From: Andrea Amorese Date: Tue, 5 Oct 2021 09:03:34 +0000 (+0200) Subject: Built motion from commit 14dbc47e.|2.5.36 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=2792b250836456cdeb41e50ef0e57f04a40badfd;p=motion2.git Built motion from commit 14dbc47e.|2.5.36 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b1d0e32..acd0c1d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-04T16:06:05.810Z", + "time": "2021-10-05T08:56:22.078Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4acaa1b..fd3f371 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-10-04T16:06:05.810Z", + "time": "2021-10-05T08:56:22.078Z", "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 c612acf..51f57db 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 _0x4434=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','STRING','contactManager','integration','motionbar','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x2ffc82,_0x4938e8){var _0x1ddef0=function(_0x8217c4){while(--_0x8217c4){_0x2ffc82['push'](_0x2ffc82['shift']());}};_0x1ddef0(++_0x4938e8);}(_0x4434,0x175));var _0x4443=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4434[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x4443('0x0')]={'name':{'type':Sequelize[_0x4443('0x1')],'get':function(_0x416689){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x4443('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4443('0x3'),_0x4443('0x4'),_0x4443('0x5'),'jscripty',_0x4443('0x6'),'browser','bot',_0x4443('0x7')]],'msg':_0x4443('0x8')}},'comment':_0x4443('0x8')},'data1':{'type':Sequelize[_0x4443('0x2')](0x1000),'comment':_0x4443('0x9')},'data2':{'type':Sequelize[_0x4443('0x2')](0x1000),'comment':_0x4443('0xa')},'data3':{'type':Sequelize[_0x4443('0x2')](0x1000),'comment':_0x4443('0xb')},'data4':{'type':Sequelize[_0x4443('0x2')](0x1000),'comments':_0x4443('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x4443('0xd')},'data6':{'type':Sequelize[_0x4443('0x2')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x4443('0xe')],'comments':_0x4443('0xf')}}; \ No newline at end of file +var _0x865e=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','STRING','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','bot','script'];(function(_0x18a6a4,_0xf3cfae){var _0x154a90=function(_0x293c2e){while(--_0x293c2e){_0x18a6a4['push'](_0x18a6a4['shift']());}};_0x154a90(++_0xf3cfae);}(_0x865e,0x6d));var _0xe865=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x865e[_0x556927];return _0x5f1235;};'use strict';var Sequelize=require(_0xe865('0x0'));module[_0xe865('0x1')]={'name':{'type':Sequelize[_0xe865('0x2')],'get':function(_0x55afa7){return this[_0xe865('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe865('0x4'),_0xe865('0x5'),_0xe865('0x6'),_0xe865('0x7'),_0xe865('0x8'),'browser',_0xe865('0x9'),_0xe865('0xa')]],'msg':_0xe865('0xb')}},'comment':_0xe865('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xe865('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xe865('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[_0xe865('0xe')](0x1000),'comments':_0xe865('0xf')},'data5':{'type':Sequelize[_0xe865('0xe')](0x1000),'comments':_0xe865('0x10')},'data6':{'type':Sequelize[_0xe865('0xe')],'comments':_0xe865('0x11')},'data7':{'type':Sequelize[_0xe865('0x12')],'comments':_0xe865('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c77bc1e..4d48ca3 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 _0xb0a7=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x19463f,_0x501f50){var _0x24021e=function(_0x1881d5){while(--_0x1881d5){_0x19463f['push'](_0x19463f['shift']());}};_0x24021e(++_0x501f50);}(_0xb0a7,0x69));var _0x7b0a=function(_0xcb5ece,_0x2d699f){_0xcb5ece=_0xcb5ece-0x0;var _0x221fcc=_0xb0a7[_0xcb5ece];return _0x221fcc;};'use strict';var emlformat=require(_0x7b0a('0x0'));var rimraf=require(_0x7b0a('0x1'));var zipdir=require(_0x7b0a('0x2'));var jsonpatch=require(_0x7b0a('0x3'));var rp=require(_0x7b0a('0x4'));var moment=require(_0x7b0a('0x5'));var BPromise=require(_0x7b0a('0x6'));var Mustache=require(_0x7b0a('0x7'));var util=require(_0x7b0a('0x8'));var path=require(_0x7b0a('0x9'));var sox=require(_0x7b0a('0xa'));var csv=require(_0x7b0a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b0a('0xc'));var _=require('lodash');var squel=require(_0x7b0a('0xd'));var crypto=require(_0x7b0a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7b0a('0xf'));var toCsv=require(_0x7b0a('0xb'));var querystring=require(_0x7b0a('0x10'));var Papa=require(_0x7b0a('0x11'));var Redis=require(_0x7b0a('0x12'));var authService=require(_0x7b0a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b0a('0x14'));var logger=require(_0x7b0a('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b0a('0x16'));var db=require(_0x7b0a('0x17'))['db'];function respondWithStatusCode(_0x183e8c,_0x2c8e0d){_0x2c8e0d=_0x2c8e0d||0xcc;return function(_0x39e7ac){if(_0x39e7ac){return _0x183e8c[_0x7b0a('0x18')](_0x2c8e0d);}return _0x183e8c[_0x7b0a('0x19')](_0x2c8e0d)['end']();};}function respondWithResult(_0x5a2bd5,_0x2f69d4){_0x2f69d4=_0x2f69d4||0xc8;return function(_0x5b846e){if(_0x5b846e){return _0x5a2bd5['status'](_0x2f69d4)[_0x7b0a('0x1a')](_0x5b846e);}};}function respondWithFilteredResult(_0x22efb8,_0xc845ef){return function(_0x47d2f4){if(_0x47d2f4){var _0x1cf30d=typeof _0xc845ef['offset']===_0x7b0a('0x1b')&&typeof _0xc845ef[_0x7b0a('0x1c')]===_0x7b0a('0x1b');var _0x13bcb2=_0x47d2f4[_0x7b0a('0x1d')];var _0x48b7f4=_0x1cf30d?0x0:_0xc845ef['offset'];var _0x22a560=_0x1cf30d?_0x47d2f4[_0x7b0a('0x1d')]:_0xc845ef['offset']+_0xc845ef[_0x7b0a('0x1c')];var _0x39682a;if(_0x22a560>=_0x13bcb2){_0x22a560=_0x13bcb2;_0x39682a=0xc8;}else{_0x39682a=0xce;}_0x22efb8[_0x7b0a('0x19')](_0x39682a);return _0x22efb8[_0x7b0a('0x1e')](_0x7b0a('0x1f'),_0x48b7f4+'-'+_0x22a560+'/'+_0x13bcb2)[_0x7b0a('0x1a')](_0x47d2f4);}return null;};}function patchUpdates(_0x459fdb){return function(_0x194198){try{jsonpatch['apply'](_0x194198,_0x459fdb,!![]);}catch(_0xf382dd){return BPromise[_0x7b0a('0x20')](_0xf382dd);}return _0x194198['save']();};}function saveUpdates(_0x3043cb,_0x28fc51){return function(_0x195f41){if(_0x195f41){return _0x195f41[_0x7b0a('0x21')](_0x3043cb)[_0x7b0a('0x22')](function(_0x549193){return _0x549193;});}return null;};}function removeEntity(_0x321bc3,_0x51f0fe){return function(_0x317ddb){if(_0x317ddb){return _0x317ddb[_0x7b0a('0x23')]()[_0x7b0a('0x22')](function(){_0x321bc3[_0x7b0a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250b38,_0x2e1e3a){return function(_0x3a0a2e){if(!_0x3a0a2e){_0x250b38[_0x7b0a('0x18')](0x194);}return _0x3a0a2e;};}function handleError(_0x4d5c07,_0x58fdc2){_0x58fdc2=_0x58fdc2||0x1f4;return function(_0x2fca59){logger['error'](_0x2fca59[_0x7b0a('0x24')]);if(_0x2fca59[_0x7b0a('0x25')]){delete _0x2fca59[_0x7b0a('0x25')];}_0x4d5c07[_0x7b0a('0x19')](_0x58fdc2)[_0x7b0a('0x26')](_0x2fca59);};}exports[_0x7b0a('0x21')]=function(_0x384224,_0x4301a6){if(_0x384224[_0x7b0a('0x27')]['id']){delete _0x384224[_0x7b0a('0x27')]['id'];}return db[_0x7b0a('0x28')]['find']({'where':{'id':_0x384224[_0x7b0a('0x29')]['id']}})[_0x7b0a('0x22')](handleEntityNotFound(_0x4301a6,null))[_0x7b0a('0x22')](saveUpdates(_0x384224[_0x7b0a('0x27')],null))[_0x7b0a('0x22')](respondWithResult(_0x4301a6,null))[_0x7b0a('0x2a')](handleError(_0x4301a6,null));};exports[_0x7b0a('0x23')]=function(_0xeb2e9b,_0x12275d){return db[_0x7b0a('0x28')][_0x7b0a('0x2b')]({'where':{'id':_0xeb2e9b[_0x7b0a('0x29')]['id']}})[_0x7b0a('0x22')](handleEntityNotFound(_0x12275d,null))['then'](removeEntity(_0x12275d,null))[_0x7b0a('0x2a')](handleError(_0x12275d,null));}; \ No newline at end of file +var _0x15db=['set','apply','reject','then','sendStatus','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count'];(function(_0x28063b,_0x6df3b2){var _0xee41a7=function(_0x2b6482){while(--_0x2b6482){_0x28063b['push'](_0x28063b['shift']());}};_0xee41a7(++_0x6df3b2);}(_0x15db,0x176));var _0xb15d=function(_0x16e9ce,_0xd5eb79){_0x16e9ce=_0x16e9ce-0x0;var _0xcdad4=_0x15db[_0x16e9ce];return _0xcdad4;};'use strict';var emlformat=require(_0xb15d('0x0'));var rimraf=require(_0xb15d('0x1'));var zipdir=require(_0xb15d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb15d('0x3'));var BPromise=require(_0xb15d('0x4'));var Mustache=require(_0xb15d('0x5'));var util=require(_0xb15d('0x6'));var path=require(_0xb15d('0x7'));var sox=require('sox');var csv=require(_0xb15d('0x8'));var ejs=require(_0xb15d('0x9'));var fs=require('fs');var fs_extra=require(_0xb15d('0xa'));var _=require(_0xb15d('0xb'));var squel=require(_0xb15d('0xc'));var crypto=require(_0xb15d('0xd'));var jsforce=require(_0xb15d('0xe'));var deskjs=require(_0xb15d('0xf'));var toCsv=require(_0xb15d('0x8'));var querystring=require(_0xb15d('0x10'));var Papa=require('papaparse');var Redis=require(_0xb15d('0x11'));var authService=require(_0xb15d('0x12'));var qs=require(_0xb15d('0x13'));var as=require(_0xb15d('0x14'));var hardwareService=require(_0xb15d('0x15'));var logger=require(_0xb15d('0x16'))(_0xb15d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb15d('0x18'))['db'];function respondWithStatusCode(_0x559b22,_0x599a56){_0x599a56=_0x599a56||0xcc;return function(_0x4566b5){if(_0x4566b5){return _0x559b22['sendStatus'](_0x599a56);}return _0x559b22[_0xb15d('0x19')](_0x599a56)['end']();};}function respondWithResult(_0x17644c,_0x1641a1){_0x1641a1=_0x1641a1||0xc8;return function(_0x4e055c){if(_0x4e055c){return _0x17644c[_0xb15d('0x19')](_0x1641a1)[_0xb15d('0x1a')](_0x4e055c);}};}function respondWithFilteredResult(_0x55c4ae,_0x89a6e6){return function(_0xb4c7ac){if(_0xb4c7ac){var _0x8c1071=typeof _0x89a6e6[_0xb15d('0x1b')]===_0xb15d('0x1c')&&typeof _0x89a6e6[_0xb15d('0x1d')]===_0xb15d('0x1c');var _0x1d45ff=_0xb4c7ac[_0xb15d('0x1e')];var _0x300c63=_0x8c1071?0x0:_0x89a6e6[_0xb15d('0x1b')];var _0x3465bf=_0x8c1071?_0xb4c7ac[_0xb15d('0x1e')]:_0x89a6e6[_0xb15d('0x1b')]+_0x89a6e6['limit'];var _0x11e3a6;if(_0x3465bf>=_0x1d45ff){_0x3465bf=_0x1d45ff;_0x11e3a6=0xc8;}else{_0x11e3a6=0xce;}_0x55c4ae[_0xb15d('0x19')](_0x11e3a6);return _0x55c4ae[_0xb15d('0x1f')]('Content-Range',_0x300c63+'-'+_0x3465bf+'/'+_0x1d45ff)['json'](_0xb4c7ac);}return null;};}function patchUpdates(_0xa26763){return function(_0x262889){try{jsonpatch[_0xb15d('0x20')](_0x262889,_0xa26763,!![]);}catch(_0x3f20d3){return BPromise[_0xb15d('0x21')](_0x3f20d3);}return _0x262889['save']();};}function saveUpdates(_0x429fd8,_0x4c1946){return function(_0x44d8b5){if(_0x44d8b5){return _0x44d8b5['update'](_0x429fd8)[_0xb15d('0x22')](function(_0x2fbbdf){return _0x2fbbdf;});}return null;};}function removeEntity(_0x324da3,_0x3e7cc2){return function(_0x140673){if(_0x140673){return _0x140673['destroy']()[_0xb15d('0x22')](function(){_0x324da3[_0xb15d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bea4a,_0x369e4b){return function(_0x52b67d){if(!_0x52b67d){_0x5bea4a[_0xb15d('0x23')](0x194);}return _0x52b67d;};}function handleError(_0x1eec02,_0x77832d){_0x77832d=_0x77832d||0x1f4;return function(_0x1e0dd0){logger[_0xb15d('0x24')](_0x1e0dd0[_0xb15d('0x25')]);if(_0x1e0dd0[_0xb15d('0x26')]){delete _0x1e0dd0[_0xb15d('0x26')];}_0x1eec02[_0xb15d('0x19')](_0x77832d)[_0xb15d('0x27')](_0x1e0dd0);};}exports['update']=function(_0x2d40fa,_0x1696ea){if(_0x2d40fa['body']['id']){delete _0x2d40fa[_0xb15d('0x28')]['id'];}return db[_0xb15d('0x29')][_0xb15d('0x2a')]({'where':{'id':_0x2d40fa[_0xb15d('0x2b')]['id']}})[_0xb15d('0x22')](handleEntityNotFound(_0x1696ea,null))['then'](saveUpdates(_0x2d40fa[_0xb15d('0x28')],null))[_0xb15d('0x22')](respondWithResult(_0x1696ea,null))['catch'](handleError(_0x1696ea,null));};exports['destroy']=function(_0x1c9da8,_0x42ae66){return db['Action'][_0xb15d('0x2a')]({'where':{'id':_0x1c9da8['params']['id']}})[_0xb15d('0x22')](handleEntityNotFound(_0x42ae66,null))['then'](removeEntity(_0x42ae66,null))[_0xb15d('0x2c')](handleError(_0x42ae66,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index b7821e8..fd5a5a8 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 _0x8156=['./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x192d21,_0xa50541){var _0x18d6f0=function(_0x3a317b){while(--_0x3a317b){_0x192d21['push'](_0x192d21['shift']());}};_0x18d6f0(++_0xa50541);}(_0x8156,0xad));var _0x6815=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8156[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x6815('0x0'));var logger=require(_0x6815('0x1'))(_0x6815('0x2'));var moment=require(_0x6815('0x3'));var BPromise=require(_0x6815('0x4'));var rp=require(_0x6815('0x5'));var fs=require('fs');var path=require(_0x6815('0x6'));var rimraf=require(_0x6815('0x7'));var config=require(_0x6815('0x8'));var attributes=require(_0x6815('0x9'));module[_0x6815('0xa')]=function(_0xcf7396,_0x41f17f){return _0xcf7396[_0x6815('0xb')](_0x6815('0xc'),attributes,{'tableName':_0x6815('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0053=['tools_actions','util','../../config/logger','api','moment','request-promise','rimraf','./action.attributes','define','Action'];(function(_0x1b1d5d,_0x159e42){var _0x58468a=function(_0x5ca7cd){while(--_0x5ca7cd){_0x1b1d5d['push'](_0x1b1d5d['shift']());}};_0x58468a(++_0x159e42);}(_0x0053,0x14b));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3005('0x0'));var logger=require(_0x3005('0x1'))(_0x3005('0x2'));var moment=require(_0x3005('0x3'));var BPromise=require('bluebird');var rp=require(_0x3005('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3005('0x5'));var config=require('../../config/environment');var attributes=require(_0x3005('0x6'));module['exports']=function(_0x17c82a,_0x3c6aa2){return _0x17c82a[_0x3005('0x7')](_0x3005('0x8'),attributes,{'tableName':_0x3005('0x9'),'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 bb80c7b..e2bf295 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x814b,0x1a2));var _0xb814=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x814b[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 090e724..5e688a7 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 _0x203a=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x203a,0x161));var _0xa203=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x203a[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0xa203('0x0'));var path=require(_0xa203('0x1'));var timeout=require(_0xa203('0x2'));var express=require(_0xa203('0x3'));var router=express['Router']();var fs_extra=require(_0xa203('0x4'));var auth=require(_0xa203('0x5'));var interaction=require(_0xa203('0x6'));var config=require(_0xa203('0x7'));var controller=require(_0xa203('0x8'));router[_0xa203('0x9')](_0xa203('0xa'),auth['isAuthenticated'](),controller[_0xa203('0xb')]);router[_0xa203('0xc')](_0xa203('0xa'),auth[_0xa203('0xd')](),controller[_0xa203('0xe')]);module[_0xa203('0xf')]=router; \ No newline at end of file +var _0xa89f=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer','util'];(function(_0x22bd7a,_0x3d22f0){var _0x39cc73=function(_0x32f09f){while(--_0x32f09f){_0x22bd7a['push'](_0x22bd7a['shift']());}};_0x39cc73(++_0x3d22f0);}(_0xa89f,0x1a2));var _0xfa89=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0xa89f[_0x3d13bb];return _0x4b5a1b;};'use strict';var multer=require(_0xfa89('0x0'));var util=require(_0xfa89('0x1'));var path=require(_0xfa89('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa89('0x3')]();var fs_extra=require(_0xfa89('0x4'));var auth=require(_0xfa89('0x5'));var interaction=require(_0xfa89('0x6'));var config=require(_0xfa89('0x7'));var controller=require(_0xfa89('0x8'));router['put'](_0xfa89('0x9'),auth[_0xfa89('0xa')](),controller[_0xfa89('0xb')]);router[_0xfa89('0xc')](_0xfa89('0x9'),auth[_0xfa89('0xa')](),controller[_0xfa89('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 58a8eb6..0be2cbe 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0x5075,0x73));var _0x5507=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0x5075[_0x1f1837];return _0x25ab57;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0xd63b06,_0x34850f){var _0x343035=function(_0x17f681){while(--_0x17f681){_0xd63b06['push'](_0xd63b06['shift']());}};_0x343035(++_0x34850f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x24ca[_0x402c8f];return _0x11e809;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 7151c39..fd5a925 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 _0x8592=['metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','name','right_join','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','getFields','clone','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','SELECT','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','includeAll','include','catch','show','params','keys','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','merge','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId'];(function(_0x2da402,_0x14a691){var _0x31a57d=function(_0x3cfb60){while(--_0x3cfb60){_0x2da402['push'](_0x2da402['shift']());}};_0x31a57d(++_0x14a691);}(_0x8592,0xd5));var _0x2859=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x8592[_0x207a02];return _0xd995c3;};'use strict';var emlformat=require(_0x2859('0x0'));var rimraf=require(_0x2859('0x1'));var zipdir=require(_0x2859('0x2'));var jsonpatch=require(_0x2859('0x3'));var rp=require(_0x2859('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2859('0x5'));var util=require(_0x2859('0x6'));var path=require(_0x2859('0x7'));var sox=require(_0x2859('0x8'));var csv=require(_0x2859('0x9'));var ejs=require(_0x2859('0xa'));var fs=require('fs');var fs_extra=require(_0x2859('0xb'));var _=require(_0x2859('0xc'));var squel=require('squel');var crypto=require(_0x2859('0xd'));var jsforce=require(_0x2859('0xe'));var deskjs=require(_0x2859('0xf'));var toCsv=require(_0x2859('0x9'));var querystring=require(_0x2859('0x10'));var Papa=require(_0x2859('0x11'));var Redis=require(_0x2859('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2859('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2859('0x14'));var logger=require(_0x2859('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2859('0x16'));var db=require(_0x2859('0x17'))['db'];var dbH=require(_0x2859('0x17'))[_0x2859('0x18')];function respondWithStatusCode(_0x3155c8,_0xeef6f){_0xeef6f=_0xeef6f||0xcc;return function(_0x32e53f){if(_0x32e53f){return _0x3155c8[_0x2859('0x19')](_0xeef6f);}return _0x3155c8['status'](_0xeef6f)[_0x2859('0x1a')]();};}function respondWithResult(_0x14426c,_0x2ab3dc){_0x2ab3dc=_0x2ab3dc||0xc8;return function(_0x1bf983){if(_0x1bf983){return _0x14426c['status'](_0x2ab3dc)[_0x2859('0x1b')](_0x1bf983);}};}function respondWithFilteredResult(_0x160b9b,_0x33894c){return function(_0x3e3c83){if(_0x3e3c83){var _0x3bd5c4=typeof _0x33894c[_0x2859('0x1c')]==='undefined'&&typeof _0x33894c[_0x2859('0x1d')]==='undefined';var _0x89f4a6=_0x3e3c83[_0x2859('0x1e')];var _0x2a7ec0=_0x3bd5c4?0x0:_0x33894c[_0x2859('0x1c')];var _0x1287d0=_0x3bd5c4?_0x3e3c83[_0x2859('0x1e')]:_0x33894c['offset']+_0x33894c[_0x2859('0x1d')];var _0x427b6a;if(_0x1287d0>=_0x89f4a6){_0x1287d0=_0x89f4a6;_0x427b6a=0xc8;}else{_0x427b6a=0xce;}_0x160b9b[_0x2859('0x1f')](_0x427b6a);return _0x160b9b[_0x2859('0x20')](_0x2859('0x21'),_0x2a7ec0+'-'+_0x1287d0+'/'+_0x89f4a6)[_0x2859('0x1b')](_0x3e3c83);}return null;};}function patchUpdates(_0x272930){return function(_0x2cced2){try{jsonpatch[_0x2859('0x22')](_0x2cced2,_0x272930,!![]);}catch(_0x3a4019){return BPromise[_0x2859('0x23')](_0x3a4019);}return _0x2cced2[_0x2859('0x24')]();};}function saveUpdates(_0x34c30b,_0x560124){return function(_0x1b2a50){if(_0x1b2a50){return _0x1b2a50[_0x2859('0x25')](_0x34c30b)[_0x2859('0x26')](function(_0x16bb07){return _0x16bb07;});}return null;};}function removeEntity(_0x2b213a,_0x6fc930){return function(_0x2fd4c6){if(_0x2fd4c6){return _0x2fd4c6[_0x2859('0x27')]()[_0x2859('0x26')](function(){var _0x1652f7=_0x2fd4c6[_0x2859('0x28')]({'plain':!![]});var _0xd75a60=_0x2859('0x29');return db[_0x2859('0x2a')][_0x2859('0x27')]({'where':{'type':_0xd75a60,'resourceId':_0x1652f7['id']}})['then'](function(){return _0x2fd4c6;});})[_0x2859('0x26')](function(){_0x2b213a[_0x2859('0x1f')](0xcc)[_0x2859('0x1a')]();});}};}function handleEntityNotFound(_0x3f74ad,_0x55ae79){return function(_0x1a066e){if(!_0x1a066e){_0x3f74ad['sendStatus'](0x194);}return _0x1a066e;};}function handleError(_0xe501f3,_0x80ab91){_0x80ab91=_0x80ab91||0x1f4;return function(_0x103a41){logger[_0x2859('0x2b')](_0x103a41['stack']);if(_0x103a41['name']){delete _0x103a41['name'];}_0xe501f3[_0x2859('0x1f')](_0x80ab91)[_0x2859('0x2c')](_0x103a41);};}exports[_0x2859('0x2d')]=function(_0x557b8a,_0xcccc58){var _0x250759={},_0x2cec8a={},_0x2b26e5={'count':0x0,'rows':[]};var _0x1721db=_[_0x2859('0x2e')](db[_0x2859('0x2f')][_0x2859('0x30')],function(_0x556492){return{'name':_0x556492[_0x2859('0x31')],'type':_0x556492[_0x2859('0x32')][_0x2859('0x33')]};});_0x2cec8a[_0x2859('0x34')]=_[_0x2859('0x2e')](_0x1721db,'name');_0x2cec8a['query']=_['keys'](_0x557b8a[_0x2859('0x35')]);_0x2cec8a[_0x2859('0x36')]=_[_0x2859('0x37')](_0x2cec8a[_0x2859('0x34')],_0x2cec8a[_0x2859('0x35')]);_0x250759[_0x2859('0x38')]=_['intersection'](_0x2cec8a['model'],qs['fields'](_0x557b8a[_0x2859('0x35')][_0x2859('0x39')]));_0x250759[_0x2859('0x38')]=_0x250759[_0x2859('0x38')][_0x2859('0x3a')]?_0x250759[_0x2859('0x38')]:_0x2cec8a[_0x2859('0x34')];if(!_0x557b8a[_0x2859('0x35')]['hasOwnProperty']('nolimit')){_0x250759[_0x2859('0x1d')]=qs[_0x2859('0x1d')](_0x557b8a['query'][_0x2859('0x1d')]);_0x250759[_0x2859('0x1c')]=qs[_0x2859('0x1c')](_0x557b8a[_0x2859('0x35')][_0x2859('0x1c')]);}_0x250759[_0x2859('0x3b')]=qs['sort'](_0x557b8a[_0x2859('0x35')][_0x2859('0x3c')]);_0x250759[_0x2859('0x3d')]=qs[_0x2859('0x36')](_['pick'](_0x557b8a['query'],_0x2cec8a[_0x2859('0x36')]),_0x1721db);if(_0x557b8a[_0x2859('0x35')][_0x2859('0x3e')]){_0x250759[_0x2859('0x3d')]=_['merge'](_0x250759[_0x2859('0x3d')],{'$or':_[_0x2859('0x2e')](_0x1721db,function(_0x2bcb76){if(_0x2bcb76[_0x2859('0x32')]!==_0x2859('0x3f')){var _0x964b92={};_0x964b92[_0x2bcb76['name']]={'$like':'%'+_0x557b8a[_0x2859('0x35')][_0x2859('0x3e')]+'%'};return _0x964b92;}})});}_0x250759=_['merge']({},_0x250759,_0x557b8a['options']);var _0x2eec15={'where':_0x250759[_0x2859('0x3d')]};return db[_0x2859('0x2f')][_0x2859('0x1e')](_0x2eec15)['then'](function(_0x165b01){_0x2b26e5[_0x2859('0x1e')]=_0x165b01;if(_0x557b8a[_0x2859('0x35')][_0x2859('0x40')]){_0x250759[_0x2859('0x41')]=[{'all':!![]}];}return db[_0x2859('0x2f')]['findAll'](_0x250759);})[_0x2859('0x26')](function(_0x51b10b){_0x2b26e5['rows']=_0x51b10b;return _0x2b26e5;})[_0x2859('0x26')](respondWithFilteredResult(_0xcccc58,_0x250759))[_0x2859('0x42')](handleError(_0xcccc58,null));};exports[_0x2859('0x43')]=function(_0x1cd982,_0x869d88){var _0x45d6a4={'raw':![],'where':{'id':_0x1cd982[_0x2859('0x44')]['id']}},_0x19b0c7={};_0x19b0c7[_0x2859('0x34')]=_[_0x2859('0x45')](db[_0x2859('0x2f')][_0x2859('0x30')]);_0x19b0c7[_0x2859('0x35')]=_['keys'](_0x1cd982[_0x2859('0x35')]);_0x19b0c7[_0x2859('0x36')]=_[_0x2859('0x37')](_0x19b0c7[_0x2859('0x34')],_0x19b0c7['query']);_0x45d6a4[_0x2859('0x38')]=_[_0x2859('0x37')](_0x19b0c7[_0x2859('0x34')],qs[_0x2859('0x39')](_0x1cd982[_0x2859('0x35')][_0x2859('0x39')]));_0x45d6a4[_0x2859('0x38')]=_0x45d6a4[_0x2859('0x38')][_0x2859('0x3a')]?_0x45d6a4[_0x2859('0x38')]:_0x19b0c7['model'];if(_0x1cd982[_0x2859('0x35')][_0x2859('0x40')]){_0x45d6a4[_0x2859('0x41')]=[{'all':!![]}];}_0x45d6a4=_['merge']({},_0x45d6a4,_0x1cd982[_0x2859('0x46')]);return db[_0x2859('0x2f')][_0x2859('0x47')](_0x45d6a4)['then'](handleEntityNotFound(_0x869d88,null))[_0x2859('0x26')](respondWithResult(_0x869d88,null))[_0x2859('0x42')](handleError(_0x869d88,null));};exports[_0x2859('0x48')]=function(_0x7b8c04,_0x14ae22){return db[_0x2859('0x2f')]['create'](_0x7b8c04['body'],{})[_0x2859('0x26')](function(_0x5a71e5){var _0x48fc29=_0x7b8c04['user'][_0x2859('0x28')]({'plain':!![]});if(!_0x48fc29)throw new Error(_0x2859('0x49'));if(_0x48fc29['role']===_0x2859('0x4a')){var _0x90de85=_0x5a71e5[_0x2859('0x28')]({'plain':!![]});var _0x30a9b9=_0x2859('0x4b');return db[_0x2859('0x4c')]['find']({'where':{'name':_0x30a9b9,'userProfileId':_0x48fc29[_0x2859('0x4d')]},'raw':!![]})[_0x2859('0x26')](function(_0x469ec7){if(_0x469ec7&&_0x469ec7[_0x2859('0x4e')]===0x0){return db['UserProfileResource'][_0x2859('0x48')]({'name':_0x90de85['name'],'resourceId':_0x90de85['id'],'type':'CustomReports','sectionId':_0x469ec7['id']},{})[_0x2859('0x26')](function(){return _0x5a71e5;});}else{return _0x5a71e5;}})[_0x2859('0x42')](function(_0x18f6ef){logger[_0x2859('0x2b')](_0x2859('0x4f'),_0x18f6ef);throw _0x18f6ef;});}return _0x5a71e5;})[_0x2859('0x26')](respondWithResult(_0x14ae22,0xc9))['catch'](handleError(_0x14ae22,null));};exports['update']=function(_0xb02f58,_0x41fb0d){if(_0xb02f58['body']['id']){delete _0xb02f58[_0x2859('0x50')]['id'];}return db[_0x2859('0x2f')][_0x2859('0x47')]({'where':{'id':_0xb02f58[_0x2859('0x44')]['id']}})[_0x2859('0x26')](handleEntityNotFound(_0x41fb0d,null))[_0x2859('0x26')](saveUpdates(_0xb02f58[_0x2859('0x50')],null))['then'](respondWithResult(_0x41fb0d,null))['catch'](handleError(_0x41fb0d,null));};exports[_0x2859('0x27')]=function(_0xaf6106,_0x12ec55){return db[_0x2859('0x2f')][_0x2859('0x47')]({'where':{'id':_0xaf6106[_0x2859('0x44')]['id']}})[_0x2859('0x26')](handleEntityNotFound(_0x12ec55,null))[_0x2859('0x26')](removeEntity(_0x12ec55,null))[_0x2859('0x42')](handleError(_0x12ec55,null));};exports[_0x2859('0x51')]=function(_0x368e9b,_0x185dea){var _0x534b0e=0xa;var _0x10eb18=[_0x2859('0x52'),'left_join','right_join',_0x2859('0x53')];var _0x34e783={'SUM':_0x2859('0x54'),'COUNT':_0x2859('0x55'),'COUNT DISTINCT':_0x2859('0x56'),'MAX':_0x2859('0x57'),'MIN':_0x2859('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2859('0x59'),'GROUP_CONCAT DESC':_0x2859('0x5a')};var _0x114d38={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2859('0x5b'),'HOUR':_0x2859('0x5c'),'ROUND':_0x2859('0x5d'),'UNIX_TIMESTAMP':_0x2859('0x5e')};var _0x2555e0=function(_0x59515a){return!_[_0x2859('0x5f')]([_0x2859('0x60'),_0x2859('0x61'),_0x2859('0x62'),_0x2859('0x63')],_0x59515a);};var _0x35d92e=function(_0x4f3940){if(!_0x4f3940||!_0x4f3940[_0x2859('0x64')][_0x2859('0x3a')]){return'';}for(var _0x4cc54a='(',_0x3d390f=0x0;_0x3d390f<_0x4f3940[_0x2859('0x64')]['length'];_0x3d390f+=0x1){_0x3d390f>0x0&&(_0x4cc54a+='\x20'+_0x4f3940['operator']+'\x20');_0x4cc54a+=_0x4f3940['rules'][_0x3d390f]['group']?_0x35d92e(_0x4f3940[_0x2859('0x64')][_0x3d390f][_0x2859('0x65')]):_0x4f3940['rules'][_0x3d390f]['field']+'\x20'+_0x4f3940[_0x2859('0x64')][_0x3d390f][_0x2859('0x66')]+(_0x2555e0(_0x4f3940['rules'][_0x3d390f][_0x2859('0x66')])?'\x20'+_0x4f3940[_0x2859('0x64')][_0x3d390f][_0x2859('0x67')]:'');}return _0x4cc54a+')';};var _0x18ab39={'where':{'id':_0x368e9b[_0x2859('0x44')]['id']}},_0x4cd1e2,_0x5eac74,_0x377c8d,_0x2a71cb,_0x2eded0;_0x18ab39=_[_0x2859('0x68')]({},_0x18ab39,_0x368e9b[_0x2859('0x46')]);return db['AnalyticCustomReport']['find'](_0x18ab39)[_0x2859('0x26')](function(_0x3b2083){if(_0x3b2083){_0x4cd1e2=_0x3b2083;return _0x3b2083['getFields']();}return null;})[_0x2859('0x26')](function(_0x521b1c){if(_0x521b1c){if(!_0x521b1c[_0x2859('0x3a')]){throw new db[(_0x2859('0x69'))][(_0x2859('0x6a'))](_0x2859('0x6b'),0x193);}_0x5eac74=_0x521b1c;return db[_0x2859('0x6c')][_0x2859('0x6d')]({'raw':!![]});}return null;})[_0x2859('0x26')](function(_0x3a8d76){if(_0x3a8d76){_0x377c8d=_[_0x2859('0x6e')](_0x3a8d76,'id');var _0x49ca0d;var _0x291341=squel[_0x2859('0x6f')]();_0x291341[_0x2859('0x70')](_0x4cd1e2[_0x2859('0x71')]);for(var _0x1aaac2=0x0;_0x1aaac2<_0x5eac74[_0x2859('0x3a')];_0x1aaac2+=0x1){_0x49ca0d=_0x5eac74[_0x1aaac2][_0x2859('0x72')]?_0x377c8d[_0x5eac74[_0x1aaac2][_0x2859('0x72')]][_0x2859('0x73')]:_0x5eac74[_0x1aaac2][_0x2859('0x74')];_0x49ca0d=_0x5eac74[_0x1aaac2][_0x2859('0x75')]?_[_0x2859('0x76')](_0x34e783[_0x5eac74[_0x1aaac2][_0x2859('0x75')]],'%s',_0x49ca0d):_0x49ca0d;_0x49ca0d=_0x5eac74[_0x1aaac2][_0x2859('0x77')]?_[_0x2859('0x76')](_0x114d38[_0x5eac74[_0x1aaac2][_0x2859('0x77')]],'%s',_0x49ca0d):_0x49ca0d;if(_0x5eac74[_0x1aaac2][_0x2859('0x78')]){_0x291341[_0x2859('0x65')](_0x49ca0d);}_0x5eac74[_0x1aaac2][_0x2859('0x79')]&&_0x291341[_0x2859('0x3b')](_0x49ca0d,_0x5eac74[_0x1aaac2][_0x2859('0x79')]===_0x2859('0x7a')?![]:!![]);_0x291341[_0x2859('0x74')](_0x49ca0d,_0x5eac74[_0x1aaac2][_0x2859('0x7b')]||_0x49ca0d);}if(_0x4cd1e2[_0x2859('0x7c')]){_0x4cd1e2['joins']=JSON[_0x2859('0x7d')](_0x4cd1e2[_0x2859('0x7c')]);for(var _0xca7b8c=0x0;_0xca7b8c<_0x4cd1e2['joins'][_0x2859('0x3a')];_0xca7b8c+=0x1){if(_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c][_0x2859('0x32')]&&_[_0x2859('0x5f')](_0x10eb18,_0x4cd1e2['joins'][_0xca7b8c]['type'])&&_0x4cd1e2['joins'][_0xca7b8c]['parentKey']&&_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c]['foreignTable']&&_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c][_0x2859('0x7e')]){_0x291341[_0x4cd1e2['joins'][_0xca7b8c][_0x2859('0x32')]](_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c][_0x2859('0x7f')],null,util['format'](_0x2859('0x80'),_0x4cd1e2['table'],_0x4cd1e2['joins'][_0xca7b8c][_0x2859('0x81')],_0x4cd1e2['joins'][_0xca7b8c][_0x2859('0x7f')],_0x4cd1e2[_0x2859('0x7c')][_0xca7b8c]['foreignKey']));}}}if(_0x4cd1e2['conditions']){_0x4cd1e2[_0x2859('0x82')]=JSON[_0x2859('0x7d')](_0x4cd1e2[_0x2859('0x82')]);_0x291341['where'](_0x35d92e(_0x4cd1e2[_0x2859('0x82')][_0x2859('0x65')]));}_0x2eded0=_0x291341['clone']();_0x291341[_0x2859('0x1d')](_0x534b0e);_0x291341['offset'](0x0);logger[_0x2859('0x83')](_0x2859('0x84'),_0x291341['toString']());return dbH[_0x2859('0x85')]['query'](_0x291341[_0x2859('0x86')](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')]['SELECT']});}})[_0x2859('0x26')](respondWithResult(_0x185dea,null))['catch'](handleError(_0x185dea,null));};function runReport(_0x2ed25e,_0x2e5605,_0x5b0e31){var _0xbf88d7=_0x2e5605[_0x2859('0x88')];var _0x24678d=0xa;var _0x3b18ec=[_0x2859('0x52'),'left_join',_0x2859('0x89'),_0x2859('0x53')];var _0x19a136={'SUM':_0x2859('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x2859('0x58'),'AVG':_0x2859('0x8a'),'GROUP_CONCAT':_0x2859('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2859('0x5a')};var _0x962ddc={'SEC_TO_TIME':_0x2859('0x8c'),'DATE':_0x2859('0x5b'),'HOUR':_0x2859('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24bd9f=function(_0x1d5056){return!_[_0x2859('0x5f')]([_0x2859('0x60'),_0x2859('0x61'),_0x2859('0x62'),_0x2859('0x63')],_0x1d5056);};var _0x5c6511=function(_0x18576b){if(!_0x18576b||!_0x18576b['rules'][_0x2859('0x3a')]){return'';}for(var _0x52ba6a='(',_0x55638f=0x0;_0x55638f<_0x18576b['rules'][_0x2859('0x3a')];_0x55638f+=0x1){_0x55638f>0x0&&(_0x52ba6a+='\x20'+_0x18576b['operator']+'\x20');_0x52ba6a+=_0x18576b[_0x2859('0x64')][_0x55638f]['group']?_0x5c6511(_0x18576b[_0x2859('0x64')][_0x55638f]['group']):_0x18576b[_0x2859('0x64')][_0x55638f][_0x2859('0x74')]+'\x20'+_0x18576b[_0x2859('0x64')][_0x55638f][_0x2859('0x66')]+(_0x24bd9f(_0x18576b[_0x2859('0x64')][_0x55638f][_0x2859('0x66')])?'\x20'+_0x18576b['rules'][_0x55638f][_0x2859('0x67')]:'');}return _0x52ba6a+')';};var _0x2761d9={'where':{'id':_0x2ed25e['id']}},_0x4df1da,_0x3842ae,_0x5be7f8,_0x203f4d,_0x4331b4;_0x2761d9=_[_0x2859('0x68')]({},_0x2761d9,_0x5b0e31);return db['AnalyticCustomReport'][_0x2859('0x47')](_0x2761d9)['then'](function(_0x40348f){if(_0x40348f){_0x4df1da=_0x40348f;return _0x40348f[_0x2859('0x8d')]();}return null;})[_0x2859('0x26')](function(_0x43c6ee){if(_0x43c6ee){if(!_0x43c6ee['length']){throw new db['Sequelize'][(_0x2859('0x6a'))](_0x2859('0x6b'),0x193);}_0x3842ae=_0x43c6ee;return db[_0x2859('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x46dbc5){if(_0x46dbc5){_0x5be7f8=_['keyBy'](_0x46dbc5,'id');var _0x61a35e;var _0x398ee4=squel[_0x2859('0x6f')]();_0x398ee4[_0x2859('0x70')](_0x4df1da[_0x2859('0x71')]);for(var _0x5957ee=0x0;_0x5957ee<_0x3842ae[_0x2859('0x3a')];_0x5957ee+=0x1){_0x61a35e=_0x3842ae[_0x5957ee]['MetricId']?_0x5be7f8[_0x3842ae[_0x5957ee][_0x2859('0x72')]][_0x2859('0x73')]:_0x3842ae[_0x5957ee]['field'];_0x61a35e=_0x3842ae[_0x5957ee][_0x2859('0x75')]?_[_0x2859('0x76')](_0x19a136[_0x3842ae[_0x5957ee]['function']],'%s',_0x61a35e):_0x61a35e;_0x61a35e=_0x3842ae[_0x5957ee][_0x2859('0x77')]?_[_0x2859('0x76')](_0x962ddc[_0x3842ae[_0x5957ee][_0x2859('0x77')]],'%s',_0x61a35e):_0x61a35e;if(_0x3842ae[_0x5957ee]['groupBy']){_0x398ee4[_0x2859('0x65')](_0x61a35e);}_0x3842ae[_0x5957ee][_0x2859('0x79')]&&_0x398ee4[_0x2859('0x3b')](_0x61a35e,_0x3842ae[_0x5957ee][_0x2859('0x79')]===_0x2859('0x7a')?![]:!![]);_0x398ee4[_0x2859('0x74')](_0x61a35e,_0x3842ae[_0x5957ee][_0x2859('0x7b')]||_0x61a35e);}if(_0x4df1da[_0x2859('0x7c')]){_0x4df1da['joins']=JSON[_0x2859('0x7d')](_0x4df1da[_0x2859('0x7c')]);for(var _0x162391=0x0;_0x162391<_0x4df1da[_0x2859('0x7c')][_0x2859('0x3a')];_0x162391+=0x1){if(_0x4df1da[_0x2859('0x7c')][_0x162391]['type']&&_['includes'](_0x3b18ec,_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x32')])&&_0x4df1da['joins'][_0x162391][_0x2859('0x81')]&&_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7f')]&&_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7e')]){_0x398ee4[_0x4df1da[_0x2859('0x7c')][_0x162391]['type']](_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7f')],null,util['format'](_0x2859('0x80'),_0x4df1da[_0x2859('0x71')],_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x81')],_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7f')],_0x4df1da[_0x2859('0x7c')][_0x162391][_0x2859('0x7e')]));}}}if(_0x4df1da[_0x2859('0x82')]){_0x4df1da['conditions']=JSON['parse'](_0x4df1da[_0x2859('0x82')]);_0x398ee4[_0x2859('0x3d')](_0x5c6511(_0x4df1da[_0x2859('0x82')][_0x2859('0x65')]));}_0x4331b4=_0x398ee4[_0x2859('0x8e')]();_0x398ee4[_0x2859('0x1d')](_0x24678d);_0x398ee4[_0x2859('0x1c')](0x0);return;}})['then'](function(){if(_0x2e5605[_0x2859('0x8f')]===_0x2859('0x90')){return null;}var _0x40b7f7=_[_0x2859('0x68')](_0x2e5605,{'name':_0x2e5605['fullPath']||_0x2e5605['name']||_0x4df1da[_0x2859('0x88')],'basename':_0xbf88d7,'savename':util['format']('%s-%s.%s',_0x2e5605[_0x2859('0x88')]||_0x4df1da[_0x2859('0x88')],require(_0x2859('0x91'))[_0x2859('0x92')](0x4),_0x2e5605[_0x2859('0x8f')]||_0x2859('0x93')),'reportId':_0x4df1da['id'],'reportType':_0x2859('0x94')});return db[_0x2859('0x95')][_0x2859('0x48')](_0x40b7f7,{'raw':!![]});})[_0x2859('0x26')](function(_0x927af6){if(_0x4df1da[_0x2859('0x71')]===_0x2859('0x96')){_0x4331b4[_0x2859('0x3d')](_0x4df1da['table']+_0x2859('0x97'),_0x2e5605[_0x2859('0x98')],_0x2e5605[_0x2859('0x99')]);}else{_0x4331b4[_0x2859('0x3d')](_0x4df1da[_0x2859('0x71')]+_0x2859('0x9a'),_0x2e5605[_0x2859('0x98')],_0x2e5605[_0x2859('0x99')]);}if(_0x927af6){logger[_0x2859('0x9b')](_0x2859('0x9c'),_0x4331b4[_0x2859('0x86')]());require(_0x2859('0x9d'))[_0x2859('0x9e')](path[_0x2859('0x52')](__dirname,_0x2859('0x9f'),_0x927af6[_0x2859('0x8f')]),[_0x927af6['id'],_0x4331b4[_0x2859('0x86')](),path[_0x2859('0x52')](__dirname,_0x2859('0xa0'),_0x927af6['savename']),_0xbf88d7]);return _0x927af6;}else{var _0x5a35ab=squel[_0x2859('0x6f')]();_0x5a35ab[_0x2859('0x70')]('('+_0x4331b4[_0x2859('0x86')]()+')','countTable');_0x5a35ab[_0x2859('0x74')](_0x2859('0xa1'),_0x2859('0x1e'));_0x4331b4[_0x2859('0x1d')](_0x2e5605[_0x2859('0x1d')]||_0x24678d);_0x4331b4[_0x2859('0x1c')](_0x2e5605[_0x2859('0x1c')]||0x0);return dbH[_0x2859('0x85')][_0x2859('0x35')](_0x5a35ab['toString'](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')]['SELECT']})[_0x2859('0x26')](function(_0x44d278){if(!_0x44d278[_0x2859('0x3a')]){_0x203f4d=0x0;}else{_0x203f4d=_0x44d278[0x0][_0x2859('0x1e')]||0x0;}return dbH[_0x2859('0x85')][_0x2859('0x35')](_0x4331b4[_0x2859('0x86')](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')][_0x2859('0xa2')]});})[_0x2859('0x26')](function(_0x48112e){return{'rows':_0x48112e||[],'count':_0x203f4d};});}});}exports['run']=function(_0x565301,_0x1218c2){return runReport(_0x565301[_0x2859('0x44')],_0x565301[_0x2859('0x35')],_0x565301[_0x2859('0x46')])[_0x2859('0x26')](respondWithResult(_0x1218c2,null))['catch'](handleError(_0x1218c2,null));};exports[_0x2859('0xa3')]=runReport;exports[_0x2859('0x35')]=function(_0x4eab39,_0x2def26){var _0x13955a=0xa;var _0x3cdd34=['join','left_join',_0x2859('0x89'),'cross_join'];var _0x21c54f={'SUM':'SUM(%s)','COUNT':_0x2859('0x55'),'COUNT DISTINCT':_0x2859('0x56'),'MAX':_0x2859('0x57'),'MIN':_0x2859('0x58'),'AVG':_0x2859('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2859('0x59'),'GROUP_CONCAT DESC':_0x2859('0x5a')};var _0x41387b={'SEC_TO_TIME':_0x2859('0x8c'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2859('0x5e')};var _0x3c3772=function(_0x527926){return!_[_0x2859('0x5f')]([_0x2859('0x60'),_0x2859('0x61'),_0x2859('0x62'),'IS\x20NOT\x20EMPTY'],_0x527926);};var _0x106cd2=function(_0x31145d){if(!_0x31145d||!_0x31145d['rules'][_0x2859('0x3a')]){return'';}for(var _0x1c6931='(',_0x13ab2f=0x0;_0x13ab2f<_0x31145d[_0x2859('0x64')]['length'];_0x13ab2f+=0x1){_0x13ab2f>0x0&&(_0x1c6931+='\x20'+_0x31145d['operator']+'\x20');_0x1c6931+=_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x65')]?_0x106cd2(_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x65')]):_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x74')]+'\x20'+_0x31145d['rules'][_0x13ab2f][_0x2859('0x66')]+(_0x3c3772(_0x31145d['rules'][_0x13ab2f][_0x2859('0x66')])?'\x20'+_0x31145d[_0x2859('0x64')][_0x13ab2f][_0x2859('0x67')]:'');}return _0x1c6931+')';};var _0x782a97={'where':{'id':_0x4eab39[_0x2859('0x44')]['id']}},_0x2eb99a,_0x5108a5,_0x477a28,_0x104ab2,_0xeea1a9;_0x782a97=_[_0x2859('0x68')]({},_0x782a97,_0x4eab39['options']);return db[_0x2859('0x2f')][_0x2859('0x47')](_0x782a97)[_0x2859('0x26')](function(_0x1bcdb7){if(_0x1bcdb7){_0x2eb99a=_0x1bcdb7;return _0x1bcdb7['getFields']();}return null;})['then'](function(_0x27712f){if(_0x27712f){if(!_0x27712f[_0x2859('0x3a')]){throw new db[(_0x2859('0x69'))][(_0x2859('0x6a'))](_0x2859('0x6b'),0x193);}_0x5108a5=_0x27712f;return db['AnalyticMetric'][_0x2859('0x6d')]({'raw':!![]});}return null;})['then'](function(_0x3f3bb6){if(_0x3f3bb6){_0x477a28=_[_0x2859('0x6e')](_0x3f3bb6,'id');var _0x169a49;var _0x54d94a=squel[_0x2859('0x6f')]();_0x54d94a[_0x2859('0x70')](_0x2eb99a[_0x2859('0x71')]);for(var _0x34dc7b=0x0;_0x34dc7b<_0x5108a5[_0x2859('0x3a')];_0x34dc7b+=0x1){_0x169a49=_0x5108a5[_0x34dc7b][_0x2859('0x72')]?_0x477a28[_0x5108a5[_0x34dc7b][_0x2859('0x72')]][_0x2859('0x73')]:_0x5108a5[_0x34dc7b][_0x2859('0x74')];_0x169a49=_0x5108a5[_0x34dc7b][_0x2859('0x75')]?_[_0x2859('0x76')](_0x21c54f[_0x5108a5[_0x34dc7b][_0x2859('0x75')]],'%s',_0x169a49):_0x169a49;_0x169a49=_0x5108a5[_0x34dc7b][_0x2859('0x77')]?_['replace'](_0x41387b[_0x5108a5[_0x34dc7b][_0x2859('0x77')]],'%s',_0x169a49):_0x169a49;if(_0x5108a5[_0x34dc7b]['groupBy']){_0x54d94a['group'](_0x169a49);}_0x5108a5[_0x34dc7b][_0x2859('0x79')]&&_0x54d94a['order'](_0x169a49,_0x5108a5[_0x34dc7b][_0x2859('0x79')]===_0x2859('0x7a')?![]:!![]);_0x54d94a['field'](_0x169a49,_0x5108a5[_0x34dc7b]['alias']||_0x169a49);}if(_0x2eb99a[_0x2859('0x7c')]){_0x2eb99a[_0x2859('0x7c')]=JSON[_0x2859('0x7d')](_0x2eb99a[_0x2859('0x7c')]);for(var _0x5ca306=0x0;_0x5ca306<_0x2eb99a[_0x2859('0x7c')][_0x2859('0x3a')];_0x5ca306+=0x1){if(_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x32')]&&_[_0x2859('0x5f')](_0x3cdd34,_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x32')])&&_0x2eb99a['joins'][_0x5ca306][_0x2859('0x81')]&&_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x7f')]&&_0x2eb99a['joins'][_0x5ca306][_0x2859('0x7e')]){_0x54d94a[_0x2eb99a['joins'][_0x5ca306][_0x2859('0x32')]](_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x7f')],null,util[_0x2859('0x77')](_0x2859('0x80'),_0x2eb99a[_0x2859('0x71')],_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x81')],_0x2eb99a['joins'][_0x5ca306][_0x2859('0x7f')],_0x2eb99a[_0x2859('0x7c')][_0x5ca306][_0x2859('0x7e')]));}}}if(_0x2eb99a[_0x2859('0x82')]){_0x2eb99a['conditions']=JSON[_0x2859('0x7d')](_0x2eb99a['conditions']);_0x54d94a[_0x2859('0x3d')](_0x106cd2(_0x2eb99a[_0x2859('0x82')][_0x2859('0x65')]));}_0xeea1a9=_0x54d94a[_0x2859('0x8e')]();_0x54d94a[_0x2859('0x1d')](_0x13955a);_0x54d94a['offset'](0x0);logger['debug'](_0x2859('0x84'),_0x54d94a['toString']());return dbH[_0x2859('0x85')][_0x2859('0x35')](_0x54d94a[_0x2859('0x86')](),{'type':dbH[_0x2859('0x85')][_0x2859('0x87')]['SELECT']});}})[_0x2859('0x26')](function(){return{'sql':_0xeea1a9[_0x2859('0x86')]()};})[_0x2859('0x26')](respondWithResult(_0x2def26,null))[_0x2859('0x42')](handleError(_0x2def26,null));}; \ No newline at end of file +var _0xcf54=['apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','index','map','AnalyticCustomReport','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','AnalyticMetric','from','table','MetricId','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','includes','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','toString','sequelize','SELECT','IS\x20NOT\x20NULL','ValidationErrorItem','findAll','keyBy','metric','foreignKey','clone','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','DATE(%s)','Please\x20insert\x20at\x20least\x20one\x20field','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x4c649a,_0x3b5658){var _0x32970f=function(_0x57ef1c){while(--_0x57ef1c){_0x4c649a['push'](_0x4c649a['shift']());}};_0x32970f(++_0x3b5658);}(_0xcf54,0x125));var _0x4cf5=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xcf54[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cf5('0x0'));var zipdir=require(_0x4cf5('0x1'));var jsonpatch=require(_0x4cf5('0x2'));var rp=require(_0x4cf5('0x3'));var moment=require(_0x4cf5('0x4'));var BPromise=require(_0x4cf5('0x5'));var Mustache=require(_0x4cf5('0x6'));var util=require('util');var path=require(_0x4cf5('0x7'));var sox=require(_0x4cf5('0x8'));var csv=require(_0x4cf5('0x9'));var ejs=require(_0x4cf5('0xa'));var fs=require('fs');var fs_extra=require(_0x4cf5('0xb'));var _=require('lodash');var squel=require(_0x4cf5('0xc'));var crypto=require(_0x4cf5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4cf5('0x9'));var querystring=require('querystring');var Papa=require(_0x4cf5('0xe'));var Redis=require(_0x4cf5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4cf5('0x10'));var as=require(_0x4cf5('0x11'));var hardwareService=require(_0x4cf5('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4cf5('0x13'));var licenseUtil=require(_0x4cf5('0x14'));var db=require(_0x4cf5('0x15'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x29af5e,_0x167a39){_0x167a39=_0x167a39||0xcc;return function(_0xb1eb68){if(_0xb1eb68){return _0x29af5e[_0x4cf5('0x16')](_0x167a39);}return _0x29af5e[_0x4cf5('0x17')](_0x167a39)[_0x4cf5('0x18')]();};}function respondWithResult(_0x3b2e36,_0x2bd4bb){_0x2bd4bb=_0x2bd4bb||0xc8;return function(_0x27f818){if(_0x27f818){return _0x3b2e36[_0x4cf5('0x17')](_0x2bd4bb)[_0x4cf5('0x19')](_0x27f818);}};}function respondWithFilteredResult(_0x50a4a7,_0x2a40c4){return function(_0x8463d8){if(_0x8463d8){var _0x568c9e=typeof _0x2a40c4[_0x4cf5('0x1a')]===_0x4cf5('0x1b')&&typeof _0x2a40c4[_0x4cf5('0x1c')]===_0x4cf5('0x1b');var _0x2436c0=_0x8463d8[_0x4cf5('0x1d')];var _0x478a7c=_0x568c9e?0x0:_0x2a40c4[_0x4cf5('0x1a')];var _0x775aa8=_0x568c9e?_0x8463d8[_0x4cf5('0x1d')]:_0x2a40c4['offset']+_0x2a40c4[_0x4cf5('0x1c')];var _0x5e2c97;if(_0x775aa8>=_0x2436c0){_0x775aa8=_0x2436c0;_0x5e2c97=0xc8;}else{_0x5e2c97=0xce;}_0x50a4a7[_0x4cf5('0x17')](_0x5e2c97);return _0x50a4a7['set'](_0x4cf5('0x1e'),_0x478a7c+'-'+_0x775aa8+'/'+_0x2436c0)[_0x4cf5('0x19')](_0x8463d8);}return null;};}function patchUpdates(_0x18ac02){return function(_0x213883){try{jsonpatch[_0x4cf5('0x1f')](_0x213883,_0x18ac02,!![]);}catch(_0x8524ed){return BPromise[_0x4cf5('0x20')](_0x8524ed);}return _0x213883[_0x4cf5('0x21')]();};}function saveUpdates(_0x5c2043,_0x454639){return function(_0x590140){if(_0x590140){return _0x590140[_0x4cf5('0x22')](_0x5c2043)[_0x4cf5('0x23')](function(_0x44494c){return _0x44494c;});}return null;};}function removeEntity(_0x44c773,_0x1c31d0){return function(_0x2407c6){if(_0x2407c6){return _0x2407c6[_0x4cf5('0x24')]()[_0x4cf5('0x23')](function(){var _0x338b9c=_0x2407c6[_0x4cf5('0x25')]({'plain':!![]});var _0x39730c='CustomReports';return db[_0x4cf5('0x26')][_0x4cf5('0x24')]({'where':{'type':_0x39730c,'resourceId':_0x338b9c['id']}})[_0x4cf5('0x23')](function(){return _0x2407c6;});})[_0x4cf5('0x23')](function(){_0x44c773[_0x4cf5('0x17')](0xcc)[_0x4cf5('0x18')]();});}};}function handleEntityNotFound(_0x22a002,_0x41fd44){return function(_0x340acf){if(!_0x340acf){_0x22a002[_0x4cf5('0x16')](0x194);}return _0x340acf;};}function handleError(_0x519b36,_0x2b18af){_0x2b18af=_0x2b18af||0x1f4;return function(_0x37ad8d){logger[_0x4cf5('0x27')](_0x37ad8d[_0x4cf5('0x28')]);if(_0x37ad8d['name']){delete _0x37ad8d['name'];}_0x519b36['status'](_0x2b18af)['send'](_0x37ad8d);};}exports[_0x4cf5('0x29')]=function(_0x49287e,_0x464c50){var _0x111be7={},_0x559208={},_0x3b3869={'count':0x0,'rows':[]};var _0x5c6a51=_[_0x4cf5('0x2a')](db[_0x4cf5('0x2b')][_0x4cf5('0x2c')],function(_0x183980){return{'name':_0x183980['fieldName'],'type':_0x183980[_0x4cf5('0x2d')][_0x4cf5('0x2e')]};});_0x559208[_0x4cf5('0x2f')]=_[_0x4cf5('0x2a')](_0x5c6a51,_0x4cf5('0x30'));_0x559208[_0x4cf5('0x31')]=_[_0x4cf5('0x32')](_0x49287e[_0x4cf5('0x31')]);_0x559208[_0x4cf5('0x33')]=_['intersection'](_0x559208[_0x4cf5('0x2f')],_0x559208['query']);_0x111be7[_0x4cf5('0x34')]=_[_0x4cf5('0x35')](_0x559208['model'],qs['fields'](_0x49287e[_0x4cf5('0x31')][_0x4cf5('0x36')]));_0x111be7[_0x4cf5('0x34')]=_0x111be7['attributes']['length']?_0x111be7['attributes']:_0x559208[_0x4cf5('0x2f')];if(!_0x49287e[_0x4cf5('0x31')][_0x4cf5('0x37')](_0x4cf5('0x38'))){_0x111be7['limit']=qs[_0x4cf5('0x1c')](_0x49287e['query'][_0x4cf5('0x1c')]);_0x111be7[_0x4cf5('0x1a')]=qs['offset'](_0x49287e['query'][_0x4cf5('0x1a')]);}_0x111be7['order']=qs['sort'](_0x49287e['query'][_0x4cf5('0x39')]);_0x111be7[_0x4cf5('0x3a')]=qs[_0x4cf5('0x33')](_[_0x4cf5('0x3b')](_0x49287e['query'],_0x559208['filters']),_0x5c6a51);if(_0x49287e['query'][_0x4cf5('0x3c')]){_0x111be7[_0x4cf5('0x3a')]=_[_0x4cf5('0x3d')](_0x111be7[_0x4cf5('0x3a')],{'$or':_[_0x4cf5('0x2a')](_0x5c6a51,function(_0x2b62a1){if(_0x2b62a1[_0x4cf5('0x2d')]!==_0x4cf5('0x3e')){var _0x273ec6={};_0x273ec6[_0x2b62a1[_0x4cf5('0x30')]]={'$like':'%'+_0x49287e[_0x4cf5('0x31')][_0x4cf5('0x3c')]+'%'};return _0x273ec6;}})});}_0x111be7=_[_0x4cf5('0x3d')]({},_0x111be7,_0x49287e['options']);var _0x4f908d={'where':_0x111be7[_0x4cf5('0x3a')]};return db['AnalyticCustomReport'][_0x4cf5('0x1d')](_0x4f908d)[_0x4cf5('0x23')](function(_0x540cf5){_0x3b3869['count']=_0x540cf5;if(_0x49287e['query'][_0x4cf5('0x3f')]){_0x111be7[_0x4cf5('0x40')]=[{'all':!![]}];}return db[_0x4cf5('0x2b')]['findAll'](_0x111be7);})[_0x4cf5('0x23')](function(_0x13590c){_0x3b3869[_0x4cf5('0x41')]=_0x13590c;return _0x3b3869;})[_0x4cf5('0x23')](respondWithFilteredResult(_0x464c50,_0x111be7))[_0x4cf5('0x42')](handleError(_0x464c50,null));};exports[_0x4cf5('0x43')]=function(_0x432013,_0x52dcfa){var _0x823aca={'raw':![],'where':{'id':_0x432013[_0x4cf5('0x44')]['id']}},_0x53841b={};_0x53841b[_0x4cf5('0x2f')]=_['keys'](db['AnalyticCustomReport'][_0x4cf5('0x2c')]);_0x53841b[_0x4cf5('0x31')]=_[_0x4cf5('0x32')](_0x432013[_0x4cf5('0x31')]);_0x53841b['filters']=_[_0x4cf5('0x35')](_0x53841b[_0x4cf5('0x2f')],_0x53841b[_0x4cf5('0x31')]);_0x823aca[_0x4cf5('0x34')]=_[_0x4cf5('0x35')](_0x53841b['model'],qs[_0x4cf5('0x36')](_0x432013[_0x4cf5('0x31')][_0x4cf5('0x36')]));_0x823aca[_0x4cf5('0x34')]=_0x823aca['attributes'][_0x4cf5('0x45')]?_0x823aca[_0x4cf5('0x34')]:_0x53841b['model'];if(_0x432013[_0x4cf5('0x31')][_0x4cf5('0x3f')]){_0x823aca[_0x4cf5('0x40')]=[{'all':!![]}];}_0x823aca=_[_0x4cf5('0x3d')]({},_0x823aca,_0x432013[_0x4cf5('0x46')]);return db[_0x4cf5('0x2b')]['find'](_0x823aca)[_0x4cf5('0x23')](handleEntityNotFound(_0x52dcfa,null))[_0x4cf5('0x23')](respondWithResult(_0x52dcfa,null))['catch'](handleError(_0x52dcfa,null));};exports['create']=function(_0x5a5406,_0xc13929){return db['AnalyticCustomReport'][_0x4cf5('0x47')](_0x5a5406[_0x4cf5('0x48')],{})[_0x4cf5('0x23')](function(_0x102fe0){var _0x5999b0=_0x5a5406[_0x4cf5('0x49')][_0x4cf5('0x25')]({'plain':!![]});if(!_0x5999b0)throw new Error(_0x4cf5('0x4a'));if(_0x5999b0['role']==='user'){var _0x4cf882=_0x102fe0[_0x4cf5('0x25')]({'plain':!![]});var _0x23d3ff=_0x4cf5('0x4b');return db[_0x4cf5('0x4c')][_0x4cf5('0x4d')]({'where':{'name':_0x23d3ff,'userProfileId':_0x5999b0[_0x4cf5('0x4e')]},'raw':!![]})[_0x4cf5('0x23')](function(_0x45bf71){if(_0x45bf71&&_0x45bf71[_0x4cf5('0x4f')]===0x0){return db[_0x4cf5('0x26')]['create']({'name':_0x4cf882[_0x4cf5('0x30')],'resourceId':_0x4cf882['id'],'type':_0x4cf5('0x50'),'sectionId':_0x45bf71['id']},{})['then'](function(){return _0x102fe0;});}else{return _0x102fe0;}})[_0x4cf5('0x42')](function(_0x59be30){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59be30);throw _0x59be30;});}return _0x102fe0;})['then'](respondWithResult(_0xc13929,0xc9))[_0x4cf5('0x42')](handleError(_0xc13929,null));};exports[_0x4cf5('0x22')]=function(_0x1104bf,_0x3135d1){if(_0x1104bf[_0x4cf5('0x48')]['id']){delete _0x1104bf['body']['id'];}return db[_0x4cf5('0x2b')]['find']({'where':{'id':_0x1104bf['params']['id']}})[_0x4cf5('0x23')](handleEntityNotFound(_0x3135d1,null))[_0x4cf5('0x23')](saveUpdates(_0x1104bf['body'],null))[_0x4cf5('0x23')](respondWithResult(_0x3135d1,null))[_0x4cf5('0x42')](handleError(_0x3135d1,null));};exports['destroy']=function(_0x36419e,_0x5e505c){return db['AnalyticCustomReport'][_0x4cf5('0x4d')]({'where':{'id':_0x36419e[_0x4cf5('0x44')]['id']}})[_0x4cf5('0x23')](handleEntityNotFound(_0x5e505c,null))['then'](removeEntity(_0x5e505c,null))[_0x4cf5('0x42')](handleError(_0x5e505c,null));};exports[_0x4cf5('0x51')]=function(_0xb40494,_0x2ec3f){var _0x30a512=0xa;var _0x5b09f2=[_0x4cf5('0x52'),_0x4cf5('0x53'),_0x4cf5('0x54'),_0x4cf5('0x55')];var _0x1e2c49={'SUM':_0x4cf5('0x56'),'COUNT':_0x4cf5('0x57'),'COUNT DISTINCT':_0x4cf5('0x58'),'MAX':_0x4cf5('0x59'),'MIN':_0x4cf5('0x5a'),'AVG':_0x4cf5('0x5b'),'GROUP_CONCAT':_0x4cf5('0x5c'),'GROUP_CONCAT ASC':_0x4cf5('0x5d'),'GROUP_CONCAT DESC':_0x4cf5('0x5e')};var _0x3fba78={'SEC_TO_TIME':_0x4cf5('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4cf5('0x60'),'ROUND':_0x4cf5('0x61'),'UNIX_TIMESTAMP':_0x4cf5('0x62')};var _0x5d1f9a=function(_0x4d12f8){return!_['includes']([_0x4cf5('0x63'),'IS\x20NOT\x20NULL',_0x4cf5('0x64'),_0x4cf5('0x65')],_0x4d12f8);};var _0x4b5b17=function(_0x58f673){if(!_0x58f673||!_0x58f673[_0x4cf5('0x66')][_0x4cf5('0x45')]){return'';}for(var _0x3e705e='(',_0x28b951=0x0;_0x28b951<_0x58f673['rules'][_0x4cf5('0x45')];_0x28b951+=0x1){_0x28b951>0x0&&(_0x3e705e+='\x20'+_0x58f673[_0x4cf5('0x67')]+'\x20');_0x3e705e+=_0x58f673['rules'][_0x28b951]['group']?_0x4b5b17(_0x58f673[_0x4cf5('0x66')][_0x28b951][_0x4cf5('0x68')]):_0x58f673[_0x4cf5('0x66')][_0x28b951][_0x4cf5('0x69')]+'\x20'+_0x58f673[_0x4cf5('0x66')][_0x28b951][_0x4cf5('0x6a')]+(_0x5d1f9a(_0x58f673['rules'][_0x28b951][_0x4cf5('0x6a')])?'\x20'+_0x58f673[_0x4cf5('0x66')][_0x28b951][_0x4cf5('0x6b')]:'');}return _0x3e705e+')';};var _0x34b603={'where':{'id':_0xb40494[_0x4cf5('0x44')]['id']}},_0x4852b5,_0x4cd263,_0xa948a,_0x5ee3af,_0x470a5a;_0x34b603=_[_0x4cf5('0x3d')]({},_0x34b603,_0xb40494['options']);return db['AnalyticCustomReport']['find'](_0x34b603)[_0x4cf5('0x23')](function(_0x240103){if(_0x240103){_0x4852b5=_0x240103;return _0x240103[_0x4cf5('0x6c')]();}return null;})[_0x4cf5('0x23')](function(_0x28e003){if(_0x28e003){if(!_0x28e003[_0x4cf5('0x45')]){throw new db[(_0x4cf5('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd263=_0x28e003;return db[_0x4cf5('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x4cf5('0x23')](function(_0x1258af){if(_0x1258af){_0xa948a=_['keyBy'](_0x1258af,'id');var _0x11efc0;var _0x17055e=squel['select']();_0x17055e[_0x4cf5('0x6f')](_0x4852b5[_0x4cf5('0x70')]);for(var _0x3433fa=0x0;_0x3433fa<_0x4cd263[_0x4cf5('0x45')];_0x3433fa+=0x1){_0x11efc0=_0x4cd263[_0x3433fa][_0x4cf5('0x71')]?_0xa948a[_0x4cd263[_0x3433fa]['MetricId']]['metric']:_0x4cd263[_0x3433fa][_0x4cf5('0x69')];_0x11efc0=_0x4cd263[_0x3433fa][_0x4cf5('0x72')]?_[_0x4cf5('0x73')](_0x1e2c49[_0x4cd263[_0x3433fa]['function']],'%s',_0x11efc0):_0x11efc0;_0x11efc0=_0x4cd263[_0x3433fa][_0x4cf5('0x74')]?_[_0x4cf5('0x73')](_0x3fba78[_0x4cd263[_0x3433fa][_0x4cf5('0x74')]],'%s',_0x11efc0):_0x11efc0;if(_0x4cd263[_0x3433fa][_0x4cf5('0x75')]){_0x17055e[_0x4cf5('0x68')](_0x11efc0);}_0x4cd263[_0x3433fa][_0x4cf5('0x76')]&&_0x17055e[_0x4cf5('0x77')](_0x11efc0,_0x4cd263[_0x3433fa][_0x4cf5('0x76')]===_0x4cf5('0x78')?![]:!![]);_0x17055e[_0x4cf5('0x69')](_0x11efc0,_0x4cd263[_0x3433fa][_0x4cf5('0x79')]||_0x11efc0);}if(_0x4852b5[_0x4cf5('0x7a')]){_0x4852b5[_0x4cf5('0x7a')]=JSON[_0x4cf5('0x7b')](_0x4852b5[_0x4cf5('0x7a')]);for(var _0x3e83ab=0x0;_0x3e83ab<_0x4852b5['joins'][_0x4cf5('0x45')];_0x3e83ab+=0x1){if(_0x4852b5[_0x4cf5('0x7a')][_0x3e83ab][_0x4cf5('0x2d')]&&_[_0x4cf5('0x7c')](_0x5b09f2,_0x4852b5['joins'][_0x3e83ab][_0x4cf5('0x2d')])&&_0x4852b5[_0x4cf5('0x7a')][_0x3e83ab]['parentKey']&&_0x4852b5['joins'][_0x3e83ab][_0x4cf5('0x7d')]&&_0x4852b5[_0x4cf5('0x7a')][_0x3e83ab]['foreignKey']){_0x17055e[_0x4852b5[_0x4cf5('0x7a')][_0x3e83ab][_0x4cf5('0x2d')]](_0x4852b5['joins'][_0x3e83ab]['foreignTable'],null,util[_0x4cf5('0x74')](_0x4cf5('0x7e'),_0x4852b5[_0x4cf5('0x70')],_0x4852b5[_0x4cf5('0x7a')][_0x3e83ab][_0x4cf5('0x7f')],_0x4852b5[_0x4cf5('0x7a')][_0x3e83ab][_0x4cf5('0x7d')],_0x4852b5['joins'][_0x3e83ab]['foreignKey']));}}}if(_0x4852b5[_0x4cf5('0x80')]){_0x4852b5[_0x4cf5('0x80')]=JSON[_0x4cf5('0x7b')](_0x4852b5[_0x4cf5('0x80')]);_0x17055e[_0x4cf5('0x3a')](_0x4b5b17(_0x4852b5['conditions'][_0x4cf5('0x68')]));}_0x470a5a=_0x17055e['clone']();_0x17055e[_0x4cf5('0x1c')](_0x30a512);_0x17055e[_0x4cf5('0x1a')](0x0);logger[_0x4cf5('0x81')]('Limited\x20Query:',_0x17055e[_0x4cf5('0x82')]());return dbH[_0x4cf5('0x83')][_0x4cf5('0x31')](_0x17055e[_0x4cf5('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x4cf5('0x84')]});}})[_0x4cf5('0x23')](respondWithResult(_0x2ec3f,null))['catch'](handleError(_0x2ec3f,null));};function runReport(_0x3918f3,_0x1c4c13,_0x454688){var _0x323c22=_0x1c4c13[_0x4cf5('0x30')];var _0x4893a1=0xa;var _0x20ae3c=[_0x4cf5('0x52'),_0x4cf5('0x53'),'right_join',_0x4cf5('0x55')];var _0xe25c9c={'SUM':_0x4cf5('0x56'),'COUNT':_0x4cf5('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4cf5('0x5b'),'GROUP_CONCAT':_0x4cf5('0x5c'),'GROUP_CONCAT ASC':_0x4cf5('0x5d'),'GROUP_CONCAT DESC':_0x4cf5('0x5e')};var _0x227d67={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x4cf5('0x61'),'UNIX_TIMESTAMP':_0x4cf5('0x62')};var _0x3ce2bd=function(_0x317385){return!_[_0x4cf5('0x7c')]([_0x4cf5('0x63'),_0x4cf5('0x85'),_0x4cf5('0x64'),_0x4cf5('0x65')],_0x317385);};var _0x557020=function(_0x149c44){if(!_0x149c44||!_0x149c44[_0x4cf5('0x66')][_0x4cf5('0x45')]){return'';}for(var _0x77035='(',_0x587101=0x0;_0x587101<_0x149c44[_0x4cf5('0x66')][_0x4cf5('0x45')];_0x587101+=0x1){_0x587101>0x0&&(_0x77035+='\x20'+_0x149c44[_0x4cf5('0x67')]+'\x20');_0x77035+=_0x149c44[_0x4cf5('0x66')][_0x587101]['group']?_0x557020(_0x149c44['rules'][_0x587101]['group']):_0x149c44[_0x4cf5('0x66')][_0x587101][_0x4cf5('0x69')]+'\x20'+_0x149c44[_0x4cf5('0x66')][_0x587101]['condition']+(_0x3ce2bd(_0x149c44['rules'][_0x587101][_0x4cf5('0x6a')])?'\x20'+_0x149c44[_0x4cf5('0x66')][_0x587101]['value']:'');}return _0x77035+')';};var _0x371284={'where':{'id':_0x3918f3['id']}},_0xa2eef2,_0xcf7e1b,_0x1aa7f9,_0x56762d,_0x3b4ec4;_0x371284=_[_0x4cf5('0x3d')]({},_0x371284,_0x454688);return db['AnalyticCustomReport']['find'](_0x371284)[_0x4cf5('0x23')](function(_0x22fef1){if(_0x22fef1){_0xa2eef2=_0x22fef1;return _0x22fef1[_0x4cf5('0x6c')]();}return null;})[_0x4cf5('0x23')](function(_0xd6d83f){if(_0xd6d83f){if(!_0xd6d83f[_0x4cf5('0x45')]){throw new db[(_0x4cf5('0x6d'))][(_0x4cf5('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xcf7e1b=_0xd6d83f;return db[_0x4cf5('0x6e')][_0x4cf5('0x87')]({'raw':!![]});}return null;})['then'](function(_0x2d68d7){if(_0x2d68d7){_0x1aa7f9=_[_0x4cf5('0x88')](_0x2d68d7,'id');var _0x5e3775;var _0x14dcb0=squel['select']();_0x14dcb0[_0x4cf5('0x6f')](_0xa2eef2[_0x4cf5('0x70')]);for(var _0x332ede=0x0;_0x332ede<_0xcf7e1b[_0x4cf5('0x45')];_0x332ede+=0x1){_0x5e3775=_0xcf7e1b[_0x332ede]['MetricId']?_0x1aa7f9[_0xcf7e1b[_0x332ede]['MetricId']][_0x4cf5('0x89')]:_0xcf7e1b[_0x332ede][_0x4cf5('0x69')];_0x5e3775=_0xcf7e1b[_0x332ede][_0x4cf5('0x72')]?_[_0x4cf5('0x73')](_0xe25c9c[_0xcf7e1b[_0x332ede][_0x4cf5('0x72')]],'%s',_0x5e3775):_0x5e3775;_0x5e3775=_0xcf7e1b[_0x332ede][_0x4cf5('0x74')]?_['replace'](_0x227d67[_0xcf7e1b[_0x332ede]['format']],'%s',_0x5e3775):_0x5e3775;if(_0xcf7e1b[_0x332ede]['groupBy']){_0x14dcb0[_0x4cf5('0x68')](_0x5e3775);}_0xcf7e1b[_0x332ede][_0x4cf5('0x76')]&&_0x14dcb0[_0x4cf5('0x77')](_0x5e3775,_0xcf7e1b[_0x332ede][_0x4cf5('0x76')]===_0x4cf5('0x78')?![]:!![]);_0x14dcb0['field'](_0x5e3775,_0xcf7e1b[_0x332ede]['alias']||_0x5e3775);}if(_0xa2eef2[_0x4cf5('0x7a')]){_0xa2eef2['joins']=JSON[_0x4cf5('0x7b')](_0xa2eef2[_0x4cf5('0x7a')]);for(var _0x5ec2cd=0x0;_0x5ec2cd<_0xa2eef2[_0x4cf5('0x7a')]['length'];_0x5ec2cd+=0x1){if(_0xa2eef2[_0x4cf5('0x7a')][_0x5ec2cd][_0x4cf5('0x2d')]&&_[_0x4cf5('0x7c')](_0x20ae3c,_0xa2eef2[_0x4cf5('0x7a')][_0x5ec2cd]['type'])&&_0xa2eef2['joins'][_0x5ec2cd][_0x4cf5('0x7f')]&&_0xa2eef2[_0x4cf5('0x7a')][_0x5ec2cd][_0x4cf5('0x7d')]&&_0xa2eef2[_0x4cf5('0x7a')][_0x5ec2cd][_0x4cf5('0x8a')]){_0x14dcb0[_0xa2eef2['joins'][_0x5ec2cd][_0x4cf5('0x2d')]](_0xa2eef2['joins'][_0x5ec2cd][_0x4cf5('0x7d')],null,util[_0x4cf5('0x74')]('%s.%s\x20=\x20%s.%s',_0xa2eef2[_0x4cf5('0x70')],_0xa2eef2[_0x4cf5('0x7a')][_0x5ec2cd]['parentKey'],_0xa2eef2['joins'][_0x5ec2cd][_0x4cf5('0x7d')],_0xa2eef2[_0x4cf5('0x7a')][_0x5ec2cd][_0x4cf5('0x8a')]));}}}if(_0xa2eef2[_0x4cf5('0x80')]){_0xa2eef2[_0x4cf5('0x80')]=JSON[_0x4cf5('0x7b')](_0xa2eef2['conditions']);_0x14dcb0[_0x4cf5('0x3a')](_0x557020(_0xa2eef2[_0x4cf5('0x80')][_0x4cf5('0x68')]));}_0x3b4ec4=_0x14dcb0[_0x4cf5('0x8b')]();_0x14dcb0[_0x4cf5('0x1c')](_0x4893a1);_0x14dcb0[_0x4cf5('0x1a')](0x0);return;}})[_0x4cf5('0x23')](function(){if(_0x1c4c13[_0x4cf5('0x8c')]===_0x4cf5('0x8d')){return null;}var _0xb7f3df=_[_0x4cf5('0x3d')](_0x1c4c13,{'name':_0x1c4c13['fullPath']||_0x1c4c13[_0x4cf5('0x30')]||_0xa2eef2[_0x4cf5('0x30')],'basename':_0x323c22,'savename':util['format'](_0x4cf5('0x8e'),_0x1c4c13[_0x4cf5('0x30')]||_0xa2eef2[_0x4cf5('0x30')],require(_0x4cf5('0x8f'))[_0x4cf5('0x90')](0x4),_0x1c4c13[_0x4cf5('0x8c')]||_0x4cf5('0x91')),'reportId':_0xa2eef2['id'],'reportType':_0x4cf5('0x92')});return db[_0x4cf5('0x93')][_0x4cf5('0x47')](_0xb7f3df,{'raw':!![]});})[_0x4cf5('0x23')](function(_0x960ebf){if(_0xa2eef2[_0x4cf5('0x70')]==='cdr'){_0x3b4ec4['where'](_0xa2eef2['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1c4c13['startDate'],_0x1c4c13[_0x4cf5('0x94')]);}else{_0x3b4ec4[_0x4cf5('0x3a')](_0xa2eef2[_0x4cf5('0x70')]+_0x4cf5('0x95'),_0x1c4c13[_0x4cf5('0x96')],_0x1c4c13['endDate']);}if(_0x960ebf){logger[_0x4cf5('0x97')]('Run\x20Query:',_0x3b4ec4[_0x4cf5('0x82')]());require(_0x4cf5('0x98'))['fork'](path[_0x4cf5('0x52')](__dirname,'../../components/export/',_0x960ebf[_0x4cf5('0x8c')]),[_0x960ebf['id'],_0x3b4ec4[_0x4cf5('0x82')](),path[_0x4cf5('0x52')](__dirname,_0x4cf5('0x99'),_0x960ebf['savename']),_0x323c22]);return _0x960ebf;}else{var _0x2b5863=squel['select']();_0x2b5863[_0x4cf5('0x6f')]('('+_0x3b4ec4[_0x4cf5('0x82')]()+')',_0x4cf5('0x9a'));_0x2b5863[_0x4cf5('0x69')](_0x4cf5('0x9b'),_0x4cf5('0x1d'));_0x3b4ec4[_0x4cf5('0x1c')](_0x1c4c13[_0x4cf5('0x1c')]||_0x4893a1);_0x3b4ec4[_0x4cf5('0x1a')](_0x1c4c13[_0x4cf5('0x1a')]||0x0);return dbH['sequelize'][_0x4cf5('0x31')](_0x2b5863[_0x4cf5('0x82')](),{'type':dbH[_0x4cf5('0x83')][_0x4cf5('0x9c')][_0x4cf5('0x84')]})['then'](function(_0x5593fa){if(!_0x5593fa[_0x4cf5('0x45')]){_0x56762d=0x0;}else{_0x56762d=_0x5593fa[0x0][_0x4cf5('0x1d')]||0x0;}return dbH['sequelize'][_0x4cf5('0x31')](_0x3b4ec4[_0x4cf5('0x82')](),{'type':dbH['sequelize'][_0x4cf5('0x9c')][_0x4cf5('0x84')]});})['then'](function(_0x3e265c){return{'rows':_0x3e265c||[],'count':_0x56762d};});}});}exports[_0x4cf5('0x9d')]=function(_0x31f983,_0x135716){return runReport(_0x31f983[_0x4cf5('0x44')],_0x31f983[_0x4cf5('0x31')],_0x31f983[_0x4cf5('0x46')])[_0x4cf5('0x23')](respondWithResult(_0x135716,null))[_0x4cf5('0x42')](handleError(_0x135716,null));};exports[_0x4cf5('0x9e')]=runReport;exports['query']=function(_0x111513,_0x1561b6){var _0x29dc43=0xa;var _0x74036b=[_0x4cf5('0x52'),_0x4cf5('0x53'),'right_join',_0x4cf5('0x55')];var _0x1817ae={'SUM':_0x4cf5('0x56'),'COUNT':_0x4cf5('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x4cf5('0x5a'),'AVG':_0x4cf5('0x5b'),'GROUP_CONCAT':_0x4cf5('0x5c'),'GROUP_CONCAT ASC':_0x4cf5('0x5d'),'GROUP_CONCAT DESC':_0x4cf5('0x5e')};var _0x354f18={'SEC_TO_TIME':_0x4cf5('0x5f'),'DATE':_0x4cf5('0x9f'),'HOUR':_0x4cf5('0x60'),'ROUND':_0x4cf5('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2546cf=function(_0x5aad64){return!_['includes'](['IS\x20NULL',_0x4cf5('0x85'),_0x4cf5('0x64'),'IS\x20NOT\x20EMPTY'],_0x5aad64);};var _0x5bb568=function(_0x1ccd20){if(!_0x1ccd20||!_0x1ccd20[_0x4cf5('0x66')][_0x4cf5('0x45')]){return'';}for(var _0x45e05d='(',_0x417151=0x0;_0x417151<_0x1ccd20[_0x4cf5('0x66')][_0x4cf5('0x45')];_0x417151+=0x1){_0x417151>0x0&&(_0x45e05d+='\x20'+_0x1ccd20[_0x4cf5('0x67')]+'\x20');_0x45e05d+=_0x1ccd20[_0x4cf5('0x66')][_0x417151][_0x4cf5('0x68')]?_0x5bb568(_0x1ccd20['rules'][_0x417151][_0x4cf5('0x68')]):_0x1ccd20['rules'][_0x417151][_0x4cf5('0x69')]+'\x20'+_0x1ccd20[_0x4cf5('0x66')][_0x417151][_0x4cf5('0x6a')]+(_0x2546cf(_0x1ccd20[_0x4cf5('0x66')][_0x417151][_0x4cf5('0x6a')])?'\x20'+_0x1ccd20[_0x4cf5('0x66')][_0x417151][_0x4cf5('0x6b')]:'');}return _0x45e05d+')';};var _0x127f7a={'where':{'id':_0x111513['params']['id']}},_0x533358,_0x59cdb7,_0x3ae4ff,_0x38d8b6,_0x2a4056;_0x127f7a=_[_0x4cf5('0x3d')]({},_0x127f7a,_0x111513['options']);return db[_0x4cf5('0x2b')][_0x4cf5('0x4d')](_0x127f7a)['then'](function(_0x451770){if(_0x451770){_0x533358=_0x451770;return _0x451770[_0x4cf5('0x6c')]();}return null;})[_0x4cf5('0x23')](function(_0x23c198){if(_0x23c198){if(!_0x23c198[_0x4cf5('0x45')]){throw new db[(_0x4cf5('0x6d'))][(_0x4cf5('0x86'))](_0x4cf5('0xa0'),0x193);}_0x59cdb7=_0x23c198;return db[_0x4cf5('0x6e')][_0x4cf5('0x87')]({'raw':!![]});}return null;})[_0x4cf5('0x23')](function(_0x3a7d78){if(_0x3a7d78){_0x3ae4ff=_['keyBy'](_0x3a7d78,'id');var _0x4984b7;var _0x5e7cc4=squel[_0x4cf5('0xa1')]();_0x5e7cc4['from'](_0x533358['table']);for(var _0x5a0dea=0x0;_0x5a0dea<_0x59cdb7[_0x4cf5('0x45')];_0x5a0dea+=0x1){_0x4984b7=_0x59cdb7[_0x5a0dea][_0x4cf5('0x71')]?_0x3ae4ff[_0x59cdb7[_0x5a0dea][_0x4cf5('0x71')]][_0x4cf5('0x89')]:_0x59cdb7[_0x5a0dea][_0x4cf5('0x69')];_0x4984b7=_0x59cdb7[_0x5a0dea]['function']?_['replace'](_0x1817ae[_0x59cdb7[_0x5a0dea][_0x4cf5('0x72')]],'%s',_0x4984b7):_0x4984b7;_0x4984b7=_0x59cdb7[_0x5a0dea]['format']?_['replace'](_0x354f18[_0x59cdb7[_0x5a0dea][_0x4cf5('0x74')]],'%s',_0x4984b7):_0x4984b7;if(_0x59cdb7[_0x5a0dea]['groupBy']){_0x5e7cc4[_0x4cf5('0x68')](_0x4984b7);}_0x59cdb7[_0x5a0dea][_0x4cf5('0x76')]&&_0x5e7cc4[_0x4cf5('0x77')](_0x4984b7,_0x59cdb7[_0x5a0dea][_0x4cf5('0x76')]===_0x4cf5('0x78')?![]:!![]);_0x5e7cc4['field'](_0x4984b7,_0x59cdb7[_0x5a0dea][_0x4cf5('0x79')]||_0x4984b7);}if(_0x533358[_0x4cf5('0x7a')]){_0x533358[_0x4cf5('0x7a')]=JSON[_0x4cf5('0x7b')](_0x533358['joins']);for(var _0x22ca57=0x0;_0x22ca57<_0x533358['joins'][_0x4cf5('0x45')];_0x22ca57+=0x1){if(_0x533358[_0x4cf5('0x7a')][_0x22ca57][_0x4cf5('0x2d')]&&_[_0x4cf5('0x7c')](_0x74036b,_0x533358[_0x4cf5('0x7a')][_0x22ca57][_0x4cf5('0x2d')])&&_0x533358[_0x4cf5('0x7a')][_0x22ca57][_0x4cf5('0x7f')]&&_0x533358[_0x4cf5('0x7a')][_0x22ca57]['foreignTable']&&_0x533358[_0x4cf5('0x7a')][_0x22ca57][_0x4cf5('0x8a')]){_0x5e7cc4[_0x533358[_0x4cf5('0x7a')][_0x22ca57][_0x4cf5('0x2d')]](_0x533358['joins'][_0x22ca57][_0x4cf5('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x533358['table'],_0x533358[_0x4cf5('0x7a')][_0x22ca57]['parentKey'],_0x533358[_0x4cf5('0x7a')][_0x22ca57][_0x4cf5('0x7d')],_0x533358['joins'][_0x22ca57][_0x4cf5('0x8a')]));}}}if(_0x533358['conditions']){_0x533358['conditions']=JSON['parse'](_0x533358[_0x4cf5('0x80')]);_0x5e7cc4[_0x4cf5('0x3a')](_0x5bb568(_0x533358[_0x4cf5('0x80')][_0x4cf5('0x68')]));}_0x2a4056=_0x5e7cc4[_0x4cf5('0x8b')]();_0x5e7cc4[_0x4cf5('0x1c')](_0x29dc43);_0x5e7cc4[_0x4cf5('0x1a')](0x0);logger[_0x4cf5('0x81')]('Limited\x20Query:',_0x5e7cc4[_0x4cf5('0x82')]());return dbH[_0x4cf5('0x83')][_0x4cf5('0x31')](_0x5e7cc4[_0x4cf5('0x82')](),{'type':dbH[_0x4cf5('0x83')][_0x4cf5('0x9c')][_0x4cf5('0x84')]});}})[_0x4cf5('0x23')](function(){return{'sql':_0x2a4056[_0x4cf5('0x82')]()};})[_0x4cf5('0x23')](respondWithResult(_0x1561b6,null))['catch'](handleError(_0x1561b6,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index bf3d586..7a1826d 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 _0x0c45=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird'];(function(_0x40e0d6,_0xb1e94b){var _0x32cfe8=function(_0x31e355){while(--_0x31e355){_0x40e0d6['push'](_0x40e0d6['shift']());}};_0x32cfe8(++_0xb1e94b);}(_0x0c45,0x70));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50c4('0x0'));var util=require(_0x50c4('0x1'));var logger=require(_0x50c4('0x2'))(_0x50c4('0x3'));var moment=require('moment');var BPromise=require(_0x50c4('0x4'));var rp=require(_0x50c4('0x5'));var fs=require('fs');var path=require(_0x50c4('0x6'));var rimraf=require('rimraf');var config=require(_0x50c4('0x7'));var attributes=require(_0x50c4('0x8'));module[_0x50c4('0x9')]=function(_0x31c092,_0x45dc5a){return _0x31c092[_0x50c4('0xa')](_0x50c4('0xb'),attributes,{'tableName':_0x50c4('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a3=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','AnalyticCustomReport','util'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x1bb84b,_0xbb2edc){_0x1bb84b=_0x1bb84b-0x0;var _0x4120e4=_0xc7a3[_0x1bb84b];return _0x4120e4;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var logger=require(_0x3c7a('0x1'))(_0x3c7a('0x2'));var moment=require(_0x3c7a('0x3'));var BPromise=require(_0x3c7a('0x4'));var rp=require(_0x3c7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x3c7a('0x8')]=function(_0x2051ce,_0x2736c1){return _0x2051ce['define'](_0x3c7a('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 1ee8b65..bd8d9c1 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 _0x1ab5=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1ab5,0x15b));var _0x51ab=function(_0x2f1277,_0x57d562){_0x2f1277=_0x2f1277-0x0;var _0x3bdbba=_0x1ab5[_0x2f1277];return _0x3bdbba;};'use strict';var _=require(_0x51ab('0x0'));var util=require(_0x51ab('0x1'));var moment=require(_0x51ab('0x2'));var BPromise=require(_0x51ab('0x3'));var rs=require(_0x51ab('0x4'));var fs=require('fs');var Redis=require(_0x51ab('0x5'));var db=require(_0x51ab('0x6'))['db'];var utils=require(_0x51ab('0x7'));var logger=require('../../config/logger')(_0x51ab('0x8'));var config=require(_0x51ab('0x9'));var jayson=require(_0x51ab('0xa'));var client=jayson[_0x51ab('0xb')][_0x51ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1bc877,_0x44bc18,_0x18b118){return new BPromise(function(_0x254066,_0x3ffaf2){return client[_0x51ab('0xd')](_0x1bc877,_0x18b118)[_0x51ab('0xe')](function(_0x5eca0e){logger[_0x51ab('0xf')](_0x51ab('0x10'),_0x44bc18,_0x51ab('0x11'));logger['debug'](_0x51ab('0x12'),_0x44bc18,'request\x20sent',JSON[_0x51ab('0x13')](_0x5eca0e));if(_0x5eca0e[_0x51ab('0x14')]){if(_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x15')]===0x1f4){logger[_0x51ab('0x14')](_0x51ab('0x10'),_0x44bc18,_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);return _0x3ffaf2(_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);}logger[_0x51ab('0x14')](_0x51ab('0x10'),_0x44bc18,_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);return _0x254066(_0x5eca0e[_0x51ab('0x14')][_0x51ab('0x16')]);}else{logger[_0x51ab('0xf')](_0x51ab('0x10'),_0x44bc18,_0x51ab('0x11'));_0x254066(_0x5eca0e['result'][_0x51ab('0x16')]);}})[_0x51ab('0x17')](function(_0x27b888){logger[_0x51ab('0x14')](_0x51ab('0x10'),_0x44bc18,_0x27b888);_0x3ffaf2(_0x27b888);});});} \ No newline at end of file +var _0x2803=['util','moment','ioredis','../../mysqldb','rpc','../../config/environment','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xbdb384,_0x599d9){var _0x11eacf=function(_0x54eaf3){while(--_0x54eaf3){_0xbdb384['push'](_0xbdb384['shift']());}};_0x11eacf(++_0x599d9);}(_0x2803,0xa1));var _0x3280=function(_0x3577c3,_0x4831ce){_0x3577c3=_0x3577c3-0x0;var _0x1e89cc=_0x2803[_0x3577c3];return _0x1e89cc;};'use strict';var _=require(_0x3280('0x0'));var util=require(_0x3280('0x1'));var moment=require(_0x3280('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3280('0x3'));var db=require(_0x3280('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3280('0x5'));var config=require(_0x3280('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3280('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x132ce5,_0x180eb5,_0x483460){return new BPromise(function(_0x382db3,_0x31bb6d){return client['request'](_0x132ce5,_0x483460)[_0x3280('0x8')](function(_0x38125c){logger[_0x3280('0x9')](_0x3280('0xa'),_0x180eb5,_0x3280('0xb'));logger['debug'](_0x3280('0xc'),_0x180eb5,_0x3280('0xb'),JSON[_0x3280('0xd')](_0x38125c));if(_0x38125c['error']){if(_0x38125c[_0x3280('0xe')][_0x3280('0xf')]===0x1f4){logger[_0x3280('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x180eb5,_0x38125c[_0x3280('0xe')][_0x3280('0x10')]);return _0x31bb6d(_0x38125c['error'][_0x3280('0x10')]);}logger[_0x3280('0xe')](_0x3280('0xa'),_0x180eb5,_0x38125c[_0x3280('0xe')]['message']);return _0x382db3(_0x38125c[_0x3280('0xe')][_0x3280('0x10')]);}else{logger[_0x3280('0x9')](_0x3280('0xa'),_0x180eb5,_0x3280('0xb'));_0x382db3(_0x38125c['result'][_0x3280('0x10')]);}})[_0x3280('0x11')](function(_0x49bdab){logger[_0x3280('0xe')](_0x3280('0xa'),_0x180eb5,_0x49bdab);_0x31bb6d(_0x49bdab);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 4f6bbde..2ce897b 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 _0x6fd7=['show','preview','/:id/run','run','query','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x28dfff,_0x40dcff){var _0x351572=function(_0x42aecc){while(--_0x42aecc){_0x28dfff['push'](_0x28dfff['shift']());}};_0x351572(++_0x40dcff);}(_0x6fd7,0x11f));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x76fd('0x0'));var util=require(_0x76fd('0x1'));var path=require('path');var timeout=require(_0x76fd('0x2'));var express=require(_0x76fd('0x3'));var router=express['Router']();var fs_extra=require(_0x76fd('0x4'));var auth=require(_0x76fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x76fd('0x6'));var controller=require(_0x76fd('0x7'));router[_0x76fd('0x8')]('/',auth[_0x76fd('0x9')](),controller[_0x76fd('0xa')]);router[_0x76fd('0x8')](_0x76fd('0xb'),auth[_0x76fd('0x9')](),controller[_0x76fd('0xc')]);router[_0x76fd('0x8')]('/:id/preview',auth[_0x76fd('0x9')](),controller[_0x76fd('0xd')]);router['get'](_0x76fd('0xe'),auth[_0x76fd('0x9')](),controller[_0x76fd('0xf')]);router[_0x76fd('0x8')]('/:id/query',auth[_0x76fd('0x9')](),controller[_0x76fd('0x10')]);router['post']('/',auth[_0x76fd('0x9')](),controller[_0x76fd('0x11')]);router[_0x76fd('0x12')](_0x76fd('0xb'),auth[_0x76fd('0x9')](),controller[_0x76fd('0x13')]);router[_0x76fd('0x14')](_0x76fd('0xb'),auth[_0x76fd('0x9')](),controller[_0x76fd('0x15')]);module[_0x76fd('0x16')]=router; \ No newline at end of file +var _0xafbb=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/query','query','post'];(function(_0x1fe2cf,_0x211365){var _0x293a8a=function(_0x1af68c){while(--_0x1af68c){_0x1fe2cf['push'](_0x1fe2cf['shift']());}};_0x293a8a(++_0x211365);}(_0xafbb,0x1a7));var _0xbafb=function(_0x212899,_0x3eaa52){_0x212899=_0x212899-0x0;var _0x491e14=_0xafbb[_0x212899];return _0x491e14;};'use strict';var multer=require(_0xbafb('0x0'));var util=require(_0xbafb('0x1'));var path=require(_0xbafb('0x2'));var timeout=require(_0xbafb('0x3'));var express=require(_0xbafb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbafb('0x5'));var interaction=require(_0xbafb('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xbafb('0x7')](),controller[_0xbafb('0x8')]);router['get'](_0xbafb('0x9'),auth[_0xbafb('0x7')](),controller[_0xbafb('0xa')]);router[_0xbafb('0xb')](_0xbafb('0xc'),auth[_0xbafb('0x7')](),controller[_0xbafb('0xd')]);router[_0xbafb('0xb')]('/:id/run',auth['isAuthenticated'](),controller['run']);router['get'](_0xbafb('0xe'),auth[_0xbafb('0x7')](),controller[_0xbafb('0xf')]);router[_0xbafb('0x10')]('/',auth[_0xbafb('0x7')](),controller[_0xbafb('0x11')]);router[_0xbafb('0x12')]('/:id',auth[_0xbafb('0x7')](),controller[_0xbafb('0x13')]);router[_0xbafb('0x14')](_0xbafb('0x9'),auth[_0xbafb('0x7')](),controller['destroy']);module[_0xbafb('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e7e73d9..887b3b6 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 _0x8958=['TEXT','exports'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0x8958,0x93));var _0x8895=function(_0x4350ec,_0x3d0740){_0x4350ec=_0x4350ec-0x0;var _0x10c2fe=_0x8958[_0x4350ec];return _0x10c2fe;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x5075,0x73));var _0x5507=function(_0xba0394,_0x2c6844){_0xba0394=_0xba0394-0x0;var _0x1789dd=_0x5075[_0xba0394];return _0x1789dd;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 11b2c9c..d0f5eef 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 _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x4e19d3,_0x5a30bf){var _0x96eade=function(_0x4d1cc9){while(--_0x4d1cc9){_0x4e19d3['push'](_0x4e19d3['shift']());}};_0x96eade(++_0x5a30bf);}(_0x524e,0x15e));var _0xe524=function(_0x318e0a,_0x9677c2){_0x318e0a=_0x318e0a-0x0;var _0x25201a=_0x524e[_0x318e0a];return _0x25201a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x564e9f,_0x225a15){var _0x3a9f3e=function(_0x1bbe48){while(--_0x1bbe48){_0x564e9f['push'](_0x564e9f['shift']());}};_0x3a9f3e(++_0x225a15);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc4aa[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3e1816b..f2d3e76 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 _0x7732=['define','AnalyticDefaultReport','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7732,0x18e));var _0x2773=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x7732[_0x342700];return _0x53406f;};'use strict';var _=require('lodash');var util=require(_0x2773('0x0'));var logger=require(_0x2773('0x1'))(_0x2773('0x2'));var moment=require(_0x2773('0x3'));var BPromise=require('bluebird');var rp=require(_0x2773('0x4'));var fs=require('fs');var path=require(_0x2773('0x5'));var rimraf=require(_0x2773('0x6'));var config=require(_0x2773('0x7'));var attributes=require(_0x2773('0x8'));module['exports']=function(_0x5c235e,_0x4a38ac){return _0x5c235e[_0x2773('0x9')](_0x2773('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28e8=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x3e0863,_0x5e7b9a){var _0x5cf89=function(_0x5a42cb){while(--_0x5a42cb){_0x3e0863['push'](_0x3e0863['shift']());}};_0x5cf89(++_0x5e7b9a);}(_0x28e8,0x12f));var _0x828e=function(_0x36d9ab,_0x40059a){_0x36d9ab=_0x36d9ab-0x0;var _0x287954=_0x28e8[_0x36d9ab];return _0x287954;};'use strict';var _=require(_0x828e('0x0'));var util=require(_0x828e('0x1'));var logger=require('../../config/logger')(_0x828e('0x2'));var moment=require('moment');var BPromise=require(_0x828e('0x3'));var rp=require(_0x828e('0x4'));var fs=require('fs');var path=require(_0x828e('0x5'));var rimraf=require(_0x828e('0x6'));var config=require(_0x828e('0x7'));var attributes=require(_0x828e('0x8'));module[_0x828e('0x9')]=function(_0x1879c6,_0x33c806){return _0x1879c6[_0x828e('0xa')](_0x828e('0xb'),attributes,{'tableName':_0x828e('0xc'),'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 08bb15a..ae52d67 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 _0xea83=['info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x50f29f,_0x2f73cc){var _0x35e9e9=function(_0x4cab88){while(--_0x4cab88){_0x50f29f['push'](_0x50f29f['shift']());}};_0x35e9e9(++_0x2f73cc);}(_0xea83,0x1aa));var _0x3ea8=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xea83[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0x3ea8('0x0'));var util=require(_0x3ea8('0x1'));var moment=require(_0x3ea8('0x2'));var BPromise=require(_0x3ea8('0x3'));var rs=require(_0x3ea8('0x4'));var fs=require('fs');var Redis=require(_0x3ea8('0x5'));var db=require(_0x3ea8('0x6'))['db'];var utils=require(_0x3ea8('0x7'));var logger=require(_0x3ea8('0x8'))(_0x3ea8('0x9'));var config=require(_0x3ea8('0xa'));var jayson=require(_0x3ea8('0xb'));var client=jayson[_0x3ea8('0xc')][_0x3ea8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x159aae,_0x3bbeec,_0x1c8a5c){return new BPromise(function(_0x1ffbe8,_0xb5d1ad){return client[_0x3ea8('0xe')](_0x159aae,_0x1c8a5c)[_0x3ea8('0xf')](function(_0xc7fc68){logger[_0x3ea8('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3bbeec,_0x3ea8('0x11'));logger[_0x3ea8('0x12')](_0x3ea8('0x13'),_0x3bbeec,'request\x20sent',JSON[_0x3ea8('0x14')](_0xc7fc68));if(_0xc7fc68[_0x3ea8('0x15')]){if(_0xc7fc68[_0x3ea8('0x15')]['code']===0x1f4){logger['error'](_0x3ea8('0x16'),_0x3bbeec,_0xc7fc68[_0x3ea8('0x15')][_0x3ea8('0x17')]);return _0xb5d1ad(_0xc7fc68[_0x3ea8('0x15')]['message']);}logger[_0x3ea8('0x15')](_0x3ea8('0x16'),_0x3bbeec,_0xc7fc68[_0x3ea8('0x15')][_0x3ea8('0x17')]);return _0x1ffbe8(_0xc7fc68['error'][_0x3ea8('0x17')]);}else{logger['info'](_0x3ea8('0x16'),_0x3bbeec,'request\x20sent');_0x1ffbe8(_0xc7fc68[_0x3ea8('0x18')][_0x3ea8('0x17')]);}})[_0x3ea8('0x19')](function(_0x4e0b84){logger[_0x3ea8('0x15')](_0x3ea8('0x16'),_0x3bbeec,_0x4e0b84);_0xb5d1ad(_0x4e0b84);});});} \ No newline at end of file +var _0xa7e3=['rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xa7e3,0xcc));var _0x3a7e=function(_0x2d3040,_0x222d79){_0x2d3040=_0x2d3040-0x0;var _0x2614a8=_0xa7e3[_0x2d3040];return _0x2614a8;};'use strict';var _=require('lodash');var util=require(_0x3a7e('0x0'));var moment=require(_0x3a7e('0x1'));var BPromise=require(_0x3a7e('0x2'));var rs=require(_0x3a7e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3a7e('0x4'));var logger=require(_0x3a7e('0x5'))(_0x3a7e('0x6'));var config=require(_0x3a7e('0x7'));var jayson=require(_0x3a7e('0x8'));var client=jayson[_0x3a7e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d15e,_0x3baa9d,_0x5cc152){return new BPromise(function(_0x3e07d8,_0x35a910){return client[_0x3a7e('0xa')](_0x41d15e,_0x5cc152)[_0x3a7e('0xb')](function(_0xeb7b16){logger[_0x3a7e('0xc')](_0x3a7e('0xd'),_0x3baa9d,_0x3a7e('0xe'));logger[_0x3a7e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3baa9d,_0x3a7e('0xe'),JSON[_0x3a7e('0x10')](_0xeb7b16));if(_0xeb7b16[_0x3a7e('0x11')]){if(_0xeb7b16[_0x3a7e('0x11')]['code']===0x1f4){logger[_0x3a7e('0x11')](_0x3a7e('0xd'),_0x3baa9d,_0xeb7b16[_0x3a7e('0x11')]['message']);return _0x35a910(_0xeb7b16['error'][_0x3a7e('0x12')]);}logger[_0x3a7e('0x11')](_0x3a7e('0xd'),_0x3baa9d,_0xeb7b16[_0x3a7e('0x11')][_0x3a7e('0x12')]);return _0x3e07d8(_0xeb7b16[_0x3a7e('0x11')][_0x3a7e('0x12')]);}else{logger['info'](_0x3a7e('0xd'),_0x3baa9d,_0x3a7e('0xe'));_0x3e07d8(_0xeb7b16[_0x3a7e('0x13')][_0x3a7e('0x12')]);}})[_0x3a7e('0x14')](function(_0x4fa526){logger[_0x3a7e('0x11')](_0x3a7e('0xd'),_0x3baa9d,_0x4fa526);_0x35a910(_0x4fa526);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 1bb482b..8a2beb5 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 _0x3e1d=['query','post','put','update','delete','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3e1d,0x13a));var _0xd3e1=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x3e1d[_0x3be2e2];return _0x53b9c5;};'use strict';var multer=require('multer');var util=require(_0xd3e1('0x0'));var path=require('path');var timeout=require(_0xd3e1('0x1'));var express=require(_0xd3e1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x3'));var interaction=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var controller=require(_0xd3e1('0x6'));router[_0xd3e1('0x7')]('/',auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x9')]);router['get'](_0xd3e1('0xa'),auth['isAuthenticated'](),controller[_0xd3e1('0xb')]);router[_0xd3e1('0x7')](_0xd3e1('0xc'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0xd')]);router[_0xd3e1('0x7')](_0xd3e1('0xe'),auth[_0xd3e1('0x8')](),controller['run']);router[_0xd3e1('0x7')](_0xd3e1('0xf'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x10')]);router[_0xd3e1('0x11')]('/',auth[_0xd3e1('0x8')](),controller['create']);router[_0xd3e1('0x12')](_0xd3e1('0xa'),auth[_0xd3e1('0x8')](),controller[_0xd3e1('0x13')]);router[_0xd3e1('0x14')](_0xd3e1('0xa'),auth[_0xd3e1('0x8')](),controller['destroy']);module[_0xd3e1('0x15')]=router; \ No newline at end of file +var _0x1cc1=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','/:id/preview','/:id/run','run','post','put','update'];(function(_0x1f0cd1,_0xc1b8cc){var _0x306ce4=function(_0x210449){while(--_0x210449){_0x1f0cd1['push'](_0x1f0cd1['shift']());}};_0x306ce4(++_0xc1b8cc);}(_0x1cc1,0x106));var _0x11cc=function(_0x4d117c,_0x456634){_0x4d117c=_0x4d117c-0x0;var _0x4c2580=_0x1cc1[_0x4d117c];return _0x4c2580;};'use strict';var multer=require(_0x11cc('0x0'));var util=require(_0x11cc('0x1'));var path=require(_0x11cc('0x2'));var timeout=require(_0x11cc('0x3'));var express=require(_0x11cc('0x4'));var router=express[_0x11cc('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x11cc('0x6'));var config=require(_0x11cc('0x7'));var controller=require(_0x11cc('0x8'));router[_0x11cc('0x9')]('/',auth[_0x11cc('0xa')](),controller['index']);router[_0x11cc('0x9')](_0x11cc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x11cc('0x9')](_0x11cc('0xc'),auth[_0x11cc('0xa')](),controller['preview']);router[_0x11cc('0x9')](_0x11cc('0xd'),auth['isAuthenticated'](),controller[_0x11cc('0xe')]);router['get']('/:id/query',auth[_0x11cc('0xa')](),controller['query']);router[_0x11cc('0xf')]('/',auth[_0x11cc('0xa')](),controller['create']);router[_0x11cc('0x10')](_0x11cc('0xb'),auth['isAuthenticated'](),controller[_0x11cc('0x11')]);router[_0x11cc('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x11cc('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a4efb5e..c7a50cd 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 _0xa120=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa120,0xe2));var _0x0a12=function(_0xdea275,_0x357a1e){_0xdea275=_0xdea275-0x0;var _0xaa0974=_0xa120[_0xdea275];return _0xaa0974;};'use strict';var Sequelize=require(_0x0a12('0x0'));var moment=require(_0x0a12('0x1'));module[_0x0a12('0x2')]={'name':{'type':Sequelize[_0x0a12('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x0a12('0x4')](_0x0a12('0x5'),_0x0a12('0x6'),_0x0a12('0x7')),'allowNull':![],'defaultValue':_0x0a12('0x5')},'savename':{'type':Sequelize[_0x0a12('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0a12('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x0a12('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x0a12('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x0a12('0x9')},'reportId':{'type':Sequelize[_0x0a12('0xa')](0xb)[_0x0a12('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4bd7=['manual','scheduled','INTEGER','UNSIGNED','sequelize','STRING','csv','pdf','xlsx','DATE','Loading','ENUM'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x4bd7,0x184));var _0x74bd=function(_0xd5c365,_0x4040b7){_0xd5c365=_0xd5c365-0x0;var _0x3e4875=_0x4bd7[_0xd5c365];return _0x3e4875;};'use strict';var Sequelize=require(_0x74bd('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x74bd('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x74bd('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x74bd('0x2'),_0x74bd('0x3'),_0x74bd('0x4')),'allowNull':![],'defaultValue':_0x74bd('0x2')},'savename':{'type':Sequelize[_0x74bd('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x74bd('0x5')]},'endDate':{'type':Sequelize[_0x74bd('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x74bd('0x6')},'type':{'type':Sequelize[_0x74bd('0x7')](_0x74bd('0x8'),_0x74bd('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x74bd('0xa')](0xb)[_0x74bd('0xb')]},'reportType':{'type':Sequelize[_0x74bd('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index d90a0ef..1e6d7db 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 _0x0d92=['reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','rawAttributes','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply'];(function(_0x1ca3a7,_0x309ca5){var _0x1a49c8=function(_0x21537c){while(--_0x21537c){_0x1ca3a7['push'](_0x1ca3a7['shift']());}};_0x1a49c8(++_0x309ca5);}(_0x0d92,0xfc));var _0x20d9=function(_0x4c5114,_0x466755){_0x4c5114=_0x4c5114-0x0;var _0xedb3d8=_0x0d92[_0x4c5114];return _0xedb3d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20d9('0x1'));var rp=require(_0x20d9('0x2'));var moment=require(_0x20d9('0x3'));var BPromise=require(_0x20d9('0x4'));var Mustache=require('mustache');var util=require(_0x20d9('0x5'));var path=require(_0x20d9('0x6'));var sox=require(_0x20d9('0x7'));var csv=require(_0x20d9('0x8'));var ejs=require(_0x20d9('0x9'));var fs=require('fs');var fs_extra=require(_0x20d9('0xa'));var _=require(_0x20d9('0xb'));var squel=require(_0x20d9('0xc'));var crypto=require('crypto');var jsforce=require(_0x20d9('0xd'));var deskjs=require(_0x20d9('0xe'));var toCsv=require(_0x20d9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20d9('0xf'));var logger=require(_0x20d9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x20d9('0x11'));var licenseUtil=require(_0x20d9('0x12'));var db=require(_0x20d9('0x13'))['db'];function respondWithStatusCode(_0x3131f3,_0x5552d0){_0x5552d0=_0x5552d0||0xcc;return function(_0x5dbcbf){if(_0x5dbcbf){return _0x3131f3[_0x20d9('0x14')](_0x5552d0);}return _0x3131f3[_0x20d9('0x15')](_0x5552d0)[_0x20d9('0x16')]();};}function respondWithResult(_0x4a126f,_0x6e20b2){_0x6e20b2=_0x6e20b2||0xc8;return function(_0xaca2e){if(_0xaca2e){return _0x4a126f[_0x20d9('0x15')](_0x6e20b2)[_0x20d9('0x17')](_0xaca2e);}};}function respondWithFilteredResult(_0x173371,_0x1aaa58){return function(_0x550ffa){if(_0x550ffa){var _0x2f7b12=typeof _0x1aaa58['offset']==='undefined'&&typeof _0x1aaa58[_0x20d9('0x18')]===_0x20d9('0x19');var _0x4c2ebd=_0x550ffa[_0x20d9('0x1a')];var _0x4a8cf5=_0x2f7b12?0x0:_0x1aaa58[_0x20d9('0x1b')];var _0x3d3058=_0x2f7b12?_0x550ffa[_0x20d9('0x1a')]:_0x1aaa58[_0x20d9('0x1b')]+_0x1aaa58['limit'];var _0x5d2170;if(_0x3d3058>=_0x4c2ebd){_0x3d3058=_0x4c2ebd;_0x5d2170=0xc8;}else{_0x5d2170=0xce;}_0x173371['status'](_0x5d2170);return _0x173371[_0x20d9('0x1c')]('Content-Range',_0x4a8cf5+'-'+_0x3d3058+'/'+_0x4c2ebd)[_0x20d9('0x17')](_0x550ffa);}return null;};}function patchUpdates(_0x2586ce){return function(_0x121124){try{jsonpatch[_0x20d9('0x1d')](_0x121124,_0x2586ce,!![]);}catch(_0x7d8c55){return BPromise[_0x20d9('0x1e')](_0x7d8c55);}return _0x121124[_0x20d9('0x1f')]();};}function saveUpdates(_0x4f845b,_0x132df4){return function(_0x2c409d){if(_0x2c409d){return _0x2c409d[_0x20d9('0x20')](_0x4f845b)[_0x20d9('0x21')](function(_0x2c0b61){return _0x2c0b61;});}return null;};}function removeEntity(_0x55cc42,_0x341a15){return function(_0x2eedf0){if(_0x2eedf0){return _0x2eedf0[_0x20d9('0x22')]()[_0x20d9('0x21')](function(){var _0x5143d3=_0x2eedf0[_0x20d9('0x23')]({'plain':!![]});var _0x421335=_0x20d9('0x24');return db[_0x20d9('0x25')]['destroy']({'where':{'type':_0x421335,'resourceId':_0x5143d3['id']}})[_0x20d9('0x21')](function(){return _0x2eedf0;});})[_0x20d9('0x21')](function(){_0x55cc42[_0x20d9('0x15')](0xcc)[_0x20d9('0x16')]();});}};}function handleEntityNotFound(_0x12c94b,_0x48ea2c){return function(_0x41ef01){if(!_0x41ef01){_0x12c94b['sendStatus'](0x194);}return _0x41ef01;};}function handleError(_0x28b0d8,_0x945b74){_0x945b74=_0x945b74||0x1f4;return function(_0x133246){logger[_0x20d9('0x26')](_0x133246[_0x20d9('0x27')]);if(_0x133246[_0x20d9('0x28')]){delete _0x133246[_0x20d9('0x28')];}_0x28b0d8[_0x20d9('0x15')](_0x945b74)[_0x20d9('0x29')](_0x133246);};}exports['index']=function(_0x3e16d4,_0x40d086){var _0x144bc8={},_0x3ec83b={},_0x2c249f={'count':0x0,'rows':[]};var _0x5704ee=_[_0x20d9('0x2a')](db[_0x20d9('0x2b')]['rawAttributes'],function(_0x19343b){return{'name':_0x19343b[_0x20d9('0x2c')],'type':_0x19343b[_0x20d9('0x2d')]['key']};});_0x3ec83b[_0x20d9('0x2e')]=_[_0x20d9('0x2a')](_0x5704ee,_0x20d9('0x28'));_0x3ec83b[_0x20d9('0x2f')]=_[_0x20d9('0x30')](_0x3e16d4['query']);_0x3ec83b[_0x20d9('0x31')]=_[_0x20d9('0x32')](_0x3ec83b['model'],_0x3ec83b[_0x20d9('0x2f')]);_0x144bc8[_0x20d9('0x33')]=_['intersection'](_0x3ec83b[_0x20d9('0x2e')],qs[_0x20d9('0x34')](_0x3e16d4['query']['fields']));_0x144bc8[_0x20d9('0x33')]=_0x144bc8[_0x20d9('0x33')][_0x20d9('0x35')]?_0x144bc8[_0x20d9('0x33')]:_0x3ec83b[_0x20d9('0x2e')];if(!_0x3e16d4['query'][_0x20d9('0x36')](_0x20d9('0x37'))){_0x144bc8[_0x20d9('0x18')]=qs[_0x20d9('0x18')](_0x3e16d4[_0x20d9('0x2f')][_0x20d9('0x18')]);_0x144bc8[_0x20d9('0x1b')]=qs[_0x20d9('0x1b')](_0x3e16d4['query']['offset']);}_0x144bc8[_0x20d9('0x38')]=qs[_0x20d9('0x39')](_0x3e16d4[_0x20d9('0x2f')][_0x20d9('0x39')]);_0x144bc8[_0x20d9('0x3a')]=qs[_0x20d9('0x31')](_[_0x20d9('0x3b')](_0x3e16d4[_0x20d9('0x2f')],_0x3ec83b[_0x20d9('0x31')]),_0x5704ee);if(_0x3e16d4['query'][_0x20d9('0x3c')]){_0x144bc8['where']=_['merge'](_0x144bc8[_0x20d9('0x3a')],{'$or':_[_0x20d9('0x2a')](_0x5704ee,function(_0x4d7118){if(_0x4d7118[_0x20d9('0x2d')]!==_0x20d9('0x3d')){var _0x4c9471={};_0x4c9471[_0x4d7118['name']]={'$like':'%'+_0x3e16d4['query'][_0x20d9('0x3c')]+'%'};return _0x4c9471;}})});}_0x144bc8=_[_0x20d9('0x3e')]({},_0x144bc8,_0x3e16d4[_0x20d9('0x3f')]);var _0x5f424a={'where':_0x144bc8['where']};return db[_0x20d9('0x2b')][_0x20d9('0x1a')](_0x5f424a)[_0x20d9('0x21')](function(_0x2f4ae6){_0x2c249f['count']=_0x2f4ae6;if(_0x3e16d4['query'][_0x20d9('0x40')]){_0x144bc8[_0x20d9('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x144bc8);})['then'](function(_0x5af63a){_0x2c249f[_0x20d9('0x42')]=_0x5af63a;return _0x2c249f;})[_0x20d9('0x21')](respondWithFilteredResult(_0x40d086,_0x144bc8))[_0x20d9('0x43')](handleError(_0x40d086,null));};exports[_0x20d9('0x44')]=function(_0x1cbacc,_0x53fdc3){var _0x4c4633={'raw':!![],'where':{'id':_0x1cbacc['params']['id']}},_0x45011c={};_0x45011c[_0x20d9('0x2e')]=_[_0x20d9('0x30')](db['AnalyticExtractedReport'][_0x20d9('0x45')]);_0x45011c[_0x20d9('0x2f')]=_[_0x20d9('0x30')](_0x1cbacc['query']);_0x45011c[_0x20d9('0x31')]=_[_0x20d9('0x32')](_0x45011c[_0x20d9('0x2e')],_0x45011c[_0x20d9('0x2f')]);_0x4c4633[_0x20d9('0x33')]=_[_0x20d9('0x32')](_0x45011c[_0x20d9('0x2e')],qs[_0x20d9('0x34')](_0x1cbacc['query'][_0x20d9('0x34')]));_0x4c4633['attributes']=_0x4c4633[_0x20d9('0x33')][_0x20d9('0x35')]?_0x4c4633[_0x20d9('0x33')]:_0x45011c['model'];if(_0x1cbacc[_0x20d9('0x2f')][_0x20d9('0x40')]){_0x4c4633[_0x20d9('0x41')]=[{'all':!![]}];}_0x4c4633=_[_0x20d9('0x3e')]({},_0x4c4633,_0x1cbacc[_0x20d9('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x4c4633)[_0x20d9('0x21')](handleEntityNotFound(_0x53fdc3,null))[_0x20d9('0x21')](respondWithResult(_0x53fdc3,null))['catch'](handleError(_0x53fdc3,null));};exports['create']=function(_0x4106f8,_0x360b2b){return db[_0x20d9('0x2b')]['create'](_0x4106f8[_0x20d9('0x46')],{})['then'](function(_0x43c01c){var _0x5ba440=_0x4106f8[_0x20d9('0x47')][_0x20d9('0x23')]({'plain':!![]});if(!_0x5ba440)throw new Error(_0x20d9('0x48'));if(_0x5ba440[_0x20d9('0x49')]===_0x20d9('0x47')){var _0x43a38c=_0x43c01c[_0x20d9('0x23')]({'plain':!![]});var _0x3d6d57='ExtractedReports';return db[_0x20d9('0x4a')][_0x20d9('0x4b')]({'where':{'name':_0x3d6d57,'userProfileId':_0x5ba440[_0x20d9('0x4c')]},'raw':!![]})[_0x20d9('0x21')](function(_0x4c1212){if(_0x4c1212&&_0x4c1212[_0x20d9('0x4d')]===0x0){return db[_0x20d9('0x25')][_0x20d9('0x4e')]({'name':_0x43a38c[_0x20d9('0x28')],'resourceId':_0x43a38c['id'],'type':_0x4c1212[_0x20d9('0x28')],'sectionId':_0x4c1212['id']},{})[_0x20d9('0x21')](function(){return _0x43c01c;});}else{return _0x43c01c;}})[_0x20d9('0x43')](function(_0x4902ba){logger[_0x20d9('0x26')](_0x20d9('0x4f'),_0x4902ba);throw _0x4902ba;});}return _0x43c01c;})[_0x20d9('0x21')](respondWithResult(_0x360b2b,0xc9))[_0x20d9('0x43')](handleError(_0x360b2b,null));};exports[_0x20d9('0x20')]=function(_0x2f1689,_0x3213a4){if(_0x2f1689[_0x20d9('0x46')]['id']){delete _0x2f1689[_0x20d9('0x46')]['id'];}return db[_0x20d9('0x2b')][_0x20d9('0x4b')]({'where':{'id':_0x2f1689[_0x20d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x3213a4,null))[_0x20d9('0x21')](saveUpdates(_0x2f1689['body'],null))[_0x20d9('0x21')](respondWithResult(_0x3213a4,null))['catch'](handleError(_0x3213a4,null));};exports[_0x20d9('0x22')]=function(_0x4d73a4,_0x4eaf4e){return db[_0x20d9('0x2b')][_0x20d9('0x4b')]({'where':{'id':_0x4d73a4['params']['id']}})[_0x20d9('0x21')](handleEntityNotFound(_0x4eaf4e,null))[_0x20d9('0x21')](removeEntity(_0x4eaf4e,null))['catch'](handleError(_0x4eaf4e,null));};exports[_0x20d9('0x51')]=function(_0x49887d,_0x49deeb,_0x50e76b){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x49887d[_0x20d9('0x50')]['id']},'attributes':['name',_0x20d9('0x52'),'savename',_0x20d9('0x53')],'raw':!![]})[_0x20d9('0x21')](handleEntityNotFound(_0x49deeb,null))['then'](function(_0x5dbe0c){if(_0x5dbe0c){if(!fs[_0x20d9('0x54')](path[_0x20d9('0x55')](config['root'],_0x20d9('0x56'),_0x5dbe0c[_0x20d9('0x57')]))){throw new db['Sequelize'][(_0x20d9('0x58'))](_0x20d9('0x59'));}if(_0x49887d['query'][_0x20d9('0x5a')]){return _0x49deeb[_0x20d9('0x14')](0xc8);}return _0x49deeb[_0x20d9('0x51')](path['join'](config[_0x20d9('0x5b')],_0x20d9('0x56'),_0x5dbe0c[_0x20d9('0x57')]),util[_0x20d9('0x5c')](_0x20d9('0x5d'),_0x5dbe0c['basename']||_0x5dbe0c[_0x20d9('0x28')],_0x5dbe0c[_0x20d9('0x53')]['toLowerCase']()));}})['catch'](handleError(_0x49deeb,null));}; \ No newline at end of file +var _0x1f52=['fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','existsSync','root','server/files/reports','Sequelize','exists','join','format','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','get','ExtractedReports','sendStatus','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes'];(function(_0x2c9805,_0x41f232){var _0x1d6fa5=function(_0x240335){while(--_0x240335){_0x2c9805['push'](_0x2c9805['shift']());}};_0x1d6fa5(++_0x41f232);}(_0x1f52,0x85));var _0x21f5=function(_0x5d2cc0,_0x860685){_0x5d2cc0=_0x5d2cc0-0x0;var _0x4bb229=_0x1f52[_0x5d2cc0];return _0x4bb229;};'use strict';var emlformat=require(_0x21f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21f5('0x1'));var jsonpatch=require(_0x21f5('0x2'));var rp=require(_0x21f5('0x3'));var moment=require('moment');var BPromise=require(_0x21f5('0x4'));var Mustache=require(_0x21f5('0x5'));var util=require('util');var path=require(_0x21f5('0x6'));var sox=require(_0x21f5('0x7'));var csv=require(_0x21f5('0x8'));var ejs=require(_0x21f5('0x9'));var fs=require('fs');var fs_extra=require(_0x21f5('0xa'));var _=require(_0x21f5('0xb'));var squel=require(_0x21f5('0xc'));var crypto=require(_0x21f5('0xd'));var jsforce=require(_0x21f5('0xe'));var deskjs=require(_0x21f5('0xf'));var toCsv=require(_0x21f5('0x8'));var querystring=require('querystring');var Papa=require(_0x21f5('0x10'));var Redis=require(_0x21f5('0x11'));var authService=require(_0x21f5('0x12'));var qs=require(_0x21f5('0x13'));var as=require(_0x21f5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21f5('0x15'))(_0x21f5('0x16'));var utils=require('../../config/utils');var config=require(_0x21f5('0x17'));var licenseUtil=require(_0x21f5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2efded,_0x458713){_0x458713=_0x458713||0xcc;return function(_0xf1ea36){if(_0xf1ea36){return _0x2efded['sendStatus'](_0x458713);}return _0x2efded[_0x21f5('0x19')](_0x458713)[_0x21f5('0x1a')]();};}function respondWithResult(_0x547ef4,_0x3c56ab){_0x3c56ab=_0x3c56ab||0xc8;return function(_0x381850){if(_0x381850){return _0x547ef4[_0x21f5('0x19')](_0x3c56ab)[_0x21f5('0x1b')](_0x381850);}};}function respondWithFilteredResult(_0x5cf591,_0xecb9bc){return function(_0x2d88c5){if(_0x2d88c5){var _0x214cb0=typeof _0xecb9bc[_0x21f5('0x1c')]===_0x21f5('0x1d')&&typeof _0xecb9bc[_0x21f5('0x1e')]===_0x21f5('0x1d');var _0x1d2b35=_0x2d88c5['count'];var _0x10b67d=_0x214cb0?0x0:_0xecb9bc['offset'];var _0x47447b=_0x214cb0?_0x2d88c5[_0x21f5('0x1f')]:_0xecb9bc[_0x21f5('0x1c')]+_0xecb9bc[_0x21f5('0x1e')];var _0x46ceb2;if(_0x47447b>=_0x1d2b35){_0x47447b=_0x1d2b35;_0x46ceb2=0xc8;}else{_0x46ceb2=0xce;}_0x5cf591['status'](_0x46ceb2);return _0x5cf591[_0x21f5('0x20')](_0x21f5('0x21'),_0x10b67d+'-'+_0x47447b+'/'+_0x1d2b35)[_0x21f5('0x1b')](_0x2d88c5);}return null;};}function patchUpdates(_0x375e50){return function(_0x58305e){try{jsonpatch[_0x21f5('0x22')](_0x58305e,_0x375e50,!![]);}catch(_0x3d3376){return BPromise['reject'](_0x3d3376);}return _0x58305e['save']();};}function saveUpdates(_0x4ded61,_0x576911){return function(_0x3499b4){if(_0x3499b4){return _0x3499b4[_0x21f5('0x23')](_0x4ded61)['then'](function(_0x543b8c){return _0x543b8c;});}return null;};}function removeEntity(_0x281774,_0x320bd6){return function(_0x56665c){if(_0x56665c){return _0x56665c[_0x21f5('0x24')]()[_0x21f5('0x25')](function(){var _0x2f2b19=_0x56665c[_0x21f5('0x26')]({'plain':!![]});var _0x311444=_0x21f5('0x27');return db['UserProfileResource'][_0x21f5('0x24')]({'where':{'type':_0x311444,'resourceId':_0x2f2b19['id']}})[_0x21f5('0x25')](function(){return _0x56665c;});})[_0x21f5('0x25')](function(){_0x281774[_0x21f5('0x19')](0xcc)[_0x21f5('0x1a')]();});}};}function handleEntityNotFound(_0x52a026,_0x47c972){return function(_0xc91d4){if(!_0xc91d4){_0x52a026[_0x21f5('0x28')](0x194);}return _0xc91d4;};}function handleError(_0x306dbf,_0x55589a){_0x55589a=_0x55589a||0x1f4;return function(_0x517788){logger['error'](_0x517788[_0x21f5('0x29')]);if(_0x517788[_0x21f5('0x2a')]){delete _0x517788[_0x21f5('0x2a')];}_0x306dbf[_0x21f5('0x19')](_0x55589a)[_0x21f5('0x2b')](_0x517788);};}exports[_0x21f5('0x2c')]=function(_0x30995f,_0x4c7099){var _0x278359={},_0x1111a0={},_0x3ab3f7={'count':0x0,'rows':[]};var _0x29c7cd=_['map'](db[_0x21f5('0x2d')][_0x21f5('0x2e')],function(_0x1c0200){return{'name':_0x1c0200[_0x21f5('0x2f')],'type':_0x1c0200[_0x21f5('0x30')]['key']};});_0x1111a0[_0x21f5('0x31')]=_[_0x21f5('0x32')](_0x29c7cd,'name');_0x1111a0[_0x21f5('0x33')]=_[_0x21f5('0x34')](_0x30995f[_0x21f5('0x33')]);_0x1111a0['filters']=_[_0x21f5('0x35')](_0x1111a0[_0x21f5('0x31')],_0x1111a0[_0x21f5('0x33')]);_0x278359[_0x21f5('0x36')]=_['intersection'](_0x1111a0[_0x21f5('0x31')],qs[_0x21f5('0x37')](_0x30995f['query'][_0x21f5('0x37')]));_0x278359[_0x21f5('0x36')]=_0x278359[_0x21f5('0x36')][_0x21f5('0x38')]?_0x278359[_0x21f5('0x36')]:_0x1111a0['model'];if(!_0x30995f[_0x21f5('0x33')]['hasOwnProperty'](_0x21f5('0x39'))){_0x278359['limit']=qs[_0x21f5('0x1e')](_0x30995f[_0x21f5('0x33')]['limit']);_0x278359[_0x21f5('0x1c')]=qs[_0x21f5('0x1c')](_0x30995f[_0x21f5('0x33')][_0x21f5('0x1c')]);}_0x278359['order']=qs[_0x21f5('0x3a')](_0x30995f['query'][_0x21f5('0x3a')]);_0x278359[_0x21f5('0x3b')]=qs[_0x21f5('0x3c')](_[_0x21f5('0x3d')](_0x30995f['query'],_0x1111a0[_0x21f5('0x3c')]),_0x29c7cd);if(_0x30995f[_0x21f5('0x33')][_0x21f5('0x3e')]){_0x278359['where']=_[_0x21f5('0x3f')](_0x278359[_0x21f5('0x3b')],{'$or':_[_0x21f5('0x32')](_0x29c7cd,function(_0x51970b){if(_0x51970b[_0x21f5('0x30')]!==_0x21f5('0x40')){var _0x4d28ba={};_0x4d28ba[_0x51970b['name']]={'$like':'%'+_0x30995f[_0x21f5('0x33')][_0x21f5('0x3e')]+'%'};return _0x4d28ba;}})});}_0x278359=_['merge']({},_0x278359,_0x30995f['options']);var _0x3358b1={'where':_0x278359[_0x21f5('0x3b')]};return db['AnalyticExtractedReport'][_0x21f5('0x1f')](_0x3358b1)[_0x21f5('0x25')](function(_0x447334){_0x3ab3f7[_0x21f5('0x1f')]=_0x447334;if(_0x30995f[_0x21f5('0x33')][_0x21f5('0x41')]){_0x278359[_0x21f5('0x42')]=[{'all':!![]}];}return db[_0x21f5('0x2d')]['findAll'](_0x278359);})[_0x21f5('0x25')](function(_0x593d13){_0x3ab3f7[_0x21f5('0x43')]=_0x593d13;return _0x3ab3f7;})['then'](respondWithFilteredResult(_0x4c7099,_0x278359))[_0x21f5('0x44')](handleError(_0x4c7099,null));};exports[_0x21f5('0x45')]=function(_0x53d75b,_0x1afc35){var _0xd6d5ee={'raw':!![],'where':{'id':_0x53d75b[_0x21f5('0x46')]['id']}},_0x43edea={};_0x43edea['model']=_[_0x21f5('0x34')](db[_0x21f5('0x2d')][_0x21f5('0x2e')]);_0x43edea[_0x21f5('0x33')]=_[_0x21f5('0x34')](_0x53d75b[_0x21f5('0x33')]);_0x43edea[_0x21f5('0x3c')]=_[_0x21f5('0x35')](_0x43edea[_0x21f5('0x31')],_0x43edea[_0x21f5('0x33')]);_0xd6d5ee['attributes']=_['intersection'](_0x43edea['model'],qs['fields'](_0x53d75b[_0x21f5('0x33')][_0x21f5('0x37')]));_0xd6d5ee['attributes']=_0xd6d5ee[_0x21f5('0x36')][_0x21f5('0x38')]?_0xd6d5ee[_0x21f5('0x36')]:_0x43edea['model'];if(_0x53d75b[_0x21f5('0x33')][_0x21f5('0x41')]){_0xd6d5ee[_0x21f5('0x42')]=[{'all':!![]}];}_0xd6d5ee=_[_0x21f5('0x3f')]({},_0xd6d5ee,_0x53d75b[_0x21f5('0x47')]);return db[_0x21f5('0x2d')][_0x21f5('0x48')](_0xd6d5ee)[_0x21f5('0x25')](handleEntityNotFound(_0x1afc35,null))[_0x21f5('0x25')](respondWithResult(_0x1afc35,null))[_0x21f5('0x44')](handleError(_0x1afc35,null));};exports[_0x21f5('0x49')]=function(_0x5837db,_0xdeef1c){return db[_0x21f5('0x2d')][_0x21f5('0x49')](_0x5837db[_0x21f5('0x4a')],{})[_0x21f5('0x25')](function(_0x1361e4){var _0x4eed9c=_0x5837db[_0x21f5('0x4b')][_0x21f5('0x26')]({'plain':!![]});if(!_0x4eed9c)throw new Error(_0x21f5('0x4c'));if(_0x4eed9c[_0x21f5('0x4d')]===_0x21f5('0x4b')){var _0x2b5c10=_0x1361e4['get']({'plain':!![]});var _0x161fda=_0x21f5('0x27');return db[_0x21f5('0x4e')][_0x21f5('0x48')]({'where':{'name':_0x161fda,'userProfileId':_0x4eed9c[_0x21f5('0x4f')]},'raw':!![]})[_0x21f5('0x25')](function(_0x871f88){if(_0x871f88&&_0x871f88['autoAssociation']===0x0){return db[_0x21f5('0x50')][_0x21f5('0x49')]({'name':_0x2b5c10[_0x21f5('0x2a')],'resourceId':_0x2b5c10['id'],'type':_0x871f88[_0x21f5('0x2a')],'sectionId':_0x871f88['id']},{})['then'](function(){return _0x1361e4;});}else{return _0x1361e4;}})[_0x21f5('0x44')](function(_0x15d628){logger['error'](_0x21f5('0x51'),_0x15d628);throw _0x15d628;});}return _0x1361e4;})[_0x21f5('0x25')](respondWithResult(_0xdeef1c,0xc9))[_0x21f5('0x44')](handleError(_0xdeef1c,null));};exports[_0x21f5('0x23')]=function(_0x5bf75a,_0x47ea9b){if(_0x5bf75a[_0x21f5('0x4a')]['id']){delete _0x5bf75a[_0x21f5('0x4a')]['id'];}return db[_0x21f5('0x2d')]['find']({'where':{'id':_0x5bf75a['params']['id']}})[_0x21f5('0x25')](handleEntityNotFound(_0x47ea9b,null))[_0x21f5('0x25')](saveUpdates(_0x5bf75a['body'],null))[_0x21f5('0x25')](respondWithResult(_0x47ea9b,null))[_0x21f5('0x44')](handleError(_0x47ea9b,null));};exports[_0x21f5('0x24')]=function(_0x33a842,_0x401f98){return db['AnalyticExtractedReport'][_0x21f5('0x48')]({'where':{'id':_0x33a842[_0x21f5('0x46')]['id']}})['then'](handleEntityNotFound(_0x401f98,null))[_0x21f5('0x25')](removeEntity(_0x401f98,null))[_0x21f5('0x44')](handleError(_0x401f98,null));};exports['download']=function(_0x3b4f98,_0x14e6a9,_0x15ad05){return db[_0x21f5('0x2d')][_0x21f5('0x48')]({'where':{'id':_0x3b4f98['params']['id']},'attributes':[_0x21f5('0x2a'),_0x21f5('0x52'),_0x21f5('0x53'),'output'],'raw':!![]})[_0x21f5('0x25')](handleEntityNotFound(_0x14e6a9,null))[_0x21f5('0x25')](function(_0x35a48e){if(_0x35a48e){if(!fs[_0x21f5('0x54')](path['join'](config[_0x21f5('0x55')],_0x21f5('0x56'),_0x35a48e[_0x21f5('0x53')]))){throw new db[(_0x21f5('0x57'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x3b4f98['query'][_0x21f5('0x58')]){return _0x14e6a9[_0x21f5('0x28')](0xc8);}return _0x14e6a9['download'](path[_0x21f5('0x59')](config[_0x21f5('0x55')],_0x21f5('0x56'),_0x35a48e[_0x21f5('0x53')]),util[_0x21f5('0x5a')](_0x21f5('0x5b'),_0x35a48e[_0x21f5('0x52')]||_0x35a48e[_0x21f5('0x2a')],_0x35a48e[_0x21f5('0x5c')][_0x21f5('0x5d')]()));}})[_0x21f5('0x44')](handleError(_0x14e6a9,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 26e2c46..c91f10b 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 _0x9129=['util','../../config/logger','api','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x5d77d3,_0x1fd3de){var _0x49c28f=function(_0x500cc9){while(--_0x500cc9){_0x5d77d3['push'](_0x5d77d3['shift']());}};_0x49c28f(++_0x1fd3de);}(_0x9129,0x137));var _0x9912=function(_0xf1226a,_0x29a250){_0xf1226a=_0xf1226a-0x0;var _0x1b8fe7=_0x9129[_0xf1226a];return _0x1b8fe7;};'use strict';var _=require(_0x9912('0x0'));var util=require(_0x9912('0x1'));var logger=require(_0x9912('0x2'))(_0x9912('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9912('0x4'));var rimraf=require(_0x9912('0x5'));var config=require(_0x9912('0x6'));var attributes=require(_0x9912('0x7'));module[_0x9912('0x8')]=function(_0x33d0ec,_0x2c310d){return _0x33d0ec[_0x9912('0x9')](_0x9912('0xa'),attributes,{'tableName':_0x9912('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6328=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x27ec72,_0x4c6fb2){var _0x28da1d=function(_0x2d2f3d){while(--_0x2d2f3d){_0x27ec72['push'](_0x27ec72['shift']());}};_0x28da1d(++_0x4c6fb2);}(_0x6328,0xc9));var _0x8632=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x6328[_0x3bf925];return _0x2128a1;};'use strict';var _=require(_0x8632('0x0'));var util=require('util');var logger=require(_0x8632('0x1'))('api');var moment=require(_0x8632('0x2'));var BPromise=require(_0x8632('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8632('0x4'));var rimraf=require(_0x8632('0x5'));var config=require('../../config/environment');var attributes=require(_0x8632('0x6'));module[_0x8632('0x7')]=function(_0x2a9afe,_0x26adb7){return _0x2a9afe[_0x8632('0x8')](_0x8632('0x9'),attributes,{'tableName':_0x8632('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 aba82bb..b9da371 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 _0xfdf4=['AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xfdf4,0xe6));var _0x4fdf=function(_0x34daed,_0x20a680){_0x34daed=_0x34daed-0x0;var _0x5bcafa=_0xfdf4[_0x34daed];return _0x5bcafa;};'use strict';var _=require(_0x4fdf('0x0'));var util=require(_0x4fdf('0x1'));var moment=require(_0x4fdf('0x2'));var BPromise=require(_0x4fdf('0x3'));var rs=require(_0x4fdf('0x4'));var fs=require('fs');var Redis=require(_0x4fdf('0x5'));var db=require(_0x4fdf('0x6'))['db'];var utils=require(_0x4fdf('0x7'));var logger=require('../../config/logger')(_0x4fdf('0x8'));var config=require(_0x4fdf('0x9'));var jayson=require(_0x4fdf('0xa'));var client=jayson[_0x4fdf('0xb')][_0x4fdf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x579ffe,_0x5897bc,_0x75a8ee){return new BPromise(function(_0x2c2460,_0x1b3398){return client['request'](_0x579ffe,_0x75a8ee)[_0x4fdf('0xd')](function(_0x183f9f){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5897bc,_0x4fdf('0xe'));logger[_0x4fdf('0xf')](_0x4fdf('0x10'),_0x5897bc,_0x4fdf('0xe'),JSON[_0x4fdf('0x11')](_0x183f9f));if(_0x183f9f[_0x4fdf('0x12')]){if(_0x183f9f['error'][_0x4fdf('0x13')]===0x1f4){logger[_0x4fdf('0x12')](_0x4fdf('0x14'),_0x5897bc,_0x183f9f[_0x4fdf('0x12')][_0x4fdf('0x15')]);return _0x1b3398(_0x183f9f[_0x4fdf('0x12')][_0x4fdf('0x15')]);}logger[_0x4fdf('0x12')](_0x4fdf('0x14'),_0x5897bc,_0x183f9f['error'][_0x4fdf('0x15')]);return _0x2c2460(_0x183f9f[_0x4fdf('0x12')]['message']);}else{logger[_0x4fdf('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5897bc,'request\x20sent');_0x2c2460(_0x183f9f[_0x4fdf('0x17')][_0x4fdf('0x15')]);}})[_0x4fdf('0x18')](function(_0x4ae4ce){logger[_0x4fdf('0x12')](_0x4fdf('0x14'),_0x5897bc,_0x4ae4ce);_0x1b3398(_0x4ae4ce);});});} \ No newline at end of file +var _0x9c79=['jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x44872d,_0x16199e){var _0x2cea8c=function(_0x585159){while(--_0x585159){_0x44872d['push'](_0x44872d['shift']());}};_0x2cea8c(++_0x16199e);}(_0x9c79,0x1d6));var _0x99c7=function(_0x4afe3b,_0x255e0d){_0x4afe3b=_0x4afe3b-0x0;var _0x2c22d1=_0x9c79[_0x4afe3b];return _0x2c22d1;};'use strict';var _=require(_0x99c7('0x0'));var util=require(_0x99c7('0x1'));var moment=require(_0x99c7('0x2'));var BPromise=require(_0x99c7('0x3'));var rs=require(_0x99c7('0x4'));var fs=require('fs');var Redis=require(_0x99c7('0x5'));var db=require(_0x99c7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x99c7('0x7'))(_0x99c7('0x8'));var config=require(_0x99c7('0x9'));var jayson=require(_0x99c7('0xa'));var client=jayson[_0x99c7('0xb')][_0x99c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc4c07f,_0xd30d88,_0x154e4b){return new BPromise(function(_0x53d756,_0x4b939a){return client[_0x99c7('0xd')](_0xc4c07f,_0x154e4b)['then'](function(_0x5993cd){logger[_0x99c7('0xe')](_0x99c7('0xf'),_0xd30d88,_0x99c7('0x10'));logger[_0x99c7('0x11')](_0x99c7('0x12'),_0xd30d88,'request\x20sent',JSON[_0x99c7('0x13')](_0x5993cd));if(_0x5993cd[_0x99c7('0x14')]){if(_0x5993cd[_0x99c7('0x14')]['code']===0x1f4){logger['error'](_0x99c7('0xf'),_0xd30d88,_0x5993cd[_0x99c7('0x14')]['message']);return _0x4b939a(_0x5993cd[_0x99c7('0x14')]['message']);}logger[_0x99c7('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xd30d88,_0x5993cd[_0x99c7('0x14')]['message']);return _0x53d756(_0x5993cd[_0x99c7('0x14')][_0x99c7('0x15')]);}else{logger[_0x99c7('0xe')](_0x99c7('0xf'),_0xd30d88,_0x99c7('0x10'));_0x53d756(_0x5993cd[_0x99c7('0x16')]['message']);}})[_0x99c7('0x17')](function(_0x40b6fc){logger[_0x99c7('0x14')](_0x99c7('0xf'),_0xd30d88,_0x40b6fc);_0x4b939a(_0x40b6fc);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 762da53..022b1ad 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 _0x87d2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','update','delete','util','connect-timeout','express','fs-extra'];(function(_0x53c3ac,_0x251df4){var _0x26c991=function(_0x4813bc){while(--_0x4813bc){_0x53c3ac['push'](_0x53c3ac['shift']());}};_0x26c991(++_0x251df4);}(_0x87d2,0x188));var _0x287d=function(_0x32bbaa,_0x2bc8f3){_0x32bbaa=_0x32bbaa-0x0;var _0x34077b=_0x87d2[_0x32bbaa];return _0x34077b;};'use strict';var multer=require('multer');var util=require(_0x287d('0x0'));var path=require('path');var timeout=require(_0x287d('0x1'));var express=require(_0x287d('0x2'));var router=express['Router']();var fs_extra=require(_0x287d('0x3'));var auth=require(_0x287d('0x4'));var interaction=require(_0x287d('0x5'));var config=require(_0x287d('0x6'));var controller=require(_0x287d('0x7'));router[_0x287d('0x8')]('/',auth['isAuthenticated'](),controller[_0x287d('0x9')]);router[_0x287d('0x8')](_0x287d('0xa'),auth[_0x287d('0xb')](),controller[_0x287d('0xc')]);router[_0x287d('0x8')](_0x287d('0xd'),auth[_0x287d('0xb')](),controller['download']);router[_0x287d('0xe')]('/',auth['isAuthenticated'](),controller[_0x287d('0xf')]);router['put']('/:id',auth[_0x287d('0xb')](),controller[_0x287d('0x10')]);router[_0x287d('0x11')](_0x287d('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xae88=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1f058b,_0x4a47cf){var _0x5c5232=function(_0x11eee8){while(--_0x11eee8){_0x1f058b['push'](_0x1f058b['shift']());}};_0x5c5232(++_0x4a47cf);}(_0xae88,0x15a));var _0x8ae8=function(_0x57303e,_0x355f75){_0x57303e=_0x57303e-0x0;var _0x3fc3f3=_0xae88[_0x57303e];return _0x3fc3f3;};'use strict';var multer=require(_0x8ae8('0x0'));var util=require(_0x8ae8('0x1'));var path=require(_0x8ae8('0x2'));var timeout=require(_0x8ae8('0x3'));var express=require(_0x8ae8('0x4'));var router=express[_0x8ae8('0x5')]();var fs_extra=require(_0x8ae8('0x6'));var auth=require(_0x8ae8('0x7'));var interaction=require(_0x8ae8('0x8'));var config=require('../../config/environment');var controller=require(_0x8ae8('0x9'));router[_0x8ae8('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8ae8('0xb'),auth[_0x8ae8('0xc')](),controller[_0x8ae8('0xd')]);router[_0x8ae8('0xa')](_0x8ae8('0xe'),auth[_0x8ae8('0xc')](),controller[_0x8ae8('0xf')]);router['post']('/',auth[_0x8ae8('0xc')](),controller[_0x8ae8('0x10')]);router[_0x8ae8('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8ae8('0x12')]);router[_0x8ae8('0x13')](_0x8ae8('0xb'),auth['isAuthenticated'](),controller[_0x8ae8('0x14')]);module[_0x8ae8('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 755d611..43ea3e7 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 _0x8858=['sequelize','exports','STRING','BOOLEAN'];(function(_0x243b5a,_0x4c3ec0){var _0x3584f0=function(_0x3170f1){while(--_0x3170f1){_0x243b5a['push'](_0x243b5a['shift']());}};_0x3584f0(++_0x4c3ec0);}(_0x8858,0x94));var _0x8885=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8858[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x8885('0x0'));module[_0x8885('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x8885('0x2')]},'function':{'type':Sequelize[_0x8885('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x8885('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8885('0x2')]},'custom':{'type':Sequelize[_0x8885('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xaf18=['exports','STRING','BOOLEAN'];(function(_0x58f65e,_0x467d61){var _0x35684b=function(_0x17cafe){while(--_0x17cafe){_0x58f65e['push'](_0x58f65e['shift']());}};_0x35684b(++_0x467d61);}(_0xaf18,0x1b9));var _0x8af1=function(_0x1bd646,_0x3dbb93){_0x1bd646=_0x1bd646-0x0;var _0x13cc4d=_0xaf18[_0x1bd646];return _0x13cc4d;};'use strict';var Sequelize=require('sequelize');module[_0x8af1('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x8af1('0x1')]},'format':{'type':Sequelize[_0x8af1('0x1')]},'groupBy':{'type':Sequelize[_0x8af1('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 03a7f81..ef15bb7 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 _0x57bd=['ids','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','intersection','create','body','catch','bulkCreate','find','params'];(function(_0x81a736,_0x1e437d){var _0x208d8c=function(_0x652e65){while(--_0x652e65){_0x81a736['push'](_0x81a736['shift']());}};_0x208d8c(++_0x1e437d);}(_0x57bd,0x185));var _0xd57b=function(_0x105b8b,_0x95a899){_0x105b8b=_0x105b8b-0x0;var _0x17ebda=_0x57bd[_0x105b8b];return _0x17ebda;};'use strict';var emlformat=require(_0xd57b('0x0'));var rimraf=require(_0xd57b('0x1'));var zipdir=require(_0xd57b('0x2'));var jsonpatch=require(_0xd57b('0x3'));var rp=require(_0xd57b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd57b('0x5'));var util=require('util');var path=require(_0xd57b('0x6'));var sox=require(_0xd57b('0x7'));var csv=require(_0xd57b('0x8'));var ejs=require(_0xd57b('0x9'));var fs=require('fs');var fs_extra=require(_0xd57b('0xa'));var _=require(_0xd57b('0xb'));var squel=require('squel');var crypto=require(_0xd57b('0xc'));var jsforce=require(_0xd57b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd57b('0x8'));var querystring=require(_0xd57b('0xe'));var Papa=require(_0xd57b('0xf'));var Redis=require(_0xd57b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd57b('0x11'));var logger=require(_0xd57b('0x12'))(_0xd57b('0x13'));var utils=require(_0xd57b('0x14'));var config=require(_0xd57b('0x15'));var licenseUtil=require(_0xd57b('0x16'));var db=require(_0xd57b('0x17'))['db'];function respondWithStatusCode(_0x43b0f5,_0x1ea3df){_0x1ea3df=_0x1ea3df||0xcc;return function(_0x36bec7){if(_0x36bec7){return _0x43b0f5[_0xd57b('0x18')](_0x1ea3df);}return _0x43b0f5[_0xd57b('0x19')](_0x1ea3df)[_0xd57b('0x1a')]();};}function respondWithResult(_0xccf9ad,_0x30caf0){_0x30caf0=_0x30caf0||0xc8;return function(_0x28d36e){if(_0x28d36e){return _0xccf9ad[_0xd57b('0x19')](_0x30caf0)[_0xd57b('0x1b')](_0x28d36e);}};}function respondWithFilteredResult(_0x197769,_0x47c986){return function(_0x2a0dc6){if(_0x2a0dc6){var _0x59b68a=typeof _0x47c986[_0xd57b('0x1c')]===_0xd57b('0x1d')&&typeof _0x47c986['limit']===_0xd57b('0x1d');var _0x4a0892=_0x2a0dc6[_0xd57b('0x1e')];var _0x119506=_0x59b68a?0x0:_0x47c986[_0xd57b('0x1c')];var _0x55a3b6=_0x59b68a?_0x2a0dc6[_0xd57b('0x1e')]:_0x47c986['offset']+_0x47c986[_0xd57b('0x1f')];var _0x4a8487;if(_0x55a3b6>=_0x4a0892){_0x55a3b6=_0x4a0892;_0x4a8487=0xc8;}else{_0x4a8487=0xce;}_0x197769[_0xd57b('0x19')](_0x4a8487);return _0x197769[_0xd57b('0x20')]('Content-Range',_0x119506+'-'+_0x55a3b6+'/'+_0x4a0892)[_0xd57b('0x1b')](_0x2a0dc6);}return null;};}function patchUpdates(_0x394472){return function(_0x3f7933){try{jsonpatch[_0xd57b('0x21')](_0x3f7933,_0x394472,!![]);}catch(_0x9492f8){return BPromise[_0xd57b('0x22')](_0x9492f8);}return _0x3f7933[_0xd57b('0x23')]();};}function saveUpdates(_0x2a7c65,_0x1df6c9){return function(_0x46d240){if(_0x46d240){return _0x46d240['update'](_0x2a7c65)['then'](function(_0x2c6079){return _0x2c6079;});}return null;};}function removeEntity(_0x3ccb45,_0x1c0e0d){return function(_0x471db7){if(_0x471db7){return _0x471db7[_0xd57b('0x24')]()[_0xd57b('0x25')](function(){_0x3ccb45[_0xd57b('0x19')](0xcc)[_0xd57b('0x1a')]();});}};}function handleEntityNotFound(_0x1604e4,_0x2634c1){return function(_0x21e7c9){if(!_0x21e7c9){_0x1604e4[_0xd57b('0x18')](0x194);}return _0x21e7c9;};}function handleError(_0x4f84b7,_0x2a9e46){_0x2a9e46=_0x2a9e46||0x1f4;return function(_0x1c18c4){logger[_0xd57b('0x26')](_0x1c18c4['stack']);if(_0x1c18c4[_0xd57b('0x27')]){delete _0x1c18c4[_0xd57b('0x27')];}_0x4f84b7[_0xd57b('0x19')](_0x2a9e46)[_0xd57b('0x28')](_0x1c18c4);};}exports['index']=function(_0x4561cb,_0x3c7140){var _0x264a0b={},_0x3fa723={},_0x45d389={'count':0x0,'rows':[]};var _0x4c6816=_[_0xd57b('0x29')](db[_0xd57b('0x2a')][_0xd57b('0x2b')],function(_0x27c58b){return{'name':_0x27c58b[_0xd57b('0x2c')],'type':_0x27c58b['type']['key']};});_0x3fa723[_0xd57b('0x2d')]=_[_0xd57b('0x29')](_0x4c6816,_0xd57b('0x27'));_0x3fa723['query']=_[_0xd57b('0x2e')](_0x4561cb[_0xd57b('0x2f')]);_0x3fa723[_0xd57b('0x30')]=_['intersection'](_0x3fa723['model'],_0x3fa723[_0xd57b('0x2f')]);_0x264a0b[_0xd57b('0x31')]=_['intersection'](_0x3fa723[_0xd57b('0x2d')],qs[_0xd57b('0x32')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x32')]));_0x264a0b[_0xd57b('0x31')]=_0x264a0b[_0xd57b('0x31')][_0xd57b('0x33')]?_0x264a0b['attributes']:_0x3fa723[_0xd57b('0x2d')];if(!_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x34')]('nolimit')){_0x264a0b[_0xd57b('0x1f')]=qs[_0xd57b('0x1f')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x1f')]);_0x264a0b[_0xd57b('0x1c')]=qs[_0xd57b('0x1c')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x1c')]);}_0x264a0b[_0xd57b('0x35')]=qs[_0xd57b('0x36')](_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x36')]);_0x264a0b['where']=qs[_0xd57b('0x30')](_[_0xd57b('0x37')](_0x4561cb['query'],_0x3fa723[_0xd57b('0x30')]),_0x4c6816);if(_0x4561cb['query'][_0xd57b('0x38')]){_0x264a0b[_0xd57b('0x39')]=_[_0xd57b('0x3a')](_0x264a0b['where'],{'$or':_[_0xd57b('0x29')](_0x4c6816,function(_0x1b847e){if(_0x1b847e[_0xd57b('0x3b')]!==_0xd57b('0x3c')){var _0x2f0460={};_0x2f0460[_0x1b847e['name']]={'$like':'%'+_0x4561cb[_0xd57b('0x2f')]['filter']+'%'};return _0x2f0460;}})});}_0x264a0b=_[_0xd57b('0x3a')]({},_0x264a0b,_0x4561cb[_0xd57b('0x3d')]);var _0x58cb0c={'where':_0x264a0b[_0xd57b('0x39')]};return db[_0xd57b('0x2a')][_0xd57b('0x1e')](_0x58cb0c)[_0xd57b('0x25')](function(_0x498cda){_0x45d389[_0xd57b('0x1e')]=_0x498cda;if(_0x4561cb[_0xd57b('0x2f')][_0xd57b('0x3e')]){_0x264a0b[_0xd57b('0x3f')]=[{'all':!![]}];}return db[_0xd57b('0x2a')][_0xd57b('0x40')](_0x264a0b);})[_0xd57b('0x25')](function(_0x10de27){_0x45d389[_0xd57b('0x41')]=_0x10de27;return _0x45d389;})[_0xd57b('0x25')](respondWithFilteredResult(_0x3c7140,_0x264a0b))['catch'](handleError(_0x3c7140,null));};exports['show']=function(_0x3ea241,_0x1b79f7){var _0x1503cb={'raw':![],'where':{'id':_0x3ea241['params']['id']}},_0x98d5a4={};_0x98d5a4[_0xd57b('0x2d')]=_[_0xd57b('0x2e')](db[_0xd57b('0x2a')][_0xd57b('0x2b')]);_0x98d5a4[_0xd57b('0x2f')]=_[_0xd57b('0x2e')](_0x3ea241[_0xd57b('0x2f')]);_0x98d5a4[_0xd57b('0x30')]=_[_0xd57b('0x42')](_0x98d5a4[_0xd57b('0x2d')],_0x98d5a4[_0xd57b('0x2f')]);_0x1503cb[_0xd57b('0x31')]=_[_0xd57b('0x42')](_0x98d5a4['model'],qs[_0xd57b('0x32')](_0x3ea241[_0xd57b('0x2f')][_0xd57b('0x32')]));_0x1503cb[_0xd57b('0x31')]=_0x1503cb[_0xd57b('0x31')][_0xd57b('0x33')]?_0x1503cb[_0xd57b('0x31')]:_0x98d5a4[_0xd57b('0x2d')];if(_0x3ea241[_0xd57b('0x2f')][_0xd57b('0x3e')]){_0x1503cb['include']=[{'all':!![]}];}_0x1503cb=_[_0xd57b('0x3a')]({},_0x1503cb,_0x3ea241[_0xd57b('0x3d')]);return db[_0xd57b('0x2a')]['find'](_0x1503cb)[_0xd57b('0x25')](handleEntityNotFound(_0x1b79f7,null))[_0xd57b('0x25')](respondWithResult(_0x1b79f7,null))['catch'](handleError(_0x1b79f7,null));};exports[_0xd57b('0x43')]=function(_0x5990cd,_0x1a21a1){return db[_0xd57b('0x2a')][_0xd57b('0x43')](_0x5990cd[_0xd57b('0x44')],{})[_0xd57b('0x25')](respondWithResult(_0x1a21a1,0xc9))[_0xd57b('0x45')](handleError(_0x1a21a1,null));};exports[_0xd57b('0x46')]=function(_0x361138,_0x19fed7){return db[_0xd57b('0x2a')][_0xd57b('0x46')](_0x361138[_0xd57b('0x44')],{'raw':![],'individualHooks':!![]})[_0xd57b('0x25')](respondWithResult(_0x19fed7,0xc9))[_0xd57b('0x45')](handleError(_0x19fed7,null));};exports['update']=function(_0x1349c5,_0x242526){if(_0x1349c5[_0xd57b('0x44')]['id']){delete _0x1349c5[_0xd57b('0x44')]['id'];}return db[_0xd57b('0x2a')][_0xd57b('0x47')]({'where':{'id':_0x1349c5[_0xd57b('0x48')]['id']}})['then'](handleEntityNotFound(_0x242526,null))[_0xd57b('0x25')](saveUpdates(_0x1349c5[_0xd57b('0x44')],null))[_0xd57b('0x25')](respondWithResult(_0x242526,null))['catch'](handleError(_0x242526,null));};exports[_0xd57b('0x24')]=function(_0x3f5416,_0x5cc8ed){return db[_0xd57b('0x2a')][_0xd57b('0x47')]({'where':{'id':_0x3f5416['params']['id']}})[_0xd57b('0x25')](handleEntityNotFound(_0x5cc8ed,null))[_0xd57b('0x25')](removeEntity(_0x5cc8ed,null))[_0xd57b('0x45')](handleError(_0x5cc8ed,null));};exports['bulkDestroy']=function(_0x1b5653,_0x5250fa){return db[_0xd57b('0x2a')][_0xd57b('0x24')]({'where':{'id':_0x1b5653[_0xd57b('0x2f')][_0xd57b('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xd57b('0x25')](respondWithResult(_0x5250fa,0xcc))[_0xd57b('0x45')](handleError(_0x5250fa,null));};exports['addFields']=function(_0x1d6786,_0x2621d9,_0x59bc1e){return db[_0xd57b('0x4a')][_0xd57b('0x4b')]({'where':{'id':_0x1d6786[_0xd57b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2621d9,null))[_0xd57b('0x25')](function(_0x37de0d){if(_0x37de0d){return db['sequelize'][_0xd57b('0x4c')](function(_0x1037ac){return db[_0xd57b('0x2a')]['destroy']({'where':{'CustomReportId':_0x1d6786[_0xd57b('0x48')]['id']},'transaction':_0x1037ac})[_0xd57b('0x25')](function(_0x2aa4e8){var _0x126f40=_[_0xd57b('0x29')](_0x1d6786[_0xd57b('0x44')],function(_0x4f18b8){delete _0x4f18b8['id'];_0x4f18b8['CustomReportId']=_0x1d6786[_0xd57b('0x48')]['id'];return _0x4f18b8;});return db[_0xd57b('0x2a')][_0xd57b('0x46')](_0x126f40,{'transaction':_0x1037ac});});})[_0xd57b('0x25')](function(){return db[_0xd57b('0x2a')][_0xd57b('0x40')]({'where':{'CustomReportId':_0x1d6786[_0xd57b('0x48')]['id']}});});}})[_0xd57b('0x25')](respondWithResult(_0x2621d9,null))[_0xd57b('0x45')](handleError(_0x2621d9,null));}; \ No newline at end of file +var _0x4c61=['update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','keys','AnalyticFieldReport','length','include','create','body','bulkCreate','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','rimraf','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4c61,0xca));var _0x14c6=function(_0x4937b5,_0x2db161){_0x4937b5=_0x4937b5-0x0;var _0x415fe8=_0x4c61[_0x4937b5];return _0x415fe8;};'use strict';var emlformat=require(_0x14c6('0x0'));var rimraf=require(_0x14c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14c6('0x2'));var rp=require(_0x14c6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x14c6('0x4'));var sox=require('sox');var csv=require(_0x14c6('0x5'));var ejs=require(_0x14c6('0x6'));var fs=require('fs');var fs_extra=require(_0x14c6('0x7'));var _=require('lodash');var squel=require(_0x14c6('0x8'));var crypto=require(_0x14c6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x14c6('0xa'));var toCsv=require(_0x14c6('0x5'));var querystring=require(_0x14c6('0xb'));var Papa=require(_0x14c6('0xc'));var Redis=require(_0x14c6('0xd'));var authService=require(_0x14c6('0xe'));var qs=require(_0x14c6('0xf'));var as=require(_0x14c6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14c6('0x11'))(_0x14c6('0x12'));var utils=require(_0x14c6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x14c6('0x14'));var db=require(_0x14c6('0x15'))['db'];function respondWithStatusCode(_0x234935,_0x14c805){_0x14c805=_0x14c805||0xcc;return function(_0x2a255d){if(_0x2a255d){return _0x234935[_0x14c6('0x16')](_0x14c805);}return _0x234935[_0x14c6('0x17')](_0x14c805)[_0x14c6('0x18')]();};}function respondWithResult(_0x3f1c6b,_0x5baf13){_0x5baf13=_0x5baf13||0xc8;return function(_0x15dab1){if(_0x15dab1){return _0x3f1c6b[_0x14c6('0x17')](_0x5baf13)['json'](_0x15dab1);}};}function respondWithFilteredResult(_0x199bde,_0x527b60){return function(_0xab77f){if(_0xab77f){var _0x3d4b5f=typeof _0x527b60['offset']===_0x14c6('0x19')&&typeof _0x527b60[_0x14c6('0x1a')]===_0x14c6('0x19');var _0x29fe20=_0xab77f[_0x14c6('0x1b')];var _0x8d6b58=_0x3d4b5f?0x0:_0x527b60[_0x14c6('0x1c')];var _0x2d4974=_0x3d4b5f?_0xab77f[_0x14c6('0x1b')]:_0x527b60[_0x14c6('0x1c')]+_0x527b60[_0x14c6('0x1a')];var _0x3530be;if(_0x2d4974>=_0x29fe20){_0x2d4974=_0x29fe20;_0x3530be=0xc8;}else{_0x3530be=0xce;}_0x199bde[_0x14c6('0x17')](_0x3530be);return _0x199bde[_0x14c6('0x1d')](_0x14c6('0x1e'),_0x8d6b58+'-'+_0x2d4974+'/'+_0x29fe20)['json'](_0xab77f);}return null;};}function patchUpdates(_0x45383b){return function(_0x579a29){try{jsonpatch[_0x14c6('0x1f')](_0x579a29,_0x45383b,!![]);}catch(_0x17900b){return BPromise['reject'](_0x17900b);}return _0x579a29['save']();};}function saveUpdates(_0x5b34cb,_0x1e2f55){return function(_0x4e869b){if(_0x4e869b){return _0x4e869b[_0x14c6('0x20')](_0x5b34cb)[_0x14c6('0x21')](function(_0x8bcd4d){return _0x8bcd4d;});}return null;};}function removeEntity(_0xc77e70,_0x261c04){return function(_0x49049a){if(_0x49049a){return _0x49049a['destroy']()['then'](function(){_0xc77e70['status'](0xcc)[_0x14c6('0x18')]();});}};}function handleEntityNotFound(_0x38fb0d,_0x58a080){return function(_0x396df0){if(!_0x396df0){_0x38fb0d[_0x14c6('0x16')](0x194);}return _0x396df0;};}function handleError(_0x33ce2f,_0xc7efdc){_0xc7efdc=_0xc7efdc||0x1f4;return function(_0x15dc4f){logger[_0x14c6('0x22')](_0x15dc4f['stack']);if(_0x15dc4f[_0x14c6('0x23')]){delete _0x15dc4f[_0x14c6('0x23')];}_0x33ce2f[_0x14c6('0x17')](_0xc7efdc)[_0x14c6('0x24')](_0x15dc4f);};}exports[_0x14c6('0x25')]=function(_0xf13744,_0x4670cc){var _0x35d639={},_0x27fa10={},_0x3e6a5e={'count':0x0,'rows':[]};var _0x29629e=_[_0x14c6('0x26')](db['AnalyticFieldReport'][_0x14c6('0x27')],function(_0x2b16af){return{'name':_0x2b16af[_0x14c6('0x28')],'type':_0x2b16af[_0x14c6('0x29')][_0x14c6('0x2a')]};});_0x27fa10[_0x14c6('0x2b')]=_[_0x14c6('0x26')](_0x29629e,_0x14c6('0x23'));_0x27fa10[_0x14c6('0x2c')]=_['keys'](_0xf13744[_0x14c6('0x2c')]);_0x27fa10[_0x14c6('0x2d')]=_[_0x14c6('0x2e')](_0x27fa10[_0x14c6('0x2b')],_0x27fa10[_0x14c6('0x2c')]);_0x35d639['attributes']=_['intersection'](_0x27fa10[_0x14c6('0x2b')],qs[_0x14c6('0x2f')](_0xf13744[_0x14c6('0x2c')][_0x14c6('0x2f')]));_0x35d639[_0x14c6('0x30')]=_0x35d639[_0x14c6('0x30')]['length']?_0x35d639[_0x14c6('0x30')]:_0x27fa10[_0x14c6('0x2b')];if(!_0xf13744[_0x14c6('0x2c')][_0x14c6('0x31')](_0x14c6('0x32'))){_0x35d639['limit']=qs[_0x14c6('0x1a')](_0xf13744[_0x14c6('0x2c')][_0x14c6('0x1a')]);_0x35d639[_0x14c6('0x1c')]=qs[_0x14c6('0x1c')](_0xf13744[_0x14c6('0x2c')][_0x14c6('0x1c')]);}_0x35d639[_0x14c6('0x33')]=qs[_0x14c6('0x34')](_0xf13744[_0x14c6('0x2c')][_0x14c6('0x34')]);_0x35d639[_0x14c6('0x35')]=qs[_0x14c6('0x2d')](_[_0x14c6('0x36')](_0xf13744['query'],_0x27fa10['filters']),_0x29629e);if(_0xf13744[_0x14c6('0x2c')][_0x14c6('0x37')]){_0x35d639[_0x14c6('0x35')]=_[_0x14c6('0x38')](_0x35d639[_0x14c6('0x35')],{'$or':_['map'](_0x29629e,function(_0x21f231){if(_0x21f231[_0x14c6('0x29')]!==_0x14c6('0x39')){var _0x3ebd2e={};_0x3ebd2e[_0x21f231[_0x14c6('0x23')]]={'$like':'%'+_0xf13744[_0x14c6('0x2c')][_0x14c6('0x37')]+'%'};return _0x3ebd2e;}})});}_0x35d639=_['merge']({},_0x35d639,_0xf13744[_0x14c6('0x3a')]);var _0x3fc831={'where':_0x35d639[_0x14c6('0x35')]};return db['AnalyticFieldReport'][_0x14c6('0x1b')](_0x3fc831)[_0x14c6('0x21')](function(_0x4df068){_0x3e6a5e[_0x14c6('0x1b')]=_0x4df068;if(_0xf13744[_0x14c6('0x2c')][_0x14c6('0x3b')]){_0x35d639['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x14c6('0x3c')](_0x35d639);})['then'](function(_0xaa13fb){_0x3e6a5e['rows']=_0xaa13fb;return _0x3e6a5e;})['then'](respondWithFilteredResult(_0x4670cc,_0x35d639))[_0x14c6('0x3d')](handleError(_0x4670cc,null));};exports['show']=function(_0x2fda35,_0x4b053d){var _0x1c46d3={'raw':![],'where':{'id':_0x2fda35[_0x14c6('0x3e')]['id']}},_0x13bfb1={};_0x13bfb1['model']=_[_0x14c6('0x3f')](db[_0x14c6('0x40')][_0x14c6('0x27')]);_0x13bfb1[_0x14c6('0x2c')]=_[_0x14c6('0x3f')](_0x2fda35[_0x14c6('0x2c')]);_0x13bfb1[_0x14c6('0x2d')]=_[_0x14c6('0x2e')](_0x13bfb1[_0x14c6('0x2b')],_0x13bfb1[_0x14c6('0x2c')]);_0x1c46d3[_0x14c6('0x30')]=_[_0x14c6('0x2e')](_0x13bfb1[_0x14c6('0x2b')],qs['fields'](_0x2fda35['query']['fields']));_0x1c46d3[_0x14c6('0x30')]=_0x1c46d3[_0x14c6('0x30')][_0x14c6('0x41')]?_0x1c46d3[_0x14c6('0x30')]:_0x13bfb1[_0x14c6('0x2b')];if(_0x2fda35[_0x14c6('0x2c')]['includeAll']){_0x1c46d3[_0x14c6('0x42')]=[{'all':!![]}];}_0x1c46d3=_[_0x14c6('0x38')]({},_0x1c46d3,_0x2fda35['options']);return db[_0x14c6('0x40')]['find'](_0x1c46d3)['then'](handleEntityNotFound(_0x4b053d,null))[_0x14c6('0x21')](respondWithResult(_0x4b053d,null))[_0x14c6('0x3d')](handleError(_0x4b053d,null));};exports[_0x14c6('0x43')]=function(_0x5b3b74,_0x162463){return db[_0x14c6('0x40')][_0x14c6('0x43')](_0x5b3b74[_0x14c6('0x44')],{})[_0x14c6('0x21')](respondWithResult(_0x162463,0xc9))[_0x14c6('0x3d')](handleError(_0x162463,null));};exports[_0x14c6('0x45')]=function(_0xf60f36,_0x257262){return db[_0x14c6('0x40')][_0x14c6('0x45')](_0xf60f36[_0x14c6('0x44')],{'raw':![],'individualHooks':!![]})[_0x14c6('0x21')](respondWithResult(_0x257262,0xc9))[_0x14c6('0x3d')](handleError(_0x257262,null));};exports['update']=function(_0x27a1ac,_0x38529b){if(_0x27a1ac[_0x14c6('0x44')]['id']){delete _0x27a1ac[_0x14c6('0x44')]['id'];}return db['AnalyticFieldReport'][_0x14c6('0x46')]({'where':{'id':_0x27a1ac[_0x14c6('0x3e')]['id']}})[_0x14c6('0x21')](handleEntityNotFound(_0x38529b,null))['then'](saveUpdates(_0x27a1ac['body'],null))[_0x14c6('0x21')](respondWithResult(_0x38529b,null))['catch'](handleError(_0x38529b,null));};exports['destroy']=function(_0x148872,_0x4b7ffb){return db['AnalyticFieldReport'][_0x14c6('0x46')]({'where':{'id':_0x148872[_0x14c6('0x3e')]['id']}})[_0x14c6('0x21')](handleEntityNotFound(_0x4b7ffb,null))['then'](removeEntity(_0x4b7ffb,null))['catch'](handleError(_0x4b7ffb,null));};exports[_0x14c6('0x47')]=function(_0x147639,_0x3e8ece){return db[_0x14c6('0x40')][_0x14c6('0x48')]({'where':{'id':_0x147639['query'][_0x14c6('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x14c6('0x21')](respondWithResult(_0x3e8ece,0xcc))['catch'](handleError(_0x3e8ece,null));};exports[_0x14c6('0x4a')]=function(_0x415bfc,_0x220781,_0x537329){return db[_0x14c6('0x4b')][_0x14c6('0x4c')]({'where':{'id':_0x415bfc[_0x14c6('0x3e')]['id']}})[_0x14c6('0x21')](handleEntityNotFound(_0x220781,null))['then'](function(_0x41d15c){if(_0x41d15c){return db[_0x14c6('0x4d')]['transaction'](function(_0x23533c){return db[_0x14c6('0x40')][_0x14c6('0x48')]({'where':{'CustomReportId':_0x415bfc[_0x14c6('0x3e')]['id']},'transaction':_0x23533c})[_0x14c6('0x21')](function(_0x1268e2){var _0x152736=_[_0x14c6('0x26')](_0x415bfc[_0x14c6('0x44')],function(_0x27a4b5){delete _0x27a4b5['id'];_0x27a4b5['CustomReportId']=_0x415bfc[_0x14c6('0x3e')]['id'];return _0x27a4b5;});return db[_0x14c6('0x40')][_0x14c6('0x45')](_0x152736,{'transaction':_0x23533c});});})['then'](function(){return db[_0x14c6('0x40')][_0x14c6('0x3c')]({'where':{'CustomReportId':_0x415bfc['params']['id']}});});}})[_0x14c6('0x21')](respondWithResult(_0x220781,null))[_0x14c6('0x3d')](handleError(_0x220781,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 43f6d5e..ca21896 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 _0xdd5c=['exports','AnalyticFieldReport','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xdd5c,0x156));var _0xcdd5=function(_0x45bcb1,_0x46cad0){_0x45bcb1=_0x45bcb1-0x0;var _0x4bd6a3=_0xdd5c[_0x45bcb1];return _0x4bd6a3;};'use strict';var _=require(_0xcdd5('0x0'));var util=require(_0xcdd5('0x1'));var logger=require(_0xcdd5('0x2'))('api');var moment=require(_0xcdd5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd5('0x4'));var rimraf=require(_0xcdd5('0x5'));var config=require(_0xcdd5('0x6'));var attributes=require(_0xcdd5('0x7'));module[_0xcdd5('0x8')]=function(_0x3b14ee,_0x4942d6){return _0x3b14ee['define'](_0xcdd5('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa46=['analytics_report_fields','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xfa46,0x94));var _0x6fa4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfa46[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6fa4('0x0'))('api');var moment=require(_0x6fa4('0x1'));var BPromise=require('bluebird');var rp=require(_0x6fa4('0x2'));var fs=require('fs');var path=require(_0x6fa4('0x3'));var rimraf=require(_0x6fa4('0x4'));var config=require(_0x6fa4('0x5'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x4c1d57,_0x521ae3){return _0x4c1d57['define']('AnalyticFieldReport',attributes,{'tableName':_0x6fa4('0x6'),'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 4466191..75f32b5 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 _0xb130=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x475def,_0x579a6e){var _0x109214=function(_0x2b3218){while(--_0x2b3218){_0x475def['push'](_0x475def['shift']());}};_0x109214(++_0x579a6e);}(_0xb130,0x86));var _0x0b13=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xb130[_0x119b3e];return _0x1169ae;};'use strict';var _=require(_0x0b13('0x0'));var util=require('util');var moment=require(_0x0b13('0x1'));var BPromise=require(_0x0b13('0x2'));var rs=require(_0x0b13('0x3'));var fs=require('fs');var Redis=require(_0x0b13('0x4'));var db=require(_0x0b13('0x5'))['db'];var utils=require(_0x0b13('0x6'));var logger=require(_0x0b13('0x7'))(_0x0b13('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0b13('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568722,_0x3f71b4,_0xc62cc4){return new BPromise(function(_0x19fdc2,_0x8280b5){return client[_0x0b13('0xa')](_0x568722,_0xc62cc4)[_0x0b13('0xb')](function(_0x2d11cd){logger[_0x0b13('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x0b13('0xd'));logger[_0x0b13('0xe')](_0x0b13('0xf'),_0x3f71b4,'request\x20sent',JSON[_0x0b13('0x10')](_0x2d11cd));if(_0x2d11cd[_0x0b13('0x11')]){if(_0x2d11cd[_0x0b13('0x11')][_0x0b13('0x12')]===0x1f4){logger[_0x0b13('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x2d11cd['error'][_0x0b13('0x13')]);return _0x8280b5(_0x2d11cd[_0x0b13('0x11')][_0x0b13('0x13')]);}logger['error'](_0x0b13('0x14'),_0x3f71b4,_0x2d11cd['error']['message']);return _0x19fdc2(_0x2d11cd[_0x0b13('0x11')][_0x0b13('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x0b13('0xd'));_0x19fdc2(_0x2d11cd[_0x0b13('0x15')][_0x0b13('0x13')]);}})[_0x0b13('0x16')](function(_0x485688){logger[_0x0b13('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f71b4,_0x485688);_0x8280b5(_0x485688);});});} \ No newline at end of file +var _0x2994=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','jayson/promise','client','http'];(function(_0x13f674,_0x316463){var _0x92b2fa=function(_0x5c2d1d){while(--_0x5c2d1d){_0x13f674['push'](_0x13f674['shift']());}};_0x92b2fa(++_0x316463);}(_0x2994,0x1aa));var _0x4299=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x2994[_0x2f1114];return _0x2fe856;};'use strict';var _=require('lodash');var util=require(_0x4299('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4299('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4299('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4299('0x3'));var client=jayson[_0x4299('0x4')][_0x4299('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x262649,_0x27f396,_0xb436ac){return new BPromise(function(_0x2927d1,_0x51472f){return client[_0x4299('0x6')](_0x262649,_0xb436ac)[_0x4299('0x7')](function(_0x14e94f){logger[_0x4299('0x8')](_0x4299('0x9'),_0x27f396,_0x4299('0xa'));logger['debug'](_0x4299('0xb'),_0x27f396,_0x4299('0xa'),JSON[_0x4299('0xc')](_0x14e94f));if(_0x14e94f[_0x4299('0xd')]){if(_0x14e94f[_0x4299('0xd')][_0x4299('0xe')]===0x1f4){logger[_0x4299('0xd')](_0x4299('0x9'),_0x27f396,_0x14e94f[_0x4299('0xd')][_0x4299('0xf')]);return _0x51472f(_0x14e94f[_0x4299('0xd')][_0x4299('0xf')]);}logger[_0x4299('0xd')](_0x4299('0x9'),_0x27f396,_0x14e94f['error'][_0x4299('0xf')]);return _0x2927d1(_0x14e94f[_0x4299('0xd')][_0x4299('0xf')]);}else{logger[_0x4299('0x8')](_0x4299('0x9'),_0x27f396,_0x4299('0xa'));_0x2927d1(_0x14e94f[_0x4299('0x10')][_0x4299('0xf')]);}})[_0x4299('0x11')](function(_0x5811a1){logger['error'](_0x4299('0x9'),_0x27f396,_0x5811a1);_0x51472f(_0x5811a1);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 5d0a27b..48865da 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(_0x2715fe,_0x4e0f99){var _0x45f432=function(_0x636842){while(--_0x636842){_0x2715fe['push'](_0x2715fe['shift']());}};_0x45f432(++_0x4e0f99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x42b91e,_0x4da2c5){var _0x490d74=function(_0x5eec3d){while(--_0x5eec3d){_0x42b91e['push'](_0x42b91e['shift']());}};_0x490d74(++_0x4da2c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 e14adad..40a69c2 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 _0x9d62=['exports','STRING','name','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9d62,0xaf));var _0x29d6=function(_0x4805f4,_0xdf483e){_0x4805f4=_0x4805f4-0x0;var _0x1c63d4=_0x9d62[_0x4805f4];return _0x1c63d4;};'use strict';var Sequelize=require(_0x29d6('0x0'));module[_0x29d6('0x1')]={'name':{'type':Sequelize[_0x29d6('0x2')],'allowNull':![],'unique':_0x29d6('0x3')},'table':{'type':Sequelize[_0x29d6('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x29d6('0x2')]}}; \ No newline at end of file +var _0xeebe=['sequelize','STRING','TEXT'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xeebe,0xff));var _0xeeeb=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xeebe[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xeeeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xeeeb('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xeeeb('0x1')]},'metric':{'type':Sequelize[_0xeeeb('0x2')]},'description':{'type':Sequelize[_0xeeeb('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 53bf953..ab1baa3 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x9b26e0,_0x4643d7){var _0x35c253=function(_0x12c449){while(--_0x12c449){_0x9b26e0['push'](_0x9b26e0['shift']());}};_0x35c253(++_0x4643d7);}(_0x24ca,0x1bc));var _0xa24c=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x24ca[_0x282a1f];return _0x296ea7;};'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'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0xe3e516,_0x2c591e){var _0x57d43c=function(_0x2abd44){while(--_0x2abd44){_0xe3e516['push'](_0xe3e516['shift']());}};_0x57d43c(++_0x2c591e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d85a1d9..74c593b 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 _0xba0d=['api','moment','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger'];(function(_0x536ba4,_0x58d964){var _0x4eae23=function(_0x4b6e91){while(--_0x4b6e91){_0x536ba4['push'](_0x536ba4['shift']());}};_0x4eae23(++_0x58d964);}(_0xba0d,0x8e));var _0xdba0=function(_0x5441eb,_0x395a7b){_0x5441eb=_0x5441eb-0x0;var _0x458a33=_0xba0d[_0x5441eb];return _0x458a33;};'use strict';var _=require(_0xdba0('0x0'));var util=require('util');var logger=require(_0xdba0('0x1'))(_0xdba0('0x2'));var moment=require(_0xdba0('0x3'));var BPromise=require('bluebird');var rp=require(_0xdba0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdba0('0x5'));var config=require(_0xdba0('0x6'));var attributes=require(_0xdba0('0x7'));module[_0xdba0('0x8')]=function(_0x592a53,_0x59e841){return _0x592a53[_0xdba0('0x9')](_0xdba0('0xa'),attributes,{'tableName':_0xdba0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f4a=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4335db,_0x10d0ad){var _0x1270e9=function(_0x22de36){while(--_0x22de36){_0x4335db['push'](_0x4335db['shift']());}};_0x1270e9(++_0x10d0ad);}(_0x2f4a,0x8f));var _0xa2f4=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x2f4a[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xa2f4('0x0'));var util=require(_0xa2f4('0x1'));var logger=require(_0xa2f4('0x2'))(_0xa2f4('0x3'));var moment=require(_0xa2f4('0x4'));var BPromise=require(_0xa2f4('0x5'));var rp=require(_0xa2f4('0x6'));var fs=require('fs');var path=require(_0xa2f4('0x7'));var rimraf=require(_0xa2f4('0x8'));var config=require(_0xa2f4('0x9'));var attributes=require('./analyticMetric.attributes');module[_0xa2f4('0xa')]=function(_0x3d4545,_0x37ccfa){return _0x3d4545[_0xa2f4('0xb')](_0xa2f4('0xc'),attributes,{'tableName':_0xa2f4('0xd'),'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 c0e803a..62878c2 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 _0x24be=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s'];(function(_0x1c9bf9,_0xf95651){var _0x4f948f=function(_0x20be74){while(--_0x20be74){_0x1c9bf9['push'](_0x1c9bf9['shift']());}};_0x4f948f(++_0xf95651);}(_0x24be,0x69));var _0xe24b=function(_0x55713f,_0x1eaecc){_0x55713f=_0x55713f-0x0;var _0x5adbba=_0x24be[_0x55713f];return _0x5adbba;};'use strict';var _=require(_0xe24b('0x0'));var util=require(_0xe24b('0x1'));var moment=require(_0xe24b('0x2'));var BPromise=require(_0xe24b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe24b('0x4'));var db=require(_0xe24b('0x5'))['db'];var utils=require(_0xe24b('0x6'));var logger=require(_0xe24b('0x7'))(_0xe24b('0x8'));var config=require(_0xe24b('0x9'));var jayson=require(_0xe24b('0xa'));var client=jayson[_0xe24b('0xb')][_0xe24b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23c1e5,_0x3d850c,_0x2d1f98){return new BPromise(function(_0x3d088e,_0x50e26e){return client['request'](_0x23c1e5,_0x2d1f98)[_0xe24b('0xd')](function(_0x1c29a5){logger['info'](_0xe24b('0xe'),_0x3d850c,_0xe24b('0xf'));logger[_0xe24b('0x10')](_0xe24b('0x11'),_0x3d850c,_0xe24b('0xf'),JSON[_0xe24b('0x12')](_0x1c29a5));if(_0x1c29a5['error']){if(_0x1c29a5[_0xe24b('0x13')][_0xe24b('0x14')]===0x1f4){logger[_0xe24b('0x13')](_0xe24b('0xe'),_0x3d850c,_0x1c29a5[_0xe24b('0x13')]['message']);return _0x50e26e(_0x1c29a5[_0xe24b('0x13')][_0xe24b('0x15')]);}logger[_0xe24b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3d850c,_0x1c29a5['error']['message']);return _0x3d088e(_0x1c29a5[_0xe24b('0x13')][_0xe24b('0x15')]);}else{logger[_0xe24b('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x3d850c,_0xe24b('0xf'));_0x3d088e(_0x1c29a5[_0xe24b('0x17')]['message']);}})['catch'](function(_0xf0ec55){logger['error'](_0xe24b('0xe'),_0x3d850c,_0xf0ec55);_0x50e26e(_0xf0ec55);});});} \ No newline at end of file +var _0x5721=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3d63cf,_0x7cda4c){var _0x585d95=function(_0x2420b8){while(--_0x2420b8){_0x3d63cf['push'](_0x3d63cf['shift']());}};_0x585d95(++_0x7cda4c);}(_0x5721,0xe0));var _0x1572=function(_0x1193cb,_0x588c90){_0x1193cb=_0x1193cb-0x0;var _0x1ed3e8=_0x5721[_0x1193cb];return _0x1ed3e8;};'use strict';var _=require('lodash');var util=require(_0x1572('0x0'));var moment=require(_0x1572('0x1'));var BPromise=require(_0x1572('0x2'));var rs=require(_0x1572('0x3'));var fs=require('fs');var Redis=require(_0x1572('0x4'));var db=require(_0x1572('0x5'))['db'];var utils=require(_0x1572('0x6'));var logger=require(_0x1572('0x7'))(_0x1572('0x8'));var config=require(_0x1572('0x9'));var jayson=require(_0x1572('0xa'));var client=jayson[_0x1572('0xb')][_0x1572('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47a8f0,_0x5da5dc,_0x110cc2){return new BPromise(function(_0x41975f,_0x1f4101){return client[_0x1572('0xd')](_0x47a8f0,_0x110cc2)[_0x1572('0xe')](function(_0x41cf7a){logger[_0x1572('0xf')](_0x1572('0x10'),_0x5da5dc,_0x1572('0x11'));logger[_0x1572('0x12')](_0x1572('0x13'),_0x5da5dc,_0x1572('0x11'),JSON['stringify'](_0x41cf7a));if(_0x41cf7a[_0x1572('0x14')]){if(_0x41cf7a[_0x1572('0x14')][_0x1572('0x15')]===0x1f4){logger['error'](_0x1572('0x10'),_0x5da5dc,_0x41cf7a[_0x1572('0x14')][_0x1572('0x16')]);return _0x1f4101(_0x41cf7a[_0x1572('0x14')][_0x1572('0x16')]);}logger[_0x1572('0x14')](_0x1572('0x10'),_0x5da5dc,_0x41cf7a[_0x1572('0x14')][_0x1572('0x16')]);return _0x41975f(_0x41cf7a['error'][_0x1572('0x16')]);}else{logger[_0x1572('0xf')](_0x1572('0x10'),_0x5da5dc,_0x1572('0x11'));_0x41975f(_0x41cf7a[_0x1572('0x17')][_0x1572('0x16')]);}})['catch'](function(_0x1b37dd){logger['error'](_0x1572('0x10'),_0x5da5dc,_0x1b37dd);_0x1f4101(_0x1b37dd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 804d722..c2ec583 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 _0xef8b=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','post','isAuthenticated','update','delete'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xef8b,0x192));var _0xbef8=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0xef8b[_0x51ec61];return _0x223200;};'use strict';var multer=require('multer');var util=require(_0xbef8('0x0'));var path=require(_0xbef8('0x1'));var timeout=require(_0xbef8('0x2'));var express=require(_0xbef8('0x3'));var router=express[_0xbef8('0x4')]();var fs_extra=require(_0xbef8('0x5'));var auth=require(_0xbef8('0x6'));var interaction=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var controller=require(_0xbef8('0x9'));router[_0xbef8('0xa')]('/',auth['isAuthenticated'](),controller[_0xbef8('0xb')]);router[_0xbef8('0xa')](_0xbef8('0xc'),auth['isAuthenticated'](),controller[_0xbef8('0xd')]);router[_0xbef8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbef8('0xc'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x10')]);router[_0xbef8('0x11')](_0xbef8('0xc'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x12')]);module[_0xbef8('0x13')]=router; \ No newline at end of file +var _0xa9b1=['index','/:id','show','post','create','put','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x1226f6,_0x2b51f5){var _0x56e4c2=function(_0x1bc5d1){while(--_0x1bc5d1){_0x1226f6['push'](_0x1226f6['shift']());}};_0x56e4c2(++_0x2b51f5);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a9b('0x0'));var timeout=require(_0x1a9b('0x1'));var express=require(_0x1a9b('0x2'));var router=express[_0x1a9b('0x3')]();var fs_extra=require(_0x1a9b('0x4'));var auth=require(_0x1a9b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x1a9b('0x6')]('/',auth[_0x1a9b('0x7')](),controller[_0x1a9b('0x8')]);router[_0x1a9b('0x6')](_0x1a9b('0x9'),auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xa')]);router[_0x1a9b('0xb')]('/',auth[_0x1a9b('0x7')](),controller[_0x1a9b('0xc')]);router[_0x1a9b('0xd')](_0x1a9b('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x1a9b('0xe')](_0x1a9b('0x9'),auth[_0x1a9b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1f16519..f825fef 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 _0x578a=['TEXT','sequelize','exports'];(function(_0x239ea4,_0x2413a9){var _0xe0a9ae=function(_0x4610f9){while(--_0x4610f9){_0x239ea4['push'](_0x239ea4['shift']());}};_0xe0a9ae(++_0x2413a9);}(_0x578a,0xd0));var _0xa578=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0x578a[_0xe4d6c6];return _0x3a8935;};'use strict';var Sequelize=require(_0xa578('0x0'));module[_0xa578('0x1')]={'tree':{'type':Sequelize[_0xa578('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5be0=['TEXT','sequelize','exports'];(function(_0x588457,_0x2a1fe9){var _0x642552=function(_0x42832d){while(--_0x42832d){_0x588457['push'](_0x588457['shift']());}};_0x642552(++_0x2a1fe9);}(_0x5be0,0x154));var _0x05be=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0x5be0[_0x6182ff];return _0x1cec22;};'use strict';var Sequelize=require(_0x05be('0x0'));module[_0x05be('0x1')]={'tree':{'type':Sequelize[_0x05be('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 9bac45d..373fcc1 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 _0xcd29=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0xa98bf9,_0x6c44fa){var _0xef2d77=function(_0xa6c6c9){while(--_0xa6c6c9){_0xa98bf9['push'](_0xa98bf9['shift']());}};_0xef2d77(++_0x6c44fa);}(_0xcd29,0x137));var _0x9cd2=function(_0x4431a1,_0x4b8792){_0x4431a1=_0x4431a1-0x0;var _0x41171b=_0xcd29[_0x4431a1];return _0x41171b;};'use strict';var emlformat=require(_0x9cd2('0x0'));var rimraf=require(_0x9cd2('0x1'));var zipdir=require(_0x9cd2('0x2'));var jsonpatch=require(_0x9cd2('0x3'));var rp=require(_0x9cd2('0x4'));var moment=require('moment');var BPromise=require(_0x9cd2('0x5'));var Mustache=require(_0x9cd2('0x6'));var util=require('util');var path=require(_0x9cd2('0x7'));var sox=require(_0x9cd2('0x8'));var csv=require(_0x9cd2('0x9'));var ejs=require(_0x9cd2('0xa'));var fs=require('fs');var fs_extra=require(_0x9cd2('0xb'));var _=require(_0x9cd2('0xc'));var squel=require(_0x9cd2('0xd'));var crypto=require(_0x9cd2('0xe'));var jsforce=require(_0x9cd2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9cd2('0x9'));var querystring=require(_0x9cd2('0x10'));var Papa=require(_0x9cd2('0x11'));var Redis=require(_0x9cd2('0x12'));var authService=require(_0x9cd2('0x13'));var qs=require(_0x9cd2('0x14'));var as=require(_0x9cd2('0x15'));var hardwareService=require(_0x9cd2('0x16'));var logger=require(_0x9cd2('0x17'))(_0x9cd2('0x18'));var utils=require(_0x9cd2('0x19'));var config=require(_0x9cd2('0x1a'));var licenseUtil=require(_0x9cd2('0x1b'));var db=require(_0x9cd2('0x1c'))['db'];function respondWithStatusCode(_0x100ae6,_0x4a1ddc){_0x4a1ddc=_0x4a1ddc||0xcc;return function(_0x5a99df){if(_0x5a99df){return _0x100ae6[_0x9cd2('0x1d')](_0x4a1ddc);}return _0x100ae6[_0x9cd2('0x1e')](_0x4a1ddc)[_0x9cd2('0x1f')]();};}function respondWithResult(_0x48c2b1,_0x30c8c9){_0x30c8c9=_0x30c8c9||0xc8;return function(_0x4f62bf){if(_0x4f62bf){return _0x48c2b1[_0x9cd2('0x1e')](_0x30c8c9)[_0x9cd2('0x20')](_0x4f62bf);}};}function respondWithFilteredResult(_0x131ee3,_0x30c248){return function(_0xedcf3d){if(_0xedcf3d){var _0x196498=typeof _0x30c248[_0x9cd2('0x21')]==='undefined'&&typeof _0x30c248[_0x9cd2('0x22')]===_0x9cd2('0x23');var _0x5f5dbb=_0xedcf3d[_0x9cd2('0x24')];var _0x4b2063=_0x196498?0x0:_0x30c248['offset'];var _0x2de0b8=_0x196498?_0xedcf3d[_0x9cd2('0x24')]:_0x30c248[_0x9cd2('0x21')]+_0x30c248[_0x9cd2('0x22')];var _0x4044a2;if(_0x2de0b8>=_0x5f5dbb){_0x2de0b8=_0x5f5dbb;_0x4044a2=0xc8;}else{_0x4044a2=0xce;}_0x131ee3[_0x9cd2('0x1e')](_0x4044a2);return _0x131ee3[_0x9cd2('0x25')](_0x9cd2('0x26'),_0x4b2063+'-'+_0x2de0b8+'/'+_0x5f5dbb)[_0x9cd2('0x20')](_0xedcf3d);}return null;};}function patchUpdates(_0x3fb01c){return function(_0x404e7c){try{jsonpatch[_0x9cd2('0x27')](_0x404e7c,_0x3fb01c,!![]);}catch(_0x41a84f){return BPromise[_0x9cd2('0x28')](_0x41a84f);}return _0x404e7c[_0x9cd2('0x29')]();};}function saveUpdates(_0x43568e,_0x60258d){return function(_0x3039d9){if(_0x3039d9){return _0x3039d9[_0x9cd2('0x2a')](_0x43568e)[_0x9cd2('0x2b')](function(_0x4a3f9a){return _0x4a3f9a;});}return null;};}function removeEntity(_0x59ff0d,_0x3e0796){return function(_0x51b9e3){if(_0x51b9e3){return _0x51b9e3['destroy']()[_0x9cd2('0x2b')](function(){_0x59ff0d[_0x9cd2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b4f1,_0x597fb9){return function(_0x5043f1){if(!_0x5043f1){_0x11b4f1[_0x9cd2('0x1d')](0x194);}return _0x5043f1;};}function handleError(_0x5df9ff,_0x2acce1){_0x2acce1=_0x2acce1||0x1f4;return function(_0x4e4a3e){logger['error'](_0x4e4a3e[_0x9cd2('0x2c')]);if(_0x4e4a3e[_0x9cd2('0x2d')]){delete _0x4e4a3e[_0x9cd2('0x2d')];}_0x5df9ff['status'](_0x2acce1)['send'](_0x4e4a3e);};}exports[_0x9cd2('0x2e')]=function(_0x26304d,_0x33cf03){var _0x5f4b1e={},_0x43d88e={},_0x577c40={'count':0x0,'rows':[]};var _0x4b250b=_[_0x9cd2('0x2f')](db['AnalyticTreeReport'][_0x9cd2('0x30')],function(_0x16a54b){return{'name':_0x16a54b[_0x9cd2('0x31')],'type':_0x16a54b[_0x9cd2('0x32')][_0x9cd2('0x33')]};});_0x43d88e[_0x9cd2('0x34')]=_[_0x9cd2('0x2f')](_0x4b250b,_0x9cd2('0x2d'));_0x43d88e[_0x9cd2('0x35')]=_[_0x9cd2('0x36')](_0x26304d[_0x9cd2('0x35')]);_0x43d88e['filters']=_[_0x9cd2('0x37')](_0x43d88e[_0x9cd2('0x34')],_0x43d88e[_0x9cd2('0x35')]);_0x5f4b1e[_0x9cd2('0x38')]=_[_0x9cd2('0x37')](_0x43d88e[_0x9cd2('0x34')],qs['fields'](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x39')]));_0x5f4b1e[_0x9cd2('0x38')]=_0x5f4b1e[_0x9cd2('0x38')][_0x9cd2('0x3a')]?_0x5f4b1e[_0x9cd2('0x38')]:_0x43d88e['model'];if(!_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x3b')](_0x9cd2('0x3c'))){_0x5f4b1e[_0x9cd2('0x22')]=qs[_0x9cd2('0x22')](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x22')]);_0x5f4b1e[_0x9cd2('0x21')]=qs['offset'](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x21')]);}_0x5f4b1e[_0x9cd2('0x3d')]=qs[_0x9cd2('0x3e')](_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x3e')]);_0x5f4b1e['where']=qs[_0x9cd2('0x3f')](_[_0x9cd2('0x40')](_0x26304d[_0x9cd2('0x35')],_0x43d88e[_0x9cd2('0x3f')]),_0x4b250b);if(_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x41')]){_0x5f4b1e[_0x9cd2('0x42')]=_[_0x9cd2('0x43')](_0x5f4b1e[_0x9cd2('0x42')],{'$or':_[_0x9cd2('0x2f')](_0x4b250b,function(_0x2cbc1c){if(_0x2cbc1c[_0x9cd2('0x32')]!==_0x9cd2('0x44')){var _0x38baa4={};_0x38baa4[_0x2cbc1c[_0x9cd2('0x2d')]]={'$like':'%'+_0x26304d['query'][_0x9cd2('0x41')]+'%'};return _0x38baa4;}})});}_0x5f4b1e=_[_0x9cd2('0x43')]({},_0x5f4b1e,_0x26304d['options']);var _0x40e21d={'where':_0x5f4b1e['where']};return db[_0x9cd2('0x45')][_0x9cd2('0x24')](_0x40e21d)[_0x9cd2('0x2b')](function(_0x46221d){_0x577c40[_0x9cd2('0x24')]=_0x46221d;if(_0x26304d[_0x9cd2('0x35')][_0x9cd2('0x46')]){_0x5f4b1e['include']=[{'all':!![]}];}return db[_0x9cd2('0x45')][_0x9cd2('0x47')](_0x5f4b1e);})[_0x9cd2('0x2b')](function(_0x1debfb){_0x577c40[_0x9cd2('0x48')]=_0x1debfb;return _0x577c40;})['then'](respondWithFilteredResult(_0x33cf03,_0x5f4b1e))[_0x9cd2('0x49')](handleError(_0x33cf03,null));};exports[_0x9cd2('0x4a')]=function(_0x4b00ba,_0x5d0cc6){var _0x1b1265={'raw':!![],'where':{'id':_0x4b00ba[_0x9cd2('0x4b')]['id']}},_0x503560={};_0x503560[_0x9cd2('0x34')]=_[_0x9cd2('0x36')](db['AnalyticTreeReport']['rawAttributes']);_0x503560[_0x9cd2('0x35')]=_[_0x9cd2('0x36')](_0x4b00ba[_0x9cd2('0x35')]);_0x503560['filters']=_[_0x9cd2('0x37')](_0x503560[_0x9cd2('0x34')],_0x503560[_0x9cd2('0x35')]);_0x1b1265[_0x9cd2('0x38')]=_[_0x9cd2('0x37')](_0x503560[_0x9cd2('0x34')],qs[_0x9cd2('0x39')](_0x4b00ba[_0x9cd2('0x35')]['fields']));_0x1b1265[_0x9cd2('0x38')]=_0x1b1265[_0x9cd2('0x38')][_0x9cd2('0x3a')]?_0x1b1265[_0x9cd2('0x38')]:_0x503560['model'];if(_0x4b00ba['query'][_0x9cd2('0x46')]){_0x1b1265['include']=[{'all':!![]}];}_0x1b1265=_[_0x9cd2('0x43')]({},_0x1b1265,_0x4b00ba['options']);return db['AnalyticTreeReport'][_0x9cd2('0x4c')](_0x1b1265)[_0x9cd2('0x2b')](handleEntityNotFound(_0x5d0cc6,null))[_0x9cd2('0x2b')](respondWithResult(_0x5d0cc6,null))['catch'](handleError(_0x5d0cc6,null));};exports[_0x9cd2('0x4d')]=function(_0x572e17,_0x589f66){return db['AnalyticTreeReport'][_0x9cd2('0x4d')](_0x572e17[_0x9cd2('0x4e')],{})['then'](respondWithResult(_0x589f66,0xc9))[_0x9cd2('0x49')](handleError(_0x589f66,null));};exports[_0x9cd2('0x2a')]=function(_0x1caf33,_0x408a43){if(_0x1caf33[_0x9cd2('0x4e')]['id']){delete _0x1caf33['body']['id'];}return db[_0x9cd2('0x45')]['find']({'where':{'id':_0x1caf33[_0x9cd2('0x4b')]['id']}})[_0x9cd2('0x2b')](handleEntityNotFound(_0x408a43,null))['then'](saveUpdates(_0x1caf33['body'],null))[_0x9cd2('0x2b')](respondWithResult(_0x408a43,null))[_0x9cd2('0x49')](handleError(_0x408a43,null));};exports[_0x9cd2('0x4f')]=function(_0x546874,_0x327f41){return db[_0x9cd2('0x45')][_0x9cd2('0x4c')]({'where':{'id':_0x546874[_0x9cd2('0x4b')]['id']}})[_0x9cd2('0x2b')](handleEntityNotFound(_0x327f41,null))[_0x9cd2('0x2b')](removeEntity(_0x327f41,null))[_0x9cd2('0x49')](handleError(_0x327f41,null));}; \ No newline at end of file +var _0x3523=['destroy','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','create','body','catch','update','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x587aa5,_0x10683a){var _0xce0248=function(_0x2136ae){while(--_0x2136ae){_0x587aa5['push'](_0x587aa5['shift']());}};_0xce0248(++_0x10683a);}(_0x3523,0x102));var _0x3352=function(_0x32a254,_0xc47fcb){_0x32a254=_0x32a254-0x0;var _0x64cb16=_0x3523[_0x32a254];return _0x64cb16;};'use strict';var emlformat=require(_0x3352('0x0'));var rimraf=require(_0x3352('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3352('0x2'));var rp=require(_0x3352('0x3'));var moment=require('moment');var BPromise=require(_0x3352('0x4'));var Mustache=require(_0x3352('0x5'));var util=require(_0x3352('0x6'));var path=require(_0x3352('0x7'));var sox=require('sox');var csv=require(_0x3352('0x8'));var ejs=require(_0x3352('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3352('0xa'));var squel=require(_0x3352('0xb'));var crypto=require(_0x3352('0xc'));var jsforce=require(_0x3352('0xd'));var deskjs=require(_0x3352('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3352('0xf'));var Papa=require('papaparse');var Redis=require(_0x3352('0x10'));var authService=require(_0x3352('0x11'));var qs=require(_0x3352('0x12'));var as=require(_0x3352('0x13'));var hardwareService=require(_0x3352('0x14'));var logger=require(_0x3352('0x15'))(_0x3352('0x16'));var utils=require(_0x3352('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47aed0,_0x187110){_0x187110=_0x187110||0xcc;return function(_0x1161b2){if(_0x1161b2){return _0x47aed0[_0x3352('0x18')](_0x187110);}return _0x47aed0[_0x3352('0x19')](_0x187110)[_0x3352('0x1a')]();};}function respondWithResult(_0x240f30,_0x3cb81f){_0x3cb81f=_0x3cb81f||0xc8;return function(_0x473397){if(_0x473397){return _0x240f30[_0x3352('0x19')](_0x3cb81f)[_0x3352('0x1b')](_0x473397);}};}function respondWithFilteredResult(_0x4991bb,_0x55e229){return function(_0x548295){if(_0x548295){var _0xc11d57=typeof _0x55e229[_0x3352('0x1c')]===_0x3352('0x1d')&&typeof _0x55e229[_0x3352('0x1e')]===_0x3352('0x1d');var _0x2eadbb=_0x548295[_0x3352('0x1f')];var _0xffe9e6=_0xc11d57?0x0:_0x55e229[_0x3352('0x1c')];var _0xce2ea0=_0xc11d57?_0x548295[_0x3352('0x1f')]:_0x55e229[_0x3352('0x1c')]+_0x55e229[_0x3352('0x1e')];var _0x51e574;if(_0xce2ea0>=_0x2eadbb){_0xce2ea0=_0x2eadbb;_0x51e574=0xc8;}else{_0x51e574=0xce;}_0x4991bb[_0x3352('0x19')](_0x51e574);return _0x4991bb[_0x3352('0x20')](_0x3352('0x21'),_0xffe9e6+'-'+_0xce2ea0+'/'+_0x2eadbb)[_0x3352('0x1b')](_0x548295);}return null;};}function patchUpdates(_0x303e4d){return function(_0x546738){try{jsonpatch[_0x3352('0x22')](_0x546738,_0x303e4d,!![]);}catch(_0x11c0b9){return BPromise[_0x3352('0x23')](_0x11c0b9);}return _0x546738[_0x3352('0x24')]();};}function saveUpdates(_0x3ff815,_0x5a6733){return function(_0x45c478){if(_0x45c478){return _0x45c478['update'](_0x3ff815)[_0x3352('0x25')](function(_0x100b16){return _0x100b16;});}return null;};}function removeEntity(_0x525c26,_0x2baa0f){return function(_0x4caaa1){if(_0x4caaa1){return _0x4caaa1[_0x3352('0x26')]()['then'](function(){_0x525c26[_0x3352('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1ab87,_0x5660e3){return function(_0x4ce8af){if(!_0x4ce8af){_0xc1ab87['sendStatus'](0x194);}return _0x4ce8af;};}function handleError(_0x5ecfe9,_0x49cf52){_0x49cf52=_0x49cf52||0x1f4;return function(_0x67c1c0){logger[_0x3352('0x27')](_0x67c1c0['stack']);if(_0x67c1c0[_0x3352('0x28')]){delete _0x67c1c0['name'];}_0x5ecfe9[_0x3352('0x19')](_0x49cf52)['send'](_0x67c1c0);};}exports[_0x3352('0x29')]=function(_0x27e994,_0x25f960){var _0x329300={},_0x250609={},_0x3b0dda={'count':0x0,'rows':[]};var _0x4c3ca1=_[_0x3352('0x2a')](db[_0x3352('0x2b')][_0x3352('0x2c')],function(_0x525c66){return{'name':_0x525c66[_0x3352('0x2d')],'type':_0x525c66[_0x3352('0x2e')][_0x3352('0x2f')]};});_0x250609[_0x3352('0x30')]=_['map'](_0x4c3ca1,_0x3352('0x28'));_0x250609[_0x3352('0x31')]=_['keys'](_0x27e994[_0x3352('0x31')]);_0x250609[_0x3352('0x32')]=_['intersection'](_0x250609[_0x3352('0x30')],_0x250609[_0x3352('0x31')]);_0x329300[_0x3352('0x33')]=_[_0x3352('0x34')](_0x250609[_0x3352('0x30')],qs['fields'](_0x27e994[_0x3352('0x31')][_0x3352('0x35')]));_0x329300[_0x3352('0x33')]=_0x329300[_0x3352('0x33')]['length']?_0x329300['attributes']:_0x250609[_0x3352('0x30')];if(!_0x27e994[_0x3352('0x31')][_0x3352('0x36')](_0x3352('0x37'))){_0x329300['limit']=qs[_0x3352('0x1e')](_0x27e994[_0x3352('0x31')][_0x3352('0x1e')]);_0x329300[_0x3352('0x1c')]=qs[_0x3352('0x1c')](_0x27e994[_0x3352('0x31')][_0x3352('0x1c')]);}_0x329300[_0x3352('0x38')]=qs[_0x3352('0x39')](_0x27e994[_0x3352('0x31')][_0x3352('0x39')]);_0x329300[_0x3352('0x3a')]=qs[_0x3352('0x32')](_[_0x3352('0x3b')](_0x27e994['query'],_0x250609[_0x3352('0x32')]),_0x4c3ca1);if(_0x27e994[_0x3352('0x31')][_0x3352('0x3c')]){_0x329300[_0x3352('0x3a')]=_[_0x3352('0x3d')](_0x329300[_0x3352('0x3a')],{'$or':_[_0x3352('0x2a')](_0x4c3ca1,function(_0x538399){if(_0x538399['type']!==_0x3352('0x3e')){var _0x4caca9={};_0x4caca9[_0x538399[_0x3352('0x28')]]={'$like':'%'+_0x27e994[_0x3352('0x31')][_0x3352('0x3c')]+'%'};return _0x4caca9;}})});}_0x329300=_[_0x3352('0x3d')]({},_0x329300,_0x27e994[_0x3352('0x3f')]);var _0x35a01b={'where':_0x329300[_0x3352('0x3a')]};return db[_0x3352('0x2b')]['count'](_0x35a01b)[_0x3352('0x25')](function(_0x32d4e9){_0x3b0dda[_0x3352('0x1f')]=_0x32d4e9;if(_0x27e994[_0x3352('0x31')][_0x3352('0x40')]){_0x329300[_0x3352('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x329300);})['then'](function(_0x44549e){_0x3b0dda[_0x3352('0x42')]=_0x44549e;return _0x3b0dda;})['then'](respondWithFilteredResult(_0x25f960,_0x329300))['catch'](handleError(_0x25f960,null));};exports[_0x3352('0x43')]=function(_0x18fa6c,_0x5e4312){var _0x31cad4={'raw':!![],'where':{'id':_0x18fa6c[_0x3352('0x44')]['id']}},_0x39777a={};_0x39777a['model']=_['keys'](db[_0x3352('0x2b')][_0x3352('0x2c')]);_0x39777a[_0x3352('0x31')]=_['keys'](_0x18fa6c[_0x3352('0x31')]);_0x39777a[_0x3352('0x32')]=_[_0x3352('0x34')](_0x39777a[_0x3352('0x30')],_0x39777a[_0x3352('0x31')]);_0x31cad4['attributes']=_[_0x3352('0x34')](_0x39777a[_0x3352('0x30')],qs['fields'](_0x18fa6c[_0x3352('0x31')][_0x3352('0x35')]));_0x31cad4[_0x3352('0x33')]=_0x31cad4[_0x3352('0x33')]['length']?_0x31cad4[_0x3352('0x33')]:_0x39777a[_0x3352('0x30')];if(_0x18fa6c[_0x3352('0x31')]['includeAll']){_0x31cad4[_0x3352('0x41')]=[{'all':!![]}];}_0x31cad4=_['merge']({},_0x31cad4,_0x18fa6c[_0x3352('0x3f')]);return db['AnalyticTreeReport']['find'](_0x31cad4)[_0x3352('0x25')](handleEntityNotFound(_0x5e4312,null))['then'](respondWithResult(_0x5e4312,null))['catch'](handleError(_0x5e4312,null));};exports[_0x3352('0x45')]=function(_0x2bbc9e,_0x56ac84){return db[_0x3352('0x2b')][_0x3352('0x45')](_0x2bbc9e[_0x3352('0x46')],{})[_0x3352('0x25')](respondWithResult(_0x56ac84,0xc9))[_0x3352('0x47')](handleError(_0x56ac84,null));};exports[_0x3352('0x48')]=function(_0x24b19e,_0x4c81b4){if(_0x24b19e[_0x3352('0x46')]['id']){delete _0x24b19e[_0x3352('0x46')]['id'];}return db[_0x3352('0x2b')][_0x3352('0x49')]({'where':{'id':_0x24b19e[_0x3352('0x44')]['id']}})[_0x3352('0x25')](handleEntityNotFound(_0x4c81b4,null))[_0x3352('0x25')](saveUpdates(_0x24b19e[_0x3352('0x46')],null))[_0x3352('0x25')](respondWithResult(_0x4c81b4,null))[_0x3352('0x47')](handleError(_0x4c81b4,null));};exports['destroy']=function(_0x4a5bfb,_0x18103f){return db['AnalyticTreeReport'][_0x3352('0x49')]({'where':{'id':_0x4a5bfb['params']['id']}})[_0x3352('0x25')](handleEntityNotFound(_0x18103f,null))[_0x3352('0x25')](removeEntity(_0x18103f,null))[_0x3352('0x47')](handleError(_0x18103f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 9a364e4..b446afa 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 _0xf999=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2935e2,_0x9a6d5e){var _0x500019=function(_0x17f84d){while(--_0x17f84d){_0x2935e2['push'](_0x2935e2['shift']());}};_0x500019(++_0x9a6d5e);}(_0xf999,0x1f3));var _0x9f99=function(_0xae05de,_0x518819){_0xae05de=_0xae05de-0x0;var _0xb859db=_0xf999[_0xae05de];return _0xb859db;};'use strict';var _=require(_0x9f99('0x0'));var util=require(_0x9f99('0x1'));var logger=require(_0x9f99('0x2'))(_0x9f99('0x3'));var moment=require(_0x9f99('0x4'));var BPromise=require(_0x9f99('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f99('0x6'));var rimraf=require(_0x9f99('0x7'));var config=require('../../config/environment');var attributes=require(_0x9f99('0x8'));module[_0x9f99('0x9')]=function(_0x7cfc19,_0x1c569a){return _0x7cfc19[_0x9f99('0xa')](_0x9f99('0xb'),attributes,{'tableName':_0x9f99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd58d=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x42b902,_0x3c49fd){var _0x2d9d68=function(_0x2175bf){while(--_0x2175bf){_0x42b902['push'](_0x42b902['shift']());}};_0x2d9d68(++_0x3c49fd);}(_0xd58d,0x72));var _0xdd58=function(_0x1c8e78,_0x56ceeb){_0x1c8e78=_0x1c8e78-0x0;var _0x18e385=_0xd58d[_0x1c8e78];return _0x18e385;};'use strict';var _=require(_0xdd58('0x0'));var util=require(_0xdd58('0x1'));var logger=require(_0xdd58('0x2'))(_0xdd58('0x3'));var moment=require(_0xdd58('0x4'));var BPromise=require(_0xdd58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd58('0x6'));var rimraf=require(_0xdd58('0x7'));var config=require(_0xdd58('0x8'));var attributes=require(_0xdd58('0x9'));module[_0xdd58('0xa')]=function(_0xa9bf14,_0x231e4a){return _0xa9bf14[_0xdd58('0xb')](_0xdd58('0xc'),attributes,{'tableName':_0xdd58('0xd'),'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 6967587..db866d6 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3d7486,_0x5529e5){var _0x54e078=function(_0x57dd9c){while(--_0x57dd9c){_0x3d7486['push'](_0x3d7486['shift']());}};_0x54e078(++_0x5529e5);}(_0x2ef3,0xba));var _0x32ef=function(_0x25f24f,_0x476d60){_0x25f24f=_0x25f24f-0x0;var _0x19b3f0=_0x2ef3[_0x25f24f];return _0x19b3f0;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x271a5e,_0x14ff4f){var _0x4206b5=function(_0x43d1f1){while(--_0x43d1f1){_0x271a5e['push'](_0x271a5e['shift']());}};_0x4206b5(++_0x14ff4f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x43c345,_0x4efb4d){_0x43c345=_0x43c345-0x0;var _0x138bfc=_0x5f2f[_0x43c345];return _0x138bfc;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index dfae117..3c938b3 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 _0xed65=['express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','path','connect-timeout'];(function(_0x2c944e,_0x26f659){var _0x2cc529=function(_0x3fbc4b){while(--_0x3fbc4b){_0x2c944e['push'](_0x2c944e['shift']());}};_0x2cc529(++_0x26f659);}(_0xed65,0xfd));var _0x5ed6=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xed65[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ed6('0x0'));var timeout=require(_0x5ed6('0x1'));var express=require(_0x5ed6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ed6('0x3'));var interaction=require(_0x5ed6('0x4'));var config=require('../../config/environment');var controller=require(_0x5ed6('0x5'));router[_0x5ed6('0x6')]('/',auth[_0x5ed6('0x7')](),controller[_0x5ed6('0x8')]);router[_0x5ed6('0x6')]('/:id',auth[_0x5ed6('0x7')](),controller[_0x5ed6('0x9')]);router[_0x5ed6('0xa')]('/',auth[_0x5ed6('0x7')](),controller[_0x5ed6('0xb')]);router[_0x5ed6('0xc')](_0x5ed6('0xd'),auth[_0x5ed6('0x7')](),controller['update']);router[_0x5ed6('0xe')](_0x5ed6('0xd'),auth[_0x5ed6('0x7')](),controller[_0x5ed6('0xf')]);module[_0x5ed6('0x10')]=router; \ No newline at end of file +var _0xa058=['update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0xa058,0x16b));var _0x8a05=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0xa058[_0x5ef161];return _0x1c6e9e;};'use strict';var multer=require(_0x8a05('0x0'));var util=require(_0x8a05('0x1'));var path=require(_0x8a05('0x2'));var timeout=require(_0x8a05('0x3'));var express=require(_0x8a05('0x4'));var router=express['Router']();var fs_extra=require(_0x8a05('0x5'));var auth=require(_0x8a05('0x6'));var interaction=require(_0x8a05('0x7'));var config=require(_0x8a05('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x8a05('0x9')]('/',auth[_0x8a05('0xa')](),controller[_0x8a05('0xb')]);router[_0x8a05('0x9')](_0x8a05('0xc'),auth[_0x8a05('0xa')](),controller[_0x8a05('0xd')]);router[_0x8a05('0xe')]('/',auth['isAuthenticated'](),controller[_0x8a05('0xf')]);router[_0x8a05('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8a05('0x11')]);router[_0x8a05('0x12')](_0x8a05('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8a05('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 ce95b89..9243fea 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 _0xb7a8=['exports','STRING'];(function(_0x4d3d46,_0x35282a){var _0x4b76d4=function(_0x1ca16d){while(--_0x1ca16d){_0x4d3d46['push'](_0x4d3d46['shift']());}};_0x4b76d4(++_0x35282a);}(_0xb7a8,0xec));var _0x8b7a=function(_0x54bbc4,_0x265a5b){_0x54bbc4=_0x54bbc4-0x0;var _0x478cfc=_0xb7a8[_0x54bbc4];return _0x478cfc;};'use strict';var Sequelize=require('sequelize');module[_0x8b7a('0x0')]={'name':{'type':Sequelize[_0x8b7a('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8b7a('0x1')]}}; \ No newline at end of file +var _0x5c4a=['STRING','exports'];(function(_0xde57e1,_0x57d2c0){var _0x2d1065=function(_0x484bdf){while(--_0x484bdf){_0xde57e1['push'](_0xde57e1['shift']());}};_0x2d1065(++_0x57d2c0);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x126592,_0x1a5714){_0x126592=_0x126592-0x0;var _0x5e2929=_0x5c4a[_0x126592];return _0x5e2929;};'use strict';var Sequelize=require('sequelize');module[_0xa5c4('0x0')]={'name':{'type':Sequelize[_0xa5c4('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa5c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2fea545..5da29f1 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 _0x58e5=['Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','length','find','catch','clone','includeAll','get','createdAt','updatedAt','body','create','destroy','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','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','status','json','offset','undefined','limit','count','set'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x58e5,0x14a));var _0x558e=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x58e5[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0x558e('0x0'));var rimraf=require(_0x558e('0x1'));var zipdir=require(_0x558e('0x2'));var jsonpatch=require(_0x558e('0x3'));var rp=require(_0x558e('0x4'));var moment=require('moment');var BPromise=require(_0x558e('0x5'));var Mustache=require(_0x558e('0x6'));var util=require(_0x558e('0x7'));var path=require('path');var sox=require(_0x558e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x558e('0x9'));var _=require(_0x558e('0xa'));var squel=require(_0x558e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x558e('0xc'));var toCsv=require(_0x558e('0xd'));var querystring=require(_0x558e('0xe'));var Papa=require(_0x558e('0xf'));var Redis=require(_0x558e('0x10'));var authService=require(_0x558e('0x11'));var qs=require(_0x558e('0x12'));var as=require(_0x558e('0x13'));var hardwareService=require(_0x558e('0x14'));var logger=require(_0x558e('0x15'))('api');var utils=require(_0x558e('0x16'));var config=require(_0x558e('0x17'));var licenseUtil=require(_0x558e('0x18'));var db=require(_0x558e('0x19'))['db'];function respondWithStatusCode(_0x3d8641,_0x20e13b){_0x20e13b=_0x20e13b||0xcc;return function(_0x9fe660){if(_0x9fe660){return _0x3d8641[_0x558e('0x1a')](_0x20e13b);}return _0x3d8641[_0x558e('0x1b')](_0x20e13b)['end']();};}function respondWithResult(_0xe98954,_0x193916){_0x193916=_0x193916||0xc8;return function(_0x448770){if(_0x448770){return _0xe98954[_0x558e('0x1b')](_0x193916)[_0x558e('0x1c')](_0x448770);}};}function respondWithFilteredResult(_0x4b9772,_0x11dc66){return function(_0x469cfa){if(_0x469cfa){var _0x45bbbb=typeof _0x11dc66[_0x558e('0x1d')]===_0x558e('0x1e')&&typeof _0x11dc66[_0x558e('0x1f')]==='undefined';var _0x10295e=_0x469cfa[_0x558e('0x20')];var _0x359658=_0x45bbbb?0x0:_0x11dc66['offset'];var _0x39072b=_0x45bbbb?_0x469cfa[_0x558e('0x20')]:_0x11dc66[_0x558e('0x1d')]+_0x11dc66['limit'];var _0x451f26;if(_0x39072b>=_0x10295e){_0x39072b=_0x10295e;_0x451f26=0xc8;}else{_0x451f26=0xce;}_0x4b9772[_0x558e('0x1b')](_0x451f26);return _0x4b9772[_0x558e('0x21')](_0x558e('0x22'),_0x359658+'-'+_0x39072b+'/'+_0x10295e)['json'](_0x469cfa);}return null;};}function patchUpdates(_0x577513){return function(_0x37bc36){try{jsonpatch[_0x558e('0x23')](_0x37bc36,_0x577513,!![]);}catch(_0x11357a){return BPromise[_0x558e('0x24')](_0x11357a);}return _0x37bc36[_0x558e('0x25')]();};}function saveUpdates(_0x48dc6,_0x2fdca3){return function(_0x2d998b){if(_0x2d998b){return _0x2d998b[_0x558e('0x26')](_0x48dc6)[_0x558e('0x27')](function(_0xc22a98){return _0xc22a98;});}return null;};}function removeEntity(_0x158200,_0x4979f9){return function(_0x3d7f5f){if(_0x3d7f5f){return _0x3d7f5f['destroy']()[_0x558e('0x27')](function(){_0x158200[_0x558e('0x1b')](0xcc)[_0x558e('0x28')]();});}};}function handleEntityNotFound(_0x485315,_0x4aa377){return function(_0x4d8559){if(!_0x4d8559){_0x485315[_0x558e('0x1a')](0x194);}return _0x4d8559;};}function handleError(_0x514146,_0xc915aa){_0xc915aa=_0xc915aa||0x1f4;return function(_0x38c574){logger[_0x558e('0x29')](_0x38c574[_0x558e('0x2a')]);if(_0x38c574[_0x558e('0x2b')]){delete _0x38c574[_0x558e('0x2b')];}_0x514146[_0x558e('0x1b')](_0xc915aa)[_0x558e('0x2c')](_0x38c574);};}exports[_0x558e('0x2d')]=function(_0x26e30e,_0x581dfd){var _0x2f69ff={},_0x5d7c68={},_0x2d3951={'count':0x0,'rows':[]};var _0x485250=_[_0x558e('0x2e')](db[_0x558e('0x2f')][_0x558e('0x30')],function(_0x2a4dca){return{'name':_0x2a4dca[_0x558e('0x31')],'type':_0x2a4dca[_0x558e('0x32')][_0x558e('0x33')]};});_0x5d7c68[_0x558e('0x34')]=_[_0x558e('0x2e')](_0x485250,_0x558e('0x2b'));_0x5d7c68[_0x558e('0x35')]=_[_0x558e('0x36')](_0x26e30e['query']);_0x5d7c68[_0x558e('0x37')]=_[_0x558e('0x38')](_0x5d7c68['model'],_0x5d7c68[_0x558e('0x35')]);_0x2f69ff[_0x558e('0x39')]=_[_0x558e('0x38')](_0x5d7c68[_0x558e('0x34')],qs[_0x558e('0x3a')](_0x26e30e['query'][_0x558e('0x3a')]));_0x2f69ff[_0x558e('0x39')]=_0x2f69ff[_0x558e('0x39')]['length']?_0x2f69ff[_0x558e('0x39')]:_0x5d7c68[_0x558e('0x34')];if(!_0x26e30e[_0x558e('0x35')]['hasOwnProperty']('nolimit')){_0x2f69ff[_0x558e('0x1f')]=qs[_0x558e('0x1f')](_0x26e30e['query'][_0x558e('0x1f')]);_0x2f69ff[_0x558e('0x1d')]=qs['offset'](_0x26e30e['query'][_0x558e('0x1d')]);}_0x2f69ff[_0x558e('0x3b')]=qs[_0x558e('0x3c')](_0x26e30e[_0x558e('0x35')][_0x558e('0x3c')]);_0x2f69ff['where']=qs[_0x558e('0x37')](_['pick'](_0x26e30e[_0x558e('0x35')],_0x5d7c68['filters']),_0x485250);if(_0x26e30e[_0x558e('0x35')][_0x558e('0x3d')]){_0x2f69ff[_0x558e('0x3e')]=_[_0x558e('0x3f')](_0x2f69ff[_0x558e('0x3e')],{'$or':_[_0x558e('0x2e')](_0x485250,function(_0x3e2135){if(_0x3e2135[_0x558e('0x32')]!==_0x558e('0x40')){var _0x45f4a0={};_0x45f4a0[_0x3e2135[_0x558e('0x2b')]]={'$like':'%'+_0x26e30e[_0x558e('0x35')][_0x558e('0x3d')]+'%'};return _0x45f4a0;}})});}_0x2f69ff=_[_0x558e('0x3f')]({},_0x2f69ff,_0x26e30e[_0x558e('0x41')]);var _0x3d9408={'where':_0x2f69ff[_0x558e('0x3e')]};return db[_0x558e('0x2f')]['count'](_0x3d9408)[_0x558e('0x27')](function(_0x2adcc1){_0x2d3951[_0x558e('0x20')]=_0x2adcc1;if(_0x26e30e['query']['includeAll']){_0x2f69ff[_0x558e('0x42')]=[{'all':!![]}];}return db[_0x558e('0x2f')][_0x558e('0x43')](_0x2f69ff);})[_0x558e('0x27')](function(_0x5a9e4c){_0x2d3951[_0x558e('0x44')]=_0x5a9e4c;return _0x2d3951;})['then'](respondWithFilteredResult(_0x581dfd,_0x2f69ff))['catch'](handleError(_0x581dfd,null));};exports['show']=function(_0x3cb938,_0xad148d){var _0xa10ea7={'raw':!![],'where':{'id':_0x3cb938[_0x558e('0x45')]['id']}},_0x516599={};_0x516599['model']=_[_0x558e('0x36')](db[_0x558e('0x2f')][_0x558e('0x30')]);_0x516599['query']=_[_0x558e('0x36')](_0x3cb938[_0x558e('0x35')]);_0x516599[_0x558e('0x37')]=_[_0x558e('0x38')](_0x516599[_0x558e('0x34')],_0x516599['query']);_0xa10ea7[_0x558e('0x39')]=_['intersection'](_0x516599['model'],qs['fields'](_0x3cb938[_0x558e('0x35')][_0x558e('0x3a')]));_0xa10ea7['attributes']=_0xa10ea7['attributes'][_0x558e('0x46')]?_0xa10ea7[_0x558e('0x39')]:_0x516599[_0x558e('0x34')];if(_0x3cb938[_0x558e('0x35')]['includeAll']){_0xa10ea7[_0x558e('0x42')]=[{'all':!![]}];}_0xa10ea7=_['merge']({},_0xa10ea7,_0x3cb938[_0x558e('0x41')]);return db[_0x558e('0x2f')][_0x558e('0x47')](_0xa10ea7)[_0x558e('0x27')](handleEntityNotFound(_0xad148d,null))[_0x558e('0x27')](respondWithResult(_0xad148d,null))[_0x558e('0x48')](handleError(_0xad148d,null));};exports[_0x558e('0x49')]=function(_0x2b0738,_0x404a53){var _0x5a1acd={'where':{'id':_0x2b0738[_0x558e('0x45')]['id']}},_0x5daee6={};_0x5daee6[_0x558e('0x34')]=_[_0x558e('0x36')](db[_0x558e('0x2f')][_0x558e('0x30')]);_0x5a1acd[_0x558e('0x39')]=_[_0x558e('0x38')](_0x5daee6[_0x558e('0x34')],qs[_0x558e('0x3a')](_0x2b0738['query']['fields']));_0x5a1acd['attributes']=_0x5a1acd['attributes'][_0x558e('0x46')]?_0x5a1acd['attributes']:_0x5daee6[_0x558e('0x34')];if(_0x2b0738[_0x558e('0x35')][_0x558e('0x4a')]){_0x5a1acd[_0x558e('0x42')]=[{'all':!![]}];}_0x5a1acd=_[_0x558e('0x3f')]({},_0x5a1acd,_0x2b0738[_0x558e('0x41')]);return db[_0x558e('0x2f')][_0x558e('0x47')](_0x5a1acd)['then'](handleEntityNotFound(_0x404a53,null))[_0x558e('0x27')](function(_0x4685a0){if(_0x4685a0){var _0x493cde=_0x4685a0[_0x558e('0x4b')]({'plain':!![]});_0x493cde=qs['omit'](_0x493cde,['id',_0x558e('0x4c'),_0x558e('0x4d')]);_0x2b0738['body']=_['omit'](_0x2b0738[_0x558e('0x4e')],['id',_0x558e('0x4c'),_0x558e('0x4d')]);return db['Attachment'][_0x558e('0x4f')](_[_0x558e('0x3f')](_0x493cde,_0x2b0738['body']),{'include':_0x2b0738['query'][_0x558e('0x4a')]?[{'all':!![]}]:undefined});}})[_0x558e('0x27')](respondWithResult(_0x404a53,0xc9))[_0x558e('0x48')](handleError(_0x404a53,null));};exports[_0x558e('0x26')]=function(_0x265194,_0x18870e){if(_0x265194[_0x558e('0x4e')]['id']){delete _0x265194[_0x558e('0x4e')]['id'];}return db[_0x558e('0x2f')][_0x558e('0x47')]({'where':{'id':_0x265194['params']['id']}})[_0x558e('0x27')](handleEntityNotFound(_0x18870e,null))[_0x558e('0x27')](saveUpdates(_0x265194[_0x558e('0x4e')],null))[_0x558e('0x27')](respondWithResult(_0x18870e,null))[_0x558e('0x48')](handleError(_0x18870e,null));};exports[_0x558e('0x50')]=function(_0xb73f18,_0xab9e47){return db[_0x558e('0x2f')][_0x558e('0x47')]({'where':{'id':_0xb73f18['params']['id']}})['then'](handleEntityNotFound(_0xab9e47,null))['then'](removeEntity(_0xab9e47,null))[_0x558e('0x48')](handleError(_0xab9e47,null));};exports[_0x558e('0x4f')]=function(_0x1fd415,_0x43eead,_0x106bf4){_0x1fd415[_0x558e('0x4e')][_0x558e('0x2b')]=_0x1fd415[_0x558e('0x51')][_0x558e('0x52')];_0x1fd415[_0x558e('0x4e')][_0x558e('0x53')]=_0x1fd415['file'][_0x558e('0x54')];_0x1fd415[_0x558e('0x4e')][_0x558e('0x32')]=_0x1fd415[_0x558e('0x51')][_0x558e('0x55')];return db['Attachment']['create'](_0x1fd415[_0x558e('0x4e')])[_0x558e('0x27')](respondWithResult(_0x43eead,0xc9))['catch'](handleError(_0x43eead,null));};exports['download']=function(_0x2f304f,_0x431352,_0x42a00c){return db['Attachment'][_0x558e('0x56')]({'where':{'id':_0x2f304f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x431352,null))[_0x558e('0x27')](function(_0x92aabe){if(_0x92aabe){var _0x18f3a8=_0x92aabe[_0x558e('0x57')]!==null;var _0x103eac=path['join'](config[_0x558e('0x58')],'server/files/attachments/');if(_0x18f3a8){_0x103eac=path[_0x558e('0x59')](_0x103eac,_0x558e('0x5a'));}var _0x1a7490=path[_0x558e('0x59')](_0x103eac,_0x92aabe[_0x558e('0x53')]);return _0x431352['download'](_0x1a7490);}})[_0x558e('0x48')](handleError(_0x431352,null));}; \ No newline at end of file +var _0xc1e2=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','Attachment','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter'];(function(_0x3e34bf,_0x33425b){var _0x5185fb=function(_0x3485f9){while(--_0x3485f9){_0x3e34bf['push'](_0x3e34bf['shift']());}};_0x5185fb(++_0x33425b);}(_0xc1e2,0xce));var _0x2c1e=function(_0x5074d0,_0x287774){_0x5074d0=_0x5074d0-0x0;var _0x984f55=_0xc1e2[_0x5074d0];return _0x984f55;};'use strict';var emlformat=require(_0x2c1e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2c1e('0x1'));var rp=require(_0x2c1e('0x2'));var moment=require(_0x2c1e('0x3'));var BPromise=require(_0x2c1e('0x4'));var Mustache=require(_0x2c1e('0x5'));var util=require(_0x2c1e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2c1e('0x7'));var fs=require('fs');var fs_extra=require(_0x2c1e('0x8'));var _=require('lodash');var squel=require(_0x2c1e('0x9'));var crypto=require('crypto');var jsforce=require(_0x2c1e('0xa'));var deskjs=require(_0x2c1e('0xb'));var toCsv=require(_0x2c1e('0xc'));var querystring=require(_0x2c1e('0xd'));var Papa=require('papaparse');var Redis=require(_0x2c1e('0xe'));var authService=require(_0x2c1e('0xf'));var qs=require(_0x2c1e('0x10'));var as=require(_0x2c1e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c1e('0x12'))(_0x2c1e('0x13'));var utils=require('../../config/utils');var config=require(_0x2c1e('0x14'));var licenseUtil=require(_0x2c1e('0x15'));var db=require(_0x2c1e('0x16'))['db'];function respondWithStatusCode(_0x414959,_0x4e83dc){_0x4e83dc=_0x4e83dc||0xcc;return function(_0x197616){if(_0x197616){return _0x414959[_0x2c1e('0x17')](_0x4e83dc);}return _0x414959['status'](_0x4e83dc)[_0x2c1e('0x18')]();};}function respondWithResult(_0x215485,_0x13042a){_0x13042a=_0x13042a||0xc8;return function(_0x421679){if(_0x421679){return _0x215485[_0x2c1e('0x19')](_0x13042a)['json'](_0x421679);}};}function respondWithFilteredResult(_0x3f2113,_0x38e510){return function(_0xf744df){if(_0xf744df){var _0x4e30e6=typeof _0x38e510['offset']===_0x2c1e('0x1a')&&typeof _0x38e510[_0x2c1e('0x1b')]===_0x2c1e('0x1a');var _0x1276cd=_0xf744df['count'];var _0xb1f9a3=_0x4e30e6?0x0:_0x38e510[_0x2c1e('0x1c')];var _0x351c55=_0x4e30e6?_0xf744df[_0x2c1e('0x1d')]:_0x38e510[_0x2c1e('0x1c')]+_0x38e510['limit'];var _0xf13999;if(_0x351c55>=_0x1276cd){_0x351c55=_0x1276cd;_0xf13999=0xc8;}else{_0xf13999=0xce;}_0x3f2113[_0x2c1e('0x19')](_0xf13999);return _0x3f2113[_0x2c1e('0x1e')](_0x2c1e('0x1f'),_0xb1f9a3+'-'+_0x351c55+'/'+_0x1276cd)['json'](_0xf744df);}return null;};}function patchUpdates(_0x4de96d){return function(_0x12d6e6){try{jsonpatch[_0x2c1e('0x20')](_0x12d6e6,_0x4de96d,!![]);}catch(_0x36e074){return BPromise[_0x2c1e('0x21')](_0x36e074);}return _0x12d6e6[_0x2c1e('0x22')]();};}function saveUpdates(_0x2e5617,_0x4ae03e){return function(_0x46d4a9){if(_0x46d4a9){return _0x46d4a9[_0x2c1e('0x23')](_0x2e5617)[_0x2c1e('0x24')](function(_0x2f4d94){return _0x2f4d94;});}return null;};}function removeEntity(_0x3a5ca4,_0x2ce345){return function(_0x3ce62e){if(_0x3ce62e){return _0x3ce62e[_0x2c1e('0x25')]()['then'](function(){_0x3a5ca4[_0x2c1e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b507f,_0x4d1819){return function(_0x5ef252){if(!_0x5ef252){_0x5b507f[_0x2c1e('0x17')](0x194);}return _0x5ef252;};}function handleError(_0x143095,_0x140c6c){_0x140c6c=_0x140c6c||0x1f4;return function(_0x52f0ea){logger[_0x2c1e('0x26')](_0x52f0ea[_0x2c1e('0x27')]);if(_0x52f0ea['name']){delete _0x52f0ea[_0x2c1e('0x28')];}_0x143095['status'](_0x140c6c)['send'](_0x52f0ea);};}exports['index']=function(_0x160a05,_0x3019a3){var _0x5d1a8a={},_0x10b863={},_0x1e9f3c={'count':0x0,'rows':[]};var _0xea72d3=_[_0x2c1e('0x29')](db[_0x2c1e('0x2a')][_0x2c1e('0x2b')],function(_0x547171){return{'name':_0x547171['fieldName'],'type':_0x547171[_0x2c1e('0x2c')]['key']};});_0x10b863[_0x2c1e('0x2d')]=_[_0x2c1e('0x29')](_0xea72d3,_0x2c1e('0x28'));_0x10b863[_0x2c1e('0x2e')]=_[_0x2c1e('0x2f')](_0x160a05[_0x2c1e('0x2e')]);_0x10b863[_0x2c1e('0x30')]=_[_0x2c1e('0x31')](_0x10b863[_0x2c1e('0x2d')],_0x10b863[_0x2c1e('0x2e')]);_0x5d1a8a[_0x2c1e('0x32')]=_[_0x2c1e('0x31')](_0x10b863['model'],qs[_0x2c1e('0x33')](_0x160a05[_0x2c1e('0x2e')][_0x2c1e('0x33')]));_0x5d1a8a[_0x2c1e('0x32')]=_0x5d1a8a[_0x2c1e('0x32')]['length']?_0x5d1a8a['attributes']:_0x10b863[_0x2c1e('0x2d')];if(!_0x160a05['query']['hasOwnProperty'](_0x2c1e('0x34'))){_0x5d1a8a[_0x2c1e('0x1b')]=qs[_0x2c1e('0x1b')](_0x160a05[_0x2c1e('0x2e')][_0x2c1e('0x1b')]);_0x5d1a8a[_0x2c1e('0x1c')]=qs['offset'](_0x160a05[_0x2c1e('0x2e')][_0x2c1e('0x1c')]);}_0x5d1a8a[_0x2c1e('0x35')]=qs[_0x2c1e('0x36')](_0x160a05[_0x2c1e('0x2e')][_0x2c1e('0x36')]);_0x5d1a8a[_0x2c1e('0x37')]=qs[_0x2c1e('0x30')](_[_0x2c1e('0x38')](_0x160a05['query'],_0x10b863[_0x2c1e('0x30')]),_0xea72d3);if(_0x160a05[_0x2c1e('0x2e')][_0x2c1e('0x39')]){_0x5d1a8a[_0x2c1e('0x37')]=_[_0x2c1e('0x3a')](_0x5d1a8a[_0x2c1e('0x37')],{'$or':_[_0x2c1e('0x29')](_0xea72d3,function(_0x2abce1){if(_0x2abce1[_0x2c1e('0x2c')]!==_0x2c1e('0x3b')){var _0x5b9417={};_0x5b9417[_0x2abce1['name']]={'$like':'%'+_0x160a05[_0x2c1e('0x2e')][_0x2c1e('0x39')]+'%'};return _0x5b9417;}})});}_0x5d1a8a=_[_0x2c1e('0x3a')]({},_0x5d1a8a,_0x160a05[_0x2c1e('0x3c')]);var _0x255253={'where':_0x5d1a8a['where']};return db[_0x2c1e('0x2a')][_0x2c1e('0x1d')](_0x255253)[_0x2c1e('0x24')](function(_0x38f7b8){_0x1e9f3c['count']=_0x38f7b8;if(_0x160a05['query'][_0x2c1e('0x3d')]){_0x5d1a8a[_0x2c1e('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0x2c1e('0x3f')](_0x5d1a8a);})[_0x2c1e('0x24')](function(_0x1a3e58){_0x1e9f3c[_0x2c1e('0x40')]=_0x1a3e58;return _0x1e9f3c;})['then'](respondWithFilteredResult(_0x3019a3,_0x5d1a8a))[_0x2c1e('0x41')](handleError(_0x3019a3,null));};exports[_0x2c1e('0x42')]=function(_0x4f5b33,_0x56eae8){var _0x51acee={'raw':!![],'where':{'id':_0x4f5b33[_0x2c1e('0x43')]['id']}},_0x5144e6={};_0x5144e6['model']=_['keys'](db['Attachment'][_0x2c1e('0x2b')]);_0x5144e6[_0x2c1e('0x2e')]=_['keys'](_0x4f5b33[_0x2c1e('0x2e')]);_0x5144e6['filters']=_[_0x2c1e('0x31')](_0x5144e6[_0x2c1e('0x2d')],_0x5144e6[_0x2c1e('0x2e')]);_0x51acee[_0x2c1e('0x32')]=_[_0x2c1e('0x31')](_0x5144e6[_0x2c1e('0x2d')],qs[_0x2c1e('0x33')](_0x4f5b33[_0x2c1e('0x2e')]['fields']));_0x51acee[_0x2c1e('0x32')]=_0x51acee[_0x2c1e('0x32')][_0x2c1e('0x44')]?_0x51acee[_0x2c1e('0x32')]:_0x5144e6[_0x2c1e('0x2d')];if(_0x4f5b33[_0x2c1e('0x2e')][_0x2c1e('0x3d')]){_0x51acee[_0x2c1e('0x3e')]=[{'all':!![]}];}_0x51acee=_[_0x2c1e('0x3a')]({},_0x51acee,_0x4f5b33['options']);return db[_0x2c1e('0x2a')][_0x2c1e('0x45')](_0x51acee)[_0x2c1e('0x24')](handleEntityNotFound(_0x56eae8,null))['then'](respondWithResult(_0x56eae8,null))[_0x2c1e('0x41')](handleError(_0x56eae8,null));};exports[_0x2c1e('0x46')]=function(_0x259298,_0xcedd5d){var _0x569570={'where':{'id':_0x259298[_0x2c1e('0x43')]['id']}},_0x49eefc={};_0x49eefc[_0x2c1e('0x2d')]=_[_0x2c1e('0x2f')](db[_0x2c1e('0x2a')]['rawAttributes']);_0x569570[_0x2c1e('0x32')]=_['intersection'](_0x49eefc[_0x2c1e('0x2d')],qs[_0x2c1e('0x33')](_0x259298['query']['fields']));_0x569570[_0x2c1e('0x32')]=_0x569570[_0x2c1e('0x32')][_0x2c1e('0x44')]?_0x569570[_0x2c1e('0x32')]:_0x49eefc[_0x2c1e('0x2d')];if(_0x259298['query'][_0x2c1e('0x3d')]){_0x569570[_0x2c1e('0x3e')]=[{'all':!![]}];}_0x569570=_[_0x2c1e('0x3a')]({},_0x569570,_0x259298[_0x2c1e('0x3c')]);return db[_0x2c1e('0x2a')][_0x2c1e('0x45')](_0x569570)[_0x2c1e('0x24')](handleEntityNotFound(_0xcedd5d,null))[_0x2c1e('0x24')](function(_0x255a37){if(_0x255a37){var _0x580ca3=_0x255a37[_0x2c1e('0x47')]({'plain':!![]});_0x580ca3=qs[_0x2c1e('0x48')](_0x580ca3,['id',_0x2c1e('0x49'),_0x2c1e('0x4a')]);_0x259298[_0x2c1e('0x4b')]=_[_0x2c1e('0x48')](_0x259298['body'],['id',_0x2c1e('0x49'),_0x2c1e('0x4a')]);return db[_0x2c1e('0x2a')]['create'](_[_0x2c1e('0x3a')](_0x580ca3,_0x259298[_0x2c1e('0x4b')]),{'include':_0x259298[_0x2c1e('0x2e')][_0x2c1e('0x3d')]?[{'all':!![]}]:undefined});}})[_0x2c1e('0x24')](respondWithResult(_0xcedd5d,0xc9))[_0x2c1e('0x41')](handleError(_0xcedd5d,null));};exports[_0x2c1e('0x23')]=function(_0x47ee04,_0x2cb815){if(_0x47ee04[_0x2c1e('0x4b')]['id']){delete _0x47ee04[_0x2c1e('0x4b')]['id'];}return db[_0x2c1e('0x2a')]['find']({'where':{'id':_0x47ee04['params']['id']}})[_0x2c1e('0x24')](handleEntityNotFound(_0x2cb815,null))[_0x2c1e('0x24')](saveUpdates(_0x47ee04[_0x2c1e('0x4b')],null))['then'](respondWithResult(_0x2cb815,null))[_0x2c1e('0x41')](handleError(_0x2cb815,null));};exports[_0x2c1e('0x25')]=function(_0x5edadc,_0x40943d){return db[_0x2c1e('0x2a')][_0x2c1e('0x45')]({'where':{'id':_0x5edadc[_0x2c1e('0x43')]['id']}})[_0x2c1e('0x24')](handleEntityNotFound(_0x40943d,null))[_0x2c1e('0x24')](removeEntity(_0x40943d,null))[_0x2c1e('0x41')](handleError(_0x40943d,null));};exports[_0x2c1e('0x4c')]=function(_0x49f72e,_0x17c505,_0xea67f1){_0x49f72e[_0x2c1e('0x4b')][_0x2c1e('0x28')]=_0x49f72e[_0x2c1e('0x4d')][_0x2c1e('0x4e')];_0x49f72e[_0x2c1e('0x4b')][_0x2c1e('0x4f')]=_0x49f72e[_0x2c1e('0x4d')]['filename'];_0x49f72e[_0x2c1e('0x4b')][_0x2c1e('0x2c')]=_0x49f72e[_0x2c1e('0x4d')][_0x2c1e('0x50')];return db[_0x2c1e('0x2a')][_0x2c1e('0x4c')](_0x49f72e[_0x2c1e('0x4b')])[_0x2c1e('0x24')](respondWithResult(_0x17c505,0xc9))[_0x2c1e('0x41')](handleError(_0x17c505,null));};exports['download']=function(_0x409b18,_0x19f2f6,_0xda2220){return db[_0x2c1e('0x2a')][_0x2c1e('0x51')]({'where':{'id':_0x409b18['params']['id']},'raw':!![]})[_0x2c1e('0x24')](handleEntityNotFound(_0x19f2f6,null))['then'](function(_0x5d1722){if(_0x5d1722){var _0x313769=_0x5d1722[_0x2c1e('0x52')]!==null;var _0x577646=path['join'](config[_0x2c1e('0x53')],_0x2c1e('0x54'));if(_0x313769){_0x577646=path[_0x2c1e('0x55')](_0x577646,_0x2c1e('0x56'));}var _0x1bd23f=path[_0x2c1e('0x55')](_0x577646,_0x5d1722[_0x2c1e('0x4f')]);return _0x19f2f6[_0x2c1e('0x57')](_0x1bd23f);}})[_0x2c1e('0x41')](handleError(_0x19f2f6,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 15a0b13..7040e36 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 _0x314e=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','../../config/logger','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x314e,0x170));var _0xe314=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x314e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe314('0x0'));var util=require('util');var logger=require(_0xe314('0x1'))(_0xe314('0x2'));var moment=require(_0xe314('0x3'));var BPromise=require('bluebird');var rp=require(_0xe314('0x4'));var fs=require('fs');var path=require(_0xe314('0x5'));var rimraf=require(_0xe314('0x6'));var config=require(_0xe314('0x7'));var attributes=require(_0xe314('0x8'));module[_0xe314('0x9')]=function(_0x4d1300,_0x4ba0dc){return _0x4d1300[_0xe314('0xa')]('Attachment',attributes,{'tableName':_0xe314('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cc9=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./attachment.attributes','exports','attachments'];(function(_0x1460bc,_0x509d3b){var _0x1bb22c=function(_0x57b4f5){while(--_0x57b4f5){_0x1460bc['push'](_0x1460bc['shift']());}};_0x1bb22c(++_0x509d3b);}(_0x9cc9,0x1b9));var _0x99cc=function(_0x225c99,_0x2deb40){_0x225c99=_0x225c99-0x0;var _0x15b19a=_0x9cc9[_0x225c99];return _0x15b19a;};'use strict';var _=require(_0x99cc('0x0'));var util=require('util');var logger=require(_0x99cc('0x1'))('api');var moment=require(_0x99cc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x99cc('0x3'));var rimraf=require(_0x99cc('0x4'));var config=require(_0x99cc('0x5'));var attributes=require(_0x99cc('0x6'));module[_0x99cc('0x7')]=function(_0x354457,_0x4c4cf7){return _0x354457['define']('Attachment',attributes,{'tableName':_0x99cc('0x8'),'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 180382e..6c99d89 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 _0xd845=['client','http','request','then','info','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xc4e4b2,_0x522c41){var _0x11bdd4=function(_0x88e89e){while(--_0x88e89e){_0xc4e4b2['push'](_0xc4e4b2['shift']());}};_0x11bdd4(++_0x522c41);}(_0xd845,0x135));var _0x5d84=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd845[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var moment=require(_0x5d84('0x2'));var BPromise=require(_0x5d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d84('0x4'));var db=require(_0x5d84('0x5'))['db'];var utils=require(_0x5d84('0x6'));var logger=require(_0x5d84('0x7'))('rpc');var config=require(_0x5d84('0x8'));var jayson=require(_0x5d84('0x9'));var client=jayson[_0x5d84('0xa')][_0x5d84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1712cb,_0x3f0541,_0x537d0e){return new BPromise(function(_0x135c45,_0x493231){return client[_0x5d84('0xc')](_0x1712cb,_0x537d0e)[_0x5d84('0xd')](function(_0x579df0){logger[_0x5d84('0xe')](_0x5d84('0xf'),_0x3f0541,'request\x20sent');logger['debug'](_0x5d84('0x10'),_0x3f0541,_0x5d84('0x11'),JSON[_0x5d84('0x12')](_0x579df0));if(_0x579df0[_0x5d84('0x13')]){if(_0x579df0[_0x5d84('0x13')]['code']===0x1f4){logger[_0x5d84('0x13')](_0x5d84('0xf'),_0x3f0541,_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);return _0x493231(_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);}logger['error'](_0x5d84('0xf'),_0x3f0541,_0x579df0['error'][_0x5d84('0x14')]);return _0x135c45(_0x579df0[_0x5d84('0x13')][_0x5d84('0x14')]);}else{logger['info'](_0x5d84('0xf'),_0x3f0541,_0x5d84('0x11'));_0x135c45(_0x579df0[_0x5d84('0x15')][_0x5d84('0x14')]);}})[_0x5d84('0x16')](function(_0x4c4dc6){logger[_0x5d84('0x13')]('Attachment,\x20%s,\x20%s',_0x3f0541,_0x4c4dc6);_0x493231(_0x4c4dc6);});});}exports[_0x5d84('0x17')]=function(_0x59a6be){var _0x3b3f63=this;return new Promise(function(_0x2494cd,_0x2ba609){return db[_0x5d84('0x18')][_0x5d84('0x19')](_0x59a6be[_0x5d84('0x1a')],{'raw':_0x59a6be[_0x5d84('0x1b')]?_0x59a6be['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x254ac6){logger[_0x5d84('0xe')](_0x5d84('0x17'),_0x59a6be);logger[_0x5d84('0x1c')](_0x5d84('0x17'),_0x59a6be,JSON[_0x5d84('0x12')](_0x254ac6));_0x2494cd(_0x254ac6);})[_0x5d84('0x16')](function(_0x554d80){logger['error']('CreateAttachment',_0x554d80['message'],_0x59a6be);_0x2ba609(_0x3b3f63[_0x5d84('0x13')](0x1f4,_0x554d80['message']));});});}; \ No newline at end of file +var _0x83f1=['CreateAttachment','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Attachment','create','options','raw'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x83f1,0x1cc));var _0x183f=function(_0xcd4de3,_0x57f6c7){_0xcd4de3=_0xcd4de3-0x0;var _0x1f9ecf=_0x83f1[_0xcd4de3];return _0x1f9ecf;};'use strict';var _=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var moment=require(_0x183f('0x2'));var BPromise=require(_0x183f('0x3'));var rs=require(_0x183f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x183f('0x5'));var logger=require(_0x183f('0x6'))(_0x183f('0x7'));var config=require(_0x183f('0x8'));var jayson=require(_0x183f('0x9'));var client=jayson['client'][_0x183f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf702f5,_0x364cc4,_0x5c75c3){return new BPromise(function(_0x434be2,_0x5bdf95){return client[_0x183f('0xb')](_0xf702f5,_0x5c75c3)[_0x183f('0xc')](function(_0x37ed60){logger[_0x183f('0xd')](_0x183f('0xe'),_0x364cc4,_0x183f('0xf'));logger[_0x183f('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x364cc4,_0x183f('0xf'),JSON[_0x183f('0x11')](_0x37ed60));if(_0x37ed60[_0x183f('0x12')]){if(_0x37ed60[_0x183f('0x12')][_0x183f('0x13')]===0x1f4){logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0x37ed60['error'][_0x183f('0x14')]);return _0x5bdf95(_0x37ed60['error']['message']);}logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0x37ed60[_0x183f('0x12')][_0x183f('0x14')]);return _0x434be2(_0x37ed60[_0x183f('0x12')]['message']);}else{logger[_0x183f('0xd')]('Attachment,\x20%s,\x20%s',_0x364cc4,_0x183f('0xf'));_0x434be2(_0x37ed60[_0x183f('0x15')][_0x183f('0x14')]);}})['catch'](function(_0xe9c5d9){logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0xe9c5d9);_0x5bdf95(_0xe9c5d9);});});}exports['CreateAttachment']=function(_0x284244){var _0x2b819e=this;return new Promise(function(_0x2c3468,_0x3f713f){return db[_0x183f('0x16')][_0x183f('0x17')](_0x284244['body'],{'raw':_0x284244[_0x183f('0x18')]?_0x284244[_0x183f('0x18')][_0x183f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x26a103){logger['info'](_0x183f('0x1a'),_0x284244);logger[_0x183f('0x10')](_0x183f('0x1a'),_0x284244,JSON[_0x183f('0x11')](_0x26a103));_0x2c3468(_0x26a103);})['catch'](function(_0x3a1bec){logger[_0x183f('0x12')](_0x183f('0x1a'),_0x3a1bec[_0x183f('0x14')],_0x284244);_0x3f713f(_0x2b819e[_0x183f('0x12')](0x1f4,_0x3a1bec[_0x183f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 41b4317..21dd94e 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x51172a,_0x14d44e){var _0xc98e9a=function(_0x560fd0){while(--_0x560fd0){_0x51172a['push'](_0x51172a['shift']());}};_0xc98e9a(++_0x14d44e);}(_0x757a,0xde));var _0xa757=function(_0x362e9f,_0x296609){_0x362e9f=_0x362e9f-0x0;var _0x39e161=_0x757a[_0x362e9f];return _0x39e161;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=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(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x0b0e,0x187));var _0xe0b0=function(_0xda4fad,_0x37db34){_0xda4fad=_0xda4fad-0x0;var _0x56ae95=_0x0b0e[_0xda4fad];return _0x56ae95;};'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/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d7c7cfe..e1682c4 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 _0xd374=['add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','clientSecret','secret','Setting','allowedLoginAttempts','then','User','find','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt'];(function(_0x353e6c,_0x596af8){var _0x568a84=function(_0xd1791e){while(--_0xd1791e){_0x353e6c['push'](_0x353e6c['shift']());}};_0x568a84(++_0x596af8);}(_0xd374,0xdd));var _0x4d37=function(_0xe31c95,_0x1edf2c){_0xe31c95=_0xe31c95-0x0;var _0x4d1987=_0xd374[_0xe31c95];return _0x4d1987;};'use strict';var _=require(_0x4d37('0x0'));var passport=require(_0x4d37('0x1'));var GoogleStrategy=require(_0x4d37('0x2'))[_0x4d37('0x3')];var moment=require(_0x4d37('0x4'));var db=require(_0x4d37('0x5'))['db'];var config=require(_0x4d37('0x6'));var signToken=require('../../components/auth/service')[_0x4d37('0x7')];var utils=require(_0x4d37('0x8'));exports[_0x4d37('0x9')]=passport[_0x4d37('0xa')](_0x4d37('0xb'),{'failureRedirect':_0x4d37('0xc'),'scope':[_0x4d37('0xd'),_0x4d37('0xe')],'session':![]});exports[_0x4d37('0xf')]=passport['authenticate']('google',{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x4d37('0xb')]?config['google'][_0x4d37('0x10')]:'id','clientSecret':config['google']?config[_0x4d37('0xb')][_0x4d37('0x11')]:_0x4d37('0x12'),'callbackURL':config[_0x4d37('0xb')]?config[_0x4d37('0xb')]['callbackURL']:''},function(_0x3d4b8e,_0x794888,_0x1a5468,_0x33dd98){var _0x2a7317,_0x41bb1d;return db[_0x4d37('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x4d37('0x14'),'blockDuration'],'raw':!![]})[_0x4d37('0x15')](function(_0x2ae8cf){_0x2a7317=_0x2ae8cf;return db[_0x4d37('0x16')][_0x4d37('0x17')]({'where':{'email':_['map'](_0x1a5468['emails'],'value'),'role':{'$or':[_0x4d37('0x18'),'user',_0x4d37('0x19')]}}});})[_0x4d37('0x15')](function(_0x427670){_0x41bb1d=_0x427670;if(_0x41bb1d){if(_0x41bb1d[_0x4d37('0x1a')]){return _0x33dd98(_0x4d37('0x1b'));}else if(_0x2a7317[_0x4d37('0x1c')]>0x0){if(_0x41bb1d[_0x4d37('0x1d')]){if(moment(_0x41bb1d[_0x4d37('0x1e')])[_0x4d37('0x1f')](_0x2a7317[_0x4d37('0x1c')],_0x4d37('0x20'))>moment()){return _0x33dd98(_0x4d37('0x1b'));}else{return utils[_0x4d37('0x21')](_0x41bb1d,0x0,![],null)[_0x4d37('0x15')](function(){return utils[_0x4d37('0x22')](_0x41bb1d);})[_0x4d37('0x15')](function(){return _0x33dd98(null,_0x41bb1d);});}}else{return utils[_0x4d37('0x22')](_0x41bb1d)[_0x4d37('0x15')](function(){return _0x33dd98(null,_0x41bb1d);});}}else{return utils['getLicense'](_0x41bb1d)[_0x4d37('0x15')](function(){return _0x33dd98(null,_0x41bb1d);});}}return _0x33dd98('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x4d37('0x23')](function(_0x1fc787){_0x33dd98(_0x1fc787);});})); \ No newline at end of file +var _0xbb90=['lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','google','/login','email','callback','clientID','secret','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','disabled','blocked','add','clearBlockUser','getLicense','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb90,0x91));var _0x0bb9=function(_0xfc61bd,_0x125e37){_0xfc61bd=_0xfc61bd-0x0;var _0x5171de=_0xbb90[_0xfc61bd];return _0x5171de;};'use strict';var _=require(_0x0bb9('0x0'));var passport=require(_0x0bb9('0x1'));var GoogleStrategy=require(_0x0bb9('0x2'))[_0x0bb9('0x3')];var moment=require(_0x0bb9('0x4'));var db=require(_0x0bb9('0x5'))['db'];var config=require(_0x0bb9('0x6'));var signToken=require(_0x0bb9('0x7'))[_0x0bb9('0x8')];var utils=require(_0x0bb9('0x9'));exports['login']=passport['authenticate'](_0x0bb9('0xa'),{'failureRedirect':_0x0bb9('0xb'),'scope':['profile',_0x0bb9('0xc')],'session':![]});exports[_0x0bb9('0xd')]=passport['authenticate'](_0x0bb9('0xa'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x0bb9('0xa')]?config['google'][_0x0bb9('0xe')]:'id','clientSecret':config['google']?config['google']['clientSecret']:_0x0bb9('0xf'),'callbackURL':config['google']?config[_0x0bb9('0xa')]['callbackURL']:''},function(_0x18acd2,_0x165ee5,_0x35dd83,_0x56f891){var _0x2fa639,_0x5a2f98;return db['Setting'][_0x0bb9('0x10')]({'where':{'id':0x1},'attributes':[_0x0bb9('0x11'),_0x0bb9('0x12')],'raw':!![]})[_0x0bb9('0x13')](function(_0x354e3f){_0x2fa639=_0x354e3f;return db[_0x0bb9('0x14')][_0x0bb9('0x15')]({'where':{'email':_['map'](_0x35dd83[_0x0bb9('0x16')],'value'),'role':{'$or':['admin','user','agent']}}});})[_0x0bb9('0x13')](function(_0x4ff252){_0x5a2f98=_0x4ff252;if(_0x5a2f98){if(_0x5a2f98[_0x0bb9('0x17')]){return _0x56f891('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2fa639['blockDuration']>0x0){if(_0x5a2f98[_0x0bb9('0x18')]){if(moment(_0x5a2f98['blockedAt'])[_0x0bb9('0x19')](_0x2fa639[_0x0bb9('0x12')],'minutes')>moment()){return _0x56f891('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x0bb9('0x1a')](_0x5a2f98,0x0,![],null)['then'](function(){return utils[_0x0bb9('0x1b')](_0x5a2f98);})[_0x0bb9('0x13')](function(){return _0x56f891(null,_0x5a2f98);});}}else{return utils[_0x0bb9('0x1b')](_0x5a2f98)[_0x0bb9('0x13')](function(){return _0x56f891(null,_0x5a2f98);});}}else{return utils['getLicense'](_0x5a2f98)[_0x0bb9('0x13')](function(){return _0x56f891(null,_0x5a2f98);});}}return _0x56f891('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x0bb9('0x1c')](function(_0x350458){_0x56f891(_0x350458);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 01786e2..8e18152 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 _0x1de4=['login','/callback','callback','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x3d6618,_0x2ed011){var _0xc449b5=function(_0x55fdaa){while(--_0x55fdaa){_0x3d6618['push'](_0x3d6618['shift']());}};_0xc449b5(++_0x2ed011);}(_0x1de4,0x94));var _0x41de=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x1de4[_0x5317b5];return _0x3b7ce2;};'use strict';var express=require(_0x41de('0x0'));var passport=require(_0x41de('0x1'));var router=express[_0x41de('0x2')]();var controller=require(_0x41de('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x41de('0x4'));router[_0x41de('0x5')]('/',controller[_0x41de('0x6')]);router['get'](_0x41de('0x7'),controller[_0x41de('0x8')],authService['isMiddleware'],userController[_0x41de('0x6')],authService[_0x41de('0x9')]);module[_0x41de('0xa')]=router; \ No newline at end of file +var _0xb06c=['exports','passport','Router','../user/user.controller.js','../../components/auth/service','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0xb06c,0x123));var _0xcb06=function(_0x4d6911,_0x5c2fb3){_0x4d6911=_0x4d6911-0x0;var _0x125de0=_0xb06c[_0x4d6911];return _0x125de0;};'use strict';var express=require('express');var passport=require(_0xcb06('0x0'));var router=express[_0xcb06('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xcb06('0x2'));var authService=require(_0xcb06('0x3'));router['get']('/',controller[_0xcb06('0x4')]);router['get'](_0xcb06('0x5'),controller[_0xcb06('0x6')],authService[_0xcb06('0x7')],userController['login'],authService[_0xcb06('0x8')]);module[_0xcb06('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1b099c6..2509dac 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 _0xeff5=['online','forgot','Email\x20parameter\x20is\x20missing','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','status','params','token','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','save','Password\x20reset!','use','util','passport-local','jayson/promise','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blocked','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','minutes','clearBlockUser','blockedAt','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x3a051f,_0x448120){var _0x487fad=function(_0x1ce6e7){while(--_0x1ce6e7){_0x3a051f['push'](_0x3a051f['shift']());}};_0x487fad(++_0x448120);}(_0xeff5,0x101));var _0x5eff=function(_0x26f916,_0x33c024){_0x26f916=_0x26f916-0x0;var _0x4b590e=_0xeff5[_0x26f916];return _0x4b590e;};'use strict';var util=require(_0x5eff('0x0'));var passport=require('passport');var LocalStrategy=require(_0x5eff('0x1'))['Strategy'];var jayson=require(_0x5eff('0x2'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require(_0x5eff('0x3'))['db'];var authService=require(_0x5eff('0x4'));var utils=require(_0x5eff('0x5'));var client=jayson[_0x5eff('0x6')][_0x5eff('0x7')]({'port':0x232b});function localAuthenticate(_0x1722fe,_0x31e993,_0x446a04,_0x109f8e){var _0x386143,_0x2a1f37;return db[_0x5eff('0x8')][_0x5eff('0x9')]({'where':{'id':0x1},'attributes':[_0x5eff('0xa'),_0x5eff('0xb')],'raw':!![]})[_0x5eff('0xc')](function(_0x37debd){_0x386143=_0x37debd;return _0x1722fe[_0x5eff('0x9')]({'attributes':['id',_0x5eff('0xd'),_0x5eff('0xe'),'salt',_0x5eff('0xf'),'disabled',_0x5eff('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x31e993,'role':{'$or':['admin',_0x5eff('0x11'),'agent']}}});})[_0x5eff('0xc')](function(_0x599d96){if(!_0x599d96||_0x599d96&&_0x599d96[_0x5eff('0xd')]!==_0x31e993){throw new Error(_0x5eff('0x12'));}else{_0x2a1f37=_0x599d96;return _0x2a1f37;}})[_0x5eff('0xc')](function(){_0x2a1f37['authenticate'](_0x446a04,function(_0x404f60,_0x35dd15){var _0xc81e1d=_0x2a1f37['loginAttempts']+0x1;if(_0x404f60){return _0x109f8e(_0x404f60);}else if(!_0x35dd15){if(_0x2a1f37[_0x5eff('0x13')]){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});}else if(_0x386143[_0x5eff('0xa')]>0x0){if(_0x2a1f37[_0x5eff('0x10')]){if(_0x386143[_0x5eff('0xb')]>0x0){if(moment(_0x2a1f37['blockedAt'])['add'](_0x386143['blockDuration'],_0x5eff('0x14'))>moment()){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});}else{return utils[_0x5eff('0x15')](_0x2a1f37,_0xc81e1d,![],null)[_0x5eff('0xc')](function(){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});});}}else{return _0x109f8e(null,![],{'message':_0x5eff('0x12')});}}else{if(_0xc81e1d>=_0x386143['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2a1f37,0x0,!![],moment())['then'](function(){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});});}else{return utils[_0x5eff('0x15')](_0x2a1f37,_0xc81e1d,![],null)[_0x5eff('0xc')](function(){return _0x109f8e(null,![],{'message':_0x5eff('0x12')});});}}}else{return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2a1f37['disabled']){return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x386143[_0x5eff('0xa')]>0x0){if(_0x2a1f37[_0x5eff('0x10')]){if(_0x386143[_0x5eff('0xb')]>0x0){if(moment(_0x2a1f37[_0x5eff('0x16')])[_0x5eff('0x17')](_0x386143[_0x5eff('0xb')],_0x5eff('0x14'))>moment()){return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2a1f37,0x0,![],null)[_0x5eff('0xc')](function(){return utils[_0x5eff('0x18')](_0x2a1f37);})[_0x5eff('0xc')](function(){return _0x109f8e(null,_0x2a1f37);});}}else{return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5eff('0x15')](_0x2a1f37,0x0,![],null)[_0x5eff('0xc')](function(){return utils[_0x5eff('0x18')](_0x2a1f37);})[_0x5eff('0xc')](function(){return _0x109f8e(null,_0x2a1f37);})[_0x5eff('0x19')](function(_0x351eae){return _0x109f8e(null,![],_0x351eae);});}}else{if(_0x2a1f37[_0x5eff('0x10')]){return _0x109f8e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5eff('0x18')](_0x2a1f37)['then'](function(){return _0x109f8e(null,_0x2a1f37);});}}}});})['catch'](function(_0x53dace){return _0x109f8e(null,![],_0x53dace);});}function sendServiceMail(_0x1a3d36){return db[_0x5eff('0x1a')][_0x5eff('0x1b')]({'where':{'service':!![]},'attributes':['id',_0x5eff('0xd'),_0x5eff('0x1c')],'include':[{'model':db[_0x5eff('0x1d')],'as':_0x5eff('0x1e')}]})[_0x5eff('0xc')](function(_0x775b1e){if(!_0x775b1e){throw new Error(_0x5eff('0x1f'));}var _0x48f4cc={'tls':{'rejectUnauthorized':![]}};if(_0x775b1e[_0x5eff('0x1e')]['service']){_0x48f4cc[_0x5eff('0x20')]=_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x20')];}else{_0x48f4cc[_0x5eff('0x21')]=_0x775b1e['Smtp']['host'];_0x48f4cc[_0x5eff('0x22')]=_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x22')];_0x48f4cc[_0x5eff('0x23')]=_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x23')];}if(_0x775b1e[_0x5eff('0x1e')]['authentication']){_0x48f4cc[_0x5eff('0x24')]={'user':_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x11')],'pass':_0x775b1e[_0x5eff('0x1e')][_0x5eff('0x25')]};}var _0x3dee1a={'account':_0x48f4cc,'message':_[_0x5eff('0x26')]({'from':util[_0x5eff('0x27')](_0x5eff('0x28'),_0x775b1e[_0x5eff('0xd')],_0x775b1e[_0x5eff('0x1c')]||_0x775b1e[_0x5eff('0x1e')]['user'])},_0x1a3d36)};return client['request'](_0x5eff('0x29'),_0x3dee1a);})[_0x5eff('0xc')](function(_0x36fb55){if(_0x36fb55[_0x5eff('0x2a')]){throw new Error(util[_0x5eff('0x27')](_0x5eff('0x2b'),_0x36fb55[_0x5eff('0x2a')][_0x5eff('0x2c')]||JSON[_0x5eff('0x2d')](_0x36fb55[_0x5eff('0x2a')])));}return!![];});}function handleError(_0x26e44e,_0x1be615,_0x2b45b4){return _0x26e44e['status'](_0x1be615||0x1f4)[_0x5eff('0x2e')]({'message':_0x2b45b4?_0x2b45b4['message']||_0x2b45b4:''});}exports[_0x5eff('0x2f')]=function(_0x39c118,_0x17d568,_0x1e7ee2){passport[_0x5eff('0x30')]('local',function(_0x43a780,_0x400b09,_0x124ee9){var _0x59f49d=_0x43a780||_0x124ee9;if(_0x59f49d){return handleError(_0x17d568,0x191,_0x59f49d);}if(!_0x400b09){return handleError(_0x17d568,0x194,{'message':_0x5eff('0x31')});}else{var _0x8b09d8={'payload':{'id':_0x400b09['id'],'role':_0x400b09[_0x5eff('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5eff('0x32')](_0x8b09d8)[_0x5eff('0xc')](function(_0x4f15d4){_0x17d568['json']({'id':_0x400b09['id'],'token':_0x4f15d4,'statusCall':'','isAlreadyLogged':_0x400b09[_0x5eff('0x33')]});});}})(_0x39c118,_0x17d568,_0x1e7ee2);};exports[_0x5eff('0x34')]=function(_0x19ceea,_0x4ceb60,_0x1fbb4c){if(!_0x19ceea['body'][_0x5eff('0x1c')]){return handleError(_0x4ceb60,0x1f4,{'message':_0x5eff('0x35')});}var _0x3687cf=rs['generate']();_0x19ceea[_0x5eff('0x36')]['email']=_0x19ceea[_0x5eff('0x36')][_0x5eff('0x1c')][_0x5eff('0x37')]()['toLowerCase']();var _0x2a3ff1;return db[_0x5eff('0x8')][_0x5eff('0x9')]({'where':{'id':0x1},'attributes':[_0x5eff('0xa'),_0x5eff('0xb')],'raw':!![]})[_0x5eff('0xc')](function(_0x5e0228){_0x2a3ff1=_0x5e0228;return db[_0x5eff('0x38')][_0x5eff('0x1b')]({'where':{'email':_0x19ceea[_0x5eff('0x36')][_0x5eff('0x1c')]}});})[_0x5eff('0xc')](function(_0x22cd26){if(!_0x22cd26){throw new Error(_0x5eff('0x39'));}if(_0x22cd26['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x22cd26[_0x5eff('0x10')]){if(moment(_0x22cd26[_0x5eff('0x16')])[_0x5eff('0x17')](_0x2a3ff1[_0x5eff('0xb')],'minutes')>moment()){throw new Error(_0x5eff('0x3a'));}else{_0x22cd26[_0x5eff('0x10')]=![];_0x22cd26[_0x5eff('0x16')]=null;}}_0x22cd26[_0x5eff('0x3b')]=_0x3687cf;_0x22cd26[_0x5eff('0x3c')]=Date[_0x5eff('0x3d')]()+0x36ee80;return _0x22cd26['save']();})['then'](function(){return sendServiceMail({'to':_0x19ceea[_0x5eff('0x36')][_0x5eff('0x1c')],'subject':_0x5eff('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5eff('0x3f')+_0x5eff('0x40')+_0x19ceea[_0x5eff('0x41')][_0x5eff('0x21')]+_0x5eff('0x42')+_0x3687cf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5eff('0xc')](function(){_0x4ceb60[_0x5eff('0x43')](0xc8)[_0x5eff('0x2e')]({'message':'Reset\x20Email\x20sent!'});})[_0x5eff('0x19')](function(_0x16335e){return handleError(_0x4ceb60,0x1f4,_0x16335e);});};exports['reset']=function(_0x526a68,_0x215dbb,_0x594559){return db[_0x5eff('0x38')][_0x5eff('0x1b')]({'where':{'resetPasswordToken':_0x526a68[_0x5eff('0x44')][_0x5eff('0x45')],'resetPasswordExpires':{'$gt':Date[_0x5eff('0x3d')]()}}})[_0x5eff('0xc')](function(_0x2f8c5a){if(!_0x2f8c5a){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0x5eff('0x46'),'enforcePasswordHistory',_0x5eff('0x47')]})[_0x5eff('0xc')](function(_0x141381){if(_0x141381[_0x5eff('0x46')])authService['validatePasswordPattern'](_0x526a68[_0x5eff('0x36')][_0x5eff('0xe')]);if(!_0x141381[_0x5eff('0x48')]||!_0x2f8c5a[_0x5eff('0x49')])return _0x2f8c5a;authService['validatePasswordHistory'](_0x526a68[_0x5eff('0x36')][_0x5eff('0xe')],_0x2f8c5a['previousPasswords'],_0x141381[_0x5eff('0x47')]);return _0x2f8c5a;})[_0x5eff('0xc')](function(){_0x2f8c5a['password']=_0x526a68[_0x5eff('0x36')]['password'];_0x2f8c5a[_0x5eff('0x3b')]=null;_0x2f8c5a[_0x5eff('0x3c')]=null;return _0x2f8c5a[_0x5eff('0x4a')]();});})[_0x5eff('0xc')](function(){_0x215dbb[_0x5eff('0x43')](0xc8)[_0x5eff('0x2e')]({'message':_0x5eff('0x4b')});})[_0x5eff('0x19')](function(_0x370bdb){return handleError(_0x215dbb,0x1f4,_0x370bdb);});};passport[_0x5eff('0x4c')](new LocalStrategy({'usernameField':'name','passwordField':_0x5eff('0xe')},function(_0x3f18aa,_0x53c34b,_0x178f7f){return localAuthenticate(db['User'],_0x3f18aa,_0x53c34b,_0x178f7f);})); \ No newline at end of file +var _0x1f15=['salt','role','disabled','blocked','blockedAt','admin','user','agent','name','authenticate','loginAttempts','blockDuration','minutes','clearBlockUser','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','validatePasswordHistory','Password\x20reset!','util','passport','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x1f15,0xe6));var _0x51f1=function(_0xf1d7ee,_0x331c86){_0xf1d7ee=_0xf1d7ee-0x0;var _0x44110a=_0x1f15[_0xf1d7ee];return _0x44110a;};'use strict';var util=require(_0x51f1('0x0'));var passport=require(_0x51f1('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x51f1('0x2'));var _=require('lodash');var rs=require(_0x51f1('0x3'));var moment=require(_0x51f1('0x4'));var db=require(_0x51f1('0x5'))['db'];var authService=require(_0x51f1('0x6'));var utils=require(_0x51f1('0x7'));var client=jayson['client'][_0x51f1('0x8')]({'port':0x232b});function localAuthenticate(_0x24636f,_0x528d36,_0x1956a6,_0x5ae140){var _0x7ea2e5,_0x45b0af;return db[_0x51f1('0x9')][_0x51f1('0xa')]({'where':{'id':0x1},'attributes':[_0x51f1('0xb'),'blockDuration'],'raw':!![]})[_0x51f1('0xc')](function(_0x361c18){_0x7ea2e5=_0x361c18;return _0x24636f[_0x51f1('0xa')]({'attributes':['id','name','password',_0x51f1('0xd'),_0x51f1('0xe'),_0x51f1('0xf'),_0x51f1('0x10'),_0x51f1('0x11'),'loginAttempts'],'where':{'name':_0x528d36,'role':{'$or':[_0x51f1('0x12'),_0x51f1('0x13'),_0x51f1('0x14')]}}});})[_0x51f1('0xc')](function(_0x57659e){if(!_0x57659e||_0x57659e&&_0x57659e[_0x51f1('0x15')]!==_0x528d36){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x45b0af=_0x57659e;return _0x45b0af;}})[_0x51f1('0xc')](function(){_0x45b0af[_0x51f1('0x16')](_0x1956a6,function(_0x48db5e,_0x436bfd){var _0x5feabf=_0x45b0af[_0x51f1('0x17')]+0x1;if(_0x48db5e){return _0x5ae140(_0x48db5e);}else if(!_0x436bfd){if(_0x45b0af['disabled']){return _0x5ae140(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x7ea2e5[_0x51f1('0xb')]>0x0){if(_0x45b0af['blocked']){if(_0x7ea2e5['blockDuration']>0x0){if(moment(_0x45b0af['blockedAt'])['add'](_0x7ea2e5[_0x51f1('0x18')],_0x51f1('0x19'))>moment()){return _0x5ae140(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x51f1('0x1a')](_0x45b0af,_0x5feabf,![],null)[_0x51f1('0xc')](function(){return _0x5ae140(null,![],{'message':_0x51f1('0x1b')});});}}else{return _0x5ae140(null,![],{'message':_0x51f1('0x1b')});}}else{if(_0x5feabf>=_0x7ea2e5['allowedLoginAttempts']){return utils[_0x51f1('0x1a')](_0x45b0af,0x0,!![],moment())[_0x51f1('0xc')](function(){return _0x5ae140(null,![],{'message':_0x51f1('0x1b')});});}else{return utils[_0x51f1('0x1a')](_0x45b0af,_0x5feabf,![],null)['then'](function(){return _0x5ae140(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5ae140(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x45b0af[_0x51f1('0xf')]){return _0x5ae140(null,![],{'message':_0x51f1('0x1b')});}else if(_0x7ea2e5[_0x51f1('0xb')]>0x0){if(_0x45b0af[_0x51f1('0x10')]){if(_0x7ea2e5[_0x51f1('0x18')]>0x0){if(moment(_0x45b0af['blockedAt'])[_0x51f1('0x1c')](_0x7ea2e5['blockDuration'],_0x51f1('0x19'))>moment()){return _0x5ae140(null,![],{'message':_0x51f1('0x1b')});}else{return utils[_0x51f1('0x1a')](_0x45b0af,0x0,![],null)[_0x51f1('0xc')](function(){return utils[_0x51f1('0x1d')](_0x45b0af);})[_0x51f1('0xc')](function(){return _0x5ae140(null,_0x45b0af);});}}else{return _0x5ae140(null,![],{'message':_0x51f1('0x1b')});}}else{return utils[_0x51f1('0x1a')](_0x45b0af,0x0,![],null)[_0x51f1('0xc')](function(){return utils[_0x51f1('0x1d')](_0x45b0af);})['then'](function(){return _0x5ae140(null,_0x45b0af);})[_0x51f1('0x1e')](function(_0x225d69){return _0x5ae140(null,![],_0x225d69);});}}else{if(_0x45b0af[_0x51f1('0x10')]){return _0x5ae140(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x51f1('0x1d')](_0x45b0af)[_0x51f1('0xc')](function(){return _0x5ae140(null,_0x45b0af);});}}}});})[_0x51f1('0x1e')](function(_0x10a2b0){return _0x5ae140(null,![],_0x10a2b0);});}function sendServiceMail(_0x10ceed){return db[_0x51f1('0x1f')][_0x51f1('0x20')]({'where':{'service':!![]},'attributes':['id',_0x51f1('0x15'),_0x51f1('0x21')],'include':[{'model':db[_0x51f1('0x22')],'as':_0x51f1('0x23')}]})[_0x51f1('0xc')](function(_0x908be9){if(!_0x908be9){throw new Error(_0x51f1('0x24'));}var _0x5c5476={'tls':{'rejectUnauthorized':![]}};if(_0x908be9[_0x51f1('0x23')][_0x51f1('0x25')]){_0x5c5476[_0x51f1('0x25')]=_0x908be9[_0x51f1('0x23')][_0x51f1('0x25')];}else{_0x5c5476['host']=_0x908be9[_0x51f1('0x23')]['host'];_0x5c5476[_0x51f1('0x26')]=_0x908be9[_0x51f1('0x23')][_0x51f1('0x26')];_0x5c5476[_0x51f1('0x27')]=_0x908be9[_0x51f1('0x23')][_0x51f1('0x27')];}if(_0x908be9['Smtp'][_0x51f1('0x28')]){_0x5c5476[_0x51f1('0x29')]={'user':_0x908be9['Smtp'][_0x51f1('0x13')],'pass':_0x908be9[_0x51f1('0x23')][_0x51f1('0x2a')]};}var _0x291fd9={'account':_0x5c5476,'message':_['merge']({'from':util[_0x51f1('0x2b')](_0x51f1('0x2c'),_0x908be9[_0x51f1('0x15')],_0x908be9[_0x51f1('0x21')]||_0x908be9[_0x51f1('0x23')][_0x51f1('0x13')])},_0x10ceed)};return client[_0x51f1('0x2d')](_0x51f1('0x2e'),_0x291fd9);})[_0x51f1('0xc')](function(_0x43e4bf){if(_0x43e4bf[_0x51f1('0x2f')]){throw new Error(util['format'](_0x51f1('0x30'),_0x43e4bf[_0x51f1('0x2f')][_0x51f1('0x31')]||JSON[_0x51f1('0x32')](_0x43e4bf[_0x51f1('0x2f')])));}return!![];});}function handleError(_0x1cfcef,_0x5600f0,_0x3654f6){return _0x1cfcef[_0x51f1('0x33')](_0x5600f0||0x1f4)['send']({'message':_0x3654f6?_0x3654f6[_0x51f1('0x31')]||_0x3654f6:''});}exports['login']=function(_0x37bf79,_0x57f5ce,_0x4a399c){passport[_0x51f1('0x16')]('local',function(_0xd29c2f,_0x431bdb,_0x597b8f){var _0x4ea554=_0xd29c2f||_0x597b8f;if(_0x4ea554){return handleError(_0x57f5ce,0x191,_0x4ea554);}if(!_0x431bdb){return handleError(_0x57f5ce,0x194,{'message':_0x51f1('0x34')});}else{var _0x3ea825={'payload':{'id':_0x431bdb['id'],'role':_0x431bdb[_0x51f1('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3ea825)[_0x51f1('0xc')](function(_0x44dae5){_0x57f5ce[_0x51f1('0x35')]({'id':_0x431bdb['id'],'token':_0x44dae5,'statusCall':'','isAlreadyLogged':_0x431bdb['online']});});}})(_0x37bf79,_0x57f5ce,_0x4a399c);};exports[_0x51f1('0x36')]=function(_0xb6e777,_0x2c68da,_0x11847c){if(!_0xb6e777[_0x51f1('0x37')]['email']){return handleError(_0x2c68da,0x1f4,{'message':_0x51f1('0x38')});}var _0x2c624c=rs['generate']();_0xb6e777[_0x51f1('0x37')][_0x51f1('0x21')]=_0xb6e777[_0x51f1('0x37')][_0x51f1('0x21')][_0x51f1('0x39')]()[_0x51f1('0x3a')]();var _0x20cf5e;return db['Setting'][_0x51f1('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x51f1('0x18')],'raw':!![]})[_0x51f1('0xc')](function(_0x1408ef){_0x20cf5e=_0x1408ef;return db[_0x51f1('0x3b')][_0x51f1('0x20')]({'where':{'email':_0xb6e777['body']['email']}});})[_0x51f1('0xc')](function(_0x4b8c44){if(!_0x4b8c44){throw new Error(_0x51f1('0x3c'));}if(_0x4b8c44['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4b8c44[_0x51f1('0x10')]){if(moment(_0x4b8c44[_0x51f1('0x11')])[_0x51f1('0x1c')](_0x20cf5e['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4b8c44[_0x51f1('0x10')]=![];_0x4b8c44[_0x51f1('0x11')]=null;}}_0x4b8c44[_0x51f1('0x3d')]=_0x2c624c;_0x4b8c44[_0x51f1('0x3e')]=Date[_0x51f1('0x3f')]()+0x36ee80;return _0x4b8c44[_0x51f1('0x40')]();})[_0x51f1('0xc')](function(){return sendServiceMail({'to':_0xb6e777[_0x51f1('0x37')]['email'],'subject':_0x51f1('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x51f1('0x42')+'https://'+_0xb6e777[_0x51f1('0x43')][_0x51f1('0x44')]+_0x51f1('0x45')+_0x2c624c+'\x0a\x0a'+_0x51f1('0x46')});})[_0x51f1('0xc')](function(){_0x2c68da[_0x51f1('0x33')](0xc8)[_0x51f1('0x47')]({'message':'Reset\x20Email\x20sent!'});})[_0x51f1('0x1e')](function(_0xe097e0){return handleError(_0x2c68da,0x1f4,_0xe097e0);});};exports['reset']=function(_0x328d7b,_0x595164,_0x206593){return db[_0x51f1('0x3b')][_0x51f1('0x20')]({'where':{'resetPasswordToken':_0x328d7b[_0x51f1('0x48')][_0x51f1('0x49')],'resetPasswordExpires':{'$gt':Date[_0x51f1('0x3f')]()}}})[_0x51f1('0xc')](function(_0x42e72b){if(!_0x42e72b){throw new Error(_0x51f1('0x4a'));}return db[_0x51f1('0x9')][_0x51f1('0xa')]({'attributes':['id',_0x51f1('0x4b'),_0x51f1('0x4c'),_0x51f1('0x4d')]})[_0x51f1('0xc')](function(_0x5d7bb5){if(_0x5d7bb5[_0x51f1('0x4b')])authService['validatePasswordPattern'](_0x328d7b[_0x51f1('0x37')][_0x51f1('0x4e')]);if(!_0x5d7bb5['enforcePasswordHistory']||!_0x42e72b['previousPasswords'])return _0x42e72b;authService[_0x51f1('0x4f')](_0x328d7b[_0x51f1('0x37')][_0x51f1('0x4e')],_0x42e72b['previousPasswords'],_0x5d7bb5[_0x51f1('0x4d')]);return _0x42e72b;})[_0x51f1('0xc')](function(){_0x42e72b[_0x51f1('0x4e')]=_0x328d7b[_0x51f1('0x37')]['password'];_0x42e72b[_0x51f1('0x3d')]=null;_0x42e72b['resetPasswordExpires']=null;return _0x42e72b[_0x51f1('0x40')]();});})[_0x51f1('0xc')](function(){_0x595164[_0x51f1('0x33')](0xc8)[_0x51f1('0x47')]({'message':_0x51f1('0x50')});})[_0x51f1('0x1e')](function(_0xcee541){return handleError(_0x595164,0x1f4,_0xcee541);});};passport['use'](new LocalStrategy({'usernameField':_0x51f1('0x15'),'passwordField':_0x51f1('0x4e')},function(_0x1722bc,_0x3f118b,_0x54fc7c){return localAuthenticate(db[_0x51f1('0x3b')],_0x1722bc,_0x3f118b,_0x54fc7c);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c60e1b2..8d51076 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 _0xe065=['login','/reset/:token','exports','Router','./authLocal.controller','post'];(function(_0x42e407,_0x22ff7b){var _0x2e55b6=function(_0x4b0e05){while(--_0x4b0e05){_0x42e407['push'](_0x42e407['shift']());}};_0x2e55b6(++_0x22ff7b);}(_0xe065,0xc9));var _0x5e06=function(_0x514461,_0x4744d6){_0x514461=_0x514461-0x0;var _0x4f8748=_0xe065[_0x514461];return _0x4f8748;};'use strict';var express=require('express');var router=express[_0x5e06('0x0')]();var controller=require(_0x5e06('0x1'));router[_0x5e06('0x2')]('/',controller[_0x5e06('0x3')]);router['post']('/forgot',controller['forgot']);router[_0x5e06('0x2')](_0x5e06('0x4'),controller['reset']);module[_0x5e06('0x5')]=router; \ No newline at end of file +var _0x312c=['express','Router','./authLocal.controller','post','login','/forgot','reset'];(function(_0x32d5fb,_0x57dcee){var _0x2986af=function(_0x418895){while(--_0x418895){_0x32d5fb['push'](_0x32d5fb['shift']());}};_0x2986af(++_0x57dcee);}(_0x312c,0x103));var _0xc312=function(_0x3c4e2b,_0x4cfa30){_0x3c4e2b=_0x3c4e2b-0x0;var _0x233256=_0x312c[_0x3c4e2b];return _0x233256;};'use strict';var express=require(_0xc312('0x0'));var router=express[_0xc312('0x1')]();var controller=require(_0xc312('0x2'));router[_0xc312('0x3')]('/',controller[_0xc312('0x4')]);router[_0xc312('0x3')](_0xc312('0x5'),controller['forgot']);router[_0xc312('0x3')]('/reset/:token',controller[_0xc312('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 08e204f..11be89a 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 _0xe831=['exports','STRING','INTEGER','sequelize'];(function(_0xc0374e,_0x2de1fc){var _0x3cabe1=function(_0x2cfcae){while(--_0x2cfcae){_0xc0374e['push'](_0xc0374e['shift']());}};_0x3cabe1(++_0x2de1fc);}(_0xe831,0x137));var _0x1e83=function(_0x257115,_0x5504d8){_0x257115=_0x257115-0x0;var _0x4ec752=_0xe831[_0x257115];return _0x4ec752;};'use strict';var Sequelize=require(_0x1e83('0x0'));module[_0x1e83('0x1')]={'name':{'type':Sequelize[_0x1e83('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1e83('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1e83('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3494=['BOOLEAN','sequelize','STRING'];(function(_0x41d5b4,_0x449f98){var _0x56a933=function(_0xe2aa20){while(--_0xe2aa20){_0x41d5b4['push'](_0x41d5b4['shift']());}};_0x56a933(++_0x449f98);}(_0x3494,0x163));var _0x4349=function(_0x499c25,_0x1b4777){_0x499c25=_0x499c25-0x0;var _0x344aa5=_0x3494[_0x499c25];return _0x344aa5;};'use strict';var Sequelize=require(_0x4349('0x0'));module['exports']={'name':{'type':Sequelize[_0x4349('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x4349('0x1')]},'description':{'type':Sequelize[_0x4349('0x1')]},'status':{'type':Sequelize[_0x4349('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 8739c28..2bba9f6 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 _0x9e41=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range','reject','save','update','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','then','include','findAll','rows','catch','params','includeAll','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x55256b,_0x28779f){var _0x2b03f2=function(_0x24148c){while(--_0x24148c){_0x55256b['push'](_0x55256b['shift']());}};_0x2b03f2(++_0x28779f);}(_0x9e41,0x101));var _0x19e4=function(_0x4f02e9,_0x1ac79c){_0x4f02e9=_0x4f02e9-0x0;var _0x111b56=_0x9e41[_0x4f02e9];return _0x111b56;};'use strict';var emlformat=require(_0x19e4('0x0'));var rimraf=require(_0x19e4('0x1'));var zipdir=require(_0x19e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19e4('0x3'));var moment=require(_0x19e4('0x4'));var BPromise=require(_0x19e4('0x5'));var Mustache=require(_0x19e4('0x6'));var util=require(_0x19e4('0x7'));var path=require(_0x19e4('0x8'));var sox=require(_0x19e4('0x9'));var csv=require(_0x19e4('0xa'));var ejs=require(_0x19e4('0xb'));var fs=require('fs');var fs_extra=require(_0x19e4('0xc'));var _=require(_0x19e4('0xd'));var squel=require(_0x19e4('0xe'));var crypto=require('crypto');var jsforce=require(_0x19e4('0xf'));var deskjs=require(_0x19e4('0x10'));var toCsv=require(_0x19e4('0xa'));var querystring=require(_0x19e4('0x11'));var Papa=require(_0x19e4('0x12'));var Redis=require(_0x19e4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x19e4('0x14'));var as=require(_0x19e4('0x15'));var hardwareService=require(_0x19e4('0x16'));var logger=require(_0x19e4('0x17'))(_0x19e4('0x18'));var utils=require(_0x19e4('0x19'));var config=require(_0x19e4('0x1a'));var licenseUtil=require(_0x19e4('0x1b'));var db=require(_0x19e4('0x1c'))['db'];function respondWithStatusCode(_0x15b8df,_0x4f6a83){_0x4f6a83=_0x4f6a83||0xcc;return function(_0x164e4e){if(_0x164e4e){return _0x15b8df[_0x19e4('0x1d')](_0x4f6a83);}return _0x15b8df[_0x19e4('0x1e')](_0x4f6a83)['end']();};}function respondWithResult(_0x184bb4,_0x444d85){_0x444d85=_0x444d85||0xc8;return function(_0x4adb04){if(_0x4adb04){return _0x184bb4[_0x19e4('0x1e')](_0x444d85)[_0x19e4('0x1f')](_0x4adb04);}};}function respondWithFilteredResult(_0x5ea7c6,_0x337e33){return function(_0x59c48c){if(_0x59c48c){var _0x1b5ad1=typeof _0x337e33['offset']===_0x19e4('0x20')&&typeof _0x337e33[_0x19e4('0x21')]==='undefined';var _0xda24d=_0x59c48c['count'];var _0x27dd49=_0x1b5ad1?0x0:_0x337e33[_0x19e4('0x22')];var _0x4a5137=_0x1b5ad1?_0x59c48c['count']:_0x337e33['offset']+_0x337e33['limit'];var _0x38c793;if(_0x4a5137>=_0xda24d){_0x4a5137=_0xda24d;_0x38c793=0xc8;}else{_0x38c793=0xce;}_0x5ea7c6[_0x19e4('0x1e')](_0x38c793);return _0x5ea7c6[_0x19e4('0x23')](_0x19e4('0x24'),_0x27dd49+'-'+_0x4a5137+'/'+_0xda24d)['json'](_0x59c48c);}return null;};}function patchUpdates(_0x371a18){return function(_0x22a456){try{jsonpatch['apply'](_0x22a456,_0x371a18,!![]);}catch(_0x45c7f4){return BPromise[_0x19e4('0x25')](_0x45c7f4);}return _0x22a456[_0x19e4('0x26')]();};}function saveUpdates(_0x3293b2,_0x50b8fd){return function(_0xa05a00){if(_0xa05a00){return _0xa05a00[_0x19e4('0x27')](_0x3293b2)['then'](function(_0x56a070){return _0x56a070;});}return null;};}function removeEntity(_0x5e7527,_0x9ee83b){return function(_0x214449){if(_0x214449){return _0x214449[_0x19e4('0x28')]()['then'](function(){_0x5e7527[_0x19e4('0x1e')](0xcc)[_0x19e4('0x29')]();});}};}function handleEntityNotFound(_0x45275d,_0x20b260){return function(_0x3b2904){if(!_0x3b2904){_0x45275d['sendStatus'](0x194);}return _0x3b2904;};}function handleError(_0xc1bbe2,_0x24a408){_0x24a408=_0x24a408||0x1f4;return function(_0x1b1051){logger[_0x19e4('0x2a')](_0x1b1051[_0x19e4('0x2b')]);if(_0x1b1051[_0x19e4('0x2c')]){delete _0x1b1051[_0x19e4('0x2c')];}_0xc1bbe2[_0x19e4('0x1e')](_0x24a408)[_0x19e4('0x2d')](_0x1b1051);};}exports[_0x19e4('0x2e')]=function(_0x6eb957,_0x8be049){var _0x3f6224={},_0xf68ed5={},_0x3fe363={'count':0x0,'rows':[]};var _0x464e8a=_[_0x19e4('0x2f')](db[_0x19e4('0x30')][_0x19e4('0x31')],function(_0x42e111){return{'name':_0x42e111[_0x19e4('0x32')],'type':_0x42e111[_0x19e4('0x33')][_0x19e4('0x34')]};});_0xf68ed5['model']=_[_0x19e4('0x2f')](_0x464e8a,'name');_0xf68ed5['query']=_[_0x19e4('0x35')](_0x6eb957[_0x19e4('0x36')]);_0xf68ed5[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0xf68ed5[_0x19e4('0x39')],_0xf68ed5[_0x19e4('0x36')]);_0x3f6224[_0x19e4('0x3a')]=_[_0x19e4('0x38')](_0xf68ed5[_0x19e4('0x39')],qs[_0x19e4('0x3b')](_0x6eb957['query'][_0x19e4('0x3b')]));_0x3f6224[_0x19e4('0x3a')]=_0x3f6224[_0x19e4('0x3a')][_0x19e4('0x3c')]?_0x3f6224[_0x19e4('0x3a')]:_0xf68ed5[_0x19e4('0x39')];if(!_0x6eb957[_0x19e4('0x36')]['hasOwnProperty'](_0x19e4('0x3d'))){_0x3f6224[_0x19e4('0x21')]=qs[_0x19e4('0x21')](_0x6eb957['query'][_0x19e4('0x21')]);_0x3f6224['offset']=qs[_0x19e4('0x22')](_0x6eb957[_0x19e4('0x36')]['offset']);}_0x3f6224[_0x19e4('0x3e')]=qs[_0x19e4('0x3f')](_0x6eb957[_0x19e4('0x36')]['sort']);_0x3f6224[_0x19e4('0x40')]=qs['filters'](_[_0x19e4('0x41')](_0x6eb957[_0x19e4('0x36')],_0xf68ed5['filters']),_0x464e8a);if(_0x6eb957[_0x19e4('0x36')][_0x19e4('0x42')]){_0x3f6224[_0x19e4('0x40')]=_[_0x19e4('0x43')](_0x3f6224['where'],{'$or':_['map'](_0x464e8a,function(_0x27c81b){if(_0x27c81b['type']!==_0x19e4('0x44')){var _0x4e1221={};_0x4e1221[_0x27c81b[_0x19e4('0x2c')]]={'$like':'%'+_0x6eb957['query']['filter']+'%'};return _0x4e1221;}})});}_0x3f6224=_['merge']({},_0x3f6224,_0x6eb957[_0x19e4('0x45')]);var _0x2e9ff4={'where':_0x3f6224[_0x19e4('0x40')]};return db[_0x19e4('0x30')][_0x19e4('0x46')](_0x2e9ff4)[_0x19e4('0x47')](function(_0x5e1b8b){_0x3fe363[_0x19e4('0x46')]=_0x5e1b8b;if(_0x6eb957[_0x19e4('0x36')]['includeAll']){_0x3f6224[_0x19e4('0x48')]=[{'all':!![]}];}return db[_0x19e4('0x30')][_0x19e4('0x49')](_0x3f6224);})[_0x19e4('0x47')](function(_0x5132c0){_0x3fe363[_0x19e4('0x4a')]=_0x5132c0;return _0x3fe363;})['then'](respondWithFilteredResult(_0x8be049,_0x3f6224))[_0x19e4('0x4b')](handleError(_0x8be049,null));};exports['show']=function(_0xb18265,_0x595bbd){var _0x1bdee6={'raw':![],'where':{'id':_0xb18265[_0x19e4('0x4c')]['id']}},_0x500c59={};_0x500c59['model']=_[_0x19e4('0x35')](db[_0x19e4('0x30')][_0x19e4('0x31')]);_0x500c59['query']=_[_0x19e4('0x35')](_0xb18265[_0x19e4('0x36')]);_0x500c59[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0x500c59[_0x19e4('0x39')],_0x500c59[_0x19e4('0x36')]);_0x1bdee6[_0x19e4('0x3a')]=_['intersection'](_0x500c59[_0x19e4('0x39')],qs[_0x19e4('0x3b')](_0xb18265[_0x19e4('0x36')][_0x19e4('0x3b')]));_0x1bdee6[_0x19e4('0x3a')]=_0x1bdee6[_0x19e4('0x3a')]['length']?_0x1bdee6['attributes']:_0x500c59[_0x19e4('0x39')];if(_0xb18265[_0x19e4('0x36')][_0x19e4('0x4d')]){_0x1bdee6[_0x19e4('0x48')]=[{'all':!![]}];}_0x1bdee6=_[_0x19e4('0x43')]({},_0x1bdee6,_0xb18265[_0x19e4('0x45')]);return db['Automation']['find'](_0x1bdee6)['then'](handleEntityNotFound(_0x595bbd,null))[_0x19e4('0x47')](respondWithResult(_0x595bbd,null))[_0x19e4('0x4b')](handleError(_0x595bbd,null));};exports[_0x19e4('0x4e')]=function(_0x470ece,_0x33cb19){return db[_0x19e4('0x30')]['create'](_0x470ece[_0x19e4('0x4f')],{})[_0x19e4('0x47')](respondWithResult(_0x33cb19,0xc9))['catch'](handleError(_0x33cb19,null));};exports[_0x19e4('0x27')]=function(_0x261e09,_0x34fd7d){if(_0x261e09[_0x19e4('0x4f')]['id']){delete _0x261e09[_0x19e4('0x4f')]['id'];}return db[_0x19e4('0x30')][_0x19e4('0x50')]({'where':{'id':_0x261e09[_0x19e4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34fd7d,null))[_0x19e4('0x47')](saveUpdates(_0x261e09[_0x19e4('0x4f')],null))['then'](respondWithResult(_0x34fd7d,null))['catch'](handleError(_0x34fd7d,null));};exports[_0x19e4('0x28')]=function(_0xd32e8e,_0x3e94ed){return db['Automation'][_0x19e4('0x50')]({'where':{'id':_0xd32e8e[_0x19e4('0x4c')]['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0x3e94ed,null))[_0x19e4('0x47')](removeEntity(_0x3e94ed,null))[_0x19e4('0x4b')](handleError(_0x3e94ed,null));};exports[_0x19e4('0x51')]=function(_0x24c457,_0xdd0912,_0x51e9f4){return db[_0x19e4('0x52')][_0x19e4('0x50')]({'where':{'id':_0x24c457[_0x19e4('0x4c')]['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0xdd0912,null))['then'](function(_0x44cd59){if(_0x44cd59){return _0x44cd59[_0x19e4('0x51')](_0x24c457['body'][_0x19e4('0x53')],_[_0x19e4('0x54')](_0x24c457[_0x19e4('0x4f')],[_0x19e4('0x53'),'id'])||{});}})['then'](respondWithResult(_0xdd0912,null))[_0x19e4('0x4b')](handleError(_0xdd0912,null));};exports[_0x19e4('0x55')]=function(_0x3fcd3a,_0x37161c,_0x113b97){var _0x2a634d={};var _0x41ce6b={};var _0x3af5fa;var _0x53a89e;return db[_0x19e4('0x30')][_0x19e4('0x56')]({'where':{'id':_0x3fcd3a[_0x19e4('0x4c')]['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0x37161c,null))[_0x19e4('0x47')](function(_0x1bf793){if(_0x1bf793){_0x3af5fa=_0x1bf793;_0x41ce6b[_0x19e4('0x39')]=_['keys'](db[_0x19e4('0x52')][_0x19e4('0x31')]);_0x41ce6b[_0x19e4('0x36')]=_['keys'](_0x3fcd3a[_0x19e4('0x36')]);_0x41ce6b[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0x41ce6b[_0x19e4('0x39')],_0x41ce6b[_0x19e4('0x36')]);_0x2a634d['attributes']=_[_0x19e4('0x38')](_0x41ce6b[_0x19e4('0x39')],qs['fields'](_0x3fcd3a['query']['fields']));_0x2a634d['attributes']=_0x2a634d[_0x19e4('0x3a')][_0x19e4('0x3c')]?_0x2a634d[_0x19e4('0x3a')]:_0x41ce6b['model'];_0x2a634d[_0x19e4('0x3e')]=qs[_0x19e4('0x3f')](_0x3fcd3a[_0x19e4('0x36')][_0x19e4('0x3f')]);_0x2a634d[_0x19e4('0x40')]=qs[_0x19e4('0x37')](_['pick'](_0x3fcd3a[_0x19e4('0x36')],_0x41ce6b[_0x19e4('0x37')]));if(_0x3fcd3a['query'][_0x19e4('0x42')]){_0x2a634d['where']=_[_0x19e4('0x43')](_0x2a634d[_0x19e4('0x40')],{'$or':_['map'](_0x2a634d['attributes'],function(_0xfbaeed){var _0x2abf6d={};_0x2abf6d[_0xfbaeed]={'$like':'%'+_0x3fcd3a[_0x19e4('0x36')][_0x19e4('0x42')]+'%'};return _0x2abf6d;})});}_0x2a634d=_[_0x19e4('0x43')]({},_0x2a634d,_0x3fcd3a[_0x19e4('0x45')]);return _0x3af5fa[_0x19e4('0x55')](_0x2a634d);}})[_0x19e4('0x47')](function(_0x148e74){if(_0x148e74){_0x53a89e=_0x148e74[_0x19e4('0x3c')];if(!_0x3fcd3a['query'][_0x19e4('0x57')](_0x19e4('0x3d'))){_0x2a634d[_0x19e4('0x21')]=qs[_0x19e4('0x21')](_0x3fcd3a['query']['limit']);_0x2a634d['offset']=qs[_0x19e4('0x22')](_0x3fcd3a[_0x19e4('0x36')][_0x19e4('0x22')]);}return _0x3af5fa[_0x19e4('0x55')](_0x2a634d);}})[_0x19e4('0x47')](function(_0x327683){if(_0x327683){return _0x327683?{'count':_0x53a89e,'rows':_0x327683}:null;}})[_0x19e4('0x47')](respondWithResult(_0x37161c,null))[_0x19e4('0x4b')](handleError(_0x37161c,null));};exports[_0x19e4('0x58')]=function(_0x183b47,_0x3923c,_0xb115cf){return db[_0x19e4('0x59')][_0x19e4('0x50')]({'where':{'id':_0x183b47[_0x19e4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3923c,null))['then'](function(_0x21f686){if(_0x21f686){return _0x21f686[_0x19e4('0x58')](_0x183b47['body'][_0x19e4('0x53')],_['omit'](_0x183b47[_0x19e4('0x4f')],[_0x19e4('0x53'),'id'])||{});}})[_0x19e4('0x47')](respondWithResult(_0x3923c,null))[_0x19e4('0x4b')](handleError(_0x3923c,null));};exports['getActions']=function(_0x5aff32,_0x39af64,_0x5e898b){var _0x319116={};var _0x114a10={};var _0x21598d;var _0x4614bf;return db[_0x19e4('0x30')][_0x19e4('0x56')]({'where':{'id':_0x5aff32['params']['id']}})[_0x19e4('0x47')](handleEntityNotFound(_0x39af64,null))[_0x19e4('0x47')](function(_0x4dcb55){if(_0x4dcb55){_0x21598d=_0x4dcb55;_0x114a10['model']=_[_0x19e4('0x35')](db[_0x19e4('0x59')]['rawAttributes']);_0x114a10['query']=_[_0x19e4('0x35')](_0x5aff32['query']);_0x114a10[_0x19e4('0x37')]=_[_0x19e4('0x38')](_0x114a10[_0x19e4('0x39')],_0x114a10[_0x19e4('0x36')]);_0x319116[_0x19e4('0x3a')]=_[_0x19e4('0x38')](_0x114a10[_0x19e4('0x39')],qs['fields'](_0x5aff32[_0x19e4('0x36')][_0x19e4('0x3b')]));_0x319116[_0x19e4('0x3a')]=_0x319116[_0x19e4('0x3a')][_0x19e4('0x3c')]?_0x319116[_0x19e4('0x3a')]:_0x114a10[_0x19e4('0x39')];_0x319116[_0x19e4('0x3e')]=qs[_0x19e4('0x3f')](_0x5aff32[_0x19e4('0x36')][_0x19e4('0x3f')]);_0x319116['where']=qs[_0x19e4('0x37')](_['pick'](_0x5aff32['query'],_0x114a10[_0x19e4('0x37')]));if(_0x5aff32[_0x19e4('0x36')]['filter']){_0x319116[_0x19e4('0x40')]=_[_0x19e4('0x43')](_0x319116['where'],{'$or':_['map'](_0x319116[_0x19e4('0x3a')],function(_0x4b4468){var _0x1797bd={};_0x1797bd[_0x4b4468]={'$like':'%'+_0x5aff32['query']['filter']+'%'};return _0x1797bd;})});}_0x319116=_[_0x19e4('0x43')]({},_0x319116,_0x5aff32[_0x19e4('0x45')]);return _0x21598d[_0x19e4('0x5a')](_0x319116);}})[_0x19e4('0x47')](function(_0x3c9325){if(_0x3c9325){_0x4614bf=_0x3c9325[_0x19e4('0x3c')];if(!_0x5aff32[_0x19e4('0x36')]['hasOwnProperty'](_0x19e4('0x3d'))){_0x319116['limit']=qs[_0x19e4('0x21')](_0x5aff32[_0x19e4('0x36')][_0x19e4('0x21')]);_0x319116[_0x19e4('0x22')]=qs[_0x19e4('0x22')](_0x5aff32['query']['offset']);}return _0x21598d[_0x19e4('0x5a')](_0x319116);}})['then'](function(_0x48982e){if(_0x48982e){return _0x48982e?{'count':_0x4614bf,'rows':_0x48982e}:null;}})[_0x19e4('0x47')](respondWithResult(_0x39af64,null))['catch'](handleError(_0x39af64,null));}; \ No newline at end of file +var _0x3d13=['sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','index','map','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','Automation','includeAll','include','findAll','catch','show','params','body','find','addConditions','Condition','omit','ids','getConditions','findOne','addActions','Action','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d13,0x1d7));var _0x33d1=function(_0x2ef0b8,_0x4fe86d){_0x2ef0b8=_0x2ef0b8-0x0;var _0x41a811=_0x3d13[_0x2ef0b8];return _0x41a811;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33d1('0x0'));var zipdir=require(_0x33d1('0x1'));var jsonpatch=require(_0x33d1('0x2'));var rp=require('request-promise');var moment=require(_0x33d1('0x3'));var BPromise=require(_0x33d1('0x4'));var Mustache=require(_0x33d1('0x5'));var util=require(_0x33d1('0x6'));var path=require(_0x33d1('0x7'));var sox=require(_0x33d1('0x8'));var csv=require(_0x33d1('0x9'));var ejs=require(_0x33d1('0xa'));var fs=require('fs');var fs_extra=require(_0x33d1('0xb'));var _=require(_0x33d1('0xc'));var squel=require(_0x33d1('0xd'));var crypto=require(_0x33d1('0xe'));var jsforce=require(_0x33d1('0xf'));var deskjs=require(_0x33d1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x33d1('0x11'));var Papa=require('papaparse');var Redis=require(_0x33d1('0x12'));var authService=require(_0x33d1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33d1('0x14'));var logger=require(_0x33d1('0x15'))(_0x33d1('0x16'));var utils=require(_0x33d1('0x17'));var config=require(_0x33d1('0x18'));var licenseUtil=require(_0x33d1('0x19'));var db=require(_0x33d1('0x1a'))['db'];function respondWithStatusCode(_0x27e20e,_0xb9c3fb){_0xb9c3fb=_0xb9c3fb||0xcc;return function(_0x2cabb2){if(_0x2cabb2){return _0x27e20e[_0x33d1('0x1b')](_0xb9c3fb);}return _0x27e20e[_0x33d1('0x1c')](_0xb9c3fb)['end']();};}function respondWithResult(_0x39473f,_0xdee58b){_0xdee58b=_0xdee58b||0xc8;return function(_0x21e502){if(_0x21e502){return _0x39473f['status'](_0xdee58b)['json'](_0x21e502);}};}function respondWithFilteredResult(_0x2c11fc,_0x4ded73){return function(_0x47cb92){if(_0x47cb92){var _0x362251=typeof _0x4ded73[_0x33d1('0x1d')]===_0x33d1('0x1e')&&typeof _0x4ded73[_0x33d1('0x1f')]===_0x33d1('0x1e');var _0x10002d=_0x47cb92[_0x33d1('0x20')];var _0x211e26=_0x362251?0x0:_0x4ded73[_0x33d1('0x1d')];var _0x3100ed=_0x362251?_0x47cb92[_0x33d1('0x20')]:_0x4ded73[_0x33d1('0x1d')]+_0x4ded73[_0x33d1('0x1f')];var _0x585707;if(_0x3100ed>=_0x10002d){_0x3100ed=_0x10002d;_0x585707=0xc8;}else{_0x585707=0xce;}_0x2c11fc[_0x33d1('0x1c')](_0x585707);return _0x2c11fc[_0x33d1('0x21')]('Content-Range',_0x211e26+'-'+_0x3100ed+'/'+_0x10002d)['json'](_0x47cb92);}return null;};}function patchUpdates(_0x439cb1){return function(_0x52240f){try{jsonpatch[_0x33d1('0x22')](_0x52240f,_0x439cb1,!![]);}catch(_0x102eee){return BPromise[_0x33d1('0x23')](_0x102eee);}return _0x52240f[_0x33d1('0x24')]();};}function saveUpdates(_0x55e620,_0x5bdb17){return function(_0xc251af){if(_0xc251af){return _0xc251af[_0x33d1('0x25')](_0x55e620)[_0x33d1('0x26')](function(_0x34a907){return _0x34a907;});}return null;};}function removeEntity(_0x5dce45,_0x14c808){return function(_0x37fa0a){if(_0x37fa0a){return _0x37fa0a[_0x33d1('0x27')]()[_0x33d1('0x26')](function(){_0x5dce45['status'](0xcc)[_0x33d1('0x28')]();});}};}function handleEntityNotFound(_0x103070,_0x189ed8){return function(_0x2b8628){if(!_0x2b8628){_0x103070[_0x33d1('0x1b')](0x194);}return _0x2b8628;};}function handleError(_0x22c6c4,_0x406ce8){_0x406ce8=_0x406ce8||0x1f4;return function(_0x4806a6){logger[_0x33d1('0x29')](_0x4806a6['stack']);if(_0x4806a6['name']){delete _0x4806a6['name'];}_0x22c6c4[_0x33d1('0x1c')](_0x406ce8)['send'](_0x4806a6);};}exports[_0x33d1('0x2a')]=function(_0x80a3d4,_0x3569f4){var _0x1b34b7={},_0x36283d={},_0x2b6d00={'count':0x0,'rows':[]};var _0x33db69=_[_0x33d1('0x2b')](db['Automation'][_0x33d1('0x2c')],function(_0x3fc40d){return{'name':_0x3fc40d[_0x33d1('0x2d')],'type':_0x3fc40d['type'][_0x33d1('0x2e')]};});_0x36283d[_0x33d1('0x2f')]=_['map'](_0x33db69,_0x33d1('0x30'));_0x36283d[_0x33d1('0x31')]=_[_0x33d1('0x32')](_0x80a3d4[_0x33d1('0x31')]);_0x36283d['filters']=_[_0x33d1('0x33')](_0x36283d[_0x33d1('0x2f')],_0x36283d['query']);_0x1b34b7[_0x33d1('0x34')]=_[_0x33d1('0x33')](_0x36283d['model'],qs[_0x33d1('0x35')](_0x80a3d4[_0x33d1('0x31')][_0x33d1('0x35')]));_0x1b34b7[_0x33d1('0x34')]=_0x1b34b7[_0x33d1('0x34')][_0x33d1('0x36')]?_0x1b34b7[_0x33d1('0x34')]:_0x36283d['model'];if(!_0x80a3d4['query'][_0x33d1('0x37')](_0x33d1('0x38'))){_0x1b34b7[_0x33d1('0x1f')]=qs['limit'](_0x80a3d4[_0x33d1('0x31')]['limit']);_0x1b34b7[_0x33d1('0x1d')]=qs[_0x33d1('0x1d')](_0x80a3d4['query']['offset']);}_0x1b34b7[_0x33d1('0x39')]=qs[_0x33d1('0x3a')](_0x80a3d4['query']['sort']);_0x1b34b7[_0x33d1('0x3b')]=qs[_0x33d1('0x3c')](_[_0x33d1('0x3d')](_0x80a3d4[_0x33d1('0x31')],_0x36283d['filters']),_0x33db69);if(_0x80a3d4[_0x33d1('0x31')]['filter']){_0x1b34b7[_0x33d1('0x3b')]=_[_0x33d1('0x3e')](_0x1b34b7[_0x33d1('0x3b')],{'$or':_[_0x33d1('0x2b')](_0x33db69,function(_0x5adef8){if(_0x5adef8['type']!==_0x33d1('0x3f')){var _0x46e09d={};_0x46e09d[_0x5adef8[_0x33d1('0x30')]]={'$like':'%'+_0x80a3d4[_0x33d1('0x31')][_0x33d1('0x40')]+'%'};return _0x46e09d;}})});}_0x1b34b7=_['merge']({},_0x1b34b7,_0x80a3d4[_0x33d1('0x41')]);var _0x1e5e46={'where':_0x1b34b7[_0x33d1('0x3b')]};return db[_0x33d1('0x42')][_0x33d1('0x20')](_0x1e5e46)[_0x33d1('0x26')](function(_0x575a4b){_0x2b6d00['count']=_0x575a4b;if(_0x80a3d4[_0x33d1('0x31')][_0x33d1('0x43')]){_0x1b34b7[_0x33d1('0x44')]=[{'all':!![]}];}return db['Automation'][_0x33d1('0x45')](_0x1b34b7);})['then'](function(_0x5a57ab){_0x2b6d00['rows']=_0x5a57ab;return _0x2b6d00;})[_0x33d1('0x26')](respondWithFilteredResult(_0x3569f4,_0x1b34b7))[_0x33d1('0x46')](handleError(_0x3569f4,null));};exports[_0x33d1('0x47')]=function(_0x4e7eff,_0x47d818){var _0x51486c={'raw':![],'where':{'id':_0x4e7eff[_0x33d1('0x48')]['id']}},_0xdcfc56={};_0xdcfc56['model']=_['keys'](db[_0x33d1('0x42')][_0x33d1('0x2c')]);_0xdcfc56['query']=_['keys'](_0x4e7eff[_0x33d1('0x31')]);_0xdcfc56[_0x33d1('0x3c')]=_['intersection'](_0xdcfc56[_0x33d1('0x2f')],_0xdcfc56[_0x33d1('0x31')]);_0x51486c[_0x33d1('0x34')]=_[_0x33d1('0x33')](_0xdcfc56['model'],qs[_0x33d1('0x35')](_0x4e7eff[_0x33d1('0x31')][_0x33d1('0x35')]));_0x51486c['attributes']=_0x51486c[_0x33d1('0x34')]['length']?_0x51486c['attributes']:_0xdcfc56[_0x33d1('0x2f')];if(_0x4e7eff[_0x33d1('0x31')][_0x33d1('0x43')]){_0x51486c[_0x33d1('0x44')]=[{'all':!![]}];}_0x51486c=_[_0x33d1('0x3e')]({},_0x51486c,_0x4e7eff['options']);return db[_0x33d1('0x42')]['find'](_0x51486c)['then'](handleEntityNotFound(_0x47d818,null))[_0x33d1('0x26')](respondWithResult(_0x47d818,null))[_0x33d1('0x46')](handleError(_0x47d818,null));};exports['create']=function(_0x555179,_0x7e0e89){return db[_0x33d1('0x42')]['create'](_0x555179[_0x33d1('0x49')],{})[_0x33d1('0x26')](respondWithResult(_0x7e0e89,0xc9))[_0x33d1('0x46')](handleError(_0x7e0e89,null));};exports[_0x33d1('0x25')]=function(_0x14b7cb,_0x2e60e7){if(_0x14b7cb['body']['id']){delete _0x14b7cb[_0x33d1('0x49')]['id'];}return db['Automation'][_0x33d1('0x4a')]({'where':{'id':_0x14b7cb[_0x33d1('0x48')]['id']}})[_0x33d1('0x26')](handleEntityNotFound(_0x2e60e7,null))[_0x33d1('0x26')](saveUpdates(_0x14b7cb[_0x33d1('0x49')],null))[_0x33d1('0x26')](respondWithResult(_0x2e60e7,null))[_0x33d1('0x46')](handleError(_0x2e60e7,null));};exports[_0x33d1('0x27')]=function(_0x2fd509,_0x2cb815){return db[_0x33d1('0x42')][_0x33d1('0x4a')]({'where':{'id':_0x2fd509[_0x33d1('0x48')]['id']}})[_0x33d1('0x26')](handleEntityNotFound(_0x2cb815,null))['then'](removeEntity(_0x2cb815,null))[_0x33d1('0x46')](handleError(_0x2cb815,null));};exports[_0x33d1('0x4b')]=function(_0x393512,_0x4307c9,_0x5cc5d9){return db[_0x33d1('0x4c')][_0x33d1('0x4a')]({'where':{'id':_0x393512['params']['id']}})['then'](handleEntityNotFound(_0x4307c9,null))[_0x33d1('0x26')](function(_0x4ba0c0){if(_0x4ba0c0){return _0x4ba0c0[_0x33d1('0x4b')](_0x393512[_0x33d1('0x49')]['ids'],_[_0x33d1('0x4d')](_0x393512[_0x33d1('0x49')],[_0x33d1('0x4e'),'id'])||{});}})[_0x33d1('0x26')](respondWithResult(_0x4307c9,null))[_0x33d1('0x46')](handleError(_0x4307c9,null));};exports[_0x33d1('0x4f')]=function(_0x25fe2a,_0x6f2afd,_0x181fd9){var _0x57ae3e={};var _0x8dc79c={};var _0x58c39c;var _0x4082bb;return db['Automation'][_0x33d1('0x50')]({'where':{'id':_0x25fe2a['params']['id']}})[_0x33d1('0x26')](handleEntityNotFound(_0x6f2afd,null))[_0x33d1('0x26')](function(_0x3ede7c){if(_0x3ede7c){_0x58c39c=_0x3ede7c;_0x8dc79c['model']=_[_0x33d1('0x32')](db['Condition']['rawAttributes']);_0x8dc79c[_0x33d1('0x31')]=_[_0x33d1('0x32')](_0x25fe2a['query']);_0x8dc79c[_0x33d1('0x3c')]=_[_0x33d1('0x33')](_0x8dc79c['model'],_0x8dc79c[_0x33d1('0x31')]);_0x57ae3e[_0x33d1('0x34')]=_['intersection'](_0x8dc79c[_0x33d1('0x2f')],qs[_0x33d1('0x35')](_0x25fe2a[_0x33d1('0x31')][_0x33d1('0x35')]));_0x57ae3e[_0x33d1('0x34')]=_0x57ae3e[_0x33d1('0x34')][_0x33d1('0x36')]?_0x57ae3e[_0x33d1('0x34')]:_0x8dc79c['model'];_0x57ae3e[_0x33d1('0x39')]=qs[_0x33d1('0x3a')](_0x25fe2a['query']['sort']);_0x57ae3e[_0x33d1('0x3b')]=qs[_0x33d1('0x3c')](_['pick'](_0x25fe2a[_0x33d1('0x31')],_0x8dc79c['filters']));if(_0x25fe2a[_0x33d1('0x31')][_0x33d1('0x40')]){_0x57ae3e[_0x33d1('0x3b')]=_[_0x33d1('0x3e')](_0x57ae3e[_0x33d1('0x3b')],{'$or':_[_0x33d1('0x2b')](_0x57ae3e['attributes'],function(_0x490760){var _0x5533a4={};_0x5533a4[_0x490760]={'$like':'%'+_0x25fe2a[_0x33d1('0x31')][_0x33d1('0x40')]+'%'};return _0x5533a4;})});}_0x57ae3e=_[_0x33d1('0x3e')]({},_0x57ae3e,_0x25fe2a['options']);return _0x58c39c[_0x33d1('0x4f')](_0x57ae3e);}})[_0x33d1('0x26')](function(_0xf63f47){if(_0xf63f47){_0x4082bb=_0xf63f47['length'];if(!_0x25fe2a[_0x33d1('0x31')][_0x33d1('0x37')](_0x33d1('0x38'))){_0x57ae3e['limit']=qs[_0x33d1('0x1f')](_0x25fe2a['query'][_0x33d1('0x1f')]);_0x57ae3e['offset']=qs[_0x33d1('0x1d')](_0x25fe2a[_0x33d1('0x31')][_0x33d1('0x1d')]);}return _0x58c39c[_0x33d1('0x4f')](_0x57ae3e);}})['then'](function(_0x164fda){if(_0x164fda){return _0x164fda?{'count':_0x4082bb,'rows':_0x164fda}:null;}})[_0x33d1('0x26')](respondWithResult(_0x6f2afd,null))[_0x33d1('0x46')](handleError(_0x6f2afd,null));};exports[_0x33d1('0x51')]=function(_0x3daa23,_0x27eb15,_0x3b6ce2){return db['Action'][_0x33d1('0x4a')]({'where':{'id':_0x3daa23[_0x33d1('0x48')]['id']}})[_0x33d1('0x26')](handleEntityNotFound(_0x27eb15,null))['then'](function(_0x33bf24){if(_0x33bf24){return _0x33bf24[_0x33d1('0x51')](_0x3daa23[_0x33d1('0x49')][_0x33d1('0x4e')],_[_0x33d1('0x4d')](_0x3daa23[_0x33d1('0x49')],[_0x33d1('0x4e'),'id'])||{});}})[_0x33d1('0x26')](respondWithResult(_0x27eb15,null))[_0x33d1('0x46')](handleError(_0x27eb15,null));};exports['getActions']=function(_0x5e9889,_0x3980dd,_0x48501a){var _0x1fae2c={};var _0x16e342={};var _0x3c9e08;var _0x594652;return db[_0x33d1('0x42')]['findOne']({'where':{'id':_0x5e9889['params']['id']}})[_0x33d1('0x26')](handleEntityNotFound(_0x3980dd,null))[_0x33d1('0x26')](function(_0x4ec5ca){if(_0x4ec5ca){_0x3c9e08=_0x4ec5ca;_0x16e342['model']=_['keys'](db[_0x33d1('0x52')]['rawAttributes']);_0x16e342[_0x33d1('0x31')]=_[_0x33d1('0x32')](_0x5e9889[_0x33d1('0x31')]);_0x16e342[_0x33d1('0x3c')]=_['intersection'](_0x16e342['model'],_0x16e342[_0x33d1('0x31')]);_0x1fae2c[_0x33d1('0x34')]=_['intersection'](_0x16e342[_0x33d1('0x2f')],qs['fields'](_0x5e9889['query'][_0x33d1('0x35')]));_0x1fae2c[_0x33d1('0x34')]=_0x1fae2c[_0x33d1('0x34')][_0x33d1('0x36')]?_0x1fae2c[_0x33d1('0x34')]:_0x16e342[_0x33d1('0x2f')];_0x1fae2c[_0x33d1('0x39')]=qs[_0x33d1('0x3a')](_0x5e9889['query']['sort']);_0x1fae2c[_0x33d1('0x3b')]=qs[_0x33d1('0x3c')](_[_0x33d1('0x3d')](_0x5e9889[_0x33d1('0x31')],_0x16e342[_0x33d1('0x3c')]));if(_0x5e9889['query'][_0x33d1('0x40')]){_0x1fae2c['where']=_[_0x33d1('0x3e')](_0x1fae2c[_0x33d1('0x3b')],{'$or':_['map'](_0x1fae2c['attributes'],function(_0x51b6d1){var _0xe803fa={};_0xe803fa[_0x51b6d1]={'$like':'%'+_0x5e9889[_0x33d1('0x31')][_0x33d1('0x40')]+'%'};return _0xe803fa;})});}_0x1fae2c=_[_0x33d1('0x3e')]({},_0x1fae2c,_0x5e9889['options']);return _0x3c9e08['getActions'](_0x1fae2c);}})[_0x33d1('0x26')](function(_0x49c0de){if(_0x49c0de){_0x594652=_0x49c0de[_0x33d1('0x36')];if(!_0x5e9889[_0x33d1('0x31')][_0x33d1('0x37')](_0x33d1('0x38'))){_0x1fae2c[_0x33d1('0x1f')]=qs['limit'](_0x5e9889[_0x33d1('0x31')][_0x33d1('0x1f')]);_0x1fae2c['offset']=qs[_0x33d1('0x1d')](_0x5e9889[_0x33d1('0x31')][_0x33d1('0x1d')]);}return _0x3c9e08['getActions'](_0x1fae2c);}})[_0x33d1('0x26')](function(_0x380fe2){if(_0x380fe2){return _0x380fe2?{'count':_0x594652,'rows':_0x380fe2}:null;}})[_0x33d1('0x26')](respondWithResult(_0x3980dd,null))[_0x33d1('0x46')](handleError(_0x3980dd,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 2524e2d..1a73e44 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 _0xe261=['moment','path','rimraf','../../config/environment','./automation.attributes','define','lodash','api'];(function(_0x325bc4,_0x4df462){var _0x330091=function(_0x22db60){while(--_0x22db60){_0x325bc4['push'](_0x325bc4['shift']());}};_0x330091(++_0x4df462);}(_0xe261,0xe6));var _0x1e26=function(_0x5d7b9f,_0x5b504a){_0x5d7b9f=_0x5d7b9f-0x0;var _0x53df66=_0xe261[_0x5d7b9f];return _0x53df66;};'use strict';var _=require(_0x1e26('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1e26('0x1'));var moment=require(_0x1e26('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e26('0x3'));var rimraf=require(_0x1e26('0x4'));var config=require(_0x1e26('0x5'));var attributes=require(_0x1e26('0x6'));module['exports']=function(_0x23af66,_0x4b37b0){return _0x23af66[_0x1e26('0x7')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68d3=['exports','define','tools_automations','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x44846c,_0x5e2655){var _0x33fbfd=function(_0x5e6ba6){while(--_0x5e6ba6){_0x44846c['push'](_0x44846c['shift']());}};_0x33fbfd(++_0x5e2655);}(_0x68d3,0xf3));var _0x368d=function(_0x15132c,_0x57220d){_0x15132c=_0x15132c-0x0;var _0x55cf73=_0x68d3[_0x15132c];return _0x55cf73;};'use strict';var _=require(_0x368d('0x0'));var util=require(_0x368d('0x1'));var logger=require(_0x368d('0x2'))('api');var moment=require(_0x368d('0x3'));var BPromise=require(_0x368d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x368d('0x5'));var rimraf=require(_0x368d('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x368d('0x7')]=function(_0x2ad13e,_0x29828a){return _0x2ad13e[_0x368d('0x8')]('Automation',attributes,{'tableName':_0x368d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 2455ef7..339aa33 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x35b70f,_0x29492d){var _0x4fdd28=function(_0x38e91e){while(--_0x38e91e){_0x35b70f['push'](_0x35b70f['shift']());}};_0x4fdd28(++_0x29492d);}(_0x14a0,0x8e));var _0x014a=function(_0x37c0f8,_0x4fe3ce){_0x37c0f8=_0x37c0f8-0x0;var _0x2bad68=_0x14a0[_0x37c0f8];return _0x2bad68;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Automation,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Automation,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x4201=['debug','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','request\x20sent'];(function(_0x5c50f6,_0xe5d2dd){var _0x4e4f77=function(_0x1410c2){while(--_0x1410c2){_0x5c50f6['push'](_0x5c50f6['shift']());}};_0x4e4f77(++_0xe5d2dd);}(_0x4201,0x71));var _0x1420=function(_0x40710f,_0x3f145e){_0x40710f=_0x40710f-0x0;var _0x591385=_0x4201[_0x40710f];return _0x591385;};'use strict';var _=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var moment=require('moment');var BPromise=require(_0x1420('0x2'));var rs=require(_0x1420('0x3'));var fs=require('fs');var Redis=require(_0x1420('0x4'));var db=require(_0x1420('0x5'))['db'];var utils=require(_0x1420('0x6'));var logger=require(_0x1420('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1420('0x8'));var client=jayson[_0x1420('0x9')][_0x1420('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a8ba,_0x239e16,_0x59ddc5){return new BPromise(function(_0x5a925c,_0x46d303){return client[_0x1420('0xb')](_0x35a8ba,_0x59ddc5)['then'](function(_0x1d52ff){logger['info']('Automation,\x20%s,\x20%s',_0x239e16,_0x1420('0xc'));logger[_0x1420('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x239e16,_0x1420('0xc'),JSON[_0x1420('0xe')](_0x1d52ff));if(_0x1d52ff[_0x1420('0xf')]){if(_0x1d52ff[_0x1420('0xf')][_0x1420('0x10')]===0x1f4){logger[_0x1420('0xf')](_0x1420('0x11'),_0x239e16,_0x1d52ff[_0x1420('0xf')]['message']);return _0x46d303(_0x1d52ff['error']['message']);}logger['error'](_0x1420('0x11'),_0x239e16,_0x1d52ff[_0x1420('0xf')][_0x1420('0x12')]);return _0x5a925c(_0x1d52ff[_0x1420('0xf')][_0x1420('0x12')]);}else{logger[_0x1420('0x13')]('Automation,\x20%s,\x20%s',_0x239e16,'request\x20sent');_0x5a925c(_0x1d52ff[_0x1420('0x14')]['message']);}})['catch'](function(_0x231659){logger[_0x1420('0xf')](_0x1420('0x11'),_0x239e16,_0x231659);_0x46d303(_0x231659);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 1634944..2feb2a3 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 _0x54ef=['/:id','show','/:id/conditions','isAuthenticated','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x54ef,0x112));var _0xf54e=function(_0x5a0622,_0x12b419){_0x5a0622=_0x5a0622-0x0;var _0x448119=_0x54ef[_0x5a0622];return _0x448119;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['get'](_0xf54e('0xe'),auth[_0xf54e('0xf')](),controller['getConditions']);router[_0xf54e('0xb')](_0xf54e('0x10'),auth[_0xf54e('0xf')](),controller[_0xf54e('0x11')]);router['post']('/',auth[_0xf54e('0xf')](),controller[_0xf54e('0x12')]);router[_0xf54e('0x13')](_0xf54e('0xe'),auth['isAuthenticated'](),controller[_0xf54e('0x14')]);router['post']('/:id/actions',auth[_0xf54e('0xf')](),controller[_0xf54e('0x15')]);router[_0xf54e('0x16')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0x17')]);router[_0xf54e('0x18')](_0xf54e('0xc'),auth[_0xf54e('0xf')](),controller['destroy']);module[_0xf54e('0x19')]=router; \ No newline at end of file +var _0x9f60=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','exports','multer','path'];(function(_0x2fdf43,_0xe96583){var _0x266981=function(_0x5f0323){while(--_0x5f0323){_0x2fdf43['push'](_0x2fdf43['shift']());}};_0x266981(++_0xe96583);}(_0x9f60,0x1ae));var _0x09f6=function(_0x4306ab,_0x30c206){_0x4306ab=_0x4306ab-0x0;var _0x45c639=_0x9f60[_0x4306ab];return _0x45c639;};'use strict';var multer=require(_0x09f6('0x0'));var util=require('util');var path=require(_0x09f6('0x1'));var timeout=require(_0x09f6('0x2'));var express=require(_0x09f6('0x3'));var router=express[_0x09f6('0x4')]();var fs_extra=require(_0x09f6('0x5'));var auth=require(_0x09f6('0x6'));var interaction=require(_0x09f6('0x7'));var config=require('../../config/environment');var controller=require(_0x09f6('0x8'));router[_0x09f6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x09f6('0xa'),auth[_0x09f6('0xb')](),controller[_0x09f6('0xc')]);router[_0x09f6('0x9')](_0x09f6('0xd'),auth[_0x09f6('0xb')](),controller[_0x09f6('0xe')]);router[_0x09f6('0x9')]('/:id/actions',auth[_0x09f6('0xb')](),controller[_0x09f6('0xf')]);router[_0x09f6('0x10')]('/',auth['isAuthenticated'](),controller[_0x09f6('0x11')]);router[_0x09f6('0x10')]('/:id/conditions',auth[_0x09f6('0xb')](),controller[_0x09f6('0x12')]);router[_0x09f6('0x10')](_0x09f6('0x13'),auth[_0x09f6('0xb')](),controller[_0x09f6('0x14')]);router[_0x09f6('0x15')](_0x09f6('0xa'),auth[_0x09f6('0xb')](),controller[_0x09f6('0x16')]);router['delete'](_0x09f6('0xa'),auth[_0x09f6('0xb')](),controller['destroy']);module[_0x09f6('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 474e6c8..de9dab5 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 _0x03cb=['#AMD\x20Maximum\x20Word\x20Length','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','name','ENUM','ivr','STRING','BOOLEAN','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x3492c8,_0x5a40aa){var _0xf3e965=function(_0x4f7ee9){while(--_0x4f7ee9){_0x3492c8['push'](_0x3492c8['shift']());}};_0xf3e965(++_0x5a40aa);}(_0x03cb,0x1dc));var _0xb03c=function(_0x359316,_0x57f2bf){_0x359316=_0x359316-0x0;var _0x76842b=_0x03cb[_0x359316];return _0x76842b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb03c('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb03c('0x1')](_0xb03c('0x2')),'allowNull':![],'defaultValue':_0xb03c('0x2')},'description':{'type':Sequelize[_0xb03c('0x3')]},'active':{'type':Sequelize[_0xb03c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xb03c('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb03c('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'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':_0xb03c('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb03c('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb03c('0xc')},'dialTimezone':{'type':Sequelize[_0xb03c('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb03c('0x3')],'defaultValue':_0xb03c('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xb03c('0x1')](_0xb03c('0xe'),'never',_0xb03c('0xf')),'defaultValue':_0xb03c('0xe')},'dialAMDActive':{'type':Sequelize[_0xb03c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb03c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb03c('0x10')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb03c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb03c('0x11')},'dialAMDMinWordLength':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb03c('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb03c('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb03c('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb03c('0x6')](0x9)[_0xb03c('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb03c('0x14')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb03c('0x1')]('DESC',_0xb03c('0x15')),'defaultValue':_0xb03c('0x16')},'dialPrefix':{'type':Sequelize[_0xb03c('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb03c('0x17')},'dialCutDigit':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb03c('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x1c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb03c('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)[_0xb03c('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb03c('0x1d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb03c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb03c('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb03c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x706c=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\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'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x706c,0xd1));var _0xc706=function(_0x57bb3a,_0x237ede){_0x57bb3a=_0x57bb3a-0x0;var _0x5decaa=_0x706c[_0x57bb3a];return _0x5decaa;};'use strict';var Sequelize=require(_0xc706('0x0'));module[_0xc706('0x1')]={'name':{'type':Sequelize[_0xc706('0x2')],'unique':_0xc706('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc706('0x4')](_0xc706('0x5')),'allowNull':![],'defaultValue':_0xc706('0x5')},'description':{'type':Sequelize[_0xc706('0x2')]},'active':{'type':Sequelize[_0xc706('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xc706('0x7')](0x4)[_0xc706('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc706('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc706('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc706('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc706('0xd')},'dialTimezone':{'type':Sequelize[_0xc706('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc706('0x2')],'defaultValue':_0xc706('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xc706('0x4')](_0xc706('0xf'),_0xc706('0x10'),_0xc706('0x11')),'defaultValue':_0xc706('0xf')},'dialAMDActive':{'type':Sequelize[_0xc706('0x6')],'defaultValue':0x0,'comment':_0xc706('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xc706('0x7')](0x9)[_0xc706('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc706('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xc706('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc706('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc706('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc706('0x7')](0x9)[_0xc706('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc706('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xc706('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc706('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc706('0x7')](0x9)[_0xc706('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc706('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc706('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc706('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc706('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc706('0x7')](0x9)[_0xc706('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc706('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc706('0x4')](_0xc706('0x1c'),_0xc706('0x1d')),'defaultValue':_0xc706('0x1c')},'dialPrefix':{'type':Sequelize[_0xc706('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc706('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc706('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc706('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc706('0x7')](0x3)[_0xc706('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc706('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc706('0x7')](0x5)[_0xc706('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index c377e4d..f4a1f77 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 _0x1e3f=['cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','clone','omit','updatedAt','createdAt','userProfileId','autoAssociation','params','CampaignId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','findOne','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','phone','ContactId','select','field','ListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','scheduledAt','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0x1e3f,0x19a));var _0xf1e3=function(_0x34f7bb,_0x547eb3){_0x34f7bb=_0x34f7bb-0x0;var _0x2efee3=_0x1e3f[_0x34f7bb];return _0x2efee3;};'use strict';var emlformat=require(_0xf1e3('0x0'));var rimraf=require(_0xf1e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1e3('0x2'));var rp=require(_0xf1e3('0x3'));var moment=require(_0xf1e3('0x4'));var BPromise=require(_0xf1e3('0x5'));var Mustache=require(_0xf1e3('0x6'));var util=require(_0xf1e3('0x7'));var path=require(_0xf1e3('0x8'));var sox=require(_0xf1e3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf1e3('0xa'));var _=require(_0xf1e3('0xb'));var squel=require(_0xf1e3('0xc'));var crypto=require(_0xf1e3('0xd'));var jsforce=require(_0xf1e3('0xe'));var deskjs=require(_0xf1e3('0xf'));var toCsv=require(_0xf1e3('0x10'));var querystring=require(_0xf1e3('0x11'));var Papa=require(_0xf1e3('0x12'));var Redis=require(_0xf1e3('0x13'));var authService=require(_0xf1e3('0x14'));var qs=require(_0xf1e3('0x15'));var as=require(_0xf1e3('0x16'));var hardwareService=require(_0xf1e3('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xf1e3('0x18'));var config=require(_0xf1e3('0x19'));var licenseUtil=require(_0xf1e3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43e3c4,_0x550c1e){_0x550c1e=_0x550c1e||0xcc;return function(_0x270248){if(_0x270248){return _0x43e3c4[_0xf1e3('0x1b')](_0x550c1e);}return _0x43e3c4['status'](_0x550c1e)[_0xf1e3('0x1c')]();};}function respondWithResult(_0xcb8517,_0x10c870){_0x10c870=_0x10c870||0xc8;return function(_0x225724){if(_0x225724){return _0xcb8517[_0xf1e3('0x1d')](_0x10c870)['json'](_0x225724);}};}function respondWithFilteredResult(_0x50327d,_0x5763c1){return function(_0x455829){if(_0x455829){var _0x3655a3=typeof _0x5763c1[_0xf1e3('0x1e')]===_0xf1e3('0x1f')&&typeof _0x5763c1[_0xf1e3('0x20')]===_0xf1e3('0x1f');var _0x39ab27=_0x455829[_0xf1e3('0x21')];var _0x3c8449=_0x3655a3?0x0:_0x5763c1['offset'];var _0x3fb6bb=_0x3655a3?_0x455829[_0xf1e3('0x21')]:_0x5763c1['offset']+_0x5763c1[_0xf1e3('0x20')];var _0xe00a72;if(_0x3fb6bb>=_0x39ab27){_0x3fb6bb=_0x39ab27;_0xe00a72=0xc8;}else{_0xe00a72=0xce;}_0x50327d[_0xf1e3('0x1d')](_0xe00a72);return _0x50327d[_0xf1e3('0x22')]('Content-Range',_0x3c8449+'-'+_0x3fb6bb+'/'+_0x39ab27)[_0xf1e3('0x23')](_0x455829);}return null;};}function patchUpdates(_0x1a4412){return function(_0x23f799){try{jsonpatch[_0xf1e3('0x24')](_0x23f799,_0x1a4412,!![]);}catch(_0x23f42c){return BPromise[_0xf1e3('0x25')](_0x23f42c);}return _0x23f799[_0xf1e3('0x26')]();};}function saveUpdates(_0x908c18,_0x5f4545){return function(_0x19d911){if(_0x19d911){return _0x19d911[_0xf1e3('0x27')](_0x908c18)[_0xf1e3('0x28')](function(_0x2ae940){return _0x2ae940;});}return null;};}function removeEntity(_0x460e47,_0x4affc4){return function(_0x4527e6){if(_0x4527e6){return _0x4527e6[_0xf1e3('0x29')]()[_0xf1e3('0x28')](function(){var _0x1b5a0e=_0x4527e6['get']({'plain':!![]});var _0x331c74='IvrCampaigns';return db[_0xf1e3('0x2a')][_0xf1e3('0x29')]({'where':{'type':_0x331c74,'resourceId':_0x1b5a0e['id']}})[_0xf1e3('0x28')](function(){return _0x4527e6;});})['then'](function(){_0x460e47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf7202a,_0x4ae63e){return function(_0x3f6255){if(!_0x3f6255){_0xf7202a[_0xf1e3('0x1b')](0x194);}return _0x3f6255;};}function handleError(_0x579a70,_0x19fb08){_0x19fb08=_0x19fb08||0x1f4;return function(_0x7ca0a3){logger[_0xf1e3('0x2b')](_0x7ca0a3[_0xf1e3('0x2c')]);if(_0x7ca0a3[_0xf1e3('0x2d')]){delete _0x7ca0a3[_0xf1e3('0x2d')];}_0x579a70[_0xf1e3('0x1d')](_0x19fb08)[_0xf1e3('0x2e')](_0x7ca0a3);};}exports[_0xf1e3('0x2f')]=function(_0x2bfeef,_0x2c9eb6){var _0x3314e7={},_0x2b91e8={},_0x49fa47={'count':0x0,'rows':[]};var _0x266a1c=_[_0xf1e3('0x30')](db[_0xf1e3('0x31')][_0xf1e3('0x32')],function(_0x50cc08){return{'name':_0x50cc08[_0xf1e3('0x33')],'type':_0x50cc08['type'][_0xf1e3('0x34')]};});_0x2b91e8[_0xf1e3('0x35')]=_[_0xf1e3('0x30')](_0x266a1c,_0xf1e3('0x2d'));_0x2b91e8[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0x2bfeef[_0xf1e3('0x36')]);_0x2b91e8[_0xf1e3('0x38')]=_['intersection'](_0x2b91e8[_0xf1e3('0x35')],_0x2b91e8[_0xf1e3('0x36')]);_0x3314e7[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x2b91e8[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x3314e7['attributes']=_0x3314e7[_0xf1e3('0x39')]['length']?_0x3314e7[_0xf1e3('0x39')]:_0x2b91e8[_0xf1e3('0x35')];if(!_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x3314e7[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x2bfeef[_0xf1e3('0x36')]['limit']);_0x3314e7['offset']=qs['offset'](_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x1e')]);}_0x3314e7[_0xf1e3('0x3e')]=qs[_0xf1e3('0x3f')](_0x2bfeef[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x3314e7[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x2bfeef['query'],_0x2b91e8[_0xf1e3('0x38')]),_0x266a1c);if(_0x2bfeef['query'][_0xf1e3('0x42')]){_0x3314e7[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x3314e7[_0xf1e3('0x40')],{'$or':_[_0xf1e3('0x30')](_0x266a1c,function(_0x3b0674){if(_0x3b0674[_0xf1e3('0x44')]!==_0xf1e3('0x45')){var _0x57f718={};_0x57f718[_0x3b0674[_0xf1e3('0x2d')]]={'$like':'%'+_0x2bfeef[_0xf1e3('0x36')]['filter']+'%'};return _0x57f718;}})});}_0x3314e7=_[_0xf1e3('0x43')]({},_0x3314e7,_0x2bfeef[_0xf1e3('0x46')]);var _0x4aab43={'where':_0x3314e7['where']};return db['Campaign']['count'](_0x4aab43)['then'](function(_0x4b3cf1){_0x49fa47[_0xf1e3('0x21')]=_0x4b3cf1;if(_0x2bfeef['query'][_0xf1e3('0x47')]){_0x3314e7['include']=[{'all':!![]}];}return db[_0xf1e3('0x31')][_0xf1e3('0x48')](_0x3314e7);})['then'](function(_0xd13ce6){_0x49fa47[_0xf1e3('0x49')]=_0xd13ce6;return _0x49fa47;})[_0xf1e3('0x28')](respondWithFilteredResult(_0x2c9eb6,_0x3314e7))[_0xf1e3('0x4a')](handleError(_0x2c9eb6,null));};exports[_0xf1e3('0x4b')]=function(_0x57f31c,_0x5997f7){var _0x422dad={'raw':![],'where':{'id':_0x57f31c['params']['id']}},_0x3aa071={};_0x3aa071[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x31')][_0xf1e3('0x32')]);_0x3aa071['query']=_[_0xf1e3('0x37')](_0x57f31c[_0xf1e3('0x36')]);_0x3aa071[_0xf1e3('0x38')]=_[_0xf1e3('0x3a')](_0x3aa071[_0xf1e3('0x35')],_0x3aa071[_0xf1e3('0x36')]);_0x422dad[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x3aa071[_0xf1e3('0x35')],qs['fields'](_0x57f31c[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x422dad['attributes']=_0x422dad[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x422dad[_0xf1e3('0x39')]:_0x3aa071['model'];if(_0x57f31c[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x422dad[_0xf1e3('0x4d')]=[{'all':!![]}];}_0x422dad=_[_0xf1e3('0x43')]({},_0x422dad,_0x57f31c[_0xf1e3('0x46')]);return db['Campaign'][_0xf1e3('0x4e')](_0x422dad)[_0xf1e3('0x28')](handleEntityNotFound(_0x5997f7,null))[_0xf1e3('0x28')](respondWithResult(_0x5997f7,null))['catch'](handleError(_0x5997f7,null));};exports['create']=function(_0x5f0c9d,_0x6c426a){return db[_0xf1e3('0x31')][_0xf1e3('0x4f')](_0x5f0c9d[_0xf1e3('0x50')],{})[_0xf1e3('0x28')](function(_0x452034){var _0x1abfed=_0x5f0c9d['user'][_0xf1e3('0x51')]({'plain':!![]});if(!_0x1abfed)throw new Error(_0xf1e3('0x52'));if(_0x1abfed[_0xf1e3('0x53')]===_0xf1e3('0x54')){var _0x336f86=_0x452034[_0xf1e3('0x51')]({'plain':!![]});var _0x41a687=_0xf1e3('0x55');return db['UserProfileSection'][_0xf1e3('0x4e')]({'where':{'name':_0x41a687,'userProfileId':_0x1abfed['userProfileId']},'raw':!![]})['then'](function(_0x2b8854){if(_0x2b8854&&_0x2b8854['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x336f86[_0xf1e3('0x2d')],'resourceId':_0x336f86['id'],'type':_0x2b8854['name'],'sectionId':_0x2b8854['id']},{})['then'](function(){return _0x452034;});}else{return _0x452034;}})[_0xf1e3('0x4a')](function(_0x2088b6){logger[_0xf1e3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2088b6);throw _0x2088b6;});}return _0x452034;})[_0xf1e3('0x28')](respondWithResult(_0x6c426a,0xc9))[_0xf1e3('0x4a')](handleError(_0x6c426a,null));};exports[_0xf1e3('0x56')]=function(_0x3683b4,_0x94bf9c){var _0x2317ec={'where':{'id':_0x3683b4['params']['id']}},_0x5159b4={};_0x5159b4[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x31')][_0xf1e3('0x32')]);_0x2317ec[_0xf1e3('0x39')]=_['intersection'](_0x5159b4[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x3683b4[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x2317ec[_0xf1e3('0x39')]=_0x2317ec[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x2317ec['attributes']:_0x5159b4[_0xf1e3('0x35')];if(_0x3683b4[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x2317ec[_0xf1e3('0x4d')]=[{'all':!![]}];}_0x2317ec=_['merge']({},_0x2317ec,_0x3683b4['options']);return db[_0xf1e3('0x31')][_0xf1e3('0x4e')](_0x2317ec)[_0xf1e3('0x28')](handleEntityNotFound(_0x94bf9c,null))[_0xf1e3('0x28')](function(_0x3b0a0d){if(_0x3b0a0d){var _0x2791cd=_0x3b0a0d[_0xf1e3('0x51')]({'plain':!![]});_0x2791cd=qs[_0xf1e3('0x57')](_0x2791cd,['id','createdAt',_0xf1e3('0x58')]);_0x3683b4[_0xf1e3('0x50')]=_[_0xf1e3('0x57')](_0x3683b4[_0xf1e3('0x50')],['id',_0xf1e3('0x59'),'updatedAt']);return db[_0xf1e3('0x31')]['create'](_[_0xf1e3('0x43')](_0x2791cd,_0x3683b4[_0xf1e3('0x50')]),{'include':_0x3683b4[_0xf1e3('0x36')][_0xf1e3('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x235241){var _0x51e7cb=_0x3683b4[_0xf1e3('0x54')]['get']({'plain':!![]});if(!_0x51e7cb)throw new Error(_0xf1e3('0x52'));if(_0x51e7cb[_0xf1e3('0x53')]===_0xf1e3('0x54')){var _0x4bcbe0=_0x235241[_0xf1e3('0x51')]({'plain':!![]});var _0x53f97b='IvrCampaigns';return db['UserProfileSection'][_0xf1e3('0x4e')]({'where':{'name':_0x53f97b,'userProfileId':_0x51e7cb[_0xf1e3('0x5a')]},'raw':!![]})[_0xf1e3('0x28')](function(_0x4053e2){if(_0x4053e2&&_0x4053e2[_0xf1e3('0x5b')]===0x0){return db[_0xf1e3('0x2a')][_0xf1e3('0x4f')]({'name':_0x4bcbe0[_0xf1e3('0x2d')],'resourceId':_0x4bcbe0['id'],'type':_0x4053e2[_0xf1e3('0x2d')],'sectionId':_0x4053e2['id']},{})['then'](function(){return _0x235241;});}else{return _0x235241;}})[_0xf1e3('0x4a')](function(_0x18e34b){logger[_0xf1e3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18e34b);throw _0x18e34b;});}return _0x235241;});}})[_0xf1e3('0x28')](respondWithResult(_0x94bf9c,0xc9))['catch'](handleError(_0x94bf9c,null));};exports[_0xf1e3('0x27')]=function(_0x10de9c,_0x445a54){if(_0x10de9c[_0xf1e3('0x50')]['id']){delete _0x10de9c['body']['id'];}return db[_0xf1e3('0x31')]['find']({'where':{'id':_0x10de9c[_0xf1e3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x445a54,null))[_0xf1e3('0x28')](saveUpdates(_0x10de9c[_0xf1e3('0x50')],null))[_0xf1e3('0x28')](respondWithResult(_0x445a54,null))[_0xf1e3('0x4a')](handleError(_0x445a54,null));};exports[_0xf1e3('0x29')]=function(_0x36d983,_0x3d5d4a){return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x36d983['params']['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x3d5d4a,null))[_0xf1e3('0x28')](removeEntity(_0x3d5d4a,null))['catch'](handleError(_0x3d5d4a,null));};exports['getHoppers']=function(_0x103f28,_0x268fa0,_0x1af105){var _0x2a457d={'raw':!![],'where':{}};var _0x1e0c65={};var _0x2fb15d={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')]['findOne']({'where':{'id':_0x103f28[_0xf1e3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x268fa0,null))[_0xf1e3('0x28')](function(_0x410fc6){if(_0x410fc6){_0x1e0c65['model']=_[_0xf1e3('0x37')](db['CmHopper']['rawAttributes']);_0x1e0c65[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0x103f28[_0xf1e3('0x36')]);_0x1e0c65[_0xf1e3('0x38')]=_[_0xf1e3('0x3a')](_0x1e0c65['model'],_0x1e0c65['query']);_0x2a457d['attributes']=_[_0xf1e3('0x3a')](_0x1e0c65[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x103f28[_0xf1e3('0x36')]['fields']));_0x2a457d[_0xf1e3('0x39')]=_0x2a457d['attributes'][_0xf1e3('0x4c')]?_0x2a457d['attributes']:_0x1e0c65[_0xf1e3('0x35')];if(!_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x3c')]('nolimit')){_0x2a457d[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x103f28[_0xf1e3('0x36')]['limit']);_0x2a457d[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x1e')]);}_0x2a457d[_0xf1e3('0x3e')]=qs['sort'](_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x2a457d['where']=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x103f28['query'],_0x1e0c65[_0xf1e3('0x38')]));_0x2a457d[_0xf1e3('0x40')][_0xf1e3('0x5d')]=_0x410fc6['id'];if(_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x2a457d['where']=_['merge'](_0x2a457d['where'],{'$or':_[_0xf1e3('0x30')](_0x2a457d['attributes'],function(_0x1f57b7){var _0x442c78={};_0x442c78[_0x1f57b7]={'$like':'%'+_0x103f28['query'][_0xf1e3('0x42')]+'%'};return _0x442c78;})});}_0x2a457d=_[_0xf1e3('0x43')]({},_0x2a457d,_0x103f28[_0xf1e3('0x46')]);return db[_0xf1e3('0x5e')][_0xf1e3('0x21')]({'where':_0x2a457d['where']})[_0xf1e3('0x28')](function(_0x5b1a70){_0x2fb15d[_0xf1e3('0x21')]=_0x5b1a70;if(_0x103f28[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x2a457d[_0xf1e3('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0xf1e3('0x48')](_0x2a457d);})['then'](function(_0x252751){_0x2fb15d['rows']=_0x252751;return _0x2fb15d;});}})['then'](respondWithFilteredResult(_0x268fa0,_0x2a457d))[_0xf1e3('0x4a')](handleError(_0x268fa0,null));};exports['getHopperHistories']=function(_0x1b5434,_0x2c0ecf,_0x4f729a){var _0x4fca8b={'raw':!![],'where':{}};var _0x3d3d9f={};var _0xd8ddbb={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')]['findOne']({'where':{'id':_0x1b5434[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x2c0ecf,null))['then'](function(_0x1fd997){if(_0x1fd997){_0x3d3d9f[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db['CmHopperHistory'][_0xf1e3('0x32')]);_0x3d3d9f[_0xf1e3('0x36')]=_['keys'](_0x1b5434[_0xf1e3('0x36')]);_0x3d3d9f[_0xf1e3('0x38')]=_[_0xf1e3('0x3a')](_0x3d3d9f[_0xf1e3('0x35')],_0x3d3d9f[_0xf1e3('0x36')]);_0x4fca8b['attributes']=_[_0xf1e3('0x3a')](_0x3d3d9f[_0xf1e3('0x35')],qs['fields'](_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x4fca8b[_0xf1e3('0x39')]=_0x4fca8b[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x4fca8b[_0xf1e3('0x39')]:_0x3d3d9f['model'];if(!_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x3c')]('nolimit')){_0x4fca8b[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x1b5434[_0xf1e3('0x36')]['limit']);_0x4fca8b[_0xf1e3('0x1e')]=qs['offset'](_0x1b5434['query'][_0xf1e3('0x1e')]);}_0x4fca8b[_0xf1e3('0x3e')]=qs[_0xf1e3('0x3f')](_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x4fca8b[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_['pick'](_0x1b5434['query'],_0x3d3d9f['filters']));_0x4fca8b[_0xf1e3('0x40')][_0xf1e3('0x5d')]=_0x1fd997['id'];if(_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x4fca8b[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x4fca8b['where'],{'$or':_[_0xf1e3('0x30')](_0x4fca8b[_0xf1e3('0x39')],function(_0x5e8d12){var _0x2a646b={};_0x2a646b[_0x5e8d12]={'$like':'%'+_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x42')]+'%'};return _0x2a646b;})});}_0x4fca8b=_[_0xf1e3('0x43')]({},_0x4fca8b,_0x1b5434['options']);return db[_0xf1e3('0x5f')][_0xf1e3('0x21')]({'where':_0x4fca8b[_0xf1e3('0x40')]})[_0xf1e3('0x28')](function(_0x5a24c5){_0xd8ddbb[_0xf1e3('0x21')]=_0x5a24c5;if(_0x1b5434[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x4fca8b[_0xf1e3('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x4fca8b);})[_0xf1e3('0x28')](function(_0x37a285){_0xd8ddbb[_0xf1e3('0x49')]=_0x37a285;return _0xd8ddbb;});}})[_0xf1e3('0x28')](respondWithFilteredResult(_0x2c0ecf,_0x4fca8b))[_0xf1e3('0x4a')](handleError(_0x2c0ecf,null));};exports[_0xf1e3('0x60')]=function(_0x284999,_0x5d1c96,_0x3c8aa1){var _0x16e75f={'raw':!![],'where':{}};var _0x13f9b3={};var _0x49126f={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')]['findOne']({'where':{'id':_0x284999[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x5d1c96,null))['then'](function(_0x1d804a){if(_0x1d804a){_0x13f9b3[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x61')][_0xf1e3('0x32')]);_0x13f9b3['query']=_[_0xf1e3('0x37')](_0x284999['query']);_0x13f9b3['filters']=_[_0xf1e3('0x3a')](_0x13f9b3[_0xf1e3('0x35')],_0x13f9b3[_0xf1e3('0x36')]);_0x16e75f[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x13f9b3[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x284999[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x16e75f[_0xf1e3('0x39')]=_0x16e75f[_0xf1e3('0x39')]['length']?_0x16e75f['attributes']:_0x13f9b3['model'];if(!_0x284999[_0xf1e3('0x36')][_0xf1e3('0x3c')]('nolimit')){_0x16e75f[_0xf1e3('0x20')]=qs['limit'](_0x284999[_0xf1e3('0x36')][_0xf1e3('0x20')]);_0x16e75f[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0x284999[_0xf1e3('0x36')][_0xf1e3('0x1e')]);}_0x16e75f['order']=qs[_0xf1e3('0x3f')](_0x284999[_0xf1e3('0x36')]['sort']);_0x16e75f['where']=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x284999[_0xf1e3('0x36')],_0x13f9b3[_0xf1e3('0x38')]));_0x16e75f['where'][_0xf1e3('0x5d')]=_0x1d804a['id'];if(_0x284999[_0xf1e3('0x36')]['filter']){_0x16e75f[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x16e75f['where'],{'$or':_[_0xf1e3('0x30')](_0x16e75f[_0xf1e3('0x39')],function(_0x569ce5){var _0x3d5d87={};_0x3d5d87[_0x569ce5]={'$like':'%'+_0x284999[_0xf1e3('0x36')]['filter']+'%'};return _0x3d5d87;})});}_0x16e75f=_['merge']({},_0x16e75f,_0x284999[_0xf1e3('0x46')]);return db['CmHopperFinal'][_0xf1e3('0x21')]({'where':_0x16e75f[_0xf1e3('0x40')]})[_0xf1e3('0x28')](function(_0x5e5a7a){_0x49126f[_0xf1e3('0x21')]=_0x5e5a7a;if(_0x284999['query'][_0xf1e3('0x47')]){_0x16e75f[_0xf1e3('0x4d')]=[{'all':!![]}];}return db[_0xf1e3('0x61')][_0xf1e3('0x48')](_0x16e75f);})[_0xf1e3('0x28')](function(_0x3b7aaa){_0x49126f[_0xf1e3('0x49')]=_0x3b7aaa;return _0x49126f;});}})[_0xf1e3('0x28')](respondWithFilteredResult(_0x5d1c96,_0x16e75f))[_0xf1e3('0x4a')](handleError(_0x5d1c96,null));};exports[_0xf1e3('0x62')]=function(_0x2d1023,_0x236df5,_0x7112ca){var _0x13e07f={'raw':!![],'where':{}};var _0x5be996={};var _0x4a01f9={'count':0x0,'rows':[]};return db[_0xf1e3('0x31')][_0xf1e3('0x63')]({'where':{'id':_0x2d1023[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x236df5,null))[_0xf1e3('0x28')](function(_0x19edd6){if(_0x19edd6){_0x5be996[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db['CmHopperBlack']['rawAttributes']);_0x5be996[_0xf1e3('0x36')]=_['keys'](_0x2d1023[_0xf1e3('0x36')]);_0x5be996[_0xf1e3('0x38')]=_['intersection'](_0x5be996['model'],_0x5be996[_0xf1e3('0x36')]);_0x13e07f[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x5be996[_0xf1e3('0x35')],qs['fields'](_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x3b')]));_0x13e07f[_0xf1e3('0x39')]=_0x13e07f[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x13e07f['attributes']:_0x5be996[_0xf1e3('0x35')];if(!_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x13e07f[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x2d1023['query'][_0xf1e3('0x20')]);_0x13e07f[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0x2d1023['query']['offset']);}_0x13e07f[_0xf1e3('0x3e')]=qs[_0xf1e3('0x3f')](_0x2d1023[_0xf1e3('0x36')]['sort']);_0x13e07f[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x2d1023[_0xf1e3('0x36')],_0x5be996[_0xf1e3('0x38')]));_0x13e07f[_0xf1e3('0x40')][_0xf1e3('0x5d')]=_0x19edd6['id'];if(_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x13e07f[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x13e07f[_0xf1e3('0x40')],{'$or':_['map'](_0x13e07f[_0xf1e3('0x39')],function(_0x3c4674){var _0x360900={};_0x360900[_0x3c4674]={'$like':'%'+_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x42')]+'%'};return _0x360900;})});}_0x13e07f=_['merge']({},_0x13e07f,_0x2d1023['options']);return db[_0xf1e3('0x64')][_0xf1e3('0x21')]({'where':_0x13e07f['where']})[_0xf1e3('0x28')](function(_0x11e94e){_0x4a01f9[_0xf1e3('0x21')]=_0x11e94e;if(_0x2d1023[_0xf1e3('0x36')][_0xf1e3('0x47')]){_0x13e07f[_0xf1e3('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf1e3('0x48')](_0x13e07f);})[_0xf1e3('0x28')](function(_0x309fb8){_0x4a01f9[_0xf1e3('0x49')]=_0x309fb8;return _0x4a01f9;});}})[_0xf1e3('0x28')](respondWithFilteredResult(_0x236df5,_0x13e07f))[_0xf1e3('0x4a')](handleError(_0x236df5,null));};exports['getLists']=function(_0xe5eab9,_0x59a29e,_0x1589c3){var _0x536cfb={};var _0x44d67c={};var _0x1e4930;var _0x487aef;return db[_0xf1e3('0x31')][_0xf1e3('0x63')]({'where':{'id':_0xe5eab9[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x59a29e,null))[_0xf1e3('0x28')](function(_0x221d1a){if(_0x221d1a){_0x1e4930=_0x221d1a;_0x44d67c[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x65')][_0xf1e3('0x32')]);_0x44d67c[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0xe5eab9[_0xf1e3('0x36')]);_0x44d67c[_0xf1e3('0x38')]=_['intersection'](_0x44d67c[_0xf1e3('0x35')],_0x44d67c[_0xf1e3('0x36')]);_0x536cfb[_0xf1e3('0x39')]=_['intersection'](_0x44d67c[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0xe5eab9['query'][_0xf1e3('0x3b')]));_0x536cfb[_0xf1e3('0x39')]=_0x536cfb['attributes'][_0xf1e3('0x4c')]?_0x536cfb[_0xf1e3('0x39')]:_0x44d67c[_0xf1e3('0x35')];_0x536cfb['order']=qs[_0xf1e3('0x3f')](_0xe5eab9['query'][_0xf1e3('0x3f')]);_0x536cfb[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0xe5eab9[_0xf1e3('0x36')],_0x44d67c['filters']));if(_0xe5eab9[_0xf1e3('0x36')]['filter']){_0x536cfb[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x536cfb[_0xf1e3('0x40')],{'$or':_[_0xf1e3('0x30')](_0x536cfb[_0xf1e3('0x39')],function(_0x40672a){var _0x4f887a={};_0x4f887a[_0x40672a]={'$like':'%'+_0xe5eab9['query'][_0xf1e3('0x42')]+'%'};return _0x4f887a;})});}_0x536cfb=_[_0xf1e3('0x43')]({},_0x536cfb,_0xe5eab9[_0xf1e3('0x46')]);return _0x1e4930[_0xf1e3('0x66')](_0x536cfb);}})['then'](function(_0x444bbf){if(_0x444bbf){_0x487aef=_0x444bbf[_0xf1e3('0x4c')];if(!_0xe5eab9[_0xf1e3('0x36')][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x536cfb['limit']=qs[_0xf1e3('0x20')](_0xe5eab9[_0xf1e3('0x36')][_0xf1e3('0x20')]);_0x536cfb[_0xf1e3('0x1e')]=qs[_0xf1e3('0x1e')](_0xe5eab9['query'][_0xf1e3('0x1e')]);}return _0x1e4930[_0xf1e3('0x66')](_0x536cfb);}})[_0xf1e3('0x28')](function(_0x195fb5){if(_0x195fb5){return _0x195fb5?{'count':_0x487aef,'rows':_0x195fb5}:null;}})[_0xf1e3('0x28')](respondWithResult(_0x59a29e,null))[_0xf1e3('0x4a')](handleError(_0x59a29e,null));};exports[_0xf1e3('0x67')]=function(_0x206f4b,_0x1976ad,_0x4c5a75){var _0x21c03c,_0x2c77b4;return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x206f4b[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x1976ad,null))['then'](function(_0x2b652d){if(_0x2b652d){_0x2c77b4=_0x2b652d;return _0x2b652d[_0xf1e3('0x67')](_0x206f4b[_0xf1e3('0x50')][_0xf1e3('0x68')],_['omit'](_0x206f4b[_0xf1e3('0x50')],[_0xf1e3('0x68'),'id'])||{});}return null;})[_0xf1e3('0x69')](function(_0xb1ac00){var _0x332864;_0x21c03c=_0xb1ac00||[];var _0x4be2bf=[];if(_0xb1ac00){for(var _0x3394bc=0x0;_0x3394bc<_0xb1ac00[_0xf1e3('0x4c')];_0x3394bc+=0x1){var _0x24761c=_0xb1ac00[_0x3394bc][_0xf1e3('0x51')]({'plain':!![]});_0x2c77b4[_0xf1e3('0x6a')]=_0x206f4b[_0xf1e3('0x50')][_0xf1e3('0x6a')]?_0x206f4b[_0xf1e3('0x50')][_0xf1e3('0x6a')]:_0x2c77b4[_0xf1e3('0x6a')];switch(_0x2c77b4[_0xf1e3('0x6a')]){case'always':_0x332864=squel[_0xf1e3('0x6b')]()[_0xf1e3('0x6c')]('cm_hopper')['fromQuery']([_0xf1e3('0x6d'),'scheduledAt',_0xf1e3('0x6e'),'ListId','CampaignId',_0xf1e3('0x59'),_0xf1e3('0x58')],squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')](_0xf1e3('0x6d'),'phone')[_0xf1e3('0x70')]('NOW()','scheduledAt')[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))[_0xf1e3('0x70')](_0x24761c['CmListId']['toString'](),_0xf1e3('0x71'))[_0xf1e3('0x70')](_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))['field'](_0xf1e3('0x73'),_0xf1e3('0x59'))['field'](_0xf1e3('0x73'),_0xf1e3('0x58'))[_0xf1e3('0x74')](_0xf1e3('0x75'))[_0xf1e3('0x40')](_0xf1e3('0x76'))[_0xf1e3('0x40')]('ListId\x20=\x20?',_0x24761c[_0xf1e3('0x77')][_0xf1e3('0x72')]())[_0xf1e3('0x40')](_0xf1e3('0x78'))[_0xf1e3('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')](_0xf1e3('0x79'))[_0xf1e3('0x74')]('cm_hopper_final')[_0xf1e3('0x40')](_0xf1e3('0x7a'),_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')]()))[_0xf1e3('0x40')](_0xf1e3('0x7b'),squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')]('COALESCE(phone,\x27\x27)')[_0xf1e3('0x74')](_0xf1e3('0x7c'))[_0xf1e3('0x40')](_0xf1e3('0x7a'),_0x206f4b['params']['id'][_0xf1e3('0x72')]())))[_0xf1e3('0x72')]();break;case'onlyIfOpen':_0x332864=squel[_0xf1e3('0x6b')]()[_0xf1e3('0x6c')]('cm_hopper')[_0xf1e3('0x7d')]([_0xf1e3('0x6d'),_0xf1e3('0x7e'),_0xf1e3('0x6e'),_0xf1e3('0x71'),'CampaignId','createdAt','updatedAt'],squel[_0xf1e3('0x6f')]()['field'](_0xf1e3('0x6d'),_0xf1e3('0x6d'))[_0xf1e3('0x70')](_0xf1e3('0x73'),_0xf1e3('0x7e'))[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))[_0xf1e3('0x70')](_0x24761c['CmListId'][_0xf1e3('0x72')](),_0xf1e3('0x71'))['field'](_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))[_0xf1e3('0x70')](_0xf1e3('0x73'),'createdAt')[_0xf1e3('0x70')](_0xf1e3('0x73'),'updatedAt')['from'](_0xf1e3('0x75'))[_0xf1e3('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0xf1e3('0x7f'),_0x24761c[_0xf1e3('0x77')][_0xf1e3('0x72')]())[_0xf1e3('0x40')](_0xf1e3('0x78'))[_0xf1e3('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')]('COALESCE(phone,\x27\x27)')[_0xf1e3('0x74')](_0xf1e3('0x7c'))[_0xf1e3('0x40')]('CampaignId\x20=\x20?',_0x206f4b[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')]())))[_0xf1e3('0x72')]();break;default:_0x332864=squel[_0xf1e3('0x6b')]()[_0xf1e3('0x6c')](_0xf1e3('0x7c'))[_0xf1e3('0x7d')]([_0xf1e3('0x6d'),_0xf1e3('0x7e'),_0xf1e3('0x6e'),_0xf1e3('0x71'),_0xf1e3('0x5d'),_0xf1e3('0x59'),'updatedAt'],squel[_0xf1e3('0x6f')]()['field']('phone','phone')[_0xf1e3('0x70')](_0xf1e3('0x73'),_0xf1e3('0x7e'))[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))['field'](_0x24761c[_0xf1e3('0x77')][_0xf1e3('0x72')](),_0xf1e3('0x71'))['field'](_0x206f4b['params']['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))[_0xf1e3('0x70')]('NOW()',_0xf1e3('0x59'))[_0xf1e3('0x70')]('NOW()',_0xf1e3('0x58'))['from']('cm_contacts')[_0xf1e3('0x40')](_0xf1e3('0x76'))[_0xf1e3('0x40')](_0xf1e3('0x7f'),_0x24761c[_0xf1e3('0x77')]['toString']())[_0xf1e3('0x40')](_0xf1e3('0x78')))['toString']();}_0x4be2bf[_0xf1e3('0x80')](db[_0xf1e3('0x81')][_0xf1e3('0x36')](_0x332864));}return BPromise[_0xf1e3('0x82')](_0x4be2bf);}})[_0xf1e3('0x28')](function(){return _0x21c03c;})[_0xf1e3('0x28')](respondWithResult(_0x1976ad,null))[_0xf1e3('0x4a')](handleError(_0x1976ad,null));};exports[_0xf1e3('0x83')]=function(_0x51d362,_0x357243,_0x7a942e){return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x51d362[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x357243,null))[_0xf1e3('0x28')](function(_0x7282d3){if(_0x7282d3){return _0x7282d3[_0xf1e3('0x83')](_0x51d362[_0xf1e3('0x36')][_0xf1e3('0x68')]);}})[_0xf1e3('0x28')](function(_0x14fac9){if(_0x14fac9){return db[_0xf1e3('0x5e')][_0xf1e3('0x29')]({'where':{'ListId':_0x51d362[_0xf1e3('0x36')][_0xf1e3('0x68')],'CampaignId':_0x51d362[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](function(){return _0x14fac9;});}})[_0xf1e3('0x28')](respondWithStatusCode(_0x357243,null))['catch'](handleError(_0x357243,null));};exports['getBlackLists']=function(_0x275c09,_0x305bcc,_0x3cd3fe){var _0x31dc9a={};var _0xc3df5a={};var _0x13d3ee;var _0x380a8a;return db[_0xf1e3('0x31')][_0xf1e3('0x63')]({'where':{'id':_0x275c09['params']['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x305bcc,null))[_0xf1e3('0x28')](function(_0x2d4571){if(_0x2d4571){_0x13d3ee=_0x2d4571;_0xc3df5a[_0xf1e3('0x35')]=_[_0xf1e3('0x37')](db[_0xf1e3('0x65')][_0xf1e3('0x32')]);_0xc3df5a[_0xf1e3('0x36')]=_[_0xf1e3('0x37')](_0x275c09[_0xf1e3('0x36')]);_0xc3df5a['filters']=_[_0xf1e3('0x3a')](_0xc3df5a[_0xf1e3('0x35')],_0xc3df5a[_0xf1e3('0x36')]);_0x31dc9a[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0xc3df5a[_0xf1e3('0x35')],qs[_0xf1e3('0x3b')](_0x275c09[_0xf1e3('0x36')]['fields']));_0x31dc9a['attributes']=_0x31dc9a[_0xf1e3('0x39')][_0xf1e3('0x4c')]?_0x31dc9a[_0xf1e3('0x39')]:_0xc3df5a[_0xf1e3('0x35')];_0x31dc9a[_0xf1e3('0x3e')]=qs['sort'](_0x275c09[_0xf1e3('0x36')][_0xf1e3('0x3f')]);_0x31dc9a[_0xf1e3('0x40')]=qs[_0xf1e3('0x38')](_[_0xf1e3('0x41')](_0x275c09[_0xf1e3('0x36')],_0xc3df5a[_0xf1e3('0x38')]));if(_0x275c09[_0xf1e3('0x36')][_0xf1e3('0x42')]){_0x31dc9a[_0xf1e3('0x40')]=_[_0xf1e3('0x43')](_0x31dc9a[_0xf1e3('0x40')],{'$or':_['map'](_0x31dc9a[_0xf1e3('0x39')],function(_0x6a3cce){var _0x52d53b={};_0x52d53b[_0x6a3cce]={'$like':'%'+_0x275c09[_0xf1e3('0x36')][_0xf1e3('0x42')]+'%'};return _0x52d53b;})});}_0x31dc9a=_['merge']({},_0x31dc9a,_0x275c09['options']);return _0x13d3ee[_0xf1e3('0x84')](_0x31dc9a);}})['then'](function(_0x40956b){if(_0x40956b){_0x380a8a=_0x40956b[_0xf1e3('0x4c')];if(!_0x275c09['query'][_0xf1e3('0x3c')](_0xf1e3('0x3d'))){_0x31dc9a[_0xf1e3('0x20')]=qs[_0xf1e3('0x20')](_0x275c09['query'][_0xf1e3('0x20')]);_0x31dc9a['offset']=qs[_0xf1e3('0x1e')](_0x275c09[_0xf1e3('0x36')]['offset']);}return _0x13d3ee[_0xf1e3('0x84')](_0x31dc9a);}})[_0xf1e3('0x28')](function(_0x1dbc2f){if(_0x1dbc2f){return _0x1dbc2f?{'count':_0x380a8a,'rows':_0x1dbc2f}:null;}})['then'](respondWithResult(_0x305bcc,null))[_0xf1e3('0x4a')](handleError(_0x305bcc,null));};exports[_0xf1e3('0x85')]=function(_0x4cc4a1,_0x76bcbf,_0xf3d7a4){var _0x4f733f,_0x31e024;return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x4cc4a1[_0xf1e3('0x5c')]['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x76bcbf,null))[_0xf1e3('0x28')](function(_0x33669c){if(_0x33669c){_0x31e024=_0x33669c;return _0x33669c[_0xf1e3('0x85')](_0x4cc4a1['body'][_0xf1e3('0x68')],_[_0xf1e3('0x57')](_0x4cc4a1[_0xf1e3('0x50')],['ids','id'])||{});}return null;})['spread'](function(_0x3d0781){var _0x4b66dd;_0x4f733f=_0x3d0781||[];var _0x1d604a=[];if(_0x3d0781){for(var _0x3cc0ee=0x0;_0x3cc0ee<_0x3d0781['length'];_0x3cc0ee+=0x1){var _0xc1e4ba=_0x3d0781[_0x3cc0ee][_0xf1e3('0x51')]({'plain':!![]});_0x4b66dd=squel['insert']()[_0xf1e3('0x6c')](_0xf1e3('0x86'))[_0xf1e3('0x7d')](['phone',_0xf1e3('0x6e'),_0xf1e3('0x71'),_0xf1e3('0x5d'),'createdAt','updatedAt'],squel[_0xf1e3('0x6f')]()[_0xf1e3('0x70')](_0xf1e3('0x6d'),_0xf1e3('0x6d'))[_0xf1e3('0x70')]('id',_0xf1e3('0x6e'))['field'](_0xc1e4ba[_0xf1e3('0x77')][_0xf1e3('0x72')](),_0xf1e3('0x71'))[_0xf1e3('0x70')](_0x4cc4a1[_0xf1e3('0x5c')]['id'][_0xf1e3('0x72')](),_0xf1e3('0x5d'))[_0xf1e3('0x70')](_0xf1e3('0x73'),_0xf1e3('0x59'))['field']('NOW()',_0xf1e3('0x58'))[_0xf1e3('0x74')](_0xf1e3('0x75'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xf1e3('0x7f'),_0xc1e4ba[_0xf1e3('0x77')][_0xf1e3('0x72')]())['where'](_0xf1e3('0x78')))[_0xf1e3('0x72')]();_0x1d604a['push'](db[_0xf1e3('0x81')][_0xf1e3('0x36')](_0x4b66dd));}return BPromise[_0xf1e3('0x82')](_0x1d604a);}})[_0xf1e3('0x28')](function(){return _0x4f733f;})[_0xf1e3('0x28')](respondWithResult(_0x76bcbf,null))[_0xf1e3('0x4a')](handleError(_0x76bcbf,null));};exports[_0xf1e3('0x87')]=function(_0x52e523,_0x51c131,_0x1719f1){return db[_0xf1e3('0x31')][_0xf1e3('0x4e')]({'where':{'id':_0x52e523['params']['id']}})[_0xf1e3('0x28')](handleEntityNotFound(_0x51c131,null))['then'](function(_0x42639f){if(_0x42639f){return _0x42639f[_0xf1e3('0x87')](_0x52e523[_0xf1e3('0x36')][_0xf1e3('0x68')]);}})['then'](function(_0x45fd13){if(_0x45fd13){return db['CmHopperBlack'][_0xf1e3('0x29')]({'where':{'ListId':_0x52e523['query'][_0xf1e3('0x68')],'CampaignId':_0x52e523[_0xf1e3('0x5c')]['id']}})['then'](function(){return _0x45fd13;});}})['then'](respondWithStatusCode(_0x51c131,null))['catch'](handleError(_0x51c131,null));}; \ No newline at end of file +var _0x9dae=['model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','UserProfileSection','find','userProfileId','UserProfileResource','clone','createdAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','insert','from','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','all','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','destroy','stack','name','send','index','map','Campaign','rawAttributes','fieldName'];(function(_0x562ec5,_0x36b5a4){var _0x279c8c=function(_0x2de373){while(--_0x2de373){_0x562ec5['push'](_0x562ec5['shift']());}};_0x279c8c(++_0x36b5a4);}(_0x9dae,0xdf));var _0xe9da=function(_0x309e37,_0x409b86){_0x309e37=_0x309e37-0x0;var _0x12f434=_0x9dae[_0x309e37];return _0x12f434;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9da('0x0'));var jsonpatch=require(_0xe9da('0x1'));var rp=require(_0xe9da('0x2'));var moment=require(_0xe9da('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe9da('0x4'));var util=require('util');var path=require(_0xe9da('0x5'));var sox=require(_0xe9da('0x6'));var csv=require(_0xe9da('0x7'));var ejs=require(_0xe9da('0x8'));var fs=require('fs');var fs_extra=require(_0xe9da('0x9'));var _=require(_0xe9da('0xa'));var squel=require('squel');var crypto=require(_0xe9da('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe9da('0xc'));var toCsv=require(_0xe9da('0x7'));var querystring=require(_0xe9da('0xd'));var Papa=require(_0xe9da('0xe'));var Redis=require('ioredis');var authService=require(_0xe9da('0xf'));var qs=require(_0xe9da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9da('0x11'));var logger=require(_0xe9da('0x12'))(_0xe9da('0x13'));var utils=require(_0xe9da('0x14'));var config=require(_0xe9da('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9da('0x16'))['db'];function respondWithStatusCode(_0x175c38,_0x179dfe){_0x179dfe=_0x179dfe||0xcc;return function(_0x2cbc0d){if(_0x2cbc0d){return _0x175c38[_0xe9da('0x17')](_0x179dfe);}return _0x175c38[_0xe9da('0x18')](_0x179dfe)[_0xe9da('0x19')]();};}function respondWithResult(_0x33e375,_0x44df0e){_0x44df0e=_0x44df0e||0xc8;return function(_0x585c6a){if(_0x585c6a){return _0x33e375[_0xe9da('0x18')](_0x44df0e)[_0xe9da('0x1a')](_0x585c6a);}};}function respondWithFilteredResult(_0xa7025b,_0x505b6f){return function(_0x157f1f){if(_0x157f1f){var _0x9b075d=typeof _0x505b6f[_0xe9da('0x1b')]===_0xe9da('0x1c')&&typeof _0x505b6f[_0xe9da('0x1d')]===_0xe9da('0x1c');var _0x1e5bf1=_0x157f1f[_0xe9da('0x1e')];var _0x4d36c8=_0x9b075d?0x0:_0x505b6f[_0xe9da('0x1b')];var _0x53b87a=_0x9b075d?_0x157f1f[_0xe9da('0x1e')]:_0x505b6f[_0xe9da('0x1b')]+_0x505b6f[_0xe9da('0x1d')];var _0x2f1580;if(_0x53b87a>=_0x1e5bf1){_0x53b87a=_0x1e5bf1;_0x2f1580=0xc8;}else{_0x2f1580=0xce;}_0xa7025b['status'](_0x2f1580);return _0xa7025b[_0xe9da('0x1f')](_0xe9da('0x20'),_0x4d36c8+'-'+_0x53b87a+'/'+_0x1e5bf1)['json'](_0x157f1f);}return null;};}function patchUpdates(_0x397a8e){return function(_0x496169){try{jsonpatch[_0xe9da('0x21')](_0x496169,_0x397a8e,!![]);}catch(_0x2d524a){return BPromise[_0xe9da('0x22')](_0x2d524a);}return _0x496169[_0xe9da('0x23')]();};}function saveUpdates(_0x1653db,_0x50d1a8){return function(_0x48436f){if(_0x48436f){return _0x48436f[_0xe9da('0x24')](_0x1653db)[_0xe9da('0x25')](function(_0x363f1e){return _0x363f1e;});}return null;};}function removeEntity(_0x5890c1,_0x444fb4){return function(_0x192f6b){if(_0x192f6b){return _0x192f6b['destroy']()['then'](function(){var _0xb9605a=_0x192f6b[_0xe9da('0x26')]({'plain':!![]});var _0x3b8be2=_0xe9da('0x27');return db['UserProfileResource'][_0xe9da('0x28')]({'where':{'type':_0x3b8be2,'resourceId':_0xb9605a['id']}})['then'](function(){return _0x192f6b;});})[_0xe9da('0x25')](function(){_0x5890c1[_0xe9da('0x18')](0xcc)[_0xe9da('0x19')]();});}};}function handleEntityNotFound(_0x42eefa,_0x5c6d5d){return function(_0x1053b3){if(!_0x1053b3){_0x42eefa['sendStatus'](0x194);}return _0x1053b3;};}function handleError(_0x4863ad,_0x306b79){_0x306b79=_0x306b79||0x1f4;return function(_0x4c5962){logger['error'](_0x4c5962[_0xe9da('0x29')]);if(_0x4c5962['name']){delete _0x4c5962[_0xe9da('0x2a')];}_0x4863ad[_0xe9da('0x18')](_0x306b79)[_0xe9da('0x2b')](_0x4c5962);};}exports[_0xe9da('0x2c')]=function(_0x4ac8f8,_0x160971){var _0x5d9722={},_0xf17830={},_0x36bfbf={'count':0x0,'rows':[]};var _0x8383eb=_[_0xe9da('0x2d')](db[_0xe9da('0x2e')][_0xe9da('0x2f')],function(_0x5d6d28){return{'name':_0x5d6d28[_0xe9da('0x30')],'type':_0x5d6d28['type']['key']};});_0xf17830[_0xe9da('0x31')]=_[_0xe9da('0x2d')](_0x8383eb,_0xe9da('0x2a'));_0xf17830['query']=_[_0xe9da('0x32')](_0x4ac8f8[_0xe9da('0x33')]);_0xf17830['filters']=_['intersection'](_0xf17830[_0xe9da('0x31')],_0xf17830[_0xe9da('0x33')]);_0x5d9722[_0xe9da('0x34')]=_[_0xe9da('0x35')](_0xf17830['model'],qs[_0xe9da('0x36')](_0x4ac8f8['query'][_0xe9da('0x36')]));_0x5d9722[_0xe9da('0x34')]=_0x5d9722[_0xe9da('0x34')]['length']?_0x5d9722[_0xe9da('0x34')]:_0xf17830[_0xe9da('0x31')];if(!_0x4ac8f8['query'][_0xe9da('0x37')](_0xe9da('0x38'))){_0x5d9722[_0xe9da('0x1d')]=qs[_0xe9da('0x1d')](_0x4ac8f8[_0xe9da('0x33')][_0xe9da('0x1d')]);_0x5d9722[_0xe9da('0x1b')]=qs[_0xe9da('0x1b')](_0x4ac8f8[_0xe9da('0x33')]['offset']);}_0x5d9722[_0xe9da('0x39')]=qs[_0xe9da('0x3a')](_0x4ac8f8['query']['sort']);_0x5d9722[_0xe9da('0x3b')]=qs['filters'](_[_0xe9da('0x3c')](_0x4ac8f8['query'],_0xf17830[_0xe9da('0x3d')]),_0x8383eb);if(_0x4ac8f8['query'][_0xe9da('0x3e')]){_0x5d9722[_0xe9da('0x3b')]=_[_0xe9da('0x3f')](_0x5d9722[_0xe9da('0x3b')],{'$or':_['map'](_0x8383eb,function(_0x21973b){if(_0x21973b[_0xe9da('0x40')]!==_0xe9da('0x41')){var _0x402f68={};_0x402f68[_0x21973b[_0xe9da('0x2a')]]={'$like':'%'+_0x4ac8f8[_0xe9da('0x33')][_0xe9da('0x3e')]+'%'};return _0x402f68;}})});}_0x5d9722=_[_0xe9da('0x3f')]({},_0x5d9722,_0x4ac8f8[_0xe9da('0x42')]);var _0x37a161={'where':_0x5d9722[_0xe9da('0x3b')]};return db['Campaign'][_0xe9da('0x1e')](_0x37a161)['then'](function(_0x10f565){_0x36bfbf[_0xe9da('0x1e')]=_0x10f565;if(_0x4ac8f8[_0xe9da('0x33')]['includeAll']){_0x5d9722[_0xe9da('0x43')]=[{'all':!![]}];}return db[_0xe9da('0x2e')][_0xe9da('0x44')](_0x5d9722);})[_0xe9da('0x25')](function(_0x58e43a){_0x36bfbf[_0xe9da('0x45')]=_0x58e43a;return _0x36bfbf;})[_0xe9da('0x25')](respondWithFilteredResult(_0x160971,_0x5d9722))[_0xe9da('0x46')](handleError(_0x160971,null));};exports[_0xe9da('0x47')]=function(_0x27d2b0,_0x5ac20c){var _0x4330eb={'raw':![],'where':{'id':_0x27d2b0[_0xe9da('0x48')]['id']}},_0x388635={};_0x388635['model']=_[_0xe9da('0x32')](db['Campaign'][_0xe9da('0x2f')]);_0x388635[_0xe9da('0x33')]=_['keys'](_0x27d2b0[_0xe9da('0x33')]);_0x388635[_0xe9da('0x3d')]=_['intersection'](_0x388635[_0xe9da('0x31')],_0x388635[_0xe9da('0x33')]);_0x4330eb[_0xe9da('0x34')]=_[_0xe9da('0x35')](_0x388635[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0x27d2b0[_0xe9da('0x33')][_0xe9da('0x36')]));_0x4330eb[_0xe9da('0x34')]=_0x4330eb['attributes'][_0xe9da('0x49')]?_0x4330eb[_0xe9da('0x34')]:_0x388635[_0xe9da('0x31')];if(_0x27d2b0['query'][_0xe9da('0x4a')]){_0x4330eb[_0xe9da('0x43')]=[{'all':!![]}];}_0x4330eb=_[_0xe9da('0x3f')]({},_0x4330eb,_0x27d2b0[_0xe9da('0x42')]);return db['Campaign']['find'](_0x4330eb)[_0xe9da('0x25')](handleEntityNotFound(_0x5ac20c,null))[_0xe9da('0x25')](respondWithResult(_0x5ac20c,null))['catch'](handleError(_0x5ac20c,null));};exports[_0xe9da('0x4b')]=function(_0x1bcc4a,_0x1bea15){return db['Campaign'][_0xe9da('0x4b')](_0x1bcc4a[_0xe9da('0x4c')],{})[_0xe9da('0x25')](function(_0x39a8cf){var _0x4ae305=_0x1bcc4a[_0xe9da('0x4d')]['get']({'plain':!![]});if(!_0x4ae305)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ae305['role']===_0xe9da('0x4d')){var _0x2c9c85=_0x39a8cf['get']({'plain':!![]});var _0x56b291=_0xe9da('0x27');return db[_0xe9da('0x4e')][_0xe9da('0x4f')]({'where':{'name':_0x56b291,'userProfileId':_0x4ae305[_0xe9da('0x50')]},'raw':!![]})[_0xe9da('0x25')](function(_0x27ca40){if(_0x27ca40&&_0x27ca40['autoAssociation']===0x0){return db[_0xe9da('0x51')][_0xe9da('0x4b')]({'name':_0x2c9c85[_0xe9da('0x2a')],'resourceId':_0x2c9c85['id'],'type':_0x27ca40['name'],'sectionId':_0x27ca40['id']},{})[_0xe9da('0x25')](function(){return _0x39a8cf;});}else{return _0x39a8cf;}})['catch'](function(_0x57d073){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57d073);throw _0x57d073;});}return _0x39a8cf;})[_0xe9da('0x25')](respondWithResult(_0x1bea15,0xc9))[_0xe9da('0x46')](handleError(_0x1bea15,null));};exports[_0xe9da('0x52')]=function(_0x4c8949,_0x4a7a75){var _0x4fd2b3={'where':{'id':_0x4c8949['params']['id']}},_0x34a58e={};_0x34a58e[_0xe9da('0x31')]=_[_0xe9da('0x32')](db[_0xe9da('0x2e')][_0xe9da('0x2f')]);_0x4fd2b3['attributes']=_[_0xe9da('0x35')](_0x34a58e[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0x4c8949[_0xe9da('0x33')][_0xe9da('0x36')]));_0x4fd2b3[_0xe9da('0x34')]=_0x4fd2b3[_0xe9da('0x34')][_0xe9da('0x49')]?_0x4fd2b3[_0xe9da('0x34')]:_0x34a58e[_0xe9da('0x31')];if(_0x4c8949[_0xe9da('0x33')]['includeAll']){_0x4fd2b3[_0xe9da('0x43')]=[{'all':!![]}];}_0x4fd2b3=_[_0xe9da('0x3f')]({},_0x4fd2b3,_0x4c8949[_0xe9da('0x42')]);return db['Campaign'][_0xe9da('0x4f')](_0x4fd2b3)[_0xe9da('0x25')](handleEntityNotFound(_0x4a7a75,null))[_0xe9da('0x25')](function(_0x2c672b){if(_0x2c672b){var _0x3209a1=_0x2c672b['get']({'plain':!![]});_0x3209a1=qs['omit'](_0x3209a1,['id',_0xe9da('0x53'),'updatedAt']);_0x4c8949[_0xe9da('0x4c')]=_[_0xe9da('0x54')](_0x4c8949['body'],['id',_0xe9da('0x53'),'updatedAt']);return db[_0xe9da('0x2e')][_0xe9da('0x4b')](_[_0xe9da('0x3f')](_0x3209a1,_0x4c8949[_0xe9da('0x4c')]),{'include':_0x4c8949[_0xe9da('0x33')][_0xe9da('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x59ff78){var _0x5c6c93=_0x4c8949[_0xe9da('0x4d')][_0xe9da('0x26')]({'plain':!![]});if(!_0x5c6c93)throw new Error(_0xe9da('0x55'));if(_0x5c6c93[_0xe9da('0x56')]==='user'){var _0xd272c4=_0x59ff78[_0xe9da('0x26')]({'plain':!![]});var _0x59c457=_0xe9da('0x27');return db[_0xe9da('0x4e')][_0xe9da('0x4f')]({'where':{'name':_0x59c457,'userProfileId':_0x5c6c93[_0xe9da('0x50')]},'raw':!![]})[_0xe9da('0x25')](function(_0x548397){if(_0x548397&&_0x548397[_0xe9da('0x57')]===0x0){return db[_0xe9da('0x51')]['create']({'name':_0xd272c4['name'],'resourceId':_0xd272c4['id'],'type':_0x548397[_0xe9da('0x2a')],'sectionId':_0x548397['id']},{})[_0xe9da('0x25')](function(){return _0x59ff78;});}else{return _0x59ff78;}})[_0xe9da('0x46')](function(_0x401688){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x401688);throw _0x401688;});}return _0x59ff78;});}})[_0xe9da('0x25')](respondWithResult(_0x4a7a75,0xc9))[_0xe9da('0x46')](handleError(_0x4a7a75,null));};exports[_0xe9da('0x24')]=function(_0x5f0fa8,_0x34f14c){if(_0x5f0fa8[_0xe9da('0x4c')]['id']){delete _0x5f0fa8[_0xe9da('0x4c')]['id'];}return db[_0xe9da('0x2e')][_0xe9da('0x4f')]({'where':{'id':_0x5f0fa8[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x34f14c,null))[_0xe9da('0x25')](saveUpdates(_0x5f0fa8[_0xe9da('0x4c')],null))[_0xe9da('0x25')](respondWithResult(_0x34f14c,null))[_0xe9da('0x46')](handleError(_0x34f14c,null));};exports[_0xe9da('0x28')]=function(_0x311e1d,_0x12321f){return db[_0xe9da('0x2e')][_0xe9da('0x4f')]({'where':{'id':_0x311e1d[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x12321f,null))[_0xe9da('0x25')](removeEntity(_0x12321f,null))[_0xe9da('0x46')](handleError(_0x12321f,null));};exports[_0xe9da('0x58')]=function(_0x42c896,_0x5d9035,_0x5b4b9b){var _0x26a97e={'raw':!![],'where':{}};var _0x4efe1f={};var _0x5befe3={'count':0x0,'rows':[]};return db[_0xe9da('0x2e')][_0xe9da('0x59')]({'where':{'id':_0x42c896[_0xe9da('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d9035,null))[_0xe9da('0x25')](function(_0x4820f1){if(_0x4820f1){_0x4efe1f[_0xe9da('0x31')]=_[_0xe9da('0x32')](db[_0xe9da('0x5a')]['rawAttributes']);_0x4efe1f['query']=_[_0xe9da('0x32')](_0x42c896[_0xe9da('0x33')]);_0x4efe1f[_0xe9da('0x3d')]=_['intersection'](_0x4efe1f[_0xe9da('0x31')],_0x4efe1f['query']);_0x26a97e[_0xe9da('0x34')]=_[_0xe9da('0x35')](_0x4efe1f[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0x42c896[_0xe9da('0x33')]['fields']));_0x26a97e['attributes']=_0x26a97e[_0xe9da('0x34')][_0xe9da('0x49')]?_0x26a97e[_0xe9da('0x34')]:_0x4efe1f[_0xe9da('0x31')];if(!_0x42c896[_0xe9da('0x33')][_0xe9da('0x37')]('nolimit')){_0x26a97e[_0xe9da('0x1d')]=qs[_0xe9da('0x1d')](_0x42c896[_0xe9da('0x33')][_0xe9da('0x1d')]);_0x26a97e['offset']=qs[_0xe9da('0x1b')](_0x42c896[_0xe9da('0x33')][_0xe9da('0x1b')]);}_0x26a97e[_0xe9da('0x39')]=qs[_0xe9da('0x3a')](_0x42c896['query']['sort']);_0x26a97e[_0xe9da('0x3b')]=qs[_0xe9da('0x3d')](_[_0xe9da('0x3c')](_0x42c896[_0xe9da('0x33')],_0x4efe1f[_0xe9da('0x3d')]));_0x26a97e[_0xe9da('0x3b')][_0xe9da('0x5b')]=_0x4820f1['id'];if(_0x42c896[_0xe9da('0x33')][_0xe9da('0x3e')]){_0x26a97e[_0xe9da('0x3b')]=_[_0xe9da('0x3f')](_0x26a97e[_0xe9da('0x3b')],{'$or':_[_0xe9da('0x2d')](_0x26a97e['attributes'],function(_0x29b7d5){var _0x2d9b7a={};_0x2d9b7a[_0x29b7d5]={'$like':'%'+_0x42c896[_0xe9da('0x33')][_0xe9da('0x3e')]+'%'};return _0x2d9b7a;})});}_0x26a97e=_['merge']({},_0x26a97e,_0x42c896[_0xe9da('0x42')]);return db[_0xe9da('0x5a')][_0xe9da('0x1e')]({'where':_0x26a97e[_0xe9da('0x3b')]})['then'](function(_0x16887e){_0x5befe3[_0xe9da('0x1e')]=_0x16887e;if(_0x42c896[_0xe9da('0x33')]['includeAll']){_0x26a97e[_0xe9da('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xe9da('0x44')](_0x26a97e);})[_0xe9da('0x25')](function(_0x58e1bc){_0x5befe3['rows']=_0x58e1bc;return _0x5befe3;});}})['then'](respondWithFilteredResult(_0x5d9035,_0x26a97e))['catch'](handleError(_0x5d9035,null));};exports[_0xe9da('0x5c')]=function(_0xf207f0,_0x2945de,_0x594f87){var _0x3d7f6b={'raw':!![],'where':{}};var _0x5ab639={};var _0xdc87ee={'count':0x0,'rows':[]};return db[_0xe9da('0x2e')]['findOne']({'where':{'id':_0xf207f0[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x2945de,null))[_0xe9da('0x25')](function(_0x35c31e){if(_0x35c31e){_0x5ab639[_0xe9da('0x31')]=_[_0xe9da('0x32')](db[_0xe9da('0x5d')][_0xe9da('0x2f')]);_0x5ab639[_0xe9da('0x33')]=_[_0xe9da('0x32')](_0xf207f0['query']);_0x5ab639['filters']=_['intersection'](_0x5ab639[_0xe9da('0x31')],_0x5ab639[_0xe9da('0x33')]);_0x3d7f6b[_0xe9da('0x34')]=_[_0xe9da('0x35')](_0x5ab639[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0xf207f0[_0xe9da('0x33')][_0xe9da('0x36')]));_0x3d7f6b[_0xe9da('0x34')]=_0x3d7f6b['attributes'][_0xe9da('0x49')]?_0x3d7f6b[_0xe9da('0x34')]:_0x5ab639['model'];if(!_0xf207f0[_0xe9da('0x33')][_0xe9da('0x37')](_0xe9da('0x38'))){_0x3d7f6b[_0xe9da('0x1d')]=qs[_0xe9da('0x1d')](_0xf207f0[_0xe9da('0x33')]['limit']);_0x3d7f6b['offset']=qs[_0xe9da('0x1b')](_0xf207f0[_0xe9da('0x33')]['offset']);}_0x3d7f6b[_0xe9da('0x39')]=qs[_0xe9da('0x3a')](_0xf207f0[_0xe9da('0x33')]['sort']);_0x3d7f6b[_0xe9da('0x3b')]=qs['filters'](_[_0xe9da('0x3c')](_0xf207f0[_0xe9da('0x33')],_0x5ab639[_0xe9da('0x3d')]));_0x3d7f6b[_0xe9da('0x3b')][_0xe9da('0x5b')]=_0x35c31e['id'];if(_0xf207f0[_0xe9da('0x33')][_0xe9da('0x3e')]){_0x3d7f6b[_0xe9da('0x3b')]=_['merge'](_0x3d7f6b[_0xe9da('0x3b')],{'$or':_[_0xe9da('0x2d')](_0x3d7f6b[_0xe9da('0x34')],function(_0x1021b9){var _0x39af8d={};_0x39af8d[_0x1021b9]={'$like':'%'+_0xf207f0[_0xe9da('0x33')]['filter']+'%'};return _0x39af8d;})});}_0x3d7f6b=_['merge']({},_0x3d7f6b,_0xf207f0[_0xe9da('0x42')]);return db['CmHopperHistory'][_0xe9da('0x1e')]({'where':_0x3d7f6b[_0xe9da('0x3b')]})[_0xe9da('0x25')](function(_0xd56a9b){_0xdc87ee[_0xe9da('0x1e')]=_0xd56a9b;if(_0xf207f0['query'][_0xe9da('0x4a')]){_0x3d7f6b[_0xe9da('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe9da('0x44')](_0x3d7f6b);})[_0xe9da('0x25')](function(_0xdadf38){_0xdc87ee[_0xe9da('0x45')]=_0xdadf38;return _0xdc87ee;});}})[_0xe9da('0x25')](respondWithFilteredResult(_0x2945de,_0x3d7f6b))[_0xe9da('0x46')](handleError(_0x2945de,null));};exports[_0xe9da('0x5e')]=function(_0x572994,_0x512498,_0x46ec68){var _0x2a1efe={'raw':!![],'where':{}};var _0x206781={};var _0xec8284={'count':0x0,'rows':[]};return db[_0xe9da('0x2e')]['findOne']({'where':{'id':_0x572994[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x512498,null))[_0xe9da('0x25')](function(_0x1eab30){if(_0x1eab30){_0x206781[_0xe9da('0x31')]=_[_0xe9da('0x32')](db['CmHopperFinal'][_0xe9da('0x2f')]);_0x206781[_0xe9da('0x33')]=_[_0xe9da('0x32')](_0x572994[_0xe9da('0x33')]);_0x206781[_0xe9da('0x3d')]=_[_0xe9da('0x35')](_0x206781[_0xe9da('0x31')],_0x206781[_0xe9da('0x33')]);_0x2a1efe[_0xe9da('0x34')]=_['intersection'](_0x206781[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0x572994[_0xe9da('0x33')][_0xe9da('0x36')]));_0x2a1efe[_0xe9da('0x34')]=_0x2a1efe[_0xe9da('0x34')]['length']?_0x2a1efe['attributes']:_0x206781[_0xe9da('0x31')];if(!_0x572994[_0xe9da('0x33')][_0xe9da('0x37')]('nolimit')){_0x2a1efe[_0xe9da('0x1d')]=qs[_0xe9da('0x1d')](_0x572994[_0xe9da('0x33')][_0xe9da('0x1d')]);_0x2a1efe[_0xe9da('0x1b')]=qs[_0xe9da('0x1b')](_0x572994[_0xe9da('0x33')][_0xe9da('0x1b')]);}_0x2a1efe[_0xe9da('0x39')]=qs['sort'](_0x572994[_0xe9da('0x33')]['sort']);_0x2a1efe['where']=qs['filters'](_[_0xe9da('0x3c')](_0x572994[_0xe9da('0x33')],_0x206781['filters']));_0x2a1efe[_0xe9da('0x3b')][_0xe9da('0x5b')]=_0x1eab30['id'];if(_0x572994['query'][_0xe9da('0x3e')]){_0x2a1efe[_0xe9da('0x3b')]=_[_0xe9da('0x3f')](_0x2a1efe[_0xe9da('0x3b')],{'$or':_['map'](_0x2a1efe['attributes'],function(_0x5123ee){var _0x5a1619={};_0x5a1619[_0x5123ee]={'$like':'%'+_0x572994['query'][_0xe9da('0x3e')]+'%'};return _0x5a1619;})});}_0x2a1efe=_[_0xe9da('0x3f')]({},_0x2a1efe,_0x572994['options']);return db[_0xe9da('0x5f')][_0xe9da('0x1e')]({'where':_0x2a1efe[_0xe9da('0x3b')]})['then'](function(_0x371c82){_0xec8284[_0xe9da('0x1e')]=_0x371c82;if(_0x572994[_0xe9da('0x33')][_0xe9da('0x4a')]){_0x2a1efe[_0xe9da('0x43')]=[{'all':!![]}];}return db[_0xe9da('0x5f')][_0xe9da('0x44')](_0x2a1efe);})[_0xe9da('0x25')](function(_0x43f38d){_0xec8284[_0xe9da('0x45')]=_0x43f38d;return _0xec8284;});}})[_0xe9da('0x25')](respondWithFilteredResult(_0x512498,_0x2a1efe))[_0xe9da('0x46')](handleError(_0x512498,null));};exports[_0xe9da('0x60')]=function(_0x344f6f,_0x29aab1,_0x3237d7){var _0x273ee9={'raw':!![],'where':{}};var _0x12512f={};var _0x3c0990={'count':0x0,'rows':[]};return db[_0xe9da('0x2e')]['findOne']({'where':{'id':_0x344f6f['params']['id']}})['then'](handleEntityNotFound(_0x29aab1,null))['then'](function(_0x2231a0){if(_0x2231a0){_0x12512f[_0xe9da('0x31')]=_[_0xe9da('0x32')](db[_0xe9da('0x61')][_0xe9da('0x2f')]);_0x12512f[_0xe9da('0x33')]=_[_0xe9da('0x32')](_0x344f6f[_0xe9da('0x33')]);_0x12512f[_0xe9da('0x3d')]=_[_0xe9da('0x35')](_0x12512f[_0xe9da('0x31')],_0x12512f[_0xe9da('0x33')]);_0x273ee9['attributes']=_[_0xe9da('0x35')](_0x12512f[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0x344f6f['query'][_0xe9da('0x36')]));_0x273ee9[_0xe9da('0x34')]=_0x273ee9[_0xe9da('0x34')]['length']?_0x273ee9[_0xe9da('0x34')]:_0x12512f[_0xe9da('0x31')];if(!_0x344f6f[_0xe9da('0x33')]['hasOwnProperty'](_0xe9da('0x38'))){_0x273ee9['limit']=qs[_0xe9da('0x1d')](_0x344f6f[_0xe9da('0x33')]['limit']);_0x273ee9[_0xe9da('0x1b')]=qs[_0xe9da('0x1b')](_0x344f6f[_0xe9da('0x33')][_0xe9da('0x1b')]);}_0x273ee9['order']=qs['sort'](_0x344f6f[_0xe9da('0x33')][_0xe9da('0x3a')]);_0x273ee9[_0xe9da('0x3b')]=qs[_0xe9da('0x3d')](_['pick'](_0x344f6f[_0xe9da('0x33')],_0x12512f['filters']));_0x273ee9[_0xe9da('0x3b')][_0xe9da('0x5b')]=_0x2231a0['id'];if(_0x344f6f[_0xe9da('0x33')][_0xe9da('0x3e')]){_0x273ee9['where']=_['merge'](_0x273ee9['where'],{'$or':_['map'](_0x273ee9[_0xe9da('0x34')],function(_0x30739a){var _0x4c4773={};_0x4c4773[_0x30739a]={'$like':'%'+_0x344f6f[_0xe9da('0x33')][_0xe9da('0x3e')]+'%'};return _0x4c4773;})});}_0x273ee9=_['merge']({},_0x273ee9,_0x344f6f[_0xe9da('0x42')]);return db['CmHopperBlack'][_0xe9da('0x1e')]({'where':_0x273ee9[_0xe9da('0x3b')]})[_0xe9da('0x25')](function(_0x12f89f){_0x3c0990[_0xe9da('0x1e')]=_0x12f89f;if(_0x344f6f[_0xe9da('0x33')][_0xe9da('0x4a')]){_0x273ee9['include']=[{'all':!![]}];}return db[_0xe9da('0x61')][_0xe9da('0x44')](_0x273ee9);})[_0xe9da('0x25')](function(_0xe692d0){_0x3c0990[_0xe9da('0x45')]=_0xe692d0;return _0x3c0990;});}})['then'](respondWithFilteredResult(_0x29aab1,_0x273ee9))[_0xe9da('0x46')](handleError(_0x29aab1,null));};exports['getLists']=function(_0x4cf163,_0x49a9d2,_0x202a6e){var _0x393492={};var _0x1b0dc2={};var _0x3596f5;var _0x48525f;return db[_0xe9da('0x2e')][_0xe9da('0x59')]({'where':{'id':_0x4cf163[_0xe9da('0x48')]['id']}})['then'](handleEntityNotFound(_0x49a9d2,null))[_0xe9da('0x25')](function(_0x25abfe){if(_0x25abfe){_0x3596f5=_0x25abfe;_0x1b0dc2[_0xe9da('0x31')]=_['keys'](db[_0xe9da('0x62')][_0xe9da('0x2f')]);_0x1b0dc2[_0xe9da('0x33')]=_['keys'](_0x4cf163[_0xe9da('0x33')]);_0x1b0dc2[_0xe9da('0x3d')]=_[_0xe9da('0x35')](_0x1b0dc2[_0xe9da('0x31')],_0x1b0dc2[_0xe9da('0x33')]);_0x393492[_0xe9da('0x34')]=_[_0xe9da('0x35')](_0x1b0dc2[_0xe9da('0x31')],qs[_0xe9da('0x36')](_0x4cf163[_0xe9da('0x33')]['fields']));_0x393492['attributes']=_0x393492['attributes'][_0xe9da('0x49')]?_0x393492['attributes']:_0x1b0dc2[_0xe9da('0x31')];_0x393492['order']=qs[_0xe9da('0x3a')](_0x4cf163[_0xe9da('0x33')][_0xe9da('0x3a')]);_0x393492['where']=qs[_0xe9da('0x3d')](_[_0xe9da('0x3c')](_0x4cf163[_0xe9da('0x33')],_0x1b0dc2[_0xe9da('0x3d')]));if(_0x4cf163[_0xe9da('0x33')][_0xe9da('0x3e')]){_0x393492[_0xe9da('0x3b')]=_[_0xe9da('0x3f')](_0x393492[_0xe9da('0x3b')],{'$or':_[_0xe9da('0x2d')](_0x393492[_0xe9da('0x34')],function(_0x2e8717){var _0x4fb82a={};_0x4fb82a[_0x2e8717]={'$like':'%'+_0x4cf163['query'][_0xe9da('0x3e')]+'%'};return _0x4fb82a;})});}_0x393492=_['merge']({},_0x393492,_0x4cf163[_0xe9da('0x42')]);return _0x3596f5[_0xe9da('0x63')](_0x393492);}})[_0xe9da('0x25')](function(_0x1c255d){if(_0x1c255d){_0x48525f=_0x1c255d[_0xe9da('0x49')];if(!_0x4cf163[_0xe9da('0x33')][_0xe9da('0x37')](_0xe9da('0x38'))){_0x393492['limit']=qs[_0xe9da('0x1d')](_0x4cf163[_0xe9da('0x33')]['limit']);_0x393492[_0xe9da('0x1b')]=qs['offset'](_0x4cf163[_0xe9da('0x33')][_0xe9da('0x1b')]);}return _0x3596f5[_0xe9da('0x63')](_0x393492);}})[_0xe9da('0x25')](function(_0x23d4e4){if(_0x23d4e4){return _0x23d4e4?{'count':_0x48525f,'rows':_0x23d4e4}:null;}})[_0xe9da('0x25')](respondWithResult(_0x49a9d2,null))[_0xe9da('0x46')](handleError(_0x49a9d2,null));};exports['addLists']=function(_0x4a87f7,_0x5a72c6,_0x584b0d){var _0x4e88cb,_0x51c856;return db[_0xe9da('0x2e')][_0xe9da('0x4f')]({'where':{'id':_0x4a87f7[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x5a72c6,null))[_0xe9da('0x25')](function(_0x1f9fd1){if(_0x1f9fd1){_0x51c856=_0x1f9fd1;return _0x1f9fd1[_0xe9da('0x64')](_0x4a87f7[_0xe9da('0x4c')][_0xe9da('0x65')],_['omit'](_0x4a87f7[_0xe9da('0x4c')],[_0xe9da('0x65'),'id'])||{});}return null;})[_0xe9da('0x66')](function(_0x425ce4){var _0x52c383;_0x4e88cb=_0x425ce4||[];var _0x300e1d=[];if(_0x425ce4){for(var _0x1cddf8=0x0;_0x1cddf8<_0x425ce4[_0xe9da('0x49')];_0x1cddf8+=0x1){var _0x89521e=_0x425ce4[_0x1cddf8][_0xe9da('0x26')]({'plain':!![]});_0x51c856[_0xe9da('0x67')]=_0x4a87f7[_0xe9da('0x4c')][_0xe9da('0x67')]?_0x4a87f7[_0xe9da('0x4c')][_0xe9da('0x67')]:_0x51c856[_0xe9da('0x67')];switch(_0x51c856['dialCheckDuplicateType']){case _0xe9da('0x68'):_0x52c383=squel['insert']()[_0xe9da('0x69')](_0xe9da('0x6a'))[_0xe9da('0x6b')]([_0xe9da('0x6c'),_0xe9da('0x6d'),_0xe9da('0x6e'),_0xe9da('0x6f'),_0xe9da('0x5b'),_0xe9da('0x53'),_0xe9da('0x70')],squel[_0xe9da('0x71')]()[_0xe9da('0x72')]('phone',_0xe9da('0x6c'))[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x6d'))[_0xe9da('0x72')]('id',_0xe9da('0x6e'))['field'](_0x89521e[_0xe9da('0x74')][_0xe9da('0x75')](),'ListId')[_0xe9da('0x72')](_0x4a87f7[_0xe9da('0x48')]['id'][_0xe9da('0x75')](),_0xe9da('0x5b'))[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x53'))['field'](_0xe9da('0x73'),'updatedAt')['from']('cm_contacts')[_0xe9da('0x3b')](_0xe9da('0x76'))['where'](_0xe9da('0x77'),_0x89521e[_0xe9da('0x74')][_0xe9da('0x75')]())[_0xe9da('0x3b')](_0xe9da('0x78'))[_0xe9da('0x3b')](_0xe9da('0x79'),squel[_0xe9da('0x71')]()[_0xe9da('0x72')](_0xe9da('0x7a'))['from'](_0xe9da('0x7b'))[_0xe9da('0x3b')](_0xe9da('0x7c'),_0x4a87f7[_0xe9da('0x48')]['id']['toString']()))[_0xe9da('0x3b')](_0xe9da('0x79'),squel[_0xe9da('0x71')]()[_0xe9da('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0xe9da('0x6a'))['where'](_0xe9da('0x7c'),_0x4a87f7[_0xe9da('0x48')]['id']['toString']())))['toString']();break;case _0xe9da('0x7d'):_0x52c383=squel[_0xe9da('0x7e')]()[_0xe9da('0x69')](_0xe9da('0x6a'))[_0xe9da('0x6b')](['phone',_0xe9da('0x6d'),_0xe9da('0x6e'),_0xe9da('0x6f'),'CampaignId',_0xe9da('0x53'),_0xe9da('0x70')],squel[_0xe9da('0x71')]()[_0xe9da('0x72')](_0xe9da('0x6c'),_0xe9da('0x6c'))[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x6d'))['field']('id',_0xe9da('0x6e'))[_0xe9da('0x72')](_0x89521e[_0xe9da('0x74')][_0xe9da('0x75')](),'ListId')[_0xe9da('0x72')](_0x4a87f7[_0xe9da('0x48')]['id'][_0xe9da('0x75')](),_0xe9da('0x5b'))['field']('NOW()','createdAt')[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x70'))[_0xe9da('0x7f')](_0xe9da('0x80'))[_0xe9da('0x3b')](_0xe9da('0x76'))['where'](_0xe9da('0x77'),_0x89521e['CmListId'][_0xe9da('0x75')]())[_0xe9da('0x3b')](_0xe9da('0x78'))[_0xe9da('0x3b')](_0xe9da('0x79'),squel[_0xe9da('0x71')]()[_0xe9da('0x72')]('COALESCE(phone,\x27\x27)')[_0xe9da('0x7f')]('cm_hopper')[_0xe9da('0x3b')](_0xe9da('0x7c'),_0x4a87f7[_0xe9da('0x48')]['id'][_0xe9da('0x75')]())))[_0xe9da('0x75')]();break;default:_0x52c383=squel[_0xe9da('0x7e')]()['into'](_0xe9da('0x6a'))[_0xe9da('0x6b')]([_0xe9da('0x6c'),_0xe9da('0x6d'),'ContactId',_0xe9da('0x6f'),_0xe9da('0x5b'),_0xe9da('0x53'),'updatedAt'],squel[_0xe9da('0x71')]()[_0xe9da('0x72')](_0xe9da('0x6c'),_0xe9da('0x6c'))[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x6d'))[_0xe9da('0x72')]('id',_0xe9da('0x6e'))['field'](_0x89521e['CmListId'][_0xe9da('0x75')](),'ListId')[_0xe9da('0x72')](_0x4a87f7[_0xe9da('0x48')]['id']['toString'](),_0xe9da('0x5b'))[_0xe9da('0x72')](_0xe9da('0x73'),'createdAt')['field'](_0xe9da('0x73'),_0xe9da('0x70'))[_0xe9da('0x7f')](_0xe9da('0x80'))['where'](_0xe9da('0x76'))['where']('ListId\x20=\x20?',_0x89521e[_0xe9da('0x74')]['toString']())[_0xe9da('0x3b')](_0xe9da('0x78')))[_0xe9da('0x75')]();}_0x300e1d['push'](db['sequelize'][_0xe9da('0x33')](_0x52c383));}return BPromise['all'](_0x300e1d);}})['then'](function(){return _0x4e88cb;})[_0xe9da('0x25')](respondWithResult(_0x5a72c6,null))[_0xe9da('0x46')](handleError(_0x5a72c6,null));};exports[_0xe9da('0x81')]=function(_0x59b6e6,_0x1b44b6,_0x4bb231){return db[_0xe9da('0x2e')][_0xe9da('0x4f')]({'where':{'id':_0x59b6e6[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x1b44b6,null))[_0xe9da('0x25')](function(_0x2cae0a){if(_0x2cae0a){return _0x2cae0a['removeLists'](_0x59b6e6[_0xe9da('0x33')][_0xe9da('0x65')]);}})[_0xe9da('0x25')](function(_0xa03d5a){if(_0xa03d5a){return db[_0xe9da('0x5a')][_0xe9da('0x28')]({'where':{'ListId':_0x59b6e6[_0xe9da('0x33')][_0xe9da('0x65')],'CampaignId':_0x59b6e6[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](function(){return _0xa03d5a;});}})[_0xe9da('0x25')](respondWithStatusCode(_0x1b44b6,null))[_0xe9da('0x46')](handleError(_0x1b44b6,null));};exports[_0xe9da('0x82')]=function(_0x12c3ea,_0xae9898,_0x5b190a){var _0x313a05={};var _0x397319={};var _0x3889e2;var _0x113c05;return db[_0xe9da('0x2e')][_0xe9da('0x59')]({'where':{'id':_0x12c3ea[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0xae9898,null))[_0xe9da('0x25')](function(_0x5b6743){if(_0x5b6743){_0x3889e2=_0x5b6743;_0x397319['model']=_['keys'](db[_0xe9da('0x62')][_0xe9da('0x2f')]);_0x397319['query']=_[_0xe9da('0x32')](_0x12c3ea[_0xe9da('0x33')]);_0x397319[_0xe9da('0x3d')]=_[_0xe9da('0x35')](_0x397319[_0xe9da('0x31')],_0x397319[_0xe9da('0x33')]);_0x313a05[_0xe9da('0x34')]=_[_0xe9da('0x35')](_0x397319[_0xe9da('0x31')],qs['fields'](_0x12c3ea[_0xe9da('0x33')]['fields']));_0x313a05[_0xe9da('0x34')]=_0x313a05['attributes']['length']?_0x313a05['attributes']:_0x397319[_0xe9da('0x31')];_0x313a05[_0xe9da('0x39')]=qs[_0xe9da('0x3a')](_0x12c3ea[_0xe9da('0x33')][_0xe9da('0x3a')]);_0x313a05[_0xe9da('0x3b')]=qs['filters'](_[_0xe9da('0x3c')](_0x12c3ea[_0xe9da('0x33')],_0x397319[_0xe9da('0x3d')]));if(_0x12c3ea[_0xe9da('0x33')]['filter']){_0x313a05[_0xe9da('0x3b')]=_['merge'](_0x313a05[_0xe9da('0x3b')],{'$or':_['map'](_0x313a05[_0xe9da('0x34')],function(_0x416b83){var _0x4ea941={};_0x4ea941[_0x416b83]={'$like':'%'+_0x12c3ea['query'][_0xe9da('0x3e')]+'%'};return _0x4ea941;})});}_0x313a05=_['merge']({},_0x313a05,_0x12c3ea[_0xe9da('0x42')]);return _0x3889e2[_0xe9da('0x82')](_0x313a05);}})[_0xe9da('0x25')](function(_0x1aca39){if(_0x1aca39){_0x113c05=_0x1aca39[_0xe9da('0x49')];if(!_0x12c3ea['query'][_0xe9da('0x37')](_0xe9da('0x38'))){_0x313a05[_0xe9da('0x1d')]=qs[_0xe9da('0x1d')](_0x12c3ea[_0xe9da('0x33')]['limit']);_0x313a05[_0xe9da('0x1b')]=qs[_0xe9da('0x1b')](_0x12c3ea['query'][_0xe9da('0x1b')]);}return _0x3889e2[_0xe9da('0x82')](_0x313a05);}})['then'](function(_0x4e8c98){if(_0x4e8c98){return _0x4e8c98?{'count':_0x113c05,'rows':_0x4e8c98}:null;}})[_0xe9da('0x25')](respondWithResult(_0xae9898,null))['catch'](handleError(_0xae9898,null));};exports['addBlackLists']=function(_0x48424a,_0x456ebe,_0x429144){var _0x238bba,_0x2b11af;return db['Campaign'][_0xe9da('0x4f')]({'where':{'id':_0x48424a[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x456ebe,null))[_0xe9da('0x25')](function(_0x26d8ac){if(_0x26d8ac){_0x2b11af=_0x26d8ac;return _0x26d8ac[_0xe9da('0x83')](_0x48424a['body']['ids'],_[_0xe9da('0x54')](_0x48424a[_0xe9da('0x4c')],[_0xe9da('0x65'),'id'])||{});}return null;})['spread'](function(_0x214716){var _0x59219f;_0x238bba=_0x214716||[];var _0x6b9237=[];if(_0x214716){for(var _0x219989=0x0;_0x219989<_0x214716[_0xe9da('0x49')];_0x219989+=0x1){var _0x198da1=_0x214716[_0x219989][_0xe9da('0x26')]({'plain':!![]});_0x59219f=squel[_0xe9da('0x7e')]()[_0xe9da('0x69')](_0xe9da('0x84'))[_0xe9da('0x6b')]([_0xe9da('0x6c'),_0xe9da('0x6e'),_0xe9da('0x6f'),_0xe9da('0x5b'),_0xe9da('0x53'),_0xe9da('0x70')],squel[_0xe9da('0x71')]()[_0xe9da('0x72')]('phone',_0xe9da('0x6c'))[_0xe9da('0x72')]('id',_0xe9da('0x6e'))[_0xe9da('0x72')](_0x198da1[_0xe9da('0x74')]['toString'](),_0xe9da('0x6f'))['field'](_0x48424a[_0xe9da('0x48')]['id']['toString'](),_0xe9da('0x5b'))[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x53'))[_0xe9da('0x72')](_0xe9da('0x73'),_0xe9da('0x70'))['from']('cm_contacts')[_0xe9da('0x3b')](_0xe9da('0x76'))[_0xe9da('0x3b')]('ListId\x20=\x20?',_0x198da1['CmListId'][_0xe9da('0x75')]())[_0xe9da('0x3b')](_0xe9da('0x78')))['toString']();_0x6b9237['push'](db[_0xe9da('0x85')][_0xe9da('0x33')](_0x59219f));}return BPromise[_0xe9da('0x86')](_0x6b9237);}})[_0xe9da('0x25')](function(){return _0x238bba;})[_0xe9da('0x25')](respondWithResult(_0x456ebe,null))['catch'](handleError(_0x456ebe,null));};exports[_0xe9da('0x87')]=function(_0x1fb22c,_0x3dfdbf,_0x3c2118){return db[_0xe9da('0x2e')]['find']({'where':{'id':_0x1fb22c[_0xe9da('0x48')]['id']}})[_0xe9da('0x25')](handleEntityNotFound(_0x3dfdbf,null))[_0xe9da('0x25')](function(_0x46f33b){if(_0x46f33b){return _0x46f33b['removeBlackLists'](_0x1fb22c['query'][_0xe9da('0x65')]);}})['then'](function(_0x4e57df){if(_0x4e57df){return db[_0xe9da('0x61')][_0xe9da('0x28')]({'where':{'ListId':_0x1fb22c[_0xe9da('0x33')]['ids'],'CampaignId':_0x1fb22c[_0xe9da('0x48')]['id']}})['then'](function(){return _0x4e57df;});}})['then'](respondWithStatusCode(_0x3dfdbf,null))['catch'](handleError(_0x3dfdbf,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 8e567fa..4879108 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3f581f,_0x4ea03c){var _0x1e0d19=function(_0x2b9d8a){while(--_0x2b9d8a){_0x3f581f['push'](_0x3f581f['shift']());}};_0x1e0d19(++_0x4ea03c);}(_0x7a54,0x106));var _0x47a5=function(_0x6cd864,_0x2f4c05){_0x6cd864=_0x6cd864-0x0;var _0xa1c1ae=_0x7a54[_0x6cd864];return _0xa1c1ae;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 6e95b21..b964ba8 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 _0xc6d8=['request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','model','attributes','map','include','then','GetCampaign','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x266d29,_0x2b6b29){var _0x33bbbd=function(_0x3b934d){while(--_0x3b934d){_0x266d29['push'](_0x266d29['shift']());}};_0x33bbbd(++_0x2b6b29);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x195690,_0x13d76e){_0x195690=_0x195690-0x0;var _0xcd8219=_0xc6d8[_0x195690];return _0xcd8219;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Campaign,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['GetCampaign']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Campaign'][_0x8c6d('0x13')]({'raw':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['where']||null:null,'attributes':_0x3e5495['options']?_0x3e5495[_0x8c6d('0x14')]['attributes']||null:null,'limit':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['limit']||null:null,'include':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')]['include']?_['map'](_0x3e5495['options']['include'],function(_0x2a85b5){return{'model':db[_0x2a85b5[_0x8c6d('0x16')]],'as':_0x2a85b5['as'],'attributes':_0x2a85b5[_0x8c6d('0x17')],'include':_0x2a85b5['include']?_[_0x8c6d('0x18')](_0x2a85b5['include'],function(_0x15a9c4){return{'model':db[_0x15a9c4['model']],'as':_0x15a9c4['as'],'attributes':_0x15a9c4[_0x8c6d('0x17')],'include':_0x15a9c4[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a9c4[_0x8c6d('0x19')],function(_0x1e6755){return{'model':db[_0x1e6755[_0x8c6d('0x16')]],'as':_0x1e6755['as'],'attributes':_0x1e6755[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x3eab38){logger['info']('GetCampaign',_0x3e5495);logger[_0x8c6d('0xd')](_0x8c6d('0x1b'),_0x3e5495,JSON[_0x8c6d('0xf')](_0x3eab38));_0x4c2f8d(_0x3eab38);})[_0x8c6d('0x12')](function(_0x370626){logger[_0x8c6d('0x10')](_0x8c6d('0x1b'),_0x370626[_0x8c6d('0x11')],_0x3e5495);_0x21b8ee(_0x5a22de[_0x8c6d('0x10')](0x1f4,_0x370626[_0x8c6d('0x11')]));});});}; \ No newline at end of file +var _0xc79f=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xc79f,0x82));var _0xfc79=function(_0xbe6d5d,_0x308a41){_0xbe6d5d=_0xbe6d5d-0x0;var _0x2cb584=_0xc79f[_0xbe6d5d];return _0x2cb584;};'use strict';var _=require(_0xfc79('0x0'));var util=require(_0xfc79('0x1'));var moment=require(_0xfc79('0x2'));var BPromise=require(_0xfc79('0x3'));var rs=require(_0xfc79('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc79('0x5'))['db'];var utils=require(_0xfc79('0x6'));var logger=require(_0xfc79('0x7'))(_0xfc79('0x8'));var config=require(_0xfc79('0x9'));var jayson=require(_0xfc79('0xa'));var client=jayson[_0xfc79('0xb')][_0xfc79('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3df358,_0x47f36c,_0x8c8b37){return new BPromise(function(_0x59bf11,_0x18a07e){return client[_0xfc79('0xd')](_0x3df358,_0x8c8b37)[_0xfc79('0xe')](function(_0x4eb2f6){logger[_0xfc79('0xf')](_0xfc79('0x10'),_0x47f36c,_0xfc79('0x11'));logger[_0xfc79('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x47f36c,_0xfc79('0x11'),JSON[_0xfc79('0x13')](_0x4eb2f6));if(_0x4eb2f6[_0xfc79('0x14')]){if(_0x4eb2f6['error'][_0xfc79('0x15')]===0x1f4){logger[_0xfc79('0x14')]('Campaign,\x20%s,\x20%s',_0x47f36c,_0x4eb2f6[_0xfc79('0x14')]['message']);return _0x18a07e(_0x4eb2f6[_0xfc79('0x14')][_0xfc79('0x16')]);}logger[_0xfc79('0x14')]('Campaign,\x20%s,\x20%s',_0x47f36c,_0x4eb2f6[_0xfc79('0x14')][_0xfc79('0x16')]);return _0x59bf11(_0x4eb2f6[_0xfc79('0x14')][_0xfc79('0x16')]);}else{logger[_0xfc79('0xf')](_0xfc79('0x10'),_0x47f36c,'request\x20sent');_0x59bf11(_0x4eb2f6[_0xfc79('0x17')][_0xfc79('0x16')]);}})[_0xfc79('0x18')](function(_0x322972){logger['error'](_0xfc79('0x10'),_0x47f36c,_0x322972);_0x18a07e(_0x322972);});});}exports[_0xfc79('0x19')]=function(_0x216501){var _0x22dde3=this;return new Promise(function(_0x489e9a,_0x5f2d67){return db[_0xfc79('0x1a')]['findAll']({'raw':_0x216501[_0xfc79('0x1b')]?_0x216501[_0xfc79('0x1b')][_0xfc79('0x1c')]===undefined?!![]:![]:!![],'where':_0x216501[_0xfc79('0x1b')]?_0x216501['options'][_0xfc79('0x1d')]||null:null,'attributes':_0x216501[_0xfc79('0x1b')]?_0x216501[_0xfc79('0x1b')][_0xfc79('0x1e')]||null:null,'limit':_0x216501[_0xfc79('0x1b')]?_0x216501[_0xfc79('0x1b')][_0xfc79('0x1f')]||null:null,'include':_0x216501['options']?_0x216501[_0xfc79('0x1b')][_0xfc79('0x20')]?_[_0xfc79('0x21')](_0x216501[_0xfc79('0x1b')][_0xfc79('0x20')],function(_0x5a1c6e){return{'model':db[_0x5a1c6e['model']],'as':_0x5a1c6e['as'],'attributes':_0x5a1c6e['attributes'],'include':_0x5a1c6e[_0xfc79('0x20')]?_[_0xfc79('0x21')](_0x5a1c6e[_0xfc79('0x20')],function(_0x324191){return{'model':db[_0x324191['model']],'as':_0x324191['as'],'attributes':_0x324191[_0xfc79('0x1e')],'include':_0x324191['include']?_[_0xfc79('0x21')](_0x324191['include'],function(_0x82011){return{'model':db[_0x82011[_0xfc79('0x22')]],'as':_0x82011['as'],'attributes':_0x82011[_0xfc79('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14fd6c){logger[_0xfc79('0xf')](_0xfc79('0x19'),_0x216501);logger[_0xfc79('0x12')](_0xfc79('0x19'),_0x216501,JSON[_0xfc79('0x13')](_0x14fd6c));_0x489e9a(_0x14fd6c);})[_0xfc79('0x18')](function(_0x4ef0f8){logger[_0xfc79('0x14')](_0xfc79('0x19'),_0x4ef0f8[_0xfc79('0x16')],_0x216501);_0x5f2d67(_0x22dde3[_0xfc79('0x14')](0x1f4,_0x4ef0f8['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 34b1d92..53f7c19 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 _0xf825=['index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','/:id/clone','clone','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated'];(function(_0x4e591c,_0x20d296){var _0x36ae27=function(_0x31ad09){while(--_0x31ad09){_0x4e591c['push'](_0x4e591c['shift']());}};_0x36ae27(++_0x20d296);}(_0xf825,0xc3));var _0x5f82=function(_0x5a1fe6,_0xf5002b){_0x5a1fe6=_0x5a1fe6-0x0;var _0x1e2e0f=_0xf825[_0x5a1fe6];return _0x1e2e0f;};'use strict';var multer=require(_0x5f82('0x0'));var util=require(_0x5f82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f82('0x2'));var router=express[_0x5f82('0x3')]();var fs_extra=require(_0x5f82('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f82('0x5'));var config=require('../../config/environment');var controller=require(_0x5f82('0x6'));router[_0x5f82('0x7')]('/',auth[_0x5f82('0x8')](),controller[_0x5f82('0x9')]);router[_0x5f82('0x7')]('/:id',auth[_0x5f82('0x8')](),controller[_0x5f82('0xa')]);router[_0x5f82('0x7')](_0x5f82('0xb'),auth[_0x5f82('0x8')](),controller[_0x5f82('0xc')]);router['get'](_0x5f82('0xd'),auth['isAuthenticated'](),controller[_0x5f82('0xe')]);router[_0x5f82('0x7')](_0x5f82('0xf'),auth['isAuthenticated'](),controller[_0x5f82('0x10')]);router['get'](_0x5f82('0x11'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x12')]);router[_0x5f82('0x7')](_0x5f82('0x13'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x14')]);router[_0x5f82('0x7')](_0x5f82('0x15'),auth[_0x5f82('0x8')](),controller['getBlackLists']);router[_0x5f82('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f82('0x16')](_0x5f82('0x17'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x18')]);router[_0x5f82('0x16')](_0x5f82('0x13'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x19')]);router[_0x5f82('0x16')](_0x5f82('0x15'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x1a')]);router['put'](_0x5f82('0x1b'),auth[_0x5f82('0x8')](),controller[_0x5f82('0x1c')]);router[_0x5f82('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x5f82('0x1e')]);router[_0x5f82('0x1d')]('/:id/lists',auth[_0x5f82('0x8')](),controller[_0x5f82('0x1f')]);router[_0x5f82('0x1d')](_0x5f82('0x15'),auth['isAuthenticated'](),controller[_0x5f82('0x20')]);module[_0x5f82('0x21')]=router; \ No newline at end of file +var _0x11db=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x1434c7,_0x35090a){var _0x3dacb3=function(_0x44d087){while(--_0x44d087){_0x1434c7['push'](_0x1434c7['shift']());}};_0x3dacb3(++_0x35090a);}(_0x11db,0x146));var _0xb11d=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x11db[_0x5f08a6];return _0x5d0641;};'use strict';var multer=require(_0xb11d('0x0'));var util=require(_0xb11d('0x1'));var path=require(_0xb11d('0x2'));var timeout=require(_0xb11d('0x3'));var express=require(_0xb11d('0x4'));var router=express['Router']();var fs_extra=require(_0xb11d('0x5'));var auth=require(_0xb11d('0x6'));var interaction=require(_0xb11d('0x7'));var config=require(_0xb11d('0x8'));var controller=require(_0xb11d('0x9'));router[_0xb11d('0xa')]('/',auth[_0xb11d('0xb')](),controller[_0xb11d('0xc')]);router[_0xb11d('0xa')](_0xb11d('0xd'),auth['isAuthenticated'](),controller[_0xb11d('0xe')]);router[_0xb11d('0xa')](_0xb11d('0xf'),auth['isAuthenticated'](),controller[_0xb11d('0x10')]);router[_0xb11d('0xa')](_0xb11d('0x11'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x12')]);router[_0xb11d('0xa')]('/:id/hopper_finals',auth[_0xb11d('0xb')](),controller['getHopperFinals']);router[_0xb11d('0xa')]('/:id/hopper_black',auth[_0xb11d('0xb')](),controller[_0xb11d('0x13')]);router[_0xb11d('0xa')](_0xb11d('0x14'),auth['isAuthenticated'](),controller[_0xb11d('0x15')]);router[_0xb11d('0xa')](_0xb11d('0x16'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x17')]);router[_0xb11d('0x18')]('/',auth[_0xb11d('0xb')](),controller[_0xb11d('0x19')]);router['post'](_0xb11d('0x1a'),auth['isAuthenticated'](),controller[_0xb11d('0x1b')]);router[_0xb11d('0x18')]('/:id/lists',auth[_0xb11d('0xb')](),controller[_0xb11d('0x1c')]);router[_0xb11d('0x18')](_0xb11d('0x16'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x1d')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb11d('0x1e')]);router[_0xb11d('0x1f')](_0xb11d('0xd'),auth[_0xb11d('0xb')](),controller[_0xb11d('0x20')]);router[_0xb11d('0x1f')](_0xb11d('0x14'),auth[_0xb11d('0xb')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0xb11d('0xb')](),controller['removeBlackLists']);module[_0xb11d('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9005860..5fa1f45 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 _0xfed6=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfed6,0x83));var _0x6fed=function(_0x417ae0,_0x49af61){_0x417ae0=_0x417ae0-0x0;var _0x4b677f=_0xfed6[_0x417ae0];return _0x4b677f;};'use strict';var Sequelize=require(_0x6fed('0x0'));module[_0x6fed('0x1')]={'key':{'type':Sequelize[_0x6fed('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6fed('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6fed('0x2')]},'name':{'type':Sequelize[_0x6fed('0x4')],'get':function(){return this[_0x6fed('0x5')](_0x6fed('0x6'));}}}; \ No newline at end of file +var _0x8f4f=['getDataValue','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x3c86af,_0x480729){var _0x58265c=function(_0x4f8706){while(--_0x4f8706){_0x3c86af['push'](_0x3c86af['shift']());}};_0x58265c(++_0x480729);}(_0x8f4f,0xd3));var _0xf8f4=function(_0x3dc82c,_0xe235b0){_0x3dc82c=_0x3dc82c-0x0;var _0x3e8ec4=_0x8f4f[_0x3dc82c];return _0x3e8ec4;};'use strict';var Sequelize=require(_0xf8f4('0x0'));module[_0xf8f4('0x1')]={'key':{'type':Sequelize[_0xf8f4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf8f4('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf8f4('0x2')]},'name':{'type':Sequelize[_0xf8f4('0x4')],'get':function(){return this[_0xf8f4('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index fd7e6a3..32da6ec 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 _0x4afc=['rawAttributes','find','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','get','CannedAnswers','error','stack','name','index','map','CannedAnswer','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show'];(function(_0x1823ab,_0x2f9b59){var _0x441279=function(_0x89fb5){while(--_0x89fb5){_0x1823ab['push'](_0x1823ab['shift']());}};_0x441279(++_0x2f9b59);}(_0x4afc,0x64));var _0xc4af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4afc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc4af('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc4af('0x1'));var BPromise=require(_0xc4af('0x2'));var Mustache=require(_0xc4af('0x3'));var util=require('util');var path=require(_0xc4af('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc4af('0x5'));var _=require(_0xc4af('0x6'));var squel=require(_0xc4af('0x7'));var crypto=require(_0xc4af('0x8'));var jsforce=require(_0xc4af('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc4af('0xa'));var querystring=require(_0xc4af('0xb'));var Papa=require(_0xc4af('0xc'));var Redis=require(_0xc4af('0xd'));var authService=require(_0xc4af('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc4af('0xf'));var hardwareService=require(_0xc4af('0x10'));var logger=require('../../config/logger')(_0xc4af('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc4af('0x12'))['db'];function respondWithStatusCode(_0x4811ba,_0x3ec0f0){_0x3ec0f0=_0x3ec0f0||0xcc;return function(_0x365ab5){if(_0x365ab5){return _0x4811ba[_0xc4af('0x13')](_0x3ec0f0);}return _0x4811ba['status'](_0x3ec0f0)[_0xc4af('0x14')]();};}function respondWithResult(_0x5a4b38,_0x49e634){_0x49e634=_0x49e634||0xc8;return function(_0xd4ffab){if(_0xd4ffab){return _0x5a4b38[_0xc4af('0x15')](_0x49e634)[_0xc4af('0x16')](_0xd4ffab);}};}function respondWithFilteredResult(_0x3d523e,_0x197c21){return function(_0x438136){if(_0x438136){var _0x304b62=typeof _0x197c21[_0xc4af('0x17')]===_0xc4af('0x18')&&typeof _0x197c21[_0xc4af('0x19')]==='undefined';var _0x1b98f0=_0x438136[_0xc4af('0x1a')];var _0x19bd48=_0x304b62?0x0:_0x197c21[_0xc4af('0x17')];var _0x4dd3e0=_0x304b62?_0x438136[_0xc4af('0x1a')]:_0x197c21[_0xc4af('0x17')]+_0x197c21[_0xc4af('0x19')];var _0x544d9c;if(_0x4dd3e0>=_0x1b98f0){_0x4dd3e0=_0x1b98f0;_0x544d9c=0xc8;}else{_0x544d9c=0xce;}_0x3d523e[_0xc4af('0x15')](_0x544d9c);return _0x3d523e['set'](_0xc4af('0x1b'),_0x19bd48+'-'+_0x4dd3e0+'/'+_0x1b98f0)['json'](_0x438136);}return null;};}function patchUpdates(_0x384b53){return function(_0x5714bf){try{jsonpatch['apply'](_0x5714bf,_0x384b53,!![]);}catch(_0x526fe4){return BPromise[_0xc4af('0x1c')](_0x526fe4);}return _0x5714bf[_0xc4af('0x1d')]();};}function saveUpdates(_0x2263f9,_0x914074){return function(_0x39c0f6){if(_0x39c0f6){return _0x39c0f6['update'](_0x2263f9)['then'](function(_0x24d8b8){return _0x24d8b8;});}return null;};}function removeEntity(_0x17d2fc,_0x157317){return function(_0x79d020){if(_0x79d020){return _0x79d020[_0xc4af('0x1e')]()[_0xc4af('0x1f')](function(){var _0x1b1b8e=_0x79d020[_0xc4af('0x20')]({'plain':!![]});var _0xf35732=_0xc4af('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0xf35732,'resourceId':_0x1b1b8e['id']}})[_0xc4af('0x1f')](function(){return _0x79d020;});})[_0xc4af('0x1f')](function(){_0x17d2fc[_0xc4af('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bfdb,_0x364897){return function(_0x4710c9){if(!_0x4710c9){_0x38bfdb[_0xc4af('0x13')](0x194);}return _0x4710c9;};}function handleError(_0xe5d909,_0x29a09d){_0x29a09d=_0x29a09d||0x1f4;return function(_0x2bc68d){logger[_0xc4af('0x22')](_0x2bc68d[_0xc4af('0x23')]);if(_0x2bc68d[_0xc4af('0x24')]){delete _0x2bc68d[_0xc4af('0x24')];}_0xe5d909[_0xc4af('0x15')](_0x29a09d)['send'](_0x2bc68d);};}exports[_0xc4af('0x25')]=function(_0x10221f,_0x5da578){var _0x1558c7={},_0xed33e1={},_0x2d765b={'count':0x0,'rows':[]};var _0x1e01b8=_[_0xc4af('0x26')](db[_0xc4af('0x27')]['rawAttributes'],function(_0x163579){return{'name':_0x163579[_0xc4af('0x28')],'type':_0x163579[_0xc4af('0x29')]['key']};});_0xed33e1['model']=_[_0xc4af('0x26')](_0x1e01b8,_0xc4af('0x24'));_0xed33e1['query']=_[_0xc4af('0x2a')](_0x10221f[_0xc4af('0x2b')]);_0xed33e1[_0xc4af('0x2c')]=_[_0xc4af('0x2d')](_0xed33e1[_0xc4af('0x2e')],_0xed33e1[_0xc4af('0x2b')]);_0x1558c7[_0xc4af('0x2f')]=_[_0xc4af('0x2d')](_0xed33e1['model'],qs[_0xc4af('0x30')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x30')]));_0x1558c7[_0xc4af('0x2f')]=_0x1558c7[_0xc4af('0x2f')][_0xc4af('0x31')]?_0x1558c7['attributes']:_0xed33e1[_0xc4af('0x2e')];if(!_0x10221f[_0xc4af('0x2b')][_0xc4af('0x32')](_0xc4af('0x33'))){_0x1558c7['limit']=qs[_0xc4af('0x19')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x19')]);_0x1558c7['offset']=qs[_0xc4af('0x17')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x17')]);}_0x1558c7[_0xc4af('0x34')]=qs[_0xc4af('0x35')](_0x10221f[_0xc4af('0x2b')][_0xc4af('0x35')]);_0x1558c7[_0xc4af('0x36')]=qs[_0xc4af('0x2c')](_[_0xc4af('0x37')](_0x10221f['query'],_0xed33e1[_0xc4af('0x2c')]),_0x1e01b8);if(_0x10221f['query'][_0xc4af('0x38')]){_0x1558c7[_0xc4af('0x36')]=_['merge'](_0x1558c7['where'],{'$or':[{'key':{'$like':'%'+_0x10221f[_0xc4af('0x2b')][_0xc4af('0x38')]+'%'}},{'value':{'$like':'%'+_0x10221f[_0xc4af('0x2b')][_0xc4af('0x38')]+'%'}}]});}_0x1558c7=_[_0xc4af('0x39')]({},_0x1558c7,_0x10221f[_0xc4af('0x3a')]);var _0x1ccf37={'where':_0x1558c7[_0xc4af('0x36')]};return db[_0xc4af('0x27')]['count'](_0x1ccf37)[_0xc4af('0x1f')](function(_0x48a066){_0x2d765b['count']=_0x48a066;if(_0x10221f[_0xc4af('0x2b')][_0xc4af('0x3b')]){_0x1558c7[_0xc4af('0x3c')]=[{'all':!![]}];}return db[_0xc4af('0x27')]['findAll'](_0x1558c7);})[_0xc4af('0x1f')](function(_0x5541e0){_0x2d765b[_0xc4af('0x3d')]=_0x5541e0;return _0x2d765b;})[_0xc4af('0x1f')](respondWithFilteredResult(_0x5da578,_0x1558c7))[_0xc4af('0x3e')](handleError(_0x5da578,null));};exports[_0xc4af('0x3f')]=function(_0x4c513f,_0x5d8855){var _0x32f755={'raw':!![],'where':{'id':_0x4c513f['params']['id']}},_0x1b76ca={};_0x1b76ca['model']=_['keys'](db[_0xc4af('0x27')][_0xc4af('0x40')]);_0x1b76ca[_0xc4af('0x2b')]=_[_0xc4af('0x2a')](_0x4c513f['query']);_0x1b76ca[_0xc4af('0x2c')]=_[_0xc4af('0x2d')](_0x1b76ca[_0xc4af('0x2e')],_0x1b76ca[_0xc4af('0x2b')]);_0x32f755[_0xc4af('0x2f')]=_['intersection'](_0x1b76ca[_0xc4af('0x2e')],qs[_0xc4af('0x30')](_0x4c513f['query']['fields']));_0x32f755['attributes']=_0x32f755[_0xc4af('0x2f')][_0xc4af('0x31')]?_0x32f755['attributes']:_0x1b76ca[_0xc4af('0x2e')];if(_0x4c513f['query'][_0xc4af('0x3b')]){_0x32f755[_0xc4af('0x3c')]=[{'all':!![]}];}_0x32f755=_[_0xc4af('0x39')]({},_0x32f755,_0x4c513f[_0xc4af('0x3a')]);return db['CannedAnswer']['find'](_0x32f755)[_0xc4af('0x1f')](handleEntityNotFound(_0x5d8855,null))[_0xc4af('0x1f')](respondWithResult(_0x5d8855,null))['catch'](handleError(_0x5d8855,null));};exports['update']=function(_0x4eeae1,_0x17e95d){if(_0x4eeae1['body']['id']){delete _0x4eeae1['body']['id'];}return db[_0xc4af('0x27')][_0xc4af('0x41')]({'where':{'id':_0x4eeae1['params']['id']}})[_0xc4af('0x1f')](handleEntityNotFound(_0x17e95d,null))[_0xc4af('0x1f')](saveUpdates(_0x4eeae1['body'],null))[_0xc4af('0x1f')](respondWithResult(_0x17e95d,null))['catch'](handleError(_0x17e95d,null));};exports['destroy']=function(_0x584149,_0x2edc9f){return db[_0xc4af('0x27')][_0xc4af('0x41')]({'where':{'id':_0x584149[_0xc4af('0x42')]['id']}})['then'](handleEntityNotFound(_0x2edc9f,null))['then'](removeEntity(_0x2edc9f,null))[_0xc4af('0x3e')](handleError(_0x2edc9f,null));};exports[_0xc4af('0x43')]=function(_0x5d09e3,_0x52bd95){var _0x34f241={'key':_0x5d09e3[_0xc4af('0x44')]['key']};if(_0x5d09e3['body'][_0xc4af('0x45')]){_0x34f241[_0xc4af('0x45')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x45')];}else if(_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x46')]){_0x34f241[_0xc4af('0x46')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x46')];}else if(_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x47')]){_0x34f241[_0xc4af('0x47')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x47')];}else if(_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x48')]){_0x34f241[_0xc4af('0x48')]=_0x5d09e3[_0xc4af('0x44')][_0xc4af('0x48')];}return db[_0xc4af('0x27')][_0xc4af('0x41')]({'where':_0x34f241})[_0xc4af('0x1f')](function(_0x564d75){if(_0x564d75){throw new db[(_0xc4af('0x49'))][(_0xc4af('0x4a'))](_0xc4af('0x4b'));}return db[_0xc4af('0x27')][_0xc4af('0x43')](_0x5d09e3[_0xc4af('0x44')]);})[_0xc4af('0x1f')](function(_0xca8444){var _0x4e83a5=_0x5d09e3['user'][_0xc4af('0x20')]({'plain':!![]});if(!_0x4e83a5)throw new Error(_0xc4af('0x4c'));if(_0x4e83a5[_0xc4af('0x4d')]===_0xc4af('0x4e')){var _0x21818b=_0xca8444[_0xc4af('0x20')]({'plain':!![]});return db[_0xc4af('0x4f')][_0xc4af('0x41')]({'where':{'name':_0xc4af('0x21'),'userProfileId':_0x4e83a5['userProfileId']},'raw':!![]})['then'](function(_0x44b894){if(_0x44b894&&_0x44b894['autoAssociation']===0x0){return db[_0xc4af('0x50')][_0xc4af('0x43')]({'name':_0x21818b[_0xc4af('0x24')],'resourceId':_0x21818b['id'],'type':_0x44b894[_0xc4af('0x24')],'sectionId':_0x44b894['id']},{})[_0xc4af('0x1f')](function(){return _0xca8444;});}else{return _0xca8444;}})[_0xc4af('0x3e')](function(_0x2c6961){logger[_0xc4af('0x22')](_0xc4af('0x51'),_0x2c6961);throw _0x2c6961;});}return _0xca8444;})['then'](respondWithResult(_0x52bd95,0xc9))[_0xc4af('0x3e')](handleError(_0x52bd95,null));}; \ No newline at end of file +var _0xec8b=['ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CannedAnswer','includeAll','include','findAll','show','options','find','catch','update','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0xe2d14f,_0x49fd0e){var _0x4522d2=function(_0x1bf09a){while(--_0x1bf09a){_0xe2d14f['push'](_0xe2d14f['shift']());}};_0x4522d2(++_0x49fd0e);}(_0xec8b,0x10d));var _0xbec8=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xec8b[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbec8('0x0'));var zipdir=require(_0xbec8('0x1'));var jsonpatch=require(_0xbec8('0x2'));var rp=require('request-promise');var moment=require(_0xbec8('0x3'));var BPromise=require(_0xbec8('0x4'));var Mustache=require(_0xbec8('0x5'));var util=require(_0xbec8('0x6'));var path=require('path');var sox=require(_0xbec8('0x7'));var csv=require(_0xbec8('0x8'));var ejs=require(_0xbec8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbec8('0xa'));var crypto=require(_0xbec8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbec8('0x8'));var querystring=require(_0xbec8('0xc'));var Papa=require(_0xbec8('0xd'));var Redis=require(_0xbec8('0xe'));var authService=require(_0xbec8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbec8('0x10'));var hardwareService=require(_0xbec8('0x11'));var logger=require('../../config/logger')(_0xbec8('0x12'));var utils=require(_0xbec8('0x13'));var config=require(_0xbec8('0x14'));var licenseUtil=require(_0xbec8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x596b45,_0x8599f4){_0x8599f4=_0x8599f4||0xcc;return function(_0x1984a3){if(_0x1984a3){return _0x596b45[_0xbec8('0x16')](_0x8599f4);}return _0x596b45[_0xbec8('0x17')](_0x8599f4)[_0xbec8('0x18')]();};}function respondWithResult(_0xd29f38,_0x25c74d){_0x25c74d=_0x25c74d||0xc8;return function(_0x1e7fb4){if(_0x1e7fb4){return _0xd29f38[_0xbec8('0x17')](_0x25c74d)[_0xbec8('0x19')](_0x1e7fb4);}};}function respondWithFilteredResult(_0x34a537,_0x44b1a3){return function(_0x2962e1){if(_0x2962e1){var _0x3dd995=typeof _0x44b1a3[_0xbec8('0x1a')]===_0xbec8('0x1b')&&typeof _0x44b1a3[_0xbec8('0x1c')]===_0xbec8('0x1b');var _0xcb2d95=_0x2962e1[_0xbec8('0x1d')];var _0x4dcaba=_0x3dd995?0x0:_0x44b1a3[_0xbec8('0x1a')];var _0x4e44c4=_0x3dd995?_0x2962e1[_0xbec8('0x1d')]:_0x44b1a3[_0xbec8('0x1a')]+_0x44b1a3[_0xbec8('0x1c')];var _0xe34a54;if(_0x4e44c4>=_0xcb2d95){_0x4e44c4=_0xcb2d95;_0xe34a54=0xc8;}else{_0xe34a54=0xce;}_0x34a537[_0xbec8('0x17')](_0xe34a54);return _0x34a537[_0xbec8('0x1e')](_0xbec8('0x1f'),_0x4dcaba+'-'+_0x4e44c4+'/'+_0xcb2d95)[_0xbec8('0x19')](_0x2962e1);}return null;};}function patchUpdates(_0x59c695){return function(_0x23ddcd){try{jsonpatch[_0xbec8('0x20')](_0x23ddcd,_0x59c695,!![]);}catch(_0x23f826){return BPromise[_0xbec8('0x21')](_0x23f826);}return _0x23ddcd[_0xbec8('0x22')]();};}function saveUpdates(_0x200fe2,_0x42ee3d){return function(_0x16f8b4){if(_0x16f8b4){return _0x16f8b4['update'](_0x200fe2)[_0xbec8('0x23')](function(_0x31591e){return _0x31591e;});}return null;};}function removeEntity(_0x35ba34,_0x4d757a){return function(_0x469cf2){if(_0x469cf2){return _0x469cf2[_0xbec8('0x24')]()['then'](function(){var _0x56a82a=_0x469cf2[_0xbec8('0x25')]({'plain':!![]});var _0x386957=_0xbec8('0x26');return db[_0xbec8('0x27')][_0xbec8('0x24')]({'where':{'type':_0x386957,'resourceId':_0x56a82a['id']}})[_0xbec8('0x23')](function(){return _0x469cf2;});})['then'](function(){_0x35ba34[_0xbec8('0x17')](0xcc)[_0xbec8('0x18')]();});}};}function handleEntityNotFound(_0xdf6428,_0x9e430c){return function(_0x34ff8c){if(!_0x34ff8c){_0xdf6428[_0xbec8('0x16')](0x194);}return _0x34ff8c;};}function handleError(_0x2646c7,_0x4971b0){_0x4971b0=_0x4971b0||0x1f4;return function(_0x101b2a){logger[_0xbec8('0x28')](_0x101b2a['stack']);if(_0x101b2a['name']){delete _0x101b2a[_0xbec8('0x29')];}_0x2646c7[_0xbec8('0x17')](_0x4971b0)[_0xbec8('0x2a')](_0x101b2a);};}exports[_0xbec8('0x2b')]=function(_0x4d7d84,_0x466425){var _0x16add4={},_0x1d1a8c={},_0x35ba65={'count':0x0,'rows':[]};var _0x2de743=_[_0xbec8('0x2c')](db['CannedAnswer'][_0xbec8('0x2d')],function(_0x5708b7){return{'name':_0x5708b7['fieldName'],'type':_0x5708b7[_0xbec8('0x2e')][_0xbec8('0x2f')]};});_0x1d1a8c['model']=_[_0xbec8('0x2c')](_0x2de743,_0xbec8('0x29'));_0x1d1a8c[_0xbec8('0x30')]=_[_0xbec8('0x31')](_0x4d7d84['query']);_0x1d1a8c[_0xbec8('0x32')]=_['intersection'](_0x1d1a8c[_0xbec8('0x33')],_0x1d1a8c[_0xbec8('0x30')]);_0x16add4[_0xbec8('0x34')]=_[_0xbec8('0x35')](_0x1d1a8c['model'],qs[_0xbec8('0x36')](_0x4d7d84[_0xbec8('0x30')]['fields']));_0x16add4[_0xbec8('0x34')]=_0x16add4[_0xbec8('0x34')]['length']?_0x16add4[_0xbec8('0x34')]:_0x1d1a8c[_0xbec8('0x33')];if(!_0x4d7d84[_0xbec8('0x30')][_0xbec8('0x37')](_0xbec8('0x38'))){_0x16add4[_0xbec8('0x1c')]=qs[_0xbec8('0x1c')](_0x4d7d84['query'][_0xbec8('0x1c')]);_0x16add4[_0xbec8('0x1a')]=qs[_0xbec8('0x1a')](_0x4d7d84[_0xbec8('0x30')][_0xbec8('0x1a')]);}_0x16add4[_0xbec8('0x39')]=qs['sort'](_0x4d7d84[_0xbec8('0x30')][_0xbec8('0x3a')]);_0x16add4[_0xbec8('0x3b')]=qs['filters'](_[_0xbec8('0x3c')](_0x4d7d84['query'],_0x1d1a8c['filters']),_0x2de743);if(_0x4d7d84[_0xbec8('0x30')][_0xbec8('0x3d')]){_0x16add4['where']=_['merge'](_0x16add4[_0xbec8('0x3b')],{'$or':[{'key':{'$like':'%'+_0x4d7d84[_0xbec8('0x30')][_0xbec8('0x3d')]+'%'}},{'value':{'$like':'%'+_0x4d7d84['query']['filter']+'%'}}]});}_0x16add4=_[_0xbec8('0x3e')]({},_0x16add4,_0x4d7d84['options']);var _0x1f9e76={'where':_0x16add4[_0xbec8('0x3b')]};return db[_0xbec8('0x3f')]['count'](_0x1f9e76)[_0xbec8('0x23')](function(_0x147728){_0x35ba65[_0xbec8('0x1d')]=_0x147728;if(_0x4d7d84['query'][_0xbec8('0x40')]){_0x16add4[_0xbec8('0x41')]=[{'all':!![]}];}return db[_0xbec8('0x3f')][_0xbec8('0x42')](_0x16add4);})['then'](function(_0x480231){_0x35ba65['rows']=_0x480231;return _0x35ba65;})['then'](respondWithFilteredResult(_0x466425,_0x16add4))['catch'](handleError(_0x466425,null));};exports[_0xbec8('0x43')]=function(_0x3255a3,_0x4d6eb5){var _0x3fbca1={'raw':!![],'where':{'id':_0x3255a3['params']['id']}},_0x81fb8b={};_0x81fb8b['model']=_[_0xbec8('0x31')](db[_0xbec8('0x3f')][_0xbec8('0x2d')]);_0x81fb8b['query']=_[_0xbec8('0x31')](_0x3255a3['query']);_0x81fb8b[_0xbec8('0x32')]=_[_0xbec8('0x35')](_0x81fb8b[_0xbec8('0x33')],_0x81fb8b[_0xbec8('0x30')]);_0x3fbca1[_0xbec8('0x34')]=_[_0xbec8('0x35')](_0x81fb8b[_0xbec8('0x33')],qs['fields'](_0x3255a3['query'][_0xbec8('0x36')]));_0x3fbca1['attributes']=_0x3fbca1[_0xbec8('0x34')]['length']?_0x3fbca1[_0xbec8('0x34')]:_0x81fb8b['model'];if(_0x3255a3[_0xbec8('0x30')][_0xbec8('0x40')]){_0x3fbca1[_0xbec8('0x41')]=[{'all':!![]}];}_0x3fbca1=_[_0xbec8('0x3e')]({},_0x3fbca1,_0x3255a3[_0xbec8('0x44')]);return db[_0xbec8('0x3f')][_0xbec8('0x45')](_0x3fbca1)['then'](handleEntityNotFound(_0x4d6eb5,null))[_0xbec8('0x23')](respondWithResult(_0x4d6eb5,null))[_0xbec8('0x46')](handleError(_0x4d6eb5,null));};exports[_0xbec8('0x47')]=function(_0x210fe7,_0x30203c){if(_0x210fe7[_0xbec8('0x48')]['id']){delete _0x210fe7[_0xbec8('0x48')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x210fe7[_0xbec8('0x49')]['id']}})[_0xbec8('0x23')](handleEntityNotFound(_0x30203c,null))[_0xbec8('0x23')](saveUpdates(_0x210fe7[_0xbec8('0x48')],null))[_0xbec8('0x23')](respondWithResult(_0x30203c,null))[_0xbec8('0x46')](handleError(_0x30203c,null));};exports[_0xbec8('0x24')]=function(_0x2ca909,_0x3d0177){return db[_0xbec8('0x3f')][_0xbec8('0x45')]({'where':{'id':_0x2ca909[_0xbec8('0x49')]['id']}})[_0xbec8('0x23')](handleEntityNotFound(_0x3d0177,null))[_0xbec8('0x23')](removeEntity(_0x3d0177,null))[_0xbec8('0x46')](handleError(_0x3d0177,null));};exports['create']=function(_0x33a129,_0x173a81){var _0x203fde={'key':_0x33a129[_0xbec8('0x48')]['key']};if(_0x33a129[_0xbec8('0x48')][_0xbec8('0x4a')]){_0x203fde[_0xbec8('0x4a')]=_0x33a129[_0xbec8('0x48')]['MailAccountId'];}else if(_0x33a129['body']['SmsAccountId']){_0x203fde['SmsAccountId']=_0x33a129['body'][_0xbec8('0x4b')];}else if(_0x33a129[_0xbec8('0x48')][_0xbec8('0x4c')]){_0x203fde['OpenchannelAccountId']=_0x33a129[_0xbec8('0x48')]['OpenchannelAccountId'];}else if(_0x33a129[_0xbec8('0x48')][_0xbec8('0x4d')]){_0x203fde[_0xbec8('0x4d')]=_0x33a129[_0xbec8('0x48')][_0xbec8('0x4d')];}return db[_0xbec8('0x3f')][_0xbec8('0x45')]({'where':_0x203fde})[_0xbec8('0x23')](function(_0x435af4){if(_0x435af4){throw new db[(_0xbec8('0x4e'))][(_0xbec8('0x4f'))](_0xbec8('0x50'));}return db[_0xbec8('0x3f')][_0xbec8('0x51')](_0x33a129[_0xbec8('0x48')]);})['then'](function(_0x4daa38){var _0x502184=_0x33a129[_0xbec8('0x52')][_0xbec8('0x25')]({'plain':!![]});if(!_0x502184)throw new Error(_0xbec8('0x53'));if(_0x502184['role']===_0xbec8('0x52')){var _0x5f176e=_0x4daa38[_0xbec8('0x25')]({'plain':!![]});return db[_0xbec8('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x502184[_0xbec8('0x55')]},'raw':!![]})[_0xbec8('0x23')](function(_0x1a938a){if(_0x1a938a&&_0x1a938a[_0xbec8('0x56')]===0x0){return db[_0xbec8('0x27')][_0xbec8('0x51')]({'name':_0x5f176e[_0xbec8('0x29')],'resourceId':_0x5f176e['id'],'type':_0x1a938a[_0xbec8('0x29')],'sectionId':_0x1a938a['id']},{})[_0xbec8('0x23')](function(){return _0x4daa38;});}else{return _0x4daa38;}})[_0xbec8('0x46')](function(_0x5cd280){logger[_0xbec8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cd280);throw _0x5cd280;});}return _0x4daa38;})[_0xbec8('0x23')](respondWithResult(_0x173a81,0xc9))[_0xbec8('0x46')](handleError(_0x173a81,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index eff75c5..3fd5574 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 _0xedb8=['utf8mb4_unicode_ci','api','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x23d667,_0x1356b2){var _0x103541=function(_0x196ef5){while(--_0x196ef5){_0x23d667['push'](_0x23d667['shift']());}};_0x103541(++_0x1356b2);}(_0xedb8,0x181));var _0x8edb=function(_0x56e969,_0x2ed835){_0x56e969=_0x56e969-0x0;var _0x6577af=_0xedb8[_0x56e969];return _0x6577af;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8edb('0x0'));var moment=require('moment');var BPromise=require(_0x8edb('0x1'));var rp=require(_0x8edb('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8edb('0x3'));var config=require(_0x8edb('0x4'));var attributes=require(_0x8edb('0x5'));module[_0x8edb('0x6')]=function(_0x33db93,_0x41dd88){return _0x33db93[_0x8edb('0x7')](_0x8edb('0x8'),attributes,{'tableName':_0x8edb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8edb('0xa'),'collate':_0x8edb('0xb')});}; \ No newline at end of file +var _0xadcf=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4ea7c4,_0xd6713f){var _0x582fe4=function(_0x50f809){while(--_0x50f809){_0x4ea7c4['push'](_0x4ea7c4['shift']());}};_0x582fe4(++_0xd6713f);}(_0xadcf,0xbf));var _0xfadc=function(_0x47a2a5,_0x1bb224){_0x47a2a5=_0x47a2a5-0x0;var _0x35c957=_0xadcf[_0x47a2a5];return _0x35c957;};'use strict';var _=require(_0xfadc('0x0'));var util=require(_0xfadc('0x1'));var logger=require(_0xfadc('0x2'))(_0xfadc('0x3'));var moment=require(_0xfadc('0x4'));var BPromise=require(_0xfadc('0x5'));var rp=require(_0xfadc('0x6'));var fs=require('fs');var path=require(_0xfadc('0x7'));var rimraf=require(_0xfadc('0x8'));var config=require(_0xfadc('0x9'));var attributes=require(_0xfadc('0xa'));module[_0xfadc('0xb')]=function(_0x35274f,_0x41c48c){return _0x35274f[_0xfadc('0xc')](_0xfadc('0xd'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfadc('0xe'),'collate':_0xfadc('0xf')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index ab7a116..aec5a97 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(_0x63d68e,_0x20a649){var _0x373810=function(_0x285987){while(--_0x285987){_0x63d68e['push'](_0x63d68e['shift']());}};_0x373810(++_0x20a649);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x111192,_0xb8d073){var _0x499936=function(_0x398707){while(--_0x398707){_0x111192['push'](_0x111192['shift']());}};_0x499936(++_0xb8d073);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 92804fb..e65046b 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 _0xfb84=['/:id','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated'];(function(_0xffd893,_0x378965){var _0xc2deb1=function(_0x3f4e85){while(--_0x3f4e85){_0xffd893['push'](_0xffd893['shift']());}};_0xc2deb1(++_0x378965);}(_0xfb84,0x112));var _0x4fb8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xfb84[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0x4fb8('0x0'));var util=require(_0x4fb8('0x1'));var path=require(_0x4fb8('0x2'));var timeout=require(_0x4fb8('0x3'));var express=require(_0x4fb8('0x4'));var router=express[_0x4fb8('0x5')]();var fs_extra=require(_0x4fb8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4fb8('0x7'));var config=require('../../config/environment');var controller=require(_0x4fb8('0x8'));router[_0x4fb8('0x9')]('/',auth[_0x4fb8('0xa')](),controller['index']);router[_0x4fb8('0x9')](_0x4fb8('0xb'),auth[_0x4fb8('0xa')](),controller['show']);router['post']('/',auth[_0x4fb8('0xa')](),controller['create']);router[_0x4fb8('0xc')](_0x4fb8('0xb'),auth[_0x4fb8('0xa')](),controller['update']);router['delete'](_0x4fb8('0xb'),auth['isAuthenticated'](),controller[_0x4fb8('0xd')]);module[_0x4fb8('0xe')]=router; \ No newline at end of file +var _0x32f8=['create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','post'];(function(_0x5e4107,_0x21ea92){var _0x11ba5f=function(_0x5a60b4){while(--_0x5a60b4){_0x5e4107['push'](_0x5e4107['shift']());}};_0x11ba5f(++_0x21ea92);}(_0x32f8,0x18b));var _0x832f=function(_0x3e6531,_0xac3ee9){_0x3e6531=_0x3e6531-0x0;var _0xa8371d=_0x32f8[_0x3e6531];return _0xa8371d;};'use strict';var multer=require(_0x832f('0x0'));var util=require('util');var path=require(_0x832f('0x1'));var timeout=require(_0x832f('0x2'));var express=require(_0x832f('0x3'));var router=express[_0x832f('0x4')]();var fs_extra=require(_0x832f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x832f('0x6'));var config=require(_0x832f('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x832f('0x8')]);router[_0x832f('0x9')](_0x832f('0xa'),auth[_0x832f('0xb')](),controller['show']);router[_0x832f('0xc')]('/',auth[_0x832f('0xb')](),controller[_0x832f('0xd')]);router[_0x832f('0xe')]('/:id',auth[_0x832f('0xb')](),controller[_0x832f('0xf')]);router['delete'](_0x832f('0xa'),auth[_0x832f('0xb')](),controller['destroy']);module[_0x832f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 7c9f555..82522ff 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 _0x3715=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x383a4e,_0x55faa4){var _0x3e17f6=function(_0xb62bab){while(--_0xb62bab){_0x383a4e['push'](_0x383a4e['shift']());}};_0x3e17f6(++_0x55faa4);}(_0x3715,0xc3));var _0x5371=function(_0x4d1791,_0x1c99df){_0x4d1791=_0x4d1791-0x0;var _0x72288c=_0x3715[_0x4d1791];return _0x72288c;};'use strict';var Sequelize=require(_0x5371('0x0'));module[_0x5371('0x1')]={'calldate':{'type':Sequelize[_0x5371('0x2')],'allowNull':![],'defaultValue':_0x5371('0x3')},'clid':{'type':Sequelize[_0x5371('0x4')]},'src':{'type':Sequelize[_0x5371('0x4')]},'dst':{'type':Sequelize[_0x5371('0x4')]},'dcontext':{'type':Sequelize[_0x5371('0x4')]},'channel':{'type':Sequelize[_0x5371('0x4')]},'dstchannel':{'type':Sequelize[_0x5371('0x4')]},'lastapp':{'type':Sequelize[_0x5371('0x4')]},'lastdata':{'type':Sequelize[_0x5371('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5371('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5371('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5371('0x4')]},'userfield':{'type':Sequelize[_0x5371('0x4')]},'uniqueid':{'type':Sequelize[_0x5371('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x5371('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x5371('0x4')]}}; \ No newline at end of file +var _0x37a4=['DATE','STRING','INTEGER','sequelize'];(function(_0x5b1a21,_0x3f16e0){var _0x39728a=function(_0x5b3596){while(--_0x5b3596){_0x5b1a21['push'](_0x5b1a21['shift']());}};_0x39728a(++_0x3f16e0);}(_0x37a4,0xcb));var _0x437a=function(_0xecf812,_0x3571bb){_0xecf812=_0xecf812-0x0;var _0x332b72=_0x37a4[_0xecf812];return _0x332b72;};'use strict';var Sequelize=require(_0x437a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x437a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x437a('0x2')]},'src':{'type':Sequelize[_0x437a('0x2')]},'dst':{'type':Sequelize[_0x437a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x437a('0x2')]},'lastapp':{'type':Sequelize[_0x437a('0x2')]},'lastdata':{'type':Sequelize[_0x437a('0x2')]},'duration':{'type':Sequelize[_0x437a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x437a('0x2')]},'amaflags':{'type':Sequelize[_0x437a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x437a('0x2')]},'uniqueid':{'type':Sequelize[_0x437a('0x2')]},'linkedid':{'type':Sequelize[_0x437a('0x2')]},'sequence':{'type':Sequelize[_0x437a('0x2')]},'peeraccount':{'type':Sequelize[_0x437a('0x2')]},'type':{'type':Sequelize[_0x437a('0x2')]},'tag':{'type':Sequelize[_0x437a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 87302b7..36a9d3f 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 _0xc03e=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x560958,_0x1fc7bb){var _0x29b6b9=function(_0x40924d){while(--_0x40924d){_0x560958['push'](_0x560958['shift']());}};_0x29b6b9(++_0x1fc7bb);}(_0xc03e,0x15a));var _0xec03=function(_0x481604,_0x276ff8){_0x481604=_0x481604-0x0;var _0x1ca4ed=_0xc03e[_0x481604];return _0x1ca4ed;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec03('0x1'));var rp=require('request-promise');var moment=require(_0xec03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec03('0x3'));var util=require(_0xec03('0x4'));var path=require(_0xec03('0x5'));var sox=require(_0xec03('0x6'));var csv=require(_0xec03('0x7'));var ejs=require(_0xec03('0x8'));var fs=require('fs');var fs_extra=require(_0xec03('0x9'));var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x7'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var as=require(_0xec03('0x12'));var hardwareService=require(_0xec03('0x13'));var logger=require(_0xec03('0x14'))(_0xec03('0x15'));var utils=require(_0xec03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec03('0x17'));var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x398720,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xcc;return function(_0x9908ef){if(_0x9908ef){return _0x398720[_0xec03('0x19')](_0x2f65a1);}return _0x398720[_0xec03('0x1a')](_0x2f65a1)[_0xec03('0x1b')]();};}function respondWithResult(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xc8;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1a')](_0x555447)[_0xec03('0x1c')](_0x5ca0e2);}};}function respondWithFilteredResult(_0x3501ab,_0x515680){return function(_0x28bb4f){if(_0x28bb4f){var _0xbe85e6=typeof _0x515680[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x515680['limit']===_0xec03('0x1e');var _0x52f6ae=_0x28bb4f[_0xec03('0x1f')];var _0x5e8ae2=_0xbe85e6?0x0:_0x515680[_0xec03('0x1d')];var _0x5b3e04=_0xbe85e6?_0x28bb4f['count']:_0x515680[_0xec03('0x1d')]+_0x515680[_0xec03('0x20')];var _0xefa268;if(_0x5b3e04>=_0x52f6ae){_0x5b3e04=_0x52f6ae;_0xefa268=0xc8;}else{_0xefa268=0xce;}_0x3501ab[_0xec03('0x1a')](_0xefa268);return _0x3501ab['set'](_0xec03('0x21'),_0x5e8ae2+'-'+_0x5b3e04+'/'+_0x52f6ae)['json'](_0x28bb4f);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x22')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x23')](_0x33a167);}return _0x253910[_0xec03('0x24')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x25')](_0x3a44df)[_0xec03('0x26')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x26')](function(){_0x76b813[_0xec03('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(!_0x26875e){_0x2bfcf6[_0xec03('0x19')](0x194);}return _0x26875e;};}function handleError(_0x1c6870,_0x581322){_0x581322=_0x581322||0x1f4;return function(_0x73cc4f){logger[_0xec03('0x27')](_0x73cc4f[_0xec03('0x28')]);if(_0x73cc4f[_0xec03('0x29')]){delete _0x73cc4f[_0xec03('0x29')];}_0x1c6870['status'](_0x581322)[_0xec03('0x2a')](_0x73cc4f);};}exports[_0xec03('0x2b')]=function(_0x49f9ab,_0x530251){var _0x2063ba={},_0x12b5c9={},_0x35a9eb={'count':0x0,'rows':[]};var _0x872f98=_[_0xec03('0x2c')](db[_0xec03('0x2d')][_0xec03('0x2e')],function(_0x28753c){return{'name':_0x28753c['fieldName'],'type':_0x28753c[_0xec03('0x2f')][_0xec03('0x30')]};});_0x12b5c9[_0xec03('0x31')]=_[_0xec03('0x2c')](_0x872f98,_0xec03('0x29'));_0x12b5c9[_0xec03('0x32')]=_[_0xec03('0x33')](_0x49f9ab[_0xec03('0x32')]);_0x12b5c9[_0xec03('0x34')]=_['intersection'](_0x12b5c9['model'],_0x12b5c9['query']);_0x2063ba[_0xec03('0x35')]=_[_0xec03('0x36')](_0x12b5c9[_0xec03('0x31')],qs[_0xec03('0x37')](_0x49f9ab['query']['fields']));_0x2063ba['attributes']=_0x2063ba['attributes'][_0xec03('0x38')]?_0x2063ba[_0xec03('0x35')]:_0x12b5c9[_0xec03('0x31')];if(!_0x49f9ab[_0xec03('0x32')][_0xec03('0x39')](_0xec03('0x3a'))){_0x2063ba[_0xec03('0x20')]=qs[_0xec03('0x20')](_0x49f9ab[_0xec03('0x32')][_0xec03('0x20')]);_0x2063ba[_0xec03('0x1d')]=qs[_0xec03('0x1d')](_0x49f9ab['query'][_0xec03('0x1d')]);}_0x2063ba[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_0x49f9ab['query'][_0xec03('0x3c')]);_0x2063ba[_0xec03('0x3d')]=qs[_0xec03('0x34')](_[_0xec03('0x3e')](_0x49f9ab[_0xec03('0x32')],_0x12b5c9[_0xec03('0x34')]),_0x872f98);if(_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]){_0x2063ba[_0xec03('0x3d')]=_[_0xec03('0x40')](_0x2063ba[_0xec03('0x3d')],{'$or':_['map'](_0x872f98,function(_0x25286a){if(_0x25286a[_0xec03('0x2f')]!==_0xec03('0x41')){var _0x3d6d70={};_0x3d6d70[_0x25286a[_0xec03('0x29')]]={'$like':'%'+_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]+'%'};return _0x3d6d70;}})});}_0x2063ba=_[_0xec03('0x40')]({},_0x2063ba,_0x49f9ab['options']);var _0x454e91={'where':_0x2063ba['where']};return db['Cdr'][_0xec03('0x1f')](_0x454e91)['then'](function(_0x548b81){_0x35a9eb[_0xec03('0x1f')]=_0x548b81;if(_0x49f9ab[_0xec03('0x32')]['includeAll']){_0x2063ba[_0xec03('0x42')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x2063ba);})['then'](function(_0x494fec){_0x35a9eb[_0xec03('0x43')]=_0x494fec;return _0x35a9eb;})[_0xec03('0x26')](respondWithFilteredResult(_0x530251,_0x2063ba))[_0xec03('0x44')](handleError(_0x530251,null));};exports['show']=function(_0x1b1aea,_0x3f2522){var _0xe03df3={'raw':!![],'where':{'id':_0x1b1aea[_0xec03('0x45')]['id']}},_0x14a429={};_0x14a429[_0xec03('0x31')]=_[_0xec03('0x33')](db[_0xec03('0x2d')][_0xec03('0x2e')]);_0x14a429['query']=_[_0xec03('0x33')](_0x1b1aea[_0xec03('0x32')]);_0x14a429[_0xec03('0x34')]=_[_0xec03('0x36')](_0x14a429['model'],_0x14a429[_0xec03('0x32')]);_0xe03df3[_0xec03('0x35')]=_[_0xec03('0x36')](_0x14a429[_0xec03('0x31')],qs[_0xec03('0x37')](_0x1b1aea[_0xec03('0x32')]['fields']));_0xe03df3['attributes']=_0xe03df3[_0xec03('0x35')][_0xec03('0x38')]?_0xe03df3[_0xec03('0x35')]:_0x14a429[_0xec03('0x31')];if(_0x1b1aea[_0xec03('0x32')]['includeAll']){_0xe03df3['include']=[{'all':!![]}];}_0xe03df3=_[_0xec03('0x40')]({},_0xe03df3,_0x1b1aea['options']);return db[_0xec03('0x2d')][_0xec03('0x46')](_0xe03df3)[_0xec03('0x26')](handleEntityNotFound(_0x3f2522,null))[_0xec03('0x26')](respondWithResult(_0x3f2522,null))['catch'](handleError(_0x3f2522,null));};exports[_0xec03('0x47')]=function(_0x14a61c,_0x3c7e18){return db[_0xec03('0x2d')]['create'](_0x14a61c[_0xec03('0x48')],{})['then'](respondWithResult(_0x3c7e18,0xc9))[_0xec03('0x44')](handleError(_0x3c7e18,null));};exports[_0xec03('0x25')]=function(_0xdb9a99,_0x1c6b87){if(_0xdb9a99[_0xec03('0x48')]['id']){delete _0xdb9a99[_0xec03('0x48')]['id'];}return db[_0xec03('0x2d')]['find']({'where':{'id':_0xdb9a99[_0xec03('0x45')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x1c6b87,null))[_0xec03('0x26')](saveUpdates(_0xdb9a99[_0xec03('0x48')],null))['then'](respondWithResult(_0x1c6b87,null))[_0xec03('0x44')](handleError(_0x1c6b87,null));};exports['destroy']=function(_0xe0e874,_0x3825f9){return db[_0xec03('0x2d')][_0xec03('0x46')]({'where':{'id':_0xe0e874['params']['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x3825f9,null))[_0xec03('0x26')](removeEntity(_0x3825f9,null))[_0xec03('0x44')](handleError(_0x3825f9,null));};exports[_0xec03('0x49')]=function(_0x32a5af,_0x5b1339){return db[_0xec03('0x2d')][_0xec03('0x49')]()[_0xec03('0x26')](respondWithResult(_0x5b1339,null))['catch'](handleError(_0x5b1339,null));}; \ No newline at end of file +var _0x8819=['request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','zip-dir','fast-json-patch'];(function(_0x245837,_0x19f822){var _0x34effd=function(_0x888e48){while(--_0x888e48){_0x245837['push'](_0x245837['shift']());}};_0x34effd(++_0x19f822);}(_0x8819,0x94));var _0x9881=function(_0x2f7374,_0x476db0){_0x2f7374=_0x2f7374-0x0;var _0x5be48c=_0x8819[_0x2f7374];return _0x5be48c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9881('0x0'));var jsonpatch=require(_0x9881('0x1'));var rp=require(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var BPromise=require(_0x9881('0x4'));var Mustache=require('mustache');var util=require(_0x9881('0x5'));var path=require(_0x9881('0x6'));var sox=require(_0x9881('0x7'));var csv=require(_0x9881('0x8'));var ejs=require(_0x9881('0x9'));var fs=require('fs');var fs_extra=require(_0x9881('0xa'));var _=require('lodash');var squel=require(_0x9881('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9881('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9881('0xd'));var Redis=require('ioredis');var authService=require(_0x9881('0xe'));var qs=require(_0x9881('0xf'));var as=require(_0x9881('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9881('0x11'))(_0x9881('0x12'));var utils=require(_0x9881('0x13'));var config=require(_0x9881('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9881('0x15'))['db'];function respondWithStatusCode(_0x26ee3f,_0x5c6d2d){_0x5c6d2d=_0x5c6d2d||0xcc;return function(_0x42850e){if(_0x42850e){return _0x26ee3f['sendStatus'](_0x5c6d2d);}return _0x26ee3f['status'](_0x5c6d2d)['end']();};}function respondWithResult(_0x58f526,_0x12794f){_0x12794f=_0x12794f||0xc8;return function(_0x3178d7){if(_0x3178d7){return _0x58f526[_0x9881('0x16')](_0x12794f)[_0x9881('0x17')](_0x3178d7);}};}function respondWithFilteredResult(_0x39d127,_0x1d57ea){return function(_0x4b9d1b){if(_0x4b9d1b){var _0x411513=typeof _0x1d57ea[_0x9881('0x18')]===_0x9881('0x19')&&typeof _0x1d57ea['limit']==='undefined';var _0x4c92c9=_0x4b9d1b[_0x9881('0x1a')];var _0x4c3493=_0x411513?0x0:_0x1d57ea[_0x9881('0x18')];var _0x5a9848=_0x411513?_0x4b9d1b['count']:_0x1d57ea[_0x9881('0x18')]+_0x1d57ea[_0x9881('0x1b')];var _0x1cbac3;if(_0x5a9848>=_0x4c92c9){_0x5a9848=_0x4c92c9;_0x1cbac3=0xc8;}else{_0x1cbac3=0xce;}_0x39d127[_0x9881('0x16')](_0x1cbac3);return _0x39d127[_0x9881('0x1c')](_0x9881('0x1d'),_0x4c3493+'-'+_0x5a9848+'/'+_0x4c92c9)[_0x9881('0x17')](_0x4b9d1b);}return null;};}function patchUpdates(_0x1243cc){return function(_0x1ee450){try{jsonpatch[_0x9881('0x1e')](_0x1ee450,_0x1243cc,!![]);}catch(_0x32ca84){return BPromise[_0x9881('0x1f')](_0x32ca84);}return _0x1ee450[_0x9881('0x20')]();};}function saveUpdates(_0x300fa6,_0x174b39){return function(_0x58485d){if(_0x58485d){return _0x58485d['update'](_0x300fa6)[_0x9881('0x21')](function(_0x513545){return _0x513545;});}return null;};}function removeEntity(_0x499461,_0x1ba558){return function(_0x30ed15){if(_0x30ed15){return _0x30ed15['destroy']()['then'](function(){_0x499461[_0x9881('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bddc1,_0x161f8d){return function(_0x16eeca){if(!_0x16eeca){_0x2bddc1[_0x9881('0x22')](0x194);}return _0x16eeca;};}function handleError(_0x2c3cd1,_0x14e6f9){_0x14e6f9=_0x14e6f9||0x1f4;return function(_0x2f6b7c){logger[_0x9881('0x23')](_0x2f6b7c[_0x9881('0x24')]);if(_0x2f6b7c[_0x9881('0x25')]){delete _0x2f6b7c[_0x9881('0x25')];}_0x2c3cd1[_0x9881('0x16')](_0x14e6f9)[_0x9881('0x26')](_0x2f6b7c);};}exports['index']=function(_0x31956e,_0x41fe0d){var _0x5c2815={},_0x236979={},_0x3d7120={'count':0x0,'rows':[]};var _0x4970be=_[_0x9881('0x27')](db[_0x9881('0x28')][_0x9881('0x29')],function(_0x204f2b){return{'name':_0x204f2b[_0x9881('0x2a')],'type':_0x204f2b[_0x9881('0x2b')][_0x9881('0x2c')]};});_0x236979[_0x9881('0x2d')]=_['map'](_0x4970be,_0x9881('0x25'));_0x236979[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x31956e[_0x9881('0x2e')]);_0x236979[_0x9881('0x30')]=_[_0x9881('0x31')](_0x236979['model'],_0x236979[_0x9881('0x2e')]);_0x5c2815[_0x9881('0x32')]=_['intersection'](_0x236979[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x31956e[_0x9881('0x2e')][_0x9881('0x33')]));_0x5c2815[_0x9881('0x32')]=_0x5c2815['attributes'][_0x9881('0x34')]?_0x5c2815[_0x9881('0x32')]:_0x236979[_0x9881('0x2d')];if(!_0x31956e[_0x9881('0x2e')][_0x9881('0x35')](_0x9881('0x36'))){_0x5c2815[_0x9881('0x1b')]=qs[_0x9881('0x1b')](_0x31956e[_0x9881('0x2e')][_0x9881('0x1b')]);_0x5c2815[_0x9881('0x18')]=qs[_0x9881('0x18')](_0x31956e[_0x9881('0x2e')][_0x9881('0x18')]);}_0x5c2815[_0x9881('0x37')]=qs[_0x9881('0x38')](_0x31956e['query'][_0x9881('0x38')]);_0x5c2815['where']=qs[_0x9881('0x30')](_['pick'](_0x31956e[_0x9881('0x2e')],_0x236979[_0x9881('0x30')]),_0x4970be);if(_0x31956e['query'][_0x9881('0x39')]){_0x5c2815['where']=_[_0x9881('0x3a')](_0x5c2815[_0x9881('0x3b')],{'$or':_[_0x9881('0x27')](_0x4970be,function(_0x204fc3){if(_0x204fc3['type']!==_0x9881('0x3c')){var _0x3d183e={};_0x3d183e[_0x204fc3[_0x9881('0x25')]]={'$like':'%'+_0x31956e[_0x9881('0x2e')][_0x9881('0x39')]+'%'};return _0x3d183e;}})});}_0x5c2815=_[_0x9881('0x3a')]({},_0x5c2815,_0x31956e[_0x9881('0x3d')]);var _0x4feb70={'where':_0x5c2815[_0x9881('0x3b')]};return db['Cdr'][_0x9881('0x1a')](_0x4feb70)[_0x9881('0x21')](function(_0x1c0396){_0x3d7120['count']=_0x1c0396;if(_0x31956e[_0x9881('0x2e')][_0x9881('0x3e')]){_0x5c2815[_0x9881('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0x9881('0x40')](_0x5c2815);})[_0x9881('0x21')](function(_0x4fe13d){_0x3d7120[_0x9881('0x41')]=_0x4fe13d;return _0x3d7120;})[_0x9881('0x21')](respondWithFilteredResult(_0x41fe0d,_0x5c2815))[_0x9881('0x42')](handleError(_0x41fe0d,null));};exports[_0x9881('0x43')]=function(_0x424ed1,_0x1eae2f){var _0x2ac606={'raw':!![],'where':{'id':_0x424ed1[_0x9881('0x44')]['id']}},_0x4421bc={};_0x4421bc[_0x9881('0x2d')]=_['keys'](db[_0x9881('0x28')][_0x9881('0x29')]);_0x4421bc[_0x9881('0x2e')]=_[_0x9881('0x2f')](_0x424ed1[_0x9881('0x2e')]);_0x4421bc['filters']=_[_0x9881('0x31')](_0x4421bc[_0x9881('0x2d')],_0x4421bc[_0x9881('0x2e')]);_0x2ac606[_0x9881('0x32')]=_['intersection'](_0x4421bc[_0x9881('0x2d')],qs[_0x9881('0x33')](_0x424ed1[_0x9881('0x2e')]['fields']));_0x2ac606[_0x9881('0x32')]=_0x2ac606[_0x9881('0x32')][_0x9881('0x34')]?_0x2ac606[_0x9881('0x32')]:_0x4421bc[_0x9881('0x2d')];if(_0x424ed1[_0x9881('0x2e')][_0x9881('0x3e')]){_0x2ac606[_0x9881('0x3f')]=[{'all':!![]}];}_0x2ac606=_[_0x9881('0x3a')]({},_0x2ac606,_0x424ed1[_0x9881('0x3d')]);return db['Cdr'][_0x9881('0x45')](_0x2ac606)[_0x9881('0x21')](handleEntityNotFound(_0x1eae2f,null))[_0x9881('0x21')](respondWithResult(_0x1eae2f,null))['catch'](handleError(_0x1eae2f,null));};exports[_0x9881('0x46')]=function(_0x24a52b,_0x1e1f0f){return db['Cdr']['create'](_0x24a52b[_0x9881('0x47')],{})[_0x9881('0x21')](respondWithResult(_0x1e1f0f,0xc9))[_0x9881('0x42')](handleError(_0x1e1f0f,null));};exports[_0x9881('0x48')]=function(_0x49c478,_0x514263){if(_0x49c478[_0x9881('0x47')]['id']){delete _0x49c478[_0x9881('0x47')]['id'];}return db[_0x9881('0x28')]['find']({'where':{'id':_0x49c478[_0x9881('0x44')]['id']}})[_0x9881('0x21')](handleEntityNotFound(_0x514263,null))['then'](saveUpdates(_0x49c478[_0x9881('0x47')],null))[_0x9881('0x21')](respondWithResult(_0x514263,null))[_0x9881('0x42')](handleError(_0x514263,null));};exports[_0x9881('0x49')]=function(_0x21720a,_0x32cb89){return db[_0x9881('0x28')]['find']({'where':{'id':_0x21720a[_0x9881('0x44')]['id']}})['then'](handleEntityNotFound(_0x32cb89,null))[_0x9881('0x21')](removeEntity(_0x32cb89,null))[_0x9881('0x42')](handleError(_0x32cb89,null));};exports[_0x9881('0x4a')]=function(_0x16ca26,_0x590acc){return db['Cdr'][_0x9881('0x4a')]()[_0x9881('0x21')](respondWithResult(_0x590acc,null))[_0x9881('0x42')](handleError(_0x590acc,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index bc286f2..52cbb0e 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x97a647,_0x6d0f3e){var _0x151593=function(_0x588803){while(--_0x588803){_0x97a647['push'](_0x97a647['shift']());}};_0x151593(++_0x6d0f3e);}(_0x7a54,0x106));var _0x47a5=function(_0x357f46,_0x5371e5){_0x357f46=_0x357f46-0x0;var _0x3431d1=_0x7a54[_0x357f46];return _0x3431d1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x36e2d9,_0x5a0bde){var _0x4beee2=function(_0x36a4e0){while(--_0x36a4e0){_0x36e2d9['push'](_0x36e2d9['shift']());}};_0x4beee2(++_0x5a0bde);}(_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':'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 3237cd9..828f41e 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 _0x20ce=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3f7313,_0x399ba6){var _0x2afe38=function(_0x2bf07d){while(--_0x2bf07d){_0x3f7313['push'](_0x3f7313['shift']());}};_0x2afe38(++_0x399ba6);}(_0x20ce,0xfe));var _0xe20c=function(_0x37a7b4,_0x3a3e6e){_0x37a7b4=_0x37a7b4-0x0;var _0x4f4277=_0x20ce[_0x37a7b4];return _0x4f4277;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require(_0xe20c('0x3'));var rs=require(_0xe20c('0x4'));var fs=require('fs');var Redis=require(_0xe20c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe20c('0x6'))(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe20c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39eced,_0x2a4d38,_0x2474ed){return new BPromise(function(_0xd2ff53,_0x42433b){return client['request'](_0x39eced,_0x2474ed)[_0xe20c('0xa')](function(_0xe3a3b0){logger[_0xe20c('0xb')](_0xe20c('0xc'),_0x2a4d38,'request\x20sent');logger[_0xe20c('0xd')](_0xe20c('0xe'),_0x2a4d38,'request\x20sent',JSON[_0xe20c('0xf')](_0xe3a3b0));if(_0xe3a3b0['error']){if(_0xe3a3b0[_0xe20c('0x10')][_0xe20c('0x11')]===0x1f4){logger['error'](_0xe20c('0xc'),_0x2a4d38,_0xe3a3b0[_0xe20c('0x10')][_0xe20c('0x12')]);return _0x42433b(_0xe3a3b0[_0xe20c('0x10')]['message']);}logger[_0xe20c('0x10')](_0xe20c('0xc'),_0x2a4d38,_0xe3a3b0['error'][_0xe20c('0x12')]);return _0xd2ff53(_0xe3a3b0['error']['message']);}else{logger[_0xe20c('0xb')](_0xe20c('0xc'),_0x2a4d38,'request\x20sent');_0xd2ff53(_0xe3a3b0[_0xe20c('0x13')][_0xe20c('0x12')]);}})[_0xe20c('0x14')](function(_0x120c56){logger[_0xe20c('0x10')](_0xe20c('0xc'),_0x2a4d38,_0x120c56);_0x42433b(_0x120c56);});});} \ No newline at end of file +var _0x8557=['code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2abff5,_0x5cc3a1){var _0x2cebb5=function(_0x3b9131){while(--_0x3b9131){_0x2abff5['push'](_0x2abff5['shift']());}};_0x2cebb5(++_0x5cc3a1);}(_0x8557,0x190));var _0x7855=function(_0xfdf7a4,_0x37da46){_0xfdf7a4=_0xfdf7a4-0x0;var _0x59ec89=_0x8557[_0xfdf7a4];return _0x59ec89;};'use strict';var _=require('lodash');var util=require(_0x7855('0x0'));var moment=require(_0x7855('0x1'));var BPromise=require('bluebird');var rs=require(_0x7855('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7855('0x3'))['db'];var utils=require(_0x7855('0x4'));var logger=require(_0x7855('0x5'))('rpc');var config=require(_0x7855('0x6'));var jayson=require(_0x7855('0x7'));var client=jayson[_0x7855('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28b21e,_0x46cff8,_0x22f2e0){return new BPromise(function(_0x24b0da,_0x4d7a88){return client[_0x7855('0x9')](_0x28b21e,_0x22f2e0)[_0x7855('0xa')](function(_0x17a1ec){logger[_0x7855('0xb')](_0x7855('0xc'),_0x46cff8,'request\x20sent');logger[_0x7855('0xd')](_0x7855('0xe'),_0x46cff8,_0x7855('0xf'),JSON[_0x7855('0x10')](_0x17a1ec));if(_0x17a1ec[_0x7855('0x11')]){if(_0x17a1ec[_0x7855('0x11')][_0x7855('0x12')]===0x1f4){logger[_0x7855('0x11')](_0x7855('0xc'),_0x46cff8,_0x17a1ec[_0x7855('0x11')][_0x7855('0x13')]);return _0x4d7a88(_0x17a1ec[_0x7855('0x11')][_0x7855('0x13')]);}logger[_0x7855('0x11')](_0x7855('0xc'),_0x46cff8,_0x17a1ec[_0x7855('0x11')][_0x7855('0x13')]);return _0x24b0da(_0x17a1ec[_0x7855('0x11')][_0x7855('0x13')]);}else{logger[_0x7855('0xb')]('Cdr,\x20%s,\x20%s',_0x46cff8,'request\x20sent');_0x24b0da(_0x17a1ec[_0x7855('0x14')]['message']);}})[_0x7855('0x15')](function(_0xaa6485){logger[_0x7855('0x11')](_0x7855('0xc'),_0x46cff8,_0xaa6485);_0x4d7a88(_0xaa6485);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index ee0c555..6010369 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x8e7772,_0x9d77b0){var _0x408200=function(_0x1c61b6){while(--_0x1c61b6){_0x8e7772['push'](_0x8e7772['shift']());}};_0x408200(++_0x9d77b0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_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 28bd926..041264f 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 _0xe500=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe500,0x1e5));var _0x0e50=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0xe500[_0x4057f9];return _0x5552b7;};'use strict';var Sequelize=require(_0x0e50('0x0'));module[_0x0e50('0x1')]={'priority':{'type':Sequelize[_0x0e50('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0e50('0x3')],'allowNull':![],'defaultValue':_0x0e50('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0e50('0x3')]},'interval':{'type':Sequelize[_0x0e50('0x3')],'defaultValue':_0x0e50('0x5')}}; \ No newline at end of file +var _0xe4ec=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x511e3e,_0x35337d){var _0x5f485d=function(_0x17028d){while(--_0x17028d){_0x511e3e['push'](_0x511e3e['shift']());}};_0x5f485d(++_0x35337d);}(_0xe4ec,0x174));var _0xce4e=function(_0x357b2a,_0xc00551){_0x357b2a=_0x357b2a-0x0;var _0x18a2f3=_0xe4ec[_0x357b2a];return _0x18a2f3;};'use strict';var Sequelize=require(_0xce4e('0x0'));module[_0xce4e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xce4e('0x2')],'allowNull':![],'defaultValue':_0xce4e('0x3')},'appdata':{'type':Sequelize[_0xce4e('0x4')]()},'description':{'type':Sequelize[_0xce4e('0x2')]},'interval':{'type':Sequelize[_0xce4e('0x2')],'defaultValue':_0xce4e('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 19874b6..a88f9d0 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 _0x7070=['catch','update','body','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','limit','undefined','set','json','save','then','destroy','error','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','model','fields','length','include','merge','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7070,0x1d7));var _0x0707=function(_0xc19d6,_0x4d5cf3){_0xc19d6=_0xc19d6-0x0;var _0x255f2b=_0x7070[_0xc19d6];return _0x255f2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0707('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0707('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0707('0x2'));var Mustache=require(_0x0707('0x3'));var util=require(_0x0707('0x4'));var path=require(_0x0707('0x5'));var sox=require('sox');var csv=require(_0x0707('0x6'));var ejs=require(_0x0707('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0707('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0707('0x9'));var toCsv=require(_0x0707('0x6'));var querystring=require(_0x0707('0xa'));var Papa=require(_0x0707('0xb'));var Redis=require(_0x0707('0xc'));var authService=require(_0x0707('0xd'));var qs=require(_0x0707('0xe'));var as=require(_0x0707('0xf'));var hardwareService=require(_0x0707('0x10'));var logger=require(_0x0707('0x11'))('api');var utils=require(_0x0707('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0707('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b55c6,_0x2bd4d8){_0x2bd4d8=_0x2bd4d8||0xcc;return function(_0x3eeea8){if(_0x3eeea8){return _0x3b55c6[_0x0707('0x14')](_0x2bd4d8);}return _0x3b55c6[_0x0707('0x15')](_0x2bd4d8)[_0x0707('0x16')]();};}function respondWithResult(_0x3b0f64,_0x111fd7){_0x111fd7=_0x111fd7||0xc8;return function(_0x380abc){if(_0x380abc){return _0x3b0f64[_0x0707('0x15')](_0x111fd7)['json'](_0x380abc);}};}function respondWithFilteredResult(_0x5bae3d,_0x3fce78){return function(_0x429da2){if(_0x429da2){var _0x1370b3=typeof _0x3fce78[_0x0707('0x17')]==='undefined'&&typeof _0x3fce78[_0x0707('0x18')]===_0x0707('0x19');var _0xe1cf0e=_0x429da2['count'];var _0x13d5de=_0x1370b3?0x0:_0x3fce78['offset'];var _0x471431=_0x1370b3?_0x429da2['count']:_0x3fce78[_0x0707('0x17')]+_0x3fce78[_0x0707('0x18')];var _0x1debb9;if(_0x471431>=_0xe1cf0e){_0x471431=_0xe1cf0e;_0x1debb9=0xc8;}else{_0x1debb9=0xce;}_0x5bae3d[_0x0707('0x15')](_0x1debb9);return _0x5bae3d[_0x0707('0x1a')]('Content-Range',_0x13d5de+'-'+_0x471431+'/'+_0xe1cf0e)[_0x0707('0x1b')](_0x429da2);}return null;};}function patchUpdates(_0x360caf){return function(_0x37d1fd){try{jsonpatch['apply'](_0x37d1fd,_0x360caf,!![]);}catch(_0x5c8731){return BPromise['reject'](_0x5c8731);}return _0x37d1fd[_0x0707('0x1c')]();};}function saveUpdates(_0x3f31e1,_0x1d133c){return function(_0x51dec4){if(_0x51dec4){return _0x51dec4['update'](_0x3f31e1)[_0x0707('0x1d')](function(_0x225a58){return _0x225a58;});}return null;};}function removeEntity(_0x370554,_0x3e9c41){return function(_0x3ba507){if(_0x3ba507){return _0x3ba507[_0x0707('0x1e')]()[_0x0707('0x1d')](function(){_0x370554[_0x0707('0x15')](0xcc)[_0x0707('0x16')]();});}};}function handleEntityNotFound(_0x3dc5fb,_0x392acd){return function(_0x373bca){if(!_0x373bca){_0x3dc5fb['sendStatus'](0x194);}return _0x373bca;};}function handleError(_0x14d68b,_0x1834e0){_0x1834e0=_0x1834e0||0x1f4;return function(_0x3be832){logger[_0x0707('0x1f')](_0x3be832['stack']);if(_0x3be832[_0x0707('0x20')]){delete _0x3be832[_0x0707('0x20')];}_0x14d68b[_0x0707('0x15')](_0x1834e0)[_0x0707('0x21')](_0x3be832);};}exports[_0x0707('0x22')]=function(_0x599090,_0x1a4f0b){var _0x3378a5={'raw':!![],'where':{'id':_0x599090[_0x0707('0x23')]['id']}},_0x2f0ed2={};_0x2f0ed2['model']=_[_0x0707('0x24')](db[_0x0707('0x25')][_0x0707('0x26')]);_0x2f0ed2[_0x0707('0x27')]=_[_0x0707('0x24')](_0x599090[_0x0707('0x27')]);_0x2f0ed2[_0x0707('0x28')]=_['intersection'](_0x2f0ed2['model'],_0x2f0ed2[_0x0707('0x27')]);_0x3378a5[_0x0707('0x29')]=_[_0x0707('0x2a')](_0x2f0ed2[_0x0707('0x2b')],qs['fields'](_0x599090[_0x0707('0x27')][_0x0707('0x2c')]));_0x3378a5['attributes']=_0x3378a5[_0x0707('0x29')][_0x0707('0x2d')]?_0x3378a5['attributes']:_0x2f0ed2[_0x0707('0x2b')];if(_0x599090[_0x0707('0x27')]['includeAll']){_0x3378a5[_0x0707('0x2e')]=[{'all':!![]}];}_0x3378a5=_[_0x0707('0x2f')]({},_0x3378a5,_0x599090['options']);return db[_0x0707('0x25')][_0x0707('0x30')](_0x3378a5)[_0x0707('0x1d')](handleEntityNotFound(_0x1a4f0b,null))[_0x0707('0x1d')](respondWithResult(_0x1a4f0b,null))[_0x0707('0x31')](handleError(_0x1a4f0b,null));};exports[_0x0707('0x32')]=function(_0x19c84,_0x5e5b1a){if(_0x19c84[_0x0707('0x33')]['id']){delete _0x19c84[_0x0707('0x33')]['id'];}return db[_0x0707('0x25')]['find']({'where':{'id':_0x19c84[_0x0707('0x23')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x5e5b1a,null))['then'](saveUpdates(_0x19c84[_0x0707('0x33')],null))[_0x0707('0x1d')](respondWithResult(_0x5e5b1a,null))[_0x0707('0x31')](handleError(_0x5e5b1a,null));};exports['destroy']=function(_0x362d24,_0x4d093c){return db[_0x0707('0x25')][_0x0707('0x30')]({'where':{'id':_0x362d24[_0x0707('0x23')]['id']}})[_0x0707('0x1d')](handleEntityNotFound(_0x4d093c,null))[_0x0707('0x1d')](removeEntity(_0x4d093c,null))[_0x0707('0x31')](handleError(_0x4d093c,null));}; \ No newline at end of file +var _0x7c59=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','end','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','filters','query','attributes','intersection','fields','include','merge','options','catch','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service'];(function(_0x48f65a,_0x898b56){var _0x21b8a7=function(_0x1229f2){while(--_0x1229f2){_0x48f65a['push'](_0x48f65a['shift']());}};_0x21b8a7(++_0x898b56);}(_0x7c59,0x147));var _0x97c5=function(_0x46da01,_0x2f0040){_0x46da01=_0x46da01-0x0;var _0x42513f=_0x7c59[_0x46da01];return _0x42513f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c5('0x0'));var zipdir=require(_0x97c5('0x1'));var jsonpatch=require(_0x97c5('0x2'));var rp=require(_0x97c5('0x3'));var moment=require('moment');var BPromise=require(_0x97c5('0x4'));var Mustache=require(_0x97c5('0x5'));var util=require('util');var path=require('path');var sox=require(_0x97c5('0x6'));var csv=require(_0x97c5('0x7'));var ejs=require(_0x97c5('0x8'));var fs=require('fs');var fs_extra=require(_0x97c5('0x9'));var _=require(_0x97c5('0xa'));var squel=require('squel');var crypto=require(_0x97c5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97c5('0x7'));var querystring=require(_0x97c5('0xc'));var Papa=require(_0x97c5('0xd'));var Redis=require('ioredis');var authService=require(_0x97c5('0xe'));var qs=require(_0x97c5('0xf'));var as=require(_0x97c5('0x10'));var hardwareService=require(_0x97c5('0x11'));var logger=require('../../config/logger')(_0x97c5('0x12'));var utils=require(_0x97c5('0x13'));var config=require(_0x97c5('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x97c5('0x15'))['db'];function respondWithStatusCode(_0xf44acf,_0x3704de){_0x3704de=_0x3704de||0xcc;return function(_0x2e27a3){if(_0x2e27a3){return _0xf44acf[_0x97c5('0x16')](_0x3704de);}return _0xf44acf['status'](_0x3704de)['end']();};}function respondWithResult(_0x40043b,_0x16d65e){_0x16d65e=_0x16d65e||0xc8;return function(_0x2b0457){if(_0x2b0457){return _0x40043b[_0x97c5('0x17')](_0x16d65e)[_0x97c5('0x18')](_0x2b0457);}};}function respondWithFilteredResult(_0x3a7db5,_0x2b2a7c){return function(_0x3b2e49){if(_0x3b2e49){var _0x2ac994=typeof _0x2b2a7c['offset']===_0x97c5('0x19')&&typeof _0x2b2a7c['limit']===_0x97c5('0x19');var _0x240989=_0x3b2e49[_0x97c5('0x1a')];var _0x29ba7f=_0x2ac994?0x0:_0x2b2a7c[_0x97c5('0x1b')];var _0x5b8ebc=_0x2ac994?_0x3b2e49[_0x97c5('0x1a')]:_0x2b2a7c['offset']+_0x2b2a7c[_0x97c5('0x1c')];var _0x5d276f;if(_0x5b8ebc>=_0x240989){_0x5b8ebc=_0x240989;_0x5d276f=0xc8;}else{_0x5d276f=0xce;}_0x3a7db5[_0x97c5('0x17')](_0x5d276f);return _0x3a7db5[_0x97c5('0x1d')]('Content-Range',_0x29ba7f+'-'+_0x5b8ebc+'/'+_0x240989)[_0x97c5('0x18')](_0x3b2e49);}return null;};}function patchUpdates(_0x4eb0da){return function(_0x19651c){try{jsonpatch[_0x97c5('0x1e')](_0x19651c,_0x4eb0da,!![]);}catch(_0x3ecba3){return BPromise[_0x97c5('0x1f')](_0x3ecba3);}return _0x19651c[_0x97c5('0x20')]();};}function saveUpdates(_0x4bf3d6,_0x1fdac4){return function(_0x5b050a){if(_0x5b050a){return _0x5b050a[_0x97c5('0x21')](_0x4bf3d6)[_0x97c5('0x22')](function(_0x4c4c3a){return _0x4c4c3a;});}return null;};}function removeEntity(_0x1086c7,_0x4e8b28){return function(_0x2b5a6d){if(_0x2b5a6d){return _0x2b5a6d['destroy']()[_0x97c5('0x22')](function(){_0x1086c7[_0x97c5('0x17')](0xcc)[_0x97c5('0x23')]();});}};}function handleEntityNotFound(_0x393b85,_0x5e7a62){return function(_0x4199e3){if(!_0x4199e3){_0x393b85['sendStatus'](0x194);}return _0x4199e3;};}function handleError(_0x134b39,_0x539384){_0x539384=_0x539384||0x1f4;return function(_0x2c7db7){logger[_0x97c5('0x24')](_0x2c7db7[_0x97c5('0x25')]);if(_0x2c7db7[_0x97c5('0x26')]){delete _0x2c7db7[_0x97c5('0x26')];}_0x134b39[_0x97c5('0x17')](_0x539384)[_0x97c5('0x27')](_0x2c7db7);};}exports['show']=function(_0x1ef72a,_0x2a3878){var _0x49fc66={'raw':!![],'where':{'id':_0x1ef72a[_0x97c5('0x28')]['id']}},_0x3f0f84={};_0x3f0f84[_0x97c5('0x29')]=_[_0x97c5('0x2a')](db[_0x97c5('0x2b')][_0x97c5('0x2c')]);_0x3f0f84['query']=_[_0x97c5('0x2a')](_0x1ef72a['query']);_0x3f0f84[_0x97c5('0x2d')]=_['intersection'](_0x3f0f84[_0x97c5('0x29')],_0x3f0f84[_0x97c5('0x2e')]);_0x49fc66[_0x97c5('0x2f')]=_[_0x97c5('0x30')](_0x3f0f84[_0x97c5('0x29')],qs[_0x97c5('0x31')](_0x1ef72a[_0x97c5('0x2e')]['fields']));_0x49fc66['attributes']=_0x49fc66['attributes']['length']?_0x49fc66['attributes']:_0x3f0f84[_0x97c5('0x29')];if(_0x1ef72a[_0x97c5('0x2e')]['includeAll']){_0x49fc66[_0x97c5('0x32')]=[{'all':!![]}];}_0x49fc66=_[_0x97c5('0x33')]({},_0x49fc66,_0x1ef72a[_0x97c5('0x34')]);return db['ChatApplication']['find'](_0x49fc66)[_0x97c5('0x22')](handleEntityNotFound(_0x2a3878,null))['then'](respondWithResult(_0x2a3878,null))[_0x97c5('0x35')](handleError(_0x2a3878,null));};exports['update']=function(_0x17819a,_0xf796c9){if(_0x17819a[_0x97c5('0x36')]['id']){delete _0x17819a['body']['id'];}return db[_0x97c5('0x2b')][_0x97c5('0x37')]({'where':{'id':_0x17819a['params']['id']}})[_0x97c5('0x22')](handleEntityNotFound(_0xf796c9,null))[_0x97c5('0x22')](saveUpdates(_0x17819a[_0x97c5('0x36')],null))['then'](respondWithResult(_0xf796c9,null))[_0x97c5('0x35')](handleError(_0xf796c9,null));};exports[_0x97c5('0x38')]=function(_0x5cb787,_0x4dbcb1){return db[_0x97c5('0x2b')]['find']({'where':{'id':_0x5cb787[_0x97c5('0x28')]['id']}})[_0x97c5('0x22')](handleEntityNotFound(_0x4dbcb1,null))[_0x97c5('0x22')](removeEntity(_0x4dbcb1,null))[_0x97c5('0x35')](handleError(_0x4dbcb1,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c80b007..a4eede2 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 _0xac05=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','utf8mb4'];(function(_0x443383,_0x11d7b9){var _0x10552c=function(_0x47ff7e){while(--_0x47ff7e){_0x443383['push'](_0x443383['shift']());}};_0x10552c(++_0x11d7b9);}(_0xac05,0x1c3));var _0x5ac0=function(_0x4265fb,_0x5cc20a){_0x4265fb=_0x4265fb-0x0;var _0x295c3f=_0xac05[_0x4265fb];return _0x295c3f;};'use strict';var _=require(_0x5ac0('0x0'));var util=require(_0x5ac0('0x1'));var logger=require(_0x5ac0('0x2'))(_0x5ac0('0x3'));var moment=require(_0x5ac0('0x4'));var BPromise=require(_0x5ac0('0x5'));var rp=require(_0x5ac0('0x6'));var fs=require('fs');var path=require(_0x5ac0('0x7'));var rimraf=require(_0x5ac0('0x8'));var config=require(_0x5ac0('0x9'));var attributes=require('./chatApplication.attributes');module[_0x5ac0('0xa')]=function(_0xfcf73e,_0x5ca7e4){return _0xfcf73e[_0x5ac0('0xb')](_0x5ac0('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ac0('0xd'),'collate':_0x5ac0('0xe')});}; \ No newline at end of file +var _0x0dc1=['../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x45a55e,_0x426f6c){var _0x5008e1=function(_0x5b9a28){while(--_0x5b9a28){_0x45a55e['push'](_0x45a55e['shift']());}};_0x5008e1(++_0x426f6c);}(_0x0dc1,0x198));var _0x10dc=function(_0x3798d1,_0x50d6de){_0x3798d1=_0x3798d1-0x0;var _0x3512a8=_0x0dc1[_0x3798d1];return _0x3512a8;};'use strict';var _=require('lodash');var util=require(_0x10dc('0x0'));var logger=require(_0x10dc('0x1'))(_0x10dc('0x2'));var moment=require(_0x10dc('0x3'));var BPromise=require(_0x10dc('0x4'));var rp=require(_0x10dc('0x5'));var fs=require('fs');var path=require(_0x10dc('0x6'));var rimraf=require(_0x10dc('0x7'));var config=require(_0x10dc('0x8'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x1eb796,_0x34582a){return _0x1eb796[_0x10dc('0x9')](_0x10dc('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10dc('0xb'),'collate':_0x10dc('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index e55c951..489d078 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 _0x868b=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x868b,0x18e));var _0xb868=function(_0x41e7ea,_0x463af6){_0x41e7ea=_0x41e7ea-0x0;var _0x6a81e2=_0x868b[_0x41e7ea];return _0x6a81e2;};'use strict';var _=require('lodash');var util=require(_0xb868('0x0'));var moment=require(_0xb868('0x1'));var BPromise=require(_0xb868('0x2'));var rs=require(_0xb868('0x3'));var fs=require('fs');var Redis=require(_0xb868('0x4'));var db=require(_0xb868('0x5'))['db'];var utils=require(_0xb868('0x6'));var logger=require(_0xb868('0x7'))(_0xb868('0x8'));var config=require(_0xb868('0x9'));var jayson=require(_0xb868('0xa'));var client=jayson['client'][_0xb868('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6e1f,_0x1a6b28,_0x20279c){return new BPromise(function(_0xc7ab6d,_0x5c2096){return client[_0xb868('0xc')](_0x4c6e1f,_0x20279c)['then'](function(_0x3b8d00){logger[_0xb868('0xd')]('ChatApplication,\x20%s,\x20%s',_0x1a6b28,_0xb868('0xe'));logger[_0xb868('0xf')](_0xb868('0x10'),_0x1a6b28,'request\x20sent',JSON[_0xb868('0x11')](_0x3b8d00));if(_0x3b8d00['error']){if(_0x3b8d00[_0xb868('0x12')][_0xb868('0x13')]===0x1f4){logger[_0xb868('0x12')](_0xb868('0x14'),_0x1a6b28,_0x3b8d00[_0xb868('0x12')][_0xb868('0x15')]);return _0x5c2096(_0x3b8d00[_0xb868('0x12')]['message']);}logger[_0xb868('0x12')]('ChatApplication,\x20%s,\x20%s',_0x1a6b28,_0x3b8d00[_0xb868('0x12')][_0xb868('0x15')]);return _0xc7ab6d(_0x3b8d00[_0xb868('0x12')]['message']);}else{logger[_0xb868('0xd')]('ChatApplication,\x20%s,\x20%s',_0x1a6b28,_0xb868('0xe'));_0xc7ab6d(_0x3b8d00[_0xb868('0x16')][_0xb868('0x15')]);}})['catch'](function(_0x4ce44e){logger['error'](_0xb868('0x14'),_0x1a6b28,_0x4ce44e);_0x5c2096(_0x4ce44e);});});} \ No newline at end of file +var _0xb8e6=['error','code','message','info','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3c45b4,_0x1941cf){var _0x73361f=function(_0x1ab007){while(--_0x1ab007){_0x3c45b4['push'](_0x3c45b4['shift']());}};_0x73361f(++_0x1941cf);}(_0xb8e6,0x155));var _0x6b8e=function(_0x3aff76,_0x1e8c96){_0x3aff76=_0x3aff76-0x0;var _0x1a37c1=_0xb8e6[_0x3aff76];return _0x1a37c1;};'use strict';var _=require(_0x6b8e('0x0'));var util=require(_0x6b8e('0x1'));var moment=require(_0x6b8e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b8e('0x3'))['db'];var utils=require(_0x6b8e('0x4'));var logger=require(_0x6b8e('0x5'))(_0x6b8e('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b8e('0x7'));var client=jayson[_0x6b8e('0x8')][_0x6b8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e2f4e,_0x549f48,_0x523eb9){return new BPromise(function(_0x4666e4,_0x29a752){return client[_0x6b8e('0xa')](_0x1e2f4e,_0x523eb9)[_0x6b8e('0xb')](function(_0x4e0c62){logger['info'](_0x6b8e('0xc'),_0x549f48,_0x6b8e('0xd'));logger[_0x6b8e('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x549f48,'request\x20sent',JSON[_0x6b8e('0xf')](_0x4e0c62));if(_0x4e0c62[_0x6b8e('0x10')]){if(_0x4e0c62['error'][_0x6b8e('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x549f48,_0x4e0c62[_0x6b8e('0x10')][_0x6b8e('0x12')]);return _0x29a752(_0x4e0c62['error'][_0x6b8e('0x12')]);}logger[_0x6b8e('0x10')](_0x6b8e('0xc'),_0x549f48,_0x4e0c62[_0x6b8e('0x10')][_0x6b8e('0x12')]);return _0x4666e4(_0x4e0c62[_0x6b8e('0x10')][_0x6b8e('0x12')]);}else{logger[_0x6b8e('0x13')](_0x6b8e('0xc'),_0x549f48,'request\x20sent');_0x4666e4(_0x4e0c62['result'][_0x6b8e('0x12')]);}})[_0x6b8e('0x14')](function(_0x476f8a){logger[_0x6b8e('0x10')]('ChatApplication,\x20%s,\x20%s',_0x549f48,_0x476f8a);_0x29a752(_0x476f8a);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e4b6e41..88bfdf6 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 _0x7707=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show','put','isAuthenticated','/:id','destroy','exports','util','connect-timeout','express'];(function(_0x4bb5d5,_0xdbdf58){var _0x7b0473=function(_0x2b529e){while(--_0x2b529e){_0x4bb5d5['push'](_0x4bb5d5['shift']());}};_0x7b0473(++_0xdbdf58);}(_0x7707,0xfd));var _0x7770=function(_0x58326d,_0x390169){_0x58326d=_0x58326d-0x0;var _0x25d24b=_0x7707[_0x58326d];return _0x25d24b;};'use strict';var multer=require('multer');var util=require(_0x7770('0x0'));var path=require('path');var timeout=require(_0x7770('0x1'));var express=require(_0x7770('0x2'));var router=express[_0x7770('0x3')]();var fs_extra=require(_0x7770('0x4'));var auth=require(_0x7770('0x5'));var interaction=require(_0x7770('0x6'));var config=require(_0x7770('0x7'));var controller=require(_0x7770('0x8'));router[_0x7770('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7770('0xa')]);router[_0x7770('0xb')]('/:id',auth[_0x7770('0xc')](),controller['update']);router['delete'](_0x7770('0xd'),auth[_0x7770('0xc')](),controller[_0x7770('0xe')]);module[_0x7770('0xf')]=router; \ No newline at end of file +var _0x78f6=['isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0xdfc87d,_0x28e1a5){var _0x4e2a5e=function(_0x55f2f7){while(--_0x55f2f7){_0xdfc87d['push'](_0xdfc87d['shift']());}};_0x4e2a5e(++_0x28e1a5);}(_0x78f6,0x1cf));var _0x678f=function(_0x4bb97f,_0x1ea76){_0x4bb97f=_0x4bb97f-0x0;var _0x465b49=_0x78f6[_0x4bb97f];return _0x465b49;};'use strict';var multer=require(_0x678f('0x0'));var util=require(_0x678f('0x1'));var path=require(_0x678f('0x2'));var timeout=require(_0x678f('0x3'));var express=require(_0x678f('0x4'));var router=express['Router']();var fs_extra=require(_0x678f('0x5'));var auth=require(_0x678f('0x6'));var interaction=require(_0x678f('0x7'));var config=require(_0x678f('0x8'));var controller=require(_0x678f('0x9'));router[_0x678f('0xa')](_0x678f('0xb'),auth[_0x678f('0xc')](),controller[_0x678f('0xd')]);router[_0x678f('0xe')](_0x678f('0xb'),auth[_0x678f('0xc')](),controller[_0x678f('0xf')]);router[_0x678f('0x10')]('/:id',auth[_0x678f('0xc')](),controller[_0x678f('0x11')]);module[_0x678f('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index b64c0d4..ac6a3db 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 _0xb3f9=['exports','BOOLEAN','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x619848,_0xbe695d){_0x619848=_0x619848-0x0;var _0x5887fb=_0xb3f9[_0x619848];return _0x5887fb;};'use strict';var Sequelize=require(_0x9b3f('0x0'));module[_0x9b3f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9b3f('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4c23=['sequelize','exports','BOOLEAN'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4c23,0x138));var _0x34c2=function(_0x11146c,_0x4f743d){_0x11146c=_0x11146c-0x0;var _0x33823f=_0x4c23[_0x11146c];return _0x33823f;};'use strict';var Sequelize=require(_0x34c2('0x0'));module[_0x34c2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x34c2('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 16c6d56..c7d7867 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 _0x6a4e=['save','destroy','then','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','options','includeAll','include','catch','show','params','rawAttributes','merge','find','create','body','update','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','findOne','User','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0xd0d704,_0x17b971){var _0x2161a8=function(_0x42fd9b){while(--_0x42fd9b){_0xd0d704['push'](_0xd0d704['shift']());}};_0x2161a8(++_0x17b971);}(_0x6a4e,0x9a));var _0xe6a4=function(_0x168a13,_0x509ea8){_0x168a13=_0x168a13-0x0;var _0x590f06=_0x6a4e[_0x168a13];return _0x590f06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6a4('0x0'));var zipdir=require(_0xe6a4('0x1'));var jsonpatch=require(_0xe6a4('0x2'));var rp=require(_0xe6a4('0x3'));var moment=require(_0xe6a4('0x4'));var BPromise=require(_0xe6a4('0x5'));var Mustache=require(_0xe6a4('0x6'));var util=require('util');var path=require(_0xe6a4('0x7'));var sox=require(_0xe6a4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6a4('0x9'));var _=require(_0xe6a4('0xa'));var squel=require(_0xe6a4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6a4('0xc'));var toCsv=require(_0xe6a4('0xd'));var querystring=require(_0xe6a4('0xe'));var Papa=require(_0xe6a4('0xf'));var Redis=require(_0xe6a4('0x10'));var authService=require(_0xe6a4('0x11'));var qs=require(_0xe6a4('0x12'));var as=require(_0xe6a4('0x13'));var hardwareService=require(_0xe6a4('0x14'));var logger=require('../../config/logger')(_0xe6a4('0x15'));var utils=require(_0xe6a4('0x16'));var config=require(_0xe6a4('0x17'));var licenseUtil=require(_0xe6a4('0x18'));var db=require(_0xe6a4('0x19'))['db'];config[_0xe6a4('0x1a')]=_[_0xe6a4('0x1b')](config[_0xe6a4('0x1a')],{'host':_0xe6a4('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6a4('0x1a')]));require(_0xe6a4('0x1d'))[_0xe6a4('0x1e')](socket);function respondWithStatusCode(_0x152950,_0x5d5692){_0x5d5692=_0x5d5692||0xcc;return function(_0x4c3369){if(_0x4c3369){return _0x152950[_0xe6a4('0x1f')](_0x5d5692);}return _0x152950[_0xe6a4('0x20')](_0x5d5692)[_0xe6a4('0x21')]();};}function respondWithResult(_0xff0ae3,_0x2aacef){_0x2aacef=_0x2aacef||0xc8;return function(_0x421220){if(_0x421220){return _0xff0ae3['status'](_0x2aacef)[_0xe6a4('0x22')](_0x421220);}};}function respondWithFilteredResult(_0x4deb7d,_0x1446ca){return function(_0x4a1233){if(_0x4a1233){var _0x109b8f=typeof _0x1446ca[_0xe6a4('0x23')]===_0xe6a4('0x24')&&typeof _0x1446ca['limit']===_0xe6a4('0x24');var _0xb3ee22=_0x4a1233[_0xe6a4('0x25')];var _0xdae3be=_0x109b8f?0x0:_0x1446ca['offset'];var _0x52341a=_0x109b8f?_0x4a1233[_0xe6a4('0x25')]:_0x1446ca[_0xe6a4('0x23')]+_0x1446ca[_0xe6a4('0x26')];var _0x23b652;if(_0x52341a>=_0xb3ee22){_0x52341a=_0xb3ee22;_0x23b652=0xc8;}else{_0x23b652=0xce;}_0x4deb7d[_0xe6a4('0x20')](_0x23b652);return _0x4deb7d[_0xe6a4('0x27')](_0xe6a4('0x28'),_0xdae3be+'-'+_0x52341a+'/'+_0xb3ee22)[_0xe6a4('0x22')](_0x4a1233);}return null;};}function patchUpdates(_0x394f37){return function(_0xf9d7c9){try{jsonpatch['apply'](_0xf9d7c9,_0x394f37,!![]);}catch(_0x2cb7df){return BPromise[_0xe6a4('0x29')](_0x2cb7df);}return _0xf9d7c9[_0xe6a4('0x2a')]();};}function saveUpdates(_0x223160,_0x313a0d){return function(_0x2bdccb){if(_0x2bdccb){return _0x2bdccb['update'](_0x223160)['then'](function(_0x2fe1b1){return _0x2fe1b1;});}return null;};}function removeEntity(_0x76f0c1,_0x1c1954){return function(_0x561dd1){if(_0x561dd1){return _0x561dd1[_0xe6a4('0x2b')]()[_0xe6a4('0x2c')](function(){_0x76f0c1[_0xe6a4('0x20')](0xcc)[_0xe6a4('0x21')]();});}};}function handleEntityNotFound(_0x1ca5b9,_0x56c71b){return function(_0x349ff9){if(!_0x349ff9){_0x1ca5b9['sendStatus'](0x194);}return _0x349ff9;};}function handleError(_0x443a3b,_0xb222d1){_0xb222d1=_0xb222d1||0x1f4;return function(_0x2607d8){logger['error'](_0x2607d8[_0xe6a4('0x2d')]);if(_0x2607d8[_0xe6a4('0x2e')]){delete _0x2607d8[_0xe6a4('0x2e')];}_0x443a3b[_0xe6a4('0x20')](_0xb222d1)[_0xe6a4('0x2f')](_0x2607d8);};}exports[_0xe6a4('0x30')]=function(_0x1faf35,_0x413235){var _0x51c94d={},_0x5a3275={},_0x5862d8={'count':0x0,'rows':[]};var _0x233660=_[_0xe6a4('0x31')](db[_0xe6a4('0x32')]['rawAttributes'],function(_0x242d5c){return{'name':_0x242d5c[_0xe6a4('0x33')],'type':_0x242d5c[_0xe6a4('0x34')][_0xe6a4('0x35')]};});_0x5a3275[_0xe6a4('0x36')]=_[_0xe6a4('0x31')](_0x233660,'name');_0x5a3275['query']=_[_0xe6a4('0x37')](_0x1faf35[_0xe6a4('0x38')]);_0x5a3275[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0x5a3275['model'],_0x5a3275[_0xe6a4('0x38')]);_0x51c94d[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0x5a3275[_0xe6a4('0x36')],qs['fields'](_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x3c')]));_0x51c94d[_0xe6a4('0x3b')]=_0x51c94d[_0xe6a4('0x3b')][_0xe6a4('0x3d')]?_0x51c94d[_0xe6a4('0x3b')]:_0x5a3275[_0xe6a4('0x36')];if(!_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x3e')]('nolimit')){_0x51c94d['limit']=qs[_0xe6a4('0x26')](_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x26')]);_0x51c94d[_0xe6a4('0x23')]=qs[_0xe6a4('0x23')](_0x1faf35[_0xe6a4('0x38')]['offset']);}_0x51c94d[_0xe6a4('0x3f')]=qs[_0xe6a4('0x40')](_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x40')]);_0x51c94d['where']=qs['filters'](_['pick'](_0x1faf35[_0xe6a4('0x38')],_0x5a3275[_0xe6a4('0x39')]),_0x233660);if(_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x41')]){_0x51c94d[_0xe6a4('0x42')]=_['merge'](_0x51c94d[_0xe6a4('0x42')],{'$or':_[_0xe6a4('0x31')](_0x233660,function(_0x131f13){if(_0x131f13[_0xe6a4('0x34')]!=='VIRTUAL'){var _0x11f7ec={};_0x11f7ec[_0x131f13[_0xe6a4('0x2e')]]={'$like':'%'+_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x41')]+'%'};return _0x11f7ec;}})});}_0x51c94d=_['merge']({},_0x51c94d,_0x1faf35[_0xe6a4('0x43')]);var _0xacbf93={'where':_0x51c94d[_0xe6a4('0x42')]};return db[_0xe6a4('0x32')][_0xe6a4('0x25')](_0xacbf93)[_0xe6a4('0x2c')](function(_0x1138a8){_0x5862d8['count']=_0x1138a8;if(_0x1faf35[_0xe6a4('0x38')][_0xe6a4('0x44')]){_0x51c94d[_0xe6a4('0x45')]=[{'all':!![]}];}return db[_0xe6a4('0x32')]['findAll'](_0x51c94d);})['then'](function(_0x5ab920){_0x5862d8['rows']=_0x5ab920;return _0x5862d8;})[_0xe6a4('0x2c')](respondWithFilteredResult(_0x413235,_0x51c94d))[_0xe6a4('0x46')](handleError(_0x413235,null));};exports[_0xe6a4('0x47')]=function(_0x242846,_0x46426d){var _0x2ca174={'raw':!![],'where':{'id':_0x242846[_0xe6a4('0x48')]['id']}},_0x1bcff4={};_0x1bcff4[_0xe6a4('0x36')]=_[_0xe6a4('0x37')](db['ChatGroup'][_0xe6a4('0x49')]);_0x1bcff4[_0xe6a4('0x38')]=_['keys'](_0x242846[_0xe6a4('0x38')]);_0x1bcff4[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0x1bcff4[_0xe6a4('0x36')],_0x1bcff4['query']);_0x2ca174[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0x1bcff4['model'],qs['fields'](_0x242846['query']['fields']));_0x2ca174[_0xe6a4('0x3b')]=_0x2ca174['attributes']['length']?_0x2ca174[_0xe6a4('0x3b')]:_0x1bcff4[_0xe6a4('0x36')];if(_0x242846[_0xe6a4('0x38')][_0xe6a4('0x44')]){_0x2ca174['include']=[{'all':!![]}];}_0x2ca174=_[_0xe6a4('0x4a')]({},_0x2ca174,_0x242846['options']);return db['ChatGroup'][_0xe6a4('0x4b')](_0x2ca174)[_0xe6a4('0x2c')](handleEntityNotFound(_0x46426d,null))[_0xe6a4('0x2c')](respondWithResult(_0x46426d,null))[_0xe6a4('0x46')](handleError(_0x46426d,null));};exports[_0xe6a4('0x4c')]=function(_0x474b2c,_0x2e7ab5){return db[_0xe6a4('0x32')][_0xe6a4('0x4c')](_0x474b2c[_0xe6a4('0x4d')],{})[_0xe6a4('0x2c')](respondWithResult(_0x2e7ab5,0xc9))[_0xe6a4('0x46')](handleError(_0x2e7ab5,null));};exports[_0xe6a4('0x4e')]=function(_0x7d8067,_0x1b56a8){if(_0x7d8067[_0xe6a4('0x4d')]['id']){delete _0x7d8067['body']['id'];}return db[_0xe6a4('0x32')][_0xe6a4('0x4b')]({'where':{'id':_0x7d8067[_0xe6a4('0x48')]['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x1b56a8,null))['then'](saveUpdates(_0x7d8067[_0xe6a4('0x4d')],null))[_0xe6a4('0x2c')](respondWithResult(_0x1b56a8,null))[_0xe6a4('0x46')](handleError(_0x1b56a8,null));};exports[_0xe6a4('0x2b')]=function(_0x305c03,_0xec7f70){return db['ChatGroup'][_0xe6a4('0x4b')]({'where':{'id':_0x305c03[_0xe6a4('0x48')]['id']}})['then'](handleEntityNotFound(_0xec7f70,null))['then'](removeEntity(_0xec7f70,null))[_0xe6a4('0x46')](handleError(_0xec7f70,null));};exports[_0xe6a4('0x4f')]=function(_0x330e64,_0x57fc11){return db['ChatGroup'][_0xe6a4('0x4f')]()[_0xe6a4('0x2c')](respondWithResult(_0x57fc11,null))[_0xe6a4('0x46')](handleError(_0x57fc11,null));};exports['getUnread']=function(_0x5eddb1,_0x182a09,_0x488e89){return db[_0xe6a4('0x50')][_0xe6a4('0x25')]({'where':{'ChatGroupId':_0x5eddb1[_0xe6a4('0x48')]['id'],'ToId':_0x5eddb1[_0xe6a4('0x51')]['id'],'read':![]}})[_0xe6a4('0x2c')](function(_0xf3f516){return{'id':_[_0xe6a4('0x52')](_0x5eddb1['params']['id']),'count':_0xf3f516};})[_0xe6a4('0x2c')](respondWithResult(_0x182a09,null))[_0xe6a4('0x46')](handleError(_0x182a09,null));};exports[_0xe6a4('0x53')]=function(_0x5dcba5,_0xdce09a,_0x3765c6){return db[_0xe6a4('0x32')][_0xe6a4('0x4b')]({'where':{'id':_0x5dcba5['params']['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0xdce09a,null))[_0xe6a4('0x2c')](function(_0x425763){if(_0x425763){return _0x425763[_0xe6a4('0x53')](_0x5dcba5['body']['ids'],_[_0xe6a4('0x54')](_0x5dcba5[_0xe6a4('0x4d')],[_0xe6a4('0x55'),'id'])||{});}})['then'](respondWithResult(_0xdce09a,null))[_0xe6a4('0x46')](handleError(_0xdce09a,null));};exports['getMembers']=function(_0x5885ce,_0x1c55a0,_0x6b1b47){var _0x403ea0={};var _0xf56a0c={};var _0x1ebc6a;var _0x237663;return db[_0xe6a4('0x32')][_0xe6a4('0x56')]({'where':{'id':_0x5885ce[_0xe6a4('0x48')]['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x1c55a0,null))[_0xe6a4('0x2c')](function(_0x2eaf69){if(_0x2eaf69){_0x1ebc6a=_0x2eaf69;_0xf56a0c['model']=_['keys'](db[_0xe6a4('0x57')][_0xe6a4('0x49')]);_0xf56a0c['query']=_[_0xe6a4('0x37')](_0x5885ce['query']);_0xf56a0c[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0xf56a0c[_0xe6a4('0x36')],_0xf56a0c['query']);_0x403ea0[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0xf56a0c[_0xe6a4('0x36')],qs[_0xe6a4('0x3c')](_0x5885ce['query'][_0xe6a4('0x3c')]));_0x403ea0['attributes']=_0x403ea0['attributes']['length']?_0x403ea0['attributes']:_0xf56a0c['model'];_0x403ea0[_0xe6a4('0x3f')]=qs[_0xe6a4('0x40')](_0x5885ce[_0xe6a4('0x38')]['sort']);_0x403ea0[_0xe6a4('0x42')]=qs[_0xe6a4('0x39')](_['pick'](_0x5885ce[_0xe6a4('0x38')],_0xf56a0c[_0xe6a4('0x39')]));if(_0x5885ce[_0xe6a4('0x38')]['filter']){_0x403ea0[_0xe6a4('0x42')]=_[_0xe6a4('0x4a')](_0x403ea0[_0xe6a4('0x42')],{'$or':_[_0xe6a4('0x31')](_0x403ea0['attributes'],function(_0x4105a0){var _0x10aa7d={};_0x10aa7d[_0x4105a0]={'$like':'%'+_0x5885ce[_0xe6a4('0x38')][_0xe6a4('0x41')]+'%'};return _0x10aa7d;})});}_0x403ea0=_[_0xe6a4('0x4a')]({},_0x403ea0,_0x5885ce[_0xe6a4('0x43')]);return _0x1ebc6a[_0xe6a4('0x58')](_0x403ea0);}})['then'](function(_0x2acc94){if(_0x2acc94){_0x237663=_0x2acc94[_0xe6a4('0x3d')];if(!_0x5885ce[_0xe6a4('0x38')][_0xe6a4('0x3e')](_0xe6a4('0x59'))){_0x403ea0[_0xe6a4('0x26')]=qs[_0xe6a4('0x26')](_0x5885ce['query'][_0xe6a4('0x26')]);_0x403ea0[_0xe6a4('0x23')]=qs['offset'](_0x5885ce['query'][_0xe6a4('0x23')]);}return _0x1ebc6a[_0xe6a4('0x58')](_0x403ea0);}})[_0xe6a4('0x2c')](function(_0x1e7984){if(_0x1e7984){return _0x1e7984?{'count':_0x237663,'rows':_0x1e7984}:null;}})[_0xe6a4('0x2c')](respondWithResult(_0x1c55a0,null))['catch'](handleError(_0x1c55a0,null));};exports[_0xe6a4('0x5a')]=function(_0x507708,_0x1ae0f7,_0x24c832){return db['ChatGroup'][_0xe6a4('0x4b')]({'where':{'id':_0x507708['params']['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x1ae0f7,null))[_0xe6a4('0x2c')](function(_0xc00984){if(_0xc00984){return _0xc00984[_0xe6a4('0x5a')](_0x507708[_0xe6a4('0x38')][_0xe6a4('0x55')]);}})[_0xe6a4('0x2c')](respondWithStatusCode(_0x1ae0f7,null))[_0xe6a4('0x46')](handleError(_0x1ae0f7,null));};exports[_0xe6a4('0x5b')]=function(_0x347d3b,_0x4912ba,_0x8dabb8){if(_0x347d3b[_0xe6a4('0x4d')]['id']){delete _0x347d3b[_0xe6a4('0x4d')]['id'];}return db['ChatGroup'][_0xe6a4('0x4b')]({'where':{'id':_0x347d3b[_0xe6a4('0x48')]['id']}})[_0xe6a4('0x2c')](handleEntityNotFound(_0x4912ba,null))[_0xe6a4('0x2c')](function(_0x12a923){if(_0x12a923){_0x347d3b[_0xe6a4('0x4d')][_0xe6a4('0x5c')]=_0x12a923['id'];return db[_0xe6a4('0x50')][_0xe6a4('0x4c')](_0x347d3b[_0xe6a4('0x4d')]);}})[_0xe6a4('0x2c')](respondWithResult(_0x4912ba,null))['catch'](handleError(_0x4912ba,null));};exports[_0xe6a4('0x5d')]=function(_0x1b8a4e,_0x27db05,_0x538aa5){var _0x5b32e9={};var _0x4cd347={};var _0x32d1f6;var _0x26bd70;return db[_0xe6a4('0x32')]['findOne']({'where':{'id':_0x1b8a4e['params']['id']}})['then'](handleEntityNotFound(_0x27db05,null))['then'](function(_0x2798a9){if(_0x2798a9){_0x32d1f6=_0x2798a9;_0x4cd347[_0xe6a4('0x36')]=_[_0xe6a4('0x37')](db[_0xe6a4('0x50')]['rawAttributes']);_0x4cd347['query']=_[_0xe6a4('0x37')](_0x1b8a4e[_0xe6a4('0x38')]);_0x4cd347[_0xe6a4('0x39')]=_[_0xe6a4('0x3a')](_0x4cd347[_0xe6a4('0x36')],_0x4cd347[_0xe6a4('0x38')]);_0x5b32e9[_0xe6a4('0x3b')]=_[_0xe6a4('0x3a')](_0x4cd347[_0xe6a4('0x36')],qs[_0xe6a4('0x3c')](_0x1b8a4e['query'][_0xe6a4('0x3c')]));_0x5b32e9[_0xe6a4('0x3b')]=_0x5b32e9[_0xe6a4('0x3b')]['length']?_0x5b32e9[_0xe6a4('0x3b')]:_0x4cd347[_0xe6a4('0x36')];_0x5b32e9['order']=qs[_0xe6a4('0x40')](_0x1b8a4e[_0xe6a4('0x38')]['sort']);_0x5b32e9[_0xe6a4('0x42')]=qs[_0xe6a4('0x39')](_[_0xe6a4('0x5e')](_0x1b8a4e[_0xe6a4('0x38')],_0x4cd347[_0xe6a4('0x39')]));if(_0x1b8a4e['query'][_0xe6a4('0x41')]){_0x5b32e9['where']=_['merge'](_0x5b32e9[_0xe6a4('0x42')],{'$or':_[_0xe6a4('0x31')](_0x5b32e9[_0xe6a4('0x3b')],function(_0x44df43){var _0x3e2a10={};_0x3e2a10[_0x44df43]={'$like':'%'+_0x1b8a4e['query'][_0xe6a4('0x41')]+'%'};return _0x3e2a10;})});}if(_0x1b8a4e[_0xe6a4('0x38')][_0xe6a4('0x5f')]){var _0xd0dc74=_0x1b8a4e[_0xe6a4('0x38')][_0xe6a4('0x5f')][_0xe6a4('0x60')](',');var _0x5a1cab={};_0x5a1cab[_0xd0dc74[0x0]]={'$gte':moment(_0xd0dc74[0x1])[_0xe6a4('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b32e9['where']=_[_0xe6a4('0x4a')](_0x5b32e9[_0xe6a4('0x42')],_0x5a1cab);}_0x5b32e9=_[_0xe6a4('0x4a')]({},_0x5b32e9,_0x1b8a4e['options']);return _0x32d1f6[_0xe6a4('0x5d')](_0x5b32e9);}})['then'](function(_0x3f09f1){if(_0x3f09f1){_0x26bd70=_0x3f09f1[_0xe6a4('0x3d')];if(!_0x1b8a4e[_0xe6a4('0x38')]['hasOwnProperty'](_0xe6a4('0x59'))){_0x5b32e9[_0xe6a4('0x26')]=qs[_0xe6a4('0x26')](_0x1b8a4e[_0xe6a4('0x38')][_0xe6a4('0x26')]);_0x5b32e9['offset']=qs[_0xe6a4('0x23')](_0x1b8a4e['query'][_0xe6a4('0x23')]);}return _0x32d1f6[_0xe6a4('0x5d')](_0x5b32e9);}})[_0xe6a4('0x2c')](function(_0x18d151){if(_0x18d151){return _0x18d151?{'count':_0x26bd70,'rows':_0x18d151}:null;}})[_0xe6a4('0x2c')](respondWithResult(_0x27db05,null))[_0xe6a4('0x46')](handleError(_0x27db05,null));}; \ No newline at end of file +var _0x4d95=['order','pick','where','merge','VIRTUAL','name','filter','ChatGroup','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','update','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','User','sort','getMembers','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','rimraf','fast-json-patch','request-promise','moment','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','end','sendStatus','error','send','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x492219,_0x536478){var _0x5bdbce=function(_0x404454){while(--_0x404454){_0x492219['push'](_0x492219['shift']());}};_0x5bdbce(++_0x536478);}(_0x4d95,0x1a5));var _0x54d9=function(_0x37f8cf,_0x364fb3){_0x37f8cf=_0x37f8cf-0x0;var _0x40f300=_0x4d95[_0x37f8cf];return _0x40f300;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54d9('0x1'));var rp=require(_0x54d9('0x2'));var moment=require(_0x54d9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x54d9('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x54d9('0x5'));var fs=require('fs');var fs_extra=require(_0x54d9('0x6'));var _=require(_0x54d9('0x7'));var squel=require(_0x54d9('0x8'));var crypto=require(_0x54d9('0x9'));var jsforce=require(_0x54d9('0xa'));var deskjs=require(_0x54d9('0xb'));var toCsv=require(_0x54d9('0xc'));var querystring=require(_0x54d9('0xd'));var Papa=require(_0x54d9('0xe'));var Redis=require(_0x54d9('0xf'));var authService=require(_0x54d9('0x10'));var qs=require(_0x54d9('0x11'));var as=require(_0x54d9('0x12'));var hardwareService=require(_0x54d9('0x13'));var logger=require(_0x54d9('0x14'))(_0x54d9('0x15'));var utils=require(_0x54d9('0x16'));var config=require(_0x54d9('0x17'));var licenseUtil=require(_0x54d9('0x18'));var db=require(_0x54d9('0x19'))['db'];config['redis']=_[_0x54d9('0x1a')](config['redis'],{'host':_0x54d9('0x1b'),'port':0x18eb});var socket=require(_0x54d9('0x1c'))(new Redis(config[_0x54d9('0x1d')]));require('./chatGroup.socket')[_0x54d9('0x1e')](socket);function respondWithStatusCode(_0xbea3b0,_0x4626cb){_0x4626cb=_0x4626cb||0xcc;return function(_0x32ace7){if(_0x32ace7){return _0xbea3b0['sendStatus'](_0x4626cb);}return _0xbea3b0[_0x54d9('0x1f')](_0x4626cb)['end']();};}function respondWithResult(_0x7edd6e,_0x376e14){_0x376e14=_0x376e14||0xc8;return function(_0x4f0dc4){if(_0x4f0dc4){return _0x7edd6e['status'](_0x376e14)['json'](_0x4f0dc4);}};}function respondWithFilteredResult(_0x17bf8c,_0x3df968){return function(_0x1ead03){if(_0x1ead03){var _0x4a5d55=typeof _0x3df968[_0x54d9('0x20')]===_0x54d9('0x21')&&typeof _0x3df968[_0x54d9('0x22')]===_0x54d9('0x21');var _0x83fa1d=_0x1ead03['count'];var _0x3bc0d8=_0x4a5d55?0x0:_0x3df968[_0x54d9('0x20')];var _0x3b2361=_0x4a5d55?_0x1ead03[_0x54d9('0x23')]:_0x3df968[_0x54d9('0x20')]+_0x3df968['limit'];var _0x5d0c71;if(_0x3b2361>=_0x83fa1d){_0x3b2361=_0x83fa1d;_0x5d0c71=0xc8;}else{_0x5d0c71=0xce;}_0x17bf8c[_0x54d9('0x1f')](_0x5d0c71);return _0x17bf8c[_0x54d9('0x24')](_0x54d9('0x25'),_0x3bc0d8+'-'+_0x3b2361+'/'+_0x83fa1d)['json'](_0x1ead03);}return null;};}function patchUpdates(_0x4cce6e){return function(_0x99ec80){try{jsonpatch[_0x54d9('0x26')](_0x99ec80,_0x4cce6e,!![]);}catch(_0x2af2fb){return BPromise[_0x54d9('0x27')](_0x2af2fb);}return _0x99ec80['save']();};}function saveUpdates(_0x4f8560,_0x41b644){return function(_0x282027){if(_0x282027){return _0x282027['update'](_0x4f8560)['then'](function(_0x5d2e86){return _0x5d2e86;});}return null;};}function removeEntity(_0x3a4c5d,_0x30efe1){return function(_0x38740c){if(_0x38740c){return _0x38740c[_0x54d9('0x28')]()[_0x54d9('0x29')](function(){_0x3a4c5d[_0x54d9('0x1f')](0xcc)[_0x54d9('0x2a')]();});}};}function handleEntityNotFound(_0x3f5780,_0x3ae28d){return function(_0x53ed34){if(!_0x53ed34){_0x3f5780[_0x54d9('0x2b')](0x194);}return _0x53ed34;};}function handleError(_0x8fc802,_0x5e0f50){_0x5e0f50=_0x5e0f50||0x1f4;return function(_0xee298e){logger[_0x54d9('0x2c')](_0xee298e['stack']);if(_0xee298e['name']){delete _0xee298e['name'];}_0x8fc802[_0x54d9('0x1f')](_0x5e0f50)[_0x54d9('0x2d')](_0xee298e);};}exports['index']=function(_0x338746,_0x495f9f){var _0x206680={},_0x11a4d0={},_0x4d4b1a={'count':0x0,'rows':[]};var _0x414a67=_[_0x54d9('0x2e')](db['ChatGroup'][_0x54d9('0x2f')],function(_0x4d489e){return{'name':_0x4d489e[_0x54d9('0x30')],'type':_0x4d489e[_0x54d9('0x31')]['key']};});_0x11a4d0['model']=_[_0x54d9('0x2e')](_0x414a67,'name');_0x11a4d0['query']=_[_0x54d9('0x32')](_0x338746[_0x54d9('0x33')]);_0x11a4d0[_0x54d9('0x34')]=_[_0x54d9('0x35')](_0x11a4d0[_0x54d9('0x36')],_0x11a4d0['query']);_0x206680[_0x54d9('0x37')]=_[_0x54d9('0x35')](_0x11a4d0[_0x54d9('0x36')],qs['fields'](_0x338746['query'][_0x54d9('0x38')]));_0x206680[_0x54d9('0x37')]=_0x206680[_0x54d9('0x37')][_0x54d9('0x39')]?_0x206680[_0x54d9('0x37')]:_0x11a4d0['model'];if(!_0x338746[_0x54d9('0x33')][_0x54d9('0x3a')]('nolimit')){_0x206680[_0x54d9('0x22')]=qs[_0x54d9('0x22')](_0x338746['query'][_0x54d9('0x22')]);_0x206680[_0x54d9('0x20')]=qs[_0x54d9('0x20')](_0x338746[_0x54d9('0x33')][_0x54d9('0x20')]);}_0x206680[_0x54d9('0x3b')]=qs['sort'](_0x338746[_0x54d9('0x33')]['sort']);_0x206680['where']=qs[_0x54d9('0x34')](_[_0x54d9('0x3c')](_0x338746[_0x54d9('0x33')],_0x11a4d0[_0x54d9('0x34')]),_0x414a67);if(_0x338746[_0x54d9('0x33')]['filter']){_0x206680[_0x54d9('0x3d')]=_[_0x54d9('0x3e')](_0x206680[_0x54d9('0x3d')],{'$or':_['map'](_0x414a67,function(_0x1204a1){if(_0x1204a1[_0x54d9('0x31')]!==_0x54d9('0x3f')){var _0x7c5ae0={};_0x7c5ae0[_0x1204a1[_0x54d9('0x40')]]={'$like':'%'+_0x338746[_0x54d9('0x33')][_0x54d9('0x41')]+'%'};return _0x7c5ae0;}})});}_0x206680=_['merge']({},_0x206680,_0x338746['options']);var _0x276fd6={'where':_0x206680['where']};return db[_0x54d9('0x42')][_0x54d9('0x23')](_0x276fd6)['then'](function(_0x20b0dc){_0x4d4b1a['count']=_0x20b0dc;if(_0x338746[_0x54d9('0x33')]['includeAll']){_0x206680['include']=[{'all':!![]}];}return db[_0x54d9('0x42')][_0x54d9('0x43')](_0x206680);})['then'](function(_0x2a23ee){_0x4d4b1a[_0x54d9('0x44')]=_0x2a23ee;return _0x4d4b1a;})[_0x54d9('0x29')](respondWithFilteredResult(_0x495f9f,_0x206680))[_0x54d9('0x45')](handleError(_0x495f9f,null));};exports[_0x54d9('0x46')]=function(_0x5729b4,_0x10f597){var _0x2ca37d={'raw':!![],'where':{'id':_0x5729b4[_0x54d9('0x47')]['id']}},_0x2debc3={};_0x2debc3[_0x54d9('0x36')]=_[_0x54d9('0x32')](db[_0x54d9('0x42')][_0x54d9('0x2f')]);_0x2debc3['query']=_[_0x54d9('0x32')](_0x5729b4['query']);_0x2debc3[_0x54d9('0x34')]=_[_0x54d9('0x35')](_0x2debc3[_0x54d9('0x36')],_0x2debc3[_0x54d9('0x33')]);_0x2ca37d[_0x54d9('0x37')]=_[_0x54d9('0x35')](_0x2debc3['model'],qs['fields'](_0x5729b4[_0x54d9('0x33')][_0x54d9('0x38')]));_0x2ca37d[_0x54d9('0x37')]=_0x2ca37d[_0x54d9('0x37')][_0x54d9('0x39')]?_0x2ca37d[_0x54d9('0x37')]:_0x2debc3[_0x54d9('0x36')];if(_0x5729b4[_0x54d9('0x33')][_0x54d9('0x48')]){_0x2ca37d[_0x54d9('0x49')]=[{'all':!![]}];}_0x2ca37d=_['merge']({},_0x2ca37d,_0x5729b4[_0x54d9('0x4a')]);return db['ChatGroup'][_0x54d9('0x4b')](_0x2ca37d)[_0x54d9('0x29')](handleEntityNotFound(_0x10f597,null))['then'](respondWithResult(_0x10f597,null))[_0x54d9('0x45')](handleError(_0x10f597,null));};exports[_0x54d9('0x4c')]=function(_0x3b3e7b,_0x395bc){return db[_0x54d9('0x42')][_0x54d9('0x4c')](_0x3b3e7b[_0x54d9('0x4d')],{})[_0x54d9('0x29')](respondWithResult(_0x395bc,0xc9))[_0x54d9('0x45')](handleError(_0x395bc,null));};exports[_0x54d9('0x4e')]=function(_0x37cf35,_0x4c47b4){if(_0x37cf35['body']['id']){delete _0x37cf35[_0x54d9('0x4d')]['id'];}return db[_0x54d9('0x42')][_0x54d9('0x4b')]({'where':{'id':_0x37cf35[_0x54d9('0x47')]['id']}})[_0x54d9('0x29')](handleEntityNotFound(_0x4c47b4,null))[_0x54d9('0x29')](saveUpdates(_0x37cf35[_0x54d9('0x4d')],null))[_0x54d9('0x29')](respondWithResult(_0x4c47b4,null))[_0x54d9('0x45')](handleError(_0x4c47b4,null));};exports['destroy']=function(_0x259163,_0x34a086){return db[_0x54d9('0x42')]['find']({'where':{'id':_0x259163['params']['id']}})[_0x54d9('0x29')](handleEntityNotFound(_0x34a086,null))[_0x54d9('0x29')](removeEntity(_0x34a086,null))[_0x54d9('0x45')](handleError(_0x34a086,null));};exports[_0x54d9('0x4f')]=function(_0x140dc7,_0x13652d){return db['ChatGroup'][_0x54d9('0x4f')]()[_0x54d9('0x29')](respondWithResult(_0x13652d,null))[_0x54d9('0x45')](handleError(_0x13652d,null));};exports[_0x54d9('0x50')]=function(_0x3b0074,_0x1f100a,_0x51bffc){return db[_0x54d9('0x51')][_0x54d9('0x23')]({'where':{'ChatGroupId':_0x3b0074[_0x54d9('0x47')]['id'],'ToId':_0x3b0074['user']['id'],'read':![]}})[_0x54d9('0x29')](function(_0x551b92){return{'id':_[_0x54d9('0x52')](_0x3b0074[_0x54d9('0x47')]['id']),'count':_0x551b92};})['then'](respondWithResult(_0x1f100a,null))[_0x54d9('0x45')](handleError(_0x1f100a,null));};exports[_0x54d9('0x53')]=function(_0x5ddce8,_0x4c0de4,_0x7f6e56){return db[_0x54d9('0x42')][_0x54d9('0x4b')]({'where':{'id':_0x5ddce8[_0x54d9('0x47')]['id']}})[_0x54d9('0x29')](handleEntityNotFound(_0x4c0de4,null))[_0x54d9('0x29')](function(_0x39590f){if(_0x39590f){return _0x39590f[_0x54d9('0x53')](_0x5ddce8[_0x54d9('0x4d')][_0x54d9('0x54')],_[_0x54d9('0x55')](_0x5ddce8[_0x54d9('0x4d')],['ids','id'])||{});}})[_0x54d9('0x29')](respondWithResult(_0x4c0de4,null))['catch'](handleError(_0x4c0de4,null));};exports['getMembers']=function(_0x19d11a,_0x4373cd,_0x16c537){var _0x1422c9={};var _0x3859a9={};var _0xba1b76;var _0x1b368f;return db[_0x54d9('0x42')]['findOne']({'where':{'id':_0x19d11a[_0x54d9('0x47')]['id']}})[_0x54d9('0x29')](handleEntityNotFound(_0x4373cd,null))[_0x54d9('0x29')](function(_0x1748de){if(_0x1748de){_0xba1b76=_0x1748de;_0x3859a9['model']=_[_0x54d9('0x32')](db[_0x54d9('0x56')][_0x54d9('0x2f')]);_0x3859a9[_0x54d9('0x33')]=_[_0x54d9('0x32')](_0x19d11a[_0x54d9('0x33')]);_0x3859a9[_0x54d9('0x34')]=_[_0x54d9('0x35')](_0x3859a9['model'],_0x3859a9[_0x54d9('0x33')]);_0x1422c9[_0x54d9('0x37')]=_['intersection'](_0x3859a9['model'],qs[_0x54d9('0x38')](_0x19d11a['query'][_0x54d9('0x38')]));_0x1422c9[_0x54d9('0x37')]=_0x1422c9[_0x54d9('0x37')][_0x54d9('0x39')]?_0x1422c9['attributes']:_0x3859a9[_0x54d9('0x36')];_0x1422c9['order']=qs[_0x54d9('0x57')](_0x19d11a[_0x54d9('0x33')][_0x54d9('0x57')]);_0x1422c9[_0x54d9('0x3d')]=qs[_0x54d9('0x34')](_[_0x54d9('0x3c')](_0x19d11a[_0x54d9('0x33')],_0x3859a9['filters']));if(_0x19d11a[_0x54d9('0x33')][_0x54d9('0x41')]){_0x1422c9['where']=_[_0x54d9('0x3e')](_0x1422c9[_0x54d9('0x3d')],{'$or':_['map'](_0x1422c9[_0x54d9('0x37')],function(_0x5e5e87){var _0x701526={};_0x701526[_0x5e5e87]={'$like':'%'+_0x19d11a[_0x54d9('0x33')]['filter']+'%'};return _0x701526;})});}_0x1422c9=_[_0x54d9('0x3e')]({},_0x1422c9,_0x19d11a['options']);return _0xba1b76[_0x54d9('0x58')](_0x1422c9);}})[_0x54d9('0x29')](function(_0x6d4aae){if(_0x6d4aae){_0x1b368f=_0x6d4aae[_0x54d9('0x39')];if(!_0x19d11a[_0x54d9('0x33')][_0x54d9('0x3a')](_0x54d9('0x59'))){_0x1422c9[_0x54d9('0x22')]=qs[_0x54d9('0x22')](_0x19d11a[_0x54d9('0x33')][_0x54d9('0x22')]);_0x1422c9[_0x54d9('0x20')]=qs[_0x54d9('0x20')](_0x19d11a[_0x54d9('0x33')][_0x54d9('0x20')]);}return _0xba1b76['getMembers'](_0x1422c9);}})['then'](function(_0x3ce7a7){if(_0x3ce7a7){return _0x3ce7a7?{'count':_0x1b368f,'rows':_0x3ce7a7}:null;}})[_0x54d9('0x29')](respondWithResult(_0x4373cd,null))[_0x54d9('0x45')](handleError(_0x4373cd,null));};exports[_0x54d9('0x5a')]=function(_0x10b5f5,_0x256d84,_0x3345bb){return db[_0x54d9('0x42')][_0x54d9('0x4b')]({'where':{'id':_0x10b5f5[_0x54d9('0x47')]['id']}})[_0x54d9('0x29')](handleEntityNotFound(_0x256d84,null))[_0x54d9('0x29')](function(_0x573ab9){if(_0x573ab9){return _0x573ab9[_0x54d9('0x5a')](_0x10b5f5[_0x54d9('0x33')][_0x54d9('0x54')]);}})['then'](respondWithStatusCode(_0x256d84,null))[_0x54d9('0x45')](handleError(_0x256d84,null));};exports[_0x54d9('0x5b')]=function(_0x321d45,_0x178781,_0xc2c67){if(_0x321d45[_0x54d9('0x4d')]['id']){delete _0x321d45[_0x54d9('0x4d')]['id'];}return db[_0x54d9('0x42')][_0x54d9('0x4b')]({'where':{'id':_0x321d45[_0x54d9('0x47')]['id']}})['then'](handleEntityNotFound(_0x178781,null))[_0x54d9('0x29')](function(_0x412b4a){if(_0x412b4a){_0x321d45[_0x54d9('0x4d')][_0x54d9('0x5c')]=_0x412b4a['id'];return db[_0x54d9('0x51')][_0x54d9('0x4c')](_0x321d45[_0x54d9('0x4d')]);}})['then'](respondWithResult(_0x178781,null))['catch'](handleError(_0x178781,null));};exports[_0x54d9('0x5d')]=function(_0x41a0f3,_0x4b6359,_0xc01aee){var _0x3775ec={};var _0x2cb63a={};var _0x4bdbc5;var _0x2d1414;return db[_0x54d9('0x42')][_0x54d9('0x5e')]({'where':{'id':_0x41a0f3[_0x54d9('0x47')]['id']}})[_0x54d9('0x29')](handleEntityNotFound(_0x4b6359,null))['then'](function(_0x39e7d6){if(_0x39e7d6){_0x4bdbc5=_0x39e7d6;_0x2cb63a[_0x54d9('0x36')]=_[_0x54d9('0x32')](db[_0x54d9('0x51')][_0x54d9('0x2f')]);_0x2cb63a[_0x54d9('0x33')]=_['keys'](_0x41a0f3[_0x54d9('0x33')]);_0x2cb63a[_0x54d9('0x34')]=_[_0x54d9('0x35')](_0x2cb63a[_0x54d9('0x36')],_0x2cb63a[_0x54d9('0x33')]);_0x3775ec['attributes']=_[_0x54d9('0x35')](_0x2cb63a[_0x54d9('0x36')],qs[_0x54d9('0x38')](_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x38')]));_0x3775ec[_0x54d9('0x37')]=_0x3775ec[_0x54d9('0x37')][_0x54d9('0x39')]?_0x3775ec[_0x54d9('0x37')]:_0x2cb63a['model'];_0x3775ec[_0x54d9('0x3b')]=qs[_0x54d9('0x57')](_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x57')]);_0x3775ec[_0x54d9('0x3d')]=qs[_0x54d9('0x34')](_[_0x54d9('0x3c')](_0x41a0f3[_0x54d9('0x33')],_0x2cb63a[_0x54d9('0x34')]));if(_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x41')]){_0x3775ec[_0x54d9('0x3d')]=_[_0x54d9('0x3e')](_0x3775ec[_0x54d9('0x3d')],{'$or':_['map'](_0x3775ec['attributes'],function(_0x388b84){var _0x2ebb56={};_0x2ebb56[_0x388b84]={'$like':'%'+_0x41a0f3['query'][_0x54d9('0x41')]+'%'};return _0x2ebb56;})});}if(_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x5f')]){var _0xec6d38=_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x5f')]['split'](',');var _0x1f9424={};_0x1f9424[_0xec6d38[0x0]]={'$gte':moment(_0xec6d38[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3775ec[_0x54d9('0x3d')]=_[_0x54d9('0x3e')](_0x3775ec[_0x54d9('0x3d')],_0x1f9424);}_0x3775ec=_[_0x54d9('0x3e')]({},_0x3775ec,_0x41a0f3['options']);return _0x4bdbc5[_0x54d9('0x5d')](_0x3775ec);}})['then'](function(_0x46ca96){if(_0x46ca96){_0x2d1414=_0x46ca96[_0x54d9('0x39')];if(!_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x3a')](_0x54d9('0x59'))){_0x3775ec[_0x54d9('0x22')]=qs[_0x54d9('0x22')](_0x41a0f3['query'][_0x54d9('0x22')]);_0x3775ec[_0x54d9('0x20')]=qs[_0x54d9('0x20')](_0x41a0f3[_0x54d9('0x33')][_0x54d9('0x20')]);}return _0x4bdbc5[_0x54d9('0x5d')](_0x3775ec);}})[_0x54d9('0x29')](function(_0x3fd367){if(_0x3fd367){return _0x3fd367?{'count':_0x2d1414,'rows':_0x3fd367}:null;}})[_0x54d9('0x29')](respondWithResult(_0x4b6359,null))[_0x54d9('0x45')](handleError(_0x4b6359,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f776a4f..0d9cadd 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 _0x6c64=['ChatGroup','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x31778e,_0x4a03bb){var _0x470dcb=function(_0x38dbbf){while(--_0x38dbbf){_0x31778e['push'](_0x31778e['shift']());}};_0x470dcb(++_0x4a03bb);}(_0x6c64,0xdf));var _0x46c6=function(_0x538268,_0x55c0e1){_0x538268=_0x538268-0x0;var _0x1645c3=_0x6c64[_0x538268];return _0x1645c3;};'use strict';var EventEmitter=require(_0x46c6('0x0'));var ChatGroup=require(_0x46c6('0x1'))['db'][_0x46c6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x46c6('0x3'),'afterDestroy':_0x46c6('0x4')};function emitEvent(_0x2a797c){return function(_0x5eb94c,_0x3e0a71,_0xf1b108){ChatGroupEvents[_0x46c6('0x5')](_0x2a797c+':'+_0x5eb94c['id'],_0x5eb94c);ChatGroupEvents[_0x46c6('0x5')](_0x2a797c,_0x5eb94c);_0xf1b108(null);};}for(var e in events){if(events[_0x46c6('0x6')](e)){var event=events[e];ChatGroup[_0x46c6('0x7')](e,emitEvent(event));}}module[_0x46c6('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x5c3c=['emit','hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove'];(function(_0x46c5c4,_0x555ce7){var _0x423a4a=function(_0x7a9b7e){while(--_0x7a9b7e){_0x46c5c4['push'](_0x46c5c4['shift']());}};_0x423a4a(++_0x555ce7);}(_0x5c3c,0x132));var _0xc5c3=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x5c3c[_0x4b7b62];return _0x2280df;};'use strict';var EventEmitter=require(_0xc5c3('0x0'));var ChatGroup=require(_0xc5c3('0x1'))['db'][_0xc5c3('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc5c3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc5c3('0x4'),'afterDestroy':_0xc5c3('0x5')};function emitEvent(_0x1c2152){return function(_0x2a3649,_0x2535e0,_0x36525d){ChatGroupEvents[_0xc5c3('0x6')](_0x1c2152+':'+_0x2a3649['id'],_0x2a3649);ChatGroupEvents[_0xc5c3('0x6')](_0x1c2152,_0x2a3649);_0x36525d(null);};}for(var e in events){if(events[_0xc5c3('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index a94be68..422de03 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 _0xed04=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups','lodash'];(function(_0x36988b,_0x211f65){var _0x4946cc=function(_0x5218a5){while(--_0x5218a5){_0x36988b['push'](_0x36988b['shift']());}};_0x4946cc(++_0x211f65);}(_0xed04,0x99));var _0x4ed0=function(_0x4e7962,_0x1de67b){_0x4e7962=_0x4e7962-0x0;var _0x1d30b9=_0xed04[_0x4e7962];return _0x1d30b9;};'use strict';var _=require(_0x4ed0('0x0'));var util=require(_0x4ed0('0x1'));var logger=require('../../config/logger')(_0x4ed0('0x2'));var moment=require(_0x4ed0('0x3'));var BPromise=require(_0x4ed0('0x4'));var rp=require(_0x4ed0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ed0('0x6'));var config=require(_0x4ed0('0x7'));var attributes=require(_0x4ed0('0x8'));module[_0x4ed0('0x9')]=function(_0x292d7c,_0x169af1){return _0x292d7c['define']('ChatGroup',attributes,{'tableName':_0x4ed0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb827=['./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x4948e8,_0x1f4aea){var _0x1b52ab=function(_0x105a98){while(--_0x105a98){_0x4948e8['push'](_0x4948e8['shift']());}};_0x1b52ab(++_0x1f4aea);}(_0xb827,0xdd));var _0x7b82=function(_0x7ee44,_0x2e0bdf){_0x7ee44=_0x7ee44-0x0;var _0x184617=_0xb827[_0x7ee44];return _0x184617;};'use strict';var _=require(_0x7b82('0x0'));var util=require(_0x7b82('0x1'));var logger=require(_0x7b82('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7b82('0x3'));var rp=require(_0x7b82('0x4'));var fs=require('fs');var path=require(_0x7b82('0x5'));var rimraf=require(_0x7b82('0x6'));var config=require('../../config/environment');var attributes=require(_0x7b82('0x7'));module[_0x7b82('0x8')]=function(_0x4b3c44,_0x1aa271){return _0x4b3c44[_0x7b82('0x9')](_0x7b82('0xa'),attributes,{'tableName':_0x7b82('0xb'),'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 9e08f8e..0ac6efb 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 _0x36eb=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x1c7294,_0x43d230){var _0x55c507=function(_0x2bcdb3){while(--_0x2bcdb3){_0x1c7294['push'](_0x1c7294['shift']());}};_0x55c507(++_0x43d230);}(_0x36eb,0x111));var _0xb36e=function(_0x5bd183,_0x333604){_0x5bd183=_0x5bd183-0x0;var _0x32dd6b=_0x36eb[_0x5bd183];return _0x32dd6b;};'use strict';var _=require(_0xb36e('0x0'));var util=require('util');var moment=require(_0xb36e('0x1'));var BPromise=require('bluebird');var rs=require(_0xb36e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb36e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb36e('0x4'));var jayson=require(_0xb36e('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xb36e('0x6')]=_[_0xb36e('0x7')](config[_0xb36e('0x6')],{'host':_0xb36e('0x8'),'port':0x18eb});var socket=require(_0xb36e('0x9'))(new Redis(config['redis']));require(_0xb36e('0xa'))[_0xb36e('0xb')](socket);function respondWithRpcPromise(_0x5e20be,_0x10d7f6,_0x510cb2){return new BPromise(function(_0x266cc3,_0x2f8620){return client[_0xb36e('0xc')](_0x5e20be,_0x510cb2)[_0xb36e('0xd')](function(_0x4d8ec5){logger[_0xb36e('0xe')](_0xb36e('0xf'),_0x10d7f6,_0xb36e('0x10'));logger['debug'](_0xb36e('0x11'),_0x10d7f6,_0xb36e('0x10'),JSON[_0xb36e('0x12')](_0x4d8ec5));if(_0x4d8ec5[_0xb36e('0x13')]){if(_0x4d8ec5[_0xb36e('0x13')]['code']===0x1f4){logger[_0xb36e('0x13')](_0xb36e('0xf'),_0x10d7f6,_0x4d8ec5[_0xb36e('0x13')][_0xb36e('0x14')]);return _0x2f8620(_0x4d8ec5[_0xb36e('0x13')][_0xb36e('0x14')]);}logger[_0xb36e('0x13')]('ChatGroup,\x20%s,\x20%s',_0x10d7f6,_0x4d8ec5[_0xb36e('0x13')]['message']);return _0x266cc3(_0x4d8ec5[_0xb36e('0x13')][_0xb36e('0x14')]);}else{logger[_0xb36e('0xe')](_0xb36e('0xf'),_0x10d7f6,_0xb36e('0x10'));_0x266cc3(_0x4d8ec5['result'][_0xb36e('0x14')]);}})[_0xb36e('0x15')](function(_0x2c9b3c){logger[_0xb36e('0x13')](_0xb36e('0xf'),_0x10d7f6,_0x2c9b3c);_0x2f8620(_0x2c9b3c);});});} \ No newline at end of file +var _0x7da7=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x12aa4b,_0x1de4cb){var _0x513131=function(_0x145113){while(--_0x145113){_0x12aa4b['push'](_0x12aa4b['shift']());}};_0x513131(++_0x1de4cb);}(_0x7da7,0x10d));var _0x77da=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x7da7[_0x2e2681];return _0x368a64;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});config[_0x77da('0x9')]=_['defaults'](config[_0x77da('0x9')],{'host':_0x77da('0xa'),'port':0x18eb});var socket=require(_0x77da('0xb'))(new Redis(config[_0x77da('0x9')]));require(_0x77da('0xc'))['register'](socket);function respondWithRpcPromise(_0x40c86e,_0xb55827,_0x172d7f){return new BPromise(function(_0x5ea12f,_0x35d06e){return client[_0x77da('0xd')](_0x40c86e,_0x172d7f)[_0x77da('0xe')](function(_0x2a675a){logger['info'](_0x77da('0xf'),_0xb55827,_0x77da('0x10'));logger[_0x77da('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xb55827,'request\x20sent',JSON[_0x77da('0x12')](_0x2a675a));if(_0x2a675a[_0x77da('0x13')]){if(_0x2a675a['error'][_0x77da('0x14')]===0x1f4){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')]['message']);return _0x35d06e(_0x2a675a[_0x77da('0x13')]['message']);}logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x2a675a[_0x77da('0x13')][_0x77da('0x15')]);return _0x5ea12f(_0x2a675a['error']['message']);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xb55827,_0x77da('0x10'));_0x5ea12f(_0x2a675a[_0x77da('0x16')][_0x77da('0x15')]);}})[_0x77da('0x17')](function(_0x19a00c){logger[_0x77da('0x13')](_0x77da('0xf'),_0xb55827,_0x19a00c);_0x35d06e(_0x19a00c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 94cc61c..9f7e7fd 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 _0x4955=['emit','removeListener','register','length','chatGroup:','remove','update'];(function(_0x52b828,_0x412d29){var _0x38fd5a=function(_0x2dae25){while(--_0x2dae25){_0x52b828['push'](_0x52b828['shift']());}};_0x38fd5a(++_0x412d29);}(_0x4955,0x91));var _0x5495=function(_0x3efac0,_0x299a97){_0x3efac0=_0x3efac0-0x0;var _0x1cb83f=_0x4955[_0x3efac0];return _0x1cb83f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x5495('0x0'),_0x5495('0x1')];function createListener(_0x25e834,_0x44739d){return function(_0x33a9f9){_0x44739d[_0x5495('0x2')](_0x25e834,_0x33a9f9);};}function removeListener(_0x3f91f2,_0x46dbff){return function(){ChatGroupEvents[_0x5495('0x3')](_0x3f91f2,_0x46dbff);};}exports[_0x5495('0x4')]=function(_0x2c4091){for(var _0x327ac7=0x0,_0x31f890=events[_0x5495('0x5')];_0x327ac7<_0x31f890;_0x327ac7++){var _0x31816d=events[_0x327ac7];var _0x5e755d=createListener(_0x5495('0x6')+_0x31816d,_0x2c4091);ChatGroupEvents['on'](_0x31816d,_0x5e755d);}}; \ No newline at end of file +var _0xaac0=['remove','emit','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x29c3e0,_0x297eba){var _0x295754=function(_0x54e04a){while(--_0x54e04a){_0x29c3e0['push'](_0x29c3e0['shift']());}};_0x295754(++_0x297eba);}(_0xaac0,0x14e));var _0x0aac=function(_0x335bb1,_0x5aa97e){_0x335bb1=_0x335bb1-0x0;var _0x4c2fc7=_0xaac0[_0x335bb1];return _0x4c2fc7;};'use strict';var ChatGroupEvents=require(_0x0aac('0x0'));var events=[_0x0aac('0x1'),_0x0aac('0x2'),'update'];function createListener(_0x582d46,_0x5da43e){return function(_0x538975){_0x5da43e[_0x0aac('0x3')](_0x582d46,_0x538975);};}function removeListener(_0x5d688d,_0x34d526){return function(){ChatGroupEvents[_0x0aac('0x4')](_0x5d688d,_0x34d526);};}exports['register']=function(_0x3372d9){for(var _0x13443f=0x0,_0xeb45a1=events[_0x0aac('0x5')];_0x13443f<_0xeb45a1;_0x13443f++){var _0x2bec99=events[_0x13443f];var _0x9c258f=createListener(_0x0aac('0x6')+_0x2bec99,_0x3372d9);ChatGroupEvents['on'](_0x2bec99,_0x9c258f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 3376dd9..8e9cd18 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 _0x07eb=['Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express'];(function(_0x8eafd0,_0x3bfcd5){var _0x5de482=function(_0x273137){while(--_0x273137){_0x8eafd0['push'](_0x8eafd0['shift']());}};_0x5de482(++_0x3bfcd5);}(_0x07eb,0xf7));var _0xb07e=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x07eb[_0x54ea7a];return _0x65a10d;};'use strict';var multer=require(_0xb07e('0x0'));var util=require(_0xb07e('0x1'));var path=require(_0xb07e('0x2'));var timeout=require(_0xb07e('0x3'));var express=require(_0xb07e('0x4'));var router=express[_0xb07e('0x5')]();var fs_extra=require(_0xb07e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb07e('0x7'));var config=require('../../config/environment');var controller=require(_0xb07e('0x8'));router[_0xb07e('0x9')]('/',auth[_0xb07e('0xa')](),controller['index']);router[_0xb07e('0x9')](_0xb07e('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb07e('0x9')](_0xb07e('0xc'),auth[_0xb07e('0xa')](),controller[_0xb07e('0xd')]);router[_0xb07e('0x9')](_0xb07e('0xe'),auth[_0xb07e('0xa')](),controller[_0xb07e('0xf')]);router[_0xb07e('0x9')](_0xb07e('0x10'),auth['isAuthenticated'](),controller[_0xb07e('0x11')]);router['get'](_0xb07e('0x12'),auth[_0xb07e('0xa')](),controller[_0xb07e('0x13')]);router[_0xb07e('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb07e('0x14')](_0xb07e('0x10'),auth[_0xb07e('0xa')](),controller[_0xb07e('0x15')]);router[_0xb07e('0x14')](_0xb07e('0x12'),auth[_0xb07e('0xa')](),controller[_0xb07e('0x16')]);router[_0xb07e('0x17')](_0xb07e('0xc'),auth['isAuthenticated'](),controller[_0xb07e('0x18')]);router[_0xb07e('0x19')](_0xb07e('0xc'),auth['isAuthenticated'](),controller[_0xb07e('0x1a')]);router[_0xb07e('0x19')](_0xb07e('0x10'),auth['isAuthenticated'](),controller[_0xb07e('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x18ae=['update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','post','create','addMembers','/:id/messages','put'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x18ae,0xa0));var _0xe18a=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0x18ae[_0x285824];return _0x311d7e;};'use strict';var multer=require(_0xe18a('0x0'));var util=require(_0xe18a('0x1'));var path=require(_0xe18a('0x2'));var timeout=require(_0xe18a('0x3'));var express=require(_0xe18a('0x4'));var router=express[_0xe18a('0x5')]();var fs_extra=require(_0xe18a('0x6'));var auth=require(_0xe18a('0x7'));var interaction=require(_0xe18a('0x8'));var config=require(_0xe18a('0x9'));var controller=require(_0xe18a('0xa'));router[_0xe18a('0xb')]('/',auth[_0xe18a('0xc')](),controller['index']);router['get'](_0xe18a('0xd'),auth[_0xe18a('0xc')](),controller[_0xe18a('0xe')]);router[_0xe18a('0xb')](_0xe18a('0xf'),auth[_0xe18a('0xc')](),controller[_0xe18a('0x10')]);router['get'](_0xe18a('0x11'),auth[_0xe18a('0xc')](),controller[_0xe18a('0x12')]);router[_0xe18a('0xb')](_0xe18a('0x13'),auth['isAuthenticated'](),controller[_0xe18a('0x14')]);router[_0xe18a('0xb')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xe18a('0x15')]('/',auth[_0xe18a('0xc')](),controller[_0xe18a('0x16')]);router['post'](_0xe18a('0x13'),auth[_0xe18a('0xc')](),controller[_0xe18a('0x17')]);router[_0xe18a('0x15')](_0xe18a('0x18'),auth[_0xe18a('0xc')](),controller['addMessage']);router[_0xe18a('0x19')](_0xe18a('0xf'),auth[_0xe18a('0xc')](),controller[_0xe18a('0x1a')]);router[_0xe18a('0x1b')](_0xe18a('0xf'),auth[_0xe18a('0xc')](),controller[_0xe18a('0x1c')]);router[_0xe18a('0x1b')](_0xe18a('0x13'),auth[_0xe18a('0xc')](),controller[_0xe18a('0x1d')]);module[_0xe18a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ad533b4..88c4f9d 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 _0x6cb4=['star','thumb','TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x8f15dd,_0x1b132c){var _0x6a2868=function(_0x51da5f){while(--_0x51da5f){_0x8f15dd['push'](_0x8f15dd['shift']());}};_0x6a2868(++_0x1b132c);}(_0x6cb4,0xff));var _0x46cb=function(_0xa09324,_0x2a1d7f){_0xa09324=_0xa09324-0x0;var _0x426959=_0x6cb4[_0xa09324];return _0x426959;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize[_0x46cb('0x8')]},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize[_0x46cb('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize[_0x46cb('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x46cb('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x46cb('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5c00=['STRING','out','sequelize','exports','BOOLEAN','ENUM','thumb','star','TEXT','DATE'];(function(_0x35e502,_0x3f1595){var _0x4ac72e=function(_0x4e126f){while(--_0x4e126f){_0x35e502['push'](_0x35e502['shift']());}};_0x4ac72e(++_0x3f1595);}(_0x5c00,0x17e));var _0x05c0=function(_0xcafb2b,_0x2cc85e){_0xcafb2b=_0xcafb2b-0x0;var _0x539f9a=_0x5c00[_0xcafb2b];return _0x539f9a;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'closed':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x05c0('0x3')]('star',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'ratingMessage':{'type':Sequelize[_0x05c0('0x6')]},'pathTranscript':{'type':Sequelize[_0x05c0('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x05c0('0x7')]},'disposition':{'type':Sequelize[_0x05c0('0x8')]},'secondDisposition':{'type':Sequelize[_0x05c0('0x8')]},'thirdDisposition':{'type':Sequelize[_0x05c0('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x05c0('0x8')]},'browserVersion':{'type':Sequelize[_0x05c0('0x8')]},'osName':{'type':Sequelize[_0x05c0('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x05c0('0x8')]},'deviceVendor':{'type':Sequelize[_0x05c0('0x8')]},'deviceType':{'type':Sequelize[_0x05c0('0x8')]},'referer':{'type':Sequelize[_0x05c0('0x6')]},'customerIp':{'type':Sequelize[_0x05c0('0x8')]},'formData':{'type':Sequelize[_0x05c0('0x6')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x05c0('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x05c0('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x05c0('0x8')]},'customerPort':{'type':Sequelize[_0x05c0('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 54e0954..75b3540 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 _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x14a0,0x8e));var _0x014a=function(_0x18747c,_0x3e3091){_0x18747c=_0x18747c-0x0;var _0x15323b=_0x14a0[_0x18747c];return _0x15323b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));}; \ No newline at end of file +var _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0xef0f,0x168));var _0xfef0=function(_0x48ae67,_0x2be5e2){_0x48ae67=_0x48ae67-0x0;var _0x47b29b=_0xef0f[_0x48ae67];return _0x47b29b;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 7a7bad7..a8f9831 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 _0xf0e9=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','then','Users','map','findAll','setDataValue'];(function(_0x17f022,_0x4c98bb){var _0x4a37d2=function(_0x3a354e){while(--_0x3a354e){_0x17f022['push'](_0x17f022['shift']());}};_0x4a37d2(++_0x4c98bb);}(_0xf0e9,0x96));var _0x9f0e=function(_0x22ae5b,_0xb48e39){_0x22ae5b=_0x22ae5b-0x0;var _0x33900f=_0xf0e9[_0x22ae5b];return _0x33900f;};'use strict';var EventEmitter=require(_0x9f0e('0x0'));var ChatInteraction=require(_0x9f0e('0x1'))['db'][_0x9f0e('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x9f0e('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f0e('0x4'),'afterUpdate':_0x9f0e('0x5'),'afterDestroy':_0x9f0e('0x6')};function emitEvent(_0x56c504){return function(_0x30e060,_0x1fd3fc,_0x106a8e){_0x30e060['getUsers']({'attributes':['id'],'raw':!![]})[_0x9f0e('0x7')](function(_0x3a2b52){_0x30e060['setDataValue'](_0x9f0e('0x8'),_0x3a2b52[_0x9f0e('0x9')](function(_0x334727){return{'id':_0x334727['id']};}));return ChatMessage[_0x9f0e('0xa')]({'where':{'ChatInteractionId':_0x30e060['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ad0a2){_0x30e060[_0x9f0e('0xb')](_0x9f0e('0xc'),_0x4ad0a2[_0x9f0e('0xd')]);ChatInteractionEvents[_0x9f0e('0xe')](_0x56c504+':'+_0x30e060['id'],_0x30e060);ChatInteractionEvents[_0x9f0e('0xe')](_0x56c504,_0x30e060);_0x106a8e(null);})[_0x9f0e('0xf')](_0x106a8e(null));};}for(var e in events){if(events[_0x9f0e('0x10')](e)){var event=events[e];ChatInteraction[_0x9f0e('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x1408=['hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','Users','map','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x737c3d,_0x38f1cf){var _0x13c853=function(_0x1e4cb6){while(--_0x1e4cb6){_0x737c3d['push'](_0x737c3d['shift']());}};_0x13c853(++_0x38f1cf);}(_0x1408,0xff));var _0x8140=function(_0x4baae7,_0x407cc8){_0x4baae7=_0x4baae7-0x0;var _0x243490=_0x1408[_0x4baae7];return _0x243490;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x8140('0x0'))['db'][_0x8140('0x1')];var ChatMessage=require(_0x8140('0x0'))['db'][_0x8140('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8140('0x3'),'afterUpdate':_0x8140('0x4'),'afterDestroy':_0x8140('0x5')};function emitEvent(_0x4f1d94){return function(_0x1de01c,_0x1c7c8f,_0x256656){_0x1de01c[_0x8140('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x498dc8){_0x1de01c['setDataValue'](_0x8140('0x7'),_0x498dc8[_0x8140('0x8')](function(_0x4c868a){return{'id':_0x4c868a['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1de01c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8140('0x9')](function(_0xd9f209){_0x1de01c[_0x8140('0xa')](_0x8140('0xb'),_0xd9f209[_0x8140('0xc')]);ChatInteractionEvents[_0x8140('0xd')](_0x4f1d94+':'+_0x1de01c['id'],_0x1de01c);ChatInteractionEvents[_0x8140('0xd')](_0x4f1d94,_0x1de01c);_0x256656(null);})[_0x8140('0xe')](_0x256656(null));};}for(var e in events){if(events[_0x8140('0xf')](e)){var event=events[e];ChatInteraction[_0x8140('0x10')](e,emitEvent(event));}}module[_0x8140('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e6b6561..fc81eaf 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 _0x2ef7=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','request-promise'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0x2ef7,0x1e6));var _0x72ef=function(_0x1e17e9,_0xd02714){_0x1e17e9=_0x1e17e9-0x0;var _0xd972eb=_0x2ef7[_0x1e17e9];return _0xd972eb;};'use strict';var _=require('lodash');var util=require(_0x72ef('0x0'));var logger=require(_0x72ef('0x1'))(_0x72ef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x72ef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72ef('0x4'));var config=require(_0x72ef('0x5'));var attributes=require(_0x72ef('0x6'));module[_0x72ef('0x7')]=function(_0x45e295,_0xc4be74){return _0x45e295[_0x72ef('0x8')]('ChatInteraction',attributes,{'tableName':_0x72ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17542c,_0x58e69a,_0x4d2522){if(_0x17542c[_0x72ef('0xa')]('closed')){_0x17542c[_0x72ef('0xb')]=moment()['format'](_0x72ef('0xc'));}_0x4d2522(null,_0x17542c);}},'charset':_0x72ef('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0181=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird'];(function(_0x1ee35d,_0x56b6a8){var _0x1338d2=function(_0x16820d){while(--_0x16820d){_0x1ee35d['push'](_0x1ee35d['shift']());}};_0x1338d2(++_0x56b6a8);}(_0x0181,0xec));var _0x1018=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0181[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x1018('0x0'));var util=require(_0x1018('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1018('0x2'));var BPromise=require(_0x1018('0x3'));var rp=require(_0x1018('0x4'));var fs=require('fs');var path=require(_0x1018('0x5'));var rimraf=require(_0x1018('0x6'));var config=require(_0x1018('0x7'));var attributes=require(_0x1018('0x8'));module['exports']=function(_0x592b09,_0x1a84cb){return _0x592b09[_0x1018('0x9')](_0x1018('0xa'),attributes,{'tableName':_0x1018('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13fad9,_0x29e1ff,_0x175994){if(_0x13fad9[_0x1018('0xc')](_0x1018('0xd'))){_0x13fad9['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x175994(null,_0x13fad9);}},'charset':_0x1018('0xe'),'collate':_0x1018('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e0e3f01..8540f9f 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 _0xa2dc=['AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','omit','spread','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','then','request\x20sent','debug','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','info','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa2dc,0x182));var _0xca2d=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xa2dc[_0x13ac10];return _0x28eda2;};'use strict';var _=require(_0xca2d('0x0'));var util=require('util');var moment=require(_0xca2d('0x1'));var BPromise=require(_0xca2d('0x2'));var rs=require(_0xca2d('0x3'));var fs=require('fs');var Redis=require(_0xca2d('0x4'));var db=require(_0xca2d('0x5'))['db'];var utils=require(_0xca2d('0x6'));var logger=require('../../config/logger')(_0xca2d('0x7'));var config=require('../../config/environment');var jayson=require(_0xca2d('0x8'));var client=jayson[_0xca2d('0x9')][_0xca2d('0xa')]({'port':0x232a});config['redis']=_[_0xca2d('0xb')](config[_0xca2d('0xc')],{'host':_0xca2d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca2d('0xc')]));require(_0xca2d('0xe'))[_0xca2d('0xf')](socket);function respondWithRpcPromise(_0x1a6051,_0x42947f,_0x1f9b12){return new BPromise(function(_0x7db430,_0x368321){return client['request'](_0x1a6051,_0x1f9b12)[_0xca2d('0x10')](function(_0x4e1d6e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x42947f,_0xca2d('0x11'));logger[_0xca2d('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x42947f,_0xca2d('0x11'),JSON['stringify'](_0x4e1d6e));if(_0x4e1d6e[_0xca2d('0x13')]){if(_0x4e1d6e[_0xca2d('0x13')][_0xca2d('0x14')]===0x1f4){logger[_0xca2d('0x13')](_0xca2d('0x15'),_0x42947f,_0x4e1d6e[_0xca2d('0x13')][_0xca2d('0x16')]);return _0x368321(_0x4e1d6e['error'][_0xca2d('0x16')]);}logger[_0xca2d('0x13')](_0xca2d('0x15'),_0x42947f,_0x4e1d6e[_0xca2d('0x13')][_0xca2d('0x16')]);return _0x7db430(_0x4e1d6e['error'][_0xca2d('0x16')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x42947f,_0xca2d('0x11'));_0x7db430(_0x4e1d6e[_0xca2d('0x17')][_0xca2d('0x16')]);}})[_0xca2d('0x18')](function(_0x52e841){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x42947f,_0x52e841);_0x368321(_0x52e841);});});}exports[_0xca2d('0x19')]=function(_0x386da4){var _0x1abd62=this;return new Promise(function(_0x503138,_0x186282){return db['ChatInteraction'][_0xca2d('0x1a')](_0x386da4['body'],{'raw':_0x386da4[_0xca2d('0x1b')]?_0x386da4['options'][_0xca2d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x386da4[_0xca2d('0x1b')]?_0x386da4[_0xca2d('0x1b')][_0xca2d('0x1d')]||null:null,'attributes':_0x386da4['options']?_0x386da4[_0xca2d('0x1b')][_0xca2d('0x1e')]||null:null,'limit':_0x386da4[_0xca2d('0x1b')]?_0x386da4[_0xca2d('0x1b')][_0xca2d('0x1f')]||null:null})[_0xca2d('0x10')](function(_0x201445){logger[_0xca2d('0x20')]('UpdateChatInteraction',_0x386da4);logger['debug'](_0xca2d('0x19'),_0x386da4,JSON[_0xca2d('0x21')](_0x201445));_0x503138(_0x201445);})[_0xca2d('0x18')](function(_0x63dd4b){logger[_0xca2d('0x13')]('UpdateChatInteraction',_0x63dd4b[_0xca2d('0x16')],_0x386da4);_0x186282(_0x1abd62['error'](0x1f4,_0x63dd4b[_0xca2d('0x16')]));});});};exports[_0xca2d('0x22')]=function(_0x5a8b1d){return new Promise(function(_0x1b76a3,_0x2bf5c6){return db[_0xca2d('0x23')][_0xca2d('0x24')]({'where':_0x5a8b1d['options']?_0x5a8b1d['options'][_0xca2d('0x1d')]||null:null})[_0xca2d('0x10')](function(_0x33cdb0){if(_0x33cdb0){return _0x33cdb0[_0xca2d('0x25')](_0x5a8b1d[_0xca2d('0x26')][_0xca2d('0x27')],_[_0xca2d('0x28')](_0x5a8b1d[_0xca2d('0x26')],['ids','id'])||{});}})[_0xca2d('0x29')](function(_0x2db8e8){logger[_0xca2d('0x20')]('AddTags',_0x5a8b1d);logger['debug']('AddTags',_0x5a8b1d,JSON[_0xca2d('0x21')](_0x2db8e8));_0x1b76a3(_0x2db8e8);})['catch'](function(_0x4754c1){logger[_0xca2d('0x13')]('AddTags',_0x4754c1[_0xca2d('0x16')],_0x5a8b1d);_0x2bf5c6(_this[_0xca2d('0x13')](0x1f4,_0x4754c1[_0xca2d('0x16')]));});});}; \ No newline at end of file +var _0xe88b=['AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes'];(function(_0x1ced13,_0x524d36){var _0x126223=function(_0x49a643){while(--_0x49a643){_0x1ced13['push'](_0x1ced13['shift']());}};_0x126223(++_0x524d36);}(_0xe88b,0x8c));var _0xbe88=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe88b[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0xbe88('0x0'));var moment=require(_0xbe88('0x1'));var BPromise=require(_0xbe88('0x2'));var rs=require(_0xbe88('0x3'));var fs=require('fs');var Redis=require(_0xbe88('0x4'));var db=require(_0xbe88('0x5'))['db'];var utils=require(_0xbe88('0x6'));var logger=require(_0xbe88('0x7'))(_0xbe88('0x8'));var config=require(_0xbe88('0x9'));var jayson=require(_0xbe88('0xa'));var client=jayson[_0xbe88('0xb')][_0xbe88('0xc')]({'port':0x232a});config[_0xbe88('0xd')]=_[_0xbe88('0xe')](config[_0xbe88('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe88('0xf'))(new Redis(config[_0xbe88('0xd')]));require(_0xbe88('0x10'))[_0xbe88('0x11')](socket);function respondWithRpcPromise(_0x5ec35e,_0x5b3a29,_0x14c085){return new BPromise(function(_0x326e42,_0x237303){return client['request'](_0x5ec35e,_0x14c085)[_0xbe88('0x12')](function(_0x28844a){logger[_0xbe88('0x13')](_0xbe88('0x14'),_0x5b3a29,'request\x20sent');logger[_0xbe88('0x15')](_0xbe88('0x16'),_0x5b3a29,_0xbe88('0x17'),JSON['stringify'](_0x28844a));if(_0x28844a['error']){if(_0x28844a[_0xbe88('0x18')][_0xbe88('0x19')]===0x1f4){logger[_0xbe88('0x18')](_0xbe88('0x14'),_0x5b3a29,_0x28844a[_0xbe88('0x18')]['message']);return _0x237303(_0x28844a[_0xbe88('0x18')]['message']);}logger[_0xbe88('0x18')](_0xbe88('0x14'),_0x5b3a29,_0x28844a[_0xbe88('0x18')]['message']);return _0x326e42(_0x28844a['error']['message']);}else{logger[_0xbe88('0x13')](_0xbe88('0x14'),_0x5b3a29,_0xbe88('0x17'));_0x326e42(_0x28844a['result'][_0xbe88('0x1a')]);}})[_0xbe88('0x1b')](function(_0x72c588){logger[_0xbe88('0x18')](_0xbe88('0x14'),_0x5b3a29,_0x72c588);_0x237303(_0x72c588);});});}exports[_0xbe88('0x1c')]=function(_0x26bb73){var _0x5101f1=this;return new Promise(function(_0x5e6aaa,_0x54461e){return db[_0xbe88('0x1d')][_0xbe88('0x1e')](_0x26bb73[_0xbe88('0x1f')],{'raw':_0x26bb73['options']?_0x26bb73[_0xbe88('0x20')][_0xbe88('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26bb73[_0xbe88('0x20')]?_0x26bb73[_0xbe88('0x20')][_0xbe88('0x22')]||null:null,'attributes':_0x26bb73['options']?_0x26bb73[_0xbe88('0x20')][_0xbe88('0x23')]||null:null,'limit':_0x26bb73[_0xbe88('0x20')]?_0x26bb73[_0xbe88('0x20')]['limit']||null:null})[_0xbe88('0x12')](function(_0x3f85ee){logger[_0xbe88('0x13')](_0xbe88('0x1c'),_0x26bb73);logger[_0xbe88('0x15')]('UpdateChatInteraction',_0x26bb73,JSON['stringify'](_0x3f85ee));_0x5e6aaa(_0x3f85ee);})[_0xbe88('0x1b')](function(_0x4e14e9){logger['error']('UpdateChatInteraction',_0x4e14e9[_0xbe88('0x1a')],_0x26bb73);_0x54461e(_0x5101f1[_0xbe88('0x18')](0x1f4,_0x4e14e9['message']));});});};exports[_0xbe88('0x24')]=function(_0x3af831){return new Promise(function(_0x3d9887,_0x2215af){return db[_0xbe88('0x1d')][_0xbe88('0x25')]({'where':_0x3af831[_0xbe88('0x20')]?_0x3af831['options'][_0xbe88('0x22')]||null:null})[_0xbe88('0x12')](function(_0x10e91f){if(_0x10e91f){return _0x10e91f[_0xbe88('0x26')](_0x3af831[_0xbe88('0x1f')][_0xbe88('0x27')],_[_0xbe88('0x28')](_0x3af831[_0xbe88('0x1f')],[_0xbe88('0x27'),'id'])||{});}})[_0xbe88('0x29')](function(_0x10a0c8){logger[_0xbe88('0x13')](_0xbe88('0x2a'),_0x3af831);logger[_0xbe88('0x15')]('AddTags',_0x3af831,JSON[_0xbe88('0x2b')](_0x10a0c8));_0x3d9887(_0x10a0c8);})[_0xbe88('0x1b')](function(_0x39d730){logger[_0xbe88('0x18')](_0xbe88('0x2a'),_0x39d730[_0xbe88('0x1a')],_0x3af831);_0x2215af(_this[_0xbe88('0x18')](0x1f4,_0x39d730[_0xbe88('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 350671c..886df96 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 _0x0cf7=['save','update','emit','register','./chatInteraction.events'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x0cf7,0x1c1));var _0x70cf=function(_0x1bb700,_0x5bb9f1){_0x1bb700=_0x1bb700-0x0;var _0x46e905=_0x0cf7[_0x1bb700];return _0x46e905;};'use strict';var ChatInteractionEvents=require(_0x70cf('0x0'));var events=[_0x70cf('0x1'),'remove',_0x70cf('0x2')];function createListener(_0x39443a,_0x566d0c){return function(_0x814960){_0x566d0c[_0x70cf('0x3')](_0x39443a,_0x814960);};}function removeListener(_0x5cf3cc,_0xcdf659){return function(){ChatInteractionEvents['removeListener'](_0x5cf3cc,_0xcdf659);};}exports[_0x70cf('0x4')]=function(_0x3a276c){for(var _0x38b752=0x0,_0x320cc1=events['length'];_0x38b752<_0x320cc1;_0x38b752++){var _0x100bb1=events[_0x38b752];var _0x5f3777=createListener('chatInteraction:'+_0x100bb1,_0x3a276c);ChatInteractionEvents['on'](_0x100bb1,_0x5f3777);}}; \ No newline at end of file +var _0x94a5=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x436753,_0x4a47fa){var _0x24c0ff=function(_0x358336){while(--_0x358336){_0x436753['push'](_0x436753['shift']());}};_0x24c0ff(++_0x4a47fa);}(_0x94a5,0x1b1));var _0x594a=function(_0x10f14e,_0x37311a){_0x10f14e=_0x10f14e-0x0;var _0x3474a4=_0x94a5[_0x10f14e];return _0x3474a4;};'use strict';var ChatInteractionEvents=require(_0x594a('0x0'));var events=[_0x594a('0x1'),_0x594a('0x2'),_0x594a('0x3')];function createListener(_0x1602f8,_0x5e8b43){return function(_0x55fd40){_0x5e8b43[_0x594a('0x4')](_0x1602f8,_0x55fd40);};}function removeListener(_0x488e72,_0x10534f){return function(){ChatInteractionEvents[_0x594a('0x5')](_0x488e72,_0x10534f);};}exports[_0x594a('0x6')]=function(_0x440ddf){for(var _0xeb9b02=0x0,_0x55d2f9=events['length'];_0xeb9b02<_0x55d2f9;_0xeb9b02++){var _0x37add0=events[_0xeb9b02];var _0x5bd7cd=createListener(_0x594a('0x7')+_0x37add0,_0x440ddf);ChatInteractionEvents['on'](_0x37add0,_0x5bd7cd);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 050dbac..b766add 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 _0x5204=['create','/:id/vidaoo','diskStorage','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post'];(function(_0x25f8bc,_0x1f9a64){var _0x218d62=function(_0x56b34c){while(--_0x56b34c){_0x25f8bc['push'](_0x25f8bc['shift']());}};_0x218d62(++_0x1f9a64);}(_0x5204,0xe2));var _0x4520=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x5204[_0x1a89a1];return _0x3d5b46;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4520('0x0'));var timeout=require(_0x4520('0x1'));var express=require(_0x4520('0x2'));var router=express[_0x4520('0x3')]();var fs_extra=require(_0x4520('0x4'));var auth=require(_0x4520('0x5'));var interaction=require(_0x4520('0x6'));var config=require(_0x4520('0x7'));var controller=require(_0x4520('0x8'));router['get']('/',auth[_0x4520('0x9')](),controller[_0x4520('0xa')]);router['get'](_0x4520('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4520('0xc')](_0x4520('0xd'),auth[_0x4520('0xe')](),controller[_0x4520('0xf')]);router['get'](_0x4520('0x10'),auth[_0x4520('0xe')](),controller[_0x4520('0x11')]);router[_0x4520('0xc')](_0x4520('0x12'),auth[_0x4520('0x9')](),controller[_0x4520('0x13')]);router[_0x4520('0xc')](_0x4520('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x4520('0x15')]);router[_0x4520('0xc')]('/:id/download',auth[_0x4520('0x9')](),controller[_0x4520('0x16')]);router[_0x4520('0x17')]('/',auth[_0x4520('0x9')](),controller[_0x4520('0x18')]);router[_0x4520('0x17')](_0x4520('0x19'),auth[_0x4520('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4520('0x1a')]({'destination':function(_0x52af68,_0x4ce671,_0x22dfa5){_0x22dfa5(null,path['join'](config['root'],_0x4520('0x1b')));},'filename':function(_0x329fb9,_0x4e9f6d,_0x3981ea){_0x3981ea(null,util[_0x4520('0x1c')]('%s-%s',Date[_0x4520('0x1d')](),_0x4e9f6d[_0x4520('0x1e')][_0x4520('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4520('0x17')](_0x4520('0x20'),upload['single'](_0x4520('0x21')),controller[_0x4520('0x22')]);router[_0x4520('0x17')](_0x4520('0x12'),auth[_0x4520('0xe')](),controller[_0x4520('0x23')]);router[_0x4520('0x17')](_0x4520('0x24'),auth[_0x4520('0x9')](),interaction[_0x4520('0x25')](_0x4520('0x26'),'chatinteraction:addtags'),controller[_0x4520('0x27')]);router['put'](_0x4520('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x4520('0x26'),'chatinteraction:update'),controller[_0x4520('0x28')]);router[_0x4520('0x29')](_0x4520('0x2a'),controller[_0x4520('0x2b')]);router['put'](_0x4520('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x4520('0x2d')]);router[_0x4520('0x29')]('/:id/close',controller['close']);router[_0x4520('0x2e')](_0x4520('0xd'),auth[_0x4520('0x9')](),interaction[_0x4520('0x25')]('chat',_0x4520('0x2f')),controller[_0x4520('0x30')]);router[_0x4520('0x2e')]('/:id/tags',auth[_0x4520('0x9')](),controller['removeTags']);module[_0x4520('0x31')]=router; \ No newline at end of file +var _0x0cf6=['diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','single','file','attachmentUpload','addMessage','chat','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','/:id/download','download','post','create'];(function(_0x1356f9,_0x501d83){var _0x469efe=function(_0x2de676){while(--_0x2de676){_0x1356f9['push'](_0x1356f9['shift']());}};_0x469efe(++_0x501d83);}(_0x0cf6,0x10d));var _0x60cf=function(_0x42d439,_0x2bcb89){_0x42d439=_0x42d439-0x0;var _0x48bbda=_0x0cf6[_0x42d439];return _0x48bbda;};'use strict';var multer=require(_0x60cf('0x0'));var util=require(_0x60cf('0x1'));var path=require(_0x60cf('0x2'));var timeout=require('connect-timeout');var express=require(_0x60cf('0x3'));var router=express[_0x60cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x60cf('0x5'));var interaction=require(_0x60cf('0x6'));var config=require('../../config/environment');var controller=require(_0x60cf('0x7'));router[_0x60cf('0x8')]('/',auth[_0x60cf('0x9')](),controller['index']);router[_0x60cf('0x8')]('/describe',auth[_0x60cf('0x9')](),controller['describe']);router[_0x60cf('0x8')](_0x60cf('0xa'),auth[_0x60cf('0xb')](),controller[_0x60cf('0xc')]);router[_0x60cf('0x8')]('/:id/attachment_download',auth[_0x60cf('0xb')](),controller[_0x60cf('0xd')]);router[_0x60cf('0x8')](_0x60cf('0xe'),auth[_0x60cf('0x9')](),controller['getMessages']);router[_0x60cf('0x8')]('/:id/my_messages',auth[_0x60cf('0xb')](),controller['getMyMessages']);router[_0x60cf('0x8')](_0x60cf('0xf'),auth['isAuthenticated'](),controller[_0x60cf('0x10')]);router[_0x60cf('0x11')]('/',auth[_0x60cf('0x9')](),controller[_0x60cf('0x12')]);router[_0x60cf('0x11')]('/:id/vidaoo',auth[_0x60cf('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x60cf('0x13')]({'destination':function(_0x291c0a,_0x2b6586,_0x245c3d){_0x245c3d(null,path[_0x60cf('0x14')](config[_0x60cf('0x15')],_0x60cf('0x16')));},'filename':function(_0x2d6b90,_0x5bb56f,_0x11b981){_0x11b981(null,util[_0x60cf('0x17')](_0x60cf('0x18'),Date[_0x60cf('0x19')](),_0x5bb56f['originalname'][_0x60cf('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x60cf('0x11')]('/:id/attachment_upload',upload[_0x60cf('0x1b')](_0x60cf('0x1c')),controller[_0x60cf('0x1d')]);router[_0x60cf('0x11')](_0x60cf('0xe'),auth[_0x60cf('0xb')](),controller[_0x60cf('0x1e')]);router[_0x60cf('0x11')]('/:id/tags',auth[_0x60cf('0x9')](),interaction['tracked'](_0x60cf('0x1f'),'chatinteraction:addtags'),controller[_0x60cf('0x20')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x60cf('0x1f'),_0x60cf('0x21')),controller[_0x60cf('0x22')]);router[_0x60cf('0x23')](_0x60cf('0x24'),controller[_0x60cf('0x25')]);router[_0x60cf('0x23')](_0x60cf('0x26'),auth['isChatInteractionAuthorized'](),controller[_0x60cf('0x27')]);router['put'](_0x60cf('0x28'),controller[_0x60cf('0x29')]);router[_0x60cf('0x2a')](_0x60cf('0xa'),auth['isAuthenticated'](),interaction[_0x60cf('0x2b')]('chat',_0x60cf('0x2c')),controller[_0x60cf('0x2d')]);router['delete'](_0x60cf('0x2e'),auth[_0x60cf('0x9')](),controller['removeTags']);module[_0x60cf('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 72143bf..99761a0 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 _0x7cc6=['TEXT','medium','BOOLEAN','INTEGER'];(function(_0xb5cb42,_0x2d6784){var _0x10511d=function(_0x22ea02){while(--_0x22ea02){_0xb5cb42['push'](_0xb5cb42['shift']());}};_0x10511d(++_0x2d6784);}(_0x7cc6,0xcc));var _0x67cc=function(_0x54eafa,_0x3f0cf1){_0x54eafa=_0x54eafa-0x0;var _0x1ab927=_0x7cc6[_0x54eafa];return _0x1ab927;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x67cc('0x0')](_0x67cc('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x67cc('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x67cc('0x3')]}}; \ No newline at end of file +var _0x58fa=['exports','TEXT','INTEGER'];(function(_0x1d6435,_0x56ae48){var _0x22b6e1=function(_0x3adef1){while(--_0x3adef1){_0x1d6435['push'](_0x1d6435['shift']());}};_0x22b6e1(++_0x56ae48);}(_0x58fa,0x1c5));var _0xa58f=function(_0x561f9a,_0x2072a0){_0x561f9a=_0x561f9a-0x0;var _0x3747b2=_0x58fa[_0x561f9a];return _0x3747b2;};'use strict';var Sequelize=require('sequelize');module[_0xa58f('0x0')]={'body':{'type':Sequelize[_0xa58f('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa58f('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index d18e56e..628e139 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 _0xfaf4=['create','body','params','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User','findAll','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','ToId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','include','find'];(function(_0x18dc7e,_0x1d3a63){var _0x481936=function(_0x6264d0){while(--_0x6264d0){_0x18dc7e['push'](_0x18dc7e['shift']());}};_0x481936(++_0x1d3a63);}(_0xfaf4,0x100));var _0x4faf=function(_0x7e4c89,_0x251031){_0x7e4c89=_0x7e4c89-0x0;var _0xaa0be9=_0xfaf4[_0x7e4c89];return _0xaa0be9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4faf('0x0'));var zipdir=require(_0x4faf('0x1'));var jsonpatch=require(_0x4faf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4faf('0x3'));var util=require(_0x4faf('0x4'));var path=require(_0x4faf('0x5'));var sox=require(_0x4faf('0x6'));var csv=require(_0x4faf('0x7'));var ejs=require(_0x4faf('0x8'));var fs=require('fs');var fs_extra=require(_0x4faf('0x9'));var _=require('lodash');var squel=require(_0x4faf('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4faf('0x7'));var querystring=require(_0x4faf('0xb'));var Papa=require(_0x4faf('0xc'));var Redis=require(_0x4faf('0xd'));var authService=require(_0x4faf('0xe'));var qs=require(_0x4faf('0xf'));var as=require(_0x4faf('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4faf('0x11'))(_0x4faf('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4faf('0x13'));var db=require(_0x4faf('0x14'))['db'];config['redis']=_[_0x4faf('0x15')](config[_0x4faf('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x4faf('0x17'))(new Redis(config[_0x4faf('0x16')]));require(_0x4faf('0x18'))['register'](socket);function respondWithStatusCode(_0x544a7c,_0x356eb5){_0x356eb5=_0x356eb5||0xcc;return function(_0x464049){if(_0x464049){return _0x544a7c[_0x4faf('0x19')](_0x356eb5);}return _0x544a7c[_0x4faf('0x1a')](_0x356eb5)[_0x4faf('0x1b')]();};}function respondWithResult(_0x2c108c,_0x15e868){_0x15e868=_0x15e868||0xc8;return function(_0xdb3c0b){if(_0xdb3c0b){return _0x2c108c[_0x4faf('0x1a')](_0x15e868)[_0x4faf('0x1c')](_0xdb3c0b);}};}function respondWithFilteredResult(_0xb07d81,_0x293cd2){return function(_0x562bc5){if(_0x562bc5){var _0x4a174a=typeof _0x293cd2[_0x4faf('0x1d')]===_0x4faf('0x1e')&&typeof _0x293cd2['limit']===_0x4faf('0x1e');var _0x312432=_0x562bc5['count'];var _0x193447=_0x4a174a?0x0:_0x293cd2[_0x4faf('0x1d')];var _0x5b13fd=_0x4a174a?_0x562bc5[_0x4faf('0x1f')]:_0x293cd2[_0x4faf('0x1d')]+_0x293cd2[_0x4faf('0x20')];var _0x19c4f7;if(_0x5b13fd>=_0x312432){_0x5b13fd=_0x312432;_0x19c4f7=0xc8;}else{_0x19c4f7=0xce;}_0xb07d81['status'](_0x19c4f7);return _0xb07d81[_0x4faf('0x21')](_0x4faf('0x22'),_0x193447+'-'+_0x5b13fd+'/'+_0x312432)[_0x4faf('0x1c')](_0x562bc5);}return null;};}function patchUpdates(_0x549074){return function(_0x520b80){try{jsonpatch[_0x4faf('0x23')](_0x520b80,_0x549074,!![]);}catch(_0x3c58e3){return BPromise[_0x4faf('0x24')](_0x3c58e3);}return _0x520b80[_0x4faf('0x25')]();};}function saveUpdates(_0x39b933,_0x4b02c7){return function(_0x5335b8){if(_0x5335b8){return _0x5335b8[_0x4faf('0x26')](_0x39b933)[_0x4faf('0x27')](function(_0xa23bd4){return _0xa23bd4;});}return null;};}function removeEntity(_0x4e4ce2,_0x4aea49){return function(_0x248ef9){if(_0x248ef9){return _0x248ef9['destroy']()[_0x4faf('0x27')](function(){_0x4e4ce2[_0x4faf('0x1a')](0xcc)[_0x4faf('0x1b')]();});}};}function handleEntityNotFound(_0x5c5d55,_0x1bdb20){return function(_0x2ee669){if(!_0x2ee669){_0x5c5d55['sendStatus'](0x194);}return _0x2ee669;};}function handleError(_0x9f6b34,_0x46611f){_0x46611f=_0x46611f||0x1f4;return function(_0x4a8cd9){logger[_0x4faf('0x28')](_0x4a8cd9[_0x4faf('0x29')]);if(_0x4a8cd9[_0x4faf('0x2a')]){delete _0x4a8cd9[_0x4faf('0x2a')];}_0x9f6b34[_0x4faf('0x1a')](_0x46611f)[_0x4faf('0x2b')](_0x4a8cd9);};}exports['index']=function(_0xc4ec9d,_0x539759){var _0x36b762={},_0x585683={},_0x16a65d={'count':0x0,'rows':[]};var _0x1f95e2=_[_0x4faf('0x2c')](db[_0x4faf('0x2d')][_0x4faf('0x2e')],function(_0x48cce1){return{'name':_0x48cce1[_0x4faf('0x2f')],'type':_0x48cce1[_0x4faf('0x30')]['key']};});_0x585683[_0x4faf('0x31')]=_['map'](_0x1f95e2,_0x4faf('0x2a'));_0x585683[_0x4faf('0x32')]=_[_0x4faf('0x33')](_0xc4ec9d[_0x4faf('0x32')]);_0x585683[_0x4faf('0x34')]=_[_0x4faf('0x35')](_0x585683[_0x4faf('0x31')],_0x585683[_0x4faf('0x32')]);_0x36b762['attributes']=_[_0x4faf('0x35')](_0x585683[_0x4faf('0x31')],qs[_0x4faf('0x36')](_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x36')]));_0x36b762[_0x4faf('0x37')]=_0x36b762['attributes'][_0x4faf('0x38')]?_0x36b762['attributes']:_0x585683[_0x4faf('0x31')];if(!_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x39')](_0x4faf('0x3a'))){_0x36b762[_0x4faf('0x20')]=qs['limit'](_0xc4ec9d[_0x4faf('0x32')]['limit']);_0x36b762[_0x4faf('0x1d')]=qs[_0x4faf('0x1d')](_0xc4ec9d['query'][_0x4faf('0x1d')]);}_0x36b762[_0x4faf('0x3b')]=qs[_0x4faf('0x3c')](_0xc4ec9d['query'][_0x4faf('0x3c')]);_0x36b762[_0x4faf('0x3d')]=qs[_0x4faf('0x34')](_['pick'](_0xc4ec9d[_0x4faf('0x32')],_0x585683['filters']),_0x1f95e2);if(_0xc4ec9d[_0x4faf('0x32')]['filter']){_0x36b762[_0x4faf('0x3d')]=_[_0x4faf('0x3e')](_0x36b762[_0x4faf('0x3d')],{'$or':_['map'](_0x1f95e2,function(_0x843157){if(_0x843157[_0x4faf('0x30')]!==_0x4faf('0x3f')){var _0x3f08e4={};_0x3f08e4[_0x843157[_0x4faf('0x2a')]]={'$like':'%'+_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x40')]+'%'};return _0x3f08e4;}})});}_0x36b762=_[_0x4faf('0x3e')]({},_0x36b762,_0xc4ec9d['options']);var _0x34d501={'where':_0x36b762[_0x4faf('0x3d')]};return db[_0x4faf('0x2d')][_0x4faf('0x1f')](_0x34d501)['then'](function(_0x168b4f){_0x16a65d[_0x4faf('0x1f')]=_0x168b4f;if(_0xc4ec9d[_0x4faf('0x32')][_0x4faf('0x41')]){_0x36b762['include']=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x36b762);})['then'](function(_0x344207){_0x16a65d[_0x4faf('0x42')]=_0x344207;return _0x16a65d;})[_0x4faf('0x27')](respondWithFilteredResult(_0x539759,_0x36b762))[_0x4faf('0x43')](handleError(_0x539759,null));};exports[_0x4faf('0x44')]=function(_0x1b9cd7,_0x3c5872){var _0x28a53e={'raw':!![],'where':{'id':_0x1b9cd7['params']['id']}},_0x310162={};_0x310162[_0x4faf('0x31')]=_['keys'](db[_0x4faf('0x2d')][_0x4faf('0x2e')]);_0x310162[_0x4faf('0x32')]=_[_0x4faf('0x33')](_0x1b9cd7[_0x4faf('0x32')]);_0x310162['filters']=_[_0x4faf('0x35')](_0x310162[_0x4faf('0x31')],_0x310162[_0x4faf('0x32')]);_0x28a53e[_0x4faf('0x37')]=_['intersection'](_0x310162[_0x4faf('0x31')],qs['fields'](_0x1b9cd7['query'][_0x4faf('0x36')]));_0x28a53e[_0x4faf('0x37')]=_0x28a53e[_0x4faf('0x37')][_0x4faf('0x38')]?_0x28a53e['attributes']:_0x310162['model'];if(_0x1b9cd7[_0x4faf('0x32')][_0x4faf('0x41')]){_0x28a53e[_0x4faf('0x45')]=[{'all':!![]}];}_0x28a53e=_[_0x4faf('0x3e')]({},_0x28a53e,_0x1b9cd7['options']);return db['ChatInternalMessage'][_0x4faf('0x46')](_0x28a53e)[_0x4faf('0x27')](handleEntityNotFound(_0x3c5872,null))[_0x4faf('0x27')](respondWithResult(_0x3c5872,null))[_0x4faf('0x43')](handleError(_0x3c5872,null));};exports[_0x4faf('0x47')]=function(_0xd8d071,_0x4d2576){return db['ChatInternalMessage'][_0x4faf('0x47')](_0xd8d071[_0x4faf('0x48')],{})['then'](respondWithResult(_0x4d2576,0xc9))[_0x4faf('0x43')](handleError(_0x4d2576,null));};exports[_0x4faf('0x26')]=function(_0x3bfc99,_0x5480c0){if(_0x3bfc99[_0x4faf('0x48')]['id']){delete _0x3bfc99['body']['id'];}return db['ChatInternalMessage'][_0x4faf('0x46')]({'where':{'id':_0x3bfc99[_0x4faf('0x49')]['id']}})[_0x4faf('0x27')](handleEntityNotFound(_0x5480c0,null))[_0x4faf('0x27')](saveUpdates(_0x3bfc99[_0x4faf('0x48')],null))[_0x4faf('0x27')](respondWithResult(_0x5480c0,null))[_0x4faf('0x43')](handleError(_0x5480c0,null));};exports[_0x4faf('0x4a')]=function(_0x428025,_0x5e5e8c){return db[_0x4faf('0x2d')]['find']({'where':{'id':_0x428025[_0x4faf('0x49')]['id']}})[_0x4faf('0x27')](handleEntityNotFound(_0x5e5e8c,null))['then'](removeEntity(_0x5e5e8c,null))[_0x4faf('0x43')](handleError(_0x5e5e8c,null));};exports[_0x4faf('0x4b')]=function(_0x32df4b,_0x5f2b38){return db[_0x4faf('0x2d')][_0x4faf('0x4b')]()['then'](respondWithResult(_0x5f2b38,null))['catch'](handleError(_0x5f2b38,null));};function wrapUser(_0x2b1b0d){return function(_0x4f62eb){var _0x4b9554=_0x2b1b0d[_0x4faf('0x4c')]({'plain':!![]});_0x4b9554[_0x4faf('0x4d')]=[];if(_0x4f62eb){_0x4b9554[_0x4faf('0x4e')]=_0x4f62eb[_0x4faf('0x4f')];_0x4b9554[_0x4faf('0x50')]=_0x4f62eb;}else{_0x4b9554[_0x4faf('0x4e')]=moment(0x0)[_0x4faf('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b9554[_0x4faf('0x50')]={};}return _0x4b9554;};}exports['getUsers']=function(_0x378696,_0x2fe724,_0x4b9e1b){var _0x5a9b2f=[];return db[_0x4faf('0x52')][_0x4faf('0x53')]({'where':{'role':['agent','admin',_0x4faf('0x54')]},'attributes':['id',_0x4faf('0x55'),'name','role',_0x4faf('0x56'),_0x4faf('0x57'),_0x4faf('0x58'),_0x4faf('0x59'),_0x4faf('0x5a'),_0x4faf('0x5b')],'order':qs[_0x4faf('0x3c')](_0x4faf('0x5c')),'include':[{'model':db[_0x4faf('0x5d')],'as':_0x4faf('0x5e'),'attributes':['id',_0x4faf('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x4faf('0x27')](function(_0x1bc82c){if(_0x1bc82c){var _0x2ff9c4=_0x378696['user'][_0x4faf('0x4c')]({'plain':!![]});if(!_0x2ff9c4)throw new Error(_0x4faf('0x5f'));if(_0x2ff9c4[_0x4faf('0x60')]===_0x4faf('0x54')){return db[_0x4faf('0x61')]['find']({'where':{'name':_0x4faf('0x62'),'userProfileId':_0x2ff9c4[_0x4faf('0x63')]},'raw':!![]})[_0x4faf('0x27')](function(_0x1d56c6){if(_0x1d56c6){if(_0x1d56c6[_0x4faf('0x64')]===0x0){return db[_0x4faf('0x65')][_0x4faf('0x53')]({'where':{'sectionId':_0x1d56c6['id']},'raw':!![]})[_0x4faf('0x27')](function(_0xc188ce){var _0x321e0c=[];if(_['isEmpty'](_0xc188ce)){_0x321e0c=_['filter'](_0x1bc82c,function(_0x5bbcd6){if(_0x5bbcd6[_0x4faf('0x60')]!==_0x4faf('0x66')){return _0x5bbcd6;}});return _0x321e0c;}else{for(var _0x46cdb3=0x0;_0x46cdb3<_0x1bc82c['length'];_0x46cdb3++){var _0x3b46f3=_0x1bc82c[_0x46cdb3];if(_0x3b46f3[_0x4faf('0x60')]===_0x4faf('0x66')){var _0x234d94=_[_0x4faf('0x46')](_0xc188ce,function(_0x214ded){return _0x214ded[_0x4faf('0x67')]===_0x3b46f3['id'];});if(_0x234d94)_0x321e0c[_0x4faf('0x68')](_0x3b46f3);}else{_0x321e0c[_0x4faf('0x68')](_0x3b46f3);}}return _0x321e0c;}});}else{return _0x1bc82c;}}else{var _0x51ee13=_['filter'](_0x1bc82c,function(_0x546781){if(_0x546781['role']!==_0x4faf('0x66')){return _0x546781;}});return _0x51ee13;}});}else{return _0x1bc82c;}}})[_0x4faf('0x27')](function(_0x8796f6){var _0x29bde9=[];if(_0x8796f6){_0x5a9b2f=_0x8796f6;for(var _0x357f81=0x0;_0x357f81<_0x8796f6[_0x4faf('0x38')];_0x357f81+=0x1){_0x5a9b2f[_0x357f81]['messages']=[];_0x29bde9[_0x4faf('0x68')](db[_0x4faf('0x2d')][_0x4faf('0x46')]({'where':{'FromId':[_0x378696[_0x4faf('0x54')]['id'],_0x8796f6[_0x357f81]['id']],'ToId':[_0x378696[_0x4faf('0x54')]['id'],_0x8796f6[_0x357f81]['id']],'ChatGroupId':null},'attributes':['id',_0x4faf('0x4f'),_0x4faf('0x69'),_0x4faf('0x6a'),_0x4faf('0x6b'),_0x4faf('0x48')],'order':qs[_0x4faf('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4faf('0x27')](wrapUser(_0x8796f6[_0x357f81])));}return BPromise[_0x4faf('0x6c')](_0x29bde9);}return[];})[_0x4faf('0x27')](function(_0x15a2d1){return{'rows':_0x15a2d1,'count':_0x15a2d1['length']};})[_0x4faf('0x27')](respondWithResult(_0x2fe724,null))['catch'](handleError(_0x2fe724,null));}; \ No newline at end of file +var _0xca0f=['status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','catch','show','find','create','body','params','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','name','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','all','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus'];(function(_0x58581a,_0x400937){var _0x162863=function(_0x355051){while(--_0x355051){_0x58581a['push'](_0x58581a['shift']());}};_0x162863(++_0x400937);}(_0xca0f,0xc7));var _0xfca0=function(_0x1cd173,_0x1d212f){_0x1cd173=_0x1cd173-0x0;var _0x3352c2=_0xca0f[_0x1cd173];return _0x3352c2;};'use strict';var emlformat=require(_0xfca0('0x0'));var rimraf=require(_0xfca0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfca0('0x2'));var moment=require(_0xfca0('0x3'));var BPromise=require(_0xfca0('0x4'));var Mustache=require(_0xfca0('0x5'));var util=require(_0xfca0('0x6'));var path=require(_0xfca0('0x7'));var sox=require(_0xfca0('0x8'));var csv=require(_0xfca0('0x9'));var ejs=require(_0xfca0('0xa'));var fs=require('fs');var fs_extra=require(_0xfca0('0xb'));var _=require(_0xfca0('0xc'));var squel=require(_0xfca0('0xd'));var crypto=require(_0xfca0('0xe'));var jsforce=require(_0xfca0('0xf'));var deskjs=require(_0xfca0('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfca0('0x11'));var Papa=require(_0xfca0('0x12'));var Redis=require(_0xfca0('0x13'));var authService=require(_0xfca0('0x14'));var qs=require(_0xfca0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xfca0('0x16'));var config=require(_0xfca0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfca0('0x18'))['db'];config[_0xfca0('0x19')]=_[_0xfca0('0x1a')](config[_0xfca0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xfca0('0x1b'))(new Redis(config[_0xfca0('0x19')]));require(_0xfca0('0x1c'))[_0xfca0('0x1d')](socket);function respondWithStatusCode(_0x1afc83,_0x3f9db7){_0x3f9db7=_0x3f9db7||0xcc;return function(_0x38a5f2){if(_0x38a5f2){return _0x1afc83[_0xfca0('0x1e')](_0x3f9db7);}return _0x1afc83[_0xfca0('0x1f')](_0x3f9db7)[_0xfca0('0x20')]();};}function respondWithResult(_0x49ab04,_0x43de09){_0x43de09=_0x43de09||0xc8;return function(_0x30c52c){if(_0x30c52c){return _0x49ab04[_0xfca0('0x1f')](_0x43de09)[_0xfca0('0x21')](_0x30c52c);}};}function respondWithFilteredResult(_0x24221e,_0x3a447d){return function(_0x5f35fe){if(_0x5f35fe){var _0x201737=typeof _0x3a447d[_0xfca0('0x22')]===_0xfca0('0x23')&&typeof _0x3a447d[_0xfca0('0x24')]===_0xfca0('0x23');var _0x164902=_0x5f35fe[_0xfca0('0x25')];var _0x1d4d0d=_0x201737?0x0:_0x3a447d[_0xfca0('0x22')];var _0x582d19=_0x201737?_0x5f35fe['count']:_0x3a447d[_0xfca0('0x22')]+_0x3a447d[_0xfca0('0x24')];var _0x1b84b8;if(_0x582d19>=_0x164902){_0x582d19=_0x164902;_0x1b84b8=0xc8;}else{_0x1b84b8=0xce;}_0x24221e[_0xfca0('0x1f')](_0x1b84b8);return _0x24221e['set']('Content-Range',_0x1d4d0d+'-'+_0x582d19+'/'+_0x164902)[_0xfca0('0x21')](_0x5f35fe);}return null;};}function patchUpdates(_0x4ccec1){return function(_0x1b2aed){try{jsonpatch[_0xfca0('0x26')](_0x1b2aed,_0x4ccec1,!![]);}catch(_0x50443e){return BPromise[_0xfca0('0x27')](_0x50443e);}return _0x1b2aed[_0xfca0('0x28')]();};}function saveUpdates(_0x56b038,_0x5dbba8){return function(_0x8deff3){if(_0x8deff3){return _0x8deff3[_0xfca0('0x29')](_0x56b038)['then'](function(_0x354ee0){return _0x354ee0;});}return null;};}function removeEntity(_0x2d4c29,_0x593e29){return function(_0xd768a8){if(_0xd768a8){return _0xd768a8[_0xfca0('0x2a')]()[_0xfca0('0x2b')](function(){_0x2d4c29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39637b,_0x40bf7d){return function(_0x39680a){if(!_0x39680a){_0x39637b[_0xfca0('0x1e')](0x194);}return _0x39680a;};}function handleError(_0x278ce1,_0x232b80){_0x232b80=_0x232b80||0x1f4;return function(_0x16d75d){logger[_0xfca0('0x2c')](_0x16d75d[_0xfca0('0x2d')]);if(_0x16d75d['name']){delete _0x16d75d['name'];}_0x278ce1['status'](_0x232b80)[_0xfca0('0x2e')](_0x16d75d);};}exports[_0xfca0('0x2f')]=function(_0x56dac8,_0x4358b4){var _0x43cbb0={},_0x3bc5bd={},_0x54084d={'count':0x0,'rows':[]};var _0x3fcb8c=_['map'](db['ChatInternalMessage'][_0xfca0('0x30')],function(_0x1c8da4){return{'name':_0x1c8da4[_0xfca0('0x31')],'type':_0x1c8da4[_0xfca0('0x32')][_0xfca0('0x33')]};});_0x3bc5bd[_0xfca0('0x34')]=_[_0xfca0('0x35')](_0x3fcb8c,'name');_0x3bc5bd[_0xfca0('0x36')]=_[_0xfca0('0x37')](_0x56dac8[_0xfca0('0x36')]);_0x3bc5bd[_0xfca0('0x38')]=_[_0xfca0('0x39')](_0x3bc5bd[_0xfca0('0x34')],_0x3bc5bd['query']);_0x43cbb0[_0xfca0('0x3a')]=_[_0xfca0('0x39')](_0x3bc5bd[_0xfca0('0x34')],qs[_0xfca0('0x3b')](_0x56dac8['query'][_0xfca0('0x3b')]));_0x43cbb0[_0xfca0('0x3a')]=_0x43cbb0[_0xfca0('0x3a')][_0xfca0('0x3c')]?_0x43cbb0[_0xfca0('0x3a')]:_0x3bc5bd[_0xfca0('0x34')];if(!_0x56dac8[_0xfca0('0x36')][_0xfca0('0x3d')](_0xfca0('0x3e'))){_0x43cbb0[_0xfca0('0x24')]=qs['limit'](_0x56dac8[_0xfca0('0x36')]['limit']);_0x43cbb0['offset']=qs[_0xfca0('0x22')](_0x56dac8['query'][_0xfca0('0x22')]);}_0x43cbb0[_0xfca0('0x3f')]=qs[_0xfca0('0x40')](_0x56dac8[_0xfca0('0x36')][_0xfca0('0x40')]);_0x43cbb0[_0xfca0('0x41')]=qs[_0xfca0('0x38')](_[_0xfca0('0x42')](_0x56dac8[_0xfca0('0x36')],_0x3bc5bd['filters']),_0x3fcb8c);if(_0x56dac8[_0xfca0('0x36')][_0xfca0('0x43')]){_0x43cbb0[_0xfca0('0x41')]=_[_0xfca0('0x44')](_0x43cbb0[_0xfca0('0x41')],{'$or':_['map'](_0x3fcb8c,function(_0x3d6ce1){if(_0x3d6ce1[_0xfca0('0x32')]!==_0xfca0('0x45')){var _0x5449d5={};_0x5449d5[_0x3d6ce1['name']]={'$like':'%'+_0x56dac8[_0xfca0('0x36')][_0xfca0('0x43')]+'%'};return _0x5449d5;}})});}_0x43cbb0=_[_0xfca0('0x44')]({},_0x43cbb0,_0x56dac8[_0xfca0('0x46')]);var _0xeb74eb={'where':_0x43cbb0['where']};return db[_0xfca0('0x47')][_0xfca0('0x25')](_0xeb74eb)[_0xfca0('0x2b')](function(_0x15baeb){_0x54084d[_0xfca0('0x25')]=_0x15baeb;if(_0x56dac8[_0xfca0('0x36')][_0xfca0('0x48')]){_0x43cbb0[_0xfca0('0x49')]=[{'all':!![]}];}return db[_0xfca0('0x47')]['findAll'](_0x43cbb0);})[_0xfca0('0x2b')](function(_0x4f2869){_0x54084d['rows']=_0x4f2869;return _0x54084d;})[_0xfca0('0x2b')](respondWithFilteredResult(_0x4358b4,_0x43cbb0))[_0xfca0('0x4a')](handleError(_0x4358b4,null));};exports[_0xfca0('0x4b')]=function(_0x449e2d,_0x347d11){var _0x35f77b={'raw':!![],'where':{'id':_0x449e2d['params']['id']}},_0xfa4e37={};_0xfa4e37[_0xfca0('0x34')]=_[_0xfca0('0x37')](db[_0xfca0('0x47')][_0xfca0('0x30')]);_0xfa4e37[_0xfca0('0x36')]=_[_0xfca0('0x37')](_0x449e2d[_0xfca0('0x36')]);_0xfa4e37['filters']=_[_0xfca0('0x39')](_0xfa4e37[_0xfca0('0x34')],_0xfa4e37[_0xfca0('0x36')]);_0x35f77b[_0xfca0('0x3a')]=_['intersection'](_0xfa4e37[_0xfca0('0x34')],qs['fields'](_0x449e2d[_0xfca0('0x36')]['fields']));_0x35f77b[_0xfca0('0x3a')]=_0x35f77b['attributes']['length']?_0x35f77b[_0xfca0('0x3a')]:_0xfa4e37['model'];if(_0x449e2d[_0xfca0('0x36')]['includeAll']){_0x35f77b[_0xfca0('0x49')]=[{'all':!![]}];}_0x35f77b=_[_0xfca0('0x44')]({},_0x35f77b,_0x449e2d['options']);return db[_0xfca0('0x47')][_0xfca0('0x4c')](_0x35f77b)[_0xfca0('0x2b')](handleEntityNotFound(_0x347d11,null))[_0xfca0('0x2b')](respondWithResult(_0x347d11,null))[_0xfca0('0x4a')](handleError(_0x347d11,null));};exports[_0xfca0('0x4d')]=function(_0x3ea83a,_0x46543e){return db[_0xfca0('0x47')]['create'](_0x3ea83a['body'],{})[_0xfca0('0x2b')](respondWithResult(_0x46543e,0xc9))[_0xfca0('0x4a')](handleError(_0x46543e,null));};exports['update']=function(_0x2e07d3,_0x1160d3){if(_0x2e07d3['body']['id']){delete _0x2e07d3[_0xfca0('0x4e')]['id'];}return db[_0xfca0('0x47')]['find']({'where':{'id':_0x2e07d3[_0xfca0('0x4f')]['id']}})[_0xfca0('0x2b')](handleEntityNotFound(_0x1160d3,null))[_0xfca0('0x2b')](saveUpdates(_0x2e07d3['body'],null))['then'](respondWithResult(_0x1160d3,null))[_0xfca0('0x4a')](handleError(_0x1160d3,null));};exports[_0xfca0('0x2a')]=function(_0x5da16c,_0x486efe){return db[_0xfca0('0x47')][_0xfca0('0x4c')]({'where':{'id':_0x5da16c[_0xfca0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x486efe,null))[_0xfca0('0x2b')](removeEntity(_0x486efe,null))[_0xfca0('0x4a')](handleError(_0x486efe,null));};exports['describe']=function(_0x3257d7,_0x5e6b00){return db['ChatInternalMessage']['describe']()[_0xfca0('0x2b')](respondWithResult(_0x5e6b00,null))[_0xfca0('0x4a')](handleError(_0x5e6b00,null));};function wrapUser(_0x3a85a0){return function(_0x2518e1){var _0xa5638f=_0x3a85a0[_0xfca0('0x50')]({'plain':!![]});_0xa5638f['messages']=[];if(_0x2518e1){_0xa5638f[_0xfca0('0x51')]=_0x2518e1[_0xfca0('0x52')];_0xa5638f[_0xfca0('0x53')]=_0x2518e1;}else{_0xa5638f[_0xfca0('0x51')]=moment(0x0)[_0xfca0('0x54')](_0xfca0('0x55'));_0xa5638f[_0xfca0('0x53')]={};}return _0xa5638f;};}exports[_0xfca0('0x56')]=function(_0x429951,_0x382222,_0x475705){var _0x4a9d3e=[];return db[_0xfca0('0x57')][_0xfca0('0x58')]({'where':{'role':[_0xfca0('0x59'),_0xfca0('0x5a'),_0xfca0('0x5b')]},'attributes':['id','fullname',_0xfca0('0x5c'),_0xfca0('0x5d'),_0xfca0('0x5e'),'internal',_0xfca0('0x5f'),_0xfca0('0x60'),_0xfca0('0x61'),_0xfca0('0x62')],'order':qs['sort'](_0xfca0('0x63')),'include':[{'model':db['VoiceQueue'],'as':_0xfca0('0x64'),'attributes':['id',_0xfca0('0x5c'),'type'],'through':{'attributes':[]}}]})[_0xfca0('0x2b')](function(_0x1dd67f){if(_0x1dd67f){var _0x1c30b0=_0x429951[_0xfca0('0x5b')]['get']({'plain':!![]});if(!_0x1c30b0)throw new Error(_0xfca0('0x65'));if(_0x1c30b0[_0xfca0('0x5d')]===_0xfca0('0x5b')){return db[_0xfca0('0x66')][_0xfca0('0x4c')]({'where':{'name':_0xfca0('0x67'),'userProfileId':_0x1c30b0[_0xfca0('0x68')]},'raw':!![]})[_0xfca0('0x2b')](function(_0x29af6d){if(_0x29af6d){if(_0x29af6d[_0xfca0('0x69')]===0x0){return db[_0xfca0('0x6a')]['findAll']({'where':{'sectionId':_0x29af6d['id']},'raw':!![]})[_0xfca0('0x2b')](function(_0x4c4855){var _0x33acd4=[];if(_[_0xfca0('0x6b')](_0x4c4855)){_0x33acd4=_[_0xfca0('0x43')](_0x1dd67f,function(_0x57079e){if(_0x57079e[_0xfca0('0x5d')]!==_0xfca0('0x59')){return _0x57079e;}});return _0x33acd4;}else{for(var _0x174a04=0x0;_0x174a04<_0x1dd67f[_0xfca0('0x3c')];_0x174a04++){var _0x3e37e3=_0x1dd67f[_0x174a04];if(_0x3e37e3[_0xfca0('0x5d')]===_0xfca0('0x59')){var _0x581427=_['find'](_0x4c4855,function(_0x1db54c){return _0x1db54c[_0xfca0('0x6c')]===_0x3e37e3['id'];});if(_0x581427)_0x33acd4['push'](_0x3e37e3);}else{_0x33acd4[_0xfca0('0x6d')](_0x3e37e3);}}return _0x33acd4;}});}else{return _0x1dd67f;}}else{var _0x4a9288=_[_0xfca0('0x43')](_0x1dd67f,function(_0x3086ab){if(_0x3086ab[_0xfca0('0x5d')]!=='agent'){return _0x3086ab;}});return _0x4a9288;}});}else{return _0x1dd67f;}}})[_0xfca0('0x2b')](function(_0x4c7c6c){var _0x16e055=[];if(_0x4c7c6c){_0x4a9d3e=_0x4c7c6c;for(var _0x3c8a05=0x0;_0x3c8a05<_0x4c7c6c['length'];_0x3c8a05+=0x1){_0x4a9d3e[_0x3c8a05][_0xfca0('0x6e')]=[];_0x16e055['push'](db[_0xfca0('0x47')][_0xfca0('0x4c')]({'where':{'FromId':[_0x429951['user']['id'],_0x4c7c6c[_0x3c8a05]['id']],'ToId':[_0x429951[_0xfca0('0x5b')]['id'],_0x4c7c6c[_0x3c8a05]['id']],'ChatGroupId':null},'attributes':['id',_0xfca0('0x52'),_0xfca0('0x6f'),_0xfca0('0x70'),_0xfca0('0x71'),_0xfca0('0x4e')],'order':qs[_0xfca0('0x40')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfca0('0x2b')](wrapUser(_0x4c7c6c[_0x3c8a05])));}return BPromise[_0xfca0('0x72')](_0x16e055);}return[];})['then'](function(_0x1e7eb3){return{'rows':_0x1e7eb3,'count':_0x1e7eb3[_0xfca0('0x3c')]};})['then'](respondWithResult(_0x382222,null))[_0xfca0('0x4a')](handleError(_0x382222,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2751de5..97df5b0 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 _0xe4aa=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xe4aa,0x114));var _0xae4a=function(_0x40bb0c,_0x21afb0){_0x40bb0c=_0x40bb0c-0x0;var _0x2c65e0=_0xe4aa[_0x40bb0c];return _0x2c65e0;};'use strict';var EventEmitter=require(_0xae4a('0x0'));var ChatInternalMessage=require(_0xae4a('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xae4a('0x2')](0x0);var events={'afterCreate':_0xae4a('0x3'),'afterUpdate':_0xae4a('0x4'),'afterDestroy':_0xae4a('0x5')};function emitEvent(_0x14ea67){return function(_0x52682a,_0x4f43c6,_0x478a21){ChatInternalMessageEvents[_0xae4a('0x6')](_0x14ea67+':'+_0x52682a['id'],_0x52682a);ChatInternalMessageEvents['emit'](_0x14ea67,_0x52682a);_0x478a21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xae4a('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xd647=['hook','exports','ChatInternalMessage','update','remove','emit'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd647,0x1ee));var _0x7d64=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0xd647[_0x9a7ea6];return _0x1c2040;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x7d64('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d64('0x1'),'afterDestroy':_0x7d64('0x2')};function emitEvent(_0x41cd79){return function(_0x5c8fef,_0x37d52f,_0x5bb3ff){ChatInternalMessageEvents[_0x7d64('0x3')](_0x41cd79+':'+_0x5c8fef['id'],_0x5c8fef);ChatInternalMessageEvents[_0x7d64('0x3')](_0x41cd79,_0x5c8fef);_0x5bb3ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x7d64('0x4')](e,emitEvent(event));}}module[_0x7d64('0x5')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index efc907b..0a3ae4d 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 _0xdb29=['rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','api','moment','bluebird','path'];(function(_0xac3ebb,_0x3ae939){var _0x40ac9f=function(_0x4612df){while(--_0x4612df){_0xac3ebb['push'](_0xac3ebb['shift']());}};_0x40ac9f(++_0x3ae939);}(_0xdb29,0x10f));var _0x9db2=function(_0x240e91,_0x124240){_0x240e91=_0x240e91-0x0;var _0x5aeb50=_0xdb29[_0x240e91];return _0x5aeb50;};'use strict';var _=require(_0x9db2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9db2('0x1'));var moment=require(_0x9db2('0x2'));var BPromise=require(_0x9db2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9db2('0x4'));var rimraf=require(_0x9db2('0x5'));var config=require(_0x9db2('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x9db2('0x7')]=function(_0x4b0470,_0x39d37e){return _0x4b0470[_0x9db2('0x8')](_0x9db2('0x9'),attributes,{'tableName':_0x9db2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9db2('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x95fc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0x95fc,0x1cb));var _0xc95f=function(_0x22a2f1,_0x52b506){_0x22a2f1=_0x22a2f1-0x0;var _0x3f6899=_0x95fc[_0x22a2f1];return _0x3f6899;};'use strict';var _=require(_0xc95f('0x0'));var util=require(_0xc95f('0x1'));var logger=require(_0xc95f('0x2'))(_0xc95f('0x3'));var moment=require(_0xc95f('0x4'));var BPromise=require(_0xc95f('0x5'));var rp=require(_0xc95f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc95f('0x7'));var config=require(_0xc95f('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xc95f('0x9')]=function(_0x5d5492,_0x387578){return _0x5d5492[_0xc95f('0xa')](_0xc95f('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc95f('0xc'),'collate':_0xc95f('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index e5fab69..9e740f9 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 _0x8f0b=['request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x599b07,_0x22cd9f){var _0x490cc6=function(_0x4854f6){while(--_0x4854f6){_0x599b07['push'](_0x599b07['shift']());}};_0x490cc6(++_0x22cd9f);}(_0x8f0b,0x1a2));var _0xb8f0=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x8f0b[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xb8f0('0x0'));var util=require(_0xb8f0('0x1'));var moment=require(_0xb8f0('0x2'));var BPromise=require(_0xb8f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8f0('0x5'));var logger=require(_0xb8f0('0x6'))(_0xb8f0('0x7'));var config=require(_0xb8f0('0x8'));var jayson=require(_0xb8f0('0x9'));var client=jayson[_0xb8f0('0xa')][_0xb8f0('0xb')]({'port':0x232a});config[_0xb8f0('0xc')]=_[_0xb8f0('0xd')](config['redis'],{'host':_0xb8f0('0xe'),'port':0x18eb});var socket=require(_0xb8f0('0xf'))(new Redis(config[_0xb8f0('0xc')]));require(_0xb8f0('0x10'))['register'](socket);function respondWithRpcPromise(_0xff4d7f,_0x65cc25,_0x5e7d21){return new BPromise(function(_0x276f5a,_0x475606){return client[_0xb8f0('0x11')](_0xff4d7f,_0x5e7d21)[_0xb8f0('0x12')](function(_0x53231a){logger['info'](_0xb8f0('0x13'),_0x65cc25,_0xb8f0('0x14'));logger[_0xb8f0('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x65cc25,'request\x20sent',JSON[_0xb8f0('0x16')](_0x53231a));if(_0x53231a[_0xb8f0('0x17')]){if(_0x53231a['error'][_0xb8f0('0x18')]===0x1f4){logger['error'](_0xb8f0('0x13'),_0x65cc25,_0x53231a['error'][_0xb8f0('0x19')]);return _0x475606(_0x53231a[_0xb8f0('0x17')]['message']);}logger[_0xb8f0('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x65cc25,_0x53231a[_0xb8f0('0x17')][_0xb8f0('0x19')]);return _0x276f5a(_0x53231a[_0xb8f0('0x17')][_0xb8f0('0x19')]);}else{logger[_0xb8f0('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x65cc25,'request\x20sent');_0x276f5a(_0x53231a[_0xb8f0('0x1b')][_0xb8f0('0x19')]);}})[_0xb8f0('0x1c')](function(_0x12d952){logger[_0xb8f0('0x17')](_0xb8f0('0x13'),_0x65cc25,_0x12d952);_0x475606(_0x12d952);});});} \ No newline at end of file +var _0x5793=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x5793,0xb1));var _0x3579=function(_0x2dc6f6,_0x2b77e){_0x2dc6f6=_0x2dc6f6-0x0;var _0x457fe9=_0x5793[_0x2dc6f6];return _0x457fe9;};'use strict';var _=require(_0x3579('0x0'));var util=require(_0x3579('0x1'));var moment=require(_0x3579('0x2'));var BPromise=require(_0x3579('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3579('0x4'));var logger=require(_0x3579('0x5'))(_0x3579('0x6'));var config=require(_0x3579('0x7'));var jayson=require(_0x3579('0x8'));var client=jayson['client'][_0x3579('0x9')]({'port':0x232a});config['redis']=_[_0x3579('0xa')](config[_0x3579('0xb')],{'host':_0x3579('0xc'),'port':0x18eb});var socket=require(_0x3579('0xd'))(new Redis(config[_0x3579('0xb')]));require(_0x3579('0xe'))[_0x3579('0xf')](socket);function respondWithRpcPromise(_0x26f978,_0xe8765e,_0x1af737){return new BPromise(function(_0x1fbed3,_0x3cb520){return client['request'](_0x26f978,_0x1af737)[_0x3579('0x10')](function(_0x254730){logger[_0x3579('0x11')](_0x3579('0x12'),_0xe8765e,_0x3579('0x13'));logger[_0x3579('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xe8765e,_0x3579('0x13'),JSON[_0x3579('0x15')](_0x254730));if(_0x254730['error']){if(_0x254730[_0x3579('0x16')][_0x3579('0x17')]===0x1f4){logger[_0x3579('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0xe8765e,_0x254730[_0x3579('0x16')][_0x3579('0x18')]);return _0x3cb520(_0x254730[_0x3579('0x16')]['message']);}logger['error'](_0x3579('0x12'),_0xe8765e,_0x254730[_0x3579('0x16')][_0x3579('0x18')]);return _0x1fbed3(_0x254730[_0x3579('0x16')][_0x3579('0x18')]);}else{logger[_0x3579('0x11')](_0x3579('0x12'),_0xe8765e,_0x3579('0x13'));_0x1fbed3(_0x254730[_0x3579('0x19')][_0x3579('0x18')]);}})[_0x3579('0x1a')](function(_0x553f9f){logger[_0x3579('0x16')](_0x3579('0x12'),_0xe8765e,_0x553f9f);_0x3cb520(_0x553f9f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 910aaeb..218313c 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 _0xf9d1=['length','chatInternalMessage:','./chatInternalMessage.events','remove','update','removeListener','register'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0xf9d1,0x198));var _0x1f9d=function(_0x4f46f1,_0x2a39b9){_0x4f46f1=_0x4f46f1-0x0;var _0x5e146b=_0xf9d1[_0x4f46f1];return _0x5e146b;};'use strict';var ChatInternalMessageEvents=require(_0x1f9d('0x0'));var events=['save',_0x1f9d('0x1'),_0x1f9d('0x2')];function createListener(_0x2c2319,_0x3983b1){return function(_0x526382){_0x3983b1['emit'](_0x2c2319,_0x526382);};}function removeListener(_0x50f773,_0x18786a){return function(){ChatInternalMessageEvents[_0x1f9d('0x3')](_0x50f773,_0x18786a);};}exports[_0x1f9d('0x4')]=function(_0xcadff8){for(var _0x14b71c=0x0,_0x5efdfc=events[_0x1f9d('0x5')];_0x14b71c<_0x5efdfc;_0x14b71c++){var _0x5952f1=events[_0x14b71c];var _0xcf018a=createListener(_0x1f9d('0x6')+_0x5952f1,_0xcadff8);ChatInternalMessageEvents['on'](_0x5952f1,_0xcf018a);}}; \ No newline at end of file +var _0xfa4e=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','emit'];(function(_0x4aaaf6,_0x19cbca){var _0x29ca8a=function(_0xe53575){while(--_0xe53575){_0x4aaaf6['push'](_0x4aaaf6['shift']());}};_0x29ca8a(++_0x19cbca);}(_0xfa4e,0xac));var _0xefa4=function(_0xb1eff3,_0x29d37a){_0xb1eff3=_0xb1eff3-0x0;var _0x5319f0=_0xfa4e[_0xb1eff3];return _0x5319f0;};'use strict';var ChatInternalMessageEvents=require(_0xefa4('0x0'));var events=['save',_0xefa4('0x1'),'update'];function createListener(_0x16bd04,_0x144138){return function(_0x3c69a1){_0x144138[_0xefa4('0x2')](_0x16bd04,_0x3c69a1);};}function removeListener(_0x1cd2aa,_0x5a7546){return function(){ChatInternalMessageEvents[_0xefa4('0x3')](_0x1cd2aa,_0x5a7546);};}exports[_0xefa4('0x4')]=function(_0x4b9d34){for(var _0x39c9a6=0x0,_0x5124d1=events[_0xefa4('0x5')];_0x39c9a6<_0x5124d1;_0x39c9a6++){var _0x4498eb=events[_0x39c9a6];var _0x4c3f11=createListener(_0xefa4('0x6')+_0x4498eb,_0x4b9d34);ChatInternalMessageEvents['on'](_0x4498eb,_0x4c3f11);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 6901cf0..d612687 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 _0x1209=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/users','getUsers','/:id','show','post','create','delete','exports','util','path','Router'];(function(_0x4a2673,_0x1290a1){var _0x20f7ff=function(_0x48b1b3){while(--_0x48b1b3){_0x4a2673['push'](_0x4a2673['shift']());}};_0x20f7ff(++_0x1290a1);}(_0x1209,0x69));var _0x9120=function(_0xa86433,_0x36e3cf){_0xa86433=_0xa86433-0x0;var _0x669482=_0x1209[_0xa86433];return _0x669482;};'use strict';var multer=require('multer');var util=require(_0x9120('0x0'));var path=require(_0x9120('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9120('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9120('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9120('0x4'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x9120('0x5')](),controller[_0x9120('0x6')]);router[_0x9120('0x7')](_0x9120('0x8'),auth['isAuthenticated'](),controller[_0x9120('0x9')]);router[_0x9120('0x7')](_0x9120('0xa'),auth['isAuthenticated'](),controller[_0x9120('0xb')]);router[_0x9120('0x7')](_0x9120('0xc'),auth[_0x9120('0x5')](),controller[_0x9120('0xd')]);router[_0x9120('0xe')]('/',auth[_0x9120('0x5')](),controller[_0x9120('0xf')]);router['put'](_0x9120('0xc'),controller['update']);router[_0x9120('0x10')]('/:id',auth[_0x9120('0x5')](),controller['destroy']);module[_0x9120('0x11')]=router; \ No newline at end of file +var _0xf728=['isAuthenticated','describe','getUsers','/:id','put','update','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','index','get','/describe'];(function(_0x4304fd,_0x160fad){var _0x286f67=function(_0x4536c2){while(--_0x4536c2){_0x4304fd['push'](_0x4304fd['shift']());}};_0x286f67(++_0x160fad);}(_0xf728,0x1a0));var _0x8f72=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xf728[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x8f72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8f72('0x1'));var express=require('express');var router=express[_0x8f72('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8f72('0x3'));var interaction=require(_0x8f72('0x4'));var config=require('../../config/environment');var controller=require(_0x8f72('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x8f72('0x6')]);router[_0x8f72('0x7')](_0x8f72('0x8'),auth[_0x8f72('0x9')](),controller[_0x8f72('0xa')]);router['get']('/users',auth[_0x8f72('0x9')](),controller[_0x8f72('0xb')]);router[_0x8f72('0x7')](_0x8f72('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8f72('0x9')](),controller['create']);router[_0x8f72('0xd')]('/:id',controller[_0x8f72('0xe')]);router['delete'](_0x8f72('0xc'),auth['isAuthenticated'](),controller[_0x8f72('0xf')]);module[_0x8f72('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a8140a3..adbc559 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 _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x1d21,0x158));var _0x11d2=function(_0x42cc1f,_0xe9eb20){_0x42cc1f=_0x42cc1f-0x0;var _0x175df5=_0x1d21[_0x42cc1f];return _0x175df5;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}}; \ No newline at end of file +var _0x9c00=['DATE','STRING','TEXT','sequelize','exports','BOOLEAN','out'];(function(_0x2ec53e,_0x59038e){var _0x3a42d0=function(_0x8dfc05){while(--_0x8dfc05){_0x2ec53e['push'](_0x2ec53e['shift']());}};_0x3a42d0(++_0x59038e);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2de4e6,_0x2dbab4){_0x2de4e6=_0x2de4e6-0x0;var _0x156984=_0x9c00[_0x2de4e6];return _0x156984;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x09c0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x09c0('0x3')),'defaultValue':_0x09c0('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x09c0('0x4')]},'providerName':{'type':Sequelize[_0x09c0('0x5')]},'providerResponse':{'type':Sequelize[_0x09c0('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index a290bdd..87e096f 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 _0x8084=['limit','undefined','count','json','reject','update','sendStatus','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','find','create','body','destroy','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','chat','ChatInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','motionChannel','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8084,0x1d9));var _0x4808=function(_0x5f5d98,_0x8b21df){_0x5f5d98=_0x5f5d98-0x0;var _0x1a9dea=_0x8084[_0x5f5d98];return _0x1a9dea;};'use strict';var emlformat=require(_0x4808('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4808('0x1'));var jsonpatch=require(_0x4808('0x2'));var rp=require(_0x4808('0x3'));var moment=require(_0x4808('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4808('0x5'));var util=require(_0x4808('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4808('0x7'));var ejs=require(_0x4808('0x8'));var fs=require('fs');var fs_extra=require(_0x4808('0x9'));var _=require(_0x4808('0xa'));var squel=require('squel');var crypto=require(_0x4808('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4808('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4808('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4808('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4808('0xe'));var logger=require(_0x4808('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x4808('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x4808('0x11'))['db'];config[_0x4808('0x12')]=_[_0x4808('0x13')](config[_0x4808('0x12')],{'host':_0x4808('0x14'),'port':0x18eb});var socket=require(_0x4808('0x15'))(new Redis(config[_0x4808('0x12')]));require(_0x4808('0x16'))[_0x4808('0x17')](socket);var jayson=require(_0x4808('0x18'));var client=jayson[_0x4808('0x19')][_0x4808('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x4808('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x80ab62,_0x1c339b,_0x1b213a,_0x299e57){return new BPromise(function(_0x28510b,_0x3255b0){var _0x1d229a=_0x299e57||client;return _0x1d229a[_0x4808('0x1b')](_0x80ab62,_0x1b213a)[_0x4808('0x1c')](function(_0x10cd20){logger[_0x4808('0x1d')](_0x4808('0x1e'),_0x1c339b,_0x4808('0x1f'));logger[_0x4808('0x20')](_0x4808('0x21'),_0x1c339b,'request\x20sent',JSON[_0x4808('0x22')](_0x10cd20));if(_0x10cd20[_0x4808('0x23')]){if(_0x10cd20[_0x4808('0x23')][_0x4808('0x24')]===0x1f4){logger[_0x4808('0x23')](_0x4808('0x1e'),_0x1c339b,_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);return _0x3255b0(_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);}logger[_0x4808('0x23')]('ChatMessage,\x20%s,\x20%s',_0x1c339b,_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);return _0x28510b(_0x10cd20[_0x4808('0x23')][_0x4808('0x25')]);}else{logger[_0x4808('0x1d')](_0x4808('0x1e'),_0x1c339b,'request\x20sent');_0x28510b(_0x10cd20[_0x4808('0x26')][_0x4808('0x25')]);}})[_0x4808('0x27')](function(_0x2ee15f){logger[_0x4808('0x23')](_0x4808('0x1e'),_0x1c339b,_0x2ee15f);_0x3255b0(_0x2ee15f);});});}function respondWithStatusCode(_0x36647d,_0x21e404){_0x21e404=_0x21e404||0xcc;return function(_0x2891f9){if(_0x2891f9){return _0x36647d['sendStatus'](_0x21e404);}return _0x36647d[_0x4808('0x28')](_0x21e404)[_0x4808('0x29')]();};}function respondWithResult(_0x1808bf,_0x2280e0){_0x2280e0=_0x2280e0||0xc8;return function(_0x5b7194){if(_0x5b7194){return _0x1808bf[_0x4808('0x28')](_0x2280e0)['json'](_0x5b7194);}};}function respondWithFilteredResult(_0x1041a1,_0x5eb747){return function(_0x214626){if(_0x214626){var _0x5af70f=typeof _0x5eb747[_0x4808('0x2a')]==='undefined'&&typeof _0x5eb747[_0x4808('0x2b')]===_0x4808('0x2c');var _0x3b1699=_0x214626[_0x4808('0x2d')];var _0x518148=_0x5af70f?0x0:_0x5eb747['offset'];var _0x3c0c5b=_0x5af70f?_0x214626[_0x4808('0x2d')]:_0x5eb747[_0x4808('0x2a')]+_0x5eb747[_0x4808('0x2b')];var _0x3f5484;if(_0x3c0c5b>=_0x3b1699){_0x3c0c5b=_0x3b1699;_0x3f5484=0xc8;}else{_0x3f5484=0xce;}_0x1041a1[_0x4808('0x28')](_0x3f5484);return _0x1041a1['set']('Content-Range',_0x518148+'-'+_0x3c0c5b+'/'+_0x3b1699)[_0x4808('0x2e')](_0x214626);}return null;};}function patchUpdates(_0x315584){return function(_0x56b1dd){try{jsonpatch['apply'](_0x56b1dd,_0x315584,!![]);}catch(_0x26312a){return BPromise[_0x4808('0x2f')](_0x26312a);}return _0x56b1dd['save']();};}function saveUpdates(_0xe6617a,_0x46104f){return function(_0x1eb4f3){if(_0x1eb4f3){return _0x1eb4f3[_0x4808('0x30')](_0xe6617a)[_0x4808('0x1c')](function(_0x1fbb27){return _0x1fbb27;});}return null;};}function removeEntity(_0x287dd8,_0xaf0b7c){return function(_0x3d5bc9){if(_0x3d5bc9){return _0x3d5bc9['destroy']()[_0x4808('0x1c')](function(){_0x287dd8['status'](0xcc)[_0x4808('0x29')]();});}};}function handleEntityNotFound(_0x2527e6,_0x36219f){return function(_0xedb3ef){if(!_0xedb3ef){_0x2527e6[_0x4808('0x31')](0x194);}return _0xedb3ef;};}function handleError(_0x3aeda8,_0xf859c7){_0xf859c7=_0xf859c7||0x1f4;return function(_0x44e8eb){logger[_0x4808('0x23')](_0x44e8eb[_0x4808('0x32')]);if(_0x44e8eb['name']){delete _0x44e8eb[_0x4808('0x33')];}_0x3aeda8[_0x4808('0x28')](_0xf859c7)[_0x4808('0x34')](_0x44e8eb);};}exports[_0x4808('0x35')]=function(_0x30c44,_0x3cf1ce){var _0x373916={},_0x55645a={},_0x571787={'count':0x0,'rows':[]};var _0x5363cc=_['map'](db[_0x4808('0x36')][_0x4808('0x37')],function(_0x5ab08c){return{'name':_0x5ab08c[_0x4808('0x38')],'type':_0x5ab08c[_0x4808('0x39')]['key']};});_0x55645a[_0x4808('0x3a')]=_[_0x4808('0x3b')](_0x5363cc,_0x4808('0x33'));_0x55645a[_0x4808('0x3c')]=_['keys'](_0x30c44['query']);_0x55645a[_0x4808('0x3d')]=_[_0x4808('0x3e')](_0x55645a[_0x4808('0x3a')],_0x55645a[_0x4808('0x3c')]);_0x373916['attributes']=_[_0x4808('0x3e')](_0x55645a[_0x4808('0x3a')],qs[_0x4808('0x3f')](_0x30c44[_0x4808('0x3c')][_0x4808('0x3f')]));_0x373916[_0x4808('0x40')]=_0x373916[_0x4808('0x40')][_0x4808('0x41')]?_0x373916['attributes']:_0x55645a[_0x4808('0x3a')];if(!_0x30c44[_0x4808('0x3c')][_0x4808('0x42')](_0x4808('0x43'))){_0x373916['limit']=qs[_0x4808('0x2b')](_0x30c44[_0x4808('0x3c')][_0x4808('0x2b')]);_0x373916[_0x4808('0x2a')]=qs[_0x4808('0x2a')](_0x30c44[_0x4808('0x3c')][_0x4808('0x2a')]);}_0x373916[_0x4808('0x44')]=qs[_0x4808('0x45')](_0x30c44[_0x4808('0x3c')][_0x4808('0x45')]);_0x373916[_0x4808('0x46')]=qs[_0x4808('0x3d')](_[_0x4808('0x47')](_0x30c44[_0x4808('0x3c')],_0x55645a[_0x4808('0x3d')]),_0x5363cc);if(_0x30c44[_0x4808('0x3c')][_0x4808('0x48')]){_0x373916['where']=_[_0x4808('0x49')](_0x373916[_0x4808('0x46')],{'$or':_[_0x4808('0x3b')](_0x5363cc,function(_0x12d60c){if(_0x12d60c[_0x4808('0x39')]!==_0x4808('0x4a')){var _0x17214f={};_0x17214f[_0x12d60c['name']]={'$like':'%'+_0x30c44[_0x4808('0x3c')][_0x4808('0x48')]+'%'};return _0x17214f;}})});}_0x373916=_[_0x4808('0x49')]({},_0x373916,_0x30c44['options']);var _0x303710={'where':_0x373916[_0x4808('0x46')]};return db[_0x4808('0x36')][_0x4808('0x2d')](_0x303710)[_0x4808('0x1c')](function(_0x5cce37){_0x571787[_0x4808('0x2d')]=_0x5cce37;if(_0x30c44[_0x4808('0x3c')][_0x4808('0x4b')]){_0x373916[_0x4808('0x4c')]=[{'all':!![]}];}return db[_0x4808('0x36')]['findAll'](_0x373916);})['then'](function(_0x442042){_0x571787[_0x4808('0x4d')]=_0x442042;return _0x571787;})[_0x4808('0x1c')](respondWithFilteredResult(_0x3cf1ce,_0x373916))['catch'](handleError(_0x3cf1ce,null));};exports[_0x4808('0x4e')]=function(_0x37aa29,_0x580279){var _0x5a2e23={'raw':!![],'where':{'id':_0x37aa29[_0x4808('0x4f')]['id']}},_0x4dec63={};_0x4dec63[_0x4808('0x3a')]=_[_0x4808('0x50')](db[_0x4808('0x36')]['rawAttributes']);_0x4dec63['query']=_[_0x4808('0x50')](_0x37aa29[_0x4808('0x3c')]);_0x4dec63['filters']=_['intersection'](_0x4dec63[_0x4808('0x3a')],_0x4dec63['query']);_0x5a2e23[_0x4808('0x40')]=_[_0x4808('0x3e')](_0x4dec63[_0x4808('0x3a')],qs[_0x4808('0x3f')](_0x37aa29['query'][_0x4808('0x3f')]));_0x5a2e23[_0x4808('0x40')]=_0x5a2e23[_0x4808('0x40')]['length']?_0x5a2e23['attributes']:_0x4dec63[_0x4808('0x3a')];if(_0x37aa29[_0x4808('0x3c')][_0x4808('0x4b')]){_0x5a2e23['include']=[{'all':!![]}];}_0x5a2e23=_['merge']({},_0x5a2e23,_0x37aa29['options']);return db[_0x4808('0x36')][_0x4808('0x51')](_0x5a2e23)[_0x4808('0x1c')](handleEntityNotFound(_0x580279,null))[_0x4808('0x1c')](respondWithResult(_0x580279,null))['catch'](handleError(_0x580279,null));};exports[_0x4808('0x52')]=function(_0x5a4ae5,_0x4870be){return db[_0x4808('0x36')][_0x4808('0x52')](_0x5a4ae5[_0x4808('0x53')],{})[_0x4808('0x1c')](respondWithResult(_0x4870be,0xc9))[_0x4808('0x27')](handleError(_0x4870be,null));};exports[_0x4808('0x30')]=function(_0x25815a,_0x3c6300){if(_0x25815a[_0x4808('0x53')]['id']){delete _0x25815a[_0x4808('0x53')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x25815a[_0x4808('0x4f')]['id']}})[_0x4808('0x1c')](handleEntityNotFound(_0x3c6300,null))[_0x4808('0x1c')](saveUpdates(_0x25815a[_0x4808('0x53')],null))[_0x4808('0x1c')](respondWithResult(_0x3c6300,null))[_0x4808('0x27')](handleError(_0x3c6300,null));};exports[_0x4808('0x54')]=function(_0x395a6f,_0x29c8d4){return db[_0x4808('0x36')][_0x4808('0x51')]({'where':{'id':_0x395a6f[_0x4808('0x4f')]['id']}})[_0x4808('0x1c')](handleEntityNotFound(_0x29c8d4,null))[_0x4808('0x1c')](removeEntity(_0x29c8d4,null))[_0x4808('0x27')](handleError(_0x29c8d4,null));};exports[_0x4808('0x55')]=function(_0x57cd2e,_0x23a21a){return db[_0x4808('0x36')][_0x4808('0x55')]()[_0x4808('0x1c')](respondWithResult(_0x23a21a,null))['catch'](handleError(_0x23a21a,null));};var interaction_log=require(_0x4808('0xf'))(_0x4808('0x56'));exports[_0x4808('0x57')]=function(_0x16cae5,_0x17893e,_0x23221b){var _0x13f168={'agent':{},'channel':'chat'};if(_0x16cae5[_0x4808('0x53')]['id']){delete _0x16cae5[_0x4808('0x53')]['id'];}_0x16cae5['body'][_0x4808('0x58')]=!![];_0x16cae5[_0x4808('0x53')][_0x4808('0x59')]=moment()[_0x4808('0x5a')](_0x4808('0x5b'));_0x16cae5['body'][_0x4808('0x5c')]=_0x16cae5[_0x4808('0x53')][_0x4808('0x5c')]||_0x16cae5[_0x4808('0x5d')]['id'];_0x13f168['agent']['id']=_0x16cae5['body'][_0x4808('0x5c')];return db['ChatMessage'][_0x4808('0x51')]({'where':{'id':_0x16cae5[_0x4808('0x4f')]['id'],'UserId':null}})[_0x4808('0x1c')](handleEntityNotFound(_0x17893e,null))[_0x4808('0x1c')](saveUpdates(_0x16cae5[_0x4808('0x53')],null))[_0x4808('0x1c')](function(_0x33254d){if(_0x33254d){_0x13f168['message']=_0x33254d['get']({'plain':!![]});return db['ChatInteraction'][_0x4808('0x51')]({'where':{'id':_0x33254d[_0x4808('0x5e')]}});}return null;})[_0x4808('0x1c')](handleEntityNotFound(_0x17893e,null))[_0x4808('0x1c')](function(_0x2131c9){if(_0x2131c9){return _0x2131c9['update']({'UserId':_0x16cae5[_0x4808('0x53')][_0x4808('0x5c')],'read1stAt':_[_0x4808('0x5f')](_0x2131c9[_0x4808('0x60')])?moment()[_0x4808('0x5a')](_0x4808('0x5b')):undefined});}return null;})[_0x4808('0x1c')](function(_0x10475e){if(_0x10475e){_0x13f168[_0x4808('0x61')]=_0x10475e[_0x4808('0x62')]({'plain':!![]});interaction_log['info'](_0x4808('0x63'),_0x16cae5[_0x4808('0x5d')]['id'],_0x16cae5[_0x4808('0x5d')][_0x4808('0x33')],_0x16cae5[_0x4808('0x5d')][_0x4808('0x64')],_0x13f168[_0x4808('0x61')]['id'],_0x16cae5[_0x4808('0x53')]?JSON[_0x4808('0x22')](_0x16cae5[_0x4808('0x53')]):_0x4808('0x65'));return respondWithRpcPromise(_0x4808('0x66'),_0x4808('0x67'),_0x13f168);}return null;})[_0x4808('0x1c')](function(_0x5c2950){var _0x1deda5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5c2950[_0x4808('0x25')][_0x4808('0x68')];return db[_0x4808('0x69')]['query'](_0x1deda5,{'type':db['Sequelize'][_0x4808('0x6a')][_0x4808('0x6b')],'raw':!![]})[_0x4808('0x1c')](function(_0x4233a0){return _0x4233a0;});})[_0x4808('0x1c')](function(_0x46005d){if(_0x46005d){_0x13f168['message'][_0x4808('0x6c')]=_0x46005d[0x0];if(!_0x16cae5['body'][_0x4808('0x5c')])return;return db['User'][_0x4808('0x51')]({'where':{'id':_0x16cae5[_0x4808('0x53')]['UserId'],'role':_0x4808('0x6d')},'attributes':['id','name','fullname',_0x4808('0x6e'),_0x4808('0x6f')],'raw':!![]});}return null;})[_0x4808('0x1c')](function(_0x542e43){if(!_0x542e43)return null;_0x13f168[_0x4808('0x25')][_0x4808('0x6d')]=_0x542e43;return _0x13f168;})[_0x4808('0x1c')](function(_0x4ae7f1){if(_0x4ae7f1){if(_0x16cae5[_0x4808('0x53')][_0x4808('0x70')]){_0x13f168[_0x4808('0x25')][_0x4808('0x71')]=util['format'](_0x4808('0x72'),_0x16cae5[_0x4808('0x5d')][_0x4808('0x33')]);_0x13f168[_0x4808('0x25')][_0x4808('0x73')]=_0x13f168[_0x4808('0x73')];_0x13f168['message']['motionChannel']=_0x13f168['channel'];_0x13f168[_0x4808('0x25')][_0x4808('0x74')]='accept';return respondWithRpcPromise('EventManager',_0x4808('0x75'),{'event':_0x4808('0x76'),'message':_[_0x4808('0x49')](_0x13f168[_0x4808('0x25')],JSON['parse'](_0x13f168[_0x4808('0x61')][_0x4808('0x77')]))},client9002)[_0x4808('0x1c')](function(){return _0x13f168;});}return _0x13f168;}return null;})[_0x4808('0x1c')](respondWithResult(_0x17893e,null))['catch'](handleError(_0x17893e,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x4808('0x2f')]=function(_0x5bb11a,_0x43849b,_0x3478d2){var _0x2edc22={'agent':{},'channel':_0x4808('0x78')};if(_0x5bb11a[_0x4808('0x53')]['id']){delete _0x5bb11a['body']['id'];}_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')]=_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')]||_0x5bb11a[_0x4808('0x5d')]['id'];_0x2edc22[_0x4808('0x6d')]['id']=_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')];return db[_0x4808('0x36')]['find']({'where':{'id':_0x5bb11a[_0x4808('0x4f')]['id'],'UserId':null}})[_0x4808('0x1c')](handleEntityNotFound(_0x43849b,null))[_0x4808('0x1c')](function(_0x3a3cb5){if(_0x3a3cb5){_0x2edc22['message']=_0x3a3cb5[_0x4808('0x62')]({'plain':!![]});return db[_0x4808('0x79')]['find']({'where':{'id':_0x3a3cb5[_0x4808('0x5e')]}});}return null;})[_0x4808('0x1c')](handleEntityNotFound(_0x43849b,null))[_0x4808('0x1c')](function(_0x30f6df){if(_0x30f6df){_0x2edc22['interaction']=_0x30f6df[_0x4808('0x62')]({'plain':!![]});interaction_log[_0x4808('0x1d')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bb11a[_0x4808('0x5d')]['id'],_0x5bb11a[_0x4808('0x5d')][_0x4808('0x33')],_0x5bb11a[_0x4808('0x5d')][_0x4808('0x64')],_0x2edc22[_0x4808('0x61')]['id'],_0x5bb11a[_0x4808('0x53')]?JSON[_0x4808('0x22')](_0x5bb11a[_0x4808('0x53')]):'null');return respondWithRpcPromise(_0x4808('0x7a'),_0x4808('0x7b'),_0x2edc22);}return null;})[_0x4808('0x1c')](function(_0x20cfd7){var _0x4ceca6=_0x4808('0x7c')+_0x20cfd7[_0x4808('0x25')]['ContactId'];return db[_0x4808('0x69')][_0x4808('0x3c')](_0x4ceca6,{'type':db['Sequelize'][_0x4808('0x6a')]['SELECT'],'raw':!![]})[_0x4808('0x1c')](function(_0xe37d31){return _0xe37d31;});})[_0x4808('0x1c')](function(_0x3e8536){if(_0x3e8536){_0x2edc22[_0x4808('0x25')]['contact']=_0x3e8536[0x0];if(!_0x5bb11a[_0x4808('0x53')]['UserId'])return;return db[_0x4808('0x7d')][_0x4808('0x51')]({'where':{'id':_0x5bb11a[_0x4808('0x53')][_0x4808('0x5c')],'role':_0x4808('0x6d')},'attributes':['id',_0x4808('0x33'),'fullname',_0x4808('0x6e'),_0x4808('0x6f')],'raw':!![]});}return null;})[_0x4808('0x1c')](function(_0x56976d){if(!_0x56976d)return null;_0x2edc22[_0x4808('0x25')]['agent']=_0x56976d;return _0x2edc22;})[_0x4808('0x1c')](function(_0x2a41c4){if(_0x2a41c4){_0x2a41c4['message'][_0x4808('0x71')]=util[_0x4808('0x5a')](_0x4808('0x72'),_0x5bb11a['user'][_0x4808('0x33')]);_0x2a41c4['message'][_0x4808('0x73')]=_0x2edc22[_0x4808('0x73')];_0x2a41c4[_0x4808('0x25')][_0x4808('0x7e')]=_0x2edc22['channel'];_0x2a41c4[_0x4808('0x25')][_0x4808('0x74')]=_0x4808('0x2f');respondWithRpcPromise(_0x4808('0x75'),_0x4808('0x75'),{'event':_0x4808('0x7f'),'message':_['merge'](_0x2edc22[_0x4808('0x25')],JSON[_0x4808('0x80')](_0x2edc22[_0x4808('0x61')]['formData']))},client9002);return _0x2edc22;}return null;})[_0x4808('0x1c')](respondWithResult(_0x43849b,null))[_0x4808('0x27')](handleError(_0x43849b,null));}; \ No newline at end of file +var _0x7d28=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','get','name','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','fullname','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','then','end','stack','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x5a143a,_0xbbe7d6){var _0x51d092=function(_0x43f58){while(--_0x43f58){_0x5a143a['push'](_0x5a143a['shift']());}};_0x51d092(++_0xbbe7d6);}(_0x7d28,0x14e));var _0x87d2=function(_0x23eddb,_0xf21aac){_0x23eddb=_0x23eddb-0x0;var _0x1b7d59=_0x7d28[_0x23eddb];return _0x1b7d59;};'use strict';var emlformat=require(_0x87d2('0x0'));var rimraf=require(_0x87d2('0x1'));var zipdir=require(_0x87d2('0x2'));var jsonpatch=require(_0x87d2('0x3'));var rp=require(_0x87d2('0x4'));var moment=require(_0x87d2('0x5'));var BPromise=require(_0x87d2('0x6'));var Mustache=require(_0x87d2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x87d2('0x8'));var csv=require('to-csv');var ejs=require(_0x87d2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87d2('0xa'));var squel=require(_0x87d2('0xb'));var crypto=require('crypto');var jsforce=require(_0x87d2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x87d2('0xd'));var querystring=require(_0x87d2('0xe'));var Papa=require(_0x87d2('0xf'));var Redis=require(_0x87d2('0x10'));var authService=require(_0x87d2('0x11'));var qs=require(_0x87d2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87d2('0x13'));var logger=require(_0x87d2('0x14'))(_0x87d2('0x15'));var utils=require(_0x87d2('0x16'));var config=require(_0x87d2('0x17'));var licenseUtil=require(_0x87d2('0x18'));var db=require('../../mysqldb')['db'];config[_0x87d2('0x19')]=_[_0x87d2('0x1a')](config[_0x87d2('0x19')],{'host':_0x87d2('0x1b'),'port':0x18eb});var socket=require(_0x87d2('0x1c'))(new Redis(config['redis']));require(_0x87d2('0x1d'))[_0x87d2('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a6db7,_0x166c03,_0x165d28,_0x43fe2a){return new BPromise(function(_0x544926,_0x57b4f0){var _0x4c3df6=_0x43fe2a||client;return _0x4c3df6[_0x87d2('0x1f')](_0x2a6db7,_0x165d28)['then'](function(_0x1691d9){logger['info'](_0x87d2('0x20'),_0x166c03,'request\x20sent');logger[_0x87d2('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x166c03,_0x87d2('0x22'),JSON[_0x87d2('0x23')](_0x1691d9));if(_0x1691d9[_0x87d2('0x24')]){if(_0x1691d9[_0x87d2('0x24')][_0x87d2('0x25')]===0x1f4){logger['error'](_0x87d2('0x20'),_0x166c03,_0x1691d9[_0x87d2('0x24')][_0x87d2('0x26')]);return _0x57b4f0(_0x1691d9[_0x87d2('0x24')]['message']);}logger[_0x87d2('0x24')](_0x87d2('0x20'),_0x166c03,_0x1691d9[_0x87d2('0x24')][_0x87d2('0x26')]);return _0x544926(_0x1691d9[_0x87d2('0x24')]['message']);}else{logger[_0x87d2('0x27')](_0x87d2('0x20'),_0x166c03,_0x87d2('0x22'));_0x544926(_0x1691d9['result']['message']);}})['catch'](function(_0x545e36){logger[_0x87d2('0x24')](_0x87d2('0x20'),_0x166c03,_0x545e36);_0x57b4f0(_0x545e36);});});}function respondWithStatusCode(_0x2f8fc1,_0x48c191){_0x48c191=_0x48c191||0xcc;return function(_0x315b34){if(_0x315b34){return _0x2f8fc1[_0x87d2('0x28')](_0x48c191);}return _0x2f8fc1[_0x87d2('0x29')](_0x48c191)['end']();};}function respondWithResult(_0x571e1c,_0x20286b){_0x20286b=_0x20286b||0xc8;return function(_0x3d08cd){if(_0x3d08cd){return _0x571e1c[_0x87d2('0x29')](_0x20286b)[_0x87d2('0x2a')](_0x3d08cd);}};}function respondWithFilteredResult(_0x3e4ce0,_0x1c6f17){return function(_0x353e96){if(_0x353e96){var _0x230f2f=typeof _0x1c6f17['offset']==='undefined'&&typeof _0x1c6f17[_0x87d2('0x2b')]===_0x87d2('0x2c');var _0x6994cc=_0x353e96[_0x87d2('0x2d')];var _0x5e0729=_0x230f2f?0x0:_0x1c6f17[_0x87d2('0x2e')];var _0x5cbc52=_0x230f2f?_0x353e96['count']:_0x1c6f17[_0x87d2('0x2e')]+_0x1c6f17[_0x87d2('0x2b')];var _0x2bbf6b;if(_0x5cbc52>=_0x6994cc){_0x5cbc52=_0x6994cc;_0x2bbf6b=0xc8;}else{_0x2bbf6b=0xce;}_0x3e4ce0[_0x87d2('0x29')](_0x2bbf6b);return _0x3e4ce0[_0x87d2('0x2f')](_0x87d2('0x30'),_0x5e0729+'-'+_0x5cbc52+'/'+_0x6994cc)[_0x87d2('0x2a')](_0x353e96);}return null;};}function patchUpdates(_0x82b674){return function(_0x142960){try{jsonpatch[_0x87d2('0x31')](_0x142960,_0x82b674,!![]);}catch(_0x373f25){return BPromise['reject'](_0x373f25);}return _0x142960[_0x87d2('0x32')]();};}function saveUpdates(_0x1e14a0,_0x2ed4c6){return function(_0x34d4f8){if(_0x34d4f8){return _0x34d4f8[_0x87d2('0x33')](_0x1e14a0)['then'](function(_0x34c0d2){return _0x34c0d2;});}return null;};}function removeEntity(_0x4a375f,_0x33efce){return function(_0x310467){if(_0x310467){return _0x310467[_0x87d2('0x34')]()[_0x87d2('0x35')](function(){_0x4a375f[_0x87d2('0x29')](0xcc)[_0x87d2('0x36')]();});}};}function handleEntityNotFound(_0x275056,_0x522bef){return function(_0x37e12e){if(!_0x37e12e){_0x275056[_0x87d2('0x28')](0x194);}return _0x37e12e;};}function handleError(_0x1b6c9f,_0x1f4793){_0x1f4793=_0x1f4793||0x1f4;return function(_0x1cf1d4){logger[_0x87d2('0x24')](_0x1cf1d4[_0x87d2('0x37')]);if(_0x1cf1d4['name']){delete _0x1cf1d4['name'];}_0x1b6c9f[_0x87d2('0x29')](_0x1f4793)[_0x87d2('0x38')](_0x1cf1d4);};}exports[_0x87d2('0x39')]=function(_0x2ad191,_0x510258){var _0x11b16c={},_0x23eb1d={},_0x2066ea={'count':0x0,'rows':[]};var _0x5da5b2=_[_0x87d2('0x3a')](db[_0x87d2('0x3b')][_0x87d2('0x3c')],function(_0x1461f3){return{'name':_0x1461f3[_0x87d2('0x3d')],'type':_0x1461f3[_0x87d2('0x3e')][_0x87d2('0x3f')]};});_0x23eb1d[_0x87d2('0x40')]=_[_0x87d2('0x3a')](_0x5da5b2,'name');_0x23eb1d['query']=_['keys'](_0x2ad191[_0x87d2('0x41')]);_0x23eb1d[_0x87d2('0x42')]=_[_0x87d2('0x43')](_0x23eb1d[_0x87d2('0x40')],_0x23eb1d['query']);_0x11b16c[_0x87d2('0x44')]=_[_0x87d2('0x43')](_0x23eb1d[_0x87d2('0x40')],qs[_0x87d2('0x45')](_0x2ad191[_0x87d2('0x41')][_0x87d2('0x45')]));_0x11b16c['attributes']=_0x11b16c['attributes'][_0x87d2('0x46')]?_0x11b16c[_0x87d2('0x44')]:_0x23eb1d[_0x87d2('0x40')];if(!_0x2ad191[_0x87d2('0x41')][_0x87d2('0x47')]('nolimit')){_0x11b16c[_0x87d2('0x2b')]=qs[_0x87d2('0x2b')](_0x2ad191[_0x87d2('0x41')]['limit']);_0x11b16c[_0x87d2('0x2e')]=qs[_0x87d2('0x2e')](_0x2ad191[_0x87d2('0x41')]['offset']);}_0x11b16c[_0x87d2('0x48')]=qs['sort'](_0x2ad191['query'][_0x87d2('0x49')]);_0x11b16c['where']=qs['filters'](_[_0x87d2('0x4a')](_0x2ad191[_0x87d2('0x41')],_0x23eb1d[_0x87d2('0x42')]),_0x5da5b2);if(_0x2ad191[_0x87d2('0x41')][_0x87d2('0x4b')]){_0x11b16c[_0x87d2('0x4c')]=_[_0x87d2('0x4d')](_0x11b16c[_0x87d2('0x4c')],{'$or':_[_0x87d2('0x3a')](_0x5da5b2,function(_0x2e0405){if(_0x2e0405[_0x87d2('0x3e')]!==_0x87d2('0x4e')){var _0x2c04c5={};_0x2c04c5[_0x2e0405['name']]={'$like':'%'+_0x2ad191['query']['filter']+'%'};return _0x2c04c5;}})});}_0x11b16c=_[_0x87d2('0x4d')]({},_0x11b16c,_0x2ad191[_0x87d2('0x4f')]);var _0x4ebffc={'where':_0x11b16c[_0x87d2('0x4c')]};return db[_0x87d2('0x3b')][_0x87d2('0x2d')](_0x4ebffc)[_0x87d2('0x35')](function(_0x4747cb){_0x2066ea[_0x87d2('0x2d')]=_0x4747cb;if(_0x2ad191['query'][_0x87d2('0x50')]){_0x11b16c[_0x87d2('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x87d2('0x52')](_0x11b16c);})['then'](function(_0x3aa5eb){_0x2066ea['rows']=_0x3aa5eb;return _0x2066ea;})['then'](respondWithFilteredResult(_0x510258,_0x11b16c))['catch'](handleError(_0x510258,null));};exports[_0x87d2('0x53')]=function(_0x391d1b,_0x5e5245){var _0x10de72={'raw':!![],'where':{'id':_0x391d1b[_0x87d2('0x54')]['id']}},_0x2b9a65={};_0x2b9a65[_0x87d2('0x40')]=_[_0x87d2('0x55')](db[_0x87d2('0x3b')]['rawAttributes']);_0x2b9a65[_0x87d2('0x41')]=_['keys'](_0x391d1b[_0x87d2('0x41')]);_0x2b9a65[_0x87d2('0x42')]=_[_0x87d2('0x43')](_0x2b9a65[_0x87d2('0x40')],_0x2b9a65[_0x87d2('0x41')]);_0x10de72[_0x87d2('0x44')]=_[_0x87d2('0x43')](_0x2b9a65[_0x87d2('0x40')],qs[_0x87d2('0x45')](_0x391d1b['query'][_0x87d2('0x45')]));_0x10de72[_0x87d2('0x44')]=_0x10de72[_0x87d2('0x44')][_0x87d2('0x46')]?_0x10de72['attributes']:_0x2b9a65['model'];if(_0x391d1b[_0x87d2('0x41')][_0x87d2('0x50')]){_0x10de72[_0x87d2('0x51')]=[{'all':!![]}];}_0x10de72=_[_0x87d2('0x4d')]({},_0x10de72,_0x391d1b['options']);return db[_0x87d2('0x3b')][_0x87d2('0x56')](_0x10de72)[_0x87d2('0x35')](handleEntityNotFound(_0x5e5245,null))[_0x87d2('0x35')](respondWithResult(_0x5e5245,null))[_0x87d2('0x57')](handleError(_0x5e5245,null));};exports[_0x87d2('0x58')]=function(_0x138844,_0x4b68d1){return db[_0x87d2('0x3b')]['create'](_0x138844[_0x87d2('0x59')],{})[_0x87d2('0x35')](respondWithResult(_0x4b68d1,0xc9))['catch'](handleError(_0x4b68d1,null));};exports[_0x87d2('0x33')]=function(_0x53eb69,_0x38951d){if(_0x53eb69[_0x87d2('0x59')]['id']){delete _0x53eb69[_0x87d2('0x59')]['id'];}return db[_0x87d2('0x3b')]['find']({'where':{'id':_0x53eb69['params']['id']}})[_0x87d2('0x35')](handleEntityNotFound(_0x38951d,null))[_0x87d2('0x35')](saveUpdates(_0x53eb69['body'],null))[_0x87d2('0x35')](respondWithResult(_0x38951d,null))[_0x87d2('0x57')](handleError(_0x38951d,null));};exports[_0x87d2('0x34')]=function(_0x6d4ec4,_0x499457){return db[_0x87d2('0x3b')][_0x87d2('0x56')]({'where':{'id':_0x6d4ec4[_0x87d2('0x54')]['id']}})['then'](handleEntityNotFound(_0x499457,null))[_0x87d2('0x35')](removeEntity(_0x499457,null))[_0x87d2('0x57')](handleError(_0x499457,null));};exports[_0x87d2('0x5a')]=function(_0x259d05,_0x4b59b8){return db[_0x87d2('0x3b')][_0x87d2('0x5a')]()['then'](respondWithResult(_0x4b59b8,null))['catch'](handleError(_0x4b59b8,null));};var interaction_log=require('../../config/logger')(_0x87d2('0x5b'));exports['accept']=function(_0x194e19,_0x2cc943,_0x225b02){var _0x5917a6={'agent':{},'channel':'chat'};if(_0x194e19[_0x87d2('0x59')]['id']){delete _0x194e19[_0x87d2('0x59')]['id'];}_0x194e19[_0x87d2('0x59')][_0x87d2('0x5c')]=!![];_0x194e19[_0x87d2('0x59')][_0x87d2('0x5d')]=moment()[_0x87d2('0x5e')](_0x87d2('0x5f'));_0x194e19[_0x87d2('0x59')][_0x87d2('0x60')]=_0x194e19[_0x87d2('0x59')][_0x87d2('0x60')]||_0x194e19[_0x87d2('0x61')]['id'];_0x5917a6[_0x87d2('0x62')]['id']=_0x194e19[_0x87d2('0x59')][_0x87d2('0x60')];return db[_0x87d2('0x3b')][_0x87d2('0x56')]({'where':{'id':_0x194e19[_0x87d2('0x54')]['id'],'UserId':null}})[_0x87d2('0x35')](handleEntityNotFound(_0x2cc943,null))[_0x87d2('0x35')](saveUpdates(_0x194e19['body'],null))[_0x87d2('0x35')](function(_0x11b8be){if(_0x11b8be){_0x5917a6['message']=_0x11b8be['get']({'plain':!![]});return db[_0x87d2('0x63')][_0x87d2('0x56')]({'where':{'id':_0x11b8be[_0x87d2('0x64')]}});}return null;})[_0x87d2('0x35')](handleEntityNotFound(_0x2cc943,null))[_0x87d2('0x35')](function(_0x562c9a){if(_0x562c9a){return _0x562c9a[_0x87d2('0x33')]({'UserId':_0x194e19[_0x87d2('0x59')][_0x87d2('0x60')],'read1stAt':_[_0x87d2('0x65')](_0x562c9a[_0x87d2('0x66')])?moment()[_0x87d2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x87d2('0x35')](function(_0x3245b8){if(_0x3245b8){_0x5917a6['interaction']=_0x3245b8[_0x87d2('0x67')]({'plain':!![]});interaction_log[_0x87d2('0x27')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x194e19[_0x87d2('0x61')]['id'],_0x194e19[_0x87d2('0x61')][_0x87d2('0x68')],_0x194e19[_0x87d2('0x61')][_0x87d2('0x69')],_0x5917a6[_0x87d2('0x6a')]['id'],_0x194e19[_0x87d2('0x59')]?JSON[_0x87d2('0x23')](_0x194e19[_0x87d2('0x59')]):'null');return respondWithRpcPromise(_0x87d2('0x6b'),_0x87d2('0x6c'),_0x5917a6);}return null;})[_0x87d2('0x35')](function(_0x38ca30){var _0x5d827e=_0x87d2('0x6d')+_0x38ca30[_0x87d2('0x26')][_0x87d2('0x6e')];return db['sequelize'][_0x87d2('0x41')](_0x5d827e,{'type':db[_0x87d2('0x6f')][_0x87d2('0x70')][_0x87d2('0x71')],'raw':!![]})[_0x87d2('0x35')](function(_0x30e0d4){return _0x30e0d4;});})[_0x87d2('0x35')](function(_0x3c1eb1){if(_0x3c1eb1){_0x5917a6['message'][_0x87d2('0x72')]=_0x3c1eb1[0x0];if(!_0x194e19[_0x87d2('0x59')][_0x87d2('0x60')])return;return db[_0x87d2('0x73')][_0x87d2('0x56')]({'where':{'id':_0x194e19[_0x87d2('0x59')][_0x87d2('0x60')],'role':_0x87d2('0x62')},'attributes':['id',_0x87d2('0x68'),'fullname',_0x87d2('0x74'),_0x87d2('0x75')],'raw':!![]});}return null;})['then'](function(_0xa40138){if(!_0xa40138)return null;_0x5917a6[_0x87d2('0x26')][_0x87d2('0x62')]=_0xa40138;return _0x5917a6;})[_0x87d2('0x35')](function(_0x1af715){if(_0x1af715){if(_0x194e19['body'][_0x87d2('0x76')]){_0x5917a6[_0x87d2('0x26')][_0x87d2('0x77')]=util[_0x87d2('0x5e')](_0x87d2('0x78'),_0x194e19[_0x87d2('0x61')]['name']);_0x5917a6[_0x87d2('0x26')][_0x87d2('0x79')]=_0x5917a6['channel'];_0x5917a6[_0x87d2('0x26')]['motionChannel']=_0x5917a6[_0x87d2('0x79')];_0x5917a6['message'][_0x87d2('0x7a')]='accept';return respondWithRpcPromise('EventManager',_0x87d2('0x7b'),{'event':_0x87d2('0x7c'),'message':_[_0x87d2('0x4d')](_0x5917a6[_0x87d2('0x26')],JSON[_0x87d2('0x7d')](_0x5917a6[_0x87d2('0x6a')][_0x87d2('0x7e')]))},client9002)['then'](function(){return _0x5917a6;});}return _0x5917a6;}return null;})['then'](respondWithResult(_0x2cc943,null))[_0x87d2('0x57')](handleError(_0x2cc943,null));};var interaction_log=require(_0x87d2('0x14'))('chat-interactions');exports[_0x87d2('0x7f')]=function(_0x3985df,_0x12e2fd,_0x8cb4){var _0x2d6109={'agent':{},'channel':'chat'};if(_0x3985df[_0x87d2('0x59')]['id']){delete _0x3985df['body']['id'];}_0x3985df[_0x87d2('0x59')][_0x87d2('0x60')]=_0x3985df[_0x87d2('0x59')][_0x87d2('0x60')]||_0x3985df[_0x87d2('0x61')]['id'];_0x2d6109[_0x87d2('0x62')]['id']=_0x3985df[_0x87d2('0x59')][_0x87d2('0x60')];return db[_0x87d2('0x3b')][_0x87d2('0x56')]({'where':{'id':_0x3985df[_0x87d2('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12e2fd,null))[_0x87d2('0x35')](function(_0x21be3e){if(_0x21be3e){_0x2d6109[_0x87d2('0x26')]=_0x21be3e['get']({'plain':!![]});return db[_0x87d2('0x63')][_0x87d2('0x56')]({'where':{'id':_0x21be3e[_0x87d2('0x64')]}});}return null;})[_0x87d2('0x35')](handleEntityNotFound(_0x12e2fd,null))[_0x87d2('0x35')](function(_0x48494a){if(_0x48494a){_0x2d6109[_0x87d2('0x6a')]=_0x48494a[_0x87d2('0x67')]({'plain':!![]});interaction_log[_0x87d2('0x27')](_0x87d2('0x80'),_0x3985df[_0x87d2('0x61')]['id'],_0x3985df[_0x87d2('0x61')][_0x87d2('0x68')],_0x3985df['user'][_0x87d2('0x69')],_0x2d6109[_0x87d2('0x6a')]['id'],_0x3985df[_0x87d2('0x59')]?JSON['stringify'](_0x3985df[_0x87d2('0x59')]):_0x87d2('0x81'));return respondWithRpcPromise(_0x87d2('0x82'),_0x87d2('0x83'),_0x2d6109);}return null;})[_0x87d2('0x35')](function(_0x4740f1){var _0x73779e=_0x87d2('0x6d')+_0x4740f1[_0x87d2('0x26')][_0x87d2('0x6e')];return db[_0x87d2('0x84')][_0x87d2('0x41')](_0x73779e,{'type':db[_0x87d2('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x87d2('0x35')](function(_0x5ba08e){return _0x5ba08e;});})[_0x87d2('0x35')](function(_0x43ee78){if(_0x43ee78){_0x2d6109[_0x87d2('0x26')]['contact']=_0x43ee78[0x0];if(!_0x3985df[_0x87d2('0x59')][_0x87d2('0x60')])return;return db[_0x87d2('0x73')]['find']({'where':{'id':_0x3985df[_0x87d2('0x59')][_0x87d2('0x60')],'role':'agent'},'attributes':['id',_0x87d2('0x68'),_0x87d2('0x85'),_0x87d2('0x74'),'internal'],'raw':!![]});}return null;})[_0x87d2('0x35')](function(_0x48c157){if(!_0x48c157)return null;_0x2d6109[_0x87d2('0x26')][_0x87d2('0x62')]=_0x48c157;return _0x2d6109;})[_0x87d2('0x35')](function(_0x4458ca){if(_0x4458ca){_0x4458ca[_0x87d2('0x26')][_0x87d2('0x77')]=util[_0x87d2('0x5e')](_0x87d2('0x78'),_0x3985df[_0x87d2('0x61')][_0x87d2('0x68')]);_0x4458ca[_0x87d2('0x26')][_0x87d2('0x79')]=_0x2d6109['channel'];_0x4458ca[_0x87d2('0x26')][_0x87d2('0x86')]=_0x2d6109[_0x87d2('0x79')];_0x4458ca[_0x87d2('0x26')][_0x87d2('0x7a')]=_0x87d2('0x7f');respondWithRpcPromise(_0x87d2('0x7b'),_0x87d2('0x7b'),{'event':_0x87d2('0x87'),'message':_[_0x87d2('0x4d')](_0x2d6109[_0x87d2('0x26')],JSON[_0x87d2('0x7d')](_0x2d6109[_0x87d2('0x6a')][_0x87d2('0x7e')]))},client9002);return _0x2d6109;}return null;})[_0x87d2('0x35')](respondWithResult(_0x12e2fd,null))['catch'](handleError(_0x12e2fd,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index cf41dbc..f932539 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 _0x5d66=['update','emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d66,0x12c));var _0x65d6=function(_0xabf09f,_0x56293f){_0xabf09f=_0xabf09f-0x0;var _0x1cdfce=_0x5d66[_0xabf09f];return _0x1cdfce;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x65d6('0x0'))['db'][_0x65d6('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x65d6('0x2')](0x0);var events={'afterCreate':_0x65d6('0x3'),'afterUpdate':_0x65d6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e1e10){return function(_0x3805da,_0x5d7682,_0x521ae6){ChatMessageEvents[_0x65d6('0x5')](_0x2e1e10+':'+_0x3805da['id'],_0x3805da);ChatMessageEvents[_0x65d6('0x5')](_0x2e1e10,_0x3805da);_0x521ae6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x65d6('0x6')](e,emitEvent(event));}}module[_0x65d6('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0xac42=['events','../../mysqldb','setMaxListeners','save','update','emit','exports'];(function(_0xac24b4,_0x3f5ecf){var _0x1d3073=function(_0x34aada){while(--_0x34aada){_0xac24b4['push'](_0xac24b4['shift']());}};_0x1d3073(++_0x3f5ecf);}(_0xac42,0x93));var _0x2ac4=function(_0x1cad51,_0x27ff4d){_0x1cad51=_0x1cad51-0x0;var _0x2ef33e=_0xac42[_0x1cad51];return _0x2ef33e;};'use strict';var EventEmitter=require(_0x2ac4('0x0'));var ChatMessage=require(_0x2ac4('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2ac4('0x2')](0x0);var events={'afterCreate':_0x2ac4('0x3'),'afterUpdate':_0x2ac4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1bbd1d){return function(_0x15ebbf,_0x4fc824,_0x150d5c){ChatMessageEvents[_0x2ac4('0x5')](_0x1bbd1d+':'+_0x15ebbf['id'],_0x15ebbf);ChatMessageEvents['emit'](_0x1bbd1d,_0x15ebbf);_0x150d5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2ac4('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 3e2bebe..fca694f 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 _0xcb3c=['direction','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','toLowerCase'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb3c,0x150));var _0xccb3=function(_0x5b20ef,_0x15f3aa){_0x5b20ef=_0x5b20ef-0x0;var _0xd04a72=_0xcb3c[_0x5b20ef];return _0xd04a72;};'use strict';var _=require(_0xccb3('0x0'));var util=require(_0xccb3('0x1'));var logger=require(_0xccb3('0x2'))(_0xccb3('0x3'));var moment=require('moment');var BPromise=require(_0xccb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccb3('0x5'));var rimraf=require('rimraf');var config=require(_0xccb3('0x6'));var attributes=require(_0xccb3('0x7'));module[_0xccb3('0x8')]=function(_0x3c02f3,_0x56eec1){return _0x3c02f3[_0xccb3('0x9')](_0xccb3('0xa'),attributes,{'tableName':_0xccb3('0xb'),'paranoid':![],'indexes':[{'name':_0xccb3('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ccda4,_0x3eedd4,_0x49298f){var _0x451c06=_0x3c02f3[_0xccb3('0xd')];var _0x3c4eb2=_0x4ccda4['get']({'plain':!![]});if(_0x3c4eb2['direction'][_0xccb3('0xe')]()==='in'||_0x3c4eb2[_0xccb3('0xf')][_0xccb3('0xe')]()===_0xccb3('0x10')&&!_0x3c4eb2[_0xccb3('0x11')]&&!_[_0xccb3('0x12')](_0x3c4eb2['UserId'])){_0x451c06[_0xccb3('0x13')][_0xccb3('0x14')]({'where':{'id':_0x3c4eb2[_0xccb3('0x15')]}})[_0xccb3('0x16')](function(_0x1744a4){if(_0x1744a4){_0x1744a4[_0xccb3('0x17')]({'lastMsgAt':_0x3c4eb2[_0xccb3('0x18')],'lastMsgDirection':_0x3c4eb2['direction'][_0xccb3('0xe')]()});}})[_0xccb3('0x19')](function(_0x59c508){console[_0xccb3('0x1a')](_0x59c508);});}_0x49298f();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xde9c=['ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','findOne'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xde9c,0xa9));var _0xcde9=function(_0x502d02,_0x3b8921){_0x502d02=_0x502d02-0x0;var _0x5c937a=_0xde9c[_0x502d02];return _0x5c937a;};'use strict';var _=require(_0xcde9('0x0'));var util=require(_0xcde9('0x1'));var logger=require('../../config/logger')(_0xcde9('0x2'));var moment=require(_0xcde9('0x3'));var BPromise=require(_0xcde9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcde9('0x5'));var rimraf=require(_0xcde9('0x6'));var config=require(_0xcde9('0x7'));var attributes=require(_0xcde9('0x8'));module['exports']=function(_0x47d93a,_0x38fe99){return _0x47d93a[_0xcde9('0x9')](_0xcde9('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcde9('0xb'),'fields':[_0xcde9('0xc')],'type':_0xcde9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7e9be9,_0x253139,_0x9fba8e){var _0x187b6e=_0x47d93a[_0xcde9('0xe')];var _0xbefa80=_0x7e9be9[_0xcde9('0xf')]({'plain':!![]});if(_0xbefa80[_0xcde9('0x10')]['toLowerCase']()==='in'||_0xbefa80[_0xcde9('0x10')][_0xcde9('0x11')]()==='out'&&!_0xbefa80['secret']&&!_[_0xcde9('0x12')](_0xbefa80['UserId'])){_0x187b6e['ChatInteraction'][_0xcde9('0x13')]({'where':{'id':_0xbefa80[_0xcde9('0x14')]}})[_0xcde9('0x15')](function(_0xe08a4f){if(_0xe08a4f){_0xe08a4f[_0xcde9('0x16')]({'lastMsgAt':_0xbefa80[_0xcde9('0x17')],'lastMsgDirection':_0xbefa80[_0xcde9('0x10')][_0xcde9('0x11')]()});}})[_0xcde9('0x18')](function(_0x3181c4){console[_0xcde9('0x19')](_0x3181c4);});}_0x9fba8e();}},'charset':_0xcde9('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 55a95a9..61215c6 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 _0x78b2=['code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage','body','options','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x297e28,_0x3b1969){var _0xf97226=function(_0x3ca11f){while(--_0x3ca11f){_0x297e28['push'](_0x297e28['shift']());}};_0xf97226(++_0x3b1969);}(_0x78b2,0x7e));var _0x278b=function(_0x3ce7df,_0x764f4f){_0x3ce7df=_0x3ce7df-0x0;var _0x578a8a=_0x78b2[_0x3ce7df];return _0x578a8a;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var moment=require(_0x278b('0x2'));var BPromise=require(_0x278b('0x3'));var rs=require(_0x278b('0x4'));var fs=require('fs');var Redis=require(_0x278b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x278b('0x6'));var logger=require(_0x278b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x278b('0x8')]=_['defaults'](config[_0x278b('0x8')],{'host':_0x278b('0x9'),'port':0x18eb});var socket=require(_0x278b('0xa'))(new Redis(config[_0x278b('0x8')]));require(_0x278b('0xb'))[_0x278b('0xc')](socket);function respondWithRpcPromise(_0x4f1bd0,_0x30eb0b,_0x2ffadd){return new BPromise(function(_0x3e5977,_0x3b126){return client[_0x278b('0xd')](_0x4f1bd0,_0x2ffadd)[_0x278b('0xe')](function(_0x1a55ec){logger['info']('ChatMessage,\x20%s,\x20%s',_0x30eb0b,'request\x20sent');logger[_0x278b('0xf')](_0x278b('0x10'),_0x30eb0b,_0x278b('0x11'),JSON['stringify'](_0x1a55ec));if(_0x1a55ec[_0x278b('0x12')]){if(_0x1a55ec[_0x278b('0x12')][_0x278b('0x13')]===0x1f4){logger[_0x278b('0x12')](_0x278b('0x14'),_0x30eb0b,_0x1a55ec[_0x278b('0x12')][_0x278b('0x15')]);return _0x3b126(_0x1a55ec[_0x278b('0x12')][_0x278b('0x15')]);}logger[_0x278b('0x12')](_0x278b('0x14'),_0x30eb0b,_0x1a55ec[_0x278b('0x12')][_0x278b('0x15')]);return _0x3e5977(_0x1a55ec[_0x278b('0x12')]['message']);}else{logger['info'](_0x278b('0x14'),_0x30eb0b,_0x278b('0x11'));_0x3e5977(_0x1a55ec['result']['message']);}})[_0x278b('0x16')](function(_0x201999){logger[_0x278b('0x12')](_0x278b('0x14'),_0x30eb0b,_0x201999);_0x3b126(_0x201999);});});}exports[_0x278b('0x17')]=function(_0x37f462){var _0x2499b7=this;return new Promise(function(_0x266997,_0x250563){return db[_0x278b('0x18')]['create'](_0x37f462[_0x278b('0x19')],{'raw':_0x37f462[_0x278b('0x1a')]?_0x37f462[_0x278b('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x278b('0xe')](function(_0xa2af8b){logger[_0x278b('0x1b')](_0x278b('0x17'),_0x37f462);logger[_0x278b('0xf')]('CreateChatMessage',_0x37f462,JSON[_0x278b('0x1c')](_0xa2af8b));_0x266997(_0xa2af8b);})[_0x278b('0x16')](function(_0x5c895c){logger[_0x278b('0x12')](_0x278b('0x17'),_0x5c895c[_0x278b('0x15')],_0x37f462);_0x250563(_0x2499b7[_0x278b('0x12')](0x1f4,_0x5c895c[_0x278b('0x15')]));});});}; \ No newline at end of file +var _0x9297=['catch','ChatMessage','body','options','raw','CreateChatMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result'];(function(_0x2a78d1,_0x3c3c09){var _0x52ec75=function(_0x35a0a3){while(--_0x35a0a3){_0x2a78d1['push'](_0x2a78d1['shift']());}};_0x52ec75(++_0x3c3c09);}(_0x9297,0x6c));var _0x7929=function(_0x217b12,_0x3724b8){_0x217b12=_0x217b12-0x0;var _0x5945b7=_0x9297[_0x217b12];return _0x5945b7;};'use strict';var _=require(_0x7929('0x0'));var util=require(_0x7929('0x1'));var moment=require(_0x7929('0x2'));var BPromise=require('bluebird');var rs=require(_0x7929('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7929('0x4'))['db'];var utils=require(_0x7929('0x5'));var logger=require(_0x7929('0x6'))(_0x7929('0x7'));var config=require(_0x7929('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7929('0x9')][_0x7929('0xa')]({'port':0x232a});config[_0x7929('0xb')]=_['defaults'](config[_0x7929('0xb')],{'host':_0x7929('0xc'),'port':0x18eb});var socket=require(_0x7929('0xd'))(new Redis(config['redis']));require(_0x7929('0xe'))[_0x7929('0xf')](socket);function respondWithRpcPromise(_0x3d94de,_0x21d23e,_0x427691){return new BPromise(function(_0x44e67e,_0x465d59){return client[_0x7929('0x10')](_0x3d94de,_0x427691)[_0x7929('0x11')](function(_0x1eb9a6){logger[_0x7929('0x12')]('ChatMessage,\x20%s,\x20%s',_0x21d23e,_0x7929('0x13'));logger[_0x7929('0x14')](_0x7929('0x15'),_0x21d23e,_0x7929('0x13'),JSON[_0x7929('0x16')](_0x1eb9a6));if(_0x1eb9a6[_0x7929('0x17')]){if(_0x1eb9a6['error'][_0x7929('0x18')]===0x1f4){logger[_0x7929('0x17')](_0x7929('0x19'),_0x21d23e,_0x1eb9a6[_0x7929('0x17')]['message']);return _0x465d59(_0x1eb9a6[_0x7929('0x17')][_0x7929('0x1a')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x21d23e,_0x1eb9a6[_0x7929('0x17')][_0x7929('0x1a')]);return _0x44e67e(_0x1eb9a6[_0x7929('0x17')][_0x7929('0x1a')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x21d23e,_0x7929('0x13'));_0x44e67e(_0x1eb9a6[_0x7929('0x1b')]['message']);}})[_0x7929('0x1c')](function(_0x4155a1){logger[_0x7929('0x17')]('ChatMessage,\x20%s,\x20%s',_0x21d23e,_0x4155a1);_0x465d59(_0x4155a1);});});}exports['CreateChatMessage']=function(_0x2af7f6){var _0x310dff=this;return new Promise(function(_0x11ccc6,_0x58a4a3){return db[_0x7929('0x1d')]['create'](_0x2af7f6[_0x7929('0x1e')],{'raw':_0x2af7f6[_0x7929('0x1f')]?_0x2af7f6[_0x7929('0x1f')][_0x7929('0x20')]===undefined?!![]:![]:!![]})[_0x7929('0x11')](function(_0xd6cd0c){logger[_0x7929('0x12')](_0x7929('0x21'),_0x2af7f6);logger[_0x7929('0x14')](_0x7929('0x21'),_0x2af7f6,JSON[_0x7929('0x16')](_0xd6cd0c));_0x11ccc6(_0xd6cd0c);})['catch'](function(_0x4cfcff){logger[_0x7929('0x17')](_0x7929('0x21'),_0x4cfcff[_0x7929('0x1a')],_0x2af7f6);_0x58a4a3(_0x310dff[_0x7929('0x17')](0x1f4,_0x4cfcff[_0x7929('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 7b97630..935e593 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 _0x3148=['save','update','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x3148,0x1d3));var _0x8314=function(_0x4f21cd,_0x30f06f){_0x4f21cd=_0x4f21cd-0x0;var _0x1af331=_0x3148[_0x4f21cd];return _0x1af331;};'use strict';var ChatMessageEvents=require(_0x8314('0x0'));var events=[_0x8314('0x1'),'remove',_0x8314('0x2')];function createListener(_0xf80bf9,_0x1b13ca){return function(_0x63760b){_0x1b13ca['emit'](_0xf80bf9,_0x63760b);};}function removeListener(_0x35ee55,_0x41e9fd){return function(){ChatMessageEvents[_0x8314('0x3')](_0x35ee55,_0x41e9fd);};}exports[_0x8314('0x4')]=function(_0x18a30b){for(var _0x9cb271=0x0,_0x1bd913=events['length'];_0x9cb271<_0x1bd913;_0x9cb271++){var _0x837c1f=events[_0x9cb271];var _0x4df2b0=createListener(_0x8314('0x5')+_0x837c1f,_0x18a30b);ChatMessageEvents['on'](_0x837c1f,_0x4df2b0);}}; \ No newline at end of file +var _0xa23f=['save','emit','register','chatMessage:','./chatMessage.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa23f,0x7c));var _0xfa23=function(_0x53c747,_0x505a9f){_0x53c747=_0x53c747-0x0;var _0x4e2c18=_0xa23f[_0x53c747];return _0x4e2c18;};'use strict';var ChatMessageEvents=require(_0xfa23('0x0'));var events=[_0xfa23('0x1'),'remove','update'];function createListener(_0xb81edf,_0x3f714c){return function(_0x1c85a9){_0x3f714c[_0xfa23('0x2')](_0xb81edf,_0x1c85a9);};}function removeListener(_0x5643b1,_0x86778e){return function(){ChatMessageEvents['removeListener'](_0x5643b1,_0x86778e);};}exports[_0xfa23('0x3')]=function(_0x2df2f5){for(var _0x4c3f4=0x0,_0x3696ef=events['length'];_0x4c3f4<_0x3696ef;_0x4c3f4++){var _0x5a7882=events[_0x4c3f4];var _0x59d53e=createListener(_0xfa23('0x4')+_0x5a7882,_0x2df2f5);ChatMessageEvents['on'](_0x5a7882,_0x59d53e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 56518ef..f229628 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 _0x62e4=['put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','post','tracked','chat','chatmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62e4,0x6d));var _0x462e=function(_0x15548e,_0xbae56d){_0x15548e=_0x15548e-0x0;var _0x305a7f=_0x62e4[_0x15548e];return _0x305a7f;};'use strict';var multer=require(_0x462e('0x0'));var util=require(_0x462e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x462e('0x2'));var router=express[_0x462e('0x3')]();var fs_extra=require(_0x462e('0x4'));var auth=require(_0x462e('0x5'));var interaction=require(_0x462e('0x6'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x462e('0x7')]('/',auth[_0x462e('0x8')](),controller['index']);router[_0x462e('0x7')](_0x462e('0x9'),auth[_0x462e('0x8')](),controller[_0x462e('0xa')]);router[_0x462e('0x7')]('/:id',auth[_0x462e('0x8')](),controller['show']);router[_0x462e('0xb')]('/',auth['isAuthenticated'](),interaction[_0x462e('0xc')](_0x462e('0xd'),_0x462e('0xe')),controller[_0x462e('0xf')]);router[_0x462e('0x10')]('/:id',controller[_0x462e('0x11')]);router[_0x462e('0x10')](_0x462e('0x12'),auth[_0x462e('0x8')](),controller[_0x462e('0x13')]);router['put']('/:id/reject',auth[_0x462e('0x8')](),controller[_0x462e('0x14')]);router[_0x462e('0x15')](_0x462e('0x16'),auth[_0x462e('0x8')](),controller[_0x462e('0x17')]);module[_0x462e('0x18')]=router; \ No newline at end of file +var _0xd74e=['get','isAuthenticated','index','/describe','/:id','show','post','tracked','chat','chatmessage:create','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x5cc484,_0x32965f){var _0x5305ab=function(_0x173c10){while(--_0x173c10){_0x5cc484['push'](_0x5cc484['shift']());}};_0x5305ab(++_0x32965f);}(_0xd74e,0x1ca));var _0xed74=function(_0x7b2b76,_0x3405ac){_0x7b2b76=_0x7b2b76-0x0;var _0x2ba685=_0xd74e[_0x7b2b76];return _0x2ba685;};'use strict';var multer=require(_0xed74('0x0'));var util=require(_0xed74('0x1'));var path=require(_0xed74('0x2'));var timeout=require(_0xed74('0x3'));var express=require('express');var router=express[_0xed74('0x4')]();var fs_extra=require(_0xed74('0x5'));var auth=require(_0xed74('0x6'));var interaction=require(_0xed74('0x7'));var config=require(_0xed74('0x8'));var controller=require(_0xed74('0x9'));router[_0xed74('0xa')]('/',auth[_0xed74('0xb')](),controller[_0xed74('0xc')]);router[_0xed74('0xa')](_0xed74('0xd'),auth[_0xed74('0xb')](),controller['describe']);router['get'](_0xed74('0xe'),auth[_0xed74('0xb')](),controller[_0xed74('0xf')]);router[_0xed74('0x10')]('/',auth['isAuthenticated'](),interaction[_0xed74('0x11')](_0xed74('0x12'),_0xed74('0x13')),controller['create']);router['put'](_0xed74('0xe'),controller['update']);router[_0xed74('0x14')]('/:id/accept',auth[_0xed74('0xb')](),controller['accept']);router[_0xed74('0x14')](_0xed74('0x15'),auth[_0xed74('0xb')](),controller[_0xed74('0x16')]);router[_0xed74('0x17')]('/:id',auth[_0xed74('0xb')](),controller[_0xed74('0x18')]);module[_0xed74('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index e45246f..98b5804 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 _0xb029=['sequelize','exports','TEXT','medium'];(function(_0x19f5f1,_0x5a9d31){var _0x44b0a7=function(_0xbd206d){while(--_0xbd206d){_0x19f5f1['push'](_0x19f5f1['shift']());}};_0x44b0a7(++_0x5a9d31);}(_0xb029,0x12c));var _0x9b02=function(_0xc03fac,_0x5e8753){_0xc03fac=_0xc03fac-0x0;var _0xa1af02=_0xb029[_0xc03fac];return _0xa1af02;};'use strict';var Sequelize=require(_0x9b02('0x0'));module[_0x9b02('0x1')]={'body':{'type':Sequelize[_0x9b02('0x2')](_0x9b02('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xbfb2=['medium','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbfb2,0x18d));var _0x2bfb=function(_0x20d976,_0x92a468){_0x20d976=_0x20d976-0x0;var _0x10a2a7=_0xbfb2[_0x20d976];return _0x10a2a7;};'use strict';var Sequelize=require('sequelize');module[_0x2bfb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x2bfb('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 b4b9f9c..432f875 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3c2876,_0x303375){var _0x4851cd=function(_0x5d1050){while(--_0x5d1050){_0x3c2876['push'](_0x3c2876['shift']());}};_0x4851cd(++_0x303375);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x18fe3a,_0x55f676){var _0x6be0d8=function(_0x378bca){while(--_0x378bca){_0x18fe3a['push'](_0x18fe3a['shift']());}};_0x6be0d8(++_0x55f676);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index bde67d0..2841ccc 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 _0x7ed0=['lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x267390,_0x1733f2){var _0x19c5a9=function(_0x373f3a){while(--_0x373f3a){_0x267390['push'](_0x267390['shift']());}};_0x19c5a9(++_0x1733f2);}(_0x7ed0,0x12b));var _0x07ed=function(_0x541e3b,_0x209b1e){_0x541e3b=_0x541e3b-0x0;var _0xe45bd0=_0x7ed0[_0x541e3b];return _0xe45bd0;};'use strict';var _=require(_0x07ed('0x0'));var util=require(_0x07ed('0x1'));var logger=require('../../config/logger')(_0x07ed('0x2'));var moment=require(_0x07ed('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07ed('0x4'));var rimraf=require(_0x07ed('0x5'));var config=require(_0x07ed('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x07ed('0x7')]=function(_0x1edf2a,_0x4f3334){return _0x1edf2a[_0x07ed('0x8')](_0x07ed('0x9'),attributes,{'tableName':_0x07ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07ed('0xb'),'collate':_0x07ed('0xc')});}; \ No newline at end of file +var _0x8d17=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x1a7525,_0x3c50eb){var _0x913a43=function(_0x31a9c5){while(--_0x31a9c5){_0x1a7525['push'](_0x1a7525['shift']());}};_0x913a43(++_0x3c50eb);}(_0x8d17,0x150));var _0x78d1=function(_0x1943eb,_0xedd3d){_0x1943eb=_0x1943eb-0x0;var _0x4b2c71=_0x8d17[_0x1943eb];return _0x4b2c71;};'use strict';var _=require(_0x78d1('0x0'));var util=require(_0x78d1('0x1'));var logger=require(_0x78d1('0x2'))(_0x78d1('0x3'));var moment=require('moment');var BPromise=require(_0x78d1('0x4'));var rp=require(_0x78d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78d1('0x6'));var config=require(_0x78d1('0x7'));var attributes=require(_0x78d1('0x8'));module[_0x78d1('0x9')]=function(_0x250314,_0xaf3ab8){return _0x250314[_0x78d1('0xa')](_0x78d1('0xb'),attributes,{'tableName':_0x78d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78d1('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index af55ad8..f49ae47 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 _0x63b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x63b7,0x1e2));var _0x763b=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x63b7[_0x4df6f9];return _0x4b1a73;};'use strict';var _=require('lodash');var util=require(_0x763b('0x0'));var moment=require('moment');var BPromise=require(_0x763b('0x1'));var rs=require(_0x763b('0x2'));var fs=require('fs');var Redis=require(_0x763b('0x3'));var db=require(_0x763b('0x4'))['db'];var utils=require(_0x763b('0x5'));var logger=require('../../config/logger')(_0x763b('0x6'));var config=require(_0x763b('0x7'));var jayson=require(_0x763b('0x8'));var client=jayson['client'][_0x763b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe9cf0,_0x464ab0,_0x218a1f){return new BPromise(function(_0xffb979,_0x476fc4){return client[_0x763b('0xa')](_0xbe9cf0,_0x218a1f)[_0x763b('0xb')](function(_0x2833b2){logger['info'](_0x763b('0xc'),_0x464ab0,_0x763b('0xd'));logger[_0x763b('0xe')](_0x763b('0xf'),_0x464ab0,_0x763b('0xd'),JSON[_0x763b('0x10')](_0x2833b2));if(_0x2833b2['error']){if(_0x2833b2[_0x763b('0x11')][_0x763b('0x12')]===0x1f4){logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0x476fc4(_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);}logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0xffb979(_0x2833b2['error'][_0x763b('0x13')]);}else{logger[_0x763b('0x14')](_0x763b('0xc'),_0x464ab0,'request\x20sent');_0xffb979(_0x2833b2[_0x763b('0x15')]['message']);}})[_0x763b('0x16')](function(_0x493346){logger[_0x763b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x464ab0,_0x493346);_0x476fc4(_0x493346);});});} \ No newline at end of file +var _0x0d74=['catch','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x7929d8,_0x8be119){var _0x40ff94=function(_0x48beda){while(--_0x48beda){_0x7929d8['push'](_0x7929d8['shift']());}};_0x40ff94(++_0x8be119);}(_0x0d74,0x1c9));var _0x40d7=function(_0x19ad89,_0x2c4232){_0x19ad89=_0x19ad89-0x0;var _0x4d6a80=_0x0d74[_0x19ad89];return _0x4d6a80;};'use strict';var _=require('lodash');var util=require(_0x40d7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d7('0x1'));var db=require(_0x40d7('0x2'))['db'];var utils=require(_0x40d7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x40d7('0x4'));var jayson=require(_0x40d7('0x5'));var client=jayson[_0x40d7('0x6')][_0x40d7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2beea5,_0x2d8121,_0x239818){return new BPromise(function(_0x17b098,_0x4d2435){return client['request'](_0x2beea5,_0x239818)['then'](function(_0x7359e8){logger[_0x40d7('0x8')](_0x40d7('0x9'),_0x2d8121,_0x40d7('0xa'));logger[_0x40d7('0xb')](_0x40d7('0xc'),_0x2d8121,_0x40d7('0xa'),JSON[_0x40d7('0xd')](_0x7359e8));if(_0x7359e8[_0x40d7('0xe')]){if(_0x7359e8[_0x40d7('0xe')][_0x40d7('0xf')]===0x1f4){logger[_0x40d7('0xe')](_0x40d7('0x9'),_0x2d8121,_0x7359e8[_0x40d7('0xe')][_0x40d7('0x10')]);return _0x4d2435(_0x7359e8[_0x40d7('0xe')][_0x40d7('0x10')]);}logger[_0x40d7('0xe')](_0x40d7('0x9'),_0x2d8121,_0x7359e8['error'][_0x40d7('0x10')]);return _0x17b098(_0x7359e8[_0x40d7('0xe')][_0x40d7('0x10')]);}else{logger[_0x40d7('0x8')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2d8121,_0x40d7('0xa'));_0x17b098(_0x7359e8[_0x40d7('0x11')][_0x40d7('0x10')]);}})[_0x40d7('0x12')](function(_0xb924f3){logger['error'](_0x40d7('0x9'),_0x2d8121,_0xb924f3);_0x4d2435(_0xb924f3);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 1d50246..56d9d22 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 _0xf1ad=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x244f1f,_0x26934c){var _0x1064f7=function(_0x280ea8){while(--_0x280ea8){_0x244f1f['push'](_0x244f1f['shift']());}};_0x1064f7(++_0x26934c);}(_0xf1ad,0x15a));var _0xdf1a=function(_0x3b6528,_0x2683e1){_0x3b6528=_0x3b6528-0x0;var _0x260874=_0xf1ad[_0x3b6528];return _0x260874;};'use strict';var multer=require(_0xdf1a('0x0'));var util=require(_0xdf1a('0x1'));var path=require(_0xdf1a('0x2'));var timeout=require(_0xdf1a('0x3'));var express=require(_0xdf1a('0x4'));var router=express[_0xdf1a('0x5')]();var fs_extra=require(_0xdf1a('0x6'));var auth=require(_0xdf1a('0x7'));var interaction=require(_0xdf1a('0x8'));var config=require(_0xdf1a('0x9'));var controller=require(_0xdf1a('0xa'));router[_0xdf1a('0xb')]('/',auth['isAuthenticated'](),controller[_0xdf1a('0xc')]);router[_0xdf1a('0xb')](_0xdf1a('0xd'),auth[_0xdf1a('0xe')](),controller['describe']);router[_0xdf1a('0xb')](_0xdf1a('0xf'),auth[_0xdf1a('0xe')](),controller[_0xdf1a('0x10')]);router[_0xdf1a('0x11')]('/',auth[_0xdf1a('0xe')](),controller[_0xdf1a('0x12')]);router['put'](_0xdf1a('0xf'),auth[_0xdf1a('0xe')](),controller[_0xdf1a('0x13')]);router[_0xdf1a('0x14')](_0xdf1a('0xf'),auth['isAuthenticated'](),controller[_0xdf1a('0x15')]);module[_0xdf1a('0x16')]=router; \ No newline at end of file +var _0x4c61=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','create','put','update'];(function(_0x13b000,_0x4c3a75){var _0x568366=function(_0x34b8f0){while(--_0x34b8f0){_0x13b000['push'](_0x13b000['shift']());}};_0x568366(++_0x4c3a75);}(_0x4c61,0xf3));var _0x14c6=function(_0x5dad56,_0x5c88ee){_0x5dad56=_0x5dad56-0x0;var _0x264889=_0x4c61[_0x5dad56];return _0x264889;};'use strict';var multer=require(_0x14c6('0x0'));var util=require(_0x14c6('0x1'));var path=require('path');var timeout=require(_0x14c6('0x2'));var express=require('express');var router=express[_0x14c6('0x3')]();var fs_extra=require(_0x14c6('0x4'));var auth=require(_0x14c6('0x5'));var interaction=require(_0x14c6('0x6'));var config=require(_0x14c6('0x7'));var controller=require(_0x14c6('0x8'));router[_0x14c6('0x9')]('/',auth[_0x14c6('0xa')](),controller[_0x14c6('0xb')]);router['get']('/describe',auth[_0x14c6('0xa')](),controller[_0x14c6('0xc')]);router['get'](_0x14c6('0xd'),auth[_0x14c6('0xa')](),controller['show']);router['post']('/',auth[_0x14c6('0xa')](),controller[_0x14c6('0xe')]);router[_0x14c6('0xf')](_0x14c6('0xd'),auth[_0x14c6('0xa')](),controller[_0x14c6('0x10')]);router[_0x14c6('0x11')](_0x14c6('0xd'),auth['isAuthenticated'](),controller[_0x14c6('0x12')]);module[_0x14c6('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e76686f..ad49bcb 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 _0x741a=['exports','STRING','INTEGER','sequelize'];(function(_0x27889f,_0x4809b9){var _0x201713=function(_0x5e5c1e){while(--_0x5e5c1e){_0x27889f['push'](_0x27889f['shift']());}};_0x201713(++_0x4809b9);}(_0x741a,0xab));var _0xa741=function(_0x686086,_0x2f84d0){_0x686086=_0x686086-0x0;var _0x2ce9b8=_0x741a[_0x686086];return _0x2ce9b8;};'use strict';var Sequelize=require(_0xa741('0x0'));module[_0xa741('0x1')]={'name':{'type':Sequelize[_0xa741('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa741('0x2')]},'timeout':{'type':Sequelize[_0xa741('0x3')]}}; \ No newline at end of file +var _0x76eb=['STRING','ENUM','mouseOver','timeout','exports'];(function(_0x4b723d,_0x5874da){var _0x3fee85=function(_0x3b7831){while(--_0x3b7831){_0x4b723d['push'](_0x4b723d['shift']());}};_0x3fee85(++_0x5874da);}(_0x76eb,0x12b));var _0xb76e=function(_0xff3357,_0x3b4152){_0xff3357=_0xff3357-0x0;var _0x16d529=_0x76eb[_0xff3357];return _0x16d529;};'use strict';var Sequelize=require('sequelize');module[_0xb76e('0x0')]={'name':{'type':Sequelize[_0xb76e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb76e('0x2')](_0xb76e('0x3'),_0xb76e('0x4')),'defaultValue':_0xb76e('0x3')},'selector':{'type':Sequelize[_0xb76e('0x1')]},'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 a16661c..bbf355a 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 _0x54da=['moment','mustache','util','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','name','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','include','options','catch','create','update','body','find','destroy','eml-format','zip-dir'];(function(_0x38e870,_0x3d2e6a){var _0x2dabbe=function(_0x3ddea3){while(--_0x3ddea3){_0x38e870['push'](_0x38e870['shift']());}};_0x2dabbe(++_0x3d2e6a);}(_0x54da,0x9d));var _0xa54d=function(_0x11a3c2,_0xb7f165){_0x11a3c2=_0x11a3c2-0x0;var _0x846cea=_0x54da[_0x11a3c2];return _0x846cea;};'use strict';var emlformat=require(_0xa54d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa54d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa54d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa54d('0x3'));var util=require(_0xa54d('0x4'));var path=require(_0xa54d('0x5'));var sox=require(_0xa54d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa54d('0x7'));var _=require(_0xa54d('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa54d('0x9'));var toCsv=require(_0xa54d('0xa'));var querystring=require(_0xa54d('0xb'));var Papa=require('papaparse');var Redis=require(_0xa54d('0xc'));var authService=require(_0xa54d('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa54d('0xe'));var logger=require('../../config/logger')(_0xa54d('0xf'));var utils=require(_0xa54d('0x10'));var config=require(_0xa54d('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa54d('0x12'))['db'];function respondWithStatusCode(_0x4aa983,_0x4f1d93){_0x4f1d93=_0x4f1d93||0xcc;return function(_0x5ea2b6){if(_0x5ea2b6){return _0x4aa983[_0xa54d('0x13')](_0x4f1d93);}return _0x4aa983[_0xa54d('0x14')](_0x4f1d93)[_0xa54d('0x15')]();};}function respondWithResult(_0x11d38f,_0xd5c470){_0xd5c470=_0xd5c470||0xc8;return function(_0x5f30f9){if(_0x5f30f9){return _0x11d38f[_0xa54d('0x14')](_0xd5c470)[_0xa54d('0x16')](_0x5f30f9);}};}function respondWithFilteredResult(_0x272e8d,_0xdf2d8){return function(_0x23cd06){if(_0x23cd06){var _0xfc1686=typeof _0xdf2d8[_0xa54d('0x17')]===_0xa54d('0x18')&&typeof _0xdf2d8[_0xa54d('0x19')]===_0xa54d('0x18');var _0x3227f7=_0x23cd06[_0xa54d('0x1a')];var _0x49e221=_0xfc1686?0x0:_0xdf2d8[_0xa54d('0x17')];var _0x1fd2bc=_0xfc1686?_0x23cd06[_0xa54d('0x1a')]:_0xdf2d8[_0xa54d('0x17')]+_0xdf2d8[_0xa54d('0x19')];var _0xa4a36b;if(_0x1fd2bc>=_0x3227f7){_0x1fd2bc=_0x3227f7;_0xa4a36b=0xc8;}else{_0xa4a36b=0xce;}_0x272e8d['status'](_0xa4a36b);return _0x272e8d['set'](_0xa54d('0x1b'),_0x49e221+'-'+_0x1fd2bc+'/'+_0x3227f7)[_0xa54d('0x16')](_0x23cd06);}return null;};}function patchUpdates(_0x44cc3d){return function(_0x23fc6d){try{jsonpatch[_0xa54d('0x1c')](_0x23fc6d,_0x44cc3d,!![]);}catch(_0x2d5893){return BPromise[_0xa54d('0x1d')](_0x2d5893);}return _0x23fc6d[_0xa54d('0x1e')]();};}function saveUpdates(_0x4e4250,_0x42a376){return function(_0x47b7ea){if(_0x47b7ea){return _0x47b7ea['update'](_0x4e4250)[_0xa54d('0x1f')](function(_0x99c1b3){return _0x99c1b3;});}return null;};}function removeEntity(_0x5b135f,_0x5695ad){return function(_0x1447d8){if(_0x1447d8){return _0x1447d8['destroy']()[_0xa54d('0x1f')](function(){_0x5b135f[_0xa54d('0x14')](0xcc)[_0xa54d('0x15')]();});}};}function handleEntityNotFound(_0x346086,_0x37dd6c){return function(_0x468d2e){if(!_0x468d2e){_0x346086[_0xa54d('0x13')](0x194);}return _0x468d2e;};}function handleError(_0x33eb45,_0x4497a0){_0x4497a0=_0x4497a0||0x1f4;return function(_0x15030a){logger[_0xa54d('0x20')](_0x15030a['stack']);if(_0x15030a[_0xa54d('0x21')]){delete _0x15030a[_0xa54d('0x21')];}_0x33eb45[_0xa54d('0x14')](_0x4497a0)['send'](_0x15030a);};}exports[_0xa54d('0x22')]=function(_0xb8661f,_0x13f701){var _0x58b625={'raw':!![],'where':{'id':_0xb8661f[_0xa54d('0x23')]['id']}},_0x2e10ff={};_0x2e10ff['model']=_[_0xa54d('0x24')](db[_0xa54d('0x25')]['rawAttributes']);_0x2e10ff[_0xa54d('0x26')]=_[_0xa54d('0x24')](_0xb8661f['query']);_0x2e10ff['filters']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],_0x2e10ff['query']);_0x58b625['attributes']=_[_0xa54d('0x27')](_0x2e10ff[_0xa54d('0x28')],qs[_0xa54d('0x29')](_0xb8661f['query']['fields']));_0x58b625['attributes']=_0x58b625[_0xa54d('0x2a')][_0xa54d('0x2b')]?_0x58b625['attributes']:_0x2e10ff[_0xa54d('0x28')];if(_0xb8661f[_0xa54d('0x26')][_0xa54d('0x2c')]){_0x58b625[_0xa54d('0x2d')]=[{'all':!![]}];}_0x58b625=_['merge']({},_0x58b625,_0xb8661f[_0xa54d('0x2e')]);return db[_0xa54d('0x25')]['find'](_0x58b625)[_0xa54d('0x1f')](handleEntityNotFound(_0x13f701,null))[_0xa54d('0x1f')](respondWithResult(_0x13f701,null))[_0xa54d('0x2f')](handleError(_0x13f701,null));};exports[_0xa54d('0x30')]=function(_0x2ecf81,_0x69b869){return db[_0xa54d('0x25')][_0xa54d('0x30')](_0x2ecf81['body'],{})['then'](respondWithResult(_0x69b869,0xc9))[_0xa54d('0x2f')](handleError(_0x69b869,null));};exports[_0xa54d('0x31')]=function(_0x59627b,_0x49d4b8){if(_0x59627b[_0xa54d('0x32')]['id']){delete _0x59627b[_0xa54d('0x32')]['id'];}return db['ChatProactiveAction'][_0xa54d('0x33')]({'where':{'id':_0x59627b[_0xa54d('0x23')]['id']}})['then'](handleEntityNotFound(_0x49d4b8,null))[_0xa54d('0x1f')](saveUpdates(_0x59627b['body'],null))[_0xa54d('0x1f')](respondWithResult(_0x49d4b8,null))[_0xa54d('0x2f')](handleError(_0x49d4b8,null));};exports[_0xa54d('0x34')]=function(_0x482af2,_0x4f9eab){return db[_0xa54d('0x25')][_0xa54d('0x33')]({'where':{'id':_0x482af2[_0xa54d('0x23')]['id']}})[_0xa54d('0x1f')](handleEntityNotFound(_0x4f9eab,null))[_0xa54d('0x1f')](removeEntity(_0x4f9eab,null))[_0xa54d('0x2f')](handleError(_0x4f9eab,null));}; \ No newline at end of file +var _0xe14b=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','options','catch','create','body','find','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x1840a6,_0x1751d0){var _0x70d28f=function(_0x539d7c){while(--_0x539d7c){_0x1840a6['push'](_0x1840a6['shift']());}};_0x70d28f(++_0x1751d0);}(_0xe14b,0x93));var _0xbe14=function(_0x4011f7,_0x1c04d5){_0x4011f7=_0x4011f7-0x0;var _0x56994c=_0xe14b[_0x4011f7];return _0x56994c;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['show']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={'raw':!![],'where':{'id':_0x3c3613[_0xbe14('0x27')]['id']}},_0x19252f={};_0x19252f[_0xbe14('0x28')]=_[_0xbe14('0x29')](db[_0xbe14('0x2a')][_0xbe14('0x2b')]);_0x19252f[_0xbe14('0x2c')]=_[_0xbe14('0x29')](_0x3c3613[_0xbe14('0x2c')]);_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x2e')](_0x19252f[_0xbe14('0x28')],_0x19252f[_0xbe14('0x2c')]);_0x1c7cc7[_0xbe14('0x2f')]=_[_0xbe14('0x2e')](_0x19252f[_0xbe14('0x28')],qs[_0xbe14('0x30')](_0x3c3613['query'][_0xbe14('0x30')]));_0x1c7cc7['attributes']=_0x1c7cc7['attributes'][_0xbe14('0x31')]?_0x1c7cc7['attributes']:_0x19252f[_0xbe14('0x28')];if(_0x3c3613[_0xbe14('0x2c')]['includeAll']){_0x1c7cc7['include']=[{'all':!![]}];}_0x1c7cc7=_['merge']({},_0x1c7cc7,_0x3c3613[_0xbe14('0x32')]);return db[_0xbe14('0x2a')]['find'](_0x1c7cc7)[_0xbe14('0x22')](handleEntityNotFound(_0x3b3e84,null))[_0xbe14('0x22')](respondWithResult(_0x3b3e84,null))[_0xbe14('0x33')](handleError(_0x3b3e84,null));};exports[_0xbe14('0x34')]=function(_0x29c23e,_0x5ef1e5){return db['ChatProactiveAction'][_0xbe14('0x34')](_0x29c23e['body'],{})['then'](respondWithResult(_0x5ef1e5,0xc9))['catch'](handleError(_0x5ef1e5,null));};exports[_0xbe14('0x21')]=function(_0x393f6b,_0x2bb45){if(_0x393f6b[_0xbe14('0x35')]['id']){delete _0x393f6b[_0xbe14('0x35')]['id'];}return db[_0xbe14('0x2a')][_0xbe14('0x36')]({'where':{'id':_0x393f6b[_0xbe14('0x27')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x2bb45,null))[_0xbe14('0x22')](saveUpdates(_0x393f6b[_0xbe14('0x35')],null))[_0xbe14('0x22')](respondWithResult(_0x2bb45,null))['catch'](handleError(_0x2bb45,null));};exports['destroy']=function(_0x43cdaa,_0x2951e1){return db[_0xbe14('0x2a')]['find']({'where':{'id':_0x43cdaa[_0xbe14('0x27')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x2951e1,null))[_0xbe14('0x22')](removeEntity(_0x2951e1,null))[_0xbe14('0x33')](handleError(_0x2951e1,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 8c313f1..c8c3121 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 _0xe06e=['lodash','api','moment','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x5879a9,_0x5f4b52){var _0x565db7=function(_0x1e8590){while(--_0x1e8590){_0x5879a9['push'](_0x5879a9['shift']());}};_0x565db7(++_0x5f4b52);}(_0xe06e,0x9a));var _0xee06=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xe06e[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0xee06('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee06('0x1'));var moment=require(_0xee06('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee06('0x3'));var rimraf=require(_0xee06('0x4'));var config=require(_0xee06('0x5'));var attributes=require(_0xee06('0x6'));module[_0xee06('0x7')]=function(_0x15ec1f,_0x78622b){return _0x15ec1f[_0xee06('0x8')](_0xee06('0x9'),attributes,{'tableName':_0xee06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d3c=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x24a4dd,_0x58bf1d){var _0x502787=function(_0x5c74e1){while(--_0x5c74e1){_0x24a4dd['push'](_0x24a4dd['shift']());}};_0x502787(++_0x58bf1d);}(_0x4d3c,0x15c));var _0xc4d3=function(_0x209a49,_0x210a79){_0x209a49=_0x209a49-0x0;var _0x3a288b=_0x4d3c[_0x209a49];return _0x3a288b;};'use strict';var _=require(_0xc4d3('0x0'));var util=require(_0xc4d3('0x1'));var logger=require(_0xc4d3('0x2'))(_0xc4d3('0x3'));var moment=require(_0xc4d3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4d3('0x5'));var rimraf=require(_0xc4d3('0x6'));var config=require(_0xc4d3('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xc4d3('0x8')]=function(_0x10c73b,_0x448d09){return _0x10c73b[_0xc4d3('0x9')](_0xc4d3('0xa'),attributes,{'tableName':_0xc4d3('0xb'),'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 506baa3..cf11f2f 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 _0xbebc=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x23b57c,_0xdc7f98){var _0x4c3b1d=function(_0x283147){while(--_0x283147){_0x23b57c['push'](_0x23b57c['shift']());}};_0x4c3b1d(++_0xdc7f98);}(_0xbebc,0x8f));var _0xcbeb=function(_0x2b33c6,_0xfeeabb){_0x2b33c6=_0x2b33c6-0x0;var _0x2b4d9d=_0xbebc[_0x2b33c6];return _0x2b4d9d;};'use strict';var _=require(_0xcbeb('0x0'));var util=require(_0xcbeb('0x1'));var moment=require(_0xcbeb('0x2'));var BPromise=require(_0xcbeb('0x3'));var rs=require(_0xcbeb('0x4'));var fs=require('fs');var Redis=require(_0xcbeb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbeb('0x6'));var logger=require('../../config/logger')(_0xcbeb('0x7'));var config=require(_0xcbeb('0x8'));var jayson=require(_0xcbeb('0x9'));var client=jayson[_0xcbeb('0xa')][_0xcbeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2928f4,_0x397056,_0x277061){return new BPromise(function(_0x40945d,_0x36db70){return client[_0xcbeb('0xc')](_0x2928f4,_0x277061)['then'](function(_0x45bad2){logger[_0xcbeb('0xd')](_0xcbeb('0xe'),_0x397056,_0xcbeb('0xf'));logger[_0xcbeb('0x10')](_0xcbeb('0x11'),_0x397056,_0xcbeb('0xf'),JSON[_0xcbeb('0x12')](_0x45bad2));if(_0x45bad2['error']){if(_0x45bad2[_0xcbeb('0x13')]['code']===0x1f4){logger[_0xcbeb('0x13')](_0xcbeb('0xe'),_0x397056,_0x45bad2[_0xcbeb('0x13')][_0xcbeb('0x14')]);return _0x36db70(_0x45bad2['error'][_0xcbeb('0x14')]);}logger[_0xcbeb('0x13')](_0xcbeb('0xe'),_0x397056,_0x45bad2[_0xcbeb('0x13')][_0xcbeb('0x14')]);return _0x40945d(_0x45bad2[_0xcbeb('0x13')][_0xcbeb('0x14')]);}else{logger['info'](_0xcbeb('0xe'),_0x397056,_0xcbeb('0xf'));_0x40945d(_0x45bad2[_0xcbeb('0x15')]['message']);}})[_0xcbeb('0x16')](function(_0x230e88){logger[_0xcbeb('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x397056,_0x230e88);_0x36db70(_0x230e88);});});} \ No newline at end of file +var _0xd77f=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2867fc,_0x174116){var _0x509b87=function(_0x3dc19b){while(--_0x3dc19b){_0x2867fc['push'](_0x2867fc['shift']());}};_0x509b87(++_0x174116);}(_0xd77f,0x70));var _0xfd77=function(_0x3775a6,_0x472b9c){_0x3775a6=_0x3775a6-0x0;var _0x5fe1d4=_0xd77f[_0x3775a6];return _0x5fe1d4;};'use strict';var _=require(_0xfd77('0x0'));var util=require(_0xfd77('0x1'));var moment=require(_0xfd77('0x2'));var BPromise=require(_0xfd77('0x3'));var rs=require(_0xfd77('0x4'));var fs=require('fs');var Redis=require(_0xfd77('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd77('0x6'));var logger=require(_0xfd77('0x7'))(_0xfd77('0x8'));var config=require(_0xfd77('0x9'));var jayson=require(_0xfd77('0xa'));var client=jayson[_0xfd77('0xb')][_0xfd77('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2435cf,_0x4d31ce,_0x1bcfe8){return new BPromise(function(_0x1370e0,_0x592f70){return client[_0xfd77('0xd')](_0x2435cf,_0x1bcfe8)[_0xfd77('0xe')](function(_0x48fca0){logger[_0xfd77('0xf')](_0xfd77('0x10'),_0x4d31ce,_0xfd77('0x11'));logger[_0xfd77('0x12')](_0xfd77('0x13'),_0x4d31ce,_0xfd77('0x11'),JSON[_0xfd77('0x14')](_0x48fca0));if(_0x48fca0['error']){if(_0x48fca0[_0xfd77('0x15')][_0xfd77('0x16')]===0x1f4){logger[_0xfd77('0x15')](_0xfd77('0x10'),_0x4d31ce,_0x48fca0['error'][_0xfd77('0x17')]);return _0x592f70(_0x48fca0[_0xfd77('0x15')][_0xfd77('0x17')]);}logger[_0xfd77('0x15')](_0xfd77('0x10'),_0x4d31ce,_0x48fca0[_0xfd77('0x15')]['message']);return _0x1370e0(_0x48fca0['error'][_0xfd77('0x17')]);}else{logger[_0xfd77('0xf')](_0xfd77('0x10'),_0x4d31ce,'request\x20sent');_0x1370e0(_0x48fca0['result'][_0xfd77('0x17')]);}})[_0xfd77('0x18')](function(_0x2414df){logger[_0xfd77('0x15')](_0xfd77('0x10'),_0x4d31ce,_0x2414df);_0x592f70(_0x2414df);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index e6187f5..4484e61 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x39a508,_0x1c735e){_0x39a508=_0x39a508-0x0;var _0x24dcfa=_0xb4c7[_0x39a508];return _0x24dcfa;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file +var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x55a879,_0x56ae94){var _0x26f3ff=function(_0x36e537){while(--_0x36e537){_0x55a879['push'](_0x55a879['shift']());}};_0x26f3ff(++_0x56ae94);}(_0x032e,0x124));var _0xe032=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x032e[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 68047c5..115094a 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 _0x6bb7=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x415260,_0x135fcb){var _0x490f21=function(_0x28d91c){while(--_0x28d91c){_0x415260['push'](_0x415260['shift']());}};_0x490f21(++_0x135fcb);}(_0x6bb7,0x89));var _0x76bb=function(_0x10c577,_0x2bc20b){_0x10c577=_0x10c577-0x0;var _0x22173a=_0x6bb7[_0x10c577];return _0x22173a;};'use strict';var Sequelize=require(_0x76bb('0x0'));module[_0x76bb('0x1')]={'name':{'type':Sequelize[_0x76bb('0x2')],'unique':_0x76bb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x76bb('0x2')]},'timeout':{'type':Sequelize[_0x76bb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x76bb('0x5')](_0x76bb('0x6'),_0x76bb('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xca13=['roundrobin','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x4c71fa,_0x14b8f7){var _0x46621e=function(_0xcc58b2){while(--_0xcc58b2){_0x4c71fa['push'](_0x4c71fa['shift']());}};_0x46621e(++_0x14b8f7);}(_0xca13,0x1a5));var _0x3ca1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca13[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3ca1('0x0'));module[_0x3ca1('0x1')]={'name':{'type':Sequelize[_0x3ca1('0x2')],'unique':_0x3ca1('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3ca1('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ca1('0x4')]('rrmemory',_0x3ca1('0x5'),_0x3ca1('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 2ffc28f..e5eb78a 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 _0x53e2=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','request\x20sent','error','code','message','result','catch','ChatQueue,\x20%s,\x20%s','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1c57fd,_0x5eeeae){var _0x408d52=function(_0x4668bf){while(--_0x4668bf){_0x1c57fd['push'](_0x1c57fd['shift']());}};_0x408d52(++_0x5eeeae);}(_0x53e2,0xd1));var _0x253e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x53e2[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x253e('0x0'));var rimraf=require(_0x253e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x253e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x253e('0x3'));var Mustache=require(_0x253e('0x4'));var util=require(_0x253e('0x5'));var path=require(_0x253e('0x6'));var sox=require(_0x253e('0x7'));var csv=require('to-csv');var ejs=require(_0x253e('0x8'));var fs=require('fs');var fs_extra=require(_0x253e('0x9'));var _=require(_0x253e('0xa'));var squel=require(_0x253e('0xb'));var crypto=require('crypto');var jsforce=require(_0x253e('0xc'));var deskjs=require(_0x253e('0xd'));var toCsv=require(_0x253e('0xe'));var querystring=require(_0x253e('0xf'));var Papa=require(_0x253e('0x10'));var Redis=require(_0x253e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x253e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x253e('0x13'));var logger=require(_0x253e('0x14'))(_0x253e('0x15'));var utils=require('../../config/utils');var config=require(_0x253e('0x16'));var licenseUtil=require(_0x253e('0x17'));var db=require('../../mysqldb')['db'];config[_0x253e('0x18')]=_['defaults'](config['redis'],{'host':_0x253e('0x19'),'port':0x18eb});var socket=require(_0x253e('0x1a'))(new Redis(config[_0x253e('0x18')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x253e('0x1b'));var client=jayson[_0x253e('0x1c')][_0x253e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2bb80a,_0x10a1ef,_0x37819f,_0x203477){return new BPromise(function(_0x673119,_0x99904b){var _0x3068e6=_0x203477||client;return _0x3068e6[_0x253e('0x1e')](_0x2bb80a,_0x37819f)['then'](function(_0x252e2d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x253e('0x1f'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x10a1ef,_0x253e('0x1f'),JSON['stringify'](_0x252e2d));if(_0x252e2d[_0x253e('0x20')]){if(_0x252e2d[_0x253e('0x20')][_0x253e('0x21')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x252e2d[_0x253e('0x20')][_0x253e('0x22')]);return _0x99904b(_0x252e2d[_0x253e('0x20')]['message']);}logger[_0x253e('0x20')]('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x252e2d[_0x253e('0x20')][_0x253e('0x22')]);return _0x673119(_0x252e2d['error'][_0x253e('0x22')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x10a1ef,_0x253e('0x1f'));_0x673119(_0x252e2d[_0x253e('0x23')][_0x253e('0x22')]);}})[_0x253e('0x24')](function(_0x32cdc7){logger[_0x253e('0x20')](_0x253e('0x25'),_0x10a1ef,_0x32cdc7);_0x99904b(_0x32cdc7);});});}function respondWithStatusCode(_0xeacbd8,_0x556523){_0x556523=_0x556523||0xcc;return function(_0x5366ef){if(_0x5366ef){return _0xeacbd8[_0x253e('0x26')](_0x556523);}return _0xeacbd8[_0x253e('0x27')](_0x556523)[_0x253e('0x28')]();};}function respondWithResult(_0x3d4df1,_0x5630d7){_0x5630d7=_0x5630d7||0xc8;return function(_0x79a15d){if(_0x79a15d){return _0x3d4df1['status'](_0x5630d7)['json'](_0x79a15d);}};}function respondWithFilteredResult(_0x2d8588,_0x49187b){return function(_0x308e97){if(_0x308e97){var _0x259ef8=typeof _0x49187b[_0x253e('0x29')]===_0x253e('0x2a')&&typeof _0x49187b[_0x253e('0x2b')]===_0x253e('0x2a');var _0x1b0958=_0x308e97[_0x253e('0x2c')];var _0x4f22ad=_0x259ef8?0x0:_0x49187b['offset'];var _0x23a844=_0x259ef8?_0x308e97[_0x253e('0x2c')]:_0x49187b['offset']+_0x49187b['limit'];var _0x113fb1;if(_0x23a844>=_0x1b0958){_0x23a844=_0x1b0958;_0x113fb1=0xc8;}else{_0x113fb1=0xce;}_0x2d8588['status'](_0x113fb1);return _0x2d8588[_0x253e('0x2d')](_0x253e('0x2e'),_0x4f22ad+'-'+_0x23a844+'/'+_0x1b0958)['json'](_0x308e97);}return null;};}function patchUpdates(_0x2cc5c7){return function(_0x39690f){try{jsonpatch[_0x253e('0x2f')](_0x39690f,_0x2cc5c7,!![]);}catch(_0x45b46a){return BPromise[_0x253e('0x30')](_0x45b46a);}return _0x39690f[_0x253e('0x31')]();};}function saveUpdates(_0x5a9d30,_0xa9ccf9){return function(_0x38e1ae){if(_0x38e1ae){return _0x38e1ae['update'](_0x5a9d30)[_0x253e('0x32')](function(_0xc9301b){return _0xc9301b;});}return null;};}function removeEntity(_0x5da2b6,_0x557fcb){return function(_0x5ce71c){if(_0x5ce71c){return _0x5ce71c['destroy']()['then'](function(){var _0x148ea3=_0x5ce71c[_0x253e('0x33')]({'plain':!![]});var _0x342304=_0x253e('0x34');return db[_0x253e('0x35')][_0x253e('0x36')]({'where':{'type':_0x342304,'resourceId':_0x148ea3['id']}})[_0x253e('0x32')](function(){return _0x5ce71c;});})[_0x253e('0x32')](function(){_0x5da2b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a880,_0x8a8ca0){return function(_0x38fbbd){if(!_0x38fbbd){_0x49a880[_0x253e('0x26')](0x194);}return _0x38fbbd;};}function handleError(_0x556efd,_0x4f983d){_0x4f983d=_0x4f983d||0x1f4;return function(_0x2e2bbe){logger[_0x253e('0x20')](_0x2e2bbe[_0x253e('0x37')]);if(_0x2e2bbe['name']){delete _0x2e2bbe[_0x253e('0x38')];}_0x556efd['status'](_0x4f983d)[_0x253e('0x39')](_0x2e2bbe);};}exports[_0x253e('0x3a')]=function(_0x3fe415,_0x43439d){var _0x4d93f6={},_0x5ce3a2={},_0x3c7530={'count':0x0,'rows':[]};var _0x3284a6=_[_0x253e('0x3b')](db[_0x253e('0x3c')][_0x253e('0x3d')],function(_0x59a5a2){return{'name':_0x59a5a2[_0x253e('0x3e')],'type':_0x59a5a2['type']['key']};});_0x5ce3a2['model']=_[_0x253e('0x3b')](_0x3284a6,'name');_0x5ce3a2[_0x253e('0x3f')]=_['keys'](_0x3fe415[_0x253e('0x3f')]);_0x5ce3a2[_0x253e('0x40')]=_[_0x253e('0x41')](_0x5ce3a2[_0x253e('0x42')],_0x5ce3a2[_0x253e('0x3f')]);_0x4d93f6[_0x253e('0x43')]=_[_0x253e('0x41')](_0x5ce3a2['model'],qs[_0x253e('0x44')](_0x3fe415[_0x253e('0x3f')][_0x253e('0x44')]));_0x4d93f6[_0x253e('0x43')]=_0x4d93f6[_0x253e('0x43')]['length']?_0x4d93f6['attributes']:_0x5ce3a2['model'];if(!_0x3fe415['query'][_0x253e('0x45')](_0x253e('0x46'))){_0x4d93f6[_0x253e('0x2b')]=qs[_0x253e('0x2b')](_0x3fe415[_0x253e('0x3f')]['limit']);_0x4d93f6[_0x253e('0x29')]=qs[_0x253e('0x29')](_0x3fe415[_0x253e('0x3f')]['offset']);}_0x4d93f6[_0x253e('0x47')]=qs[_0x253e('0x48')](_0x3fe415[_0x253e('0x3f')]['sort']);_0x4d93f6['where']=qs[_0x253e('0x40')](_[_0x253e('0x49')](_0x3fe415[_0x253e('0x3f')],_0x5ce3a2[_0x253e('0x40')]),_0x3284a6);if(_0x3fe415[_0x253e('0x3f')][_0x253e('0x4a')]){_0x4d93f6[_0x253e('0x4b')]=_[_0x253e('0x4c')](_0x4d93f6[_0x253e('0x4b')],{'$or':_[_0x253e('0x3b')](_0x3284a6,function(_0x2d8bf9){if(_0x2d8bf9['type']!==_0x253e('0x4d')){var _0xd959d6={};_0xd959d6[_0x2d8bf9['name']]={'$like':'%'+_0x3fe415[_0x253e('0x3f')][_0x253e('0x4a')]+'%'};return _0xd959d6;}})});}_0x4d93f6=_[_0x253e('0x4c')]({},_0x4d93f6,_0x3fe415[_0x253e('0x4e')]);var _0x18af22={'where':_0x4d93f6[_0x253e('0x4b')]};return db[_0x253e('0x3c')][_0x253e('0x2c')](_0x18af22)[_0x253e('0x32')](function(_0xaa6b86){_0x3c7530[_0x253e('0x2c')]=_0xaa6b86;if(_0x3fe415['query'][_0x253e('0x4f')]){_0x4d93f6[_0x253e('0x50')]=[{'all':!![]}];}return db[_0x253e('0x3c')][_0x253e('0x51')](_0x4d93f6);})[_0x253e('0x32')](function(_0x37af50){_0x3c7530[_0x253e('0x52')]=_0x37af50;return _0x3c7530;})['then'](respondWithFilteredResult(_0x43439d,_0x4d93f6))[_0x253e('0x24')](handleError(_0x43439d,null));};exports[_0x253e('0x53')]=function(_0x9847bb,_0x4676be){var _0x226c26={'raw':!![],'where':{'id':_0x9847bb[_0x253e('0x54')]['id']}},_0x59f0c6={};_0x59f0c6[_0x253e('0x42')]=_['keys'](db['ChatQueue'][_0x253e('0x3d')]);_0x59f0c6[_0x253e('0x3f')]=_[_0x253e('0x55')](_0x9847bb[_0x253e('0x3f')]);_0x59f0c6[_0x253e('0x40')]=_['intersection'](_0x59f0c6[_0x253e('0x42')],_0x59f0c6[_0x253e('0x3f')]);_0x226c26[_0x253e('0x43')]=_['intersection'](_0x59f0c6[_0x253e('0x42')],qs[_0x253e('0x44')](_0x9847bb[_0x253e('0x3f')][_0x253e('0x44')]));_0x226c26[_0x253e('0x43')]=_0x226c26[_0x253e('0x43')][_0x253e('0x56')]?_0x226c26[_0x253e('0x43')]:_0x59f0c6[_0x253e('0x42')];if(_0x9847bb[_0x253e('0x3f')][_0x253e('0x4f')]){_0x226c26[_0x253e('0x50')]=[{'all':!![]}];}_0x226c26=_['merge']({},_0x226c26,_0x9847bb[_0x253e('0x4e')]);return db[_0x253e('0x3c')][_0x253e('0x57')](_0x226c26)[_0x253e('0x32')](handleEntityNotFound(_0x4676be,null))['then'](respondWithResult(_0x4676be,null))['catch'](handleError(_0x4676be,null));};exports[_0x253e('0x58')]=function(_0x192708,_0x1e3142){return db[_0x253e('0x3c')][_0x253e('0x58')](_0x192708[_0x253e('0x59')],{})[_0x253e('0x32')](function(_0x1c8230){var _0x48388e=_0x192708[_0x253e('0x5a')][_0x253e('0x33')]({'plain':!![]});if(!_0x48388e)throw new Error(_0x253e('0x5b'));if(_0x48388e[_0x253e('0x5c')]===_0x253e('0x5a')){var _0x232174=_0x1c8230[_0x253e('0x33')]({'plain':!![]});var _0x944707=_0x253e('0x34');return db[_0x253e('0x5d')]['find']({'where':{'name':_0x944707,'userProfileId':_0x48388e[_0x253e('0x5e')]},'raw':!![]})[_0x253e('0x32')](function(_0x4ce13f){if(_0x4ce13f&&_0x4ce13f[_0x253e('0x5f')]===0x0){return db[_0x253e('0x35')]['create']({'name':_0x232174[_0x253e('0x38')],'resourceId':_0x232174['id'],'type':_0x4ce13f[_0x253e('0x38')],'sectionId':_0x4ce13f['id']},{})['then'](function(){return _0x1c8230;});}else{return _0x1c8230;}})[_0x253e('0x24')](function(_0x1e67f8){logger[_0x253e('0x20')](_0x253e('0x60'),_0x1e67f8);throw _0x1e67f8;});}return _0x1c8230;})[_0x253e('0x32')](respondWithResult(_0x1e3142,0xc9))[_0x253e('0x24')](handleError(_0x1e3142,null));};exports[_0x253e('0x61')]=function(_0x192a7c,_0x5573af){if(_0x192a7c[_0x253e('0x59')]['id']){delete _0x192a7c[_0x253e('0x59')]['id'];}return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x192a7c['params']['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x5573af,null))[_0x253e('0x32')](saveUpdates(_0x192a7c[_0x253e('0x59')],null))['then'](respondWithResult(_0x5573af,null))[_0x253e('0x24')](handleError(_0x5573af,null));};exports[_0x253e('0x36')]=function(_0x2d1fb0,_0x4630ad){return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x2d1fb0[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x4630ad,null))[_0x253e('0x32')](removeEntity(_0x4630ad,null))[_0x253e('0x24')](handleError(_0x4630ad,null));};exports[_0x253e('0x62')]=function(_0x17aca9,_0x329f76){return db[_0x253e('0x3c')][_0x253e('0x62')]()['then'](respondWithResult(_0x329f76,null))[_0x253e('0x24')](handleError(_0x329f76,null));};exports['getMembers']=function(_0x1890ea,_0x22ba95,_0x282393){var _0x1291cc={'raw':!![],'where':{}},_0x4a4cab={},_0xf07f30;return db[_0x253e('0x3c')][_0x253e('0x63')]({'where':{'id':_0x1890ea[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x22ba95,null))['then'](function(_0x11346f){if(_0x11346f){_0xf07f30=_0x11346f['get']({'plain':!![]});_0x4a4cab[_0x253e('0x42')]=_[_0x253e('0x55')](db[_0x253e('0x64')][_0x253e('0x3d')]);_0x4a4cab[_0x253e('0x3f')]=_[_0x253e('0x55')](_0x1890ea[_0x253e('0x3f')]);_0x4a4cab[_0x253e('0x40')]=_['intersection'](_0x4a4cab[_0x253e('0x42')],_0x4a4cab[_0x253e('0x3f')]);_0x1291cc[_0x253e('0x43')]=_[_0x253e('0x41')](_0x4a4cab[_0x253e('0x42')],qs[_0x253e('0x44')](_0x1890ea[_0x253e('0x3f')][_0x253e('0x44')]));_0x1291cc['attributes']=_0x1291cc[_0x253e('0x43')]['length']?_0x1291cc['attributes']:_0x4a4cab['model'];if(!_0x1890ea[_0x253e('0x3f')]['hasOwnProperty'](_0x253e('0x46'))){_0x1291cc[_0x253e('0x2b')]=qs[_0x253e('0x2b')](_0x1890ea[_0x253e('0x3f')]['limit']);_0x1291cc['offset']=qs[_0x253e('0x29')](_0x1890ea[_0x253e('0x3f')]['offset']);}_0x1291cc[_0x253e('0x47')]=qs[_0x253e('0x48')](_0x1890ea[_0x253e('0x3f')][_0x253e('0x48')]);_0x1291cc['where']=qs[_0x253e('0x40')](_['pick'](_0x1890ea[_0x253e('0x3f')],_0x4a4cab['filters']));_0x1291cc[_0x253e('0x4b')][_0x253e('0x65')]=_0x11346f['id'];if(_0x1890ea['query'][_0x253e('0x4a')]){_0x1291cc[_0x253e('0x4b')]=_['merge'](_0x1291cc[_0x253e('0x4b')],{'$or':_[_0x253e('0x3b')](_0x1291cc[_0x253e('0x43')],function(_0x4238a6){var _0x46b0f3={};_0x46b0f3[_0x4238a6]={'$like':'%'+_0x1890ea[_0x253e('0x3f')][_0x253e('0x4a')]+'%'};return _0x46b0f3;})});}_0x1291cc=_[_0x253e('0x4c')]({},_0x1291cc,_0x1890ea[_0x253e('0x4e')]);return db[_0x253e('0x64')][_0x253e('0x51')](_0x1291cc);}})[_0x253e('0x32')](function(_0x4c973d){if(_0x4c973d){return db['User'][_0x253e('0x66')]({'where':{'id':_['map'](_0x4c973d,_0x253e('0x67')),'role':_0x253e('0x68')},'attributes':['id',_0x253e('0x38'),_0x253e('0x69'),_0x253e('0x6a'),_0x253e('0x6b')]});}})[_0x253e('0x32')](function(_0x256ea0){if(_0x256ea0){return{'count':_0x256ea0[_0x253e('0x2c')],'rows':_[_0x253e('0x3b')](_0x256ea0['rows'],function(_0x30c2ba){return{'membername':_0x30c2ba[_0x253e('0x38')],'UserId':_0x30c2ba['id'],'queue_name':_0xf07f30[_0x253e('0x38')],'ChatQueueId':_0xf07f30['id'],'interface':util[_0x253e('0x6c')](_0x253e('0x6d'),_0x253e('0x6e'),_0x30c2ba[_0x253e('0x38')]),'penalty':0x0,'paused':_0x30c2ba[_0x253e('0x69')],'createdAt':_0x30c2ba[_0x253e('0x6b')],'updatedAt':_0x30c2ba[_0x253e('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x22ba95,_0x1291cc))[_0x253e('0x24')](handleError(_0x22ba95,null));};exports['getTeams']=function(_0x3710a9,_0x295c22,_0x27aa00){var _0x5b663f={};var _0x44b331={};var _0x12644b;var _0x406810;return db[_0x253e('0x3c')][_0x253e('0x63')]({'where':{'id':_0x3710a9[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0x295c22,null))['then'](function(_0x20f90b){if(_0x20f90b){_0x12644b=_0x20f90b;_0x44b331[_0x253e('0x42')]=_[_0x253e('0x55')](db[_0x253e('0x6f')][_0x253e('0x3d')]);_0x44b331['query']=_[_0x253e('0x55')](_0x3710a9[_0x253e('0x3f')]);_0x44b331[_0x253e('0x40')]=_[_0x253e('0x41')](_0x44b331[_0x253e('0x42')],_0x44b331[_0x253e('0x3f')]);_0x5b663f[_0x253e('0x43')]=_['intersection'](_0x44b331['model'],qs[_0x253e('0x44')](_0x3710a9[_0x253e('0x3f')][_0x253e('0x44')]));_0x5b663f[_0x253e('0x43')]=_0x5b663f[_0x253e('0x43')][_0x253e('0x56')]?_0x5b663f[_0x253e('0x43')]:_0x44b331[_0x253e('0x42')];_0x5b663f[_0x253e('0x47')]=qs['sort'](_0x3710a9[_0x253e('0x3f')][_0x253e('0x48')]);_0x5b663f[_0x253e('0x4b')]=qs[_0x253e('0x40')](_[_0x253e('0x49')](_0x3710a9[_0x253e('0x3f')],_0x44b331[_0x253e('0x40')]));if(_0x3710a9['query'][_0x253e('0x4a')]){_0x5b663f['where']=_['merge'](_0x5b663f[_0x253e('0x4b')],{'$or':_['map'](_0x5b663f[_0x253e('0x43')],function(_0x4d0d31){var _0x162fa6={};_0x162fa6[_0x4d0d31]={'$like':'%'+_0x3710a9[_0x253e('0x3f')]['filter']+'%'};return _0x162fa6;})});}_0x5b663f=_[_0x253e('0x4c')]({},_0x5b663f,_0x3710a9['options']);return _0x12644b[_0x253e('0x70')](_0x5b663f);}})[_0x253e('0x32')](function(_0x1455af){if(_0x1455af){_0x406810=_0x1455af[_0x253e('0x56')];if(!_0x3710a9[_0x253e('0x3f')]['hasOwnProperty'](_0x253e('0x46'))){_0x5b663f['limit']=qs['limit'](_0x3710a9[_0x253e('0x3f')][_0x253e('0x2b')]);_0x5b663f[_0x253e('0x29')]=qs[_0x253e('0x29')](_0x3710a9[_0x253e('0x3f')][_0x253e('0x29')]);}return _0x12644b[_0x253e('0x70')](_0x5b663f);}})[_0x253e('0x32')](function(_0x24e50d){if(_0x24e50d){return _0x24e50d?{'count':_0x406810,'rows':_0x24e50d}:null;}})[_0x253e('0x32')](respondWithResult(_0x295c22,null))[_0x253e('0x24')](handleError(_0x295c22,null));};exports[_0x253e('0x71')]=function(_0x5b7b91,_0x1b204c,_0x5e2cac){var _0x4ea8a6=_0x5b7b91[_0x253e('0x59')][_0x253e('0x72')];return db[_0x253e('0x6f')][_0x253e('0x51')]({'where':{'id':_0x4ea8a6},'attributes':['id'],'include':[{'model':db[_0x253e('0x73')],'as':_0x253e('0x74'),'attributes':['id',_0x253e('0x38'),_0x253e('0x75'),'voicePause',_0x253e('0x76')],'raw':!![]}]})[_0x253e('0x32')](function(_0x30444e){if(_0x30444e){var _0x222ef3=_[_0x253e('0x77')](_0x30444e,function(_0x445991){var _0x37268e=_0x445991[_0x253e('0x33')]({'plain':!![]});return _0x37268e[_0x253e('0x74')];});return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x5b7b91[_0x253e('0x54')]['id']}})[_0x253e('0x32')](function(_0x2d69c4){return db[_0x253e('0x78')][_0x253e('0x79')](function(_0xeeb266){return _0x2d69c4[_0x253e('0x71')](_0x4ea8a6,{'transaction':_0xeeb266})['then'](function(){return BPromise[_0x253e('0x7a')](_0x222ef3,function(_0x37dbd1){return db[_0x253e('0x64')][_0x253e('0x7b')]({'where':{'UserId':_0x37dbd1['id'],'ChatQueueId':_0x5b7b91[_0x253e('0x54')]['id']},'transaction':_0xeeb266});});})[_0x253e('0x32')](function(){_0x222ef3[_0x253e('0x7c')](function(_0x144537){socket[_0x253e('0x7d')]('userChatQueue:save',{'UserId':_0x144537['id'],'ChatQueueId':_0x2d69c4['id']});});});});});}})[_0x253e('0x32')](respondWithStatusCode(_0x1b204c,null))['catch'](handleError(_0x1b204c,null));};exports['removeTeams']=function(_0x114b5f,_0x5e953c,_0x3aaad5){return db[_0x253e('0x6f')][_0x253e('0x51')]({'where':{'id':_0x114b5f[_0x253e('0x3f')][_0x253e('0x72')]},'attributes':['id'],'include':[{'model':db[_0x253e('0x73')],'as':_0x253e('0x74'),'attributes':['id'],'raw':!![]}]})[_0x253e('0x32')](handleEntityNotFound(_0x5e953c,null))[_0x253e('0x32')](function(_0x2b1c0d){var _0x359cea=_[_0x253e('0x3b')](_0x2b1c0d,'id');var _0x25bbad=[];var _0x3a6bb6=[];var _0xb384b0=squel[_0x253e('0x7e')]();_0xb384b0[_0x253e('0x7f')](_0x253e('0x80'))[_0x253e('0x81')](_0x253e('0x82'),'tq')[_0x253e('0x83')]('user_has_teams','ut',_0x253e('0x84'))[_0x253e('0x4b')](_0x253e('0x85'),_0x114b5f[_0x253e('0x54')]['id']);for(var _0x322333=0x0;_0x322333<_0x2b1c0d['length'];_0x322333+=0x1){let _0x55f9f7=_0x2b1c0d[_0x322333];for(var _0x1977c9=0x0;_0x1977c9<_0x55f9f7['Agents']['length'];_0x1977c9+=0x1){let _0x437f94=_0x55f9f7[_0x253e('0x74')][_0x1977c9];var _0x2cb1eb=_0xb384b0[_0x253e('0x86')]();_0x2cb1eb[_0x253e('0x4b')](_0x253e('0x87'),_0x437f94['id']);_0x3a6bb6['push'](db[_0x253e('0x78')][_0x253e('0x3f')](_0x2cb1eb['toString'](),{'type':db[_0x253e('0x78')]['QueryTypes'][_0x253e('0x88')]})[_0x253e('0x32')](function(_0x17b87b){if(_0x17b87b['length']===0x1){return _0x437f94['id'];}else{var _0x138f82=_[_0x253e('0x89')](_['map'](_0x17b87b,_0x253e('0x8a')),function(_0x13cc87){return _[_0x253e('0x8b')](_0x359cea,_0x13cc87);});if(_0x138f82){return _0x437f94['id'];}}}));}}return BPromise[_0x253e('0x8c')](_0x3a6bb6)[_0x253e('0x32')](function(_0x4a4974){_0x25bbad=_(_0x25bbad)[_0x253e('0x8d')](_0x4a4974)[_0x253e('0x8e')]()[_0x253e('0x8f')]();return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x114b5f[_0x253e('0x54')]['id']}})[_0x253e('0x32')](function(_0x1626df){return db[_0x253e('0x78')][_0x253e('0x79')](function(_0x3f7f63){return _0x1626df[_0x253e('0x90')](_0x114b5f['query'][_0x253e('0x72')],{'transaction':_0x3f7f63})['then'](function(){if(!_['isEmpty'](_0x25bbad)){return _0x1626df[_0x253e('0x91')](_0x25bbad,{'transaction':_0x3f7f63});}})[_0x253e('0x32')](function(){_0x25bbad[_0x253e('0x7c')](function(_0x1140ed){socket[_0x253e('0x7d')]('userChatQueue:remove',{'UserId':_0x1140ed,'ChatQueueId':_0x1626df['id']});});});});});});})[_0x253e('0x32')](respondWithStatusCode(_0x5e953c,null))[_0x253e('0x24')](handleError(_0x5e953c,null));};exports['addAgents']=function(_0x4990c7,_0xb70d9d,_0x5a2970){return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x4990c7[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0xb70d9d,null))[_0x253e('0x32')](function(_0x59f1db){if(_0x59f1db){return _0x59f1db[_0x253e('0x92')](_0x4990c7['body']['ids'],_[_0x253e('0x93')](_0x4990c7[_0x253e('0x59')],[_0x253e('0x72'),'id'])||{})['spread'](function(_0x2716f8){for(var _0x58ecbc=0x0;_0x58ecbc<_0x4990c7[_0x253e('0x59')][_0x253e('0x72')][_0x253e('0x56')];_0x58ecbc+=0x1){socket[_0x253e('0x7d')]('userChatQueue:save',{'UserId':Number(_0x4990c7['body'][_0x253e('0x72')][_0x58ecbc]),'ChatQueueId':Number(_0x4990c7['params']['id'])});}return _0x2716f8;});}})[_0x253e('0x32')](respondWithResult(_0xb70d9d,null))[_0x253e('0x24')](handleError(_0xb70d9d,null));};exports['removeAgents']=function(_0x1be931,_0x27b666,_0x25a9d6){return db[_0x253e('0x3c')][_0x253e('0x57')]({'where':{'id':_0x1be931['params']['id']}})['then'](handleEntityNotFound(_0x27b666,null))[_0x253e('0x32')](function(_0x11e46d){if(_0x11e46d){return _0x11e46d[_0x253e('0x91')](_0x1be931[_0x253e('0x3f')][_0x253e('0x72')])[_0x253e('0x32')](function(){if(_[_0x253e('0x94')](_0x1be931['query'][_0x253e('0x72')])){for(var _0x239eb9=0x0;_0x239eb9<_0x1be931['query'][_0x253e('0x72')][_0x253e('0x56')];_0x239eb9+=0x1){socket[_0x253e('0x7d')](_0x253e('0x95'),{'UserId':Number(_0x1be931[_0x253e('0x3f')]['ids'][_0x239eb9]),'ChatQueueId':Number(_0x1be931[_0x253e('0x54')]['id'])});}}else{socket[_0x253e('0x7d')](_0x253e('0x95'),{'UserId':Number(_0x1be931[_0x253e('0x3f')][_0x253e('0x72')]),'ChatQueueId':Number(_0x1be931[_0x253e('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x27b666,null))['catch'](handleError(_0x27b666,null));};exports[_0x253e('0x96')]=function(_0x4e5b47,_0xdceffe,_0x1c76f5){var _0x18e5e3={};var _0x5b7e52={};var _0x39af81;var _0x180b4f;return db[_0x253e('0x3c')][_0x253e('0x63')]({'where':{'id':_0x4e5b47[_0x253e('0x54')]['id']}})[_0x253e('0x32')](handleEntityNotFound(_0xdceffe,null))['then'](function(_0x489c3e){if(_0x489c3e){_0x39af81=_0x489c3e;_0x5b7e52[_0x253e('0x42')]=_[_0x253e('0x55')](db[_0x253e('0x73')][_0x253e('0x3d')]);_0x5b7e52[_0x253e('0x3f')]=_[_0x253e('0x55')](_0x4e5b47['query']);_0x5b7e52['filters']=_[_0x253e('0x41')](_0x5b7e52[_0x253e('0x42')],_0x5b7e52[_0x253e('0x3f')]);_0x18e5e3[_0x253e('0x43')]=_['intersection'](_0x5b7e52[_0x253e('0x42')],qs[_0x253e('0x44')](_0x4e5b47[_0x253e('0x3f')][_0x253e('0x44')]));_0x18e5e3[_0x253e('0x43')]=_0x18e5e3['attributes'][_0x253e('0x56')]?_0x18e5e3[_0x253e('0x43')]:_0x5b7e52[_0x253e('0x42')];_0x18e5e3[_0x253e('0x47')]=qs[_0x253e('0x48')](_0x4e5b47['query']['sort']);_0x18e5e3[_0x253e('0x4b')]=qs[_0x253e('0x40')](_[_0x253e('0x49')](_0x4e5b47[_0x253e('0x3f')],_0x5b7e52['filters']));if(_0x4e5b47[_0x253e('0x3f')]['filter']){_0x18e5e3['where']=_[_0x253e('0x4c')](_0x18e5e3[_0x253e('0x4b')],{'$or':_['map'](_0x18e5e3['attributes'],function(_0x1205ff){var _0x2bda63={};_0x2bda63[_0x1205ff]={'$like':'%'+_0x4e5b47[_0x253e('0x3f')][_0x253e('0x4a')]+'%'};return _0x2bda63;})});}_0x18e5e3=_[_0x253e('0x4c')]({},_0x18e5e3,_0x4e5b47['options']);return _0x39af81[_0x253e('0x96')](_0x18e5e3);}})['then'](function(_0x161409){if(_0x161409){_0x180b4f=_0x161409['length'];if(!_0x4e5b47['query'][_0x253e('0x45')](_0x253e('0x46'))){_0x18e5e3[_0x253e('0x2b')]=qs[_0x253e('0x2b')](_0x4e5b47[_0x253e('0x3f')][_0x253e('0x2b')]);_0x18e5e3['offset']=qs[_0x253e('0x29')](_0x4e5b47[_0x253e('0x3f')][_0x253e('0x29')]);}return _0x39af81[_0x253e('0x96')](_0x18e5e3);}})[_0x253e('0x32')](function(_0x4a2607){if(_0x4a2607){return _0x4a2607?{'count':_0x180b4f,'rows':_0x4a2607}:null;}})[_0x253e('0x32')](respondWithResult(_0xdceffe,null))['catch'](handleError(_0xdceffe,null));}; \ No newline at end of file +var _0x0b2c=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','register','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','params','describe','getMembers','findOne','UserChatQueue','findAndCountAll','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','User','select','field','tq.TeamId','team_has_chat_queues','join'];(function(_0x4ffe17,_0x31d8d7){var _0x23d0b4=function(_0x485878){while(--_0x485878){_0x4ffe17['push'](_0x4ffe17['shift']());}};_0x23d0b4(++_0x31d8d7);}(_0x0b2c,0x145));var _0xc0b2=function(_0x1c9077,_0x340121){_0x1c9077=_0x1c9077-0x0;var _0x1f4579=_0x0b2c[_0x1c9077];return _0x1f4579;};'use strict';var emlformat=require(_0xc0b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc0b2('0x1'));var jsonpatch=require(_0xc0b2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc0b2('0x3'));var Mustache=require('mustache');var util=require(_0xc0b2('0x4'));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(_0xc0b2('0x5'));var _=require(_0xc0b2('0x6'));var squel=require(_0xc0b2('0x7'));var crypto=require('crypto');var jsforce=require(_0xc0b2('0x8'));var deskjs=require(_0xc0b2('0x9'));var toCsv=require(_0xc0b2('0xa'));var querystring=require(_0xc0b2('0xb'));var Papa=require(_0xc0b2('0xc'));var Redis=require(_0xc0b2('0xd'));var authService=require(_0xc0b2('0xe'));var qs=require(_0xc0b2('0xf'));var as=require(_0xc0b2('0x10'));var hardwareService=require(_0xc0b2('0x11'));var logger=require(_0xc0b2('0x12'))('api');var utils=require(_0xc0b2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc0b2('0x14'));var db=require(_0xc0b2('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc0b2('0x16')]));require('./chatQueue.socket')[_0xc0b2('0x17')](socket);var jayson=require(_0xc0b2('0x18'));var client=jayson[_0xc0b2('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x78ba93,_0x3ef590,_0x5ed6ae,_0x3e1a45){return new BPromise(function(_0x3bd35a,_0x313805){var _0x1df59c=_0x3e1a45||client;return _0x1df59c['request'](_0x78ba93,_0x5ed6ae)[_0xc0b2('0x1a')](function(_0x1ee528){logger[_0xc0b2('0x1b')](_0xc0b2('0x1c'),_0x3ef590,_0xc0b2('0x1d'));logger['debug'](_0xc0b2('0x1e'),_0x3ef590,'request\x20sent',JSON[_0xc0b2('0x1f')](_0x1ee528));if(_0x1ee528[_0xc0b2('0x20')]){if(_0x1ee528[_0xc0b2('0x20')][_0xc0b2('0x21')]===0x1f4){logger['error'](_0xc0b2('0x1c'),_0x3ef590,_0x1ee528[_0xc0b2('0x20')][_0xc0b2('0x22')]);return _0x313805(_0x1ee528[_0xc0b2('0x20')][_0xc0b2('0x22')]);}logger[_0xc0b2('0x20')](_0xc0b2('0x1c'),_0x3ef590,_0x1ee528[_0xc0b2('0x20')]['message']);return _0x3bd35a(_0x1ee528['error'][_0xc0b2('0x22')]);}else{logger[_0xc0b2('0x1b')](_0xc0b2('0x1c'),_0x3ef590,_0xc0b2('0x1d'));_0x3bd35a(_0x1ee528[_0xc0b2('0x23')]['message']);}})['catch'](function(_0x45a372){logger[_0xc0b2('0x20')]('ChatQueue,\x20%s,\x20%s',_0x3ef590,_0x45a372);_0x313805(_0x45a372);});});}function respondWithStatusCode(_0x11e01d,_0x4ce25e){_0x4ce25e=_0x4ce25e||0xcc;return function(_0x455206){if(_0x455206){return _0x11e01d[_0xc0b2('0x24')](_0x4ce25e);}return _0x11e01d['status'](_0x4ce25e)[_0xc0b2('0x25')]();};}function respondWithResult(_0x41132a,_0x2b695d){_0x2b695d=_0x2b695d||0xc8;return function(_0x52473d){if(_0x52473d){return _0x41132a['status'](_0x2b695d)[_0xc0b2('0x26')](_0x52473d);}};}function respondWithFilteredResult(_0x4adcda,_0x13515d){return function(_0x50fb91){if(_0x50fb91){var _0x3bb15d=typeof _0x13515d[_0xc0b2('0x27')]===_0xc0b2('0x28')&&typeof _0x13515d[_0xc0b2('0x29')]===_0xc0b2('0x28');var _0x29ac30=_0x50fb91[_0xc0b2('0x2a')];var _0x5f14fa=_0x3bb15d?0x0:_0x13515d[_0xc0b2('0x27')];var _0x54a66c=_0x3bb15d?_0x50fb91[_0xc0b2('0x2a')]:_0x13515d['offset']+_0x13515d[_0xc0b2('0x29')];var _0x552731;if(_0x54a66c>=_0x29ac30){_0x54a66c=_0x29ac30;_0x552731=0xc8;}else{_0x552731=0xce;}_0x4adcda[_0xc0b2('0x2b')](_0x552731);return _0x4adcda[_0xc0b2('0x2c')](_0xc0b2('0x2d'),_0x5f14fa+'-'+_0x54a66c+'/'+_0x29ac30)[_0xc0b2('0x26')](_0x50fb91);}return null;};}function patchUpdates(_0x145b74){return function(_0x4a327d){try{jsonpatch['apply'](_0x4a327d,_0x145b74,!![]);}catch(_0x14fad5){return BPromise[_0xc0b2('0x2e')](_0x14fad5);}return _0x4a327d[_0xc0b2('0x2f')]();};}function saveUpdates(_0x4f050d,_0x236799){return function(_0x2b47fb){if(_0x2b47fb){return _0x2b47fb[_0xc0b2('0x30')](_0x4f050d)[_0xc0b2('0x1a')](function(_0x4f4f95){return _0x4f4f95;});}return null;};}function removeEntity(_0x4fd735,_0x35ae62){return function(_0x2ab1bc){if(_0x2ab1bc){return _0x2ab1bc[_0xc0b2('0x31')]()[_0xc0b2('0x1a')](function(){var _0x1b8a01=_0x2ab1bc['get']({'plain':!![]});var _0x540837=_0xc0b2('0x32');return db[_0xc0b2('0x33')][_0xc0b2('0x31')]({'where':{'type':_0x540837,'resourceId':_0x1b8a01['id']}})[_0xc0b2('0x1a')](function(){return _0x2ab1bc;});})[_0xc0b2('0x1a')](function(){_0x4fd735[_0xc0b2('0x2b')](0xcc)[_0xc0b2('0x25')]();});}};}function handleEntityNotFound(_0x346d5d,_0x354a90){return function(_0x3d0afd){if(!_0x3d0afd){_0x346d5d[_0xc0b2('0x24')](0x194);}return _0x3d0afd;};}function handleError(_0x2bfc2,_0x267596){_0x267596=_0x267596||0x1f4;return function(_0x32f6a5){logger[_0xc0b2('0x20')](_0x32f6a5[_0xc0b2('0x34')]);if(_0x32f6a5['name']){delete _0x32f6a5[_0xc0b2('0x35')];}_0x2bfc2[_0xc0b2('0x2b')](_0x267596)[_0xc0b2('0x36')](_0x32f6a5);};}exports[_0xc0b2('0x37')]=function(_0x3f4000,_0x17e7fb){var _0x2c51c5={},_0x5a0783={},_0x3a4309={'count':0x0,'rows':[]};var _0x164123=_['map'](db[_0xc0b2('0x38')][_0xc0b2('0x39')],function(_0x110962){return{'name':_0x110962[_0xc0b2('0x3a')],'type':_0x110962[_0xc0b2('0x3b')][_0xc0b2('0x3c')]};});_0x5a0783[_0xc0b2('0x3d')]=_[_0xc0b2('0x3e')](_0x164123,'name');_0x5a0783[_0xc0b2('0x3f')]=_['keys'](_0x3f4000[_0xc0b2('0x3f')]);_0x5a0783['filters']=_[_0xc0b2('0x40')](_0x5a0783[_0xc0b2('0x3d')],_0x5a0783[_0xc0b2('0x3f')]);_0x2c51c5['attributes']=_[_0xc0b2('0x40')](_0x5a0783[_0xc0b2('0x3d')],qs[_0xc0b2('0x41')](_0x3f4000[_0xc0b2('0x3f')][_0xc0b2('0x41')]));_0x2c51c5[_0xc0b2('0x42')]=_0x2c51c5[_0xc0b2('0x42')][_0xc0b2('0x43')]?_0x2c51c5['attributes']:_0x5a0783['model'];if(!_0x3f4000[_0xc0b2('0x3f')][_0xc0b2('0x44')](_0xc0b2('0x45'))){_0x2c51c5[_0xc0b2('0x29')]=qs[_0xc0b2('0x29')](_0x3f4000[_0xc0b2('0x3f')][_0xc0b2('0x29')]);_0x2c51c5[_0xc0b2('0x27')]=qs[_0xc0b2('0x27')](_0x3f4000[_0xc0b2('0x3f')][_0xc0b2('0x27')]);}_0x2c51c5[_0xc0b2('0x46')]=qs[_0xc0b2('0x47')](_0x3f4000[_0xc0b2('0x3f')][_0xc0b2('0x47')]);_0x2c51c5[_0xc0b2('0x48')]=qs['filters'](_[_0xc0b2('0x49')](_0x3f4000['query'],_0x5a0783[_0xc0b2('0x4a')]),_0x164123);if(_0x3f4000[_0xc0b2('0x3f')][_0xc0b2('0x4b')]){_0x2c51c5['where']=_['merge'](_0x2c51c5['where'],{'$or':_[_0xc0b2('0x3e')](_0x164123,function(_0x54de3a){if(_0x54de3a[_0xc0b2('0x3b')]!==_0xc0b2('0x4c')){var _0x30fd43={};_0x30fd43[_0x54de3a[_0xc0b2('0x35')]]={'$like':'%'+_0x3f4000['query'][_0xc0b2('0x4b')]+'%'};return _0x30fd43;}})});}_0x2c51c5=_[_0xc0b2('0x4d')]({},_0x2c51c5,_0x3f4000[_0xc0b2('0x4e')]);var _0x2a358a={'where':_0x2c51c5[_0xc0b2('0x48')]};return db[_0xc0b2('0x38')][_0xc0b2('0x2a')](_0x2a358a)['then'](function(_0x468286){_0x3a4309[_0xc0b2('0x2a')]=_0x468286;if(_0x3f4000[_0xc0b2('0x3f')]['includeAll']){_0x2c51c5[_0xc0b2('0x4f')]=[{'all':!![]}];}return db[_0xc0b2('0x38')][_0xc0b2('0x50')](_0x2c51c5);})['then'](function(_0x259b81){_0x3a4309[_0xc0b2('0x51')]=_0x259b81;return _0x3a4309;})['then'](respondWithFilteredResult(_0x17e7fb,_0x2c51c5))[_0xc0b2('0x52')](handleError(_0x17e7fb,null));};exports[_0xc0b2('0x53')]=function(_0x4c964c,_0x24b13e){var _0x1de281={'raw':!![],'where':{'id':_0x4c964c['params']['id']}},_0x16c1b5={};_0x16c1b5['model']=_['keys'](db[_0xc0b2('0x38')][_0xc0b2('0x39')]);_0x16c1b5[_0xc0b2('0x3f')]=_[_0xc0b2('0x54')](_0x4c964c['query']);_0x16c1b5['filters']=_[_0xc0b2('0x40')](_0x16c1b5[_0xc0b2('0x3d')],_0x16c1b5[_0xc0b2('0x3f')]);_0x1de281[_0xc0b2('0x42')]=_[_0xc0b2('0x40')](_0x16c1b5['model'],qs[_0xc0b2('0x41')](_0x4c964c[_0xc0b2('0x3f')][_0xc0b2('0x41')]));_0x1de281['attributes']=_0x1de281[_0xc0b2('0x42')][_0xc0b2('0x43')]?_0x1de281[_0xc0b2('0x42')]:_0x16c1b5[_0xc0b2('0x3d')];if(_0x4c964c[_0xc0b2('0x3f')][_0xc0b2('0x55')]){_0x1de281[_0xc0b2('0x4f')]=[{'all':!![]}];}_0x1de281=_[_0xc0b2('0x4d')]({},_0x1de281,_0x4c964c[_0xc0b2('0x4e')]);return db['ChatQueue'][_0xc0b2('0x56')](_0x1de281)[_0xc0b2('0x1a')](handleEntityNotFound(_0x24b13e,null))[_0xc0b2('0x1a')](respondWithResult(_0x24b13e,null))[_0xc0b2('0x52')](handleError(_0x24b13e,null));};exports[_0xc0b2('0x57')]=function(_0x595193,_0x23afc1){return db[_0xc0b2('0x38')][_0xc0b2('0x57')](_0x595193['body'],{})[_0xc0b2('0x1a')](function(_0x411a81){var _0x185b4e=_0x595193[_0xc0b2('0x58')][_0xc0b2('0x59')]({'plain':!![]});if(!_0x185b4e)throw new Error(_0xc0b2('0x5a'));if(_0x185b4e[_0xc0b2('0x5b')]===_0xc0b2('0x58')){var _0x4d8f79=_0x411a81[_0xc0b2('0x59')]({'plain':!![]});var _0x3b11b4=_0xc0b2('0x32');return db[_0xc0b2('0x5c')][_0xc0b2('0x56')]({'where':{'name':_0x3b11b4,'userProfileId':_0x185b4e[_0xc0b2('0x5d')]},'raw':!![]})[_0xc0b2('0x1a')](function(_0x482ae4){if(_0x482ae4&&_0x482ae4[_0xc0b2('0x5e')]===0x0){return db[_0xc0b2('0x33')]['create']({'name':_0x4d8f79[_0xc0b2('0x35')],'resourceId':_0x4d8f79['id'],'type':_0x482ae4[_0xc0b2('0x35')],'sectionId':_0x482ae4['id']},{})[_0xc0b2('0x1a')](function(){return _0x411a81;});}else{return _0x411a81;}})[_0xc0b2('0x52')](function(_0x2640f7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2640f7);throw _0x2640f7;});}return _0x411a81;})[_0xc0b2('0x1a')](respondWithResult(_0x23afc1,0xc9))[_0xc0b2('0x52')](handleError(_0x23afc1,null));};exports[_0xc0b2('0x30')]=function(_0x42898e,_0x15d5d6){if(_0x42898e[_0xc0b2('0x5f')]['id']){delete _0x42898e[_0xc0b2('0x5f')]['id'];}return db['ChatQueue'][_0xc0b2('0x56')]({'where':{'id':_0x42898e[_0xc0b2('0x60')]['id']}})[_0xc0b2('0x1a')](handleEntityNotFound(_0x15d5d6,null))[_0xc0b2('0x1a')](saveUpdates(_0x42898e[_0xc0b2('0x5f')],null))['then'](respondWithResult(_0x15d5d6,null))[_0xc0b2('0x52')](handleError(_0x15d5d6,null));};exports[_0xc0b2('0x31')]=function(_0x56a13a,_0x579ecb){return db[_0xc0b2('0x38')][_0xc0b2('0x56')]({'where':{'id':_0x56a13a[_0xc0b2('0x60')]['id']}})[_0xc0b2('0x1a')](handleEntityNotFound(_0x579ecb,null))[_0xc0b2('0x1a')](removeEntity(_0x579ecb,null))[_0xc0b2('0x52')](handleError(_0x579ecb,null));};exports[_0xc0b2('0x61')]=function(_0x407e6d,_0x48606c){return db[_0xc0b2('0x38')][_0xc0b2('0x61')]()[_0xc0b2('0x1a')](respondWithResult(_0x48606c,null))[_0xc0b2('0x52')](handleError(_0x48606c,null));};exports[_0xc0b2('0x62')]=function(_0xe9746d,_0x2740e2,_0x148e01){var _0x8d5dd={'raw':!![],'where':{}},_0x55c146={},_0x1b3389;return db[_0xc0b2('0x38')][_0xc0b2('0x63')]({'where':{'id':_0xe9746d[_0xc0b2('0x60')]['id']}})[_0xc0b2('0x1a')](handleEntityNotFound(_0x2740e2,null))['then'](function(_0x4ade1d){if(_0x4ade1d){_0x1b3389=_0x4ade1d[_0xc0b2('0x59')]({'plain':!![]});_0x55c146[_0xc0b2('0x3d')]=_[_0xc0b2('0x54')](db[_0xc0b2('0x64')][_0xc0b2('0x39')]);_0x55c146[_0xc0b2('0x3f')]=_[_0xc0b2('0x54')](_0xe9746d[_0xc0b2('0x3f')]);_0x55c146[_0xc0b2('0x4a')]=_['intersection'](_0x55c146[_0xc0b2('0x3d')],_0x55c146[_0xc0b2('0x3f')]);_0x8d5dd['attributes']=_[_0xc0b2('0x40')](_0x55c146[_0xc0b2('0x3d')],qs[_0xc0b2('0x41')](_0xe9746d[_0xc0b2('0x3f')][_0xc0b2('0x41')]));_0x8d5dd[_0xc0b2('0x42')]=_0x8d5dd[_0xc0b2('0x42')]['length']?_0x8d5dd['attributes']:_0x55c146['model'];if(!_0xe9746d[_0xc0b2('0x3f')][_0xc0b2('0x44')](_0xc0b2('0x45'))){_0x8d5dd[_0xc0b2('0x29')]=qs['limit'](_0xe9746d[_0xc0b2('0x3f')][_0xc0b2('0x29')]);_0x8d5dd[_0xc0b2('0x27')]=qs[_0xc0b2('0x27')](_0xe9746d['query'][_0xc0b2('0x27')]);}_0x8d5dd['order']=qs['sort'](_0xe9746d[_0xc0b2('0x3f')]['sort']);_0x8d5dd[_0xc0b2('0x48')]=qs[_0xc0b2('0x4a')](_[_0xc0b2('0x49')](_0xe9746d['query'],_0x55c146[_0xc0b2('0x4a')]));_0x8d5dd[_0xc0b2('0x48')]['ChatQueueId']=_0x4ade1d['id'];if(_0xe9746d[_0xc0b2('0x3f')][_0xc0b2('0x4b')]){_0x8d5dd[_0xc0b2('0x48')]=_[_0xc0b2('0x4d')](_0x8d5dd[_0xc0b2('0x48')],{'$or':_[_0xc0b2('0x3e')](_0x8d5dd[_0xc0b2('0x42')],function(_0x1275f3){var _0x19b462={};_0x19b462[_0x1275f3]={'$like':'%'+_0xe9746d[_0xc0b2('0x3f')][_0xc0b2('0x4b')]+'%'};return _0x19b462;})});}_0x8d5dd=_[_0xc0b2('0x4d')]({},_0x8d5dd,_0xe9746d[_0xc0b2('0x4e')]);return db['UserChatQueue']['findAll'](_0x8d5dd);}})['then'](function(_0x5e9eb9){if(_0x5e9eb9){return db['User'][_0xc0b2('0x65')]({'where':{'id':_[_0xc0b2('0x3e')](_0x5e9eb9,_0xc0b2('0x66')),'role':_0xc0b2('0x67')},'attributes':['id','name',_0xc0b2('0x68'),'updatedAt',_0xc0b2('0x69')]});}})['then'](function(_0x33f28e){if(_0x33f28e){return{'count':_0x33f28e['count'],'rows':_[_0xc0b2('0x3e')](_0x33f28e[_0xc0b2('0x51')],function(_0x50067a){return{'membername':_0x50067a[_0xc0b2('0x35')],'UserId':_0x50067a['id'],'queue_name':_0x1b3389[_0xc0b2('0x35')],'ChatQueueId':_0x1b3389['id'],'interface':util[_0xc0b2('0x6a')](_0xc0b2('0x6b'),_0xc0b2('0x6c'),_0x50067a[_0xc0b2('0x35')]),'penalty':0x0,'paused':_0x50067a[_0xc0b2('0x68')],'createdAt':_0x50067a['createdAt'],'updatedAt':_0x50067a[_0xc0b2('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc0b2('0x1a')](respondWithFilteredResult(_0x2740e2,_0x8d5dd))[_0xc0b2('0x52')](handleError(_0x2740e2,null));};exports[_0xc0b2('0x6e')]=function(_0x143234,_0x292d8d,_0x227588){var _0x344372={};var _0x48128b={};var _0x5a317a;var _0x356aad;return db[_0xc0b2('0x38')][_0xc0b2('0x63')]({'where':{'id':_0x143234[_0xc0b2('0x60')]['id']}})['then'](handleEntityNotFound(_0x292d8d,null))[_0xc0b2('0x1a')](function(_0x17a3e9){if(_0x17a3e9){_0x5a317a=_0x17a3e9;_0x48128b[_0xc0b2('0x3d')]=_['keys'](db[_0xc0b2('0x6f')][_0xc0b2('0x39')]);_0x48128b[_0xc0b2('0x3f')]=_['keys'](_0x143234[_0xc0b2('0x3f')]);_0x48128b[_0xc0b2('0x4a')]=_[_0xc0b2('0x40')](_0x48128b['model'],_0x48128b[_0xc0b2('0x3f')]);_0x344372[_0xc0b2('0x42')]=_[_0xc0b2('0x40')](_0x48128b['model'],qs[_0xc0b2('0x41')](_0x143234[_0xc0b2('0x3f')]['fields']));_0x344372[_0xc0b2('0x42')]=_0x344372[_0xc0b2('0x42')][_0xc0b2('0x43')]?_0x344372[_0xc0b2('0x42')]:_0x48128b[_0xc0b2('0x3d')];_0x344372[_0xc0b2('0x46')]=qs[_0xc0b2('0x47')](_0x143234['query'][_0xc0b2('0x47')]);_0x344372['where']=qs[_0xc0b2('0x4a')](_[_0xc0b2('0x49')](_0x143234[_0xc0b2('0x3f')],_0x48128b[_0xc0b2('0x4a')]));if(_0x143234[_0xc0b2('0x3f')]['filter']){_0x344372[_0xc0b2('0x48')]=_['merge'](_0x344372[_0xc0b2('0x48')],{'$or':_[_0xc0b2('0x3e')](_0x344372[_0xc0b2('0x42')],function(_0x5a7dab){var _0x56105d={};_0x56105d[_0x5a7dab]={'$like':'%'+_0x143234[_0xc0b2('0x3f')][_0xc0b2('0x4b')]+'%'};return _0x56105d;})});}_0x344372=_[_0xc0b2('0x4d')]({},_0x344372,_0x143234['options']);return _0x5a317a[_0xc0b2('0x6e')](_0x344372);}})[_0xc0b2('0x1a')](function(_0x9df4c6){if(_0x9df4c6){_0x356aad=_0x9df4c6[_0xc0b2('0x43')];if(!_0x143234[_0xc0b2('0x3f')]['hasOwnProperty'](_0xc0b2('0x45'))){_0x344372[_0xc0b2('0x29')]=qs[_0xc0b2('0x29')](_0x143234[_0xc0b2('0x3f')][_0xc0b2('0x29')]);_0x344372['offset']=qs[_0xc0b2('0x27')](_0x143234[_0xc0b2('0x3f')][_0xc0b2('0x27')]);}return _0x5a317a['getTeams'](_0x344372);}})[_0xc0b2('0x1a')](function(_0x575b6b){if(_0x575b6b){return _0x575b6b?{'count':_0x356aad,'rows':_0x575b6b}:null;}})[_0xc0b2('0x1a')](respondWithResult(_0x292d8d,null))[_0xc0b2('0x52')](handleError(_0x292d8d,null));};exports['addTeams']=function(_0xed5609,_0x23326a,_0x3f76d1){var _0x1456f3=_0xed5609[_0xc0b2('0x5f')][_0xc0b2('0x70')];return db[_0xc0b2('0x6f')]['findAll']({'where':{'id':_0x1456f3},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc0b2('0x71'),'attributes':['id',_0xc0b2('0x35'),_0xc0b2('0x72'),_0xc0b2('0x73'),'interface'],'raw':!![]}]})['then'](function(_0x42ad8d){if(_0x42ad8d){var _0xa4c72=_[_0xc0b2('0x74')](_0x42ad8d,function(_0x3e859e){var _0x142dc7=_0x3e859e['get']({'plain':!![]});return _0x142dc7[_0xc0b2('0x71')];});return db['ChatQueue'][_0xc0b2('0x56')]({'where':{'id':_0xed5609['params']['id']}})['then'](function(_0x2dd7eb){return db[_0xc0b2('0x75')][_0xc0b2('0x76')](function(_0x1c714f){return _0x2dd7eb[_0xc0b2('0x77')](_0x1456f3,{'transaction':_0x1c714f})[_0xc0b2('0x1a')](function(){return BPromise['each'](_0xa4c72,function(_0x569659){return db[_0xc0b2('0x64')][_0xc0b2('0x78')]({'where':{'UserId':_0x569659['id'],'ChatQueueId':_0xed5609['params']['id']},'transaction':_0x1c714f});});})[_0xc0b2('0x1a')](function(){_0xa4c72[_0xc0b2('0x79')](function(_0x361649){socket['emit']('userChatQueue:save',{'UserId':_0x361649['id'],'ChatQueueId':_0x2dd7eb['id']});});});});});}})[_0xc0b2('0x1a')](respondWithStatusCode(_0x23326a,null))[_0xc0b2('0x52')](handleError(_0x23326a,null));};exports['removeTeams']=function(_0x5b591e,_0x48c29a,_0x469baa){return db['Team'][_0xc0b2('0x50')]({'where':{'id':_0x5b591e[_0xc0b2('0x3f')][_0xc0b2('0x70')]},'attributes':['id'],'include':[{'model':db[_0xc0b2('0x7a')],'as':_0xc0b2('0x71'),'attributes':['id'],'raw':!![]}]})[_0xc0b2('0x1a')](handleEntityNotFound(_0x48c29a,null))[_0xc0b2('0x1a')](function(_0x3bf528){var _0x47b075=_[_0xc0b2('0x3e')](_0x3bf528,'id');var _0x3f5b8d=[];var _0x16bde4=[];var _0x2550d0=squel[_0xc0b2('0x7b')]();_0x2550d0[_0xc0b2('0x7c')](_0xc0b2('0x7d'))['from'](_0xc0b2('0x7e'),'tq')[_0xc0b2('0x7f')](_0xc0b2('0x80'),'ut',_0xc0b2('0x81'))[_0xc0b2('0x48')](_0xc0b2('0x82'),_0x5b591e[_0xc0b2('0x60')]['id']);for(var _0x5c7732=0x0;_0x5c7732<_0x3bf528['length'];_0x5c7732+=0x1){let _0x24e327=_0x3bf528[_0x5c7732];for(var _0x3a4fd4=0x0;_0x3a4fd4<_0x24e327[_0xc0b2('0x71')]['length'];_0x3a4fd4+=0x1){let _0x46b4af=_0x24e327[_0xc0b2('0x71')][_0x3a4fd4];var _0x1fb282=_0x2550d0[_0xc0b2('0x83')]();_0x1fb282[_0xc0b2('0x48')](_0xc0b2('0x84'),_0x46b4af['id']);_0x16bde4[_0xc0b2('0x85')](db['sequelize'][_0xc0b2('0x3f')](_0x1fb282[_0xc0b2('0x86')](),{'type':db[_0xc0b2('0x75')]['QueryTypes'][_0xc0b2('0x87')]})[_0xc0b2('0x1a')](function(_0x27b576){if(_0x27b576[_0xc0b2('0x43')]===0x1){return _0x46b4af['id'];}else{var _0x20edd4=_[_0xc0b2('0x88')](_[_0xc0b2('0x3e')](_0x27b576,_0xc0b2('0x89')),function(_0x186459){return _[_0xc0b2('0x8a')](_0x47b075,_0x186459);});if(_0x20edd4){return _0x46b4af['id'];}}}));}}return BPromise[_0xc0b2('0x8b')](_0x16bde4)[_0xc0b2('0x1a')](function(_0x15e7fa){_0x3f5b8d=_(_0x3f5b8d)['union'](_0x15e7fa)[_0xc0b2('0x8c')]()[_0xc0b2('0x8d')]();return db[_0xc0b2('0x38')]['find']({'where':{'id':_0x5b591e[_0xc0b2('0x60')]['id']}})[_0xc0b2('0x1a')](function(_0x29e619){return db[_0xc0b2('0x75')]['transaction'](function(_0x162bf3){return _0x29e619['removeTeams'](_0x5b591e[_0xc0b2('0x3f')][_0xc0b2('0x70')],{'transaction':_0x162bf3})[_0xc0b2('0x1a')](function(){if(!_[_0xc0b2('0x8e')](_0x3f5b8d)){return _0x29e619[_0xc0b2('0x8f')](_0x3f5b8d,{'transaction':_0x162bf3});}})[_0xc0b2('0x1a')](function(){_0x3f5b8d[_0xc0b2('0x79')](function(_0x185c83){socket[_0xc0b2('0x90')](_0xc0b2('0x91'),{'UserId':_0x185c83,'ChatQueueId':_0x29e619['id']});});});});});});})['then'](respondWithStatusCode(_0x48c29a,null))[_0xc0b2('0x52')](handleError(_0x48c29a,null));};exports[_0xc0b2('0x92')]=function(_0x13b1b5,_0x1aee3d,_0xabd0bb){return db[_0xc0b2('0x38')][_0xc0b2('0x56')]({'where':{'id':_0x13b1b5['params']['id']}})[_0xc0b2('0x1a')](handleEntityNotFound(_0x1aee3d,null))[_0xc0b2('0x1a')](function(_0x45fb80){if(_0x45fb80){return _0x45fb80[_0xc0b2('0x92')](_0x13b1b5[_0xc0b2('0x5f')]['ids'],_[_0xc0b2('0x93')](_0x13b1b5[_0xc0b2('0x5f')],[_0xc0b2('0x70'),'id'])||{})[_0xc0b2('0x94')](function(_0x11557e){for(var _0x187b6d=0x0;_0x187b6d<_0x13b1b5[_0xc0b2('0x5f')]['ids'][_0xc0b2('0x43')];_0x187b6d+=0x1){socket[_0xc0b2('0x90')](_0xc0b2('0x95'),{'UserId':Number(_0x13b1b5[_0xc0b2('0x5f')][_0xc0b2('0x70')][_0x187b6d]),'ChatQueueId':Number(_0x13b1b5[_0xc0b2('0x60')]['id'])});}return _0x11557e;});}})[_0xc0b2('0x1a')](respondWithResult(_0x1aee3d,null))[_0xc0b2('0x52')](handleError(_0x1aee3d,null));};exports[_0xc0b2('0x8f')]=function(_0x13ccad,_0x59af2a,_0x6e1122){return db[_0xc0b2('0x38')][_0xc0b2('0x56')]({'where':{'id':_0x13ccad['params']['id']}})['then'](handleEntityNotFound(_0x59af2a,null))[_0xc0b2('0x1a')](function(_0x4cceca){if(_0x4cceca){return _0x4cceca[_0xc0b2('0x8f')](_0x13ccad[_0xc0b2('0x3f')][_0xc0b2('0x70')])[_0xc0b2('0x1a')](function(){if(_['isArray'](_0x13ccad[_0xc0b2('0x3f')][_0xc0b2('0x70')])){for(var _0x5b71ed=0x0;_0x5b71ed<_0x13ccad['query'][_0xc0b2('0x70')][_0xc0b2('0x43')];_0x5b71ed+=0x1){socket[_0xc0b2('0x90')](_0xc0b2('0x91'),{'UserId':Number(_0x13ccad[_0xc0b2('0x3f')][_0xc0b2('0x70')][_0x5b71ed]),'ChatQueueId':Number(_0x13ccad[_0xc0b2('0x60')]['id'])});}}else{socket[_0xc0b2('0x90')](_0xc0b2('0x91'),{'UserId':Number(_0x13ccad['query'][_0xc0b2('0x70')]),'ChatQueueId':Number(_0x13ccad[_0xc0b2('0x60')]['id'])});}});}})[_0xc0b2('0x1a')](respondWithStatusCode(_0x59af2a,null))[_0xc0b2('0x52')](handleError(_0x59af2a,null));};exports[_0xc0b2('0x96')]=function(_0x3a3d4f,_0x2231d4,_0x5677f7){var _0x55f6d0={};var _0x5810e8={};var _0x549579;var _0x1f1dcf;return db['ChatQueue'][_0xc0b2('0x63')]({'where':{'id':_0x3a3d4f[_0xc0b2('0x60')]['id']}})['then'](handleEntityNotFound(_0x2231d4,null))[_0xc0b2('0x1a')](function(_0x241e9a){if(_0x241e9a){_0x549579=_0x241e9a;_0x5810e8['model']=_[_0xc0b2('0x54')](db[_0xc0b2('0x7a')][_0xc0b2('0x39')]);_0x5810e8['query']=_['keys'](_0x3a3d4f[_0xc0b2('0x3f')]);_0x5810e8[_0xc0b2('0x4a')]=_['intersection'](_0x5810e8[_0xc0b2('0x3d')],_0x5810e8[_0xc0b2('0x3f')]);_0x55f6d0[_0xc0b2('0x42')]=_[_0xc0b2('0x40')](_0x5810e8[_0xc0b2('0x3d')],qs[_0xc0b2('0x41')](_0x3a3d4f['query'][_0xc0b2('0x41')]));_0x55f6d0[_0xc0b2('0x42')]=_0x55f6d0['attributes'][_0xc0b2('0x43')]?_0x55f6d0[_0xc0b2('0x42')]:_0x5810e8[_0xc0b2('0x3d')];_0x55f6d0[_0xc0b2('0x46')]=qs[_0xc0b2('0x47')](_0x3a3d4f[_0xc0b2('0x3f')]['sort']);_0x55f6d0[_0xc0b2('0x48')]=qs[_0xc0b2('0x4a')](_[_0xc0b2('0x49')](_0x3a3d4f[_0xc0b2('0x3f')],_0x5810e8[_0xc0b2('0x4a')]));if(_0x3a3d4f[_0xc0b2('0x3f')][_0xc0b2('0x4b')]){_0x55f6d0[_0xc0b2('0x48')]=_['merge'](_0x55f6d0['where'],{'$or':_['map'](_0x55f6d0['attributes'],function(_0x178f44){var _0x56fc6f={};_0x56fc6f[_0x178f44]={'$like':'%'+_0x3a3d4f[_0xc0b2('0x3f')][_0xc0b2('0x4b')]+'%'};return _0x56fc6f;})});}_0x55f6d0=_['merge']({},_0x55f6d0,_0x3a3d4f[_0xc0b2('0x4e')]);return _0x549579[_0xc0b2('0x96')](_0x55f6d0);}})[_0xc0b2('0x1a')](function(_0x5c4a7d){if(_0x5c4a7d){_0x1f1dcf=_0x5c4a7d[_0xc0b2('0x43')];if(!_0x3a3d4f[_0xc0b2('0x3f')][_0xc0b2('0x44')]('nolimit')){_0x55f6d0[_0xc0b2('0x29')]=qs[_0xc0b2('0x29')](_0x3a3d4f['query'][_0xc0b2('0x29')]);_0x55f6d0[_0xc0b2('0x27')]=qs[_0xc0b2('0x27')](_0x3a3d4f[_0xc0b2('0x3f')]['offset']);}return _0x549579[_0xc0b2('0x96')](_0x55f6d0);}})[_0xc0b2('0x1a')](function(_0x4e98bc){if(_0x4e98bc){return _0x4e98bc?{'count':_0x1f1dcf,'rows':_0x4e98bc}:null;}})[_0xc0b2('0x1a')](respondWithResult(_0x2231d4,null))[_0xc0b2('0x52')](handleError(_0x2231d4,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 422df98..cbb0366 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 _0x7707=['events','../../mysqldb','ChatQueue','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x29a171,_0x155cd2){var _0xd5c076=function(_0x195e11){while(--_0x195e11){_0x29a171['push'](_0x29a171['shift']());}};_0xd5c076(++_0x155cd2);}(_0x7707,0x158));var _0x7770=function(_0x232caf,_0x358822){_0x232caf=_0x232caf-0x0;var _0x4a5781=_0x7707[_0x232caf];return _0x4a5781;};'use strict';var EventEmitter=require(_0x7770('0x0'));var ChatQueue=require(_0x7770('0x1'))['db'][_0x7770('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7770('0x3')](0x0);var events={'afterCreate':_0x7770('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2dfe26){return function(_0x4f1e9e,_0x5c2a01,_0x50d79e){ChatQueueEvents[_0x7770('0x5')](_0x2dfe26+':'+_0x4f1e9e['id'],_0x4f1e9e);ChatQueueEvents[_0x7770('0x5')](_0x2dfe26,_0x4f1e9e);_0x50d79e(null);};}for(var e in events){if(events[_0x7770('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x7770('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xa62c=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x446b25,_0x7ae0c2){var _0x5a6260=function(_0x1e4985){while(--_0x1e4985){_0x446b25['push'](_0x446b25['shift']());}};_0x5a6260(++_0x7ae0c2);}(_0xa62c,0x70));var _0xca62=function(_0x2dbcef,_0x1cfecb){_0x2dbcef=_0x2dbcef-0x0;var _0x5a90ea=_0xa62c[_0x2dbcef];return _0x5a90ea;};'use strict';var EventEmitter=require(_0xca62('0x0'));var ChatQueue=require(_0xca62('0x1'))['db'][_0xca62('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xca62('0x3')](0x0);var events={'afterCreate':_0xca62('0x4'),'afterUpdate':_0xca62('0x5'),'afterDestroy':_0xca62('0x6')};function emitEvent(_0x50fa2e){return function(_0x35180a,_0x3da6b7,_0x2845a1){ChatQueueEvents[_0xca62('0x7')](_0x50fa2e+':'+_0x35180a['id'],_0x35180a);ChatQueueEvents[_0xca62('0x7')](_0x50fa2e,_0x35180a);_0x2845a1(null);};}for(var e in events){if(events[_0xca62('0x8')](e)){var event=events[e];ChatQueue[_0xca62('0x9')](e,emitEvent(event));}}module[_0xca62('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 49db4a7..bd93df4 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 _0x4d62=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x217850,_0x251846){var _0x3026c6=function(_0x5e6a36){while(--_0x5e6a36){_0x217850['push'](_0x217850['shift']());}};_0x3026c6(++_0x251846);}(_0x4d62,0x16e));var _0x24d6=function(_0x120a5b,_0x26a525){_0x120a5b=_0x120a5b-0x0;var _0x4f5ac9=_0x4d62[_0x120a5b];return _0x4f5ac9;};'use strict';var _=require(_0x24d6('0x0'));var util=require(_0x24d6('0x1'));var logger=require(_0x24d6('0x2'))(_0x24d6('0x3'));var moment=require(_0x24d6('0x4'));var BPromise=require(_0x24d6('0x5'));var rp=require(_0x24d6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24d6('0x7'));var config=require(_0x24d6('0x8'));var attributes=require(_0x24d6('0x9'));module[_0x24d6('0xa')]=function(_0xe7ec69,_0x5f0daf){return _0xe7ec69[_0x24d6('0xb')](_0x24d6('0xc'),attributes,{'tableName':_0x24d6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a74=['../../config/environment','ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c6603,_0x557f47){var _0x5aff1c=function(_0x26c5fe){while(--_0x26c5fe){_0x4c6603['push'](_0x4c6603['shift']());}};_0x5aff1c(++_0x557f47);}(_0x8a74,0xd4));var _0x48a7=function(_0x27b68b,_0x148818){_0x27b68b=_0x27b68b-0x0;var _0x3994cc=_0x8a74[_0x27b68b];return _0x3994cc;};'use strict';var _=require(_0x48a7('0x0'));var util=require(_0x48a7('0x1'));var logger=require('../../config/logger')(_0x48a7('0x2'));var moment=require(_0x48a7('0x3'));var BPromise=require(_0x48a7('0x4'));var rp=require(_0x48a7('0x5'));var fs=require('fs');var path=require(_0x48a7('0x6'));var rimraf=require(_0x48a7('0x7'));var config=require(_0x48a7('0x8'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x55f0a7,_0x1899d0){return _0x55f0a7['define'](_0x48a7('0x9'),attributes,{'tableName':_0x48a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index c7e0670..6f73874 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 _0x7334=['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','result','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ChatQueue','find','ShowChatQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4069c6,_0x4ee231){var _0xc37519=function(_0x1d3bc2){while(--_0x1d3bc2){_0x4069c6['push'](_0x4069c6['shift']());}};_0xc37519(++_0x4ee231);}(_0x7334,0x184));var _0x4733=function(_0x5135ad,_0x35e57c){_0x5135ad=_0x5135ad-0x0;var _0x17261e=_0x7334[_0x5135ad];return _0x17261e;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});config[_0x4733('0xb')]=_[_0x4733('0xc')](config[_0x4733('0xb')],{'host':_0x4733('0xd'),'port':0x18eb});var socket=require(_0x4733('0xe'))(new Redis(config[_0x4733('0xb')]));require(_0x4733('0xf'))[_0x4733('0x10')](socket);function respondWithRpcPromise(_0x1bc511,_0x2bafad,_0x49032d){return new BPromise(function(_0x42b97f,_0x1e6fcf){return client['request'](_0x1bc511,_0x49032d)[_0x4733('0x11')](function(_0x5240a4){logger[_0x4733('0x12')](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));logger[_0x4733('0x15')](_0x4733('0x16'),_0x2bafad,_0x4733('0x14'),JSON[_0x4733('0x17')](_0x5240a4));if(_0x5240a4['error']){if(_0x5240a4[_0x4733('0x18')]['code']===0x1f4){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);return _0x1e6fcf(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')]['message']);return _0x42b97f(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}else{logger['info'](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));_0x42b97f(_0x5240a4[_0x4733('0x1a')][_0x4733('0x19')]);}})['catch'](function(_0x517fbc){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x517fbc);_0x1e6fcf(_0x517fbc);});});}exports['GetChatQueue']=function(_0x32f166){var _0x1943bc=this;return new Promise(function(_0x15339c,_0x7a4e0){return db['ChatQueue'][_0x4733('0x1b')]({'raw':_0x32f166[_0x4733('0x1c')]?_0x32f166['options'][_0x4733('0x1d')]===undefined?!![]:![]:!![],'where':_0x32f166[_0x4733('0x1c')]?_0x32f166['options'][_0x4733('0x1e')]||null:null,'attributes':_0x32f166[_0x4733('0x1c')]?_0x32f166[_0x4733('0x1c')][_0x4733('0x1f')]||null:null,'limit':_0x32f166[_0x4733('0x1c')]?_0x32f166[_0x4733('0x1c')][_0x4733('0x20')]||null:null,'include':_0x32f166[_0x4733('0x1c')]?_0x32f166['options'][_0x4733('0x21')]?_[_0x4733('0x22')](_0x32f166[_0x4733('0x1c')][_0x4733('0x21')],function(_0x30ee9b){return{'model':db[_0x30ee9b[_0x4733('0x23')]],'as':_0x30ee9b['as'],'attributes':_0x30ee9b[_0x4733('0x1f')],'include':_0x30ee9b[_0x4733('0x21')]?_[_0x4733('0x22')](_0x30ee9b[_0x4733('0x21')],function(_0x521855){return{'model':db[_0x521855[_0x4733('0x23')]],'as':_0x521855['as'],'attributes':_0x521855['attributes'],'include':_0x521855['include']?_[_0x4733('0x22')](_0x521855['include'],function(_0xcde4f4){return{'model':db[_0xcde4f4['model']],'as':_0xcde4f4['as'],'attributes':_0xcde4f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2976b0){logger[_0x4733('0x12')](_0x4733('0x24'),_0x32f166);logger[_0x4733('0x15')]('GetChatQueue',_0x32f166,JSON['stringify'](_0x2976b0));_0x15339c(_0x2976b0);})['catch'](function(_0x2b2757){logger['error']('GetChatQueue',_0x2b2757[_0x4733('0x19')],_0x32f166);_0x7a4e0(_0x1943bc[_0x4733('0x18')](0x1f4,_0x2b2757[_0x4733('0x19')]));});});};exports['ShowChatQueue']=function(_0x523c61){var _0x4412f7=this;return new Promise(function(_0x3a4307,_0x22d38a){return db[_0x4733('0x25')][_0x4733('0x26')]({'raw':_0x523c61['options']?_0x523c61[_0x4733('0x1c')][_0x4733('0x1d')]===undefined?!![]:![]:!![],'where':_0x523c61[_0x4733('0x1c')]?_0x523c61[_0x4733('0x1c')][_0x4733('0x1e')]||null:null,'attributes':_0x523c61['options']?_0x523c61['options'][_0x4733('0x1f')]||null:null,'include':_0x523c61[_0x4733('0x1c')]?_0x523c61[_0x4733('0x1c')][_0x4733('0x21')]?_[_0x4733('0x22')](_0x523c61['options'][_0x4733('0x21')],function(_0x4855a8){return{'model':db[_0x4855a8[_0x4733('0x23')]],'as':_0x4855a8['as'],'attributes':_0x4855a8['attributes'],'include':_0x4855a8[_0x4733('0x21')]?_[_0x4733('0x22')](_0x4855a8[_0x4733('0x21')],function(_0x2ec052){return{'model':db[_0x2ec052[_0x4733('0x23')]],'as':_0x2ec052['as'],'attributes':_0x2ec052[_0x4733('0x1f')],'include':_0x2ec052[_0x4733('0x21')]?_[_0x4733('0x22')](_0x2ec052['include'],function(_0x174889){return{'model':db[_0x174889['model']],'as':_0x174889['as'],'attributes':_0x174889[_0x4733('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4733('0x11')](function(_0x381fa8){logger[_0x4733('0x12')](_0x4733('0x27'),_0x523c61);logger[_0x4733('0x15')](_0x4733('0x27'),_0x523c61,JSON[_0x4733('0x17')](_0x381fa8));_0x3a4307(_0x381fa8);})['catch'](function(_0x35a10b){logger[_0x4733('0x18')]('ShowChatQueue',_0x35a10b[_0x4733('0x19')],_0x523c61);_0x22d38a(_0x4412f7[_0x4733('0x18')](0x1f4,_0x35a10b['message']));});});}; \ No newline at end of file +var _0xcf3d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','options','where','attributes','include','map','model','debug','find','raw','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x449986,_0x40c2c7){var _0x36cc9a=function(_0x1bbe33){while(--_0x1bbe33){_0x449986['push'](_0x449986['shift']());}};_0x36cc9a(++_0x40c2c7);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x13cfab,_0x1009a8){_0x13cfab=_0x13cfab-0x0;var _0x26deae=_0xcf3d[_0x13cfab];return _0x26deae;};'use strict';var _=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var moment=require(_0xdcf3('0x2'));var BPromise=require(_0xdcf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdcf3('0x5'));var logger=require(_0xdcf3('0x6'))(_0xdcf3('0x7'));var config=require(_0xdcf3('0x8'));var jayson=require(_0xdcf3('0x9'));var client=jayson[_0xdcf3('0xa')]['http']({'port':0x232a});config[_0xdcf3('0xb')]=_['defaults'](config[_0xdcf3('0xb')],{'host':_0xdcf3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0xdcf3('0xd')](socket);function respondWithRpcPromise(_0x45b935,_0x129aee,_0xcbed7f){return new BPromise(function(_0x1b650b,_0x6f7c77){return client[_0xdcf3('0xe')](_0x45b935,_0xcbed7f)[_0xdcf3('0xf')](function(_0x3ce000){logger['info'](_0xdcf3('0x10'),_0x129aee,_0xdcf3('0x11'));logger['debug'](_0xdcf3('0x12'),_0x129aee,_0xdcf3('0x11'),JSON[_0xdcf3('0x13')](_0x3ce000));if(_0x3ce000[_0xdcf3('0x14')]){if(_0x3ce000['error'][_0xdcf3('0x15')]===0x1f4){logger[_0xdcf3('0x14')]('ChatQueue,\x20%s,\x20%s',_0x129aee,_0x3ce000[_0xdcf3('0x14')]['message']);return _0x6f7c77(_0x3ce000[_0xdcf3('0x14')][_0xdcf3('0x16')]);}logger[_0xdcf3('0x14')](_0xdcf3('0x10'),_0x129aee,_0x3ce000['error'][_0xdcf3('0x16')]);return _0x1b650b(_0x3ce000[_0xdcf3('0x14')]['message']);}else{logger[_0xdcf3('0x17')](_0xdcf3('0x10'),_0x129aee,_0xdcf3('0x11'));_0x1b650b(_0x3ce000[_0xdcf3('0x18')][_0xdcf3('0x16')]);}})[_0xdcf3('0x19')](function(_0x28844a){logger[_0xdcf3('0x14')](_0xdcf3('0x10'),_0x129aee,_0x28844a);_0x6f7c77(_0x28844a);});});}exports[_0xdcf3('0x1a')]=function(_0x5362b4){var _0x4bec24=this;return new Promise(function(_0x5609d7,_0x3a4512){return db[_0xdcf3('0x1b')]['findAll']({'raw':_0x5362b4['options']?_0x5362b4[_0xdcf3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5362b4['options']?_0x5362b4[_0xdcf3('0x1c')][_0xdcf3('0x1d')]||null:null,'attributes':_0x5362b4[_0xdcf3('0x1c')]?_0x5362b4['options'][_0xdcf3('0x1e')]||null:null,'limit':_0x5362b4['options']?_0x5362b4[_0xdcf3('0x1c')]['limit']||null:null,'include':_0x5362b4[_0xdcf3('0x1c')]?_0x5362b4[_0xdcf3('0x1c')][_0xdcf3('0x1f')]?_[_0xdcf3('0x20')](_0x5362b4['options'][_0xdcf3('0x1f')],function(_0x5c8557){return{'model':db[_0x5c8557[_0xdcf3('0x21')]],'as':_0x5c8557['as'],'attributes':_0x5c8557[_0xdcf3('0x1e')],'include':_0x5c8557[_0xdcf3('0x1f')]?_[_0xdcf3('0x20')](_0x5c8557['include'],function(_0x115d7f){return{'model':db[_0x115d7f['model']],'as':_0x115d7f['as'],'attributes':_0x115d7f['attributes'],'include':_0x115d7f['include']?_['map'](_0x115d7f[_0xdcf3('0x1f')],function(_0x4cd417){return{'model':db[_0x4cd417[_0xdcf3('0x21')]],'as':_0x4cd417['as'],'attributes':_0x4cd417['attributes']};}):[]};}):[]};}):[]:[]})[_0xdcf3('0xf')](function(_0x4cc17a){logger[_0xdcf3('0x17')](_0xdcf3('0x1a'),_0x5362b4);logger[_0xdcf3('0x22')](_0xdcf3('0x1a'),_0x5362b4,JSON[_0xdcf3('0x13')](_0x4cc17a));_0x5609d7(_0x4cc17a);})[_0xdcf3('0x19')](function(_0x30f912){logger[_0xdcf3('0x14')](_0xdcf3('0x1a'),_0x30f912[_0xdcf3('0x16')],_0x5362b4);_0x3a4512(_0x4bec24[_0xdcf3('0x14')](0x1f4,_0x30f912[_0xdcf3('0x16')]));});});};exports['ShowChatQueue']=function(_0x387211){var _0x42d0f9=this;return new Promise(function(_0x178bef,_0x3b8301){return db[_0xdcf3('0x1b')][_0xdcf3('0x23')]({'raw':_0x387211[_0xdcf3('0x1c')]?_0x387211[_0xdcf3('0x1c')][_0xdcf3('0x24')]===undefined?!![]:![]:!![],'where':_0x387211['options']?_0x387211[_0xdcf3('0x1c')]['where']||null:null,'attributes':_0x387211[_0xdcf3('0x1c')]?_0x387211[_0xdcf3('0x1c')][_0xdcf3('0x1e')]||null:null,'include':_0x387211[_0xdcf3('0x1c')]?_0x387211[_0xdcf3('0x1c')][_0xdcf3('0x1f')]?_['map'](_0x387211[_0xdcf3('0x1c')][_0xdcf3('0x1f')],function(_0x50c4f9){return{'model':db[_0x50c4f9[_0xdcf3('0x21')]],'as':_0x50c4f9['as'],'attributes':_0x50c4f9[_0xdcf3('0x1e')],'include':_0x50c4f9['include']?_[_0xdcf3('0x20')](_0x50c4f9[_0xdcf3('0x1f')],function(_0x11c974){return{'model':db[_0x11c974[_0xdcf3('0x21')]],'as':_0x11c974['as'],'attributes':_0x11c974['attributes'],'include':_0x11c974[_0xdcf3('0x1f')]?_[_0xdcf3('0x20')](_0x11c974['include'],function(_0x5228aa){return{'model':db[_0x5228aa['model']],'as':_0x5228aa['as'],'attributes':_0x5228aa[_0xdcf3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdcf3('0xf')](function(_0x25903e){logger[_0xdcf3('0x17')](_0xdcf3('0x25'),_0x387211);logger[_0xdcf3('0x22')](_0xdcf3('0x25'),_0x387211,JSON[_0xdcf3('0x13')](_0x25903e));_0x178bef(_0x25903e);})[_0xdcf3('0x19')](function(_0x54ffdc){logger['error'](_0xdcf3('0x25'),_0x54ffdc['message'],_0x387211);_0x3b8301(_0x42d0f9[_0xdcf3('0x14')](0x1f4,_0x54ffdc[_0xdcf3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index dc5864d..05a0589 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 _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x20e485,_0x8b0481){var _0xebd551=function(_0x3225c4){while(--_0x3225c4){_0x20e485['push'](_0x20e485['shift']());}};_0xebd551(++_0x8b0481);}(_0xec56,0x1bd));var _0x6ec5=function(_0x2851b0,_0x26ad57){_0x2851b0=_0x2851b0-0x0;var _0x2123a2=_0xec56[_0x2851b0];return _0x2123a2;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file +var _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2246ed,_0x477cbc){var _0x3a7ebb=function(_0xce709c){while(--_0xce709c){_0x2246ed['push'](_0x2246ed['shift']());}};_0x3a7ebb(++_0x477cbc);}(_0x6334,0x119));var _0x4633=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x6334[_0x2fee96];return _0x2e6ad1;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 344d953..e2934ad 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x5fc3[_0x5c5c52];return _0x4229ff;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3e74,0x175));var _0x43e7=function(_0x46dbad,_0x409794){_0x46dbad=_0x46dbad-0x0;var _0x29cd82=_0x3e74[_0x46dbad];return _0x29cd82;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 640e3a9..2108e82 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 _0x07b6=['DATE','moment','exports','STRING'];(function(_0x4e9a22,_0x65e645){var _0x364420=function(_0x4ecb09){while(--_0x4ecb09){_0x4e9a22['push'](_0x4e9a22['shift']());}};_0x364420(++_0x65e645);}(_0x07b6,0xb5));var _0x607b=function(_0x5cd395,_0x507285){_0x5cd395=_0x5cd395-0x0;var _0x141227=_0x07b6[_0x5cd395];return _0x141227;};'use strict';var moment=require(_0x607b('0x0'));var Sequelize=require('sequelize');module[_0x607b('0x1')]={'uniqueid':{'type':Sequelize[_0x607b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x607b('0x2')]},'joinAt':{'type':Sequelize[_0x607b('0x3')]},'leaveAt':{'type':Sequelize[_0x607b('0x3')]},'acceptAt':{'type':Sequelize[_0x607b('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x607b('0x2')]}}; \ No newline at end of file +var _0xa87e=['sequelize','exports','STRING','DATE','moment'];(function(_0x56ac3d,_0x1694f4){var _0x56ce44=function(_0x1d833d){while(--_0x1d833d){_0x56ac3d['push'](_0x56ac3d['shift']());}};_0x56ce44(++_0x1694f4);}(_0xa87e,0x185));var _0xea87=function(_0x33a431,_0x57d25b){_0x33a431=_0x33a431-0x0;var _0x325d6e=_0xa87e[_0x33a431];return _0x325d6e;};'use strict';var moment=require(_0xea87('0x0'));var Sequelize=require(_0xea87('0x1'));module[_0xea87('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xea87('0x3')]},'joinAt':{'type':Sequelize[_0xea87('0x4')]},'leaveAt':{'type':Sequelize[_0xea87('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xea87('0x4')]},'reason':{'type':Sequelize[_0xea87('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1265ad3..f4ac730 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 _0xc1dc=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x1b5178,_0x370995){var _0xf77410=function(_0x36c72e){while(--_0x36c72e){_0x1b5178['push'](_0x1b5178['shift']());}};_0xf77410(++_0x370995);}(_0xc1dc,0x84));var _0xcc1d=function(_0x1cbad7,_0x4e989e){_0x1cbad7=_0x1cbad7-0x0;var _0x3d83fb=_0xc1dc[_0x1cbad7];return _0x3d83fb;};'use strict';var emlformat=require(_0xcc1d('0x0'));var rimraf=require(_0xcc1d('0x1'));var zipdir=require(_0xcc1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc1d('0x3'));var moment=require('moment');var BPromise=require(_0xcc1d('0x4'));var Mustache=require(_0xcc1d('0x5'));var util=require('util');var path=require(_0xcc1d('0x6'));var sox=require(_0xcc1d('0x7'));var csv=require(_0xcc1d('0x8'));var ejs=require(_0xcc1d('0x9'));var fs=require('fs');var fs_extra=require(_0xcc1d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc1d('0xb'));var jsforce=require(_0xcc1d('0xc'));var deskjs=require(_0xcc1d('0xd'));var toCsv=require(_0xcc1d('0x8'));var querystring=require(_0xcc1d('0xe'));var Papa=require(_0xcc1d('0xf'));var Redis=require('ioredis');var authService=require(_0xcc1d('0x10'));var qs=require(_0xcc1d('0x11'));var as=require(_0xcc1d('0x12'));var hardwareService=require(_0xcc1d('0x13'));var logger=require(_0xcc1d('0x14'))(_0xcc1d('0x15'));var utils=require('../../config/utils');var config=require(_0xcc1d('0x16'));var licenseUtil=require(_0xcc1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11a34f,_0x3e2534){_0x3e2534=_0x3e2534||0xcc;return function(_0x1440f6){if(_0x1440f6){return _0x11a34f[_0xcc1d('0x18')](_0x3e2534);}return _0x11a34f[_0xcc1d('0x19')](_0x3e2534)[_0xcc1d('0x1a')]();};}function respondWithResult(_0x18b64a,_0x5345ab){_0x5345ab=_0x5345ab||0xc8;return function(_0x5e66ce){if(_0x5e66ce){return _0x18b64a[_0xcc1d('0x19')](_0x5345ab)['json'](_0x5e66ce);}};}function respondWithFilteredResult(_0x35e177,_0x452772){return function(_0x35f147){if(_0x35f147){var _0xc71166=typeof _0x452772[_0xcc1d('0x1b')]===_0xcc1d('0x1c')&&typeof _0x452772[_0xcc1d('0x1d')]===_0xcc1d('0x1c');var _0x2147ca=_0x35f147[_0xcc1d('0x1e')];var _0x483963=_0xc71166?0x0:_0x452772['offset'];var _0x2ee388=_0xc71166?_0x35f147['count']:_0x452772[_0xcc1d('0x1b')]+_0x452772[_0xcc1d('0x1d')];var _0xf44327;if(_0x2ee388>=_0x2147ca){_0x2ee388=_0x2147ca;_0xf44327=0xc8;}else{_0xf44327=0xce;}_0x35e177[_0xcc1d('0x19')](_0xf44327);return _0x35e177[_0xcc1d('0x1f')](_0xcc1d('0x20'),_0x483963+'-'+_0x2ee388+'/'+_0x2147ca)[_0xcc1d('0x21')](_0x35f147);}return null;};}function patchUpdates(_0x1b88f4){return function(_0x438288){try{jsonpatch['apply'](_0x438288,_0x1b88f4,!![]);}catch(_0x23189c){return BPromise['reject'](_0x23189c);}return _0x438288[_0xcc1d('0x22')]();};}function saveUpdates(_0x1bcf7b,_0x167b9f){return function(_0x5a2df6){if(_0x5a2df6){return _0x5a2df6[_0xcc1d('0x23')](_0x1bcf7b)[_0xcc1d('0x24')](function(_0x31a006){return _0x31a006;});}return null;};}function removeEntity(_0x451523,_0xac9e86){return function(_0x5e2f74){if(_0x5e2f74){return _0x5e2f74[_0xcc1d('0x25')]()['then'](function(){_0x451523[_0xcc1d('0x19')](0xcc)[_0xcc1d('0x1a')]();});}};}function handleEntityNotFound(_0x3f8b30,_0x40e31c){return function(_0xd2dba0){if(!_0xd2dba0){_0x3f8b30['sendStatus'](0x194);}return _0xd2dba0;};}function handleError(_0x8ae1a4,_0x17cdfe){_0x17cdfe=_0x17cdfe||0x1f4;return function(_0xec0667){logger['error'](_0xec0667[_0xcc1d('0x26')]);if(_0xec0667['name']){delete _0xec0667[_0xcc1d('0x27')];}_0x8ae1a4['status'](_0x17cdfe)[_0xcc1d('0x28')](_0xec0667);};}exports[_0xcc1d('0x29')]=function(_0x47710b,_0x50b769){var _0x2c5c51={},_0x10f5d3={},_0x11ba24={'count':0x0,'rows':[]};var _0x4a406f=_[_0xcc1d('0x2a')](db['ChatQueueReport'][_0xcc1d('0x2b')],function(_0x2a68ef){return{'name':_0x2a68ef[_0xcc1d('0x2c')],'type':_0x2a68ef[_0xcc1d('0x2d')][_0xcc1d('0x2e')]};});_0x10f5d3['model']=_[_0xcc1d('0x2a')](_0x4a406f,_0xcc1d('0x27'));_0x10f5d3['query']=_[_0xcc1d('0x2f')](_0x47710b['query']);_0x10f5d3[_0xcc1d('0x30')]=_['intersection'](_0x10f5d3['model'],_0x10f5d3[_0xcc1d('0x31')]);_0x2c5c51['attributes']=_[_0xcc1d('0x32')](_0x10f5d3[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x2c5c51[_0xcc1d('0x35')]=_0x2c5c51['attributes'][_0xcc1d('0x36')]?_0x2c5c51['attributes']:_0x10f5d3[_0xcc1d('0x33')];if(!_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x37')](_0xcc1d('0x38'))){_0x2c5c51['limit']=qs[_0xcc1d('0x1d')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1d')]);_0x2c5c51[_0xcc1d('0x1b')]=qs[_0xcc1d('0x1b')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1b')]);}_0x2c5c51[_0xcc1d('0x39')]=qs[_0xcc1d('0x3a')](_0x47710b[_0xcc1d('0x31')]['sort']);_0x2c5c51['where']=qs[_0xcc1d('0x30')](_[_0xcc1d('0x3b')](_0x47710b['query'],_0x10f5d3['filters']),_0x4a406f);if(_0x47710b['query'][_0xcc1d('0x3c')]){_0x2c5c51[_0xcc1d('0x3d')]=_[_0xcc1d('0x3e')](_0x2c5c51[_0xcc1d('0x3d')],{'$or':_[_0xcc1d('0x2a')](_0x4a406f,function(_0xcc81fd){if(_0xcc81fd[_0xcc1d('0x2d')]!=='VIRTUAL'){var _0x3d35e9={};_0x3d35e9[_0xcc81fd['name']]={'$like':'%'+_0x47710b['query']['filter']+'%'};return _0x3d35e9;}})});}_0x2c5c51=_[_0xcc1d('0x3e')]({},_0x2c5c51,_0x47710b[_0xcc1d('0x3f')]);var _0x59d656={'where':_0x2c5c51['where']};return db[_0xcc1d('0x40')]['count'](_0x59d656)[_0xcc1d('0x24')](function(_0x91e50d){_0x11ba24[_0xcc1d('0x1e')]=_0x91e50d;if(_0x47710b['query'][_0xcc1d('0x41')]){_0x2c5c51[_0xcc1d('0x42')]=[{'all':!![]}];}return db[_0xcc1d('0x40')][_0xcc1d('0x43')](_0x2c5c51);})[_0xcc1d('0x24')](function(_0x350b9d){_0x11ba24[_0xcc1d('0x44')]=_0x350b9d;return _0x11ba24;})['then'](respondWithFilteredResult(_0x50b769,_0x2c5c51))[_0xcc1d('0x45')](handleError(_0x50b769,null));};exports['show']=function(_0x809c64,_0x2ac320){var _0x1d74b4={'raw':!![],'where':{'id':_0x809c64[_0xcc1d('0x46')]['id']}},_0x252361={};_0x252361[_0xcc1d('0x33')]=_[_0xcc1d('0x2f')](db[_0xcc1d('0x40')][_0xcc1d('0x2b')]);_0x252361[_0xcc1d('0x31')]=_[_0xcc1d('0x2f')](_0x809c64[_0xcc1d('0x31')]);_0x252361['filters']=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],_0x252361[_0xcc1d('0x31')]);_0x1d74b4[_0xcc1d('0x35')]=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x1d74b4[_0xcc1d('0x35')]=_0x1d74b4[_0xcc1d('0x35')]['length']?_0x1d74b4[_0xcc1d('0x35')]:_0x252361[_0xcc1d('0x33')];if(_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x41')]){_0x1d74b4[_0xcc1d('0x42')]=[{'all':!![]}];}_0x1d74b4=_[_0xcc1d('0x3e')]({},_0x1d74b4,_0x809c64[_0xcc1d('0x3f')]);return db[_0xcc1d('0x40')][_0xcc1d('0x47')](_0x1d74b4)[_0xcc1d('0x24')](handleEntityNotFound(_0x2ac320,null))[_0xcc1d('0x24')](respondWithResult(_0x2ac320,null))[_0xcc1d('0x45')](handleError(_0x2ac320,null));};exports[_0xcc1d('0x48')]=function(_0x1ba4fc,_0x3e9a69){return db[_0xcc1d('0x40')][_0xcc1d('0x48')](_0x1ba4fc[_0xcc1d('0x49')],{})[_0xcc1d('0x24')](respondWithResult(_0x3e9a69,0xc9))[_0xcc1d('0x45')](handleError(_0x3e9a69,null));};exports['update']=function(_0x46a883,_0x4f4359){if(_0x46a883[_0xcc1d('0x49')]['id']){delete _0x46a883[_0xcc1d('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x46a883[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x4f4359,null))[_0xcc1d('0x24')](saveUpdates(_0x46a883[_0xcc1d('0x49')],null))[_0xcc1d('0x24')](respondWithResult(_0x4f4359,null))[_0xcc1d('0x45')](handleError(_0x4f4359,null));};exports['destroy']=function(_0x40b834,_0x98ee9a){return db['ChatQueueReport'][_0xcc1d('0x47')]({'where':{'id':_0x40b834[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x98ee9a,null))['then'](removeEntity(_0x98ee9a,null))[_0xcc1d('0x45')](handleError(_0x98ee9a,null));};exports[_0xcc1d('0x4a')]=function(_0x3b232f,_0x50d994){return db[_0xcc1d('0x40')][_0xcc1d('0x4a')]()[_0xcc1d('0x24')](respondWithResult(_0x50d994,null))[_0xcc1d('0x45')](handleError(_0x50d994,null));}; \ No newline at end of file +var _0x0272=['ejs','fs-extra','jsforce','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','count','limit','set','reject','save','then','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0x353847,_0x5c84de){var _0x40d8a6=function(_0x221958){while(--_0x221958){_0x353847['push'](_0x353847['shift']());}};_0x40d8a6(++_0x5c84de);}(_0x0272,0x15a));var _0x2027=function(_0x14a48f,_0x1f6b24){_0x14a48f=_0x14a48f-0x0;var _0x17b855=_0x0272[_0x14a48f];return _0x17b855;};'use strict';var emlformat=require(_0x2027('0x0'));var rimraf=require(_0x2027('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2027('0x2'));var rp=require(_0x2027('0x3'));var moment=require(_0x2027('0x4'));var BPromise=require(_0x2027('0x5'));var Mustache=require(_0x2027('0x6'));var util=require(_0x2027('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2027('0x8'));var ejs=require(_0x2027('0x9'));var fs=require('fs');var fs_extra=require(_0x2027('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2027('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2027('0x8'));var querystring=require('querystring');var Papa=require(_0x2027('0xc'));var Redis=require(_0x2027('0xd'));var authService=require(_0x2027('0xe'));var qs=require(_0x2027('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2027('0x10'));var logger=require(_0x2027('0x11'))(_0x2027('0x12'));var utils=require(_0x2027('0x13'));var config=require(_0x2027('0x14'));var licenseUtil=require(_0x2027('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ba43f,_0x2f3649){_0x2f3649=_0x2f3649||0xcc;return function(_0x5391c4){if(_0x5391c4){return _0x2ba43f[_0x2027('0x16')](_0x2f3649);}return _0x2ba43f[_0x2027('0x17')](_0x2f3649)[_0x2027('0x18')]();};}function respondWithResult(_0x4404cd,_0x54dfde){_0x54dfde=_0x54dfde||0xc8;return function(_0x84157d){if(_0x84157d){return _0x4404cd['status'](_0x54dfde)[_0x2027('0x19')](_0x84157d);}};}function respondWithFilteredResult(_0x16b781,_0x1cd227){return function(_0x156c7a){if(_0x156c7a){var _0x2a1234=typeof _0x1cd227[_0x2027('0x1a')]===_0x2027('0x1b')&&typeof _0x1cd227['limit']===_0x2027('0x1b');var _0x4195dc=_0x156c7a[_0x2027('0x1c')];var _0x532a2c=_0x2a1234?0x0:_0x1cd227[_0x2027('0x1a')];var _0x5d47bf=_0x2a1234?_0x156c7a[_0x2027('0x1c')]:_0x1cd227['offset']+_0x1cd227[_0x2027('0x1d')];var _0x2091a9;if(_0x5d47bf>=_0x4195dc){_0x5d47bf=_0x4195dc;_0x2091a9=0xc8;}else{_0x2091a9=0xce;}_0x16b781[_0x2027('0x17')](_0x2091a9);return _0x16b781[_0x2027('0x1e')]('Content-Range',_0x532a2c+'-'+_0x5d47bf+'/'+_0x4195dc)[_0x2027('0x19')](_0x156c7a);}return null;};}function patchUpdates(_0x372d0b){return function(_0x1e4e90){try{jsonpatch['apply'](_0x1e4e90,_0x372d0b,!![]);}catch(_0x238b08){return BPromise[_0x2027('0x1f')](_0x238b08);}return _0x1e4e90[_0x2027('0x20')]();};}function saveUpdates(_0x1e049c,_0x5e11ba){return function(_0x3a215a){if(_0x3a215a){return _0x3a215a['update'](_0x1e049c)['then'](function(_0x1a8b7f){return _0x1a8b7f;});}return null;};}function removeEntity(_0x277880,_0x462ff){return function(_0x5cb8d6){if(_0x5cb8d6){return _0x5cb8d6['destroy']()[_0x2027('0x21')](function(){_0x277880['status'](0xcc)[_0x2027('0x18')]();});}};}function handleEntityNotFound(_0x250775,_0x214cc4){return function(_0xb1435){if(!_0xb1435){_0x250775[_0x2027('0x16')](0x194);}return _0xb1435;};}function handleError(_0x36037a,_0x1d30d4){_0x1d30d4=_0x1d30d4||0x1f4;return function(_0x49f9f8){logger[_0x2027('0x22')](_0x49f9f8[_0x2027('0x23')]);if(_0x49f9f8[_0x2027('0x24')]){delete _0x49f9f8['name'];}_0x36037a['status'](_0x1d30d4)[_0x2027('0x25')](_0x49f9f8);};}exports['index']=function(_0x90a6ae,_0x5295f8){var _0x481765={},_0x36f98d={},_0x21feb4={'count':0x0,'rows':[]};var _0x2a9320=_[_0x2027('0x26')](db[_0x2027('0x27')][_0x2027('0x28')],function(_0x83a66){return{'name':_0x83a66[_0x2027('0x29')],'type':_0x83a66['type'][_0x2027('0x2a')]};});_0x36f98d[_0x2027('0x2b')]=_[_0x2027('0x26')](_0x2a9320,_0x2027('0x24'));_0x36f98d['query']=_['keys'](_0x90a6ae[_0x2027('0x2c')]);_0x36f98d[_0x2027('0x2d')]=_[_0x2027('0x2e')](_0x36f98d[_0x2027('0x2b')],_0x36f98d[_0x2027('0x2c')]);_0x481765['attributes']=_['intersection'](_0x36f98d[_0x2027('0x2b')],qs['fields'](_0x90a6ae[_0x2027('0x2c')][_0x2027('0x2f')]));_0x481765[_0x2027('0x30')]=_0x481765[_0x2027('0x30')][_0x2027('0x31')]?_0x481765['attributes']:_0x36f98d[_0x2027('0x2b')];if(!_0x90a6ae[_0x2027('0x2c')][_0x2027('0x32')]('nolimit')){_0x481765[_0x2027('0x1d')]=qs['limit'](_0x90a6ae['query'][_0x2027('0x1d')]);_0x481765[_0x2027('0x1a')]=qs[_0x2027('0x1a')](_0x90a6ae[_0x2027('0x2c')][_0x2027('0x1a')]);}_0x481765['order']=qs['sort'](_0x90a6ae[_0x2027('0x2c')][_0x2027('0x33')]);_0x481765[_0x2027('0x34')]=qs[_0x2027('0x2d')](_['pick'](_0x90a6ae['query'],_0x36f98d[_0x2027('0x2d')]),_0x2a9320);if(_0x90a6ae[_0x2027('0x2c')]['filter']){_0x481765[_0x2027('0x34')]=_[_0x2027('0x35')](_0x481765[_0x2027('0x34')],{'$or':_[_0x2027('0x26')](_0x2a9320,function(_0x37404e){if(_0x37404e[_0x2027('0x36')]!==_0x2027('0x37')){var _0x1b6a64={};_0x1b6a64[_0x37404e[_0x2027('0x24')]]={'$like':'%'+_0x90a6ae[_0x2027('0x2c')]['filter']+'%'};return _0x1b6a64;}})});}_0x481765=_[_0x2027('0x35')]({},_0x481765,_0x90a6ae[_0x2027('0x38')]);var _0x7d3b69={'where':_0x481765[_0x2027('0x34')]};return db['ChatQueueReport'][_0x2027('0x1c')](_0x7d3b69)['then'](function(_0x5cf0d9){_0x21feb4['count']=_0x5cf0d9;if(_0x90a6ae['query'][_0x2027('0x39')]){_0x481765[_0x2027('0x3a')]=[{'all':!![]}];}return db[_0x2027('0x27')][_0x2027('0x3b')](_0x481765);})['then'](function(_0x38f8e5){_0x21feb4[_0x2027('0x3c')]=_0x38f8e5;return _0x21feb4;})[_0x2027('0x21')](respondWithFilteredResult(_0x5295f8,_0x481765))[_0x2027('0x3d')](handleError(_0x5295f8,null));};exports[_0x2027('0x3e')]=function(_0x5cf361,_0x23e230){var _0x5ce14f={'raw':!![],'where':{'id':_0x5cf361[_0x2027('0x3f')]['id']}},_0x5a6e2f={};_0x5a6e2f[_0x2027('0x2b')]=_[_0x2027('0x40')](db[_0x2027('0x27')][_0x2027('0x28')]);_0x5a6e2f[_0x2027('0x2c')]=_[_0x2027('0x40')](_0x5cf361[_0x2027('0x2c')]);_0x5a6e2f[_0x2027('0x2d')]=_[_0x2027('0x2e')](_0x5a6e2f[_0x2027('0x2b')],_0x5a6e2f[_0x2027('0x2c')]);_0x5ce14f[_0x2027('0x30')]=_[_0x2027('0x2e')](_0x5a6e2f['model'],qs[_0x2027('0x2f')](_0x5cf361[_0x2027('0x2c')][_0x2027('0x2f')]));_0x5ce14f[_0x2027('0x30')]=_0x5ce14f[_0x2027('0x30')][_0x2027('0x31')]?_0x5ce14f[_0x2027('0x30')]:_0x5a6e2f[_0x2027('0x2b')];if(_0x5cf361[_0x2027('0x2c')][_0x2027('0x39')]){_0x5ce14f[_0x2027('0x3a')]=[{'all':!![]}];}_0x5ce14f=_[_0x2027('0x35')]({},_0x5ce14f,_0x5cf361['options']);return db['ChatQueueReport'][_0x2027('0x41')](_0x5ce14f)['then'](handleEntityNotFound(_0x23e230,null))['then'](respondWithResult(_0x23e230,null))['catch'](handleError(_0x23e230,null));};exports[_0x2027('0x42')]=function(_0x14e83d,_0x348381){return db[_0x2027('0x27')]['create'](_0x14e83d[_0x2027('0x43')],{})[_0x2027('0x21')](respondWithResult(_0x348381,0xc9))[_0x2027('0x3d')](handleError(_0x348381,null));};exports[_0x2027('0x44')]=function(_0x53cba9,_0x987f99){if(_0x53cba9[_0x2027('0x43')]['id']){delete _0x53cba9[_0x2027('0x43')]['id'];}return db[_0x2027('0x27')][_0x2027('0x41')]({'where':{'id':_0x53cba9['params']['id']}})[_0x2027('0x21')](handleEntityNotFound(_0x987f99,null))[_0x2027('0x21')](saveUpdates(_0x53cba9[_0x2027('0x43')],null))[_0x2027('0x21')](respondWithResult(_0x987f99,null))['catch'](handleError(_0x987f99,null));};exports[_0x2027('0x45')]=function(_0x4a6308,_0x583a2a){return db[_0x2027('0x27')][_0x2027('0x41')]({'where':{'id':_0x4a6308['params']['id']}})['then'](handleEntityNotFound(_0x583a2a,null))[_0x2027('0x21')](removeEntity(_0x583a2a,null))[_0x2027('0x3d')](handleError(_0x583a2a,null));};exports['describe']=function(_0x17e99e,_0x2e3531){return db[_0x2027('0x27')][_0x2027('0x46')]()[_0x2027('0x21')](respondWithResult(_0x2e3531,null))[_0x2027('0x3d')](handleError(_0x2e3531,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d2929eb..ca01dad 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(_0x12ddee,_0x23a83c){var _0x4af963=function(_0x5e73e5){while(--_0x5e73e5){_0x12ddee['push'](_0x12ddee['shift']());}};_0x4af963(++_0x23a83c);}(_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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2e5e9f,_0x56933f){var _0x45036b=function(_0x9a4c69){while(--_0x9a4c69){_0x2e5e9f['push'](_0x2e5e9f['shift']());}};_0x45036b(++_0x56933f);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c115b,_0x59d8a5){_0x1c115b=_0x1c115b-0x0;var _0x234a18=_0xb10b[_0x1c115b];return _0x234a18;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 9f3e3fa..ede5f19 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 _0xa5cd=['limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','attributes'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0xa5cd,0xd3));var _0xda5c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xa5cd[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda5c('0x0'));var BPromise=require(_0xda5c('0x1'));var rs=require(_0xda5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda5c('0x3'))['db'];var utils=require(_0xda5c('0x4'));var logger=require(_0xda5c('0x5'))(_0xda5c('0x6'));var config=require(_0xda5c('0x7'));var jayson=require(_0xda5c('0x8'));var client=jayson[_0xda5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7006b3,_0x3c2094,_0x2df01d){return new BPromise(function(_0xa18ef3,_0x4ee173){return client['request'](_0x7006b3,_0x2df01d)[_0xda5c('0xa')](function(_0x35dbb7){logger[_0xda5c('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3c2094,_0xda5c('0xc'));logger[_0xda5c('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3c2094,'request\x20sent',JSON[_0xda5c('0xe')](_0x35dbb7));if(_0x35dbb7[_0xda5c('0xf')]){if(_0x35dbb7[_0xda5c('0xf')]['code']===0x1f4){logger[_0xda5c('0xf')](_0xda5c('0x10'),_0x3c2094,_0x35dbb7['error'][_0xda5c('0x11')]);return _0x4ee173(_0x35dbb7[_0xda5c('0xf')][_0xda5c('0x11')]);}logger['error'](_0xda5c('0x10'),_0x3c2094,_0x35dbb7[_0xda5c('0xf')][_0xda5c('0x11')]);return _0xa18ef3(_0x35dbb7[_0xda5c('0xf')]['message']);}else{logger[_0xda5c('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3c2094,_0xda5c('0xc'));_0xa18ef3(_0x35dbb7['result'][_0xda5c('0x11')]);}})['catch'](function(_0x277d61){logger['error'](_0xda5c('0x10'),_0x3c2094,_0x277d61);_0x4ee173(_0x277d61);});});}exports[_0xda5c('0x12')]=function(_0x504391){var _0x2dbdd7=this;return new Promise(function(_0x771326,_0x51a6a2){return db[_0xda5c('0x13')][_0xda5c('0x14')](_0x504391[_0xda5c('0x15')],{'raw':_0x504391[_0xda5c('0x16')]?_0x504391[_0xda5c('0x16')][_0xda5c('0x17')]===undefined?!![]:![]:!![]})[_0xda5c('0xa')](function(_0x44fe7f){logger[_0xda5c('0xb')](_0xda5c('0x12'),_0x504391);logger[_0xda5c('0xd')](_0xda5c('0x12'),_0x504391,JSON['stringify'](_0x44fe7f));_0x771326(_0x44fe7f);})[_0xda5c('0x18')](function(_0x547b51){logger['error']('CreateChatQueueReport',_0x547b51[_0xda5c('0x11')],_0x504391);_0x51a6a2(_0x2dbdd7[_0xda5c('0xf')](0x1f4,_0x547b51[_0xda5c('0x11')]));});});};exports[_0xda5c('0x19')]=function(_0x48aee6){var _0x172350=this;return new Promise(function(_0x9e32b3,_0x530aeb){return db['ChatQueueReport'][_0xda5c('0x1a')](_0x48aee6[_0xda5c('0x15')],{'raw':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48aee6['options']?_0x48aee6[_0xda5c('0x16')][_0xda5c('0x1b')]||null:null,'attributes':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options'][_0xda5c('0x1c')]||null:null,'limit':_0x48aee6[_0xda5c('0x16')]?_0x48aee6['options'][_0xda5c('0x1d')]||null:null})[_0xda5c('0xa')](function(_0x147af7){logger['info'](_0xda5c('0x19'),_0x48aee6);logger['debug'](_0xda5c('0x19'),_0x48aee6,JSON[_0xda5c('0xe')](_0x147af7));_0x9e32b3(_0x147af7);})[_0xda5c('0x18')](function(_0x1394b6){logger[_0xda5c('0xf')](_0xda5c('0x19'),_0x1394b6[_0xda5c('0x11')],_0x48aee6);_0x530aeb(_0x172350['error'](0x1f4,_0x1394b6[_0xda5c('0x11')]));});});}; \ No newline at end of file +var _0xa1a4=['client','http','request','then','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','body','limit','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x271ab5,_0x3e0218){var _0x55a6bf=function(_0xb65b1e){while(--_0xb65b1e){_0x271ab5['push'](_0x271ab5['shift']());}};_0x55a6bf(++_0x3e0218);}(_0xa1a4,0x11f));var _0x4a1a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa1a4[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x4a1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a1a('0x1'));var rs=require(_0x4a1a('0x2'));var fs=require('fs');var Redis=require(_0x4a1a('0x3'));var db=require(_0x4a1a('0x4'))['db'];var utils=require(_0x4a1a('0x5'));var logger=require(_0x4a1a('0x6'))(_0x4a1a('0x7'));var config=require(_0x4a1a('0x8'));var jayson=require(_0x4a1a('0x9'));var client=jayson[_0x4a1a('0xa')][_0x4a1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16bb6d,_0x4b90f0,_0x6109cc){return new BPromise(function(_0x51c432,_0xcd0771){return client[_0x4a1a('0xc')](_0x16bb6d,_0x6109cc)[_0x4a1a('0xd')](function(_0x27238a){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x4b90f0,'request\x20sent');logger['debug'](_0x4a1a('0xe'),_0x4b90f0,_0x4a1a('0xf'),JSON[_0x4a1a('0x10')](_0x27238a));if(_0x27238a[_0x4a1a('0x11')]){if(_0x27238a[_0x4a1a('0x11')]['code']===0x1f4){logger[_0x4a1a('0x11')](_0x4a1a('0x12'),_0x4b90f0,_0x27238a[_0x4a1a('0x11')][_0x4a1a('0x13')]);return _0xcd0771(_0x27238a[_0x4a1a('0x11')][_0x4a1a('0x13')]);}logger['error'](_0x4a1a('0x12'),_0x4b90f0,_0x27238a[_0x4a1a('0x11')][_0x4a1a('0x13')]);return _0x51c432(_0x27238a['error'][_0x4a1a('0x13')]);}else{logger[_0x4a1a('0x14')](_0x4a1a('0x12'),_0x4b90f0,'request\x20sent');_0x51c432(_0x27238a[_0x4a1a('0x15')][_0x4a1a('0x13')]);}})[_0x4a1a('0x16')](function(_0x36c55d){logger[_0x4a1a('0x11')](_0x4a1a('0x12'),_0x4b90f0,_0x36c55d);_0xcd0771(_0x36c55d);});});}exports['CreateChatQueueReport']=function(_0x477c9e){var _0xad38b0=this;return new Promise(function(_0x5e1376,_0x356f06){return db[_0x4a1a('0x17')][_0x4a1a('0x18')](_0x477c9e['body'],{'raw':_0x477c9e[_0x4a1a('0x19')]?_0x477c9e[_0x4a1a('0x19')][_0x4a1a('0x1a')]===undefined?!![]:![]:!![]})[_0x4a1a('0xd')](function(_0x5e6f2f){logger[_0x4a1a('0x14')](_0x4a1a('0x1b'),_0x477c9e);logger['debug'](_0x4a1a('0x1b'),_0x477c9e,JSON['stringify'](_0x5e6f2f));_0x5e1376(_0x5e6f2f);})['catch'](function(_0x308fe5){logger[_0x4a1a('0x11')]('CreateChatQueueReport',_0x308fe5['message'],_0x477c9e);_0x356f06(_0xad38b0[_0x4a1a('0x11')](0x1f4,_0x308fe5[_0x4a1a('0x13')]));});});};exports[_0x4a1a('0x1c')]=function(_0x46e0af){var _0x7ed1c5=this;return new Promise(function(_0x54800a,_0xcb5804){return db['ChatQueueReport'][_0x4a1a('0x1d')](_0x46e0af[_0x4a1a('0x1e')],{'raw':_0x46e0af['options']?_0x46e0af[_0x4a1a('0x19')][_0x4a1a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e0af[_0x4a1a('0x19')]?_0x46e0af['options']['where']||null:null,'attributes':_0x46e0af[_0x4a1a('0x19')]?_0x46e0af[_0x4a1a('0x19')]['attributes']||null:null,'limit':_0x46e0af[_0x4a1a('0x19')]?_0x46e0af[_0x4a1a('0x19')][_0x4a1a('0x1f')]||null:null})[_0x4a1a('0xd')](function(_0x347571){logger[_0x4a1a('0x14')](_0x4a1a('0x1c'),_0x46e0af);logger[_0x4a1a('0x20')]('UpdateChatQueueReport',_0x46e0af,JSON[_0x4a1a('0x10')](_0x347571));_0x54800a(_0x347571);})[_0x4a1a('0x16')](function(_0x1e1999){logger[_0x4a1a('0x11')](_0x4a1a('0x1c'),_0x1e1999[_0x4a1a('0x13')],_0x46e0af);_0xcb5804(_0x7ed1c5['error'](0x1f4,_0x1e1999['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 2497d99..e2685b4 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 _0xceb6=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','update'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0xceb6,0x1e3));var _0x6ceb=function(_0x3e93a3,_0x1d38cf){_0x3e93a3=_0x3e93a3-0x0;var _0x5edc60=_0xceb6[_0x3e93a3];return _0x5edc60;};'use strict';var multer=require('multer');var util=require(_0x6ceb('0x0'));var path=require(_0x6ceb('0x1'));var timeout=require(_0x6ceb('0x2'));var express=require(_0x6ceb('0x3'));var router=express[_0x6ceb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ceb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ceb('0x6'));var controller=require('./chatQueueReport.controller');router[_0x6ceb('0x7')]('/',auth['isAuthenticated'](),controller[_0x6ceb('0x8')]);router[_0x6ceb('0x7')](_0x6ceb('0x9'),auth[_0x6ceb('0xa')](),controller[_0x6ceb('0xb')]);router['get']('/:id',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0xc')]);router[_0x6ceb('0xd')]('/',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0xe')]);router[_0x6ceb('0xf')]('/:id',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0x10')]);router[_0x6ceb('0x11')]('/:id',auth[_0x6ceb('0xa')](),controller[_0x6ceb('0x12')]);module[_0x6ceb('0x13')]=router; \ No newline at end of file +var _0x443d=['put','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create'];(function(_0x5a41c7,_0x2f55ce){var _0x176597=function(_0x3b8eff){while(--_0x3b8eff){_0x5a41c7['push'](_0x5a41c7['shift']());}};_0x176597(++_0x2f55ce);}(_0x443d,0x144));var _0xd443=function(_0x2eeccd,_0x3f018e){_0x2eeccd=_0x2eeccd-0x0;var _0x4e7ed3=_0x443d[_0x2eeccd];return _0x4e7ed3;};'use strict';var multer=require(_0xd443('0x0'));var util=require(_0xd443('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd443('0x2')]();var fs_extra=require(_0xd443('0x3'));var auth=require(_0xd443('0x4'));var interaction=require(_0xd443('0x5'));var config=require(_0xd443('0x6'));var controller=require(_0xd443('0x7'));router['get']('/',auth[_0xd443('0x8')](),controller[_0xd443('0x9')]);router[_0xd443('0xa')](_0xd443('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd443('0xa')](_0xd443('0xc'),auth[_0xd443('0x8')](),controller[_0xd443('0xd')]);router[_0xd443('0xe')]('/',auth['isAuthenticated'](),controller[_0xd443('0xf')]);router[_0xd443('0x10')]('/:id',auth[_0xd443('0x8')](),controller[_0xd443('0x11')]);router['delete'](_0xd443('0xc'),auth[_0xd443('0x8')](),controller[_0xd443('0x12')]);module[_0xd443('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index c6cf0b3..fdd2eb2 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4475e0,_0xf51b40){var _0x575291=function(_0xcadfe7){while(--_0xcadfe7){_0x4475e0['push'](_0x4475e0['shift']());}};_0x575291(++_0xf51b40);}(_0x70e0,0x17b));var _0x070e=function(_0x183b57,_0xfc6974){_0x183b57=_0x183b57-0x0;var _0x2ddba5=_0x70e0[_0x183b57];return _0x2ddba5;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3e5664,_0x484d14){var _0x3bd4ab=function(_0x4a5b34){while(--_0x4a5b34){_0x3e5664['push'](_0x3e5664['shift']());}};_0x3bd4ab(++_0x484d14);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xf3cd[_0x1b8f5a];return _0x594189;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 3916de8..7974d1b 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 _0xbcc9=['limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','map','ChatTransferReport','rawAttributes','fieldName','model','query','intersection','fields','attributes','order','sort','where','filters','pick','type','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','catch','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x1de8d8,_0xca0c0c){var _0x5ad51f=function(_0xc3533a){while(--_0xc3533a){_0x1de8d8['push'](_0x1de8d8['shift']());}};_0x5ad51f(++_0xca0c0c);}(_0xbcc9,0x149));var _0x9bcc=function(_0x41fdcc,_0x586927){_0x41fdcc=_0x41fdcc-0x0;var _0x3de759=_0xbcc9[_0x41fdcc];return _0x3de759;};'use strict';var emlformat=require(_0x9bcc('0x0'));var rimraf=require(_0x9bcc('0x1'));var zipdir=require(_0x9bcc('0x2'));var jsonpatch=require(_0x9bcc('0x3'));var rp=require('request-promise');var moment=require(_0x9bcc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9bcc('0x5'));var path=require(_0x9bcc('0x6'));var sox=require('sox');var csv=require(_0x9bcc('0x7'));var ejs=require(_0x9bcc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bcc('0x9'));var squel=require(_0x9bcc('0xa'));var crypto=require(_0x9bcc('0xb'));var jsforce=require(_0x9bcc('0xc'));var deskjs=require(_0x9bcc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9bcc('0xe'));var Papa=require(_0x9bcc('0xf'));var Redis=require(_0x9bcc('0x10'));var authService=require(_0x9bcc('0x11'));var qs=require(_0x9bcc('0x12'));var as=require(_0x9bcc('0x13'));var hardwareService=require(_0x9bcc('0x14'));var logger=require(_0x9bcc('0x15'))(_0x9bcc('0x16'));var utils=require('../../config/utils');var config=require(_0x9bcc('0x17'));var licenseUtil=require(_0x9bcc('0x18'));var db=require(_0x9bcc('0x19'))['db'];function respondWithStatusCode(_0xc2e345,_0xb384dd){_0xb384dd=_0xb384dd||0xcc;return function(_0x549f0b){if(_0x549f0b){return _0xc2e345[_0x9bcc('0x1a')](_0xb384dd);}return _0xc2e345[_0x9bcc('0x1b')](_0xb384dd)['end']();};}function respondWithResult(_0x2f04e5,_0x4be1e4){_0x4be1e4=_0x4be1e4||0xc8;return function(_0x27e1c5){if(_0x27e1c5){return _0x2f04e5[_0x9bcc('0x1b')](_0x4be1e4)[_0x9bcc('0x1c')](_0x27e1c5);}};}function respondWithFilteredResult(_0x4f5101,_0x572541){return function(_0x4f93dc){if(_0x4f93dc){var _0x5b18ca=typeof _0x572541[_0x9bcc('0x1d')]===_0x9bcc('0x1e')&&typeof _0x572541[_0x9bcc('0x1f')]==='undefined';var _0x4a58ad=_0x4f93dc[_0x9bcc('0x20')];var _0x43591b=_0x5b18ca?0x0:_0x572541[_0x9bcc('0x1d')];var _0xc75f6=_0x5b18ca?_0x4f93dc[_0x9bcc('0x20')]:_0x572541['offset']+_0x572541['limit'];var _0x3bedde;if(_0xc75f6>=_0x4a58ad){_0xc75f6=_0x4a58ad;_0x3bedde=0xc8;}else{_0x3bedde=0xce;}_0x4f5101['status'](_0x3bedde);return _0x4f5101[_0x9bcc('0x21')](_0x9bcc('0x22'),_0x43591b+'-'+_0xc75f6+'/'+_0x4a58ad)['json'](_0x4f93dc);}return null;};}function patchUpdates(_0x337704){return function(_0x5cdae1){try{jsonpatch['apply'](_0x5cdae1,_0x337704,!![]);}catch(_0x6fa342){return BPromise[_0x9bcc('0x23')](_0x6fa342);}return _0x5cdae1[_0x9bcc('0x24')]();};}function saveUpdates(_0x521358,_0x45379d){return function(_0x4be5be){if(_0x4be5be){return _0x4be5be[_0x9bcc('0x25')](_0x521358)['then'](function(_0x3ba2ef){return _0x3ba2ef;});}return null;};}function removeEntity(_0x1f79b9,_0x26f53f){return function(_0x2f4388){if(_0x2f4388){return _0x2f4388['destroy']()[_0x9bcc('0x26')](function(){_0x1f79b9[_0x9bcc('0x1b')](0xcc)[_0x9bcc('0x27')]();});}};}function handleEntityNotFound(_0xcdcc94,_0x5ea989){return function(_0x3c6acb){if(!_0x3c6acb){_0xcdcc94['sendStatus'](0x194);}return _0x3c6acb;};}function handleError(_0x53ff0f,_0x468548){_0x468548=_0x468548||0x1f4;return function(_0x1f3891){logger[_0x9bcc('0x28')](_0x1f3891[_0x9bcc('0x29')]);if(_0x1f3891[_0x9bcc('0x2a')]){delete _0x1f3891[_0x9bcc('0x2a')];}_0x53ff0f[_0x9bcc('0x1b')](_0x468548)['send'](_0x1f3891);};}exports['index']=function(_0xf83dd4,_0x179829){var _0x256793={},_0x3696e5={},_0x3ca71c={'count':0x0,'rows':[]};var _0x219e30=_[_0x9bcc('0x2b')](db[_0x9bcc('0x2c')][_0x9bcc('0x2d')],function(_0x4f1787){return{'name':_0x4f1787[_0x9bcc('0x2e')],'type':_0x4f1787['type']['key']};});_0x3696e5[_0x9bcc('0x2f')]=_[_0x9bcc('0x2b')](_0x219e30,'name');_0x3696e5[_0x9bcc('0x30')]=_['keys'](_0xf83dd4[_0x9bcc('0x30')]);_0x3696e5['filters']=_[_0x9bcc('0x31')](_0x3696e5[_0x9bcc('0x2f')],_0x3696e5['query']);_0x256793['attributes']=_['intersection'](_0x3696e5[_0x9bcc('0x2f')],qs['fields'](_0xf83dd4['query'][_0x9bcc('0x32')]));_0x256793[_0x9bcc('0x33')]=_0x256793[_0x9bcc('0x33')]['length']?_0x256793[_0x9bcc('0x33')]:_0x3696e5['model'];if(!_0xf83dd4[_0x9bcc('0x30')]['hasOwnProperty']('nolimit')){_0x256793[_0x9bcc('0x1f')]=qs['limit'](_0xf83dd4[_0x9bcc('0x30')][_0x9bcc('0x1f')]);_0x256793[_0x9bcc('0x1d')]=qs[_0x9bcc('0x1d')](_0xf83dd4[_0x9bcc('0x30')][_0x9bcc('0x1d')]);}_0x256793[_0x9bcc('0x34')]=qs[_0x9bcc('0x35')](_0xf83dd4['query'][_0x9bcc('0x35')]);_0x256793[_0x9bcc('0x36')]=qs[_0x9bcc('0x37')](_[_0x9bcc('0x38')](_0xf83dd4['query'],_0x3696e5[_0x9bcc('0x37')]),_0x219e30);if(_0xf83dd4['query']['filter']){_0x256793[_0x9bcc('0x36')]=_['merge'](_0x256793[_0x9bcc('0x36')],{'$or':_[_0x9bcc('0x2b')](_0x219e30,function(_0x411584){if(_0x411584[_0x9bcc('0x39')]!==_0x9bcc('0x3a')){var _0x156c34={};_0x156c34[_0x411584[_0x9bcc('0x2a')]]={'$like':'%'+_0xf83dd4[_0x9bcc('0x30')]['filter']+'%'};return _0x156c34;}})});}_0x256793=_['merge']({},_0x256793,_0xf83dd4[_0x9bcc('0x3b')]);var _0x2f34ca={'where':_0x256793['where']};return db['ChatTransferReport'][_0x9bcc('0x20')](_0x2f34ca)['then'](function(_0x1c3084){_0x3ca71c[_0x9bcc('0x20')]=_0x1c3084;if(_0xf83dd4['query']['includeAll']){_0x256793[_0x9bcc('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9bcc('0x3d')](_0x256793);})[_0x9bcc('0x26')](function(_0x482aa1){_0x3ca71c[_0x9bcc('0x3e')]=_0x482aa1;return _0x3ca71c;})[_0x9bcc('0x26')](respondWithFilteredResult(_0x179829,_0x256793))['catch'](handleError(_0x179829,null));};exports[_0x9bcc('0x3f')]=function(_0x1a987d,_0x1b17ea){var _0xbddce3={'raw':!![],'where':{'id':_0x1a987d['params']['id']}},_0x44d6da={};_0x44d6da[_0x9bcc('0x2f')]=_[_0x9bcc('0x40')](db[_0x9bcc('0x2c')][_0x9bcc('0x2d')]);_0x44d6da['query']=_[_0x9bcc('0x40')](_0x1a987d[_0x9bcc('0x30')]);_0x44d6da[_0x9bcc('0x37')]=_[_0x9bcc('0x31')](_0x44d6da[_0x9bcc('0x2f')],_0x44d6da[_0x9bcc('0x30')]);_0xbddce3[_0x9bcc('0x33')]=_['intersection'](_0x44d6da[_0x9bcc('0x2f')],qs['fields'](_0x1a987d['query'][_0x9bcc('0x32')]));_0xbddce3[_0x9bcc('0x33')]=_0xbddce3[_0x9bcc('0x33')]['length']?_0xbddce3[_0x9bcc('0x33')]:_0x44d6da[_0x9bcc('0x2f')];if(_0x1a987d[_0x9bcc('0x30')][_0x9bcc('0x41')]){_0xbddce3[_0x9bcc('0x3c')]=[{'all':!![]}];}_0xbddce3=_['merge']({},_0xbddce3,_0x1a987d[_0x9bcc('0x3b')]);return db['ChatTransferReport'][_0x9bcc('0x42')](_0xbddce3)[_0x9bcc('0x26')](handleEntityNotFound(_0x1b17ea,null))[_0x9bcc('0x26')](respondWithResult(_0x1b17ea,null))[_0x9bcc('0x43')](handleError(_0x1b17ea,null));};exports['create']=function(_0x3c63c8,_0x119ef1){return db[_0x9bcc('0x2c')]['create'](_0x3c63c8[_0x9bcc('0x44')],{})[_0x9bcc('0x26')](respondWithResult(_0x119ef1,0xc9))['catch'](handleError(_0x119ef1,null));};exports['update']=function(_0x526fba,_0x42d901){if(_0x526fba[_0x9bcc('0x44')]['id']){delete _0x526fba[_0x9bcc('0x44')]['id'];}return db['ChatTransferReport'][_0x9bcc('0x42')]({'where':{'id':_0x526fba['params']['id']}})[_0x9bcc('0x26')](handleEntityNotFound(_0x42d901,null))['then'](saveUpdates(_0x526fba['body'],null))['then'](respondWithResult(_0x42d901,null))[_0x9bcc('0x43')](handleError(_0x42d901,null));};exports[_0x9bcc('0x45')]=function(_0x424600,_0x965cce){return db[_0x9bcc('0x2c')][_0x9bcc('0x42')]({'where':{'id':_0x424600[_0x9bcc('0x46')]['id']}})[_0x9bcc('0x26')](handleEntityNotFound(_0x965cce,null))[_0x9bcc('0x26')](removeEntity(_0x965cce,null))[_0x9bcc('0x43')](handleError(_0x965cce,null));};exports[_0x9bcc('0x47')]=function(_0x56e269,_0x485822){return db[_0x9bcc('0x2c')][_0x9bcc('0x47')]()[_0x9bcc('0x26')](respondWithResult(_0x485822,null))[_0x9bcc('0x43')](handleError(_0x485822,null));}; \ No newline at end of file +var _0x7086=['end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7086,0x1b8));var _0x6708=function(_0xbc47f1,_0x489fcb){_0xbc47f1=_0xbc47f1-0x0;var _0xb3387b=_0x7086[_0xbc47f1];return _0xb3387b;};'use strict';var emlformat=require(_0x6708('0x0'));var rimraf=require(_0x6708('0x1'));var zipdir=require(_0x6708('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6708('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6708('0x4'));var util=require(_0x6708('0x5'));var path=require(_0x6708('0x6'));var sox=require(_0x6708('0x7'));var csv=require(_0x6708('0x8'));var ejs=require(_0x6708('0x9'));var fs=require('fs');var fs_extra=require(_0x6708('0xa'));var _=require(_0x6708('0xb'));var squel=require(_0x6708('0xc'));var crypto=require(_0x6708('0xd'));var jsforce=require(_0x6708('0xe'));var deskjs=require(_0x6708('0xf'));var toCsv=require(_0x6708('0x8'));var querystring=require(_0x6708('0x10'));var Papa=require(_0x6708('0x11'));var Redis=require(_0x6708('0x12'));var authService=require(_0x6708('0x13'));var qs=require(_0x6708('0x14'));var as=require(_0x6708('0x15'));var hardwareService=require(_0x6708('0x16'));var logger=require(_0x6708('0x17'))(_0x6708('0x18'));var utils=require(_0x6708('0x19'));var config=require(_0x6708('0x1a'));var licenseUtil=require(_0x6708('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273b28,_0x370976){_0x370976=_0x370976||0xcc;return function(_0x33762d){if(_0x33762d){return _0x273b28['sendStatus'](_0x370976);}return _0x273b28['status'](_0x370976)[_0x6708('0x1c')]();};}function respondWithResult(_0x26eb0c,_0x1643f3){_0x1643f3=_0x1643f3||0xc8;return function(_0x55b5bd){if(_0x55b5bd){return _0x26eb0c[_0x6708('0x1d')](_0x1643f3)[_0x6708('0x1e')](_0x55b5bd);}};}function respondWithFilteredResult(_0xbe9e40,_0x29ce48){return function(_0x4833f6){if(_0x4833f6){var _0x180f1c=typeof _0x29ce48[_0x6708('0x1f')]===_0x6708('0x20')&&typeof _0x29ce48[_0x6708('0x21')]===_0x6708('0x20');var _0x2c7de3=_0x4833f6['count'];var _0x6f632e=_0x180f1c?0x0:_0x29ce48[_0x6708('0x1f')];var _0x14a6e2=_0x180f1c?_0x4833f6[_0x6708('0x22')]:_0x29ce48['offset']+_0x29ce48[_0x6708('0x21')];var _0x576177;if(_0x14a6e2>=_0x2c7de3){_0x14a6e2=_0x2c7de3;_0x576177=0xc8;}else{_0x576177=0xce;}_0xbe9e40['status'](_0x576177);return _0xbe9e40[_0x6708('0x23')](_0x6708('0x24'),_0x6f632e+'-'+_0x14a6e2+'/'+_0x2c7de3)[_0x6708('0x1e')](_0x4833f6);}return null;};}function patchUpdates(_0x2c1b48){return function(_0x14ccee){try{jsonpatch['apply'](_0x14ccee,_0x2c1b48,!![]);}catch(_0x849397){return BPromise['reject'](_0x849397);}return _0x14ccee[_0x6708('0x25')]();};}function saveUpdates(_0x40ef4b,_0x542a9e){return function(_0x360d37){if(_0x360d37){return _0x360d37[_0x6708('0x26')](_0x40ef4b)[_0x6708('0x27')](function(_0x2c7df3){return _0x2c7df3;});}return null;};}function removeEntity(_0x10700b,_0xab9d06){return function(_0x386334){if(_0x386334){return _0x386334[_0x6708('0x28')]()[_0x6708('0x27')](function(){_0x10700b[_0x6708('0x1d')](0xcc)[_0x6708('0x1c')]();});}};}function handleEntityNotFound(_0x11e93c,_0x578ab1){return function(_0x3cc69c){if(!_0x3cc69c){_0x11e93c[_0x6708('0x29')](0x194);}return _0x3cc69c;};}function handleError(_0x17b367,_0xc713a2){_0xc713a2=_0xc713a2||0x1f4;return function(_0x2cae10){logger[_0x6708('0x2a')](_0x2cae10['stack']);if(_0x2cae10[_0x6708('0x2b')]){delete _0x2cae10[_0x6708('0x2b')];}_0x17b367[_0x6708('0x1d')](_0xc713a2)['send'](_0x2cae10);};}exports[_0x6708('0x2c')]=function(_0x21cb3a,_0x4f2af1){var _0xeebb41={},_0x42a150={},_0x29c3d6={'count':0x0,'rows':[]};var _0x23312c=_[_0x6708('0x2d')](db[_0x6708('0x2e')][_0x6708('0x2f')],function(_0x24b6d7){return{'name':_0x24b6d7[_0x6708('0x30')],'type':_0x24b6d7['type'][_0x6708('0x31')]};});_0x42a150['model']=_[_0x6708('0x2d')](_0x23312c,_0x6708('0x2b'));_0x42a150[_0x6708('0x32')]=_[_0x6708('0x33')](_0x21cb3a[_0x6708('0x32')]);_0x42a150['filters']=_['intersection'](_0x42a150[_0x6708('0x34')],_0x42a150[_0x6708('0x32')]);_0xeebb41['attributes']=_[_0x6708('0x35')](_0x42a150['model'],qs[_0x6708('0x36')](_0x21cb3a[_0x6708('0x32')][_0x6708('0x36')]));_0xeebb41[_0x6708('0x37')]=_0xeebb41[_0x6708('0x37')][_0x6708('0x38')]?_0xeebb41['attributes']:_0x42a150[_0x6708('0x34')];if(!_0x21cb3a[_0x6708('0x32')]['hasOwnProperty'](_0x6708('0x39'))){_0xeebb41[_0x6708('0x21')]=qs['limit'](_0x21cb3a['query'][_0x6708('0x21')]);_0xeebb41['offset']=qs[_0x6708('0x1f')](_0x21cb3a['query'][_0x6708('0x1f')]);}_0xeebb41[_0x6708('0x3a')]=qs['sort'](_0x21cb3a[_0x6708('0x32')][_0x6708('0x3b')]);_0xeebb41[_0x6708('0x3c')]=qs[_0x6708('0x3d')](_[_0x6708('0x3e')](_0x21cb3a[_0x6708('0x32')],_0x42a150[_0x6708('0x3d')]),_0x23312c);if(_0x21cb3a[_0x6708('0x32')][_0x6708('0x3f')]){_0xeebb41[_0x6708('0x3c')]=_[_0x6708('0x40')](_0xeebb41['where'],{'$or':_[_0x6708('0x2d')](_0x23312c,function(_0x164596){if(_0x164596[_0x6708('0x41')]!==_0x6708('0x42')){var _0x63ca49={};_0x63ca49[_0x164596[_0x6708('0x2b')]]={'$like':'%'+_0x21cb3a[_0x6708('0x32')][_0x6708('0x3f')]+'%'};return _0x63ca49;}})});}_0xeebb41=_[_0x6708('0x40')]({},_0xeebb41,_0x21cb3a[_0x6708('0x43')]);var _0x4e5202={'where':_0xeebb41[_0x6708('0x3c')]};return db['ChatTransferReport'][_0x6708('0x22')](_0x4e5202)[_0x6708('0x27')](function(_0x5935e1){_0x29c3d6[_0x6708('0x22')]=_0x5935e1;if(_0x21cb3a['query'][_0x6708('0x44')]){_0xeebb41[_0x6708('0x45')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6708('0x46')](_0xeebb41);})['then'](function(_0x332e00){_0x29c3d6[_0x6708('0x47')]=_0x332e00;return _0x29c3d6;})[_0x6708('0x27')](respondWithFilteredResult(_0x4f2af1,_0xeebb41))[_0x6708('0x48')](handleError(_0x4f2af1,null));};exports[_0x6708('0x49')]=function(_0x31eb42,_0x3197ae){var _0x1d085a={'raw':!![],'where':{'id':_0x31eb42['params']['id']}},_0x5f3780={};_0x5f3780[_0x6708('0x34')]=_[_0x6708('0x33')](db[_0x6708('0x2e')][_0x6708('0x2f')]);_0x5f3780[_0x6708('0x32')]=_[_0x6708('0x33')](_0x31eb42[_0x6708('0x32')]);_0x5f3780[_0x6708('0x3d')]=_['intersection'](_0x5f3780[_0x6708('0x34')],_0x5f3780[_0x6708('0x32')]);_0x1d085a[_0x6708('0x37')]=_['intersection'](_0x5f3780[_0x6708('0x34')],qs[_0x6708('0x36')](_0x31eb42['query']['fields']));_0x1d085a[_0x6708('0x37')]=_0x1d085a[_0x6708('0x37')][_0x6708('0x38')]?_0x1d085a[_0x6708('0x37')]:_0x5f3780[_0x6708('0x34')];if(_0x31eb42['query'][_0x6708('0x44')]){_0x1d085a[_0x6708('0x45')]=[{'all':!![]}];}_0x1d085a=_['merge']({},_0x1d085a,_0x31eb42[_0x6708('0x43')]);return db[_0x6708('0x2e')]['find'](_0x1d085a)[_0x6708('0x27')](handleEntityNotFound(_0x3197ae,null))[_0x6708('0x27')](respondWithResult(_0x3197ae,null))[_0x6708('0x48')](handleError(_0x3197ae,null));};exports[_0x6708('0x4a')]=function(_0x3149fd,_0x2805a4){return db[_0x6708('0x2e')][_0x6708('0x4a')](_0x3149fd[_0x6708('0x4b')],{})['then'](respondWithResult(_0x2805a4,0xc9))['catch'](handleError(_0x2805a4,null));};exports['update']=function(_0x20d556,_0x3af5ba){if(_0x20d556['body']['id']){delete _0x20d556[_0x6708('0x4b')]['id'];}return db[_0x6708('0x2e')]['find']({'where':{'id':_0x20d556['params']['id']}})[_0x6708('0x27')](handleEntityNotFound(_0x3af5ba,null))[_0x6708('0x27')](saveUpdates(_0x20d556[_0x6708('0x4b')],null))['then'](respondWithResult(_0x3af5ba,null))[_0x6708('0x48')](handleError(_0x3af5ba,null));};exports['destroy']=function(_0x4636b2,_0x3694a9){return db[_0x6708('0x2e')]['find']({'where':{'id':_0x4636b2[_0x6708('0x4c')]['id']}})[_0x6708('0x27')](handleEntityNotFound(_0x3694a9,null))[_0x6708('0x27')](removeEntity(_0x3694a9,null))[_0x6708('0x48')](handleError(_0x3694a9,null));};exports[_0x6708('0x4d')]=function(_0x1366a7,_0x522263){return db[_0x6708('0x2e')][_0x6708('0x4d')]()['then'](respondWithResult(_0x522263,null))['catch'](handleError(_0x522263,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d422464..dab7930 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 _0x61bc=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x30eb2f,_0x44b55b){var _0x33ce44=function(_0x3e1a62){while(--_0x3e1a62){_0x30eb2f['push'](_0x30eb2f['shift']());}};_0x33ce44(++_0x44b55b);}(_0x61bc,0x9b));var _0xc61b=function(_0x531b8f,_0x367e3b){_0x531b8f=_0x531b8f-0x0;var _0x1917af=_0x61bc[_0x531b8f];return _0x1917af;};'use strict';var _=require(_0xc61b('0x0'));var util=require(_0xc61b('0x1'));var logger=require(_0xc61b('0x2'))(_0xc61b('0x3'));var moment=require('moment');var BPromise=require(_0xc61b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc61b('0x5'));var rimraf=require(_0xc61b('0x6'));var config=require(_0xc61b('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xc61b('0x8')]=function(_0x2dc6af,_0x22d2a7){return _0x2dc6af[_0xc61b('0x9')](_0xc61b('0xa'),attributes,{'tableName':_0xc61b('0xb'),'paranoid':![],'indexes':[{'name':_0xc61b('0xc'),'fields':[_0xc61b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xec63=['uniqueid','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0xec63,0x1e1));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3ec6('0x0'))(_0x3ec6('0x1'));var moment=require(_0x3ec6('0x2'));var BPromise=require('bluebird');var rp=require(_0x3ec6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ec6('0x4'));var config=require(_0x3ec6('0x5'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x4af96e,_0x427799){return _0x4af96e[_0x3ec6('0x6')](_0x3ec6('0x7'),attributes,{'tableName':_0x3ec6('0x8'),'paranoid':![],'indexes':[{'name':_0x3ec6('0x9'),'fields':[_0x3ec6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1e5a1a4..a603425 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 _0xeb09=['stringify','error','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x10ffa8,_0x440d73){var _0x42c4d4=function(_0x37d9a9){while(--_0x37d9a9){_0x10ffa8['push'](_0x10ffa8['shift']());}};_0x42c4d4(++_0x440d73);}(_0xeb09,0x1bd));var _0x9eb0=function(_0x19c204,_0x47782f){_0x19c204=_0x19c204-0x0;var _0x32c1c0=_0xeb09[_0x19c204];return _0x32c1c0;};'use strict';var _=require(_0x9eb0('0x0'));var util=require(_0x9eb0('0x1'));var moment=require(_0x9eb0('0x2'));var BPromise=require('bluebird');var rs=require(_0x9eb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9eb0('0x4'));var logger=require(_0x9eb0('0x5'))(_0x9eb0('0x6'));var config=require(_0x9eb0('0x7'));var jayson=require(_0x9eb0('0x8'));var client=jayson[_0x9eb0('0x9')][_0x9eb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dbccb,_0x1adb3a,_0x51deba){return new BPromise(function(_0x55fe66,_0x1b981c){return client[_0x9eb0('0xb')](_0x2dbccb,_0x51deba)[_0x9eb0('0xc')](function(_0x1c13ac){logger[_0x9eb0('0xd')](_0x9eb0('0xe'),_0x1adb3a,_0x9eb0('0xf'));logger['debug'](_0x9eb0('0x10'),_0x1adb3a,_0x9eb0('0xf'),JSON[_0x9eb0('0x11')](_0x1c13ac));if(_0x1c13ac[_0x9eb0('0x12')]){if(_0x1c13ac[_0x9eb0('0x12')]['code']===0x1f4){logger['error'](_0x9eb0('0xe'),_0x1adb3a,_0x1c13ac[_0x9eb0('0x12')]['message']);return _0x1b981c(_0x1c13ac[_0x9eb0('0x12')]['message']);}logger['error'](_0x9eb0('0xe'),_0x1adb3a,_0x1c13ac[_0x9eb0('0x12')]['message']);return _0x55fe66(_0x1c13ac[_0x9eb0('0x12')]['message']);}else{logger[_0x9eb0('0xd')](_0x9eb0('0xe'),_0x1adb3a,_0x9eb0('0xf'));_0x55fe66(_0x1c13ac['result'][_0x9eb0('0x13')]);}})[_0x9eb0('0x14')](function(_0x24bc20){logger['error'](_0x9eb0('0xe'),_0x1adb3a,_0x24bc20);_0x1b981c(_0x24bc20);});});} \ No newline at end of file +var _0xa4e9=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message'];(function(_0x2a223d,_0x293f83){var _0x158268=function(_0x282f4f){while(--_0x282f4f){_0x2a223d['push'](_0x2a223d['shift']());}};_0x158268(++_0x293f83);}(_0xa4e9,0x12f));var _0x9a4e=function(_0x16ee6f,_0x5e3239){_0x16ee6f=_0x16ee6f-0x0;var _0x20d729=_0xa4e9[_0x16ee6f];return _0x20d729;};'use strict';var _=require(_0x9a4e('0x0'));var util=require(_0x9a4e('0x1'));var moment=require(_0x9a4e('0x2'));var BPromise=require(_0x9a4e('0x3'));var rs=require(_0x9a4e('0x4'));var fs=require('fs');var Redis=require(_0x9a4e('0x5'));var db=require(_0x9a4e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a4e('0x7'))(_0x9a4e('0x8'));var config=require(_0x9a4e('0x9'));var jayson=require(_0x9a4e('0xa'));var client=jayson[_0x9a4e('0xb')][_0x9a4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x162ff2,_0x28d597,_0x545bff){return new BPromise(function(_0x5e96c5,_0x4940ee){return client[_0x9a4e('0xd')](_0x162ff2,_0x545bff)[_0x9a4e('0xe')](function(_0x2ea3f2){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x28d597,_0x9a4e('0xf'));logger['debug'](_0x9a4e('0x10'),_0x28d597,_0x9a4e('0xf'),JSON[_0x9a4e('0x11')](_0x2ea3f2));if(_0x2ea3f2[_0x9a4e('0x12')]){if(_0x2ea3f2[_0x9a4e('0x12')][_0x9a4e('0x13')]===0x1f4){logger[_0x9a4e('0x12')](_0x9a4e('0x14'),_0x28d597,_0x2ea3f2[_0x9a4e('0x12')]['message']);return _0x4940ee(_0x2ea3f2['error'][_0x9a4e('0x15')]);}logger[_0x9a4e('0x12')](_0x9a4e('0x14'),_0x28d597,_0x2ea3f2[_0x9a4e('0x12')]['message']);return _0x5e96c5(_0x2ea3f2['error'][_0x9a4e('0x15')]);}else{logger[_0x9a4e('0x16')](_0x9a4e('0x14'),_0x28d597,'request\x20sent');_0x5e96c5(_0x2ea3f2[_0x9a4e('0x17')][_0x9a4e('0x15')]);}})[_0x9a4e('0x18')](function(_0x5caf0f){logger['error'](_0x9a4e('0x14'),_0x28d597,_0x5caf0f);_0x4940ee(_0x5caf0f);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6ced668..607c3b3 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 _0x3546=['/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0x3546,0x119));var _0x6354=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x3546[_0x1d1963];return _0x3f58bb;};'use strict';var multer=require('multer');var util=require(_0x6354('0x0'));var path=require('path');var timeout=require(_0x6354('0x1'));var express=require(_0x6354('0x2'));var router=express['Router']();var fs_extra=require(_0x6354('0x3'));var auth=require(_0x6354('0x4'));var interaction=require(_0x6354('0x5'));var config=require(_0x6354('0x6'));var controller=require(_0x6354('0x7'));router[_0x6354('0x8')]('/',auth[_0x6354('0x9')](),controller[_0x6354('0xa')]);router['get'](_0x6354('0xb'),auth['isAuthenticated'](),controller[_0x6354('0xc')]);router[_0x6354('0x8')](_0x6354('0xd'),auth[_0x6354('0x9')](),controller[_0x6354('0xe')]);router[_0x6354('0xf')]('/',auth[_0x6354('0x9')](),controller[_0x6354('0x10')]);router[_0x6354('0x11')](_0x6354('0xd'),auth[_0x6354('0x9')](),controller[_0x6354('0x12')]);router['delete']('/:id',auth[_0x6354('0x9')](),controller[_0x6354('0x13')]);module[_0x6354('0x14')]=router; \ No newline at end of file +var _0x69e2=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','update','destroy','multer','path','connect-timeout'];(function(_0x3de361,_0x520189){var _0x2988cc=function(_0x2fb6ff){while(--_0x2fb6ff){_0x3de361['push'](_0x3de361['shift']());}};_0x2988cc(++_0x520189);}(_0x69e2,0x18d));var _0x269e=function(_0x2702e3,_0x511070){_0x2702e3=_0x2702e3-0x0;var _0x433602=_0x69e2[_0x2702e3];return _0x433602;};'use strict';var multer=require(_0x269e('0x0'));var util=require('util');var path=require(_0x269e('0x1'));var timeout=require(_0x269e('0x2'));var express=require(_0x269e('0x3'));var router=express['Router']();var fs_extra=require(_0x269e('0x4'));var auth=require(_0x269e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x269e('0x6'));var controller=require('./chatTransferReport.controller');router[_0x269e('0x7')]('/',auth[_0x269e('0x8')](),controller[_0x269e('0x9')]);router[_0x269e('0x7')]('/describe',auth[_0x269e('0x8')](),controller[_0x269e('0xa')]);router[_0x269e('0x7')](_0x269e('0xb'),auth[_0x269e('0x8')](),controller[_0x269e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x269e('0xd')]);router['put'](_0x269e('0xb'),auth[_0x269e('0x8')](),controller[_0x269e('0xe')]);router['delete'](_0x269e('0xb'),auth[_0x269e('0x8')](),controller[_0x269e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7d8e969..10ec397 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 _0x10f2=['exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10f2,0x137));var _0x210f=function(_0x102df7,_0x313ea0){_0x102df7=_0x102df7-0x0;var _0xbe68ca=_0x10f2[_0x102df7];return _0xbe68ca;};'use strict';var Sequelize=require(_0x210f('0x0'));var rs=require('randomstring');module[_0x210f('0x1')]={'name':{'type':Sequelize[_0x210f('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'unique':_0x210f('0x3')},'description':{'type':Sequelize[_0x210f('0x2')]},'mapKey':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x5')},'customerAlias':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':_0x210f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':_0x210f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x210f('0x2')]},'animation':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x210f('0xa')](_0x210f('0xb'),_0x210f('0xc')),'defaultValue':_0x210f('0xb')},'header_online':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0xe')},'offline_chat_button':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0xf')},'download_transcript':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x210f('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x12')},'noteTitle':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x13')},'placeholderMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x14')},'closingMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x15')},'skipMessageButton':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x16')},'conditionAgreement':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x210f('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x210f('0xa')]('star','thumb'),'defaultValue':_0x210f('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x210f('0x11')],'defaultValue':function(){return JSON[_0x210f('0x18')]({'items':[{'type':_0x210f('0x19'),'variable':null,'config':{'placeholder':_0x210f('0x1a'),'type':_0x210f('0x1b'),'required':!![]},'props':{'title':_0x210f('0x1a'),'helpText':''}},{'type':_0x210f('0x19'),'props':{'title':_0x210f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x210f('0x4'),'type':_0x210f('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x210f('0x1c')](_0x210f('0x1d'))?JSON['parse'](this[_0x210f('0x1c')](_0x210f('0x1d'))):{};},'set':function(_0x2f72e4){return this[_0x210f('0x1e')]('onlineForm',JSON[_0x210f('0x18')](_0x2f72e4));}},'offlineForm':{'type':Sequelize[_0x210f('0x11')],'defaultValue':function(){return JSON[_0x210f('0x18')]({'items':[{'type':_0x210f('0x19'),'props':{'title':_0x210f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x210f('0x4'),'type':_0x210f('0x4')},'variable':null},{'type':_0x210f('0x1f'),'config':{'placeholder':_0x210f('0x20')},'props':{'title':_0x210f('0x20'),'helpText':_0x210f('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x210f('0x1c')](_0x210f('0x22'))?JSON[_0x210f('0x23')](this[_0x210f('0x1c')](_0x210f('0x22'))):{};},'set':function(_0x8d618e){return this[_0x210f('0x1e')](_0x210f('0x22'),JSON['stringify'](_0x8d618e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x210f('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x24')},'waitingMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x26')},'offlineMessageBody':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x16')},'sendUnmanaged':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x210f('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x210f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x210f('0x29');}},'notificationSound':{'type':Sequelize[_0x210f('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x210f('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x210f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x2b')},'verticalAlignment':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x2c')},'defaultTitle':{'type':Sequelize[_0x210f('0x2')]},'customerAvatar':{'type':Sequelize[_0x210f('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x210f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x210f('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x210f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x210f('0x2')],'defaultValue':_0x210f('0x2e')},'systemAvatar':{'type':Sequelize[_0x210f('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x210f('0x8')],'comment':_0x210f('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![],'comment':_0x210f('0x30'),'set':function(_0x432b50){if(!_0x432b50)this[_0x210f('0x1e')](_0x210f('0x31'),null);this[_0x210f('0x1e')]('mandatoryDisposition',_0x432b50);}},'vidaooEscalation':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x210f('0x2')]},'vidaooTopic':{'type':Sequelize[_0x210f('0x2')],'allowNull':![],'defaultValue':_0x210f('0x32')},'vidaooNote':{'type':Sequelize[_0x210f('0x2')],'defaultValue':function(){return _0x210f('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x210f('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x210f('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x210f('0x11')]}}; \ No newline at end of file +var _0xe635=['getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','text'];(function(_0x4da80b,_0x210718){var _0x2e561a=function(_0x4458d9){while(--_0x4458d9){_0x4da80b['push'](_0x4da80b['shift']());}};_0x2e561a(++_0x210718);}(_0xe635,0x88));var _0x5e63=function(_0x8f368a,_0x164cb5){_0x8f368a=_0x8f368a-0x0;var _0x10cb41=_0xe635[_0x8f368a];return _0x10cb41;};'use strict';var Sequelize=require(_0x5e63('0x0'));var rs=require(_0x5e63('0x1'));module[_0x5e63('0x2')]={'name':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![],'unique':_0x5e63('0x4')},'description':{'type':Sequelize[_0x5e63('0x3')]},'mapKey':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x5')},'mapKeyOffline':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x5')},'key':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![],'defaultValue':_0x5e63('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5e63('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5e63('0x3')]},'animation':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5e63('0xa')](_0x5e63('0xb'),_0x5e63('0xc')),'defaultValue':_0x5e63('0xb')},'header_online':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0xd')},'start_chat_button':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0xf')},'download_transcript':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5e63('0x11')]},'closingQuestion':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0x13')},'noteTitle':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x5e63('0x17'),_0x5e63('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5e63('0x19')]({'items':[{'type':_0x5e63('0x1a'),'variable':null,'config':{'placeholder':_0x5e63('0x1b'),'type':_0x5e63('0x1c'),'required':!![]},'props':{'title':_0x5e63('0x1b'),'helpText':''}},{'type':_0x5e63('0x1a'),'props':{'title':_0x5e63('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5e63('0x5'),'type':_0x5e63('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5e63('0x1d')](_0x5e63('0x1e'))?JSON[_0x5e63('0x1f')](this['getDataValue']('onlineForm')):{};},'set':function(_0x338cb8){return this[_0x5e63('0x20')](_0x5e63('0x1e'),JSON[_0x5e63('0x19')](_0x338cb8));}},'offlineForm':{'type':Sequelize[_0x5e63('0x11')],'defaultValue':function(){return JSON[_0x5e63('0x19')]({'items':[{'type':_0x5e63('0x1a'),'props':{'title':_0x5e63('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5e63('0x5'),'type':_0x5e63('0x5')},'variable':null},{'type':_0x5e63('0x21'),'config':{'placeholder':_0x5e63('0x22')},'props':{'title':_0x5e63('0x22'),'helpText':_0x5e63('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x5e63('0x1d')]('offlineForm')?JSON[_0x5e63('0x1f')](this[_0x5e63('0x1d')](_0x5e63('0x24'))):{};},'set':function(_0x91f182){return this[_0x5e63('0x20')]('offlineForm',JSON[_0x5e63('0x19')](_0x91f182));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5e63('0x25')]();}},'autoclose':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5e63('0x3')]},'forwardOffline':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x26')},'waitingMessage':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0x2b')},'sendUnmanaged':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5e63('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5e63('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x5e63('0x2d')},'verticalAlignment':{'type':Sequelize[_0x5e63('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x2e')},'defaultTitle':{'type':Sequelize[_0x5e63('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5e63('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5e63('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5e63('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5e63('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':_0x5e63('0x30')},'systemAvatar':{'type':Sequelize[_0x5e63('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5e63('0x8')],'comment':_0x5e63('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5e63('0x32'),'set':function(_0xc90177){if(!_0xc90177)this[_0x5e63('0x20')](_0x5e63('0x33'),null);this['setDataValue'](_0x5e63('0x34'),_0xc90177);}},'vidaooEscalation':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x5e63('0x3')],'allowNull':![],'defaultValue':_0x5e63('0x35')},'vidaooNote':{'type':Sequelize[_0x5e63('0x3')],'defaultValue':function(){return _0x5e63('0x36');}},'vidaooMetadata':{'type':Sequelize[_0x5e63('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5e63('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5e63('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 995e8be..4cc8b6d 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 _0x41a4=['SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','x-real-ip','color_button','backgroundColor','addApplications','getApplications','addProactiveActions','ChatProactiveAction','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','get','ChatWebsites','UserProfileResource','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','pick','ChatWebsiteId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','../../config/license/util','getLicense','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','headers','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','Start','startRouting','EventManager','offline','files','ValidationError','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x41a4,0x16c));var _0x441a=function(_0x20dc1c,_0x21d9e8){_0x20dc1c=_0x20dc1c-0x0;var _0x108360=_0x41a4[_0x20dc1c];return _0x108360;};'use strict';var emlformat=require(_0x441a('0x0'));var rimraf=require(_0x441a('0x1'));var zipdir=require(_0x441a('0x2'));var jsonpatch=require(_0x441a('0x3'));var rp=require(_0x441a('0x4'));var moment=require('moment');var BPromise=require(_0x441a('0x5'));var Mustache=require(_0x441a('0x6'));var util=require(_0x441a('0x7'));var path=require('path');var sox=require(_0x441a('0x8'));var csv=require(_0x441a('0x9'));var ejs=require(_0x441a('0xa'));var fs=require('fs');var fs_extra=require(_0x441a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x441a('0xc'));var jsforce=require(_0x441a('0xd'));var deskjs=require(_0x441a('0xe'));var toCsv=require(_0x441a('0x9'));var querystring=require('querystring');var Papa=require(_0x441a('0xf'));var Redis=require(_0x441a('0x10'));var authService=require(_0x441a('0x11'));var qs=require(_0x441a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x441a('0x13'));var logger=require('../../config/logger')(_0x441a('0x14'));var utils=require(_0x441a('0x15'));var config=require(_0x441a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x441a('0x17'))['db'];config[_0x441a('0x18')]=_[_0x441a('0x19')](config[_0x441a('0x18')],{'host':_0x441a('0x1a'),'port':0x18eb});var socket=require(_0x441a('0x1b'))(new Redis(config[_0x441a('0x18')]));require(_0x441a('0x1c'))['register'](socket);var jayson=require(_0x441a('0x1d'));var client=jayson[_0x441a('0x1e')][_0x441a('0x1f')]({'port':0x232c});var client9002=jayson[_0x441a('0x1e')][_0x441a('0x1f')]({'port':0x232a});var client9003=jayson[_0x441a('0x1e')][_0x441a('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0x441a('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x5a42b5,_0x2be644,_0x248d82,_0x1ab3b3){return new BPromise(function(_0xcaecba,_0x3b26cf){var _0x3a47a5=_0x1ab3b3||client;return _0x3a47a5[_0x441a('0x20')](_0x5a42b5,_0x248d82)[_0x441a('0x21')](function(_0x66cc87){logger[_0x441a('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x2be644,_0x441a('0x23'));logger[_0x441a('0x24')](_0x441a('0x25'),_0x2be644,_0x441a('0x23'),JSON[_0x441a('0x26')](_0x66cc87));if(_0x66cc87['error']){if(_0x66cc87['error']['code']===0x1f4){logger[_0x441a('0x27')](_0x441a('0x28'),_0x2be644,_0x66cc87[_0x441a('0x27')][_0x441a('0x29')]);return _0x3b26cf(_0x66cc87[_0x441a('0x27')][_0x441a('0x29')]);}logger[_0x441a('0x27')](_0x441a('0x28'),_0x2be644,_0x66cc87[_0x441a('0x27')][_0x441a('0x29')]);return _0xcaecba(_0x66cc87[_0x441a('0x27')]['message']);}else{logger[_0x441a('0x22')](_0x441a('0x28'),_0x2be644,_0x441a('0x23'));_0xcaecba(_0x66cc87[_0x441a('0x2a')][_0x441a('0x29')]);}})[_0x441a('0x2b')](function(_0x5150b1){logger[_0x441a('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x2be644,_0x5150b1);_0x3b26cf(_0x5150b1);});});}function respondWithStatusCode(_0x49716d,_0x1a385b){_0x1a385b=_0x1a385b||0xcc;return function(_0x25deb7){if(_0x25deb7){return _0x49716d[_0x441a('0x2c')](_0x1a385b);}return _0x49716d['status'](_0x1a385b)[_0x441a('0x2d')]();};}function respondWithResult(_0x467a3c,_0x1b899e){_0x1b899e=_0x1b899e||0xc8;return function(_0x27886e){if(_0x27886e){return _0x467a3c[_0x441a('0x2e')](_0x1b899e)[_0x441a('0x2f')](_0x27886e);}};}function respondWithFilteredResult(_0x3a4508,_0x3ef617){return function(_0x260fd6){if(_0x260fd6){var _0x8b4023=typeof _0x3ef617[_0x441a('0x30')]==='undefined'&&typeof _0x3ef617[_0x441a('0x31')]===_0x441a('0x32');var _0x12808f=_0x260fd6['count'];var _0xffece2=_0x8b4023?0x0:_0x3ef617['offset'];var _0x59a000=_0x8b4023?_0x260fd6[_0x441a('0x33')]:_0x3ef617[_0x441a('0x30')]+_0x3ef617[_0x441a('0x31')];var _0x577228;if(_0x59a000>=_0x12808f){_0x59a000=_0x12808f;_0x577228=0xc8;}else{_0x577228=0xce;}_0x3a4508[_0x441a('0x2e')](_0x577228);return _0x3a4508[_0x441a('0x34')](_0x441a('0x35'),_0xffece2+'-'+_0x59a000+'/'+_0x12808f)[_0x441a('0x2f')](_0x260fd6);}return null;};}function patchUpdates(_0x308e6b){return function(_0x43eec1){try{jsonpatch['apply'](_0x43eec1,_0x308e6b,!![]);}catch(_0x324196){return BPromise['reject'](_0x324196);}return _0x43eec1[_0x441a('0x36')]();};}function saveUpdates(_0xae68c9,_0xf1913c){return function(_0x5dbf7e){if(_0x5dbf7e){return _0x5dbf7e[_0x441a('0x37')](_0xae68c9)['then'](function(_0x556f6a){return _0x556f6a;});}return null;};}function removeEntity(_0xdfdcf9,_0x590eaa){return function(_0x14e6b9){if(_0x14e6b9){return _0x14e6b9[_0x441a('0x38')]()[_0x441a('0x21')](function(){var _0x982fec=_0x14e6b9[_0x441a('0x39')]({'plain':!![]});var _0x40a137=_0x441a('0x3a');return db[_0x441a('0x3b')][_0x441a('0x38')]({'where':{'type':_0x40a137,'resourceId':_0x982fec['id']}})[_0x441a('0x21')](function(){return _0x14e6b9;});})['then'](function(){_0xdfdcf9[_0x441a('0x2e')](0xcc)[_0x441a('0x2d')]();});}};}function handleEntityNotFound(_0x523f86,_0x28c5ed){return function(_0x349126){if(!_0x349126){_0x523f86[_0x441a('0x2c')](0x194);}return _0x349126;};}function handleError(_0x210d93,_0x113253){_0x113253=_0x113253||0x1f4;return function(_0x1f681e){logger[_0x441a('0x27')](_0x1f681e['stack']);if(_0x1f681e[_0x441a('0x3c')]){delete _0x1f681e[_0x441a('0x3c')];}_0x210d93[_0x441a('0x2e')](_0x113253)[_0x441a('0x3d')](_0x1f681e);};}exports['index']=function(_0x20607c,_0x4135a9){var _0x16b36d={'include':[{'model':db['Pause'],'as':_0x441a('0x3e')}]},_0xb8263={},_0x3f8627={'count':0x0,'rows':[]};var _0x510ea1=_[_0x441a('0x3f')](db[_0x441a('0x40')][_0x441a('0x41')],function(_0x1f98d6){return{'name':_0x1f98d6[_0x441a('0x42')],'type':_0x1f98d6[_0x441a('0x43')][_0x441a('0x44')]};});_0xb8263[_0x441a('0x45')]=_[_0x441a('0x3f')](_0x510ea1,_0x441a('0x3c'));_0xb8263[_0x441a('0x46')]=_[_0x441a('0x47')](_0x20607c[_0x441a('0x46')]);_0xb8263['filters']=_[_0x441a('0x48')](_0xb8263[_0x441a('0x45')],_0xb8263['query']);_0x16b36d[_0x441a('0x49')]=_[_0x441a('0x48')](_0xb8263['model'],qs[_0x441a('0x4a')](_0x20607c['query'][_0x441a('0x4a')]));_0x16b36d[_0x441a('0x49')]=_0x16b36d[_0x441a('0x49')][_0x441a('0x4b')]?_0x16b36d[_0x441a('0x49')]:_0xb8263[_0x441a('0x45')];if(!_0x20607c[_0x441a('0x46')][_0x441a('0x4c')](_0x441a('0x4d'))){_0x16b36d[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x20607c[_0x441a('0x46')][_0x441a('0x31')]);_0x16b36d[_0x441a('0x30')]=qs['offset'](_0x20607c[_0x441a('0x46')]['offset']);}_0x16b36d[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x20607c[_0x441a('0x46')][_0x441a('0x4f')]);_0x16b36d[_0x441a('0x50')]=qs[_0x441a('0x51')](_['pick'](_0x20607c[_0x441a('0x46')],_0xb8263[_0x441a('0x51')]),_0x510ea1);if(_0x20607c['query'][_0x441a('0x52')]){_0x16b36d[_0x441a('0x50')]=_[_0x441a('0x53')](_0x16b36d[_0x441a('0x50')],{'$or':_['map'](_0x510ea1,function(_0x336cef){if(_0x336cef[_0x441a('0x43')]!==_0x441a('0x54')){var _0x14fe91={};_0x14fe91[_0x336cef[_0x441a('0x3c')]]={'$like':'%'+_0x20607c[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x14fe91;}})});}_0x16b36d=_[_0x441a('0x53')]({},_0x16b36d,_0x20607c[_0x441a('0x55')]);var _0x5a94fd={'where':_0x16b36d[_0x441a('0x50')]};return db[_0x441a('0x40')][_0x441a('0x33')](_0x5a94fd)['then'](function(_0x3e5421){_0x3f8627[_0x441a('0x33')]=_0x3e5421;if(_0x20607c[_0x441a('0x46')][_0x441a('0x56')]){_0x16b36d[_0x441a('0x57')]=[{'all':!![]}];}return db[_0x441a('0x40')][_0x441a('0x58')](_0x16b36d);})['then'](function(_0x3b5f98){_0x3f8627[_0x441a('0x59')]=_0x3b5f98;return _0x3f8627;})[_0x441a('0x21')](respondWithFilteredResult(_0x4135a9,_0x16b36d))['catch'](handleError(_0x4135a9,null));};exports[_0x441a('0x5a')]=function(_0x266955,_0x5f2b7a){var _0xda4cf7={'raw':![],'where':{'id':_0x266955['params']['id']},'include':[{'model':db[_0x441a('0x5b')],'as':'mandatoryDispositionPause'}]},_0x579648={};_0x579648['model']=_['keys'](db[_0x441a('0x40')]['rawAttributes']);_0x579648[_0x441a('0x46')]=_[_0x441a('0x47')](_0x266955[_0x441a('0x46')]);_0x579648['filters']=_[_0x441a('0x48')](_0x579648[_0x441a('0x45')],_0x579648[_0x441a('0x46')]);_0xda4cf7[_0x441a('0x49')]=_[_0x441a('0x48')](_0x579648[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x266955[_0x441a('0x46')][_0x441a('0x4a')]));_0xda4cf7[_0x441a('0x49')]=_0xda4cf7[_0x441a('0x49')][_0x441a('0x4b')]?_0xda4cf7[_0x441a('0x49')]:_0x579648[_0x441a('0x45')];if(_0x266955['query'][_0x441a('0x56')]){_0xda4cf7[_0x441a('0x57')]=[{'all':!![]}];}_0xda4cf7=_[_0x441a('0x53')]({},_0xda4cf7,_0x266955[_0x441a('0x55')]);return db['ChatWebsite'][_0x441a('0x5c')](_0xda4cf7)['then'](handleEntityNotFound(_0x5f2b7a,null))[_0x441a('0x21')](respondWithResult(_0x5f2b7a,null))['catch'](handleError(_0x5f2b7a,null));};exports['create']=function(_0x357a63,_0x51a812){return db[_0x441a('0x40')]['create'](_0x357a63[_0x441a('0x5d')],{})[_0x441a('0x21')](function(_0xf26830){var _0x3eee54=_0x357a63[_0x441a('0x5e')][_0x441a('0x39')]({'plain':!![]});if(!_0x3eee54)throw new Error(_0x441a('0x5f'));if(_0x3eee54[_0x441a('0x60')]===_0x441a('0x5e')){var _0x307eeb=_0xf26830[_0x441a('0x39')]({'plain':!![]});var _0xc940d0=_0x441a('0x3a');return db[_0x441a('0x61')][_0x441a('0x5c')]({'where':{'name':_0xc940d0,'userProfileId':_0x3eee54[_0x441a('0x62')]},'raw':!![]})[_0x441a('0x21')](function(_0x1130a0){if(_0x1130a0&&_0x1130a0[_0x441a('0x63')]===0x0){return db[_0x441a('0x3b')][_0x441a('0x64')]({'name':_0x307eeb[_0x441a('0x3c')],'resourceId':_0x307eeb['id'],'type':_0x1130a0['name'],'sectionId':_0x1130a0['id']},{})[_0x441a('0x21')](function(){return _0xf26830;});}else{return _0xf26830;}})[_0x441a('0x2b')](function(_0x5cf760){logger[_0x441a('0x27')](_0x441a('0x65'),_0x5cf760);throw _0x5cf760;});}return _0xf26830;})[_0x441a('0x21')](respondWithResult(_0x51a812,0xc9))[_0x441a('0x2b')](handleError(_0x51a812,null));};exports[_0x441a('0x37')]=function(_0x129123,_0x449e5a){if(_0x129123[_0x441a('0x5d')]['id']){delete _0x129123[_0x441a('0x5d')]['id'];}return db[_0x441a('0x40')]['find']({'where':{'id':_0x129123[_0x441a('0x66')]['id']},'include':[{'model':db[_0x441a('0x5b')],'as':'mandatoryDispositionPause'}]})[_0x441a('0x21')](handleEntityNotFound(_0x449e5a,null))[_0x441a('0x21')](saveUpdates(_0x129123['body'],null))[_0x441a('0x21')](respondWithResult(_0x449e5a,null))[_0x441a('0x2b')](handleError(_0x449e5a,null));};exports[_0x441a('0x38')]=function(_0x258006,_0x5a3453){return db[_0x441a('0x40')]['find']({'where':{'id':_0x258006[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x5a3453,null))[_0x441a('0x21')](removeEntity(_0x5a3453,null))[_0x441a('0x2b')](handleError(_0x5a3453,null));};exports['describe']=function(_0x11ee7f,_0x127e42){return db[_0x441a('0x40')][_0x441a('0x67')]()['then'](respondWithResult(_0x127e42,null))['catch'](handleError(_0x127e42,null));};exports[_0x441a('0x68')]=function(_0x915d9c,_0x2cec2e,_0x6320dc){if(_0x915d9c['body']['id']){delete _0x915d9c['body']['id'];}return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x915d9c[_0x441a('0x66')]['id']}})['then'](handleEntityNotFound(_0x2cec2e,null))[_0x441a('0x21')](function(_0x32a0bd){if(_0x32a0bd){_0x915d9c['body']['ChatWebsiteId']=_0x32a0bd['id'];return db[_0x441a('0x69')]['create'](_0x915d9c[_0x441a('0x5d')]);}})['then'](respondWithResult(_0x2cec2e,null))['catch'](handleError(_0x2cec2e,null));};exports[_0x441a('0x6a')]=function(_0x61086b,_0x18a99c,_0xf7f45f){var _0x2b149f={'raw':![],'where':{}};var _0x477f24={};var _0x48bb86={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x61086b['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x18a99c,null))['then'](function(_0x442a63){if(_0x442a63){_0x477f24[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0x69')][_0x441a('0x41')]);_0x477f24['query']=_[_0x441a('0x47')](_0x61086b[_0x441a('0x46')]);_0x477f24[_0x441a('0x51')]=_[_0x441a('0x48')](_0x477f24[_0x441a('0x45')],_0x477f24[_0x441a('0x46')]);_0x2b149f[_0x441a('0x49')]=_['intersection'](_0x477f24[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x61086b[_0x441a('0x46')][_0x441a('0x4a')]));_0x2b149f[_0x441a('0x49')]=_0x2b149f['attributes'][_0x441a('0x4b')]?_0x2b149f[_0x441a('0x49')]:_0x477f24[_0x441a('0x45')];if(!_0x61086b['query'][_0x441a('0x4c')](_0x441a('0x4d'))){_0x2b149f[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x61086b[_0x441a('0x46')]['limit']);_0x2b149f[_0x441a('0x30')]=qs['offset'](_0x61086b[_0x441a('0x46')]['offset']);}_0x2b149f[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x61086b['query'][_0x441a('0x4f')]);_0x2b149f[_0x441a('0x50')]=qs['filters'](_[_0x441a('0x6c')](_0x61086b['query'],_0x477f24[_0x441a('0x51')]));_0x2b149f[_0x441a('0x50')][_0x441a('0x6d')]=_0x442a63['id'];if(_0x61086b['query'][_0x441a('0x52')]){_0x2b149f[_0x441a('0x50')]=_['merge'](_0x2b149f['where'],{'$or':_[_0x441a('0x3f')](_0x2b149f['attributes'],function(_0x2c4608){var _0x474875={};_0x474875[_0x2c4608]={'$like':'%'+_0x61086b[_0x441a('0x46')]['filter']+'%'};return _0x474875;})});}_0x2b149f=_['merge']({},_0x2b149f,_0x61086b[_0x441a('0x55')]);return db[_0x441a('0x69')][_0x441a('0x33')]({'where':_0x2b149f[_0x441a('0x50')]})['then'](function(_0x24c083){_0x48bb86[_0x441a('0x33')]=_0x24c083;if(_0x61086b[_0x441a('0x46')][_0x441a('0x56')]){_0x2b149f[_0x441a('0x57')]=[{'all':!![]}];}return db[_0x441a('0x69')][_0x441a('0x58')](_0x2b149f);})[_0x441a('0x21')](function(_0x2c952f){_0x48bb86['rows']=_0x2c952f;return _0x48bb86;});}})[_0x441a('0x21')](respondWithFilteredResult(_0x18a99c,_0x2b149f))[_0x441a('0x2b')](handleError(_0x18a99c,null));};exports[_0x441a('0x6e')]=function(_0x2273e5,_0x12f908,_0x2cbbeb){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x2273e5[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x12f908,null))[_0x441a('0x21')](function(_0x227de3){if(_0x227de3){return _0x227de3[_0x441a('0x6e')](_0x2273e5['query']['ids']);}})[_0x441a('0x21')](respondWithStatusCode(_0x12f908,null))[_0x441a('0x2b')](handleError(_0x12f908,null));};exports[_0x441a('0x6f')]=function(_0x6441b,_0x13cc2a,_0x69e727){if(_0x6441b[_0x441a('0x5d')]['id']){delete _0x6441b[_0x441a('0x5d')]['id'];}return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x6441b[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x13cc2a,null))[_0x441a('0x21')](function(_0x19b862){if(_0x19b862){_0x6441b[_0x441a('0x5d')][_0x441a('0x6d')]=_0x19b862['id'];return db[_0x441a('0x70')][_0x441a('0x64')](_0x6441b[_0x441a('0x5d')]);}})[_0x441a('0x21')](respondWithResult(_0x13cc2a,null))[_0x441a('0x2b')](handleError(_0x13cc2a,null));};exports['getAnswers']=function(_0x57d2de,_0x3053c0,_0x567361){var _0x449299={'raw':![],'where':{}};var _0x53c939={};var _0x12f85a={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x57d2de['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x3053c0,null))[_0x441a('0x21')](function(_0x102320){if(_0x102320){_0x53c939['model']=_['keys'](db[_0x441a('0x70')][_0x441a('0x41')]);_0x53c939[_0x441a('0x46')]=_[_0x441a('0x47')](_0x57d2de['query']);_0x53c939[_0x441a('0x51')]=_[_0x441a('0x48')](_0x53c939[_0x441a('0x45')],_0x53c939['query']);_0x449299['attributes']=_[_0x441a('0x48')](_0x53c939[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x57d2de[_0x441a('0x46')]['fields']));_0x449299[_0x441a('0x49')]=_0x449299[_0x441a('0x49')][_0x441a('0x4b')]?_0x449299[_0x441a('0x49')]:_0x53c939[_0x441a('0x45')];if(!_0x57d2de['query'][_0x441a('0x4c')](_0x441a('0x4d'))){_0x449299['limit']=qs['limit'](_0x57d2de[_0x441a('0x46')]['limit']);_0x449299[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x57d2de['query']['offset']);}_0x449299[_0x441a('0x4e')]=qs['sort'](_0x57d2de[_0x441a('0x46')][_0x441a('0x4f')]);_0x449299[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x57d2de[_0x441a('0x46')],_0x53c939[_0x441a('0x51')]));_0x449299[_0x441a('0x50')]['ChatWebsiteId']=_0x102320['id'];if(_0x57d2de['query'][_0x441a('0x52')]){_0x449299[_0x441a('0x50')]=_['merge'](_0x449299[_0x441a('0x50')],{'$or':_[_0x441a('0x3f')](_0x449299['attributes'],function(_0x54ed5b){var _0x36b602={};_0x36b602[_0x54ed5b]={'$like':'%'+_0x57d2de[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x36b602;})});}_0x449299=_['merge']({},_0x449299,_0x57d2de['options']);return db[_0x441a('0x70')][_0x441a('0x33')]({'where':_0x449299['where']})['then'](function(_0x5ecb7a){_0x12f85a[_0x441a('0x33')]=_0x5ecb7a;if(_0x57d2de[_0x441a('0x46')]['includeAll']){_0x449299['include']=[{'all':!![]}];}return db[_0x441a('0x70')][_0x441a('0x58')](_0x449299);})[_0x441a('0x21')](function(_0x1c91c9){_0x12f85a[_0x441a('0x59')]=_0x1c91c9;return _0x12f85a;});}})['then'](respondWithFilteredResult(_0x3053c0,_0x449299))[_0x441a('0x2b')](handleError(_0x3053c0,null));};exports[_0x441a('0x71')]=function(_0x21d46b,_0x4516a0,_0x25c91b){return db[_0x441a('0x40')]['find']({'where':{'id':_0x21d46b[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x4516a0,null))[_0x441a('0x21')](function(_0x5ae275){if(_0x5ae275){return _0x5ae275[_0x441a('0x71')](_0x21d46b[_0x441a('0x46')][_0x441a('0x72')]);}})['then'](respondWithStatusCode(_0x4516a0,null))[_0x441a('0x2b')](handleError(_0x4516a0,null));};exports[_0x441a('0x73')]=function(_0x2a99a7,_0xa6728f,_0x4d7b2b){_0x2a99a7[_0x441a('0x5d')][_0x441a('0x74')]=_0x2a99a7[_0x441a('0x75')][_0x441a('0x76')];return db['ChatWebsite'][_0x441a('0x5c')]({'where':{'id':_0x2a99a7['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0xa6728f,null))['then'](saveUpdates(_0x2a99a7[_0x441a('0x5d')],null))['then'](respondWithResult(_0xa6728f,null))['catch'](handleError(_0xa6728f,null));};exports[_0x441a('0x77')]=function(_0x55abcb,_0x2fb56d,_0x3155de){_0x55abcb[_0x441a('0x5d')][_0x441a('0x78')]=_0x55abcb[_0x441a('0x75')][_0x441a('0x76')];return db['ChatWebsite'][_0x441a('0x5c')]({'where':{'id':_0x55abcb['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x2fb56d,null))[_0x441a('0x21')](saveUpdates(_0x55abcb[_0x441a('0x5d')],null))['then'](respondWithResult(_0x2fb56d,null))[_0x441a('0x2b')](handleError(_0x2fb56d,null));};exports['addCustomerAvatar']=function(_0x5c23f6,_0x54ee47,_0x157b05){_0x5c23f6[_0x441a('0x5d')][_0x441a('0x79')]=_0x5c23f6['file'][_0x441a('0x76')];return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x5c23f6[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x54ee47,null))['then'](saveUpdates(_0x5c23f6[_0x441a('0x5d')],null))['then'](respondWithResult(_0x54ee47,null))['catch'](handleError(_0x54ee47,null));};exports[_0x441a('0x7a')]=function(_0x149ff7,_0x5101e3,_0xdb9fb0){_0x149ff7[_0x441a('0x5d')][_0x441a('0x7b')]=_0x149ff7[_0x441a('0x75')]['filename'];return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x149ff7[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x5101e3,null))[_0x441a('0x21')](saveUpdates(_0x149ff7[_0x441a('0x5d')],null))[_0x441a('0x21')](respondWithResult(_0x5101e3,null))[_0x441a('0x2b')](handleError(_0x5101e3,null));};exports['getLogo']=function(_0x5a2497,_0x47bedf,_0x1de094){var _0x539255=path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/logos/default_logo.svg');var _0x3bf79d={'where':{'id':_0x5a2497[_0x441a('0x66')]['id']},'attributes':['id',_0x441a('0x74')],'raw':!![]};var _0x45d06e=![];return require(_0x441a('0x7e'))[_0x441a('0x7f')]()[_0x441a('0x21')](function(_0x357d9e){if(_0x357d9e){_0x45d06e=_0x357d9e['custom'];}})[_0x441a('0x21')](function(){return db[_0x441a('0x40')][_0x441a('0x5c')](_0x3bf79d);})[_0x441a('0x21')](handleEntityNotFound(_0x47bedf,null))['then'](function(_0x3c0bd1){if(_0x3c0bd1){if(!_['isNil'](_0x3c0bd1[_0x441a('0x74')])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config['root'],_0x441a('0x81'),_0x3c0bd1[_0x441a('0x74')]))&&_0x45d06e){_0x539255=path[_0x441a('0x7c')](config['root'],'server/files/images/logos/',_0x3c0bd1['sitepic']);}}return _0x47bedf[_0x441a('0x82')](_0x539255);}})[_0x441a('0x2b')](handleError(_0x47bedf,null));};exports['getAvatar']=function(_0x3a2ec9,_0x3dce81,_0xc98990){var _0x57589e=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x83'));var _0x3933af={'where':{'id':_0x3a2ec9['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x441a('0x40')][_0x441a('0x5c')](_0x3933af)[_0x441a('0x21')](handleEntityNotFound(_0x3dce81,null))[_0x441a('0x21')](function(_0x5caca6){if(_0x5caca6){if(!_[_0x441a('0x84')](_0x5caca6[_0x441a('0x78')])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/avatars/',_0x5caca6[_0x441a('0x78')]))){_0x57589e=path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/avatars/',_0x5caca6['agentAvatar']);}}return _0x3dce81[_0x441a('0x82')](_0x57589e);}})[_0x441a('0x2b')](handleError(_0x3dce81,null));};exports[_0x441a('0x85')]=function(_0x575382,_0x50ecc1,_0x2652d0){var _0x2d3dd5=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x86'));var _0x599339={'where':{'id':_0x575382[_0x441a('0x66')]['id']},'attributes':['id',_0x441a('0x79'),_0x441a('0x87')],'raw':!![]};return db[_0x441a('0x40')][_0x441a('0x5c')](_0x599339)[_0x441a('0x21')](handleEntityNotFound(_0x50ecc1,null))[_0x441a('0x21')](function(_0x2243b3){if(_0x2243b3){if(!_[_0x441a('0x84')](_0x2243b3[_0x441a('0x79')])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x88'),_0x2243b3[_0x441a('0x79')]))&&_0x2243b3['showCustomerAvatar']){_0x2d3dd5=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x88'),_0x2243b3[_0x441a('0x79')]);}}return _0x50ecc1[_0x441a('0x82')](_0x2d3dd5);}})[_0x441a('0x2b')](handleError(_0x50ecc1,null));};exports[_0x441a('0x89')]=function(_0x44535d,_0x5d4912,_0x2c766f){var _0x123ea0=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x8a'));var _0x15a86e={'where':{'id':_0x44535d[_0x441a('0x66')]['id']},'attributes':['id',_0x441a('0x7b')],'raw':!![]};return db[_0x441a('0x40')][_0x441a('0x5c')](_0x15a86e)[_0x441a('0x21')](handleEntityNotFound(_0x5d4912,null))[_0x441a('0x21')](function(_0x156b8a){if(_0x156b8a){if(!_['isNil'](_0x156b8a['systemAvatar'])){if(fs[_0x441a('0x80')](path[_0x441a('0x7c')](config[_0x441a('0x7d')],'server/files/images/avatars/',_0x156b8a[_0x441a('0x7b')]))){_0x123ea0=path[_0x441a('0x7c')](config[_0x441a('0x7d')],_0x441a('0x88'),_0x156b8a[_0x441a('0x7b')]);}}return _0x5d4912[_0x441a('0x82')](_0x123ea0);}})[_0x441a('0x2b')](handleError(_0x5d4912,null));};exports['notify']=function(_0x13c2ad,_0x17066d,_0x3506a9){var _0x5855a6=require('user-agent-parser');var _0xfc9e41=new _0x5855a6();var _0x4296fb=_0xfc9e41['setUA'](_0x13c2ad[_0x441a('0x8b')][_0x441a('0x8c')])['getResult']();var _0x1df5bb={'body':_0x13c2ad['body'],'channel':_0x441a('0x8d')};var _0x1f9826=[];var _0x4f1045=[];var _0x2ceead={};var _0x5e781f=![];return db[_0x441a('0x8e')]['describe']()[_0x441a('0x21')](function(_0x348e27){if(!_0x348e27){throw new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x90'));}_0x1f9826=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x348e27),[_0x441a('0x92'),_0x441a('0x93')]);_0x4f1045=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x348e27),[_0x441a('0x92'),'updatedAt',_0x441a('0x94'),_0x441a('0x95')]);if(_0x13c2ad[_0x441a('0x5d')]['id']){delete _0x13c2ad['body']['id'];}if(_[_0x441a('0x84')](_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')])){throw new db['Sequelize']['ValidationError'](_0x441a('0x97'));}if(_[_0x441a('0x84')](_0x13c2ad[_0x441a('0x5d')][_0x441a('0x5d')])||_0x13c2ad[_0x441a('0x5d')]['body']===''){throw new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x98'));}if(_['isNil'](_0x13c2ad['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x441a('0x99')+_0x4f1045);}if(!_[_0x441a('0x9a')](_0x4f1045,_0x13c2ad['body'][_0x441a('0x9b')])){throw new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x9c')+_0x4f1045);}_0x2ceead[_0x13c2ad['body'][_0x441a('0x9b')]]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')];})[_0x441a('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x13c2ad['params']['id']},'include':[{'model':db[_0x441a('0x9d')],'as':_0x441a('0x9e'),'include':[{'model':db['CmContact'],'as':_0x441a('0x9f'),'where':_0x2ceead,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x441a('0xa0')],'as':_0x441a('0xa1')}]});})[_0x441a('0x21')](handleEntityNotFound(_0x17066d,null))[_0x441a('0x21')](function(_0xd69ed0){if(_0xd69ed0&&_0xd69ed0[_0x441a('0x9e')]){_0x1df5bb[_0x441a('0xa2')]=_0xd69ed0;_0x1df5bb[_0x441a('0xa3')]=_0xd69ed0['Applications'];_0x1df5bb[_0x441a('0xa4')]=_0xd69ed0[_0x441a('0x9e')];_0x1df5bb['applications']=_['orderBy'](_0x1df5bb[_0x441a('0xa3')],[_0x441a('0xa5')],['asc']);if(_0x1df5bb[_0x441a('0xa2')]['Applications']){delete _0x1df5bb[_0x441a('0xa2')]['Applications'];}if(_0x1df5bb['account'][_0x441a('0x9e')]&&_0x1df5bb['account'][_0x441a('0x9e')][_0x441a('0x9f')][_0x441a('0x4b')]){return _0x1df5bb[_0x441a('0xa2')][_0x441a('0x9e')][_0x441a('0x9f')][0x0];}var _0x1aad3e=_[_0x441a('0x19')](_0x13c2ad[_0x441a('0x5d')],{'firstName':_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')],'ListId':_0xd69ed0['ListId']});_0x1aad3e[_0x13c2ad['body'][_0x441a('0x9b')]]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0x96')];return db['CmContact']['create'](_0x1aad3e,{'fields':_0x1f9826,'raw':!![]});}})[_0x441a('0x21')](handleEntityNotFound(_0x17066d,null))[_0x441a('0x21')](function(_0x423145){_0x1df5bb[_0x441a('0xa6')]=_0x423145;var _0x815654=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xa7')];if(_0x13c2ad[_0x441a('0x8b')]['cf-connecting-ip']){_0x815654=_0x13c2ad[_0x441a('0x8b')][_0x441a('0xa8')];}else if(_0x13c2ad[_0x441a('0x8b')][_0x441a('0xa9')]){_0x815654=_[_0x441a('0xaa')](_0x13c2ad['headers']['x-forwarded-for'][_0x441a('0xab')](','));}if(_0x423145){var _0x5e3b29={'ContactId':_0x423145['id'],'ChatWebsiteId':_0x13c2ad[_0x441a('0x66')]['id'],'from':(_0x423145[_0x441a('0xac')]||'')+'\x20'+(_0x423145['lastName']||''),'customerIp':_0x815654,'customerPort':_0x13c2ad[_0x441a('0x8b')][_0x441a('0xad')]?_0x13c2ad[_0x441a('0x8b')][_0x441a('0xad')]:null,'referer':_0x13c2ad[_0x441a('0x5d')][_0x441a('0xae')],'browserName':_0x4296fb[_0x441a('0xaf')][_0x441a('0x3c')]&&_0x4296fb['browser'][_0x441a('0xb0')]?util[_0x441a('0xb1')](_0x441a('0xb2'),_0x4296fb[_0x441a('0xaf')][_0x441a('0x3c')],_0x4296fb[_0x441a('0xaf')][_0x441a('0xb0')]):_0x441a('0xb3'),'browserVersion':_0x4296fb[_0x441a('0xaf')]['version']||_0x441a('0xb3'),'osName':util[_0x441a('0xb1')]('%s\x20%s',_0x4296fb['os'][_0x441a('0x3c')],_0x4296fb['os'][_0x441a('0xb0')]),'osVersion':_0x4296fb['os'][_0x441a('0xb0')],'deviceModel':_0x4296fb[_0x441a('0xb4')]['model']&&_0x4296fb[_0x441a('0xb4')][_0x441a('0xb5')]?util[_0x441a('0xb1')](_0x441a('0xb6'),_0x4296fb[_0x441a('0xb4')][_0x441a('0x45')],_0x4296fb[_0x441a('0xb4')][_0x441a('0xb5')],_0x4296fb[_0x441a('0xb4')][_0x441a('0x43')]):null,'deviceVendor':_0x4296fb[_0x441a('0xb4')][_0x441a('0xb5')],'deviceType':_0x4296fb[_0x441a('0xb4')]['type'],'formData':JSON[_0x441a('0x26')](_0x13c2ad[_0x441a('0x5d')])};var _0x6e09ce={'ChatWebsiteId':_0x13c2ad['params']['id'],'closed':![]};if(_0x13c2ad['body'][_0x441a('0xb7')]){_0x6e09ce[_0x441a('0xb7')]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xb7')];return db[_0x441a('0xb8')][_0x441a('0x5c')]({'where':_0x6e09ce})[_0x441a('0x21')](function(_0x247460){if(_0x247460){return[_0x247460,![]];}_0x5e3b29[_0x441a('0xb7')]=_0x13c2ad['body'][_0x441a('0xb7')];_0x5e3b29[_0x441a('0xb9')]=_0x13c2ad[_0x441a('0x5d')]['externalUrl'];return db[_0x441a('0xb8')][_0x441a('0x64')](_0x5e3b29)['then'](function(_0x3ca7e4){return[_0x3ca7e4,!![]];});});}_0x6e09ce[_0x441a('0xba')]=_0x423145['id'];if(_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbb')]&&_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbb')]['id']){_0x6e09ce['id']=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbb')]['id'];return db[_0x441a('0xb8')][_0x441a('0x5c')]({'where':_0x6e09ce})[_0x441a('0x21')](function(_0x139c8c){if(_0x139c8c){return[_0x139c8c,![]];}return db[_0x441a('0xb8')]['create'](_0x5e3b29)[_0x441a('0x21')](function(_0x4d4db3){return[_0x4d4db3,!![]];});});}return db['ChatInteraction'][_0x441a('0x64')](_0x5e3b29)[_0x441a('0x21')](function(_0x4d43d1){return[_0x4d43d1,!![]];});}})[_0x441a('0xbc')](function(_0x7eb98d,_0x2e5da6){if(_0x7eb98d){_0x5e781f=_0x2e5da6;if(!_0x2e5da6){var _0x5514b7={'from':(_0x1df5bb['contact'][_0x441a('0xac')]||'')+'\x20'+(_0x1df5bb[_0x441a('0xa6')][_0x441a('0xbd')]||'')};if(_0x13c2ad[_0x441a('0x5d')]['threadId']&&_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbe')]&&_0x13c2ad['body']['threadId']!=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbe')]){_0x5514b7[_0x441a('0xb7')]=_0x13c2ad[_0x441a('0x5d')][_0x441a('0xbe')];}return _0x7eb98d[_0x441a('0x37')](_0x5514b7);}else{return _0x7eb98d;}}})['then'](function(_0x271548){_0x1df5bb[_0x441a('0xbb')]=_0x271548['get']({'plain':!![]});_0x1df5bb[_0x441a('0xbb')]['created']=_0x5e781f;if(_0x1df5bb[_0x441a('0xbb')]['created']){if(_0x1df5bb['account'][_0x441a('0xbf')]){_0x1df5bb[_0x441a('0xa3')][_0x441a('0xc0')]({'id':0x0,'priority':_0x1df5bb[_0x441a('0xa3')][_0x441a('0x4b')]+0x1,'app':'close','appdata':_0x441a('0xc1'),'interval':_0x441a('0xc2')});}}return db[_0x441a('0xc3')][_0x441a('0x64')]({'body':_0x13c2ad[_0x441a('0x5d')][_0x441a('0x5d')],'ChatWebsiteId':_0x13c2ad[_0x441a('0x66')]['id'],'ChatInteractionId':_0x271548['id'],'direction':'in','ContactId':_0x1df5bb[_0x441a('0xa6')]['id'],'AttachmentId':_0x13c2ad[_0x441a('0x5d')][_0x441a('0xc4')]});})[_0x441a('0x21')](function(_0x34a6ee){_0x1df5bb[_0x441a('0x29')]=_0x34a6ee;if(_0x1df5bb['interaction'][_0x441a('0xc5')]){return db[_0x441a('0xc6')][_0x441a('0x5c')]({'attributes':['id','name'],'where':{'id':_0x1df5bb[_0x441a('0xbb')][_0x441a('0xc5')]}})[_0x441a('0x21')](function(_0x3b9009){if(_0x3b9009){_0x1df5bb[_0x441a('0xa3')][_0x441a('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3b9009[_0x441a('0x3c')]+','+(_0x1df5bb['account']['waitForTheAssignedAgent']||0xa),'interval':_0x441a('0xc2')});_0x1df5bb['forcedOwnership']=!![];}return respondWithRpcPromise('Start','startRouting',_0x1df5bb);});}return respondWithRpcPromise(_0x441a('0xc8'),_0x441a('0xc9'),_0x1df5bb);})[_0x441a('0x21')](function(_0x2d10ca){respondWithRpcPromise('EventManager',_0x441a('0xca'),{'event':'notify','message':_0x2d10ca},client9002);return _0x2d10ca;})[_0x441a('0x21')](respondWithResult(_0x17066d,null))[_0x441a('0x2b')](handleError(_0x17066d,null));};exports[_0x441a('0xcb')]=function(_0x26278b,_0x1097ca,_0x25b403){var _0x597fe7,_0x48b891,_0x156468;var _0x1ea928=[];var _0x1aa097=[];var _0x3a79f0={};var _0x57f529=_0x26278b[_0x441a('0xcc')]||[];var _0xfb627c=[];var _0xb461dc;return db[_0x441a('0x8e')][_0x441a('0x67')]()[_0x441a('0x21')](function(_0x365dc0){if(!_0x365dc0){throw new db['Sequelize'][(_0x441a('0xcd'))](_0x441a('0x90'));}_0x1aa097=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x365dc0),[_0x441a('0x92'),_0x441a('0x93')]);_0x1ea928=_[_0x441a('0x91')](_[_0x441a('0x47')](_0x365dc0),[_0x441a('0x92'),_0x441a('0x93'),'CompanyId',_0x441a('0x95')]);if(_0x26278b[_0x441a('0x5d')]['id']){delete _0x26278b[_0x441a('0x5d')]['id'];}if(_[_0x441a('0x84')](_0x26278b[_0x441a('0x5d')][_0x441a('0x96')])){throw _0x1097ca[_0x441a('0x2e')](0x1f4)[_0x441a('0x3d')](new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0x97')));}if(_[_0x441a('0x84')](_0x26278b['body'][_0x441a('0x5d')])||_0x26278b['body']['body']===''){throw _0x1097ca[_0x441a('0x2e')](0x1f4)[_0x441a('0x3d')](new db[(_0x441a('0x8f'))][(_0x441a('0xcd'))](_0x441a('0x98')));}if(_['isNil'](_0x26278b[_0x441a('0x5d')][_0x441a('0xce')])){throw _0x1097ca[_0x441a('0x2e')](0x1f4)[_0x441a('0x3d')](new db[(_0x441a('0x8f'))][(_0x441a('0xcd'))](_0x441a('0xcf')+_0x1ea928));}if(!_[_0x441a('0x9a')](_0x1ea928,_0x26278b[_0x441a('0x5d')][_0x441a('0xce')])){throw _0x1097ca['status'](0x1f4)['send'](new db[(_0x441a('0x8f'))]['ValidationError'](_0x441a('0xd0')+_0x1ea928));}_0x3a79f0[_0x26278b[_0x441a('0x5d')][_0x441a('0xce')]]=_0x26278b[_0x441a('0x5d')][_0x441a('0x96')];})[_0x441a('0x21')](function(){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x26278b['params']['id']},'include':[{'model':db[_0x441a('0x9d')],'as':_0x441a('0x9e')},{'model':db[_0x441a('0xd1')],'as':'MailAccount'}]});})[_0x441a('0x21')](handleEntityNotFound(_0x1097ca,null))['then'](function(_0x4e5c46){if(_0x4e5c46&&_0x4e5c46[_0x441a('0x9e')]){_0x48b891=_0x4e5c46;var _0x239907=_[_0x441a('0x19')](_0x26278b[_0x441a('0x5d')],{'firstName':_0x26278b['body'][_0x441a('0x96')],'phone':_0x26278b[_0x441a('0x5d')][_0x441a('0x96')],'ListId':_0x4e5c46[_0x441a('0x95')]});_0x239907[_0x26278b[_0x441a('0x5d')][_0x441a('0xce')]]=_0x26278b[_0x441a('0x5d')][_0x441a('0x96')];return db[_0x441a('0x8e')][_0x441a('0xd2')]({'where':_0x3a79f0,'defaults':_0x239907});}})['spread'](function(_0x47af5a){if(_0x47af5a){_0x156468=_0x47af5a;var _0x45faa4=fs['readFileSync'](path[_0x441a('0x7c')](config['root'],_0x441a('0xd3')),_0x441a('0xd4'));var _0x2d4121=ejs[_0x441a('0xd5')](_0x45faa4,{'body':_[_0x441a('0xd6')](_0x26278b[_0x441a('0x5d')][_0x441a('0x5d')]),'bodyTitle':_0x48b891[_0x441a('0xd7')]});return db['ChatOfflineMessage'][_0x441a('0x64')]({'body':_0x2d4121,'ContactId':_0x47af5a['id'],'ChatWebsiteId':_0x48b891['id']});}})[_0x441a('0x21')](function(_0x1bd505){_0xb461dc=_0x1bd505;if(_0x57f529[_0x441a('0x4b')]){var _0x4d058e=_0x57f529[_0x441a('0x3f')](function(_0x3e2bdb){return{'name':_0x3e2bdb[_0x441a('0xd8')],'basename':_0x3e2bdb['filename'],'type':_0x3e2bdb[_0x441a('0xd9')],'ChatOfflineMessageId':_0x1bd505['id']};});_0xfb627c=_0x4d058e[_0x441a('0x3f')](_0x8231ae=>{var _0x45293c={'filename':_0x8231ae[_0x441a('0x3c')],'path':path['join'](config[_0x441a('0x7d')],_0x441a('0xda'),_0x441a('0xcc'),_0x441a('0xdb'),_0x441a('0xdc'),_0x8231ae[_0x441a('0xdd')])};return _0x45293c;});if(!_0x48b891[_0x441a('0xde')]){return db[_0x441a('0xdf')][_0x441a('0xe0')](function(_0x3aea97){return db[_0x441a('0xe1')][_0x441a('0xe2')](_0x4d058e,{'transaction':_0x3aea97});});}}})[_0x441a('0x21')](function(){if(_0xb461dc){_0x597fe7=_0xb461dc;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x441a('0xe3')],'as':_0x441a('0xe4'),'raw':!![]}]});}})[_0x441a('0x21')](function(_0x1d9f8f){if(_0x1d9f8f&&_0x1d9f8f[_0x441a('0xe4')]&&_0x48b891[_0x441a('0xe5')]&&_0x48b891[_0x441a('0xe6')]){var _0x45fa2c={'tls':{'rejectUnauthorized':![]}};if(_0x1d9f8f[_0x441a('0xe4')][_0x441a('0xe7')]){_0x45fa2c[_0x441a('0xe7')]=_0x1d9f8f[_0x441a('0xe4')][_0x441a('0xe7')];}else{_0x45fa2c[_0x441a('0xe8')]=_0x1d9f8f[_0x441a('0xe4')]['host'];_0x45fa2c['port']=_0x1d9f8f['Smtp'][_0x441a('0xe9')];_0x45fa2c[_0x441a('0xea')]=_0x1d9f8f[_0x441a('0xe4')]['secure'];}if(_0x1d9f8f[_0x441a('0xe4')]['authentication']){_0x45fa2c[_0x441a('0xeb')]={'user':_0x1d9f8f['Smtp'][_0x441a('0x5e')],'pass':_0x1d9f8f[_0x441a('0xe4')]['pass']};}return respondWithRpcPromise(_0x441a('0xec'),_0x441a('0xed'),{'account':_0x45fa2c,'message':{'from':util[_0x441a('0xb1')](_0x441a('0xee'),_0x1d9f8f[_0x441a('0x3c')],_0x1d9f8f['email']||_0x1d9f8f[_0x441a('0xe4')][_0x441a('0x5e')]),'to':_0x48b891['forwardOfflineAddress'],'subject':_0x48b891[_0x441a('0xef')],'html':_0x597fe7[_0x441a('0x5d')],'attachments':_0xfb627c}},client9003)[_0x441a('0x21')](function(){return _0x597fe7;})[_0x441a('0x2b')](function(_0x3b2953){console[_0x441a('0x27')](_0x3b2953);});}})[_0x441a('0x21')](function(){if(_0x48b891&&_0x48b891[_0x441a('0xde')]&&_0x48b891[_0x441a('0xf0')]){var _0x5c278b=[];if(_0x57f529[_0x441a('0x4b')]){_0x5c278b=_0x57f529[_0x441a('0x3f')](function(_0x3c2d61){return{'name':_0x3c2d61['originalname'],'basename':_0x3c2d61[_0x441a('0x76')],'type':_0x3c2d61['mimetype'],'ChatOfflineMessageId':_0xb461dc['id']};});}var _0x29c4ce;if(!_['isNil'](_0x48b891['subjectOffline'])){var _0x5b65b8=_[_0x441a('0x3f')](_0x26278b['body'],function(_0x5c1f7e){return _0x5c1f7e;});var _0x1c204f=_['toPairsIn'](_0x5b65b8)[0x0];var _0x2f3717=_[_0x441a('0xf1')](_0x1c204f,function(_0x4ec31c){return _0x4ec31c;});_0x29c4ce=_0x2f3717[0x1][_0x48b891[_0x441a('0xf2')]];}var _0x205ed0={'from':_0x156468[_0x441a('0xf3')],'firstName':_0x156468[_0x441a('0xac')],'lastName':_0x156468['lastName'],'mapKey':_0x441a('0xf3'),'message':{'from':_0x156468[_0x441a('0xf3')],'to':_0x48b891[_0x441a('0xd1')][_0x441a('0xf3')],'cc':'','subject':_[_0x441a('0x84')](_0x29c4ce)?_0x48b891['offlineMessageSubject']:_0x29c4ce,'messageId':'','sentAt':new Date(),'attach':_0x5c278b['length'],'attachments':_0x5c278b,'originChannel':'Chat','ChatWebsiteId':_0x48b891['id'],'ChatOfflineMessageId':_0x597fe7['id'],'originTo':_0x48b891[_0x441a('0xd1')][_0x441a('0xf3')]},'body':_0x597fe7[_0x441a('0x5d')]};var _0x19e98d={'account':{'id':_0x48b891[_0x441a('0xf0')]},'body':_0x205ed0,'log':_0x441a('0xf4')};return respondWithRpcPromise(_0x441a('0xf4'),_0x441a('0xf5'),_0x19e98d,client9001)['then'](function(){return _0x597fe7;})[_0x441a('0x2b')](function(_0x23dc82){console[_0x441a('0x27')](_0x23dc82);});}return;})[_0x441a('0x21')](function(){if(_0x597fe7){return _0x597fe7;}})['then'](respondWithResult(_0x1097ca,null))[_0x441a('0x2b')](function(_0x59f3ed){console['error'](_0x441a('0x2b'),_0x59f3ed);for(var _0x1a6f3c of _0x57f529){var _0x11e92f=path[_0x441a('0x7c')](config['root'],_0x441a('0xda'),_0x441a('0xcc'),_0x441a('0xdb'),'offline-chat',_0x1a6f3c[_0x441a('0x76')]);fs_extra[_0x441a('0xf6')](_0x11e92f)[_0x441a('0x2b')](function(_0x3db9cf){console[_0x441a('0x27')](_0x441a('0xf7'),_0x11e92f,_0x3db9cf);});}});};exports[_0x441a('0xf8')]=function(_0x2a9d29,_0x5660fc,_0x2bda4a){return db[_0x441a('0xb8')][_0x441a('0x5c')]({'where':{'id':_0x2a9d29['params']['id']}})['then'](handleEntityNotFound(_0x5660fc,null))[_0x441a('0x21')](function(_0x4949ff){if(_0x4949ff){return _0x4949ff[_0x441a('0xf8')](_0x2a9d29[_0x441a('0x5d')][_0x441a('0x72')],_[_0x441a('0xf9')](_0x2a9d29[_0x441a('0x5d')],['ids','id'])||{});}})[_0x441a('0x21')](respondWithResult(_0x5660fc,null))['catch'](handleError(_0x5660fc,null));};exports[_0x441a('0xfa')]=function(_0x2da97f,_0xb8d2c4,_0x4a2401){var _0x50adc1={'raw':![],'where':{}};var _0x3770c3={};var _0x260bd5={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x2da97f[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0xb8d2c4,null))[_0x441a('0x21')](function(_0x432623){if(_0x432623){_0x3770c3[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0xb8')][_0x441a('0x41')]);_0x3770c3[_0x441a('0x46')]=_['keys'](_0x2da97f['query']);_0x3770c3[_0x441a('0x51')]=_[_0x441a('0x48')](_0x3770c3[_0x441a('0x45')],_0x3770c3['query']);_0x50adc1[_0x441a('0x49')]=_[_0x441a('0x48')](_0x3770c3['model'],qs['fields'](_0x2da97f[_0x441a('0x46')]['fields']));_0x50adc1[_0x441a('0x49')]=_0x50adc1[_0x441a('0x49')][_0x441a('0x4b')]?_0x50adc1[_0x441a('0x49')]:_0x3770c3[_0x441a('0x45')];if(!_0x2da97f['query'][_0x441a('0x4c')]('nolimit')){_0x50adc1[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x2da97f[_0x441a('0x46')][_0x441a('0x31')]);_0x50adc1[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x2da97f['query'][_0x441a('0x30')]);}_0x50adc1[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x2da97f['query']['sort']);_0x50adc1[_0x441a('0x50')]=qs['filters'](_[_0x441a('0x6c')](_0x2da97f[_0x441a('0x46')],_0x3770c3[_0x441a('0x51')]));_0x50adc1[_0x441a('0x50')][_0x441a('0x6d')]=_0x432623['id'];if(_0x2da97f[_0x441a('0x46')]['filter']){_0x50adc1[_0x441a('0x50')]=_[_0x441a('0x53')](_0x50adc1['where'],{'$or':_[_0x441a('0x3f')](_0x50adc1['attributes'],function(_0x11c147){var _0x3eff51={};_0x3eff51[_0x11c147]={'$like':'%'+_0x2da97f[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x3eff51;})});}_0x50adc1=_[_0x441a('0x53')]({},_0x50adc1,_0x2da97f[_0x441a('0x55')]);return db[_0x441a('0xb8')][_0x441a('0x33')]({'where':_0x50adc1[_0x441a('0x50')]})['then'](function(_0x61f30e){_0x260bd5[_0x441a('0x33')]=_0x61f30e;if(_0x2da97f[_0x441a('0x46')][_0x441a('0x56')]){_0x50adc1[_0x441a('0x57')]=[{'model':db[_0x441a('0x8e')],'as':_0x441a('0xfb'),'required':![]},{'model':db['User'],'as':_0x441a('0xfc'),'attributes':[_0x441a('0x3c'),_0x441a('0xfd'),_0x441a('0xfe')],'required':![]},{'model':db['Tag'],'as':_0x441a('0xff'),'attributes':['id','name',_0x441a('0x100')],'where':_0x2da97f[_0x441a('0x46')]['tag']?{'id':_0x2da97f[_0x441a('0x46')][_0x441a('0x101')]}:undefined,'required':_0x2da97f[_0x441a('0x46')][_0x441a('0x101')]?!![]:![]}];}return db['ChatInteraction'][_0x441a('0x58')](_0x50adc1);})[_0x441a('0x21')](function(_0x468084){_0x260bd5[_0x441a('0x59')]=_0x468084;return _0x260bd5;});}})['then'](respondWithFilteredResult(_0xb8d2c4,_0x50adc1))[_0x441a('0x2b')](handleError(_0xb8d2c4,null));};function iftimePromise(_0xa16706,_0x1186b8){return respondWithRpcPromise(_0x441a('0x102'),_0x441a('0x103'),{'command':_0x1186b8[_0x441a('0x104')]?util[_0x441a('0xb1')]('iftime\x20%s,%s',_0xa16706['interval'],_0x1186b8['timezone']):util['format']('iftime\x20%s',_0xa16706['interval'])},client9002)[_0x441a('0x21')](function(_0x421493){var _0x190853=_0x421493&&_0x421493[_0x441a('0x105')](_0x441a('0x106'))>=0x0?!![]:![];logger[_0x441a('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1186b8['id'],_0xa16706['id'],_0xa16706['interval'],_0x190853?_0x441a('0x107'):_0x441a('0x108'),_0x1186b8[_0x441a('0x104')]?_0x1186b8[_0x441a('0x104')]:_0x441a('0x109'));return _0x190853;})['catch'](function(_0x5389c0){logger[_0x441a('0x27')](_0x441a('0x10a'),_0x1186b8['id'],_0xa16706['id'],_0xa16706[_0x441a('0x10b')],util[_0x441a('0x10c')](_0x5389c0,{'showHidden':![],'depth':null}),_0x1186b8[_0x441a('0x104')]?_0x1186b8[_0x441a('0x104')]:_0x441a('0x109'));return![];});}exports[_0x441a('0x103')]=function(_0x34e516,_0x3ee391,_0x17dd66){var _0x277926=0x0;var _0x4639a4=0x0;var _0x14e930=![];var _0x5b3a04;var _0x4d8e11;return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x34e516[_0x441a('0x66')]['id']},'include':[{'model':db[_0x441a('0x10d')],'as':_0x441a('0x10d'),'include':[{'model':db[_0x441a('0x10d')],'as':_0x441a('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3ee391,null))[_0x441a('0x21')](function(_0x4b4c12){if(_0x4b4c12){_0x5b3a04=_0x4b4c12;return _0x4b4c12[_0x441a('0x10f')]({'raw':!![]});}})[_0x441a('0x21')](function(_0x1ea5df){if(_0x5b3a04){if(_0x1ea5df){_0x4d8e11=_0x1ea5df;}}return require(_0x441a('0x7e'))[_0x441a('0x7f')]();})[_0x441a('0x21')](function(_0x2348ed){if(_0x2348ed){_0x4639a4=_0x2348ed[_0x441a('0x110')];_0x14e930=_0x2348ed[_0x441a('0x111')];}})[_0x441a('0x21')](function(){return db[_0x441a('0xb8')][_0x441a('0x33')]({'where':{'closed':![]}});})[_0x441a('0x21')](function(_0x2308da){_0x277926=_0x2308da;if(_0x4639a4&&_0x2308da>_0x4639a4){return db[_0x441a('0x112')][_0x441a('0x6b')]({'where':{'id':0x1}})[_0x441a('0x21')](function(_0x345c05){if(_0x345c05){_0x345c05[_0x441a('0x113')](_0x441a('0x114'));}});}})[_0x441a('0x21')](function(){if(_0x5b3a04[_0x441a('0x10d')]&&_0x5b3a04[_0x441a('0x10d')][_0x441a('0x10e')]){var _0x130cde=[];for(var _0x32bf8e=0x0;_0x32bf8e<_0x5b3a04[_0x441a('0x10d')][_0x441a('0x10e')][_0x441a('0x4b')];_0x32bf8e++){var _0x3a2cec=_0x5b3a04[_0x441a('0x10d')][_0x441a('0x10e')][_0x32bf8e][_0x441a('0x39')]({'plain':!![]});_0x130cde[_0x441a('0xc0')](iftimePromise(_0x3a2cec,_0x5b3a04));}return BPromise[_0x441a('0x115')](_0x130cde)[_0x441a('0x21')](function(_0x334c7b){return _[_0x441a('0x116')](_0x334c7b);});}else{return!![];}})[_0x441a('0x21')](function(_0x575bac){var _0x50ea4d=fs[_0x441a('0x117')](path['join'](config[_0x441a('0x7d')],_0x441a('0x118')),_0x441a('0xd4'));var _0x52064b={'remote':_0x5b3a04['remote'],'query':querystring[_0x441a('0x26')](_['merge'](_0x5b3a04['get']({'plain':!![]}),{'customerIp':_0x34e516[_0x441a('0x8b')][_0x441a('0xa9')]||_0x34e516[_0x441a('0x8b')][_0x441a('0x119')]||_0x34e516['connection']['remoteAddress']||_0x34e516['ip'],'referer':_0x34e516[_0x441a('0x8b')][_0x441a('0xae')],'openedInteractions':_0x277926,'maxInteractions':_0x4639a4,'virtual':_0x14e930[_0x441a('0x110')],'online':_0x575bac,'custom':_0x14e930}))['replace'](/'/g,'\x5c\x27')};_0x3ee391[_0x441a('0x3d')](ejs[_0x441a('0xd5')](Mustache['render'](_0x50ea4d,_0x52064b),{'proactiveActions':_0x4d8e11,'alignment':_0x5b3a04['alignment'],'verticalAlignment':_0x5b3a04['verticalAlignment'],'div_color':_0x5b3a04['color'],'text_color':_0x5b3a04['textColor'],'button_color':_0x5b3a04[_0x441a('0x11a')],'background_color':_0x5b3a04[_0x441a('0x11b')]}));})['catch'](handleError(_0x3ee391,null));};exports[_0x441a('0x11c')]=function(_0x886eec,_0x553331,_0x43d5a7){return db[_0x441a('0x40')]['findOne']({'where':{'id':_0x886eec['params']['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x553331,null))[_0x441a('0x21')](function(_0x4635ca){if(_0x4635ca){return db['sequelize']['transaction'](function(_0xee63b4){return db['ChatApplication'][_0x441a('0x38')]({'where':{'ChatWebsiteId':_0x886eec[_0x441a('0x66')]['id']},'transaction':_0xee63b4})[_0x441a('0x21')](function(_0x55776a){var _0x2486eb=_[_0x441a('0x3f')](_0x886eec['body'],function(_0x425cfc){_0x425cfc[_0x441a('0x6d')]=_0x886eec[_0x441a('0x66')]['id'];return _0x425cfc;});return db[_0x441a('0xa0')][_0x441a('0xe2')](_0x2486eb,{'transaction':_0xee63b4});});})[_0x441a('0x21')](function(){return db[_0x441a('0xa0')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x886eec['params']['id']},'order':_0x441a('0xa5')});});}})[_0x441a('0x21')](respondWithResult(_0x553331,null))[_0x441a('0x2b')](handleError(_0x553331,null));};exports[_0x441a('0x11d')]=function(_0x30a33b,_0x185ac0,_0x4b1fdf){var _0x419828={};var _0x20bf40={};var _0x4ee58d;var _0x1cf685;return db[_0x441a('0x40')]['findOne']({'where':{'id':_0x30a33b[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x185ac0,null))[_0x441a('0x21')](function(_0x4b6316){if(_0x4b6316){_0x4ee58d=_0x4b6316;_0x20bf40[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0xa0')][_0x441a('0x41')]);_0x20bf40[_0x441a('0x46')]=_[_0x441a('0x47')](_0x30a33b['query']);_0x20bf40['filters']=_[_0x441a('0x48')](_0x20bf40['model'],_0x20bf40[_0x441a('0x46')]);_0x419828[_0x441a('0x49')]=_[_0x441a('0x48')](_0x20bf40[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x30a33b[_0x441a('0x46')][_0x441a('0x4a')]));_0x419828['attributes']=_0x419828[_0x441a('0x49')][_0x441a('0x4b')]?_0x419828[_0x441a('0x49')]:_0x20bf40[_0x441a('0x45')];_0x419828['order']=qs['sort'](_0x30a33b[_0x441a('0x46')][_0x441a('0x4f')]);_0x419828[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x30a33b[_0x441a('0x46')],_0x20bf40['filters']));if(_0x30a33b[_0x441a('0x46')][_0x441a('0x52')]){_0x419828[_0x441a('0x50')]=_[_0x441a('0x53')](_0x419828['where'],{'$or':_[_0x441a('0x3f')](_0x419828[_0x441a('0x49')],function(_0x31310e){var _0x15d54e={};_0x15d54e[_0x31310e]={'$like':'%'+_0x30a33b[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x15d54e;})});}_0x419828=_[_0x441a('0x53')]({},_0x419828,_0x30a33b[_0x441a('0x55')]);return _0x4ee58d[_0x441a('0x11d')](_0x419828);}})[_0x441a('0x21')](function(_0x3cd4e5){if(_0x3cd4e5){_0x1cf685=_0x3cd4e5[_0x441a('0x4b')];if(!_0x30a33b[_0x441a('0x46')][_0x441a('0x4c')](_0x441a('0x4d'))){_0x419828[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x30a33b[_0x441a('0x46')]['limit']);_0x419828[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x30a33b[_0x441a('0x46')][_0x441a('0x30')]);}return _0x4ee58d[_0x441a('0x11d')](_0x419828);}})['then'](function(_0x3598a1){if(_0x3598a1){return _0x3598a1?{'count':_0x1cf685,'rows':_0x3598a1}:null;}})[_0x441a('0x21')](respondWithResult(_0x185ac0,null))[_0x441a('0x2b')](handleError(_0x185ac0,null));};exports[_0x441a('0x11e')]=function(_0x268548,_0x54a732,_0x424eba){return db['chatProactiveAction'][_0x441a('0x5c')]({'where':{'id':_0x268548[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x54a732,null))[_0x441a('0x21')](function(_0x451308){if(_0x451308){return _0x451308[_0x441a('0x11e')](_0x268548['body'][_0x441a('0x72')],_[_0x441a('0xf9')](_0x268548[_0x441a('0x5d')],[_0x441a('0x72'),'id'])||{});}})[_0x441a('0x21')](respondWithResult(_0x54a732,null))[_0x441a('0x2b')](handleError(_0x54a732,null));};exports['getProactiveActions']=function(_0x58fed5,_0x514ce4,_0x4a8a00){var _0x5eb301={};var _0xf8fad8={};var _0x32df86;var _0x30903d;return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x58fed5[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x514ce4,null))[_0x441a('0x21')](function(_0x52bcdc){if(_0x52bcdc){_0x32df86=_0x52bcdc;_0xf8fad8[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0x11f')][_0x441a('0x41')]);_0xf8fad8['query']=_[_0x441a('0x47')](_0x58fed5[_0x441a('0x46')]);_0xf8fad8[_0x441a('0x51')]=_[_0x441a('0x48')](_0xf8fad8['model'],_0xf8fad8['query']);_0x5eb301['attributes']=_[_0x441a('0x48')](_0xf8fad8[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x58fed5[_0x441a('0x46')]['fields']));_0x5eb301['attributes']=_0x5eb301['attributes'][_0x441a('0x4b')]?_0x5eb301['attributes']:_0xf8fad8[_0x441a('0x45')];_0x5eb301['order']=qs['sort'](_0x58fed5[_0x441a('0x46')]['sort']);_0x5eb301[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x58fed5[_0x441a('0x46')],_0xf8fad8['filters']));if(_0x58fed5[_0x441a('0x46')]['filter']){_0x5eb301['where']=_['merge'](_0x5eb301['where'],{'$or':_[_0x441a('0x3f')](_0x5eb301[_0x441a('0x49')],function(_0x476e67){var _0x5ad3a9={};_0x5ad3a9[_0x476e67]={'$like':'%'+_0x58fed5[_0x441a('0x46')][_0x441a('0x52')]+'%'};return _0x5ad3a9;})});}_0x5eb301=_[_0x441a('0x53')]({},_0x5eb301,_0x58fed5[_0x441a('0x55')]);return _0x32df86[_0x441a('0x10f')](_0x5eb301);}})[_0x441a('0x21')](function(_0x5bd0a4){if(_0x5bd0a4){_0x30903d=_0x5bd0a4[_0x441a('0x4b')];if(!_0x58fed5[_0x441a('0x46')][_0x441a('0x4c')]('nolimit')){_0x5eb301[_0x441a('0x31')]=qs[_0x441a('0x31')](_0x58fed5[_0x441a('0x46')][_0x441a('0x31')]);_0x5eb301[_0x441a('0x30')]=qs['offset'](_0x58fed5[_0x441a('0x46')][_0x441a('0x30')]);}return _0x32df86['getProactiveActions'](_0x5eb301);}})[_0x441a('0x21')](function(_0x4b887a){if(_0x4b887a){return _0x4b887a?{'count':_0x30903d,'rows':_0x4b887a}:null;}})['then'](respondWithResult(_0x514ce4,null))[_0x441a('0x2b')](handleError(_0x514ce4,null));};exports['getFields']=function(_0x396dbd,_0x2e872e,_0x433efa){var _0x3bc578=_0x396dbd['query'][_0x441a('0x120')]==='false'?_0x441a('0x121'):_0x441a('0x122');return db['ChatWebsite']['find']({'attributes':['id',_0x3bc578],'where':{'id':_0x396dbd['params']['id']}})['then'](handleEntityNotFound(_0x2e872e,null))['then'](function(_0x48b51b){if(_0x48b51b){var _0xa67ede=_0x48b51b[_0x3bc578];var _0xd65774=_0xa67ede&&_0xa67ede[_0x441a('0x123')]?_0xa67ede[_0x441a('0x123')]:[];_0x2e872e['send']({'fromKey':_[_0x441a('0x84')](_0xa67ede[_0x441a('0x124')])?undefined:_0xa67ede['fromKey'],'count':_0xd65774[_0x441a('0x4b')],'rows':_0xd65774});}})['catch'](handleError(_0x2e872e,null));};exports[_0x441a('0x125')]=function(_0x5779a3,_0x2ad0df,_0x228690){var _0x3da6b6={'raw':![],'where':{}};var _0x5cc0d2={};var _0x2e9181={'count':0x0,'rows':[]};return db[_0x441a('0x40')][_0x441a('0x6b')]({'where':{'id':_0x5779a3[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x2ad0df,null))['then'](function(_0x240b36){if(_0x240b36){_0x5cc0d2[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0x126')]['rawAttributes']);_0x5cc0d2[_0x441a('0x46')]=_[_0x441a('0x47')](_0x5779a3[_0x441a('0x46')]);_0x5cc0d2[_0x441a('0x51')]=_[_0x441a('0x48')](_0x5cc0d2['model'],_0x5cc0d2['query']);_0x3da6b6[_0x441a('0x49')]=_[_0x441a('0x48')](_0x5cc0d2[_0x441a('0x45')],qs[_0x441a('0x4a')](_0x5779a3[_0x441a('0x46')][_0x441a('0x4a')]));_0x3da6b6['attributes']=_0x3da6b6['attributes'][_0x441a('0x4b')]?_0x3da6b6[_0x441a('0x49')]:_0x5cc0d2[_0x441a('0x45')];if(!_0x5779a3['query'][_0x441a('0x4c')](_0x441a('0x4d'))){_0x3da6b6['limit']=qs[_0x441a('0x31')](_0x5779a3[_0x441a('0x46')][_0x441a('0x31')]);_0x3da6b6[_0x441a('0x30')]=qs[_0x441a('0x30')](_0x5779a3[_0x441a('0x46')][_0x441a('0x30')]);}_0x3da6b6[_0x441a('0x4e')]=qs['sort'](_0x5779a3[_0x441a('0x46')][_0x441a('0x4f')]);_0x3da6b6[_0x441a('0x50')]=qs['filters'](_[_0x441a('0x6c')](_0x5779a3[_0x441a('0x46')],_0x5cc0d2['filters']));_0x3da6b6[_0x441a('0x50')][_0x441a('0x6d')]=_0x240b36['id'];if(_0x5779a3[_0x441a('0x46')]['filter']){_0x3da6b6[_0x441a('0x50')]=_[_0x441a('0x53')](_0x3da6b6['where'],{'$or':_[_0x441a('0x3f')](_0x3da6b6[_0x441a('0x49')],function(_0x82035f){var _0x331e42={};_0x331e42[_0x82035f]={'$like':'%'+_0x5779a3['query']['filter']+'%'};return _0x331e42;})});}_0x3da6b6=_['merge']({},_0x3da6b6,_0x5779a3[_0x441a('0x55')]);return db[_0x441a('0x126')][_0x441a('0x33')]({'where':_0x3da6b6[_0x441a('0x50')]})[_0x441a('0x21')](function(_0x2e5d2d){_0x2e9181['count']=_0x2e5d2d;if(_0x5779a3[_0x441a('0x46')][_0x441a('0x56')]){_0x3da6b6[_0x441a('0x57')]=[{'all':!![]}];}else{_0x3da6b6['include']=[{'model':db[_0x441a('0x8e')],'as':'Contact','required':![]},{'model':db[_0x441a('0xe1')],'as':_0x441a('0x127'),'required':![]}];}return db[_0x441a('0x126')][_0x441a('0x58')](_0x3da6b6);})[_0x441a('0x21')](function(_0x11e927){_0x2e9181[_0x441a('0x59')]=_0x11e927;return _0x2e9181;});}})['then'](respondWithFilteredResult(_0x2ad0df,_0x3da6b6))['catch'](handleError(_0x2ad0df,null));};exports['addAgents']=function(_0xe73e23,_0x9579ab,_0x23afa9){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0xe73e23[_0x441a('0x66')]['id']}})['then'](handleEntityNotFound(_0x9579ab,null))[_0x441a('0x21')](function(_0x5eb0ee){if(_0x5eb0ee){return _0x5eb0ee['addAgents'](_0xe73e23[_0x441a('0x5d')][_0x441a('0x72')],_[_0x441a('0xf9')](_0xe73e23[_0x441a('0x5d')],[_0x441a('0x72'),'id'])||{})[_0x441a('0xbc')](function(_0x5ca471){for(var _0x42e48c=0x0;_0x42e48c<_0xe73e23[_0x441a('0x5d')][_0x441a('0x72')]['length'];_0x42e48c+=0x1){socket[_0x441a('0x128')]('userChatWebsite:save',{'UserId':Number(_0xe73e23[_0x441a('0x5d')][_0x441a('0x72')][_0x42e48c]),'ChatWebsiteId':Number(_0xe73e23[_0x441a('0x66')]['id'])});}return _0x5ca471;});}})['then'](respondWithResult(_0x9579ab,null))['catch'](handleError(_0x9579ab,null));};exports['removeAgents']=function(_0x10c26c,_0x5a6352,_0x2be95e){return db[_0x441a('0x40')][_0x441a('0x5c')]({'where':{'id':_0x10c26c[_0x441a('0x66')]['id']}})[_0x441a('0x21')](handleEntityNotFound(_0x5a6352,null))[_0x441a('0x21')](function(_0x21268a){if(_0x21268a){return _0x21268a[_0x441a('0x129')](_0x10c26c[_0x441a('0x46')][_0x441a('0x72')])[_0x441a('0x21')](function(){if(_['isArray'](_0x10c26c[_0x441a('0x46')][_0x441a('0x72')])){for(var _0x57d489=0x0;_0x57d489<_0x10c26c[_0x441a('0x46')][_0x441a('0x72')][_0x441a('0x4b')];_0x57d489+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x10c26c['query'][_0x441a('0x72')][_0x57d489]),'ChatWebsiteId':Number(_0x10c26c['params']['id'])});}}else{socket['emit'](_0x441a('0x12a'),{'UserId':Number(_0x10c26c[_0x441a('0x46')][_0x441a('0x72')]),'ChatWebsiteId':Number(_0x10c26c['params']['id'])});}});}})[_0x441a('0x21')](respondWithStatusCode(_0x5a6352,null))[_0x441a('0x2b')](handleError(_0x5a6352,null));};exports[_0x441a('0x12b')]=function(_0x24c33d,_0x7518c9,_0x3bfaa5){var _0x4ade91={};var _0x5e561d={};var _0x2f1ff9;var _0x3ec193;return db[_0x441a('0x40')]['findOne']({'where':{'id':_0x24c33d[_0x441a('0x66')]['id']}})['then'](handleEntityNotFound(_0x7518c9,null))[_0x441a('0x21')](function(_0x3798f6){if(_0x3798f6){_0x2f1ff9=_0x3798f6;_0x5e561d[_0x441a('0x45')]=_[_0x441a('0x47')](db[_0x441a('0xc6')][_0x441a('0x41')]);_0x5e561d[_0x441a('0x46')]=_['keys'](_0x24c33d[_0x441a('0x46')]);_0x5e561d[_0x441a('0x51')]=_['intersection'](_0x5e561d[_0x441a('0x45')],_0x5e561d[_0x441a('0x46')]);_0x4ade91['attributes']=_[_0x441a('0x48')](_0x5e561d['model'],qs[_0x441a('0x4a')](_0x24c33d['query'][_0x441a('0x4a')]));_0x4ade91[_0x441a('0x49')]=_0x4ade91[_0x441a('0x49')]['length']?_0x4ade91[_0x441a('0x49')]:_0x5e561d[_0x441a('0x45')];_0x4ade91[_0x441a('0x4e')]=qs[_0x441a('0x4f')](_0x24c33d['query'][_0x441a('0x4f')]);_0x4ade91[_0x441a('0x50')]=qs[_0x441a('0x51')](_[_0x441a('0x6c')](_0x24c33d[_0x441a('0x46')],_0x5e561d[_0x441a('0x51')]));if(_0x24c33d[_0x441a('0x46')][_0x441a('0x52')]){_0x4ade91['where']=_[_0x441a('0x53')](_0x4ade91[_0x441a('0x50')],{'$or':_['map'](_0x4ade91[_0x441a('0x49')],function(_0x44c072){var _0x4f1b4d={};_0x4f1b4d[_0x44c072]={'$like':'%'+_0x24c33d[_0x441a('0x46')]['filter']+'%'};return _0x4f1b4d;})});}_0x4ade91=_[_0x441a('0x53')]({},_0x4ade91,_0x24c33d[_0x441a('0x55')]);return _0x2f1ff9[_0x441a('0x12b')](_0x4ade91);}})['then'](function(_0x341f49){if(_0x341f49){_0x3ec193=_0x341f49[_0x441a('0x4b')];if(!_0x24c33d[_0x441a('0x46')][_0x441a('0x4c')]('nolimit')){_0x4ade91['limit']=qs[_0x441a('0x31')](_0x24c33d['query']['limit']);_0x4ade91['offset']=qs[_0x441a('0x30')](_0x24c33d[_0x441a('0x46')][_0x441a('0x30')]);}return _0x2f1ff9[_0x441a('0x12b')](_0x4ade91);}})[_0x441a('0x21')](function(_0x37084b){if(_0x37084b){return _0x37084b?{'count':_0x3ec193,'rows':_0x37084b}:null;}})['then'](respondWithResult(_0x7518c9,null))[_0x441a('0x2b')](handleError(_0x7518c9,null));}; \ No newline at end of file +var _0x3dca=['jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','filters','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','List','list','applications','orderBy','priority','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','mimetype','files','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','virtual','License','Intervals','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x43b61e,_0x47da03){var _0x5baf61=function(_0x4c6b0b){while(--_0x4c6b0b){_0x43b61e['push'](_0x43b61e['shift']());}};_0x5baf61(++_0x47da03);}(_0x3dca,0x11f));var _0xa3dc=function(_0x89973b,_0x1741ec){_0x89973b=_0x89973b-0x0;var _0x45cdf3=_0x3dca[_0x89973b];return _0x45cdf3;};'use strict';var emlformat=require(_0xa3dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3dc('0x1'));var jsonpatch=require(_0xa3dc('0x2'));var rp=require(_0xa3dc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa3dc('0x4'));var util=require('util');var path=require(_0xa3dc('0x5'));var sox=require('sox');var csv=require(_0xa3dc('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3dc('0x7'));var _=require(_0xa3dc('0x8'));var squel=require(_0xa3dc('0x9'));var crypto=require(_0xa3dc('0xa'));var jsforce=require(_0xa3dc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa3dc('0x6'));var querystring=require('querystring');var Papa=require(_0xa3dc('0xc'));var Redis=require(_0xa3dc('0xd'));var authService=require(_0xa3dc('0xe'));var qs=require(_0xa3dc('0xf'));var as=require(_0xa3dc('0x10'));var hardwareService=require(_0xa3dc('0x11'));var logger=require(_0xa3dc('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa3dc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3dc('0x14'))['db'];config[_0xa3dc('0x15')]=_[_0xa3dc('0x16')](config['redis'],{'host':_0xa3dc('0x17'),'port':0x18eb});var socket=require(_0xa3dc('0x18'))(new Redis(config[_0xa3dc('0x15')]));require(_0xa3dc('0x19'))[_0xa3dc('0x1a')](socket);var jayson=require(_0xa3dc('0x1b'));var client=jayson['client'][_0xa3dc('0x1c')]({'port':0x232c});var client9002=jayson[_0xa3dc('0x1d')][_0xa3dc('0x1c')]({'port':0x232a});var client9003=jayson[_0xa3dc('0x1d')][_0xa3dc('0x1c')]({'port':0x232b});var client9001=jayson['client'][_0xa3dc('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x475100,_0x5d0f52,_0x2529e0,_0x4aa2eb){return new BPromise(function(_0x39d98b,_0xbacd1c){var _0x3c9be9=_0x4aa2eb||client;return _0x3c9be9[_0xa3dc('0x1e')](_0x475100,_0x2529e0)[_0xa3dc('0x1f')](function(_0x2ce7f3){logger[_0xa3dc('0x20')](_0xa3dc('0x21'),_0x5d0f52,'request\x20sent');logger[_0xa3dc('0x22')](_0xa3dc('0x23'),_0x5d0f52,_0xa3dc('0x24'),JSON[_0xa3dc('0x25')](_0x2ce7f3));if(_0x2ce7f3[_0xa3dc('0x26')]){if(_0x2ce7f3[_0xa3dc('0x26')][_0xa3dc('0x27')]===0x1f4){logger[_0xa3dc('0x26')](_0xa3dc('0x21'),_0x5d0f52,_0x2ce7f3['error']['message']);return _0xbacd1c(_0x2ce7f3[_0xa3dc('0x26')][_0xa3dc('0x28')]);}logger[_0xa3dc('0x26')](_0xa3dc('0x21'),_0x5d0f52,_0x2ce7f3['error'][_0xa3dc('0x28')]);return _0x39d98b(_0x2ce7f3['error'][_0xa3dc('0x28')]);}else{logger[_0xa3dc('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x5d0f52,_0xa3dc('0x24'));_0x39d98b(_0x2ce7f3[_0xa3dc('0x29')][_0xa3dc('0x28')]);}})[_0xa3dc('0x2a')](function(_0xe32ab5){logger['error'](_0xa3dc('0x21'),_0x5d0f52,_0xe32ab5);_0xbacd1c(_0xe32ab5);});});}function respondWithStatusCode(_0x469633,_0x50f2a7){_0x50f2a7=_0x50f2a7||0xcc;return function(_0x51d530){if(_0x51d530){return _0x469633[_0xa3dc('0x2b')](_0x50f2a7);}return _0x469633['status'](_0x50f2a7)['end']();};}function respondWithResult(_0x35bce4,_0x55b799){_0x55b799=_0x55b799||0xc8;return function(_0x2dbb63){if(_0x2dbb63){return _0x35bce4['status'](_0x55b799)[_0xa3dc('0x2c')](_0x2dbb63);}};}function respondWithFilteredResult(_0x264d80,_0xd85fcb){return function(_0x170a0f){if(_0x170a0f){var _0x140c8d=typeof _0xd85fcb[_0xa3dc('0x2d')]===_0xa3dc('0x2e')&&typeof _0xd85fcb[_0xa3dc('0x2f')]==='undefined';var _0x349629=_0x170a0f['count'];var _0x5592a5=_0x140c8d?0x0:_0xd85fcb[_0xa3dc('0x2d')];var _0x31723a=_0x140c8d?_0x170a0f[_0xa3dc('0x30')]:_0xd85fcb['offset']+_0xd85fcb[_0xa3dc('0x2f')];var _0x32c662;if(_0x31723a>=_0x349629){_0x31723a=_0x349629;_0x32c662=0xc8;}else{_0x32c662=0xce;}_0x264d80[_0xa3dc('0x31')](_0x32c662);return _0x264d80[_0xa3dc('0x32')](_0xa3dc('0x33'),_0x5592a5+'-'+_0x31723a+'/'+_0x349629)[_0xa3dc('0x2c')](_0x170a0f);}return null;};}function patchUpdates(_0x4c1f7a){return function(_0x21b249){try{jsonpatch[_0xa3dc('0x34')](_0x21b249,_0x4c1f7a,!![]);}catch(_0x5aefd3){return BPromise[_0xa3dc('0x35')](_0x5aefd3);}return _0x21b249['save']();};}function saveUpdates(_0x4e6bfc,_0x42d6a9){return function(_0x47917e){if(_0x47917e){return _0x47917e[_0xa3dc('0x36')](_0x4e6bfc)[_0xa3dc('0x1f')](function(_0x51cc0e){return _0x51cc0e;});}return null;};}function removeEntity(_0x7e5577,_0xd6b21f){return function(_0x4fde6e){if(_0x4fde6e){return _0x4fde6e[_0xa3dc('0x37')]()[_0xa3dc('0x1f')](function(){var _0x5764d7=_0x4fde6e[_0xa3dc('0x38')]({'plain':!![]});var _0x44d59f='ChatWebsites';return db[_0xa3dc('0x39')][_0xa3dc('0x37')]({'where':{'type':_0x44d59f,'resourceId':_0x5764d7['id']}})[_0xa3dc('0x1f')](function(){return _0x4fde6e;});})[_0xa3dc('0x1f')](function(){_0x7e5577[_0xa3dc('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x151b5,_0x171512){return function(_0x5ce3f9){if(!_0x5ce3f9){_0x151b5[_0xa3dc('0x2b')](0x194);}return _0x5ce3f9;};}function handleError(_0xa40f03,_0x1fbafd){_0x1fbafd=_0x1fbafd||0x1f4;return function(_0x530aca){logger['error'](_0x530aca['stack']);if(_0x530aca[_0xa3dc('0x3a')]){delete _0x530aca[_0xa3dc('0x3a')];}_0xa40f03['status'](_0x1fbafd)['send'](_0x530aca);};}exports[_0xa3dc('0x3b')]=function(_0x143c49,_0x39b9ef){var _0x3618c3={'include':[{'model':db[_0xa3dc('0x3c')],'as':_0xa3dc('0x3d')}]},_0x56766f={},_0xd5b5b1={'count':0x0,'rows':[]};var _0x5e3287=_[_0xa3dc('0x3e')](db[_0xa3dc('0x3f')][_0xa3dc('0x40')],function(_0x2fbaa9){return{'name':_0x2fbaa9[_0xa3dc('0x41')],'type':_0x2fbaa9[_0xa3dc('0x42')][_0xa3dc('0x43')]};});_0x56766f[_0xa3dc('0x44')]=_[_0xa3dc('0x3e')](_0x5e3287,_0xa3dc('0x3a'));_0x56766f[_0xa3dc('0x45')]=_[_0xa3dc('0x46')](_0x143c49[_0xa3dc('0x45')]);_0x56766f['filters']=_['intersection'](_0x56766f[_0xa3dc('0x44')],_0x56766f[_0xa3dc('0x45')]);_0x3618c3['attributes']=_[_0xa3dc('0x47')](_0x56766f[_0xa3dc('0x44')],qs['fields'](_0x143c49[_0xa3dc('0x45')][_0xa3dc('0x48')]));_0x3618c3['attributes']=_0x3618c3['attributes'][_0xa3dc('0x49')]?_0x3618c3[_0xa3dc('0x4a')]:_0x56766f['model'];if(!_0x143c49[_0xa3dc('0x45')][_0xa3dc('0x4b')](_0xa3dc('0x4c'))){_0x3618c3[_0xa3dc('0x2f')]=qs['limit'](_0x143c49[_0xa3dc('0x45')][_0xa3dc('0x2f')]);_0x3618c3[_0xa3dc('0x2d')]=qs[_0xa3dc('0x2d')](_0x143c49[_0xa3dc('0x45')][_0xa3dc('0x2d')]);}_0x3618c3[_0xa3dc('0x4d')]=qs['sort'](_0x143c49['query'][_0xa3dc('0x4e')]);_0x3618c3['where']=qs['filters'](_[_0xa3dc('0x4f')](_0x143c49[_0xa3dc('0x45')],_0x56766f['filters']),_0x5e3287);if(_0x143c49[_0xa3dc('0x45')][_0xa3dc('0x50')]){_0x3618c3[_0xa3dc('0x51')]=_[_0xa3dc('0x52')](_0x3618c3['where'],{'$or':_['map'](_0x5e3287,function(_0x3c9d24){if(_0x3c9d24[_0xa3dc('0x42')]!==_0xa3dc('0x53')){var _0x5b82dc={};_0x5b82dc[_0x3c9d24[_0xa3dc('0x3a')]]={'$like':'%'+_0x143c49['query'][_0xa3dc('0x50')]+'%'};return _0x5b82dc;}})});}_0x3618c3=_['merge']({},_0x3618c3,_0x143c49['options']);var _0x4d5d30={'where':_0x3618c3[_0xa3dc('0x51')]};return db['ChatWebsite'][_0xa3dc('0x30')](_0x4d5d30)[_0xa3dc('0x1f')](function(_0x38774e){_0xd5b5b1[_0xa3dc('0x30')]=_0x38774e;if(_0x143c49[_0xa3dc('0x45')][_0xa3dc('0x54')]){_0x3618c3[_0xa3dc('0x55')]=[{'all':!![]}];}return db['ChatWebsite'][_0xa3dc('0x56')](_0x3618c3);})[_0xa3dc('0x1f')](function(_0x24bce4){_0xd5b5b1[_0xa3dc('0x57')]=_0x24bce4;return _0xd5b5b1;})[_0xa3dc('0x1f')](respondWithFilteredResult(_0x39b9ef,_0x3618c3))[_0xa3dc('0x2a')](handleError(_0x39b9ef,null));};exports[_0xa3dc('0x58')]=function(_0x2b4248,_0x3fe98f){var _0x23d240={'raw':![],'where':{'id':_0x2b4248[_0xa3dc('0x59')]['id']},'include':[{'model':db[_0xa3dc('0x3c')],'as':_0xa3dc('0x3d')}]},_0x467a86={};_0x467a86[_0xa3dc('0x44')]=_['keys'](db[_0xa3dc('0x3f')]['rawAttributes']);_0x467a86['query']=_['keys'](_0x2b4248['query']);_0x467a86[_0xa3dc('0x5a')]=_[_0xa3dc('0x47')](_0x467a86[_0xa3dc('0x44')],_0x467a86[_0xa3dc('0x45')]);_0x23d240[_0xa3dc('0x4a')]=_['intersection'](_0x467a86[_0xa3dc('0x44')],qs['fields'](_0x2b4248['query'][_0xa3dc('0x48')]));_0x23d240['attributes']=_0x23d240[_0xa3dc('0x4a')][_0xa3dc('0x49')]?_0x23d240['attributes']:_0x467a86[_0xa3dc('0x44')];if(_0x2b4248[_0xa3dc('0x45')][_0xa3dc('0x54')]){_0x23d240['include']=[{'all':!![]}];}_0x23d240=_[_0xa3dc('0x52')]({},_0x23d240,_0x2b4248[_0xa3dc('0x5b')]);return db[_0xa3dc('0x3f')]['find'](_0x23d240)[_0xa3dc('0x1f')](handleEntityNotFound(_0x3fe98f,null))[_0xa3dc('0x1f')](respondWithResult(_0x3fe98f,null))[_0xa3dc('0x2a')](handleError(_0x3fe98f,null));};exports[_0xa3dc('0x5c')]=function(_0x15b3bd,_0x1f1b89){return db[_0xa3dc('0x3f')][_0xa3dc('0x5c')](_0x15b3bd[_0xa3dc('0x5d')],{})[_0xa3dc('0x1f')](function(_0x56fd4c){var _0x294be5=_0x15b3bd[_0xa3dc('0x5e')]['get']({'plain':!![]});if(!_0x294be5)throw new Error(_0xa3dc('0x5f'));if(_0x294be5['role']==='user'){var _0x152191=_0x56fd4c[_0xa3dc('0x38')]({'plain':!![]});var _0x591f53=_0xa3dc('0x60');return db[_0xa3dc('0x61')][_0xa3dc('0x62')]({'where':{'name':_0x591f53,'userProfileId':_0x294be5[_0xa3dc('0x63')]},'raw':!![]})['then'](function(_0x57fccb){if(_0x57fccb&&_0x57fccb[_0xa3dc('0x64')]===0x0){return db[_0xa3dc('0x39')][_0xa3dc('0x5c')]({'name':_0x152191[_0xa3dc('0x3a')],'resourceId':_0x152191['id'],'type':_0x57fccb[_0xa3dc('0x3a')],'sectionId':_0x57fccb['id']},{})[_0xa3dc('0x1f')](function(){return _0x56fd4c;});}else{return _0x56fd4c;}})[_0xa3dc('0x2a')](function(_0x2ce657){logger[_0xa3dc('0x26')](_0xa3dc('0x65'),_0x2ce657);throw _0x2ce657;});}return _0x56fd4c;})[_0xa3dc('0x1f')](respondWithResult(_0x1f1b89,0xc9))[_0xa3dc('0x2a')](handleError(_0x1f1b89,null));};exports[_0xa3dc('0x36')]=function(_0x548eca,_0x6e581e){if(_0x548eca[_0xa3dc('0x5d')]['id']){delete _0x548eca['body']['id'];}return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x548eca[_0xa3dc('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xa3dc('0x3d')}]})[_0xa3dc('0x1f')](handleEntityNotFound(_0x6e581e,null))[_0xa3dc('0x1f')](saveUpdates(_0x548eca['body'],null))[_0xa3dc('0x1f')](respondWithResult(_0x6e581e,null))[_0xa3dc('0x2a')](handleError(_0x6e581e,null));};exports[_0xa3dc('0x37')]=function(_0x2fdc03,_0x548d89){return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x2fdc03[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x548d89,null))['then'](removeEntity(_0x548d89,null))['catch'](handleError(_0x548d89,null));};exports[_0xa3dc('0x66')]=function(_0x3e38db,_0x3c2c83){return db['ChatWebsite']['describe']()[_0xa3dc('0x1f')](respondWithResult(_0x3c2c83,null))[_0xa3dc('0x2a')](handleError(_0x3c2c83,null));};exports[_0xa3dc('0x67')]=function(_0x301d15,_0x7f4e54,_0x56cd9d){if(_0x301d15[_0xa3dc('0x5d')]['id']){delete _0x301d15[_0xa3dc('0x5d')]['id'];}return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x301d15[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x7f4e54,null))[_0xa3dc('0x1f')](function(_0x257dc0){if(_0x257dc0){_0x301d15[_0xa3dc('0x5d')]['ChatWebsiteId']=_0x257dc0['id'];return db[_0xa3dc('0x68')][_0xa3dc('0x5c')](_0x301d15[_0xa3dc('0x5d')]);}})[_0xa3dc('0x1f')](respondWithResult(_0x7f4e54,null))[_0xa3dc('0x2a')](handleError(_0x7f4e54,null));};exports[_0xa3dc('0x69')]=function(_0x2b3c83,_0xefd936,_0x561189){var _0x52bf84={'raw':![],'where':{}};var _0x3e9b21={};var _0x1e1e5a={'count':0x0,'rows':[]};return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0x2b3c83['params']['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0xefd936,null))[_0xa3dc('0x1f')](function(_0x233e39){if(_0x233e39){_0x3e9b21[_0xa3dc('0x44')]=_[_0xa3dc('0x46')](db[_0xa3dc('0x68')][_0xa3dc('0x40')]);_0x3e9b21[_0xa3dc('0x45')]=_[_0xa3dc('0x46')](_0x2b3c83[_0xa3dc('0x45')]);_0x3e9b21['filters']=_[_0xa3dc('0x47')](_0x3e9b21[_0xa3dc('0x44')],_0x3e9b21[_0xa3dc('0x45')]);_0x52bf84[_0xa3dc('0x4a')]=_['intersection'](_0x3e9b21[_0xa3dc('0x44')],qs[_0xa3dc('0x48')](_0x2b3c83['query'][_0xa3dc('0x48')]));_0x52bf84[_0xa3dc('0x4a')]=_0x52bf84[_0xa3dc('0x4a')][_0xa3dc('0x49')]?_0x52bf84[_0xa3dc('0x4a')]:_0x3e9b21[_0xa3dc('0x44')];if(!_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x4b')](_0xa3dc('0x4c'))){_0x52bf84[_0xa3dc('0x2f')]=qs[_0xa3dc('0x2f')](_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x2f')]);_0x52bf84[_0xa3dc('0x2d')]=qs[_0xa3dc('0x2d')](_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x2d')]);}_0x52bf84['order']=qs['sort'](_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x4e')]);_0x52bf84[_0xa3dc('0x51')]=qs['filters'](_['pick'](_0x2b3c83['query'],_0x3e9b21[_0xa3dc('0x5a')]));_0x52bf84['where'][_0xa3dc('0x6b')]=_0x233e39['id'];if(_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x50')]){_0x52bf84['where']=_[_0xa3dc('0x52')](_0x52bf84[_0xa3dc('0x51')],{'$or':_[_0xa3dc('0x3e')](_0x52bf84['attributes'],function(_0x2cfbaa){var _0x5741bd={};_0x5741bd[_0x2cfbaa]={'$like':'%'+_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x50')]+'%'};return _0x5741bd;})});}_0x52bf84=_[_0xa3dc('0x52')]({},_0x52bf84,_0x2b3c83[_0xa3dc('0x5b')]);return db['Disposition'][_0xa3dc('0x30')]({'where':_0x52bf84[_0xa3dc('0x51')]})['then'](function(_0x50eb8e){_0x1e1e5a[_0xa3dc('0x30')]=_0x50eb8e;if(_0x2b3c83[_0xa3dc('0x45')][_0xa3dc('0x54')]){_0x52bf84[_0xa3dc('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x52bf84);})['then'](function(_0x35998b){_0x1e1e5a[_0xa3dc('0x57')]=_0x35998b;return _0x1e1e5a;});}})[_0xa3dc('0x1f')](respondWithFilteredResult(_0xefd936,_0x52bf84))['catch'](handleError(_0xefd936,null));};exports[_0xa3dc('0x6c')]=function(_0x4bb8b1,_0x1f1278,_0x342174){return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x4bb8b1[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x1f1278,null))[_0xa3dc('0x1f')](function(_0x39ec5e){if(_0x39ec5e){return _0x39ec5e[_0xa3dc('0x6c')](_0x4bb8b1[_0xa3dc('0x45')][_0xa3dc('0x6d')]);}})[_0xa3dc('0x1f')](respondWithStatusCode(_0x1f1278,null))['catch'](handleError(_0x1f1278,null));};exports[_0xa3dc('0x6e')]=function(_0x1af006,_0x2b5fae,_0x2f7517){if(_0x1af006[_0xa3dc('0x5d')]['id']){delete _0x1af006['body']['id'];}return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x1af006['params']['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x2b5fae,null))[_0xa3dc('0x1f')](function(_0x530225){if(_0x530225){_0x1af006[_0xa3dc('0x5d')][_0xa3dc('0x6b')]=_0x530225['id'];return db['CannedAnswer'][_0xa3dc('0x5c')](_0x1af006[_0xa3dc('0x5d')]);}})[_0xa3dc('0x1f')](respondWithResult(_0x2b5fae,null))['catch'](handleError(_0x2b5fae,null));};exports[_0xa3dc('0x6f')]=function(_0x57d659,_0x45f5e9,_0x28034c){var _0x1c4385={'raw':![],'where':{}};var _0x2a2dad={};var _0x3b5642={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa3dc('0x6a')]({'where':{'id':_0x57d659[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x45f5e9,null))[_0xa3dc('0x1f')](function(_0xf4a523){if(_0xf4a523){_0x2a2dad[_0xa3dc('0x44')]=_['keys'](db[_0xa3dc('0x70')][_0xa3dc('0x40')]);_0x2a2dad[_0xa3dc('0x45')]=_[_0xa3dc('0x46')](_0x57d659[_0xa3dc('0x45')]);_0x2a2dad[_0xa3dc('0x5a')]=_['intersection'](_0x2a2dad[_0xa3dc('0x44')],_0x2a2dad['query']);_0x1c4385[_0xa3dc('0x4a')]=_[_0xa3dc('0x47')](_0x2a2dad[_0xa3dc('0x44')],qs[_0xa3dc('0x48')](_0x57d659['query']['fields']));_0x1c4385[_0xa3dc('0x4a')]=_0x1c4385[_0xa3dc('0x4a')][_0xa3dc('0x49')]?_0x1c4385[_0xa3dc('0x4a')]:_0x2a2dad['model'];if(!_0x57d659[_0xa3dc('0x45')]['hasOwnProperty']('nolimit')){_0x1c4385[_0xa3dc('0x2f')]=qs[_0xa3dc('0x2f')](_0x57d659[_0xa3dc('0x45')][_0xa3dc('0x2f')]);_0x1c4385[_0xa3dc('0x2d')]=qs[_0xa3dc('0x2d')](_0x57d659[_0xa3dc('0x45')][_0xa3dc('0x2d')]);}_0x1c4385['order']=qs[_0xa3dc('0x4e')](_0x57d659[_0xa3dc('0x45')][_0xa3dc('0x4e')]);_0x1c4385[_0xa3dc('0x51')]=qs[_0xa3dc('0x5a')](_[_0xa3dc('0x4f')](_0x57d659['query'],_0x2a2dad[_0xa3dc('0x5a')]));_0x1c4385[_0xa3dc('0x51')][_0xa3dc('0x6b')]=_0xf4a523['id'];if(_0x57d659['query'][_0xa3dc('0x50')]){_0x1c4385['where']=_[_0xa3dc('0x52')](_0x1c4385['where'],{'$or':_[_0xa3dc('0x3e')](_0x1c4385[_0xa3dc('0x4a')],function(_0x3521e0){var _0x1d1161={};_0x1d1161[_0x3521e0]={'$like':'%'+_0x57d659['query'][_0xa3dc('0x50')]+'%'};return _0x1d1161;})});}_0x1c4385=_[_0xa3dc('0x52')]({},_0x1c4385,_0x57d659['options']);return db[_0xa3dc('0x70')][_0xa3dc('0x30')]({'where':_0x1c4385[_0xa3dc('0x51')]})[_0xa3dc('0x1f')](function(_0x4c917a){_0x3b5642['count']=_0x4c917a;if(_0x57d659[_0xa3dc('0x45')][_0xa3dc('0x54')]){_0x1c4385[_0xa3dc('0x55')]=[{'all':!![]}];}return db[_0xa3dc('0x70')]['findAll'](_0x1c4385);})[_0xa3dc('0x1f')](function(_0x541a90){_0x3b5642[_0xa3dc('0x57')]=_0x541a90;return _0x3b5642;});}})[_0xa3dc('0x1f')](respondWithFilteredResult(_0x45f5e9,_0x1c4385))['catch'](handleError(_0x45f5e9,null));};exports[_0xa3dc('0x71')]=function(_0x5c1e06,_0x1ba35c,_0x54d7a7){return db[_0xa3dc('0x3f')]['find']({'where':{'id':_0x5c1e06[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x1ba35c,null))[_0xa3dc('0x1f')](function(_0x38ef21){if(_0x38ef21){return _0x38ef21[_0xa3dc('0x71')](_0x5c1e06['query'][_0xa3dc('0x6d')]);}})['then'](respondWithStatusCode(_0x1ba35c,null))[_0xa3dc('0x2a')](handleError(_0x1ba35c,null));};exports[_0xa3dc('0x72')]=function(_0x57314f,_0x3ad9d1,_0x1fb708){_0x57314f['body'][_0xa3dc('0x73')]=_0x57314f[_0xa3dc('0x74')][_0xa3dc('0x75')];return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x57314f['params']['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x3ad9d1,null))[_0xa3dc('0x1f')](saveUpdates(_0x57314f[_0xa3dc('0x5d')],null))[_0xa3dc('0x1f')](respondWithResult(_0x3ad9d1,null))[_0xa3dc('0x2a')](handleError(_0x3ad9d1,null));};exports[_0xa3dc('0x76')]=function(_0x25651e,_0x5953ce,_0x3f37bb){_0x25651e['body']['agentAvatar']=_0x25651e[_0xa3dc('0x74')][_0xa3dc('0x75')];return db['ChatWebsite'][_0xa3dc('0x62')]({'where':{'id':_0x25651e['params']['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x5953ce,null))[_0xa3dc('0x1f')](saveUpdates(_0x25651e[_0xa3dc('0x5d')],null))['then'](respondWithResult(_0x5953ce,null))[_0xa3dc('0x2a')](handleError(_0x5953ce,null));};exports[_0xa3dc('0x77')]=function(_0x2a5154,_0x278348,_0x13d961){_0x2a5154[_0xa3dc('0x5d')][_0xa3dc('0x78')]=_0x2a5154[_0xa3dc('0x74')]['filename'];return db['ChatWebsite'][_0xa3dc('0x62')]({'where':{'id':_0x2a5154[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x278348,null))[_0xa3dc('0x1f')](saveUpdates(_0x2a5154['body'],null))[_0xa3dc('0x1f')](respondWithResult(_0x278348,null))['catch'](handleError(_0x278348,null));};exports[_0xa3dc('0x79')]=function(_0x14f3d4,_0x2eaab6,_0x18274f){_0x14f3d4[_0xa3dc('0x5d')][_0xa3dc('0x7a')]=_0x14f3d4[_0xa3dc('0x74')][_0xa3dc('0x75')];return db[_0xa3dc('0x3f')]['find']({'where':{'id':_0x14f3d4[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x2eaab6,null))['then'](saveUpdates(_0x14f3d4['body'],null))[_0xa3dc('0x1f')](respondWithResult(_0x2eaab6,null))[_0xa3dc('0x2a')](handleError(_0x2eaab6,null));};exports[_0xa3dc('0x7b')]=function(_0x5e23ca,_0x1fa7c4,_0x1cb996){var _0x5d0954=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x7e'));var _0x44df48={'where':{'id':_0x5e23ca[_0xa3dc('0x59')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3b555=![];return require(_0xa3dc('0x7f'))[_0xa3dc('0x80')]()['then'](function(_0x3d1ec9){if(_0x3d1ec9){_0x3b555=_0x3d1ec9[_0xa3dc('0x81')];}})[_0xa3dc('0x1f')](function(){return db['ChatWebsite'][_0xa3dc('0x62')](_0x44df48);})[_0xa3dc('0x1f')](handleEntityNotFound(_0x1fa7c4,null))['then'](function(_0x33c616){if(_0x33c616){if(!_[_0xa3dc('0x82')](_0x33c616[_0xa3dc('0x73')])){if(fs[_0xa3dc('0x83')](path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x84'),_0x33c616[_0xa3dc('0x73')]))&&_0x3b555){_0x5d0954=path['join'](config[_0xa3dc('0x7d')],'server/files/images/logos/',_0x33c616[_0xa3dc('0x73')]);}}return _0x1fa7c4[_0xa3dc('0x85')](_0x5d0954);}})[_0xa3dc('0x2a')](handleError(_0x1fa7c4,null));};exports[_0xa3dc('0x86')]=function(_0x3b42dd,_0x117a23,_0x2ba88b){var _0x448034=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x87'));var _0x3efd92={'where':{'id':_0x3b42dd[_0xa3dc('0x59')]['id']},'attributes':['id',_0xa3dc('0x88')],'raw':!![]};return db[_0xa3dc('0x3f')]['find'](_0x3efd92)[_0xa3dc('0x1f')](handleEntityNotFound(_0x117a23,null))[_0xa3dc('0x1f')](function(_0x2b3680){if(_0x2b3680){if(!_[_0xa3dc('0x82')](_0x2b3680['agentAvatar'])){if(fs[_0xa3dc('0x83')](path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],'server/files/images/avatars/',_0x2b3680[_0xa3dc('0x88')]))){_0x448034=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],'server/files/images/avatars/',_0x2b3680['agentAvatar']);}}return _0x117a23['download'](_0x448034);}})['catch'](handleError(_0x117a23,null));};exports[_0xa3dc('0x89')]=function(_0x2e00a4,_0x14c4ef,_0x1f1ef4){var _0x3bbddb=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x8a'));var _0x326262={'where':{'id':_0x2e00a4[_0xa3dc('0x59')]['id']},'attributes':['id',_0xa3dc('0x78'),'showCustomerAvatar'],'raw':!![]};return db[_0xa3dc('0x3f')]['find'](_0x326262)['then'](handleEntityNotFound(_0x14c4ef,null))[_0xa3dc('0x1f')](function(_0x2d5c78){if(_0x2d5c78){if(!_[_0xa3dc('0x82')](_0x2d5c78[_0xa3dc('0x78')])){if(fs[_0xa3dc('0x83')](path[_0xa3dc('0x7c')](config['root'],_0xa3dc('0x8b'),_0x2d5c78[_0xa3dc('0x78')]))&&_0x2d5c78[_0xa3dc('0x8c')]){_0x3bbddb=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x8b'),_0x2d5c78[_0xa3dc('0x78')]);}}return _0x14c4ef[_0xa3dc('0x85')](_0x3bbddb);}})[_0xa3dc('0x2a')](handleError(_0x14c4ef,null));};exports[_0xa3dc('0x8d')]=function(_0x2aeddc,_0x3769a8,_0x17633e){var _0x1ae9ec=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x8e'));var _0x358371={'where':{'id':_0x2aeddc[_0xa3dc('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xa3dc('0x3f')][_0xa3dc('0x62')](_0x358371)[_0xa3dc('0x1f')](handleEntityNotFound(_0x3769a8,null))['then'](function(_0x4b73ae){if(_0x4b73ae){if(!_['isNil'](_0x4b73ae[_0xa3dc('0x7a')])){if(fs['existsSync'](path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x8b'),_0x4b73ae[_0xa3dc('0x7a')]))){_0x1ae9ec=path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x8b'),_0x4b73ae[_0xa3dc('0x7a')]);}}return _0x3769a8[_0xa3dc('0x85')](_0x1ae9ec);}})[_0xa3dc('0x2a')](handleError(_0x3769a8,null));};exports[_0xa3dc('0x8f')]=function(_0x4e5b54,_0x2e4ca9,_0x2046a5){var _0x4da444=require(_0xa3dc('0x90'));var _0x24cb4e=new _0x4da444();var _0xcafa35=_0x24cb4e[_0xa3dc('0x91')](_0x4e5b54[_0xa3dc('0x92')]['user-agent'])[_0xa3dc('0x93')]();var _0x3cf85a={'body':_0x4e5b54['body'],'channel':_0xa3dc('0x94')};var _0x32e690=[];var _0x27c423=[];var _0x1b62cc={};var _0x39aa1f=![];return db['CmContact'][_0xa3dc('0x66')]()[_0xa3dc('0x1f')](function(_0x5a7fe5){if(!_0x5a7fe5){throw new db[(_0xa3dc('0x95'))]['ValidationError'](_0xa3dc('0x96'));}_0x32e690=_[_0xa3dc('0x97')](_[_0xa3dc('0x46')](_0x5a7fe5),['createdAt','updatedAt']);_0x27c423=_['difference'](_[_0xa3dc('0x46')](_0x5a7fe5),[_0xa3dc('0x98'),_0xa3dc('0x99'),_0xa3dc('0x9a'),_0xa3dc('0x9b')]);if(_0x4e5b54[_0xa3dc('0x5d')]['id']){delete _0x4e5b54[_0xa3dc('0x5d')]['id'];}if(_[_0xa3dc('0x82')](_0x4e5b54['body'][_0xa3dc('0x9c')])){throw new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0x9e'));}if(_[_0xa3dc('0x82')](_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0x5d')])||_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0x5d')]===''){throw new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0x9f'));}if(_[_0xa3dc('0x82')](_0x4e5b54[_0xa3dc('0x5d')]['mapKey'])){throw new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0xa0')+_0x27c423);}if(!_['includes'](_0x27c423,_0x4e5b54[_0xa3dc('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0xa3dc('0x9d'))](_0xa3dc('0xa1')+_0x27c423);}_0x1b62cc[_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xa2')]]=_0x4e5b54['body'][_0xa3dc('0x9c')];})[_0xa3dc('0x1f')](function(){return db[_0xa3dc('0x3f')]['find']({'where':{'id':_0x4e5b54[_0xa3dc('0x59')]['id']},'include':[{'model':db[_0xa3dc('0xa3')],'as':'List','include':[{'model':db[_0xa3dc('0xa4')],'as':_0xa3dc('0xa5'),'where':_0x1b62cc,'limit':0x1,'order':[[_0xa3dc('0x99'),_0xa3dc('0xa6')]]}]},{'model':db[_0xa3dc('0xa7')],'as':_0xa3dc('0xa8')}]});})[_0xa3dc('0x1f')](handleEntityNotFound(_0x2e4ca9,null))[_0xa3dc('0x1f')](function(_0xccbf97){if(_0xccbf97&&_0xccbf97[_0xa3dc('0xa9')]){_0x3cf85a['account']=_0xccbf97;_0x3cf85a['applications']=_0xccbf97[_0xa3dc('0xa8')];_0x3cf85a[_0xa3dc('0xaa')]=_0xccbf97[_0xa3dc('0xa9')];_0x3cf85a[_0xa3dc('0xab')]=_[_0xa3dc('0xac')](_0x3cf85a[_0xa3dc('0xab')],[_0xa3dc('0xad')],['asc']);if(_0x3cf85a['account'][_0xa3dc('0xa8')]){delete _0x3cf85a['account']['Applications'];}if(_0x3cf85a[_0xa3dc('0xae')][_0xa3dc('0xa9')]&&_0x3cf85a['account']['List'][_0xa3dc('0xa5')]['length']){return _0x3cf85a[_0xa3dc('0xae')]['List'][_0xa3dc('0xa5')][0x0];}var _0xc10943=_[_0xa3dc('0x16')](_0x4e5b54['body'],{'firstName':_0x4e5b54[_0xa3dc('0x5d')]['from'],'ListId':_0xccbf97[_0xa3dc('0x9b')]});_0xc10943[_0x4e5b54['body'][_0xa3dc('0xa2')]]=_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0x9c')];return db['CmContact'][_0xa3dc('0x5c')](_0xc10943,{'fields':_0x32e690,'raw':!![]});}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x2e4ca9,null))[_0xa3dc('0x1f')](function(_0x2230d5){_0x3cf85a[_0xa3dc('0xaf')]=_0x2230d5;var _0x4746c5=_0x4e5b54['body'][_0xa3dc('0xb0')];if(_0x4e5b54['headers'][_0xa3dc('0xb1')]){_0x4746c5=_0x4e5b54[_0xa3dc('0x92')][_0xa3dc('0xb1')];}else if(_0x4e5b54[_0xa3dc('0x92')][_0xa3dc('0xb2')]){_0x4746c5=_[_0xa3dc('0xb3')](_0x4e5b54[_0xa3dc('0x92')][_0xa3dc('0xb2')][_0xa3dc('0xb4')](','));}if(_0x2230d5){var _0x21b80e={'ContactId':_0x2230d5['id'],'ChatWebsiteId':_0x4e5b54[_0xa3dc('0x59')]['id'],'from':(_0x2230d5['firstName']||'')+'\x20'+(_0x2230d5[_0xa3dc('0xb5')]||''),'customerIp':_0x4746c5,'customerPort':_0x4e5b54[_0xa3dc('0x92')][_0xa3dc('0xb6')]?_0x4e5b54[_0xa3dc('0x92')][_0xa3dc('0xb6')]:null,'referer':_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xb7')],'browserName':_0xcafa35[_0xa3dc('0xb8')][_0xa3dc('0x3a')]&&_0xcafa35['browser'][_0xa3dc('0xb9')]?util[_0xa3dc('0xba')]('%s\x20%s',_0xcafa35[_0xa3dc('0xb8')][_0xa3dc('0x3a')],_0xcafa35[_0xa3dc('0xb8')][_0xa3dc('0xb9')]):_0xa3dc('0xbb'),'browserVersion':_0xcafa35[_0xa3dc('0xb8')][_0xa3dc('0xb9')]||_0xa3dc('0xbb'),'osName':util[_0xa3dc('0xba')](_0xa3dc('0xbc'),_0xcafa35['os']['name'],_0xcafa35['os']['version']),'osVersion':_0xcafa35['os'][_0xa3dc('0xb9')],'deviceModel':_0xcafa35[_0xa3dc('0xbd')][_0xa3dc('0x44')]&&_0xcafa35[_0xa3dc('0xbd')]['vendor']?util[_0xa3dc('0xba')]('%s\x20%s\x20%s',_0xcafa35[_0xa3dc('0xbd')]['model'],_0xcafa35[_0xa3dc('0xbd')]['vendor'],_0xcafa35[_0xa3dc('0xbd')]['type']):null,'deviceVendor':_0xcafa35[_0xa3dc('0xbd')][_0xa3dc('0xbe')],'deviceType':_0xcafa35[_0xa3dc('0xbd')]['type'],'formData':JSON[_0xa3dc('0x25')](_0x4e5b54[_0xa3dc('0x5d')])};var _0x3e2789={'ChatWebsiteId':_0x4e5b54['params']['id'],'closed':![]};if(_0x4e5b54['body']['threadId']){_0x3e2789[_0xa3dc('0xbf')]=_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xbf')];return db[_0xa3dc('0xc0')][_0xa3dc('0x62')]({'where':_0x3e2789})[_0xa3dc('0x1f')](function(_0x40d68f){if(_0x40d68f){return[_0x40d68f,![]];}_0x21b80e['threadId']=_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xbf')];_0x21b80e['externalUrl']=_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xc1')];return db[_0xa3dc('0xc0')][_0xa3dc('0x5c')](_0x21b80e)['then'](function(_0x3e17d0){return[_0x3e17d0,!![]];});});}_0x3e2789[_0xa3dc('0xc2')]=_0x2230d5['id'];if(_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xc3')]&&_0x4e5b54['body'][_0xa3dc('0xc3')]['id']){_0x3e2789['id']=_0x4e5b54[_0xa3dc('0x5d')]['interaction']['id'];return db[_0xa3dc('0xc0')][_0xa3dc('0x62')]({'where':_0x3e2789})['then'](function(_0xd7f523){if(_0xd7f523){return[_0xd7f523,![]];}return db[_0xa3dc('0xc0')][_0xa3dc('0x5c')](_0x21b80e)['then'](function(_0x4b4b59){return[_0x4b4b59,!![]];});});}return db[_0xa3dc('0xc0')][_0xa3dc('0x5c')](_0x21b80e)['then'](function(_0x1029da){return[_0x1029da,!![]];});}})[_0xa3dc('0xc4')](function(_0x3466af,_0x3bbeff){if(_0x3466af){_0x39aa1f=_0x3bbeff;if(!_0x3bbeff){var _0x14ea1f={'from':(_0x3cf85a[_0xa3dc('0xaf')][_0xa3dc('0xc5')]||'')+'\x20'+(_0x3cf85a[_0xa3dc('0xaf')][_0xa3dc('0xb5')]||'')};if(_0x4e5b54['body'][_0xa3dc('0xbf')]&&_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xc6')]&&_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xbf')]!=_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xc6')]){_0x14ea1f[_0xa3dc('0xbf')]=_0x4e5b54[_0xa3dc('0x5d')]['messageId'];}return _0x3466af[_0xa3dc('0x36')](_0x14ea1f);}else{return _0x3466af;}}})['then'](function(_0x3ee0dd){_0x3cf85a[_0xa3dc('0xc3')]=_0x3ee0dd['get']({'plain':!![]});_0x3cf85a['interaction'][_0xa3dc('0xc7')]=_0x39aa1f;if(_0x3cf85a[_0xa3dc('0xc3')][_0xa3dc('0xc7')]){if(_0x3cf85a[_0xa3dc('0xae')]['autoclose']){_0x3cf85a[_0xa3dc('0xab')][_0xa3dc('0xc8')]({'id':0x0,'priority':_0x3cf85a[_0xa3dc('0xab')][_0xa3dc('0x49')]+0x1,'app':_0xa3dc('0xc9'),'appdata':_0xa3dc('0xca'),'interval':_0xa3dc('0xcb')});}}return db[_0xa3dc('0xcc')][_0xa3dc('0x5c')]({'body':_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0x5d')],'ChatWebsiteId':_0x4e5b54['params']['id'],'ChatInteractionId':_0x3ee0dd['id'],'direction':'in','ContactId':_0x3cf85a[_0xa3dc('0xaf')]['id'],'AttachmentId':_0x4e5b54[_0xa3dc('0x5d')][_0xa3dc('0xcd')]});})[_0xa3dc('0x1f')](function(_0x4e21e5){_0x3cf85a[_0xa3dc('0x28')]=_0x4e21e5;if(_0x3cf85a[_0xa3dc('0xc3')][_0xa3dc('0xce')]){return db[_0xa3dc('0xcf')][_0xa3dc('0x62')]({'attributes':['id',_0xa3dc('0x3a')],'where':{'id':_0x3cf85a['interaction'][_0xa3dc('0xce')]}})[_0xa3dc('0x1f')](function(_0x456d50){if(_0x456d50){_0x3cf85a['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x456d50[_0xa3dc('0x3a')]+','+(_0x3cf85a[_0xa3dc('0xae')][_0xa3dc('0xd0')]||0xa),'interval':_0xa3dc('0xcb')});_0x3cf85a[_0xa3dc('0xd1')]=!![];}return respondWithRpcPromise(_0xa3dc('0xd2'),_0xa3dc('0xd3'),_0x3cf85a);});}return respondWithRpcPromise(_0xa3dc('0xd2'),_0xa3dc('0xd3'),_0x3cf85a);})[_0xa3dc('0x1f')](function(_0x274b23){respondWithRpcPromise(_0xa3dc('0xd4'),_0xa3dc('0xd4'),{'event':'notify','message':_0x274b23},client9002);return _0x274b23;})[_0xa3dc('0x1f')](respondWithResult(_0x2e4ca9,null))[_0xa3dc('0x2a')](handleError(_0x2e4ca9,null));};exports[_0xa3dc('0xd5')]=function(_0x11425b,_0x416124,_0x3b29b0){var _0x41cba8,_0xd491b5,_0x5477f8;var _0xd8774d=[];var _0x3b5f38=[];var _0x4fcee2={};var _0x99c7ef=_0x11425b['files']||[];var _0x4b7329=[];var _0x11f4c8;return db[_0xa3dc('0xa4')][_0xa3dc('0x66')]()['then'](function(_0x3944c8){if(!_0x3944c8){throw new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0x96'));}_0x3b5f38=_['difference'](_[_0xa3dc('0x46')](_0x3944c8),[_0xa3dc('0x98'),_0xa3dc('0x99')]);_0xd8774d=_[_0xa3dc('0x97')](_[_0xa3dc('0x46')](_0x3944c8),[_0xa3dc('0x98'),_0xa3dc('0x99'),_0xa3dc('0x9a'),_0xa3dc('0x9b')]);if(_0x11425b[_0xa3dc('0x5d')]['id']){delete _0x11425b['body']['id'];}if(_[_0xa3dc('0x82')](_0x11425b['body']['from'])){throw _0x416124[_0xa3dc('0x31')](0x1f4)['send'](new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0x9e')));}if(_[_0xa3dc('0x82')](_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0x5d')])||_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0x5d')]===''){throw _0x416124[_0xa3dc('0x31')](0x1f4)[_0xa3dc('0xd6')](new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa3dc('0x82')](_0x11425b[_0xa3dc('0x5d')]['mapKeyOffline'])){throw _0x416124[_0xa3dc('0x31')](0x1f4)['send'](new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0xd7')+_0xd8774d));}if(!_[_0xa3dc('0xd8')](_0xd8774d,_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0xd9')])){throw _0x416124[_0xa3dc('0x31')](0x1f4)[_0xa3dc('0xd6')](new db[(_0xa3dc('0x95'))][(_0xa3dc('0x9d'))](_0xa3dc('0xda')+_0xd8774d));}_0x4fcee2[_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0xd9')]]=_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0x9c')];})[_0xa3dc('0x1f')](function(){return db[_0xa3dc('0x3f')]['find']({'where':{'id':_0x11425b[_0xa3dc('0x59')]['id']},'include':[{'model':db[_0xa3dc('0xa3')],'as':_0xa3dc('0xa9')},{'model':db[_0xa3dc('0xdb')],'as':_0xa3dc('0xdb')}]});})['then'](handleEntityNotFound(_0x416124,null))[_0xa3dc('0x1f')](function(_0x2336e9){if(_0x2336e9&&_0x2336e9[_0xa3dc('0xa9')]){_0xd491b5=_0x2336e9;var _0x2db665=_[_0xa3dc('0x16')](_0x11425b['body'],{'firstName':_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0x9c')],'phone':_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0x9c')],'ListId':_0x2336e9[_0xa3dc('0x9b')]});_0x2db665[_0x11425b['body'][_0xa3dc('0xd9')]]=_0x11425b['body']['from'];return db[_0xa3dc('0xa4')][_0xa3dc('0xdc')]({'where':_0x4fcee2,'defaults':_0x2db665});}})['spread'](function(_0x43770f){if(_0x43770f){_0x5477f8=_0x43770f;var _0x2a087d=fs['readFileSync'](path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0xdd')),_0xa3dc('0xde'));var _0x1c1691=ejs[_0xa3dc('0xdf')](_0x2a087d,{'body':_['toPairs'](_0x11425b[_0xa3dc('0x5d')][_0xa3dc('0x5d')]),'bodyTitle':_0xd491b5[_0xa3dc('0xe0')]});return db[_0xa3dc('0xe1')][_0xa3dc('0x5c')]({'body':_0x1c1691,'ContactId':_0x43770f['id'],'ChatWebsiteId':_0xd491b5['id']});}})[_0xa3dc('0x1f')](function(_0xb0e79){_0x11f4c8=_0xb0e79;if(_0x99c7ef[_0xa3dc('0x49')]){var _0x461c75=_0x99c7ef['map'](function(_0xa89210){return{'name':_0xa89210['originalname'],'basename':_0xa89210[_0xa3dc('0x75')],'type':_0xa89210[_0xa3dc('0xe2')],'ChatOfflineMessageId':_0xb0e79['id']};});_0x4b7329=_0x461c75['map'](_0x463fdd=>{var _0x4363d3={'filename':_0x463fdd[_0xa3dc('0x3a')],'path':path['join'](config['root'],'server',_0xa3dc('0xe3'),_0xa3dc('0xe4'),_0xa3dc('0xe5'),_0x463fdd['basename'])};return _0x4363d3;});if(!_0xd491b5[_0xa3dc('0xe6')]){return db['sequelize'][_0xa3dc('0xe7')](function(_0x37da99){return db[_0xa3dc('0xe8')][_0xa3dc('0xe9')](_0x461c75,{'transaction':_0x37da99});});}}})[_0xa3dc('0x1f')](function(){if(_0x11f4c8){_0x41cba8=_0x11f4c8;return db[_0xa3dc('0xdb')][_0xa3dc('0x6a')]({'where':{'active':!![]},'include':[{'model':db[_0xa3dc('0xea')],'as':_0xa3dc('0xeb'),'raw':!![]}]});}})[_0xa3dc('0x1f')](function(_0x3d5d49){if(_0x3d5d49&&_0x3d5d49[_0xa3dc('0xeb')]&&_0xd491b5[_0xa3dc('0xec')]&&_0xd491b5['forwardOfflineAddress']){var _0x179979={'tls':{'rejectUnauthorized':![]}};if(_0x3d5d49[_0xa3dc('0xeb')][_0xa3dc('0xed')]){_0x179979[_0xa3dc('0xed')]=_0x3d5d49[_0xa3dc('0xeb')]['service'];}else{_0x179979[_0xa3dc('0xee')]=_0x3d5d49['Smtp'][_0xa3dc('0xee')];_0x179979[_0xa3dc('0xef')]=_0x3d5d49['Smtp'][_0xa3dc('0xef')];_0x179979[_0xa3dc('0xf0')]=_0x3d5d49[_0xa3dc('0xeb')][_0xa3dc('0xf0')];}if(_0x3d5d49[_0xa3dc('0xeb')][_0xa3dc('0xf1')]){_0x179979[_0xa3dc('0xf2')]={'user':_0x3d5d49[_0xa3dc('0xeb')][_0xa3dc('0x5e')],'pass':_0x3d5d49[_0xa3dc('0xeb')]['pass']};}return respondWithRpcPromise(_0xa3dc('0xf3'),_0xa3dc('0xf4'),{'account':_0x179979,'message':{'from':util[_0xa3dc('0xba')](_0xa3dc('0xf5'),_0x3d5d49[_0xa3dc('0x3a')],_0x3d5d49['email']||_0x3d5d49['Smtp'][_0xa3dc('0x5e')]),'to':_0xd491b5['forwardOfflineAddress'],'subject':_0xd491b5[_0xa3dc('0xf6')],'html':_0x41cba8[_0xa3dc('0x5d')],'attachments':_0x4b7329}},client9003)[_0xa3dc('0x1f')](function(){return _0x41cba8;})['catch'](function(_0x5e84a2){console[_0xa3dc('0x26')](_0x5e84a2);});}})['then'](function(){if(_0xd491b5&&_0xd491b5['openNewInteraction']&&_0xd491b5[_0xa3dc('0xf7')]){var _0x1fdae8=[];if(_0x99c7ef[_0xa3dc('0x49')]){_0x1fdae8=_0x99c7ef['map'](function(_0x21de9e){return{'name':_0x21de9e[_0xa3dc('0xf8')],'basename':_0x21de9e[_0xa3dc('0x75')],'type':_0x21de9e['mimetype'],'ChatOfflineMessageId':_0x11f4c8['id']};});}var _0x272327;if(!_[_0xa3dc('0x82')](_0xd491b5['subjectOffline'])){var _0x39406f=_[_0xa3dc('0x3e')](_0x11425b['body'],function(_0x498931){return _0x498931;});var _0x2275f2=_[_0xa3dc('0xf9')](_0x39406f)[0x0];var _0x331082=_[_0xa3dc('0xfa')](_0x2275f2,function(_0x159823){return _0x159823;});_0x272327=_0x331082[0x1][_0xd491b5['subjectOffline']];}var _0x41e8a9={'from':_0x5477f8['email'],'firstName':_0x5477f8[_0xa3dc('0xc5')],'lastName':_0x5477f8[_0xa3dc('0xb5')],'mapKey':_0xa3dc('0xfb'),'message':{'from':_0x5477f8[_0xa3dc('0xfb')],'to':_0xd491b5[_0xa3dc('0xdb')][_0xa3dc('0xfb')],'cc':'','subject':_[_0xa3dc('0x82')](_0x272327)?_0xd491b5[_0xa3dc('0xf6')]:_0x272327,'messageId':'','sentAt':new Date(),'attach':_0x1fdae8[_0xa3dc('0x49')],'attachments':_0x1fdae8,'originChannel':_0xa3dc('0xfc'),'ChatWebsiteId':_0xd491b5['id'],'ChatOfflineMessageId':_0x41cba8['id'],'originTo':_0xd491b5[_0xa3dc('0xdb')]['email']},'body':_0x41cba8['body']};var _0x1b1852={'account':{'id':_0xd491b5[_0xa3dc('0xf7')]},'body':_0x41e8a9,'log':_0xa3dc('0xfd')};return respondWithRpcPromise('NotifyMailAccount',_0xa3dc('0xfe'),_0x1b1852,client9001)[_0xa3dc('0x1f')](function(){return _0x41cba8;})[_0xa3dc('0x2a')](function(_0x515d4a){console[_0xa3dc('0x26')](_0x515d4a);});}return;})['then'](function(){if(_0x41cba8){return _0x41cba8;}})[_0xa3dc('0x1f')](respondWithResult(_0x416124,null))['catch'](function(_0x11e0c7){console['error'](_0xa3dc('0x2a'),_0x11e0c7);for(var _0x244eb7 of _0x99c7ef){var _0x4bca1d=path['join'](config[_0xa3dc('0x7d')],_0xa3dc('0xff'),_0xa3dc('0xe3'),_0xa3dc('0xe4'),_0xa3dc('0xe5'),_0x244eb7[_0xa3dc('0x75')]);fs_extra[_0xa3dc('0x100')](_0x4bca1d)[_0xa3dc('0x2a')](function(_0x18a2a9){console[_0xa3dc('0x26')](_0xa3dc('0x101'),_0x4bca1d,_0x18a2a9);});}});};exports[_0xa3dc('0x102')]=function(_0x34972a,_0xf55ac4,_0x11be8f){return db[_0xa3dc('0xc0')][_0xa3dc('0x62')]({'where':{'id':_0x34972a[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0xf55ac4,null))[_0xa3dc('0x1f')](function(_0x30088e){if(_0x30088e){return _0x30088e[_0xa3dc('0x102')](_0x34972a[_0xa3dc('0x5d')]['ids'],_[_0xa3dc('0x103')](_0x34972a[_0xa3dc('0x5d')],['ids','id'])||{});}})[_0xa3dc('0x1f')](respondWithResult(_0xf55ac4,null))['catch'](handleError(_0xf55ac4,null));};exports[_0xa3dc('0x104')]=function(_0x596096,_0x5545ca,_0x3dd421){var _0x87aaab={'raw':![],'where':{}};var _0x537de6={};var _0x3641bf={'count':0x0,'rows':[]};return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0x596096['params']['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x5545ca,null))['then'](function(_0x2395eb){if(_0x2395eb){_0x537de6[_0xa3dc('0x44')]=_[_0xa3dc('0x46')](db[_0xa3dc('0xc0')][_0xa3dc('0x40')]);_0x537de6['query']=_[_0xa3dc('0x46')](_0x596096[_0xa3dc('0x45')]);_0x537de6[_0xa3dc('0x5a')]=_['intersection'](_0x537de6[_0xa3dc('0x44')],_0x537de6[_0xa3dc('0x45')]);_0x87aaab[_0xa3dc('0x4a')]=_[_0xa3dc('0x47')](_0x537de6[_0xa3dc('0x44')],qs[_0xa3dc('0x48')](_0x596096['query'][_0xa3dc('0x48')]));_0x87aaab[_0xa3dc('0x4a')]=_0x87aaab['attributes'][_0xa3dc('0x49')]?_0x87aaab['attributes']:_0x537de6[_0xa3dc('0x44')];if(!_0x596096[_0xa3dc('0x45')]['hasOwnProperty'](_0xa3dc('0x4c'))){_0x87aaab[_0xa3dc('0x2f')]=qs[_0xa3dc('0x2f')](_0x596096[_0xa3dc('0x45')][_0xa3dc('0x2f')]);_0x87aaab[_0xa3dc('0x2d')]=qs[_0xa3dc('0x2d')](_0x596096[_0xa3dc('0x45')][_0xa3dc('0x2d')]);}_0x87aaab[_0xa3dc('0x4d')]=qs[_0xa3dc('0x4e')](_0x596096[_0xa3dc('0x45')][_0xa3dc('0x4e')]);_0x87aaab[_0xa3dc('0x51')]=qs['filters'](_['pick'](_0x596096[_0xa3dc('0x45')],_0x537de6[_0xa3dc('0x5a')]));_0x87aaab['where']['ChatWebsiteId']=_0x2395eb['id'];if(_0x596096['query']['filter']){_0x87aaab[_0xa3dc('0x51')]=_[_0xa3dc('0x52')](_0x87aaab[_0xa3dc('0x51')],{'$or':_['map'](_0x87aaab[_0xa3dc('0x4a')],function(_0xd25d25){var _0xf2eec0={};_0xf2eec0[_0xd25d25]={'$like':'%'+_0x596096['query'][_0xa3dc('0x50')]+'%'};return _0xf2eec0;})});}_0x87aaab=_[_0xa3dc('0x52')]({},_0x87aaab,_0x596096['options']);return db[_0xa3dc('0xc0')][_0xa3dc('0x30')]({'where':_0x87aaab[_0xa3dc('0x51')]})['then'](function(_0x36d1b0){_0x3641bf['count']=_0x36d1b0;if(_0x596096[_0xa3dc('0x45')][_0xa3dc('0x54')]){_0x87aaab[_0xa3dc('0x55')]=[{'model':db[_0xa3dc('0xa4')],'as':'Contact','required':![]},{'model':db[_0xa3dc('0xcf')],'as':_0xa3dc('0x105'),'attributes':[_0xa3dc('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xa3dc('0x106')],'as':_0xa3dc('0x107'),'attributes':['id','name',_0xa3dc('0x108')],'where':_0x596096['query'][_0xa3dc('0x109')]?{'id':_0x596096[_0xa3dc('0x45')][_0xa3dc('0x109')]}:undefined,'required':_0x596096[_0xa3dc('0x45')][_0xa3dc('0x109')]?!![]:![]}];}return db[_0xa3dc('0xc0')][_0xa3dc('0x56')](_0x87aaab);})[_0xa3dc('0x1f')](function(_0x34a0d9){_0x3641bf[_0xa3dc('0x57')]=_0x34a0d9;return _0x3641bf;});}})[_0xa3dc('0x1f')](respondWithFilteredResult(_0x5545ca,_0x87aaab))[_0xa3dc('0x2a')](handleError(_0x5545ca,null));};function iftimePromise(_0x37c71d,_0x1c6f95){return respondWithRpcPromise(_0xa3dc('0x10a'),_0xa3dc('0x10b'),{'command':_0x1c6f95[_0xa3dc('0x10c')]?util[_0xa3dc('0xba')](_0xa3dc('0x10d'),_0x37c71d[_0xa3dc('0x10e')],_0x1c6f95[_0xa3dc('0x10c')]):util[_0xa3dc('0xba')](_0xa3dc('0x10f'),_0x37c71d[_0xa3dc('0x10e')])},client9002)[_0xa3dc('0x1f')](function(_0x32ccf2){var _0x117096=_0x32ccf2&&_0x32ccf2[_0xa3dc('0x110')]('true')>=0x0?!![]:![];logger[_0xa3dc('0x20')](_0xa3dc('0x111'),_0x1c6f95['id'],_0x37c71d['id'],_0x37c71d[_0xa3dc('0x10e')],_0x117096?'ONLINE':_0xa3dc('0x112'),_0x1c6f95[_0xa3dc('0x10c')]?_0x1c6f95[_0xa3dc('0x10c')]:_0xa3dc('0x113'));return _0x117096;})[_0xa3dc('0x2a')](function(_0x48aa36){logger[_0xa3dc('0x26')](_0xa3dc('0x111'),_0x1c6f95['id'],_0x37c71d['id'],_0x37c71d['interval'],util[_0xa3dc('0x114')](_0x48aa36,{'showHidden':![],'depth':null}),_0x1c6f95[_0xa3dc('0x10c')]?_0x1c6f95[_0xa3dc('0x10c')]:_0xa3dc('0x113'));return![];});}exports[_0xa3dc('0x10b')]=function(_0x3da873,_0x2fea53,_0x58538b){var _0x501aa3=0x0;var _0x1f58f9=0x0;var _0x29c6a4=![];var _0x487c3a;var _0x389f2e;return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x3da873['params']['id']},'include':[{'model':db[_0xa3dc('0x115')],'as':_0xa3dc('0x115'),'include':[{'model':db[_0xa3dc('0x115')],'as':'Intervals','attributes':['id',_0xa3dc('0x10e')],'raw':!![]}]}]})[_0xa3dc('0x1f')](handleEntityNotFound(_0x2fea53,null))['then'](function(_0xe53d5a){if(_0xe53d5a){_0x487c3a=_0xe53d5a;return _0xe53d5a['getProactiveActions']({'raw':!![]});}})[_0xa3dc('0x1f')](function(_0x388403){if(_0x487c3a){if(_0x388403){_0x389f2e=_0x388403;}}return require('../../config/license/util')[_0xa3dc('0x80')]();})[_0xa3dc('0x1f')](function(_0x35434b){if(_0x35434b){_0x1f58f9=_0x35434b[_0xa3dc('0x116')];_0x29c6a4=_0x35434b[_0xa3dc('0x81')];}})[_0xa3dc('0x1f')](function(){return db[_0xa3dc('0xc0')][_0xa3dc('0x30')]({'where':{'closed':![]}});})[_0xa3dc('0x1f')](function(_0x463dd7){_0x501aa3=_0x463dd7;if(_0x1f58f9&&_0x463dd7>_0x1f58f9){return db[_0xa3dc('0x117')][_0xa3dc('0x6a')]({'where':{'id':0x1}})[_0xa3dc('0x1f')](function(_0xc6009){if(_0xc6009){_0xc6009['increment']('chatLicenseExceeded');}});}})['then'](function(){if(_0x487c3a['Interval']&&_0x487c3a['Interval'][_0xa3dc('0x118')]){var _0x1c4047=[];for(var _0x4e8086=0x0;_0x4e8086<_0x487c3a[_0xa3dc('0x115')]['Intervals']['length'];_0x4e8086++){var _0x4a6019=_0x487c3a[_0xa3dc('0x115')][_0xa3dc('0x118')][_0x4e8086][_0xa3dc('0x38')]({'plain':!![]});_0x1c4047[_0xa3dc('0xc8')](iftimePromise(_0x4a6019,_0x487c3a));}return BPromise['all'](_0x1c4047)['then'](function(_0x1248df){return _[_0xa3dc('0x119')](_0x1248df);});}else{return!![];}})[_0xa3dc('0x1f')](function(_0x20575b){var _0x8efe0d=fs[_0xa3dc('0x11a')](path[_0xa3dc('0x7c')](config[_0xa3dc('0x7d')],_0xa3dc('0x11b')),_0xa3dc('0xde'));var _0x130a89={'remote':_0x487c3a[_0xa3dc('0x11c')],'query':querystring[_0xa3dc('0x25')](_[_0xa3dc('0x52')](_0x487c3a[_0xa3dc('0x38')]({'plain':!![]}),{'customerIp':_0x3da873[_0xa3dc('0x92')][_0xa3dc('0xb2')]||_0x3da873[_0xa3dc('0x92')][_0xa3dc('0x11d')]||_0x3da873[_0xa3dc('0x11e')][_0xa3dc('0x11f')]||_0x3da873['ip'],'referer':_0x3da873[_0xa3dc('0x92')]['referer'],'openedInteractions':_0x501aa3,'maxInteractions':_0x1f58f9,'virtual':_0x29c6a4[_0xa3dc('0x116')],'online':_0x20575b,'custom':_0x29c6a4}))['replace'](/'/g,'\x5c\x27')};_0x2fea53[_0xa3dc('0xd6')](ejs[_0xa3dc('0xdf')](Mustache['render'](_0x8efe0d,_0x130a89),{'proactiveActions':_0x389f2e,'alignment':_0x487c3a[_0xa3dc('0x120')],'verticalAlignment':_0x487c3a[_0xa3dc('0x121')],'div_color':_0x487c3a[_0xa3dc('0x108')],'text_color':_0x487c3a[_0xa3dc('0x122')],'button_color':_0x487c3a[_0xa3dc('0x123')],'background_color':_0x487c3a[_0xa3dc('0x124')]}));})['catch'](handleError(_0x2fea53,null));};exports[_0xa3dc('0x125')]=function(_0x2bfd26,_0x4bb432,_0x2046ea){return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0x2bfd26[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x4bb432,null))[_0xa3dc('0x1f')](function(_0x46e95c){if(_0x46e95c){return db['sequelize']['transaction'](function(_0x40c65c){return db[_0xa3dc('0xa7')][_0xa3dc('0x37')]({'where':{'ChatWebsiteId':_0x2bfd26['params']['id']},'transaction':_0x40c65c})[_0xa3dc('0x1f')](function(_0x2504b9){var _0x53fc66=_[_0xa3dc('0x3e')](_0x2bfd26['body'],function(_0x4dfd5d){_0x4dfd5d[_0xa3dc('0x6b')]=_0x2bfd26[_0xa3dc('0x59')]['id'];return _0x4dfd5d;});return db[_0xa3dc('0xa7')][_0xa3dc('0xe9')](_0x53fc66,{'transaction':_0x40c65c});});})[_0xa3dc('0x1f')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x2bfd26[_0xa3dc('0x59')]['id']},'order':_0xa3dc('0xad')});});}})[_0xa3dc('0x1f')](respondWithResult(_0x4bb432,null))['catch'](handleError(_0x4bb432,null));};exports[_0xa3dc('0x126')]=function(_0x3c99db,_0x1fe557,_0x56c15f){var _0x4c1301={};var _0x2dac64={};var _0x32748a;var _0x483a76;return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0x3c99db['params']['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x1fe557,null))[_0xa3dc('0x1f')](function(_0x2812a){if(_0x2812a){_0x32748a=_0x2812a;_0x2dac64[_0xa3dc('0x44')]=_[_0xa3dc('0x46')](db[_0xa3dc('0xa7')]['rawAttributes']);_0x2dac64[_0xa3dc('0x45')]=_[_0xa3dc('0x46')](_0x3c99db[_0xa3dc('0x45')]);_0x2dac64['filters']=_['intersection'](_0x2dac64['model'],_0x2dac64[_0xa3dc('0x45')]);_0x4c1301[_0xa3dc('0x4a')]=_['intersection'](_0x2dac64[_0xa3dc('0x44')],qs[_0xa3dc('0x48')](_0x3c99db['query'][_0xa3dc('0x48')]));_0x4c1301[_0xa3dc('0x4a')]=_0x4c1301[_0xa3dc('0x4a')][_0xa3dc('0x49')]?_0x4c1301[_0xa3dc('0x4a')]:_0x2dac64[_0xa3dc('0x44')];_0x4c1301[_0xa3dc('0x4d')]=qs['sort'](_0x3c99db[_0xa3dc('0x45')]['sort']);_0x4c1301[_0xa3dc('0x51')]=qs[_0xa3dc('0x5a')](_[_0xa3dc('0x4f')](_0x3c99db[_0xa3dc('0x45')],_0x2dac64[_0xa3dc('0x5a')]));if(_0x3c99db[_0xa3dc('0x45')]['filter']){_0x4c1301['where']=_['merge'](_0x4c1301['where'],{'$or':_[_0xa3dc('0x3e')](_0x4c1301[_0xa3dc('0x4a')],function(_0x4f7877){var _0x354e3e={};_0x354e3e[_0x4f7877]={'$like':'%'+_0x3c99db[_0xa3dc('0x45')][_0xa3dc('0x50')]+'%'};return _0x354e3e;})});}_0x4c1301=_[_0xa3dc('0x52')]({},_0x4c1301,_0x3c99db[_0xa3dc('0x5b')]);return _0x32748a[_0xa3dc('0x126')](_0x4c1301);}})[_0xa3dc('0x1f')](function(_0x1e6a9c){if(_0x1e6a9c){_0x483a76=_0x1e6a9c['length'];if(!_0x3c99db[_0xa3dc('0x45')][_0xa3dc('0x4b')](_0xa3dc('0x4c'))){_0x4c1301[_0xa3dc('0x2f')]=qs[_0xa3dc('0x2f')](_0x3c99db[_0xa3dc('0x45')]['limit']);_0x4c1301['offset']=qs['offset'](_0x3c99db[_0xa3dc('0x45')]['offset']);}return _0x32748a[_0xa3dc('0x126')](_0x4c1301);}})[_0xa3dc('0x1f')](function(_0x52322f){if(_0x52322f){return _0x52322f?{'count':_0x483a76,'rows':_0x52322f}:null;}})[_0xa3dc('0x1f')](respondWithResult(_0x1fe557,null))[_0xa3dc('0x2a')](handleError(_0x1fe557,null));};exports[_0xa3dc('0x127')]=function(_0x21bb5a,_0x43a613,_0x35ed23){return db[_0xa3dc('0x128')]['find']({'where':{'id':_0x21bb5a[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x43a613,null))[_0xa3dc('0x1f')](function(_0x43cff1){if(_0x43cff1){return _0x43cff1[_0xa3dc('0x127')](_0x21bb5a['body']['ids'],_['omit'](_0x21bb5a[_0xa3dc('0x5d')],[_0xa3dc('0x6d'),'id'])||{});}})[_0xa3dc('0x1f')](respondWithResult(_0x43a613,null))['catch'](handleError(_0x43a613,null));};exports[_0xa3dc('0x129')]=function(_0xbc7795,_0x52e95e,_0x13fbac){var _0x1882b7={};var _0x5853f2={};var _0x3257aa;var _0x2f6a72;return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0xbc7795[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x52e95e,null))[_0xa3dc('0x1f')](function(_0x454947){if(_0x454947){_0x3257aa=_0x454947;_0x5853f2[_0xa3dc('0x44')]=_['keys'](db[_0xa3dc('0x12a')][_0xa3dc('0x40')]);_0x5853f2['query']=_[_0xa3dc('0x46')](_0xbc7795[_0xa3dc('0x45')]);_0x5853f2[_0xa3dc('0x5a')]=_[_0xa3dc('0x47')](_0x5853f2[_0xa3dc('0x44')],_0x5853f2['query']);_0x1882b7[_0xa3dc('0x4a')]=_['intersection'](_0x5853f2[_0xa3dc('0x44')],qs['fields'](_0xbc7795[_0xa3dc('0x45')][_0xa3dc('0x48')]));_0x1882b7['attributes']=_0x1882b7[_0xa3dc('0x4a')][_0xa3dc('0x49')]?_0x1882b7[_0xa3dc('0x4a')]:_0x5853f2[_0xa3dc('0x44')];_0x1882b7[_0xa3dc('0x4d')]=qs['sort'](_0xbc7795[_0xa3dc('0x45')][_0xa3dc('0x4e')]);_0x1882b7['where']=qs[_0xa3dc('0x5a')](_[_0xa3dc('0x4f')](_0xbc7795[_0xa3dc('0x45')],_0x5853f2[_0xa3dc('0x5a')]));if(_0xbc7795[_0xa3dc('0x45')][_0xa3dc('0x50')]){_0x1882b7['where']=_[_0xa3dc('0x52')](_0x1882b7[_0xa3dc('0x51')],{'$or':_[_0xa3dc('0x3e')](_0x1882b7[_0xa3dc('0x4a')],function(_0x1dadfc){var _0xf60534={};_0xf60534[_0x1dadfc]={'$like':'%'+_0xbc7795[_0xa3dc('0x45')]['filter']+'%'};return _0xf60534;})});}_0x1882b7=_['merge']({},_0x1882b7,_0xbc7795[_0xa3dc('0x5b')]);return _0x3257aa[_0xa3dc('0x129')](_0x1882b7);}})[_0xa3dc('0x1f')](function(_0x5f4cc7){if(_0x5f4cc7){_0x2f6a72=_0x5f4cc7['length'];if(!_0xbc7795[_0xa3dc('0x45')][_0xa3dc('0x4b')](_0xa3dc('0x4c'))){_0x1882b7['limit']=qs['limit'](_0xbc7795[_0xa3dc('0x45')][_0xa3dc('0x2f')]);_0x1882b7['offset']=qs[_0xa3dc('0x2d')](_0xbc7795['query']['offset']);}return _0x3257aa[_0xa3dc('0x129')](_0x1882b7);}})[_0xa3dc('0x1f')](function(_0x3659d8){if(_0x3659d8){return _0x3659d8?{'count':_0x2f6a72,'rows':_0x3659d8}:null;}})[_0xa3dc('0x1f')](respondWithResult(_0x52e95e,null))['catch'](handleError(_0x52e95e,null));};exports[_0xa3dc('0x12b')]=function(_0x472da5,_0x33f7e4,_0x436ab7){var _0xea6553=_0x472da5[_0xa3dc('0x45')][_0xa3dc('0x12c')]==='false'?'offlineForm':_0xa3dc('0x12d');return db['ChatWebsite']['find']({'attributes':['id',_0xea6553],'where':{'id':_0x472da5[_0xa3dc('0x59')]['id']}})['then'](handleEntityNotFound(_0x33f7e4,null))[_0xa3dc('0x1f')](function(_0x515f37){if(_0x515f37){var _0xdf3d9b=_0x515f37[_0xea6553];var _0x52d74b=_0xdf3d9b&&_0xdf3d9b[_0xa3dc('0x12e')]?_0xdf3d9b[_0xa3dc('0x12e')]:[];_0x33f7e4[_0xa3dc('0xd6')]({'fromKey':_['isNil'](_0xdf3d9b[_0xa3dc('0x12f')])?undefined:_0xdf3d9b[_0xa3dc('0x12f')],'count':_0x52d74b[_0xa3dc('0x49')],'rows':_0x52d74b});}})[_0xa3dc('0x2a')](handleError(_0x33f7e4,null));};exports[_0xa3dc('0x130')]=function(_0x1a6ef4,_0x43c3a6,_0x48f31c){var _0x42c4d2={'raw':![],'where':{}};var _0x5e8c02={};var _0x139073={'count':0x0,'rows':[]};return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0x1a6ef4[_0xa3dc('0x59')]['id']}})['then'](handleEntityNotFound(_0x43c3a6,null))[_0xa3dc('0x1f')](function(_0x41609d){if(_0x41609d){_0x5e8c02[_0xa3dc('0x44')]=_[_0xa3dc('0x46')](db['ChatOfflineMessage'][_0xa3dc('0x40')]);_0x5e8c02[_0xa3dc('0x45')]=_[_0xa3dc('0x46')](_0x1a6ef4[_0xa3dc('0x45')]);_0x5e8c02[_0xa3dc('0x5a')]=_[_0xa3dc('0x47')](_0x5e8c02[_0xa3dc('0x44')],_0x5e8c02[_0xa3dc('0x45')]);_0x42c4d2['attributes']=_[_0xa3dc('0x47')](_0x5e8c02[_0xa3dc('0x44')],qs[_0xa3dc('0x48')](_0x1a6ef4[_0xa3dc('0x45')]['fields']));_0x42c4d2[_0xa3dc('0x4a')]=_0x42c4d2[_0xa3dc('0x4a')]['length']?_0x42c4d2[_0xa3dc('0x4a')]:_0x5e8c02['model'];if(!_0x1a6ef4[_0xa3dc('0x45')]['hasOwnProperty'](_0xa3dc('0x4c'))){_0x42c4d2[_0xa3dc('0x2f')]=qs['limit'](_0x1a6ef4['query'][_0xa3dc('0x2f')]);_0x42c4d2['offset']=qs[_0xa3dc('0x2d')](_0x1a6ef4['query'][_0xa3dc('0x2d')]);}_0x42c4d2[_0xa3dc('0x4d')]=qs[_0xa3dc('0x4e')](_0x1a6ef4['query'][_0xa3dc('0x4e')]);_0x42c4d2[_0xa3dc('0x51')]=qs[_0xa3dc('0x5a')](_['pick'](_0x1a6ef4['query'],_0x5e8c02['filters']));_0x42c4d2[_0xa3dc('0x51')][_0xa3dc('0x6b')]=_0x41609d['id'];if(_0x1a6ef4[_0xa3dc('0x45')][_0xa3dc('0x50')]){_0x42c4d2[_0xa3dc('0x51')]=_['merge'](_0x42c4d2['where'],{'$or':_[_0xa3dc('0x3e')](_0x42c4d2[_0xa3dc('0x4a')],function(_0x5a8823){var _0x67bf2c={};_0x67bf2c[_0x5a8823]={'$like':'%'+_0x1a6ef4[_0xa3dc('0x45')][_0xa3dc('0x50')]+'%'};return _0x67bf2c;})});}_0x42c4d2=_[_0xa3dc('0x52')]({},_0x42c4d2,_0x1a6ef4['options']);return db[_0xa3dc('0xe1')]['count']({'where':_0x42c4d2[_0xa3dc('0x51')]})[_0xa3dc('0x1f')](function(_0x497bbc){_0x139073[_0xa3dc('0x30')]=_0x497bbc;if(_0x1a6ef4[_0xa3dc('0x45')][_0xa3dc('0x54')]){_0x42c4d2['include']=[{'all':!![]}];}else{_0x42c4d2['include']=[{'model':db['CmContact'],'as':_0xa3dc('0x131'),'required':![]},{'model':db[_0xa3dc('0xe8')],'as':_0xa3dc('0x132'),'required':![]}];}return db['ChatOfflineMessage'][_0xa3dc('0x56')](_0x42c4d2);})[_0xa3dc('0x1f')](function(_0x38c5a3){_0x139073[_0xa3dc('0x57')]=_0x38c5a3;return _0x139073;});}})[_0xa3dc('0x1f')](respondWithFilteredResult(_0x43c3a6,_0x42c4d2))[_0xa3dc('0x2a')](handleError(_0x43c3a6,null));};exports[_0xa3dc('0x133')]=function(_0x48ec17,_0x5b7f0f,_0x4b7f40){return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x48ec17[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x5b7f0f,null))[_0xa3dc('0x1f')](function(_0x47cd97){if(_0x47cd97){return _0x47cd97[_0xa3dc('0x133')](_0x48ec17[_0xa3dc('0x5d')]['ids'],_[_0xa3dc('0x103')](_0x48ec17['body'],['ids','id'])||{})[_0xa3dc('0xc4')](function(_0x3183be){for(var _0x3b99bb=0x0;_0x3b99bb<_0x48ec17[_0xa3dc('0x5d')]['ids'][_0xa3dc('0x49')];_0x3b99bb+=0x1){socket[_0xa3dc('0x134')](_0xa3dc('0x135'),{'UserId':Number(_0x48ec17['body']['ids'][_0x3b99bb]),'ChatWebsiteId':Number(_0x48ec17[_0xa3dc('0x59')]['id'])});}return _0x3183be;});}})[_0xa3dc('0x1f')](respondWithResult(_0x5b7f0f,null))['catch'](handleError(_0x5b7f0f,null));};exports['removeAgents']=function(_0x38292d,_0x57e724,_0x55032e){return db[_0xa3dc('0x3f')][_0xa3dc('0x62')]({'where':{'id':_0x38292d[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x57e724,null))['then'](function(_0x554623){if(_0x554623){return _0x554623[_0xa3dc('0x136')](_0x38292d[_0xa3dc('0x45')][_0xa3dc('0x6d')])[_0xa3dc('0x1f')](function(){if(_[_0xa3dc('0x137')](_0x38292d[_0xa3dc('0x45')][_0xa3dc('0x6d')])){for(var _0x2966d4=0x0;_0x2966d4<_0x38292d[_0xa3dc('0x45')][_0xa3dc('0x6d')]['length'];_0x2966d4+=0x1){socket[_0xa3dc('0x134')](_0xa3dc('0x138'),{'UserId':Number(_0x38292d[_0xa3dc('0x45')][_0xa3dc('0x6d')][_0x2966d4]),'ChatWebsiteId':Number(_0x38292d['params']['id'])});}}else{socket['emit'](_0xa3dc('0x138'),{'UserId':Number(_0x38292d[_0xa3dc('0x45')][_0xa3dc('0x6d')]),'ChatWebsiteId':Number(_0x38292d[_0xa3dc('0x59')]['id'])});}});}})[_0xa3dc('0x1f')](respondWithStatusCode(_0x57e724,null))[_0xa3dc('0x2a')](handleError(_0x57e724,null));};exports[_0xa3dc('0x139')]=function(_0x29d43a,_0x1ec940,_0x54838f){var _0x2c9354={};var _0x156364={};var _0x31d527;var _0xe74bf;return db[_0xa3dc('0x3f')][_0xa3dc('0x6a')]({'where':{'id':_0x29d43a[_0xa3dc('0x59')]['id']}})[_0xa3dc('0x1f')](handleEntityNotFound(_0x1ec940,null))[_0xa3dc('0x1f')](function(_0x4ce7c6){if(_0x4ce7c6){_0x31d527=_0x4ce7c6;_0x156364[_0xa3dc('0x44')]=_['keys'](db[_0xa3dc('0xcf')]['rawAttributes']);_0x156364[_0xa3dc('0x45')]=_[_0xa3dc('0x46')](_0x29d43a['query']);_0x156364[_0xa3dc('0x5a')]=_[_0xa3dc('0x47')](_0x156364[_0xa3dc('0x44')],_0x156364[_0xa3dc('0x45')]);_0x2c9354[_0xa3dc('0x4a')]=_[_0xa3dc('0x47')](_0x156364[_0xa3dc('0x44')],qs[_0xa3dc('0x48')](_0x29d43a[_0xa3dc('0x45')][_0xa3dc('0x48')]));_0x2c9354['attributes']=_0x2c9354[_0xa3dc('0x4a')][_0xa3dc('0x49')]?_0x2c9354[_0xa3dc('0x4a')]:_0x156364[_0xa3dc('0x44')];_0x2c9354[_0xa3dc('0x4d')]=qs[_0xa3dc('0x4e')](_0x29d43a['query'][_0xa3dc('0x4e')]);_0x2c9354[_0xa3dc('0x51')]=qs[_0xa3dc('0x5a')](_[_0xa3dc('0x4f')](_0x29d43a[_0xa3dc('0x45')],_0x156364[_0xa3dc('0x5a')]));if(_0x29d43a[_0xa3dc('0x45')][_0xa3dc('0x50')]){_0x2c9354['where']=_[_0xa3dc('0x52')](_0x2c9354['where'],{'$or':_[_0xa3dc('0x3e')](_0x2c9354['attributes'],function(_0x696d99){var _0x1087fb={};_0x1087fb[_0x696d99]={'$like':'%'+_0x29d43a[_0xa3dc('0x45')][_0xa3dc('0x50')]+'%'};return _0x1087fb;})});}_0x2c9354=_[_0xa3dc('0x52')]({},_0x2c9354,_0x29d43a['options']);return _0x31d527['getAgents'](_0x2c9354);}})[_0xa3dc('0x1f')](function(_0x1b097e){if(_0x1b097e){_0xe74bf=_0x1b097e[_0xa3dc('0x49')];if(!_0x29d43a[_0xa3dc('0x45')][_0xa3dc('0x4b')](_0xa3dc('0x4c'))){_0x2c9354[_0xa3dc('0x2f')]=qs[_0xa3dc('0x2f')](_0x29d43a['query'][_0xa3dc('0x2f')]);_0x2c9354['offset']=qs[_0xa3dc('0x2d')](_0x29d43a[_0xa3dc('0x45')][_0xa3dc('0x2d')]);}return _0x31d527[_0xa3dc('0x139')](_0x2c9354);}})[_0xa3dc('0x1f')](function(_0xbd0bbc){if(_0xbd0bbc){return _0xbd0bbc?{'count':_0xe74bf,'rows':_0xbd0bbc}:null;}})[_0xa3dc('0x1f')](respondWithResult(_0x1ec940,null))[_0xa3dc('0x2a')](handleError(_0x1ec940,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 71a12f0..5ac4b2a 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 _0x14ee=['update','remove','hook','exports','events','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14ee,0x115));var _0xe14e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14ee[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe14e('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe14e('0x1')](0x0);var events={'afterCreate':_0xe14e('0x2'),'afterUpdate':_0xe14e('0x3'),'afterDestroy':_0xe14e('0x4')};function emitEvent(_0x244b80){return function(_0x5db128,_0x1c8074,_0xb8bb83){ChatWebsiteEvents['emit'](_0x244b80+':'+_0x5db128['id'],_0x5db128);ChatWebsiteEvents['emit'](_0x244b80,_0x5db128);_0xb8bb83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xe14e('0x5')](e,emitEvent(event));}}module[_0xe14e('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x872a=['setMaxListeners','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite'];(function(_0x52af6f,_0x2f1482){var _0x1f49d4=function(_0x190bcb){while(--_0x190bcb){_0x52af6f['push'](_0x52af6f['shift']());}};_0x1f49d4(++_0x2f1482);}(_0x872a,0x100));var _0xa872=function(_0x1b4690,_0x257683){_0x1b4690=_0x1b4690-0x0;var _0x12f52e=_0x872a[_0x1b4690];return _0x12f52e;};'use strict';var EventEmitter=require(_0xa872('0x0'));var ChatWebsite=require(_0xa872('0x1'))['db'][_0xa872('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa872('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15a8e0){return function(_0x58715a,_0x2854a7,_0x2b0489){ChatWebsiteEvents[_0xa872('0x4')](_0x15a8e0+':'+_0x58715a['id'],_0x58715a);ChatWebsiteEvents[_0xa872('0x4')](_0x15a8e0,_0x58715a);_0x2b0489(null);};}for(var e in events){if(events[_0xa872('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xa872('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 0f29a84..4d46382 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 _0xdccb=['ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x46759d,_0x13e994){var _0x3e7fe0=function(_0x2f427d){while(--_0x2f427d){_0x46759d['push'](_0x46759d['shift']());}};_0x3e7fe0(++_0x13e994);}(_0xdccb,0x16a));var _0xbdcc=function(_0xdfc87d,_0x28e1a5){_0xdfc87d=_0xdfc87d-0x0;var _0x4e2a5e=_0xdccb[_0xdfc87d];return _0x4e2a5e;};'use strict';var _=require(_0xbdcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdcc('0x1'));var moment=require(_0xbdcc('0x2'));var BPromise=require(_0xbdcc('0x3'));var rp=require(_0xbdcc('0x4'));var fs=require('fs');var path=require(_0xbdcc('0x5'));var rimraf=require(_0xbdcc('0x6'));var config=require(_0xbdcc('0x7'));var attributes=require(_0xbdcc('0x8'));module[_0xbdcc('0x9')]=function(_0x598516,_0x2dfd56){return _0x598516['define'](_0xbdcc('0xa'),attributes,{'tableName':_0xbdcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f88=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x2981d7,_0x13c09e){var _0x6834d8=function(_0x490134){while(--_0x490134){_0x2981d7['push'](_0x2981d7['shift']());}};_0x6834d8(++_0x13c09e);}(_0x4f88,0x99));var _0x84f8=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x4f88[_0x3792e6];return _0x441e44;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require(_0x84f8('0x2'))('api');var moment=require(_0x84f8('0x3'));var BPromise=require(_0x84f8('0x4'));var rp=require(_0x84f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84f8('0x6'));var config=require(_0x84f8('0x7'));var attributes=require(_0x84f8('0x8'));module[_0x84f8('0x9')]=function(_0x28252,_0x298d61){return _0x28252['define'](_0x84f8('0xa'),attributes,{'tableName':_0x84f8('0xb'),'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 9f77417..ae5c04f 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 _0xb9bf=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x2a215e,_0x5d121d){var _0x2f4ca8=function(_0x34519f){while(--_0x34519f){_0x2a215e['push'](_0x2a215e['shift']());}};_0x2f4ca8(++_0x5d121d);}(_0xb9bf,0x1af));var _0xfb9b=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb9bf[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require(_0xfb9b('0x0'));var moment=require(_0xfb9b('0x1'));var BPromise=require('bluebird');var rs=require(_0xfb9b('0x2'));var fs=require('fs');var Redis=require(_0xfb9b('0x3'));var db=require(_0xfb9b('0x4'))['db'];var utils=require(_0xfb9b('0x5'));var logger=require(_0xfb9b('0x6'))(_0xfb9b('0x7'));var config=require(_0xfb9b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfb9b('0x9')]({'port':0x232a});config[_0xfb9b('0xa')]=_[_0xfb9b('0xb')](config[_0xfb9b('0xa')],{'host':_0xfb9b('0xc'),'port':0x18eb});var socket=require(_0xfb9b('0xd'))(new Redis(config[_0xfb9b('0xa')]));require(_0xfb9b('0xe'))[_0xfb9b('0xf')](socket);function respondWithRpcPromise(_0x164d6a,_0x24c434,_0x207bab){return new BPromise(function(_0x5dc46d,_0x518a26){return client[_0xfb9b('0x10')](_0x164d6a,_0x207bab)[_0xfb9b('0x11')](function(_0x542621){logger[_0xfb9b('0x12')](_0xfb9b('0x13'),_0x24c434,_0xfb9b('0x14'));logger[_0xfb9b('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x24c434,_0xfb9b('0x14'),JSON[_0xfb9b('0x16')](_0x542621));if(_0x542621[_0xfb9b('0x17')]){if(_0x542621[_0xfb9b('0x17')]['code']===0x1f4){logger[_0xfb9b('0x17')](_0xfb9b('0x13'),_0x24c434,_0x542621[_0xfb9b('0x17')][_0xfb9b('0x18')]);return _0x518a26(_0x542621['error'][_0xfb9b('0x18')]);}logger[_0xfb9b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x24c434,_0x542621[_0xfb9b('0x17')][_0xfb9b('0x18')]);return _0x5dc46d(_0x542621[_0xfb9b('0x17')][_0xfb9b('0x18')]);}else{logger[_0xfb9b('0x12')](_0xfb9b('0x13'),_0x24c434,_0xfb9b('0x14'));_0x5dc46d(_0x542621[_0xfb9b('0x19')][_0xfb9b('0x18')]);}})['catch'](function(_0x4a3720){logger['error'](_0xfb9b('0x13'),_0x24c434,_0x4a3720);_0x518a26(_0x4a3720);});});} \ No newline at end of file +var _0xdd2c=['client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0xdd2c,0x6b));var _0xcdd2=function(_0x7e32ea,_0x36c432){_0x7e32ea=_0x7e32ea-0x0;var _0x238791=_0xdd2c[_0x7e32ea];return _0x238791;};'use strict';var _=require(_0xcdd2('0x0'));var util=require(_0xcdd2('0x1'));var moment=require('moment');var BPromise=require(_0xcdd2('0x2'));var rs=require(_0xcdd2('0x3'));var fs=require('fs');var Redis=require(_0xcdd2('0x4'));var db=require(_0xcdd2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdd2('0x6'))(_0xcdd2('0x7'));var config=require('../../config/environment');var jayson=require(_0xcdd2('0x8'));var client=jayson[_0xcdd2('0x9')][_0xcdd2('0xa')]({'port':0x232a});config[_0xcdd2('0xb')]=_[_0xcdd2('0xc')](config['redis'],{'host':_0xcdd2('0xd'),'port':0x18eb});var socket=require(_0xcdd2('0xe'))(new Redis(config[_0xcdd2('0xb')]));require(_0xcdd2('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c2f5f,_0x19e4b4,_0x467c36){return new BPromise(function(_0x5008cb,_0x514e8e){return client[_0xcdd2('0x10')](_0x2c2f5f,_0x467c36)[_0xcdd2('0x11')](function(_0x549069){logger[_0xcdd2('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x19e4b4,_0xcdd2('0x13'));logger[_0xcdd2('0x14')](_0xcdd2('0x15'),_0x19e4b4,_0xcdd2('0x13'),JSON[_0xcdd2('0x16')](_0x549069));if(_0x549069['error']){if(_0x549069[_0xcdd2('0x17')][_0xcdd2('0x18')]===0x1f4){logger['error'](_0xcdd2('0x19'),_0x19e4b4,_0x549069[_0xcdd2('0x17')][_0xcdd2('0x1a')]);return _0x514e8e(_0x549069['error'][_0xcdd2('0x1a')]);}logger[_0xcdd2('0x17')](_0xcdd2('0x19'),_0x19e4b4,_0x549069['error'][_0xcdd2('0x1a')]);return _0x5008cb(_0x549069[_0xcdd2('0x17')][_0xcdd2('0x1a')]);}else{logger['info'](_0xcdd2('0x19'),_0x19e4b4,_0xcdd2('0x13'));_0x5008cb(_0x549069[_0xcdd2('0x1b')][_0xcdd2('0x1a')]);}})[_0xcdd2('0x1c')](function(_0x34cc88){logger[_0xcdd2('0x17')](_0xcdd2('0x19'),_0x19e4b4,_0x34cc88);_0x514e8e(_0x34cc88);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 256eed3..4b1c364 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 _0xc906=['length','./chatWebsite.events','save','update','removeListener','register'];(function(_0x235ada,_0x96d7af){var _0x25e3ff=function(_0x178b49){while(--_0x178b49){_0x235ada['push'](_0x235ada['shift']());}};_0x25e3ff(++_0x96d7af);}(_0xc906,0x109));var _0x6c90=function(_0x37dd34,_0x424244){_0x37dd34=_0x37dd34-0x0;var _0x34c993=_0xc906[_0x37dd34];return _0x34c993;};'use strict';var ChatWebsiteEvents=require(_0x6c90('0x0'));var events=[_0x6c90('0x1'),'remove',_0x6c90('0x2')];function createListener(_0x41cabe,_0x1e8dcc){return function(_0x138bd0){_0x1e8dcc['emit'](_0x41cabe,_0x138bd0);};}function removeListener(_0x3e4aca,_0xd66b09){return function(){ChatWebsiteEvents[_0x6c90('0x3')](_0x3e4aca,_0xd66b09);};}exports[_0x6c90('0x4')]=function(_0x3293e8){for(var _0x4669c5=0x0,_0xb397a7=events[_0x6c90('0x5')];_0x4669c5<_0xb397a7;_0x4669c5++){var _0x13f947=events[_0x4669c5];var _0x147a14=createListener('chatWebsite:'+_0x13f947,_0x3293e8);ChatWebsiteEvents['on'](_0x13f947,_0x147a14);}}; \ No newline at end of file +var _0x3ea2=['emit','removeListener','register','length','./chatWebsite.events','save','remove'];(function(_0x3b04a4,_0x51fcc1){var _0x15c651=function(_0x540707){while(--_0x540707){_0x3b04a4['push'](_0x3b04a4['shift']());}};_0x15c651(++_0x51fcc1);}(_0x3ea2,0xba));var _0x23ea=function(_0xe01d60,_0x340301){_0xe01d60=_0xe01d60-0x0;var _0x46d858=_0x3ea2[_0xe01d60];return _0x46d858;};'use strict';var ChatWebsiteEvents=require(_0x23ea('0x0'));var events=[_0x23ea('0x1'),_0x23ea('0x2'),'update'];function createListener(_0x12b42e,_0x22e4dd){return function(_0x311c81){_0x22e4dd[_0x23ea('0x3')](_0x12b42e,_0x311c81);};}function removeListener(_0x4128f9,_0x37c72a){return function(){ChatWebsiteEvents[_0x23ea('0x4')](_0x4128f9,_0x37c72a);};}exports[_0x23ea('0x5')]=function(_0x55bb34){for(var _0x523e07=0x0,_0x374951=events[_0x23ea('0x6')];_0x523e07<_0x374951;_0x523e07++){var _0x1de389=events[_0x523e07];var _0x391046=createListener('chatWebsite:'+_0x1de389,_0x55bb34);ChatWebsiteEvents['on'](_0x1de389,_0x391046);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ec436c6..60eeaf2 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 _0x37c3=['diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','file','server/files/images/avatars/','addCustomerAvatar','join','/:id/notify','notify','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','addApplications','addProactiveActions','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','/:id/dispositions','addDisposition'];(function(_0x126158,_0x1b9785){var _0x5a2978=function(_0x140322){while(--_0x140322){_0x126158['push'](_0x126158['shift']());}};_0x5a2978(++_0x1b9785);}(_0x37c3,0x122));var _0x337c=function(_0x27b20e,_0x302f69){_0x27b20e=_0x27b20e-0x0;var _0x58950b=_0x37c3[_0x27b20e];return _0x58950b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x337c('0x0'));var timeout=require('connect-timeout');var express=require(_0x337c('0x1'));var router=express[_0x337c('0x2')]();var fs_extra=require(_0x337c('0x3'));var auth=require(_0x337c('0x4'));var interaction=require(_0x337c('0x5'));var config=require('../../config/environment');var controller=require(_0x337c('0x6'));router['get']('/',auth[_0x337c('0x7')](),controller['index']);router['get']('/describe',auth[_0x337c('0x7')](),controller[_0x337c('0x8')]);router[_0x337c('0x9')](_0x337c('0xa'),auth[_0x337c('0x7')](),controller[_0x337c('0xb')]);router[_0x337c('0x9')]('/:id/dispositions',auth[_0x337c('0x7')](),controller[_0x337c('0xc')]);router[_0x337c('0x9')](_0x337c('0xd'),auth[_0x337c('0x7')](),controller[_0x337c('0xe')]);router[_0x337c('0x9')](_0x337c('0xf'),controller[_0x337c('0x10')]);router[_0x337c('0x9')](_0x337c('0x11'),controller['getAvatar']);router['get'](_0x337c('0x12'),controller[_0x337c('0x13')]);router['get']('/:id/system_avatar',controller[_0x337c('0x14')]);router['get'](_0x337c('0x15'),auth[_0x337c('0x7')](),controller[_0x337c('0x16')]);router[_0x337c('0x9')](_0x337c('0x17'),controller[_0x337c('0x18')]);router[_0x337c('0x9')](_0x337c('0x19'),auth['isAuthenticated'](),controller['getApplications']);router[_0x337c('0x9')](_0x337c('0x1a'),auth[_0x337c('0x7')](),controller[_0x337c('0x1b')]);router[_0x337c('0x9')](_0x337c('0x1c'),controller[_0x337c('0x1d')]);router[_0x337c('0x9')](_0x337c('0x1e'),auth[_0x337c('0x7')](),controller[_0x337c('0x1f')]);router[_0x337c('0x9')]('/:id/users',auth[_0x337c('0x7')](),controller['getAgents']);router[_0x337c('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0x337c('0x20')](_0x337c('0x21'),auth[_0x337c('0x7')](),controller[_0x337c('0x22')]);router[_0x337c('0x20')](_0x337c('0xd'),auth[_0x337c('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x337c('0x23')]({'destination':function(_0x4f5e26,_0x263fdb,_0x50e312){_0x50e312(null,path['join'](config[_0x337c('0x24')],_0x337c('0x25')));},'filename':function(_0x2f744a,_0x689142,_0x413071){_0x413071(null,util[_0x337c('0x26')](_0x337c('0x27'),Date[_0x337c('0x28')](),_0x689142[_0x337c('0x29')]));}})});router['post'](_0x337c('0xf'),upload[_0x337c('0x2a')]('file'),controller[_0x337c('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d8767,_0x4b2fe2,_0x2c85e9){_0x2c85e9(null,path['join'](config[_0x337c('0x24')],'server/files/images/avatars/'));},'filename':function(_0x167ea4,_0xb22fe5,_0x557ded){_0x557ded(null,util[_0x337c('0x26')](_0x337c('0x27'),Date['now'](),_0xb22fe5[_0x337c('0x29')]));}})});router[_0x337c('0x20')](_0x337c('0x11'),upload[_0x337c('0x2a')](_0x337c('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x337c('0x23')]({'destination':function(_0x27de90,_0x18e0bc,_0x43175f){_0x43175f(null,path['join'](config['root'],_0x337c('0x2d')));},'filename':function(_0x5c3776,_0x5431b0,_0x1b59ca){_0x1b59ca(null,util[_0x337c('0x26')](_0x337c('0x27'),Date[_0x337c('0x28')](),_0x5431b0['originalname']));}})});router[_0x337c('0x20')]('/:id/customer_avatar',upload[_0x337c('0x2a')](_0x337c('0x2c')),controller[_0x337c('0x2e')]);var upload=multer({'storage':multer[_0x337c('0x23')]({'destination':function(_0x579b30,_0x39308c,_0x48b5d6){_0x48b5d6(null,path[_0x337c('0x2f')](config[_0x337c('0x24')],_0x337c('0x2d')));},'filename':function(_0x31c06f,_0x56e486,_0x32a710){_0x32a710(null,util[_0x337c('0x26')]('%s-%s',Date[_0x337c('0x28')](),_0x56e486[_0x337c('0x29')]));}})});router[_0x337c('0x20')]('/:id/system_avatar',upload[_0x337c('0x2a')](_0x337c('0x2c')),controller['addSystemAvatar']);router[_0x337c('0x20')](_0x337c('0x30'),controller[_0x337c('0x31')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x41a18f,_0x4d42fd,_0x313690){const _0x1f55ed=path[_0x337c('0x2f')](config['root'],'server/files',_0x337c('0x32'),_0x337c('0x33'));fs_extra[_0x337c('0x34')](_0x1f55ed,function(){_0x313690(null,_0x1f55ed);});},'filename':function(_0x42a742,_0x23db88,_0x53ed82){const _0x4ea0d0=_0x23db88[_0x337c('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x234b92=path[_0x337c('0x35')](_0x4ea0d0);const _0x74ded1=Date['now']()+'-'+_0x4ea0d0[_0x337c('0x36')](_0x234b92,'')+_0x234b92;_0x53ed82(null,_0x74ded1);}})});router['post'](_0x337c('0x37'),offlineUploadMulter['any'](),controller['offline']);router['post']('/:id/interactions',auth[_0x337c('0x7')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0x337c('0x7')](),controller[_0x337c('0x38')]);router[_0x337c('0x20')](_0x337c('0x1a'),auth[_0x337c('0x7')](),controller[_0x337c('0x39')]);router['post'](_0x337c('0x3a'),auth[_0x337c('0x7')](),controller[_0x337c('0x3b')]);router[_0x337c('0x3c')](_0x337c('0xa'),auth[_0x337c('0x7')](),controller['update']);router[_0x337c('0x3d')]('/:id',auth[_0x337c('0x7')](),controller[_0x337c('0x3e')]);router[_0x337c('0x3d')](_0x337c('0x21'),auth[_0x337c('0x7')](),controller[_0x337c('0x3f')]);router['delete'](_0x337c('0xd'),auth[_0x337c('0x7')](),controller['removeAnswers']);router[_0x337c('0x3d')](_0x337c('0x3a'),auth[_0x337c('0x7')](),controller[_0x337c('0x40')]);module['exports']=router; \ No newline at end of file +var _0x9489=['extname','/:id/offline','any','offline','addInteraction','/:id/applications','addAgents','put','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','create','/:id/dispositions','post','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x9489,0x12d));var _0x9948=function(_0x2f3c60,_0x4789c6){_0x2f3c60=_0x2f3c60-0x0;var _0x1b5314=_0x9489[_0x2f3c60];return _0x1b5314;};'use strict';var multer=require(_0x9948('0x0'));var util=require(_0x9948('0x1'));var path=require(_0x9948('0x2'));var timeout=require(_0x9948('0x3'));var express=require(_0x9948('0x4'));var router=express[_0x9948('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9948('0x6'));var interaction=require(_0x9948('0x7'));var config=require(_0x9948('0x8'));var controller=require(_0x9948('0x9'));router[_0x9948('0xa')]('/',auth[_0x9948('0xb')](),controller['index']);router['get'](_0x9948('0xc'),auth['isAuthenticated'](),controller[_0x9948('0xd')]);router[_0x9948('0xa')](_0x9948('0xe'),auth[_0x9948('0xb')](),controller['show']);router[_0x9948('0xa')]('/:id/dispositions',auth[_0x9948('0xb')](),controller[_0x9948('0xf')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9948('0x10')]);router[_0x9948('0xa')](_0x9948('0x11'),controller[_0x9948('0x12')]);router[_0x9948('0xa')](_0x9948('0x13'),controller[_0x9948('0x14')]);router['get'](_0x9948('0x15'),controller[_0x9948('0x16')]);router[_0x9948('0xa')](_0x9948('0x17'),controller['getSystemAvatar']);router[_0x9948('0xa')](_0x9948('0x18'),auth['isAuthenticated'](),controller[_0x9948('0x19')]);router['get'](_0x9948('0x1a'),controller[_0x9948('0x1b')]);router[_0x9948('0xa')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x9948('0xa')](_0x9948('0x1c'),auth['isAuthenticated'](),controller[_0x9948('0x1d')]);router[_0x9948('0xa')](_0x9948('0x1e'),controller['getFields']);router[_0x9948('0xa')](_0x9948('0x1f'),auth['isAuthenticated'](),controller[_0x9948('0x20')]);router[_0x9948('0xa')](_0x9948('0x21'),auth[_0x9948('0xb')](),controller['getAgents']);router['post']('/',auth[_0x9948('0xb')](),controller[_0x9948('0x22')]);router['post'](_0x9948('0x23'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x9948('0x24')](_0x9948('0x25'),auth['isAuthenticated'](),controller[_0x9948('0x26')]);var upload=multer({'storage':multer[_0x9948('0x27')]({'destination':function(_0x358a85,_0x4c0c0d,_0x32bb61){_0x32bb61(null,path[_0x9948('0x28')](config[_0x9948('0x29')],_0x9948('0x2a')));},'filename':function(_0x23a864,_0x3794e3,_0x1828ba){_0x1828ba(null,util[_0x9948('0x2b')]('%s-%s',Date[_0x9948('0x2c')](),_0x3794e3[_0x9948('0x2d')]));}})});router['post']('/:id/logo',upload[_0x9948('0x2e')](_0x9948('0x2f')),controller[_0x9948('0x30')]);var upload=multer({'storage':multer[_0x9948('0x27')]({'destination':function(_0x893c38,_0x1ca66b,_0x3e8e45){_0x3e8e45(null,path['join'](config[_0x9948('0x29')],_0x9948('0x31')));},'filename':function(_0x130fdd,_0x3ca112,_0x415332){_0x415332(null,util['format'](_0x9948('0x32'),Date['now'](),_0x3ca112['originalname']));}})});router[_0x9948('0x24')]('/:id/avatar',upload[_0x9948('0x2e')]('file'),controller[_0x9948('0x33')]);var upload=multer({'storage':multer[_0x9948('0x27')]({'destination':function(_0x4763cb,_0x596fd2,_0x26ee7d){_0x26ee7d(null,path[_0x9948('0x28')](config[_0x9948('0x29')],'server/files/images/avatars/'));},'filename':function(_0x8a26b1,_0x316739,_0x12eab4){_0x12eab4(null,util[_0x9948('0x2b')](_0x9948('0x32'),Date[_0x9948('0x2c')](),_0x316739['originalname']));}})});router[_0x9948('0x24')]('/:id/customer_avatar',upload[_0x9948('0x2e')](_0x9948('0x2f')),controller[_0x9948('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x378c60,_0x22aef8,_0x4a9abe){_0x4a9abe(null,path[_0x9948('0x28')](config[_0x9948('0x29')],'server/files/images/avatars/'));},'filename':function(_0x3c55f3,_0x33ab4d,_0x14565c){_0x14565c(null,util[_0x9948('0x2b')](_0x9948('0x32'),Date[_0x9948('0x2c')](),_0x33ab4d[_0x9948('0x2d')]));}})});router[_0x9948('0x24')](_0x9948('0x17'),upload['single']('file'),controller[_0x9948('0x35')]);router[_0x9948('0x24')](_0x9948('0x36'),controller[_0x9948('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x9948('0x27')]({'destination':function(_0x1bb534,_0x42428b,_0x3d283b){const _0x42453e=path[_0x9948('0x28')](config[_0x9948('0x29')],_0x9948('0x38'),'attachments',_0x9948('0x39'));fs_extra[_0x9948('0x3a')](_0x42453e,function(){_0x3d283b(null,_0x42453e);});},'filename':function(_0x4eedfe,_0x4952f0,_0x1c45a4){const _0x55b212=_0x4952f0[_0x9948('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x166d77=path[_0x9948('0x3b')](_0x55b212);const _0x3103d1=Date[_0x9948('0x2c')]()+'-'+_0x55b212['replace'](_0x166d77,'')+_0x166d77;_0x1c45a4(null,_0x3103d1);}})});router['post'](_0x9948('0x3c'),offlineUploadMulter[_0x9948('0x3d')](),controller[_0x9948('0x3e')]);router['post']('/:id/interactions',auth[_0x9948('0xb')](),controller[_0x9948('0x3f')]);router[_0x9948('0x24')](_0x9948('0x40'),auth['isAuthenticated'](),controller['addApplications']);router[_0x9948('0x24')]('/:id/proactive_actions',auth[_0x9948('0xb')](),controller['addProactiveActions']);router['post'](_0x9948('0x21'),auth['isAuthenticated'](),controller[_0x9948('0x41')]);router[_0x9948('0x42')]('/:id',auth[_0x9948('0xb')](),controller['update']);router[_0x9948('0x43')](_0x9948('0xe'),auth['isAuthenticated'](),controller[_0x9948('0x44')]);router[_0x9948('0x43')](_0x9948('0x23'),auth[_0x9948('0xb')](),controller[_0x9948('0x45')]);router[_0x9948('0x43')](_0x9948('0x25'),auth['isAuthenticated'](),controller[_0x9948('0x46')]);router['delete'](_0x9948('0x21'),auth[_0x9948('0xb')](),controller['removeAgents']);module[_0x9948('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index d624fc0..5cfa1c9 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 _0x2dc3=['exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0x2dc3,0x127));var _0x32dc=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2dc3[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x32dc('0x0')]={'name':{'type':Sequelize[_0x32dc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x32dc('0x2')](_0x32dc('0x3'),_0x32dc('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x32dc('0x1')]},'data2':{'type':Sequelize[_0x32dc('0x1')]}}; \ No newline at end of file +var _0x01d9=['STRING','ENUM','Google','sequelize','exports'];(function(_0x25ce6e,_0x56e3a8){var _0x49e1ce=function(_0x2285cb){while(--_0x2285cb){_0x25ce6e['push'](_0x25ce6e['shift']());}};_0x49e1ce(++_0x56e3a8);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x901d('0x0'));module[_0x901d('0x1')]={'name':{'type':Sequelize[_0x901d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x901d('0x3')]('AmazonAWS',_0x901d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x901d('0x2')]},'data2':{'type':Sequelize[_0x901d('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index c1ecedf..d7a3e92 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 _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x2c5b59,_0x4901d7){var _0x5f2dc6=function(_0x43a6e0){while(--_0x43a6e0){_0x2c5b59['push'](_0x2c5b59['shift']());}};_0x5f2dc6(++_0x4901d7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0b0e[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a08e3,_0x19db1f){_0x3a08e3=_0x3a08e3-0x0;var _0x7f2b79=_0x5f2f[_0x3a08e3];return _0x7f2b79;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 24c2f33..b49c703 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 _0x7670=['define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7670,0x7b));var _0x0767=function(_0xa56e2a,_0x3aac89){_0xa56e2a=_0xa56e2a-0x0;var _0x5d4674=_0x7670[_0xa56e2a];return _0x5d4674;};'use strict';var _=require(_0x0767('0x0'));var util=require('util');var logger=require(_0x0767('0x1'))(_0x0767('0x2'));var moment=require(_0x0767('0x3'));var BPromise=require('bluebird');var rp=require(_0x0767('0x4'));var fs=require('fs');var path=require(_0x0767('0x5'));var rimraf=require(_0x0767('0x6'));var config=require(_0x0767('0x7'));var attributes=require(_0x0767('0x8'));module['exports']=function(_0x3b8735,_0x1077ee){return _0x3b8735[_0x0767('0x9')](_0x0767('0xa'),attributes,{'tableName':_0x0767('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1b3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','CloudProvider','lodash'];(function(_0x3d36d6,_0xa64992){var _0x161116=function(_0xa94641){while(--_0xa94641){_0x3d36d6['push'](_0x3d36d6['shift']());}};_0x161116(++_0xa64992);}(_0xc1b3,0x1ac));var _0x3c1b=function(_0x2054b1,_0x12bb72){_0x2054b1=_0x2054b1-0x0;var _0x94f24a=_0xc1b3[_0x2054b1];return _0x94f24a;};'use strict';var _=require(_0x3c1b('0x0'));var util=require(_0x3c1b('0x1'));var logger=require(_0x3c1b('0x2'))(_0x3c1b('0x3'));var moment=require(_0x3c1b('0x4'));var BPromise=require(_0x3c1b('0x5'));var rp=require(_0x3c1b('0x6'));var fs=require('fs');var path=require(_0x3c1b('0x7'));var rimraf=require('rimraf');var config=require(_0x3c1b('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x3c1b('0x9')]=function(_0x4aaa7e,_0x3bceee){return _0x4aaa7e['define'](_0x3c1b('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d36c476..28e0fd5 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4f4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x48cb6e,_0x494099){var _0x161dea=function(_0x3e42b7){while(--_0x3e42b7){_0x48cb6e['push'](_0x48cb6e['shift']());}};_0x161dea(++_0x494099);}(_0xb4f4,0xda));var _0x4b4f=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xb4f4[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});} \ No newline at end of file +var _0x0936=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xe4b6e3,_0xc66ec){var _0x4b362a=function(_0xaf4ec9){while(--_0xaf4ec9){_0xe4b6e3['push'](_0xe4b6e3['shift']());}};_0x4b362a(++_0xc66ec);}(_0x0936,0xde));var _0x6093=function(_0x426cad,_0x45810d){_0x426cad=_0x426cad-0x0;var _0x50c00f=_0x0936[_0x426cad];return _0x50c00f;};'use strict';var _=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var moment=require(_0x6093('0x2'));var BPromise=require(_0x6093('0x3'));var rs=require(_0x6093('0x4'));var fs=require('fs');var Redis=require(_0x6093('0x5'));var db=require(_0x6093('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6093('0x7'));var config=require(_0x6093('0x8'));var jayson=require(_0x6093('0x9'));var client=jayson[_0x6093('0xa')][_0x6093('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d812e,_0x478323,_0x54df66){return new BPromise(function(_0x5280b8,_0x219592){return client[_0x6093('0xc')](_0x7d812e,_0x54df66)[_0x6093('0xd')](function(_0x178aba){logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));logger[_0x6093('0x11')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x478323,'request\x20sent',JSON[_0x6093('0x12')](_0x178aba));if(_0x178aba[_0x6093('0x13')]){if(_0x178aba[_0x6093('0x13')][_0x6093('0x14')]===0x1f4){logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x219592(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x5280b8(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}else{logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));_0x5280b8(_0x178aba[_0x6093('0x16')][_0x6093('0x15')]);}})[_0x6093('0x17')](function(_0x5c8f2a){logger['error'](_0x6093('0xf'),_0x478323,_0x5c8f2a);_0x219592(_0x5c8f2a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8cc67f4..ec0be12 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 _0xc891=['create','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post'];(function(_0x2f2959,_0x147c7f){var _0x2fd01b=function(_0x41f3f9){while(--_0x41f3f9){_0x2f2959['push'](_0x2f2959['shift']());}};_0x2fd01b(++_0x147c7f);}(_0xc891,0x152));var _0x1c89=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xc891[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x1c89('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1c89('0x1'));var express=require('express');var router=express[_0x1c89('0x2')]();var fs_extra=require(_0x1c89('0x3'));var auth=require(_0x1c89('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1c89('0x5'));var controller=require(_0x1c89('0x6'));router[_0x1c89('0x7')]('/',auth[_0x1c89('0x8')](),controller['index']);router[_0x1c89('0x7')](_0x1c89('0x9'),auth['isAuthenticated'](),controller[_0x1c89('0xa')]);router[_0x1c89('0xb')]('/',auth['isAuthenticated'](),controller[_0x1c89('0xc')]);router['put'](_0x1c89('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x1c89('0x8')](),controller['destroy']);module[_0x1c89('0xd')]=router; \ No newline at end of file +var _0xd7a4=['/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xd7a4,0x7e));var _0x4d7a=function(_0x13c72e,_0x2626fb){_0x13c72e=_0x13c72e-0x0;var _0x1c6d08=_0xd7a4[_0x13c72e];return _0x1c6d08;};'use strict';var multer=require(_0x4d7a('0x0'));var util=require(_0x4d7a('0x1'));var path=require('path');var timeout=require(_0x4d7a('0x2'));var express=require(_0x4d7a('0x3'));var router=express[_0x4d7a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4d7a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d7a('0x6'));var controller=require('./cloudProvider.controller');router[_0x4d7a('0x7')]('/',auth[_0x4d7a('0x8')](),controller[_0x4d7a('0x9')]);router[_0x4d7a('0x7')](_0x4d7a('0xa'),auth[_0x4d7a('0x8')](),controller[_0x4d7a('0xb')]);router[_0x4d7a('0xc')]('/',auth[_0x4d7a('0x8')](),controller['create']);router[_0x4d7a('0xd')]('/:id',auth[_0x4d7a('0x8')](),controller[_0x4d7a('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4d7a('0xf')]);module[_0x4d7a('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 071be3a..6c831ef 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 _0x7858=['exports','STRING'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7858,0x10e));var _0x8785=function(_0x2bebc0,_0x55f6d2){_0x2bebc0=_0x2bebc0-0x0;var _0x56997c=_0x7858[_0x2bebc0];return _0x56997c;};'use strict';var Sequelize=require('sequelize');module[_0x8785('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8785('0x1')]},'companyId':{'type':Sequelize[_0x8785('0x1')]},'website':{'type':Sequelize[_0x8785('0x1')]},'phone':{'type':Sequelize[_0x8785('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8785('0x1')]},'street':{'type':Sequelize[_0x8785('0x1')]},'postalCode':{'type':Sequelize[_0x8785('0x1')]},'city':{'type':Sequelize[_0x8785('0x1')]},'country':{'type':Sequelize[_0x8785('0x1')]},'email':{'type':Sequelize[_0x8785('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x8785('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8785('0x1')]},'description':{'type':Sequelize[_0x8785('0x1')]}}; \ No newline at end of file +var _0x485f=['name','sequelize','exports','STRING'];(function(_0x160fef,_0x2ce0ba){var _0x31fce1=function(_0x3847b0){while(--_0x3847b0){_0x160fef['push'](_0x160fef['shift']());}};_0x31fce1(++_0x2ce0ba);}(_0x485f,0x131));var _0xf485=function(_0x374950,_0x55ba0a){_0x374950=_0x374950-0x0;var _0xb158f4=_0x485f[_0x374950];return _0xb158f4;};'use strict';var Sequelize=require(_0xf485('0x0'));module[_0xf485('0x1')]={'name':{'type':Sequelize[_0xf485('0x2')],'unique':_0xf485('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf485('0x2')]},'companyId':{'type':Sequelize[_0xf485('0x2')]},'website':{'type':Sequelize[_0xf485('0x2')]},'phone':{'type':Sequelize[_0xf485('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf485('0x2')]},'street':{'type':Sequelize[_0xf485('0x2')]},'postalCode':{'type':Sequelize[_0xf485('0x2')]},'city':{'type':Sequelize[_0xf485('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf485('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf485('0x2')]},'sStreet':{'type':Sequelize[_0xf485('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xf485('0x2')]},'description':{'type':Sequelize[_0xf485('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 847c008..4ff6519 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 _0x3e9a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','pick','merge','where','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x58ef0f,_0x31c945){var _0x57e69c=function(_0x46ccdf){while(--_0x46ccdf){_0x58ef0f['push'](_0x58ef0f['shift']());}};_0x57e69c(++_0x31c945);}(_0x3e9a,0x14f));var _0xa3e9=function(_0x50ab95,_0x480438){_0x50ab95=_0x50ab95-0x0;var _0x2c62cd=_0x3e9a[_0x50ab95];return _0x2c62cd;};'use strict';var emlformat=require(_0xa3e9('0x0'));var rimraf=require(_0xa3e9('0x1'));var zipdir=require(_0xa3e9('0x2'));var jsonpatch=require(_0xa3e9('0x3'));var rp=require('request-promise');var moment=require(_0xa3e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa3e9('0x5'));var util=require(_0xa3e9('0x6'));var path=require(_0xa3e9('0x7'));var sox=require(_0xa3e9('0x8'));var csv=require(_0xa3e9('0x9'));var ejs=require(_0xa3e9('0xa'));var fs=require('fs');var fs_extra=require(_0xa3e9('0xb'));var _=require(_0xa3e9('0xc'));var squel=require(_0xa3e9('0xd'));var crypto=require(_0xa3e9('0xe'));var jsforce=require(_0xa3e9('0xf'));var deskjs=require(_0xa3e9('0x10'));var toCsv=require(_0xa3e9('0x9'));var querystring=require('querystring');var Papa=require(_0xa3e9('0x11'));var Redis=require(_0xa3e9('0x12'));var authService=require(_0xa3e9('0x13'));var qs=require(_0xa3e9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3e9('0x15'));var logger=require(_0xa3e9('0x16'))(_0xa3e9('0x17'));var utils=require('../../config/utils');var config=require(_0xa3e9('0x18'));var licenseUtil=require(_0xa3e9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38ae98,_0x597eeb){_0x597eeb=_0x597eeb||0xcc;return function(_0x3d46de){if(_0x3d46de){return _0x38ae98['sendStatus'](_0x597eeb);}return _0x38ae98[_0xa3e9('0x1a')](_0x597eeb)[_0xa3e9('0x1b')]();};}function respondWithResult(_0x1ba47c,_0x530b3c){_0x530b3c=_0x530b3c||0xc8;return function(_0x4f5383){if(_0x4f5383){return _0x1ba47c[_0xa3e9('0x1a')](_0x530b3c)[_0xa3e9('0x1c')](_0x4f5383);}};}function respondWithFilteredResult(_0xef6fc,_0x7868a){return function(_0x20414f){if(_0x20414f){var _0x59af68=typeof _0x7868a['offset']===_0xa3e9('0x1d')&&typeof _0x7868a[_0xa3e9('0x1e')]===_0xa3e9('0x1d');var _0x46e5bc=_0x20414f[_0xa3e9('0x1f')];var _0x1f8929=_0x59af68?0x0:_0x7868a[_0xa3e9('0x20')];var _0x430f3e=_0x59af68?_0x20414f['count']:_0x7868a[_0xa3e9('0x20')]+_0x7868a['limit'];var _0x1d1579;if(_0x430f3e>=_0x46e5bc){_0x430f3e=_0x46e5bc;_0x1d1579=0xc8;}else{_0x1d1579=0xce;}_0xef6fc[_0xa3e9('0x1a')](_0x1d1579);return _0xef6fc[_0xa3e9('0x21')](_0xa3e9('0x22'),_0x1f8929+'-'+_0x430f3e+'/'+_0x46e5bc)['json'](_0x20414f);}return null;};}function patchUpdates(_0x52a629){return function(_0x553cef){try{jsonpatch[_0xa3e9('0x23')](_0x553cef,_0x52a629,!![]);}catch(_0xeb2bbd){return BPromise['reject'](_0xeb2bbd);}return _0x553cef['save']();};}function saveUpdates(_0xa0a31a,_0x41de29){return function(_0xac96fc){if(_0xac96fc){return _0xac96fc[_0xa3e9('0x24')](_0xa0a31a)[_0xa3e9('0x25')](function(_0x318824){return _0x318824;});}return null;};}function removeEntity(_0x5a0c56,_0x4b3452){return function(_0x2efedd){if(_0x2efedd){return _0x2efedd[_0xa3e9('0x26')]()[_0xa3e9('0x25')](function(){var _0x2bd1ed=_0x2efedd[_0xa3e9('0x27')]({'plain':!![]});var _0x29afab=_0xa3e9('0x28');return db[_0xa3e9('0x29')]['destroy']({'where':{'type':_0x29afab,'resourceId':_0x2bd1ed['id']}})[_0xa3e9('0x25')](function(){return _0x2efedd;});})[_0xa3e9('0x25')](function(){_0x5a0c56[_0xa3e9('0x1a')](0xcc)[_0xa3e9('0x1b')]();});}};}function handleEntityNotFound(_0x56ec02,_0x1f555e){return function(_0x3c303d){if(!_0x3c303d){_0x56ec02['sendStatus'](0x194);}return _0x3c303d;};}function handleError(_0x4c1b75,_0x23bca1){_0x23bca1=_0x23bca1||0x1f4;return function(_0x5277a6){logger[_0xa3e9('0x2a')](_0x5277a6['stack']);if(_0x5277a6['name']){delete _0x5277a6[_0xa3e9('0x2b')];}_0x4c1b75[_0xa3e9('0x1a')](_0x23bca1)[_0xa3e9('0x2c')](_0x5277a6);};}exports[_0xa3e9('0x2d')]=function(_0xff1945,_0x594034){var _0x41aaa4={},_0x35d117={},_0x388438={'count':0x0,'rows':[]};return db[_0xa3e9('0x2e')]['describe']()[_0xa3e9('0x25')](function(_0x297d66){_0x35d117[_0xa3e9('0x2f')]=_[_0xa3e9('0x30')](_0x297d66);_0x35d117['query']=_[_0xa3e9('0x30')](_0xff1945['query']);_0x35d117[_0xa3e9('0x31')]=_[_0xa3e9('0x32')](_0x35d117['model'],_0x35d117[_0xa3e9('0x33')]);_0x41aaa4['attributes']=_[_0xa3e9('0x32')](_0x35d117[_0xa3e9('0x2f')],qs[_0xa3e9('0x34')](_0xff1945[_0xa3e9('0x33')]['fields']));_0x41aaa4[_0xa3e9('0x35')]=_0x41aaa4[_0xa3e9('0x35')][_0xa3e9('0x36')]?_0x41aaa4[_0xa3e9('0x35')]:_0x35d117[_0xa3e9('0x2f')];if(!_0xff1945[_0xa3e9('0x33')][_0xa3e9('0x37')]('nolimit')){_0x41aaa4[_0xa3e9('0x1e')]=qs[_0xa3e9('0x1e')](_0xff1945[_0xa3e9('0x33')]['limit']);_0x41aaa4[_0xa3e9('0x20')]=qs['offset'](_0xff1945[_0xa3e9('0x33')]['offset']);}_0x41aaa4[_0xa3e9('0x38')]=qs[_0xa3e9('0x39')](_0xff1945['query']['sort']);_0x41aaa4['where']=qs[_0xa3e9('0x31')](_[_0xa3e9('0x3a')](_0xff1945[_0xa3e9('0x33')],_0x35d117[_0xa3e9('0x31')]),_0x297d66);if(_0xff1945[_0xa3e9('0x33')]['filter']){_0x41aaa4['where']=_[_0xa3e9('0x3b')](_0x41aaa4[_0xa3e9('0x3c')],{'$or':_['map'](_0x41aaa4[_0xa3e9('0x35')],function(_0x2f506a){var _0xa053d3={};_0xa053d3[_0x2f506a]={'$like':'%'+_0xff1945[_0xa3e9('0x33')][_0xa3e9('0x3d')]+'%'};return _0xa053d3;})});}_0x41aaa4=_[_0xa3e9('0x3b')]({},_0x41aaa4,_0xff1945[_0xa3e9('0x3e')]);var _0x262882={'where':_0x41aaa4[_0xa3e9('0x3c')]};return db['CmCompany'][_0xa3e9('0x1f')](_0x262882)[_0xa3e9('0x25')](function(_0x2625ca){_0x388438[_0xa3e9('0x1f')]=_0x2625ca;if(_0xff1945[_0xa3e9('0x33')][_0xa3e9('0x3f')]){_0x41aaa4[_0xa3e9('0x40')]=[{'all':!![]}];}return db[_0xa3e9('0x2e')]['findAll'](_0x41aaa4);})[_0xa3e9('0x25')](function(_0x3d1252){_0x388438[_0xa3e9('0x41')]=_0x3d1252;return _0x388438;})[_0xa3e9('0x25')](respondWithFilteredResult(_0x594034,_0x41aaa4))[_0xa3e9('0x42')](handleError(_0x594034,null));})[_0xa3e9('0x42')](handleError(_0x594034,null));};exports[_0xa3e9('0x43')]=function(_0x7f1bb8,_0x3c9fe1){var _0x2ff190={'raw':![],'where':{'id':_0x7f1bb8[_0xa3e9('0x44')]['id']}},_0x48769d={};_0x48769d[_0xa3e9('0x2f')]=_['keys'](db['CmCompany'][_0xa3e9('0x45')]);_0x48769d[_0xa3e9('0x33')]=_[_0xa3e9('0x30')](_0x7f1bb8[_0xa3e9('0x33')]);_0x48769d['filters']=_['intersection'](_0x48769d[_0xa3e9('0x2f')],_0x48769d[_0xa3e9('0x33')]);_0x2ff190[_0xa3e9('0x35')]=_[_0xa3e9('0x32')](_0x48769d[_0xa3e9('0x2f')],qs[_0xa3e9('0x34')](_0x7f1bb8[_0xa3e9('0x33')][_0xa3e9('0x34')]));_0x2ff190[_0xa3e9('0x35')]=_0x2ff190[_0xa3e9('0x35')][_0xa3e9('0x36')]?_0x2ff190[_0xa3e9('0x35')]:_0x48769d[_0xa3e9('0x2f')];if(_0x7f1bb8[_0xa3e9('0x33')]['includeAll']){_0x2ff190[_0xa3e9('0x40')]=[{'all':!![]}];}_0x2ff190=_[_0xa3e9('0x3b')]({},_0x2ff190,_0x7f1bb8[_0xa3e9('0x3e')]);return db[_0xa3e9('0x2e')][_0xa3e9('0x46')](_0x2ff190)[_0xa3e9('0x25')](handleEntityNotFound(_0x3c9fe1,null))['then'](respondWithResult(_0x3c9fe1,null))[_0xa3e9('0x42')](handleError(_0x3c9fe1,null));};exports[_0xa3e9('0x47')]=function(_0x330b8b,_0x12b39d){return db[_0xa3e9('0x2e')][_0xa3e9('0x47')](_0x330b8b[_0xa3e9('0x48')],{})[_0xa3e9('0x25')](function(_0x58a46a){var _0x386fa6=_0x330b8b[_0xa3e9('0x49')][_0xa3e9('0x27')]({'plain':!![]});if(!_0x386fa6)throw new Error(_0xa3e9('0x4a'));if(_0x386fa6[_0xa3e9('0x4b')]===_0xa3e9('0x49')){var _0x1de608=_0x58a46a[_0xa3e9('0x27')]({'plain':!![]});var _0x1e3d5c='Companies';return db[_0xa3e9('0x4c')]['find']({'where':{'name':_0x1e3d5c,'userProfileId':_0x386fa6[_0xa3e9('0x4d')]},'raw':!![]})[_0xa3e9('0x25')](function(_0x1d33a6){if(_0x1d33a6&&_0x1d33a6['autoAssociation']===0x0){return db[_0xa3e9('0x29')][_0xa3e9('0x47')]({'name':_0x1de608['name'],'resourceId':_0x1de608['id'],'type':_0x1d33a6[_0xa3e9('0x2b')],'sectionId':_0x1d33a6['id']},{})[_0xa3e9('0x25')](function(){return _0x58a46a;});}else{return _0x58a46a;}})[_0xa3e9('0x42')](function(_0x27f52a){logger[_0xa3e9('0x2a')](_0xa3e9('0x4e'),_0x27f52a);throw _0x27f52a;});}return _0x58a46a;})[_0xa3e9('0x25')](respondWithResult(_0x12b39d,0xc9))[_0xa3e9('0x42')](handleError(_0x12b39d,null));};exports[_0xa3e9('0x24')]=function(_0x46c4fb,_0x2c9edc){if(_0x46c4fb[_0xa3e9('0x48')]['id']){delete _0x46c4fb[_0xa3e9('0x48')]['id'];}return db[_0xa3e9('0x2e')][_0xa3e9('0x46')]({'where':{'id':_0x46c4fb[_0xa3e9('0x44')]['id']}})[_0xa3e9('0x25')](handleEntityNotFound(_0x2c9edc,null))[_0xa3e9('0x25')](saveUpdates(_0x46c4fb['body'],null))[_0xa3e9('0x25')](respondWithResult(_0x2c9edc,null))[_0xa3e9('0x42')](handleError(_0x2c9edc,null));};exports[_0xa3e9('0x26')]=function(_0x496c19,_0x57ea4c){return db['CmCompany'][_0xa3e9('0x46')]({'where':{'id':_0x496c19['params']['id']}})[_0xa3e9('0x25')](handleEntityNotFound(_0x57ea4c,null))[_0xa3e9('0x25')](removeEntity(_0x57ea4c,null))[_0xa3e9('0x42')](handleError(_0x57ea4c,null));};exports['describe']=function(_0x154245,_0x3c91e3){return db[_0xa3e9('0x2e')]['describe']()[_0xa3e9('0x25')](respondWithResult(_0x3c91e3,null))[_0xa3e9('0x42')](handleError(_0x3c91e3,null));};exports[_0xa3e9('0x4f')]=function(_0x202185,_0x30f153,_0x1e4590){return db[_0xa3e9('0x50')]['find']({'where':{'id':_0x202185[_0xa3e9('0x44')]['id']}})['then'](handleEntityNotFound(_0x30f153,null))[_0xa3e9('0x25')](function(_0x70b7ad){if(_0x70b7ad){return _0x70b7ad[_0xa3e9('0x4f')](_0x202185['body'][_0xa3e9('0x51')],_['omit'](_0x202185['body'],[_0xa3e9('0x51'),'id'])||{});}})[_0xa3e9('0x25')](respondWithResult(_0x30f153,null))[_0xa3e9('0x42')](handleError(_0x30f153,null));};exports[_0xa3e9('0x52')]=function(_0x12f4e4,_0x5cd8d6,_0x16fadb){var _0x44cb11={};var _0x10d6cc={};var _0x5862b6;var _0x6d6d59;return db['CmCompany']['findOne']({'where':{'id':_0x12f4e4[_0xa3e9('0x44')]['id']}})[_0xa3e9('0x25')](handleEntityNotFound(_0x5cd8d6,null))['then'](function(_0x16b93d){if(_0x16b93d){_0x5862b6=_0x16b93d;_0x10d6cc['model']=_[_0xa3e9('0x30')](db[_0xa3e9('0x50')]['rawAttributes']);_0x10d6cc[_0xa3e9('0x33')]=_[_0xa3e9('0x30')](_0x12f4e4[_0xa3e9('0x33')]);_0x10d6cc[_0xa3e9('0x31')]=_['intersection'](_0x10d6cc['model'],_0x10d6cc[_0xa3e9('0x33')]);_0x44cb11['attributes']=_[_0xa3e9('0x32')](_0x10d6cc[_0xa3e9('0x2f')],qs['fields'](_0x12f4e4['query']['fields']));_0x44cb11[_0xa3e9('0x35')]=_0x44cb11[_0xa3e9('0x35')][_0xa3e9('0x36')]?_0x44cb11[_0xa3e9('0x35')]:_0x10d6cc[_0xa3e9('0x2f')];_0x44cb11[_0xa3e9('0x38')]=qs[_0xa3e9('0x39')](_0x12f4e4[_0xa3e9('0x33')][_0xa3e9('0x39')]);_0x44cb11[_0xa3e9('0x3c')]=qs[_0xa3e9('0x31')](_[_0xa3e9('0x3a')](_0x12f4e4[_0xa3e9('0x33')],_0x10d6cc[_0xa3e9('0x31')]));if(_0x12f4e4[_0xa3e9('0x33')][_0xa3e9('0x3d')]){_0x44cb11[_0xa3e9('0x3c')]=_['merge'](_0x44cb11[_0xa3e9('0x3c')],{'$or':_[_0xa3e9('0x53')](_0x44cb11['attributes'],function(_0x343699){var _0x3ad79f={};_0x3ad79f[_0x343699]={'$like':'%'+_0x12f4e4['query'][_0xa3e9('0x3d')]+'%'};return _0x3ad79f;})});}_0x44cb11=_[_0xa3e9('0x3b')]({},_0x44cb11,_0x12f4e4[_0xa3e9('0x3e')]);return _0x5862b6[_0xa3e9('0x52')](_0x44cb11);}})[_0xa3e9('0x25')](function(_0x270189){if(_0x270189){_0x6d6d59=_0x270189[_0xa3e9('0x36')];if(!_0x12f4e4[_0xa3e9('0x33')][_0xa3e9('0x37')](_0xa3e9('0x54'))){_0x44cb11[_0xa3e9('0x1e')]=qs[_0xa3e9('0x1e')](_0x12f4e4['query']['limit']);_0x44cb11[_0xa3e9('0x20')]=qs[_0xa3e9('0x20')](_0x12f4e4['query'][_0xa3e9('0x20')]);}return _0x5862b6['getContacts'](_0x44cb11);}})[_0xa3e9('0x25')](function(_0x28f5cb){if(_0x28f5cb){return _0x28f5cb?{'count':_0x6d6d59,'rows':_0x28f5cb}:null;}})[_0xa3e9('0x25')](respondWithResult(_0x5cd8d6,null))[_0xa3e9('0x42')](handleError(_0x5cd8d6,null));}; \ No newline at end of file +var _0x326f=['CmContact','addContacts','ids','findOne','rawAttributes','map','getContacts','hasOwnProperty','nolimit','eml-format','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','Companies','UserProfileResource','destroy','error','stack','name','send','index','model','keys','query','filters','attributes','fields','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','include','rows','catch','show','params','intersection','length','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x326f,0x155));var _0xf326=function(_0x580e3c,_0x1697f7){_0x580e3c=_0x580e3c-0x0;var _0x56c9aa=_0x326f[_0x580e3c];return _0x56c9aa;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf326('0x1'));var moment=require('moment');var BPromise=require(_0xf326('0x2'));var Mustache=require(_0xf326('0x3'));var util=require(_0xf326('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf326('0x5'));var ejs=require(_0xf326('0x6'));var fs=require('fs');var fs_extra=require(_0xf326('0x7'));var _=require(_0xf326('0x8'));var squel=require(_0xf326('0x9'));var crypto=require(_0xf326('0xa'));var jsforce=require(_0xf326('0xb'));var deskjs=require(_0xf326('0xc'));var toCsv=require(_0xf326('0x5'));var querystring=require(_0xf326('0xd'));var Papa=require('papaparse');var Redis=require(_0xf326('0xe'));var authService=require(_0xf326('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf326('0x10'));var hardwareService=require(_0xf326('0x11'));var logger=require('../../config/logger')(_0xf326('0x12'));var utils=require('../../config/utils');var config=require(_0xf326('0x13'));var licenseUtil=require(_0xf326('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x134a70,_0x135cb8){_0x135cb8=_0x135cb8||0xcc;return function(_0x3b992b){if(_0x3b992b){return _0x134a70[_0xf326('0x15')](_0x135cb8);}return _0x134a70[_0xf326('0x16')](_0x135cb8)[_0xf326('0x17')]();};}function respondWithResult(_0x2b6157,_0x37d409){_0x37d409=_0x37d409||0xc8;return function(_0x2f5307){if(_0x2f5307){return _0x2b6157[_0xf326('0x16')](_0x37d409)[_0xf326('0x18')](_0x2f5307);}};}function respondWithFilteredResult(_0x1bdf79,_0x16817e){return function(_0xbfb556){if(_0xbfb556){var _0x307e69=typeof _0x16817e[_0xf326('0x19')]===_0xf326('0x1a')&&typeof _0x16817e[_0xf326('0x1b')]===_0xf326('0x1a');var _0x56167=_0xbfb556['count'];var _0x35b905=_0x307e69?0x0:_0x16817e[_0xf326('0x19')];var _0x4d29bf=_0x307e69?_0xbfb556[_0xf326('0x1c')]:_0x16817e['offset']+_0x16817e[_0xf326('0x1b')];var _0x5a78b1;if(_0x4d29bf>=_0x56167){_0x4d29bf=_0x56167;_0x5a78b1=0xc8;}else{_0x5a78b1=0xce;}_0x1bdf79[_0xf326('0x16')](_0x5a78b1);return _0x1bdf79[_0xf326('0x1d')](_0xf326('0x1e'),_0x35b905+'-'+_0x4d29bf+'/'+_0x56167)[_0xf326('0x18')](_0xbfb556);}return null;};}function patchUpdates(_0x5634b){return function(_0x1ddbe5){try{jsonpatch[_0xf326('0x1f')](_0x1ddbe5,_0x5634b,!![]);}catch(_0x25246c){return BPromise['reject'](_0x25246c);}return _0x1ddbe5['save']();};}function saveUpdates(_0x560958,_0x3a8390){return function(_0x25ef7b){if(_0x25ef7b){return _0x25ef7b['update'](_0x560958)[_0xf326('0x20')](function(_0x52271b){return _0x52271b;});}return null;};}function removeEntity(_0x169832,_0xe48756){return function(_0x5aa111){if(_0x5aa111){return _0x5aa111['destroy']()[_0xf326('0x20')](function(){var _0x267876=_0x5aa111[_0xf326('0x21')]({'plain':!![]});var _0x2b0ea3=_0xf326('0x22');return db[_0xf326('0x23')][_0xf326('0x24')]({'where':{'type':_0x2b0ea3,'resourceId':_0x267876['id']}})[_0xf326('0x20')](function(){return _0x5aa111;});})['then'](function(){_0x169832[_0xf326('0x16')](0xcc)[_0xf326('0x17')]();});}};}function handleEntityNotFound(_0x297f0a,_0x42dfb9){return function(_0x13b9d7){if(!_0x13b9d7){_0x297f0a[_0xf326('0x15')](0x194);}return _0x13b9d7;};}function handleError(_0x57e05b,_0x1b13c2){_0x1b13c2=_0x1b13c2||0x1f4;return function(_0x4a65a5){logger[_0xf326('0x25')](_0x4a65a5[_0xf326('0x26')]);if(_0x4a65a5[_0xf326('0x27')]){delete _0x4a65a5[_0xf326('0x27')];}_0x57e05b[_0xf326('0x16')](_0x1b13c2)[_0xf326('0x28')](_0x4a65a5);};}exports[_0xf326('0x29')]=function(_0x530088,_0x574a7f){var _0x35dab5={},_0x4628e2={},_0x67e879={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xf326('0x20')](function(_0x48309e){_0x4628e2[_0xf326('0x2a')]=_[_0xf326('0x2b')](_0x48309e);_0x4628e2[_0xf326('0x2c')]=_['keys'](_0x530088['query']);_0x4628e2[_0xf326('0x2d')]=_['intersection'](_0x4628e2[_0xf326('0x2a')],_0x4628e2[_0xf326('0x2c')]);_0x35dab5[_0xf326('0x2e')]=_['intersection'](_0x4628e2['model'],qs[_0xf326('0x2f')](_0x530088[_0xf326('0x2c')][_0xf326('0x2f')]));_0x35dab5[_0xf326('0x2e')]=_0x35dab5[_0xf326('0x2e')]['length']?_0x35dab5[_0xf326('0x2e')]:_0x4628e2[_0xf326('0x2a')];if(!_0x530088[_0xf326('0x2c')]['hasOwnProperty']('nolimit')){_0x35dab5[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x530088[_0xf326('0x2c')][_0xf326('0x1b')]);_0x35dab5[_0xf326('0x19')]=qs['offset'](_0x530088[_0xf326('0x2c')][_0xf326('0x19')]);}_0x35dab5[_0xf326('0x30')]=qs[_0xf326('0x31')](_0x530088[_0xf326('0x2c')][_0xf326('0x31')]);_0x35dab5[_0xf326('0x32')]=qs[_0xf326('0x2d')](_[_0xf326('0x33')](_0x530088[_0xf326('0x2c')],_0x4628e2['filters']),_0x48309e);if(_0x530088[_0xf326('0x2c')][_0xf326('0x34')]){_0x35dab5[_0xf326('0x32')]=_[_0xf326('0x35')](_0x35dab5[_0xf326('0x32')],{'$or':_['map'](_0x35dab5['attributes'],function(_0xd9262f){var _0x4c8276={};_0x4c8276[_0xd9262f]={'$like':'%'+_0x530088[_0xf326('0x2c')][_0xf326('0x34')]+'%'};return _0x4c8276;})});}_0x35dab5=_[_0xf326('0x35')]({},_0x35dab5,_0x530088[_0xf326('0x36')]);var _0x22d5bc={'where':_0x35dab5[_0xf326('0x32')]};return db[_0xf326('0x37')][_0xf326('0x1c')](_0x22d5bc)[_0xf326('0x20')](function(_0x4726bc){_0x67e879[_0xf326('0x1c')]=_0x4726bc;if(_0x530088[_0xf326('0x2c')][_0xf326('0x38')]){_0x35dab5[_0xf326('0x39')]=[{'all':!![]}];}return db[_0xf326('0x37')]['findAll'](_0x35dab5);})[_0xf326('0x20')](function(_0x1129ab){_0x67e879[_0xf326('0x3a')]=_0x1129ab;return _0x67e879;})[_0xf326('0x20')](respondWithFilteredResult(_0x574a7f,_0x35dab5))[_0xf326('0x3b')](handleError(_0x574a7f,null));})['catch'](handleError(_0x574a7f,null));};exports[_0xf326('0x3c')]=function(_0x1373af,_0x297de4){var _0x31263e={'raw':![],'where':{'id':_0x1373af[_0xf326('0x3d')]['id']}},_0x479533={};_0x479533[_0xf326('0x2a')]=_[_0xf326('0x2b')](db['CmCompany']['rawAttributes']);_0x479533['query']=_[_0xf326('0x2b')](_0x1373af[_0xf326('0x2c')]);_0x479533['filters']=_[_0xf326('0x3e')](_0x479533[_0xf326('0x2a')],_0x479533[_0xf326('0x2c')]);_0x31263e[_0xf326('0x2e')]=_[_0xf326('0x3e')](_0x479533[_0xf326('0x2a')],qs[_0xf326('0x2f')](_0x1373af[_0xf326('0x2c')][_0xf326('0x2f')]));_0x31263e['attributes']=_0x31263e[_0xf326('0x2e')][_0xf326('0x3f')]?_0x31263e[_0xf326('0x2e')]:_0x479533[_0xf326('0x2a')];if(_0x1373af[_0xf326('0x2c')]['includeAll']){_0x31263e[_0xf326('0x39')]=[{'all':!![]}];}_0x31263e=_[_0xf326('0x35')]({},_0x31263e,_0x1373af[_0xf326('0x36')]);return db[_0xf326('0x37')]['find'](_0x31263e)[_0xf326('0x20')](handleEntityNotFound(_0x297de4,null))['then'](respondWithResult(_0x297de4,null))[_0xf326('0x3b')](handleError(_0x297de4,null));};exports['create']=function(_0x1e97a3,_0xfcbc95){return db['CmCompany']['create'](_0x1e97a3[_0xf326('0x40')],{})[_0xf326('0x20')](function(_0x1d5b46){var _0x51aa6d=_0x1e97a3[_0xf326('0x41')][_0xf326('0x21')]({'plain':!![]});if(!_0x51aa6d)throw new Error(_0xf326('0x42'));if(_0x51aa6d['role']===_0xf326('0x41')){var _0x3b1f19=_0x1d5b46['get']({'plain':!![]});var _0x198967=_0xf326('0x22');return db[_0xf326('0x43')][_0xf326('0x44')]({'where':{'name':_0x198967,'userProfileId':_0x51aa6d[_0xf326('0x45')]},'raw':!![]})[_0xf326('0x20')](function(_0x265733){if(_0x265733&&_0x265733[_0xf326('0x46')]===0x0){return db[_0xf326('0x23')][_0xf326('0x47')]({'name':_0x3b1f19['name'],'resourceId':_0x3b1f19['id'],'type':_0x265733[_0xf326('0x27')],'sectionId':_0x265733['id']},{})[_0xf326('0x20')](function(){return _0x1d5b46;});}else{return _0x1d5b46;}})[_0xf326('0x3b')](function(_0x5734e4){logger['error'](_0xf326('0x48'),_0x5734e4);throw _0x5734e4;});}return _0x1d5b46;})[_0xf326('0x20')](respondWithResult(_0xfcbc95,0xc9))['catch'](handleError(_0xfcbc95,null));};exports[_0xf326('0x49')]=function(_0x3ddc2b,_0x4f5239){if(_0x3ddc2b[_0xf326('0x40')]['id']){delete _0x3ddc2b[_0xf326('0x40')]['id'];}return db['CmCompany'][_0xf326('0x44')]({'where':{'id':_0x3ddc2b['params']['id']}})[_0xf326('0x20')](handleEntityNotFound(_0x4f5239,null))[_0xf326('0x20')](saveUpdates(_0x3ddc2b[_0xf326('0x40')],null))[_0xf326('0x20')](respondWithResult(_0x4f5239,null))[_0xf326('0x3b')](handleError(_0x4f5239,null));};exports[_0xf326('0x24')]=function(_0xcf49f7,_0x275950){return db['CmCompany']['find']({'where':{'id':_0xcf49f7['params']['id']}})[_0xf326('0x20')](handleEntityNotFound(_0x275950,null))[_0xf326('0x20')](removeEntity(_0x275950,null))[_0xf326('0x3b')](handleError(_0x275950,null));};exports['describe']=function(_0x36c592,_0x4cc36c){return db[_0xf326('0x37')]['describe']()[_0xf326('0x20')](respondWithResult(_0x4cc36c,null))[_0xf326('0x3b')](handleError(_0x4cc36c,null));};exports['addContacts']=function(_0x2ad4c2,_0x1f571d,_0x21bd91){return db[_0xf326('0x4a')][_0xf326('0x44')]({'where':{'id':_0x2ad4c2[_0xf326('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1f571d,null))[_0xf326('0x20')](function(_0x36ae4b){if(_0x36ae4b){return _0x36ae4b[_0xf326('0x4b')](_0x2ad4c2[_0xf326('0x40')][_0xf326('0x4c')],_['omit'](_0x2ad4c2[_0xf326('0x40')],['ids','id'])||{});}})[_0xf326('0x20')](respondWithResult(_0x1f571d,null))[_0xf326('0x3b')](handleError(_0x1f571d,null));};exports['getContacts']=function(_0x3c288e,_0xa2f3ec,_0x4d017a){var _0x2907a5={};var _0x232398={};var _0x40b797;var _0x2f3087;return db[_0xf326('0x37')][_0xf326('0x4d')]({'where':{'id':_0x3c288e[_0xf326('0x3d')]['id']}})[_0xf326('0x20')](handleEntityNotFound(_0xa2f3ec,null))[_0xf326('0x20')](function(_0x39e358){if(_0x39e358){_0x40b797=_0x39e358;_0x232398[_0xf326('0x2a')]=_['keys'](db[_0xf326('0x4a')][_0xf326('0x4e')]);_0x232398[_0xf326('0x2c')]=_[_0xf326('0x2b')](_0x3c288e[_0xf326('0x2c')]);_0x232398['filters']=_[_0xf326('0x3e')](_0x232398[_0xf326('0x2a')],_0x232398[_0xf326('0x2c')]);_0x2907a5[_0xf326('0x2e')]=_[_0xf326('0x3e')](_0x232398['model'],qs['fields'](_0x3c288e['query']['fields']));_0x2907a5[_0xf326('0x2e')]=_0x2907a5[_0xf326('0x2e')][_0xf326('0x3f')]?_0x2907a5['attributes']:_0x232398[_0xf326('0x2a')];_0x2907a5[_0xf326('0x30')]=qs[_0xf326('0x31')](_0x3c288e['query'][_0xf326('0x31')]);_0x2907a5['where']=qs[_0xf326('0x2d')](_[_0xf326('0x33')](_0x3c288e[_0xf326('0x2c')],_0x232398[_0xf326('0x2d')]));if(_0x3c288e['query']['filter']){_0x2907a5[_0xf326('0x32')]=_['merge'](_0x2907a5['where'],{'$or':_[_0xf326('0x4f')](_0x2907a5[_0xf326('0x2e')],function(_0x5df509){var _0xbad29d={};_0xbad29d[_0x5df509]={'$like':'%'+_0x3c288e[_0xf326('0x2c')]['filter']+'%'};return _0xbad29d;})});}_0x2907a5=_[_0xf326('0x35')]({},_0x2907a5,_0x3c288e['options']);return _0x40b797[_0xf326('0x50')](_0x2907a5);}})[_0xf326('0x20')](function(_0x4eec53){if(_0x4eec53){_0x2f3087=_0x4eec53[_0xf326('0x3f')];if(!_0x3c288e[_0xf326('0x2c')][_0xf326('0x51')](_0xf326('0x52'))){_0x2907a5[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x3c288e['query'][_0xf326('0x1b')]);_0x2907a5[_0xf326('0x19')]=qs[_0xf326('0x19')](_0x3c288e[_0xf326('0x2c')][_0xf326('0x19')]);}return _0x40b797[_0xf326('0x50')](_0x2907a5);}})[_0xf326('0x20')](function(_0x2c59d8){if(_0x2c59d8){return _0x2c59d8?{'count':_0x2f3087,'rows':_0x2c59d8}:null;}})[_0xf326('0x20')](respondWithResult(_0xa2f3ec,null))[_0xf326('0x3b')](handleError(_0xa2f3ec,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 523498c..5446ba8 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 _0x4eb5=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eb5,0xd0));var _0x54eb=function(_0x4f9938,_0x766949){_0x4f9938=_0x4f9938-0x0;var _0x4450fa=_0x4eb5[_0x4f9938];return _0x4450fa;};'use strict';var _=require(_0x54eb('0x0'));var util=require(_0x54eb('0x1'));var logger=require(_0x54eb('0x2'))(_0x54eb('0x3'));var moment=require(_0x54eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x54eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54eb('0x6'));var config=require(_0x54eb('0x7'));var attributes=require(_0x54eb('0x8'));module[_0x54eb('0x9')]=function(_0x198c60,_0x4a6fac){return _0x198c60[_0x54eb('0xa')](_0x54eb('0xb'),attributes,{'tableName':_0x54eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0be4=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','request-promise'];(function(_0x2308db,_0x2e95c9){var _0x38d5de=function(_0x553804){while(--_0x553804){_0x2308db['push'](_0x2308db['shift']());}};_0x38d5de(++_0x2e95c9);}(_0x0be4,0xac));var _0x40be=function(_0x189ef1,_0x1f03c3){_0x189ef1=_0x189ef1-0x0;var _0x236456=_0x0be4[_0x189ef1];return _0x236456;};'use strict';var _=require(_0x40be('0x0'));var util=require(_0x40be('0x1'));var logger=require(_0x40be('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x40be('0x3'));var fs=require('fs');var path=require(_0x40be('0x4'));var rimraf=require(_0x40be('0x5'));var config=require('../../config/environment');var attributes=require(_0x40be('0x6'));module[_0x40be('0x7')]=function(_0x548a30,_0x3d4cd5){return _0x548a30[_0x40be('0x8')](_0x40be('0x9'),attributes,{'tableName':_0x40be('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 6a6588f..0de653a 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 _0x6fdf=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x487620,_0x39ef12){var _0xd21f02=function(_0x29c122){while(--_0x29c122){_0x487620['push'](_0x487620['shift']());}};_0xd21f02(++_0x39ef12);}(_0x6fdf,0x86));var _0xf6fd=function(_0x1b7074,_0x57a607){_0x1b7074=_0x1b7074-0x0;var _0x5ace20=_0x6fdf[_0x1b7074];return _0x5ace20;};'use strict';var _=require(_0xf6fd('0x0'));var util=require(_0xf6fd('0x1'));var moment=require(_0xf6fd('0x2'));var BPromise=require(_0xf6fd('0x3'));var rs=require(_0xf6fd('0x4'));var fs=require('fs');var Redis=require(_0xf6fd('0x5'));var db=require(_0xf6fd('0x6'))['db'];var utils=require(_0xf6fd('0x7'));var logger=require(_0xf6fd('0x8'))(_0xf6fd('0x9'));var config=require(_0xf6fd('0xa'));var jayson=require(_0xf6fd('0xb'));var client=jayson[_0xf6fd('0xc')][_0xf6fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f27a4,_0x1b79ec,_0x37f260){return new BPromise(function(_0x42f291,_0x42be27){return client[_0xf6fd('0xe')](_0x1f27a4,_0x37f260)['then'](function(_0xe3f19b){logger[_0xf6fd('0xf')]('CmCompany,\x20%s,\x20%s',_0x1b79ec,_0xf6fd('0x10'));logger['debug'](_0xf6fd('0x11'),_0x1b79ec,_0xf6fd('0x10'),JSON['stringify'](_0xe3f19b));if(_0xe3f19b[_0xf6fd('0x12')]){if(_0xe3f19b[_0xf6fd('0x12')][_0xf6fd('0x13')]===0x1f4){logger[_0xf6fd('0x12')](_0xf6fd('0x14'),_0x1b79ec,_0xe3f19b[_0xf6fd('0x12')][_0xf6fd('0x15')]);return _0x42be27(_0xe3f19b['error'][_0xf6fd('0x15')]);}logger[_0xf6fd('0x12')]('CmCompany,\x20%s,\x20%s',_0x1b79ec,_0xe3f19b[_0xf6fd('0x12')][_0xf6fd('0x15')]);return _0x42f291(_0xe3f19b['error'][_0xf6fd('0x15')]);}else{logger[_0xf6fd('0xf')](_0xf6fd('0x14'),_0x1b79ec,_0xf6fd('0x10'));_0x42f291(_0xe3f19b[_0xf6fd('0x16')][_0xf6fd('0x15')]);}})[_0xf6fd('0x17')](function(_0x5968d0){logger['error']('CmCompany,\x20%s,\x20%s',_0x1b79ec,_0x5968d0);_0x42be27(_0x5968d0);});});} \ No newline at end of file +var _0x2736=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x2736,0xe3));var _0x6273=function(_0x511723,_0x4db8e2){_0x511723=_0x511723-0x0;var _0x25add0=_0x2736[_0x511723];return _0x25add0;};'use strict';var _=require(_0x6273('0x0'));var util=require(_0x6273('0x1'));var moment=require(_0x6273('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6273('0x3'));var db=require(_0x6273('0x4'))['db'];var utils=require(_0x6273('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6273('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6273('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48b5da,_0x49c19e,_0x75b748){return new BPromise(function(_0x115b62,_0x54f80b){return client[_0x6273('0x8')](_0x48b5da,_0x75b748)[_0x6273('0x9')](function(_0x5d592b){logger['info'](_0x6273('0xa'),_0x49c19e,_0x6273('0xb'));logger[_0x6273('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x49c19e,_0x6273('0xb'),JSON[_0x6273('0xd')](_0x5d592b));if(_0x5d592b[_0x6273('0xe')]){if(_0x5d592b['error'][_0x6273('0xf')]===0x1f4){logger['error'](_0x6273('0xa'),_0x49c19e,_0x5d592b[_0x6273('0xe')][_0x6273('0x10')]);return _0x54f80b(_0x5d592b['error'][_0x6273('0x10')]);}logger[_0x6273('0xe')]('CmCompany,\x20%s,\x20%s',_0x49c19e,_0x5d592b['error']['message']);return _0x115b62(_0x5d592b['error'][_0x6273('0x10')]);}else{logger[_0x6273('0x11')](_0x6273('0xa'),_0x49c19e,'request\x20sent');_0x115b62(_0x5d592b[_0x6273('0x12')][_0x6273('0x10')]);}})[_0x6273('0x13')](function(_0x30e733){logger[_0x6273('0xe')](_0x6273('0xa'),_0x49c19e,_0x30e733);_0x54f80b(_0x30e733);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 38c9ac8..5923296 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 _0xa164=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put'];(function(_0x5b36eb,_0x1162b0){var _0x467355=function(_0x343c86){while(--_0x343c86){_0x5b36eb['push'](_0x5b36eb['shift']());}};_0x467355(++_0x1162b0);}(_0xa164,0xaa));var _0x4a16=function(_0xbc519a,_0x31ced6){_0xbc519a=_0xbc519a-0x0;var _0x2b0566=_0xa164[_0xbc519a];return _0x2b0566;};'use strict';var multer=require(_0x4a16('0x0'));var util=require(_0x4a16('0x1'));var path=require(_0x4a16('0x2'));var timeout=require(_0x4a16('0x3'));var express=require(_0x4a16('0x4'));var router=express[_0x4a16('0x5')]();var fs_extra=require(_0x4a16('0x6'));var auth=require(_0x4a16('0x7'));var interaction=require(_0x4a16('0x8'));var config=require(_0x4a16('0x9'));var controller=require('./cmCompany.controller');router[_0x4a16('0xa')]('/',auth[_0x4a16('0xb')](),controller[_0x4a16('0xc')]);router['get'](_0x4a16('0xd'),auth[_0x4a16('0xb')](),controller[_0x4a16('0xe')]);router[_0x4a16('0xa')](_0x4a16('0xf'),auth['isAuthenticated'](),controller[_0x4a16('0x10')]);router[_0x4a16('0xa')](_0x4a16('0x11'),auth[_0x4a16('0xb')](),controller[_0x4a16('0x12')]);router[_0x4a16('0x13')]('/',auth[_0x4a16('0xb')](),controller['create']);router[_0x4a16('0x13')]('/:id/contacts',auth[_0x4a16('0xb')](),controller[_0x4a16('0x14')]);router[_0x4a16('0x15')](_0x4a16('0xf'),auth[_0x4a16('0xb')](),controller['update']);router[_0x4a16('0x16')](_0x4a16('0xf'),auth[_0x4a16('0xb')](),controller[_0x4a16('0x17')]);module['exports']=router; \ No newline at end of file +var _0xdffe=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','addContacts','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0xb06d04,_0x1a87b0){var _0x15454a=function(_0x575f03){while(--_0x575f03){_0xb06d04['push'](_0xb06d04['shift']());}};_0x15454a(++_0x1a87b0);}(_0xdffe,0x18c));var _0xedff=function(_0x1d1854,_0x4a83b1){_0x1d1854=_0x1d1854-0x0;var _0x5b2acb=_0xdffe[_0x1d1854];return _0x5b2acb;};'use strict';var multer=require(_0xedff('0x0'));var util=require(_0xedff('0x1'));var path=require(_0xedff('0x2'));var timeout=require(_0xedff('0x3'));var express=require(_0xedff('0x4'));var router=express[_0xedff('0x5')]();var fs_extra=require(_0xedff('0x6'));var auth=require(_0xedff('0x7'));var interaction=require(_0xedff('0x8'));var config=require(_0xedff('0x9'));var controller=require(_0xedff('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xedff('0xb')]);router[_0xedff('0xc')](_0xedff('0xd'),auth[_0xedff('0xe')](),controller[_0xedff('0xf')]);router[_0xedff('0xc')](_0xedff('0x10'),auth[_0xedff('0xe')](),controller[_0xedff('0x11')]);router[_0xedff('0xc')](_0xedff('0x12'),auth[_0xedff('0xe')](),controller['getContacts']);router[_0xedff('0x13')]('/',auth[_0xedff('0xe')](),controller[_0xedff('0x14')]);router[_0xedff('0x13')](_0xedff('0x12'),auth[_0xedff('0xe')](),controller[_0xedff('0x15')]);router['put'](_0xedff('0x10'),auth[_0xedff('0xe')](),controller[_0xedff('0x16')]);router[_0xedff('0x17')](_0xedff('0x10'),auth['isAuthenticated'](),controller[_0xedff('0x18')]);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 478db05..239de27 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 _0xb190=['exports','STRING','TEXT','INTEGER','DATE','NOW','sequelize'];(function(_0x27188e,_0x2cb7b7){var _0x466456=function(_0x2b9758){while(--_0x2b9758){_0x27188e['push'](_0x27188e['shift']());}};_0x466456(++_0x2cb7b7);}(_0xb190,0x84));var _0x0b19=function(_0x318890,_0x524b86){_0x318890=_0x318890-0x0;var _0x4e3df0=_0xb190[_0x318890];return _0x4e3df0;};'use strict';var _=require('lodash');var Sequelize=require(_0x0b19('0x0'));module[_0x0b19('0x1')]={'firstName':{'type':Sequelize[_0x0b19('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0b19('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0b19('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0b19('0x2')]},'dateOfBirth':{'type':Sequelize[_0x0b19('0x2')]},'description':{'type':Sequelize[_0x0b19('0x3')]},'phone':{'type':Sequelize[_0x0b19('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0b19('0x2')]},'url':{'type':Sequelize[_0x0b19('0x2')]},'facebook':{'type':Sequelize[_0x0b19('0x2')]},'fb_data':{'type':Sequelize[_0x0b19('0x2')]},'twitter':{'type':Sequelize[_0x0b19('0x2')]},'skype':{'type':Sequelize[_0x0b19('0x2')]},'teams':{'type':Sequelize[_0x0b19('0x2')]},'viber':{'type':Sequelize[_0x0b19('0x2')]},'line':{'type':Sequelize[_0x0b19('0x2')]},'wechat':{'type':Sequelize[_0x0b19('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0b19('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0b19('0x5')],'defaultValue':Sequelize[_0x0b19('0x6')]}}; \ No newline at end of file +var _0x8745=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x42ed4c,_0x3cf7f5){var _0x2ca1b6=function(_0x3d01a9){while(--_0x3d01a9){_0x42ed4c['push'](_0x42ed4c['shift']());}};_0x2ca1b6(++_0x3cf7f5);}(_0x8745,0xb6));var _0x5874=function(_0x52d4d2,_0x3b95c2){_0x52d4d2=_0x52d4d2-0x0;var _0x57b70e=_0x8745[_0x52d4d2];return _0x57b70e;};'use strict';var _=require(_0x5874('0x0'));var Sequelize=require(_0x5874('0x1'));module[_0x5874('0x2')]={'firstName':{'type':Sequelize[_0x5874('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5874('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5874('0x3')]},'city':{'type':Sequelize[_0x5874('0x3')]},'country':{'type':Sequelize[_0x5874('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5874('0x3')]},'description':{'type':Sequelize[_0x5874('0x4')]},'phone':{'type':Sequelize[_0x5874('0x3')]},'mobile':{'type':Sequelize[_0x5874('0x3')]},'fax':{'type':Sequelize[_0x5874('0x3')]},'email':{'type':Sequelize[_0x5874('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x5874('0x3')]},'twitter':{'type':Sequelize[_0x5874('0x3')]},'skype':{'type':Sequelize[_0x5874('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x5874('0x3')]},'line':{'type':Sequelize[_0x5874('0x3')]},'wechat':{'type':Sequelize[_0x5874('0x3')]},'telegram':{'type':Sequelize[_0x5874('0x3')]},'UserId':{'type':Sequelize[_0x5874('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5874('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5874('0x7')],'defaultValue':Sequelize[_0x5874('0x8')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3286b29..2254f09 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 _0x5525=['conditions','find','Tag','value','forEach','union','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','type','text','start','end','map','hasOwnProperty','filter','isNil','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','c.id','QueryTypes','SELECT','clone','having','resolve','user','role','agent','User','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','destroy','params','catch','tags','startsWith','displayName','columnName','custom','values','merge','body','findAll','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','findOrCreate','show','Tags','$and','omit','format','cf_%d','pickBy','cm_contacts','setFields','id\x20=\x20?','toParam','phone','rawAttributes','pick','getTags','setTags','ids','getHoppers','ContactId','options','include','getHopperHistories','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','userThirdDisposition','UserId','fullname','alias','DESC','createdAt','findAndCountAll','startCase','Website','Account','closed','disposition','secondDisposition','thirdDisposition','browserName','customerIp','deviceModel','osName','ratingValue','subject','substatus','threadId','Interaction','Owner','all','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','json','offset','undefined','count','set','Content-Range','update','then','status','error','stack','name','send','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','trimStart','fieldType','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','select','field','color','from','uc.CmContactId\x20=\x20c.id','left_join','tools_tags','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x5525,0xda));var _0x5552=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5525[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x5552('0x0'));var BPromise=require(_0x5552('0x1'));var util=require(_0x5552('0x2'));var path=require(_0x5552('0x3'));var fs=require('fs');var _=require(_0x5552('0x4'));var squel=require(_0x5552('0x5'));var Papa=require(_0x5552('0x6'));var Redis=require(_0x5552('0x7'));var qs=require(_0x5552('0x8'));var as=require(_0x5552('0x9'));var logger=require(_0x5552('0xa'))(_0x5552('0xb'));var config=require(_0x5552('0xc'));var db=require(_0x5552('0xd'))['db'];config[_0x5552('0xe')]=_['defaults'](config[_0x5552('0xe')],{'host':_0x5552('0xf'),'port':0x18eb});var socket=require(_0x5552('0x10'))(new Redis(config[_0x5552('0xe')]));require(_0x5552('0x11'))['register'](socket);function respondWithResult(_0x4705a4,_0x299709){_0x299709=_0x299709||0xc8;return function(_0x428fd6){if(_0x428fd6){return _0x4705a4['status'](_0x299709)[_0x5552('0x12')](_0x428fd6);}};}function respondWithFilteredResult(_0x1fba5d,_0x354685){return function(_0x3e7b10){if(_0x3e7b10){var _0x507d0d=typeof _0x354685[_0x5552('0x13')]===_0x5552('0x14')&&typeof _0x354685['limit']==='undefined';var _0x3a784a=_0x3e7b10[_0x5552('0x15')];var _0x3e94f2=_0x507d0d?0x0:_0x354685[_0x5552('0x13')];var _0x527a65=_0x507d0d?_0x3e7b10[_0x5552('0x15')]:_0x354685['offset']+_0x354685['limit'];var _0x382dbb;if(_0x527a65>=_0x3a784a){_0x527a65=_0x3a784a;_0x382dbb=0xc8;}else{_0x382dbb=0xce;}_0x1fba5d['status'](_0x382dbb);return _0x1fba5d[_0x5552('0x16')](_0x5552('0x17'),_0x3e94f2+'-'+_0x527a65+'/'+_0x3a784a)['json'](_0x3e7b10);}return null;};}function saveUpdates(_0x1c31f8){return function(_0x125aeb){if(_0x125aeb){return _0x125aeb[_0x5552('0x18')](_0x1c31f8)[_0x5552('0x19')](function(_0x6fc53d){return _0x6fc53d;});}return null;};}function removeEntity(_0x3794fc){return function(_0x30d463){if(_0x30d463){return _0x30d463['destroy']()[_0x5552('0x19')](function(){_0x3794fc[_0x5552('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e1ef){return function(_0x4ea8ab){if(!_0x4ea8ab){_0x48e1ef['sendStatus'](0x194);}return _0x4ea8ab;};}function handleError(_0x32b52b,_0x58ae2a){_0x58ae2a=_0x58ae2a||0x1f4;return function(_0x33d719){logger[_0x5552('0x1b')](_0x33d719[_0x5552('0x1c')]);if(_0x33d719[_0x5552('0x1d')]){delete _0x33d719['name'];}_0x32b52b[_0x5552('0x1a')](_0x58ae2a)[_0x5552('0x1e')](_0x33d719);};}exports[_0x5552('0x1f')]=function(_0x236b92,_0x125ffc){var _0x631cd2={},_0x45a43f={},_0x103158={'count':0x0,'rows':[]};return db[_0x5552('0x20')][_0x5552('0x21')]()[_0x5552('0x19')](function(_0xa28a52){var _0x2d8a91=[];for(var _0x515034=0x0;_0x5150340x1){_0xadd424['or'](_0x5552('0x60'),qs[_0x5552('0x61')](_0x3932ca),null);}else{if(qs[_0x5552('0x62')](_0x3932ca)){_0xadd424['or'](_0x5552('0x63'),_0x3932ca+'%');_0xadd424['or']('c.phone\x20LIKE\x20?',_0x3932ca+'%');_0xadd424['or'](_0x5552('0x64'),_0x3932ca+'%');_0xadd424['or'](_0x5552('0x65'),_0x3932ca+'%');}else if(qs['isEmail'](_0x3932ca)){_0xadd424['or']('c.email\x20LIKE\x20?',_0x3932ca+'%');}else{_0xadd424['or']('c.firstName\x20LIKE\x20?','%'+_0x3932ca+'%');_0xadd424['or'](_0x5552('0x66'),'%'+_0x3932ca+'%');_0xadd424['or'](_0x5552('0x67'),'%'+_0x3932ca+'%');}}}}_0x45c30e[_0x5552('0x34')](_0xadd424);_0x45c30e['group'](_0x5552('0x68'));var _0x45e413={'type':db['Sequelize'][_0x5552('0x69')][_0x5552('0x6a')],'raw':!![]};var _0x360c78=_0x45c30e[_0x5552('0x6b')]()['field'](_0x5552('0x68'));if(_0x631cd2['order']){_0x631cd2[_0x5552('0x32')][_0x5552('0x45')](function(_0x4f2d3c){_0x45c30e[_0x5552('0x32')]('c.'+_0x4f2d3c[0x0],_0x4f2d3c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5552('0x56')](_0x476a44)){_0x45c30e[_0x5552('0x6c')](_0x169e1d);_0x360c78['where']('t.id\x20IN\x20?',_0x476a44);}BPromise[_0x5552('0x6d')]()[_0x5552('0x19')](function(){if(!_0x121a70)return;if(_0x236b92[_0x5552('0x6e')][_0x5552('0x6f')]!==_0x5552('0x70'))return;if(!_['some'](_0x121a70[_0x5552('0x41')],[_0x5552('0x36'),_0x5552('0x71')])){return _0x236b92['user'][_0x5552('0x72')]({'attributes':['id'],'raw':!![]})[_0x5552('0x19')](function(_0x244975){if(_[_0x5552('0x56')](_0x244975)){_0x360c78[_0x5552('0x34')](_0x5552('0x73'));_0x45c30e[_0x5552('0x34')](_0x5552('0x73'));}else{_0x360c78[_0x5552('0x34')](_0x5552('0x74'),_['map'](_0x244975,'id'));_0x45c30e['where'](_0x5552('0x74'),_['map'](_0x244975,'id'));}});}})[_0x5552('0x19')](function(){if(_0x236b92[_0x5552('0x6e')]['role']==='agent'&&!_0x121a70&&!_0x236b92[_0x5552('0x2b')][_0x5552('0x57')])return[];return db[_0x5552('0x75')]['query'](_0x360c78[_0x5552('0x76')](),_0x45e413);})[_0x5552('0x19')](function(_0x4a1584){_0x103158['count']=_0x4a1584[_0x5552('0x23')];if(_0x103158['count']===0x0)return[];return db['sequelize'][_0x5552('0x2b')](_0x12be16[_0x5552('0x76')](),_0x45e413)['then'](function(_0x58ee9f){_0x237b80=_[_0x5552('0x77')](_0x58ee9f,'id');_0x45e413=_['merge'](_0x45e413,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x236b92[_0x5552('0x2b')][_0x5552('0x2e')]){_0x631cd2['attributes'][_0x5552('0x45')](function(_0x5739fa){_0x45c30e[_0x5552('0x36')]('c.'+_0x5739fa);});}else{_0x45c30e[_0x5552('0x36')]('c.id');_0x45c30e[_0x5552('0x36')](_0x5552('0x78'));_0x45c30e[_0x5552('0x36')](_0x5552('0x79'));_0x45c30e['field'](_0x5552('0x7a'));_0x45c30e[_0x5552('0x36')]('c.mobile');_0x45c30e[_0x5552('0x36')](_0x5552('0x7b'));_0x45c30e[_0x5552('0x36')](_0x5552('0x7c'));_0x45c30e[_0x5552('0x36')](_0x5552('0x7d'));_0x45c30e['field'](_0x5552('0x7e'));_0x45c30e['field']('c.deletedAt');_0x45c30e['field']('c.CompanyId');_0x45c30e[_0x5552('0x36')](_0x5552('0x7f'),_0x5552('0x80'));}if(_0x631cd2['limit'])_0x45c30e['limit'](_0x631cd2['limit']);if(_0x631cd2['offset'])_0x45c30e['offset'](_0x631cd2[_0x5552('0x13')]);return db[_0x5552('0x75')][_0x5552('0x2b')](_0x45c30e[_0x5552('0x76')](),_0x45e413);});})['then'](function(_0x31a022){_0x31a022[_0x5552('0x45')](function(_0x27bc16){if(_0x27bc16[_0x5552('0x80')]){_0x27bc16['Tags']=[];_0x27bc16[_0x5552('0x80')][_0x5552('0x5f')](',')['forEach'](function(_0x41445a){_0x27bc16['Tags']['push'](_0x237b80[_0x41445a]);});}delete _0x27bc16[_0x5552('0x80')];});_0x103158[_0x5552('0x81')]=_0x31a022;return _0x103158;})[_0x5552('0x19')](respondWithFilteredResult(_0x125ffc,_0x631cd2));})['catch'](handleError(_0x125ffc,null));};exports[_0x5552('0x82')]=function(_0x39e9f3,_0x5e0eec){return db[_0x5552('0x20')]['find']({'where':{'id':_0x39e9f3[_0x5552('0x83')]['id']}})[_0x5552('0x19')](handleEntityNotFound(_0x5e0eec,null))[_0x5552('0x19')](removeEntity(_0x5e0eec,null))[_0x5552('0x84')](handleError(_0x5e0eec,null));};exports[_0x5552('0x21')]=function(_0x2d47b4,_0x312bb7){return db['CmContact'][_0x5552('0x21')]()[_0x5552('0x19')](function(_0x39c542){delete _0x39c542[_0x5552('0x85')];for(var _0x522dce=0x0;_0x522dce=_0x49b1f2){_0x3e0539=_0x49b1f2;_0x2dbf08=0xc8;}else{_0x2dbf08=0xce;}_0x4d8155[_0x4d0a('0xe')](_0x2dbf08);return _0x4d8155[_0x4d0a('0x13')](_0x4d0a('0x14'),_0x461e27+'-'+_0x3e0539+'/'+_0x49b1f2)[_0x4d0a('0xf')](_0x5a35be);}return null;};}function saveUpdates(_0x477c85){return function(_0x1f2479){if(_0x1f2479){return _0x1f2479[_0x4d0a('0x15')](_0x477c85)['then'](function(_0x358878){return _0x358878;});}return null;};}function removeEntity(_0x14da3e){return function(_0x38f959){if(_0x38f959){return _0x38f959[_0x4d0a('0x16')]()[_0x4d0a('0x17')](function(){_0x14da3e['status'](0xcc)[_0x4d0a('0x18')]();});}};}function handleEntityNotFound(_0x2dfd8e){return function(_0x1ec642){if(!_0x1ec642){_0x2dfd8e[_0x4d0a('0x19')](0x194);}return _0x1ec642;};}function handleError(_0x585ceb,_0x3c6465){_0x3c6465=_0x3c6465||0x1f4;return function(_0x50188c){logger['error'](_0x50188c[_0x4d0a('0x1a')]);if(_0x50188c[_0x4d0a('0x1b')]){delete _0x50188c['name'];}_0x585ceb[_0x4d0a('0xe')](_0x3c6465)['send'](_0x50188c);};}exports[_0x4d0a('0x1c')]=function(_0x3853b8,_0x37c757){var _0x2ba6fb={},_0x37147a={},_0x34bcd5={'count':0x0,'rows':[]};return db[_0x4d0a('0x1d')][_0x4d0a('0x1e')]()['then'](function(_0xe9f968){var _0x5188db=[];for(var _0x125e8f=0x0;_0x125e8f0x1){_0xd6a850['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4d0a('0x5e')](_0x4f29f2),null);}else{if(qs[_0x4d0a('0x5f')](_0x4f29f2)){_0xd6a850['or'](_0x4d0a('0x60'),_0x4f29f2+'%');_0xd6a850['or'](_0x4d0a('0x61'),_0x4f29f2+'%');_0xd6a850['or'](_0x4d0a('0x62'),_0x4f29f2+'%');_0xd6a850['or'](_0x4d0a('0x63'),_0x4f29f2+'%');}else if(qs[_0x4d0a('0x64')](_0x4f29f2)){_0xd6a850['or'](_0x4d0a('0x65'),_0x4f29f2+'%');}else{_0xd6a850['or']('c.firstName\x20LIKE\x20?','%'+_0x4f29f2+'%');_0xd6a850['or'](_0x4d0a('0x66'),'%'+_0x4f29f2+'%');_0xd6a850['or']('c.email\x20LIKE\x20?','%'+_0x4f29f2+'%');}}}}_0x30d42a[_0x4d0a('0x32')](_0xd6a850);_0x30d42a[_0x4d0a('0x67')]('c.id');var _0x156801={'type':db['Sequelize'][_0x4d0a('0x68')][_0x4d0a('0x69')],'raw':!![]};var _0xee8251=_0x30d42a['clone']()[_0x4d0a('0x34')]('c.id');if(_0x2ba6fb['order']){_0x2ba6fb[_0x4d0a('0x31')][_0x4d0a('0x46')](function(_0x4403df){_0x30d42a[_0x4d0a('0x31')]('c.'+_0x4403df[0x0],_0x4403df[0x1]===_0x4d0a('0x6a')?![]:!![]);});}if(!_[_0x4d0a('0x55')](_0x300a31)){_0x30d42a['having'](_0x37ced3);_0xee8251[_0x4d0a('0x32')](_0x4d0a('0x6b'),_0x300a31);}BPromise[_0x4d0a('0x6c')]()[_0x4d0a('0x17')](function(){if(!_0x451a07)return;if(_0x3853b8[_0x4d0a('0x6d')][_0x4d0a('0x6e')]!=='agent')return;if(!_[_0x4d0a('0x6f')](_0x451a07[_0x4d0a('0x42')],[_0x4d0a('0x34'),'User'])){return _0x3853b8[_0x4d0a('0x6d')][_0x4d0a('0x70')]({'attributes':['id'],'raw':!![]})[_0x4d0a('0x17')](function(_0x3114d2){if(_[_0x4d0a('0x55')](_0x3114d2)){_0xee8251[_0x4d0a('0x32')](_0x4d0a('0x71'));_0x30d42a[_0x4d0a('0x32')](_0x4d0a('0x71'));}else{_0xee8251['where'](_0x4d0a('0x57'),_[_0x4d0a('0x45')](_0x3114d2,'id'));_0x30d42a[_0x4d0a('0x32')]('c.ListId\x20IN\x20?',_[_0x4d0a('0x45')](_0x3114d2,'id'));}});}})[_0x4d0a('0x17')](function(){if(_0x3853b8['user'][_0x4d0a('0x6e')]===_0x4d0a('0x72')&&!_0x451a07&&!_0x3853b8['query'][_0x4d0a('0x56')])return[];return db['sequelize'][_0x4d0a('0x29')](_0xee8251[_0x4d0a('0x73')](),_0x156801);})[_0x4d0a('0x17')](function(_0x5bf694){_0x34bcd5[_0x4d0a('0x12')]=_0x5bf694[_0x4d0a('0x24')];if(_0x34bcd5[_0x4d0a('0x12')]===0x0)return[];return db[_0x4d0a('0x74')][_0x4d0a('0x29')](_0x356015[_0x4d0a('0x73')](),_0x156801)[_0x4d0a('0x17')](function(_0xdf397e){_0xe4f13c=_[_0x4d0a('0x75')](_0xdf397e,'id');_0x156801=_['merge'](_0x156801,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3853b8[_0x4d0a('0x29')]['fields']){_0x2ba6fb['attributes']['forEach'](function(_0x448280){_0x30d42a['field']('c.'+_0x448280);});}else{_0x30d42a[_0x4d0a('0x34')](_0x4d0a('0x76'));_0x30d42a['field'](_0x4d0a('0x77'));_0x30d42a[_0x4d0a('0x34')](_0x4d0a('0x78'));_0x30d42a['field']('c.phone');_0x30d42a['field']('c.mobile');_0x30d42a['field'](_0x4d0a('0x79'));_0x30d42a[_0x4d0a('0x34')]('c.email');_0x30d42a['field'](_0x4d0a('0x7a'));_0x30d42a[_0x4d0a('0x34')](_0x4d0a('0x7b'));_0x30d42a['field'](_0x4d0a('0x7c'));_0x30d42a['field'](_0x4d0a('0x7d'));_0x30d42a[_0x4d0a('0x34')](_0x4d0a('0x7e'),_0x4d0a('0x7f'));}if(_0x2ba6fb['limit'])_0x30d42a[_0x4d0a('0x30')](_0x2ba6fb['limit']);if(_0x2ba6fb[_0x4d0a('0x10')])_0x30d42a[_0x4d0a('0x10')](_0x2ba6fb[_0x4d0a('0x10')]);return db['sequelize'][_0x4d0a('0x29')](_0x30d42a[_0x4d0a('0x73')](),_0x156801);});})[_0x4d0a('0x17')](function(_0xcc80f1){_0xcc80f1[_0x4d0a('0x46')](function(_0xd2c0c7){if(_0xd2c0c7[_0x4d0a('0x7f')]){_0xd2c0c7[_0x4d0a('0x80')]=[];_0xd2c0c7['TagIds'][_0x4d0a('0x81')](',')['forEach'](function(_0x1bf109){_0xd2c0c7[_0x4d0a('0x80')][_0x4d0a('0x53')](_0xe4f13c[_0x1bf109]);});}delete _0xd2c0c7[_0x4d0a('0x7f')];});_0x34bcd5[_0x4d0a('0x82')]=_0xcc80f1;return _0x34bcd5;})[_0x4d0a('0x17')](respondWithFilteredResult(_0x37c757,_0x2ba6fb));})['catch'](handleError(_0x37c757,null));};exports[_0x4d0a('0x16')]=function(_0x266570,_0x3cd6d4){return db['CmContact'][_0x4d0a('0x43')]({'where':{'id':_0x266570['params']['id']}})[_0x4d0a('0x17')](handleEntityNotFound(_0x3cd6d4,null))[_0x4d0a('0x17')](removeEntity(_0x3cd6d4,null))[_0x4d0a('0x83')](handleError(_0x3cd6d4,null));};exports['describe']=function(_0x5e7fa8,_0x4b5128){return db[_0x4d0a('0x1d')][_0x4d0a('0x1e')]()[_0x4d0a('0x17')](function(_0x451128){delete _0x451128['tags'];for(var _0x2a2741=0x0;_0x2a2741{}\s\\|]/g,'-');_0x57037e(null,util['format'](_0xb806('0x20'),path['basename'](_0x559e45['originalname'],path['extname'](_0x559e45['originalname'])),Date['now'](),path[_0xb806('0x21')](_0x559e45[_0xb806('0x1e')])));}})});router[_0xb806('0x16')](_0xb806('0x22'),upload[_0xb806('0x23')](_0xb806('0x24')),controller[_0xb806('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc2d823,_0x1a07e1,_0x2a908f){_0x2a908f(null,path[_0xb806('0x1c')](config[_0xb806('0x26')],'server/files/tmp'));},'filename':function(_0x158508,_0x349f70,_0x3ffdab){_0x349f70[_0xb806('0x1e')]=_0x349f70[_0xb806('0x1e')][_0xb806('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ffdab(null,util[_0xb806('0x27')](_0xb806('0x20'),path[_0xb806('0x28')](_0x349f70[_0xb806('0x1e')],path[_0xb806('0x21')](_0x349f70[_0xb806('0x1e')])),Date[_0xb806('0x29')](),path[_0xb806('0x21')](_0x349f70['originalname'])));}})});router[_0xb806('0x16')](_0xb806('0x2a'),upload[_0xb806('0x23')]('file'),controller[_0xb806('0x2b')]);router[_0xb806('0x16')](_0xb806('0x2c'),auth[_0xb806('0xa')](),controller[_0xb806('0x2d')]);router['put'](_0xb806('0x2e'),auth[_0xb806('0xa')](),controller[_0xb806('0x2f')]);router[_0xb806('0x30')](_0xb806('0x2e'),auth[_0xb806('0xa')](),controller[_0xb806('0x31')]);module[_0xb806('0x32')]=router; \ No newline at end of file +var _0xb020=['replace','%s-%s%s','now','extname','/csv','single','file','uploadCsv','format','basename','/upload','upload','import','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContact.controller','isAuthenticated','index','describe','get','/:id','show','getTags','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','/:id/tags','setTags','diskStorage','join','root','server/files/tmp','originalname'];(function(_0x5a3604,_0x3d15b5){var _0x17ce7e=function(_0x1ccff8){while(--_0x1ccff8){_0x5a3604['push'](_0x5a3604['shift']());}};_0x17ce7e(++_0x3d15b5);}(_0xb020,0x1c9));var _0x0b02=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0xb020[_0x5dee2a];return _0x31e98e;};'use strict';var multer=require(_0x0b02('0x0'));var util=require(_0x0b02('0x1'));var path=require('path');var timeout=require(_0x0b02('0x2'));var express=require(_0x0b02('0x3'));var router=express[_0x0b02('0x4')]();var fs_extra=require(_0x0b02('0x5'));var auth=require(_0x0b02('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b02('0x7'));var controller=require(_0x0b02('0x8'));router['get']('/',auth[_0x0b02('0x9')](),controller[_0x0b02('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0b02('0xb')]);router[_0x0b02('0xc')](_0x0b02('0xd'),auth[_0x0b02('0x9')](),controller[_0x0b02('0xe')]);router[_0x0b02('0xc')]('/:id/tags',auth[_0x0b02('0x9')](),controller[_0x0b02('0xf')]);router[_0x0b02('0xc')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0b02('0x10')]);router[_0x0b02('0xc')](_0x0b02('0x11'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x12')]);router[_0x0b02('0xc')](_0x0b02('0x13'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x14')]);router['get'](_0x0b02('0x15'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x16')]);router['get'](_0x0b02('0x17'),auth['isAuthenticated'](),controller[_0x0b02('0x18')]);router[_0x0b02('0x19')](_0x0b02('0x1a'),auth['isAuthenticated'](),controller[_0x0b02('0x1b')]);router[_0x0b02('0x19')]('/',auth['isAuthenticated'](),controller[_0x0b02('0x1c')]);router[_0x0b02('0x19')](_0x0b02('0x1d'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x1e')]);router['post'](_0x0b02('0x1f'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x20')]);var upload=multer({'storage':multer[_0x0b02('0x21')]({'destination':function(_0x2f0105,_0x483e83,_0x38cfa9){_0x38cfa9(null,path[_0x0b02('0x22')](config[_0x0b02('0x23')],_0x0b02('0x24')));},'filename':function(_0x26ffdc,_0xfce284,_0xdc103a){_0xfce284[_0x0b02('0x25')]=_0xfce284[_0x0b02('0x25')][_0x0b02('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xdc103a(null,util['format'](_0x0b02('0x27'),path['basename'](_0xfce284[_0x0b02('0x25')],path['extname'](_0xfce284[_0x0b02('0x25')])),Date[_0x0b02('0x28')](),path[_0x0b02('0x29')](_0xfce284[_0x0b02('0x25')])));}})});router[_0x0b02('0x19')](_0x0b02('0x2a'),upload[_0x0b02('0x2b')](_0x0b02('0x2c')),controller[_0x0b02('0x2d')]);var upload=multer({'storage':multer[_0x0b02('0x21')]({'destination':function(_0x466335,_0x4d27b6,_0x7e6b26){_0x7e6b26(null,path['join'](config[_0x0b02('0x23')],_0x0b02('0x24')));},'filename':function(_0x2b733a,_0x53fca2,_0x9bd93){_0x53fca2[_0x0b02('0x25')]=_0x53fca2[_0x0b02('0x25')][_0x0b02('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9bd93(null,util[_0x0b02('0x2e')]('%s-%s%s',path[_0x0b02('0x2f')](_0x53fca2['originalname'],path['extname'](_0x53fca2[_0x0b02('0x25')])),Date[_0x0b02('0x28')](),path[_0x0b02('0x29')](_0x53fca2[_0x0b02('0x25')])));}})});router['post'](_0x0b02('0x30'),upload['single']('file'),controller[_0x0b02('0x31')]);router[_0x0b02('0x19')]('/upload/:id',auth[_0x0b02('0x9')](),controller[_0x0b02('0x32')]);router['put'](_0x0b02('0xd'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x33')]);router[_0x0b02('0x34')](_0x0b02('0xd'),auth[_0x0b02('0x9')](),controller[_0x0b02('0x35')]);module[_0x0b02('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 2eba4ee..5aaeb2c 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 _0xc65c=['VIRTUAL','getDataValue','alias','setDataValue','STRING','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','lodash','exports'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xc65c,0x19e));var _0xcc65=function(_0x110c20,_0x55f872){_0x110c20=_0x110c20-0x0;var _0x382800=_0xc65c[_0x110c20];return _0x382800;};'use strict';var Sequelize=require('sequelize');var _=require(_0xcc65('0x0'));module[_0xcc65('0x1')]={'name':{'type':Sequelize[_0xcc65('0x2')],'get':function(_0x3ab83f){return this[_0xcc65('0x3')](_0xcc65('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x10ddbb){this[_0xcc65('0x5')](_0xcc65('0x4'),_0x10ddbb?_0x10ddbb:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0xcc65('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xcc65('0x7')),'get':function(){if(this[_0xcc65('0x3')](_0xcc65('0x8'))===_0xcc65('0x9')){return JSON[_0xcc65('0xa')](this[_0xcc65('0x3')](_0xcc65('0xb')));}else{return this[_0xcc65('0x3')](_0xcc65('0xb'));}},'set':function(_0x571c8e){if(Array[_0xcc65('0xc')](_0x571c8e)){this[_0xcc65('0x5')]('values',JSON[_0xcc65('0xd')](_0x571c8e));}else{this['setDataValue'](_0xcc65('0xb'),_0x571c8e);}}},'required':{'type':Sequelize[_0xcc65('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcc65('0xf')]('voice')}}; \ No newline at end of file +var _0x597f=['VIRTUAL','STRING','setDataValue','alias','getDataValue','name','TEXT','long','type','select','parse','values','BOOLEAN','ENUM','voice','lodash','exports'];(function(_0x5c4a34,_0x2b8a6c){var _0x468ede=function(_0xfc7f1a){while(--_0xfc7f1a){_0x5c4a34['push'](_0x5c4a34['shift']());}};_0x468ede(++_0x2b8a6c);}(_0x597f,0x11f));var _0xf597=function(_0x583125,_0x34c12b){_0x583125=_0x583125-0x0;var _0x118c4d=_0x597f[_0x583125];return _0x118c4d;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf597('0x0'));module[_0xf597('0x1')]={'name':{'type':Sequelize[_0xf597('0x2')],'get':function(_0x1f37f4){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xf597('0x3')],'allowNull':![],'set':function(_0x3dbc45){this[_0xf597('0x4')](_0xf597('0x5'),_0x3dbc45?_0x3dbc45:this[_0xf597('0x6')](_0xf597('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xf597('0x8')](_0xf597('0x9')),'get':function(){if(this[_0xf597('0x6')](_0xf597('0xa'))===_0xf597('0xb')){return JSON[_0xf597('0xc')](this['getDataValue'](_0xf597('0xd')));}else{return this['getDataValue'](_0xf597('0xd'));}},'set':function(_0x3135bd){if(Array['isArray'](_0x3135bd)){this[_0xf597('0x4')](_0xf597('0xd'),JSON['stringify'](_0x3135bd));}else{this[_0xf597('0x4')](_0xf597('0xd'),_0x3135bd);}}},'required':{'type':Sequelize[_0xf597('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf597('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf597('0xf')](_0xf597('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 45032ef..7e7c7d8 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 _0x945e=['includeAll','include','findAll','params','fields','options','find','body','catch','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','keys','filters','intersection','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x4812e7,_0x19c190){var _0x46455a=function(_0x56b02f){while(--_0x56b02f){_0x4812e7['push'](_0x4812e7['shift']());}};_0x46455a(++_0x19c190);}(_0x945e,0xca));var _0xe945=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x945e[_0x53cf8e];return _0x459197;};'use strict';var emlformat=require(_0xe945('0x0'));var rimraf=require(_0xe945('0x1'));var zipdir=require(_0xe945('0x2'));var jsonpatch=require(_0xe945('0x3'));var rp=require(_0xe945('0x4'));var moment=require(_0xe945('0x5'));var BPromise=require(_0xe945('0x6'));var Mustache=require(_0xe945('0x7'));var util=require(_0xe945('0x8'));var path=require('path');var sox=require(_0xe945('0x9'));var csv=require(_0xe945('0xa'));var ejs=require(_0xe945('0xb'));var fs=require('fs');var fs_extra=require(_0xe945('0xc'));var _=require(_0xe945('0xd'));var squel=require(_0xe945('0xe'));var crypto=require(_0xe945('0xf'));var jsforce=require(_0xe945('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe945('0x11'));var Redis=require(_0xe945('0x12'));var authService=require(_0xe945('0x13'));var qs=require(_0xe945('0x14'));var as=require(_0xe945('0x15'));var hardwareService=require(_0xe945('0x16'));var logger=require(_0xe945('0x17'))(_0xe945('0x18'));var utils=require(_0xe945('0x19'));var config=require(_0xe945('0x1a'));var licenseUtil=require(_0xe945('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54266d,_0xb9b789){_0xb9b789=_0xb9b789||0xcc;return function(_0x5d9731){if(_0x5d9731){return _0x54266d[_0xe945('0x1c')](_0xb9b789);}return _0x54266d[_0xe945('0x1d')](_0xb9b789)[_0xe945('0x1e')]();};}function respondWithResult(_0x277a80,_0x123362){_0x123362=_0x123362||0xc8;return function(_0x477827){if(_0x477827){return _0x277a80['status'](_0x123362)[_0xe945('0x1f')](_0x477827);}};}function respondWithFilteredResult(_0x1b0130,_0x4fe162){return function(_0x11d1c3){if(_0x11d1c3){var _0x20042f=typeof _0x4fe162[_0xe945('0x20')]===_0xe945('0x21')&&typeof _0x4fe162[_0xe945('0x22')]===_0xe945('0x21');var _0x5c82f9=_0x11d1c3[_0xe945('0x23')];var _0xfbf1f5=_0x20042f?0x0:_0x4fe162[_0xe945('0x20')];var _0x5c438d=_0x20042f?_0x11d1c3[_0xe945('0x23')]:_0x4fe162[_0xe945('0x20')]+_0x4fe162[_0xe945('0x22')];var _0x23d833;if(_0x5c438d>=_0x5c82f9){_0x5c438d=_0x5c82f9;_0x23d833=0xc8;}else{_0x23d833=0xce;}_0x1b0130[_0xe945('0x1d')](_0x23d833);return _0x1b0130[_0xe945('0x24')]('Content-Range',_0xfbf1f5+'-'+_0x5c438d+'/'+_0x5c82f9)['json'](_0x11d1c3);}return null;};}function patchUpdates(_0x194a4a){return function(_0x4572ab){try{jsonpatch[_0xe945('0x25')](_0x4572ab,_0x194a4a,!![]);}catch(_0x4b3507){return BPromise['reject'](_0x4b3507);}return _0x4572ab[_0xe945('0x26')]();};}function saveUpdates(_0x5bd12e,_0x432d7e){return function(_0x3b1a2c){if(_0x3b1a2c){return _0x3b1a2c[_0xe945('0x27')](_0x5bd12e)['then'](function(_0x4d927c){return _0x4d927c;});}return null;};}function removeEntity(_0x10e890,_0x231673){return function(_0x71fc74){if(_0x71fc74){return _0x71fc74[_0xe945('0x28')]()[_0xe945('0x29')](function(){_0x10e890[_0xe945('0x1d')](0xcc)[_0xe945('0x1e')]();});}};}function handleEntityNotFound(_0x55efc5,_0x260fbc){return function(_0x1aee5b){if(!_0x1aee5b){_0x55efc5[_0xe945('0x1c')](0x194);}return _0x1aee5b;};}function handleError(_0x19307b,_0x246fc2){_0x246fc2=_0x246fc2||0x1f4;return function(_0xc58f1f){logger['error'](_0xc58f1f[_0xe945('0x2a')]);if(_0xc58f1f[_0xe945('0x2b')]){delete _0xc58f1f[_0xe945('0x2b')];}_0x19307b[_0xe945('0x1d')](_0x246fc2)['send'](_0xc58f1f);};}exports[_0xe945('0x2c')]=function(_0x5c0ec9,_0x108868){var _0x3ade55={},_0x5e76f3={},_0x5b002d={'count':0x0,'rows':[]};var _0x430e2f=_[_0xe945('0x2d')](db[_0xe945('0x2e')][_0xe945('0x2f')],function(_0x3d16f7){return{'name':_0x3d16f7[_0xe945('0x30')],'type':_0x3d16f7[_0xe945('0x31')][_0xe945('0x32')]};});_0x5e76f3[_0xe945('0x33')]=_[_0xe945('0x34')](_['map'](_0x430e2f,_0xe945('0x2b')),[_0xe945('0x2b')]);_0x5e76f3['query']=_[_0xe945('0x35')](_0x5c0ec9['query']);_0x5e76f3[_0xe945('0x36')]=_[_0xe945('0x37')](_0x5e76f3['model'],_0x5e76f3['query']);_0x3ade55['attributes']=_['intersection'](_0x5e76f3[_0xe945('0x33')],qs['fields'](_0x5c0ec9['query']['fields']));_0x3ade55[_0xe945('0x38')]=_0x3ade55[_0xe945('0x38')][_0xe945('0x39')]?_0x3ade55[_0xe945('0x38')]:_0x5e76f3['model'];if(!_0x5c0ec9[_0xe945('0x3a')][_0xe945('0x3b')](_0xe945('0x3c'))){_0x3ade55[_0xe945('0x22')]=qs['limit'](_0x5c0ec9['query'][_0xe945('0x22')]);_0x3ade55[_0xe945('0x20')]=qs[_0xe945('0x20')](_0x5c0ec9['query'][_0xe945('0x20')]);}_0x3ade55[_0xe945('0x3d')]=qs[_0xe945('0x3e')](_0x5c0ec9[_0xe945('0x3a')][_0xe945('0x3e')]);_0x3ade55[_0xe945('0x3f')]=qs[_0xe945('0x36')](_[_0xe945('0x40')](_0x5c0ec9[_0xe945('0x3a')],_0x5e76f3['filters']),_0x430e2f);if(_0x5c0ec9['query'][_0xe945('0x41')]){_0x3ade55[_0xe945('0x3f')]=_[_0xe945('0x42')](_0x3ade55[_0xe945('0x3f')],{'$or':_[_0xe945('0x2d')](_0x430e2f,function(_0xe4ea21){if(_0xe4ea21[_0xe945('0x31')]!==_0xe945('0x43')){var _0x21dd0b={};_0x21dd0b[_0xe4ea21['name']]={'$like':'%'+_0x5c0ec9['query']['filter']+'%'};return _0x21dd0b;}})});}_0x3ade55=_[_0xe945('0x42')]({},_0x3ade55,_0x5c0ec9['options']);var _0x2241f5={'where':_0x3ade55[_0xe945('0x3f')]};return db['CmCustomField'][_0xe945('0x23')](_0x2241f5)[_0xe945('0x29')](function(_0x2166a1){_0x5b002d[_0xe945('0x23')]=_0x2166a1;if(_0x5c0ec9[_0xe945('0x3a')][_0xe945('0x44')]){_0x3ade55[_0xe945('0x45')]=[{'all':!![]}];}return db[_0xe945('0x2e')][_0xe945('0x46')](_0x3ade55);})[_0xe945('0x29')](function(_0x4612dc){_0x5b002d['rows']=_0x4612dc;return _0x5b002d;})['then'](respondWithFilteredResult(_0x108868,_0x3ade55))['catch'](handleError(_0x108868,null));};exports['show']=function(_0x4ca906,_0x19f448){var _0x491f23={'raw':!![],'where':{'id':_0x4ca906[_0xe945('0x47')]['id']}},_0x2d21f2={};_0x2d21f2['model']=_[_0xe945('0x35')](db[_0xe945('0x2e')][_0xe945('0x2f')]);_0x2d21f2[_0xe945('0x3a')]=_['keys'](_0x4ca906['query']);_0x2d21f2['filters']=_['intersection'](_0x2d21f2[_0xe945('0x33')],_0x2d21f2[_0xe945('0x3a')]);_0x491f23[_0xe945('0x38')]=_[_0xe945('0x37')](_0x2d21f2[_0xe945('0x33')],qs[_0xe945('0x48')](_0x4ca906[_0xe945('0x3a')][_0xe945('0x48')]));_0x491f23[_0xe945('0x38')]=_0x491f23['attributes'][_0xe945('0x39')]?_0x491f23[_0xe945('0x38')]:_0x2d21f2[_0xe945('0x33')];if(_0x4ca906[_0xe945('0x3a')][_0xe945('0x44')]){_0x491f23['include']=[{'all':!![]}];}_0x491f23=_[_0xe945('0x42')]({},_0x491f23,_0x4ca906[_0xe945('0x49')]);return db[_0xe945('0x2e')][_0xe945('0x4a')](_0x491f23)['then'](handleEntityNotFound(_0x19f448,null))[_0xe945('0x29')](respondWithResult(_0x19f448,null))['catch'](handleError(_0x19f448,null));};exports[_0xe945('0x27')]=function(_0x5873e3,_0x3f3c51){if(_0x5873e3[_0xe945('0x4b')]['id']){delete _0x5873e3[_0xe945('0x4b')]['id'];}return db[_0xe945('0x2e')][_0xe945('0x4a')]({'where':{'id':_0x5873e3[_0xe945('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f3c51,null))[_0xe945('0x29')](saveUpdates(_0x5873e3[_0xe945('0x4b')],null))[_0xe945('0x29')](respondWithResult(_0x3f3c51,null))[_0xe945('0x4c')](handleError(_0x3f3c51,null));};exports[_0xe945('0x28')]=function(_0x189ed0,_0x58344e){return db[_0xe945('0x2e')][_0xe945('0x4a')]({'where':{'id':_0x189ed0[_0xe945('0x47')]['id']}})['then'](handleEntityNotFound(_0x58344e,null))['then'](removeEntity(_0x58344e,null))[_0xe945('0x4c')](handleError(_0x58344e,null));};exports[_0xe945('0x4d')]=function(_0x294a4b,_0x4026d4){var _0x2026a2;return db[_0xe945('0x4e')][_0xe945('0x4f')](function(_0x2fcc7e){return db[_0xe945('0x2e')][_0xe945('0x4d')](_0x294a4b[_0xe945('0x4b')],{'transaction':_0x2fcc7e})[_0xe945('0x29')](function(_0x43df15){_0x2026a2=_0x43df15;var _0x3c8882={'type':db['Sequelize'][_0xe945('0x50')],'transaction':_0x2fcc7e};switch(_0x294a4b[_0xe945('0x4b')][_0xe945('0x31')]){case _0xe945('0x51'):_0x3c8882[_0xe945('0x31')]=db[_0xe945('0x52')][_0xe945('0x50')];break;case _0xe945('0x53'):_0x3c8882[_0xe945('0x31')]=db[_0xe945('0x52')][_0xe945('0x54')];break;case'switch':_0x3c8882[_0xe945('0x31')]=db[_0xe945('0x52')][_0xe945('0x55')];_0x3c8882[_0xe945('0x56')]=![];break;default:}return db[_0xe945('0x4e')][_0xe945('0x57')][_0xe945('0x58')](_0xe945('0x59'),util['format']('cf_%d',_0x2026a2['id']),_0x3c8882);})[_0xe945('0x29')](function(){return _0x2026a2;});})[_0xe945('0x29')](respondWithResult(_0x4026d4,0xc9))[_0xe945('0x4c')](handleError(_0x4026d4,null));}; \ No newline at end of file +var _0x6a18=['length','include','find','body','params','catch','create','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','sequelize','queryInterface','addColumn','format','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','send','index','CmCustomField','rawAttributes','type','model','differenceBy','map','name','query','keys','attributes','fields','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','findAll','show','intersection'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0x6a18,0xff));var _0x86a1=function(_0x3602b7,_0x11b298){_0x3602b7=_0x3602b7-0x0;var _0xd2fee7=_0x6a18[_0x3602b7];return _0xd2fee7;};'use strict';var emlformat=require(_0x86a1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86a1('0x1'));var rp=require(_0x86a1('0x2'));var moment=require(_0x86a1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x86a1('0x4'));var util=require(_0x86a1('0x5'));var path=require(_0x86a1('0x6'));var sox=require(_0x86a1('0x7'));var csv=require(_0x86a1('0x8'));var ejs=require(_0x86a1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x86a1('0xa'));var jsforce=require(_0x86a1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x86a1('0xc'));var Redis=require(_0x86a1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x86a1('0xe'));var as=require(_0x86a1('0xf'));var hardwareService=require(_0x86a1('0x10'));var logger=require(_0x86a1('0x11'))(_0x86a1('0x12'));var utils=require(_0x86a1('0x13'));var config=require(_0x86a1('0x14'));var licenseUtil=require(_0x86a1('0x15'));var db=require(_0x86a1('0x16'))['db'];function respondWithStatusCode(_0x564431,_0x25b26c){_0x25b26c=_0x25b26c||0xcc;return function(_0x55a9f3){if(_0x55a9f3){return _0x564431['sendStatus'](_0x25b26c);}return _0x564431[_0x86a1('0x17')](_0x25b26c)[_0x86a1('0x18')]();};}function respondWithResult(_0x101257,_0x1ee3b7){_0x1ee3b7=_0x1ee3b7||0xc8;return function(_0x4aab65){if(_0x4aab65){return _0x101257[_0x86a1('0x17')](_0x1ee3b7)['json'](_0x4aab65);}};}function respondWithFilteredResult(_0x322f33,_0xdb5253){return function(_0x4ea198){if(_0x4ea198){var _0x4244a4=typeof _0xdb5253['offset']===_0x86a1('0x19')&&typeof _0xdb5253['limit']===_0x86a1('0x19');var _0x47d1a2=_0x4ea198['count'];var _0x2f29f7=_0x4244a4?0x0:_0xdb5253['offset'];var _0x345b4a=_0x4244a4?_0x4ea198[_0x86a1('0x1a')]:_0xdb5253[_0x86a1('0x1b')]+_0xdb5253[_0x86a1('0x1c')];var _0x58a087;if(_0x345b4a>=_0x47d1a2){_0x345b4a=_0x47d1a2;_0x58a087=0xc8;}else{_0x58a087=0xce;}_0x322f33[_0x86a1('0x17')](_0x58a087);return _0x322f33['set'](_0x86a1('0x1d'),_0x2f29f7+'-'+_0x345b4a+'/'+_0x47d1a2)['json'](_0x4ea198);}return null;};}function patchUpdates(_0x28b316){return function(_0x53df3b){try{jsonpatch[_0x86a1('0x1e')](_0x53df3b,_0x28b316,!![]);}catch(_0x2ef5cc){return BPromise[_0x86a1('0x1f')](_0x2ef5cc);}return _0x53df3b['save']();};}function saveUpdates(_0x466c46,_0x25122b){return function(_0x188399){if(_0x188399){return _0x188399[_0x86a1('0x20')](_0x466c46)[_0x86a1('0x21')](function(_0x2c4dc6){return _0x2c4dc6;});}return null;};}function removeEntity(_0x1f7b74,_0x224e32){return function(_0x32f503){if(_0x32f503){return _0x32f503[_0x86a1('0x22')]()[_0x86a1('0x21')](function(){_0x1f7b74[_0x86a1('0x17')](0xcc)[_0x86a1('0x18')]();});}};}function handleEntityNotFound(_0x1fd9ac,_0x1e8657){return function(_0x44f278){if(!_0x44f278){_0x1fd9ac[_0x86a1('0x23')](0x194);}return _0x44f278;};}function handleError(_0x28bed2,_0x1619dd){_0x1619dd=_0x1619dd||0x1f4;return function(_0x52a8e3){logger['error'](_0x52a8e3['stack']);if(_0x52a8e3['name']){delete _0x52a8e3['name'];}_0x28bed2[_0x86a1('0x17')](_0x1619dd)[_0x86a1('0x24')](_0x52a8e3);};}exports[_0x86a1('0x25')]=function(_0x44ce27,_0xc8b916){var _0x3bdebd={},_0x1cc9de={},_0x594e28={'count':0x0,'rows':[]};var _0x131f30=_['map'](db[_0x86a1('0x26')][_0x86a1('0x27')],function(_0x28ff39){return{'name':_0x28ff39['fieldName'],'type':_0x28ff39[_0x86a1('0x28')]['key']};});_0x1cc9de[_0x86a1('0x29')]=_[_0x86a1('0x2a')](_[_0x86a1('0x2b')](_0x131f30,_0x86a1('0x2c')),['name']);_0x1cc9de[_0x86a1('0x2d')]=_[_0x86a1('0x2e')](_0x44ce27[_0x86a1('0x2d')]);_0x1cc9de['filters']=_['intersection'](_0x1cc9de['model'],_0x1cc9de[_0x86a1('0x2d')]);_0x3bdebd[_0x86a1('0x2f')]=_['intersection'](_0x1cc9de[_0x86a1('0x29')],qs[_0x86a1('0x30')](_0x44ce27['query']['fields']));_0x3bdebd[_0x86a1('0x2f')]=_0x3bdebd[_0x86a1('0x2f')]['length']?_0x3bdebd[_0x86a1('0x2f')]:_0x1cc9de['model'];if(!_0x44ce27['query']['hasOwnProperty'](_0x86a1('0x31'))){_0x3bdebd[_0x86a1('0x1c')]=qs['limit'](_0x44ce27['query']['limit']);_0x3bdebd['offset']=qs[_0x86a1('0x1b')](_0x44ce27[_0x86a1('0x2d')][_0x86a1('0x1b')]);}_0x3bdebd['order']=qs['sort'](_0x44ce27[_0x86a1('0x2d')][_0x86a1('0x32')]);_0x3bdebd['where']=qs['filters'](_[_0x86a1('0x33')](_0x44ce27['query'],_0x1cc9de[_0x86a1('0x34')]),_0x131f30);if(_0x44ce27[_0x86a1('0x2d')][_0x86a1('0x35')]){_0x3bdebd[_0x86a1('0x36')]=_[_0x86a1('0x37')](_0x3bdebd[_0x86a1('0x36')],{'$or':_['map'](_0x131f30,function(_0x46195a){if(_0x46195a[_0x86a1('0x28')]!=='VIRTUAL'){var _0x5bf91f={};_0x5bf91f[_0x46195a[_0x86a1('0x2c')]]={'$like':'%'+_0x44ce27['query'][_0x86a1('0x35')]+'%'};return _0x5bf91f;}})});}_0x3bdebd=_[_0x86a1('0x37')]({},_0x3bdebd,_0x44ce27[_0x86a1('0x38')]);var _0x5e6090={'where':_0x3bdebd[_0x86a1('0x36')]};return db[_0x86a1('0x26')][_0x86a1('0x1a')](_0x5e6090)[_0x86a1('0x21')](function(_0x42ca21){_0x594e28[_0x86a1('0x1a')]=_0x42ca21;if(_0x44ce27['query'][_0x86a1('0x39')]){_0x3bdebd['include']=[{'all':!![]}];}return db[_0x86a1('0x26')][_0x86a1('0x3a')](_0x3bdebd);})[_0x86a1('0x21')](function(_0x5c23bf){_0x594e28['rows']=_0x5c23bf;return _0x594e28;})[_0x86a1('0x21')](respondWithFilteredResult(_0xc8b916,_0x3bdebd))['catch'](handleError(_0xc8b916,null));};exports[_0x86a1('0x3b')]=function(_0x969592,_0x465610){var _0x2a339a={'raw':!![],'where':{'id':_0x969592['params']['id']}},_0xdb3d94={};_0xdb3d94[_0x86a1('0x29')]=_['keys'](db[_0x86a1('0x26')][_0x86a1('0x27')]);_0xdb3d94['query']=_[_0x86a1('0x2e')](_0x969592[_0x86a1('0x2d')]);_0xdb3d94[_0x86a1('0x34')]=_[_0x86a1('0x3c')](_0xdb3d94[_0x86a1('0x29')],_0xdb3d94[_0x86a1('0x2d')]);_0x2a339a[_0x86a1('0x2f')]=_['intersection'](_0xdb3d94[_0x86a1('0x29')],qs[_0x86a1('0x30')](_0x969592['query'][_0x86a1('0x30')]));_0x2a339a[_0x86a1('0x2f')]=_0x2a339a['attributes'][_0x86a1('0x3d')]?_0x2a339a[_0x86a1('0x2f')]:_0xdb3d94['model'];if(_0x969592[_0x86a1('0x2d')][_0x86a1('0x39')]){_0x2a339a[_0x86a1('0x3e')]=[{'all':!![]}];}_0x2a339a=_[_0x86a1('0x37')]({},_0x2a339a,_0x969592[_0x86a1('0x38')]);return db[_0x86a1('0x26')][_0x86a1('0x3f')](_0x2a339a)[_0x86a1('0x21')](handleEntityNotFound(_0x465610,null))[_0x86a1('0x21')](respondWithResult(_0x465610,null))['catch'](handleError(_0x465610,null));};exports[_0x86a1('0x20')]=function(_0x2c44f1,_0x8262b2){if(_0x2c44f1['body']['id']){delete _0x2c44f1[_0x86a1('0x40')]['id'];}return db[_0x86a1('0x26')][_0x86a1('0x3f')]({'where':{'id':_0x2c44f1['params']['id']}})[_0x86a1('0x21')](handleEntityNotFound(_0x8262b2,null))[_0x86a1('0x21')](saveUpdates(_0x2c44f1[_0x86a1('0x40')],null))[_0x86a1('0x21')](respondWithResult(_0x8262b2,null))['catch'](handleError(_0x8262b2,null));};exports[_0x86a1('0x22')]=function(_0x3cdfde,_0x822b99){return db['CmCustomField']['find']({'where':{'id':_0x3cdfde[_0x86a1('0x41')]['id']}})[_0x86a1('0x21')](handleEntityNotFound(_0x822b99,null))[_0x86a1('0x21')](removeEntity(_0x822b99,null))[_0x86a1('0x42')](handleError(_0x822b99,null));};exports[_0x86a1('0x43')]=function(_0x5ca409,_0x58d904){var _0x444769;return db['sequelize'][_0x86a1('0x44')](function(_0x1098bc){return db['CmCustomField'][_0x86a1('0x43')](_0x5ca409[_0x86a1('0x40')],{'transaction':_0x1098bc})['then'](function(_0xd7c731){_0x444769=_0xd7c731;var _0x36d3d6={'type':db[_0x86a1('0x45')][_0x86a1('0x46')],'transaction':_0x1098bc};switch(_0x5ca409['body'][_0x86a1('0x28')]){case _0x86a1('0x47'):_0x36d3d6[_0x86a1('0x28')]=db[_0x86a1('0x45')][_0x86a1('0x46')];break;case _0x86a1('0x48'):_0x36d3d6[_0x86a1('0x28')]=db[_0x86a1('0x45')]['INTEGER'];break;case _0x86a1('0x49'):_0x36d3d6[_0x86a1('0x28')]=db['Sequelize'][_0x86a1('0x4a')];_0x36d3d6['defaultValue']=![];break;default:}return db[_0x86a1('0x4b')][_0x86a1('0x4c')][_0x86a1('0x4d')]('cm_contacts',util[_0x86a1('0x4e')]('cf_%d',_0x444769['id']),_0x36d3d6);})[_0x86a1('0x21')](function(){return _0x444769;});})['then'](respondWithResult(_0x58d904,0xc9))[_0x86a1('0x42')](handleError(_0x58d904,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 83e2ba2..be836c4 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 _0x7f03=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields'];(function(_0x1cac97,_0x14901b){var _0xc47a1=function(_0xd30b64){while(--_0xd30b64){_0x1cac97['push'](_0x1cac97['shift']());}};_0xc47a1(++_0x14901b);}(_0x7f03,0x8c));var _0x37f0=function(_0x2152f0,_0x726288){_0x2152f0=_0x2152f0-0x0;var _0x3a6558=_0x7f03[_0x2152f0];return _0x3a6558;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x37f0('0x0'));var moment=require(_0x37f0('0x1'));var BPromise=require(_0x37f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37f0('0x3'));var rimraf=require(_0x37f0('0x4'));var config=require(_0x37f0('0x5'));var attributes=require('./cmCustomField.attributes');module[_0x37f0('0x6')]=function(_0x158ba5,_0x38f4cd){return _0x158ba5[_0x37f0('0x7')](_0x37f0('0x8'),attributes,{'tableName':_0x37f0('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5158=['define','CmCustomField','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5158,0x15e));var _0x8515=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x5158[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x8515('0x0'));var util=require(_0x8515('0x1'));var logger=require(_0x8515('0x2'))(_0x8515('0x3'));var moment=require(_0x8515('0x4'));var BPromise=require('bluebird');var rp=require(_0x8515('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8515('0x6'));var config=require(_0x8515('0x7'));var attributes=require(_0x8515('0x8'));module[_0x8515('0x9')]=function(_0x1fc587,_0x112aac){return _0x1fc587[_0x8515('0xa')](_0x8515('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index f0766c3..f81ada2 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 _0xd963=['error','code','message','CmCustomField,\x20%s,\x20%s','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','stringify'];(function(_0x1c49ab,_0x2eec78){var _0x5b7c05=function(_0x311331){while(--_0x311331){_0x1c49ab['push'](_0x1c49ab['shift']());}};_0x5b7c05(++_0x2eec78);}(_0xd963,0x19c));var _0x3d96=function(_0x3fe440,_0x18d0cb){_0x3fe440=_0x3fe440-0x0;var _0x30cf95=_0xd963[_0x3fe440];return _0x30cf95;};'use strict';var _=require(_0x3d96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d96('0x1'));var rs=require(_0x3d96('0x2'));var fs=require('fs');var Redis=require(_0x3d96('0x3'));var db=require(_0x3d96('0x4'))['db'];var utils=require(_0x3d96('0x5'));var logger=require(_0x3d96('0x6'))('rpc');var config=require(_0x3d96('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3d96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25f3ab,_0x50f956,_0x92394b){return new BPromise(function(_0x562c20,_0x5584cc){return client[_0x3d96('0x9')](_0x25f3ab,_0x92394b)['then'](function(_0x14034e){logger[_0x3d96('0xa')]('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x3d96('0xb'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x50f956,_0x3d96('0xb'),JSON[_0x3d96('0xc')](_0x14034e));if(_0x14034e[_0x3d96('0xd')]){if(_0x14034e[_0x3d96('0xd')][_0x3d96('0xe')]===0x1f4){logger[_0x3d96('0xd')]('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x14034e['error'][_0x3d96('0xf')]);return _0x5584cc(_0x14034e[_0x3d96('0xd')][_0x3d96('0xf')]);}logger[_0x3d96('0xd')](_0x3d96('0x10'),_0x50f956,_0x14034e[_0x3d96('0xd')][_0x3d96('0xf')]);return _0x562c20(_0x14034e[_0x3d96('0xd')]['message']);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x3d96('0xb'));_0x562c20(_0x14034e['result']['message']);}})['catch'](function(_0x4c8324){logger[_0x3d96('0xd')]('CmCustomField,\x20%s,\x20%s',_0x50f956,_0x4c8324);_0x5584cc(_0x4c8324);});});} \ No newline at end of file +var _0x9a8c=['ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x51c94e,_0x83ce35){var _0x159aef=function(_0x2e0df6){while(--_0x2e0df6){_0x51c94e['push'](_0x51c94e['shift']());}};_0x159aef(++_0x83ce35);}(_0x9a8c,0x104));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9a8('0x0'));var util=require('util');var moment=require(_0xc9a8('0x1'));var BPromise=require(_0xc9a8('0x2'));var rs=require(_0xc9a8('0x3'));var fs=require('fs');var Redis=require(_0xc9a8('0x4'));var db=require(_0xc9a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9a8('0x6'))(_0xc9a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc9a8('0x8')][_0xc9a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b627b,_0xcc9db3,_0x33308b){return new BPromise(function(_0x14a86a,_0x1bd5f8){return client[_0xc9a8('0xa')](_0x3b627b,_0x33308b)[_0xc9a8('0xb')](function(_0x187274){logger[_0xc9a8('0xc')](_0xc9a8('0xd'),_0xcc9db3,'request\x20sent');logger[_0xc9a8('0xe')](_0xc9a8('0xf'),_0xcc9db3,_0xc9a8('0x10'),JSON[_0xc9a8('0x11')](_0x187274));if(_0x187274[_0xc9a8('0x12')]){if(_0x187274[_0xc9a8('0x12')][_0xc9a8('0x13')]===0x1f4){logger[_0xc9a8('0x12')](_0xc9a8('0xd'),_0xcc9db3,_0x187274[_0xc9a8('0x12')]['message']);return _0x1bd5f8(_0x187274['error'][_0xc9a8('0x14')]);}logger[_0xc9a8('0x12')](_0xc9a8('0xd'),_0xcc9db3,_0x187274[_0xc9a8('0x12')][_0xc9a8('0x14')]);return _0x14a86a(_0x187274[_0xc9a8('0x12')][_0xc9a8('0x14')]);}else{logger[_0xc9a8('0xc')](_0xc9a8('0xd'),_0xcc9db3,_0xc9a8('0x10'));_0x14a86a(_0x187274[_0xc9a8('0x15')]['message']);}})['catch'](function(_0x24373b){logger[_0xc9a8('0x12')](_0xc9a8('0xd'),_0xcc9db3,_0x24373b);_0x1bd5f8(_0x24373b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 51df46c..3f689d2 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 _0x90b5=['/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x130369,_0x59b244){var _0x4ca8aa=function(_0xf057ee){while(--_0xf057ee){_0x130369['push'](_0x130369['shift']());}};_0x4ca8aa(++_0x59b244);}(_0x90b5,0x139));var _0x590b=function(_0x154980,_0x2710e5){_0x154980=_0x154980-0x0;var _0x55a463=_0x90b5[_0x154980];return _0x55a463;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./cmCustomField.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0xc')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0xe')](_0x590b('0xa'),auth[_0x590b('0x8')](),controller['update']);router[_0x590b('0xf')](_0x590b('0xa'),auth['isAuthenticated'](),controller[_0x590b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x82a7=['../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x656cb5,_0x2da9fd){var _0x62ee2a=function(_0x18a25c){while(--_0x18a25c){_0x656cb5['push'](_0x656cb5['shift']());}};_0x62ee2a(++_0x2da9fd);}(_0x82a7,0x1c4));var _0x782a=function(_0x2e6f19,_0x13ea60){_0x2e6f19=_0x2e6f19-0x0;var _0x54a84a=_0x82a7[_0x2e6f19];return _0x54a84a;};'use strict';var multer=require('multer');var util=require(_0x782a('0x0'));var path=require(_0x782a('0x1'));var timeout=require(_0x782a('0x2'));var express=require(_0x782a('0x3'));var router=express[_0x782a('0x4')]();var fs_extra=require(_0x782a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x782a('0x6'));var config=require(_0x782a('0x7'));var controller=require(_0x782a('0x8'));router[_0x782a('0x9')]('/',auth[_0x782a('0xa')](),controller[_0x782a('0xb')]);router[_0x782a('0x9')](_0x782a('0xc'),auth[_0x782a('0xa')](),controller['show']);router[_0x782a('0xd')]('/',auth['isAuthenticated'](),controller[_0x782a('0xe')]);router['put']('/:id',auth[_0x782a('0xa')](),controller['update']);router[_0x782a('0xf')](_0x782a('0xc'),auth['isAuthenticated'](),controller[_0x782a('0x10')]);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 2c8958e..262e4ae 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 _0x2b75=['contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x2cdb37,_0x9862be){var _0x1ac131=function(_0x448065){while(--_0x448065){_0x2cdb37['push'](_0x2cdb37['shift']());}};_0x1ac131(++_0x9862be);}(_0x2b75,0xa3));var _0x52b7=function(_0x3cbc00,_0x563224){_0x3cbc00=_0x3cbc00-0x0;var _0x45dfd1=_0x2b75[_0x3cbc00];return _0x45dfd1;};'use strict';var moment=require(_0x52b7('0x0'));var Sequelize=require(_0x52b7('0x1'));module['exports']={'phone':{'type':Sequelize[_0x52b7('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x52b7('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x52b7('0x4')],'defaultValue':moment()[_0x52b7('0x5')](_0x52b7('0x6'))},'countbusyretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x52b7('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x52b7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x52b7('0x4')]},'priority':{'type':Sequelize[_0x52b7('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x52b7('0x7')],'unique':_0x52b7('0x8')},'ListId':{'type':Sequelize[_0x52b7('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x52b7('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x52b7('0x8')},'CampaignId':{'type':Sequelize[_0x52b7('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x52b7('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3903=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0x3903,0x128));var _0x3390=function(_0x106a79,_0x5170a0){_0x106a79=_0x106a79-0x0;var _0x1ad295=_0x3903[_0x106a79];return _0x1ad295;};'use strict';var moment=require(_0x3390('0x0'));var Sequelize=require(_0x3390('0x1'));module[_0x3390('0x2')]={'phone':{'type':Sequelize[_0x3390('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3390('0x4')],'defaultValue':moment()[_0x3390('0x5')](_0x3390('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3390('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3390('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3390('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3390('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3390('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3390('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x3390('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x3390('0xa')},'CampaignId':{'type':Sequelize[_0x3390('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x3390('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3390('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3390('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3390('0x7')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index fe8f913..9b60f0e 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 _0x2fbb=['reject','save','update','then','destroy','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','include','findAll','rows','catch','params','keys','includeAll','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','state','statedesc','deleted','campaign','membername','UserId','user','format','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json'];(function(_0x1e731e,_0x25acd5){var _0x37ba4c=function(_0x59294d){while(--_0x59294d){_0x1e731e['push'](_0x1e731e['shift']());}};_0x37ba4c(++_0x25acd5);}(_0x2fbb,0x199));var _0xb2fb=function(_0x272766,_0x4b0f6e){_0x272766=_0x272766-0x0;var _0xfb961d=_0x2fbb[_0x272766];return _0xfb961d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2fb('0x0'));var zipdir=require(_0xb2fb('0x1'));var jsonpatch=require(_0xb2fb('0x2'));var rp=require(_0xb2fb('0x3'));var moment=require('moment');var BPromise=require(_0xb2fb('0x4'));var Mustache=require('mustache');var util=require(_0xb2fb('0x5'));var path=require(_0xb2fb('0x6'));var sox=require(_0xb2fb('0x7'));var csv=require('to-csv');var ejs=require(_0xb2fb('0x8'));var fs=require('fs');var fs_extra=require(_0xb2fb('0x9'));var _=require(_0xb2fb('0xa'));var squel=require('squel');var crypto=require(_0xb2fb('0xb'));var jsforce=require(_0xb2fb('0xc'));var deskjs=require(_0xb2fb('0xd'));var toCsv=require(_0xb2fb('0xe'));var querystring=require(_0xb2fb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb2fb('0x10'));var qs=require(_0xb2fb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb2fb('0x12'));var logger=require(_0xb2fb('0x13'))(_0xb2fb('0x14'));var utils=require(_0xb2fb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb2fb('0x16'))['db'];function respondWithStatusCode(_0x686f4c,_0x4d71e8){_0x4d71e8=_0x4d71e8||0xcc;return function(_0x265290){if(_0x265290){return _0x686f4c[_0xb2fb('0x17')](_0x4d71e8);}return _0x686f4c['status'](_0x4d71e8)[_0xb2fb('0x18')]();};}function respondWithResult(_0x4a0b86,_0x2901a1){_0x2901a1=_0x2901a1||0xc8;return function(_0x336b4f){if(_0x336b4f){return _0x4a0b86[_0xb2fb('0x19')](_0x2901a1)['json'](_0x336b4f);}};}function respondWithFilteredResult(_0x217184,_0x448d19){return function(_0xafa79){if(_0xafa79){var _0x5d5f60=typeof _0x448d19[_0xb2fb('0x1a')]===_0xb2fb('0x1b')&&typeof _0x448d19[_0xb2fb('0x1c')]===_0xb2fb('0x1b');var _0x15dda1=_0xafa79[_0xb2fb('0x1d')];var _0x3523c9=_0x5d5f60?0x0:_0x448d19[_0xb2fb('0x1a')];var _0x3b4b98=_0x5d5f60?_0xafa79['count']:_0x448d19[_0xb2fb('0x1a')]+_0x448d19[_0xb2fb('0x1c')];var _0x36f0df;if(_0x3b4b98>=_0x15dda1){_0x3b4b98=_0x15dda1;_0x36f0df=0xc8;}else{_0x36f0df=0xce;}_0x217184['status'](_0x36f0df);return _0x217184[_0xb2fb('0x1e')]('Content-Range',_0x3523c9+'-'+_0x3b4b98+'/'+_0x15dda1)[_0xb2fb('0x1f')](_0xafa79);}return null;};}function patchUpdates(_0x16e5a9){return function(_0x332c21){try{jsonpatch['apply'](_0x332c21,_0x16e5a9,!![]);}catch(_0x48d0cd){return BPromise[_0xb2fb('0x20')](_0x48d0cd);}return _0x332c21[_0xb2fb('0x21')]();};}function saveUpdates(_0x294771,_0x13454b){return function(_0x4c828b){if(_0x4c828b){return _0x4c828b[_0xb2fb('0x22')](_0x294771)[_0xb2fb('0x23')](function(_0x24348c){return _0x24348c;});}return null;};}function removeEntity(_0xe157d6,_0x25207a){return function(_0x201180){if(_0x201180){return _0x201180[_0xb2fb('0x24')]()[_0xb2fb('0x23')](function(){_0xe157d6[_0xb2fb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320285,_0xdec57b){return function(_0x44e096){if(!_0x44e096){_0x320285[_0xb2fb('0x17')](0x194);}return _0x44e096;};}function handleError(_0x111c34,_0x1293df){_0x1293df=_0x1293df||0x1f4;return function(_0x47c8e0){logger[_0xb2fb('0x25')](_0x47c8e0['stack']);if(_0x47c8e0[_0xb2fb('0x26')]){delete _0x47c8e0[_0xb2fb('0x26')];}_0x111c34[_0xb2fb('0x19')](_0x1293df)[_0xb2fb('0x27')](_0x47c8e0);};}exports[_0xb2fb('0x28')]=function(_0x4105fb,_0x45c233){var _0x19e1d7={},_0x294bf4={},_0x5a2bb2={'count':0x0,'rows':[]};var _0x1a93b5=_[_0xb2fb('0x29')](db[_0xb2fb('0x2a')][_0xb2fb('0x2b')],function(_0x903881){return{'name':_0x903881[_0xb2fb('0x2c')],'type':_0x903881['type'][_0xb2fb('0x2d')]};});_0x294bf4[_0xb2fb('0x2e')]=_[_0xb2fb('0x29')](_0x1a93b5,_0xb2fb('0x26'));_0x294bf4[_0xb2fb('0x2f')]=_['keys'](_0x4105fb['query']);_0x294bf4[_0xb2fb('0x30')]=_[_0xb2fb('0x31')](_0x294bf4[_0xb2fb('0x2e')],_0x294bf4[_0xb2fb('0x2f')]);_0x294bf4[_0xb2fb('0x30')]=_['concat'](_0x294bf4[_0xb2fb('0x30')],[_0xb2fb('0x32'),_0xb2fb('0x33'),_0xb2fb('0x34'),_0xb2fb('0x35'),_0xb2fb('0x36'),_0xb2fb('0x37'),_0xb2fb('0x38'),_0xb2fb('0x39'),_0xb2fb('0x3a'),_0xb2fb('0x3b'),_0xb2fb('0x3c'),_0xb2fb('0x3d'),'$notIn',_0xb2fb('0x3e'),'$notLike',_0xb2fb('0x3f'),'$notILike',_0xb2fb('0x3e'),'$overlap',_0xb2fb('0x40'),_0xb2fb('0x41'),_0xb2fb('0x42')]);_0x19e1d7[_0xb2fb('0x43')]=_[_0xb2fb('0x31')](_0x294bf4[_0xb2fb('0x2e')],qs[_0xb2fb('0x44')](_0x4105fb['query'][_0xb2fb('0x44')]));_0x19e1d7['attributes']=_0x19e1d7[_0xb2fb('0x43')][_0xb2fb('0x45')]?_0x19e1d7[_0xb2fb('0x43')]:_0x294bf4[_0xb2fb('0x2e')];if(!_0x4105fb[_0xb2fb('0x2f')]['hasOwnProperty'](_0xb2fb('0x46'))){_0x19e1d7[_0xb2fb('0x1c')]=qs[_0xb2fb('0x1c')](_0x4105fb[_0xb2fb('0x2f')][_0xb2fb('0x1c')]);_0x19e1d7[_0xb2fb('0x1a')]=qs[_0xb2fb('0x1a')](_0x4105fb['query'][_0xb2fb('0x1a')]);}_0x19e1d7[_0xb2fb('0x47')]=qs[_0xb2fb('0x48')](_0x4105fb[_0xb2fb('0x2f')][_0xb2fb('0x48')]);_0x19e1d7[_0xb2fb('0x49')]=qs[_0xb2fb('0x30')](_['pick'](_0x4105fb[_0xb2fb('0x2f')],_0x294bf4[_0xb2fb('0x30')]),_0x1a93b5);if(_0x4105fb['query']['filter']){_0x19e1d7['where']=_[_0xb2fb('0x4a')](_0x19e1d7[_0xb2fb('0x49')],{'$or':_[_0xb2fb('0x29')](_0x1a93b5,function(_0xb217a4){if(_0xb217a4[_0xb2fb('0x4b')]!==_0xb2fb('0x4c')){var _0x354154={};_0x354154[_0xb217a4[_0xb2fb('0x26')]]={'$like':'%'+_0x4105fb['query'][_0xb2fb('0x4d')]+'%'};return _0x354154;}})});}_0x19e1d7=_['merge']({},_0x19e1d7,_0x4105fb['options']);var _0x35befa={'where':_0x19e1d7[_0xb2fb('0x49')]};return db[_0xb2fb('0x2a')][_0xb2fb('0x1d')](_0x35befa)[_0xb2fb('0x23')](function(_0x3e764b){_0x5a2bb2[_0xb2fb('0x1d')]=_0x3e764b;if(_0x4105fb[_0xb2fb('0x2f')]['includeAll']){_0x19e1d7[_0xb2fb('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xb2fb('0x4f')](_0x19e1d7);})[_0xb2fb('0x23')](function(_0x3e8acf){_0x5a2bb2[_0xb2fb('0x50')]=_0x3e8acf;return _0x5a2bb2;})[_0xb2fb('0x23')](respondWithFilteredResult(_0x45c233,_0x19e1d7))[_0xb2fb('0x51')](handleError(_0x45c233,null));};exports['show']=function(_0x1aea59,_0x2b6450){var _0x23c80f={'raw':!![],'where':{'id':_0x1aea59[_0xb2fb('0x52')]['id']}},_0x1edccc={};_0x1edccc[_0xb2fb('0x2e')]=_['keys'](db[_0xb2fb('0x2a')][_0xb2fb('0x2b')]);_0x1edccc['query']=_[_0xb2fb('0x53')](_0x1aea59[_0xb2fb('0x2f')]);_0x1edccc[_0xb2fb('0x30')]=_['intersection'](_0x1edccc[_0xb2fb('0x2e')],_0x1edccc['query']);_0x23c80f[_0xb2fb('0x43')]=_[_0xb2fb('0x31')](_0x1edccc['model'],qs['fields'](_0x1aea59[_0xb2fb('0x2f')][_0xb2fb('0x44')]));_0x23c80f[_0xb2fb('0x43')]=_0x23c80f[_0xb2fb('0x43')][_0xb2fb('0x45')]?_0x23c80f['attributes']:_0x1edccc[_0xb2fb('0x2e')];if(_0x1aea59[_0xb2fb('0x2f')][_0xb2fb('0x54')]){_0x23c80f[_0xb2fb('0x4e')]=[{'all':!![]}];}_0x23c80f=_['merge']({},_0x23c80f,_0x1aea59[_0xb2fb('0x55')]);return db['CmHopper'][_0xb2fb('0x56')](_0x23c80f)[_0xb2fb('0x23')](handleEntityNotFound(_0x2b6450,null))[_0xb2fb('0x23')](respondWithResult(_0x2b6450,null))[_0xb2fb('0x51')](handleError(_0x2b6450,null));};exports[_0xb2fb('0x57')]=function(_0x2db70b,_0x3842bb){return db[_0xb2fb('0x2a')]['create'](_0x2db70b[_0xb2fb('0x58')],{})['then'](respondWithResult(_0x3842bb,0xc9))[_0xb2fb('0x51')](handleError(_0x3842bb,null));};exports[_0xb2fb('0x22')]=function(_0x5d96b6,_0x41b60b){if(_0x5d96b6[_0xb2fb('0x58')]['id']){delete _0x5d96b6[_0xb2fb('0x58')]['id'];}return db[_0xb2fb('0x2a')][_0xb2fb('0x56')]({'where':{'id':_0x5d96b6['params']['id']}})['then'](handleEntityNotFound(_0x41b60b,null))[_0xb2fb('0x23')](saveUpdates(_0x5d96b6[_0xb2fb('0x58')],null))[_0xb2fb('0x23')](respondWithResult(_0x41b60b,null))[_0xb2fb('0x51')](handleError(_0x41b60b,null));};exports[_0xb2fb('0x59')]=function(_0x2d7037,_0x1373ec){return db['CmHopper'][_0xb2fb('0x59')]()[_0xb2fb('0x23')](respondWithResult(_0x1373ec,null))['catch'](handleError(_0x1373ec,null));};exports['destroy']=function(_0x4d953b,_0x4b06d3){var _0x4c281d;return db[_0xb2fb('0x2a')]['find']({'where':{'id':_0x4d953b[_0xb2fb('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b06d3,null))[_0xb2fb('0x23')](function(_0x5897b8){if(_0x5897b8){return _0x5897b8[_0xb2fb('0x24')]()[_0xb2fb('0x23')](function(_0x2d33c6){return _0x2d33c6;});}})[_0xb2fb('0x23')](function(_0x24397d){_0x4c281d=_0x24397d;if(_0x24397d){if(_0x24397d[_0xb2fb('0x5a')]||_0x24397d[_0xb2fb('0x5b')]){return db[_0x24397d[_0xb2fb('0x5a')]?_0xb2fb('0x5c'):_0xb2fb('0x5d')]['find']({'where':{'id':_0x24397d[_0xb2fb('0x5a')]?_0x24397d[_0xb2fb('0x5a')]:_0x24397d['CampaignId']},'attributes':['id',_0xb2fb('0x26')],'raw':!![]});}}})[_0xb2fb('0x23')](function(_0x1bb1c3){var _0x4a007a={};if(_0x1bb1c3){_['merge'](_0x4a007a,_[_0xb2fb('0x5e')](_0x4c281d[_0xb2fb('0x5f')],['createdAt','updatedAt','id']));_0x4a007a[_0xb2fb('0x60')]=0x15;_0x4a007a[_0xb2fb('0x61')]=_0xb2fb('0x62');_0x4a007a[_0xb2fb('0x63')]=_0x1bb1c3[_0xb2fb('0x26')];_0x4a007a[_0xb2fb('0x64')]=_0x4d953b['user']['name'];_0x4a007a[_0xb2fb('0x65')]=_0x4d953b[_0xb2fb('0x66')]['id'];_0x4a007a[_0xb2fb('0x62')]=!![];_0x4a007a['deletedat']=moment()[_0xb2fb('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a007a['calleridnum']=_0x4c281d[_0xb2fb('0x68')];_0x4a007a[_0xb2fb('0x69')]=_0x4c281d['VoiceQueueId']?_0xb2fb('0x6a'):_0xb2fb('0x6b');return db[_0xb2fb('0x6c')][_0xb2fb('0x56')]({'where':{'id':_0x4a007a[_0xb2fb('0x6d')]},'attributes':[_0xb2fb('0x6e'),_0xb2fb('0x6f')]})[_0xb2fb('0x23')](function(_0x3a0bbf){if(!_[_0xb2fb('0x70')](_0x4b06d3)&&!_['isNil'](_0x3a0bbf[_0xb2fb('0x6e')])){_0x4a007a[_0xb2fb('0x71')]=_0x3a0bbf[_0xb2fb('0x6e')];if(!_[_0xb2fb('0x70')](_0x3a0bbf[_0xb2fb('0x6f')])){_0x4a007a[_0xb2fb('0x71')]+='\x20'+_0x3a0bbf[_0xb2fb('0x6f')];}}})['finally'](function(){return db[_0xb2fb('0x72')][_0xb2fb('0x57')](_0x4a007a);});}})[_0xb2fb('0x23')](function(){return _0x4b06d3[_0xb2fb('0x19')](0xcc)[_0xb2fb('0x18')]();})[_0xb2fb('0x51')](handleError(_0x4b06d3,null));};exports['getPreview']=function(_0x5f19e0,_0x4ec5a5,_0x210911){var _0x15bb6e=[];return db[_0xb2fb('0x6c')][_0xb2fb('0x59')]()['then'](function(_0x1e28b4){_0x15bb6e=_[_0xb2fb('0x53')](_0x1e28b4);return _0x5f19e0[_0xb2fb('0x66')][_0xb2fb('0x73')]({'where':{'type':_0xb2fb('0x74'),'dialActive':!![],'dialMethod':_0xb2fb('0x75')},'attributes':['id',_0xb2fb('0x76')],'raw':!![]});})[_0xb2fb('0x23')](function(_0x2aa8c2){if(_0x2aa8c2&&_0x2aa8c2[_0xb2fb('0x45')]){return db[_0xb2fb('0x77')][_0xb2fb('0x78')](function(_0x17542b){var _0x36af51={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb2fb('0x67')](_0xb2fb('0x79'))},'VoiceQueueId':{'$in':_[_0xb2fb('0x29')](_0x2aa8c2,'id')},'$or':[{'UserId':null},{'UserId':_0x5f19e0[_0xb2fb('0x66')]['id']}]};var _0x222811=[];if(_0x5f19e0[_0xb2fb('0x58')][_0xb2fb('0x7a')]&&_0x5f19e0['body'][_0xb2fb('0x7a')]===_0xb2fb('0x7b')){if(!_[_0xb2fb('0x7c')](_0x5f19e0[_0xb2fb('0x58')]['hopperIds'])){_0x36af51['id']={'$in':_0x5f19e0['body'][_0xb2fb('0x7d')]};}_0x222811=[[_0xb2fb('0x7e'),_0xb2fb('0x7f')],['scheduledAt',_0x2aa8c2[0x0]['dialOrderByScheduledAt']===_0xb2fb('0x7f')?_0xb2fb('0x80'):_0xb2fb('0x7f')],db[_0xb2fb('0x77')]['literal'](_0xb2fb('0x81')),['id',_0xb2fb('0x80')]];}else{if(!_[_0xb2fb('0x7c')](_0x5f19e0[_0xb2fb('0x58')]['hopperIds'])){_0x36af51['id']={'$notIn':_0x5f19e0[_0xb2fb('0x58')][_0xb2fb('0x7d')]};}_0x222811=[['priority',_0xb2fb('0x80')],[_0xb2fb('0x82'),_0x2aa8c2[0x0][_0xb2fb('0x76')]],db[_0xb2fb('0x77')][_0xb2fb('0x83')](_0xb2fb('0x84')),['id','ASC']];}return db[_0xb2fb('0x2a')][_0xb2fb('0x85')]({'attributes':['id',_0xb2fb('0x86')],'where':_0x36af51,'order':_0x222811,'transaction':_0x17542b,'lock':_0x17542b[_0xb2fb('0x87')][_0xb2fb('0x88')],'include':[{'model':db[_0xb2fb('0x6c')],'as':_0xb2fb('0x89'),'attributes':_0x15bb6e,'include':[{'model':db['CmCompany'],'as':_0xb2fb('0x8a'),'attributes':['id','name']}]},{'model':db[_0xb2fb('0x8b')],'as':_0xb2fb('0x8c'),'attributes':['id',_0xb2fb('0x26')]},{'model':db[_0xb2fb('0x5c')],'as':_0xb2fb('0x8d'),'attributes':['id',_0xb2fb('0x26'),_0xb2fb('0x8e')]}]})['then'](function(_0x5c7599){if(_0x5c7599){return _0x5c7599[_0xb2fb('0x22')]({'UserId':_0x5f19e0['user']['id']},{'transaction':_0x17542b});}});});}})[_0xb2fb('0x23')](handleEntityNotFound(_0x4ec5a5,null))['then'](respondWithResult(_0x4ec5a5,null))[_0xb2fb('0x51')](handleError(_0x4ec5a5,null));};exports[_0xb2fb('0x8f')]=function(_0xec6a0f,_0x57c7ae,_0x3ab9e3){return _0xec6a0f[_0xb2fb('0x66')][_0xb2fb('0x73')]({'where':{'type':_0xb2fb('0x74'),'dialActive':!![],'dialMethod':_0xb2fb('0x75')},'attributes':['id'],'raw':!![]})[_0xb2fb('0x23')](function(_0xe542a){if(_0xe542a&&_0xe542a[_0xb2fb('0x45')]){return db['CmHopper'][_0xb2fb('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb2fb('0x67')](_0xb2fb('0x79'))},'VoiceQueueId':{'$in':_[_0xb2fb('0x29')](_0xe542a,'id')},'$or':[{'UserId':null},{'UserId':_0xec6a0f[_0xb2fb('0x66')]['id']}]}});}return 0x0;})[_0xb2fb('0x23')](function(_0xc70938){if(!_['isNil'](_0xc70938)&&_[_0xb2fb('0x90')](_0xc70938)){return _0x57c7ae['status'](0xc8)[_0xb2fb('0x1f')]({'contacts':_0xc70938});}else{logger[_0xb2fb('0x25')](_0xb2fb('0x91'),_0xb2fb('0x8f'),0x194,_0xb2fb('0x92'));_0x57c7ae[_0xb2fb('0x17')](0x194);}})[_0xb2fb('0x51')](handleError(_0x57c7ae,null));}; \ No newline at end of file +var _0x36c1=['YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','user','getVoiceQueues','preview','dialOrderByScheduledAt','length','transaction','direction','isEmpty','scheduledAt','DESC','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','destroy','then','error','name','index','map','type','key','model','query','filters','intersection','$and','$lt','$lte','$ne','$not','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','attributes','nolimit','order','sort','filter','where','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','createdAt','state','campaign','membername','UserId','deleted','deletedat','format'];(function(_0x2fd350,_0x3a3d66){var _0x4752fc=function(_0x2b2b25){while(--_0x2b2b25){_0x2fd350['push'](_0x2fd350['shift']());}};_0x4752fc(++_0x3a3d66);}(_0x36c1,0x1c6));var _0x136c=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x36c1[_0x4812e0];return _0x252e0f;};'use strict';var emlformat=require(_0x136c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x136c('0x1'));var jsonpatch=require(_0x136c('0x2'));var rp=require(_0x136c('0x3'));var moment=require('moment');var BPromise=require(_0x136c('0x4'));var Mustache=require(_0x136c('0x5'));var util=require(_0x136c('0x6'));var path=require('path');var sox=require(_0x136c('0x7'));var csv=require(_0x136c('0x8'));var ejs=require(_0x136c('0x9'));var fs=require('fs');var fs_extra=require(_0x136c('0xa'));var _=require(_0x136c('0xb'));var squel=require(_0x136c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x136c('0xd'));var toCsv=require(_0x136c('0x8'));var querystring=require(_0x136c('0xe'));var Papa=require(_0x136c('0xf'));var Redis=require(_0x136c('0x10'));var authService=require(_0x136c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x136c('0x12'));var utils=require(_0x136c('0x13'));var config=require(_0x136c('0x14'));var licenseUtil=require(_0x136c('0x15'));var db=require(_0x136c('0x16'))['db'];function respondWithStatusCode(_0x4520f3,_0x35695c){_0x35695c=_0x35695c||0xcc;return function(_0x5010e7){if(_0x5010e7){return _0x4520f3[_0x136c('0x17')](_0x35695c);}return _0x4520f3[_0x136c('0x18')](_0x35695c)[_0x136c('0x19')]();};}function respondWithResult(_0xcc999f,_0x2d03d7){_0x2d03d7=_0x2d03d7||0xc8;return function(_0x2fd7c3){if(_0x2fd7c3){return _0xcc999f[_0x136c('0x18')](_0x2d03d7)[_0x136c('0x1a')](_0x2fd7c3);}};}function respondWithFilteredResult(_0x13845a,_0x2140a3){return function(_0x4beb9d){if(_0x4beb9d){var _0x361e85=typeof _0x2140a3[_0x136c('0x1b')]==='undefined'&&typeof _0x2140a3[_0x136c('0x1c')]===_0x136c('0x1d');var _0x31c5f3=_0x4beb9d[_0x136c('0x1e')];var _0x206619=_0x361e85?0x0:_0x2140a3[_0x136c('0x1b')];var _0x4bd168=_0x361e85?_0x4beb9d[_0x136c('0x1e')]:_0x2140a3['offset']+_0x2140a3['limit'];var _0x4ab527;if(_0x4bd168>=_0x31c5f3){_0x4bd168=_0x31c5f3;_0x4ab527=0xc8;}else{_0x4ab527=0xce;}_0x13845a[_0x136c('0x18')](_0x4ab527);return _0x13845a['set'](_0x136c('0x1f'),_0x206619+'-'+_0x4bd168+'/'+_0x31c5f3)[_0x136c('0x1a')](_0x4beb9d);}return null;};}function patchUpdates(_0x409e8b){return function(_0x2c3c55){try{jsonpatch['apply'](_0x2c3c55,_0x409e8b,!![]);}catch(_0x1f9d41){return BPromise[_0x136c('0x20')](_0x1f9d41);}return _0x2c3c55['save']();};}function saveUpdates(_0x296d36,_0x177855){return function(_0xa3e96b){if(_0xa3e96b){return _0xa3e96b[_0x136c('0x21')](_0x296d36)['then'](function(_0x4ceda2){return _0x4ceda2;});}return null;};}function removeEntity(_0x4503ed,_0x2a1f20){return function(_0x20d901){if(_0x20d901){return _0x20d901[_0x136c('0x22')]()[_0x136c('0x23')](function(){_0x4503ed[_0x136c('0x18')](0xcc)[_0x136c('0x19')]();});}};}function handleEntityNotFound(_0x100a77,_0x5ca327){return function(_0x15c2e8){if(!_0x15c2e8){_0x100a77[_0x136c('0x17')](0x194);}return _0x15c2e8;};}function handleError(_0x2c4994,_0x41d6ef){_0x41d6ef=_0x41d6ef||0x1f4;return function(_0x3cbf17){logger[_0x136c('0x24')](_0x3cbf17['stack']);if(_0x3cbf17[_0x136c('0x25')]){delete _0x3cbf17[_0x136c('0x25')];}_0x2c4994['status'](_0x41d6ef)['send'](_0x3cbf17);};}exports[_0x136c('0x26')]=function(_0x4755fd,_0x2464cb){var _0x3c9efe={},_0x5c3169={},_0x59b95b={'count':0x0,'rows':[]};var _0x405f4d=_[_0x136c('0x27')](db['CmHopper']['rawAttributes'],function(_0x2f4e8c){return{'name':_0x2f4e8c['fieldName'],'type':_0x2f4e8c[_0x136c('0x28')][_0x136c('0x29')]};});_0x5c3169[_0x136c('0x2a')]=_['map'](_0x405f4d,'name');_0x5c3169[_0x136c('0x2b')]=_['keys'](_0x4755fd[_0x136c('0x2b')]);_0x5c3169[_0x136c('0x2c')]=_[_0x136c('0x2d')](_0x5c3169[_0x136c('0x2a')],_0x5c3169[_0x136c('0x2b')]);_0x5c3169[_0x136c('0x2c')]=_['concat'](_0x5c3169[_0x136c('0x2c')],[_0x136c('0x2e'),'$or','$gt','$gte',_0x136c('0x2f'),_0x136c('0x30'),_0x136c('0x31'),'$eq',_0x136c('0x32'),'$between',_0x136c('0x33'),_0x136c('0x34'),_0x136c('0x35'),_0x136c('0x36'),'$notLike',_0x136c('0x37'),'$notILike',_0x136c('0x36'),_0x136c('0x38'),_0x136c('0x39'),_0x136c('0x3a'),_0x136c('0x3b')]);_0x3c9efe[_0x136c('0x3c')]=_[_0x136c('0x2d')](_0x5c3169[_0x136c('0x2a')],qs['fields'](_0x4755fd[_0x136c('0x2b')]['fields']));_0x3c9efe['attributes']=_0x3c9efe['attributes']['length']?_0x3c9efe[_0x136c('0x3c')]:_0x5c3169['model'];if(!_0x4755fd[_0x136c('0x2b')]['hasOwnProperty'](_0x136c('0x3d'))){_0x3c9efe[_0x136c('0x1c')]=qs['limit'](_0x4755fd[_0x136c('0x2b')][_0x136c('0x1c')]);_0x3c9efe[_0x136c('0x1b')]=qs['offset'](_0x4755fd['query'][_0x136c('0x1b')]);}_0x3c9efe[_0x136c('0x3e')]=qs[_0x136c('0x3f')](_0x4755fd[_0x136c('0x2b')][_0x136c('0x3f')]);_0x3c9efe['where']=qs[_0x136c('0x2c')](_['pick'](_0x4755fd[_0x136c('0x2b')],_0x5c3169[_0x136c('0x2c')]),_0x405f4d);if(_0x4755fd[_0x136c('0x2b')][_0x136c('0x40')]){_0x3c9efe[_0x136c('0x41')]=_[_0x136c('0x42')](_0x3c9efe[_0x136c('0x41')],{'$or':_['map'](_0x405f4d,function(_0x51f283){if(_0x51f283[_0x136c('0x28')]!=='VIRTUAL'){var _0x5f31ca={};_0x5f31ca[_0x51f283[_0x136c('0x25')]]={'$like':'%'+_0x4755fd['query'][_0x136c('0x40')]+'%'};return _0x5f31ca;}})});}_0x3c9efe=_['merge']({},_0x3c9efe,_0x4755fd[_0x136c('0x43')]);var _0x221b5f={'where':_0x3c9efe[_0x136c('0x41')]};return db[_0x136c('0x44')][_0x136c('0x1e')](_0x221b5f)[_0x136c('0x23')](function(_0x5d52ea){_0x59b95b[_0x136c('0x1e')]=_0x5d52ea;if(_0x4755fd[_0x136c('0x2b')][_0x136c('0x45')]){_0x3c9efe[_0x136c('0x46')]=[{'all':!![]}];}return db[_0x136c('0x44')][_0x136c('0x47')](_0x3c9efe);})[_0x136c('0x23')](function(_0x514479){_0x59b95b[_0x136c('0x48')]=_0x514479;return _0x59b95b;})[_0x136c('0x23')](respondWithFilteredResult(_0x2464cb,_0x3c9efe))[_0x136c('0x49')](handleError(_0x2464cb,null));};exports[_0x136c('0x4a')]=function(_0x12bddd,_0x4d5b2a){var _0x4dde3c={'raw':!![],'where':{'id':_0x12bddd['params']['id']}},_0x1dd6ba={};_0x1dd6ba['model']=_[_0x136c('0x4b')](db[_0x136c('0x44')][_0x136c('0x4c')]);_0x1dd6ba[_0x136c('0x2b')]=_[_0x136c('0x4b')](_0x12bddd[_0x136c('0x2b')]);_0x1dd6ba[_0x136c('0x2c')]=_['intersection'](_0x1dd6ba[_0x136c('0x2a')],_0x1dd6ba[_0x136c('0x2b')]);_0x4dde3c[_0x136c('0x3c')]=_[_0x136c('0x2d')](_0x1dd6ba[_0x136c('0x2a')],qs['fields'](_0x12bddd['query']['fields']));_0x4dde3c['attributes']=_0x4dde3c[_0x136c('0x3c')]['length']?_0x4dde3c[_0x136c('0x3c')]:_0x1dd6ba[_0x136c('0x2a')];if(_0x12bddd[_0x136c('0x2b')][_0x136c('0x45')]){_0x4dde3c[_0x136c('0x46')]=[{'all':!![]}];}_0x4dde3c=_[_0x136c('0x42')]({},_0x4dde3c,_0x12bddd['options']);return db[_0x136c('0x44')][_0x136c('0x4d')](_0x4dde3c)[_0x136c('0x23')](handleEntityNotFound(_0x4d5b2a,null))[_0x136c('0x23')](respondWithResult(_0x4d5b2a,null))['catch'](handleError(_0x4d5b2a,null));};exports[_0x136c('0x4e')]=function(_0x2c71ab,_0xe34e6f){return db[_0x136c('0x44')][_0x136c('0x4e')](_0x2c71ab['body'],{})[_0x136c('0x23')](respondWithResult(_0xe34e6f,0xc9))[_0x136c('0x49')](handleError(_0xe34e6f,null));};exports[_0x136c('0x21')]=function(_0x5e14c7,_0xb78ec7){if(_0x5e14c7[_0x136c('0x4f')]['id']){delete _0x5e14c7[_0x136c('0x4f')]['id'];}return db['CmHopper'][_0x136c('0x4d')]({'where':{'id':_0x5e14c7[_0x136c('0x50')]['id']}})[_0x136c('0x23')](handleEntityNotFound(_0xb78ec7,null))[_0x136c('0x23')](saveUpdates(_0x5e14c7['body'],null))[_0x136c('0x23')](respondWithResult(_0xb78ec7,null))[_0x136c('0x49')](handleError(_0xb78ec7,null));};exports[_0x136c('0x51')]=function(_0x51538d,_0x4e78a7){return db['CmHopper'][_0x136c('0x51')]()['then'](respondWithResult(_0x4e78a7,null))[_0x136c('0x49')](handleError(_0x4e78a7,null));};exports[_0x136c('0x22')]=function(_0x39ec84,_0x2de6c1){var _0x2fd1f1;return db['CmHopper'][_0x136c('0x4d')]({'where':{'id':_0x39ec84[_0x136c('0x50')]['id']}})[_0x136c('0x23')](handleEntityNotFound(_0x2de6c1,null))[_0x136c('0x23')](function(_0xd3c849){if(_0xd3c849){return _0xd3c849[_0x136c('0x22')]()[_0x136c('0x23')](function(_0x20dbd3){return _0x20dbd3;});}})['then'](function(_0x28b5d3){_0x2fd1f1=_0x28b5d3;if(_0x28b5d3){if(_0x28b5d3[_0x136c('0x52')]||_0x28b5d3[_0x136c('0x53')]){return db[_0x28b5d3[_0x136c('0x52')]?_0x136c('0x54'):'Campaign'][_0x136c('0x4d')]({'where':{'id':_0x28b5d3[_0x136c('0x52')]?_0x28b5d3[_0x136c('0x52')]:_0x28b5d3[_0x136c('0x53')]},'attributes':['id',_0x136c('0x25')],'raw':!![]});}}})[_0x136c('0x23')](function(_0x5d3963){var _0x398abd={};if(_0x5d3963){_[_0x136c('0x42')](_0x398abd,_[_0x136c('0x55')](_0x2fd1f1['dataValues'],[_0x136c('0x56'),'updatedAt','id']));_0x398abd[_0x136c('0x57')]=0x15;_0x398abd['statedesc']='deleted';_0x398abd[_0x136c('0x58')]=_0x5d3963[_0x136c('0x25')];_0x398abd[_0x136c('0x59')]=_0x39ec84['user'][_0x136c('0x25')];_0x398abd[_0x136c('0x5a')]=_0x39ec84['user']['id'];_0x398abd[_0x136c('0x5b')]=!![];_0x398abd[_0x136c('0x5c')]=moment()[_0x136c('0x5d')](_0x136c('0x5e'));_0x398abd[_0x136c('0x5f')]=_0x2fd1f1['phone'];_0x398abd[_0x136c('0x60')]=_0x2fd1f1[_0x136c('0x52')]?_0x136c('0x61'):_0x136c('0x62');return db[_0x136c('0x63')][_0x136c('0x4d')]({'where':{'id':_0x398abd[_0x136c('0x64')]},'attributes':[_0x136c('0x65'),_0x136c('0x66')]})['then'](function(_0xef3dea){if(!_[_0x136c('0x67')](_0x2de6c1)&&!_[_0x136c('0x67')](_0xef3dea['firstName'])){_0x398abd['calleridname']=_0xef3dea[_0x136c('0x65')];if(!_[_0x136c('0x67')](_0xef3dea['lastName'])){_0x398abd[_0x136c('0x68')]+='\x20'+_0xef3dea[_0x136c('0x66')];}}})[_0x136c('0x69')](function(){return db[_0x136c('0x6a')]['create'](_0x398abd);});}})[_0x136c('0x23')](function(){return _0x2de6c1[_0x136c('0x18')](0xcc)['end']();})[_0x136c('0x49')](handleError(_0x2de6c1,null));};exports[_0x136c('0x6b')]=function(_0x6e4c61,_0x5901aa,_0x5b9f9d){var _0x480081=[];return db[_0x136c('0x63')]['describe']()[_0x136c('0x23')](function(_0x1184ae){_0x480081=_[_0x136c('0x4b')](_0x1184ae);return _0x6e4c61[_0x136c('0x6c')][_0x136c('0x6d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x136c('0x6e')},'attributes':['id',_0x136c('0x6f')],'raw':!![]});})[_0x136c('0x23')](function(_0x36578f){if(_0x36578f&&_0x36578f[_0x136c('0x70')]){return db['sequelize'][_0x136c('0x71')](function(_0xa850c){var _0x36092f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x136c('0x5d')](_0x136c('0x5e'))},'VoiceQueueId':{'$in':_[_0x136c('0x27')](_0x36578f,'id')},'$or':[{'UserId':null},{'UserId':_0x6e4c61['user']['id']}]};var _0x49a100=[];if(_0x6e4c61[_0x136c('0x4f')]['direction']&&_0x6e4c61[_0x136c('0x4f')][_0x136c('0x72')]==='prev'){if(!_[_0x136c('0x73')](_0x6e4c61[_0x136c('0x4f')]['hopperIds'])){_0x36092f['id']={'$in':_0x6e4c61[_0x136c('0x4f')]['hopperIds']};}_0x49a100=[['priority','ASC'],[_0x136c('0x74'),_0x36578f[0x0][_0x136c('0x6f')]==='ASC'?_0x136c('0x75'):_0x136c('0x76')],db[_0x136c('0x77')][_0x136c('0x78')](_0x136c('0x79')),['id',_0x136c('0x75')]];}else{if(!_[_0x136c('0x73')](_0x6e4c61[_0x136c('0x4f')]['hopperIds'])){_0x36092f['id']={'$notIn':_0x6e4c61[_0x136c('0x4f')][_0x136c('0x7a')]};}_0x49a100=[[_0x136c('0x7b'),_0x136c('0x75')],[_0x136c('0x74'),_0x36578f[0x0][_0x136c('0x6f')]],db['sequelize'][_0x136c('0x78')](_0x136c('0x7c')),['id',_0x136c('0x76')]];}return db['CmHopper'][_0x136c('0x7d')]({'attributes':['id',_0x136c('0x7e')],'where':_0x36092f,'order':_0x49a100,'transaction':_0xa850c,'lock':_0xa850c['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x136c('0x7f'),'attributes':_0x480081,'include':[{'model':db[_0x136c('0x80')],'as':_0x136c('0x81'),'attributes':['id',_0x136c('0x25')]}]},{'model':db[_0x136c('0x82')],'as':'List','attributes':['id',_0x136c('0x25')]},{'model':db[_0x136c('0x54')],'as':_0x136c('0x83'),'attributes':['id','name',_0x136c('0x84')]}]})[_0x136c('0x23')](function(_0x15efd8){if(_0x15efd8){return _0x15efd8[_0x136c('0x21')]({'UserId':_0x6e4c61['user']['id']},{'transaction':_0xa850c});}});});}})[_0x136c('0x23')](handleEntityNotFound(_0x5901aa,null))['then'](respondWithResult(_0x5901aa,null))[_0x136c('0x49')](handleError(_0x5901aa,null));};exports[_0x136c('0x85')]=function(_0x1e9a78,_0xc60612,_0x8049e4){return _0x1e9a78[_0x136c('0x6c')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x136c('0x6e')},'attributes':['id'],'raw':!![]})[_0x136c('0x23')](function(_0x50c9a7){if(_0x50c9a7&&_0x50c9a7['length']){return db['CmHopper'][_0x136c('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x136c('0x5d')](_0x136c('0x5e'))},'VoiceQueueId':{'$in':_[_0x136c('0x27')](_0x50c9a7,'id')},'$or':[{'UserId':null},{'UserId':_0x1e9a78[_0x136c('0x6c')]['id']}]}});}return 0x0;})['then'](function(_0x3785b9){if(!_[_0x136c('0x67')](_0x3785b9)&&_[_0x136c('0x86')](_0x3785b9)){return _0xc60612['status'](0xc8)[_0x136c('0x1a')]({'contacts':_0x3785b9});}else{logger[_0x136c('0x24')](_0x136c('0x87'),'getOpenContacts',0x194,_0x136c('0x88'));_0xc60612[_0x136c('0x17')](0x194);}})[_0x136c('0x49')](handleError(_0xc60612,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 66d352d..3815d7f 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 _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0xe70618,_0x16cdac){var _0x4fe2b9=function(_0x4155a2){while(--_0x4155a2){_0xe70618['push'](_0xe70618['shift']());}};_0x4fe2b9(++_0x16cdac);}(_0xfcf0,0x138));var _0x0fcf=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xfcf0[_0x166d93];return _0xba708;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['define','CmHopper','cm_hopper','scheduledat','phone','priority','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x11759b,_0x41808e){var _0x5d42bc=function(_0x573fc4){while(--_0x573fc4){_0x11759b['push'](_0x11759b['shift']());}};_0x5d42bc(++_0x41808e);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x43b8ce,_0x5b7222){_0x43b8ce=_0x43b8ce-0x0;var _0x324f38=_0xdbf5[_0x43b8ce];return _0x324f38;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5dbf('0xc')]},{'name':'phone','fields':[_0x5dbf('0xd')]},{'name':_0x5dbf('0xe'),'fields':[_0x5dbf('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 5db2399..e04a4f1 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 _0xd9f9=['map','then','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','limit','destroy','GetContactDialer','CmContact','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','describe','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','include','model','attributes'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xd9f9,0x6c));var _0x9d9f=function(_0x3c3c47,_0x2ad7d5){_0x3c3c47=_0x3c3c47-0x0;var _0xc294c7=_0xd9f9[_0x3c3c47];return _0xc294c7;};'use strict';var _=require(_0x9d9f('0x0'));var util=require(_0x9d9f('0x1'));var moment=require(_0x9d9f('0x2'));var BPromise=require(_0x9d9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d9f('0x5'))('rpc');var config=require(_0x9d9f('0x6'));var jayson=require(_0x9d9f('0x7'));var client=jayson['client'][_0x9d9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x304ccb,_0x126455,_0x28315c){return new BPromise(function(_0x41bdec,_0x27f9d7){return client[_0x9d9f('0x9')](_0x304ccb,_0x28315c)['then'](function(_0x25a7fb){logger[_0x9d9f('0xa')](_0x9d9f('0xb'),_0x126455,_0x9d9f('0xc'));logger[_0x9d9f('0xd')](_0x9d9f('0xe'),_0x126455,_0x9d9f('0xc'),JSON[_0x9d9f('0xf')](_0x25a7fb));if(_0x25a7fb[_0x9d9f('0x10')]){if(_0x25a7fb[_0x9d9f('0x10')][_0x9d9f('0x11')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x126455,_0x25a7fb[_0x9d9f('0x10')]['message']);return _0x27f9d7(_0x25a7fb['error'][_0x9d9f('0x12')]);}logger[_0x9d9f('0x10')]('CmHopper,\x20%s,\x20%s',_0x126455,_0x25a7fb['error'][_0x9d9f('0x12')]);return _0x41bdec(_0x25a7fb[_0x9d9f('0x10')]['message']);}else{logger[_0x9d9f('0xa')](_0x9d9f('0xb'),_0x126455,_0x9d9f('0xc'));_0x41bdec(_0x25a7fb[_0x9d9f('0x13')][_0x9d9f('0x12')]);}})[_0x9d9f('0x14')](function(_0x2bfcab){logger[_0x9d9f('0x10')](_0x9d9f('0xb'),_0x126455,_0x2bfcab);_0x27f9d7(_0x2bfcab);});});}exports[_0x9d9f('0x15')]=function(_0x2b6ee7){var _0x521121=this;return new Promise(function(_0x2c94c7,_0x10deca){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'raw':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'where':_0x2b6ee7['options']?_0x2b6ee7['options'][_0x9d9f('0x1a')]||null:null,'attributes':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')]['attributes']||null:null,'limit':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')]['limit']||null:null,'include':_0x2b6ee7[_0x9d9f('0x18')]?_0x2b6ee7[_0x9d9f('0x18')][_0x9d9f('0x1b')]?_['map'](_0x2b6ee7[_0x9d9f('0x18')][_0x9d9f('0x1b')],function(_0x553c54){return{'model':db[_0x553c54[_0x9d9f('0x1c')]],'as':_0x553c54['as'],'attributes':_0x553c54[_0x9d9f('0x1d')],'include':_0x553c54[_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x553c54[_0x9d9f('0x1b')],function(_0x142850){return{'model':db[_0x142850[_0x9d9f('0x1c')]],'as':_0x142850['as'],'attributes':_0x142850['attributes'],'include':_0x142850['include']?_[_0x9d9f('0x1e')](_0x142850[_0x9d9f('0x1b')],function(_0x34da15){return{'model':db[_0x34da15[_0x9d9f('0x1c')]],'as':_0x34da15['as'],'attributes':_0x34da15['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x25ed5b){logger['info'](_0x9d9f('0x15'),_0x2b6ee7);logger['debug'](_0x9d9f('0x15'),_0x2b6ee7,JSON[_0x9d9f('0xf')](_0x25ed5b));_0x2c94c7(_0x25ed5b);})[_0x9d9f('0x14')](function(_0x5d5684){logger['error'](_0x9d9f('0x15'),_0x5d5684[_0x9d9f('0x12')],_0x2b6ee7);_0x10deca(_0x521121[_0x9d9f('0x10')](0x1f4,_0x5d5684[_0x9d9f('0x12')]));});});};exports[_0x9d9f('0x20')]=function(_0x43cd8c){var _0x5d280c=this;return new Promise(function(_0x1e1049,_0x3847a2){return db[_0x9d9f('0x16')]['find']({'raw':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options'][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'where':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options']['where']||null:null,'attributes':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options'][_0x9d9f('0x1d')]||null:null,'include':_0x43cd8c[_0x9d9f('0x18')]?_0x43cd8c['options'][_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x43cd8c[_0x9d9f('0x18')]['include'],function(_0x315b7a){return{'model':db[_0x315b7a['model']],'as':_0x315b7a['as'],'attributes':_0x315b7a[_0x9d9f('0x1d')],'include':_0x315b7a['include']?_[_0x9d9f('0x1e')](_0x315b7a['include'],function(_0x92c676){return{'model':db[_0x92c676[_0x9d9f('0x1c')]],'as':_0x92c676['as'],'attributes':_0x92c676[_0x9d9f('0x1d')],'include':_0x92c676[_0x9d9f('0x1b')]?_['map'](_0x92c676['include'],function(_0x549994){return{'model':db[_0x549994['model']],'as':_0x549994['as'],'attributes':_0x549994['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x364a40){logger[_0x9d9f('0xa')](_0x9d9f('0x20'),_0x43cd8c);logger[_0x9d9f('0xd')]('ShowCmHopper',_0x43cd8c,JSON['stringify'](_0x364a40));_0x1e1049(_0x364a40);})[_0x9d9f('0x14')](function(_0xafbf7c){logger[_0x9d9f('0x10')](_0x9d9f('0x20'),_0xafbf7c['message'],_0x43cd8c);_0x3847a2(_0x5d280c[_0x9d9f('0x10')](0x1f4,_0xafbf7c['message']));});});};exports[_0x9d9f('0x21')]=function(_0x30302b){var _0x51f8a1=this;return new Promise(function(_0xd214ab,_0xb171a5){return db[_0x9d9f('0x16')][_0x9d9f('0x22')](_0x30302b[_0x9d9f('0x23')],{'raw':_0x30302b[_0x9d9f('0x18')]?_0x30302b[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![]})[_0x9d9f('0x1f')](function(_0x39f596){logger['info'](_0x9d9f('0x21'),_0x30302b);logger[_0x9d9f('0xd')](_0x9d9f('0x21'),_0x30302b,JSON[_0x9d9f('0xf')](_0x39f596));_0xd214ab(_0x39f596);})[_0x9d9f('0x14')](function(_0xe2f221){logger[_0x9d9f('0x10')]('CreateCmHopper',_0xe2f221['message'],_0x30302b);_0xb171a5(_0x51f8a1[_0x9d9f('0x10')](0x1f4,_0xe2f221['message']));});});};exports[_0x9d9f('0x24')]=function(_0xec9e6d){var _0x29e587=this;return new Promise(function(_0x3e9997,_0x16d55b){return db['CmHopper'][_0x9d9f('0x25')](_0xec9e6d[_0x9d9f('0x23')],{'raw':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')]['attributes']||null:null,'limit':_0xec9e6d[_0x9d9f('0x18')]?_0xec9e6d[_0x9d9f('0x18')][_0x9d9f('0x26')]||null:null})[_0x9d9f('0x1f')](function(_0x4ddbb6){logger['info']('UpdateCmHopper',_0xec9e6d);logger[_0x9d9f('0xd')](_0x9d9f('0x24'),_0xec9e6d,JSON['stringify'](_0x4ddbb6));_0x3e9997(_0x4ddbb6);})[_0x9d9f('0x14')](function(_0x1a5fd4){logger[_0x9d9f('0x10')](_0x9d9f('0x24'),_0x1a5fd4[_0x9d9f('0x12')],_0xec9e6d);_0x16d55b(_0x29e587[_0x9d9f('0x10')](0x1f4,_0x1a5fd4[_0x9d9f('0x12')]));});});};exports['DestroyCmHopper']=function(_0x4f5c98){var _0x5bf1f2=this;return new Promise(function(_0x31fce1,_0xe938b){return db[_0x9d9f('0x16')][_0x9d9f('0x27')]({'where':_0x4f5c98[_0x9d9f('0x18')]?_0x4f5c98['options'][_0x9d9f('0x1a')]||null:null})['then'](function(_0x2aeb61){logger[_0x9d9f('0xa')]('DestroyCmHopper',_0x4f5c98);logger[_0x9d9f('0xd')]('DestroyCmHopper',_0x4f5c98,JSON[_0x9d9f('0xf')](_0x2aeb61));_0x31fce1(_0x2aeb61);})[_0x9d9f('0x14')](function(_0x42a6ed){logger[_0x9d9f('0x10')]('DestroyCmHopper',_0x42a6ed[_0x9d9f('0x12')],_0x4f5c98);_0xe938b(_0x5bf1f2[_0x9d9f('0x10')](0x1f4,_0x42a6ed['message']));});});};exports[_0x9d9f('0x28')]=function(_0x326150){var _0x303c8a=this;return new Promise(function(_0x3e3ec9,_0x11fe64){return db[_0x9d9f('0x29')]['describe']()['then'](function(_0x3bcc2f){return db[_0x9d9f('0x2a')][_0x9d9f('0x2b')](function(_0x350e1e){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'where':_0x326150['options']?_0x326150[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':_0x326150[_0x9d9f('0x18')]?_0x326150[_0x9d9f('0x18')][_0x9d9f('0x1d')]||null:null,'limit':_0x326150['options']?_0x326150[_0x9d9f('0x18')]['limit']||null:null,'order':_0x326150['options']?_0x326150['options'][_0x9d9f('0x2c')]||null:null,'transaction':_0x350e1e,'lock':_0x350e1e[_0x9d9f('0x2d')][_0x9d9f('0x2e')],'include':[{'model':db[_0x9d9f('0x29')],'as':_0x9d9f('0x2f'),'attributes':_[_0x9d9f('0x30')](_0x3bcc2f)},{'model':db[_0x9d9f('0x31')],'as':_0x9d9f('0x32'),'attributes':['id',_0x9d9f('0x33'),_0x9d9f('0x34')]}]})[_0x9d9f('0x1f')](function(_0x26532a){var _0x22ade0=[];var _0x30c0c6=[];for(var _0x4bf395=0x0;_0x4bf395<_0x26532a[_0x9d9f('0x35')];_0x4bf395+=0x1){var _0x3b6fed=_0x26532a[_0x4bf395][_0x9d9f('0x36')];if(_0x3b6fed===null){_0x22ade0[_0x9d9f('0x37')](_0x26532a[_0x4bf395][_0x9d9f('0x25')](_0x326150[_0x9d9f('0x23')],{'transaction':_0x350e1e}));}else if(!_0x30c0c6[_0x9d9f('0x38')](_0x3b6fed)){_0x30c0c6[_0x9d9f('0x37')](_0x3b6fed);_0x22ade0[_0x9d9f('0x37')](_0x26532a[_0x4bf395][_0x9d9f('0x25')](_0x326150[_0x9d9f('0x23')],{'transaction':_0x350e1e}));}}return BPromise[_0x9d9f('0x39')](_0x22ade0);});})['then'](function(_0x54ef2b){logger['info'](_0x9d9f('0x28'),_0x326150);logger[_0x9d9f('0xd')]('GetContactDialer',_0x326150,JSON[_0x9d9f('0xf')](_0x54ef2b));_0x3e3ec9(_0x54ef2b);})[_0x9d9f('0x14')](function(_0x24e2b8){logger[_0x9d9f('0x10')](_0x9d9f('0x28'),_0x24e2b8['message'],_0x326150);_0x11fe64(_0x303c8a[_0x9d9f('0x10')](0x1f4,_0x24e2b8[_0x9d9f('0x12')]));});});});};exports[_0x9d9f('0x3a')]=function(_0x21ebba){var _0x2b014c=this;return new Promise(function(_0x23ae71,_0x12dae9){return db[_0x9d9f('0x2a')][_0x9d9f('0x2b')](function(_0x153b62){return db['CmHopperFinal']['create'](_0x21ebba[_0x9d9f('0x23')],{'raw':_0x21ebba['options']?_0x21ebba[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'transaction':_0x153b62})[_0x9d9f('0x1f')](function(){return db[_0x9d9f('0x16')][_0x9d9f('0x27')]({'where':_0x21ebba['options']?_0x21ebba[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'transaction':_0x153b62});});})[_0x9d9f('0x1f')](function(_0x260ae2){logger[_0x9d9f('0xa')](_0x9d9f('0x3a'),_0x21ebba);logger['debug'](_0x9d9f('0x3a'),_0x21ebba,JSON[_0x9d9f('0xf')](_0x260ae2));_0x23ae71(_0x260ae2);})[_0x9d9f('0x14')](function(_0xe9edf7){logger[_0x9d9f('0x10')]('MoveContactManagedDialer',_0xe9edf7['message'],_0x21ebba);_0x12dae9(_0x2b014c[_0x9d9f('0x10')](0x1f4,_0xe9edf7[_0x9d9f('0x12')]));});});};exports['CountReScheduled']=function(_0x1edf68){var _0x44f3e7=this;return new Promise(function(_0x1552ad,_0x113db5){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'raw':_0x1edf68['options']?_0x1edf68[_0x9d9f('0x18')][_0x9d9f('0x19')]===undefined?!![]:![]:!![],'where':_0x1edf68[_0x9d9f('0x18')]?_0x1edf68[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':[[db[_0x9d9f('0x2a')]['fn'](_0x9d9f('0x3b'),db[_0x9d9f('0x2a')]['fn']('IF',db[_0x9d9f('0x2a')][_0x9d9f('0x3c')](_0x9d9f('0x3d')+util[_0x9d9f('0x3e')]('\x22%s\x22',moment()[_0x9d9f('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x9d9f('0x3f')))),_0x9d9f('0x40')]]})[_0x9d9f('0x1f')](function(_0x2ec436){logger[_0x9d9f('0xa')](_0x9d9f('0x41'),_0x1edf68);logger[_0x9d9f('0xd')](_0x9d9f('0x41'),_0x1edf68,JSON['stringify'](_0x2ec436));_0x1552ad(_0x2ec436);})['catch'](function(_0xa8d96a){logger[_0x9d9f('0x10')](_0x9d9f('0x41'),_0xa8d96a[_0x9d9f('0x12')],_0x1edf68);_0x113db5(_0x44f3e7['error'](0x1f4,_0xa8d96a[_0x9d9f('0x12')]));});});};exports[_0x9d9f('0x42')]=function(_0x1c1855){var _0x1655ca=this;return new Promise(function(_0x12fcef,_0x85b47e){return db[_0x9d9f('0x29')]['describe']()[_0x9d9f('0x1f')](function(_0x2439f9){return db[_0x9d9f('0x2a')][_0x9d9f('0x2b')](function(_0x31478e){return db['CmHopper'][_0x9d9f('0x17')]({'where':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855['options'][_0x9d9f('0x1a')]||null:null,'attributes':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855['options'][_0x9d9f('0x1d')]||null:null,'limit':0x1,'order':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855[_0x9d9f('0x18')][_0x9d9f('0x2c')]||null:null,'group':db[_0x9d9f('0x16')][_0x9d9f('0x36')],'transaction':_0x31478e,'lock':_0x31478e[_0x9d9f('0x2d')]['UPDATE'],'include':_0x1c1855[_0x9d9f('0x18')]?_0x1c1855[_0x9d9f('0x18')]['include']?_[_0x9d9f('0x1e')](_0x1c1855[_0x9d9f('0x18')]['include'],function(_0x9dfd3d){return{'model':db[_0x9dfd3d[_0x9d9f('0x1c')]],'as':_0x9dfd3d['as'],'attributes':_0x9dfd3d[_0x9d9f('0x1d')],'include':_0x9dfd3d[_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x9dfd3d[_0x9d9f('0x1b')],function(_0x4766f0){return{'model':db[_0x4766f0['model']],'as':_0x4766f0['as'],'attributes':_0x4766f0[_0x9d9f('0x1d')],'include':_0x4766f0['include']?_[_0x9d9f('0x1e')](_0x4766f0[_0x9d9f('0x1b')],function(_0x2951e8){return{'model':db[_0x2951e8[_0x9d9f('0x1c')]],'as':_0x2951e8['as'],'attributes':_0x2951e8[_0x9d9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x3f3905){var _0x14186b=[];for(var _0x492d5a=0x0;_0x492d5a<_0x3f3905[_0x9d9f('0x35')];_0x492d5a+=0x1){_0x14186b[_0x9d9f('0x37')](_0x3f3905[_0x492d5a][_0x9d9f('0x25')](_0x1c1855[_0x9d9f('0x23')],{'transaction':_0x31478e}));}return BPromise['all'](_0x14186b);});})[_0x9d9f('0x1f')](function(_0x49a7bd){logger['info'](_0x9d9f('0x42'),_0x1c1855);logger[_0x9d9f('0xd')](_0x9d9f('0x42'),_0x1c1855,JSON[_0x9d9f('0xf')](_0x49a7bd));_0x12fcef(_0x49a7bd);})[_0x9d9f('0x14')](function(_0x1086c5){logger[_0x9d9f('0x10')](_0x9d9f('0x42'),_0x1086c5['message'],_0x1c1855);_0x85b47e(_0x1655ca['error'](0x1f4,_0x1086c5[_0x9d9f('0x12')]));});});});};exports[_0x9d9f('0x43')]=function(_0x544137){var _0x38752a=this;return new Promise(function(_0x25d1ca,_0x276348){db[_0x9d9f('0x29')][_0x9d9f('0x44')]()[_0x9d9f('0x1f')](function(_0x54e49d){return db[_0x9d9f('0x16')][_0x9d9f('0x17')]({'raw':_0x544137[_0x9d9f('0x18')]?_0x544137[_0x9d9f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x544137[_0x9d9f('0x18')]?_0x544137[_0x9d9f('0x18')][_0x9d9f('0x1a')]||null:null,'attributes':_0x544137['options']?_0x544137[_0x9d9f('0x18')][_0x9d9f('0x1d')]||null:null,'limit':_0x544137[_0x9d9f('0x18')]?_0x544137[_0x9d9f('0x18')][_0x9d9f('0x26')]||null:null,'include':_0x544137['options']?_0x544137[_0x9d9f('0x18')]['include']?_[_0x9d9f('0x1e')](_0x544137[_0x9d9f('0x18')][_0x9d9f('0x1b')],function(_0xa93aff){return{'model':db[_0xa93aff['model']],'as':_0xa93aff['as'],'attributes':_0xa93aff['as']===_0x9d9f('0x2f')?_[_0x9d9f('0x30')](_0x54e49d):_0xa93aff[_0x9d9f('0x1d')],'include':_0xa93aff[_0x9d9f('0x1b')]?_['map'](_0xa93aff[_0x9d9f('0x1b')],function(_0x393685){return{'model':db[_0x393685[_0x9d9f('0x1c')]],'as':_0x393685['as'],'attributes':_0x393685[_0x9d9f('0x1d')],'include':_0x393685[_0x9d9f('0x1b')]?_[_0x9d9f('0x1e')](_0x393685[_0x9d9f('0x1b')],function(_0x54cc7e){return{'model':db[_0x54cc7e[_0x9d9f('0x1c')]],'as':_0x54cc7e['as'],'attributes':_0x54cc7e[_0x9d9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9d9f('0x1f')](function(_0x584d2c){logger[_0x9d9f('0xa')]('GetCmHopper',_0x544137);logger[_0x9d9f('0xd')](_0x9d9f('0x15'),_0x544137,JSON[_0x9d9f('0xf')](_0x584d2c));_0x25d1ca(_0x584d2c);})['catch'](function(_0x18f8a8){logger['error']('GetCmHopper',_0x18f8a8[_0x9d9f('0x12')],_0x544137);_0x276348(_0x38752a[_0x9d9f('0x10')](0x1f4,_0x18f8a8[_0x9d9f('0x12')]));});});});}; \ No newline at end of file +var _0x32e6=['GetCmHopper','stringify','find','raw','where','ShowCmHopper','body','CreateCmHopper','update','UpdateCmHopper','DestroyCmHopper','destroy','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','keys','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer','CmHopperFinal','create','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopper','findAll','options','attributes','limit','include','map','model'];(function(_0x25c16e,_0xcb132c){var _0x5e804d=function(_0x288bc3){while(--_0x288bc3){_0x25c16e['push'](_0x25c16e['shift']());}};_0x5e804d(++_0xcb132c);}(_0x32e6,0xfc));var _0x632e=function(_0x1e85ee,_0x5c6579){_0x1e85ee=_0x1e85ee-0x0;var _0x3540bf=_0x32e6[_0x1e85ee];return _0x3540bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x632e('0x0'));var BPromise=require(_0x632e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x632e('0x2'));var db=require(_0x632e('0x3'))['db'];var utils=require(_0x632e('0x4'));var logger=require(_0x632e('0x5'))(_0x632e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x632e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f47d5,_0x6542c5,_0x5480bc){return new BPromise(function(_0x24476b,_0x552cb1){return client[_0x632e('0x8')](_0x1f47d5,_0x5480bc)[_0x632e('0x9')](function(_0x29b9a6){logger[_0x632e('0xa')](_0x632e('0xb'),_0x6542c5,_0x632e('0xc'));logger[_0x632e('0xd')](_0x632e('0xe'),_0x6542c5,_0x632e('0xc'),JSON['stringify'](_0x29b9a6));if(_0x29b9a6['error']){if(_0x29b9a6[_0x632e('0xf')][_0x632e('0x10')]===0x1f4){logger[_0x632e('0xf')](_0x632e('0xb'),_0x6542c5,_0x29b9a6[_0x632e('0xf')][_0x632e('0x11')]);return _0x552cb1(_0x29b9a6[_0x632e('0xf')]['message']);}logger['error'](_0x632e('0xb'),_0x6542c5,_0x29b9a6['error'][_0x632e('0x11')]);return _0x24476b(_0x29b9a6['error'][_0x632e('0x11')]);}else{logger[_0x632e('0xa')](_0x632e('0xb'),_0x6542c5,'request\x20sent');_0x24476b(_0x29b9a6[_0x632e('0x12')][_0x632e('0x11')]);}})[_0x632e('0x13')](function(_0x26cae1){logger[_0x632e('0xf')]('CmHopper,\x20%s,\x20%s',_0x6542c5,_0x26cae1);_0x552cb1(_0x26cae1);});});}exports['GetCmHopper']=function(_0x35422f){var _0x2e83db=this;return new Promise(function(_0x164dd9,_0x4a6d2a){return db[_0x632e('0x14')][_0x632e('0x15')]({'raw':_0x35422f[_0x632e('0x16')]?_0x35422f[_0x632e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x35422f[_0x632e('0x16')]?_0x35422f[_0x632e('0x16')]['where']||null:null,'attributes':_0x35422f[_0x632e('0x16')]?_0x35422f[_0x632e('0x16')][_0x632e('0x17')]||null:null,'limit':_0x35422f[_0x632e('0x16')]?_0x35422f[_0x632e('0x16')][_0x632e('0x18')]||null:null,'include':_0x35422f['options']?_0x35422f[_0x632e('0x16')][_0x632e('0x19')]?_[_0x632e('0x1a')](_0x35422f[_0x632e('0x16')][_0x632e('0x19')],function(_0x26badf){return{'model':db[_0x26badf['model']],'as':_0x26badf['as'],'attributes':_0x26badf['attributes'],'include':_0x26badf[_0x632e('0x19')]?_[_0x632e('0x1a')](_0x26badf['include'],function(_0x567a19){return{'model':db[_0x567a19[_0x632e('0x1b')]],'as':_0x567a19['as'],'attributes':_0x567a19[_0x632e('0x17')],'include':_0x567a19['include']?_['map'](_0x567a19['include'],function(_0x742588){return{'model':db[_0x742588[_0x632e('0x1b')]],'as':_0x742588['as'],'attributes':_0x742588['attributes']};}):[]};}):[]};}):[]:[]})[_0x632e('0x9')](function(_0x4ac674){logger[_0x632e('0xa')](_0x632e('0x1c'),_0x35422f);logger[_0x632e('0xd')](_0x632e('0x1c'),_0x35422f,JSON[_0x632e('0x1d')](_0x4ac674));_0x164dd9(_0x4ac674);})[_0x632e('0x13')](function(_0x4300f1){logger[_0x632e('0xf')](_0x632e('0x1c'),_0x4300f1[_0x632e('0x11')],_0x35422f);_0x4a6d2a(_0x2e83db[_0x632e('0xf')](0x1f4,_0x4300f1[_0x632e('0x11')]));});});};exports['ShowCmHopper']=function(_0x907b99){var _0x184844=this;return new Promise(function(_0x1703e2,_0x54ecf6){return db[_0x632e('0x14')][_0x632e('0x1e')]({'raw':_0x907b99[_0x632e('0x16')]?_0x907b99[_0x632e('0x16')][_0x632e('0x1f')]===undefined?!![]:![]:!![],'where':_0x907b99['options']?_0x907b99[_0x632e('0x16')][_0x632e('0x20')]||null:null,'attributes':_0x907b99[_0x632e('0x16')]?_0x907b99['options'][_0x632e('0x17')]||null:null,'include':_0x907b99[_0x632e('0x16')]?_0x907b99['options'][_0x632e('0x19')]?_['map'](_0x907b99[_0x632e('0x16')][_0x632e('0x19')],function(_0x449a1b){return{'model':db[_0x449a1b[_0x632e('0x1b')]],'as':_0x449a1b['as'],'attributes':_0x449a1b['attributes'],'include':_0x449a1b[_0x632e('0x19')]?_[_0x632e('0x1a')](_0x449a1b[_0x632e('0x19')],function(_0x86eb0f){return{'model':db[_0x86eb0f[_0x632e('0x1b')]],'as':_0x86eb0f['as'],'attributes':_0x86eb0f[_0x632e('0x17')],'include':_0x86eb0f[_0x632e('0x19')]?_[_0x632e('0x1a')](_0x86eb0f[_0x632e('0x19')],function(_0x3b2377){return{'model':db[_0x3b2377[_0x632e('0x1b')]],'as':_0x3b2377['as'],'attributes':_0x3b2377[_0x632e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x632e('0x9')](function(_0x55dee5){logger[_0x632e('0xa')](_0x632e('0x21'),_0x907b99);logger['debug']('ShowCmHopper',_0x907b99,JSON['stringify'](_0x55dee5));_0x1703e2(_0x55dee5);})[_0x632e('0x13')](function(_0x4d4525){logger[_0x632e('0xf')](_0x632e('0x21'),_0x4d4525['message'],_0x907b99);_0x54ecf6(_0x184844[_0x632e('0xf')](0x1f4,_0x4d4525[_0x632e('0x11')]));});});};exports['CreateCmHopper']=function(_0x5384a8){var _0x4cdd33=this;return new Promise(function(_0x31e5b7,_0x289091){return db['CmHopper']['create'](_0x5384a8[_0x632e('0x22')],{'raw':_0x5384a8['options']?_0x5384a8[_0x632e('0x16')][_0x632e('0x1f')]===undefined?!![]:![]:!![]})[_0x632e('0x9')](function(_0x47f1bd){logger[_0x632e('0xa')](_0x632e('0x23'),_0x5384a8);logger['debug'](_0x632e('0x23'),_0x5384a8,JSON['stringify'](_0x47f1bd));_0x31e5b7(_0x47f1bd);})['catch'](function(_0x48bbb2){logger[_0x632e('0xf')]('CreateCmHopper',_0x48bbb2[_0x632e('0x11')],_0x5384a8);_0x289091(_0x4cdd33[_0x632e('0xf')](0x1f4,_0x48bbb2[_0x632e('0x11')]));});});};exports['UpdateCmHopper']=function(_0xe054a2){var _0x40cd04=this;return new Promise(function(_0x315fde,_0xecdcee){return db['CmHopper'][_0x632e('0x24')](_0xe054a2[_0x632e('0x22')],{'raw':_0xe054a2[_0x632e('0x16')]?_0xe054a2['options'][_0x632e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe054a2[_0x632e('0x16')]?_0xe054a2[_0x632e('0x16')][_0x632e('0x20')]||null:null,'attributes':_0xe054a2[_0x632e('0x16')]?_0xe054a2['options'][_0x632e('0x17')]||null:null,'limit':_0xe054a2[_0x632e('0x16')]?_0xe054a2[_0x632e('0x16')]['limit']||null:null})[_0x632e('0x9')](function(_0x5c648c){logger['info'](_0x632e('0x25'),_0xe054a2);logger[_0x632e('0xd')](_0x632e('0x25'),_0xe054a2,JSON['stringify'](_0x5c648c));_0x315fde(_0x5c648c);})[_0x632e('0x13')](function(_0x2329ab){logger['error'](_0x632e('0x25'),_0x2329ab['message'],_0xe054a2);_0xecdcee(_0x40cd04['error'](0x1f4,_0x2329ab[_0x632e('0x11')]));});});};exports[_0x632e('0x26')]=function(_0xfec284){var _0xe6f4fd=this;return new Promise(function(_0x143c1f,_0xec8e7d){return db[_0x632e('0x14')][_0x632e('0x27')]({'where':_0xfec284[_0x632e('0x16')]?_0xfec284[_0x632e('0x16')]['where']||null:null})[_0x632e('0x9')](function(_0x340c09){logger[_0x632e('0xa')](_0x632e('0x26'),_0xfec284);logger[_0x632e('0xd')](_0x632e('0x26'),_0xfec284,JSON[_0x632e('0x1d')](_0x340c09));_0x143c1f(_0x340c09);})['catch'](function(_0x3abe41){logger[_0x632e('0xf')](_0x632e('0x26'),_0x3abe41[_0x632e('0x11')],_0xfec284);_0xec8e7d(_0xe6f4fd['error'](0x1f4,_0x3abe41['message']));});});};exports['GetContactDialer']=function(_0xfe6ded){var _0x599764=this;return new Promise(function(_0x1ebf17,_0x4bf384){return db['CmContact'][_0x632e('0x28')]()[_0x632e('0x9')](function(_0xab1a1e){return db[_0x632e('0x29')][_0x632e('0x2a')](function(_0x2fff30){return db[_0x632e('0x14')][_0x632e('0x15')]({'where':_0xfe6ded[_0x632e('0x16')]?_0xfe6ded[_0x632e('0x16')]['where']||null:null,'attributes':_0xfe6ded[_0x632e('0x16')]?_0xfe6ded[_0x632e('0x16')][_0x632e('0x17')]||null:null,'limit':_0xfe6ded['options']?_0xfe6ded[_0x632e('0x16')][_0x632e('0x18')]||null:null,'order':_0xfe6ded[_0x632e('0x16')]?_0xfe6ded[_0x632e('0x16')][_0x632e('0x2b')]||null:null,'transaction':_0x2fff30,'lock':_0x2fff30[_0x632e('0x2c')][_0x632e('0x2d')],'include':[{'model':db[_0x632e('0x2e')],'as':_0x632e('0x2f'),'attributes':_[_0x632e('0x30')](_0xab1a1e)},{'model':db['User'],'as':_0x632e('0x31'),'attributes':['id',_0x632e('0x32'),_0x632e('0x33')]}]})[_0x632e('0x9')](function(_0x423a68){var _0x57cd24=[];var _0x3bb8a5=[];for(var _0x2b8f5a=0x0;_0x2b8f5a<_0x423a68[_0x632e('0x34')];_0x2b8f5a+=0x1){var _0x183e4=_0x423a68[_0x2b8f5a][_0x632e('0x35')];if(_0x183e4===null){_0x57cd24[_0x632e('0x36')](_0x423a68[_0x2b8f5a][_0x632e('0x24')](_0xfe6ded[_0x632e('0x22')],{'transaction':_0x2fff30}));}else if(!_0x3bb8a5[_0x632e('0x37')](_0x183e4)){_0x3bb8a5[_0x632e('0x36')](_0x183e4);_0x57cd24[_0x632e('0x36')](_0x423a68[_0x2b8f5a][_0x632e('0x24')](_0xfe6ded['body'],{'transaction':_0x2fff30}));}}return BPromise[_0x632e('0x38')](_0x57cd24);});})[_0x632e('0x9')](function(_0x10a4f5){logger[_0x632e('0xa')](_0x632e('0x39'),_0xfe6ded);logger[_0x632e('0xd')](_0x632e('0x39'),_0xfe6ded,JSON[_0x632e('0x1d')](_0x10a4f5));_0x1ebf17(_0x10a4f5);})[_0x632e('0x13')](function(_0x23c265){logger[_0x632e('0xf')]('GetContactDialer',_0x23c265[_0x632e('0x11')],_0xfe6ded);_0x4bf384(_0x599764[_0x632e('0xf')](0x1f4,_0x23c265[_0x632e('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x210b22){var _0x46e067=this;return new Promise(function(_0x505e82,_0xc19fc5){return db['sequelize'][_0x632e('0x2a')](function(_0x538a7f){return db[_0x632e('0x3a')][_0x632e('0x3b')](_0x210b22[_0x632e('0x22')],{'raw':_0x210b22['options']?_0x210b22[_0x632e('0x16')][_0x632e('0x1f')]===undefined?!![]:![]:!![],'transaction':_0x538a7f})[_0x632e('0x9')](function(){return db[_0x632e('0x14')]['destroy']({'where':_0x210b22['options']?_0x210b22[_0x632e('0x16')][_0x632e('0x20')]||null:null,'transaction':_0x538a7f});});})[_0x632e('0x9')](function(_0x3ec8be){logger['info'](_0x632e('0x3c'),_0x210b22);logger['debug']('MoveContactManagedDialer',_0x210b22,JSON[_0x632e('0x1d')](_0x3ec8be));_0x505e82(_0x3ec8be);})[_0x632e('0x13')](function(_0x50580e){logger['error']('MoveContactManagedDialer',_0x50580e[_0x632e('0x11')],_0x210b22);_0xc19fc5(_0x46e067['error'](0x1f4,_0x50580e['message']));});});};exports['CountReScheduled']=function(_0x42d437){var _0x3aaef5=this;return new Promise(function(_0x1e1c60,_0x57eb00){return db[_0x632e('0x14')]['findAll']({'raw':_0x42d437[_0x632e('0x16')]?_0x42d437[_0x632e('0x16')][_0x632e('0x1f')]===undefined?!![]:![]:!![],'where':_0x42d437['options']?_0x42d437['options']['where']||null:null,'attributes':[[db[_0x632e('0x29')]['fn'](_0x632e('0x3d'),db[_0x632e('0x29')]['fn']('IF',db[_0x632e('0x29')][_0x632e('0x3e')](_0x632e('0x3f')+util[_0x632e('0x40')]('\x22%s\x22',moment()[_0x632e('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x632e('0x41')))),_0x632e('0x42')]]})[_0x632e('0x9')](function(_0x54c223){logger[_0x632e('0xa')](_0x632e('0x43'),_0x42d437);logger[_0x632e('0xd')](_0x632e('0x43'),_0x42d437,JSON[_0x632e('0x1d')](_0x54c223));_0x1e1c60(_0x54c223);})[_0x632e('0x13')](function(_0xf29aab){logger[_0x632e('0xf')](_0x632e('0x43'),_0xf29aab['message'],_0x42d437);_0x57eb00(_0x3aaef5[_0x632e('0xf')](0x1f4,_0xf29aab[_0x632e('0x11')]));});});};exports[_0x632e('0x44')]=function(_0x187dda){var _0x711447=this;return new Promise(function(_0x3f5533,_0x3f0804){return db[_0x632e('0x2e')][_0x632e('0x28')]()[_0x632e('0x9')](function(_0x409b5c){return db[_0x632e('0x29')][_0x632e('0x2a')](function(_0x319e76){return db[_0x632e('0x14')][_0x632e('0x15')]({'where':_0x187dda[_0x632e('0x16')]?_0x187dda['options'][_0x632e('0x20')]||null:null,'attributes':_0x187dda[_0x632e('0x16')]?_0x187dda[_0x632e('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x187dda[_0x632e('0x16')]?_0x187dda[_0x632e('0x16')][_0x632e('0x2b')]||null:null,'group':db['CmHopper'][_0x632e('0x35')],'transaction':_0x319e76,'lock':_0x319e76[_0x632e('0x2c')][_0x632e('0x2d')],'include':_0x187dda[_0x632e('0x16')]?_0x187dda[_0x632e('0x16')]['include']?_['map'](_0x187dda[_0x632e('0x16')][_0x632e('0x19')],function(_0x5dc6ce){return{'model':db[_0x5dc6ce['model']],'as':_0x5dc6ce['as'],'attributes':_0x5dc6ce[_0x632e('0x17')],'include':_0x5dc6ce[_0x632e('0x19')]?_[_0x632e('0x1a')](_0x5dc6ce[_0x632e('0x19')],function(_0x14d587){return{'model':db[_0x14d587[_0x632e('0x1b')]],'as':_0x14d587['as'],'attributes':_0x14d587['attributes'],'include':_0x14d587[_0x632e('0x19')]?_[_0x632e('0x1a')](_0x14d587[_0x632e('0x19')],function(_0x4b980b){return{'model':db[_0x4b980b[_0x632e('0x1b')]],'as':_0x4b980b['as'],'attributes':_0x4b980b['attributes']};}):[]};}):[]};}):[]:[]})[_0x632e('0x9')](function(_0x4709ef){var _0x487468=[];for(var _0x5cd616=0x0;_0x5cd616<_0x4709ef[_0x632e('0x34')];_0x5cd616+=0x1){_0x487468[_0x632e('0x36')](_0x4709ef[_0x5cd616][_0x632e('0x24')](_0x187dda['body'],{'transaction':_0x319e76}));}return BPromise['all'](_0x487468);});})['then'](function(_0x2f8043){logger[_0x632e('0xa')](_0x632e('0x44'),_0x187dda);logger[_0x632e('0xd')]('GetContactRecallMe',_0x187dda,JSON[_0x632e('0x1d')](_0x2f8043));_0x3f5533(_0x2f8043);})['catch'](function(_0x3881c0){logger[_0x632e('0xf')](_0x632e('0x44'),_0x3881c0[_0x632e('0x11')],_0x187dda);_0x3f0804(_0x711447['error'](0x1f4,_0x3881c0[_0x632e('0x11')]));});});});};exports[_0x632e('0x45')]=function(_0x23fcc4){var _0x3d16e1=this;return new Promise(function(_0x128df0,_0x5677d2){db['CmContact']['describe']()['then'](function(_0x412120){return db[_0x632e('0x14')][_0x632e('0x15')]({'raw':_0x23fcc4['options']?_0x23fcc4[_0x632e('0x16')][_0x632e('0x1f')]===undefined?!![]:![]:!![],'where':_0x23fcc4[_0x632e('0x16')]?_0x23fcc4[_0x632e('0x16')][_0x632e('0x20')]||null:null,'attributes':_0x23fcc4[_0x632e('0x16')]?_0x23fcc4[_0x632e('0x16')]['attributes']||null:null,'limit':_0x23fcc4['options']?_0x23fcc4['options'][_0x632e('0x18')]||null:null,'include':_0x23fcc4['options']?_0x23fcc4['options'][_0x632e('0x19')]?_[_0x632e('0x1a')](_0x23fcc4[_0x632e('0x16')][_0x632e('0x19')],function(_0x5ef689){return{'model':db[_0x5ef689['model']],'as':_0x5ef689['as'],'attributes':_0x5ef689['as']===_0x632e('0x2f')?_[_0x632e('0x30')](_0x412120):_0x5ef689['attributes'],'include':_0x5ef689['include']?_['map'](_0x5ef689[_0x632e('0x19')],function(_0x1716ed){return{'model':db[_0x1716ed[_0x632e('0x1b')]],'as':_0x1716ed['as'],'attributes':_0x1716ed[_0x632e('0x17')],'include':_0x1716ed[_0x632e('0x19')]?_[_0x632e('0x1a')](_0x1716ed[_0x632e('0x19')],function(_0x1cfc29){return{'model':db[_0x1cfc29[_0x632e('0x1b')]],'as':_0x1cfc29['as'],'attributes':_0x1cfc29[_0x632e('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x433d47){logger[_0x632e('0xa')](_0x632e('0x1c'),_0x23fcc4);logger[_0x632e('0xd')](_0x632e('0x1c'),_0x23fcc4,JSON[_0x632e('0x1d')](_0x433d47));_0x128df0(_0x433d47);})[_0x632e('0x13')](function(_0x258a01){logger['error'](_0x632e('0x1c'),_0x258a01[_0x632e('0x11')],_0x23fcc4);_0x5677d2(_0x3d16e1[_0x632e('0xf')](0x1f4,_0x258a01[_0x632e('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b359795..c54d161 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 _0x720e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/opencontacts','/:id','show','post','create','/preview','put','destroy','exports'];(function(_0x581454,_0x47b953){var _0x53d1e8=function(_0x36d6fc){while(--_0x36d6fc){_0x581454['push'](_0x581454['shift']());}};_0x53d1e8(++_0x47b953);}(_0x720e,0x18c));var _0xe720=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x720e[_0x211fef];return _0x5447bf;};'use strict';var multer=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var path=require(_0xe720('0x2'));var timeout=require(_0xe720('0x3'));var express=require(_0xe720('0x4'));var router=express[_0xe720('0x5')]();var fs_extra=require(_0xe720('0x6'));var auth=require(_0xe720('0x7'));var interaction=require(_0xe720('0x8'));var config=require(_0xe720('0x9'));var controller=require('./cmHopper.controller');router[_0xe720('0xa')]('/',auth[_0xe720('0xb')](),controller['index']);router[_0xe720('0xa')]('/describe',auth[_0xe720('0xb')](),controller[_0xe720('0xc')]);router[_0xe720('0xa')](_0xe720('0xd'),auth[_0xe720('0xb')](),controller['getOpenContacts']);router[_0xe720('0xa')](_0xe720('0xe'),auth[_0xe720('0xb')](),controller[_0xe720('0xf')]);router[_0xe720('0x10')]('/',auth['isAuthenticated'](),controller[_0xe720('0x11')]);router[_0xe720('0x10')](_0xe720('0x12'),auth[_0xe720('0xb')](),controller['getPreview']);router[_0xe720('0x13')](_0xe720('0xe'),auth[_0xe720('0xb')](),controller['update']);router['delete'](_0xe720('0xe'),auth[_0xe720('0xb')](),controller[_0xe720('0x14')]);module[_0xe720('0x15')]=router; \ No newline at end of file +var _0x9a9c=['/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','isAuthenticated','get','/describe','describe','/opencontacts','getOpenContacts','show','post','create','getPreview','delete'];(function(_0x4a7325,_0x4c3e07){var _0x55eebd=function(_0x53649c){while(--_0x53649c){_0x4a7325['push'](_0x4a7325['shift']());}};_0x55eebd(++_0x4c3e07);}(_0x9a9c,0x18f));var _0xc9a9=function(_0x9b7721,_0x36ef2f){_0x9b7721=_0x9b7721-0x0;var _0x2c92de=_0x9a9c[_0x9b7721];return _0x2c92de;};'use strict';var multer=require('multer');var util=require(_0xc9a9('0x0'));var path=require('path');var timeout=require(_0xc9a9('0x1'));var express=require(_0xc9a9('0x2'));var router=express[_0xc9a9('0x3')]();var fs_extra=require(_0xc9a9('0x4'));var auth=require(_0xc9a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9a9('0x6'));var controller=require(_0xc9a9('0x7'));router['get']('/',auth[_0xc9a9('0x8')](),controller['index']);router[_0xc9a9('0x9')](_0xc9a9('0xa'),auth[_0xc9a9('0x8')](),controller[_0xc9a9('0xb')]);router[_0xc9a9('0x9')](_0xc9a9('0xc'),auth['isAuthenticated'](),controller[_0xc9a9('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc9a9('0xe')]);router[_0xc9a9('0xf')]('/',auth[_0xc9a9('0x8')](),controller[_0xc9a9('0x10')]);router[_0xc9a9('0xf')]('/preview',auth[_0xc9a9('0x8')](),controller[_0xc9a9('0x11')]);router['put']('/:id',auth[_0xc9a9('0x8')](),controller['update']);router[_0xc9a9('0x12')](_0xc9a9('0x13'),auth['isAuthenticated'](),controller[_0xc9a9('0x14')]);module[_0xc9a9('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 835cc1a..cb4f541 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 _0x21f2=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x21f2,0x158));var _0x221f=function(_0x4fb64,_0x15df9f){_0x4fb64=_0x4fb64-0x0;var _0x2f9795=_0x21f2[_0x4fb64];return _0x2f9795;};'use strict';var moment=require('moment');var Sequelize=require(_0x221f('0x0'));module[_0x221f('0x1')]={'phone':{'type':Sequelize[_0x221f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x221f('0x3')],'unique':_0x221f('0x4')},'ListId':{'type':Sequelize[_0x221f('0x3')],'unique':_0x221f('0x4')},'VoiceQueueId':{'type':Sequelize[_0x221f('0x3')],'unique':_0x221f('0x4')}}; \ No newline at end of file +var _0xb9e0=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xb9e0,0x18c));var _0x0b9e=function(_0x2d9d5f,_0x3591bd){_0x2d9d5f=_0x2d9d5f-0x0;var _0x11174b=_0xb9e0[_0x2d9d5f];return _0x11174b;};'use strict';var moment=require(_0x0b9e('0x0'));var Sequelize=require(_0x0b9e('0x1'));module[_0x0b9e('0x2')]={'phone':{'type':Sequelize[_0x0b9e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0b9e('0x4')],'unique':_0x0b9e('0x5')},'ListId':{'type':Sequelize[_0x0b9e('0x4')],'unique':_0x0b9e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x0b9e('0x4')],'unique':_0x0b9e('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index bc6cca4..38dc1fa 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 _0x444e=['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','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','CmHopperBlack','include','rows','catch','rawAttributes','includeAll','options','find','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0x444e,0xd4));var _0xe444=function(_0xa6e4a3,_0x2999cd){_0xa6e4a3=_0xa6e4a3-0x0;var _0x392dc7=_0x444e[_0xa6e4a3];return _0x392dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe444('0x0'));var zipdir=require(_0xe444('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe444('0x2'));var moment=require(_0xe444('0x3'));var BPromise=require(_0xe444('0x4'));var Mustache=require(_0xe444('0x5'));var util=require(_0xe444('0x6'));var path=require(_0xe444('0x7'));var sox=require(_0xe444('0x8'));var csv=require(_0xe444('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe444('0xa'));var _=require(_0xe444('0xb'));var squel=require(_0xe444('0xc'));var crypto=require(_0xe444('0xd'));var jsforce=require(_0xe444('0xe'));var deskjs=require(_0xe444('0xf'));var toCsv=require(_0xe444('0x9'));var querystring=require('querystring');var Papa=require(_0xe444('0x10'));var Redis=require(_0xe444('0x11'));var authService=require(_0xe444('0x12'));var qs=require(_0xe444('0x13'));var as=require(_0xe444('0x14'));var hardwareService=require(_0xe444('0x15'));var logger=require('../../config/logger')(_0xe444('0x16'));var utils=require('../../config/utils');var config=require(_0xe444('0x17'));var licenseUtil=require(_0xe444('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d8a00,_0x544a39){_0x544a39=_0x544a39||0xcc;return function(_0xb5bd72){if(_0xb5bd72){return _0x4d8a00[_0xe444('0x19')](_0x544a39);}return _0x4d8a00[_0xe444('0x1a')](_0x544a39)[_0xe444('0x1b')]();};}function respondWithResult(_0x213a3a,_0x5a6e51){_0x5a6e51=_0x5a6e51||0xc8;return function(_0x47cbfb){if(_0x47cbfb){return _0x213a3a[_0xe444('0x1a')](_0x5a6e51)[_0xe444('0x1c')](_0x47cbfb);}};}function respondWithFilteredResult(_0x1242cc,_0xf790fb){return function(_0x4b0a8f){if(_0x4b0a8f){var _0xd65e1b=typeof _0xf790fb['offset']===_0xe444('0x1d')&&typeof _0xf790fb[_0xe444('0x1e')]===_0xe444('0x1d');var _0x124ea9=_0x4b0a8f[_0xe444('0x1f')];var _0x36b9a2=_0xd65e1b?0x0:_0xf790fb[_0xe444('0x20')];var _0x3b8c25=_0xd65e1b?_0x4b0a8f[_0xe444('0x1f')]:_0xf790fb[_0xe444('0x20')]+_0xf790fb[_0xe444('0x1e')];var _0x5b788d;if(_0x3b8c25>=_0x124ea9){_0x3b8c25=_0x124ea9;_0x5b788d=0xc8;}else{_0x5b788d=0xce;}_0x1242cc['status'](_0x5b788d);return _0x1242cc[_0xe444('0x21')](_0xe444('0x22'),_0x36b9a2+'-'+_0x3b8c25+'/'+_0x124ea9)['json'](_0x4b0a8f);}return null;};}function patchUpdates(_0x1022b6){return function(_0x49daeb){try{jsonpatch[_0xe444('0x23')](_0x49daeb,_0x1022b6,!![]);}catch(_0x308ac2){return BPromise['reject'](_0x308ac2);}return _0x49daeb[_0xe444('0x24')]();};}function saveUpdates(_0x3908d8,_0x4a86f8){return function(_0x24ad66){if(_0x24ad66){return _0x24ad66[_0xe444('0x25')](_0x3908d8)[_0xe444('0x26')](function(_0x4b920a){return _0x4b920a;});}return null;};}function removeEntity(_0xdf75bb,_0x4f152e){return function(_0xc4d0ac){if(_0xc4d0ac){return _0xc4d0ac['destroy']()[_0xe444('0x26')](function(){_0xdf75bb[_0xe444('0x1a')](0xcc)[_0xe444('0x1b')]();});}};}function handleEntityNotFound(_0x1df5f7,_0xdc84a8){return function(_0x4f2974){if(!_0x4f2974){_0x1df5f7['sendStatus'](0x194);}return _0x4f2974;};}function handleError(_0x2cf74b,_0x3c5359){_0x3c5359=_0x3c5359||0x1f4;return function(_0x514973){logger['error'](_0x514973[_0xe444('0x27')]);if(_0x514973[_0xe444('0x28')]){delete _0x514973[_0xe444('0x28')];}_0x2cf74b[_0xe444('0x1a')](_0x3c5359)[_0xe444('0x29')](_0x514973);};}exports[_0xe444('0x2a')]=function(_0x384933,_0x182849){var _0x3699fa={},_0x44a91a={},_0x2df4b6={'count':0x0,'rows':[]};var _0x79796f=_[_0xe444('0x2b')](db['CmHopperBlack']['rawAttributes'],function(_0x14aa5f){return{'name':_0x14aa5f[_0xe444('0x2c')],'type':_0x14aa5f[_0xe444('0x2d')][_0xe444('0x2e')]};});_0x44a91a[_0xe444('0x2f')]=_['map'](_0x79796f,'name');_0x44a91a[_0xe444('0x30')]=_[_0xe444('0x31')](_0x384933[_0xe444('0x30')]);_0x44a91a[_0xe444('0x32')]=_[_0xe444('0x33')](_0x44a91a[_0xe444('0x2f')],_0x44a91a[_0xe444('0x30')]);_0x3699fa[_0xe444('0x34')]=_[_0xe444('0x33')](_0x44a91a[_0xe444('0x2f')],qs['fields'](_0x384933[_0xe444('0x30')][_0xe444('0x35')]));_0x3699fa[_0xe444('0x34')]=_0x3699fa[_0xe444('0x34')][_0xe444('0x36')]?_0x3699fa['attributes']:_0x44a91a[_0xe444('0x2f')];if(!_0x384933['query'][_0xe444('0x37')](_0xe444('0x38'))){_0x3699fa[_0xe444('0x1e')]=qs[_0xe444('0x1e')](_0x384933['query'][_0xe444('0x1e')]);_0x3699fa[_0xe444('0x20')]=qs[_0xe444('0x20')](_0x384933[_0xe444('0x30')][_0xe444('0x20')]);}_0x3699fa[_0xe444('0x39')]=qs[_0xe444('0x3a')](_0x384933[_0xe444('0x30')][_0xe444('0x3a')]);_0x3699fa['where']=qs[_0xe444('0x32')](_['pick'](_0x384933['query'],_0x44a91a['filters']),_0x79796f);if(_0x384933['query'][_0xe444('0x3b')]){_0x3699fa[_0xe444('0x3c')]=_[_0xe444('0x3d')](_0x3699fa[_0xe444('0x3c')],{'$or':_['map'](_0x79796f,function(_0x4b1f29){if(_0x4b1f29[_0xe444('0x2d')]!=='VIRTUAL'){var _0x4c02d1={};_0x4c02d1[_0x4b1f29[_0xe444('0x28')]]={'$like':'%'+_0x384933[_0xe444('0x30')][_0xe444('0x3b')]+'%'};return _0x4c02d1;}})});}_0x3699fa=_[_0xe444('0x3d')]({},_0x3699fa,_0x384933['options']);var _0x419343={'where':_0x3699fa['where']};return db[_0xe444('0x3e')][_0xe444('0x1f')](_0x419343)[_0xe444('0x26')](function(_0x519f3e){_0x2df4b6[_0xe444('0x1f')]=_0x519f3e;if(_0x384933['query']['includeAll']){_0x3699fa[_0xe444('0x3f')]=[{'all':!![]}];}return db[_0xe444('0x3e')]['findAll'](_0x3699fa);})[_0xe444('0x26')](function(_0x315d73){_0x2df4b6[_0xe444('0x40')]=_0x315d73;return _0x2df4b6;})[_0xe444('0x26')](respondWithFilteredResult(_0x182849,_0x3699fa))[_0xe444('0x41')](handleError(_0x182849,null));};exports['show']=function(_0x5ae9fe,_0x569c41){var _0x2daa31={'raw':!![],'where':{'id':_0x5ae9fe['params']['id']}},_0x43bf11={};_0x43bf11[_0xe444('0x2f')]=_['keys'](db[_0xe444('0x3e')][_0xe444('0x42')]);_0x43bf11[_0xe444('0x30')]=_[_0xe444('0x31')](_0x5ae9fe['query']);_0x43bf11['filters']=_['intersection'](_0x43bf11[_0xe444('0x2f')],_0x43bf11['query']);_0x2daa31[_0xe444('0x34')]=_[_0xe444('0x33')](_0x43bf11[_0xe444('0x2f')],qs[_0xe444('0x35')](_0x5ae9fe[_0xe444('0x30')][_0xe444('0x35')]));_0x2daa31['attributes']=_0x2daa31[_0xe444('0x34')]['length']?_0x2daa31[_0xe444('0x34')]:_0x43bf11['model'];if(_0x5ae9fe[_0xe444('0x30')][_0xe444('0x43')]){_0x2daa31[_0xe444('0x3f')]=[{'all':!![]}];}_0x2daa31=_['merge']({},_0x2daa31,_0x5ae9fe[_0xe444('0x44')]);return db[_0xe444('0x3e')][_0xe444('0x45')](_0x2daa31)['then'](handleEntityNotFound(_0x569c41,null))[_0xe444('0x26')](respondWithResult(_0x569c41,null))[_0xe444('0x41')](handleError(_0x569c41,null));};exports['update']=function(_0x2790b7,_0x5de390){if(_0x2790b7[_0xe444('0x46')]['id']){delete _0x2790b7['body']['id'];}return db['CmHopperBlack'][_0xe444('0x45')]({'where':{'id':_0x2790b7['params']['id']}})[_0xe444('0x26')](handleEntityNotFound(_0x5de390,null))[_0xe444('0x26')](saveUpdates(_0x2790b7[_0xe444('0x46')],null))['then'](respondWithResult(_0x5de390,null))['catch'](handleError(_0x5de390,null));};exports[_0xe444('0x47')]=function(_0x1e9506,_0x542166){return db['CmHopperBlack'][_0xe444('0x45')]({'where':{'id':_0x1e9506['params']['id']}})[_0xe444('0x26')](handleEntityNotFound(_0x542166,null))[_0xe444('0x26')](removeEntity(_0x542166,null))['catch'](handleError(_0x542166,null));};exports[_0xe444('0x48')]=function(_0x3b3380,_0x2626cc){return db[_0xe444('0x3e')]['describe']()['then'](respondWithResult(_0x2626cc,null))[_0xe444('0x41')](handleError(_0x2626cc,null));}; \ No newline at end of file +var _0xe511=['index','CmHopperBlack','type','key','model','map','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','find','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x4af934,_0x592ea4){var _0x1fc3e3=function(_0x299081){while(--_0x299081){_0x4af934['push'](_0x4af934['shift']());}};_0x1fc3e3(++_0x592ea4);}(_0xe511,0x143));var _0x1e51=function(_0x58d40f,_0x18f78d){_0x58d40f=_0x58d40f-0x0;var _0x56572c=_0xe511[_0x58d40f];return _0x56572c;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require(_0x1e51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e51('0x3'));var moment=require(_0x1e51('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e51('0x5'));var util=require(_0x1e51('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1e51('0x7'));var ejs=require(_0x1e51('0x8'));var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require('lodash');var squel=require(_0x1e51('0xa'));var crypto=require(_0x1e51('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1e51('0xc'));var toCsv=require(_0x1e51('0x7'));var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1e51('0xf'));var as=require(_0x1e51('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e51('0x11'))(_0x1e51('0x12'));var utils=require(_0x1e51('0x13'));var config=require(_0x1e51('0x14'));var licenseUtil=require(_0x1e51('0x15'));var db=require(_0x1e51('0x16'))['db'];function respondWithStatusCode(_0xe4d4b3,_0x12c932){_0x12c932=_0x12c932||0xcc;return function(_0xaf4eb4){if(_0xaf4eb4){return _0xe4d4b3[_0x1e51('0x17')](_0x12c932);}return _0xe4d4b3[_0x1e51('0x18')](_0x12c932)[_0x1e51('0x19')]();};}function respondWithResult(_0x270cf8,_0x35884c){_0x35884c=_0x35884c||0xc8;return function(_0x17e478){if(_0x17e478){return _0x270cf8['status'](_0x35884c)[_0x1e51('0x1a')](_0x17e478);}};}function respondWithFilteredResult(_0x448589,_0x4cab59){return function(_0x595947){if(_0x595947){var _0xedbf9d=typeof _0x4cab59[_0x1e51('0x1b')]==='undefined'&&typeof _0x4cab59[_0x1e51('0x1c')]===_0x1e51('0x1d');var _0x46dd5f=_0x595947[_0x1e51('0x1e')];var _0xe5a87a=_0xedbf9d?0x0:_0x4cab59['offset'];var _0x4e9687=_0xedbf9d?_0x595947[_0x1e51('0x1e')]:_0x4cab59[_0x1e51('0x1b')]+_0x4cab59[_0x1e51('0x1c')];var _0x37b099;if(_0x4e9687>=_0x46dd5f){_0x4e9687=_0x46dd5f;_0x37b099=0xc8;}else{_0x37b099=0xce;}_0x448589[_0x1e51('0x18')](_0x37b099);return _0x448589[_0x1e51('0x1f')](_0x1e51('0x20'),_0xe5a87a+'-'+_0x4e9687+'/'+_0x46dd5f)[_0x1e51('0x1a')](_0x595947);}return null;};}function patchUpdates(_0xa51649){return function(_0x20ac4f){try{jsonpatch['apply'](_0x20ac4f,_0xa51649,!![]);}catch(_0x5f0728){return BPromise[_0x1e51('0x21')](_0x5f0728);}return _0x20ac4f[_0x1e51('0x22')]();};}function saveUpdates(_0x1273e7,_0x4a4748){return function(_0x275548){if(_0x275548){return _0x275548[_0x1e51('0x23')](_0x1273e7)[_0x1e51('0x24')](function(_0x49ad6d){return _0x49ad6d;});}return null;};}function removeEntity(_0x4113bf,_0x178d39){return function(_0x56d2c9){if(_0x56d2c9){return _0x56d2c9[_0x1e51('0x25')]()[_0x1e51('0x24')](function(){_0x4113bf[_0x1e51('0x18')](0xcc)[_0x1e51('0x19')]();});}};}function handleEntityNotFound(_0x1288a6,_0x3ffef7){return function(_0x3406e4){if(!_0x3406e4){_0x1288a6[_0x1e51('0x17')](0x194);}return _0x3406e4;};}function handleError(_0x5a53ce,_0x35f7b2){_0x35f7b2=_0x35f7b2||0x1f4;return function(_0x55ac7a){logger[_0x1e51('0x26')](_0x55ac7a[_0x1e51('0x27')]);if(_0x55ac7a[_0x1e51('0x28')]){delete _0x55ac7a[_0x1e51('0x28')];}_0x5a53ce['status'](_0x35f7b2)[_0x1e51('0x29')](_0x55ac7a);};}exports[_0x1e51('0x2a')]=function(_0x30c95a,_0x1f3f78){var _0x277e93={},_0x1f18a2={},_0x5b1b19={'count':0x0,'rows':[]};var _0x19a6c0=_['map'](db[_0x1e51('0x2b')]['rawAttributes'],function(_0x23e5a1){return{'name':_0x23e5a1['fieldName'],'type':_0x23e5a1[_0x1e51('0x2c')][_0x1e51('0x2d')]};});_0x1f18a2[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x19a6c0,_0x1e51('0x28'));_0x1f18a2['query']=_['keys'](_0x30c95a['query']);_0x1f18a2[_0x1e51('0x30')]=_[_0x1e51('0x31')](_0x1f18a2[_0x1e51('0x2e')],_0x1f18a2[_0x1e51('0x32')]);_0x277e93['attributes']=_[_0x1e51('0x31')](_0x1f18a2['model'],qs[_0x1e51('0x33')](_0x30c95a['query'][_0x1e51('0x33')]));_0x277e93['attributes']=_0x277e93[_0x1e51('0x34')][_0x1e51('0x35')]?_0x277e93['attributes']:_0x1f18a2[_0x1e51('0x2e')];if(!_0x30c95a['query']['hasOwnProperty'](_0x1e51('0x36'))){_0x277e93[_0x1e51('0x1c')]=qs['limit'](_0x30c95a[_0x1e51('0x32')][_0x1e51('0x1c')]);_0x277e93[_0x1e51('0x1b')]=qs[_0x1e51('0x1b')](_0x30c95a[_0x1e51('0x32')][_0x1e51('0x1b')]);}_0x277e93[_0x1e51('0x37')]=qs[_0x1e51('0x38')](_0x30c95a[_0x1e51('0x32')][_0x1e51('0x38')]);_0x277e93[_0x1e51('0x39')]=qs[_0x1e51('0x30')](_[_0x1e51('0x3a')](_0x30c95a[_0x1e51('0x32')],_0x1f18a2['filters']),_0x19a6c0);if(_0x30c95a['query']['filter']){_0x277e93['where']=_[_0x1e51('0x3b')](_0x277e93[_0x1e51('0x39')],{'$or':_['map'](_0x19a6c0,function(_0x36d958){if(_0x36d958[_0x1e51('0x2c')]!==_0x1e51('0x3c')){var _0x49e3b7={};_0x49e3b7[_0x36d958['name']]={'$like':'%'+_0x30c95a['query'][_0x1e51('0x3d')]+'%'};return _0x49e3b7;}})});}_0x277e93=_[_0x1e51('0x3b')]({},_0x277e93,_0x30c95a[_0x1e51('0x3e')]);var _0x10f481={'where':_0x277e93['where']};return db['CmHopperBlack'][_0x1e51('0x1e')](_0x10f481)[_0x1e51('0x24')](function(_0xcef07e){_0x5b1b19['count']=_0xcef07e;if(_0x30c95a[_0x1e51('0x32')][_0x1e51('0x3f')]){_0x277e93[_0x1e51('0x40')]=[{'all':!![]}];}return db[_0x1e51('0x2b')]['findAll'](_0x277e93);})[_0x1e51('0x24')](function(_0x5ea1c1){_0x5b1b19[_0x1e51('0x41')]=_0x5ea1c1;return _0x5b1b19;})[_0x1e51('0x24')](respondWithFilteredResult(_0x1f3f78,_0x277e93))[_0x1e51('0x42')](handleError(_0x1f3f78,null));};exports[_0x1e51('0x43')]=function(_0x27d2b4,_0x5c51e3){var _0x1d1c4a={'raw':!![],'where':{'id':_0x27d2b4['params']['id']}},_0x5b6f25={};_0x5b6f25[_0x1e51('0x2e')]=_[_0x1e51('0x44')](db[_0x1e51('0x2b')]['rawAttributes']);_0x5b6f25[_0x1e51('0x32')]=_[_0x1e51('0x44')](_0x27d2b4[_0x1e51('0x32')]);_0x5b6f25[_0x1e51('0x30')]=_[_0x1e51('0x31')](_0x5b6f25[_0x1e51('0x2e')],_0x5b6f25[_0x1e51('0x32')]);_0x1d1c4a[_0x1e51('0x34')]=_[_0x1e51('0x31')](_0x5b6f25[_0x1e51('0x2e')],qs[_0x1e51('0x33')](_0x27d2b4[_0x1e51('0x32')][_0x1e51('0x33')]));_0x1d1c4a[_0x1e51('0x34')]=_0x1d1c4a[_0x1e51('0x34')][_0x1e51('0x35')]?_0x1d1c4a['attributes']:_0x5b6f25[_0x1e51('0x2e')];if(_0x27d2b4[_0x1e51('0x32')][_0x1e51('0x3f')]){_0x1d1c4a['include']=[{'all':!![]}];}_0x1d1c4a=_[_0x1e51('0x3b')]({},_0x1d1c4a,_0x27d2b4[_0x1e51('0x3e')]);return db[_0x1e51('0x2b')][_0x1e51('0x45')](_0x1d1c4a)[_0x1e51('0x24')](handleEntityNotFound(_0x5c51e3,null))[_0x1e51('0x24')](respondWithResult(_0x5c51e3,null))[_0x1e51('0x42')](handleError(_0x5c51e3,null));};exports[_0x1e51('0x23')]=function(_0x5d70a2,_0x14e0b1){if(_0x5d70a2[_0x1e51('0x46')]['id']){delete _0x5d70a2[_0x1e51('0x46')]['id'];}return db[_0x1e51('0x2b')][_0x1e51('0x45')]({'where':{'id':_0x5d70a2[_0x1e51('0x47')]['id']}})[_0x1e51('0x24')](handleEntityNotFound(_0x14e0b1,null))[_0x1e51('0x24')](saveUpdates(_0x5d70a2[_0x1e51('0x46')],null))['then'](respondWithResult(_0x14e0b1,null))[_0x1e51('0x42')](handleError(_0x14e0b1,null));};exports[_0x1e51('0x25')]=function(_0x193c6b,_0x94237d){return db['CmHopperBlack'][_0x1e51('0x45')]({'where':{'id':_0x193c6b['params']['id']}})[_0x1e51('0x24')](handleEntityNotFound(_0x94237d,null))[_0x1e51('0x24')](removeEntity(_0x94237d,null))['catch'](handleError(_0x94237d,null));};exports[_0x1e51('0x48')]=function(_0x4d1b25,_0x2778f5){return db[_0x1e51('0x2b')][_0x1e51('0x48')]()[_0x1e51('0x24')](respondWithResult(_0x2778f5,null))[_0x1e51('0x42')](handleError(_0x2778f5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3cf8179..1186635 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 _0xb983=['rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5607e7,_0x24b29f){var _0xb9159c=function(_0x398e1a){while(--_0x398e1a){_0x5607e7['push'](_0x5607e7['shift']());}};_0xb9159c(++_0x24b29f);}(_0xb983,0xe3));var _0x3b98=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xb983[_0x421eeb];return _0x2c7371;};'use strict';var _=require('lodash');var util=require(_0x3b98('0x0'));var logger=require(_0x3b98('0x1'))(_0x3b98('0x2'));var moment=require(_0x3b98('0x3'));var BPromise=require(_0x3b98('0x4'));var rp=require(_0x3b98('0x5'));var fs=require('fs');var path=require(_0x3b98('0x6'));var rimraf=require(_0x3b98('0x7'));var config=require(_0x3b98('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x3b98('0x9')]=function(_0x7e8b31,_0x478e3d){return _0x7e8b31[_0x3b98('0xa')](_0x3b98('0xb'),attributes,{'tableName':_0x3b98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d6a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1d6a,0x18e));var _0xa1d6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1d6a[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xa1d6('0x0'));var util=require(_0xa1d6('0x1'));var logger=require(_0xa1d6('0x2'))(_0xa1d6('0x3'));var moment=require(_0xa1d6('0x4'));var BPromise=require(_0xa1d6('0x5'));var rp=require(_0xa1d6('0x6'));var fs=require('fs');var path=require(_0xa1d6('0x7'));var rimraf=require(_0xa1d6('0x8'));var config=require(_0xa1d6('0x9'));var attributes=require('./cmHopperBlack.attributes');module[_0xa1d6('0xa')]=function(_0xdc1c31,_0x2c5a82){return _0xdc1c31['define'](_0xa1d6('0xb'),attributes,{'tableName':_0xa1d6('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 3436afc..bc05137 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 _0x0a0f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird'];(function(_0x46f0cb,_0x245576){var _0x2ca080=function(_0x800d06){while(--_0x800d06){_0x46f0cb['push'](_0x46f0cb['shift']());}};_0x2ca080(++_0x245576);}(_0x0a0f,0x1c5));var _0xf0a0=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x0a0f[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0xf0a0('0x0'));var util=require(_0xf0a0('0x1'));var moment=require('moment');var BPromise=require(_0xf0a0('0x2'));var rs=require(_0xf0a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0a0('0x4'))['db'];var utils=require(_0xf0a0('0x5'));var logger=require(_0xf0a0('0x6'))(_0xf0a0('0x7'));var config=require(_0xf0a0('0x8'));var jayson=require(_0xf0a0('0x9'));var client=jayson['client'][_0xf0a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce96f,_0x45bd08,_0x30f3d8){return new BPromise(function(_0x8124c3,_0x3032ec){return client['request'](_0x5ce96f,_0x30f3d8)[_0xf0a0('0xb')](function(_0x1c4ee1){logger['info'](_0xf0a0('0xc'),_0x45bd08,'request\x20sent');logger[_0xf0a0('0xd')](_0xf0a0('0xe'),_0x45bd08,'request\x20sent',JSON[_0xf0a0('0xf')](_0x1c4ee1));if(_0x1c4ee1[_0xf0a0('0x10')]){if(_0x1c4ee1[_0xf0a0('0x10')][_0xf0a0('0x11')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x45bd08,_0x1c4ee1['error'][_0xf0a0('0x12')]);return _0x3032ec(_0x1c4ee1['error'][_0xf0a0('0x12')]);}logger['error'](_0xf0a0('0xc'),_0x45bd08,_0x1c4ee1[_0xf0a0('0x10')]['message']);return _0x8124c3(_0x1c4ee1[_0xf0a0('0x10')][_0xf0a0('0x12')]);}else{logger[_0xf0a0('0x13')](_0xf0a0('0xc'),_0x45bd08,'request\x20sent');_0x8124c3(_0x1c4ee1[_0xf0a0('0x14')]['message']);}})[_0xf0a0('0x15')](function(_0x1372ad){logger[_0xf0a0('0x10')](_0xf0a0('0xc'),_0x45bd08,_0x1372ad);_0x3032ec(_0x1372ad);});});}exports[_0xf0a0('0x16')]=function(_0x2eee71){var _0x143214=this;return new Promise(function(_0x59b8ff,_0xae62a0){return db[_0xf0a0('0x17')][_0xf0a0('0x18')]({'raw':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1b')]||null:null,'attributes':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71['options'][_0xf0a0('0x1c')]||null:null,'limit':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1d')]||null:null,'include':_0x2eee71[_0xf0a0('0x19')]?_0x2eee71['options']['include']?_[_0xf0a0('0x1e')](_0x2eee71[_0xf0a0('0x19')][_0xf0a0('0x1f')],function(_0x486293){return{'model':db[_0x486293[_0xf0a0('0x20')]],'as':_0x486293['as'],'attributes':_0x486293[_0xf0a0('0x1c')],'include':_0x486293[_0xf0a0('0x1f')]?_[_0xf0a0('0x1e')](_0x486293[_0xf0a0('0x1f')],function(_0x868513){return{'model':db[_0x868513[_0xf0a0('0x20')]],'as':_0x868513['as'],'attributes':_0x868513['attributes'],'include':_0x868513[_0xf0a0('0x1f')]?_[_0xf0a0('0x1e')](_0x868513[_0xf0a0('0x1f')],function(_0x821a00){return{'model':db[_0x821a00[_0xf0a0('0x20')]],'as':_0x821a00['as'],'attributes':_0x821a00['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0a0('0xb')](function(_0x5623b2){logger[_0xf0a0('0x13')](_0xf0a0('0x16'),_0x2eee71);logger['debug']('GetCmHopperBlack',_0x2eee71,JSON[_0xf0a0('0xf')](_0x5623b2));_0x59b8ff(_0x5623b2);})[_0xf0a0('0x15')](function(_0x38d1e7){logger['error'](_0xf0a0('0x16'),_0x38d1e7[_0xf0a0('0x12')],_0x2eee71);_0xae62a0(_0x143214[_0xf0a0('0x10')](0x1f4,_0x38d1e7['message']));});});};exports[_0xf0a0('0x21')]=function(_0x4b4ef1){var _0x3bada6=this;return new Promise(function(_0x3a8f93,_0x5b8914){return db[_0xf0a0('0x17')][_0xf0a0('0x22')](_0x4b4ef1[_0xf0a0('0x23')],{'raw':_0x4b4ef1[_0xf0a0('0x19')]?_0x4b4ef1[_0xf0a0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b4ef1[_0xf0a0('0x19')]?_0x4b4ef1[_0xf0a0('0x19')][_0xf0a0('0x1b')]||null:null,'attributes':_0x4b4ef1['options']?_0x4b4ef1[_0xf0a0('0x19')]['attributes']||null:null,'limit':_0x4b4ef1['options']?_0x4b4ef1[_0xf0a0('0x19')]['limit']||null:null})[_0xf0a0('0xb')](function(_0x4db39b){logger[_0xf0a0('0x13')](_0xf0a0('0x21'),_0x4b4ef1);logger['debug']('UpdateCmHopperBlack',_0x4b4ef1,JSON[_0xf0a0('0xf')](_0x4db39b));_0x3a8f93(_0x4db39b);})[_0xf0a0('0x15')](function(_0x553bb0){logger[_0xf0a0('0x10')]('UpdateCmHopperBlack',_0x553bb0[_0xf0a0('0x12')],_0x4b4ef1);_0x5b8914(_0x3bada6['error'](0x1f4,_0x553bb0[_0xf0a0('0x12')]));});});};exports[_0xf0a0('0x24')]=function(_0x51270f){var _0x5c5c3b=this;return new Promise(function(_0x1d8dda,_0x552dd3){return db[_0xf0a0('0x17')][_0xf0a0('0x25')]({'where':_0x51270f[_0xf0a0('0x19')]?_0x51270f['options']['where']||null:null})['then'](function(_0x229e1a){logger[_0xf0a0('0x13')](_0xf0a0('0x24'),_0x51270f);logger[_0xf0a0('0xd')](_0xf0a0('0x24'),_0x51270f,JSON[_0xf0a0('0xf')](_0x229e1a));_0x1d8dda(_0x229e1a);})['catch'](function(_0x2a0fd9){logger[_0xf0a0('0x10')](_0xf0a0('0x24'),_0x2a0fd9[_0xf0a0('0x12')],_0x51270f);_0x552dd3(_0x5c5c3b[_0xf0a0('0x10')](0x1f4,_0x2a0fd9[_0xf0a0('0x12')]));});});}; \ No newline at end of file +var _0xb76f=['request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','raw','stringify','CmHopperBlack','DestroyCmHopperBlack','lodash','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb76f,0x80));var _0xfb76=function(_0x22babc,_0x48adb0){_0x22babc=_0x22babc-0x0;var _0x980ce=_0xb76f[_0x22babc];return _0x980ce;};'use strict';var _=require(_0xfb76('0x0'));var util=require('util');var moment=require(_0xfb76('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb76('0x2'))['db'];var utils=require(_0xfb76('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb76('0x4'));var jayson=require(_0xfb76('0x5'));var client=jayson[_0xfb76('0x6')][_0xfb76('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x166ac2,_0x559027,_0x4fe51d){return new BPromise(function(_0x2130df,_0x19ebb6){return client[_0xfb76('0x8')](_0x166ac2,_0x4fe51d)[_0xfb76('0x9')](function(_0x21b9a4){logger[_0xfb76('0xa')](_0xfb76('0xb'),_0x559027,_0xfb76('0xc'));logger[_0xfb76('0xd')](_0xfb76('0xe'),_0x559027,_0xfb76('0xc'),JSON['stringify'](_0x21b9a4));if(_0x21b9a4[_0xfb76('0xf')]){if(_0x21b9a4[_0xfb76('0xf')]['code']===0x1f4){logger[_0xfb76('0xf')](_0xfb76('0xb'),_0x559027,_0x21b9a4[_0xfb76('0xf')][_0xfb76('0x10')]);return _0x19ebb6(_0x21b9a4[_0xfb76('0xf')][_0xfb76('0x10')]);}logger[_0xfb76('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x559027,_0x21b9a4[_0xfb76('0xf')][_0xfb76('0x10')]);return _0x2130df(_0x21b9a4[_0xfb76('0xf')][_0xfb76('0x10')]);}else{logger[_0xfb76('0xa')](_0xfb76('0xb'),_0x559027,_0xfb76('0xc'));_0x2130df(_0x21b9a4[_0xfb76('0x11')][_0xfb76('0x10')]);}})[_0xfb76('0x12')](function(_0xbf2088){logger[_0xfb76('0xf')](_0xfb76('0xb'),_0x559027,_0xbf2088);_0x19ebb6(_0xbf2088);});});}exports[_0xfb76('0x13')]=function(_0xa3f52c){var _0x1baa28=this;return new Promise(function(_0x43384f,_0x44e72c){return db['CmHopperBlack'][_0xfb76('0x14')]({'raw':_0xa3f52c[_0xfb76('0x15')]?_0xa3f52c['options']['raw']===undefined?!![]:![]:!![],'where':_0xa3f52c[_0xfb76('0x15')]?_0xa3f52c['options'][_0xfb76('0x16')]||null:null,'attributes':_0xa3f52c['options']?_0xa3f52c[_0xfb76('0x15')][_0xfb76('0x17')]||null:null,'limit':_0xa3f52c[_0xfb76('0x15')]?_0xa3f52c[_0xfb76('0x15')][_0xfb76('0x18')]||null:null,'include':_0xa3f52c[_0xfb76('0x15')]?_0xa3f52c['options'][_0xfb76('0x19')]?_[_0xfb76('0x1a')](_0xa3f52c['options'][_0xfb76('0x19')],function(_0x3d1de5){return{'model':db[_0x3d1de5[_0xfb76('0x1b')]],'as':_0x3d1de5['as'],'attributes':_0x3d1de5[_0xfb76('0x17')],'include':_0x3d1de5['include']?_[_0xfb76('0x1a')](_0x3d1de5['include'],function(_0x148db9){return{'model':db[_0x148db9[_0xfb76('0x1b')]],'as':_0x148db9['as'],'attributes':_0x148db9['attributes'],'include':_0x148db9[_0xfb76('0x19')]?_[_0xfb76('0x1a')](_0x148db9[_0xfb76('0x19')],function(_0x1214a2){return{'model':db[_0x1214a2[_0xfb76('0x1b')]],'as':_0x1214a2['as'],'attributes':_0x1214a2[_0xfb76('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfb76('0x9')](function(_0x234d7b){logger[_0xfb76('0xa')](_0xfb76('0x13'),_0xa3f52c);logger['debug']('GetCmHopperBlack',_0xa3f52c,JSON['stringify'](_0x234d7b));_0x43384f(_0x234d7b);})[_0xfb76('0x12')](function(_0x413b21){logger[_0xfb76('0xf')](_0xfb76('0x13'),_0x413b21[_0xfb76('0x10')],_0xa3f52c);_0x44e72c(_0x1baa28[_0xfb76('0xf')](0x1f4,_0x413b21[_0xfb76('0x10')]));});});};exports[_0xfb76('0x1c')]=function(_0x5f58b1){var _0xf22451=this;return new Promise(function(_0x58feeb,_0x2e122b){return db['CmHopperBlack'][_0xfb76('0x1d')](_0x5f58b1[_0xfb76('0x1e')],{'raw':_0x5f58b1[_0xfb76('0x15')]?_0x5f58b1['options'][_0xfb76('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f58b1[_0xfb76('0x15')]?_0x5f58b1[_0xfb76('0x15')][_0xfb76('0x16')]||null:null,'attributes':_0x5f58b1[_0xfb76('0x15')]?_0x5f58b1[_0xfb76('0x15')][_0xfb76('0x17')]||null:null,'limit':_0x5f58b1['options']?_0x5f58b1[_0xfb76('0x15')][_0xfb76('0x18')]||null:null})[_0xfb76('0x9')](function(_0x25ca86){logger[_0xfb76('0xa')](_0xfb76('0x1c'),_0x5f58b1);logger['debug'](_0xfb76('0x1c'),_0x5f58b1,JSON[_0xfb76('0x20')](_0x25ca86));_0x58feeb(_0x25ca86);})[_0xfb76('0x12')](function(_0x5b3c69){logger['error'](_0xfb76('0x1c'),_0x5b3c69[_0xfb76('0x10')],_0x5f58b1);_0x2e122b(_0xf22451[_0xfb76('0xf')](0x1f4,_0x5b3c69[_0xfb76('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x4e23cf){var _0x2dd78e=this;return new Promise(function(_0x15c0ce,_0xc844ab){return db[_0xfb76('0x21')]['destroy']({'where':_0x4e23cf['options']?_0x4e23cf[_0xfb76('0x15')][_0xfb76('0x16')]||null:null})[_0xfb76('0x9')](function(_0x26509c){logger['info'](_0xfb76('0x22'),_0x4e23cf);logger[_0xfb76('0xd')](_0xfb76('0x22'),_0x4e23cf,JSON['stringify'](_0x26509c));_0x15c0ce(_0x26509c);})[_0xfb76('0x12')](function(_0x529f33){logger['error']('DestroyCmHopperBlack',_0x529f33['message'],_0x4e23cf);_0xc844ab(_0x2dd78e[_0xfb76('0xf')](0x1f4,_0x529f33['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index c80faf4..04eac53 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 _0x741c=['get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x5cd6f3,_0x45ca37){var _0x503e72=function(_0x5bb5cf){while(--_0x5bb5cf){_0x5cd6f3['push'](_0x5cd6f3['shift']());}};_0x503e72(++_0x45ca37);}(_0x741c,0x196));var _0xc741=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x741c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['describe']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['put']('/:id',auth[_0xc741('0x9')](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xc'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);module[_0xc741('0x11')]=router; \ No newline at end of file +var _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','show','put','/:id','delete','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x32f4,0x154));var _0x432f=function(_0x535c7e,_0x43a005){_0x535c7e=_0x535c7e-0x0;var _0x567a3a=_0x32f4[_0x535c7e];return _0x567a3a;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0xd')](_0x432f('0xe'),auth[_0x432f('0xa')](),controller['update']);router[_0x432f('0xf')]('/:id',auth[_0x432f('0xa')](),controller['destroy']);module[_0x432f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index b805d9f..1e174c4 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 _0x03b1=['exports','INTEGER','STRING','DATE','endtime','followuptime','diff','setDataValue','BOOLEAN'];(function(_0x56aa3d,_0x113592){var _0xbc1524=function(_0x326105){while(--_0x326105){_0x56aa3d['push'](_0x56aa3d['shift']());}};_0xbc1524(++_0x113592);}(_0x03b1,0xbd));var _0x103b=function(_0x193ef7,_0x48d6c4){_0x193ef7=_0x193ef7-0x0;var _0x39284e=_0x03b1[_0x193ef7];return _0x39284e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x103b('0x0')]={'state':{'type':Sequelize[_0x103b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x103b('0x2')]},'scheduledat':{'type':Sequelize[_0x103b('0x3')]},'countbusyretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x103b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x103b('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x103b('0x3')]},'responsetime':{'type':Sequelize[_0x103b('0x3')]},'answertime':{'type':Sequelize[_0x103b('0x3')]},'droptime':{'type':Sequelize[_0x103b('0x3')]},'endtime':{'type':Sequelize[_0x103b('0x3')]},'ringtime':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x103b('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x103b('0x2')]},'reason':{'type':Sequelize[_0x103b('0x2')]},'disposition':{'type':Sequelize[_0x103b('0x2')]},'secondDisposition':{'type':Sequelize[_0x103b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x103b('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4059c3){var _0x28e08d=this['getDataValue'](_0x103b('0x4'));if(_0x28e08d&&_0x4059c3){this['setDataValue'](_0x103b('0x5'),moment(_0x4059c3)[_0x103b('0x6')](moment(_0x28e08d),'seconds'));}return this[_0x103b('0x7')]('dispositionat',_0x4059c3);}},'amd':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x103b('0x3')]},'callback':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x103b('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x103b('0x3')]},'recallme':{'type':Sequelize[_0x103b('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x103b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd194=['DATE','INTEGER','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports','STRING'];(function(_0x13dfac,_0xe5c2f){var _0x19f949=function(_0x4d9962){while(--_0x4d9962){_0x13dfac['push'](_0x13dfac['shift']());}};_0x19f949(++_0xe5c2f);}(_0xd194,0x1dc));var _0x4d19=function(_0x721b5e,_0x14811f){_0x721b5e=_0x721b5e-0x0;var _0x1acf42=_0xd194[_0x721b5e];return _0x1acf42;};'use strict';var Sequelize=require(_0x4d19('0x0'));var moment=require(_0x4d19('0x1'));module[_0x4d19('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x4d19('0x3')]},'scheduledat':{'type':Sequelize[_0x4d19('0x4')]},'countbusyretry':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4d19('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4d19('0x3')]},'calleridnum':{'type':Sequelize[_0x4d19('0x3')]},'calleridname':{'type':Sequelize[_0x4d19('0x3')]},'starttime':{'type':Sequelize[_0x4d19('0x4')]},'responsetime':{'type':Sequelize[_0x4d19('0x4')]},'answertime':{'type':Sequelize[_0x4d19('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4d19('0x3')]},'campaign':{'type':Sequelize[_0x4d19('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4d19('0x3')]},'reason':{'type':Sequelize[_0x4d19('0x3')]},'disposition':{'type':Sequelize[_0x4d19('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4d19('0x3')]},'dispositionat':{'type':Sequelize[_0x4d19('0x4')],'set':function(_0x4b07ce){var _0x3db421=this['getDataValue']('endtime');if(_0x3db421&&_0x4b07ce){this['setDataValue'](_0x4d19('0x6'),moment(_0x4b07ce)[_0x4d19('0x7')](moment(_0x3db421),_0x4d19('0x8')));}return this[_0x4d19('0x9')](_0x4d19('0xa'),_0x4b07ce);}},'amd':{'type':Sequelize[_0x4d19('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4d19('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x4d19('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x4d19('0x4')]},'callback':{'type':Sequelize[_0x4d19('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x4d19('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x4d19('0x4')]},'recallme':{'type':Sequelize[_0x4d19('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4d19('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4d19('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'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 15b2167..f4ffc34 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 _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5a8d43,_0x4cdd60){var _0x2e16fc=function(_0x55d036){while(--_0x55d036){_0x5a8d43['push'](_0x5a8d43['shift']());}};_0x2e16fc(++_0x4cdd60);}(_0x2a07,0x74));var _0x72a0=function(_0x4d399b,_0x3bd4a4){_0x4d399b=_0x4d399b-0x0;var _0x4435e5=_0x2a07[_0x4d399b];return _0x4435e5;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file +var _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x1e8639,_0x1a9fcf){var _0x220c8a=function(_0x55b21c){while(--_0x55b21c){_0x1e8639['push'](_0x1e8639['shift']());}};_0x220c8a(++_0x1a9fcf);}(_0x5fab,0x177));var _0xb5fa=function(_0x34217a,_0x1f545a){_0x34217a=_0x34217a-0x0;var _0x23c2be=_0x5fab[_0x34217a];return _0x23c2be;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 02f51e4..741515f 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 _0x7d96=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x3e27cd,_0x5e647f){var _0x2f2f41=function(_0x1a2ec3){while(--_0x1a2ec3){_0x3e27cd['push'](_0x3e27cd['shift']());}};_0x2f2f41(++_0x5e647f);}(_0x7d96,0x147));var _0x67d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7d96[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x67d9('0x0'));var util=require(_0x67d9('0x1'));var logger=require(_0x67d9('0x2'))('api');var moment=require(_0x67d9('0x3'));var BPromise=require(_0x67d9('0x4'));var rp=require(_0x67d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67d9('0x6'));var config=require(_0x67d9('0x7'));var attributes=require(_0x67d9('0x8'));module[_0x67d9('0x9')]=function(_0x2c07d2,_0x34b427){return _0x2c07d2[_0x67d9('0xa')](_0x67d9('0xb'),attributes,{'tableName':_0x67d9('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x67d9('0xd')]},{'name':_0x67d9('0xe'),'fields':[_0x67d9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc22=['lodash','../../config/logger','moment','request-promise','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x5b2d2f,_0x21fc54){var _0x54c1d8=function(_0x31749e){while(--_0x31749e){_0x5b2d2f['push'](_0x5b2d2f['shift']());}};_0x54c1d8(++_0x21fc54);}(_0xfc22,0x154));var _0x2fc2=function(_0x2a7bc7,_0x4aac55){_0x2a7bc7=_0x2a7bc7-0x0;var _0xffa2d5=_0xfc22[_0x2a7bc7];return _0xffa2d5;};'use strict';var _=require(_0x2fc2('0x0'));var util=require('util');var logger=require(_0x2fc2('0x1'))('api');var moment=require(_0x2fc2('0x2'));var BPromise=require('bluebird');var rp=require(_0x2fc2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2fc2('0x4'));var attributes=require(_0x2fc2('0x5'));module[_0x2fc2('0x6')]=function(_0x5892d2,_0x21bded){return _0x5892d2['define'](_0x2fc2('0x7'),attributes,{'tableName':_0x2fc2('0x8'),'paranoid':![],'indexes':[{'name':_0x2fc2('0x9'),'fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 9a219d5..6f58e94 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5135c3,_0x7b6e06){var _0x502650=function(_0x339f0a){while(--_0x339f0a){_0x5135c3['push'](_0x5135c3['shift']());}};_0x502650(++_0x7b6e06);}(_0x7a54,0x106));var _0x47a5=function(_0x2bb3c5,_0x37d7a4){_0x2bb3c5=_0x2bb3c5-0x0;var _0x182342=_0x7a54[_0x2bb3c5];return _0x182342;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x38bcdf,_0x77921c){var _0x3d940e=function(_0x57ea89){while(--_0x57ea89){_0x38bcdf['push'](_0x38bcdf['shift']());}};_0x3d940e(++_0x77921c);}(_0x7a54,0x106));var _0x47a5=function(_0x34e14a,_0x2a9c1d){_0x34e14a=_0x34e14a-0x0;var _0x5199ee=_0x7a54[_0x34e14a];return _0x5199ee;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d8a7f84..ad0c4f7 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 _0xc8ee=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post'];(function(_0x551d65,_0x56c1de){var _0x8e8dc0=function(_0x4f46a3){while(--_0x4f46a3){_0x551d65['push'](_0x551d65['shift']());}};_0x8e8dc0(++_0x56c1de);}(_0xc8ee,0xcb));var _0xec8e=function(_0x1e3687,_0x2c4897){_0x1e3687=_0x1e3687-0x0;var _0x558934=_0xc8ee[_0x1e3687];return _0x558934;};'use strict';var multer=require(_0xec8e('0x0'));var util=require(_0xec8e('0x1'));var path=require(_0xec8e('0x2'));var timeout=require(_0xec8e('0x3'));var express=require(_0xec8e('0x4'));var router=express[_0xec8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xec8e('0x6'));var interaction=require(_0xec8e('0x7'));var config=require(_0xec8e('0x8'));var controller=require(_0xec8e('0x9'));router['get']('/',auth[_0xec8e('0xa')](),controller[_0xec8e('0xb')]);router[_0xec8e('0xc')](_0xec8e('0xd'),auth[_0xec8e('0xa')](),controller[_0xec8e('0xe')]);router[_0xec8e('0xc')](_0xec8e('0xf'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x10')]);router['get'](_0xec8e('0x11'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x12')]);router[_0xec8e('0xc')](_0xec8e('0x13'),auth[_0xec8e('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xec8e('0x14')](_0xec8e('0x15'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x16')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0xec8e('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xec8e('0x14')](_0xec8e('0x17'),auth[_0xec8e('0xa')](),controller[_0xec8e('0x18')]);router[_0xec8e('0x19')](_0xec8e('0xf'),auth['isAuthenticated'](),controller[_0xec8e('0x1a')]);module[_0xec8e('0x1b')]=router; \ No newline at end of file +var _0xe7c3=['fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','update','exports','multer','path','connect-timeout','Router'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0xe7c3,0x173));var _0x3e7c=function(_0x5d1994,_0x589d77){_0x5d1994=_0x5d1994-0x0;var _0x450bda=_0xe7c3[_0x5d1994];return _0x450bda;};'use strict';var multer=require(_0x3e7c('0x0'));var util=require('util');var path=require(_0x3e7c('0x1'));var timeout=require(_0x3e7c('0x2'));var express=require('express');var router=express[_0x3e7c('0x3')]();var fs_extra=require(_0x3e7c('0x4'));var auth=require(_0x3e7c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3e7c('0x6'));var controller=require(_0x3e7c('0x7'));router[_0x3e7c('0x8')]('/',auth['isAuthenticated'](),controller[_0x3e7c('0x9')]);router[_0x3e7c('0x8')](_0x3e7c('0xa'),auth[_0x3e7c('0xb')](),controller['describe']);router[_0x3e7c('0x8')](_0x3e7c('0xc'),auth[_0x3e7c('0xb')](),controller[_0x3e7c('0xd')]);router[_0x3e7c('0x8')](_0x3e7c('0xe'),auth[_0x3e7c('0xb')](),controller[_0x3e7c('0xf')]);router[_0x3e7c('0x8')](_0x3e7c('0x10'),auth[_0x3e7c('0xb')](),controller[_0x3e7c('0x11')]);router['post'](_0x3e7c('0x12'),auth['isAuthenticated'](),controller[_0x3e7c('0x13')]);router['post'](_0x3e7c('0x14'),auth[_0x3e7c('0xb')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x3e7c('0x15')](_0x3e7c('0x16'),auth[_0x3e7c('0xb')](),controller['checkContactHopper']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e7c('0x17')]);module[_0x3e7c('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index dca0836..48e1437 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 _0x4d82=['STRING','BOOLEAN','exports','INTEGER','DATE'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x4d82,0x160));var _0x24d8=function(_0x366e75,_0x533d1d){_0x366e75=_0x366e75-0x0;var _0x3b167b=_0x4d82[_0x366e75];return _0x3b167b;};'use strict';var Sequelize=require('sequelize');module[_0x24d8('0x0')]={'state':{'type':Sequelize[_0x24d8('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x24d8('0x2')]},'countbusyretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x24d8('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x24d8('0x3')]},'calleridnum':{'type':Sequelize[_0x24d8('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x24d8('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x24d8('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x24d8('0x3')]},'campaigntype':{'type':Sequelize[_0x24d8('0x3')]},'membername':{'type':Sequelize[_0x24d8('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x24d8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x24d8('0x2')]},'recallme':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x24d8('0x2')]},'edited':{'type':Sequelize[_0x24d8('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x24d8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc049=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0xc049,0xfb));var _0x9c04=function(_0x4d2234,_0x5e4ed1){_0x4d2234=_0x4d2234-0x0;var _0x28c56b=_0xc049[_0x4d2234];return _0x28c56b;};'use strict';var Sequelize=require(_0x9c04('0x0'));module[_0x9c04('0x1')]={'state':{'type':Sequelize[_0x9c04('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9c04('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x9c04('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9c04('0x3')]},'calleridnum':{'type':Sequelize[_0x9c04('0x3')]},'calleridname':{'type':Sequelize[_0x9c04('0x3')]},'starttime':{'type':Sequelize[_0x9c04('0x4')]},'responsetime':{'type':Sequelize[_0x9c04('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9c04('0x4')]},'endtime':{'type':Sequelize[_0x9c04('0x4')]},'ringtime':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9c04('0x3')]},'campaign':{'type':Sequelize[_0x9c04('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9c04('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x9c04('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9c04('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9c04('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9c04('0x4')]},'recallme':{'type':Sequelize[_0x9c04('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x9c04('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9c04('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 163b73e..ac30e17 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 _0xcc91=['uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','CmHopperHistory','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','catch','params','rawAttributes','includeAll','options','find','create','describe','update','body'];(function(_0x2a714a,_0x5bb137){var _0x246ff0=function(_0x10dadd){while(--_0x10dadd){_0x2a714a['push'](_0x2a714a['shift']());}};_0x246ff0(++_0x5bb137);}(_0xcc91,0xe8));var _0x1cc9=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xcc91[_0x132558];return _0x34f138;};'use strict';var emlformat=require(_0x1cc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1cc9('0x1'));var jsonpatch=require(_0x1cc9('0x2'));var rp=require(_0x1cc9('0x3'));var moment=require(_0x1cc9('0x4'));var BPromise=require(_0x1cc9('0x5'));var Mustache=require(_0x1cc9('0x6'));var util=require(_0x1cc9('0x7'));var path=require(_0x1cc9('0x8'));var sox=require(_0x1cc9('0x9'));var csv=require(_0x1cc9('0xa'));var ejs=require(_0x1cc9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1cc9('0xc'));var crypto=require('crypto');var jsforce=require(_0x1cc9('0xd'));var deskjs=require(_0x1cc9('0xe'));var toCsv=require(_0x1cc9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cc9('0xf'));var qs=require(_0x1cc9('0x10'));var as=require(_0x1cc9('0x11'));var hardwareService=require(_0x1cc9('0x12'));var logger=require(_0x1cc9('0x13'))(_0x1cc9('0x14'));var utils=require(_0x1cc9('0x15'));var config=require(_0x1cc9('0x16'));var licenseUtil=require(_0x1cc9('0x17'));var db=require(_0x1cc9('0x18'))['db'];function respondWithStatusCode(_0x11dae2,_0x5e96f0){_0x5e96f0=_0x5e96f0||0xcc;return function(_0x2353be){if(_0x2353be){return _0x11dae2['sendStatus'](_0x5e96f0);}return _0x11dae2['status'](_0x5e96f0)[_0x1cc9('0x19')]();};}function respondWithResult(_0x1c2302,_0x2353d7){_0x2353d7=_0x2353d7||0xc8;return function(_0x39dcfc){if(_0x39dcfc){return _0x1c2302[_0x1cc9('0x1a')](_0x2353d7)[_0x1cc9('0x1b')](_0x39dcfc);}};}function respondWithFilteredResult(_0x40e37c,_0x103d72){return function(_0x2084aa){if(_0x2084aa){var _0x5583cc=typeof _0x103d72[_0x1cc9('0x1c')]==='undefined'&&typeof _0x103d72[_0x1cc9('0x1d')]===_0x1cc9('0x1e');var _0x5bde42=_0x2084aa[_0x1cc9('0x1f')];var _0x56c245=_0x5583cc?0x0:_0x103d72[_0x1cc9('0x1c')];var _0x6199bc=_0x5583cc?_0x2084aa[_0x1cc9('0x1f')]:_0x103d72['offset']+_0x103d72[_0x1cc9('0x1d')];var _0x2aa8fb;if(_0x6199bc>=_0x5bde42){_0x6199bc=_0x5bde42;_0x2aa8fb=0xc8;}else{_0x2aa8fb=0xce;}_0x40e37c[_0x1cc9('0x1a')](_0x2aa8fb);return _0x40e37c[_0x1cc9('0x20')]('Content-Range',_0x56c245+'-'+_0x6199bc+'/'+_0x5bde42)['json'](_0x2084aa);}return null;};}function patchUpdates(_0x1b0069){return function(_0x9ffc13){try{jsonpatch[_0x1cc9('0x21')](_0x9ffc13,_0x1b0069,!![]);}catch(_0x59d53d){return BPromise[_0x1cc9('0x22')](_0x59d53d);}return _0x9ffc13[_0x1cc9('0x23')]();};}function saveUpdates(_0x5c6bdc,_0x171164){return function(_0xf3d3a0){if(_0xf3d3a0){return _0xf3d3a0['update'](_0x5c6bdc)[_0x1cc9('0x24')](function(_0x2d8583){return _0x2d8583;});}return null;};}function removeEntity(_0x2c3876,_0x2ad8c2){return function(_0x4742b6){if(_0x4742b6){return _0x4742b6[_0x1cc9('0x25')]()[_0x1cc9('0x24')](function(){_0x2c3876[_0x1cc9('0x1a')](0xcc)[_0x1cc9('0x19')]();});}};}function handleEntityNotFound(_0x2a8980,_0x46670c){return function(_0x236050){if(!_0x236050){_0x2a8980[_0x1cc9('0x26')](0x194);}return _0x236050;};}function handleError(_0x3c0ad7,_0x4ab04d){_0x4ab04d=_0x4ab04d||0x1f4;return function(_0x30f533){logger['error'](_0x30f533[_0x1cc9('0x27')]);if(_0x30f533[_0x1cc9('0x28')]){delete _0x30f533['name'];}_0x3c0ad7[_0x1cc9('0x1a')](_0x4ab04d)[_0x1cc9('0x29')](_0x30f533);};}exports[_0x1cc9('0x2a')]=function(_0x5cf7fd,_0x42f2f5){var _0x344f7b={},_0x309864={},_0x5d41ee={'count':0x0,'rows':[]};var _0x290280=_[_0x1cc9('0x2b')](db[_0x1cc9('0x2c')]['rawAttributes'],function(_0x2d8ce9){return{'name':_0x2d8ce9[_0x1cc9('0x2d')],'type':_0x2d8ce9[_0x1cc9('0x2e')]['key']};});_0x309864[_0x1cc9('0x2f')]=_['map'](_0x290280,_0x1cc9('0x28'));_0x309864[_0x1cc9('0x30')]=_['keys'](_0x5cf7fd[_0x1cc9('0x30')]);_0x309864[_0x1cc9('0x31')]=_['intersection'](_0x309864['model'],_0x309864['query']);_0x344f7b[_0x1cc9('0x32')]=_[_0x1cc9('0x33')](_0x309864[_0x1cc9('0x2f')],qs[_0x1cc9('0x34')](_0x5cf7fd['query'][_0x1cc9('0x34')]));_0x344f7b[_0x1cc9('0x32')]=_0x344f7b[_0x1cc9('0x32')][_0x1cc9('0x35')]?_0x344f7b[_0x1cc9('0x32')]:_0x309864[_0x1cc9('0x2f')];if(!_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x36')](_0x1cc9('0x37'))){_0x344f7b[_0x1cc9('0x1d')]=qs[_0x1cc9('0x1d')](_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x1d')]);_0x344f7b['offset']=qs[_0x1cc9('0x1c')](_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x1c')]);}_0x344f7b[_0x1cc9('0x38')]=qs[_0x1cc9('0x39')](_0x5cf7fd[_0x1cc9('0x30')][_0x1cc9('0x39')]);_0x344f7b[_0x1cc9('0x3a')]=qs[_0x1cc9('0x31')](_[_0x1cc9('0x3b')](_0x5cf7fd[_0x1cc9('0x30')],_0x309864[_0x1cc9('0x31')]),_0x290280);if(_0x5cf7fd[_0x1cc9('0x30')]['filter']){_0x344f7b[_0x1cc9('0x3a')]=_['merge'](_0x344f7b[_0x1cc9('0x3a')],{'$or':_['map'](_0x290280,function(_0x4fe558){if(_0x4fe558[_0x1cc9('0x2e')]!==_0x1cc9('0x3c')){var _0x423fed={};_0x423fed[_0x4fe558[_0x1cc9('0x28')]]={'$like':'%'+_0x5cf7fd['query'][_0x1cc9('0x3d')]+'%'};return _0x423fed;}})});}_0x344f7b=_[_0x1cc9('0x3e')]({},_0x344f7b,_0x5cf7fd['options']);var _0x1ec454={'where':_0x344f7b[_0x1cc9('0x3a')]};return db[_0x1cc9('0x2c')][_0x1cc9('0x1f')](_0x1ec454)[_0x1cc9('0x24')](function(_0x4e95b4){_0x5d41ee[_0x1cc9('0x1f')]=_0x4e95b4;if(_0x5cf7fd[_0x1cc9('0x30')]['includeAll']){_0x344f7b[_0x1cc9('0x3f')]=[{'all':!![]}];}return db[_0x1cc9('0x2c')][_0x1cc9('0x40')](_0x344f7b);})[_0x1cc9('0x24')](function(_0x16b749){_0x5d41ee[_0x1cc9('0x41')]=_0x16b749;return _0x5d41ee;})[_0x1cc9('0x24')](respondWithFilteredResult(_0x42f2f5,_0x344f7b))[_0x1cc9('0x42')](handleError(_0x42f2f5,null));};exports['show']=function(_0xca03a2,_0x2c5fd6){var _0xe86604={'raw':!![],'where':{'id':_0xca03a2[_0x1cc9('0x43')]['id']}},_0x3e8f71={};_0x3e8f71[_0x1cc9('0x2f')]=_['keys'](db['CmHopperHistory'][_0x1cc9('0x44')]);_0x3e8f71[_0x1cc9('0x30')]=_['keys'](_0xca03a2['query']);_0x3e8f71['filters']=_[_0x1cc9('0x33')](_0x3e8f71[_0x1cc9('0x2f')],_0x3e8f71[_0x1cc9('0x30')]);_0xe86604[_0x1cc9('0x32')]=_[_0x1cc9('0x33')](_0x3e8f71[_0x1cc9('0x2f')],qs['fields'](_0xca03a2[_0x1cc9('0x30')][_0x1cc9('0x34')]));_0xe86604['attributes']=_0xe86604[_0x1cc9('0x32')][_0x1cc9('0x35')]?_0xe86604[_0x1cc9('0x32')]:_0x3e8f71[_0x1cc9('0x2f')];if(_0xca03a2[_0x1cc9('0x30')][_0x1cc9('0x45')]){_0xe86604['include']=[{'all':!![]}];}_0xe86604=_[_0x1cc9('0x3e')]({},_0xe86604,_0xca03a2[_0x1cc9('0x46')]);return db[_0x1cc9('0x2c')][_0x1cc9('0x47')](_0xe86604)[_0x1cc9('0x24')](handleEntityNotFound(_0x2c5fd6,null))[_0x1cc9('0x24')](respondWithResult(_0x2c5fd6,null))[_0x1cc9('0x42')](handleError(_0x2c5fd6,null));};exports[_0x1cc9('0x48')]=function(_0xc645b7,_0x4fe54e){return db[_0x1cc9('0x2c')][_0x1cc9('0x48')](_0xc645b7['body'],{})['then'](respondWithResult(_0x4fe54e,0xc9))[_0x1cc9('0x42')](handleError(_0x4fe54e,null));};exports[_0x1cc9('0x49')]=function(_0x4b8bf9,_0x4bda9d){return db['CmHopperHistory'][_0x1cc9('0x49')]()[_0x1cc9('0x24')](respondWithResult(_0x4bda9d,null))[_0x1cc9('0x42')](handleError(_0x4bda9d,null));};exports[_0x1cc9('0x4a')]=function(_0x19c9f8,_0xcd53ee){if(_0x19c9f8[_0x1cc9('0x4b')][_0x1cc9('0x4c')]){delete _0x19c9f8['body']['uniqueid'];}return db[_0x1cc9('0x2c')][_0x1cc9('0x47')]({'where':{'uniqueid':_0x19c9f8[_0x1cc9('0x43')]['id']}})[_0x1cc9('0x24')](handleEntityNotFound(_0xcd53ee,null))[_0x1cc9('0x24')](saveUpdates(_0x19c9f8['body'],null))[_0x1cc9('0x24')](respondWithResult(_0xcd53ee,null))[_0x1cc9('0x42')](handleError(_0xcd53ee,null));}; \ No newline at end of file +var _0x4e66=['filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','findAll','rows','catch','params','include','find','create','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e66,0x106));var _0x64e6=function(_0x4ef85c,_0xe66542){_0x4ef85c=_0x4ef85c-0x0;var _0x39bb8e=_0x4e66[_0x4ef85c];return _0x39bb8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64e6('0x0'));var zipdir=require(_0x64e6('0x1'));var jsonpatch=require(_0x64e6('0x2'));var rp=require(_0x64e6('0x3'));var moment=require(_0x64e6('0x4'));var BPromise=require(_0x64e6('0x5'));var Mustache=require(_0x64e6('0x6'));var util=require('util');var path=require(_0x64e6('0x7'));var sox=require(_0x64e6('0x8'));var csv=require(_0x64e6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x64e6('0xa'));var _=require(_0x64e6('0xb'));var squel=require(_0x64e6('0xc'));var crypto=require(_0x64e6('0xd'));var jsforce=require(_0x64e6('0xe'));var deskjs=require(_0x64e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x64e6('0x10'));var Papa=require(_0x64e6('0x11'));var Redis=require('ioredis');var authService=require(_0x64e6('0x12'));var qs=require(_0x64e6('0x13'));var as=require(_0x64e6('0x14'));var hardwareService=require(_0x64e6('0x15'));var logger=require(_0x64e6('0x16'))(_0x64e6('0x17'));var utils=require(_0x64e6('0x18'));var config=require(_0x64e6('0x19'));var licenseUtil=require(_0x64e6('0x1a'));var db=require(_0x64e6('0x1b'))['db'];function respondWithStatusCode(_0x3ebb2e,_0x2433e0){_0x2433e0=_0x2433e0||0xcc;return function(_0xa12ef3){if(_0xa12ef3){return _0x3ebb2e['sendStatus'](_0x2433e0);}return _0x3ebb2e[_0x64e6('0x1c')](_0x2433e0)[_0x64e6('0x1d')]();};}function respondWithResult(_0x4d80fc,_0x50c267){_0x50c267=_0x50c267||0xc8;return function(_0x584286){if(_0x584286){return _0x4d80fc[_0x64e6('0x1c')](_0x50c267)['json'](_0x584286);}};}function respondWithFilteredResult(_0x5d7d96,_0x297a2f){return function(_0x35577b){if(_0x35577b){var _0x23d1ea=typeof _0x297a2f['offset']===_0x64e6('0x1e')&&typeof _0x297a2f['limit']===_0x64e6('0x1e');var _0x48bb5d=_0x35577b[_0x64e6('0x1f')];var _0x1b5b8f=_0x23d1ea?0x0:_0x297a2f[_0x64e6('0x20')];var _0x3790fd=_0x23d1ea?_0x35577b[_0x64e6('0x1f')]:_0x297a2f[_0x64e6('0x20')]+_0x297a2f['limit'];var _0x3854c3;if(_0x3790fd>=_0x48bb5d){_0x3790fd=_0x48bb5d;_0x3854c3=0xc8;}else{_0x3854c3=0xce;}_0x5d7d96[_0x64e6('0x1c')](_0x3854c3);return _0x5d7d96[_0x64e6('0x21')](_0x64e6('0x22'),_0x1b5b8f+'-'+_0x3790fd+'/'+_0x48bb5d)['json'](_0x35577b);}return null;};}function patchUpdates(_0x512a90){return function(_0x52710f){try{jsonpatch[_0x64e6('0x23')](_0x52710f,_0x512a90,!![]);}catch(_0x4cd977){return BPromise[_0x64e6('0x24')](_0x4cd977);}return _0x52710f[_0x64e6('0x25')]();};}function saveUpdates(_0x1a1425,_0x1b1a43){return function(_0x321d0c){if(_0x321d0c){return _0x321d0c[_0x64e6('0x26')](_0x1a1425)['then'](function(_0x23a391){return _0x23a391;});}return null;};}function removeEntity(_0x147bf0,_0x3da031){return function(_0x41a7d0){if(_0x41a7d0){return _0x41a7d0[_0x64e6('0x27')]()[_0x64e6('0x28')](function(){_0x147bf0[_0x64e6('0x1c')](0xcc)[_0x64e6('0x1d')]();});}};}function handleEntityNotFound(_0x190b59,_0x33ba80){return function(_0x5910a3){if(!_0x5910a3){_0x190b59[_0x64e6('0x29')](0x194);}return _0x5910a3;};}function handleError(_0x489992,_0x43783b){_0x43783b=_0x43783b||0x1f4;return function(_0x5cdd84){logger[_0x64e6('0x2a')](_0x5cdd84[_0x64e6('0x2b')]);if(_0x5cdd84['name']){delete _0x5cdd84[_0x64e6('0x2c')];}_0x489992[_0x64e6('0x1c')](_0x43783b)[_0x64e6('0x2d')](_0x5cdd84);};}exports[_0x64e6('0x2e')]=function(_0x32480a,_0x12f1f6){var _0x58907={},_0x326d75={},_0x219cf0={'count':0x0,'rows':[]};var _0x48be40=_[_0x64e6('0x2f')](db['CmHopperHistory'][_0x64e6('0x30')],function(_0x1c5a07){return{'name':_0x1c5a07['fieldName'],'type':_0x1c5a07[_0x64e6('0x31')][_0x64e6('0x32')]};});_0x326d75['model']=_[_0x64e6('0x2f')](_0x48be40,_0x64e6('0x2c'));_0x326d75[_0x64e6('0x33')]=_[_0x64e6('0x34')](_0x32480a[_0x64e6('0x33')]);_0x326d75['filters']=_[_0x64e6('0x35')](_0x326d75['model'],_0x326d75[_0x64e6('0x33')]);_0x58907[_0x64e6('0x36')]=_['intersection'](_0x326d75[_0x64e6('0x37')],qs[_0x64e6('0x38')](_0x32480a['query'][_0x64e6('0x38')]));_0x58907['attributes']=_0x58907['attributes'][_0x64e6('0x39')]?_0x58907['attributes']:_0x326d75[_0x64e6('0x37')];if(!_0x32480a[_0x64e6('0x33')][_0x64e6('0x3a')](_0x64e6('0x3b'))){_0x58907[_0x64e6('0x3c')]=qs[_0x64e6('0x3c')](_0x32480a[_0x64e6('0x33')][_0x64e6('0x3c')]);_0x58907[_0x64e6('0x20')]=qs[_0x64e6('0x20')](_0x32480a[_0x64e6('0x33')][_0x64e6('0x20')]);}_0x58907[_0x64e6('0x3d')]=qs[_0x64e6('0x3e')](_0x32480a[_0x64e6('0x33')][_0x64e6('0x3e')]);_0x58907[_0x64e6('0x3f')]=qs[_0x64e6('0x40')](_[_0x64e6('0x41')](_0x32480a[_0x64e6('0x33')],_0x326d75['filters']),_0x48be40);if(_0x32480a[_0x64e6('0x33')][_0x64e6('0x42')]){_0x58907[_0x64e6('0x3f')]=_[_0x64e6('0x43')](_0x58907[_0x64e6('0x3f')],{'$or':_['map'](_0x48be40,function(_0x1a00d2){if(_0x1a00d2[_0x64e6('0x31')]!==_0x64e6('0x44')){var _0x3c3a83={};_0x3c3a83[_0x1a00d2['name']]={'$like':'%'+_0x32480a[_0x64e6('0x33')][_0x64e6('0x42')]+'%'};return _0x3c3a83;}})});}_0x58907=_[_0x64e6('0x43')]({},_0x58907,_0x32480a[_0x64e6('0x45')]);var _0xc6746a={'where':_0x58907[_0x64e6('0x3f')]};return db[_0x64e6('0x46')][_0x64e6('0x1f')](_0xc6746a)[_0x64e6('0x28')](function(_0x307372){_0x219cf0[_0x64e6('0x1f')]=_0x307372;if(_0x32480a[_0x64e6('0x33')][_0x64e6('0x47')]){_0x58907['include']=[{'all':!![]}];}return db[_0x64e6('0x46')][_0x64e6('0x48')](_0x58907);})[_0x64e6('0x28')](function(_0x105543){_0x219cf0[_0x64e6('0x49')]=_0x105543;return _0x219cf0;})[_0x64e6('0x28')](respondWithFilteredResult(_0x12f1f6,_0x58907))[_0x64e6('0x4a')](handleError(_0x12f1f6,null));};exports['show']=function(_0x21aac3,_0x3fe4c6){var _0x3c9631={'raw':!![],'where':{'id':_0x21aac3[_0x64e6('0x4b')]['id']}},_0x11e9c5={};_0x11e9c5[_0x64e6('0x37')]=_[_0x64e6('0x34')](db[_0x64e6('0x46')][_0x64e6('0x30')]);_0x11e9c5[_0x64e6('0x33')]=_['keys'](_0x21aac3[_0x64e6('0x33')]);_0x11e9c5[_0x64e6('0x40')]=_[_0x64e6('0x35')](_0x11e9c5['model'],_0x11e9c5[_0x64e6('0x33')]);_0x3c9631[_0x64e6('0x36')]=_[_0x64e6('0x35')](_0x11e9c5[_0x64e6('0x37')],qs[_0x64e6('0x38')](_0x21aac3[_0x64e6('0x33')][_0x64e6('0x38')]));_0x3c9631[_0x64e6('0x36')]=_0x3c9631[_0x64e6('0x36')][_0x64e6('0x39')]?_0x3c9631[_0x64e6('0x36')]:_0x11e9c5[_0x64e6('0x37')];if(_0x21aac3[_0x64e6('0x33')]['includeAll']){_0x3c9631[_0x64e6('0x4c')]=[{'all':!![]}];}_0x3c9631=_[_0x64e6('0x43')]({},_0x3c9631,_0x21aac3[_0x64e6('0x45')]);return db[_0x64e6('0x46')][_0x64e6('0x4d')](_0x3c9631)['then'](handleEntityNotFound(_0x3fe4c6,null))[_0x64e6('0x28')](respondWithResult(_0x3fe4c6,null))['catch'](handleError(_0x3fe4c6,null));};exports[_0x64e6('0x4e')]=function(_0x4ca099,_0x1ed8bf){return db['CmHopperHistory'][_0x64e6('0x4e')](_0x4ca099[_0x64e6('0x4f')],{})[_0x64e6('0x28')](respondWithResult(_0x1ed8bf,0xc9))[_0x64e6('0x4a')](handleError(_0x1ed8bf,null));};exports['describe']=function(_0x153d75,_0x15d456){return db[_0x64e6('0x46')][_0x64e6('0x50')]()[_0x64e6('0x28')](respondWithResult(_0x15d456,null))[_0x64e6('0x4a')](handleError(_0x15d456,null));};exports['update']=function(_0x1eb334,_0x54aa42){if(_0x1eb334[_0x64e6('0x4f')]['uniqueid']){delete _0x1eb334[_0x64e6('0x4f')][_0x64e6('0x51')];}return db[_0x64e6('0x46')][_0x64e6('0x4d')]({'where':{'uniqueid':_0x1eb334[_0x64e6('0x4b')]['id']}})[_0x64e6('0x28')](handleEntityNotFound(_0x54aa42,null))[_0x64e6('0x28')](saveUpdates(_0x1eb334[_0x64e6('0x4f')],null))[_0x64e6('0x28')](respondWithResult(_0x54aa42,null))[_0x64e6('0x4a')](handleError(_0x54aa42,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index c61d79d..7e60fc3 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 _0xd9eb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x137c51,_0x1b0ab4){var _0x77b4d3=function(_0x246695){while(--_0x246695){_0x137c51['push'](_0x137c51['shift']());}};_0x77b4d3(++_0x1b0ab4);}(_0xd9eb,0xca));var _0xbd9e=function(_0x28d31d,_0x57a4e6){_0x28d31d=_0x28d31d-0x0;var _0x2df7c1=_0xd9eb[_0x28d31d];return _0x2df7c1;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var logger=require(_0xbd9e('0x2'))(_0xbd9e('0x3'));var moment=require(_0xbd9e('0x4'));var BPromise=require(_0xbd9e('0x5'));var rp=require(_0xbd9e('0x6'));var fs=require('fs');var path=require(_0xbd9e('0x7'));var rimraf=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var attributes=require(_0xbd9e('0xa'));module[_0xbd9e('0xb')]=function(_0x20c36a,_0x4ade3f){return _0x20c36a[_0xbd9e('0xc')](_0xbd9e('0xd'),attributes,{'tableName':_0xbd9e('0xe'),'paranoid':![],'indexes':[{'name':_0xbd9e('0xf'),'fields':[_0xbd9e('0xf')]},{'name':_0xbd9e('0x10'),'fields':[_0xbd9e('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x794b=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment','path','rimraf'];(function(_0x357809,_0x4066dc){var _0x2bdfe3=function(_0x3933c8){while(--_0x3933c8){_0x357809['push'](_0x357809['shift']());}};_0x2bdfe3(++_0x4066dc);}(_0x794b,0x1c2));var _0xb794=function(_0x2ca8bd,_0x5ccb13){_0x2ca8bd=_0x2ca8bd-0x0;var _0x2b0343=_0x794b[_0x2ca8bd];return _0x2b0343;};'use strict';var _=require(_0xb794('0x0'));var util=require(_0xb794('0x1'));var logger=require('../../config/logger')(_0xb794('0x2'));var moment=require(_0xb794('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb794('0x4'));var rimraf=require(_0xb794('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0xb794('0x6')]=function(_0x338e39,_0xde33a5){return _0x338e39[_0xb794('0x7')](_0xb794('0x8'),attributes,{'tableName':_0xb794('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xb794('0xa')]},{'name':_0xb794('0xb'),'fields':[_0xb794('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9364a71..c8943e3 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 _0xd813=['catch','CreateCmHopperHistory','CmHopperHistory','body','options','stringify','AvgHandleTime','findAll','raw','where','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','CmHopperHistory,\x20%s,\x20%s','message'];(function(_0x42e3fb,_0x1c7dde){var _0x44f77f=function(_0x114642){while(--_0x114642){_0x42e3fb['push'](_0x42e3fb['shift']());}};_0x44f77f(++_0x1c7dde);}(_0xd813,0x19c));var _0x3d81=function(_0x708c33,_0x57e9f2){_0x708c33=_0x708c33-0x0;var _0xe5e059=_0xd813[_0x708c33];return _0xe5e059;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3d81('0x0'));var BPromise=require(_0x3d81('0x1'));var rs=require(_0x3d81('0x2'));var fs=require('fs');var Redis=require(_0x3d81('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d81('0x4'));var logger=require(_0x3d81('0x5'))(_0x3d81('0x6'));var config=require(_0x3d81('0x7'));var jayson=require(_0x3d81('0x8'));var client=jayson[_0x3d81('0x9')][_0x3d81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a94c6,_0x35f582,_0x36275e){return new BPromise(function(_0x528344,_0x14bbfd){return client[_0x3d81('0xb')](_0x2a94c6,_0x36275e)[_0x3d81('0xc')](function(_0x3780d7){logger[_0x3d81('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x35f582,_0x3d81('0xe'));logger[_0x3d81('0xf')](_0x3d81('0x10'),_0x35f582,_0x3d81('0xe'),JSON['stringify'](_0x3780d7));if(_0x3780d7[_0x3d81('0x11')]){if(_0x3780d7['error']['code']===0x1f4){logger['error'](_0x3d81('0x12'),_0x35f582,_0x3780d7[_0x3d81('0x11')][_0x3d81('0x13')]);return _0x14bbfd(_0x3780d7['error'][_0x3d81('0x13')]);}logger[_0x3d81('0x11')](_0x3d81('0x12'),_0x35f582,_0x3780d7['error'][_0x3d81('0x13')]);return _0x528344(_0x3780d7[_0x3d81('0x11')]['message']);}else{logger[_0x3d81('0xd')](_0x3d81('0x12'),_0x35f582,'request\x20sent');_0x528344(_0x3780d7['result'][_0x3d81('0x13')]);}})[_0x3d81('0x14')](function(_0x233e0e){logger[_0x3d81('0x11')](_0x3d81('0x12'),_0x35f582,_0x233e0e);_0x14bbfd(_0x233e0e);});});}exports[_0x3d81('0x15')]=function(_0x5ad83b){var _0x4285ec=this;return new Promise(function(_0x5e1770,_0x3a3281){return db[_0x3d81('0x16')]['create'](_0x5ad83b[_0x3d81('0x17')],{'raw':_0x5ad83b[_0x3d81('0x18')]?_0x5ad83b[_0x3d81('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3d81('0xc')](function(_0x1794bf){logger[_0x3d81('0xd')]('CreateCmHopperHistory',_0x5ad83b);logger[_0x3d81('0xf')](_0x3d81('0x15'),_0x5ad83b,JSON[_0x3d81('0x19')](_0x1794bf));_0x5e1770(_0x1794bf);})[_0x3d81('0x14')](function(_0x2694f1){logger['error'](_0x3d81('0x15'),_0x2694f1['message'],_0x5ad83b);_0x3a3281(_0x4285ec['error'](0x1f4,_0x2694f1[_0x3d81('0x13')]));});});};exports[_0x3d81('0x1a')]=function(_0x130b95){var _0x2843f1=this;return new Promise(function(_0x11412d,_0x2c57ac){return db[_0x3d81('0x16')][_0x3d81('0x1b')]({'raw':_0x130b95[_0x3d81('0x18')]?_0x130b95[_0x3d81('0x18')][_0x3d81('0x1c')]===undefined?!![]:![]:!![],'where':_0x130b95[_0x3d81('0x18')]?_0x130b95[_0x3d81('0x18')][_0x3d81('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3d81('0x1e'),db['sequelize'][_0x3d81('0x1f')]('id')),_0x3d81('0x20')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x23')))),_0x3d81('0x24')],[db['sequelize']['fn']('COUNT',db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x25')))),_0x3d81('0x26')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x3d81('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x3d81('0x27')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x28'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x3d81('0x29')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x28'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x2a')))),_0x3d81('0x2b')]]})[_0x3d81('0xc')](function(_0x4970c4){logger[_0x3d81('0xd')](_0x3d81('0x1a'),_0x130b95);logger[_0x3d81('0xf')](_0x3d81('0x1a'),_0x130b95,JSON[_0x3d81('0x19')](_0x4970c4));_0x11412d(_0x4970c4);})[_0x3d81('0x14')](function(_0x5eccb4){logger[_0x3d81('0x11')](_0x3d81('0x1a'),_0x5eccb4[_0x3d81('0x13')],_0x130b95);_0x2c57ac(_0x2843f1[_0x3d81('0x11')](0x1f4,_0x5eccb4[_0x3d81('0x13')]));});});};exports[_0x3d81('0x2c')]=function(_0x2f818d){var _0x35c16f=this;return new Promise(function(_0xdc0b1e,_0x5c10a2){return db['CmHopperHistory']['findAll']({'raw':_0x2f818d['options']?_0x2f818d[_0x3d81('0x18')][_0x3d81('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f818d[_0x3d81('0x18')]?_0x2f818d[_0x3d81('0x18')][_0x3d81('0x1d')]||null:null,'attributes':[[_0x3d81('0x2d'),'name'],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x3d81('0x2e')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x2f')))),_0x3d81('0x30')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x23')))),_0x3d81('0x31')],[db[_0x3d81('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x3d81('0x32')))),_0x3d81('0x33')],[db['sequelize']['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')]['literal'](_0x3d81('0x34')))),_0x3d81('0x35')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize']['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x36')))),_0x3d81('0x37')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize']['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x38')))),_0x3d81('0x39')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x3a')))),_0x3d81('0x3b')],[db['sequelize']['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0x3d81('0x3c')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x3d')))),_0x3d81('0x3e')],[db[_0x3d81('0x21')]['fn']('COUNT',db[_0x3d81('0x21')]['fn']('IF',db['sequelize']['literal'](_0x3d81('0x3f')))),_0x3d81('0x40')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x41')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db['sequelize'][_0x3d81('0x22')](_0x3d81('0x42')))),_0x3d81('0x40')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')](_0x3d81('0x43')))),_0x3d81('0x44')]],'group':[_0x3d81('0x2d')]})[_0x3d81('0xc')](function(_0x34ea2a){logger[_0x3d81('0xd')](_0x3d81('0x2c'),_0x2f818d);logger[_0x3d81('0xf')](_0x3d81('0x2c'),_0x2f818d,JSON[_0x3d81('0x19')](_0x34ea2a));_0xdc0b1e(_0x34ea2a);})['catch'](function(_0x54d4d7){logger['error'](_0x3d81('0x2c'),_0x54d4d7[_0x3d81('0x13')],_0x2f818d);_0x5c10a2(_0x35c16f[_0x3d81('0x11')](0x1f4,_0x54d4d7[_0x3d81('0x13')]));});});};exports[_0x3d81('0x45')]=function(_0x189d18){var _0x378b11=this;return new Promise(function(_0x55bb8b,_0x3ac45e){return db[_0x3d81('0x16')][_0x3d81('0x1b')]({'raw':_0x189d18['options']?_0x189d18[_0x3d81('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x189d18['options']?_0x189d18[_0x3d81('0x18')][_0x3d81('0x1d')]||null:null,'attributes':[[_0x3d81('0x2d'),_0x3d81('0x46')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db['sequelize'][_0x3d81('0x1f')]('id')),_0x3d81('0x47')],[db[_0x3d81('0x21')]['fn'](_0x3d81('0x1e'),db[_0x3d81('0x21')]['fn']('IF',db[_0x3d81('0x21')][_0x3d81('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':['campaign']})['then'](function(_0x5a88b1){logger[_0x3d81('0xd')](_0x3d81('0x45'),_0x189d18);logger[_0x3d81('0xf')](_0x3d81('0x45'),_0x189d18,JSON[_0x3d81('0x19')](_0x5a88b1));_0x55bb8b(_0x5a88b1);})[_0x3d81('0x14')](function(_0x26e84c){logger[_0x3d81('0x11')]('GetCampaignHopperHistory',_0x26e84c['message'],_0x189d18);_0x3ac45e(_0x378b11[_0x3d81('0x11')](0x1f4,_0x26e84c[_0x3d81('0x13')]));});});}; \ No newline at end of file +var _0xbe85=['`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','col','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay'];(function(_0x22801a,_0x58ca2a){var _0x235749=function(_0x5ddd06){while(--_0x5ddd06){_0x22801a['push'](_0x22801a['shift']());}};_0x235749(++_0x58ca2a);}(_0xbe85,0x19c));var _0x5be8=function(_0x13c736,_0x1d4578){_0x13c736=_0x13c736-0x0;var _0x5987c7=_0xbe85[_0x13c736];return _0x5987c7;};'use strict';var _=require(_0x5be8('0x0'));var util=require(_0x5be8('0x1'));var moment=require(_0x5be8('0x2'));var BPromise=require('bluebird');var rs=require(_0x5be8('0x3'));var fs=require('fs');var Redis=require(_0x5be8('0x4'));var db=require(_0x5be8('0x5'))['db'];var utils=require(_0x5be8('0x6'));var logger=require(_0x5be8('0x7'))(_0x5be8('0x8'));var config=require(_0x5be8('0x9'));var jayson=require(_0x5be8('0xa'));var client=jayson[_0x5be8('0xb')][_0x5be8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa2d9b2,_0x1ff0ec,_0x301965){return new BPromise(function(_0x33d5be,_0x544647){return client['request'](_0xa2d9b2,_0x301965)[_0x5be8('0xd')](function(_0x42613c){logger[_0x5be8('0xe')](_0x5be8('0xf'),_0x1ff0ec,_0x5be8('0x10'));logger[_0x5be8('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1ff0ec,_0x5be8('0x10'),JSON[_0x5be8('0x12')](_0x42613c));if(_0x42613c['error']){if(_0x42613c['error']['code']===0x1f4){logger[_0x5be8('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x1ff0ec,_0x42613c[_0x5be8('0x13')][_0x5be8('0x14')]);return _0x544647(_0x42613c[_0x5be8('0x13')][_0x5be8('0x14')]);}logger[_0x5be8('0x13')](_0x5be8('0xf'),_0x1ff0ec,_0x42613c[_0x5be8('0x13')][_0x5be8('0x14')]);return _0x33d5be(_0x42613c[_0x5be8('0x13')][_0x5be8('0x14')]);}else{logger[_0x5be8('0xe')](_0x5be8('0xf'),_0x1ff0ec,'request\x20sent');_0x33d5be(_0x42613c['result'][_0x5be8('0x14')]);}})[_0x5be8('0x15')](function(_0x5a0ad8){logger[_0x5be8('0x13')](_0x5be8('0xf'),_0x1ff0ec,_0x5a0ad8);_0x544647(_0x5a0ad8);});});}exports[_0x5be8('0x16')]=function(_0x521482){var _0x524db6=this;return new Promise(function(_0x3666ae,_0x1410f7){return db[_0x5be8('0x17')][_0x5be8('0x18')](_0x521482[_0x5be8('0x19')],{'raw':_0x521482[_0x5be8('0x1a')]?_0x521482[_0x5be8('0x1a')][_0x5be8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x55f63b){logger[_0x5be8('0xe')](_0x5be8('0x16'),_0x521482);logger['debug'](_0x5be8('0x16'),_0x521482,JSON[_0x5be8('0x12')](_0x55f63b));_0x3666ae(_0x55f63b);})[_0x5be8('0x15')](function(_0x336f3b){logger['error']('CreateCmHopperHistory',_0x336f3b[_0x5be8('0x14')],_0x521482);_0x1410f7(_0x524db6['error'](0x1f4,_0x336f3b['message']));});});};exports['AvgHandleTime']=function(_0xbb3b54){var _0xf73049=this;return new Promise(function(_0xabfac0,_0x5e056c){return db[_0x5be8('0x17')][_0x5be8('0x1c')]({'raw':_0xbb3b54[_0x5be8('0x1a')]?_0xbb3b54[_0x5be8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xbb3b54[_0x5be8('0x1a')]?_0xbb3b54[_0x5be8('0x1a')][_0x5be8('0x1d')]||null:null,'attributes':[[db[_0x5be8('0x1e')]['fn']('COUNT',db[_0x5be8('0x1e')]['col']('id')),_0x5be8('0x1f')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')]['literal'](_0x5be8('0x21')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x23')))),_0x5be8('0x24')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x5be8('0x25')],[db[_0x5be8('0x1e')]['fn']('AVG',db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')]['literal'](_0x5be8('0x26')))),'predictiveIntervalAvgHoldtime'],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x27'),db[_0x5be8('0x1e')]['fn']('IF',db['sequelize'][_0x5be8('0x22')](_0x5be8('0x28')))),'predictiveIntervalAvgTalktime']]})[_0x5be8('0xd')](function(_0x1c2945){logger[_0x5be8('0xe')](_0x5be8('0x29'),_0xbb3b54);logger['debug']('AvgHandleTime',_0xbb3b54,JSON[_0x5be8('0x12')](_0x1c2945));_0xabfac0(_0x1c2945);})[_0x5be8('0x15')](function(_0x811f53){logger[_0x5be8('0x13')](_0x5be8('0x29'),_0x811f53['message'],_0xbb3b54);_0x5e056c(_0xf73049['error'](0x1f4,_0x811f53[_0x5be8('0x14')]));});});};exports[_0x5be8('0x2a')]=function(_0x374c13){var _0x4eca97=this;return new Promise(function(_0xd24357,_0x8319a1){return db[_0x5be8('0x17')][_0x5be8('0x1c')]({'raw':_0x374c13['options']?_0x374c13[_0x5be8('0x1a')][_0x5be8('0x1b')]===undefined?!![]:![]:!![],'where':_0x374c13[_0x5be8('0x1a')]?_0x374c13[_0x5be8('0x1a')][_0x5be8('0x1d')]||null:null,'attributes':[[_0x5be8('0x2b'),'name'],[db[_0x5be8('0x1e')]['fn']('COUNT',db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x2c')))),_0x5be8('0x2d')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db['sequelize'][_0x5be8('0x22')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x21')))),'outboundAnswerCallsDay'],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db['sequelize']['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0x5be8('0x2e')],[db[_0x5be8('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x5be8('0x22')](_0x5be8('0x2f')))),'outboundCongestionCallsDay'],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db['sequelize']['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x30')))),_0x5be8('0x31')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x32')))),'outboundDropCallsDayCallersExit'],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db['sequelize'][_0x5be8('0x22')](_0x5be8('0x33')))),_0x5be8('0x34')],[db['sequelize']['fn']('COUNT',db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x35')))),_0x5be8('0x36')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db['sequelize'][_0x5be8('0x22')](_0x5be8('0x37')))),_0x5be8('0x38')],[db[_0x5be8('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x39')))),'outboundRejectCallsDay'],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x3a')))),_0x5be8('0x3b')],[db['sequelize']['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x5be8('0x3c')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')]['fn']('IF',db['sequelize'][_0x5be8('0x22')](_0x5be8('0x3d')))),_0x5be8('0x3e')]],'group':[_0x5be8('0x2b')]})[_0x5be8('0xd')](function(_0x365f8d){logger[_0x5be8('0xe')](_0x5be8('0x2a'),_0x374c13);logger[_0x5be8('0x11')](_0x5be8('0x2a'),_0x374c13,JSON[_0x5be8('0x12')](_0x365f8d));_0xd24357(_0x365f8d);})[_0x5be8('0x15')](function(_0x9df720){logger['error'](_0x5be8('0x2a'),_0x9df720[_0x5be8('0x14')],_0x374c13);_0x8319a1(_0x4eca97[_0x5be8('0x13')](0x1f4,_0x9df720[_0x5be8('0x14')]));});});};exports[_0x5be8('0x3f')]=function(_0x356584){var _0x534f54=this;return new Promise(function(_0x36f48e,_0x47a0b0){return db['CmHopperHistory']['findAll']({'raw':_0x356584[_0x5be8('0x1a')]?_0x356584[_0x5be8('0x1a')][_0x5be8('0x1b')]===undefined?!![]:![]:!![],'where':_0x356584['options']?_0x356584[_0x5be8('0x1a')]['where']||null:null,'attributes':[[_0x5be8('0x2b'),_0x5be8('0x40')],[db[_0x5be8('0x1e')]['fn'](_0x5be8('0x20'),db[_0x5be8('0x1e')][_0x5be8('0x41')]('id')),'ivrTotalCallsDays'],[db[_0x5be8('0x1e')]['fn']('COUNT',db[_0x5be8('0x1e')]['fn']('IF',db[_0x5be8('0x1e')][_0x5be8('0x22')](_0x5be8('0x21')))),_0x5be8('0x42')]],'group':['campaign']})['then'](function(_0x3ba92e){logger[_0x5be8('0xe')](_0x5be8('0x3f'),_0x356584);logger['debug']('GetCampaignHopperHistory',_0x356584,JSON['stringify'](_0x3ba92e));_0x36f48e(_0x3ba92e);})[_0x5be8('0x15')](function(_0x2f3559){logger[_0x5be8('0x13')]('GetCampaignHopperHistory',_0x2f3559['message'],_0x356584);_0x47a0b0(_0x534f54[_0x5be8('0x13')](0x1f4,_0x2f3559['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 11ab5ec..ad48f70 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 _0x4f3c=['./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x44a923,_0x127746){var _0x4a086e=function(_0x4519e1){while(--_0x4519e1){_0x44a923['push'](_0x44a923['shift']());}};_0x4a086e(++_0x127746);}(_0x4f3c,0xb4));var _0xc4f3=function(_0x294f3d,_0x1b0f82){_0x294f3d=_0x294f3d-0x0;var _0x2c8f6c=_0x4f3c[_0x294f3d];return _0x2c8f6c;};'use strict';var multer=require('multer');var util=require(_0xc4f3('0x0'));var path=require(_0xc4f3('0x1'));var timeout=require(_0xc4f3('0x2'));var express=require(_0xc4f3('0x3'));var router=express[_0xc4f3('0x4')]();var fs_extra=require(_0xc4f3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc4f3('0x6'));var controller=require(_0xc4f3('0x7'));router[_0xc4f3('0x8')]('/',auth[_0xc4f3('0x9')](),controller['index']);router[_0xc4f3('0x8')](_0xc4f3('0xa'),auth[_0xc4f3('0x9')](),controller[_0xc4f3('0xb')]);router[_0xc4f3('0x8')](_0xc4f3('0xc'),auth[_0xc4f3('0x9')](),controller[_0xc4f3('0xd')]);router[_0xc4f3('0xe')]('/',auth[_0xc4f3('0x9')](),controller['create']);router[_0xc4f3('0xf')](_0xc4f3('0xc'),auth['isAuthenticated'](),controller[_0xc4f3('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8409=['/:id','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','post','create','put'];(function(_0x471b02,_0x25c812){var _0x26c7f6=function(_0x7f5056){while(--_0x7f5056){_0x471b02['push'](_0x471b02['shift']());}};_0x26c7f6(++_0x25c812);}(_0x8409,0x11f));var _0x9840=function(_0x45f06a,_0x2d6e27){_0x45f06a=_0x45f06a-0x0;var _0x381af5=_0x8409[_0x45f06a];return _0x381af5;};'use strict';var multer=require(_0x9840('0x0'));var util=require('util');var path=require(_0x9840('0x1'));var timeout=require(_0x9840('0x2'));var express=require(_0x9840('0x3'));var router=express[_0x9840('0x4')]();var fs_extra=require(_0x9840('0x5'));var auth=require(_0x9840('0x6'));var interaction=require(_0x9840('0x7'));var config=require(_0x9840('0x8'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x9840('0x9')](),controller['index']);router[_0x9840('0xa')](_0x9840('0xb'),auth[_0x9840('0x9')](),controller[_0x9840('0xc')]);router[_0x9840('0xa')]('/:id',auth[_0x9840('0x9')](),controller[_0x9840('0xd')]);router[_0x9840('0xe')]('/',auth[_0x9840('0x9')](),controller[_0x9840('0xf')]);router[_0x9840('0x10')](_0x9840('0x11'),auth[_0x9840('0x9')](),controller['update']);module[_0x9840('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 81f785d..42fb7ef 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 _0x165d=['STRING','name','sequelize','exports'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x165d,0x14a));var _0xd165=function(_0x3ca477,_0x2f4b41){_0x3ca477=_0x3ca477-0x0;var _0x2bfafa=_0x165d[_0x3ca477];return _0x2bfafa;};'use strict';var Sequelize=require(_0xd165('0x0'));module[_0xd165('0x1')]={'name':{'type':Sequelize[_0xd165('0x2')],'unique':_0xd165('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd165('0x2')]},'dialPrefix':{'type':Sequelize[_0xd165('0x2')]}}; \ No newline at end of file +var _0x44ae=['name','sequelize','exports','STRING'];(function(_0x322296,_0x57eb19){var _0x432ea7=function(_0x4bd2b3){while(--_0x4bd2b3){_0x322296['push'](_0x322296['shift']());}};_0x432ea7(++_0x57eb19);}(_0x44ae,0x17d));var _0xe44a=function(_0x2a87e9,_0x25c03e){_0x2a87e9=_0x2a87e9-0x0;var _0x5de0e6=_0x44ae[_0x2a87e9];return _0x5de0e6;};'use strict';var Sequelize=require(_0xe44a('0x0'));module[_0xe44a('0x1')]={'name':{'type':Sequelize[_0xe44a('0x2')],'unique':_0xe44a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xe44a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 021dfb6..cffe3a8 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 _0xfd77=['filter','ids','addContacts','tags','isArray','join','each','omit','success','push','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','CmContact','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','number','INTEGER','defaultValue','queryInterface','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','end','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','CmList','includeAll','findAll','rows','params','include','merge','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','catch','body','describe','addDisposition','ListId','getDispositions','findOne','Disposition','rawAttributes','hasOwnProperty','pick'];(function(_0x5e4b56,_0x177082){var _0x261196=function(_0x434894){while(--_0x434894){_0x5e4b56['push'](_0x5e4b56['shift']());}};_0x261196(++_0x177082);}(_0xfd77,0x157));var _0x7fd7=function(_0x31795d,_0x4860e2){_0x31795d=_0x31795d-0x0;var _0x63d93b=_0xfd77[_0x31795d];return _0x63d93b;};'use strict';var emlformat=require(_0x7fd7('0x0'));var rimraf=require(_0x7fd7('0x1'));var zipdir=require(_0x7fd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fd7('0x3'));var moment=require(_0x7fd7('0x4'));var BPromise=require(_0x7fd7('0x5'));var Mustache=require(_0x7fd7('0x6'));var util=require(_0x7fd7('0x7'));var path=require('path');var sox=require(_0x7fd7('0x8'));var csv=require(_0x7fd7('0x9'));var ejs=require(_0x7fd7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fd7('0xb'));var squel=require(_0x7fd7('0xc'));var crypto=require('crypto');var jsforce=require(_0x7fd7('0xd'));var deskjs=require(_0x7fd7('0xe'));var toCsv=require(_0x7fd7('0x9'));var querystring=require('querystring');var Papa=require(_0x7fd7('0xf'));var Redis=require(_0x7fd7('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7fd7('0x11'));var hardwareService=require(_0x7fd7('0x12'));var logger=require(_0x7fd7('0x13'))(_0x7fd7('0x14'));var utils=require(_0x7fd7('0x15'));var config=require(_0x7fd7('0x16'));var licenseUtil=require(_0x7fd7('0x17'));var db=require(_0x7fd7('0x18'))['db'];config[_0x7fd7('0x19')]=_[_0x7fd7('0x1a')](config[_0x7fd7('0x19')],{'host':_0x7fd7('0x1b'),'port':0x18eb});var socket=require(_0x7fd7('0x1c'))(new Redis(config['redis']));require(_0x7fd7('0x1d'))[_0x7fd7('0x1e')](socket);function respondWithStatusCode(_0x29fc42,_0x1b5d0c){_0x1b5d0c=_0x1b5d0c||0xcc;return function(_0x5a2417){if(_0x5a2417){return _0x29fc42[_0x7fd7('0x1f')](_0x1b5d0c);}return _0x29fc42[_0x7fd7('0x20')](_0x1b5d0c)['end']();};}function respondWithResult(_0x2454ea,_0x4aa2e7){_0x4aa2e7=_0x4aa2e7||0xc8;return function(_0x17ed90){if(_0x17ed90){return _0x2454ea[_0x7fd7('0x20')](_0x4aa2e7)[_0x7fd7('0x21')](_0x17ed90);}};}function respondWithFilteredResult(_0x2f0827,_0x376907){return function(_0x2df275){if(_0x2df275){var _0x33cbbe=typeof _0x376907[_0x7fd7('0x22')]===_0x7fd7('0x23')&&typeof _0x376907[_0x7fd7('0x24')]==='undefined';var _0xbcbb09=_0x2df275[_0x7fd7('0x25')];var _0x1978cc=_0x33cbbe?0x0:_0x376907[_0x7fd7('0x22')];var _0x2de16b=_0x33cbbe?_0x2df275[_0x7fd7('0x25')]:_0x376907[_0x7fd7('0x22')]+_0x376907['limit'];var _0x112f62;if(_0x2de16b>=_0xbcbb09){_0x2de16b=_0xbcbb09;_0x112f62=0xc8;}else{_0x112f62=0xce;}_0x2f0827[_0x7fd7('0x20')](_0x112f62);return _0x2f0827['set'](_0x7fd7('0x26'),_0x1978cc+'-'+_0x2de16b+'/'+_0xbcbb09)[_0x7fd7('0x21')](_0x2df275);}return null;};}function patchUpdates(_0x24068b){return function(_0x109d45){try{jsonpatch[_0x7fd7('0x27')](_0x109d45,_0x24068b,!![]);}catch(_0x3e0a7e){return BPromise[_0x7fd7('0x28')](_0x3e0a7e);}return _0x109d45[_0x7fd7('0x29')]();};}function saveUpdates(_0x3562f9,_0x1867f9){return function(_0x3b7913){if(_0x3b7913){return _0x3b7913[_0x7fd7('0x2a')](_0x3562f9)[_0x7fd7('0x2b')](function(_0x28f088){return _0x28f088;});}return null;};}function removeEntity(_0x18bdaf,_0x38caaa){return function(_0x1c1287){if(_0x1c1287){return _0x1c1287[_0x7fd7('0x2c')]()['then'](function(){var _0x51ce4e=_0x1c1287['get']({'plain':!![]});var _0x1fb804=_0x7fd7('0x2d');return db[_0x7fd7('0x2e')][_0x7fd7('0x2c')]({'where':{'type':_0x1fb804,'resourceId':_0x51ce4e['id']}})[_0x7fd7('0x2b')](function(){return _0x1c1287;});})[_0x7fd7('0x2b')](function(){_0x18bdaf[_0x7fd7('0x20')](0xcc)[_0x7fd7('0x2f')]();});}};}function handleEntityNotFound(_0x2df6b0,_0x21d95b){return function(_0x1df87c){if(!_0x1df87c){_0x2df6b0[_0x7fd7('0x1f')](0x194);}return _0x1df87c;};}function handleError(_0x561b42,_0x2564f0){_0x2564f0=_0x2564f0||0x1f4;return function(_0x4192b2){logger[_0x7fd7('0x30')](_0x4192b2[_0x7fd7('0x31')]);if(_0x4192b2['name']){delete _0x4192b2[_0x7fd7('0x32')];}_0x561b42[_0x7fd7('0x20')](_0x2564f0)[_0x7fd7('0x33')](_0x4192b2);};}exports[_0x7fd7('0x34')]=function(_0x43a045,_0x1e50a5){var _0x48ebc7={},_0x611ca={},_0x412195={'count':0x0,'rows':[]};var _0x28afb3=_[_0x7fd7('0x35')](db['CmList']['rawAttributes'],function(_0x34ec66){return{'name':_0x34ec66[_0x7fd7('0x36')],'type':_0x34ec66[_0x7fd7('0x37')][_0x7fd7('0x38')]};});_0x611ca['model']=_['map'](_0x28afb3,_0x7fd7('0x32'));_0x611ca[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x43a045[_0x7fd7('0x39')]);_0x611ca[_0x7fd7('0x3b')]=_['intersection'](_0x611ca[_0x7fd7('0x3c')],_0x611ca[_0x7fd7('0x39')]);_0x48ebc7['attributes']=_[_0x7fd7('0x3d')](_0x611ca[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x48ebc7[_0x7fd7('0x3f')]=_0x48ebc7[_0x7fd7('0x3f')][_0x7fd7('0x40')]?_0x48ebc7[_0x7fd7('0x3f')]:_0x611ca[_0x7fd7('0x3c')];if(!_0x43a045[_0x7fd7('0x39')]['hasOwnProperty'](_0x7fd7('0x41'))){_0x48ebc7[_0x7fd7('0x24')]=qs[_0x7fd7('0x24')](_0x43a045[_0x7fd7('0x39')]['limit']);_0x48ebc7[_0x7fd7('0x22')]=qs['offset'](_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x22')]);}_0x48ebc7[_0x7fd7('0x42')]=qs['sort'](_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x43')]);_0x48ebc7[_0x7fd7('0x44')]=qs[_0x7fd7('0x3b')](_['pick'](_0x43a045[_0x7fd7('0x39')],_0x611ca['filters']),_0x28afb3);if(_0x43a045[_0x7fd7('0x39')]['filter']){_0x48ebc7[_0x7fd7('0x44')]=_['merge'](_0x48ebc7[_0x7fd7('0x44')],{'$or':_['map'](_0x28afb3,function(_0x58876d){if(_0x58876d[_0x7fd7('0x37')]!==_0x7fd7('0x45')){var _0x5cb812={};_0x5cb812[_0x58876d[_0x7fd7('0x32')]]={'$like':'%'+_0x43a045['query']['filter']+'%'};return _0x5cb812;}})});}_0x48ebc7=_['merge']({},_0x48ebc7,_0x43a045['options']);var _0x3e9a90={'where':_0x48ebc7[_0x7fd7('0x44')]};return db[_0x7fd7('0x46')][_0x7fd7('0x25')](_0x3e9a90)[_0x7fd7('0x2b')](function(_0x26c415){_0x412195[_0x7fd7('0x25')]=_0x26c415;if(_0x43a045[_0x7fd7('0x39')][_0x7fd7('0x47')]){_0x48ebc7['include']=[{'all':!![]}];}return db[_0x7fd7('0x46')][_0x7fd7('0x48')](_0x48ebc7);})[_0x7fd7('0x2b')](function(_0x1431b3){_0x412195[_0x7fd7('0x49')]=_0x1431b3;return _0x412195;})[_0x7fd7('0x2b')](respondWithFilteredResult(_0x1e50a5,_0x48ebc7))['catch'](handleError(_0x1e50a5,null));};exports['show']=function(_0x46b85a,_0x101325){var _0x48e3f0={'raw':![],'where':{'id':_0x46b85a[_0x7fd7('0x4a')]['id']}},_0x13dbc2={};_0x13dbc2['model']=_[_0x7fd7('0x3a')](db[_0x7fd7('0x46')]['rawAttributes']);_0x13dbc2[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x46b85a[_0x7fd7('0x39')]);_0x13dbc2[_0x7fd7('0x3b')]=_[_0x7fd7('0x3d')](_0x13dbc2[_0x7fd7('0x3c')],_0x13dbc2[_0x7fd7('0x39')]);_0x48e3f0['attributes']=_[_0x7fd7('0x3d')](_0x13dbc2[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x46b85a[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x48e3f0[_0x7fd7('0x3f')]=_0x48e3f0['attributes'][_0x7fd7('0x40')]?_0x48e3f0[_0x7fd7('0x3f')]:_0x13dbc2[_0x7fd7('0x3c')];if(_0x46b85a[_0x7fd7('0x39')][_0x7fd7('0x47')]){_0x48e3f0[_0x7fd7('0x4b')]=[{'all':!![]}];}_0x48e3f0=_[_0x7fd7('0x4c')]({},_0x48e3f0,_0x46b85a[_0x7fd7('0x4d')]);return db[_0x7fd7('0x46')]['find'](_0x48e3f0)['then'](handleEntityNotFound(_0x101325,null))['then'](respondWithResult(_0x101325,null))['catch'](handleError(_0x101325,null));};exports['create']=function(_0x48bb1c,_0x4b60ac){return db['CmList'][_0x7fd7('0x4e')](_0x48bb1c['body'],{})['then'](function(_0x39a5bc){var _0x1882a8=_0x48bb1c[_0x7fd7('0x4f')]['get']({'plain':!![]});if(!_0x1882a8)throw new Error(_0x7fd7('0x50'));if(_0x1882a8['role']==='user'){var _0x5d6946=_0x39a5bc['get']({'plain':!![]});var _0x8944b1='Lists';return db[_0x7fd7('0x51')][_0x7fd7('0x52')]({'where':{'name':_0x8944b1,'userProfileId':_0x1882a8['userProfileId']},'raw':!![]})[_0x7fd7('0x2b')](function(_0x580943){if(_0x580943&&_0x580943[_0x7fd7('0x53')]===0x0){return db[_0x7fd7('0x2e')][_0x7fd7('0x4e')]({'name':_0x5d6946[_0x7fd7('0x32')],'resourceId':_0x5d6946['id'],'type':_0x580943[_0x7fd7('0x32')],'sectionId':_0x580943['id']},{})['then'](function(){return _0x39a5bc;});}else{return _0x39a5bc;}})[_0x7fd7('0x54')](function(_0x1ad8f2){logger[_0x7fd7('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ad8f2);throw _0x1ad8f2;});}return _0x39a5bc;})[_0x7fd7('0x2b')](respondWithResult(_0x4b60ac,0xc9))['catch'](handleError(_0x4b60ac,null));};exports['update']=function(_0x1cd59f,_0x5f3ac3){if(_0x1cd59f[_0x7fd7('0x55')]['id']){delete _0x1cd59f[_0x7fd7('0x55')]['id'];}return db['CmList']['find']({'where':{'id':_0x1cd59f[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f3ac3,null))['then'](saveUpdates(_0x1cd59f[_0x7fd7('0x55')],null))[_0x7fd7('0x2b')](respondWithResult(_0x5f3ac3,null))[_0x7fd7('0x54')](handleError(_0x5f3ac3,null));};exports[_0x7fd7('0x2c')]=function(_0x2ade3a,_0x2e4e83){return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x2ade3a[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e4e83,null))['then'](removeEntity(_0x2e4e83,null))[_0x7fd7('0x54')](handleError(_0x2e4e83,null));};exports[_0x7fd7('0x56')]=function(_0xb82128,_0x3c625d){return db[_0x7fd7('0x46')][_0x7fd7('0x56')]()[_0x7fd7('0x2b')](respondWithResult(_0x3c625d,null))[_0x7fd7('0x54')](handleError(_0x3c625d,null));};exports[_0x7fd7('0x57')]=function(_0x4c4e91,_0x2a283f,_0x1fc5b3){if(_0x4c4e91[_0x7fd7('0x55')]['id']){delete _0x4c4e91[_0x7fd7('0x55')]['id'];}return db['CmList'][_0x7fd7('0x52')]({'where':{'id':_0x4c4e91[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x2a283f,null))[_0x7fd7('0x2b')](function(_0x57bd62){if(_0x57bd62){_0x4c4e91[_0x7fd7('0x55')][_0x7fd7('0x58')]=_0x57bd62['id'];return db['Disposition'][_0x7fd7('0x4e')](_0x4c4e91['body']);}})[_0x7fd7('0x2b')](respondWithResult(_0x2a283f,null))['catch'](handleError(_0x2a283f,null));};exports[_0x7fd7('0x59')]=function(_0x38a7a2,_0xfac7bc,_0x110d3c){var _0x12225c={'raw':![],'where':{}};var _0x4ff43d={};var _0x5127b7={'count':0x0,'rows':[]};return db[_0x7fd7('0x46')][_0x7fd7('0x5a')]({'where':{'id':_0x38a7a2[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0xfac7bc,null))[_0x7fd7('0x2b')](function(_0x1531c9){if(_0x1531c9){_0x4ff43d[_0x7fd7('0x3c')]=_[_0x7fd7('0x3a')](db[_0x7fd7('0x5b')][_0x7fd7('0x5c')]);_0x4ff43d[_0x7fd7('0x39')]=_['keys'](_0x38a7a2[_0x7fd7('0x39')]);_0x4ff43d['filters']=_['intersection'](_0x4ff43d[_0x7fd7('0x3c')],_0x4ff43d[_0x7fd7('0x39')]);_0x12225c[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x4ff43d[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x38a7a2['query'][_0x7fd7('0x3e')]));_0x12225c['attributes']=_0x12225c[_0x7fd7('0x3f')]['length']?_0x12225c['attributes']:_0x4ff43d[_0x7fd7('0x3c')];if(!_0x38a7a2['query'][_0x7fd7('0x5d')](_0x7fd7('0x41'))){_0x12225c[_0x7fd7('0x24')]=qs[_0x7fd7('0x24')](_0x38a7a2['query'][_0x7fd7('0x24')]);_0x12225c[_0x7fd7('0x22')]=qs[_0x7fd7('0x22')](_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x22')]);}_0x12225c[_0x7fd7('0x42')]=qs['sort'](_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x43')]);_0x12225c[_0x7fd7('0x44')]=qs['filters'](_[_0x7fd7('0x5e')](_0x38a7a2['query'],_0x4ff43d['filters']));_0x12225c[_0x7fd7('0x44')]['ListId']=_0x1531c9['id'];if(_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x12225c[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x12225c[_0x7fd7('0x44')],{'$or':_[_0x7fd7('0x35')](_0x12225c[_0x7fd7('0x3f')],function(_0x21edc9){var _0x3ec2fd={};_0x3ec2fd[_0x21edc9]={'$like':'%'+_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x5f')]+'%'};return _0x3ec2fd;})});}_0x12225c=_[_0x7fd7('0x4c')]({},_0x12225c,_0x38a7a2[_0x7fd7('0x4d')]);return db[_0x7fd7('0x5b')][_0x7fd7('0x25')]({'where':_0x12225c[_0x7fd7('0x44')]})[_0x7fd7('0x2b')](function(_0x36f9f7){_0x5127b7['count']=_0x36f9f7;if(_0x38a7a2[_0x7fd7('0x39')][_0x7fd7('0x47')]){_0x12225c[_0x7fd7('0x4b')]=[{'all':!![]}];}return db[_0x7fd7('0x5b')][_0x7fd7('0x48')](_0x12225c);})[_0x7fd7('0x2b')](function(_0x2781dd){_0x5127b7[_0x7fd7('0x49')]=_0x2781dd;return _0x5127b7;});}})[_0x7fd7('0x2b')](respondWithFilteredResult(_0xfac7bc,_0x12225c))['catch'](handleError(_0xfac7bc,null));};exports['removeDispositions']=function(_0x38c362,_0x21fa0f,_0x144710){return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x38c362[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21fa0f,null))[_0x7fd7('0x2b')](function(_0x5a2dfe){if(_0x5a2dfe){return _0x5a2dfe['removeDispositions'](_0x38c362['query'][_0x7fd7('0x60')]);}})['then'](respondWithStatusCode(_0x21fa0f,null))[_0x7fd7('0x54')](handleError(_0x21fa0f,null));};exports[_0x7fd7('0x61')]=function(_0x247095,_0x5a5736,_0x5a5a3f){return db[_0x7fd7('0x46')]['find']({'where':{'id':_0x247095['params']['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x5a5736,null))[_0x7fd7('0x2b')](function(_0x2528bb){if(_0x2528bb){var _0x8bb4bd=[];var _0x5a9b4f={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x7fd7('0x2b')](function(_0xcf27f4){if(_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')]&&_[_0x7fd7('0x63')](_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')])){if(_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')][_0x7fd7('0x40')]){_0x247095[_0x7fd7('0x55')][_0x7fd7('0x62')]=_0x247095[_0x7fd7('0x55')]['tags'][_0x7fd7('0x64')](';')+';';}else{_0x247095['body'][_0x7fd7('0x62')]=null;}}else{_0x247095[_0x7fd7('0x55')]['tags']=null;}if(_0x247095[_0x7fd7('0x55')]&&_['isArray'](_0x247095[_0x7fd7('0x55')])){for(var _0x2cbaed=0x0;_0x2cbaed<_0x247095[_0x7fd7('0x55')][_0x7fd7('0x40')];_0x2cbaed+=0x1){_0x247095[_0x7fd7('0x55')][_0x2cbaed][_0x7fd7('0x58')]=_0x247095[_0x7fd7('0x4a')]['id'];_0x8bb4bd['push'](_0x247095[_0x7fd7('0x55')][_0x2cbaed]);}return BPromise[_0x7fd7('0x65')](_0x8bb4bd,function(_0x5c498e){return db['CmContact'][_0x7fd7('0x4e')](_[_0x7fd7('0x66')](_0x5c498e,[_0x7fd7('0x60'),'id'])||{},{'fields':_[_0x7fd7('0x3a')](_0xcf27f4),'raw':!![]})[_0x7fd7('0x2b')](function(_0x43b0c0){_0x5a9b4f[_0x7fd7('0x67')][_0x7fd7('0x68')](_0x43b0c0[_0x7fd7('0x69')]);})['catch'](function(_0x4ddb6b){_0x5a9b4f[_0x7fd7('0x6a')][_0x7fd7('0x68')]({'data':_0x5c498e,'error':_0x4ddb6b['message']});});})['then'](function(_0xbc3591){return _0x5a9b4f;})[_0x7fd7('0x54')](function(_0x53dd90){return _0x53dd90;});}else{_0x5a5736[_0x7fd7('0x20')](0x190)[_0x7fd7('0x21')]({'message':_0x7fd7('0x6b')});}});}})[_0x7fd7('0x2b')](respondWithResult(_0x5a5736,null))[_0x7fd7('0x54')](handleError(_0x5a5736,null));};exports[_0x7fd7('0x6c')]=function(_0x4cdf74,_0x3e6fc9,_0x5d167d){var _0x8e1a07;return db['CmList'][_0x7fd7('0x52')]({'where':{'id':_0x4cdf74[_0x7fd7('0x4a')]['id']},'include':[{'model':db[_0x7fd7('0x6d')],'as':_0x7fd7('0x6e')}]})[_0x7fd7('0x2b')](handleEntityNotFound(_0x3e6fc9,null))[_0x7fd7('0x2b')](function(_0x2d64e5){if(_0x2d64e5){_0x8e1a07=_0x2d64e5;return db[_0x7fd7('0x6f')][_0x7fd7('0x5c')];}})[_0x7fd7('0x2b')](function(_0x2b7e5b){if(_0x2b7e5b){var _0x2b0ebe={};var _0x214ba0={};_0x214ba0['model']=_[_0x7fd7('0x70')](_[_0x7fd7('0x3a')](_0x2b7e5b),_[_0x7fd7('0x35')](_0x8e1a07[_0x7fd7('0x6e')],function(_0x5bb141){return util['format'](_0x7fd7('0x71'),_0x5bb141['id']);}));_0x214ba0[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x4cdf74['query']);_0x214ba0['filters']=_['intersection'](_0x214ba0['model'],_0x214ba0[_0x7fd7('0x39')]);_0x2b0ebe[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x214ba0[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x4cdf74['query']['fields']));_0x2b0ebe[_0x7fd7('0x3f')]=_0x2b0ebe[_0x7fd7('0x3f')]['length']?_0x2b0ebe[_0x7fd7('0x3f')]:_0x214ba0[_0x7fd7('0x3c')];if(!_0x4cdf74[_0x7fd7('0x39')]['hasOwnProperty'](_0x7fd7('0x41'))){_0x2b0ebe[_0x7fd7('0x24')]=qs[_0x7fd7('0x24')](_0x4cdf74[_0x7fd7('0x39')]['limit']);_0x2b0ebe[_0x7fd7('0x22')]=qs['offset'](_0x4cdf74[_0x7fd7('0x39')]['offset']);}_0x2b0ebe[_0x7fd7('0x42')]=qs[_0x7fd7('0x43')](_0x4cdf74[_0x7fd7('0x39')]['sort']);_0x2b0ebe[_0x7fd7('0x44')]=qs[_0x7fd7('0x3b')](_[_0x7fd7('0x5e')](_0x4cdf74['query'],_0x214ba0[_0x7fd7('0x3b')]));_0x2b0ebe[_0x7fd7('0x72')]=!![];if(_0x4cdf74[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x2b0ebe['where']=_[_0x7fd7('0x4c')](_0x2b0ebe['where'],{'$or':_['map'](_0x2b0ebe[_0x7fd7('0x3f')],function(_0x5b607d){var _0x5efbee={};_0x5efbee[_0x5b607d]={'$like':'%'+_0x4cdf74['query'][_0x7fd7('0x5f')]+'%'};return _0x5efbee;})});}_0x2b0ebe=_[_0x7fd7('0x4c')]({},_0x2b0ebe,_0x4cdf74[_0x7fd7('0x4d')]);return _0x8e1a07[_0x7fd7('0x6c')](_0x2b0ebe);}})[_0x7fd7('0x2b')](respondWithResult(_0x3e6fc9,null))[_0x7fd7('0x54')](handleError(_0x3e6fc9,null));};exports[_0x7fd7('0x73')]=function(_0x4674d4,_0x20e97,_0x537616){var _0x39abcb;return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x4674d4[_0x7fd7('0x4a')]['id']},'include':[{'model':db[_0x7fd7('0x6d')],'as':_0x7fd7('0x6e')}]})[_0x7fd7('0x2b')](handleEntityNotFound(_0x20e97,null))[_0x7fd7('0x2b')](function(_0x730dc6){if(_0x730dc6){_0x39abcb=_0x730dc6;return db['CmContact'][_0x7fd7('0x5c')];}})[_0x7fd7('0x2b')](function(_0x335819){if(_0x335819){var _0x2c7110={};var _0x1d0446={};_0x1d0446[_0x7fd7('0x3c')]=_[_0x7fd7('0x70')](_[_0x7fd7('0x3a')](_0x335819),_['map'](_0x39abcb[_0x7fd7('0x6e')],function(_0x31c931){return util[_0x7fd7('0x74')](_0x7fd7('0x71'),_0x31c931['id']);}));_0x1d0446['query']=_['keys'](_0x4674d4[_0x7fd7('0x39')]);_0x1d0446['filters']=_[_0x7fd7('0x3d')](_0x1d0446[_0x7fd7('0x3c')],_0x1d0446[_0x7fd7('0x39')]);_0x2c7110[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x1d0446['model'],qs['fields'](_0x4674d4[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x2c7110[_0x7fd7('0x3f')]=_0x2c7110[_0x7fd7('0x3f')][_0x7fd7('0x40')]?_0x2c7110['attributes']:_0x1d0446['model'];if(!_0x4674d4['query'][_0x7fd7('0x5d')](_0x7fd7('0x41'))){_0x2c7110[_0x7fd7('0x24')]=qs['limit'](_0x4674d4[_0x7fd7('0x39')]['limit']);_0x2c7110[_0x7fd7('0x22')]=qs['offset'](_0x4674d4[_0x7fd7('0x39')][_0x7fd7('0x22')]);}_0x2c7110['order']=qs[_0x7fd7('0x43')](_0x4674d4['query'][_0x7fd7('0x43')]);_0x2c7110['where']=qs[_0x7fd7('0x3b')](_['pick'](_0x4674d4[_0x7fd7('0x39')],_0x1d0446[_0x7fd7('0x3b')]));_0x2c7110[_0x7fd7('0x72')]=!![];if(_0x4674d4[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x2c7110['where']=_['merge'](_0x2c7110['where'],{'$or':_['map'](_0x2c7110[_0x7fd7('0x3f')],function(_0x5545c2){var _0xe77d7={};_0xe77d7[_0x5545c2]={'$like':'%'+_0x4674d4['query']['filter']+'%'};return _0xe77d7;})});}_0x2c7110=_[_0x7fd7('0x4c')]({},_0x2c7110,_0x4674d4[_0x7fd7('0x4d')]);return _0x39abcb[_0x7fd7('0x6c')](_0x2c7110);}})[_0x7fd7('0x2b')](function(_0x2c7b23){if(!_[_0x7fd7('0x75')](_0x2c7b23)){var _0x1d99cd=toCsv(_0x2c7b23);var _0x5a64f3=Date[_0x7fd7('0x76')]();fs[_0x7fd7('0x77')](util[_0x7fd7('0x74')]('/tmp/list_%d_%s.csv',_0x39abcb['id'],_0x5a64f3),_0x1d99cd);_0x20e97[_0x7fd7('0x78')](_0x7fd7('0x79'),_0x7fd7('0x7a')+util['format'](_0x7fd7('0x7b'),_0x39abcb['id'],_0x5a64f3));_0x20e97['setHeader'](_0x7fd7('0x7c'),_0x7fd7('0x7d'));return _0x20e97['download'](util[_0x7fd7('0x74')](_0x7fd7('0x7e'),_0x39abcb['id'],_0x5a64f3));}else{return _0x20e97[_0x7fd7('0x1f')](0xcc);}})['catch'](handleError(_0x20e97,null));};exports[_0x7fd7('0x7f')]=function(_0x17c5dc,_0x46bd74,_0x1ddfa1){var _0x2e2a3d;delete _0x17c5dc['body']['id'];return db[_0x7fd7('0x46')]['findOne']({'where':{'id':_0x17c5dc['params']['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x46bd74,null))[_0x7fd7('0x2b')](function(_0x193822){if(_0x193822){return db[_0x7fd7('0x80')][_0x7fd7('0x81')](function(_0x33a6bf){return db[_0x7fd7('0x6d')][_0x7fd7('0x4e')](_0x17c5dc['body'],{'transaction':_0x33a6bf})['then'](function(_0x4a0e83){_0x2e2a3d=_0x4a0e83;return _0x193822[_0x7fd7('0x82')](_0x4a0e83,{'transaction':_0x33a6bf});})[_0x7fd7('0x2b')](function(){var _0x46c9ea={'type':db[_0x7fd7('0x83')]['TEXT'],'transaction':_0x33a6bf};switch(_0x17c5dc['body'][_0x7fd7('0x37')]){case'text':_0x46c9ea[_0x7fd7('0x37')]=db[_0x7fd7('0x83')]['TEXT'];break;case _0x7fd7('0x84'):_0x46c9ea[_0x7fd7('0x37')]=db['Sequelize'][_0x7fd7('0x85')];break;case'switch':_0x46c9ea[_0x7fd7('0x37')]=db['Sequelize']['BOOLEAN'];_0x46c9ea[_0x7fd7('0x86')]=![];break;default:}return db[_0x7fd7('0x80')][_0x7fd7('0x87')]['addColumn'](_0x7fd7('0x88'),util[_0x7fd7('0x74')](_0x7fd7('0x89'),_0x2e2a3d['id']),_0x46c9ea);})[_0x7fd7('0x2b')](function(){return _0x2e2a3d;});});}})[_0x7fd7('0x2b')](respondWithResult(_0x46bd74,null))['catch'](handleError(_0x46bd74,null));};exports['getCustomFields']=function(_0x19309f,_0x67e8c3,_0x499aff){var _0x2a4d5b={};var _0x4a2e4c={};var _0x2effbe;var _0x11f409;return db[_0x7fd7('0x46')][_0x7fd7('0x5a')]({'where':{'id':_0x19309f['params']['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x67e8c3,null))[_0x7fd7('0x2b')](function(_0x3ec3c9){if(_0x3ec3c9){_0x2effbe=_0x3ec3c9;_0x4a2e4c['model']=_['keys'](db[_0x7fd7('0x6d')][_0x7fd7('0x5c')]);_0x4a2e4c[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x19309f[_0x7fd7('0x39')]);_0x4a2e4c[_0x7fd7('0x3b')]=_[_0x7fd7('0x3d')](_0x4a2e4c['model'],_0x4a2e4c[_0x7fd7('0x39')]);_0x2a4d5b[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x4a2e4c[_0x7fd7('0x3c')],qs['fields'](_0x19309f[_0x7fd7('0x39')][_0x7fd7('0x3e')]));_0x2a4d5b[_0x7fd7('0x3f')]=_0x2a4d5b['attributes'][_0x7fd7('0x40')]?_0x2a4d5b[_0x7fd7('0x3f')]:_0x4a2e4c[_0x7fd7('0x3c')];_0x2a4d5b[_0x7fd7('0x42')]=qs[_0x7fd7('0x43')](_0x19309f[_0x7fd7('0x39')][_0x7fd7('0x43')]);_0x2a4d5b[_0x7fd7('0x44')]=qs['filters'](_[_0x7fd7('0x5e')](_0x19309f[_0x7fd7('0x39')],_0x4a2e4c[_0x7fd7('0x3b')]));_0x2a4d5b[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x2a4d5b[_0x7fd7('0x44')],{'$or':[{'ListId':_0x3ec3c9['id']},{'ListId':null}]});if(_0x19309f['query'][_0x7fd7('0x5f')]){_0x2a4d5b[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x2a4d5b['where'],{'$or':_[_0x7fd7('0x35')](_0x2a4d5b['attributes'],function(_0xc6a862){var _0x600920={};_0x600920[_0xc6a862]={'$like':'%'+_0x19309f[_0x7fd7('0x39')][_0x7fd7('0x5f')]+'%'};return _0x600920;})});}_0x2a4d5b=_['merge']({},_0x2a4d5b,_0x19309f[_0x7fd7('0x4d')]);return db[_0x7fd7('0x6d')][_0x7fd7('0x8a')](_0x2a4d5b);}})['then'](respondWithResult(_0x67e8c3,null))[_0x7fd7('0x54')](handleError(_0x67e8c3,null));};exports[_0x7fd7('0x8b')]=function(_0x2fa2c7,_0x16d26b,_0x2812fd){return db[_0x7fd7('0x46')][_0x7fd7('0x52')]({'where':{'id':_0x2fa2c7[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x16d26b,null))[_0x7fd7('0x2b')](function(_0x58739e){if(_0x58739e){return _0x58739e['addAgents'](_0x2fa2c7[_0x7fd7('0x55')][_0x7fd7('0x60')],_[_0x7fd7('0x66')](_0x2fa2c7[_0x7fd7('0x55')],[_0x7fd7('0x60'),'id'])||{})[_0x7fd7('0x8c')](function(_0x27a91d){for(var _0xcfa6c2=0x0;_0xcfa6c2<_0x2fa2c7['body']['ids'][_0x7fd7('0x40')];_0xcfa6c2+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x2fa2c7[_0x7fd7('0x55')][_0x7fd7('0x60')][_0xcfa6c2]),'CmListId':Number(_0x2fa2c7[_0x7fd7('0x4a')]['id'])});}return _0x27a91d;});}})['then'](respondWithResult(_0x16d26b,null))[_0x7fd7('0x54')](handleError(_0x16d26b,null));};exports[_0x7fd7('0x8d')]=function(_0x42fb2c,_0x341cb1,_0x4fbb6f){return db['CmList'][_0x7fd7('0x52')]({'where':{'id':_0x42fb2c[_0x7fd7('0x4a')]['id']}})[_0x7fd7('0x2b')](handleEntityNotFound(_0x341cb1,null))[_0x7fd7('0x2b')](function(_0x3e90fa){if(_0x3e90fa){return _0x3e90fa[_0x7fd7('0x8d')](_0x42fb2c[_0x7fd7('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x42fb2c[_0x7fd7('0x39')][_0x7fd7('0x60')])){for(var _0x5f4b9e=0x0;_0x5f4b9e<_0x42fb2c['query'][_0x7fd7('0x60')]['length'];_0x5f4b9e+=0x1){socket[_0x7fd7('0x8e')](_0x7fd7('0x8f'),{'UserId':Number(_0x42fb2c[_0x7fd7('0x39')]['ids'][_0x5f4b9e]),'CmListId':Number(_0x42fb2c['params']['id'])});}}else{socket[_0x7fd7('0x8e')](_0x7fd7('0x8f'),{'UserId':Number(_0x42fb2c[_0x7fd7('0x39')][_0x7fd7('0x60')]),'CmListId':Number(_0x42fb2c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x341cb1,null))[_0x7fd7('0x54')](handleError(_0x341cb1,null));};exports[_0x7fd7('0x90')]=function(_0x4fa00b,_0x48edef,_0x3ce4a0){var _0x108896={};var _0x100cf5={};var _0x29a39f;var _0x591ae5;return db[_0x7fd7('0x46')][_0x7fd7('0x5a')]({'where':{'id':_0x4fa00b[_0x7fd7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48edef,null))[_0x7fd7('0x2b')](function(_0x144d1e){if(_0x144d1e){_0x29a39f=_0x144d1e;_0x100cf5[_0x7fd7('0x3c')]=_['keys'](db[_0x7fd7('0x91')][_0x7fd7('0x5c')]);_0x100cf5[_0x7fd7('0x39')]=_[_0x7fd7('0x3a')](_0x4fa00b[_0x7fd7('0x39')]);_0x100cf5['filters']=_[_0x7fd7('0x3d')](_0x100cf5[_0x7fd7('0x3c')],_0x100cf5['query']);_0x108896[_0x7fd7('0x3f')]=_[_0x7fd7('0x3d')](_0x100cf5[_0x7fd7('0x3c')],qs[_0x7fd7('0x3e')](_0x4fa00b[_0x7fd7('0x39')]['fields']));_0x108896['attributes']=_0x108896['attributes'][_0x7fd7('0x40')]?_0x108896['attributes']:_0x100cf5[_0x7fd7('0x3c')];_0x108896[_0x7fd7('0x42')]=qs[_0x7fd7('0x43')](_0x4fa00b[_0x7fd7('0x39')]['sort']);_0x108896[_0x7fd7('0x44')]=qs['filters'](_['pick'](_0x4fa00b[_0x7fd7('0x39')],_0x100cf5[_0x7fd7('0x3b')]));if(_0x4fa00b[_0x7fd7('0x39')][_0x7fd7('0x5f')]){_0x108896[_0x7fd7('0x44')]=_[_0x7fd7('0x4c')](_0x108896[_0x7fd7('0x44')],{'$or':_[_0x7fd7('0x35')](_0x108896[_0x7fd7('0x3f')],function(_0x1283ac){var _0x869809={};_0x869809[_0x1283ac]={'$like':'%'+_0x4fa00b[_0x7fd7('0x39')]['filter']+'%'};return _0x869809;})});}_0x108896=_[_0x7fd7('0x4c')]({},_0x108896,_0x4fa00b[_0x7fd7('0x4d')]);return _0x29a39f['getAgents'](_0x108896);}})[_0x7fd7('0x2b')](function(_0x3f6fd1){if(_0x3f6fd1){_0x591ae5=_0x3f6fd1[_0x7fd7('0x40')];if(!_0x4fa00b[_0x7fd7('0x39')][_0x7fd7('0x5d')](_0x7fd7('0x41'))){_0x108896['limit']=qs[_0x7fd7('0x24')](_0x4fa00b[_0x7fd7('0x39')][_0x7fd7('0x24')]);_0x108896[_0x7fd7('0x22')]=qs[_0x7fd7('0x22')](_0x4fa00b['query'][_0x7fd7('0x22')]);}return _0x29a39f['getAgents'](_0x108896);}})[_0x7fd7('0x2b')](function(_0xec61fe){if(_0xec61fe){return _0xec61fe?{'count':_0x591ae5,'rows':_0xec61fe}:null;}})[_0x7fd7('0x2b')](respondWithResult(_0x48edef,null))[_0x7fd7('0x54')](handleError(_0x48edef,null));}; \ No newline at end of file +var _0x81ca=['limit','count','offset','Content-Range','reject','update','then','Lists','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','CmList','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addContacts','tags','isArray','push','each','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmContact','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','omit','userCmList:save','removeAgents','emit','userCmList:remove','User','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','status','end','json','undefined'];(function(_0x2e271a,_0x39e24b){var _0xf7e8f7=function(_0x92382e){while(--_0x92382e){_0x2e271a['push'](_0x2e271a['shift']());}};_0xf7e8f7(++_0x39e24b);}(_0x81ca,0x185));var _0xa81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81ca[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa81c('0x0'));var rimraf=require(_0xa81c('0x1'));var zipdir=require(_0xa81c('0x2'));var jsonpatch=require(_0xa81c('0x3'));var rp=require(_0xa81c('0x4'));var moment=require(_0xa81c('0x5'));var BPromise=require(_0xa81c('0x6'));var Mustache=require(_0xa81c('0x7'));var util=require(_0xa81c('0x8'));var path=require(_0xa81c('0x9'));var sox=require(_0xa81c('0xa'));var csv=require(_0xa81c('0xb'));var ejs=require(_0xa81c('0xc'));var fs=require('fs');var fs_extra=require(_0xa81c('0xd'));var _=require(_0xa81c('0xe'));var squel=require('squel');var crypto=require(_0xa81c('0xf'));var jsforce=require(_0xa81c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa81c('0xb'));var querystring=require('querystring');var Papa=require(_0xa81c('0x11'));var Redis=require(_0xa81c('0x12'));var authService=require(_0xa81c('0x13'));var qs=require(_0xa81c('0x14'));var as=require(_0xa81c('0x15'));var hardwareService=require(_0xa81c('0x16'));var logger=require('../../config/logger')(_0xa81c('0x17'));var utils=require('../../config/utils');var config=require(_0xa81c('0x18'));var licenseUtil=require(_0xa81c('0x19'));var db=require('../../mysqldb')['db'];config[_0xa81c('0x1a')]=_[_0xa81c('0x1b')](config[_0xa81c('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa81c('0x1c'))(new Redis(config[_0xa81c('0x1a')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x5a76f2,_0x4a98bd){_0x4a98bd=_0x4a98bd||0xcc;return function(_0x37ed08){if(_0x37ed08){return _0x5a76f2[_0xa81c('0x1d')](_0x4a98bd);}return _0x5a76f2[_0xa81c('0x1e')](_0x4a98bd)[_0xa81c('0x1f')]();};}function respondWithResult(_0x36ff1d,_0x1dbbae){_0x1dbbae=_0x1dbbae||0xc8;return function(_0x2a0d6a){if(_0x2a0d6a){return _0x36ff1d[_0xa81c('0x1e')](_0x1dbbae)[_0xa81c('0x20')](_0x2a0d6a);}};}function respondWithFilteredResult(_0x1aeef8,_0x2064c2){return function(_0x4b1bbc){if(_0x4b1bbc){var _0x5a53fd=typeof _0x2064c2['offset']===_0xa81c('0x21')&&typeof _0x2064c2[_0xa81c('0x22')]===_0xa81c('0x21');var _0x385ab6=_0x4b1bbc[_0xa81c('0x23')];var _0x3e2f04=_0x5a53fd?0x0:_0x2064c2[_0xa81c('0x24')];var _0x5d552f=_0x5a53fd?_0x4b1bbc[_0xa81c('0x23')]:_0x2064c2[_0xa81c('0x24')]+_0x2064c2['limit'];var _0x439369;if(_0x5d552f>=_0x385ab6){_0x5d552f=_0x385ab6;_0x439369=0xc8;}else{_0x439369=0xce;}_0x1aeef8[_0xa81c('0x1e')](_0x439369);return _0x1aeef8['set'](_0xa81c('0x25'),_0x3e2f04+'-'+_0x5d552f+'/'+_0x385ab6)['json'](_0x4b1bbc);}return null;};}function patchUpdates(_0x1a7aa5){return function(_0x2b232d){try{jsonpatch['apply'](_0x2b232d,_0x1a7aa5,!![]);}catch(_0x6a57d7){return BPromise[_0xa81c('0x26')](_0x6a57d7);}return _0x2b232d['save']();};}function saveUpdates(_0x2742fa,_0x351839){return function(_0x5cd97a){if(_0x5cd97a){return _0x5cd97a[_0xa81c('0x27')](_0x2742fa)[_0xa81c('0x28')](function(_0x6d7bbf){return _0x6d7bbf;});}return null;};}function removeEntity(_0x284d8b,_0x5a718d){return function(_0x5963c5){if(_0x5963c5){return _0x5963c5['destroy']()[_0xa81c('0x28')](function(){var _0xd273b2=_0x5963c5['get']({'plain':!![]});var _0x408b02=_0xa81c('0x29');return db[_0xa81c('0x2a')][_0xa81c('0x2b')]({'where':{'type':_0x408b02,'resourceId':_0xd273b2['id']}})[_0xa81c('0x28')](function(){return _0x5963c5;});})[_0xa81c('0x28')](function(){_0x284d8b[_0xa81c('0x1e')](0xcc)[_0xa81c('0x1f')]();});}};}function handleEntityNotFound(_0x44c786,_0x1c94c8){return function(_0x2f9a8f){if(!_0x2f9a8f){_0x44c786[_0xa81c('0x1d')](0x194);}return _0x2f9a8f;};}function handleError(_0x7668e5,_0x4050ea){_0x4050ea=_0x4050ea||0x1f4;return function(_0x19ace0){logger['error'](_0x19ace0[_0xa81c('0x2c')]);if(_0x19ace0[_0xa81c('0x2d')]){delete _0x19ace0[_0xa81c('0x2d')];}_0x7668e5[_0xa81c('0x1e')](_0x4050ea)[_0xa81c('0x2e')](_0x19ace0);};}exports[_0xa81c('0x2f')]=function(_0x190f64,_0x10e4d2){var _0x428f68={},_0x257ff5={},_0x7a18f2={'count':0x0,'rows':[]};var _0x19272f=_['map'](db['CmList'][_0xa81c('0x30')],function(_0x300482){return{'name':_0x300482[_0xa81c('0x31')],'type':_0x300482[_0xa81c('0x32')]['key']};});_0x257ff5['model']=_[_0xa81c('0x33')](_0x19272f,_0xa81c('0x2d'));_0x257ff5['query']=_[_0xa81c('0x34')](_0x190f64[_0xa81c('0x35')]);_0x257ff5[_0xa81c('0x36')]=_[_0xa81c('0x37')](_0x257ff5[_0xa81c('0x38')],_0x257ff5[_0xa81c('0x35')]);_0x428f68['attributes']=_[_0xa81c('0x37')](_0x257ff5[_0xa81c('0x38')],qs[_0xa81c('0x39')](_0x190f64['query'][_0xa81c('0x39')]));_0x428f68['attributes']=_0x428f68[_0xa81c('0x3a')]['length']?_0x428f68[_0xa81c('0x3a')]:_0x257ff5[_0xa81c('0x38')];if(!_0x190f64['query']['hasOwnProperty'](_0xa81c('0x3b'))){_0x428f68[_0xa81c('0x22')]=qs[_0xa81c('0x22')](_0x190f64['query']['limit']);_0x428f68[_0xa81c('0x24')]=qs[_0xa81c('0x24')](_0x190f64[_0xa81c('0x35')][_0xa81c('0x24')]);}_0x428f68[_0xa81c('0x3c')]=qs['sort'](_0x190f64[_0xa81c('0x35')][_0xa81c('0x3d')]);_0x428f68[_0xa81c('0x3e')]=qs[_0xa81c('0x36')](_[_0xa81c('0x3f')](_0x190f64[_0xa81c('0x35')],_0x257ff5['filters']),_0x19272f);if(_0x190f64[_0xa81c('0x35')][_0xa81c('0x40')]){_0x428f68[_0xa81c('0x3e')]=_[_0xa81c('0x41')](_0x428f68['where'],{'$or':_['map'](_0x19272f,function(_0x1a1d75){if(_0x1a1d75[_0xa81c('0x32')]!=='VIRTUAL'){var _0x2c0d18={};_0x2c0d18[_0x1a1d75[_0xa81c('0x2d')]]={'$like':'%'+_0x190f64[_0xa81c('0x35')][_0xa81c('0x40')]+'%'};return _0x2c0d18;}})});}_0x428f68=_[_0xa81c('0x41')]({},_0x428f68,_0x190f64[_0xa81c('0x42')]);var _0x389dd0={'where':_0x428f68[_0xa81c('0x3e')]};return db[_0xa81c('0x43')]['count'](_0x389dd0)[_0xa81c('0x28')](function(_0x5d7f8e){_0x7a18f2[_0xa81c('0x23')]=_0x5d7f8e;if(_0x190f64[_0xa81c('0x35')][_0xa81c('0x44')]){_0x428f68[_0xa81c('0x45')]=[{'all':!![]}];}return db[_0xa81c('0x43')][_0xa81c('0x46')](_0x428f68);})['then'](function(_0x263c59){_0x7a18f2[_0xa81c('0x47')]=_0x263c59;return _0x7a18f2;})[_0xa81c('0x28')](respondWithFilteredResult(_0x10e4d2,_0x428f68))[_0xa81c('0x48')](handleError(_0x10e4d2,null));};exports[_0xa81c('0x49')]=function(_0x400576,_0xbc6136){var _0x339e00={'raw':![],'where':{'id':_0x400576[_0xa81c('0x4a')]['id']}},_0xad34b1={};_0xad34b1[_0xa81c('0x38')]=_[_0xa81c('0x34')](db[_0xa81c('0x43')][_0xa81c('0x30')]);_0xad34b1[_0xa81c('0x35')]=_['keys'](_0x400576[_0xa81c('0x35')]);_0xad34b1[_0xa81c('0x36')]=_[_0xa81c('0x37')](_0xad34b1[_0xa81c('0x38')],_0xad34b1['query']);_0x339e00[_0xa81c('0x3a')]=_[_0xa81c('0x37')](_0xad34b1[_0xa81c('0x38')],qs[_0xa81c('0x39')](_0x400576[_0xa81c('0x35')][_0xa81c('0x39')]));_0x339e00['attributes']=_0x339e00[_0xa81c('0x3a')][_0xa81c('0x4b')]?_0x339e00[_0xa81c('0x3a')]:_0xad34b1[_0xa81c('0x38')];if(_0x400576[_0xa81c('0x35')][_0xa81c('0x44')]){_0x339e00[_0xa81c('0x45')]=[{'all':!![]}];}_0x339e00=_[_0xa81c('0x41')]({},_0x339e00,_0x400576[_0xa81c('0x42')]);return db['CmList'][_0xa81c('0x4c')](_0x339e00)['then'](handleEntityNotFound(_0xbc6136,null))['then'](respondWithResult(_0xbc6136,null))[_0xa81c('0x48')](handleError(_0xbc6136,null));};exports[_0xa81c('0x4d')]=function(_0x3d5149,_0x464019){return db[_0xa81c('0x43')][_0xa81c('0x4d')](_0x3d5149[_0xa81c('0x4e')],{})[_0xa81c('0x28')](function(_0x1e5fbf){var _0x337efb=_0x3d5149[_0xa81c('0x4f')][_0xa81c('0x50')]({'plain':!![]});if(!_0x337efb)throw new Error(_0xa81c('0x51'));if(_0x337efb[_0xa81c('0x52')]===_0xa81c('0x4f')){var _0x30b603=_0x1e5fbf[_0xa81c('0x50')]({'plain':!![]});var _0x14331d=_0xa81c('0x29');return db[_0xa81c('0x53')][_0xa81c('0x4c')]({'where':{'name':_0x14331d,'userProfileId':_0x337efb[_0xa81c('0x54')]},'raw':!![]})[_0xa81c('0x28')](function(_0x56694a){if(_0x56694a&&_0x56694a['autoAssociation']===0x0){return db[_0xa81c('0x2a')][_0xa81c('0x4d')]({'name':_0x30b603[_0xa81c('0x2d')],'resourceId':_0x30b603['id'],'type':_0x56694a[_0xa81c('0x2d')],'sectionId':_0x56694a['id']},{})[_0xa81c('0x28')](function(){return _0x1e5fbf;});}else{return _0x1e5fbf;}})[_0xa81c('0x48')](function(_0x1484cd){logger[_0xa81c('0x55')](_0xa81c('0x56'),_0x1484cd);throw _0x1484cd;});}return _0x1e5fbf;})[_0xa81c('0x28')](respondWithResult(_0x464019,0xc9))['catch'](handleError(_0x464019,null));};exports[_0xa81c('0x27')]=function(_0x4d7095,_0x149518){if(_0x4d7095[_0xa81c('0x4e')]['id']){delete _0x4d7095[_0xa81c('0x4e')]['id'];}return db[_0xa81c('0x43')][_0xa81c('0x4c')]({'where':{'id':_0x4d7095[_0xa81c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x149518,null))[_0xa81c('0x28')](saveUpdates(_0x4d7095[_0xa81c('0x4e')],null))[_0xa81c('0x28')](respondWithResult(_0x149518,null))['catch'](handleError(_0x149518,null));};exports[_0xa81c('0x2b')]=function(_0x57ef22,_0x1ca274){return db[_0xa81c('0x43')][_0xa81c('0x4c')]({'where':{'id':_0x57ef22['params']['id']}})['then'](handleEntityNotFound(_0x1ca274,null))['then'](removeEntity(_0x1ca274,null))['catch'](handleError(_0x1ca274,null));};exports[_0xa81c('0x57')]=function(_0x3920cd,_0x5997d1){return db[_0xa81c('0x43')][_0xa81c('0x57')]()['then'](respondWithResult(_0x5997d1,null))[_0xa81c('0x48')](handleError(_0x5997d1,null));};exports['addDisposition']=function(_0xc001e9,_0xc921f8,_0x161c61){if(_0xc001e9['body']['id']){delete _0xc001e9[_0xa81c('0x4e')]['id'];}return db[_0xa81c('0x43')][_0xa81c('0x4c')]({'where':{'id':_0xc001e9['params']['id']}})[_0xa81c('0x28')](handleEntityNotFound(_0xc921f8,null))[_0xa81c('0x28')](function(_0x2b3585){if(_0x2b3585){_0xc001e9['body'][_0xa81c('0x58')]=_0x2b3585['id'];return db[_0xa81c('0x59')][_0xa81c('0x4d')](_0xc001e9['body']);}})['then'](respondWithResult(_0xc921f8,null))[_0xa81c('0x48')](handleError(_0xc921f8,null));};exports['getDispositions']=function(_0x4d9858,_0x4d71b4,_0xc448ed){var _0x15615f={'raw':![],'where':{}};var _0x18a579={};var _0x510669={'count':0x0,'rows':[]};return db['CmList'][_0xa81c('0x5a')]({'where':{'id':_0x4d9858[_0xa81c('0x4a')]['id']}})[_0xa81c('0x28')](handleEntityNotFound(_0x4d71b4,null))[_0xa81c('0x28')](function(_0x5ae090){if(_0x5ae090){_0x18a579[_0xa81c('0x38')]=_[_0xa81c('0x34')](db['Disposition'][_0xa81c('0x30')]);_0x18a579[_0xa81c('0x35')]=_['keys'](_0x4d9858[_0xa81c('0x35')]);_0x18a579[_0xa81c('0x36')]=_[_0xa81c('0x37')](_0x18a579[_0xa81c('0x38')],_0x18a579[_0xa81c('0x35')]);_0x15615f['attributes']=_[_0xa81c('0x37')](_0x18a579[_0xa81c('0x38')],qs[_0xa81c('0x39')](_0x4d9858[_0xa81c('0x35')][_0xa81c('0x39')]));_0x15615f['attributes']=_0x15615f['attributes']['length']?_0x15615f[_0xa81c('0x3a')]:_0x18a579[_0xa81c('0x38')];if(!_0x4d9858[_0xa81c('0x35')][_0xa81c('0x5b')]('nolimit')){_0x15615f[_0xa81c('0x22')]=qs[_0xa81c('0x22')](_0x4d9858['query'][_0xa81c('0x22')]);_0x15615f[_0xa81c('0x24')]=qs[_0xa81c('0x24')](_0x4d9858['query'][_0xa81c('0x24')]);}_0x15615f[_0xa81c('0x3c')]=qs['sort'](_0x4d9858['query'][_0xa81c('0x3d')]);_0x15615f[_0xa81c('0x3e')]=qs[_0xa81c('0x36')](_[_0xa81c('0x3f')](_0x4d9858[_0xa81c('0x35')],_0x18a579[_0xa81c('0x36')]));_0x15615f[_0xa81c('0x3e')][_0xa81c('0x58')]=_0x5ae090['id'];if(_0x4d9858['query'][_0xa81c('0x40')]){_0x15615f[_0xa81c('0x3e')]=_[_0xa81c('0x41')](_0x15615f['where'],{'$or':_['map'](_0x15615f[_0xa81c('0x3a')],function(_0x3ad703){var _0x1e2b74={};_0x1e2b74[_0x3ad703]={'$like':'%'+_0x4d9858['query'][_0xa81c('0x40')]+'%'};return _0x1e2b74;})});}_0x15615f=_[_0xa81c('0x41')]({},_0x15615f,_0x4d9858[_0xa81c('0x42')]);return db[_0xa81c('0x59')][_0xa81c('0x23')]({'where':_0x15615f[_0xa81c('0x3e')]})[_0xa81c('0x28')](function(_0xd2a3c5){_0x510669[_0xa81c('0x23')]=_0xd2a3c5;if(_0x4d9858['query'][_0xa81c('0x44')]){_0x15615f['include']=[{'all':!![]}];}return db[_0xa81c('0x59')][_0xa81c('0x46')](_0x15615f);})[_0xa81c('0x28')](function(_0x50ec58){_0x510669[_0xa81c('0x47')]=_0x50ec58;return _0x510669;});}})[_0xa81c('0x28')](respondWithFilteredResult(_0x4d71b4,_0x15615f))[_0xa81c('0x48')](handleError(_0x4d71b4,null));};exports[_0xa81c('0x5c')]=function(_0x3db844,_0x1c89c3,_0x554269){return db[_0xa81c('0x43')]['find']({'where':{'id':_0x3db844['params']['id']}})[_0xa81c('0x28')](handleEntityNotFound(_0x1c89c3,null))['then'](function(_0x3097d6){if(_0x3097d6){return _0x3097d6[_0xa81c('0x5c')](_0x3db844[_0xa81c('0x35')][_0xa81c('0x5d')]);}})[_0xa81c('0x28')](respondWithStatusCode(_0x1c89c3,null))[_0xa81c('0x48')](handleError(_0x1c89c3,null));};exports[_0xa81c('0x5e')]=function(_0x514336,_0x38e0cc,_0x49de0e){return db[_0xa81c('0x43')][_0xa81c('0x4c')]({'where':{'id':_0x514336[_0xa81c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x38e0cc,null))[_0xa81c('0x28')](function(_0x4dc832){if(_0x4dc832){var _0xbe59a4=[];var _0x2bf0a9={'success':[],'errors':[]};return db['CmContact'][_0xa81c('0x57')]()[_0xa81c('0x28')](function(_0x291eb6){if(_0x514336[_0xa81c('0x4e')]['tags']&&_['isArray'](_0x514336[_0xa81c('0x4e')][_0xa81c('0x5f')])){if(_0x514336['body'][_0xa81c('0x5f')][_0xa81c('0x4b')]){_0x514336[_0xa81c('0x4e')][_0xa81c('0x5f')]=_0x514336[_0xa81c('0x4e')][_0xa81c('0x5f')]['join'](';')+';';}else{_0x514336[_0xa81c('0x4e')][_0xa81c('0x5f')]=null;}}else{_0x514336[_0xa81c('0x4e')][_0xa81c('0x5f')]=null;}if(_0x514336[_0xa81c('0x4e')]&&_[_0xa81c('0x60')](_0x514336['body'])){for(var _0x36ba21=0x0;_0x36ba21<_0x514336[_0xa81c('0x4e')][_0xa81c('0x4b')];_0x36ba21+=0x1){_0x514336[_0xa81c('0x4e')][_0x36ba21][_0xa81c('0x58')]=_0x514336[_0xa81c('0x4a')]['id'];_0xbe59a4[_0xa81c('0x61')](_0x514336[_0xa81c('0x4e')][_0x36ba21]);}return BPromise[_0xa81c('0x62')](_0xbe59a4,function(_0x363dac){return db['CmContact'][_0xa81c('0x4d')](_['omit'](_0x363dac,['ids','id'])||{},{'fields':_['keys'](_0x291eb6),'raw':!![]})[_0xa81c('0x28')](function(_0x11bc15){_0x2bf0a9['success'][_0xa81c('0x61')](_0x11bc15[_0xa81c('0x63')]);})['catch'](function(_0x2c1850){_0x2bf0a9[_0xa81c('0x64')]['push']({'data':_0x363dac,'error':_0x2c1850[_0xa81c('0x65')]});});})['then'](function(_0x595230){return _0x2bf0a9;})[_0xa81c('0x48')](function(_0x52d17e){return _0x52d17e;});}else{_0x38e0cc['status'](0x190)[_0xa81c('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xa81c('0x28')](respondWithResult(_0x38e0cc,null))[_0xa81c('0x48')](handleError(_0x38e0cc,null));};exports[_0xa81c('0x66')]=function(_0x25eeb9,_0x51b109,_0x115425){var _0x4de6d1;return db[_0xa81c('0x43')]['find']({'where':{'id':_0x25eeb9[_0xa81c('0x4a')]['id']},'include':[{'model':db[_0xa81c('0x67')],'as':_0xa81c('0x68')}]})[_0xa81c('0x28')](handleEntityNotFound(_0x51b109,null))[_0xa81c('0x28')](function(_0x331559){if(_0x331559){_0x4de6d1=_0x331559;return db['CmContact']['rawAttributes'];}})[_0xa81c('0x28')](function(_0x25abff){if(_0x25abff){var _0x46653f={};var _0x21bc28={};_0x21bc28['model']=_[_0xa81c('0x69')](_[_0xa81c('0x34')](_0x25abff),_[_0xa81c('0x33')](_0x4de6d1[_0xa81c('0x68')],function(_0x220ac6){return util[_0xa81c('0x6a')](_0xa81c('0x6b'),_0x220ac6['id']);}));_0x21bc28['query']=_[_0xa81c('0x34')](_0x25eeb9['query']);_0x21bc28['filters']=_[_0xa81c('0x37')](_0x21bc28[_0xa81c('0x38')],_0x21bc28[_0xa81c('0x35')]);_0x46653f[_0xa81c('0x3a')]=_[_0xa81c('0x37')](_0x21bc28[_0xa81c('0x38')],qs[_0xa81c('0x39')](_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x39')]));_0x46653f[_0xa81c('0x3a')]=_0x46653f[_0xa81c('0x3a')][_0xa81c('0x4b')]?_0x46653f[_0xa81c('0x3a')]:_0x21bc28[_0xa81c('0x38')];if(!_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x5b')]('nolimit')){_0x46653f[_0xa81c('0x22')]=qs[_0xa81c('0x22')](_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x22')]);_0x46653f['offset']=qs['offset'](_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x24')]);}_0x46653f[_0xa81c('0x3c')]=qs[_0xa81c('0x3d')](_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x3d')]);_0x46653f[_0xa81c('0x3e')]=qs[_0xa81c('0x36')](_['pick'](_0x25eeb9[_0xa81c('0x35')],_0x21bc28[_0xa81c('0x36')]));_0x46653f[_0xa81c('0x6c')]=!![];if(_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x40')]){_0x46653f[_0xa81c('0x3e')]=_[_0xa81c('0x41')](_0x46653f[_0xa81c('0x3e')],{'$or':_[_0xa81c('0x33')](_0x46653f['attributes'],function(_0x2a2291){var _0x62c3c5={};_0x62c3c5[_0x2a2291]={'$like':'%'+_0x25eeb9[_0xa81c('0x35')][_0xa81c('0x40')]+'%'};return _0x62c3c5;})});}_0x46653f=_[_0xa81c('0x41')]({},_0x46653f,_0x25eeb9['options']);return _0x4de6d1[_0xa81c('0x66')](_0x46653f);}})[_0xa81c('0x28')](respondWithResult(_0x51b109,null))[_0xa81c('0x48')](handleError(_0x51b109,null));};exports[_0xa81c('0x6d')]=function(_0x18466f,_0x2b7278,_0x4612db){var _0x120cbb;return db['CmList'][_0xa81c('0x4c')]({'where':{'id':_0x18466f[_0xa81c('0x4a')]['id']},'include':[{'model':db[_0xa81c('0x67')],'as':_0xa81c('0x68')}]})['then'](handleEntityNotFound(_0x2b7278,null))[_0xa81c('0x28')](function(_0x4202cc){if(_0x4202cc){_0x120cbb=_0x4202cc;return db[_0xa81c('0x6e')]['rawAttributes'];}})[_0xa81c('0x28')](function(_0x4512ce){if(_0x4512ce){var _0x59c6a0={};var _0x3834c3={};_0x3834c3[_0xa81c('0x38')]=_[_0xa81c('0x69')](_['keys'](_0x4512ce),_[_0xa81c('0x33')](_0x120cbb[_0xa81c('0x68')],function(_0x293d0a){return util['format'](_0xa81c('0x6b'),_0x293d0a['id']);}));_0x3834c3[_0xa81c('0x35')]=_[_0xa81c('0x34')](_0x18466f['query']);_0x3834c3[_0xa81c('0x36')]=_[_0xa81c('0x37')](_0x3834c3['model'],_0x3834c3[_0xa81c('0x35')]);_0x59c6a0[_0xa81c('0x3a')]=_[_0xa81c('0x37')](_0x3834c3['model'],qs['fields'](_0x18466f[_0xa81c('0x35')]['fields']));_0x59c6a0[_0xa81c('0x3a')]=_0x59c6a0[_0xa81c('0x3a')][_0xa81c('0x4b')]?_0x59c6a0['attributes']:_0x3834c3[_0xa81c('0x38')];if(!_0x18466f['query']['hasOwnProperty'](_0xa81c('0x3b'))){_0x59c6a0['limit']=qs['limit'](_0x18466f[_0xa81c('0x35')][_0xa81c('0x22')]);_0x59c6a0[_0xa81c('0x24')]=qs['offset'](_0x18466f[_0xa81c('0x35')]['offset']);}_0x59c6a0[_0xa81c('0x3c')]=qs[_0xa81c('0x3d')](_0x18466f[_0xa81c('0x35')][_0xa81c('0x3d')]);_0x59c6a0[_0xa81c('0x3e')]=qs[_0xa81c('0x36')](_[_0xa81c('0x3f')](_0x18466f['query'],_0x3834c3[_0xa81c('0x36')]));_0x59c6a0[_0xa81c('0x6c')]=!![];if(_0x18466f[_0xa81c('0x35')][_0xa81c('0x40')]){_0x59c6a0[_0xa81c('0x3e')]=_[_0xa81c('0x41')](_0x59c6a0[_0xa81c('0x3e')],{'$or':_[_0xa81c('0x33')](_0x59c6a0[_0xa81c('0x3a')],function(_0x577542){var _0x49814e={};_0x49814e[_0x577542]={'$like':'%'+_0x18466f['query'][_0xa81c('0x40')]+'%'};return _0x49814e;})});}_0x59c6a0=_[_0xa81c('0x41')]({},_0x59c6a0,_0x18466f[_0xa81c('0x42')]);return _0x120cbb[_0xa81c('0x66')](_0x59c6a0);}})[_0xa81c('0x28')](function(_0xc5b19c){if(!_['isEmpty'](_0xc5b19c)){var _0xf72b66=toCsv(_0xc5b19c);var _0x40b66d=Date[_0xa81c('0x6f')]();fs[_0xa81c('0x70')](util[_0xa81c('0x6a')](_0xa81c('0x71'),_0x120cbb['id'],_0x40b66d),_0xf72b66);_0x2b7278['setHeader'](_0xa81c('0x72'),_0xa81c('0x73')+util[_0xa81c('0x6a')](_0xa81c('0x74'),_0x120cbb['id'],_0x40b66d));_0x2b7278[_0xa81c('0x75')](_0xa81c('0x76'),_0xa81c('0x77'));return _0x2b7278['download'](util['format']('/tmp/list_%d_%s.csv',_0x120cbb['id'],_0x40b66d));}else{return _0x2b7278[_0xa81c('0x1d')](0xcc);}})[_0xa81c('0x48')](handleError(_0x2b7278,null));};exports['addCustomField']=function(_0x59bdc2,_0x23bc7c,_0x325b5d){var _0x466dec;delete _0x59bdc2[_0xa81c('0x4e')]['id'];return db['CmList'][_0xa81c('0x5a')]({'where':{'id':_0x59bdc2[_0xa81c('0x4a')]['id']}})[_0xa81c('0x28')](handleEntityNotFound(_0x23bc7c,null))[_0xa81c('0x28')](function(_0x2690a9){if(_0x2690a9){return db['sequelize'][_0xa81c('0x78')](function(_0xa0686){return db[_0xa81c('0x67')][_0xa81c('0x4d')](_0x59bdc2[_0xa81c('0x4e')],{'transaction':_0xa0686})[_0xa81c('0x28')](function(_0x1ca4fd){_0x466dec=_0x1ca4fd;return _0x2690a9['addCustomFields'](_0x1ca4fd,{'transaction':_0xa0686});})[_0xa81c('0x28')](function(){var _0x326054={'type':db[_0xa81c('0x79')][_0xa81c('0x7a')],'transaction':_0xa0686};switch(_0x59bdc2[_0xa81c('0x4e')][_0xa81c('0x32')]){case _0xa81c('0x7b'):_0x326054[_0xa81c('0x32')]=db[_0xa81c('0x79')][_0xa81c('0x7a')];break;case'number':_0x326054[_0xa81c('0x32')]=db[_0xa81c('0x79')][_0xa81c('0x7c')];break;case _0xa81c('0x7d'):_0x326054[_0xa81c('0x32')]=db[_0xa81c('0x79')][_0xa81c('0x7e')];_0x326054['defaultValue']=![];break;default:}return db[_0xa81c('0x7f')][_0xa81c('0x80')][_0xa81c('0x81')](_0xa81c('0x82'),util['format'](_0xa81c('0x83'),_0x466dec['id']),_0x326054);})[_0xa81c('0x28')](function(){return _0x466dec;});});}})[_0xa81c('0x28')](respondWithResult(_0x23bc7c,null))[_0xa81c('0x48')](handleError(_0x23bc7c,null));};exports[_0xa81c('0x84')]=function(_0x2de33c,_0x50c644,_0x12972b){var _0x4d7548={};var _0x5f23f0={};var _0x1c6144;var _0xdfd184;return db[_0xa81c('0x43')]['findOne']({'where':{'id':_0x2de33c[_0xa81c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50c644,null))[_0xa81c('0x28')](function(_0x3a30ad){if(_0x3a30ad){_0x1c6144=_0x3a30ad;_0x5f23f0[_0xa81c('0x38')]=_[_0xa81c('0x34')](db[_0xa81c('0x67')][_0xa81c('0x30')]);_0x5f23f0[_0xa81c('0x35')]=_[_0xa81c('0x34')](_0x2de33c[_0xa81c('0x35')]);_0x5f23f0[_0xa81c('0x36')]=_[_0xa81c('0x37')](_0x5f23f0[_0xa81c('0x38')],_0x5f23f0['query']);_0x4d7548[_0xa81c('0x3a')]=_[_0xa81c('0x37')](_0x5f23f0['model'],qs[_0xa81c('0x39')](_0x2de33c[_0xa81c('0x35')]['fields']));_0x4d7548[_0xa81c('0x3a')]=_0x4d7548[_0xa81c('0x3a')][_0xa81c('0x4b')]?_0x4d7548[_0xa81c('0x3a')]:_0x5f23f0[_0xa81c('0x38')];_0x4d7548[_0xa81c('0x3c')]=qs[_0xa81c('0x3d')](_0x2de33c['query'][_0xa81c('0x3d')]);_0x4d7548[_0xa81c('0x3e')]=qs['filters'](_['pick'](_0x2de33c['query'],_0x5f23f0[_0xa81c('0x36')]));_0x4d7548[_0xa81c('0x3e')]=_[_0xa81c('0x41')](_0x4d7548['where'],{'$or':[{'ListId':_0x3a30ad['id']},{'ListId':null}]});if(_0x2de33c[_0xa81c('0x35')][_0xa81c('0x40')]){_0x4d7548[_0xa81c('0x3e')]=_[_0xa81c('0x41')](_0x4d7548[_0xa81c('0x3e')],{'$or':_[_0xa81c('0x33')](_0x4d7548[_0xa81c('0x3a')],function(_0x20abb7){var _0x52ecad={};_0x52ecad[_0x20abb7]={'$like':'%'+_0x2de33c[_0xa81c('0x35')][_0xa81c('0x40')]+'%'};return _0x52ecad;})});}_0x4d7548=_[_0xa81c('0x41')]({},_0x4d7548,_0x2de33c[_0xa81c('0x42')]);return db[_0xa81c('0x67')]['findAndCountAll'](_0x4d7548);}})[_0xa81c('0x28')](respondWithResult(_0x50c644,null))[_0xa81c('0x48')](handleError(_0x50c644,null));};exports[_0xa81c('0x85')]=function(_0x30ebf0,_0x58b173,_0x477a66){return db[_0xa81c('0x43')][_0xa81c('0x4c')]({'where':{'id':_0x30ebf0[_0xa81c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58b173,null))['then'](function(_0x4a5f2b){if(_0x4a5f2b){return _0x4a5f2b[_0xa81c('0x85')](_0x30ebf0[_0xa81c('0x4e')]['ids'],_[_0xa81c('0x86')](_0x30ebf0[_0xa81c('0x4e')],[_0xa81c('0x5d'),'id'])||{})['spread'](function(_0x647e84){for(var _0x31f80f=0x0;_0x31f80f<_0x30ebf0[_0xa81c('0x4e')]['ids'][_0xa81c('0x4b')];_0x31f80f+=0x1){socket['emit'](_0xa81c('0x87'),{'UserId':Number(_0x30ebf0[_0xa81c('0x4e')]['ids'][_0x31f80f]),'CmListId':Number(_0x30ebf0[_0xa81c('0x4a')]['id'])});}return _0x647e84;});}})['then'](respondWithResult(_0x58b173,null))[_0xa81c('0x48')](handleError(_0x58b173,null));};exports[_0xa81c('0x88')]=function(_0x485149,_0x1852fb,_0x54a0aa){return db[_0xa81c('0x43')][_0xa81c('0x4c')]({'where':{'id':_0x485149['params']['id']}})[_0xa81c('0x28')](handleEntityNotFound(_0x1852fb,null))[_0xa81c('0x28')](function(_0x5491a4){if(_0x5491a4){return _0x5491a4['removeAgents'](_0x485149[_0xa81c('0x35')][_0xa81c('0x5d')])['then'](function(){if(_[_0xa81c('0x60')](_0x485149['query']['ids'])){for(var _0x2b2042=0x0;_0x2b2042<_0x485149['query'][_0xa81c('0x5d')][_0xa81c('0x4b')];_0x2b2042+=0x1){socket[_0xa81c('0x89')](_0xa81c('0x8a'),{'UserId':Number(_0x485149[_0xa81c('0x35')][_0xa81c('0x5d')][_0x2b2042]),'CmListId':Number(_0x485149[_0xa81c('0x4a')]['id'])});}}else{socket[_0xa81c('0x89')](_0xa81c('0x8a'),{'UserId':Number(_0x485149['query'][_0xa81c('0x5d')]),'CmListId':Number(_0x485149[_0xa81c('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1852fb,null))[_0xa81c('0x48')](handleError(_0x1852fb,null));};exports['getAgents']=function(_0x2dfa4b,_0x59c91b,_0x505c2d){var _0x3bd902={};var _0xc8345a={};var _0x382fc5;var _0x6d0d05;return db[_0xa81c('0x43')][_0xa81c('0x5a')]({'where':{'id':_0x2dfa4b['params']['id']}})['then'](handleEntityNotFound(_0x59c91b,null))['then'](function(_0x4c71a0){if(_0x4c71a0){_0x382fc5=_0x4c71a0;_0xc8345a['model']=_[_0xa81c('0x34')](db[_0xa81c('0x8b')]['rawAttributes']);_0xc8345a[_0xa81c('0x35')]=_[_0xa81c('0x34')](_0x2dfa4b['query']);_0xc8345a[_0xa81c('0x36')]=_['intersection'](_0xc8345a[_0xa81c('0x38')],_0xc8345a[_0xa81c('0x35')]);_0x3bd902[_0xa81c('0x3a')]=_[_0xa81c('0x37')](_0xc8345a[_0xa81c('0x38')],qs[_0xa81c('0x39')](_0x2dfa4b['query'][_0xa81c('0x39')]));_0x3bd902[_0xa81c('0x3a')]=_0x3bd902['attributes']['length']?_0x3bd902[_0xa81c('0x3a')]:_0xc8345a['model'];_0x3bd902[_0xa81c('0x3c')]=qs[_0xa81c('0x3d')](_0x2dfa4b['query'][_0xa81c('0x3d')]);_0x3bd902['where']=qs[_0xa81c('0x36')](_[_0xa81c('0x3f')](_0x2dfa4b[_0xa81c('0x35')],_0xc8345a[_0xa81c('0x36')]));if(_0x2dfa4b[_0xa81c('0x35')][_0xa81c('0x40')]){_0x3bd902[_0xa81c('0x3e')]=_['merge'](_0x3bd902[_0xa81c('0x3e')],{'$or':_['map'](_0x3bd902[_0xa81c('0x3a')],function(_0x20c2cd){var _0x559232={};_0x559232[_0x20c2cd]={'$like':'%'+_0x2dfa4b['query']['filter']+'%'};return _0x559232;})});}_0x3bd902=_[_0xa81c('0x41')]({},_0x3bd902,_0x2dfa4b['options']);return _0x382fc5['getAgents'](_0x3bd902);}})['then'](function(_0x21ddf4){if(_0x21ddf4){_0x6d0d05=_0x21ddf4[_0xa81c('0x4b')];if(!_0x2dfa4b['query'][_0xa81c('0x5b')](_0xa81c('0x3b'))){_0x3bd902[_0xa81c('0x22')]=qs[_0xa81c('0x22')](_0x2dfa4b[_0xa81c('0x35')]['limit']);_0x3bd902['offset']=qs[_0xa81c('0x24')](_0x2dfa4b[_0xa81c('0x35')][_0xa81c('0x24')]);}return _0x382fc5[_0xa81c('0x8c')](_0x3bd902);}})[_0xa81c('0x28')](function(_0x16aca4){if(_0x16aca4){return _0x16aca4?{'count':_0x6d0d05,'rows':_0x16aca4}:null;}})[_0xa81c('0x28')](respondWithResult(_0x59c91b,null))[_0xa81c('0x48')](handleError(_0x59c91b,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 6e4d954..6127ee0 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x3014a4,_0x56b5aa){var _0x4ff3da=function(_0x17c093){while(--_0x17c093){_0x3014a4['push'](_0x3014a4['shift']());}};_0x4ff3da(++_0x56b5aa);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9b3b627..15fe00b 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 _0xd2ea=['cm_lists','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList'];(function(_0x4131da,_0x124783){var _0x583242=function(_0x4c899f){while(--_0x4c899f){_0x4131da['push'](_0x4131da['shift']());}};_0x583242(++_0x124783);}(_0xd2ea,0x15f));var _0xad2e=function(_0x274ee3,_0x21eb7b){_0x274ee3=_0x274ee3-0x0;var _0x22b253=_0xd2ea[_0x274ee3];return _0x22b253;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec56=['define','CmList','cm_lists','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x25e812,_0x1342a2){var _0x727c56=function(_0x243b79){while(--_0x243b79){_0x25e812['push'](_0x25e812['shift']());}};_0x727c56(++_0x1342a2);}(_0xec56,0x1bd));var _0x6ec5=function(_0x6679d6,_0x2027a4){_0x6679d6=_0x6679d6-0x0;var _0x280beb=_0xec56[_0x6679d6];return _0x280beb;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'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 8f1529a..2764c9b 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 _0x1ad6=['client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x38e591,_0x8ee45e){var _0x1c3a4e=function(_0x3f23be){while(--_0x3f23be){_0x38e591['push'](_0x38e591['shift']());}};_0x1c3a4e(++_0x8ee45e);}(_0x1ad6,0x147));var _0x61ad=function(_0xb65f5e,_0x63e53f){_0xb65f5e=_0xb65f5e-0x0;var _0xbe7630=_0x1ad6[_0xb65f5e];return _0xbe7630;};'use strict';var _=require(_0x61ad('0x0'));var util=require(_0x61ad('0x1'));var moment=require(_0x61ad('0x2'));var BPromise=require(_0x61ad('0x3'));var rs=require(_0x61ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61ad('0x5'))['db'];var utils=require(_0x61ad('0x6'));var logger=require('../../config/logger')(_0x61ad('0x7'));var config=require(_0x61ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x61ad('0x9')][_0x61ad('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x61ad('0xb')],{'host':_0x61ad('0xc'),'port':0x18eb});var socket=require(_0x61ad('0xd'))(new Redis(config['redis']));require(_0x61ad('0xe'))[_0x61ad('0xf')](socket);function respondWithRpcPromise(_0x61362,_0x2cecac,_0x5dee04){return new BPromise(function(_0xbb2777,_0x30a02c){return client[_0x61ad('0x10')](_0x61362,_0x5dee04)[_0x61ad('0x11')](function(_0x4c5ca4){logger[_0x61ad('0x12')](_0x61ad('0x13'),_0x2cecac,_0x61ad('0x14'));logger[_0x61ad('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x2cecac,_0x61ad('0x14'),JSON['stringify'](_0x4c5ca4));if(_0x4c5ca4[_0x61ad('0x16')]){if(_0x4c5ca4['error']['code']===0x1f4){logger[_0x61ad('0x16')](_0x61ad('0x13'),_0x2cecac,_0x4c5ca4[_0x61ad('0x16')][_0x61ad('0x17')]);return _0x30a02c(_0x4c5ca4[_0x61ad('0x16')][_0x61ad('0x17')]);}logger[_0x61ad('0x16')]('CmList,\x20%s,\x20%s',_0x2cecac,_0x4c5ca4['error'][_0x61ad('0x17')]);return _0xbb2777(_0x4c5ca4['error']['message']);}else{logger['info'](_0x61ad('0x13'),_0x2cecac,'request\x20sent');_0xbb2777(_0x4c5ca4['result'][_0x61ad('0x17')]);}})['catch'](function(_0x12016c){logger[_0x61ad('0x16')](_0x61ad('0x13'),_0x2cecac,_0x12016c);_0x30a02c(_0x12016c);});});} \ No newline at end of file +var _0x701a=['message','info','result','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x34500d,_0x104432){var _0x36a780=function(_0x1e5e82){while(--_0x1e5e82){_0x34500d['push'](_0x34500d['shift']());}};_0x36a780(++_0x104432);}(_0x701a,0x1cb));var _0xa701=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0x701a[_0x3c81b5];return _0x5888c4;};'use strict';var _=require(_0xa701('0x0'));var util=require(_0xa701('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa701('0x2'))['db'];var utils=require(_0xa701('0x3'));var logger=require(_0xa701('0x4'))(_0xa701('0x5'));var config=require(_0xa701('0x6'));var jayson=require(_0xa701('0x7'));var client=jayson[_0xa701('0x8')][_0xa701('0x9')]({'port':0x232a});config[_0xa701('0xa')]=_['defaults'](config['redis'],{'host':_0xa701('0xb'),'port':0x18eb});var socket=require(_0xa701('0xc'))(new Redis(config[_0xa701('0xa')]));require(_0xa701('0xd'))[_0xa701('0xe')](socket);function respondWithRpcPromise(_0xcc5e2e,_0x1d3ef6,_0x23cb78){return new BPromise(function(_0x2bf1d1,_0x489914){return client['request'](_0xcc5e2e,_0x23cb78)[_0xa701('0xf')](function(_0x7b0ef7){logger['info'](_0xa701('0x10'),_0x1d3ef6,_0xa701('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x1d3ef6,'request\x20sent',JSON[_0xa701('0x12')](_0x7b0ef7));if(_0x7b0ef7[_0xa701('0x13')]){if(_0x7b0ef7['error'][_0xa701('0x14')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x1d3ef6,_0x7b0ef7['error']['message']);return _0x489914(_0x7b0ef7[_0xa701('0x13')][_0xa701('0x15')]);}logger[_0xa701('0x13')](_0xa701('0x10'),_0x1d3ef6,_0x7b0ef7['error']['message']);return _0x2bf1d1(_0x7b0ef7[_0xa701('0x13')][_0xa701('0x15')]);}else{logger[_0xa701('0x16')](_0xa701('0x10'),_0x1d3ef6,'request\x20sent');_0x2bf1d1(_0x7b0ef7[_0xa701('0x17')][_0xa701('0x15')]);}})['catch'](function(_0x49f6ab){logger[_0xa701('0x13')](_0xa701('0x10'),_0x1d3ef6,_0x49f6ab);_0x489914(_0x49f6ab);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7c3e10f..f6df256 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 _0xa031=['save','remove','update','removeListener','register','cmList:','./cmList.events'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0xa031,0x7d));var _0x1a03=function(_0x2a6983,_0x356502){_0x2a6983=_0x2a6983-0x0;var _0x15dc29=_0xa031[_0x2a6983];return _0x15dc29;};'use strict';var CmListEvents=require(_0x1a03('0x0'));var events=[_0x1a03('0x1'),_0x1a03('0x2'),_0x1a03('0x3')];function createListener(_0x10b89e,_0x28d046){return function(_0x4c9713){_0x28d046['emit'](_0x10b89e,_0x4c9713);};}function removeListener(_0x4818b6,_0x4b719d){return function(){CmListEvents[_0x1a03('0x4')](_0x4818b6,_0x4b719d);};}exports[_0x1a03('0x5')]=function(_0x29c1db){for(var _0x7b32cc=0x0,_0x1b2a65=events['length'];_0x7b32cc<_0x1b2a65;_0x7b32cc++){var _0x28351a=events[_0x7b32cc];var _0x5db09c=createListener(_0x1a03('0x6')+_0x28351a,_0x29c1db);CmListEvents['on'](_0x28351a,_0x5db09c);}}; \ No newline at end of file +var _0x8f2e=['removeListener','register','length','./cmList.events','remove','update','emit'];(function(_0x2bc630,_0x54bb4d){var _0x34fb25=function(_0x10f9bc){while(--_0x10f9bc){_0x2bc630['push'](_0x2bc630['shift']());}};_0x34fb25(++_0x54bb4d);}(_0x8f2e,0x1c3));var _0xe8f2=function(_0xcc2ce1,_0x1175fa){_0xcc2ce1=_0xcc2ce1-0x0;var _0x35e8f1=_0x8f2e[_0xcc2ce1];return _0x35e8f1;};'use strict';var CmListEvents=require(_0xe8f2('0x0'));var events=['save',_0xe8f2('0x1'),_0xe8f2('0x2')];function createListener(_0x21d7b4,_0x35631f){return function(_0x541516){_0x35631f[_0xe8f2('0x3')](_0x21d7b4,_0x541516);};}function removeListener(_0x2afed1,_0x4c26cc){return function(){CmListEvents[_0xe8f2('0x4')](_0x2afed1,_0x4c26cc);};}exports[_0xe8f2('0x5')]=function(_0x3d5635){for(var _0xdd35fc=0x0,_0x25530f=events[_0xe8f2('0x6')];_0xdd35fc<_0x25530f;_0xdd35fc++){var _0x581816=events[_0xdd35fc];var _0xa31904=createListener('cmList:'+_0x581816,_0x3d5635);CmListEvents['on'](_0x581816,_0xa31904);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 4756632..f6d68a8 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 _0x1c99=['get','isAuthenticated','/describe','/:id','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','addContacts','addAgents','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x1c99,0x66));var _0x91c9=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x1c99[_0x125ff8];return _0x2d9ef;};'use strict';var multer=require(_0x91c9('0x0'));var util=require(_0x91c9('0x1'));var path=require(_0x91c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x91c9('0x3'));var router=express[_0x91c9('0x4')]();var fs_extra=require(_0x91c9('0x5'));var auth=require(_0x91c9('0x6'));var interaction=require(_0x91c9('0x7'));var config=require(_0x91c9('0x8'));var controller=require(_0x91c9('0x9'));router[_0x91c9('0xa')]('/',auth[_0x91c9('0xb')](),controller['index']);router[_0x91c9('0xa')](_0x91c9('0xc'),auth[_0x91c9('0xb')](),controller['describe']);router[_0x91c9('0xa')](_0x91c9('0xd'),auth[_0x91c9('0xb')](),controller['show']);router[_0x91c9('0xa')]('/:id/dispositions',auth[_0x91c9('0xb')](),controller[_0x91c9('0xe')]);router[_0x91c9('0xa')](_0x91c9('0xf'),auth['isAuthenticated'](),controller[_0x91c9('0x10')]);router[_0x91c9('0xa')](_0x91c9('0x11'),auth[_0x91c9('0xb')](),controller[_0x91c9('0x12')]);router[_0x91c9('0xa')]('/:id/fields',auth[_0x91c9('0xb')](),controller[_0x91c9('0x13')]);router[_0x91c9('0xa')](_0x91c9('0x14'),auth[_0x91c9('0xb')](),controller['getAgents']);router[_0x91c9('0x15')]('/',auth[_0x91c9('0xb')](),controller[_0x91c9('0x16')]);router[_0x91c9('0x15')](_0x91c9('0x17'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x91c9('0x15')](_0x91c9('0xf'),auth[_0x91c9('0xb')](),controller[_0x91c9('0x18')]);router[_0x91c9('0x15')]('/:id/fields',auth['isAuthenticated'](),controller['addCustomField']);router[_0x91c9('0x15')](_0x91c9('0x14'),auth[_0x91c9('0xb')](),controller[_0x91c9('0x19')]);router[_0x91c9('0x1a')](_0x91c9('0xd'),auth[_0x91c9('0xb')](),controller['update']);router[_0x91c9('0x1b')](_0x91c9('0xd'),auth[_0x91c9('0xb')](),controller['destroy']);router[_0x91c9('0x1b')](_0x91c9('0x17'),auth[_0x91c9('0xb')](),controller['removeDispositions']);router[_0x91c9('0x1b')](_0x91c9('0x14'),auth[_0x91c9('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2f9f=['removeDispositions','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addCustomField','addAgents','put','delete','destroy'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0x2f9f,0xf0));var _0xf2f9=function(_0x5ae46a,_0x2943e4){_0x5ae46a=_0x5ae46a-0x0;var _0x428fd0=_0x2f9f[_0x5ae46a];return _0x428fd0;};'use strict';var multer=require('multer');var util=require(_0xf2f9('0x0'));var path=require(_0xf2f9('0x1'));var timeout=require(_0xf2f9('0x2'));var express=require(_0xf2f9('0x3'));var router=express[_0xf2f9('0x4')]();var fs_extra=require(_0xf2f9('0x5'));var auth=require(_0xf2f9('0x6'));var interaction=require(_0xf2f9('0x7'));var config=require(_0xf2f9('0x8'));var controller=require(_0xf2f9('0x9'));router[_0xf2f9('0xa')]('/',auth[_0xf2f9('0xb')](),controller[_0xf2f9('0xc')]);router[_0xf2f9('0xa')]('/describe',auth[_0xf2f9('0xb')](),controller['describe']);router[_0xf2f9('0xa')](_0xf2f9('0xd'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0xe')]);router['get']('/:id/dispositions',auth[_0xf2f9('0xb')](),controller[_0xf2f9('0xf')]);router[_0xf2f9('0xa')](_0xf2f9('0x10'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x11')]);router[_0xf2f9('0xa')](_0xf2f9('0x12'),auth[_0xf2f9('0xb')](),controller['getContactsCsv']);router[_0xf2f9('0xa')](_0xf2f9('0x13'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x14')]);router['get'](_0xf2f9('0x15'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x16')]);router[_0xf2f9('0x17')]('/',auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x18')]);router[_0xf2f9('0x17')](_0xf2f9('0x19'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x1a')]);router[_0xf2f9('0x17')](_0xf2f9('0x10'),auth[_0xf2f9('0xb')](),controller['addContacts']);router[_0xf2f9('0x17')](_0xf2f9('0x13'),auth['isAuthenticated'](),controller[_0xf2f9('0x1b')]);router[_0xf2f9('0x17')](_0xf2f9('0x15'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x1c')]);router[_0xf2f9('0x1d')](_0xf2f9('0xd'),auth[_0xf2f9('0xb')](),controller['update']);router[_0xf2f9('0x1e')](_0xf2f9('0xd'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x1f')]);router[_0xf2f9('0x1e')](_0xf2f9('0x19'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x20')]);router[_0xf2f9('0x1e')](_0xf2f9('0x15'),auth[_0xf2f9('0xb')](),controller[_0xf2f9('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 52f6ca8..4ba70ef 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 _0x0f93=['VIRTUAL','getDataValue','field','STRING','exports'];(function(_0xddee98,_0x50d312){var _0x108d97=function(_0x446dd8){while(--_0x446dd8){_0xddee98['push'](_0xddee98['shift']());}};_0x108d97(++_0x50d312);}(_0x0f93,0x176));var _0x30f9=function(_0x1ea324,_0x1926ee){_0x1ea324=_0x1ea324-0x0;var _0x2505d5=_0x0f93[_0x1ea324];return _0x2505d5;};'use strict';var Sequelize=require('sequelize');module[_0x30f9('0x0')]={'name':{'type':Sequelize[_0x30f9('0x1')],'get':function(_0x24f54c){return this[_0x30f9('0x2')](_0x30f9('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x30f9('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2622=['STRING','sequelize','VIRTUAL'];(function(_0x529f1c,_0x437ed1){var _0x4d57ab=function(_0x39d479){while(--_0x39d479){_0x529f1c['push'](_0x529f1c['shift']());}};_0x4d57ab(++_0x437ed1);}(_0x2622,0x1a8));var _0x2262=function(_0x42189f,_0x2dada5){_0x42189f=_0x42189f-0x0;var _0x36de9f=_0x2622[_0x42189f];return _0x36de9f;};'use strict';var Sequelize=require(_0x2262('0x0'));module['exports']={'name':{'type':Sequelize[_0x2262('0x1')],'get':function(_0x3d9736){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x2262('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x2262('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2262('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index b2c2f08..73df4a6 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x33615d,_0x4ef7b6){var _0x577d36=function(_0x2c69b0){while(--_0x2c69b0){_0x33615d['push'](_0x33615d['shift']());}};_0x577d36(++_0x4ef7b6);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x1540b1,_0x1b9909){var _0x302dac=function(_0x35605a){while(--_0x35605a){_0x1540b1['push'](_0x1540b1['shift']());}};_0x302dac(++_0x1b9909);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8f46938..dc07ee3 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 _0x2ae9=['bluebird','path','../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','../../config/logger','api','moment'];(function(_0x44e9b4,_0x47ce85){var _0x3381e2=function(_0x1b5e71){while(--_0x1b5e71){_0x44e9b4['push'](_0x44e9b4['shift']());}};_0x3381e2(++_0x47ce85);}(_0x2ae9,0xe3));var _0x92ae=function(_0x3666dc,_0x18701a){_0x3666dc=_0x3666dc-0x0;var _0x31c942=_0x2ae9[_0x3666dc];return _0x31c942;};'use strict';var _=require(_0x92ae('0x0'));var util=require('util');var logger=require(_0x92ae('0x1'))(_0x92ae('0x2'));var moment=require(_0x92ae('0x3'));var BPromise=require(_0x92ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92ae('0x5'));var rimraf=require('rimraf');var config=require(_0x92ae('0x6'));var attributes=require(_0x92ae('0x7'));module[_0x92ae('0x8')]=function(_0x14bc14,_0x4313b4){return _0x14bc14[_0x92ae('0x9')]('Condition',attributes,{'tableName':_0x92ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f86=['../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','Condition','util'];(function(_0x5767ee,_0x5ecd89){var _0x2f94c5=function(_0x598076){while(--_0x598076){_0x5767ee['push'](_0x5767ee['shift']());}};_0x2f94c5(++_0x5ecd89);}(_0x9f86,0xdf));var _0x69f8=function(_0x52c651,_0x4c1f4e){_0x52c651=_0x52c651-0x0;var _0x525ceb=_0x9f86[_0x52c651];return _0x525ceb;};'use strict';var _=require('lodash');var util=require(_0x69f8('0x0'));var logger=require(_0x69f8('0x1'))('api');var moment=require(_0x69f8('0x2'));var BPromise=require(_0x69f8('0x3'));var rp=require(_0x69f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x69f8('0x5'));var attributes=require('./condition.attributes');module[_0x69f8('0x6')]=function(_0x4a4f9c,_0x1032e9){return _0x4a4f9c['define'](_0x69f8('0x7'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 81d9a4a..2f10d3e 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 _0xfb9a=['util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x222524,_0x7a5cd){var _0x1d8b5c=function(_0x4d4309){while(--_0x4d4309){_0x222524['push'](_0x222524['shift']());}};_0x1d8b5c(++_0x7a5cd);}(_0xfb9a,0x1b8));var _0xafb9=function(_0x1694c8,_0x3f04ae){_0x1694c8=_0x1694c8-0x0;var _0xebb521=_0xfb9a[_0x1694c8];return _0xebb521;};'use strict';var _=require(_0xafb9('0x0'));var util=require(_0xafb9('0x1'));var moment=require(_0xafb9('0x2'));var BPromise=require(_0xafb9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafb9('0x4'));var db=require(_0xafb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xafb9('0x6'));var config=require(_0xafb9('0x7'));var jayson=require(_0xafb9('0x8'));var client=jayson[_0xafb9('0x9')][_0xafb9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e090,_0x2304df,_0x4e9f37){return new BPromise(function(_0x12f99a,_0x1e93da){return client[_0xafb9('0xb')](_0x45e090,_0x4e9f37)['then'](function(_0xa9b778){logger[_0xafb9('0xc')](_0xafb9('0xd'),_0x2304df,_0xafb9('0xe'));logger[_0xafb9('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x2304df,_0xafb9('0xe'),JSON[_0xafb9('0x10')](_0xa9b778));if(_0xa9b778[_0xafb9('0x11')]){if(_0xa9b778[_0xafb9('0x11')][_0xafb9('0x12')]===0x1f4){logger['error'](_0xafb9('0xd'),_0x2304df,_0xa9b778['error'][_0xafb9('0x13')]);return _0x1e93da(_0xa9b778[_0xafb9('0x11')][_0xafb9('0x13')]);}logger['error'](_0xafb9('0xd'),_0x2304df,_0xa9b778[_0xafb9('0x11')][_0xafb9('0x13')]);return _0x12f99a(_0xa9b778['error'][_0xafb9('0x13')]);}else{logger[_0xafb9('0xc')]('Condition,\x20%s,\x20%s',_0x2304df,_0xafb9('0xe'));_0x12f99a(_0xa9b778[_0xafb9('0x14')][_0xafb9('0x13')]);}})['catch'](function(_0x24de9f){logger[_0xafb9('0x11')](_0xafb9('0xd'),_0x2304df,_0x24de9f);_0x1e93da(_0x24de9f);});});} \ No newline at end of file +var _0x84da=['then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5dd818,_0x93cb5d){var _0x44b3a3=function(_0x5d3bcc){while(--_0x5d3bcc){_0x5dd818['push'](_0x5dd818['shift']());}};_0x44b3a3(++_0x93cb5d);}(_0x84da,0x1ae));var _0xa84d=function(_0x46f647,_0x33ee02){_0x46f647=_0x46f647-0x0;var _0x4e1af9=_0x84da[_0x46f647];return _0x4e1af9;};'use strict';var _=require(_0xa84d('0x0'));var util=require('util');var moment=require(_0xa84d('0x1'));var BPromise=require('bluebird');var rs=require(_0xa84d('0x2'));var fs=require('fs');var Redis=require(_0xa84d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa84d('0x4'));var logger=require('../../config/logger')(_0xa84d('0x5'));var config=require(_0xa84d('0x6'));var jayson=require(_0xa84d('0x7'));var client=jayson[_0xa84d('0x8')][_0xa84d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x514a9c,_0x3457cb,_0x5d9a51){return new BPromise(function(_0x4ad1b3,_0x3310d8){return client['request'](_0x514a9c,_0x5d9a51)[_0xa84d('0xa')](function(_0x48d69a){logger[_0xa84d('0xb')](_0xa84d('0xc'),_0x3457cb,'request\x20sent');logger[_0xa84d('0xd')](_0xa84d('0xe'),_0x3457cb,'request\x20sent',JSON[_0xa84d('0xf')](_0x48d69a));if(_0x48d69a[_0xa84d('0x10')]){if(_0x48d69a[_0xa84d('0x10')]['code']===0x1f4){logger[_0xa84d('0x10')](_0xa84d('0xc'),_0x3457cb,_0x48d69a[_0xa84d('0x10')]['message']);return _0x3310d8(_0x48d69a[_0xa84d('0x10')][_0xa84d('0x11')]);}logger['error'](_0xa84d('0xc'),_0x3457cb,_0x48d69a[_0xa84d('0x10')][_0xa84d('0x11')]);return _0x4ad1b3(_0x48d69a['error']['message']);}else{logger[_0xa84d('0xb')]('Condition,\x20%s,\x20%s',_0x3457cb,_0xa84d('0x12'));_0x4ad1b3(_0x48d69a[_0xa84d('0x13')][_0xa84d('0x11')]);}})['catch'](function(_0x27821c){logger[_0xa84d('0x10')](_0xa84d('0xc'),_0x3457cb,_0x27821c);_0x3310d8(_0x27821c);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 93c630c..fe7fe03 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 _0x761e=['put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./condition.controller'];(function(_0x5dd23d,_0x21a586){var _0x2284cf=function(_0x148286){while(--_0x148286){_0x5dd23d['push'](_0x5dd23d['shift']());}};_0x2284cf(++_0x21a586);}(_0x761e,0xc9));var _0xe761=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x761e[_0x412e27];return _0x53da42;};'use strict';var multer=require(_0xe761('0x0'));var util=require(_0xe761('0x1'));var path=require(_0xe761('0x2'));var timeout=require(_0xe761('0x3'));var express=require(_0xe761('0x4'));var router=express[_0xe761('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe761('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe761('0x7'));var controller=require(_0xe761('0x8'));router[_0xe761('0x9')](_0xe761('0xa'),auth[_0xe761('0xb')](),controller[_0xe761('0xc')]);router[_0xe761('0xd')](_0xe761('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe761('0xe')]=router; \ No newline at end of file +var _0x081d=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','update','delete','destroy'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x081d,0x152));var _0xd081=function(_0x4fa738,_0x2a491c){_0x4fa738=_0x4fa738-0x0;var _0x55bf55=_0x081d[_0x4fa738];return _0x55bf55;};'use strict';var multer=require(_0xd081('0x0'));var util=require(_0xd081('0x1'));var path=require(_0xd081('0x2'));var timeout=require(_0xd081('0x3'));var express=require('express');var router=express[_0xd081('0x4')]();var fs_extra=require(_0xd081('0x5'));var auth=require(_0xd081('0x6'));var interaction=require(_0xd081('0x7'));var config=require('../../config/environment');var controller=require(_0xd081('0x8'));router[_0xd081('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd081('0xa')]);router[_0xd081('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xd081('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 90550af..1f6b1a6 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 _0xd8b0=['exports','sequelize'];(function(_0x2540b7,_0x53e961){var _0x138e6e=function(_0x208f02){while(--_0x208f02){_0x2540b7['push'](_0x2540b7['shift']());}};_0x138e6e(++_0x53e961);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xb7e7[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index afb864f..348b11a 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 _0x994e=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','update','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','pick','getItems','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','attributes','find','create','body','user'];(function(_0x51af50,_0x3d5c0b){var _0x415302=function(_0x1501d8){while(--_0x1501d8){_0x51af50['push'](_0x51af50['shift']());}};_0x415302(++_0x3d5c0b);}(_0x994e,0x19e));var _0xe994=function(_0x2dc7eb,_0x330655){_0x2dc7eb=_0x2dc7eb-0x0;var _0x18f922=_0x994e[_0x2dc7eb];return _0x18f922;};'use strict';var emlformat=require(_0xe994('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe994('0x1'));var jsonpatch=require(_0xe994('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe994('0x3'));var Mustache=require(_0xe994('0x4'));var util=require(_0xe994('0x5'));var path=require(_0xe994('0x6'));var sox=require(_0xe994('0x7'));var csv=require(_0xe994('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe994('0x9'));var crypto=require(_0xe994('0xa'));var jsforce=require(_0xe994('0xb'));var deskjs=require(_0xe994('0xc'));var toCsv=require(_0xe994('0x8'));var querystring=require('querystring');var Papa=require(_0xe994('0xd'));var Redis=require('ioredis');var authService=require(_0xe994('0xe'));var qs=require(_0xe994('0xf'));var as=require(_0xe994('0x10'));var hardwareService=require(_0xe994('0x11'));var logger=require(_0xe994('0x12'))(_0xe994('0x13'));var utils=require(_0xe994('0x14'));var config=require(_0xe994('0x15'));var licenseUtil=require(_0xe994('0x16'));var db=require(_0xe994('0x17'))['db'];config[_0xe994('0x18')]=_[_0xe994('0x19')](config[_0xe994('0x18')],{'host':_0xe994('0x1a'),'port':0x18eb});var socket=require(_0xe994('0x1b'))(new Redis(config['redis']));require(_0xe994('0x1c'))[_0xe994('0x1d')](socket);function respondWithStatusCode(_0x505d05,_0x4bddee){_0x4bddee=_0x4bddee||0xcc;return function(_0x40b28a){if(_0x40b28a){return _0x505d05['sendStatus'](_0x4bddee);}return _0x505d05[_0xe994('0x1e')](_0x4bddee)['end']();};}function respondWithResult(_0x23b44b,_0x242f51){_0x242f51=_0x242f51||0xc8;return function(_0x1adac3){if(_0x1adac3){return _0x23b44b[_0xe994('0x1e')](_0x242f51)[_0xe994('0x1f')](_0x1adac3);}};}function respondWithFilteredResult(_0x35e2ae,_0x5ec920){return function(_0x519f1c){if(_0x519f1c){var _0x24a193=typeof _0x5ec920[_0xe994('0x20')]===_0xe994('0x21')&&typeof _0x5ec920[_0xe994('0x22')]===_0xe994('0x21');var _0x9a90e3=_0x519f1c[_0xe994('0x23')];var _0x1587dc=_0x24a193?0x0:_0x5ec920[_0xe994('0x20')];var _0x4a8f9d=_0x24a193?_0x519f1c[_0xe994('0x23')]:_0x5ec920[_0xe994('0x20')]+_0x5ec920[_0xe994('0x22')];var _0x3aac7f;if(_0x4a8f9d>=_0x9a90e3){_0x4a8f9d=_0x9a90e3;_0x3aac7f=0xc8;}else{_0x3aac7f=0xce;}_0x35e2ae['status'](_0x3aac7f);return _0x35e2ae[_0xe994('0x24')]('Content-Range',_0x1587dc+'-'+_0x4a8f9d+'/'+_0x9a90e3)[_0xe994('0x1f')](_0x519f1c);}return null;};}function patchUpdates(_0xe2ca16){return function(_0x2c05d6){try{jsonpatch[_0xe994('0x25')](_0x2c05d6,_0xe2ca16,!![]);}catch(_0x11eb1b){return BPromise[_0xe994('0x26')](_0x11eb1b);}return _0x2c05d6[_0xe994('0x27')]();};}function saveUpdates(_0x384cf1,_0x1202a0){return function(_0x52bd33){if(_0x52bd33){return _0x52bd33['update'](_0x384cf1)[_0xe994('0x28')](function(_0x5f1a4d){return _0x5f1a4d;});}return null;};}function removeEntity(_0x12907c,_0x3bd09a){return function(_0x112b41){if(_0x112b41){return _0x112b41[_0xe994('0x29')]()[_0xe994('0x28')](function(){var _0x5eb254=_0x112b41[_0xe994('0x2a')]({'plain':!![]});var _0x25c98c=_0xe994('0x2b');return db[_0xe994('0x2c')]['destroy']({'where':{'type':_0x25c98c,'resourceId':_0x5eb254['id']}})[_0xe994('0x28')](function(){return _0x112b41;});})[_0xe994('0x28')](function(){_0x12907c[_0xe994('0x1e')](0xcc)[_0xe994('0x2d')]();});}};}function handleEntityNotFound(_0x149f5f,_0x481c67){return function(_0x298db4){if(!_0x298db4){_0x149f5f['sendStatus'](0x194);}return _0x298db4;};}function handleError(_0x55eedf,_0x58f720){_0x58f720=_0x58f720||0x1f4;return function(_0x47705b){logger[_0xe994('0x2e')](_0x47705b['stack']);if(_0x47705b[_0xe994('0x2f')]){delete _0x47705b['name'];}_0x55eedf[_0xe994('0x1e')](_0x58f720)[_0xe994('0x30')](_0x47705b);};}exports[_0xe994('0x31')]=function(_0x521af2,_0x5ba8ed){var _0x454a8d={},_0x53dbdf={},_0x177b28={'count':0x0,'rows':[]};var _0x4199a1=_[_0xe994('0x32')](db[_0xe994('0x33')][_0xe994('0x34')],function(_0x5e1e64){return{'name':_0x5e1e64[_0xe994('0x35')],'type':_0x5e1e64['type'][_0xe994('0x36')]};});_0x53dbdf[_0xe994('0x37')]=_[_0xe994('0x32')](_0x4199a1,_0xe994('0x2f'));_0x53dbdf[_0xe994('0x38')]=_[_0xe994('0x39')](_0x521af2['query']);_0x53dbdf[_0xe994('0x3a')]=_['intersection'](_0x53dbdf[_0xe994('0x37')],_0x53dbdf[_0xe994('0x38')]);_0x454a8d['attributes']=_[_0xe994('0x3b')](_0x53dbdf['model'],qs[_0xe994('0x3c')](_0x521af2['query'][_0xe994('0x3c')]));_0x454a8d['attributes']=_0x454a8d['attributes'][_0xe994('0x3d')]?_0x454a8d['attributes']:_0x53dbdf[_0xe994('0x37')];if(!_0x521af2[_0xe994('0x38')][_0xe994('0x3e')](_0xe994('0x3f'))){_0x454a8d[_0xe994('0x22')]=qs[_0xe994('0x22')](_0x521af2[_0xe994('0x38')]['limit']);_0x454a8d[_0xe994('0x20')]=qs[_0xe994('0x20')](_0x521af2[_0xe994('0x38')][_0xe994('0x20')]);}_0x454a8d[_0xe994('0x40')]=qs[_0xe994('0x41')](_0x521af2[_0xe994('0x38')][_0xe994('0x41')]);_0x454a8d[_0xe994('0x42')]=qs[_0xe994('0x3a')](_['pick'](_0x521af2[_0xe994('0x38')],_0x53dbdf[_0xe994('0x3a')]),_0x4199a1);if(_0x521af2[_0xe994('0x38')][_0xe994('0x43')]){_0x454a8d[_0xe994('0x42')]=_[_0xe994('0x44')](_0x454a8d[_0xe994('0x42')],{'$or':_['map'](_0x4199a1,function(_0x58a1cd){if(_0x58a1cd[_0xe994('0x45')]!=='VIRTUAL'){var _0x41f708={};_0x41f708[_0x58a1cd[_0xe994('0x2f')]]={'$like':'%'+_0x521af2[_0xe994('0x38')][_0xe994('0x43')]+'%'};return _0x41f708;}})});}_0x454a8d=_[_0xe994('0x44')]({},_0x454a8d,_0x521af2[_0xe994('0x46')]);var _0x35942d={'where':_0x454a8d[_0xe994('0x42')]};return db['Dashboard']['count'](_0x35942d)[_0xe994('0x28')](function(_0x21230c){_0x177b28[_0xe994('0x23')]=_0x21230c;if(_0x521af2[_0xe994('0x38')][_0xe994('0x47')]){_0x454a8d[_0xe994('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xe994('0x49')](_0x454a8d);})[_0xe994('0x28')](function(_0x376d42){_0x177b28['rows']=_0x376d42;return _0x177b28;})[_0xe994('0x28')](respondWithFilteredResult(_0x5ba8ed,_0x454a8d))[_0xe994('0x4a')](handleError(_0x5ba8ed,null));};exports[_0xe994('0x4b')]=function(_0x30e438,_0x43b2f9){var _0x27bfbf={'raw':![],'where':{'id':_0x30e438[_0xe994('0x4c')]['id']}},_0xb338c={};_0xb338c[_0xe994('0x37')]=_[_0xe994('0x39')](db[_0xe994('0x33')][_0xe994('0x34')]);_0xb338c['query']=_[_0xe994('0x39')](_0x30e438[_0xe994('0x38')]);_0xb338c[_0xe994('0x3a')]=_[_0xe994('0x3b')](_0xb338c[_0xe994('0x37')],_0xb338c[_0xe994('0x38')]);_0x27bfbf['attributes']=_['intersection'](_0xb338c[_0xe994('0x37')],qs['fields'](_0x30e438[_0xe994('0x38')][_0xe994('0x3c')]));_0x27bfbf[_0xe994('0x4d')]=_0x27bfbf[_0xe994('0x4d')][_0xe994('0x3d')]?_0x27bfbf[_0xe994('0x4d')]:_0xb338c['model'];if(_0x30e438[_0xe994('0x38')][_0xe994('0x47')]){_0x27bfbf[_0xe994('0x48')]=[{'all':!![]}];}_0x27bfbf=_[_0xe994('0x44')]({},_0x27bfbf,_0x30e438[_0xe994('0x46')]);return db['Dashboard'][_0xe994('0x4e')](_0x27bfbf)[_0xe994('0x28')](handleEntityNotFound(_0x43b2f9,null))[_0xe994('0x28')](respondWithResult(_0x43b2f9,null))[_0xe994('0x4a')](handleError(_0x43b2f9,null));};exports[_0xe994('0x4f')]=function(_0x1be429,_0x892300){return db['Dashboard'][_0xe994('0x4f')](_0x1be429[_0xe994('0x50')],{})[_0xe994('0x28')](function(_0x267a03){var _0x4dc8bf=_0x1be429[_0xe994('0x51')][_0xe994('0x2a')]({'plain':!![]});if(!_0x4dc8bf)throw new Error(_0xe994('0x52'));if(_0x4dc8bf[_0xe994('0x53')]===_0xe994('0x51')){var _0x34b5ea=_0x267a03[_0xe994('0x2a')]({'plain':!![]});var _0x260341=_0xe994('0x2b');return db[_0xe994('0x54')]['find']({'where':{'name':_0x260341,'userProfileId':_0x4dc8bf[_0xe994('0x55')]},'raw':!![]})[_0xe994('0x28')](function(_0xa2fa00){if(_0xa2fa00&&_0xa2fa00['autoAssociation']===0x0){return db[_0xe994('0x2c')][_0xe994('0x4f')]({'name':_0x34b5ea[_0xe994('0x2f')],'resourceId':_0x34b5ea['id'],'type':_0xa2fa00[_0xe994('0x2f')],'sectionId':_0xa2fa00['id']},{})['then'](function(){return _0x267a03;});}else{return _0x267a03;}})['catch'](function(_0x62a8f3){logger['error'](_0xe994('0x56'),_0x62a8f3);throw _0x62a8f3;});}return _0x267a03;})['then'](respondWithResult(_0x892300,0xc9))[_0xe994('0x4a')](handleError(_0x892300,null));};exports[_0xe994('0x57')]=function(_0x24a352,_0x38f27a){var _0x209d3d={'where':{'id':_0x24a352[_0xe994('0x4c')]['id']}},_0x4dd88a={};_0x4dd88a[_0xe994('0x37')]=_[_0xe994('0x39')](db['Dashboard'][_0xe994('0x34')]);_0x209d3d[_0xe994('0x4d')]=_[_0xe994('0x3b')](_0x4dd88a[_0xe994('0x37')],qs[_0xe994('0x3c')](_0x24a352['query'][_0xe994('0x3c')]));_0x209d3d['attributes']=_0x209d3d[_0xe994('0x4d')]['length']?_0x209d3d[_0xe994('0x4d')]:_0x4dd88a[_0xe994('0x37')];if(_0x24a352[_0xe994('0x38')][_0xe994('0x47')]){_0x209d3d[_0xe994('0x48')]=[{'all':!![]}];}_0x209d3d=_[_0xe994('0x44')]({},_0x209d3d,_0x24a352[_0xe994('0x46')]);return db[_0xe994('0x33')][_0xe994('0x4e')](_0x209d3d)[_0xe994('0x28')](handleEntityNotFound(_0x38f27a,null))[_0xe994('0x28')](function(_0x3b8a31){if(_0x3b8a31){var _0x16a689=_0x3b8a31[_0xe994('0x2a')]({'plain':!![]});_0x16a689=qs[_0xe994('0x58')](_0x16a689,['id',_0xe994('0x59'),_0xe994('0x5a')]);_0x24a352[_0xe994('0x50')]=_[_0xe994('0x58')](_0x24a352['body'],['id',_0xe994('0x59'),_0xe994('0x5a')]);return db[_0xe994('0x33')][_0xe994('0x4f')](_['merge'](_0x16a689,_0x24a352[_0xe994('0x50')]),{'include':_0x24a352[_0xe994('0x38')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4f4dac){var _0x5a77fe=_0x24a352[_0xe994('0x51')][_0xe994('0x2a')]({'plain':!![]});if(!_0x5a77fe)throw new Error(_0xe994('0x52'));if(_0x5a77fe[_0xe994('0x53')]==='user'){var _0x154bda=_0x4f4dac['get']({'plain':!![]});var _0x253667=_0xe994('0x2b');return db[_0xe994('0x54')][_0xe994('0x4e')]({'where':{'name':_0x253667,'userProfileId':_0x5a77fe[_0xe994('0x55')]},'raw':!![]})[_0xe994('0x28')](function(_0x1851ee){if(_0x1851ee&&_0x1851ee[_0xe994('0x5b')]===0x0){return db['UserProfileResource'][_0xe994('0x4f')]({'name':_0x154bda['name'],'resourceId':_0x154bda['id'],'type':_0x1851ee[_0xe994('0x2f')],'sectionId':_0x1851ee['id']},{})[_0xe994('0x28')](function(){return _0x4f4dac;});}else{return _0x4f4dac;}})['catch'](function(_0x41d8fd){logger['error'](_0xe994('0x56'),_0x41d8fd);throw _0x41d8fd;});}return _0x4f4dac;});}})[_0xe994('0x28')](respondWithResult(_0x38f27a,0xc9))[_0xe994('0x4a')](handleError(_0x38f27a,null));};exports[_0xe994('0x5c')]=function(_0x5532cf,_0x4a1ecd){if(_0x5532cf[_0xe994('0x50')]['id']){delete _0x5532cf[_0xe994('0x50')]['id'];}return db[_0xe994('0x33')]['find']({'where':{'id':_0x5532cf[_0xe994('0x4c')]['id']}})[_0xe994('0x28')](handleEntityNotFound(_0x4a1ecd,null))[_0xe994('0x28')](saveUpdates(_0x5532cf[_0xe994('0x50')],null))[_0xe994('0x28')](respondWithResult(_0x4a1ecd,null))[_0xe994('0x4a')](handleError(_0x4a1ecd,null));};exports['destroy']=function(_0x2e359c,_0x7e1c5d){return db[_0xe994('0x33')][_0xe994('0x4e')]({'where':{'id':_0x2e359c[_0xe994('0x4c')]['id']}})[_0xe994('0x28')](handleEntityNotFound(_0x7e1c5d,null))[_0xe994('0x28')](removeEntity(_0x7e1c5d,null))[_0xe994('0x4a')](handleError(_0x7e1c5d,null));};function widgetAttributes(_0x2f0908){try{switch(_0x2f0908[_0xe994('0x45')]){case _0xe994('0x5d'):return[{'name':_0xe994('0x5e'),'value':_0x2f0908[_0xe994('0x5e')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||_0xe994('0x61')}];case'custom':return[{'name':_0xe994('0x62'),'value':_0x2f0908[_0xe994('0x62')]||(_0x2f0908['attrs']&&_0x2f0908['attrs'][0x0]?_0x2f0908[_0xe994('0x5f')][0x0]['value']:undefined)||''}];case _0xe994('0x63'):return[{'name':_0xe994('0x64'),'value':_0x2f0908[_0xe994('0x64')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908['attrs'][0x0]?_0x2f0908['attrs'][0x0]['value']:undefined)||_0xe994('0x65')},{'name':_0xe994('0x66'),'value':_0x2f0908[_0xe994('0x66')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x1]?_0x2f0908[_0xe994('0x5f')][0x1][_0xe994('0x60')]:undefined)||_0xe994('0x67')},{'name':_0xe994('0x68'),'value':_0x2f0908[_0xe994('0x68')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x2]?_0x2f0908[_0xe994('0x5f')][0x2][_0xe994('0x60')]:undefined)||0xc}];case _0xe994('0x69'):return[{'name':_0xe994('0x6a'),'value':_0x2f0908[_0xe994('0x6a')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908['attrs'][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||_0xe994('0x6b')},{'name':_0xe994('0x6c'),'value':_0x2f0908[_0xe994('0x6c')]||(_0x2f0908['attrs']&&_0x2f0908[_0xe994('0x5f')][0x1]?_0x2f0908['attrs'][0x1][_0xe994('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x2f0908['attrFontSize']||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x2]?_0x2f0908[_0xe994('0x5f')][0x2][_0xe994('0x60')]:undefined)||0x14}];case _0xe994('0x6d'):case _0xe994('0x6e'):return[{'name':_0xe994('0x6f'),'value':_0x2f0908[_0xe994('0x6f')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||_0xe994('0x6b')},{'name':_0xe994('0x70'),'value':_0x2f0908[_0xe994('0x70')]||(_0x2f0908['attrs']&&_0x2f0908['attrs'][0x1]?_0x2f0908[_0xe994('0x5f')][0x1][_0xe994('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x2f0908[_0xe994('0x71')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908['attrs'][0x2]?_0x2f0908[_0xe994('0x5f')][0x2]['value']:undefined)||null},{'name':_0xe994('0x6c'),'value':_0x2f0908[_0xe994('0x6c')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x3]?_0x2f0908[_0xe994('0x5f')][0x3][_0xe994('0x60')]:undefined)||[]}];case _0xe994('0x72'):return[{'name':_0xe994('0x73'),'type':_0x2f0908[_0xe994('0x74')]||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x45')]:undefined)||null,'value':_0x2f0908['attrReport']||(_0x2f0908[_0xe994('0x5f')]&&_0x2f0908[_0xe994('0x5f')][0x0]?_0x2f0908[_0xe994('0x5f')][0x0][_0xe994('0x60')]:undefined)||null},{'name':_0xe994('0x75'),'value':_0x2f0908[_0xe994('0x75')]||(_0x2f0908['attrs']&&_0x2f0908[_0xe994('0x5f')][0x1]?_0x2f0908[_0xe994('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x526971){logger[_0xe994('0x2e')]('widgetAttributes:\x20%s',JSON[_0xe994('0x76')](_0x526971));return[];}}exports[_0xe994('0x77')]=function(_0x4568a1,_0x935f18,_0x2c95e9){if(_0x4568a1[_0xe994('0x50')]['id']){delete _0x4568a1['body']['id'];}return db[_0xe994('0x33')][_0xe994('0x4e')]({'where':{'id':_0x4568a1[_0xe994('0x4c')]['id']}})[_0xe994('0x28')](handleEntityNotFound(_0x935f18,null))[_0xe994('0x28')](function(_0x33947b){if(_0x33947b){_0x4568a1[_0xe994('0x50')][_0xe994('0x78')]=_0x33947b['id'];_0x4568a1[_0xe994('0x50')][_0xe994('0x5f')]=widgetAttributes(_0x4568a1[_0xe994('0x50')]);return db['DashboardItem'][_0xe994('0x4f')](_0x4568a1[_0xe994('0x50')]);}})[_0xe994('0x28')](respondWithResult(_0x935f18,null))[_0xe994('0x4a')](handleError(_0x935f18,null));};exports['getItems']=function(_0x189480,_0x558892,_0x54b5b5){var _0x2c3468={};var _0x419089={};var _0x1c54db;var _0x5441b6;return db[_0xe994('0x33')]['findOne']({'where':{'id':_0x189480[_0xe994('0x4c')]['id']}})['then'](handleEntityNotFound(_0x558892,null))[_0xe994('0x28')](function(_0x47ca55){if(_0x47ca55){_0x1c54db=_0x47ca55;_0x419089[_0xe994('0x37')]=_[_0xe994('0x39')](db[_0xe994('0x79')]['rawAttributes']);_0x419089['query']=_[_0xe994('0x39')](_0x189480['query']);_0x419089[_0xe994('0x3a')]=_[_0xe994('0x3b')](_0x419089[_0xe994('0x37')],_0x419089[_0xe994('0x38')]);_0x2c3468[_0xe994('0x4d')]=_[_0xe994('0x3b')](_0x419089[_0xe994('0x37')],qs['fields'](_0x189480[_0xe994('0x38')][_0xe994('0x3c')]));_0x2c3468[_0xe994('0x4d')]=_0x2c3468[_0xe994('0x4d')][_0xe994('0x3d')]?_0x2c3468['attributes']:_0x419089[_0xe994('0x37')];_0x2c3468[_0xe994('0x40')]=qs[_0xe994('0x41')](_0x189480['query'][_0xe994('0x41')]);_0x2c3468[_0xe994('0x42')]=qs[_0xe994('0x3a')](_[_0xe994('0x7a')](_0x189480['query'],_0x419089[_0xe994('0x3a')]));if(_0x189480['query'][_0xe994('0x43')]){_0x2c3468[_0xe994('0x42')]=_[_0xe994('0x44')](_0x2c3468[_0xe994('0x42')],{'$or':_[_0xe994('0x32')](_0x2c3468[_0xe994('0x4d')],function(_0xce0245){var _0x4a636e={};_0x4a636e[_0xce0245]={'$like':'%'+_0x189480[_0xe994('0x38')][_0xe994('0x43')]+'%'};return _0x4a636e;})});}_0x2c3468=_[_0xe994('0x44')]({},_0x2c3468,_0x189480[_0xe994('0x46')]);return _0x1c54db['getItems'](_0x2c3468);}})['then'](function(_0x3067a6){if(_0x3067a6){_0x5441b6=_0x3067a6[_0xe994('0x3d')];if(!_0x189480[_0xe994('0x38')]['hasOwnProperty'](_0xe994('0x3f'))){_0x2c3468['limit']=qs[_0xe994('0x22')](_0x189480[_0xe994('0x38')][_0xe994('0x22')]);_0x2c3468['offset']=qs[_0xe994('0x20')](_0x189480[_0xe994('0x38')]['offset']);}return _0x1c54db[_0xe994('0x7b')](_0x2c3468);}})['then'](function(_0x4bb6e7){if(_0x4bb6e7){return _0x4bb6e7?{'count':_0x5441b6,'rows':_0x4bb6e7}:null;}})[_0xe994('0x28')](respondWithResult(_0x558892,null))[_0xe994('0x4a')](handleError(_0x558892,null));}; \ No newline at end of file +var _0xc885=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','type','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','getItems','findOne','DashboardItem','rimraf','zip-dir','fast-json-patch','moment','mustache','path','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','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','destroy','then','get','CustomDashboards','UserProfileResource','name','index','map','Dashboard','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x1474ca,_0x303570){var _0x60406e=function(_0x264fba){while(--_0x264fba){_0x1474ca['push'](_0x1474ca['shift']());}};_0x60406e(++_0x303570);}(_0xc885,0x17f));var _0x5c88=function(_0x13a836,_0x4c2ba2){_0x13a836=_0x13a836-0x0;var _0x1f5bee=_0xc885[_0x13a836];return _0x1f5bee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c88('0x0'));var zipdir=require(_0x5c88('0x1'));var jsonpatch=require(_0x5c88('0x2'));var rp=require('request-promise');var moment=require(_0x5c88('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5c88('0x4'));var util=require('util');var path=require(_0x5c88('0x5'));var sox=require('sox');var csv=require(_0x5c88('0x6'));var ejs=require(_0x5c88('0x7'));var fs=require('fs');var fs_extra=require(_0x5c88('0x8'));var _=require(_0x5c88('0x9'));var squel=require(_0x5c88('0xa'));var crypto=require(_0x5c88('0xb'));var jsforce=require(_0x5c88('0xc'));var deskjs=require(_0x5c88('0xd'));var toCsv=require(_0x5c88('0x6'));var querystring=require(_0x5c88('0xe'));var Papa=require(_0x5c88('0xf'));var Redis=require(_0x5c88('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c88('0x11'));var as=require(_0x5c88('0x12'));var hardwareService=require(_0x5c88('0x13'));var logger=require(_0x5c88('0x14'))(_0x5c88('0x15'));var utils=require(_0x5c88('0x16'));var config=require(_0x5c88('0x17'));var licenseUtil=require(_0x5c88('0x18'));var db=require(_0x5c88('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5c88('0x1a'),'port':0x18eb});var socket=require(_0x5c88('0x1b'))(new Redis(config['redis']));require(_0x5c88('0x1c'))[_0x5c88('0x1d')](socket);function respondWithStatusCode(_0x49a466,_0x124e86){_0x124e86=_0x124e86||0xcc;return function(_0x5c236f){if(_0x5c236f){return _0x49a466[_0x5c88('0x1e')](_0x124e86);}return _0x49a466['status'](_0x124e86)[_0x5c88('0x1f')]();};}function respondWithResult(_0x11e47e,_0xf1e37e){_0xf1e37e=_0xf1e37e||0xc8;return function(_0x381877){if(_0x381877){return _0x11e47e[_0x5c88('0x20')](_0xf1e37e)['json'](_0x381877);}};}function respondWithFilteredResult(_0x38deb0,_0xfa9868){return function(_0x5b502e){if(_0x5b502e){var _0x203bf4=typeof _0xfa9868[_0x5c88('0x21')]===_0x5c88('0x22')&&typeof _0xfa9868[_0x5c88('0x23')]===_0x5c88('0x22');var _0x563e25=_0x5b502e[_0x5c88('0x24')];var _0x493ada=_0x203bf4?0x0:_0xfa9868[_0x5c88('0x21')];var _0x417b50=_0x203bf4?_0x5b502e[_0x5c88('0x24')]:_0xfa9868[_0x5c88('0x21')]+_0xfa9868['limit'];var _0x1b3069;if(_0x417b50>=_0x563e25){_0x417b50=_0x563e25;_0x1b3069=0xc8;}else{_0x1b3069=0xce;}_0x38deb0[_0x5c88('0x20')](_0x1b3069);return _0x38deb0[_0x5c88('0x25')]('Content-Range',_0x493ada+'-'+_0x417b50+'/'+_0x563e25)[_0x5c88('0x26')](_0x5b502e);}return null;};}function patchUpdates(_0x54dd10){return function(_0x57d955){try{jsonpatch[_0x5c88('0x27')](_0x57d955,_0x54dd10,!![]);}catch(_0x202218){return BPromise[_0x5c88('0x28')](_0x202218);}return _0x57d955[_0x5c88('0x29')]();};}function saveUpdates(_0x229b73,_0x4cafa7){return function(_0x246466){if(_0x246466){return _0x246466['update'](_0x229b73)['then'](function(_0x405723){return _0x405723;});}return null;};}function removeEntity(_0x80c81,_0x1ea62f){return function(_0x8e3e3a){if(_0x8e3e3a){return _0x8e3e3a[_0x5c88('0x2a')]()[_0x5c88('0x2b')](function(){var _0x5af161=_0x8e3e3a[_0x5c88('0x2c')]({'plain':!![]});var _0x26f4e1=_0x5c88('0x2d');return db[_0x5c88('0x2e')][_0x5c88('0x2a')]({'where':{'type':_0x26f4e1,'resourceId':_0x5af161['id']}})[_0x5c88('0x2b')](function(){return _0x8e3e3a;});})['then'](function(){_0x80c81[_0x5c88('0x20')](0xcc)[_0x5c88('0x1f')]();});}};}function handleEntityNotFound(_0x51c89a,_0x43f108){return function(_0x571c94){if(!_0x571c94){_0x51c89a['sendStatus'](0x194);}return _0x571c94;};}function handleError(_0x2a00be,_0x14df19){_0x14df19=_0x14df19||0x1f4;return function(_0x596292){logger['error'](_0x596292['stack']);if(_0x596292[_0x5c88('0x2f')]){delete _0x596292['name'];}_0x2a00be['status'](_0x14df19)['send'](_0x596292);};}exports[_0x5c88('0x30')]=function(_0x42737e,_0x16079f){var _0x13571a={},_0x451483={},_0x1344e6={'count':0x0,'rows':[]};var _0x4bb7e0=_[_0x5c88('0x31')](db[_0x5c88('0x32')]['rawAttributes'],function(_0x46dcea){return{'name':_0x46dcea[_0x5c88('0x33')],'type':_0x46dcea['type']['key']};});_0x451483[_0x5c88('0x34')]=_['map'](_0x4bb7e0,'name');_0x451483['query']=_[_0x5c88('0x35')](_0x42737e[_0x5c88('0x36')]);_0x451483[_0x5c88('0x37')]=_[_0x5c88('0x38')](_0x451483['model'],_0x451483[_0x5c88('0x36')]);_0x13571a['attributes']=_[_0x5c88('0x38')](_0x451483[_0x5c88('0x34')],qs[_0x5c88('0x39')](_0x42737e[_0x5c88('0x36')][_0x5c88('0x39')]));_0x13571a[_0x5c88('0x3a')]=_0x13571a[_0x5c88('0x3a')][_0x5c88('0x3b')]?_0x13571a[_0x5c88('0x3a')]:_0x451483[_0x5c88('0x34')];if(!_0x42737e['query'][_0x5c88('0x3c')](_0x5c88('0x3d'))){_0x13571a['limit']=qs[_0x5c88('0x23')](_0x42737e['query']['limit']);_0x13571a['offset']=qs['offset'](_0x42737e[_0x5c88('0x36')][_0x5c88('0x21')]);}_0x13571a[_0x5c88('0x3e')]=qs[_0x5c88('0x3f')](_0x42737e[_0x5c88('0x36')][_0x5c88('0x3f')]);_0x13571a[_0x5c88('0x40')]=qs[_0x5c88('0x37')](_[_0x5c88('0x41')](_0x42737e[_0x5c88('0x36')],_0x451483[_0x5c88('0x37')]),_0x4bb7e0);if(_0x42737e['query'][_0x5c88('0x42')]){_0x13571a[_0x5c88('0x40')]=_['merge'](_0x13571a[_0x5c88('0x40')],{'$or':_[_0x5c88('0x31')](_0x4bb7e0,function(_0x43d96f){if(_0x43d96f['type']!==_0x5c88('0x43')){var _0xc4ea30={};_0xc4ea30[_0x43d96f[_0x5c88('0x2f')]]={'$like':'%'+_0x42737e['query']['filter']+'%'};return _0xc4ea30;}})});}_0x13571a=_[_0x5c88('0x44')]({},_0x13571a,_0x42737e[_0x5c88('0x45')]);var _0x32fd34={'where':_0x13571a[_0x5c88('0x40')]};return db[_0x5c88('0x32')][_0x5c88('0x24')](_0x32fd34)[_0x5c88('0x2b')](function(_0x588fd3){_0x1344e6[_0x5c88('0x24')]=_0x588fd3;if(_0x42737e[_0x5c88('0x36')]['includeAll']){_0x13571a['include']=[{'all':!![]}];}return db[_0x5c88('0x32')]['findAll'](_0x13571a);})[_0x5c88('0x2b')](function(_0x1aa4d8){_0x1344e6[_0x5c88('0x46')]=_0x1aa4d8;return _0x1344e6;})[_0x5c88('0x2b')](respondWithFilteredResult(_0x16079f,_0x13571a))[_0x5c88('0x47')](handleError(_0x16079f,null));};exports[_0x5c88('0x48')]=function(_0x35e28c,_0x273791){var _0x300140={'raw':![],'where':{'id':_0x35e28c[_0x5c88('0x49')]['id']}},_0x404706={};_0x404706['model']=_[_0x5c88('0x35')](db[_0x5c88('0x32')][_0x5c88('0x4a')]);_0x404706[_0x5c88('0x36')]=_[_0x5c88('0x35')](_0x35e28c['query']);_0x404706[_0x5c88('0x37')]=_['intersection'](_0x404706[_0x5c88('0x34')],_0x404706['query']);_0x300140[_0x5c88('0x3a')]=_[_0x5c88('0x38')](_0x404706['model'],qs[_0x5c88('0x39')](_0x35e28c[_0x5c88('0x36')][_0x5c88('0x39')]));_0x300140[_0x5c88('0x3a')]=_0x300140['attributes']['length']?_0x300140[_0x5c88('0x3a')]:_0x404706[_0x5c88('0x34')];if(_0x35e28c[_0x5c88('0x36')]['includeAll']){_0x300140[_0x5c88('0x4b')]=[{'all':!![]}];}_0x300140=_[_0x5c88('0x44')]({},_0x300140,_0x35e28c['options']);return db[_0x5c88('0x32')][_0x5c88('0x4c')](_0x300140)[_0x5c88('0x2b')](handleEntityNotFound(_0x273791,null))[_0x5c88('0x2b')](respondWithResult(_0x273791,null))[_0x5c88('0x47')](handleError(_0x273791,null));};exports[_0x5c88('0x4d')]=function(_0x51f518,_0x11f42d){return db[_0x5c88('0x32')][_0x5c88('0x4d')](_0x51f518[_0x5c88('0x4e')],{})['then'](function(_0x3e416d){var _0xed3e22=_0x51f518[_0x5c88('0x4f')][_0x5c88('0x2c')]({'plain':!![]});if(!_0xed3e22)throw new Error(_0x5c88('0x50'));if(_0xed3e22[_0x5c88('0x51')]===_0x5c88('0x4f')){var _0x4ffb96=_0x3e416d['get']({'plain':!![]});var _0x42845f='CustomDashboards';return db[_0x5c88('0x52')][_0x5c88('0x4c')]({'where':{'name':_0x42845f,'userProfileId':_0xed3e22[_0x5c88('0x53')]},'raw':!![]})['then'](function(_0x546bc0){if(_0x546bc0&&_0x546bc0[_0x5c88('0x54')]===0x0){return db[_0x5c88('0x2e')][_0x5c88('0x4d')]({'name':_0x4ffb96[_0x5c88('0x2f')],'resourceId':_0x4ffb96['id'],'type':_0x546bc0[_0x5c88('0x2f')],'sectionId':_0x546bc0['id']},{})[_0x5c88('0x2b')](function(){return _0x3e416d;});}else{return _0x3e416d;}})['catch'](function(_0x282588){logger[_0x5c88('0x55')](_0x5c88('0x56'),_0x282588);throw _0x282588;});}return _0x3e416d;})['then'](respondWithResult(_0x11f42d,0xc9))[_0x5c88('0x47')](handleError(_0x11f42d,null));};exports[_0x5c88('0x57')]=function(_0x5627e8,_0x5dae46){var _0x288df3={'where':{'id':_0x5627e8['params']['id']}},_0x181b71={};_0x181b71[_0x5c88('0x34')]=_[_0x5c88('0x35')](db[_0x5c88('0x32')][_0x5c88('0x4a')]);_0x288df3['attributes']=_[_0x5c88('0x38')](_0x181b71[_0x5c88('0x34')],qs[_0x5c88('0x39')](_0x5627e8[_0x5c88('0x36')][_0x5c88('0x39')]));_0x288df3[_0x5c88('0x3a')]=_0x288df3['attributes']['length']?_0x288df3[_0x5c88('0x3a')]:_0x181b71['model'];if(_0x5627e8[_0x5c88('0x36')]['includeAll']){_0x288df3[_0x5c88('0x4b')]=[{'all':!![]}];}_0x288df3=_[_0x5c88('0x44')]({},_0x288df3,_0x5627e8[_0x5c88('0x45')]);return db[_0x5c88('0x32')]['find'](_0x288df3)[_0x5c88('0x2b')](handleEntityNotFound(_0x5dae46,null))[_0x5c88('0x2b')](function(_0x2e4725){if(_0x2e4725){var _0x3fe9e5=_0x2e4725[_0x5c88('0x2c')]({'plain':!![]});_0x3fe9e5=qs[_0x5c88('0x58')](_0x3fe9e5,['id',_0x5c88('0x59'),_0x5c88('0x5a')]);_0x5627e8[_0x5c88('0x4e')]=_[_0x5c88('0x58')](_0x5627e8[_0x5c88('0x4e')],['id',_0x5c88('0x59'),_0x5c88('0x5a')]);return db[_0x5c88('0x32')][_0x5c88('0x4d')](_[_0x5c88('0x44')](_0x3fe9e5,_0x5627e8[_0x5c88('0x4e')]),{'include':_0x5627e8['query']['includeAll']?[{'all':!![]}]:undefined})[_0x5c88('0x2b')](function(_0x5cef4a){var _0x17f249=_0x5627e8[_0x5c88('0x4f')][_0x5c88('0x2c')]({'plain':!![]});if(!_0x17f249)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17f249['role']==='user'){var _0x44cb8f=_0x5cef4a[_0x5c88('0x2c')]({'plain':!![]});var _0x399112=_0x5c88('0x2d');return db[_0x5c88('0x52')][_0x5c88('0x4c')]({'where':{'name':_0x399112,'userProfileId':_0x17f249[_0x5c88('0x53')]},'raw':!![]})[_0x5c88('0x2b')](function(_0x4225a3){if(_0x4225a3&&_0x4225a3[_0x5c88('0x54')]===0x0){return db[_0x5c88('0x2e')]['create']({'name':_0x44cb8f['name'],'resourceId':_0x44cb8f['id'],'type':_0x4225a3[_0x5c88('0x2f')],'sectionId':_0x4225a3['id']},{})['then'](function(){return _0x5cef4a;});}else{return _0x5cef4a;}})[_0x5c88('0x47')](function(_0x364ad2){logger[_0x5c88('0x55')](_0x5c88('0x56'),_0x364ad2);throw _0x364ad2;});}return _0x5cef4a;});}})['then'](respondWithResult(_0x5dae46,0xc9))[_0x5c88('0x47')](handleError(_0x5dae46,null));};exports['update']=function(_0x4c820e,_0x424b98){if(_0x4c820e[_0x5c88('0x4e')]['id']){delete _0x4c820e['body']['id'];}return db[_0x5c88('0x32')][_0x5c88('0x4c')]({'where':{'id':_0x4c820e['params']['id']}})[_0x5c88('0x2b')](handleEntityNotFound(_0x424b98,null))[_0x5c88('0x2b')](saveUpdates(_0x4c820e[_0x5c88('0x4e')],null))[_0x5c88('0x2b')](respondWithResult(_0x424b98,null))[_0x5c88('0x47')](handleError(_0x424b98,null));};exports[_0x5c88('0x2a')]=function(_0x285dec,_0x3f2fa8){return db[_0x5c88('0x32')][_0x5c88('0x4c')]({'where':{'id':_0x285dec[_0x5c88('0x49')]['id']}})[_0x5c88('0x2b')](handleEntityNotFound(_0x3f2fa8,null))[_0x5c88('0x2b')](removeEntity(_0x3f2fa8,null))['catch'](handleError(_0x3f2fa8,null));};function widgetAttributes(_0x2946a5){try{switch(_0x2946a5[_0x5c88('0x5b')]){case _0x5c88('0x5c'):return[{'name':_0x5c88('0x5d'),'value':_0x2946a5[_0x5c88('0x5d')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5['attrs'][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0][_0x5c88('0x5f')]:undefined)||'https://'}];case'custom':return[{'name':_0x5c88('0x60'),'value':_0x2946a5[_0x5c88('0x60')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5['attrs'][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0][_0x5c88('0x5f')]:undefined)||''}];case _0x5c88('0x61'):return[{'name':'attrHourFormat','value':_0x2946a5[_0x5c88('0x62')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0][_0x5c88('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0x5c88('0x63'),'value':_0x2946a5[_0x5c88('0x63')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5['attrs'][0x1]?_0x2946a5[_0x5c88('0x5e')][0x1][_0x5c88('0x5f')]:undefined)||_0x5c88('0x64')},{'name':'attrFontSize','value':_0x2946a5[_0x5c88('0x65')]||(_0x2946a5['attrs']&&_0x2946a5[_0x5c88('0x5e')][0x2]?_0x2946a5[_0x5c88('0x5e')][0x2][_0x5c88('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0x5c88('0x66'),'value':_0x2946a5[_0x5c88('0x66')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0]['value']:undefined)||_0x5c88('0x67')},{'name':'attrVoiceQueues','value':_0x2946a5[_0x5c88('0x68')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x1]?_0x2946a5['attrs'][0x1][_0x5c88('0x5f')]:undefined)||[]},{'name':_0x5c88('0x65'),'value':_0x2946a5[_0x5c88('0x65')]||(_0x2946a5['attrs']&&_0x2946a5[_0x5c88('0x5e')][0x2]?_0x2946a5['attrs'][0x2][_0x5c88('0x5f')]:undefined)||0x14}];case _0x5c88('0x69'):case'pie-chart':return[{'name':'attrSerie1','value':_0x2946a5['attrSerie1']||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0]['value']:undefined)||_0x5c88('0x67')},{'name':_0x5c88('0x6a'),'value':_0x2946a5[_0x5c88('0x6a')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x1]?_0x2946a5['attrs'][0x1][_0x5c88('0x5f')]:undefined)||null},{'name':_0x5c88('0x6b'),'value':_0x2946a5[_0x5c88('0x6b')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x2]?_0x2946a5[_0x5c88('0x5e')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x2946a5['attrVoiceQueues']||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x3]?_0x2946a5[_0x5c88('0x5e')][0x3][_0x5c88('0x5f')]:undefined)||[]}];case _0x5c88('0x6c'):return[{'name':_0x5c88('0x6d'),'type':_0x2946a5[_0x5c88('0x6e')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0]['type']:undefined)||null,'value':_0x2946a5[_0x5c88('0x6d')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x0]?_0x2946a5[_0x5c88('0x5e')][0x0][_0x5c88('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x2946a5[_0x5c88('0x6f')]||(_0x2946a5[_0x5c88('0x5e')]&&_0x2946a5[_0x5c88('0x5e')][0x1]?_0x2946a5['attrs'][0x1][_0x5c88('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x44898e){logger[_0x5c88('0x55')]('widgetAttributes:\x20%s',JSON[_0x5c88('0x70')](_0x44898e));return[];}}exports[_0x5c88('0x71')]=function(_0x5cd5c5,_0x156c0c,_0x28f2b6){if(_0x5cd5c5['body']['id']){delete _0x5cd5c5[_0x5c88('0x4e')]['id'];}return db['Dashboard'][_0x5c88('0x4c')]({'where':{'id':_0x5cd5c5[_0x5c88('0x49')]['id']}})[_0x5c88('0x2b')](handleEntityNotFound(_0x156c0c,null))[_0x5c88('0x2b')](function(_0x2a132d){if(_0x2a132d){_0x5cd5c5[_0x5c88('0x4e')]['DashboardId']=_0x2a132d['id'];_0x5cd5c5[_0x5c88('0x4e')][_0x5c88('0x5e')]=widgetAttributes(_0x5cd5c5['body']);return db['DashboardItem'][_0x5c88('0x4d')](_0x5cd5c5[_0x5c88('0x4e')]);}})[_0x5c88('0x2b')](respondWithResult(_0x156c0c,null))[_0x5c88('0x47')](handleError(_0x156c0c,null));};exports[_0x5c88('0x72')]=function(_0x42ff3e,_0x4881b1,_0x2a254c){var _0x5bc2d0={};var _0x48db76={};var _0x564f08;var _0x421b97;return db[_0x5c88('0x32')][_0x5c88('0x73')]({'where':{'id':_0x42ff3e[_0x5c88('0x49')]['id']}})[_0x5c88('0x2b')](handleEntityNotFound(_0x4881b1,null))[_0x5c88('0x2b')](function(_0x1e8deb){if(_0x1e8deb){_0x564f08=_0x1e8deb;_0x48db76[_0x5c88('0x34')]=_[_0x5c88('0x35')](db[_0x5c88('0x74')][_0x5c88('0x4a')]);_0x48db76[_0x5c88('0x36')]=_[_0x5c88('0x35')](_0x42ff3e[_0x5c88('0x36')]);_0x48db76[_0x5c88('0x37')]=_[_0x5c88('0x38')](_0x48db76['model'],_0x48db76['query']);_0x5bc2d0[_0x5c88('0x3a')]=_[_0x5c88('0x38')](_0x48db76['model'],qs[_0x5c88('0x39')](_0x42ff3e[_0x5c88('0x36')][_0x5c88('0x39')]));_0x5bc2d0[_0x5c88('0x3a')]=_0x5bc2d0[_0x5c88('0x3a')][_0x5c88('0x3b')]?_0x5bc2d0['attributes']:_0x48db76[_0x5c88('0x34')];_0x5bc2d0[_0x5c88('0x3e')]=qs[_0x5c88('0x3f')](_0x42ff3e['query'][_0x5c88('0x3f')]);_0x5bc2d0['where']=qs['filters'](_[_0x5c88('0x41')](_0x42ff3e['query'],_0x48db76[_0x5c88('0x37')]));if(_0x42ff3e[_0x5c88('0x36')]['filter']){_0x5bc2d0[_0x5c88('0x40')]=_[_0x5c88('0x44')](_0x5bc2d0[_0x5c88('0x40')],{'$or':_[_0x5c88('0x31')](_0x5bc2d0[_0x5c88('0x3a')],function(_0xc02c29){var _0x4352d8={};_0x4352d8[_0xc02c29]={'$like':'%'+_0x42ff3e[_0x5c88('0x36')]['filter']+'%'};return _0x4352d8;})});}_0x5bc2d0=_[_0x5c88('0x44')]({},_0x5bc2d0,_0x42ff3e[_0x5c88('0x45')]);return _0x564f08['getItems'](_0x5bc2d0);}})['then'](function(_0x9ea4ab){if(_0x9ea4ab){_0x421b97=_0x9ea4ab[_0x5c88('0x3b')];if(!_0x42ff3e[_0x5c88('0x36')][_0x5c88('0x3c')](_0x5c88('0x3d'))){_0x5bc2d0[_0x5c88('0x23')]=qs[_0x5c88('0x23')](_0x42ff3e[_0x5c88('0x36')]['limit']);_0x5bc2d0['offset']=qs[_0x5c88('0x21')](_0x42ff3e['query'][_0x5c88('0x21')]);}return _0x564f08[_0x5c88('0x72')](_0x5bc2d0);}})[_0x5c88('0x2b')](function(_0x103a75){if(_0x103a75){return _0x103a75?{'count':_0x421b97,'rows':_0x103a75}:null;}})[_0x5c88('0x2b')](respondWithResult(_0x4881b1,null))[_0x5c88('0x47')](handleError(_0x4881b1,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 972b2c4..66f3678 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 _0x5ebc=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3ae7ba,_0x10b3ec){var _0x14a974=function(_0x477da0){while(--_0x477da0){_0x3ae7ba['push'](_0x3ae7ba['shift']());}};_0x14a974(++_0x10b3ec);}(_0x5ebc,0x103));var _0xc5eb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5ebc[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xc5eb('0x0'))['db'][_0xc5eb('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc5eb('0x2')](0x0);var events={'afterCreate':_0xc5eb('0x3'),'afterUpdate':_0xc5eb('0x4'),'afterDestroy':_0xc5eb('0x5')};function emitEvent(_0x51701b){return function(_0x1927cb,_0x31ca64,_0x5b8921){DashboardEvents[_0xc5eb('0x6')](_0x51701b+':'+_0x1927cb['id'],_0x1927cb);DashboardEvents[_0xc5eb('0x6')](_0x51701b,_0x1927cb);_0x5b8921(null);};}for(var e in events){if(events[_0xc5eb('0x7')](e)){var event=events[e];Dashboard[_0xc5eb('0x8')](e,emitEvent(event));}}module[_0xc5eb('0x9')]=DashboardEvents; \ No newline at end of file +var _0x5c73=['../../mysqldb','save','update','remove','emit','exports'];(function(_0x5d2a68,_0x94ade6){var _0x58f18a=function(_0x78a2a){while(--_0x78a2a){_0x5d2a68['push'](_0x5d2a68['shift']());}};_0x58f18a(++_0x94ade6);}(_0x5c73,0x114));var _0x35c7=function(_0x2fdb02,_0x251a3e){_0x2fdb02=_0x2fdb02-0x0;var _0x4a6de4=_0x5c73[_0x2fdb02];return _0x4a6de4;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x35c7('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35c7('0x1'),'afterUpdate':_0x35c7('0x2'),'afterDestroy':_0x35c7('0x3')};function emitEvent(_0xed04d6){return function(_0x45b984,_0x384d83,_0x5f51e1){DashboardEvents[_0x35c7('0x4')](_0xed04d6+':'+_0x45b984['id'],_0x45b984);DashboardEvents[_0x35c7('0x4')](_0xed04d6,_0x45b984);_0x5f51e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x35c7('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 043d5a7..d0ca2d5 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 _0x59fe=['../../config/environment','./dashboard.attributes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x59fe,0x146));var _0xe59f=function(_0x435cc5,_0x3f4545){_0x435cc5=_0x435cc5-0x0;var _0xfff27=_0x59fe[_0x435cc5];return _0xfff27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe59f('0x0'))(_0xe59f('0x1'));var moment=require(_0xe59f('0x2'));var BPromise=require(_0xe59f('0x3'));var rp=require(_0xe59f('0x4'));var fs=require('fs');var path=require(_0xe59f('0x5'));var rimraf=require(_0xe59f('0x6'));var config=require(_0xe59f('0x7'));var attributes=require(_0xe59f('0x8'));module['exports']=function(_0x281442,_0x2484bb){return _0x281442['define']('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cf9=['Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','rimraf','./dashboard.attributes','exports','define'];(function(_0x39285c,_0x25a9b9){var _0x4f24d0=function(_0x460999){while(--_0x460999){_0x39285c['push'](_0x39285c['shift']());}};_0x4f24d0(++_0x25a9b9);}(_0x6cf9,0xb2));var _0x96cf=function(_0x5e3a45,_0x45f0c5){_0x5e3a45=_0x5e3a45-0x0;var _0x13419f=_0x6cf9[_0x5e3a45];return _0x13419f;};'use strict';var _=require(_0x96cf('0x0'));var util=require(_0x96cf('0x1'));var logger=require(_0x96cf('0x2'))('api');var moment=require(_0x96cf('0x3'));var BPromise=require(_0x96cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x96cf('0x5'));var config=require('../../config/environment');var attributes=require(_0x96cf('0x6'));module[_0x96cf('0x7')]=function(_0x2c9c63,_0x4f0a2d){return _0x2c9c63[_0x96cf('0x8')](_0x96cf('0x9'),attributes,{'tableName':_0x96cf('0xa'),'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 15a0aec..c5c8cba 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 _0x2225=['register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x37d959,_0xf56089){var _0x5c5d77=function(_0x2e5083){while(--_0x2e5083){_0x37d959['push'](_0x37d959['shift']());}};_0x5c5d77(++_0xf56089);}(_0x2225,0x150));var _0x5222=function(_0x4dfbb7,_0x1b608d){_0x4dfbb7=_0x4dfbb7-0x0;var _0x23e02e=_0x2225[_0x4dfbb7];return _0x23e02e;};'use strict';var _=require('lodash');var util=require(_0x5222('0x0'));var moment=require(_0x5222('0x1'));var BPromise=require(_0x5222('0x2'));var rs=require(_0x5222('0x3'));var fs=require('fs');var Redis=require(_0x5222('0x4'));var db=require(_0x5222('0x5'))['db'];var utils=require(_0x5222('0x6'));var logger=require(_0x5222('0x7'))(_0x5222('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5222('0x9')]['http']({'port':0x232a});config[_0x5222('0xa')]=_[_0x5222('0xb')](config[_0x5222('0xa')],{'host':_0x5222('0xc'),'port':0x18eb});var socket=require(_0x5222('0xd'))(new Redis(config[_0x5222('0xa')]));require(_0x5222('0xe'))[_0x5222('0xf')](socket);function respondWithRpcPromise(_0x59130f,_0x5bc598,_0x1cf282){return new BPromise(function(_0x4e36da,_0x2b19da){return client[_0x5222('0x10')](_0x59130f,_0x1cf282)[_0x5222('0x11')](function(_0x2eb3a0){logger['info'](_0x5222('0x12'),_0x5bc598,_0x5222('0x13'));logger['debug'](_0x5222('0x14'),_0x5bc598,'request\x20sent',JSON[_0x5222('0x15')](_0x2eb3a0));if(_0x2eb3a0[_0x5222('0x16')]){if(_0x2eb3a0['error'][_0x5222('0x17')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x5bc598,_0x2eb3a0[_0x5222('0x16')]['message']);return _0x2b19da(_0x2eb3a0['error']['message']);}logger[_0x5222('0x16')](_0x5222('0x12'),_0x5bc598,_0x2eb3a0[_0x5222('0x16')][_0x5222('0x18')]);return _0x4e36da(_0x2eb3a0[_0x5222('0x16')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x5bc598,_0x5222('0x13'));_0x4e36da(_0x2eb3a0[_0x5222('0x19')][_0x5222('0x18')]);}})[_0x5222('0x1a')](function(_0x581ea5){logger[_0x5222('0x16')](_0x5222('0x12'),_0x5bc598,_0x581ea5);_0x2b19da(_0x581ea5);});});} \ No newline at end of file +var _0xecd1=['../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','debug','error','code','Dashboard,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x48e3a0,_0xa832f1){var _0x28038d=function(_0x3dc335){while(--_0x3dc335){_0x48e3a0['push'](_0x48e3a0['shift']());}};_0x28038d(++_0xa832f1);}(_0xecd1,0xc2));var _0x1ecd=function(_0xb3ae4,_0x497fd6){_0xb3ae4=_0xb3ae4-0x0;var _0x4d76ff=_0xecd1[_0xb3ae4];return _0x4d76ff;};'use strict';var _=require('lodash');var util=require(_0x1ecd('0x0'));var moment=require(_0x1ecd('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ecd('0x2'));var fs=require('fs');var Redis=require(_0x1ecd('0x3'));var db=require(_0x1ecd('0x4'))['db'];var utils=require(_0x1ecd('0x5'));var logger=require(_0x1ecd('0x6'))(_0x1ecd('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ecd('0x8'));var client=jayson[_0x1ecd('0x9')][_0x1ecd('0xa')]({'port':0x232a});config[_0x1ecd('0xb')]=_['defaults'](config[_0x1ecd('0xb')],{'host':_0x1ecd('0xc'),'port':0x18eb});var socket=require(_0x1ecd('0xd'))(new Redis(config[_0x1ecd('0xb')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x4d94b0,_0x29c094,_0xdebd31){return new BPromise(function(_0x481c40,_0x445eba){return client[_0x1ecd('0xe')](_0x4d94b0,_0xdebd31)[_0x1ecd('0xf')](function(_0x1e9d08){logger[_0x1ecd('0x10')]('Dashboard,\x20%s,\x20%s',_0x29c094,'request\x20sent');logger[_0x1ecd('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x29c094,'request\x20sent',JSON['stringify'](_0x1e9d08));if(_0x1e9d08['error']){if(_0x1e9d08[_0x1ecd('0x12')][_0x1ecd('0x13')]===0x1f4){logger['error'](_0x1ecd('0x14'),_0x29c094,_0x1e9d08[_0x1ecd('0x12')][_0x1ecd('0x15')]);return _0x445eba(_0x1e9d08[_0x1ecd('0x12')]['message']);}logger['error'](_0x1ecd('0x14'),_0x29c094,_0x1e9d08[_0x1ecd('0x12')][_0x1ecd('0x15')]);return _0x481c40(_0x1e9d08[_0x1ecd('0x12')][_0x1ecd('0x15')]);}else{logger[_0x1ecd('0x10')](_0x1ecd('0x14'),_0x29c094,_0x1ecd('0x16'));_0x481c40(_0x1e9d08[_0x1ecd('0x17')][_0x1ecd('0x15')]);}})[_0x1ecd('0x18')](function(_0x3287c0){logger[_0x1ecd('0x12')]('Dashboard,\x20%s,\x20%s',_0x29c094,_0x3287c0);_0x445eba(_0x3287c0);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index e9cf5b2..fc8a49a 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 _0x8594=['update','emit','register','dashboard:','save'];(function(_0x15f77a,_0x461593){var _0x12dffc=function(_0x15c64f){while(--_0x15c64f){_0x15f77a['push'](_0x15f77a['shift']());}};_0x12dffc(++_0x461593);}(_0x8594,0x121));var _0x4859=function(_0x38b813,_0x555fb4){_0x38b813=_0x38b813-0x0;var _0x48ee04=_0x8594[_0x38b813];return _0x48ee04;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x4859('0x0'),'remove',_0x4859('0x1')];function createListener(_0x45d11b,_0x53854f){return function(_0x471b30){_0x53854f[_0x4859('0x2')](_0x45d11b,_0x471b30);};}function removeListener(_0x55dcaa,_0x476bdc){return function(){DashboardEvents['removeListener'](_0x55dcaa,_0x476bdc);};}exports[_0x4859('0x3')]=function(_0x45c5fa){for(var _0x1e347f=0x0,_0x4bc585=events['length'];_0x1e347f<_0x4bc585;_0x1e347f++){var _0xf79d25=events[_0x1e347f];var _0x1cd01a=createListener(_0x4859('0x4')+_0xf79d25,_0x45c5fa);DashboardEvents['on'](_0xf79d25,_0x1cd01a);}}; \ No newline at end of file +var _0xe901=['./dashboard.events','update','emit','removeListener','register'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe901,0x1d1));var _0x1e90=function(_0x19d172,_0x21bf9b){_0x19d172=_0x19d172-0x0;var _0x4e1ccd=_0xe901[_0x19d172];return _0x4e1ccd;};'use strict';var DashboardEvents=require(_0x1e90('0x0'));var events=['save','remove',_0x1e90('0x1')];function createListener(_0x388293,_0x385cbb){return function(_0x5a1c12){_0x385cbb[_0x1e90('0x2')](_0x388293,_0x5a1c12);};}function removeListener(_0x529c36,_0x503650){return function(){DashboardEvents[_0x1e90('0x3')](_0x529c36,_0x503650);};}exports[_0x1e90('0x4')]=function(_0x4a7ef8){for(var _0x3739e0=0x0,_0x3fde18=events['length'];_0x3739e0<_0x3fde18;_0x3739e0++){var _0x534659=events[_0x3739e0];var _0x556210=createListener('dashboard:'+_0x534659,_0x4a7ef8);DashboardEvents['on'](_0x534659,_0x556210);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b9c9408..deac537 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 _0xa7cb=['/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','index'];(function(_0x8d3262,_0x439e73){var _0x45561c=function(_0x36581f){while(--_0x36581f){_0x8d3262['push'](_0x8d3262['shift']());}};_0x45561c(++_0x439e73);}(_0xa7cb,0x1ae));var _0xba7c=function(_0xb68772,_0x5253ac){_0xb68772=_0xb68772-0x0;var _0x4189bb=_0xa7cb[_0xb68772];return _0x4189bb;};'use strict';var multer=require(_0xba7c('0x0'));var util=require(_0xba7c('0x1'));var path=require(_0xba7c('0x2'));var timeout=require(_0xba7c('0x3'));var express=require(_0xba7c('0x4'));var router=express[_0xba7c('0x5')]();var fs_extra=require(_0xba7c('0x6'));var auth=require(_0xba7c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xba7c('0x8'));var controller=require(_0xba7c('0x9'));router[_0xba7c('0xa')]('/',auth['isAuthenticated'](),controller[_0xba7c('0xb')]);router[_0xba7c('0xa')](_0xba7c('0xc'),auth[_0xba7c('0xd')](),controller[_0xba7c('0xe')]);router['get'](_0xba7c('0xf'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x10')]);router[_0xba7c('0x11')]('/',auth[_0xba7c('0xd')](),controller[_0xba7c('0x12')]);router[_0xba7c('0x11')](_0xba7c('0x13'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x14')]);router[_0xba7c('0x11')](_0xba7c('0xf'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x15')]);router[_0xba7c('0x16')](_0xba7c('0xc'),auth[_0xba7c('0xd')](),controller[_0xba7c('0x17')]);router[_0xba7c('0x18')](_0xba7c('0xc'),auth[_0xba7c('0xd')](),controller['destroy']);module[_0xba7c('0x19')]=router; \ No newline at end of file +var _0x7737=['post','/:id/clone','clone','/:id/items','addItem','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0x7737,0xe1));var _0x7773=function(_0x4bdda3,_0x25f960){_0x4bdda3=_0x4bdda3-0x0;var _0x3f8722=_0x7737[_0x4bdda3];return _0x3f8722;};'use strict';var multer=require(_0x7773('0x0'));var util=require(_0x7773('0x1'));var path=require(_0x7773('0x2'));var timeout=require('connect-timeout');var express=require(_0x7773('0x3'));var router=express[_0x7773('0x4')]();var fs_extra=require(_0x7773('0x5'));var auth=require(_0x7773('0x6'));var interaction=require(_0x7773('0x7'));var config=require(_0x7773('0x8'));var controller=require(_0x7773('0x9'));router[_0x7773('0xa')]('/',auth[_0x7773('0xb')](),controller[_0x7773('0xc')]);router[_0x7773('0xa')](_0x7773('0xd'),auth[_0x7773('0xb')](),controller[_0x7773('0xe')]);router[_0x7773('0xa')]('/:id/items',auth[_0x7773('0xb')](),controller['getItems']);router[_0x7773('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7773('0xf')](_0x7773('0x10'),auth[_0x7773('0xb')](),controller[_0x7773('0x11')]);router[_0x7773('0xf')](_0x7773('0x12'),auth[_0x7773('0xb')](),controller[_0x7773('0x13')]);router[_0x7773('0x14')](_0x7773('0xd'),auth['isAuthenticated'](),controller[_0x7773('0x15')]);router[_0x7773('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7773('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 305d4b7..309462c 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 _0xc1c6=['long','parse','setDataValue','stringify','attrs','INTEGER','#ffffff','sequelize','squel','lodash','STRING','TEXT'];(function(_0x1809a3,_0x157c89){var _0x344547=function(_0x51e6eb){while(--_0x51e6eb){_0x1809a3['push'](_0x1809a3['shift']());}};_0x344547(++_0x157c89);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2e686b,_0x1cc985){_0x2e686b=_0x2e686b-0x0;var _0x156e75=_0xc1c6[_0x2e686b];return _0x156e75;};'use strict';var Sequelize=require(_0x6c1c('0x0'));var squel=require(_0x6c1c('0x1'));var _=require(_0x6c1c('0x2'));module['exports']={'title':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6c1c('0x4')](_0x6c1c('0x5')),'get':function(){try{return JSON[_0x6c1c('0x6')](this['getDataValue']('attrs'));}catch(_0x32af84){return[];}},'set':function(_0x524a6b){try{this[_0x6c1c('0x7')]('attrs',JSON[_0x6c1c('0x8')](_0x524a6b));}catch(_0x2eb1ba){this[_0x6c1c('0x7')](_0x6c1c('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6c1c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6c1c('0xa')]},'background':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':_0x6c1c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6c1c('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6c1c('0x3')]},'titleFontSize':{'type':Sequelize[_0x6c1c('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xacf4=['lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xacf4,0xe7));var _0x4acf=function(_0x44594d,_0x44470c){_0x44594d=_0x44594d-0x0;var _0x1bff66=_0xacf4[_0x44594d];return _0x1bff66;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4acf('0x0'));module[_0x4acf('0x1')]={'title':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4acf('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4acf('0x3')](_0x4acf('0x4')),'get':function(){try{return JSON[_0x4acf('0x5')](this['getDataValue'](_0x4acf('0x6')));}catch(_0x2124c8){return[];}},'set':function(_0x4e0c43){try{this[_0x4acf('0x7')](_0x4acf('0x6'),JSON[_0x4acf('0x8')](_0x4e0c43));}catch(_0x45a5a4){this[_0x4acf('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4acf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4acf('0x9')]},'col':{'type':Sequelize[_0x4acf('0x9')]},'background':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':_0x4acf('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index b54d1ee..c00986e 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 _0xd3b4=['attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','model','keys','DashboardItem','rawAttributes','filters','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','params','iframe','attrUrl','attrs','value','custom'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x308108,_0x490636){_0x308108=_0x308108-0x0;var _0x33e77c=_0xd3b4[_0x308108];return _0x33e77c;};'use strict';var emlformat=require(_0x4d3b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4d3b('0x1'));var rp=require(_0x4d3b('0x2'));var moment=require(_0x4d3b('0x3'));var BPromise=require(_0x4d3b('0x4'));var Mustache=require('mustache');var util=require(_0x4d3b('0x5'));var path=require('path');var sox=require(_0x4d3b('0x6'));var csv=require(_0x4d3b('0x7'));var ejs=require(_0x4d3b('0x8'));var fs=require('fs');var fs_extra=require(_0x4d3b('0x9'));var _=require(_0x4d3b('0xa'));var squel=require(_0x4d3b('0xb'));var crypto=require(_0x4d3b('0xc'));var jsforce=require(_0x4d3b('0xd'));var deskjs=require(_0x4d3b('0xe'));var toCsv=require(_0x4d3b('0x7'));var querystring=require('querystring');var Papa=require(_0x4d3b('0xf'));var Redis=require('ioredis');var authService=require(_0x4d3b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d3b('0x11'));var hardwareService=require(_0x4d3b('0x12'));var logger=require(_0x4d3b('0x13'))(_0x4d3b('0x14'));var utils=require(_0x4d3b('0x15'));var config=require(_0x4d3b('0x16'));var licenseUtil=require(_0x4d3b('0x17'));var db=require(_0x4d3b('0x18'))['db'];config[_0x4d3b('0x19')]=_[_0x4d3b('0x1a')](config[_0x4d3b('0x19')],{'host':_0x4d3b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d3b('0x19')]));require(_0x4d3b('0x1c'))[_0x4d3b('0x1d')](socket);function respondWithStatusCode(_0x156e79,_0x38fba9){_0x38fba9=_0x38fba9||0xcc;return function(_0x16d34b){if(_0x16d34b){return _0x156e79[_0x4d3b('0x1e')](_0x38fba9);}return _0x156e79[_0x4d3b('0x1f')](_0x38fba9)[_0x4d3b('0x20')]();};}function respondWithResult(_0x43a9a2,_0x531d57){_0x531d57=_0x531d57||0xc8;return function(_0xfbb52a){if(_0xfbb52a){return _0x43a9a2['status'](_0x531d57)[_0x4d3b('0x21')](_0xfbb52a);}};}function respondWithFilteredResult(_0x37c854,_0x15cc17){return function(_0x408b9b){if(_0x408b9b){var _0x4f5ac6=typeof _0x15cc17[_0x4d3b('0x22')]===_0x4d3b('0x23')&&typeof _0x15cc17[_0x4d3b('0x24')]===_0x4d3b('0x23');var _0x1fe7f5=_0x408b9b[_0x4d3b('0x25')];var _0x3a409c=_0x4f5ac6?0x0:_0x15cc17[_0x4d3b('0x22')];var _0x4f0e27=_0x4f5ac6?_0x408b9b[_0x4d3b('0x25')]:_0x15cc17[_0x4d3b('0x22')]+_0x15cc17[_0x4d3b('0x24')];var _0x50ef5a;if(_0x4f0e27>=_0x1fe7f5){_0x4f0e27=_0x1fe7f5;_0x50ef5a=0xc8;}else{_0x50ef5a=0xce;}_0x37c854[_0x4d3b('0x1f')](_0x50ef5a);return _0x37c854['set'](_0x4d3b('0x26'),_0x3a409c+'-'+_0x4f0e27+'/'+_0x1fe7f5)[_0x4d3b('0x21')](_0x408b9b);}return null;};}function patchUpdates(_0x335bd8){return function(_0x557811){try{jsonpatch[_0x4d3b('0x27')](_0x557811,_0x335bd8,!![]);}catch(_0x508335){return BPromise[_0x4d3b('0x28')](_0x508335);}return _0x557811[_0x4d3b('0x29')]();};}function saveUpdates(_0xc3fe1d,_0x5b94fc){return function(_0x26c9ca){if(_0x26c9ca){return _0x26c9ca[_0x4d3b('0x2a')](_0xc3fe1d)[_0x4d3b('0x2b')](function(_0x24ada0){return _0x24ada0;});}return null;};}function removeEntity(_0x51856d,_0x260cd3){return function(_0x7ac21c){if(_0x7ac21c){return _0x7ac21c[_0x4d3b('0x2c')]()[_0x4d3b('0x2b')](function(){_0x51856d[_0x4d3b('0x1f')](0xcc)[_0x4d3b('0x20')]();});}};}function handleEntityNotFound(_0x1223c7,_0x37fc9d){return function(_0x1b7c1b){if(!_0x1b7c1b){_0x1223c7['sendStatus'](0x194);}return _0x1b7c1b;};}function handleError(_0x3b62a7,_0x48adb6){_0x48adb6=_0x48adb6||0x1f4;return function(_0x26209a){logger[_0x4d3b('0x2d')](_0x26209a[_0x4d3b('0x2e')]);if(_0x26209a[_0x4d3b('0x2f')]){delete _0x26209a[_0x4d3b('0x2f')];}_0x3b62a7[_0x4d3b('0x1f')](_0x48adb6)['send'](_0x26209a);};}exports['show']=function(_0x3817bd,_0x599e10){var _0x5dc8a9={'raw':![],'where':{'id':_0x3817bd['params']['id']}},_0x18d048={};_0x18d048[_0x4d3b('0x30')]=_[_0x4d3b('0x31')](db[_0x4d3b('0x32')][_0x4d3b('0x33')]);_0x18d048['query']=_['keys'](_0x3817bd['query']);_0x18d048[_0x4d3b('0x34')]=_['intersection'](_0x18d048[_0x4d3b('0x30')],_0x18d048[_0x4d3b('0x35')]);_0x5dc8a9[_0x4d3b('0x36')]=_[_0x4d3b('0x37')](_0x18d048[_0x4d3b('0x30')],qs[_0x4d3b('0x38')](_0x3817bd[_0x4d3b('0x35')][_0x4d3b('0x38')]));_0x5dc8a9[_0x4d3b('0x36')]=_0x5dc8a9[_0x4d3b('0x36')]['length']?_0x5dc8a9[_0x4d3b('0x36')]:_0x18d048['model'];if(_0x3817bd['query'][_0x4d3b('0x39')]){_0x5dc8a9[_0x4d3b('0x3a')]=[{'all':!![]}];}_0x5dc8a9=_[_0x4d3b('0x3b')]({},_0x5dc8a9,_0x3817bd[_0x4d3b('0x3c')]);return db[_0x4d3b('0x32')][_0x4d3b('0x3d')](_0x5dc8a9)[_0x4d3b('0x2b')](handleEntityNotFound(_0x599e10,null))[_0x4d3b('0x2b')](respondWithResult(_0x599e10,null))[_0x4d3b('0x3e')](handleError(_0x599e10,null));};exports[_0x4d3b('0x2c')]=function(_0x497f8f,_0x35a046){return db['DashboardItem']['find']({'where':{'id':_0x497f8f[_0x4d3b('0x3f')]['id']}})[_0x4d3b('0x2b')](handleEntityNotFound(_0x35a046,null))[_0x4d3b('0x2b')](removeEntity(_0x35a046,null))[_0x4d3b('0x3e')](handleError(_0x35a046,null));};function widgetAttributes(_0x5e5a0c){try{switch(_0x5e5a0c['type']){case _0x4d3b('0x40'):return[{'name':_0x4d3b('0x41'),'value':_0x5e5a0c[_0x4d3b('0x41')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||'https://'}];case _0x4d3b('0x44'):return[{'name':_0x4d3b('0x45'),'value':_0x5e5a0c[_0x4d3b('0x45')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||''}];case _0x4d3b('0x46'):return[{'name':_0x4d3b('0x47'),'value':_0x5e5a0c[_0x4d3b('0x47')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0]['value']:undefined)||_0x4d3b('0x48')},{'name':_0x4d3b('0x49'),'value':_0x5e5a0c['attrTimezone']||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x1]?_0x5e5a0c[_0x4d3b('0x42')][0x1][_0x4d3b('0x43')]:undefined)||_0x4d3b('0x4a')},{'name':_0x4d3b('0x4b'),'value':_0x5e5a0c[_0x4d3b('0x4b')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x2]?_0x5e5a0c[_0x4d3b('0x42')][0x2][_0x4d3b('0x43')]:undefined)||0xc}];case _0x4d3b('0x4c'):return[{'name':'attrMetric','value':_0x5e5a0c[_0x4d3b('0x4d')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||'total'},{'name':_0x4d3b('0x4e'),'value':_0x5e5a0c[_0x4d3b('0x4e')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x1]?_0x5e5a0c['attrs'][0x1][_0x4d3b('0x43')]:undefined)||[]},{'name':_0x4d3b('0x4b'),'value':_0x5e5a0c[_0x4d3b('0x4b')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x2]?_0x5e5a0c[_0x4d3b('0x42')][0x2][_0x4d3b('0x43')]:undefined)||0x14}];case'multibar-chart':case _0x4d3b('0x4f'):return[{'name':_0x4d3b('0x50'),'value':_0x5e5a0c['attrSerie1']||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x43')]:undefined)||_0x4d3b('0x51')},{'name':_0x4d3b('0x52'),'value':_0x5e5a0c[_0x4d3b('0x52')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x1]?_0x5e5a0c[_0x4d3b('0x42')][0x1][_0x4d3b('0x43')]:undefined)||null},{'name':_0x4d3b('0x53'),'value':_0x5e5a0c[_0x4d3b('0x53')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x2]?_0x5e5a0c[_0x4d3b('0x42')][0x2][_0x4d3b('0x43')]:undefined)||null},{'name':_0x4d3b('0x4e'),'value':_0x5e5a0c[_0x4d3b('0x4e')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x3]?_0x5e5a0c[_0x4d3b('0x42')][0x3][_0x4d3b('0x43')]:undefined)||[]}];case _0x4d3b('0x54'):return[{'name':_0x4d3b('0x55'),'type':_0x5e5a0c[_0x4d3b('0x56')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c['attrs'][0x0]?_0x5e5a0c[_0x4d3b('0x42')][0x0][_0x4d3b('0x57')]:undefined)||null,'value':_0x5e5a0c[_0x4d3b('0x55')]||(_0x5e5a0c[_0x4d3b('0x42')]&&_0x5e5a0c[_0x4d3b('0x42')][0x0]?_0x5e5a0c['attrs'][0x0][_0x4d3b('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x5e5a0c[_0x4d3b('0x58')]||(_0x5e5a0c['attrs']&&_0x5e5a0c[_0x4d3b('0x42')][0x1]?_0x5e5a0c['attrs'][0x1][_0x4d3b('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x2f7791){logger[_0x4d3b('0x2d')](_0x4d3b('0x59'),JSON[_0x4d3b('0x5a')](_0x2f7791));return[];}}exports[_0x4d3b('0x5b')]=function(_0x171499,_0xa4899b){if(_0x171499[_0x4d3b('0x5c')]){_0x171499[_0x4d3b('0x5c')][_0x4d3b('0x42')]=widgetAttributes(_0x171499[_0x4d3b('0x5c')]);}return db['DashboardItem'][_0x4d3b('0x5b')](_0x171499[_0x4d3b('0x5c')],{})[_0x4d3b('0x2b')](respondWithResult(_0xa4899b,0xc9))[_0x4d3b('0x3e')](handleError(_0xa4899b,null));};exports['update']=function(_0x2ed4a5,_0x5c1f51){if(_0x2ed4a5[_0x4d3b('0x5c')]['id']){delete _0x2ed4a5[_0x4d3b('0x5c')]['id'];}_0x2ed4a5[_0x4d3b('0x5c')]['attrs']=widgetAttributes(_0x2ed4a5[_0x4d3b('0x5c')]);return db[_0x4d3b('0x32')][_0x4d3b('0x3d')]({'where':{'id':_0x2ed4a5[_0x4d3b('0x3f')]['id']}})[_0x4d3b('0x2b')](handleEntityNotFound(_0x5c1f51,null))['then'](saveUpdates(_0x2ed4a5[_0x4d3b('0x5c')],null))[_0x4d3b('0x2b')](respondWithResult(_0x5c1f51,null))[_0x4d3b('0x3e')](handleError(_0x5c1f51,null));}; \ No newline at end of file +var _0x9f2d=['attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','params','model','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','merge','find','destroy','DashboardItem','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9f2d,0x1d1));var _0xd9f2=function(_0x2a1933,_0x43e3ab){_0x2a1933=_0x2a1933-0x0;var _0x70daa3=_0x9f2d[_0x2a1933];return _0x70daa3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd9f2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9f2('0x1'));var moment=require(_0xd9f2('0x2'));var BPromise=require(_0xd9f2('0x3'));var Mustache=require(_0xd9f2('0x4'));var util=require(_0xd9f2('0x5'));var path=require(_0xd9f2('0x6'));var sox=require(_0xd9f2('0x7'));var csv=require(_0xd9f2('0x8'));var ejs=require(_0xd9f2('0x9'));var fs=require('fs');var fs_extra=require(_0xd9f2('0xa'));var _=require(_0xd9f2('0xb'));var squel=require(_0xd9f2('0xc'));var crypto=require(_0xd9f2('0xd'));var jsforce=require(_0xd9f2('0xe'));var deskjs=require(_0xd9f2('0xf'));var toCsv=require(_0xd9f2('0x8'));var querystring=require(_0xd9f2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9f2('0x11'));var qs=require(_0xd9f2('0x12'));var as=require(_0xd9f2('0x13'));var hardwareService=require(_0xd9f2('0x14'));var logger=require(_0xd9f2('0x15'))(_0xd9f2('0x16'));var utils=require('../../config/utils');var config=require(_0xd9f2('0x17'));var licenseUtil=require(_0xd9f2('0x18'));var db=require(_0xd9f2('0x19'))['db'];config[_0xd9f2('0x1a')]=_[_0xd9f2('0x1b')](config[_0xd9f2('0x1a')],{'host':_0xd9f2('0x1c'),'port':0x18eb});var socket=require(_0xd9f2('0x1d'))(new Redis(config[_0xd9f2('0x1a')]));require(_0xd9f2('0x1e'))[_0xd9f2('0x1f')](socket);function respondWithStatusCode(_0x3eca22,_0x118a76){_0x118a76=_0x118a76||0xcc;return function(_0x2dd333){if(_0x2dd333){return _0x3eca22[_0xd9f2('0x20')](_0x118a76);}return _0x3eca22[_0xd9f2('0x21')](_0x118a76)[_0xd9f2('0x22')]();};}function respondWithResult(_0x1dee72,_0xd2a4e){_0xd2a4e=_0xd2a4e||0xc8;return function(_0x399635){if(_0x399635){return _0x1dee72[_0xd9f2('0x21')](_0xd2a4e)[_0xd9f2('0x23')](_0x399635);}};}function respondWithFilteredResult(_0x13ac4c,_0x453677){return function(_0x43707d){if(_0x43707d){var _0x22d620=typeof _0x453677[_0xd9f2('0x24')]===_0xd9f2('0x25')&&typeof _0x453677[_0xd9f2('0x26')]===_0xd9f2('0x25');var _0x2c158d=_0x43707d[_0xd9f2('0x27')];var _0x88a3=_0x22d620?0x0:_0x453677[_0xd9f2('0x24')];var _0x409c49=_0x22d620?_0x43707d['count']:_0x453677['offset']+_0x453677[_0xd9f2('0x26')];var _0x3965af;if(_0x409c49>=_0x2c158d){_0x409c49=_0x2c158d;_0x3965af=0xc8;}else{_0x3965af=0xce;}_0x13ac4c[_0xd9f2('0x21')](_0x3965af);return _0x13ac4c[_0xd9f2('0x28')](_0xd9f2('0x29'),_0x88a3+'-'+_0x409c49+'/'+_0x2c158d)[_0xd9f2('0x23')](_0x43707d);}return null;};}function patchUpdates(_0xdd69f4){return function(_0x514eff){try{jsonpatch[_0xd9f2('0x2a')](_0x514eff,_0xdd69f4,!![]);}catch(_0x31dac2){return BPromise[_0xd9f2('0x2b')](_0x31dac2);}return _0x514eff['save']();};}function saveUpdates(_0x2ae86a,_0x162147){return function(_0x29b171){if(_0x29b171){return _0x29b171[_0xd9f2('0x2c')](_0x2ae86a)[_0xd9f2('0x2d')](function(_0x1c5577){return _0x1c5577;});}return null;};}function removeEntity(_0x137051,_0x1b955d){return function(_0x4936ec){if(_0x4936ec){return _0x4936ec['destroy']()['then'](function(){_0x137051[_0xd9f2('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23605b,_0x1738f5){return function(_0x3859ae){if(!_0x3859ae){_0x23605b[_0xd9f2('0x20')](0x194);}return _0x3859ae;};}function handleError(_0x2b1205,_0x5c4220){_0x5c4220=_0x5c4220||0x1f4;return function(_0x5b57e4){logger[_0xd9f2('0x2e')](_0x5b57e4[_0xd9f2('0x2f')]);if(_0x5b57e4[_0xd9f2('0x30')]){delete _0x5b57e4['name'];}_0x2b1205[_0xd9f2('0x21')](_0x5c4220)[_0xd9f2('0x31')](_0x5b57e4);};}exports['show']=function(_0x10f45f,_0x2aa5d8){var _0x233431={'raw':![],'where':{'id':_0x10f45f[_0xd9f2('0x32')]['id']}},_0x2ecdae={};_0x2ecdae[_0xd9f2('0x33')]=_['keys'](db['DashboardItem'][_0xd9f2('0x34')]);_0x2ecdae[_0xd9f2('0x35')]=_[_0xd9f2('0x36')](_0x10f45f['query']);_0x2ecdae[_0xd9f2('0x37')]=_[_0xd9f2('0x38')](_0x2ecdae['model'],_0x2ecdae['query']);_0x233431['attributes']=_[_0xd9f2('0x38')](_0x2ecdae[_0xd9f2('0x33')],qs['fields'](_0x10f45f[_0xd9f2('0x35')][_0xd9f2('0x39')]));_0x233431[_0xd9f2('0x3a')]=_0x233431[_0xd9f2('0x3a')][_0xd9f2('0x3b')]?_0x233431[_0xd9f2('0x3a')]:_0x2ecdae[_0xd9f2('0x33')];if(_0x10f45f[_0xd9f2('0x35')][_0xd9f2('0x3c')]){_0x233431['include']=[{'all':!![]}];}_0x233431=_[_0xd9f2('0x3d')]({},_0x233431,_0x10f45f['options']);return db['DashboardItem'][_0xd9f2('0x3e')](_0x233431)['then'](handleEntityNotFound(_0x2aa5d8,null))[_0xd9f2('0x2d')](respondWithResult(_0x2aa5d8,null))['catch'](handleError(_0x2aa5d8,null));};exports[_0xd9f2('0x3f')]=function(_0x460c38,_0x215124){return db[_0xd9f2('0x40')]['find']({'where':{'id':_0x460c38[_0xd9f2('0x32')]['id']}})['then'](handleEntityNotFound(_0x215124,null))[_0xd9f2('0x2d')](removeEntity(_0x215124,null))[_0xd9f2('0x41')](handleError(_0x215124,null));};function widgetAttributes(_0x166864){try{switch(_0x166864[_0xd9f2('0x42')]){case _0xd9f2('0x43'):return[{'name':_0xd9f2('0x44'),'value':_0x166864[_0xd9f2('0x44')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x0]?_0x166864[_0xd9f2('0x45')][0x0]['value']:undefined)||_0xd9f2('0x46')}];case _0xd9f2('0x47'):return[{'name':_0xd9f2('0x48'),'value':_0x166864[_0xd9f2('0x48')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x0]?_0x166864[_0xd9f2('0x45')][0x0][_0xd9f2('0x49')]:undefined)||''}];case _0xd9f2('0x4a'):return[{'name':_0xd9f2('0x4b'),'value':_0x166864['attrHourFormat']||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x0]?_0x166864[_0xd9f2('0x45')][0x0][_0xd9f2('0x49')]:undefined)||_0xd9f2('0x4c')},{'name':_0xd9f2('0x4d'),'value':_0x166864[_0xd9f2('0x4d')]||(_0x166864['attrs']&&_0x166864[_0xd9f2('0x45')][0x1]?_0x166864['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0xd9f2('0x4e'),'value':_0x166864[_0xd9f2('0x4e')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x2]?_0x166864[_0xd9f2('0x45')][0x2][_0xd9f2('0x49')]:undefined)||0xc}];case _0xd9f2('0x4f'):return[{'name':_0xd9f2('0x50'),'value':_0x166864[_0xd9f2('0x50')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x0]?_0x166864[_0xd9f2('0x45')][0x0][_0xd9f2('0x49')]:undefined)||_0xd9f2('0x51')},{'name':_0xd9f2('0x52'),'value':_0x166864['attrVoiceQueues']||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x1]?_0x166864['attrs'][0x1][_0xd9f2('0x49')]:undefined)||[]},{'name':_0xd9f2('0x4e'),'value':_0x166864[_0xd9f2('0x4e')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x2]?_0x166864[_0xd9f2('0x45')][0x2]['value']:undefined)||0x14}];case _0xd9f2('0x53'):case _0xd9f2('0x54'):return[{'name':_0xd9f2('0x55'),'value':_0x166864[_0xd9f2('0x55')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864['attrs'][0x0]?_0x166864[_0xd9f2('0x45')][0x0][_0xd9f2('0x49')]:undefined)||_0xd9f2('0x51')},{'name':'attrSerie2','value':_0x166864['attrSerie2']||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x1]?_0x166864[_0xd9f2('0x45')][0x1][_0xd9f2('0x49')]:undefined)||null},{'name':_0xd9f2('0x56'),'value':_0x166864[_0xd9f2('0x56')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x2]?_0x166864[_0xd9f2('0x45')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x166864['attrVoiceQueues']||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x3]?_0x166864[_0xd9f2('0x45')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0xd9f2('0x57'),'type':_0x166864['reportType']||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x0]?_0x166864['attrs'][0x0]['type']:undefined)||null,'value':_0x166864[_0xd9f2('0x57')]||(_0x166864[_0xd9f2('0x45')]&&_0x166864['attrs'][0x0]?_0x166864['attrs'][0x0][_0xd9f2('0x49')]:undefined)||null},{'name':_0xd9f2('0x58'),'value':_0x166864['attrRefresh']||(_0x166864[_0xd9f2('0x45')]&&_0x166864[_0xd9f2('0x45')][0x1]?_0x166864['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1eece9){logger[_0xd9f2('0x2e')](_0xd9f2('0x59'),JSON[_0xd9f2('0x5a')](_0x1eece9));return[];}}exports['create']=function(_0x477c0a,_0x54080c){if(_0x477c0a['body']){_0x477c0a[_0xd9f2('0x5b')][_0xd9f2('0x45')]=widgetAttributes(_0x477c0a['body']);}return db[_0xd9f2('0x40')]['create'](_0x477c0a[_0xd9f2('0x5b')],{})['then'](respondWithResult(_0x54080c,0xc9))[_0xd9f2('0x41')](handleError(_0x54080c,null));};exports[_0xd9f2('0x2c')]=function(_0x572b5c,_0x4febee){if(_0x572b5c[_0xd9f2('0x5b')]['id']){delete _0x572b5c[_0xd9f2('0x5b')]['id'];}_0x572b5c[_0xd9f2('0x5b')][_0xd9f2('0x45')]=widgetAttributes(_0x572b5c[_0xd9f2('0x5b')]);return db[_0xd9f2('0x40')]['find']({'where':{'id':_0x572b5c[_0xd9f2('0x32')]['id']}})['then'](handleEntityNotFound(_0x4febee,null))['then'](saveUpdates(_0x572b5c['body'],null))[_0xd9f2('0x2d')](respondWithResult(_0x4febee,null))[_0xd9f2('0x41')](handleError(_0x4febee,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 56a8a78..5e30508 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 _0xf23b=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x57041f,_0x967686){var _0x5145ca=function(_0x550db5){while(--_0x550db5){_0x57041f['push'](_0x57041f['shift']());}};_0x5145ca(++_0x967686);}(_0xf23b,0xd4));var _0xbf23=function(_0x4dcac4,_0x10e48a){_0x4dcac4=_0x4dcac4-0x0;var _0x2a238d=_0xf23b[_0x4dcac4];return _0x2a238d;};'use strict';var EventEmitter=require(_0xbf23('0x0'));var DashboardItem=require(_0xbf23('0x1'))['db'][_0xbf23('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbf23('0x3')](0x0);var events={'afterCreate':_0xbf23('0x4'),'afterUpdate':_0xbf23('0x5'),'afterDestroy':_0xbf23('0x6')};function emitEvent(_0x462fbf){return function(_0x29bfae,_0x493a25,_0x591f1c){DashboardItemEvents['emit'](_0x462fbf+':'+_0x29bfae['id'],_0x29bfae);DashboardItemEvents[_0xbf23('0x7')](_0x462fbf,_0x29bfae);_0x591f1c(null);};}for(var e in events){if(events[_0xbf23('0x8')](e)){var event=events[e];DashboardItem[_0xbf23('0x9')](e,emitEvent(event));}}module[_0xbf23('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x016e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x419c82,_0x41c464){var _0x270458=function(_0x3cbba0){while(--_0x3cbba0){_0x419c82['push'](_0x419c82['shift']());}};_0x270458(++_0x41c464);}(_0x016e,0x1b5));var _0xe016=function(_0x15c280,_0x1dbbc9){_0x15c280=_0x15c280-0x0;var _0x59cf4f=_0x016e[_0x15c280];return _0x59cf4f;};'use strict';var EventEmitter=require(_0xe016('0x0'));var DashboardItem=require(_0xe016('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xe016('0x2')](0x0);var events={'afterCreate':_0xe016('0x3'),'afterUpdate':_0xe016('0x4'),'afterDestroy':_0xe016('0x5')};function emitEvent(_0x510e02){return function(_0x17f77c,_0x4c1d80,_0x492ca0){DashboardItemEvents[_0xe016('0x6')](_0x510e02+':'+_0x17f77c['id'],_0x17f77c);DashboardItemEvents[_0xe016('0x6')](_0x510e02,_0x17f77c);_0x492ca0(null);};}for(var e in events){if(events[_0xe016('0x7')](e)){var event=events[e];DashboardItem[_0xe016('0x8')](e,emitEvent(event));}}module[_0xe016('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 947292a..b45cddb 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 _0x60ce=['request-promise','path','exports','define','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x181b4b,_0x216ed9){var _0xd9c915=function(_0x527eb9){while(--_0x527eb9){_0x181b4b['push'](_0x181b4b['shift']());}};_0xd9c915(++_0x216ed9);}(_0x60ce,0x118));var _0xe60c=function(_0x59f2eb,_0x4a40f5){_0x59f2eb=_0x59f2eb-0x0;var _0x3bc71e=_0x60ce[_0x59f2eb];return _0x3bc71e;};'use strict';var _=require(_0xe60c('0x0'));var util=require(_0xe60c('0x1'));var logger=require(_0xe60c('0x2'))(_0xe60c('0x3'));var moment=require(_0xe60c('0x4'));var BPromise=require(_0xe60c('0x5'));var rp=require(_0xe60c('0x6'));var fs=require('fs');var path=require(_0xe60c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0xe60c('0x8')]=function(_0x4c1f04,_0x5c81dc){return _0x4c1f04[_0xe60c('0x9')](_0xe60c('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfe8=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items'];(function(_0x36758b,_0x366a68){var _0x2e4166=function(_0x516cbf){while(--_0x516cbf){_0x36758b['push'](_0x36758b['shift']());}};_0x2e4166(++_0x366a68);}(_0xdfe8,0x12c));var _0x8dfe=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0xdfe8[_0x1f0679];return _0x3dc3a4;};'use strict';var _=require(_0x8dfe('0x0'));var util=require(_0x8dfe('0x1'));var logger=require(_0x8dfe('0x2'))(_0x8dfe('0x3'));var moment=require('moment');var BPromise=require(_0x8dfe('0x4'));var rp=require(_0x8dfe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8dfe('0x6'));var config=require('../../config/environment');var attributes=require(_0x8dfe('0x7'));module[_0x8dfe('0x8')]=function(_0xb4e83e,_0x5e12bb){return _0xb4e83e[_0x8dfe('0x9')](_0x8dfe('0xa'),attributes,{'tableName':_0x8dfe('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 9e755fa..4ba9a2c 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 _0x4901=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x4d95e8,_0x8c6139){var _0x508106=function(_0x28df){while(--_0x28df){_0x4d95e8['push'](_0x4d95e8['shift']());}};_0x508106(++_0x8c6139);}(_0x4901,0x107));var _0x1490=function(_0x7782ff,_0x487117){_0x7782ff=_0x7782ff-0x0;var _0x152919=_0x4901[_0x7782ff];return _0x152919;};'use strict';var _=require(_0x1490('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1490('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1490('0x2'))['db'];var utils=require(_0x1490('0x3'));var logger=require(_0x1490('0x4'))(_0x1490('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1490('0x6')]['http']({'port':0x232a});config[_0x1490('0x7')]=_[_0x1490('0x8')](config[_0x1490('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x1490('0x9'))(new Redis(config[_0x1490('0x7')]));require(_0x1490('0xa'))[_0x1490('0xb')](socket);function respondWithRpcPromise(_0x56b296,_0x4bf8a8,_0x23e46d){return new BPromise(function(_0x3c739f,_0x1636eb){return client[_0x1490('0xc')](_0x56b296,_0x23e46d)[_0x1490('0xd')](function(_0x5b45ca){logger[_0x1490('0xe')](_0x1490('0xf'),_0x4bf8a8,'request\x20sent');logger[_0x1490('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4bf8a8,_0x1490('0x11'),JSON[_0x1490('0x12')](_0x5b45ca));if(_0x5b45ca[_0x1490('0x13')]){if(_0x5b45ca[_0x1490('0x13')][_0x1490('0x14')]===0x1f4){logger[_0x1490('0x13')](_0x1490('0xf'),_0x4bf8a8,_0x5b45ca[_0x1490('0x13')][_0x1490('0x15')]);return _0x1636eb(_0x5b45ca['error'][_0x1490('0x15')]);}logger['error'](_0x1490('0xf'),_0x4bf8a8,_0x5b45ca[_0x1490('0x13')][_0x1490('0x15')]);return _0x3c739f(_0x5b45ca[_0x1490('0x13')]['message']);}else{logger[_0x1490('0xe')](_0x1490('0xf'),_0x4bf8a8,_0x1490('0x11'));_0x3c739f(_0x5b45ca[_0x1490('0x16')]['message']);}})[_0x1490('0x17')](function(_0x5b176b){logger['error'](_0x1490('0xf'),_0x4bf8a8,_0x5b176b);_0x1636eb(_0x5b176b);});});} \ No newline at end of file +var _0x4aeb=['defaults','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x4aeb,0x1ef));var _0xb4ae=function(_0xd866ed,_0x3c38cd){_0xd866ed=_0xd866ed-0x0;var _0x71e99b=_0x4aeb[_0xd866ed];return _0x71e99b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb4ae('0x0'));var BPromise=require('bluebird');var rs=require(_0xb4ae('0x1'));var fs=require('fs');var Redis=require(_0xb4ae('0x2'));var db=require(_0xb4ae('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb4ae('0x4'));var config=require(_0xb4ae('0x5'));var jayson=require(_0xb4ae('0x6'));var client=jayson[_0xb4ae('0x7')]['http']({'port':0x232a});config[_0xb4ae('0x8')]=_[_0xb4ae('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb4ae('0xa'))(new Redis(config[_0xb4ae('0x8')]));require(_0xb4ae('0xb'))['register'](socket);function respondWithRpcPromise(_0x2f4119,_0x5e5862,_0x1c7fd2){return new BPromise(function(_0x5cf18b,_0x92b27f){return client[_0xb4ae('0xc')](_0x2f4119,_0x1c7fd2)[_0xb4ae('0xd')](function(_0x359f2a){logger[_0xb4ae('0xe')](_0xb4ae('0xf'),_0x5e5862,'request\x20sent');logger[_0xb4ae('0x10')](_0xb4ae('0x11'),_0x5e5862,_0xb4ae('0x12'),JSON['stringify'](_0x359f2a));if(_0x359f2a[_0xb4ae('0x13')]){if(_0x359f2a['error'][_0xb4ae('0x14')]===0x1f4){logger[_0xb4ae('0x13')](_0xb4ae('0xf'),_0x5e5862,_0x359f2a[_0xb4ae('0x13')][_0xb4ae('0x15')]);return _0x92b27f(_0x359f2a[_0xb4ae('0x13')]['message']);}logger[_0xb4ae('0x13')](_0xb4ae('0xf'),_0x5e5862,_0x359f2a[_0xb4ae('0x13')][_0xb4ae('0x15')]);return _0x5cf18b(_0x359f2a[_0xb4ae('0x13')][_0xb4ae('0x15')]);}else{logger[_0xb4ae('0xe')](_0xb4ae('0xf'),_0x5e5862,_0xb4ae('0x12'));_0x5cf18b(_0x359f2a[_0xb4ae('0x16')]['message']);}})[_0xb4ae('0x17')](function(_0x69feb8){logger[_0xb4ae('0x13')](_0xb4ae('0xf'),_0x5e5862,_0x69feb8);_0x92b27f(_0x69feb8);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a66c8a8..346065c 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 _0x5e31=['remove','update','register','length'];(function(_0x22ab7e,_0x3d6fa7){var _0x2198f9=function(_0x2210d5){while(--_0x2210d5){_0x22ab7e['push'](_0x22ab7e['shift']());}};_0x2198f9(++_0x3d6fa7);}(_0x5e31,0x1c4));var _0x15e3=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x5e31[_0x242a4f];return _0x122117;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x15e3('0x0'),_0x15e3('0x1')];function createListener(_0x101f3e,_0x222e65){return function(_0x28f1e7){_0x222e65['emit'](_0x101f3e,_0x28f1e7);};}function removeListener(_0x5acb33,_0x21d9d2){return function(){DashboardItemEvents['removeListener'](_0x5acb33,_0x21d9d2);};}exports[_0x15e3('0x2')]=function(_0x499cd1){for(var _0x55c7e4=0x0,_0x565e4f=events[_0x15e3('0x3')];_0x55c7e4<_0x565e4f;_0x55c7e4++){var _0x2a6a4f=events[_0x55c7e4];var _0x3ef21e=createListener('dashboardItem:'+_0x2a6a4f,_0x499cd1);DashboardItemEvents['on'](_0x2a6a4f,_0x3ef21e);}}; \ No newline at end of file +var _0x360f=['length','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0x186a91,_0x47402a){var _0x586730=function(_0x4c9cdd){while(--_0x4c9cdd){_0x186a91['push'](_0x186a91['shift']());}};_0x586730(++_0x47402a);}(_0x360f,0x171));var _0xf360=function(_0x46826a,_0xfce054){_0x46826a=_0x46826a-0x0;var _0x4970c5=_0x360f[_0x46826a];return _0x4970c5;};'use strict';var DashboardItemEvents=require(_0xf360('0x0'));var events=[_0xf360('0x1'),_0xf360('0x2'),_0xf360('0x3')];function createListener(_0xe695c,_0x2d1d66){return function(_0x1fb51f){_0x2d1d66[_0xf360('0x4')](_0xe695c,_0x1fb51f);};}function removeListener(_0x5e2e77,_0x3904ae){return function(){DashboardItemEvents[_0xf360('0x5')](_0x5e2e77,_0x3904ae);};}exports[_0xf360('0x6')]=function(_0x1f27dd){for(var _0x1eb6b1=0x0,_0x13368b=events[_0xf360('0x7')];_0x1eb6b1<_0x13368b;_0x1eb6b1++){var _0x2dfcb6=events[_0x1eb6b1];var _0x1e7a96=createListener('dashboardItem:'+_0x2dfcb6,_0x1f27dd);DashboardItemEvents['on'](_0x2dfcb6,_0x1e7a96);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c6a40f5..1f6a2d5 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 _0x06b2=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','update'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x06b2,0x14b));var _0x206b=function(_0x2059b1,_0x24a617){_0x2059b1=_0x2059b1-0x0;var _0x2fe10b=_0x06b2[_0x2059b1];return _0x2fe10b;};'use strict';var multer=require(_0x206b('0x0'));var util=require(_0x206b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x206b('0x2'));var router=express[_0x206b('0x3')]();var fs_extra=require(_0x206b('0x4'));var auth=require(_0x206b('0x5'));var interaction=require(_0x206b('0x6'));var config=require('../../config/environment');var controller=require(_0x206b('0x7'));router[_0x206b('0x8')](_0x206b('0x9'),auth[_0x206b('0xa')](),controller[_0x206b('0xb')]);router['post']('/',auth[_0x206b('0xa')](),controller[_0x206b('0xc')]);router['put'](_0x206b('0x9'),auth[_0x206b('0xa')](),controller[_0x206b('0xd')]);router['delete'](_0x206b('0x9'),auth[_0x206b('0xa')](),controller['destroy']);module[_0x206b('0xe')]=router; \ No newline at end of file +var _0x0ccf=['isAuthenticated','create','update','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','post'];(function(_0x616100,_0x14e25c){var _0x3b30f1=function(_0x2b507c){while(--_0x2b507c){_0x616100['push'](_0x616100['shift']());}};_0x3b30f1(++_0x14e25c);}(_0x0ccf,0x86));var _0xf0cc=function(_0x21599e,_0x16f272){_0x21599e=_0x21599e-0x0;var _0x4abce4=_0x0ccf[_0x21599e];return _0x4abce4;};'use strict';var multer=require('multer');var util=require(_0xf0cc('0x0'));var path=require(_0xf0cc('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0cc('0x2'));var router=express[_0xf0cc('0x3')]();var fs_extra=require(_0xf0cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0cc('0x5'));var config=require(_0xf0cc('0x6'));var controller=require(_0xf0cc('0x7'));router[_0xf0cc('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf0cc('0x9')]('/',auth[_0xf0cc('0xa')](),controller[_0xf0cc('0xb')]);router['put']('/:id',auth[_0xf0cc('0xa')](),controller[_0xf0cc('0xc')]);router['delete'](_0xf0cc('0xd'),auth[_0xf0cc('0xa')](),controller[_0xf0cc('0xe')]);module[_0xf0cc('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 376cd2f..df52b7d 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 _0x07ba=['STRING','ENUM','first','second','third','sequelize','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x07ba,0x1d3));var _0xa07b=function(_0x1dc99c,_0x2f5f00){_0x1dc99c=_0x1dc99c-0x0;var _0x51a05d=_0x07ba[_0x1dc99c];return _0x51a05d;};'use strict';var Sequelize=require(_0xa07b('0x0'));module[_0xa07b('0x1')]={'name':{'type':Sequelize[_0xa07b('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xa07b('0x3')](_0xa07b('0x4'),_0xa07b('0x5'),_0xa07b('0x6')),'allowNull':![],'defaultValue':_0xa07b('0x4')},'description':{'type':Sequelize[_0xa07b('0x2')]}}; \ No newline at end of file +var _0x71ed=['STRING','exports','ENUM','first','second','third'];(function(_0x2d0a3b,_0x23e317){var _0x277f97=function(_0x4ef747){while(--_0x4ef747){_0x2d0a3b['push'](_0x2d0a3b['shift']());}};_0x277f97(++_0x23e317);}(_0x71ed,0xeb));var _0xd71e=function(_0x21e9ae,_0x5138ed){_0x21e9ae=_0x21e9ae-0x0;var _0x1d3866=_0x71ed[_0x21e9ae];return _0x1d3866;};'use strict';var Sequelize=require('sequelize');module[_0xd71e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xd71e('0x1')](_0xd71e('0x2'),_0xd71e('0x3'),_0xd71e('0x4')),'allowNull':![],'defaultValue':_0xd71e('0x2')},'description':{'type':Sequelize[_0xd71e('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 54e6c4c..4e7488e 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 _0x82c4=['pick','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','end','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x82c4,0x1ca));var _0x482c=function(_0x1d408d,_0x2fef27){_0x1d408d=_0x1d408d-0x0;var _0x112a98=_0x82c4[_0x1d408d];return _0x112a98;};'use strict';var emlformat=require(_0x482c('0x0'));var rimraf=require(_0x482c('0x1'));var zipdir=require(_0x482c('0x2'));var jsonpatch=require(_0x482c('0x3'));var rp=require(_0x482c('0x4'));var moment=require(_0x482c('0x5'));var BPromise=require(_0x482c('0x6'));var Mustache=require('mustache');var util=require(_0x482c('0x7'));var path=require('path');var sox=require(_0x482c('0x8'));var csv=require('to-csv');var ejs=require(_0x482c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var as=require(_0x482c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x482c('0x15'))(_0x482c('0x16'));var utils=require(_0x482c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x482c('0x18'));var db=require(_0x482c('0x19'))['db'];function respondWithStatusCode(_0x3fabb3,_0x56aafd){_0x56aafd=_0x56aafd||0xcc;return function(_0x4bfb3a){if(_0x4bfb3a){return _0x3fabb3[_0x482c('0x1a')](_0x56aafd);}return _0x3fabb3[_0x482c('0x1b')](_0x56aafd)['end']();};}function respondWithResult(_0x56ee17,_0x14452b){_0x14452b=_0x14452b||0xc8;return function(_0xe3f853){if(_0xe3f853){return _0x56ee17[_0x482c('0x1b')](_0x14452b)[_0x482c('0x1c')](_0xe3f853);}};}function respondWithFilteredResult(_0x37a4f0,_0x119635){return function(_0x3beedb){if(_0x3beedb){var _0xf65563=typeof _0x119635[_0x482c('0x1d')]===_0x482c('0x1e')&&typeof _0x119635[_0x482c('0x1f')]===_0x482c('0x1e');var _0x4bdf15=_0x3beedb[_0x482c('0x20')];var _0x5b6f7e=_0xf65563?0x0:_0x119635[_0x482c('0x1d')];var _0x258148=_0xf65563?_0x3beedb['count']:_0x119635['offset']+_0x119635[_0x482c('0x1f')];var _0x584656;if(_0x258148>=_0x4bdf15){_0x258148=_0x4bdf15;_0x584656=0xc8;}else{_0x584656=0xce;}_0x37a4f0[_0x482c('0x1b')](_0x584656);return _0x37a4f0[_0x482c('0x21')](_0x482c('0x22'),_0x5b6f7e+'-'+_0x258148+'/'+_0x4bdf15)[_0x482c('0x1c')](_0x3beedb);}return null;};}function patchUpdates(_0x5c927b){return function(_0x1c9a7b){try{jsonpatch[_0x482c('0x23')](_0x1c9a7b,_0x5c927b,!![]);}catch(_0x38a956){return BPromise[_0x482c('0x24')](_0x38a956);}return _0x1c9a7b[_0x482c('0x25')]();};}function saveUpdates(_0x58ed18,_0x4afcd9){return function(_0x238503){if(_0x238503){return _0x238503[_0x482c('0x26')](_0x58ed18)[_0x482c('0x27')](function(_0x5c4e9c){return _0x5c4e9c;});}return null;};}function removeEntity(_0x3d5490,_0x579d2f){return function(_0x2f3f96){if(_0x2f3f96){return _0x2f3f96[_0x482c('0x28')]()['then'](function(){var _0x466583=_0x2f3f96['get']({'plain':!![]});var _0x589bc6=_0x482c('0x29');return db[_0x482c('0x2a')][_0x482c('0x28')]({'where':{'type':_0x589bc6,'resourceId':_0x466583['id']}})[_0x482c('0x27')](function(){return _0x2f3f96;});})[_0x482c('0x27')](function(){_0x3d5490[_0x482c('0x1b')](0xcc)[_0x482c('0x2b')]();});}};}function handleEntityNotFound(_0x5ad788,_0xb65836){return function(_0x255417){if(!_0x255417){_0x5ad788['sendStatus'](0x194);}return _0x255417;};}function handleError(_0xb01bc3,_0x52b6fc){_0x52b6fc=_0x52b6fc||0x1f4;return function(_0x54782d){logger[_0x482c('0x2c')](_0x54782d['stack']);if(_0x54782d[_0x482c('0x2d')]){delete _0x54782d[_0x482c('0x2d')];}_0xb01bc3[_0x482c('0x1b')](_0x52b6fc)[_0x482c('0x2e')](_0x54782d);};}exports[_0x482c('0x2f')]=function(_0x11950f,_0x36b00d){var _0x3e9b22={},_0x24b4df={},_0x2d3800={'count':0x0,'rows':[]};var _0x3135a7=_[_0x482c('0x30')](db[_0x482c('0x31')][_0x482c('0x32')],function(_0x1eac87){return{'name':_0x1eac87[_0x482c('0x33')],'type':_0x1eac87[_0x482c('0x34')][_0x482c('0x35')]};});_0x24b4df['model']=_['map'](_0x3135a7,'name');_0x24b4df[_0x482c('0x36')]=_[_0x482c('0x37')](_0x11950f[_0x482c('0x36')]);_0x24b4df[_0x482c('0x38')]=_['intersection'](_0x24b4df[_0x482c('0x39')],_0x24b4df['query']);_0x3e9b22[_0x482c('0x3a')]=_[_0x482c('0x3b')](_0x24b4df[_0x482c('0x39')],qs[_0x482c('0x3c')](_0x11950f[_0x482c('0x36')][_0x482c('0x3c')]));_0x3e9b22[_0x482c('0x3a')]=_0x3e9b22[_0x482c('0x3a')]['length']?_0x3e9b22['attributes']:_0x24b4df[_0x482c('0x39')];if(!_0x11950f['query'][_0x482c('0x3d')](_0x482c('0x3e'))){_0x3e9b22[_0x482c('0x1f')]=qs['limit'](_0x11950f[_0x482c('0x36')][_0x482c('0x1f')]);_0x3e9b22[_0x482c('0x1d')]=qs[_0x482c('0x1d')](_0x11950f['query'][_0x482c('0x1d')]);}_0x3e9b22['order']=qs[_0x482c('0x3f')](_0x11950f['query'][_0x482c('0x3f')]);_0x3e9b22['where']=qs[_0x482c('0x38')](_[_0x482c('0x40')](_0x11950f['query'],_0x24b4df[_0x482c('0x38')]),_0x3135a7);if(_0x11950f['query']['filter']){_0x3e9b22[_0x482c('0x41')]=_['merge'](_0x3e9b22['where'],{'$or':_['map'](_0x3135a7,function(_0x581757){if(_0x581757[_0x482c('0x34')]!==_0x482c('0x42')){var _0x39b121={};_0x39b121[_0x581757[_0x482c('0x2d')]]={'$like':'%'+_0x11950f[_0x482c('0x36')]['filter']+'%'};return _0x39b121;}})});}_0x3e9b22=_[_0x482c('0x43')]({},_0x3e9b22,_0x11950f[_0x482c('0x44')]);var _0x45c8c2={'where':_0x3e9b22[_0x482c('0x41')]};return db['Disposition']['count'](_0x45c8c2)[_0x482c('0x27')](function(_0x44bedf){_0x2d3800[_0x482c('0x20')]=_0x44bedf;if(_0x11950f[_0x482c('0x36')][_0x482c('0x45')]){_0x3e9b22[_0x482c('0x46')]=[{'all':!![]}];}return db[_0x482c('0x31')][_0x482c('0x47')](_0x3e9b22);})[_0x482c('0x27')](function(_0x15fc22){_0x2d3800[_0x482c('0x48')]=_0x15fc22;return _0x2d3800;})['then'](respondWithFilteredResult(_0x36b00d,_0x3e9b22))[_0x482c('0x49')](handleError(_0x36b00d,null));};exports[_0x482c('0x4a')]=function(_0x393ca2,_0xdd4d9d){var _0xcbe404={'raw':!![],'where':{'id':_0x393ca2[_0x482c('0x4b')]['id']}},_0x3dd8a2={};_0x3dd8a2['model']=_['keys'](db[_0x482c('0x31')][_0x482c('0x32')]);_0x3dd8a2[_0x482c('0x36')]=_['keys'](_0x393ca2[_0x482c('0x36')]);_0x3dd8a2['filters']=_[_0x482c('0x3b')](_0x3dd8a2[_0x482c('0x39')],_0x3dd8a2[_0x482c('0x36')]);_0xcbe404[_0x482c('0x3a')]=_['intersection'](_0x3dd8a2[_0x482c('0x39')],qs[_0x482c('0x3c')](_0x393ca2[_0x482c('0x36')]['fields']));_0xcbe404[_0x482c('0x3a')]=_0xcbe404[_0x482c('0x3a')][_0x482c('0x4c')]?_0xcbe404['attributes']:_0x3dd8a2['model'];if(_0x393ca2['query']['includeAll']){_0xcbe404['include']=[{'all':!![]}];}_0xcbe404=_['merge']({},_0xcbe404,_0x393ca2[_0x482c('0x44')]);return db['Disposition'][_0x482c('0x4d')](_0xcbe404)[_0x482c('0x27')](handleEntityNotFound(_0xdd4d9d,null))[_0x482c('0x27')](respondWithResult(_0xdd4d9d,null))[_0x482c('0x49')](handleError(_0xdd4d9d,null));};exports[_0x482c('0x4e')]=function(_0x351eb4,_0x37be4f){return db[_0x482c('0x31')][_0x482c('0x4e')](_0x351eb4[_0x482c('0x4f')],{})[_0x482c('0x27')](function(_0x3f7ff7){var _0x1126b7=_0x351eb4[_0x482c('0x50')][_0x482c('0x51')]({'plain':!![]});if(!_0x1126b7)throw new Error(_0x482c('0x52'));if(_0x1126b7[_0x482c('0x53')]===_0x482c('0x50')){var _0x26e50b=_0x3f7ff7['get']({'plain':!![]});var _0x107b1b=_0x482c('0x29');return db['UserProfileSection'][_0x482c('0x4d')]({'where':{'name':_0x107b1b,'userProfileId':_0x1126b7[_0x482c('0x54')]},'raw':!![]})[_0x482c('0x27')](function(_0x170310){if(_0x170310&&_0x170310[_0x482c('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x26e50b[_0x482c('0x2d')],'resourceId':_0x26e50b['id'],'type':_0x170310[_0x482c('0x2d')],'sectionId':_0x170310['id']},{})[_0x482c('0x27')](function(){return _0x3f7ff7;});}else{return _0x3f7ff7;}})[_0x482c('0x49')](function(_0x257ece){logger[_0x482c('0x2c')](_0x482c('0x56'),_0x257ece);throw _0x257ece;});}return _0x3f7ff7;})['then'](respondWithResult(_0x37be4f,0xc9))['catch'](handleError(_0x37be4f,null));};exports['update']=function(_0x461947,_0x37549d){if(_0x461947[_0x482c('0x4f')]['id']){delete _0x461947[_0x482c('0x4f')]['id'];}return db[_0x482c('0x31')][_0x482c('0x4d')]({'where':{'id':_0x461947[_0x482c('0x4b')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x37549d,null))[_0x482c('0x27')](saveUpdates(_0x461947[_0x482c('0x4f')],null))[_0x482c('0x27')](respondWithResult(_0x37549d,null))['catch'](handleError(_0x37549d,null));};exports[_0x482c('0x28')]=function(_0x3e7c52,_0x1fe26e){return db[_0x482c('0x31')][_0x482c('0x4d')]({'where':{'id':_0x3e7c52[_0x482c('0x4b')]['id']}})[_0x482c('0x27')](handleEntityNotFound(_0x1fe26e,null))[_0x482c('0x27')](removeEntity(_0x1fe26e,null))[_0x482c('0x49')](handleError(_0x1fe26e,null));}; \ No newline at end of file +var _0x41d9=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','destroy','then','get','Dispositions','sendStatus','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require(_0x941d('0x1'));var zipdir=require(_0x941d('0x2'));var jsonpatch=require(_0x941d('0x3'));var rp=require(_0x941d('0x4'));var moment=require(_0x941d('0x5'));var BPromise=require(_0x941d('0x6'));var Mustache=require('mustache');var util=require(_0x941d('0x7'));var path=require(_0x941d('0x8'));var sox=require('sox');var csv=require(_0x941d('0x9'));var ejs=require(_0x941d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x941d('0xb'));var squel=require('squel');var crypto=require(_0x941d('0xc'));var jsforce=require(_0x941d('0xd'));var deskjs=require(_0x941d('0xe'));var toCsv=require(_0x941d('0x9'));var querystring=require(_0x941d('0xf'));var Papa=require('papaparse');var Redis=require(_0x941d('0x10'));var authService=require(_0x941d('0x11'));var qs=require(_0x941d('0x12'));var as=require(_0x941d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941d('0x14'))(_0x941d('0x15'));var utils=require(_0x941d('0x16'));var config=require(_0x941d('0x17'));var licenseUtil=require(_0x941d('0x18'));var db=require(_0x941d('0x19'))['db'];function respondWithStatusCode(_0x4d93c4,_0x192331){_0x192331=_0x192331||0xcc;return function(_0x55c5aa){if(_0x55c5aa){return _0x4d93c4['sendStatus'](_0x192331);}return _0x4d93c4[_0x941d('0x1a')](_0x192331)[_0x941d('0x1b')]();};}function respondWithResult(_0xbd3711,_0x2aa972){_0x2aa972=_0x2aa972||0xc8;return function(_0x20a6ab){if(_0x20a6ab){return _0xbd3711[_0x941d('0x1a')](_0x2aa972)[_0x941d('0x1c')](_0x20a6ab);}};}function respondWithFilteredResult(_0x45d85d,_0x369b0b){return function(_0x1f1aeb){if(_0x1f1aeb){var _0x7df80e=typeof _0x369b0b['offset']===_0x941d('0x1d')&&typeof _0x369b0b[_0x941d('0x1e')]===_0x941d('0x1d');var _0x2e5c4f=_0x1f1aeb[_0x941d('0x1f')];var _0x3ac25f=_0x7df80e?0x0:_0x369b0b[_0x941d('0x20')];var _0x2c6ce5=_0x7df80e?_0x1f1aeb[_0x941d('0x1f')]:_0x369b0b['offset']+_0x369b0b[_0x941d('0x1e')];var _0x57f5e6;if(_0x2c6ce5>=_0x2e5c4f){_0x2c6ce5=_0x2e5c4f;_0x57f5e6=0xc8;}else{_0x57f5e6=0xce;}_0x45d85d[_0x941d('0x1a')](_0x57f5e6);return _0x45d85d[_0x941d('0x21')]('Content-Range',_0x3ac25f+'-'+_0x2c6ce5+'/'+_0x2e5c4f)[_0x941d('0x1c')](_0x1f1aeb);}return null;};}function patchUpdates(_0x5ac2e6){return function(_0x526708){try{jsonpatch[_0x941d('0x22')](_0x526708,_0x5ac2e6,!![]);}catch(_0xf6636){return BPromise[_0x941d('0x23')](_0xf6636);}return _0x526708['save']();};}function saveUpdates(_0x1309af,_0x3baf0b){return function(_0xc19c76){if(_0xc19c76){return _0xc19c76['update'](_0x1309af)['then'](function(_0x520bb2){return _0x520bb2;});}return null;};}function removeEntity(_0x306557,_0x26b7b6){return function(_0xd72c49){if(_0xd72c49){return _0xd72c49[_0x941d('0x24')]()[_0x941d('0x25')](function(){var _0x572190=_0xd72c49[_0x941d('0x26')]({'plain':!![]});var _0x43a443=_0x941d('0x27');return db['UserProfileResource'][_0x941d('0x24')]({'where':{'type':_0x43a443,'resourceId':_0x572190['id']}})[_0x941d('0x25')](function(){return _0xd72c49;});})[_0x941d('0x25')](function(){_0x306557[_0x941d('0x1a')](0xcc)[_0x941d('0x1b')]();});}};}function handleEntityNotFound(_0x213052,_0x1a3dc2){return function(_0x2f20b3){if(!_0x2f20b3){_0x213052[_0x941d('0x28')](0x194);}return _0x2f20b3;};}function handleError(_0x145991,_0x2f38c8){_0x2f38c8=_0x2f38c8||0x1f4;return function(_0x1cacc4){logger['error'](_0x1cacc4[_0x941d('0x29')]);if(_0x1cacc4[_0x941d('0x2a')]){delete _0x1cacc4['name'];}_0x145991[_0x941d('0x1a')](_0x2f38c8)[_0x941d('0x2b')](_0x1cacc4);};}exports[_0x941d('0x2c')]=function(_0x367607,_0x46db04){var _0x17e60d={},_0x406f8b={},_0x596d0b={'count':0x0,'rows':[]};var _0x59297e=_[_0x941d('0x2d')](db[_0x941d('0x2e')][_0x941d('0x2f')],function(_0x5b94f5){return{'name':_0x5b94f5['fieldName'],'type':_0x5b94f5[_0x941d('0x30')][_0x941d('0x31')]};});_0x406f8b[_0x941d('0x32')]=_['map'](_0x59297e,_0x941d('0x2a'));_0x406f8b[_0x941d('0x33')]=_[_0x941d('0x34')](_0x367607[_0x941d('0x33')]);_0x406f8b['filters']=_[_0x941d('0x35')](_0x406f8b[_0x941d('0x32')],_0x406f8b[_0x941d('0x33')]);_0x17e60d[_0x941d('0x36')]=_[_0x941d('0x35')](_0x406f8b[_0x941d('0x32')],qs['fields'](_0x367607['query']['fields']));_0x17e60d[_0x941d('0x36')]=_0x17e60d['attributes'][_0x941d('0x37')]?_0x17e60d[_0x941d('0x36')]:_0x406f8b[_0x941d('0x32')];if(!_0x367607[_0x941d('0x33')][_0x941d('0x38')](_0x941d('0x39'))){_0x17e60d[_0x941d('0x1e')]=qs[_0x941d('0x1e')](_0x367607[_0x941d('0x33')][_0x941d('0x1e')]);_0x17e60d['offset']=qs[_0x941d('0x20')](_0x367607[_0x941d('0x33')][_0x941d('0x20')]);}_0x17e60d[_0x941d('0x3a')]=qs[_0x941d('0x3b')](_0x367607[_0x941d('0x33')][_0x941d('0x3b')]);_0x17e60d[_0x941d('0x3c')]=qs[_0x941d('0x3d')](_[_0x941d('0x3e')](_0x367607[_0x941d('0x33')],_0x406f8b[_0x941d('0x3d')]),_0x59297e);if(_0x367607[_0x941d('0x33')]['filter']){_0x17e60d['where']=_[_0x941d('0x3f')](_0x17e60d[_0x941d('0x3c')],{'$or':_['map'](_0x59297e,function(_0x372009){if(_0x372009['type']!==_0x941d('0x40')){var _0x513f28={};_0x513f28[_0x372009[_0x941d('0x2a')]]={'$like':'%'+_0x367607['query'][_0x941d('0x41')]+'%'};return _0x513f28;}})});}_0x17e60d=_[_0x941d('0x3f')]({},_0x17e60d,_0x367607[_0x941d('0x42')]);var _0x2dc0aa={'where':_0x17e60d[_0x941d('0x3c')]};return db['Disposition']['count'](_0x2dc0aa)[_0x941d('0x25')](function(_0x3354ef){_0x596d0b[_0x941d('0x1f')]=_0x3354ef;if(_0x367607[_0x941d('0x33')][_0x941d('0x43')]){_0x17e60d[_0x941d('0x44')]=[{'all':!![]}];}return db[_0x941d('0x2e')][_0x941d('0x45')](_0x17e60d);})[_0x941d('0x25')](function(_0xf7ff74){_0x596d0b[_0x941d('0x46')]=_0xf7ff74;return _0x596d0b;})[_0x941d('0x25')](respondWithFilteredResult(_0x46db04,_0x17e60d))[_0x941d('0x47')](handleError(_0x46db04,null));};exports['show']=function(_0x1d72a9,_0x54e731){var _0x19a842={'raw':!![],'where':{'id':_0x1d72a9['params']['id']}},_0x58a2c9={};_0x58a2c9['model']=_['keys'](db[_0x941d('0x2e')][_0x941d('0x2f')]);_0x58a2c9['query']=_[_0x941d('0x34')](_0x1d72a9[_0x941d('0x33')]);_0x58a2c9[_0x941d('0x3d')]=_['intersection'](_0x58a2c9['model'],_0x58a2c9[_0x941d('0x33')]);_0x19a842[_0x941d('0x36')]=_[_0x941d('0x35')](_0x58a2c9[_0x941d('0x32')],qs['fields'](_0x1d72a9[_0x941d('0x33')]['fields']));_0x19a842['attributes']=_0x19a842['attributes'][_0x941d('0x37')]?_0x19a842[_0x941d('0x36')]:_0x58a2c9[_0x941d('0x32')];if(_0x1d72a9[_0x941d('0x33')]['includeAll']){_0x19a842[_0x941d('0x44')]=[{'all':!![]}];}_0x19a842=_[_0x941d('0x3f')]({},_0x19a842,_0x1d72a9[_0x941d('0x42')]);return db['Disposition']['find'](_0x19a842)[_0x941d('0x25')](handleEntityNotFound(_0x54e731,null))['then'](respondWithResult(_0x54e731,null))[_0x941d('0x47')](handleError(_0x54e731,null));};exports[_0x941d('0x48')]=function(_0x319d85,_0xef7ff7){return db[_0x941d('0x2e')][_0x941d('0x48')](_0x319d85[_0x941d('0x49')],{})[_0x941d('0x25')](function(_0x197383){var _0x208069=_0x319d85[_0x941d('0x4a')][_0x941d('0x26')]({'plain':!![]});if(!_0x208069)throw new Error(_0x941d('0x4b'));if(_0x208069[_0x941d('0x4c')]===_0x941d('0x4a')){var _0x2ec3cf=_0x197383[_0x941d('0x26')]({'plain':!![]});var _0x597f4f=_0x941d('0x27');return db[_0x941d('0x4d')][_0x941d('0x4e')]({'where':{'name':_0x597f4f,'userProfileId':_0x208069['userProfileId']},'raw':!![]})['then'](function(_0x3891ef){if(_0x3891ef&&_0x3891ef['autoAssociation']===0x0){return db['UserProfileResource'][_0x941d('0x48')]({'name':_0x2ec3cf[_0x941d('0x2a')],'resourceId':_0x2ec3cf['id'],'type':_0x3891ef[_0x941d('0x2a')],'sectionId':_0x3891ef['id']},{})[_0x941d('0x25')](function(){return _0x197383;});}else{return _0x197383;}})[_0x941d('0x47')](function(_0x495916){logger['error'](_0x941d('0x4f'),_0x495916);throw _0x495916;});}return _0x197383;})[_0x941d('0x25')](respondWithResult(_0xef7ff7,0xc9))[_0x941d('0x47')](handleError(_0xef7ff7,null));};exports[_0x941d('0x50')]=function(_0x4431aa,_0x2b5f21){if(_0x4431aa[_0x941d('0x49')]['id']){delete _0x4431aa[_0x941d('0x49')]['id'];}return db[_0x941d('0x2e')][_0x941d('0x4e')]({'where':{'id':_0x4431aa[_0x941d('0x51')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0x2b5f21,null))[_0x941d('0x25')](saveUpdates(_0x4431aa['body'],null))[_0x941d('0x25')](respondWithResult(_0x2b5f21,null))[_0x941d('0x47')](handleError(_0x2b5f21,null));};exports[_0x941d('0x24')]=function(_0x38ea0d,_0x1295da){return db[_0x941d('0x2e')][_0x941d('0x4e')]({'where':{'id':_0x38ea0d[_0x941d('0x51')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0x1295da,null))[_0x941d('0x25')](removeEntity(_0x1295da,null))[_0x941d('0x47')](handleError(_0x1295da,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f786952..472d7f7 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 _0x8857=['tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','Disposition'];(function(_0x5463b1,_0x238edb){var _0x1bf00f=function(_0x33110e){while(--_0x33110e){_0x5463b1['push'](_0x5463b1['shift']());}};_0x1bf00f(++_0x238edb);}(_0x8857,0x74));var _0x7885=function(_0x485d53,_0x15b471){_0x485d53=_0x485d53-0x0;var _0x208411=_0x8857[_0x485d53];return _0x208411;};'use strict';var _=require(_0x7885('0x0'));var util=require(_0x7885('0x1'));var logger=require(_0x7885('0x2'))(_0x7885('0x3'));var moment=require(_0x7885('0x4'));var BPromise=require('bluebird');var rp=require(_0x7885('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7885('0x6'));var config=require(_0x7885('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x2651b6,_0x1d8e8c){return _0x2651b6[_0x7885('0x8')](_0x7885('0x9'),attributes,{'tableName':_0x7885('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x7885('0xb')]},{'unique':!![],'name':_0x7885('0xc'),'fields':[_0x7885('0xd'),_0x7885('0xe')]},{'unique':!![],'name':_0x7885('0xf'),'fields':[_0x7885('0xd'),_0x7885('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0x7885('0xd'),_0x7885('0x11')]},{'unique':!![],'name':_0x7885('0x12'),'fields':[_0x7885('0xd'),_0x7885('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0x7885('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x7885('0x14'),'fields':[_0x7885('0xd'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5af8=['MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','name_mail'];(function(_0x5a59d3,_0x3777e7){var _0x58b482=function(_0x2835ed){while(--_0x2835ed){_0x5a59d3['push'](_0x5a59d3['shift']());}};_0x58b482(++_0x3777e7);}(_0x5af8,0x1c2));var _0x85af=function(_0x26ac2c,_0xa56f76){_0x26ac2c=_0x26ac2c-0x0;var _0x10916c=_0x5af8[_0x26ac2c];return _0x10916c;};'use strict';var _=require(_0x85af('0x0'));var util=require(_0x85af('0x1'));var logger=require(_0x85af('0x2'))(_0x85af('0x3'));var moment=require(_0x85af('0x4'));var BPromise=require(_0x85af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85af('0x6'));var rimraf=require(_0x85af('0x7'));var config=require(_0x85af('0x8'));var attributes=require(_0x85af('0x9'));module[_0x85af('0xa')]=function(_0x1702b2,_0x1a83f4){return _0x1702b2[_0x85af('0xb')](_0x85af('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x85af('0xd'),'fields':[_0x85af('0xe'),_0x85af('0xf')]},{'unique':!![],'name':_0x85af('0x10'),'fields':[_0x85af('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0x85af('0x11'),'fields':[_0x85af('0xe'),_0x85af('0x12')]},{'unique':!![],'name':_0x85af('0x13'),'fields':[_0x85af('0xe'),_0x85af('0x14')]},{'unique':!![],'name':_0x85af('0x15'),'fields':[_0x85af('0xe'),_0x85af('0x16')]},{'unique':!![],'name':_0x85af('0x17'),'fields':[_0x85af('0xe'),_0x85af('0x18')]},{'unique':!![],'name':_0x85af('0x19'),'fields':[_0x85af('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index e02b776..52a6087 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(_0x3c8c6f,_0x445ad1){var _0x2f0436=function(_0x524e22){while(--_0x524e22){_0x3c8c6f['push'](_0x3c8c6f['shift']());}};_0x2f0436(++_0x445ad1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x1e65c8,_0x2ee9f7){var _0x340cc4=function(_0x2abd1){while(--_0x2abd1){_0x1e65c8['push'](_0x1e65c8['shift']());}};_0x340cc4(++_0x2ee9f7);}(_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/disposition/index.js b/server/api/disposition/index.js index af90376..095f66c 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 _0x4be7=['update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x54c327,_0x321118){var _0x1e380c=function(_0x6304f){while(--_0x6304f){_0x54c327['push'](_0x54c327['shift']());}};_0x1e380c(++_0x321118);}(_0x4be7,0x93));var _0x74be=function(_0x1b33bc,_0x282af6){_0x1b33bc=_0x1b33bc-0x0;var _0x23b81c=_0x4be7[_0x1b33bc];return _0x23b81c;};'use strict';var multer=require('multer');var util=require(_0x74be('0x0'));var path=require('path');var timeout=require(_0x74be('0x1'));var express=require('express');var router=express[_0x74be('0x2')]();var fs_extra=require(_0x74be('0x3'));var auth=require(_0x74be('0x4'));var interaction=require(_0x74be('0x5'));var config=require(_0x74be('0x6'));var controller=require(_0x74be('0x7'));router[_0x74be('0x8')]('/',auth[_0x74be('0x9')](),controller[_0x74be('0xa')]);router[_0x74be('0x8')](_0x74be('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x74be('0xc')]('/',auth[_0x74be('0x9')](),controller[_0x74be('0xd')]);router[_0x74be('0xe')](_0x74be('0xb'),auth[_0x74be('0x9')](),controller[_0x74be('0xf')]);router[_0x74be('0x10')](_0x74be('0xb'),auth[_0x74be('0x9')](),controller[_0x74be('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4aca=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','create','delete','exports'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0x4aca,0x120));var _0xa4ac=function(_0x3744ac,_0x58b58f){_0x3744ac=_0x3744ac-0x0;var _0x303472=_0x4aca[_0x3744ac];return _0x303472;};'use strict';var multer=require(_0xa4ac('0x0'));var util=require(_0xa4ac('0x1'));var path=require(_0xa4ac('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4ac('0x3'));var router=express[_0xa4ac('0x4')]();var fs_extra=require(_0xa4ac('0x5'));var auth=require(_0xa4ac('0x6'));var interaction=require(_0xa4ac('0x7'));var config=require(_0xa4ac('0x8'));var controller=require(_0xa4ac('0x9'));router['get']('/',auth[_0xa4ac('0xa')](),controller[_0xa4ac('0xb')]);router[_0xa4ac('0xc')](_0xa4ac('0xd'),auth['isAuthenticated'](),controller[_0xa4ac('0xe')]);router['post']('/',auth[_0xa4ac('0xa')](),controller[_0xa4ac('0xf')]);router['put'](_0xa4ac('0xd'),auth[_0xa4ac('0xa')](),controller['update']);router[_0xa4ac('0x10')]('/:id',auth[_0xa4ac('0xa')](),controller['destroy']);module[_0xa4ac('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 696f8a7..342f4bf 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 _0x8411=['9600','12000','ENUM','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','localstationid','4800','7200'];(function(_0x53c861,_0x140c9c){var _0x417b7b=function(_0x495754){while(--_0x495754){_0x53c861['push'](_0x53c861['shift']());}};_0x417b7b(++_0x140c9c);}(_0x8411,0x9a));var _0x1841=function(_0x484c11,_0x40c1db){_0x484c11=_0x484c11-0x0;var _0x31b64a=_0x8411[_0x484c11];return _0x31b64a;};'use strict';var Sequelize=require('sequelize');module[_0x1841('0x0')]={'name':{'type':Sequelize[_0x1841('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1841('0x2')},'headerinfo':{'type':Sequelize[_0x1841('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x1841('0x1')],'unique':_0x1841('0x3')},'minrate':{'type':Sequelize['ENUM']('2400',_0x1841('0x4'),_0x1841('0x5'),_0x1841('0x6'),_0x1841('0x7'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x1841('0x8')]('2400',_0x1841('0x4'),'7200',_0x1841('0x6'),_0x1841('0x7'),_0x1841('0x9')),'defaultValue':_0x1841('0x9')},'modem':{'type':Sequelize[_0x1841('0x1')],'defaultValue':_0x1841('0xa')},'gateway':{'type':Sequelize[_0x1841('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1841('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1841('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x1841('0xc'),'IAX',_0x1841('0xd'),_0x1841('0xe')),'defaultValue':_0x1841('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1841('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1841('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1841('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1841('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1841('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1841('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4185ae){if(!_0x4185ae)this[_0x1841('0x11')](_0x1841('0x12'),null);this[_0x1841('0x11')](_0x1841('0x13'),_0x4185ae);}}}; \ No newline at end of file +var _0x1cc5=['12000','14400','2400','7200','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','exports','STRING','ENUM','yes','4800','9600'];(function(_0x3ee5bd,_0xac7eda){var _0x5bbda5=function(_0x550709){while(--_0x550709){_0x3ee5bd['push'](_0x3ee5bd['shift']());}};_0x5bbda5(++_0xac7eda);}(_0x1cc5,0x1c6));var _0x51cc=function(_0x366655,_0x4d032){_0x366655=_0x366655-0x0;var _0x11e076=_0x1cc5[_0x366655];return _0x11e076;};'use strict';var Sequelize=require('sequelize');module[_0x51cc('0x0')]={'name':{'type':Sequelize[_0x51cc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x51cc('0x1')]},'ecm':{'type':Sequelize[_0x51cc('0x2')](_0x51cc('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x51cc('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM']('2400',_0x51cc('0x4'),'7200',_0x51cc('0x5'),_0x51cc('0x6'),_0x51cc('0x7')),'defaultValue':_0x51cc('0x4')},'maxrate':{'type':Sequelize[_0x51cc('0x2')](_0x51cc('0x8'),_0x51cc('0x4'),_0x51cc('0x9'),_0x51cc('0x5'),_0x51cc('0x6'),_0x51cc('0x7')),'defaultValue':_0x51cc('0x7')},'modem':{'type':Sequelize[_0x51cc('0x1')],'defaultValue':_0x51cc('0xa')},'gateway':{'type':Sequelize[_0x51cc('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x51cc('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x51cc('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x51cc('0x2')](_0x51cc('0xc'),_0x51cc('0xd'),'DADHI',_0x51cc('0xe')),'defaultValue':_0x51cc('0xc')},'key':{'type':Sequelize[_0x51cc('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x51cc('0xf');}},'notificationSound':{'type':Sequelize[_0x51cc('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x51cc('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x51cc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x51cc('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x51cc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x51cc('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x51cc('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x51cc('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x51cc('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4e6ec8){if(!_0x4e6ec8)this[_0x51cc('0x12')]('mandatoryDispositionPauseId',null);this[_0x51cc('0x12')](_0x51cc('0x13'),_0x4e6ec8);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c592112..22946cd 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 _0xdcfd=['pick','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','app','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','ReceiveFax','addAccountApplications','sequelize','bulkCreate','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','user','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','FaxAccounts','end','sendStatus','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','FaxAccount','includeAll','include','show','params','mandatoryDispositionPause','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','describe','FaxAccountId','getDispositions','findOne','Disposition'];(function(_0x111155,_0x47d1f2){var _0x4989bb=function(_0xe9b4f5){while(--_0xe9b4f5){_0x111155['push'](_0x111155['shift']());}};_0x4989bb(++_0x47d1f2);}(_0xdcfd,0x11c));var _0xddcf=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0xdcfd[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0xddcf('0x0'));var rimraf=require(_0xddcf('0x1'));var zipdir=require(_0xddcf('0x2'));var jsonpatch=require(_0xddcf('0x3'));var rp=require(_0xddcf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xddcf('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xddcf('0x6'));var fs=require('fs');var fs_extra=require(_0xddcf('0x7'));var _=require(_0xddcf('0x8'));var squel=require(_0xddcf('0x9'));var crypto=require(_0xddcf('0xa'));var jsforce=require(_0xddcf('0xb'));var deskjs=require(_0xddcf('0xc'));var toCsv=require('to-csv');var querystring=require(_0xddcf('0xd'));var Papa=require(_0xddcf('0xe'));var Redis=require(_0xddcf('0xf'));var authService=require(_0xddcf('0x10'));var qs=require(_0xddcf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xddcf('0x12'))(_0xddcf('0x13'));var utils=require(_0xddcf('0x14'));var config=require(_0xddcf('0x15'));var licenseUtil=require(_0xddcf('0x16'));var db=require('../../mysqldb')['db'];config[_0xddcf('0x17')]=_[_0xddcf('0x18')](config[_0xddcf('0x17')],{'host':_0xddcf('0x19'),'port':0x18eb});var socket=require(_0xddcf('0x1a'))(new Redis(config[_0xddcf('0x17')]));require(_0xddcf('0x1b'))[_0xddcf('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xddcf('0x1d')][_0xddcf('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xddcf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1b807a,_0x1a400e,_0x1bcde0,_0x4cf835){return new BPromise(function(_0x3eabf7,_0x1c4aa9){var _0x4caa68=_0x4cf835||client;return _0x4caa68['request'](_0x1b807a,_0x1bcde0)[_0xddcf('0x1f')](function(_0x2aee08){logger['info'](_0xddcf('0x20'),_0x1a400e,'request\x20sent');logger[_0xddcf('0x21')](_0xddcf('0x22'),_0x1a400e,_0xddcf('0x23'),JSON[_0xddcf('0x24')](_0x2aee08));if(_0x2aee08[_0xddcf('0x25')]){if(_0x2aee08[_0xddcf('0x25')][_0xddcf('0x26')]===0x1f4){logger[_0xddcf('0x25')](_0xddcf('0x20'),_0x1a400e,_0x2aee08[_0xddcf('0x25')][_0xddcf('0x27')]);return _0x1c4aa9(_0x2aee08[_0xddcf('0x25')][_0xddcf('0x27')]);}logger[_0xddcf('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1a400e,_0x2aee08[_0xddcf('0x25')][_0xddcf('0x27')]);return _0x3eabf7(_0x2aee08['error'][_0xddcf('0x27')]);}else{logger[_0xddcf('0x28')](_0xddcf('0x20'),_0x1a400e,_0xddcf('0x23'));_0x3eabf7(_0x2aee08[_0xddcf('0x29')][_0xddcf('0x27')]);}})[_0xddcf('0x2a')](function(_0x2ac241){logger[_0xddcf('0x25')](_0xddcf('0x20'),_0x1a400e,_0x2ac241);_0x1c4aa9(_0x2ac241);});});}function respondWithStatusCode(_0x1609f4,_0x1b74ea){_0x1b74ea=_0x1b74ea||0xcc;return function(_0x3f7319){if(_0x3f7319){return _0x1609f4['sendStatus'](_0x1b74ea);}return _0x1609f4['status'](_0x1b74ea)['end']();};}function respondWithResult(_0x4525e9,_0x4644cf){_0x4644cf=_0x4644cf||0xc8;return function(_0x880ec7){if(_0x880ec7){return _0x4525e9[_0xddcf('0x2b')](_0x4644cf)[_0xddcf('0x2c')](_0x880ec7);}};}function respondWithFilteredResult(_0x500c0f,_0x1ecab1){return function(_0x46602d){if(_0x46602d){var _0x5a3464=typeof _0x1ecab1[_0xddcf('0x2d')]===_0xddcf('0x2e')&&typeof _0x1ecab1[_0xddcf('0x2f')]==='undefined';var _0x1a5ab0=_0x46602d['count'];var _0x494d34=_0x5a3464?0x0:_0x1ecab1[_0xddcf('0x2d')];var _0x537a83=_0x5a3464?_0x46602d[_0xddcf('0x30')]:_0x1ecab1[_0xddcf('0x2d')]+_0x1ecab1[_0xddcf('0x2f')];var _0x3ea360;if(_0x537a83>=_0x1a5ab0){_0x537a83=_0x1a5ab0;_0x3ea360=0xc8;}else{_0x3ea360=0xce;}_0x500c0f['status'](_0x3ea360);return _0x500c0f[_0xddcf('0x31')]('Content-Range',_0x494d34+'-'+_0x537a83+'/'+_0x1a5ab0)[_0xddcf('0x2c')](_0x46602d);}return null;};}function patchUpdates(_0x35266c){return function(_0x14781a){try{jsonpatch[_0xddcf('0x32')](_0x14781a,_0x35266c,!![]);}catch(_0x4e77d9){return BPromise[_0xddcf('0x33')](_0x4e77d9);}return _0x14781a[_0xddcf('0x34')]();};}function saveUpdates(_0xd5478b,_0x4042ab){return function(_0x416f50){if(_0x416f50){return _0x416f50[_0xddcf('0x35')](_0xd5478b)['then'](function(_0x1d1f25){return _0x1d1f25;});}return null;};}function removeEntity(_0x400e93,_0x13c246){return function(_0x4c3bc8){if(_0x4c3bc8){return _0x4c3bc8[_0xddcf('0x36')]()[_0xddcf('0x1f')](function(){var _0x448949=_0x4c3bc8[_0xddcf('0x37')]({'plain':!![]});var _0x3b4203=_0xddcf('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b4203,'resourceId':_0x448949['id']}})['then'](function(){return _0x4c3bc8;});})['then'](function(){_0x400e93[_0xddcf('0x2b')](0xcc)[_0xddcf('0x39')]();});}};}function handleEntityNotFound(_0x364275,_0x5b11ff){return function(_0xc3b300){if(!_0xc3b300){_0x364275[_0xddcf('0x3a')](0x194);}return _0xc3b300;};}function handleError(_0x2b047a,_0x390eb2){_0x390eb2=_0x390eb2||0x1f4;return function(_0x1b01ea){logger[_0xddcf('0x25')](_0x1b01ea[_0xddcf('0x3b')]);if(_0x1b01ea[_0xddcf('0x3c')]){delete _0x1b01ea['name'];}_0x2b047a[_0xddcf('0x2b')](_0x390eb2)[_0xddcf('0x3d')](_0x1b01ea);};}exports[_0xddcf('0x3e')]=function(_0x319857,_0x3e5153){var _0x339118={'include':[{'model':db[_0xddcf('0x3f')],'as':'mandatoryDispositionPause'}]},_0x45a558={},_0x416da7={'count':0x0,'rows':[]};var _0x1ef909=_[_0xddcf('0x40')](db['FaxAccount'][_0xddcf('0x41')],function(_0x25ac0f){return{'name':_0x25ac0f[_0xddcf('0x42')],'type':_0x25ac0f[_0xddcf('0x43')][_0xddcf('0x44')]};});_0x45a558[_0xddcf('0x45')]=_[_0xddcf('0x40')](_0x1ef909,_0xddcf('0x3c'));_0x45a558[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x319857[_0xddcf('0x46')]);_0x45a558[_0xddcf('0x48')]=_['intersection'](_0x45a558[_0xddcf('0x45')],_0x45a558[_0xddcf('0x46')]);_0x339118['attributes']=_[_0xddcf('0x49')](_0x45a558[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x319857['query']['fields']));_0x339118[_0xddcf('0x4b')]=_0x339118[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x339118['attributes']:_0x45a558[_0xddcf('0x45')];if(!_0x319857[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x339118[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x319857[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x339118['offset']=qs[_0xddcf('0x2d')](_0x319857[_0xddcf('0x46')][_0xddcf('0x2d')]);}_0x339118[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x319857['query'][_0xddcf('0x50')]);_0x339118[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_['pick'](_0x319857['query'],_0x45a558[_0xddcf('0x48')]),_0x1ef909);if(_0x319857[_0xddcf('0x46')][_0xddcf('0x52')]){_0x339118[_0xddcf('0x51')]=_['merge'](_0x339118[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x1ef909,function(_0x28340f){if(_0x28340f[_0xddcf('0x43')]!==_0xddcf('0x53')){var _0x84914f={};_0x84914f[_0x28340f[_0xddcf('0x3c')]]={'$like':'%'+_0x319857[_0xddcf('0x46')][_0xddcf('0x52')]+'%'};return _0x84914f;}})});}_0x339118=_['merge']({},_0x339118,_0x319857['options']);var _0x5f3fe2={'where':_0x339118[_0xddcf('0x51')]};return db[_0xddcf('0x54')]['count'](_0x5f3fe2)[_0xddcf('0x1f')](function(_0x2bd9b6){_0x416da7['count']=_0x2bd9b6;if(_0x319857[_0xddcf('0x46')][_0xddcf('0x55')]){_0x339118[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0x54')]['findAll'](_0x339118);})['then'](function(_0x3134a9){_0x416da7['rows']=_0x3134a9;return _0x416da7;})[_0xddcf('0x1f')](respondWithFilteredResult(_0x3e5153,_0x339118))[_0xddcf('0x2a')](handleError(_0x3e5153,null));};exports[_0xddcf('0x57')]=function(_0xb0cfa9,_0x677076){var _0x1e7b20={'raw':![],'where':{'id':_0xb0cfa9[_0xddcf('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xddcf('0x59')}]},_0x413e84={};_0x413e84[_0xddcf('0x45')]=_[_0xddcf('0x47')](db[_0xddcf('0x54')]['rawAttributes']);_0x413e84[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0xb0cfa9[_0xddcf('0x46')]);_0x413e84[_0xddcf('0x48')]=_[_0xddcf('0x49')](_0x413e84[_0xddcf('0x45')],_0x413e84[_0xddcf('0x46')]);_0x1e7b20[_0xddcf('0x4b')]=_[_0xddcf('0x49')](_0x413e84[_0xddcf('0x45')],qs['fields'](_0xb0cfa9[_0xddcf('0x46')]['fields']));_0x1e7b20[_0xddcf('0x4b')]=_0x1e7b20['attributes']['length']?_0x1e7b20['attributes']:_0x413e84[_0xddcf('0x45')];if(_0xb0cfa9[_0xddcf('0x46')][_0xddcf('0x55')]){_0x1e7b20[_0xddcf('0x56')]=[{'all':!![]}];}_0x1e7b20=_[_0xddcf('0x5a')]({},_0x1e7b20,_0xb0cfa9[_0xddcf('0x5b')]);return db['FaxAccount'][_0xddcf('0x5c')](_0x1e7b20)[_0xddcf('0x1f')](handleEntityNotFound(_0x677076,null))['then'](respondWithResult(_0x677076,null))['catch'](handleError(_0x677076,null));};exports[_0xddcf('0x5d')]=function(_0x596efe,_0x116889){return db[_0xddcf('0x54')][_0xddcf('0x5d')](_0x596efe[_0xddcf('0x5e')],{})[_0xddcf('0x1f')](function(_0x44fcb7){var _0x5d56b5=_0x596efe['user']['get']({'plain':!![]});if(!_0x5d56b5)throw new Error(_0xddcf('0x5f'));if(_0x5d56b5['role']==='user'){var _0x39312d=_0x44fcb7['get']({'plain':!![]});var _0x265bc2='FaxAccounts';return db[_0xddcf('0x60')][_0xddcf('0x5c')]({'where':{'name':_0x265bc2,'userProfileId':_0x5d56b5['userProfileId']},'raw':!![]})['then'](function(_0x89bb8c){if(_0x89bb8c&&_0x89bb8c[_0xddcf('0x61')]===0x0){return db[_0xddcf('0x62')][_0xddcf('0x5d')]({'name':_0x39312d[_0xddcf('0x3c')],'resourceId':_0x39312d['id'],'type':_0x89bb8c[_0xddcf('0x3c')],'sectionId':_0x89bb8c['id']},{})['then'](function(){return _0x44fcb7;});}else{return _0x44fcb7;}})[_0xddcf('0x2a')](function(_0x559577){logger[_0xddcf('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559577);throw _0x559577;});}return _0x44fcb7;})[_0xddcf('0x1f')](respondWithResult(_0x116889,0xc9))[_0xddcf('0x2a')](handleError(_0x116889,null));};exports[_0xddcf('0x35')]=function(_0x1fff5a,_0x1fa5c3){if(_0x1fff5a['body']['id']){delete _0x1fff5a[_0xddcf('0x5e')]['id'];}return db['FaxAccount'][_0xddcf('0x5c')]({'where':{'id':_0x1fff5a[_0xddcf('0x58')]['id']},'include':[{'model':db[_0xddcf('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xddcf('0x1f')](handleEntityNotFound(_0x1fa5c3,null))[_0xddcf('0x1f')](saveUpdates(_0x1fff5a[_0xddcf('0x5e')],null))[_0xddcf('0x1f')](respondWithResult(_0x1fa5c3,null))[_0xddcf('0x2a')](handleError(_0x1fa5c3,null));};exports[_0xddcf('0x36')]=function(_0x2b5a98,_0x3bb975){return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x2b5a98[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x3bb975,null))[_0xddcf('0x1f')](removeEntity(_0x3bb975,null))[_0xddcf('0x2a')](handleError(_0x3bb975,null));};exports[_0xddcf('0x63')]=function(_0x2befb9,_0x4c7e72){return db[_0xddcf('0x54')][_0xddcf('0x63')]()[_0xddcf('0x1f')](respondWithResult(_0x4c7e72,null))[_0xddcf('0x2a')](handleError(_0x4c7e72,null));};exports['addDisposition']=function(_0x2445ad,_0x23de68,_0x2a08aa){if(_0x2445ad['body']['id']){delete _0x2445ad['body']['id'];}return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x2445ad[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x23de68,null))[_0xddcf('0x1f')](function(_0x2ca152){if(_0x2ca152){_0x2445ad[_0xddcf('0x5e')][_0xddcf('0x64')]=_0x2ca152['id'];return db['Disposition'][_0xddcf('0x5d')](_0x2445ad[_0xddcf('0x5e')]);}})['then'](respondWithResult(_0x23de68,null))[_0xddcf('0x2a')](handleError(_0x23de68,null));};exports[_0xddcf('0x65')]=function(_0x55c618,_0x2a3c2f,_0x2a7787){var _0x3eda3d={'raw':![],'where':{}};var _0x18cba5={};var _0x48703b={'count':0x0,'rows':[]};return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x55c618[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x2a3c2f,null))[_0xddcf('0x1f')](function(_0x846aa2){if(_0x846aa2){_0x18cba5[_0xddcf('0x45')]=_['keys'](db[_0xddcf('0x67')]['rawAttributes']);_0x18cba5['query']=_['keys'](_0x55c618[_0xddcf('0x46')]);_0x18cba5[_0xddcf('0x48')]=_[_0xddcf('0x49')](_0x18cba5[_0xddcf('0x45')],_0x18cba5[_0xddcf('0x46')]);_0x3eda3d[_0xddcf('0x4b')]=_['intersection'](_0x18cba5['model'],qs[_0xddcf('0x4a')](_0x55c618[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x3eda3d[_0xddcf('0x4b')]=_0x3eda3d[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x3eda3d[_0xddcf('0x4b')]:_0x18cba5[_0xddcf('0x45')];if(!_0x55c618[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x3eda3d[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x55c618[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x3eda3d['offset']=qs['offset'](_0x55c618[_0xddcf('0x46')][_0xddcf('0x2d')]);}_0x3eda3d['order']=qs['sort'](_0x55c618[_0xddcf('0x46')]['sort']);_0x3eda3d[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x55c618['query'],_0x18cba5[_0xddcf('0x48')]));_0x3eda3d['where'][_0xddcf('0x64')]=_0x846aa2['id'];if(_0x55c618['query'][_0xddcf('0x52')]){_0x3eda3d[_0xddcf('0x51')]=_['merge'](_0x3eda3d[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x3eda3d[_0xddcf('0x4b')],function(_0x5c4fa6){var _0x64506={};_0x64506[_0x5c4fa6]={'$like':'%'+_0x55c618['query'][_0xddcf('0x52')]+'%'};return _0x64506;})});}_0x3eda3d=_[_0xddcf('0x5a')]({},_0x3eda3d,_0x55c618[_0xddcf('0x5b')]);return db[_0xddcf('0x67')][_0xddcf('0x30')]({'where':_0x3eda3d[_0xddcf('0x51')]})['then'](function(_0x3c9596){_0x48703b[_0xddcf('0x30')]=_0x3c9596;if(_0x55c618[_0xddcf('0x46')][_0xddcf('0x55')]){_0x3eda3d[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0x67')][_0xddcf('0x69')](_0x3eda3d);})[_0xddcf('0x1f')](function(_0x6268ce){_0x48703b['rows']=_0x6268ce;return _0x48703b;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0x2a3c2f,_0x3eda3d))[_0xddcf('0x2a')](handleError(_0x2a3c2f,null));};exports[_0xddcf('0x6a')]=function(_0x23a97b,_0x370c84,_0x2a152c){return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x23a97b[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x370c84,null))['then'](function(_0x4096bc){if(_0x4096bc){return _0x4096bc[_0xddcf('0x6a')](_0x23a97b[_0xddcf('0x46')]['ids']);}})[_0xddcf('0x1f')](respondWithStatusCode(_0x370c84,null))[_0xddcf('0x2a')](handleError(_0x370c84,null));};exports[_0xddcf('0x6b')]=function(_0x1d154a,_0x897262,_0x247125){if(_0x1d154a[_0xddcf('0x5e')]['id']){delete _0x1d154a[_0xddcf('0x5e')]['id'];}return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0x1d154a[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x897262,null))[_0xddcf('0x1f')](function(_0x48b251){if(_0x48b251){_0x1d154a[_0xddcf('0x5e')][_0xddcf('0x64')]=_0x48b251['id'];return db[_0xddcf('0x6c')][_0xddcf('0x5d')](_0x1d154a[_0xddcf('0x5e')]);}})[_0xddcf('0x1f')](respondWithResult(_0x897262,null))[_0xddcf('0x2a')](handleError(_0x897262,null));};exports[_0xddcf('0x6d')]=function(_0x3c3856,_0xb6781c,_0x5a700d){var _0x3eb5da={'raw':![],'where':{}};var _0x54b719={};var _0x969810={'count':0x0,'rows':[]};return db['FaxAccount'][_0xddcf('0x66')]({'where':{'id':_0x3c3856[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0xb6781c,null))[_0xddcf('0x1f')](function(_0x469946){if(_0x469946){_0x54b719[_0xddcf('0x45')]=_['keys'](db[_0xddcf('0x6c')]['rawAttributes']);_0x54b719[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x3c3856['query']);_0x54b719[_0xddcf('0x48')]=_[_0xddcf('0x49')](_0x54b719[_0xddcf('0x45')],_0x54b719['query']);_0x3eb5da['attributes']=_[_0xddcf('0x49')](_0x54b719[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x3c3856[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x3eb5da['attributes']=_0x3eb5da[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x3eb5da[_0xddcf('0x4b')]:_0x54b719[_0xddcf('0x45')];if(!_0x3c3856[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x3eb5da[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x3c3856[_0xddcf('0x46')]['limit']);_0x3eb5da[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x3c3856['query'][_0xddcf('0x2d')]);}_0x3eb5da[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x3c3856['query']['sort']);_0x3eb5da[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x3c3856['query'],_0x54b719[_0xddcf('0x48')]));_0x3eb5da[_0xddcf('0x51')][_0xddcf('0x64')]=_0x469946['id'];if(_0x3c3856[_0xddcf('0x46')]['filter']){_0x3eb5da[_0xddcf('0x51')]=_['merge'](_0x3eb5da[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x3eb5da[_0xddcf('0x4b')],function(_0x40a9ca){var _0x139bc2={};_0x139bc2[_0x40a9ca]={'$like':'%'+_0x3c3856[_0xddcf('0x46')]['filter']+'%'};return _0x139bc2;})});}_0x3eb5da=_[_0xddcf('0x5a')]({},_0x3eb5da,_0x3c3856[_0xddcf('0x5b')]);return db[_0xddcf('0x6c')][_0xddcf('0x30')]({'where':_0x3eb5da['where']})[_0xddcf('0x1f')](function(_0x52a6be){_0x969810[_0xddcf('0x30')]=_0x52a6be;if(_0x3c3856[_0xddcf('0x46')]['includeAll']){_0x3eb5da[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0x6c')]['findAll'](_0x3eb5da);})['then'](function(_0x3f0878){_0x969810[_0xddcf('0x6e')]=_0x3f0878;return _0x969810;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0xb6781c,_0x3eb5da))[_0xddcf('0x2a')](handleError(_0xb6781c,null));};exports[_0xddcf('0x6f')]=function(_0x137d39,_0x404ef9,_0x2d1525){return db['FaxAccount'][_0xddcf('0x5c')]({'where':{'id':_0x137d39[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x404ef9,null))[_0xddcf('0x1f')](function(_0x23f990){if(_0x23f990){return _0x23f990[_0xddcf('0x6f')](_0x137d39[_0xddcf('0x46')][_0xddcf('0x70')]);}})[_0xddcf('0x1f')](respondWithStatusCode(_0x404ef9,null))[_0xddcf('0x2a')](handleError(_0x404ef9,null));};exports[_0xddcf('0x71')]=function(_0x19357b,_0x19b07e,_0x271ba3){return db['FaxInteraction']['find']({'where':{'id':_0x19357b[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x19b07e,null))[_0xddcf('0x1f')](function(_0x78e623){if(_0x78e623){return _0x78e623[_0xddcf('0x71')](_0x19357b[_0xddcf('0x5e')][_0xddcf('0x70')],_[_0xddcf('0x72')](_0x19357b['body'],[_0xddcf('0x70'),'id'])||{});}})['then'](respondWithResult(_0x19b07e,null))[_0xddcf('0x2a')](handleError(_0x19b07e,null));};exports[_0xddcf('0x73')]=function(_0x57b98d,_0x495d39,_0x2fca98){var _0x37c9f8={'raw':![],'where':{}};var _0x5151b2={};var _0x48913b={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x57b98d[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x495d39,null))[_0xddcf('0x1f')](function(_0x22e5e9){if(_0x22e5e9){_0x5151b2[_0xddcf('0x45')]=_[_0xddcf('0x47')](db[_0xddcf('0x74')]['rawAttributes']);_0x5151b2[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x57b98d['query']);_0x5151b2['filters']=_['intersection'](_0x5151b2['model'],_0x5151b2['query']);_0x37c9f8[_0xddcf('0x4b')]=_['intersection'](_0x5151b2[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x57b98d['query'][_0xddcf('0x4a')]));_0x37c9f8[_0xddcf('0x4b')]=_0x37c9f8['attributes'][_0xddcf('0x4c')]?_0x37c9f8[_0xddcf('0x4b')]:_0x5151b2[_0xddcf('0x45')];if(!_0x57b98d[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x37c9f8[_0xddcf('0x2f')]=qs['limit'](_0x57b98d[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x37c9f8['offset']=qs[_0xddcf('0x2d')](_0x57b98d[_0xddcf('0x46')][_0xddcf('0x2d')]);}_0x37c9f8[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x57b98d[_0xddcf('0x46')][_0xddcf('0x50')]);_0x37c9f8['where']=qs[_0xddcf('0x48')](_['pick'](_0x57b98d[_0xddcf('0x46')],_0x5151b2[_0xddcf('0x48')]));_0x37c9f8[_0xddcf('0x51')]['FaxAccountId']=_0x22e5e9['id'];if(_0x57b98d['query']['filter']){_0x37c9f8[_0xddcf('0x51')]=_[_0xddcf('0x5a')](_0x37c9f8[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x37c9f8[_0xddcf('0x4b')],function(_0x49d217){var _0x4b5752={};_0x4b5752[_0x49d217]={'$like':'%'+_0x57b98d[_0xddcf('0x46')]['filter']+'%'};return _0x4b5752;})});}_0x37c9f8=_[_0xddcf('0x5a')]({},_0x37c9f8,_0x57b98d[_0xddcf('0x5b')]);return db[_0xddcf('0x74')][_0xddcf('0x30')]({'where':_0x37c9f8['where']})[_0xddcf('0x1f')](function(_0x131973){_0x48913b['count']=_0x131973;if(_0x57b98d[_0xddcf('0x46')][_0xddcf('0x55')]){_0x37c9f8[_0xddcf('0x56')]=[{'model':db[_0xddcf('0x75')],'as':_0xddcf('0x76'),'required':![]},{'model':db[_0xddcf('0x77')],'as':_0xddcf('0x78'),'attributes':[_0xddcf('0x3c'),_0xddcf('0x79'),_0xddcf('0x7a')],'required':![]},{'model':db[_0xddcf('0x7b')],'as':_0xddcf('0x7c'),'attributes':['id',_0xddcf('0x3c'),_0xddcf('0x7d')],'where':_0x57b98d[_0xddcf('0x46')][_0xddcf('0x7e')]?{'id':_0x57b98d[_0xddcf('0x46')][_0xddcf('0x7e')]}:undefined,'required':_0x57b98d[_0xddcf('0x46')]['tag']?!![]:![]}];}return db[_0xddcf('0x74')]['findAll'](_0x37c9f8);})[_0xddcf('0x1f')](function(_0x298902){_0x48913b[_0xddcf('0x6e')]=_0x298902;return _0x48913b;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0x495d39,_0x37c9f8))[_0xddcf('0x2a')](handleError(_0x495d39,null));};exports['addApplications']=function(_0x594931,_0x5f0a2e,_0x1bf719){return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x594931['params']['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x5f0a2e,null))[_0xddcf('0x1f')](function(_0x119190){if(_0x119190){return db['sequelize'][_0xddcf('0x7f')](function(_0x30f9af){return db[_0xddcf('0x80')]['destroy']({'where':{'FaxAccountId':_0x594931[_0xddcf('0x58')]['id']},'transaction':_0x30f9af})[_0xddcf('0x1f')](function(_0x1f9ba9){var _0x3f29ab=_[_0xddcf('0x40')](_0x594931['body'],function(_0x11b375){_0x11b375[_0xddcf('0x64')]=_0x594931[_0xddcf('0x58')]['id'];return _0x11b375;});return db['FaxApplication']['bulkCreate'](_0x3f29ab,{'transaction':_0x30f9af});});})[_0xddcf('0x1f')](function(){return db[_0xddcf('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x594931['params']['id']},'order':_0xddcf('0x81')});});}})[_0xddcf('0x1f')](respondWithResult(_0x5f0a2e,null))[_0xddcf('0x2a')](handleError(_0x5f0a2e,null));};exports[_0xddcf('0x82')]=function(_0x494677,_0x30804e,_0x369f2b){var _0x2941a6={};var _0x3d6042={};var _0x3e7b03;var _0x404458;return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x494677[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x30804e,null))[_0xddcf('0x1f')](function(_0x3592c8){if(_0x3592c8){_0x3e7b03=_0x3592c8;_0x3d6042['model']=_[_0xddcf('0x47')](db['FaxApplication'][_0xddcf('0x41')]);_0x3d6042[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x494677[_0xddcf('0x46')]);_0x3d6042[_0xddcf('0x48')]=_['intersection'](_0x3d6042[_0xddcf('0x45')],_0x3d6042[_0xddcf('0x46')]);_0x2941a6[_0xddcf('0x4b')]=_['intersection'](_0x3d6042[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x494677[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x2941a6[_0xddcf('0x4b')]=_0x2941a6[_0xddcf('0x4b')][_0xddcf('0x4c')]?_0x2941a6['attributes']:_0x3d6042[_0xddcf('0x45')];_0x2941a6[_0xddcf('0x4f')]=qs[_0xddcf('0x50')](_0x494677['query'][_0xddcf('0x50')]);_0x2941a6[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x494677[_0xddcf('0x46')],_0x3d6042[_0xddcf('0x48')]));if(_0x494677[_0xddcf('0x46')][_0xddcf('0x52')]){_0x2941a6[_0xddcf('0x51')]=_[_0xddcf('0x5a')](_0x2941a6[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x2941a6[_0xddcf('0x4b')],function(_0x36e42d){var _0x4ef528={};_0x4ef528[_0x36e42d]={'$like':'%'+_0x494677[_0xddcf('0x46')]['filter']+'%'};return _0x4ef528;})});}_0x2941a6=_['merge']({},_0x2941a6,_0x494677[_0xddcf('0x5b')]);return _0x3e7b03[_0xddcf('0x82')](_0x2941a6);}})[_0xddcf('0x1f')](function(_0x507e27){if(_0x507e27){_0x404458=_0x507e27[_0xddcf('0x4c')];if(!_0x494677[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x2941a6[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x494677['query']['limit']);_0x2941a6[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x494677[_0xddcf('0x46')]['offset']);}return _0x3e7b03[_0xddcf('0x82')](_0x2941a6);}})['then'](function(_0x2801be){if(_0x2801be){return _0x2801be?{'count':_0x404458,'rows':_0x2801be}:null;}})[_0xddcf('0x1f')](respondWithResult(_0x30804e,null))['catch'](handleError(_0x30804e,null));};function Extension(_0x21d52b,_0x479945,_0x34149,_0x5e4e66){this[_0xddcf('0x83')]=_0xddcf('0x84');this['exten']=_0x21d52b['localstationid'];this[_0xddcf('0x85')]=_0x5e4e66;this[_0xddcf('0x43')]='system';this['description']=_0xddcf('0x86');this[_0xddcf('0x64')]=_0x21d52b['id'];this[_0xddcf('0x81')]=_0x479945;this[_0xddcf('0x87')]=_0x34149;}function createExtensionsReciveFax(_0x2828c7){var _0xe74ecb=0x1;var _0x3f0491=[];_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,'',_0xddcf('0x89')));_0xe74ecb+=0x1;_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,_0xddcf('0x8a'),_0xddcf('0x8b')));_0xe74ecb+=0x1;for(var _0x545097 in _0x2828c7){if(_0x2828c7['hasOwnProperty'](_0x545097)&&(_0x545097===_0xddcf('0x8c')||_0x545097===_0xddcf('0x8d')||_0x545097===_0xddcf('0x8e')||_0x545097==='faxdetect'||_0x545097===_0xddcf('0x8f')||_0x545097===_0xddcf('0x90')||_0x545097===_0xddcf('0x91')||_0x545097===_0xddcf('0x92')||_0x545097==='t38timeout')){_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,_0xddcf('0x93')+_0x545097+')='+_0x2828c7[_0x545097],_0xddcf('0x8b')));_0xe74ecb+=0x1;}}_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,'6','Wait'));_0xe74ecb+=0x1;_0x3f0491[_0xddcf('0x88')](new Extension(_0x2828c7,_0xe74ecb,'/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',_0xddcf('0x94')));_0xe74ecb=0x0;return _0x3f0491;}exports[_0xddcf('0x95')]=function(_0x37b6f8,_0x4116be,_0x29e04e){var _0x1ef10d;return db[_0xddcf('0x96')][_0xddcf('0x7f')](function(_0xf6bcda){return db[_0xddcf('0x54')][_0xddcf('0x5d')](_0x37b6f8[_0xddcf('0x5e')],{'transaction':_0xf6bcda})[_0xddcf('0x1f')](function(_0x56fd5c){_0x1ef10d=_0x56fd5c[_0xddcf('0x37')]({'plain':!![]});return db['VoiceExtension'][_0xddcf('0x97')](createExtensionsReciveFax(_0x1ef10d),{'transaction':_0xf6bcda});});})[_0xddcf('0x1f')](function(){return _0x1ef10d;})[_0xddcf('0x1f')](respondWithResult(_0x4116be,null))[_0xddcf('0x2a')](handleError(_0x4116be,null));};exports['updateAccountApplications']=function(_0x11ad50,_0x5ab4ce,_0x207782){var _0x433dd6;return db[_0xddcf('0x96')][_0xddcf('0x7f')](function(_0x40a703){return db[_0xddcf('0x54')][_0xddcf('0x35')](_0x11ad50['body'],{'where':{'id':_0x11ad50[_0xddcf('0x5e')]['id']},'transaction':_0x40a703})['then'](function(_0x54f206){return db['VoiceExtension'][_0xddcf('0x36')]({'where':{'FaxAccountId':_0x11ad50[_0xddcf('0x5e')]['id']},'transaction':_0x40a703})['then'](function(_0x1dc20a){return db[_0xddcf('0x98')][_0xddcf('0x97')](createExtensionsReciveFax(_['omit'](_0x11ad50[_0xddcf('0x5e')],[_0xddcf('0x99'),_0xddcf('0x44'),_0xddcf('0x9a'),_0xddcf('0x9b'),_0xddcf('0x9c'),_0xddcf('0x9d')])),{'transaction':_0x40a703});});});})[_0xddcf('0x1f')](function(){return db[_0xddcf('0x54')][_0xddcf('0x9e')](_0x11ad50['body']['id']);})[_0xddcf('0x1f')](respondWithResult(_0x5ab4ce,null))['catch'](handleError(_0x5ab4ce,null));};exports[_0xddcf('0x9f')]=function(_0x17885c,_0x1f5f10,_0x118372){var _0x230b0c={'raw':!![],'where':{}};var _0x73bef1={};var _0x27bf6e={'count':0x0,'rows':[]};return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x17885c[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x1f5f10,null))[_0xddcf('0x1f')](function(_0x440e96){if(_0x440e96){_0x73bef1['model']=_[_0xddcf('0x47')](db[_0xddcf('0xa0')]['rawAttributes']);_0x73bef1[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x17885c[_0xddcf('0x46')]);_0x73bef1[_0xddcf('0x48')]=_['intersection'](_0x73bef1['model'],_0x73bef1['query']);_0x230b0c['attributes']=_[_0xddcf('0x49')](_0x73bef1[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x17885c[_0xddcf('0x46')][_0xddcf('0x4a')]));_0x230b0c[_0xddcf('0x4b')]=_0x230b0c[_0xddcf('0x4b')]['length']?_0x230b0c[_0xddcf('0x4b')]:_0x73bef1[_0xddcf('0x45')];if(!_0x17885c[_0xddcf('0x46')]['hasOwnProperty']('nolimit')){_0x230b0c[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x17885c[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x230b0c[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x17885c[_0xddcf('0x46')]['offset']);}_0x230b0c[_0xddcf('0x4f')]=qs['sort'](_0x17885c[_0xddcf('0x46')]['sort']);_0x230b0c[_0xddcf('0x51')]=qs[_0xddcf('0x48')](_[_0xddcf('0x68')](_0x17885c[_0xddcf('0x46')],_0x73bef1['filters']));_0x230b0c[_0xddcf('0x51')][_0xddcf('0x64')]=_0x440e96['id'];if(_0x17885c[_0xddcf('0x46')][_0xddcf('0x52')]){_0x230b0c[_0xddcf('0x51')]=_[_0xddcf('0x5a')](_0x230b0c[_0xddcf('0x51')],{'$or':_['map'](_0x230b0c[_0xddcf('0x4b')],function(_0x444e03){var _0x32afc7={};_0x32afc7[_0x444e03]={'$like':'%'+_0x17885c['query'][_0xddcf('0x52')]+'%'};return _0x32afc7;})});}if(_0x17885c[_0xddcf('0x46')]['$gte']){var _0x57d1a0=_0x17885c[_0xddcf('0x46')]['$gte'][_0xddcf('0xa1')](',');var _0x282869={};_0x282869[_0x57d1a0[0x0]]={'$gte':moment(_0x57d1a0[0x1])['format'](_0xddcf('0xa2'))};_0x230b0c['where']=_[_0xddcf('0x5a')](_0x230b0c[_0xddcf('0x51')],_0x282869);}_0x230b0c=_[_0xddcf('0x5a')]({},_0x230b0c,_0x17885c['options']);return db['FaxMessage'][_0xddcf('0x30')]({'where':_0x230b0c[_0xddcf('0x51')]})[_0xddcf('0x1f')](function(_0x15e41b){_0x27bf6e['count']=_0x15e41b;if(_0x17885c[_0xddcf('0x46')][_0xddcf('0x55')]){_0x230b0c[_0xddcf('0x56')]=[{'all':!![]}];}return db[_0xddcf('0xa0')]['findAll'](_0x230b0c);})['then'](function(_0x4ec4c7){_0x27bf6e[_0xddcf('0x6e')]=_0x4ec4c7;return _0x27bf6e;});}})[_0xddcf('0x1f')](respondWithFilteredResult(_0x1f5f10,_0x230b0c))['catch'](handleError(_0x1f5f10,null));};exports['send']=function(_0xba9da1,_0x48d20a,_0x188a40){var _0x56bfad,_0x270147={},_0x5779fc;if(_0xba9da1['body']['to']){_0x5779fc=_0xba9da1[_0xddcf('0x5e')]['to'][0x0];}return db[_0xddcf('0x54')][_0xddcf('0x5c')]({'where':{'id':_0xba9da1[_0xddcf('0x58')]['id']},'include':[{'model':db[_0xddcf('0xa3')],'as':_0xddcf('0xa4'),'include':[{'model':db[_0xddcf('0x75')],'as':_0xddcf('0xa5'),'where':{'fax':_0x5779fc},'limit':0x1,'order':[[_0xddcf('0x9b'),_0xddcf('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x48d20a,null))['then'](function(_0x26ad2e){_0x56bfad=_0x26ad2e;if(_0xba9da1[_0xddcf('0x5e')]['attachments']&&_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0xddcf('0x4c')]){for(var _0x5d4905=0x0;_0x5d4905<_0xba9da1['body'][_0xddcf('0xa7')][_0xddcf('0x4c')];_0x5d4905+=0x1){_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0x5d4905]={'filename':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0x5d4905]['name'],'id':_0xba9da1['body'][_0xddcf('0xa7')][_0x5d4905]['id'],'path':path[_0xddcf('0xa8')](config[_0xddcf('0xa9')],'server/files/attachments',_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][_0x5d4905]['basename'])};}}return respondWithRpcPromise(_0xddcf('0xaa'),_0xddcf('0xaa'),{'FaxAccountId':_['isNil'](_0xba9da1['params']['id'])?undefined:_0xba9da1['params']['id'],'path':_[_0xddcf('0xab')](_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['path'])?undefined:_0xba9da1[_0xddcf('0x5e')]['attachments'][0x0][_0xddcf('0xac')],'fax':_['isNil'](_0xba9da1[_0xddcf('0x5e')]['to'][0x0])?undefined:_0xba9da1[_0xddcf('0x5e')]['to'][0x0]},client9002);})[_0xddcf('0x1f')](function(){if(_0x56bfad){if(_[_0xddcf('0xab')](_0xba9da1['body'][_0xddcf('0xad')])){_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xad')]=util[_0xddcf('0xae')](_0xddcf('0xaf'),_0x56bfad['name'],_0x56bfad[_0xddcf('0xb0')]);}if(_0x56bfad[_0xddcf('0xa4')]){if(_0x56bfad[_0xddcf('0xa4')]['Contacts']['length']){return _0x56bfad[_0xddcf('0xa4')]['Contacts'][0x0];}else{return db[_0xddcf('0x75')][_0xddcf('0x5d')](_[_0xddcf('0x18')](_0xba9da1['body'],{'firstName':_0xba9da1['body']['to'][0x0],'phone':_0xba9da1[_0xddcf('0x5e')]['to'][0x0],'fax':_0xba9da1[_0xddcf('0x5e')]['to'][0x0],'ListId':_0x56bfad[_0xddcf('0x9d')]}));}}else{throw new Error(_0xddcf('0xb1'));}}else{throw new Error(_0xddcf('0xb2'));}})[_0xddcf('0x1f')](function(_0x256b7b){if(_0x256b7b){return db[_0xddcf('0x74')][_0xddcf('0x5c')]({'where':{'ContactId':_0x256b7b['id'],'closed':![],'FaxAccountId':_0x56bfad['id']}})['then'](function(_0x338237){if(_0x338237){return[_0x338237,![]];}return db[_0xddcf('0x74')][_0xddcf('0x5d')]({'UserId':_0xba9da1['user']['id'],'ContactId':_0x256b7b['id'],'FaxAccountId':_0x56bfad['id'],'fax':_0xba9da1['body']['to'][0x0],'firstMsgDirection':_0xddcf('0xb3'),'Messages':[_[_0xddcf('0x5a')](_0xba9da1[_0xddcf('0x5e')],{'read':![],'body':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0][_0xddcf('0xb4')],'FaxAccountId':_0x56bfad['id'],'UserId':_0xba9da1['user']['id'],'ContactId':_0x256b7b['id'],'AttachmentId':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xddcf('0xa0')],'as':'Messages'}]})[_0xddcf('0x1f')](function(_0x3bda6d){return[_0x3bda6d,!![]];});});}else{throw new Error(_0xddcf('0xb5'));}})[_0xddcf('0xb6')](function(_0xfe0bbd,_0x4cfc54){if(_0x4cfc54){return _0xfe0bbd;}return db[_0xddcf('0xa0')][_0xddcf('0x5d')]({'direction':_0xddcf('0xb3'),'read':![],'body':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['filename'],'FaxAccountId':_0x56bfad['id'],'FaxInteractionId':_0xfe0bbd['id'],'UserId':_0xba9da1[_0xddcf('0xb7')]['id'],'ContactId':_0xfe0bbd['ContactId'],'AttachmentId':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['id']})[_0xddcf('0x1f')](function(_0x52ac48){_0xfe0bbd[_0xddcf('0xb8')][_0xddcf('0xb9')]=[];_0xfe0bbd[_0xddcf('0xb8')][_0xddcf('0xb9')][_0xddcf('0x88')](_0x52ac48[_0xddcf('0xb8')]);return _0xfe0bbd;});})['then'](function(_0x5e59a0){respondWithRpcPromise(_0xddcf('0xba'),_0xddcf('0xba'),{'FaxAccountId':_['isNil'](_0xba9da1[_0xddcf('0x58')]['id'])?undefined:_0xba9da1[_0xddcf('0x58')]['id'],'path':_[_0xddcf('0xab')](_0xba9da1[_0xddcf('0x5e')]['attachments'][0x0][_0xddcf('0xac')])?undefined:_0xba9da1['body'][_0xddcf('0xa7')][0x0][_0xddcf('0xac')],'fax':_['isNil'](_0xba9da1['body']['to'][0x0])?undefined:_0xba9da1[_0xddcf('0x5e')]['to'][0x0],'AttachmentId':_0xba9da1[_0xddcf('0x5e')][_0xddcf('0xa7')][0x0]['id']},client9002)[_0xddcf('0x1f')](function(_0x13c241){logger[_0xddcf('0x28')]('SendFaxRpc,\x20%s',_0x13c241);})[_0xddcf('0x2a')](function(_0x12b15c){logger[_0xddcf('0x28')](_0xddcf('0xbb'),_0x12b15c);});return _0x5e59a0;})[_0xddcf('0x1f')](respondWithResult(_0x48d20a,null))[_0xddcf('0x2a')](handleError(_0x48d20a,null));};exports['addAgents']=function(_0x490dd0,_0x53bf5d,_0x21c525){return db['FaxAccount'][_0xddcf('0x5c')]({'where':{'id':_0x490dd0[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x53bf5d,null))[_0xddcf('0x1f')](function(_0xa86c7b){if(_0xa86c7b){return _0xa86c7b['addAgents'](_0x490dd0[_0xddcf('0x5e')]['ids'],_[_0xddcf('0x72')](_0x490dd0['body'],[_0xddcf('0x70'),'id'])||{})[_0xddcf('0xb6')](function(_0x23a0b7){for(var _0x237746=0x0;_0x237746<_0x490dd0[_0xddcf('0x5e')][_0xddcf('0x70')][_0xddcf('0x4c')];_0x237746+=0x1){socket[_0xddcf('0xbc')](_0xddcf('0xbd'),{'UserId':Number(_0x490dd0[_0xddcf('0x5e')][_0xddcf('0x70')][_0x237746]),'FaxAccountId':Number(_0x490dd0[_0xddcf('0x58')]['id'])});}return _0x23a0b7;});}})['then'](respondWithResult(_0x53bf5d,null))[_0xddcf('0x2a')](handleError(_0x53bf5d,null));};exports[_0xddcf('0xbe')]=function(_0x476ed2,_0x475058,_0x324350){return db['FaxAccount']['find']({'where':{'id':_0x476ed2[_0xddcf('0x58')]['id']}})[_0xddcf('0x1f')](handleEntityNotFound(_0x475058,null))[_0xddcf('0x1f')](function(_0x4db3cd){if(_0x4db3cd){return _0x4db3cd[_0xddcf('0xbe')](_0x476ed2[_0xddcf('0x46')][_0xddcf('0x70')])[_0xddcf('0x1f')](function(){if(_[_0xddcf('0xbf')](_0x476ed2[_0xddcf('0x46')][_0xddcf('0x70')])){for(var _0x50d650=0x0;_0x50d650<_0x476ed2[_0xddcf('0x46')]['ids'][_0xddcf('0x4c')];_0x50d650+=0x1){socket['emit'](_0xddcf('0xc0'),{'UserId':Number(_0x476ed2['query']['ids'][_0x50d650]),'FaxAccountId':Number(_0x476ed2['params']['id'])});}}else{socket[_0xddcf('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x476ed2[_0xddcf('0x46')][_0xddcf('0x70')]),'FaxAccountId':Number(_0x476ed2['params']['id'])});}});}})[_0xddcf('0x1f')](respondWithStatusCode(_0x475058,null))[_0xddcf('0x2a')](handleError(_0x475058,null));};exports[_0xddcf('0xc1')]=function(_0x12c222,_0x1e6c68,_0x18e490){var _0x4545d4={};var _0x27e8e1={};var _0x44423a;var _0x35a45f;return db[_0xddcf('0x54')][_0xddcf('0x66')]({'where':{'id':_0x12c222[_0xddcf('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e6c68,null))['then'](function(_0x34c299){if(_0x34c299){_0x44423a=_0x34c299;_0x27e8e1['model']=_[_0xddcf('0x47')](db['User'][_0xddcf('0x41')]);_0x27e8e1[_0xddcf('0x46')]=_[_0xddcf('0x47')](_0x12c222[_0xddcf('0x46')]);_0x27e8e1[_0xddcf('0x48')]=_['intersection'](_0x27e8e1[_0xddcf('0x45')],_0x27e8e1[_0xddcf('0x46')]);_0x4545d4['attributes']=_[_0xddcf('0x49')](_0x27e8e1[_0xddcf('0x45')],qs[_0xddcf('0x4a')](_0x12c222['query'][_0xddcf('0x4a')]));_0x4545d4[_0xddcf('0x4b')]=_0x4545d4['attributes'][_0xddcf('0x4c')]?_0x4545d4['attributes']:_0x27e8e1['model'];_0x4545d4[_0xddcf('0x4f')]=qs['sort'](_0x12c222[_0xddcf('0x46')]['sort']);_0x4545d4['where']=qs['filters'](_[_0xddcf('0x68')](_0x12c222['query'],_0x27e8e1[_0xddcf('0x48')]));if(_0x12c222[_0xddcf('0x46')][_0xddcf('0x52')]){_0x4545d4[_0xddcf('0x51')]=_['merge'](_0x4545d4[_0xddcf('0x51')],{'$or':_[_0xddcf('0x40')](_0x4545d4[_0xddcf('0x4b')],function(_0x4d1deb){var _0x2207f4={};_0x2207f4[_0x4d1deb]={'$like':'%'+_0x12c222[_0xddcf('0x46')][_0xddcf('0x52')]+'%'};return _0x2207f4;})});}_0x4545d4=_[_0xddcf('0x5a')]({},_0x4545d4,_0x12c222['options']);return _0x44423a['getAgents'](_0x4545d4);}})['then'](function(_0x272767){if(_0x272767){_0x35a45f=_0x272767['length'];if(!_0x12c222[_0xddcf('0x46')][_0xddcf('0x4d')](_0xddcf('0x4e'))){_0x4545d4[_0xddcf('0x2f')]=qs[_0xddcf('0x2f')](_0x12c222[_0xddcf('0x46')][_0xddcf('0x2f')]);_0x4545d4[_0xddcf('0x2d')]=qs[_0xddcf('0x2d')](_0x12c222['query'][_0xddcf('0x2d')]);}return _0x44423a[_0xddcf('0xc1')](_0x4545d4);}})[_0xddcf('0x1f')](function(_0x5500d8){if(_0x5500d8){return _0x5500d8?{'count':_0x35a45f,'rows':_0x5500d8}:null;}})[_0xddcf('0x1f')](respondWithResult(_0x1e6c68,null))['catch'](handleError(_0x1e6c68,null));}; \ No newline at end of file +var _0xc4ae=['rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','options','FaxAccount','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','FaxAccountId','getDispositions','findOne','Disposition','hasOwnProperty','order','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','ids','getInteractions','CmContact','User','Owner','fullname','Tag','Tags','tag','addApplications','transaction','bulkCreate','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','send','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','path','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','index','Pause','map'];(function(_0xdd57ce,_0x1064d0){var _0x539a3f=function(_0x19e279){while(--_0x19e279){_0xdd57ce['push'](_0xdd57ce['shift']());}};_0x539a3f(++_0x1064d0);}(_0xc4ae,0x86));var _0xec4a=function(_0x36586a,_0x58e9ee){_0x36586a=_0x36586a-0x0;var _0x4a34f6=_0xc4ae[_0x36586a];return _0x4a34f6;};'use strict';var emlformat=require(_0xec4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec4a('0x1'));var jsonpatch=require(_0xec4a('0x2'));var rp=require(_0xec4a('0x3'));var moment=require(_0xec4a('0x4'));var BPromise=require(_0xec4a('0x5'));var Mustache=require('mustache');var util=require(_0xec4a('0x6'));var path=require('path');var sox=require(_0xec4a('0x7'));var csv=require(_0xec4a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec4a('0x9'));var squel=require('squel');var crypto=require(_0xec4a('0xa'));var jsforce=require(_0xec4a('0xb'));var deskjs=require(_0xec4a('0xc'));var toCsv=require(_0xec4a('0x8'));var querystring=require(_0xec4a('0xd'));var Papa=require('papaparse');var Redis=require(_0xec4a('0xe'));var authService=require(_0xec4a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xec4a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xec4a('0x11'));var config=require(_0xec4a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xec4a('0x13'))['db'];config[_0xec4a('0x14')]=_['defaults'](config[_0xec4a('0x14')],{'host':_0xec4a('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec4a('0x14')]));require(_0xec4a('0x16'))[_0xec4a('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xec4a('0x18')]['http']({'port':0x232c});var client9002=jayson[_0xec4a('0x18')][_0xec4a('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xf1149,_0xd3e3f2,_0xe4d821,_0x2377a6){return new BPromise(function(_0x5ef0bf,_0x4a4ff4){var _0x4d28f8=_0x2377a6||client;return _0x4d28f8[_0xec4a('0x1a')](_0xf1149,_0xe4d821)['then'](function(_0x2131c8){logger[_0xec4a('0x1b')](_0xec4a('0x1c'),_0xd3e3f2,_0xec4a('0x1d'));logger[_0xec4a('0x1e')](_0xec4a('0x1f'),_0xd3e3f2,_0xec4a('0x1d'),JSON[_0xec4a('0x20')](_0x2131c8));if(_0x2131c8[_0xec4a('0x21')]){if(_0x2131c8[_0xec4a('0x21')][_0xec4a('0x22')]===0x1f4){logger[_0xec4a('0x21')](_0xec4a('0x1c'),_0xd3e3f2,_0x2131c8['error'][_0xec4a('0x23')]);return _0x4a4ff4(_0x2131c8[_0xec4a('0x21')][_0xec4a('0x23')]);}logger[_0xec4a('0x21')](_0xec4a('0x1c'),_0xd3e3f2,_0x2131c8[_0xec4a('0x21')][_0xec4a('0x23')]);return _0x5ef0bf(_0x2131c8[_0xec4a('0x21')][_0xec4a('0x23')]);}else{logger[_0xec4a('0x1b')]('FaxAccount,\x20%s,\x20%s',_0xd3e3f2,_0xec4a('0x1d'));_0x5ef0bf(_0x2131c8[_0xec4a('0x24')][_0xec4a('0x23')]);}})[_0xec4a('0x25')](function(_0x291741){logger[_0xec4a('0x21')](_0xec4a('0x1c'),_0xd3e3f2,_0x291741);_0x4a4ff4(_0x291741);});});}function respondWithStatusCode(_0x404d73,_0x250663){_0x250663=_0x250663||0xcc;return function(_0x2df4de){if(_0x2df4de){return _0x404d73['sendStatus'](_0x250663);}return _0x404d73[_0xec4a('0x26')](_0x250663)[_0xec4a('0x27')]();};}function respondWithResult(_0x1fad03,_0x1ab22a){_0x1ab22a=_0x1ab22a||0xc8;return function(_0x41ba60){if(_0x41ba60){return _0x1fad03['status'](_0x1ab22a)[_0xec4a('0x28')](_0x41ba60);}};}function respondWithFilteredResult(_0x2e856f,_0x1202a3){return function(_0x249e0e){if(_0x249e0e){var _0x359d69=typeof _0x1202a3[_0xec4a('0x29')]===_0xec4a('0x2a')&&typeof _0x1202a3[_0xec4a('0x2b')]===_0xec4a('0x2a');var _0x54d786=_0x249e0e[_0xec4a('0x2c')];var _0x2f3194=_0x359d69?0x0:_0x1202a3['offset'];var _0x33b798=_0x359d69?_0x249e0e[_0xec4a('0x2c')]:_0x1202a3['offset']+_0x1202a3[_0xec4a('0x2b')];var _0x201c2a;if(_0x33b798>=_0x54d786){_0x33b798=_0x54d786;_0x201c2a=0xc8;}else{_0x201c2a=0xce;}_0x2e856f[_0xec4a('0x26')](_0x201c2a);return _0x2e856f[_0xec4a('0x2d')](_0xec4a('0x2e'),_0x2f3194+'-'+_0x33b798+'/'+_0x54d786)['json'](_0x249e0e);}return null;};}function patchUpdates(_0x2de5c5){return function(_0x53dbf5){try{jsonpatch[_0xec4a('0x2f')](_0x53dbf5,_0x2de5c5,!![]);}catch(_0x794213){return BPromise[_0xec4a('0x30')](_0x794213);}return _0x53dbf5[_0xec4a('0x31')]();};}function saveUpdates(_0x3365f0,_0x2ad1d4){return function(_0xfa6d96){if(_0xfa6d96){return _0xfa6d96[_0xec4a('0x32')](_0x3365f0)[_0xec4a('0x33')](function(_0x47b66a){return _0x47b66a;});}return null;};}function removeEntity(_0x4cf077,_0x1d4798){return function(_0x219400){if(_0x219400){return _0x219400[_0xec4a('0x34')]()['then'](function(){var _0x521e23=_0x219400[_0xec4a('0x35')]({'plain':!![]});var _0x46b346='FaxAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x46b346,'resourceId':_0x521e23['id']}})['then'](function(){return _0x219400;});})['then'](function(){_0x4cf077[_0xec4a('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x442931,_0x40576d){return function(_0x23e6b4){if(!_0x23e6b4){_0x442931[_0xec4a('0x36')](0x194);}return _0x23e6b4;};}function handleError(_0x16419a,_0x571f8f){_0x571f8f=_0x571f8f||0x1f4;return function(_0x56f7eb){logger[_0xec4a('0x21')](_0x56f7eb[_0xec4a('0x37')]);if(_0x56f7eb[_0xec4a('0x38')]){delete _0x56f7eb[_0xec4a('0x38')];}_0x16419a[_0xec4a('0x26')](_0x571f8f)['send'](_0x56f7eb);};}exports[_0xec4a('0x39')]=function(_0x4a17b5,_0x584774){var _0x4fb8fb={'include':[{'model':db[_0xec4a('0x3a')],'as':'mandatoryDispositionPause'}]},_0x21eecc={},_0x11ed01={'count':0x0,'rows':[]};var _0x434e85=_[_0xec4a('0x3b')](db['FaxAccount'][_0xec4a('0x3c')],function(_0x1d09a4){return{'name':_0x1d09a4['fieldName'],'type':_0x1d09a4[_0xec4a('0x3d')][_0xec4a('0x3e')]};});_0x21eecc['model']=_['map'](_0x434e85,_0xec4a('0x38'));_0x21eecc[_0xec4a('0x3f')]=_[_0xec4a('0x40')](_0x4a17b5[_0xec4a('0x3f')]);_0x21eecc[_0xec4a('0x41')]=_['intersection'](_0x21eecc[_0xec4a('0x42')],_0x21eecc[_0xec4a('0x3f')]);_0x4fb8fb[_0xec4a('0x43')]=_[_0xec4a('0x44')](_0x21eecc[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x4a17b5[_0xec4a('0x3f')]['fields']));_0x4fb8fb[_0xec4a('0x43')]=_0x4fb8fb[_0xec4a('0x43')][_0xec4a('0x46')]?_0x4fb8fb[_0xec4a('0x43')]:_0x21eecc['model'];if(!_0x4a17b5[_0xec4a('0x3f')]['hasOwnProperty'](_0xec4a('0x47'))){_0x4fb8fb['limit']=qs[_0xec4a('0x2b')](_0x4a17b5['query'][_0xec4a('0x2b')]);_0x4fb8fb[_0xec4a('0x29')]=qs[_0xec4a('0x29')](_0x4a17b5['query'][_0xec4a('0x29')]);}_0x4fb8fb['order']=qs[_0xec4a('0x48')](_0x4a17b5[_0xec4a('0x3f')][_0xec4a('0x48')]);_0x4fb8fb[_0xec4a('0x49')]=qs[_0xec4a('0x41')](_[_0xec4a('0x4a')](_0x4a17b5[_0xec4a('0x3f')],_0x21eecc['filters']),_0x434e85);if(_0x4a17b5[_0xec4a('0x3f')][_0xec4a('0x4b')]){_0x4fb8fb[_0xec4a('0x49')]=_[_0xec4a('0x4c')](_0x4fb8fb['where'],{'$or':_[_0xec4a('0x3b')](_0x434e85,function(_0x3b7740){if(_0x3b7740['type']!=='VIRTUAL'){var _0x33c185={};_0x33c185[_0x3b7740[_0xec4a('0x38')]]={'$like':'%'+_0x4a17b5[_0xec4a('0x3f')][_0xec4a('0x4b')]+'%'};return _0x33c185;}})});}_0x4fb8fb=_[_0xec4a('0x4c')]({},_0x4fb8fb,_0x4a17b5[_0xec4a('0x4d')]);var _0x3fdbbd={'where':_0x4fb8fb['where']};return db[_0xec4a('0x4e')][_0xec4a('0x2c')](_0x3fdbbd)[_0xec4a('0x33')](function(_0x1510cc){_0x11ed01[_0xec4a('0x2c')]=_0x1510cc;if(_0x4a17b5[_0xec4a('0x3f')][_0xec4a('0x4f')]){_0x4fb8fb[_0xec4a('0x50')]=[{'all':!![]}];}return db[_0xec4a('0x4e')][_0xec4a('0x51')](_0x4fb8fb);})[_0xec4a('0x33')](function(_0x50e56e){_0x11ed01[_0xec4a('0x52')]=_0x50e56e;return _0x11ed01;})[_0xec4a('0x33')](respondWithFilteredResult(_0x584774,_0x4fb8fb))[_0xec4a('0x25')](handleError(_0x584774,null));};exports[_0xec4a('0x53')]=function(_0x153b04,_0x43d8de){var _0x29ba98={'raw':![],'where':{'id':_0x153b04[_0xec4a('0x54')]['id']},'include':[{'model':db[_0xec4a('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2127c9={};_0x2127c9['model']=_[_0xec4a('0x40')](db['FaxAccount'][_0xec4a('0x3c')]);_0x2127c9['query']=_['keys'](_0x153b04['query']);_0x2127c9[_0xec4a('0x41')]=_['intersection'](_0x2127c9[_0xec4a('0x42')],_0x2127c9[_0xec4a('0x3f')]);_0x29ba98[_0xec4a('0x43')]=_[_0xec4a('0x44')](_0x2127c9[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x153b04['query'][_0xec4a('0x45')]));_0x29ba98['attributes']=_0x29ba98['attributes']['length']?_0x29ba98[_0xec4a('0x43')]:_0x2127c9[_0xec4a('0x42')];if(_0x153b04['query'][_0xec4a('0x4f')]){_0x29ba98[_0xec4a('0x50')]=[{'all':!![]}];}_0x29ba98=_[_0xec4a('0x4c')]({},_0x29ba98,_0x153b04[_0xec4a('0x4d')]);return db[_0xec4a('0x4e')][_0xec4a('0x55')](_0x29ba98)[_0xec4a('0x33')](handleEntityNotFound(_0x43d8de,null))['then'](respondWithResult(_0x43d8de,null))['catch'](handleError(_0x43d8de,null));};exports[_0xec4a('0x56')]=function(_0x3c5eef,_0x3ace69){return db[_0xec4a('0x4e')][_0xec4a('0x56')](_0x3c5eef[_0xec4a('0x57')],{})[_0xec4a('0x33')](function(_0x1f1454){var _0x931505=_0x3c5eef[_0xec4a('0x58')]['get']({'plain':!![]});if(!_0x931505)throw new Error(_0xec4a('0x59'));if(_0x931505[_0xec4a('0x5a')]===_0xec4a('0x58')){var _0xb6791c=_0x1f1454[_0xec4a('0x35')]({'plain':!![]});var _0x385ddd=_0xec4a('0x5b');return db[_0xec4a('0x5c')][_0xec4a('0x55')]({'where':{'name':_0x385ddd,'userProfileId':_0x931505[_0xec4a('0x5d')]},'raw':!![]})[_0xec4a('0x33')](function(_0x336b80){if(_0x336b80&&_0x336b80['autoAssociation']===0x0){return db[_0xec4a('0x5e')][_0xec4a('0x56')]({'name':_0xb6791c['name'],'resourceId':_0xb6791c['id'],'type':_0x336b80['name'],'sectionId':_0x336b80['id']},{})[_0xec4a('0x33')](function(){return _0x1f1454;});}else{return _0x1f1454;}})['catch'](function(_0x121a8f){logger[_0xec4a('0x21')](_0xec4a('0x5f'),_0x121a8f);throw _0x121a8f;});}return _0x1f1454;})[_0xec4a('0x33')](respondWithResult(_0x3ace69,0xc9))[_0xec4a('0x25')](handleError(_0x3ace69,null));};exports['update']=function(_0x4fb5fe,_0x2a65b1){if(_0x4fb5fe[_0xec4a('0x57')]['id']){delete _0x4fb5fe[_0xec4a('0x57')]['id'];}return db[_0xec4a('0x4e')][_0xec4a('0x55')]({'where':{'id':_0x4fb5fe[_0xec4a('0x54')]['id']},'include':[{'model':db[_0xec4a('0x3a')],'as':_0xec4a('0x60')}]})[_0xec4a('0x33')](handleEntityNotFound(_0x2a65b1,null))[_0xec4a('0x33')](saveUpdates(_0x4fb5fe[_0xec4a('0x57')],null))[_0xec4a('0x33')](respondWithResult(_0x2a65b1,null))[_0xec4a('0x25')](handleError(_0x2a65b1,null));};exports['destroy']=function(_0x182f14,_0x56a081){return db[_0xec4a('0x4e')]['find']({'where':{'id':_0x182f14[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x56a081,null))[_0xec4a('0x33')](removeEntity(_0x56a081,null))[_0xec4a('0x25')](handleError(_0x56a081,null));};exports['describe']=function(_0x41c981,_0x31f594){return db[_0xec4a('0x4e')]['describe']()[_0xec4a('0x33')](respondWithResult(_0x31f594,null))[_0xec4a('0x25')](handleError(_0x31f594,null));};exports['addDisposition']=function(_0x26ebeb,_0x35c38c,_0x2fd617){if(_0x26ebeb[_0xec4a('0x57')]['id']){delete _0x26ebeb[_0xec4a('0x57')]['id'];}return db[_0xec4a('0x4e')][_0xec4a('0x55')]({'where':{'id':_0x26ebeb[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x35c38c,null))[_0xec4a('0x33')](function(_0xf857dc){if(_0xf857dc){_0x26ebeb[_0xec4a('0x57')][_0xec4a('0x61')]=_0xf857dc['id'];return db['Disposition'][_0xec4a('0x56')](_0x26ebeb[_0xec4a('0x57')]);}})[_0xec4a('0x33')](respondWithResult(_0x35c38c,null))[_0xec4a('0x25')](handleError(_0x35c38c,null));};exports[_0xec4a('0x62')]=function(_0x37590c,_0x398d6a,_0x194ca0){var _0x19e996={'raw':![],'where':{}};var _0x169e76={};var _0x2b8aea={'count':0x0,'rows':[]};return db[_0xec4a('0x4e')][_0xec4a('0x63')]({'where':{'id':_0x37590c[_0xec4a('0x54')]['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x398d6a,null))[_0xec4a('0x33')](function(_0x3db351){if(_0x3db351){_0x169e76[_0xec4a('0x42')]=_['keys'](db[_0xec4a('0x64')][_0xec4a('0x3c')]);_0x169e76[_0xec4a('0x3f')]=_[_0xec4a('0x40')](_0x37590c[_0xec4a('0x3f')]);_0x169e76['filters']=_[_0xec4a('0x44')](_0x169e76['model'],_0x169e76['query']);_0x19e996[_0xec4a('0x43')]=_[_0xec4a('0x44')](_0x169e76[_0xec4a('0x42')],qs['fields'](_0x37590c[_0xec4a('0x3f')]['fields']));_0x19e996[_0xec4a('0x43')]=_0x19e996[_0xec4a('0x43')][_0xec4a('0x46')]?_0x19e996[_0xec4a('0x43')]:_0x169e76[_0xec4a('0x42')];if(!_0x37590c[_0xec4a('0x3f')][_0xec4a('0x65')](_0xec4a('0x47'))){_0x19e996['limit']=qs[_0xec4a('0x2b')](_0x37590c[_0xec4a('0x3f')][_0xec4a('0x2b')]);_0x19e996['offset']=qs[_0xec4a('0x29')](_0x37590c['query']['offset']);}_0x19e996[_0xec4a('0x66')]=qs[_0xec4a('0x48')](_0x37590c[_0xec4a('0x3f')]['sort']);_0x19e996[_0xec4a('0x49')]=qs['filters'](_['pick'](_0x37590c[_0xec4a('0x3f')],_0x169e76[_0xec4a('0x41')]));_0x19e996[_0xec4a('0x49')]['FaxAccountId']=_0x3db351['id'];if(_0x37590c[_0xec4a('0x3f')][_0xec4a('0x4b')]){_0x19e996[_0xec4a('0x49')]=_['merge'](_0x19e996['where'],{'$or':_[_0xec4a('0x3b')](_0x19e996[_0xec4a('0x43')],function(_0x4ca6b6){var _0x504c51={};_0x504c51[_0x4ca6b6]={'$like':'%'+_0x37590c['query'][_0xec4a('0x4b')]+'%'};return _0x504c51;})});}_0x19e996=_['merge']({},_0x19e996,_0x37590c['options']);return db[_0xec4a('0x64')][_0xec4a('0x2c')]({'where':_0x19e996['where']})[_0xec4a('0x33')](function(_0x5f08ea){_0x2b8aea[_0xec4a('0x2c')]=_0x5f08ea;if(_0x37590c[_0xec4a('0x3f')]['includeAll']){_0x19e996[_0xec4a('0x50')]=[{'all':!![]}];}return db[_0xec4a('0x64')][_0xec4a('0x51')](_0x19e996);})[_0xec4a('0x33')](function(_0x31cd72){_0x2b8aea[_0xec4a('0x52')]=_0x31cd72;return _0x2b8aea;});}})[_0xec4a('0x33')](respondWithFilteredResult(_0x398d6a,_0x19e996))[_0xec4a('0x25')](handleError(_0x398d6a,null));};exports['removeDispositions']=function(_0x1d173a,_0x24d273,_0x36a387){return db[_0xec4a('0x4e')][_0xec4a('0x55')]({'where':{'id':_0x1d173a[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x24d273,null))['then'](function(_0x3c49b9){if(_0x3c49b9){return _0x3c49b9[_0xec4a('0x67')](_0x1d173a[_0xec4a('0x3f')]['ids']);}})[_0xec4a('0x33')](respondWithStatusCode(_0x24d273,null))[_0xec4a('0x25')](handleError(_0x24d273,null));};exports[_0xec4a('0x68')]=function(_0x505343,_0x4359ab,_0x34fce2){if(_0x505343[_0xec4a('0x57')]['id']){delete _0x505343['body']['id'];}return db[_0xec4a('0x4e')]['find']({'where':{'id':_0x505343[_0xec4a('0x54')]['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x4359ab,null))[_0xec4a('0x33')](function(_0x40802a){if(_0x40802a){_0x505343[_0xec4a('0x57')][_0xec4a('0x61')]=_0x40802a['id'];return db[_0xec4a('0x69')]['create'](_0x505343['body']);}})[_0xec4a('0x33')](respondWithResult(_0x4359ab,null))[_0xec4a('0x25')](handleError(_0x4359ab,null));};exports['getAnswers']=function(_0x48a76d,_0x47da7b,_0x2182fe){var _0x5c1cea={'raw':![],'where':{}};var _0x51f8ee={};var _0x501297={'count':0x0,'rows':[]};return db['FaxAccount'][_0xec4a('0x63')]({'where':{'id':_0x48a76d[_0xec4a('0x54')]['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x47da7b,null))[_0xec4a('0x33')](function(_0x5b5cc4){if(_0x5b5cc4){_0x51f8ee[_0xec4a('0x42')]=_[_0xec4a('0x40')](db[_0xec4a('0x69')][_0xec4a('0x3c')]);_0x51f8ee[_0xec4a('0x3f')]=_[_0xec4a('0x40')](_0x48a76d[_0xec4a('0x3f')]);_0x51f8ee[_0xec4a('0x41')]=_['intersection'](_0x51f8ee[_0xec4a('0x42')],_0x51f8ee[_0xec4a('0x3f')]);_0x5c1cea['attributes']=_[_0xec4a('0x44')](_0x51f8ee[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x48a76d[_0xec4a('0x3f')][_0xec4a('0x45')]));_0x5c1cea['attributes']=_0x5c1cea[_0xec4a('0x43')][_0xec4a('0x46')]?_0x5c1cea[_0xec4a('0x43')]:_0x51f8ee[_0xec4a('0x42')];if(!_0x48a76d[_0xec4a('0x3f')][_0xec4a('0x65')]('nolimit')){_0x5c1cea[_0xec4a('0x2b')]=qs['limit'](_0x48a76d[_0xec4a('0x3f')][_0xec4a('0x2b')]);_0x5c1cea['offset']=qs['offset'](_0x48a76d[_0xec4a('0x3f')][_0xec4a('0x29')]);}_0x5c1cea['order']=qs['sort'](_0x48a76d[_0xec4a('0x3f')][_0xec4a('0x48')]);_0x5c1cea['where']=qs[_0xec4a('0x41')](_[_0xec4a('0x4a')](_0x48a76d[_0xec4a('0x3f')],_0x51f8ee[_0xec4a('0x41')]));_0x5c1cea[_0xec4a('0x49')]['FaxAccountId']=_0x5b5cc4['id'];if(_0x48a76d['query'][_0xec4a('0x4b')]){_0x5c1cea[_0xec4a('0x49')]=_['merge'](_0x5c1cea[_0xec4a('0x49')],{'$or':_[_0xec4a('0x3b')](_0x5c1cea[_0xec4a('0x43')],function(_0x26bc25){var _0x1058a3={};_0x1058a3[_0x26bc25]={'$like':'%'+_0x48a76d[_0xec4a('0x3f')]['filter']+'%'};return _0x1058a3;})});}_0x5c1cea=_[_0xec4a('0x4c')]({},_0x5c1cea,_0x48a76d['options']);return db[_0xec4a('0x69')][_0xec4a('0x2c')]({'where':_0x5c1cea[_0xec4a('0x49')]})[_0xec4a('0x33')](function(_0x2abe3c){_0x501297[_0xec4a('0x2c')]=_0x2abe3c;if(_0x48a76d[_0xec4a('0x3f')][_0xec4a('0x4f')]){_0x5c1cea['include']=[{'all':!![]}];}return db[_0xec4a('0x69')][_0xec4a('0x51')](_0x5c1cea);})[_0xec4a('0x33')](function(_0x2a8da7){_0x501297[_0xec4a('0x52')]=_0x2a8da7;return _0x501297;});}})[_0xec4a('0x33')](respondWithFilteredResult(_0x47da7b,_0x5c1cea))[_0xec4a('0x25')](handleError(_0x47da7b,null));};exports[_0xec4a('0x6a')]=function(_0x49b562,_0x3749fc,_0x311541){return db['FaxAccount']['find']({'where':{'id':_0x49b562[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x3749fc,null))[_0xec4a('0x33')](function(_0x28babd){if(_0x28babd){return _0x28babd[_0xec4a('0x6a')](_0x49b562['query']['ids']);}})[_0xec4a('0x33')](respondWithStatusCode(_0x3749fc,null))[_0xec4a('0x25')](handleError(_0x3749fc,null));};exports[_0xec4a('0x6b')]=function(_0x1a982c,_0x519b38,_0x93ecc6){return db[_0xec4a('0x6c')]['find']({'where':{'id':_0x1a982c[_0xec4a('0x54')]['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x519b38,null))[_0xec4a('0x33')](function(_0x11b886){if(_0x11b886){return _0x11b886['addInteraction'](_0x1a982c[_0xec4a('0x57')]['ids'],_[_0xec4a('0x6d')](_0x1a982c[_0xec4a('0x57')],[_0xec4a('0x6e'),'id'])||{});}})[_0xec4a('0x33')](respondWithResult(_0x519b38,null))[_0xec4a('0x25')](handleError(_0x519b38,null));};exports[_0xec4a('0x6f')]=function(_0x28464e,_0x5f537a,_0x4f45f5){var _0x4627cf={'raw':![],'where':{}};var _0x1b6d48={};var _0x473590={'count':0x0,'rows':[]};return db[_0xec4a('0x4e')][_0xec4a('0x63')]({'where':{'id':_0x28464e['params']['id']}})['then'](handleEntityNotFound(_0x5f537a,null))[_0xec4a('0x33')](function(_0x12fad2){if(_0x12fad2){_0x1b6d48['model']=_['keys'](db['FaxInteraction'][_0xec4a('0x3c')]);_0x1b6d48[_0xec4a('0x3f')]=_[_0xec4a('0x40')](_0x28464e[_0xec4a('0x3f')]);_0x1b6d48[_0xec4a('0x41')]=_[_0xec4a('0x44')](_0x1b6d48[_0xec4a('0x42')],_0x1b6d48[_0xec4a('0x3f')]);_0x4627cf[_0xec4a('0x43')]=_[_0xec4a('0x44')](_0x1b6d48[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x28464e[_0xec4a('0x3f')]['fields']));_0x4627cf[_0xec4a('0x43')]=_0x4627cf['attributes'][_0xec4a('0x46')]?_0x4627cf['attributes']:_0x1b6d48['model'];if(!_0x28464e['query'][_0xec4a('0x65')](_0xec4a('0x47'))){_0x4627cf['limit']=qs[_0xec4a('0x2b')](_0x28464e[_0xec4a('0x3f')]['limit']);_0x4627cf[_0xec4a('0x29')]=qs[_0xec4a('0x29')](_0x28464e[_0xec4a('0x3f')]['offset']);}_0x4627cf[_0xec4a('0x66')]=qs[_0xec4a('0x48')](_0x28464e[_0xec4a('0x3f')][_0xec4a('0x48')]);_0x4627cf[_0xec4a('0x49')]=qs['filters'](_[_0xec4a('0x4a')](_0x28464e[_0xec4a('0x3f')],_0x1b6d48[_0xec4a('0x41')]));_0x4627cf[_0xec4a('0x49')]['FaxAccountId']=_0x12fad2['id'];if(_0x28464e[_0xec4a('0x3f')]['filter']){_0x4627cf[_0xec4a('0x49')]=_[_0xec4a('0x4c')](_0x4627cf[_0xec4a('0x49')],{'$or':_[_0xec4a('0x3b')](_0x4627cf[_0xec4a('0x43')],function(_0x43c49b){var _0x3acf3d={};_0x3acf3d[_0x43c49b]={'$like':'%'+_0x28464e[_0xec4a('0x3f')]['filter']+'%'};return _0x3acf3d;})});}_0x4627cf=_[_0xec4a('0x4c')]({},_0x4627cf,_0x28464e[_0xec4a('0x4d')]);return db['FaxInteraction'][_0xec4a('0x2c')]({'where':_0x4627cf['where']})[_0xec4a('0x33')](function(_0x4e6538){_0x473590[_0xec4a('0x2c')]=_0x4e6538;if(_0x28464e['query'][_0xec4a('0x4f')]){_0x4627cf[_0xec4a('0x50')]=[{'model':db[_0xec4a('0x70')],'as':'Contact','required':![]},{'model':db[_0xec4a('0x71')],'as':_0xec4a('0x72'),'attributes':['name',_0xec4a('0x73'),'internal'],'required':![]},{'model':db[_0xec4a('0x74')],'as':_0xec4a('0x75'),'attributes':['id',_0xec4a('0x38'),'color'],'where':_0x28464e[_0xec4a('0x3f')][_0xec4a('0x76')]?{'id':_0x28464e['query']['tag']}:undefined,'required':_0x28464e['query'][_0xec4a('0x76')]?!![]:![]}];}return db[_0xec4a('0x6c')][_0xec4a('0x51')](_0x4627cf);})[_0xec4a('0x33')](function(_0x1b9428){_0x473590['rows']=_0x1b9428;return _0x473590;});}})['then'](respondWithFilteredResult(_0x5f537a,_0x4627cf))[_0xec4a('0x25')](handleError(_0x5f537a,null));};exports[_0xec4a('0x77')]=function(_0x451521,_0x22e47d,_0x5159ff){return db['FaxAccount'][_0xec4a('0x63')]({'where':{'id':_0x451521['params']['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x22e47d,null))['then'](function(_0x4477de){if(_0x4477de){return db['sequelize'][_0xec4a('0x78')](function(_0x360be4){return db['FaxApplication'][_0xec4a('0x34')]({'where':{'FaxAccountId':_0x451521[_0xec4a('0x54')]['id']},'transaction':_0x360be4})['then'](function(_0x4f0a3e){var _0xeadb2c=_[_0xec4a('0x3b')](_0x451521['body'],function(_0x46b57e){_0x46b57e[_0xec4a('0x61')]=_0x451521[_0xec4a('0x54')]['id'];return _0x46b57e;});return db['FaxApplication'][_0xec4a('0x79')](_0xeadb2c,{'transaction':_0x360be4});});})['then'](function(){return db[_0xec4a('0x7a')][_0xec4a('0x7b')]({'where':{'FaxAccountId':_0x451521[_0xec4a('0x54')]['id']},'order':_0xec4a('0x7c')});});}})[_0xec4a('0x33')](respondWithResult(_0x22e47d,null))[_0xec4a('0x25')](handleError(_0x22e47d,null));};exports[_0xec4a('0x7d')]=function(_0x3d4969,_0x141c37,_0x3320ed){var _0x1430e7={};var _0x59b645={};var _0x5b1246;var _0x9dfb85;return db[_0xec4a('0x4e')][_0xec4a('0x63')]({'where':{'id':_0x3d4969[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x141c37,null))[_0xec4a('0x33')](function(_0x2fe7fa){if(_0x2fe7fa){_0x5b1246=_0x2fe7fa;_0x59b645[_0xec4a('0x42')]=_[_0xec4a('0x40')](db[_0xec4a('0x7a')][_0xec4a('0x3c')]);_0x59b645[_0xec4a('0x3f')]=_[_0xec4a('0x40')](_0x3d4969[_0xec4a('0x3f')]);_0x59b645[_0xec4a('0x41')]=_[_0xec4a('0x44')](_0x59b645[_0xec4a('0x42')],_0x59b645[_0xec4a('0x3f')]);_0x1430e7[_0xec4a('0x43')]=_[_0xec4a('0x44')](_0x59b645[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x3d4969[_0xec4a('0x3f')][_0xec4a('0x45')]));_0x1430e7[_0xec4a('0x43')]=_0x1430e7[_0xec4a('0x43')]['length']?_0x1430e7[_0xec4a('0x43')]:_0x59b645['model'];_0x1430e7[_0xec4a('0x66')]=qs[_0xec4a('0x48')](_0x3d4969[_0xec4a('0x3f')]['sort']);_0x1430e7[_0xec4a('0x49')]=qs['filters'](_['pick'](_0x3d4969[_0xec4a('0x3f')],_0x59b645['filters']));if(_0x3d4969[_0xec4a('0x3f')][_0xec4a('0x4b')]){_0x1430e7[_0xec4a('0x49')]=_[_0xec4a('0x4c')](_0x1430e7[_0xec4a('0x49')],{'$or':_[_0xec4a('0x3b')](_0x1430e7[_0xec4a('0x43')],function(_0x40f12b){var _0x427266={};_0x427266[_0x40f12b]={'$like':'%'+_0x3d4969[_0xec4a('0x3f')]['filter']+'%'};return _0x427266;})});}_0x1430e7=_[_0xec4a('0x4c')]({},_0x1430e7,_0x3d4969['options']);return _0x5b1246[_0xec4a('0x7d')](_0x1430e7);}})['then'](function(_0x43fa6b){if(_0x43fa6b){_0x9dfb85=_0x43fa6b[_0xec4a('0x46')];if(!_0x3d4969[_0xec4a('0x3f')][_0xec4a('0x65')]('nolimit')){_0x1430e7[_0xec4a('0x2b')]=qs[_0xec4a('0x2b')](_0x3d4969[_0xec4a('0x3f')][_0xec4a('0x2b')]);_0x1430e7[_0xec4a('0x29')]=qs['offset'](_0x3d4969[_0xec4a('0x3f')][_0xec4a('0x29')]);}return _0x5b1246[_0xec4a('0x7d')](_0x1430e7);}})[_0xec4a('0x33')](function(_0xbf19ce){if(_0xbf19ce){return _0xbf19ce?{'count':_0x9dfb85,'rows':_0xbf19ce}:null;}})['then'](respondWithResult(_0x141c37,null))[_0xec4a('0x25')](handleError(_0x141c37,null));};function Extension(_0xe4448e,_0x12ff72,_0x33a17d,_0x58e07a){this[_0xec4a('0x7e')]=_0xec4a('0x7f');this['exten']=_0xe4448e['localstationid'];this[_0xec4a('0x80')]=_0x58e07a;this[_0xec4a('0x3d')]=_0xec4a('0x81');this[_0xec4a('0x82')]=_0xec4a('0x83');this['FaxAccountId']=_0xe4448e['id'];this[_0xec4a('0x7c')]=_0x12ff72;this['appdata']=_0x33a17d;}function createExtensionsReciveFax(_0x13aa21){var _0x3f258f=0x1;var _0x53974c=[];_0x53974c[_0xec4a('0x84')](new Extension(_0x13aa21,_0x3f258f,'',_0xec4a('0x85')));_0x3f258f+=0x1;_0x53974c['push'](new Extension(_0x13aa21,_0x3f258f,_0xec4a('0x86'),_0xec4a('0x87')));_0x3f258f+=0x1;for(var _0x56a3e2 in _0x13aa21){if(_0x13aa21['hasOwnProperty'](_0x56a3e2)&&(_0x56a3e2===_0xec4a('0x88')||_0x56a3e2===_0xec4a('0x89')||_0x56a3e2===_0xec4a('0x8a')||_0x56a3e2===_0xec4a('0x8b')||_0x56a3e2===_0xec4a('0x8c')||_0x56a3e2===_0xec4a('0x8d')||_0x56a3e2===_0xec4a('0x8e')||_0x56a3e2===_0xec4a('0x8f')||_0x56a3e2==='t38timeout')){_0x53974c[_0xec4a('0x84')](new Extension(_0x13aa21,_0x3f258f,_0xec4a('0x90')+_0x56a3e2+')='+_0x13aa21[_0x56a3e2],_0xec4a('0x87')));_0x3f258f+=0x1;}}_0x53974c['push'](new Extension(_0x13aa21,_0x3f258f,'6',_0xec4a('0x91')));_0x3f258f+=0x1;_0x53974c['push'](new Extension(_0x13aa21,_0x3f258f,_0xec4a('0x92'),_0xec4a('0x93')));_0x3f258f=0x0;return _0x53974c;}exports[_0xec4a('0x94')]=function(_0x2f027b,_0x1c53e1,_0x5def7a){var _0x7f5dc8;return db[_0xec4a('0x95')][_0xec4a('0x78')](function(_0xf94ec1){return db[_0xec4a('0x4e')][_0xec4a('0x56')](_0x2f027b[_0xec4a('0x57')],{'transaction':_0xf94ec1})[_0xec4a('0x33')](function(_0x293e83){_0x7f5dc8=_0x293e83[_0xec4a('0x35')]({'plain':!![]});return db[_0xec4a('0x96')][_0xec4a('0x79')](createExtensionsReciveFax(_0x7f5dc8),{'transaction':_0xf94ec1});});})[_0xec4a('0x33')](function(){return _0x7f5dc8;})[_0xec4a('0x33')](respondWithResult(_0x1c53e1,null))[_0xec4a('0x25')](handleError(_0x1c53e1,null));};exports[_0xec4a('0x97')]=function(_0x2f7b0d,_0x4f6c50,_0x469696){var _0x506f41;return db[_0xec4a('0x95')][_0xec4a('0x78')](function(_0x114991){return db['FaxAccount']['update'](_0x2f7b0d[_0xec4a('0x57')],{'where':{'id':_0x2f7b0d[_0xec4a('0x57')]['id']},'transaction':_0x114991})[_0xec4a('0x33')](function(_0x56f729){return db[_0xec4a('0x96')][_0xec4a('0x34')]({'where':{'FaxAccountId':_0x2f7b0d[_0xec4a('0x57')]['id']},'transaction':_0x114991})[_0xec4a('0x33')](function(_0x48eadb){return db['VoiceExtension'][_0xec4a('0x79')](createExtensionsReciveFax(_[_0xec4a('0x6d')](_0x2f7b0d[_0xec4a('0x57')],[_0xec4a('0x98'),_0xec4a('0x3e'),_0xec4a('0x99'),_0xec4a('0x9a'),_0xec4a('0x9b'),_0xec4a('0x9c')])),{'transaction':_0x114991});});});})[_0xec4a('0x33')](function(){return db[_0xec4a('0x4e')][_0xec4a('0x9d')](_0x2f7b0d[_0xec4a('0x57')]['id']);})[_0xec4a('0x33')](respondWithResult(_0x4f6c50,null))[_0xec4a('0x25')](handleError(_0x4f6c50,null));};exports[_0xec4a('0x9e')]=function(_0x54192b,_0x2882e0,_0x73839b){var _0x5161b2={'raw':!![],'where':{}};var _0x13065a={};var _0x31e061={'count':0x0,'rows':[]};return db['FaxAccount'][_0xec4a('0x63')]({'where':{'id':_0x54192b[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x2882e0,null))[_0xec4a('0x33')](function(_0x4ceaa6){if(_0x4ceaa6){_0x13065a['model']=_[_0xec4a('0x40')](db[_0xec4a('0x9f')][_0xec4a('0x3c')]);_0x13065a[_0xec4a('0x3f')]=_[_0xec4a('0x40')](_0x54192b[_0xec4a('0x3f')]);_0x13065a[_0xec4a('0x41')]=_[_0xec4a('0x44')](_0x13065a[_0xec4a('0x42')],_0x13065a[_0xec4a('0x3f')]);_0x5161b2['attributes']=_['intersection'](_0x13065a[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x54192b['query'][_0xec4a('0x45')]));_0x5161b2[_0xec4a('0x43')]=_0x5161b2[_0xec4a('0x43')][_0xec4a('0x46')]?_0x5161b2[_0xec4a('0x43')]:_0x13065a['model'];if(!_0x54192b['query'][_0xec4a('0x65')](_0xec4a('0x47'))){_0x5161b2[_0xec4a('0x2b')]=qs[_0xec4a('0x2b')](_0x54192b[_0xec4a('0x3f')][_0xec4a('0x2b')]);_0x5161b2[_0xec4a('0x29')]=qs[_0xec4a('0x29')](_0x54192b[_0xec4a('0x3f')][_0xec4a('0x29')]);}_0x5161b2[_0xec4a('0x66')]=qs[_0xec4a('0x48')](_0x54192b[_0xec4a('0x3f')][_0xec4a('0x48')]);_0x5161b2['where']=qs['filters'](_['pick'](_0x54192b[_0xec4a('0x3f')],_0x13065a[_0xec4a('0x41')]));_0x5161b2[_0xec4a('0x49')][_0xec4a('0x61')]=_0x4ceaa6['id'];if(_0x54192b[_0xec4a('0x3f')][_0xec4a('0x4b')]){_0x5161b2[_0xec4a('0x49')]=_[_0xec4a('0x4c')](_0x5161b2[_0xec4a('0x49')],{'$or':_[_0xec4a('0x3b')](_0x5161b2[_0xec4a('0x43')],function(_0x1897e4){var _0x321ffb={};_0x321ffb[_0x1897e4]={'$like':'%'+_0x54192b[_0xec4a('0x3f')]['filter']+'%'};return _0x321ffb;})});}if(_0x54192b[_0xec4a('0x3f')][_0xec4a('0xa0')]){var _0x2c20fe=_0x54192b[_0xec4a('0x3f')][_0xec4a('0xa0')][_0xec4a('0xa1')](',');var _0x441e6d={};_0x441e6d[_0x2c20fe[0x0]]={'$gte':moment(_0x2c20fe[0x1])[_0xec4a('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5161b2[_0xec4a('0x49')]=_[_0xec4a('0x4c')](_0x5161b2[_0xec4a('0x49')],_0x441e6d);}_0x5161b2=_[_0xec4a('0x4c')]({},_0x5161b2,_0x54192b[_0xec4a('0x4d')]);return db[_0xec4a('0x9f')][_0xec4a('0x2c')]({'where':_0x5161b2[_0xec4a('0x49')]})['then'](function(_0x3483ff){_0x31e061[_0xec4a('0x2c')]=_0x3483ff;if(_0x54192b[_0xec4a('0x3f')][_0xec4a('0x4f')]){_0x5161b2['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5161b2);})[_0xec4a('0x33')](function(_0x380233){_0x31e061['rows']=_0x380233;return _0x31e061;});}})['then'](respondWithFilteredResult(_0x2882e0,_0x5161b2))['catch'](handleError(_0x2882e0,null));};exports[_0xec4a('0xa3')]=function(_0x361818,_0x191dbc,_0x2ba0d9){var _0x10b432,_0x12ec25={},_0x3c8253;if(_0x361818['body']['to']){_0x3c8253=_0x361818[_0xec4a('0x57')]['to'][0x0];}return db[_0xec4a('0x4e')]['find']({'where':{'id':_0x361818[_0xec4a('0x54')]['id']},'include':[{'model':db[_0xec4a('0xa4')],'as':_0xec4a('0xa5'),'include':[{'model':db[_0xec4a('0x70')],'as':_0xec4a('0xa6'),'where':{'fax':_0x3c8253},'limit':0x1,'order':[['updatedAt',_0xec4a('0xa7')]]}]}]})[_0xec4a('0x33')](handleEntityNotFound(_0x191dbc,null))[_0xec4a('0x33')](function(_0x4a4703){_0x10b432=_0x4a4703;if(_0x361818['body'][_0xec4a('0xa8')]&&_0x361818['body'][_0xec4a('0xa8')][_0xec4a('0x46')]){for(var _0x53aa3b=0x0;_0x53aa3b<_0x361818['body'][_0xec4a('0xa8')]['length'];_0x53aa3b+=0x1){_0x361818['body'][_0xec4a('0xa8')][_0x53aa3b]={'filename':_0x361818[_0xec4a('0x57')][_0xec4a('0xa8')][_0x53aa3b][_0xec4a('0x38')],'id':_0x361818[_0xec4a('0x57')][_0xec4a('0xa8')][_0x53aa3b]['id'],'path':path['join'](config[_0xec4a('0xa9')],_0xec4a('0xaa'),_0x361818['body'][_0xec4a('0xa8')][_0x53aa3b]['basename'])};}}return respondWithRpcPromise(_0xec4a('0xab'),_0xec4a('0xab'),{'FaxAccountId':_['isNil'](_0x361818[_0xec4a('0x54')]['id'])?undefined:_0x361818[_0xec4a('0x54')]['id'],'path':_['isNil'](_0x361818[_0xec4a('0x57')][_0xec4a('0xa8')][0x0][_0xec4a('0xac')])?undefined:_0x361818[_0xec4a('0x57')]['attachments'][0x0][_0xec4a('0xac')],'fax':_[_0xec4a('0xad')](_0x361818['body']['to'][0x0])?undefined:_0x361818[_0xec4a('0x57')]['to'][0x0]},client9002);})[_0xec4a('0x33')](function(){if(_0x10b432){if(_[_0xec4a('0xad')](_0x361818['body'][_0xec4a('0xae')])){_0x361818[_0xec4a('0x57')][_0xec4a('0xae')]=util[_0xec4a('0xa2')](_0xec4a('0xaf'),_0x10b432[_0xec4a('0x38')],_0x10b432[_0xec4a('0xb0')]);}if(_0x10b432[_0xec4a('0xa5')]){if(_0x10b432['List']['Contacts'][_0xec4a('0x46')]){return _0x10b432[_0xec4a('0xa5')][_0xec4a('0xa6')][0x0];}else{return db[_0xec4a('0x70')][_0xec4a('0x56')](_[_0xec4a('0xb1')](_0x361818[_0xec4a('0x57')],{'firstName':_0x361818[_0xec4a('0x57')]['to'][0x0],'phone':_0x361818['body']['to'][0x0],'fax':_0x361818[_0xec4a('0x57')]['to'][0x0],'ListId':_0x10b432[_0xec4a('0x9c')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xec4a('0xb2'));}})[_0xec4a('0x33')](function(_0x3bd369){if(_0x3bd369){return db['FaxInteraction'][_0xec4a('0x55')]({'where':{'ContactId':_0x3bd369['id'],'closed':![],'FaxAccountId':_0x10b432['id']}})[_0xec4a('0x33')](function(_0x580833){if(_0x580833){return[_0x580833,![]];}return db[_0xec4a('0x6c')]['create']({'UserId':_0x361818[_0xec4a('0x58')]['id'],'ContactId':_0x3bd369['id'],'FaxAccountId':_0x10b432['id'],'fax':_0x361818[_0xec4a('0x57')]['to'][0x0],'firstMsgDirection':_0xec4a('0xb3'),'Messages':[_[_0xec4a('0x4c')](_0x361818[_0xec4a('0x57')],{'read':![],'body':_0x361818['body'][_0xec4a('0xa8')][0x0]['filename'],'FaxAccountId':_0x10b432['id'],'UserId':_0x361818[_0xec4a('0x58')]['id'],'ContactId':_0x3bd369['id'],'AttachmentId':_0x361818[_0xec4a('0x57')][_0xec4a('0xa8')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xec4a('0xb4')}]})[_0xec4a('0x33')](function(_0x29acd7){return[_0x29acd7,!![]];});});}else{throw new Error(_0xec4a('0xb5'));}})[_0xec4a('0xb6')](function(_0x466c0c,_0xaf8528){if(_0xaf8528){return _0x466c0c;}return db[_0xec4a('0x9f')][_0xec4a('0x56')]({'direction':_0xec4a('0xb3'),'read':![],'body':_0x361818[_0xec4a('0x57')]['attachments'][0x0]['filename'],'FaxAccountId':_0x10b432['id'],'FaxInteractionId':_0x466c0c['id'],'UserId':_0x361818['user']['id'],'ContactId':_0x466c0c[_0xec4a('0xb7')],'AttachmentId':_0x361818['body'][_0xec4a('0xa8')][0x0]['id']})[_0xec4a('0x33')](function(_0x962674){_0x466c0c[_0xec4a('0xb8')]['Messages']=[];_0x466c0c[_0xec4a('0xb8')][_0xec4a('0xb4')][_0xec4a('0x84')](_0x962674[_0xec4a('0xb8')]);return _0x466c0c;});})[_0xec4a('0x33')](function(_0x481827){respondWithRpcPromise('SendFax',_0xec4a('0xb9'),{'FaxAccountId':_['isNil'](_0x361818['params']['id'])?undefined:_0x361818['params']['id'],'path':_[_0xec4a('0xad')](_0x361818[_0xec4a('0x57')][_0xec4a('0xa8')][0x0]['path'])?undefined:_0x361818[_0xec4a('0x57')][_0xec4a('0xa8')][0x0][_0xec4a('0xac')],'fax':_['isNil'](_0x361818['body']['to'][0x0])?undefined:_0x361818[_0xec4a('0x57')]['to'][0x0],'AttachmentId':_0x361818['body'][_0xec4a('0xa8')][0x0]['id']},client9002)[_0xec4a('0x33')](function(_0x470d65){logger[_0xec4a('0x1b')](_0xec4a('0xba'),_0x470d65);})['catch'](function(_0x55849f){logger[_0xec4a('0x1b')](_0xec4a('0xba'),_0x55849f);});return _0x481827;})[_0xec4a('0x33')](respondWithResult(_0x191dbc,null))['catch'](handleError(_0x191dbc,null));};exports[_0xec4a('0xbb')]=function(_0x114ae6,_0x33b72b,_0x55ce6b){return db[_0xec4a('0x4e')][_0xec4a('0x55')]({'where':{'id':_0x114ae6[_0xec4a('0x54')]['id']}})['then'](handleEntityNotFound(_0x33b72b,null))['then'](function(_0x11f87d){if(_0x11f87d){return _0x11f87d[_0xec4a('0xbb')](_0x114ae6['body'][_0xec4a('0x6e')],_[_0xec4a('0x6d')](_0x114ae6[_0xec4a('0x57')],['ids','id'])||{})[_0xec4a('0xb6')](function(_0x530ec2){for(var _0x46931f=0x0;_0x46931f<_0x114ae6[_0xec4a('0x57')][_0xec4a('0x6e')][_0xec4a('0x46')];_0x46931f+=0x1){socket['emit'](_0xec4a('0xbc'),{'UserId':Number(_0x114ae6['body'][_0xec4a('0x6e')][_0x46931f]),'FaxAccountId':Number(_0x114ae6[_0xec4a('0x54')]['id'])});}return _0x530ec2;});}})[_0xec4a('0x33')](respondWithResult(_0x33b72b,null))[_0xec4a('0x25')](handleError(_0x33b72b,null));};exports[_0xec4a('0xbd')]=function(_0x273249,_0x3c2c14,_0x34ae5d){return db['FaxAccount'][_0xec4a('0x55')]({'where':{'id':_0x273249[_0xec4a('0x54')]['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x3c2c14,null))[_0xec4a('0x33')](function(_0x10300b){if(_0x10300b){return _0x10300b['removeAgents'](_0x273249[_0xec4a('0x3f')][_0xec4a('0x6e')])[_0xec4a('0x33')](function(){if(_[_0xec4a('0xbe')](_0x273249[_0xec4a('0x3f')][_0xec4a('0x6e')])){for(var _0x2faff7=0x0;_0x2faff7<_0x273249[_0xec4a('0x3f')][_0xec4a('0x6e')][_0xec4a('0x46')];_0x2faff7+=0x1){socket[_0xec4a('0xbf')](_0xec4a('0xc0'),{'UserId':Number(_0x273249[_0xec4a('0x3f')][_0xec4a('0x6e')][_0x2faff7]),'FaxAccountId':Number(_0x273249['params']['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x273249[_0xec4a('0x3f')][_0xec4a('0x6e')]),'FaxAccountId':Number(_0x273249[_0xec4a('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c2c14,null))[_0xec4a('0x25')](handleError(_0x3c2c14,null));};exports['getAgents']=function(_0x15fe8f,_0x47448b,_0x2d818a){var _0x3b390f={};var _0x19d7a3={};var _0x218f68;var _0x61f0ce;return db[_0xec4a('0x4e')]['findOne']({'where':{'id':_0x15fe8f['params']['id']}})[_0xec4a('0x33')](handleEntityNotFound(_0x47448b,null))[_0xec4a('0x33')](function(_0x24684c){if(_0x24684c){_0x218f68=_0x24684c;_0x19d7a3[_0xec4a('0x42')]=_['keys'](db['User']['rawAttributes']);_0x19d7a3['query']=_[_0xec4a('0x40')](_0x15fe8f[_0xec4a('0x3f')]);_0x19d7a3['filters']=_[_0xec4a('0x44')](_0x19d7a3['model'],_0x19d7a3[_0xec4a('0x3f')]);_0x3b390f[_0xec4a('0x43')]=_[_0xec4a('0x44')](_0x19d7a3[_0xec4a('0x42')],qs[_0xec4a('0x45')](_0x15fe8f[_0xec4a('0x3f')][_0xec4a('0x45')]));_0x3b390f[_0xec4a('0x43')]=_0x3b390f[_0xec4a('0x43')][_0xec4a('0x46')]?_0x3b390f[_0xec4a('0x43')]:_0x19d7a3[_0xec4a('0x42')];_0x3b390f[_0xec4a('0x66')]=qs['sort'](_0x15fe8f[_0xec4a('0x3f')][_0xec4a('0x48')]);_0x3b390f[_0xec4a('0x49')]=qs[_0xec4a('0x41')](_[_0xec4a('0x4a')](_0x15fe8f[_0xec4a('0x3f')],_0x19d7a3[_0xec4a('0x41')]));if(_0x15fe8f[_0xec4a('0x3f')]['filter']){_0x3b390f[_0xec4a('0x49')]=_['merge'](_0x3b390f[_0xec4a('0x49')],{'$or':_[_0xec4a('0x3b')](_0x3b390f[_0xec4a('0x43')],function(_0x5e3bb8){var _0xedd310={};_0xedd310[_0x5e3bb8]={'$like':'%'+_0x15fe8f[_0xec4a('0x3f')][_0xec4a('0x4b')]+'%'};return _0xedd310;})});}_0x3b390f=_[_0xec4a('0x4c')]({},_0x3b390f,_0x15fe8f[_0xec4a('0x4d')]);return _0x218f68['getAgents'](_0x3b390f);}})[_0xec4a('0x33')](function(_0x87e85f){if(_0x87e85f){_0x61f0ce=_0x87e85f[_0xec4a('0x46')];if(!_0x15fe8f[_0xec4a('0x3f')][_0xec4a('0x65')](_0xec4a('0x47'))){_0x3b390f[_0xec4a('0x2b')]=qs['limit'](_0x15fe8f[_0xec4a('0x3f')]['limit']);_0x3b390f[_0xec4a('0x29')]=qs[_0xec4a('0x29')](_0x15fe8f[_0xec4a('0x3f')][_0xec4a('0x29')]);}return _0x218f68[_0xec4a('0xc1')](_0x3b390f);}})[_0xec4a('0x33')](function(_0x3d3aed){if(_0x3d3aed){return _0x3d3aed?{'count':_0x61f0ce,'rows':_0x3d3aed}:null;}})[_0xec4a('0x33')](respondWithResult(_0x47448b,null))[_0xec4a('0x25')](handleError(_0x47448b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 4d864f5..633cc1d 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 _0x6acf=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6acf,0x1d5));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf6ac('0x0'));var FaxAccount=require(_0xf6ac('0x1'))['db'][_0xf6ac('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf6ac('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6ac('0x4'),'afterDestroy':_0xf6ac('0x5')};function emitEvent(_0x525438){return function(_0x3be76d,_0x4f3f17,_0x4d0c89){FaxAccountEvents['emit'](_0x525438+':'+_0x3be76d['id'],_0x3be76d);FaxAccountEvents[_0xf6ac('0x6')](_0x525438,_0x3be76d);_0x4d0c89(null);};}for(var e in events){if(events[_0xf6ac('0x7')](e)){var event=events[e];FaxAccount[_0xf6ac('0x8')](e,emitEvent(event));}}module[_0xf6ac('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xca6b=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x20e79a,_0x322d4e){var _0x70801f=function(_0x12aed2){while(--_0x12aed2){_0x20e79a['push'](_0x20e79a['shift']());}};_0x70801f(++_0x322d4e);}(_0xca6b,0xd3));var _0xbca6=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xca6b[_0x4fc9e6];return _0x551d28;};'use strict';var EventEmitter=require(_0xbca6('0x0'));var FaxAccount=require(_0xbca6('0x1'))['db'][_0xbca6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbca6('0x3')](0x0);var events={'afterCreate':_0xbca6('0x4'),'afterUpdate':_0xbca6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36f57d){return function(_0x50af5b,_0x9aa412,_0x4badd1){FaxAccountEvents[_0xbca6('0x6')](_0x36f57d+':'+_0x50af5b['id'],_0x50af5b);FaxAccountEvents[_0xbca6('0x6')](_0x36f57d,_0x50af5b);_0x4badd1(null);};}for(var e in events){if(events[_0xbca6('0x7')](e)){var event=events[e];FaxAccount[_0xbca6('0x8')](e,emitEvent(event));}}module[_0xbca6('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index e1a8818..9bbdbf4 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 _0x3cb4=['fax_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount'];(function(_0x13892e,_0x23ad62){var _0x39527a=function(_0x10551b){while(--_0x10551b){_0x13892e['push'](_0x13892e['shift']());}};_0x39527a(++_0x23ad62);}(_0x3cb4,0xd1));var _0x43cb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3cb4[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x43cb('0x0'));var util=require(_0x43cb('0x1'));var logger=require('../../config/logger')(_0x43cb('0x2'));var moment=require(_0x43cb('0x3'));var BPromise=require(_0x43cb('0x4'));var rp=require(_0x43cb('0x5'));var fs=require('fs');var path=require(_0x43cb('0x6'));var rimraf=require(_0x43cb('0x7'));var config=require(_0x43cb('0x8'));var attributes=require(_0x43cb('0x9'));module[_0x43cb('0xa')]=function(_0x331000,_0x4937c2){return _0x331000['define'](_0x43cb('0xb'),attributes,{'tableName':_0x43cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2785=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','lodash','util'];(function(_0x174583,_0x468485){var _0x14e46f=function(_0x227127){while(--_0x227127){_0x174583['push'](_0x174583['shift']());}};_0x14e46f(++_0x468485);}(_0x2785,0xb9));var _0x5278=function(_0x4232a8,_0x295a1e){_0x4232a8=_0x4232a8-0x0;var _0x26c6ca=_0x2785[_0x4232a8];return _0x26c6ca;};'use strict';var _=require(_0x5278('0x0'));var util=require(_0x5278('0x1'));var logger=require(_0x5278('0x2'))(_0x5278('0x3'));var moment=require(_0x5278('0x4'));var BPromise=require(_0x5278('0x5'));var rp=require(_0x5278('0x6'));var fs=require('fs');var path=require(_0x5278('0x7'));var rimraf=require(_0x5278('0x8'));var config=require(_0x5278('0x9'));var attributes=require(_0x5278('0xa'));module['exports']=function(_0x122763,_0x567428){return _0x122763['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 606481a..dbd990a 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 _0xf695=['ContactId','AttachmentId','UserId','name','interaction','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','FaxAccount,\x20%s,\x20%s','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetFaxAccount','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','List','Contacts','FaxApplication','get','account','applications','Applications','length','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','created','FaxMessage'];(function(_0x3aa8d7,_0x14bacf){var _0x41711e=function(_0x3d1301){while(--_0x3d1301){_0x3aa8d7['push'](_0x3aa8d7['shift']());}};_0x41711e(++_0x14bacf);}(_0xf695,0x1b8));var _0x5f69=function(_0x19f9a5,_0xa6924a){_0x19f9a5=_0x19f9a5-0x0;var _0x2eada1=_0xf695[_0x19f9a5];return _0x2eada1;};'use strict';var _=require('lodash');var util=require(_0x5f69('0x0'));var moment=require(_0x5f69('0x1'));var BPromise=require(_0x5f69('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f69('0x3'));var db=require(_0x5f69('0x4'))['db'];var utils=require(_0x5f69('0x5'));var logger=require(_0x5f69('0x6'))(_0x5f69('0x7'));var config=require(_0x5f69('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f69('0x9')][_0x5f69('0xa')]({'port':0x232c});config['redis']=_[_0x5f69('0xb')](config[_0x5f69('0xc')],{'host':_0x5f69('0xd'),'port':0x18eb});var socket=require(_0x5f69('0xe'))(new Redis(config[_0x5f69('0xc')]));require('./faxAccount.socket')[_0x5f69('0xf')](socket);function respondWithRpcPromise(_0x3cbf83,_0x4a40ee,_0xbe2901){return new BPromise(function(_0x432a13,_0x24c136){return client[_0x5f69('0x10')](_0x3cbf83,_0xbe2901)[_0x5f69('0x11')](function(_0x4e388f){logger[_0x5f69('0x12')]('FaxAccount,\x20%s,\x20%s',_0x4a40ee,_0x5f69('0x13'));logger[_0x5f69('0x14')](_0x5f69('0x15'),_0x4a40ee,_0x5f69('0x13'),JSON['stringify'](_0x4e388f));if(_0x4e388f[_0x5f69('0x16')]){if(_0x4e388f['error']['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4a40ee,_0x4e388f[_0x5f69('0x16')][_0x5f69('0x17')]);return _0x24c136(_0x4e388f[_0x5f69('0x16')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x4a40ee,_0x4e388f[_0x5f69('0x16')][_0x5f69('0x17')]);return _0x432a13(_0x4e388f[_0x5f69('0x16')][_0x5f69('0x17')]);}else{logger[_0x5f69('0x12')](_0x5f69('0x18'),_0x4a40ee,'request\x20sent');_0x432a13(_0x4e388f['result']['message']);}})['catch'](function(_0x315039){logger['error'](_0x5f69('0x18'),_0x4a40ee,_0x315039);_0x24c136(_0x315039);});});}exports['GetFaxAccount']=function(_0x4f0db2){var _0x1b901d=this;return new Promise(function(_0x251bc1,_0x4d873d){return db[_0x5f69('0x19')][_0x5f69('0x1a')]({'raw':_0x4f0db2['options']?_0x4f0db2[_0x5f69('0x1b')][_0x5f69('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f0db2['options']?_0x4f0db2[_0x5f69('0x1b')][_0x5f69('0x1d')]||null:null,'attributes':_0x4f0db2[_0x5f69('0x1b')]?_0x4f0db2[_0x5f69('0x1b')]['attributes']||null:null,'limit':_0x4f0db2[_0x5f69('0x1b')]?_0x4f0db2['options'][_0x5f69('0x1e')]||null:null,'include':_0x4f0db2[_0x5f69('0x1b')]?_0x4f0db2[_0x5f69('0x1b')][_0x5f69('0x1f')]?_[_0x5f69('0x20')](_0x4f0db2['options'][_0x5f69('0x1f')],function(_0x4dcaf0){return{'model':db[_0x4dcaf0[_0x5f69('0x21')]],'as':_0x4dcaf0['as'],'attributes':_0x4dcaf0[_0x5f69('0x22')],'include':_0x4dcaf0['include']?_[_0x5f69('0x20')](_0x4dcaf0[_0x5f69('0x1f')],function(_0x51190f){return{'model':db[_0x51190f[_0x5f69('0x21')]],'as':_0x51190f['as'],'attributes':_0x51190f[_0x5f69('0x22')],'include':_0x51190f[_0x5f69('0x1f')]?_[_0x5f69('0x20')](_0x51190f[_0x5f69('0x1f')],function(_0x1915e3){return{'model':db[_0x1915e3[_0x5f69('0x21')]],'as':_0x1915e3['as'],'attributes':_0x1915e3[_0x5f69('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26f025){logger[_0x5f69('0x12')](_0x5f69('0x23'),_0x4f0db2);logger[_0x5f69('0x14')]('GetFaxAccount',_0x4f0db2,JSON[_0x5f69('0x24')](_0x26f025));_0x251bc1(_0x26f025);})[_0x5f69('0x25')](function(_0x4906f3){logger[_0x5f69('0x16')](_0x5f69('0x23'),_0x4906f3[_0x5f69('0x17')],_0x4f0db2);_0x4d873d(_0x1b901d[_0x5f69('0x16')](0x1f4,_0x4906f3[_0x5f69('0x17')]));});});};exports[_0x5f69('0x26')]=function(_0x19ef94,_0x2a9d11,_0xbc1d40){var _0x30f3c4=this;return new Promise(function(_0x172959,_0x311c6f){var _0x50fea0={'body':_0x19ef94[_0x5f69('0x27')],'channel':_0x5f69('0x28')};var _0x4770fb=[];var _0x14538a=[];var _0x304779={};return db[_0x5f69('0x29')][_0x5f69('0x2a')]()[_0x5f69('0x11')](function(_0x1d4512){if(!_0x1d4512){throw new db[(_0x5f69('0x2b'))][(_0x5f69('0x2c'))](_0x5f69('0x2d'));}_0x4770fb=_['difference'](_[_0x5f69('0x2e')](_0x1d4512),[_0x5f69('0x2f'),_0x5f69('0x30')]);_0x14538a=_[_0x5f69('0x31')](_[_0x5f69('0x2e')](_0x1d4512),[_0x5f69('0x2f'),_0x5f69('0x30'),'CompanyId',_0x5f69('0x32')]);if(_0x19ef94[_0x5f69('0x27')]['id']){delete _0x19ef94[_0x5f69('0x27')]['id'];}if(_['isNil'](_0x19ef94[_0x5f69('0x27')]['from'])){throw new db[(_0x5f69('0x2b'))]['ValidationError'](_0x5f69('0x33'));}if(_[_0x5f69('0x34')](_0x19ef94[_0x5f69('0x27')][_0x5f69('0x27')])||_0x19ef94[_0x5f69('0x27')][_0x5f69('0x27')]===''){throw new db[(_0x5f69('0x2b'))][(_0x5f69('0x2c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x19ef94[_0x5f69('0x27')]['mapKey'])){throw new db[(_0x5f69('0x2b'))][(_0x5f69('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14538a);}if(!_['includes'](_0x14538a,_0x19ef94[_0x5f69('0x27')][_0x5f69('0x35')])){throw new db['Sequelize'][(_0x5f69('0x2c'))](_0x5f69('0x36')+_0x14538a);}_0x304779[_0x19ef94[_0x5f69('0x27')][_0x5f69('0x35')]]=_0x19ef94['body'][_0x5f69('0x37')];})['then'](function(){return db[_0x5f69('0x19')][_0x5f69('0x38')]({'where':{'id':_0x19ef94['account']['id']},'include':[{'model':db[_0x5f69('0x39')],'as':_0x5f69('0x3a'),'include':[{'model':db[_0x5f69('0x29')],'as':_0x5f69('0x3b'),'where':_0x304779,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5f69('0x3c')],'as':'Applications'}]});})['then'](function(_0x380ef5){if(_0x380ef5&&_0x380ef5[_0x5f69('0x3a')]){var _0x158fa6=_0x380ef5[_0x5f69('0x3d')]({'plain':!![]});_0x50fea0[_0x5f69('0x3e')]=_0x158fa6;_0x50fea0[_0x5f69('0x3f')]=_0x158fa6[_0x5f69('0x40')];_0x50fea0['list']=_0x158fa6[_0x5f69('0x3a')];_0x50fea0[_0x5f69('0x3f')]=_['orderBy'](_0x50fea0[_0x5f69('0x3f')],['priority'],['asc']);if(_0x50fea0[_0x5f69('0x3e')][_0x5f69('0x40')]){delete _0x50fea0[_0x5f69('0x3e')][_0x5f69('0x40')];}if(_0x50fea0[_0x5f69('0x3e')][_0x5f69('0x3a')]&&_0x50fea0[_0x5f69('0x3e')]['List'][_0x5f69('0x3b')][_0x5f69('0x41')]){return _0x50fea0[_0x5f69('0x3e')][_0x5f69('0x3a')][_0x5f69('0x3b')][0x0];}var _0x561f1d=_['defaults'](_0x19ef94[_0x5f69('0x27')],{'firstName':_0x19ef94[_0x5f69('0x27')][_0x5f69('0x37')],'ListId':_0x158fa6['ListId']});_0x561f1d[_0x19ef94[_0x5f69('0x27')][_0x5f69('0x35')]]=_0x19ef94[_0x5f69('0x27')][_0x5f69('0x37')];return db[_0x5f69('0x29')][_0x5f69('0x42')](_0x561f1d,{'fields':_0x4770fb,'raw':!![]});}})[_0x5f69('0x11')](function(_0x52e8d1){_0x50fea0[_0x5f69('0x43')]=_0x52e8d1;if(_0x52e8d1){var _0x2c3fd7={'ContactId':_0x52e8d1['id'],'FaxAccountId':_0x19ef94['account']['id'],'fax':_0x52e8d1[_0x5f69('0x28')]};return db[_0x5f69('0x44')]['find']({'where':{'ContactId':_0x52e8d1['id'],'closed':![],'FaxAccountId':_0x19ef94[_0x5f69('0x3e')]['id']}})[_0x5f69('0x11')](function(_0x22b0db){if(_0x22b0db){return[_0x22b0db,![]];}return db[_0x5f69('0x44')][_0x5f69('0x42')](_0x2c3fd7)[_0x5f69('0x11')](function(_0x22cac2){return[_0x22cac2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5f69('0x45')](function(_0x138ade,_0x23ec72){var _0x4f6266=_0x138ade[_0x5f69('0x3d')]({'plain':!![]});if(_0x23ec72){if(_0x50fea0['account'][_0x5f69('0x46')]){_0x50fea0[_0x5f69('0x3f')][_0x5f69('0x47')]({'id':0x0,'priority':_0x50fea0[_0x5f69('0x3f')][_0x5f69('0x41')]+0x1,'app':_0x5f69('0x48'),'appdata':_0x5f69('0x49'),'interval':'*,*,*,*'});}_0x4f6266[_0x5f69('0x4a')]=!![];}else{_0x4f6266[_0x5f69('0x4a')]=![];}_0x50fea0['interaction']=_0x4f6266;return db[_0x5f69('0x4b')]['create']({'body':_0x19ef94[_0x5f69('0x27')][_0x5f69('0x27')],'FaxAccountId':_0x19ef94[_0x5f69('0x3e')]['id'],'FaxInteractionId':_0x138ade['id'],'direction':'in','ContactId':_0x138ade[_0x5f69('0x4c')],'AttachmentId':_0x19ef94[_0x5f69('0x27')][_0x5f69('0x4d')]});})[_0x5f69('0x11')](function(_0x5cb7fa){_0x50fea0[_0x5f69('0x17')]=_0x5cb7fa;if(_0x50fea0['interaction'][_0x5f69('0x4e')]){return db['User']['find']({'attributes':['id',_0x5f69('0x4f')],'where':{'id':_0x50fea0[_0x5f69('0x50')]['UserId']}})[_0x5f69('0x11')](function(_0x2e8bee){if(_0x2e8bee){_0x50fea0['applications'][_0x5f69('0x51')]({'id':0x0,'priority':0x0,'app':_0x5f69('0x52'),'appdata':_0x2e8bee['name']+','+(_0x50fea0[_0x5f69('0x3e')][_0x5f69('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5f69('0x54'),_0x5f69('0x55'),_0x50fea0);});}return respondWithRpcPromise(_0x5f69('0x54'),_0x5f69('0x55'),_0x50fea0);})['then'](function(_0x4e772d){_0x172959(_0x4e772d);})['catch'](function(_0x5b6f52){_0x311c6f(_0x30f3c4[_0x5f69('0x16')](0x1f4,_0x5b6f52[_0x5f69('0x17')]));});});}; \ No newline at end of file +var _0xda17=['defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','body','fax','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','asc','length','ListId','create','FaxInteraction','Contact\x20not\x20found','push','close','unmanaged','*,*,*,*','created','FaxMessage','AttachmentId','interaction','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xda17,0x1a8));var _0x7da1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xda17[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7da1('0x0'));var util=require(_0x7da1('0x1'));var moment=require(_0x7da1('0x2'));var BPromise=require('bluebird');var rs=require(_0x7da1('0x3'));var fs=require('fs');var Redis=require(_0x7da1('0x4'));var db=require(_0x7da1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7da1('0x6'))('rpc');var config=require(_0x7da1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7da1('0x8')][_0x7da1('0x9')]({'port':0x232c});config[_0x7da1('0xa')]=_[_0x7da1('0xb')](config[_0x7da1('0xa')],{'host':_0x7da1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7da1('0xa')]));require(_0x7da1('0xd'))[_0x7da1('0xe')](socket);function respondWithRpcPromise(_0x4ad40d,_0x54554e,_0x3eb104){return new BPromise(function(_0x27435e,_0x331707){return client[_0x7da1('0xf')](_0x4ad40d,_0x3eb104)[_0x7da1('0x10')](function(_0x410d8e){logger[_0x7da1('0x11')](_0x7da1('0x12'),_0x54554e,_0x7da1('0x13'));logger[_0x7da1('0x14')](_0x7da1('0x15'),_0x54554e,_0x7da1('0x13'),JSON[_0x7da1('0x16')](_0x410d8e));if(_0x410d8e[_0x7da1('0x17')]){if(_0x410d8e['error']['code']===0x1f4){logger[_0x7da1('0x17')](_0x7da1('0x12'),_0x54554e,_0x410d8e[_0x7da1('0x17')][_0x7da1('0x18')]);return _0x331707(_0x410d8e[_0x7da1('0x17')][_0x7da1('0x18')]);}logger['error'](_0x7da1('0x12'),_0x54554e,_0x410d8e[_0x7da1('0x17')][_0x7da1('0x18')]);return _0x27435e(_0x410d8e['error'][_0x7da1('0x18')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x54554e,_0x7da1('0x13'));_0x27435e(_0x410d8e[_0x7da1('0x19')][_0x7da1('0x18')]);}})[_0x7da1('0x1a')](function(_0x40eb70){logger[_0x7da1('0x17')](_0x7da1('0x12'),_0x54554e,_0x40eb70);_0x331707(_0x40eb70);});});}exports[_0x7da1('0x1b')]=function(_0x183bc9){var _0x14cba7=this;return new Promise(function(_0x1a72cd,_0x50c553){return db[_0x7da1('0x1c')][_0x7da1('0x1d')]({'raw':_0x183bc9[_0x7da1('0x1e')]?_0x183bc9[_0x7da1('0x1e')][_0x7da1('0x1f')]===undefined?!![]:![]:!![],'where':_0x183bc9['options']?_0x183bc9[_0x7da1('0x1e')][_0x7da1('0x20')]||null:null,'attributes':_0x183bc9[_0x7da1('0x1e')]?_0x183bc9['options'][_0x7da1('0x21')]||null:null,'limit':_0x183bc9[_0x7da1('0x1e')]?_0x183bc9[_0x7da1('0x1e')]['limit']||null:null,'include':_0x183bc9[_0x7da1('0x1e')]?_0x183bc9[_0x7da1('0x1e')][_0x7da1('0x22')]?_[_0x7da1('0x23')](_0x183bc9['options'][_0x7da1('0x22')],function(_0x322ddf){return{'model':db[_0x322ddf[_0x7da1('0x24')]],'as':_0x322ddf['as'],'attributes':_0x322ddf[_0x7da1('0x21')],'include':_0x322ddf[_0x7da1('0x22')]?_[_0x7da1('0x23')](_0x322ddf['include'],function(_0x3bdfb3){return{'model':db[_0x3bdfb3['model']],'as':_0x3bdfb3['as'],'attributes':_0x3bdfb3[_0x7da1('0x21')],'include':_0x3bdfb3[_0x7da1('0x22')]?_[_0x7da1('0x23')](_0x3bdfb3[_0x7da1('0x22')],function(_0x6476b9){return{'model':db[_0x6476b9['model']],'as':_0x6476b9['as'],'attributes':_0x6476b9[_0x7da1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7da1('0x10')](function(_0x1b359f){logger[_0x7da1('0x11')](_0x7da1('0x1b'),_0x183bc9);logger[_0x7da1('0x14')]('GetFaxAccount',_0x183bc9,JSON[_0x7da1('0x16')](_0x1b359f));_0x1a72cd(_0x1b359f);})[_0x7da1('0x1a')](function(_0x8c7596){logger['error'](_0x7da1('0x1b'),_0x8c7596[_0x7da1('0x18')],_0x183bc9);_0x50c553(_0x14cba7[_0x7da1('0x17')](0x1f4,_0x8c7596[_0x7da1('0x18')]));});});};exports[_0x7da1('0x25')]=function(_0x6205fa,_0x34e588,_0x344549){var _0xacf7fe=this;return new Promise(function(_0x4c108d,_0x4f42eb){var _0x40475b={'body':_0x6205fa[_0x7da1('0x26')],'channel':_0x7da1('0x27')};var _0x4190e9=[];var _0x4ccfd2=[];var _0x40b8da={};return db['CmContact']['describe']()['then'](function(_0x4249c3){if(!_0x4249c3){throw new db[(_0x7da1('0x28'))][(_0x7da1('0x29'))]('no\x20available\x20attributes');}_0x4190e9=_[_0x7da1('0x2a')](_[_0x7da1('0x2b')](_0x4249c3),[_0x7da1('0x2c'),'updatedAt']);_0x4ccfd2=_[_0x7da1('0x2a')](_[_0x7da1('0x2b')](_0x4249c3),[_0x7da1('0x2c'),_0x7da1('0x2d'),_0x7da1('0x2e'),'ListId']);if(_0x6205fa[_0x7da1('0x26')]['id']){delete _0x6205fa['body']['id'];}if(_[_0x7da1('0x2f')](_0x6205fa[_0x7da1('0x26')][_0x7da1('0x30')])){throw new db['Sequelize'][(_0x7da1('0x29'))](_0x7da1('0x31'));}if(_['isNil'](_0x6205fa[_0x7da1('0x26')]['body'])||_0x6205fa[_0x7da1('0x26')][_0x7da1('0x26')]===''){throw new db[(_0x7da1('0x28'))]['ValidationError'](_0x7da1('0x32'));}if(_['isNil'](_0x6205fa['body'][_0x7da1('0x33')])){throw new db[(_0x7da1('0x28'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ccfd2);}if(!_[_0x7da1('0x34')](_0x4ccfd2,_0x6205fa['body'][_0x7da1('0x33')])){throw new db[(_0x7da1('0x28'))][(_0x7da1('0x29'))](_0x7da1('0x35')+_0x4ccfd2);}_0x40b8da[_0x6205fa['body'][_0x7da1('0x33')]]=_0x6205fa[_0x7da1('0x26')][_0x7da1('0x30')];})[_0x7da1('0x10')](function(){return db[_0x7da1('0x1c')][_0x7da1('0x36')]({'where':{'id':_0x6205fa[_0x7da1('0x37')]['id']},'include':[{'model':db[_0x7da1('0x38')],'as':'List','include':[{'model':db[_0x7da1('0x39')],'as':_0x7da1('0x3a'),'where':_0x40b8da,'limit':0x1,'order':[['updatedAt',_0x7da1('0x3b')]]}]},{'model':db[_0x7da1('0x3c')],'as':_0x7da1('0x3d')}]});})[_0x7da1('0x10')](function(_0x483b48){if(_0x483b48&&_0x483b48[_0x7da1('0x3e')]){var _0x11f401=_0x483b48[_0x7da1('0x3f')]({'plain':!![]});_0x40475b[_0x7da1('0x37')]=_0x11f401;_0x40475b[_0x7da1('0x40')]=_0x11f401[_0x7da1('0x3d')];_0x40475b[_0x7da1('0x41')]=_0x11f401[_0x7da1('0x3e')];_0x40475b[_0x7da1('0x40')]=_['orderBy'](_0x40475b[_0x7da1('0x40')],['priority'],[_0x7da1('0x42')]);if(_0x40475b[_0x7da1('0x37')][_0x7da1('0x3d')]){delete _0x40475b[_0x7da1('0x37')][_0x7da1('0x3d')];}if(_0x40475b[_0x7da1('0x37')][_0x7da1('0x3e')]&&_0x40475b['account'][_0x7da1('0x3e')][_0x7da1('0x3a')][_0x7da1('0x43')]){return _0x40475b[_0x7da1('0x37')][_0x7da1('0x3e')][_0x7da1('0x3a')][0x0];}var _0x5cf397=_[_0x7da1('0xb')](_0x6205fa[_0x7da1('0x26')],{'firstName':_0x6205fa[_0x7da1('0x26')][_0x7da1('0x30')],'ListId':_0x11f401[_0x7da1('0x44')]});_0x5cf397[_0x6205fa[_0x7da1('0x26')]['mapKey']]=_0x6205fa['body'][_0x7da1('0x30')];return db['CmContact'][_0x7da1('0x45')](_0x5cf397,{'fields':_0x4190e9,'raw':!![]});}})['then'](function(_0xb01e2){_0x40475b['contact']=_0xb01e2;if(_0xb01e2){var _0x2d1b4f={'ContactId':_0xb01e2['id'],'FaxAccountId':_0x6205fa['account']['id'],'fax':_0xb01e2[_0x7da1('0x27')]};return db[_0x7da1('0x46')][_0x7da1('0x36')]({'where':{'ContactId':_0xb01e2['id'],'closed':![],'FaxAccountId':_0x6205fa['account']['id']}})['then'](function(_0x40577d){if(_0x40577d){return[_0x40577d,![]];}return db['FaxInteraction'][_0x7da1('0x45')](_0x2d1b4f)['then'](function(_0x4ed4e8){return[_0x4ed4e8,!![]];});});}else{throw new Error(_0x7da1('0x47'));}})['spread'](function(_0x1e06fe,_0x333cca){var _0x264720=_0x1e06fe[_0x7da1('0x3f')]({'plain':!![]});if(_0x333cca){if(_0x40475b[_0x7da1('0x37')]['autoclose']){_0x40475b[_0x7da1('0x40')][_0x7da1('0x48')]({'id':0x0,'priority':_0x40475b['applications']['length']+0x1,'app':_0x7da1('0x49'),'appdata':_0x7da1('0x4a'),'interval':_0x7da1('0x4b')});}_0x264720[_0x7da1('0x4c')]=!![];}else{_0x264720['created']=![];}_0x40475b['interaction']=_0x264720;return db[_0x7da1('0x4d')][_0x7da1('0x45')]({'body':_0x6205fa['body'][_0x7da1('0x26')],'FaxAccountId':_0x6205fa[_0x7da1('0x37')]['id'],'FaxInteractionId':_0x1e06fe['id'],'direction':'in','ContactId':_0x1e06fe['ContactId'],'AttachmentId':_0x6205fa['body'][_0x7da1('0x4e')]});})['then'](function(_0x23480c){_0x40475b[_0x7da1('0x18')]=_0x23480c;if(_0x40475b[_0x7da1('0x4f')][_0x7da1('0x50')]){return db[_0x7da1('0x51')]['find']({'attributes':['id',_0x7da1('0x52')],'where':{'id':_0x40475b[_0x7da1('0x4f')][_0x7da1('0x50')]}})[_0x7da1('0x10')](function(_0x34ba1c){if(_0x34ba1c){_0x40475b[_0x7da1('0x40')][_0x7da1('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x34ba1c['name']+','+(_0x40475b[_0x7da1('0x37')][_0x7da1('0x54')]||0xa),'interval':_0x7da1('0x4b')});}return respondWithRpcPromise(_0x7da1('0x55'),_0x7da1('0x56'),_0x40475b);});}return respondWithRpcPromise(_0x7da1('0x55'),_0x7da1('0x56'),_0x40475b);})[_0x7da1('0x10')](function(_0x7a155c){_0x4c108d(_0x7a155c);})['catch'](function(_0x29afa2){_0x4f42eb(_0xacf7fe['error'](0x1f4,_0x29afa2[_0x7da1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index c269e23..21cea61 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 _0xe7fd=['./faxAccount.events','save','remove','emit','removeListener','length','faxAccount:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe7fd,0x8c));var _0xde7f=function(_0x41b7c4,_0x177675){_0x41b7c4=_0x41b7c4-0x0;var _0x138973=_0xe7fd[_0x41b7c4];return _0x138973;};'use strict';var FaxAccountEvents=require(_0xde7f('0x0'));var events=[_0xde7f('0x1'),_0xde7f('0x2'),'update'];function createListener(_0x57b50b,_0x4897e4){return function(_0x4f2eaa){_0x4897e4[_0xde7f('0x3')](_0x57b50b,_0x4f2eaa);};}function removeListener(_0x56c9aa,_0x1e2afb){return function(){FaxAccountEvents[_0xde7f('0x4')](_0x56c9aa,_0x1e2afb);};}exports['register']=function(_0x3b6ae8){for(var _0x577fe3=0x0,_0x7119a0=events[_0xde7f('0x5')];_0x577fe3<_0x7119a0;_0x577fe3++){var _0x5d5075=events[_0x577fe3];var _0x1b613d=createListener(_0xde7f('0x6')+_0x5d5075,_0x3b6ae8);FaxAccountEvents['on'](_0x5d5075,_0x1b613d);}}; \ No newline at end of file +var _0xa717=['emit','length','save'];(function(_0x1dcf93,_0x5f0866){var _0x3a3f9a=function(_0x26918b){while(--_0x26918b){_0x1dcf93['push'](_0x1dcf93['shift']());}};_0x3a3f9a(++_0x5f0866);}(_0xa717,0x1a0));var _0x7a71=function(_0x1d3544,_0x1ac9bf){_0x1d3544=_0x1d3544-0x0;var _0x12c7fc=_0xa717[_0x1d3544];return _0x12c7fc;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x7a71('0x0'),'remove','update'];function createListener(_0x309610,_0x56c6a8){return function(_0x597267){_0x56c6a8[_0x7a71('0x1')](_0x309610,_0x597267);};}function removeListener(_0x418971,_0x2e7383){return function(){FaxAccountEvents['removeListener'](_0x418971,_0x2e7383);};}exports['register']=function(_0x26660e){for(var _0x1cef56=0x0,_0x5b0281=events[_0x7a71('0x2')];_0x1cef56<_0x5b0281;_0x1cef56++){var _0x126393=events[_0x1cef56];var _0x3644a4=createListener('faxAccount:'+_0x126393,_0x26660e);FaxAccountEvents['on'](_0x126393,_0x3644a4);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 6064dc1..061679c 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(_0x2a829f,_0x1b0c15){var _0x5737c3=function(_0x2376f9){while(--_0x2376f9){_0x2a829f['push'](_0x2a829f['shift']());}};_0x5737c3(++_0x1b0c15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x3287a6,_0x35e598){var _0x9c6449=function(_0x407e41){while(--_0x407e41){_0x3287a6['push'](_0x3287a6['shift']());}};_0x9c6449(++_0x35e598);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 af297a3..54c1ddb 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 _0x43b0=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x43b0,0x1bc));var _0x043b=function(_0x5f4b31,_0x4dc6bc){_0x5f4b31=_0x5f4b31-0x0;var _0x71f868=_0x43b0[_0x5f4b31];return _0x71f868;};'use strict';var Sequelize=require(_0x043b('0x0'));module[_0x043b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x043b('0x2')],'allowNull':![],'defaultValue':_0x043b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x043b('0x2')]},'interval':{'type':Sequelize[_0x043b('0x2')],'defaultValue':_0x043b('0x4')}}; \ No newline at end of file +var _0x1d99=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x490254,_0x6d7202){var _0x3e5790=function(_0x33c5f4){while(--_0x33c5f4){_0x490254['push'](_0x490254['shift']());}};_0x3e5790(++_0x6d7202);}(_0x1d99,0x1c3));var _0x91d9=function(_0x2d8bc8,_0x4e76c9){_0x2d8bc8=_0x2d8bc8-0x0;var _0x12b94a=_0x1d99[_0x2d8bc8];return _0x12b94a;};'use strict';var Sequelize=require(_0x91d9('0x0'));module[_0x91d9('0x1')]={'priority':{'type':Sequelize[_0x91d9('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x91d9('0x3')]()},'description':{'type':Sequelize[_0x91d9('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x91d9('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 120c60f..1f117ec 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 _0x29b1=['lodash','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','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxApplication','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x5aa089,_0x2d8caf){var _0xd86642=function(_0x14d084){while(--_0x14d084){_0x5aa089['push'](_0x5aa089['shift']());}};_0xd86642(++_0x2d8caf);}(_0x29b1,0x15d));var _0x129b=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x29b1[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x129b('0x0'));var rimraf=require(_0x129b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x129b('0x2'));var moment=require(_0x129b('0x3'));var BPromise=require(_0x129b('0x4'));var Mustache=require(_0x129b('0x5'));var util=require(_0x129b('0x6'));var path=require('path');var sox=require(_0x129b('0x7'));var csv=require(_0x129b('0x8'));var ejs=require(_0x129b('0x9'));var fs=require('fs');var fs_extra=require(_0x129b('0xa'));var _=require(_0x129b('0xb'));var squel=require('squel');var crypto=require(_0x129b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x129b('0xd'));var toCsv=require(_0x129b('0x8'));var querystring=require(_0x129b('0xe'));var Papa=require(_0x129b('0xf'));var Redis=require('ioredis');var authService=require(_0x129b('0x10'));var qs=require(_0x129b('0x11'));var as=require(_0x129b('0x12'));var hardwareService=require(_0x129b('0x13'));var logger=require(_0x129b('0x14'))(_0x129b('0x15'));var utils=require('../../config/utils');var config=require(_0x129b('0x16'));var licenseUtil=require(_0x129b('0x17'));var db=require(_0x129b('0x18'))['db'];function respondWithStatusCode(_0x16b948,_0x496da9){_0x496da9=_0x496da9||0xcc;return function(_0x3b9b63){if(_0x3b9b63){return _0x16b948[_0x129b('0x19')](_0x496da9);}return _0x16b948[_0x129b('0x1a')](_0x496da9)[_0x129b('0x1b')]();};}function respondWithResult(_0x44c759,_0x4da6b0){_0x4da6b0=_0x4da6b0||0xc8;return function(_0x2ba5c6){if(_0x2ba5c6){return _0x44c759[_0x129b('0x1a')](_0x4da6b0)['json'](_0x2ba5c6);}};}function respondWithFilteredResult(_0x409e34,_0xfe5c6e){return function(_0x258b14){if(_0x258b14){var _0x384740=typeof _0xfe5c6e['offset']===_0x129b('0x1c')&&typeof _0xfe5c6e[_0x129b('0x1d')]===_0x129b('0x1c');var _0x4c601b=_0x258b14['count'];var _0x43631d=_0x384740?0x0:_0xfe5c6e['offset'];var _0x1e8a32=_0x384740?_0x258b14['count']:_0xfe5c6e[_0x129b('0x1e')]+_0xfe5c6e[_0x129b('0x1d')];var _0x5ac554;if(_0x1e8a32>=_0x4c601b){_0x1e8a32=_0x4c601b;_0x5ac554=0xc8;}else{_0x5ac554=0xce;}_0x409e34[_0x129b('0x1a')](_0x5ac554);return _0x409e34[_0x129b('0x1f')](_0x129b('0x20'),_0x43631d+'-'+_0x1e8a32+'/'+_0x4c601b)['json'](_0x258b14);}return null;};}function patchUpdates(_0x4abc20){return function(_0x126d58){try{jsonpatch[_0x129b('0x21')](_0x126d58,_0x4abc20,!![]);}catch(_0x2c9253){return BPromise[_0x129b('0x22')](_0x2c9253);}return _0x126d58[_0x129b('0x23')]();};}function saveUpdates(_0x919525,_0x21d15b){return function(_0xe0187d){if(_0xe0187d){return _0xe0187d[_0x129b('0x24')](_0x919525)[_0x129b('0x25')](function(_0x6a9a99){return _0x6a9a99;});}return null;};}function removeEntity(_0x17fd11,_0xe772c6){return function(_0x107c2c){if(_0x107c2c){return _0x107c2c[_0x129b('0x26')]()[_0x129b('0x25')](function(){_0x17fd11[_0x129b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7d6b,_0xf64554){return function(_0x303ab7){if(!_0x303ab7){_0x2a7d6b[_0x129b('0x19')](0x194);}return _0x303ab7;};}function handleError(_0x13623d,_0x3a20fb){_0x3a20fb=_0x3a20fb||0x1f4;return function(_0x430852){logger[_0x129b('0x27')](_0x430852[_0x129b('0x28')]);if(_0x430852[_0x129b('0x29')]){delete _0x430852[_0x129b('0x29')];}_0x13623d[_0x129b('0x1a')](_0x3a20fb)['send'](_0x430852);};}exports[_0x129b('0x2a')]=function(_0x4d23ee,_0x2a847d){var _0x184da5={},_0x251dc9={},_0x22847e={'count':0x0,'rows':[]};var _0x37d472=_[_0x129b('0x2b')](db[_0x129b('0x2c')][_0x129b('0x2d')],function(_0x3058e9){return{'name':_0x3058e9['fieldName'],'type':_0x3058e9[_0x129b('0x2e')][_0x129b('0x2f')]};});_0x251dc9[_0x129b('0x30')]=_[_0x129b('0x2b')](_0x37d472,_0x129b('0x29'));_0x251dc9[_0x129b('0x31')]=_['keys'](_0x4d23ee[_0x129b('0x31')]);_0x251dc9[_0x129b('0x32')]=_['intersection'](_0x251dc9[_0x129b('0x30')],_0x251dc9[_0x129b('0x31')]);_0x184da5['attributes']=_[_0x129b('0x33')](_0x251dc9[_0x129b('0x30')],qs[_0x129b('0x34')](_0x4d23ee[_0x129b('0x31')][_0x129b('0x34')]));_0x184da5['attributes']=_0x184da5[_0x129b('0x35')][_0x129b('0x36')]?_0x184da5[_0x129b('0x35')]:_0x251dc9['model'];if(!_0x4d23ee[_0x129b('0x31')][_0x129b('0x37')]('nolimit')){_0x184da5[_0x129b('0x1d')]=qs[_0x129b('0x1d')](_0x4d23ee[_0x129b('0x31')][_0x129b('0x1d')]);_0x184da5['offset']=qs[_0x129b('0x1e')](_0x4d23ee['query'][_0x129b('0x1e')]);}_0x184da5[_0x129b('0x38')]=qs[_0x129b('0x39')](_0x4d23ee[_0x129b('0x31')][_0x129b('0x39')]);_0x184da5[_0x129b('0x3a')]=qs['filters'](_[_0x129b('0x3b')](_0x4d23ee['query'],_0x251dc9[_0x129b('0x32')]),_0x37d472);if(_0x4d23ee[_0x129b('0x31')][_0x129b('0x3c')]){_0x184da5['where']=_[_0x129b('0x3d')](_0x184da5[_0x129b('0x3a')],{'$or':_['map'](_0x37d472,function(_0x321e28){if(_0x321e28[_0x129b('0x2e')]!=='VIRTUAL'){var _0x2f6b49={};_0x2f6b49[_0x321e28[_0x129b('0x29')]]={'$like':'%'+_0x4d23ee[_0x129b('0x31')][_0x129b('0x3c')]+'%'};return _0x2f6b49;}})});}_0x184da5=_[_0x129b('0x3d')]({},_0x184da5,_0x4d23ee['options']);var _0x386267={'where':_0x184da5[_0x129b('0x3a')]};return db['FaxApplication'][_0x129b('0x3e')](_0x386267)[_0x129b('0x25')](function(_0xd93ca4){_0x22847e['count']=_0xd93ca4;if(_0x4d23ee['query'][_0x129b('0x3f')]){_0x184da5[_0x129b('0x40')]=[{'all':!![]}];}return db[_0x129b('0x2c')][_0x129b('0x41')](_0x184da5);})[_0x129b('0x25')](function(_0x46fe3c){_0x22847e[_0x129b('0x42')]=_0x46fe3c;return _0x22847e;})[_0x129b('0x25')](respondWithFilteredResult(_0x2a847d,_0x184da5))[_0x129b('0x43')](handleError(_0x2a847d,null));};exports[_0x129b('0x44')]=function(_0x58be86,_0x429038){var _0x3c530={'raw':!![],'where':{'id':_0x58be86[_0x129b('0x45')]['id']}},_0x219b78={};_0x219b78[_0x129b('0x30')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x219b78['query']=_['keys'](_0x58be86[_0x129b('0x31')]);_0x219b78[_0x129b('0x32')]=_[_0x129b('0x33')](_0x219b78['model'],_0x219b78[_0x129b('0x31')]);_0x3c530[_0x129b('0x35')]=_[_0x129b('0x33')](_0x219b78[_0x129b('0x30')],qs[_0x129b('0x34')](_0x58be86['query'][_0x129b('0x34')]));_0x3c530['attributes']=_0x3c530[_0x129b('0x35')][_0x129b('0x36')]?_0x3c530[_0x129b('0x35')]:_0x219b78['model'];if(_0x58be86[_0x129b('0x31')][_0x129b('0x3f')]){_0x3c530[_0x129b('0x40')]=[{'all':!![]}];}_0x3c530=_[_0x129b('0x3d')]({},_0x3c530,_0x58be86['options']);return db[_0x129b('0x2c')][_0x129b('0x46')](_0x3c530)[_0x129b('0x25')](handleEntityNotFound(_0x429038,null))[_0x129b('0x25')](respondWithResult(_0x429038,null))[_0x129b('0x43')](handleError(_0x429038,null));};exports['create']=function(_0x57853d,_0x2cc231){return db[_0x129b('0x2c')]['create'](_0x57853d[_0x129b('0x47')],{})[_0x129b('0x25')](respondWithResult(_0x2cc231,0xc9))[_0x129b('0x43')](handleError(_0x2cc231,null));};exports['update']=function(_0x5d0189,_0x624d73){if(_0x5d0189[_0x129b('0x47')]['id']){delete _0x5d0189[_0x129b('0x47')]['id'];}return db[_0x129b('0x2c')][_0x129b('0x46')]({'where':{'id':_0x5d0189[_0x129b('0x45')]['id']}})[_0x129b('0x25')](handleEntityNotFound(_0x624d73,null))[_0x129b('0x25')](saveUpdates(_0x5d0189[_0x129b('0x47')],null))[_0x129b('0x25')](respondWithResult(_0x624d73,null))['catch'](handleError(_0x624d73,null));};exports['destroy']=function(_0x2e4a23,_0xfce5e3){return db[_0x129b('0x2c')][_0x129b('0x46')]({'where':{'id':_0x2e4a23[_0x129b('0x45')]['id']}})[_0x129b('0x25')](handleEntityNotFound(_0xfce5e3,null))[_0x129b('0x25')](removeEntity(_0xfce5e3,null))[_0x129b('0x43')](handleError(_0xfce5e3,null));}; \ No newline at end of file +var _0x919d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x919d,0x183));var _0xd919=function(_0x2d6aed,_0x232776){_0x2d6aed=_0x2d6aed-0x0;var _0x300ea7=_0x919d[_0x2d6aed];return _0x300ea7;};'use strict';var emlformat=require(_0xd919('0x0'));var rimraf=require(_0xd919('0x1'));var zipdir=require(_0xd919('0x2'));var jsonpatch=require(_0xd919('0x3'));var rp=require(_0xd919('0x4'));var moment=require(_0xd919('0x5'));var BPromise=require(_0xd919('0x6'));var Mustache=require(_0xd919('0x7'));var util=require(_0xd919('0x8'));var path=require(_0xd919('0x9'));var sox=require(_0xd919('0xa'));var csv=require(_0xd919('0xb'));var ejs=require(_0xd919('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd919('0xd'));var squel=require(_0xd919('0xe'));var crypto=require(_0xd919('0xf'));var jsforce=require(_0xd919('0x10'));var deskjs=require(_0xd919('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd919('0x12'));var Papa=require(_0xd919('0x13'));var Redis=require(_0xd919('0x14'));var authService=require(_0xd919('0x15'));var qs=require(_0xd919('0x16'));var as=require(_0xd919('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd919('0x18'))(_0xd919('0x19'));var utils=require('../../config/utils');var config=require(_0xd919('0x1a'));var licenseUtil=require(_0xd919('0x1b'));var db=require(_0xd919('0x1c'))['db'];function respondWithStatusCode(_0x51ae24,_0x2d5ad7){_0x2d5ad7=_0x2d5ad7||0xcc;return function(_0x4e1c6a){if(_0x4e1c6a){return _0x51ae24[_0xd919('0x1d')](_0x2d5ad7);}return _0x51ae24[_0xd919('0x1e')](_0x2d5ad7)[_0xd919('0x1f')]();};}function respondWithResult(_0x3d582b,_0x286335){_0x286335=_0x286335||0xc8;return function(_0x3d459e){if(_0x3d459e){return _0x3d582b[_0xd919('0x1e')](_0x286335)[_0xd919('0x20')](_0x3d459e);}};}function respondWithFilteredResult(_0x5f231b,_0x42326d){return function(_0x3f8bf4){if(_0x3f8bf4){var _0x281f66=typeof _0x42326d['offset']===_0xd919('0x21')&&typeof _0x42326d['limit']===_0xd919('0x21');var _0x2c75f6=_0x3f8bf4[_0xd919('0x22')];var _0x26339b=_0x281f66?0x0:_0x42326d[_0xd919('0x23')];var _0x593b5=_0x281f66?_0x3f8bf4[_0xd919('0x22')]:_0x42326d['offset']+_0x42326d[_0xd919('0x24')];var _0x4d281d;if(_0x593b5>=_0x2c75f6){_0x593b5=_0x2c75f6;_0x4d281d=0xc8;}else{_0x4d281d=0xce;}_0x5f231b[_0xd919('0x1e')](_0x4d281d);return _0x5f231b['set'](_0xd919('0x25'),_0x26339b+'-'+_0x593b5+'/'+_0x2c75f6)[_0xd919('0x20')](_0x3f8bf4);}return null;};}function patchUpdates(_0xe069b2){return function(_0x5ab2af){try{jsonpatch['apply'](_0x5ab2af,_0xe069b2,!![]);}catch(_0x2d7ece){return BPromise[_0xd919('0x26')](_0x2d7ece);}return _0x5ab2af[_0xd919('0x27')]();};}function saveUpdates(_0x2abbd7,_0x1e1c30){return function(_0x423b31){if(_0x423b31){return _0x423b31[_0xd919('0x28')](_0x2abbd7)[_0xd919('0x29')](function(_0x51a2ed){return _0x51a2ed;});}return null;};}function removeEntity(_0x59011f,_0x426802){return function(_0x501623){if(_0x501623){return _0x501623[_0xd919('0x2a')]()[_0xd919('0x29')](function(){_0x59011f[_0xd919('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564443,_0x111323){return function(_0x2f89ea){if(!_0x2f89ea){_0x564443['sendStatus'](0x194);}return _0x2f89ea;};}function handleError(_0x25f03c,_0x435dcd){_0x435dcd=_0x435dcd||0x1f4;return function(_0x1bf497){logger[_0xd919('0x2b')](_0x1bf497[_0xd919('0x2c')]);if(_0x1bf497[_0xd919('0x2d')]){delete _0x1bf497[_0xd919('0x2d')];}_0x25f03c[_0xd919('0x1e')](_0x435dcd)[_0xd919('0x2e')](_0x1bf497);};}exports[_0xd919('0x2f')]=function(_0x96a69e,_0x3124ec){var _0x5db673={},_0x49f14f={},_0x17e623={'count':0x0,'rows':[]};var _0x41551b=_[_0xd919('0x30')](db[_0xd919('0x31')][_0xd919('0x32')],function(_0x41962d){return{'name':_0x41962d[_0xd919('0x33')],'type':_0x41962d['type'][_0xd919('0x34')]};});_0x49f14f['model']=_[_0xd919('0x30')](_0x41551b,_0xd919('0x2d'));_0x49f14f[_0xd919('0x35')]=_[_0xd919('0x36')](_0x96a69e['query']);_0x49f14f[_0xd919('0x37')]=_[_0xd919('0x38')](_0x49f14f['model'],_0x49f14f[_0xd919('0x35')]);_0x5db673['attributes']=_['intersection'](_0x49f14f[_0xd919('0x39')],qs['fields'](_0x96a69e[_0xd919('0x35')][_0xd919('0x3a')]));_0x5db673[_0xd919('0x3b')]=_0x5db673[_0xd919('0x3b')]['length']?_0x5db673[_0xd919('0x3b')]:_0x49f14f[_0xd919('0x39')];if(!_0x96a69e['query'][_0xd919('0x3c')](_0xd919('0x3d'))){_0x5db673[_0xd919('0x24')]=qs[_0xd919('0x24')](_0x96a69e[_0xd919('0x35')]['limit']);_0x5db673['offset']=qs['offset'](_0x96a69e[_0xd919('0x35')]['offset']);}_0x5db673[_0xd919('0x3e')]=qs['sort'](_0x96a69e[_0xd919('0x35')]['sort']);_0x5db673[_0xd919('0x3f')]=qs['filters'](_[_0xd919('0x40')](_0x96a69e['query'],_0x49f14f[_0xd919('0x37')]),_0x41551b);if(_0x96a69e['query']['filter']){_0x5db673[_0xd919('0x3f')]=_[_0xd919('0x41')](_0x5db673['where'],{'$or':_['map'](_0x41551b,function(_0x503a90){if(_0x503a90[_0xd919('0x42')]!==_0xd919('0x43')){var _0x4acbc4={};_0x4acbc4[_0x503a90[_0xd919('0x2d')]]={'$like':'%'+_0x96a69e[_0xd919('0x35')][_0xd919('0x44')]+'%'};return _0x4acbc4;}})});}_0x5db673=_[_0xd919('0x41')]({},_0x5db673,_0x96a69e[_0xd919('0x45')]);var _0x57f583={'where':_0x5db673[_0xd919('0x3f')]};return db['FaxApplication'][_0xd919('0x22')](_0x57f583)[_0xd919('0x29')](function(_0xc9d15){_0x17e623[_0xd919('0x22')]=_0xc9d15;if(_0x96a69e[_0xd919('0x35')][_0xd919('0x46')]){_0x5db673[_0xd919('0x47')]=[{'all':!![]}];}return db[_0xd919('0x31')][_0xd919('0x48')](_0x5db673);})[_0xd919('0x29')](function(_0x253a3d){_0x17e623[_0xd919('0x49')]=_0x253a3d;return _0x17e623;})['then'](respondWithFilteredResult(_0x3124ec,_0x5db673))['catch'](handleError(_0x3124ec,null));};exports[_0xd919('0x4a')]=function(_0x420102,_0x30aee1){var _0x17bed3={'raw':!![],'where':{'id':_0x420102[_0xd919('0x4b')]['id']}},_0x4f4ae2={};_0x4f4ae2['model']=_[_0xd919('0x36')](db[_0xd919('0x31')][_0xd919('0x32')]);_0x4f4ae2[_0xd919('0x35')]=_[_0xd919('0x36')](_0x420102[_0xd919('0x35')]);_0x4f4ae2['filters']=_[_0xd919('0x38')](_0x4f4ae2['model'],_0x4f4ae2[_0xd919('0x35')]);_0x17bed3[_0xd919('0x3b')]=_['intersection'](_0x4f4ae2[_0xd919('0x39')],qs['fields'](_0x420102[_0xd919('0x35')][_0xd919('0x3a')]));_0x17bed3[_0xd919('0x3b')]=_0x17bed3['attributes'][_0xd919('0x4c')]?_0x17bed3[_0xd919('0x3b')]:_0x4f4ae2['model'];if(_0x420102[_0xd919('0x35')][_0xd919('0x46')]){_0x17bed3['include']=[{'all':!![]}];}_0x17bed3=_[_0xd919('0x41')]({},_0x17bed3,_0x420102['options']);return db[_0xd919('0x31')][_0xd919('0x4d')](_0x17bed3)[_0xd919('0x29')](handleEntityNotFound(_0x30aee1,null))[_0xd919('0x29')](respondWithResult(_0x30aee1,null))[_0xd919('0x4e')](handleError(_0x30aee1,null));};exports[_0xd919('0x4f')]=function(_0x3da684,_0x10badf){return db[_0xd919('0x31')]['create'](_0x3da684[_0xd919('0x50')],{})[_0xd919('0x29')](respondWithResult(_0x10badf,0xc9))[_0xd919('0x4e')](handleError(_0x10badf,null));};exports[_0xd919('0x28')]=function(_0xc443fc,_0x250059){if(_0xc443fc[_0xd919('0x50')]['id']){delete _0xc443fc[_0xd919('0x50')]['id'];}return db[_0xd919('0x31')][_0xd919('0x4d')]({'where':{'id':_0xc443fc['params']['id']}})[_0xd919('0x29')](handleEntityNotFound(_0x250059,null))['then'](saveUpdates(_0xc443fc['body'],null))[_0xd919('0x29')](respondWithResult(_0x250059,null))['catch'](handleError(_0x250059,null));};exports[_0xd919('0x2a')]=function(_0x56929d,_0x5f61eb){return db[_0xd919('0x31')][_0xd919('0x4d')]({'where':{'id':_0x56929d[_0xd919('0x4b')]['id']}})[_0xd919('0x29')](handleEntityNotFound(_0x5f61eb,null))[_0xd919('0x29')](removeEntity(_0x5f61eb,null))[_0xd919('0x4e')](handleError(_0x5f61eb,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 553d777..9e3bd04 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 _0x5dfc=['request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x5643f7,_0x2fded8){var _0x1af993=function(_0x118908){while(--_0x118908){_0x5643f7['push'](_0x5643f7['shift']());}};_0x1af993(++_0x2fded8);}(_0x5dfc,0x13d));var _0xc5df=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x5dfc[_0x65c903];return _0x23e1d7;};'use strict';var _=require(_0xc5df('0x0'));var util=require(_0xc5df('0x1'));var logger=require('../../config/logger')(_0xc5df('0x2'));var moment=require(_0xc5df('0x3'));var BPromise=require(_0xc5df('0x4'));var rp=require(_0xc5df('0x5'));var fs=require('fs');var path=require(_0xc5df('0x6'));var rimraf=require('rimraf');var config=require(_0xc5df('0x7'));var attributes=require(_0xc5df('0x8'));module['exports']=function(_0x10240d,_0x811b18){return _0x10240d[_0xc5df('0x9')](_0xc5df('0xa'),attributes,{'tableName':_0xc5df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5df('0xc'),'collate':_0xc5df('0xd')});}; \ No newline at end of file +var _0x46c0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x46c0,0x184));var _0x046c=function(_0x283c87,_0x545688){_0x283c87=_0x283c87-0x0;var _0xde4143=_0x46c0[_0x283c87];return _0xde4143;};'use strict';var _=require('lodash');var util=require(_0x046c('0x0'));var logger=require(_0x046c('0x1'))(_0x046c('0x2'));var moment=require(_0x046c('0x3'));var BPromise=require(_0x046c('0x4'));var rp=require(_0x046c('0x5'));var fs=require('fs');var path=require(_0x046c('0x6'));var rimraf=require(_0x046c('0x7'));var config=require(_0x046c('0x8'));var attributes=require(_0x046c('0x9'));module[_0x046c('0xa')]=function(_0x6bbd7f,_0x1b2bba){return _0x6bbd7f['define'](_0x046c('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x046c('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2253653..6adf392 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 _0x6170=['FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug'];(function(_0xc94c2b,_0x1eb9c0){var _0x274cf0=function(_0x388dec){while(--_0x388dec){_0xc94c2b['push'](_0xc94c2b['shift']());}};_0x274cf0(++_0x1eb9c0);}(_0x6170,0x18f));var _0x0617=function(_0x4103c3,_0x47afa4){_0x4103c3=_0x4103c3-0x0;var _0x47a347=_0x6170[_0x4103c3];return _0x47a347;};'use strict';var _=require(_0x0617('0x0'));var util=require(_0x0617('0x1'));var moment=require(_0x0617('0x2'));var BPromise=require(_0x0617('0x3'));var rs=require(_0x0617('0x4'));var fs=require('fs');var Redis=require(_0x0617('0x5'));var db=require(_0x0617('0x6'))['db'];var utils=require(_0x0617('0x7'));var logger=require('../../config/logger')(_0x0617('0x8'));var config=require(_0x0617('0x9'));var jayson=require(_0x0617('0xa'));var client=jayson['client'][_0x0617('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d0e1d,_0x25f09e,_0x16241b){return new BPromise(function(_0x3dff44,_0xcd24b2){return client[_0x0617('0xc')](_0x1d0e1d,_0x16241b)[_0x0617('0xd')](function(_0x1bce38){logger[_0x0617('0xe')](_0x0617('0xf'),_0x25f09e,'request\x20sent');logger[_0x0617('0x10')](_0x0617('0x11'),_0x25f09e,_0x0617('0x12'),JSON['stringify'](_0x1bce38));if(_0x1bce38[_0x0617('0x13')]){if(_0x1bce38[_0x0617('0x13')][_0x0617('0x14')]===0x1f4){logger[_0x0617('0x13')](_0x0617('0xf'),_0x25f09e,_0x1bce38['error'][_0x0617('0x15')]);return _0xcd24b2(_0x1bce38[_0x0617('0x13')][_0x0617('0x15')]);}logger[_0x0617('0x13')](_0x0617('0xf'),_0x25f09e,_0x1bce38[_0x0617('0x13')]['message']);return _0x3dff44(_0x1bce38[_0x0617('0x13')][_0x0617('0x15')]);}else{logger[_0x0617('0xe')](_0x0617('0xf'),_0x25f09e,'request\x20sent');_0x3dff44(_0x1bce38[_0x0617('0x16')][_0x0617('0x15')]);}})[_0x0617('0x17')](function(_0x17354f){logger['error'](_0x0617('0xf'),_0x25f09e,_0x17354f);_0xcd24b2(_0x17354f);});});}exports[_0x0617('0x18')]=function(_0xdeee0){var _0x532bea=this;return new Promise(function(_0x31020a,_0x348058){return db[_0x0617('0x19')][_0x0617('0x1a')](_0xdeee0['body'],{'raw':_0xdeee0['options']?_0xdeee0[_0x0617('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdeee0[_0x0617('0x1b')]?_0xdeee0[_0x0617('0x1b')][_0x0617('0x1c')]||null:null,'attributes':_0xdeee0['options']?_0xdeee0['options'][_0x0617('0x1d')]||null:null,'limit':_0xdeee0[_0x0617('0x1b')]?_0xdeee0[_0x0617('0x1b')][_0x0617('0x1e')]||null:null})[_0x0617('0xd')](function(_0x2e5ce9){logger[_0x0617('0xe')](_0x0617('0x18'),_0xdeee0);logger[_0x0617('0x10')](_0x0617('0x18'),_0xdeee0,JSON[_0x0617('0x1f')](_0x2e5ce9));_0x31020a(_0x2e5ce9);})[_0x0617('0x17')](function(_0x1ca978){logger[_0x0617('0x13')](_0x0617('0x18'),_0x1ca978[_0x0617('0x15')],_0xdeee0);_0x348058(_0x532bea[_0x0617('0x13')](0x1f4,_0x1ca978[_0x0617('0x15')]));});});}; \ No newline at end of file +var _0xb35f=['../../config/environment','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','update','body','options','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x39e2d7,_0x1b15f6){var _0x413d0d=function(_0x3af71d){while(--_0x3af71d){_0x39e2d7['push'](_0x39e2d7['shift']());}};_0x413d0d(++_0x1b15f6);}(_0xb35f,0x1c8));var _0xfb35=function(_0xf050f8,_0x471965){_0xf050f8=_0xf050f8-0x0;var _0x5bb8cd=_0xb35f[_0xf050f8];return _0x5bb8cd;};'use strict';var _=require('lodash');var util=require(_0xfb35('0x0'));var moment=require(_0xfb35('0x1'));var BPromise=require(_0xfb35('0x2'));var rs=require(_0xfb35('0x3'));var fs=require('fs');var Redis=require(_0xfb35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb35('0x5'));var logger=require(_0xfb35('0x6'))(_0xfb35('0x7'));var config=require(_0xfb35('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfb35('0x9')][_0xfb35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f7e7,_0x100855,_0x526095){return new BPromise(function(_0x4208b0,_0x5497ad){return client['request'](_0x51f7e7,_0x526095)[_0xfb35('0xb')](function(_0x12cd54){logger[_0xfb35('0xc')](_0xfb35('0xd'),_0x100855,_0xfb35('0xe'));logger[_0xfb35('0xf')](_0xfb35('0x10'),_0x100855,_0xfb35('0xe'),JSON[_0xfb35('0x11')](_0x12cd54));if(_0x12cd54[_0xfb35('0x12')]){if(_0x12cd54[_0xfb35('0x12')]['code']===0x1f4){logger[_0xfb35('0x12')](_0xfb35('0xd'),_0x100855,_0x12cd54[_0xfb35('0x12')][_0xfb35('0x13')]);return _0x5497ad(_0x12cd54[_0xfb35('0x12')][_0xfb35('0x13')]);}logger['error'](_0xfb35('0xd'),_0x100855,_0x12cd54[_0xfb35('0x12')][_0xfb35('0x13')]);return _0x4208b0(_0x12cd54['error'][_0xfb35('0x13')]);}else{logger[_0xfb35('0xc')](_0xfb35('0xd'),_0x100855,_0xfb35('0xe'));_0x4208b0(_0x12cd54[_0xfb35('0x14')][_0xfb35('0x13')]);}})[_0xfb35('0x15')](function(_0x29ce07){logger[_0xfb35('0x12')](_0xfb35('0xd'),_0x100855,_0x29ce07);_0x5497ad(_0x29ce07);});});}exports[_0xfb35('0x16')]=function(_0x48b12b){var _0x55dab2=this;return new Promise(function(_0x23ec62,_0x93da3){return db['FaxApplication'][_0xfb35('0x17')](_0x48b12b[_0xfb35('0x18')],{'raw':_0x48b12b['options']?_0x48b12b[_0xfb35('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48b12b[_0xfb35('0x19')]?_0x48b12b[_0xfb35('0x19')][_0xfb35('0x1a')]||null:null,'attributes':_0x48b12b['options']?_0x48b12b[_0xfb35('0x19')][_0xfb35('0x1b')]||null:null,'limit':_0x48b12b[_0xfb35('0x19')]?_0x48b12b[_0xfb35('0x19')][_0xfb35('0x1c')]||null:null})['then'](function(_0x1285c0){logger[_0xfb35('0xc')](_0xfb35('0x16'),_0x48b12b);logger[_0xfb35('0xf')](_0xfb35('0x16'),_0x48b12b,JSON[_0xfb35('0x11')](_0x1285c0));_0x23ec62(_0x1285c0);})[_0xfb35('0x15')](function(_0x8454ff){logger['error']('UpdateFaxApplication',_0x8454ff[_0xfb35('0x13')],_0x48b12b);_0x93da3(_0x55dab2['error'](0x1f4,_0x8454ff[_0xfb35('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 609679d..d0a2b84 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 _0x4024=['express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','update','destroy','exports','multer','util','connect-timeout'];(function(_0x25a9b8,_0x21be82){var _0x5a6df4=function(_0x497e31){while(--_0x497e31){_0x25a9b8['push'](_0x25a9b8['shift']());}};_0x5a6df4(++_0x21be82);}(_0x4024,0x89));var _0x4402=function(_0x3f975c,_0x545c92){_0x3f975c=_0x3f975c-0x0;var _0x1e9a3f=_0x4024[_0x3f975c];return _0x1e9a3f;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['post']('/',auth[_0x4402('0x7')](),controller['create']);router['put'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xb')]);router['delete'](_0x4402('0xa'),auth['isAuthenticated'](),controller[_0x4402('0xc')]);module[_0x4402('0xd')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3d38cf,_0x35dff7){var _0x140350=function(_0x547bb7){while(--_0x547bb7){_0x3d38cf['push'](_0x3d38cf['shift']());}};_0x140350(++_0x35dff7);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xe5b5[_0x18d631];return _0x50d708;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0x10')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0x12')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x13')]);router['delete'](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x14')]);module[_0x5e5b('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index a6b5eca..749d330 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 _0x9d9c=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x1c6dcf,_0x2018b2){var _0x4990ae=function(_0x510c6e){while(--_0x510c6e){_0x1c6dcf['push'](_0x1c6dcf['shift']());}};_0x4990ae(++_0x2018b2);}(_0x9d9c,0x90));var _0xc9d9=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x9d9c[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0xc9d9('0x0'));module[_0xc9d9('0x1')]={'closed':{'type':Sequelize[_0xc9d9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc9d9('0x3')]},'note':{'type':Sequelize[_0xc9d9('0x3')]},'read1stAt':{'type':Sequelize[_0xc9d9('0x4')]},'fax':{'type':Sequelize[_0xc9d9('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc9d9('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc9d9('0x5')]('in',_0xc9d9('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6f2a=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x349541,_0x502ea7){var _0x497e7c=function(_0x4e3c92){while(--_0x4e3c92){_0x349541['push'](_0x349541['shift']());}};_0x497e7c(++_0x502ea7);}(_0x6f2a,0x189));var _0xa6f2=function(_0x4c6666,_0x26585e){_0x4c6666=_0x4c6666-0x0;var _0x1bd512=_0x6f2a[_0x4c6666];return _0x1bd512;};'use strict';var Sequelize=require(_0xa6f2('0x0'));module['exports']={'closed':{'type':Sequelize[_0xa6f2('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa6f2('0x2')]},'disposition':{'type':Sequelize[_0xa6f2('0x3')]},'secondDisposition':{'type':Sequelize[_0xa6f2('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa6f2('0x3')]},'note':{'type':Sequelize[_0xa6f2('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xa6f2('0x4')]('in',_0xa6f2('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa6f2('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa6f2('0x4')]('in',_0xa6f2('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 89befb1..efb23bd 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 _0x99d2=['files','tmp','join','attachments','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','Contact.mobile','Contact.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','rawAttributes','include','merge','create','body','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','pick','format','options','includeAll','findAll','rows','setTags','omit','color','emit','faxInteractionTags:save','removeTags','download','unix','root','server'];(function(_0x2862b1,_0x51a367){var _0x817ee6=function(_0x59cc5b){while(--_0x59cc5b){_0x2862b1['push'](_0x2862b1['shift']());}};_0x817ee6(++_0x51a367);}(_0x99d2,0xe4));var _0x299d=function(_0x7e5dd7,_0x38a320){_0x7e5dd7=_0x7e5dd7-0x0;var _0x5499a7=_0x99d2[_0x7e5dd7];return _0x5499a7;};'use strict';var emlformat=require(_0x299d('0x0'));var rimraf=require(_0x299d('0x1'));var zipdir=require(_0x299d('0x2'));var jsonpatch=require(_0x299d('0x3'));var rp=require(_0x299d('0x4'));var moment=require(_0x299d('0x5'));var BPromise=require(_0x299d('0x6'));var Mustache=require(_0x299d('0x7'));var util=require('util');var path=require(_0x299d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x299d('0x9'));var fs=require('fs');var fs_extra=require(_0x299d('0xa'));var _=require(_0x299d('0xb'));var squel=require(_0x299d('0xc'));var crypto=require(_0x299d('0xd'));var jsforce=require(_0x299d('0xe'));var deskjs=require(_0x299d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x299d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x299d('0x11'));var hardwareService=require(_0x299d('0x12'));var logger=require(_0x299d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x299d('0x14'));var licenseUtil=require(_0x299d('0x15'));var db=require(_0x299d('0x16'))['db'];config['redis']=_['defaults'](config[_0x299d('0x17')],{'host':_0x299d('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x299d('0x17')]));require(_0x299d('0x19'))[_0x299d('0x1a')](socket);function respondWithStatusCode(_0x160a44,_0x12217a){_0x12217a=_0x12217a||0xcc;return function(_0x2ade4b){if(_0x2ade4b){return _0x160a44[_0x299d('0x1b')](_0x12217a);}return _0x160a44[_0x299d('0x1c')](_0x12217a)[_0x299d('0x1d')]();};}function respondWithResult(_0x283d73,_0x2fba2a){_0x2fba2a=_0x2fba2a||0xc8;return function(_0xe00605){if(_0xe00605){return _0x283d73[_0x299d('0x1c')](_0x2fba2a)[_0x299d('0x1e')](_0xe00605);}};}function respondWithFilteredResult(_0x546849,_0x336088){return function(_0x5840b3){if(_0x5840b3){var _0x3917be=typeof _0x336088[_0x299d('0x1f')]===_0x299d('0x20')&&typeof _0x336088[_0x299d('0x21')]==='undefined';var _0x3b0949=_0x5840b3[_0x299d('0x22')];var _0x7cb23a=_0x3917be?0x0:_0x336088[_0x299d('0x1f')];var _0x38db81=_0x3917be?_0x5840b3[_0x299d('0x22')]:_0x336088[_0x299d('0x1f')]+_0x336088['limit'];var _0xb56d91;if(_0x38db81>=_0x3b0949){_0x38db81=_0x3b0949;_0xb56d91=0xc8;}else{_0xb56d91=0xce;}_0x546849[_0x299d('0x1c')](_0xb56d91);return _0x546849['set'](_0x299d('0x23'),_0x7cb23a+'-'+_0x38db81+'/'+_0x3b0949)[_0x299d('0x1e')](_0x5840b3);}return null;};}function patchUpdates(_0x2ebdfa){return function(_0xa895f3){try{jsonpatch[_0x299d('0x24')](_0xa895f3,_0x2ebdfa,!![]);}catch(_0x54caf5){return BPromise[_0x299d('0x25')](_0x54caf5);}return _0xa895f3[_0x299d('0x26')]();};}function saveUpdates(_0x1a2420,_0xdba49b){return function(_0x15320c){if(_0x15320c){return _0x15320c[_0x299d('0x27')](_0x1a2420)[_0x299d('0x28')](function(_0x3bb589){return _0x3bb589;});}return null;};}function removeEntity(_0x1a91c1,_0x437f14){return function(_0x47a874){if(_0x47a874){return _0x47a874[_0x299d('0x29')]()[_0x299d('0x28')](function(){_0x1a91c1[_0x299d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c429f,_0x210fba){return function(_0x513c73){if(!_0x513c73){_0x1c429f[_0x299d('0x1b')](0x194);}return _0x513c73;};}function handleError(_0x1ccd69,_0x30bd94){_0x30bd94=_0x30bd94||0x1f4;return function(_0x1df42d){logger['error'](_0x1df42d['stack']);if(_0x1df42d[_0x299d('0x2a')]){delete _0x1df42d['name'];}_0x1ccd69[_0x299d('0x1c')](_0x30bd94)[_0x299d('0x2b')](_0x1df42d);};}function getInteractionUsers(_0x992d0f,_0x20d626){return new BPromise(function(_0x3b4082,_0x2b0663){try{if(_0x20d626[_0x992d0f['id']]){_0x992d0f[_0x299d('0x2c')]=_[_0x299d('0x2d')](_0x20d626[_0x992d0f['id']],function(_0x203084){return{'id':_0x203084['id'],'fullname':_0x203084[_0x299d('0x2e')]};});}}catch(_0x3dcb77){_0x2b0663(_0x3dcb77);}_0x3b4082(_0x992d0f);});}function getInteractionTags(_0x35472b,_0x299d86){return new BPromise(function(_0xb5935f,_0x4bc8a7){try{if(_0x35472b[_0x299d('0x2f')]){_0x35472b[_0x299d('0x30')]=[];_0x35472b[_0x299d('0x2f')][_0x299d('0x31')](',')[_0x299d('0x32')](function(_0x2ba1ff){_0x35472b['Tags'][_0x299d('0x33')](_0x299d86[_0x2ba1ff]);});}delete _0x35472b['TagIds'];}catch(_0x22d332){_0x4bc8a7(_0x22d332);}_0xb5935f(_0x35472b);});}function updateFaxInteraction(_0x5785ee,_0x23b3b0,_0x5895b4){return new BPromise(function(_0x33f760,_0x222707){return getInteractionUsers(_0x5785ee,_0x5895b4)['then'](function(_0x5557a8){return getInteractionTags(_0x5557a8,_0x23b3b0);})[_0x299d('0x28')](function(_0x57e912){_0x33f760(_0x57e912);})[_0x299d('0x34')](function(_0x492956){_0x222707(_0x492956);});});}exports[_0x299d('0x35')]=function(_0x1b6266,_0x4f8fb1){var _0x9683c={},_0x4d91ee={},_0x19f5da={'count':0x0,'rows':[]};var _0x45471b=_[_0x299d('0x2d')](db[_0x299d('0x36')]['rawAttributes'],function(_0x2947ed){return{'name':_0x2947ed[_0x299d('0x37')],'type':_0x2947ed[_0x299d('0x38')][_0x299d('0x39')]};});_0x4d91ee[_0x299d('0x3a')]=_[_0x299d('0x2d')](_0x45471b,_0x299d('0x2a'));_0x4d91ee[_0x299d('0x3b')]=_[_0x299d('0x3c')](_0x1b6266[_0x299d('0x3b')]);_0x4d91ee[_0x299d('0x3d')]=_['intersection'](_0x4d91ee[_0x299d('0x3a')],_0x4d91ee[_0x299d('0x3b')]);_0x9683c['attributes']=_[_0x299d('0x3e')](_0x4d91ee[_0x299d('0x3a')],qs[_0x299d('0x3f')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x3f')]));_0x9683c['attributes']=_0x9683c[_0x299d('0x40')][_0x299d('0x41')]?_0x9683c['attributes']:_0x4d91ee[_0x299d('0x3a')];if(!_0x1b6266[_0x299d('0x3b')][_0x299d('0x42')](_0x299d('0x43'))){_0x9683c[_0x299d('0x21')]=qs[_0x299d('0x21')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x21')]);_0x9683c[_0x299d('0x1f')]=qs['offset'](_0x1b6266[_0x299d('0x3b')][_0x299d('0x1f')]);}_0x9683c[_0x299d('0x44')]=qs[_0x299d('0x45')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x45')]);_0x9683c[_0x299d('0x46')]=qs[_0x299d('0x3d')](_['pick'](_0x1b6266[_0x299d('0x3b')],_0x4d91ee[_0x299d('0x3d')]),_0x45471b);var _0x59fc35=[];var _0x28e141=squel['select']()['field']('id')[_0x299d('0x47')](_0x299d('0x2a'))[_0x299d('0x47')]('color')[_0x299d('0x48')](_0x299d('0x49'));var _0x5bf8ac=squel['select']()[_0x299d('0x47')]('u.id')[_0x299d('0x47')](_0x299d('0x4a'))['field'](_0x299d('0x4b'))[_0x299d('0x48')](_0x299d('0x4c'),'ui')['left_join'](_0x299d('0x4d'),'u',_0x299d('0x4e'));var _0x58595a=squel['select']()[_0x299d('0x48')]('fax_interactions','i')[_0x299d('0x4f')](_0x299d('0x50'),'c',_0x299d('0x51'))[_0x299d('0x4f')](_0x299d('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x299d('0x4f')](_0x299d('0x52'),'a','a.id\x20=\x20i.FaxAccountId')['left_join']('fax_messages','me',_0x299d('0x53'))[_0x299d('0x4f')]('fax_interaction_has_tags','it',_0x299d('0x54'))[_0x299d('0x4f')](_0x299d('0x49'),'t',_0x299d('0x55'));var _0x39be8e=squel['expr']();var _0x1257cb=[];var _0x4135e0=squel[_0x299d('0x56')]();var _0x4379f9;if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x57')]){_0x4379f9=as[_0x299d('0x58')](_0x1b6266[_0x299d('0x3b')][_0x299d('0x57')]);var _0x23ba7c=_0x4379f9[_0x299d('0x59')];for(var _0x37c615=0x0;_0x37c615<_0x4379f9[_0x299d('0x5a')]['length'];_0x37c615++){var _0x5457cb=_0x4379f9[_0x299d('0x5a')][_0x37c615];var _0x3cc96c='i';var _0x1116c9=_[_0x299d('0x5b')](_0x45471b,[_0x299d('0x2a'),_0x5457cb['field']]);if(!_0x1116c9){switch(_0x5457cb[_0x299d('0x47')]){case _0x299d('0x5c'):if(_0x5457cb[_0x299d('0x5d')]==0x1){_0x58595a[_0x299d('0x5e')]('`'+_0x5457cb['field']+_0x299d('0x5f'));}else{_0x58595a[_0x299d('0x5e')]('`'+_0x5457cb['field']+_0x299d('0x60'));}break;case _0x299d('0x61'):if(_0x5457cb[_0x299d('0x62')]==='$substring'){if(_0x5457cb[_0x299d('0x5d')][_0x299d('0x31')]('\x20')[_0x299d('0x41')]>0x1){_0x39be8e[_0x23ba7c](_0x299d('0x63'),qs[_0x299d('0x64')](_0x5457cb[_0x299d('0x5d')]),null);}else{var _0x4b3bb8='%'+_0x5457cb[_0x299d('0x5d')]+'%';_0x39be8e[_0x23ba7c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4b3bb8,_0x4b3bb8,_0x4b3bb8);}}else{_0x1116c9=_[_0x299d('0x5b')](_0x45471b,[_0x299d('0x2a'),_0x299d('0x65')]);_0x5457cb[_0x299d('0x47')]=_0x299d('0x65');_0x32c67b=as[_0x299d('0x66')](_0x3cc96c,_0x1116c9[_0x299d('0x38')],_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b['text'],_0x32c67b['value'][_0x299d('0x67')],_0x32c67b[_0x299d('0x5d')][_0x299d('0x1d')]);}break;case _0x299d('0x68'):var _0x57b89e=_0x5457cb['value'][_0x299d('0x31')](',')[_0x299d('0x2d')](function(_0x5a1c8b){return Number(_0x5a1c8b);});_0x57b89e[_0x299d('0x32')](function(_0xa7f42a){_0x4135e0['or'](_0x299d('0x69'),'%,'+_0xa7f42a+',%');});_0x1257cb=_[_0x299d('0x6a')](_0x1257cb,_0x57b89e);break;case _0x299d('0x6b'):if(_0x5457cb[_0x299d('0x62')]===_0x299d('0x6c')){_0x39be8e[_0x23ba7c](_0x299d('0x6d'),'%'+_0x5457cb[_0x299d('0x5d')]+'%',null);}else{_0x1116c9=_['find'](_0x45471b,[_0x299d('0x2a'),_0x299d('0x6e')]);_0x5457cb[_0x299d('0x47')]=_0x299d('0x6e');_0x32c67b=as['buildExpression'](_0x3cc96c,_0x1116c9[_0x299d('0x38')],_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b[_0x299d('0x6f')],_0x32c67b[_0x299d('0x5d')][_0x299d('0x67')],_0x32c67b[_0x299d('0x5d')][_0x299d('0x1d')]);}break;case'body':_0x32c67b=as['buildExpression']('me',null,_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b[_0x299d('0x6f')],_0x32c67b[_0x299d('0x5d')]['start'],_0x32c67b[_0x299d('0x5d')][_0x299d('0x1d')]);break;}}else{var _0x32c67b=as[_0x299d('0x66')](_0x3cc96c,_0x1116c9[_0x299d('0x38')],_0x5457cb);_0x39be8e[_0x23ba7c](_0x32c67b['text'],_0x32c67b[_0x299d('0x5d')][_0x299d('0x67')],_0x32c67b[_0x299d('0x5d')]['end']);}}}else{var _0x1364cc=_(_0x1b6266[_0x299d('0x3b')])[_0x299d('0x3c')]()[_0x299d('0x2d')](function(_0x3dfee0){return _['some'](_0x45471b,[_0x299d('0x2a'),_0x3dfee0])?_0x3dfee0:undefined;})[_0x299d('0x70')]()[_0x299d('0x5d')]();if(!_[_0x299d('0x71')](_0x1364cc)){_0x1364cc[_0x299d('0x32')](function(_0x1fe599){if(_0x1fe599===_0x299d('0x72')){_0x58595a[_0x299d('0x46')](_0x299d('0x73'),[][_0x299d('0x74')](_0x1b6266[_0x299d('0x3b')][_0x1fe599]));}else if(_0x1fe599===_0x299d('0x75')){var _0x25873e=JSON[_0x299d('0x76')](_0x1b6266[_0x299d('0x3b')][_0x1fe599])[_0x299d('0x77')];var _0x2916de=JSON[_0x299d('0x76')](_0x1b6266['query'][_0x1fe599])[_0x299d('0x78')];_0x58595a[_0x299d('0x46')](_0x299d('0x79'),_0x25873e,_0x2916de);}else{if(_0x1b6266['query'][_0x1fe599]===_0x299d('0x7a')){_0x58595a[_0x299d('0x46')]('i.'+_0x1fe599+_0x299d('0x7b'));}else{_0x58595a['where']('i.'+_0x1fe599+_0x299d('0x7c'),_0x1b6266[_0x299d('0x3b')][_0x1fe599]);}}});}if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7d')]){if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7d')]==0x1){_0x58595a[_0x299d('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x58595a[_0x299d('0x5e')](_0x299d('0x7e'));}}if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7f')]){_0x1257cb=_[_0x299d('0x80')](_0x1b6266[_0x299d('0x3b')]['tag'])?_0x1b6266[_0x299d('0x3b')][_0x299d('0x7f')]:new Array(_0x1b6266[_0x299d('0x3b')][_0x299d('0x7f')]);_0x1257cb[_0x299d('0x32')](function(_0x52d6cd){_0x4135e0['or'](_0x299d('0x69'),'%,'+_0x52d6cd+',%');});}if(_0x1b6266[_0x299d('0x3b')]['filter']){var _0x5e995e=_0x1b6266[_0x299d('0x3b')][_0x299d('0x81')]['replace']('\x5c','\x5c\x5c')[_0x299d('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5e995e)){_0x39be8e['or'](_0x299d('0x83'),_0x5e995e+'%')['or'](_0x299d('0x84'),_0x5e995e+'%');}_0x39be8e['or'](_0x299d('0x85'),_0x5e995e+'%');}}_0x58595a[_0x299d('0x46')](_0x39be8e);_0x58595a['group'](_0x299d('0x86'));var _0xa5e797={'type':db[_0x299d('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5cadd5=_0x58595a[_0x299d('0x88')]();_0x5cadd5[_0x299d('0x47')](_0x299d('0x86'));_0x5cadd5[_0x299d('0x47')](_0x299d('0x89'),_0x299d('0x5c'));if(_0x9683c['order']){_0x9683c[_0x299d('0x44')][_0x299d('0x32')](function(_0x1d102d){var _0x55c838=_0x1d102d[0x0]===_0x299d('0x8a')?_0x1d102d[0x0]:'i.'+_0x1d102d[0x0];_0x58595a[_0x299d('0x44')](_0x55c838,_0x1d102d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1257cb)){_0x58595a[_0x299d('0x5e')](_0x4135e0);_0x5cadd5[_0x299d('0x46')](_0x299d('0x8b'),_0x1257cb);}BPromise['resolve']()[_0x299d('0x28')](function(){if(!_0x4379f9){if(_0x1b6266[_0x299d('0x3b')][_0x299d('0x72')])return;_0x5cadd5[_0x299d('0x46')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x58595a[_0x299d('0x46')](_0x299d('0x8c'));return;}if(_0x1b6266[_0x299d('0x8d')]['role']!==_0x299d('0x8e'))return;return _0x1b6266[_0x299d('0x8d')][_0x299d('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47c033){if(_[_0x299d('0x71')](_0x47c033)){_0x5cadd5[_0x299d('0x46')](_0x299d('0x90'));_0x58595a['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x5cadd5[_0x299d('0x46')](_0x299d('0x73'),_[_0x299d('0x2d')](_0x47c033,'id'));_0x58595a[_0x299d('0x46')](_0x299d('0x73'),_[_0x299d('0x2d')](_0x47c033,'id'));}});})[_0x299d('0x28')](function(){if(_0x1b6266[_0x299d('0x8d')][_0x299d('0x91')]===_0x299d('0x8e')&&!_0x4379f9&&!_0x1b6266['query'][_0x299d('0x72')])return[];return db['sequelize']['query'](_0x5cadd5[_0x299d('0x92')](),_0xa5e797);})['then'](function(_0x63da94){_0x19f5da[_0x299d('0x22')]=_0x63da94['length'];if(_0x19f5da['count']===0x0)return[];return db[_0x299d('0x93')]['query'](_0x28e141['toString'](),_0xa5e797)[_0x299d('0x28')](function(_0x2398f9){_0x59fc35=_[_0x299d('0x94')](_0x2398f9,'id');_0xa5e797=_['merge'](_0xa5e797,{'model':db[_0x299d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1b6266['query'][_0x299d('0x3f')]){_0x9683c[_0x299d('0x40')][_0x299d('0x32')](function(_0x44007b){_0x58595a[_0x299d('0x47')]('i.'+_0x44007b);});}else{_0x58595a[_0x299d('0x47')](_0x299d('0x89'),'unreadMessages');_0x58595a[_0x299d('0x47')](_0x299d('0x95'),_0x299d('0x96'));_0x58595a[_0x299d('0x47')]('a.mandatoryDisposition',_0x299d('0x97'));_0x58595a['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',_0x299d('0x8a'));_0x58595a[_0x299d('0x47')]('i.*');_0x58595a['field'](_0x299d('0x98'),_0x299d('0x99'));_0x58595a[_0x299d('0x47')](_0x299d('0x9a'),'Contact.lastName');_0x58595a[_0x299d('0x47')]('c.email','Contact.email');_0x58595a[_0x299d('0x47')](_0x299d('0x9b'),_0x299d('0x9c'));_0x58595a[_0x299d('0x47')]('c.mobile',_0x299d('0x9d'));_0x58595a[_0x299d('0x47')]('c.fax',_0x299d('0x9e'));_0x58595a['field']('o.fullname','Owner.fullname');_0x58595a[_0x299d('0x47')]('o.internal',_0x299d('0x9f'));_0x58595a[_0x299d('0x47')](_0x299d('0xa0'),_0x299d('0x2f'));}if(_0x9683c['limit'])_0x58595a[_0x299d('0x21')](_0x9683c[_0x299d('0x21')]);if(_0x9683c[_0x299d('0x1f')])_0x58595a[_0x299d('0x1f')](_0x9683c[_0x299d('0x1f')]);return db[_0x299d('0x93')][_0x299d('0x3b')](_0x58595a[_0x299d('0x92')](),_0xa5e797);})[_0x299d('0x28')](function(_0x6183fa){if(_0x6183fa[_0x299d('0x41')]>0x0)_0x5bf8ac[_0x299d('0x46')](_0x299d('0xa1'),_['map'](_0x6183fa,'id'));return db['sequelize'][_0x299d('0x3b')](_0x5bf8ac[_0x299d('0x92')](),_0xa5e797)[_0x299d('0x28')](function(_0xefe8d0){var _0x345e83=_[_0x299d('0xa2')](_0xefe8d0,_0x299d('0xa3'));var _0x2a59a8=[];_0x6183fa[_0x299d('0x32')](function(_0x1fd7f0){_0x2a59a8[_0x299d('0x33')](updateFaxInteraction(_0x1fd7f0,_0x59fc35,_0x345e83));});return BPromise[_0x299d('0xa4')](_0x2a59a8);});});})[_0x299d('0x28')](function(_0x3ab654){_0x19f5da['rows']=_0x3ab654;return _0x19f5da;})[_0x299d('0x28')](respondWithFilteredResult(_0x4f8fb1,_0x9683c))[_0x299d('0x34')](handleError(_0x4f8fb1,null));};exports[_0x299d('0xa5')]=function(_0x1d99e6,_0x44570){var _0x360315={'raw':![],'where':{'id':_0x1d99e6['params']['id']}},_0x5c38fd={};_0x5c38fd[_0x299d('0x3a')]=_[_0x299d('0x3c')](db['FaxInteraction'][_0x299d('0xa6')]);_0x5c38fd['query']=_[_0x299d('0x3c')](_0x1d99e6[_0x299d('0x3b')]);_0x5c38fd['filters']=_[_0x299d('0x3e')](_0x5c38fd[_0x299d('0x3a')],_0x5c38fd[_0x299d('0x3b')]);_0x360315[_0x299d('0x40')]=_['intersection'](_0x5c38fd[_0x299d('0x3a')],qs['fields'](_0x1d99e6['query'][_0x299d('0x3f')]));_0x360315[_0x299d('0x40')]=_0x360315['attributes'][_0x299d('0x41')]?_0x360315['attributes']:_0x5c38fd[_0x299d('0x3a')];if(_0x1d99e6['query']['includeAll']){_0x360315[_0x299d('0xa7')]=[{'all':!![]}];}_0x360315=_[_0x299d('0xa8')]({},_0x360315,_0x1d99e6['options']);return db[_0x299d('0x36')]['find'](_0x360315)[_0x299d('0x28')](handleEntityNotFound(_0x44570,null))['then'](respondWithResult(_0x44570,null))['catch'](handleError(_0x44570,null));};exports['create']=function(_0x1dd2ef,_0x3d5d80){return db['FaxInteraction'][_0x299d('0xa9')](_0x1dd2ef[_0x299d('0xaa')],{})[_0x299d('0x28')](respondWithResult(_0x3d5d80,0xc9))[_0x299d('0x34')](handleError(_0x3d5d80,null));};exports[_0x299d('0x27')]=function(_0x1e6a33,_0x576b08){if(_0x1e6a33[_0x299d('0xaa')]['id']){delete _0x1e6a33[_0x299d('0xaa')]['id'];}return db['FaxInteraction'][_0x299d('0x5b')]({'where':{'id':_0x1e6a33[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x576b08,null))[_0x299d('0x28')](saveUpdates(_0x1e6a33['body'],null))[_0x299d('0x28')](respondWithResult(_0x576b08,null))['catch'](handleError(_0x576b08,null));};exports[_0x299d('0x29')]=function(_0x138e1a,_0x3b49b6){return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x138e1a[_0x299d('0xab')]['id']}})['then'](handleEntityNotFound(_0x3b49b6,null))['then'](removeEntity(_0x3b49b6,null))[_0x299d('0x34')](handleError(_0x3b49b6,null));};exports[_0x299d('0xac')]=function(_0x2320d5,_0x4e010a){return db[_0x299d('0x36')][_0x299d('0xac')]()[_0x299d('0x28')](respondWithResult(_0x4e010a,null))[_0x299d('0x34')](handleError(_0x4e010a,null));};exports[_0x299d('0xad')]=function(_0x1735a2,_0x3d5b61,_0x2ada97){return db[_0x299d('0xae')][_0x299d('0x5b')]({'where':{'id':_0x1735a2[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x3d5b61,null))[_0x299d('0x28')](function(_0x93fdcd){if(_0x93fdcd){return _0x93fdcd[_0x299d('0xad')](_0x1735a2['body'][_0x299d('0xaf')],_['omit'](_0x1735a2[_0x299d('0xaa')],['ids','id'])||{});}})[_0x299d('0x28')](respondWithResult(_0x3d5b61,null))[_0x299d('0x34')](handleError(_0x3d5b61,null));};exports[_0x299d('0xb0')]=function(_0x4e2a21,_0x104824,_0x380feb){var _0x20e315={'raw':![],'where':{}};var _0x59528c={};var _0x3aa0df={'count':0x0,'rows':[]};return db[_0x299d('0x36')][_0x299d('0xb1')]({'where':{'id':_0x4e2a21[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x104824,null))['then'](function(_0x5a52f1){if(_0x5a52f1){_0x59528c[_0x299d('0x3a')]=_[_0x299d('0x3c')](db['FaxMessage']['rawAttributes']);_0x59528c[_0x299d('0x3b')]=_[_0x299d('0x3c')](_0x4e2a21['query']);_0x59528c[_0x299d('0x3d')]=_[_0x299d('0x3e')](_0x59528c[_0x299d('0x3a')],_0x59528c['query']);_0x20e315[_0x299d('0x40')]=_[_0x299d('0x3e')](_0x59528c[_0x299d('0x3a')],qs[_0x299d('0x3f')](_0x4e2a21[_0x299d('0x3b')][_0x299d('0x3f')]));_0x20e315['attributes']=_0x20e315['attributes'][_0x299d('0x41')]?_0x20e315[_0x299d('0x40')]:_0x59528c[_0x299d('0x3a')];if(!_0x4e2a21[_0x299d('0x3b')]['hasOwnProperty'](_0x299d('0x43'))){_0x20e315[_0x299d('0x21')]=qs[_0x299d('0x21')](_0x4e2a21[_0x299d('0x3b')][_0x299d('0x21')]);_0x20e315['offset']=qs[_0x299d('0x1f')](_0x4e2a21[_0x299d('0x3b')][_0x299d('0x1f')]);}_0x20e315[_0x299d('0x44')]=qs[_0x299d('0x45')](_0x4e2a21[_0x299d('0x3b')]['sort']);_0x20e315[_0x299d('0x46')]=qs[_0x299d('0x3d')](_[_0x299d('0xb2')](_0x4e2a21[_0x299d('0x3b')],_0x59528c[_0x299d('0x3d')]));_0x20e315[_0x299d('0x46')][_0x299d('0xa3')]=_0x5a52f1['id'];if(_0x4e2a21['query']['filter']){_0x20e315[_0x299d('0x46')]=_[_0x299d('0xa8')](_0x20e315['where'],{'$or':_[_0x299d('0x2d')](_0x20e315[_0x299d('0x40')],function(_0x1506d6){var _0x518c2b={};_0x518c2b[_0x1506d6]={'$like':'%'+_0x4e2a21[_0x299d('0x3b')][_0x299d('0x81')]+'%'};return _0x518c2b;})});}if(_0x4e2a21[_0x299d('0x3b')][_0x299d('0x77')]){var _0x1566ff=_0x4e2a21[_0x299d('0x3b')][_0x299d('0x77')][_0x299d('0x31')](',');var _0x802708={};_0x802708[_0x1566ff[0x0]]={'$gte':moment(_0x1566ff[0x1])[_0x299d('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x20e315['where']=_[_0x299d('0xa8')](_0x20e315[_0x299d('0x46')],_0x802708);}_0x20e315=_[_0x299d('0xa8')]({},_0x20e315,_0x4e2a21[_0x299d('0xb4')]);return db[_0x299d('0xae')][_0x299d('0x22')]({'where':_0x20e315[_0x299d('0x46')]})[_0x299d('0x28')](function(_0x48bb6b){_0x3aa0df[_0x299d('0x22')]=_0x48bb6b;if(_0x4e2a21[_0x299d('0x3b')][_0x299d('0xb5')]){_0x20e315[_0x299d('0xa7')]=[{'all':!![]}];}return db['FaxMessage'][_0x299d('0xb6')](_0x20e315);})['then'](function(_0x27b978){_0x3aa0df[_0x299d('0xb7')]=_0x27b978;return _0x3aa0df;});}})[_0x299d('0x28')](respondWithFilteredResult(_0x104824,_0x20e315))[_0x299d('0x34')](handleError(_0x104824,null));};exports['addTags']=function(_0x41800a,_0x28ebe1,_0x263d5b){return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x41800a[_0x299d('0xab')]['id']}})[_0x299d('0x28')](handleEntityNotFound(_0x28ebe1,null))['then'](function(_0x3437ba){if(_0x3437ba){return _0x3437ba[_0x299d('0xb8')](_0x41800a[_0x299d('0xaa')]['ids'],_[_0x299d('0xb9')](_0x41800a[_0x299d('0xaa')],[_0x299d('0xaf'),'id'])||{})['spread'](function(){return db[_0x299d('0x68')][_0x299d('0xb6')]({'attributes':['id',_0x299d('0x2a'),_0x299d('0xba')],'where':{'id':_0x41800a['body'][_0x299d('0xaf')]}});})['then'](function(_0x5780ff){socket[_0x299d('0xbb')](_0x299d('0xbc'),{'id':Number(_0x41800a[_0x299d('0xab')]['id']),'tags':_0x5780ff||[]});return{'id':Number(_0x41800a[_0x299d('0xab')]['id']),'tags':_0x5780ff||[]};});}})['then'](respondWithResult(_0x28ebe1,null))[_0x299d('0x34')](handleError(_0x28ebe1,null));};exports[_0x299d('0xbd')]=function(_0x11aaad,_0x1f4553,_0x1b4433){return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x11aaad['params']['id']}})['then'](handleEntityNotFound(_0x1f4553,null))['then'](function(_0x415314){if(_0x415314){return _0x415314['removeTags'](_0x11aaad[_0x299d('0x3b')][_0x299d('0xaf')]);}})[_0x299d('0x28')](respondWithStatusCode(_0x1f4553,null))['catch'](handleError(_0x1f4553,null));};exports[_0x299d('0xbe')]=function(_0x2db18f,_0x1f268c){var _0x493eff=moment()[_0x299d('0xbf')]()['toString']();var _0x24e32d=path['join'](config[_0x299d('0xc0')],_0x299d('0xc1'),_0x299d('0xc2'),_0x299d('0xc3'));var _0x321d74=path[_0x299d('0xc4')](config[_0x299d('0xc0')],_0x299d('0xc1'),_0x299d('0xc2'),_0x299d('0xc5'));var _0x374524=path[_0x299d('0xc4')](_0x24e32d,_0x493eff);var _0x2dd853=util[_0x299d('0xb3')](_0x299d('0xc6'),_0x2db18f[_0x299d('0xab')]['id'],_0x493eff);var _0x50b296=path['join'](_0x24e32d,_0x2dd853);var _0x5a7bd6=[];_0x5a7bd6[_0x299d('0x33')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x5f30c2=[{'model':db[_0x299d('0xae')],'as':_0x299d('0xc7'),'attributes':['id','body','createdAt'],'include':_0x5a7bd6}];return db[_0x299d('0x36')][_0x299d('0x5b')]({'where':{'id':_0x2db18f['params']['id']},'include':_0x5f30c2})[_0x299d('0x28')](handleEntityNotFound(_0x1f268c,null))[_0x299d('0x28')](function(_0x34a624){if(_0x34a624&&_0x34a624[_0x299d('0xc7')]){var _0x2464ae=_0x34a624[_0x299d('0xc8')]({'plain':!![]});fs[_0x299d('0xc9')](_0x374524);for(var _0x42e336=0x0;_0x42e336<_0x2464ae[_0x299d('0xc7')][_0x299d('0x41')];_0x42e336++){var _0x595d64=_0x2464ae['Messages'][_0x42e336][_0x299d('0xca')];if(_0x595d64){var _0xc918c3=path[_0x299d('0xc4')](_0x321d74,_0x595d64[_0x299d('0xcb')]);if(fs[_0x299d('0xcc')](_0xc918c3)){fs[_0x299d('0xcd')](_0xc918c3)[_0x299d('0xce')](fs[_0x299d('0xcf')](path[_0x299d('0xc4')](_0x374524,_0x595d64[_0x299d('0xcb')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x363eac,_0x56b4f7){zipdir(_0x374524,{'saveTo':_0x50b296},function(_0x1613e7,_0x19b043){if(_0x1613e7)return _0x56b4f7(_0x1613e7);return _0x363eac(_0x19b043);});})[_0x299d('0x28')](function(){return new BPromise(function(_0x453e18,_0x3939eb){rimraf(_0x374524,function(_0x2e9b75){if(_0x2e9b75)_0x3939eb(_0x2e9b75);return _0x453e18();});});})[_0x299d('0x28')](function(){return _0x1f268c[_0x299d('0xbe')](_0x50b296,_0x2dd853,function(_0x2d06cb){if(_0x2d06cb){console[_0x299d('0xd0')](_0x299d('0xd1'),_0x2d06cb);}else{fs[_0x299d('0xd2')](_0x50b296);}});});});}else{return _0x1f268c[_0x299d('0x1b')](0xc8);}})[_0x299d('0x34')](handleError(_0x1f268c,null));}; \ No newline at end of file +var _0xb8b1=['it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','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','text','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','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)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','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','push','all','rows','show','params','keys','includeAll','options','create','describe','addMessage','ids','omit','getMessages','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','include','findAll','addTags','setTags','faxInteractionTags:save','removeTags','download','join','files','root','server','attachments','format','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags'];(function(_0x6619a6,_0x1f964b){var _0x1be738=function(_0x56b977){while(--_0x56b977){_0x6619a6['push'](_0x6619a6['shift']());}};_0x1be738(++_0x1f964b);}(_0xb8b1,0x15c));var _0x1b8b=function(_0x37f89c,_0x49a16c){_0x37f89c=_0x37f89c-0x0;var _0x4ebeac=_0xb8b1[_0x37f89c];return _0x4ebeac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b8b('0x0'));var zipdir=require(_0x1b8b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b8b('0x2'));var moment=require(_0x1b8b('0x3'));var BPromise=require(_0x1b8b('0x4'));var Mustache=require(_0x1b8b('0x5'));var util=require('util');var path=require(_0x1b8b('0x6'));var sox=require('sox');var csv=require(_0x1b8b('0x7'));var ejs=require(_0x1b8b('0x8'));var fs=require('fs');var fs_extra=require(_0x1b8b('0x9'));var _=require(_0x1b8b('0xa'));var squel=require('squel');var crypto=require(_0x1b8b('0xb'));var jsforce=require(_0x1b8b('0xc'));var deskjs=require(_0x1b8b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1b8b('0xe'));var Papa=require('papaparse');var Redis=require(_0x1b8b('0xf'));var authService=require(_0x1b8b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b8b('0x11'));var logger=require('../../config/logger')(_0x1b8b('0x12'));var utils=require(_0x1b8b('0x13'));var config=require(_0x1b8b('0x14'));var licenseUtil=require(_0x1b8b('0x15'));var db=require(_0x1b8b('0x16'))['db'];config['redis']=_['defaults'](config[_0x1b8b('0x17')],{'host':_0x1b8b('0x18'),'port':0x18eb});var socket=require(_0x1b8b('0x19'))(new Redis(config[_0x1b8b('0x17')]));require(_0x1b8b('0x1a'))['register'](socket);function respondWithStatusCode(_0x55d57e,_0x531890){_0x531890=_0x531890||0xcc;return function(_0x18333a){if(_0x18333a){return _0x55d57e[_0x1b8b('0x1b')](_0x531890);}return _0x55d57e[_0x1b8b('0x1c')](_0x531890)[_0x1b8b('0x1d')]();};}function respondWithResult(_0x45d976,_0x4fd161){_0x4fd161=_0x4fd161||0xc8;return function(_0x36e0be){if(_0x36e0be){return _0x45d976[_0x1b8b('0x1c')](_0x4fd161)[_0x1b8b('0x1e')](_0x36e0be);}};}function respondWithFilteredResult(_0xa1db13,_0x1f2a6d){return function(_0x4daca7){if(_0x4daca7){var _0xe084e1=typeof _0x1f2a6d[_0x1b8b('0x1f')]===_0x1b8b('0x20')&&typeof _0x1f2a6d[_0x1b8b('0x21')]===_0x1b8b('0x20');var _0x446b2b=_0x4daca7[_0x1b8b('0x22')];var _0x42670c=_0xe084e1?0x0:_0x1f2a6d[_0x1b8b('0x1f')];var _0x17fbe0=_0xe084e1?_0x4daca7[_0x1b8b('0x22')]:_0x1f2a6d[_0x1b8b('0x1f')]+_0x1f2a6d['limit'];var _0xb69f97;if(_0x17fbe0>=_0x446b2b){_0x17fbe0=_0x446b2b;_0xb69f97=0xc8;}else{_0xb69f97=0xce;}_0xa1db13[_0x1b8b('0x1c')](_0xb69f97);return _0xa1db13[_0x1b8b('0x23')]('Content-Range',_0x42670c+'-'+_0x17fbe0+'/'+_0x446b2b)['json'](_0x4daca7);}return null;};}function patchUpdates(_0x237cb4){return function(_0x141e32){try{jsonpatch['apply'](_0x141e32,_0x237cb4,!![]);}catch(_0x2f7bb3){return BPromise[_0x1b8b('0x24')](_0x2f7bb3);}return _0x141e32[_0x1b8b('0x25')]();};}function saveUpdates(_0x501f73,_0x28cea1){return function(_0x1fe31e){if(_0x1fe31e){return _0x1fe31e[_0x1b8b('0x26')](_0x501f73)[_0x1b8b('0x27')](function(_0x20755c){return _0x20755c;});}return null;};}function removeEntity(_0x5c51f3,_0x351517){return function(_0x521da4){if(_0x521da4){return _0x521da4[_0x1b8b('0x28')]()[_0x1b8b('0x27')](function(){_0x5c51f3[_0x1b8b('0x1c')](0xcc)[_0x1b8b('0x1d')]();});}};}function handleEntityNotFound(_0x1a04a5,_0xc72107){return function(_0x50fdc7){if(!_0x50fdc7){_0x1a04a5[_0x1b8b('0x1b')](0x194);}return _0x50fdc7;};}function handleError(_0x34c28a,_0x26ffdf){_0x26ffdf=_0x26ffdf||0x1f4;return function(_0x49948c){logger[_0x1b8b('0x29')](_0x49948c[_0x1b8b('0x2a')]);if(_0x49948c[_0x1b8b('0x2b')]){delete _0x49948c[_0x1b8b('0x2b')];}_0x34c28a[_0x1b8b('0x1c')](_0x26ffdf)['send'](_0x49948c);};}function getInteractionUsers(_0x573de1,_0xd34763){return new BPromise(function(_0x1dd650,_0x38cfcc){try{if(_0xd34763[_0x573de1['id']]){_0x573de1[_0x1b8b('0x2c')]=_[_0x1b8b('0x2d')](_0xd34763[_0x573de1['id']],function(_0x1cb085){return{'id':_0x1cb085['id'],'fullname':_0x1cb085[_0x1b8b('0x2e')]};});}}catch(_0x3fde4b){_0x38cfcc(_0x3fde4b);}_0x1dd650(_0x573de1);});}function getInteractionTags(_0x37b4d5,_0x192e06){return new BPromise(function(_0x1f3e3a,_0xb837c5){try{if(_0x37b4d5['TagIds']){_0x37b4d5[_0x1b8b('0x2f')]=[];_0x37b4d5[_0x1b8b('0x30')][_0x1b8b('0x31')](',')[_0x1b8b('0x32')](function(_0x52e5c9){_0x37b4d5[_0x1b8b('0x2f')]['push'](_0x192e06[_0x52e5c9]);});}delete _0x37b4d5['TagIds'];}catch(_0x41dfe4){_0xb837c5(_0x41dfe4);}_0x1f3e3a(_0x37b4d5);});}function updateFaxInteraction(_0x4525ba,_0x113090,_0x45faf5){return new BPromise(function(_0x40de23,_0x3bb32f){return getInteractionUsers(_0x4525ba,_0x45faf5)['then'](function(_0x5ce807){return getInteractionTags(_0x5ce807,_0x113090);})['then'](function(_0x1cccc8){_0x40de23(_0x1cccc8);})[_0x1b8b('0x33')](function(_0xdf37bd){_0x3bb32f(_0xdf37bd);});});}exports[_0x1b8b('0x34')]=function(_0x52b662,_0x1dae8e){var _0x221595={},_0xf4a43b={},_0x3c5be5={'count':0x0,'rows':[]};var _0x595b31=_[_0x1b8b('0x2d')](db[_0x1b8b('0x35')][_0x1b8b('0x36')],function(_0x517ac3){return{'name':_0x517ac3[_0x1b8b('0x37')],'type':_0x517ac3[_0x1b8b('0x38')][_0x1b8b('0x39')]};});_0xf4a43b['model']=_['map'](_0x595b31,_0x1b8b('0x2b'));_0xf4a43b[_0x1b8b('0x3a')]=_['keys'](_0x52b662['query']);_0xf4a43b[_0x1b8b('0x3b')]=_['intersection'](_0xf4a43b['model'],_0xf4a43b[_0x1b8b('0x3a')]);_0x221595['attributes']=_[_0x1b8b('0x3c')](_0xf4a43b[_0x1b8b('0x3d')],qs[_0x1b8b('0x3e')](_0x52b662['query'][_0x1b8b('0x3e')]));_0x221595[_0x1b8b('0x3f')]=_0x221595[_0x1b8b('0x3f')][_0x1b8b('0x40')]?_0x221595['attributes']:_0xf4a43b['model'];if(!_0x52b662[_0x1b8b('0x3a')]['hasOwnProperty'](_0x1b8b('0x41'))){_0x221595[_0x1b8b('0x21')]=qs[_0x1b8b('0x21')](_0x52b662['query'][_0x1b8b('0x21')]);_0x221595['offset']=qs['offset'](_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x1f')]);}_0x221595[_0x1b8b('0x42')]=qs[_0x1b8b('0x43')](_0x52b662[_0x1b8b('0x3a')]['sort']);_0x221595[_0x1b8b('0x44')]=qs[_0x1b8b('0x3b')](_[_0x1b8b('0x45')](_0x52b662[_0x1b8b('0x3a')],_0xf4a43b['filters']),_0x595b31);var _0x4bdc6c=[];var _0x544f27=squel[_0x1b8b('0x46')]()['field']('id')[_0x1b8b('0x47')]('name')['field'](_0x1b8b('0x48'))[_0x1b8b('0x49')]('tools_tags');var _0x353801=squel[_0x1b8b('0x46')]()[_0x1b8b('0x47')](_0x1b8b('0x4a'))[_0x1b8b('0x47')](_0x1b8b('0x4b'))[_0x1b8b('0x47')](_0x1b8b('0x4c'))[_0x1b8b('0x49')](_0x1b8b('0x4d'),'ui')[_0x1b8b('0x4e')](_0x1b8b('0x4f'),'u',_0x1b8b('0x50'));var _0x301b77=squel['select']()[_0x1b8b('0x49')]('fax_interactions','i')[_0x1b8b('0x4e')](_0x1b8b('0x51'),'c',_0x1b8b('0x52'))['left_join'](_0x1b8b('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x1b8b('0x4e')](_0x1b8b('0x53'),'a',_0x1b8b('0x54'))[_0x1b8b('0x4e')](_0x1b8b('0x55'),'me',_0x1b8b('0x56'))[_0x1b8b('0x4e')](_0x1b8b('0x57'),'it',_0x1b8b('0x58'))[_0x1b8b('0x4e')](_0x1b8b('0x59'),'t',_0x1b8b('0x5a'));var _0x15559b=squel[_0x1b8b('0x5b')]();var _0x2f535d=[];var _0x4c5564=squel[_0x1b8b('0x5b')]();var _0x53e135;if(_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x5c')]){_0x53e135=as['parseSearch'](_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x5c')]);var _0x2f0089=_0x53e135['sqlOperator'];for(var _0x38e7fa=0x0;_0x38e7fa<_0x53e135[_0x1b8b('0x5d')][_0x1b8b('0x40')];_0x38e7fa++){var _0x39a16a=_0x53e135[_0x1b8b('0x5d')][_0x38e7fa];var _0x49ec08='i';var _0x189bdb=_[_0x1b8b('0x5e')](_0x595b31,[_0x1b8b('0x2b'),_0x39a16a[_0x1b8b('0x47')]]);if(!_0x189bdb){switch(_0x39a16a[_0x1b8b('0x47')]){case'unreadMessages':if(_0x39a16a[_0x1b8b('0x5f')]==0x1){_0x301b77[_0x1b8b('0x60')]('`'+_0x39a16a['field']+_0x1b8b('0x61'));}else{_0x301b77[_0x1b8b('0x60')]('`'+_0x39a16a['field']+_0x1b8b('0x62'));}break;case _0x1b8b('0x63'):if(_0x39a16a[_0x1b8b('0x64')]===_0x1b8b('0x65')){if(_0x39a16a[_0x1b8b('0x5f')]['split']('\x20')[_0x1b8b('0x40')]>0x1){_0x15559b[_0x2f0089](_0x1b8b('0x66'),qs[_0x1b8b('0x67')](_0x39a16a[_0x1b8b('0x5f')]),null);}else{var _0xf7aaa0='%'+_0x39a16a[_0x1b8b('0x5f')]+'%';_0x15559b[_0x2f0089](_0x1b8b('0x68'),_0xf7aaa0,_0xf7aaa0,_0xf7aaa0);}}else{_0x189bdb=_['find'](_0x595b31,[_0x1b8b('0x2b'),_0x1b8b('0x69')]);_0x39a16a['field']=_0x1b8b('0x69');_0x545cce=as['buildExpression'](_0x49ec08,_0x189bdb[_0x1b8b('0x38')],_0x39a16a);_0x15559b[_0x2f0089](_0x545cce[_0x1b8b('0x6a')],_0x545cce[_0x1b8b('0x5f')]['start'],_0x545cce[_0x1b8b('0x5f')][_0x1b8b('0x1d')]);}break;case _0x1b8b('0x6b'):var _0x1643c7=_0x39a16a[_0x1b8b('0x5f')][_0x1b8b('0x31')](',')[_0x1b8b('0x2d')](function(_0x1c9488){return Number(_0x1c9488);});_0x1643c7['forEach'](function(_0x403966){_0x4c5564['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x403966+',%');});_0x2f535d=_[_0x1b8b('0x6c')](_0x2f535d,_0x1643c7);break;case _0x1b8b('0x6d'):if(_0x39a16a['operator']===_0x1b8b('0x65')){_0x15559b[_0x2f0089](_0x1b8b('0x6e'),'%'+_0x39a16a[_0x1b8b('0x5f')]+'%',null);}else{_0x189bdb=_[_0x1b8b('0x5e')](_0x595b31,[_0x1b8b('0x2b'),'UserId']);_0x39a16a[_0x1b8b('0x47')]=_0x1b8b('0x6f');_0x545cce=as[_0x1b8b('0x70')](_0x49ec08,_0x189bdb[_0x1b8b('0x38')],_0x39a16a);_0x15559b[_0x2f0089](_0x545cce[_0x1b8b('0x6a')],_0x545cce['value'][_0x1b8b('0x71')],_0x545cce[_0x1b8b('0x5f')][_0x1b8b('0x1d')]);}break;case _0x1b8b('0x72'):_0x545cce=as['buildExpression']('me',null,_0x39a16a);_0x15559b[_0x2f0089](_0x545cce['text'],_0x545cce[_0x1b8b('0x5f')]['start'],_0x545cce['value'][_0x1b8b('0x1d')]);break;}}else{var _0x545cce=as['buildExpression'](_0x49ec08,_0x189bdb['type'],_0x39a16a);_0x15559b[_0x2f0089](_0x545cce[_0x1b8b('0x6a')],_0x545cce[_0x1b8b('0x5f')][_0x1b8b('0x71')],_0x545cce['value'][_0x1b8b('0x1d')]);}}}else{var _0x13b40c=_(_0x52b662['query'])['keys']()['map'](function(_0x9cad67){return _[_0x1b8b('0x73')](_0x595b31,['name',_0x9cad67])?_0x9cad67:undefined;})[_0x1b8b('0x74')]()[_0x1b8b('0x5f')]();if(!_[_0x1b8b('0x75')](_0x13b40c)){_0x13b40c['forEach'](function(_0x1a1632){if(_0x1a1632===_0x1b8b('0x76')){_0x301b77[_0x1b8b('0x44')](_0x1b8b('0x77'),[][_0x1b8b('0x78')](_0x52b662[_0x1b8b('0x3a')][_0x1a1632]));}else if(_0x1a1632===_0x1b8b('0x79')){var _0x27487e=JSON[_0x1b8b('0x7a')](_0x52b662[_0x1b8b('0x3a')][_0x1a1632])[_0x1b8b('0x7b')];var _0x49b71e=JSON[_0x1b8b('0x7a')](_0x52b662['query'][_0x1a1632])[_0x1b8b('0x7c')];_0x301b77[_0x1b8b('0x44')](_0x1b8b('0x7d'),_0x27487e,_0x49b71e);}else{if(_0x52b662['query'][_0x1a1632]===_0x1b8b('0x7e')){_0x301b77['where']('i.'+_0x1a1632+'\x20IS\x20NULL');}else{_0x301b77[_0x1b8b('0x44')]('i.'+_0x1a1632+_0x1b8b('0x7f'),_0x52b662[_0x1b8b('0x3a')][_0x1a1632]);}}});}if(_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x80')]){if(_0x52b662[_0x1b8b('0x3a')]['read']==0x1){_0x301b77['having'](_0x1b8b('0x81'));}else{_0x301b77[_0x1b8b('0x60')](_0x1b8b('0x82'));}}if(_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x83')]){_0x2f535d=_['isArray'](_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x83')])?_0x52b662['query']['tag']:new Array(_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x83')]);_0x2f535d[_0x1b8b('0x32')](function(_0x27c01c){_0x4c5564['or'](_0x1b8b('0x84'),'%,'+_0x27c01c+',%');});}if(_0x52b662[_0x1b8b('0x3a')]['filter']){var _0x4b8496=_0x52b662['query'][_0x1b8b('0x85')]['replace']('\x5c','\x5c\x5c')[_0x1b8b('0x86')](/'/g,'\x27\x27');if(qs[_0x1b8b('0x87')](_0x4b8496)){_0x15559b['or']('i.id\x20LIKE\x20?',_0x4b8496+'%')['or'](_0x1b8b('0x88'),_0x4b8496+'%');}_0x15559b['or'](_0x1b8b('0x89'),_0x4b8496+'%');}}_0x301b77['where'](_0x15559b);_0x301b77[_0x1b8b('0x8a')](_0x1b8b('0x8b'));var _0x5ac931={'type':db[_0x1b8b('0x8c')][_0x1b8b('0x8d')][_0x1b8b('0x8e')],'raw':!![]};var _0x5dd3ac=_0x301b77[_0x1b8b('0x8f')]();_0x5dd3ac[_0x1b8b('0x47')](_0x1b8b('0x8b'));_0x5dd3ac[_0x1b8b('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1b8b('0x90'));if(_0x221595[_0x1b8b('0x42')]){_0x221595[_0x1b8b('0x42')][_0x1b8b('0x32')](function(_0x3f3db5){var _0xa33a05=_0x3f3db5[0x0]===_0x1b8b('0x91')?_0x3f3db5[0x0]:'i.'+_0x3f3db5[0x0];_0x301b77['order'](_0xa33a05,_0x3f3db5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1b8b('0x75')](_0x2f535d)){_0x301b77[_0x1b8b('0x60')](_0x4c5564);_0x5dd3ac[_0x1b8b('0x44')]('t.id\x20IN\x20?',_0x2f535d);}BPromise[_0x1b8b('0x92')]()['then'](function(){if(!_0x53e135){if(_0x52b662['query'][_0x1b8b('0x76')])return;_0x5dd3ac[_0x1b8b('0x44')](_0x1b8b('0x93'));_0x301b77[_0x1b8b('0x44')](_0x1b8b('0x93'));return;}if(_0x52b662[_0x1b8b('0x94')][_0x1b8b('0x95')]!==_0x1b8b('0x96'))return;return _0x52b662[_0x1b8b('0x94')][_0x1b8b('0x97')]({'attributes':['id'],'raw':!![]})[_0x1b8b('0x27')](function(_0x1ebb5b){if(_[_0x1b8b('0x75')](_0x1ebb5b)){_0x5dd3ac['where'](_0x1b8b('0x98'));_0x301b77[_0x1b8b('0x44')](_0x1b8b('0x98'));}else{_0x5dd3ac[_0x1b8b('0x44')](_0x1b8b('0x77'),_[_0x1b8b('0x2d')](_0x1ebb5b,'id'));_0x301b77['where'](_0x1b8b('0x77'),_['map'](_0x1ebb5b,'id'));}});})[_0x1b8b('0x27')](function(){if(_0x52b662[_0x1b8b('0x94')][_0x1b8b('0x95')]===_0x1b8b('0x96')&&!_0x53e135&&!_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x76')])return[];return db[_0x1b8b('0x99')]['query'](_0x5dd3ac[_0x1b8b('0x9a')](),_0x5ac931);})[_0x1b8b('0x27')](function(_0x28fc57){_0x3c5be5[_0x1b8b('0x22')]=_0x28fc57[_0x1b8b('0x40')];if(_0x3c5be5[_0x1b8b('0x22')]===0x0)return[];return db['sequelize'][_0x1b8b('0x3a')](_0x544f27[_0x1b8b('0x9a')](),_0x5ac931)[_0x1b8b('0x27')](function(_0x132912){_0x4bdc6c=_[_0x1b8b('0x9b')](_0x132912,'id');_0x5ac931=_[_0x1b8b('0x9c')](_0x5ac931,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x52b662[_0x1b8b('0x3a')][_0x1b8b('0x3e')]){_0x221595['attributes'][_0x1b8b('0x32')](function(_0x55cde8){_0x301b77[_0x1b8b('0x47')]('i.'+_0x55cde8);});}else{_0x301b77[_0x1b8b('0x47')](_0x1b8b('0x9d'),_0x1b8b('0x90'));_0x301b77['field']('a.key',_0x1b8b('0x9e'));_0x301b77[_0x1b8b('0x47')](_0x1b8b('0x9f'),_0x1b8b('0xa0'));_0x301b77['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');_0x301b77[_0x1b8b('0x47')](_0x1b8b('0xa1'));_0x301b77[_0x1b8b('0x47')](_0x1b8b('0xa2'),_0x1b8b('0xa3'));_0x301b77[_0x1b8b('0x47')](_0x1b8b('0xa4'),_0x1b8b('0xa5'));_0x301b77[_0x1b8b('0x47')]('c.email','Contact.email');_0x301b77['field']('c.phone',_0x1b8b('0xa6'));_0x301b77[_0x1b8b('0x47')](_0x1b8b('0xa7'),_0x1b8b('0xa8'));_0x301b77[_0x1b8b('0x47')](_0x1b8b('0xa9'),_0x1b8b('0xaa'));_0x301b77['field'](_0x1b8b('0xab'),_0x1b8b('0xac'));_0x301b77[_0x1b8b('0x47')](_0x1b8b('0xad'),_0x1b8b('0xae'));_0x301b77['field'](_0x1b8b('0xaf'),_0x1b8b('0x30'));}if(_0x221595[_0x1b8b('0x21')])_0x301b77[_0x1b8b('0x21')](_0x221595[_0x1b8b('0x21')]);if(_0x221595[_0x1b8b('0x1f')])_0x301b77[_0x1b8b('0x1f')](_0x221595['offset']);return db[_0x1b8b('0x99')][_0x1b8b('0x3a')](_0x301b77[_0x1b8b('0x9a')](),_0x5ac931);})[_0x1b8b('0x27')](function(_0x2c1c6d){if(_0x2c1c6d['length']>0x0)_0x353801[_0x1b8b('0x44')](_0x1b8b('0xb0'),_[_0x1b8b('0x2d')](_0x2c1c6d,'id'));return db[_0x1b8b('0x99')][_0x1b8b('0x3a')](_0x353801[_0x1b8b('0x9a')](),_0x5ac931)[_0x1b8b('0x27')](function(_0x1baf73){var _0x3cfd53=_[_0x1b8b('0xb1')](_0x1baf73,'FaxInteractionId');var _0x399e1f=[];_0x2c1c6d[_0x1b8b('0x32')](function(_0x17bfcb){_0x399e1f[_0x1b8b('0xb2')](updateFaxInteraction(_0x17bfcb,_0x4bdc6c,_0x3cfd53));});return BPromise[_0x1b8b('0xb3')](_0x399e1f);});});})['then'](function(_0x3f8fac){_0x3c5be5[_0x1b8b('0xb4')]=_0x3f8fac;return _0x3c5be5;})[_0x1b8b('0x27')](respondWithFilteredResult(_0x1dae8e,_0x221595))[_0x1b8b('0x33')](handleError(_0x1dae8e,null));};exports[_0x1b8b('0xb5')]=function(_0x3189a9,_0x15e0d4){var _0x1c0c11={'raw':![],'where':{'id':_0x3189a9[_0x1b8b('0xb6')]['id']}},_0x1b5aaf={};_0x1b5aaf['model']=_[_0x1b8b('0xb7')](db[_0x1b8b('0x35')][_0x1b8b('0x36')]);_0x1b5aaf[_0x1b8b('0x3a')]=_[_0x1b8b('0xb7')](_0x3189a9['query']);_0x1b5aaf[_0x1b8b('0x3b')]=_[_0x1b8b('0x3c')](_0x1b5aaf[_0x1b8b('0x3d')],_0x1b5aaf['query']);_0x1c0c11[_0x1b8b('0x3f')]=_[_0x1b8b('0x3c')](_0x1b5aaf[_0x1b8b('0x3d')],qs[_0x1b8b('0x3e')](_0x3189a9[_0x1b8b('0x3a')]['fields']));_0x1c0c11[_0x1b8b('0x3f')]=_0x1c0c11[_0x1b8b('0x3f')]['length']?_0x1c0c11[_0x1b8b('0x3f')]:_0x1b5aaf[_0x1b8b('0x3d')];if(_0x3189a9['query'][_0x1b8b('0xb8')]){_0x1c0c11['include']=[{'all':!![]}];}_0x1c0c11=_['merge']({},_0x1c0c11,_0x3189a9[_0x1b8b('0xb9')]);return db['FaxInteraction'][_0x1b8b('0x5e')](_0x1c0c11)[_0x1b8b('0x27')](handleEntityNotFound(_0x15e0d4,null))[_0x1b8b('0x27')](respondWithResult(_0x15e0d4,null))[_0x1b8b('0x33')](handleError(_0x15e0d4,null));};exports[_0x1b8b('0xba')]=function(_0x43b828,_0x2ecda0){return db['FaxInteraction'][_0x1b8b('0xba')](_0x43b828[_0x1b8b('0x72')],{})[_0x1b8b('0x27')](respondWithResult(_0x2ecda0,0xc9))[_0x1b8b('0x33')](handleError(_0x2ecda0,null));};exports['update']=function(_0x376996,_0x8c5c91){if(_0x376996[_0x1b8b('0x72')]['id']){delete _0x376996[_0x1b8b('0x72')]['id'];}return db[_0x1b8b('0x35')][_0x1b8b('0x5e')]({'where':{'id':_0x376996[_0x1b8b('0xb6')]['id']}})[_0x1b8b('0x27')](handleEntityNotFound(_0x8c5c91,null))[_0x1b8b('0x27')](saveUpdates(_0x376996['body'],null))['then'](respondWithResult(_0x8c5c91,null))[_0x1b8b('0x33')](handleError(_0x8c5c91,null));};exports[_0x1b8b('0x28')]=function(_0x5db358,_0x285ac7){return db['FaxInteraction'][_0x1b8b('0x5e')]({'where':{'id':_0x5db358['params']['id']}})[_0x1b8b('0x27')](handleEntityNotFound(_0x285ac7,null))[_0x1b8b('0x27')](removeEntity(_0x285ac7,null))[_0x1b8b('0x33')](handleError(_0x285ac7,null));};exports['describe']=function(_0x4cf472,_0x26052f){return db[_0x1b8b('0x35')][_0x1b8b('0xbb')]()[_0x1b8b('0x27')](respondWithResult(_0x26052f,null))[_0x1b8b('0x33')](handleError(_0x26052f,null));};exports[_0x1b8b('0xbc')]=function(_0x28d878,_0x31dbcf,_0x565744){return db['FaxMessage']['find']({'where':{'id':_0x28d878[_0x1b8b('0xb6')]['id']}})[_0x1b8b('0x27')](handleEntityNotFound(_0x31dbcf,null))[_0x1b8b('0x27')](function(_0x29e720){if(_0x29e720){return _0x29e720[_0x1b8b('0xbc')](_0x28d878[_0x1b8b('0x72')][_0x1b8b('0xbd')],_[_0x1b8b('0xbe')](_0x28d878[_0x1b8b('0x72')],[_0x1b8b('0xbd'),'id'])||{});}})[_0x1b8b('0x27')](respondWithResult(_0x31dbcf,null))[_0x1b8b('0x33')](handleError(_0x31dbcf,null));};exports[_0x1b8b('0xbf')]=function(_0x491c52,_0x15ab35,_0x391805){var _0x48f9f2={'raw':![],'where':{}};var _0x4e888d={};var _0x52eda8={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x491c52[_0x1b8b('0xb6')]['id']}})[_0x1b8b('0x27')](handleEntityNotFound(_0x15ab35,null))['then'](function(_0x532bc8){if(_0x532bc8){_0x4e888d[_0x1b8b('0x3d')]=_[_0x1b8b('0xb7')](db['FaxMessage']['rawAttributes']);_0x4e888d[_0x1b8b('0x3a')]=_['keys'](_0x491c52[_0x1b8b('0x3a')]);_0x4e888d[_0x1b8b('0x3b')]=_[_0x1b8b('0x3c')](_0x4e888d[_0x1b8b('0x3d')],_0x4e888d[_0x1b8b('0x3a')]);_0x48f9f2['attributes']=_[_0x1b8b('0x3c')](_0x4e888d[_0x1b8b('0x3d')],qs[_0x1b8b('0x3e')](_0x491c52[_0x1b8b('0x3a')][_0x1b8b('0x3e')]));_0x48f9f2[_0x1b8b('0x3f')]=_0x48f9f2[_0x1b8b('0x3f')][_0x1b8b('0x40')]?_0x48f9f2[_0x1b8b('0x3f')]:_0x4e888d[_0x1b8b('0x3d')];if(!_0x491c52[_0x1b8b('0x3a')]['hasOwnProperty'](_0x1b8b('0x41'))){_0x48f9f2[_0x1b8b('0x21')]=qs[_0x1b8b('0x21')](_0x491c52[_0x1b8b('0x3a')][_0x1b8b('0x21')]);_0x48f9f2[_0x1b8b('0x1f')]=qs[_0x1b8b('0x1f')](_0x491c52[_0x1b8b('0x3a')][_0x1b8b('0x1f')]);}_0x48f9f2[_0x1b8b('0x42')]=qs[_0x1b8b('0x43')](_0x491c52['query'][_0x1b8b('0x43')]);_0x48f9f2[_0x1b8b('0x44')]=qs['filters'](_['pick'](_0x491c52[_0x1b8b('0x3a')],_0x4e888d[_0x1b8b('0x3b')]));_0x48f9f2[_0x1b8b('0x44')][_0x1b8b('0xc0')]=_0x532bc8['id'];if(_0x491c52['query']['filter']){_0x48f9f2[_0x1b8b('0x44')]=_[_0x1b8b('0x9c')](_0x48f9f2[_0x1b8b('0x44')],{'$or':_[_0x1b8b('0x2d')](_0x48f9f2['attributes'],function(_0x340cad){var _0x35e454={};_0x35e454[_0x340cad]={'$like':'%'+_0x491c52['query']['filter']+'%'};return _0x35e454;})});}if(_0x491c52[_0x1b8b('0x3a')][_0x1b8b('0x7b')]){var _0x589272=_0x491c52[_0x1b8b('0x3a')]['$gte']['split'](',');var _0x5912ff={};_0x5912ff[_0x589272[0x0]]={'$gte':moment(_0x589272[0x1])['format'](_0x1b8b('0xc1'))};_0x48f9f2[_0x1b8b('0x44')]=_['merge'](_0x48f9f2[_0x1b8b('0x44')],_0x5912ff);}_0x48f9f2=_['merge']({},_0x48f9f2,_0x491c52['options']);return db[_0x1b8b('0xc2')][_0x1b8b('0x22')]({'where':_0x48f9f2[_0x1b8b('0x44')]})[_0x1b8b('0x27')](function(_0x4f1071){_0x52eda8[_0x1b8b('0x22')]=_0x4f1071;if(_0x491c52['query'][_0x1b8b('0xb8')]){_0x48f9f2[_0x1b8b('0xc3')]=[{'all':!![]}];}return db[_0x1b8b('0xc2')][_0x1b8b('0xc4')](_0x48f9f2);})[_0x1b8b('0x27')](function(_0x53c02a){_0x52eda8[_0x1b8b('0xb4')]=_0x53c02a;return _0x52eda8;});}})[_0x1b8b('0x27')](respondWithFilteredResult(_0x15ab35,_0x48f9f2))[_0x1b8b('0x33')](handleError(_0x15ab35,null));};exports[_0x1b8b('0xc5')]=function(_0x1e3369,_0x43180c,_0x426753){return db[_0x1b8b('0x35')][_0x1b8b('0x5e')]({'where':{'id':_0x1e3369[_0x1b8b('0xb6')]['id']}})['then'](handleEntityNotFound(_0x43180c,null))[_0x1b8b('0x27')](function(_0x12d7c9){if(_0x12d7c9){return _0x12d7c9[_0x1b8b('0xc6')](_0x1e3369[_0x1b8b('0x72')][_0x1b8b('0xbd')],_[_0x1b8b('0xbe')](_0x1e3369[_0x1b8b('0x72')],[_0x1b8b('0xbd'),'id'])||{})['spread'](function(){return db[_0x1b8b('0x6b')][_0x1b8b('0xc4')]({'attributes':['id','name',_0x1b8b('0x48')],'where':{'id':_0x1e3369['body'][_0x1b8b('0xbd')]}});})[_0x1b8b('0x27')](function(_0x3a9a7a){socket['emit'](_0x1b8b('0xc7'),{'id':Number(_0x1e3369[_0x1b8b('0xb6')]['id']),'tags':_0x3a9a7a||[]});return{'id':Number(_0x1e3369[_0x1b8b('0xb6')]['id']),'tags':_0x3a9a7a||[]};});}})[_0x1b8b('0x27')](respondWithResult(_0x43180c,null))[_0x1b8b('0x33')](handleError(_0x43180c,null));};exports[_0x1b8b('0xc8')]=function(_0x5d411d,_0x2a0847,_0x47c828){return db[_0x1b8b('0x35')][_0x1b8b('0x5e')]({'where':{'id':_0x5d411d[_0x1b8b('0xb6')]['id']}})[_0x1b8b('0x27')](handleEntityNotFound(_0x2a0847,null))[_0x1b8b('0x27')](function(_0x47d5d0){if(_0x47d5d0){return _0x47d5d0[_0x1b8b('0xc8')](_0x5d411d['query'][_0x1b8b('0xbd')]);}})[_0x1b8b('0x27')](respondWithStatusCode(_0x2a0847,null))['catch'](handleError(_0x2a0847,null));};exports[_0x1b8b('0xc9')]=function(_0x56c119,_0x5cd611){var _0x5ee03b=moment()['unix']()[_0x1b8b('0x9a')]();var _0x199327=path[_0x1b8b('0xca')](config['root'],'server',_0x1b8b('0xcb'),'tmp');var _0xdd25ae=path['join'](config[_0x1b8b('0xcc')],_0x1b8b('0xcd'),_0x1b8b('0xcb'),_0x1b8b('0xce'));var _0x36156c=path[_0x1b8b('0xca')](_0x199327,_0x5ee03b);var _0xc77a07=util[_0x1b8b('0xcf')](_0x1b8b('0xd0'),_0x56c119['params']['id'],_0x5ee03b);var _0x2683d6=path[_0x1b8b('0xca')](_0x199327,_0xc77a07);var _0x90ecf6=[];_0x90ecf6['push']({'model':db[_0x1b8b('0xd1')],'as':_0x1b8b('0xd1'),'raw':!![]});var _0x56aaf1=[{'model':db[_0x1b8b('0xc2')],'as':_0x1b8b('0xd2'),'attributes':['id',_0x1b8b('0x72'),_0x1b8b('0x79')],'include':_0x90ecf6}];return db[_0x1b8b('0x35')][_0x1b8b('0x5e')]({'where':{'id':_0x56c119[_0x1b8b('0xb6')]['id']},'include':_0x56aaf1})[_0x1b8b('0x27')](handleEntityNotFound(_0x5cd611,null))[_0x1b8b('0x27')](function(_0x2380e4){if(_0x2380e4&&_0x2380e4[_0x1b8b('0xd2')]){var _0x204a71=_0x2380e4['get']({'plain':!![]});fs['mkdirSync'](_0x36156c);for(var _0x7c5a2a=0x0;_0x7c5a2a<_0x204a71['Messages'][_0x1b8b('0x40')];_0x7c5a2a++){var _0x6b9850=_0x204a71['Messages'][_0x7c5a2a]['Attachment'];if(_0x6b9850){var _0xa7ec0a=path[_0x1b8b('0xca')](_0xdd25ae,_0x6b9850[_0x1b8b('0xd3')]);if(fs[_0x1b8b('0xd4')](_0xa7ec0a)){fs[_0x1b8b('0xd5')](_0xa7ec0a)[_0x1b8b('0xd6')](fs[_0x1b8b('0xd7')](path[_0x1b8b('0xca')](_0x36156c,_0x6b9850[_0x1b8b('0xd3')])));}}}return BPromise[_0x1b8b('0x92')]()['then'](function(){return new BPromise(function(_0x36ac86,_0x2a1954){zipdir(_0x36156c,{'saveTo':_0x2683d6},function(_0x5cd773,_0x1c7a0e){if(_0x5cd773)return _0x2a1954(_0x5cd773);return _0x36ac86(_0x1c7a0e);});})[_0x1b8b('0x27')](function(){return new BPromise(function(_0x3a98a0,_0x4a2751){rimraf(_0x36156c,function(_0x37b578){if(_0x37b578)_0x4a2751(_0x37b578);return _0x3a98a0();});});})[_0x1b8b('0x27')](function(){return _0x5cd611[_0x1b8b('0xc9')](_0x2683d6,_0xc77a07,function(_0x37e873){if(_0x37e873){console[_0x1b8b('0xd8')](_0x1b8b('0xd9'),_0x37e873);}else{fs['unlinkSync'](_0x2683d6);}});});});}else{return _0x5cd611[_0x1b8b('0x1b')](0xc8);}})[_0x1b8b('0x33')](handleError(_0x5cd611,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 7e45b53..98a1fc0 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 _0x46cf=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x3932dc,_0x1be802){var _0x1149de=function(_0x35f5ce){while(--_0x35f5ce){_0x3932dc['push'](_0x3932dc['shift']());}};_0x1149de(++_0x1be802);}(_0x46cf,0xda));var _0xf46c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46cf[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xf46c('0x0'));var FaxInteraction=require(_0xf46c('0x1'))['db'][_0xf46c('0x2')];var FaxMessage=require(_0xf46c('0x1'))['db'][_0xf46c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf46c('0x4')](0x0);var events={'afterCreate':_0xf46c('0x5'),'afterUpdate':_0xf46c('0x6'),'afterDestroy':_0xf46c('0x7')};function emitEvent(_0x53f07f){return function(_0x44535a,_0x2e919e,_0x2e873a){_0x44535a[_0xf46c('0x8')]({'attributes':['id'],'raw':!![]})[_0xf46c('0x9')](function(_0x3282e3){_0x44535a[_0xf46c('0xa')](_0xf46c('0xb'),_0x3282e3[_0xf46c('0xc')](function(_0x4fd916){return{'id':_0x4fd916['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x44535a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x48cd4b){_0x44535a[_0xf46c('0xa')](_0xf46c('0xd'),_0x48cd4b[_0xf46c('0xe')]);FaxInteractionEvents[_0xf46c('0xf')](_0x53f07f+':'+_0x44535a['id'],_0x44535a);FaxInteractionEvents['emit'](_0x53f07f,_0x44535a);_0x2e873a(null);})[_0xf46c('0x10')](_0x2e873a(null));};}for(var e in events){if(events[_0xf46c('0x11')](e)){var event=events[e];FaxInteraction[_0xf46c('0x12')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x44b7=['save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x44b7,0x19d));var _0x744b=function(_0x2db17a,_0x499db9){_0x2db17a=_0x2db17a-0x0;var _0x1544da=_0x44b7[_0x2db17a];return _0x1544da;};'use strict';var EventEmitter=require(_0x744b('0x0'));var FaxInteraction=require(_0x744b('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x744b('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x744b('0x2')](0x0);var events={'afterCreate':_0x744b('0x3'),'afterUpdate':_0x744b('0x4'),'afterDestroy':_0x744b('0x5')};function emitEvent(_0x29b16c){return function(_0x5c944c,_0x3fbdec,_0x1a6d18){_0x5c944c[_0x744b('0x6')]({'attributes':['id'],'raw':!![]})[_0x744b('0x7')](function(_0x412e68){_0x5c944c[_0x744b('0x8')](_0x744b('0x9'),_0x412e68[_0x744b('0xa')](function(_0x633696){return{'id':_0x633696['id']};}));return FaxMessage[_0x744b('0xb')]({'where':{'FaxInteractionId':_0x5c944c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x447b93){_0x5c944c['setDataValue'](_0x744b('0xc'),_0x447b93['length']);FaxInteractionEvents[_0x744b('0xd')](_0x29b16c+':'+_0x5c944c['id'],_0x5c944c);FaxInteractionEvents[_0x744b('0xd')](_0x29b16c,_0x5c944c);_0x1a6d18(null);})['catch'](_0x1a6d18(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x744b('0xe')](e,emitEvent(event));}}module[_0x744b('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f852755..baab02b 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 _0xd16c=['exports','FaxInteraction','closed','format','lodash','../../config/logger','api','bluebird','request-promise','./faxInteraction.attributes'];(function(_0x579428,_0x43af4c){var _0x18be75=function(_0x578d6f){while(--_0x578d6f){_0x579428['push'](_0x579428['shift']());}};_0x18be75(++_0x43af4c);}(_0xd16c,0xd6));var _0xcd16=function(_0x460a9c,_0xf0b2ec){_0x460a9c=_0x460a9c-0x0;var _0x2e247a=_0xd16c[_0x460a9c];return _0x2e247a;};'use strict';var _=require(_0xcd16('0x0'));var util=require('util');var logger=require(_0xcd16('0x1'))(_0xcd16('0x2'));var moment=require('moment');var BPromise=require(_0xcd16('0x3'));var rp=require(_0xcd16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd16('0x5'));module[_0xcd16('0x6')]=function(_0x5eb2ae,_0x5cd58a){return _0x5eb2ae['define'](_0xcd16('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b3134,_0x44c415,_0x5f0751){if(_0x4b3134['changed'](_0xcd16('0x8'))){_0x4b3134['closedAt']=moment()[_0xcd16('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5f0751(null,_0x4b3134);}}});}; \ No newline at end of file +var _0xc82c=['path','exports','FaxInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5f095a,_0x46da77){var _0x1d85fd=function(_0x473bbd){while(--_0x473bbd){_0x5f095a['push'](_0x5f095a['shift']());}};_0x1d85fd(++_0x46da77);}(_0xc82c,0x125));var _0xcc82=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc82c[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xcc82('0x0'));var util=require(_0xcc82('0x1'));var logger=require('../../config/logger')(_0xcc82('0x2'));var moment=require(_0xcc82('0x3'));var BPromise=require(_0xcc82('0x4'));var rp=require(_0xcc82('0x5'));var fs=require('fs');var path=require(_0xcc82('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xcc82('0x7')]=function(_0x232123,_0x5e828c){return _0x232123['define'](_0xcc82('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8efbe5,_0x1f138b,_0x43a467){if(_0x8efbe5['changed'](_0xcc82('0x9'))){_0x8efbe5[_0xcc82('0xa')]=moment()[_0xcc82('0xb')](_0xcc82('0xc'));}_0x43a467(null,_0x8efbe5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index dc3b702..ee8a54b 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 _0xa34b=['error','code','message','result','catch','body','options','raw','where','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ee2fa,_0x118e5a){var _0x718957=function(_0x57f4a8){while(--_0x57f4a8){_0x1ee2fa['push'](_0x1ee2fa['shift']());}};_0x718957(++_0x118e5a);}(_0xa34b,0xbc));var _0xba34=function(_0x2dfb25,_0x358b90){_0x2dfb25=_0x2dfb25-0x0;var _0x5947a6=_0xa34b[_0x2dfb25];return _0x5947a6;};'use strict';var _=require(_0xba34('0x0'));var util=require('util');var moment=require(_0xba34('0x1'));var BPromise=require('bluebird');var rs=require(_0xba34('0x2'));var fs=require('fs');var Redis=require(_0xba34('0x3'));var db=require(_0xba34('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba34('0x5'))(_0xba34('0x6'));var config=require(_0xba34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba34('0x8')]['http']({'port':0x232a});config[_0xba34('0x9')]=_[_0xba34('0xa')](config[_0xba34('0x9')],{'host':_0xba34('0xb'),'port':0x18eb});var socket=require(_0xba34('0xc'))(new Redis(config[_0xba34('0x9')]));require(_0xba34('0xd'))[_0xba34('0xe')](socket);function respondWithRpcPromise(_0x74e5d9,_0x468094,_0x5a9dd5){return new BPromise(function(_0x192cfc,_0x1d72bc){return client[_0xba34('0xf')](_0x74e5d9,_0x5a9dd5)['then'](function(_0x26a463){logger[_0xba34('0x10')](_0xba34('0x11'),_0x468094,_0xba34('0x12'));logger[_0xba34('0x13')](_0xba34('0x14'),_0x468094,_0xba34('0x12'),JSON[_0xba34('0x15')](_0x26a463));if(_0x26a463[_0xba34('0x16')]){if(_0x26a463[_0xba34('0x16')][_0xba34('0x17')]===0x1f4){logger[_0xba34('0x16')](_0xba34('0x11'),_0x468094,_0x26a463[_0xba34('0x16')][_0xba34('0x18')]);return _0x1d72bc(_0x26a463[_0xba34('0x16')][_0xba34('0x18')]);}logger['error'](_0xba34('0x11'),_0x468094,_0x26a463[_0xba34('0x16')][_0xba34('0x18')]);return _0x192cfc(_0x26a463['error'][_0xba34('0x18')]);}else{logger[_0xba34('0x10')](_0xba34('0x11'),_0x468094,'request\x20sent');_0x192cfc(_0x26a463[_0xba34('0x19')]['message']);}})[_0xba34('0x1a')](function(_0x81f29e){logger[_0xba34('0x16')](_0xba34('0x11'),_0x468094,_0x81f29e);_0x1d72bc(_0x81f29e);});});}exports['UpdateFaxInteraction']=function(_0xf49b5c){var _0x446054=this;return new Promise(function(_0x130a75,_0x21e35c){return db['FaxInteraction']['update'](_0xf49b5c[_0xba34('0x1b')],{'raw':_0xf49b5c['options']?_0xf49b5c[_0xba34('0x1c')][_0xba34('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf49b5c[_0xba34('0x1c')]?_0xf49b5c[_0xba34('0x1c')][_0xba34('0x1e')]||null:null,'attributes':_0xf49b5c['options']?_0xf49b5c[_0xba34('0x1c')]['attributes']||null:null,'limit':_0xf49b5c[_0xba34('0x1c')]?_0xf49b5c['options'][_0xba34('0x1f')]||null:null})[_0xba34('0x20')](function(_0x3bc456){logger['info'](_0xba34('0x21'),_0xf49b5c);logger[_0xba34('0x13')]('UpdateFaxInteraction',_0xf49b5c,JSON[_0xba34('0x15')](_0x3bc456));_0x130a75(_0x3bc456);})[_0xba34('0x1a')](function(_0x14ec3f){logger[_0xba34('0x16')](_0xba34('0x21'),_0x14ec3f[_0xba34('0x18')],_0xf49b5c);_0x21e35c(_0x446054['error'](0x1f4,_0x14ec3f[_0xba34('0x18')]));});});};exports[_0xba34('0x22')]=function(_0x4fc048){return new Promise(function(_0x4384a6,_0x11e6ee){return db[_0xba34('0x23')][_0xba34('0x24')]({'where':_0x4fc048[_0xba34('0x1c')]?_0x4fc048[_0xba34('0x1c')][_0xba34('0x1e')]||null:null})['then'](function(_0x52737e){if(_0x52737e){return _0x52737e[_0xba34('0x25')](_0x4fc048[_0xba34('0x1b')][_0xba34('0x26')],_[_0xba34('0x27')](_0x4fc048['body'],['ids','id'])||{});}})[_0xba34('0x28')](function(_0x3b6eff){logger['info'](_0xba34('0x29'),_0x4fc048);logger[_0xba34('0x13')]('AddTags',_0x4fc048,JSON[_0xba34('0x15')](_0x3b6eff));_0x4384a6(_0x3b6eff);})['catch'](function(_0x2439d5){logger['error'](_0xba34('0x29'),_0x2439d5[_0xba34('0x18')],_0x4fc048);_0x11e6ee(_this[_0xba34('0x16')](0x1f4,_0x2439d5['message']));});});}; \ No newline at end of file +var _0x3c2e=['debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','defaults','redis','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x3c2e,0xde));var _0xe3c2=function(_0x34dca9,_0x165671){_0x34dca9=_0x34dca9-0x0;var _0xfdcc85=_0x3c2e[_0x34dca9];return _0xfdcc85;};'use strict';var _=require('lodash');var util=require(_0xe3c2('0x0'));var moment=require('moment');var BPromise=require(_0xe3c2('0x1'));var rs=require(_0xe3c2('0x2'));var fs=require('fs');var Redis=require(_0xe3c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3c2('0x4'));var logger=require(_0xe3c2('0x5'))(_0xe3c2('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe3c2('0x7')]({'port':0x232a});config['redis']=_[_0xe3c2('0x8')](config[_0xe3c2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3c2('0xa'))(new Redis(config[_0xe3c2('0x9')]));require(_0xe3c2('0xb'))[_0xe3c2('0xc')](socket);function respondWithRpcPromise(_0x35774d,_0x387579,_0x299d5a){return new BPromise(function(_0x4ab51e,_0x39988f){return client[_0xe3c2('0xd')](_0x35774d,_0x299d5a)[_0xe3c2('0xe')](function(_0x26d561){logger[_0xe3c2('0xf')](_0xe3c2('0x10'),_0x387579,_0xe3c2('0x11'));logger[_0xe3c2('0x12')](_0xe3c2('0x13'),_0x387579,_0xe3c2('0x11'),JSON[_0xe3c2('0x14')](_0x26d561));if(_0x26d561['error']){if(_0x26d561[_0xe3c2('0x15')][_0xe3c2('0x16')]===0x1f4){logger[_0xe3c2('0x15')](_0xe3c2('0x10'),_0x387579,_0x26d561[_0xe3c2('0x15')][_0xe3c2('0x17')]);return _0x39988f(_0x26d561[_0xe3c2('0x15')][_0xe3c2('0x17')]);}logger[_0xe3c2('0x15')](_0xe3c2('0x10'),_0x387579,_0x26d561[_0xe3c2('0x15')][_0xe3c2('0x17')]);return _0x4ab51e(_0x26d561[_0xe3c2('0x15')][_0xe3c2('0x17')]);}else{logger[_0xe3c2('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x387579,'request\x20sent');_0x4ab51e(_0x26d561['result'][_0xe3c2('0x17')]);}})[_0xe3c2('0x18')](function(_0x274c2c){logger[_0xe3c2('0x15')](_0xe3c2('0x10'),_0x387579,_0x274c2c);_0x39988f(_0x274c2c);});});}exports[_0xe3c2('0x19')]=function(_0x1dde19){var _0x5a5afe=this;return new Promise(function(_0x42efe5,_0x4a1b19){return db[_0xe3c2('0x1a')][_0xe3c2('0x1b')](_0x1dde19[_0xe3c2('0x1c')],{'raw':_0x1dde19[_0xe3c2('0x1d')]?_0x1dde19['options'][_0xe3c2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dde19[_0xe3c2('0x1d')]?_0x1dde19[_0xe3c2('0x1d')][_0xe3c2('0x1f')]||null:null,'attributes':_0x1dde19[_0xe3c2('0x1d')]?_0x1dde19[_0xe3c2('0x1d')][_0xe3c2('0x20')]||null:null,'limit':_0x1dde19[_0xe3c2('0x1d')]?_0x1dde19[_0xe3c2('0x1d')]['limit']||null:null})[_0xe3c2('0xe')](function(_0x4f42e2){logger[_0xe3c2('0xf')](_0xe3c2('0x19'),_0x1dde19);logger[_0xe3c2('0x12')]('UpdateFaxInteraction',_0x1dde19,JSON['stringify'](_0x4f42e2));_0x42efe5(_0x4f42e2);})[_0xe3c2('0x18')](function(_0x759051){logger['error'](_0xe3c2('0x19'),_0x759051[_0xe3c2('0x17')],_0x1dde19);_0x4a1b19(_0x5a5afe[_0xe3c2('0x15')](0x1f4,_0x759051[_0xe3c2('0x17')]));});});};exports[_0xe3c2('0x21')]=function(_0x498870){return new Promise(function(_0x257b15,_0xe28f4b){return db[_0xe3c2('0x1a')][_0xe3c2('0x22')]({'where':_0x498870[_0xe3c2('0x1d')]?_0x498870[_0xe3c2('0x1d')][_0xe3c2('0x1f')]||null:null})[_0xe3c2('0xe')](function(_0x359480){if(_0x359480){return _0x359480[_0xe3c2('0x23')](_0x498870[_0xe3c2('0x1c')][_0xe3c2('0x24')],_[_0xe3c2('0x25')](_0x498870[_0xe3c2('0x1c')],[_0xe3c2('0x24'),'id'])||{});}})[_0xe3c2('0x26')](function(_0x27db9a){logger[_0xe3c2('0xf')](_0xe3c2('0x27'),_0x498870);logger['debug'](_0xe3c2('0x27'),_0x498870,JSON[_0xe3c2('0x14')](_0x27db9a));_0x257b15(_0x27db9a);})[_0xe3c2('0x18')](function(_0x5443a1){logger[_0xe3c2('0x15')](_0xe3c2('0x27'),_0x5443a1['message'],_0x498870);_0xe28f4b(_this[_0xe3c2('0x15')](0x1f4,_0x5443a1['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 8c028c4..a6af53c 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 _0xe8a3=['register','faxInteraction:','./faxInteraction.events','save','remove','removeListener'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0xe8a3,0x110));var _0x3e8a=function(_0x3bbde7,_0x344127){_0x3bbde7=_0x3bbde7-0x0;var _0x117992=_0xe8a3[_0x3bbde7];return _0x117992;};'use strict';var FaxInteractionEvents=require(_0x3e8a('0x0'));var events=[_0x3e8a('0x1'),_0x3e8a('0x2'),'update'];function createListener(_0x6e80e1,_0x41c174){return function(_0x3c9be3){_0x41c174['emit'](_0x6e80e1,_0x3c9be3);};}function removeListener(_0x29741d,_0xd3ad61){return function(){FaxInteractionEvents[_0x3e8a('0x3')](_0x29741d,_0xd3ad61);};}exports[_0x3e8a('0x4')]=function(_0x24dd89){for(var _0x3c82b5=0x0,_0x8941d3=events['length'];_0x3c82b5<_0x8941d3;_0x3c82b5++){var _0x442586=events[_0x3c82b5];var _0x1a5326=createListener(_0x3e8a('0x5')+_0x442586,_0x24dd89);FaxInteractionEvents['on'](_0x442586,_0x1a5326);}}; \ No newline at end of file +var _0x1700=['save','update','emit','register','length','faxInteraction:'];(function(_0x272ae3,_0x2b182e){var _0x3eefbe=function(_0x3f9cab){while(--_0x3f9cab){_0x272ae3['push'](_0x272ae3['shift']());}};_0x3eefbe(++_0x2b182e);}(_0x1700,0x1f2));var _0x0170=function(_0x30216b,_0x47f127){_0x30216b=_0x30216b-0x0;var _0x39af8c=_0x1700[_0x30216b];return _0x39af8c;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x0170('0x0'),'remove',_0x0170('0x1')];function createListener(_0x1cbb59,_0x5b5031){return function(_0x1fe1ab){_0x5b5031[_0x0170('0x2')](_0x1cbb59,_0x1fe1ab);};}function removeListener(_0x325c2a,_0x5098be){return function(){FaxInteractionEvents['removeListener'](_0x325c2a,_0x5098be);};}exports[_0x0170('0x3')]=function(_0x4101aa){for(var _0x109069=0x0,_0xf32da7=events[_0x0170('0x4')];_0x109069<_0xf32da7;_0x109069++){var _0x9cb514=events[_0x109069];var _0x46cc15=createListener(_0x0170('0x5')+_0x9cb514,_0x4101aa);FaxInteractionEvents['on'](_0x9cb514,_0x46cc15);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index a20d639..3e7bc00 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 _0x680e=['get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','fax','faxinteraction:update','update','destroy','delete','removeTags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x5546fb,_0x574452){var _0x26a624=function(_0x303d86){while(--_0x303d86){_0x5546fb['push'](_0x5546fb['shift']());}};_0x26a624(++_0x574452);}(_0x680e,0x170));var _0xe680=function(_0x393d5b,_0x38ebb8){_0x393d5b=_0x393d5b-0x0;var _0x37fb8b=_0x680e[_0x393d5b];return _0x37fb8b;};'use strict';var multer=require(_0xe680('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe680('0x1'));var express=require(_0xe680('0x2'));var router=express[_0xe680('0x3')]();var fs_extra=require(_0xe680('0x4'));var auth=require(_0xe680('0x5'));var interaction=require(_0xe680('0x6'));var config=require(_0xe680('0x7'));var controller=require(_0xe680('0x8'));router[_0xe680('0x9')]('/',auth[_0xe680('0xa')](),controller[_0xe680('0xb')]);router[_0xe680('0x9')](_0xe680('0xc'),auth[_0xe680('0xa')](),controller[_0xe680('0xd')]);router[_0xe680('0x9')](_0xe680('0xe'),auth[_0xe680('0xa')](),controller['show']);router[_0xe680('0x9')](_0xe680('0xf'),auth['isAuthenticated'](),controller[_0xe680('0x10')]);router[_0xe680('0x9')](_0xe680('0x11'),auth[_0xe680('0xa')](),controller['download']);router[_0xe680('0x12')]('/',auth[_0xe680('0xa')](),controller[_0xe680('0x13')]);router[_0xe680('0x12')]('/:id/messages',auth[_0xe680('0xa')](),controller['addMessage']);router['post'](_0xe680('0x14'),auth['isAuthenticated'](),interaction[_0xe680('0x15')]('fax','faxinteraction:addtags'),controller['addTags']);router['put']('/:id',auth[_0xe680('0xa')](),interaction[_0xe680('0x15')](_0xe680('0x16'),_0xe680('0x17')),controller[_0xe680('0x18')]);router['delete'](_0xe680('0xe'),auth[_0xe680('0xa')](),interaction[_0xe680('0x15')](_0xe680('0x16'),'faxinteraction:destroy'),controller[_0xe680('0x19')]);router[_0xe680('0x1a')](_0xe680('0x14'),auth['isAuthenticated'](),controller[_0xe680('0x1b')]);module[_0xe680('0x1c')]=router; \ No newline at end of file +var _0xbb6e=['delete','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0xbb6e,0xe4));var _0xebb6=function(_0x20e089,_0x565676){_0x20e089=_0x20e089-0x0;var _0x56b03b=_0xbb6e[_0x20e089];return _0x56b03b;};'use strict';var multer=require(_0xebb6('0x0'));var util=require(_0xebb6('0x1'));var path=require(_0xebb6('0x2'));var timeout=require(_0xebb6('0x3'));var express=require('express');var router=express[_0xebb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xebb6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xebb6('0x6'));var controller=require(_0xebb6('0x7'));router[_0xebb6('0x8')]('/',auth['isAuthenticated'](),controller[_0xebb6('0x9')]);router[_0xebb6('0x8')](_0xebb6('0xa'),auth[_0xebb6('0xb')](),controller['describe']);router['get'](_0xebb6('0xc'),auth[_0xebb6('0xb')](),controller[_0xebb6('0xd')]);router[_0xebb6('0x8')](_0xebb6('0xe'),auth[_0xebb6('0xb')](),controller[_0xebb6('0xf')]);router[_0xebb6('0x8')](_0xebb6('0x10'),auth[_0xebb6('0xb')](),controller[_0xebb6('0x11')]);router[_0xebb6('0x12')]('/',auth['isAuthenticated'](),controller[_0xebb6('0x13')]);router[_0xebb6('0x12')](_0xebb6('0xe'),auth[_0xebb6('0xb')](),controller[_0xebb6('0x14')]);router[_0xebb6('0x12')](_0xebb6('0x15'),auth[_0xebb6('0xb')](),interaction[_0xebb6('0x16')](_0xebb6('0x17'),_0xebb6('0x18')),controller[_0xebb6('0x19')]);router['put'](_0xebb6('0xc'),auth['isAuthenticated'](),interaction[_0xebb6('0x16')](_0xebb6('0x17'),_0xebb6('0x1a')),controller[_0xebb6('0x1b')]);router[_0xebb6('0x1c')]('/:id',auth[_0xebb6('0xb')](),interaction[_0xebb6('0x16')](_0xebb6('0x17'),_0xebb6('0x1d')),controller[_0xebb6('0x1e')]);router[_0xebb6('0x1c')](_0xebb6('0x15'),auth[_0xebb6('0xb')](),controller[_0xebb6('0x1f')]);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 2d70a56..eaf63ac 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 _0x9224=['out','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4b4479,_0x412664){var _0x2f90b0=function(_0x416d19){while(--_0x416d19){_0x4b4479['push'](_0x4b4479['shift']());}};_0x2f90b0(++_0x412664);}(_0x9224,0xa3));var _0x4922=function(_0x3350fb,_0x5cded5){_0x3350fb=_0x3350fb-0x0;var _0x4f399b=_0x9224[_0x3350fb];return _0x4f399b;};'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 +var _0xb4e6=['ENUM','out','sequelize','TEXT','medium','BOOLEAN'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xb4e6[_0x2aefb6];return _0x202772;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'body':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6b4e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b4e('0x4')]('in',_0x6b4e('0x5')),'defaultValue':_0x6b4e('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6b4e('0x1')],'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 c21ce87..3c876ff 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 _0x1821=['fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','rejectmessage','create','CmContact','findOne','isNil','Attachment','SendFax','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','body','find','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','message','FaxInteraction','FaxInteractionId','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User'];(function(_0x429cfc,_0x38de1a){var _0xfa4273=function(_0x29ab73){while(--_0x29ab73){_0x429cfc['push'](_0x429cfc['shift']());}};_0xfa4273(++_0x38de1a);}(_0x1821,0xb0));var _0x1182=function(_0x8179a3,_0x27e1d2){_0x8179a3=_0x8179a3-0x0;var _0x14ed5a=_0x1821[_0x8179a3];return _0x14ed5a;};'use strict';var emlformat=require(_0x1182('0x0'));var rimraf=require(_0x1182('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1182('0x2'));var Mustache=require(_0x1182('0x3'));var util=require(_0x1182('0x4'));var path=require(_0x1182('0x5'));var sox=require(_0x1182('0x6'));var csv=require(_0x1182('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1182('0x8'));var _=require(_0x1182('0x9'));var squel=require(_0x1182('0xa'));var crypto=require(_0x1182('0xb'));var jsforce=require(_0x1182('0xc'));var deskjs=require(_0x1182('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1182('0xe'));var Redis=require(_0x1182('0xf'));var authService=require(_0x1182('0x10'));var qs=require(_0x1182('0x11'));var as=require(_0x1182('0x12'));var hardwareService=require(_0x1182('0x13'));var logger=require('../../config/logger')(_0x1182('0x14'));var utils=require(_0x1182('0x15'));var config=require(_0x1182('0x16'));var licenseUtil=require(_0x1182('0x17'));var db=require(_0x1182('0x18'))['db'];config['redis']=_['defaults'](config[_0x1182('0x19')],{'host':_0x1182('0x1a'),'port':0x18eb});var socket=require(_0x1182('0x1b'))(new Redis(config[_0x1182('0x19')]));require(_0x1182('0x1c'))[_0x1182('0x1d')](socket);var jayson=require(_0x1182('0x1e'));var client=jayson[_0x1182('0x1f')][_0x1182('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x1182('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4a8e1f,_0x36e86a,_0x1dc907,_0x4affcf){return new BPromise(function(_0xb5f526,_0xba2377){var _0x7e2980=_0x4affcf||client;return _0x7e2980[_0x1182('0x21')](_0x4a8e1f,_0x1dc907)[_0x1182('0x22')](function(_0x1e238a){logger[_0x1182('0x23')]('FaxMessage,\x20%s,\x20%s',_0x36e86a,_0x1182('0x24'));logger[_0x1182('0x25')](_0x1182('0x26'),_0x36e86a,_0x1182('0x24'),JSON[_0x1182('0x27')](_0x1e238a));if(_0x1e238a['error']){if(_0x1e238a[_0x1182('0x28')][_0x1182('0x29')]===0x1f4){logger[_0x1182('0x28')]('FaxMessage,\x20%s,\x20%s',_0x36e86a,_0x1e238a[_0x1182('0x28')]['message']);return _0xba2377(_0x1e238a['error']['message']);}logger[_0x1182('0x28')](_0x1182('0x2a'),_0x36e86a,_0x1e238a['error']['message']);return _0xb5f526(_0x1e238a[_0x1182('0x28')]['message']);}else{logger[_0x1182('0x23')]('FaxMessage,\x20%s,\x20%s',_0x36e86a,'request\x20sent');_0xb5f526(_0x1e238a[_0x1182('0x2b')]['message']);}})[_0x1182('0x2c')](function(_0x640cb8){logger[_0x1182('0x28')](_0x1182('0x2a'),_0x36e86a,_0x640cb8);_0xba2377(_0x640cb8);});});}function respondWithStatusCode(_0x3f7cda,_0x47d8c2){_0x47d8c2=_0x47d8c2||0xcc;return function(_0x35afb1){if(_0x35afb1){return _0x3f7cda[_0x1182('0x2d')](_0x47d8c2);}return _0x3f7cda[_0x1182('0x2e')](_0x47d8c2)[_0x1182('0x2f')]();};}function respondWithResult(_0x4f9bc5,_0x1d46ca){_0x1d46ca=_0x1d46ca||0xc8;return function(_0x2c2cbf){if(_0x2c2cbf){return _0x4f9bc5['status'](_0x1d46ca)['json'](_0x2c2cbf);}};}function respondWithFilteredResult(_0x1d0a22,_0x3cfd9b){return function(_0x2f5376){if(_0x2f5376){var _0x2ffe13=typeof _0x3cfd9b[_0x1182('0x30')]==='undefined'&&typeof _0x3cfd9b[_0x1182('0x31')]===_0x1182('0x32');var _0x5534af=_0x2f5376[_0x1182('0x33')];var _0x4b6ca3=_0x2ffe13?0x0:_0x3cfd9b[_0x1182('0x30')];var _0x18c5a0=_0x2ffe13?_0x2f5376['count']:_0x3cfd9b[_0x1182('0x30')]+_0x3cfd9b[_0x1182('0x31')];var _0x3a5a4f;if(_0x18c5a0>=_0x5534af){_0x18c5a0=_0x5534af;_0x3a5a4f=0xc8;}else{_0x3a5a4f=0xce;}_0x1d0a22[_0x1182('0x2e')](_0x3a5a4f);return _0x1d0a22[_0x1182('0x34')]('Content-Range',_0x4b6ca3+'-'+_0x18c5a0+'/'+_0x5534af)['json'](_0x2f5376);}return null;};}function patchUpdates(_0x2fb254){return function(_0x263e65){try{jsonpatch[_0x1182('0x35')](_0x263e65,_0x2fb254,!![]);}catch(_0x56000a){return BPromise[_0x1182('0x36')](_0x56000a);}return _0x263e65[_0x1182('0x37')]();};}function saveUpdates(_0x4b3219,_0x584f61){return function(_0x26a083){if(_0x26a083){return _0x26a083[_0x1182('0x38')](_0x4b3219)[_0x1182('0x22')](function(_0x2081ba){return _0x2081ba;});}return null;};}function removeEntity(_0x24f58e,_0x4bc49f){return function(_0xa44db0){if(_0xa44db0){return _0xa44db0[_0x1182('0x39')]()['then'](function(){_0x24f58e[_0x1182('0x2e')](0xcc)[_0x1182('0x2f')]();});}};}function handleEntityNotFound(_0x1b3230,_0x415c58){return function(_0x4c64db){if(!_0x4c64db){_0x1b3230['sendStatus'](0x194);}return _0x4c64db;};}function handleError(_0x2ec9c2,_0x2c779d){_0x2c779d=_0x2c779d||0x1f4;return function(_0x5f292c){logger[_0x1182('0x28')](_0x5f292c[_0x1182('0x3a')]);if(_0x5f292c['name']){delete _0x5f292c[_0x1182('0x3b')];}_0x2ec9c2[_0x1182('0x2e')](_0x2c779d)[_0x1182('0x3c')](_0x5f292c);};}exports[_0x1182('0x3d')]=function(_0x280b1b,_0x2edee0){var _0x2edcfd={},_0x5a0a0b={},_0x25f200={'count':0x0,'rows':[]};var _0x214031=_[_0x1182('0x3e')](db[_0x1182('0x3f')][_0x1182('0x40')],function(_0x4cef0e){return{'name':_0x4cef0e['fieldName'],'type':_0x4cef0e['type']['key']};});_0x5a0a0b[_0x1182('0x41')]=_[_0x1182('0x3e')](_0x214031,_0x1182('0x3b'));_0x5a0a0b['query']=_[_0x1182('0x42')](_0x280b1b[_0x1182('0x43')]);_0x5a0a0b[_0x1182('0x44')]=_[_0x1182('0x45')](_0x5a0a0b[_0x1182('0x41')],_0x5a0a0b['query']);_0x2edcfd[_0x1182('0x46')]=_['intersection'](_0x5a0a0b[_0x1182('0x41')],qs['fields'](_0x280b1b[_0x1182('0x43')]['fields']));_0x2edcfd[_0x1182('0x46')]=_0x2edcfd[_0x1182('0x46')][_0x1182('0x47')]?_0x2edcfd[_0x1182('0x46')]:_0x5a0a0b[_0x1182('0x41')];if(!_0x280b1b[_0x1182('0x43')][_0x1182('0x48')](_0x1182('0x49'))){_0x2edcfd[_0x1182('0x31')]=qs[_0x1182('0x31')](_0x280b1b[_0x1182('0x43')][_0x1182('0x31')]);_0x2edcfd['offset']=qs[_0x1182('0x30')](_0x280b1b['query'][_0x1182('0x30')]);}_0x2edcfd['order']=qs['sort'](_0x280b1b[_0x1182('0x43')][_0x1182('0x4a')]);_0x2edcfd[_0x1182('0x4b')]=qs['filters'](_['pick'](_0x280b1b[_0x1182('0x43')],_0x5a0a0b[_0x1182('0x44')]),_0x214031);if(_0x280b1b[_0x1182('0x43')][_0x1182('0x4c')]){_0x2edcfd[_0x1182('0x4b')]=_[_0x1182('0x4d')](_0x2edcfd['where'],{'$or':_[_0x1182('0x3e')](_0x214031,function(_0x16ed55){if(_0x16ed55['type']!==_0x1182('0x4e')){var _0x3d098a={};_0x3d098a[_0x16ed55[_0x1182('0x3b')]]={'$like':'%'+_0x280b1b[_0x1182('0x43')][_0x1182('0x4c')]+'%'};return _0x3d098a;}})});}_0x2edcfd=_[_0x1182('0x4d')]({},_0x2edcfd,_0x280b1b[_0x1182('0x4f')]);var _0x170d2f={'where':_0x2edcfd[_0x1182('0x4b')]};return db[_0x1182('0x3f')]['count'](_0x170d2f)['then'](function(_0xd354a8){_0x25f200['count']=_0xd354a8;if(_0x280b1b[_0x1182('0x43')][_0x1182('0x50')]){_0x2edcfd[_0x1182('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0x1182('0x52')](_0x2edcfd);})[_0x1182('0x22')](function(_0x23e7ed){_0x25f200[_0x1182('0x53')]=_0x23e7ed;return _0x25f200;})[_0x1182('0x22')](respondWithFilteredResult(_0x2edee0,_0x2edcfd))['catch'](handleError(_0x2edee0,null));};exports[_0x1182('0x54')]=function(_0x1c257e,_0x1d7658){var _0x38a5bf={'raw':!![],'where':{'id':_0x1c257e[_0x1182('0x55')]['id']}},_0x41634c={};_0x41634c[_0x1182('0x41')]=_['keys'](db[_0x1182('0x3f')][_0x1182('0x40')]);_0x41634c['query']=_['keys'](_0x1c257e['query']);_0x41634c[_0x1182('0x44')]=_[_0x1182('0x45')](_0x41634c['model'],_0x41634c[_0x1182('0x43')]);_0x38a5bf[_0x1182('0x46')]=_[_0x1182('0x45')](_0x41634c[_0x1182('0x41')],qs['fields'](_0x1c257e['query'][_0x1182('0x56')]));_0x38a5bf['attributes']=_0x38a5bf['attributes']['length']?_0x38a5bf['attributes']:_0x41634c[_0x1182('0x41')];if(_0x1c257e[_0x1182('0x43')][_0x1182('0x50')]){_0x38a5bf[_0x1182('0x51')]=[{'all':!![]}];}_0x38a5bf=_[_0x1182('0x4d')]({},_0x38a5bf,_0x1c257e[_0x1182('0x4f')]);return db[_0x1182('0x3f')]['find'](_0x38a5bf)['then'](handleEntityNotFound(_0x1d7658,null))[_0x1182('0x22')](respondWithResult(_0x1d7658,null))[_0x1182('0x2c')](handleError(_0x1d7658,null));};exports[_0x1182('0x38')]=function(_0x47b5ee,_0x39cbed){if(_0x47b5ee['body']['id']){delete _0x47b5ee[_0x1182('0x57')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x47b5ee[_0x1182('0x55')]['id']}})[_0x1182('0x22')](handleEntityNotFound(_0x39cbed,null))[_0x1182('0x22')](saveUpdates(_0x47b5ee[_0x1182('0x57')],null))['then'](respondWithResult(_0x39cbed,null))[_0x1182('0x2c')](handleError(_0x39cbed,null));};exports[_0x1182('0x39')]=function(_0x5b7394,_0x2755e5){return db[_0x1182('0x3f')][_0x1182('0x58')]({'where':{'id':_0x5b7394[_0x1182('0x55')]['id']}})[_0x1182('0x22')](handleEntityNotFound(_0x2755e5,null))[_0x1182('0x22')](removeEntity(_0x2755e5,null))[_0x1182('0x2c')](handleError(_0x2755e5,null));};exports[_0x1182('0x59')]=function(_0x714004,_0x32b48c){return db[_0x1182('0x3f')][_0x1182('0x59')]()[_0x1182('0x22')](respondWithResult(_0x32b48c,null))[_0x1182('0x2c')](handleError(_0x32b48c,null));};var interaction_log=require(_0x1182('0x5a'))(_0x1182('0x5b'));exports[_0x1182('0x5c')]=function(_0x4e41f7,_0x41ed84,_0x58c016){var _0x4c8ebc={'agent':{},'channel':_0x1182('0x5d')};if(_0x4e41f7[_0x1182('0x57')]['id']){delete _0x4e41f7[_0x1182('0x57')]['id'];}_0x4e41f7[_0x1182('0x57')][_0x1182('0x5e')]=!![];_0x4e41f7[_0x1182('0x57')][_0x1182('0x5f')]=moment()['format'](_0x1182('0x60'));_0x4e41f7[_0x1182('0x57')]['UserId']=_0x4e41f7['body'][_0x1182('0x61')]||_0x4e41f7[_0x1182('0x62')]['id'];_0x4c8ebc[_0x1182('0x63')]['id']=_0x4e41f7[_0x1182('0x57')][_0x1182('0x61')];return db['FaxMessage']['find']({'where':{'id':_0x4e41f7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x41ed84,null))[_0x1182('0x22')](saveUpdates(_0x4e41f7[_0x1182('0x57')],null))[_0x1182('0x22')](function(_0x2612c9){if(_0x2612c9){_0x4c8ebc[_0x1182('0x64')]=_0x2612c9['get']({'plain':!![]});return db[_0x1182('0x65')][_0x1182('0x58')]({'where':{'id':_0x2612c9[_0x1182('0x66')]}});}return null;})[_0x1182('0x22')](handleEntityNotFound(_0x41ed84,null))['then'](function(_0x14fd06){if(_0x14fd06){return _0x14fd06[_0x1182('0x38')]({'UserId':_0x4e41f7[_0x1182('0x57')][_0x1182('0x61')],'read1stAt':_['isNil'](_0x14fd06['read1stAt'])?moment()[_0x1182('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1182('0x22')](function(_0x13bf4b){if(_0x13bf4b){_0x4c8ebc[_0x1182('0x68')]=_0x13bf4b[_0x1182('0x69')]({'plain':!![]});interaction_log[_0x1182('0x23')](_0x1182('0x6a'),_0x4e41f7['user']['id'],_0x4e41f7[_0x1182('0x62')][_0x1182('0x3b')],_0x4e41f7[_0x1182('0x62')]['role'],_0x4c8ebc['interaction']['id'],_0x4e41f7[_0x1182('0x57')]?JSON[_0x1182('0x27')](_0x4e41f7[_0x1182('0x57')]):_0x1182('0x6b'));return respondWithRpcPromise(_0x1182('0x6c'),_0x1182('0x6d'),_0x4c8ebc);}return null;})['then'](function(_0x4e011e){var _0x49a2c9=_0x1182('0x6e')+_0x4e011e[_0x1182('0x64')][_0x1182('0x6f')];return db['sequelize'][_0x1182('0x43')](_0x49a2c9,{'type':db[_0x1182('0x70')][_0x1182('0x71')][_0x1182('0x72')],'raw':!![]})[_0x1182('0x22')](function(_0x5ddbd8){return _0x5ddbd8;});})['then'](function(_0x4071b0){if(_0x4071b0){_0x4c8ebc[_0x1182('0x64')]['contact']=_0x4071b0[0x0];if(!_0x4e41f7[_0x1182('0x57')]['UserId'])return;return db[_0x1182('0x73')][_0x1182('0x58')]({'where':{'id':_0x4e41f7['body'][_0x1182('0x61')],'role':_0x1182('0x63')},'attributes':['id','name',_0x1182('0x74'),_0x1182('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x313fe1){if(!_0x313fe1)return null;_0x4c8ebc[_0x1182('0x64')]['agent']=_0x313fe1;return _0x4c8ebc;})[_0x1182('0x22')](function(_0x58ecea){if(_0x58ecea){if(_0x4e41f7['body'][_0x1182('0x76')]){_0x4c8ebc[_0x1182('0x64')][_0x1182('0x77')]=util[_0x1182('0x67')](_0x1182('0x78'),_0x4e41f7['user'][_0x1182('0x3b')]);_0x4c8ebc[_0x1182('0x64')][_0x1182('0x79')]=_0x4c8ebc[_0x1182('0x79')];_0x4c8ebc[_0x1182('0x64')][_0x1182('0x7a')]=_0x4c8ebc[_0x1182('0x79')];_0x4c8ebc[_0x1182('0x64')][_0x1182('0x7b')]=_0x1182('0x5c');return respondWithRpcPromise(_0x1182('0x7c'),_0x1182('0x7c'),{'event':_0x1182('0x7d'),'message':_0x4c8ebc[_0x1182('0x64')]},client9002)[_0x1182('0x22')](function(){return _0x4c8ebc;});}return _0x4c8ebc;}return null;})['then'](respondWithResult(_0x41ed84,null))[_0x1182('0x2c')](handleError(_0x41ed84,null));};var interaction_log=require('../../config/logger')(_0x1182('0x5b'));exports[_0x1182('0x36')]=function(_0x242225,_0x37e636,_0x201a7e){var _0x276d79={'agent':{},'channel':_0x1182('0x5d')};if(_0x242225[_0x1182('0x57')]['id']){delete _0x242225[_0x1182('0x57')]['id'];}_0x242225[_0x1182('0x57')][_0x1182('0x61')]=_0x242225[_0x1182('0x57')][_0x1182('0x61')]||_0x242225[_0x1182('0x62')]['id'];_0x276d79[_0x1182('0x63')]['id']=_0x242225[_0x1182('0x57')][_0x1182('0x61')];return db[_0x1182('0x3f')][_0x1182('0x58')]({'where':{'id':_0x242225['params']['id'],'UserId':null}})[_0x1182('0x22')](handleEntityNotFound(_0x37e636,null))['then'](function(_0x13d2f7){if(_0x13d2f7){_0x276d79[_0x1182('0x64')]=_0x13d2f7[_0x1182('0x69')]({'plain':!![]});return db[_0x1182('0x65')][_0x1182('0x58')]({'where':{'id':_0x13d2f7['FaxInteractionId']}});}return null;})[_0x1182('0x22')](handleEntityNotFound(_0x37e636,null))['then'](function(_0x75b244){if(_0x75b244){_0x276d79[_0x1182('0x68')]=_0x75b244[_0x1182('0x69')]({'plain':!![]});interaction_log['info'](_0x1182('0x7e'),_0x242225[_0x1182('0x62')]['id'],_0x242225[_0x1182('0x62')][_0x1182('0x3b')],_0x242225[_0x1182('0x62')][_0x1182('0x7f')],_0x276d79[_0x1182('0x68')]['id'],_0x242225['body']?JSON['stringify'](_0x242225[_0x1182('0x57')]):_0x1182('0x6b'));return respondWithRpcPromise(_0x1182('0x80'),_0x1182('0x81'),_0x276d79);}return null;})[_0x1182('0x22')](function(_0x4603ee){var _0x19652d=_0x1182('0x6e')+_0x4603ee[_0x1182('0x64')]['ContactId'];return db[_0x1182('0x82')][_0x1182('0x43')](_0x19652d,{'type':db[_0x1182('0x70')][_0x1182('0x71')][_0x1182('0x72')],'raw':!![]})['then'](function(_0x4580ea){return _0x4580ea;});})[_0x1182('0x22')](function(_0x22bf8b){if(_0x22bf8b){_0x276d79[_0x1182('0x64')]['contact']=_0x22bf8b[0x0];if(!_0x242225['body'][_0x1182('0x61')])return;return db[_0x1182('0x73')]['find']({'where':{'id':_0x242225[_0x1182('0x57')][_0x1182('0x61')],'role':_0x1182('0x63')},'attributes':['id',_0x1182('0x3b'),_0x1182('0x74'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x45ff4c){if(!_0x45ff4c)return null;_0x276d79[_0x1182('0x64')]['agent']=_0x45ff4c;return _0x276d79;})[_0x1182('0x22')](function(_0x1f30c4){if(_0x1f30c4){_0x1f30c4[_0x1182('0x64')][_0x1182('0x77')]=util[_0x1182('0x67')](_0x1182('0x78'),_0x242225[_0x1182('0x62')][_0x1182('0x3b')]);_0x1f30c4['message']['channel']=_0x276d79[_0x1182('0x79')];_0x1f30c4[_0x1182('0x64')][_0x1182('0x7a')]=_0x276d79[_0x1182('0x79')];_0x1f30c4[_0x1182('0x64')][_0x1182('0x7b')]=_0x1182('0x36');respondWithRpcPromise(_0x1182('0x7c'),_0x1182('0x7c'),{'event':_0x1182('0x83'),'message':_0x1f30c4[_0x1182('0x64')]},client9002);return _0x276d79;}return null;})['then'](respondWithResult(_0x37e636,null))[_0x1182('0x2c')](handleError(_0x37e636,null));};exports['create']=function(_0x36cf32,_0x58f998){var _0x340fb5;return db[_0x1182('0x3f')][_0x1182('0x84')](_0x36cf32[_0x1182('0x57')],{})['then'](function(_0x6380c1){_0x340fb5=_0x6380c1;return db[_0x1182('0x85')][_0x1182('0x86')]({'where':{'id':_0x340fb5[_0x1182('0x6f')]}});})['then'](function(_0x37c354){if(_[_0x1182('0x87')](_0x37c354)){return;}else{_0x340fb5[_0x1182('0x5d')]=_0x37c354[_0x1182('0x5d')];return db[_0x1182('0x88')][_0x1182('0x86')]({'where':{'id':_0x340fb5['AttachmentId']}});}})[_0x1182('0x22')](function(_0x3a3d80){return respondWithRpcPromise(_0x1182('0x89'),_0x1182('0x89'),{'FaxAccountId':_[_0x1182('0x87')](_0x36cf32[_0x1182('0x57')])?undefined:_0x36cf32[_0x1182('0x57')]['FaxAccountId'],'path':_['isNil'](_0x3a3d80)?undefined:util[_0x1182('0x67')]('/var/opt/motion2/server/files/attachments/%s',_0x3a3d80[_0x1182('0x8a')]),'fax':_[_0x1182('0x87')](_0x340fb5[_0x1182('0x5d')])?undefined:_0x340fb5['fax'],'AttachmentId':_0x340fb5[_0x1182('0x8b')]},client9002);})[_0x1182('0x22')](respondWithResult(_0x58f998,0xc9))['catch'](handleError(_0x58f998,null));};exports[_0x1182('0x8c')]=function(_0x22c1eb,_0x568c60){var _0x477b89=path[_0x1182('0x8d')](config[_0x1182('0x8e')],_0x1182('0x8f'),_0x1182('0x90'),_0x1182('0x91'));return db['FaxMessage'][_0x1182('0x58')]({'where':{'id':_0x22c1eb['params']['id']},'include':[{'model':db['Attachment'],'as':_0x1182('0x88')}]})[_0x1182('0x22')](handleEntityNotFound(_0x568c60,null))[_0x1182('0x22')](function(_0x788eb8){if(_0x788eb8){return _0x568c60[_0x1182('0x8c')](path[_0x1182('0x8d')](_0x477b89,_0x788eb8['Attachment'][_0x1182('0x8a')]));}})[_0x1182('0x2c')](handleError(_0x568c60,null));}; \ No newline at end of file +var _0xb1e9=['request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','destroy','describe','../../config/logger','fax-interactions','readAt','user','agent','UserId','FaxInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','ContactId','sequelize','QueryTypes','contact','User','fullname','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax','FaxInteraction','interaction','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','internal','interface','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','info','FaxMessage,\x20%s,\x20%s'];(function(_0x5b2984,_0x5da204){var _0x2506c1=function(_0x48e776){while(--_0x48e776){_0x5b2984['push'](_0x5b2984['shift']());}};_0x2506c1(++_0x5da204);}(_0xb1e9,0x18d));var _0x9b1e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb1e9[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x9b1e('0x0'));var rimraf=require(_0x9b1e('0x1'));var zipdir=require(_0x9b1e('0x2'));var jsonpatch=require(_0x9b1e('0x3'));var rp=require(_0x9b1e('0x4'));var moment=require(_0x9b1e('0x5'));var BPromise=require(_0x9b1e('0x6'));var Mustache=require(_0x9b1e('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9b1e('0x8'));var ejs=require(_0x9b1e('0x9'));var fs=require('fs');var fs_extra=require(_0x9b1e('0xa'));var _=require('lodash');var squel=require(_0x9b1e('0xb'));var crypto=require(_0x9b1e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9b1e('0xd'));var toCsv=require(_0x9b1e('0x8'));var querystring=require(_0x9b1e('0xe'));var Papa=require(_0x9b1e('0xf'));var Redis=require(_0x9b1e('0x10'));var authService=require(_0x9b1e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b1e('0x12'));var hardwareService=require(_0x9b1e('0x13'));var logger=require('../../config/logger')(_0x9b1e('0x14'));var utils=require(_0x9b1e('0x15'));var config=require(_0x9b1e('0x16'));var licenseUtil=require(_0x9b1e('0x17'));var db=require(_0x9b1e('0x18'))['db'];config[_0x9b1e('0x19')]=_[_0x9b1e('0x1a')](config['redis'],{'host':_0x9b1e('0x1b'),'port':0x18eb});var socket=require(_0x9b1e('0x1c'))(new Redis(config[_0x9b1e('0x19')]));require(_0x9b1e('0x1d'))['register'](socket);var jayson=require(_0x9b1e('0x1e'));var client=jayson[_0x9b1e('0x1f')][_0x9b1e('0x20')]({'port':0x232c});var client9002=jayson[_0x9b1e('0x1f')][_0x9b1e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x780409,_0x492e99,_0xe23dbb,_0x53a7ac){return new BPromise(function(_0xb9d709,_0xc36fdc){var _0x252b26=_0x53a7ac||client;return _0x252b26['request'](_0x780409,_0xe23dbb)['then'](function(_0x1f6adb){logger[_0x9b1e('0x21')](_0x9b1e('0x22'),_0x492e99,_0x9b1e('0x23'));logger[_0x9b1e('0x24')](_0x9b1e('0x25'),_0x492e99,_0x9b1e('0x23'),JSON[_0x9b1e('0x26')](_0x1f6adb));if(_0x1f6adb[_0x9b1e('0x27')]){if(_0x1f6adb[_0x9b1e('0x27')][_0x9b1e('0x28')]===0x1f4){logger[_0x9b1e('0x27')]('FaxMessage,\x20%s,\x20%s',_0x492e99,_0x1f6adb[_0x9b1e('0x27')][_0x9b1e('0x29')]);return _0xc36fdc(_0x1f6adb[_0x9b1e('0x27')]['message']);}logger[_0x9b1e('0x27')](_0x9b1e('0x22'),_0x492e99,_0x1f6adb[_0x9b1e('0x27')]['message']);return _0xb9d709(_0x1f6adb[_0x9b1e('0x27')][_0x9b1e('0x29')]);}else{logger['info'](_0x9b1e('0x22'),_0x492e99,_0x9b1e('0x23'));_0xb9d709(_0x1f6adb[_0x9b1e('0x2a')][_0x9b1e('0x29')]);}})['catch'](function(_0x57844e){logger['error'](_0x9b1e('0x22'),_0x492e99,_0x57844e);_0xc36fdc(_0x57844e);});});}function respondWithStatusCode(_0x2bce4e,_0x19836d){_0x19836d=_0x19836d||0xcc;return function(_0x2b4875){if(_0x2b4875){return _0x2bce4e['sendStatus'](_0x19836d);}return _0x2bce4e[_0x9b1e('0x2b')](_0x19836d)[_0x9b1e('0x2c')]();};}function respondWithResult(_0x218d6d,_0x47aa20){_0x47aa20=_0x47aa20||0xc8;return function(_0x56779e){if(_0x56779e){return _0x218d6d['status'](_0x47aa20)['json'](_0x56779e);}};}function respondWithFilteredResult(_0x3f8e56,_0x4a3a40){return function(_0x2095e2){if(_0x2095e2){var _0x4941b3=typeof _0x4a3a40[_0x9b1e('0x2d')]===_0x9b1e('0x2e')&&typeof _0x4a3a40[_0x9b1e('0x2f')]==='undefined';var _0x58e60c=_0x2095e2[_0x9b1e('0x30')];var _0x2063c0=_0x4941b3?0x0:_0x4a3a40['offset'];var _0x5b1556=_0x4941b3?_0x2095e2[_0x9b1e('0x30')]:_0x4a3a40[_0x9b1e('0x2d')]+_0x4a3a40[_0x9b1e('0x2f')];var _0x56a90d;if(_0x5b1556>=_0x58e60c){_0x5b1556=_0x58e60c;_0x56a90d=0xc8;}else{_0x56a90d=0xce;}_0x3f8e56['status'](_0x56a90d);return _0x3f8e56['set'](_0x9b1e('0x31'),_0x2063c0+'-'+_0x5b1556+'/'+_0x58e60c)[_0x9b1e('0x32')](_0x2095e2);}return null;};}function patchUpdates(_0x4e0afb){return function(_0x5a3a8a){try{jsonpatch[_0x9b1e('0x33')](_0x5a3a8a,_0x4e0afb,!![]);}catch(_0x1dea4b){return BPromise[_0x9b1e('0x34')](_0x1dea4b);}return _0x5a3a8a[_0x9b1e('0x35')]();};}function saveUpdates(_0x4c6b53,_0x5b6caf){return function(_0x39f165){if(_0x39f165){return _0x39f165[_0x9b1e('0x36')](_0x4c6b53)[_0x9b1e('0x37')](function(_0x14478c){return _0x14478c;});}return null;};}function removeEntity(_0x288cbd,_0x511477){return function(_0x5b16c3){if(_0x5b16c3){return _0x5b16c3['destroy']()[_0x9b1e('0x37')](function(){_0x288cbd[_0x9b1e('0x2b')](0xcc)[_0x9b1e('0x2c')]();});}};}function handleEntityNotFound(_0x146b4f,_0x5419e6){return function(_0x28e64b){if(!_0x28e64b){_0x146b4f[_0x9b1e('0x38')](0x194);}return _0x28e64b;};}function handleError(_0x440bb3,_0x228737){_0x228737=_0x228737||0x1f4;return function(_0x2fa0eb){logger['error'](_0x2fa0eb[_0x9b1e('0x39')]);if(_0x2fa0eb['name']){delete _0x2fa0eb[_0x9b1e('0x3a')];}_0x440bb3['status'](_0x228737)[_0x9b1e('0x3b')](_0x2fa0eb);};}exports['index']=function(_0x2e9f01,_0x2343d5){var _0x18c4cf={},_0x6b2356={},_0x69eb1={'count':0x0,'rows':[]};var _0x437e56=_[_0x9b1e('0x3c')](db[_0x9b1e('0x3d')][_0x9b1e('0x3e')],function(_0x3e8493){return{'name':_0x3e8493[_0x9b1e('0x3f')],'type':_0x3e8493[_0x9b1e('0x40')]['key']};});_0x6b2356[_0x9b1e('0x41')]=_[_0x9b1e('0x3c')](_0x437e56,_0x9b1e('0x3a'));_0x6b2356['query']=_[_0x9b1e('0x42')](_0x2e9f01[_0x9b1e('0x43')]);_0x6b2356[_0x9b1e('0x44')]=_[_0x9b1e('0x45')](_0x6b2356[_0x9b1e('0x41')],_0x6b2356[_0x9b1e('0x43')]);_0x18c4cf[_0x9b1e('0x46')]=_[_0x9b1e('0x45')](_0x6b2356['model'],qs[_0x9b1e('0x47')](_0x2e9f01[_0x9b1e('0x43')]['fields']));_0x18c4cf[_0x9b1e('0x46')]=_0x18c4cf['attributes']['length']?_0x18c4cf['attributes']:_0x6b2356['model'];if(!_0x2e9f01['query'][_0x9b1e('0x48')](_0x9b1e('0x49'))){_0x18c4cf[_0x9b1e('0x2f')]=qs[_0x9b1e('0x2f')](_0x2e9f01['query'][_0x9b1e('0x2f')]);_0x18c4cf['offset']=qs[_0x9b1e('0x2d')](_0x2e9f01[_0x9b1e('0x43')]['offset']);}_0x18c4cf[_0x9b1e('0x4a')]=qs[_0x9b1e('0x4b')](_0x2e9f01[_0x9b1e('0x43')]['sort']);_0x18c4cf[_0x9b1e('0x4c')]=qs[_0x9b1e('0x44')](_['pick'](_0x2e9f01[_0x9b1e('0x43')],_0x6b2356[_0x9b1e('0x44')]),_0x437e56);if(_0x2e9f01[_0x9b1e('0x43')][_0x9b1e('0x4d')]){_0x18c4cf['where']=_[_0x9b1e('0x4e')](_0x18c4cf[_0x9b1e('0x4c')],{'$or':_['map'](_0x437e56,function(_0x1d8811){if(_0x1d8811['type']!==_0x9b1e('0x4f')){var _0x109104={};_0x109104[_0x1d8811[_0x9b1e('0x3a')]]={'$like':'%'+_0x2e9f01['query'][_0x9b1e('0x4d')]+'%'};return _0x109104;}})});}_0x18c4cf=_[_0x9b1e('0x4e')]({},_0x18c4cf,_0x2e9f01[_0x9b1e('0x50')]);var _0x37f4a9={'where':_0x18c4cf[_0x9b1e('0x4c')]};return db[_0x9b1e('0x3d')][_0x9b1e('0x30')](_0x37f4a9)[_0x9b1e('0x37')](function(_0x4c3508){_0x69eb1[_0x9b1e('0x30')]=_0x4c3508;if(_0x2e9f01[_0x9b1e('0x43')][_0x9b1e('0x51')]){_0x18c4cf[_0x9b1e('0x52')]=[{'all':!![]}];}return db[_0x9b1e('0x3d')][_0x9b1e('0x53')](_0x18c4cf);})[_0x9b1e('0x37')](function(_0xf77aef){_0x69eb1[_0x9b1e('0x54')]=_0xf77aef;return _0x69eb1;})[_0x9b1e('0x37')](respondWithFilteredResult(_0x2343d5,_0x18c4cf))[_0x9b1e('0x55')](handleError(_0x2343d5,null));};exports[_0x9b1e('0x56')]=function(_0xb34998,_0x2f0a7b){var _0x37cd58={'raw':!![],'where':{'id':_0xb34998[_0x9b1e('0x57')]['id']}},_0x2c152a={};_0x2c152a[_0x9b1e('0x41')]=_[_0x9b1e('0x42')](db[_0x9b1e('0x3d')][_0x9b1e('0x3e')]);_0x2c152a[_0x9b1e('0x43')]=_['keys'](_0xb34998[_0x9b1e('0x43')]);_0x2c152a['filters']=_[_0x9b1e('0x45')](_0x2c152a[_0x9b1e('0x41')],_0x2c152a['query']);_0x37cd58['attributes']=_[_0x9b1e('0x45')](_0x2c152a[_0x9b1e('0x41')],qs[_0x9b1e('0x47')](_0xb34998[_0x9b1e('0x43')]['fields']));_0x37cd58['attributes']=_0x37cd58[_0x9b1e('0x46')][_0x9b1e('0x58')]?_0x37cd58[_0x9b1e('0x46')]:_0x2c152a[_0x9b1e('0x41')];if(_0xb34998['query'][_0x9b1e('0x51')]){_0x37cd58[_0x9b1e('0x52')]=[{'all':!![]}];}_0x37cd58=_[_0x9b1e('0x4e')]({},_0x37cd58,_0xb34998[_0x9b1e('0x50')]);return db[_0x9b1e('0x3d')][_0x9b1e('0x59')](_0x37cd58)[_0x9b1e('0x37')](handleEntityNotFound(_0x2f0a7b,null))[_0x9b1e('0x37')](respondWithResult(_0x2f0a7b,null))['catch'](handleError(_0x2f0a7b,null));};exports['update']=function(_0x5555ad,_0x49b1a2){if(_0x5555ad[_0x9b1e('0x5a')]['id']){delete _0x5555ad[_0x9b1e('0x5a')]['id'];}return db[_0x9b1e('0x3d')]['find']({'where':{'id':_0x5555ad['params']['id']}})['then'](handleEntityNotFound(_0x49b1a2,null))[_0x9b1e('0x37')](saveUpdates(_0x5555ad[_0x9b1e('0x5a')],null))[_0x9b1e('0x37')](respondWithResult(_0x49b1a2,null))[_0x9b1e('0x55')](handleError(_0x49b1a2,null));};exports[_0x9b1e('0x5b')]=function(_0x2ce597,_0x4930f5){return db[_0x9b1e('0x3d')][_0x9b1e('0x59')]({'where':{'id':_0x2ce597[_0x9b1e('0x57')]['id']}})[_0x9b1e('0x37')](handleEntityNotFound(_0x4930f5,null))[_0x9b1e('0x37')](removeEntity(_0x4930f5,null))[_0x9b1e('0x55')](handleError(_0x4930f5,null));};exports[_0x9b1e('0x5c')]=function(_0x437d68,_0x5387ce){return db[_0x9b1e('0x3d')][_0x9b1e('0x5c')]()[_0x9b1e('0x37')](respondWithResult(_0x5387ce,null))[_0x9b1e('0x55')](handleError(_0x5387ce,null));};var interaction_log=require(_0x9b1e('0x5d'))(_0x9b1e('0x5e'));exports['accept']=function(_0x46eb4f,_0x4ca97f,_0x19711d){var _0x42206b={'agent':{},'channel':'fax'};if(_0x46eb4f[_0x9b1e('0x5a')]['id']){delete _0x46eb4f[_0x9b1e('0x5a')]['id'];}_0x46eb4f[_0x9b1e('0x5a')]['read']=!![];_0x46eb4f[_0x9b1e('0x5a')][_0x9b1e('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x46eb4f[_0x9b1e('0x5a')]['UserId']=_0x46eb4f[_0x9b1e('0x5a')]['UserId']||_0x46eb4f[_0x9b1e('0x60')]['id'];_0x42206b[_0x9b1e('0x61')]['id']=_0x46eb4f[_0x9b1e('0x5a')][_0x9b1e('0x62')];return db['FaxMessage'][_0x9b1e('0x59')]({'where':{'id':_0x46eb4f[_0x9b1e('0x57')]['id'],'UserId':null}})[_0x9b1e('0x37')](handleEntityNotFound(_0x4ca97f,null))[_0x9b1e('0x37')](saveUpdates(_0x46eb4f[_0x9b1e('0x5a')],null))[_0x9b1e('0x37')](function(_0x4922a3){if(_0x4922a3){_0x42206b[_0x9b1e('0x29')]=_0x4922a3['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4922a3[_0x9b1e('0x63')]}});}return null;})[_0x9b1e('0x37')](handleEntityNotFound(_0x4ca97f,null))[_0x9b1e('0x37')](function(_0x7e9d66){if(_0x7e9d66){return _0x7e9d66[_0x9b1e('0x36')]({'UserId':_0x46eb4f[_0x9b1e('0x5a')][_0x9b1e('0x62')],'read1stAt':_['isNil'](_0x7e9d66[_0x9b1e('0x64')])?moment()[_0x9b1e('0x65')](_0x9b1e('0x66')):undefined});}return null;})[_0x9b1e('0x37')](function(_0x27aa86){if(_0x27aa86){_0x42206b['interaction']=_0x27aa86[_0x9b1e('0x67')]({'plain':!![]});interaction_log[_0x9b1e('0x21')](_0x9b1e('0x68'),_0x46eb4f[_0x9b1e('0x60')]['id'],_0x46eb4f['user'][_0x9b1e('0x3a')],_0x46eb4f[_0x9b1e('0x60')][_0x9b1e('0x69')],_0x42206b['interaction']['id'],_0x46eb4f[_0x9b1e('0x5a')]?JSON[_0x9b1e('0x26')](_0x46eb4f[_0x9b1e('0x5a')]):'null');return respondWithRpcPromise(_0x9b1e('0x6a'),'acceptMessage',_0x42206b);}return null;})[_0x9b1e('0x37')](function(_0x28f300){var _0x5a7749='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28f300['message'][_0x9b1e('0x6b')];return db[_0x9b1e('0x6c')][_0x9b1e('0x43')](_0x5a7749,{'type':db['Sequelize'][_0x9b1e('0x6d')]['SELECT'],'raw':!![]})[_0x9b1e('0x37')](function(_0x51a645){return _0x51a645;});})[_0x9b1e('0x37')](function(_0x1c25b0){if(_0x1c25b0){_0x42206b[_0x9b1e('0x29')][_0x9b1e('0x6e')]=_0x1c25b0[0x0];if(!_0x46eb4f[_0x9b1e('0x5a')]['UserId'])return;return db[_0x9b1e('0x6f')][_0x9b1e('0x59')]({'where':{'id':_0x46eb4f[_0x9b1e('0x5a')][_0x9b1e('0x62')],'role':_0x9b1e('0x61')},'attributes':['id',_0x9b1e('0x3a'),_0x9b1e('0x70'),'email','internal'],'raw':!![]});}return null;})[_0x9b1e('0x37')](function(_0x17394a){if(!_0x17394a)return null;_0x42206b[_0x9b1e('0x29')][_0x9b1e('0x61')]=_0x17394a;return _0x42206b;})['then'](function(_0x5a0411){if(_0x5a0411){if(_0x46eb4f[_0x9b1e('0x5a')][_0x9b1e('0x71')]){_0x42206b[_0x9b1e('0x29')]['interface']=util[_0x9b1e('0x65')](_0x9b1e('0x72'),_0x46eb4f[_0x9b1e('0x60')]['name']);_0x42206b['message']['channel']=_0x42206b[_0x9b1e('0x73')];_0x42206b[_0x9b1e('0x29')][_0x9b1e('0x74')]=_0x42206b[_0x9b1e('0x73')];_0x42206b[_0x9b1e('0x29')][_0x9b1e('0x75')]=_0x9b1e('0x76');return respondWithRpcPromise(_0x9b1e('0x77'),_0x9b1e('0x77'),{'event':_0x9b1e('0x78'),'message':_0x42206b[_0x9b1e('0x29')]},client9002)['then'](function(){return _0x42206b;});}return _0x42206b;}return null;})[_0x9b1e('0x37')](respondWithResult(_0x4ca97f,null))[_0x9b1e('0x55')](handleError(_0x4ca97f,null));};var interaction_log=require(_0x9b1e('0x5d'))(_0x9b1e('0x5e'));exports[_0x9b1e('0x34')]=function(_0x4ca0a5,_0xd1928f,_0x920b21){var _0x48c49e={'agent':{},'channel':_0x9b1e('0x79')};if(_0x4ca0a5['body']['id']){delete _0x4ca0a5[_0x9b1e('0x5a')]['id'];}_0x4ca0a5[_0x9b1e('0x5a')][_0x9b1e('0x62')]=_0x4ca0a5[_0x9b1e('0x5a')][_0x9b1e('0x62')]||_0x4ca0a5[_0x9b1e('0x60')]['id'];_0x48c49e[_0x9b1e('0x61')]['id']=_0x4ca0a5[_0x9b1e('0x5a')]['UserId'];return db[_0x9b1e('0x3d')]['find']({'where':{'id':_0x4ca0a5[_0x9b1e('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd1928f,null))[_0x9b1e('0x37')](function(_0x1a5a1c){if(_0x1a5a1c){_0x48c49e['message']=_0x1a5a1c[_0x9b1e('0x67')]({'plain':!![]});return db[_0x9b1e('0x7a')][_0x9b1e('0x59')]({'where':{'id':_0x1a5a1c[_0x9b1e('0x63')]}});}return null;})[_0x9b1e('0x37')](handleEntityNotFound(_0xd1928f,null))[_0x9b1e('0x37')](function(_0x94b339){if(_0x94b339){_0x48c49e['interaction']=_0x94b339[_0x9b1e('0x67')]({'plain':!![]});interaction_log[_0x9b1e('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ca0a5[_0x9b1e('0x60')]['id'],_0x4ca0a5[_0x9b1e('0x60')][_0x9b1e('0x3a')],_0x4ca0a5[_0x9b1e('0x60')][_0x9b1e('0x69')],_0x48c49e[_0x9b1e('0x7b')]['id'],_0x4ca0a5[_0x9b1e('0x5a')]?JSON[_0x9b1e('0x26')](_0x4ca0a5[_0x9b1e('0x5a')]):_0x9b1e('0x7c'));return respondWithRpcPromise('RejectMessage',_0x9b1e('0x7d'),_0x48c49e);}return null;})[_0x9b1e('0x37')](function(_0x26f39a){var _0x5449c3=_0x9b1e('0x7e')+_0x26f39a[_0x9b1e('0x29')]['ContactId'];return db[_0x9b1e('0x6c')][_0x9b1e('0x43')](_0x5449c3,{'type':db['Sequelize'][_0x9b1e('0x6d')][_0x9b1e('0x7f')],'raw':!![]})['then'](function(_0x4abf4f){return _0x4abf4f;});})['then'](function(_0x446d9d){if(_0x446d9d){_0x48c49e[_0x9b1e('0x29')]['contact']=_0x446d9d[0x0];if(!_0x4ca0a5[_0x9b1e('0x5a')][_0x9b1e('0x62')])return;return db[_0x9b1e('0x6f')][_0x9b1e('0x59')]({'where':{'id':_0x4ca0a5[_0x9b1e('0x5a')][_0x9b1e('0x62')],'role':_0x9b1e('0x61')},'attributes':['id',_0x9b1e('0x3a'),_0x9b1e('0x70'),'email',_0x9b1e('0x80')],'raw':!![]});}return null;})['then'](function(_0x46860e){if(!_0x46860e)return null;_0x48c49e[_0x9b1e('0x29')][_0x9b1e('0x61')]=_0x46860e;return _0x48c49e;})[_0x9b1e('0x37')](function(_0xa72069){if(_0xa72069){_0xa72069[_0x9b1e('0x29')][_0x9b1e('0x81')]=util[_0x9b1e('0x65')](_0x9b1e('0x72'),_0x4ca0a5[_0x9b1e('0x60')][_0x9b1e('0x3a')]);_0xa72069['message'][_0x9b1e('0x73')]=_0x48c49e[_0x9b1e('0x73')];_0xa72069[_0x9b1e('0x29')]['motionChannel']=_0x48c49e['channel'];_0xa72069['message']['event']=_0x9b1e('0x34');respondWithRpcPromise(_0x9b1e('0x77'),_0x9b1e('0x77'),{'event':'rejectmessage','message':_0xa72069['message']},client9002);return _0x48c49e;}return null;})[_0x9b1e('0x37')](respondWithResult(_0xd1928f,null))[_0x9b1e('0x55')](handleError(_0xd1928f,null));};exports[_0x9b1e('0x82')]=function(_0x3852ad,_0x223a0c){var _0x486f00;return db[_0x9b1e('0x3d')][_0x9b1e('0x82')](_0x3852ad['body'],{})[_0x9b1e('0x37')](function(_0x5858c4){_0x486f00=_0x5858c4;return db[_0x9b1e('0x83')][_0x9b1e('0x84')]({'where':{'id':_0x486f00[_0x9b1e('0x6b')]}});})[_0x9b1e('0x37')](function(_0xd14ed0){if(_[_0x9b1e('0x85')](_0xd14ed0)){return;}else{_0x486f00['fax']=_0xd14ed0['fax'];return db[_0x9b1e('0x86')][_0x9b1e('0x84')]({'where':{'id':_0x486f00[_0x9b1e('0x87')]}});}})[_0x9b1e('0x37')](function(_0xd2b2ec){return respondWithRpcPromise('SendFax',_0x9b1e('0x88'),{'FaxAccountId':_[_0x9b1e('0x85')](_0x3852ad[_0x9b1e('0x5a')])?undefined:_0x3852ad[_0x9b1e('0x5a')]['FaxAccountId'],'path':_[_0x9b1e('0x85')](_0xd2b2ec)?undefined:util[_0x9b1e('0x65')](_0x9b1e('0x89'),_0xd2b2ec[_0x9b1e('0x8a')]),'fax':_[_0x9b1e('0x85')](_0x486f00['fax'])?undefined:_0x486f00['fax'],'AttachmentId':_0x486f00[_0x9b1e('0x87')]},client9002);})[_0x9b1e('0x37')](respondWithResult(_0x223a0c,0xc9))[_0x9b1e('0x55')](handleError(_0x223a0c,null));};exports[_0x9b1e('0x8b')]=function(_0x55fbf8,_0x281ece){var _0x2a2686=path[_0x9b1e('0x8c')](config[_0x9b1e('0x8d')],_0x9b1e('0x8e'),_0x9b1e('0x8f'),'attachments');return db[_0x9b1e('0x3d')][_0x9b1e('0x59')]({'where':{'id':_0x55fbf8['params']['id']},'include':[{'model':db[_0x9b1e('0x86')],'as':_0x9b1e('0x86')}]})['then'](handleEntityNotFound(_0x281ece,null))[_0x9b1e('0x37')](function(_0x152fd5){if(_0x152fd5){return _0x281ece[_0x9b1e('0x8b')](path[_0x9b1e('0x8c')](_0x2a2686,_0x152fd5['Attachment'][_0x9b1e('0x8a')]));}})[_0x9b1e('0x55')](handleError(_0x281ece,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 818c630..0ae2acf 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 _0x5d95=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x3e06c3,_0x5959f4){var _0x395953=function(_0x57eb8c){while(--_0x57eb8c){_0x3e06c3['push'](_0x3e06c3['shift']());}};_0x395953(++_0x5959f4);}(_0x5d95,0x77));var _0x55d9=function(_0xdcd71f,_0x5c66f9){_0xdcd71f=_0xdcd71f-0x0;var _0x4a490c=_0x5d95[_0xdcd71f];return _0x4a490c;};'use strict';var EventEmitter=require(_0x55d9('0x0'));var FaxMessage=require(_0x55d9('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x55d9('0x2')](0x0);var events={'afterCreate':_0x55d9('0x3'),'afterUpdate':_0x55d9('0x4'),'afterDestroy':_0x55d9('0x5')};function emitEvent(_0x135c30){return function(_0x536e6d,_0xabfc0e,_0x5b0772){FaxMessageEvents['emit'](_0x135c30+':'+_0x536e6d['id'],_0x536e6d);FaxMessageEvents[_0x55d9('0x6')](_0x135c30,_0x536e6d);_0x5b0772(null);};}for(var e in events){if(events[_0x55d9('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3cb827,_0x4c7d54){var _0x4802a2=function(_0x3b5faf){while(--_0x3b5faf){_0x3cb827['push'](_0x3cb827['shift']());}};_0x4802a2(++_0x4c7d54);}(_0x9f02,0x68));var _0x29f0=function(_0x784d77,_0x44b196){_0x784d77=_0x784d77-0x0;var _0x3af5ab=_0x9f02[_0x784d77];return _0x3af5ab;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){FaxMessageEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);FaxMessageEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];FaxMessage[_0x29f0('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 330aea5..49f0330 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 _0x00ee=['error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch'];(function(_0x4685a4,_0x567250){var _0x51af19=function(_0xc8ebdf){while(--_0xc8ebdf){_0x4685a4['push'](_0x4685a4['shift']());}};_0x51af19(++_0x567250);}(_0x00ee,0x162));var _0xe00e=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x00ee[_0x1fb1c1];return _0x1622df;};'use strict';var _=require(_0xe00e('0x0'));var util=require('util');var logger=require(_0xe00e('0x1'))('api');var moment=require(_0xe00e('0x2'));var BPromise=require(_0xe00e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe00e('0x4'));var attributes=require(_0xe00e('0x5'));module[_0xe00e('0x6')]=function(_0x47f903,_0x419a9c){return _0x47f903[_0xe00e('0x7')](_0xe00e('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xe00e('0x9')],'type':_0xe00e('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38901a,_0x33a3fe,_0x227b2f){var _0x5b5c57=_0x47f903[_0xe00e('0xb')];var _0x4c89e8=_0x38901a['get']({'plain':!![]});if(_0x4c89e8[_0xe00e('0xc')][_0xe00e('0xd')]()==='in'||_0x4c89e8[_0xe00e('0xc')]['toLowerCase']()===_0xe00e('0xe')&&!_0x4c89e8[_0xe00e('0xf')]&&!_[_0xe00e('0x10')](_0x4c89e8[_0xe00e('0x11')])){_0x5b5c57[_0xe00e('0x12')][_0xe00e('0x13')]({'where':{'id':_0x4c89e8[_0xe00e('0x14')]}})[_0xe00e('0x15')](function(_0x3eb77d){if(_0x3eb77d){_0x3eb77d[_0xe00e('0x16')]({'lastMsgAt':_0x4c89e8['createdAt'],'lastMsgDirection':_0x4c89e8[_0xe00e('0xc')]['toLowerCase']()});}})[_0xe00e('0x17')](function(_0x497bb5){console[_0xe00e('0x18')](_0x497bb5);});}_0x227b2f();}},'charset':_0xe00e('0x19'),'collate':_0xe00e('0x1a')});}; \ No newline at end of file +var _0x49b7=['models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','fti_fax_messages','body','FULLTEXT'];(function(_0x14faa6,_0xccadc8){var _0x3ca44a=function(_0x414bb4){while(--_0x414bb4){_0x14faa6['push'](_0x14faa6['shift']());}};_0x3ca44a(++_0xccadc8);}(_0x49b7,0x121));var _0x749b=function(_0x337ef8,_0x3971ab){_0x337ef8=_0x337ef8-0x0;var _0x585b75=_0x49b7[_0x337ef8];return _0x585b75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x749b('0x0'))(_0x749b('0x1'));var moment=require(_0x749b('0x2'));var BPromise=require('bluebird');var rp=require(_0x749b('0x3'));var fs=require('fs');var path=require(_0x749b('0x4'));var rimraf=require(_0x749b('0x5'));var config=require(_0x749b('0x6'));var attributes=require(_0x749b('0x7'));module['exports']=function(_0x4462de,_0x58585d){return _0x4462de['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x749b('0x8'),'fields':[_0x749b('0x9')],'type':_0x749b('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b45ac,_0x25cfaa,_0x55747a){var _0x2b0c93=_0x4462de[_0x749b('0xb')];var _0x42dc01=_0x3b45ac[_0x749b('0xc')]({'plain':!![]});if(_0x42dc01[_0x749b('0xd')][_0x749b('0xe')]()==='in'||_0x42dc01['direction']['toLowerCase']()===_0x749b('0xf')&&!_0x42dc01[_0x749b('0x10')]&&!_['isNil'](_0x42dc01[_0x749b('0x11')])){_0x2b0c93[_0x749b('0x12')][_0x749b('0x13')]({'where':{'id':_0x42dc01[_0x749b('0x14')]}})['then'](function(_0x4f6ba0){if(_0x4f6ba0){_0x4f6ba0[_0x749b('0x15')]({'lastMsgAt':_0x42dc01[_0x749b('0x16')],'lastMsgDirection':_0x42dc01[_0x749b('0xd')][_0x749b('0xe')]()});}})[_0x749b('0x17')](function(_0xce88ff){console['error'](_0xce88ff);});}_0x55747a();}},'charset':'utf8mb4','collate':_0x749b('0x18')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e1286cb..519d111 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 _0xa8a8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa8a8,0xec));var _0x8a8a=function(_0x236f47,_0x5d11e1){_0x236f47=_0x236f47-0x0;var _0x228853=_0xa8a8[_0x236f47];return _0x228853;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});config[_0x8a8a('0xd')]=_[_0x8a8a('0xe')](config[_0x8a8a('0xd')],{'host':_0x8a8a('0xf'),'port':0x18eb});var socket=require(_0x8a8a('0x10'))(new Redis(config[_0x8a8a('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3c01cd,_0x497b8a,_0x11788d){return new BPromise(function(_0x3d3a00,_0x532621){return client[_0x8a8a('0x11')](_0x3c01cd,_0x11788d)[_0x8a8a('0x12')](function(_0xb13fca){logger['info'](_0x8a8a('0x13'),_0x497b8a,_0x8a8a('0x14'));logger[_0x8a8a('0x15')](_0x8a8a('0x16'),_0x497b8a,'request\x20sent',JSON[_0x8a8a('0x17')](_0xb13fca));if(_0xb13fca['error']){if(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x19')]===0x1f4){logger[_0x8a8a('0x18')](_0x8a8a('0x13'),_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x532621(_0xb13fca[_0x8a8a('0x18')]['message']);}logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x3d3a00(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);}else{logger[_0x8a8a('0x1b')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x8a8a('0x14'));_0x3d3a00(_0xb13fca[_0x8a8a('0x1c')][_0x8a8a('0x1a')]);}})[_0x8a8a('0x1d')](function(_0x299827){logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x299827);_0x532621(_0x299827);});});}exports['CreateFaxMessage']=function(_0x5181b2){var _0x4e3d0a=this;return new Promise(function(_0x4a6601,_0x3a9b2f){return db[_0x8a8a('0x1e')][_0x8a8a('0x1f')](_0x5181b2[_0x8a8a('0x20')],{'raw':_0x5181b2[_0x8a8a('0x21')]?_0x5181b2[_0x8a8a('0x21')][_0x8a8a('0x22')]===undefined?!![]:![]:!![]})[_0x8a8a('0x12')](function(_0x25d5d4){logger[_0x8a8a('0x1b')](_0x8a8a('0x23'),_0x5181b2);logger[_0x8a8a('0x15')](_0x8a8a('0x23'),_0x5181b2,JSON[_0x8a8a('0x17')](_0x25d5d4));_0x4a6601(_0x25d5d4);})[_0x8a8a('0x1d')](function(_0x545a38){logger[_0x8a8a('0x18')](_0x8a8a('0x23'),_0x545a38[_0x8a8a('0x1a')],_0x5181b2);_0x3a9b2f(_0x4e3d0a[_0x8a8a('0x18')](0x1f4,_0x545a38[_0x8a8a('0x1a')]));});});};exports[_0x8a8a('0x24')]=function(_0x3aa46d){var _0x5f4dcc=this;return new Promise(function(_0x31d21a,_0x38c1e0){return db[_0x8a8a('0x1e')]['update'](_0x3aa46d['body'],{'raw':_0x3aa46d[_0x8a8a('0x21')]?_0x3aa46d[_0x8a8a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa46d['options']?_0x3aa46d['options'][_0x8a8a('0x25')]||null:null,'attributes':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x26')]||null:null,'limit':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x27')]||null:null})[_0x8a8a('0x12')](function(_0x8df0cb){logger[_0x8a8a('0x1b')](_0x8a8a('0x24'),_0x3aa46d);logger[_0x8a8a('0x15')](_0x8a8a('0x24'),_0x3aa46d,JSON['stringify'](_0x8df0cb));_0x31d21a(_0x8df0cb);})['catch'](function(_0x56e79e){logger[_0x8a8a('0x18')](_0x8a8a('0x24'),_0x56e79e['message'],_0x3aa46d);_0x38c1e0(_0x5f4dcc[_0x8a8a('0x18')](0x1f4,_0x56e79e[_0x8a8a('0x1a')]));});});}; \ No newline at end of file +var _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x242b15,_0x546fe1){var _0x40443a=function(_0x4ed34f){while(--_0x4ed34f){_0x242b15['push'](_0x242b15['shift']());}};_0x40443a(++_0x546fe1);}(_0xd2ea,0x15f));var _0xad2e=function(_0x442e65,_0x4a265f){_0x442e65=_0x442e65-0x0;var _0x5beea9=_0xd2ea[_0x442e65];return _0x5beea9;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 483d16a..20de178 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 _0x37a5=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x2f2601,_0x10b8be){var _0x3c6e6=function(_0x12a171){while(--_0x12a171){_0x2f2601['push'](_0x2f2601['shift']());}};_0x3c6e6(++_0x10b8be);}(_0x37a5,0x1b4));var _0x537a=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x37a5[_0x4fde08];return _0x12e725;};'use strict';var FaxMessageEvents=require(_0x537a('0x0'));var events=[_0x537a('0x1'),_0x537a('0x2'),_0x537a('0x3')];function createListener(_0x18f494,_0x31999c){return function(_0x163c3f){_0x31999c[_0x537a('0x4')](_0x18f494,_0x163c3f);};}function removeListener(_0x11fccf,_0x5c0a2d){return function(){FaxMessageEvents[_0x537a('0x5')](_0x11fccf,_0x5c0a2d);};}exports[_0x537a('0x6')]=function(_0x199610){for(var _0x18c281=0x0,_0x5c0084=events[_0x537a('0x7')];_0x18c281<_0x5c0084;_0x18c281++){var _0x42ad58=events[_0x18c281];var _0x4517ed=createListener(_0x537a('0x8')+_0x42ad58,_0x199610);FaxMessageEvents['on'](_0x42ad58,_0x4517ed);}}; \ No newline at end of file +var _0x1617=['register','faxMessage:','./faxMessage.events','save','update','emit'];(function(_0x1ae270,_0x1c2afc){var _0x735bbf=function(_0x3e6e14){while(--_0x3e6e14){_0x1ae270['push'](_0x1ae270['shift']());}};_0x735bbf(++_0x1c2afc);}(_0x1617,0xfe));var _0x7161=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0x1617[_0x4fa489];return _0x41d2ce;};'use strict';var FaxMessageEvents=require(_0x7161('0x0'));var events=[_0x7161('0x1'),'remove',_0x7161('0x2')];function createListener(_0x43c27e,_0x4d07e8){return function(_0x2f96ac){_0x4d07e8[_0x7161('0x3')](_0x43c27e,_0x2f96ac);};}function removeListener(_0x22a7e8,_0x1c22fc){return function(){FaxMessageEvents['removeListener'](_0x22a7e8,_0x1c22fc);};}exports[_0x7161('0x4')]=function(_0x56597a){for(var _0x52b893=0x0,_0x37c565=events['length'];_0x52b893<_0x37c565;_0x52b893++){var _0xfac82=events[_0x52b893];var _0x121554=createListener(_0x7161('0x5')+_0xfac82,_0x56597a);FaxMessageEvents['on'](_0xfac82,_0x121554);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 6ea32da..8442640 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 _0x2f68=['/:id/reject','reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept'];(function(_0x5cef48,_0x4f4b95){var _0x2486c6=function(_0x4acbe3){while(--_0x4acbe3){_0x5cef48['push'](_0x5cef48['shift']());}};_0x2486c6(++_0x4f4b95);}(_0x2f68,0x9a));var _0x82f6=function(_0x13c667,_0x2ccf54){_0x13c667=_0x13c667-0x0;var _0x1ddc4d=_0x2f68[_0x13c667];return _0x1ddc4d;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var fs_extra=require(_0x82f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var controller=require('./faxMessage.controller');router[_0x82f6('0x7')]('/',auth[_0x82f6('0x8')](),controller['index']);router['get'](_0x82f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x82f6('0x7')](_0x82f6('0xa'),auth[_0x82f6('0x8')](),controller['show']);router[_0x82f6('0x7')](_0x82f6('0xb'),auth['isAuthenticated'](),controller[_0x82f6('0xc')]);router[_0x82f6('0xd')]('/',auth[_0x82f6('0x8')](),interaction[_0x82f6('0xe')](_0x82f6('0xf'),_0x82f6('0x10')),controller['create']);router[_0x82f6('0x11')](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x12')]);router[_0x82f6('0x11')](_0x82f6('0x13'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x14')]);router[_0x82f6('0x11')](_0x82f6('0x15'),auth[_0x82f6('0x8')](),controller[_0x82f6('0x16')]);router['delete'](_0x82f6('0xa'),auth['isAuthenticated'](),controller[_0x82f6('0x17')]);module[_0x82f6('0x18')]=router; \ No newline at end of file +var _0xa571=['download','post','tracked','fax','put','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/download'];(function(_0xed7b75,_0x5bffa0){var _0x3c6f50=function(_0x5b5ebe){while(--_0x5b5ebe){_0xed7b75['push'](_0xed7b75['shift']());}};_0x3c6f50(++_0x5bffa0);}(_0xa571,0x107));var _0x1a57=function(_0xf25802,_0x4b1892){_0xf25802=_0xf25802-0x0;var _0x482df9=_0xa571[_0xf25802];return _0x482df9;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./faxMessage.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['describe']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')]('/',auth[_0x1a57('0x8')](),interaction[_0x1a57('0xf')](_0x1a57('0x10'),'faxmessage:create'),controller['create']);router[_0x1a57('0x11')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['update']);router[_0x1a57('0x11')](_0x1a57('0x12'),auth['isAuthenticated'](),controller[_0x1a57('0x13')]);router['put'](_0x1a57('0x14'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/:id',auth[_0x1a57('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 90293f0..1647533 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 _0x6659=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1e51b3,_0x1a0a26){var _0x25ef21=function(_0x27f423){while(--_0x27f423){_0x1e51b3['push'](_0x1e51b3['shift']());}};_0x25ef21(++_0x1a0a26);}(_0x6659,0x169));var _0x9665=function(_0x196ebe,_0x46cfeb){_0x196ebe=_0x196ebe-0x0;var _0x2f3f26=_0x6659[_0x196ebe];return _0x2f3f26;};'use strict';var Sequelize=require(_0x9665('0x0'));module[_0x9665('0x1')]={'name':{'type':Sequelize[_0x9665('0x2')],'unique':_0x9665('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9665('0x2')]},'timeout':{'type':Sequelize[_0x9665('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9665('0x5')](_0x9665('0x6'),'beepall',_0x9665('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9665('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfbf2=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x419edc,_0x1d8fef){var _0xdaabc9=function(_0x151c46){while(--_0x151c46){_0x419edc['push'](_0x419edc['shift']());}};_0xdaabc9(++_0x1d8fef);}(_0xfbf2,0xc0));var _0x2fbf=function(_0x1dd2ca,_0x2652a4){_0x1dd2ca=_0x1dd2ca-0x0;var _0x223b68=_0xfbf2[_0x1dd2ca];return _0x223b68;};'use strict';var Sequelize=require(_0x2fbf('0x0'));module[_0x2fbf('0x1')]={'name':{'type':Sequelize[_0x2fbf('0x2')],'unique':_0x2fbf('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2fbf('0x2')]},'timeout':{'type':Sequelize[_0x2fbf('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2fbf('0x5'),_0x2fbf('0x6'),_0x2fbf('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x2fbf('0x4')],'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 9ca180f..5899f49 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 _0xa3d0=['fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserFaxQueue','User','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','FaxQueues','UserProfileResource','then','error','name','send','index','map','FaxQueue'];(function(_0x5939c0,_0x5623b8){var _0xd71a19=function(_0x17711f){while(--_0x17711f){_0x5939c0['push'](_0x5939c0['shift']());}};_0xd71a19(++_0x5623b8);}(_0xa3d0,0xee));var _0x0a3d=function(_0x5c0fd1,_0x5ed3aa){_0x5c0fd1=_0x5c0fd1-0x0;var _0x21b83d=_0xa3d0[_0x5c0fd1];return _0x21b83d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a3d('0x0'));var zipdir=require(_0x0a3d('0x1'));var jsonpatch=require(_0x0a3d('0x2'));var rp=require(_0x0a3d('0x3'));var moment=require('moment');var BPromise=require(_0x0a3d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0a3d('0x5'));var sox=require('sox');var csv=require(_0x0a3d('0x6'));var ejs=require(_0x0a3d('0x7'));var fs=require('fs');var fs_extra=require(_0x0a3d('0x8'));var _=require('lodash');var squel=require(_0x0a3d('0x9'));var crypto=require('crypto');var jsforce=require(_0x0a3d('0xa'));var deskjs=require(_0x0a3d('0xb'));var toCsv=require(_0x0a3d('0x6'));var querystring=require(_0x0a3d('0xc'));var Papa=require(_0x0a3d('0xd'));var Redis=require(_0x0a3d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0a3d('0xf'));var as=require(_0x0a3d('0x10'));var hardwareService=require(_0x0a3d('0x11'));var logger=require(_0x0a3d('0x12'))(_0x0a3d('0x13'));var utils=require(_0x0a3d('0x14'));var config=require(_0x0a3d('0x15'));var licenseUtil=require(_0x0a3d('0x16'));var db=require(_0x0a3d('0x17'))['db'];config['redis']=_[_0x0a3d('0x18')](config[_0x0a3d('0x19')],{'host':_0x0a3d('0x1a'),'port':0x18eb});var socket=require(_0x0a3d('0x1b'))(new Redis(config[_0x0a3d('0x19')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x34b664,_0xdb1696){_0xdb1696=_0xdb1696||0xcc;return function(_0x1fa485){if(_0x1fa485){return _0x34b664[_0x0a3d('0x1c')](_0xdb1696);}return _0x34b664['status'](_0xdb1696)[_0x0a3d('0x1d')]();};}function respondWithResult(_0x16977e,_0x50fd88){_0x50fd88=_0x50fd88||0xc8;return function(_0x5b1d5c){if(_0x5b1d5c){return _0x16977e[_0x0a3d('0x1e')](_0x50fd88)[_0x0a3d('0x1f')](_0x5b1d5c);}};}function respondWithFilteredResult(_0x396864,_0x3ece78){return function(_0x2eae82){if(_0x2eae82){var _0x37b45d=typeof _0x3ece78[_0x0a3d('0x20')]==='undefined'&&typeof _0x3ece78[_0x0a3d('0x21')]===_0x0a3d('0x22');var _0x4d074e=_0x2eae82[_0x0a3d('0x23')];var _0x2bfd24=_0x37b45d?0x0:_0x3ece78[_0x0a3d('0x20')];var _0x542976=_0x37b45d?_0x2eae82[_0x0a3d('0x23')]:_0x3ece78['offset']+_0x3ece78[_0x0a3d('0x21')];var _0x355fdb;if(_0x542976>=_0x4d074e){_0x542976=_0x4d074e;_0x355fdb=0xc8;}else{_0x355fdb=0xce;}_0x396864[_0x0a3d('0x1e')](_0x355fdb);return _0x396864['set'](_0x0a3d('0x24'),_0x2bfd24+'-'+_0x542976+'/'+_0x4d074e)[_0x0a3d('0x1f')](_0x2eae82);}return null;};}function patchUpdates(_0x527c8f){return function(_0xf8dba){try{jsonpatch[_0x0a3d('0x25')](_0xf8dba,_0x527c8f,!![]);}catch(_0xb4fc29){return BPromise[_0x0a3d('0x26')](_0xb4fc29);}return _0xf8dba[_0x0a3d('0x27')]();};}function saveUpdates(_0x331e8f,_0x486334){return function(_0x1aa555){if(_0x1aa555){return _0x1aa555['update'](_0x331e8f)['then'](function(_0x56080c){return _0x56080c;});}return null;};}function removeEntity(_0x3ce603,_0x4995dc){return function(_0x4772dd){if(_0x4772dd){return _0x4772dd[_0x0a3d('0x28')]()['then'](function(){var _0x15f210=_0x4772dd['get']({'plain':!![]});var _0x115564=_0x0a3d('0x29');return db[_0x0a3d('0x2a')]['destroy']({'where':{'type':_0x115564,'resourceId':_0x15f210['id']}})[_0x0a3d('0x2b')](function(){return _0x4772dd;});})['then'](function(){_0x3ce603[_0x0a3d('0x1e')](0xcc)[_0x0a3d('0x1d')]();});}};}function handleEntityNotFound(_0x56e415,_0x120832){return function(_0x36aae1){if(!_0x36aae1){_0x56e415[_0x0a3d('0x1c')](0x194);}return _0x36aae1;};}function handleError(_0x4a7dde,_0x1173ab){_0x1173ab=_0x1173ab||0x1f4;return function(_0x5cf66d){logger[_0x0a3d('0x2c')](_0x5cf66d['stack']);if(_0x5cf66d[_0x0a3d('0x2d')]){delete _0x5cf66d[_0x0a3d('0x2d')];}_0x4a7dde[_0x0a3d('0x1e')](_0x1173ab)[_0x0a3d('0x2e')](_0x5cf66d);};}exports[_0x0a3d('0x2f')]=function(_0x1ffaf9,_0x288d1f){var _0x3de3c9={},_0x14e3e6={},_0x4fc53a={'count':0x0,'rows':[]};var _0x5e329a=_[_0x0a3d('0x30')](db[_0x0a3d('0x31')]['rawAttributes'],function(_0x42b6e0){return{'name':_0x42b6e0[_0x0a3d('0x32')],'type':_0x42b6e0['type'][_0x0a3d('0x33')]};});_0x14e3e6[_0x0a3d('0x34')]=_['map'](_0x5e329a,_0x0a3d('0x2d'));_0x14e3e6[_0x0a3d('0x35')]=_[_0x0a3d('0x36')](_0x1ffaf9[_0x0a3d('0x35')]);_0x14e3e6['filters']=_[_0x0a3d('0x37')](_0x14e3e6[_0x0a3d('0x34')],_0x14e3e6['query']);_0x3de3c9[_0x0a3d('0x38')]=_[_0x0a3d('0x37')](_0x14e3e6[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x3de3c9[_0x0a3d('0x38')]=_0x3de3c9[_0x0a3d('0x38')][_0x0a3d('0x3a')]?_0x3de3c9[_0x0a3d('0x38')]:_0x14e3e6['model'];if(!_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x3b')](_0x0a3d('0x3c'))){_0x3de3c9[_0x0a3d('0x21')]=qs[_0x0a3d('0x21')](_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x21')]);_0x3de3c9[_0x0a3d('0x20')]=qs['offset'](_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x20')]);}_0x3de3c9[_0x0a3d('0x3d')]=qs[_0x0a3d('0x3e')](_0x1ffaf9['query'][_0x0a3d('0x3e')]);_0x3de3c9[_0x0a3d('0x3f')]=qs['filters'](_[_0x0a3d('0x40')](_0x1ffaf9[_0x0a3d('0x35')],_0x14e3e6[_0x0a3d('0x41')]),_0x5e329a);if(_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x3de3c9[_0x0a3d('0x3f')]=_['merge'](_0x3de3c9[_0x0a3d('0x3f')],{'$or':_[_0x0a3d('0x30')](_0x5e329a,function(_0x13fb3e){if(_0x13fb3e[_0x0a3d('0x43')]!==_0x0a3d('0x44')){var _0x24505b={};_0x24505b[_0x13fb3e[_0x0a3d('0x2d')]]={'$like':'%'+_0x1ffaf9[_0x0a3d('0x35')]['filter']+'%'};return _0x24505b;}})});}_0x3de3c9=_['merge']({},_0x3de3c9,_0x1ffaf9[_0x0a3d('0x45')]);var _0x10a97e={'where':_0x3de3c9[_0x0a3d('0x3f')]};return db[_0x0a3d('0x31')][_0x0a3d('0x23')](_0x10a97e)['then'](function(_0x4b610b){_0x4fc53a['count']=_0x4b610b;if(_0x1ffaf9[_0x0a3d('0x35')][_0x0a3d('0x46')]){_0x3de3c9[_0x0a3d('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x0a3d('0x48')](_0x3de3c9);})['then'](function(_0x57dcbd){_0x4fc53a[_0x0a3d('0x49')]=_0x57dcbd;return _0x4fc53a;})[_0x0a3d('0x2b')](respondWithFilteredResult(_0x288d1f,_0x3de3c9))[_0x0a3d('0x4a')](handleError(_0x288d1f,null));};exports[_0x0a3d('0x4b')]=function(_0x38e45f,_0x51102d){var _0x2a9d57={'raw':!![],'where':{'id':_0x38e45f['params']['id']}},_0x3ceb09={};_0x3ceb09[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db[_0x0a3d('0x31')][_0x0a3d('0x4c')]);_0x3ceb09['query']=_['keys'](_0x38e45f[_0x0a3d('0x35')]);_0x3ceb09[_0x0a3d('0x41')]=_[_0x0a3d('0x37')](_0x3ceb09[_0x0a3d('0x34')],_0x3ceb09[_0x0a3d('0x35')]);_0x2a9d57[_0x0a3d('0x38')]=_['intersection'](_0x3ceb09[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x38e45f[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x2a9d57[_0x0a3d('0x38')]=_0x2a9d57[_0x0a3d('0x38')][_0x0a3d('0x3a')]?_0x2a9d57['attributes']:_0x3ceb09[_0x0a3d('0x34')];if(_0x38e45f[_0x0a3d('0x35')][_0x0a3d('0x46')]){_0x2a9d57[_0x0a3d('0x47')]=[{'all':!![]}];}_0x2a9d57=_[_0x0a3d('0x4d')]({},_0x2a9d57,_0x38e45f[_0x0a3d('0x45')]);return db[_0x0a3d('0x31')][_0x0a3d('0x4e')](_0x2a9d57)[_0x0a3d('0x2b')](handleEntityNotFound(_0x51102d,null))[_0x0a3d('0x2b')](respondWithResult(_0x51102d,null))['catch'](handleError(_0x51102d,null));};exports[_0x0a3d('0x4f')]=function(_0x37da59,_0x51e51e){return db[_0x0a3d('0x31')][_0x0a3d('0x4f')](_0x37da59[_0x0a3d('0x50')],{})[_0x0a3d('0x2b')](function(_0xc65d59){var _0x25dbb2=_0x37da59['user'][_0x0a3d('0x51')]({'plain':!![]});if(!_0x25dbb2)throw new Error(_0x0a3d('0x52'));if(_0x25dbb2[_0x0a3d('0x53')]===_0x0a3d('0x54')){var _0x2d61c6=_0xc65d59[_0x0a3d('0x51')]({'plain':!![]});var _0x550cc0=_0x0a3d('0x29');return db[_0x0a3d('0x55')]['find']({'where':{'name':_0x550cc0,'userProfileId':_0x25dbb2[_0x0a3d('0x56')]},'raw':!![]})[_0x0a3d('0x2b')](function(_0x11a4e1){if(_0x11a4e1&&_0x11a4e1[_0x0a3d('0x57')]===0x0){return db[_0x0a3d('0x2a')][_0x0a3d('0x4f')]({'name':_0x2d61c6[_0x0a3d('0x2d')],'resourceId':_0x2d61c6['id'],'type':_0x11a4e1[_0x0a3d('0x2d')],'sectionId':_0x11a4e1['id']},{})[_0x0a3d('0x2b')](function(){return _0xc65d59;});}else{return _0xc65d59;}})['catch'](function(_0x52a055){logger[_0x0a3d('0x2c')](_0x0a3d('0x58'),_0x52a055);throw _0x52a055;});}return _0xc65d59;})[_0x0a3d('0x2b')](respondWithResult(_0x51e51e,0xc9))[_0x0a3d('0x4a')](handleError(_0x51e51e,null));};exports[_0x0a3d('0x59')]=function(_0x836704,_0x43fea4){if(_0x836704[_0x0a3d('0x50')]['id']){delete _0x836704[_0x0a3d('0x50')]['id'];}return db[_0x0a3d('0x31')][_0x0a3d('0x4e')]({'where':{'id':_0x836704[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x43fea4,null))[_0x0a3d('0x2b')](saveUpdates(_0x836704[_0x0a3d('0x50')],null))[_0x0a3d('0x2b')](respondWithResult(_0x43fea4,null))[_0x0a3d('0x4a')](handleError(_0x43fea4,null));};exports['destroy']=function(_0x46de70,_0x74e8fc){return db[_0x0a3d('0x31')][_0x0a3d('0x4e')]({'where':{'id':_0x46de70[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x74e8fc,null))['then'](removeEntity(_0x74e8fc,null))[_0x0a3d('0x4a')](handleError(_0x74e8fc,null));};exports[_0x0a3d('0x5b')]=function(_0x6894a3,_0xfb7494){return db['FaxQueue'][_0x0a3d('0x5b')]()['then'](respondWithResult(_0xfb7494,null))[_0x0a3d('0x4a')](handleError(_0xfb7494,null));};exports['getMembers']=function(_0x3b2340,_0x370cd1,_0x2707b9){var _0x5778c2={'raw':!![],'where':{}},_0x1ff5ac={},_0x47adf6;return db[_0x0a3d('0x31')][_0x0a3d('0x5c')]({'where':{'id':_0x3b2340[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x370cd1,null))[_0x0a3d('0x2b')](function(_0x30024b){if(_0x30024b){_0x47adf6=_0x30024b[_0x0a3d('0x51')]({'plain':!![]});_0x1ff5ac[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db[_0x0a3d('0x5d')][_0x0a3d('0x4c')]);_0x1ff5ac[_0x0a3d('0x35')]=_[_0x0a3d('0x36')](_0x3b2340['query']);_0x1ff5ac[_0x0a3d('0x41')]=_['intersection'](_0x1ff5ac[_0x0a3d('0x34')],_0x1ff5ac[_0x0a3d('0x35')]);_0x5778c2[_0x0a3d('0x38')]=_[_0x0a3d('0x37')](_0x1ff5ac[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x3b2340['query'][_0x0a3d('0x39')]));_0x5778c2[_0x0a3d('0x38')]=_0x5778c2[_0x0a3d('0x38')][_0x0a3d('0x3a')]?_0x5778c2['attributes']:_0x1ff5ac['model'];if(!_0x3b2340['query']['hasOwnProperty'](_0x0a3d('0x3c'))){_0x5778c2[_0x0a3d('0x21')]=qs[_0x0a3d('0x21')](_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x21')]);_0x5778c2['offset']=qs[_0x0a3d('0x20')](_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x20')]);}_0x5778c2[_0x0a3d('0x3d')]=qs[_0x0a3d('0x3e')](_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x3e')]);_0x5778c2['where']=qs[_0x0a3d('0x41')](_[_0x0a3d('0x40')](_0x3b2340['query'],_0x1ff5ac['filters']));_0x5778c2[_0x0a3d('0x3f')]['FaxQueueId']=_0x30024b['id'];if(_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x5778c2[_0x0a3d('0x3f')]=_[_0x0a3d('0x4d')](_0x5778c2[_0x0a3d('0x3f')],{'$or':_[_0x0a3d('0x30')](_0x5778c2[_0x0a3d('0x38')],function(_0x3ac44a){var _0x27b629={};_0x27b629[_0x3ac44a]={'$like':'%'+_0x3b2340[_0x0a3d('0x35')][_0x0a3d('0x42')]+'%'};return _0x27b629;})});}_0x5778c2=_[_0x0a3d('0x4d')]({},_0x5778c2,_0x3b2340['options']);return db['UserFaxQueue'][_0x0a3d('0x48')](_0x5778c2);}})[_0x0a3d('0x2b')](function(_0x1c5568){if(_0x1c5568){return db[_0x0a3d('0x5e')][_0x0a3d('0x5f')]({'where':{'id':_['map'](_0x1c5568,'UserId'),'role':_0x0a3d('0x60')},'attributes':['id',_0x0a3d('0x2d'),_0x0a3d('0x61'),'updatedAt',_0x0a3d('0x62')]});}})[_0x0a3d('0x2b')](function(_0x235659){if(_0x235659){return{'count':_0x235659[_0x0a3d('0x23')],'rows':_[_0x0a3d('0x30')](_0x235659[_0x0a3d('0x49')],function(_0xacc1ef){return{'membername':_0xacc1ef['name'],'UserId':_0xacc1ef['id'],'queue_name':_0x47adf6[_0x0a3d('0x2d')],'FaxQueueId':_0x47adf6['id'],'interface':util[_0x0a3d('0x63')](_0x0a3d('0x64'),_0x0a3d('0x65'),_0xacc1ef[_0x0a3d('0x2d')]),'penalty':0x0,'paused':_0xacc1ef[_0x0a3d('0x61')],'createdAt':_0xacc1ef[_0x0a3d('0x62')],'updatedAt':_0xacc1ef[_0x0a3d('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0a3d('0x2b')](respondWithFilteredResult(_0x370cd1,_0x5778c2))['catch'](handleError(_0x370cd1,null));};exports[_0x0a3d('0x67')]=function(_0x332d72,_0x36ab0f,_0x2f01b6){var _0x42314f={};var _0x399382={};var _0x3b95bb;var _0x2e3902;return db[_0x0a3d('0x31')][_0x0a3d('0x5c')]({'where':{'id':_0x332d72[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x36ab0f,null))[_0x0a3d('0x2b')](function(_0x511c2a){if(_0x511c2a){_0x3b95bb=_0x511c2a;_0x399382[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db['Team'][_0x0a3d('0x4c')]);_0x399382['query']=_[_0x0a3d('0x36')](_0x332d72['query']);_0x399382[_0x0a3d('0x41')]=_[_0x0a3d('0x37')](_0x399382[_0x0a3d('0x34')],_0x399382[_0x0a3d('0x35')]);_0x42314f[_0x0a3d('0x38')]=_[_0x0a3d('0x37')](_0x399382[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x42314f[_0x0a3d('0x38')]=_0x42314f[_0x0a3d('0x38')]['length']?_0x42314f['attributes']:_0x399382[_0x0a3d('0x34')];_0x42314f['order']=qs[_0x0a3d('0x3e')](_0x332d72[_0x0a3d('0x35')]['sort']);_0x42314f[_0x0a3d('0x3f')]=qs[_0x0a3d('0x41')](_[_0x0a3d('0x40')](_0x332d72[_0x0a3d('0x35')],_0x399382[_0x0a3d('0x41')]));if(_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x42314f[_0x0a3d('0x3f')]=_[_0x0a3d('0x4d')](_0x42314f[_0x0a3d('0x3f')],{'$or':_[_0x0a3d('0x30')](_0x42314f[_0x0a3d('0x38')],function(_0x344eb7){var _0xdee8ad={};_0xdee8ad[_0x344eb7]={'$like':'%'+_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x42')]+'%'};return _0xdee8ad;})});}_0x42314f=_[_0x0a3d('0x4d')]({},_0x42314f,_0x332d72[_0x0a3d('0x45')]);return _0x3b95bb[_0x0a3d('0x67')](_0x42314f);}})['then'](function(_0x87a3bb){if(_0x87a3bb){_0x2e3902=_0x87a3bb[_0x0a3d('0x3a')];if(!_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x3b')](_0x0a3d('0x3c'))){_0x42314f['limit']=qs[_0x0a3d('0x21')](_0x332d72['query'][_0x0a3d('0x21')]);_0x42314f[_0x0a3d('0x20')]=qs[_0x0a3d('0x20')](_0x332d72[_0x0a3d('0x35')][_0x0a3d('0x20')]);}return _0x3b95bb[_0x0a3d('0x67')](_0x42314f);}})[_0x0a3d('0x2b')](function(_0x4a7049){if(_0x4a7049){return _0x4a7049?{'count':_0x2e3902,'rows':_0x4a7049}:null;}})[_0x0a3d('0x2b')](respondWithResult(_0x36ab0f,null))[_0x0a3d('0x4a')](handleError(_0x36ab0f,null));};exports[_0x0a3d('0x68')]=function(_0xa1b276,_0x4b4305,_0x46834d){var _0x23bb88=_0xa1b276[_0x0a3d('0x50')][_0x0a3d('0x69')];return db[_0x0a3d('0x6a')][_0x0a3d('0x48')]({'where':{'id':_0x23bb88},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a3d('0x6b'),'attributes':['id',_0x0a3d('0x2d'),_0x0a3d('0x6c'),'voicePause',_0x0a3d('0x6d')],'raw':!![]}]})['then'](function(_0x44e7f2){if(_0x44e7f2){var _0x3aaec0=_[_0x0a3d('0x6e')](_0x44e7f2,function(_0x1769a6){var _0x4d4d44=_0x1769a6[_0x0a3d('0x51')]({'plain':!![]});return _0x4d4d44[_0x0a3d('0x6b')];});return db['FaxQueue'][_0x0a3d('0x4e')]({'where':{'id':_0xa1b276[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](function(_0x25e5c9){return db[_0x0a3d('0x6f')][_0x0a3d('0x70')](function(_0x4c40a2){return _0x25e5c9[_0x0a3d('0x68')](_0x23bb88,{'transaction':_0x4c40a2})['then'](function(){return BPromise[_0x0a3d('0x71')](_0x3aaec0,function(_0x144392){return db[_0x0a3d('0x5d')][_0x0a3d('0x72')]({'where':{'UserId':_0x144392['id'],'FaxQueueId':_0xa1b276[_0x0a3d('0x5a')]['id']},'transaction':_0x4c40a2});});})[_0x0a3d('0x2b')](function(){_0x3aaec0[_0x0a3d('0x73')](function(_0x34ae88){socket[_0x0a3d('0x74')]('userFaxQueue:save',{'UserId':_0x34ae88['id'],'FaxQueueId':_0x25e5c9['id']});});});});});}})['then'](respondWithStatusCode(_0x4b4305,null))['catch'](handleError(_0x4b4305,null));};exports['removeTeams']=function(_0x4d958b,_0x8438a9,_0x2bfb00){return db['Team']['findAll']({'where':{'id':_0x4d958b[_0x0a3d('0x35')][_0x0a3d('0x69')]},'attributes':['id'],'include':[{'model':db[_0x0a3d('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0a3d('0x2b')](handleEntityNotFound(_0x8438a9,null))[_0x0a3d('0x2b')](function(_0x2fc1a5){var _0x603ee1=_[_0x0a3d('0x30')](_0x2fc1a5,'id');var _0x196366=[];var _0x5794c4=[];var _0x52ab19=squel[_0x0a3d('0x75')]();_0x52ab19[_0x0a3d('0x76')]('tq.TeamId')[_0x0a3d('0x77')](_0x0a3d('0x78'),'tq')[_0x0a3d('0x79')](_0x0a3d('0x7a'),'ut',_0x0a3d('0x7b'))[_0x0a3d('0x3f')](_0x0a3d('0x7c'),_0x4d958b['params']['id']);for(var _0x35977a=0x0;_0x35977a<_0x2fc1a5[_0x0a3d('0x3a')];_0x35977a+=0x1){let _0x1608ec=_0x2fc1a5[_0x35977a];for(var _0x3b9089=0x0;_0x3b9089<_0x1608ec['Agents'][_0x0a3d('0x3a')];_0x3b9089+=0x1){let _0x2e2863=_0x1608ec[_0x0a3d('0x6b')][_0x3b9089];var _0x14263d=_0x52ab19[_0x0a3d('0x7d')]();_0x14263d[_0x0a3d('0x3f')]('ut.UserId\x20=\x20?',_0x2e2863['id']);_0x5794c4[_0x0a3d('0x7e')](db['sequelize']['query'](_0x14263d[_0x0a3d('0x7f')](),{'type':db[_0x0a3d('0x6f')][_0x0a3d('0x80')][_0x0a3d('0x81')]})['then'](function(_0x5a619a){if(_0x5a619a[_0x0a3d('0x3a')]===0x1){return _0x2e2863['id'];}else{var _0x321703=_[_0x0a3d('0x82')](_[_0x0a3d('0x30')](_0x5a619a,_0x0a3d('0x83')),function(_0x170f77){return _[_0x0a3d('0x84')](_0x603ee1,_0x170f77);});if(_0x321703){return _0x2e2863['id'];}}}));}}return BPromise['all'](_0x5794c4)[_0x0a3d('0x2b')](function(_0x4f36ed){_0x196366=_(_0x196366)[_0x0a3d('0x85')](_0x4f36ed)[_0x0a3d('0x86')]()[_0x0a3d('0x87')]();return db['FaxQueue']['find']({'where':{'id':_0x4d958b[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](function(_0x3488a1){return db[_0x0a3d('0x6f')][_0x0a3d('0x70')](function(_0x49fc02){return _0x3488a1[_0x0a3d('0x88')](_0x4d958b[_0x0a3d('0x35')][_0x0a3d('0x69')],{'transaction':_0x49fc02})[_0x0a3d('0x2b')](function(){if(!_['isEmpty'](_0x196366)){return _0x3488a1[_0x0a3d('0x89')](_0x196366,{'transaction':_0x49fc02});}})[_0x0a3d('0x2b')](function(){_0x196366[_0x0a3d('0x73')](function(_0x2201e){socket[_0x0a3d('0x74')](_0x0a3d('0x8a'),{'UserId':_0x2201e,'FaxQueueId':_0x3488a1['id']});});});});});});})['then'](respondWithStatusCode(_0x8438a9,null))[_0x0a3d('0x4a')](handleError(_0x8438a9,null));};exports[_0x0a3d('0x8b')]=function(_0x30629d,_0x257fed,_0x3205d0){return db[_0x0a3d('0x31')][_0x0a3d('0x4e')]({'where':{'id':_0x30629d[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x257fed,null))[_0x0a3d('0x2b')](function(_0x19c2fa){if(_0x19c2fa){return _0x19c2fa[_0x0a3d('0x8b')](_0x30629d[_0x0a3d('0x50')][_0x0a3d('0x69')],_['omit'](_0x30629d[_0x0a3d('0x50')],[_0x0a3d('0x69'),'id'])||{})[_0x0a3d('0x8c')](function(_0x49e611){for(var _0x56b8f8=0x0;_0x56b8f8<_0x30629d[_0x0a3d('0x50')]['ids'][_0x0a3d('0x3a')];_0x56b8f8+=0x1){socket[_0x0a3d('0x74')](_0x0a3d('0x8d'),{'UserId':Number(_0x30629d['body'][_0x0a3d('0x69')][_0x56b8f8]),'FaxQueueId':Number(_0x30629d[_0x0a3d('0x5a')]['id'])});}return _0x49e611;});}})[_0x0a3d('0x2b')](respondWithResult(_0x257fed,null))[_0x0a3d('0x4a')](handleError(_0x257fed,null));};exports[_0x0a3d('0x89')]=function(_0x579a88,_0x4343fa,_0xf8df00){return db['FaxQueue'][_0x0a3d('0x4e')]({'where':{'id':_0x579a88[_0x0a3d('0x5a')]['id']}})[_0x0a3d('0x2b')](handleEntityNotFound(_0x4343fa,null))['then'](function(_0x35f15c){if(_0x35f15c){return _0x35f15c['removeAgents'](_0x579a88[_0x0a3d('0x35')][_0x0a3d('0x69')])[_0x0a3d('0x2b')](function(){if(_[_0x0a3d('0x8e')](_0x579a88[_0x0a3d('0x35')][_0x0a3d('0x69')])){for(var _0x214678=0x0;_0x214678<_0x579a88['query'][_0x0a3d('0x69')]['length'];_0x214678+=0x1){socket[_0x0a3d('0x74')](_0x0a3d('0x8a'),{'UserId':Number(_0x579a88['query'][_0x0a3d('0x69')][_0x214678]),'FaxQueueId':Number(_0x579a88[_0x0a3d('0x5a')]['id'])});}}else{socket[_0x0a3d('0x74')](_0x0a3d('0x8a'),{'UserId':Number(_0x579a88[_0x0a3d('0x35')][_0x0a3d('0x69')]),'FaxQueueId':Number(_0x579a88[_0x0a3d('0x5a')]['id'])});}});}})[_0x0a3d('0x2b')](respondWithStatusCode(_0x4343fa,null))[_0x0a3d('0x4a')](handleError(_0x4343fa,null));};exports[_0x0a3d('0x8f')]=function(_0x33eb70,_0x4ef90c,_0x34e7c7){var _0x5506dc={};var _0x277cfb={};var _0x1c5d2f;var _0x86b58e;return db[_0x0a3d('0x31')][_0x0a3d('0x5c')]({'where':{'id':_0x33eb70[_0x0a3d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ef90c,null))[_0x0a3d('0x2b')](function(_0x30151f){if(_0x30151f){_0x1c5d2f=_0x30151f;_0x277cfb[_0x0a3d('0x34')]=_[_0x0a3d('0x36')](db[_0x0a3d('0x5e')][_0x0a3d('0x4c')]);_0x277cfb[_0x0a3d('0x35')]=_['keys'](_0x33eb70[_0x0a3d('0x35')]);_0x277cfb[_0x0a3d('0x41')]=_[_0x0a3d('0x37')](_0x277cfb[_0x0a3d('0x34')],_0x277cfb[_0x0a3d('0x35')]);_0x5506dc['attributes']=_[_0x0a3d('0x37')](_0x277cfb[_0x0a3d('0x34')],qs[_0x0a3d('0x39')](_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x39')]));_0x5506dc[_0x0a3d('0x38')]=_0x5506dc[_0x0a3d('0x38')]['length']?_0x5506dc['attributes']:_0x277cfb[_0x0a3d('0x34')];_0x5506dc['order']=qs[_0x0a3d('0x3e')](_0x33eb70['query'][_0x0a3d('0x3e')]);_0x5506dc[_0x0a3d('0x3f')]=qs[_0x0a3d('0x41')](_['pick'](_0x33eb70['query'],_0x277cfb[_0x0a3d('0x41')]));if(_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x42')]){_0x5506dc['where']=_[_0x0a3d('0x4d')](_0x5506dc[_0x0a3d('0x3f')],{'$or':_['map'](_0x5506dc[_0x0a3d('0x38')],function(_0x3dc2de){var _0x4f5fca={};_0x4f5fca[_0x3dc2de]={'$like':'%'+_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x42')]+'%'};return _0x4f5fca;})});}_0x5506dc=_[_0x0a3d('0x4d')]({},_0x5506dc,_0x33eb70['options']);return _0x1c5d2f['getAgents'](_0x5506dc);}})['then'](function(_0xc91463){if(_0xc91463){_0x86b58e=_0xc91463[_0x0a3d('0x3a')];if(!_0x33eb70[_0x0a3d('0x35')]['hasOwnProperty'](_0x0a3d('0x3c'))){_0x5506dc[_0x0a3d('0x21')]=qs[_0x0a3d('0x21')](_0x33eb70[_0x0a3d('0x35')]['limit']);_0x5506dc[_0x0a3d('0x20')]=qs['offset'](_0x33eb70[_0x0a3d('0x35')][_0x0a3d('0x20')]);}return _0x1c5d2f[_0x0a3d('0x8f')](_0x5506dc);}})[_0x0a3d('0x2b')](function(_0x3c3dc2){if(_0x3c3dc2){return _0x3c3dc2?{'count':_0x86b58e,'rows':_0x3c3dc2}:null;}})[_0x0a3d('0x2b')](respondWithResult(_0x4ef90c,null))['catch'](handleError(_0x4ef90c,null));}; \ No newline at end of file +var _0x39e3=['map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','include','rows','show','params','rawAttributes','length','includeAll','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','findOne','UserFaxQueue','order','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','flatMap','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','Agents','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','includes','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','destroy','error','stack','name','send','index','FaxQueue','fieldName','type','key','model'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x39e3,0xe6));var _0x339e=function(_0x526924,_0x529ac3){_0x526924=_0x526924-0x0;var _0x570684=_0x39e3[_0x526924];return _0x570684;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x339e('0x0'));var zipdir=require(_0x339e('0x1'));var jsonpatch=require(_0x339e('0x2'));var rp=require(_0x339e('0x3'));var moment=require(_0x339e('0x4'));var BPromise=require(_0x339e('0x5'));var Mustache=require(_0x339e('0x6'));var util=require(_0x339e('0x7'));var path=require('path');var sox=require(_0x339e('0x8'));var csv=require(_0x339e('0x9'));var ejs=require(_0x339e('0xa'));var fs=require('fs');var fs_extra=require(_0x339e('0xb'));var _=require(_0x339e('0xc'));var squel=require(_0x339e('0xd'));var crypto=require(_0x339e('0xe'));var jsforce=require(_0x339e('0xf'));var deskjs=require(_0x339e('0x10'));var toCsv=require(_0x339e('0x9'));var querystring=require(_0x339e('0x11'));var Papa=require('papaparse');var Redis=require(_0x339e('0x12'));var authService=require(_0x339e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x339e('0x14'));var hardwareService=require(_0x339e('0x15'));var logger=require(_0x339e('0x16'))(_0x339e('0x17'));var utils=require(_0x339e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x339e('0x19'));var db=require(_0x339e('0x1a'))['db'];config[_0x339e('0x1b')]=_['defaults'](config[_0x339e('0x1b')],{'host':_0x339e('0x1c'),'port':0x18eb});var socket=require(_0x339e('0x1d'))(new Redis(config[_0x339e('0x1b')]));require(_0x339e('0x1e'))[_0x339e('0x1f')](socket);function respondWithStatusCode(_0xaed5d,_0x33c5a2){_0x33c5a2=_0x33c5a2||0xcc;return function(_0x21cb14){if(_0x21cb14){return _0xaed5d[_0x339e('0x20')](_0x33c5a2);}return _0xaed5d[_0x339e('0x21')](_0x33c5a2)[_0x339e('0x22')]();};}function respondWithResult(_0x3756c3,_0x25cf78){_0x25cf78=_0x25cf78||0xc8;return function(_0x1730e1){if(_0x1730e1){return _0x3756c3[_0x339e('0x21')](_0x25cf78)[_0x339e('0x23')](_0x1730e1);}};}function respondWithFilteredResult(_0x5c6b2f,_0x402e25){return function(_0x2075b9){if(_0x2075b9){var _0x36b92f=typeof _0x402e25[_0x339e('0x24')]==='undefined'&&typeof _0x402e25[_0x339e('0x25')]===_0x339e('0x26');var _0x131a2a=_0x2075b9[_0x339e('0x27')];var _0x4a342b=_0x36b92f?0x0:_0x402e25[_0x339e('0x24')];var _0xfefa9b=_0x36b92f?_0x2075b9[_0x339e('0x27')]:_0x402e25[_0x339e('0x24')]+_0x402e25[_0x339e('0x25')];var _0x54f776;if(_0xfefa9b>=_0x131a2a){_0xfefa9b=_0x131a2a;_0x54f776=0xc8;}else{_0x54f776=0xce;}_0x5c6b2f[_0x339e('0x21')](_0x54f776);return _0x5c6b2f[_0x339e('0x28')](_0x339e('0x29'),_0x4a342b+'-'+_0xfefa9b+'/'+_0x131a2a)['json'](_0x2075b9);}return null;};}function patchUpdates(_0x58de4e){return function(_0x418008){try{jsonpatch[_0x339e('0x2a')](_0x418008,_0x58de4e,!![]);}catch(_0x41ae91){return BPromise[_0x339e('0x2b')](_0x41ae91);}return _0x418008[_0x339e('0x2c')]();};}function saveUpdates(_0x269d97,_0x11a3a4){return function(_0x275a14){if(_0x275a14){return _0x275a14['update'](_0x269d97)[_0x339e('0x2d')](function(_0x298e5b){return _0x298e5b;});}return null;};}function removeEntity(_0x5e692d,_0x9ae07f){return function(_0x8416aa){if(_0x8416aa){return _0x8416aa['destroy']()[_0x339e('0x2d')](function(){var _0x2f2675=_0x8416aa[_0x339e('0x2e')]({'plain':!![]});var _0x52a0ad='FaxQueues';return db['UserProfileResource'][_0x339e('0x2f')]({'where':{'type':_0x52a0ad,'resourceId':_0x2f2675['id']}})[_0x339e('0x2d')](function(){return _0x8416aa;});})[_0x339e('0x2d')](function(){_0x5e692d[_0x339e('0x21')](0xcc)[_0x339e('0x22')]();});}};}function handleEntityNotFound(_0x47fa61,_0x2913e0){return function(_0x39910a){if(!_0x39910a){_0x47fa61['sendStatus'](0x194);}return _0x39910a;};}function handleError(_0x4a5128,_0x305829){_0x305829=_0x305829||0x1f4;return function(_0x2be549){logger[_0x339e('0x30')](_0x2be549[_0x339e('0x31')]);if(_0x2be549[_0x339e('0x32')]){delete _0x2be549['name'];}_0x4a5128[_0x339e('0x21')](_0x305829)[_0x339e('0x33')](_0x2be549);};}exports[_0x339e('0x34')]=function(_0x2d7fa3,_0xbd8f06){var _0x4d6a28={},_0x5b4aa1={},_0x4d0b6d={'count':0x0,'rows':[]};var _0x1bc2e4=_['map'](db[_0x339e('0x35')]['rawAttributes'],function(_0x577239){return{'name':_0x577239[_0x339e('0x36')],'type':_0x577239[_0x339e('0x37')][_0x339e('0x38')]};});_0x5b4aa1[_0x339e('0x39')]=_[_0x339e('0x3a')](_0x1bc2e4,'name');_0x5b4aa1[_0x339e('0x3b')]=_[_0x339e('0x3c')](_0x2d7fa3[_0x339e('0x3b')]);_0x5b4aa1['filters']=_[_0x339e('0x3d')](_0x5b4aa1['model'],_0x5b4aa1[_0x339e('0x3b')]);_0x4d6a28[_0x339e('0x3e')]=_[_0x339e('0x3d')](_0x5b4aa1[_0x339e('0x39')],qs[_0x339e('0x3f')](_0x2d7fa3['query'][_0x339e('0x3f')]));_0x4d6a28['attributes']=_0x4d6a28[_0x339e('0x3e')]['length']?_0x4d6a28['attributes']:_0x5b4aa1[_0x339e('0x39')];if(!_0x2d7fa3[_0x339e('0x3b')][_0x339e('0x40')](_0x339e('0x41'))){_0x4d6a28[_0x339e('0x25')]=qs['limit'](_0x2d7fa3[_0x339e('0x3b')][_0x339e('0x25')]);_0x4d6a28['offset']=qs['offset'](_0x2d7fa3[_0x339e('0x3b')][_0x339e('0x24')]);}_0x4d6a28['order']=qs['sort'](_0x2d7fa3[_0x339e('0x3b')][_0x339e('0x42')]);_0x4d6a28['where']=qs[_0x339e('0x43')](_[_0x339e('0x44')](_0x2d7fa3[_0x339e('0x3b')],_0x5b4aa1[_0x339e('0x43')]),_0x1bc2e4);if(_0x2d7fa3[_0x339e('0x3b')][_0x339e('0x45')]){_0x4d6a28['where']=_[_0x339e('0x46')](_0x4d6a28[_0x339e('0x47')],{'$or':_['map'](_0x1bc2e4,function(_0x4ec215){if(_0x4ec215['type']!==_0x339e('0x48')){var _0x3acbb3={};_0x3acbb3[_0x4ec215[_0x339e('0x32')]]={'$like':'%'+_0x2d7fa3[_0x339e('0x3b')][_0x339e('0x45')]+'%'};return _0x3acbb3;}})});}_0x4d6a28=_[_0x339e('0x46')]({},_0x4d6a28,_0x2d7fa3['options']);var _0x22574d={'where':_0x4d6a28[_0x339e('0x47')]};return db['FaxQueue'][_0x339e('0x27')](_0x22574d)[_0x339e('0x2d')](function(_0x47e00c){_0x4d0b6d[_0x339e('0x27')]=_0x47e00c;if(_0x2d7fa3[_0x339e('0x3b')]['includeAll']){_0x4d6a28[_0x339e('0x49')]=[{'all':!![]}];}return db[_0x339e('0x35')]['findAll'](_0x4d6a28);})['then'](function(_0x1789c8){_0x4d0b6d[_0x339e('0x4a')]=_0x1789c8;return _0x4d0b6d;})[_0x339e('0x2d')](respondWithFilteredResult(_0xbd8f06,_0x4d6a28))['catch'](handleError(_0xbd8f06,null));};exports[_0x339e('0x4b')]=function(_0x5ce205,_0x45d378){var _0x6302e1={'raw':!![],'where':{'id':_0x5ce205[_0x339e('0x4c')]['id']}},_0x3e911d={};_0x3e911d['model']=_['keys'](db[_0x339e('0x35')][_0x339e('0x4d')]);_0x3e911d[_0x339e('0x3b')]=_['keys'](_0x5ce205['query']);_0x3e911d[_0x339e('0x43')]=_[_0x339e('0x3d')](_0x3e911d[_0x339e('0x39')],_0x3e911d[_0x339e('0x3b')]);_0x6302e1[_0x339e('0x3e')]=_[_0x339e('0x3d')](_0x3e911d[_0x339e('0x39')],qs[_0x339e('0x3f')](_0x5ce205[_0x339e('0x3b')]['fields']));_0x6302e1[_0x339e('0x3e')]=_0x6302e1[_0x339e('0x3e')][_0x339e('0x4e')]?_0x6302e1[_0x339e('0x3e')]:_0x3e911d[_0x339e('0x39')];if(_0x5ce205[_0x339e('0x3b')][_0x339e('0x4f')]){_0x6302e1[_0x339e('0x49')]=[{'all':!![]}];}_0x6302e1=_[_0x339e('0x46')]({},_0x6302e1,_0x5ce205[_0x339e('0x50')]);return db[_0x339e('0x35')][_0x339e('0x51')](_0x6302e1)[_0x339e('0x2d')](handleEntityNotFound(_0x45d378,null))[_0x339e('0x2d')](respondWithResult(_0x45d378,null))[_0x339e('0x52')](handleError(_0x45d378,null));};exports[_0x339e('0x53')]=function(_0x37a1aa,_0x16d0ce){return db[_0x339e('0x35')][_0x339e('0x53')](_0x37a1aa[_0x339e('0x54')],{})[_0x339e('0x2d')](function(_0x7ea7c){var _0x275707=_0x37a1aa['user']['get']({'plain':!![]});if(!_0x275707)throw new Error(_0x339e('0x55'));if(_0x275707[_0x339e('0x56')]===_0x339e('0x57')){var _0x32692a=_0x7ea7c[_0x339e('0x2e')]({'plain':!![]});var _0x254788=_0x339e('0x58');return db[_0x339e('0x59')]['find']({'where':{'name':_0x254788,'userProfileId':_0x275707[_0x339e('0x5a')]},'raw':!![]})['then'](function(_0x3ca4ff){if(_0x3ca4ff&&_0x3ca4ff[_0x339e('0x5b')]===0x0){return db[_0x339e('0x5c')][_0x339e('0x53')]({'name':_0x32692a['name'],'resourceId':_0x32692a['id'],'type':_0x3ca4ff[_0x339e('0x32')],'sectionId':_0x3ca4ff['id']},{})[_0x339e('0x2d')](function(){return _0x7ea7c;});}else{return _0x7ea7c;}})['catch'](function(_0x2b4241){logger[_0x339e('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b4241);throw _0x2b4241;});}return _0x7ea7c;})[_0x339e('0x2d')](respondWithResult(_0x16d0ce,0xc9))[_0x339e('0x52')](handleError(_0x16d0ce,null));};exports[_0x339e('0x5d')]=function(_0x32e532,_0xc8803e){if(_0x32e532[_0x339e('0x54')]['id']){delete _0x32e532['body']['id'];}return db[_0x339e('0x35')][_0x339e('0x51')]({'where':{'id':_0x32e532[_0x339e('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc8803e,null))[_0x339e('0x2d')](saveUpdates(_0x32e532[_0x339e('0x54')],null))[_0x339e('0x2d')](respondWithResult(_0xc8803e,null))[_0x339e('0x52')](handleError(_0xc8803e,null));};exports[_0x339e('0x2f')]=function(_0x83a5a9,_0x112152){return db[_0x339e('0x35')]['find']({'where':{'id':_0x83a5a9['params']['id']}})['then'](handleEntityNotFound(_0x112152,null))[_0x339e('0x2d')](removeEntity(_0x112152,null))['catch'](handleError(_0x112152,null));};exports[_0x339e('0x5e')]=function(_0x262d42,_0x44a414){return db[_0x339e('0x35')][_0x339e('0x5e')]()[_0x339e('0x2d')](respondWithResult(_0x44a414,null))[_0x339e('0x52')](handleError(_0x44a414,null));};exports['getMembers']=function(_0xce91db,_0x50ce03,_0x61bf59){var _0x497853={'raw':!![],'where':{}},_0x46d9b1={},_0x4fd47c;return db['FaxQueue'][_0x339e('0x5f')]({'where':{'id':_0xce91db[_0x339e('0x4c')]['id']}})[_0x339e('0x2d')](handleEntityNotFound(_0x50ce03,null))['then'](function(_0x122263){if(_0x122263){_0x4fd47c=_0x122263[_0x339e('0x2e')]({'plain':!![]});_0x46d9b1[_0x339e('0x39')]=_[_0x339e('0x3c')](db[_0x339e('0x60')][_0x339e('0x4d')]);_0x46d9b1[_0x339e('0x3b')]=_[_0x339e('0x3c')](_0xce91db[_0x339e('0x3b')]);_0x46d9b1[_0x339e('0x43')]=_[_0x339e('0x3d')](_0x46d9b1[_0x339e('0x39')],_0x46d9b1[_0x339e('0x3b')]);_0x497853['attributes']=_['intersection'](_0x46d9b1[_0x339e('0x39')],qs[_0x339e('0x3f')](_0xce91db[_0x339e('0x3b')][_0x339e('0x3f')]));_0x497853[_0x339e('0x3e')]=_0x497853['attributes']['length']?_0x497853[_0x339e('0x3e')]:_0x46d9b1[_0x339e('0x39')];if(!_0xce91db[_0x339e('0x3b')]['hasOwnProperty']('nolimit')){_0x497853['limit']=qs[_0x339e('0x25')](_0xce91db['query']['limit']);_0x497853['offset']=qs['offset'](_0xce91db['query']['offset']);}_0x497853[_0x339e('0x61')]=qs['sort'](_0xce91db[_0x339e('0x3b')][_0x339e('0x42')]);_0x497853[_0x339e('0x47')]=qs[_0x339e('0x43')](_[_0x339e('0x44')](_0xce91db[_0x339e('0x3b')],_0x46d9b1[_0x339e('0x43')]));_0x497853[_0x339e('0x47')][_0x339e('0x62')]=_0x122263['id'];if(_0xce91db['query'][_0x339e('0x45')]){_0x497853['where']=_[_0x339e('0x46')](_0x497853['where'],{'$or':_[_0x339e('0x3a')](_0x497853[_0x339e('0x3e')],function(_0x2080f0){var _0x785d9b={};_0x785d9b[_0x2080f0]={'$like':'%'+_0xce91db[_0x339e('0x3b')]['filter']+'%'};return _0x785d9b;})});}_0x497853=_[_0x339e('0x46')]({},_0x497853,_0xce91db[_0x339e('0x50')]);return db[_0x339e('0x60')][_0x339e('0x63')](_0x497853);}})[_0x339e('0x2d')](function(_0x38625d){if(_0x38625d){return db[_0x339e('0x64')][_0x339e('0x65')]({'where':{'id':_[_0x339e('0x3a')](_0x38625d,_0x339e('0x66')),'role':_0x339e('0x67')},'attributes':['id',_0x339e('0x32'),_0x339e('0x68'),_0x339e('0x69'),_0x339e('0x6a')]});}})[_0x339e('0x2d')](function(_0x1886e3){if(_0x1886e3){return{'count':_0x1886e3[_0x339e('0x27')],'rows':_[_0x339e('0x3a')](_0x1886e3[_0x339e('0x4a')],function(_0x208622){return{'membername':_0x208622[_0x339e('0x32')],'UserId':_0x208622['id'],'queue_name':_0x4fd47c[_0x339e('0x32')],'FaxQueueId':_0x4fd47c['id'],'interface':util[_0x339e('0x6b')](_0x339e('0x6c'),_0x339e('0x6d'),_0x208622[_0x339e('0x32')]),'penalty':0x0,'paused':_0x208622[_0x339e('0x68')],'createdAt':_0x208622[_0x339e('0x6a')],'updatedAt':_0x208622[_0x339e('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x339e('0x2d')](respondWithFilteredResult(_0x50ce03,_0x497853))['catch'](handleError(_0x50ce03,null));};exports[_0x339e('0x6e')]=function(_0x4626dd,_0x3a6c31,_0x68cca8){var _0xd420dc={};var _0x4e73f2={};var _0x1e23c8;var _0x423146;return db['FaxQueue'][_0x339e('0x5f')]({'where':{'id':_0x4626dd[_0x339e('0x4c')]['id']}})[_0x339e('0x2d')](handleEntityNotFound(_0x3a6c31,null))[_0x339e('0x2d')](function(_0x29edc7){if(_0x29edc7){_0x1e23c8=_0x29edc7;_0x4e73f2['model']=_[_0x339e('0x3c')](db[_0x339e('0x6f')]['rawAttributes']);_0x4e73f2[_0x339e('0x3b')]=_[_0x339e('0x3c')](_0x4626dd[_0x339e('0x3b')]);_0x4e73f2['filters']=_[_0x339e('0x3d')](_0x4e73f2[_0x339e('0x39')],_0x4e73f2[_0x339e('0x3b')]);_0xd420dc[_0x339e('0x3e')]=_[_0x339e('0x3d')](_0x4e73f2['model'],qs[_0x339e('0x3f')](_0x4626dd[_0x339e('0x3b')][_0x339e('0x3f')]));_0xd420dc[_0x339e('0x3e')]=_0xd420dc[_0x339e('0x3e')][_0x339e('0x4e')]?_0xd420dc['attributes']:_0x4e73f2[_0x339e('0x39')];_0xd420dc['order']=qs['sort'](_0x4626dd[_0x339e('0x3b')][_0x339e('0x42')]);_0xd420dc[_0x339e('0x47')]=qs[_0x339e('0x43')](_[_0x339e('0x44')](_0x4626dd[_0x339e('0x3b')],_0x4e73f2[_0x339e('0x43')]));if(_0x4626dd['query'][_0x339e('0x45')]){_0xd420dc[_0x339e('0x47')]=_['merge'](_0xd420dc['where'],{'$or':_[_0x339e('0x3a')](_0xd420dc[_0x339e('0x3e')],function(_0x3d035c){var _0x3382df={};_0x3382df[_0x3d035c]={'$like':'%'+_0x4626dd[_0x339e('0x3b')][_0x339e('0x45')]+'%'};return _0x3382df;})});}_0xd420dc=_[_0x339e('0x46')]({},_0xd420dc,_0x4626dd[_0x339e('0x50')]);return _0x1e23c8[_0x339e('0x6e')](_0xd420dc);}})[_0x339e('0x2d')](function(_0x47fc0b){if(_0x47fc0b){_0x423146=_0x47fc0b[_0x339e('0x4e')];if(!_0x4626dd[_0x339e('0x3b')][_0x339e('0x40')](_0x339e('0x41'))){_0xd420dc[_0x339e('0x25')]=qs[_0x339e('0x25')](_0x4626dd[_0x339e('0x3b')][_0x339e('0x25')]);_0xd420dc[_0x339e('0x24')]=qs[_0x339e('0x24')](_0x4626dd[_0x339e('0x3b')][_0x339e('0x24')]);}return _0x1e23c8[_0x339e('0x6e')](_0xd420dc);}})[_0x339e('0x2d')](function(_0x486fa4){if(_0x486fa4){return _0x486fa4?{'count':_0x423146,'rows':_0x486fa4}:null;}})['then'](respondWithResult(_0x3a6c31,null))[_0x339e('0x52')](handleError(_0x3a6c31,null));};exports[_0x339e('0x70')]=function(_0x5aef30,_0x5f19f6,_0x18aab0){var _0x3aaec4=_0x5aef30[_0x339e('0x54')][_0x339e('0x71')];return db[_0x339e('0x6f')][_0x339e('0x63')]({'where':{'id':_0x3aaec4},'attributes':['id'],'include':[{'model':db[_0x339e('0x64')],'as':'Agents','attributes':['id','name',_0x339e('0x72'),'voicePause','interface'],'raw':!![]}]})[_0x339e('0x2d')](function(_0x2a6fc1){if(_0x2a6fc1){var _0x3fa891=_[_0x339e('0x73')](_0x2a6fc1,function(_0x316731){var _0xb2d144=_0x316731[_0x339e('0x2e')]({'plain':!![]});return _0xb2d144['Agents'];});return db['FaxQueue'][_0x339e('0x51')]({'where':{'id':_0x5aef30[_0x339e('0x4c')]['id']}})[_0x339e('0x2d')](function(_0x4db4e9){return db[_0x339e('0x74')][_0x339e('0x75')](function(_0x29a86e){return _0x4db4e9[_0x339e('0x70')](_0x3aaec4,{'transaction':_0x29a86e})[_0x339e('0x2d')](function(){return BPromise[_0x339e('0x76')](_0x3fa891,function(_0x43c93e){return db[_0x339e('0x60')]['findOrCreate']({'where':{'UserId':_0x43c93e['id'],'FaxQueueId':_0x5aef30[_0x339e('0x4c')]['id']},'transaction':_0x29a86e});});})['then'](function(){_0x3fa891[_0x339e('0x77')](function(_0x1b541b){socket[_0x339e('0x78')](_0x339e('0x79'),{'UserId':_0x1b541b['id'],'FaxQueueId':_0x4db4e9['id']});});});});});}})['then'](respondWithStatusCode(_0x5f19f6,null))[_0x339e('0x52')](handleError(_0x5f19f6,null));};exports[_0x339e('0x7a')]=function(_0x3c6469,_0x15b37e,_0x5bc2d7){return db[_0x339e('0x6f')][_0x339e('0x63')]({'where':{'id':_0x3c6469['query'][_0x339e('0x71')]},'attributes':['id'],'include':[{'model':db[_0x339e('0x64')],'as':_0x339e('0x7b'),'attributes':['id'],'raw':!![]}]})[_0x339e('0x2d')](handleEntityNotFound(_0x15b37e,null))[_0x339e('0x2d')](function(_0x405185){var _0x2420eb=_[_0x339e('0x3a')](_0x405185,'id');var _0x2056f9=[];var _0x536d7c=[];var _0x21d897=squel['select']();_0x21d897['field'](_0x339e('0x7c'))[_0x339e('0x7d')](_0x339e('0x7e'),'tq')[_0x339e('0x7f')](_0x339e('0x80'),'ut',_0x339e('0x81'))[_0x339e('0x47')]('FaxQueueId\x20=\x20?',_0x3c6469['params']['id']);for(var _0x3f963a=0x0;_0x3f963a<_0x405185[_0x339e('0x4e')];_0x3f963a+=0x1){let _0x100166=_0x405185[_0x3f963a];for(var _0x2f0c62=0x0;_0x2f0c62<_0x100166['Agents'][_0x339e('0x4e')];_0x2f0c62+=0x1){let _0x299b18=_0x100166[_0x339e('0x7b')][_0x2f0c62];var _0x2e1198=_0x21d897[_0x339e('0x82')]();_0x2e1198[_0x339e('0x47')]('ut.UserId\x20=\x20?',_0x299b18['id']);_0x536d7c[_0x339e('0x83')](db[_0x339e('0x74')][_0x339e('0x3b')](_0x2e1198[_0x339e('0x84')](),{'type':db['sequelize'][_0x339e('0x85')]['SELECT']})['then'](function(_0x56a984){if(_0x56a984[_0x339e('0x4e')]===0x1){return _0x299b18['id'];}else{var _0x5cf2f0=_['every'](_[_0x339e('0x3a')](_0x56a984,'TeamId'),function(_0x3c9be6){return _[_0x339e('0x86')](_0x2420eb,_0x3c9be6);});if(_0x5cf2f0){return _0x299b18['id'];}}}));}}return BPromise['all'](_0x536d7c)[_0x339e('0x2d')](function(_0x4a3732){_0x2056f9=_(_0x2056f9)[_0x339e('0x87')](_0x4a3732)[_0x339e('0x88')]()[_0x339e('0x89')]();return db[_0x339e('0x35')]['find']({'where':{'id':_0x3c6469[_0x339e('0x4c')]['id']}})[_0x339e('0x2d')](function(_0x272bd7){return db[_0x339e('0x74')][_0x339e('0x75')](function(_0x5102e4){return _0x272bd7[_0x339e('0x7a')](_0x3c6469[_0x339e('0x3b')]['ids'],{'transaction':_0x5102e4})[_0x339e('0x2d')](function(){if(!_[_0x339e('0x8a')](_0x2056f9)){return _0x272bd7[_0x339e('0x8b')](_0x2056f9,{'transaction':_0x5102e4});}})['then'](function(){_0x2056f9[_0x339e('0x77')](function(_0x3c9c02){socket[_0x339e('0x78')](_0x339e('0x8c'),{'UserId':_0x3c9c02,'FaxQueueId':_0x272bd7['id']});});});});});});})['then'](respondWithStatusCode(_0x15b37e,null))[_0x339e('0x52')](handleError(_0x15b37e,null));};exports['addAgents']=function(_0x1841e2,_0x38e1b2,_0x2c438c){return db['FaxQueue'][_0x339e('0x51')]({'where':{'id':_0x1841e2['params']['id']}})[_0x339e('0x2d')](handleEntityNotFound(_0x38e1b2,null))[_0x339e('0x2d')](function(_0x1eb724){if(_0x1eb724){return _0x1eb724['addAgents'](_0x1841e2['body'][_0x339e('0x71')],_['omit'](_0x1841e2['body'],[_0x339e('0x71'),'id'])||{})[_0x339e('0x8d')](function(_0x543a87){for(var _0x2fabce=0x0;_0x2fabce<_0x1841e2[_0x339e('0x54')][_0x339e('0x71')]['length'];_0x2fabce+=0x1){socket[_0x339e('0x78')]('userFaxQueue:save',{'UserId':Number(_0x1841e2[_0x339e('0x54')]['ids'][_0x2fabce]),'FaxQueueId':Number(_0x1841e2['params']['id'])});}return _0x543a87;});}})[_0x339e('0x2d')](respondWithResult(_0x38e1b2,null))[_0x339e('0x52')](handleError(_0x38e1b2,null));};exports[_0x339e('0x8b')]=function(_0x5ed739,_0x44c794,_0x55d2e4){return db[_0x339e('0x35')][_0x339e('0x51')]({'where':{'id':_0x5ed739[_0x339e('0x4c')]['id']}})[_0x339e('0x2d')](handleEntityNotFound(_0x44c794,null))[_0x339e('0x2d')](function(_0x43b480){if(_0x43b480){return _0x43b480[_0x339e('0x8b')](_0x5ed739[_0x339e('0x3b')][_0x339e('0x71')])[_0x339e('0x2d')](function(){if(_[_0x339e('0x8e')](_0x5ed739[_0x339e('0x3b')]['ids'])){for(var _0x2e0347=0x0;_0x2e0347<_0x5ed739[_0x339e('0x3b')][_0x339e('0x71')][_0x339e('0x4e')];_0x2e0347+=0x1){socket[_0x339e('0x78')]('userFaxQueue:remove',{'UserId':Number(_0x5ed739[_0x339e('0x3b')]['ids'][_0x2e0347]),'FaxQueueId':Number(_0x5ed739[_0x339e('0x4c')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x5ed739[_0x339e('0x3b')]['ids']),'FaxQueueId':Number(_0x5ed739['params']['id'])});}});}})[_0x339e('0x2d')](respondWithStatusCode(_0x44c794,null))[_0x339e('0x52')](handleError(_0x44c794,null));};exports[_0x339e('0x8f')]=function(_0x99af3f,_0x1a0db4,_0x278342){var _0x5db5e6={};var _0x2050d5={};var _0x475210;var _0x44f205;return db[_0x339e('0x35')]['findOne']({'where':{'id':_0x99af3f[_0x339e('0x4c')]['id']}})[_0x339e('0x2d')](handleEntityNotFound(_0x1a0db4,null))[_0x339e('0x2d')](function(_0x4c85ad){if(_0x4c85ad){_0x475210=_0x4c85ad;_0x2050d5[_0x339e('0x39')]=_[_0x339e('0x3c')](db['User'][_0x339e('0x4d')]);_0x2050d5[_0x339e('0x3b')]=_[_0x339e('0x3c')](_0x99af3f[_0x339e('0x3b')]);_0x2050d5[_0x339e('0x43')]=_[_0x339e('0x3d')](_0x2050d5['model'],_0x2050d5[_0x339e('0x3b')]);_0x5db5e6[_0x339e('0x3e')]=_[_0x339e('0x3d')](_0x2050d5[_0x339e('0x39')],qs[_0x339e('0x3f')](_0x99af3f['query']['fields']));_0x5db5e6['attributes']=_0x5db5e6[_0x339e('0x3e')][_0x339e('0x4e')]?_0x5db5e6['attributes']:_0x2050d5[_0x339e('0x39')];_0x5db5e6['order']=qs[_0x339e('0x42')](_0x99af3f[_0x339e('0x3b')][_0x339e('0x42')]);_0x5db5e6[_0x339e('0x47')]=qs[_0x339e('0x43')](_[_0x339e('0x44')](_0x99af3f['query'],_0x2050d5['filters']));if(_0x99af3f['query'][_0x339e('0x45')]){_0x5db5e6[_0x339e('0x47')]=_['merge'](_0x5db5e6['where'],{'$or':_['map'](_0x5db5e6['attributes'],function(_0x3d2e14){var _0x425138={};_0x425138[_0x3d2e14]={'$like':'%'+_0x99af3f[_0x339e('0x3b')]['filter']+'%'};return _0x425138;})});}_0x5db5e6=_[_0x339e('0x46')]({},_0x5db5e6,_0x99af3f[_0x339e('0x50')]);return _0x475210[_0x339e('0x8f')](_0x5db5e6);}})[_0x339e('0x2d')](function(_0x3b1a8a){if(_0x3b1a8a){_0x44f205=_0x3b1a8a[_0x339e('0x4e')];if(!_0x99af3f[_0x339e('0x3b')][_0x339e('0x40')](_0x339e('0x41'))){_0x5db5e6['limit']=qs[_0x339e('0x25')](_0x99af3f['query'][_0x339e('0x25')]);_0x5db5e6[_0x339e('0x24')]=qs[_0x339e('0x24')](_0x99af3f[_0x339e('0x3b')][_0x339e('0x24')]);}return _0x475210[_0x339e('0x8f')](_0x5db5e6);}})[_0x339e('0x2d')](function(_0x5505b2){if(_0x5505b2){return _0x5505b2?{'count':_0x44f205,'rows':_0x5505b2}:null;}})['then'](respondWithResult(_0x1a0db4,null))[_0x339e('0x52')](handleError(_0x1a0db4,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 7d600d6..c3e64df 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 _0x2ef7=['remove','emit','events','../../mysqldb','FaxQueue'];(function(_0x2af1f4,_0xec83fc){var _0x46f2fd=function(_0x28a9dd){while(--_0x28a9dd){_0x2af1f4['push'](_0x2af1f4['shift']());}};_0x46f2fd(++_0xec83fc);}(_0x2ef7,0xe3));var _0x72ef=function(_0x21400a,_0x5c767a){_0x21400a=_0x21400a-0x0;var _0x5cdc02=_0x2ef7[_0x21400a];return _0x5cdc02;};'use strict';var EventEmitter=require(_0x72ef('0x0'));var FaxQueue=require(_0x72ef('0x1'))['db'][_0x72ef('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x72ef('0x3')};function emitEvent(_0x7480d6){return function(_0x2edd22,_0x5168ea,_0x115d55){FaxQueueEvents[_0x72ef('0x4')](_0x7480d6+':'+_0x2edd22['id'],_0x2edd22);FaxQueueEvents[_0x72ef('0x4')](_0x7480d6,_0x2edd22);_0x115d55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xb642=['emit','hook','exports','events','../../mysqldb','FaxQueue','save','update','remove'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0xb642,0x93));var _0x2b64=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb642[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0x2b64('0x0'));var FaxQueue=require(_0x2b64('0x1'))['db'][_0x2b64('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2b64('0x3'),'afterUpdate':_0x2b64('0x4'),'afterDestroy':_0x2b64('0x5')};function emitEvent(_0x5d6026){return function(_0x5b453a,_0x32c1e2,_0x4a9f9){FaxQueueEvents['emit'](_0x5d6026+':'+_0x5b453a['id'],_0x5b453a);FaxQueueEvents[_0x2b64('0x6')](_0x5d6026,_0x5b453a);_0x4a9f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x2b64('0x7')](e,emitEvent(event));}}module[_0x2b64('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 8478e65..8e83445 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 _0x16f3=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x16f3,0xb4));var _0x316f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16f3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x316f('0x0'));var logger=require(_0x316f('0x1'))('api');var moment=require(_0x316f('0x2'));var BPromise=require(_0x316f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x316f('0x4'));var rimraf=require(_0x316f('0x5'));var config=require(_0x316f('0x6'));var attributes=require(_0x316f('0x7'));module[_0x316f('0x8')]=function(_0x48ab64,_0x112486){return _0x48ab64[_0x316f('0x9')](_0x316f('0xa'),attributes,{'tableName':_0x316f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3197=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','fax_queues','lodash'];(function(_0x345f02,_0x4f3a6f){var _0x144e35=function(_0x1e6bde){while(--_0x1e6bde){_0x345f02['push'](_0x345f02['shift']());}};_0x144e35(++_0x4f3a6f);}(_0x3197,0x133));var _0x7319=function(_0x47f0f3,_0x420451){_0x47f0f3=_0x47f0f3-0x0;var _0x31a351=_0x3197[_0x47f0f3];return _0x31a351;};'use strict';var _=require(_0x7319('0x0'));var util=require(_0x7319('0x1'));var logger=require(_0x7319('0x2'))(_0x7319('0x3'));var moment=require(_0x7319('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7319('0x5'));var rimraf=require(_0x7319('0x6'));var config=require(_0x7319('0x7'));var attributes=require('./faxQueue.attributes');module[_0x7319('0x8')]=function(_0x295526,_0x3bb206){return _0x295526[_0x7319('0x9')]('FaxQueue',attributes,{'tableName':_0x7319('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 436734f..8e069e5 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 _0x1f2b=['code','message','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','GetFaxQueue','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4990f6,_0xeed40c){var _0x16ce29=function(_0x12b458){while(--_0x12b458){_0x4990f6['push'](_0x4990f6['shift']());}};_0x16ce29(++_0xeed40c);}(_0x1f2b,0x137));var _0xb1f2=function(_0xa74cca,_0x5d4ee1){_0xa74cca=_0xa74cca-0x0;var _0x46bc82=_0x1f2b[_0xa74cca];return _0x46bc82;};'use strict';var _=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var moment=require(_0xb1f2('0x2'));var BPromise=require(_0xb1f2('0x3'));var rs=require(_0xb1f2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1f2('0x5'))['db'];var utils=require(_0xb1f2('0x6'));var logger=require(_0xb1f2('0x7'))(_0xb1f2('0x8'));var config=require(_0xb1f2('0x9'));var jayson=require(_0xb1f2('0xa'));var client=jayson[_0xb1f2('0xb')][_0xb1f2('0xc')]({'port':0x232a});config[_0xb1f2('0xd')]=_[_0xb1f2('0xe')](config[_0xb1f2('0xd')],{'host':_0xb1f2('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb1f2('0x10'))[_0xb1f2('0x11')](socket);function respondWithRpcPromise(_0x5da319,_0x24be81,_0x85dcb0){return new BPromise(function(_0x4471f4,_0x309785){return client['request'](_0x5da319,_0x85dcb0)[_0xb1f2('0x12')](function(_0x9ee061){logger[_0xb1f2('0x13')](_0xb1f2('0x14'),_0x24be81,'request\x20sent');logger['debug'](_0xb1f2('0x15'),_0x24be81,_0xb1f2('0x16'),JSON[_0xb1f2('0x17')](_0x9ee061));if(_0x9ee061[_0xb1f2('0x18')]){if(_0x9ee061['error'][_0xb1f2('0x19')]===0x1f4){logger['error'](_0xb1f2('0x14'),_0x24be81,_0x9ee061['error'][_0xb1f2('0x1a')]);return _0x309785(_0x9ee061[_0xb1f2('0x18')][_0xb1f2('0x1a')]);}logger[_0xb1f2('0x18')]('FaxQueue,\x20%s,\x20%s',_0x24be81,_0x9ee061[_0xb1f2('0x18')][_0xb1f2('0x1a')]);return _0x4471f4(_0x9ee061['error']['message']);}else{logger['info'](_0xb1f2('0x14'),_0x24be81,_0xb1f2('0x16'));_0x4471f4(_0x9ee061['result'][_0xb1f2('0x1a')]);}})[_0xb1f2('0x1b')](function(_0x5ef674){logger[_0xb1f2('0x18')](_0xb1f2('0x14'),_0x24be81,_0x5ef674);_0x309785(_0x5ef674);});});}exports['GetFaxQueue']=function(_0x231a99){var _0x30f4b8=this;return new Promise(function(_0x4e7ade,_0x3fdf2f){return db[_0xb1f2('0x1c')][_0xb1f2('0x1d')]({'raw':_0x231a99['options']?_0x231a99[_0xb1f2('0x1e')][_0xb1f2('0x1f')]===undefined?!![]:![]:!![],'where':_0x231a99[_0xb1f2('0x1e')]?_0x231a99[_0xb1f2('0x1e')][_0xb1f2('0x20')]||null:null,'attributes':_0x231a99[_0xb1f2('0x1e')]?_0x231a99['options'][_0xb1f2('0x21')]||null:null,'limit':_0x231a99[_0xb1f2('0x1e')]?_0x231a99['options'][_0xb1f2('0x22')]||null:null,'include':_0x231a99[_0xb1f2('0x1e')]?_0x231a99[_0xb1f2('0x1e')][_0xb1f2('0x23')]?_['map'](_0x231a99['options'][_0xb1f2('0x23')],function(_0x134f75){return{'model':db[_0x134f75[_0xb1f2('0x24')]],'as':_0x134f75['as'],'attributes':_0x134f75[_0xb1f2('0x21')],'include':_0x134f75[_0xb1f2('0x23')]?_[_0xb1f2('0x25')](_0x134f75['include'],function(_0xd318f8){return{'model':db[_0xd318f8[_0xb1f2('0x24')]],'as':_0xd318f8['as'],'attributes':_0xd318f8[_0xb1f2('0x21')],'include':_0xd318f8[_0xb1f2('0x23')]?_[_0xb1f2('0x25')](_0xd318f8['include'],function(_0x512761){return{'model':db[_0x512761[_0xb1f2('0x24')]],'as':_0x512761['as'],'attributes':_0x512761[_0xb1f2('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb1f2('0x12')](function(_0x10622d){logger[_0xb1f2('0x13')]('GetFaxQueue',_0x231a99);logger[_0xb1f2('0x26')](_0xb1f2('0x27'),_0x231a99,JSON[_0xb1f2('0x17')](_0x10622d));_0x4e7ade(_0x10622d);})[_0xb1f2('0x1b')](function(_0x11bf3b){logger[_0xb1f2('0x18')](_0xb1f2('0x27'),_0x11bf3b[_0xb1f2('0x1a')],_0x231a99);_0x3fdf2f(_0x30f4b8['error'](0x1f4,_0x11bf3b['message']));});});};exports[_0xb1f2('0x28')]=function(_0x432e19){var _0x1208fb=this;return new Promise(function(_0x5d10fe,_0x5854d8){return db[_0xb1f2('0x1c')][_0xb1f2('0x29')]({'raw':_0x432e19[_0xb1f2('0x1e')]?_0x432e19[_0xb1f2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x432e19[_0xb1f2('0x1e')]?_0x432e19['options'][_0xb1f2('0x20')]||null:null,'attributes':_0x432e19['options']?_0x432e19[_0xb1f2('0x1e')][_0xb1f2('0x21')]||null:null,'include':_0x432e19[_0xb1f2('0x1e')]?_0x432e19[_0xb1f2('0x1e')][_0xb1f2('0x23')]?_['map'](_0x432e19[_0xb1f2('0x1e')][_0xb1f2('0x23')],function(_0x4b3e7a){return{'model':db[_0x4b3e7a[_0xb1f2('0x24')]],'as':_0x4b3e7a['as'],'attributes':_0x4b3e7a[_0xb1f2('0x21')],'include':_0x4b3e7a['include']?_[_0xb1f2('0x25')](_0x4b3e7a[_0xb1f2('0x23')],function(_0x5f23b3){return{'model':db[_0x5f23b3[_0xb1f2('0x24')]],'as':_0x5f23b3['as'],'attributes':_0x5f23b3['attributes'],'include':_0x5f23b3[_0xb1f2('0x23')]?_[_0xb1f2('0x25')](_0x5f23b3[_0xb1f2('0x23')],function(_0x2ff510){return{'model':db[_0x2ff510[_0xb1f2('0x24')]],'as':_0x2ff510['as'],'attributes':_0x2ff510['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ae320){logger[_0xb1f2('0x13')]('ShowFaxQueue',_0x432e19);logger[_0xb1f2('0x26')](_0xb1f2('0x28'),_0x432e19,JSON['stringify'](_0x5ae320));_0x5d10fe(_0x5ae320);})[_0xb1f2('0x1b')](function(_0x393cb3){logger[_0xb1f2('0x18')](_0xb1f2('0x28'),_0x393cb3['message'],_0x432e19);_0x5854d8(_0x1208fb[_0xb1f2('0x18')](0x1f4,_0x393cb3['message']));});});}; \ No newline at end of file +var _0x87b8=['FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetFaxQueue','FaxQueue','findAll','options','raw','limit','include','map','model','attributes','then','debug','catch','ShowFaxQueue','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x87b8,0x8b));var _0x887b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x87b8[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x887b('0x0'));var moment=require('moment');var BPromise=require(_0x887b('0x1'));var rs=require(_0x887b('0x2'));var fs=require('fs');var Redis=require(_0x887b('0x3'));var db=require(_0x887b('0x4'))['db'];var utils=require(_0x887b('0x5'));var logger=require(_0x887b('0x6'))(_0x887b('0x7'));var config=require(_0x887b('0x8'));var jayson=require(_0x887b('0x9'));var client=jayson[_0x887b('0xa')][_0x887b('0xb')]({'port':0x232a});config[_0x887b('0xc')]=_[_0x887b('0xd')](config[_0x887b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x887b('0xe'))(new Redis(config[_0x887b('0xc')]));require('./faxQueue.socket')[_0x887b('0xf')](socket);function respondWithRpcPromise(_0x3833b6,_0xe92205,_0x4dc7b1){return new BPromise(function(_0x4e6329,_0x4627bc){return client[_0x887b('0x10')](_0x3833b6,_0x4dc7b1)['then'](function(_0x6fc5c2){logger['info'](_0x887b('0x11'),_0xe92205,_0x887b('0x12'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0xe92205,_0x887b('0x12'),JSON[_0x887b('0x13')](_0x6fc5c2));if(_0x6fc5c2[_0x887b('0x14')]){if(_0x6fc5c2['error']['code']===0x1f4){logger[_0x887b('0x14')]('FaxQueue,\x20%s,\x20%s',_0xe92205,_0x6fc5c2['error']['message']);return _0x4627bc(_0x6fc5c2[_0x887b('0x14')]['message']);}logger['error'](_0x887b('0x11'),_0xe92205,_0x6fc5c2[_0x887b('0x14')][_0x887b('0x15')]);return _0x4e6329(_0x6fc5c2[_0x887b('0x14')][_0x887b('0x15')]);}else{logger[_0x887b('0x16')](_0x887b('0x11'),_0xe92205,_0x887b('0x12'));_0x4e6329(_0x6fc5c2[_0x887b('0x17')][_0x887b('0x15')]);}})['catch'](function(_0x5237b2){logger[_0x887b('0x14')](_0x887b('0x11'),_0xe92205,_0x5237b2);_0x4627bc(_0x5237b2);});});}exports[_0x887b('0x18')]=function(_0x3ee46c){var _0x3d42d1=this;return new Promise(function(_0x2fc6b5,_0x4ec3e9){return db[_0x887b('0x19')][_0x887b('0x1a')]({'raw':_0x3ee46c[_0x887b('0x1b')]?_0x3ee46c[_0x887b('0x1b')][_0x887b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ee46c[_0x887b('0x1b')]?_0x3ee46c[_0x887b('0x1b')]['where']||null:null,'attributes':_0x3ee46c['options']?_0x3ee46c[_0x887b('0x1b')]['attributes']||null:null,'limit':_0x3ee46c[_0x887b('0x1b')]?_0x3ee46c[_0x887b('0x1b')][_0x887b('0x1d')]||null:null,'include':_0x3ee46c[_0x887b('0x1b')]?_0x3ee46c[_0x887b('0x1b')][_0x887b('0x1e')]?_[_0x887b('0x1f')](_0x3ee46c['options']['include'],function(_0x1c1629){return{'model':db[_0x1c1629[_0x887b('0x20')]],'as':_0x1c1629['as'],'attributes':_0x1c1629['attributes'],'include':_0x1c1629[_0x887b('0x1e')]?_[_0x887b('0x1f')](_0x1c1629['include'],function(_0x229097){return{'model':db[_0x229097[_0x887b('0x20')]],'as':_0x229097['as'],'attributes':_0x229097['attributes'],'include':_0x229097['include']?_[_0x887b('0x1f')](_0x229097['include'],function(_0x284f02){return{'model':db[_0x284f02[_0x887b('0x20')]],'as':_0x284f02['as'],'attributes':_0x284f02[_0x887b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x887b('0x22')](function(_0x3f29c5){logger[_0x887b('0x16')](_0x887b('0x18'),_0x3ee46c);logger[_0x887b('0x23')](_0x887b('0x18'),_0x3ee46c,JSON['stringify'](_0x3f29c5));_0x2fc6b5(_0x3f29c5);})[_0x887b('0x24')](function(_0x5808e6){logger['error'](_0x887b('0x18'),_0x5808e6['message'],_0x3ee46c);_0x4ec3e9(_0x3d42d1[_0x887b('0x14')](0x1f4,_0x5808e6[_0x887b('0x15')]));});});};exports[_0x887b('0x25')]=function(_0x1dd76e){var _0x5d38c7=this;return new Promise(function(_0x2dbba4,_0x36dd73){return db[_0x887b('0x19')]['find']({'raw':_0x1dd76e[_0x887b('0x1b')]?_0x1dd76e[_0x887b('0x1b')][_0x887b('0x1c')]===undefined?!![]:![]:!![],'where':_0x1dd76e[_0x887b('0x1b')]?_0x1dd76e['options'][_0x887b('0x26')]||null:null,'attributes':_0x1dd76e[_0x887b('0x1b')]?_0x1dd76e[_0x887b('0x1b')]['attributes']||null:null,'include':_0x1dd76e[_0x887b('0x1b')]?_0x1dd76e[_0x887b('0x1b')][_0x887b('0x1e')]?_['map'](_0x1dd76e[_0x887b('0x1b')][_0x887b('0x1e')],function(_0x3dd859){return{'model':db[_0x3dd859[_0x887b('0x20')]],'as':_0x3dd859['as'],'attributes':_0x3dd859[_0x887b('0x21')],'include':_0x3dd859['include']?_[_0x887b('0x1f')](_0x3dd859[_0x887b('0x1e')],function(_0x52c012){return{'model':db[_0x52c012['model']],'as':_0x52c012['as'],'attributes':_0x52c012['attributes'],'include':_0x52c012[_0x887b('0x1e')]?_[_0x887b('0x1f')](_0x52c012[_0x887b('0x1e')],function(_0x3d26f0){return{'model':db[_0x3d26f0[_0x887b('0x20')]],'as':_0x3d26f0['as'],'attributes':_0x3d26f0[_0x887b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x887b('0x22')](function(_0x197c2c){logger[_0x887b('0x16')](_0x887b('0x25'),_0x1dd76e);logger[_0x887b('0x23')](_0x887b('0x25'),_0x1dd76e,JSON[_0x887b('0x13')](_0x197c2c));_0x2dbba4(_0x197c2c);})[_0x887b('0x24')](function(_0x2eaa5c){logger['error'](_0x887b('0x25'),_0x2eaa5c[_0x887b('0x15')],_0x1dd76e);_0x36dd73(_0x5d38c7['error'](0x1f4,_0x2eaa5c[_0x887b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 50e5f7a..7a2068e 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 _0xbb85=['register','length','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x364b9e,_0x1ec0a8){var _0x16fac1=function(_0x33ec07){while(--_0x33ec07){_0x364b9e['push'](_0x364b9e['shift']());}};_0x16fac1(++_0x1ec0a8);}(_0xbb85,0x92));var _0x5bb8=function(_0x501d13,_0x1f320c){_0x501d13=_0x501d13-0x0;var _0x279573=_0xbb85[_0x501d13];return _0x279573;};'use strict';var FaxQueueEvents=require(_0x5bb8('0x0'));var events=[_0x5bb8('0x1'),_0x5bb8('0x2'),_0x5bb8('0x3')];function createListener(_0x4e3e6c,_0x17ab5f){return function(_0x3a5f66){_0x17ab5f[_0x5bb8('0x4')](_0x4e3e6c,_0x3a5f66);};}function removeListener(_0x453f19,_0x31ceda){return function(){FaxQueueEvents[_0x5bb8('0x5')](_0x453f19,_0x31ceda);};}exports[_0x5bb8('0x6')]=function(_0x48ad61){for(var _0x4d208a=0x0,_0x59a54e=events[_0x5bb8('0x7')];_0x4d208a<_0x59a54e;_0x4d208a++){var _0x2b9940=events[_0x4d208a];var _0x5669ce=createListener('faxQueue:'+_0x2b9940,_0x48ad61);FaxQueueEvents['on'](_0x2b9940,_0x5669ce);}}; \ No newline at end of file +var _0x8b97=['emit','removeListener','length','faxQueue:','./faxQueue.events','remove','update'];(function(_0x160c60,_0x2cfc62){var _0x319d7c=function(_0x3c7264){while(--_0x3c7264){_0x160c60['push'](_0x160c60['shift']());}};_0x319d7c(++_0x2cfc62);}(_0x8b97,0x1d9));var _0x78b9=function(_0x49a0cf,_0x2b2e81){_0x49a0cf=_0x49a0cf-0x0;var _0x5134f1=_0x8b97[_0x49a0cf];return _0x5134f1;};'use strict';var FaxQueueEvents=require(_0x78b9('0x0'));var events=['save',_0x78b9('0x1'),_0x78b9('0x2')];function createListener(_0x3e6022,_0xf7f09f){return function(_0x37ccb2){_0xf7f09f[_0x78b9('0x3')](_0x3e6022,_0x37ccb2);};}function removeListener(_0x528e61,_0x36e9ae){return function(){FaxQueueEvents[_0x78b9('0x4')](_0x528e61,_0x36e9ae);};}exports['register']=function(_0x194bb3){for(var _0x1de137=0x0,_0x4b59e4=events[_0x78b9('0x5')];_0x1de137<_0x4b59e4;_0x1de137++){var _0x226007=events[_0x1de137];var _0x1fc7e=createListener(_0x78b9('0x6')+_0x226007,_0x194bb3);FaxQueueEvents['on'](_0x226007,_0x1fc7e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 3673da9..5586a10 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 _0xe5af=['util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0xaac24,_0x57ce3b){var _0x1fa972=function(_0x133694){while(--_0x133694){_0xaac24['push'](_0xaac24['shift']());}};_0x1fa972(++_0x57ce3b);}(_0xe5af,0x9c));var _0xfe5a=function(_0x40ce9b,_0x5b6f36){_0x40ce9b=_0x40ce9b-0x0;var _0x1a8b8b=_0xe5af[_0x40ce9b];return _0x1a8b8b;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller['show']);router['get'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['getMembers']);router[_0xfe5a('0x6')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xc')]);router[_0xfe5a('0x6')]('/:id/users',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0xe')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xf')]);router['post'](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x10')]);router[_0xfe5a('0xe')](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x12')]);router[_0xfe5a('0x13')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x15')]);router[_0xfe5a('0x16')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x17')]);router[_0xfe5a('0x16')]('/:id/teams',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x18')]);router['delete'](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7880=['delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update'];(function(_0x38ac27,_0x22b014){var _0x4dd332=function(_0x476ac4){while(--_0x476ac4){_0x38ac27['push'](_0x38ac27['shift']());}};_0x4dd332(++_0x22b014);}(_0x7880,0x1f4));var _0x0788=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0x7880[_0x1667df];return _0x341abf;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x16')]('/',auth[_0x0788('0xa')](),controller['create']);router[_0x0788('0x16')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x17')]);router['post'](_0x0788('0x14'),auth['isAuthenticated'](),controller[_0x0788('0x18')]);router[_0x0788('0x19')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x1a')]);router[_0x0788('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x1b')]('/:id/teams',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x1b')]('/:id/users',auth[_0x0788('0xa')](),controller[_0x0788('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index a0ffaac..6c749cb 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 _0xf408=['STRING','DATE','moment','sequelize','exports'];(function(_0x101f93,_0x28c3b2){var _0x4f2f3a=function(_0xdead01){while(--_0xdead01){_0x101f93['push'](_0x101f93['shift']());}};_0x4f2f3a(++_0x28c3b2);}(_0xf408,0x1ce));var _0x8f40=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0xf408[_0x124298];return _0x35ac24;};'use strict';var moment=require(_0x8f40('0x0'));var Sequelize=require(_0x8f40('0x1'));module[_0x8f40('0x2')]={'uniqueid':{'type':Sequelize[_0x8f40('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8f40('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8f40('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8f40('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x501b=['moment','sequelize','exports','STRING','DATE'];(function(_0x3c6a03,_0x10b38c){var _0xdd38cb=function(_0x83beaf){while(--_0x83beaf){_0x3c6a03['push'](_0x3c6a03['shift']());}};_0xdd38cb(++_0x10b38c);}(_0x501b,0xd2));var _0xb501=function(_0x398569,_0x184cd8){_0x398569=_0x398569-0x0;var _0x6f1d36=_0x501b[_0x398569];return _0x6f1d36;};'use strict';var moment=require(_0xb501('0x0'));var Sequelize=require(_0xb501('0x1'));module[_0xb501('0x2')]={'uniqueid':{'type':Sequelize[_0xb501('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb501('0x3')]},'joinAt':{'type':Sequelize[_0xb501('0x4')]},'leaveAt':{'type':Sequelize[_0xb501('0x4')]},'acceptAt':{'type':Sequelize[_0xb501('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb501('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 38aae73..241a5c8 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 _0x559a=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxQueueReport','then','includeAll','include','findAll','catch','show','params','keys','length','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','end','error','stack','name','index','map'];(function(_0x3edd38,_0x3d9b6b){var _0x23bc04=function(_0x584efa){while(--_0x584efa){_0x3edd38['push'](_0x3edd38['shift']());}};_0x23bc04(++_0x3d9b6b);}(_0x559a,0xb3));var _0xa559=function(_0x528b11,_0x2e7447){_0x528b11=_0x528b11-0x0;var _0x5913ed=_0x559a[_0x528b11];return _0x5913ed;};'use strict';var emlformat=require(_0xa559('0x0'));var rimraf=require(_0xa559('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa559('0x2'));var rp=require(_0xa559('0x3'));var moment=require(_0xa559('0x4'));var BPromise=require(_0xa559('0x5'));var Mustache=require(_0xa559('0x6'));var util=require(_0xa559('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa559('0x8'));var ejs=require(_0xa559('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa559('0xa'));var squel=require(_0xa559('0xb'));var crypto=require('crypto');var jsforce=require(_0xa559('0xc'));var deskjs=require(_0xa559('0xd'));var toCsv=require(_0xa559('0x8'));var querystring=require(_0xa559('0xe'));var Papa=require('papaparse');var Redis=require(_0xa559('0xf'));var authService=require(_0xa559('0x10'));var qs=require(_0xa559('0x11'));var as=require(_0xa559('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa559('0x13'));var utils=require(_0xa559('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa559('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442e26,_0x5f0463){_0x5f0463=_0x5f0463||0xcc;return function(_0x2a646e){if(_0x2a646e){return _0x442e26[_0xa559('0x16')](_0x5f0463);}return _0x442e26[_0xa559('0x17')](_0x5f0463)['end']();};}function respondWithResult(_0xe93c61,_0x3853fd){_0x3853fd=_0x3853fd||0xc8;return function(_0x5ed915){if(_0x5ed915){return _0xe93c61[_0xa559('0x17')](_0x3853fd)[_0xa559('0x18')](_0x5ed915);}};}function respondWithFilteredResult(_0x369d26,_0x1e48b3){return function(_0x539a4b){if(_0x539a4b){var _0x309c27=typeof _0x1e48b3['offset']===_0xa559('0x19')&&typeof _0x1e48b3[_0xa559('0x1a')]==='undefined';var _0x2c6993=_0x539a4b[_0xa559('0x1b')];var _0x163405=_0x309c27?0x0:_0x1e48b3[_0xa559('0x1c')];var _0x1a4c42=_0x309c27?_0x539a4b[_0xa559('0x1b')]:_0x1e48b3[_0xa559('0x1c')]+_0x1e48b3[_0xa559('0x1a')];var _0x329d59;if(_0x1a4c42>=_0x2c6993){_0x1a4c42=_0x2c6993;_0x329d59=0xc8;}else{_0x329d59=0xce;}_0x369d26[_0xa559('0x17')](_0x329d59);return _0x369d26['set']('Content-Range',_0x163405+'-'+_0x1a4c42+'/'+_0x2c6993)[_0xa559('0x18')](_0x539a4b);}return null;};}function patchUpdates(_0x3aa532){return function(_0x47cb65){try{jsonpatch[_0xa559('0x1d')](_0x47cb65,_0x3aa532,!![]);}catch(_0x190a9e){return BPromise[_0xa559('0x1e')](_0x190a9e);}return _0x47cb65[_0xa559('0x1f')]();};}function saveUpdates(_0x1812ef,_0x2dd8cf){return function(_0x572046){if(_0x572046){return _0x572046[_0xa559('0x20')](_0x1812ef)['then'](function(_0x1d4370){return _0x1d4370;});}return null;};}function removeEntity(_0x396fe9,_0x314fef){return function(_0x487a60){if(_0x487a60){return _0x487a60[_0xa559('0x21')]()['then'](function(){_0x396fe9[_0xa559('0x17')](0xcc)[_0xa559('0x22')]();});}};}function handleEntityNotFound(_0x5834c6,_0x2a5181){return function(_0x552c2c){if(!_0x552c2c){_0x5834c6['sendStatus'](0x194);}return _0x552c2c;};}function handleError(_0x1581b9,_0x1914e7){_0x1914e7=_0x1914e7||0x1f4;return function(_0x3fcf7f){logger[_0xa559('0x23')](_0x3fcf7f[_0xa559('0x24')]);if(_0x3fcf7f[_0xa559('0x25')]){delete _0x3fcf7f[_0xa559('0x25')];}_0x1581b9[_0xa559('0x17')](_0x1914e7)['send'](_0x3fcf7f);};}exports[_0xa559('0x26')]=function(_0x30a781,_0x21c8a0){var _0x1c92b9={},_0x5f3fbb={},_0x1fb70f={'count':0x0,'rows':[]};var _0x32db9d=_[_0xa559('0x27')](db['FaxQueueReport'][_0xa559('0x28')],function(_0x224a3a){return{'name':_0x224a3a[_0xa559('0x29')],'type':_0x224a3a[_0xa559('0x2a')][_0xa559('0x2b')]};});_0x5f3fbb[_0xa559('0x2c')]=_[_0xa559('0x27')](_0x32db9d,_0xa559('0x25'));_0x5f3fbb[_0xa559('0x2d')]=_['keys'](_0x30a781[_0xa559('0x2d')]);_0x5f3fbb[_0xa559('0x2e')]=_[_0xa559('0x2f')](_0x5f3fbb[_0xa559('0x2c')],_0x5f3fbb['query']);_0x1c92b9[_0xa559('0x30')]=_['intersection'](_0x5f3fbb[_0xa559('0x2c')],qs[_0xa559('0x31')](_0x30a781[_0xa559('0x2d')][_0xa559('0x31')]));_0x1c92b9[_0xa559('0x30')]=_0x1c92b9[_0xa559('0x30')]['length']?_0x1c92b9[_0xa559('0x30')]:_0x5f3fbb[_0xa559('0x2c')];if(!_0x30a781[_0xa559('0x2d')][_0xa559('0x32')](_0xa559('0x33'))){_0x1c92b9[_0xa559('0x1a')]=qs[_0xa559('0x1a')](_0x30a781[_0xa559('0x2d')]['limit']);_0x1c92b9[_0xa559('0x1c')]=qs[_0xa559('0x1c')](_0x30a781[_0xa559('0x2d')][_0xa559('0x1c')]);}_0x1c92b9[_0xa559('0x34')]=qs[_0xa559('0x35')](_0x30a781[_0xa559('0x2d')]['sort']);_0x1c92b9[_0xa559('0x36')]=qs[_0xa559('0x2e')](_[_0xa559('0x37')](_0x30a781[_0xa559('0x2d')],_0x5f3fbb[_0xa559('0x2e')]),_0x32db9d);if(_0x30a781[_0xa559('0x2d')][_0xa559('0x38')]){_0x1c92b9[_0xa559('0x36')]=_[_0xa559('0x39')](_0x1c92b9[_0xa559('0x36')],{'$or':_[_0xa559('0x27')](_0x32db9d,function(_0x2e9351){if(_0x2e9351[_0xa559('0x2a')]!=='VIRTUAL'){var _0x3e58e3={};_0x3e58e3[_0x2e9351['name']]={'$like':'%'+_0x30a781[_0xa559('0x2d')]['filter']+'%'};return _0x3e58e3;}})});}_0x1c92b9=_[_0xa559('0x39')]({},_0x1c92b9,_0x30a781['options']);var _0x3873c9={'where':_0x1c92b9[_0xa559('0x36')]};return db[_0xa559('0x3a')][_0xa559('0x1b')](_0x3873c9)[_0xa559('0x3b')](function(_0x2efc09){_0x1fb70f[_0xa559('0x1b')]=_0x2efc09;if(_0x30a781['query'][_0xa559('0x3c')]){_0x1c92b9[_0xa559('0x3d')]=[{'all':!![]}];}return db[_0xa559('0x3a')][_0xa559('0x3e')](_0x1c92b9);})[_0xa559('0x3b')](function(_0x278f31){_0x1fb70f['rows']=_0x278f31;return _0x1fb70f;})[_0xa559('0x3b')](respondWithFilteredResult(_0x21c8a0,_0x1c92b9))[_0xa559('0x3f')](handleError(_0x21c8a0,null));};exports[_0xa559('0x40')]=function(_0x429249,_0x5d6325){var _0x6340d3={'raw':!![],'where':{'id':_0x429249[_0xa559('0x41')]['id']}},_0x2af622={};_0x2af622[_0xa559('0x2c')]=_[_0xa559('0x42')](db['FaxQueueReport'][_0xa559('0x28')]);_0x2af622[_0xa559('0x2d')]=_[_0xa559('0x42')](_0x429249[_0xa559('0x2d')]);_0x2af622[_0xa559('0x2e')]=_[_0xa559('0x2f')](_0x2af622[_0xa559('0x2c')],_0x2af622['query']);_0x6340d3[_0xa559('0x30')]=_[_0xa559('0x2f')](_0x2af622[_0xa559('0x2c')],qs[_0xa559('0x31')](_0x429249[_0xa559('0x2d')][_0xa559('0x31')]));_0x6340d3[_0xa559('0x30')]=_0x6340d3[_0xa559('0x30')][_0xa559('0x43')]?_0x6340d3['attributes']:_0x2af622[_0xa559('0x2c')];if(_0x429249[_0xa559('0x2d')][_0xa559('0x3c')]){_0x6340d3[_0xa559('0x3d')]=[{'all':!![]}];}_0x6340d3=_[_0xa559('0x39')]({},_0x6340d3,_0x429249[_0xa559('0x44')]);return db[_0xa559('0x3a')]['find'](_0x6340d3)[_0xa559('0x3b')](handleEntityNotFound(_0x5d6325,null))[_0xa559('0x3b')](respondWithResult(_0x5d6325,null))[_0xa559('0x3f')](handleError(_0x5d6325,null));};exports[_0xa559('0x45')]=function(_0x425dda,_0x482e46){return db[_0xa559('0x3a')][_0xa559('0x45')](_0x425dda['body'],{})[_0xa559('0x3b')](respondWithResult(_0x482e46,0xc9))[_0xa559('0x3f')](handleError(_0x482e46,null));};exports['update']=function(_0x56a722,_0x140490){if(_0x56a722[_0xa559('0x46')]['id']){delete _0x56a722[_0xa559('0x46')]['id'];}return db[_0xa559('0x3a')][_0xa559('0x47')]({'where':{'id':_0x56a722[_0xa559('0x41')]['id']}})['then'](handleEntityNotFound(_0x140490,null))[_0xa559('0x3b')](saveUpdates(_0x56a722['body'],null))['then'](respondWithResult(_0x140490,null))['catch'](handleError(_0x140490,null));};exports[_0xa559('0x21')]=function(_0x2c200e,_0x17453f){return db[_0xa559('0x3a')][_0xa559('0x47')]({'where':{'id':_0x2c200e[_0xa559('0x41')]['id']}})[_0xa559('0x3b')](handleEntityNotFound(_0x17453f,null))[_0xa559('0x3b')](removeEntity(_0x17453f,null))[_0xa559('0x3f')](handleError(_0x17453f,null));};exports[_0xa559('0x48')]=function(_0x3be912,_0x4abc17){return db[_0xa559('0x3a')][_0xa559('0x48')]()[_0xa559('0x3b')](respondWithResult(_0x4abc17,null))[_0xa559('0x3f')](handleError(_0x4abc17,null));}; \ No newline at end of file +var _0x90db=['options','find','body','describe','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FaxQueueReport','includeAll','include','findAll','rows','catch','params','length'];(function(_0x4da262,_0x3acc86){var _0x1a696c=function(_0x24ff1a){while(--_0x24ff1a){_0x4da262['push'](_0x4da262['shift']());}};_0x1a696c(++_0x3acc86);}(_0x90db,0x1c0));var _0xb90d=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x90db[_0x1fc122];return _0xa2cb13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb90d('0x0'));var zipdir=require(_0xb90d('0x1'));var jsonpatch=require(_0xb90d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb90d('0x3'));var sox=require(_0xb90d('0x4'));var csv=require(_0xb90d('0x5'));var ejs=require(_0xb90d('0x6'));var fs=require('fs');var fs_extra=require(_0xb90d('0x7'));var _=require(_0xb90d('0x8'));var squel=require(_0xb90d('0x9'));var crypto=require(_0xb90d('0xa'));var jsforce=require(_0xb90d('0xb'));var deskjs=require(_0xb90d('0xc'));var toCsv=require(_0xb90d('0x5'));var querystring=require(_0xb90d('0xd'));var Papa=require('papaparse');var Redis=require(_0xb90d('0xe'));var authService=require(_0xb90d('0xf'));var qs=require(_0xb90d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb90d('0x11'));var logger=require(_0xb90d('0x12'))(_0xb90d('0x13'));var utils=require(_0xb90d('0x14'));var config=require(_0xb90d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb90d('0x16'))['db'];function respondWithStatusCode(_0x5bc2b9,_0xe1b1d6){_0xe1b1d6=_0xe1b1d6||0xcc;return function(_0x1d5eed){if(_0x1d5eed){return _0x5bc2b9[_0xb90d('0x17')](_0xe1b1d6);}return _0x5bc2b9[_0xb90d('0x18')](_0xe1b1d6)[_0xb90d('0x19')]();};}function respondWithResult(_0x1152fb,_0x1f797c){_0x1f797c=_0x1f797c||0xc8;return function(_0x56c67c){if(_0x56c67c){return _0x1152fb[_0xb90d('0x18')](_0x1f797c)['json'](_0x56c67c);}};}function respondWithFilteredResult(_0x13dbd5,_0x469d74){return function(_0x5af3c4){if(_0x5af3c4){var _0x1b2324=typeof _0x469d74['offset']===_0xb90d('0x1a')&&typeof _0x469d74[_0xb90d('0x1b')]===_0xb90d('0x1a');var _0x23c136=_0x5af3c4[_0xb90d('0x1c')];var _0x47ee5d=_0x1b2324?0x0:_0x469d74[_0xb90d('0x1d')];var _0x4bd383=_0x1b2324?_0x5af3c4[_0xb90d('0x1c')]:_0x469d74['offset']+_0x469d74['limit'];var _0x73eae9;if(_0x4bd383>=_0x23c136){_0x4bd383=_0x23c136;_0x73eae9=0xc8;}else{_0x73eae9=0xce;}_0x13dbd5[_0xb90d('0x18')](_0x73eae9);return _0x13dbd5[_0xb90d('0x1e')](_0xb90d('0x1f'),_0x47ee5d+'-'+_0x4bd383+'/'+_0x23c136)[_0xb90d('0x20')](_0x5af3c4);}return null;};}function patchUpdates(_0x134076){return function(_0x4d3a04){try{jsonpatch[_0xb90d('0x21')](_0x4d3a04,_0x134076,!![]);}catch(_0x14958c){return BPromise['reject'](_0x14958c);}return _0x4d3a04[_0xb90d('0x22')]();};}function saveUpdates(_0x21d28e,_0x3b3b80){return function(_0x39dcc4){if(_0x39dcc4){return _0x39dcc4[_0xb90d('0x23')](_0x21d28e)[_0xb90d('0x24')](function(_0x818e68){return _0x818e68;});}return null;};}function removeEntity(_0x24f299,_0x37b8ec){return function(_0x1cf8cc){if(_0x1cf8cc){return _0x1cf8cc[_0xb90d('0x25')]()[_0xb90d('0x24')](function(){_0x24f299[_0xb90d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280ec3,_0x54827c){return function(_0x130cc8){if(!_0x130cc8){_0x280ec3[_0xb90d('0x17')](0x194);}return _0x130cc8;};}function handleError(_0x373246,_0x41273b){_0x41273b=_0x41273b||0x1f4;return function(_0x31aee9){logger[_0xb90d('0x26')](_0x31aee9[_0xb90d('0x27')]);if(_0x31aee9[_0xb90d('0x28')]){delete _0x31aee9[_0xb90d('0x28')];}_0x373246[_0xb90d('0x18')](_0x41273b)['send'](_0x31aee9);};}exports[_0xb90d('0x29')]=function(_0x12022d,_0x9428fe){var _0x112370={},_0x1f9151={},_0x21fcea={'count':0x0,'rows':[]};var _0x480d90=_['map'](db['FaxQueueReport'][_0xb90d('0x2a')],function(_0x506aa0){return{'name':_0x506aa0[_0xb90d('0x2b')],'type':_0x506aa0[_0xb90d('0x2c')]['key']};});_0x1f9151[_0xb90d('0x2d')]=_[_0xb90d('0x2e')](_0x480d90,_0xb90d('0x28'));_0x1f9151[_0xb90d('0x2f')]=_[_0xb90d('0x30')](_0x12022d[_0xb90d('0x2f')]);_0x1f9151[_0xb90d('0x31')]=_[_0xb90d('0x32')](_0x1f9151[_0xb90d('0x2d')],_0x1f9151[_0xb90d('0x2f')]);_0x112370[_0xb90d('0x33')]=_[_0xb90d('0x32')](_0x1f9151[_0xb90d('0x2d')],qs[_0xb90d('0x34')](_0x12022d[_0xb90d('0x2f')][_0xb90d('0x34')]));_0x112370[_0xb90d('0x33')]=_0x112370[_0xb90d('0x33')]['length']?_0x112370['attributes']:_0x1f9151[_0xb90d('0x2d')];if(!_0x12022d[_0xb90d('0x2f')][_0xb90d('0x35')](_0xb90d('0x36'))){_0x112370[_0xb90d('0x1b')]=qs[_0xb90d('0x1b')](_0x12022d[_0xb90d('0x2f')]['limit']);_0x112370[_0xb90d('0x1d')]=qs['offset'](_0x12022d[_0xb90d('0x2f')][_0xb90d('0x1d')]);}_0x112370[_0xb90d('0x37')]=qs[_0xb90d('0x38')](_0x12022d[_0xb90d('0x2f')][_0xb90d('0x38')]);_0x112370[_0xb90d('0x39')]=qs[_0xb90d('0x31')](_[_0xb90d('0x3a')](_0x12022d['query'],_0x1f9151[_0xb90d('0x31')]),_0x480d90);if(_0x12022d[_0xb90d('0x2f')][_0xb90d('0x3b')]){_0x112370[_0xb90d('0x39')]=_['merge'](_0x112370[_0xb90d('0x39')],{'$or':_[_0xb90d('0x2e')](_0x480d90,function(_0x1965a6){if(_0x1965a6[_0xb90d('0x2c')]!==_0xb90d('0x3c')){var _0x4adffe={};_0x4adffe[_0x1965a6[_0xb90d('0x28')]]={'$like':'%'+_0x12022d[_0xb90d('0x2f')][_0xb90d('0x3b')]+'%'};return _0x4adffe;}})});}_0x112370=_[_0xb90d('0x3d')]({},_0x112370,_0x12022d['options']);var _0x396258={'where':_0x112370[_0xb90d('0x39')]};return db[_0xb90d('0x3e')][_0xb90d('0x1c')](_0x396258)[_0xb90d('0x24')](function(_0x5180db){_0x21fcea[_0xb90d('0x1c')]=_0x5180db;if(_0x12022d[_0xb90d('0x2f')][_0xb90d('0x3f')]){_0x112370[_0xb90d('0x40')]=[{'all':!![]}];}return db[_0xb90d('0x3e')][_0xb90d('0x41')](_0x112370);})[_0xb90d('0x24')](function(_0x238a36){_0x21fcea[_0xb90d('0x42')]=_0x238a36;return _0x21fcea;})[_0xb90d('0x24')](respondWithFilteredResult(_0x9428fe,_0x112370))[_0xb90d('0x43')](handleError(_0x9428fe,null));};exports['show']=function(_0x200de3,_0x539ac4){var _0x3497c2={'raw':!![],'where':{'id':_0x200de3[_0xb90d('0x44')]['id']}},_0x53ad19={};_0x53ad19[_0xb90d('0x2d')]=_[_0xb90d('0x30')](db[_0xb90d('0x3e')][_0xb90d('0x2a')]);_0x53ad19['query']=_[_0xb90d('0x30')](_0x200de3[_0xb90d('0x2f')]);_0x53ad19['filters']=_['intersection'](_0x53ad19['model'],_0x53ad19['query']);_0x3497c2[_0xb90d('0x33')]=_[_0xb90d('0x32')](_0x53ad19['model'],qs[_0xb90d('0x34')](_0x200de3['query'][_0xb90d('0x34')]));_0x3497c2['attributes']=_0x3497c2['attributes'][_0xb90d('0x45')]?_0x3497c2[_0xb90d('0x33')]:_0x53ad19[_0xb90d('0x2d')];if(_0x200de3[_0xb90d('0x2f')][_0xb90d('0x3f')]){_0x3497c2['include']=[{'all':!![]}];}_0x3497c2=_[_0xb90d('0x3d')]({},_0x3497c2,_0x200de3[_0xb90d('0x46')]);return db[_0xb90d('0x3e')][_0xb90d('0x47')](_0x3497c2)[_0xb90d('0x24')](handleEntityNotFound(_0x539ac4,null))[_0xb90d('0x24')](respondWithResult(_0x539ac4,null))[_0xb90d('0x43')](handleError(_0x539ac4,null));};exports['create']=function(_0xcd3b8b,_0x240e0f){return db[_0xb90d('0x3e')]['create'](_0xcd3b8b[_0xb90d('0x48')],{})[_0xb90d('0x24')](respondWithResult(_0x240e0f,0xc9))[_0xb90d('0x43')](handleError(_0x240e0f,null));};exports['update']=function(_0x4a50aa,_0x25e5f5){if(_0x4a50aa[_0xb90d('0x48')]['id']){delete _0x4a50aa[_0xb90d('0x48')]['id'];}return db[_0xb90d('0x3e')][_0xb90d('0x47')]({'where':{'id':_0x4a50aa[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x25e5f5,null))[_0xb90d('0x24')](saveUpdates(_0x4a50aa[_0xb90d('0x48')],null))[_0xb90d('0x24')](respondWithResult(_0x25e5f5,null))[_0xb90d('0x43')](handleError(_0x25e5f5,null));};exports[_0xb90d('0x25')]=function(_0x3f3c14,_0x45821a){return db['FaxQueueReport'][_0xb90d('0x47')]({'where':{'id':_0x3f3c14[_0xb90d('0x44')]['id']}})[_0xb90d('0x24')](handleEntityNotFound(_0x45821a,null))['then'](removeEntity(_0x45821a,null))['catch'](handleError(_0x45821a,null));};exports['describe']=function(_0x1aef13,_0x3d681d){return db[_0xb90d('0x3e')][_0xb90d('0x49')]()['then'](respondWithResult(_0x3d681d,null))[_0xb90d('0x43')](handleError(_0x3d681d,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 44d882e..6ea63ed 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x35ce78,_0xaaa4ca){var _0x2ce457=function(_0x5a1f34){while(--_0x5a1f34){_0x35ce78['push'](_0x35ce78['shift']());}};_0x2ce457(++_0xaaa4ca);}(_0x326f,0xd1));var _0xf326=function(_0x52f59b,_0x1b5ec9){_0x52f59b=_0x52f59b-0x0;var _0x28632a=_0x326f[_0x52f59b];return _0x28632a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x39d4e7,_0x33383c){var _0x1b3375=function(_0x45d961){while(--_0x45d961){_0x39d4e7['push'](_0x39d4e7['shift']());}};_0x1b3375(++_0x33383c);}(_0x4975,0x86));var _0x5497=function(_0x1137a7,_0x359f38){_0x1137a7=_0x1137a7-0x0;var _0x4a4c39=_0x4975[_0x1137a7];return _0x4a4c39;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index a1411c1..d55c956 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 _0x1735=['where','attributes','limit','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxQueueReport','body','options','raw','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','update'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x1735,0x1e3));var _0x5173=function(_0x355753,_0x32c6fc){_0x355753=_0x355753-0x0;var _0x35cf36=_0x1735[_0x355753];return _0x35cf36;};'use strict';var _=require(_0x5173('0x0'));var util=require(_0x5173('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5173('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5173('0x3'));var logger=require(_0x5173('0x4'))(_0x5173('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5173('0x6')][_0x5173('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x492549,_0x1a2145,_0xc9f0a0){return new BPromise(function(_0x35de17,_0x35ec61){return client[_0x5173('0x8')](_0x492549,_0xc9f0a0)[_0x5173('0x9')](function(_0x240b3c){logger[_0x5173('0xa')](_0x5173('0xb'),_0x1a2145,_0x5173('0xc'));logger[_0x5173('0xd')](_0x5173('0xe'),_0x1a2145,_0x5173('0xc'),JSON['stringify'](_0x240b3c));if(_0x240b3c[_0x5173('0xf')]){if(_0x240b3c[_0x5173('0xf')][_0x5173('0x10')]===0x1f4){logger[_0x5173('0xf')](_0x5173('0xb'),_0x1a2145,_0x240b3c['error'][_0x5173('0x11')]);return _0x35ec61(_0x240b3c[_0x5173('0xf')]['message']);}logger[_0x5173('0xf')](_0x5173('0xb'),_0x1a2145,_0x240b3c[_0x5173('0xf')]['message']);return _0x35de17(_0x240b3c[_0x5173('0xf')][_0x5173('0x11')]);}else{logger[_0x5173('0xa')](_0x5173('0xb'),_0x1a2145,_0x5173('0xc'));_0x35de17(_0x240b3c['result'][_0x5173('0x11')]);}})[_0x5173('0x12')](function(_0x624b56){logger[_0x5173('0xf')](_0x5173('0xb'),_0x1a2145,_0x624b56);_0x35ec61(_0x624b56);});});}exports['CreateFaxQueueReport']=function(_0x692f6a){var _0x532ed4=this;return new Promise(function(_0x14f7dd,_0x2eb29b){return db[_0x5173('0x13')]['create'](_0x692f6a[_0x5173('0x14')],{'raw':_0x692f6a[_0x5173('0x15')]?_0x692f6a[_0x5173('0x15')][_0x5173('0x16')]===undefined?!![]:![]:!![]})[_0x5173('0x9')](function(_0x1b1996){logger[_0x5173('0xa')]('CreateFaxQueueReport',_0x692f6a);logger['debug'](_0x5173('0x17'),_0x692f6a,JSON[_0x5173('0x18')](_0x1b1996));_0x14f7dd(_0x1b1996);})[_0x5173('0x12')](function(_0x2b50de){logger[_0x5173('0xf')]('CreateFaxQueueReport',_0x2b50de[_0x5173('0x11')],_0x692f6a);_0x2eb29b(_0x532ed4[_0x5173('0xf')](0x1f4,_0x2b50de[_0x5173('0x11')]));});});};exports[_0x5173('0x19')]=function(_0x2d1634){var _0xe254ca=this;return new Promise(function(_0x614493,_0x159f87){return db[_0x5173('0x13')][_0x5173('0x1a')](_0x2d1634[_0x5173('0x14')],{'raw':_0x2d1634['options']?_0x2d1634[_0x5173('0x15')][_0x5173('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d1634['options']?_0x2d1634[_0x5173('0x15')][_0x5173('0x1b')]||null:null,'attributes':_0x2d1634[_0x5173('0x15')]?_0x2d1634['options'][_0x5173('0x1c')]||null:null,'limit':_0x2d1634['options']?_0x2d1634[_0x5173('0x15')][_0x5173('0x1d')]||null:null})[_0x5173('0x9')](function(_0x46a5e4){logger[_0x5173('0xa')](_0x5173('0x19'),_0x2d1634);logger[_0x5173('0xd')](_0x5173('0x19'),_0x2d1634,JSON[_0x5173('0x18')](_0x46a5e4));_0x614493(_0x46a5e4);})['catch'](function(_0x36352b){logger['error'](_0x5173('0x19'),_0x36352b[_0x5173('0x11')],_0x2d1634);_0x159f87(_0xe254ca[_0x5173('0xf')](0x1f4,_0x36352b[_0x5173('0x11')]));});});}; \ No newline at end of file +var _0x317a=['code','message','result','catch','CreateFaxQueueReport','create','body','options','raw','debug','FaxQueueReport','where','limit','info','UpdateFaxQueueReport','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x14e887,_0x3572d3){var _0x8e9496=function(_0x1a141f){while(--_0x1a141f){_0x14e887['push'](_0x14e887['shift']());}};_0x8e9496(++_0x3572d3);}(_0x317a,0x1c1));var _0xa317=function(_0x56a987,_0x2c1ee5){_0x56a987=_0x56a987-0x0;var _0xf30558=_0x317a[_0x56a987];return _0xf30558;};'use strict';var _=require(_0xa317('0x0'));var util=require(_0xa317('0x1'));var moment=require(_0xa317('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa317('0x3'));var db=require(_0xa317('0x4'))['db'];var utils=require(_0xa317('0x5'));var logger=require('../../config/logger')(_0xa317('0x6'));var config=require(_0xa317('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa317('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37f8b5,_0x47398a,_0x200242){return new BPromise(function(_0x296777,_0x58e0d6){return client[_0xa317('0x9')](_0x37f8b5,_0x200242)[_0xa317('0xa')](function(_0x2ede8d){logger['info'](_0xa317('0xb'),_0x47398a,'request\x20sent');logger['debug'](_0xa317('0xc'),_0x47398a,_0xa317('0xd'),JSON[_0xa317('0xe')](_0x2ede8d));if(_0x2ede8d[_0xa317('0xf')]){if(_0x2ede8d[_0xa317('0xf')][_0xa317('0x10')]===0x1f4){logger[_0xa317('0xf')](_0xa317('0xb'),_0x47398a,_0x2ede8d[_0xa317('0xf')][_0xa317('0x11')]);return _0x58e0d6(_0x2ede8d['error'][_0xa317('0x11')]);}logger[_0xa317('0xf')](_0xa317('0xb'),_0x47398a,_0x2ede8d['error'][_0xa317('0x11')]);return _0x296777(_0x2ede8d['error']['message']);}else{logger['info'](_0xa317('0xb'),_0x47398a,_0xa317('0xd'));_0x296777(_0x2ede8d[_0xa317('0x12')][_0xa317('0x11')]);}})[_0xa317('0x13')](function(_0x17004b){logger[_0xa317('0xf')](_0xa317('0xb'),_0x47398a,_0x17004b);_0x58e0d6(_0x17004b);});});}exports[_0xa317('0x14')]=function(_0x3aff00){var _0x9c186a=this;return new Promise(function(_0x5a6dfe,_0x57cc72){return db['FaxQueueReport'][_0xa317('0x15')](_0x3aff00[_0xa317('0x16')],{'raw':_0x3aff00[_0xa317('0x17')]?_0x3aff00[_0xa317('0x17')][_0xa317('0x18')]===undefined?!![]:![]:!![]})[_0xa317('0xa')](function(_0x452ba3){logger['info'](_0xa317('0x14'),_0x3aff00);logger[_0xa317('0x19')]('CreateFaxQueueReport',_0x3aff00,JSON[_0xa317('0xe')](_0x452ba3));_0x5a6dfe(_0x452ba3);})['catch'](function(_0x54a05b){logger[_0xa317('0xf')]('CreateFaxQueueReport',_0x54a05b[_0xa317('0x11')],_0x3aff00);_0x57cc72(_0x9c186a[_0xa317('0xf')](0x1f4,_0x54a05b[_0xa317('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x2b1a97){var _0xa717fc=this;return new Promise(function(_0x31f621,_0x4e8a41){return db[_0xa317('0x1a')]['update'](_0x2b1a97[_0xa317('0x16')],{'raw':_0x2b1a97[_0xa317('0x17')]?_0x2b1a97[_0xa317('0x17')][_0xa317('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1a97[_0xa317('0x17')]?_0x2b1a97['options'][_0xa317('0x1b')]||null:null,'attributes':_0x2b1a97[_0xa317('0x17')]?_0x2b1a97[_0xa317('0x17')]['attributes']||null:null,'limit':_0x2b1a97[_0xa317('0x17')]?_0x2b1a97[_0xa317('0x17')][_0xa317('0x1c')]||null:null})[_0xa317('0xa')](function(_0x44c89e){logger[_0xa317('0x1d')](_0xa317('0x1e'),_0x2b1a97);logger[_0xa317('0x19')](_0xa317('0x1e'),_0x2b1a97,JSON[_0xa317('0xe')](_0x44c89e));_0x31f621(_0x44c89e);})[_0xa317('0x13')](function(_0x2fb9a1){logger['error'](_0xa317('0x1e'),_0x2fb9a1['message'],_0x2b1a97);_0x4e8a41(_0xa717fc[_0xa317('0xf')](0x1f4,_0x2fb9a1[_0xa317('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c7c6d20..8b00ce3 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 _0x9f8d=['update','delete','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put'];(function(_0x43ade9,_0xd1b6fa){var _0x56d85a=function(_0x51ece1){while(--_0x51ece1){_0x43ade9['push'](_0x43ade9['shift']());}};_0x56d85a(++_0xd1b6fa);}(_0x9f8d,0x1c5));var _0xd9f8=function(_0x2e952c,_0x273152){_0x2e952c=_0x2e952c-0x0;var _0x3e9a62=_0x9f8d[_0x2e952c];return _0x3e9a62;};'use strict';var multer=require('multer');var util=require(_0xd9f8('0x0'));var path=require(_0xd9f8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd9f8('0x2'));var auth=require(_0xd9f8('0x3'));var interaction=require(_0xd9f8('0x4'));var config=require(_0xd9f8('0x5'));var controller=require(_0xd9f8('0x6'));router[_0xd9f8('0x7')]('/',auth[_0xd9f8('0x8')](),controller['index']);router[_0xd9f8('0x7')](_0xd9f8('0x9'),auth[_0xd9f8('0x8')](),controller['describe']);router[_0xd9f8('0x7')](_0xd9f8('0xa'),auth['isAuthenticated'](),controller[_0xd9f8('0xb')]);router[_0xd9f8('0xc')]('/',auth['isAuthenticated'](),controller[_0xd9f8('0xd')]);router[_0xd9f8('0xe')]('/:id',auth[_0xd9f8('0x8')](),controller[_0xd9f8('0xf')]);router[_0xd9f8('0x10')]('/:id',auth[_0xd9f8('0x8')](),controller['destroy']);module[_0xd9f8('0x11')]=router; \ No newline at end of file +var _0x799d=['put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x799d,0x146));var _0xd799=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x799d[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd799('0x0'));var express=require(_0xd799('0x1'));var router=express[_0xd799('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd799('0x3'));var config=require(_0xd799('0x4'));var controller=require(_0xd799('0x5'));router[_0xd799('0x6')]('/',auth[_0xd799('0x7')](),controller[_0xd799('0x8')]);router[_0xd799('0x6')](_0xd799('0x9'),auth[_0xd799('0x7')](),controller[_0xd799('0xa')]);router[_0xd799('0x6')]('/:id',auth[_0xd799('0x7')](),controller[_0xd799('0xb')]);router[_0xd799('0xc')]('/',auth[_0xd799('0x7')](),controller[_0xd799('0xd')]);router[_0xd799('0xe')](_0xd799('0xf'),auth[_0xd799('0x7')](),controller[_0xd799('0x10')]);router[_0xd799('0x11')]('/:id',auth[_0xd799('0x7')](),controller[_0xd799('0x12')]);module[_0xd799('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2634cb4..999314b 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2e5fcf,_0x596581){var _0x5f493b=function(_0x3aad45){while(--_0x3aad45){_0x2e5fcf['push'](_0x2e5fcf['shift']());}};_0x5f493b(++_0x596581);}(_0xaa88,0x137));var _0x8aa8=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0xaa88[_0xe719ec];return _0x4842a1;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x56bf86,_0x1a8598){var _0x29429c=function(_0x7184ff){while(--_0x7184ff){_0x56bf86['push'](_0x56bf86['shift']());}};_0x29429c(++_0x1a8598);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xcb91[_0x2d994d];return _0xd54be4;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 5ab1a2e..3933255 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 _0x5413=['body','describe','eml-format','rimraf','zip-dir','request-promise','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','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','destroy','error','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','then','includeAll','include','rows','catch','show','params','length','find','create'];(function(_0x2c976f,_0x4bd2c4){var _0x1a1227=function(_0x24597e){while(--_0x24597e){_0x2c976f['push'](_0x2c976f['shift']());}};_0x1a1227(++_0x4bd2c4);}(_0x5413,0x126));var _0x3541=function(_0x446fdd,_0x55790a){_0x446fdd=_0x446fdd-0x0;var _0x203b19=_0x5413[_0x446fdd];return _0x203b19;};'use strict';var emlformat=require(_0x3541('0x0'));var rimraf=require(_0x3541('0x1'));var zipdir=require(_0x3541('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3541('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3541('0x4'));var path=require(_0x3541('0x5'));var sox=require(_0x3541('0x6'));var csv=require(_0x3541('0x7'));var ejs=require(_0x3541('0x8'));var fs=require('fs');var fs_extra=require(_0x3541('0x9'));var _=require(_0x3541('0xa'));var squel=require(_0x3541('0xb'));var crypto=require(_0x3541('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3541('0xd'));var toCsv=require(_0x3541('0x7'));var querystring=require(_0x3541('0xe'));var Papa=require(_0x3541('0xf'));var Redis=require(_0x3541('0x10'));var authService=require(_0x3541('0x11'));var qs=require(_0x3541('0x12'));var as=require(_0x3541('0x13'));var hardwareService=require(_0x3541('0x14'));var logger=require(_0x3541('0x15'))(_0x3541('0x16'));var utils=require(_0x3541('0x17'));var config=require(_0x3541('0x18'));var licenseUtil=require(_0x3541('0x19'));var db=require(_0x3541('0x1a'))['db'];function respondWithStatusCode(_0x2b1aa6,_0x3d6485){_0x3d6485=_0x3d6485||0xcc;return function(_0x3016e5){if(_0x3016e5){return _0x2b1aa6[_0x3541('0x1b')](_0x3d6485);}return _0x2b1aa6['status'](_0x3d6485)['end']();};}function respondWithResult(_0x7fc1ff,_0x27a5d4){_0x27a5d4=_0x27a5d4||0xc8;return function(_0x4742d7){if(_0x4742d7){return _0x7fc1ff[_0x3541('0x1c')](_0x27a5d4)['json'](_0x4742d7);}};}function respondWithFilteredResult(_0x111976,_0xdaa067){return function(_0x4b404c){if(_0x4b404c){var _0x2914bd=typeof _0xdaa067[_0x3541('0x1d')]==='undefined'&&typeof _0xdaa067['limit']===_0x3541('0x1e');var _0x292278=_0x4b404c[_0x3541('0x1f')];var _0x3b720e=_0x2914bd?0x0:_0xdaa067[_0x3541('0x1d')];var _0xd36933=_0x2914bd?_0x4b404c[_0x3541('0x1f')]:_0xdaa067['offset']+_0xdaa067['limit'];var _0x543d00;if(_0xd36933>=_0x292278){_0xd36933=_0x292278;_0x543d00=0xc8;}else{_0x543d00=0xce;}_0x111976[_0x3541('0x1c')](_0x543d00);return _0x111976['set'](_0x3541('0x20'),_0x3b720e+'-'+_0xd36933+'/'+_0x292278)[_0x3541('0x21')](_0x4b404c);}return null;};}function patchUpdates(_0x9c950a){return function(_0x110cbd){try{jsonpatch[_0x3541('0x22')](_0x110cbd,_0x9c950a,!![]);}catch(_0x57f205){return BPromise[_0x3541('0x23')](_0x57f205);}return _0x110cbd[_0x3541('0x24')]();};}function saveUpdates(_0x43afd9,_0x28bbc2){return function(_0xaedc5b){if(_0xaedc5b){return _0xaedc5b[_0x3541('0x25')](_0x43afd9)['then'](function(_0x5d1a9b){return _0x5d1a9b;});}return null;};}function removeEntity(_0x474a04,_0x12c801){return function(_0x4ac881){if(_0x4ac881){return _0x4ac881[_0x3541('0x26')]()['then'](function(){_0x474a04[_0x3541('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x305de5,_0x29810e){return function(_0x2986f9){if(!_0x2986f9){_0x305de5[_0x3541('0x1b')](0x194);}return _0x2986f9;};}function handleError(_0x271f3c,_0x38966e){_0x38966e=_0x38966e||0x1f4;return function(_0x5dbe5b){logger[_0x3541('0x27')](_0x5dbe5b['stack']);if(_0x5dbe5b[_0x3541('0x28')]){delete _0x5dbe5b['name'];}_0x271f3c['status'](_0x38966e)['send'](_0x5dbe5b);};}exports[_0x3541('0x29')]=function(_0x16bd04,_0x599432){var _0x51d67d={},_0x57d96b={},_0x207e63={'count':0x0,'rows':[]};var _0x3d11cc=_[_0x3541('0x2a')](db[_0x3541('0x2b')][_0x3541('0x2c')],function(_0x18ac80){return{'name':_0x18ac80[_0x3541('0x2d')],'type':_0x18ac80[_0x3541('0x2e')]['key']};});_0x57d96b['model']=_['map'](_0x3d11cc,_0x3541('0x28'));_0x57d96b[_0x3541('0x2f')]=_[_0x3541('0x30')](_0x16bd04[_0x3541('0x2f')]);_0x57d96b[_0x3541('0x31')]=_[_0x3541('0x32')](_0x57d96b[_0x3541('0x33')],_0x57d96b[_0x3541('0x2f')]);_0x51d67d[_0x3541('0x34')]=_[_0x3541('0x32')](_0x57d96b['model'],qs[_0x3541('0x35')](_0x16bd04[_0x3541('0x2f')][_0x3541('0x35')]));_0x51d67d[_0x3541('0x34')]=_0x51d67d[_0x3541('0x34')]['length']?_0x51d67d[_0x3541('0x34')]:_0x57d96b[_0x3541('0x33')];if(!_0x16bd04[_0x3541('0x2f')][_0x3541('0x36')]('nolimit')){_0x51d67d['limit']=qs['limit'](_0x16bd04[_0x3541('0x2f')]['limit']);_0x51d67d[_0x3541('0x1d')]=qs['offset'](_0x16bd04[_0x3541('0x2f')]['offset']);}_0x51d67d[_0x3541('0x37')]=qs[_0x3541('0x38')](_0x16bd04['query']['sort']);_0x51d67d[_0x3541('0x39')]=qs[_0x3541('0x31')](_['pick'](_0x16bd04[_0x3541('0x2f')],_0x57d96b[_0x3541('0x31')]),_0x3d11cc);if(_0x16bd04[_0x3541('0x2f')]['filter']){_0x51d67d['where']=_[_0x3541('0x3a')](_0x51d67d['where'],{'$or':_[_0x3541('0x2a')](_0x3d11cc,function(_0x5a2dc2){if(_0x5a2dc2[_0x3541('0x2e')]!==_0x3541('0x3b')){var _0x5335bc={};_0x5335bc[_0x5a2dc2['name']]={'$like':'%'+_0x16bd04[_0x3541('0x2f')][_0x3541('0x3c')]+'%'};return _0x5335bc;}})});}_0x51d67d=_['merge']({},_0x51d67d,_0x16bd04['options']);var _0x46434e={'where':_0x51d67d['where']};return db[_0x3541('0x2b')][_0x3541('0x1f')](_0x46434e)[_0x3541('0x3d')](function(_0xb759f9){_0x207e63['count']=_0xb759f9;if(_0x16bd04[_0x3541('0x2f')][_0x3541('0x3e')]){_0x51d67d[_0x3541('0x3f')]=[{'all':!![]}];}return db[_0x3541('0x2b')]['findAll'](_0x51d67d);})[_0x3541('0x3d')](function(_0x3ac364){_0x207e63[_0x3541('0x40')]=_0x3ac364;return _0x207e63;})['then'](respondWithFilteredResult(_0x599432,_0x51d67d))[_0x3541('0x41')](handleError(_0x599432,null));};exports[_0x3541('0x42')]=function(_0x1e2638,_0x97122){var _0x4655ed={'raw':!![],'where':{'id':_0x1e2638[_0x3541('0x43')]['id']}},_0xd2dc9={};_0xd2dc9[_0x3541('0x33')]=_[_0x3541('0x30')](db[_0x3541('0x2b')]['rawAttributes']);_0xd2dc9['query']=_[_0x3541('0x30')](_0x1e2638[_0x3541('0x2f')]);_0xd2dc9[_0x3541('0x31')]=_[_0x3541('0x32')](_0xd2dc9[_0x3541('0x33')],_0xd2dc9[_0x3541('0x2f')]);_0x4655ed[_0x3541('0x34')]=_[_0x3541('0x32')](_0xd2dc9[_0x3541('0x33')],qs[_0x3541('0x35')](_0x1e2638[_0x3541('0x2f')]['fields']));_0x4655ed['attributes']=_0x4655ed[_0x3541('0x34')][_0x3541('0x44')]?_0x4655ed[_0x3541('0x34')]:_0xd2dc9['model'];if(_0x1e2638[_0x3541('0x2f')]['includeAll']){_0x4655ed[_0x3541('0x3f')]=[{'all':!![]}];}_0x4655ed=_[_0x3541('0x3a')]({},_0x4655ed,_0x1e2638['options']);return db[_0x3541('0x2b')][_0x3541('0x45')](_0x4655ed)[_0x3541('0x3d')](handleEntityNotFound(_0x97122,null))['then'](respondWithResult(_0x97122,null))[_0x3541('0x41')](handleError(_0x97122,null));};exports[_0x3541('0x46')]=function(_0x3315e9,_0x489223){return db[_0x3541('0x2b')][_0x3541('0x46')](_0x3315e9[_0x3541('0x47')],{})[_0x3541('0x3d')](respondWithResult(_0x489223,0xc9))[_0x3541('0x41')](handleError(_0x489223,null));};exports[_0x3541('0x25')]=function(_0x2fcb61,_0x3aa4b0){if(_0x2fcb61[_0x3541('0x47')]['id']){delete _0x2fcb61[_0x3541('0x47')]['id'];}return db[_0x3541('0x2b')]['find']({'where':{'id':_0x2fcb61[_0x3541('0x43')]['id']}})[_0x3541('0x3d')](handleEntityNotFound(_0x3aa4b0,null))[_0x3541('0x3d')](saveUpdates(_0x2fcb61[_0x3541('0x47')],null))[_0x3541('0x3d')](respondWithResult(_0x3aa4b0,null))[_0x3541('0x41')](handleError(_0x3aa4b0,null));};exports[_0x3541('0x26')]=function(_0x42bd32,_0x511437){return db[_0x3541('0x2b')][_0x3541('0x45')]({'where':{'id':_0x42bd32['params']['id']}})['then'](handleEntityNotFound(_0x511437,null))['then'](removeEntity(_0x511437,null))[_0x3541('0x41')](handleError(_0x511437,null));};exports[_0x3541('0x48')]=function(_0x717d72,_0x2ddaf4){return db[_0x3541('0x2b')]['describe']()[_0x3541('0x3d')](respondWithResult(_0x2ddaf4,null))[_0x3541('0x41')](handleError(_0x2ddaf4,null));}; \ No newline at end of file +var _0x6b82=['attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','index','FaxTransferReport','rawAttributes','type','key','model','query','filters','intersection','fields'];(function(_0x13934c,_0x30e1bc){var _0x3d29d5=function(_0x3a3695){while(--_0x3a3695){_0x13934c['push'](_0x13934c['shift']());}};_0x3d29d5(++_0x30e1bc);}(_0x6b82,0xfd));var _0x26b8=function(_0x40cff7,_0x5c3eb5){_0x40cff7=_0x40cff7-0x0;var _0x38006f=_0x6b82[_0x40cff7];return _0x38006f;};'use strict';var emlformat=require(_0x26b8('0x0'));var rimraf=require(_0x26b8('0x1'));var zipdir=require(_0x26b8('0x2'));var jsonpatch=require(_0x26b8('0x3'));var rp=require('request-promise');var moment=require(_0x26b8('0x4'));var BPromise=require(_0x26b8('0x5'));var Mustache=require('mustache');var util=require(_0x26b8('0x6'));var path=require(_0x26b8('0x7'));var sox=require(_0x26b8('0x8'));var csv=require(_0x26b8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26b8('0xa'));var _=require(_0x26b8('0xb'));var squel=require(_0x26b8('0xc'));var crypto=require('crypto');var jsforce=require(_0x26b8('0xd'));var deskjs=require(_0x26b8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x26b8('0xf'));var Papa=require(_0x26b8('0x10'));var Redis=require(_0x26b8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x26b8('0x12'));var as=require(_0x26b8('0x13'));var hardwareService=require(_0x26b8('0x14'));var logger=require(_0x26b8('0x15'))(_0x26b8('0x16'));var utils=require('../../config/utils');var config=require(_0x26b8('0x17'));var licenseUtil=require(_0x26b8('0x18'));var db=require(_0x26b8('0x19'))['db'];function respondWithStatusCode(_0x4f2d36,_0x28f0c9){_0x28f0c9=_0x28f0c9||0xcc;return function(_0x34708b){if(_0x34708b){return _0x4f2d36[_0x26b8('0x1a')](_0x28f0c9);}return _0x4f2d36[_0x26b8('0x1b')](_0x28f0c9)[_0x26b8('0x1c')]();};}function respondWithResult(_0x33466c,_0xa394ca){_0xa394ca=_0xa394ca||0xc8;return function(_0x2a1a37){if(_0x2a1a37){return _0x33466c[_0x26b8('0x1b')](_0xa394ca)[_0x26b8('0x1d')](_0x2a1a37);}};}function respondWithFilteredResult(_0x57bc26,_0xd5af34){return function(_0x5be3f6){if(_0x5be3f6){var _0x2e51f9=typeof _0xd5af34[_0x26b8('0x1e')]===_0x26b8('0x1f')&&typeof _0xd5af34['limit']===_0x26b8('0x1f');var _0x193598=_0x5be3f6[_0x26b8('0x20')];var _0x36761d=_0x2e51f9?0x0:_0xd5af34[_0x26b8('0x1e')];var _0x2e8282=_0x2e51f9?_0x5be3f6[_0x26b8('0x20')]:_0xd5af34[_0x26b8('0x1e')]+_0xd5af34['limit'];var _0x39f5af;if(_0x2e8282>=_0x193598){_0x2e8282=_0x193598;_0x39f5af=0xc8;}else{_0x39f5af=0xce;}_0x57bc26['status'](_0x39f5af);return _0x57bc26[_0x26b8('0x21')](_0x26b8('0x22'),_0x36761d+'-'+_0x2e8282+'/'+_0x193598)[_0x26b8('0x1d')](_0x5be3f6);}return null;};}function patchUpdates(_0x1d6698){return function(_0x3977e8){try{jsonpatch['apply'](_0x3977e8,_0x1d6698,!![]);}catch(_0x44f6f4){return BPromise['reject'](_0x44f6f4);}return _0x3977e8['save']();};}function saveUpdates(_0x4b8722,_0x4c0f0b){return function(_0x3c2bb3){if(_0x3c2bb3){return _0x3c2bb3[_0x26b8('0x23')](_0x4b8722)[_0x26b8('0x24')](function(_0x3da22a){return _0x3da22a;});}return null;};}function removeEntity(_0x5505ba,_0x36ce4f){return function(_0x4a2053){if(_0x4a2053){return _0x4a2053[_0x26b8('0x25')]()['then'](function(){_0x5505ba[_0x26b8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb33f,_0xd7c318){return function(_0xecd34c){if(!_0xecd34c){_0x2bb33f[_0x26b8('0x1a')](0x194);}return _0xecd34c;};}function handleError(_0x12ae63,_0x25c5a3){_0x25c5a3=_0x25c5a3||0x1f4;return function(_0x2c3d7f){logger[_0x26b8('0x26')](_0x2c3d7f[_0x26b8('0x27')]);if(_0x2c3d7f['name']){delete _0x2c3d7f[_0x26b8('0x28')];}_0x12ae63[_0x26b8('0x1b')](_0x25c5a3)['send'](_0x2c3d7f);};}exports[_0x26b8('0x29')]=function(_0x43db99,_0x50260c){var _0x2081d4={},_0x4c5ee6={},_0x1a345c={'count':0x0,'rows':[]};var _0x5b6811=_['map'](db[_0x26b8('0x2a')][_0x26b8('0x2b')],function(_0x54101c){return{'name':_0x54101c['fieldName'],'type':_0x54101c[_0x26b8('0x2c')][_0x26b8('0x2d')]};});_0x4c5ee6[_0x26b8('0x2e')]=_['map'](_0x5b6811,_0x26b8('0x28'));_0x4c5ee6['query']=_['keys'](_0x43db99[_0x26b8('0x2f')]);_0x4c5ee6[_0x26b8('0x30')]=_[_0x26b8('0x31')](_0x4c5ee6[_0x26b8('0x2e')],_0x4c5ee6[_0x26b8('0x2f')]);_0x2081d4['attributes']=_[_0x26b8('0x31')](_0x4c5ee6[_0x26b8('0x2e')],qs[_0x26b8('0x32')](_0x43db99[_0x26b8('0x2f')][_0x26b8('0x32')]));_0x2081d4[_0x26b8('0x33')]=_0x2081d4[_0x26b8('0x33')][_0x26b8('0x34')]?_0x2081d4['attributes']:_0x4c5ee6[_0x26b8('0x2e')];if(!_0x43db99[_0x26b8('0x2f')][_0x26b8('0x35')](_0x26b8('0x36'))){_0x2081d4[_0x26b8('0x37')]=qs[_0x26b8('0x37')](_0x43db99[_0x26b8('0x2f')]['limit']);_0x2081d4[_0x26b8('0x1e')]=qs['offset'](_0x43db99[_0x26b8('0x2f')][_0x26b8('0x1e')]);}_0x2081d4[_0x26b8('0x38')]=qs[_0x26b8('0x39')](_0x43db99[_0x26b8('0x2f')][_0x26b8('0x39')]);_0x2081d4['where']=qs[_0x26b8('0x30')](_[_0x26b8('0x3a')](_0x43db99[_0x26b8('0x2f')],_0x4c5ee6['filters']),_0x5b6811);if(_0x43db99[_0x26b8('0x2f')][_0x26b8('0x3b')]){_0x2081d4[_0x26b8('0x3c')]=_['merge'](_0x2081d4[_0x26b8('0x3c')],{'$or':_['map'](_0x5b6811,function(_0x133e3c){if(_0x133e3c[_0x26b8('0x2c')]!==_0x26b8('0x3d')){var _0x3be695={};_0x3be695[_0x133e3c[_0x26b8('0x28')]]={'$like':'%'+_0x43db99['query']['filter']+'%'};return _0x3be695;}})});}_0x2081d4=_[_0x26b8('0x3e')]({},_0x2081d4,_0x43db99[_0x26b8('0x3f')]);var _0xb97623={'where':_0x2081d4[_0x26b8('0x3c')]};return db['FaxTransferReport'][_0x26b8('0x20')](_0xb97623)['then'](function(_0x73ad64){_0x1a345c[_0x26b8('0x20')]=_0x73ad64;if(_0x43db99[_0x26b8('0x2f')][_0x26b8('0x40')]){_0x2081d4[_0x26b8('0x41')]=[{'all':!![]}];}return db[_0x26b8('0x2a')][_0x26b8('0x42')](_0x2081d4);})[_0x26b8('0x24')](function(_0x29e2a4){_0x1a345c[_0x26b8('0x43')]=_0x29e2a4;return _0x1a345c;})[_0x26b8('0x24')](respondWithFilteredResult(_0x50260c,_0x2081d4))[_0x26b8('0x44')](handleError(_0x50260c,null));};exports[_0x26b8('0x45')]=function(_0x1a4b64,_0x45e6a1){var _0x29fb61={'raw':!![],'where':{'id':_0x1a4b64['params']['id']}},_0x30dfd1={};_0x30dfd1[_0x26b8('0x2e')]=_['keys'](db[_0x26b8('0x2a')][_0x26b8('0x2b')]);_0x30dfd1[_0x26b8('0x2f')]=_[_0x26b8('0x46')](_0x1a4b64[_0x26b8('0x2f')]);_0x30dfd1[_0x26b8('0x30')]=_[_0x26b8('0x31')](_0x30dfd1[_0x26b8('0x2e')],_0x30dfd1[_0x26b8('0x2f')]);_0x29fb61[_0x26b8('0x33')]=_[_0x26b8('0x31')](_0x30dfd1[_0x26b8('0x2e')],qs[_0x26b8('0x32')](_0x1a4b64[_0x26b8('0x2f')]['fields']));_0x29fb61[_0x26b8('0x33')]=_0x29fb61[_0x26b8('0x33')][_0x26b8('0x34')]?_0x29fb61[_0x26b8('0x33')]:_0x30dfd1['model'];if(_0x1a4b64['query'][_0x26b8('0x40')]){_0x29fb61[_0x26b8('0x41')]=[{'all':!![]}];}_0x29fb61=_[_0x26b8('0x3e')]({},_0x29fb61,_0x1a4b64[_0x26b8('0x3f')]);return db['FaxTransferReport'][_0x26b8('0x47')](_0x29fb61)[_0x26b8('0x24')](handleEntityNotFound(_0x45e6a1,null))[_0x26b8('0x24')](respondWithResult(_0x45e6a1,null))['catch'](handleError(_0x45e6a1,null));};exports[_0x26b8('0x48')]=function(_0x32abdd,_0x25020a){return db[_0x26b8('0x2a')][_0x26b8('0x48')](_0x32abdd[_0x26b8('0x49')],{})[_0x26b8('0x24')](respondWithResult(_0x25020a,0xc9))['catch'](handleError(_0x25020a,null));};exports[_0x26b8('0x23')]=function(_0x152c00,_0x142d00){if(_0x152c00['body']['id']){delete _0x152c00[_0x26b8('0x49')]['id'];}return db[_0x26b8('0x2a')][_0x26b8('0x47')]({'where':{'id':_0x152c00[_0x26b8('0x4a')]['id']}})[_0x26b8('0x24')](handleEntityNotFound(_0x142d00,null))[_0x26b8('0x24')](saveUpdates(_0x152c00['body'],null))[_0x26b8('0x24')](respondWithResult(_0x142d00,null))[_0x26b8('0x44')](handleError(_0x142d00,null));};exports[_0x26b8('0x25')]=function(_0x4e1585,_0xb35195){return db['FaxTransferReport']['find']({'where':{'id':_0x4e1585[_0x26b8('0x4a')]['id']}})[_0x26b8('0x24')](handleEntityNotFound(_0xb35195,null))[_0x26b8('0x24')](removeEntity(_0xb35195,null))['catch'](handleError(_0xb35195,null));};exports[_0x26b8('0x4b')]=function(_0x1d3435,_0x158250){return db[_0x26b8('0x2a')][_0x26b8('0x4b')]()[_0x26b8('0x24')](respondWithResult(_0x158250,null))[_0x26b8('0x44')](handleError(_0x158250,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ddf3200..2759687 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 _0x600f=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x4a8f10,_0x5941bd){var _0x25cc12=function(_0x5b2d09){while(--_0x5b2d09){_0x4a8f10['push'](_0x4a8f10['shift']());}};_0x25cc12(++_0x5941bd);}(_0x600f,0x6c));var _0xf600=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x600f[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xf600('0x0'));var util=require(_0xf600('0x1'));var logger=require(_0xf600('0x2'))(_0xf600('0x3'));var moment=require(_0xf600('0x4'));var BPromise=require(_0xf600('0x5'));var rp=require(_0xf600('0x6'));var fs=require('fs');var path=require(_0xf600('0x7'));var rimraf=require(_0xf600('0x8'));var config=require(_0xf600('0x9'));var attributes=require(_0xf600('0xa'));module[_0xf600('0xb')]=function(_0x1ab1a5,_0x422f36){return _0x1ab1a5['define'](_0xf600('0xc'),attributes,{'tableName':_0xf600('0xd'),'paranoid':![],'indexes':[{'name':_0xf600('0xe'),'fields':[_0xf600('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57a1=['../../config/logger','api','request-promise','../../config/environment','./faxTransferReport.attributes','uniqueid','lodash'];(function(_0x27c9f6,_0x1fad6e){var _0x451273=function(_0x57d9aa){while(--_0x57d9aa){_0x27c9f6['push'](_0x27c9f6['shift']());}};_0x451273(++_0x1fad6e);}(_0x57a1,0x148));var _0x157a=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0x57a1[_0xfd5f37];return _0x11bd01;};'use strict';var _=require(_0x157a('0x0'));var util=require('util');var logger=require(_0x157a('0x1'))(_0x157a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x157a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x157a('0x4'));var attributes=require(_0x157a('0x5'));module['exports']=function(_0x59a914,_0x3e8960){return _0x59a914['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x157a('0x6'),'fields':[_0x157a('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index ad0da4b..acfb2f8 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 _0x82b4=['catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x82b4,0x1d5));var _0x482b=function(_0x28a670,_0x92437b){_0x28a670=_0x28a670-0x0;var _0x861fde=_0x82b4[_0x28a670];return _0x861fde;};'use strict';var _=require('lodash');var util=require(_0x482b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x482b('0x1'));var fs=require('fs');var Redis=require(_0x482b('0x2'));var db=require(_0x482b('0x3'))['db'];var utils=require(_0x482b('0x4'));var logger=require(_0x482b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x482b('0x6'));var client=jayson[_0x482b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef8e0,_0x20eae2,_0x1f2b7f){return new BPromise(function(_0x281b01,_0x18e27b){return client['request'](_0x4ef8e0,_0x1f2b7f)[_0x482b('0x8')](function(_0x457d97){logger[_0x482b('0x9')](_0x482b('0xa'),_0x20eae2,_0x482b('0xb'));logger['debug'](_0x482b('0xc'),_0x20eae2,_0x482b('0xb'),JSON[_0x482b('0xd')](_0x457d97));if(_0x457d97[_0x482b('0xe')]){if(_0x457d97[_0x482b('0xe')][_0x482b('0xf')]===0x1f4){logger[_0x482b('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x20eae2,_0x457d97['error'][_0x482b('0x10')]);return _0x18e27b(_0x457d97[_0x482b('0xe')][_0x482b('0x10')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x20eae2,_0x457d97[_0x482b('0xe')][_0x482b('0x10')]);return _0x281b01(_0x457d97['error']['message']);}else{logger[_0x482b('0x9')]('FaxTransferReport,\x20%s,\x20%s',_0x20eae2,_0x482b('0xb'));_0x281b01(_0x457d97['result']['message']);}})[_0x482b('0x11')](function(_0x3f27e1){logger[_0x482b('0xe')](_0x482b('0xa'),_0x20eae2,_0x3f27e1);_0x18e27b(_0x3f27e1);});});} \ No newline at end of file +var _0xf52f=['client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x559d28,_0xb3ed0b){var _0x57ddfe=function(_0x2ef2e2){while(--_0x2ef2e2){_0x559d28['push'](_0x559d28['shift']());}};_0x57ddfe(++_0xb3ed0b);}(_0xf52f,0x137));var _0xff52=function(_0x4e4253,_0x411609){_0x4e4253=_0x4e4253-0x0;var _0x52767f=_0xf52f[_0x4e4253];return _0x52767f;};'use strict';var _=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var moment=require(_0xff52('0x2'));var BPromise=require(_0xff52('0x3'));var rs=require(_0xff52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff52('0x5'))['db'];var utils=require(_0xff52('0x6'));var logger=require(_0xff52('0x7'))(_0xff52('0x8'));var config=require(_0xff52('0x9'));var jayson=require(_0xff52('0xa'));var client=jayson[_0xff52('0xb')][_0xff52('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d48fe,_0x251b20,_0x2137e9){return new BPromise(function(_0x4ea566,_0xb453bc){return client['request'](_0x2d48fe,_0x2137e9)[_0xff52('0xd')](function(_0x2ebadb){logger['info'](_0xff52('0xe'),_0x251b20,_0xff52('0xf'));logger[_0xff52('0x10')](_0xff52('0x11'),_0x251b20,_0xff52('0xf'),JSON[_0xff52('0x12')](_0x2ebadb));if(_0x2ebadb[_0xff52('0x13')]){if(_0x2ebadb[_0xff52('0x13')]['code']===0x1f4){logger[_0xff52('0x13')](_0xff52('0xe'),_0x251b20,_0x2ebadb[_0xff52('0x13')][_0xff52('0x14')]);return _0xb453bc(_0x2ebadb[_0xff52('0x13')][_0xff52('0x14')]);}logger[_0xff52('0x13')](_0xff52('0xe'),_0x251b20,_0x2ebadb[_0xff52('0x13')][_0xff52('0x14')]);return _0x4ea566(_0x2ebadb['error'][_0xff52('0x14')]);}else{logger[_0xff52('0x15')](_0xff52('0xe'),_0x251b20,'request\x20sent');_0x4ea566(_0x2ebadb['result']['message']);}})[_0xff52('0x16')](function(_0x22c020){logger[_0xff52('0x13')](_0xff52('0xe'),_0x251b20,_0x22c020);_0xb453bc(_0x22c020);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a75b4b6..9266580 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 _0x6185=['update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6185,0xbc));var _0x5618=function(_0x17f2e7,_0x15fb71){_0x17f2e7=_0x17f2e7-0x0;var _0x49f939=_0x6185[_0x17f2e7];return _0x49f939;};'use strict';var multer=require('multer');var util=require(_0x5618('0x0'));var path=require('path');var timeout=require(_0x5618('0x1'));var express=require(_0x5618('0x2'));var router=express[_0x5618('0x3')]();var fs_extra=require(_0x5618('0x4'));var auth=require(_0x5618('0x5'));var interaction=require(_0x5618('0x6'));var config=require(_0x5618('0x7'));var controller=require(_0x5618('0x8'));router[_0x5618('0x9')]('/',auth[_0x5618('0xa')](),controller[_0x5618('0xb')]);router[_0x5618('0x9')](_0x5618('0xc'),auth[_0x5618('0xa')](),controller[_0x5618('0xd')]);router[_0x5618('0x9')](_0x5618('0xe'),auth[_0x5618('0xa')](),controller[_0x5618('0xf')]);router[_0x5618('0x10')]('/',auth[_0x5618('0xa')](),controller[_0x5618('0x11')]);router[_0x5618('0x12')](_0x5618('0xe'),auth['isAuthenticated'](),controller[_0x5618('0x13')]);router[_0x5618('0x14')]('/:id',auth[_0x5618('0xa')](),controller[_0x5618('0x15')]);module[_0x5618('0x16')]=router; \ No newline at end of file +var _0xa0cd=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x405dc0,_0x5f2898){var _0x1ed46d=function(_0x5efad7){while(--_0x5efad7){_0x405dc0['push'](_0x405dc0['shift']());}};_0x1ed46d(++_0x5f2898);}(_0xa0cd,0x17d));var _0xda0c=function(_0x3e410c,_0x3675c0){_0x3e410c=_0x3e410c-0x0;var _0x48605a=_0xa0cd[_0x3e410c];return _0x48605a;};'use strict';var multer=require(_0xda0c('0x0'));var util=require('util');var path=require(_0xda0c('0x1'));var timeout=require('connect-timeout');var express=require(_0xda0c('0x2'));var router=express['Router']();var fs_extra=require(_0xda0c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xda0c('0x4'));var config=require(_0xda0c('0x5'));var controller=require(_0xda0c('0x6'));router[_0xda0c('0x7')]('/',auth[_0xda0c('0x8')](),controller[_0xda0c('0x9')]);router[_0xda0c('0x7')](_0xda0c('0xa'),auth[_0xda0c('0x8')](),controller[_0xda0c('0xb')]);router['get'](_0xda0c('0xc'),auth[_0xda0c('0x8')](),controller[_0xda0c('0xd')]);router[_0xda0c('0xe')]('/',auth[_0xda0c('0x8')](),controller[_0xda0c('0xf')]);router['put'](_0xda0c('0xc'),auth['isAuthenticated'](),controller[_0xda0c('0x10')]);router[_0xda0c('0x11')](_0xda0c('0xc'),auth[_0xda0c('0x8')](),controller[_0xda0c('0x12')]);module[_0xda0c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 02d0644..bfbecb9 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 _0x56f8=['post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x59cd25,_0x55b586){var _0x1efadf=function(_0x4b66dc){while(--_0x4b66dc){_0x59cd25['push'](_0x59cd25['shift']());}};_0x1efadf(++_0x55b586);}(_0x56f8,0x1a0));var _0x856f=function(_0x4d0156,_0x2ff6dc){_0x4d0156=_0x4d0156-0x0;var _0x4f88cd=_0x56f8[_0x4d0156];return _0x4f88cd;};'use strict';var multer=require(_0x856f('0x0'));var util=require(_0x856f('0x1'));var path=require(_0x856f('0x2'));var timeout=require(_0x856f('0x3'));var express=require(_0x856f('0x4'));var router=express['Router']();var fs_extra=require(_0x856f('0x5'));var auth=require(_0x856f('0x6'));var interaction=require(_0x856f('0x7'));var config=require(_0x856f('0x8'));var controller=require(_0x856f('0x9'));router[_0x856f('0xa')]('/',auth[_0x856f('0xb')](),controller[_0x856f('0xc')]);router[_0x856f('0xa')](_0x856f('0xd'),auth['isAuthenticated'](),controller[_0x856f('0xe')]);router[_0x856f('0xa')]('/:id/configurations',auth[_0x856f('0xb')](),controller['getConfigurations']);router[_0x856f('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x856f('0xf')]);router[_0x856f('0x10')]('/',auth['isAuthenticated'](),controller[_0x856f('0x11')]);router[_0x856f('0x10')](_0x856f('0x12'),auth[_0x856f('0xb')](),controller[_0x856f('0x13')]);router[_0x856f('0x14')]('/:id',auth[_0x856f('0xb')](),controller[_0x856f('0x15')]);router[_0x856f('0x16')](_0x856f('0xd'),auth[_0x856f('0xb')](),controller[_0x856f('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0912=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post','create','addConfiguration','put','update'];(function(_0x21c00a,_0x519770){var _0x4aca9b=function(_0x408e63){while(--_0x408e63){_0x21c00a['push'](_0x21c00a['shift']());}};_0x4aca9b(++_0x519770);}(_0x0912,0x127));var _0x2091=function(_0x28bb66,_0x27c318){_0x28bb66=_0x28bb66-0x0;var _0x5b2980=_0x0912[_0x28bb66];return _0x5b2980;};'use strict';var multer=require(_0x2091('0x0'));var util=require(_0x2091('0x1'));var path=require('path');var timeout=require(_0x2091('0x2'));var express=require(_0x2091('0x3'));var router=express[_0x2091('0x4')]();var fs_extra=require(_0x2091('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2091('0x6'));var config=require(_0x2091('0x7'));var controller=require(_0x2091('0x8'));router[_0x2091('0x9')]('/',auth[_0x2091('0xa')](),controller[_0x2091('0xb')]);router['get'](_0x2091('0xc'),auth[_0x2091('0xa')](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x2091('0xd')]);router['get']('/:id/fields',auth[_0x2091('0xa')](),controller[_0x2091('0xe')]);router[_0x2091('0xf')]('/',auth['isAuthenticated'](),controller[_0x2091('0x10')]);router[_0x2091('0xf')]('/:id/configurations',auth[_0x2091('0xa')](),controller[_0x2091('0x11')]);router[_0x2091('0x12')]('/:id',auth[_0x2091('0xa')](),controller[_0x2091('0x13')]);router['delete'](_0x2091('0xc'),auth[_0x2091('0xa')](),controller['destroy']);module[_0x2091('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 4802eac..defed15 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 _0x7cb8=['newTab','exports','STRING','basic','ENUM','integrationTab'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x7cb8,0x19f));var _0x87cb=function(_0x49c1cd,_0x1eb682){_0x49c1cd=_0x49c1cd-0x0;var _0x4708b6=_0x7cb8[_0x49c1cd];return _0x4708b6;};'use strict';var Sequelize=require('sequelize');module[_0x87cb('0x0')]={'name':{'type':Sequelize[_0x87cb('0x1')]},'description':{'type':Sequelize[_0x87cb('0x1')]},'username':{'type':Sequelize[_0x87cb('0x1')]},'remoteUri':{'type':Sequelize[_0x87cb('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x87cb('0x2')),'defaultValue':_0x87cb('0x2')},'password':{'type':Sequelize[_0x87cb('0x1')]},'consumerKey':{'type':Sequelize[_0x87cb('0x1')]},'consumerSecret':{'type':Sequelize[_0x87cb('0x1')]},'token':{'type':Sequelize[_0x87cb('0x1')]},'tokenSecret':{'type':Sequelize[_0x87cb('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x87cb('0x3')](_0x87cb('0x4'),_0x87cb('0x5')),'defaultValue':_0x87cb('0x4')}}; \ No newline at end of file +var _0x39cd=['exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x501f83,_0x214776){var _0x1ddbee=function(_0x446608){while(--_0x446608){_0x501f83['push'](_0x501f83['shift']());}};_0x1ddbee(++_0x214776);}(_0x39cd,0xfc));var _0xd39c=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x39cd[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require('sequelize');module[_0xd39c('0x0')]={'name':{'type':Sequelize[_0xd39c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd39c('0x1')]},'remoteUri':{'type':Sequelize[_0xd39c('0x1')]},'authType':{'type':Sequelize[_0xd39c('0x2')](_0xd39c('0x3')),'defaultValue':_0xd39c('0x3')},'password':{'type':Sequelize[_0xd39c('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xd39c('0x1')]},'serverUrl':{'type':Sequelize[_0xd39c('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd39c('0x4'),_0xd39c('0x5')),'defaultValue':_0xd39c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 81700b6..ad29500 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 _0x187f=['DeskAccount','rawAttributes','key','model','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','getConfigurations','DeskConfiguration','length','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','name','index','map'];(function(_0x19ad9a,_0x4def83){var _0x3c00d8=function(_0x37c176){while(--_0x37c176){_0x19ad9a['push'](_0x19ad9a['shift']());}};_0x3c00d8(++_0x4def83);}(_0x187f,0x134));var _0xf187=function(_0x20afca,_0x4bbec6){_0x20afca=_0x20afca-0x0;var _0x4cfbf0=_0x187f[_0x20afca];return _0x4cfbf0;};'use strict';var emlformat=require(_0xf187('0x0'));var rimraf=require(_0xf187('0x1'));var zipdir=require(_0xf187('0x2'));var jsonpatch=require(_0xf187('0x3'));var rp=require(_0xf187('0x4'));var moment=require(_0xf187('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf187('0x6'));var util=require('util');var path=require(_0xf187('0x7'));var sox=require(_0xf187('0x8'));var csv=require('to-csv');var ejs=require(_0xf187('0x9'));var fs=require('fs');var fs_extra=require(_0xf187('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf187('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf187('0xc'));var toCsv=require(_0xf187('0xd'));var querystring=require(_0xf187('0xe'));var Papa=require(_0xf187('0xf'));var Redis=require(_0xf187('0x10'));var authService=require(_0xf187('0x11'));var qs=require(_0xf187('0x12'));var as=require(_0xf187('0x13'));var hardwareService=require(_0xf187('0x14'));var logger=require(_0xf187('0x15'))(_0xf187('0x16'));var utils=require('../../config/utils');var config=require(_0xf187('0x17'));var licenseUtil=require(_0xf187('0x18'));var db=require(_0xf187('0x19'))['db'];var integrations=require(_0xf187('0x1a'));function respondWithStatusCode(_0x26c008,_0x1af2dd){_0x1af2dd=_0x1af2dd||0xcc;return function(_0x137de2){if(_0x137de2){return _0x26c008[_0xf187('0x1b')](_0x1af2dd);}return _0x26c008[_0xf187('0x1c')](_0x1af2dd)[_0xf187('0x1d')]();};}function respondWithResult(_0x40e143,_0x4d95a9){_0x4d95a9=_0x4d95a9||0xc8;return function(_0x598f3f){if(_0x598f3f){return _0x40e143[_0xf187('0x1c')](_0x4d95a9)['json'](_0x598f3f);}};}function respondWithFilteredResult(_0x204201,_0x5b262e){return function(_0x33352c){if(_0x33352c){var _0xc82fca=typeof _0x5b262e[_0xf187('0x1e')]===_0xf187('0x1f')&&typeof _0x5b262e['limit']===_0xf187('0x1f');var _0x2be928=_0x33352c[_0xf187('0x20')];var _0x4eac35=_0xc82fca?0x0:_0x5b262e[_0xf187('0x1e')];var _0x5e64b0=_0xc82fca?_0x33352c[_0xf187('0x20')]:_0x5b262e['offset']+_0x5b262e[_0xf187('0x21')];var _0x4d3fba;if(_0x5e64b0>=_0x2be928){_0x5e64b0=_0x2be928;_0x4d3fba=0xc8;}else{_0x4d3fba=0xce;}_0x204201['status'](_0x4d3fba);return _0x204201[_0xf187('0x22')](_0xf187('0x23'),_0x4eac35+'-'+_0x5e64b0+'/'+_0x2be928)[_0xf187('0x24')](_0x33352c);}return null;};}function patchUpdates(_0x1bfb6a){return function(_0x4abd57){try{jsonpatch[_0xf187('0x25')](_0x4abd57,_0x1bfb6a,!![]);}catch(_0x52814a){return BPromise['reject'](_0x52814a);}return _0x4abd57['save']();};}function saveUpdates(_0x52868e,_0x4a6799){return function(_0x3af8b8){if(_0x3af8b8){return _0x3af8b8[_0xf187('0x26')](_0x52868e)[_0xf187('0x27')](function(_0x5dc143){return _0x5dc143;});}return null;};}function removeEntity(_0x302c26,_0x5e7261){return function(_0x174101){if(_0x174101){return _0x174101[_0xf187('0x28')]()[_0xf187('0x27')](function(){_0x302c26[_0xf187('0x1c')](0xcc)[_0xf187('0x1d')]();});}};}function handleEntityNotFound(_0x399172,_0x206abe){return function(_0x48b57a){if(!_0x48b57a){_0x399172['sendStatus'](0x194);}return _0x48b57a;};}function handleError(_0x26f954,_0x52e404){_0x52e404=_0x52e404||0x1f4;return function(_0x54b226){logger[_0xf187('0x29')](_0x54b226[_0xf187('0x2a')]);if(_0x54b226[_0xf187('0x2b')]){delete _0x54b226[_0xf187('0x2b')];}_0x26f954[_0xf187('0x1c')](_0x52e404)['send'](_0x54b226);};}exports[_0xf187('0x2c')]=function(_0x6f8079,_0x40fc44){var _0x11317d={},_0x1a7b96={},_0x135950={'count':0x0,'rows':[]};var _0x464968=_[_0xf187('0x2d')](db[_0xf187('0x2e')][_0xf187('0x2f')],function(_0x22a0fa){return{'name':_0x22a0fa['fieldName'],'type':_0x22a0fa['type'][_0xf187('0x30')]};});_0x1a7b96[_0xf187('0x31')]=_[_0xf187('0x2d')](_0x464968,'name');_0x1a7b96['query']=_[_0xf187('0x32')](_0x6f8079['query']);_0x1a7b96[_0xf187('0x33')]=_[_0xf187('0x34')](_0x1a7b96[_0xf187('0x31')],_0x1a7b96[_0xf187('0x35')]);_0x11317d['attributes']=_[_0xf187('0x34')](_0x1a7b96['model'],qs[_0xf187('0x36')](_0x6f8079[_0xf187('0x35')][_0xf187('0x36')]));_0x11317d[_0xf187('0x37')]=_0x11317d['attributes']['length']?_0x11317d[_0xf187('0x37')]:_0x1a7b96[_0xf187('0x31')];if(!_0x6f8079[_0xf187('0x35')]['hasOwnProperty'](_0xf187('0x38'))){_0x11317d[_0xf187('0x21')]=qs[_0xf187('0x21')](_0x6f8079['query'][_0xf187('0x21')]);_0x11317d[_0xf187('0x1e')]=qs['offset'](_0x6f8079[_0xf187('0x35')][_0xf187('0x1e')]);}_0x11317d[_0xf187('0x39')]=qs['sort'](_0x6f8079[_0xf187('0x35')][_0xf187('0x3a')]);_0x11317d[_0xf187('0x3b')]=qs[_0xf187('0x33')](_[_0xf187('0x3c')](_0x6f8079[_0xf187('0x35')],_0x1a7b96[_0xf187('0x33')]),_0x464968);if(_0x6f8079[_0xf187('0x35')][_0xf187('0x3d')]){_0x11317d[_0xf187('0x3b')]=_[_0xf187('0x3e')](_0x11317d[_0xf187('0x3b')],{'$or':_[_0xf187('0x2d')](_0x464968,function(_0x393cc7){if(_0x393cc7[_0xf187('0x3f')]!==_0xf187('0x40')){var _0x1fe52c={};_0x1fe52c[_0x393cc7['name']]={'$like':'%'+_0x6f8079['query']['filter']+'%'};return _0x1fe52c;}})});}_0x11317d=_[_0xf187('0x3e')]({},_0x11317d,_0x6f8079[_0xf187('0x41')]);var _0x221f12={'where':_0x11317d[_0xf187('0x3b')]};return db[_0xf187('0x2e')]['count'](_0x221f12)[_0xf187('0x27')](function(_0x11458a){_0x135950['count']=_0x11458a;if(_0x6f8079[_0xf187('0x35')]['includeAll']){_0x11317d['include']=[{'all':!![]}];}return db['DeskAccount'][_0xf187('0x42')](_0x11317d);})['then'](function(_0x1f63e1){_0x135950[_0xf187('0x43')]=_0x1f63e1;return _0x135950;})[_0xf187('0x27')](respondWithFilteredResult(_0x40fc44,_0x11317d))[_0xf187('0x44')](handleError(_0x40fc44,null));};exports[_0xf187('0x45')]=function(_0x478c84,_0x3af1ff){var _0x2f3857={'raw':![],'where':{'id':_0x478c84[_0xf187('0x46')]['id']}},_0x551e7d={};_0x551e7d[_0xf187('0x31')]=_['keys'](db[_0xf187('0x2e')][_0xf187('0x2f')]);_0x551e7d[_0xf187('0x35')]=_[_0xf187('0x32')](_0x478c84[_0xf187('0x35')]);_0x551e7d[_0xf187('0x33')]=_[_0xf187('0x34')](_0x551e7d['model'],_0x551e7d['query']);_0x2f3857[_0xf187('0x37')]=_[_0xf187('0x34')](_0x551e7d[_0xf187('0x31')],qs[_0xf187('0x36')](_0x478c84['query']['fields']));_0x2f3857[_0xf187('0x37')]=_0x2f3857['attributes']['length']?_0x2f3857[_0xf187('0x37')]:_0x551e7d[_0xf187('0x31')];if(_0x478c84[_0xf187('0x35')][_0xf187('0x47')]){_0x2f3857[_0xf187('0x48')]=[{'all':!![]}];}_0x2f3857=_[_0xf187('0x3e')]({},_0x2f3857,_0x478c84[_0xf187('0x41')]);return db[_0xf187('0x2e')][_0xf187('0x49')](_0x2f3857)[_0xf187('0x27')](handleEntityNotFound(_0x3af1ff,null))['then'](respondWithResult(_0x3af1ff,null))['catch'](handleError(_0x3af1ff,null));};exports[_0xf187('0x4a')]=function(_0x71c4f9,_0x3c9ab3){return db['DeskAccount'][_0xf187('0x4a')](_0x71c4f9[_0xf187('0x4b')],{})[_0xf187('0x27')](respondWithResult(_0x3c9ab3,0xc9))[_0xf187('0x44')](handleError(_0x3c9ab3,null));};exports[_0xf187('0x26')]=function(_0x4bfd7f,_0x1f7026){if(_0x4bfd7f[_0xf187('0x4b')]['id']){delete _0x4bfd7f[_0xf187('0x4b')]['id'];}return db['DeskAccount'][_0xf187('0x49')]({'where':{'id':_0x4bfd7f[_0xf187('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f7026,null))[_0xf187('0x27')](saveUpdates(_0x4bfd7f[_0xf187('0x4b')],null))[_0xf187('0x27')](respondWithResult(_0x1f7026,null))[_0xf187('0x44')](handleError(_0x1f7026,null));};exports[_0xf187('0x28')]=function(_0x252276,_0x4ff88e){return db[_0xf187('0x2e')][_0xf187('0x49')]({'where':{'id':_0x252276[_0xf187('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ff88e,null))[_0xf187('0x27')](removeEntity(_0x4ff88e,null))['catch'](handleError(_0x4ff88e,null));};exports[_0xf187('0x4c')]=function(_0x287813,_0x53e0d8,_0x1aa5a5){var _0x1d9671={};var _0x36edca={};var _0xfb4152;var _0x48a595;return db[_0xf187('0x2e')]['findOne']({'where':{'id':_0x287813['params']['id']}})['then'](handleEntityNotFound(_0x53e0d8,null))[_0xf187('0x27')](function(_0x306ff7){if(_0x306ff7){_0xfb4152=_0x306ff7;_0x36edca[_0xf187('0x31')]=_[_0xf187('0x32')](db[_0xf187('0x4d')][_0xf187('0x2f')]);_0x36edca[_0xf187('0x35')]=_['keys'](_0x287813[_0xf187('0x35')]);_0x36edca[_0xf187('0x33')]=_['intersection'](_0x36edca['model'],_0x36edca[_0xf187('0x35')]);_0x1d9671[_0xf187('0x37')]=_[_0xf187('0x34')](_0x36edca[_0xf187('0x31')],qs['fields'](_0x287813[_0xf187('0x35')][_0xf187('0x36')]));_0x1d9671[_0xf187('0x37')]=_0x1d9671['attributes']['length']?_0x1d9671['attributes']:_0x36edca[_0xf187('0x31')];_0x1d9671[_0xf187('0x39')]=qs['sort'](_0x287813[_0xf187('0x35')]['sort']);_0x1d9671[_0xf187('0x3b')]=qs[_0xf187('0x33')](_['pick'](_0x287813[_0xf187('0x35')],_0x36edca[_0xf187('0x33')]));if(_0x287813[_0xf187('0x35')]['filter']){_0x1d9671[_0xf187('0x3b')]=_[_0xf187('0x3e')](_0x1d9671[_0xf187('0x3b')],{'$or':_[_0xf187('0x2d')](_0x1d9671[_0xf187('0x37')],function(_0x3f1f2f){var _0x1ba0e8={};_0x1ba0e8[_0x3f1f2f]={'$like':'%'+_0x287813['query']['filter']+'%'};return _0x1ba0e8;})});}_0x1d9671=_[_0xf187('0x3e')]({},_0x1d9671,_0x287813[_0xf187('0x41')]);return _0xfb4152[_0xf187('0x4c')](_0x1d9671);}})[_0xf187('0x27')](function(_0x5722ac){if(_0x5722ac){_0x48a595=_0x5722ac[_0xf187('0x4e')];if(!_0x287813[_0xf187('0x35')][_0xf187('0x4f')]('nolimit')){_0x1d9671[_0xf187('0x21')]=qs['limit'](_0x287813[_0xf187('0x35')][_0xf187('0x21')]);_0x1d9671[_0xf187('0x1e')]=qs[_0xf187('0x1e')](_0x287813['query']['offset']);}return _0xfb4152[_0xf187('0x4c')](_0x1d9671);}})['then'](function(_0x212380){if(_0x212380){return _0x212380?{'count':_0x48a595,'rows':_0x212380}:null;}})['then'](respondWithResult(_0x53e0d8,null))['catch'](handleError(_0x53e0d8,null));};exports[_0xf187('0x50')]=function(_0x25aded,_0x494bc4,_0x2feeed){if(_0x25aded[_0xf187('0x4b')]['id']){delete _0x25aded[_0xf187('0x4b')]['id'];}return db['DeskAccount'][_0xf187('0x51')]({'where':{'id':_0x25aded[_0xf187('0x46')]['id']}})[_0xf187('0x27')](handleEntityNotFound(_0x494bc4,null))[_0xf187('0x27')](function(_0x2d3171){if(_0x2d3171){_0x25aded['body']['AccountId']=_0x2d3171['id'];_0x25aded[_0xf187('0x4b')][_0xf187('0x52')]=integrations[_0xf187('0x53')](_0x25aded[_0xf187('0x4b')]['channel'],_0x25aded[_0xf187('0x4b')][_0xf187('0x3f')]);_0x25aded[_0xf187('0x4b')][_0xf187('0x54')]=integrations[_0xf187('0x55')](_0x25aded['body']['channel'],_0x25aded['body']['type']);return db[_0xf187('0x4d')]['create'](_0x25aded[_0xf187('0x4b')],{'include':[{'model':db[_0xf187('0x56')],'as':_0xf187('0x52')},{'model':db[_0xf187('0x56')],'as':_0xf187('0x54')}]});}return null;})[_0xf187('0x27')](respondWithResult(_0x494bc4,null))['catch'](handleError(_0x494bc4,null));};exports[_0xf187('0x57')]=function(_0x1b2704,_0x1e71da,_0x528aee){var _0x542b31=[{'name':_0xf187('0x58'),'label':_0xf187('0x58'),'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 _0x347d31='';return db[_0xf187('0x2e')]['findOne']({'where':{'id':_0x1b2704[_0xf187('0x46')]['id']},'attributes':['id',_0xf187('0x59'),_0xf187('0x5a'),_0xf187('0x5b'),_0xf187('0x5c'),_0xf187('0x5d'),_0xf187('0x5e'),_0xf187('0x5f'),_0xf187('0x60')]})[_0xf187('0x27')](handleEntityNotFound(_0x1e71da,null))[_0xf187('0x27')](function(_0x34d07e){if(_0x34d07e){_0x347d31=_0x34d07e['remoteUri'];var _0x28ff09=_0x347d31[_0xf187('0x61')](-0x1);if(_0x28ff09==='/'){_0x347d31=_0x347d31[_0xf187('0x62')](0x0,_0x347d31['lastIndexOf'](_0x28ff09));}var _0x13a56f={'method':'GET','uri':util[_0xf187('0x63')](_0xf187('0x64'),_0x347d31),'headers':{'Content-Type':_0xf187('0x65'),'Accept':_0xf187('0x65')},'json':!![]};if(_0x34d07e['authType']===_0xf187('0x66')){_0x13a56f[_0xf187('0x67')][_0xf187('0x68')]=util[_0xf187('0x63')](_0xf187('0x69'),new Buffer(util[_0xf187('0x63')](_0xf187('0x6a'),_0x34d07e[_0xf187('0x5b')],_0x34d07e[_0xf187('0x5c')]))[_0xf187('0x6b')]('base64'));}return rp(_0x13a56f)[_0xf187('0x27')](function(_0x365de5){return _0x542b31[_0xf187('0x6c')](_['map'](_0x365de5[_0xf187('0x6d')][_0xf187('0x6e')],function(_0x2105b4){return{'id':_0x2105b4['name'],'name':_0x2105b4[_0xf187('0x2b')],'type':_0x2105b4[_0xf187('0x3f')],'active':_0x2105b4['active'],'label':_0x2105b4[_0xf187('0x6f')],'custom':!![]};}));});}})[_0xf187('0x27')](function(_0x552c08){return{'count':_0x552c08[_0xf187('0x4e')],'rows':_0x552c08};})[_0xf187('0x27')](respondWithResult(_0x1e71da,null))[_0xf187('0x44')](function(_0x14a4de){var _0x3ae013=_0x1b2704[_0xf187('0x35')][_0xf187('0x70')]?0x1f4:_0x14a4de[_0xf187('0x71')]||0x1f4;logger[_0xf187('0x29')](_0xf187('0x72'),_0xf187('0x57'),_0x3ae013,JSON[_0xf187('0x73')](_0x14a4de));delete _0x14a4de[_0xf187('0x2b')];if(_0x3ae013===0x191){_0x3ae013=0x190;}_0x1e71da[_0xf187('0x1c')](_0x3ae013)[_0xf187('0x74')](_0x1b2704[_0xf187('0x35')]['test']?{'message':_0xf187('0x75'),'statusCode':_0x14a4de['statusCode']}:_0x14a4de);});}; \ No newline at end of file +var _0x5e05=['sort','where','filter','merge','options','includeAll','rows','catch','include','find','create','body','params','getConfigurations','findOne','DeskConfiguration','order','hasOwnProperty','addConfiguration','channel','Descriptions','getDescriptions','type','DeskField','Subjects','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','application/json','basic','headers','Authorization','format','%s:%s','base64','_embedded','entries','active','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5e05,0x10f));var _0x55e0=function(_0x2475d8,_0x6f269d){_0x2475d8=_0x2475d8-0x0;var _0x3aac6a=_0x5e05[_0x2475d8];return _0x3aac6a;};'use strict';var emlformat=require(_0x55e0('0x0'));var rimraf=require(_0x55e0('0x1'));var zipdir=require(_0x55e0('0x2'));var jsonpatch=require(_0x55e0('0x3'));var rp=require('request-promise');var moment=require(_0x55e0('0x4'));var BPromise=require(_0x55e0('0x5'));var Mustache=require('mustache');var util=require(_0x55e0('0x6'));var path=require(_0x55e0('0x7'));var sox=require(_0x55e0('0x8'));var csv=require(_0x55e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55e0('0xa'));var _=require(_0x55e0('0xb'));var squel=require(_0x55e0('0xc'));var crypto=require(_0x55e0('0xd'));var jsforce=require(_0x55e0('0xe'));var deskjs=require(_0x55e0('0xf'));var toCsv=require(_0x55e0('0x9'));var querystring=require(_0x55e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x55e0('0x11'));var authService=require(_0x55e0('0x12'));var qs=require(_0x55e0('0x13'));var as=require(_0x55e0('0x14'));var hardwareService=require(_0x55e0('0x15'));var logger=require('../../config/logger')(_0x55e0('0x16'));var utils=require(_0x55e0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x55e0('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x55e0('0x19'));function respondWithStatusCode(_0x25d597,_0x32773b){_0x32773b=_0x32773b||0xcc;return function(_0x2f7ff4){if(_0x2f7ff4){return _0x25d597[_0x55e0('0x1a')](_0x32773b);}return _0x25d597[_0x55e0('0x1b')](_0x32773b)[_0x55e0('0x1c')]();};}function respondWithResult(_0x2c8199,_0x3d4c03){_0x3d4c03=_0x3d4c03||0xc8;return function(_0xf84151){if(_0xf84151){return _0x2c8199[_0x55e0('0x1b')](_0x3d4c03)[_0x55e0('0x1d')](_0xf84151);}};}function respondWithFilteredResult(_0x12f039,_0x40deee){return function(_0x29a333){if(_0x29a333){var _0x2d5aba=typeof _0x40deee[_0x55e0('0x1e')]===_0x55e0('0x1f')&&typeof _0x40deee[_0x55e0('0x20')]==='undefined';var _0x10e815=_0x29a333[_0x55e0('0x21')];var _0x232b27=_0x2d5aba?0x0:_0x40deee[_0x55e0('0x1e')];var _0x1d9983=_0x2d5aba?_0x29a333[_0x55e0('0x21')]:_0x40deee[_0x55e0('0x1e')]+_0x40deee[_0x55e0('0x20')];var _0x5b7cf5;if(_0x1d9983>=_0x10e815){_0x1d9983=_0x10e815;_0x5b7cf5=0xc8;}else{_0x5b7cf5=0xce;}_0x12f039[_0x55e0('0x1b')](_0x5b7cf5);return _0x12f039[_0x55e0('0x22')](_0x55e0('0x23'),_0x232b27+'-'+_0x1d9983+'/'+_0x10e815)[_0x55e0('0x1d')](_0x29a333);}return null;};}function patchUpdates(_0x34b197){return function(_0x6699db){try{jsonpatch[_0x55e0('0x24')](_0x6699db,_0x34b197,!![]);}catch(_0x912f80){return BPromise[_0x55e0('0x25')](_0x912f80);}return _0x6699db[_0x55e0('0x26')]();};}function saveUpdates(_0x31a24e,_0x3df1eb){return function(_0x4cea54){if(_0x4cea54){return _0x4cea54[_0x55e0('0x27')](_0x31a24e)[_0x55e0('0x28')](function(_0x12adba){return _0x12adba;});}return null;};}function removeEntity(_0x392847,_0x4373d1){return function(_0xfe3864){if(_0xfe3864){return _0xfe3864[_0x55e0('0x29')]()[_0x55e0('0x28')](function(){_0x392847['status'](0xcc)[_0x55e0('0x1c')]();});}};}function handleEntityNotFound(_0x5a3467,_0x4f5156){return function(_0x5c5f52){if(!_0x5c5f52){_0x5a3467[_0x55e0('0x1a')](0x194);}return _0x5c5f52;};}function handleError(_0xbd39af,_0x201aa5){_0x201aa5=_0x201aa5||0x1f4;return function(_0x1b1276){logger['error'](_0x1b1276[_0x55e0('0x2a')]);if(_0x1b1276['name']){delete _0x1b1276[_0x55e0('0x2b')];}_0xbd39af[_0x55e0('0x1b')](_0x201aa5)['send'](_0x1b1276);};}exports[_0x55e0('0x2c')]=function(_0xf3b23,_0x38df98){var _0x3fb455={},_0xb36587={},_0x3987eb={'count':0x0,'rows':[]};var _0x3583e4=_[_0x55e0('0x2d')](db[_0x55e0('0x2e')][_0x55e0('0x2f')],function(_0x49d1d9){return{'name':_0x49d1d9[_0x55e0('0x30')],'type':_0x49d1d9['type'][_0x55e0('0x31')]};});_0xb36587[_0x55e0('0x32')]=_['map'](_0x3583e4,_0x55e0('0x2b'));_0xb36587[_0x55e0('0x33')]=_[_0x55e0('0x34')](_0xf3b23[_0x55e0('0x33')]);_0xb36587[_0x55e0('0x35')]=_[_0x55e0('0x36')](_0xb36587[_0x55e0('0x32')],_0xb36587['query']);_0x3fb455[_0x55e0('0x37')]=_[_0x55e0('0x36')](_0xb36587[_0x55e0('0x32')],qs[_0x55e0('0x38')](_0xf3b23[_0x55e0('0x33')][_0x55e0('0x38')]));_0x3fb455[_0x55e0('0x37')]=_0x3fb455['attributes'][_0x55e0('0x39')]?_0x3fb455['attributes']:_0xb36587[_0x55e0('0x32')];if(!_0xf3b23[_0x55e0('0x33')]['hasOwnProperty'](_0x55e0('0x3a'))){_0x3fb455[_0x55e0('0x20')]=qs[_0x55e0('0x20')](_0xf3b23['query'][_0x55e0('0x20')]);_0x3fb455[_0x55e0('0x1e')]=qs[_0x55e0('0x1e')](_0xf3b23[_0x55e0('0x33')][_0x55e0('0x1e')]);}_0x3fb455['order']=qs['sort'](_0xf3b23[_0x55e0('0x33')][_0x55e0('0x3b')]);_0x3fb455[_0x55e0('0x3c')]=qs[_0x55e0('0x35')](_['pick'](_0xf3b23[_0x55e0('0x33')],_0xb36587[_0x55e0('0x35')]),_0x3583e4);if(_0xf3b23['query'][_0x55e0('0x3d')]){_0x3fb455['where']=_[_0x55e0('0x3e')](_0x3fb455['where'],{'$or':_[_0x55e0('0x2d')](_0x3583e4,function(_0x5f27fb){if(_0x5f27fb['type']!=='VIRTUAL'){var _0x2a69d8={};_0x2a69d8[_0x5f27fb[_0x55e0('0x2b')]]={'$like':'%'+_0xf3b23['query'][_0x55e0('0x3d')]+'%'};return _0x2a69d8;}})});}_0x3fb455=_[_0x55e0('0x3e')]({},_0x3fb455,_0xf3b23[_0x55e0('0x3f')]);var _0x409fb5={'where':_0x3fb455['where']};return db[_0x55e0('0x2e')][_0x55e0('0x21')](_0x409fb5)['then'](function(_0x3d5942){_0x3987eb[_0x55e0('0x21')]=_0x3d5942;if(_0xf3b23[_0x55e0('0x33')][_0x55e0('0x40')]){_0x3fb455['include']=[{'all':!![]}];}return db[_0x55e0('0x2e')]['findAll'](_0x3fb455);})['then'](function(_0xc35852){_0x3987eb[_0x55e0('0x41')]=_0xc35852;return _0x3987eb;})[_0x55e0('0x28')](respondWithFilteredResult(_0x38df98,_0x3fb455))[_0x55e0('0x42')](handleError(_0x38df98,null));};exports['show']=function(_0x375fe4,_0x46311e){var _0x1bd146={'raw':![],'where':{'id':_0x375fe4['params']['id']}},_0xd8bbca={};_0xd8bbca[_0x55e0('0x32')]=_[_0x55e0('0x34')](db[_0x55e0('0x2e')][_0x55e0('0x2f')]);_0xd8bbca[_0x55e0('0x33')]=_[_0x55e0('0x34')](_0x375fe4[_0x55e0('0x33')]);_0xd8bbca['filters']=_['intersection'](_0xd8bbca[_0x55e0('0x32')],_0xd8bbca[_0x55e0('0x33')]);_0x1bd146[_0x55e0('0x37')]=_[_0x55e0('0x36')](_0xd8bbca[_0x55e0('0x32')],qs[_0x55e0('0x38')](_0x375fe4[_0x55e0('0x33')][_0x55e0('0x38')]));_0x1bd146[_0x55e0('0x37')]=_0x1bd146[_0x55e0('0x37')]['length']?_0x1bd146[_0x55e0('0x37')]:_0xd8bbca[_0x55e0('0x32')];if(_0x375fe4[_0x55e0('0x33')]['includeAll']){_0x1bd146[_0x55e0('0x43')]=[{'all':!![]}];}_0x1bd146=_['merge']({},_0x1bd146,_0x375fe4[_0x55e0('0x3f')]);return db[_0x55e0('0x2e')][_0x55e0('0x44')](_0x1bd146)[_0x55e0('0x28')](handleEntityNotFound(_0x46311e,null))[_0x55e0('0x28')](respondWithResult(_0x46311e,null))[_0x55e0('0x42')](handleError(_0x46311e,null));};exports[_0x55e0('0x45')]=function(_0x1b3e09,_0x4146ec){return db[_0x55e0('0x2e')]['create'](_0x1b3e09['body'],{})[_0x55e0('0x28')](respondWithResult(_0x4146ec,0xc9))[_0x55e0('0x42')](handleError(_0x4146ec,null));};exports[_0x55e0('0x27')]=function(_0x3d6ffb,_0x29167d){if(_0x3d6ffb[_0x55e0('0x46')]['id']){delete _0x3d6ffb[_0x55e0('0x46')]['id'];}return db['DeskAccount'][_0x55e0('0x44')]({'where':{'id':_0x3d6ffb[_0x55e0('0x47')]['id']}})[_0x55e0('0x28')](handleEntityNotFound(_0x29167d,null))['then'](saveUpdates(_0x3d6ffb[_0x55e0('0x46')],null))[_0x55e0('0x28')](respondWithResult(_0x29167d,null))['catch'](handleError(_0x29167d,null));};exports[_0x55e0('0x29')]=function(_0x13ec01,_0x5b489a){return db[_0x55e0('0x2e')]['find']({'where':{'id':_0x13ec01[_0x55e0('0x47')]['id']}})[_0x55e0('0x28')](handleEntityNotFound(_0x5b489a,null))[_0x55e0('0x28')](removeEntity(_0x5b489a,null))[_0x55e0('0x42')](handleError(_0x5b489a,null));};exports[_0x55e0('0x48')]=function(_0x1ee897,_0x262a82,_0x10ef51){var _0x373dbd={};var _0x3810e2={};var _0x4a09b3;var _0x5ae189;return db['DeskAccount'][_0x55e0('0x49')]({'where':{'id':_0x1ee897['params']['id']}})[_0x55e0('0x28')](handleEntityNotFound(_0x262a82,null))[_0x55e0('0x28')](function(_0x2fe440){if(_0x2fe440){_0x4a09b3=_0x2fe440;_0x3810e2[_0x55e0('0x32')]=_[_0x55e0('0x34')](db[_0x55e0('0x4a')]['rawAttributes']);_0x3810e2[_0x55e0('0x33')]=_[_0x55e0('0x34')](_0x1ee897[_0x55e0('0x33')]);_0x3810e2['filters']=_['intersection'](_0x3810e2[_0x55e0('0x32')],_0x3810e2[_0x55e0('0x33')]);_0x373dbd[_0x55e0('0x37')]=_[_0x55e0('0x36')](_0x3810e2['model'],qs[_0x55e0('0x38')](_0x1ee897[_0x55e0('0x33')][_0x55e0('0x38')]));_0x373dbd[_0x55e0('0x37')]=_0x373dbd[_0x55e0('0x37')]['length']?_0x373dbd[_0x55e0('0x37')]:_0x3810e2[_0x55e0('0x32')];_0x373dbd[_0x55e0('0x4b')]=qs[_0x55e0('0x3b')](_0x1ee897['query'][_0x55e0('0x3b')]);_0x373dbd[_0x55e0('0x3c')]=qs[_0x55e0('0x35')](_['pick'](_0x1ee897[_0x55e0('0x33')],_0x3810e2[_0x55e0('0x35')]));if(_0x1ee897['query']['filter']){_0x373dbd['where']=_[_0x55e0('0x3e')](_0x373dbd[_0x55e0('0x3c')],{'$or':_[_0x55e0('0x2d')](_0x373dbd[_0x55e0('0x37')],function(_0x150d76){var _0x73648c={};_0x73648c[_0x150d76]={'$like':'%'+_0x1ee897[_0x55e0('0x33')][_0x55e0('0x3d')]+'%'};return _0x73648c;})});}_0x373dbd=_['merge']({},_0x373dbd,_0x1ee897[_0x55e0('0x3f')]);return _0x4a09b3[_0x55e0('0x48')](_0x373dbd);}})['then'](function(_0x3b8733){if(_0x3b8733){_0x5ae189=_0x3b8733[_0x55e0('0x39')];if(!_0x1ee897[_0x55e0('0x33')][_0x55e0('0x4c')](_0x55e0('0x3a'))){_0x373dbd[_0x55e0('0x20')]=qs['limit'](_0x1ee897[_0x55e0('0x33')][_0x55e0('0x20')]);_0x373dbd[_0x55e0('0x1e')]=qs[_0x55e0('0x1e')](_0x1ee897['query']['offset']);}return _0x4a09b3['getConfigurations'](_0x373dbd);}})[_0x55e0('0x28')](function(_0x12c1b5){if(_0x12c1b5){return _0x12c1b5?{'count':_0x5ae189,'rows':_0x12c1b5}:null;}})[_0x55e0('0x28')](respondWithResult(_0x262a82,null))['catch'](handleError(_0x262a82,null));};exports[_0x55e0('0x4d')]=function(_0x36a33b,_0x3d8e57,_0x17d0ba){if(_0x36a33b['body']['id']){delete _0x36a33b[_0x55e0('0x46')]['id'];}return db['DeskAccount'][_0x55e0('0x49')]({'where':{'id':_0x36a33b[_0x55e0('0x47')]['id']}})[_0x55e0('0x28')](handleEntityNotFound(_0x3d8e57,null))['then'](function(_0xbd678){if(_0xbd678){_0x36a33b[_0x55e0('0x46')]['AccountId']=_0xbd678['id'];_0x36a33b[_0x55e0('0x46')]['Subjects']=integrations['getSubjects'](_0x36a33b[_0x55e0('0x46')][_0x55e0('0x4e')],_0x36a33b[_0x55e0('0x46')]['type']);_0x36a33b[_0x55e0('0x46')][_0x55e0('0x4f')]=integrations[_0x55e0('0x50')](_0x36a33b[_0x55e0('0x46')][_0x55e0('0x4e')],_0x36a33b[_0x55e0('0x46')][_0x55e0('0x51')]);return db[_0x55e0('0x4a')][_0x55e0('0x45')](_0x36a33b['body'],{'include':[{'model':db[_0x55e0('0x52')],'as':_0x55e0('0x53')},{'model':db[_0x55e0('0x52')],'as':_0x55e0('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d8e57,null))[_0x55e0('0x42')](handleError(_0x3d8e57,null));};exports['getFields']=function(_0x585b01,_0x71ee63,_0x2760f6){var _0x918eb3=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x58ee2d='';return db[_0x55e0('0x2e')][_0x55e0('0x49')]({'where':{'id':_0x585b01[_0x55e0('0x47')]['id']},'attributes':['id',_0x55e0('0x54'),_0x55e0('0x55'),_0x55e0('0x56'),_0x55e0('0x57'),_0x55e0('0x58'),_0x55e0('0x59'),_0x55e0('0x5a'),'tokenSecret']})['then'](handleEntityNotFound(_0x71ee63,null))[_0x55e0('0x28')](function(_0x19691c){if(_0x19691c){_0x58ee2d=_0x19691c['remoteUri'];var _0x37df16=_0x58ee2d[_0x55e0('0x5b')](-0x1);if(_0x37df16==='/'){_0x58ee2d=_0x58ee2d[_0x55e0('0x5c')](0x0,_0x58ee2d[_0x55e0('0x5d')](_0x37df16));}var _0x3b9079={'method':_0x55e0('0x5e'),'uri':util['format']('%s/custom_fields',_0x58ee2d),'headers':{'Content-Type':_0x55e0('0x5f'),'Accept':_0x55e0('0x5f')},'json':!![]};if(_0x19691c['authType']===_0x55e0('0x60')){_0x3b9079[_0x55e0('0x61')][_0x55e0('0x62')]=util['format']('Basic\x20%s',new Buffer(util[_0x55e0('0x63')](_0x55e0('0x64'),_0x19691c['username'],_0x19691c[_0x55e0('0x57')]))['toString'](_0x55e0('0x65')));}return rp(_0x3b9079)[_0x55e0('0x28')](function(_0x4eeecf){return _0x918eb3['concat'](_[_0x55e0('0x2d')](_0x4eeecf[_0x55e0('0x66')][_0x55e0('0x67')],function(_0x4a9275){return{'id':_0x4a9275[_0x55e0('0x2b')],'name':_0x4a9275[_0x55e0('0x2b')],'type':_0x4a9275[_0x55e0('0x51')],'active':_0x4a9275[_0x55e0('0x68')],'label':_0x4a9275['label'],'custom':!![]};}));});}})[_0x55e0('0x28')](function(_0x53f0fd){return{'count':_0x53f0fd[_0x55e0('0x39')],'rows':_0x53f0fd};})[_0x55e0('0x28')](respondWithResult(_0x71ee63,null))[_0x55e0('0x42')](function(_0x437ba3){var _0x237589=_0x585b01['query']['test']?0x1f4:_0x437ba3[_0x55e0('0x69')]||0x1f4;logger[_0x55e0('0x6a')](_0x55e0('0x6b'),_0x55e0('0x6c'),_0x237589,JSON[_0x55e0('0x6d')](_0x437ba3));delete _0x437ba3[_0x55e0('0x2b')];if(_0x237589===0x191){_0x237589=0x190;}_0x71ee63[_0x55e0('0x1b')](_0x237589)['send'](_0x585b01[_0x55e0('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x437ba3['statusCode']}:_0x437ba3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 119358b..c083204 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 _0x5172=['exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x48df73,_0xc25672){var _0x351681=function(_0x3b17a2){while(--_0x3b17a2){_0x48df73['push'](_0x48df73['shift']());}};_0x351681(++_0xc25672);}(_0x5172,0x121));var _0x2517=function(_0xdc94a4,_0x1be57a){_0xdc94a4=_0xdc94a4-0x0;var _0x306cde=_0x5172[_0xdc94a4];return _0x306cde;};'use strict';var _=require(_0x2517('0x0'));var util=require(_0x2517('0x1'));var logger=require(_0x2517('0x2'))(_0x2517('0x3'));var moment=require(_0x2517('0x4'));var BPromise=require('bluebird');var rp=require(_0x2517('0x5'));var fs=require('fs');var path=require(_0x2517('0x6'));var rimraf=require(_0x2517('0x7'));var config=require(_0x2517('0x8'));var attributes=require(_0x2517('0x9'));var integrations=require(_0x2517('0xa'));module[_0x2517('0xb')]=function(_0x3d5ae0,_0x16eb82){return _0x3d5ae0[_0x2517('0xc')](_0x2517('0xd'),attributes,{'tableName':_0x2517('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be1=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','util'];(function(_0x11c3dc,_0x4ed96f){var _0x5dfff6=function(_0x2547cd){while(--_0x2547cd){_0x11c3dc['push'](_0x11c3dc['shift']());}};_0x5dfff6(++_0x4ed96f);}(_0x2be1,0x1e3));var _0x12be=function(_0x4cce8,_0x22d1fe){_0x4cce8=_0x4cce8-0x0;var _0x458440=_0x2be1[_0x4cce8];return _0x458440;};'use strict';var _=require('lodash');var util=require(_0x12be('0x0'));var logger=require(_0x12be('0x1'))(_0x12be('0x2'));var moment=require('moment');var BPromise=require(_0x12be('0x3'));var rp=require(_0x12be('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12be('0x5'));var config=require(_0x12be('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x12be('0x7'));module[_0x12be('0x8')]=function(_0x26adb7,_0x18f0be){return _0x26adb7[_0x12be('0x9')](_0x12be('0xa'),attributes,{'tableName':'int_desk_accounts','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 fb4f263..80cf3d6 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 _0x0cbd=['message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x24712a,_0x8da508){var _0x1eccf8=function(_0x2a83f6){while(--_0x2a83f6){_0x24712a['push'](_0x24712a['shift']());}};_0x1eccf8(++_0x8da508);}(_0x0cbd,0x138));var _0xd0cb=function(_0x352e52,_0x34a693){_0x352e52=_0x352e52-0x0;var _0x5b5f2a=_0x0cbd[_0x352e52];return _0x5b5f2a;};'use strict';var _=require(_0xd0cb('0x0'));var util=require(_0xd0cb('0x1'));var moment=require(_0xd0cb('0x2'));var BPromise=require(_0xd0cb('0x3'));var rs=require(_0xd0cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0cb('0x5'))['db'];var utils=require(_0xd0cb('0x6'));var logger=require(_0xd0cb('0x7'))(_0xd0cb('0x8'));var config=require(_0xd0cb('0x9'));var jayson=require(_0xd0cb('0xa'));var client=jayson['client'][_0xd0cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e3e5f,_0x4a24dc,_0x3cdf29){return new BPromise(function(_0x2ed558,_0x2abeef){return client['request'](_0x3e3e5f,_0x3cdf29)[_0xd0cb('0xc')](function(_0x2fbf55){logger[_0xd0cb('0xd')](_0xd0cb('0xe'),_0x4a24dc,_0xd0cb('0xf'));logger[_0xd0cb('0x10')](_0xd0cb('0x11'),_0x4a24dc,'request\x20sent',JSON[_0xd0cb('0x12')](_0x2fbf55));if(_0x2fbf55[_0xd0cb('0x13')]){if(_0x2fbf55[_0xd0cb('0x13')][_0xd0cb('0x14')]===0x1f4){logger[_0xd0cb('0x13')](_0xd0cb('0xe'),_0x4a24dc,_0x2fbf55[_0xd0cb('0x13')]['message']);return _0x2abeef(_0x2fbf55['error'][_0xd0cb('0x15')]);}logger[_0xd0cb('0x13')](_0xd0cb('0xe'),_0x4a24dc,_0x2fbf55[_0xd0cb('0x13')][_0xd0cb('0x15')]);return _0x2ed558(_0x2fbf55[_0xd0cb('0x13')][_0xd0cb('0x15')]);}else{logger[_0xd0cb('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4a24dc,_0xd0cb('0xf'));_0x2ed558(_0x2fbf55[_0xd0cb('0x16')][_0xd0cb('0x15')]);}})['catch'](function(_0x23f53e){logger[_0xd0cb('0x13')](_0xd0cb('0xe'),_0x4a24dc,_0x23f53e);_0x2abeef(_0x23f53e);});});}exports[_0xd0cb('0x17')]=function(_0x571706){var _0x5d3249=this;return new Promise(function(_0x54d777,_0x4c61d7){return db[_0xd0cb('0x18')][_0xd0cb('0x19')]({'raw':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x571706[_0xd0cb('0x1a')]?_0x571706['options'][_0xd0cb('0x1c')]||null:null,'attributes':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1d')]||null:null,'limit':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1e')]||null:null,'include':_0x571706[_0xd0cb('0x1a')]?_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x571706[_0xd0cb('0x1a')][_0xd0cb('0x1f')],function(_0x3ef6b0){return{'model':db[_0x3ef6b0[_0xd0cb('0x21')]],'as':_0x3ef6b0['as'],'attributes':_0x3ef6b0[_0xd0cb('0x1d')],'include':_0x3ef6b0[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x3ef6b0[_0xd0cb('0x1f')],function(_0x520690){return{'model':db[_0x520690[_0xd0cb('0x21')]],'as':_0x520690['as'],'attributes':_0x520690['attributes'],'include':_0x520690[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x520690['include'],function(_0x2ead8e){return{'model':db[_0x2ead8e['model']],'as':_0x2ead8e['as'],'attributes':_0x2ead8e[_0xd0cb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0cb('0xc')](function(_0x3e420b){logger[_0xd0cb('0xd')](_0xd0cb('0x17'),_0x571706);logger['debug'](_0xd0cb('0x17'),_0x571706,JSON[_0xd0cb('0x12')](_0x3e420b));_0x54d777(_0x3e420b);})[_0xd0cb('0x22')](function(_0x7f47ba){logger[_0xd0cb('0x13')](_0xd0cb('0x17'),_0x7f47ba['message'],_0x571706);_0x4c61d7(_0x5d3249[_0xd0cb('0x13')](0x1f4,_0x7f47ba[_0xd0cb('0x15')]));});});};exports[_0xd0cb('0x23')]=function(_0x2b3eb4){var _0x286983=this;return new Promise(function(_0x31036b,_0x1399aa){return db[_0xd0cb('0x18')][_0xd0cb('0x24')]({'raw':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4[_0xd0cb('0x1a')][_0xd0cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4['options'][_0xd0cb('0x1c')]||null:null,'attributes':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4[_0xd0cb('0x1a')][_0xd0cb('0x1d')]||null:null,'include':_0x2b3eb4[_0xd0cb('0x1a')]?_0x2b3eb4[_0xd0cb('0x1a')]['include']?_[_0xd0cb('0x20')](_0x2b3eb4[_0xd0cb('0x1a')][_0xd0cb('0x1f')],function(_0x36c2c8){return{'model':db[_0x36c2c8[_0xd0cb('0x21')]],'as':_0x36c2c8['as'],'attributes':_0x36c2c8[_0xd0cb('0x1d')],'include':_0x36c2c8[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x36c2c8['include'],function(_0x301a4f){return{'model':db[_0x301a4f[_0xd0cb('0x21')]],'as':_0x301a4f['as'],'attributes':_0x301a4f[_0xd0cb('0x1d')],'include':_0x301a4f[_0xd0cb('0x1f')]?_[_0xd0cb('0x20')](_0x301a4f[_0xd0cb('0x1f')],function(_0x3c3fd9){return{'model':db[_0x3c3fd9[_0xd0cb('0x21')]],'as':_0x3c3fd9['as'],'attributes':_0x3c3fd9[_0xd0cb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0cb('0xc')](function(_0x553a1c){logger[_0xd0cb('0xd')](_0xd0cb('0x23'),_0x2b3eb4);logger[_0xd0cb('0x10')](_0xd0cb('0x23'),_0x2b3eb4,JSON[_0xd0cb('0x12')](_0x553a1c));_0x31036b(_0x553a1c);})[_0xd0cb('0x22')](function(_0x2283ae){logger[_0xd0cb('0x13')](_0xd0cb('0x23'),_0x2283ae[_0xd0cb('0x15')],_0x2b3eb4);_0x1399aa(_0x286983[_0xd0cb('0x13')](0x1f4,_0x2283ae[_0xd0cb('0x15')]));});});}; \ No newline at end of file +var _0xe663=['map','GetDeskAccount','debug','stringify','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','DeskAccount','findAll','options','raw','where','attributes','include','model'];(function(_0x275d09,_0x5615bf){var _0x4a1e90=function(_0x2fcd33){while(--_0x2fcd33){_0x275d09['push'](_0x275d09['shift']());}};_0x4a1e90(++_0x5615bf);}(_0xe663,0x8f));var _0x3e66=function(_0x15b8c3,_0x17ae6f){_0x15b8c3=_0x15b8c3-0x0;var _0x49236e=_0xe663[_0x15b8c3];return _0x49236e;};'use strict';var _=require(_0x3e66('0x0'));var util=require(_0x3e66('0x1'));var moment=require(_0x3e66('0x2'));var BPromise=require(_0x3e66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e66('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e66('0x5'));var logger=require(_0x3e66('0x6'))(_0x3e66('0x7'));var config=require(_0x3e66('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3e66('0x9')][_0x3e66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x119347,_0x1aa20a,_0x187fb0){return new BPromise(function(_0x18d4b4,_0x1b5a1c){return client['request'](_0x119347,_0x187fb0)[_0x3e66('0xb')](function(_0x137395){logger[_0x3e66('0xc')](_0x3e66('0xd'),_0x1aa20a,'request\x20sent');logger['debug'](_0x3e66('0xe'),_0x1aa20a,_0x3e66('0xf'),JSON['stringify'](_0x137395));if(_0x137395[_0x3e66('0x10')]){if(_0x137395['error'][_0x3e66('0x11')]===0x1f4){logger[_0x3e66('0x10')](_0x3e66('0xd'),_0x1aa20a,_0x137395['error']['message']);return _0x1b5a1c(_0x137395[_0x3e66('0x10')]['message']);}logger[_0x3e66('0x10')](_0x3e66('0xd'),_0x1aa20a,_0x137395['error'][_0x3e66('0x12')]);return _0x18d4b4(_0x137395['error'][_0x3e66('0x12')]);}else{logger[_0x3e66('0xc')]('DeskAccount,\x20%s,\x20%s',_0x1aa20a,_0x3e66('0xf'));_0x18d4b4(_0x137395['result'][_0x3e66('0x12')]);}})['catch'](function(_0x1db0d2){logger['error'](_0x3e66('0xd'),_0x1aa20a,_0x1db0d2);_0x1b5a1c(_0x1db0d2);});});}exports['GetDeskAccount']=function(_0x468c63){var _0x24a77f=this;return new Promise(function(_0x4471b6,_0x39cd9e){return db[_0x3e66('0x13')][_0x3e66('0x14')]({'raw':_0x468c63[_0x3e66('0x15')]?_0x468c63['options'][_0x3e66('0x16')]===undefined?!![]:![]:!![],'where':_0x468c63['options']?_0x468c63[_0x3e66('0x15')][_0x3e66('0x17')]||null:null,'attributes':_0x468c63['options']?_0x468c63[_0x3e66('0x15')][_0x3e66('0x18')]||null:null,'limit':_0x468c63[_0x3e66('0x15')]?_0x468c63[_0x3e66('0x15')]['limit']||null:null,'include':_0x468c63[_0x3e66('0x15')]?_0x468c63['options'][_0x3e66('0x19')]?_['map'](_0x468c63[_0x3e66('0x15')][_0x3e66('0x19')],function(_0x131514){return{'model':db[_0x131514[_0x3e66('0x1a')]],'as':_0x131514['as'],'attributes':_0x131514['attributes'],'include':_0x131514[_0x3e66('0x19')]?_['map'](_0x131514[_0x3e66('0x19')],function(_0xd53af9){return{'model':db[_0xd53af9[_0x3e66('0x1a')]],'as':_0xd53af9['as'],'attributes':_0xd53af9[_0x3e66('0x18')],'include':_0xd53af9[_0x3e66('0x19')]?_[_0x3e66('0x1b')](_0xd53af9[_0x3e66('0x19')],function(_0x57d3b0){return{'model':db[_0x57d3b0[_0x3e66('0x1a')]],'as':_0x57d3b0['as'],'attributes':_0x57d3b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e66('0xb')](function(_0x596089){logger[_0x3e66('0xc')](_0x3e66('0x1c'),_0x468c63);logger[_0x3e66('0x1d')](_0x3e66('0x1c'),_0x468c63,JSON[_0x3e66('0x1e')](_0x596089));_0x4471b6(_0x596089);})[_0x3e66('0x1f')](function(_0x11bd3e){logger[_0x3e66('0x10')]('GetDeskAccount',_0x11bd3e['message'],_0x468c63);_0x39cd9e(_0x24a77f['error'](0x1f4,_0x11bd3e[_0x3e66('0x12')]));});});};exports[_0x3e66('0x20')]=function(_0x5dca14){var _0x536e85=this;return new Promise(function(_0x2120ee,_0x6e51c){return db[_0x3e66('0x13')][_0x3e66('0x21')]({'raw':_0x5dca14[_0x3e66('0x15')]?_0x5dca14[_0x3e66('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5dca14[_0x3e66('0x15')]?_0x5dca14[_0x3e66('0x15')][_0x3e66('0x17')]||null:null,'attributes':_0x5dca14[_0x3e66('0x15')]?_0x5dca14[_0x3e66('0x15')][_0x3e66('0x18')]||null:null,'include':_0x5dca14[_0x3e66('0x15')]?_0x5dca14[_0x3e66('0x15')][_0x3e66('0x19')]?_[_0x3e66('0x1b')](_0x5dca14['options'][_0x3e66('0x19')],function(_0x27df1c){return{'model':db[_0x27df1c[_0x3e66('0x1a')]],'as':_0x27df1c['as'],'attributes':_0x27df1c[_0x3e66('0x18')],'include':_0x27df1c[_0x3e66('0x19')]?_['map'](_0x27df1c[_0x3e66('0x19')],function(_0x2ea136){return{'model':db[_0x2ea136[_0x3e66('0x1a')]],'as':_0x2ea136['as'],'attributes':_0x2ea136[_0x3e66('0x18')],'include':_0x2ea136['include']?_[_0x3e66('0x1b')](_0x2ea136['include'],function(_0x449f28){return{'model':db[_0x449f28[_0x3e66('0x1a')]],'as':_0x449f28['as'],'attributes':_0x449f28[_0x3e66('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3e66('0xb')](function(_0x9f5069){logger[_0x3e66('0xc')](_0x3e66('0x20'),_0x5dca14);logger[_0x3e66('0x1d')]('ShowDeskAccount',_0x5dca14,JSON[_0x3e66('0x1e')](_0x9f5069));_0x2120ee(_0x9f5069);})[_0x3e66('0x1f')](function(_0x45f728){logger[_0x3e66('0x10')](_0x3e66('0x20'),_0x45f728[_0x3e66('0x12')],_0x5dca14);_0x6e51c(_0x536e85[_0x3e66('0x10')](0x1f4,_0x45f728[_0x3e66('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 55b08a0..17ed489 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x40ca9e,_0x4e610f){var _0x3aae9f=function(_0x944212){while(--_0x944212){_0x40ca9e['push'](_0x40ca9e['shift']());}};_0x3aae9f(++_0x4e610f);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e878b,_0x4732ad){_0x4e878b=_0x4e878b-0x0;var _0x4126aa=_0xedd9[_0x4e878b];return _0x4126aa;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x55ca,0x126));var _0xa55c=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0x55ca[_0x317497];return _0x3445b0;};'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['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);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['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index aeb21e1..f966f7b 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 _0x48ea=['STRING','sequelize','exports'];(function(_0x1a450a,_0x4dcb72){var _0x4f8ef4=function(_0x44c6ba){while(--_0x44c6ba){_0x1a450a['push'](_0x1a450a['shift']());}};_0x4f8ef4(++_0x4dcb72);}(_0x48ea,0x19c));var _0xa48e=function(_0x281f54,_0x3ac707){_0x281f54=_0x281f54-0x0;var _0x104d42=_0x48ea[_0x281f54];return _0x104d42;};'use strict';var Sequelize=require(_0xa48e('0x0'));module[_0xa48e('0x1')]={'name':{'type':Sequelize[_0xa48e('0x2')]},'description':{'type':Sequelize[_0xa48e('0x2')]}}; \ No newline at end of file +var _0xc80f=['STRING','sequelize','exports'];(function(_0x57ce7c,_0x4a443f){var _0x484fb2=function(_0x2ae35c){while(--_0x2ae35c){_0x57ce7c['push'](_0x57ce7c['shift']());}};_0x484fb2(++_0x4a443f);}(_0xc80f,0x106));var _0xfc80=function(_0x460a84,_0x5d46ba){_0x460a84=_0x460a84-0x0;var _0x2587c9=_0xc80f[_0x460a84];return _0x2587c9;};'use strict';var Sequelize=require(_0xfc80('0x0'));module[_0xfc80('0x1')]={'name':{'type':Sequelize[_0xfc80('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1e5ce43..46da3e9 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 _0x471e=['count','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','DeskField','getSubjects','pick','getDescriptions','Tag','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','end','error','name','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x42e6e7,_0x4ee4f6){var _0x32909b=function(_0xfeb4fa){while(--_0xfeb4fa){_0x42e6e7['push'](_0x42e6e7['shift']());}};_0x32909b(++_0x4ee4f6);}(_0x471e,0x199));var _0xe471=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x471e[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xe471('0x0'));var rimraf=require(_0xe471('0x1'));var zipdir=require(_0xe471('0x2'));var jsonpatch=require(_0xe471('0x3'));var rp=require(_0xe471('0x4'));var moment=require(_0xe471('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe471('0x6'));var util=require(_0xe471('0x7'));var path=require(_0xe471('0x8'));var sox=require(_0xe471('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe471('0xa'));var squel=require(_0xe471('0xb'));var crypto=require(_0xe471('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe471('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe471('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe471('0xf'));var as=require(_0xe471('0x10'));var hardwareService=require(_0xe471('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe471('0x12'));var licenseUtil=require(_0xe471('0x13'));var db=require(_0xe471('0x14'))['db'];function respondWithStatusCode(_0x310b97,_0x729be6){_0x729be6=_0x729be6||0xcc;return function(_0x302251){if(_0x302251){return _0x310b97[_0xe471('0x15')](_0x729be6);}return _0x310b97[_0xe471('0x16')](_0x729be6)['end']();};}function respondWithResult(_0x49cf27,_0x420168){_0x420168=_0x420168||0xc8;return function(_0x278f63){if(_0x278f63){return _0x49cf27['status'](_0x420168)[_0xe471('0x17')](_0x278f63);}};}function respondWithFilteredResult(_0x5c5463,_0x51ffdb){return function(_0xe5d058){if(_0xe5d058){var _0x5d6399=typeof _0x51ffdb[_0xe471('0x18')]==='undefined'&&typeof _0x51ffdb[_0xe471('0x19')]==='undefined';var _0x3546b2=_0xe5d058['count'];var _0xb6f13d=_0x5d6399?0x0:_0x51ffdb[_0xe471('0x18')];var _0x582642=_0x5d6399?_0xe5d058['count']:_0x51ffdb[_0xe471('0x18')]+_0x51ffdb[_0xe471('0x19')];var _0x21c9ab;if(_0x582642>=_0x3546b2){_0x582642=_0x3546b2;_0x21c9ab=0xc8;}else{_0x21c9ab=0xce;}_0x5c5463[_0xe471('0x16')](_0x21c9ab);return _0x5c5463[_0xe471('0x1a')](_0xe471('0x1b'),_0xb6f13d+'-'+_0x582642+'/'+_0x3546b2)[_0xe471('0x17')](_0xe5d058);}return null;};}function patchUpdates(_0x24a0aa){return function(_0x25465d){try{jsonpatch['apply'](_0x25465d,_0x24a0aa,!![]);}catch(_0x43a8a5){return BPromise[_0xe471('0x1c')](_0x43a8a5);}return _0x25465d['save']();};}function saveUpdates(_0x232db1,_0x483ae7){return function(_0x404d1f){if(_0x404d1f){return _0x404d1f[_0xe471('0x1d')](_0x232db1)[_0xe471('0x1e')](function(_0xefbbf){return _0xefbbf;});}return null;};}function removeEntity(_0x21e863,_0x4783cd){return function(_0x1588e7){if(_0x1588e7){return _0x1588e7[_0xe471('0x1f')]()['then'](function(){_0x21e863[_0xe471('0x16')](0xcc)[_0xe471('0x20')]();});}};}function handleEntityNotFound(_0x4a036d,_0x451ed8){return function(_0x55c6ef){if(!_0x55c6ef){_0x4a036d[_0xe471('0x15')](0x194);}return _0x55c6ef;};}function handleError(_0x382f75,_0xadc23a){_0xadc23a=_0xadc23a||0x1f4;return function(_0x1d1dcf){logger[_0xe471('0x21')](_0x1d1dcf['stack']);if(_0x1d1dcf[_0xe471('0x22')]){delete _0x1d1dcf[_0xe471('0x22')];}_0x382f75[_0xe471('0x16')](_0xadc23a)['send'](_0x1d1dcf);};}exports[_0xe471('0x23')]=function(_0x168778,_0x18f3a7){var _0x2cf1ef={},_0x4ae59c={},_0xc6f9b0={'count':0x0,'rows':[]};var _0x3879ec=_[_0xe471('0x24')](db[_0xe471('0x25')][_0xe471('0x26')],function(_0x2b1bbe){return{'name':_0x2b1bbe[_0xe471('0x27')],'type':_0x2b1bbe['type'][_0xe471('0x28')]};});_0x4ae59c[_0xe471('0x29')]=_['map'](_0x3879ec,_0xe471('0x22'));_0x4ae59c[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x168778[_0xe471('0x2a')]);_0x4ae59c[_0xe471('0x2c')]=_[_0xe471('0x2d')](_0x4ae59c[_0xe471('0x29')],_0x4ae59c[_0xe471('0x2a')]);_0x2cf1ef['attributes']=_[_0xe471('0x2d')](_0x4ae59c[_0xe471('0x29')],qs['fields'](_0x168778[_0xe471('0x2a')][_0xe471('0x2e')]));_0x2cf1ef[_0xe471('0x2f')]=_0x2cf1ef[_0xe471('0x2f')][_0xe471('0x30')]?_0x2cf1ef['attributes']:_0x4ae59c['model'];if(!_0x168778[_0xe471('0x2a')][_0xe471('0x31')](_0xe471('0x32'))){_0x2cf1ef['limit']=qs['limit'](_0x168778['query'][_0xe471('0x19')]);_0x2cf1ef[_0xe471('0x18')]=qs[_0xe471('0x18')](_0x168778['query'][_0xe471('0x18')]);}_0x2cf1ef[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x168778['query'][_0xe471('0x34')]);_0x2cf1ef[_0xe471('0x35')]=qs[_0xe471('0x2c')](_['pick'](_0x168778[_0xe471('0x2a')],_0x4ae59c[_0xe471('0x2c')]),_0x3879ec);if(_0x168778['query'][_0xe471('0x36')]){_0x2cf1ef[_0xe471('0x35')]=_[_0xe471('0x37')](_0x2cf1ef['where'],{'$or':_['map'](_0x3879ec,function(_0x5ceb7f){if(_0x5ceb7f[_0xe471('0x38')]!==_0xe471('0x39')){var _0xad9c8d={};_0xad9c8d[_0x5ceb7f[_0xe471('0x22')]]={'$like':'%'+_0x168778[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0xad9c8d;}})});}_0x2cf1ef=_[_0xe471('0x37')]({},_0x2cf1ef,_0x168778[_0xe471('0x3a')]);var _0x39c4a8={'where':_0x2cf1ef[_0xe471('0x35')]};return db['DeskConfiguration'][_0xe471('0x3b')](_0x39c4a8)[_0xe471('0x1e')](function(_0x37ab5e){_0xc6f9b0[_0xe471('0x3b')]=_0x37ab5e;if(_0x168778[_0xe471('0x2a')][_0xe471('0x3c')]){_0x2cf1ef[_0xe471('0x3d')]=[{'all':!![]}];}return db[_0xe471('0x25')][_0xe471('0x3e')](_0x2cf1ef);})[_0xe471('0x1e')](function(_0x14b4bf){_0xc6f9b0[_0xe471('0x3f')]=_0x14b4bf;return _0xc6f9b0;})[_0xe471('0x1e')](respondWithFilteredResult(_0x18f3a7,_0x2cf1ef))[_0xe471('0x40')](handleError(_0x18f3a7,null));};exports['show']=function(_0x5618df,_0x410988){var _0x3edb31={'raw':![],'where':{'id':_0x5618df[_0xe471('0x41')]['id']}},_0x3d8949={};_0x3d8949[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x25')][_0xe471('0x26')]);_0x3d8949[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x5618df[_0xe471('0x2a')]);_0x3d8949['filters']=_[_0xe471('0x2d')](_0x3d8949[_0xe471('0x29')],_0x3d8949[_0xe471('0x2a')]);_0x3edb31[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x3d8949[_0xe471('0x29')],qs['fields'](_0x5618df[_0xe471('0x2a')]['fields']));_0x3edb31['attributes']=_0x3edb31[_0xe471('0x2f')][_0xe471('0x30')]?_0x3edb31[_0xe471('0x2f')]:_0x3d8949[_0xe471('0x29')];if(_0x5618df[_0xe471('0x2a')][_0xe471('0x3c')]){_0x3edb31['include']=[{'all':!![]}];}_0x3edb31=_['merge']({},_0x3edb31,_0x5618df['options']);return db['DeskConfiguration'][_0xe471('0x42')](_0x3edb31)[_0xe471('0x1e')](handleEntityNotFound(_0x410988,null))[_0xe471('0x1e')](respondWithResult(_0x410988,null))[_0xe471('0x40')](handleError(_0x410988,null));};exports[_0xe471('0x43')]=function(_0x1e7e52,_0x297621){return db[_0xe471('0x25')][_0xe471('0x43')](_0x1e7e52[_0xe471('0x44')],{})[_0xe471('0x1e')](respondWithResult(_0x297621,0xc9))[_0xe471('0x40')](handleError(_0x297621,null));};exports[_0xe471('0x1d')]=function(_0x147e79,_0x526e95){if(_0x147e79['body']['id']){delete _0x147e79[_0xe471('0x44')]['id'];}return db[_0xe471('0x25')][_0xe471('0x42')]({'where':{'id':_0x147e79['params']['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0x526e95,null))['then'](saveUpdates(_0x147e79[_0xe471('0x44')],null))[_0xe471('0x1e')](respondWithResult(_0x526e95,null))[_0xe471('0x40')](handleError(_0x526e95,null));};exports[_0xe471('0x1f')]=function(_0x54da48,_0x1e45e3){return db['DeskConfiguration'][_0xe471('0x42')]({'where':{'id':_0x54da48[_0xe471('0x41')]['id']}})['then'](handleEntityNotFound(_0x1e45e3,null))[_0xe471('0x1e')](removeEntity(_0x1e45e3,null))[_0xe471('0x40')](handleError(_0x1e45e3,null));};exports[_0xe471('0x45')]=function(_0x251d49,_0x89457d,_0x3b0528){var _0x46d1d2={};var _0x1c4310={};var _0x3592bf;var _0xad2e5f;return db['DeskConfiguration'][_0xe471('0x46')]({'where':{'id':_0x251d49['params']['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0x89457d,null))['then'](function(_0x22b334){if(_0x22b334){_0x3592bf=_0x22b334;_0x1c4310[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x47')]['rawAttributes']);_0x1c4310[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x251d49['query']);_0x1c4310[_0xe471('0x2c')]=_['intersection'](_0x1c4310[_0xe471('0x29')],_0x1c4310[_0xe471('0x2a')]);_0x46d1d2[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x1c4310['model'],qs['fields'](_0x251d49['query'][_0xe471('0x2e')]));_0x46d1d2[_0xe471('0x2f')]=_0x46d1d2[_0xe471('0x2f')][_0xe471('0x30')]?_0x46d1d2['attributes']:_0x1c4310[_0xe471('0x29')];_0x46d1d2[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x251d49['query'][_0xe471('0x34')]);_0x46d1d2[_0xe471('0x35')]=qs['filters'](_['pick'](_0x251d49[_0xe471('0x2a')],_0x1c4310[_0xe471('0x2c')]));if(_0x251d49['query'][_0xe471('0x36')]){_0x46d1d2[_0xe471('0x35')]=_[_0xe471('0x37')](_0x46d1d2[_0xe471('0x35')],{'$or':_[_0xe471('0x24')](_0x46d1d2[_0xe471('0x2f')],function(_0x3a6775){var _0x13b54d={};_0x13b54d[_0x3a6775]={'$like':'%'+_0x251d49[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x13b54d;})});}_0x46d1d2=_['merge']({},_0x46d1d2,_0x251d49[_0xe471('0x3a')]);return _0x3592bf[_0xe471('0x45')](_0x46d1d2);}})['then'](function(_0xe66ff){if(_0xe66ff){_0xad2e5f=_0xe66ff[_0xe471('0x30')];if(!_0x251d49[_0xe471('0x2a')][_0xe471('0x31')](_0xe471('0x32'))){_0x46d1d2[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x251d49[_0xe471('0x2a')][_0xe471('0x19')]);_0x46d1d2[_0xe471('0x18')]=qs['offset'](_0x251d49[_0xe471('0x2a')][_0xe471('0x18')]);}return _0x3592bf[_0xe471('0x45')](_0x46d1d2);}})[_0xe471('0x1e')](function(_0x4a2b74){if(_0x4a2b74){return _0x4a2b74?{'count':_0xad2e5f,'rows':_0x4a2b74}:null;}})[_0xe471('0x1e')](respondWithResult(_0x89457d,null))[_0xe471('0x40')](handleError(_0x89457d,null));};exports[_0xe471('0x48')]=function(_0x23e241,_0x135eb4,_0x5d5272){var _0x23f701={};var _0x38c038={};var _0xd99924;var _0x2f8750;return db[_0xe471('0x25')][_0xe471('0x46')]({'where':{'id':_0x23e241[_0xe471('0x41')]['id']}})['then'](handleEntityNotFound(_0x135eb4,null))[_0xe471('0x1e')](function(_0x37e59b){if(_0x37e59b){_0xd99924=_0x37e59b;_0x38c038[_0xe471('0x29')]=_['keys'](db[_0xe471('0x47')][_0xe471('0x26')]);_0x38c038[_0xe471('0x2a')]=_['keys'](_0x23e241['query']);_0x38c038['filters']=_[_0xe471('0x2d')](_0x38c038['model'],_0x38c038[_0xe471('0x2a')]);_0x23f701[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x38c038[_0xe471('0x29')],qs[_0xe471('0x2e')](_0x23e241[_0xe471('0x2a')][_0xe471('0x2e')]));_0x23f701[_0xe471('0x2f')]=_0x23f701[_0xe471('0x2f')][_0xe471('0x30')]?_0x23f701[_0xe471('0x2f')]:_0x38c038[_0xe471('0x29')];_0x23f701[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x23e241[_0xe471('0x2a')][_0xe471('0x34')]);_0x23f701[_0xe471('0x35')]=qs[_0xe471('0x2c')](_[_0xe471('0x49')](_0x23e241['query'],_0x38c038[_0xe471('0x2c')]));if(_0x23e241[_0xe471('0x2a')][_0xe471('0x36')]){_0x23f701[_0xe471('0x35')]=_[_0xe471('0x37')](_0x23f701[_0xe471('0x35')],{'$or':_[_0xe471('0x24')](_0x23f701[_0xe471('0x2f')],function(_0x3508a9){var _0x910967={};_0x910967[_0x3508a9]={'$like':'%'+_0x23e241[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x910967;})});}_0x23f701=_[_0xe471('0x37')]({},_0x23f701,_0x23e241['options']);return _0xd99924[_0xe471('0x48')](_0x23f701);}})['then'](function(_0x121ae2){if(_0x121ae2){_0x2f8750=_0x121ae2[_0xe471('0x30')];if(!_0x23e241[_0xe471('0x2a')][_0xe471('0x31')](_0xe471('0x32'))){_0x23f701[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x23e241[_0xe471('0x2a')][_0xe471('0x19')]);_0x23f701[_0xe471('0x18')]=qs[_0xe471('0x18')](_0x23e241['query'][_0xe471('0x18')]);}return _0xd99924[_0xe471('0x48')](_0x23f701);}})['then'](function(_0x2c744a){if(_0x2c744a){return _0x2c744a?{'count':_0x2f8750,'rows':_0x2c744a}:null;}})[_0xe471('0x1e')](respondWithResult(_0x135eb4,null))[_0xe471('0x40')](handleError(_0x135eb4,null));};exports[_0xe471('0x4a')]=function(_0x1663d3,_0x2fa017,_0x4a2298){var _0x31e364={};var _0x45fa3e={};var _0x2941b4;var _0x73c250;return db[_0xe471('0x25')]['findOne']({'where':{'id':_0x1663d3['params']['id']}})['then'](handleEntityNotFound(_0x2fa017,null))[_0xe471('0x1e')](function(_0x52d24e){if(_0x52d24e){_0x2941b4=_0x52d24e;_0x45fa3e[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x47')][_0xe471('0x26')]);_0x45fa3e['query']=_['keys'](_0x1663d3[_0xe471('0x2a')]);_0x45fa3e['filters']=_['intersection'](_0x45fa3e[_0xe471('0x29')],_0x45fa3e[_0xe471('0x2a')]);_0x31e364[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x45fa3e[_0xe471('0x29')],qs[_0xe471('0x2e')](_0x1663d3[_0xe471('0x2a')]['fields']));_0x31e364[_0xe471('0x2f')]=_0x31e364[_0xe471('0x2f')]['length']?_0x31e364[_0xe471('0x2f')]:_0x45fa3e['model'];_0x31e364[_0xe471('0x33')]=qs['sort'](_0x1663d3[_0xe471('0x2a')][_0xe471('0x34')]);_0x31e364[_0xe471('0x35')]=qs[_0xe471('0x2c')](_['pick'](_0x1663d3[_0xe471('0x2a')],_0x45fa3e[_0xe471('0x2c')]));if(_0x1663d3['query'][_0xe471('0x36')]){_0x31e364[_0xe471('0x35')]=_['merge'](_0x31e364['where'],{'$or':_[_0xe471('0x24')](_0x31e364[_0xe471('0x2f')],function(_0x5964c7){var _0x19ab47={};_0x19ab47[_0x5964c7]={'$like':'%'+_0x1663d3[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x19ab47;})});}_0x31e364=_[_0xe471('0x37')]({},_0x31e364,_0x1663d3[_0xe471('0x3a')]);return _0x2941b4['getDescriptions'](_0x31e364);}})[_0xe471('0x1e')](function(_0x26c196){if(_0x26c196){_0x73c250=_0x26c196[_0xe471('0x30')];if(!_0x1663d3[_0xe471('0x2a')]['hasOwnProperty'](_0xe471('0x32'))){_0x31e364[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x1663d3[_0xe471('0x2a')][_0xe471('0x19')]);_0x31e364[_0xe471('0x18')]=qs['offset'](_0x1663d3[_0xe471('0x2a')][_0xe471('0x18')]);}return _0x2941b4[_0xe471('0x4a')](_0x31e364);}})[_0xe471('0x1e')](function(_0xc2392){if(_0xc2392){return _0xc2392?{'count':_0x73c250,'rows':_0xc2392}:null;}})[_0xe471('0x1e')](respondWithResult(_0x2fa017,null))[_0xe471('0x40')](handleError(_0x2fa017,null));};exports['getTags']=function(_0x2786d3,_0xb43976,_0x40a4a8){var _0x5b5e05={};var _0x503daf={};var _0x44abae;var _0x107ba3;return db[_0xe471('0x25')][_0xe471('0x46')]({'where':{'id':_0x2786d3[_0xe471('0x41')]['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0xb43976,null))[_0xe471('0x1e')](function(_0x538327){if(_0x538327){_0x44abae=_0x538327;_0x503daf[_0xe471('0x29')]=_[_0xe471('0x2b')](db[_0xe471('0x4b')]['rawAttributes']);_0x503daf[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x2786d3[_0xe471('0x2a')]);_0x503daf['filters']=_[_0xe471('0x2d')](_0x503daf['model'],_0x503daf[_0xe471('0x2a')]);_0x5b5e05[_0xe471('0x2f')]=_[_0xe471('0x2d')](_0x503daf[_0xe471('0x29')],qs['fields'](_0x2786d3[_0xe471('0x2a')]['fields']));_0x5b5e05[_0xe471('0x2f')]=_0x5b5e05['attributes'][_0xe471('0x30')]?_0x5b5e05[_0xe471('0x2f')]:_0x503daf['model'];_0x5b5e05[_0xe471('0x33')]=qs[_0xe471('0x34')](_0x2786d3[_0xe471('0x2a')][_0xe471('0x34')]);_0x5b5e05['where']=qs[_0xe471('0x2c')](_[_0xe471('0x49')](_0x2786d3[_0xe471('0x2a')],_0x503daf[_0xe471('0x2c')]));if(_0x2786d3[_0xe471('0x2a')][_0xe471('0x36')]){_0x5b5e05[_0xe471('0x35')]=_[_0xe471('0x37')](_0x5b5e05['where'],{'$or':_['map'](_0x5b5e05[_0xe471('0x2f')],function(_0x403d56){var _0x3083ad={};_0x3083ad[_0x403d56]={'$like':'%'+_0x2786d3[_0xe471('0x2a')][_0xe471('0x36')]+'%'};return _0x3083ad;})});}_0x5b5e05=_['merge']({},_0x5b5e05,_0x2786d3[_0xe471('0x3a')]);return _0x44abae[_0xe471('0x4c')](_0x5b5e05);}})['then'](function(_0x182100){if(_0x182100){_0x107ba3=_0x182100[_0xe471('0x30')];if(!_0x2786d3[_0xe471('0x2a')][_0xe471('0x31')]('nolimit')){_0x5b5e05[_0xe471('0x19')]=qs[_0xe471('0x19')](_0x2786d3[_0xe471('0x2a')][_0xe471('0x19')]);_0x5b5e05[_0xe471('0x18')]=qs[_0xe471('0x18')](_0x2786d3[_0xe471('0x2a')]['offset']);}return _0x44abae[_0xe471('0x4c')](_0x5b5e05);}})['then'](function(_0x4a0ebc){if(_0x4a0ebc){return _0x4a0ebc?{'count':_0x107ba3,'rows':_0x4a0ebc}:null;}})[_0xe471('0x1e')](respondWithResult(_0xb43976,null))[_0xe471('0x40')](handleError(_0xb43976,null));};exports['setTags']=function(_0x36ab30,_0x912bb7,_0x5d3a9a){if(_0x36ab30[_0xe471('0x44')]['id']){delete _0x36ab30[_0xe471('0x44')]['id'];}return db['DeskConfiguration'][_0xe471('0x46')]({'where':{'id':_0x36ab30[_0xe471('0x41')]['id']}})[_0xe471('0x1e')](handleEntityNotFound(_0x912bb7,null))[_0xe471('0x1e')](function(_0x186eea){if(_0x186eea){return _0x186eea['setTags'](_0x36ab30[_0xe471('0x44')][_0xe471('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x912bb7,null))[_0xe471('0x40')](handleError(_0x912bb7,null));}; \ No newline at end of file +var _0x5962=['map','DeskConfiguration','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','catch','params','rawAttributes','find','create','body','destroy','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','index'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x5962,0x169));var _0x2596=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0x5962[_0x35387d];return _0x3aba56;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2596('0x0'));var rp=require('request-promise');var moment=require(_0x2596('0x1'));var BPromise=require(_0x2596('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2596('0x3'));var sox=require(_0x2596('0x4'));var csv=require(_0x2596('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2596('0x6'));var _=require(_0x2596('0x7'));var squel=require(_0x2596('0x8'));var crypto=require(_0x2596('0x9'));var jsforce=require(_0x2596('0xa'));var deskjs=require(_0x2596('0xb'));var toCsv=require(_0x2596('0x5'));var querystring=require(_0x2596('0xc'));var Papa=require(_0x2596('0xd'));var Redis=require(_0x2596('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2596('0xf'));var as=require(_0x2596('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2596('0x11'))(_0x2596('0x12'));var utils=require(_0x2596('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2596('0x14'));var db=require(_0x2596('0x15'))['db'];function respondWithStatusCode(_0x2ff54b,_0x4b4f06){_0x4b4f06=_0x4b4f06||0xcc;return function(_0x26b91d){if(_0x26b91d){return _0x2ff54b['sendStatus'](_0x4b4f06);}return _0x2ff54b[_0x2596('0x16')](_0x4b4f06)[_0x2596('0x17')]();};}function respondWithResult(_0x116d54,_0x22ace8){_0x22ace8=_0x22ace8||0xc8;return function(_0x5cec78){if(_0x5cec78){return _0x116d54[_0x2596('0x16')](_0x22ace8)[_0x2596('0x18')](_0x5cec78);}};}function respondWithFilteredResult(_0x50c514,_0x5c2cec){return function(_0x5c173b){if(_0x5c173b){var _0x130367=typeof _0x5c2cec['offset']==='undefined'&&typeof _0x5c2cec[_0x2596('0x19')]===_0x2596('0x1a');var _0x213084=_0x5c173b[_0x2596('0x1b')];var _0x2f9c3d=_0x130367?0x0:_0x5c2cec['offset'];var _0x3c116c=_0x130367?_0x5c173b[_0x2596('0x1b')]:_0x5c2cec['offset']+_0x5c2cec[_0x2596('0x19')];var _0xad567d;if(_0x3c116c>=_0x213084){_0x3c116c=_0x213084;_0xad567d=0xc8;}else{_0xad567d=0xce;}_0x50c514[_0x2596('0x16')](_0xad567d);return _0x50c514[_0x2596('0x1c')](_0x2596('0x1d'),_0x2f9c3d+'-'+_0x3c116c+'/'+_0x213084)[_0x2596('0x18')](_0x5c173b);}return null;};}function patchUpdates(_0x5a65ba){return function(_0x2cc562){try{jsonpatch[_0x2596('0x1e')](_0x2cc562,_0x5a65ba,!![]);}catch(_0x3ae983){return BPromise[_0x2596('0x1f')](_0x3ae983);}return _0x2cc562[_0x2596('0x20')]();};}function saveUpdates(_0x5e3433,_0xbd6192){return function(_0x5860eb){if(_0x5860eb){return _0x5860eb[_0x2596('0x21')](_0x5e3433)[_0x2596('0x22')](function(_0x25ab84){return _0x25ab84;});}return null;};}function removeEntity(_0x310fbd,_0x3621ce){return function(_0xdfe6df){if(_0xdfe6df){return _0xdfe6df['destroy']()[_0x2596('0x22')](function(){_0x310fbd[_0x2596('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54dfb6,_0x330d97){return function(_0x169189){if(!_0x169189){_0x54dfb6[_0x2596('0x23')](0x194);}return _0x169189;};}function handleError(_0x481e2f,_0x35dfc1){_0x35dfc1=_0x35dfc1||0x1f4;return function(_0x3eb60a){logger[_0x2596('0x24')](_0x3eb60a['stack']);if(_0x3eb60a['name']){delete _0x3eb60a[_0x2596('0x25')];}_0x481e2f[_0x2596('0x16')](_0x35dfc1)['send'](_0x3eb60a);};}exports[_0x2596('0x26')]=function(_0x55df13,_0x554656){var _0x14d4ba={},_0x1b60c6={},_0x41bd81={'count':0x0,'rows':[]};var _0x284a5f=_[_0x2596('0x27')](db[_0x2596('0x28')]['rawAttributes'],function(_0xc6a3){return{'name':_0xc6a3['fieldName'],'type':_0xc6a3['type'][_0x2596('0x29')]};});_0x1b60c6[_0x2596('0x2a')]=_['map'](_0x284a5f,_0x2596('0x25'));_0x1b60c6['query']=_[_0x2596('0x2b')](_0x55df13[_0x2596('0x2c')]);_0x1b60c6[_0x2596('0x2d')]=_[_0x2596('0x2e')](_0x1b60c6['model'],_0x1b60c6[_0x2596('0x2c')]);_0x14d4ba[_0x2596('0x2f')]=_[_0x2596('0x2e')](_0x1b60c6[_0x2596('0x2a')],qs[_0x2596('0x30')](_0x55df13['query']['fields']));_0x14d4ba['attributes']=_0x14d4ba[_0x2596('0x2f')][_0x2596('0x31')]?_0x14d4ba[_0x2596('0x2f')]:_0x1b60c6[_0x2596('0x2a')];if(!_0x55df13[_0x2596('0x2c')][_0x2596('0x32')](_0x2596('0x33'))){_0x14d4ba[_0x2596('0x19')]=qs['limit'](_0x55df13[_0x2596('0x2c')][_0x2596('0x19')]);_0x14d4ba['offset']=qs[_0x2596('0x34')](_0x55df13[_0x2596('0x2c')]['offset']);}_0x14d4ba[_0x2596('0x35')]=qs[_0x2596('0x36')](_0x55df13['query'][_0x2596('0x36')]);_0x14d4ba[_0x2596('0x37')]=qs[_0x2596('0x2d')](_[_0x2596('0x38')](_0x55df13[_0x2596('0x2c')],_0x1b60c6['filters']),_0x284a5f);if(_0x55df13[_0x2596('0x2c')]['filter']){_0x14d4ba[_0x2596('0x37')]=_[_0x2596('0x39')](_0x14d4ba[_0x2596('0x37')],{'$or':_['map'](_0x284a5f,function(_0x490c1b){if(_0x490c1b[_0x2596('0x3a')]!==_0x2596('0x3b')){var _0x55a970={};_0x55a970[_0x490c1b[_0x2596('0x25')]]={'$like':'%'+_0x55df13[_0x2596('0x2c')][_0x2596('0x3c')]+'%'};return _0x55a970;}})});}_0x14d4ba=_[_0x2596('0x39')]({},_0x14d4ba,_0x55df13[_0x2596('0x3d')]);var _0x151e3d={'where':_0x14d4ba[_0x2596('0x37')]};return db[_0x2596('0x28')]['count'](_0x151e3d)[_0x2596('0x22')](function(_0xbc69d2){_0x41bd81['count']=_0xbc69d2;if(_0x55df13[_0x2596('0x2c')][_0x2596('0x3e')]){_0x14d4ba['include']=[{'all':!![]}];}return db[_0x2596('0x28')][_0x2596('0x3f')](_0x14d4ba);})[_0x2596('0x22')](function(_0x1ca6b8){_0x41bd81['rows']=_0x1ca6b8;return _0x41bd81;})[_0x2596('0x22')](respondWithFilteredResult(_0x554656,_0x14d4ba))[_0x2596('0x40')](handleError(_0x554656,null));};exports['show']=function(_0x37ef8f,_0x57fbd8){var _0x1e69aa={'raw':![],'where':{'id':_0x37ef8f[_0x2596('0x41')]['id']}},_0x3a28d3={};_0x3a28d3['model']=_[_0x2596('0x2b')](db[_0x2596('0x28')][_0x2596('0x42')]);_0x3a28d3['query']=_[_0x2596('0x2b')](_0x37ef8f['query']);_0x3a28d3[_0x2596('0x2d')]=_[_0x2596('0x2e')](_0x3a28d3[_0x2596('0x2a')],_0x3a28d3['query']);_0x1e69aa[_0x2596('0x2f')]=_[_0x2596('0x2e')](_0x3a28d3[_0x2596('0x2a')],qs['fields'](_0x37ef8f['query'][_0x2596('0x30')]));_0x1e69aa[_0x2596('0x2f')]=_0x1e69aa['attributes']['length']?_0x1e69aa[_0x2596('0x2f')]:_0x3a28d3[_0x2596('0x2a')];if(_0x37ef8f[_0x2596('0x2c')][_0x2596('0x3e')]){_0x1e69aa['include']=[{'all':!![]}];}_0x1e69aa=_[_0x2596('0x39')]({},_0x1e69aa,_0x37ef8f['options']);return db[_0x2596('0x28')][_0x2596('0x43')](_0x1e69aa)[_0x2596('0x22')](handleEntityNotFound(_0x57fbd8,null))[_0x2596('0x22')](respondWithResult(_0x57fbd8,null))[_0x2596('0x40')](handleError(_0x57fbd8,null));};exports[_0x2596('0x44')]=function(_0x78933d,_0x46976b){return db['DeskConfiguration'][_0x2596('0x44')](_0x78933d[_0x2596('0x45')],{})[_0x2596('0x22')](respondWithResult(_0x46976b,0xc9))[_0x2596('0x40')](handleError(_0x46976b,null));};exports[_0x2596('0x21')]=function(_0xf8040d,_0x1233a7){if(_0xf8040d[_0x2596('0x45')]['id']){delete _0xf8040d[_0x2596('0x45')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0xf8040d[_0x2596('0x41')]['id']}})[_0x2596('0x22')](handleEntityNotFound(_0x1233a7,null))[_0x2596('0x22')](saveUpdates(_0xf8040d['body'],null))[_0x2596('0x22')](respondWithResult(_0x1233a7,null))['catch'](handleError(_0x1233a7,null));};exports[_0x2596('0x46')]=function(_0xbb168e,_0x5b82e3){return db[_0x2596('0x28')][_0x2596('0x43')]({'where':{'id':_0xbb168e[_0x2596('0x41')]['id']}})[_0x2596('0x22')](handleEntityNotFound(_0x5b82e3,null))[_0x2596('0x22')](removeEntity(_0x5b82e3,null))[_0x2596('0x40')](handleError(_0x5b82e3,null));};exports[_0x2596('0x47')]=function(_0x23dd99,_0x335ab1,_0x2f8706){var _0x20536e={};var _0x4248ad={};var _0x32d57e;var _0x4d5c4b;return db['DeskConfiguration'][_0x2596('0x48')]({'where':{'id':_0x23dd99[_0x2596('0x41')]['id']}})[_0x2596('0x22')](handleEntityNotFound(_0x335ab1,null))[_0x2596('0x22')](function(_0x2f3b55){if(_0x2f3b55){_0x32d57e=_0x2f3b55;_0x4248ad[_0x2596('0x2a')]=_[_0x2596('0x2b')](db[_0x2596('0x49')][_0x2596('0x42')]);_0x4248ad[_0x2596('0x2c')]=_['keys'](_0x23dd99['query']);_0x4248ad[_0x2596('0x2d')]=_['intersection'](_0x4248ad[_0x2596('0x2a')],_0x4248ad[_0x2596('0x2c')]);_0x20536e[_0x2596('0x2f')]=_[_0x2596('0x2e')](_0x4248ad[_0x2596('0x2a')],qs['fields'](_0x23dd99[_0x2596('0x2c')]['fields']));_0x20536e[_0x2596('0x2f')]=_0x20536e[_0x2596('0x2f')]['length']?_0x20536e['attributes']:_0x4248ad['model'];_0x20536e[_0x2596('0x35')]=qs[_0x2596('0x36')](_0x23dd99[_0x2596('0x2c')]['sort']);_0x20536e[_0x2596('0x37')]=qs['filters'](_[_0x2596('0x38')](_0x23dd99[_0x2596('0x2c')],_0x4248ad[_0x2596('0x2d')]));if(_0x23dd99['query'][_0x2596('0x3c')]){_0x20536e[_0x2596('0x37')]=_[_0x2596('0x39')](_0x20536e[_0x2596('0x37')],{'$or':_[_0x2596('0x27')](_0x20536e[_0x2596('0x2f')],function(_0xee13c9){var _0x29f73e={};_0x29f73e[_0xee13c9]={'$like':'%'+_0x23dd99['query'][_0x2596('0x3c')]+'%'};return _0x29f73e;})});}_0x20536e=_[_0x2596('0x39')]({},_0x20536e,_0x23dd99[_0x2596('0x3d')]);return _0x32d57e['getFields'](_0x20536e);}})[_0x2596('0x22')](function(_0x36bdb0){if(_0x36bdb0){_0x4d5c4b=_0x36bdb0['length'];if(!_0x23dd99['query']['hasOwnProperty'](_0x2596('0x33'))){_0x20536e[_0x2596('0x19')]=qs[_0x2596('0x19')](_0x23dd99['query']['limit']);_0x20536e[_0x2596('0x34')]=qs[_0x2596('0x34')](_0x23dd99[_0x2596('0x2c')][_0x2596('0x34')]);}return _0x32d57e['getFields'](_0x20536e);}})['then'](function(_0x3949ba){if(_0x3949ba){return _0x3949ba?{'count':_0x4d5c4b,'rows':_0x3949ba}:null;}})[_0x2596('0x22')](respondWithResult(_0x335ab1,null))[_0x2596('0x40')](handleError(_0x335ab1,null));};exports[_0x2596('0x4a')]=function(_0x36bca9,_0x48976d,_0x2c08e9){var _0x32b54f={};var _0x5b58c4={};var _0x4e0d7b;var _0x2aaf00;return db[_0x2596('0x28')][_0x2596('0x48')]({'where':{'id':_0x36bca9['params']['id']}})[_0x2596('0x22')](handleEntityNotFound(_0x48976d,null))[_0x2596('0x22')](function(_0x3fa572){if(_0x3fa572){_0x4e0d7b=_0x3fa572;_0x5b58c4[_0x2596('0x2a')]=_['keys'](db['DeskField']['rawAttributes']);_0x5b58c4[_0x2596('0x2c')]=_[_0x2596('0x2b')](_0x36bca9[_0x2596('0x2c')]);_0x5b58c4['filters']=_[_0x2596('0x2e')](_0x5b58c4[_0x2596('0x2a')],_0x5b58c4[_0x2596('0x2c')]);_0x32b54f[_0x2596('0x2f')]=_[_0x2596('0x2e')](_0x5b58c4[_0x2596('0x2a')],qs[_0x2596('0x30')](_0x36bca9[_0x2596('0x2c')][_0x2596('0x30')]));_0x32b54f[_0x2596('0x2f')]=_0x32b54f[_0x2596('0x2f')][_0x2596('0x31')]?_0x32b54f['attributes']:_0x5b58c4[_0x2596('0x2a')];_0x32b54f[_0x2596('0x35')]=qs[_0x2596('0x36')](_0x36bca9[_0x2596('0x2c')][_0x2596('0x36')]);_0x32b54f[_0x2596('0x37')]=qs['filters'](_[_0x2596('0x38')](_0x36bca9[_0x2596('0x2c')],_0x5b58c4[_0x2596('0x2d')]));if(_0x36bca9[_0x2596('0x2c')][_0x2596('0x3c')]){_0x32b54f['where']=_[_0x2596('0x39')](_0x32b54f[_0x2596('0x37')],{'$or':_[_0x2596('0x27')](_0x32b54f[_0x2596('0x2f')],function(_0x58ddc3){var _0x3c304b={};_0x3c304b[_0x58ddc3]={'$like':'%'+_0x36bca9['query']['filter']+'%'};return _0x3c304b;})});}_0x32b54f=_['merge']({},_0x32b54f,_0x36bca9[_0x2596('0x3d')]);return _0x4e0d7b[_0x2596('0x4a')](_0x32b54f);}})['then'](function(_0x435967){if(_0x435967){_0x2aaf00=_0x435967[_0x2596('0x31')];if(!_0x36bca9[_0x2596('0x2c')][_0x2596('0x32')](_0x2596('0x33'))){_0x32b54f[_0x2596('0x19')]=qs[_0x2596('0x19')](_0x36bca9[_0x2596('0x2c')][_0x2596('0x19')]);_0x32b54f['offset']=qs['offset'](_0x36bca9[_0x2596('0x2c')]['offset']);}return _0x4e0d7b['getSubjects'](_0x32b54f);}})[_0x2596('0x22')](function(_0xe403f1){if(_0xe403f1){return _0xe403f1?{'count':_0x2aaf00,'rows':_0xe403f1}:null;}})[_0x2596('0x22')](respondWithResult(_0x48976d,null))[_0x2596('0x40')](handleError(_0x48976d,null));};exports[_0x2596('0x4b')]=function(_0x24c9fa,_0xa46978,_0x3654f5){var _0x1c76a1={};var _0x27ce64={};var _0x551a75;var _0x206e5a;return db[_0x2596('0x28')]['findOne']({'where':{'id':_0x24c9fa[_0x2596('0x41')]['id']}})[_0x2596('0x22')](handleEntityNotFound(_0xa46978,null))[_0x2596('0x22')](function(_0x106f4c){if(_0x106f4c){_0x551a75=_0x106f4c;_0x27ce64['model']=_[_0x2596('0x2b')](db['DeskField'][_0x2596('0x42')]);_0x27ce64['query']=_['keys'](_0x24c9fa['query']);_0x27ce64[_0x2596('0x2d')]=_['intersection'](_0x27ce64['model'],_0x27ce64[_0x2596('0x2c')]);_0x1c76a1[_0x2596('0x2f')]=_[_0x2596('0x2e')](_0x27ce64[_0x2596('0x2a')],qs[_0x2596('0x30')](_0x24c9fa[_0x2596('0x2c')][_0x2596('0x30')]));_0x1c76a1[_0x2596('0x2f')]=_0x1c76a1['attributes'][_0x2596('0x31')]?_0x1c76a1[_0x2596('0x2f')]:_0x27ce64[_0x2596('0x2a')];_0x1c76a1[_0x2596('0x35')]=qs[_0x2596('0x36')](_0x24c9fa[_0x2596('0x2c')]['sort']);_0x1c76a1['where']=qs['filters'](_[_0x2596('0x38')](_0x24c9fa[_0x2596('0x2c')],_0x27ce64[_0x2596('0x2d')]));if(_0x24c9fa[_0x2596('0x2c')][_0x2596('0x3c')]){_0x1c76a1['where']=_[_0x2596('0x39')](_0x1c76a1[_0x2596('0x37')],{'$or':_[_0x2596('0x27')](_0x1c76a1[_0x2596('0x2f')],function(_0xbc7d0c){var _0x154907={};_0x154907[_0xbc7d0c]={'$like':'%'+_0x24c9fa['query'][_0x2596('0x3c')]+'%'};return _0x154907;})});}_0x1c76a1=_[_0x2596('0x39')]({},_0x1c76a1,_0x24c9fa[_0x2596('0x3d')]);return _0x551a75[_0x2596('0x4b')](_0x1c76a1);}})[_0x2596('0x22')](function(_0x33cd30){if(_0x33cd30){_0x206e5a=_0x33cd30[_0x2596('0x31')];if(!_0x24c9fa['query']['hasOwnProperty']('nolimit')){_0x1c76a1['limit']=qs['limit'](_0x24c9fa['query'][_0x2596('0x19')]);_0x1c76a1['offset']=qs[_0x2596('0x34')](_0x24c9fa[_0x2596('0x2c')][_0x2596('0x34')]);}return _0x551a75[_0x2596('0x4b')](_0x1c76a1);}})['then'](function(_0x3710fc){if(_0x3710fc){return _0x3710fc?{'count':_0x206e5a,'rows':_0x3710fc}:null;}})[_0x2596('0x22')](respondWithResult(_0xa46978,null))[_0x2596('0x40')](handleError(_0xa46978,null));};exports[_0x2596('0x4c')]=function(_0x2ecd31,_0x498423,_0x5d437a){var _0x3eab36={};var _0x46b260={};var _0x407448;var _0x5ad010;return db[_0x2596('0x28')][_0x2596('0x48')]({'where':{'id':_0x2ecd31[_0x2596('0x41')]['id']}})[_0x2596('0x22')](handleEntityNotFound(_0x498423,null))[_0x2596('0x22')](function(_0xda2ea4){if(_0xda2ea4){_0x407448=_0xda2ea4;_0x46b260['model']=_[_0x2596('0x2b')](db[_0x2596('0x4d')]['rawAttributes']);_0x46b260[_0x2596('0x2c')]=_['keys'](_0x2ecd31[_0x2596('0x2c')]);_0x46b260[_0x2596('0x2d')]=_[_0x2596('0x2e')](_0x46b260[_0x2596('0x2a')],_0x46b260[_0x2596('0x2c')]);_0x3eab36[_0x2596('0x2f')]=_[_0x2596('0x2e')](_0x46b260['model'],qs[_0x2596('0x30')](_0x2ecd31[_0x2596('0x2c')][_0x2596('0x30')]));_0x3eab36[_0x2596('0x2f')]=_0x3eab36[_0x2596('0x2f')][_0x2596('0x31')]?_0x3eab36[_0x2596('0x2f')]:_0x46b260[_0x2596('0x2a')];_0x3eab36[_0x2596('0x35')]=qs[_0x2596('0x36')](_0x2ecd31['query'][_0x2596('0x36')]);_0x3eab36['where']=qs[_0x2596('0x2d')](_[_0x2596('0x38')](_0x2ecd31['query'],_0x46b260['filters']));if(_0x2ecd31[_0x2596('0x2c')][_0x2596('0x3c')]){_0x3eab36[_0x2596('0x37')]=_[_0x2596('0x39')](_0x3eab36[_0x2596('0x37')],{'$or':_[_0x2596('0x27')](_0x3eab36[_0x2596('0x2f')],function(_0x249c36){var _0x25f295={};_0x25f295[_0x249c36]={'$like':'%'+_0x2ecd31[_0x2596('0x2c')][_0x2596('0x3c')]+'%'};return _0x25f295;})});}_0x3eab36=_[_0x2596('0x39')]({},_0x3eab36,_0x2ecd31[_0x2596('0x3d')]);return _0x407448['getTags'](_0x3eab36);}})[_0x2596('0x22')](function(_0x513875){if(_0x513875){_0x5ad010=_0x513875['length'];if(!_0x2ecd31[_0x2596('0x2c')][_0x2596('0x32')]('nolimit')){_0x3eab36[_0x2596('0x19')]=qs[_0x2596('0x19')](_0x2ecd31['query'][_0x2596('0x19')]);_0x3eab36[_0x2596('0x34')]=qs['offset'](_0x2ecd31[_0x2596('0x2c')][_0x2596('0x34')]);}return _0x407448[_0x2596('0x4c')](_0x3eab36);}})[_0x2596('0x22')](function(_0x3449ae){if(_0x3449ae){return _0x3449ae?{'count':_0x5ad010,'rows':_0x3449ae}:null;}})[_0x2596('0x22')](respondWithResult(_0x498423,null))[_0x2596('0x40')](handleError(_0x498423,null));};exports[_0x2596('0x4e')]=function(_0x31425d,_0x278c07,_0x405c43){if(_0x31425d[_0x2596('0x45')]['id']){delete _0x31425d[_0x2596('0x45')]['id'];}return db[_0x2596('0x28')]['findOne']({'where':{'id':_0x31425d[_0x2596('0x41')]['id']}})['then'](handleEntityNotFound(_0x278c07,null))[_0x2596('0x22')](function(_0x45dc7f){if(_0x45dc7f){return _0x45dc7f[_0x2596('0x4e')](_0x31425d[_0x2596('0x45')][_0x2596('0x4f')]||[]);}return null;})[_0x2596('0x22')](respondWithResult(_0x278c07,null))['catch'](handleError(_0x278c07,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 806603d..e4dbd6d 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 _0xd56e=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd56e,0x1e8));var _0xed56=function(_0x3592a9,_0x3e7743){_0x3592a9=_0x3592a9-0x0;var _0x1f6f52=_0xd56e[_0x3592a9];return _0x1f6f52;};'use strict';var _=require(_0xed56('0x0'));var util=require(_0xed56('0x1'));var logger=require(_0xed56('0x2'))(_0xed56('0x3'));var moment=require(_0xed56('0x4'));var BPromise=require('bluebird');var rp=require(_0xed56('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed56('0x6'));var config=require(_0xed56('0x7'));var attributes=require(_0xed56('0x8'));module[_0xed56('0x9')]=function(_0x1dee95,_0x5839e3){return _0x1dee95[_0xed56('0xa')](_0xed56('0xb'),attributes,{'tableName':_0xed56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf930=['api','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf930,0x15b));var _0x0f93=function(_0x1e0d89,_0x4e0482){_0x1e0d89=_0x1e0d89-0x0;var _0x140d15=_0xf930[_0x1e0d89];return _0x140d15;};'use strict';var _=require(_0x0f93('0x0'));var util=require(_0x0f93('0x1'));var logger=require(_0x0f93('0x2'))(_0x0f93('0x3'));var moment=require(_0x0f93('0x4'));var BPromise=require('bluebird');var rp=require(_0x0f93('0x5'));var fs=require('fs');var path=require(_0x0f93('0x6'));var rimraf=require(_0x0f93('0x7'));var config=require(_0x0f93('0x8'));var attributes=require(_0x0f93('0x9'));module[_0x0f93('0xa')]=function(_0x1b593f,_0x5b4750){return _0x1b593f[_0x0f93('0xb')](_0x0f93('0xc'),attributes,{'tableName':_0x0f93('0xd'),'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 595a548..b16e525 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 _0x38f2=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1c699a,_0x167ed9){var _0x407285=function(_0x29ce36){while(--_0x29ce36){_0x1c699a['push'](_0x1c699a['shift']());}};_0x407285(++_0x167ed9);}(_0x38f2,0xbe));var _0x238f=function(_0x59077b,_0x5c5999){_0x59077b=_0x59077b-0x0;var _0x4f0b95=_0x38f2[_0x59077b];return _0x4f0b95;};'use strict';var _=require(_0x238f('0x0'));var util=require(_0x238f('0x1'));var moment=require(_0x238f('0x2'));var BPromise=require('bluebird');var rs=require(_0x238f('0x3'));var fs=require('fs');var Redis=require(_0x238f('0x4'));var db=require(_0x238f('0x5'))['db'];var utils=require(_0x238f('0x6'));var logger=require(_0x238f('0x7'))(_0x238f('0x8'));var config=require(_0x238f('0x9'));var jayson=require(_0x238f('0xa'));var client=jayson['client'][_0x238f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54db80,_0x3d7a28,_0x22ceaf){return new BPromise(function(_0x9a2864,_0x41e921){return client[_0x238f('0xc')](_0x54db80,_0x22ceaf)[_0x238f('0xd')](function(_0x1fa5c8){logger[_0x238f('0xe')](_0x238f('0xf'),_0x3d7a28,_0x238f('0x10'));logger['debug'](_0x238f('0x11'),_0x3d7a28,_0x238f('0x10'),JSON[_0x238f('0x12')](_0x1fa5c8));if(_0x1fa5c8[_0x238f('0x13')]){if(_0x1fa5c8['error'][_0x238f('0x14')]===0x1f4){logger[_0x238f('0x13')](_0x238f('0xf'),_0x3d7a28,_0x1fa5c8[_0x238f('0x13')]['message']);return _0x41e921(_0x1fa5c8[_0x238f('0x13')][_0x238f('0x15')]);}logger['error'](_0x238f('0xf'),_0x3d7a28,_0x1fa5c8[_0x238f('0x13')][_0x238f('0x15')]);return _0x9a2864(_0x1fa5c8[_0x238f('0x13')][_0x238f('0x15')]);}else{logger[_0x238f('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x3d7a28,_0x238f('0x10'));_0x9a2864(_0x1fa5c8[_0x238f('0x16')][_0x238f('0x15')]);}})['catch'](function(_0x559f11){logger[_0x238f('0x13')](_0x238f('0xf'),_0x3d7a28,_0x559f11);_0x41e921(_0x559f11);});});} \ No newline at end of file +var _0xa3fe=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x3560f4,_0x3bfdea){var _0x1b9e22=function(_0x383bb2){while(--_0x383bb2){_0x3560f4['push'](_0x3560f4['shift']());}};_0x1b9e22(++_0x3bfdea);}(_0xa3fe,0xd8));var _0xea3f=function(_0x149bc3,_0x4b09d8){_0x149bc3=_0x149bc3-0x0;var _0x5d33eb=_0xa3fe[_0x149bc3];return _0x5d33eb;};'use strict';var _=require(_0xea3f('0x0'));var util=require('util');var moment=require(_0xea3f('0x1'));var BPromise=require(_0xea3f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea3f('0x3'));var db=require(_0xea3f('0x4'))['db'];var utils=require(_0xea3f('0x5'));var logger=require('../../config/logger')(_0xea3f('0x6'));var config=require('../../config/environment');var jayson=require(_0xea3f('0x7'));var client=jayson[_0xea3f('0x8')][_0xea3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e494,_0x56abd6,_0x187ce0){return new BPromise(function(_0x35ba50,_0x3c4807){return client['request'](_0x49e494,_0x187ce0)['then'](function(_0x464ad4){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x56abd6,_0xea3f('0xa'));logger[_0xea3f('0xb')](_0xea3f('0xc'),_0x56abd6,'request\x20sent',JSON['stringify'](_0x464ad4));if(_0x464ad4['error']){if(_0x464ad4[_0xea3f('0xd')][_0xea3f('0xe')]===0x1f4){logger[_0xea3f('0xd')](_0xea3f('0xf'),_0x56abd6,_0x464ad4['error']['message']);return _0x3c4807(_0x464ad4['error'][_0xea3f('0x10')]);}logger[_0xea3f('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x56abd6,_0x464ad4[_0xea3f('0xd')][_0xea3f('0x10')]);return _0x35ba50(_0x464ad4['error'][_0xea3f('0x10')]);}else{logger[_0xea3f('0x11')](_0xea3f('0xf'),_0x56abd6,_0xea3f('0xa'));_0x35ba50(_0x464ad4[_0xea3f('0x12')][_0xea3f('0x10')]);}})[_0xea3f('0x13')](function(_0x2585f1){logger[_0xea3f('0xd')](_0xea3f('0xf'),_0x56abd6,_0x2585f1);_0x3c4807(_0x2585f1);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index de995e4..ff34e31 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 _0x9181=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskField.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','util','path'];(function(_0x44d385,_0x1a313a){var _0x5c2cc5=function(_0x5d1d76){while(--_0x5d1d76){_0x44d385['push'](_0x44d385['shift']());}};_0x5c2cc5(++_0x1a313a);}(_0x9181,0x166));var _0x1918=function(_0x5d540b,_0x13d07d){_0x5d540b=_0x5d540b-0x0;var _0x3196e3=_0x9181[_0x5d540b];return _0x3196e3;};'use strict';var multer=require('multer');var util=require(_0x1918('0x0'));var path=require(_0x1918('0x1'));var timeout=require(_0x1918('0x2'));var express=require(_0x1918('0x3'));var router=express[_0x1918('0x4')]();var fs_extra=require(_0x1918('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1918('0x6'));var config=require('../../config/environment');var controller=require(_0x1918('0x7'));router[_0x1918('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1918('0x8')](_0x1918('0x9'),auth['isAuthenticated'](),controller[_0x1918('0xa')]);router[_0x1918('0xb')]('/',auth[_0x1918('0xc')](),controller[_0x1918('0xd')]);router[_0x1918('0xe')]('/:id',auth[_0x1918('0xc')](),controller[_0x1918('0xf')]);router[_0x1918('0x10')](_0x1918('0x9'),auth[_0x1918('0xc')](),controller['destroy']);module[_0x1918('0x11')]=router; \ No newline at end of file +var _0xdedd=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','create','put','update'];(function(_0x4a4f21,_0x5d2244){var _0x4380ee=function(_0x17c882){while(--_0x17c882){_0x4a4f21['push'](_0x4a4f21['shift']());}};_0x4380ee(++_0x5d2244);}(_0xdedd,0x1a1));var _0xdded=function(_0x867f6b,_0x3a0435){_0x867f6b=_0x867f6b-0x0;var _0x3d2f6c=_0xdedd[_0x867f6b];return _0x3d2f6c;};'use strict';var multer=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var path=require(_0xdded('0x2'));var timeout=require(_0xdded('0x3'));var express=require('express');var router=express[_0xdded('0x4')]();var fs_extra=require(_0xdded('0x5'));var auth=require(_0xdded('0x6'));var interaction=require(_0xdded('0x7'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0xdded('0x8')]('/',auth[_0xdded('0x9')](),controller[_0xdded('0xa')]);router[_0xdded('0x8')]('/:id',auth[_0xdded('0x9')](),controller[_0xdded('0xb')]);router['post']('/',auth[_0xdded('0x9')](),controller[_0xdded('0xc')]);router[_0xdded('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xdded('0xe')]);router[_0xdded('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xdded('0x10')]);module[_0xdded('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 29fbce5..4ebaed6 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 _0x3e4e=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2a05bf,_0x55e3a4){var _0x38a62e=function(_0x28d868){while(--_0x28d868){_0x2a05bf['push'](_0x2a05bf['shift']());}};_0x38a62e(++_0x55e3a4);}(_0x3e4e,0x1c5));var _0xe3e4=function(_0x4f2edd,_0x9955df){_0x4f2edd=_0x4f2edd-0x0;var _0x196b9f=_0x3e4e[_0x4f2edd];return _0x196b9f;};'use strict';var Sequelize=require(_0xe3e4('0x0'));module[_0xe3e4('0x1')]={'type':{'type':Sequelize[_0xe3e4('0x2')](_0xe3e4('0x3'),_0xe3e4('0x4'),_0xe3e4('0x5'),'keyValue',_0xe3e4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe3e4('0x7')]},'key':{'type':Sequelize[_0xe3e4('0x7')]},'keyType':{'type':Sequelize[_0xe3e4('0x2')](_0xe3e4('0x3'),'variable',_0xe3e4('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe3e4('0x7')]},'nameField':{'type':Sequelize[_0xe3e4('0x7')]},'customField':{'type':Sequelize[_0xe3e4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbf5d=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2a400b,_0xdb5833){var _0x57512c=function(_0x87f884){while(--_0x87f884){_0x2a400b['push'](_0x2a400b['shift']());}};_0x57512c(++_0xdb5833);}(_0xbf5d,0x174));var _0xdbf5=function(_0x32d1f3,_0x543e0a){_0x32d1f3=_0x32d1f3-0x0;var _0x25e385=_0xbf5d[_0x32d1f3];return _0x25e385;};'use strict';var Sequelize=require(_0xdbf5('0x0'));module[_0xdbf5('0x1')]={'type':{'type':Sequelize[_0xdbf5('0x2')](_0xdbf5('0x3'),_0xdbf5('0x4'),_0xdbf5('0x5'),_0xdbf5('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xdbf5('0x7')]},'key':{'type':Sequelize[_0xdbf5('0x7')]},'keyType':{'type':Sequelize[_0xdbf5('0x2')](_0xdbf5('0x3'),'variable',_0xdbf5('0x5'))},'keyContent':{'type':Sequelize[_0xdbf5('0x7')]},'idField':{'type':Sequelize[_0xdbf5('0x7')]},'nameField':{'type':Sequelize[_0xdbf5('0x7')]},'customField':{'type':Sequelize[_0xdbf5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdbf5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 8640fa1..ac6a157 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 _0xc9c3=['options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','filter','where','merge'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc9c3,0x96));var _0x3c9c=function(_0x27edb3,_0x1a7a27){_0x27edb3=_0x27edb3-0x0;var _0x4d3118=_0xc9c3[_0x27edb3];return _0x4d3118;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];function respondWithStatusCode(_0x3f464d,_0x4a17ed){_0x4a17ed=_0x4a17ed||0xcc;return function(_0x50cf96){if(_0x50cf96){return _0x3f464d['sendStatus'](_0x4a17ed);}return _0x3f464d[_0x3c9c('0x18')](_0x4a17ed)['end']();};}function respondWithResult(_0x5e8c0e,_0x53b3ca){_0x53b3ca=_0x53b3ca||0xc8;return function(_0x22c495){if(_0x22c495){return _0x5e8c0e['status'](_0x53b3ca)[_0x3c9c('0x19')](_0x22c495);}};}function respondWithFilteredResult(_0xf16337,_0x1f725b){return function(_0x824e63){if(_0x824e63){var _0x4a43d2=typeof _0x1f725b[_0x3c9c('0x1a')]==='undefined'&&typeof _0x1f725b['limit']==='undefined';var _0x3200a3=_0x824e63[_0x3c9c('0x1b')];var _0x216fd8=_0x4a43d2?0x0:_0x1f725b[_0x3c9c('0x1a')];var _0x3e63e0=_0x4a43d2?_0x824e63[_0x3c9c('0x1b')]:_0x1f725b[_0x3c9c('0x1a')]+_0x1f725b['limit'];var _0x15a90a;if(_0x3e63e0>=_0x3200a3){_0x3e63e0=_0x3200a3;_0x15a90a=0xc8;}else{_0x15a90a=0xce;}_0xf16337['status'](_0x15a90a);return _0xf16337[_0x3c9c('0x1c')]('Content-Range',_0x216fd8+'-'+_0x3e63e0+'/'+_0x3200a3)[_0x3c9c('0x19')](_0x824e63);}return null;};}function patchUpdates(_0x1152d5){return function(_0x5f51fb){try{jsonpatch[_0x3c9c('0x1d')](_0x5f51fb,_0x1152d5,!![]);}catch(_0x29e4ac){return BPromise[_0x3c9c('0x1e')](_0x29e4ac);}return _0x5f51fb['save']();};}function saveUpdates(_0x3faad1,_0x249747){return function(_0x2d5ffc){if(_0x2d5ffc){return _0x2d5ffc[_0x3c9c('0x1f')](_0x3faad1)[_0x3c9c('0x20')](function(_0x3bc5c4){return _0x3bc5c4;});}return null;};}function removeEntity(_0x338c2d,_0x32e4c2){return function(_0x509bf7){if(_0x509bf7){return _0x509bf7[_0x3c9c('0x21')]()['then'](function(){_0x338c2d[_0x3c9c('0x18')](0xcc)[_0x3c9c('0x22')]();});}};}function handleEntityNotFound(_0x4ca078,_0x527bb9){return function(_0x379880){if(!_0x379880){_0x4ca078[_0x3c9c('0x23')](0x194);}return _0x379880;};}function handleError(_0x1b57ec,_0x43d1f0){_0x43d1f0=_0x43d1f0||0x1f4;return function(_0x4c283d){logger[_0x3c9c('0x24')](_0x4c283d[_0x3c9c('0x25')]);if(_0x4c283d['name']){delete _0x4c283d[_0x3c9c('0x26')];}_0x1b57ec['status'](_0x43d1f0)['send'](_0x4c283d);};}exports[_0x3c9c('0x27')]=function(_0x39ea8d,_0x333f2b){var _0x248de1={},_0x7bdf33={},_0x5da4e9={'count':0x0,'rows':[]};var _0x18eebd=_['map'](db[_0x3c9c('0x28')][_0x3c9c('0x29')],function(_0x4a0644){return{'name':_0x4a0644[_0x3c9c('0x2a')],'type':_0x4a0644['type'][_0x3c9c('0x2b')]};});_0x7bdf33[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x18eebd,_0x3c9c('0x26'));_0x7bdf33[_0x3c9c('0x2e')]=_[_0x3c9c('0x2f')](_0x39ea8d[_0x3c9c('0x2e')]);_0x7bdf33[_0x3c9c('0x30')]=_['intersection'](_0x7bdf33[_0x3c9c('0x2c')],_0x7bdf33[_0x3c9c('0x2e')]);_0x248de1[_0x3c9c('0x31')]=_[_0x3c9c('0x32')](_0x7bdf33[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x248de1[_0x3c9c('0x31')]=_0x248de1[_0x3c9c('0x31')][_0x3c9c('0x34')]?_0x248de1[_0x3c9c('0x31')]:_0x7bdf33[_0x3c9c('0x2c')];if(!_0x39ea8d[_0x3c9c('0x2e')]['hasOwnProperty'](_0x3c9c('0x35'))){_0x248de1[_0x3c9c('0x36')]=qs[_0x3c9c('0x36')](_0x39ea8d['query'][_0x3c9c('0x36')]);_0x248de1[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x39ea8d[_0x3c9c('0x2e')]['offset']);}_0x248de1['order']=qs[_0x3c9c('0x37')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x37')]);_0x248de1['where']=qs['filters'](_[_0x3c9c('0x38')](_0x39ea8d['query'],_0x7bdf33['filters']),_0x18eebd);if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]){_0x248de1[_0x3c9c('0x3a')]=_['merge'](_0x248de1[_0x3c9c('0x3a')],{'$or':_[_0x3c9c('0x2d')](_0x18eebd,function(_0x4024aa){if(_0x4024aa['type']!=='VIRTUAL'){var _0x4826d3={};_0x4826d3[_0x4024aa[_0x3c9c('0x26')]]={'$like':'%'+_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]+'%'};return _0x4826d3;}})});}_0x248de1=_[_0x3c9c('0x3b')]({},_0x248de1,_0x39ea8d[_0x3c9c('0x3c')]);var _0x1125ff={'where':_0x248de1['where']};return db['DeskField'][_0x3c9c('0x1b')](_0x1125ff)[_0x3c9c('0x20')](function(_0xe23844){_0x5da4e9['count']=_0xe23844;if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x248de1[_0x3c9c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x248de1);})[_0x3c9c('0x20')](function(_0xdbac2a){_0x5da4e9[_0x3c9c('0x3f')]=_0xdbac2a;return _0x5da4e9;})['then'](respondWithFilteredResult(_0x333f2b,_0x248de1))[_0x3c9c('0x40')](handleError(_0x333f2b,null));};exports[_0x3c9c('0x41')]=function(_0xd81ea4,_0x3dbfc7){var _0x5be9a3={'raw':!![],'where':{'id':_0xd81ea4[_0x3c9c('0x42')]['id']}},_0x412a21={};_0x412a21['model']=_['keys'](db[_0x3c9c('0x28')][_0x3c9c('0x29')]);_0x412a21['query']=_[_0x3c9c('0x2f')](_0xd81ea4[_0x3c9c('0x2e')]);_0x412a21[_0x3c9c('0x30')]=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],_0x412a21[_0x3c9c('0x2e')]);_0x5be9a3['attributes']=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x5be9a3['attributes']=_0x5be9a3['attributes'][_0x3c9c('0x34')]?_0x5be9a3[_0x3c9c('0x31')]:_0x412a21[_0x3c9c('0x2c')];if(_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x5be9a3['include']=[{'all':!![]}];}_0x5be9a3=_[_0x3c9c('0x3b')]({},_0x5be9a3,_0xd81ea4[_0x3c9c('0x3c')]);return db[_0x3c9c('0x28')][_0x3c9c('0x43')](_0x5be9a3)[_0x3c9c('0x20')](handleEntityNotFound(_0x3dbfc7,null))['then'](respondWithResult(_0x3dbfc7,null))[_0x3c9c('0x40')](handleError(_0x3dbfc7,null));};exports[_0x3c9c('0x44')]=function(_0x1804e3,_0x24b1f0){return db[_0x3c9c('0x28')][_0x3c9c('0x44')](_0x1804e3[_0x3c9c('0x45')],{})['then'](respondWithResult(_0x24b1f0,0xc9))[_0x3c9c('0x40')](handleError(_0x24b1f0,null));};exports[_0x3c9c('0x1f')]=function(_0xbcf5fb,_0x278f77){if(_0xbcf5fb[_0x3c9c('0x45')]['id']){delete _0xbcf5fb[_0x3c9c('0x45')]['id'];}return db['DeskField'][_0x3c9c('0x43')]({'where':{'id':_0xbcf5fb[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x278f77,null))[_0x3c9c('0x20')](saveUpdates(_0xbcf5fb[_0x3c9c('0x45')],null))[_0x3c9c('0x20')](respondWithResult(_0x278f77,null))[_0x3c9c('0x40')](handleError(_0x278f77,null));};exports[_0x3c9c('0x21')]=function(_0xb62338,_0x31e63d){return db[_0x3c9c('0x28')][_0x3c9c('0x43')]({'where':{'id':_0xb62338[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x31e63d,null))[_0x3c9c('0x20')](removeEntity(_0x31e63d,null))[_0x3c9c('0x40')](handleError(_0x31e63d,null));}; \ No newline at end of file +var _0xc7a3=['limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5f0627,_0x72504a){var _0x490fe6=function(_0x421e95){while(--_0x421e95){_0x5f0627['push'](_0x5f0627['shift']());}};_0x490fe6(++_0x72504a);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x4f6afe,_0x44a4ff){_0x4f6afe=_0x4f6afe-0x0;var _0x5256f8=_0xc7a3[_0x4f6afe];return _0x5256f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c7a('0x0'));var zipdir=require(_0x3c7a('0x1'));var jsonpatch=require(_0x3c7a('0x2'));var rp=require(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var Mustache=require('mustache');var util=require(_0x3c7a('0x6'));var path=require(_0x3c7a('0x7'));var sox=require('sox');var csv=require(_0x3c7a('0x8'));var ejs=require(_0x3c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x3c7a('0xa'));var _=require('lodash');var squel=require(_0x3c7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c7a('0x8'));var querystring=require(_0x3c7a('0xd'));var Papa=require(_0x3c7a('0xe'));var Redis=require('ioredis');var authService=require(_0x3c7a('0xf'));var qs=require(_0x3c7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7a('0x11'));var logger=require('../../config/logger')(_0x3c7a('0x12'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x13'));var licenseUtil=require(_0x3c7a('0x14'));var db=require(_0x3c7a('0x15'))['db'];function respondWithStatusCode(_0x16ea63,_0x3d47c3){_0x3d47c3=_0x3d47c3||0xcc;return function(_0x53e5d7){if(_0x53e5d7){return _0x16ea63[_0x3c7a('0x16')](_0x3d47c3);}return _0x16ea63[_0x3c7a('0x17')](_0x3d47c3)[_0x3c7a('0x18')]();};}function respondWithResult(_0x36185c,_0x24d188){_0x24d188=_0x24d188||0xc8;return function(_0x4e6ca5){if(_0x4e6ca5){return _0x36185c[_0x3c7a('0x17')](_0x24d188)[_0x3c7a('0x19')](_0x4e6ca5);}};}function respondWithFilteredResult(_0x5af0a6,_0x539270){return function(_0x3044e6){if(_0x3044e6){var _0xb9201c=typeof _0x539270[_0x3c7a('0x1a')]==='undefined'&&typeof _0x539270[_0x3c7a('0x1b')]==='undefined';var _0x74fd1e=_0x3044e6[_0x3c7a('0x1c')];var _0x36e8c2=_0xb9201c?0x0:_0x539270[_0x3c7a('0x1a')];var _0x3cb5bf=_0xb9201c?_0x3044e6[_0x3c7a('0x1c')]:_0x539270['offset']+_0x539270[_0x3c7a('0x1b')];var _0x2db9df;if(_0x3cb5bf>=_0x74fd1e){_0x3cb5bf=_0x74fd1e;_0x2db9df=0xc8;}else{_0x2db9df=0xce;}_0x5af0a6[_0x3c7a('0x17')](_0x2db9df);return _0x5af0a6[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x36e8c2+'-'+_0x3cb5bf+'/'+_0x74fd1e)[_0x3c7a('0x19')](_0x3044e6);}return null;};}function patchUpdates(_0x11a06b){return function(_0x34f4a6){try{jsonpatch[_0x3c7a('0x1f')](_0x34f4a6,_0x11a06b,!![]);}catch(_0x544742){return BPromise[_0x3c7a('0x20')](_0x544742);}return _0x34f4a6['save']();};}function saveUpdates(_0x3c75ff,_0x557518){return function(_0x40d24e){if(_0x40d24e){return _0x40d24e[_0x3c7a('0x21')](_0x3c75ff)[_0x3c7a('0x22')](function(_0x7dbe38){return _0x7dbe38;});}return null;};}function removeEntity(_0x283568,_0x245dde){return function(_0x8251d4){if(_0x8251d4){return _0x8251d4[_0x3c7a('0x23')]()[_0x3c7a('0x22')](function(){_0x283568[_0x3c7a('0x17')](0xcc)[_0x3c7a('0x18')]();});}};}function handleEntityNotFound(_0x317fbd,_0x56539f){return function(_0x3984a1){if(!_0x3984a1){_0x317fbd[_0x3c7a('0x16')](0x194);}return _0x3984a1;};}function handleError(_0x37cc40,_0x3829de){_0x3829de=_0x3829de||0x1f4;return function(_0x9b910c){logger[_0x3c7a('0x24')](_0x9b910c[_0x3c7a('0x25')]);if(_0x9b910c[_0x3c7a('0x26')]){delete _0x9b910c['name'];}_0x37cc40[_0x3c7a('0x17')](_0x3829de)[_0x3c7a('0x27')](_0x9b910c);};}exports[_0x3c7a('0x28')]=function(_0x197012,_0x33065b){var _0x1a96a0={},_0xccf304={},_0x1ff595={'count':0x0,'rows':[]};var _0x508d2e=_[_0x3c7a('0x29')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')],function(_0x18a346){return{'name':_0x18a346[_0x3c7a('0x2c')],'type':_0x18a346[_0x3c7a('0x2d')][_0x3c7a('0x2e')]};});_0xccf304[_0x3c7a('0x2f')]=_[_0x3c7a('0x29')](_0x508d2e,_0x3c7a('0x26'));_0xccf304[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x197012[_0x3c7a('0x30')]);_0xccf304['filters']=_['intersection'](_0xccf304['model'],_0xccf304['query']);_0x1a96a0[_0x3c7a('0x32')]=_[_0x3c7a('0x33')](_0xccf304[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x1a96a0[_0x3c7a('0x32')]=_0x1a96a0[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x1a96a0[_0x3c7a('0x32')]:_0xccf304[_0x3c7a('0x2f')];if(!_0x197012[_0x3c7a('0x30')][_0x3c7a('0x36')](_0x3c7a('0x37'))){_0x1a96a0['limit']=qs[_0x3c7a('0x1b')](_0x197012[_0x3c7a('0x30')]['limit']);_0x1a96a0[_0x3c7a('0x1a')]=qs['offset'](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x1a')]);}_0x1a96a0['order']=qs[_0x3c7a('0x38')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x38')]);_0x1a96a0[_0x3c7a('0x39')]=qs[_0x3c7a('0x3a')](_[_0x3c7a('0x3b')](_0x197012[_0x3c7a('0x30')],_0xccf304[_0x3c7a('0x3a')]),_0x508d2e);if(_0x197012[_0x3c7a('0x30')][_0x3c7a('0x3c')]){_0x1a96a0['where']=_[_0x3c7a('0x3d')](_0x1a96a0[_0x3c7a('0x39')],{'$or':_[_0x3c7a('0x29')](_0x508d2e,function(_0x43c236){if(_0x43c236[_0x3c7a('0x2d')]!==_0x3c7a('0x3e')){var _0x101e5d={};_0x101e5d[_0x43c236[_0x3c7a('0x26')]]={'$like':'%'+_0x197012['query'][_0x3c7a('0x3c')]+'%'};return _0x101e5d;}})});}_0x1a96a0=_[_0x3c7a('0x3d')]({},_0x1a96a0,_0x197012['options']);var _0x442087={'where':_0x1a96a0['where']};return db['DeskField']['count'](_0x442087)['then'](function(_0x44e935){_0x1ff595[_0x3c7a('0x1c')]=_0x44e935;if(_0x197012[_0x3c7a('0x30')]['includeAll']){_0x1a96a0[_0x3c7a('0x3f')]=[{'all':!![]}];}return db[_0x3c7a('0x2a')]['findAll'](_0x1a96a0);})['then'](function(_0x491335){_0x1ff595[_0x3c7a('0x40')]=_0x491335;return _0x1ff595;})[_0x3c7a('0x22')](respondWithFilteredResult(_0x33065b,_0x1a96a0))[_0x3c7a('0x41')](handleError(_0x33065b,null));};exports[_0x3c7a('0x42')]=function(_0x8d805a,_0x3e6a70){var _0x3f6060={'raw':!![],'where':{'id':_0x8d805a[_0x3c7a('0x43')]['id']}},_0x302556={};_0x302556[_0x3c7a('0x2f')]=_[_0x3c7a('0x31')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')]);_0x302556[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x8d805a['query']);_0x302556[_0x3c7a('0x3a')]=_[_0x3c7a('0x33')](_0x302556['model'],_0x302556['query']);_0x3f6060['attributes']=_[_0x3c7a('0x33')](_0x302556[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x8d805a[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x3f6060[_0x3c7a('0x32')]=_0x3f6060[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x3f6060[_0x3c7a('0x32')]:_0x302556[_0x3c7a('0x2f')];if(_0x8d805a[_0x3c7a('0x30')]['includeAll']){_0x3f6060['include']=[{'all':!![]}];}_0x3f6060=_['merge']({},_0x3f6060,_0x8d805a[_0x3c7a('0x44')]);return db[_0x3c7a('0x2a')][_0x3c7a('0x45')](_0x3f6060)[_0x3c7a('0x22')](handleEntityNotFound(_0x3e6a70,null))[_0x3c7a('0x22')](respondWithResult(_0x3e6a70,null))['catch'](handleError(_0x3e6a70,null));};exports[_0x3c7a('0x46')]=function(_0x12b69a,_0x2eb9e2){return db[_0x3c7a('0x2a')][_0x3c7a('0x46')](_0x12b69a[_0x3c7a('0x47')],{})[_0x3c7a('0x22')](respondWithResult(_0x2eb9e2,0xc9))['catch'](handleError(_0x2eb9e2,null));};exports['update']=function(_0x420fa7,_0x350ea7){if(_0x420fa7[_0x3c7a('0x47')]['id']){delete _0x420fa7[_0x3c7a('0x47')]['id'];}return db[_0x3c7a('0x2a')][_0x3c7a('0x45')]({'where':{'id':_0x420fa7['params']['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x350ea7,null))['then'](saveUpdates(_0x420fa7['body'],null))[_0x3c7a('0x22')](respondWithResult(_0x350ea7,null))[_0x3c7a('0x41')](handleError(_0x350ea7,null));};exports[_0x3c7a('0x23')]=function(_0x50b5e4,_0x5759a0){return db['DeskField']['find']({'where':{'id':_0x50b5e4[_0x3c7a('0x43')]['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x5759a0,null))[_0x3c7a('0x22')](removeEntity(_0x5759a0,null))[_0x3c7a('0x41')](handleError(_0x5759a0,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f028224..14fbfed 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 _0x0d6f=['../../config/environment','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e3ce8,_0x4fcfd6){var _0x867cfd=function(_0x481d5b){while(--_0x481d5b){_0x5e3ce8['push'](_0x5e3ce8['shift']());}};_0x867cfd(++_0x4fcfd6);}(_0x0d6f,0x127));var _0xf0d6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0d6f[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xf0d6('0x0'));var util=require(_0xf0d6('0x1'));var logger=require(_0xf0d6('0x2'))(_0xf0d6('0x3'));var moment=require(_0xf0d6('0x4'));var BPromise=require(_0xf0d6('0x5'));var rp=require(_0xf0d6('0x6'));var fs=require('fs');var path=require(_0xf0d6('0x7'));var rimraf=require(_0xf0d6('0x8'));var config=require(_0xf0d6('0x9'));var attributes=require('./intDeskField.attributes');module[_0xf0d6('0xa')]=function(_0x384403,_0x127a7d){return _0x384403[_0xf0d6('0xb')]('DeskField',attributes,{'tableName':_0xf0d6('0xc'),'paranoid':![],'indexes':[{'name':_0xf0d6('0xd'),'fields':[_0xf0d6('0xe'),_0xf0d6('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc8bb=['idField','FieldId','lodash','moment','request-promise','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x59ea0a,_0x242bbf){var _0x1f1b87=function(_0x1b5389){while(--_0x1b5389){_0x59ea0a['push'](_0x59ea0a['shift']());}};_0x1f1b87(++_0x242bbf);}(_0xc8bb,0xf9));var _0xbc8b=function(_0x3b7f18,_0x1a2fa4){_0x3b7f18=_0x3b7f18-0x0;var _0x5ef112=_0xc8bb[_0x3b7f18];return _0x5ef112;};'use strict';var _=require(_0xbc8b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc8b('0x1'));var BPromise=require('bluebird');var rp=require(_0xbc8b('0x2'));var fs=require('fs');var path=require(_0xbc8b('0x3'));var rimraf=require(_0xbc8b('0x4'));var config=require(_0xbc8b('0x5'));var attributes=require('./intDeskField.attributes');module[_0xbc8b('0x6')]=function(_0x4612bc,_0x219732){return _0x4612bc[_0xbc8b('0x7')](_0xbc8b('0x8'),attributes,{'tableName':_0xbc8b('0x9'),'paranoid':![],'indexes':[{'name':_0xbc8b('0xa'),'fields':[_0xbc8b('0xb'),_0xbc8b('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 5605739..b3a7d47 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 _0x2e2f=['request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','DeskField,\x20%s,\x20%s','debug'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x2e2f,0x77));var _0xf2e2=function(_0xd746ed,_0x81920c){_0xd746ed=_0xd746ed-0x0;var _0x5ef2a6=_0x2e2f[_0xd746ed];return _0x5ef2a6;};'use strict';var _=require(_0xf2e2('0x0'));var util=require(_0xf2e2('0x1'));var moment=require(_0xf2e2('0x2'));var BPromise=require(_0xf2e2('0x3'));var rs=require(_0xf2e2('0x4'));var fs=require('fs');var Redis=require(_0xf2e2('0x5'));var db=require(_0xf2e2('0x6'))['db'];var utils=require(_0xf2e2('0x7'));var logger=require(_0xf2e2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf2e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5107dd,_0x35ba45,_0x6e9705){return new BPromise(function(_0x4291f7,_0xc3dc90){return client[_0xf2e2('0xa')](_0x5107dd,_0x6e9705)['then'](function(_0x4caa96){logger[_0xf2e2('0xb')](_0xf2e2('0xc'),_0x35ba45,'request\x20sent');logger[_0xf2e2('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x35ba45,_0xf2e2('0xe'),JSON['stringify'](_0x4caa96));if(_0x4caa96[_0xf2e2('0xf')]){if(_0x4caa96[_0xf2e2('0xf')][_0xf2e2('0x10')]===0x1f4){logger[_0xf2e2('0xf')](_0xf2e2('0xc'),_0x35ba45,_0x4caa96['error'][_0xf2e2('0x11')]);return _0xc3dc90(_0x4caa96[_0xf2e2('0xf')][_0xf2e2('0x11')]);}logger[_0xf2e2('0xf')](_0xf2e2('0xc'),_0x35ba45,_0x4caa96[_0xf2e2('0xf')][_0xf2e2('0x11')]);return _0x4291f7(_0x4caa96['error']['message']);}else{logger[_0xf2e2('0xb')](_0xf2e2('0xc'),_0x35ba45,_0xf2e2('0xe'));_0x4291f7(_0x4caa96['result'][_0xf2e2('0x11')]);}})[_0xf2e2('0x12')](function(_0x38104f){logger[_0xf2e2('0xf')](_0xf2e2('0xc'),_0x35ba45,_0x38104f);_0xc3dc90(_0x38104f);});});} \ No newline at end of file +var _0xa572=['info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x807631,_0x4fd4f9){var _0x1dae1f=function(_0x28364f){while(--_0x28364f){_0x807631['push'](_0x807631['shift']());}};_0x1dae1f(++_0x4fd4f9);}(_0xa572,0xfa));var _0x2a57=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xa572[_0x4914ad];return _0x3cd61f;};'use strict';var _=require(_0x2a57('0x0'));var util=require(_0x2a57('0x1'));var moment=require(_0x2a57('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a57('0x3'));var fs=require('fs');var Redis=require(_0x2a57('0x4'));var db=require(_0x2a57('0x5'))['db'];var utils=require(_0x2a57('0x6'));var logger=require(_0x2a57('0x7'))(_0x2a57('0x8'));var config=require(_0x2a57('0x9'));var jayson=require(_0x2a57('0xa'));var client=jayson['client'][_0x2a57('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d14ee,_0x25fcda,_0xb2ecc9){return new BPromise(function(_0x38ab4c,_0x58403e){return client[_0x2a57('0xc')](_0x1d14ee,_0xb2ecc9)[_0x2a57('0xd')](function(_0xd5e12){logger[_0x2a57('0xe')](_0x2a57('0xf'),_0x25fcda,'request\x20sent');logger[_0x2a57('0x10')](_0x2a57('0x11'),_0x25fcda,_0x2a57('0x12'),JSON[_0x2a57('0x13')](_0xd5e12));if(_0xd5e12['error']){if(_0xd5e12[_0x2a57('0x14')][_0x2a57('0x15')]===0x1f4){logger[_0x2a57('0x14')](_0x2a57('0xf'),_0x25fcda,_0xd5e12[_0x2a57('0x14')]['message']);return _0x58403e(_0xd5e12['error'][_0x2a57('0x16')]);}logger['error'](_0x2a57('0xf'),_0x25fcda,_0xd5e12[_0x2a57('0x14')]['message']);return _0x38ab4c(_0xd5e12[_0x2a57('0x14')][_0x2a57('0x16')]);}else{logger[_0x2a57('0xe')](_0x2a57('0xf'),_0x25fcda,_0x2a57('0x12'));_0x38ab4c(_0xd5e12[_0x2a57('0x17')][_0x2a57('0x16')]);}})['catch'](function(_0x5d13e6){logger[_0x2a57('0x14')](_0x2a57('0xf'),_0x25fcda,_0x5d13e6);_0x58403e(_0x5d13e6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 485fe13..bfc8cdf 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 _0x2318=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','/:id','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','update','destroy','exports','multer'];(function(_0x163d5f,_0x15ef60){var _0x2cbcf3=function(_0x3a16f0){while(--_0x3a16f0){_0x163d5f['push'](_0x163d5f['shift']());}};_0x2cbcf3(++_0x15ef60);}(_0x2318,0xa0));var _0x8231=function(_0x333aa2,_0x3f2d95){_0x333aa2=_0x333aa2-0x0;var _0x338bc4=_0x2318[_0x333aa2];return _0x338bc4;};'use strict';var multer=require(_0x8231('0x0'));var util=require(_0x8231('0x1'));var path=require(_0x8231('0x2'));var timeout=require(_0x8231('0x3'));var express=require(_0x8231('0x4'));var router=express[_0x8231('0x5')]();var fs_extra=require(_0x8231('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8231('0x7'));var config=require('../../config/environment');var controller=require(_0x8231('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8231('0x9')](_0x8231('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8231('0x9')](_0x8231('0xb'),auth['isAuthenticated'](),controller[_0x8231('0xc')]);router[_0x8231('0x9')](_0x8231('0xd'),auth[_0x8231('0xe')](),controller[_0x8231('0xf')]);router[_0x8231('0x10')]('/',auth[_0x8231('0xe')](),controller[_0x8231('0x11')]);router[_0x8231('0x10')]('/:id/configurations',auth[_0x8231('0xe')](),controller[_0x8231('0x12')]);router[_0x8231('0x13')]('/:id',auth[_0x8231('0xe')](),controller[_0x8231('0x14')]);router['delete'](_0x8231('0xa'),auth[_0x8231('0xe')](),controller[_0x8231('0x15')]);module[_0x8231('0x16')]=router; \ No newline at end of file +var _0xc087=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','destroy','multer','util','path'];(function(_0x349d9c,_0x5db3b1){var _0x502b45=function(_0x3111f9){while(--_0x3111f9){_0x349d9c['push'](_0x349d9c['shift']());}};_0x502b45(++_0x5db3b1);}(_0xc087,0x1e1));var _0x7c08=function(_0x2f2a6f,_0xe63e10){_0x2f2a6f=_0x2f2a6f-0x0;var _0x14441d=_0xc087[_0x2f2a6f];return _0x14441d;};'use strict';var multer=require(_0x7c08('0x0'));var util=require(_0x7c08('0x1'));var path=require(_0x7c08('0x2'));var timeout=require(_0x7c08('0x3'));var express=require(_0x7c08('0x4'));var router=express[_0x7c08('0x5')]();var fs_extra=require(_0x7c08('0x6'));var auth=require(_0x7c08('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7c08('0x8'));router[_0x7c08('0x9')]('/',auth[_0x7c08('0xa')](),controller['index']);router[_0x7c08('0x9')](_0x7c08('0xb'),auth['isAuthenticated'](),controller[_0x7c08('0xc')]);router[_0x7c08('0x9')](_0x7c08('0xd'),auth[_0x7c08('0xa')](),controller['getConfigurations']);router['get'](_0x7c08('0xe'),auth['isAuthenticated'](),controller[_0x7c08('0xf')]);router['post']('/',auth[_0x7c08('0xa')](),controller[_0x7c08('0x10')]);router[_0x7c08('0x11')](_0x7c08('0xd'),auth[_0x7c08('0xa')](),controller[_0x7c08('0x12')]);router[_0x7c08('0x13')](_0x7c08('0xb'),auth['isAuthenticated'](),controller[_0x7c08('0x14')]);router['delete'](_0x7c08('0xb'),auth[_0x7c08('0xa')](),controller[_0x7c08('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index adbea54..6314c31 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 _0xdaab=['STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdaab,0xa2));var _0xbdaa=function(_0x1c184b,_0x4d61b4){_0x1c184b=_0x1c184b-0x0;var _0x22bcf0=_0xdaab[_0x1c184b];return _0x22bcf0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbdaa('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbdaa('0x0')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xbdaa('0x0')]},'clientSecret':{'type':Sequelize[_0xbdaa('0x0')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xbdaa('0x0')]}}; \ No newline at end of file +var _0xf628=['STRING','sequelize'];(function(_0x10ed6e,_0x546fd8){var _0x326a39=function(_0x370be2){while(--_0x370be2){_0x10ed6e['push'](_0x10ed6e['shift']());}};_0x326a39(++_0x546fd8);}(_0xf628,0x193));var _0x8f62=function(_0x5ade28,_0xf67286){_0x5ade28=_0x5ade28-0x0;var _0x124865=_0xf628[_0x5ade28];return _0x124865;};'use strict';var Sequelize=require(_0x8f62('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f62('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8f62('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x8f62('0x1')]},'clientId':{'type':Sequelize[_0x8f62('0x1')]},'clientSecret':{'type':Sequelize[_0x8f62('0x1')]},'serverUrl':{'type':Sequelize[_0x8f62('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8f62('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 04682e9..5af5eaf 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 _0xf9bb=['include','find','create','body','update','catch','getConfigurations','findOne','Dynamics365Configuration','order','pick','nolimit','addConfiguration','AccountId','Subjects','channel','Dynamics365Field','getFields','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','substring','lastIndexOf','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','findAll','rows','show','params'];(function(_0x2e4426,_0x488dc1){var _0x7f6b47=function(_0x1e4967){while(--_0x1e4967){_0x2e4426['push'](_0x2e4426['shift']());}};_0x7f6b47(++_0x488dc1);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x433d65,_0x5d119b){_0x433d65=_0x433d65-0x0;var _0x24799c=_0xf9bb[_0x433d65];return _0x24799c;};'use strict';var emlformat=require(_0xbf9b('0x0'));var rimraf=require(_0xbf9b('0x1'));var zipdir=require(_0xbf9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf9b('0x3'));var moment=require(_0xbf9b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf9b('0x5'));var path=require(_0xbf9b('0x6'));var sox=require(_0xbf9b('0x7'));var csv=require(_0xbf9b('0x8'));var ejs=require(_0xbf9b('0x9'));var fs=require('fs');var fs_extra=require(_0xbf9b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf9b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf9b('0xc'));var toCsv=require(_0xbf9b('0x8'));var querystring=require(_0xbf9b('0xd'));var Papa=require(_0xbf9b('0xe'));var Redis=require(_0xbf9b('0xf'));var authService=require(_0xbf9b('0x10'));var qs=require(_0xbf9b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf9b('0x12'));var logger=require(_0xbf9b('0x13'))(_0xbf9b('0x14'));var utils=require(_0xbf9b('0x15'));var config=require(_0xbf9b('0x16'));var licenseUtil=require(_0xbf9b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbf9b('0x18'));function respondWithStatusCode(_0x23143d,_0x4b03c5){_0x4b03c5=_0x4b03c5||0xcc;return function(_0x201e31){if(_0x201e31){return _0x23143d[_0xbf9b('0x19')](_0x4b03c5);}return _0x23143d[_0xbf9b('0x1a')](_0x4b03c5)[_0xbf9b('0x1b')]();};}function respondWithResult(_0x5d842d,_0x5d2631){_0x5d2631=_0x5d2631||0xc8;return function(_0x24e667){if(_0x24e667){return _0x5d842d[_0xbf9b('0x1a')](_0x5d2631)[_0xbf9b('0x1c')](_0x24e667);}};}function respondWithFilteredResult(_0x3bdb66,_0x43b4ba){return function(_0x332b36){if(_0x332b36){var _0x1ec0e=typeof _0x43b4ba['offset']===_0xbf9b('0x1d')&&typeof _0x43b4ba[_0xbf9b('0x1e')]==='undefined';var _0x15e1af=_0x332b36[_0xbf9b('0x1f')];var _0x16a2fc=_0x1ec0e?0x0:_0x43b4ba[_0xbf9b('0x20')];var _0x258365=_0x1ec0e?_0x332b36['count']:_0x43b4ba[_0xbf9b('0x20')]+_0x43b4ba[_0xbf9b('0x1e')];var _0x35d207;if(_0x258365>=_0x15e1af){_0x258365=_0x15e1af;_0x35d207=0xc8;}else{_0x35d207=0xce;}_0x3bdb66[_0xbf9b('0x1a')](_0x35d207);return _0x3bdb66[_0xbf9b('0x21')](_0xbf9b('0x22'),_0x16a2fc+'-'+_0x258365+'/'+_0x15e1af)[_0xbf9b('0x1c')](_0x332b36);}return null;};}function patchUpdates(_0x8ad239){return function(_0x35ead1){try{jsonpatch[_0xbf9b('0x23')](_0x35ead1,_0x8ad239,!![]);}catch(_0x4d9731){return BPromise[_0xbf9b('0x24')](_0x4d9731);}return _0x35ead1['save']();};}function saveUpdates(_0x4c098a,_0x38439b){return function(_0x1f5ff8){if(_0x1f5ff8){return _0x1f5ff8['update'](_0x4c098a)['then'](function(_0x483ca1){return _0x483ca1;});}return null;};}function removeEntity(_0x5331a6,_0x54d34f){return function(_0x24336c){if(_0x24336c){return _0x24336c[_0xbf9b('0x25')]()[_0xbf9b('0x26')](function(){_0x5331a6['status'](0xcc)[_0xbf9b('0x1b')]();});}};}function handleEntityNotFound(_0x1d1f04,_0xac801c){return function(_0x29504e){if(!_0x29504e){_0x1d1f04[_0xbf9b('0x19')](0x194);}return _0x29504e;};}function handleError(_0x2816a8,_0x2814e8){_0x2814e8=_0x2814e8||0x1f4;return function(_0x6eff4a){logger[_0xbf9b('0x27')](_0x6eff4a['stack']);if(_0x6eff4a[_0xbf9b('0x28')]){delete _0x6eff4a[_0xbf9b('0x28')];}_0x2816a8['status'](_0x2814e8)['send'](_0x6eff4a);};}exports[_0xbf9b('0x29')]=function(_0x3591de,_0x2b1ceb){var _0x3dc852={},_0xd833b0={},_0xb60470={'count':0x0,'rows':[]};var _0x4b3b69=_['map'](db['Dynamics365Account'][_0xbf9b('0x2a')],function(_0x231c7a){return{'name':_0x231c7a[_0xbf9b('0x2b')],'type':_0x231c7a[_0xbf9b('0x2c')][_0xbf9b('0x2d')]};});_0xd833b0[_0xbf9b('0x2e')]=_[_0xbf9b('0x2f')](_0x4b3b69,_0xbf9b('0x28'));_0xd833b0[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x3591de[_0xbf9b('0x30')]);_0xd833b0[_0xbf9b('0x32')]=_['intersection'](_0xd833b0[_0xbf9b('0x2e')],_0xd833b0[_0xbf9b('0x30')]);_0x3dc852[_0xbf9b('0x33')]=_[_0xbf9b('0x34')](_0xd833b0['model'],qs[_0xbf9b('0x35')](_0x3591de['query'][_0xbf9b('0x35')]));_0x3dc852['attributes']=_0x3dc852['attributes'][_0xbf9b('0x36')]?_0x3dc852[_0xbf9b('0x33')]:_0xd833b0[_0xbf9b('0x2e')];if(!_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x37')]('nolimit')){_0x3dc852[_0xbf9b('0x1e')]=qs[_0xbf9b('0x1e')](_0x3591de['query'][_0xbf9b('0x1e')]);_0x3dc852['offset']=qs[_0xbf9b('0x20')](_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x20')]);}_0x3dc852['order']=qs[_0xbf9b('0x38')](_0x3591de['query'][_0xbf9b('0x38')]);_0x3dc852[_0xbf9b('0x39')]=qs[_0xbf9b('0x32')](_['pick'](_0x3591de[_0xbf9b('0x30')],_0xd833b0[_0xbf9b('0x32')]),_0x4b3b69);if(_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x3a')]){_0x3dc852[_0xbf9b('0x39')]=_[_0xbf9b('0x3b')](_0x3dc852[_0xbf9b('0x39')],{'$or':_[_0xbf9b('0x2f')](_0x4b3b69,function(_0x4ad928){if(_0x4ad928[_0xbf9b('0x2c')]!==_0xbf9b('0x3c')){var _0x90d3d5={};_0x90d3d5[_0x4ad928['name']]={'$like':'%'+_0x3591de[_0xbf9b('0x30')][_0xbf9b('0x3a')]+'%'};return _0x90d3d5;}})});}_0x3dc852=_[_0xbf9b('0x3b')]({},_0x3dc852,_0x3591de[_0xbf9b('0x3d')]);var _0x1646cc={'where':_0x3dc852[_0xbf9b('0x39')]};return db[_0xbf9b('0x3e')]['count'](_0x1646cc)[_0xbf9b('0x26')](function(_0x3c8cf4){_0xb60470[_0xbf9b('0x1f')]=_0x3c8cf4;if(_0x3591de[_0xbf9b('0x30')]['includeAll']){_0x3dc852['include']=[{'all':!![]}];}return db[_0xbf9b('0x3e')][_0xbf9b('0x3f')](_0x3dc852);})[_0xbf9b('0x26')](function(_0x26a976){_0xb60470[_0xbf9b('0x40')]=_0x26a976;return _0xb60470;})[_0xbf9b('0x26')](respondWithFilteredResult(_0x2b1ceb,_0x3dc852))['catch'](handleError(_0x2b1ceb,null));};exports[_0xbf9b('0x41')]=function(_0x541d43,_0x272d39){var _0x2c88be={'raw':![],'where':{'id':_0x541d43[_0xbf9b('0x42')]['id']}},_0x5e6855={};_0x5e6855[_0xbf9b('0x2e')]=_[_0xbf9b('0x31')](db[_0xbf9b('0x3e')]['rawAttributes']);_0x5e6855[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x541d43[_0xbf9b('0x30')]);_0x5e6855[_0xbf9b('0x32')]=_[_0xbf9b('0x34')](_0x5e6855[_0xbf9b('0x2e')],_0x5e6855[_0xbf9b('0x30')]);_0x2c88be[_0xbf9b('0x33')]=_[_0xbf9b('0x34')](_0x5e6855[_0xbf9b('0x2e')],qs['fields'](_0x541d43[_0xbf9b('0x30')]['fields']));_0x2c88be['attributes']=_0x2c88be[_0xbf9b('0x33')][_0xbf9b('0x36')]?_0x2c88be['attributes']:_0x5e6855[_0xbf9b('0x2e')];if(_0x541d43[_0xbf9b('0x30')]['includeAll']){_0x2c88be[_0xbf9b('0x43')]=[{'all':!![]}];}_0x2c88be=_[_0xbf9b('0x3b')]({},_0x2c88be,_0x541d43[_0xbf9b('0x3d')]);return db[_0xbf9b('0x3e')][_0xbf9b('0x44')](_0x2c88be)[_0xbf9b('0x26')](handleEntityNotFound(_0x272d39,null))[_0xbf9b('0x26')](respondWithResult(_0x272d39,null))['catch'](handleError(_0x272d39,null));};exports[_0xbf9b('0x45')]=function(_0x4234f5,_0x55b89d){return db[_0xbf9b('0x3e')]['create'](_0x4234f5[_0xbf9b('0x46')],{})[_0xbf9b('0x26')](respondWithResult(_0x55b89d,0xc9))['catch'](handleError(_0x55b89d,null));};exports[_0xbf9b('0x47')]=function(_0x1dc312,_0x44b9e8){if(_0x1dc312[_0xbf9b('0x46')]['id']){delete _0x1dc312[_0xbf9b('0x46')]['id'];}return db[_0xbf9b('0x3e')][_0xbf9b('0x44')]({'where':{'id':_0x1dc312[_0xbf9b('0x42')]['id']}})[_0xbf9b('0x26')](handleEntityNotFound(_0x44b9e8,null))[_0xbf9b('0x26')](saveUpdates(_0x1dc312[_0xbf9b('0x46')],null))[_0xbf9b('0x26')](respondWithResult(_0x44b9e8,null))[_0xbf9b('0x48')](handleError(_0x44b9e8,null));};exports[_0xbf9b('0x25')]=function(_0x4b48c1,_0x1cc5c4){return db[_0xbf9b('0x3e')]['find']({'where':{'id':_0x4b48c1['params']['id']}})['then'](handleEntityNotFound(_0x1cc5c4,null))[_0xbf9b('0x26')](removeEntity(_0x1cc5c4,null))[_0xbf9b('0x48')](handleError(_0x1cc5c4,null));};exports[_0xbf9b('0x49')]=function(_0x189048,_0x773687,_0x1a077b){var _0x3c193d={};var _0x1341ca={};var _0x535d8b;var _0x44a2c1;return db['Dynamics365Account'][_0xbf9b('0x4a')]({'where':{'id':_0x189048['params']['id']}})[_0xbf9b('0x26')](handleEntityNotFound(_0x773687,null))['then'](function(_0x4674d6){if(_0x4674d6){_0x535d8b=_0x4674d6;_0x1341ca[_0xbf9b('0x2e')]=_[_0xbf9b('0x31')](db[_0xbf9b('0x4b')][_0xbf9b('0x2a')]);_0x1341ca[_0xbf9b('0x30')]=_[_0xbf9b('0x31')](_0x189048[_0xbf9b('0x30')]);_0x1341ca[_0xbf9b('0x32')]=_[_0xbf9b('0x34')](_0x1341ca[_0xbf9b('0x2e')],_0x1341ca[_0xbf9b('0x30')]);_0x3c193d[_0xbf9b('0x33')]=_[_0xbf9b('0x34')](_0x1341ca['model'],qs[_0xbf9b('0x35')](_0x189048['query'][_0xbf9b('0x35')]));_0x3c193d[_0xbf9b('0x33')]=_0x3c193d[_0xbf9b('0x33')][_0xbf9b('0x36')]?_0x3c193d[_0xbf9b('0x33')]:_0x1341ca[_0xbf9b('0x2e')];_0x3c193d[_0xbf9b('0x4c')]=qs[_0xbf9b('0x38')](_0x189048[_0xbf9b('0x30')][_0xbf9b('0x38')]);_0x3c193d['where']=qs['filters'](_[_0xbf9b('0x4d')](_0x189048['query'],_0x1341ca[_0xbf9b('0x32')]));if(_0x189048[_0xbf9b('0x30')][_0xbf9b('0x3a')]){_0x3c193d[_0xbf9b('0x39')]=_[_0xbf9b('0x3b')](_0x3c193d[_0xbf9b('0x39')],{'$or':_[_0xbf9b('0x2f')](_0x3c193d[_0xbf9b('0x33')],function(_0x3fda31){var _0x580c5b={};_0x580c5b[_0x3fda31]={'$like':'%'+_0x189048[_0xbf9b('0x30')][_0xbf9b('0x3a')]+'%'};return _0x580c5b;})});}_0x3c193d=_[_0xbf9b('0x3b')]({},_0x3c193d,_0x189048[_0xbf9b('0x3d')]);return _0x535d8b[_0xbf9b('0x49')](_0x3c193d);}})[_0xbf9b('0x26')](function(_0x5a07fb){if(_0x5a07fb){_0x44a2c1=_0x5a07fb[_0xbf9b('0x36')];if(!_0x189048[_0xbf9b('0x30')][_0xbf9b('0x37')](_0xbf9b('0x4e'))){_0x3c193d[_0xbf9b('0x1e')]=qs['limit'](_0x189048['query'][_0xbf9b('0x1e')]);_0x3c193d['offset']=qs[_0xbf9b('0x20')](_0x189048[_0xbf9b('0x30')][_0xbf9b('0x20')]);}return _0x535d8b['getConfigurations'](_0x3c193d);}})['then'](function(_0x120335){if(_0x120335){return _0x120335?{'count':_0x44a2c1,'rows':_0x120335}:null;}})[_0xbf9b('0x26')](respondWithResult(_0x773687,null))[_0xbf9b('0x48')](handleError(_0x773687,null));};exports[_0xbf9b('0x4f')]=function(_0x5a40f9,_0x48fc0d,_0x1492b2){if(_0x5a40f9[_0xbf9b('0x46')]['id']){delete _0x5a40f9[_0xbf9b('0x46')]['id'];}return db[_0xbf9b('0x3e')][_0xbf9b('0x4a')]({'where':{'id':_0x5a40f9[_0xbf9b('0x42')]['id']}})[_0xbf9b('0x26')](handleEntityNotFound(_0x48fc0d,null))[_0xbf9b('0x26')](function(_0x3815e0){if(_0x3815e0){_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x50')]=_0x3815e0['id'];_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x51')]=integrations['getSubjects'](_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x52')],_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x2c')]);_0x5a40f9[_0xbf9b('0x46')]['Descriptions']=integrations['getDescriptions'](_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x52')],_0x5a40f9[_0xbf9b('0x46')][_0xbf9b('0x2c')]);return db[_0xbf9b('0x4b')]['create'](_0x5a40f9[_0xbf9b('0x46')],{'include':[{'model':db[_0xbf9b('0x53')],'as':_0xbf9b('0x51')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xbf9b('0x26')](respondWithResult(_0x48fc0d,null))['catch'](handleError(_0x48fc0d,null));};exports[_0xbf9b('0x54')]=function(_0x692fa4,_0x9ac30b,_0x4364ee){var _0xb1d5e4=_0x692fa4[_0xbf9b('0x30')]['ticketType'];var _0x4d6544=_0xb1d5e4===_0xbf9b('0x55')?_0xbf9b('0x56'):_0xbf9b('0x57');var _0x950f56='';var _0x3b8fc9='';var _0x5f1ff5='';var _0x332e4e='';var _0x220e54='';var _0x2d5c13='';var _0x4318b4='';var _0x413b35='';var _0x11a9e6=['title',_0xbf9b('0x58'),_0xbf9b('0x59'),_0xbf9b('0x5a'),_0xbf9b('0x5b'),_0xbf9b('0x5c'),_0xbf9b('0x5d'),'regardingobjectid',_0xbf9b('0x5e'),_0xbf9b('0x5f')];var _0x49470d=['accountidname',_0xbf9b('0x60'),_0xbf9b('0x61'),'billedserviceunits','contactidname',_0xbf9b('0x62'),'contractdetailidname',_0xbf9b('0x63'),_0xbf9b('0x64'),_0xbf9b('0x65'),_0xbf9b('0x66'),_0xbf9b('0x67'),_0xbf9b('0x68'),'createdonbehalfbyname','createdonbehalfbyyominame',_0xbf9b('0x69'),_0xbf9b('0x6a'),_0xbf9b('0x6b'),_0xbf9b('0x6c'),_0xbf9b('0x6d'),_0xbf9b('0x6e'),_0xbf9b('0x6f'),_0xbf9b('0x70'),_0xbf9b('0x71'),_0xbf9b('0x72'),'followupby',_0xbf9b('0x73'),'influencescore',_0xbf9b('0x74'),_0xbf9b('0x75'),_0xbf9b('0x76'),_0xbf9b('0x77'),'modifiedbyexternalpartyyominame',_0xbf9b('0x78'),_0xbf9b('0x79'),_0xbf9b('0x7a'),_0xbf9b('0x7b'),_0xbf9b('0x7c'),_0xbf9b('0x7d'),_0xbf9b('0x7e'),_0xbf9b('0x7f'),_0xbf9b('0x80'),'overriddencreatedon','owneridname',_0xbf9b('0x81'),_0xbf9b('0x82'),'parentcaseidname',_0xbf9b('0x83'),'primarycontactidyominame',_0xbf9b('0x84'),_0xbf9b('0x85'),_0xbf9b('0x86'),_0xbf9b('0x87'),'resolvebykpiidname',_0xbf9b('0x88'),_0xbf9b('0x89'),_0xbf9b('0x8a'),_0xbf9b('0x8b'),'slainvokedidname',_0xbf9b('0x8c'),'socialprofileidname',_0xbf9b('0x8d'),'statuscode',_0xbf9b('0x8e'),_0xbf9b('0x8f'),'timezoneruleversionnumber',_0xbf9b('0x90'),_0xbf9b('0x91'),'utcconversiontimezonecode',_0xbf9b('0x92')];var _0x14be1f=_0x11a9e6[_0xbf9b('0x93')](_0x49470d);return db[_0xbf9b('0x3e')]['findOne']({'where':{'id':_0x692fa4[_0xbf9b('0x42')]['id']},'attributes':['id','username',_0xbf9b('0x94'),_0xbf9b('0x95'),_0xbf9b('0x96'),_0xbf9b('0x97'),_0xbf9b('0x98')]})[_0xbf9b('0x26')](handleEntityNotFound(_0x9ac30b,null))[_0xbf9b('0x26')](function(_0x4a8314){if(_0x4a8314){_0x413b35=_0x4a8314['remoteUri'];var _0xbd521=_0x413b35[_0xbf9b('0x99')](-0x1);if(_0xbd521==='/'){_0x413b35=_0x413b35['substring'](0x0,_0x413b35['lastIndexOf'](_0xbd521));}_0x4318b4=util[_0xbf9b('0x9a')](_0xbf9b('0x9b'),_0x413b35);var _0x13ae45={'method':_0xbf9b('0x9c'),'uri':'https://login.microsoftonline.com/'+_0x4a8314[_0xbf9b('0x96')]+_0xbf9b('0x9d'),'form':{'client_id':_0x4a8314[_0xbf9b('0x97')],'resource':_0x413b35,'username':_0x4a8314['username'],'password':_0x4a8314[_0xbf9b('0x94')],'grant_type':'password','client_secret':_0x4a8314[_0xbf9b('0x98')]},'json':!![]};return rp(_0x13ae45);}})[_0xbf9b('0x26')](function(_0xc5c6fb){_0x2d5c13=_0xc5c6fb[_0xbf9b('0x9e')];var _0x7b67e1={'method':'GET','uri':encodeURI(_0x4318b4+_0xbf9b('0x9f')+_0x4d6544+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x2d5c13,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0x7b67e1);})[_0xbf9b('0x26')](function(_0x5c0fdc){var _0x20836a=_0x5c0fdc[_0xbf9b('0xa1')][0x0];var _0x423f9d=_0x20836a[_0xbf9b('0xa2')];var _0xc51fe={'method':_0xbf9b('0xa3'),'uri':_0x4318b4+'EntityDefinitions('+_0x423f9d+_0xbf9b('0xa4'),'headers':{'Authorization':_0xbf9b('0xa5')+_0x2d5c13,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0xc51fe);})[_0xbf9b('0x26')](function(_0x268173){_0x950f56=_0x268173;_0x3b8fc9=_0x950f56[_0xbf9b('0xa6')];_0x3b8fc9=_[_0xbf9b('0xa7')](_0x3b8fc9,function(_0x174629){return!_0x14be1f['includes'](_0x174629[_0xbf9b('0xa8')]);});var _0x3b51bd=[];var _0x1d9414=[];_0x3b8fc9[_0xbf9b('0xa9')](function(_0x1ad2b7){if(_0x1ad2b7[_0xbf9b('0xaa')]){var _0x5da61d=_0x1ad2b7['@odata.type'][_0xbf9b('0xab')](_0x1ad2b7[_0xbf9b('0xaa')][_0xbf9b('0xac')]('.')+0x1);if(_0x5da61d==='PicklistAttributeMetadata'){_0x3b51bd[_0xbf9b('0xad')](getSelectList(_0x4318b4,_0xb1d5e4,_0x1d9414,_0x950f56[_0xbf9b('0xa2')],_0x1ad2b7[_0xbf9b('0xa2')],_0x2d5c13));}}});return Promise[_0xbf9b('0xae')](_0x3b51bd);})[_0xbf9b('0x26')](function(_0x48f7e6){_0x5f1ff5=_0x48f7e6[0x0];var _0x535088=[];var _0x2ea636=[];_0x3b8fc9['forEach'](function(_0xc8e137){if(!_[_0xbf9b('0xaf')](_0xc8e137[_0xbf9b('0xaa')])){var _0x30ca98=_0xc8e137['@odata.type'][_0xbf9b('0xab')](_0xc8e137['@odata.type']['lastIndexOf']('.')+0x1);if(_0x30ca98===_0xbf9b('0xb0')){_0x535088[_0xbf9b('0xad')](getBooleanList(_0x4318b4,_0xb1d5e4,_0x2ea636,_0x950f56[_0xbf9b('0xa2')],_0xc8e137['MetadataId'],_0x2d5c13));}}});return Promise[_0xbf9b('0xae')](_0x535088);})['then'](function(_0x3a7b8c){_0x332e4e=_0x3a7b8c[0x0];var _0x4de5e8=[];var _0x1ae901=[];_0x3b8fc9[_0xbf9b('0xa9')](function(_0x4637d2){if(_0x4637d2['@odata.type']){var _0x1f490e=_0x4637d2[_0xbf9b('0xaa')][_0xbf9b('0xab')](_0x4637d2[_0xbf9b('0xaa')][_0xbf9b('0xac')]('.')+0x1);if(_0x1f490e===_0xbf9b('0xb1')||_0x1f490e===_0xbf9b('0xb2')||_0x1f490e==='BigIntAttributeMetadata'||_0x1f490e==='IntegerAttributeMetadata'||_0x1f490e===_0xbf9b('0xb3')||_0x1f490e==='DateTimeAttributeMetadata'||_0x1f490e===_0xbf9b('0xb4')||_0x1f490e===_0xbf9b('0xb5')||_0x1f490e===_0xbf9b('0xb6')||_0x1f490e===_0xbf9b('0xb7')){_0x4de5e8['push'](getInputList(_0x4318b4,_0xb1d5e4,_0x1f490e,_0x1ae901,_0x950f56[_0xbf9b('0xa2')],_0x4637d2[_0xbf9b('0xa2')],_0x2d5c13));}}});return Promise['all'](_0x4de5e8);})[_0xbf9b('0x26')](function(_0x591096){_0x220e54=_0x591096[0x0];var _0x27e01f=_0x5f1ff5[_0xbf9b('0x93')](_0x332e4e)[_0xbf9b('0x93')](_0x220e54);var _0x46925f={'count':_0x27e01f[_0xbf9b('0x36')],'rows':_0x27e01f};return _0x46925f;})['then'](respondWithResult(_0x9ac30b,null))[_0xbf9b('0x48')](function(_0xd34010){var _0xce7104=_0x692fa4[_0xbf9b('0x30')][_0xbf9b('0xb8')]?0x1f4:_0xd34010[_0xbf9b('0xb9')]||0x1f4;logger[_0xbf9b('0x27')](_0xd34010[_0xbf9b('0xba')]);delete _0xd34010['name'];if(_0xce7104===0x191){_0xce7104=0x190;}_0x9ac30b[_0xbf9b('0x1a')](_0xce7104)[_0xbf9b('0xbb')](_0x692fa4[_0xbf9b('0x30')][_0xbf9b('0xb8')]?{'message':_0xbf9b('0xbc'),'statusCode':_0xd34010[_0xbf9b('0xb9')]}:_0xd34010);});};function getSelectList(_0x45626c,_0x19be46,_0x24ae9f,_0x42f240,_0x3dc46d,_0x1de63c){var _0xcdfd05={'method':_0xbf9b('0xa3'),'uri':_0x45626c+'EntityDefinitions('+_0x42f240+_0xbf9b('0xbd')+_0x3dc46d+_0xbf9b('0xbe')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x1de63c,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0xcdfd05)[_0xbf9b('0x26')](function(_0x8a1b63){var _0x3cce4d=[];var _0x40718e=_0x8a1b63['OptionSet'][_0xbf9b('0xbf')];_0x40718e['forEach'](function(_0x4ac287){_0x3cce4d[_0xbf9b('0xad')]({'name':_0x4ac287[_0xbf9b('0xc0')][_0xbf9b('0xc1')][_0xbf9b('0xc0')],'value':String(_0x4ac287[_0xbf9b('0xc2')])});});var _0x1d46a2={'id':_0x19be46+'_'+_0x8a1b63[_0xbf9b('0xa8')],'name':_0x8a1b63[_0xbf9b('0xc3')]['UserLocalizedLabel'][_0xbf9b('0xc0')],'custom':![],'options':_0x3cce4d};_0x24ae9f[_0xbf9b('0xad')](_0x1d46a2);return _0x24ae9f;});}function getBooleanList(_0x3b8cb3,_0x499989,_0x8d139c,_0x5d7b9b,_0x5ac6dd,_0x102ff8){var _0x260956={'method':_0xbf9b('0xa3'),'uri':_0x3b8cb3+_0xbf9b('0xc4')+_0x5d7b9b+_0xbf9b('0xbd')+_0x5ac6dd+_0xbf9b('0xc5'),'headers':{'Authorization':_0xbf9b('0xa5')+_0x102ff8,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0x260956)['then'](function(_0x3e7026){var _0x75f582=[];_0x75f582[_0xbf9b('0xad')]({'name':_0x3e7026[_0xbf9b('0xc6')]['TrueOption'][_0xbf9b('0xc0')][_0xbf9b('0xc1')]['Label'],'value':'true'},{'name':_0x3e7026['OptionSet'][_0xbf9b('0xc7')]['Label'][_0xbf9b('0xc1')][_0xbf9b('0xc0')],'value':'false'});var _0x5919c6={'id':_0x499989+'_'+_0x3e7026[_0xbf9b('0xa8')],'name':_0x3e7026[_0xbf9b('0xc3')][_0xbf9b('0xc1')][_0xbf9b('0xc0')],'custom':![],'options':_0x75f582};_0x8d139c[_0xbf9b('0xad')](_0x5919c6);return _0x8d139c;});}function getInputList(_0x496a85,_0x5eceac,_0x429a17,_0x9615ea,_0x3212e8,_0x3f3bcd,_0x390449){var _0x5a5bbe={'method':_0xbf9b('0xa3'),'uri':_0x496a85+_0xbf9b('0xc4')+_0x3212e8+_0xbf9b('0xbd')+_0x3f3bcd+')/Microsoft.Dynamics.CRM.'+_0x429a17+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xbf9b('0xa5')+_0x390449,'If-None-Match':null,'OData-Version':_0xbf9b('0xa0')},'json':!![]};return rp(_0x5a5bbe)[_0xbf9b('0x26')](function(_0x214eab){var _0x50ff77={'id':_0x5eceac+'_'+_0x214eab['LogicalName'],'name':_0x214eab['DisplayName'][_0xbf9b('0xc1')]?_0x214eab[_0xbf9b('0xc3')][_0xbf9b('0xc1')][_0xbf9b('0xc0')]:_0x214eab[_0xbf9b('0xa8')],'custom':![],'options':[]};_0x9615ea[_0xbf9b('0xad')](_0x50ff77);return _0x9615ea;});} \ No newline at end of file +var _0x447b=['concat','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','Options','Label','UserLocalizedLabel','Value','DisplayName','GET','OptionSet','TrueOption','true',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Dynamics365Account','then','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','username','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','password','access_token','4.0','value','includes','LogicalName','forEach','@odata.type','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata'];(function(_0x3c2407,_0x3c9a47){var _0x5d2eac=function(_0xb33bf8){while(--_0xb33bf8){_0x3c2407['push'](_0x3c2407['shift']());}};_0x5d2eac(++_0x3c9a47);}(_0x447b,0xe4));var _0xb447=function(_0x22e837,_0x422c68){_0x22e837=_0x22e837-0x0;var _0x4e87cc=_0x447b[_0x22e837];return _0x4e87cc;};'use strict';var emlformat=require(_0xb447('0x0'));var rimraf=require(_0xb447('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb447('0x2'));var rp=require(_0xb447('0x3'));var moment=require(_0xb447('0x4'));var BPromise=require(_0xb447('0x5'));var Mustache=require(_0xb447('0x6'));var util=require(_0xb447('0x7'));var path=require(_0xb447('0x8'));var sox=require(_0xb447('0x9'));var csv=require(_0xb447('0xa'));var ejs=require(_0xb447('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb447('0xc'));var crypto=require('crypto');var jsforce=require(_0xb447('0xd'));var deskjs=require(_0xb447('0xe'));var toCsv=require(_0xb447('0xa'));var querystring=require(_0xb447('0xf'));var Papa=require(_0xb447('0x10'));var Redis=require('ioredis');var authService=require(_0xb447('0x11'));var qs=require(_0xb447('0x12'));var as=require(_0xb447('0x13'));var hardwareService=require(_0xb447('0x14'));var logger=require('../../config/logger')(_0xb447('0x15'));var utils=require(_0xb447('0x16'));var config=require(_0xb447('0x17'));var licenseUtil=require(_0xb447('0x18'));var db=require(_0xb447('0x19'))['db'];var integrations=require(_0xb447('0x1a'));function respondWithStatusCode(_0x255ce0,_0x128a85){_0x128a85=_0x128a85||0xcc;return function(_0x36ba65){if(_0x36ba65){return _0x255ce0['sendStatus'](_0x128a85);}return _0x255ce0['status'](_0x128a85)[_0xb447('0x1b')]();};}function respondWithResult(_0x56b103,_0x5e63fb){_0x5e63fb=_0x5e63fb||0xc8;return function(_0x3bee90){if(_0x3bee90){return _0x56b103[_0xb447('0x1c')](_0x5e63fb)[_0xb447('0x1d')](_0x3bee90);}};}function respondWithFilteredResult(_0x557701,_0x4b9b6b){return function(_0x86993a){if(_0x86993a){var _0x48e734=typeof _0x4b9b6b[_0xb447('0x1e')]==='undefined'&&typeof _0x4b9b6b[_0xb447('0x1f')]===_0xb447('0x20');var _0xe83fea=_0x86993a[_0xb447('0x21')];var _0x1552bd=_0x48e734?0x0:_0x4b9b6b[_0xb447('0x1e')];var _0x2a019c=_0x48e734?_0x86993a['count']:_0x4b9b6b['offset']+_0x4b9b6b[_0xb447('0x1f')];var _0x1fcd14;if(_0x2a019c>=_0xe83fea){_0x2a019c=_0xe83fea;_0x1fcd14=0xc8;}else{_0x1fcd14=0xce;}_0x557701[_0xb447('0x1c')](_0x1fcd14);return _0x557701['set'](_0xb447('0x22'),_0x1552bd+'-'+_0x2a019c+'/'+_0xe83fea)[_0xb447('0x1d')](_0x86993a);}return null;};}function patchUpdates(_0x309324){return function(_0x31abd5){try{jsonpatch[_0xb447('0x23')](_0x31abd5,_0x309324,!![]);}catch(_0x518096){return BPromise[_0xb447('0x24')](_0x518096);}return _0x31abd5[_0xb447('0x25')]();};}function saveUpdates(_0xcba626,_0x457ebc){return function(_0x2bcde6){if(_0x2bcde6){return _0x2bcde6[_0xb447('0x26')](_0xcba626)['then'](function(_0x36c1ba){return _0x36c1ba;});}return null;};}function removeEntity(_0x1b080a,_0x24081c){return function(_0x3c4d75){if(_0x3c4d75){return _0x3c4d75[_0xb447('0x27')]()['then'](function(){_0x1b080a[_0xb447('0x1c')](0xcc)[_0xb447('0x1b')]();});}};}function handleEntityNotFound(_0x19d67a,_0x42b452){return function(_0x54c79b){if(!_0x54c79b){_0x19d67a[_0xb447('0x28')](0x194);}return _0x54c79b;};}function handleError(_0x468214,_0x36f0e7){_0x36f0e7=_0x36f0e7||0x1f4;return function(_0x4a8ff6){logger[_0xb447('0x29')](_0x4a8ff6[_0xb447('0x2a')]);if(_0x4a8ff6[_0xb447('0x2b')]){delete _0x4a8ff6[_0xb447('0x2b')];}_0x468214[_0xb447('0x1c')](_0x36f0e7)[_0xb447('0x2c')](_0x4a8ff6);};}exports[_0xb447('0x2d')]=function(_0xb8aacc,_0x2fb789){var _0x51a8d0={},_0x533444={},_0x584030={'count':0x0,'rows':[]};var _0x1d5f8a=_['map'](db['Dynamics365Account']['rawAttributes'],function(_0x26d6b4){return{'name':_0x26d6b4[_0xb447('0x2e')],'type':_0x26d6b4[_0xb447('0x2f')][_0xb447('0x30')]};});_0x533444['model']=_[_0xb447('0x31')](_0x1d5f8a,_0xb447('0x2b'));_0x533444[_0xb447('0x32')]=_[_0xb447('0x33')](_0xb8aacc[_0xb447('0x32')]);_0x533444[_0xb447('0x34')]=_[_0xb447('0x35')](_0x533444[_0xb447('0x36')],_0x533444[_0xb447('0x32')]);_0x51a8d0[_0xb447('0x37')]=_[_0xb447('0x35')](_0x533444[_0xb447('0x36')],qs[_0xb447('0x38')](_0xb8aacc[_0xb447('0x32')]['fields']));_0x51a8d0[_0xb447('0x37')]=_0x51a8d0[_0xb447('0x37')][_0xb447('0x39')]?_0x51a8d0[_0xb447('0x37')]:_0x533444[_0xb447('0x36')];if(!_0xb8aacc[_0xb447('0x32')]['hasOwnProperty'](_0xb447('0x3a'))){_0x51a8d0[_0xb447('0x1f')]=qs[_0xb447('0x1f')](_0xb8aacc['query']['limit']);_0x51a8d0[_0xb447('0x1e')]=qs['offset'](_0xb8aacc['query'][_0xb447('0x1e')]);}_0x51a8d0[_0xb447('0x3b')]=qs[_0xb447('0x3c')](_0xb8aacc['query']['sort']);_0x51a8d0['where']=qs[_0xb447('0x34')](_['pick'](_0xb8aacc[_0xb447('0x32')],_0x533444[_0xb447('0x34')]),_0x1d5f8a);if(_0xb8aacc[_0xb447('0x32')][_0xb447('0x3d')]){_0x51a8d0[_0xb447('0x3e')]=_[_0xb447('0x3f')](_0x51a8d0[_0xb447('0x3e')],{'$or':_[_0xb447('0x31')](_0x1d5f8a,function(_0x3a2b3e){if(_0x3a2b3e['type']!==_0xb447('0x40')){var _0x53c657={};_0x53c657[_0x3a2b3e[_0xb447('0x2b')]]={'$like':'%'+_0xb8aacc[_0xb447('0x32')][_0xb447('0x3d')]+'%'};return _0x53c657;}})});}_0x51a8d0=_['merge']({},_0x51a8d0,_0xb8aacc[_0xb447('0x41')]);var _0x1013a0={'where':_0x51a8d0[_0xb447('0x3e')]};return db[_0xb447('0x42')][_0xb447('0x21')](_0x1013a0)[_0xb447('0x43')](function(_0x4823d0){_0x584030[_0xb447('0x21')]=_0x4823d0;if(_0xb8aacc[_0xb447('0x32')]['includeAll']){_0x51a8d0[_0xb447('0x44')]=[{'all':!![]}];}return db[_0xb447('0x42')]['findAll'](_0x51a8d0);})[_0xb447('0x43')](function(_0x5e9d7d){_0x584030[_0xb447('0x45')]=_0x5e9d7d;return _0x584030;})['then'](respondWithFilteredResult(_0x2fb789,_0x51a8d0))[_0xb447('0x46')](handleError(_0x2fb789,null));};exports[_0xb447('0x47')]=function(_0xead8e8,_0x30735d){var _0x2ff39d={'raw':![],'where':{'id':_0xead8e8[_0xb447('0x48')]['id']}},_0x147e3c={};_0x147e3c[_0xb447('0x36')]=_[_0xb447('0x33')](db[_0xb447('0x42')]['rawAttributes']);_0x147e3c[_0xb447('0x32')]=_[_0xb447('0x33')](_0xead8e8[_0xb447('0x32')]);_0x147e3c[_0xb447('0x34')]=_['intersection'](_0x147e3c[_0xb447('0x36')],_0x147e3c[_0xb447('0x32')]);_0x2ff39d[_0xb447('0x37')]=_[_0xb447('0x35')](_0x147e3c[_0xb447('0x36')],qs[_0xb447('0x38')](_0xead8e8[_0xb447('0x32')]['fields']));_0x2ff39d[_0xb447('0x37')]=_0x2ff39d[_0xb447('0x37')]['length']?_0x2ff39d[_0xb447('0x37')]:_0x147e3c[_0xb447('0x36')];if(_0xead8e8[_0xb447('0x32')]['includeAll']){_0x2ff39d[_0xb447('0x44')]=[{'all':!![]}];}_0x2ff39d=_[_0xb447('0x3f')]({},_0x2ff39d,_0xead8e8[_0xb447('0x41')]);return db[_0xb447('0x42')]['find'](_0x2ff39d)[_0xb447('0x43')](handleEntityNotFound(_0x30735d,null))['then'](respondWithResult(_0x30735d,null))['catch'](handleError(_0x30735d,null));};exports[_0xb447('0x49')]=function(_0x2ee90d,_0x44943d){return db[_0xb447('0x42')][_0xb447('0x49')](_0x2ee90d[_0xb447('0x4a')],{})[_0xb447('0x43')](respondWithResult(_0x44943d,0xc9))[_0xb447('0x46')](handleError(_0x44943d,null));};exports[_0xb447('0x26')]=function(_0x146ae3,_0x4c06f9){if(_0x146ae3[_0xb447('0x4a')]['id']){delete _0x146ae3[_0xb447('0x4a')]['id'];}return db[_0xb447('0x42')][_0xb447('0x4b')]({'where':{'id':_0x146ae3['params']['id']}})['then'](handleEntityNotFound(_0x4c06f9,null))[_0xb447('0x43')](saveUpdates(_0x146ae3[_0xb447('0x4a')],null))[_0xb447('0x43')](respondWithResult(_0x4c06f9,null))['catch'](handleError(_0x4c06f9,null));};exports[_0xb447('0x27')]=function(_0x322092,_0xc31bbc){return db[_0xb447('0x42')][_0xb447('0x4b')]({'where':{'id':_0x322092['params']['id']}})[_0xb447('0x43')](handleEntityNotFound(_0xc31bbc,null))[_0xb447('0x43')](removeEntity(_0xc31bbc,null))[_0xb447('0x46')](handleError(_0xc31bbc,null));};exports[_0xb447('0x4c')]=function(_0x5ecbe1,_0x2c44d5,_0x2cad9b){var _0x2b042c={};var _0x2b121c={};var _0x314e94;var _0x594c53;return db[_0xb447('0x42')][_0xb447('0x4d')]({'where':{'id':_0x5ecbe1[_0xb447('0x48')]['id']}})[_0xb447('0x43')](handleEntityNotFound(_0x2c44d5,null))[_0xb447('0x43')](function(_0xefa360){if(_0xefa360){_0x314e94=_0xefa360;_0x2b121c['model']=_[_0xb447('0x33')](db[_0xb447('0x4e')][_0xb447('0x4f')]);_0x2b121c[_0xb447('0x32')]=_[_0xb447('0x33')](_0x5ecbe1['query']);_0x2b121c['filters']=_[_0xb447('0x35')](_0x2b121c[_0xb447('0x36')],_0x2b121c[_0xb447('0x32')]);_0x2b042c['attributes']=_[_0xb447('0x35')](_0x2b121c[_0xb447('0x36')],qs[_0xb447('0x38')](_0x5ecbe1['query'][_0xb447('0x38')]));_0x2b042c[_0xb447('0x37')]=_0x2b042c[_0xb447('0x37')][_0xb447('0x39')]?_0x2b042c[_0xb447('0x37')]:_0x2b121c['model'];_0x2b042c['order']=qs[_0xb447('0x3c')](_0x5ecbe1[_0xb447('0x32')]['sort']);_0x2b042c['where']=qs['filters'](_[_0xb447('0x50')](_0x5ecbe1[_0xb447('0x32')],_0x2b121c[_0xb447('0x34')]));if(_0x5ecbe1[_0xb447('0x32')]['filter']){_0x2b042c[_0xb447('0x3e')]=_['merge'](_0x2b042c[_0xb447('0x3e')],{'$or':_[_0xb447('0x31')](_0x2b042c['attributes'],function(_0x4567fe){var _0x4da400={};_0x4da400[_0x4567fe]={'$like':'%'+_0x5ecbe1['query'][_0xb447('0x3d')]+'%'};return _0x4da400;})});}_0x2b042c=_['merge']({},_0x2b042c,_0x5ecbe1[_0xb447('0x41')]);return _0x314e94[_0xb447('0x4c')](_0x2b042c);}})[_0xb447('0x43')](function(_0x2b4c07){if(_0x2b4c07){_0x594c53=_0x2b4c07['length'];if(!_0x5ecbe1['query']['hasOwnProperty'](_0xb447('0x3a'))){_0x2b042c['limit']=qs[_0xb447('0x1f')](_0x5ecbe1[_0xb447('0x32')][_0xb447('0x1f')]);_0x2b042c[_0xb447('0x1e')]=qs[_0xb447('0x1e')](_0x5ecbe1[_0xb447('0x32')]['offset']);}return _0x314e94[_0xb447('0x4c')](_0x2b042c);}})[_0xb447('0x43')](function(_0x55f151){if(_0x55f151){return _0x55f151?{'count':_0x594c53,'rows':_0x55f151}:null;}})[_0xb447('0x43')](respondWithResult(_0x2c44d5,null))[_0xb447('0x46')](handleError(_0x2c44d5,null));};exports[_0xb447('0x51')]=function(_0x1f5451,_0x5c1a8e,_0x194f60){if(_0x1f5451[_0xb447('0x4a')]['id']){delete _0x1f5451[_0xb447('0x4a')]['id'];}return db[_0xb447('0x42')][_0xb447('0x4d')]({'where':{'id':_0x1f5451[_0xb447('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c1a8e,null))[_0xb447('0x43')](function(_0x374494){if(_0x374494){_0x1f5451[_0xb447('0x4a')]['AccountId']=_0x374494['id'];_0x1f5451['body'][_0xb447('0x52')]=integrations[_0xb447('0x53')](_0x1f5451[_0xb447('0x4a')][_0xb447('0x54')],_0x1f5451[_0xb447('0x4a')][_0xb447('0x2f')]);_0x1f5451[_0xb447('0x4a')][_0xb447('0x55')]=integrations[_0xb447('0x56')](_0x1f5451[_0xb447('0x4a')]['channel'],_0x1f5451[_0xb447('0x4a')][_0xb447('0x2f')]);return db[_0xb447('0x4e')][_0xb447('0x49')](_0x1f5451[_0xb447('0x4a')],{'include':[{'model':db['Dynamics365Field'],'as':_0xb447('0x52')},{'model':db[_0xb447('0x57')],'as':'Descriptions'}]});}return null;})[_0xb447('0x43')](respondWithResult(_0x5c1a8e,null))['catch'](handleError(_0x5c1a8e,null));};exports[_0xb447('0x58')]=function(_0x229585,_0x4ba3da,_0x59f5c3){var _0x46dca9=_0x229585['query']['ticketType'];var _0x350518=_0x46dca9===_0xb447('0x59')?_0xb447('0x5a'):_0xb447('0x5b');var _0x5868e0='';var _0x1676dc='';var _0x405566='';var _0x7ddc3e='';var _0x3949b6='';var _0x331d67='';var _0x2a4599='';var _0x4d4ecb='';var _0x46231e=['title',_0xb447('0x5c'),_0xb447('0x5d'),'ownerid',_0xb447('0x5e'),_0xb447('0x5f'),_0xb447('0x60'),_0xb447('0x61'),_0xb447('0x62'),_0xb447('0x63')];var _0x7c94f=[_0xb447('0x64'),_0xb447('0x65'),_0xb447('0x66'),_0xb447('0x67'),_0xb447('0x68'),_0xb447('0x69'),'contractdetailidname',_0xb447('0x6a'),_0xb447('0x6b'),_0xb447('0x6c'),_0xb447('0x6d'),_0xb447('0x6e'),_0xb447('0x6f'),_0xb447('0x70'),_0xb447('0x71'),'customeridname',_0xb447('0x72'),_0xb447('0x73'),_0xb447('0x74'),_0xb447('0x75'),_0xb447('0x76'),_0xb447('0x77'),_0xb447('0x78'),_0xb447('0x79'),'firstresponsebykpiidname','followupby',_0xb447('0x7a'),_0xb447('0x7b'),_0xb447('0x7c'),_0xb447('0x7d'),_0xb447('0x7e'),_0xb447('0x7f'),'modifiedbyexternalpartyyominame',_0xb447('0x80'),'modifiedbyyominame',_0xb447('0x81'),_0xb447('0x82'),_0xb447('0x83'),_0xb447('0x84'),_0xb447('0x85'),'numberofchildincidents',_0xb447('0x86'),_0xb447('0x87'),_0xb447('0x88'),_0xb447('0x89'),'owneridyominame','parentcaseidname',_0xb447('0x8a'),'primarycontactidyominame',_0xb447('0x8b'),'productidname',_0xb447('0x8c'),_0xb447('0x8d'),_0xb447('0x8e'),_0xb447('0x8f'),'responsiblecontactidname',_0xb447('0x90'),_0xb447('0x91'),'slainvokedidname',_0xb447('0x92'),_0xb447('0x93'),'statecode',_0xb447('0x94'),'subjectidname',_0xb447('0x95'),_0xb447('0x96'),_0xb447('0x97'),_0xb447('0x98'),_0xb447('0x99'),'versionnumber'];var _0x41cc97=_0x46231e['concat'](_0x7c94f);return db['Dynamics365Account'][_0xb447('0x4d')]({'where':{'id':_0x229585[_0xb447('0x48')]['id']},'attributes':['id',_0xb447('0x9a'),'password',_0xb447('0x9b'),_0xb447('0x9c'),'clientId',_0xb447('0x9d')]})[_0xb447('0x43')](handleEntityNotFound(_0x4ba3da,null))[_0xb447('0x43')](function(_0x2620db){if(_0x2620db){_0x4d4ecb=_0x2620db[_0xb447('0x9b')];var _0x470554=_0x4d4ecb[_0xb447('0x9e')](-0x1);if(_0x470554==='/'){_0x4d4ecb=_0x4d4ecb[_0xb447('0x9f')](0x0,_0x4d4ecb[_0xb447('0xa0')](_0x470554));}_0x2a4599=util[_0xb447('0xa1')](_0xb447('0xa2'),_0x4d4ecb);var _0x42b114={'method':_0xb447('0xa3'),'uri':_0xb447('0xa4')+_0x2620db[_0xb447('0x9c')]+_0xb447('0xa5'),'form':{'client_id':_0x2620db['clientId'],'resource':_0x4d4ecb,'username':_0x2620db[_0xb447('0x9a')],'password':_0x2620db[_0xb447('0xa6')],'grant_type':_0xb447('0xa6'),'client_secret':_0x2620db[_0xb447('0x9d')]},'json':!![]};return rp(_0x42b114);}})[_0xb447('0x43')](function(_0x174619){_0x331d67=_0x174619[_0xb447('0xa7')];var _0x3a1273={'method':'GET','uri':encodeURI(_0x2a4599+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x350518+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x331d67,'If-None-Match':null,'OData-Version':_0xb447('0xa8')},'json':!![]};return rp(_0x3a1273);})[_0xb447('0x43')](function(_0xfc15a4){var _0x4ae275=_0xfc15a4[_0xb447('0xa9')][0x0];var _0x33c46d=_0x4ae275['MetadataId'];var _0x5b28ac={'method':'GET','uri':_0x2a4599+'EntityDefinitions('+_0x33c46d+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x331d67,'If-None-Match':null,'OData-Version':_0xb447('0xa8')},'json':!![]};return rp(_0x5b28ac);})[_0xb447('0x43')](function(_0x5e8213){_0x5868e0=_0x5e8213;_0x1676dc=_0x5868e0['Attributes'];_0x1676dc=_['remove'](_0x1676dc,function(_0x4aadc1){return!_0x41cc97[_0xb447('0xaa')](_0x4aadc1[_0xb447('0xab')]);});var _0x48e873=[];var _0x523d3b=[];_0x1676dc[_0xb447('0xac')](function(_0x829187){if(_0x829187['@odata.type']){var _0x551469=_0x829187[_0xb447('0xad')]['substring'](_0x829187['@odata.type'][_0xb447('0xa0')]('.')+0x1);if(_0x551469==='PicklistAttributeMetadata'){_0x48e873[_0xb447('0xae')](getSelectList(_0x2a4599,_0x46dca9,_0x523d3b,_0x5868e0[_0xb447('0xaf')],_0x829187[_0xb447('0xaf')],_0x331d67));}}});return Promise[_0xb447('0xb0')](_0x48e873);})['then'](function(_0x51db31){_0x405566=_0x51db31[0x0];var _0x458532=[];var _0x21fe36=[];_0x1676dc[_0xb447('0xac')](function(_0x3de632){if(!_[_0xb447('0xb1')](_0x3de632[_0xb447('0xad')])){var _0x5c2fc2=_0x3de632[_0xb447('0xad')][_0xb447('0x9f')](_0x3de632[_0xb447('0xad')][_0xb447('0xa0')]('.')+0x1);if(_0x5c2fc2===_0xb447('0xb2')){_0x458532['push'](getBooleanList(_0x2a4599,_0x46dca9,_0x21fe36,_0x5868e0['MetadataId'],_0x3de632[_0xb447('0xaf')],_0x331d67));}}});return Promise[_0xb447('0xb0')](_0x458532);})[_0xb447('0x43')](function(_0x5a2095){_0x7ddc3e=_0x5a2095[0x0];var _0x393b52=[];var _0x55149c=[];_0x1676dc[_0xb447('0xac')](function(_0x283ac6){if(_0x283ac6['@odata.type']){var _0x20e5c8=_0x283ac6[_0xb447('0xad')][_0xb447('0x9f')](_0x283ac6[_0xb447('0xad')][_0xb447('0xa0')]('.')+0x1);if(_0x20e5c8===_0xb447('0xb3')||_0x20e5c8===_0xb447('0xb4')||_0x20e5c8===_0xb447('0xb5')||_0x20e5c8===_0xb447('0xb6')||_0x20e5c8===_0xb447('0xb7')||_0x20e5c8===_0xb447('0xb8')||_0x20e5c8===_0xb447('0xb9')||_0x20e5c8===_0xb447('0xba')||_0x20e5c8===_0xb447('0xbb')||_0x20e5c8==='DecimalAttributeMetadata'){_0x393b52[_0xb447('0xae')](getInputList(_0x2a4599,_0x46dca9,_0x20e5c8,_0x55149c,_0x5868e0[_0xb447('0xaf')],_0x283ac6[_0xb447('0xaf')],_0x331d67));}}});return Promise[_0xb447('0xb0')](_0x393b52);})[_0xb447('0x43')](function(_0x474280){_0x3949b6=_0x474280[0x0];var _0x1b8e20=_0x405566[_0xb447('0xbc')](_0x7ddc3e)['concat'](_0x3949b6);var _0x286cc8={'count':_0x1b8e20[_0xb447('0x39')],'rows':_0x1b8e20};return _0x286cc8;})[_0xb447('0x43')](respondWithResult(_0x4ba3da,null))[_0xb447('0x46')](function(_0x108c4b){var _0x3d9685=_0x229585[_0xb447('0x32')][_0xb447('0xbd')]?0x1f4:_0x108c4b[_0xb447('0xbe')]||0x1f4;logger[_0xb447('0x29')](_0x108c4b[_0xb447('0x2a')]);delete _0x108c4b[_0xb447('0x2b')];if(_0x3d9685===0x191){_0x3d9685=0x190;}_0x4ba3da['status'](_0x3d9685)[_0xb447('0x2c')](_0x229585[_0xb447('0x32')][_0xb447('0xbd')]?{'message':_0xb447('0xbf'),'statusCode':_0x108c4b[_0xb447('0xbe')]}:_0x108c4b);});};function getSelectList(_0xa4cad4,_0x321cbc,_0x595284,_0x55609b,_0x537c63,_0x445b4f){var _0x547b75={'method':'GET','uri':_0xa4cad4+_0xb447('0xc0')+_0x55609b+')/Attributes('+_0x537c63+_0xb447('0xc1')+_0xb447('0xc2'),'headers':{'Authorization':_0xb447('0xc3')+_0x445b4f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x547b75)[_0xb447('0x43')](function(_0x1ce059){var _0x231a16=[];var _0x19f4df=_0x1ce059['OptionSet'][_0xb447('0xc4')];_0x19f4df[_0xb447('0xac')](function(_0x5981c2){_0x231a16[_0xb447('0xae')]({'name':_0x5981c2[_0xb447('0xc5')][_0xb447('0xc6')]['Label'],'value':String(_0x5981c2[_0xb447('0xc7')])});});var _0x54d483={'id':_0x321cbc+'_'+_0x1ce059['LogicalName'],'name':_0x1ce059[_0xb447('0xc8')][_0xb447('0xc6')][_0xb447('0xc5')],'custom':![],'options':_0x231a16};_0x595284[_0xb447('0xae')](_0x54d483);return _0x595284;});}function getBooleanList(_0x4f7963,_0x2f6d56,_0x584470,_0x1e3943,_0x234fd2,_0x319dd0){var _0x24ef06={'method':_0xb447('0xc9'),'uri':_0x4f7963+'EntityDefinitions('+_0x1e3943+')/Attributes('+_0x234fd2+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xb447('0xc3')+_0x319dd0,'If-None-Match':null,'OData-Version':_0xb447('0xa8')},'json':!![]};return rp(_0x24ef06)[_0xb447('0x43')](function(_0x27251c){var _0x161270=[];_0x161270['push']({'name':_0x27251c[_0xb447('0xca')][_0xb447('0xcb')][_0xb447('0xc5')][_0xb447('0xc6')][_0xb447('0xc5')],'value':_0xb447('0xcc')},{'name':_0x27251c['OptionSet']['FalseOption'][_0xb447('0xc5')]['UserLocalizedLabel']['Label'],'value':'false'});var _0x4c3b8b={'id':_0x2f6d56+'_'+_0x27251c['LogicalName'],'name':_0x27251c[_0xb447('0xc8')][_0xb447('0xc6')][_0xb447('0xc5')],'custom':![],'options':_0x161270};_0x584470[_0xb447('0xae')](_0x4c3b8b);return _0x584470;});}function getInputList(_0x2969c1,_0x40c685,_0x4014c3,_0x2b50a1,_0xee7230,_0x47052f,_0xab052){var _0x8f8aa1={'method':_0xb447('0xc9'),'uri':_0x2969c1+_0xb447('0xc0')+_0xee7230+_0xb447('0xcd')+_0x47052f+_0xb447('0xce')+_0x4014c3+_0xb447('0xcf'),'headers':{'Authorization':_0xb447('0xc3')+_0xab052,'If-None-Match':null,'OData-Version':_0xb447('0xa8')},'json':!![]};return rp(_0x8f8aa1)[_0xb447('0x43')](function(_0x2a29be){var _0x3dbdb3={'id':_0x40c685+'_'+_0x2a29be[_0xb447('0xab')],'name':_0x2a29be[_0xb447('0xc8')][_0xb447('0xc6')]?_0x2a29be[_0xb447('0xc8')][_0xb447('0xc6')]['Label']:_0x2a29be[_0xb447('0xab')],'custom':![],'options':[]};_0x2b50a1[_0xb447('0xae')](_0x3dbdb3);return _0x2b50a1;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 0bcb9cc..556d6f7 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x12b72b,_0x5a6718){var _0x35b7cf=function(_0x482fe0){while(--_0x482fe0){_0x12b72b['push'](_0x12b72b['shift']());}};_0x35b7cf(++_0x5a6718);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1255cc,_0x53e747){var _0x175f70=function(_0x5098f9){while(--_0x5098f9){_0x1255cc['push'](_0x1255cc['shift']());}};_0x175f70(++_0x53e747);}(_0x757a,0xde));var _0xa757=function(_0x3faf86,_0x36adf6){_0x3faf86=_0x3faf86-0x0;var _0x46e80d=_0x757a[_0x3faf86];return _0x46e80d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index afa2d14..3c67feb 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 _0xc8a5=['request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','attributes','limit','include','map','model','ShowDynamics365Account','Dynamics365Account','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4966ce,_0x2c5c80){var _0x4426aa=function(_0x48560a){while(--_0x48560a){_0x4966ce['push'](_0x4966ce['shift']());}};_0x4426aa(++_0x2c5c80);}(_0xc8a5,0x1f3));var _0x5c8a=function(_0x251acf,_0x3aa907){_0x251acf=_0x251acf-0x0;var _0x2d9fcd=_0xc8a5[_0x251acf];return _0x2d9fcd;};'use strict';var _=require('lodash');var util=require(_0x5c8a('0x0'));var moment=require(_0x5c8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x5c8a('0x2'));var fs=require('fs');var Redis=require(_0x5c8a('0x3'));var db=require(_0x5c8a('0x4'))['db'];var utils=require(_0x5c8a('0x5'));var logger=require(_0x5c8a('0x6'))('rpc');var config=require(_0x5c8a('0x7'));var jayson=require(_0x5c8a('0x8'));var client=jayson[_0x5c8a('0x9')][_0x5c8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d5b68,_0x50c706,_0x487792){return new BPromise(function(_0xc143db,_0x2a3939){return client[_0x5c8a('0xb')](_0x1d5b68,_0x487792)[_0x5c8a('0xc')](function(_0x10d293){logger[_0x5c8a('0xd')](_0x5c8a('0xe'),_0x50c706,_0x5c8a('0xf'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x50c706,_0x5c8a('0xf'),JSON[_0x5c8a('0x10')](_0x10d293));if(_0x10d293[_0x5c8a('0x11')]){if(_0x10d293[_0x5c8a('0x11')][_0x5c8a('0x12')]===0x1f4){logger[_0x5c8a('0x11')](_0x5c8a('0xe'),_0x50c706,_0x10d293['error'][_0x5c8a('0x13')]);return _0x2a3939(_0x10d293[_0x5c8a('0x11')]['message']);}logger[_0x5c8a('0x11')](_0x5c8a('0xe'),_0x50c706,_0x10d293[_0x5c8a('0x11')][_0x5c8a('0x13')]);return _0xc143db(_0x10d293[_0x5c8a('0x11')]['message']);}else{logger['info'](_0x5c8a('0xe'),_0x50c706,_0x5c8a('0xf'));_0xc143db(_0x10d293[_0x5c8a('0x14')][_0x5c8a('0x13')]);}})[_0x5c8a('0x15')](function(_0x5e45da){logger[_0x5c8a('0x11')](_0x5c8a('0xe'),_0x50c706,_0x5e45da);_0x2a3939(_0x5e45da);});});}exports[_0x5c8a('0x16')]=function(_0x20990b){var _0x504cdb=this;return new Promise(function(_0x48bde1,_0x1d553e){return db['Dynamics365Account'][_0x5c8a('0x17')]({'raw':_0x20990b[_0x5c8a('0x18')]?_0x20990b['options'][_0x5c8a('0x19')]===undefined?!![]:![]:!![],'where':_0x20990b[_0x5c8a('0x18')]?_0x20990b['options']['where']||null:null,'attributes':_0x20990b[_0x5c8a('0x18')]?_0x20990b[_0x5c8a('0x18')][_0x5c8a('0x1a')]||null:null,'limit':_0x20990b[_0x5c8a('0x18')]?_0x20990b[_0x5c8a('0x18')][_0x5c8a('0x1b')]||null:null,'include':_0x20990b[_0x5c8a('0x18')]?_0x20990b['options'][_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x20990b['options'][_0x5c8a('0x1c')],function(_0x3a3b87){return{'model':db[_0x3a3b87[_0x5c8a('0x1e')]],'as':_0x3a3b87['as'],'attributes':_0x3a3b87['attributes'],'include':_0x3a3b87[_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x3a3b87[_0x5c8a('0x1c')],function(_0x353d91){return{'model':db[_0x353d91[_0x5c8a('0x1e')]],'as':_0x353d91['as'],'attributes':_0x353d91[_0x5c8a('0x1a')],'include':_0x353d91['include']?_[_0x5c8a('0x1d')](_0x353d91['include'],function(_0x223f7d){return{'model':db[_0x223f7d['model']],'as':_0x223f7d['as'],'attributes':_0x223f7d[_0x5c8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5c8a('0xc')](function(_0x511c65){logger['info'](_0x5c8a('0x16'),_0x20990b);logger['debug']('GetDynamics365Account',_0x20990b,JSON[_0x5c8a('0x10')](_0x511c65));_0x48bde1(_0x511c65);})['catch'](function(_0x243be3){logger['error'](_0x5c8a('0x16'),_0x243be3['message'],_0x20990b);_0x1d553e(_0x504cdb[_0x5c8a('0x11')](0x1f4,_0x243be3[_0x5c8a('0x13')]));});});};exports[_0x5c8a('0x1f')]=function(_0x153406){var _0x2ada8b=this;return new Promise(function(_0x58c21f,_0x2a2fcd){return db[_0x5c8a('0x20')][_0x5c8a('0x21')]({'raw':_0x153406[_0x5c8a('0x18')]?_0x153406['options'][_0x5c8a('0x19')]===undefined?!![]:![]:!![],'where':_0x153406['options']?_0x153406[_0x5c8a('0x18')]['where']||null:null,'attributes':_0x153406[_0x5c8a('0x18')]?_0x153406['options']['attributes']||null:null,'include':_0x153406[_0x5c8a('0x18')]?_0x153406[_0x5c8a('0x18')][_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x153406[_0x5c8a('0x18')]['include'],function(_0x362502){return{'model':db[_0x362502[_0x5c8a('0x1e')]],'as':_0x362502['as'],'attributes':_0x362502[_0x5c8a('0x1a')],'include':_0x362502[_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x362502[_0x5c8a('0x1c')],function(_0x1f9a97){return{'model':db[_0x1f9a97[_0x5c8a('0x1e')]],'as':_0x1f9a97['as'],'attributes':_0x1f9a97[_0x5c8a('0x1a')],'include':_0x1f9a97[_0x5c8a('0x1c')]?_[_0x5c8a('0x1d')](_0x1f9a97[_0x5c8a('0x1c')],function(_0x84674){return{'model':db[_0x84674[_0x5c8a('0x1e')]],'as':_0x84674['as'],'attributes':_0x84674['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x181200){logger[_0x5c8a('0xd')]('ShowDynamics365Account',_0x153406);logger['debug'](_0x5c8a('0x1f'),_0x153406,JSON['stringify'](_0x181200));_0x58c21f(_0x181200);})['catch'](function(_0x10d08a){logger[_0x5c8a('0x11')]('ShowDynamics365Account',_0x10d08a[_0x5c8a('0x13')],_0x153406);_0x2a2fcd(_0x2ada8b[_0x5c8a('0x11')](0x1f4,_0x10d08a[_0x5c8a('0x13')]));});});}; \ No newline at end of file +var _0x147f=['message','catch','GetDynamics365Account','findAll','options','where','include','map','model','attributes','Dynamics365Account','find','ShowDynamics365Account','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4f0888,_0x5163d5){var _0x341b9d=function(_0x3506a5){while(--_0x3506a5){_0x4f0888['push'](_0x4f0888['shift']());}};_0x341b9d(++_0x5163d5);}(_0x147f,0x19b));var _0xf147=function(_0x2bf81c,_0xd5d857){_0x2bf81c=_0x2bf81c-0x0;var _0x1d8208=_0x147f[_0x2bf81c];return _0x1d8208;};'use strict';var _=require(_0xf147('0x0'));var util=require(_0xf147('0x1'));var moment=require(_0xf147('0x2'));var BPromise=require('bluebird');var rs=require(_0xf147('0x3'));var fs=require('fs');var Redis=require(_0xf147('0x4'));var db=require(_0xf147('0x5'))['db'];var utils=require(_0xf147('0x6'));var logger=require(_0xf147('0x7'))('rpc');var config=require(_0xf147('0x8'));var jayson=require(_0xf147('0x9'));var client=jayson[_0xf147('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57e34e,_0x3ae5c4,_0x3f000f){return new BPromise(function(_0x3124dd,_0xe12103){return client['request'](_0x57e34e,_0x3f000f)[_0xf147('0xb')](function(_0x4ebdf3){logger[_0xf147('0xc')](_0xf147('0xd'),_0x3ae5c4,_0xf147('0xe'));logger['debug'](_0xf147('0xf'),_0x3ae5c4,'request\x20sent',JSON['stringify'](_0x4ebdf3));if(_0x4ebdf3[_0xf147('0x10')]){if(_0x4ebdf3[_0xf147('0x10')][_0xf147('0x11')]===0x1f4){logger[_0xf147('0x10')](_0xf147('0xd'),_0x3ae5c4,_0x4ebdf3[_0xf147('0x10')][_0xf147('0x12')]);return _0xe12103(_0x4ebdf3[_0xf147('0x10')][_0xf147('0x12')]);}logger[_0xf147('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x3ae5c4,_0x4ebdf3[_0xf147('0x10')][_0xf147('0x12')]);return _0x3124dd(_0x4ebdf3['error'][_0xf147('0x12')]);}else{logger[_0xf147('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x3ae5c4,_0xf147('0xe'));_0x3124dd(_0x4ebdf3['result']['message']);}})[_0xf147('0x13')](function(_0x3699d8){logger[_0xf147('0x10')](_0xf147('0xd'),_0x3ae5c4,_0x3699d8);_0xe12103(_0x3699d8);});});}exports[_0xf147('0x14')]=function(_0x307b72){var _0x25038c=this;return new Promise(function(_0x306d7a,_0x163d99){return db['Dynamics365Account'][_0xf147('0x15')]({'raw':_0x307b72[_0xf147('0x16')]?_0x307b72[_0xf147('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x307b72[_0xf147('0x16')]?_0x307b72[_0xf147('0x16')][_0xf147('0x17')]||null:null,'attributes':_0x307b72[_0xf147('0x16')]?_0x307b72[_0xf147('0x16')]['attributes']||null:null,'limit':_0x307b72['options']?_0x307b72[_0xf147('0x16')]['limit']||null:null,'include':_0x307b72[_0xf147('0x16')]?_0x307b72[_0xf147('0x16')][_0xf147('0x18')]?_[_0xf147('0x19')](_0x307b72[_0xf147('0x16')][_0xf147('0x18')],function(_0x322971){return{'model':db[_0x322971[_0xf147('0x1a')]],'as':_0x322971['as'],'attributes':_0x322971[_0xf147('0x1b')],'include':_0x322971[_0xf147('0x18')]?_[_0xf147('0x19')](_0x322971[_0xf147('0x18')],function(_0x53415b){return{'model':db[_0x53415b[_0xf147('0x1a')]],'as':_0x53415b['as'],'attributes':_0x53415b[_0xf147('0x1b')],'include':_0x53415b[_0xf147('0x18')]?_['map'](_0x53415b[_0xf147('0x18')],function(_0x21e42d){return{'model':db[_0x21e42d[_0xf147('0x1a')]],'as':_0x21e42d['as'],'attributes':_0x21e42d[_0xf147('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf147('0xb')](function(_0x4942d1){logger[_0xf147('0xc')](_0xf147('0x14'),_0x307b72);logger['debug'](_0xf147('0x14'),_0x307b72,JSON['stringify'](_0x4942d1));_0x306d7a(_0x4942d1);})[_0xf147('0x13')](function(_0x4deb8d){logger[_0xf147('0x10')](_0xf147('0x14'),_0x4deb8d[_0xf147('0x12')],_0x307b72);_0x163d99(_0x25038c[_0xf147('0x10')](0x1f4,_0x4deb8d[_0xf147('0x12')]));});});};exports['ShowDynamics365Account']=function(_0xa35be9){var _0x4dc793=this;return new Promise(function(_0x25c106,_0xef3166){return db[_0xf147('0x1c')][_0xf147('0x1d')]({'raw':_0xa35be9['options']?_0xa35be9[_0xf147('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xa35be9[_0xf147('0x16')]?_0xa35be9[_0xf147('0x16')][_0xf147('0x17')]||null:null,'attributes':_0xa35be9[_0xf147('0x16')]?_0xa35be9[_0xf147('0x16')][_0xf147('0x1b')]||null:null,'include':_0xa35be9['options']?_0xa35be9['options'][_0xf147('0x18')]?_[_0xf147('0x19')](_0xa35be9[_0xf147('0x16')][_0xf147('0x18')],function(_0x3679e7){return{'model':db[_0x3679e7['model']],'as':_0x3679e7['as'],'attributes':_0x3679e7[_0xf147('0x1b')],'include':_0x3679e7[_0xf147('0x18')]?_[_0xf147('0x19')](_0x3679e7['include'],function(_0x5461a8){return{'model':db[_0x5461a8[_0xf147('0x1a')]],'as':_0x5461a8['as'],'attributes':_0x5461a8[_0xf147('0x1b')],'include':_0x5461a8[_0xf147('0x18')]?_[_0xf147('0x19')](_0x5461a8[_0xf147('0x18')],function(_0x48b10a){return{'model':db[_0x48b10a[_0xf147('0x1a')]],'as':_0x48b10a['as'],'attributes':_0x48b10a['attributes']};}):[]};}):[]};}):[]:[]})[_0xf147('0xb')](function(_0x355c20){logger[_0xf147('0xc')](_0xf147('0x1e'),_0xa35be9);logger[_0xf147('0x1f')](_0xf147('0x1e'),_0xa35be9,JSON[_0xf147('0x20')](_0x355c20));_0x25c106(_0x355c20);})['catch'](function(_0x214f48){logger['error'](_0xf147('0x1e'),_0x214f48['message'],_0xa35be9);_0xef3166(_0x4dc793[_0xf147('0x10')](0x1f4,_0x214f48[_0xf147('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 3f4ba11..9298ff0 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 _0x6447=['exports','util','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','post','put','update','delete','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6447,0xb5));var _0x7644=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x6447[_0x5e4563];return _0x8d1bf5;};'use strict';var multer=require('multer');var util=require(_0x7644('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7644('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7644('0x2'));var interaction=require(_0x7644('0x3'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x7644('0x4')]('/',auth[_0x7644('0x5')](),controller[_0x7644('0x6')]);router[_0x7644('0x4')](_0x7644('0x7'),auth[_0x7644('0x5')](),controller[_0x7644('0x8')]);router['get'](_0x7644('0x9'),auth[_0x7644('0x5')](),controller['getFields']);router['get'](_0x7644('0xa'),auth[_0x7644('0x5')](),controller[_0x7644('0xb')]);router[_0x7644('0x4')]('/:id/descriptions',auth[_0x7644('0x5')](),controller['getDescriptions']);router[_0x7644('0xc')]('/',auth[_0x7644('0x5')](),controller['create']);router[_0x7644('0xd')](_0x7644('0x7'),auth[_0x7644('0x5')](),controller[_0x7644('0xe')]);router[_0x7644('0xf')](_0x7644('0x7'),auth[_0x7644('0x5')](),controller[_0x7644('0x10')]);module[_0x7644('0x11')]=router; \ No newline at end of file +var _0x088d=['/:id/subjects','/:id/descriptions','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x4496f1,_0x2b87fb){var _0x3bb949=function(_0x277181){while(--_0x277181){_0x4496f1['push'](_0x4496f1['shift']());}};_0x3bb949(++_0x2b87fb);}(_0x088d,0x10a));var _0xd088=function(_0x1f2d02,_0x3b9511){_0x1f2d02=_0x1f2d02-0x0;var _0x1e6898=_0x088d[_0x1f2d02];return _0x1e6898;};'use strict';var multer=require('multer');var util=require(_0xd088('0x0'));var path=require(_0xd088('0x1'));var timeout=require(_0xd088('0x2'));var express=require(_0xd088('0x3'));var router=express[_0xd088('0x4')]();var fs_extra=require(_0xd088('0x5'));var auth=require(_0xd088('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0xd088('0x7')]('/',auth[_0xd088('0x8')](),controller[_0xd088('0x9')]);router[_0xd088('0x7')](_0xd088('0xa'),auth['isAuthenticated'](),controller[_0xd088('0xb')]);router[_0xd088('0x7')](_0xd088('0xc'),auth[_0xd088('0x8')](),controller[_0xd088('0xd')]);router[_0xd088('0x7')](_0xd088('0xe'),auth[_0xd088('0x8')](),controller['getSubjects']);router[_0xd088('0x7')](_0xd088('0xf'),auth[_0xd088('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0xd088('0x8')](),controller[_0xd088('0x10')]);router[_0xd088('0x11')]('/:id',auth[_0xd088('0x8')](),controller['update']);router[_0xd088('0x12')]('/:id',auth[_0xd088('0x8')](),controller[_0xd088('0x13')]);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 4fd6d3b..25e6458 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 _0xd9d7=['phonecall','incident','sequelize','exports','STRING','ENUM'];(function(_0x2d1c98,_0x3a2c95){var _0x4063ae=function(_0x2e16b5){while(--_0x2e16b5){_0x2d1c98['push'](_0x2d1c98['shift']());}};_0x4063ae(++_0x3a2c95);}(_0xd9d7,0x68));var _0x7d9d=function(_0x49f8c2,_0x5166b7){_0x49f8c2=_0x49f8c2-0x0;var _0x3e63ec=_0xd9d7[_0x49f8c2];return _0x3e63ec;};'use strict';var Sequelize=require(_0x7d9d('0x0'));module[_0x7d9d('0x1')]={'name':{'type':Sequelize[_0x7d9d('0x2')]},'description':{'type':Sequelize[_0x7d9d('0x2')]},'ticketType':{'type':Sequelize[_0x7d9d('0x3')]('incident',_0x7d9d('0x4')),'defaultValue':_0x7d9d('0x5')}}; \ No newline at end of file +var _0xa3ed=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x1869f3,_0x5c1294){var _0x5c79f2=function(_0x267fa8){while(--_0x267fa8){_0x1869f3['push'](_0x1869f3['shift']());}};_0x5c79f2(++_0x5c1294);}(_0xa3ed,0x13e));var _0xda3e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa3ed[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xda3e('0x0'));module[_0xda3e('0x1')]={'name':{'type':Sequelize[_0xda3e('0x2')]},'description':{'type':Sequelize[_0xda3e('0x2')]},'ticketType':{'type':Sequelize[_0xda3e('0x3')](_0xda3e('0x4'),_0xda3e('0x5')),'defaultValue':_0xda3e('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 3b95f79..f550b49 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 _0xe699=['stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','rows','catch','params','intersection','find','create','body','update','getFields','findOne','Dynamics365Field','order','options','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','save','then','destroy','error'];(function(_0x54190a,_0x240d6f){var _0x47e961=function(_0x3d631b){while(--_0x3d631b){_0x54190a['push'](_0x54190a['shift']());}};_0x47e961(++_0x240d6f);}(_0xe699,0x118));var _0x9e69=function(_0x3c04d0,_0x557b15){_0x3c04d0=_0x3c04d0-0x0;var _0x41d35b=_0xe699[_0x3c04d0];return _0x41d35b;};'use strict';var emlformat=require(_0x9e69('0x0'));var rimraf=require(_0x9e69('0x1'));var zipdir=require(_0x9e69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e69('0x3'));var Mustache=require(_0x9e69('0x4'));var util=require(_0x9e69('0x5'));var path=require(_0x9e69('0x6'));var sox=require(_0x9e69('0x7'));var csv=require(_0x9e69('0x8'));var ejs=require(_0x9e69('0x9'));var fs=require('fs');var fs_extra=require(_0x9e69('0xa'));var _=require(_0x9e69('0xb'));var squel=require(_0x9e69('0xc'));var crypto=require(_0x9e69('0xd'));var jsforce=require(_0x9e69('0xe'));var deskjs=require(_0x9e69('0xf'));var toCsv=require(_0x9e69('0x8'));var querystring=require(_0x9e69('0x10'));var Papa=require(_0x9e69('0x11'));var Redis=require(_0x9e69('0x12'));var authService=require(_0x9e69('0x13'));var qs=require(_0x9e69('0x14'));var as=require(_0x9e69('0x15'));var hardwareService=require(_0x9e69('0x16'));var logger=require('../../config/logger')(_0x9e69('0x17'));var utils=require(_0x9e69('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9e69('0x19'));var db=require(_0x9e69('0x1a'))['db'];function respondWithStatusCode(_0x3788f6,_0x152df8){_0x152df8=_0x152df8||0xcc;return function(_0x2cad08){if(_0x2cad08){return _0x3788f6[_0x9e69('0x1b')](_0x152df8);}return _0x3788f6[_0x9e69('0x1c')](_0x152df8)[_0x9e69('0x1d')]();};}function respondWithResult(_0x1b1e5f,_0x136a5e){_0x136a5e=_0x136a5e||0xc8;return function(_0x13347f){if(_0x13347f){return _0x1b1e5f[_0x9e69('0x1c')](_0x136a5e)['json'](_0x13347f);}};}function respondWithFilteredResult(_0x433a68,_0x1fc0ba){return function(_0x431e90){if(_0x431e90){var _0x2afd30=typeof _0x1fc0ba[_0x9e69('0x1e')]===_0x9e69('0x1f')&&typeof _0x1fc0ba[_0x9e69('0x20')]===_0x9e69('0x1f');var _0x4415c4=_0x431e90['count'];var _0x33833=_0x2afd30?0x0:_0x1fc0ba[_0x9e69('0x1e')];var _0x240b8d=_0x2afd30?_0x431e90[_0x9e69('0x21')]:_0x1fc0ba[_0x9e69('0x1e')]+_0x1fc0ba[_0x9e69('0x20')];var _0x337077;if(_0x240b8d>=_0x4415c4){_0x240b8d=_0x4415c4;_0x337077=0xc8;}else{_0x337077=0xce;}_0x433a68[_0x9e69('0x1c')](_0x337077);return _0x433a68[_0x9e69('0x22')]('Content-Range',_0x33833+'-'+_0x240b8d+'/'+_0x4415c4)[_0x9e69('0x23')](_0x431e90);}return null;};}function patchUpdates(_0x39efd2){return function(_0x5c466f){try{jsonpatch['apply'](_0x5c466f,_0x39efd2,!![]);}catch(_0x180003){return BPromise['reject'](_0x180003);}return _0x5c466f[_0x9e69('0x24')]();};}function saveUpdates(_0x5e2daa,_0x4c83dd){return function(_0x533349){if(_0x533349){return _0x533349['update'](_0x5e2daa)[_0x9e69('0x25')](function(_0x2291d4){return _0x2291d4;});}return null;};}function removeEntity(_0x4c80c5,_0x31ce3a){return function(_0x1fe9e5){if(_0x1fe9e5){return _0x1fe9e5[_0x9e69('0x26')]()['then'](function(){_0x4c80c5[_0x9e69('0x1c')](0xcc)[_0x9e69('0x1d')]();});}};}function handleEntityNotFound(_0x2d30d0,_0x1fe317){return function(_0x3c3e75){if(!_0x3c3e75){_0x2d30d0[_0x9e69('0x1b')](0x194);}return _0x3c3e75;};}function handleError(_0x476c30,_0x52ddb3){_0x52ddb3=_0x52ddb3||0x1f4;return function(_0x38a68a){logger[_0x9e69('0x27')](_0x38a68a[_0x9e69('0x28')]);if(_0x38a68a[_0x9e69('0x29')]){delete _0x38a68a[_0x9e69('0x29')];}_0x476c30[_0x9e69('0x1c')](_0x52ddb3)[_0x9e69('0x2a')](_0x38a68a);};}exports['index']=function(_0x5eb7bc,_0x829ce1){var _0x4d2b88={},_0x5565fc={},_0x142b70={'count':0x0,'rows':[]};var _0x40a005=_[_0x9e69('0x2b')](db[_0x9e69('0x2c')][_0x9e69('0x2d')],function(_0x4de698){return{'name':_0x4de698[_0x9e69('0x2e')],'type':_0x4de698['type'][_0x9e69('0x2f')]};});_0x5565fc['model']=_[_0x9e69('0x2b')](_0x40a005,'name');_0x5565fc[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x5eb7bc[_0x9e69('0x30')]);_0x5565fc[_0x9e69('0x32')]=_['intersection'](_0x5565fc[_0x9e69('0x33')],_0x5565fc[_0x9e69('0x30')]);_0x4d2b88['attributes']=_['intersection'](_0x5565fc[_0x9e69('0x33')],qs[_0x9e69('0x34')](_0x5eb7bc['query']['fields']));_0x4d2b88[_0x9e69('0x35')]=_0x4d2b88[_0x9e69('0x35')][_0x9e69('0x36')]?_0x4d2b88[_0x9e69('0x35')]:_0x5565fc[_0x9e69('0x33')];if(!_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x37')](_0x9e69('0x38'))){_0x4d2b88['limit']=qs['limit'](_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x20')]);_0x4d2b88[_0x9e69('0x1e')]=qs[_0x9e69('0x1e')](_0x5eb7bc[_0x9e69('0x30')]['offset']);}_0x4d2b88['order']=qs['sort'](_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x39')]);_0x4d2b88[_0x9e69('0x3a')]=qs['filters'](_[_0x9e69('0x3b')](_0x5eb7bc['query'],_0x5565fc[_0x9e69('0x32')]),_0x40a005);if(_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x3c')]){_0x4d2b88[_0x9e69('0x3a')]=_['merge'](_0x4d2b88['where'],{'$or':_[_0x9e69('0x2b')](_0x40a005,function(_0x88928a){if(_0x88928a[_0x9e69('0x3d')]!==_0x9e69('0x3e')){var _0x3de4c9={};_0x3de4c9[_0x88928a['name']]={'$like':'%'+_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x3c')]+'%'};return _0x3de4c9;}})});}_0x4d2b88=_[_0x9e69('0x3f')]({},_0x4d2b88,_0x5eb7bc['options']);var _0x58f5f0={'where':_0x4d2b88['where']};return db[_0x9e69('0x2c')][_0x9e69('0x21')](_0x58f5f0)['then'](function(_0x5ca49d){_0x142b70[_0x9e69('0x21')]=_0x5ca49d;if(_0x5eb7bc[_0x9e69('0x30')][_0x9e69('0x40')]){_0x4d2b88['include']=[{'all':!![]}];}return db[_0x9e69('0x2c')]['findAll'](_0x4d2b88);})[_0x9e69('0x25')](function(_0x4da7d5){_0x142b70[_0x9e69('0x41')]=_0x4da7d5;return _0x142b70;})[_0x9e69('0x25')](respondWithFilteredResult(_0x829ce1,_0x4d2b88))[_0x9e69('0x42')](handleError(_0x829ce1,null));};exports['show']=function(_0x973cbf,_0x2a9611){var _0x39490f={'raw':![],'where':{'id':_0x973cbf[_0x9e69('0x43')]['id']}},_0x5ad6c0={};_0x5ad6c0[_0x9e69('0x33')]=_['keys'](db[_0x9e69('0x2c')][_0x9e69('0x2d')]);_0x5ad6c0['query']=_['keys'](_0x973cbf['query']);_0x5ad6c0['filters']=_['intersection'](_0x5ad6c0[_0x9e69('0x33')],_0x5ad6c0['query']);_0x39490f[_0x9e69('0x35')]=_[_0x9e69('0x44')](_0x5ad6c0['model'],qs[_0x9e69('0x34')](_0x973cbf[_0x9e69('0x30')][_0x9e69('0x34')]));_0x39490f['attributes']=_0x39490f[_0x9e69('0x35')][_0x9e69('0x36')]?_0x39490f[_0x9e69('0x35')]:_0x5ad6c0[_0x9e69('0x33')];if(_0x973cbf['query'][_0x9e69('0x40')]){_0x39490f['include']=[{'all':!![]}];}_0x39490f=_[_0x9e69('0x3f')]({},_0x39490f,_0x973cbf['options']);return db[_0x9e69('0x2c')][_0x9e69('0x45')](_0x39490f)[_0x9e69('0x25')](handleEntityNotFound(_0x2a9611,null))['then'](respondWithResult(_0x2a9611,null))['catch'](handleError(_0x2a9611,null));};exports[_0x9e69('0x46')]=function(_0x112445,_0x4137d2){return db['Dynamics365Configuration'][_0x9e69('0x46')](_0x112445[_0x9e69('0x47')],{})[_0x9e69('0x25')](respondWithResult(_0x4137d2,0xc9))['catch'](handleError(_0x4137d2,null));};exports[_0x9e69('0x48')]=function(_0x54e81f,_0x3e4f92){if(_0x54e81f[_0x9e69('0x47')]['id']){delete _0x54e81f[_0x9e69('0x47')]['id'];}return db[_0x9e69('0x2c')][_0x9e69('0x45')]({'where':{'id':_0x54e81f[_0x9e69('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e4f92,null))[_0x9e69('0x25')](saveUpdates(_0x54e81f[_0x9e69('0x47')],null))[_0x9e69('0x25')](respondWithResult(_0x3e4f92,null))[_0x9e69('0x42')](handleError(_0x3e4f92,null));};exports[_0x9e69('0x26')]=function(_0x5c40e6,_0xf93fe2){return db[_0x9e69('0x2c')]['find']({'where':{'id':_0x5c40e6[_0x9e69('0x43')]['id']}})[_0x9e69('0x25')](handleEntityNotFound(_0xf93fe2,null))[_0x9e69('0x25')](removeEntity(_0xf93fe2,null))[_0x9e69('0x42')](handleError(_0xf93fe2,null));};exports[_0x9e69('0x49')]=function(_0x59eac2,_0x30a0fa,_0x42622a){var _0x326f50={};var _0x42e86e={};var _0x4b8a0d;var _0x4de80f;return db[_0x9e69('0x2c')][_0x9e69('0x4a')]({'where':{'id':_0x59eac2[_0x9e69('0x43')]['id']}})[_0x9e69('0x25')](handleEntityNotFound(_0x30a0fa,null))['then'](function(_0x1415d9){if(_0x1415d9){_0x4b8a0d=_0x1415d9;_0x42e86e['model']=_[_0x9e69('0x31')](db[_0x9e69('0x4b')][_0x9e69('0x2d')]);_0x42e86e[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x59eac2[_0x9e69('0x30')]);_0x42e86e['filters']=_['intersection'](_0x42e86e['model'],_0x42e86e['query']);_0x326f50[_0x9e69('0x35')]=_[_0x9e69('0x44')](_0x42e86e[_0x9e69('0x33')],qs[_0x9e69('0x34')](_0x59eac2[_0x9e69('0x30')]['fields']));_0x326f50[_0x9e69('0x35')]=_0x326f50[_0x9e69('0x35')]['length']?_0x326f50[_0x9e69('0x35')]:_0x42e86e[_0x9e69('0x33')];_0x326f50[_0x9e69('0x4c')]=qs['sort'](_0x59eac2[_0x9e69('0x30')]['sort']);_0x326f50[_0x9e69('0x3a')]=qs[_0x9e69('0x32')](_[_0x9e69('0x3b')](_0x59eac2[_0x9e69('0x30')],_0x42e86e[_0x9e69('0x32')]));if(_0x59eac2[_0x9e69('0x30')]['filter']){_0x326f50[_0x9e69('0x3a')]=_['merge'](_0x326f50['where'],{'$or':_[_0x9e69('0x2b')](_0x326f50['attributes'],function(_0x540ac6){var _0x3dcb7d={};_0x3dcb7d[_0x540ac6]={'$like':'%'+_0x59eac2[_0x9e69('0x30')][_0x9e69('0x3c')]+'%'};return _0x3dcb7d;})});}_0x326f50=_[_0x9e69('0x3f')]({},_0x326f50,_0x59eac2[_0x9e69('0x4d')]);return _0x4b8a0d[_0x9e69('0x49')](_0x326f50);}})[_0x9e69('0x25')](function(_0x886e78){if(_0x886e78){_0x4de80f=_0x886e78[_0x9e69('0x36')];if(!_0x59eac2['query'][_0x9e69('0x37')](_0x9e69('0x38'))){_0x326f50[_0x9e69('0x20')]=qs['limit'](_0x59eac2[_0x9e69('0x30')]['limit']);_0x326f50[_0x9e69('0x1e')]=qs[_0x9e69('0x1e')](_0x59eac2[_0x9e69('0x30')][_0x9e69('0x1e')]);}return _0x4b8a0d[_0x9e69('0x49')](_0x326f50);}})['then'](function(_0x4f34f8){if(_0x4f34f8){return _0x4f34f8?{'count':_0x4de80f,'rows':_0x4f34f8}:null;}})[_0x9e69('0x25')](respondWithResult(_0x30a0fa,null))[_0x9e69('0x42')](handleError(_0x30a0fa,null));};exports[_0x9e69('0x4e')]=function(_0x479bb9,_0x56eb20,_0x2243db){var _0xdb5cdf={};var _0x30589f={};var _0x546cef;var _0x2046c1;return db['Dynamics365Configuration'][_0x9e69('0x4a')]({'where':{'id':_0x479bb9[_0x9e69('0x43')]['id']}})[_0x9e69('0x25')](handleEntityNotFound(_0x56eb20,null))['then'](function(_0xadb439){if(_0xadb439){_0x546cef=_0xadb439;_0x30589f[_0x9e69('0x33')]=_[_0x9e69('0x31')](db['Dynamics365Field'][_0x9e69('0x2d')]);_0x30589f[_0x9e69('0x30')]=_[_0x9e69('0x31')](_0x479bb9[_0x9e69('0x30')]);_0x30589f[_0x9e69('0x32')]=_[_0x9e69('0x44')](_0x30589f[_0x9e69('0x33')],_0x30589f[_0x9e69('0x30')]);_0xdb5cdf['attributes']=_[_0x9e69('0x44')](_0x30589f[_0x9e69('0x33')],qs['fields'](_0x479bb9['query'][_0x9e69('0x34')]));_0xdb5cdf[_0x9e69('0x35')]=_0xdb5cdf['attributes'][_0x9e69('0x36')]?_0xdb5cdf[_0x9e69('0x35')]:_0x30589f[_0x9e69('0x33')];_0xdb5cdf[_0x9e69('0x4c')]=qs[_0x9e69('0x39')](_0x479bb9[_0x9e69('0x30')][_0x9e69('0x39')]);_0xdb5cdf[_0x9e69('0x3a')]=qs['filters'](_['pick'](_0x479bb9[_0x9e69('0x30')],_0x30589f['filters']));if(_0x479bb9['query'][_0x9e69('0x3c')]){_0xdb5cdf['where']=_[_0x9e69('0x3f')](_0xdb5cdf[_0x9e69('0x3a')],{'$or':_[_0x9e69('0x2b')](_0xdb5cdf[_0x9e69('0x35')],function(_0x32b2fd){var _0x2be472={};_0x2be472[_0x32b2fd]={'$like':'%'+_0x479bb9[_0x9e69('0x30')][_0x9e69('0x3c')]+'%'};return _0x2be472;})});}_0xdb5cdf=_[_0x9e69('0x3f')]({},_0xdb5cdf,_0x479bb9[_0x9e69('0x4d')]);return _0x546cef['getSubjects'](_0xdb5cdf);}})['then'](function(_0x1fcf35){if(_0x1fcf35){_0x2046c1=_0x1fcf35[_0x9e69('0x36')];if(!_0x479bb9[_0x9e69('0x30')][_0x9e69('0x37')]('nolimit')){_0xdb5cdf[_0x9e69('0x20')]=qs['limit'](_0x479bb9['query']['limit']);_0xdb5cdf['offset']=qs[_0x9e69('0x1e')](_0x479bb9[_0x9e69('0x30')][_0x9e69('0x1e')]);}return _0x546cef[_0x9e69('0x4e')](_0xdb5cdf);}})[_0x9e69('0x25')](function(_0x360017){if(_0x360017){return _0x360017?{'count':_0x2046c1,'rows':_0x360017}:null;}})['then'](respondWithResult(_0x56eb20,null))['catch'](handleError(_0x56eb20,null));};exports[_0x9e69('0x4f')]=function(_0x55ede9,_0x1a8192,_0x815aaa){var _0x1e7aee={};var _0x386ffc={};var _0x5a8a8e;var _0x11faf9;return db[_0x9e69('0x2c')][_0x9e69('0x4a')]({'where':{'id':_0x55ede9['params']['id']}})['then'](handleEntityNotFound(_0x1a8192,null))['then'](function(_0x1a5ebb){if(_0x1a5ebb){_0x5a8a8e=_0x1a5ebb;_0x386ffc['model']=_[_0x9e69('0x31')](db[_0x9e69('0x4b')][_0x9e69('0x2d')]);_0x386ffc[_0x9e69('0x30')]=_['keys'](_0x55ede9[_0x9e69('0x30')]);_0x386ffc[_0x9e69('0x32')]=_['intersection'](_0x386ffc['model'],_0x386ffc[_0x9e69('0x30')]);_0x1e7aee['attributes']=_[_0x9e69('0x44')](_0x386ffc['model'],qs[_0x9e69('0x34')](_0x55ede9[_0x9e69('0x30')][_0x9e69('0x34')]));_0x1e7aee[_0x9e69('0x35')]=_0x1e7aee[_0x9e69('0x35')][_0x9e69('0x36')]?_0x1e7aee[_0x9e69('0x35')]:_0x386ffc[_0x9e69('0x33')];_0x1e7aee[_0x9e69('0x4c')]=qs[_0x9e69('0x39')](_0x55ede9[_0x9e69('0x30')][_0x9e69('0x39')]);_0x1e7aee[_0x9e69('0x3a')]=qs[_0x9e69('0x32')](_['pick'](_0x55ede9[_0x9e69('0x30')],_0x386ffc[_0x9e69('0x32')]));if(_0x55ede9['query'][_0x9e69('0x3c')]){_0x1e7aee['where']=_[_0x9e69('0x3f')](_0x1e7aee[_0x9e69('0x3a')],{'$or':_[_0x9e69('0x2b')](_0x1e7aee[_0x9e69('0x35')],function(_0x421a84){var _0x47ceb3={};_0x47ceb3[_0x421a84]={'$like':'%'+_0x55ede9[_0x9e69('0x30')]['filter']+'%'};return _0x47ceb3;})});}_0x1e7aee=_[_0x9e69('0x3f')]({},_0x1e7aee,_0x55ede9[_0x9e69('0x4d')]);return _0x5a8a8e[_0x9e69('0x4f')](_0x1e7aee);}})[_0x9e69('0x25')](function(_0x2217b1){if(_0x2217b1){_0x11faf9=_0x2217b1[_0x9e69('0x36')];if(!_0x55ede9[_0x9e69('0x30')][_0x9e69('0x37')](_0x9e69('0x38'))){_0x1e7aee[_0x9e69('0x20')]=qs[_0x9e69('0x20')](_0x55ede9[_0x9e69('0x30')][_0x9e69('0x20')]);_0x1e7aee[_0x9e69('0x1e')]=qs[_0x9e69('0x1e')](_0x55ede9['query'][_0x9e69('0x1e')]);}return _0x5a8a8e[_0x9e69('0x4f')](_0x1e7aee);}})[_0x9e69('0x25')](function(_0x4c738d){if(_0x4c738d){return _0x4c738d?{'count':_0x11faf9,'rows':_0x4c738d}:null;}})[_0x9e69('0x25')](respondWithResult(_0x1a8192,null))[_0x9e69('0x42')](handleError(_0x1a8192,null));}; \ No newline at end of file +var _0xed88=['params','keys','intersection','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x135ab9,_0xf93a9){var _0x589e3c=function(_0x16d9df){while(--_0x16d9df){_0x135ab9['push'](_0x135ab9['shift']());}};_0x589e3c(++_0xf93a9);}(_0xed88,0x14b));var _0x8ed8=function(_0x4c282b,_0x52d891){_0x4c282b=_0x4c282b-0x0;var _0x4ab159=_0xed88[_0x4c282b];return _0x4ab159;};'use strict';var emlformat=require(_0x8ed8('0x0'));var rimraf=require(_0x8ed8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ed8('0x2'));var rp=require('request-promise');var moment=require(_0x8ed8('0x3'));var BPromise=require(_0x8ed8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8ed8('0x5'));var sox=require(_0x8ed8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ed8('0x7'));var _=require(_0x8ed8('0x8'));var squel=require('squel');var crypto=require(_0x8ed8('0x9'));var jsforce=require(_0x8ed8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8ed8('0xb'));var querystring=require(_0x8ed8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ed8('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x8ed8('0xe'));var hardwareService=require(_0x8ed8('0xf'));var logger=require(_0x8ed8('0x10'))(_0x8ed8('0x11'));var utils=require(_0x8ed8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8ed8('0x13'));var db=require(_0x8ed8('0x14'))['db'];function respondWithStatusCode(_0x4088ac,_0x41f4a4){_0x41f4a4=_0x41f4a4||0xcc;return function(_0x5d29a7){if(_0x5d29a7){return _0x4088ac['sendStatus'](_0x41f4a4);}return _0x4088ac[_0x8ed8('0x15')](_0x41f4a4)['end']();};}function respondWithResult(_0x3d41e0,_0x5094d9){_0x5094d9=_0x5094d9||0xc8;return function(_0x45d6e8){if(_0x45d6e8){return _0x3d41e0[_0x8ed8('0x15')](_0x5094d9)[_0x8ed8('0x16')](_0x45d6e8);}};}function respondWithFilteredResult(_0x1cc462,_0x17123b){return function(_0x530f1b){if(_0x530f1b){var _0x42cc28=typeof _0x17123b['offset']==='undefined'&&typeof _0x17123b['limit']==='undefined';var _0x2333e8=_0x530f1b[_0x8ed8('0x17')];var _0xc6989a=_0x42cc28?0x0:_0x17123b[_0x8ed8('0x18')];var _0x4ecad7=_0x42cc28?_0x530f1b[_0x8ed8('0x17')]:_0x17123b[_0x8ed8('0x18')]+_0x17123b['limit'];var _0x118f16;if(_0x4ecad7>=_0x2333e8){_0x4ecad7=_0x2333e8;_0x118f16=0xc8;}else{_0x118f16=0xce;}_0x1cc462[_0x8ed8('0x15')](_0x118f16);return _0x1cc462[_0x8ed8('0x19')](_0x8ed8('0x1a'),_0xc6989a+'-'+_0x4ecad7+'/'+_0x2333e8)[_0x8ed8('0x16')](_0x530f1b);}return null;};}function patchUpdates(_0x5c841d){return function(_0x57cff3){try{jsonpatch[_0x8ed8('0x1b')](_0x57cff3,_0x5c841d,!![]);}catch(_0x2d8755){return BPromise[_0x8ed8('0x1c')](_0x2d8755);}return _0x57cff3[_0x8ed8('0x1d')]();};}function saveUpdates(_0x301398,_0x555cd4){return function(_0x5a67c0){if(_0x5a67c0){return _0x5a67c0[_0x8ed8('0x1e')](_0x301398)['then'](function(_0x501ea3){return _0x501ea3;});}return null;};}function removeEntity(_0x5bceda,_0x16c7aa){return function(_0xd9187c){if(_0xd9187c){return _0xd9187c[_0x8ed8('0x1f')]()[_0x8ed8('0x20')](function(){_0x5bceda[_0x8ed8('0x15')](0xcc)[_0x8ed8('0x21')]();});}};}function handleEntityNotFound(_0x512335,_0x285328){return function(_0x12f92b){if(!_0x12f92b){_0x512335[_0x8ed8('0x22')](0x194);}return _0x12f92b;};}function handleError(_0x50e60f,_0x396ede){_0x396ede=_0x396ede||0x1f4;return function(_0x381fb5){logger[_0x8ed8('0x23')](_0x381fb5[_0x8ed8('0x24')]);if(_0x381fb5[_0x8ed8('0x25')]){delete _0x381fb5[_0x8ed8('0x25')];}_0x50e60f[_0x8ed8('0x15')](_0x396ede)[_0x8ed8('0x26')](_0x381fb5);};}exports[_0x8ed8('0x27')]=function(_0x355d5a,_0x1370ee){var _0x2a93b0={},_0x8a6690={},_0x2fcf6f={'count':0x0,'rows':[]};var _0x3cead3=_[_0x8ed8('0x28')](db[_0x8ed8('0x29')][_0x8ed8('0x2a')],function(_0x51db80){return{'name':_0x51db80[_0x8ed8('0x2b')],'type':_0x51db80[_0x8ed8('0x2c')][_0x8ed8('0x2d')]};});_0x8a6690[_0x8ed8('0x2e')]=_[_0x8ed8('0x28')](_0x3cead3,'name');_0x8a6690[_0x8ed8('0x2f')]=_['keys'](_0x355d5a[_0x8ed8('0x2f')]);_0x8a6690[_0x8ed8('0x30')]=_['intersection'](_0x8a6690[_0x8ed8('0x2e')],_0x8a6690[_0x8ed8('0x2f')]);_0x2a93b0[_0x8ed8('0x31')]=_['intersection'](_0x8a6690[_0x8ed8('0x2e')],qs[_0x8ed8('0x32')](_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x32')]));_0x2a93b0[_0x8ed8('0x31')]=_0x2a93b0[_0x8ed8('0x31')][_0x8ed8('0x33')]?_0x2a93b0[_0x8ed8('0x31')]:_0x8a6690[_0x8ed8('0x2e')];if(!_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x34')](_0x8ed8('0x35'))){_0x2a93b0['limit']=qs[_0x8ed8('0x36')](_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x36')]);_0x2a93b0[_0x8ed8('0x18')]=qs[_0x8ed8('0x18')](_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x18')]);}_0x2a93b0[_0x8ed8('0x37')]=qs[_0x8ed8('0x38')](_0x355d5a['query']['sort']);_0x2a93b0[_0x8ed8('0x39')]=qs[_0x8ed8('0x30')](_[_0x8ed8('0x3a')](_0x355d5a[_0x8ed8('0x2f')],_0x8a6690['filters']),_0x3cead3);if(_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x3b')]){_0x2a93b0['where']=_[_0x8ed8('0x3c')](_0x2a93b0[_0x8ed8('0x39')],{'$or':_['map'](_0x3cead3,function(_0x45561e){if(_0x45561e[_0x8ed8('0x2c')]!==_0x8ed8('0x3d')){var _0x249397={};_0x249397[_0x45561e[_0x8ed8('0x25')]]={'$like':'%'+_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x3b')]+'%'};return _0x249397;}})});}_0x2a93b0=_[_0x8ed8('0x3c')]({},_0x2a93b0,_0x355d5a[_0x8ed8('0x3e')]);var _0x2ba4e8={'where':_0x2a93b0[_0x8ed8('0x39')]};return db[_0x8ed8('0x29')][_0x8ed8('0x17')](_0x2ba4e8)[_0x8ed8('0x20')](function(_0x5523f1){_0x2fcf6f['count']=_0x5523f1;if(_0x355d5a[_0x8ed8('0x2f')][_0x8ed8('0x3f')]){_0x2a93b0[_0x8ed8('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x8ed8('0x41')](_0x2a93b0);})[_0x8ed8('0x20')](function(_0x1ea682){_0x2fcf6f[_0x8ed8('0x42')]=_0x1ea682;return _0x2fcf6f;})['then'](respondWithFilteredResult(_0x1370ee,_0x2a93b0))[_0x8ed8('0x43')](handleError(_0x1370ee,null));};exports[_0x8ed8('0x44')]=function(_0x28f04b,_0x1f8715){var _0x9cf976={'raw':![],'where':{'id':_0x28f04b[_0x8ed8('0x45')]['id']}},_0x6b5a54={};_0x6b5a54['model']=_['keys'](db[_0x8ed8('0x29')][_0x8ed8('0x2a')]);_0x6b5a54[_0x8ed8('0x2f')]=_[_0x8ed8('0x46')](_0x28f04b[_0x8ed8('0x2f')]);_0x6b5a54[_0x8ed8('0x30')]=_[_0x8ed8('0x47')](_0x6b5a54[_0x8ed8('0x2e')],_0x6b5a54['query']);_0x9cf976[_0x8ed8('0x31')]=_['intersection'](_0x6b5a54[_0x8ed8('0x2e')],qs['fields'](_0x28f04b['query']['fields']));_0x9cf976['attributes']=_0x9cf976[_0x8ed8('0x31')]['length']?_0x9cf976[_0x8ed8('0x31')]:_0x6b5a54[_0x8ed8('0x2e')];if(_0x28f04b[_0x8ed8('0x2f')][_0x8ed8('0x3f')]){_0x9cf976[_0x8ed8('0x40')]=[{'all':!![]}];}_0x9cf976=_[_0x8ed8('0x3c')]({},_0x9cf976,_0x28f04b['options']);return db[_0x8ed8('0x29')]['find'](_0x9cf976)[_0x8ed8('0x20')](handleEntityNotFound(_0x1f8715,null))[_0x8ed8('0x20')](respondWithResult(_0x1f8715,null))[_0x8ed8('0x43')](handleError(_0x1f8715,null));};exports[_0x8ed8('0x48')]=function(_0x56cce8,_0x4ec8b0){return db['Dynamics365Configuration']['create'](_0x56cce8[_0x8ed8('0x49')],{})[_0x8ed8('0x20')](respondWithResult(_0x4ec8b0,0xc9))['catch'](handleError(_0x4ec8b0,null));};exports[_0x8ed8('0x1e')]=function(_0x4760cd,_0x212639){if(_0x4760cd[_0x8ed8('0x49')]['id']){delete _0x4760cd[_0x8ed8('0x49')]['id'];}return db['Dynamics365Configuration'][_0x8ed8('0x4a')]({'where':{'id':_0x4760cd[_0x8ed8('0x45')]['id']}})[_0x8ed8('0x20')](handleEntityNotFound(_0x212639,null))[_0x8ed8('0x20')](saveUpdates(_0x4760cd[_0x8ed8('0x49')],null))[_0x8ed8('0x20')](respondWithResult(_0x212639,null))[_0x8ed8('0x43')](handleError(_0x212639,null));};exports[_0x8ed8('0x1f')]=function(_0x543ab7,_0x3ed1aa){return db[_0x8ed8('0x29')]['find']({'where':{'id':_0x543ab7[_0x8ed8('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ed1aa,null))['then'](removeEntity(_0x3ed1aa,null))[_0x8ed8('0x43')](handleError(_0x3ed1aa,null));};exports[_0x8ed8('0x4b')]=function(_0x26bef1,_0x4cb3c4,_0x2d1d46){var _0x95fe92={};var _0x39fddf={};var _0x47cbc1;var _0x21285b;return db[_0x8ed8('0x29')][_0x8ed8('0x4c')]({'where':{'id':_0x26bef1[_0x8ed8('0x45')]['id']}})[_0x8ed8('0x20')](handleEntityNotFound(_0x4cb3c4,null))['then'](function(_0x1b6885){if(_0x1b6885){_0x47cbc1=_0x1b6885;_0x39fddf['model']=_[_0x8ed8('0x46')](db[_0x8ed8('0x4d')][_0x8ed8('0x2a')]);_0x39fddf[_0x8ed8('0x2f')]=_['keys'](_0x26bef1[_0x8ed8('0x2f')]);_0x39fddf[_0x8ed8('0x30')]=_[_0x8ed8('0x47')](_0x39fddf[_0x8ed8('0x2e')],_0x39fddf[_0x8ed8('0x2f')]);_0x95fe92[_0x8ed8('0x31')]=_[_0x8ed8('0x47')](_0x39fddf['model'],qs[_0x8ed8('0x32')](_0x26bef1[_0x8ed8('0x2f')][_0x8ed8('0x32')]));_0x95fe92['attributes']=_0x95fe92[_0x8ed8('0x31')]['length']?_0x95fe92[_0x8ed8('0x31')]:_0x39fddf['model'];_0x95fe92['order']=qs[_0x8ed8('0x38')](_0x26bef1[_0x8ed8('0x2f')]['sort']);_0x95fe92['where']=qs[_0x8ed8('0x30')](_[_0x8ed8('0x3a')](_0x26bef1[_0x8ed8('0x2f')],_0x39fddf[_0x8ed8('0x30')]));if(_0x26bef1[_0x8ed8('0x2f')]['filter']){_0x95fe92[_0x8ed8('0x39')]=_[_0x8ed8('0x3c')](_0x95fe92[_0x8ed8('0x39')],{'$or':_['map'](_0x95fe92[_0x8ed8('0x31')],function(_0x416982){var _0x2a3d80={};_0x2a3d80[_0x416982]={'$like':'%'+_0x26bef1[_0x8ed8('0x2f')][_0x8ed8('0x3b')]+'%'};return _0x2a3d80;})});}_0x95fe92=_['merge']({},_0x95fe92,_0x26bef1[_0x8ed8('0x3e')]);return _0x47cbc1[_0x8ed8('0x4b')](_0x95fe92);}})['then'](function(_0x4434f2){if(_0x4434f2){_0x21285b=_0x4434f2['length'];if(!_0x26bef1[_0x8ed8('0x2f')][_0x8ed8('0x34')](_0x8ed8('0x35'))){_0x95fe92[_0x8ed8('0x36')]=qs[_0x8ed8('0x36')](_0x26bef1['query']['limit']);_0x95fe92[_0x8ed8('0x18')]=qs[_0x8ed8('0x18')](_0x26bef1[_0x8ed8('0x2f')][_0x8ed8('0x18')]);}return _0x47cbc1[_0x8ed8('0x4b')](_0x95fe92);}})['then'](function(_0x290882){if(_0x290882){return _0x290882?{'count':_0x21285b,'rows':_0x290882}:null;}})[_0x8ed8('0x20')](respondWithResult(_0x4cb3c4,null))[_0x8ed8('0x43')](handleError(_0x4cb3c4,null));};exports[_0x8ed8('0x4e')]=function(_0x238da3,_0x9fd361,_0x4584e0){var _0x594650={};var _0x53eb90={};var _0xaabac8;var _0x318437;return db[_0x8ed8('0x29')][_0x8ed8('0x4c')]({'where':{'id':_0x238da3[_0x8ed8('0x45')]['id']}})['then'](handleEntityNotFound(_0x9fd361,null))['then'](function(_0x5f378a){if(_0x5f378a){_0xaabac8=_0x5f378a;_0x53eb90['model']=_[_0x8ed8('0x46')](db[_0x8ed8('0x4d')][_0x8ed8('0x2a')]);_0x53eb90[_0x8ed8('0x2f')]=_[_0x8ed8('0x46')](_0x238da3[_0x8ed8('0x2f')]);_0x53eb90['filters']=_[_0x8ed8('0x47')](_0x53eb90[_0x8ed8('0x2e')],_0x53eb90[_0x8ed8('0x2f')]);_0x594650['attributes']=_[_0x8ed8('0x47')](_0x53eb90['model'],qs['fields'](_0x238da3['query'][_0x8ed8('0x32')]));_0x594650[_0x8ed8('0x31')]=_0x594650[_0x8ed8('0x31')]['length']?_0x594650[_0x8ed8('0x31')]:_0x53eb90[_0x8ed8('0x2e')];_0x594650['order']=qs['sort'](_0x238da3[_0x8ed8('0x2f')][_0x8ed8('0x38')]);_0x594650['where']=qs[_0x8ed8('0x30')](_[_0x8ed8('0x3a')](_0x238da3[_0x8ed8('0x2f')],_0x53eb90['filters']));if(_0x238da3[_0x8ed8('0x2f')][_0x8ed8('0x3b')]){_0x594650[_0x8ed8('0x39')]=_[_0x8ed8('0x3c')](_0x594650[_0x8ed8('0x39')],{'$or':_[_0x8ed8('0x28')](_0x594650['attributes'],function(_0x2f8658){var _0x32821a={};_0x32821a[_0x2f8658]={'$like':'%'+_0x238da3[_0x8ed8('0x2f')][_0x8ed8('0x3b')]+'%'};return _0x32821a;})});}_0x594650=_[_0x8ed8('0x3c')]({},_0x594650,_0x238da3[_0x8ed8('0x3e')]);return _0xaabac8[_0x8ed8('0x4e')](_0x594650);}})[_0x8ed8('0x20')](function(_0x1bf24b){if(_0x1bf24b){_0x318437=_0x1bf24b[_0x8ed8('0x33')];if(!_0x238da3[_0x8ed8('0x2f')]['hasOwnProperty'](_0x8ed8('0x35'))){_0x594650['limit']=qs[_0x8ed8('0x36')](_0x238da3[_0x8ed8('0x2f')][_0x8ed8('0x36')]);_0x594650[_0x8ed8('0x18')]=qs[_0x8ed8('0x18')](_0x238da3[_0x8ed8('0x2f')][_0x8ed8('0x18')]);}return _0xaabac8[_0x8ed8('0x4e')](_0x594650);}})[_0x8ed8('0x20')](function(_0x3a7dc3){if(_0x3a7dc3){return _0x3a7dc3?{'count':_0x318437,'rows':_0x3a7dc3}:null;}})[_0x8ed8('0x20')](respondWithResult(_0x9fd361,null))[_0x8ed8('0x43')](handleError(_0x9fd361,null));};exports[_0x8ed8('0x4f')]=function(_0x43f347,_0x5d936e,_0x248135){var _0x51f6dd={};var _0x33b5c4={};var _0x3dadac;var _0x11dcbc;return db[_0x8ed8('0x29')][_0x8ed8('0x4c')]({'where':{'id':_0x43f347[_0x8ed8('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d936e,null))[_0x8ed8('0x20')](function(_0x491b56){if(_0x491b56){_0x3dadac=_0x491b56;_0x33b5c4[_0x8ed8('0x2e')]=_[_0x8ed8('0x46')](db[_0x8ed8('0x4d')][_0x8ed8('0x2a')]);_0x33b5c4[_0x8ed8('0x2f')]=_[_0x8ed8('0x46')](_0x43f347['query']);_0x33b5c4[_0x8ed8('0x30')]=_[_0x8ed8('0x47')](_0x33b5c4[_0x8ed8('0x2e')],_0x33b5c4['query']);_0x51f6dd['attributes']=_[_0x8ed8('0x47')](_0x33b5c4['model'],qs['fields'](_0x43f347[_0x8ed8('0x2f')][_0x8ed8('0x32')]));_0x51f6dd[_0x8ed8('0x31')]=_0x51f6dd[_0x8ed8('0x31')][_0x8ed8('0x33')]?_0x51f6dd[_0x8ed8('0x31')]:_0x33b5c4[_0x8ed8('0x2e')];_0x51f6dd[_0x8ed8('0x37')]=qs['sort'](_0x43f347[_0x8ed8('0x2f')][_0x8ed8('0x38')]);_0x51f6dd[_0x8ed8('0x39')]=qs[_0x8ed8('0x30')](_[_0x8ed8('0x3a')](_0x43f347[_0x8ed8('0x2f')],_0x33b5c4[_0x8ed8('0x30')]));if(_0x43f347['query'][_0x8ed8('0x3b')]){_0x51f6dd[_0x8ed8('0x39')]=_[_0x8ed8('0x3c')](_0x51f6dd[_0x8ed8('0x39')],{'$or':_[_0x8ed8('0x28')](_0x51f6dd[_0x8ed8('0x31')],function(_0x5884c8){var _0x4968e0={};_0x4968e0[_0x5884c8]={'$like':'%'+_0x43f347['query']['filter']+'%'};return _0x4968e0;})});}_0x51f6dd=_[_0x8ed8('0x3c')]({},_0x51f6dd,_0x43f347[_0x8ed8('0x3e')]);return _0x3dadac[_0x8ed8('0x4f')](_0x51f6dd);}})['then'](function(_0x271b15){if(_0x271b15){_0x11dcbc=_0x271b15[_0x8ed8('0x33')];if(!_0x43f347[_0x8ed8('0x2f')][_0x8ed8('0x34')](_0x8ed8('0x35'))){_0x51f6dd[_0x8ed8('0x36')]=qs[_0x8ed8('0x36')](_0x43f347[_0x8ed8('0x2f')][_0x8ed8('0x36')]);_0x51f6dd[_0x8ed8('0x18')]=qs[_0x8ed8('0x18')](_0x43f347['query'][_0x8ed8('0x18')]);}return _0x3dadac['getDescriptions'](_0x51f6dd);}})['then'](function(_0x5c77be){if(_0x5c77be){return _0x5c77be?{'count':_0x11dcbc,'rows':_0x5c77be}:null;}})['then'](respondWithResult(_0x5d936e,null))[_0x8ed8('0x43')](handleError(_0x5d936e,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 43b8937..7dffe00 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x3544a4,_0x2b801c){var _0x3ad501=function(_0x387d32){while(--_0x387d32){_0x3544a4['push'](_0x3544a4['shift']());}};_0x3ad501(++_0x2b801c);}(_0x3e74,0x175));var _0x43e7=function(_0x1aa086,_0x1eb0e9){_0x1aa086=_0x1aa086-0x0;var _0xfdffb5=_0x3e74[_0x1aa086];return _0xfdffb5;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x3934bb,_0x256fc0){var _0xd64848=function(_0x156912){while(--_0x156912){_0x3934bb['push'](_0x3934bb['shift']());}};_0xd64848(++_0x256fc0);}(_0xaa88,0x137));var _0x8aa8=function(_0x3be7ff,_0x12e714){_0x3be7ff=_0x3be7ff-0x0;var _0x186721=_0xaa88[_0x3be7ff];return _0x186721;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'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 ab36f23..3e7144b 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 _0x92b3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x356439,_0x578979){var _0x359eb6=function(_0x34b60e){while(--_0x34b60e){_0x356439['push'](_0x356439['shift']());}};_0x359eb6(++_0x578979);}(_0x92b3,0x83));var _0x392b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x92b3[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x392b('0x0'));var util=require('util');var moment=require(_0x392b('0x1'));var BPromise=require(_0x392b('0x2'));var rs=require(_0x392b('0x3'));var fs=require('fs');var Redis=require(_0x392b('0x4'));var db=require(_0x392b('0x5'))['db'];var utils=require(_0x392b('0x6'));var logger=require(_0x392b('0x7'))(_0x392b('0x8'));var config=require('../../config/environment');var jayson=require(_0x392b('0x9'));var client=jayson[_0x392b('0xa')][_0x392b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f0913,_0x1c0c66,_0x287b64){return new BPromise(function(_0xa98897,_0x2e13db){return client[_0x392b('0xc')](_0x2f0913,_0x287b64)['then'](function(_0xa145dd){logger['info'](_0x392b('0xd'),_0x1c0c66,'request\x20sent');logger[_0x392b('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1c0c66,_0x392b('0xf'),JSON[_0x392b('0x10')](_0xa145dd));if(_0xa145dd['error']){if(_0xa145dd['error']['code']===0x1f4){logger[_0x392b('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1c0c66,_0xa145dd[_0x392b('0x11')][_0x392b('0x12')]);return _0x2e13db(_0xa145dd[_0x392b('0x11')][_0x392b('0x12')]);}logger['error'](_0x392b('0xd'),_0x1c0c66,_0xa145dd['error'][_0x392b('0x12')]);return _0xa98897(_0xa145dd[_0x392b('0x11')][_0x392b('0x12')]);}else{logger[_0x392b('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1c0c66,'request\x20sent');_0xa98897(_0xa145dd[_0x392b('0x14')][_0x392b('0x12')]);}})[_0x392b('0x15')](function(_0x165613){logger['error'](_0x392b('0xd'),_0x1c0c66,_0x165613);_0x2e13db(_0x165613);});});} \ No newline at end of file +var _0x72c9=['stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x462323,_0xf4b4ad){var _0x2e914d=function(_0x22e9c7){while(--_0x22e9c7){_0x462323['push'](_0x462323['shift']());}};_0x2e914d(++_0xf4b4ad);}(_0x72c9,0x194));var _0x972c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72c9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x972c('0x0'));var util=require('util');var moment=require(_0x972c('0x1'));var BPromise=require(_0x972c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x972c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x972c('0x4'));var logger=require(_0x972c('0x5'))('rpc');var config=require(_0x972c('0x6'));var jayson=require(_0x972c('0x7'));var client=jayson[_0x972c('0x8')][_0x972c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238db0,_0x434e57,_0x3fc4a0){return new BPromise(function(_0x3a1786,_0x5a9722){return client[_0x972c('0xa')](_0x238db0,_0x3fc4a0)[_0x972c('0xb')](function(_0xdac169){logger[_0x972c('0xc')](_0x972c('0xd'),_0x434e57,'request\x20sent');logger['debug'](_0x972c('0xe'),_0x434e57,_0x972c('0xf'),JSON[_0x972c('0x10')](_0xdac169));if(_0xdac169[_0x972c('0x11')]){if(_0xdac169[_0x972c('0x11')][_0x972c('0x12')]===0x1f4){logger[_0x972c('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x434e57,_0xdac169[_0x972c('0x11')][_0x972c('0x13')]);return _0x5a9722(_0xdac169[_0x972c('0x11')][_0x972c('0x13')]);}logger[_0x972c('0x11')](_0x972c('0xd'),_0x434e57,_0xdac169['error'][_0x972c('0x13')]);return _0x3a1786(_0xdac169[_0x972c('0x11')]['message']);}else{logger[_0x972c('0xc')](_0x972c('0xd'),_0x434e57,'request\x20sent');_0x3a1786(_0xdac169['result'][_0x972c('0x13')]);}})[_0x972c('0x14')](function(_0x11bd74){logger[_0x972c('0x11')](_0x972c('0xd'),_0x434e57,_0x11bd74);_0x5a9722(_0x11bd74);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 93813b0..92f28a5 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 _0xd33e=['isAuthenticated','index','/:id','put','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0xd33e,0x19c));var _0xed33=function(_0xab9630,_0xe19d9c){_0xab9630=_0xab9630-0x0;var _0x1567a3=_0xd33e[_0xab9630];return _0x1567a3;};'use strict';var multer=require(_0xed33('0x0'));var util=require('util');var path=require(_0xed33('0x1'));var timeout=require(_0xed33('0x2'));var express=require('express');var router=express[_0xed33('0x3')]();var fs_extra=require(_0xed33('0x4'));var auth=require(_0xed33('0x5'));var interaction=require(_0xed33('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xed33('0x7')]('/',auth[_0xed33('0x8')](),controller[_0xed33('0x9')]);router['get'](_0xed33('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xed33('0xb')](_0xed33('0xa'),auth[_0xed33('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc6b2=['/:id','show','create','put','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x12c161,_0x2791ed){var _0x522c48=function(_0x1508da){while(--_0x1508da){_0x12c161['push'](_0x12c161['shift']());}};_0x522c48(++_0x2791ed);}(_0xc6b2,0x1af));var _0x2c6b=function(_0x47de5e,_0x22b91f){_0x47de5e=_0x47de5e-0x0;var _0x190e3e=_0xc6b2[_0x47de5e];return _0x190e3e;};'use strict';var multer=require(_0x2c6b('0x0'));var util=require(_0x2c6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c6b('0x2')]();var fs_extra=require(_0x2c6b('0x3'));var auth=require(_0x2c6b('0x4'));var interaction=require(_0x2c6b('0x5'));var config=require(_0x2c6b('0x6'));var controller=require(_0x2c6b('0x7'));router[_0x2c6b('0x8')]('/',auth[_0x2c6b('0x9')](),controller[_0x2c6b('0xa')]);router[_0x2c6b('0x8')](_0x2c6b('0xb'),auth['isAuthenticated'](),controller[_0x2c6b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2c6b('0xd')]);router[_0x2c6b('0xe')]('/:id',auth[_0x2c6b('0x9')](),controller['update']);router[_0x2c6b('0xf')]('/:id',auth[_0x2c6b('0x9')](),controller[_0x2c6b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 7dfdbaf..471eb3f 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 _0xc850=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x747632,_0xfa6bf2){var _0x3c4499=function(_0x4b63ff){while(--_0x4b63ff){_0x747632['push'](_0x747632['shift']());}};_0x3c4499(++_0xfa6bf2);}(_0xc850,0x1cd));var _0x0c85=function(_0x5991f5,_0x654cfc){_0x5991f5=_0x5991f5-0x0;var _0x5a3913=_0xc850[_0x5991f5];return _0x5a3913;};'use strict';var Sequelize=require(_0x0c85('0x0'));module[_0x0c85('0x1')]={'type':{'type':Sequelize[_0x0c85('0x2')](_0x0c85('0x3'),_0x0c85('0x4'),_0x0c85('0x5'),_0x0c85('0x6'),_0x0c85('0x7')),'defaultValue':_0x0c85('0x3')},'content':{'type':Sequelize[_0x0c85('0x8')]},'key':{'type':Sequelize[_0x0c85('0x8')]},'keyType':{'type':Sequelize[_0x0c85('0x2')]('string',_0x0c85('0x4'),_0x0c85('0x5'))},'keyContent':{'type':Sequelize[_0x0c85('0x8')]},'idField':{'type':Sequelize[_0x0c85('0x8')]},'nameField':{'type':Sequelize[_0x0c85('0x8')]},'customField':{'type':Sequelize[_0x0c85('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c85('0x8')]}}; \ No newline at end of file +var _0xb27c=['variable','keyValue','STRING','customVariable','exports','ENUM','string'];(function(_0x286082,_0x12e401){var _0x419655=function(_0x48ad6e){while(--_0x48ad6e){_0x286082['push'](_0x286082['shift']());}};_0x419655(++_0x12e401);}(_0xb27c,0xac));var _0xcb27=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xb27c[_0x1df7b8];return _0x29d911;};'use strict';var Sequelize=require('sequelize');module[_0xcb27('0x0')]={'type':{'type':Sequelize[_0xcb27('0x1')](_0xcb27('0x2'),_0xcb27('0x3'),'customVariable',_0xcb27('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xcb27('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xcb27('0x2'),'variable',_0xcb27('0x6'))},'keyContent':{'type':Sequelize[_0xcb27('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcb27('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index d3dfdcd..d1dacb2 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 _0x635e=['findAll','rows','show','find','catch','create','body','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x635e,0x1a6));var _0xe635=function(_0x4bd917,_0x34599c){_0x4bd917=_0x4bd917-0x0;var _0x3eb345=_0x635e[_0x4bd917];return _0x3eb345;};'use strict';var emlformat=require(_0xe635('0x0'));var rimraf=require(_0xe635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe635('0x2'));var moment=require(_0xe635('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe635('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe635('0x5'));var csv=require(_0xe635('0x6'));var ejs=require(_0xe635('0x7'));var fs=require('fs');var fs_extra=require(_0xe635('0x8'));var _=require(_0xe635('0x9'));var squel=require(_0xe635('0xa'));var crypto=require(_0xe635('0xb'));var jsforce=require(_0xe635('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe635('0x6'));var querystring=require(_0xe635('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe635('0xe'));var qs=require(_0xe635('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe635('0x10'))(_0xe635('0x11'));var utils=require(_0xe635('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xe635('0x13'));var db=require(_0xe635('0x14'))['db'];function respondWithStatusCode(_0x2062ec,_0x10f5a4){_0x10f5a4=_0x10f5a4||0xcc;return function(_0x18d728){if(_0x18d728){return _0x2062ec['sendStatus'](_0x10f5a4);}return _0x2062ec['status'](_0x10f5a4)[_0xe635('0x15')]();};}function respondWithResult(_0x4c2619,_0x2a2dae){_0x2a2dae=_0x2a2dae||0xc8;return function(_0x216c53){if(_0x216c53){return _0x4c2619[_0xe635('0x16')](_0x2a2dae)[_0xe635('0x17')](_0x216c53);}};}function respondWithFilteredResult(_0x1e04ea,_0x2aa5ac){return function(_0x575ad9){if(_0x575ad9){var _0x252275=typeof _0x2aa5ac['offset']===_0xe635('0x18')&&typeof _0x2aa5ac[_0xe635('0x19')]===_0xe635('0x18');var _0xc5d7d9=_0x575ad9[_0xe635('0x1a')];var _0x127463=_0x252275?0x0:_0x2aa5ac[_0xe635('0x1b')];var _0x500456=_0x252275?_0x575ad9[_0xe635('0x1a')]:_0x2aa5ac[_0xe635('0x1b')]+_0x2aa5ac[_0xe635('0x19')];var _0x392fb1;if(_0x500456>=_0xc5d7d9){_0x500456=_0xc5d7d9;_0x392fb1=0xc8;}else{_0x392fb1=0xce;}_0x1e04ea[_0xe635('0x16')](_0x392fb1);return _0x1e04ea['set'](_0xe635('0x1c'),_0x127463+'-'+_0x500456+'/'+_0xc5d7d9)[_0xe635('0x17')](_0x575ad9);}return null;};}function patchUpdates(_0x305d02){return function(_0x496c45){try{jsonpatch['apply'](_0x496c45,_0x305d02,!![]);}catch(_0x919180){return BPromise['reject'](_0x919180);}return _0x496c45[_0xe635('0x1d')]();};}function saveUpdates(_0x438c4,_0x176886){return function(_0x158aeb){if(_0x158aeb){return _0x158aeb[_0xe635('0x1e')](_0x438c4)[_0xe635('0x1f')](function(_0xdadd63){return _0xdadd63;});}return null;};}function removeEntity(_0x16a0b1,_0x1cfeaa){return function(_0x3808ed){if(_0x3808ed){return _0x3808ed[_0xe635('0x20')]()['then'](function(){_0x16a0b1[_0xe635('0x16')](0xcc)[_0xe635('0x15')]();});}};}function handleEntityNotFound(_0xc3c2f2,_0x147c1f){return function(_0x4c925a){if(!_0x4c925a){_0xc3c2f2[_0xe635('0x21')](0x194);}return _0x4c925a;};}function handleError(_0x2fd40d,_0x42a083){_0x42a083=_0x42a083||0x1f4;return function(_0x2ec9be){logger[_0xe635('0x22')](_0x2ec9be[_0xe635('0x23')]);if(_0x2ec9be[_0xe635('0x24')]){delete _0x2ec9be[_0xe635('0x24')];}_0x2fd40d[_0xe635('0x16')](_0x42a083)[_0xe635('0x25')](_0x2ec9be);};}exports[_0xe635('0x26')]=function(_0x3951ce,_0x151664){var _0x17613d={},_0x4564e1={},_0x2334bb={'count':0x0,'rows':[]};var _0x3a0480=_['map'](db[_0xe635('0x27')][_0xe635('0x28')],function(_0x139824){return{'name':_0x139824[_0xe635('0x29')],'type':_0x139824['type'][_0xe635('0x2a')]};});_0x4564e1[_0xe635('0x2b')]=_[_0xe635('0x2c')](_0x3a0480,_0xe635('0x24'));_0x4564e1[_0xe635('0x2d')]=_[_0xe635('0x2e')](_0x3951ce[_0xe635('0x2d')]);_0x4564e1[_0xe635('0x2f')]=_[_0xe635('0x30')](_0x4564e1[_0xe635('0x2b')],_0x4564e1[_0xe635('0x2d')]);_0x17613d[_0xe635('0x31')]=_[_0xe635('0x30')](_0x4564e1[_0xe635('0x2b')],qs['fields'](_0x3951ce[_0xe635('0x2d')][_0xe635('0x32')]));_0x17613d['attributes']=_0x17613d[_0xe635('0x31')][_0xe635('0x33')]?_0x17613d[_0xe635('0x31')]:_0x4564e1['model'];if(!_0x3951ce['query'][_0xe635('0x34')](_0xe635('0x35'))){_0x17613d[_0xe635('0x19')]=qs['limit'](_0x3951ce['query'][_0xe635('0x19')]);_0x17613d[_0xe635('0x1b')]=qs[_0xe635('0x1b')](_0x3951ce[_0xe635('0x2d')][_0xe635('0x1b')]);}_0x17613d['order']=qs[_0xe635('0x36')](_0x3951ce[_0xe635('0x2d')][_0xe635('0x36')]);_0x17613d['where']=qs[_0xe635('0x2f')](_['pick'](_0x3951ce[_0xe635('0x2d')],_0x4564e1[_0xe635('0x2f')]),_0x3a0480);if(_0x3951ce[_0xe635('0x2d')][_0xe635('0x37')]){_0x17613d['where']=_[_0xe635('0x38')](_0x17613d[_0xe635('0x39')],{'$or':_['map'](_0x3a0480,function(_0x4800f0){if(_0x4800f0['type']!==_0xe635('0x3a')){var _0x2f0570={};_0x2f0570[_0x4800f0[_0xe635('0x24')]]={'$like':'%'+_0x3951ce[_0xe635('0x2d')]['filter']+'%'};return _0x2f0570;}})});}_0x17613d=_[_0xe635('0x38')]({},_0x17613d,_0x3951ce[_0xe635('0x3b')]);var _0x297c9d={'where':_0x17613d['where']};return db[_0xe635('0x27')][_0xe635('0x1a')](_0x297c9d)[_0xe635('0x1f')](function(_0x2392ca){_0x2334bb[_0xe635('0x1a')]=_0x2392ca;if(_0x3951ce[_0xe635('0x2d')][_0xe635('0x3c')]){_0x17613d['include']=[{'all':!![]}];}return db[_0xe635('0x27')][_0xe635('0x3d')](_0x17613d);})['then'](function(_0x576328){_0x2334bb[_0xe635('0x3e')]=_0x576328;return _0x2334bb;})[_0xe635('0x1f')](respondWithFilteredResult(_0x151664,_0x17613d))['catch'](handleError(_0x151664,null));};exports[_0xe635('0x3f')]=function(_0x2f83b5,_0x553cbf){var _0x1f2263={'raw':!![],'where':{'id':_0x2f83b5['params']['id']}},_0x24d42a={};_0x24d42a[_0xe635('0x2b')]=_[_0xe635('0x2e')](db[_0xe635('0x27')][_0xe635('0x28')]);_0x24d42a[_0xe635('0x2d')]=_['keys'](_0x2f83b5['query']);_0x24d42a[_0xe635('0x2f')]=_[_0xe635('0x30')](_0x24d42a[_0xe635('0x2b')],_0x24d42a[_0xe635('0x2d')]);_0x1f2263[_0xe635('0x31')]=_['intersection'](_0x24d42a[_0xe635('0x2b')],qs['fields'](_0x2f83b5[_0xe635('0x2d')][_0xe635('0x32')]));_0x1f2263[_0xe635('0x31')]=_0x1f2263[_0xe635('0x31')][_0xe635('0x33')]?_0x1f2263[_0xe635('0x31')]:_0x24d42a[_0xe635('0x2b')];if(_0x2f83b5[_0xe635('0x2d')][_0xe635('0x3c')]){_0x1f2263['include']=[{'all':!![]}];}_0x1f2263=_['merge']({},_0x1f2263,_0x2f83b5['options']);return db[_0xe635('0x27')][_0xe635('0x40')](_0x1f2263)[_0xe635('0x1f')](handleEntityNotFound(_0x553cbf,null))[_0xe635('0x1f')](respondWithResult(_0x553cbf,null))[_0xe635('0x41')](handleError(_0x553cbf,null));};exports['create']=function(_0x10bb28,_0x4dd721){return db[_0xe635('0x27')][_0xe635('0x42')](_0x10bb28[_0xe635('0x43')],{})[_0xe635('0x1f')](respondWithResult(_0x4dd721,0xc9))[_0xe635('0x41')](handleError(_0x4dd721,null));};exports[_0xe635('0x1e')]=function(_0x11ee1d,_0x5914a7){if(_0x11ee1d[_0xe635('0x43')]['id']){delete _0x11ee1d['body']['id'];}return db[_0xe635('0x27')][_0xe635('0x40')]({'where':{'id':_0x11ee1d[_0xe635('0x44')]['id']}})['then'](handleEntityNotFound(_0x5914a7,null))[_0xe635('0x1f')](saveUpdates(_0x11ee1d[_0xe635('0x43')],null))[_0xe635('0x1f')](respondWithResult(_0x5914a7,null))[_0xe635('0x41')](handleError(_0x5914a7,null));};exports['destroy']=function(_0x14dfd6,_0x337a4d){return db[_0xe635('0x27')][_0xe635('0x40')]({'where':{'id':_0x14dfd6[_0xe635('0x44')]['id']}})[_0xe635('0x1f')](handleEntityNotFound(_0x337a4d,null))[_0xe635('0x1f')](removeEntity(_0x337a4d,null))[_0xe635('0x41')](handleError(_0x337a4d,null));}; \ No newline at end of file +var _0x94ee=['pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','rows','catch','params','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where'];(function(_0x232271,_0xd77c5c){var _0x409f4c=function(_0x5daf0b){while(--_0x5daf0b){_0x232271['push'](_0x232271['shift']());}};_0x409f4c(++_0xd77c5c);}(_0x94ee,0x1a7));var _0xe94e=function(_0x25db22,_0x4fae8b){_0x25db22=_0x25db22-0x0;var _0x2e107e=_0x94ee[_0x25db22];return _0x2e107e;};'use strict';var emlformat=require(_0xe94e('0x0'));var rimraf=require(_0xe94e('0x1'));var zipdir=require(_0xe94e('0x2'));var jsonpatch=require(_0xe94e('0x3'));var rp=require(_0xe94e('0x4'));var moment=require(_0xe94e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe94e('0x6'));var util=require(_0xe94e('0x7'));var path=require(_0xe94e('0x8'));var sox=require('sox');var csv=require(_0xe94e('0x9'));var ejs=require(_0xe94e('0xa'));var fs=require('fs');var fs_extra=require(_0xe94e('0xb'));var _=require(_0xe94e('0xc'));var squel=require(_0xe94e('0xd'));var crypto=require('crypto');var jsforce=require(_0xe94e('0xe'));var deskjs=require(_0xe94e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe94e('0x10'));var Papa=require(_0xe94e('0x11'));var Redis=require(_0xe94e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe94e('0x13'));var as=require(_0xe94e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe94e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe94e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54d3c5,_0x1d0da0){_0x1d0da0=_0x1d0da0||0xcc;return function(_0x4870f7){if(_0x4870f7){return _0x54d3c5['sendStatus'](_0x1d0da0);}return _0x54d3c5[_0xe94e('0x17')](_0x1d0da0)['end']();};}function respondWithResult(_0x2c0dd6,_0x242720){_0x242720=_0x242720||0xc8;return function(_0x297a6d){if(_0x297a6d){return _0x2c0dd6[_0xe94e('0x17')](_0x242720)[_0xe94e('0x18')](_0x297a6d);}};}function respondWithFilteredResult(_0x1a8f23,_0x5cb333){return function(_0x2cae18){if(_0x2cae18){var _0x2c1f86=typeof _0x5cb333[_0xe94e('0x19')]===_0xe94e('0x1a')&&typeof _0x5cb333[_0xe94e('0x1b')]===_0xe94e('0x1a');var _0x157e3f=_0x2cae18[_0xe94e('0x1c')];var _0x520e06=_0x2c1f86?0x0:_0x5cb333['offset'];var _0x1dc837=_0x2c1f86?_0x2cae18['count']:_0x5cb333[_0xe94e('0x19')]+_0x5cb333[_0xe94e('0x1b')];var _0x420d4a;if(_0x1dc837>=_0x157e3f){_0x1dc837=_0x157e3f;_0x420d4a=0xc8;}else{_0x420d4a=0xce;}_0x1a8f23['status'](_0x420d4a);return _0x1a8f23[_0xe94e('0x1d')]('Content-Range',_0x520e06+'-'+_0x1dc837+'/'+_0x157e3f)[_0xe94e('0x18')](_0x2cae18);}return null;};}function patchUpdates(_0x8c5ebe){return function(_0x996b2f){try{jsonpatch['apply'](_0x996b2f,_0x8c5ebe,!![]);}catch(_0x397eab){return BPromise[_0xe94e('0x1e')](_0x397eab);}return _0x996b2f['save']();};}function saveUpdates(_0x4bfa5a,_0x18eac7){return function(_0x3345a9){if(_0x3345a9){return _0x3345a9[_0xe94e('0x1f')](_0x4bfa5a)[_0xe94e('0x20')](function(_0x715324){return _0x715324;});}return null;};}function removeEntity(_0x3dcc88,_0x22dce4){return function(_0x281094){if(_0x281094){return _0x281094[_0xe94e('0x21')]()['then'](function(){_0x3dcc88[_0xe94e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dbc87,_0x2ac9c1){return function(_0x178b92){if(!_0x178b92){_0x1dbc87['sendStatus'](0x194);}return _0x178b92;};}function handleError(_0x175721,_0x3eb360){_0x3eb360=_0x3eb360||0x1f4;return function(_0x249a2d){logger[_0xe94e('0x22')](_0x249a2d[_0xe94e('0x23')]);if(_0x249a2d['name']){delete _0x249a2d[_0xe94e('0x24')];}_0x175721[_0xe94e('0x17')](_0x3eb360)['send'](_0x249a2d);};}exports[_0xe94e('0x25')]=function(_0x2b5151,_0xd0a89f){var _0x1e839e={},_0x410bfc={},_0x2ed0db={'count':0x0,'rows':[]};var _0x452265=_[_0xe94e('0x26')](db['Dynamics365Field'][_0xe94e('0x27')],function(_0x3a36d8){return{'name':_0x3a36d8[_0xe94e('0x28')],'type':_0x3a36d8['type'][_0xe94e('0x29')]};});_0x410bfc[_0xe94e('0x2a')]=_[_0xe94e('0x26')](_0x452265,_0xe94e('0x24'));_0x410bfc[_0xe94e('0x2b')]=_[_0xe94e('0x2c')](_0x2b5151['query']);_0x410bfc[_0xe94e('0x2d')]=_['intersection'](_0x410bfc['model'],_0x410bfc['query']);_0x1e839e['attributes']=_[_0xe94e('0x2e')](_0x410bfc[_0xe94e('0x2a')],qs[_0xe94e('0x2f')](_0x2b5151[_0xe94e('0x2b')][_0xe94e('0x2f')]));_0x1e839e['attributes']=_0x1e839e['attributes']['length']?_0x1e839e[_0xe94e('0x30')]:_0x410bfc[_0xe94e('0x2a')];if(!_0x2b5151[_0xe94e('0x2b')]['hasOwnProperty'](_0xe94e('0x31'))){_0x1e839e['limit']=qs[_0xe94e('0x1b')](_0x2b5151[_0xe94e('0x2b')][_0xe94e('0x1b')]);_0x1e839e[_0xe94e('0x19')]=qs['offset'](_0x2b5151['query']['offset']);}_0x1e839e[_0xe94e('0x32')]=qs[_0xe94e('0x33')](_0x2b5151['query'][_0xe94e('0x33')]);_0x1e839e[_0xe94e('0x34')]=qs['filters'](_[_0xe94e('0x35')](_0x2b5151['query'],_0x410bfc[_0xe94e('0x2d')]),_0x452265);if(_0x2b5151[_0xe94e('0x2b')][_0xe94e('0x36')]){_0x1e839e['where']=_[_0xe94e('0x37')](_0x1e839e[_0xe94e('0x34')],{'$or':_[_0xe94e('0x26')](_0x452265,function(_0x1289d5){if(_0x1289d5['type']!==_0xe94e('0x38')){var _0x694828={};_0x694828[_0x1289d5[_0xe94e('0x24')]]={'$like':'%'+_0x2b5151[_0xe94e('0x2b')][_0xe94e('0x36')]+'%'};return _0x694828;}})});}_0x1e839e=_[_0xe94e('0x37')]({},_0x1e839e,_0x2b5151[_0xe94e('0x39')]);var _0x4f792a={'where':_0x1e839e['where']};return db[_0xe94e('0x3a')][_0xe94e('0x1c')](_0x4f792a)['then'](function(_0x32094f){_0x2ed0db['count']=_0x32094f;if(_0x2b5151['query'][_0xe94e('0x3b')]){_0x1e839e[_0xe94e('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x1e839e);})[_0xe94e('0x20')](function(_0x3aacff){_0x2ed0db[_0xe94e('0x3d')]=_0x3aacff;return _0x2ed0db;})[_0xe94e('0x20')](respondWithFilteredResult(_0xd0a89f,_0x1e839e))[_0xe94e('0x3e')](handleError(_0xd0a89f,null));};exports['show']=function(_0x115bf7,_0x3efa17){var _0xfd8271={'raw':!![],'where':{'id':_0x115bf7[_0xe94e('0x3f')]['id']}},_0x127391={};_0x127391[_0xe94e('0x2a')]=_[_0xe94e('0x2c')](db[_0xe94e('0x3a')][_0xe94e('0x27')]);_0x127391['query']=_[_0xe94e('0x2c')](_0x115bf7['query']);_0x127391[_0xe94e('0x2d')]=_[_0xe94e('0x2e')](_0x127391[_0xe94e('0x2a')],_0x127391['query']);_0xfd8271[_0xe94e('0x30')]=_[_0xe94e('0x2e')](_0x127391[_0xe94e('0x2a')],qs[_0xe94e('0x2f')](_0x115bf7[_0xe94e('0x2b')]['fields']));_0xfd8271[_0xe94e('0x30')]=_0xfd8271[_0xe94e('0x30')][_0xe94e('0x40')]?_0xfd8271['attributes']:_0x127391[_0xe94e('0x2a')];if(_0x115bf7[_0xe94e('0x2b')][_0xe94e('0x3b')]){_0xfd8271['include']=[{'all':!![]}];}_0xfd8271=_['merge']({},_0xfd8271,_0x115bf7[_0xe94e('0x39')]);return db[_0xe94e('0x3a')]['find'](_0xfd8271)[_0xe94e('0x20')](handleEntityNotFound(_0x3efa17,null))[_0xe94e('0x20')](respondWithResult(_0x3efa17,null))[_0xe94e('0x3e')](handleError(_0x3efa17,null));};exports[_0xe94e('0x41')]=function(_0x1c0df9,_0x32b66c){return db[_0xe94e('0x3a')]['create'](_0x1c0df9[_0xe94e('0x42')],{})[_0xe94e('0x20')](respondWithResult(_0x32b66c,0xc9))[_0xe94e('0x3e')](handleError(_0x32b66c,null));};exports[_0xe94e('0x1f')]=function(_0x1f6333,_0x1cdcf4){if(_0x1f6333['body']['id']){delete _0x1f6333[_0xe94e('0x42')]['id'];}return db['Dynamics365Field'][_0xe94e('0x43')]({'where':{'id':_0x1f6333[_0xe94e('0x3f')]['id']}})[_0xe94e('0x20')](handleEntityNotFound(_0x1cdcf4,null))[_0xe94e('0x20')](saveUpdates(_0x1f6333['body'],null))[_0xe94e('0x20')](respondWithResult(_0x1cdcf4,null))[_0xe94e('0x3e')](handleError(_0x1cdcf4,null));};exports['destroy']=function(_0x328a49,_0x51a08c){return db[_0xe94e('0x3a')][_0xe94e('0x43')]({'where':{'id':_0x328a49[_0xe94e('0x3f')]['id']}})[_0xe94e('0x20')](handleEntityNotFound(_0x51a08c,null))[_0xe94e('0x20')](removeEntity(_0x51a08c,null))[_0xe94e('0x3e')](handleError(_0x51a08c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2690e22..6707c41 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 _0x9f65=['FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','int_dynamics365_fields','idField'];(function(_0x1a3a64,_0x5ab041){var _0x52afa1=function(_0x45b161){while(--_0x45b161){_0x1a3a64['push'](_0x1a3a64['shift']());}};_0x52afa1(++_0x5ab041);}(_0x9f65,0x11f));var _0x59f6=function(_0x514757,_0x3e9c1b){_0x514757=_0x514757-0x0;var _0x1f4e84=_0x9f65[_0x514757];return _0x1f4e84;};'use strict';var _=require('lodash');var util=require(_0x59f6('0x0'));var logger=require(_0x59f6('0x1'))(_0x59f6('0x2'));var moment=require(_0x59f6('0x3'));var BPromise=require(_0x59f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59f6('0x5'));var rimraf=require(_0x59f6('0x6'));var config=require(_0x59f6('0x7'));var attributes=require(_0x59f6('0x8'));module[_0x59f6('0x9')]=function(_0x44b139,_0x333944){return _0x44b139['define']('Dynamics365Field',attributes,{'tableName':_0x59f6('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x59f6('0xb'),_0x59f6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2daa=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash'];(function(_0x3606c5,_0x1d431f){var _0x11938f=function(_0x5e409e){while(--_0x5e409e){_0x3606c5['push'](_0x3606c5['shift']());}};_0x11938f(++_0x1d431f);}(_0x2daa,0xff));var _0xa2da=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x2daa[_0x32f9ca];return _0x52e083;};'use strict';var _=require(_0xa2da('0x0'));var util=require(_0xa2da('0x1'));var logger=require(_0xa2da('0x2'))(_0xa2da('0x3'));var moment=require(_0xa2da('0x4'));var BPromise=require(_0xa2da('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2da('0x6'));var rimraf=require(_0xa2da('0x7'));var config=require(_0xa2da('0x8'));var attributes=require(_0xa2da('0x9'));module[_0xa2da('0xa')]=function(_0x34b1ca,_0x5caee7){return _0x34b1ca[_0xa2da('0xb')](_0xa2da('0xc'),attributes,{'tableName':_0xa2da('0xd'),'paranoid':![],'indexes':[{'name':_0xa2da('0xe'),'fields':[_0xa2da('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index d3ec80e..2786e73 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 _0x0e7d=['info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0e7d,0x1ec));var _0xd0e7=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x0e7d[_0x352e09];return _0x1b7094;};'use strict';var _=require('lodash');var util=require(_0xd0e7('0x0'));var moment=require(_0xd0e7('0x1'));var BPromise=require(_0xd0e7('0x2'));var rs=require(_0xd0e7('0x3'));var fs=require('fs');var Redis=require(_0xd0e7('0x4'));var db=require(_0xd0e7('0x5'))['db'];var utils=require(_0xd0e7('0x6'));var logger=require(_0xd0e7('0x7'))(_0xd0e7('0x8'));var config=require('../../config/environment');var jayson=require(_0xd0e7('0x9'));var client=jayson[_0xd0e7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7939af,_0xb1c9a7,_0x54c6f6){return new BPromise(function(_0x4e4022,_0x231272){return client['request'](_0x7939af,_0x54c6f6)[_0xd0e7('0xb')](function(_0x54043b){logger[_0xd0e7('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0xb1c9a7,_0xd0e7('0xd'));logger[_0xd0e7('0xe')](_0xd0e7('0xf'),_0xb1c9a7,_0xd0e7('0xd'),JSON[_0xd0e7('0x10')](_0x54043b));if(_0x54043b[_0xd0e7('0x11')]){if(_0x54043b['error'][_0xd0e7('0x12')]===0x1f4){logger[_0xd0e7('0x11')](_0xd0e7('0x13'),_0xb1c9a7,_0x54043b['error'][_0xd0e7('0x14')]);return _0x231272(_0x54043b[_0xd0e7('0x11')][_0xd0e7('0x14')]);}logger[_0xd0e7('0x11')](_0xd0e7('0x13'),_0xb1c9a7,_0x54043b['error'][_0xd0e7('0x14')]);return _0x4e4022(_0x54043b['error'][_0xd0e7('0x14')]);}else{logger[_0xd0e7('0xc')](_0xd0e7('0x13'),_0xb1c9a7,'request\x20sent');_0x4e4022(_0x54043b['result'][_0xd0e7('0x14')]);}})['catch'](function(_0x2b5822){logger[_0xd0e7('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xb1c9a7,_0x2b5822);_0x231272(_0x2b5822);});});} \ No newline at end of file +var _0x5461=['../../config/environment','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x5461,0x19e));var _0x1546=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0x5461[_0xd050c6];return _0x7278a;};'use strict';var _=require('lodash');var util=require(_0x1546('0x0'));var moment=require(_0x1546('0x1'));var BPromise=require(_0x1546('0x2'));var rs=require(_0x1546('0x3'));var fs=require('fs');var Redis=require(_0x1546('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1546('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1546('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1546('0x7')][_0x1546('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32ef74,_0x58243c,_0x4574d5){return new BPromise(function(_0x3ceaef,_0x4939cf){return client[_0x1546('0x9')](_0x32ef74,_0x4574d5)[_0x1546('0xa')](function(_0x10f067){logger['info'](_0x1546('0xb'),_0x58243c,'request\x20sent');logger[_0x1546('0xc')](_0x1546('0xd'),_0x58243c,_0x1546('0xe'),JSON[_0x1546('0xf')](_0x10f067));if(_0x10f067[_0x1546('0x10')]){if(_0x10f067['error'][_0x1546('0x11')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x58243c,_0x10f067['error']['message']);return _0x4939cf(_0x10f067['error'][_0x1546('0x12')]);}logger[_0x1546('0x10')](_0x1546('0xb'),_0x58243c,_0x10f067[_0x1546('0x10')][_0x1546('0x12')]);return _0x3ceaef(_0x10f067[_0x1546('0x10')][_0x1546('0x12')]);}else{logger['info'](_0x1546('0xb'),_0x58243c,'request\x20sent');_0x3ceaef(_0x10f067[_0x1546('0x13')][_0x1546('0x12')]);}})[_0x1546('0x14')](function(_0x4d8789){logger['error'](_0x1546('0xb'),_0x58243c,_0x4d8789);_0x4939cf(_0x4d8789);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8da8e0f..104fa61 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 _0x1605=['create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x189d45,_0x13e25b){var _0x4c34ef=function(_0x2f052b){while(--_0x2f052b){_0x189d45['push'](_0x189d45['shift']());}};_0x4c34ef(++_0x13e25b);}(_0x1605,0x8b));var _0x5160=function(_0x51f9d8,_0x55b18f){_0x51f9d8=_0x51f9d8-0x0;var _0x2c0749=_0x1605[_0x51f9d8];return _0x2c0749;};'use strict';var multer=require(_0x5160('0x0'));var util=require('util');var path=require(_0x5160('0x1'));var timeout=require(_0x5160('0x2'));var express=require(_0x5160('0x3'));var router=express[_0x5160('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5160('0x5'));var config=require(_0x5160('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x5160('0x7')](),controller[_0x5160('0x8')]);router[_0x5160('0x9')]('/:id',auth[_0x5160('0x7')](),controller[_0x5160('0xa')]);router[_0x5160('0x9')](_0x5160('0xb'),auth['isAuthenticated'](),controller[_0x5160('0xc')]);router['get'](_0x5160('0xd'),auth[_0x5160('0x7')](),controller['getFields']);router[_0x5160('0xe')]('/',auth['isAuthenticated'](),controller[_0x5160('0xf')]);router[_0x5160('0xe')](_0x5160('0xb'),auth[_0x5160('0x7')](),controller['addConfiguration']);router[_0x5160('0x10')](_0x5160('0x11'),auth['isAuthenticated'](),controller[_0x5160('0x12')]);router[_0x5160('0x13')]('/:id',auth[_0x5160('0x7')](),controller[_0x5160('0x14')]);module[_0x5160('0x15')]=router; \ No newline at end of file +var _0x8885=['Router','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','create','post','addConfiguration','put','delete','multer','util','path'];(function(_0x361250,_0x13ec17){var _0x27847d=function(_0x5a1c56){while(--_0x5a1c56){_0x361250['push'](_0x361250['shift']());}};_0x27847d(++_0x13ec17);}(_0x8885,0x1ad));var _0x5888=function(_0x3b7cc3,_0x58c400){_0x3b7cc3=_0x3b7cc3-0x0;var _0x2bc5f3=_0x8885[_0x3b7cc3];return _0x2bc5f3;};'use strict';var multer=require(_0x5888('0x0'));var util=require(_0x5888('0x1'));var path=require(_0x5888('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5888('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(_0x5888('0x4'));router[_0x5888('0x5')]('/',auth[_0x5888('0x6')](),controller['index']);router[_0x5888('0x5')](_0x5888('0x7'),auth[_0x5888('0x6')](),controller[_0x5888('0x8')]);router[_0x5888('0x5')]('/:id/configurations',auth[_0x5888('0x6')](),controller[_0x5888('0x9')]);router[_0x5888('0x5')](_0x5888('0xa'),auth[_0x5888('0x6')](),controller['getFields']);router['post']('/',auth[_0x5888('0x6')](),controller[_0x5888('0xb')]);router[_0x5888('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5888('0xd')]);router[_0x5888('0xe')]('/:id',auth[_0x5888('0x6')](),controller['update']);router[_0x5888('0xf')](_0x5888('0x7'),auth[_0x5888('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 920c0cf..fcc1c8d 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 _0x47c5=['username','remoteUri','sequelize','exports','STRING'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0x47c5,0x165));var _0x547c=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x47c5[_0xf10840];return _0x1fdf7e;};'use strict';var Sequelize=require(_0x547c('0x0'));module[_0x547c('0x1')]={'name':{'type':Sequelize[_0x547c('0x2')]},'description':{'type':Sequelize[_0x547c('0x2')]},'username':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x547c('0x2')],'unique':_0x547c('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3a6d=['exports','STRING','username','sequelize'];(function(_0x2d8089,_0x22c54a){var _0x2f2fad=function(_0x44a826){while(--_0x44a826){_0x2d8089['push'](_0x2d8089['shift']());}};_0x2f2fad(++_0x22c54a);}(_0x3a6d,0x143));var _0xd3a6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a6d[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd3a6('0x2')]},'username':{'type':Sequelize[_0xd3a6('0x2')],'unique':_0xd3a6('0x3')},'apiKey':{'type':Sequelize[_0xd3a6('0x2')]},'remoteUri':{'type':Sequelize[_0xd3a6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd3a6('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 058d28d..5546b0b 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 _0x3d7f=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','findOne','order','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','send','map','FreshdeskAccount','rawAttributes','fieldName','type','key'];(function(_0x5e69af,_0x29c591){var _0x5df5c2=function(_0x4abae9){while(--_0x4abae9){_0x5e69af['push'](_0x5e69af['shift']());}};_0x5df5c2(++_0x29c591);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x3d7f[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0xf3d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf3d7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3d7('0x2'));var moment=require(_0xf3d7('0x3'));var BPromise=require(_0xf3d7('0x4'));var Mustache=require(_0xf3d7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf3d7('0x6'));var csv=require(_0xf3d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3d7('0x8'));var squel=require(_0xf3d7('0x9'));var crypto=require(_0xf3d7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf3d7('0xb'));var toCsv=require(_0xf3d7('0x7'));var querystring=require(_0xf3d7('0xc'));var Papa=require(_0xf3d7('0xd'));var Redis=require(_0xf3d7('0xe'));var authService=require(_0xf3d7('0xf'));var qs=require(_0xf3d7('0x10'));var as=require(_0xf3d7('0x11'));var hardwareService=require(_0xf3d7('0x12'));var logger=require(_0xf3d7('0x13'))(_0xf3d7('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3d7('0x15'));var db=require(_0xf3d7('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x161613,_0xecd54c){_0xecd54c=_0xecd54c||0xcc;return function(_0x42f319){if(_0x42f319){return _0x161613['sendStatus'](_0xecd54c);}return _0x161613[_0xf3d7('0x17')](_0xecd54c)[_0xf3d7('0x18')]();};}function respondWithResult(_0x1a895a,_0x14b5d3){_0x14b5d3=_0x14b5d3||0xc8;return function(_0x1cdb40){if(_0x1cdb40){return _0x1a895a[_0xf3d7('0x17')](_0x14b5d3)['json'](_0x1cdb40);}};}function respondWithFilteredResult(_0x415a3f,_0x24e584){return function(_0x305b5c){if(_0x305b5c){var _0x18e8a2=typeof _0x24e584[_0xf3d7('0x19')]===_0xf3d7('0x1a')&&typeof _0x24e584[_0xf3d7('0x1b')]==='undefined';var _0xcf7523=_0x305b5c[_0xf3d7('0x1c')];var _0x2b4d32=_0x18e8a2?0x0:_0x24e584[_0xf3d7('0x19')];var _0xd3c306=_0x18e8a2?_0x305b5c[_0xf3d7('0x1c')]:_0x24e584['offset']+_0x24e584[_0xf3d7('0x1b')];var _0x3f387c;if(_0xd3c306>=_0xcf7523){_0xd3c306=_0xcf7523;_0x3f387c=0xc8;}else{_0x3f387c=0xce;}_0x415a3f[_0xf3d7('0x17')](_0x3f387c);return _0x415a3f[_0xf3d7('0x1d')](_0xf3d7('0x1e'),_0x2b4d32+'-'+_0xd3c306+'/'+_0xcf7523)[_0xf3d7('0x1f')](_0x305b5c);}return null;};}function patchUpdates(_0x4b4fda){return function(_0x41f70d){try{jsonpatch[_0xf3d7('0x20')](_0x41f70d,_0x4b4fda,!![]);}catch(_0x11ac3d){return BPromise[_0xf3d7('0x21')](_0x11ac3d);}return _0x41f70d['save']();};}function saveUpdates(_0x325ca5,_0x1c2a31){return function(_0x24f50e){if(_0x24f50e){return _0x24f50e[_0xf3d7('0x22')](_0x325ca5)[_0xf3d7('0x23')](function(_0x67ad16){return _0x67ad16;});}return null;};}function removeEntity(_0x573d5e,_0x3943f7){return function(_0x6043a4){if(_0x6043a4){return _0x6043a4[_0xf3d7('0x24')]()[_0xf3d7('0x23')](function(){_0x573d5e[_0xf3d7('0x17')](0xcc)[_0xf3d7('0x18')]();});}};}function handleEntityNotFound(_0x1f3812,_0x4b5b39){return function(_0x3ca4d9){if(!_0x3ca4d9){_0x1f3812[_0xf3d7('0x25')](0x194);}return _0x3ca4d9;};}function handleError(_0x968040,_0x4db9d4){_0x4db9d4=_0x4db9d4||0x1f4;return function(_0x4c107e){logger[_0xf3d7('0x26')](_0x4c107e['stack']);if(_0x4c107e[_0xf3d7('0x27')]){delete _0x4c107e['name'];}_0x968040[_0xf3d7('0x17')](_0x4db9d4)[_0xf3d7('0x28')](_0x4c107e);};}exports['index']=function(_0x1ee67e,_0x255951){var _0x82b242={},_0x42364a={},_0x46613e={'count':0x0,'rows':[]};var _0x35f1d8=_[_0xf3d7('0x29')](db[_0xf3d7('0x2a')][_0xf3d7('0x2b')],function(_0xc05c1){return{'name':_0xc05c1[_0xf3d7('0x2c')],'type':_0xc05c1[_0xf3d7('0x2d')][_0xf3d7('0x2e')]};});_0x42364a[_0xf3d7('0x2f')]=_[_0xf3d7('0x29')](_0x35f1d8,_0xf3d7('0x27'));_0x42364a[_0xf3d7('0x30')]=_[_0xf3d7('0x31')](_0x1ee67e[_0xf3d7('0x30')]);_0x42364a[_0xf3d7('0x32')]=_['intersection'](_0x42364a[_0xf3d7('0x2f')],_0x42364a[_0xf3d7('0x30')]);_0x82b242[_0xf3d7('0x33')]=_[_0xf3d7('0x34')](_0x42364a[_0xf3d7('0x2f')],qs[_0xf3d7('0x35')](_0x1ee67e['query'][_0xf3d7('0x35')]));_0x82b242[_0xf3d7('0x33')]=_0x82b242[_0xf3d7('0x33')][_0xf3d7('0x36')]?_0x82b242['attributes']:_0x42364a[_0xf3d7('0x2f')];if(!_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x37')](_0xf3d7('0x38'))){_0x82b242['limit']=qs[_0xf3d7('0x1b')](_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x1b')]);_0x82b242[_0xf3d7('0x19')]=qs[_0xf3d7('0x19')](_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x19')]);}_0x82b242['order']=qs[_0xf3d7('0x39')](_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x39')]);_0x82b242[_0xf3d7('0x3a')]=qs[_0xf3d7('0x32')](_[_0xf3d7('0x3b')](_0x1ee67e['query'],_0x42364a['filters']),_0x35f1d8);if(_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x3c')]){_0x82b242[_0xf3d7('0x3a')]=_[_0xf3d7('0x3d')](_0x82b242[_0xf3d7('0x3a')],{'$or':_[_0xf3d7('0x29')](_0x35f1d8,function(_0x420839){if(_0x420839['type']!==_0xf3d7('0x3e')){var _0x2d83d8={};_0x2d83d8[_0x420839[_0xf3d7('0x27')]]={'$like':'%'+_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x3c')]+'%'};return _0x2d83d8;}})});}_0x82b242=_['merge']({},_0x82b242,_0x1ee67e[_0xf3d7('0x3f')]);var _0x380a44={'where':_0x82b242[_0xf3d7('0x3a')]};return db['FreshdeskAccount'][_0xf3d7('0x1c')](_0x380a44)[_0xf3d7('0x23')](function(_0x34df7f){_0x46613e['count']=_0x34df7f;if(_0x1ee67e[_0xf3d7('0x30')][_0xf3d7('0x40')]){_0x82b242[_0xf3d7('0x41')]=[{'all':!![]}];}return db[_0xf3d7('0x2a')][_0xf3d7('0x42')](_0x82b242);})[_0xf3d7('0x23')](function(_0x1de9b0){_0x46613e['rows']=_0x1de9b0;return _0x46613e;})['then'](respondWithFilteredResult(_0x255951,_0x82b242))[_0xf3d7('0x43')](handleError(_0x255951,null));};exports[_0xf3d7('0x44')]=function(_0x2763c1,_0x1dc8e8){var _0x5c3b3c={'raw':![],'where':{'id':_0x2763c1[_0xf3d7('0x45')]['id']}},_0x49ef6b={};_0x49ef6b[_0xf3d7('0x2f')]=_[_0xf3d7('0x31')](db[_0xf3d7('0x2a')][_0xf3d7('0x2b')]);_0x49ef6b[_0xf3d7('0x30')]=_[_0xf3d7('0x31')](_0x2763c1[_0xf3d7('0x30')]);_0x49ef6b[_0xf3d7('0x32')]=_[_0xf3d7('0x34')](_0x49ef6b[_0xf3d7('0x2f')],_0x49ef6b[_0xf3d7('0x30')]);_0x5c3b3c[_0xf3d7('0x33')]=_[_0xf3d7('0x34')](_0x49ef6b['model'],qs[_0xf3d7('0x35')](_0x2763c1[_0xf3d7('0x30')][_0xf3d7('0x35')]));_0x5c3b3c[_0xf3d7('0x33')]=_0x5c3b3c[_0xf3d7('0x33')][_0xf3d7('0x36')]?_0x5c3b3c['attributes']:_0x49ef6b[_0xf3d7('0x2f')];if(_0x2763c1[_0xf3d7('0x30')]['includeAll']){_0x5c3b3c[_0xf3d7('0x41')]=[{'all':!![]}];}_0x5c3b3c=_['merge']({},_0x5c3b3c,_0x2763c1[_0xf3d7('0x3f')]);return db[_0xf3d7('0x2a')][_0xf3d7('0x46')](_0x5c3b3c)[_0xf3d7('0x23')](handleEntityNotFound(_0x1dc8e8,null))[_0xf3d7('0x23')](respondWithResult(_0x1dc8e8,null))['catch'](handleError(_0x1dc8e8,null));};exports[_0xf3d7('0x47')]=function(_0x483cc0,_0xf6a443){return db[_0xf3d7('0x2a')][_0xf3d7('0x47')](_0x483cc0[_0xf3d7('0x48')],{})['then'](respondWithResult(_0xf6a443,0xc9))[_0xf3d7('0x43')](handleError(_0xf6a443,null));};exports[_0xf3d7('0x22')]=function(_0x40eae9,_0x1daa8f){if(_0x40eae9[_0xf3d7('0x48')]['id']){delete _0x40eae9[_0xf3d7('0x48')]['id'];}return db[_0xf3d7('0x2a')][_0xf3d7('0x46')]({'where':{'id':_0x40eae9[_0xf3d7('0x45')]['id']}})['then'](handleEntityNotFound(_0x1daa8f,null))[_0xf3d7('0x23')](saveUpdates(_0x40eae9[_0xf3d7('0x48')],null))[_0xf3d7('0x23')](respondWithResult(_0x1daa8f,null))[_0xf3d7('0x43')](handleError(_0x1daa8f,null));};exports[_0xf3d7('0x24')]=function(_0x5ae536,_0x32c7e8){return db['FreshdeskAccount'][_0xf3d7('0x46')]({'where':{'id':_0x5ae536[_0xf3d7('0x45')]['id']}})[_0xf3d7('0x23')](handleEntityNotFound(_0x32c7e8,null))[_0xf3d7('0x23')](removeEntity(_0x32c7e8,null))[_0xf3d7('0x43')](handleError(_0x32c7e8,null));};exports['getConfigurations']=function(_0x3e0deb,_0x3f3835,_0x156f25){var _0x2c0667={};var _0x342de7={};var _0x5a0938;var _0xd564c1;return db[_0xf3d7('0x2a')][_0xf3d7('0x49')]({'where':{'id':_0x3e0deb[_0xf3d7('0x45')]['id']}})[_0xf3d7('0x23')](handleEntityNotFound(_0x3f3835,null))[_0xf3d7('0x23')](function(_0x1c70dc){if(_0x1c70dc){_0x5a0938=_0x1c70dc;_0x342de7[_0xf3d7('0x2f')]=_[_0xf3d7('0x31')](db['FreshdeskConfiguration'][_0xf3d7('0x2b')]);_0x342de7[_0xf3d7('0x30')]=_[_0xf3d7('0x31')](_0x3e0deb['query']);_0x342de7[_0xf3d7('0x32')]=_[_0xf3d7('0x34')](_0x342de7[_0xf3d7('0x2f')],_0x342de7[_0xf3d7('0x30')]);_0x2c0667[_0xf3d7('0x33')]=_[_0xf3d7('0x34')](_0x342de7[_0xf3d7('0x2f')],qs['fields'](_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x35')]));_0x2c0667[_0xf3d7('0x33')]=_0x2c0667[_0xf3d7('0x33')][_0xf3d7('0x36')]?_0x2c0667['attributes']:_0x342de7[_0xf3d7('0x2f')];_0x2c0667[_0xf3d7('0x4a')]=qs[_0xf3d7('0x39')](_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x39')]);_0x2c0667[_0xf3d7('0x3a')]=qs[_0xf3d7('0x32')](_[_0xf3d7('0x3b')](_0x3e0deb[_0xf3d7('0x30')],_0x342de7[_0xf3d7('0x32')]));if(_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x3c')]){_0x2c0667[_0xf3d7('0x3a')]=_['merge'](_0x2c0667[_0xf3d7('0x3a')],{'$or':_[_0xf3d7('0x29')](_0x2c0667[_0xf3d7('0x33')],function(_0x76d0b1){var _0x1404e7={};_0x1404e7[_0x76d0b1]={'$like':'%'+_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x3c')]+'%'};return _0x1404e7;})});}_0x2c0667=_[_0xf3d7('0x3d')]({},_0x2c0667,_0x3e0deb[_0xf3d7('0x3f')]);return _0x5a0938[_0xf3d7('0x4b')](_0x2c0667);}})[_0xf3d7('0x23')](function(_0x4312f9){if(_0x4312f9){_0xd564c1=_0x4312f9['length'];if(!_0x3e0deb[_0xf3d7('0x30')][_0xf3d7('0x37')]('nolimit')){_0x2c0667[_0xf3d7('0x1b')]=qs[_0xf3d7('0x1b')](_0x3e0deb[_0xf3d7('0x30')]['limit']);_0x2c0667['offset']=qs[_0xf3d7('0x19')](_0x3e0deb[_0xf3d7('0x30')]['offset']);}return _0x5a0938[_0xf3d7('0x4b')](_0x2c0667);}})[_0xf3d7('0x23')](function(_0x4843eb){if(_0x4843eb){return _0x4843eb?{'count':_0xd564c1,'rows':_0x4843eb}:null;}})[_0xf3d7('0x23')](respondWithResult(_0x3f3835,null))[_0xf3d7('0x43')](handleError(_0x3f3835,null));};exports['addConfiguration']=function(_0x21cc99,_0x25d8fc,_0x22202b){if(_0x21cc99[_0xf3d7('0x48')]['id']){delete _0x21cc99['body']['id'];}return db[_0xf3d7('0x2a')][_0xf3d7('0x49')]({'where':{'id':_0x21cc99[_0xf3d7('0x45')]['id']}})[_0xf3d7('0x23')](handleEntityNotFound(_0x25d8fc,null))['then'](function(_0x4d87a8){if(_0x4d87a8){_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x4c')]=_0x4d87a8['id'];_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x4d')]=integrations[_0xf3d7('0x4e')](_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x4f')],_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x2d')]);_0x21cc99[_0xf3d7('0x48')][_0xf3d7('0x50')]=integrations[_0xf3d7('0x51')](_0x21cc99['body'][_0xf3d7('0x4f')],_0x21cc99[_0xf3d7('0x48')]['type']);return db[_0xf3d7('0x52')][_0xf3d7('0x47')](_0x21cc99[_0xf3d7('0x48')],{'include':[{'model':db[_0xf3d7('0x53')],'as':_0xf3d7('0x4d')},{'model':db[_0xf3d7('0x53')],'as':_0xf3d7('0x50')}]});}return null;})[_0xf3d7('0x23')](respondWithResult(_0x25d8fc,null))[_0xf3d7('0x43')](handleError(_0x25d8fc,null));};exports[_0xf3d7('0x54')]=function(_0x39bdba,_0x485d8f,_0x21d1aa){var _0x572c18='';return db['FreshdeskAccount'][_0xf3d7('0x49')]({'where':{'id':_0x39bdba[_0xf3d7('0x45')]['id']},'attributes':['id',_0xf3d7('0x55'),_0xf3d7('0x56')]})[_0xf3d7('0x23')](handleEntityNotFound(_0x485d8f,null))[_0xf3d7('0x23')](function(_0x472ba1){if(_0x472ba1){_0x572c18=_0x472ba1[_0xf3d7('0x55')];var _0x496540=_0x572c18[_0xf3d7('0x57')](-0x1);if(_0x496540==='/'){_0x572c18=_0x572c18['substring'](0x0,_0x572c18[_0xf3d7('0x58')](_0x496540));}return rp({'method':_0xf3d7('0x59'),'uri':util[_0xf3d7('0x5a')]('%s/%s',_0x572c18,_0xf3d7('0x5b')),'headers':{'Authorization':util[_0xf3d7('0x5a')](_0xf3d7('0x5c'),new Buffer(util[_0xf3d7('0x5a')](_0xf3d7('0x5d'),_0x472ba1[_0xf3d7('0x56')]))[_0xf3d7('0x5e')](_0xf3d7('0x5f')))},'json':!![]});}})[_0xf3d7('0x23')](function(_0x1132b9){if(_0x1132b9){var _0x1bd1b0=[_0xf3d7('0x60'),_0xf3d7('0x61'),_0xf3d7('0x62'),_0xf3d7('0x63'),_0xf3d7('0x17'),_0xf3d7('0x64'),_0xf3d7('0x65'),_0xf3d7('0x66'),_0xf3d7('0x67'),_0xf3d7('0x65'),'company'];_[_0xf3d7('0x68')](_0x1132b9,function(_0x45284b){return _0x1bd1b0[_0xf3d7('0x69')](_0x45284b[_0xf3d7('0x27')])||!_0x45284b[_0xf3d7('0x6a')]&&_0x45284b[_0xf3d7('0x2d')]!==_0xf3d7('0x6b')&&_0x45284b[_0xf3d7('0x2d')]!=='custom_dropdown';});return{'count':_0x1132b9[_0xf3d7('0x36')],'rows':_['map'](_0x1132b9,function(_0x2be41a){return{'id':_0x2be41a['name'],'name':_0x2be41a[_0xf3d7('0x6c')],'custom':!_0x2be41a[_0xf3d7('0x6a')],'options':_0x2be41a[_0xf3d7('0x6d')]?_[_0xf3d7('0x29')](_0x2be41a[_0xf3d7('0x6d')],function(_0x1ac5a7){return{'name':_[_0xf3d7('0x6e')](_0x1ac5a7),'value':_0x1ac5a7};}):[]};})};}})[_0xf3d7('0x23')](respondWithResult(_0x485d8f,null))[_0xf3d7('0x43')](function(_0x348ed6){var _0x3849f0=_0x39bdba['query'][_0xf3d7('0x6f')]?0x1f4:_0x348ed6[_0xf3d7('0x70')]||0x1f4;logger[_0xf3d7('0x26')](_0xf3d7('0x71'),_0xf3d7('0x54'),_0x3849f0,JSON[_0xf3d7('0x72')](_0x348ed6));delete _0x348ed6['name'];if(_0x3849f0===0x191){_0x3849f0=0x190;}_0x485d8f[_0xf3d7('0x17')](_0x3849f0)['send'](_0x39bdba['query'][_0xf3d7('0x6f')]?{'message':_0xf3d7('0x73'),'statusCode':_0x348ed6['statusCode']}:_0x348ed6);});}; \ No newline at end of file +var _0xb688=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','index','map','FreshdeskAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','name','options','findAll','rows','catch','show','includeAll','include','find','create','params','body','findOne','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','format','api/v2/ticket_fields','toString','requester','subject','description','priority','group','source','company','includes','default','custom_text','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xb688,0xcf));var _0x8b68=function(_0x429dc4,_0xe62cf5){_0x429dc4=_0x429dc4-0x0;var _0xcd7125=_0xb688[_0x429dc4];return _0xcd7125;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];var integrations=require(_0x8b68('0x1b'));function respondWithStatusCode(_0x2f3af4,_0xaa8725){_0xaa8725=_0xaa8725||0xcc;return function(_0x137c8e){if(_0x137c8e){return _0x2f3af4[_0x8b68('0x1c')](_0xaa8725);}return _0x2f3af4['status'](_0xaa8725)[_0x8b68('0x1d')]();};}function respondWithResult(_0x509033,_0x5e3c66){_0x5e3c66=_0x5e3c66||0xc8;return function(_0x22f75b){if(_0x22f75b){return _0x509033[_0x8b68('0x1e')](_0x5e3c66)[_0x8b68('0x1f')](_0x22f75b);}};}function respondWithFilteredResult(_0x5d3468,_0x5c8d0e){return function(_0x23bd52){if(_0x23bd52){var _0x5c1e44=typeof _0x5c8d0e[_0x8b68('0x20')]===_0x8b68('0x21')&&typeof _0x5c8d0e[_0x8b68('0x22')]===_0x8b68('0x21');var _0x491695=_0x23bd52[_0x8b68('0x23')];var _0x203dd4=_0x5c1e44?0x0:_0x5c8d0e['offset'];var _0x42b3bd=_0x5c1e44?_0x23bd52[_0x8b68('0x23')]:_0x5c8d0e[_0x8b68('0x20')]+_0x5c8d0e[_0x8b68('0x22')];var _0x38b7a7;if(_0x42b3bd>=_0x491695){_0x42b3bd=_0x491695;_0x38b7a7=0xc8;}else{_0x38b7a7=0xce;}_0x5d3468['status'](_0x38b7a7);return _0x5d3468[_0x8b68('0x24')](_0x8b68('0x25'),_0x203dd4+'-'+_0x42b3bd+'/'+_0x491695)[_0x8b68('0x1f')](_0x23bd52);}return null;};}function patchUpdates(_0x1a9788){return function(_0x35d055){try{jsonpatch[_0x8b68('0x26')](_0x35d055,_0x1a9788,!![]);}catch(_0x5603d4){return BPromise['reject'](_0x5603d4);}return _0x35d055[_0x8b68('0x27')]();};}function saveUpdates(_0x59cb26,_0x332202){return function(_0x30b6d0){if(_0x30b6d0){return _0x30b6d0[_0x8b68('0x28')](_0x59cb26)[_0x8b68('0x29')](function(_0x32ddc5){return _0x32ddc5;});}return null;};}function removeEntity(_0x173524,_0x59bb8a){return function(_0x1a6fe8){if(_0x1a6fe8){return _0x1a6fe8[_0x8b68('0x2a')]()['then'](function(){_0x173524[_0x8b68('0x1e')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x240b0b,_0x5590ec){return function(_0x511ccf){if(!_0x511ccf){_0x240b0b['sendStatus'](0x194);}return _0x511ccf;};}function handleError(_0x92d186,_0x448e43){_0x448e43=_0x448e43||0x1f4;return function(_0x2ba2a3){logger['error'](_0x2ba2a3[_0x8b68('0x2b')]);if(_0x2ba2a3['name']){delete _0x2ba2a3['name'];}_0x92d186[_0x8b68('0x1e')](_0x448e43)['send'](_0x2ba2a3);};}exports[_0x8b68('0x2c')]=function(_0x3ac356,_0x48e2c8){var _0x494ce4={},_0x357635={},_0x1cd230={'count':0x0,'rows':[]};var _0x1e7c06=_[_0x8b68('0x2d')](db[_0x8b68('0x2e')][_0x8b68('0x2f')],function(_0x460c37){return{'name':_0x460c37['fieldName'],'type':_0x460c37[_0x8b68('0x30')]['key']};});_0x357635[_0x8b68('0x31')]=_[_0x8b68('0x2d')](_0x1e7c06,'name');_0x357635[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ac356[_0x8b68('0x32')]);_0x357635['filters']=_['intersection'](_0x357635[_0x8b68('0x31')],_0x357635[_0x8b68('0x32')]);_0x494ce4[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x357635[_0x8b68('0x31')],qs[_0x8b68('0x36')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x36')]));_0x494ce4[_0x8b68('0x34')]=_0x494ce4[_0x8b68('0x34')][_0x8b68('0x37')]?_0x494ce4[_0x8b68('0x34')]:_0x357635[_0x8b68('0x31')];if(!_0x3ac356[_0x8b68('0x32')][_0x8b68('0x38')](_0x8b68('0x39'))){_0x494ce4[_0x8b68('0x22')]=qs[_0x8b68('0x22')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x22')]);_0x494ce4[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3ac356['query']['offset']);}_0x494ce4[_0x8b68('0x3a')]=qs[_0x8b68('0x3b')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x494ce4[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_[_0x8b68('0x3e')](_0x3ac356[_0x8b68('0x32')],_0x357635['filters']),_0x1e7c06);if(_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x494ce4[_0x8b68('0x3c')]=_[_0x8b68('0x40')](_0x494ce4[_0x8b68('0x3c')],{'$or':_[_0x8b68('0x2d')](_0x1e7c06,function(_0xff4080){if(_0xff4080[_0x8b68('0x30')]!=='VIRTUAL'){var _0x3f874c={};_0x3f874c[_0xff4080[_0x8b68('0x41')]]={'$like':'%'+_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3f')]+'%'};return _0x3f874c;}})});}_0x494ce4=_[_0x8b68('0x40')]({},_0x494ce4,_0x3ac356[_0x8b68('0x42')]);var _0xa748c2={'where':_0x494ce4['where']};return db[_0x8b68('0x2e')][_0x8b68('0x23')](_0xa748c2)['then'](function(_0x14ec40){_0x1cd230[_0x8b68('0x23')]=_0x14ec40;if(_0x3ac356['query']['includeAll']){_0x494ce4['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x8b68('0x43')](_0x494ce4);})[_0x8b68('0x29')](function(_0x515815){_0x1cd230[_0x8b68('0x44')]=_0x515815;return _0x1cd230;})['then'](respondWithFilteredResult(_0x48e2c8,_0x494ce4))[_0x8b68('0x45')](handleError(_0x48e2c8,null));};exports[_0x8b68('0x46')]=function(_0x5a3193,_0x2f90d9){var _0x5ae345={'raw':![],'where':{'id':_0x5a3193['params']['id']}},_0x4a718c={};_0x4a718c[_0x8b68('0x31')]=_[_0x8b68('0x33')](db[_0x8b68('0x2e')][_0x8b68('0x2f')]);_0x4a718c['query']=_[_0x8b68('0x33')](_0x5a3193['query']);_0x4a718c[_0x8b68('0x3d')]=_[_0x8b68('0x35')](_0x4a718c['model'],_0x4a718c[_0x8b68('0x32')]);_0x5ae345[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x4a718c[_0x8b68('0x31')],qs['fields'](_0x5a3193[_0x8b68('0x32')][_0x8b68('0x36')]));_0x5ae345[_0x8b68('0x34')]=_0x5ae345[_0x8b68('0x34')][_0x8b68('0x37')]?_0x5ae345[_0x8b68('0x34')]:_0x4a718c[_0x8b68('0x31')];if(_0x5a3193[_0x8b68('0x32')][_0x8b68('0x47')]){_0x5ae345[_0x8b68('0x48')]=[{'all':!![]}];}_0x5ae345=_[_0x8b68('0x40')]({},_0x5ae345,_0x5a3193[_0x8b68('0x42')]);return db[_0x8b68('0x2e')][_0x8b68('0x49')](_0x5ae345)[_0x8b68('0x29')](handleEntityNotFound(_0x2f90d9,null))[_0x8b68('0x29')](respondWithResult(_0x2f90d9,null))['catch'](handleError(_0x2f90d9,null));};exports[_0x8b68('0x4a')]=function(_0x20681a,_0x5dd099){return db[_0x8b68('0x2e')]['create'](_0x20681a['body'],{})['then'](respondWithResult(_0x5dd099,0xc9))[_0x8b68('0x45')](handleError(_0x5dd099,null));};exports[_0x8b68('0x28')]=function(_0x34047c,_0x6da48b){if(_0x34047c['body']['id']){delete _0x34047c['body']['id'];}return db[_0x8b68('0x2e')][_0x8b68('0x49')]({'where':{'id':_0x34047c[_0x8b68('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6da48b,null))[_0x8b68('0x29')](saveUpdates(_0x34047c[_0x8b68('0x4c')],null))['then'](respondWithResult(_0x6da48b,null))[_0x8b68('0x45')](handleError(_0x6da48b,null));};exports[_0x8b68('0x2a')]=function(_0x595942,_0x18a9ae){return db[_0x8b68('0x2e')]['find']({'where':{'id':_0x595942[_0x8b68('0x4b')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x18a9ae,null))['then'](removeEntity(_0x18a9ae,null))['catch'](handleError(_0x18a9ae,null));};exports['getConfigurations']=function(_0x28f82d,_0x42eabd,_0x3718b2){var _0x3d4b4f={};var _0x55aad3={};var _0x5a1711;var _0x4492fd;return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x28f82d['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x42eabd,null))[_0x8b68('0x29')](function(_0x3f9d34){if(_0x3f9d34){_0x5a1711=_0x3f9d34;_0x55aad3['model']=_[_0x8b68('0x33')](db['FreshdeskConfiguration'][_0x8b68('0x2f')]);_0x55aad3[_0x8b68('0x32')]=_['keys'](_0x28f82d[_0x8b68('0x32')]);_0x55aad3[_0x8b68('0x3d')]=_[_0x8b68('0x35')](_0x55aad3[_0x8b68('0x31')],_0x55aad3[_0x8b68('0x32')]);_0x3d4b4f['attributes']=_[_0x8b68('0x35')](_0x55aad3[_0x8b68('0x31')],qs[_0x8b68('0x36')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x36')]));_0x3d4b4f[_0x8b68('0x34')]=_0x3d4b4f[_0x8b68('0x34')][_0x8b68('0x37')]?_0x3d4b4f['attributes']:_0x55aad3[_0x8b68('0x31')];_0x3d4b4f[_0x8b68('0x3a')]=qs[_0x8b68('0x3b')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x3d4b4f[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_[_0x8b68('0x3e')](_0x28f82d[_0x8b68('0x32')],_0x55aad3[_0x8b68('0x3d')]));if(_0x28f82d[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x3d4b4f[_0x8b68('0x3c')]=_[_0x8b68('0x40')](_0x3d4b4f[_0x8b68('0x3c')],{'$or':_[_0x8b68('0x2d')](_0x3d4b4f[_0x8b68('0x34')],function(_0x3da7b4){var _0xae90f0={};_0xae90f0[_0x3da7b4]={'$like':'%'+_0x28f82d[_0x8b68('0x32')]['filter']+'%'};return _0xae90f0;})});}_0x3d4b4f=_[_0x8b68('0x40')]({},_0x3d4b4f,_0x28f82d['options']);return _0x5a1711['getConfigurations'](_0x3d4b4f);}})[_0x8b68('0x29')](function(_0x5d2476){if(_0x5d2476){_0x4492fd=_0x5d2476[_0x8b68('0x37')];if(!_0x28f82d[_0x8b68('0x32')][_0x8b68('0x38')]('nolimit')){_0x3d4b4f[_0x8b68('0x22')]=qs[_0x8b68('0x22')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x22')]);_0x3d4b4f[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x28f82d[_0x8b68('0x32')]['offset']);}return _0x5a1711['getConfigurations'](_0x3d4b4f);}})[_0x8b68('0x29')](function(_0x4224f5){if(_0x4224f5){return _0x4224f5?{'count':_0x4492fd,'rows':_0x4224f5}:null;}})[_0x8b68('0x29')](respondWithResult(_0x42eabd,null))[_0x8b68('0x45')](handleError(_0x42eabd,null));};exports[_0x8b68('0x4e')]=function(_0x37da34,_0x2d1519,_0x314f1e){if(_0x37da34[_0x8b68('0x4c')]['id']){delete _0x37da34[_0x8b68('0x4c')]['id'];}return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x37da34[_0x8b68('0x4b')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x2d1519,null))[_0x8b68('0x29')](function(_0x414096){if(_0x414096){_0x37da34[_0x8b68('0x4c')][_0x8b68('0x4f')]=_0x414096['id'];_0x37da34['body']['Subjects']=integrations[_0x8b68('0x50')](_0x37da34[_0x8b68('0x4c')]['channel'],_0x37da34['body']['type']);_0x37da34[_0x8b68('0x4c')][_0x8b68('0x51')]=integrations[_0x8b68('0x52')](_0x37da34[_0x8b68('0x4c')][_0x8b68('0x53')],_0x37da34['body'][_0x8b68('0x30')]);return db[_0x8b68('0x54')]['create'](_0x37da34[_0x8b68('0x4c')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x8b68('0x51')}]});}return null;})[_0x8b68('0x29')](respondWithResult(_0x2d1519,null))[_0x8b68('0x45')](handleError(_0x2d1519,null));};exports[_0x8b68('0x55')]=function(_0x864b6b,_0x1fc24c,_0x35b22b){var _0x34456d='';return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x864b6b['params']['id']},'attributes':['id',_0x8b68('0x56'),_0x8b68('0x57')]})[_0x8b68('0x29')](handleEntityNotFound(_0x1fc24c,null))['then'](function(_0x5deaba){if(_0x5deaba){_0x34456d=_0x5deaba[_0x8b68('0x56')];var _0x1966f6=_0x34456d['slice'](-0x1);if(_0x1966f6==='/'){_0x34456d=_0x34456d[_0x8b68('0x58')](0x0,_0x34456d[_0x8b68('0x59')](_0x1966f6));}return rp({'method':_0x8b68('0x5a'),'uri':util[_0x8b68('0x5b')]('%s/%s',_0x34456d,_0x8b68('0x5c')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x8b68('0x5b')]('%s:X',_0x5deaba[_0x8b68('0x57')]))[_0x8b68('0x5d')]('base64'))},'json':!![]});}})[_0x8b68('0x29')](function(_0x11abf9){if(_0x11abf9){var _0x1525da=[_0x8b68('0x5e'),_0x8b68('0x5f'),'agent',_0x8b68('0x60'),_0x8b68('0x1e'),_0x8b68('0x61'),_0x8b68('0x62'),_0x8b68('0x63'),'ticket_type','group',_0x8b68('0x64')];_['remove'](_0x11abf9,function(_0x2d442a){return _0x1525da[_0x8b68('0x65')](_0x2d442a[_0x8b68('0x41')])||!_0x2d442a[_0x8b68('0x66')]&&_0x2d442a[_0x8b68('0x30')]!==_0x8b68('0x67')&&_0x2d442a[_0x8b68('0x30')]!=='custom_dropdown';});return{'count':_0x11abf9[_0x8b68('0x37')],'rows':_['map'](_0x11abf9,function(_0x3aaaed){return{'id':_0x3aaaed[_0x8b68('0x41')],'name':_0x3aaaed[_0x8b68('0x68')],'custom':!_0x3aaaed['default'],'options':_0x3aaaed[_0x8b68('0x69')]?_['map'](_0x3aaaed[_0x8b68('0x69')],function(_0x4bb4a5){return{'name':_[_0x8b68('0x6a')](_0x4bb4a5),'value':_0x4bb4a5};}):[]};})};}})[_0x8b68('0x29')](respondWithResult(_0x1fc24c,null))[_0x8b68('0x45')](function(_0x5ce3f8){var _0x33b775=_0x864b6b[_0x8b68('0x32')][_0x8b68('0x6b')]?0x1f4:_0x5ce3f8[_0x8b68('0x6c')]||0x1f4;logger[_0x8b68('0x6d')](_0x8b68('0x6e'),_0x8b68('0x55'),_0x33b775,JSON[_0x8b68('0x6f')](_0x5ce3f8));delete _0x5ce3f8[_0x8b68('0x41')];if(_0x33b775===0x191){_0x33b775=0x190;}_0x1fc24c['status'](_0x33b775)[_0x8b68('0x70')](_0x864b6b[_0x8b68('0x32')][_0x8b68('0x6b')]?{'message':_0x8b68('0x71'),'statusCode':_0x5ce3f8[_0x8b68('0x6c')]}:_0x5ce3f8);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 1d6a317..f5e8f6c 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 _0xf4fc=['exports','define','int_freshdesk_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0xf4fc,0xd3));var _0xcf4f=function(_0x2253bb,_0xd4bd43){_0x2253bb=_0x2253bb-0x0;var _0x4fa96f=_0xf4fc[_0x2253bb];return _0x4fa96f;};'use strict';var _=require('lodash');var util=require(_0xcf4f('0x0'));var logger=require('../../config/logger')(_0xcf4f('0x1'));var moment=require(_0xcf4f('0x2'));var BPromise=require(_0xcf4f('0x3'));var rp=require(_0xcf4f('0x4'));var fs=require('fs');var path=require(_0xcf4f('0x5'));var rimraf=require(_0xcf4f('0x6'));var config=require(_0xcf4f('0x7'));var attributes=require(_0xcf4f('0x8'));var integrations=require(_0xcf4f('0x9'));module[_0xcf4f('0xa')]=function(_0x3143d1,_0xf4e0b){return _0x3143d1[_0xcf4f('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xcf4f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2874=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x13ed5f,_0x106558){var _0x29e39c=function(_0x15c9a6){while(--_0x15c9a6){_0x13ed5f['push'](_0x13ed5f['shift']());}};_0x29e39c(++_0x106558);}(_0x2874,0xd7));var _0x4287=function(_0x26f4a8,_0x9bdd19){_0x26f4a8=_0x26f4a8-0x0;var _0x2c3ad6=_0x2874[_0x26f4a8];return _0x2c3ad6;};'use strict';var _=require(_0x4287('0x0'));var util=require(_0x4287('0x1'));var logger=require(_0x4287('0x2'))(_0x4287('0x3'));var moment=require('moment');var BPromise=require(_0x4287('0x4'));var rp=require(_0x4287('0x5'));var fs=require('fs');var path=require(_0x4287('0x6'));var rimraf=require(_0x4287('0x7'));var config=require(_0x4287('0x8'));var attributes=require(_0x4287('0x9'));var integrations=require(_0x4287('0xa'));module[_0x4287('0xb')]=function(_0x4df8ca,_0x1bf0b9){return _0x4df8ca['define'](_0x4287('0xc'),attributes,{'tableName':_0x4287('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 5cdccb7..334a724 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 _0xfa6f=['GetFreshdeskAccount','stringify','find','ShowFreshdeskAccount','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','FreshdeskAccount','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x2d9ecf,_0x2482cb){var _0x1f311f=function(_0x491d8e){while(--_0x491d8e){_0x2d9ecf['push'](_0x2d9ecf['shift']());}};_0x1f311f(++_0x2482cb);}(_0xfa6f,0xa9));var _0xffa6=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xfa6f[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xffa6('0x0'));var util=require(_0xffa6('0x1'));var moment=require(_0xffa6('0x2'));var BPromise=require('bluebird');var rs=require(_0xffa6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xffa6('0x4'));var logger=require(_0xffa6('0x5'))(_0xffa6('0x6'));var config=require(_0xffa6('0x7'));var jayson=require(_0xffa6('0x8'));var client=jayson['client'][_0xffa6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdff266,_0x27990d,_0x2f3dce){return new BPromise(function(_0x44025e,_0x581a40){return client['request'](_0xdff266,_0x2f3dce)[_0xffa6('0xa')](function(_0x5840f7){logger['info'](_0xffa6('0xb'),_0x27990d,_0xffa6('0xc'));logger[_0xffa6('0xd')](_0xffa6('0xe'),_0x27990d,'request\x20sent',JSON['stringify'](_0x5840f7));if(_0x5840f7[_0xffa6('0xf')]){if(_0x5840f7[_0xffa6('0xf')][_0xffa6('0x10')]===0x1f4){logger[_0xffa6('0xf')](_0xffa6('0xb'),_0x27990d,_0x5840f7[_0xffa6('0xf')][_0xffa6('0x11')]);return _0x581a40(_0x5840f7[_0xffa6('0xf')][_0xffa6('0x11')]);}logger[_0xffa6('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x27990d,_0x5840f7[_0xffa6('0xf')]['message']);return _0x44025e(_0x5840f7['error']['message']);}else{logger[_0xffa6('0x12')](_0xffa6('0xb'),_0x27990d,_0xffa6('0xc'));_0x44025e(_0x5840f7['result'][_0xffa6('0x11')]);}})[_0xffa6('0x13')](function(_0x192203){logger[_0xffa6('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x27990d,_0x192203);_0x581a40(_0x192203);});});}exports['GetFreshdeskAccount']=function(_0x4a9036){var _0x482411=this;return new Promise(function(_0x95aab3,_0x1d7d4b){return db[_0xffa6('0x14')][_0xffa6('0x15')]({'raw':_0x4a9036[_0xffa6('0x16')]?_0x4a9036['options'][_0xffa6('0x17')]===undefined?!![]:![]:!![],'where':_0x4a9036[_0xffa6('0x16')]?_0x4a9036[_0xffa6('0x16')]['where']||null:null,'attributes':_0x4a9036['options']?_0x4a9036['options']['attributes']||null:null,'limit':_0x4a9036[_0xffa6('0x16')]?_0x4a9036['options'][_0xffa6('0x18')]||null:null,'include':_0x4a9036['options']?_0x4a9036[_0xffa6('0x16')][_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x4a9036[_0xffa6('0x16')][_0xffa6('0x19')],function(_0x4d7191){return{'model':db[_0x4d7191[_0xffa6('0x1b')]],'as':_0x4d7191['as'],'attributes':_0x4d7191[_0xffa6('0x1c')],'include':_0x4d7191[_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x4d7191[_0xffa6('0x19')],function(_0x2b120f){return{'model':db[_0x2b120f[_0xffa6('0x1b')]],'as':_0x2b120f['as'],'attributes':_0x2b120f[_0xffa6('0x1c')],'include':_0x2b120f[_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x2b120f['include'],function(_0x8648a9){return{'model':db[_0x8648a9[_0xffa6('0x1b')]],'as':_0x8648a9['as'],'attributes':_0x8648a9['attributes']};}):[]};}):[]};}):[]:[]})[_0xffa6('0xa')](function(_0x3bbe62){logger['info'](_0xffa6('0x1d'),_0x4a9036);logger['debug'](_0xffa6('0x1d'),_0x4a9036,JSON[_0xffa6('0x1e')](_0x3bbe62));_0x95aab3(_0x3bbe62);})[_0xffa6('0x13')](function(_0x36e2f0){logger[_0xffa6('0xf')]('GetFreshdeskAccount',_0x36e2f0[_0xffa6('0x11')],_0x4a9036);_0x1d7d4b(_0x482411['error'](0x1f4,_0x36e2f0[_0xffa6('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x4858c4){var _0xb1098e=this;return new Promise(function(_0x384ca9,_0x23639e){return db[_0xffa6('0x14')][_0xffa6('0x1f')]({'raw':_0x4858c4[_0xffa6('0x16')]?_0x4858c4[_0xffa6('0x16')][_0xffa6('0x17')]===undefined?!![]:![]:!![],'where':_0x4858c4[_0xffa6('0x16')]?_0x4858c4['options']['where']||null:null,'attributes':_0x4858c4['options']?_0x4858c4[_0xffa6('0x16')][_0xffa6('0x1c')]||null:null,'include':_0x4858c4[_0xffa6('0x16')]?_0x4858c4[_0xffa6('0x16')][_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x4858c4[_0xffa6('0x16')]['include'],function(_0x32d832){return{'model':db[_0x32d832[_0xffa6('0x1b')]],'as':_0x32d832['as'],'attributes':_0x32d832['attributes'],'include':_0x32d832['include']?_['map'](_0x32d832[_0xffa6('0x19')],function(_0x5bdafc){return{'model':db[_0x5bdafc[_0xffa6('0x1b')]],'as':_0x5bdafc['as'],'attributes':_0x5bdafc['attributes'],'include':_0x5bdafc[_0xffa6('0x19')]?_[_0xffa6('0x1a')](_0x5bdafc[_0xffa6('0x19')],function(_0x29634c){return{'model':db[_0x29634c['model']],'as':_0x29634c['as'],'attributes':_0x29634c[_0xffa6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e88a){logger[_0xffa6('0x12')](_0xffa6('0x20'),_0x4858c4);logger[_0xffa6('0xd')](_0xffa6('0x20'),_0x4858c4,JSON[_0xffa6('0x1e')](_0x47e88a));_0x384ca9(_0x47e88a);})['catch'](function(_0x952fe0){logger[_0xffa6('0xf')](_0xffa6('0x20'),_0x952fe0['message'],_0x4858c4);_0x23639e(_0xb1098e[_0xffa6('0xf')](0x1f4,_0x952fe0[_0xffa6('0x11')]));});});}; \ No newline at end of file +var _0xa175=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','FreshdeskAccount','options','where','attributes','limit','map','include','model','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','find','raw','util'];(function(_0x34828f,_0x26ea02){var _0x25fd95=function(_0x75f926){while(--_0x75f926){_0x34828f['push'](_0x34828f['shift']());}};_0x25fd95(++_0x26ea02);}(_0xa175,0x15d));var _0x5a17=function(_0x37a048,_0x18c594){_0x37a048=_0x37a048-0x0;var _0x3a097c=_0xa175[_0x37a048];return _0x3a097c;};'use strict';var _=require('lodash');var util=require(_0x5a17('0x0'));var moment=require(_0x5a17('0x1'));var BPromise=require(_0x5a17('0x2'));var rs=require(_0x5a17('0x3'));var fs=require('fs');var Redis=require(_0x5a17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a17('0x5'));var logger=require('../../config/logger')(_0x5a17('0x6'));var config=require(_0x5a17('0x7'));var jayson=require(_0x5a17('0x8'));var client=jayson[_0x5a17('0x9')][_0x5a17('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6bf12f,_0x55b5eb,_0x38b8d1){return new BPromise(function(_0x21e69d,_0x1876b5){return client['request'](_0x6bf12f,_0x38b8d1)[_0x5a17('0xb')](function(_0x259909){logger['info'](_0x5a17('0xc'),_0x55b5eb,_0x5a17('0xd'));logger[_0x5a17('0xe')](_0x5a17('0xf'),_0x55b5eb,'request\x20sent',JSON['stringify'](_0x259909));if(_0x259909[_0x5a17('0x10')]){if(_0x259909[_0x5a17('0x10')][_0x5a17('0x11')]===0x1f4){logger[_0x5a17('0x10')](_0x5a17('0xc'),_0x55b5eb,_0x259909[_0x5a17('0x10')][_0x5a17('0x12')]);return _0x1876b5(_0x259909[_0x5a17('0x10')][_0x5a17('0x12')]);}logger[_0x5a17('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x55b5eb,_0x259909[_0x5a17('0x10')][_0x5a17('0x12')]);return _0x21e69d(_0x259909[_0x5a17('0x10')][_0x5a17('0x12')]);}else{logger[_0x5a17('0x13')](_0x5a17('0xc'),_0x55b5eb,_0x5a17('0xd'));_0x21e69d(_0x259909[_0x5a17('0x14')]['message']);}})[_0x5a17('0x15')](function(_0x583c55){logger[_0x5a17('0x10')](_0x5a17('0xc'),_0x55b5eb,_0x583c55);_0x1876b5(_0x583c55);});});}exports['GetFreshdeskAccount']=function(_0x406981){var _0x1e6e35=this;return new Promise(function(_0x48f031,_0x31cc4f){return db[_0x5a17('0x16')]['findAll']({'raw':_0x406981[_0x5a17('0x17')]?_0x406981[_0x5a17('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x406981[_0x5a17('0x17')]?_0x406981['options'][_0x5a17('0x18')]||null:null,'attributes':_0x406981[_0x5a17('0x17')]?_0x406981[_0x5a17('0x17')][_0x5a17('0x19')]||null:null,'limit':_0x406981[_0x5a17('0x17')]?_0x406981[_0x5a17('0x17')][_0x5a17('0x1a')]||null:null,'include':_0x406981['options']?_0x406981['options']['include']?_[_0x5a17('0x1b')](_0x406981[_0x5a17('0x17')][_0x5a17('0x1c')],function(_0x1d8d6e){return{'model':db[_0x1d8d6e[_0x5a17('0x1d')]],'as':_0x1d8d6e['as'],'attributes':_0x1d8d6e[_0x5a17('0x19')],'include':_0x1d8d6e[_0x5a17('0x1c')]?_['map'](_0x1d8d6e[_0x5a17('0x1c')],function(_0x544832){return{'model':db[_0x544832[_0x5a17('0x1d')]],'as':_0x544832['as'],'attributes':_0x544832[_0x5a17('0x19')],'include':_0x544832[_0x5a17('0x1c')]?_['map'](_0x544832[_0x5a17('0x1c')],function(_0x191c94){return{'model':db[_0x191c94[_0x5a17('0x1d')]],'as':_0x191c94['as'],'attributes':_0x191c94[_0x5a17('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fa3a0){logger['info'](_0x5a17('0x1e'),_0x406981);logger[_0x5a17('0xe')](_0x5a17('0x1e'),_0x406981,JSON[_0x5a17('0x1f')](_0x1fa3a0));_0x48f031(_0x1fa3a0);})[_0x5a17('0x15')](function(_0x14ce40){logger[_0x5a17('0x10')]('GetFreshdeskAccount',_0x14ce40[_0x5a17('0x12')],_0x406981);_0x31cc4f(_0x1e6e35[_0x5a17('0x10')](0x1f4,_0x14ce40[_0x5a17('0x12')]));});});};exports[_0x5a17('0x20')]=function(_0x2f1a50){var _0x182aa4=this;return new Promise(function(_0x1298bc,_0x44b1d8){return db[_0x5a17('0x16')][_0x5a17('0x21')]({'raw':_0x2f1a50['options']?_0x2f1a50[_0x5a17('0x17')][_0x5a17('0x22')]===undefined?!![]:![]:!![],'where':_0x2f1a50['options']?_0x2f1a50[_0x5a17('0x17')][_0x5a17('0x18')]||null:null,'attributes':_0x2f1a50['options']?_0x2f1a50[_0x5a17('0x17')][_0x5a17('0x19')]||null:null,'include':_0x2f1a50[_0x5a17('0x17')]?_0x2f1a50[_0x5a17('0x17')][_0x5a17('0x1c')]?_[_0x5a17('0x1b')](_0x2f1a50[_0x5a17('0x17')][_0x5a17('0x1c')],function(_0x734eda){return{'model':db[_0x734eda[_0x5a17('0x1d')]],'as':_0x734eda['as'],'attributes':_0x734eda[_0x5a17('0x19')],'include':_0x734eda['include']?_['map'](_0x734eda[_0x5a17('0x1c')],function(_0x586257){return{'model':db[_0x586257['model']],'as':_0x586257['as'],'attributes':_0x586257[_0x5a17('0x19')],'include':_0x586257[_0x5a17('0x1c')]?_['map'](_0x586257['include'],function(_0xf176c8){return{'model':db[_0xf176c8[_0x5a17('0x1d')]],'as':_0xf176c8['as'],'attributes':_0xf176c8[_0x5a17('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x430982){logger[_0x5a17('0x13')]('ShowFreshdeskAccount',_0x2f1a50);logger['debug'](_0x5a17('0x20'),_0x2f1a50,JSON[_0x5a17('0x1f')](_0x430982));_0x1298bc(_0x430982);})[_0x5a17('0x15')](function(_0x269430){logger[_0x5a17('0x10')](_0x5a17('0x20'),_0x269430[_0x5a17('0x12')],_0x2f1a50);_0x44b1d8(_0x182aa4[_0x5a17('0x10')](0x1f4,_0x269430['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 7fb1628..8d1f0c5 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 _0xab50=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x31826c,_0x1995c5){var _0x20bbd7=function(_0x2a98ab){while(--_0x2a98ab){_0x31826c['push'](_0x31826c['shift']());}};_0x20bbd7(++_0x1995c5);}(_0xab50,0x1d7));var _0x0ab5=function(_0x15dcfc,_0x43731d){_0x15dcfc=_0x15dcfc-0x0;var _0x332d0f=_0xab50[_0x15dcfc];return _0x332d0f;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require(_0x0ab5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab5('0x3'));var router=express[_0x0ab5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ab5('0x5'));var interaction=require(_0x0ab5('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x8')]);router[_0x0ab5('0x9')](_0x0ab5('0xa'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0xb')]);router[_0x0ab5('0x9')](_0x0ab5('0xc'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0xd')]);router[_0x0ab5('0x9')](_0x0ab5('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0ab5('0x9')](_0x0ab5('0xf'),auth[_0x0ab5('0x7')](),controller['getDescriptions']);router[_0x0ab5('0x9')](_0x0ab5('0x10'),auth[_0x0ab5('0x7')](),controller['getTags']);router[_0x0ab5('0x11')]('/',auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x12')]);router['post'](_0x0ab5('0x10'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x13')]);router[_0x0ab5('0x14')](_0x0ab5('0xa'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x15')]);router[_0x0ab5('0x16')](_0x0ab5('0xa'),auth[_0x0ab5('0x7')](),controller[_0x0ab5('0x17')]);module[_0x0ab5('0x18')]=router; \ No newline at end of file +var _0x71be=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xba78e1,_0x452ddb){var _0x4a7b98=function(_0x72a5ef){while(--_0x72a5ef){_0xba78e1['push'](_0xba78e1['shift']());}};_0x4a7b98(++_0x452ddb);}(_0x71be,0x81));var _0xe71b=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x71be[_0x37c22c];return _0x119d79;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe71b('0x0'));var timeout=require(_0xe71b('0x1'));var express=require(_0xe71b('0x2'));var router=express[_0xe71b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe71b('0x4'));var interaction=require(_0xe71b('0x5'));var config=require(_0xe71b('0x6'));var controller=require(_0xe71b('0x7'));router[_0xe71b('0x8')]('/',auth[_0xe71b('0x9')](),controller['index']);router[_0xe71b('0x8')](_0xe71b('0xa'),auth[_0xe71b('0x9')](),controller[_0xe71b('0xb')]);router['get'](_0xe71b('0xc'),auth[_0xe71b('0x9')](),controller[_0xe71b('0xd')]);router[_0xe71b('0x8')](_0xe71b('0xe'),auth[_0xe71b('0x9')](),controller[_0xe71b('0xf')]);router['get'](_0xe71b('0x10'),auth[_0xe71b('0x9')](),controller[_0xe71b('0x11')]);router[_0xe71b('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe71b('0x12')]);router[_0xe71b('0x13')]('/',auth[_0xe71b('0x9')](),controller[_0xe71b('0x14')]);router['post'](_0xe71b('0x15'),auth[_0xe71b('0x9')](),controller[_0xe71b('0x16')]);router[_0xe71b('0x17')](_0xe71b('0xa'),auth[_0xe71b('0x9')](),controller[_0xe71b('0x18')]);router['delete'](_0xe71b('0xa'),auth['isAuthenticated'](),controller[_0xe71b('0x19')]);module[_0xe71b('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 1f7f893..cf4f119 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 _0x02f8=['sequelize'];(function(_0x21c84f,_0x4614cf){var _0x5bd4aa=function(_0x289017){while(--_0x289017){_0x21c84f['push'](_0x21c84f['shift']());}};_0x5bd4aa(++_0x4614cf);}(_0x02f8,0x1e4));var _0x802f=function(_0xfb6cef,_0x206adf){_0xfb6cef=_0xfb6cef-0x0;var _0x40eb07=_0x02f8[_0xfb6cef];return _0x40eb07;};'use strict';var Sequelize=require(_0x802f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a1a=['STRING','sequelize','exports'];(function(_0x12428d,_0x5dc7a8){var _0x5685c7=function(_0x168be2){while(--_0x168be2){_0x12428d['push'](_0x12428d['shift']());}};_0x5685c7(++_0x5dc7a8);}(_0x9a1a,0x142));var _0xa9a1=function(_0x58a4d1,_0x15d225){_0x58a4d1=_0x58a4d1-0x0;var _0x4690c1=_0x9a1a[_0x58a4d1];return _0x4690c1;};'use strict';var Sequelize=require(_0xa9a1('0x0'));module[_0xa9a1('0x1')]={'name':{'type':Sequelize[_0xa9a1('0x2')]},'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 6332735..8421d5a 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 _0x1718=['hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','update','body','find','getFields','findOne','FreshdeskField','filter','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields'];(function(_0x4629e1,_0x15ec63){var _0x521c5b=function(_0x2cf921){while(--_0x2cf921){_0x4629e1['push'](_0x4629e1['shift']());}};_0x521c5b(++_0x15ec63);}(_0x1718,0x117));var _0x8171=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1718[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8171('0x0'));var zipdir=require(_0x8171('0x1'));var jsonpatch=require(_0x8171('0x2'));var rp=require('request-promise');var moment=require(_0x8171('0x3'));var BPromise=require(_0x8171('0x4'));var Mustache=require('mustache');var util=require(_0x8171('0x5'));var path=require(_0x8171('0x6'));var sox=require(_0x8171('0x7'));var csv=require(_0x8171('0x8'));var ejs=require(_0x8171('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8171('0xa'));var squel=require(_0x8171('0xb'));var crypto=require(_0x8171('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8171('0xd'));var toCsv=require(_0x8171('0x8'));var querystring=require(_0x8171('0xe'));var Papa=require(_0x8171('0xf'));var Redis=require(_0x8171('0x10'));var authService=require(_0x8171('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8171('0x12'));var hardwareService=require(_0x8171('0x13'));var logger=require(_0x8171('0x14'))('api');var utils=require(_0x8171('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8171('0x16'))['db'];function respondWithStatusCode(_0x514e25,_0x13bd66){_0x13bd66=_0x13bd66||0xcc;return function(_0x2fe569){if(_0x2fe569){return _0x514e25[_0x8171('0x17')](_0x13bd66);}return _0x514e25[_0x8171('0x18')](_0x13bd66)[_0x8171('0x19')]();};}function respondWithResult(_0x285260,_0x32bc03){_0x32bc03=_0x32bc03||0xc8;return function(_0x1bce7f){if(_0x1bce7f){return _0x285260[_0x8171('0x18')](_0x32bc03)[_0x8171('0x1a')](_0x1bce7f);}};}function respondWithFilteredResult(_0x5c9871,_0x3adbf9){return function(_0x34daac){if(_0x34daac){var _0x4f6d63=typeof _0x3adbf9[_0x8171('0x1b')]===_0x8171('0x1c')&&typeof _0x3adbf9[_0x8171('0x1d')]===_0x8171('0x1c');var _0x4b008f=_0x34daac[_0x8171('0x1e')];var _0x35dd65=_0x4f6d63?0x0:_0x3adbf9[_0x8171('0x1b')];var _0x19dd29=_0x4f6d63?_0x34daac[_0x8171('0x1e')]:_0x3adbf9[_0x8171('0x1b')]+_0x3adbf9[_0x8171('0x1d')];var _0x16e250;if(_0x19dd29>=_0x4b008f){_0x19dd29=_0x4b008f;_0x16e250=0xc8;}else{_0x16e250=0xce;}_0x5c9871['status'](_0x16e250);return _0x5c9871[_0x8171('0x1f')](_0x8171('0x20'),_0x35dd65+'-'+_0x19dd29+'/'+_0x4b008f)[_0x8171('0x1a')](_0x34daac);}return null;};}function patchUpdates(_0x12a6ad){return function(_0x476785){try{jsonpatch[_0x8171('0x21')](_0x476785,_0x12a6ad,!![]);}catch(_0x4505e4){return BPromise[_0x8171('0x22')](_0x4505e4);}return _0x476785['save']();};}function saveUpdates(_0x140755,_0x1a37ba){return function(_0x3b0db9){if(_0x3b0db9){return _0x3b0db9['update'](_0x140755)[_0x8171('0x23')](function(_0x26e5fc){return _0x26e5fc;});}return null;};}function removeEntity(_0x5d3ef5,_0x22851d){return function(_0x83ad6c){if(_0x83ad6c){return _0x83ad6c[_0x8171('0x24')]()[_0x8171('0x23')](function(){_0x5d3ef5['status'](0xcc)[_0x8171('0x19')]();});}};}function handleEntityNotFound(_0x103a5b,_0xee1fb){return function(_0x32649d){if(!_0x32649d){_0x103a5b['sendStatus'](0x194);}return _0x32649d;};}function handleError(_0x5da59f,_0x1d7fe3){_0x1d7fe3=_0x1d7fe3||0x1f4;return function(_0x20631f){logger[_0x8171('0x25')](_0x20631f[_0x8171('0x26')]);if(_0x20631f['name']){delete _0x20631f[_0x8171('0x27')];}_0x5da59f[_0x8171('0x18')](_0x1d7fe3)[_0x8171('0x28')](_0x20631f);};}exports['index']=function(_0x575e66,_0x384900){var _0x35b4fb={},_0x4bfab4={},_0x4987d6={'count':0x0,'rows':[]};var _0x281582=_['map'](db[_0x8171('0x29')][_0x8171('0x2a')],function(_0x524874){return{'name':_0x524874[_0x8171('0x2b')],'type':_0x524874[_0x8171('0x2c')][_0x8171('0x2d')]};});_0x4bfab4[_0x8171('0x2e')]=_[_0x8171('0x2f')](_0x281582,_0x8171('0x27'));_0x4bfab4['query']=_[_0x8171('0x30')](_0x575e66[_0x8171('0x31')]);_0x4bfab4['filters']=_[_0x8171('0x32')](_0x4bfab4[_0x8171('0x2e')],_0x4bfab4[_0x8171('0x31')]);_0x35b4fb[_0x8171('0x33')]=_['intersection'](_0x4bfab4[_0x8171('0x2e')],qs[_0x8171('0x34')](_0x575e66[_0x8171('0x31')][_0x8171('0x34')]));_0x35b4fb[_0x8171('0x33')]=_0x35b4fb[_0x8171('0x33')]['length']?_0x35b4fb[_0x8171('0x33')]:_0x4bfab4[_0x8171('0x2e')];if(!_0x575e66[_0x8171('0x31')][_0x8171('0x35')](_0x8171('0x36'))){_0x35b4fb[_0x8171('0x1d')]=qs['limit'](_0x575e66['query'][_0x8171('0x1d')]);_0x35b4fb[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x575e66[_0x8171('0x31')][_0x8171('0x1b')]);}_0x35b4fb[_0x8171('0x37')]=qs['sort'](_0x575e66[_0x8171('0x31')][_0x8171('0x38')]);_0x35b4fb['where']=qs['filters'](_[_0x8171('0x39')](_0x575e66[_0x8171('0x31')],_0x4bfab4[_0x8171('0x3a')]),_0x281582);if(_0x575e66[_0x8171('0x31')]['filter']){_0x35b4fb[_0x8171('0x3b')]=_[_0x8171('0x3c')](_0x35b4fb[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x281582,function(_0xf985cb){if(_0xf985cb['type']!=='VIRTUAL'){var _0x283a09={};_0x283a09[_0xf985cb[_0x8171('0x27')]]={'$like':'%'+_0x575e66[_0x8171('0x31')]['filter']+'%'};return _0x283a09;}})});}_0x35b4fb=_[_0x8171('0x3c')]({},_0x35b4fb,_0x575e66['options']);var _0x5583dc={'where':_0x35b4fb[_0x8171('0x3b')]};return db[_0x8171('0x29')][_0x8171('0x1e')](_0x5583dc)['then'](function(_0x2b55fe){_0x4987d6[_0x8171('0x1e')]=_0x2b55fe;if(_0x575e66[_0x8171('0x31')][_0x8171('0x3d')]){_0x35b4fb[_0x8171('0x3e')]=[{'all':!![]}];}return db[_0x8171('0x29')][_0x8171('0x3f')](_0x35b4fb);})[_0x8171('0x23')](function(_0x140264){_0x4987d6[_0x8171('0x40')]=_0x140264;return _0x4987d6;})[_0x8171('0x23')](respondWithFilteredResult(_0x384900,_0x35b4fb))[_0x8171('0x41')](handleError(_0x384900,null));};exports[_0x8171('0x42')]=function(_0x48c646,_0x5e5438){var _0x8e9dd2={'raw':![],'where':{'id':_0x48c646[_0x8171('0x43')]['id']}},_0x4208ca={};_0x4208ca['model']=_[_0x8171('0x30')](db[_0x8171('0x29')][_0x8171('0x2a')]);_0x4208ca[_0x8171('0x31')]=_['keys'](_0x48c646[_0x8171('0x31')]);_0x4208ca[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x4208ca[_0x8171('0x2e')],_0x4208ca[_0x8171('0x31')]);_0x8e9dd2[_0x8171('0x33')]=_[_0x8171('0x32')](_0x4208ca[_0x8171('0x2e')],qs[_0x8171('0x34')](_0x48c646[_0x8171('0x31')][_0x8171('0x34')]));_0x8e9dd2[_0x8171('0x33')]=_0x8e9dd2['attributes'][_0x8171('0x44')]?_0x8e9dd2[_0x8171('0x33')]:_0x4208ca[_0x8171('0x2e')];if(_0x48c646[_0x8171('0x31')]['includeAll']){_0x8e9dd2[_0x8171('0x3e')]=[{'all':!![]}];}_0x8e9dd2=_[_0x8171('0x3c')]({},_0x8e9dd2,_0x48c646[_0x8171('0x45')]);return db['FreshdeskConfiguration']['find'](_0x8e9dd2)[_0x8171('0x23')](handleEntityNotFound(_0x5e5438,null))[_0x8171('0x23')](respondWithResult(_0x5e5438,null))[_0x8171('0x41')](handleError(_0x5e5438,null));};exports[_0x8171('0x46')]=function(_0x55e137,_0x559b1c){return db['FreshdeskConfiguration'][_0x8171('0x46')](_0x55e137['body'],{})['then'](respondWithResult(_0x559b1c,0xc9))['catch'](handleError(_0x559b1c,null));};exports[_0x8171('0x47')]=function(_0x428507,_0x511b26){if(_0x428507[_0x8171('0x48')]['id']){delete _0x428507['body']['id'];}return db[_0x8171('0x29')]['find']({'where':{'id':_0x428507[_0x8171('0x43')]['id']}})['then'](handleEntityNotFound(_0x511b26,null))[_0x8171('0x23')](saveUpdates(_0x428507[_0x8171('0x48')],null))[_0x8171('0x23')](respondWithResult(_0x511b26,null))[_0x8171('0x41')](handleError(_0x511b26,null));};exports[_0x8171('0x24')]=function(_0x390c64,_0x48403f){return db['FreshdeskConfiguration'][_0x8171('0x49')]({'where':{'id':_0x390c64[_0x8171('0x43')]['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x48403f,null))[_0x8171('0x23')](removeEntity(_0x48403f,null))[_0x8171('0x41')](handleError(_0x48403f,null));};exports[_0x8171('0x4a')]=function(_0x341be8,_0x5eab18,_0x47fb80){var _0x5f2dd4={};var _0x3494ec={};var _0x271ee6;var _0xbab36b;return db[_0x8171('0x29')][_0x8171('0x4b')]({'where':{'id':_0x341be8['params']['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x5eab18,null))['then'](function(_0x542e3d){if(_0x542e3d){_0x271ee6=_0x542e3d;_0x3494ec['model']=_[_0x8171('0x30')](db[_0x8171('0x4c')]['rawAttributes']);_0x3494ec[_0x8171('0x31')]=_[_0x8171('0x30')](_0x341be8[_0x8171('0x31')]);_0x3494ec[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x3494ec[_0x8171('0x2e')],_0x3494ec[_0x8171('0x31')]);_0x5f2dd4[_0x8171('0x33')]=_[_0x8171('0x32')](_0x3494ec[_0x8171('0x2e')],qs[_0x8171('0x34')](_0x341be8[_0x8171('0x31')][_0x8171('0x34')]));_0x5f2dd4['attributes']=_0x5f2dd4[_0x8171('0x33')][_0x8171('0x44')]?_0x5f2dd4[_0x8171('0x33')]:_0x3494ec['model'];_0x5f2dd4[_0x8171('0x37')]=qs[_0x8171('0x38')](_0x341be8[_0x8171('0x31')][_0x8171('0x38')]);_0x5f2dd4['where']=qs['filters'](_[_0x8171('0x39')](_0x341be8[_0x8171('0x31')],_0x3494ec[_0x8171('0x3a')]));if(_0x341be8[_0x8171('0x31')][_0x8171('0x4d')]){_0x5f2dd4[_0x8171('0x3b')]=_[_0x8171('0x3c')](_0x5f2dd4[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x5f2dd4['attributes'],function(_0xc23587){var _0x2b89f6={};_0x2b89f6[_0xc23587]={'$like':'%'+_0x341be8[_0x8171('0x31')]['filter']+'%'};return _0x2b89f6;})});}_0x5f2dd4=_[_0x8171('0x3c')]({},_0x5f2dd4,_0x341be8[_0x8171('0x45')]);return _0x271ee6['getFields'](_0x5f2dd4);}})[_0x8171('0x23')](function(_0x5ae507){if(_0x5ae507){_0xbab36b=_0x5ae507[_0x8171('0x44')];if(!_0x341be8[_0x8171('0x31')]['hasOwnProperty']('nolimit')){_0x5f2dd4[_0x8171('0x1d')]=qs[_0x8171('0x1d')](_0x341be8[_0x8171('0x31')]['limit']);_0x5f2dd4[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x341be8[_0x8171('0x31')][_0x8171('0x1b')]);}return _0x271ee6[_0x8171('0x4a')](_0x5f2dd4);}})[_0x8171('0x23')](function(_0x454767){if(_0x454767){return _0x454767?{'count':_0xbab36b,'rows':_0x454767}:null;}})[_0x8171('0x23')](respondWithResult(_0x5eab18,null))[_0x8171('0x41')](handleError(_0x5eab18,null));};exports[_0x8171('0x4e')]=function(_0x671077,_0x2abf75,_0x42f62f){var _0x29abee={};var _0x2dd32d={};var _0x1e7e08;var _0x512797;return db['FreshdeskConfiguration'][_0x8171('0x4b')]({'where':{'id':_0x671077[_0x8171('0x43')]['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x2abf75,null))[_0x8171('0x23')](function(_0x21a28d){if(_0x21a28d){_0x1e7e08=_0x21a28d;_0x2dd32d[_0x8171('0x2e')]=_[_0x8171('0x30')](db[_0x8171('0x4c')][_0x8171('0x2a')]);_0x2dd32d[_0x8171('0x31')]=_['keys'](_0x671077[_0x8171('0x31')]);_0x2dd32d[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x2dd32d['model'],_0x2dd32d[_0x8171('0x31')]);_0x29abee[_0x8171('0x33')]=_[_0x8171('0x32')](_0x2dd32d['model'],qs[_0x8171('0x34')](_0x671077['query'][_0x8171('0x34')]));_0x29abee['attributes']=_0x29abee['attributes']['length']?_0x29abee[_0x8171('0x33')]:_0x2dd32d['model'];_0x29abee[_0x8171('0x37')]=qs[_0x8171('0x38')](_0x671077[_0x8171('0x31')][_0x8171('0x38')]);_0x29abee[_0x8171('0x3b')]=qs[_0x8171('0x3a')](_['pick'](_0x671077[_0x8171('0x31')],_0x2dd32d[_0x8171('0x3a')]));if(_0x671077[_0x8171('0x31')][_0x8171('0x4d')]){_0x29abee[_0x8171('0x3b')]=_[_0x8171('0x3c')](_0x29abee[_0x8171('0x3b')],{'$or':_['map'](_0x29abee[_0x8171('0x33')],function(_0x273324){var _0x56f4f0={};_0x56f4f0[_0x273324]={'$like':'%'+_0x671077[_0x8171('0x31')]['filter']+'%'};return _0x56f4f0;})});}_0x29abee=_[_0x8171('0x3c')]({},_0x29abee,_0x671077[_0x8171('0x45')]);return _0x1e7e08['getSubjects'](_0x29abee);}})['then'](function(_0x3a735c){if(_0x3a735c){_0x512797=_0x3a735c['length'];if(!_0x671077['query'][_0x8171('0x35')](_0x8171('0x36'))){_0x29abee[_0x8171('0x1d')]=qs[_0x8171('0x1d')](_0x671077[_0x8171('0x31')][_0x8171('0x1d')]);_0x29abee[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x671077[_0x8171('0x31')]['offset']);}return _0x1e7e08[_0x8171('0x4e')](_0x29abee);}})['then'](function(_0x22a256){if(_0x22a256){return _0x22a256?{'count':_0x512797,'rows':_0x22a256}:null;}})[_0x8171('0x23')](respondWithResult(_0x2abf75,null))['catch'](handleError(_0x2abf75,null));};exports['getDescriptions']=function(_0x17bd1a,_0x5a61d4,_0x3fc545){var _0x1562bd={};var _0x52e9cd={};var _0x426a49;var _0x51265a;return db['FreshdeskConfiguration'][_0x8171('0x4b')]({'where':{'id':_0x17bd1a['params']['id']}})['then'](handleEntityNotFound(_0x5a61d4,null))[_0x8171('0x23')](function(_0x433632){if(_0x433632){_0x426a49=_0x433632;_0x52e9cd['model']=_[_0x8171('0x30')](db['FreshdeskField'][_0x8171('0x2a')]);_0x52e9cd[_0x8171('0x31')]=_[_0x8171('0x30')](_0x17bd1a[_0x8171('0x31')]);_0x52e9cd[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x52e9cd[_0x8171('0x2e')],_0x52e9cd[_0x8171('0x31')]);_0x1562bd['attributes']=_['intersection'](_0x52e9cd[_0x8171('0x2e')],qs['fields'](_0x17bd1a['query']['fields']));_0x1562bd['attributes']=_0x1562bd['attributes'][_0x8171('0x44')]?_0x1562bd[_0x8171('0x33')]:_0x52e9cd[_0x8171('0x2e')];_0x1562bd[_0x8171('0x37')]=qs[_0x8171('0x38')](_0x17bd1a[_0x8171('0x31')]['sort']);_0x1562bd[_0x8171('0x3b')]=qs['filters'](_['pick'](_0x17bd1a['query'],_0x52e9cd[_0x8171('0x3a')]));if(_0x17bd1a[_0x8171('0x31')][_0x8171('0x4d')]){_0x1562bd['where']=_['merge'](_0x1562bd[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x1562bd[_0x8171('0x33')],function(_0x38647f){var _0x4f2760={};_0x4f2760[_0x38647f]={'$like':'%'+_0x17bd1a[_0x8171('0x31')][_0x8171('0x4d')]+'%'};return _0x4f2760;})});}_0x1562bd=_[_0x8171('0x3c')]({},_0x1562bd,_0x17bd1a[_0x8171('0x45')]);return _0x426a49[_0x8171('0x4f')](_0x1562bd);}})[_0x8171('0x23')](function(_0x325306){if(_0x325306){_0x51265a=_0x325306['length'];if(!_0x17bd1a[_0x8171('0x31')][_0x8171('0x35')](_0x8171('0x36'))){_0x1562bd[_0x8171('0x1d')]=qs['limit'](_0x17bd1a['query'][_0x8171('0x1d')]);_0x1562bd[_0x8171('0x1b')]=qs[_0x8171('0x1b')](_0x17bd1a[_0x8171('0x31')][_0x8171('0x1b')]);}return _0x426a49[_0x8171('0x4f')](_0x1562bd);}})[_0x8171('0x23')](function(_0x10fe49){if(_0x10fe49){return _0x10fe49?{'count':_0x51265a,'rows':_0x10fe49}:null;}})['then'](respondWithResult(_0x5a61d4,null))[_0x8171('0x41')](handleError(_0x5a61d4,null));};exports[_0x8171('0x50')]=function(_0x294167,_0x4b3159,_0x2c8226){var _0x54fc80={};var _0x5d5af0={};var _0x51bb50;var _0xd7a5dd;return db[_0x8171('0x29')][_0x8171('0x4b')]({'where':{'id':_0x294167['params']['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x4b3159,null))[_0x8171('0x23')](function(_0x135589){if(_0x135589){_0x51bb50=_0x135589;_0x5d5af0[_0x8171('0x2e')]=_[_0x8171('0x30')](db['Tag'][_0x8171('0x2a')]);_0x5d5af0[_0x8171('0x31')]=_[_0x8171('0x30')](_0x294167[_0x8171('0x31')]);_0x5d5af0[_0x8171('0x3a')]=_[_0x8171('0x32')](_0x5d5af0[_0x8171('0x2e')],_0x5d5af0[_0x8171('0x31')]);_0x54fc80[_0x8171('0x33')]=_[_0x8171('0x32')](_0x5d5af0[_0x8171('0x2e')],qs['fields'](_0x294167[_0x8171('0x31')][_0x8171('0x34')]));_0x54fc80[_0x8171('0x33')]=_0x54fc80['attributes'][_0x8171('0x44')]?_0x54fc80[_0x8171('0x33')]:_0x5d5af0[_0x8171('0x2e')];_0x54fc80['order']=qs[_0x8171('0x38')](_0x294167[_0x8171('0x31')][_0x8171('0x38')]);_0x54fc80[_0x8171('0x3b')]=qs[_0x8171('0x3a')](_[_0x8171('0x39')](_0x294167['query'],_0x5d5af0['filters']));if(_0x294167[_0x8171('0x31')][_0x8171('0x4d')]){_0x54fc80[_0x8171('0x3b')]=_['merge'](_0x54fc80[_0x8171('0x3b')],{'$or':_[_0x8171('0x2f')](_0x54fc80[_0x8171('0x33')],function(_0x4cff6f){var _0x4fdc88={};_0x4fdc88[_0x4cff6f]={'$like':'%'+_0x294167[_0x8171('0x31')][_0x8171('0x4d')]+'%'};return _0x4fdc88;})});}_0x54fc80=_[_0x8171('0x3c')]({},_0x54fc80,_0x294167['options']);return _0x51bb50[_0x8171('0x50')](_0x54fc80);}})[_0x8171('0x23')](function(_0x14b616){if(_0x14b616){_0xd7a5dd=_0x14b616[_0x8171('0x44')];if(!_0x294167[_0x8171('0x31')][_0x8171('0x35')](_0x8171('0x36'))){_0x54fc80['limit']=qs['limit'](_0x294167[_0x8171('0x31')][_0x8171('0x1d')]);_0x54fc80['offset']=qs['offset'](_0x294167['query']['offset']);}return _0x51bb50[_0x8171('0x50')](_0x54fc80);}})[_0x8171('0x23')](function(_0x1354a4){if(_0x1354a4){return _0x1354a4?{'count':_0xd7a5dd,'rows':_0x1354a4}:null;}})['then'](respondWithResult(_0x4b3159,null))[_0x8171('0x41')](handleError(_0x4b3159,null));};exports[_0x8171('0x51')]=function(_0x5e11fd,_0x1444c5,_0x2279ec){if(_0x5e11fd[_0x8171('0x48')]['id']){delete _0x5e11fd[_0x8171('0x48')]['id'];}return db[_0x8171('0x29')][_0x8171('0x4b')]({'where':{'id':_0x5e11fd['params']['id']}})[_0x8171('0x23')](handleEntityNotFound(_0x1444c5,null))[_0x8171('0x23')](function(_0x141878){if(_0x141878){return _0x141878[_0x8171('0x51')](_0x5e11fd[_0x8171('0x48')][_0x8171('0x52')]||[]);}return null;})[_0x8171('0x23')](respondWithResult(_0x1444c5,null))[_0x8171('0x41')](handleError(_0x1444c5,null));}; \ No newline at end of file +var _0x64a5=['update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','FreshdeskConfiguration','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','save'];(function(_0x4e457b,_0x31b37c){var _0x248e7b=function(_0x35d865){while(--_0x35d865){_0x4e457b['push'](_0x4e457b['shift']());}};_0x248e7b(++_0x31b37c);}(_0x64a5,0x88));var _0x564a=function(_0x1e3480,_0x4e9223){_0x1e3480=_0x1e3480-0x0;var _0x4293e8=_0x64a5[_0x1e3480];return _0x4293e8;};'use strict';var emlformat=require(_0x564a('0x0'));var rimraf=require(_0x564a('0x1'));var zipdir=require(_0x564a('0x2'));var jsonpatch=require(_0x564a('0x3'));var rp=require(_0x564a('0x4'));var moment=require('moment');var BPromise=require(_0x564a('0x5'));var Mustache=require(_0x564a('0x6'));var util=require(_0x564a('0x7'));var path=require(_0x564a('0x8'));var sox=require(_0x564a('0x9'));var csv=require(_0x564a('0xa'));var ejs=require(_0x564a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x564a('0xc'));var crypto=require(_0x564a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x564a('0xa'));var querystring=require(_0x564a('0xe'));var Papa=require(_0x564a('0xf'));var Redis=require(_0x564a('0x10'));var authService=require(_0x564a('0x11'));var qs=require(_0x564a('0x12'));var as=require(_0x564a('0x13'));var hardwareService=require(_0x564a('0x14'));var logger=require(_0x564a('0x15'))(_0x564a('0x16'));var utils=require(_0x564a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x564a('0x18'));var db=require(_0x564a('0x19'))['db'];function respondWithStatusCode(_0x459079,_0xcf95a9){_0xcf95a9=_0xcf95a9||0xcc;return function(_0xd6c16b){if(_0xd6c16b){return _0x459079[_0x564a('0x1a')](_0xcf95a9);}return _0x459079[_0x564a('0x1b')](_0xcf95a9)[_0x564a('0x1c')]();};}function respondWithResult(_0x3c4151,_0x4e5ff0){_0x4e5ff0=_0x4e5ff0||0xc8;return function(_0x50060a){if(_0x50060a){return _0x3c4151[_0x564a('0x1b')](_0x4e5ff0)[_0x564a('0x1d')](_0x50060a);}};}function respondWithFilteredResult(_0x4b810d,_0x30ebde){return function(_0x4ef55e){if(_0x4ef55e){var _0x4991fb=typeof _0x30ebde['offset']===_0x564a('0x1e')&&typeof _0x30ebde['limit']===_0x564a('0x1e');var _0x1465ea=_0x4ef55e[_0x564a('0x1f')];var _0x747ca=_0x4991fb?0x0:_0x30ebde[_0x564a('0x20')];var _0x1e4ce5=_0x4991fb?_0x4ef55e[_0x564a('0x1f')]:_0x30ebde[_0x564a('0x20')]+_0x30ebde['limit'];var _0x131c37;if(_0x1e4ce5>=_0x1465ea){_0x1e4ce5=_0x1465ea;_0x131c37=0xc8;}else{_0x131c37=0xce;}_0x4b810d[_0x564a('0x1b')](_0x131c37);return _0x4b810d['set'](_0x564a('0x21'),_0x747ca+'-'+_0x1e4ce5+'/'+_0x1465ea)[_0x564a('0x1d')](_0x4ef55e);}return null;};}function patchUpdates(_0x27fdb7){return function(_0x2016aa){try{jsonpatch[_0x564a('0x22')](_0x2016aa,_0x27fdb7,!![]);}catch(_0x5da932){return BPromise['reject'](_0x5da932);}return _0x2016aa[_0x564a('0x23')]();};}function saveUpdates(_0x249835,_0xeba921){return function(_0x4cfced){if(_0x4cfced){return _0x4cfced[_0x564a('0x24')](_0x249835)[_0x564a('0x25')](function(_0x28d6ce){return _0x28d6ce;});}return null;};}function removeEntity(_0x1868b2,_0x518c57){return function(_0x8af14f){if(_0x8af14f){return _0x8af14f[_0x564a('0x26')]()['then'](function(){_0x1868b2['status'](0xcc)[_0x564a('0x1c')]();});}};}function handleEntityNotFound(_0x1273f0,_0x59687c){return function(_0x2fab32){if(!_0x2fab32){_0x1273f0[_0x564a('0x1a')](0x194);}return _0x2fab32;};}function handleError(_0x24e362,_0x20c511){_0x20c511=_0x20c511||0x1f4;return function(_0x146827){logger[_0x564a('0x27')](_0x146827[_0x564a('0x28')]);if(_0x146827[_0x564a('0x29')]){delete _0x146827[_0x564a('0x29')];}_0x24e362['status'](_0x20c511)[_0x564a('0x2a')](_0x146827);};}exports['index']=function(_0x44a990,_0x4b1075){var _0x3e76ae={},_0x7fc48c={},_0x1ad107={'count':0x0,'rows':[]};var _0x46f2d3=_[_0x564a('0x2b')](db['FreshdeskConfiguration'][_0x564a('0x2c')],function(_0x5a819e){return{'name':_0x5a819e[_0x564a('0x2d')],'type':_0x5a819e[_0x564a('0x2e')][_0x564a('0x2f')]};});_0x7fc48c[_0x564a('0x30')]=_[_0x564a('0x2b')](_0x46f2d3,_0x564a('0x29'));_0x7fc48c[_0x564a('0x31')]=_[_0x564a('0x32')](_0x44a990[_0x564a('0x31')]);_0x7fc48c[_0x564a('0x33')]=_[_0x564a('0x34')](_0x7fc48c['model'],_0x7fc48c['query']);_0x3e76ae[_0x564a('0x35')]=_[_0x564a('0x34')](_0x7fc48c['model'],qs[_0x564a('0x36')](_0x44a990[_0x564a('0x31')]['fields']));_0x3e76ae[_0x564a('0x35')]=_0x3e76ae[_0x564a('0x35')][_0x564a('0x37')]?_0x3e76ae['attributes']:_0x7fc48c[_0x564a('0x30')];if(!_0x44a990[_0x564a('0x31')][_0x564a('0x38')](_0x564a('0x39'))){_0x3e76ae[_0x564a('0x3a')]=qs['limit'](_0x44a990[_0x564a('0x31')][_0x564a('0x3a')]);_0x3e76ae[_0x564a('0x20')]=qs[_0x564a('0x20')](_0x44a990[_0x564a('0x31')][_0x564a('0x20')]);}_0x3e76ae[_0x564a('0x3b')]=qs['sort'](_0x44a990[_0x564a('0x31')][_0x564a('0x3c')]);_0x3e76ae[_0x564a('0x3d')]=qs[_0x564a('0x33')](_[_0x564a('0x3e')](_0x44a990[_0x564a('0x31')],_0x7fc48c[_0x564a('0x33')]),_0x46f2d3);if(_0x44a990[_0x564a('0x31')]['filter']){_0x3e76ae[_0x564a('0x3d')]=_[_0x564a('0x3f')](_0x3e76ae[_0x564a('0x3d')],{'$or':_[_0x564a('0x2b')](_0x46f2d3,function(_0x3e8ee8){if(_0x3e8ee8[_0x564a('0x2e')]!==_0x564a('0x40')){var _0x5e5a01={};_0x5e5a01[_0x3e8ee8[_0x564a('0x29')]]={'$like':'%'+_0x44a990['query'][_0x564a('0x41')]+'%'};return _0x5e5a01;}})});}_0x3e76ae=_['merge']({},_0x3e76ae,_0x44a990[_0x564a('0x42')]);var _0x122025={'where':_0x3e76ae[_0x564a('0x3d')]};return db['FreshdeskConfiguration'][_0x564a('0x1f')](_0x122025)[_0x564a('0x25')](function(_0x6a4be5){_0x1ad107['count']=_0x6a4be5;if(_0x44a990['query']['includeAll']){_0x3e76ae[_0x564a('0x43')]=[{'all':!![]}];}return db[_0x564a('0x44')]['findAll'](_0x3e76ae);})[_0x564a('0x25')](function(_0x2a1f44){_0x1ad107[_0x564a('0x45')]=_0x2a1f44;return _0x1ad107;})[_0x564a('0x25')](respondWithFilteredResult(_0x4b1075,_0x3e76ae))[_0x564a('0x46')](handleError(_0x4b1075,null));};exports[_0x564a('0x47')]=function(_0x583d2b,_0x593dd2){var _0x2e4f26={'raw':![],'where':{'id':_0x583d2b[_0x564a('0x48')]['id']}},_0x54b029={};_0x54b029[_0x564a('0x30')]=_[_0x564a('0x32')](db[_0x564a('0x44')][_0x564a('0x2c')]);_0x54b029['query']=_[_0x564a('0x32')](_0x583d2b[_0x564a('0x31')]);_0x54b029[_0x564a('0x33')]=_[_0x564a('0x34')](_0x54b029[_0x564a('0x30')],_0x54b029[_0x564a('0x31')]);_0x2e4f26[_0x564a('0x35')]=_[_0x564a('0x34')](_0x54b029[_0x564a('0x30')],qs[_0x564a('0x36')](_0x583d2b[_0x564a('0x31')][_0x564a('0x36')]));_0x2e4f26[_0x564a('0x35')]=_0x2e4f26[_0x564a('0x35')][_0x564a('0x37')]?_0x2e4f26[_0x564a('0x35')]:_0x54b029['model'];if(_0x583d2b[_0x564a('0x31')][_0x564a('0x49')]){_0x2e4f26[_0x564a('0x43')]=[{'all':!![]}];}_0x2e4f26=_[_0x564a('0x3f')]({},_0x2e4f26,_0x583d2b[_0x564a('0x42')]);return db['FreshdeskConfiguration'][_0x564a('0x4a')](_0x2e4f26)[_0x564a('0x25')](handleEntityNotFound(_0x593dd2,null))[_0x564a('0x25')](respondWithResult(_0x593dd2,null))['catch'](handleError(_0x593dd2,null));};exports[_0x564a('0x4b')]=function(_0x124ce6,_0x1ecf21){return db['FreshdeskConfiguration'][_0x564a('0x4b')](_0x124ce6['body'],{})[_0x564a('0x25')](respondWithResult(_0x1ecf21,0xc9))[_0x564a('0x46')](handleError(_0x1ecf21,null));};exports[_0x564a('0x24')]=function(_0x10471b,_0x250c69){if(_0x10471b['body']['id']){delete _0x10471b[_0x564a('0x4c')]['id'];}return db[_0x564a('0x44')][_0x564a('0x4a')]({'where':{'id':_0x10471b[_0x564a('0x48')]['id']}})['then'](handleEntityNotFound(_0x250c69,null))[_0x564a('0x25')](saveUpdates(_0x10471b['body'],null))[_0x564a('0x25')](respondWithResult(_0x250c69,null))[_0x564a('0x46')](handleError(_0x250c69,null));};exports[_0x564a('0x26')]=function(_0x3d99bd,_0x39d979){return db['FreshdeskConfiguration'][_0x564a('0x4a')]({'where':{'id':_0x3d99bd[_0x564a('0x48')]['id']}})[_0x564a('0x25')](handleEntityNotFound(_0x39d979,null))[_0x564a('0x25')](removeEntity(_0x39d979,null))['catch'](handleError(_0x39d979,null));};exports[_0x564a('0x4d')]=function(_0x1483e5,_0x2f4675,_0x3d707b){var _0x597b9c={};var _0x44f3b6={};var _0x15c814;var _0x23bb33;return db[_0x564a('0x44')][_0x564a('0x4e')]({'where':{'id':_0x1483e5['params']['id']}})[_0x564a('0x25')](handleEntityNotFound(_0x2f4675,null))[_0x564a('0x25')](function(_0x3c3032){if(_0x3c3032){_0x15c814=_0x3c3032;_0x44f3b6[_0x564a('0x30')]=_[_0x564a('0x32')](db[_0x564a('0x4f')][_0x564a('0x2c')]);_0x44f3b6[_0x564a('0x31')]=_[_0x564a('0x32')](_0x1483e5[_0x564a('0x31')]);_0x44f3b6[_0x564a('0x33')]=_[_0x564a('0x34')](_0x44f3b6[_0x564a('0x30')],_0x44f3b6[_0x564a('0x31')]);_0x597b9c[_0x564a('0x35')]=_[_0x564a('0x34')](_0x44f3b6[_0x564a('0x30')],qs[_0x564a('0x36')](_0x1483e5[_0x564a('0x31')]['fields']));_0x597b9c[_0x564a('0x35')]=_0x597b9c[_0x564a('0x35')]['length']?_0x597b9c[_0x564a('0x35')]:_0x44f3b6[_0x564a('0x30')];_0x597b9c['order']=qs[_0x564a('0x3c')](_0x1483e5[_0x564a('0x31')][_0x564a('0x3c')]);_0x597b9c['where']=qs[_0x564a('0x33')](_[_0x564a('0x3e')](_0x1483e5[_0x564a('0x31')],_0x44f3b6[_0x564a('0x33')]));if(_0x1483e5[_0x564a('0x31')][_0x564a('0x41')]){_0x597b9c['where']=_[_0x564a('0x3f')](_0x597b9c['where'],{'$or':_[_0x564a('0x2b')](_0x597b9c[_0x564a('0x35')],function(_0x2b0c72){var _0x17e21b={};_0x17e21b[_0x2b0c72]={'$like':'%'+_0x1483e5[_0x564a('0x31')][_0x564a('0x41')]+'%'};return _0x17e21b;})});}_0x597b9c=_[_0x564a('0x3f')]({},_0x597b9c,_0x1483e5['options']);return _0x15c814[_0x564a('0x4d')](_0x597b9c);}})[_0x564a('0x25')](function(_0x30eef9){if(_0x30eef9){_0x23bb33=_0x30eef9['length'];if(!_0x1483e5[_0x564a('0x31')][_0x564a('0x38')](_0x564a('0x39'))){_0x597b9c['limit']=qs['limit'](_0x1483e5[_0x564a('0x31')][_0x564a('0x3a')]);_0x597b9c[_0x564a('0x20')]=qs['offset'](_0x1483e5[_0x564a('0x31')]['offset']);}return _0x15c814[_0x564a('0x4d')](_0x597b9c);}})[_0x564a('0x25')](function(_0x1dd9cd){if(_0x1dd9cd){return _0x1dd9cd?{'count':_0x23bb33,'rows':_0x1dd9cd}:null;}})[_0x564a('0x25')](respondWithResult(_0x2f4675,null))[_0x564a('0x46')](handleError(_0x2f4675,null));};exports['getSubjects']=function(_0x5eb79c,_0x312dea,_0x5d7826){var _0x4fb228={};var _0x33fd90={};var _0x537619;var _0x2b4455;return db[_0x564a('0x44')][_0x564a('0x4e')]({'where':{'id':_0x5eb79c[_0x564a('0x48')]['id']}})[_0x564a('0x25')](handleEntityNotFound(_0x312dea,null))['then'](function(_0x210304){if(_0x210304){_0x537619=_0x210304;_0x33fd90[_0x564a('0x30')]=_[_0x564a('0x32')](db[_0x564a('0x4f')][_0x564a('0x2c')]);_0x33fd90[_0x564a('0x31')]=_[_0x564a('0x32')](_0x5eb79c[_0x564a('0x31')]);_0x33fd90[_0x564a('0x33')]=_['intersection'](_0x33fd90[_0x564a('0x30')],_0x33fd90[_0x564a('0x31')]);_0x4fb228[_0x564a('0x35')]=_[_0x564a('0x34')](_0x33fd90[_0x564a('0x30')],qs[_0x564a('0x36')](_0x5eb79c[_0x564a('0x31')][_0x564a('0x36')]));_0x4fb228[_0x564a('0x35')]=_0x4fb228[_0x564a('0x35')][_0x564a('0x37')]?_0x4fb228['attributes']:_0x33fd90[_0x564a('0x30')];_0x4fb228[_0x564a('0x3b')]=qs[_0x564a('0x3c')](_0x5eb79c['query'][_0x564a('0x3c')]);_0x4fb228[_0x564a('0x3d')]=qs[_0x564a('0x33')](_['pick'](_0x5eb79c[_0x564a('0x31')],_0x33fd90[_0x564a('0x33')]));if(_0x5eb79c[_0x564a('0x31')][_0x564a('0x41')]){_0x4fb228['where']=_[_0x564a('0x3f')](_0x4fb228[_0x564a('0x3d')],{'$or':_[_0x564a('0x2b')](_0x4fb228[_0x564a('0x35')],function(_0x3a2dff){var _0x4b2b10={};_0x4b2b10[_0x3a2dff]={'$like':'%'+_0x5eb79c[_0x564a('0x31')][_0x564a('0x41')]+'%'};return _0x4b2b10;})});}_0x4fb228=_[_0x564a('0x3f')]({},_0x4fb228,_0x5eb79c[_0x564a('0x42')]);return _0x537619[_0x564a('0x50')](_0x4fb228);}})[_0x564a('0x25')](function(_0x4dcfa2){if(_0x4dcfa2){_0x2b4455=_0x4dcfa2[_0x564a('0x37')];if(!_0x5eb79c[_0x564a('0x31')]['hasOwnProperty'](_0x564a('0x39'))){_0x4fb228[_0x564a('0x3a')]=qs[_0x564a('0x3a')](_0x5eb79c[_0x564a('0x31')][_0x564a('0x3a')]);_0x4fb228[_0x564a('0x20')]=qs[_0x564a('0x20')](_0x5eb79c[_0x564a('0x31')]['offset']);}return _0x537619[_0x564a('0x50')](_0x4fb228);}})[_0x564a('0x25')](function(_0x39f82b){if(_0x39f82b){return _0x39f82b?{'count':_0x2b4455,'rows':_0x39f82b}:null;}})[_0x564a('0x25')](respondWithResult(_0x312dea,null))[_0x564a('0x46')](handleError(_0x312dea,null));};exports[_0x564a('0x51')]=function(_0x25b134,_0x4fd267,_0x14b5ef){var _0x2b22ce={};var _0x4c3819={};var _0x3d2fe2;var _0x4ff2df;return db[_0x564a('0x44')][_0x564a('0x4e')]({'where':{'id':_0x25b134[_0x564a('0x48')]['id']}})[_0x564a('0x25')](handleEntityNotFound(_0x4fd267,null))[_0x564a('0x25')](function(_0x2f8f41){if(_0x2f8f41){_0x3d2fe2=_0x2f8f41;_0x4c3819[_0x564a('0x30')]=_['keys'](db[_0x564a('0x4f')][_0x564a('0x2c')]);_0x4c3819[_0x564a('0x31')]=_[_0x564a('0x32')](_0x25b134[_0x564a('0x31')]);_0x4c3819[_0x564a('0x33')]=_[_0x564a('0x34')](_0x4c3819['model'],_0x4c3819['query']);_0x2b22ce[_0x564a('0x35')]=_[_0x564a('0x34')](_0x4c3819['model'],qs['fields'](_0x25b134[_0x564a('0x31')]['fields']));_0x2b22ce['attributes']=_0x2b22ce[_0x564a('0x35')][_0x564a('0x37')]?_0x2b22ce[_0x564a('0x35')]:_0x4c3819[_0x564a('0x30')];_0x2b22ce[_0x564a('0x3b')]=qs['sort'](_0x25b134['query']['sort']);_0x2b22ce[_0x564a('0x3d')]=qs[_0x564a('0x33')](_['pick'](_0x25b134['query'],_0x4c3819[_0x564a('0x33')]));if(_0x25b134[_0x564a('0x31')][_0x564a('0x41')]){_0x2b22ce[_0x564a('0x3d')]=_[_0x564a('0x3f')](_0x2b22ce[_0x564a('0x3d')],{'$or':_['map'](_0x2b22ce[_0x564a('0x35')],function(_0x3cb3e6){var _0x169641={};_0x169641[_0x3cb3e6]={'$like':'%'+_0x25b134[_0x564a('0x31')][_0x564a('0x41')]+'%'};return _0x169641;})});}_0x2b22ce=_[_0x564a('0x3f')]({},_0x2b22ce,_0x25b134[_0x564a('0x42')]);return _0x3d2fe2[_0x564a('0x51')](_0x2b22ce);}})[_0x564a('0x25')](function(_0x49e4e4){if(_0x49e4e4){_0x4ff2df=_0x49e4e4[_0x564a('0x37')];if(!_0x25b134[_0x564a('0x31')][_0x564a('0x38')](_0x564a('0x39'))){_0x2b22ce[_0x564a('0x3a')]=qs['limit'](_0x25b134[_0x564a('0x31')][_0x564a('0x3a')]);_0x2b22ce[_0x564a('0x20')]=qs[_0x564a('0x20')](_0x25b134[_0x564a('0x31')][_0x564a('0x20')]);}return _0x3d2fe2['getDescriptions'](_0x2b22ce);}})[_0x564a('0x25')](function(_0x577107){if(_0x577107){return _0x577107?{'count':_0x4ff2df,'rows':_0x577107}:null;}})[_0x564a('0x25')](respondWithResult(_0x4fd267,null))[_0x564a('0x46')](handleError(_0x4fd267,null));};exports[_0x564a('0x52')]=function(_0xe2f02d,_0x2c30e4,_0x4fa43c){var _0x10976d={};var _0x4f7b44={};var _0x45958e;var _0x3982ae;return db[_0x564a('0x44')]['findOne']({'where':{'id':_0xe2f02d[_0x564a('0x48')]['id']}})[_0x564a('0x25')](handleEntityNotFound(_0x2c30e4,null))[_0x564a('0x25')](function(_0xc7fd5){if(_0xc7fd5){_0x45958e=_0xc7fd5;_0x4f7b44[_0x564a('0x30')]=_[_0x564a('0x32')](db[_0x564a('0x53')][_0x564a('0x2c')]);_0x4f7b44[_0x564a('0x31')]=_[_0x564a('0x32')](_0xe2f02d[_0x564a('0x31')]);_0x4f7b44[_0x564a('0x33')]=_['intersection'](_0x4f7b44[_0x564a('0x30')],_0x4f7b44['query']);_0x10976d[_0x564a('0x35')]=_[_0x564a('0x34')](_0x4f7b44['model'],qs['fields'](_0xe2f02d['query'][_0x564a('0x36')]));_0x10976d[_0x564a('0x35')]=_0x10976d[_0x564a('0x35')][_0x564a('0x37')]?_0x10976d['attributes']:_0x4f7b44[_0x564a('0x30')];_0x10976d['order']=qs['sort'](_0xe2f02d[_0x564a('0x31')]['sort']);_0x10976d['where']=qs['filters'](_[_0x564a('0x3e')](_0xe2f02d[_0x564a('0x31')],_0x4f7b44[_0x564a('0x33')]));if(_0xe2f02d['query'][_0x564a('0x41')]){_0x10976d[_0x564a('0x3d')]=_[_0x564a('0x3f')](_0x10976d[_0x564a('0x3d')],{'$or':_['map'](_0x10976d[_0x564a('0x35')],function(_0x18a0e0){var _0x1391a0={};_0x1391a0[_0x18a0e0]={'$like':'%'+_0xe2f02d[_0x564a('0x31')]['filter']+'%'};return _0x1391a0;})});}_0x10976d=_[_0x564a('0x3f')]({},_0x10976d,_0xe2f02d[_0x564a('0x42')]);return _0x45958e['getTags'](_0x10976d);}})[_0x564a('0x25')](function(_0x5b8e2a){if(_0x5b8e2a){_0x3982ae=_0x5b8e2a[_0x564a('0x37')];if(!_0xe2f02d[_0x564a('0x31')][_0x564a('0x38')](_0x564a('0x39'))){_0x10976d['limit']=qs[_0x564a('0x3a')](_0xe2f02d['query'][_0x564a('0x3a')]);_0x10976d['offset']=qs['offset'](_0xe2f02d[_0x564a('0x31')][_0x564a('0x20')]);}return _0x45958e[_0x564a('0x52')](_0x10976d);}})[_0x564a('0x25')](function(_0x524f3f){if(_0x524f3f){return _0x524f3f?{'count':_0x3982ae,'rows':_0x524f3f}:null;}})['then'](respondWithResult(_0x2c30e4,null))[_0x564a('0x46')](handleError(_0x2c30e4,null));};exports[_0x564a('0x54')]=function(_0x39590c,_0x3fcb39,_0x30a37a){if(_0x39590c[_0x564a('0x4c')]['id']){delete _0x39590c[_0x564a('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0x564a('0x4e')]({'where':{'id':_0x39590c[_0x564a('0x48')]['id']}})['then'](handleEntityNotFound(_0x3fcb39,null))[_0x564a('0x25')](function(_0x493d88){if(_0x493d88){return _0x493d88[_0x564a('0x54')](_0x39590c[_0x564a('0x4c')][_0x564a('0x55')]||[]);}return null;})[_0x564a('0x25')](respondWithResult(_0x3fcb39,null))[_0x564a('0x46')](handleError(_0x3fcb39,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8875945..3dabaac 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 _0xd63f=['api','moment','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','util'];(function(_0x6412f4,_0xf690c){var _0x5db899=function(_0xa0051b){while(--_0xa0051b){_0x6412f4['push'](_0x6412f4['shift']());}};_0x5db899(++_0xf690c);}(_0xd63f,0x1e5));var _0xfd63=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd63f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xfd63('0x0'));var logger=require('../../config/logger')(_0xfd63('0x1'));var moment=require(_0xfd63('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd63('0x3'));var rimraf=require(_0xfd63('0x4'));var config=require(_0xfd63('0x5'));var attributes=require(_0xfd63('0x6'));module['exports']=function(_0x495629,_0x284b77){return _0x495629[_0xfd63('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0xfd63('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2801=['./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','util','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0x2801,0x17e));var _0x1280=function(_0x28ddd4,_0x4bb1da){_0x28ddd4=_0x28ddd4-0x0;var _0xa8b8e0=_0x2801[_0x28ddd4];return _0xa8b8e0;};'use strict';var _=require('lodash');var util=require(_0x1280('0x0'));var logger=require(_0x1280('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1280('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1280('0x3'));var config=require(_0x1280('0x4'));var attributes=require(_0x1280('0x5'));module[_0x1280('0x6')]=function(_0x142eca,_0x98f04b){return _0x142eca[_0x1280('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0x1280('0x8'),'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 96a208b..f2d9973 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 _0x5c12=['info','debug','request\x20sent','error','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x35128d,_0x97dfc3){var _0x20adf7=function(_0x30010e){while(--_0x30010e){_0x35128d['push'](_0x35128d['shift']());}};_0x20adf7(++_0x97dfc3);}(_0x5c12,0xf7));var _0x25c1=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x5c12[_0x440917];return _0x5e906b;};'use strict';var _=require(_0x25c1('0x0'));var util=require('util');var moment=require(_0x25c1('0x1'));var BPromise=require(_0x25c1('0x2'));var rs=require(_0x25c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x25c1('0x4'))(_0x25c1('0x5'));var config=require('../../config/environment');var jayson=require(_0x25c1('0x6'));var client=jayson['client'][_0x25c1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25f82f,_0x356d94,_0x25a507){return new BPromise(function(_0x2e0c74,_0x6e05b3){return client[_0x25c1('0x8')](_0x25f82f,_0x25a507)['then'](function(_0x1b9f15){logger[_0x25c1('0x9')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x356d94,'request\x20sent');logger[_0x25c1('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x356d94,_0x25c1('0xb'),JSON['stringify'](_0x1b9f15));if(_0x1b9f15['error']){if(_0x1b9f15['error']['code']===0x1f4){logger[_0x25c1('0xc')](_0x25c1('0xd'),_0x356d94,_0x1b9f15[_0x25c1('0xc')]['message']);return _0x6e05b3(_0x1b9f15[_0x25c1('0xc')][_0x25c1('0xe')]);}logger[_0x25c1('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x356d94,_0x1b9f15[_0x25c1('0xc')][_0x25c1('0xe')]);return _0x2e0c74(_0x1b9f15['error'][_0x25c1('0xe')]);}else{logger[_0x25c1('0x9')](_0x25c1('0xd'),_0x356d94,_0x25c1('0xb'));_0x2e0c74(_0x1b9f15['result'][_0x25c1('0xe')]);}})[_0x25c1('0xf')](function(_0x8e6df7){logger['error'](_0x25c1('0xd'),_0x356d94,_0x8e6df7);_0x6e05b3(_0x8e6df7);});});} \ No newline at end of file +var _0x3890=['client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x416468,_0x2e7a72){var _0x2ee9b7=function(_0xf354ce){while(--_0xf354ce){_0x416468['push'](_0x416468['shift']());}};_0x2ee9b7(++_0x2e7a72);}(_0x3890,0x77));var _0x0389=function(_0x400ea6,_0x34e337){_0x400ea6=_0x400ea6-0x0;var _0x5910a4=_0x3890[_0x400ea6];return _0x5910a4;};'use strict';var _=require(_0x0389('0x0'));var util=require(_0x0389('0x1'));var moment=require(_0x0389('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0389('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0389('0x4'));var logger=require('../../config/logger')(_0x0389('0x5'));var config=require(_0x0389('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0389('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55f673,_0x304f93,_0x18cec6){return new BPromise(function(_0x2a1f53,_0x213a65){return client[_0x0389('0x8')](_0x55f673,_0x18cec6)[_0x0389('0x9')](function(_0x17ec1d){logger[_0x0389('0xa')](_0x0389('0xb'),_0x304f93,_0x0389('0xc'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x304f93,_0x0389('0xc'),JSON[_0x0389('0xd')](_0x17ec1d));if(_0x17ec1d[_0x0389('0xe')]){if(_0x17ec1d[_0x0389('0xe')][_0x0389('0xf')]===0x1f4){logger[_0x0389('0xe')](_0x0389('0xb'),_0x304f93,_0x17ec1d[_0x0389('0xe')][_0x0389('0x10')]);return _0x213a65(_0x17ec1d['error'][_0x0389('0x10')]);}logger[_0x0389('0xe')](_0x0389('0xb'),_0x304f93,_0x17ec1d['error'][_0x0389('0x10')]);return _0x2a1f53(_0x17ec1d['error'][_0x0389('0x10')]);}else{logger['info'](_0x0389('0xb'),_0x304f93,'request\x20sent');_0x2a1f53(_0x17ec1d[_0x0389('0x11')][_0x0389('0x10')]);}})['catch'](function(_0x31ca83){logger['error'](_0x0389('0xb'),_0x304f93,_0x31ca83);_0x213a65(_0x31ca83);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index fe7d397..b97078d 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 _0x324c=['put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','index','/:id','isAuthenticated','show','post','create'];(function(_0x594bfa,_0x5bfdca){var _0x429ab1=function(_0x3f94a6){while(--_0x3f94a6){_0x594bfa['push'](_0x594bfa['shift']());}};_0x429ab1(++_0x5bfdca);}(_0x324c,0x190));var _0xc324=function(_0x1dc458,_0xaa5925){_0x1dc458=_0x1dc458-0x0;var _0x2e2fa2=_0x324c[_0x1dc458];return _0x2e2fa2;};'use strict';var multer=require('multer');var util=require(_0xc324('0x0'));var path=require(_0xc324('0x1'));var timeout=require(_0xc324('0x2'));var express=require('express');var router=express[_0xc324('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc324('0x4'));var interaction=require(_0xc324('0x5'));var config=require(_0xc324('0x6'));var controller=require(_0xc324('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc324('0x8')]);router['get'](_0xc324('0x9'),auth[_0xc324('0xa')](),controller[_0xc324('0xb')]);router[_0xc324('0xc')]('/',auth[_0xc324('0xa')](),controller[_0xc324('0xd')]);router[_0xc324('0xe')](_0xc324('0x9'),auth[_0xc324('0xa')](),controller[_0xc324('0xf')]);router['delete'](_0xc324('0x9'),auth[_0xc324('0xa')](),controller[_0xc324('0x10')]);module[_0xc324('0x11')]=router; \ No newline at end of file +var _0x09e6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x09e6,0x1e4));var _0x609e=function(_0x2d1e84,_0x134e6a){_0x2d1e84=_0x2d1e84-0x0;var _0x54549e=_0x09e6[_0x2d1e84];return _0x54549e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x609e('0x0'));var timeout=require('connect-timeout');var express=require(_0x609e('0x1'));var router=express[_0x609e('0x2')]();var fs_extra=require(_0x609e('0x3'));var auth=require(_0x609e('0x4'));var interaction=require(_0x609e('0x5'));var config=require(_0x609e('0x6'));var controller=require(_0x609e('0x7'));router[_0x609e('0x8')]('/',auth[_0x609e('0x9')](),controller[_0x609e('0xa')]);router[_0x609e('0x8')](_0x609e('0xb'),auth['isAuthenticated'](),controller[_0x609e('0xc')]);router['post']('/',auth[_0x609e('0x9')](),controller[_0x609e('0xd')]);router[_0x609e('0xe')](_0x609e('0xb'),auth[_0x609e('0x9')](),controller['update']);router[_0x609e('0xf')](_0x609e('0xb'),auth['isAuthenticated'](),controller[_0x609e('0x10')]);module[_0x609e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 2ab8a23..924e142 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 _0x0d0f=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x30c119,_0xfdf9b5){var _0x1babfa=function(_0x33e672){while(--_0x33e672){_0x30c119['push'](_0x30c119['shift']());}};_0x1babfa(++_0xfdf9b5);}(_0x0d0f,0x160));var _0xf0d0=function(_0x2134fa,_0x42a1dd){_0x2134fa=_0x2134fa-0x0;var _0x4a7d4f=_0x0d0f[_0x2134fa];return _0x4a7d4f;};'use strict';var Sequelize=require(_0xf0d0('0x0'));module[_0xf0d0('0x1')]={'type':{'type':Sequelize[_0xf0d0('0x2')](_0xf0d0('0x3'),_0xf0d0('0x4'),_0xf0d0('0x5'),_0xf0d0('0x6'),_0xf0d0('0x7')),'defaultValue':_0xf0d0('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf0d0('0x8')]},'keyType':{'type':Sequelize[_0xf0d0('0x2')]('string',_0xf0d0('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf0d0('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf0d0('0x8')]},'customField':{'type':Sequelize[_0xf0d0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf0d0('0x8')]}}; \ No newline at end of file +var _0x36b0=['customVariable','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x4b63e6,_0xe8815b){var _0x55e30d=function(_0x287b27){while(--_0x287b27){_0x4b63e6['push'](_0x4b63e6['shift']());}};_0x55e30d(++_0xe8815b);}(_0x36b0,0x1db));var _0x036b=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x36b0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x036b('0x0'));module[_0x036b('0x1')]={'type':{'type':Sequelize[_0x036b('0x2')](_0x036b('0x3'),_0x036b('0x4'),_0x036b('0x5'),'keyValue',_0x036b('0x6')),'defaultValue':_0x036b('0x3')},'content':{'type':Sequelize[_0x036b('0x7')]},'key':{'type':Sequelize[_0x036b('0x7')]},'keyType':{'type':Sequelize[_0x036b('0x2')]('string',_0x036b('0x4'),_0x036b('0x5'))},'keyContent':{'type':Sequelize[_0x036b('0x7')]},'idField':{'type':Sequelize[_0x036b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x036b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 381002b..3ac1dc0 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 _0xd3d1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x30f931,_0x5d57ac){var _0x2bbf19=function(_0x19f862){while(--_0x19f862){_0x30f931['push'](_0x30f931['shift']());}};_0x2bbf19(++_0x5d57ac);}(_0xd3d1,0x172));var _0x1d3d=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xd3d1[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x1d3d('0x0'));var rimraf=require(_0x1d3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1d3d('0x2'));var moment=require(_0x1d3d('0x3'));var BPromise=require(_0x1d3d('0x4'));var Mustache=require(_0x1d3d('0x5'));var util=require(_0x1d3d('0x6'));var path=require(_0x1d3d('0x7'));var sox=require(_0x1d3d('0x8'));var csv=require(_0x1d3d('0x9'));var ejs=require(_0x1d3d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d3d('0xb'));var _=require(_0x1d3d('0xc'));var squel=require(_0x1d3d('0xd'));var crypto=require(_0x1d3d('0xe'));var jsforce=require(_0x1d3d('0xf'));var deskjs=require(_0x1d3d('0x10'));var toCsv=require(_0x1d3d('0x9'));var querystring=require(_0x1d3d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d3d('0x12'));var authService=require(_0x1d3d('0x13'));var qs=require(_0x1d3d('0x14'));var as=require(_0x1d3d('0x15'));var hardwareService=require(_0x1d3d('0x16'));var logger=require(_0x1d3d('0x17'))(_0x1d3d('0x18'));var utils=require(_0x1d3d('0x19'));var config=require(_0x1d3d('0x1a'));var licenseUtil=require(_0x1d3d('0x1b'));var db=require(_0x1d3d('0x1c'))['db'];function respondWithStatusCode(_0x479216,_0xb587d){_0xb587d=_0xb587d||0xcc;return function(_0x2e375f){if(_0x2e375f){return _0x479216['sendStatus'](_0xb587d);}return _0x479216['status'](_0xb587d)[_0x1d3d('0x1d')]();};}function respondWithResult(_0x2f5b7f,_0x1a8035){_0x1a8035=_0x1a8035||0xc8;return function(_0x59b907){if(_0x59b907){return _0x2f5b7f[_0x1d3d('0x1e')](_0x1a8035)['json'](_0x59b907);}};}function respondWithFilteredResult(_0x1d54f3,_0x33e7d9){return function(_0x3491e4){if(_0x3491e4){var _0x24bb8c=typeof _0x33e7d9[_0x1d3d('0x1f')]===_0x1d3d('0x20')&&typeof _0x33e7d9[_0x1d3d('0x21')]==='undefined';var _0x5d3ac9=_0x3491e4[_0x1d3d('0x22')];var _0xe0a583=_0x24bb8c?0x0:_0x33e7d9['offset'];var _0x3b9174=_0x24bb8c?_0x3491e4['count']:_0x33e7d9[_0x1d3d('0x1f')]+_0x33e7d9[_0x1d3d('0x21')];var _0x2cd430;if(_0x3b9174>=_0x5d3ac9){_0x3b9174=_0x5d3ac9;_0x2cd430=0xc8;}else{_0x2cd430=0xce;}_0x1d54f3[_0x1d3d('0x1e')](_0x2cd430);return _0x1d54f3['set'](_0x1d3d('0x23'),_0xe0a583+'-'+_0x3b9174+'/'+_0x5d3ac9)['json'](_0x3491e4);}return null;};}function patchUpdates(_0x56c424){return function(_0x108005){try{jsonpatch[_0x1d3d('0x24')](_0x108005,_0x56c424,!![]);}catch(_0x43b14b){return BPromise[_0x1d3d('0x25')](_0x43b14b);}return _0x108005[_0x1d3d('0x26')]();};}function saveUpdates(_0xe4afa2,_0x471df5){return function(_0xa55c43){if(_0xa55c43){return _0xa55c43[_0x1d3d('0x27')](_0xe4afa2)[_0x1d3d('0x28')](function(_0x1610a6){return _0x1610a6;});}return null;};}function removeEntity(_0x502921,_0xfc3606){return function(_0x72868d){if(_0x72868d){return _0x72868d['destroy']()[_0x1d3d('0x28')](function(){_0x502921['status'](0xcc)[_0x1d3d('0x1d')]();});}};}function handleEntityNotFound(_0x20ae6d,_0x2bd023){return function(_0x4235fd){if(!_0x4235fd){_0x20ae6d[_0x1d3d('0x29')](0x194);}return _0x4235fd;};}function handleError(_0x16d032,_0x2b8074){_0x2b8074=_0x2b8074||0x1f4;return function(_0x298fd3){logger[_0x1d3d('0x2a')](_0x298fd3[_0x1d3d('0x2b')]);if(_0x298fd3[_0x1d3d('0x2c')]){delete _0x298fd3['name'];}_0x16d032[_0x1d3d('0x1e')](_0x2b8074)['send'](_0x298fd3);};}exports[_0x1d3d('0x2d')]=function(_0x2bcc2,_0x55c935){var _0x185913={},_0x16b7b3={},_0x3cb011={'count':0x0,'rows':[]};var _0x2a3812=_['map'](db[_0x1d3d('0x2e')][_0x1d3d('0x2f')],function(_0x5d1b6c){return{'name':_0x5d1b6c[_0x1d3d('0x30')],'type':_0x5d1b6c['type'][_0x1d3d('0x31')]};});_0x16b7b3[_0x1d3d('0x32')]=_['map'](_0x2a3812,_0x1d3d('0x2c'));_0x16b7b3[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x2bcc2[_0x1d3d('0x33')]);_0x16b7b3[_0x1d3d('0x35')]=_[_0x1d3d('0x36')](_0x16b7b3[_0x1d3d('0x32')],_0x16b7b3[_0x1d3d('0x33')]);_0x185913[_0x1d3d('0x37')]=_['intersection'](_0x16b7b3[_0x1d3d('0x32')],qs[_0x1d3d('0x38')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x38')]));_0x185913['attributes']=_0x185913['attributes'][_0x1d3d('0x39')]?_0x185913[_0x1d3d('0x37')]:_0x16b7b3['model'];if(!_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x3a')](_0x1d3d('0x3b'))){_0x185913[_0x1d3d('0x21')]=qs['limit'](_0x2bcc2['query'][_0x1d3d('0x21')]);_0x185913['offset']=qs[_0x1d3d('0x1f')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x1f')]);}_0x185913[_0x1d3d('0x3c')]=qs[_0x1d3d('0x3d')](_0x2bcc2[_0x1d3d('0x33')][_0x1d3d('0x3d')]);_0x185913[_0x1d3d('0x3e')]=qs['filters'](_[_0x1d3d('0x3f')](_0x2bcc2['query'],_0x16b7b3[_0x1d3d('0x35')]),_0x2a3812);if(_0x2bcc2[_0x1d3d('0x33')]['filter']){_0x185913[_0x1d3d('0x3e')]=_[_0x1d3d('0x40')](_0x185913[_0x1d3d('0x3e')],{'$or':_[_0x1d3d('0x41')](_0x2a3812,function(_0x5c53c3){if(_0x5c53c3['type']!==_0x1d3d('0x42')){var _0x59502c={};_0x59502c[_0x5c53c3[_0x1d3d('0x2c')]]={'$like':'%'+_0x2bcc2[_0x1d3d('0x33')]['filter']+'%'};return _0x59502c;}})});}_0x185913=_[_0x1d3d('0x40')]({},_0x185913,_0x2bcc2[_0x1d3d('0x43')]);var _0x51be79={'where':_0x185913[_0x1d3d('0x3e')]};return db[_0x1d3d('0x2e')][_0x1d3d('0x22')](_0x51be79)[_0x1d3d('0x28')](function(_0x1fec46){_0x3cb011[_0x1d3d('0x22')]=_0x1fec46;if(_0x2bcc2['query'][_0x1d3d('0x44')]){_0x185913[_0x1d3d('0x45')]=[{'all':!![]}];}return db[_0x1d3d('0x2e')][_0x1d3d('0x46')](_0x185913);})[_0x1d3d('0x28')](function(_0x5f007e){_0x3cb011[_0x1d3d('0x47')]=_0x5f007e;return _0x3cb011;})[_0x1d3d('0x28')](respondWithFilteredResult(_0x55c935,_0x185913))[_0x1d3d('0x48')](handleError(_0x55c935,null));};exports[_0x1d3d('0x49')]=function(_0x5d0ab0,_0x3d1c0c){var _0x977ea8={'raw':!![],'where':{'id':_0x5d0ab0[_0x1d3d('0x4a')]['id']}},_0x1597fa={};_0x1597fa[_0x1d3d('0x32')]=_['keys'](db['FreshdeskField'][_0x1d3d('0x2f')]);_0x1597fa[_0x1d3d('0x33')]=_[_0x1d3d('0x34')](_0x5d0ab0[_0x1d3d('0x33')]);_0x1597fa[_0x1d3d('0x35')]=_['intersection'](_0x1597fa[_0x1d3d('0x32')],_0x1597fa['query']);_0x977ea8[_0x1d3d('0x37')]=_[_0x1d3d('0x36')](_0x1597fa[_0x1d3d('0x32')],qs[_0x1d3d('0x38')](_0x5d0ab0['query'][_0x1d3d('0x38')]));_0x977ea8[_0x1d3d('0x37')]=_0x977ea8[_0x1d3d('0x37')][_0x1d3d('0x39')]?_0x977ea8[_0x1d3d('0x37')]:_0x1597fa[_0x1d3d('0x32')];if(_0x5d0ab0[_0x1d3d('0x33')]['includeAll']){_0x977ea8[_0x1d3d('0x45')]=[{'all':!![]}];}_0x977ea8=_['merge']({},_0x977ea8,_0x5d0ab0[_0x1d3d('0x43')]);return db[_0x1d3d('0x2e')]['find'](_0x977ea8)[_0x1d3d('0x28')](handleEntityNotFound(_0x3d1c0c,null))['then'](respondWithResult(_0x3d1c0c,null))[_0x1d3d('0x48')](handleError(_0x3d1c0c,null));};exports['create']=function(_0x17eded,_0xebd1f4){return db[_0x1d3d('0x2e')][_0x1d3d('0x4b')](_0x17eded[_0x1d3d('0x4c')],{})[_0x1d3d('0x28')](respondWithResult(_0xebd1f4,0xc9))[_0x1d3d('0x48')](handleError(_0xebd1f4,null));};exports[_0x1d3d('0x27')]=function(_0x59e88a,_0x5899cc){if(_0x59e88a['body']['id']){delete _0x59e88a[_0x1d3d('0x4c')]['id'];}return db[_0x1d3d('0x2e')][_0x1d3d('0x4d')]({'where':{'id':_0x59e88a[_0x1d3d('0x4a')]['id']}})[_0x1d3d('0x28')](handleEntityNotFound(_0x5899cc,null))[_0x1d3d('0x28')](saveUpdates(_0x59e88a['body'],null))['then'](respondWithResult(_0x5899cc,null))['catch'](handleError(_0x5899cc,null));};exports['destroy']=function(_0x3dc5ca,_0x21620d){return db[_0x1d3d('0x2e')][_0x1d3d('0x4d')]({'where':{'id':_0x3dc5ca[_0x1d3d('0x4a')]['id']}})[_0x1d3d('0x28')](handleEntityNotFound(_0x21620d,null))[_0x1d3d('0x28')](removeEntity(_0x21620d,null))[_0x1d3d('0x48')](handleError(_0x21620d,null));}; \ No newline at end of file +var _0xe812=['json','offset','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','update','find','destroy','catch','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe812,0x1f2));var _0x2e81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe812[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e81('0x0'));var zipdir=require(_0x2e81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e81('0x2'));var BPromise=require(_0x2e81('0x3'));var Mustache=require('mustache');var util=require(_0x2e81('0x4'));var path=require(_0x2e81('0x5'));var sox=require('sox');var csv=require(_0x2e81('0x6'));var ejs=require(_0x2e81('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e81('0x8'));var squel=require(_0x2e81('0x9'));var crypto=require(_0x2e81('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2e81('0xb'));var toCsv=require(_0x2e81('0x6'));var querystring=require(_0x2e81('0xc'));var Papa=require(_0x2e81('0xd'));var Redis=require('ioredis');var authService=require(_0x2e81('0xe'));var qs=require(_0x2e81('0xf'));var as=require(_0x2e81('0x10'));var hardwareService=require(_0x2e81('0x11'));var logger=require(_0x2e81('0x12'))(_0x2e81('0x13'));var utils=require(_0x2e81('0x14'));var config=require(_0x2e81('0x15'));var licenseUtil=require(_0x2e81('0x16'));var db=require(_0x2e81('0x17'))['db'];function respondWithStatusCode(_0x4284f3,_0x5c58a2){_0x5c58a2=_0x5c58a2||0xcc;return function(_0x30a730){if(_0x30a730){return _0x4284f3[_0x2e81('0x18')](_0x5c58a2);}return _0x4284f3['status'](_0x5c58a2)[_0x2e81('0x19')]();};}function respondWithResult(_0x5598a9,_0x2a4411){_0x2a4411=_0x2a4411||0xc8;return function(_0x2b24f0){if(_0x2b24f0){return _0x5598a9[_0x2e81('0x1a')](_0x2a4411)[_0x2e81('0x1b')](_0x2b24f0);}};}function respondWithFilteredResult(_0x1bb937,_0x3a8c05){return function(_0x53da62){if(_0x53da62){var _0xc4d315=typeof _0x3a8c05[_0x2e81('0x1c')]==='undefined'&&typeof _0x3a8c05[_0x2e81('0x1d')]==='undefined';var _0x2cc0c6=_0x53da62[_0x2e81('0x1e')];var _0x4c1b11=_0xc4d315?0x0:_0x3a8c05[_0x2e81('0x1c')];var _0x2bb9b6=_0xc4d315?_0x53da62[_0x2e81('0x1e')]:_0x3a8c05[_0x2e81('0x1c')]+_0x3a8c05[_0x2e81('0x1d')];var _0x1f20bf;if(_0x2bb9b6>=_0x2cc0c6){_0x2bb9b6=_0x2cc0c6;_0x1f20bf=0xc8;}else{_0x1f20bf=0xce;}_0x1bb937[_0x2e81('0x1a')](_0x1f20bf);return _0x1bb937[_0x2e81('0x1f')](_0x2e81('0x20'),_0x4c1b11+'-'+_0x2bb9b6+'/'+_0x2cc0c6)[_0x2e81('0x1b')](_0x53da62);}return null;};}function patchUpdates(_0x524694){return function(_0x10b77e){try{jsonpatch[_0x2e81('0x21')](_0x10b77e,_0x524694,!![]);}catch(_0x9ddf6b){return BPromise[_0x2e81('0x22')](_0x9ddf6b);}return _0x10b77e[_0x2e81('0x23')]();};}function saveUpdates(_0x386721,_0x18b9be){return function(_0x39ffa8){if(_0x39ffa8){return _0x39ffa8['update'](_0x386721)[_0x2e81('0x24')](function(_0x49e9f1){return _0x49e9f1;});}return null;};}function removeEntity(_0x2d50af,_0x4fe130){return function(_0x1d09cb){if(_0x1d09cb){return _0x1d09cb['destroy']()['then'](function(){_0x2d50af[_0x2e81('0x1a')](0xcc)[_0x2e81('0x19')]();});}};}function handleEntityNotFound(_0x4a75ff,_0x39e8c0){return function(_0x19b1a9){if(!_0x19b1a9){_0x4a75ff[_0x2e81('0x18')](0x194);}return _0x19b1a9;};}function handleError(_0x2d2fac,_0x2b66f9){_0x2b66f9=_0x2b66f9||0x1f4;return function(_0x3d13fc){logger[_0x2e81('0x25')](_0x3d13fc[_0x2e81('0x26')]);if(_0x3d13fc[_0x2e81('0x27')]){delete _0x3d13fc[_0x2e81('0x27')];}_0x2d2fac[_0x2e81('0x1a')](_0x2b66f9)[_0x2e81('0x28')](_0x3d13fc);};}exports[_0x2e81('0x29')]=function(_0x3ec91d,_0x4d195d){var _0x4e9aa5={},_0xfc7ce3={},_0x38cbc2={'count':0x0,'rows':[]};var _0x20ef21=_[_0x2e81('0x2a')](db[_0x2e81('0x2b')][_0x2e81('0x2c')],function(_0x243b20){return{'name':_0x243b20[_0x2e81('0x2d')],'type':_0x243b20[_0x2e81('0x2e')][_0x2e81('0x2f')]};});_0xfc7ce3[_0x2e81('0x30')]=_['map'](_0x20ef21,_0x2e81('0x27'));_0xfc7ce3[_0x2e81('0x31')]=_[_0x2e81('0x32')](_0x3ec91d[_0x2e81('0x31')]);_0xfc7ce3[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0xfc7ce3[_0x2e81('0x30')],_0xfc7ce3[_0x2e81('0x31')]);_0x4e9aa5[_0x2e81('0x35')]=_[_0x2e81('0x34')](_0xfc7ce3[_0x2e81('0x30')],qs[_0x2e81('0x36')](_0x3ec91d[_0x2e81('0x31')][_0x2e81('0x36')]));_0x4e9aa5[_0x2e81('0x35')]=_0x4e9aa5[_0x2e81('0x35')][_0x2e81('0x37')]?_0x4e9aa5['attributes']:_0xfc7ce3[_0x2e81('0x30')];if(!_0x3ec91d[_0x2e81('0x31')]['hasOwnProperty'](_0x2e81('0x38'))){_0x4e9aa5[_0x2e81('0x1d')]=qs['limit'](_0x3ec91d[_0x2e81('0x31')][_0x2e81('0x1d')]);_0x4e9aa5[_0x2e81('0x1c')]=qs['offset'](_0x3ec91d[_0x2e81('0x31')][_0x2e81('0x1c')]);}_0x4e9aa5[_0x2e81('0x39')]=qs[_0x2e81('0x3a')](_0x3ec91d[_0x2e81('0x31')]['sort']);_0x4e9aa5['where']=qs['filters'](_['pick'](_0x3ec91d[_0x2e81('0x31')],_0xfc7ce3['filters']),_0x20ef21);if(_0x3ec91d['query'][_0x2e81('0x3b')]){_0x4e9aa5[_0x2e81('0x3c')]=_[_0x2e81('0x3d')](_0x4e9aa5['where'],{'$or':_[_0x2e81('0x2a')](_0x20ef21,function(_0x21b596){if(_0x21b596[_0x2e81('0x2e')]!==_0x2e81('0x3e')){var _0x396eef={};_0x396eef[_0x21b596['name']]={'$like':'%'+_0x3ec91d['query'][_0x2e81('0x3b')]+'%'};return _0x396eef;}})});}_0x4e9aa5=_[_0x2e81('0x3d')]({},_0x4e9aa5,_0x3ec91d[_0x2e81('0x3f')]);var _0x58aab2={'where':_0x4e9aa5[_0x2e81('0x3c')]};return db[_0x2e81('0x2b')][_0x2e81('0x1e')](_0x58aab2)['then'](function(_0x237ac4){_0x38cbc2[_0x2e81('0x1e')]=_0x237ac4;if(_0x3ec91d[_0x2e81('0x31')][_0x2e81('0x40')]){_0x4e9aa5[_0x2e81('0x41')]=[{'all':!![]}];}return db[_0x2e81('0x2b')][_0x2e81('0x42')](_0x4e9aa5);})[_0x2e81('0x24')](function(_0x5508f0){_0x38cbc2['rows']=_0x5508f0;return _0x38cbc2;})[_0x2e81('0x24')](respondWithFilteredResult(_0x4d195d,_0x4e9aa5))['catch'](handleError(_0x4d195d,null));};exports[_0x2e81('0x43')]=function(_0x9f5f03,_0xf3d7a5){var _0x42154f={'raw':!![],'where':{'id':_0x9f5f03[_0x2e81('0x44')]['id']}},_0x3c5fbb={};_0x3c5fbb['model']=_['keys'](db[_0x2e81('0x2b')][_0x2e81('0x2c')]);_0x3c5fbb[_0x2e81('0x31')]=_['keys'](_0x9f5f03[_0x2e81('0x31')]);_0x3c5fbb[_0x2e81('0x33')]=_['intersection'](_0x3c5fbb[_0x2e81('0x30')],_0x3c5fbb['query']);_0x42154f[_0x2e81('0x35')]=_[_0x2e81('0x34')](_0x3c5fbb[_0x2e81('0x30')],qs[_0x2e81('0x36')](_0x9f5f03['query'][_0x2e81('0x36')]));_0x42154f['attributes']=_0x42154f[_0x2e81('0x35')][_0x2e81('0x37')]?_0x42154f['attributes']:_0x3c5fbb[_0x2e81('0x30')];if(_0x9f5f03[_0x2e81('0x31')][_0x2e81('0x40')]){_0x42154f[_0x2e81('0x41')]=[{'all':!![]}];}_0x42154f=_[_0x2e81('0x3d')]({},_0x42154f,_0x9f5f03[_0x2e81('0x3f')]);return db[_0x2e81('0x2b')]['find'](_0x42154f)[_0x2e81('0x24')](handleEntityNotFound(_0xf3d7a5,null))['then'](respondWithResult(_0xf3d7a5,null))['catch'](handleError(_0xf3d7a5,null));};exports[_0x2e81('0x45')]=function(_0x5bd250,_0x551ad0){return db[_0x2e81('0x2b')][_0x2e81('0x45')](_0x5bd250[_0x2e81('0x46')],{})['then'](respondWithResult(_0x551ad0,0xc9))['catch'](handleError(_0x551ad0,null));};exports[_0x2e81('0x47')]=function(_0x1dd4d7,_0x16ed11){if(_0x1dd4d7[_0x2e81('0x46')]['id']){delete _0x1dd4d7['body']['id'];}return db['FreshdeskField'][_0x2e81('0x48')]({'where':{'id':_0x1dd4d7[_0x2e81('0x44')]['id']}})['then'](handleEntityNotFound(_0x16ed11,null))['then'](saveUpdates(_0x1dd4d7[_0x2e81('0x46')],null))[_0x2e81('0x24')](respondWithResult(_0x16ed11,null))['catch'](handleError(_0x16ed11,null));};exports[_0x2e81('0x49')]=function(_0x33a4d7,_0x25b243){return db[_0x2e81('0x2b')][_0x2e81('0x48')]({'where':{'id':_0x33a4d7['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x25b243,null))[_0x2e81('0x24')](removeEntity(_0x25b243,null))[_0x2e81('0x4a')](handleError(_0x25b243,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 9d689d9..a6da258 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 _0xaae2=['FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xaae2,0x1a8));var _0x2aae=function(_0x48d467,_0x442bd8){_0x48d467=_0x48d467-0x0;var _0x227c4d=_0xaae2[_0x48d467];return _0x227c4d;};'use strict';var _=require(_0x2aae('0x0'));var util=require(_0x2aae('0x1'));var logger=require(_0x2aae('0x2'))('api');var moment=require(_0x2aae('0x3'));var BPromise=require(_0x2aae('0x4'));var rp=require(_0x2aae('0x5'));var fs=require('fs');var path=require(_0x2aae('0x6'));var rimraf=require('rimraf');var config=require(_0x2aae('0x7'));var attributes=require(_0x2aae('0x8'));module[_0x2aae('0x9')]=function(_0x112157,_0x5d11cd){return _0x112157['define'](_0x2aae('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x2aae('0xb'),'fields':[_0x2aae('0xc'),_0x2aae('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3280=['path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x161171,_0x2aaa5c){var _0x3c5aef=function(_0x3b2b0a){while(--_0x3b2b0a){_0x161171['push'](_0x161171['shift']());}};_0x3c5aef(++_0x2aaa5c);}(_0x3280,0x17a));var _0x0328=function(_0x11a434,_0x32f384){_0x11a434=_0x11a434-0x0;var _0x51750c=_0x3280[_0x11a434];return _0x51750c;};'use strict';var _=require('lodash');var util=require(_0x0328('0x0'));var logger=require(_0x0328('0x1'))(_0x0328('0x2'));var moment=require(_0x0328('0x3'));var BPromise=require(_0x0328('0x4'));var rp=require(_0x0328('0x5'));var fs=require('fs');var path=require(_0x0328('0x6'));var rimraf=require(_0x0328('0x7'));var config=require('../../config/environment');var attributes=require(_0x0328('0x8'));module[_0x0328('0x9')]=function(_0x47701f,_0x1cca1b){return _0x47701f[_0x0328('0xa')](_0x0328('0xb'),attributes,{'tableName':_0x0328('0xc'),'paranoid':![],'indexes':[{'name':_0x0328('0xd'),'fields':[_0x0328('0xe'),_0x0328('0xf')],'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 17d4b1c..16fdbcb 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 _0x38a8=['http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3fcb63,_0x3a6d84){var _0x181d5f=function(_0x6d5fbd){while(--_0x6d5fbd){_0x3fcb63['push'](_0x3fcb63['shift']());}};_0x181d5f(++_0x3a6d84);}(_0x38a8,0x1a4));var _0x838a=function(_0x5480e5,_0x52e354){_0x5480e5=_0x5480e5-0x0;var _0x20b7cc=_0x38a8[_0x5480e5];return _0x20b7cc;};'use strict';var _=require(_0x838a('0x0'));var util=require(_0x838a('0x1'));var moment=require(_0x838a('0x2'));var BPromise=require(_0x838a('0x3'));var rs=require(_0x838a('0x4'));var fs=require('fs');var Redis=require(_0x838a('0x5'));var db=require(_0x838a('0x6'))['db'];var utils=require(_0x838a('0x7'));var logger=require(_0x838a('0x8'))(_0x838a('0x9'));var config=require(_0x838a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x838a('0xb')][_0x838a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48fbb1,_0x916ffb,_0x45bc27){return new BPromise(function(_0x137559,_0x4ee42e){return client['request'](_0x48fbb1,_0x45bc27)[_0x838a('0xd')](function(_0x35dbd3){logger[_0x838a('0xe')](_0x838a('0xf'),_0x916ffb,_0x838a('0x10'));logger[_0x838a('0x11')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x916ffb,_0x838a('0x10'),JSON[_0x838a('0x12')](_0x35dbd3));if(_0x35dbd3[_0x838a('0x13')]){if(_0x35dbd3[_0x838a('0x13')][_0x838a('0x14')]===0x1f4){logger[_0x838a('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x916ffb,_0x35dbd3[_0x838a('0x13')][_0x838a('0x15')]);return _0x4ee42e(_0x35dbd3['error'][_0x838a('0x15')]);}logger[_0x838a('0x13')](_0x838a('0xf'),_0x916ffb,_0x35dbd3['error']['message']);return _0x137559(_0x35dbd3['error'][_0x838a('0x15')]);}else{logger[_0x838a('0xe')](_0x838a('0xf'),_0x916ffb,_0x838a('0x10'));_0x137559(_0x35dbd3[_0x838a('0x16')][_0x838a('0x15')]);}})[_0x838a('0x17')](function(_0x242ddc){logger[_0x838a('0x13')](_0x838a('0xf'),_0x916ffb,_0x242ddc);_0x4ee42e(_0x242ddc);});});} \ No newline at end of file +var _0xaf4d=['ioredis','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x2e219c,_0x522f68){var _0x38841f=function(_0x53539a){while(--_0x53539a){_0x2e219c['push'](_0x2e219c['shift']());}};_0x38841f(++_0x522f68);}(_0xaf4d,0xba));var _0xdaf4=function(_0x407a7d,_0x947ecc){_0x407a7d=_0x407a7d-0x0;var _0x3755d3=_0xaf4d[_0x407a7d];return _0x3755d3;};'use strict';var _=require(_0xdaf4('0x0'));var util=require(_0xdaf4('0x1'));var moment=require(_0xdaf4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaf4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdaf4('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdaf4('0x5'));var client=jayson[_0xdaf4('0x6')][_0xdaf4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x409ea2,_0x598e3f,_0x1cc922){return new BPromise(function(_0x9b9adb,_0x41940d){return client[_0xdaf4('0x8')](_0x409ea2,_0x1cc922)[_0xdaf4('0x9')](function(_0x38b2b6){logger[_0xdaf4('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x598e3f,_0xdaf4('0xb'));logger[_0xdaf4('0xc')](_0xdaf4('0xd'),_0x598e3f,_0xdaf4('0xb'),JSON[_0xdaf4('0xe')](_0x38b2b6));if(_0x38b2b6[_0xdaf4('0xf')]){if(_0x38b2b6[_0xdaf4('0xf')][_0xdaf4('0x10')]===0x1f4){logger[_0xdaf4('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x598e3f,_0x38b2b6[_0xdaf4('0xf')]['message']);return _0x41940d(_0x38b2b6['error'][_0xdaf4('0x11')]);}logger[_0xdaf4('0xf')](_0xdaf4('0x12'),_0x598e3f,_0x38b2b6[_0xdaf4('0xf')]['message']);return _0x9b9adb(_0x38b2b6[_0xdaf4('0xf')][_0xdaf4('0x11')]);}else{logger[_0xdaf4('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x598e3f,_0xdaf4('0xb'));_0x9b9adb(_0x38b2b6[_0xdaf4('0x13')][_0xdaf4('0x11')]);}})[_0xdaf4('0x14')](function(_0x460c89){logger[_0xdaf4('0xf')](_0xdaf4('0x12'),_0x598e3f,_0x460c89);_0x41940d(_0x460c89);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index c55418b..a2d7c45 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 _0xf7b4=['destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf7b4,0x152));var _0x4f7b=function(_0x65ab97,_0x1f2ace){_0x65ab97=_0x65ab97-0x0;var _0x38a80d=_0xf7b4[_0x65ab97];return _0x38a80d;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/fields',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);router['post'](_0x4f7b('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4f7b('0x11')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['delete'](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x13')]);module[_0x4f7b('0x14')]=router; \ No newline at end of file +var _0x34b7=['getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x34b7,0x196));var _0x734b=function(_0x34cc9f,_0x4d891a){_0x34cc9f=_0x34cc9f-0x0;var _0x1991d3=_0x34b7[_0x34cc9f];return _0x1991d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x734b('0x7')]('/:id/fields',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xd')](_0x734b('0xf'),auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0x11')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0x13')]('/:id',auth[_0x734b('0x8')](),controller[_0x734b('0x14')]);module[_0x734b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c3ab396..acac916 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 _0xb03e=['STRING','username','remoteUri','exports'];(function(_0x14c785,_0x1ef88e){var _0x165dd5=function(_0x253263){while(--_0x253263){_0x14c785['push'](_0x14c785['shift']());}};_0x165dd5(++_0x1ef88e);}(_0xb03e,0x1eb));var _0xeb03=function(_0x5eb035,_0x12a55c){_0x5eb035=_0x5eb035-0x0;var _0x1f2f83=_0xb03e[_0x5eb035];return _0x1f2f83;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'name':{'type':Sequelize[_0xeb03('0x1')]},'description':{'type':Sequelize[_0xeb03('0x1')]},'username':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x2')},'apiKey':{'type':Sequelize[_0xeb03('0x1')]},'remoteUri':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x3')},'serverUrl':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8603=['remoteUri','exports','STRING'];(function(_0x569e10,_0x5dd13e){var _0x5790cc=function(_0x18d95d){while(--_0x18d95d){_0x569e10['push'](_0x569e10['shift']());}};_0x5790cc(++_0x5dd13e);}(_0x8603,0x190));var _0x3860=function(_0x39f629,_0x54a0f6){_0x39f629=_0x39f629-0x0;var _0x44338c=_0x8603[_0x39f629];return _0x44338c;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index dd1eaa4..32c7dc3 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 _0x887f=['GET','format','%s%s','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','FreshsalesAccount','keys','length','includeAll','find','create','body','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x887f,0x1a2));var _0xf887=function(_0x29395b,_0x568a0f){_0x29395b=_0x29395b-0x0;var _0x102ae0=_0x887f[_0x29395b];return _0x102ae0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf887('0x0'));var jsonpatch=require(_0xf887('0x1'));var rp=require(_0xf887('0x2'));var moment=require(_0xf887('0x3'));var BPromise=require(_0xf887('0x4'));var Mustache=require(_0xf887('0x5'));var util=require(_0xf887('0x6'));var path=require(_0xf887('0x7'));var sox=require(_0xf887('0x8'));var csv=require('to-csv');var ejs=require(_0xf887('0x9'));var fs=require('fs');var fs_extra=require(_0xf887('0xa'));var _=require(_0xf887('0xb'));var squel=require(_0xf887('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf887('0xd'));var toCsv=require(_0xf887('0xe'));var querystring=require(_0xf887('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf887('0x10'));var as=require(_0xf887('0x11'));var hardwareService=require(_0xf887('0x12'));var logger=require(_0xf887('0x13'))(_0xf887('0x14'));var utils=require(_0xf887('0x15'));var config=require(_0xf887('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x6ff0fb,_0x4ca461){_0x4ca461=_0x4ca461||0xcc;return function(_0x20e536){if(_0x20e536){return _0x6ff0fb[_0xf887('0x17')](_0x4ca461);}return _0x6ff0fb[_0xf887('0x18')](_0x4ca461)[_0xf887('0x19')]();};}function respondWithResult(_0x5d4f62,_0x43339f){_0x43339f=_0x43339f||0xc8;return function(_0x381734){if(_0x381734){return _0x5d4f62['status'](_0x43339f)[_0xf887('0x1a')](_0x381734);}};}function respondWithFilteredResult(_0x315dd6,_0x5da008){return function(_0x37a5bb){if(_0x37a5bb){var _0x447841=typeof _0x5da008['offset']===_0xf887('0x1b')&&typeof _0x5da008['limit']===_0xf887('0x1b');var _0x36414a=_0x37a5bb[_0xf887('0x1c')];var _0x4adb14=_0x447841?0x0:_0x5da008[_0xf887('0x1d')];var _0x3bc359=_0x447841?_0x37a5bb['count']:_0x5da008[_0xf887('0x1d')]+_0x5da008[_0xf887('0x1e')];var _0x172fac;if(_0x3bc359>=_0x36414a){_0x3bc359=_0x36414a;_0x172fac=0xc8;}else{_0x172fac=0xce;}_0x315dd6['status'](_0x172fac);return _0x315dd6['set']('Content-Range',_0x4adb14+'-'+_0x3bc359+'/'+_0x36414a)[_0xf887('0x1a')](_0x37a5bb);}return null;};}function patchUpdates(_0x354efc){return function(_0x424d0d){try{jsonpatch['apply'](_0x424d0d,_0x354efc,!![]);}catch(_0x1ce8a4){return BPromise[_0xf887('0x1f')](_0x1ce8a4);}return _0x424d0d[_0xf887('0x20')]();};}function saveUpdates(_0x351a08,_0x1bcd4b){return function(_0x1eaccd){if(_0x1eaccd){return _0x1eaccd[_0xf887('0x21')](_0x351a08)[_0xf887('0x22')](function(_0x1bb234){return _0x1bb234;});}return null;};}function removeEntity(_0x40030b,_0x2406e6){return function(_0x5aae72){if(_0x5aae72){return _0x5aae72[_0xf887('0x23')]()[_0xf887('0x22')](function(){_0x40030b[_0xf887('0x18')](0xcc)[_0xf887('0x19')]();});}};}function handleEntityNotFound(_0x393060,_0x4a2817){return function(_0x4abc83){if(!_0x4abc83){_0x393060[_0xf887('0x17')](0x194);}return _0x4abc83;};}function handleError(_0x247c47,_0x218914){_0x218914=_0x218914||0x1f4;return function(_0xa4f490){logger[_0xf887('0x24')](_0xa4f490[_0xf887('0x25')]);if(_0xa4f490[_0xf887('0x26')]){delete _0xa4f490[_0xf887('0x26')];}_0x247c47[_0xf887('0x18')](_0x218914)[_0xf887('0x27')](_0xa4f490);};}exports[_0xf887('0x28')]=function(_0x1d5a72,_0x5deba0){var _0x9f587d={},_0x4bcbef={},_0x133137={'count':0x0,'rows':[]};var _0x2f329b=_[_0xf887('0x29')](db['FreshsalesAccount'][_0xf887('0x2a')],function(_0xf3745f){return{'name':_0xf3745f[_0xf887('0x2b')],'type':_0xf3745f[_0xf887('0x2c')][_0xf887('0x2d')]};});_0x4bcbef[_0xf887('0x2e')]=_[_0xf887('0x29')](_0x2f329b,_0xf887('0x26'));_0x4bcbef[_0xf887('0x2f')]=_['keys'](_0x1d5a72[_0xf887('0x2f')]);_0x4bcbef[_0xf887('0x30')]=_[_0xf887('0x31')](_0x4bcbef[_0xf887('0x2e')],_0x4bcbef['query']);_0x9f587d[_0xf887('0x32')]=_[_0xf887('0x31')](_0x4bcbef[_0xf887('0x2e')],qs[_0xf887('0x33')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x33')]));_0x9f587d[_0xf887('0x32')]=_0x9f587d[_0xf887('0x32')]['length']?_0x9f587d['attributes']:_0x4bcbef[_0xf887('0x2e')];if(!_0x1d5a72[_0xf887('0x2f')][_0xf887('0x34')](_0xf887('0x35'))){_0x9f587d['limit']=qs[_0xf887('0x1e')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x1e')]);_0x9f587d[_0xf887('0x1d')]=qs[_0xf887('0x1d')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x1d')]);}_0x9f587d[_0xf887('0x36')]=qs[_0xf887('0x37')](_0x1d5a72[_0xf887('0x2f')][_0xf887('0x37')]);_0x9f587d[_0xf887('0x38')]=qs[_0xf887('0x30')](_[_0xf887('0x39')](_0x1d5a72['query'],_0x4bcbef[_0xf887('0x30')]),_0x2f329b);if(_0x1d5a72[_0xf887('0x2f')][_0xf887('0x3a')]){_0x9f587d[_0xf887('0x38')]=_[_0xf887('0x3b')](_0x9f587d['where'],{'$or':_['map'](_0x2f329b,function(_0x3da587){if(_0x3da587[_0xf887('0x2c')]!==_0xf887('0x3c')){var _0xb9f643={};_0xb9f643[_0x3da587[_0xf887('0x26')]]={'$like':'%'+_0x1d5a72['query']['filter']+'%'};return _0xb9f643;}})});}_0x9f587d=_['merge']({},_0x9f587d,_0x1d5a72[_0xf887('0x3d')]);var _0x18fdba={'where':_0x9f587d['where']};return db['FreshsalesAccount']['count'](_0x18fdba)[_0xf887('0x22')](function(_0x5bbd14){_0x133137[_0xf887('0x1c')]=_0x5bbd14;if(_0x1d5a72['query']['includeAll']){_0x9f587d[_0xf887('0x3e')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xf887('0x3f')](_0x9f587d);})[_0xf887('0x22')](function(_0x1d7a67){_0x133137[_0xf887('0x40')]=_0x1d7a67;return _0x133137;})[_0xf887('0x22')](respondWithFilteredResult(_0x5deba0,_0x9f587d))[_0xf887('0x41')](handleError(_0x5deba0,null));};exports[_0xf887('0x42')]=function(_0x4022c4,_0x4e4f7d){var _0xfea86e={'raw':![],'where':{'id':_0x4022c4[_0xf887('0x43')]['id']}},_0x378796={};_0x378796[_0xf887('0x2e')]=_['keys'](db[_0xf887('0x44')]['rawAttributes']);_0x378796[_0xf887('0x2f')]=_[_0xf887('0x45')](_0x4022c4[_0xf887('0x2f')]);_0x378796[_0xf887('0x30')]=_[_0xf887('0x31')](_0x378796[_0xf887('0x2e')],_0x378796['query']);_0xfea86e['attributes']=_['intersection'](_0x378796['model'],qs[_0xf887('0x33')](_0x4022c4[_0xf887('0x2f')]['fields']));_0xfea86e[_0xf887('0x32')]=_0xfea86e[_0xf887('0x32')][_0xf887('0x46')]?_0xfea86e[_0xf887('0x32')]:_0x378796['model'];if(_0x4022c4[_0xf887('0x2f')][_0xf887('0x47')]){_0xfea86e[_0xf887('0x3e')]=[{'all':!![]}];}_0xfea86e=_['merge']({},_0xfea86e,_0x4022c4[_0xf887('0x3d')]);return db[_0xf887('0x44')][_0xf887('0x48')](_0xfea86e)[_0xf887('0x22')](handleEntityNotFound(_0x4e4f7d,null))[_0xf887('0x22')](respondWithResult(_0x4e4f7d,null))['catch'](handleError(_0x4e4f7d,null));};exports[_0xf887('0x49')]=function(_0x22d088,_0x427e6c){return db[_0xf887('0x44')][_0xf887('0x49')](_0x22d088['body'],{})[_0xf887('0x22')](respondWithResult(_0x427e6c,0xc9))[_0xf887('0x41')](handleError(_0x427e6c,null));};exports[_0xf887('0x21')]=function(_0x1ce664,_0xbb8867){if(_0x1ce664['body']['id']){delete _0x1ce664[_0xf887('0x4a')]['id'];}return db['FreshsalesAccount'][_0xf887('0x48')]({'where':{'id':_0x1ce664[_0xf887('0x43')]['id']}})['then'](handleEntityNotFound(_0xbb8867,null))[_0xf887('0x22')](saveUpdates(_0x1ce664[_0xf887('0x4a')],null))[_0xf887('0x22')](respondWithResult(_0xbb8867,null))['catch'](handleError(_0xbb8867,null));};exports[_0xf887('0x23')]=function(_0x42fe8e,_0x482186){return db['FreshsalesAccount'][_0xf887('0x48')]({'where':{'id':_0x42fe8e[_0xf887('0x43')]['id']}})[_0xf887('0x22')](handleEntityNotFound(_0x482186,null))['then'](removeEntity(_0x482186,null))['catch'](handleError(_0x482186,null));};exports['getConfigurations']=function(_0x542f62,_0x5c6c40,_0x4a2a39){var _0x1f54c5={};var _0x3a0ec7={};var _0x195c52;var _0xc7b54a;return db[_0xf887('0x44')][_0xf887('0x4b')]({'where':{'id':_0x542f62[_0xf887('0x43')]['id']}})[_0xf887('0x22')](handleEntityNotFound(_0x5c6c40,null))[_0xf887('0x22')](function(_0x4487fb){if(_0x4487fb){_0x195c52=_0x4487fb;_0x3a0ec7['model']=_[_0xf887('0x45')](db[_0xf887('0x4c')][_0xf887('0x2a')]);_0x3a0ec7[_0xf887('0x2f')]=_['keys'](_0x542f62[_0xf887('0x2f')]);_0x3a0ec7['filters']=_[_0xf887('0x31')](_0x3a0ec7[_0xf887('0x2e')],_0x3a0ec7[_0xf887('0x2f')]);_0x1f54c5[_0xf887('0x32')]=_[_0xf887('0x31')](_0x3a0ec7[_0xf887('0x2e')],qs[_0xf887('0x33')](_0x542f62[_0xf887('0x2f')][_0xf887('0x33')]));_0x1f54c5[_0xf887('0x32')]=_0x1f54c5['attributes'][_0xf887('0x46')]?_0x1f54c5[_0xf887('0x32')]:_0x3a0ec7['model'];_0x1f54c5[_0xf887('0x36')]=qs[_0xf887('0x37')](_0x542f62['query'][_0xf887('0x37')]);_0x1f54c5[_0xf887('0x38')]=qs[_0xf887('0x30')](_[_0xf887('0x39')](_0x542f62[_0xf887('0x2f')],_0x3a0ec7[_0xf887('0x30')]));if(_0x542f62[_0xf887('0x2f')]['filter']){_0x1f54c5[_0xf887('0x38')]=_[_0xf887('0x3b')](_0x1f54c5['where'],{'$or':_[_0xf887('0x29')](_0x1f54c5['attributes'],function(_0xda0ab3){var _0x4456c8={};_0x4456c8[_0xda0ab3]={'$like':'%'+_0x542f62['query'][_0xf887('0x3a')]+'%'};return _0x4456c8;})});}_0x1f54c5=_[_0xf887('0x3b')]({},_0x1f54c5,_0x542f62[_0xf887('0x3d')]);return _0x195c52['getConfigurations'](_0x1f54c5);}})[_0xf887('0x22')](function(_0x10a6fa){if(_0x10a6fa){_0xc7b54a=_0x10a6fa[_0xf887('0x46')];if(!_0x542f62[_0xf887('0x2f')]['hasOwnProperty'](_0xf887('0x35'))){_0x1f54c5['limit']=qs[_0xf887('0x1e')](_0x542f62['query'][_0xf887('0x1e')]);_0x1f54c5[_0xf887('0x1d')]=qs['offset'](_0x542f62[_0xf887('0x2f')][_0xf887('0x1d')]);}return _0x195c52[_0xf887('0x4d')](_0x1f54c5);}})[_0xf887('0x22')](function(_0x5e1a15){if(_0x5e1a15){return _0x5e1a15?{'count':_0xc7b54a,'rows':_0x5e1a15}:null;}})[_0xf887('0x22')](respondWithResult(_0x5c6c40,null))[_0xf887('0x41')](handleError(_0x5c6c40,null));};exports[_0xf887('0x4e')]=function(_0x216e2c,_0x4179f8,_0x30746){if(_0x216e2c[_0xf887('0x4a')]['id']){delete _0x216e2c[_0xf887('0x4a')]['id'];}return db[_0xf887('0x44')][_0xf887('0x4b')]({'where':{'id':_0x216e2c[_0xf887('0x43')]['id']}})[_0xf887('0x22')](handleEntityNotFound(_0x4179f8,null))[_0xf887('0x22')](function(_0x90de43){if(_0x90de43){_0x216e2c[_0xf887('0x4a')]['AccountId']=_0x90de43['id'];_0x216e2c[_0xf887('0x4a')][_0xf887('0x4f')]=integrations[_0xf887('0x50')](_0x216e2c[_0xf887('0x4a')][_0xf887('0x51')],_0x216e2c[_0xf887('0x4a')][_0xf887('0x2c')]);_0x216e2c[_0xf887('0x4a')]['Descriptions']=integrations[_0xf887('0x52')](_0x216e2c[_0xf887('0x4a')][_0xf887('0x51')],_0x216e2c[_0xf887('0x4a')][_0xf887('0x2c')]);return db['FreshsalesConfiguration']['create'](_0x216e2c[_0xf887('0x4a')],{'include':[{'model':db[_0xf887('0x53')],'as':_0xf887('0x4f')},{'model':db[_0xf887('0x53')],'as':_0xf887('0x54')}]});}return null;})['then'](respondWithResult(_0x4179f8,null))[_0xf887('0x41')](handleError(_0x4179f8,null));};exports[_0xf887('0x55')]=function(_0x511943,_0x3a477a,_0x23332a){var _0x36926a='';var _0x2c9d6a='';return db[_0xf887('0x44')][_0xf887('0x4b')]({'where':{'id':_0x511943[_0xf887('0x43')]['id']},'attributes':['id',_0xf887('0x56'),_0xf887('0x57'),_0xf887('0x58')]})[_0xf887('0x22')](handleEntityNotFound(_0x3a477a,null))[_0xf887('0x22')](function(_0x27f477){if(_0x27f477){_0x2c9d6a=_0x27f477[_0xf887('0x56')];_0x36926a=_0x27f477['remoteUri'];var _0x13241a=_0x27f477['remoteUri'][_0xf887('0x59')](-0x1);if(_0x13241a==='/'){_0x36926a=_0x36926a[_0xf887('0x5a')](0x0,_0x36926a[_0xf887('0x5b')](_0x13241a));}return rp({'method':_0xf887('0x5c'),'uri':util[_0xf887('0x5d')](_0xf887('0x5e'),_0x36926a,'/api/selector/owners'),'headers':{'Authorization':_0xf887('0x5f')+_0x27f477[_0xf887('0x58')]},'json':!![]});}})[_0xf887('0x22')](function(_0x312447){if(_0x312447){var _0x3f49ee=_0x312447[_0xf887('0x60')];var _0x150d56=![];var _0xa1a1ff=null;for(_0xa1a1ff=0x0;_0xa1a1ff<_0x3f49ee[_0xf887('0x46')];_0xa1a1ff++){if(_0x3f49ee[_0xa1a1ff][_0xf887('0x61')]===_0x2c9d6a){_0x150d56=!![];}}if(_0x150d56){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xf887('0x22')](respondWithResult(_0x3a477a,null))[_0xf887('0x41')](function(_0x3a50d6){var _0x9cf756=_0x511943[_0xf887('0x2f')][_0xf887('0x62')]?0x1f4:_0x3a50d6[_0xf887('0x63')]||0x1f4;logger['error'](_0xf887('0x64'),_0xf887('0x55'),_0x9cf756,JSON['stringify'](_0x3a50d6));delete _0x3a50d6['name'];if(_0x9cf756===0x191){_0x9cf756=0x190;}_0x3a477a[_0xf887('0x18')](_0x9cf756)[_0xf887('0x27')](_0x511943[_0xf887('0x2f')][_0xf887('0x62')]?{'message':_0xf887('0x65'),'statusCode':_0x3a50d6[_0xf887('0x63')]}:_0x3a50d6);});}; \ No newline at end of file +var _0x9de1=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','catch','params','keys','find','create','body','getConfigurations','FreshsalesConfiguration','hasOwnProperty','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf'];(function(_0x157196,_0x291a22){var _0x4a198b=function(_0x348746){while(--_0x348746){_0x157196['push'](_0x157196['shift']());}};_0x4a198b(++_0x291a22);}(_0x9de1,0x12a));var _0x19de=function(_0x5188fc,_0x59f9e9){_0x5188fc=_0x5188fc-0x0;var _0x474b88=_0x9de1[_0x5188fc];return _0x474b88;};'use strict';var emlformat=require(_0x19de('0x0'));var rimraf=require(_0x19de('0x1'));var zipdir=require(_0x19de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x19de('0x3'));var BPromise=require(_0x19de('0x4'));var Mustache=require(_0x19de('0x5'));var util=require(_0x19de('0x6'));var path=require(_0x19de('0x7'));var sox=require(_0x19de('0x8'));var csv=require(_0x19de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19de('0xa'));var squel=require('squel');var crypto=require(_0x19de('0xb'));var jsforce=require(_0x19de('0xc'));var deskjs=require(_0x19de('0xd'));var toCsv=require(_0x19de('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x19de('0xe'));var authService=require(_0x19de('0xf'));var qs=require(_0x19de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19de('0x11'));var logger=require(_0x19de('0x12'))('api');var utils=require(_0x19de('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x19de('0x14'));var db=require(_0x19de('0x15'))['db'];var integrations=require(_0x19de('0x16'));function respondWithStatusCode(_0x5661ef,_0x24bba5){_0x24bba5=_0x24bba5||0xcc;return function(_0x28ae33){if(_0x28ae33){return _0x5661ef[_0x19de('0x17')](_0x24bba5);}return _0x5661ef['status'](_0x24bba5)[_0x19de('0x18')]();};}function respondWithResult(_0x5af295,_0x2c8e3f){_0x2c8e3f=_0x2c8e3f||0xc8;return function(_0x3493e6){if(_0x3493e6){return _0x5af295[_0x19de('0x19')](_0x2c8e3f)[_0x19de('0x1a')](_0x3493e6);}};}function respondWithFilteredResult(_0x4678fd,_0x16d1a1){return function(_0xd2e12){if(_0xd2e12){var _0x438e3b=typeof _0x16d1a1['offset']===_0x19de('0x1b')&&typeof _0x16d1a1['limit']===_0x19de('0x1b');var _0x5d29d6=_0xd2e12[_0x19de('0x1c')];var _0x1aa6c5=_0x438e3b?0x0:_0x16d1a1[_0x19de('0x1d')];var _0x4f5a89=_0x438e3b?_0xd2e12[_0x19de('0x1c')]:_0x16d1a1[_0x19de('0x1d')]+_0x16d1a1['limit'];var _0x29835b;if(_0x4f5a89>=_0x5d29d6){_0x4f5a89=_0x5d29d6;_0x29835b=0xc8;}else{_0x29835b=0xce;}_0x4678fd[_0x19de('0x19')](_0x29835b);return _0x4678fd['set'](_0x19de('0x1e'),_0x1aa6c5+'-'+_0x4f5a89+'/'+_0x5d29d6)['json'](_0xd2e12);}return null;};}function patchUpdates(_0x32ca45){return function(_0x2c4f8a){try{jsonpatch[_0x19de('0x1f')](_0x2c4f8a,_0x32ca45,!![]);}catch(_0x2ed7d6){return BPromise[_0x19de('0x20')](_0x2ed7d6);}return _0x2c4f8a[_0x19de('0x21')]();};}function saveUpdates(_0x4caf2f,_0x5c0dbf){return function(_0x490857){if(_0x490857){return _0x490857[_0x19de('0x22')](_0x4caf2f)[_0x19de('0x23')](function(_0x59d7fc){return _0x59d7fc;});}return null;};}function removeEntity(_0x2d4cb3,_0x36b117){return function(_0xff0be0){if(_0xff0be0){return _0xff0be0[_0x19de('0x24')]()[_0x19de('0x23')](function(){_0x2d4cb3[_0x19de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x327c63,_0x36d2bc){return function(_0x591202){if(!_0x591202){_0x327c63['sendStatus'](0x194);}return _0x591202;};}function handleError(_0x9644a4,_0x51b717){_0x51b717=_0x51b717||0x1f4;return function(_0x273860){logger[_0x19de('0x25')](_0x273860[_0x19de('0x26')]);if(_0x273860[_0x19de('0x27')]){delete _0x273860['name'];}_0x9644a4[_0x19de('0x19')](_0x51b717)[_0x19de('0x28')](_0x273860);};}exports[_0x19de('0x29')]=function(_0xbc3ecb,_0x55a4f7){var _0x592ebf={},_0x3ba284={},_0x5f4b9a={'count':0x0,'rows':[]};var _0x164759=_[_0x19de('0x2a')](db[_0x19de('0x2b')][_0x19de('0x2c')],function(_0x6761b5){return{'name':_0x6761b5[_0x19de('0x2d')],'type':_0x6761b5[_0x19de('0x2e')]['key']};});_0x3ba284['model']=_[_0x19de('0x2a')](_0x164759,'name');_0x3ba284[_0x19de('0x2f')]=_['keys'](_0xbc3ecb[_0x19de('0x2f')]);_0x3ba284[_0x19de('0x30')]=_[_0x19de('0x31')](_0x3ba284['model'],_0x3ba284[_0x19de('0x2f')]);_0x592ebf[_0x19de('0x32')]=_[_0x19de('0x31')](_0x3ba284[_0x19de('0x33')],qs['fields'](_0xbc3ecb[_0x19de('0x2f')][_0x19de('0x34')]));_0x592ebf[_0x19de('0x32')]=_0x592ebf['attributes'][_0x19de('0x35')]?_0x592ebf[_0x19de('0x32')]:_0x3ba284['model'];if(!_0xbc3ecb['query']['hasOwnProperty'](_0x19de('0x36'))){_0x592ebf[_0x19de('0x37')]=qs[_0x19de('0x37')](_0xbc3ecb[_0x19de('0x2f')]['limit']);_0x592ebf[_0x19de('0x1d')]=qs[_0x19de('0x1d')](_0xbc3ecb[_0x19de('0x2f')][_0x19de('0x1d')]);}_0x592ebf[_0x19de('0x38')]=qs['sort'](_0xbc3ecb['query'][_0x19de('0x39')]);_0x592ebf[_0x19de('0x3a')]=qs['filters'](_[_0x19de('0x3b')](_0xbc3ecb[_0x19de('0x2f')],_0x3ba284[_0x19de('0x30')]),_0x164759);if(_0xbc3ecb[_0x19de('0x2f')][_0x19de('0x3c')]){_0x592ebf[_0x19de('0x3a')]=_[_0x19de('0x3d')](_0x592ebf[_0x19de('0x3a')],{'$or':_[_0x19de('0x2a')](_0x164759,function(_0xbde82){if(_0xbde82[_0x19de('0x2e')]!=='VIRTUAL'){var _0x49fcbe={};_0x49fcbe[_0xbde82[_0x19de('0x27')]]={'$like':'%'+_0xbc3ecb[_0x19de('0x2f')][_0x19de('0x3c')]+'%'};return _0x49fcbe;}})});}_0x592ebf=_[_0x19de('0x3d')]({},_0x592ebf,_0xbc3ecb[_0x19de('0x3e')]);var _0x383278={'where':_0x592ebf[_0x19de('0x3a')]};return db[_0x19de('0x2b')][_0x19de('0x1c')](_0x383278)[_0x19de('0x23')](function(_0x5812f0){_0x5f4b9a[_0x19de('0x1c')]=_0x5812f0;if(_0xbc3ecb[_0x19de('0x2f')][_0x19de('0x3f')]){_0x592ebf['include']=[{'all':!![]}];}return db[_0x19de('0x2b')]['findAll'](_0x592ebf);})[_0x19de('0x23')](function(_0x759b6e){_0x5f4b9a['rows']=_0x759b6e;return _0x5f4b9a;})['then'](respondWithFilteredResult(_0x55a4f7,_0x592ebf))[_0x19de('0x40')](handleError(_0x55a4f7,null));};exports['show']=function(_0x167b0e,_0x4652b2){var _0x3bba74={'raw':![],'where':{'id':_0x167b0e[_0x19de('0x41')]['id']}},_0x283a95={};_0x283a95[_0x19de('0x33')]=_[_0x19de('0x42')](db[_0x19de('0x2b')]['rawAttributes']);_0x283a95[_0x19de('0x2f')]=_['keys'](_0x167b0e['query']);_0x283a95[_0x19de('0x30')]=_[_0x19de('0x31')](_0x283a95[_0x19de('0x33')],_0x283a95['query']);_0x3bba74[_0x19de('0x32')]=_[_0x19de('0x31')](_0x283a95[_0x19de('0x33')],qs[_0x19de('0x34')](_0x167b0e[_0x19de('0x2f')][_0x19de('0x34')]));_0x3bba74['attributes']=_0x3bba74[_0x19de('0x32')][_0x19de('0x35')]?_0x3bba74['attributes']:_0x283a95['model'];if(_0x167b0e[_0x19de('0x2f')][_0x19de('0x3f')]){_0x3bba74['include']=[{'all':!![]}];}_0x3bba74=_[_0x19de('0x3d')]({},_0x3bba74,_0x167b0e[_0x19de('0x3e')]);return db[_0x19de('0x2b')][_0x19de('0x43')](_0x3bba74)[_0x19de('0x23')](handleEntityNotFound(_0x4652b2,null))['then'](respondWithResult(_0x4652b2,null))[_0x19de('0x40')](handleError(_0x4652b2,null));};exports['create']=function(_0x2e382f,_0x39d0da){return db[_0x19de('0x2b')][_0x19de('0x44')](_0x2e382f[_0x19de('0x45')],{})[_0x19de('0x23')](respondWithResult(_0x39d0da,0xc9))[_0x19de('0x40')](handleError(_0x39d0da,null));};exports[_0x19de('0x22')]=function(_0x3d6097,_0x574a33){if(_0x3d6097[_0x19de('0x45')]['id']){delete _0x3d6097[_0x19de('0x45')]['id'];}return db['FreshsalesAccount'][_0x19de('0x43')]({'where':{'id':_0x3d6097['params']['id']}})[_0x19de('0x23')](handleEntityNotFound(_0x574a33,null))[_0x19de('0x23')](saveUpdates(_0x3d6097[_0x19de('0x45')],null))['then'](respondWithResult(_0x574a33,null))[_0x19de('0x40')](handleError(_0x574a33,null));};exports['destroy']=function(_0x31b2c2,_0x70ec1b){return db[_0x19de('0x2b')][_0x19de('0x43')]({'where':{'id':_0x31b2c2[_0x19de('0x41')]['id']}})['then'](handleEntityNotFound(_0x70ec1b,null))[_0x19de('0x23')](removeEntity(_0x70ec1b,null))[_0x19de('0x40')](handleError(_0x70ec1b,null));};exports[_0x19de('0x46')]=function(_0x285400,_0x3155a8,_0x425d3f){var _0x202a78={};var _0x1b56e3={};var _0x1b70f1;var _0x9b3d11;return db[_0x19de('0x2b')]['findOne']({'where':{'id':_0x285400[_0x19de('0x41')]['id']}})[_0x19de('0x23')](handleEntityNotFound(_0x3155a8,null))[_0x19de('0x23')](function(_0x51a2f4){if(_0x51a2f4){_0x1b70f1=_0x51a2f4;_0x1b56e3[_0x19de('0x33')]=_[_0x19de('0x42')](db[_0x19de('0x47')]['rawAttributes']);_0x1b56e3[_0x19de('0x2f')]=_[_0x19de('0x42')](_0x285400[_0x19de('0x2f')]);_0x1b56e3[_0x19de('0x30')]=_['intersection'](_0x1b56e3[_0x19de('0x33')],_0x1b56e3[_0x19de('0x2f')]);_0x202a78[_0x19de('0x32')]=_['intersection'](_0x1b56e3[_0x19de('0x33')],qs[_0x19de('0x34')](_0x285400[_0x19de('0x2f')]['fields']));_0x202a78[_0x19de('0x32')]=_0x202a78['attributes']['length']?_0x202a78[_0x19de('0x32')]:_0x1b56e3[_0x19de('0x33')];_0x202a78['order']=qs[_0x19de('0x39')](_0x285400[_0x19de('0x2f')][_0x19de('0x39')]);_0x202a78[_0x19de('0x3a')]=qs[_0x19de('0x30')](_[_0x19de('0x3b')](_0x285400[_0x19de('0x2f')],_0x1b56e3[_0x19de('0x30')]));if(_0x285400[_0x19de('0x2f')][_0x19de('0x3c')]){_0x202a78[_0x19de('0x3a')]=_[_0x19de('0x3d')](_0x202a78[_0x19de('0x3a')],{'$or':_[_0x19de('0x2a')](_0x202a78[_0x19de('0x32')],function(_0x4e8717){var _0x509471={};_0x509471[_0x4e8717]={'$like':'%'+_0x285400[_0x19de('0x2f')][_0x19de('0x3c')]+'%'};return _0x509471;})});}_0x202a78=_[_0x19de('0x3d')]({},_0x202a78,_0x285400[_0x19de('0x3e')]);return _0x1b70f1[_0x19de('0x46')](_0x202a78);}})[_0x19de('0x23')](function(_0xbeaf0){if(_0xbeaf0){_0x9b3d11=_0xbeaf0[_0x19de('0x35')];if(!_0x285400[_0x19de('0x2f')][_0x19de('0x48')](_0x19de('0x36'))){_0x202a78[_0x19de('0x37')]=qs[_0x19de('0x37')](_0x285400[_0x19de('0x2f')][_0x19de('0x37')]);_0x202a78['offset']=qs[_0x19de('0x1d')](_0x285400[_0x19de('0x2f')][_0x19de('0x1d')]);}return _0x1b70f1[_0x19de('0x46')](_0x202a78);}})[_0x19de('0x23')](function(_0x3a0a5c){if(_0x3a0a5c){return _0x3a0a5c?{'count':_0x9b3d11,'rows':_0x3a0a5c}:null;}})[_0x19de('0x23')](respondWithResult(_0x3155a8,null))['catch'](handleError(_0x3155a8,null));};exports[_0x19de('0x49')]=function(_0x418f03,_0x2a2e3a,_0x1b6d37){if(_0x418f03['body']['id']){delete _0x418f03['body']['id'];}return db[_0x19de('0x2b')][_0x19de('0x4a')]({'where':{'id':_0x418f03[_0x19de('0x41')]['id']}})[_0x19de('0x23')](handleEntityNotFound(_0x2a2e3a,null))[_0x19de('0x23')](function(_0x1ea334){if(_0x1ea334){_0x418f03[_0x19de('0x45')]['AccountId']=_0x1ea334['id'];_0x418f03[_0x19de('0x45')][_0x19de('0x4b')]=integrations[_0x19de('0x4c')](_0x418f03[_0x19de('0x45')][_0x19de('0x4d')],_0x418f03[_0x19de('0x45')][_0x19de('0x2e')]);_0x418f03[_0x19de('0x45')][_0x19de('0x4e')]=integrations[_0x19de('0x4f')](_0x418f03[_0x19de('0x45')][_0x19de('0x4d')],_0x418f03['body'][_0x19de('0x2e')]);return db['FreshsalesConfiguration']['create'](_0x418f03[_0x19de('0x45')],{'include':[{'model':db[_0x19de('0x50')],'as':'Subjects'},{'model':db[_0x19de('0x50')],'as':'Descriptions'}]});}return null;})[_0x19de('0x23')](respondWithResult(_0x2a2e3a,null))[_0x19de('0x40')](handleError(_0x2a2e3a,null));};exports[_0x19de('0x51')]=function(_0x320c01,_0x87b455,_0x541162){var _0x4566bc='';var _0x35569d='';return db[_0x19de('0x2b')][_0x19de('0x4a')]({'where':{'id':_0x320c01[_0x19de('0x41')]['id']},'attributes':['id',_0x19de('0x52'),_0x19de('0x53'),_0x19de('0x54')]})[_0x19de('0x23')](handleEntityNotFound(_0x87b455,null))[_0x19de('0x23')](function(_0x4244f9){if(_0x4244f9){_0x35569d=_0x4244f9[_0x19de('0x52')];_0x4566bc=_0x4244f9['remoteUri'];var _0x52e0cc=_0x4244f9[_0x19de('0x53')][_0x19de('0x55')](-0x1);if(_0x52e0cc==='/'){_0x4566bc=_0x4566bc[_0x19de('0x56')](0x0,_0x4566bc[_0x19de('0x57')](_0x52e0cc));}return rp({'method':_0x19de('0x58'),'uri':util[_0x19de('0x59')](_0x19de('0x5a'),_0x4566bc,_0x19de('0x5b')),'headers':{'Authorization':_0x19de('0x5c')+_0x4244f9[_0x19de('0x54')]},'json':!![]});}})[_0x19de('0x23')](function(_0x3fa0c0){if(_0x3fa0c0){var _0x347b2f=_0x3fa0c0[_0x19de('0x5d')];var _0x380b9b=![];var _0x43977a=null;for(_0x43977a=0x0;_0x43977a<_0x347b2f[_0x19de('0x35')];_0x43977a++){if(_0x347b2f[_0x43977a][_0x19de('0x5e')]===_0x35569d){_0x380b9b=!![];}}if(_0x380b9b){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x19de('0x5f')});}}})['then'](respondWithResult(_0x87b455,null))[_0x19de('0x40')](function(_0x573d69){var _0x363339=_0x320c01[_0x19de('0x2f')][_0x19de('0x60')]?0x1f4:_0x573d69[_0x19de('0x61')]||0x1f4;logger[_0x19de('0x25')](_0x19de('0x62'),_0x19de('0x51'),_0x363339,JSON[_0x19de('0x63')](_0x573d69));delete _0x573d69[_0x19de('0x27')];if(_0x363339===0x191){_0x363339=0x190;}_0x87b455[_0x19de('0x19')](_0x363339)[_0x19de('0x28')](_0x320c01[_0x19de('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x573d69[_0x19de('0x61')]}:_0x573d69);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 5a90185..ef76de3 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 _0xfb11=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x4957af,_0x10c9f0){var _0x2fb38c=function(_0x35c256){while(--_0x35c256){_0x4957af['push'](_0x4957af['shift']());}};_0x2fb38c(++_0x10c9f0);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xfb11[_0x32d457];return _0x338386;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x1fb1('0x7')]=function(_0x133727,_0x4c098d){return _0x133727[_0x1fb1('0x8')](_0x1fb1('0x9'),attributes,{'tableName':_0x1fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./intFreshsalesAccount.attributes','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x53ec,0x192));var _0xc53e=function(_0x5a69ab,_0x610049){_0x5a69ab=_0x5a69ab-0x0;var _0x27f2f7=_0x53ec[_0x5a69ab];return _0x27f2f7;};'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'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xc53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index afdb036..11573ce 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 _0x0120=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0120,0x6f));var _0x0012=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0120[_0x2b4411];return _0x8e41ef;};'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')]('FreshsalesAccount,\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);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['FreshsalesAccount'][_0x0012('0x17')]({'raw':_0x1d0423[_0x0012('0x18')]?_0x1d0423['options'][_0x0012('0x19')]===undefined?!![]:![]:!![],'where':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x1d0423['options']?_0x1d0423['options'][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1c')]||null:null,'include':_0x1d0423[_0x0012('0x18')]?_0x1d0423[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x1d0423['options'][_0x0012('0x1d')],function(_0x24a280){return{'model':db[_0x24a280['model']],'as':_0x24a280['as'],'attributes':_0x24a280[_0x0012('0x1b')],'include':_0x24a280[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x24a280[_0x0012('0x1d')],function(_0x42bcd7){return{'model':db[_0x42bcd7['model']],'as':_0x42bcd7['as'],'attributes':_0x42bcd7[_0x0012('0x1b')],'include':_0x42bcd7[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x42bcd7[_0x0012('0x1d')],function(_0x173cb3){return{'model':db[_0x173cb3[_0x0012('0x1f')]],'as':_0x173cb3['as'],'attributes':_0x173cb3[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0012('0x20')](function(_0x300e13){logger[_0x0012('0xd')](_0x0012('0x16'),_0x1d0423);logger[_0x0012('0x21')](_0x0012('0x16'),_0x1d0423,JSON[_0x0012('0x11')](_0x300e13));_0x1e78ee(_0x300e13);})[_0x0012('0x22')](function(_0x276389){logger[_0x0012('0x12')](_0x0012('0x16'),_0x276389[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1[_0x0012('0x12')](0x1f4,_0x276389[_0x0012('0x14')]));});});};exports['ShowFreshsalesAccount']=function(_0x283134){var _0x1bb49b=this;return new Promise(function(_0x4c2601,_0x2fa6a2){return db[_0x0012('0x23')][_0x0012('0x24')]({'raw':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1a')]||null:null,'attributes':_0x283134['options']?_0x283134[_0x0012('0x18')][_0x0012('0x1b')]||null:null,'include':_0x283134[_0x0012('0x18')]?_0x283134[_0x0012('0x18')][_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x283134['options'][_0x0012('0x1d')],function(_0x30dfd8){return{'model':db[_0x30dfd8[_0x0012('0x1f')]],'as':_0x30dfd8['as'],'attributes':_0x30dfd8[_0x0012('0x1b')],'include':_0x30dfd8['include']?_['map'](_0x30dfd8[_0x0012('0x1d')],function(_0x30f8a2){return{'model':db[_0x30f8a2[_0x0012('0x1f')]],'as':_0x30f8a2['as'],'attributes':_0x30f8a2[_0x0012('0x1b')],'include':_0x30f8a2[_0x0012('0x1d')]?_[_0x0012('0x1e')](_0x30f8a2[_0x0012('0x1d')],function(_0x4f13b9){return{'model':db[_0x4f13b9[_0x0012('0x1f')]],'as':_0x4f13b9['as'],'attributes':_0x4f13b9[_0x0012('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196222){logger[_0x0012('0xd')](_0x0012('0x25'),_0x283134);logger[_0x0012('0x21')](_0x0012('0x25'),_0x283134,JSON[_0x0012('0x11')](_0x196222));_0x4c2601(_0x196222);})[_0x0012('0x22')](function(_0x4a4af8){logger[_0x0012('0x12')]('ShowFreshsalesAccount',_0x4a4af8[_0x0012('0x14')],_0x283134);_0x2fa6a2(_0x1bb49b['error'](0x1f4,_0x4a4af8['message']));});});}; \ No newline at end of file +var _0x896e=['limit','include','model','attributes','map','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x50bd23,_0x38b860){var _0x5e9f60=function(_0x4ec2bc){while(--_0x4ec2bc){_0x50bd23['push'](_0x50bd23['shift']());}};_0x5e9f60(++_0x38b860);}(_0x896e,0x1e9));var _0xe896=function(_0x1d7a23,_0x5b4f85){_0x1d7a23=_0x1d7a23-0x0;var _0x3b8391=_0x896e[_0x1d7a23];return _0x3b8391;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetFreshsalesAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowFreshsalesAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowFreshsalesAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 638a2af..35561b4 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 _0x2964=['isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x21306b,_0x30158b){var _0x2c193f=function(_0x259706){while(--_0x259706){_0x21306b['push'](_0x21306b['shift']());}};_0x2c193f(++_0x30158b);}(_0x2964,0x142));var _0x4296=function(_0x4c7fa3,_0x152dba){_0x4c7fa3=_0x4c7fa3-0x0;var _0x396e36=_0x2964[_0x4c7fa3];return _0x396e36;};'use strict';var multer=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4296('0x2'));var router=express[_0x4296('0x3')]();var fs_extra=require(_0x4296('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4296('0x5'));var config=require(_0x4296('0x6'));var controller=require(_0x4296('0x7'));router['get']('/',auth[_0x4296('0x8')](),controller[_0x4296('0x9')]);router[_0x4296('0xa')](_0x4296('0xb'),auth[_0x4296('0x8')](),controller[_0x4296('0xc')]);router['get'](_0x4296('0xd'),auth[_0x4296('0x8')](),controller[_0x4296('0xe')]);router[_0x4296('0xa')](_0x4296('0xf'),auth[_0x4296('0x8')](),controller[_0x4296('0x10')]);router[_0x4296('0xa')]('/:id/fields',auth[_0x4296('0x8')](),controller['getFields']);router[_0x4296('0x11')]('/',auth[_0x4296('0x8')](),controller[_0x4296('0x12')]);router['put'](_0x4296('0xb'),auth[_0x4296('0x8')](),controller[_0x4296('0x13')]);router[_0x4296('0x14')]('/:id',auth[_0x4296('0x8')](),controller['destroy']);module[_0x4296('0x15')]=router; \ No newline at end of file +var _0xd251=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','getDescriptions','getFields','post','create','/:id','update','destroy','exports'];(function(_0x1ed1bd,_0x421e04){var _0xe8bd65=function(_0x236b5c){while(--_0x236b5c){_0x1ed1bd['push'](_0x1ed1bd['shift']());}};_0xe8bd65(++_0x421e04);}(_0xd251,0x9a));var _0x1d25=function(_0x34e6b1,_0x3e8f0a){_0x34e6b1=_0x34e6b1-0x0;var _0x200f98=_0xd251[_0x34e6b1];return _0x200f98;};'use strict';var multer=require(_0x1d25('0x0'));var util=require(_0x1d25('0x1'));var path=require(_0x1d25('0x2'));var timeout=require(_0x1d25('0x3'));var express=require(_0x1d25('0x4'));var router=express[_0x1d25('0x5')]();var fs_extra=require(_0x1d25('0x6'));var auth=require(_0x1d25('0x7'));var interaction=require(_0x1d25('0x8'));var config=require('../../config/environment');var controller=require(_0x1d25('0x9'));router[_0x1d25('0xa')]('/',auth[_0x1d25('0xb')](),controller[_0x1d25('0xc')]);router[_0x1d25('0xa')]('/:id',auth[_0x1d25('0xb')](),controller[_0x1d25('0xd')]);router[_0x1d25('0xa')]('/:id/subjects',auth[_0x1d25('0xb')](),controller['getSubjects']);router[_0x1d25('0xa')]('/:id/descriptions',auth[_0x1d25('0xb')](),controller[_0x1d25('0xe')]);router[_0x1d25('0xa')]('/:id/fields',auth[_0x1d25('0xb')](),controller[_0x1d25('0xf')]);router[_0x1d25('0x10')]('/',auth[_0x1d25('0xb')](),controller[_0x1d25('0x11')]);router['put'](_0x1d25('0x12'),auth[_0x1d25('0xb')](),controller[_0x1d25('0x13')]);router['delete'](_0x1d25('0x12'),auth['isAuthenticated'](),controller[_0x1d25('0x14')]);module[_0x1d25('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 7348b41..384eb92 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 _0x7f84=['sequelize','STRING'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x7f84,0x1c2));var _0x47f8=function(_0x1fda58,_0x1a691d){_0x1fda58=_0x1fda58-0x0;var _0x3dce0e=_0x7f84[_0x1fda58];return _0x3dce0e;};'use strict';var Sequelize=require(_0x47f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x47f8('0x1')]},'description':{'type':Sequelize[_0x47f8('0x1')]}}; \ No newline at end of file +var _0x78e1=['STRING','sequelize'];(function(_0x25d7fc,_0x502330){var _0x16abfb=function(_0x363508){while(--_0x363508){_0x25d7fc['push'](_0x25d7fc['shift']());}};_0x16abfb(++_0x502330);}(_0x78e1,0x199));var _0x178e=function(_0x454180,_0x451bd4){_0x454180=_0x454180-0x0;var _0x1e7560=_0x78e1[_0x454180];return _0x1e7560;};'use strict';var Sequelize=require(_0x178e('0x0'));module['exports']={'name':{'type':Sequelize[_0x178e('0x1')]},'description':{'type':Sequelize[_0x178e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 5b8377c..cd993a8 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 _0x301a=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','pick','filter','where','map','type','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','create','body','find','getSubjects','FreshsalesField','sort','nolimit','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x88fd2f,_0x24d564){var _0x12818e=function(_0x16c4ee){while(--_0x16c4ee){_0x88fd2f['push'](_0x88fd2f['shift']());}};_0x12818e(++_0x24d564);}(_0x301a,0x17b));var _0xa301=function(_0x3df67e,_0x3e7e09){_0x3df67e=_0x3df67e-0x0;var _0x20a87e=_0x301a[_0x3df67e];return _0x20a87e;};'use strict';var emlformat=require(_0xa301('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa301('0x1'));var jsonpatch=require(_0xa301('0x2'));var rp=require('request-promise');var moment=require(_0xa301('0x3'));var BPromise=require(_0xa301('0x4'));var Mustache=require(_0xa301('0x5'));var util=require('util');var path=require(_0xa301('0x6'));var sox=require(_0xa301('0x7'));var csv=require('to-csv');var ejs=require(_0xa301('0x8'));var fs=require('fs');var fs_extra=require(_0xa301('0x9'));var _=require(_0xa301('0xa'));var squel=require(_0xa301('0xb'));var crypto=require('crypto');var jsforce=require(_0xa301('0xc'));var deskjs=require(_0xa301('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa301('0xe'));var Papa=require(_0xa301('0xf'));var Redis=require(_0xa301('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa301('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa301('0x12'));var logger=require('../../config/logger')(_0xa301('0x13'));var utils=require(_0xa301('0x14'));var config=require(_0xa301('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x398f29,_0x5071d0){_0x5071d0=_0x5071d0||0xcc;return function(_0x149736){if(_0x149736){return _0x398f29[_0xa301('0x16')](_0x5071d0);}return _0x398f29[_0xa301('0x17')](_0x5071d0)[_0xa301('0x18')]();};}function respondWithResult(_0x4ba19c,_0x86ce9c){_0x86ce9c=_0x86ce9c||0xc8;return function(_0x1c4ec3){if(_0x1c4ec3){return _0x4ba19c['status'](_0x86ce9c)[_0xa301('0x19')](_0x1c4ec3);}};}function respondWithFilteredResult(_0x59d4e7,_0x263cad){return function(_0x8c7d4c){if(_0x8c7d4c){var _0x32454e=typeof _0x263cad[_0xa301('0x1a')]===_0xa301('0x1b')&&typeof _0x263cad[_0xa301('0x1c')]===_0xa301('0x1b');var _0x158842=_0x8c7d4c[_0xa301('0x1d')];var _0x5a0f34=_0x32454e?0x0:_0x263cad[_0xa301('0x1a')];var _0x198988=_0x32454e?_0x8c7d4c['count']:_0x263cad[_0xa301('0x1a')]+_0x263cad[_0xa301('0x1c')];var _0x47c921;if(_0x198988>=_0x158842){_0x198988=_0x158842;_0x47c921=0xc8;}else{_0x47c921=0xce;}_0x59d4e7[_0xa301('0x17')](_0x47c921);return _0x59d4e7[_0xa301('0x1e')](_0xa301('0x1f'),_0x5a0f34+'-'+_0x198988+'/'+_0x158842)[_0xa301('0x19')](_0x8c7d4c);}return null;};}function patchUpdates(_0x39c4a3){return function(_0x3b4c4e){try{jsonpatch[_0xa301('0x20')](_0x3b4c4e,_0x39c4a3,!![]);}catch(_0x308b02){return BPromise[_0xa301('0x21')](_0x308b02);}return _0x3b4c4e['save']();};}function saveUpdates(_0x27d4b0,_0x3a4fb9){return function(_0x2af36a){if(_0x2af36a){return _0x2af36a['update'](_0x27d4b0)[_0xa301('0x22')](function(_0x18786e){return _0x18786e;});}return null;};}function removeEntity(_0x5a9869,_0x22c97a){return function(_0x20fb56){if(_0x20fb56){return _0x20fb56[_0xa301('0x23')]()[_0xa301('0x22')](function(){_0x5a9869[_0xa301('0x17')](0xcc)[_0xa301('0x18')]();});}};}function handleEntityNotFound(_0x488cb1,_0xc8fa95){return function(_0x1cc67d){if(!_0x1cc67d){_0x488cb1[_0xa301('0x16')](0x194);}return _0x1cc67d;};}function handleError(_0x8a7de7,_0x691333){_0x691333=_0x691333||0x1f4;return function(_0x227a33){logger[_0xa301('0x24')](_0x227a33[_0xa301('0x25')]);if(_0x227a33[_0xa301('0x26')]){delete _0x227a33[_0xa301('0x26')];}_0x8a7de7[_0xa301('0x17')](_0x691333)[_0xa301('0x27')](_0x227a33);};}exports['index']=function(_0xb32c11,_0x101002){var _0x1d3a08={},_0x2694f6={},_0x1cd0cf={'count':0x0,'rows':[]};var _0x58d813=_['map'](db['FreshsalesConfiguration'][_0xa301('0x28')],function(_0xac5b00){return{'name':_0xac5b00[_0xa301('0x29')],'type':_0xac5b00['type'][_0xa301('0x2a')]};});_0x2694f6['model']=_['map'](_0x58d813,_0xa301('0x26'));_0x2694f6['query']=_[_0xa301('0x2b')](_0xb32c11[_0xa301('0x2c')]);_0x2694f6[_0xa301('0x2d')]=_[_0xa301('0x2e')](_0x2694f6[_0xa301('0x2f')],_0x2694f6[_0xa301('0x2c')]);_0x1d3a08['attributes']=_[_0xa301('0x2e')](_0x2694f6[_0xa301('0x2f')],qs[_0xa301('0x30')](_0xb32c11['query'][_0xa301('0x30')]));_0x1d3a08[_0xa301('0x31')]=_0x1d3a08[_0xa301('0x31')][_0xa301('0x32')]?_0x1d3a08[_0xa301('0x31')]:_0x2694f6['model'];if(!_0xb32c11[_0xa301('0x2c')][_0xa301('0x33')]('nolimit')){_0x1d3a08[_0xa301('0x1c')]=qs[_0xa301('0x1c')](_0xb32c11[_0xa301('0x2c')][_0xa301('0x1c')]);_0x1d3a08['offset']=qs[_0xa301('0x1a')](_0xb32c11[_0xa301('0x2c')]['offset']);}_0x1d3a08[_0xa301('0x34')]=qs['sort'](_0xb32c11[_0xa301('0x2c')]['sort']);_0x1d3a08['where']=qs[_0xa301('0x2d')](_[_0xa301('0x35')](_0xb32c11[_0xa301('0x2c')],_0x2694f6[_0xa301('0x2d')]),_0x58d813);if(_0xb32c11[_0xa301('0x2c')][_0xa301('0x36')]){_0x1d3a08['where']=_['merge'](_0x1d3a08[_0xa301('0x37')],{'$or':_[_0xa301('0x38')](_0x58d813,function(_0x30469d){if(_0x30469d[_0xa301('0x39')]!==_0xa301('0x3a')){var _0x2bc955={};_0x2bc955[_0x30469d[_0xa301('0x26')]]={'$like':'%'+_0xb32c11[_0xa301('0x2c')]['filter']+'%'};return _0x2bc955;}})});}_0x1d3a08=_[_0xa301('0x3b')]({},_0x1d3a08,_0xb32c11[_0xa301('0x3c')]);var _0x4287ca={'where':_0x1d3a08[_0xa301('0x37')]};return db[_0xa301('0x3d')][_0xa301('0x1d')](_0x4287ca)[_0xa301('0x22')](function(_0x3c008d){_0x1cd0cf[_0xa301('0x1d')]=_0x3c008d;if(_0xb32c11[_0xa301('0x2c')][_0xa301('0x3e')]){_0x1d3a08[_0xa301('0x3f')]=[{'all':!![]}];}return db[_0xa301('0x3d')][_0xa301('0x40')](_0x1d3a08);})['then'](function(_0x2ef341){_0x1cd0cf[_0xa301('0x41')]=_0x2ef341;return _0x1cd0cf;})[_0xa301('0x22')](respondWithFilteredResult(_0x101002,_0x1d3a08))[_0xa301('0x42')](handleError(_0x101002,null));};exports[_0xa301('0x43')]=function(_0x58f4e3,_0x150144){var _0x4adf98={'raw':![],'where':{'id':_0x58f4e3[_0xa301('0x44')]['id']}},_0x3bd9e5={};_0x3bd9e5[_0xa301('0x2f')]=_[_0xa301('0x2b')](db[_0xa301('0x3d')][_0xa301('0x28')]);_0x3bd9e5['query']=_['keys'](_0x58f4e3['query']);_0x3bd9e5['filters']=_[_0xa301('0x2e')](_0x3bd9e5[_0xa301('0x2f')],_0x3bd9e5[_0xa301('0x2c')]);_0x4adf98[_0xa301('0x31')]=_[_0xa301('0x2e')](_0x3bd9e5[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x58f4e3[_0xa301('0x2c')][_0xa301('0x30')]));_0x4adf98[_0xa301('0x31')]=_0x4adf98['attributes'][_0xa301('0x32')]?_0x4adf98['attributes']:_0x3bd9e5[_0xa301('0x2f')];if(_0x58f4e3[_0xa301('0x2c')][_0xa301('0x3e')]){_0x4adf98[_0xa301('0x3f')]=[{'all':!![]}];}_0x4adf98=_[_0xa301('0x3b')]({},_0x4adf98,_0x58f4e3[_0xa301('0x3c')]);return db[_0xa301('0x3d')]['find'](_0x4adf98)[_0xa301('0x22')](handleEntityNotFound(_0x150144,null))[_0xa301('0x22')](respondWithResult(_0x150144,null))[_0xa301('0x42')](handleError(_0x150144,null));};exports[_0xa301('0x45')]=function(_0xd32f28,_0x41529b){return db['FreshsalesConfiguration'][_0xa301('0x45')](_0xd32f28[_0xa301('0x46')],{})['then'](respondWithResult(_0x41529b,0xc9))[_0xa301('0x42')](handleError(_0x41529b,null));};exports['update']=function(_0x119286,_0xcfd15a){if(_0x119286[_0xa301('0x46')]['id']){delete _0x119286[_0xa301('0x46')]['id'];}return db[_0xa301('0x3d')]['find']({'where':{'id':_0x119286['params']['id']}})['then'](handleEntityNotFound(_0xcfd15a,null))['then'](saveUpdates(_0x119286[_0xa301('0x46')],null))[_0xa301('0x22')](respondWithResult(_0xcfd15a,null))[_0xa301('0x42')](handleError(_0xcfd15a,null));};exports[_0xa301('0x23')]=function(_0x46f44c,_0x4f226e){return db[_0xa301('0x3d')][_0xa301('0x47')]({'where':{'id':_0x46f44c[_0xa301('0x44')]['id']}})[_0xa301('0x22')](handleEntityNotFound(_0x4f226e,null))[_0xa301('0x22')](removeEntity(_0x4f226e,null))[_0xa301('0x42')](handleError(_0x4f226e,null));};exports[_0xa301('0x48')]=function(_0x2fa881,_0x2f3610,_0x8b07c4){var _0x497fdd={};var _0x272397={};var _0x2cb92b;var _0x31d609;return db[_0xa301('0x3d')]['findOne']({'where':{'id':_0x2fa881[_0xa301('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f3610,null))[_0xa301('0x22')](function(_0x5dcdab){if(_0x5dcdab){_0x2cb92b=_0x5dcdab;_0x272397['model']=_[_0xa301('0x2b')](db[_0xa301('0x49')][_0xa301('0x28')]);_0x272397['query']=_[_0xa301('0x2b')](_0x2fa881[_0xa301('0x2c')]);_0x272397[_0xa301('0x2d')]=_[_0xa301('0x2e')](_0x272397[_0xa301('0x2f')],_0x272397[_0xa301('0x2c')]);_0x497fdd['attributes']=_[_0xa301('0x2e')](_0x272397[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x2fa881[_0xa301('0x2c')][_0xa301('0x30')]));_0x497fdd[_0xa301('0x31')]=_0x497fdd[_0xa301('0x31')][_0xa301('0x32')]?_0x497fdd[_0xa301('0x31')]:_0x272397[_0xa301('0x2f')];_0x497fdd[_0xa301('0x34')]=qs[_0xa301('0x4a')](_0x2fa881[_0xa301('0x2c')][_0xa301('0x4a')]);_0x497fdd[_0xa301('0x37')]=qs['filters'](_['pick'](_0x2fa881[_0xa301('0x2c')],_0x272397[_0xa301('0x2d')]));if(_0x2fa881[_0xa301('0x2c')][_0xa301('0x36')]){_0x497fdd[_0xa301('0x37')]=_[_0xa301('0x3b')](_0x497fdd[_0xa301('0x37')],{'$or':_['map'](_0x497fdd[_0xa301('0x31')],function(_0x4039a5){var _0x3d7160={};_0x3d7160[_0x4039a5]={'$like':'%'+_0x2fa881[_0xa301('0x2c')][_0xa301('0x36')]+'%'};return _0x3d7160;})});}_0x497fdd=_[_0xa301('0x3b')]({},_0x497fdd,_0x2fa881['options']);return _0x2cb92b['getSubjects'](_0x497fdd);}})[_0xa301('0x22')](function(_0x2dc2b8){if(_0x2dc2b8){_0x31d609=_0x2dc2b8[_0xa301('0x32')];if(!_0x2fa881[_0xa301('0x2c')][_0xa301('0x33')](_0xa301('0x4b'))){_0x497fdd[_0xa301('0x1c')]=qs[_0xa301('0x1c')](_0x2fa881[_0xa301('0x2c')][_0xa301('0x1c')]);_0x497fdd[_0xa301('0x1a')]=qs['offset'](_0x2fa881['query']['offset']);}return _0x2cb92b['getSubjects'](_0x497fdd);}})[_0xa301('0x22')](function(_0x18768a){if(_0x18768a){return _0x18768a?{'count':_0x31d609,'rows':_0x18768a}:null;}})[_0xa301('0x22')](respondWithResult(_0x2f3610,null))[_0xa301('0x42')](handleError(_0x2f3610,null));};exports[_0xa301('0x4c')]=function(_0x4fabac,_0x5e400f,_0x4848c0){var _0x37a520={};var _0x12af29={};var _0x453aff;var _0x324f57;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4fabac[_0xa301('0x44')]['id']}})[_0xa301('0x22')](handleEntityNotFound(_0x5e400f,null))[_0xa301('0x22')](function(_0x501b29){if(_0x501b29){_0x453aff=_0x501b29;_0x12af29[_0xa301('0x2f')]=_[_0xa301('0x2b')](db[_0xa301('0x49')][_0xa301('0x28')]);_0x12af29[_0xa301('0x2c')]=_['keys'](_0x4fabac[_0xa301('0x2c')]);_0x12af29[_0xa301('0x2d')]=_[_0xa301('0x2e')](_0x12af29[_0xa301('0x2f')],_0x12af29[_0xa301('0x2c')]);_0x37a520[_0xa301('0x31')]=_[_0xa301('0x2e')](_0x12af29[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x4fabac[_0xa301('0x2c')][_0xa301('0x30')]));_0x37a520[_0xa301('0x31')]=_0x37a520['attributes']['length']?_0x37a520[_0xa301('0x31')]:_0x12af29[_0xa301('0x2f')];_0x37a520[_0xa301('0x34')]=qs[_0xa301('0x4a')](_0x4fabac[_0xa301('0x2c')][_0xa301('0x4a')]);_0x37a520[_0xa301('0x37')]=qs[_0xa301('0x2d')](_[_0xa301('0x35')](_0x4fabac[_0xa301('0x2c')],_0x12af29[_0xa301('0x2d')]));if(_0x4fabac[_0xa301('0x2c')]['filter']){_0x37a520['where']=_[_0xa301('0x3b')](_0x37a520['where'],{'$or':_[_0xa301('0x38')](_0x37a520[_0xa301('0x31')],function(_0x1fdb11){var _0x409135={};_0x409135[_0x1fdb11]={'$like':'%'+_0x4fabac[_0xa301('0x2c')][_0xa301('0x36')]+'%'};return _0x409135;})});}_0x37a520=_[_0xa301('0x3b')]({},_0x37a520,_0x4fabac[_0xa301('0x3c')]);return _0x453aff[_0xa301('0x4c')](_0x37a520);}})[_0xa301('0x22')](function(_0x27261b){if(_0x27261b){_0x324f57=_0x27261b[_0xa301('0x32')];if(!_0x4fabac[_0xa301('0x2c')][_0xa301('0x33')](_0xa301('0x4b'))){_0x37a520[_0xa301('0x1c')]=qs[_0xa301('0x1c')](_0x4fabac['query'][_0xa301('0x1c')]);_0x37a520[_0xa301('0x1a')]=qs[_0xa301('0x1a')](_0x4fabac[_0xa301('0x2c')]['offset']);}return _0x453aff[_0xa301('0x4c')](_0x37a520);}})[_0xa301('0x22')](function(_0x8903aa){if(_0x8903aa){return _0x8903aa?{'count':_0x324f57,'rows':_0x8903aa}:null;}})[_0xa301('0x22')](respondWithResult(_0x5e400f,null))[_0xa301('0x42')](handleError(_0x5e400f,null));};exports['getFields']=function(_0x268e2f,_0x3a039c,_0x590dc8){var _0x2c33cc={};var _0x1dfffc={};var _0x590519;var _0x467a94;return db[_0xa301('0x3d')]['findOne']({'where':{'id':_0x268e2f[_0xa301('0x44')]['id']}})[_0xa301('0x22')](handleEntityNotFound(_0x3a039c,null))[_0xa301('0x22')](function(_0x420be2){if(_0x420be2){_0x590519=_0x420be2;_0x1dfffc[_0xa301('0x2f')]=_[_0xa301('0x2b')](db[_0xa301('0x49')][_0xa301('0x28')]);_0x1dfffc['query']=_[_0xa301('0x2b')](_0x268e2f['query']);_0x1dfffc['filters']=_['intersection'](_0x1dfffc['model'],_0x1dfffc[_0xa301('0x2c')]);_0x2c33cc[_0xa301('0x31')]=_[_0xa301('0x2e')](_0x1dfffc[_0xa301('0x2f')],qs[_0xa301('0x30')](_0x268e2f[_0xa301('0x2c')][_0xa301('0x30')]));_0x2c33cc[_0xa301('0x31')]=_0x2c33cc['attributes'][_0xa301('0x32')]?_0x2c33cc[_0xa301('0x31')]:_0x1dfffc[_0xa301('0x2f')];_0x2c33cc[_0xa301('0x34')]=qs[_0xa301('0x4a')](_0x268e2f[_0xa301('0x2c')][_0xa301('0x4a')]);_0x2c33cc[_0xa301('0x37')]=qs['filters'](_[_0xa301('0x35')](_0x268e2f[_0xa301('0x2c')],_0x1dfffc['filters']));if(_0x268e2f[_0xa301('0x2c')][_0xa301('0x36')]){_0x2c33cc[_0xa301('0x37')]=_[_0xa301('0x3b')](_0x2c33cc[_0xa301('0x37')],{'$or':_[_0xa301('0x38')](_0x2c33cc[_0xa301('0x31')],function(_0x288403){var _0x4ee4e6={};_0x4ee4e6[_0x288403]={'$like':'%'+_0x268e2f[_0xa301('0x2c')][_0xa301('0x36')]+'%'};return _0x4ee4e6;})});}_0x2c33cc=_['merge']({},_0x2c33cc,_0x268e2f[_0xa301('0x3c')]);return _0x590519[_0xa301('0x4d')](_0x2c33cc);}})['then'](function(_0x904b3f){if(_0x904b3f){_0x467a94=_0x904b3f[_0xa301('0x32')];if(!_0x268e2f['query']['hasOwnProperty'](_0xa301('0x4b'))){_0x2c33cc['limit']=qs['limit'](_0x268e2f[_0xa301('0x2c')][_0xa301('0x1c')]);_0x2c33cc[_0xa301('0x1a')]=qs[_0xa301('0x1a')](_0x268e2f[_0xa301('0x2c')][_0xa301('0x1a')]);}return _0x590519[_0xa301('0x4d')](_0x2c33cc);}})[_0xa301('0x22')](function(_0x44dfba){if(_0x44dfba){return _0x44dfba?{'count':_0x467a94,'rows':_0x44dfba}:null;}})[_0xa301('0x22')](respondWithResult(_0x3a039c,null))[_0xa301('0x42')](handleError(_0x3a039c,null));}; \ No newline at end of file +var _0x2096=['where','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','find','catch','create','body','params','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5b79e7,_0xe3651d){var _0x789e5b=function(_0x5a35d6){while(--_0x5a35d6){_0x5b79e7['push'](_0x5b79e7['shift']());}};_0x789e5b(++_0xe3651d);}(_0x2096,0x144));var _0x6209=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2096[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x6209('0x0'));var rimraf=require(_0x6209('0x1'));var zipdir=require(_0x6209('0x2'));var jsonpatch=require(_0x6209('0x3'));var rp=require(_0x6209('0x4'));var moment=require('moment');var BPromise=require(_0x6209('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6209('0x6'));var sox=require(_0x6209('0x7'));var csv=require(_0x6209('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6209('0x9'));var _=require('lodash');var squel=require(_0x6209('0xa'));var crypto=require(_0x6209('0xb'));var jsforce=require(_0x6209('0xc'));var deskjs=require(_0x6209('0xd'));var toCsv=require(_0x6209('0x8'));var querystring=require(_0x6209('0xe'));var Papa=require('papaparse');var Redis=require(_0x6209('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6209('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6209('0x11'));var utils=require('../../config/utils');var config=require(_0x6209('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6209('0x13'))['db'];function respondWithStatusCode(_0x31b5b9,_0x3d5da0){_0x3d5da0=_0x3d5da0||0xcc;return function(_0x359f1e){if(_0x359f1e){return _0x31b5b9['sendStatus'](_0x3d5da0);}return _0x31b5b9[_0x6209('0x14')](_0x3d5da0)['end']();};}function respondWithResult(_0x2e6ebd,_0x4749db){_0x4749db=_0x4749db||0xc8;return function(_0x435ad2){if(_0x435ad2){return _0x2e6ebd[_0x6209('0x14')](_0x4749db)['json'](_0x435ad2);}};}function respondWithFilteredResult(_0x14f909,_0x5f46d3){return function(_0x11d41d){if(_0x11d41d){var _0xf634ea=typeof _0x5f46d3[_0x6209('0x15')]===_0x6209('0x16')&&typeof _0x5f46d3[_0x6209('0x17')]===_0x6209('0x16');var _0x5eb111=_0x11d41d[_0x6209('0x18')];var _0x45e706=_0xf634ea?0x0:_0x5f46d3[_0x6209('0x15')];var _0x15a257=_0xf634ea?_0x11d41d[_0x6209('0x18')]:_0x5f46d3[_0x6209('0x15')]+_0x5f46d3[_0x6209('0x17')];var _0x1ab900;if(_0x15a257>=_0x5eb111){_0x15a257=_0x5eb111;_0x1ab900=0xc8;}else{_0x1ab900=0xce;}_0x14f909[_0x6209('0x14')](_0x1ab900);return _0x14f909[_0x6209('0x19')](_0x6209('0x1a'),_0x45e706+'-'+_0x15a257+'/'+_0x5eb111)[_0x6209('0x1b')](_0x11d41d);}return null;};}function patchUpdates(_0x46015f){return function(_0x2f7309){try{jsonpatch['apply'](_0x2f7309,_0x46015f,!![]);}catch(_0x3e3726){return BPromise[_0x6209('0x1c')](_0x3e3726);}return _0x2f7309[_0x6209('0x1d')]();};}function saveUpdates(_0x984d03,_0x373ff5){return function(_0x1c6fed){if(_0x1c6fed){return _0x1c6fed[_0x6209('0x1e')](_0x984d03)[_0x6209('0x1f')](function(_0x5586ab){return _0x5586ab;});}return null;};}function removeEntity(_0x277881,_0x30e7fa){return function(_0x53ea78){if(_0x53ea78){return _0x53ea78[_0x6209('0x20')]()[_0x6209('0x1f')](function(){_0x277881[_0x6209('0x14')](0xcc)[_0x6209('0x21')]();});}};}function handleEntityNotFound(_0x3e4704,_0x37ac36){return function(_0x434a0c){if(!_0x434a0c){_0x3e4704[_0x6209('0x22')](0x194);}return _0x434a0c;};}function handleError(_0x195d24,_0x274147){_0x274147=_0x274147||0x1f4;return function(_0xf096e6){logger[_0x6209('0x23')](_0xf096e6[_0x6209('0x24')]);if(_0xf096e6[_0x6209('0x25')]){delete _0xf096e6[_0x6209('0x25')];}_0x195d24[_0x6209('0x14')](_0x274147)[_0x6209('0x26')](_0xf096e6);};}exports[_0x6209('0x27')]=function(_0x54466b,_0x11feee){var _0x98f972={},_0x2df2aa={},_0x3f562a={'count':0x0,'rows':[]};var _0x7804e4=_[_0x6209('0x28')](db[_0x6209('0x29')][_0x6209('0x2a')],function(_0x40e884){return{'name':_0x40e884['fieldName'],'type':_0x40e884[_0x6209('0x2b')]['key']};});_0x2df2aa[_0x6209('0x2c')]=_[_0x6209('0x28')](_0x7804e4,_0x6209('0x25'));_0x2df2aa[_0x6209('0x2d')]=_[_0x6209('0x2e')](_0x54466b[_0x6209('0x2d')]);_0x2df2aa[_0x6209('0x2f')]=_[_0x6209('0x30')](_0x2df2aa[_0x6209('0x2c')],_0x2df2aa[_0x6209('0x2d')]);_0x98f972[_0x6209('0x31')]=_[_0x6209('0x30')](_0x2df2aa['model'],qs[_0x6209('0x32')](_0x54466b[_0x6209('0x2d')][_0x6209('0x32')]));_0x98f972[_0x6209('0x31')]=_0x98f972[_0x6209('0x31')][_0x6209('0x33')]?_0x98f972[_0x6209('0x31')]:_0x2df2aa[_0x6209('0x2c')];if(!_0x54466b['query'][_0x6209('0x34')](_0x6209('0x35'))){_0x98f972['limit']=qs['limit'](_0x54466b[_0x6209('0x2d')][_0x6209('0x17')]);_0x98f972[_0x6209('0x15')]=qs[_0x6209('0x15')](_0x54466b[_0x6209('0x2d')][_0x6209('0x15')]);}_0x98f972[_0x6209('0x36')]=qs[_0x6209('0x37')](_0x54466b[_0x6209('0x2d')][_0x6209('0x37')]);_0x98f972[_0x6209('0x38')]=qs[_0x6209('0x2f')](_['pick'](_0x54466b[_0x6209('0x2d')],_0x2df2aa['filters']),_0x7804e4);if(_0x54466b[_0x6209('0x2d')]['filter']){_0x98f972['where']=_['merge'](_0x98f972[_0x6209('0x38')],{'$or':_['map'](_0x7804e4,function(_0x7ad693){if(_0x7ad693['type']!==_0x6209('0x39')){var _0xc46342={};_0xc46342[_0x7ad693[_0x6209('0x25')]]={'$like':'%'+_0x54466b['query'][_0x6209('0x3a')]+'%'};return _0xc46342;}})});}_0x98f972=_[_0x6209('0x3b')]({},_0x98f972,_0x54466b[_0x6209('0x3c')]);var _0x1cd688={'where':_0x98f972[_0x6209('0x38')]};return db[_0x6209('0x29')][_0x6209('0x18')](_0x1cd688)[_0x6209('0x1f')](function(_0x505b3f){_0x3f562a['count']=_0x505b3f;if(_0x54466b[_0x6209('0x2d')][_0x6209('0x3d')]){_0x98f972[_0x6209('0x3e')]=[{'all':!![]}];}return db[_0x6209('0x29')][_0x6209('0x3f')](_0x98f972);})[_0x6209('0x1f')](function(_0x145c83){_0x3f562a['rows']=_0x145c83;return _0x3f562a;})['then'](respondWithFilteredResult(_0x11feee,_0x98f972))['catch'](handleError(_0x11feee,null));};exports[_0x6209('0x40')]=function(_0x3b050a,_0x130fd7){var _0x49c596={'raw':![],'where':{'id':_0x3b050a['params']['id']}},_0x10426b={};_0x10426b[_0x6209('0x2c')]=_[_0x6209('0x2e')](db[_0x6209('0x29')][_0x6209('0x2a')]);_0x10426b[_0x6209('0x2d')]=_['keys'](_0x3b050a[_0x6209('0x2d')]);_0x10426b[_0x6209('0x2f')]=_[_0x6209('0x30')](_0x10426b[_0x6209('0x2c')],_0x10426b[_0x6209('0x2d')]);_0x49c596[_0x6209('0x31')]=_[_0x6209('0x30')](_0x10426b[_0x6209('0x2c')],qs['fields'](_0x3b050a[_0x6209('0x2d')][_0x6209('0x32')]));_0x49c596[_0x6209('0x31')]=_0x49c596['attributes'][_0x6209('0x33')]?_0x49c596[_0x6209('0x31')]:_0x10426b[_0x6209('0x2c')];if(_0x3b050a[_0x6209('0x2d')][_0x6209('0x3d')]){_0x49c596[_0x6209('0x3e')]=[{'all':!![]}];}_0x49c596=_[_0x6209('0x3b')]({},_0x49c596,_0x3b050a[_0x6209('0x3c')]);return db['FreshsalesConfiguration'][_0x6209('0x41')](_0x49c596)[_0x6209('0x1f')](handleEntityNotFound(_0x130fd7,null))[_0x6209('0x1f')](respondWithResult(_0x130fd7,null))[_0x6209('0x42')](handleError(_0x130fd7,null));};exports[_0x6209('0x43')]=function(_0x52ffe4,_0x5426b9){return db['FreshsalesConfiguration'][_0x6209('0x43')](_0x52ffe4['body'],{})[_0x6209('0x1f')](respondWithResult(_0x5426b9,0xc9))[_0x6209('0x42')](handleError(_0x5426b9,null));};exports[_0x6209('0x1e')]=function(_0x47d8e5,_0x436068){if(_0x47d8e5[_0x6209('0x44')]['id']){delete _0x47d8e5['body']['id'];}return db[_0x6209('0x29')][_0x6209('0x41')]({'where':{'id':_0x47d8e5[_0x6209('0x45')]['id']}})[_0x6209('0x1f')](handleEntityNotFound(_0x436068,null))[_0x6209('0x1f')](saveUpdates(_0x47d8e5[_0x6209('0x44')],null))['then'](respondWithResult(_0x436068,null))['catch'](handleError(_0x436068,null));};exports['destroy']=function(_0x317274,_0x23b4ef){return db[_0x6209('0x29')][_0x6209('0x41')]({'where':{'id':_0x317274['params']['id']}})[_0x6209('0x1f')](handleEntityNotFound(_0x23b4ef,null))[_0x6209('0x1f')](removeEntity(_0x23b4ef,null))[_0x6209('0x42')](handleError(_0x23b4ef,null));};exports[_0x6209('0x46')]=function(_0xc69c72,_0x1af708,_0x3eed63){var _0x558028={};var _0x54588e={};var _0x494a53;var _0x594609;return db[_0x6209('0x29')][_0x6209('0x47')]({'where':{'id':_0xc69c72['params']['id']}})[_0x6209('0x1f')](handleEntityNotFound(_0x1af708,null))[_0x6209('0x1f')](function(_0x486be0){if(_0x486be0){_0x494a53=_0x486be0;_0x54588e[_0x6209('0x2c')]=_[_0x6209('0x2e')](db[_0x6209('0x48')][_0x6209('0x2a')]);_0x54588e[_0x6209('0x2d')]=_[_0x6209('0x2e')](_0xc69c72['query']);_0x54588e[_0x6209('0x2f')]=_[_0x6209('0x30')](_0x54588e['model'],_0x54588e[_0x6209('0x2d')]);_0x558028['attributes']=_[_0x6209('0x30')](_0x54588e['model'],qs['fields'](_0xc69c72[_0x6209('0x2d')][_0x6209('0x32')]));_0x558028[_0x6209('0x31')]=_0x558028['attributes'][_0x6209('0x33')]?_0x558028[_0x6209('0x31')]:_0x54588e[_0x6209('0x2c')];_0x558028[_0x6209('0x36')]=qs[_0x6209('0x37')](_0xc69c72[_0x6209('0x2d')][_0x6209('0x37')]);_0x558028['where']=qs[_0x6209('0x2f')](_[_0x6209('0x49')](_0xc69c72[_0x6209('0x2d')],_0x54588e[_0x6209('0x2f')]));if(_0xc69c72[_0x6209('0x2d')][_0x6209('0x3a')]){_0x558028[_0x6209('0x38')]=_[_0x6209('0x3b')](_0x558028[_0x6209('0x38')],{'$or':_[_0x6209('0x28')](_0x558028[_0x6209('0x31')],function(_0x24577c){var _0x54cd68={};_0x54cd68[_0x24577c]={'$like':'%'+_0xc69c72[_0x6209('0x2d')]['filter']+'%'};return _0x54cd68;})});}_0x558028=_[_0x6209('0x3b')]({},_0x558028,_0xc69c72[_0x6209('0x3c')]);return _0x494a53[_0x6209('0x46')](_0x558028);}})[_0x6209('0x1f')](function(_0x445327){if(_0x445327){_0x594609=_0x445327[_0x6209('0x33')];if(!_0xc69c72['query'][_0x6209('0x34')](_0x6209('0x35'))){_0x558028[_0x6209('0x17')]=qs[_0x6209('0x17')](_0xc69c72[_0x6209('0x2d')][_0x6209('0x17')]);_0x558028[_0x6209('0x15')]=qs[_0x6209('0x15')](_0xc69c72['query'][_0x6209('0x15')]);}return _0x494a53[_0x6209('0x46')](_0x558028);}})['then'](function(_0x499266){if(_0x499266){return _0x499266?{'count':_0x594609,'rows':_0x499266}:null;}})[_0x6209('0x1f')](respondWithResult(_0x1af708,null))[_0x6209('0x42')](handleError(_0x1af708,null));};exports[_0x6209('0x4a')]=function(_0x4aa1e6,_0x3c7b10,_0x22fd79){var _0xe269f8={};var _0x3714e6={};var _0x445cb6;var _0x157f32;return db[_0x6209('0x29')][_0x6209('0x47')]({'where':{'id':_0x4aa1e6['params']['id']}})['then'](handleEntityNotFound(_0x3c7b10,null))[_0x6209('0x1f')](function(_0x3750f3){if(_0x3750f3){_0x445cb6=_0x3750f3;_0x3714e6[_0x6209('0x2c')]=_['keys'](db['FreshsalesField'][_0x6209('0x2a')]);_0x3714e6[_0x6209('0x2d')]=_[_0x6209('0x2e')](_0x4aa1e6['query']);_0x3714e6['filters']=_[_0x6209('0x30')](_0x3714e6['model'],_0x3714e6['query']);_0xe269f8[_0x6209('0x31')]=_[_0x6209('0x30')](_0x3714e6[_0x6209('0x2c')],qs['fields'](_0x4aa1e6[_0x6209('0x2d')][_0x6209('0x32')]));_0xe269f8[_0x6209('0x31')]=_0xe269f8['attributes']['length']?_0xe269f8['attributes']:_0x3714e6['model'];_0xe269f8[_0x6209('0x36')]=qs[_0x6209('0x37')](_0x4aa1e6[_0x6209('0x2d')]['sort']);_0xe269f8[_0x6209('0x38')]=qs[_0x6209('0x2f')](_[_0x6209('0x49')](_0x4aa1e6['query'],_0x3714e6[_0x6209('0x2f')]));if(_0x4aa1e6['query'][_0x6209('0x3a')]){_0xe269f8[_0x6209('0x38')]=_[_0x6209('0x3b')](_0xe269f8[_0x6209('0x38')],{'$or':_[_0x6209('0x28')](_0xe269f8['attributes'],function(_0x52fc8e){var _0x4c5895={};_0x4c5895[_0x52fc8e]={'$like':'%'+_0x4aa1e6[_0x6209('0x2d')][_0x6209('0x3a')]+'%'};return _0x4c5895;})});}_0xe269f8=_[_0x6209('0x3b')]({},_0xe269f8,_0x4aa1e6[_0x6209('0x3c')]);return _0x445cb6[_0x6209('0x4a')](_0xe269f8);}})[_0x6209('0x1f')](function(_0x501468){if(_0x501468){_0x157f32=_0x501468[_0x6209('0x33')];if(!_0x4aa1e6[_0x6209('0x2d')][_0x6209('0x34')](_0x6209('0x35'))){_0xe269f8['limit']=qs[_0x6209('0x17')](_0x4aa1e6[_0x6209('0x2d')][_0x6209('0x17')]);_0xe269f8[_0x6209('0x15')]=qs[_0x6209('0x15')](_0x4aa1e6[_0x6209('0x2d')]['offset']);}return _0x445cb6[_0x6209('0x4a')](_0xe269f8);}})[_0x6209('0x1f')](function(_0x995693){if(_0x995693){return _0x995693?{'count':_0x157f32,'rows':_0x995693}:null;}})[_0x6209('0x1f')](respondWithResult(_0x3c7b10,null))[_0x6209('0x42')](handleError(_0x3c7b10,null));};exports[_0x6209('0x4b')]=function(_0x5f1413,_0x3edb5c,_0x54732c){var _0xfa32c3={};var _0x71071c={};var _0x3d1f94;var _0x4af095;return db[_0x6209('0x29')]['findOne']({'where':{'id':_0x5f1413['params']['id']}})[_0x6209('0x1f')](handleEntityNotFound(_0x3edb5c,null))[_0x6209('0x1f')](function(_0x517fa5){if(_0x517fa5){_0x3d1f94=_0x517fa5;_0x71071c[_0x6209('0x2c')]=_[_0x6209('0x2e')](db[_0x6209('0x48')][_0x6209('0x2a')]);_0x71071c['query']=_[_0x6209('0x2e')](_0x5f1413[_0x6209('0x2d')]);_0x71071c['filters']=_['intersection'](_0x71071c[_0x6209('0x2c')],_0x71071c[_0x6209('0x2d')]);_0xfa32c3[_0x6209('0x31')]=_[_0x6209('0x30')](_0x71071c['model'],qs['fields'](_0x5f1413[_0x6209('0x2d')][_0x6209('0x32')]));_0xfa32c3[_0x6209('0x31')]=_0xfa32c3[_0x6209('0x31')][_0x6209('0x33')]?_0xfa32c3[_0x6209('0x31')]:_0x71071c[_0x6209('0x2c')];_0xfa32c3[_0x6209('0x36')]=qs['sort'](_0x5f1413[_0x6209('0x2d')][_0x6209('0x37')]);_0xfa32c3[_0x6209('0x38')]=qs[_0x6209('0x2f')](_[_0x6209('0x49')](_0x5f1413[_0x6209('0x2d')],_0x71071c['filters']));if(_0x5f1413[_0x6209('0x2d')]['filter']){_0xfa32c3[_0x6209('0x38')]=_[_0x6209('0x3b')](_0xfa32c3['where'],{'$or':_['map'](_0xfa32c3[_0x6209('0x31')],function(_0x290c57){var _0x59c3fb={};_0x59c3fb[_0x290c57]={'$like':'%'+_0x5f1413[_0x6209('0x2d')][_0x6209('0x3a')]+'%'};return _0x59c3fb;})});}_0xfa32c3=_['merge']({},_0xfa32c3,_0x5f1413[_0x6209('0x3c')]);return _0x3d1f94[_0x6209('0x4b')](_0xfa32c3);}})[_0x6209('0x1f')](function(_0x343147){if(_0x343147){_0x4af095=_0x343147[_0x6209('0x33')];if(!_0x5f1413[_0x6209('0x2d')][_0x6209('0x34')](_0x6209('0x35'))){_0xfa32c3[_0x6209('0x17')]=qs[_0x6209('0x17')](_0x5f1413[_0x6209('0x2d')]['limit']);_0xfa32c3[_0x6209('0x15')]=qs['offset'](_0x5f1413[_0x6209('0x2d')][_0x6209('0x15')]);}return _0x3d1f94[_0x6209('0x4b')](_0xfa32c3);}})[_0x6209('0x1f')](function(_0x1f957c){if(_0x1f957c){return _0x1f957c?{'count':_0x4af095,'rows':_0x1f957c}:null;}})[_0x6209('0x1f')](respondWithResult(_0x3edb5c,null))[_0x6209('0x42')](handleError(_0x3edb5c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e8c5c6c..acaea52 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 _0xfc6f=['request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc6f,0xc5));var _0xffc6=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xfc6f[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xffc6('0x0'));var util=require('util');var logger=require(_0xffc6('0x1'))(_0xffc6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xffc6('0x3'));var fs=require('fs');var path=require(_0xffc6('0x4'));var rimraf=require('rimraf');var config=require(_0xffc6('0x5'));var attributes=require(_0xffc6('0x6'));module[_0xffc6('0x7')]=function(_0x4f04bc,_0x5b2c47){return _0x4f04bc[_0xffc6('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0xffc6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c8a=['define','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x36b005,_0x3e55b6){var _0x435f5e=function(_0x5c8639){while(--_0x5c8639){_0x36b005['push'](_0x36b005['shift']());}};_0x435f5e(++_0x3e55b6);}(_0x5c8a,0xf1));var _0xa5c8=function(_0x5c6648,_0x26d538){_0x5c6648=_0x5c6648-0x0;var _0x2942ef=_0x5c8a[_0x5c6648];return _0x2942ef;};'use strict';var _=require(_0xa5c8('0x0'));var util=require(_0xa5c8('0x1'));var logger=require('../../config/logger')(_0xa5c8('0x2'));var moment=require(_0xa5c8('0x3'));var BPromise=require(_0xa5c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5c8('0x5'));var rimraf=require(_0xa5c8('0x6'));var config=require(_0xa5c8('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xa5c8('0x8')]=function(_0x514a51,_0x1a73c9){return _0x514a51[_0xa5c8('0x9')]('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 5e60166..4169b2e 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 _0xebff=['info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xebff,0xc2));var _0xfebf=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xebff[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xfebf('0x0'));var util=require(_0xfebf('0x1'));var moment=require(_0xfebf('0x2'));var BPromise=require(_0xfebf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfebf('0x4'));var db=require(_0xfebf('0x5'))['db'];var utils=require(_0xfebf('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfebf('0x7'));var jayson=require(_0xfebf('0x8'));var client=jayson[_0xfebf('0x9')][_0xfebf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c91e6,_0x418709,_0x2c525b){return new BPromise(function(_0x2616ca,_0x542b90){return client[_0xfebf('0xb')](_0x2c91e6,_0x2c525b)[_0xfebf('0xc')](function(_0x181624){logger[_0xfebf('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x418709,_0xfebf('0xe'));logger[_0xfebf('0xf')](_0xfebf('0x10'),_0x418709,_0xfebf('0xe'),JSON[_0xfebf('0x11')](_0x181624));if(_0x181624[_0xfebf('0x12')]){if(_0x181624[_0xfebf('0x12')][_0xfebf('0x13')]===0x1f4){logger['error'](_0xfebf('0x14'),_0x418709,_0x181624['error'][_0xfebf('0x15')]);return _0x542b90(_0x181624[_0xfebf('0x12')][_0xfebf('0x15')]);}logger[_0xfebf('0x12')](_0xfebf('0x14'),_0x418709,_0x181624[_0xfebf('0x12')][_0xfebf('0x15')]);return _0x2616ca(_0x181624['error']['message']);}else{logger[_0xfebf('0xd')](_0xfebf('0x14'),_0x418709,_0xfebf('0xe'));_0x2616ca(_0x181624[_0xfebf('0x16')][_0xfebf('0x15')]);}})['catch'](function(_0x27bfb1){logger['error'](_0xfebf('0x14'),_0x418709,_0x27bfb1);_0x542b90(_0x27bfb1);});});} \ No newline at end of file +var _0x1d53=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','bluebird'];(function(_0x1a0d15,_0x424929){var _0x56fa73=function(_0x58bad7){while(--_0x58bad7){_0x1a0d15['push'](_0x1a0d15['shift']());}};_0x56fa73(++_0x424929);}(_0x1d53,0xe3));var _0x31d5=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x1d53[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x31d5('0x0'));var util=require(_0x31d5('0x1'));var moment=require('moment');var BPromise=require(_0x31d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31d5('0x3'));var db=require(_0x31d5('0x4'))['db'];var utils=require(_0x31d5('0x5'));var logger=require('../../config/logger')(_0x31d5('0x6'));var config=require(_0x31d5('0x7'));var jayson=require(_0x31d5('0x8'));var client=jayson[_0x31d5('0x9')][_0x31d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x769c93,_0x388f21,_0x374825){return new BPromise(function(_0xa8e014,_0x5413b0){return client[_0x31d5('0xb')](_0x769c93,_0x374825)[_0x31d5('0xc')](function(_0x4f1429){logger[_0x31d5('0xd')](_0x31d5('0xe'),_0x388f21,'request\x20sent');logger[_0x31d5('0xf')](_0x31d5('0x10'),_0x388f21,_0x31d5('0x11'),JSON['stringify'](_0x4f1429));if(_0x4f1429['error']){if(_0x4f1429['error'][_0x31d5('0x12')]===0x1f4){logger[_0x31d5('0x13')](_0x31d5('0xe'),_0x388f21,_0x4f1429['error'][_0x31d5('0x14')]);return _0x5413b0(_0x4f1429['error'][_0x31d5('0x14')]);}logger[_0x31d5('0x13')](_0x31d5('0xe'),_0x388f21,_0x4f1429[_0x31d5('0x13')][_0x31d5('0x14')]);return _0xa8e014(_0x4f1429['error'][_0x31d5('0x14')]);}else{logger[_0x31d5('0xd')](_0x31d5('0xe'),_0x388f21,_0x31d5('0x11'));_0xa8e014(_0x4f1429[_0x31d5('0x15')][_0x31d5('0x14')]);}})[_0x31d5('0x16')](function(_0x1744a4){logger[_0x31d5('0x13')](_0x31d5('0xe'),_0x388f21,_0x1744a4);_0x5413b0(_0x1744a4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 6717bc1..c5c1975 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 _0x524a=['create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','show'];(function(_0x52ea78,_0x4f7aad){var _0x1c855d=function(_0xf29a63){while(--_0xf29a63){_0x52ea78['push'](_0x52ea78['shift']());}};_0x1c855d(++_0x4f7aad);}(_0x524a,0xf5));var _0xa524=function(_0x2c3c52,_0x32e30a){_0x2c3c52=_0x2c3c52-0x0;var _0x8c445d=_0x524a[_0x2c3c52];return _0x8c445d;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xa')]);router['post']('/',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0xc')](_0xa524('0xd'),auth[_0xa524('0x9')](),controller['update']);router[_0xa524('0xe')](_0xa524('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa524('0xf')]=router; \ No newline at end of file +var _0x261b=['./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','multer','util','fs-extra','../../components/interaction/service'];(function(_0x37955c,_0x159287){var _0x4a01c0=function(_0x21c31b){while(--_0x21c31b){_0x37955c['push'](_0x37955c['shift']());}};_0x4a01c0(++_0x159287);}(_0x261b,0x15a));var _0xb261=function(_0xc111ab,_0xaea65b){_0xc111ab=_0xc111ab-0x0;var _0x237596=_0x261b[_0xc111ab];return _0x237596;};'use strict';var multer=require(_0xb261('0x0'));var util=require(_0xb261('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xb261('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb261('0x3'));var config=require('../../config/environment');var controller=require(_0xb261('0x4'));router['get']('/',auth[_0xb261('0x5')](),controller[_0xb261('0x6')]);router[_0xb261('0x7')](_0xb261('0x8'),auth['isAuthenticated'](),controller[_0xb261('0x9')]);router[_0xb261('0xa')]('/',auth[_0xb261('0x5')](),controller[_0xb261('0xb')]);router['put'](_0xb261('0x8'),auth[_0xb261('0x5')](),controller[_0xb261('0xc')]);router[_0xb261('0xd')](_0xb261('0x8'),auth[_0xb261('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 98240eb..8fcef80 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 _0x622f=['variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM','string'];(function(_0x224ad9,_0x5d97a7){var _0x532997=function(_0x323951){while(--_0x323951){_0x224ad9['push'](_0x224ad9['shift']());}};_0x532997(++_0x5d97a7);}(_0x622f,0x195));var _0xf622=function(_0x4c2055,_0x29fbeb){_0x4c2055=_0x4c2055-0x0;var _0x3b76e6=_0x622f[_0x4c2055];return _0x3b76e6;};'use strict';var Sequelize=require(_0xf622('0x0'));module['exports']={'type':{'type':Sequelize[_0xf622('0x1')](_0xf622('0x2'),_0xf622('0x3'),_0xf622('0x4'),_0xf622('0x5'),_0xf622('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf622('0x7')]},'key':{'type':Sequelize[_0xf622('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf622('0x2'),_0xf622('0x3'),_0xf622('0x4'))},'keyContent':{'type':Sequelize[_0xf622('0x7')]},'idField':{'type':Sequelize[_0xf622('0x7')]},'nameField':{'type':Sequelize[_0xf622('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7565=['sequelize','ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN'];(function(_0x3f4cd9,_0x4bd8d2){var _0xa19582=function(_0x293aa7){while(--_0x293aa7){_0x3f4cd9['push'](_0x3f4cd9['shift']());}};_0xa19582(++_0x4bd8d2);}(_0x7565,0x168));var _0x5756=function(_0x1365b2,_0x472f8b){_0x1365b2=_0x1365b2-0x0;var _0x44ffce=_0x7565[_0x1365b2];return _0x44ffce;};'use strict';var Sequelize=require(_0x5756('0x0'));module['exports']={'type':{'type':Sequelize[_0x5756('0x1')]('string',_0x5756('0x2'),_0x5756('0x3'),_0x5756('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5756('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5756('0x6'),_0x5756('0x2'),_0x5756('0x3'))},'keyContent':{'type':Sequelize[_0x5756('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5756('0x5')]},'customField':{'type':Sequelize[_0x5756('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5756('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 8bdbd40..a453543 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 _0xae2d=['reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x1b5d3f,_0x3d2c38){var _0x22b95b=function(_0x1d4ab0){while(--_0x1d4ab0){_0x1b5d3f['push'](_0x1b5d3f['shift']());}};_0x22b95b(++_0x3d2c38);}(_0xae2d,0x7a));var _0xdae2=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0xae2d[_0x4d05a0];return _0x4c999c;};'use strict';var emlformat=require(_0xdae2('0x0'));var rimraf=require(_0xdae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdae2('0x2'));var rp=require('request-promise');var moment=require(_0xdae2('0x3'));var BPromise=require(_0xdae2('0x4'));var Mustache=require(_0xdae2('0x5'));var util=require(_0xdae2('0x6'));var path=require(_0xdae2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdae2('0x8'));var fs=require('fs');var fs_extra=require(_0xdae2('0x9'));var _=require(_0xdae2('0xa'));var squel=require(_0xdae2('0xb'));var crypto=require(_0xdae2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdae2('0xd'));var toCsv=require(_0xdae2('0xe'));var querystring=require(_0xdae2('0xf'));var Papa=require(_0xdae2('0x10'));var Redis=require('ioredis');var authService=require(_0xdae2('0x11'));var qs=require(_0xdae2('0x12'));var as=require(_0xdae2('0x13'));var hardwareService=require(_0xdae2('0x14'));var logger=require(_0xdae2('0x15'))(_0xdae2('0x16'));var utils=require(_0xdae2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdae2('0x18'));var db=require(_0xdae2('0x19'))['db'];function respondWithStatusCode(_0x4f3a2c,_0x2fa950){_0x2fa950=_0x2fa950||0xcc;return function(_0x585209){if(_0x585209){return _0x4f3a2c[_0xdae2('0x1a')](_0x2fa950);}return _0x4f3a2c['status'](_0x2fa950)[_0xdae2('0x1b')]();};}function respondWithResult(_0x255bff,_0xe9dcbb){_0xe9dcbb=_0xe9dcbb||0xc8;return function(_0x3ec442){if(_0x3ec442){return _0x255bff[_0xdae2('0x1c')](_0xe9dcbb)[_0xdae2('0x1d')](_0x3ec442);}};}function respondWithFilteredResult(_0x4d8f85,_0x271c50){return function(_0x4d070e){if(_0x4d070e){var _0x4cc025=typeof _0x271c50[_0xdae2('0x1e')]===_0xdae2('0x1f')&&typeof _0x271c50['limit']===_0xdae2('0x1f');var _0x3c1d20=_0x4d070e['count'];var _0x27c256=_0x4cc025?0x0:_0x271c50[_0xdae2('0x1e')];var _0x4b7744=_0x4cc025?_0x4d070e['count']:_0x271c50[_0xdae2('0x1e')]+_0x271c50[_0xdae2('0x20')];var _0x2a6ccf;if(_0x4b7744>=_0x3c1d20){_0x4b7744=_0x3c1d20;_0x2a6ccf=0xc8;}else{_0x2a6ccf=0xce;}_0x4d8f85['status'](_0x2a6ccf);return _0x4d8f85[_0xdae2('0x21')](_0xdae2('0x22'),_0x27c256+'-'+_0x4b7744+'/'+_0x3c1d20)['json'](_0x4d070e);}return null;};}function patchUpdates(_0x3061dc){return function(_0x4fdfd6){try{jsonpatch[_0xdae2('0x23')](_0x4fdfd6,_0x3061dc,!![]);}catch(_0xc8f9db){return BPromise[_0xdae2('0x24')](_0xc8f9db);}return _0x4fdfd6[_0xdae2('0x25')]();};}function saveUpdates(_0x902f88,_0x54adbf){return function(_0x2bac28){if(_0x2bac28){return _0x2bac28[_0xdae2('0x26')](_0x902f88)[_0xdae2('0x27')](function(_0x35dbac){return _0x35dbac;});}return null;};}function removeEntity(_0x3ac525,_0x4fc1f1){return function(_0x8149b9){if(_0x8149b9){return _0x8149b9[_0xdae2('0x28')]()[_0xdae2('0x27')](function(){_0x3ac525[_0xdae2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa648,_0x43c3df){return function(_0x44116a){if(!_0x44116a){_0x1fa648[_0xdae2('0x1a')](0x194);}return _0x44116a;};}function handleError(_0x518fb0,_0x1e1560){_0x1e1560=_0x1e1560||0x1f4;return function(_0x5b3527){logger['error'](_0x5b3527[_0xdae2('0x29')]);if(_0x5b3527[_0xdae2('0x2a')]){delete _0x5b3527[_0xdae2('0x2a')];}_0x518fb0[_0xdae2('0x1c')](_0x1e1560)[_0xdae2('0x2b')](_0x5b3527);};}exports[_0xdae2('0x2c')]=function(_0x3f3d96,_0x1ac5bd){var _0x826235={},_0x191e4d={},_0x5043d2={'count':0x0,'rows':[]};var _0x592cae=_[_0xdae2('0x2d')](db[_0xdae2('0x2e')][_0xdae2('0x2f')],function(_0x2fa191){return{'name':_0x2fa191[_0xdae2('0x30')],'type':_0x2fa191[_0xdae2('0x31')][_0xdae2('0x32')]};});_0x191e4d[_0xdae2('0x33')]=_[_0xdae2('0x2d')](_0x592cae,_0xdae2('0x2a'));_0x191e4d[_0xdae2('0x34')]=_[_0xdae2('0x35')](_0x3f3d96[_0xdae2('0x34')]);_0x191e4d[_0xdae2('0x36')]=_[_0xdae2('0x37')](_0x191e4d['model'],_0x191e4d[_0xdae2('0x34')]);_0x826235[_0xdae2('0x38')]=_[_0xdae2('0x37')](_0x191e4d[_0xdae2('0x33')],qs[_0xdae2('0x39')](_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x39')]));_0x826235[_0xdae2('0x38')]=_0x826235[_0xdae2('0x38')][_0xdae2('0x3a')]?_0x826235[_0xdae2('0x38')]:_0x191e4d[_0xdae2('0x33')];if(!_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x3b')](_0xdae2('0x3c'))){_0x826235[_0xdae2('0x20')]=qs['limit'](_0x3f3d96[_0xdae2('0x34')]['limit']);_0x826235[_0xdae2('0x1e')]=qs[_0xdae2('0x1e')](_0x3f3d96[_0xdae2('0x34')]['offset']);}_0x826235['order']=qs[_0xdae2('0x3d')](_0x3f3d96[_0xdae2('0x34')]['sort']);_0x826235[_0xdae2('0x3e')]=qs['filters'](_[_0xdae2('0x3f')](_0x3f3d96[_0xdae2('0x34')],_0x191e4d[_0xdae2('0x36')]),_0x592cae);if(_0x3f3d96[_0xdae2('0x34')]['filter']){_0x826235[_0xdae2('0x3e')]=_[_0xdae2('0x40')](_0x826235[_0xdae2('0x3e')],{'$or':_[_0xdae2('0x2d')](_0x592cae,function(_0x21f8fd){if(_0x21f8fd['type']!==_0xdae2('0x41')){var _0x332e72={};_0x332e72[_0x21f8fd[_0xdae2('0x2a')]]={'$like':'%'+_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x42')]+'%'};return _0x332e72;}})});}_0x826235=_[_0xdae2('0x40')]({},_0x826235,_0x3f3d96['options']);var _0x4bdd20={'where':_0x826235[_0xdae2('0x3e')]};return db['FreshsalesField'][_0xdae2('0x43')](_0x4bdd20)[_0xdae2('0x27')](function(_0x1feb43){_0x5043d2[_0xdae2('0x43')]=_0x1feb43;if(_0x3f3d96[_0xdae2('0x34')][_0xdae2('0x44')]){_0x826235[_0xdae2('0x45')]=[{'all':!![]}];}return db[_0xdae2('0x2e')][_0xdae2('0x46')](_0x826235);})[_0xdae2('0x27')](function(_0x4dbd0d){_0x5043d2[_0xdae2('0x47')]=_0x4dbd0d;return _0x5043d2;})[_0xdae2('0x27')](respondWithFilteredResult(_0x1ac5bd,_0x826235))['catch'](handleError(_0x1ac5bd,null));};exports[_0xdae2('0x48')]=function(_0x2e122e,_0x4b7d15){var _0x4be18b={'raw':!![],'where':{'id':_0x2e122e[_0xdae2('0x49')]['id']}},_0x1a3fda={};_0x1a3fda['model']=_['keys'](db[_0xdae2('0x2e')][_0xdae2('0x2f')]);_0x1a3fda[_0xdae2('0x34')]=_[_0xdae2('0x35')](_0x2e122e[_0xdae2('0x34')]);_0x1a3fda[_0xdae2('0x36')]=_[_0xdae2('0x37')](_0x1a3fda[_0xdae2('0x33')],_0x1a3fda[_0xdae2('0x34')]);_0x4be18b[_0xdae2('0x38')]=_[_0xdae2('0x37')](_0x1a3fda['model'],qs[_0xdae2('0x39')](_0x2e122e['query'][_0xdae2('0x39')]));_0x4be18b[_0xdae2('0x38')]=_0x4be18b['attributes'][_0xdae2('0x3a')]?_0x4be18b[_0xdae2('0x38')]:_0x1a3fda[_0xdae2('0x33')];if(_0x2e122e[_0xdae2('0x34')][_0xdae2('0x44')]){_0x4be18b['include']=[{'all':!![]}];}_0x4be18b=_['merge']({},_0x4be18b,_0x2e122e[_0xdae2('0x4a')]);return db[_0xdae2('0x2e')]['find'](_0x4be18b)['then'](handleEntityNotFound(_0x4b7d15,null))['then'](respondWithResult(_0x4b7d15,null))[_0xdae2('0x4b')](handleError(_0x4b7d15,null));};exports[_0xdae2('0x4c')]=function(_0x36c8bd,_0x131765){return db['FreshsalesField'][_0xdae2('0x4c')](_0x36c8bd[_0xdae2('0x4d')],{})[_0xdae2('0x27')](respondWithResult(_0x131765,0xc9))[_0xdae2('0x4b')](handleError(_0x131765,null));};exports[_0xdae2('0x26')]=function(_0x1ae51b,_0x2d4651){if(_0x1ae51b[_0xdae2('0x4d')]['id']){delete _0x1ae51b['body']['id'];}return db[_0xdae2('0x2e')][_0xdae2('0x4e')]({'where':{'id':_0x1ae51b[_0xdae2('0x49')]['id']}})[_0xdae2('0x27')](handleEntityNotFound(_0x2d4651,null))[_0xdae2('0x27')](saveUpdates(_0x1ae51b[_0xdae2('0x4d')],null))[_0xdae2('0x27')](respondWithResult(_0x2d4651,null))[_0xdae2('0x4b')](handleError(_0x2d4651,null));};exports[_0xdae2('0x28')]=function(_0x4d2b94,_0x2ddc3d){return db['FreshsalesField']['find']({'where':{'id':_0x4d2b94[_0xdae2('0x49')]['id']}})[_0xdae2('0x27')](handleEntityNotFound(_0x2ddc3d,null))[_0xdae2('0x27')](removeEntity(_0x2ddc3d,null))['catch'](handleError(_0x2ddc3d,null));}; \ No newline at end of file +var _0xd115=['status','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','merge','VIRTUAL','filter','where','includeAll','include','FreshsalesField','rows','show','params','keys','length','options','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x3ba833,_0x14c847){var _0x4ce730=function(_0x1c1dee){while(--_0x1c1dee){_0x3ba833['push'](_0x3ba833['shift']());}};_0x4ce730(++_0x14c847);}(_0xd115,0xfa));var _0x5d11=function(_0x228789,_0x2b6185){_0x228789=_0x228789-0x0;var _0x3c3a6e=_0xd115[_0x228789];return _0x3c3a6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d11('0x0'));var zipdir=require(_0x5d11('0x1'));var jsonpatch=require(_0x5d11('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5d11('0x3'));var Mustache=require(_0x5d11('0x4'));var util=require(_0x5d11('0x5'));var path=require(_0x5d11('0x6'));var sox=require(_0x5d11('0x7'));var csv=require(_0x5d11('0x8'));var ejs=require(_0x5d11('0x9'));var fs=require('fs');var fs_extra=require(_0x5d11('0xa'));var _=require(_0x5d11('0xb'));var squel=require(_0x5d11('0xc'));var crypto=require(_0x5d11('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5d11('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5d11('0xf'));var Papa=require(_0x5d11('0x10'));var Redis=require('ioredis');var authService=require(_0x5d11('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5d11('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d11('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5d11('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d11('0x15'))['db'];function respondWithStatusCode(_0x48eefc,_0x33ac96){_0x33ac96=_0x33ac96||0xcc;return function(_0x4933ca){if(_0x4933ca){return _0x48eefc['sendStatus'](_0x33ac96);}return _0x48eefc[_0x5d11('0x16')](_0x33ac96)['end']();};}function respondWithResult(_0x32f926,_0x5b8932){_0x5b8932=_0x5b8932||0xc8;return function(_0x2b3328){if(_0x2b3328){return _0x32f926[_0x5d11('0x16')](_0x5b8932)[_0x5d11('0x17')](_0x2b3328);}};}function respondWithFilteredResult(_0x2ece9f,_0x131d35){return function(_0x2968dc){if(_0x2968dc){var _0x484457=typeof _0x131d35['offset']==='undefined'&&typeof _0x131d35[_0x5d11('0x18')]===_0x5d11('0x19');var _0x2243f7=_0x2968dc['count'];var _0x3ae9ab=_0x484457?0x0:_0x131d35['offset'];var _0x5de211=_0x484457?_0x2968dc[_0x5d11('0x1a')]:_0x131d35[_0x5d11('0x1b')]+_0x131d35[_0x5d11('0x18')];var _0x7e5168;if(_0x5de211>=_0x2243f7){_0x5de211=_0x2243f7;_0x7e5168=0xc8;}else{_0x7e5168=0xce;}_0x2ece9f[_0x5d11('0x16')](_0x7e5168);return _0x2ece9f[_0x5d11('0x1c')](_0x5d11('0x1d'),_0x3ae9ab+'-'+_0x5de211+'/'+_0x2243f7)[_0x5d11('0x17')](_0x2968dc);}return null;};}function patchUpdates(_0x4dc7ff){return function(_0x376d3a){try{jsonpatch[_0x5d11('0x1e')](_0x376d3a,_0x4dc7ff,!![]);}catch(_0x9656ac){return BPromise['reject'](_0x9656ac);}return _0x376d3a['save']();};}function saveUpdates(_0x27718c,_0x1f47e7){return function(_0x3047ce){if(_0x3047ce){return _0x3047ce[_0x5d11('0x1f')](_0x27718c)[_0x5d11('0x20')](function(_0xf538e0){return _0xf538e0;});}return null;};}function removeEntity(_0x54a491,_0x410928){return function(_0x16fce0){if(_0x16fce0){return _0x16fce0[_0x5d11('0x21')]()[_0x5d11('0x20')](function(){_0x54a491[_0x5d11('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20cb68,_0x4c6631){return function(_0x20f261){if(!_0x20f261){_0x20cb68[_0x5d11('0x22')](0x194);}return _0x20f261;};}function handleError(_0x471b69,_0x282e1f){_0x282e1f=_0x282e1f||0x1f4;return function(_0x36d2a4){logger['error'](_0x36d2a4[_0x5d11('0x23')]);if(_0x36d2a4['name']){delete _0x36d2a4[_0x5d11('0x24')];}_0x471b69['status'](_0x282e1f)[_0x5d11('0x25')](_0x36d2a4);};}exports[_0x5d11('0x26')]=function(_0xafb9bf,_0x401da1){var _0x3d4bc5={},_0x31208e={},_0x2f03cf={'count':0x0,'rows':[]};var _0xcaa956=_[_0x5d11('0x27')](db['FreshsalesField'][_0x5d11('0x28')],function(_0x588bb8){return{'name':_0x588bb8['fieldName'],'type':_0x588bb8[_0x5d11('0x29')][_0x5d11('0x2a')]};});_0x31208e[_0x5d11('0x2b')]=_[_0x5d11('0x27')](_0xcaa956,_0x5d11('0x24'));_0x31208e[_0x5d11('0x2c')]=_['keys'](_0xafb9bf[_0x5d11('0x2c')]);_0x31208e[_0x5d11('0x2d')]=_['intersection'](_0x31208e[_0x5d11('0x2b')],_0x31208e['query']);_0x3d4bc5[_0x5d11('0x2e')]=_[_0x5d11('0x2f')](_0x31208e[_0x5d11('0x2b')],qs[_0x5d11('0x30')](_0xafb9bf['query'][_0x5d11('0x30')]));_0x3d4bc5[_0x5d11('0x2e')]=_0x3d4bc5[_0x5d11('0x2e')]['length']?_0x3d4bc5[_0x5d11('0x2e')]:_0x31208e[_0x5d11('0x2b')];if(!_0xafb9bf['query'][_0x5d11('0x31')]('nolimit')){_0x3d4bc5[_0x5d11('0x18')]=qs[_0x5d11('0x18')](_0xafb9bf[_0x5d11('0x2c')]['limit']);_0x3d4bc5[_0x5d11('0x1b')]=qs[_0x5d11('0x1b')](_0xafb9bf[_0x5d11('0x2c')][_0x5d11('0x1b')]);}_0x3d4bc5[_0x5d11('0x32')]=qs['sort'](_0xafb9bf[_0x5d11('0x2c')][_0x5d11('0x33')]);_0x3d4bc5['where']=qs['filters'](_['pick'](_0xafb9bf[_0x5d11('0x2c')],_0x31208e[_0x5d11('0x2d')]),_0xcaa956);if(_0xafb9bf[_0x5d11('0x2c')]['filter']){_0x3d4bc5['where']=_[_0x5d11('0x34')](_0x3d4bc5['where'],{'$or':_[_0x5d11('0x27')](_0xcaa956,function(_0xff730b){if(_0xff730b[_0x5d11('0x29')]!==_0x5d11('0x35')){var _0x131bf2={};_0x131bf2[_0xff730b[_0x5d11('0x24')]]={'$like':'%'+_0xafb9bf[_0x5d11('0x2c')][_0x5d11('0x36')]+'%'};return _0x131bf2;}})});}_0x3d4bc5=_[_0x5d11('0x34')]({},_0x3d4bc5,_0xafb9bf['options']);var _0x3979d8={'where':_0x3d4bc5[_0x5d11('0x37')]};return db['FreshsalesField'][_0x5d11('0x1a')](_0x3979d8)[_0x5d11('0x20')](function(_0x549daf){_0x2f03cf[_0x5d11('0x1a')]=_0x549daf;if(_0xafb9bf['query'][_0x5d11('0x38')]){_0x3d4bc5[_0x5d11('0x39')]=[{'all':!![]}];}return db[_0x5d11('0x3a')]['findAll'](_0x3d4bc5);})[_0x5d11('0x20')](function(_0x1d3186){_0x2f03cf[_0x5d11('0x3b')]=_0x1d3186;return _0x2f03cf;})[_0x5d11('0x20')](respondWithFilteredResult(_0x401da1,_0x3d4bc5))['catch'](handleError(_0x401da1,null));};exports[_0x5d11('0x3c')]=function(_0x9af2af,_0x1989b7){var _0x1bd88d={'raw':!![],'where':{'id':_0x9af2af[_0x5d11('0x3d')]['id']}},_0x99340a={};_0x99340a[_0x5d11('0x2b')]=_['keys'](db[_0x5d11('0x3a')][_0x5d11('0x28')]);_0x99340a['query']=_[_0x5d11('0x3e')](_0x9af2af[_0x5d11('0x2c')]);_0x99340a[_0x5d11('0x2d')]=_[_0x5d11('0x2f')](_0x99340a[_0x5d11('0x2b')],_0x99340a[_0x5d11('0x2c')]);_0x1bd88d[_0x5d11('0x2e')]=_[_0x5d11('0x2f')](_0x99340a['model'],qs[_0x5d11('0x30')](_0x9af2af['query'][_0x5d11('0x30')]));_0x1bd88d[_0x5d11('0x2e')]=_0x1bd88d[_0x5d11('0x2e')][_0x5d11('0x3f')]?_0x1bd88d['attributes']:_0x99340a['model'];if(_0x9af2af[_0x5d11('0x2c')][_0x5d11('0x38')]){_0x1bd88d['include']=[{'all':!![]}];}_0x1bd88d=_[_0x5d11('0x34')]({},_0x1bd88d,_0x9af2af[_0x5d11('0x40')]);return db[_0x5d11('0x3a')]['find'](_0x1bd88d)[_0x5d11('0x20')](handleEntityNotFound(_0x1989b7,null))[_0x5d11('0x20')](respondWithResult(_0x1989b7,null))[_0x5d11('0x41')](handleError(_0x1989b7,null));};exports[_0x5d11('0x42')]=function(_0x20afa2,_0x365ffd){return db[_0x5d11('0x3a')][_0x5d11('0x42')](_0x20afa2['body'],{})[_0x5d11('0x20')](respondWithResult(_0x365ffd,0xc9))[_0x5d11('0x41')](handleError(_0x365ffd,null));};exports[_0x5d11('0x1f')]=function(_0x4a9c10,_0x2d4487){if(_0x4a9c10[_0x5d11('0x43')]['id']){delete _0x4a9c10['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x4a9c10['params']['id']}})[_0x5d11('0x20')](handleEntityNotFound(_0x2d4487,null))[_0x5d11('0x20')](saveUpdates(_0x4a9c10[_0x5d11('0x43')],null))['then'](respondWithResult(_0x2d4487,null))['catch'](handleError(_0x2d4487,null));};exports[_0x5d11('0x21')]=function(_0x205bba,_0x36296a){return db[_0x5d11('0x3a')]['find']({'where':{'id':_0x205bba['params']['id']}})['then'](handleEntityNotFound(_0x36296a,null))[_0x5d11('0x20')](removeEntity(_0x36296a,null))[_0x5d11('0x41')](handleError(_0x36296a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e0ea251..d42e424 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 _0xd4dc=['freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields'];(function(_0x55894,_0x261874){var _0x4c52c6=function(_0x2cc10f){while(--_0x2cc10f){_0x55894['push'](_0x55894['shift']());}};_0x4c52c6(++_0x261874);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xd4dc[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xcd4d('0x0'));var util=require('util');var logger=require(_0xcd4d('0x1'))(_0xcd4d('0x2'));var moment=require(_0xcd4d('0x3'));var BPromise=require(_0xcd4d('0x4'));var rp=require(_0xcd4d('0x5'));var fs=require('fs');var path=require(_0xcd4d('0x6'));var rimraf=require(_0xcd4d('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd4d('0x8'));module['exports']=function(_0x5d70fb,_0x3c5bbd){return _0x5d70fb['define'](_0xcd4d('0x9'),attributes,{'tableName':_0xcd4d('0xa'),'paranoid':![],'indexes':[{'name':_0xcd4d('0xb'),'fields':[_0xcd4d('0xc'),_0xcd4d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f81=['FreshsalesField','freshsales_unique_index','idField','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define'];(function(_0x4212d3,_0x2847f2){var _0x264985=function(_0x4c6d7f){while(--_0x4c6d7f){_0x4212d3['push'](_0x4212d3['shift']());}};_0x264985(++_0x2847f2);}(_0x4f81,0x1e3));var _0x14f8=function(_0x5e04da,_0x413926){_0x5e04da=_0x5e04da-0x0;var _0x5512c5=_0x4f81[_0x5e04da];return _0x5512c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x14f8('0x0'))('api');var moment=require(_0x14f8('0x1'));var BPromise=require(_0x14f8('0x2'));var rp=require(_0x14f8('0x3'));var fs=require('fs');var path=require(_0x14f8('0x4'));var rimraf=require(_0x14f8('0x5'));var config=require(_0x14f8('0x6'));var attributes=require(_0x14f8('0x7'));module['exports']=function(_0x33baf0,_0x510822){return _0x33baf0[_0x14f8('0x8')](_0x14f8('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x14f8('0xa'),'fields':[_0x14f8('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 5fcf5f1..0fea25a 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 _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x24fcf0,_0x4f970d){var _0x1894e0=function(_0x48c656){while(--_0x48c656){_0x24fcf0['push'](_0x24fcf0['shift']());}};_0x1894e0(++_0x4f970d);}(_0x2a07,0x74));var _0x72a0=function(_0x56039b,_0x3de8d8){_0x56039b=_0x56039b-0x0;var _0xc90792=_0x2a07[_0x56039b];return _0xc90792;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});} \ No newline at end of file +var _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xd117,0x182));var _0x7d11=function(_0x1612e9,_0x272ff8){_0x1612e9=_0x1612e9-0x0;var _0x5a39fd=_0xd117[_0x1612e9];return _0x5a39fd;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 24974ed..62c07f3 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xcd9042,_0x1cf707){var _0x144abb=function(_0x10fe00){while(--_0x10fe00){_0xcd9042['push'](_0xcd9042['shift']());}};_0x144abb(++_0x1cf707);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _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(_0x364129,_0x32e0e3){var _0x53acc7=function(_0xc52234){while(--_0xc52234){_0x364129['push'](_0x364129['shift']());}};_0x53acc7(++_0x32e0e3);}(_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 e661c4a..a8debf3 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 _0xce14=['ENUM','integrationTab','newTab','exports','STRING'];(function(_0x1ea338,_0x3d1e80){var _0x414a11=function(_0x55257c){while(--_0x55257c){_0x1ea338['push'](_0x1ea338['shift']());}};_0x414a11(++_0x3d1e80);}(_0xce14,0x17f));var _0x4ce1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xce14[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x4ce1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ce1('0x1')]},'username':{'type':Sequelize[_0x4ce1('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4ce1('0x1')]},'password':{'type':Sequelize[_0x4ce1('0x1')]},'clientId':{'type':Sequelize[_0x4ce1('0x1')]},'clientSecret':{'type':Sequelize[_0x4ce1('0x1')]},'securityToken':{'type':Sequelize[_0x4ce1('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4ce1('0x2')](_0x4ce1('0x3'),_0x4ce1('0x4')),'defaultValue':_0x4ce1('0x3')}}; \ No newline at end of file +var _0x58c9=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0xdd0cc6,_0x24dab2){var _0x2ad54c=function(_0x2f21d6){while(--_0x2f21d6){_0xdd0cc6['push'](_0xdd0cc6['shift']());}};_0x2ad54c(++_0x24dab2);}(_0x58c9,0x1bc));var _0x958c=function(_0x1bcc3e,_0x4e9a8b){_0x1bcc3e=_0x1bcc3e-0x0;var _0x3e42dd=_0x58c9[_0x1bcc3e];return _0x3e42dd;};'use strict';var Sequelize=require(_0x958c('0x0'));module[_0x958c('0x1')]={'name':{'type':Sequelize[_0x958c('0x2')]},'description':{'type':Sequelize[_0x958c('0x2')]},'username':{'type':Sequelize[_0x958c('0x2')],'unique':_0x958c('0x3')},'remoteUri':{'type':Sequelize[_0x958c('0x2')]},'password':{'type':Sequelize[_0x958c('0x2')]},'clientId':{'type':Sequelize[_0x958c('0x2')]},'clientSecret':{'type':Sequelize[_0x958c('0x2')]},'securityToken':{'type':Sequelize[_0x958c('0x2')]},'serverUrl':{'type':Sequelize[_0x958c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x958c('0x4')]('integrationTab',_0x958c('0x5')),'defaultValue':_0x958c('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index a80cc79..36ba11c 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 _0xd81c=['destroy','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','Task','findOne','remoteUri','clientId','clientSecret','password','slice','substring','lastIndexOf','Connection','login','username','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','picklistValues','value','True','False','false','test','statusCode','getFields','stringify','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then'];(function(_0x313097,_0x2f6730){var _0x3b431a=function(_0x43ab2a){while(--_0x43ab2a){_0x313097['push'](_0x313097['shift']());}};_0x3b431a(++_0x2f6730);}(_0xd81c,0xdc));var _0xcd81=function(_0x54bc76,_0x4d0664){_0x54bc76=_0x54bc76-0x0;var _0x58a457=_0xd81c[_0x54bc76];return _0x58a457;};'use strict';var emlformat=require(_0xcd81('0x0'));var rimraf=require(_0xcd81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd81('0x2'));var rp=require('request-promise');var moment=require(_0xcd81('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcd81('0x4'));var path=require(_0xcd81('0x5'));var sox=require(_0xcd81('0x6'));var csv=require(_0xcd81('0x7'));var ejs=require(_0xcd81('0x8'));var fs=require('fs');var fs_extra=require(_0xcd81('0x9'));var _=require(_0xcd81('0xa'));var squel=require(_0xcd81('0xb'));var crypto=require(_0xcd81('0xc'));var jsforce=require(_0xcd81('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd81('0xe'));var Papa=require(_0xcd81('0xf'));var Redis=require(_0xcd81('0x10'));var authService=require(_0xcd81('0x11'));var qs=require(_0xcd81('0x12'));var as=require(_0xcd81('0x13'));var hardwareService=require(_0xcd81('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcd81('0x15'));var db=require(_0xcd81('0x16'))['db'];var integrations=require(_0xcd81('0x17'));function respondWithStatusCode(_0x22f864,_0x162a4f){_0x162a4f=_0x162a4f||0xcc;return function(_0x3bb82d){if(_0x3bb82d){return _0x22f864[_0xcd81('0x18')](_0x162a4f);}return _0x22f864[_0xcd81('0x19')](_0x162a4f)[_0xcd81('0x1a')]();};}function respondWithResult(_0x25e2a1,_0x5b2656){_0x5b2656=_0x5b2656||0xc8;return function(_0x24461e){if(_0x24461e){return _0x25e2a1['status'](_0x5b2656)['json'](_0x24461e);}};}function respondWithFilteredResult(_0x9d3074,_0x5f2226){return function(_0x55713c){if(_0x55713c){var _0x4fc54b=typeof _0x5f2226[_0xcd81('0x1b')]===_0xcd81('0x1c')&&typeof _0x5f2226[_0xcd81('0x1d')]==='undefined';var _0x261455=_0x55713c['count'];var _0x25295e=_0x4fc54b?0x0:_0x5f2226[_0xcd81('0x1b')];var _0x2e80df=_0x4fc54b?_0x55713c[_0xcd81('0x1e')]:_0x5f2226[_0xcd81('0x1b')]+_0x5f2226[_0xcd81('0x1d')];var _0x3049af;if(_0x2e80df>=_0x261455){_0x2e80df=_0x261455;_0x3049af=0xc8;}else{_0x3049af=0xce;}_0x9d3074[_0xcd81('0x19')](_0x3049af);return _0x9d3074[_0xcd81('0x1f')](_0xcd81('0x20'),_0x25295e+'-'+_0x2e80df+'/'+_0x261455)[_0xcd81('0x21')](_0x55713c);}return null;};}function patchUpdates(_0x548d56){return function(_0x2889ef){try{jsonpatch[_0xcd81('0x22')](_0x2889ef,_0x548d56,!![]);}catch(_0x4b7807){return BPromise[_0xcd81('0x23')](_0x4b7807);}return _0x2889ef[_0xcd81('0x24')]();};}function saveUpdates(_0xbda687,_0x41c14d){return function(_0x109b01){if(_0x109b01){return _0x109b01['update'](_0xbda687)[_0xcd81('0x25')](function(_0x39c54c){return _0x39c54c;});}return null;};}function removeEntity(_0x77fb8a,_0x228db4){return function(_0x17714c){if(_0x17714c){return _0x17714c[_0xcd81('0x26')]()[_0xcd81('0x25')](function(){_0x77fb8a[_0xcd81('0x19')](0xcc)[_0xcd81('0x1a')]();});}};}function handleEntityNotFound(_0xd6c21a,_0x31b416){return function(_0x1664de){if(!_0x1664de){_0xd6c21a[_0xcd81('0x18')](0x194);}return _0x1664de;};}function handleError(_0x59f3c9,_0x16619e){_0x16619e=_0x16619e||0x1f4;return function(_0x46e697){logger[_0xcd81('0x27')](_0x46e697['stack']);if(_0x46e697[_0xcd81('0x28')]){delete _0x46e697['name'];}_0x59f3c9[_0xcd81('0x19')](_0x16619e)[_0xcd81('0x29')](_0x46e697);};}exports[_0xcd81('0x2a')]=function(_0x187b11,_0x34d4d1){var _0x1a1ce8={},_0x4c02ac={},_0x2df92f={'count':0x0,'rows':[]};var _0x3945aa=_[_0xcd81('0x2b')](db[_0xcd81('0x2c')][_0xcd81('0x2d')],function(_0x47bb39){return{'name':_0x47bb39[_0xcd81('0x2e')],'type':_0x47bb39[_0xcd81('0x2f')][_0xcd81('0x30')]};});_0x4c02ac[_0xcd81('0x31')]=_[_0xcd81('0x2b')](_0x3945aa,_0xcd81('0x28'));_0x4c02ac[_0xcd81('0x32')]=_[_0xcd81('0x33')](_0x187b11[_0xcd81('0x32')]);_0x4c02ac['filters']=_[_0xcd81('0x34')](_0x4c02ac['model'],_0x4c02ac[_0xcd81('0x32')]);_0x1a1ce8[_0xcd81('0x35')]=_[_0xcd81('0x34')](_0x4c02ac['model'],qs[_0xcd81('0x36')](_0x187b11[_0xcd81('0x32')]['fields']));_0x1a1ce8[_0xcd81('0x35')]=_0x1a1ce8[_0xcd81('0x35')]['length']?_0x1a1ce8[_0xcd81('0x35')]:_0x4c02ac[_0xcd81('0x31')];if(!_0x187b11[_0xcd81('0x32')]['hasOwnProperty'](_0xcd81('0x37'))){_0x1a1ce8[_0xcd81('0x1d')]=qs[_0xcd81('0x1d')](_0x187b11[_0xcd81('0x32')][_0xcd81('0x1d')]);_0x1a1ce8[_0xcd81('0x1b')]=qs[_0xcd81('0x1b')](_0x187b11['query'][_0xcd81('0x1b')]);}_0x1a1ce8[_0xcd81('0x38')]=qs['sort'](_0x187b11['query'][_0xcd81('0x39')]);_0x1a1ce8[_0xcd81('0x3a')]=qs[_0xcd81('0x3b')](_[_0xcd81('0x3c')](_0x187b11[_0xcd81('0x32')],_0x4c02ac[_0xcd81('0x3b')]),_0x3945aa);if(_0x187b11[_0xcd81('0x32')][_0xcd81('0x3d')]){_0x1a1ce8[_0xcd81('0x3a')]=_['merge'](_0x1a1ce8[_0xcd81('0x3a')],{'$or':_[_0xcd81('0x2b')](_0x3945aa,function(_0x21528e){if(_0x21528e['type']!==_0xcd81('0x3e')){var _0x3e1934={};_0x3e1934[_0x21528e[_0xcd81('0x28')]]={'$like':'%'+_0x187b11['query']['filter']+'%'};return _0x3e1934;}})});}_0x1a1ce8=_[_0xcd81('0x3f')]({},_0x1a1ce8,_0x187b11[_0xcd81('0x40')]);var _0x2825ab={'where':_0x1a1ce8[_0xcd81('0x3a')]};return db[_0xcd81('0x2c')][_0xcd81('0x1e')](_0x2825ab)[_0xcd81('0x25')](function(_0x3a2754){_0x2df92f[_0xcd81('0x1e')]=_0x3a2754;if(_0x187b11[_0xcd81('0x32')][_0xcd81('0x41')]){_0x1a1ce8[_0xcd81('0x42')]=[{'all':!![]}];}return db[_0xcd81('0x2c')][_0xcd81('0x43')](_0x1a1ce8);})[_0xcd81('0x25')](function(_0x4f3634){_0x2df92f[_0xcd81('0x44')]=_0x4f3634;return _0x2df92f;})[_0xcd81('0x25')](respondWithFilteredResult(_0x34d4d1,_0x1a1ce8))[_0xcd81('0x45')](handleError(_0x34d4d1,null));};exports[_0xcd81('0x46')]=function(_0x18459c,_0x1dadf5){var _0x135567={'raw':![],'where':{'id':_0x18459c[_0xcd81('0x47')]['id']}},_0x478138={};_0x478138['model']=_[_0xcd81('0x33')](db['SalesforceAccount'][_0xcd81('0x2d')]);_0x478138['query']=_[_0xcd81('0x33')](_0x18459c[_0xcd81('0x32')]);_0x478138['filters']=_[_0xcd81('0x34')](_0x478138[_0xcd81('0x31')],_0x478138['query']);_0x135567[_0xcd81('0x35')]=_[_0xcd81('0x34')](_0x478138['model'],qs[_0xcd81('0x36')](_0x18459c[_0xcd81('0x32')]['fields']));_0x135567['attributes']=_0x135567[_0xcd81('0x35')][_0xcd81('0x48')]?_0x135567[_0xcd81('0x35')]:_0x478138[_0xcd81('0x31')];if(_0x18459c[_0xcd81('0x32')][_0xcd81('0x41')]){_0x135567[_0xcd81('0x42')]=[{'all':!![]}];}_0x135567=_['merge']({},_0x135567,_0x18459c[_0xcd81('0x40')]);return db[_0xcd81('0x2c')][_0xcd81('0x49')](_0x135567)[_0xcd81('0x25')](handleEntityNotFound(_0x1dadf5,null))[_0xcd81('0x25')](respondWithResult(_0x1dadf5,null))[_0xcd81('0x45')](handleError(_0x1dadf5,null));};exports[_0xcd81('0x4a')]=function(_0x3b15ce,_0x18cd23){return db[_0xcd81('0x2c')][_0xcd81('0x4a')](_0x3b15ce[_0xcd81('0x4b')],{})['then'](respondWithResult(_0x18cd23,0xc9))[_0xcd81('0x45')](handleError(_0x18cd23,null));};exports[_0xcd81('0x4c')]=function(_0xe33c08,_0x1762b2){if(_0xe33c08[_0xcd81('0x4b')]['id']){delete _0xe33c08[_0xcd81('0x4b')]['id'];}return db[_0xcd81('0x2c')][_0xcd81('0x49')]({'where':{'id':_0xe33c08[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x1762b2,null))[_0xcd81('0x25')](saveUpdates(_0xe33c08[_0xcd81('0x4b')],null))[_0xcd81('0x25')](respondWithResult(_0x1762b2,null))['catch'](handleError(_0x1762b2,null));};exports[_0xcd81('0x26')]=function(_0x4f287f,_0x3e6a9f){return db[_0xcd81('0x2c')][_0xcd81('0x49')]({'where':{'id':_0x4f287f[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x3e6a9f,null))[_0xcd81('0x25')](removeEntity(_0x3e6a9f,null))[_0xcd81('0x45')](handleError(_0x3e6a9f,null));};exports[_0xcd81('0x4d')]=function(_0x4169a4,_0x547926,_0x2bbc49){var _0x30d77b={};var _0x46563c={};var _0x259223;var _0x37442e;return db[_0xcd81('0x2c')]['findOne']({'where':{'id':_0x4169a4[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x547926,null))[_0xcd81('0x25')](function(_0x56615a){if(_0x56615a){_0x259223=_0x56615a;_0x46563c[_0xcd81('0x31')]=_[_0xcd81('0x33')](db['SalesforceConfiguration']['rawAttributes']);_0x46563c[_0xcd81('0x32')]=_[_0xcd81('0x33')](_0x4169a4[_0xcd81('0x32')]);_0x46563c[_0xcd81('0x3b')]=_['intersection'](_0x46563c[_0xcd81('0x31')],_0x46563c[_0xcd81('0x32')]);_0x30d77b['attributes']=_['intersection'](_0x46563c['model'],qs[_0xcd81('0x36')](_0x4169a4[_0xcd81('0x32')][_0xcd81('0x36')]));_0x30d77b[_0xcd81('0x35')]=_0x30d77b[_0xcd81('0x35')][_0xcd81('0x48')]?_0x30d77b[_0xcd81('0x35')]:_0x46563c[_0xcd81('0x31')];_0x30d77b['order']=qs[_0xcd81('0x39')](_0x4169a4[_0xcd81('0x32')]['sort']);_0x30d77b[_0xcd81('0x3a')]=qs[_0xcd81('0x3b')](_['pick'](_0x4169a4[_0xcd81('0x32')],_0x46563c[_0xcd81('0x3b')]));if(_0x4169a4[_0xcd81('0x32')][_0xcd81('0x3d')]){_0x30d77b[_0xcd81('0x3a')]=_[_0xcd81('0x3f')](_0x30d77b['where'],{'$or':_['map'](_0x30d77b['attributes'],function(_0x2502be){var _0x2ca801={};_0x2ca801[_0x2502be]={'$like':'%'+_0x4169a4[_0xcd81('0x32')]['filter']+'%'};return _0x2ca801;})});}_0x30d77b=_['merge']({},_0x30d77b,_0x4169a4[_0xcd81('0x40')]);return _0x259223['getConfigurations'](_0x30d77b);}})[_0xcd81('0x25')](function(_0x59db11){if(_0x59db11){_0x37442e=_0x59db11[_0xcd81('0x48')];if(!_0x4169a4[_0xcd81('0x32')][_0xcd81('0x4e')]('nolimit')){_0x30d77b[_0xcd81('0x1d')]=qs[_0xcd81('0x1d')](_0x4169a4[_0xcd81('0x32')][_0xcd81('0x1d')]);_0x30d77b[_0xcd81('0x1b')]=qs[_0xcd81('0x1b')](_0x4169a4[_0xcd81('0x32')][_0xcd81('0x1b')]);}return _0x259223[_0xcd81('0x4d')](_0x30d77b);}})[_0xcd81('0x25')](function(_0x4e806a){if(_0x4e806a){return _0x4e806a?{'count':_0x37442e,'rows':_0x4e806a}:null;}})[_0xcd81('0x25')](respondWithResult(_0x547926,null))[_0xcd81('0x45')](handleError(_0x547926,null));};exports[_0xcd81('0x4f')]=function(_0xdf9e30,_0x4cf169,_0x2f8445){if(_0xdf9e30[_0xcd81('0x4b')]['id']){delete _0xdf9e30[_0xcd81('0x4b')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0xdf9e30[_0xcd81('0x47')]['id']}})[_0xcd81('0x25')](handleEntityNotFound(_0x4cf169,null))[_0xcd81('0x25')](function(_0x530647){if(_0x530647){_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x50')]=_0x530647['id'];_0xdf9e30['body'][_0xcd81('0x51')]=integrations[_0xcd81('0x52')](_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x53')],_0xdf9e30['body'][_0xcd81('0x2f')]);_0xdf9e30[_0xcd81('0x4b')]['Descriptions']=integrations[_0xcd81('0x54')](_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x53')],_0xdf9e30[_0xcd81('0x4b')][_0xcd81('0x2f')]);return db[_0xcd81('0x55')][_0xcd81('0x4a')](_0xdf9e30[_0xcd81('0x4b')],{'include':[{'model':db[_0xcd81('0x56')],'as':_0xcd81('0x51')},{'model':db[_0xcd81('0x56')],'as':_0xcd81('0x57')}]});}return null;})[_0xcd81('0x25')](respondWithResult(_0x4cf169,null))[_0xcd81('0x45')](handleError(_0x4cf169,null));};exports['getFields']=function(_0x222f18,_0x2b4d9a,_0x2c07e0){var _0x1d3e89;var _0x238c22='';var _0x2a642e=_0xcd81('0x58');return db['SalesforceAccount'][_0xcd81('0x59')]({'where':{'id':_0x222f18['params']['id']},'attributes':['id',_0xcd81('0x5a'),_0xcd81('0x5b'),_0xcd81('0x5c'),'username',_0xcd81('0x5d'),'securityToken']})[_0xcd81('0x25')](handleEntityNotFound(_0x2b4d9a,null))['then'](function(_0x5bb490){if(_0x5bb490){_0x238c22=_0x5bb490[_0xcd81('0x5a')];var _0xd7b3cc=_0x238c22[_0xcd81('0x5e')](-0x1);if(_0xd7b3cc==='/'){_0x238c22=_0x238c22[_0xcd81('0x5f')](0x0,_0x238c22[_0xcd81('0x60')](_0xd7b3cc));}_0x1d3e89=new jsforce[(_0xcd81('0x61'))]({'oauth2':{'loginUrl':_0x238c22,'clientId':_0x5bb490[_0xcd81('0x5b')],'clientSecret':_0x5bb490[_0xcd81('0x5c')]}});return _0x1d3e89[_0xcd81('0x62')](_0x5bb490[_0xcd81('0x63')],_0x5bb490['password'][_0xcd81('0x64')](_0x5bb490[_0xcd81('0x65')]));}})[_0xcd81('0x25')](function(_0x49ce68){if(_0x49ce68){if(!_[_0xcd81('0x66')](_0x222f18[_0xcd81('0x32')][_0xcd81('0x67')])){_0x2a642e=_0x222f18[_0xcd81('0x32')][_0xcd81('0x67')];}return _0x1d3e89[_0xcd81('0x68')](_0x2a642e)[_0xcd81('0x69')]();}})[_0xcd81('0x25')](function(_0x21ac27){var _0x17913d=[_0xcd81('0x6a'),_0xcd81('0x6b'),_0xcd81('0x6c'),'IsRecurrence',_0xcd81('0x6d'),'Description'];var _0x27fd41=[_0xcd81('0x6e'),_0xcd81('0x6f'),_0xcd81('0x70'),_0xcd81('0x71'),_0xcd81('0x72'),_0xcd81('0x73'),_0xcd81('0x74')];if(_0x21ac27){_[_0xcd81('0x75')](_0x21ac27[_0xcd81('0x36')],function(_0x4167a8){return _0x17913d[_0xcd81('0x76')](_0x4167a8['name'])||!_0x27fd41[_0xcd81('0x76')](_0x4167a8[_0xcd81('0x2f')]);});return{'count':_0x21ac27[_0xcd81('0x36')]['length'],'rows':_['map'](_0x21ac27['fields'],function(_0x169751){return{'id':_0x169751[_0xcd81('0x28')],'name':_0x169751[_0xcd81('0x77')],'custom':_0x169751['custom'],'options':_0x169751[_0xcd81('0x78')][_0xcd81('0x48')]>0x0?_[_0xcd81('0x2b')](_0x169751[_0xcd81('0x78')],function(_0xc4ed25){return{'name':_0xc4ed25[_0xcd81('0x77')],'value':_0xc4ed25[_0xcd81('0x79')]};}):_0x169751[_0xcd81('0x2f')]=='boolean'?[{'name':_0xcd81('0x7a'),'value':'true'},{'name':_0xcd81('0x7b'),'value':_0xcd81('0x7c')}]:[]};})};}})[_0xcd81('0x25')](respondWithResult(_0x2b4d9a,null))[_0xcd81('0x45')](function(_0x150e32){var _0x127b1f=_0x222f18[_0xcd81('0x32')][_0xcd81('0x7d')]?0x1f4:_0x150e32[_0xcd81('0x7e')]||0x1f4;logger[_0xcd81('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xcd81('0x7f'),_0x127b1f,JSON[_0xcd81('0x80')](_0x150e32));delete _0x150e32[_0xcd81('0x28')];if(_0x127b1f===0x191){_0x127b1f=0x190;}_0x2b4d9a[_0xcd81('0x19')](_0x127b1f)[_0xcd81('0x29')](_0x222f18[_0xcd81('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x150e32[_0xcd81('0x7e')]}:_0x150e32);});}; \ No newline at end of file +var _0x7949=['fast-json-patch','request-promise','bluebird','mustache','util','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','api','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','error','name','send','map','SalesforceAccount','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','getConfigurations','params','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','SalesforceField','Descriptions','getFields','Task','findOne','clientSecret','username','securityToken','remoteUri','substring','Connection','clientId','password','sobject','describe','OwnerId','IsReminderSet','Description','string','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x115af3,_0x2171fe){var _0x3fa136=function(_0x49f4ef){while(--_0x49f4ef){_0x115af3['push'](_0x115af3['shift']());}};_0x3fa136(++_0x2171fe);}(_0x7949,0x1cd));var _0x9794=function(_0x164255,_0x1536fe){_0x164255=_0x164255-0x0;var _0x4d97e4=_0x7949[_0x164255];return _0x4d97e4;};'use strict';var emlformat=require(_0x9794('0x0'));var rimraf=require(_0x9794('0x1'));var zipdir=require(_0x9794('0x2'));var jsonpatch=require(_0x9794('0x3'));var rp=require(_0x9794('0x4'));var moment=require('moment');var BPromise=require(_0x9794('0x5'));var Mustache=require(_0x9794('0x6'));var util=require(_0x9794('0x7'));var path=require('path');var sox=require(_0x9794('0x8'));var csv=require(_0x9794('0x9'));var ejs=require(_0x9794('0xa'));var fs=require('fs');var fs_extra=require(_0x9794('0xb'));var _=require(_0x9794('0xc'));var squel=require(_0x9794('0xd'));var crypto=require(_0x9794('0xe'));var jsforce=require(_0x9794('0xf'));var deskjs=require(_0x9794('0x10'));var toCsv=require(_0x9794('0x9'));var querystring=require(_0x9794('0x11'));var Papa=require(_0x9794('0x12'));var Redis=require('ioredis');var authService=require(_0x9794('0x13'));var qs=require(_0x9794('0x14'));var as=require(_0x9794('0x15'));var hardwareService=require(_0x9794('0x16'));var logger=require('../../config/logger')(_0x9794('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9794('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3447d5,_0x1c045f){_0x1c045f=_0x1c045f||0xcc;return function(_0x18ac75){if(_0x18ac75){return _0x3447d5[_0x9794('0x19')](_0x1c045f);}return _0x3447d5['status'](_0x1c045f)[_0x9794('0x1a')]();};}function respondWithResult(_0x51f21d,_0x4c2316){_0x4c2316=_0x4c2316||0xc8;return function(_0x8937bd){if(_0x8937bd){return _0x51f21d[_0x9794('0x1b')](_0x4c2316)[_0x9794('0x1c')](_0x8937bd);}};}function respondWithFilteredResult(_0xbc7949,_0x1d17d8){return function(_0x255304){if(_0x255304){var _0x5c751f=typeof _0x1d17d8[_0x9794('0x1d')]===_0x9794('0x1e')&&typeof _0x1d17d8[_0x9794('0x1f')]===_0x9794('0x1e');var _0x21ff3b=_0x255304['count'];var _0x575fa2=_0x5c751f?0x0:_0x1d17d8[_0x9794('0x1d')];var _0x21c958=_0x5c751f?_0x255304['count']:_0x1d17d8['offset']+_0x1d17d8['limit'];var _0x3f9fe7;if(_0x21c958>=_0x21ff3b){_0x21c958=_0x21ff3b;_0x3f9fe7=0xc8;}else{_0x3f9fe7=0xce;}_0xbc7949[_0x9794('0x1b')](_0x3f9fe7);return _0xbc7949[_0x9794('0x20')]('Content-Range',_0x575fa2+'-'+_0x21c958+'/'+_0x21ff3b)[_0x9794('0x1c')](_0x255304);}return null;};}function patchUpdates(_0x3f7ae7){return function(_0x420bd3){try{jsonpatch[_0x9794('0x21')](_0x420bd3,_0x3f7ae7,!![]);}catch(_0x29f49f){return BPromise[_0x9794('0x22')](_0x29f49f);}return _0x420bd3[_0x9794('0x23')]();};}function saveUpdates(_0x235228,_0x2c5c90){return function(_0x1a5dd5){if(_0x1a5dd5){return _0x1a5dd5[_0x9794('0x24')](_0x235228)['then'](function(_0x5dd018){return _0x5dd018;});}return null;};}function removeEntity(_0x56709a,_0x4285d7){return function(_0x2ad697){if(_0x2ad697){return _0x2ad697[_0x9794('0x25')]()[_0x9794('0x26')](function(){_0x56709a['status'](0xcc)[_0x9794('0x1a')]();});}};}function handleEntityNotFound(_0x1ef6ee,_0x32cbe6){return function(_0x359a12){if(!_0x359a12){_0x1ef6ee[_0x9794('0x19')](0x194);}return _0x359a12;};}function handleError(_0xf002e9,_0x2f53d5){_0x2f53d5=_0x2f53d5||0x1f4;return function(_0x286720){logger[_0x9794('0x27')](_0x286720['stack']);if(_0x286720[_0x9794('0x28')]){delete _0x286720[_0x9794('0x28')];}_0xf002e9[_0x9794('0x1b')](_0x2f53d5)[_0x9794('0x29')](_0x286720);};}exports['index']=function(_0xe3c11e,_0x7f629d){var _0x3e31ad={},_0x168f9d={},_0x3122ae={'count':0x0,'rows':[]};var _0x20d295=_[_0x9794('0x2a')](db[_0x9794('0x2b')]['rawAttributes'],function(_0x29cd3f){return{'name':_0x29cd3f['fieldName'],'type':_0x29cd3f['type'][_0x9794('0x2c')]};});_0x168f9d['model']=_[_0x9794('0x2a')](_0x20d295,_0x9794('0x28'));_0x168f9d[_0x9794('0x2d')]=_[_0x9794('0x2e')](_0xe3c11e[_0x9794('0x2d')]);_0x168f9d[_0x9794('0x2f')]=_[_0x9794('0x30')](_0x168f9d[_0x9794('0x31')],_0x168f9d[_0x9794('0x2d')]);_0x3e31ad[_0x9794('0x32')]=_[_0x9794('0x30')](_0x168f9d[_0x9794('0x31')],qs[_0x9794('0x33')](_0xe3c11e[_0x9794('0x2d')][_0x9794('0x33')]));_0x3e31ad['attributes']=_0x3e31ad[_0x9794('0x32')][_0x9794('0x34')]?_0x3e31ad['attributes']:_0x168f9d[_0x9794('0x31')];if(!_0xe3c11e[_0x9794('0x2d')][_0x9794('0x35')](_0x9794('0x36'))){_0x3e31ad[_0x9794('0x1f')]=qs[_0x9794('0x1f')](_0xe3c11e[_0x9794('0x2d')]['limit']);_0x3e31ad[_0x9794('0x1d')]=qs[_0x9794('0x1d')](_0xe3c11e[_0x9794('0x2d')][_0x9794('0x1d')]);}_0x3e31ad[_0x9794('0x37')]=qs[_0x9794('0x38')](_0xe3c11e[_0x9794('0x2d')][_0x9794('0x38')]);_0x3e31ad['where']=qs[_0x9794('0x2f')](_['pick'](_0xe3c11e[_0x9794('0x2d')],_0x168f9d['filters']),_0x20d295);if(_0xe3c11e[_0x9794('0x2d')]['filter']){_0x3e31ad['where']=_[_0x9794('0x39')](_0x3e31ad[_0x9794('0x3a')],{'$or':_['map'](_0x20d295,function(_0x124758){if(_0x124758[_0x9794('0x3b')]!==_0x9794('0x3c')){var _0x4421a5={};_0x4421a5[_0x124758[_0x9794('0x28')]]={'$like':'%'+_0xe3c11e[_0x9794('0x2d')][_0x9794('0x3d')]+'%'};return _0x4421a5;}})});}_0x3e31ad=_[_0x9794('0x39')]({},_0x3e31ad,_0xe3c11e[_0x9794('0x3e')]);var _0x1f8bd7={'where':_0x3e31ad[_0x9794('0x3a')]};return db[_0x9794('0x2b')]['count'](_0x1f8bd7)[_0x9794('0x26')](function(_0x538d80){_0x3122ae[_0x9794('0x3f')]=_0x538d80;if(_0xe3c11e[_0x9794('0x2d')][_0x9794('0x40')]){_0x3e31ad[_0x9794('0x41')]=[{'all':!![]}];}return db[_0x9794('0x2b')][_0x9794('0x42')](_0x3e31ad);})['then'](function(_0x452ce4){_0x3122ae[_0x9794('0x43')]=_0x452ce4;return _0x3122ae;})[_0x9794('0x26')](respondWithFilteredResult(_0x7f629d,_0x3e31ad))[_0x9794('0x44')](handleError(_0x7f629d,null));};exports['show']=function(_0x3708de,_0x2b6b46){var _0x31085c={'raw':![],'where':{'id':_0x3708de['params']['id']}},_0x9ce29c={};_0x9ce29c[_0x9794('0x31')]=_[_0x9794('0x2e')](db[_0x9794('0x2b')][_0x9794('0x45')]);_0x9ce29c['query']=_[_0x9794('0x2e')](_0x3708de[_0x9794('0x2d')]);_0x9ce29c[_0x9794('0x2f')]=_[_0x9794('0x30')](_0x9ce29c[_0x9794('0x31')],_0x9ce29c[_0x9794('0x2d')]);_0x31085c[_0x9794('0x32')]=_[_0x9794('0x30')](_0x9ce29c[_0x9794('0x31')],qs[_0x9794('0x33')](_0x3708de['query'][_0x9794('0x33')]));_0x31085c['attributes']=_0x31085c[_0x9794('0x32')]['length']?_0x31085c['attributes']:_0x9ce29c[_0x9794('0x31')];if(_0x3708de[_0x9794('0x2d')][_0x9794('0x40')]){_0x31085c['include']=[{'all':!![]}];}_0x31085c=_[_0x9794('0x39')]({},_0x31085c,_0x3708de['options']);return db[_0x9794('0x2b')][_0x9794('0x46')](_0x31085c)['then'](handleEntityNotFound(_0x2b6b46,null))[_0x9794('0x26')](respondWithResult(_0x2b6b46,null))['catch'](handleError(_0x2b6b46,null));};exports[_0x9794('0x47')]=function(_0x141898,_0xbf178d){return db[_0x9794('0x2b')][_0x9794('0x47')](_0x141898['body'],{})['then'](respondWithResult(_0xbf178d,0xc9))[_0x9794('0x44')](handleError(_0xbf178d,null));};exports[_0x9794('0x24')]=function(_0x2e847a,_0x100a3a){if(_0x2e847a[_0x9794('0x48')]['id']){delete _0x2e847a[_0x9794('0x48')]['id'];}return db[_0x9794('0x2b')][_0x9794('0x46')]({'where':{'id':_0x2e847a['params']['id']}})[_0x9794('0x26')](handleEntityNotFound(_0x100a3a,null))[_0x9794('0x26')](saveUpdates(_0x2e847a['body'],null))[_0x9794('0x26')](respondWithResult(_0x100a3a,null))[_0x9794('0x44')](handleError(_0x100a3a,null));};exports[_0x9794('0x25')]=function(_0x40da8a,_0x547a4f){return db['SalesforceAccount']['find']({'where':{'id':_0x40da8a['params']['id']}})[_0x9794('0x26')](handleEntityNotFound(_0x547a4f,null))[_0x9794('0x26')](removeEntity(_0x547a4f,null))[_0x9794('0x44')](handleError(_0x547a4f,null));};exports[_0x9794('0x49')]=function(_0x51d4cb,_0x5a45a9,_0x2ea46a){var _0x1098c9={};var _0xc81929={};var _0x79f89c;var _0x49607b;return db[_0x9794('0x2b')]['findOne']({'where':{'id':_0x51d4cb[_0x9794('0x4a')]['id']}})[_0x9794('0x26')](handleEntityNotFound(_0x5a45a9,null))[_0x9794('0x26')](function(_0xa07ce1){if(_0xa07ce1){_0x79f89c=_0xa07ce1;_0xc81929['model']=_[_0x9794('0x2e')](db[_0x9794('0x4b')][_0x9794('0x45')]);_0xc81929[_0x9794('0x2d')]=_['keys'](_0x51d4cb[_0x9794('0x2d')]);_0xc81929[_0x9794('0x2f')]=_[_0x9794('0x30')](_0xc81929[_0x9794('0x31')],_0xc81929[_0x9794('0x2d')]);_0x1098c9[_0x9794('0x32')]=_[_0x9794('0x30')](_0xc81929[_0x9794('0x31')],qs[_0x9794('0x33')](_0x51d4cb[_0x9794('0x2d')]['fields']));_0x1098c9['attributes']=_0x1098c9['attributes'][_0x9794('0x34')]?_0x1098c9[_0x9794('0x32')]:_0xc81929[_0x9794('0x31')];_0x1098c9[_0x9794('0x37')]=qs[_0x9794('0x38')](_0x51d4cb[_0x9794('0x2d')][_0x9794('0x38')]);_0x1098c9[_0x9794('0x3a')]=qs[_0x9794('0x2f')](_[_0x9794('0x4c')](_0x51d4cb['query'],_0xc81929[_0x9794('0x2f')]));if(_0x51d4cb[_0x9794('0x2d')][_0x9794('0x3d')]){_0x1098c9[_0x9794('0x3a')]=_['merge'](_0x1098c9[_0x9794('0x3a')],{'$or':_[_0x9794('0x2a')](_0x1098c9['attributes'],function(_0x8fdb61){var _0x50c050={};_0x50c050[_0x8fdb61]={'$like':'%'+_0x51d4cb['query'][_0x9794('0x3d')]+'%'};return _0x50c050;})});}_0x1098c9=_['merge']({},_0x1098c9,_0x51d4cb['options']);return _0x79f89c[_0x9794('0x49')](_0x1098c9);}})[_0x9794('0x26')](function(_0x348cdb){if(_0x348cdb){_0x49607b=_0x348cdb['length'];if(!_0x51d4cb[_0x9794('0x2d')][_0x9794('0x35')]('nolimit')){_0x1098c9[_0x9794('0x1f')]=qs[_0x9794('0x1f')](_0x51d4cb[_0x9794('0x2d')][_0x9794('0x1f')]);_0x1098c9['offset']=qs[_0x9794('0x1d')](_0x51d4cb[_0x9794('0x2d')][_0x9794('0x1d')]);}return _0x79f89c['getConfigurations'](_0x1098c9);}})[_0x9794('0x26')](function(_0x152cbb){if(_0x152cbb){return _0x152cbb?{'count':_0x49607b,'rows':_0x152cbb}:null;}})[_0x9794('0x26')](respondWithResult(_0x5a45a9,null))[_0x9794('0x44')](handleError(_0x5a45a9,null));};exports[_0x9794('0x4d')]=function(_0x312db1,_0x39b59e,_0x309621){if(_0x312db1['body']['id']){delete _0x312db1[_0x9794('0x48')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x312db1[_0x9794('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39b59e,null))[_0x9794('0x26')](function(_0x48b060){if(_0x48b060){_0x312db1[_0x9794('0x48')][_0x9794('0x4e')]=_0x48b060['id'];_0x312db1[_0x9794('0x48')][_0x9794('0x4f')]=integrations['getSubjects'](_0x312db1['body']['channel'],_0x312db1[_0x9794('0x48')][_0x9794('0x3b')]);_0x312db1[_0x9794('0x48')]['Descriptions']=integrations['getDescriptions'](_0x312db1[_0x9794('0x48')]['channel'],_0x312db1[_0x9794('0x48')][_0x9794('0x3b')]);return db['SalesforceConfiguration']['create'](_0x312db1[_0x9794('0x48')],{'include':[{'model':db['SalesforceField'],'as':_0x9794('0x4f')},{'model':db[_0x9794('0x50')],'as':_0x9794('0x51')}]});}return null;})['then'](respondWithResult(_0x39b59e,null))['catch'](handleError(_0x39b59e,null));};exports[_0x9794('0x52')]=function(_0x431eaa,_0x3f440f,_0x31ee2c){var _0x5270d5;var _0x479065='';var _0x15f754=_0x9794('0x53');return db['SalesforceAccount'][_0x9794('0x54')]({'where':{'id':_0x431eaa['params']['id']},'attributes':['id','remoteUri','clientId',_0x9794('0x55'),_0x9794('0x56'),'password',_0x9794('0x57')]})[_0x9794('0x26')](handleEntityNotFound(_0x3f440f,null))[_0x9794('0x26')](function(_0x3d885f){if(_0x3d885f){_0x479065=_0x3d885f[_0x9794('0x58')];var _0xce0bed=_0x479065['slice'](-0x1);if(_0xce0bed==='/'){_0x479065=_0x479065[_0x9794('0x59')](0x0,_0x479065['lastIndexOf'](_0xce0bed));}_0x5270d5=new jsforce[(_0x9794('0x5a'))]({'oauth2':{'loginUrl':_0x479065,'clientId':_0x3d885f[_0x9794('0x5b')],'clientSecret':_0x3d885f['clientSecret']}});return _0x5270d5['login'](_0x3d885f[_0x9794('0x56')],_0x3d885f[_0x9794('0x5c')]['concat'](_0x3d885f['securityToken']));}})['then'](function(_0x2d6a32){if(_0x2d6a32){if(!_['isNil'](_0x431eaa['query']['ticketType'])){_0x15f754=_0x431eaa['query']['ticketType'];}return _0x5270d5[_0x9794('0x5d')](_0x15f754)[_0x9794('0x5e')]();}})[_0x9794('0x26')](function(_0x5b8c9d){var _0x28158a=[_0x9794('0x5f'),'ActivityDate',_0x9794('0x60'),'IsRecurrence','Subject',_0x9794('0x61')];var _0x1bc1b9=[_0x9794('0x62'),'int','picklist',_0x9794('0x63'),_0x9794('0x64'),_0x9794('0x65'),_0x9794('0x66')];if(_0x5b8c9d){_[_0x9794('0x67')](_0x5b8c9d[_0x9794('0x33')],function(_0x472388){return _0x28158a[_0x9794('0x68')](_0x472388[_0x9794('0x28')])||!_0x1bc1b9[_0x9794('0x68')](_0x472388[_0x9794('0x3b')]);});return{'count':_0x5b8c9d[_0x9794('0x33')][_0x9794('0x34')],'rows':_[_0x9794('0x2a')](_0x5b8c9d[_0x9794('0x33')],function(_0x34ae52){return{'id':_0x34ae52[_0x9794('0x28')],'name':_0x34ae52['label'],'custom':_0x34ae52[_0x9794('0x69')],'options':_0x34ae52[_0x9794('0x6a')][_0x9794('0x34')]>0x0?_['map'](_0x34ae52[_0x9794('0x6a')],function(_0x4fd120){return{'name':_0x4fd120[_0x9794('0x6b')],'value':_0x4fd120[_0x9794('0x6c')]};}):_0x34ae52[_0x9794('0x3b')]==_0x9794('0x63')?[{'name':'True','value':_0x9794('0x6d')},{'name':'False','value':_0x9794('0x6e')}]:[]};})};}})[_0x9794('0x26')](respondWithResult(_0x3f440f,null))[_0x9794('0x44')](function(_0x469e42){var _0x26b4c0=_0x431eaa['query']['test']?0x1f4:_0x469e42[_0x9794('0x6f')]||0x1f4;logger[_0x9794('0x27')](_0x9794('0x70'),_0x9794('0x52'),_0x26b4c0,JSON[_0x9794('0x71')](_0x469e42));delete _0x469e42[_0x9794('0x28')];if(_0x26b4c0===0x191){_0x26b4c0=0x190;}_0x3f440f[_0x9794('0x1b')](_0x26b4c0)[_0x9794('0x29')](_0x431eaa[_0x9794('0x2d')][_0x9794('0x72')]?{'message':_0x9794('0x73'),'statusCode':_0x469e42[_0x9794('0x6f')]}:_0x469e42);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 30c927d..34e5f13 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 _0xa916=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0xa916,0x1ec));var _0x6a91=function(_0x460f6f,_0x31347a){_0x460f6f=_0x460f6f-0x0;var _0x318d14=_0xa916[_0x460f6f];return _0x318d14;};'use strict';var _=require(_0x6a91('0x0'));var util=require(_0x6a91('0x1'));var logger=require('../../config/logger')(_0x6a91('0x2'));var moment=require(_0x6a91('0x3'));var BPromise=require(_0x6a91('0x4'));var rp=require(_0x6a91('0x5'));var fs=require('fs');var path=require(_0x6a91('0x6'));var rimraf=require(_0x6a91('0x7'));var config=require(_0x6a91('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x6a91('0x9'));module['exports']=function(_0x2f970e,_0x56057f){return _0x2f970e['define'](_0x6a91('0xa'),attributes,{'tableName':_0x6a91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fad=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts'];(function(_0x418fc2,_0x43db26){var _0x1377f3=function(_0x34a3f0){while(--_0x34a3f0){_0x418fc2['push'](_0x418fc2['shift']());}};_0x1377f3(++_0x43db26);}(_0x6fad,0x174));var _0xd6fa=function(_0x28b3aa,_0x352f31){_0x28b3aa=_0x28b3aa-0x0;var _0x2332fb=_0x6fad[_0x28b3aa];return _0x2332fb;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var logger=require(_0xd6fa('0x2'))(_0xd6fa('0x3'));var moment=require('moment');var BPromise=require(_0xd6fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6fa('0x5'));var rimraf=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var attributes=require(_0xd6fa('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd6fa('0x9')]=function(_0x329390,_0x291bd5){return _0x329390[_0xd6fa('0xa')]('SalesforceAccount',attributes,{'tableName':_0xd6fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index ccf122f..e6549c8 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 _0x0127=['find','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowSalesforceAccount'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x0127,0x1c1));var _0x7012=function(_0x48aeff,_0x18d7c5){_0x48aeff=_0x48aeff-0x0;var _0x131d32=_0x0127[_0x48aeff];return _0x131d32;};'use strict';var _=require(_0x7012('0x0'));var util=require(_0x7012('0x1'));var moment=require('moment');var BPromise=require(_0x7012('0x2'));var rs=require(_0x7012('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7012('0x4'));var logger=require('../../config/logger')(_0x7012('0x5'));var config=require(_0x7012('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7012('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x52a6bb,_0x519a09,_0x3cb735){return new BPromise(function(_0x5ceb2c,_0x31608f){return client['request'](_0x52a6bb,_0x3cb735)[_0x7012('0x8')](function(_0x132029){logger[_0x7012('0x9')](_0x7012('0xa'),_0x519a09,_0x7012('0xb'));logger[_0x7012('0xc')](_0x7012('0xd'),_0x519a09,'request\x20sent',JSON['stringify'](_0x132029));if(_0x132029['error']){if(_0x132029[_0x7012('0xe')][_0x7012('0xf')]===0x1f4){logger[_0x7012('0xe')](_0x7012('0xa'),_0x519a09,_0x132029[_0x7012('0xe')]['message']);return _0x31608f(_0x132029['error'][_0x7012('0x10')]);}logger[_0x7012('0xe')](_0x7012('0xa'),_0x519a09,_0x132029[_0x7012('0xe')][_0x7012('0x10')]);return _0x5ceb2c(_0x132029[_0x7012('0xe')]['message']);}else{logger[_0x7012('0x9')](_0x7012('0xa'),_0x519a09,_0x7012('0xb'));_0x5ceb2c(_0x132029[_0x7012('0x11')][_0x7012('0x10')]);}})[_0x7012('0x12')](function(_0x8aee4c){logger[_0x7012('0xe')](_0x7012('0xa'),_0x519a09,_0x8aee4c);_0x31608f(_0x8aee4c);});});}exports[_0x7012('0x13')]=function(_0x182502){var _0x3723aa=this;return new Promise(function(_0x527212,_0x491931){return db[_0x7012('0x14')][_0x7012('0x15')]({'raw':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x17')]===undefined?!![]:![]:!![],'where':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x18')]||null:null,'attributes':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x19')]||null:null,'limit':_0x182502['options']?_0x182502[_0x7012('0x16')]['limit']||null:null,'include':_0x182502[_0x7012('0x16')]?_0x182502[_0x7012('0x16')][_0x7012('0x1a')]?_[_0x7012('0x1b')](_0x182502['options'][_0x7012('0x1a')],function(_0xfc76f1){return{'model':db[_0xfc76f1[_0x7012('0x1c')]],'as':_0xfc76f1['as'],'attributes':_0xfc76f1['attributes'],'include':_0xfc76f1[_0x7012('0x1a')]?_[_0x7012('0x1b')](_0xfc76f1['include'],function(_0x125915){return{'model':db[_0x125915[_0x7012('0x1c')]],'as':_0x125915['as'],'attributes':_0x125915[_0x7012('0x19')],'include':_0x125915[_0x7012('0x1a')]?_['map'](_0x125915[_0x7012('0x1a')],function(_0x481a3e){return{'model':db[_0x481a3e['model']],'as':_0x481a3e['as'],'attributes':_0x481a3e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7012('0x8')](function(_0x1b5814){logger[_0x7012('0x9')](_0x7012('0x13'),_0x182502);logger[_0x7012('0xc')](_0x7012('0x13'),_0x182502,JSON[_0x7012('0x1d')](_0x1b5814));_0x527212(_0x1b5814);})['catch'](function(_0x50667f){logger['error'](_0x7012('0x13'),_0x50667f[_0x7012('0x10')],_0x182502);_0x491931(_0x3723aa[_0x7012('0xe')](0x1f4,_0x50667f[_0x7012('0x10')]));});});};exports[_0x7012('0x1e')]=function(_0x22ccc0){var _0x1743fa=this;return new Promise(function(_0x5b30e9,_0x5c8aed){return db[_0x7012('0x14')][_0x7012('0x1f')]({'raw':_0x22ccc0['options']?_0x22ccc0[_0x7012('0x16')][_0x7012('0x17')]===undefined?!![]:![]:!![],'where':_0x22ccc0['options']?_0x22ccc0[_0x7012('0x16')][_0x7012('0x18')]||null:null,'attributes':_0x22ccc0[_0x7012('0x16')]?_0x22ccc0['options'][_0x7012('0x19')]||null:null,'include':_0x22ccc0[_0x7012('0x16')]?_0x22ccc0[_0x7012('0x16')][_0x7012('0x1a')]?_[_0x7012('0x1b')](_0x22ccc0['options'][_0x7012('0x1a')],function(_0x584918){return{'model':db[_0x584918[_0x7012('0x1c')]],'as':_0x584918['as'],'attributes':_0x584918[_0x7012('0x19')],'include':_0x584918[_0x7012('0x1a')]?_[_0x7012('0x1b')](_0x584918['include'],function(_0x5f2651){return{'model':db[_0x5f2651[_0x7012('0x1c')]],'as':_0x5f2651['as'],'attributes':_0x5f2651[_0x7012('0x19')],'include':_0x5f2651['include']?_[_0x7012('0x1b')](_0x5f2651[_0x7012('0x1a')],function(_0x3d6bd5){return{'model':db[_0x3d6bd5[_0x7012('0x1c')]],'as':_0x3d6bd5['as'],'attributes':_0x3d6bd5[_0x7012('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7012('0x8')](function(_0x10f655){logger[_0x7012('0x9')](_0x7012('0x1e'),_0x22ccc0);logger[_0x7012('0xc')](_0x7012('0x1e'),_0x22ccc0,JSON[_0x7012('0x1d')](_0x10f655));_0x5b30e9(_0x10f655);})['catch'](function(_0x424e9e){logger[_0x7012('0xe')]('ShowSalesforceAccount',_0x424e9e[_0x7012('0x10')],_0x22ccc0);_0x5c8aed(_0x1743fa[_0x7012('0xe')](0x1f4,_0x424e9e['message']));});});}; \ No newline at end of file +var _0x2304=['util','moment','bluebird','../../mysqldb','rpc','jayson/promise','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','include','model','attributes','map','catch','ShowSalesforceAccount','find','raw','then','lodash'];(function(_0x22c50e,_0x4ea131){var _0x500f85=function(_0x412f7b){while(--_0x412f7b){_0x22c50e['push'](_0x22c50e['shift']());}};_0x500f85(++_0x4ea131);}(_0x2304,0x192));var _0x4230=function(_0x271153,_0x242629){_0x271153=_0x271153-0x0;var _0x47b1b7=_0x2304[_0x271153];return _0x47b1b7;};'use strict';var _=require(_0x4230('0x0'));var util=require(_0x4230('0x1'));var moment=require(_0x4230('0x2'));var BPromise=require(_0x4230('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4230('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4230('0x5'));var config=require('../../config/environment');var jayson=require(_0x4230('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c32dd,_0x513b16,_0x48a55e){return new BPromise(function(_0x26c9c1,_0x5d8c93){return client[_0x4230('0x7')](_0x3c32dd,_0x48a55e)['then'](function(_0x2e63e2){logger['info'](_0x4230('0x8'),_0x513b16,_0x4230('0x9'));logger[_0x4230('0xa')](_0x4230('0xb'),_0x513b16,'request\x20sent',JSON[_0x4230('0xc')](_0x2e63e2));if(_0x2e63e2['error']){if(_0x2e63e2[_0x4230('0xd')]['code']===0x1f4){logger[_0x4230('0xd')](_0x4230('0x8'),_0x513b16,_0x2e63e2[_0x4230('0xd')][_0x4230('0xe')]);return _0x5d8c93(_0x2e63e2[_0x4230('0xd')][_0x4230('0xe')]);}logger[_0x4230('0xd')](_0x4230('0x8'),_0x513b16,_0x2e63e2[_0x4230('0xd')][_0x4230('0xe')]);return _0x26c9c1(_0x2e63e2['error']['message']);}else{logger[_0x4230('0xf')](_0x4230('0x8'),_0x513b16,'request\x20sent');_0x26c9c1(_0x2e63e2[_0x4230('0x10')][_0x4230('0xe')]);}})['catch'](function(_0x2460f2){logger[_0x4230('0xd')](_0x4230('0x8'),_0x513b16,_0x2460f2);_0x5d8c93(_0x2460f2);});});}exports[_0x4230('0x11')]=function(_0x3c8080){var _0x217334=this;return new Promise(function(_0xcd6609,_0x2d55bf){return db[_0x4230('0x12')][_0x4230('0x13')]({'raw':_0x3c8080[_0x4230('0x14')]?_0x3c8080[_0x4230('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3c8080[_0x4230('0x14')]?_0x3c8080[_0x4230('0x14')][_0x4230('0x15')]||null:null,'attributes':_0x3c8080[_0x4230('0x14')]?_0x3c8080[_0x4230('0x14')]['attributes']||null:null,'limit':_0x3c8080[_0x4230('0x14')]?_0x3c8080[_0x4230('0x14')]['limit']||null:null,'include':_0x3c8080[_0x4230('0x14')]?_0x3c8080[_0x4230('0x14')]['include']?_['map'](_0x3c8080['options'][_0x4230('0x16')],function(_0x49647a){return{'model':db[_0x49647a[_0x4230('0x17')]],'as':_0x49647a['as'],'attributes':_0x49647a[_0x4230('0x18')],'include':_0x49647a['include']?_[_0x4230('0x19')](_0x49647a[_0x4230('0x16')],function(_0x352a9e){return{'model':db[_0x352a9e[_0x4230('0x17')]],'as':_0x352a9e['as'],'attributes':_0x352a9e[_0x4230('0x18')],'include':_0x352a9e[_0x4230('0x16')]?_[_0x4230('0x19')](_0x352a9e[_0x4230('0x16')],function(_0x2ccbda){return{'model':db[_0x2ccbda[_0x4230('0x17')]],'as':_0x2ccbda['as'],'attributes':_0x2ccbda[_0x4230('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x359ece){logger[_0x4230('0xf')](_0x4230('0x11'),_0x3c8080);logger[_0x4230('0xa')](_0x4230('0x11'),_0x3c8080,JSON[_0x4230('0xc')](_0x359ece));_0xcd6609(_0x359ece);})[_0x4230('0x1a')](function(_0x2e4d33){logger[_0x4230('0xd')]('GetSalesforceAccount',_0x2e4d33['message'],_0x3c8080);_0x2d55bf(_0x217334[_0x4230('0xd')](0x1f4,_0x2e4d33[_0x4230('0xe')]));});});};exports[_0x4230('0x1b')]=function(_0x1d4d80){var _0x2adbbf=this;return new Promise(function(_0x4a5dec,_0x4fffb8){return db['SalesforceAccount'][_0x4230('0x1c')]({'raw':_0x1d4d80[_0x4230('0x14')]?_0x1d4d80['options'][_0x4230('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d4d80['options']?_0x1d4d80[_0x4230('0x14')][_0x4230('0x15')]||null:null,'attributes':_0x1d4d80[_0x4230('0x14')]?_0x1d4d80[_0x4230('0x14')]['attributes']||null:null,'include':_0x1d4d80['options']?_0x1d4d80['options']['include']?_['map'](_0x1d4d80[_0x4230('0x14')]['include'],function(_0x122ca3){return{'model':db[_0x122ca3[_0x4230('0x17')]],'as':_0x122ca3['as'],'attributes':_0x122ca3['attributes'],'include':_0x122ca3[_0x4230('0x16')]?_[_0x4230('0x19')](_0x122ca3[_0x4230('0x16')],function(_0x2bd269){return{'model':db[_0x2bd269[_0x4230('0x17')]],'as':_0x2bd269['as'],'attributes':_0x2bd269[_0x4230('0x18')],'include':_0x2bd269[_0x4230('0x16')]?_['map'](_0x2bd269[_0x4230('0x16')],function(_0x22dce3){return{'model':db[_0x22dce3[_0x4230('0x17')]],'as':_0x22dce3['as'],'attributes':_0x22dce3['attributes']};}):[]};}):[]};}):[]:[]})[_0x4230('0x1e')](function(_0x3ee02e){logger[_0x4230('0xf')](_0x4230('0x1b'),_0x1d4d80);logger[_0x4230('0xa')](_0x4230('0x1b'),_0x1d4d80,JSON[_0x4230('0xc')](_0x3ee02e));_0x4a5dec(_0x3ee02e);})[_0x4230('0x1a')](function(_0x46dbc9){logger[_0x4230('0xd')](_0x4230('0x1b'),_0x46dbc9['message'],_0x1d4d80);_0x4fffb8(_0x2adbbf[_0x4230('0xd')](0x1f4,_0x46dbc9['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 994e9a9..67f9c45 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0xc4a640,_0x4adac8){var _0x181964=function(_0x170219){while(--_0x170219){_0xc4a640['push'](_0xc4a640['shift']());}};_0x181964(++_0x4adac8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x12dd11,_0x52b882){_0x12dd11=_0x12dd11-0x0;var _0x3a502b=_0x0b0e[_0x12dd11];return _0x3a502b;};'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['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 590d9c8..25fe121 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 _0x235a=['account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead'];(function(_0x46cff2,_0x3deb25){var _0x52f643=function(_0x4c486c){while(--_0x4c486c){_0x46cff2['push'](_0x46cff2['shift']());}};_0x52f643(++_0x3deb25);}(_0x235a,0x1ef));var _0xa235=function(_0x22283c,_0x20eca5){_0x22283c=_0x22283c-0x0;var _0x19d6e0=_0x235a[_0x22283c];return _0x19d6e0;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'name':{'type':Sequelize[_0xa235('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa235('0x3')]('Task',_0xa235('0x4')),'defaultValue':_0xa235('0x5')},'moduleSearch':{'type':Sequelize[_0xa235('0x3')](_0xa235('0x6'),_0xa235('0x7'),_0xa235('0x8'),_0xa235('0x9'),_0xa235('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa235('0x3')](_0xa235('0xb'),_0xa235('0x7'),_0xa235('0x8'),'account'),'defaultValue':_0xa235('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xa235('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x857a=['Task','Case','contact_lead','contact','account_contact_lead','account','nothing','lead','sequelize','exports','STRING','ENUM'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x857a,0x11c));var _0xa857=function(_0x45096a,_0x1e2c66){_0x45096a=_0x45096a-0x0;var _0x5e9a85=_0x857a[_0x45096a];return _0x5e9a85;};'use strict';var Sequelize=require(_0xa857('0x0'));module[_0xa857('0x1')]={'name':{'type':Sequelize[_0xa857('0x2')]},'description':{'type':Sequelize[_0xa857('0x2')]},'ticketType':{'type':Sequelize[_0xa857('0x3')](_0xa857('0x4'),_0xa857('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xa857('0x3')](_0xa857('0x6'),_0xa857('0x7'),'lead',_0xa857('0x8'),_0xa857('0x9')),'defaultValue':_0xa857('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0xa857('0xa'),_0xa857('0x7'),_0xa857('0xb'),_0xa857('0x9')),'defaultValue':_0xa857('0xb')},'leadId':{'type':Sequelize[_0xa857('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xa857('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xa857('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xa857('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 58cd601..8c05528 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 _0x7573=['query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','rawAttributes','keys','find','create','body','update','getFields','findOne','params','fields','filter','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','SalesforceConfiguration','fieldName','type','model'];(function(_0x421d1f,_0x103891){var _0x4228bf=function(_0x4e30fc){while(--_0x4e30fc){_0x421d1f['push'](_0x421d1f['shift']());}};_0x4228bf(++_0x103891);}(_0x7573,0x72));var _0x3757=function(_0x35ca40,_0x271bc6){_0x35ca40=_0x35ca40-0x0;var _0x105ef7=_0x7573[_0x35ca40];return _0x105ef7;};'use strict';var emlformat=require(_0x3757('0x0'));var rimraf=require(_0x3757('0x1'));var zipdir=require(_0x3757('0x2'));var jsonpatch=require(_0x3757('0x3'));var rp=require(_0x3757('0x4'));var moment=require(_0x3757('0x5'));var BPromise=require(_0x3757('0x6'));var Mustache=require(_0x3757('0x7'));var util=require(_0x3757('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3757('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3757('0xa'));var _=require('lodash');var squel=require(_0x3757('0xb'));var crypto=require(_0x3757('0xc'));var jsforce=require(_0x3757('0xd'));var deskjs=require(_0x3757('0xe'));var toCsv=require(_0x3757('0x9'));var querystring=require(_0x3757('0xf'));var Papa=require(_0x3757('0x10'));var Redis=require(_0x3757('0x11'));var authService=require(_0x3757('0x12'));var qs=require(_0x3757('0x13'));var as=require(_0x3757('0x14'));var hardwareService=require(_0x3757('0x15'));var logger=require(_0x3757('0x16'))(_0x3757('0x17'));var utils=require(_0x3757('0x18'));var config=require(_0x3757('0x19'));var licenseUtil=require(_0x3757('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x92391d,_0x587826){_0x587826=_0x587826||0xcc;return function(_0x154021){if(_0x154021){return _0x92391d[_0x3757('0x1b')](_0x587826);}return _0x92391d[_0x3757('0x1c')](_0x587826)[_0x3757('0x1d')]();};}function respondWithResult(_0x1d9c26,_0x5a18b5){_0x5a18b5=_0x5a18b5||0xc8;return function(_0x487b5b){if(_0x487b5b){return _0x1d9c26[_0x3757('0x1c')](_0x5a18b5)[_0x3757('0x1e')](_0x487b5b);}};}function respondWithFilteredResult(_0x4e864f,_0x548c76){return function(_0x5499ef){if(_0x5499ef){var _0x213245=typeof _0x548c76['offset']===_0x3757('0x1f')&&typeof _0x548c76['limit']==='undefined';var _0x5b1014=_0x5499ef[_0x3757('0x20')];var _0x2fe934=_0x213245?0x0:_0x548c76['offset'];var _0x59d0d5=_0x213245?_0x5499ef[_0x3757('0x20')]:_0x548c76[_0x3757('0x21')]+_0x548c76[_0x3757('0x22')];var _0x1cab70;if(_0x59d0d5>=_0x5b1014){_0x59d0d5=_0x5b1014;_0x1cab70=0xc8;}else{_0x1cab70=0xce;}_0x4e864f[_0x3757('0x1c')](_0x1cab70);return _0x4e864f[_0x3757('0x23')](_0x3757('0x24'),_0x2fe934+'-'+_0x59d0d5+'/'+_0x5b1014)[_0x3757('0x1e')](_0x5499ef);}return null;};}function patchUpdates(_0x5ec0d1){return function(_0x2a3218){try{jsonpatch[_0x3757('0x25')](_0x2a3218,_0x5ec0d1,!![]);}catch(_0x4076e9){return BPromise[_0x3757('0x26')](_0x4076e9);}return _0x2a3218[_0x3757('0x27')]();};}function saveUpdates(_0x427f63,_0x2ea7dc){return function(_0x448121){if(_0x448121){return _0x448121['update'](_0x427f63)['then'](function(_0x8f4693){return _0x8f4693;});}return null;};}function removeEntity(_0x4ee245,_0x57550b){return function(_0xa61b5c){if(_0xa61b5c){return _0xa61b5c['destroy']()[_0x3757('0x28')](function(){_0x4ee245['status'](0xcc)[_0x3757('0x1d')]();});}};}function handleEntityNotFound(_0x4f1983,_0x28cc96){return function(_0x3cb7dc){if(!_0x3cb7dc){_0x4f1983[_0x3757('0x1b')](0x194);}return _0x3cb7dc;};}function handleError(_0x30c0db,_0x4fb277){_0x4fb277=_0x4fb277||0x1f4;return function(_0x2f9bbf){logger[_0x3757('0x29')](_0x2f9bbf[_0x3757('0x2a')]);if(_0x2f9bbf['name']){delete _0x2f9bbf[_0x3757('0x2b')];}_0x30c0db['status'](_0x4fb277)['send'](_0x2f9bbf);};}exports[_0x3757('0x2c')]=function(_0x40c657,_0x49fae0){var _0x3260e0={},_0x4baab2={},_0x262a58={'count':0x0,'rows':[]};var _0x3c8ef8=_[_0x3757('0x2d')](db[_0x3757('0x2e')]['rawAttributes'],function(_0x22d845){return{'name':_0x22d845[_0x3757('0x2f')],'type':_0x22d845[_0x3757('0x30')]['key']};});_0x4baab2[_0x3757('0x31')]=_[_0x3757('0x2d')](_0x3c8ef8,'name');_0x4baab2[_0x3757('0x32')]=_['keys'](_0x40c657[_0x3757('0x32')]);_0x4baab2[_0x3757('0x33')]=_[_0x3757('0x34')](_0x4baab2[_0x3757('0x31')],_0x4baab2['query']);_0x3260e0[_0x3757('0x35')]=_[_0x3757('0x34')](_0x4baab2[_0x3757('0x31')],qs['fields'](_0x40c657[_0x3757('0x32')]['fields']));_0x3260e0[_0x3757('0x35')]=_0x3260e0['attributes'][_0x3757('0x36')]?_0x3260e0['attributes']:_0x4baab2[_0x3757('0x31')];if(!_0x40c657['query'][_0x3757('0x37')]('nolimit')){_0x3260e0[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x40c657['query']['limit']);_0x3260e0['offset']=qs['offset'](_0x40c657[_0x3757('0x32')][_0x3757('0x21')]);}_0x3260e0[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x40c657[_0x3757('0x32')][_0x3757('0x39')]);_0x3260e0[_0x3757('0x3a')]=qs[_0x3757('0x33')](_[_0x3757('0x3b')](_0x40c657[_0x3757('0x32')],_0x4baab2[_0x3757('0x33')]),_0x3c8ef8);if(_0x40c657[_0x3757('0x32')]['filter']){_0x3260e0['where']=_[_0x3757('0x3c')](_0x3260e0['where'],{'$or':_[_0x3757('0x2d')](_0x3c8ef8,function(_0x47993c){if(_0x47993c[_0x3757('0x30')]!=='VIRTUAL'){var _0x1e6efd={};_0x1e6efd[_0x47993c[_0x3757('0x2b')]]={'$like':'%'+_0x40c657[_0x3757('0x32')]['filter']+'%'};return _0x1e6efd;}})});}_0x3260e0=_[_0x3757('0x3c')]({},_0x3260e0,_0x40c657[_0x3757('0x3d')]);var _0x45f050={'where':_0x3260e0[_0x3757('0x3a')]};return db['SalesforceConfiguration'][_0x3757('0x20')](_0x45f050)['then'](function(_0x446984){_0x262a58[_0x3757('0x20')]=_0x446984;if(_0x40c657['query'][_0x3757('0x3e')]){_0x3260e0[_0x3757('0x3f')]=[{'all':!![]}];}return db[_0x3757('0x2e')][_0x3757('0x40')](_0x3260e0);})['then'](function(_0x3fd3fd){_0x262a58['rows']=_0x3fd3fd;return _0x262a58;})[_0x3757('0x28')](respondWithFilteredResult(_0x49fae0,_0x3260e0))[_0x3757('0x41')](handleError(_0x49fae0,null));};exports[_0x3757('0x42')]=function(_0x1860a4,_0x4b15c6){var _0x5e0927={'raw':![],'where':{'id':_0x1860a4['params']['id']}},_0x163a65={};_0x163a65['model']=_['keys'](db[_0x3757('0x2e')][_0x3757('0x43')]);_0x163a65['query']=_[_0x3757('0x44')](_0x1860a4['query']);_0x163a65[_0x3757('0x33')]=_[_0x3757('0x34')](_0x163a65[_0x3757('0x31')],_0x163a65[_0x3757('0x32')]);_0x5e0927[_0x3757('0x35')]=_['intersection'](_0x163a65[_0x3757('0x31')],qs['fields'](_0x1860a4[_0x3757('0x32')]['fields']));_0x5e0927[_0x3757('0x35')]=_0x5e0927[_0x3757('0x35')][_0x3757('0x36')]?_0x5e0927[_0x3757('0x35')]:_0x163a65['model'];if(_0x1860a4[_0x3757('0x32')]['includeAll']){_0x5e0927[_0x3757('0x3f')]=[{'all':!![]}];}_0x5e0927=_[_0x3757('0x3c')]({},_0x5e0927,_0x1860a4['options']);return db[_0x3757('0x2e')][_0x3757('0x45')](_0x5e0927)[_0x3757('0x28')](handleEntityNotFound(_0x4b15c6,null))['then'](respondWithResult(_0x4b15c6,null))[_0x3757('0x41')](handleError(_0x4b15c6,null));};exports[_0x3757('0x46')]=function(_0x4e9d25,_0x23cfaf){return db[_0x3757('0x2e')][_0x3757('0x46')](_0x4e9d25[_0x3757('0x47')],{})[_0x3757('0x28')](respondWithResult(_0x23cfaf,0xc9))[_0x3757('0x41')](handleError(_0x23cfaf,null));};exports[_0x3757('0x48')]=function(_0x37bfc4,_0x1c76ba){if(_0x37bfc4[_0x3757('0x47')]['id']){delete _0x37bfc4[_0x3757('0x47')]['id'];}return db[_0x3757('0x2e')]['find']({'where':{'id':_0x37bfc4['params']['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x1c76ba,null))[_0x3757('0x28')](saveUpdates(_0x37bfc4[_0x3757('0x47')],null))[_0x3757('0x28')](respondWithResult(_0x1c76ba,null))['catch'](handleError(_0x1c76ba,null));};exports['destroy']=function(_0x4c1fd0,_0xa7bc6b){return db['SalesforceConfiguration'][_0x3757('0x45')]({'where':{'id':_0x4c1fd0['params']['id']}})[_0x3757('0x28')](handleEntityNotFound(_0xa7bc6b,null))['then'](removeEntity(_0xa7bc6b,null))[_0x3757('0x41')](handleError(_0xa7bc6b,null));};exports[_0x3757('0x49')]=function(_0x13928a,_0x2d658d,_0x37fd51){var _0x43a072={};var _0x3c05e2={};var _0xfc8e4d;var _0x5e9d87;return db[_0x3757('0x2e')][_0x3757('0x4a')]({'where':{'id':_0x13928a[_0x3757('0x4b')]['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x2d658d,null))[_0x3757('0x28')](function(_0x2cf13b){if(_0x2cf13b){_0xfc8e4d=_0x2cf13b;_0x3c05e2['model']=_['keys'](db['SalesforceField'][_0x3757('0x43')]);_0x3c05e2[_0x3757('0x32')]=_[_0x3757('0x44')](_0x13928a[_0x3757('0x32')]);_0x3c05e2['filters']=_[_0x3757('0x34')](_0x3c05e2[_0x3757('0x31')],_0x3c05e2[_0x3757('0x32')]);_0x43a072[_0x3757('0x35')]=_[_0x3757('0x34')](_0x3c05e2[_0x3757('0x31')],qs[_0x3757('0x4c')](_0x13928a[_0x3757('0x32')][_0x3757('0x4c')]));_0x43a072[_0x3757('0x35')]=_0x43a072[_0x3757('0x35')][_0x3757('0x36')]?_0x43a072[_0x3757('0x35')]:_0x3c05e2[_0x3757('0x31')];_0x43a072[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x13928a[_0x3757('0x32')][_0x3757('0x39')]);_0x43a072[_0x3757('0x3a')]=qs[_0x3757('0x33')](_['pick'](_0x13928a['query'],_0x3c05e2[_0x3757('0x33')]));if(_0x13928a['query'][_0x3757('0x4d')]){_0x43a072[_0x3757('0x3a')]=_[_0x3757('0x3c')](_0x43a072[_0x3757('0x3a')],{'$or':_[_0x3757('0x2d')](_0x43a072[_0x3757('0x35')],function(_0x47512e){var _0x330595={};_0x330595[_0x47512e]={'$like':'%'+_0x13928a[_0x3757('0x32')][_0x3757('0x4d')]+'%'};return _0x330595;})});}_0x43a072=_[_0x3757('0x3c')]({},_0x43a072,_0x13928a[_0x3757('0x3d')]);return _0xfc8e4d[_0x3757('0x49')](_0x43a072);}})[_0x3757('0x28')](function(_0x546f6f){if(_0x546f6f){_0x5e9d87=_0x546f6f[_0x3757('0x36')];if(!_0x13928a[_0x3757('0x32')]['hasOwnProperty'](_0x3757('0x4e'))){_0x43a072[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x13928a[_0x3757('0x32')]['limit']);_0x43a072[_0x3757('0x21')]=qs[_0x3757('0x21')](_0x13928a['query'][_0x3757('0x21')]);}return _0xfc8e4d['getFields'](_0x43a072);}})[_0x3757('0x28')](function(_0x141e18){if(_0x141e18){return _0x141e18?{'count':_0x5e9d87,'rows':_0x141e18}:null;}})[_0x3757('0x28')](respondWithResult(_0x2d658d,null))['catch'](handleError(_0x2d658d,null));};exports[_0x3757('0x4f')]=function(_0x477f8f,_0x44f633,_0x5b7dcc){var _0x160680={};var _0x27b9c7={};var _0x8b62de;var _0x26d04d;return db[_0x3757('0x2e')]['findOne']({'where':{'id':_0x477f8f[_0x3757('0x4b')]['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x44f633,null))[_0x3757('0x28')](function(_0x24806f){if(_0x24806f){_0x8b62de=_0x24806f;_0x27b9c7[_0x3757('0x31')]=_[_0x3757('0x44')](db[_0x3757('0x50')][_0x3757('0x43')]);_0x27b9c7[_0x3757('0x32')]=_['keys'](_0x477f8f[_0x3757('0x32')]);_0x27b9c7[_0x3757('0x33')]=_[_0x3757('0x34')](_0x27b9c7['model'],_0x27b9c7['query']);_0x160680[_0x3757('0x35')]=_[_0x3757('0x34')](_0x27b9c7[_0x3757('0x31')],qs[_0x3757('0x4c')](_0x477f8f[_0x3757('0x32')][_0x3757('0x4c')]));_0x160680[_0x3757('0x35')]=_0x160680['attributes'][_0x3757('0x36')]?_0x160680[_0x3757('0x35')]:_0x27b9c7[_0x3757('0x31')];_0x160680[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x477f8f[_0x3757('0x32')][_0x3757('0x39')]);_0x160680[_0x3757('0x3a')]=qs[_0x3757('0x33')](_['pick'](_0x477f8f['query'],_0x27b9c7[_0x3757('0x33')]));if(_0x477f8f[_0x3757('0x32')][_0x3757('0x4d')]){_0x160680['where']=_[_0x3757('0x3c')](_0x160680[_0x3757('0x3a')],{'$or':_[_0x3757('0x2d')](_0x160680[_0x3757('0x35')],function(_0x813911){var _0x5127db={};_0x5127db[_0x813911]={'$like':'%'+_0x477f8f[_0x3757('0x32')][_0x3757('0x4d')]+'%'};return _0x5127db;})});}_0x160680=_[_0x3757('0x3c')]({},_0x160680,_0x477f8f[_0x3757('0x3d')]);return _0x8b62de[_0x3757('0x4f')](_0x160680);}})[_0x3757('0x28')](function(_0x17884d){if(_0x17884d){_0x26d04d=_0x17884d[_0x3757('0x36')];if(!_0x477f8f[_0x3757('0x32')][_0x3757('0x37')](_0x3757('0x4e'))){_0x160680[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x477f8f[_0x3757('0x32')][_0x3757('0x22')]);_0x160680[_0x3757('0x21')]=qs['offset'](_0x477f8f['query'][_0x3757('0x21')]);}return _0x8b62de['getSubjects'](_0x160680);}})[_0x3757('0x28')](function(_0x509b9a){if(_0x509b9a){return _0x509b9a?{'count':_0x26d04d,'rows':_0x509b9a}:null;}})['then'](respondWithResult(_0x44f633,null))[_0x3757('0x41')](handleError(_0x44f633,null));};exports[_0x3757('0x51')]=function(_0x30d3e1,_0x1b6854,_0x1b3178){var _0x54870e={};var _0x4cd329={};var _0x49396c;var _0x476fd0;return db[_0x3757('0x2e')][_0x3757('0x4a')]({'where':{'id':_0x30d3e1[_0x3757('0x4b')]['id']}})[_0x3757('0x28')](handleEntityNotFound(_0x1b6854,null))[_0x3757('0x28')](function(_0x57d504){if(_0x57d504){_0x49396c=_0x57d504;_0x4cd329['model']=_[_0x3757('0x44')](db[_0x3757('0x50')][_0x3757('0x43')]);_0x4cd329[_0x3757('0x32')]=_[_0x3757('0x44')](_0x30d3e1['query']);_0x4cd329[_0x3757('0x33')]=_[_0x3757('0x34')](_0x4cd329[_0x3757('0x31')],_0x4cd329[_0x3757('0x32')]);_0x54870e[_0x3757('0x35')]=_['intersection'](_0x4cd329[_0x3757('0x31')],qs['fields'](_0x30d3e1[_0x3757('0x32')][_0x3757('0x4c')]));_0x54870e[_0x3757('0x35')]=_0x54870e[_0x3757('0x35')]['length']?_0x54870e[_0x3757('0x35')]:_0x4cd329[_0x3757('0x31')];_0x54870e[_0x3757('0x38')]=qs[_0x3757('0x39')](_0x30d3e1[_0x3757('0x32')][_0x3757('0x39')]);_0x54870e[_0x3757('0x3a')]=qs['filters'](_[_0x3757('0x3b')](_0x30d3e1['query'],_0x4cd329[_0x3757('0x33')]));if(_0x30d3e1[_0x3757('0x32')]['filter']){_0x54870e[_0x3757('0x3a')]=_[_0x3757('0x3c')](_0x54870e[_0x3757('0x3a')],{'$or':_[_0x3757('0x2d')](_0x54870e[_0x3757('0x35')],function(_0x3ed876){var _0x1b0dae={};_0x1b0dae[_0x3ed876]={'$like':'%'+_0x30d3e1['query'][_0x3757('0x4d')]+'%'};return _0x1b0dae;})});}_0x54870e=_[_0x3757('0x3c')]({},_0x54870e,_0x30d3e1[_0x3757('0x3d')]);return _0x49396c[_0x3757('0x51')](_0x54870e);}})[_0x3757('0x28')](function(_0x2f3e74){if(_0x2f3e74){_0x476fd0=_0x2f3e74['length'];if(!_0x30d3e1[_0x3757('0x32')][_0x3757('0x37')](_0x3757('0x4e'))){_0x54870e[_0x3757('0x22')]=qs[_0x3757('0x22')](_0x30d3e1['query'][_0x3757('0x22')]);_0x54870e[_0x3757('0x21')]=qs[_0x3757('0x21')](_0x30d3e1[_0x3757('0x32')]['offset']);}return _0x49396c['getDescriptions'](_0x54870e);}})[_0x3757('0x28')](function(_0x34b87e){if(_0x34b87e){return _0x34b87e?{'count':_0x476fd0,'rows':_0x34b87e}:null;}})[_0x3757('0x28')](respondWithResult(_0x1b6854,null))[_0x3757('0x41')](handleError(_0x1b6854,null));}; \ No newline at end of file +var _0x02df=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','include','find','create','body','params','getFields','SalesforceField','hasOwnProperty','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','error','stack','name','send','index','map','SalesforceConfiguration'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x02df,0x128));var _0xf02d=function(_0x5df3e6,_0x49c45b){_0x5df3e6=_0x5df3e6-0x0;var _0x2ffc54=_0x02df[_0x5df3e6];return _0x2ffc54;};'use strict';var emlformat=require(_0xf02d('0x0'));var rimraf=require(_0xf02d('0x1'));var zipdir=require(_0xf02d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf02d('0x3'));var moment=require(_0xf02d('0x4'));var BPromise=require(_0xf02d('0x5'));var Mustache=require(_0xf02d('0x6'));var util=require(_0xf02d('0x7'));var path=require(_0xf02d('0x8'));var sox=require(_0xf02d('0x9'));var csv=require('to-csv');var ejs=require(_0xf02d('0xa'));var fs=require('fs');var fs_extra=require(_0xf02d('0xb'));var _=require(_0xf02d('0xc'));var squel=require(_0xf02d('0xd'));var crypto=require(_0xf02d('0xe'));var jsforce=require(_0xf02d('0xf'));var deskjs=require(_0xf02d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf02d('0x11'));var Papa=require(_0xf02d('0x12'));var Redis=require(_0xf02d('0x13'));var authService=require(_0xf02d('0x14'));var qs=require(_0xf02d('0x15'));var as=require(_0xf02d('0x16'));var hardwareService=require(_0xf02d('0x17'));var logger=require(_0xf02d('0x18'))(_0xf02d('0x19'));var utils=require(_0xf02d('0x1a'));var config=require(_0xf02d('0x1b'));var licenseUtil=require(_0xf02d('0x1c'));var db=require(_0xf02d('0x1d'))['db'];function respondWithStatusCode(_0x5b8f36,_0x2ee71c){_0x2ee71c=_0x2ee71c||0xcc;return function(_0x51f52d){if(_0x51f52d){return _0x5b8f36[_0xf02d('0x1e')](_0x2ee71c);}return _0x5b8f36[_0xf02d('0x1f')](_0x2ee71c)[_0xf02d('0x20')]();};}function respondWithResult(_0x1e7ebb,_0x2cd76b){_0x2cd76b=_0x2cd76b||0xc8;return function(_0x221151){if(_0x221151){return _0x1e7ebb['status'](_0x2cd76b)[_0xf02d('0x21')](_0x221151);}};}function respondWithFilteredResult(_0x39644d,_0x370c9f){return function(_0x5326f4){if(_0x5326f4){var _0x229f87=typeof _0x370c9f[_0xf02d('0x22')]===_0xf02d('0x23')&&typeof _0x370c9f[_0xf02d('0x24')]==='undefined';var _0x8dca8b=_0x5326f4['count'];var _0x3c3400=_0x229f87?0x0:_0x370c9f[_0xf02d('0x22')];var _0x2e4212=_0x229f87?_0x5326f4[_0xf02d('0x25')]:_0x370c9f['offset']+_0x370c9f[_0xf02d('0x24')];var _0xf1314f;if(_0x2e4212>=_0x8dca8b){_0x2e4212=_0x8dca8b;_0xf1314f=0xc8;}else{_0xf1314f=0xce;}_0x39644d[_0xf02d('0x1f')](_0xf1314f);return _0x39644d[_0xf02d('0x26')](_0xf02d('0x27'),_0x3c3400+'-'+_0x2e4212+'/'+_0x8dca8b)[_0xf02d('0x21')](_0x5326f4);}return null;};}function patchUpdates(_0x183206){return function(_0x134386){try{jsonpatch['apply'](_0x134386,_0x183206,!![]);}catch(_0x3efe00){return BPromise[_0xf02d('0x28')](_0x3efe00);}return _0x134386[_0xf02d('0x29')]();};}function saveUpdates(_0x5bd115,_0x4c65ef){return function(_0x31ec84){if(_0x31ec84){return _0x31ec84[_0xf02d('0x2a')](_0x5bd115)[_0xf02d('0x2b')](function(_0x200a47){return _0x200a47;});}return null;};}function removeEntity(_0x23d7de,_0x37e479){return function(_0x978930){if(_0x978930){return _0x978930[_0xf02d('0x2c')]()[_0xf02d('0x2b')](function(){_0x23d7de[_0xf02d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13e29d,_0x1b36e5){return function(_0x2abd35){if(!_0x2abd35){_0x13e29d[_0xf02d('0x1e')](0x194);}return _0x2abd35;};}function handleError(_0x46dbbd,_0x4ac248){_0x4ac248=_0x4ac248||0x1f4;return function(_0xccab89){logger[_0xf02d('0x2d')](_0xccab89[_0xf02d('0x2e')]);if(_0xccab89[_0xf02d('0x2f')]){delete _0xccab89[_0xf02d('0x2f')];}_0x46dbbd[_0xf02d('0x1f')](_0x4ac248)[_0xf02d('0x30')](_0xccab89);};}exports[_0xf02d('0x31')]=function(_0x488b2e,_0x39b2d3){var _0x5269b3={},_0x26e9bc={},_0x2080f9={'count':0x0,'rows':[]};var _0x1f5376=_[_0xf02d('0x32')](db[_0xf02d('0x33')][_0xf02d('0x34')],function(_0x2d4773){return{'name':_0x2d4773[_0xf02d('0x35')],'type':_0x2d4773[_0xf02d('0x36')][_0xf02d('0x37')]};});_0x26e9bc[_0xf02d('0x38')]=_[_0xf02d('0x32')](_0x1f5376,_0xf02d('0x2f'));_0x26e9bc[_0xf02d('0x39')]=_[_0xf02d('0x3a')](_0x488b2e[_0xf02d('0x39')]);_0x26e9bc[_0xf02d('0x3b')]=_[_0xf02d('0x3c')](_0x26e9bc[_0xf02d('0x38')],_0x26e9bc['query']);_0x5269b3[_0xf02d('0x3d')]=_['intersection'](_0x26e9bc[_0xf02d('0x38')],qs['fields'](_0x488b2e['query'][_0xf02d('0x3e')]));_0x5269b3[_0xf02d('0x3d')]=_0x5269b3[_0xf02d('0x3d')][_0xf02d('0x3f')]?_0x5269b3[_0xf02d('0x3d')]:_0x26e9bc[_0xf02d('0x38')];if(!_0x488b2e[_0xf02d('0x39')]['hasOwnProperty'](_0xf02d('0x40'))){_0x5269b3[_0xf02d('0x24')]=qs['limit'](_0x488b2e[_0xf02d('0x39')][_0xf02d('0x24')]);_0x5269b3[_0xf02d('0x22')]=qs['offset'](_0x488b2e[_0xf02d('0x39')][_0xf02d('0x22')]);}_0x5269b3[_0xf02d('0x41')]=qs[_0xf02d('0x42')](_0x488b2e[_0xf02d('0x39')][_0xf02d('0x42')]);_0x5269b3[_0xf02d('0x43')]=qs[_0xf02d('0x3b')](_[_0xf02d('0x44')](_0x488b2e[_0xf02d('0x39')],_0x26e9bc['filters']),_0x1f5376);if(_0x488b2e[_0xf02d('0x39')][_0xf02d('0x45')]){_0x5269b3[_0xf02d('0x43')]=_[_0xf02d('0x46')](_0x5269b3[_0xf02d('0x43')],{'$or':_[_0xf02d('0x32')](_0x1f5376,function(_0x5395a2){if(_0x5395a2[_0xf02d('0x36')]!==_0xf02d('0x47')){var _0x85fb0f={};_0x85fb0f[_0x5395a2[_0xf02d('0x2f')]]={'$like':'%'+_0x488b2e[_0xf02d('0x39')][_0xf02d('0x45')]+'%'};return _0x85fb0f;}})});}_0x5269b3=_[_0xf02d('0x46')]({},_0x5269b3,_0x488b2e[_0xf02d('0x48')]);var _0x5810e9={'where':_0x5269b3['where']};return db[_0xf02d('0x33')][_0xf02d('0x25')](_0x5810e9)['then'](function(_0x4f6997){_0x2080f9[_0xf02d('0x25')]=_0x4f6997;if(_0x488b2e[_0xf02d('0x39')][_0xf02d('0x49')]){_0x5269b3['include']=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x5269b3);})[_0xf02d('0x2b')](function(_0x44c15c){_0x2080f9[_0xf02d('0x4a')]=_0x44c15c;return _0x2080f9;})[_0xf02d('0x2b')](respondWithFilteredResult(_0x39b2d3,_0x5269b3))[_0xf02d('0x4b')](handleError(_0x39b2d3,null));};exports['show']=function(_0x26aad2,_0x12b1fd){var _0x4a1fe0={'raw':![],'where':{'id':_0x26aad2['params']['id']}},_0x1414f8={};_0x1414f8[_0xf02d('0x38')]=_[_0xf02d('0x3a')](db[_0xf02d('0x33')][_0xf02d('0x34')]);_0x1414f8['query']=_['keys'](_0x26aad2['query']);_0x1414f8[_0xf02d('0x3b')]=_['intersection'](_0x1414f8[_0xf02d('0x38')],_0x1414f8['query']);_0x4a1fe0['attributes']=_[_0xf02d('0x3c')](_0x1414f8[_0xf02d('0x38')],qs['fields'](_0x26aad2[_0xf02d('0x39')]['fields']));_0x4a1fe0[_0xf02d('0x3d')]=_0x4a1fe0[_0xf02d('0x3d')][_0xf02d('0x3f')]?_0x4a1fe0[_0xf02d('0x3d')]:_0x1414f8[_0xf02d('0x38')];if(_0x26aad2['query'][_0xf02d('0x49')]){_0x4a1fe0[_0xf02d('0x4c')]=[{'all':!![]}];}_0x4a1fe0=_[_0xf02d('0x46')]({},_0x4a1fe0,_0x26aad2[_0xf02d('0x48')]);return db[_0xf02d('0x33')][_0xf02d('0x4d')](_0x4a1fe0)[_0xf02d('0x2b')](handleEntityNotFound(_0x12b1fd,null))[_0xf02d('0x2b')](respondWithResult(_0x12b1fd,null))['catch'](handleError(_0x12b1fd,null));};exports[_0xf02d('0x4e')]=function(_0x515980,_0x51ab48){return db[_0xf02d('0x33')]['create'](_0x515980[_0xf02d('0x4f')],{})['then'](respondWithResult(_0x51ab48,0xc9))['catch'](handleError(_0x51ab48,null));};exports['update']=function(_0x438a33,_0x5b4b20){if(_0x438a33['body']['id']){delete _0x438a33['body']['id'];}return db[_0xf02d('0x33')]['find']({'where':{'id':_0x438a33[_0xf02d('0x50')]['id']}})[_0xf02d('0x2b')](handleEntityNotFound(_0x5b4b20,null))[_0xf02d('0x2b')](saveUpdates(_0x438a33[_0xf02d('0x4f')],null))['then'](respondWithResult(_0x5b4b20,null))['catch'](handleError(_0x5b4b20,null));};exports['destroy']=function(_0x497dd1,_0x30e359){return db['SalesforceConfiguration'][_0xf02d('0x4d')]({'where':{'id':_0x497dd1[_0xf02d('0x50')]['id']}})[_0xf02d('0x2b')](handleEntityNotFound(_0x30e359,null))[_0xf02d('0x2b')](removeEntity(_0x30e359,null))[_0xf02d('0x4b')](handleError(_0x30e359,null));};exports[_0xf02d('0x51')]=function(_0x374f42,_0x1c1a11,_0x3a0a55){var _0x5448c1={};var _0x5da56d={};var _0x293285;var _0xce1783;return db[_0xf02d('0x33')]['findOne']({'where':{'id':_0x374f42[_0xf02d('0x50')]['id']}})[_0xf02d('0x2b')](handleEntityNotFound(_0x1c1a11,null))['then'](function(_0x31d9f1){if(_0x31d9f1){_0x293285=_0x31d9f1;_0x5da56d[_0xf02d('0x38')]=_[_0xf02d('0x3a')](db[_0xf02d('0x52')][_0xf02d('0x34')]);_0x5da56d[_0xf02d('0x39')]=_[_0xf02d('0x3a')](_0x374f42[_0xf02d('0x39')]);_0x5da56d['filters']=_['intersection'](_0x5da56d[_0xf02d('0x38')],_0x5da56d['query']);_0x5448c1[_0xf02d('0x3d')]=_['intersection'](_0x5da56d[_0xf02d('0x38')],qs[_0xf02d('0x3e')](_0x374f42['query'][_0xf02d('0x3e')]));_0x5448c1[_0xf02d('0x3d')]=_0x5448c1['attributes'][_0xf02d('0x3f')]?_0x5448c1['attributes']:_0x5da56d[_0xf02d('0x38')];_0x5448c1[_0xf02d('0x41')]=qs['sort'](_0x374f42[_0xf02d('0x39')][_0xf02d('0x42')]);_0x5448c1[_0xf02d('0x43')]=qs[_0xf02d('0x3b')](_['pick'](_0x374f42['query'],_0x5da56d[_0xf02d('0x3b')]));if(_0x374f42['query']['filter']){_0x5448c1[_0xf02d('0x43')]=_[_0xf02d('0x46')](_0x5448c1[_0xf02d('0x43')],{'$or':_[_0xf02d('0x32')](_0x5448c1[_0xf02d('0x3d')],function(_0x5d8944){var _0x442b0f={};_0x442b0f[_0x5d8944]={'$like':'%'+_0x374f42['query']['filter']+'%'};return _0x442b0f;})});}_0x5448c1=_[_0xf02d('0x46')]({},_0x5448c1,_0x374f42[_0xf02d('0x48')]);return _0x293285[_0xf02d('0x51')](_0x5448c1);}})['then'](function(_0x35dc72){if(_0x35dc72){_0xce1783=_0x35dc72[_0xf02d('0x3f')];if(!_0x374f42[_0xf02d('0x39')][_0xf02d('0x53')](_0xf02d('0x40'))){_0x5448c1[_0xf02d('0x24')]=qs[_0xf02d('0x24')](_0x374f42['query'][_0xf02d('0x24')]);_0x5448c1[_0xf02d('0x22')]=qs['offset'](_0x374f42[_0xf02d('0x39')][_0xf02d('0x22')]);}return _0x293285[_0xf02d('0x51')](_0x5448c1);}})['then'](function(_0x2973a2){if(_0x2973a2){return _0x2973a2?{'count':_0xce1783,'rows':_0x2973a2}:null;}})[_0xf02d('0x2b')](respondWithResult(_0x1c1a11,null))[_0xf02d('0x4b')](handleError(_0x1c1a11,null));};exports['getSubjects']=function(_0x4a9b6b,_0x1aa466,_0x1d4678){var _0x304f7b={};var _0x4a992e={};var _0x362529;var _0x8eb5cd;return db[_0xf02d('0x33')][_0xf02d('0x54')]({'where':{'id':_0x4a9b6b['params']['id']}})['then'](handleEntityNotFound(_0x1aa466,null))[_0xf02d('0x2b')](function(_0x1e8c47){if(_0x1e8c47){_0x362529=_0x1e8c47;_0x4a992e[_0xf02d('0x38')]=_[_0xf02d('0x3a')](db[_0xf02d('0x52')][_0xf02d('0x34')]);_0x4a992e[_0xf02d('0x39')]=_['keys'](_0x4a9b6b[_0xf02d('0x39')]);_0x4a992e[_0xf02d('0x3b')]=_[_0xf02d('0x3c')](_0x4a992e[_0xf02d('0x38')],_0x4a992e[_0xf02d('0x39')]);_0x304f7b[_0xf02d('0x3d')]=_[_0xf02d('0x3c')](_0x4a992e['model'],qs[_0xf02d('0x3e')](_0x4a9b6b[_0xf02d('0x39')]['fields']));_0x304f7b['attributes']=_0x304f7b[_0xf02d('0x3d')][_0xf02d('0x3f')]?_0x304f7b[_0xf02d('0x3d')]:_0x4a992e[_0xf02d('0x38')];_0x304f7b[_0xf02d('0x41')]=qs[_0xf02d('0x42')](_0x4a9b6b['query']['sort']);_0x304f7b[_0xf02d('0x43')]=qs[_0xf02d('0x3b')](_['pick'](_0x4a9b6b['query'],_0x4a992e['filters']));if(_0x4a9b6b['query'][_0xf02d('0x45')]){_0x304f7b[_0xf02d('0x43')]=_[_0xf02d('0x46')](_0x304f7b[_0xf02d('0x43')],{'$or':_[_0xf02d('0x32')](_0x304f7b[_0xf02d('0x3d')],function(_0x2b56bc){var _0x3c9b60={};_0x3c9b60[_0x2b56bc]={'$like':'%'+_0x4a9b6b[_0xf02d('0x39')][_0xf02d('0x45')]+'%'};return _0x3c9b60;})});}_0x304f7b=_[_0xf02d('0x46')]({},_0x304f7b,_0x4a9b6b[_0xf02d('0x48')]);return _0x362529[_0xf02d('0x55')](_0x304f7b);}})[_0xf02d('0x2b')](function(_0x1ffe5c){if(_0x1ffe5c){_0x8eb5cd=_0x1ffe5c['length'];if(!_0x4a9b6b[_0xf02d('0x39')][_0xf02d('0x53')](_0xf02d('0x40'))){_0x304f7b['limit']=qs['limit'](_0x4a9b6b[_0xf02d('0x39')][_0xf02d('0x24')]);_0x304f7b[_0xf02d('0x22')]=qs['offset'](_0x4a9b6b[_0xf02d('0x39')][_0xf02d('0x22')]);}return _0x362529['getSubjects'](_0x304f7b);}})[_0xf02d('0x2b')](function(_0x221c36){if(_0x221c36){return _0x221c36?{'count':_0x8eb5cd,'rows':_0x221c36}:null;}})[_0xf02d('0x2b')](respondWithResult(_0x1aa466,null))[_0xf02d('0x4b')](handleError(_0x1aa466,null));};exports[_0xf02d('0x56')]=function(_0x488cff,_0x29bf7a,_0x49e532){var _0x372b5a={};var _0x1a8040={};var _0x25c046;var _0xcc4b8c;return db[_0xf02d('0x33')][_0xf02d('0x54')]({'where':{'id':_0x488cff[_0xf02d('0x50')]['id']}})[_0xf02d('0x2b')](handleEntityNotFound(_0x29bf7a,null))[_0xf02d('0x2b')](function(_0xae2c93){if(_0xae2c93){_0x25c046=_0xae2c93;_0x1a8040[_0xf02d('0x38')]=_[_0xf02d('0x3a')](db['SalesforceField'][_0xf02d('0x34')]);_0x1a8040[_0xf02d('0x39')]=_[_0xf02d('0x3a')](_0x488cff[_0xf02d('0x39')]);_0x1a8040['filters']=_['intersection'](_0x1a8040[_0xf02d('0x38')],_0x1a8040[_0xf02d('0x39')]);_0x372b5a[_0xf02d('0x3d')]=_['intersection'](_0x1a8040[_0xf02d('0x38')],qs[_0xf02d('0x3e')](_0x488cff[_0xf02d('0x39')][_0xf02d('0x3e')]));_0x372b5a[_0xf02d('0x3d')]=_0x372b5a[_0xf02d('0x3d')][_0xf02d('0x3f')]?_0x372b5a[_0xf02d('0x3d')]:_0x1a8040['model'];_0x372b5a['order']=qs['sort'](_0x488cff['query'][_0xf02d('0x42')]);_0x372b5a[_0xf02d('0x43')]=qs[_0xf02d('0x3b')](_[_0xf02d('0x44')](_0x488cff[_0xf02d('0x39')],_0x1a8040[_0xf02d('0x3b')]));if(_0x488cff[_0xf02d('0x39')][_0xf02d('0x45')]){_0x372b5a[_0xf02d('0x43')]=_[_0xf02d('0x46')](_0x372b5a[_0xf02d('0x43')],{'$or':_[_0xf02d('0x32')](_0x372b5a[_0xf02d('0x3d')],function(_0xe88e80){var _0x36e12b={};_0x36e12b[_0xe88e80]={'$like':'%'+_0x488cff[_0xf02d('0x39')]['filter']+'%'};return _0x36e12b;})});}_0x372b5a=_[_0xf02d('0x46')]({},_0x372b5a,_0x488cff[_0xf02d('0x48')]);return _0x25c046[_0xf02d('0x56')](_0x372b5a);}})[_0xf02d('0x2b')](function(_0x4a5c00){if(_0x4a5c00){_0xcc4b8c=_0x4a5c00[_0xf02d('0x3f')];if(!_0x488cff[_0xf02d('0x39')][_0xf02d('0x53')](_0xf02d('0x40'))){_0x372b5a['limit']=qs[_0xf02d('0x24')](_0x488cff['query'][_0xf02d('0x24')]);_0x372b5a['offset']=qs['offset'](_0x488cff['query']['offset']);}return _0x25c046['getDescriptions'](_0x372b5a);}})['then'](function(_0x1b1d78){if(_0x1b1d78){return _0x1b1d78?{'count':_0xcc4b8c,'rows':_0x1b1d78}:null;}})[_0xf02d('0x2b')](respondWithResult(_0x29bf7a,null))[_0xf02d('0x4b')](handleError(_0x29bf7a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c9c8a8e..a4944ef 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 _0xe76c=['api','moment','bluebird','path','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x2813e1,_0x5424a6){var _0x83af03=function(_0x1b3e41){while(--_0x1b3e41){_0x2813e1['push'](_0x2813e1['shift']());}};_0x83af03(++_0x5424a6);}(_0xe76c,0x76));var _0xce76=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xe76c[_0x47e549];return _0x251374;};'use strict';var _=require(_0xce76('0x0'));var util=require(_0xce76('0x1'));var logger=require(_0xce76('0x2'))(_0xce76('0x3'));var moment=require(_0xce76('0x4'));var BPromise=require(_0xce76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce76('0x6'));var rimraf=require('rimraf');var config=require(_0xce76('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x59f970,_0x255863){return _0x59f970[_0xce76('0x8')](_0xce76('0x9'),attributes,{'tableName':_0xce76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x729a=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','util','../../config/logger','api'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0x729a,0xf3));var _0xa729=function(_0x343f55,_0x5983ee){_0x343f55=_0x343f55-0x0;var _0x15ce5b=_0x729a[_0x343f55];return _0x15ce5b;};'use strict';var _=require(_0xa729('0x0'));var util=require(_0xa729('0x1'));var logger=require(_0xa729('0x2'))(_0xa729('0x3'));var moment=require(_0xa729('0x4'));var BPromise=require(_0xa729('0x5'));var rp=require(_0xa729('0x6'));var fs=require('fs');var path=require(_0xa729('0x7'));var rimraf=require('rimraf');var config=require(_0xa729('0x8'));var attributes=require(_0xa729('0x9'));module[_0xa729('0xa')]=function(_0x39917a,_0xd17050){return _0x39917a[_0xa729('0xb')](_0xa729('0xc'),attributes,{'tableName':'int_salesforce_configurations','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 1b6876b..a83993f 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 _0x337a=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40f5e0,_0x53fa46){var _0x2de0f9=function(_0x436224){while(--_0x436224){_0x40f5e0['push'](_0x40f5e0['shift']());}};_0x2de0f9(++_0x53fa46);}(_0x337a,0x1be));var _0xa337=function(_0x5a3b99,_0x623a91){_0x5a3b99=_0x5a3b99-0x0;var _0x39f8c7=_0x337a[_0x5a3b99];return _0x39f8c7;};'use strict';var _=require(_0xa337('0x0'));var util=require(_0xa337('0x1'));var moment=require(_0xa337('0x2'));var BPromise=require('bluebird');var rs=require(_0xa337('0x3'));var fs=require('fs');var Redis=require(_0xa337('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa337('0x5'));var config=require('../../config/environment');var jayson=require(_0xa337('0x6'));var client=jayson[_0xa337('0x7')][_0xa337('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33f849,_0x5b1651,_0x1aff03){return new BPromise(function(_0x4ca238,_0x31eeb6){return client['request'](_0x33f849,_0x1aff03)[_0xa337('0x9')](function(_0x538ee0){logger[_0xa337('0xa')](_0xa337('0xb'),_0x5b1651,_0xa337('0xc'));logger[_0xa337('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5b1651,_0xa337('0xc'),JSON[_0xa337('0xe')](_0x538ee0));if(_0x538ee0[_0xa337('0xf')]){if(_0x538ee0[_0xa337('0xf')][_0xa337('0x10')]===0x1f4){logger[_0xa337('0xf')](_0xa337('0xb'),_0x5b1651,_0x538ee0[_0xa337('0xf')]['message']);return _0x31eeb6(_0x538ee0['error'][_0xa337('0x11')]);}logger[_0xa337('0xf')](_0xa337('0xb'),_0x5b1651,_0x538ee0[_0xa337('0xf')][_0xa337('0x11')]);return _0x4ca238(_0x538ee0[_0xa337('0xf')][_0xa337('0x11')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x5b1651,_0xa337('0xc'));_0x4ca238(_0x538ee0[_0xa337('0x12')][_0xa337('0x11')]);}})[_0xa337('0x13')](function(_0x27469a){logger[_0xa337('0xf')](_0xa337('0xb'),_0x5b1651,_0x27469a);_0x31eeb6(_0x27469a);});});} \ No newline at end of file +var _0xe402=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20e820,_0x4c5a7f){var _0x548162=function(_0x15a76b){while(--_0x15a76b){_0x20e820['push'](_0x20e820['shift']());}};_0x548162(++_0x4c5a7f);}(_0xe402,0x14e));var _0x2e40=function(_0x249970,_0x2e180c){_0x249970=_0x249970-0x0;var _0x1b351f=_0xe402[_0x249970];return _0x1b351f;};'use strict';var _=require(_0x2e40('0x0'));var util=require(_0x2e40('0x1'));var moment=require(_0x2e40('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e40('0x3'));var fs=require('fs');var Redis=require(_0x2e40('0x4'));var db=require(_0x2e40('0x5'))['db'];var utils=require(_0x2e40('0x6'));var logger=require(_0x2e40('0x7'))(_0x2e40('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e40('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d7a6,_0x5d3689,_0x59ca9e){return new BPromise(function(_0x5eb675,_0x49435c){return client[_0x2e40('0xa')](_0x12d7a6,_0x59ca9e)[_0x2e40('0xb')](function(_0x3f7ce8){logger[_0x2e40('0xc')](_0x2e40('0xd'),_0x5d3689,_0x2e40('0xe'));logger[_0x2e40('0xf')](_0x2e40('0x10'),_0x5d3689,_0x2e40('0xe'),JSON[_0x2e40('0x11')](_0x3f7ce8));if(_0x3f7ce8[_0x2e40('0x12')]){if(_0x3f7ce8[_0x2e40('0x12')][_0x2e40('0x13')]===0x1f4){logger[_0x2e40('0x12')](_0x2e40('0xd'),_0x5d3689,_0x3f7ce8[_0x2e40('0x12')][_0x2e40('0x14')]);return _0x49435c(_0x3f7ce8['error'][_0x2e40('0x14')]);}logger[_0x2e40('0x12')](_0x2e40('0xd'),_0x5d3689,_0x3f7ce8[_0x2e40('0x12')]['message']);return _0x5eb675(_0x3f7ce8[_0x2e40('0x12')][_0x2e40('0x14')]);}else{logger['info'](_0x2e40('0xd'),_0x5d3689,_0x2e40('0xe'));_0x5eb675(_0x3f7ce8[_0x2e40('0x15')]['message']);}})['catch'](function(_0x59cfc4){logger[_0x2e40('0x12')](_0x2e40('0xd'),_0x5d3689,_0x59cfc4);_0x49435c(_0x59cfc4);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d6f7212..b258fff 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 _0x635c=['isAuthenticated','index','show','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get'];(function(_0x3ed108,_0x572697){var _0x5ac7a2=function(_0x2f3ad1){while(--_0x2f3ad1){_0x3ed108['push'](_0x3ed108['shift']());}};_0x5ac7a2(++_0x572697);}(_0x635c,0x14d));var _0xc635=function(_0x1b9437,_0x3f6fb2){_0x1b9437=_0x1b9437-0x0;var _0x33621f=_0x635c[_0x1b9437];return _0x33621f;};'use strict';var multer=require('multer');var util=require(_0xc635('0x0'));var path=require(_0xc635('0x1'));var timeout=require(_0xc635('0x2'));var express=require(_0xc635('0x3'));var router=express[_0xc635('0x4')]();var fs_extra=require(_0xc635('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc635('0x6'));var config=require('../../config/environment');var controller=require(_0xc635('0x7'));router[_0xc635('0x8')]('/',auth[_0xc635('0x9')](),controller[_0xc635('0xa')]);router['get']('/:id',auth[_0xc635('0x9')](),controller[_0xc635('0xb')]);router['post']('/',auth[_0xc635('0x9')](),controller[_0xc635('0xc')]);router[_0xc635('0xd')](_0xc635('0xe'),auth['isAuthenticated'](),controller[_0xc635('0xf')]);router[_0xc635('0x10')]('/:id',auth[_0xc635('0x9')](),controller['destroy']);module[_0xc635('0x11')]=router; \ No newline at end of file +var _0x21ac=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19d48d,_0xc31e9e){var _0x1da815=function(_0x18686){while(--_0x18686){_0x19d48d['push'](_0x19d48d['shift']());}};_0x1da815(++_0xc31e9e);}(_0x21ac,0x65));var _0xc21a=function(_0x2fc554,_0x2719f0){_0x2fc554=_0x2fc554-0x0;var _0xc05dce=_0x21ac[_0x2fc554];return _0xc05dce;};'use strict';var multer=require(_0xc21a('0x0'));var util=require('util');var path=require(_0xc21a('0x1'));var timeout=require(_0xc21a('0x2'));var express=require(_0xc21a('0x3'));var router=express['Router']();var fs_extra=require(_0xc21a('0x4'));var auth=require(_0xc21a('0x5'));var interaction=require(_0xc21a('0x6'));var config=require(_0xc21a('0x7'));var controller=require(_0xc21a('0x8'));router[_0xc21a('0x9')]('/',auth[_0xc21a('0xa')](),controller['index']);router[_0xc21a('0x9')](_0xc21a('0xb'),auth[_0xc21a('0xa')](),controller[_0xc21a('0xc')]);router[_0xc21a('0xd')]('/',auth[_0xc21a('0xa')](),controller[_0xc21a('0xe')]);router[_0xc21a('0xf')](_0xc21a('0xb'),auth[_0xc21a('0xa')](),controller[_0xc21a('0x10')]);router['delete'](_0xc21a('0xb'),auth[_0xc21a('0xa')](),controller['destroy']);module[_0xc21a('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 c4504f0..5be278c 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 _0x8d76=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x8d76,0xa2));var _0x68d7=function(_0x181c8e,_0x2a0dc9){_0x181c8e=_0x181c8e-0x0;var _0x3ba7cf=_0x8d76[_0x181c8e];return _0x3ba7cf;};'use strict';var Sequelize=require(_0x68d7('0x0'));module[_0x68d7('0x1')]={'type':{'type':Sequelize[_0x68d7('0x2')]('string',_0x68d7('0x3'),_0x68d7('0x4'),_0x68d7('0x5'),'picklist'),'defaultValue':_0x68d7('0x6')},'content':{'type':Sequelize[_0x68d7('0x7')]},'key':{'type':Sequelize[_0x68d7('0x7')]},'keyType':{'type':Sequelize[_0x68d7('0x2')](_0x68d7('0x6'),_0x68d7('0x3'),_0x68d7('0x4'))},'keyContent':{'type':Sequelize[_0x68d7('0x7')]},'idField':{'type':Sequelize[_0x68d7('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x10b4=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x4cba45,_0x1960c1){var _0x4c6c67=function(_0x319a94){while(--_0x319a94){_0x4cba45['push'](_0x4cba45['shift']());}};_0x4c6c67(++_0x1960c1);}(_0x10b4,0x74));var _0x410b=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x10b4[_0x3de8a4];return _0x4635cf;};'use strict';var Sequelize=require(_0x410b('0x0'));module['exports']={'type':{'type':Sequelize[_0x410b('0x1')](_0x410b('0x2'),_0x410b('0x3'),_0x410b('0x4'),_0x410b('0x5'),_0x410b('0x6')),'defaultValue':_0x410b('0x2')},'content':{'type':Sequelize[_0x410b('0x7')]},'key':{'type':Sequelize[_0x410b('0x7')]},'keyType':{'type':Sequelize[_0x410b('0x1')](_0x410b('0x2'),_0x410b('0x3'),_0x410b('0x4'))},'keyContent':{'type':Sequelize[_0x410b('0x7')]},'idField':{'type':Sequelize[_0x410b('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 3e59490..1c455f1 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 _0x4267=['../../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','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','SalesforceField','includeAll','findAll','rows','catch','show','params','filters','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x42af3a,_0x2aafb9){var _0x14d099=function(_0x14a06d){while(--_0x14a06d){_0x42af3a['push'](_0x42af3a['shift']());}};_0x14d099(++_0x2aafb9);}(_0x4267,0x170));var _0x7426=function(_0x38b4de,_0x3b2b10){_0x38b4de=_0x38b4de-0x0;var _0x54f3dc=_0x4267[_0x38b4de];return _0x54f3dc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7426('0x0'));var jsonpatch=require(_0x7426('0x1'));var rp=require(_0x7426('0x2'));var moment=require(_0x7426('0x3'));var BPromise=require(_0x7426('0x4'));var Mustache=require('mustache');var util=require(_0x7426('0x5'));var path=require('path');var sox=require(_0x7426('0x6'));var csv=require(_0x7426('0x7'));var ejs=require(_0x7426('0x8'));var fs=require('fs');var fs_extra=require(_0x7426('0x9'));var _=require(_0x7426('0xa'));var squel=require(_0x7426('0xb'));var crypto=require(_0x7426('0xc'));var jsforce=require(_0x7426('0xd'));var deskjs=require(_0x7426('0xe'));var toCsv=require(_0x7426('0x7'));var querystring=require(_0x7426('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7426('0x10'));var qs=require(_0x7426('0x11'));var as=require(_0x7426('0x12'));var hardwareService=require(_0x7426('0x13'));var logger=require(_0x7426('0x14'))(_0x7426('0x15'));var utils=require(_0x7426('0x16'));var config=require(_0x7426('0x17'));var licenseUtil=require(_0x7426('0x18'));var db=require(_0x7426('0x19'))['db'];function respondWithStatusCode(_0x1d09bb,_0x1b2f67){_0x1b2f67=_0x1b2f67||0xcc;return function(_0x2fdbcf){if(_0x2fdbcf){return _0x1d09bb[_0x7426('0x1a')](_0x1b2f67);}return _0x1d09bb[_0x7426('0x1b')](_0x1b2f67)[_0x7426('0x1c')]();};}function respondWithResult(_0x207d75,_0x1811a2){_0x1811a2=_0x1811a2||0xc8;return function(_0x1db212){if(_0x1db212){return _0x207d75[_0x7426('0x1b')](_0x1811a2)[_0x7426('0x1d')](_0x1db212);}};}function respondWithFilteredResult(_0x4f1e77,_0x124344){return function(_0x3c8848){if(_0x3c8848){var _0x3d4272=typeof _0x124344[_0x7426('0x1e')]===_0x7426('0x1f')&&typeof _0x124344[_0x7426('0x20')]===_0x7426('0x1f');var _0x51e0ee=_0x3c8848['count'];var _0x569f04=_0x3d4272?0x0:_0x124344['offset'];var _0x17a6b0=_0x3d4272?_0x3c8848[_0x7426('0x21')]:_0x124344['offset']+_0x124344['limit'];var _0xe0abdd;if(_0x17a6b0>=_0x51e0ee){_0x17a6b0=_0x51e0ee;_0xe0abdd=0xc8;}else{_0xe0abdd=0xce;}_0x4f1e77[_0x7426('0x1b')](_0xe0abdd);return _0x4f1e77[_0x7426('0x22')](_0x7426('0x23'),_0x569f04+'-'+_0x17a6b0+'/'+_0x51e0ee)[_0x7426('0x1d')](_0x3c8848);}return null;};}function patchUpdates(_0x3dce15){return function(_0x488e88){try{jsonpatch[_0x7426('0x24')](_0x488e88,_0x3dce15,!![]);}catch(_0x1977ea){return BPromise[_0x7426('0x25')](_0x1977ea);}return _0x488e88[_0x7426('0x26')]();};}function saveUpdates(_0x53dbe8,_0x3f95be){return function(_0x4134fd){if(_0x4134fd){return _0x4134fd[_0x7426('0x27')](_0x53dbe8)[_0x7426('0x28')](function(_0x34b9af){return _0x34b9af;});}return null;};}function removeEntity(_0x5fd63b,_0x2489d9){return function(_0x2d8a2f){if(_0x2d8a2f){return _0x2d8a2f['destroy']()[_0x7426('0x28')](function(){_0x5fd63b[_0x7426('0x1b')](0xcc)[_0x7426('0x1c')]();});}};}function handleEntityNotFound(_0x363c01,_0x328086){return function(_0xa335bd){if(!_0xa335bd){_0x363c01[_0x7426('0x1a')](0x194);}return _0xa335bd;};}function handleError(_0x3f1db3,_0xae481d){_0xae481d=_0xae481d||0x1f4;return function(_0xfcba0f){logger[_0x7426('0x29')](_0xfcba0f[_0x7426('0x2a')]);if(_0xfcba0f[_0x7426('0x2b')]){delete _0xfcba0f[_0x7426('0x2b')];}_0x3f1db3[_0x7426('0x1b')](_0xae481d)[_0x7426('0x2c')](_0xfcba0f);};}exports[_0x7426('0x2d')]=function(_0x142d9a,_0x5af2a4){var _0x53ba90={},_0x4275ec={},_0x57e7c8={'count':0x0,'rows':[]};var _0x400282=_[_0x7426('0x2e')](db['SalesforceField'][_0x7426('0x2f')],function(_0x43e420){return{'name':_0x43e420[_0x7426('0x30')],'type':_0x43e420[_0x7426('0x31')][_0x7426('0x32')]};});_0x4275ec['model']=_[_0x7426('0x2e')](_0x400282,_0x7426('0x2b'));_0x4275ec[_0x7426('0x33')]=_[_0x7426('0x34')](_0x142d9a[_0x7426('0x33')]);_0x4275ec['filters']=_[_0x7426('0x35')](_0x4275ec['model'],_0x4275ec[_0x7426('0x33')]);_0x53ba90['attributes']=_[_0x7426('0x35')](_0x4275ec[_0x7426('0x36')],qs[_0x7426('0x37')](_0x142d9a[_0x7426('0x33')]['fields']));_0x53ba90['attributes']=_0x53ba90[_0x7426('0x38')][_0x7426('0x39')]?_0x53ba90[_0x7426('0x38')]:_0x4275ec[_0x7426('0x36')];if(!_0x142d9a['query'][_0x7426('0x3a')]('nolimit')){_0x53ba90[_0x7426('0x20')]=qs[_0x7426('0x20')](_0x142d9a[_0x7426('0x33')][_0x7426('0x20')]);_0x53ba90[_0x7426('0x1e')]=qs['offset'](_0x142d9a[_0x7426('0x33')][_0x7426('0x1e')]);}_0x53ba90[_0x7426('0x3b')]=qs[_0x7426('0x3c')](_0x142d9a[_0x7426('0x33')][_0x7426('0x3c')]);_0x53ba90[_0x7426('0x3d')]=qs['filters'](_[_0x7426('0x3e')](_0x142d9a[_0x7426('0x33')],_0x4275ec['filters']),_0x400282);if(_0x142d9a[_0x7426('0x33')][_0x7426('0x3f')]){_0x53ba90[_0x7426('0x3d')]=_[_0x7426('0x40')](_0x53ba90[_0x7426('0x3d')],{'$or':_[_0x7426('0x2e')](_0x400282,function(_0x1a0d73){if(_0x1a0d73[_0x7426('0x31')]!=='VIRTUAL'){var _0x226e64={};_0x226e64[_0x1a0d73[_0x7426('0x2b')]]={'$like':'%'+_0x142d9a[_0x7426('0x33')][_0x7426('0x3f')]+'%'};return _0x226e64;}})});}_0x53ba90=_[_0x7426('0x40')]({},_0x53ba90,_0x142d9a[_0x7426('0x41')]);var _0x3b83df={'where':_0x53ba90[_0x7426('0x3d')]};return db[_0x7426('0x42')][_0x7426('0x21')](_0x3b83df)[_0x7426('0x28')](function(_0x57f3b8){_0x57e7c8['count']=_0x57f3b8;if(_0x142d9a[_0x7426('0x33')][_0x7426('0x43')]){_0x53ba90['include']=[{'all':!![]}];}return db['SalesforceField'][_0x7426('0x44')](_0x53ba90);})[_0x7426('0x28')](function(_0x36e223){_0x57e7c8[_0x7426('0x45')]=_0x36e223;return _0x57e7c8;})[_0x7426('0x28')](respondWithFilteredResult(_0x5af2a4,_0x53ba90))[_0x7426('0x46')](handleError(_0x5af2a4,null));};exports[_0x7426('0x47')]=function(_0x494c3e,_0x1f6bd8){var _0x1a0571={'raw':!![],'where':{'id':_0x494c3e[_0x7426('0x48')]['id']}},_0xec0f9f={};_0xec0f9f[_0x7426('0x36')]=_[_0x7426('0x34')](db[_0x7426('0x42')][_0x7426('0x2f')]);_0xec0f9f[_0x7426('0x33')]=_[_0x7426('0x34')](_0x494c3e[_0x7426('0x33')]);_0xec0f9f[_0x7426('0x49')]=_[_0x7426('0x35')](_0xec0f9f[_0x7426('0x36')],_0xec0f9f[_0x7426('0x33')]);_0x1a0571[_0x7426('0x38')]=_[_0x7426('0x35')](_0xec0f9f[_0x7426('0x36')],qs[_0x7426('0x37')](_0x494c3e[_0x7426('0x33')][_0x7426('0x37')]));_0x1a0571[_0x7426('0x38')]=_0x1a0571['attributes'][_0x7426('0x39')]?_0x1a0571[_0x7426('0x38')]:_0xec0f9f['model'];if(_0x494c3e[_0x7426('0x33')][_0x7426('0x43')]){_0x1a0571['include']=[{'all':!![]}];}_0x1a0571=_['merge']({},_0x1a0571,_0x494c3e[_0x7426('0x41')]);return db[_0x7426('0x42')]['find'](_0x1a0571)[_0x7426('0x28')](handleEntityNotFound(_0x1f6bd8,null))['then'](respondWithResult(_0x1f6bd8,null))['catch'](handleError(_0x1f6bd8,null));};exports[_0x7426('0x4a')]=function(_0xb5b964,_0x8da533){return db[_0x7426('0x42')][_0x7426('0x4a')](_0xb5b964[_0x7426('0x4b')],{})[_0x7426('0x28')](respondWithResult(_0x8da533,0xc9))[_0x7426('0x46')](handleError(_0x8da533,null));};exports['update']=function(_0x4b13f7,_0x23506d){if(_0x4b13f7[_0x7426('0x4b')]['id']){delete _0x4b13f7[_0x7426('0x4b')]['id'];}return db[_0x7426('0x42')]['find']({'where':{'id':_0x4b13f7['params']['id']}})[_0x7426('0x28')](handleEntityNotFound(_0x23506d,null))['then'](saveUpdates(_0x4b13f7[_0x7426('0x4b')],null))[_0x7426('0x28')](respondWithResult(_0x23506d,null))['catch'](handleError(_0x23506d,null));};exports[_0x7426('0x4c')]=function(_0x119d4e,_0x2d7a2d){return db[_0x7426('0x42')]['find']({'where':{'id':_0x119d4e[_0x7426('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d7a2d,null))['then'](removeEntity(_0x2d7a2d,null))[_0x7426('0x46')](handleError(_0x2d7a2d,null));}; \ No newline at end of file +var _0x3dc3=['fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','status','json','offset','limit','undefined','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','SalesforceField','fieldName','type','key','model','map','query','filters','intersection'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x3dc3,0x1e6));var _0x33dc=function(_0x23c315,_0x1be62f){_0x23c315=_0x23c315-0x0;var _0xf9ebf1=_0x3dc3[_0x23c315];return _0xf9ebf1;};'use strict';var emlformat=require(_0x33dc('0x0'));var rimraf=require(_0x33dc('0x1'));var zipdir=require(_0x33dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x33dc('0x3'));var BPromise=require(_0x33dc('0x4'));var Mustache=require(_0x33dc('0x5'));var util=require(_0x33dc('0x6'));var path=require(_0x33dc('0x7'));var sox=require(_0x33dc('0x8'));var csv=require(_0x33dc('0x9'));var ejs=require(_0x33dc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33dc('0xb'));var squel=require(_0x33dc('0xc'));var crypto=require('crypto');var jsforce=require(_0x33dc('0xd'));var deskjs=require(_0x33dc('0xe'));var toCsv=require(_0x33dc('0x9'));var querystring=require(_0x33dc('0xf'));var Papa=require(_0x33dc('0x10'));var Redis=require(_0x33dc('0x11'));var authService=require(_0x33dc('0x12'));var qs=require(_0x33dc('0x13'));var as=require(_0x33dc('0x14'));var hardwareService=require(_0x33dc('0x15'));var logger=require(_0x33dc('0x16'))('api');var utils=require(_0x33dc('0x17'));var config=require(_0x33dc('0x18'));var licenseUtil=require(_0x33dc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd35687,_0x225540){_0x225540=_0x225540||0xcc;return function(_0x437d6e){if(_0x437d6e){return _0xd35687['sendStatus'](_0x225540);}return _0xd35687[_0x33dc('0x1a')](_0x225540)['end']();};}function respondWithResult(_0x445f71,_0x532af0){_0x532af0=_0x532af0||0xc8;return function(_0x471fa8){if(_0x471fa8){return _0x445f71['status'](_0x532af0)[_0x33dc('0x1b')](_0x471fa8);}};}function respondWithFilteredResult(_0x257b1c,_0x3193aa){return function(_0x127a44){if(_0x127a44){var _0xc5e408=typeof _0x3193aa[_0x33dc('0x1c')]==='undefined'&&typeof _0x3193aa[_0x33dc('0x1d')]===_0x33dc('0x1e');var _0x53d3da=_0x127a44['count'];var _0x3cc212=_0xc5e408?0x0:_0x3193aa[_0x33dc('0x1c')];var _0x3c500e=_0xc5e408?_0x127a44['count']:_0x3193aa[_0x33dc('0x1c')]+_0x3193aa['limit'];var _0x448ceb;if(_0x3c500e>=_0x53d3da){_0x3c500e=_0x53d3da;_0x448ceb=0xc8;}else{_0x448ceb=0xce;}_0x257b1c[_0x33dc('0x1a')](_0x448ceb);return _0x257b1c[_0x33dc('0x1f')](_0x33dc('0x20'),_0x3cc212+'-'+_0x3c500e+'/'+_0x53d3da)[_0x33dc('0x1b')](_0x127a44);}return null;};}function patchUpdates(_0x3d61b7){return function(_0xad805e){try{jsonpatch[_0x33dc('0x21')](_0xad805e,_0x3d61b7,!![]);}catch(_0x2bb55f){return BPromise['reject'](_0x2bb55f);}return _0xad805e[_0x33dc('0x22')]();};}function saveUpdates(_0x52dbc1,_0x8f2fbd){return function(_0x26f3ef){if(_0x26f3ef){return _0x26f3ef[_0x33dc('0x23')](_0x52dbc1)[_0x33dc('0x24')](function(_0x2d1b06){return _0x2d1b06;});}return null;};}function removeEntity(_0x3bc70f,_0x453968){return function(_0x2c8681){if(_0x2c8681){return _0x2c8681[_0x33dc('0x25')]()['then'](function(){_0x3bc70f['status'](0xcc)[_0x33dc('0x26')]();});}};}function handleEntityNotFound(_0x373a67,_0x4f8202){return function(_0x549432){if(!_0x549432){_0x373a67[_0x33dc('0x27')](0x194);}return _0x549432;};}function handleError(_0x4c0a78,_0x388e8d){_0x388e8d=_0x388e8d||0x1f4;return function(_0x1cb7d5){logger[_0x33dc('0x28')](_0x1cb7d5[_0x33dc('0x29')]);if(_0x1cb7d5[_0x33dc('0x2a')]){delete _0x1cb7d5[_0x33dc('0x2a')];}_0x4c0a78[_0x33dc('0x1a')](_0x388e8d)['send'](_0x1cb7d5);};}exports[_0x33dc('0x2b')]=function(_0x3f3d94,_0x27f819){var _0x4b4b65={},_0x13ebf5={},_0x576714={'count':0x0,'rows':[]};var _0x268301=_['map'](db[_0x33dc('0x2c')]['rawAttributes'],function(_0x232666){return{'name':_0x232666[_0x33dc('0x2d')],'type':_0x232666[_0x33dc('0x2e')][_0x33dc('0x2f')]};});_0x13ebf5[_0x33dc('0x30')]=_[_0x33dc('0x31')](_0x268301,_0x33dc('0x2a'));_0x13ebf5[_0x33dc('0x32')]=_['keys'](_0x3f3d94['query']);_0x13ebf5[_0x33dc('0x33')]=_[_0x33dc('0x34')](_0x13ebf5[_0x33dc('0x30')],_0x13ebf5[_0x33dc('0x32')]);_0x4b4b65['attributes']=_['intersection'](_0x13ebf5[_0x33dc('0x30')],qs['fields'](_0x3f3d94[_0x33dc('0x32')][_0x33dc('0x35')]));_0x4b4b65['attributes']=_0x4b4b65[_0x33dc('0x36')][_0x33dc('0x37')]?_0x4b4b65[_0x33dc('0x36')]:_0x13ebf5[_0x33dc('0x30')];if(!_0x3f3d94[_0x33dc('0x32')][_0x33dc('0x38')]('nolimit')){_0x4b4b65['limit']=qs[_0x33dc('0x1d')](_0x3f3d94[_0x33dc('0x32')][_0x33dc('0x1d')]);_0x4b4b65[_0x33dc('0x1c')]=qs[_0x33dc('0x1c')](_0x3f3d94['query'][_0x33dc('0x1c')]);}_0x4b4b65[_0x33dc('0x39')]=qs[_0x33dc('0x3a')](_0x3f3d94['query'][_0x33dc('0x3a')]);_0x4b4b65['where']=qs[_0x33dc('0x33')](_['pick'](_0x3f3d94[_0x33dc('0x32')],_0x13ebf5[_0x33dc('0x33')]),_0x268301);if(_0x3f3d94[_0x33dc('0x32')][_0x33dc('0x3b')]){_0x4b4b65[_0x33dc('0x3c')]=_[_0x33dc('0x3d')](_0x4b4b65[_0x33dc('0x3c')],{'$or':_[_0x33dc('0x31')](_0x268301,function(_0x8f6ce7){if(_0x8f6ce7[_0x33dc('0x2e')]!==_0x33dc('0x3e')){var _0x13ee74={};_0x13ee74[_0x8f6ce7[_0x33dc('0x2a')]]={'$like':'%'+_0x3f3d94[_0x33dc('0x32')][_0x33dc('0x3b')]+'%'};return _0x13ee74;}})});}_0x4b4b65=_[_0x33dc('0x3d')]({},_0x4b4b65,_0x3f3d94['options']);var _0xfd1133={'where':_0x4b4b65[_0x33dc('0x3c')]};return db[_0x33dc('0x2c')][_0x33dc('0x3f')](_0xfd1133)[_0x33dc('0x24')](function(_0x22daae){_0x576714['count']=_0x22daae;if(_0x3f3d94[_0x33dc('0x32')][_0x33dc('0x40')]){_0x4b4b65[_0x33dc('0x41')]=[{'all':!![]}];}return db[_0x33dc('0x2c')][_0x33dc('0x42')](_0x4b4b65);})[_0x33dc('0x24')](function(_0x15c093){_0x576714[_0x33dc('0x43')]=_0x15c093;return _0x576714;})[_0x33dc('0x24')](respondWithFilteredResult(_0x27f819,_0x4b4b65))[_0x33dc('0x44')](handleError(_0x27f819,null));};exports[_0x33dc('0x45')]=function(_0x2f3ab8,_0x59231e){var _0x2ad900={'raw':!![],'where':{'id':_0x2f3ab8[_0x33dc('0x46')]['id']}},_0x4cfa3b={};_0x4cfa3b[_0x33dc('0x30')]=_[_0x33dc('0x47')](db[_0x33dc('0x2c')][_0x33dc('0x48')]);_0x4cfa3b['query']=_[_0x33dc('0x47')](_0x2f3ab8[_0x33dc('0x32')]);_0x4cfa3b['filters']=_[_0x33dc('0x34')](_0x4cfa3b[_0x33dc('0x30')],_0x4cfa3b[_0x33dc('0x32')]);_0x2ad900[_0x33dc('0x36')]=_[_0x33dc('0x34')](_0x4cfa3b[_0x33dc('0x30')],qs[_0x33dc('0x35')](_0x2f3ab8[_0x33dc('0x32')][_0x33dc('0x35')]));_0x2ad900[_0x33dc('0x36')]=_0x2ad900[_0x33dc('0x36')][_0x33dc('0x37')]?_0x2ad900[_0x33dc('0x36')]:_0x4cfa3b['model'];if(_0x2f3ab8[_0x33dc('0x32')][_0x33dc('0x40')]){_0x2ad900[_0x33dc('0x41')]=[{'all':!![]}];}_0x2ad900=_['merge']({},_0x2ad900,_0x2f3ab8[_0x33dc('0x49')]);return db[_0x33dc('0x2c')][_0x33dc('0x4a')](_0x2ad900)[_0x33dc('0x24')](handleEntityNotFound(_0x59231e,null))[_0x33dc('0x24')](respondWithResult(_0x59231e,null))[_0x33dc('0x44')](handleError(_0x59231e,null));};exports[_0x33dc('0x4b')]=function(_0x1433b3,_0x5d7cf1){return db[_0x33dc('0x2c')][_0x33dc('0x4b')](_0x1433b3[_0x33dc('0x4c')],{})[_0x33dc('0x24')](respondWithResult(_0x5d7cf1,0xc9))[_0x33dc('0x44')](handleError(_0x5d7cf1,null));};exports[_0x33dc('0x23')]=function(_0x20c97e,_0x3371b3){if(_0x20c97e['body']['id']){delete _0x20c97e[_0x33dc('0x4c')]['id'];}return db[_0x33dc('0x2c')][_0x33dc('0x4a')]({'where':{'id':_0x20c97e['params']['id']}})['then'](handleEntityNotFound(_0x3371b3,null))['then'](saveUpdates(_0x20c97e[_0x33dc('0x4c')],null))['then'](respondWithResult(_0x3371b3,null))['catch'](handleError(_0x3371b3,null));};exports[_0x33dc('0x25')]=function(_0x4ca05b,_0x3ca5a1){return db[_0x33dc('0x2c')]['find']({'where':{'id':_0x4ca05b[_0x33dc('0x46')]['id']}})[_0x33dc('0x24')](handleEntityNotFound(_0x3ca5a1,null))[_0x33dc('0x24')](removeEntity(_0x3ca5a1,null))['catch'](handleError(_0x3ca5a1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 0ffcfab..a8d25a9 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 _0xba9b=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','salesforce_unique_index','idField','FieldId','lodash','util'];(function(_0x2390e5,_0x369025){var _0xa6038f=function(_0x2e74a3){while(--_0x2e74a3){_0x2390e5['push'](_0x2390e5['shift']());}};_0xa6038f(++_0x369025);}(_0xba9b,0xce));var _0xbba9=function(_0x50f6d7,_0x176709){_0x50f6d7=_0x50f6d7-0x0;var _0x5cc288=_0xba9b[_0x50f6d7];return _0x5cc288;};'use strict';var _=require(_0xbba9('0x0'));var util=require(_0xbba9('0x1'));var logger=require(_0xbba9('0x2'))(_0xbba9('0x3'));var moment=require(_0xbba9('0x4'));var BPromise=require(_0xbba9('0x5'));var rp=require(_0xbba9('0x6'));var fs=require('fs');var path=require(_0xbba9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xbba9('0x8')]=function(_0x4f60bc,_0x15d0f5){return _0x4f60bc[_0xbba9('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xbba9('0xa'),'fields':[_0xbba9('0xb'),_0xbba9('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x163f=['./intSalesforceField.attributes','exports','define','FieldId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2619e3,_0x343e45){var _0x4bed45=function(_0x51497d){while(--_0x51497d){_0x2619e3['push'](_0x2619e3['shift']());}};_0x4bed45(++_0x343e45);}(_0x163f,0x13c));var _0xf163=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x163f[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var logger=require('../../config/logger')(_0xf163('0x2'));var moment=require(_0xf163('0x3'));var BPromise=require(_0xf163('0x4'));var rp=require(_0xf163('0x5'));var fs=require('fs');var path=require(_0xf163('0x6'));var rimraf=require('rimraf');var config=require(_0xf163('0x7'));var attributes=require(_0xf163('0x8'));module[_0xf163('0x9')]=function(_0x4b04ee,_0x4bd2f3){return _0x4b04ee[_0xf163('0xa')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xf163('0xb')],'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 2c97bcc..c906ca3 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 _0xc144=['jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc144,0x160));var _0x4c14=function(_0x103ff2,_0x407afc){_0x103ff2=_0x103ff2-0x0;var _0xf66340=_0xc144[_0x103ff2];return _0xf66340;};'use strict';var _=require(_0x4c14('0x0'));var util=require(_0x4c14('0x1'));var moment=require(_0x4c14('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c14('0x3'))['db'];var utils=require(_0x4c14('0x4'));var logger=require(_0x4c14('0x5'))(_0x4c14('0x6'));var config=require(_0x4c14('0x7'));var jayson=require(_0x4c14('0x8'));var client=jayson[_0x4c14('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a750a,_0x4e5567,_0x4f0ad3){return new BPromise(function(_0x2f98f9,_0x289bad){return client[_0x4c14('0xa')](_0x5a750a,_0x4f0ad3)['then'](function(_0x5ee813){logger[_0x4c14('0xb')](_0x4c14('0xc'),_0x4e5567,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4e5567,_0x4c14('0xd'),JSON[_0x4c14('0xe')](_0x5ee813));if(_0x5ee813[_0x4c14('0xf')]){if(_0x5ee813['error'][_0x4c14('0x10')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4e5567,_0x5ee813[_0x4c14('0xf')][_0x4c14('0x11')]);return _0x289bad(_0x5ee813[_0x4c14('0xf')][_0x4c14('0x11')]);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x4e5567,_0x5ee813[_0x4c14('0xf')][_0x4c14('0x11')]);return _0x2f98f9(_0x5ee813['error'][_0x4c14('0x11')]);}else{logger[_0x4c14('0xb')](_0x4c14('0xc'),_0x4e5567,_0x4c14('0xd'));_0x2f98f9(_0x5ee813[_0x4c14('0x12')][_0x4c14('0x11')]);}})[_0x4c14('0x13')](function(_0x5963a4){logger[_0x4c14('0xf')](_0x4c14('0xc'),_0x4e5567,_0x5963a4);_0x289bad(_0x5963a4);});});} \ No newline at end of file +var _0x80bc=['error','SalesforceField,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ef237,_0x5206a5){var _0x50785e=function(_0x5eb9b5){while(--_0x5eb9b5){_0x2ef237['push'](_0x2ef237['shift']());}};_0x50785e(++_0x5206a5);}(_0x80bc,0x10d));var _0xc80b=function(_0x560924,_0x258a47){_0x560924=_0x560924-0x0;var _0x5c694d=_0x80bc[_0x560924];return _0x5c694d;};'use strict';var _=require('lodash');var util=require(_0xc80b('0x0'));var moment=require(_0xc80b('0x1'));var BPromise=require('bluebird');var rs=require(_0xc80b('0x2'));var fs=require('fs');var Redis=require(_0xc80b('0x3'));var db=require(_0xc80b('0x4'))['db'];var utils=require(_0xc80b('0x5'));var logger=require(_0xc80b('0x6'))(_0xc80b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc80b('0x8'));var client=jayson[_0xc80b('0x9')][_0xc80b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dde3c,_0x238cb6,_0x22607f){return new BPromise(function(_0x4d6bb6,_0x29110f){return client[_0xc80b('0xb')](_0x2dde3c,_0x22607f)[_0xc80b('0xc')](function(_0x258137){logger[_0xc80b('0xd')]('SalesforceField,\x20%s,\x20%s',_0x238cb6,'request\x20sent');logger[_0xc80b('0xe')](_0xc80b('0xf'),_0x238cb6,'request\x20sent',JSON[_0xc80b('0x10')](_0x258137));if(_0x258137[_0xc80b('0x11')]){if(_0x258137[_0xc80b('0x11')]['code']===0x1f4){logger[_0xc80b('0x11')](_0xc80b('0x12'),_0x238cb6,_0x258137[_0xc80b('0x11')]['message']);return _0x29110f(_0x258137[_0xc80b('0x11')][_0xc80b('0x13')]);}logger[_0xc80b('0x11')](_0xc80b('0x12'),_0x238cb6,_0x258137[_0xc80b('0x11')][_0xc80b('0x13')]);return _0x4d6bb6(_0x258137[_0xc80b('0x11')][_0xc80b('0x13')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x238cb6,_0xc80b('0x14'));_0x4d6bb6(_0x258137['result'][_0xc80b('0x13')]);}})[_0xc80b('0x15')](function(_0x271afe){logger['error'](_0xc80b('0x12'),_0x238cb6,_0x271afe);_0x29110f(_0x271afe);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 14c572a..3dda8e7 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 _0x1109=['/:id/configurations','getFields','post','create','/:id','delete','destroy','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index'];(function(_0x446186,_0x116e31){var _0x63b564=function(_0x590a14){while(--_0x590a14){_0x446186['push'](_0x446186['shift']());}};_0x63b564(++_0x116e31);}(_0x1109,0x17d));var _0x9110=function(_0x3046d8,_0x19af5e){_0x3046d8=_0x3046d8-0x0;var _0x56ecb6=_0x1109[_0x3046d8];return _0x56ecb6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9110('0x0'));var timeout=require('connect-timeout');var express=require(_0x9110('0x1'));var router=express['Router']();var fs_extra=require(_0x9110('0x2'));var auth=require(_0x9110('0x3'));var interaction=require(_0x9110('0x4'));var config=require(_0x9110('0x5'));var controller=require(_0x9110('0x6'));router[_0x9110('0x7')]('/',auth[_0x9110('0x8')](),controller[_0x9110('0x9')]);router[_0x9110('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9110('0x7')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller['getConfigurations']);router[_0x9110('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9110('0xb')]);router[_0x9110('0xc')]('/',auth[_0x9110('0x8')](),controller[_0x9110('0xd')]);router[_0x9110('0xc')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller['addConfiguration']);router['put'](_0x9110('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x9110('0xf')](_0x9110('0xe'),auth['isAuthenticated'](),controller[_0x9110('0x10')]);module['exports']=router; \ No newline at end of file +var _0x61be=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x4d3b77,_0x3c789c){var _0x1a716a=function(_0x10707c){while(--_0x10707c){_0x4d3b77['push'](_0x4d3b77['shift']());}};_0x1a716a(++_0x3c789c);}(_0x61be,0x1d7));var _0xe61b=function(_0x5071bf,_0x82000e){_0x5071bf=_0x5071bf-0x0;var _0xc68643=_0x61be[_0x5071bf];return _0xc68643;};'use strict';var multer=require(_0xe61b('0x0'));var util=require(_0xe61b('0x1'));var path=require(_0xe61b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe61b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe61b('0x4'));var config=require(_0xe61b('0x5'));var controller=require(_0xe61b('0x6'));router[_0xe61b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe61b('0x7')]('/:id',auth[_0xe61b('0x8')](),controller['show']);router['get'](_0xe61b('0x9'),auth[_0xe61b('0x8')](),controller[_0xe61b('0xa')]);router[_0xe61b('0x7')](_0xe61b('0xb'),auth[_0xe61b('0x8')](),controller[_0xe61b('0xc')]);router[_0xe61b('0xd')]('/',auth['isAuthenticated'](),controller[_0xe61b('0xe')]);router[_0xe61b('0xd')](_0xe61b('0x9'),auth[_0xe61b('0x8')](),controller[_0xe61b('0xf')]);router[_0xe61b('0x10')](_0xe61b('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xe61b('0x12')](_0xe61b('0x11'),auth[_0xe61b('0x8')](),controller['destroy']);module[_0xe61b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index c8b3f90..e2f01bf 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 _0x4132=['STRING','remoteUri','sequelize','exports'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x4132,0xd6));var _0x2413=function(_0x51d69c,_0x13fc9e){_0x51d69c=_0x51d69c-0x0;var _0x36aa80=_0x4132[_0x51d69c];return _0x36aa80;};'use strict';var Sequelize=require(_0x2413('0x0'));module[_0x2413('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2413('0x2')]},'username':{'type':Sequelize[_0x2413('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x2413('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2413('0x3')},'serverUrl':{'type':Sequelize[_0x2413('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8f1c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x316a67,_0x3a5fc6){var _0x3c0529=function(_0x56144b){while(--_0x56144b){_0x316a67['push'](_0x316a67['shift']());}};_0x3c0529(++_0x3a5fc6);}(_0x8f1c,0xe2));var _0xc8f1=function(_0x279299,_0x3731bb){_0x279299=_0x279299-0x0;var _0x8d6208=_0x8f1c[_0x279299];return _0x8d6208;};'use strict';var Sequelize=require(_0xc8f1('0x0'));module[_0xc8f1('0x1')]={'name':{'type':Sequelize[_0xc8f1('0x2')]},'description':{'type':Sequelize[_0xc8f1('0x2')]},'username':{'type':Sequelize[_0xc8f1('0x2')],'unique':_0xc8f1('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc8f1('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc8f1('0x4')},'serverUrl':{'type':Sequelize[_0xc8f1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1276d4e..b9b1aef 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 _0x389c=['addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','made_sla','caused_by','upon_reject','child_incidents','number','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','correlation_display','additional_assignee_list','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_tags','upon_approval','correlation_id','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','remove','forEach','internalType','push','all','assign','log','TCL:\x20_object','includes','label','ServiceNow\x20error:\x20','error','test','statusCode','boolean','True','GET','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowAccount','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','destroy','getConfigurations','ServicenowConfiguration','nolimit'];(function(_0xdaf736,_0xd8c667){var _0x1090b3=function(_0x2eab2e){while(--_0x2eab2e){_0xdaf736['push'](_0xdaf736['shift']());}};_0x1090b3(++_0xd8c667);}(_0x389c,0x64));var _0xc389=function(_0x3bda60,_0x7a7022){_0x3bda60=_0x3bda60-0x0;var _0x34bae8=_0x389c[_0x3bda60];return _0x34bae8;};'use strict';var emlformat=require(_0xc389('0x0'));var rimraf=require(_0xc389('0x1'));var zipdir=require(_0xc389('0x2'));var jsonpatch=require(_0xc389('0x3'));var rp=require(_0xc389('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc389('0x5'));var util=require(_0xc389('0x6'));var path=require(_0xc389('0x7'));var sox=require(_0xc389('0x8'));var csv=require('to-csv');var ejs=require(_0xc389('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc389('0xa'));var squel=require(_0xc389('0xb'));var crypto=require(_0xc389('0xc'));var jsforce=require(_0xc389('0xd'));var deskjs=require(_0xc389('0xe'));var toCsv=require(_0xc389('0xf'));var querystring=require(_0xc389('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc389('0x11'));var qs=require(_0xc389('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc389('0x13'));var logger=require(_0xc389('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc389('0x15'));var licenseUtil=require(_0xc389('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc389('0x17'));function respondWithStatusCode(_0x366b48,_0x42bea6){_0x42bea6=_0x42bea6||0xcc;return function(_0x453ed0){if(_0x453ed0){return _0x366b48[_0xc389('0x18')](_0x42bea6);}return _0x366b48[_0xc389('0x19')](_0x42bea6)[_0xc389('0x1a')]();};}function respondWithResult(_0x28b572,_0x191a2e){_0x191a2e=_0x191a2e||0xc8;return function(_0x4fb920){if(_0x4fb920){return _0x28b572[_0xc389('0x19')](_0x191a2e)[_0xc389('0x1b')](_0x4fb920);}};}function respondWithFilteredResult(_0x4f602c,_0x2933c2){return function(_0x29fa5f){if(_0x29fa5f){var _0x1bd6b9=typeof _0x2933c2[_0xc389('0x1c')]===_0xc389('0x1d')&&typeof _0x2933c2['limit']===_0xc389('0x1d');var _0x1adbfd=_0x29fa5f[_0xc389('0x1e')];var _0x5a1197=_0x1bd6b9?0x0:_0x2933c2[_0xc389('0x1c')];var _0xcaed47=_0x1bd6b9?_0x29fa5f[_0xc389('0x1e')]:_0x2933c2[_0xc389('0x1c')]+_0x2933c2['limit'];var _0x4d5db4;if(_0xcaed47>=_0x1adbfd){_0xcaed47=_0x1adbfd;_0x4d5db4=0xc8;}else{_0x4d5db4=0xce;}_0x4f602c['status'](_0x4d5db4);return _0x4f602c[_0xc389('0x1f')]('Content-Range',_0x5a1197+'-'+_0xcaed47+'/'+_0x1adbfd)[_0xc389('0x1b')](_0x29fa5f);}return null;};}function patchUpdates(_0x523fba){return function(_0x4a5143){try{jsonpatch[_0xc389('0x20')](_0x4a5143,_0x523fba,!![]);}catch(_0x16b67b){return BPromise['reject'](_0x16b67b);}return _0x4a5143[_0xc389('0x21')]();};}function saveUpdates(_0x4ac73b,_0x2d58b4){return function(_0x5f4c5d){if(_0x5f4c5d){return _0x5f4c5d[_0xc389('0x22')](_0x4ac73b)[_0xc389('0x23')](function(_0x191eb2){return _0x191eb2;});}return null;};}function removeEntity(_0x93fa30,_0xfbe24){return function(_0x459275){if(_0x459275){return _0x459275['destroy']()[_0xc389('0x23')](function(){_0x93fa30[_0xc389('0x19')](0xcc)[_0xc389('0x1a')]();});}};}function handleEntityNotFound(_0x177147,_0x1e3f46){return function(_0x15d3ce){if(!_0x15d3ce){_0x177147[_0xc389('0x18')](0x194);}return _0x15d3ce;};}function handleError(_0x24458a,_0xd7aac1){_0xd7aac1=_0xd7aac1||0x1f4;return function(_0x2b2355){logger['error'](_0x2b2355[_0xc389('0x24')]);if(_0x2b2355[_0xc389('0x25')]){delete _0x2b2355[_0xc389('0x25')];}_0x24458a[_0xc389('0x19')](_0xd7aac1)[_0xc389('0x26')](_0x2b2355);};}exports['index']=function(_0x5509a0,_0x359eba){var _0x382a7e={},_0x53f3e6={},_0x400c4a={'count':0x0,'rows':[]};var _0x22bacf=_[_0xc389('0x27')](db['ServicenowAccount']['rawAttributes'],function(_0x3dc8a8){return{'name':_0x3dc8a8[_0xc389('0x28')],'type':_0x3dc8a8[_0xc389('0x29')]['key']};});_0x53f3e6[_0xc389('0x2a')]=_[_0xc389('0x27')](_0x22bacf,'name');_0x53f3e6[_0xc389('0x2b')]=_[_0xc389('0x2c')](_0x5509a0['query']);_0x53f3e6[_0xc389('0x2d')]=_[_0xc389('0x2e')](_0x53f3e6[_0xc389('0x2a')],_0x53f3e6[_0xc389('0x2b')]);_0x382a7e['attributes']=_[_0xc389('0x2e')](_0x53f3e6[_0xc389('0x2a')],qs[_0xc389('0x2f')](_0x5509a0['query'][_0xc389('0x2f')]));_0x382a7e['attributes']=_0x382a7e[_0xc389('0x30')][_0xc389('0x31')]?_0x382a7e[_0xc389('0x30')]:_0x53f3e6[_0xc389('0x2a')];if(!_0x5509a0['query'][_0xc389('0x32')]('nolimit')){_0x382a7e['limit']=qs[_0xc389('0x33')](_0x5509a0[_0xc389('0x2b')][_0xc389('0x33')]);_0x382a7e[_0xc389('0x1c')]=qs[_0xc389('0x1c')](_0x5509a0[_0xc389('0x2b')][_0xc389('0x1c')]);}_0x382a7e[_0xc389('0x34')]=qs[_0xc389('0x35')](_0x5509a0[_0xc389('0x2b')][_0xc389('0x35')]);_0x382a7e[_0xc389('0x36')]=qs[_0xc389('0x2d')](_[_0xc389('0x37')](_0x5509a0[_0xc389('0x2b')],_0x53f3e6['filters']),_0x22bacf);if(_0x5509a0[_0xc389('0x2b')][_0xc389('0x38')]){_0x382a7e[_0xc389('0x36')]=_['merge'](_0x382a7e['where'],{'$or':_[_0xc389('0x27')](_0x22bacf,function(_0x559ba9){if(_0x559ba9['type']!==_0xc389('0x39')){var _0x54b9da={};_0x54b9da[_0x559ba9[_0xc389('0x25')]]={'$like':'%'+_0x5509a0[_0xc389('0x2b')][_0xc389('0x38')]+'%'};return _0x54b9da;}})});}_0x382a7e=_[_0xc389('0x3a')]({},_0x382a7e,_0x5509a0[_0xc389('0x3b')]);var _0x105ea2={'where':_0x382a7e[_0xc389('0x36')]};return db[_0xc389('0x3c')][_0xc389('0x1e')](_0x105ea2)[_0xc389('0x23')](function(_0x33f642){_0x400c4a[_0xc389('0x1e')]=_0x33f642;if(_0x5509a0[_0xc389('0x2b')][_0xc389('0x3d')]){_0x382a7e[_0xc389('0x3e')]=[{'all':!![]}];}return db[_0xc389('0x3c')]['findAll'](_0x382a7e);})['then'](function(_0x544ec2){_0x400c4a[_0xc389('0x3f')]=_0x544ec2;return _0x400c4a;})['then'](respondWithFilteredResult(_0x359eba,_0x382a7e))[_0xc389('0x40')](handleError(_0x359eba,null));};exports[_0xc389('0x41')]=function(_0x327d23,_0x33a914){var _0x1a8056={'raw':![],'where':{'id':_0x327d23['params']['id']}},_0x326cc0={};_0x326cc0[_0xc389('0x2a')]=_[_0xc389('0x2c')](db[_0xc389('0x3c')][_0xc389('0x42')]);_0x326cc0['query']=_[_0xc389('0x2c')](_0x327d23[_0xc389('0x2b')]);_0x326cc0[_0xc389('0x2d')]=_[_0xc389('0x2e')](_0x326cc0[_0xc389('0x2a')],_0x326cc0[_0xc389('0x2b')]);_0x1a8056['attributes']=_[_0xc389('0x2e')](_0x326cc0[_0xc389('0x2a')],qs[_0xc389('0x2f')](_0x327d23['query'][_0xc389('0x2f')]));_0x1a8056['attributes']=_0x1a8056['attributes']['length']?_0x1a8056['attributes']:_0x326cc0[_0xc389('0x2a')];if(_0x327d23[_0xc389('0x2b')]['includeAll']){_0x1a8056[_0xc389('0x3e')]=[{'all':!![]}];}_0x1a8056=_[_0xc389('0x3a')]({},_0x1a8056,_0x327d23[_0xc389('0x3b')]);return db[_0xc389('0x3c')][_0xc389('0x43')](_0x1a8056)['then'](handleEntityNotFound(_0x33a914,null))[_0xc389('0x23')](respondWithResult(_0x33a914,null))[_0xc389('0x40')](handleError(_0x33a914,null));};exports['create']=function(_0x416235,_0x3c091f){return db[_0xc389('0x3c')][_0xc389('0x44')](_0x416235[_0xc389('0x45')],{})[_0xc389('0x23')](respondWithResult(_0x3c091f,0xc9))['catch'](handleError(_0x3c091f,null));};exports[_0xc389('0x22')]=function(_0x3d9dda,_0x5883ac){if(_0x3d9dda[_0xc389('0x45')]['id']){delete _0x3d9dda[_0xc389('0x45')]['id'];}return db[_0xc389('0x3c')][_0xc389('0x43')]({'where':{'id':_0x3d9dda[_0xc389('0x46')]['id']}})[_0xc389('0x23')](handleEntityNotFound(_0x5883ac,null))[_0xc389('0x23')](saveUpdates(_0x3d9dda[_0xc389('0x45')],null))[_0xc389('0x23')](respondWithResult(_0x5883ac,null))[_0xc389('0x40')](handleError(_0x5883ac,null));};exports[_0xc389('0x47')]=function(_0x4f17c8,_0x2684b4){return db[_0xc389('0x3c')][_0xc389('0x43')]({'where':{'id':_0x4f17c8[_0xc389('0x46')]['id']}})[_0xc389('0x23')](handleEntityNotFound(_0x2684b4,null))[_0xc389('0x23')](removeEntity(_0x2684b4,null))[_0xc389('0x40')](handleError(_0x2684b4,null));};exports[_0xc389('0x48')]=function(_0x243772,_0x257282,_0x237872){var _0x1c88a1={};var _0x6e4757={};var _0x2f654c;var _0x305c9d;return db[_0xc389('0x3c')]['findOne']({'where':{'id':_0x243772['params']['id']}})['then'](handleEntityNotFound(_0x257282,null))[_0xc389('0x23')](function(_0x6b7386){if(_0x6b7386){_0x2f654c=_0x6b7386;_0x6e4757[_0xc389('0x2a')]=_[_0xc389('0x2c')](db[_0xc389('0x49')]['rawAttributes']);_0x6e4757['query']=_[_0xc389('0x2c')](_0x243772[_0xc389('0x2b')]);_0x6e4757['filters']=_['intersection'](_0x6e4757[_0xc389('0x2a')],_0x6e4757[_0xc389('0x2b')]);_0x1c88a1[_0xc389('0x30')]=_[_0xc389('0x2e')](_0x6e4757[_0xc389('0x2a')],qs[_0xc389('0x2f')](_0x243772[_0xc389('0x2b')][_0xc389('0x2f')]));_0x1c88a1[_0xc389('0x30')]=_0x1c88a1[_0xc389('0x30')][_0xc389('0x31')]?_0x1c88a1['attributes']:_0x6e4757['model'];_0x1c88a1[_0xc389('0x34')]=qs[_0xc389('0x35')](_0x243772[_0xc389('0x2b')][_0xc389('0x35')]);_0x1c88a1[_0xc389('0x36')]=qs[_0xc389('0x2d')](_['pick'](_0x243772[_0xc389('0x2b')],_0x6e4757[_0xc389('0x2d')]));if(_0x243772[_0xc389('0x2b')][_0xc389('0x38')]){_0x1c88a1[_0xc389('0x36')]=_[_0xc389('0x3a')](_0x1c88a1['where'],{'$or':_[_0xc389('0x27')](_0x1c88a1[_0xc389('0x30')],function(_0x58d45a){var _0x22f82d={};_0x22f82d[_0x58d45a]={'$like':'%'+_0x243772[_0xc389('0x2b')]['filter']+'%'};return _0x22f82d;})});}_0x1c88a1=_[_0xc389('0x3a')]({},_0x1c88a1,_0x243772[_0xc389('0x3b')]);return _0x2f654c[_0xc389('0x48')](_0x1c88a1);}})[_0xc389('0x23')](function(_0x309a27){if(_0x309a27){_0x305c9d=_0x309a27['length'];if(!_0x243772[_0xc389('0x2b')]['hasOwnProperty'](_0xc389('0x4a'))){_0x1c88a1[_0xc389('0x33')]=qs[_0xc389('0x33')](_0x243772['query'][_0xc389('0x33')]);_0x1c88a1[_0xc389('0x1c')]=qs['offset'](_0x243772[_0xc389('0x2b')][_0xc389('0x1c')]);}return _0x2f654c[_0xc389('0x48')](_0x1c88a1);}})[_0xc389('0x23')](function(_0x412ecb){if(_0x412ecb){return _0x412ecb?{'count':_0x305c9d,'rows':_0x412ecb}:null;}})['then'](respondWithResult(_0x257282,null))[_0xc389('0x40')](handleError(_0x257282,null));};exports[_0xc389('0x4b')]=function(_0x257c5b,_0x5d13a1,_0xc67962){if(_0x257c5b[_0xc389('0x45')]['id']){delete _0x257c5b[_0xc389('0x45')]['id'];}return db[_0xc389('0x3c')][_0xc389('0x4c')]({'where':{'id':_0x257c5b[_0xc389('0x46')]['id']}})[_0xc389('0x23')](handleEntityNotFound(_0x5d13a1,null))['then'](function(_0x5dbe49){if(_0x5dbe49){_0x257c5b[_0xc389('0x45')][_0xc389('0x4d')]=_0x5dbe49['id'];_0x257c5b['body'][_0xc389('0x4e')]=integrations['getSubjects'](_0x257c5b[_0xc389('0x45')][_0xc389('0x4f')],_0x257c5b[_0xc389('0x45')][_0xc389('0x29')]);_0x257c5b[_0xc389('0x45')][_0xc389('0x50')]=integrations[_0xc389('0x51')](_0x257c5b[_0xc389('0x45')][_0xc389('0x4f')],_0x257c5b[_0xc389('0x45')][_0xc389('0x29')]);return db[_0xc389('0x49')][_0xc389('0x44')](_0x257c5b['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xc389('0x50')}]});}return null;})[_0xc389('0x23')](respondWithResult(_0x5d13a1,null))[_0xc389('0x40')](handleError(_0x5d13a1,null));};exports[_0xc389('0x52')]=function(_0x3a0892,_0x33fcbd,_0x255bf9){var _0x45f30c=['made_sla',_0xc389('0x53'),_0xc389('0x54'),_0xc389('0x55'),_0xc389('0x56'),_0xc389('0x57'),_0xc389('0x58'),'severity',_0xc389('0x59')];var _0x23f1d8=[_0xc389('0x5a'),_0xc389('0x5b'),_0xc389('0x5c'),'watch_list',_0xc389('0x5d'),'sys_updated_on',_0xc389('0x5e'),_0xc389('0x53'),'approval_history',_0xc389('0x5f'),'resolved_by',_0xc389('0x60'),_0xc389('0x61'),_0xc389('0x62'),'sys_created_on',_0xc389('0x63'),'state',_0xc389('0x64'),_0xc389('0x54'),_0xc389('0x34'),_0xc389('0x65'),_0xc389('0x66'),_0xc389('0x67'),_0xc389('0x68'),'impact',_0xc389('0x69'),_0xc389('0x6a'),_0xc389('0x6b'),'priority',_0xc389('0x6c'),_0xc389('0x6d'),'time_worked',_0xc389('0x6e'),_0xc389('0x6f'),_0xc389('0x70'),_0xc389('0x71'),_0xc389('0x72'),_0xc389('0x73'),'resolved_at','caller_id',_0xc389('0x74'),_0xc389('0x55'),_0xc389('0x75'),'short_description',_0xc389('0x56'),_0xc389('0x76'),'delivery_task','work_start','assignment_group','business_stc',_0xc389('0x77'),'description',_0xc389('0x78'),'notify','sys_class_name',_0xc389('0x79'),_0xc389('0x7a'),_0xc389('0x7b'),_0xc389('0x7c'),_0xc389('0x7d'),'contact_type',_0xc389('0x7e'),_0xc389('0x58'),_0xc389('0x7f'),_0xc389('0x80'),_0xc389('0x81'),_0xc389('0x82'),'activity_due',_0xc389('0x83'),_0xc389('0x84'),_0xc389('0x85'),_0xc389('0x86'),_0xc389('0x87'),_0xc389('0x88'),_0xc389('0x89'),'sys_mod_count','reopen_count',_0xc389('0x8a'),'escalation',_0xc389('0x8b'),_0xc389('0x8c'),'location',_0xc389('0x59')];var _0x4b6d18='';var _0x1eaf99='';var _0x371ab3=[];var _0xd61082='';var _0x109fdc='';var _0x4d570f=[];var _0x33ec2c='';var _0x57f4f4='';var _0x211df9={};var _0x280466='';return db[_0xc389('0x3c')][_0xc389('0x4c')]({'where':{'id':_0x3a0892[_0xc389('0x46')]['id']},'attributes':['id',_0xc389('0x8d'),_0xc389('0x8e'),_0xc389('0x8f'),'remoteUri',_0xc389('0x90')]})[_0xc389('0x23')](handleEntityNotFound(_0x33fcbd,null))[_0xc389('0x23')](function(_0x21cddf){if(_0x21cddf){_0x280466=_0x21cddf[_0xc389('0x91')];var _0x160307=_0x280466[_0xc389('0x92')](-0x1);if(_0x160307==='/'){_0x280466=_0x280466[_0xc389('0x93')](0x0,_0x280466[_0xc389('0x94')](_0x160307));}_0x57f4f4=util[_0xc389('0x95')](_0xc389('0x96'),_0x280466);_0x33ec2c=util[_0xc389('0x95')](_0xc389('0x97'),_0x280466);_0x211df9={'user':_0x21cddf[_0xc389('0x8d')],'pass':_0x21cddf[_0xc389('0x8e')]};var _0xf2d5f3={'method':'GET','uri':_0x57f4f4+_0xc389('0x98'),'auth':_0x211df9,'json':!![]};return rp(_0xf2d5f3);}})[_0xc389('0x23')](function(_0x49f035){if(_0x49f035[_0xc389('0x99')][_0xc389('0x31')]>0x0){_0x4b6d18=_0x49f035[_0xc389('0x99')];}console['log'](_0xc389('0x9a'),_0x4b6d18);_0x4d570f=[];_0x1eaf99=Object['assign']([],_0x4b6d18);_[_0xc389('0x9b')](_0x1eaf99,function(_0x1060d3){return!_0x45f30c['includes'](_0x1060d3[_0xc389('0x25')]);});_0x1eaf99[_0xc389('0x9c')](function(_0x1d034c){var _0x636be2=createFieldObject(_0x33ec2c,_0x211df9,_0x1d034c[_0xc389('0x9d')],_0x1d034c[_0xc389('0x25')],_0x1d034c['label'],![]);_0x4d570f[_0xc389('0x9e')](_0x636be2);});return Promise[_0xc389('0x9f')](_0x4d570f);})['then'](function(_0x46a6ce){_0x371ab3=_0x46a6ce;_0xd61082=Object[_0xc389('0xa0')]([],_0x4b6d18);console[_0xc389('0xa1')](_0xc389('0xa2'),_0x4b6d18);_[_0xc389('0x9b')](_0xd61082,function(_0x4757be){return _0x23f1d8[_0xc389('0xa3')](_0x4757be[_0xc389('0x25')]);});console[_0xc389('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xd61082);_0x4d570f=[];_0xd61082['forEach'](function(_0x49f31f){var _0xa9458d=createFieldObject(_0x33ec2c,_0x211df9,_0x49f31f[_0xc389('0x9d')],_0x49f31f[_0xc389('0x25')],_0x49f31f[_0xc389('0xa4')],!![]);_0x4d570f['push'](_0xa9458d);});return Promise['all'](_0x4d570f);})[_0xc389('0x23')](function(_0x47d6ab){_0x109fdc=_0x47d6ab;var _0x47f5e3=_0x371ab3['concat'](_0x109fdc);return{'count':_0x47f5e3['length'],'rows':_0x47f5e3};})[_0xc389('0x23')](respondWithResult(_0x33fcbd,null))[_0xc389('0x40')](function(_0x231b17){console[_0xc389('0xa1')](_0xc389('0xa5')+_0x231b17);var _0x5312cf=_0x3a0892[_0xc389('0x2b')]['test']?0x1f4:_0x231b17['statusCode']||0x1f4;logger[_0xc389('0xa6')](_0x231b17[_0xc389('0x24')]);delete _0x231b17[_0xc389('0x25')];if(_0x5312cf===0x191){_0x5312cf=0x190;}_0x33fcbd[_0xc389('0x19')](_0x5312cf)['send'](_0x3a0892[_0xc389('0x2b')][_0xc389('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x231b17[_0xc389('0xa8')]}:_0x231b17);});};function createFieldObject(_0x44dd05,_0x44183d,_0x7563c4,_0x4c2c92,_0x3e8636,_0x566b1e){return new Promise(function(_0x1f2bac,_0x39f62d){var _0x5105c9={'id':_0x4c2c92,'name':_0x3e8636,'custom':_0x566b1e};if(_0x7563c4===_0xc389('0xa9')){_0x5105c9[_0xc389('0x3b')]=[{'name':_0xc389('0xaa'),'value':'true'},{'name':'False','value':'false'}];_0x1f2bac(_0x5105c9);}else{var _0x99da44={'method':_0xc389('0xab'),'uri':_0x44dd05+_0xc389('0xac')+_0x4c2c92,'auth':_0x44183d,'json':!![]};return rp(_0x99da44)[_0xc389('0x23')](function(_0x4b5b74){var _0x54113d=[];if(_0x4b5b74[_0xc389('0x99')][_0xc389('0x31')]>0x0){_0x4b5b74[_0xc389('0x99')][_0xc389('0x9c')](function(_0x1b8b89){if(_0x1b8b89['inactive']===_0xc389('0xad')){var _0x25703a={'name':_0x1b8b89[_0xc389('0xa4')],'value':_0x1b8b89[_0xc389('0xae')]};_0x54113d[_0xc389('0x9e')](_0x25703a);}});}_0x5105c9[_0xc389('0x3b')]=_0x54113d;if(_0x5105c9['options'][_0xc389('0x31')]>0x0){_0x1f2bac(_0x5105c9);}else{if(_0x566b1e==![]){_0x1f2bac();}else{_0x1f2bac(_0x5105c9);}}});}});} \ No newline at end of file +var _0x941f=['business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','all','test','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','find','create','body','destroy','findOne','ServicenowConfiguration','filters','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','watch_list','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','priority','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','assignment_group'];(function(_0x294767,_0x396158){var _0x5acc88=function(_0x36901f){while(--_0x36901f){_0x294767['push'](_0x294767['shift']());}};_0x5acc88(++_0x396158);}(_0x941f,0x1a7));var _0xf941=function(_0x3134d5,_0x2c5d4e){_0x3134d5=_0x3134d5-0x0;var _0x3c4595=_0x941f[_0x3134d5];return _0x3c4595;};'use strict';var emlformat=require(_0xf941('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf941('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf941('0x2'));var moment=require(_0xf941('0x3'));var BPromise=require(_0xf941('0x4'));var Mustache=require(_0xf941('0x5'));var util=require('util');var path=require(_0xf941('0x6'));var sox=require('sox');var csv=require(_0xf941('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf941('0x8'));var _=require(_0xf941('0x9'));var squel=require(_0xf941('0xa'));var crypto=require(_0xf941('0xb'));var jsforce=require(_0xf941('0xc'));var deskjs=require(_0xf941('0xd'));var toCsv=require(_0xf941('0x7'));var querystring=require(_0xf941('0xe'));var Papa=require(_0xf941('0xf'));var Redis=require('ioredis');var authService=require(_0xf941('0x10'));var qs=require(_0xf941('0x11'));var as=require(_0xf941('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf941('0x13'))(_0xf941('0x14'));var utils=require('../../config/utils');var config=require(_0xf941('0x15'));var licenseUtil=require(_0xf941('0x16'));var db=require(_0xf941('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3a7629,_0x1ba759){_0x1ba759=_0x1ba759||0xcc;return function(_0x5b6a0f){if(_0x5b6a0f){return _0x3a7629[_0xf941('0x18')](_0x1ba759);}return _0x3a7629[_0xf941('0x19')](_0x1ba759)[_0xf941('0x1a')]();};}function respondWithResult(_0x364738,_0x2192f0){_0x2192f0=_0x2192f0||0xc8;return function(_0x2b0cb5){if(_0x2b0cb5){return _0x364738[_0xf941('0x19')](_0x2192f0)[_0xf941('0x1b')](_0x2b0cb5);}};}function respondWithFilteredResult(_0x33b743,_0x133689){return function(_0xaad125){if(_0xaad125){var _0x46ec4a=typeof _0x133689[_0xf941('0x1c')]==='undefined'&&typeof _0x133689['limit']===_0xf941('0x1d');var _0x5c0ac5=_0xaad125[_0xf941('0x1e')];var _0x4190c4=_0x46ec4a?0x0:_0x133689[_0xf941('0x1c')];var _0x56959d=_0x46ec4a?_0xaad125[_0xf941('0x1e')]:_0x133689[_0xf941('0x1c')]+_0x133689[_0xf941('0x1f')];var _0x5da82d;if(_0x56959d>=_0x5c0ac5){_0x56959d=_0x5c0ac5;_0x5da82d=0xc8;}else{_0x5da82d=0xce;}_0x33b743['status'](_0x5da82d);return _0x33b743[_0xf941('0x20')]('Content-Range',_0x4190c4+'-'+_0x56959d+'/'+_0x5c0ac5)[_0xf941('0x1b')](_0xaad125);}return null;};}function patchUpdates(_0x597ea5){return function(_0x45f3c0){try{jsonpatch[_0xf941('0x21')](_0x45f3c0,_0x597ea5,!![]);}catch(_0x3d129a){return BPromise[_0xf941('0x22')](_0x3d129a);}return _0x45f3c0[_0xf941('0x23')]();};}function saveUpdates(_0x3b5733,_0x3c82fb){return function(_0x41c735){if(_0x41c735){return _0x41c735[_0xf941('0x24')](_0x3b5733)[_0xf941('0x25')](function(_0x167d47){return _0x167d47;});}return null;};}function removeEntity(_0x1d7521,_0x5e1ddd){return function(_0x10d576){if(_0x10d576){return _0x10d576['destroy']()[_0xf941('0x25')](function(){_0x1d7521[_0xf941('0x19')](0xcc)[_0xf941('0x1a')]();});}};}function handleEntityNotFound(_0x5ef592,_0x1db006){return function(_0x460403){if(!_0x460403){_0x5ef592['sendStatus'](0x194);}return _0x460403;};}function handleError(_0x513839,_0x3fd63a){_0x3fd63a=_0x3fd63a||0x1f4;return function(_0xfa7bd6){logger[_0xf941('0x26')](_0xfa7bd6[_0xf941('0x27')]);if(_0xfa7bd6['name']){delete _0xfa7bd6['name'];}_0x513839[_0xf941('0x19')](_0x3fd63a)[_0xf941('0x28')](_0xfa7bd6);};}exports[_0xf941('0x29')]=function(_0x26971b,_0x44fb3f){var _0x2d3e6a={},_0x5a35b0={},_0x37cb42={'count':0x0,'rows':[]};var _0x2a8386=_[_0xf941('0x2a')](db[_0xf941('0x2b')][_0xf941('0x2c')],function(_0x238a04){return{'name':_0x238a04[_0xf941('0x2d')],'type':_0x238a04['type'][_0xf941('0x2e')]};});_0x5a35b0[_0xf941('0x2f')]=_['map'](_0x2a8386,_0xf941('0x30'));_0x5a35b0['query']=_[_0xf941('0x31')](_0x26971b[_0xf941('0x32')]);_0x5a35b0['filters']=_[_0xf941('0x33')](_0x5a35b0[_0xf941('0x2f')],_0x5a35b0['query']);_0x2d3e6a[_0xf941('0x34')]=_[_0xf941('0x33')](_0x5a35b0['model'],qs['fields'](_0x26971b[_0xf941('0x32')][_0xf941('0x35')]));_0x2d3e6a[_0xf941('0x34')]=_0x2d3e6a[_0xf941('0x34')][_0xf941('0x36')]?_0x2d3e6a[_0xf941('0x34')]:_0x5a35b0['model'];if(!_0x26971b[_0xf941('0x32')][_0xf941('0x37')](_0xf941('0x38'))){_0x2d3e6a[_0xf941('0x1f')]=qs['limit'](_0x26971b['query'][_0xf941('0x1f')]);_0x2d3e6a[_0xf941('0x1c')]=qs[_0xf941('0x1c')](_0x26971b[_0xf941('0x32')][_0xf941('0x1c')]);}_0x2d3e6a[_0xf941('0x39')]=qs[_0xf941('0x3a')](_0x26971b['query'][_0xf941('0x3a')]);_0x2d3e6a[_0xf941('0x3b')]=qs['filters'](_[_0xf941('0x3c')](_0x26971b[_0xf941('0x32')],_0x5a35b0['filters']),_0x2a8386);if(_0x26971b[_0xf941('0x32')]['filter']){_0x2d3e6a['where']=_[_0xf941('0x3d')](_0x2d3e6a[_0xf941('0x3b')],{'$or':_[_0xf941('0x2a')](_0x2a8386,function(_0x589c0f){if(_0x589c0f[_0xf941('0x3e')]!==_0xf941('0x3f')){var _0x2f73a4={};_0x2f73a4[_0x589c0f[_0xf941('0x30')]]={'$like':'%'+_0x26971b['query'][_0xf941('0x40')]+'%'};return _0x2f73a4;}})});}_0x2d3e6a=_[_0xf941('0x3d')]({},_0x2d3e6a,_0x26971b[_0xf941('0x41')]);var _0x5086e1={'where':_0x2d3e6a[_0xf941('0x3b')]};return db[_0xf941('0x2b')][_0xf941('0x1e')](_0x5086e1)[_0xf941('0x25')](function(_0x2333d3){_0x37cb42[_0xf941('0x1e')]=_0x2333d3;if(_0x26971b['query'][_0xf941('0x42')]){_0x2d3e6a[_0xf941('0x43')]=[{'all':!![]}];}return db[_0xf941('0x2b')]['findAll'](_0x2d3e6a);})[_0xf941('0x25')](function(_0x14c35c){_0x37cb42['rows']=_0x14c35c;return _0x37cb42;})['then'](respondWithFilteredResult(_0x44fb3f,_0x2d3e6a))[_0xf941('0x44')](handleError(_0x44fb3f,null));};exports[_0xf941('0x45')]=function(_0x24ff93,_0x53736f){var _0xf1e253={'raw':![],'where':{'id':_0x24ff93[_0xf941('0x46')]['id']}},_0x459614={};_0x459614[_0xf941('0x2f')]=_['keys'](db[_0xf941('0x2b')][_0xf941('0x2c')]);_0x459614[_0xf941('0x32')]=_[_0xf941('0x31')](_0x24ff93[_0xf941('0x32')]);_0x459614['filters']=_[_0xf941('0x33')](_0x459614[_0xf941('0x2f')],_0x459614['query']);_0xf1e253[_0xf941('0x34')]=_[_0xf941('0x33')](_0x459614['model'],qs[_0xf941('0x35')](_0x24ff93[_0xf941('0x32')][_0xf941('0x35')]));_0xf1e253[_0xf941('0x34')]=_0xf1e253[_0xf941('0x34')]['length']?_0xf1e253[_0xf941('0x34')]:_0x459614['model'];if(_0x24ff93['query'][_0xf941('0x42')]){_0xf1e253['include']=[{'all':!![]}];}_0xf1e253=_[_0xf941('0x3d')]({},_0xf1e253,_0x24ff93['options']);return db[_0xf941('0x2b')][_0xf941('0x47')](_0xf1e253)[_0xf941('0x25')](handleEntityNotFound(_0x53736f,null))[_0xf941('0x25')](respondWithResult(_0x53736f,null))[_0xf941('0x44')](handleError(_0x53736f,null));};exports[_0xf941('0x48')]=function(_0x528434,_0x3f1655){return db[_0xf941('0x2b')][_0xf941('0x48')](_0x528434[_0xf941('0x49')],{})['then'](respondWithResult(_0x3f1655,0xc9))[_0xf941('0x44')](handleError(_0x3f1655,null));};exports['update']=function(_0x501564,_0xfe5791){if(_0x501564[_0xf941('0x49')]['id']){delete _0x501564['body']['id'];}return db[_0xf941('0x2b')][_0xf941('0x47')]({'where':{'id':_0x501564[_0xf941('0x46')]['id']}})[_0xf941('0x25')](handleEntityNotFound(_0xfe5791,null))['then'](saveUpdates(_0x501564[_0xf941('0x49')],null))[_0xf941('0x25')](respondWithResult(_0xfe5791,null))[_0xf941('0x44')](handleError(_0xfe5791,null));};exports[_0xf941('0x4a')]=function(_0x502df7,_0x5f3507){return db['ServicenowAccount']['find']({'where':{'id':_0x502df7[_0xf941('0x46')]['id']}})[_0xf941('0x25')](handleEntityNotFound(_0x5f3507,null))[_0xf941('0x25')](removeEntity(_0x5f3507,null))['catch'](handleError(_0x5f3507,null));};exports['getConfigurations']=function(_0x46230a,_0x12fbdf,_0x201cf1){var _0x623793={};var _0x5abdb4={};var _0x3544a7;var _0x4aa8bd;return db['ServicenowAccount'][_0xf941('0x4b')]({'where':{'id':_0x46230a[_0xf941('0x46')]['id']}})[_0xf941('0x25')](handleEntityNotFound(_0x12fbdf,null))[_0xf941('0x25')](function(_0x57e7a7){if(_0x57e7a7){_0x3544a7=_0x57e7a7;_0x5abdb4[_0xf941('0x2f')]=_[_0xf941('0x31')](db[_0xf941('0x4c')][_0xf941('0x2c')]);_0x5abdb4[_0xf941('0x32')]=_[_0xf941('0x31')](_0x46230a[_0xf941('0x32')]);_0x5abdb4[_0xf941('0x4d')]=_[_0xf941('0x33')](_0x5abdb4[_0xf941('0x2f')],_0x5abdb4[_0xf941('0x32')]);_0x623793[_0xf941('0x34')]=_['intersection'](_0x5abdb4['model'],qs[_0xf941('0x35')](_0x46230a['query'][_0xf941('0x35')]));_0x623793[_0xf941('0x34')]=_0x623793['attributes'][_0xf941('0x36')]?_0x623793[_0xf941('0x34')]:_0x5abdb4[_0xf941('0x2f')];_0x623793[_0xf941('0x39')]=qs['sort'](_0x46230a[_0xf941('0x32')][_0xf941('0x3a')]);_0x623793[_0xf941('0x3b')]=qs['filters'](_[_0xf941('0x3c')](_0x46230a['query'],_0x5abdb4[_0xf941('0x4d')]));if(_0x46230a[_0xf941('0x32')]['filter']){_0x623793[_0xf941('0x3b')]=_['merge'](_0x623793[_0xf941('0x3b')],{'$or':_[_0xf941('0x2a')](_0x623793['attributes'],function(_0x3335c6){var _0x5f0fce={};_0x5f0fce[_0x3335c6]={'$like':'%'+_0x46230a[_0xf941('0x32')][_0xf941('0x40')]+'%'};return _0x5f0fce;})});}_0x623793=_[_0xf941('0x3d')]({},_0x623793,_0x46230a['options']);return _0x3544a7[_0xf941('0x4e')](_0x623793);}})[_0xf941('0x25')](function(_0x89aa15){if(_0x89aa15){_0x4aa8bd=_0x89aa15[_0xf941('0x36')];if(!_0x46230a['query'][_0xf941('0x37')](_0xf941('0x38'))){_0x623793[_0xf941('0x1f')]=qs['limit'](_0x46230a[_0xf941('0x32')][_0xf941('0x1f')]);_0x623793[_0xf941('0x1c')]=qs[_0xf941('0x1c')](_0x46230a[_0xf941('0x32')][_0xf941('0x1c')]);}return _0x3544a7[_0xf941('0x4e')](_0x623793);}})['then'](function(_0x3071f8){if(_0x3071f8){return _0x3071f8?{'count':_0x4aa8bd,'rows':_0x3071f8}:null;}})[_0xf941('0x25')](respondWithResult(_0x12fbdf,null))[_0xf941('0x44')](handleError(_0x12fbdf,null));};exports[_0xf941('0x4f')]=function(_0x1f28c0,_0x5b1a2a,_0x1e56a0){if(_0x1f28c0[_0xf941('0x49')]['id']){delete _0x1f28c0[_0xf941('0x49')]['id'];}return db[_0xf941('0x2b')][_0xf941('0x4b')]({'where':{'id':_0x1f28c0['params']['id']}})[_0xf941('0x25')](handleEntityNotFound(_0x5b1a2a,null))[_0xf941('0x25')](function(_0x3a8723){if(_0x3a8723){_0x1f28c0['body'][_0xf941('0x50')]=_0x3a8723['id'];_0x1f28c0[_0xf941('0x49')][_0xf941('0x51')]=integrations[_0xf941('0x52')](_0x1f28c0[_0xf941('0x49')][_0xf941('0x53')],_0x1f28c0[_0xf941('0x49')][_0xf941('0x3e')]);_0x1f28c0['body']['Descriptions']=integrations[_0xf941('0x54')](_0x1f28c0[_0xf941('0x49')][_0xf941('0x53')],_0x1f28c0[_0xf941('0x49')][_0xf941('0x3e')]);return db['ServicenowConfiguration']['create'](_0x1f28c0[_0xf941('0x49')],{'include':[{'model':db[_0xf941('0x55')],'as':'Subjects'},{'model':db[_0xf941('0x55')],'as':'Descriptions'}]});}return null;})[_0xf941('0x25')](respondWithResult(_0x5b1a2a,null))['catch'](handleError(_0x5b1a2a,null));};exports[_0xf941('0x56')]=function(_0x2b8d88,_0x40456b,_0x1e1cde){var _0x2f556a=[_0xf941('0x57'),_0xf941('0x58'),'knowledge',_0xf941('0x59'),_0xf941('0x5a'),_0xf941('0x5b'),_0xf941('0x5c'),_0xf941('0x5d'),_0xf941('0x5e')];var _0x27b21c=['parent',_0xf941('0x57'),'caused_by',_0xf941('0x5f'),'upon_reject','sys_updated_on',_0xf941('0x60'),'hold_reason',_0xf941('0x61'),_0xf941('0x62'),_0xf941('0x63'),_0xf941('0x64'),_0xf941('0x65'),'user_input',_0xf941('0x66'),_0xf941('0x67'),_0xf941('0x68'),'sys_created_by','knowledge','order',_0xf941('0x69'),_0xf941('0x6a'),_0xf941('0x6b'),'delivery_plan',_0xf941('0x6c'),_0xf941('0x6d'),_0xf941('0x6e'),'business_service',_0xf941('0x6f'),'sys_domain_path',_0xf941('0x70'),_0xf941('0x71'),_0xf941('0x72'),_0xf941('0x73'),_0xf941('0x74'),'group_list',_0xf941('0x75'),_0xf941('0x76'),_0xf941('0x77'),_0xf941('0x78'),_0xf941('0x79'),_0xf941('0x59'),_0xf941('0x7a'),'short_description',_0xf941('0x5a'),_0xf941('0x7b'),_0xf941('0x7c'),'work_start',_0xf941('0x7d'),_0xf941('0x7e'),_0xf941('0x7f'),_0xf941('0x80'),_0xf941('0x81'),_0xf941('0x5b'),'sys_class_name',_0xf941('0x82'),_0xf941('0x83'),_0xf941('0x84'),_0xf941('0x85'),_0xf941('0x86'),_0xf941('0x87'),'reopened_by',_0xf941('0x5c'),_0xf941('0x88'),_0xf941('0x89'),_0xf941('0x8a'),_0xf941('0x8b'),_0xf941('0x8c'),_0xf941('0x8d'),_0xf941('0x5d'),_0xf941('0x8e'),_0xf941('0x8f'),_0xf941('0x90'),'comments_and_work_notes',_0xf941('0x91'),_0xf941('0x92'),_0xf941('0x93'),'sys_tags',_0xf941('0x94'),_0xf941('0x95'),_0xf941('0x96'),_0xf941('0x97'),_0xf941('0x5e')];var _0x2ffcc3='';var _0x3e3663='';var _0x3a088e=[];var _0x15644d='';var _0x410ca9='';var _0x160b08=[];var _0x30ec43='';var _0x2189d7='';var _0x33a890={};var _0x383ebf='';return db[_0xf941('0x2b')][_0xf941('0x4b')]({'where':{'id':_0x2b8d88[_0xf941('0x46')]['id']},'attributes':['id',_0xf941('0x98'),'password',_0xf941('0x99'),_0xf941('0x9a'),_0xf941('0x9b')]})[_0xf941('0x25')](handleEntityNotFound(_0x40456b,null))[_0xf941('0x25')](function(_0x380e50){if(_0x380e50){_0x383ebf=_0x380e50[_0xf941('0x9a')];var _0x5667df=_0x383ebf[_0xf941('0x9c')](-0x1);if(_0x5667df==='/'){_0x383ebf=_0x383ebf['substring'](0x0,_0x383ebf[_0xf941('0x9d')](_0x5667df));}_0x2189d7=util[_0xf941('0x9e')](_0xf941('0x9f'),_0x383ebf);_0x30ec43=util[_0xf941('0x9e')](_0xf941('0xa0'),_0x383ebf);_0x33a890={'user':_0x380e50[_0xf941('0x98')],'pass':_0x380e50[_0xf941('0xa1')]};var _0x368ef4={'method':'GET','uri':_0x2189d7+_0xf941('0xa2'),'auth':_0x33a890,'json':!![]};return rp(_0x368ef4);}})[_0xf941('0x25')](function(_0x9f3c69){if(_0x9f3c69[_0xf941('0xa3')]['length']>0x0){_0x2ffcc3=_0x9f3c69['result'];}console[_0xf941('0xa4')](_0xf941('0xa5'),_0x2ffcc3);_0x160b08=[];_0x3e3663=Object[_0xf941('0xa6')]([],_0x2ffcc3);_[_0xf941('0xa7')](_0x3e3663,function(_0x529f25){return!_0x2f556a[_0xf941('0xa8')](_0x529f25['name']);});_0x3e3663[_0xf941('0xa9')](function(_0x599a60){var _0x15bdf2=createFieldObject(_0x30ec43,_0x33a890,_0x599a60[_0xf941('0xaa')],_0x599a60['name'],_0x599a60[_0xf941('0xab')],![]);_0x160b08[_0xf941('0xac')](_0x15bdf2);});return Promise['all'](_0x160b08);})[_0xf941('0x25')](function(_0x194e52){_0x3a088e=_0x194e52;_0x15644d=Object[_0xf941('0xa6')]([],_0x2ffcc3);console[_0xf941('0xa4')](_0xf941('0xad'),_0x2ffcc3);_[_0xf941('0xa7')](_0x15644d,function(_0x16a6a9){return _0x27b21c[_0xf941('0xa8')](_0x16a6a9[_0xf941('0x30')]);});console[_0xf941('0xa4')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x15644d);_0x160b08=[];_0x15644d[_0xf941('0xa9')](function(_0x20c9da){var _0x34be22=createFieldObject(_0x30ec43,_0x33a890,_0x20c9da[_0xf941('0xaa')],_0x20c9da[_0xf941('0x30')],_0x20c9da[_0xf941('0xab')],!![]);_0x160b08['push'](_0x34be22);});return Promise[_0xf941('0xae')](_0x160b08);})[_0xf941('0x25')](function(_0x7b477f){_0x410ca9=_0x7b477f;var _0xe1250=_0x3a088e['concat'](_0x410ca9);return{'count':_0xe1250['length'],'rows':_0xe1250};})[_0xf941('0x25')](respondWithResult(_0x40456b,null))[_0xf941('0x44')](function(_0x13547f){console['log']('ServiceNow\x20error:\x20'+_0x13547f);var _0x547a1e=_0x2b8d88['query'][_0xf941('0xaf')]?0x1f4:_0x13547f['statusCode']||0x1f4;logger[_0xf941('0x26')](_0x13547f[_0xf941('0x27')]);delete _0x13547f['name'];if(_0x547a1e===0x191){_0x547a1e=0x190;}_0x40456b[_0xf941('0x19')](_0x547a1e)[_0xf941('0x28')](_0x2b8d88[_0xf941('0x32')][_0xf941('0xaf')]?{'message':_0xf941('0xb0'),'statusCode':_0x13547f[_0xf941('0xb1')]}:_0x13547f);});};function createFieldObject(_0x16a513,_0x5465f8,_0x3f8dd1,_0x14e54c,_0x2f3257,_0xc0745d){return new Promise(function(_0x12dcad,_0x4fa4de){var _0x2ee2c4={'id':_0x14e54c,'name':_0x2f3257,'custom':_0xc0745d};if(_0x3f8dd1===_0xf941('0xb2')){_0x2ee2c4['options']=[{'name':_0xf941('0xb3'),'value':'true'},{'name':_0xf941('0xb4'),'value':_0xf941('0xb5')}];_0x12dcad(_0x2ee2c4);}else{var _0x2b1d63={'method':'GET','uri':_0x16a513+_0xf941('0xb6')+_0x14e54c,'auth':_0x5465f8,'json':!![]};return rp(_0x2b1d63)['then'](function(_0x2a41a5){var _0x115c07=[];if(_0x2a41a5[_0xf941('0xa3')][_0xf941('0x36')]>0x0){_0x2a41a5[_0xf941('0xa3')][_0xf941('0xa9')](function(_0x118972){if(_0x118972['inactive']===_0xf941('0xb5')){var _0x43ab1e={'name':_0x118972[_0xf941('0xab')],'value':_0x118972['value']};_0x115c07[_0xf941('0xac')](_0x43ab1e);}});}_0x2ee2c4[_0xf941('0x41')]=_0x115c07;if(_0x2ee2c4['options'][_0xf941('0x36')]>0x0){_0x12dcad(_0x2ee2c4);}else{if(_0xc0745d==![]){_0x12dcad();}else{_0x12dcad(_0x2ee2c4);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index de5909d..167f4ba 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 _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2dc7d5,_0x101a11){var _0x51549f=function(_0xc5f30d){while(--_0xc5f30d){_0x2dc7d5['push'](_0x2dc7d5['shift']());}};_0x51549f(++_0x101a11);}(_0x5075,0x73));var _0x5507=function(_0x49e6ca,_0x3fb558){_0x49e6ca=_0x49e6ca-0x0;var _0x362189=_0x5075[_0x49e6ca];return _0x362189;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x57632d,_0x1089d4){var _0x56adb7=function(_0x30e9ae){while(--_0x30e9ae){_0x57632d['push'](_0x57632d['shift']());}};_0x56adb7(++_0x1089d4);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x243253,_0x1b0c50){_0x243253=_0x243253-0x0;var _0x5cfd4a=_0xbd51[_0x243253];return _0x5cfd4a;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 768ef54..0759022 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 _0x7f3d=['ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x7f3d,0x190));var _0xd7f3=function(_0x1ac77b,_0x10ee7a){_0x1ac77b=_0x1ac77b-0x0;var _0x161584=_0x7f3d[_0x1ac77b];return _0x161584;};'use strict';var _=require(_0xd7f3('0x0'));var util=require('util');var moment=require(_0xd7f3('0x1'));var BPromise=require(_0xd7f3('0x2'));var rs=require(_0xd7f3('0x3'));var fs=require('fs');var Redis=require(_0xd7f3('0x4'));var db=require(_0xd7f3('0x5'))['db'];var utils=require(_0xd7f3('0x6'));var logger=require(_0xd7f3('0x7'))(_0xd7f3('0x8'));var config=require(_0xd7f3('0x9'));var jayson=require(_0xd7f3('0xa'));var client=jayson[_0xd7f3('0xb')][_0xd7f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11f133,_0x30d5ae,_0x571901){return new BPromise(function(_0x4aaa09,_0x1805e5){return client[_0xd7f3('0xd')](_0x11f133,_0x571901)[_0xd7f3('0xe')](function(_0x313a96){logger[_0xd7f3('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x30d5ae,_0xd7f3('0x10'));logger[_0xd7f3('0x11')](_0xd7f3('0x12'),_0x30d5ae,_0xd7f3('0x10'),JSON[_0xd7f3('0x13')](_0x313a96));if(_0x313a96[_0xd7f3('0x14')]){if(_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x15')]===0x1f4){logger[_0xd7f3('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x30d5ae,_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x16')]);return _0x1805e5(_0x313a96[_0xd7f3('0x14')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x30d5ae,_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x16')]);return _0x4aaa09(_0x313a96[_0xd7f3('0x14')][_0xd7f3('0x16')]);}else{logger[_0xd7f3('0xf')](_0xd7f3('0x17'),_0x30d5ae,_0xd7f3('0x10'));_0x4aaa09(_0x313a96[_0xd7f3('0x18')][_0xd7f3('0x16')]);}})[_0xd7f3('0x19')](function(_0x2f7e82){logger['error'](_0xd7f3('0x17'),_0x30d5ae,_0x2f7e82);_0x1805e5(_0x2f7e82);});});}exports[_0xd7f3('0x1a')]=function(_0x2dccb9){var _0x24bb0b=this;return new Promise(function(_0x1d1f10,_0x462dcb){return db[_0xd7f3('0x1b')]['findAll']({'raw':_0x2dccb9[_0xd7f3('0x1c')]?_0x2dccb9[_0xd7f3('0x1c')][_0xd7f3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2dccb9[_0xd7f3('0x1c')]?_0x2dccb9[_0xd7f3('0x1c')][_0xd7f3('0x1e')]||null:null,'attributes':_0x2dccb9[_0xd7f3('0x1c')]?_0x2dccb9['options'][_0xd7f3('0x1f')]||null:null,'limit':_0x2dccb9['options']?_0x2dccb9['options'][_0xd7f3('0x20')]||null:null,'include':_0x2dccb9['options']?_0x2dccb9[_0xd7f3('0x1c')]['include']?_['map'](_0x2dccb9[_0xd7f3('0x1c')][_0xd7f3('0x21')],function(_0x39e27b){return{'model':db[_0x39e27b['model']],'as':_0x39e27b['as'],'attributes':_0x39e27b[_0xd7f3('0x1f')],'include':_0x39e27b[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0x39e27b[_0xd7f3('0x21')],function(_0xfc9ba3){return{'model':db[_0xfc9ba3[_0xd7f3('0x23')]],'as':_0xfc9ba3['as'],'attributes':_0xfc9ba3[_0xd7f3('0x1f')],'include':_0xfc9ba3[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0xfc9ba3[_0xd7f3('0x21')],function(_0x15bec5){return{'model':db[_0x15bec5[_0xd7f3('0x23')]],'as':_0x15bec5['as'],'attributes':_0x15bec5[_0xd7f3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd7f3('0xe')](function(_0x50e7d0){logger[_0xd7f3('0xf')](_0xd7f3('0x1a'),_0x2dccb9);logger[_0xd7f3('0x11')](_0xd7f3('0x1a'),_0x2dccb9,JSON[_0xd7f3('0x13')](_0x50e7d0));_0x1d1f10(_0x50e7d0);})[_0xd7f3('0x19')](function(_0x143b95){logger[_0xd7f3('0x14')](_0xd7f3('0x1a'),_0x143b95[_0xd7f3('0x16')],_0x2dccb9);_0x462dcb(_0x24bb0b[_0xd7f3('0x14')](0x1f4,_0x143b95['message']));});});};exports[_0xd7f3('0x24')]=function(_0x139fa7){var _0x3985f1=this;return new Promise(function(_0x1e1949,_0x4a6b46){return db[_0xd7f3('0x1b')][_0xd7f3('0x25')]({'raw':_0x139fa7[_0xd7f3('0x1c')]?_0x139fa7['options'][_0xd7f3('0x1d')]===undefined?!![]:![]:!![],'where':_0x139fa7[_0xd7f3('0x1c')]?_0x139fa7['options'][_0xd7f3('0x1e')]||null:null,'attributes':_0x139fa7['options']?_0x139fa7['options'][_0xd7f3('0x1f')]||null:null,'include':_0x139fa7['options']?_0x139fa7[_0xd7f3('0x1c')][_0xd7f3('0x21')]?_['map'](_0x139fa7[_0xd7f3('0x1c')][_0xd7f3('0x21')],function(_0x3afbe3){return{'model':db[_0x3afbe3[_0xd7f3('0x23')]],'as':_0x3afbe3['as'],'attributes':_0x3afbe3[_0xd7f3('0x1f')],'include':_0x3afbe3[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0x3afbe3[_0xd7f3('0x21')],function(_0x1a7020){return{'model':db[_0x1a7020[_0xd7f3('0x23')]],'as':_0x1a7020['as'],'attributes':_0x1a7020[_0xd7f3('0x1f')],'include':_0x1a7020[_0xd7f3('0x21')]?_[_0xd7f3('0x22')](_0x1a7020[_0xd7f3('0x21')],function(_0x481763){return{'model':db[_0x481763[_0xd7f3('0x23')]],'as':_0x481763['as'],'attributes':_0x481763[_0xd7f3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd7f3('0xe')](function(_0x60e5fa){logger['info'](_0xd7f3('0x24'),_0x139fa7);logger[_0xd7f3('0x11')](_0xd7f3('0x24'),_0x139fa7,JSON[_0xd7f3('0x13')](_0x60e5fa));_0x1e1949(_0x60e5fa);})[_0xd7f3('0x19')](function(_0x3c1554){logger[_0xd7f3('0x14')]('ShowServicenowAccount',_0x3c1554[_0xd7f3('0x16')],_0x139fa7);_0x4a6b46(_0x3985f1[_0xd7f3('0x14')](0x1f4,_0x3c1554['message']));});});}; \ No newline at end of file +var _0x40b1=['../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','map','include','model','ShowServicenowAccount','find','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0x40b1,0xb1));var _0x140b=function(_0x219943,_0x2f612a){_0x219943=_0x219943-0x0;var _0x492006=_0x40b1[_0x219943];return _0x492006;};'use strict';var _=require(_0x140b('0x0'));var util=require(_0x140b('0x1'));var moment=require(_0x140b('0x2'));var BPromise=require(_0x140b('0x3'));var rs=require(_0x140b('0x4'));var fs=require('fs');var Redis=require(_0x140b('0x5'));var db=require(_0x140b('0x6'))['db'];var utils=require(_0x140b('0x7'));var logger=require(_0x140b('0x8'))(_0x140b('0x9'));var config=require('../../config/environment');var jayson=require(_0x140b('0xa'));var client=jayson[_0x140b('0xb')][_0x140b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x249ad2,_0x27658b,_0xc851fb){return new BPromise(function(_0x5bb882,_0x20b65e){return client[_0x140b('0xd')](_0x249ad2,_0xc851fb)['then'](function(_0x58ea30){logger[_0x140b('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x27658b,_0x140b('0xf'));logger[_0x140b('0x10')](_0x140b('0x11'),_0x27658b,_0x140b('0xf'),JSON[_0x140b('0x12')](_0x58ea30));if(_0x58ea30[_0x140b('0x13')]){if(_0x58ea30['error'][_0x140b('0x14')]===0x1f4){logger[_0x140b('0x13')](_0x140b('0x15'),_0x27658b,_0x58ea30[_0x140b('0x13')]['message']);return _0x20b65e(_0x58ea30['error']['message']);}logger[_0x140b('0x13')](_0x140b('0x15'),_0x27658b,_0x58ea30[_0x140b('0x13')]['message']);return _0x5bb882(_0x58ea30[_0x140b('0x13')][_0x140b('0x16')]);}else{logger[_0x140b('0xe')](_0x140b('0x15'),_0x27658b,_0x140b('0xf'));_0x5bb882(_0x58ea30['result'][_0x140b('0x16')]);}})['catch'](function(_0x2b12db){logger[_0x140b('0x13')](_0x140b('0x15'),_0x27658b,_0x2b12db);_0x20b65e(_0x2b12db);});});}exports[_0x140b('0x17')]=function(_0x49440a){var _0x5e35b2=this;return new Promise(function(_0x57990a,_0x5451fe){return db[_0x140b('0x18')]['findAll']({'raw':_0x49440a[_0x140b('0x19')]?_0x49440a[_0x140b('0x19')][_0x140b('0x1a')]===undefined?!![]:![]:!![],'where':_0x49440a[_0x140b('0x19')]?_0x49440a[_0x140b('0x19')][_0x140b('0x1b')]||null:null,'attributes':_0x49440a[_0x140b('0x19')]?_0x49440a['options'][_0x140b('0x1c')]||null:null,'limit':_0x49440a['options']?_0x49440a[_0x140b('0x19')][_0x140b('0x1d')]||null:null,'include':_0x49440a['options']?_0x49440a['options']['include']?_[_0x140b('0x1e')](_0x49440a[_0x140b('0x19')][_0x140b('0x1f')],function(_0x487502){return{'model':db[_0x487502[_0x140b('0x20')]],'as':_0x487502['as'],'attributes':_0x487502[_0x140b('0x1c')],'include':_0x487502['include']?_[_0x140b('0x1e')](_0x487502[_0x140b('0x1f')],function(_0x2529bb){return{'model':db[_0x2529bb[_0x140b('0x20')]],'as':_0x2529bb['as'],'attributes':_0x2529bb[_0x140b('0x1c')],'include':_0x2529bb[_0x140b('0x1f')]?_[_0x140b('0x1e')](_0x2529bb[_0x140b('0x1f')],function(_0x316bf1){return{'model':db[_0x316bf1[_0x140b('0x20')]],'as':_0x316bf1['as'],'attributes':_0x316bf1[_0x140b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d8fa2){logger[_0x140b('0xe')](_0x140b('0x17'),_0x49440a);logger[_0x140b('0x10')](_0x140b('0x17'),_0x49440a,JSON[_0x140b('0x12')](_0x5d8fa2));_0x57990a(_0x5d8fa2);})['catch'](function(_0x1bf254){logger[_0x140b('0x13')](_0x140b('0x17'),_0x1bf254[_0x140b('0x16')],_0x49440a);_0x5451fe(_0x5e35b2['error'](0x1f4,_0x1bf254[_0x140b('0x16')]));});});};exports[_0x140b('0x21')]=function(_0x3ffaca){var _0x464c8b=this;return new Promise(function(_0x37bcae,_0x19513d){return db[_0x140b('0x18')][_0x140b('0x22')]({'raw':_0x3ffaca[_0x140b('0x19')]?_0x3ffaca[_0x140b('0x19')][_0x140b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ffaca[_0x140b('0x19')]?_0x3ffaca['options'][_0x140b('0x1b')]||null:null,'attributes':_0x3ffaca['options']?_0x3ffaca[_0x140b('0x19')][_0x140b('0x1c')]||null:null,'include':_0x3ffaca[_0x140b('0x19')]?_0x3ffaca[_0x140b('0x19')][_0x140b('0x1f')]?_[_0x140b('0x1e')](_0x3ffaca[_0x140b('0x19')][_0x140b('0x1f')],function(_0x2a0b08){return{'model':db[_0x2a0b08[_0x140b('0x20')]],'as':_0x2a0b08['as'],'attributes':_0x2a0b08['attributes'],'include':_0x2a0b08[_0x140b('0x1f')]?_['map'](_0x2a0b08['include'],function(_0x596921){return{'model':db[_0x596921[_0x140b('0x20')]],'as':_0x596921['as'],'attributes':_0x596921[_0x140b('0x1c')],'include':_0x596921[_0x140b('0x1f')]?_[_0x140b('0x1e')](_0x596921[_0x140b('0x1f')],function(_0x3e64dd){return{'model':db[_0x3e64dd['model']],'as':_0x3e64dd['as'],'attributes':_0x3e64dd[_0x140b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x140b('0x23')](function(_0x281043){logger[_0x140b('0xe')](_0x140b('0x21'),_0x3ffaca);logger[_0x140b('0x10')]('ShowServicenowAccount',_0x3ffaca,JSON[_0x140b('0x12')](_0x281043));_0x37bcae(_0x281043);})[_0x140b('0x24')](function(_0x352219){logger[_0x140b('0x13')](_0x140b('0x21'),_0x352219['message'],_0x3ffaca);_0x19513d(_0x464c8b[_0x140b('0x13')](0x1f4,_0x352219[_0x140b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c81638c..edbe0f3 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 _0x86b3=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','index','get','isAuthenticated'];(function(_0x2acc5b,_0x2616eb){var _0xcfb508=function(_0x12daa5){while(--_0x12daa5){_0x2acc5b['push'](_0x2acc5b['shift']());}};_0xcfb508(++_0x2616eb);}(_0x86b3,0x1bd));var _0x386b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86b3[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x386b('0x0'));var util=require(_0x386b('0x1'));var path=require('path');var timeout=require(_0x386b('0x2'));var express=require(_0x386b('0x3'));var router=express[_0x386b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x386b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x386b('0x6'));var controller=require(_0x386b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x386b('0x8')]);router[_0x386b('0x9')]('/:id',auth[_0x386b('0xa')](),controller[_0x386b('0xb')]);router['get'](_0x386b('0xc'),auth[_0x386b('0xa')](),controller['getFields']);router['get'](_0x386b('0xd'),auth['isAuthenticated'](),controller[_0x386b('0xe')]);router[_0x386b('0x9')](_0x386b('0xf'),auth[_0x386b('0xa')](),controller['getDescriptions']);router[_0x386b('0x10')]('/',auth[_0x386b('0xa')](),controller[_0x386b('0x11')]);router[_0x386b('0x12')](_0x386b('0x13'),auth[_0x386b('0xa')](),controller[_0x386b('0x14')]);router[_0x386b('0x15')](_0x386b('0x13'),auth['isAuthenticated'](),controller[_0x386b('0x16')]);module[_0x386b('0x17')]=router; \ No newline at end of file +var _0xb7b5=['get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0xb7b5,0xe8));var _0x5b7b=function(_0x5a09fd,_0x487978){_0x5a09fd=_0x5a09fd-0x0;var _0x51dc26=_0xb7b5[_0x5a09fd];return _0x51dc26;};'use strict';var multer=require(_0x5b7b('0x0'));var util=require(_0x5b7b('0x1'));var path=require('path');var timeout=require(_0x5b7b('0x2'));var express=require(_0x5b7b('0x3'));var router=express['Router']();var fs_extra=require(_0x5b7b('0x4'));var auth=require(_0x5b7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b7b('0x6'));var controller=require(_0x5b7b('0x7'));router[_0x5b7b('0x8')]('/',auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xa')]);router[_0x5b7b('0x8')]('/:id',auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xb')]);router['get'](_0x5b7b('0xc'),auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xd')]);router[_0x5b7b('0x8')]('/:id/subjects',auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xe')]);router['get'](_0x5b7b('0xf'),auth[_0x5b7b('0x9')](),controller[_0x5b7b('0x10')]);router[_0x5b7b('0x11')]('/',auth[_0x5b7b('0x9')](),controller[_0x5b7b('0x12')]);router[_0x5b7b('0x13')](_0x5b7b('0x14'),auth['isAuthenticated'](),controller[_0x5b7b('0x15')]);router[_0x5b7b('0x16')](_0x5b7b('0x14'),auth[_0x5b7b('0x9')](),controller[_0x5b7b('0x17')]);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 3420b8d..05e2a3e 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 _0x6b7f=['sequelize','exports','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6b7f,0x90));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6b7('0x0'));module[_0xf6b7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf6b7('0x2')]}}; \ No newline at end of file +var _0xccc4=['exports','STRING','sequelize'];(function(_0x3370f6,_0x37b373){var _0x3bbab2=function(_0x21c62c){while(--_0x21c62c){_0x3370f6['push'](_0x3370f6['shift']());}};_0x3bbab2(++_0x37b373);}(_0xccc4,0xe3));var _0x4ccc=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xccc4[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x4ccc('0x0'));module[_0x4ccc('0x1')]={'name':{'type':Sequelize[_0x4ccc('0x2')]},'description':{'type':Sequelize[_0x4ccc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index fce82f2..70680b0 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 _0xb544=['undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','stack','name','map','ServicenowConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','body','getFields','findOne','ServicenowField','sort','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xb544,0x1c8));var _0x4b54=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xb544[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x4b54('0x0'));var rimraf=require(_0x4b54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4b54('0x2'));var BPromise=require(_0x4b54('0x3'));var Mustache=require(_0x4b54('0x4'));var util=require(_0x4b54('0x5'));var path=require(_0x4b54('0x6'));var sox=require(_0x4b54('0x7'));var csv=require(_0x4b54('0x8'));var ejs=require(_0x4b54('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b54('0xa'));var squel=require('squel');var crypto=require(_0x4b54('0xb'));var jsforce=require(_0x4b54('0xc'));var deskjs=require(_0x4b54('0xd'));var toCsv=require(_0x4b54('0x8'));var querystring=require(_0x4b54('0xe'));var Papa=require(_0x4b54('0xf'));var Redis=require('ioredis');var authService=require(_0x4b54('0x10'));var qs=require(_0x4b54('0x11'));var as=require(_0x4b54('0x12'));var hardwareService=require(_0x4b54('0x13'));var logger=require(_0x4b54('0x14'))(_0x4b54('0x15'));var utils=require(_0x4b54('0x16'));var config=require(_0x4b54('0x17'));var licenseUtil=require(_0x4b54('0x18'));var db=require(_0x4b54('0x19'))['db'];function respondWithStatusCode(_0x248a7d,_0x1004a7){_0x1004a7=_0x1004a7||0xcc;return function(_0x32b267){if(_0x32b267){return _0x248a7d[_0x4b54('0x1a')](_0x1004a7);}return _0x248a7d[_0x4b54('0x1b')](_0x1004a7)['end']();};}function respondWithResult(_0x3dc4f1,_0x2bef6d){_0x2bef6d=_0x2bef6d||0xc8;return function(_0x456851){if(_0x456851){return _0x3dc4f1[_0x4b54('0x1b')](_0x2bef6d)[_0x4b54('0x1c')](_0x456851);}};}function respondWithFilteredResult(_0x2f5e6c,_0x2c20d6){return function(_0xa76081){if(_0xa76081){var _0x9b9260=typeof _0x2c20d6[_0x4b54('0x1d')]===_0x4b54('0x1e')&&typeof _0x2c20d6[_0x4b54('0x1f')]===_0x4b54('0x1e');var _0x2adb66=_0xa76081[_0x4b54('0x20')];var _0x314c95=_0x9b9260?0x0:_0x2c20d6[_0x4b54('0x1d')];var _0x469776=_0x9b9260?_0xa76081[_0x4b54('0x20')]:_0x2c20d6[_0x4b54('0x1d')]+_0x2c20d6[_0x4b54('0x1f')];var _0x3ed850;if(_0x469776>=_0x2adb66){_0x469776=_0x2adb66;_0x3ed850=0xc8;}else{_0x3ed850=0xce;}_0x2f5e6c[_0x4b54('0x1b')](_0x3ed850);return _0x2f5e6c['set'](_0x4b54('0x21'),_0x314c95+'-'+_0x469776+'/'+_0x2adb66)['json'](_0xa76081);}return null;};}function patchUpdates(_0x456b56){return function(_0x482965){try{jsonpatch[_0x4b54('0x22')](_0x482965,_0x456b56,!![]);}catch(_0x515cb8){return BPromise['reject'](_0x515cb8);}return _0x482965[_0x4b54('0x23')]();};}function saveUpdates(_0x46619d,_0x5e72e6){return function(_0x4901c2){if(_0x4901c2){return _0x4901c2[_0x4b54('0x24')](_0x46619d)[_0x4b54('0x25')](function(_0x4f0f5f){return _0x4f0f5f;});}return null;};}function removeEntity(_0x2bea9f,_0x4bb5ac){return function(_0x19b204){if(_0x19b204){return _0x19b204[_0x4b54('0x26')]()[_0x4b54('0x25')](function(){_0x2bea9f[_0x4b54('0x1b')](0xcc)[_0x4b54('0x27')]();});}};}function handleEntityNotFound(_0x540ced,_0x24d0f0){return function(_0x1d6c03){if(!_0x1d6c03){_0x540ced[_0x4b54('0x1a')](0x194);}return _0x1d6c03;};}function handleError(_0x307a0b,_0x37d406){_0x37d406=_0x37d406||0x1f4;return function(_0x29c8cd){logger[_0x4b54('0x28')](_0x29c8cd[_0x4b54('0x29')]);if(_0x29c8cd[_0x4b54('0x2a')]){delete _0x29c8cd[_0x4b54('0x2a')];}_0x307a0b[_0x4b54('0x1b')](_0x37d406)['send'](_0x29c8cd);};}exports['index']=function(_0x34ab6a,_0x117010){var _0x4308ab={},_0xb92157={},_0x86b480={'count':0x0,'rows':[]};var _0x4e8126=_[_0x4b54('0x2b')](db[_0x4b54('0x2c')]['rawAttributes'],function(_0x148c9a){return{'name':_0x148c9a[_0x4b54('0x2d')],'type':_0x148c9a['type'][_0x4b54('0x2e')]};});_0xb92157[_0x4b54('0x2f')]=_['map'](_0x4e8126,_0x4b54('0x2a'));_0xb92157[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x34ab6a[_0x4b54('0x30')]);_0xb92157[_0x4b54('0x32')]=_[_0x4b54('0x33')](_0xb92157[_0x4b54('0x2f')],_0xb92157[_0x4b54('0x30')]);_0x4308ab[_0x4b54('0x34')]=_[_0x4b54('0x33')](_0xb92157[_0x4b54('0x2f')],qs[_0x4b54('0x35')](_0x34ab6a[_0x4b54('0x30')]['fields']));_0x4308ab['attributes']=_0x4308ab[_0x4b54('0x34')][_0x4b54('0x36')]?_0x4308ab[_0x4b54('0x34')]:_0xb92157['model'];if(!_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x4308ab[_0x4b54('0x1f')]=qs['limit'](_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x4308ab['offset']=qs[_0x4b54('0x1d')](_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x1d')]);}_0x4308ab[_0x4b54('0x39')]=qs['sort'](_0x34ab6a['query']['sort']);_0x4308ab[_0x4b54('0x3a')]=qs[_0x4b54('0x32')](_[_0x4b54('0x3b')](_0x34ab6a[_0x4b54('0x30')],_0xb92157[_0x4b54('0x32')]),_0x4e8126);if(_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x3c')]){_0x4308ab['where']=_[_0x4b54('0x3d')](_0x4308ab['where'],{'$or':_[_0x4b54('0x2b')](_0x4e8126,function(_0x586a0d){if(_0x586a0d[_0x4b54('0x3e')]!==_0x4b54('0x3f')){var _0xb57b88={};_0xb57b88[_0x586a0d[_0x4b54('0x2a')]]={'$like':'%'+_0x34ab6a[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0xb57b88;}})});}_0x4308ab=_[_0x4b54('0x3d')]({},_0x4308ab,_0x34ab6a['options']);var _0x41a4d6={'where':_0x4308ab[_0x4b54('0x3a')]};return db[_0x4b54('0x2c')]['count'](_0x41a4d6)[_0x4b54('0x25')](function(_0x3cfd54){_0x86b480[_0x4b54('0x20')]=_0x3cfd54;if(_0x34ab6a['query'][_0x4b54('0x40')]){_0x4308ab['include']=[{'all':!![]}];}return db[_0x4b54('0x2c')][_0x4b54('0x41')](_0x4308ab);})[_0x4b54('0x25')](function(_0x207ec5){_0x86b480['rows']=_0x207ec5;return _0x86b480;})['then'](respondWithFilteredResult(_0x117010,_0x4308ab))[_0x4b54('0x42')](handleError(_0x117010,null));};exports[_0x4b54('0x43')]=function(_0x349799,_0x5a25b7){var _0x5ec581={'raw':![],'where':{'id':_0x349799[_0x4b54('0x44')]['id']}},_0x457c41={};_0x457c41['model']=_['keys'](db[_0x4b54('0x2c')][_0x4b54('0x45')]);_0x457c41[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x349799[_0x4b54('0x30')]);_0x457c41['filters']=_['intersection'](_0x457c41['model'],_0x457c41[_0x4b54('0x30')]);_0x5ec581[_0x4b54('0x34')]=_['intersection'](_0x457c41[_0x4b54('0x2f')],qs['fields'](_0x349799['query']['fields']));_0x5ec581['attributes']=_0x5ec581['attributes'][_0x4b54('0x36')]?_0x5ec581['attributes']:_0x457c41[_0x4b54('0x2f')];if(_0x349799[_0x4b54('0x30')][_0x4b54('0x40')]){_0x5ec581[_0x4b54('0x46')]=[{'all':!![]}];}_0x5ec581=_[_0x4b54('0x3d')]({},_0x5ec581,_0x349799[_0x4b54('0x47')]);return db[_0x4b54('0x2c')][_0x4b54('0x48')](_0x5ec581)['then'](handleEntityNotFound(_0x5a25b7,null))['then'](respondWithResult(_0x5a25b7,null))[_0x4b54('0x42')](handleError(_0x5a25b7,null));};exports[_0x4b54('0x49')]=function(_0x5b797b,_0x4c6bff){return db['ServicenowConfiguration'][_0x4b54('0x49')](_0x5b797b['body'],{})[_0x4b54('0x25')](respondWithResult(_0x4c6bff,0xc9))[_0x4b54('0x42')](handleError(_0x4c6bff,null));};exports[_0x4b54('0x24')]=function(_0x381ef2,_0x48c317){if(_0x381ef2['body']['id']){delete _0x381ef2[_0x4b54('0x4a')]['id'];}return db[_0x4b54('0x2c')][_0x4b54('0x48')]({'where':{'id':_0x381ef2[_0x4b54('0x44')]['id']}})[_0x4b54('0x25')](handleEntityNotFound(_0x48c317,null))[_0x4b54('0x25')](saveUpdates(_0x381ef2[_0x4b54('0x4a')],null))[_0x4b54('0x25')](respondWithResult(_0x48c317,null))[_0x4b54('0x42')](handleError(_0x48c317,null));};exports[_0x4b54('0x26')]=function(_0x4def89,_0xecf81d){return db[_0x4b54('0x2c')][_0x4b54('0x48')]({'where':{'id':_0x4def89[_0x4b54('0x44')]['id']}})[_0x4b54('0x25')](handleEntityNotFound(_0xecf81d,null))[_0x4b54('0x25')](removeEntity(_0xecf81d,null))[_0x4b54('0x42')](handleError(_0xecf81d,null));};exports[_0x4b54('0x4b')]=function(_0x492941,_0x4fe622,_0x5abb2c){var _0x14f96a={};var _0x11ea69={};var _0x4f0d58;var _0x4605c5;return db[_0x4b54('0x2c')][_0x4b54('0x4c')]({'where':{'id':_0x492941[_0x4b54('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fe622,null))[_0x4b54('0x25')](function(_0x20b52f){if(_0x20b52f){_0x4f0d58=_0x20b52f;_0x11ea69['model']=_[_0x4b54('0x31')](db[_0x4b54('0x4d')][_0x4b54('0x45')]);_0x11ea69[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x492941[_0x4b54('0x30')]);_0x11ea69[_0x4b54('0x32')]=_['intersection'](_0x11ea69['model'],_0x11ea69[_0x4b54('0x30')]);_0x14f96a[_0x4b54('0x34')]=_['intersection'](_0x11ea69[_0x4b54('0x2f')],qs[_0x4b54('0x35')](_0x492941['query'][_0x4b54('0x35')]));_0x14f96a[_0x4b54('0x34')]=_0x14f96a[_0x4b54('0x34')]['length']?_0x14f96a[_0x4b54('0x34')]:_0x11ea69['model'];_0x14f96a[_0x4b54('0x39')]=qs[_0x4b54('0x4e')](_0x492941[_0x4b54('0x30')][_0x4b54('0x4e')]);_0x14f96a[_0x4b54('0x3a')]=qs[_0x4b54('0x32')](_['pick'](_0x492941[_0x4b54('0x30')],_0x11ea69[_0x4b54('0x32')]));if(_0x492941[_0x4b54('0x30')][_0x4b54('0x3c')]){_0x14f96a[_0x4b54('0x3a')]=_[_0x4b54('0x3d')](_0x14f96a[_0x4b54('0x3a')],{'$or':_['map'](_0x14f96a['attributes'],function(_0xb3f93e){var _0x6ffac7={};_0x6ffac7[_0xb3f93e]={'$like':'%'+_0x492941[_0x4b54('0x30')]['filter']+'%'};return _0x6ffac7;})});}_0x14f96a=_[_0x4b54('0x3d')]({},_0x14f96a,_0x492941[_0x4b54('0x47')]);return _0x4f0d58[_0x4b54('0x4b')](_0x14f96a);}})[_0x4b54('0x25')](function(_0x52ad74){if(_0x52ad74){_0x4605c5=_0x52ad74[_0x4b54('0x36')];if(!_0x492941[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x14f96a[_0x4b54('0x1f')]=qs[_0x4b54('0x1f')](_0x492941[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x14f96a[_0x4b54('0x1d')]=qs[_0x4b54('0x1d')](_0x492941[_0x4b54('0x30')][_0x4b54('0x1d')]);}return _0x4f0d58[_0x4b54('0x4b')](_0x14f96a);}})[_0x4b54('0x25')](function(_0x31f028){if(_0x31f028){return _0x31f028?{'count':_0x4605c5,'rows':_0x31f028}:null;}})[_0x4b54('0x25')](respondWithResult(_0x4fe622,null))['catch'](handleError(_0x4fe622,null));};exports[_0x4b54('0x4f')]=function(_0x4ccd14,_0x5c49e2,_0x2bb85f){var _0x4c9ad4={};var _0x39ca8d={};var _0xcc718b;var _0x56dabe;return db[_0x4b54('0x2c')][_0x4b54('0x4c')]({'where':{'id':_0x4ccd14[_0x4b54('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c49e2,null))[_0x4b54('0x25')](function(_0x252f11){if(_0x252f11){_0xcc718b=_0x252f11;_0x39ca8d[_0x4b54('0x2f')]=_[_0x4b54('0x31')](db[_0x4b54('0x4d')][_0x4b54('0x45')]);_0x39ca8d[_0x4b54('0x30')]=_[_0x4b54('0x31')](_0x4ccd14[_0x4b54('0x30')]);_0x39ca8d['filters']=_['intersection'](_0x39ca8d[_0x4b54('0x2f')],_0x39ca8d['query']);_0x4c9ad4[_0x4b54('0x34')]=_['intersection'](_0x39ca8d[_0x4b54('0x2f')],qs[_0x4b54('0x35')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x35')]));_0x4c9ad4[_0x4b54('0x34')]=_0x4c9ad4[_0x4b54('0x34')][_0x4b54('0x36')]?_0x4c9ad4[_0x4b54('0x34')]:_0x39ca8d['model'];_0x4c9ad4['order']=qs[_0x4b54('0x4e')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x4e')]);_0x4c9ad4[_0x4b54('0x3a')]=qs['filters'](_[_0x4b54('0x3b')](_0x4ccd14[_0x4b54('0x30')],_0x39ca8d[_0x4b54('0x32')]));if(_0x4ccd14[_0x4b54('0x30')]['filter']){_0x4c9ad4[_0x4b54('0x3a')]=_[_0x4b54('0x3d')](_0x4c9ad4[_0x4b54('0x3a')],{'$or':_['map'](_0x4c9ad4[_0x4b54('0x34')],function(_0x1d597f){var _0x506d36={};_0x506d36[_0x1d597f]={'$like':'%'+_0x4ccd14['query'][_0x4b54('0x3c')]+'%'};return _0x506d36;})});}_0x4c9ad4=_[_0x4b54('0x3d')]({},_0x4c9ad4,_0x4ccd14[_0x4b54('0x47')]);return _0xcc718b[_0x4b54('0x4f')](_0x4c9ad4);}})[_0x4b54('0x25')](function(_0x138778){if(_0x138778){_0x56dabe=_0x138778['length'];if(!_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x4c9ad4[_0x4b54('0x1f')]=qs[_0x4b54('0x1f')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x4c9ad4['offset']=qs[_0x4b54('0x1d')](_0x4ccd14[_0x4b54('0x30')][_0x4b54('0x1d')]);}return _0xcc718b[_0x4b54('0x4f')](_0x4c9ad4);}})[_0x4b54('0x25')](function(_0x101e3a){if(_0x101e3a){return _0x101e3a?{'count':_0x56dabe,'rows':_0x101e3a}:null;}})[_0x4b54('0x25')](respondWithResult(_0x5c49e2,null))[_0x4b54('0x42')](handleError(_0x5c49e2,null));};exports[_0x4b54('0x50')]=function(_0x561152,_0x30143e,_0x30247d){var _0x57c943={};var _0x542219={};var _0xb8f8e5;var _0x3baba6;return db[_0x4b54('0x2c')][_0x4b54('0x4c')]({'where':{'id':_0x561152[_0x4b54('0x44')]['id']}})[_0x4b54('0x25')](handleEntityNotFound(_0x30143e,null))[_0x4b54('0x25')](function(_0x53f613){if(_0x53f613){_0xb8f8e5=_0x53f613;_0x542219[_0x4b54('0x2f')]=_[_0x4b54('0x31')](db['ServicenowField'][_0x4b54('0x45')]);_0x542219['query']=_[_0x4b54('0x31')](_0x561152['query']);_0x542219['filters']=_[_0x4b54('0x33')](_0x542219['model'],_0x542219[_0x4b54('0x30')]);_0x57c943['attributes']=_[_0x4b54('0x33')](_0x542219['model'],qs[_0x4b54('0x35')](_0x561152[_0x4b54('0x30')][_0x4b54('0x35')]));_0x57c943[_0x4b54('0x34')]=_0x57c943[_0x4b54('0x34')][_0x4b54('0x36')]?_0x57c943[_0x4b54('0x34')]:_0x542219[_0x4b54('0x2f')];_0x57c943['order']=qs[_0x4b54('0x4e')](_0x561152['query']['sort']);_0x57c943[_0x4b54('0x3a')]=qs[_0x4b54('0x32')](_[_0x4b54('0x3b')](_0x561152[_0x4b54('0x30')],_0x542219[_0x4b54('0x32')]));if(_0x561152['query']['filter']){_0x57c943[_0x4b54('0x3a')]=_[_0x4b54('0x3d')](_0x57c943['where'],{'$or':_[_0x4b54('0x2b')](_0x57c943[_0x4b54('0x34')],function(_0xedb3b8){var _0x2f0beb={};_0x2f0beb[_0xedb3b8]={'$like':'%'+_0x561152[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0x2f0beb;})});}_0x57c943=_[_0x4b54('0x3d')]({},_0x57c943,_0x561152['options']);return _0xb8f8e5[_0x4b54('0x50')](_0x57c943);}})[_0x4b54('0x25')](function(_0x1c6168){if(_0x1c6168){_0x3baba6=_0x1c6168[_0x4b54('0x36')];if(!_0x561152[_0x4b54('0x30')][_0x4b54('0x37')](_0x4b54('0x38'))){_0x57c943[_0x4b54('0x1f')]=qs[_0x4b54('0x1f')](_0x561152[_0x4b54('0x30')][_0x4b54('0x1f')]);_0x57c943['offset']=qs[_0x4b54('0x1d')](_0x561152[_0x4b54('0x30')]['offset']);}return _0xb8f8e5[_0x4b54('0x50')](_0x57c943);}})[_0x4b54('0x25')](function(_0xb89383){if(_0xb89383){return _0xb89383?{'count':_0x3baba6,'rows':_0xb89383}:null;}})[_0x4b54('0x25')](respondWithResult(_0x30143e,null))['catch'](handleError(_0x30143e,null));}; \ No newline at end of file +var _0x7dad=['nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','update','body','find','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','limit','undefined','count','status','reject','save','then','destroy','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes'];(function(_0x2e5e9f,_0x56933f){var _0x45036b=function(_0x9a4c69){while(--_0x9a4c69){_0x2e5e9f['push'](_0x2e5e9f['shift']());}};_0x45036b(++_0x56933f);}(_0x7dad,0xf0));var _0xd7da=function(_0x250476,_0x225b6b){_0x250476=_0x250476-0x0;var _0xe09865=_0x7dad[_0x250476];return _0xe09865;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7da('0x0'));var zipdir=require(_0xd7da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7da('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd7da('0x3'));var util=require('util');var path=require(_0xd7da('0x4'));var sox=require('sox');var csv=require(_0xd7da('0x5'));var ejs=require(_0xd7da('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7da('0x7'));var squel=require('squel');var crypto=require(_0xd7da('0x8'));var jsforce=require(_0xd7da('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd7da('0x5'));var querystring=require('querystring');var Papa=require(_0xd7da('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd7da('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7da('0xc'))(_0xd7da('0xd'));var utils=require(_0xd7da('0xe'));var config=require(_0xd7da('0xf'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa7c155,_0x5a6305){_0x5a6305=_0x5a6305||0xcc;return function(_0x40e57d){if(_0x40e57d){return _0xa7c155[_0xd7da('0x10')](_0x5a6305);}return _0xa7c155['status'](_0x5a6305)[_0xd7da('0x11')]();};}function respondWithResult(_0x3d2255,_0x263d13){_0x263d13=_0x263d13||0xc8;return function(_0x462eeb){if(_0x462eeb){return _0x3d2255['status'](_0x263d13)[_0xd7da('0x12')](_0x462eeb);}};}function respondWithFilteredResult(_0x397e02,_0x52e803){return function(_0x3797ae){if(_0x3797ae){var _0x36580b=typeof _0x52e803[_0xd7da('0x13')]==='undefined'&&typeof _0x52e803[_0xd7da('0x14')]===_0xd7da('0x15');var _0x592b1b=_0x3797ae[_0xd7da('0x16')];var _0x5df376=_0x36580b?0x0:_0x52e803[_0xd7da('0x13')];var _0x369f51=_0x36580b?_0x3797ae[_0xd7da('0x16')]:_0x52e803[_0xd7da('0x13')]+_0x52e803[_0xd7da('0x14')];var _0x5897dd;if(_0x369f51>=_0x592b1b){_0x369f51=_0x592b1b;_0x5897dd=0xc8;}else{_0x5897dd=0xce;}_0x397e02[_0xd7da('0x17')](_0x5897dd);return _0x397e02['set']('Content-Range',_0x5df376+'-'+_0x369f51+'/'+_0x592b1b)['json'](_0x3797ae);}return null;};}function patchUpdates(_0x65a0b1){return function(_0x5b9316){try{jsonpatch['apply'](_0x5b9316,_0x65a0b1,!![]);}catch(_0x57f507){return BPromise[_0xd7da('0x18')](_0x57f507);}return _0x5b9316[_0xd7da('0x19')]();};}function saveUpdates(_0x423ba9,_0x1366a9){return function(_0x1e81be){if(_0x1e81be){return _0x1e81be['update'](_0x423ba9)[_0xd7da('0x1a')](function(_0x1d5b37){return _0x1d5b37;});}return null;};}function removeEntity(_0xa0e55a,_0x21fbff){return function(_0x31144d){if(_0x31144d){return _0x31144d[_0xd7da('0x1b')]()[_0xd7da('0x1a')](function(){_0xa0e55a['status'](0xcc)[_0xd7da('0x11')]();});}};}function handleEntityNotFound(_0x3d8f16,_0x57d283){return function(_0x150da7){if(!_0x150da7){_0x3d8f16['sendStatus'](0x194);}return _0x150da7;};}function handleError(_0x2f3959,_0x4720c0){_0x4720c0=_0x4720c0||0x1f4;return function(_0x10eb40){logger['error'](_0x10eb40[_0xd7da('0x1c')]);if(_0x10eb40[_0xd7da('0x1d')]){delete _0x10eb40['name'];}_0x2f3959[_0xd7da('0x17')](_0x4720c0)[_0xd7da('0x1e')](_0x10eb40);};}exports[_0xd7da('0x1f')]=function(_0x2d87e0,_0x144d34){var _0x44f760={},_0x19e746={},_0x3dfd3a={'count':0x0,'rows':[]};var _0xf9e3f6=_[_0xd7da('0x20')](db[_0xd7da('0x21')]['rawAttributes'],function(_0x106e73){return{'name':_0x106e73[_0xd7da('0x22')],'type':_0x106e73[_0xd7da('0x23')][_0xd7da('0x24')]};});_0x19e746[_0xd7da('0x25')]=_[_0xd7da('0x20')](_0xf9e3f6,_0xd7da('0x1d'));_0x19e746['query']=_[_0xd7da('0x26')](_0x2d87e0[_0xd7da('0x27')]);_0x19e746[_0xd7da('0x28')]=_[_0xd7da('0x29')](_0x19e746['model'],_0x19e746[_0xd7da('0x27')]);_0x44f760['attributes']=_[_0xd7da('0x29')](_0x19e746[_0xd7da('0x25')],qs['fields'](_0x2d87e0[_0xd7da('0x27')][_0xd7da('0x2a')]));_0x44f760[_0xd7da('0x2b')]=_0x44f760[_0xd7da('0x2b')]['length']?_0x44f760[_0xd7da('0x2b')]:_0x19e746['model'];if(!_0x2d87e0[_0xd7da('0x27')]['hasOwnProperty'](_0xd7da('0x2c'))){_0x44f760[_0xd7da('0x14')]=qs[_0xd7da('0x14')](_0x2d87e0[_0xd7da('0x27')][_0xd7da('0x14')]);_0x44f760['offset']=qs[_0xd7da('0x13')](_0x2d87e0[_0xd7da('0x27')][_0xd7da('0x13')]);}_0x44f760[_0xd7da('0x2d')]=qs[_0xd7da('0x2e')](_0x2d87e0[_0xd7da('0x27')][_0xd7da('0x2e')]);_0x44f760[_0xd7da('0x2f')]=qs[_0xd7da('0x28')](_[_0xd7da('0x30')](_0x2d87e0[_0xd7da('0x27')],_0x19e746[_0xd7da('0x28')]),_0xf9e3f6);if(_0x2d87e0[_0xd7da('0x27')][_0xd7da('0x31')]){_0x44f760[_0xd7da('0x2f')]=_[_0xd7da('0x32')](_0x44f760[_0xd7da('0x2f')],{'$or':_[_0xd7da('0x20')](_0xf9e3f6,function(_0x5500c7){if(_0x5500c7['type']!=='VIRTUAL'){var _0x530674={};_0x530674[_0x5500c7[_0xd7da('0x1d')]]={'$like':'%'+_0x2d87e0['query']['filter']+'%'};return _0x530674;}})});}_0x44f760=_[_0xd7da('0x32')]({},_0x44f760,_0x2d87e0[_0xd7da('0x33')]);var _0x3ccc8a={'where':_0x44f760[_0xd7da('0x2f')]};return db[_0xd7da('0x21')][_0xd7da('0x16')](_0x3ccc8a)[_0xd7da('0x1a')](function(_0x195b7d){_0x3dfd3a[_0xd7da('0x16')]=_0x195b7d;if(_0x2d87e0[_0xd7da('0x27')][_0xd7da('0x34')]){_0x44f760[_0xd7da('0x35')]=[{'all':!![]}];}return db[_0xd7da('0x21')][_0xd7da('0x36')](_0x44f760);})['then'](function(_0x402d7a){_0x3dfd3a[_0xd7da('0x37')]=_0x402d7a;return _0x3dfd3a;})['then'](respondWithFilteredResult(_0x144d34,_0x44f760))[_0xd7da('0x38')](handleError(_0x144d34,null));};exports[_0xd7da('0x39')]=function(_0x4a8cfc,_0xf5c20b){var _0x26079e={'raw':![],'where':{'id':_0x4a8cfc[_0xd7da('0x3a')]['id']}},_0x47f06b={};_0x47f06b[_0xd7da('0x25')]=_[_0xd7da('0x26')](db['ServicenowConfiguration'][_0xd7da('0x3b')]);_0x47f06b[_0xd7da('0x27')]=_[_0xd7da('0x26')](_0x4a8cfc['query']);_0x47f06b[_0xd7da('0x28')]=_['intersection'](_0x47f06b[_0xd7da('0x25')],_0x47f06b[_0xd7da('0x27')]);_0x26079e[_0xd7da('0x2b')]=_[_0xd7da('0x29')](_0x47f06b[_0xd7da('0x25')],qs['fields'](_0x4a8cfc[_0xd7da('0x27')][_0xd7da('0x2a')]));_0x26079e[_0xd7da('0x2b')]=_0x26079e[_0xd7da('0x2b')][_0xd7da('0x3c')]?_0x26079e[_0xd7da('0x2b')]:_0x47f06b['model'];if(_0x4a8cfc[_0xd7da('0x27')][_0xd7da('0x34')]){_0x26079e[_0xd7da('0x35')]=[{'all':!![]}];}_0x26079e=_[_0xd7da('0x32')]({},_0x26079e,_0x4a8cfc[_0xd7da('0x33')]);return db[_0xd7da('0x21')]['find'](_0x26079e)[_0xd7da('0x1a')](handleEntityNotFound(_0xf5c20b,null))[_0xd7da('0x1a')](respondWithResult(_0xf5c20b,null))[_0xd7da('0x38')](handleError(_0xf5c20b,null));};exports[_0xd7da('0x3d')]=function(_0xf00573,_0x208ac2){return db['ServicenowConfiguration']['create'](_0xf00573['body'],{})[_0xd7da('0x1a')](respondWithResult(_0x208ac2,0xc9))[_0xd7da('0x38')](handleError(_0x208ac2,null));};exports[_0xd7da('0x3e')]=function(_0x49ee07,_0x26995f){if(_0x49ee07[_0xd7da('0x3f')]['id']){delete _0x49ee07[_0xd7da('0x3f')]['id'];}return db[_0xd7da('0x21')][_0xd7da('0x40')]({'where':{'id':_0x49ee07['params']['id']}})['then'](handleEntityNotFound(_0x26995f,null))[_0xd7da('0x1a')](saveUpdates(_0x49ee07[_0xd7da('0x3f')],null))[_0xd7da('0x1a')](respondWithResult(_0x26995f,null))[_0xd7da('0x38')](handleError(_0x26995f,null));};exports[_0xd7da('0x1b')]=function(_0x2701f8,_0x3211f0){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2701f8[_0xd7da('0x3a')]['id']}})[_0xd7da('0x1a')](handleEntityNotFound(_0x3211f0,null))[_0xd7da('0x1a')](removeEntity(_0x3211f0,null))['catch'](handleError(_0x3211f0,null));};exports[_0xd7da('0x41')]=function(_0x39d7b3,_0x3a2818,_0x48f4f9){var _0xa45f2b={};var _0x592887={};var _0xe5fab8;var _0x2f646a;return db[_0xd7da('0x21')][_0xd7da('0x42')]({'where':{'id':_0x39d7b3[_0xd7da('0x3a')]['id']}})[_0xd7da('0x1a')](handleEntityNotFound(_0x3a2818,null))[_0xd7da('0x1a')](function(_0x569f15){if(_0x569f15){_0xe5fab8=_0x569f15;_0x592887['model']=_[_0xd7da('0x26')](db[_0xd7da('0x43')][_0xd7da('0x3b')]);_0x592887[_0xd7da('0x27')]=_[_0xd7da('0x26')](_0x39d7b3[_0xd7da('0x27')]);_0x592887[_0xd7da('0x28')]=_[_0xd7da('0x29')](_0x592887[_0xd7da('0x25')],_0x592887[_0xd7da('0x27')]);_0xa45f2b[_0xd7da('0x2b')]=_[_0xd7da('0x29')](_0x592887['model'],qs['fields'](_0x39d7b3[_0xd7da('0x27')][_0xd7da('0x2a')]));_0xa45f2b[_0xd7da('0x2b')]=_0xa45f2b[_0xd7da('0x2b')][_0xd7da('0x3c')]?_0xa45f2b[_0xd7da('0x2b')]:_0x592887[_0xd7da('0x25')];_0xa45f2b[_0xd7da('0x2d')]=qs[_0xd7da('0x2e')](_0x39d7b3[_0xd7da('0x27')][_0xd7da('0x2e')]);_0xa45f2b[_0xd7da('0x2f')]=qs['filters'](_[_0xd7da('0x30')](_0x39d7b3[_0xd7da('0x27')],_0x592887[_0xd7da('0x28')]));if(_0x39d7b3[_0xd7da('0x27')][_0xd7da('0x31')]){_0xa45f2b['where']=_['merge'](_0xa45f2b[_0xd7da('0x2f')],{'$or':_[_0xd7da('0x20')](_0xa45f2b[_0xd7da('0x2b')],function(_0x104c14){var _0x544a49={};_0x544a49[_0x104c14]={'$like':'%'+_0x39d7b3[_0xd7da('0x27')][_0xd7da('0x31')]+'%'};return _0x544a49;})});}_0xa45f2b=_['merge']({},_0xa45f2b,_0x39d7b3[_0xd7da('0x33')]);return _0xe5fab8[_0xd7da('0x41')](_0xa45f2b);}})[_0xd7da('0x1a')](function(_0x132894){if(_0x132894){_0x2f646a=_0x132894['length'];if(!_0x39d7b3['query'][_0xd7da('0x44')](_0xd7da('0x2c'))){_0xa45f2b[_0xd7da('0x14')]=qs[_0xd7da('0x14')](_0x39d7b3[_0xd7da('0x27')]['limit']);_0xa45f2b[_0xd7da('0x13')]=qs[_0xd7da('0x13')](_0x39d7b3['query'][_0xd7da('0x13')]);}return _0xe5fab8[_0xd7da('0x41')](_0xa45f2b);}})['then'](function(_0x3a42f6){if(_0x3a42f6){return _0x3a42f6?{'count':_0x2f646a,'rows':_0x3a42f6}:null;}})['then'](respondWithResult(_0x3a2818,null))['catch'](handleError(_0x3a2818,null));};exports[_0xd7da('0x45')]=function(_0x4cb633,_0x18cca4,_0x3867a2){var _0xdf4bcf={};var _0x36f742={};var _0x2874a9;var _0x49d570;return db[_0xd7da('0x21')][_0xd7da('0x42')]({'where':{'id':_0x4cb633[_0xd7da('0x3a')]['id']}})[_0xd7da('0x1a')](handleEntityNotFound(_0x18cca4,null))[_0xd7da('0x1a')](function(_0x1fa215){if(_0x1fa215){_0x2874a9=_0x1fa215;_0x36f742[_0xd7da('0x25')]=_[_0xd7da('0x26')](db['ServicenowField'][_0xd7da('0x3b')]);_0x36f742[_0xd7da('0x27')]=_['keys'](_0x4cb633['query']);_0x36f742[_0xd7da('0x28')]=_[_0xd7da('0x29')](_0x36f742[_0xd7da('0x25')],_0x36f742[_0xd7da('0x27')]);_0xdf4bcf[_0xd7da('0x2b')]=_[_0xd7da('0x29')](_0x36f742[_0xd7da('0x25')],qs[_0xd7da('0x2a')](_0x4cb633[_0xd7da('0x27')][_0xd7da('0x2a')]));_0xdf4bcf[_0xd7da('0x2b')]=_0xdf4bcf[_0xd7da('0x2b')][_0xd7da('0x3c')]?_0xdf4bcf[_0xd7da('0x2b')]:_0x36f742[_0xd7da('0x25')];_0xdf4bcf[_0xd7da('0x2d')]=qs[_0xd7da('0x2e')](_0x4cb633[_0xd7da('0x27')]['sort']);_0xdf4bcf['where']=qs[_0xd7da('0x28')](_['pick'](_0x4cb633[_0xd7da('0x27')],_0x36f742['filters']));if(_0x4cb633[_0xd7da('0x27')][_0xd7da('0x31')]){_0xdf4bcf[_0xd7da('0x2f')]=_['merge'](_0xdf4bcf['where'],{'$or':_[_0xd7da('0x20')](_0xdf4bcf[_0xd7da('0x2b')],function(_0x65eb03){var _0x8dd8a2={};_0x8dd8a2[_0x65eb03]={'$like':'%'+_0x4cb633[_0xd7da('0x27')]['filter']+'%'};return _0x8dd8a2;})});}_0xdf4bcf=_[_0xd7da('0x32')]({},_0xdf4bcf,_0x4cb633[_0xd7da('0x33')]);return _0x2874a9[_0xd7da('0x45')](_0xdf4bcf);}})[_0xd7da('0x1a')](function(_0x5c2221){if(_0x5c2221){_0x49d570=_0x5c2221[_0xd7da('0x3c')];if(!_0x4cb633[_0xd7da('0x27')][_0xd7da('0x44')](_0xd7da('0x2c'))){_0xdf4bcf[_0xd7da('0x14')]=qs[_0xd7da('0x14')](_0x4cb633[_0xd7da('0x27')][_0xd7da('0x14')]);_0xdf4bcf[_0xd7da('0x13')]=qs[_0xd7da('0x13')](_0x4cb633['query'][_0xd7da('0x13')]);}return _0x2874a9[_0xd7da('0x45')](_0xdf4bcf);}})[_0xd7da('0x1a')](function(_0x296e29){if(_0x296e29){return _0x296e29?{'count':_0x49d570,'rows':_0x296e29}:null;}})[_0xd7da('0x1a')](respondWithResult(_0x18cca4,null))['catch'](handleError(_0x18cca4,null));};exports[_0xd7da('0x46')]=function(_0x3646e4,_0x2fb6d9,_0x33cc77){var _0x5afeae={};var _0x257ce5={};var _0x43eaef;var _0x5cad71;return db[_0xd7da('0x21')][_0xd7da('0x42')]({'where':{'id':_0x3646e4[_0xd7da('0x3a')]['id']}})[_0xd7da('0x1a')](handleEntityNotFound(_0x2fb6d9,null))[_0xd7da('0x1a')](function(_0x427e43){if(_0x427e43){_0x43eaef=_0x427e43;_0x257ce5[_0xd7da('0x25')]=_[_0xd7da('0x26')](db[_0xd7da('0x43')][_0xd7da('0x3b')]);_0x257ce5[_0xd7da('0x27')]=_['keys'](_0x3646e4[_0xd7da('0x27')]);_0x257ce5['filters']=_[_0xd7da('0x29')](_0x257ce5[_0xd7da('0x25')],_0x257ce5[_0xd7da('0x27')]);_0x5afeae[_0xd7da('0x2b')]=_[_0xd7da('0x29')](_0x257ce5['model'],qs['fields'](_0x3646e4[_0xd7da('0x27')]['fields']));_0x5afeae[_0xd7da('0x2b')]=_0x5afeae[_0xd7da('0x2b')][_0xd7da('0x3c')]?_0x5afeae[_0xd7da('0x2b')]:_0x257ce5[_0xd7da('0x25')];_0x5afeae[_0xd7da('0x2d')]=qs['sort'](_0x3646e4[_0xd7da('0x27')][_0xd7da('0x2e')]);_0x5afeae[_0xd7da('0x2f')]=qs[_0xd7da('0x28')](_[_0xd7da('0x30')](_0x3646e4[_0xd7da('0x27')],_0x257ce5[_0xd7da('0x28')]));if(_0x3646e4[_0xd7da('0x27')][_0xd7da('0x31')]){_0x5afeae[_0xd7da('0x2f')]=_[_0xd7da('0x32')](_0x5afeae['where'],{'$or':_[_0xd7da('0x20')](_0x5afeae['attributes'],function(_0x567bf4){var _0x9513e9={};_0x9513e9[_0x567bf4]={'$like':'%'+_0x3646e4['query'][_0xd7da('0x31')]+'%'};return _0x9513e9;})});}_0x5afeae=_[_0xd7da('0x32')]({},_0x5afeae,_0x3646e4['options']);return _0x43eaef[_0xd7da('0x46')](_0x5afeae);}})[_0xd7da('0x1a')](function(_0x5d1fc7){if(_0x5d1fc7){_0x5cad71=_0x5d1fc7[_0xd7da('0x3c')];if(!_0x3646e4['query'][_0xd7da('0x44')](_0xd7da('0x2c'))){_0x5afeae[_0xd7da('0x14')]=qs[_0xd7da('0x14')](_0x3646e4[_0xd7da('0x27')][_0xd7da('0x14')]);_0x5afeae[_0xd7da('0x13')]=qs[_0xd7da('0x13')](_0x3646e4[_0xd7da('0x27')][_0xd7da('0x13')]);}return _0x43eaef['getDescriptions'](_0x5afeae);}})[_0xd7da('0x1a')](function(_0x1d7645){if(_0x1d7645){return _0x1d7645?{'count':_0x5cad71,'rows':_0x1d7645}:null;}})[_0xd7da('0x1a')](respondWithResult(_0x2fb6d9,null))[_0xd7da('0x38')](handleError(_0x2fb6d9,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 8df2559..76a402e 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 _0xefe3=['../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','moment','bluebird','request-promise','path'];(function(_0x18fe01,_0x3520a6){var _0xcf894e=function(_0x314de2){while(--_0x314de2){_0x18fe01['push'](_0x18fe01['shift']());}};_0xcf894e(++_0x3520a6);}(_0xefe3,0xf5));var _0x3efe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xefe3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3efe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3efe('0x1'));var BPromise=require(_0x3efe('0x2'));var rp=require(_0x3efe('0x3'));var fs=require('fs');var path=require(_0x3efe('0x4'));var rimraf=require('rimraf');var config=require(_0x3efe('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x3efe('0x6')]=function(_0x4b5006,_0x3a1c0a){return _0x4b5006[_0x3efe('0x7')](_0x3efe('0x8'),attributes,{'tableName':_0x3efe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7b4=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','api','moment'];(function(_0x3f6f42,_0x59c9a9){var _0x340420=function(_0x1149d7){while(--_0x1149d7){_0x3f6f42['push'](_0x3f6f42['shift']());}};_0x340420(++_0x59c9a9);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1fe9b0,_0x3f62c0){_0x1fe9b0=_0x1fe9b0-0x0;var _0x1c1486=_0xf7b4[_0x1fe9b0];return _0x1c1486;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'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 7963df0..37fc2bc 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 _0x9412=['message','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x2d9a9c,_0x41bc4f){var _0x545d62=function(_0x4ad081){while(--_0x4ad081){_0x2d9a9c['push'](_0x2d9a9c['shift']());}};_0x545d62(++_0x41bc4f);}(_0x9412,0x8e));var _0x2941=function(_0x4cf9ff,_0x4c228c){_0x4cf9ff=_0x4cf9ff-0x0;var _0x406153=_0x9412[_0x4cf9ff];return _0x406153;};'use strict';var _=require(_0x2941('0x0'));var util=require(_0x2941('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2941('0x2'));var fs=require('fs');var Redis=require(_0x2941('0x3'));var db=require(_0x2941('0x4'))['db'];var utils=require(_0x2941('0x5'));var logger=require(_0x2941('0x6'))(_0x2941('0x7'));var config=require(_0x2941('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2941('0x9')][_0x2941('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8b580e,_0x1562f6,_0xf5e5fa){return new BPromise(function(_0x39cf21,_0x5d7001){return client[_0x2941('0xb')](_0x8b580e,_0xf5e5fa)[_0x2941('0xc')](function(_0x17d7f5){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x1562f6,_0x2941('0xd'));logger['debug'](_0x2941('0xe'),_0x1562f6,_0x2941('0xd'),JSON['stringify'](_0x17d7f5));if(_0x17d7f5[_0x2941('0xf')]){if(_0x17d7f5[_0x2941('0xf')][_0x2941('0x10')]===0x1f4){logger[_0x2941('0xf')](_0x2941('0x11'),_0x1562f6,_0x17d7f5[_0x2941('0xf')][_0x2941('0x12')]);return _0x5d7001(_0x17d7f5[_0x2941('0xf')][_0x2941('0x12')]);}logger[_0x2941('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1562f6,_0x17d7f5['error']['message']);return _0x39cf21(_0x17d7f5['error'][_0x2941('0x12')]);}else{logger[_0x2941('0x13')](_0x2941('0x11'),_0x1562f6,_0x2941('0xd'));_0x39cf21(_0x17d7f5['result'][_0x2941('0x12')]);}})['catch'](function(_0xc22c48){logger[_0x2941('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1562f6,_0xc22c48);_0x5d7001(_0xc22c48);});});} \ No newline at end of file +var _0x14a3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3eaf51,_0x3da9bf){var _0x8a44f1=function(_0x5577bf){while(--_0x5577bf){_0x3eaf51['push'](_0x3eaf51['shift']());}};_0x8a44f1(++_0x3da9bf);}(_0x14a3,0x161));var _0x314a=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x14a3[_0x339129];return _0x1570df;};'use strict';var _=require(_0x314a('0x0'));var util=require(_0x314a('0x1'));var moment=require(_0x314a('0x2'));var BPromise=require(_0x314a('0x3'));var rs=require(_0x314a('0x4'));var fs=require('fs');var Redis=require(_0x314a('0x5'));var db=require(_0x314a('0x6'))['db'];var utils=require(_0x314a('0x7'));var logger=require(_0x314a('0x8'))(_0x314a('0x9'));var config=require(_0x314a('0xa'));var jayson=require(_0x314a('0xb'));var client=jayson[_0x314a('0xc')][_0x314a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2a1f53,_0x593234,_0x2e4d0b){return new BPromise(function(_0x25a28a,_0x5e567d){return client['request'](_0x2a1f53,_0x2e4d0b)[_0x314a('0xe')](function(_0x1b6599){logger[_0x314a('0xf')](_0x314a('0x10'),_0x593234,_0x314a('0x11'));logger[_0x314a('0x12')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x593234,_0x314a('0x11'),JSON[_0x314a('0x13')](_0x1b6599));if(_0x1b6599['error']){if(_0x1b6599[_0x314a('0x14')][_0x314a('0x15')]===0x1f4){logger[_0x314a('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x593234,_0x1b6599[_0x314a('0x14')][_0x314a('0x16')]);return _0x5e567d(_0x1b6599[_0x314a('0x14')][_0x314a('0x16')]);}logger[_0x314a('0x14')](_0x314a('0x10'),_0x593234,_0x1b6599[_0x314a('0x14')][_0x314a('0x16')]);return _0x25a28a(_0x1b6599['error'][_0x314a('0x16')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x593234,_0x314a('0x11'));_0x25a28a(_0x1b6599[_0x314a('0x17')][_0x314a('0x16')]);}})['catch'](function(_0x88dd74){logger[_0x314a('0x14')](_0x314a('0x10'),_0x593234,_0x88dd74);_0x5e567d(_0x88dd74);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7da9915..102ab75 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 _0x928c=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x928c,0xa8));var _0xc928=function(_0x2bb24f,_0x23887a){_0x2bb24f=_0x2bb24f-0x0;var _0x56196a=_0x928c[_0x2bb24f];return _0x56196a;};'use strict';var multer=require(_0xc928('0x0'));var util=require(_0xc928('0x1'));var path=require(_0xc928('0x2'));var timeout=require(_0xc928('0x3'));var express=require(_0xc928('0x4'));var router=express[_0xc928('0x5')]();var fs_extra=require(_0xc928('0x6'));var auth=require(_0xc928('0x7'));var interaction=require(_0xc928('0x8'));var config=require(_0xc928('0x9'));var controller=require(_0xc928('0xa'));router[_0xc928('0xb')]('/',auth[_0xc928('0xc')](),controller[_0xc928('0xd')]);router[_0xc928('0xb')](_0xc928('0xe'),auth[_0xc928('0xc')](),controller[_0xc928('0xf')]);router[_0xc928('0x10')]('/',auth[_0xc928('0xc')](),controller[_0xc928('0x11')]);router[_0xc928('0x12')]('/:id',auth[_0xc928('0xc')](),controller[_0xc928('0x13')]);router[_0xc928('0x14')](_0xc928('0xe'),auth[_0xc928('0xc')](),controller[_0xc928('0x15')]);module[_0xc928('0x16')]=router; \ No newline at end of file +var _0xecc1=['post','create','put','update','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xecc1,0x15a));var _0x1ecc=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xecc1[_0x46ae5a];return _0x434986;};'use strict';var multer=require(_0x1ecc('0x0'));var util=require(_0x1ecc('0x1'));var path=require(_0x1ecc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ecc('0x3'));var interaction=require(_0x1ecc('0x4'));var config=require(_0x1ecc('0x5'));var controller=require(_0x1ecc('0x6'));router[_0x1ecc('0x7')]('/',auth[_0x1ecc('0x8')](),controller[_0x1ecc('0x9')]);router['get'](_0x1ecc('0xa'),auth[_0x1ecc('0x8')](),controller['show']);router[_0x1ecc('0xb')]('/',auth[_0x1ecc('0x8')](),controller[_0x1ecc('0xc')]);router[_0x1ecc('0xd')](_0x1ecc('0xa'),auth[_0x1ecc('0x8')](),controller[_0x1ecc('0xe')]);router['delete'](_0x1ecc('0xa'),auth[_0x1ecc('0x8')](),controller[_0x1ecc('0xf')]);module[_0x1ecc('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index a5beeef..eab7591 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 _0x34af=['exports','ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize'];(function(_0x247d4f,_0x750292){var _0x521893=function(_0x40cdac){while(--_0x40cdac){_0x247d4f['push'](_0x247d4f['shift']());}};_0x521893(++_0x750292);}(_0x34af,0x18f));var _0xf34a=function(_0x46bc19,_0x84350c){_0x46bc19=_0x46bc19-0x0;var _0x54dbc8=_0x34af[_0x46bc19];return _0x54dbc8;};'use strict';var Sequelize=require(_0xf34a('0x0'));module[_0xf34a('0x1')]={'type':{'type':Sequelize[_0xf34a('0x2')]('string',_0xf34a('0x3'),_0xf34a('0x4'),'keyValue','picklist'),'defaultValue':_0xf34a('0x5')},'content':{'type':Sequelize[_0xf34a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf34a('0x5'),'variable',_0xf34a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf34a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf34a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf34a('0x6')]}}; \ No newline at end of file +var _0x00de=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x163688,_0x12be31){var _0x52d3a3=function(_0x4a754c){while(--_0x4a754c){_0x163688['push'](_0x163688['shift']());}};_0x52d3a3(++_0x12be31);}(_0x00de,0x14a));var _0xe00d=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x00de[_0x166d93];return _0xba708;};'use strict';var Sequelize=require(_0xe00d('0x0'));module[_0xe00d('0x1')]={'type':{'type':Sequelize[_0xe00d('0x2')](_0xe00d('0x3'),_0xe00d('0x4'),_0xe00d('0x5'),'keyValue',_0xe00d('0x6')),'defaultValue':_0xe00d('0x3')},'content':{'type':Sequelize[_0xe00d('0x7')]},'key':{'type':Sequelize[_0xe00d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xe00d('0x3'),_0xe00d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe00d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe00d('0x7')]},'customField':{'type':Sequelize[_0xe00d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 08c903c..4c970ee 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 _0xbad2=['sendStatus','end','json','limit','count','offset','status','set','Content-Range','apply','reject','then','destroy','error','stack','name','map','ServicenowField','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','rawAttributes','options','create','body','catch','update','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xbad2,0x19e));var _0x2bad=function(_0x3a7f98,_0x1eec2a){_0x3a7f98=_0x3a7f98-0x0;var _0x34d3a2=_0xbad2[_0x3a7f98];return _0x34d3a2;};'use strict';var emlformat=require(_0x2bad('0x0'));var rimraf=require(_0x2bad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2bad('0x2'));var rp=require('request-promise');var moment=require(_0x2bad('0x3'));var BPromise=require(_0x2bad('0x4'));var Mustache=require(_0x2bad('0x5'));var util=require('util');var path=require(_0x2bad('0x6'));var sox=require(_0x2bad('0x7'));var csv=require(_0x2bad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bad('0x9'));var _=require(_0x2bad('0xa'));var squel=require(_0x2bad('0xb'));var crypto=require('crypto');var jsforce=require(_0x2bad('0xc'));var deskjs=require(_0x2bad('0xd'));var toCsv=require(_0x2bad('0x8'));var querystring=require('querystring');var Papa=require(_0x2bad('0xe'));var Redis=require(_0x2bad('0xf'));var authService=require(_0x2bad('0x10'));var qs=require(_0x2bad('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bad('0x12'));var logger=require('../../config/logger')(_0x2bad('0x13'));var utils=require(_0x2bad('0x14'));var config=require(_0x2bad('0x15'));var licenseUtil=require(_0x2bad('0x16'));var db=require(_0x2bad('0x17'))['db'];function respondWithStatusCode(_0x2af310,_0x32b9e3){_0x32b9e3=_0x32b9e3||0xcc;return function(_0x287bfe){if(_0x287bfe){return _0x2af310[_0x2bad('0x18')](_0x32b9e3);}return _0x2af310['status'](_0x32b9e3)[_0x2bad('0x19')]();};}function respondWithResult(_0x3cb645,_0x425d28){_0x425d28=_0x425d28||0xc8;return function(_0x579811){if(_0x579811){return _0x3cb645['status'](_0x425d28)[_0x2bad('0x1a')](_0x579811);}};}function respondWithFilteredResult(_0x220047,_0x12d04b){return function(_0x505d22){if(_0x505d22){var _0x2af4d1=typeof _0x12d04b['offset']==='undefined'&&typeof _0x12d04b[_0x2bad('0x1b')]==='undefined';var _0x20d0d1=_0x505d22[_0x2bad('0x1c')];var _0xf82190=_0x2af4d1?0x0:_0x12d04b[_0x2bad('0x1d')];var _0x3b8d9d=_0x2af4d1?_0x505d22[_0x2bad('0x1c')]:_0x12d04b[_0x2bad('0x1d')]+_0x12d04b[_0x2bad('0x1b')];var _0x479893;if(_0x3b8d9d>=_0x20d0d1){_0x3b8d9d=_0x20d0d1;_0x479893=0xc8;}else{_0x479893=0xce;}_0x220047[_0x2bad('0x1e')](_0x479893);return _0x220047[_0x2bad('0x1f')](_0x2bad('0x20'),_0xf82190+'-'+_0x3b8d9d+'/'+_0x20d0d1)[_0x2bad('0x1a')](_0x505d22);}return null;};}function patchUpdates(_0x347239){return function(_0x1625a9){try{jsonpatch[_0x2bad('0x21')](_0x1625a9,_0x347239,!![]);}catch(_0x3358f0){return BPromise[_0x2bad('0x22')](_0x3358f0);}return _0x1625a9['save']();};}function saveUpdates(_0x45b153,_0x54a2cf){return function(_0xa89c98){if(_0xa89c98){return _0xa89c98['update'](_0x45b153)[_0x2bad('0x23')](function(_0x3a396c){return _0x3a396c;});}return null;};}function removeEntity(_0x1695c0,_0x57b682){return function(_0x2684b4){if(_0x2684b4){return _0x2684b4[_0x2bad('0x24')]()[_0x2bad('0x23')](function(){_0x1695c0[_0x2bad('0x1e')](0xcc)[_0x2bad('0x19')]();});}};}function handleEntityNotFound(_0x39408e,_0x378299){return function(_0x91d38c){if(!_0x91d38c){_0x39408e['sendStatus'](0x194);}return _0x91d38c;};}function handleError(_0x26b2b2,_0x54959f){_0x54959f=_0x54959f||0x1f4;return function(_0x123cb4){logger[_0x2bad('0x25')](_0x123cb4[_0x2bad('0x26')]);if(_0x123cb4['name']){delete _0x123cb4[_0x2bad('0x27')];}_0x26b2b2['status'](_0x54959f)['send'](_0x123cb4);};}exports['index']=function(_0x96f263,_0x4cae57){var _0x2c19c3={},_0x10e872={},_0x146a91={'count':0x0,'rows':[]};var _0x261414=_[_0x2bad('0x28')](db[_0x2bad('0x29')]['rawAttributes'],function(_0x46cdce){return{'name':_0x46cdce[_0x2bad('0x2a')],'type':_0x46cdce['type'][_0x2bad('0x2b')]};});_0x10e872['model']=_[_0x2bad('0x28')](_0x261414,_0x2bad('0x27'));_0x10e872[_0x2bad('0x2c')]=_[_0x2bad('0x2d')](_0x96f263[_0x2bad('0x2c')]);_0x10e872[_0x2bad('0x2e')]=_[_0x2bad('0x2f')](_0x10e872[_0x2bad('0x30')],_0x10e872[_0x2bad('0x2c')]);_0x2c19c3[_0x2bad('0x31')]=_[_0x2bad('0x2f')](_0x10e872[_0x2bad('0x30')],qs[_0x2bad('0x32')](_0x96f263[_0x2bad('0x2c')][_0x2bad('0x32')]));_0x2c19c3['attributes']=_0x2c19c3[_0x2bad('0x31')][_0x2bad('0x33')]?_0x2c19c3['attributes']:_0x10e872['model'];if(!_0x96f263[_0x2bad('0x2c')][_0x2bad('0x34')]('nolimit')){_0x2c19c3['limit']=qs[_0x2bad('0x1b')](_0x96f263[_0x2bad('0x2c')][_0x2bad('0x1b')]);_0x2c19c3['offset']=qs['offset'](_0x96f263[_0x2bad('0x2c')]['offset']);}_0x2c19c3[_0x2bad('0x35')]=qs['sort'](_0x96f263[_0x2bad('0x2c')][_0x2bad('0x36')]);_0x2c19c3[_0x2bad('0x37')]=qs['filters'](_[_0x2bad('0x38')](_0x96f263['query'],_0x10e872[_0x2bad('0x2e')]),_0x261414);if(_0x96f263[_0x2bad('0x2c')][_0x2bad('0x39')]){_0x2c19c3[_0x2bad('0x37')]=_[_0x2bad('0x3a')](_0x2c19c3['where'],{'$or':_[_0x2bad('0x28')](_0x261414,function(_0x46c250){if(_0x46c250[_0x2bad('0x3b')]!=='VIRTUAL'){var _0x4343ca={};_0x4343ca[_0x46c250[_0x2bad('0x27')]]={'$like':'%'+_0x96f263[_0x2bad('0x2c')][_0x2bad('0x39')]+'%'};return _0x4343ca;}})});}_0x2c19c3=_[_0x2bad('0x3a')]({},_0x2c19c3,_0x96f263['options']);var _0x7e881e={'where':_0x2c19c3[_0x2bad('0x37')]};return db['ServicenowField'][_0x2bad('0x1c')](_0x7e881e)[_0x2bad('0x23')](function(_0x2cf122){_0x146a91['count']=_0x2cf122;if(_0x96f263[_0x2bad('0x2c')][_0x2bad('0x3c')]){_0x2c19c3[_0x2bad('0x3d')]=[{'all':!![]}];}return db[_0x2bad('0x29')][_0x2bad('0x3e')](_0x2c19c3);})[_0x2bad('0x23')](function(_0x39640d){_0x146a91[_0x2bad('0x3f')]=_0x39640d;return _0x146a91;})['then'](respondWithFilteredResult(_0x4cae57,_0x2c19c3))['catch'](handleError(_0x4cae57,null));};exports[_0x2bad('0x40')]=function(_0x2fe31c,_0x3020fd){var _0x5c48fb={'raw':!![],'where':{'id':_0x2fe31c[_0x2bad('0x41')]['id']}},_0x11beae={};_0x11beae['model']=_[_0x2bad('0x2d')](db['ServicenowField'][_0x2bad('0x42')]);_0x11beae['query']=_[_0x2bad('0x2d')](_0x2fe31c[_0x2bad('0x2c')]);_0x11beae[_0x2bad('0x2e')]=_[_0x2bad('0x2f')](_0x11beae[_0x2bad('0x30')],_0x11beae['query']);_0x5c48fb[_0x2bad('0x31')]=_[_0x2bad('0x2f')](_0x11beae[_0x2bad('0x30')],qs[_0x2bad('0x32')](_0x2fe31c[_0x2bad('0x2c')]['fields']));_0x5c48fb['attributes']=_0x5c48fb[_0x2bad('0x31')][_0x2bad('0x33')]?_0x5c48fb[_0x2bad('0x31')]:_0x11beae[_0x2bad('0x30')];if(_0x2fe31c[_0x2bad('0x2c')]['includeAll']){_0x5c48fb[_0x2bad('0x3d')]=[{'all':!![]}];}_0x5c48fb=_[_0x2bad('0x3a')]({},_0x5c48fb,_0x2fe31c[_0x2bad('0x43')]);return db[_0x2bad('0x29')]['find'](_0x5c48fb)[_0x2bad('0x23')](handleEntityNotFound(_0x3020fd,null))[_0x2bad('0x23')](respondWithResult(_0x3020fd,null))['catch'](handleError(_0x3020fd,null));};exports[_0x2bad('0x44')]=function(_0x393b68,_0x3e71fb){return db['ServicenowField']['create'](_0x393b68[_0x2bad('0x45')],{})[_0x2bad('0x23')](respondWithResult(_0x3e71fb,0xc9))[_0x2bad('0x46')](handleError(_0x3e71fb,null));};exports[_0x2bad('0x47')]=function(_0x50533c,_0x148c81){if(_0x50533c[_0x2bad('0x45')]['id']){delete _0x50533c['body']['id'];}return db[_0x2bad('0x29')][_0x2bad('0x48')]({'where':{'id':_0x50533c[_0x2bad('0x41')]['id']}})[_0x2bad('0x23')](handleEntityNotFound(_0x148c81,null))[_0x2bad('0x23')](saveUpdates(_0x50533c[_0x2bad('0x45')],null))[_0x2bad('0x23')](respondWithResult(_0x148c81,null))['catch'](handleError(_0x148c81,null));};exports['destroy']=function(_0x4f9315,_0x3cb0c4){return db[_0x2bad('0x29')]['find']({'where':{'id':_0x4f9315['params']['id']}})[_0x2bad('0x23')](handleEntityNotFound(_0x3cb0c4,null))['then'](removeEntity(_0x3cb0c4,null))[_0x2bad('0x46')](handleError(_0x3cb0c4,null));}; \ No newline at end of file +var _0x18a3=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ServicenowField','findAll','catch','keys','rawAttributes','includeAll','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0x18a3,0x7c));var _0x318a=function(_0x5a8783,_0x5e2e45){_0x5a8783=_0x5a8783-0x0;var _0x325b9e=_0x18a3[_0x5a8783];return _0x325b9e;};'use strict';var emlformat=require(_0x318a('0x0'));var rimraf=require(_0x318a('0x1'));var zipdir=require(_0x318a('0x2'));var jsonpatch=require(_0x318a('0x3'));var rp=require(_0x318a('0x4'));var moment=require(_0x318a('0x5'));var BPromise=require(_0x318a('0x6'));var Mustache=require(_0x318a('0x7'));var util=require(_0x318a('0x8'));var path=require(_0x318a('0x9'));var sox=require('sox');var csv=require(_0x318a('0xa'));var ejs=require(_0x318a('0xb'));var fs=require('fs');var fs_extra=require(_0x318a('0xc'));var _=require(_0x318a('0xd'));var squel=require(_0x318a('0xe'));var crypto=require(_0x318a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x318a('0x10'));var toCsv=require(_0x318a('0xa'));var querystring=require(_0x318a('0x11'));var Papa=require('papaparse');var Redis=require(_0x318a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x318a('0x13'));var as=require(_0x318a('0x14'));var hardwareService=require(_0x318a('0x15'));var logger=require(_0x318a('0x16'))(_0x318a('0x17'));var utils=require(_0x318a('0x18'));var config=require(_0x318a('0x19'));var licenseUtil=require(_0x318a('0x1a'));var db=require(_0x318a('0x1b'))['db'];function respondWithStatusCode(_0x469ae2,_0x184bc0){_0x184bc0=_0x184bc0||0xcc;return function(_0xfbcc18){if(_0xfbcc18){return _0x469ae2[_0x318a('0x1c')](_0x184bc0);}return _0x469ae2[_0x318a('0x1d')](_0x184bc0)[_0x318a('0x1e')]();};}function respondWithResult(_0x1375e5,_0x58bdf1){_0x58bdf1=_0x58bdf1||0xc8;return function(_0x4cc52b){if(_0x4cc52b){return _0x1375e5[_0x318a('0x1d')](_0x58bdf1)[_0x318a('0x1f')](_0x4cc52b);}};}function respondWithFilteredResult(_0x326b16,_0x238240){return function(_0x5d862e){if(_0x5d862e){var _0x3be363=typeof _0x238240[_0x318a('0x20')]==='undefined'&&typeof _0x238240[_0x318a('0x21')]===_0x318a('0x22');var _0x45f5eb=_0x5d862e[_0x318a('0x23')];var _0x15c963=_0x3be363?0x0:_0x238240[_0x318a('0x20')];var _0x51e840=_0x3be363?_0x5d862e[_0x318a('0x23')]:_0x238240['offset']+_0x238240[_0x318a('0x21')];var _0x1e2acc;if(_0x51e840>=_0x45f5eb){_0x51e840=_0x45f5eb;_0x1e2acc=0xc8;}else{_0x1e2acc=0xce;}_0x326b16[_0x318a('0x1d')](_0x1e2acc);return _0x326b16[_0x318a('0x24')](_0x318a('0x25'),_0x15c963+'-'+_0x51e840+'/'+_0x45f5eb)[_0x318a('0x1f')](_0x5d862e);}return null;};}function patchUpdates(_0x5d9bf3){return function(_0x5e6138){try{jsonpatch[_0x318a('0x26')](_0x5e6138,_0x5d9bf3,!![]);}catch(_0x4665ef){return BPromise[_0x318a('0x27')](_0x4665ef);}return _0x5e6138[_0x318a('0x28')]();};}function saveUpdates(_0x492d4d,_0x2f92f5){return function(_0x149760){if(_0x149760){return _0x149760[_0x318a('0x29')](_0x492d4d)[_0x318a('0x2a')](function(_0x14f582){return _0x14f582;});}return null;};}function removeEntity(_0xce2f32,_0xd30bc7){return function(_0xd50ef5){if(_0xd50ef5){return _0xd50ef5[_0x318a('0x2b')]()[_0x318a('0x2a')](function(){_0xce2f32[_0x318a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcdee54,_0x1711b3){return function(_0x179815){if(!_0x179815){_0xcdee54[_0x318a('0x1c')](0x194);}return _0x179815;};}function handleError(_0x3629ae,_0x2cdd67){_0x2cdd67=_0x2cdd67||0x1f4;return function(_0x494a70){logger[_0x318a('0x2c')](_0x494a70[_0x318a('0x2d')]);if(_0x494a70[_0x318a('0x2e')]){delete _0x494a70[_0x318a('0x2e')];}_0x3629ae[_0x318a('0x1d')](_0x2cdd67)[_0x318a('0x2f')](_0x494a70);};}exports[_0x318a('0x30')]=function(_0x160a13,_0x44c6c7){var _0x13c372={},_0x4283cd={},_0x4958f2={'count':0x0,'rows':[]};var _0x2866ac=_[_0x318a('0x31')](db['ServicenowField']['rawAttributes'],function(_0x2f6a86){return{'name':_0x2f6a86[_0x318a('0x32')],'type':_0x2f6a86[_0x318a('0x33')]['key']};});_0x4283cd['model']=_[_0x318a('0x31')](_0x2866ac,_0x318a('0x2e'));_0x4283cd[_0x318a('0x34')]=_['keys'](_0x160a13[_0x318a('0x34')]);_0x4283cd[_0x318a('0x35')]=_[_0x318a('0x36')](_0x4283cd[_0x318a('0x37')],_0x4283cd[_0x318a('0x34')]);_0x13c372[_0x318a('0x38')]=_['intersection'](_0x4283cd[_0x318a('0x37')],qs[_0x318a('0x39')](_0x160a13[_0x318a('0x34')][_0x318a('0x39')]));_0x13c372[_0x318a('0x38')]=_0x13c372[_0x318a('0x38')][_0x318a('0x3a')]?_0x13c372[_0x318a('0x38')]:_0x4283cd[_0x318a('0x37')];if(!_0x160a13['query'][_0x318a('0x3b')](_0x318a('0x3c'))){_0x13c372[_0x318a('0x21')]=qs[_0x318a('0x21')](_0x160a13[_0x318a('0x34')][_0x318a('0x21')]);_0x13c372['offset']=qs['offset'](_0x160a13['query'][_0x318a('0x20')]);}_0x13c372[_0x318a('0x3d')]=qs[_0x318a('0x3e')](_0x160a13[_0x318a('0x34')][_0x318a('0x3e')]);_0x13c372['where']=qs[_0x318a('0x35')](_[_0x318a('0x3f')](_0x160a13[_0x318a('0x34')],_0x4283cd[_0x318a('0x35')]),_0x2866ac);if(_0x160a13[_0x318a('0x34')][_0x318a('0x40')]){_0x13c372[_0x318a('0x41')]=_[_0x318a('0x42')](_0x13c372['where'],{'$or':_[_0x318a('0x31')](_0x2866ac,function(_0x22b42c){if(_0x22b42c['type']!==_0x318a('0x43')){var _0x168f6b={};_0x168f6b[_0x22b42c[_0x318a('0x2e')]]={'$like':'%'+_0x160a13['query']['filter']+'%'};return _0x168f6b;}})});}_0x13c372=_[_0x318a('0x42')]({},_0x13c372,_0x160a13['options']);var _0x21011a={'where':_0x13c372[_0x318a('0x41')]};return db[_0x318a('0x44')][_0x318a('0x23')](_0x21011a)[_0x318a('0x2a')](function(_0x39f70d){_0x4958f2[_0x318a('0x23')]=_0x39f70d;if(_0x160a13[_0x318a('0x34')]['includeAll']){_0x13c372['include']=[{'all':!![]}];}return db[_0x318a('0x44')][_0x318a('0x45')](_0x13c372);})['then'](function(_0x2b8416){_0x4958f2['rows']=_0x2b8416;return _0x4958f2;})['then'](respondWithFilteredResult(_0x44c6c7,_0x13c372))[_0x318a('0x46')](handleError(_0x44c6c7,null));};exports['show']=function(_0x58b7bc,_0x4f4077){var _0x5e621e={'raw':!![],'where':{'id':_0x58b7bc['params']['id']}},_0x9f0327={};_0x9f0327[_0x318a('0x37')]=_[_0x318a('0x47')](db[_0x318a('0x44')][_0x318a('0x48')]);_0x9f0327[_0x318a('0x34')]=_[_0x318a('0x47')](_0x58b7bc['query']);_0x9f0327[_0x318a('0x35')]=_[_0x318a('0x36')](_0x9f0327[_0x318a('0x37')],_0x9f0327[_0x318a('0x34')]);_0x5e621e[_0x318a('0x38')]=_['intersection'](_0x9f0327[_0x318a('0x37')],qs[_0x318a('0x39')](_0x58b7bc['query'][_0x318a('0x39')]));_0x5e621e[_0x318a('0x38')]=_0x5e621e[_0x318a('0x38')][_0x318a('0x3a')]?_0x5e621e[_0x318a('0x38')]:_0x9f0327[_0x318a('0x37')];if(_0x58b7bc[_0x318a('0x34')][_0x318a('0x49')]){_0x5e621e[_0x318a('0x4a')]=[{'all':!![]}];}_0x5e621e=_['merge']({},_0x5e621e,_0x58b7bc[_0x318a('0x4b')]);return db[_0x318a('0x44')][_0x318a('0x4c')](_0x5e621e)[_0x318a('0x2a')](handleEntityNotFound(_0x4f4077,null))[_0x318a('0x2a')](respondWithResult(_0x4f4077,null))['catch'](handleError(_0x4f4077,null));};exports[_0x318a('0x4d')]=function(_0x2a5808,_0x548e11){return db['ServicenowField'][_0x318a('0x4d')](_0x2a5808[_0x318a('0x4e')],{})[_0x318a('0x2a')](respondWithResult(_0x548e11,0xc9))[_0x318a('0x46')](handleError(_0x548e11,null));};exports['update']=function(_0x209cac,_0x5e8b1c){if(_0x209cac['body']['id']){delete _0x209cac['body']['id'];}return db[_0x318a('0x44')][_0x318a('0x4c')]({'where':{'id':_0x209cac[_0x318a('0x4f')]['id']}})[_0x318a('0x2a')](handleEntityNotFound(_0x5e8b1c,null))[_0x318a('0x2a')](saveUpdates(_0x209cac['body'],null))[_0x318a('0x2a')](respondWithResult(_0x5e8b1c,null))[_0x318a('0x46')](handleError(_0x5e8b1c,null));};exports[_0x318a('0x2b')]=function(_0x13fe45,_0x370edb){return db[_0x318a('0x44')][_0x318a('0x4c')]({'where':{'id':_0x13fe45[_0x318a('0x4f')]['id']}})[_0x318a('0x2a')](handleEntityNotFound(_0x370edb,null))[_0x318a('0x2a')](removeEntity(_0x370edb,null))[_0x318a('0x46')](handleError(_0x370edb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 83ad913..5ff30d2 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 _0xb583=['ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define'];(function(_0x3198f0,_0x482730){var _0x41efd9=function(_0x5acd6b){while(--_0x5acd6b){_0x3198f0['push'](_0x3198f0['shift']());}};_0x41efd9(++_0x482730);}(_0xb583,0xc8));var _0x3b58=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb583[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3b58('0x0'));var util=require(_0x3b58('0x1'));var logger=require('../../config/logger')(_0x3b58('0x2'));var moment=require(_0x3b58('0x3'));var BPromise=require(_0x3b58('0x4'));var rp=require(_0x3b58('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b58('0x6'));var config=require(_0x3b58('0x7'));var attributes=require(_0x3b58('0x8'));module['exports']=function(_0x314825,_0x198b78){return _0x314825[_0x3b58('0x9')](_0x3b58('0xa'),attributes,{'tableName':_0x3b58('0xb'),'paranoid':![],'indexes':[{'name':_0x3b58('0xc'),'fields':['idField',_0x3b58('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca94=['util','../../config/logger','api','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x2ecc92,_0x534ff3){var _0x457be8=function(_0x47e331){while(--_0x47e331){_0x2ecc92['push'](_0x2ecc92['shift']());}};_0x457be8(++_0x534ff3);}(_0xca94,0x1df));var _0x4ca9=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0xca94[_0x456032];return _0x1a53cd;};'use strict';var _=require(_0x4ca9('0x0'));var util=require(_0x4ca9('0x1'));var logger=require(_0x4ca9('0x2'))(_0x4ca9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4ca9('0x4'));var fs=require('fs');var path=require(_0x4ca9('0x5'));var rimraf=require(_0x4ca9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4ca9('0x7'));module[_0x4ca9('0x8')]=function(_0x474420,_0x367dc6){return _0x474420[_0x4ca9('0x9')](_0x4ca9('0xa'),attributes,{'tableName':_0x4ca9('0xb'),'paranoid':![],'indexes':[{'name':_0x4ca9('0xc'),'fields':[_0x4ca9('0xd'),_0x4ca9('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 160726d..7b419b6 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x565f9b,_0x3697c0){var _0x1a27f9=function(_0x1ba5de){while(--_0x1ba5de){_0x565f9b['push'](_0x565f9b['shift']());}};_0x1a27f9(++_0x3697c0);}(_0xaa88,0x137));var _0x8aa8=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0xaa88[_0x4d0df6];return _0x4e2615;};'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')]('ServicenowField,\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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x45a24b,_0x27c1c6){var _0x4211e6=function(_0xe4b770){while(--_0xe4b770){_0x45a24b['push'](_0x45a24b['shift']());}};_0x4211e6(++_0x27c1c6);}(_0xb43b,0x1b2));var _0xbb43=function(_0x336a9e,_0x434f1){_0x336a9e=_0x336a9e-0x0;var _0x1c9ae5=_0xb43b[_0x336a9e];return _0x1c9ae5;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 79810da..3b72c75 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x335f7c,_0x522e7d){var _0x220308=function(_0x34488f){while(--_0x34488f){_0x335f7c['push'](_0x335f7c['shift']());}};_0x220308(++_0x522e7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _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(_0x27e1d2,_0x51af6c){var _0x57ed5b=function(_0x20fe12){while(--_0x20fe12){_0x27e1d2['push'](_0x27e1d2['shift']());}};_0x57ed5b(++_0x51af6c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index b5c4777..1b83a87 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(_0x11046a,_0x3a8881){var _0x19ac15=function(_0x176ec2){while(--_0x176ec2){_0x11046a['push'](_0x11046a['shift']());}};_0x19ac15(++_0x3a8881);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x5480fb,_0x2ee221){var _0x331dae=function(_0x53cbb8){while(--_0x53cbb8){_0x5480fb['push'](_0x5480fb['shift']());}};_0x331dae(++_0x2ee221);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 bbf9e00..a93934c 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 _0x59e5=['params','getConfigurations','findOne','SugarcrmConfiguration','pick','filter','addConfiguration','Subjects','getSubjects','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','get_module_fields','Calls','module_fields','remove','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','findAll','catch','include','find','create','body'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x59e5,0x11b));var _0x559e=function(_0x3bde52,_0x146cff){_0x3bde52=_0x3bde52-0x0;var _0x3dd57a=_0x59e5[_0x3bde52];return _0x3dd57a;};'use strict';var emlformat=require(_0x559e('0x0'));var rimraf=require(_0x559e('0x1'));var zipdir=require(_0x559e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x559e('0x3'));var moment=require(_0x559e('0x4'));var BPromise=require(_0x559e('0x5'));var Mustache=require(_0x559e('0x6'));var util=require('util');var path=require(_0x559e('0x7'));var sox=require(_0x559e('0x8'));var csv=require(_0x559e('0x9'));var ejs=require(_0x559e('0xa'));var fs=require('fs');var fs_extra=require(_0x559e('0xb'));var _=require(_0x559e('0xc'));var squel=require(_0x559e('0xd'));var crypto=require(_0x559e('0xe'));var jsforce=require(_0x559e('0xf'));var deskjs=require(_0x559e('0x10'));var toCsv=require(_0x559e('0x9'));var querystring=require(_0x559e('0x11'));var Papa=require(_0x559e('0x12'));var Redis=require(_0x559e('0x13'));var authService=require(_0x559e('0x14'));var qs=require(_0x559e('0x15'));var as=require(_0x559e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x559e('0x17'))(_0x559e('0x18'));var utils=require(_0x559e('0x19'));var config=require(_0x559e('0x1a'));var licenseUtil=require(_0x559e('0x1b'));var db=require(_0x559e('0x1c'))['db'];var integrations=require(_0x559e('0x1d'));function respondWithStatusCode(_0x1b5924,_0xcd1c63){_0xcd1c63=_0xcd1c63||0xcc;return function(_0x5af8a4){if(_0x5af8a4){return _0x1b5924[_0x559e('0x1e')](_0xcd1c63);}return _0x1b5924[_0x559e('0x1f')](_0xcd1c63)[_0x559e('0x20')]();};}function respondWithResult(_0x20a6e8,_0x91d1a8){_0x91d1a8=_0x91d1a8||0xc8;return function(_0x6925cc){if(_0x6925cc){return _0x20a6e8['status'](_0x91d1a8)[_0x559e('0x21')](_0x6925cc);}};}function respondWithFilteredResult(_0x4eca77,_0x52f347){return function(_0x1c65e7){if(_0x1c65e7){var _0x1c6059=typeof _0x52f347['offset']===_0x559e('0x22')&&typeof _0x52f347['limit']===_0x559e('0x22');var _0x134b55=_0x1c65e7[_0x559e('0x23')];var _0x2c1111=_0x1c6059?0x0:_0x52f347['offset'];var _0x4ccda6=_0x1c6059?_0x1c65e7[_0x559e('0x23')]:_0x52f347[_0x559e('0x24')]+_0x52f347[_0x559e('0x25')];var _0x4b8019;if(_0x4ccda6>=_0x134b55){_0x4ccda6=_0x134b55;_0x4b8019=0xc8;}else{_0x4b8019=0xce;}_0x4eca77[_0x559e('0x1f')](_0x4b8019);return _0x4eca77[_0x559e('0x26')](_0x559e('0x27'),_0x2c1111+'-'+_0x4ccda6+'/'+_0x134b55)[_0x559e('0x21')](_0x1c65e7);}return null;};}function patchUpdates(_0x50cb88){return function(_0x3cfcab){try{jsonpatch['apply'](_0x3cfcab,_0x50cb88,!![]);}catch(_0x2503b2){return BPromise[_0x559e('0x28')](_0x2503b2);}return _0x3cfcab[_0x559e('0x29')]();};}function saveUpdates(_0x4365c5,_0x1d52d8){return function(_0x1816ce){if(_0x1816ce){return _0x1816ce[_0x559e('0x2a')](_0x4365c5)[_0x559e('0x2b')](function(_0x16113d){return _0x16113d;});}return null;};}function removeEntity(_0x1068bd,_0x3ae0dd){return function(_0xcafedd){if(_0xcafedd){return _0xcafedd[_0x559e('0x2c')]()[_0x559e('0x2b')](function(){_0x1068bd[_0x559e('0x1f')](0xcc)[_0x559e('0x20')]();});}};}function handleEntityNotFound(_0xfdd6da,_0x53f375){return function(_0x5a5f54){if(!_0x5a5f54){_0xfdd6da['sendStatus'](0x194);}return _0x5a5f54;};}function handleError(_0x1378ab,_0x477d3b){_0x477d3b=_0x477d3b||0x1f4;return function(_0x5191ca){logger[_0x559e('0x2d')](_0x5191ca[_0x559e('0x2e')]);if(_0x5191ca[_0x559e('0x2f')]){delete _0x5191ca['name'];}_0x1378ab['status'](_0x477d3b)[_0x559e('0x30')](_0x5191ca);};}exports[_0x559e('0x31')]=function(_0x4ad7b7,_0x192d9a){var _0x305a7f={},_0x5b93d8={},_0x233daa={'count':0x0,'rows':[]};var _0x1c6e63=_[_0x559e('0x32')](db[_0x559e('0x33')][_0x559e('0x34')],function(_0x3a03af){return{'name':_0x3a03af[_0x559e('0x35')],'type':_0x3a03af[_0x559e('0x36')]['key']};});_0x5b93d8[_0x559e('0x37')]=_[_0x559e('0x32')](_0x1c6e63,_0x559e('0x2f'));_0x5b93d8[_0x559e('0x38')]=_[_0x559e('0x39')](_0x4ad7b7[_0x559e('0x38')]);_0x5b93d8[_0x559e('0x3a')]=_[_0x559e('0x3b')](_0x5b93d8[_0x559e('0x37')],_0x5b93d8['query']);_0x305a7f[_0x559e('0x3c')]=_[_0x559e('0x3b')](_0x5b93d8[_0x559e('0x37')],qs[_0x559e('0x3d')](_0x4ad7b7['query'][_0x559e('0x3d')]));_0x305a7f[_0x559e('0x3c')]=_0x305a7f['attributes'][_0x559e('0x3e')]?_0x305a7f[_0x559e('0x3c')]:_0x5b93d8[_0x559e('0x37')];if(!_0x4ad7b7[_0x559e('0x38')][_0x559e('0x3f')](_0x559e('0x40'))){_0x305a7f[_0x559e('0x25')]=qs['limit'](_0x4ad7b7[_0x559e('0x38')]['limit']);_0x305a7f[_0x559e('0x24')]=qs[_0x559e('0x24')](_0x4ad7b7[_0x559e('0x38')][_0x559e('0x24')]);}_0x305a7f[_0x559e('0x41')]=qs[_0x559e('0x42')](_0x4ad7b7[_0x559e('0x38')][_0x559e('0x42')]);_0x305a7f[_0x559e('0x43')]=qs[_0x559e('0x3a')](_['pick'](_0x4ad7b7['query'],_0x5b93d8[_0x559e('0x3a')]),_0x1c6e63);if(_0x4ad7b7[_0x559e('0x38')]['filter']){_0x305a7f[_0x559e('0x43')]=_[_0x559e('0x44')](_0x305a7f[_0x559e('0x43')],{'$or':_['map'](_0x1c6e63,function(_0x2cb03f){if(_0x2cb03f[_0x559e('0x36')]!==_0x559e('0x45')){var _0x15f787={};_0x15f787[_0x2cb03f[_0x559e('0x2f')]]={'$like':'%'+_0x4ad7b7['query']['filter']+'%'};return _0x15f787;}})});}_0x305a7f=_['merge']({},_0x305a7f,_0x4ad7b7[_0x559e('0x46')]);var _0x2c0a45={'where':_0x305a7f[_0x559e('0x43')]};return db[_0x559e('0x33')][_0x559e('0x23')](_0x2c0a45)[_0x559e('0x2b')](function(_0x181748){_0x233daa[_0x559e('0x23')]=_0x181748;if(_0x4ad7b7[_0x559e('0x38')]['includeAll']){_0x305a7f['include']=[{'all':!![]}];}return db[_0x559e('0x33')][_0x559e('0x47')](_0x305a7f);})[_0x559e('0x2b')](function(_0x58068b){_0x233daa['rows']=_0x58068b;return _0x233daa;})[_0x559e('0x2b')](respondWithFilteredResult(_0x192d9a,_0x305a7f))[_0x559e('0x48')](handleError(_0x192d9a,null));};exports['show']=function(_0xb1ec83,_0x558e2c){var _0x2ef25f={'raw':![],'where':{'id':_0xb1ec83['params']['id']}},_0x4d69e6={};_0x4d69e6[_0x559e('0x37')]=_['keys'](db[_0x559e('0x33')][_0x559e('0x34')]);_0x4d69e6[_0x559e('0x38')]=_[_0x559e('0x39')](_0xb1ec83[_0x559e('0x38')]);_0x4d69e6[_0x559e('0x3a')]=_[_0x559e('0x3b')](_0x4d69e6[_0x559e('0x37')],_0x4d69e6[_0x559e('0x38')]);_0x2ef25f[_0x559e('0x3c')]=_['intersection'](_0x4d69e6[_0x559e('0x37')],qs['fields'](_0xb1ec83[_0x559e('0x38')][_0x559e('0x3d')]));_0x2ef25f[_0x559e('0x3c')]=_0x2ef25f[_0x559e('0x3c')]['length']?_0x2ef25f[_0x559e('0x3c')]:_0x4d69e6[_0x559e('0x37')];if(_0xb1ec83['query']['includeAll']){_0x2ef25f[_0x559e('0x49')]=[{'all':!![]}];}_0x2ef25f=_[_0x559e('0x44')]({},_0x2ef25f,_0xb1ec83[_0x559e('0x46')]);return db[_0x559e('0x33')][_0x559e('0x4a')](_0x2ef25f)[_0x559e('0x2b')](handleEntityNotFound(_0x558e2c,null))[_0x559e('0x2b')](respondWithResult(_0x558e2c,null))[_0x559e('0x48')](handleError(_0x558e2c,null));};exports[_0x559e('0x4b')]=function(_0x330e8d,_0x4c2c1b){return db['SugarcrmAccount'][_0x559e('0x4b')](_0x330e8d[_0x559e('0x4c')],{})[_0x559e('0x2b')](respondWithResult(_0x4c2c1b,0xc9))['catch'](handleError(_0x4c2c1b,null));};exports['update']=function(_0x1ca424,_0x4ba8a3){if(_0x1ca424['body']['id']){delete _0x1ca424[_0x559e('0x4c')]['id'];}return db[_0x559e('0x33')][_0x559e('0x4a')]({'where':{'id':_0x1ca424[_0x559e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ba8a3,null))[_0x559e('0x2b')](saveUpdates(_0x1ca424[_0x559e('0x4c')],null))[_0x559e('0x2b')](respondWithResult(_0x4ba8a3,null))[_0x559e('0x48')](handleError(_0x4ba8a3,null));};exports[_0x559e('0x2c')]=function(_0x303e6a,_0xf5c0ca){return db[_0x559e('0x33')][_0x559e('0x4a')]({'where':{'id':_0x303e6a['params']['id']}})[_0x559e('0x2b')](handleEntityNotFound(_0xf5c0ca,null))[_0x559e('0x2b')](removeEntity(_0xf5c0ca,null))[_0x559e('0x48')](handleError(_0xf5c0ca,null));};exports[_0x559e('0x4e')]=function(_0x406312,_0x3277d4,_0x533b16){var _0x30243a={};var _0x140464={};var _0x5b8768;var _0x329b0f;return db[_0x559e('0x33')][_0x559e('0x4f')]({'where':{'id':_0x406312[_0x559e('0x4d')]['id']}})[_0x559e('0x2b')](handleEntityNotFound(_0x3277d4,null))['then'](function(_0x3ce641){if(_0x3ce641){_0x5b8768=_0x3ce641;_0x140464[_0x559e('0x37')]=_[_0x559e('0x39')](db[_0x559e('0x50')][_0x559e('0x34')]);_0x140464[_0x559e('0x38')]=_['keys'](_0x406312[_0x559e('0x38')]);_0x140464[_0x559e('0x3a')]=_[_0x559e('0x3b')](_0x140464[_0x559e('0x37')],_0x140464['query']);_0x30243a[_0x559e('0x3c')]=_[_0x559e('0x3b')](_0x140464[_0x559e('0x37')],qs[_0x559e('0x3d')](_0x406312[_0x559e('0x38')]['fields']));_0x30243a[_0x559e('0x3c')]=_0x30243a[_0x559e('0x3c')][_0x559e('0x3e')]?_0x30243a[_0x559e('0x3c')]:_0x140464[_0x559e('0x37')];_0x30243a['order']=qs[_0x559e('0x42')](_0x406312[_0x559e('0x38')][_0x559e('0x42')]);_0x30243a[_0x559e('0x43')]=qs[_0x559e('0x3a')](_[_0x559e('0x51')](_0x406312[_0x559e('0x38')],_0x140464['filters']));if(_0x406312['query'][_0x559e('0x52')]){_0x30243a[_0x559e('0x43')]=_['merge'](_0x30243a[_0x559e('0x43')],{'$or':_[_0x559e('0x32')](_0x30243a[_0x559e('0x3c')],function(_0x4646d){var _0x3714de={};_0x3714de[_0x4646d]={'$like':'%'+_0x406312[_0x559e('0x38')][_0x559e('0x52')]+'%'};return _0x3714de;})});}_0x30243a=_['merge']({},_0x30243a,_0x406312[_0x559e('0x46')]);return _0x5b8768['getConfigurations'](_0x30243a);}})[_0x559e('0x2b')](function(_0x59a6f9){if(_0x59a6f9){_0x329b0f=_0x59a6f9[_0x559e('0x3e')];if(!_0x406312[_0x559e('0x38')][_0x559e('0x3f')](_0x559e('0x40'))){_0x30243a['limit']=qs[_0x559e('0x25')](_0x406312['query'][_0x559e('0x25')]);_0x30243a[_0x559e('0x24')]=qs[_0x559e('0x24')](_0x406312['query'][_0x559e('0x24')]);}return _0x5b8768['getConfigurations'](_0x30243a);}})[_0x559e('0x2b')](function(_0x7e151d){if(_0x7e151d){return _0x7e151d?{'count':_0x329b0f,'rows':_0x7e151d}:null;}})[_0x559e('0x2b')](respondWithResult(_0x3277d4,null))['catch'](handleError(_0x3277d4,null));};exports[_0x559e('0x53')]=function(_0xabd8d6,_0x5130b0,_0x56f58e){if(_0xabd8d6[_0x559e('0x4c')]['id']){delete _0xabd8d6[_0x559e('0x4c')]['id'];}return db[_0x559e('0x33')][_0x559e('0x4f')]({'where':{'id':_0xabd8d6[_0x559e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5130b0,null))['then'](function(_0x3b9637){if(_0x3b9637){_0xabd8d6[_0x559e('0x4c')]['AccountId']=_0x3b9637['id'];_0xabd8d6[_0x559e('0x4c')][_0x559e('0x54')]=integrations[_0x559e('0x55')](_0xabd8d6[_0x559e('0x4c')]['channel'],_0xabd8d6['body']['type']);_0xabd8d6[_0x559e('0x4c')][_0x559e('0x56')]=integrations['getDescriptions'](_0xabd8d6[_0x559e('0x4c')]['channel'],_0xabd8d6['body'][_0x559e('0x36')]);return db[_0x559e('0x50')][_0x559e('0x4b')](_0xabd8d6[_0x559e('0x4c')],{'include':[{'model':db[_0x559e('0x57')],'as':_0x559e('0x54')},{'model':db[_0x559e('0x57')],'as':_0x559e('0x56')}]});}return null;})[_0x559e('0x2b')](respondWithResult(_0x5130b0,null))[_0x559e('0x48')](handleError(_0x5130b0,null));};exports[_0x559e('0x58')]=function(_0xc25800,_0x4743fb,_0x4f0967){var _0x5dc487='';var _0x18b9aa=['id',_0x559e('0x2f'),_0x559e('0x59'),_0x559e('0x5a'),_0x559e('0x5b'),_0x559e('0x5c'),'duration_hours',_0x559e('0x5d'),_0x559e('0x5e'),'parent_type',_0x559e('0x5f'),'direction'];return db[_0x559e('0x33')][_0x559e('0x4f')]({'where':{'id':_0xc25800[_0x559e('0x4d')]['id']},'attributes':['id',_0x559e('0x60'),_0x559e('0x61'),'remoteUri']})['then'](handleEntityNotFound(_0x4743fb,null))[_0x559e('0x2b')](function(_0x10b350){if(_0x10b350){_0x5dc487=_0x10b350[_0x559e('0x62')];var _0x447a9c=_0x5dc487[_0x559e('0x63')](-0x1);if(_0x447a9c==='/'){_0x5dc487=_0x5dc487[_0x559e('0x64')](0x0,_0x5dc487[_0x559e('0x65')](_0x447a9c));}return rp({'method':_0x559e('0x66'),'uri':util[_0x559e('0x67')](_0x559e('0x68'),_0x5dc487,_0x559e('0x69')),'json':!![],'form':{'method':'login','input_type':_0x559e('0x6a'),'response_type':_0x559e('0x6a'),'rest_data':JSON[_0x559e('0x6b')]({'user_auth':{'user_name':_0x10b350['username'],'password':_0x10b350[_0x559e('0x61')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x1bd0fd){if(_0x1bd0fd&&_0x1bd0fd[_0x559e('0x2f')]!=='Invalid\x20Login'&&_0x1bd0fd[_0x559e('0x2f')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x559e('0x67')](_0x559e('0x68'),_0x5dc487,_0x559e('0x69')),'json':!![],'form':{'method':_0x559e('0x6c'),'input_type':_0x559e('0x6a'),'response_type':_0x559e('0x6a'),'rest_data':JSON[_0x559e('0x6b')]({'session':_0x1bd0fd['id'],'module_name':_0x559e('0x6d')})}})[_0x559e('0x2b')](function(_0x49709c){if(_0x49709c){var _0x22e94e=_['values'](_0x49709c[_0x559e('0x6e')]);_[_0x559e('0x6f')](_0x22e94e,function(_0x180a7d){return _0x18b9aa['includes'](_0x180a7d[_0x559e('0x2f')]);});return{'count':_0x22e94e['length'],'rows':_[_0x559e('0x32')](_0x22e94e,function(_0x3e523c){return{'id':_0x3e523c['name'],'name':_0x3e523c[_0x559e('0x70')],'custom':_[_0x559e('0x71')](_0x3e523c[_0x559e('0x2f')],'_c')?!![]:![],'options':_0x3e523c[_0x559e('0x46')]?_[_0x559e('0x32')](_[_0x559e('0x72')](_0x3e523c[_0x559e('0x46')]),function(_0x1df591){return{'name':_0x1df591[_0x559e('0x73')],'value':_0x1df591[_0x559e('0x2f')]};}):[]};})};}})[_0x559e('0x2b')](respondWithResult(_0x4743fb,null))[_0x559e('0x48')](function(_0x504051){var _0x58bf85=_0xc25800['query'][_0x559e('0x74')]?0x1f4:_0x504051[_0x559e('0x75')]||0x1f4;logger['error'](_0x559e('0x76'),_0x559e('0x58'),_0x58bf85,JSON[_0x559e('0x6b')](_0x504051));delete _0x504051[_0x559e('0x2f')];if(_0x58bf85===0x191){_0x58bf85=0x190;}_0x4743fb['status'](_0x58bf85)['send'](_0xc25800[_0x559e('0x38')][_0x559e('0x74')]?{'message':_0x559e('0x77'),'statusCode':_0x504051[_0x559e('0x75')]}:_0x504051);});}else{var _0x526ba1=0x1f4;_0x4743fb['status'](_0x526ba1)['send']({'message':_0x559e('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x23ac=['send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','destroy','SugarcrmConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','values','module_fields','remove','includes','value','test','statusCode'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x23ac,0x1e2));var _0xc23a=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x23ac[_0x37ded3];return _0x51e49e;};'use strict';var emlformat=require(_0xc23a('0x0'));var rimraf=require(_0xc23a('0x1'));var zipdir=require(_0xc23a('0x2'));var jsonpatch=require(_0xc23a('0x3'));var rp=require(_0xc23a('0x4'));var moment=require('moment');var BPromise=require(_0xc23a('0x5'));var Mustache=require(_0xc23a('0x6'));var util=require(_0xc23a('0x7'));var path=require(_0xc23a('0x8'));var sox=require(_0xc23a('0x9'));var csv=require(_0xc23a('0xa'));var ejs=require(_0xc23a('0xb'));var fs=require('fs');var fs_extra=require(_0xc23a('0xc'));var _=require(_0xc23a('0xd'));var squel=require(_0xc23a('0xe'));var crypto=require(_0xc23a('0xf'));var jsforce=require(_0xc23a('0x10'));var deskjs=require(_0xc23a('0x11'));var toCsv=require(_0xc23a('0xa'));var querystring=require(_0xc23a('0x12'));var Papa=require(_0xc23a('0x13'));var Redis=require(_0xc23a('0x14'));var authService=require(_0xc23a('0x15'));var qs=require(_0xc23a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc23a('0x17'))(_0xc23a('0x18'));var utils=require(_0xc23a('0x19'));var config=require(_0xc23a('0x1a'));var licenseUtil=require(_0xc23a('0x1b'));var db=require(_0xc23a('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e4196,_0x3a9a03){_0x3a9a03=_0x3a9a03||0xcc;return function(_0xcb4e0c){if(_0xcb4e0c){return _0x2e4196['sendStatus'](_0x3a9a03);}return _0x2e4196[_0xc23a('0x1d')](_0x3a9a03)[_0xc23a('0x1e')]();};}function respondWithResult(_0xc55aa4,_0x6d49c){_0x6d49c=_0x6d49c||0xc8;return function(_0x1fe477){if(_0x1fe477){return _0xc55aa4[_0xc23a('0x1d')](_0x6d49c)[_0xc23a('0x1f')](_0x1fe477);}};}function respondWithFilteredResult(_0x30b335,_0x1fe1d7){return function(_0x347d82){if(_0x347d82){var _0x3c4091=typeof _0x1fe1d7[_0xc23a('0x20')]===_0xc23a('0x21')&&typeof _0x1fe1d7[_0xc23a('0x22')]==='undefined';var _0x4c24b2=_0x347d82[_0xc23a('0x23')];var _0x4775b0=_0x3c4091?0x0:_0x1fe1d7[_0xc23a('0x20')];var _0x42bbb9=_0x3c4091?_0x347d82[_0xc23a('0x23')]:_0x1fe1d7[_0xc23a('0x20')]+_0x1fe1d7['limit'];var _0x861256;if(_0x42bbb9>=_0x4c24b2){_0x42bbb9=_0x4c24b2;_0x861256=0xc8;}else{_0x861256=0xce;}_0x30b335[_0xc23a('0x1d')](_0x861256);return _0x30b335['set'](_0xc23a('0x24'),_0x4775b0+'-'+_0x42bbb9+'/'+_0x4c24b2)[_0xc23a('0x1f')](_0x347d82);}return null;};}function patchUpdates(_0xbe42b7){return function(_0xff39f3){try{jsonpatch[_0xc23a('0x25')](_0xff39f3,_0xbe42b7,!![]);}catch(_0x292506){return BPromise[_0xc23a('0x26')](_0x292506);}return _0xff39f3['save']();};}function saveUpdates(_0xcb206b,_0x4676bc){return function(_0x18baac){if(_0x18baac){return _0x18baac[_0xc23a('0x27')](_0xcb206b)[_0xc23a('0x28')](function(_0x4f491e){return _0x4f491e;});}return null;};}function removeEntity(_0xf5ff33,_0x1013c8){return function(_0x1ab5b5){if(_0x1ab5b5){return _0x1ab5b5['destroy']()[_0xc23a('0x28')](function(){_0xf5ff33[_0xc23a('0x1d')](0xcc)[_0xc23a('0x1e')]();});}};}function handleEntityNotFound(_0x586078,_0x64b9c){return function(_0x50c7bd){if(!_0x50c7bd){_0x586078[_0xc23a('0x29')](0x194);}return _0x50c7bd;};}function handleError(_0x717a84,_0x5d35f2){_0x5d35f2=_0x5d35f2||0x1f4;return function(_0x310d48){logger[_0xc23a('0x2a')](_0x310d48[_0xc23a('0x2b')]);if(_0x310d48['name']){delete _0x310d48[_0xc23a('0x2c')];}_0x717a84[_0xc23a('0x1d')](_0x5d35f2)['send'](_0x310d48);};}exports[_0xc23a('0x2d')]=function(_0x5e70d2,_0x10496d){var _0x32e849={},_0x308e83={},_0xa1f20f={'count':0x0,'rows':[]};var _0x420847=_[_0xc23a('0x2e')](db[_0xc23a('0x2f')][_0xc23a('0x30')],function(_0x1663d2){return{'name':_0x1663d2[_0xc23a('0x31')],'type':_0x1663d2[_0xc23a('0x32')][_0xc23a('0x33')]};});_0x308e83[_0xc23a('0x34')]=_[_0xc23a('0x2e')](_0x420847,_0xc23a('0x2c'));_0x308e83['query']=_[_0xc23a('0x35')](_0x5e70d2[_0xc23a('0x36')]);_0x308e83[_0xc23a('0x37')]=_[_0xc23a('0x38')](_0x308e83['model'],_0x308e83['query']);_0x32e849[_0xc23a('0x39')]=_[_0xc23a('0x38')](_0x308e83[_0xc23a('0x34')],qs['fields'](_0x5e70d2[_0xc23a('0x36')][_0xc23a('0x3a')]));_0x32e849[_0xc23a('0x39')]=_0x32e849[_0xc23a('0x39')]['length']?_0x32e849[_0xc23a('0x39')]:_0x308e83[_0xc23a('0x34')];if(!_0x5e70d2['query'][_0xc23a('0x3b')](_0xc23a('0x3c'))){_0x32e849[_0xc23a('0x22')]=qs[_0xc23a('0x22')](_0x5e70d2['query']['limit']);_0x32e849[_0xc23a('0x20')]=qs[_0xc23a('0x20')](_0x5e70d2['query'][_0xc23a('0x20')]);}_0x32e849[_0xc23a('0x3d')]=qs[_0xc23a('0x3e')](_0x5e70d2[_0xc23a('0x36')][_0xc23a('0x3e')]);_0x32e849[_0xc23a('0x3f')]=qs['filters'](_[_0xc23a('0x40')](_0x5e70d2[_0xc23a('0x36')],_0x308e83[_0xc23a('0x37')]),_0x420847);if(_0x5e70d2['query'][_0xc23a('0x41')]){_0x32e849[_0xc23a('0x3f')]=_[_0xc23a('0x42')](_0x32e849[_0xc23a('0x3f')],{'$or':_[_0xc23a('0x2e')](_0x420847,function(_0x590da0){if(_0x590da0[_0xc23a('0x32')]!=='VIRTUAL'){var _0x2de99f={};_0x2de99f[_0x590da0[_0xc23a('0x2c')]]={'$like':'%'+_0x5e70d2['query']['filter']+'%'};return _0x2de99f;}})});}_0x32e849=_['merge']({},_0x32e849,_0x5e70d2[_0xc23a('0x43')]);var _0x38543b={'where':_0x32e849[_0xc23a('0x3f')]};return db['SugarcrmAccount'][_0xc23a('0x23')](_0x38543b)[_0xc23a('0x28')](function(_0x5d88d3){_0xa1f20f[_0xc23a('0x23')]=_0x5d88d3;if(_0x5e70d2[_0xc23a('0x36')]['includeAll']){_0x32e849[_0xc23a('0x44')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xc23a('0x45')](_0x32e849);})[_0xc23a('0x28')](function(_0x3b494b){_0xa1f20f[_0xc23a('0x46')]=_0x3b494b;return _0xa1f20f;})[_0xc23a('0x28')](respondWithFilteredResult(_0x10496d,_0x32e849))[_0xc23a('0x47')](handleError(_0x10496d,null));};exports['show']=function(_0x7c75c6,_0x12dda3){var _0x9ad877={'raw':![],'where':{'id':_0x7c75c6[_0xc23a('0x48')]['id']}},_0x1005a4={};_0x1005a4[_0xc23a('0x34')]=_[_0xc23a('0x35')](db[_0xc23a('0x2f')]['rawAttributes']);_0x1005a4[_0xc23a('0x36')]=_[_0xc23a('0x35')](_0x7c75c6[_0xc23a('0x36')]);_0x1005a4[_0xc23a('0x37')]=_[_0xc23a('0x38')](_0x1005a4[_0xc23a('0x34')],_0x1005a4[_0xc23a('0x36')]);_0x9ad877[_0xc23a('0x39')]=_[_0xc23a('0x38')](_0x1005a4[_0xc23a('0x34')],qs[_0xc23a('0x3a')](_0x7c75c6[_0xc23a('0x36')]['fields']));_0x9ad877[_0xc23a('0x39')]=_0x9ad877[_0xc23a('0x39')][_0xc23a('0x49')]?_0x9ad877[_0xc23a('0x39')]:_0x1005a4[_0xc23a('0x34')];if(_0x7c75c6[_0xc23a('0x36')][_0xc23a('0x4a')]){_0x9ad877[_0xc23a('0x44')]=[{'all':!![]}];}_0x9ad877=_[_0xc23a('0x42')]({},_0x9ad877,_0x7c75c6['options']);return db[_0xc23a('0x2f')][_0xc23a('0x4b')](_0x9ad877)[_0xc23a('0x28')](handleEntityNotFound(_0x12dda3,null))[_0xc23a('0x28')](respondWithResult(_0x12dda3,null))['catch'](handleError(_0x12dda3,null));};exports[_0xc23a('0x4c')]=function(_0x491f98,_0x5eb1dc){return db[_0xc23a('0x2f')][_0xc23a('0x4c')](_0x491f98['body'],{})[_0xc23a('0x28')](respondWithResult(_0x5eb1dc,0xc9))[_0xc23a('0x47')](handleError(_0x5eb1dc,null));};exports[_0xc23a('0x27')]=function(_0x53ac1b,_0x3b0a56){if(_0x53ac1b[_0xc23a('0x4d')]['id']){delete _0x53ac1b['body']['id'];}return db[_0xc23a('0x2f')]['find']({'where':{'id':_0x53ac1b[_0xc23a('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b0a56,null))[_0xc23a('0x28')](saveUpdates(_0x53ac1b[_0xc23a('0x4d')],null))['then'](respondWithResult(_0x3b0a56,null))['catch'](handleError(_0x3b0a56,null));};exports[_0xc23a('0x4e')]=function(_0x3d3a2e,_0x3bc52e){return db['SugarcrmAccount']['find']({'where':{'id':_0x3d3a2e['params']['id']}})[_0xc23a('0x28')](handleEntityNotFound(_0x3bc52e,null))['then'](removeEntity(_0x3bc52e,null))[_0xc23a('0x47')](handleError(_0x3bc52e,null));};exports['getConfigurations']=function(_0x38a950,_0x4cf5ab,_0x585e3d){var _0x511a52={};var _0x5a39fa={};var _0x46c616;var _0x11cf04;return db[_0xc23a('0x2f')]['findOne']({'where':{'id':_0x38a950[_0xc23a('0x48')]['id']}})[_0xc23a('0x28')](handleEntityNotFound(_0x4cf5ab,null))[_0xc23a('0x28')](function(_0x386519){if(_0x386519){_0x46c616=_0x386519;_0x5a39fa[_0xc23a('0x34')]=_[_0xc23a('0x35')](db[_0xc23a('0x4f')][_0xc23a('0x30')]);_0x5a39fa[_0xc23a('0x36')]=_[_0xc23a('0x35')](_0x38a950[_0xc23a('0x36')]);_0x5a39fa[_0xc23a('0x37')]=_[_0xc23a('0x38')](_0x5a39fa[_0xc23a('0x34')],_0x5a39fa['query']);_0x511a52[_0xc23a('0x39')]=_['intersection'](_0x5a39fa['model'],qs[_0xc23a('0x3a')](_0x38a950[_0xc23a('0x36')][_0xc23a('0x3a')]));_0x511a52[_0xc23a('0x39')]=_0x511a52[_0xc23a('0x39')][_0xc23a('0x49')]?_0x511a52[_0xc23a('0x39')]:_0x5a39fa[_0xc23a('0x34')];_0x511a52['order']=qs[_0xc23a('0x3e')](_0x38a950[_0xc23a('0x36')][_0xc23a('0x3e')]);_0x511a52[_0xc23a('0x3f')]=qs[_0xc23a('0x37')](_['pick'](_0x38a950[_0xc23a('0x36')],_0x5a39fa[_0xc23a('0x37')]));if(_0x38a950[_0xc23a('0x36')][_0xc23a('0x41')]){_0x511a52[_0xc23a('0x3f')]=_[_0xc23a('0x42')](_0x511a52[_0xc23a('0x3f')],{'$or':_[_0xc23a('0x2e')](_0x511a52['attributes'],function(_0x47b692){var _0x481a5e={};_0x481a5e[_0x47b692]={'$like':'%'+_0x38a950['query'][_0xc23a('0x41')]+'%'};return _0x481a5e;})});}_0x511a52=_[_0xc23a('0x42')]({},_0x511a52,_0x38a950['options']);return _0x46c616[_0xc23a('0x50')](_0x511a52);}})['then'](function(_0x121a24){if(_0x121a24){_0x11cf04=_0x121a24[_0xc23a('0x49')];if(!_0x38a950[_0xc23a('0x36')][_0xc23a('0x3b')](_0xc23a('0x3c'))){_0x511a52['limit']=qs['limit'](_0x38a950[_0xc23a('0x36')][_0xc23a('0x22')]);_0x511a52['offset']=qs[_0xc23a('0x20')](_0x38a950[_0xc23a('0x36')][_0xc23a('0x20')]);}return _0x46c616[_0xc23a('0x50')](_0x511a52);}})['then'](function(_0x2de2c2){if(_0x2de2c2){return _0x2de2c2?{'count':_0x11cf04,'rows':_0x2de2c2}:null;}})[_0xc23a('0x28')](respondWithResult(_0x4cf5ab,null))['catch'](handleError(_0x4cf5ab,null));};exports[_0xc23a('0x51')]=function(_0x36f825,_0x2b64f3,_0x579d43){if(_0x36f825[_0xc23a('0x4d')]['id']){delete _0x36f825[_0xc23a('0x4d')]['id'];}return db[_0xc23a('0x2f')][_0xc23a('0x52')]({'where':{'id':_0x36f825[_0xc23a('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b64f3,null))['then'](function(_0x327993){if(_0x327993){_0x36f825[_0xc23a('0x4d')]['AccountId']=_0x327993['id'];_0x36f825[_0xc23a('0x4d')][_0xc23a('0x53')]=integrations[_0xc23a('0x54')](_0x36f825['body']['channel'],_0x36f825['body'][_0xc23a('0x32')]);_0x36f825['body'][_0xc23a('0x55')]=integrations[_0xc23a('0x56')](_0x36f825[_0xc23a('0x4d')]['channel'],_0x36f825[_0xc23a('0x4d')][_0xc23a('0x32')]);return db[_0xc23a('0x4f')][_0xc23a('0x4c')](_0x36f825['body'],{'include':[{'model':db[_0xc23a('0x57')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xc23a('0x55')}]});}return null;})[_0xc23a('0x28')](respondWithResult(_0x2b64f3,null))['catch'](handleError(_0x2b64f3,null));};exports[_0xc23a('0x58')]=function(_0x3e1580,_0x573e8f,_0x4be4ea){var _0x20589f='';var _0xcea9d8=['id',_0xc23a('0x2c'),'assigned_user_id',_0xc23a('0x59'),_0xc23a('0x5a'),_0xc23a('0x5b'),'duration_hours','duration_minutes','parent_id',_0xc23a('0x5c'),_0xc23a('0x5d'),_0xc23a('0x5e')];return db['SugarcrmAccount'][_0xc23a('0x52')]({'where':{'id':_0x3e1580[_0xc23a('0x48')]['id']},'attributes':['id',_0xc23a('0x5f'),_0xc23a('0x60'),'remoteUri']})['then'](handleEntityNotFound(_0x573e8f,null))[_0xc23a('0x28')](function(_0x568fc6){if(_0x568fc6){_0x20589f=_0x568fc6[_0xc23a('0x61')];var _0xca8a44=_0x20589f[_0xc23a('0x62')](-0x1);if(_0xca8a44==='/'){_0x20589f=_0x20589f[_0xc23a('0x63')](0x0,_0x20589f[_0xc23a('0x64')](_0xca8a44));}return rp({'method':_0xc23a('0x65'),'uri':util['format'](_0xc23a('0x66'),_0x20589f,_0xc23a('0x67')),'json':!![],'form':{'method':_0xc23a('0x68'),'input_type':_0xc23a('0x69'),'response_type':_0xc23a('0x69'),'rest_data':JSON[_0xc23a('0x6a')]({'user_auth':{'user_name':_0x568fc6[_0xc23a('0x5f')],'password':_0x568fc6[_0xc23a('0x60')],'encryption':'PLAIN'},'application':_0xc23a('0x6b')})}});}})['then'](function(_0x1f5808){if(_0x1f5808&&_0x1f5808[_0xc23a('0x2c')]!==_0xc23a('0x6c')&&_0x1f5808['name']!==_0xc23a('0x6d')){return rp({'method':_0xc23a('0x65'),'uri':util[_0xc23a('0x6e')](_0xc23a('0x66'),_0x20589f,_0xc23a('0x67')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xc23a('0x69'),'response_type':_0xc23a('0x69'),'rest_data':JSON[_0xc23a('0x6a')]({'session':_0x1f5808['id'],'module_name':'Calls'})}})[_0xc23a('0x28')](function(_0x430cc0){if(_0x430cc0){var _0x419561=_[_0xc23a('0x6f')](_0x430cc0[_0xc23a('0x70')]);_[_0xc23a('0x71')](_0x419561,function(_0x27e42c){return _0xcea9d8[_0xc23a('0x72')](_0x27e42c[_0xc23a('0x2c')]);});return{'count':_0x419561[_0xc23a('0x49')],'rows':_[_0xc23a('0x2e')](_0x419561,function(_0x5efead){return{'id':_0x5efead[_0xc23a('0x2c')],'name':_0x5efead['label'],'custom':_['endsWith'](_0x5efead[_0xc23a('0x2c')],'_c')?!![]:![],'options':_0x5efead[_0xc23a('0x43')]?_[_0xc23a('0x2e')](_[_0xc23a('0x6f')](_0x5efead[_0xc23a('0x43')]),function(_0x461c29){return{'name':_0x461c29[_0xc23a('0x73')],'value':_0x461c29[_0xc23a('0x2c')]};}):[]};})};}})[_0xc23a('0x28')](respondWithResult(_0x573e8f,null))[_0xc23a('0x47')](function(_0x3af471){var _0x3d4ddc=_0x3e1580[_0xc23a('0x36')][_0xc23a('0x74')]?0x1f4:_0x3af471[_0xc23a('0x75')]||0x1f4;logger[_0xc23a('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0xc23a('0x58'),_0x3d4ddc,JSON[_0xc23a('0x6a')](_0x3af471));delete _0x3af471[_0xc23a('0x2c')];if(_0x3d4ddc===0x191){_0x3d4ddc=0x190;}_0x573e8f[_0xc23a('0x1d')](_0x3d4ddc)[_0xc23a('0x76')](_0x3e1580['query'][_0xc23a('0x74')]?{'message':_0xc23a('0x77'),'statusCode':_0x3af471[_0xc23a('0x75')]}:_0x3af471);});}else{var _0x2e370e=0x1f4;_0x573e8f[_0xc23a('0x1d')](_0x2e370e)['send']({'message':_0xc23a('0x77'),'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 84820c8..873ffa4 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 _0xe76a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','lodash','util'];(function(_0x53a85b,_0x43dbc8){var _0x50b2fd=function(_0x190124){while(--_0x190124){_0x53a85b['push'](_0x53a85b['shift']());}};_0x50b2fd(++_0x43dbc8);}(_0xe76a,0x177));var _0xae76=function(_0x305903,_0x4f118c){_0x305903=_0x305903-0x0;var _0x4d63d5=_0xe76a[_0x305903];return _0x4d63d5;};'use strict';var _=require(_0xae76('0x0'));var util=require(_0xae76('0x1'));var logger=require('../../config/logger')(_0xae76('0x2'));var moment=require(_0xae76('0x3'));var BPromise=require(_0xae76('0x4'));var rp=require(_0xae76('0x5'));var fs=require('fs');var path=require(_0xae76('0x6'));var rimraf=require(_0xae76('0x7'));var config=require(_0xae76('0x8'));var attributes=require(_0xae76('0x9'));var integrations=require(_0xae76('0xa'));module[_0xae76('0xb')]=function(_0x45122b,_0x5a5e9d){return _0x45122b['define'](_0xae76('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10ee=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x248084,_0x2acf86){var _0xf5cafb=function(_0x392221){while(--_0x392221){_0x248084['push'](_0x248084['shift']());}};_0xf5cafb(++_0x2acf86);}(_0x10ee,0xed));var _0xe10e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x10ee[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xe10e('0x0'));var util=require(_0xe10e('0x1'));var logger=require(_0xe10e('0x2'))(_0xe10e('0x3'));var moment=require('moment');var BPromise=require(_0xe10e('0x4'));var rp=require(_0xe10e('0x5'));var fs=require('fs');var path=require(_0xe10e('0x6'));var rimraf=require(_0xe10e('0x7'));var config=require(_0xe10e('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xe10e('0x9'));module[_0xe10e('0xa')]=function(_0x1e2f90,_0x4d7b2e){return _0x1e2f90[_0xe10e('0xb')](_0xe10e('0xc'),attributes,{'tableName':_0xe10e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 6e01767..2019051 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 _0xec8f=['../../config/environment','jayson/promise','client','http','then','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x259fe5,_0x226094){var _0x2be24c=function(_0x307fec){while(--_0x307fec){_0x259fe5['push'](_0x259fe5['shift']());}};_0x2be24c(++_0x226094);}(_0xec8f,0x11e));var _0xfec8=function(_0x31490c,_0x3a51c6){_0x31490c=_0x31490c-0x0;var _0x4c7410=_0xec8f[_0x31490c];return _0x4c7410;};'use strict';var _=require(_0xfec8('0x0'));var util=require(_0xfec8('0x1'));var moment=require(_0xfec8('0x2'));var BPromise=require(_0xfec8('0x3'));var rs=require(_0xfec8('0x4'));var fs=require('fs');var Redis=require(_0xfec8('0x5'));var db=require(_0xfec8('0x6'))['db'];var utils=require(_0xfec8('0x7'));var logger=require(_0xfec8('0x8'))(_0xfec8('0x9'));var config=require(_0xfec8('0xa'));var jayson=require(_0xfec8('0xb'));var client=jayson[_0xfec8('0xc')][_0xfec8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4cff36,_0x9a1d54,_0x3c9ea2){return new BPromise(function(_0x51a03b,_0xfc4a62){return client['request'](_0x4cff36,_0x3c9ea2)[_0xfec8('0xe')](function(_0x18c998){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x9a1d54,'request\x20sent');logger[_0xfec8('0xf')](_0xfec8('0x10'),_0x9a1d54,_0xfec8('0x11'),JSON[_0xfec8('0x12')](_0x18c998));if(_0x18c998['error']){if(_0x18c998[_0xfec8('0x13')][_0xfec8('0x14')]===0x1f4){logger[_0xfec8('0x13')](_0xfec8('0x15'),_0x9a1d54,_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);return _0xfc4a62(_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);}logger[_0xfec8('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x9a1d54,_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);return _0x51a03b(_0x18c998[_0xfec8('0x13')][_0xfec8('0x16')]);}else{logger[_0xfec8('0x17')]('SugarcrmAccount,\x20%s,\x20%s',_0x9a1d54,_0xfec8('0x11'));_0x51a03b(_0x18c998['result']['message']);}})[_0xfec8('0x18')](function(_0x5052ad){logger[_0xfec8('0x13')](_0xfec8('0x15'),_0x9a1d54,_0x5052ad);_0xfc4a62(_0x5052ad);});});}exports[_0xfec8('0x19')]=function(_0x885b03){var _0x45d169=this;return new Promise(function(_0x4922e9,_0x32cf9b){return db[_0xfec8('0x1a')][_0xfec8('0x1b')]({'raw':_0x885b03[_0xfec8('0x1c')]?_0x885b03['options'][_0xfec8('0x1d')]===undefined?!![]:![]:!![],'where':_0x885b03[_0xfec8('0x1c')]?_0x885b03[_0xfec8('0x1c')][_0xfec8('0x1e')]||null:null,'attributes':_0x885b03[_0xfec8('0x1c')]?_0x885b03['options'][_0xfec8('0x1f')]||null:null,'limit':_0x885b03[_0xfec8('0x1c')]?_0x885b03[_0xfec8('0x1c')]['limit']||null:null,'include':_0x885b03[_0xfec8('0x1c')]?_0x885b03['options'][_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x885b03['options'][_0xfec8('0x20')],function(_0x10408f){return{'model':db[_0x10408f[_0xfec8('0x22')]],'as':_0x10408f['as'],'attributes':_0x10408f[_0xfec8('0x1f')],'include':_0x10408f[_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x10408f[_0xfec8('0x20')],function(_0x3b4d65){return{'model':db[_0x3b4d65[_0xfec8('0x22')]],'as':_0x3b4d65['as'],'attributes':_0x3b4d65[_0xfec8('0x1f')],'include':_0x3b4d65[_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x3b4d65[_0xfec8('0x20')],function(_0x1f232c){return{'model':db[_0x1f232c[_0xfec8('0x22')]],'as':_0x1f232c['as'],'attributes':_0x1f232c[_0xfec8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfec8('0xe')](function(_0x41ae48){logger[_0xfec8('0x17')](_0xfec8('0x19'),_0x885b03);logger[_0xfec8('0xf')]('GetSugarcrmAccount',_0x885b03,JSON[_0xfec8('0x12')](_0x41ae48));_0x4922e9(_0x41ae48);})['catch'](function(_0x5b4d56){logger[_0xfec8('0x13')](_0xfec8('0x19'),_0x5b4d56[_0xfec8('0x16')],_0x885b03);_0x32cf9b(_0x45d169['error'](0x1f4,_0x5b4d56[_0xfec8('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x215673){var _0x199a74=this;return new Promise(function(_0x382c4d,_0x551163){return db[_0xfec8('0x1a')][_0xfec8('0x23')]({'raw':_0x215673['options']?_0x215673[_0xfec8('0x1c')][_0xfec8('0x1d')]===undefined?!![]:![]:!![],'where':_0x215673[_0xfec8('0x1c')]?_0x215673[_0xfec8('0x1c')][_0xfec8('0x1e')]||null:null,'attributes':_0x215673[_0xfec8('0x1c')]?_0x215673[_0xfec8('0x1c')][_0xfec8('0x1f')]||null:null,'include':_0x215673[_0xfec8('0x1c')]?_0x215673[_0xfec8('0x1c')][_0xfec8('0x20')]?_[_0xfec8('0x21')](_0x215673[_0xfec8('0x1c')][_0xfec8('0x20')],function(_0x37c842){return{'model':db[_0x37c842[_0xfec8('0x22')]],'as':_0x37c842['as'],'attributes':_0x37c842[_0xfec8('0x1f')],'include':_0x37c842['include']?_[_0xfec8('0x21')](_0x37c842['include'],function(_0x19f7ef){return{'model':db[_0x19f7ef['model']],'as':_0x19f7ef['as'],'attributes':_0x19f7ef[_0xfec8('0x1f')],'include':_0x19f7ef[_0xfec8('0x20')]?_['map'](_0x19f7ef[_0xfec8('0x20')],function(_0x605f91){return{'model':db[_0x605f91[_0xfec8('0x22')]],'as':_0x605f91['as'],'attributes':_0x605f91[_0xfec8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1af332){logger[_0xfec8('0x17')](_0xfec8('0x24'),_0x215673);logger[_0xfec8('0xf')](_0xfec8('0x24'),_0x215673,JSON[_0xfec8('0x12')](_0x1af332));_0x382c4d(_0x1af332);})[_0xfec8('0x18')](function(_0x4b6409){logger[_0xfec8('0x13')](_0xfec8('0x24'),_0x4b6409[_0xfec8('0x16')],_0x215673);_0x551163(_0x199a74[_0xfec8('0x13')](0x1f4,_0x4b6409[_0xfec8('0x16')]));});});}; \ No newline at end of file +var _0x06c7=['stringify','code','error','message','info','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','SugarcrmAccount','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1d2b04,_0x152281){var _0x277f00=function(_0x5dc54a){while(--_0x5dc54a){_0x1d2b04['push'](_0x1d2b04['shift']());}};_0x277f00(++_0x152281);}(_0x06c7,0x1aa));var _0x706c=function(_0x109b47,_0x294f04){_0x109b47=_0x109b47-0x0;var _0x590593=_0x06c7[_0x109b47];return _0x590593;};'use strict';var _=require(_0x706c('0x0'));var util=require(_0x706c('0x1'));var moment=require(_0x706c('0x2'));var BPromise=require(_0x706c('0x3'));var rs=require(_0x706c('0x4'));var fs=require('fs');var Redis=require(_0x706c('0x5'));var db=require(_0x706c('0x6'))['db'];var utils=require(_0x706c('0x7'));var logger=require(_0x706c('0x8'))(_0x706c('0x9'));var config=require(_0x706c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x706c('0xb')][_0x706c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37bb0c,_0x37eb2d,_0x2f8824){return new BPromise(function(_0x1aa7cb,_0x332688){return client['request'](_0x37bb0c,_0x2f8824)[_0x706c('0xd')](function(_0x34aa60){logger['info'](_0x706c('0xe'),_0x37eb2d,_0x706c('0xf'));logger[_0x706c('0x10')](_0x706c('0x11'),_0x37eb2d,'request\x20sent',JSON[_0x706c('0x12')](_0x34aa60));if(_0x34aa60['error']){if(_0x34aa60['error'][_0x706c('0x13')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x37eb2d,_0x34aa60[_0x706c('0x14')][_0x706c('0x15')]);return _0x332688(_0x34aa60[_0x706c('0x14')][_0x706c('0x15')]);}logger['error'](_0x706c('0xe'),_0x37eb2d,_0x34aa60['error']['message']);return _0x1aa7cb(_0x34aa60['error'][_0x706c('0x15')]);}else{logger[_0x706c('0x16')]('SugarcrmAccount,\x20%s,\x20%s',_0x37eb2d,_0x706c('0xf'));_0x1aa7cb(_0x34aa60['result'][_0x706c('0x15')]);}})[_0x706c('0x17')](function(_0xf86945){logger['error'](_0x706c('0xe'),_0x37eb2d,_0xf86945);_0x332688(_0xf86945);});});}exports[_0x706c('0x18')]=function(_0x5361bf){var _0x5bc1df=this;return new Promise(function(_0x53ea7d,_0x3b8ec3){return db['SugarcrmAccount'][_0x706c('0x19')]({'raw':_0x5361bf[_0x706c('0x1a')]?_0x5361bf['options'][_0x706c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5361bf[_0x706c('0x1a')]?_0x5361bf[_0x706c('0x1a')][_0x706c('0x1c')]||null:null,'attributes':_0x5361bf[_0x706c('0x1a')]?_0x5361bf['options'][_0x706c('0x1d')]||null:null,'limit':_0x5361bf[_0x706c('0x1a')]?_0x5361bf[_0x706c('0x1a')][_0x706c('0x1e')]||null:null,'include':_0x5361bf[_0x706c('0x1a')]?_0x5361bf[_0x706c('0x1a')][_0x706c('0x1f')]?_['map'](_0x5361bf[_0x706c('0x1a')]['include'],function(_0x5c4301){return{'model':db[_0x5c4301[_0x706c('0x20')]],'as':_0x5c4301['as'],'attributes':_0x5c4301[_0x706c('0x1d')],'include':_0x5c4301['include']?_[_0x706c('0x21')](_0x5c4301['include'],function(_0x559447){return{'model':db[_0x559447[_0x706c('0x20')]],'as':_0x559447['as'],'attributes':_0x559447[_0x706c('0x1d')],'include':_0x559447[_0x706c('0x1f')]?_['map'](_0x559447[_0x706c('0x1f')],function(_0x26499f){return{'model':db[_0x26499f[_0x706c('0x20')]],'as':_0x26499f['as'],'attributes':_0x26499f[_0x706c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x216d53){logger['info']('GetSugarcrmAccount',_0x5361bf);logger[_0x706c('0x10')](_0x706c('0x18'),_0x5361bf,JSON['stringify'](_0x216d53));_0x53ea7d(_0x216d53);})['catch'](function(_0x58aea3){logger[_0x706c('0x14')]('GetSugarcrmAccount',_0x58aea3[_0x706c('0x15')],_0x5361bf);_0x3b8ec3(_0x5bc1df['error'](0x1f4,_0x58aea3['message']));});});};exports['ShowSugarcrmAccount']=function(_0x559da){var _0x581f9e=this;return new Promise(function(_0x445481,_0x1239a4){return db[_0x706c('0x22')][_0x706c('0x23')]({'raw':_0x559da[_0x706c('0x1a')]?_0x559da[_0x706c('0x1a')][_0x706c('0x1b')]===undefined?!![]:![]:!![],'where':_0x559da[_0x706c('0x1a')]?_0x559da[_0x706c('0x1a')][_0x706c('0x1c')]||null:null,'attributes':_0x559da[_0x706c('0x1a')]?_0x559da[_0x706c('0x1a')]['attributes']||null:null,'include':_0x559da[_0x706c('0x1a')]?_0x559da[_0x706c('0x1a')][_0x706c('0x1f')]?_['map'](_0x559da[_0x706c('0x1a')][_0x706c('0x1f')],function(_0x489003){return{'model':db[_0x489003[_0x706c('0x20')]],'as':_0x489003['as'],'attributes':_0x489003[_0x706c('0x1d')],'include':_0x489003[_0x706c('0x1f')]?_[_0x706c('0x21')](_0x489003[_0x706c('0x1f')],function(_0x3676da){return{'model':db[_0x3676da[_0x706c('0x20')]],'as':_0x3676da['as'],'attributes':_0x3676da[_0x706c('0x1d')],'include':_0x3676da[_0x706c('0x1f')]?_[_0x706c('0x21')](_0x3676da['include'],function(_0x38eda1){return{'model':db[_0x38eda1['model']],'as':_0x38eda1['as'],'attributes':_0x38eda1['attributes']};}):[]};}):[]};}):[]:[]})[_0x706c('0xd')](function(_0x484acf){logger[_0x706c('0x16')](_0x706c('0x24'),_0x559da);logger['debug'](_0x706c('0x24'),_0x559da,JSON[_0x706c('0x12')](_0x484acf));_0x445481(_0x484acf);})[_0x706c('0x17')](function(_0x4b666c){logger['error'](_0x706c('0x24'),_0x4b666c[_0x706c('0x15')],_0x559da);_0x1239a4(_0x581f9e[_0x706c('0x14')](0x1f4,_0x4b666c[_0x706c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 40fd4bd..067ef13 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 _0x9e55=['getFields','/:id/descriptions','getDescriptions','post','create','put','update','multer','path','express','Router','../../components/auth/service','isAuthenticated','get','/:id','/:id/fields'];(function(_0x6c1a0,_0xb68825){var _0x40f3ef=function(_0x77a676){while(--_0x77a676){_0x6c1a0['push'](_0x6c1a0['shift']());}};_0x40f3ef(++_0xb68825);}(_0x9e55,0xa7));var _0x59e5=function(_0x3346da,_0x4b3472){_0x3346da=_0x3346da-0x0;var _0xbca803=_0x9e55[_0x3346da];return _0xbca803;};'use strict';var multer=require(_0x59e5('0x0'));var util=require('util');var path=require(_0x59e5('0x1'));var timeout=require('connect-timeout');var express=require(_0x59e5('0x2'));var router=express[_0x59e5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x59e5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x59e5('0x5')](),controller['index']);router[_0x59e5('0x6')](_0x59e5('0x7'),auth[_0x59e5('0x5')](),controller['show']);router[_0x59e5('0x6')](_0x59e5('0x8'),auth[_0x59e5('0x5')](),controller[_0x59e5('0x9')]);router[_0x59e5('0x6')]('/:id/subjects',auth[_0x59e5('0x5')](),controller['getSubjects']);router[_0x59e5('0x6')](_0x59e5('0xa'),auth[_0x59e5('0x5')](),controller[_0x59e5('0xb')]);router[_0x59e5('0xc')]('/',auth[_0x59e5('0x5')](),controller[_0x59e5('0xd')]);router[_0x59e5('0xe')](_0x59e5('0x7'),auth[_0x59e5('0x5')](),controller[_0x59e5('0xf')]);router['delete']('/:id',auth[_0x59e5('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6844=['delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','create','put','/:id','update'];(function(_0x344d56,_0x127cb8){var _0x4dd7eb=function(_0x47728d){while(--_0x47728d){_0x344d56['push'](_0x344d56['shift']());}};_0x4dd7eb(++_0x127cb8);}(_0x6844,0x153));var _0x4684=function(_0x5b3812,_0x4bb702){_0x5b3812=_0x5b3812-0x0;var _0x57ce23=_0x6844[_0x5b3812];return _0x57ce23;};'use strict';var multer=require('multer');var util=require(_0x4684('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4684('0x1'));var router=express['Router']();var fs_extra=require(_0x4684('0x2'));var auth=require(_0x4684('0x3'));var interaction=require(_0x4684('0x4'));var config=require(_0x4684('0x5'));var controller=require(_0x4684('0x6'));router[_0x4684('0x7')]('/',auth['isAuthenticated'](),controller[_0x4684('0x8')]);router[_0x4684('0x7')]('/:id',auth[_0x4684('0x9')](),controller[_0x4684('0xa')]);router[_0x4684('0x7')]('/:id/fields',auth[_0x4684('0x9')](),controller['getFields']);router[_0x4684('0x7')](_0x4684('0xb'),auth[_0x4684('0x9')](),controller[_0x4684('0xc')]);router[_0x4684('0x7')]('/:id/descriptions',auth[_0x4684('0x9')](),controller[_0x4684('0xd')]);router['post']('/',auth[_0x4684('0x9')](),controller[_0x4684('0xe')]);router[_0x4684('0xf')](_0x4684('0x10'),auth['isAuthenticated'](),controller[_0x4684('0x11')]);router[_0x4684('0x12')](_0x4684('0x10'),auth[_0x4684('0x9')](),controller[_0x4684('0x13')]);module[_0x4684('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 2ff63bb..6084fca 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 _0x48ef=['STRING','sequelize','exports'];(function(_0x540697,_0x2b49b5){var _0x2600e5=function(_0x375872){while(--_0x375872){_0x540697['push'](_0x540697['shift']());}};_0x2600e5(++_0x2b49b5);}(_0x48ef,0x112));var _0xf48e=function(_0x5eee1c,_0x3817d8){_0x5eee1c=_0x5eee1c-0x0;var _0x5f2ea1=_0x48ef[_0x5eee1c];return _0x5f2ea1;};'use strict';var Sequelize=require(_0xf48e('0x0'));module[_0xf48e('0x1')]={'name':{'type':Sequelize[_0xf48e('0x2')]},'description':{'type':Sequelize[_0xf48e('0x2')]}}; \ No newline at end of file +var _0x84a7=['STRING','sequelize','exports'];(function(_0x21e004,_0x177d05){var _0x4997c6=function(_0x52b393){while(--_0x52b393){_0x21e004['push'](_0x21e004['shift']());}};_0x4997c6(++_0x177d05);}(_0x84a7,0xe5));var _0x784a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x84a7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x784a('0x0'));module[_0x784a('0x1')]={'name':{'type':Sequelize[_0x784a('0x2')]},'description':{'type':Sequelize[_0x784a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c99bfff..b399bbd 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 _0x048c=['apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x5586d7,_0x592d9b){var _0x205052=function(_0x2329e2){while(--_0x2329e2){_0x5586d7['push'](_0x5586d7['shift']());}};_0x205052(++_0x592d9b);}(_0x048c,0x1ce));var _0xc048=function(_0x30efa2,_0x983b4b){_0x30efa2=_0x30efa2-0x0;var _0x45a4e2=_0x048c[_0x30efa2];return _0x45a4e2;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require(_0xc048('0x1'));var zipdir=require(_0xc048('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc048('0x3'));var moment=require(_0xc048('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc048('0x5'));var util=require(_0xc048('0x6'));var path=require('path');var sox=require(_0xc048('0x7'));var csv=require('to-csv');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(_0xc048('0xc'));var jsforce=require(_0xc048('0xd'));var deskjs=require(_0xc048('0xe'));var toCsv=require(_0xc048('0xf'));var querystring=require(_0xc048('0x10'));var Papa=require(_0xc048('0x11'));var Redis=require(_0xc048('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc048('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc048('0x14'));var logger=require(_0xc048('0x15'))(_0xc048('0x16'));var utils=require(_0xc048('0x17'));var config=require(_0xc048('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc048('0x19'))['db'];function respondWithStatusCode(_0x53fa51,_0x13355b){_0x13355b=_0x13355b||0xcc;return function(_0x42c29c){if(_0x42c29c){return _0x53fa51[_0xc048('0x1a')](_0x13355b);}return _0x53fa51['status'](_0x13355b)[_0xc048('0x1b')]();};}function respondWithResult(_0x182340,_0x2c88ec){_0x2c88ec=_0x2c88ec||0xc8;return function(_0x3b3098){if(_0x3b3098){return _0x182340[_0xc048('0x1c')](_0x2c88ec)[_0xc048('0x1d')](_0x3b3098);}};}function respondWithFilteredResult(_0x136f7f,_0x20978f){return function(_0x1abd68){if(_0x1abd68){var _0x446c43=typeof _0x20978f['offset']===_0xc048('0x1e')&&typeof _0x20978f[_0xc048('0x1f')]==='undefined';var _0xdb0bbf=_0x1abd68[_0xc048('0x20')];var _0x523fbc=_0x446c43?0x0:_0x20978f[_0xc048('0x21')];var _0x2edc99=_0x446c43?_0x1abd68['count']:_0x20978f[_0xc048('0x21')]+_0x20978f[_0xc048('0x1f')];var _0x30eb47;if(_0x2edc99>=_0xdb0bbf){_0x2edc99=_0xdb0bbf;_0x30eb47=0xc8;}else{_0x30eb47=0xce;}_0x136f7f['status'](_0x30eb47);return _0x136f7f[_0xc048('0x22')](_0xc048('0x23'),_0x523fbc+'-'+_0x2edc99+'/'+_0xdb0bbf)[_0xc048('0x1d')](_0x1abd68);}return null;};}function patchUpdates(_0x287dc5){return function(_0x126485){try{jsonpatch[_0xc048('0x24')](_0x126485,_0x287dc5,!![]);}catch(_0x501c98){return BPromise['reject'](_0x501c98);}return _0x126485[_0xc048('0x25')]();};}function saveUpdates(_0x2f50dc,_0x5ad81a){return function(_0xae103d){if(_0xae103d){return _0xae103d[_0xc048('0x26')](_0x2f50dc)[_0xc048('0x27')](function(_0xed8f29){return _0xed8f29;});}return null;};}function removeEntity(_0x328edb,_0x335311){return function(_0x27017d){if(_0x27017d){return _0x27017d[_0xc048('0x28')]()['then'](function(){_0x328edb[_0xc048('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6e0e,_0x4d06f0){return function(_0x1b7049){if(!_0x1b7049){_0x2c6e0e[_0xc048('0x1a')](0x194);}return _0x1b7049;};}function handleError(_0x5bdccc,_0x84a5dc){_0x84a5dc=_0x84a5dc||0x1f4;return function(_0x3e12e0){logger[_0xc048('0x29')](_0x3e12e0[_0xc048('0x2a')]);if(_0x3e12e0[_0xc048('0x2b')]){delete _0x3e12e0[_0xc048('0x2b')];}_0x5bdccc['status'](_0x84a5dc)[_0xc048('0x2c')](_0x3e12e0);};}exports[_0xc048('0x2d')]=function(_0x2d7f0f,_0x2cabfa){var _0x48346b={},_0x340b5d={},_0x312bb3={'count':0x0,'rows':[]};var _0x515cf3=_[_0xc048('0x2e')](db['SugarcrmConfiguration'][_0xc048('0x2f')],function(_0x2f026){return{'name':_0x2f026['fieldName'],'type':_0x2f026[_0xc048('0x30')][_0xc048('0x31')]};});_0x340b5d[_0xc048('0x32')]=_[_0xc048('0x2e')](_0x515cf3,'name');_0x340b5d[_0xc048('0x33')]=_[_0xc048('0x34')](_0x2d7f0f[_0xc048('0x33')]);_0x340b5d[_0xc048('0x35')]=_['intersection'](_0x340b5d[_0xc048('0x32')],_0x340b5d[_0xc048('0x33')]);_0x48346b['attributes']=_[_0xc048('0x36')](_0x340b5d['model'],qs[_0xc048('0x37')](_0x2d7f0f['query']['fields']));_0x48346b[_0xc048('0x38')]=_0x48346b[_0xc048('0x38')][_0xc048('0x39')]?_0x48346b['attributes']:_0x340b5d[_0xc048('0x32')];if(!_0x2d7f0f['query'][_0xc048('0x3a')](_0xc048('0x3b'))){_0x48346b[_0xc048('0x1f')]=qs[_0xc048('0x1f')](_0x2d7f0f['query'][_0xc048('0x1f')]);_0x48346b['offset']=qs[_0xc048('0x21')](_0x2d7f0f[_0xc048('0x33')][_0xc048('0x21')]);}_0x48346b[_0xc048('0x3c')]=qs['sort'](_0x2d7f0f[_0xc048('0x33')][_0xc048('0x3d')]);_0x48346b[_0xc048('0x3e')]=qs[_0xc048('0x35')](_[_0xc048('0x3f')](_0x2d7f0f['query'],_0x340b5d[_0xc048('0x35')]),_0x515cf3);if(_0x2d7f0f[_0xc048('0x33')][_0xc048('0x40')]){_0x48346b['where']=_[_0xc048('0x41')](_0x48346b[_0xc048('0x3e')],{'$or':_[_0xc048('0x2e')](_0x515cf3,function(_0x376636){if(_0x376636['type']!==_0xc048('0x42')){var _0x12403d={};_0x12403d[_0x376636['name']]={'$like':'%'+_0x2d7f0f['query'][_0xc048('0x40')]+'%'};return _0x12403d;}})});}_0x48346b=_['merge']({},_0x48346b,_0x2d7f0f[_0xc048('0x43')]);var _0x38ef2e={'where':_0x48346b[_0xc048('0x3e')]};return db[_0xc048('0x44')][_0xc048('0x20')](_0x38ef2e)[_0xc048('0x27')](function(_0x22139f){_0x312bb3['count']=_0x22139f;if(_0x2d7f0f[_0xc048('0x33')][_0xc048('0x45')]){_0x48346b[_0xc048('0x46')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xc048('0x47')](_0x48346b);})[_0xc048('0x27')](function(_0x28fee9){_0x312bb3[_0xc048('0x48')]=_0x28fee9;return _0x312bb3;})['then'](respondWithFilteredResult(_0x2cabfa,_0x48346b))[_0xc048('0x49')](handleError(_0x2cabfa,null));};exports['show']=function(_0x5d486a,_0x30153f){var _0x464f96={'raw':![],'where':{'id':_0x5d486a[_0xc048('0x4a')]['id']}},_0x335247={};_0x335247[_0xc048('0x32')]=_[_0xc048('0x34')](db[_0xc048('0x44')][_0xc048('0x2f')]);_0x335247[_0xc048('0x33')]=_[_0xc048('0x34')](_0x5d486a['query']);_0x335247['filters']=_[_0xc048('0x36')](_0x335247[_0xc048('0x32')],_0x335247[_0xc048('0x33')]);_0x464f96['attributes']=_['intersection'](_0x335247['model'],qs[_0xc048('0x37')](_0x5d486a[_0xc048('0x33')][_0xc048('0x37')]));_0x464f96[_0xc048('0x38')]=_0x464f96[_0xc048('0x38')]['length']?_0x464f96[_0xc048('0x38')]:_0x335247[_0xc048('0x32')];if(_0x5d486a['query'][_0xc048('0x45')]){_0x464f96['include']=[{'all':!![]}];}_0x464f96=_[_0xc048('0x41')]({},_0x464f96,_0x5d486a[_0xc048('0x43')]);return db[_0xc048('0x44')][_0xc048('0x4b')](_0x464f96)[_0xc048('0x27')](handleEntityNotFound(_0x30153f,null))[_0xc048('0x27')](respondWithResult(_0x30153f,null))[_0xc048('0x49')](handleError(_0x30153f,null));};exports[_0xc048('0x4c')]=function(_0x53657d,_0x581c65){return db[_0xc048('0x44')][_0xc048('0x4c')](_0x53657d[_0xc048('0x4d')],{})[_0xc048('0x27')](respondWithResult(_0x581c65,0xc9))[_0xc048('0x49')](handleError(_0x581c65,null));};exports['update']=function(_0x4ab1c9,_0x569e85){if(_0x4ab1c9[_0xc048('0x4d')]['id']){delete _0x4ab1c9[_0xc048('0x4d')]['id'];}return db['SugarcrmConfiguration'][_0xc048('0x4b')]({'where':{'id':_0x4ab1c9[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x569e85,null))[_0xc048('0x27')](saveUpdates(_0x4ab1c9[_0xc048('0x4d')],null))[_0xc048('0x27')](respondWithResult(_0x569e85,null))[_0xc048('0x49')](handleError(_0x569e85,null));};exports['destroy']=function(_0x1d4cf9,_0x13236b){return db[_0xc048('0x44')]['find']({'where':{'id':_0x1d4cf9[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x13236b,null))[_0xc048('0x27')](removeEntity(_0x13236b,null))[_0xc048('0x49')](handleError(_0x13236b,null));};exports[_0xc048('0x4e')]=function(_0x515e1f,_0x56a1fb,_0x3a9cbf){var _0xa879d={};var _0x5a3155={};var _0x44ab72;var _0x5abe0e;return db['SugarcrmConfiguration'][_0xc048('0x4f')]({'where':{'id':_0x515e1f[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x56a1fb,null))[_0xc048('0x27')](function(_0x4d95a5){if(_0x4d95a5){_0x44ab72=_0x4d95a5;_0x5a3155['model']=_[_0xc048('0x34')](db['SugarcrmField'][_0xc048('0x2f')]);_0x5a3155[_0xc048('0x33')]=_['keys'](_0x515e1f[_0xc048('0x33')]);_0x5a3155['filters']=_[_0xc048('0x36')](_0x5a3155[_0xc048('0x32')],_0x5a3155[_0xc048('0x33')]);_0xa879d['attributes']=_['intersection'](_0x5a3155['model'],qs['fields'](_0x515e1f['query'][_0xc048('0x37')]));_0xa879d[_0xc048('0x38')]=_0xa879d[_0xc048('0x38')][_0xc048('0x39')]?_0xa879d[_0xc048('0x38')]:_0x5a3155[_0xc048('0x32')];_0xa879d[_0xc048('0x3c')]=qs[_0xc048('0x3d')](_0x515e1f[_0xc048('0x33')][_0xc048('0x3d')]);_0xa879d[_0xc048('0x3e')]=qs['filters'](_[_0xc048('0x3f')](_0x515e1f['query'],_0x5a3155[_0xc048('0x35')]));if(_0x515e1f[_0xc048('0x33')][_0xc048('0x40')]){_0xa879d[_0xc048('0x3e')]=_[_0xc048('0x41')](_0xa879d[_0xc048('0x3e')],{'$or':_['map'](_0xa879d['attributes'],function(_0x17c148){var _0x271503={};_0x271503[_0x17c148]={'$like':'%'+_0x515e1f[_0xc048('0x33')][_0xc048('0x40')]+'%'};return _0x271503;})});}_0xa879d=_[_0xc048('0x41')]({},_0xa879d,_0x515e1f[_0xc048('0x43')]);return _0x44ab72[_0xc048('0x4e')](_0xa879d);}})[_0xc048('0x27')](function(_0x2f8b0d){if(_0x2f8b0d){_0x5abe0e=_0x2f8b0d[_0xc048('0x39')];if(!_0x515e1f[_0xc048('0x33')][_0xc048('0x3a')](_0xc048('0x3b'))){_0xa879d[_0xc048('0x1f')]=qs['limit'](_0x515e1f[_0xc048('0x33')][_0xc048('0x1f')]);_0xa879d[_0xc048('0x21')]=qs['offset'](_0x515e1f[_0xc048('0x33')][_0xc048('0x21')]);}return _0x44ab72[_0xc048('0x4e')](_0xa879d);}})[_0xc048('0x27')](function(_0xc97fa6){if(_0xc97fa6){return _0xc97fa6?{'count':_0x5abe0e,'rows':_0xc97fa6}:null;}})[_0xc048('0x27')](respondWithResult(_0x56a1fb,null))[_0xc048('0x49')](handleError(_0x56a1fb,null));};exports['getSubjects']=function(_0x576c95,_0x446c4c,_0x44c2f2){var _0x5c10bf={};var _0x2e8765={};var _0x188e80;var _0x4825ec;return db[_0xc048('0x44')][_0xc048('0x4f')]({'where':{'id':_0x576c95['params']['id']}})['then'](handleEntityNotFound(_0x446c4c,null))[_0xc048('0x27')](function(_0x2fdfce){if(_0x2fdfce){_0x188e80=_0x2fdfce;_0x2e8765[_0xc048('0x32')]=_[_0xc048('0x34')](db[_0xc048('0x50')][_0xc048('0x2f')]);_0x2e8765[_0xc048('0x33')]=_[_0xc048('0x34')](_0x576c95['query']);_0x2e8765['filters']=_[_0xc048('0x36')](_0x2e8765[_0xc048('0x32')],_0x2e8765[_0xc048('0x33')]);_0x5c10bf[_0xc048('0x38')]=_[_0xc048('0x36')](_0x2e8765[_0xc048('0x32')],qs[_0xc048('0x37')](_0x576c95[_0xc048('0x33')][_0xc048('0x37')]));_0x5c10bf['attributes']=_0x5c10bf[_0xc048('0x38')][_0xc048('0x39')]?_0x5c10bf['attributes']:_0x2e8765[_0xc048('0x32')];_0x5c10bf[_0xc048('0x3c')]=qs[_0xc048('0x3d')](_0x576c95[_0xc048('0x33')][_0xc048('0x3d')]);_0x5c10bf[_0xc048('0x3e')]=qs[_0xc048('0x35')](_[_0xc048('0x3f')](_0x576c95['query'],_0x2e8765[_0xc048('0x35')]));if(_0x576c95[_0xc048('0x33')][_0xc048('0x40')]){_0x5c10bf[_0xc048('0x3e')]=_[_0xc048('0x41')](_0x5c10bf[_0xc048('0x3e')],{'$or':_[_0xc048('0x2e')](_0x5c10bf[_0xc048('0x38')],function(_0x13b53b){var _0x1111f3={};_0x1111f3[_0x13b53b]={'$like':'%'+_0x576c95[_0xc048('0x33')][_0xc048('0x40')]+'%'};return _0x1111f3;})});}_0x5c10bf=_[_0xc048('0x41')]({},_0x5c10bf,_0x576c95[_0xc048('0x43')]);return _0x188e80[_0xc048('0x51')](_0x5c10bf);}})[_0xc048('0x27')](function(_0x5efe1e){if(_0x5efe1e){_0x4825ec=_0x5efe1e[_0xc048('0x39')];if(!_0x576c95[_0xc048('0x33')][_0xc048('0x3a')](_0xc048('0x3b'))){_0x5c10bf[_0xc048('0x1f')]=qs['limit'](_0x576c95[_0xc048('0x33')][_0xc048('0x1f')]);_0x5c10bf[_0xc048('0x21')]=qs['offset'](_0x576c95[_0xc048('0x33')][_0xc048('0x21')]);}return _0x188e80[_0xc048('0x51')](_0x5c10bf);}})[_0xc048('0x27')](function(_0x4a24c8){if(_0x4a24c8){return _0x4a24c8?{'count':_0x4825ec,'rows':_0x4a24c8}:null;}})['then'](respondWithResult(_0x446c4c,null))[_0xc048('0x49')](handleError(_0x446c4c,null));};exports[_0xc048('0x52')]=function(_0x4d9a5f,_0x3303f4,_0x52ee58){var _0x1da1cf={};var _0x1d38b8={};var _0x509710;var _0x533e6e;return db[_0xc048('0x44')]['findOne']({'where':{'id':_0x4d9a5f[_0xc048('0x4a')]['id']}})[_0xc048('0x27')](handleEntityNotFound(_0x3303f4,null))[_0xc048('0x27')](function(_0x589913){if(_0x589913){_0x509710=_0x589913;_0x1d38b8[_0xc048('0x32')]=_[_0xc048('0x34')](db['SugarcrmField'][_0xc048('0x2f')]);_0x1d38b8[_0xc048('0x33')]=_[_0xc048('0x34')](_0x4d9a5f[_0xc048('0x33')]);_0x1d38b8[_0xc048('0x35')]=_[_0xc048('0x36')](_0x1d38b8[_0xc048('0x32')],_0x1d38b8[_0xc048('0x33')]);_0x1da1cf[_0xc048('0x38')]=_[_0xc048('0x36')](_0x1d38b8[_0xc048('0x32')],qs['fields'](_0x4d9a5f[_0xc048('0x33')]['fields']));_0x1da1cf[_0xc048('0x38')]=_0x1da1cf[_0xc048('0x38')][_0xc048('0x39')]?_0x1da1cf[_0xc048('0x38')]:_0x1d38b8[_0xc048('0x32')];_0x1da1cf[_0xc048('0x3c')]=qs[_0xc048('0x3d')](_0x4d9a5f['query'][_0xc048('0x3d')]);_0x1da1cf[_0xc048('0x3e')]=qs['filters'](_[_0xc048('0x3f')](_0x4d9a5f[_0xc048('0x33')],_0x1d38b8[_0xc048('0x35')]));if(_0x4d9a5f[_0xc048('0x33')][_0xc048('0x40')]){_0x1da1cf['where']=_['merge'](_0x1da1cf[_0xc048('0x3e')],{'$or':_['map'](_0x1da1cf['attributes'],function(_0x2eb93e){var _0x515ef1={};_0x515ef1[_0x2eb93e]={'$like':'%'+_0x4d9a5f['query']['filter']+'%'};return _0x515ef1;})});}_0x1da1cf=_[_0xc048('0x41')]({},_0x1da1cf,_0x4d9a5f[_0xc048('0x43')]);return _0x509710[_0xc048('0x52')](_0x1da1cf);}})['then'](function(_0x1a804c){if(_0x1a804c){_0x533e6e=_0x1a804c[_0xc048('0x39')];if(!_0x4d9a5f[_0xc048('0x33')][_0xc048('0x3a')](_0xc048('0x3b'))){_0x1da1cf[_0xc048('0x1f')]=qs[_0xc048('0x1f')](_0x4d9a5f[_0xc048('0x33')]['limit']);_0x1da1cf['offset']=qs[_0xc048('0x21')](_0x4d9a5f[_0xc048('0x33')][_0xc048('0x21')]);}return _0x509710[_0xc048('0x52')](_0x1da1cf);}})['then'](function(_0x3e2dfa){if(_0x3e2dfa){return _0x3e2dfa?{'count':_0x533e6e,'rows':_0x3e2dfa}:null;}})[_0xc048('0x27')](respondWithResult(_0x3303f4,null))[_0xc048('0x49')](handleError(_0x3303f4,null));}; \ No newline at end of file +var _0x14e0=['undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','send','index','map','SugarcrmConfiguration','model','name','query','keys','filters','intersection','attributes','fields','length','sort','where','merge','VIRTUAL','includeAll','findAll','rows','show','rawAttributes','include','options','catch','create','body','find','params','getFields','SugarcrmField','order','pick','filter','nolimit','getSubjects','findOne','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x55a443,_0x27192b){var _0x463e1b=function(_0x1fdef8){while(--_0x1fdef8){_0x55a443['push'](_0x55a443['shift']());}};_0x463e1b(++_0x27192b);}(_0x14e0,0x11b));var _0x014e=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0x14e0[_0x5f25b3];return _0x4ab9bf;};'use strict';var emlformat=require(_0x014e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x014e('0x1'));var jsonpatch=require(_0x014e('0x2'));var rp=require('request-promise');var moment=require(_0x014e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x014e('0x4'));var util=require(_0x014e('0x5'));var path=require('path');var sox=require(_0x014e('0x6'));var csv=require(_0x014e('0x7'));var ejs=require(_0x014e('0x8'));var fs=require('fs');var fs_extra=require(_0x014e('0x9'));var _=require('lodash');var squel=require(_0x014e('0xa'));var crypto=require('crypto');var jsforce=require(_0x014e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x014e('0x7'));var querystring=require('querystring');var Papa=require(_0x014e('0xc'));var Redis=require(_0x014e('0xd'));var authService=require(_0x014e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x014e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014e('0x10'))(_0x014e('0x11'));var utils=require(_0x014e('0x12'));var config=require(_0x014e('0x13'));var licenseUtil=require(_0x014e('0x14'));var db=require(_0x014e('0x15'))['db'];function respondWithStatusCode(_0x568cd3,_0x1308c8){_0x1308c8=_0x1308c8||0xcc;return function(_0x279764){if(_0x279764){return _0x568cd3['sendStatus'](_0x1308c8);}return _0x568cd3[_0x014e('0x16')](_0x1308c8)[_0x014e('0x17')]();};}function respondWithResult(_0xe4be56,_0x17f7c8){_0x17f7c8=_0x17f7c8||0xc8;return function(_0xfa85e6){if(_0xfa85e6){return _0xe4be56[_0x014e('0x16')](_0x17f7c8)[_0x014e('0x18')](_0xfa85e6);}};}function respondWithFilteredResult(_0x6d2858,_0x2f75cc){return function(_0x440589){if(_0x440589){var _0x318a30=typeof _0x2f75cc['offset']===_0x014e('0x19')&&typeof _0x2f75cc[_0x014e('0x1a')]===_0x014e('0x19');var _0x530970=_0x440589['count'];var _0x2bab52=_0x318a30?0x0:_0x2f75cc[_0x014e('0x1b')];var _0x245bcc=_0x318a30?_0x440589[_0x014e('0x1c')]:_0x2f75cc[_0x014e('0x1b')]+_0x2f75cc[_0x014e('0x1a')];var _0x1c6ac;if(_0x245bcc>=_0x530970){_0x245bcc=_0x530970;_0x1c6ac=0xc8;}else{_0x1c6ac=0xce;}_0x6d2858[_0x014e('0x16')](_0x1c6ac);return _0x6d2858[_0x014e('0x1d')](_0x014e('0x1e'),_0x2bab52+'-'+_0x245bcc+'/'+_0x530970)[_0x014e('0x18')](_0x440589);}return null;};}function patchUpdates(_0x2cad02){return function(_0x375e6f){try{jsonpatch['apply'](_0x375e6f,_0x2cad02,!![]);}catch(_0x26bec7){return BPromise[_0x014e('0x1f')](_0x26bec7);}return _0x375e6f['save']();};}function saveUpdates(_0x68d4a9,_0x135eaf){return function(_0x2140bc){if(_0x2140bc){return _0x2140bc[_0x014e('0x20')](_0x68d4a9)[_0x014e('0x21')](function(_0x100c5e){return _0x100c5e;});}return null;};}function removeEntity(_0x431db6,_0x9c13c6){return function(_0x10c4fb){if(_0x10c4fb){return _0x10c4fb[_0x014e('0x22')]()[_0x014e('0x21')](function(){_0x431db6[_0x014e('0x16')](0xcc)[_0x014e('0x17')]();});}};}function handleEntityNotFound(_0x16d610,_0x574aff){return function(_0x4b90d0){if(!_0x4b90d0){_0x16d610[_0x014e('0x23')](0x194);}return _0x4b90d0;};}function handleError(_0x1c2850,_0x4b543d){_0x4b543d=_0x4b543d||0x1f4;return function(_0x25c641){logger[_0x014e('0x24')](_0x25c641[_0x014e('0x25')]);if(_0x25c641['name']){delete _0x25c641['name'];}_0x1c2850[_0x014e('0x16')](_0x4b543d)[_0x014e('0x26')](_0x25c641);};}exports[_0x014e('0x27')]=function(_0x4f4297,_0x42180c){var _0x492084={},_0x1cb500={},_0xafb149={'count':0x0,'rows':[]};var _0x54cedc=_[_0x014e('0x28')](db[_0x014e('0x29')]['rawAttributes'],function(_0x5e38a0){return{'name':_0x5e38a0['fieldName'],'type':_0x5e38a0['type']['key']};});_0x1cb500[_0x014e('0x2a')]=_['map'](_0x54cedc,_0x014e('0x2b'));_0x1cb500[_0x014e('0x2c')]=_[_0x014e('0x2d')](_0x4f4297[_0x014e('0x2c')]);_0x1cb500[_0x014e('0x2e')]=_[_0x014e('0x2f')](_0x1cb500[_0x014e('0x2a')],_0x1cb500[_0x014e('0x2c')]);_0x492084[_0x014e('0x30')]=_[_0x014e('0x2f')](_0x1cb500[_0x014e('0x2a')],qs['fields'](_0x4f4297['query'][_0x014e('0x31')]));_0x492084[_0x014e('0x30')]=_0x492084[_0x014e('0x30')][_0x014e('0x32')]?_0x492084['attributes']:_0x1cb500['model'];if(!_0x4f4297[_0x014e('0x2c')]['hasOwnProperty']('nolimit')){_0x492084['limit']=qs[_0x014e('0x1a')](_0x4f4297[_0x014e('0x2c')][_0x014e('0x1a')]);_0x492084[_0x014e('0x1b')]=qs[_0x014e('0x1b')](_0x4f4297[_0x014e('0x2c')][_0x014e('0x1b')]);}_0x492084['order']=qs[_0x014e('0x33')](_0x4f4297[_0x014e('0x2c')][_0x014e('0x33')]);_0x492084[_0x014e('0x34')]=qs[_0x014e('0x2e')](_['pick'](_0x4f4297[_0x014e('0x2c')],_0x1cb500[_0x014e('0x2e')]),_0x54cedc);if(_0x4f4297['query']['filter']){_0x492084['where']=_[_0x014e('0x35')](_0x492084[_0x014e('0x34')],{'$or':_[_0x014e('0x28')](_0x54cedc,function(_0x3ba215){if(_0x3ba215['type']!==_0x014e('0x36')){var _0x8a75f9={};_0x8a75f9[_0x3ba215[_0x014e('0x2b')]]={'$like':'%'+_0x4f4297[_0x014e('0x2c')]['filter']+'%'};return _0x8a75f9;}})});}_0x492084=_[_0x014e('0x35')]({},_0x492084,_0x4f4297['options']);var _0x43a99b={'where':_0x492084[_0x014e('0x34')]};return db[_0x014e('0x29')][_0x014e('0x1c')](_0x43a99b)[_0x014e('0x21')](function(_0x59575a){_0xafb149['count']=_0x59575a;if(_0x4f4297[_0x014e('0x2c')][_0x014e('0x37')]){_0x492084['include']=[{'all':!![]}];}return db[_0x014e('0x29')][_0x014e('0x38')](_0x492084);})[_0x014e('0x21')](function(_0x23bbac){_0xafb149[_0x014e('0x39')]=_0x23bbac;return _0xafb149;})[_0x014e('0x21')](respondWithFilteredResult(_0x42180c,_0x492084))['catch'](handleError(_0x42180c,null));};exports[_0x014e('0x3a')]=function(_0x2355ff,_0x34c1f7){var _0x11431c={'raw':![],'where':{'id':_0x2355ff['params']['id']}},_0x418b19={};_0x418b19[_0x014e('0x2a')]=_[_0x014e('0x2d')](db['SugarcrmConfiguration'][_0x014e('0x3b')]);_0x418b19[_0x014e('0x2c')]=_['keys'](_0x2355ff[_0x014e('0x2c')]);_0x418b19[_0x014e('0x2e')]=_[_0x014e('0x2f')](_0x418b19[_0x014e('0x2a')],_0x418b19[_0x014e('0x2c')]);_0x11431c[_0x014e('0x30')]=_[_0x014e('0x2f')](_0x418b19['model'],qs[_0x014e('0x31')](_0x2355ff['query'][_0x014e('0x31')]));_0x11431c[_0x014e('0x30')]=_0x11431c[_0x014e('0x30')][_0x014e('0x32')]?_0x11431c[_0x014e('0x30')]:_0x418b19[_0x014e('0x2a')];if(_0x2355ff[_0x014e('0x2c')][_0x014e('0x37')]){_0x11431c[_0x014e('0x3c')]=[{'all':!![]}];}_0x11431c=_[_0x014e('0x35')]({},_0x11431c,_0x2355ff[_0x014e('0x3d')]);return db[_0x014e('0x29')]['find'](_0x11431c)['then'](handleEntityNotFound(_0x34c1f7,null))[_0x014e('0x21')](respondWithResult(_0x34c1f7,null))[_0x014e('0x3e')](handleError(_0x34c1f7,null));};exports[_0x014e('0x3f')]=function(_0x420511,_0x1c55f6){return db[_0x014e('0x29')][_0x014e('0x3f')](_0x420511['body'],{})[_0x014e('0x21')](respondWithResult(_0x1c55f6,0xc9))[_0x014e('0x3e')](handleError(_0x1c55f6,null));};exports[_0x014e('0x20')]=function(_0x5812d4,_0x21209b){if(_0x5812d4[_0x014e('0x40')]['id']){delete _0x5812d4[_0x014e('0x40')]['id'];}return db[_0x014e('0x29')][_0x014e('0x41')]({'where':{'id':_0x5812d4[_0x014e('0x42')]['id']}})['then'](handleEntityNotFound(_0x21209b,null))[_0x014e('0x21')](saveUpdates(_0x5812d4[_0x014e('0x40')],null))[_0x014e('0x21')](respondWithResult(_0x21209b,null))[_0x014e('0x3e')](handleError(_0x21209b,null));};exports[_0x014e('0x22')]=function(_0x289148,_0x28e344){return db[_0x014e('0x29')][_0x014e('0x41')]({'where':{'id':_0x289148[_0x014e('0x42')]['id']}})['then'](handleEntityNotFound(_0x28e344,null))[_0x014e('0x21')](removeEntity(_0x28e344,null))[_0x014e('0x3e')](handleError(_0x28e344,null));};exports[_0x014e('0x43')]=function(_0x1d5149,_0x2557ff,_0xe53cbf){var _0x1ad677={};var _0x112035={};var _0x5b7c1e;var _0x5603dc;return db[_0x014e('0x29')]['findOne']({'where':{'id':_0x1d5149[_0x014e('0x42')]['id']}})['then'](handleEntityNotFound(_0x2557ff,null))[_0x014e('0x21')](function(_0x1402e6){if(_0x1402e6){_0x5b7c1e=_0x1402e6;_0x112035[_0x014e('0x2a')]=_[_0x014e('0x2d')](db[_0x014e('0x44')][_0x014e('0x3b')]);_0x112035[_0x014e('0x2c')]=_['keys'](_0x1d5149[_0x014e('0x2c')]);_0x112035[_0x014e('0x2e')]=_['intersection'](_0x112035[_0x014e('0x2a')],_0x112035['query']);_0x1ad677[_0x014e('0x30')]=_[_0x014e('0x2f')](_0x112035[_0x014e('0x2a')],qs['fields'](_0x1d5149[_0x014e('0x2c')][_0x014e('0x31')]));_0x1ad677[_0x014e('0x30')]=_0x1ad677[_0x014e('0x30')][_0x014e('0x32')]?_0x1ad677[_0x014e('0x30')]:_0x112035['model'];_0x1ad677[_0x014e('0x45')]=qs[_0x014e('0x33')](_0x1d5149[_0x014e('0x2c')]['sort']);_0x1ad677[_0x014e('0x34')]=qs[_0x014e('0x2e')](_[_0x014e('0x46')](_0x1d5149[_0x014e('0x2c')],_0x112035['filters']));if(_0x1d5149[_0x014e('0x2c')]['filter']){_0x1ad677[_0x014e('0x34')]=_[_0x014e('0x35')](_0x1ad677[_0x014e('0x34')],{'$or':_[_0x014e('0x28')](_0x1ad677['attributes'],function(_0x5995e5){var _0x493ef1={};_0x493ef1[_0x5995e5]={'$like':'%'+_0x1d5149[_0x014e('0x2c')][_0x014e('0x47')]+'%'};return _0x493ef1;})});}_0x1ad677=_[_0x014e('0x35')]({},_0x1ad677,_0x1d5149[_0x014e('0x3d')]);return _0x5b7c1e[_0x014e('0x43')](_0x1ad677);}})[_0x014e('0x21')](function(_0x580bbb){if(_0x580bbb){_0x5603dc=_0x580bbb[_0x014e('0x32')];if(!_0x1d5149[_0x014e('0x2c')]['hasOwnProperty'](_0x014e('0x48'))){_0x1ad677['limit']=qs[_0x014e('0x1a')](_0x1d5149['query']['limit']);_0x1ad677['offset']=qs[_0x014e('0x1b')](_0x1d5149['query'][_0x014e('0x1b')]);}return _0x5b7c1e[_0x014e('0x43')](_0x1ad677);}})['then'](function(_0x3429c6){if(_0x3429c6){return _0x3429c6?{'count':_0x5603dc,'rows':_0x3429c6}:null;}})[_0x014e('0x21')](respondWithResult(_0x2557ff,null))[_0x014e('0x3e')](handleError(_0x2557ff,null));};exports[_0x014e('0x49')]=function(_0x4e02f5,_0x2aa6b5,_0x2f53eb){var _0x3e0ca8={};var _0x39df76={};var _0x36596c;var _0x3427a8;return db[_0x014e('0x29')][_0x014e('0x4a')]({'where':{'id':_0x4e02f5[_0x014e('0x42')]['id']}})[_0x014e('0x21')](handleEntityNotFound(_0x2aa6b5,null))[_0x014e('0x21')](function(_0x379fb7){if(_0x379fb7){_0x36596c=_0x379fb7;_0x39df76[_0x014e('0x2a')]=_[_0x014e('0x2d')](db[_0x014e('0x44')][_0x014e('0x3b')]);_0x39df76['query']=_[_0x014e('0x2d')](_0x4e02f5['query']);_0x39df76[_0x014e('0x2e')]=_[_0x014e('0x2f')](_0x39df76[_0x014e('0x2a')],_0x39df76[_0x014e('0x2c')]);_0x3e0ca8[_0x014e('0x30')]=_[_0x014e('0x2f')](_0x39df76[_0x014e('0x2a')],qs['fields'](_0x4e02f5[_0x014e('0x2c')][_0x014e('0x31')]));_0x3e0ca8[_0x014e('0x30')]=_0x3e0ca8[_0x014e('0x30')][_0x014e('0x32')]?_0x3e0ca8[_0x014e('0x30')]:_0x39df76['model'];_0x3e0ca8[_0x014e('0x45')]=qs[_0x014e('0x33')](_0x4e02f5['query']['sort']);_0x3e0ca8['where']=qs[_0x014e('0x2e')](_[_0x014e('0x46')](_0x4e02f5[_0x014e('0x2c')],_0x39df76['filters']));if(_0x4e02f5[_0x014e('0x2c')][_0x014e('0x47')]){_0x3e0ca8[_0x014e('0x34')]=_['merge'](_0x3e0ca8[_0x014e('0x34')],{'$or':_[_0x014e('0x28')](_0x3e0ca8[_0x014e('0x30')],function(_0xa03489){var _0x3fe15a={};_0x3fe15a[_0xa03489]={'$like':'%'+_0x4e02f5[_0x014e('0x2c')]['filter']+'%'};return _0x3fe15a;})});}_0x3e0ca8=_[_0x014e('0x35')]({},_0x3e0ca8,_0x4e02f5['options']);return _0x36596c[_0x014e('0x49')](_0x3e0ca8);}})[_0x014e('0x21')](function(_0x42aa20){if(_0x42aa20){_0x3427a8=_0x42aa20[_0x014e('0x32')];if(!_0x4e02f5['query'][_0x014e('0x4b')]('nolimit')){_0x3e0ca8['limit']=qs[_0x014e('0x1a')](_0x4e02f5['query'][_0x014e('0x1a')]);_0x3e0ca8[_0x014e('0x1b')]=qs['offset'](_0x4e02f5[_0x014e('0x2c')][_0x014e('0x1b')]);}return _0x36596c[_0x014e('0x49')](_0x3e0ca8);}})['then'](function(_0x479ba6){if(_0x479ba6){return _0x479ba6?{'count':_0x3427a8,'rows':_0x479ba6}:null;}})['then'](respondWithResult(_0x2aa6b5,null))[_0x014e('0x3e')](handleError(_0x2aa6b5,null));};exports[_0x014e('0x4c')]=function(_0x26b9fc,_0x36993a,_0x2bb47f){var _0xb7d44c={};var _0x43980a={};var _0x390606;var _0x28a6f9;return db[_0x014e('0x29')][_0x014e('0x4a')]({'where':{'id':_0x26b9fc[_0x014e('0x42')]['id']}})[_0x014e('0x21')](handleEntityNotFound(_0x36993a,null))[_0x014e('0x21')](function(_0x357bc6){if(_0x357bc6){_0x390606=_0x357bc6;_0x43980a['model']=_[_0x014e('0x2d')](db[_0x014e('0x44')]['rawAttributes']);_0x43980a[_0x014e('0x2c')]=_[_0x014e('0x2d')](_0x26b9fc[_0x014e('0x2c')]);_0x43980a[_0x014e('0x2e')]=_[_0x014e('0x2f')](_0x43980a[_0x014e('0x2a')],_0x43980a[_0x014e('0x2c')]);_0xb7d44c['attributes']=_[_0x014e('0x2f')](_0x43980a[_0x014e('0x2a')],qs[_0x014e('0x31')](_0x26b9fc[_0x014e('0x2c')]['fields']));_0xb7d44c[_0x014e('0x30')]=_0xb7d44c[_0x014e('0x30')][_0x014e('0x32')]?_0xb7d44c['attributes']:_0x43980a[_0x014e('0x2a')];_0xb7d44c[_0x014e('0x45')]=qs['sort'](_0x26b9fc[_0x014e('0x2c')][_0x014e('0x33')]);_0xb7d44c['where']=qs['filters'](_[_0x014e('0x46')](_0x26b9fc[_0x014e('0x2c')],_0x43980a[_0x014e('0x2e')]));if(_0x26b9fc[_0x014e('0x2c')][_0x014e('0x47')]){_0xb7d44c[_0x014e('0x34')]=_[_0x014e('0x35')](_0xb7d44c['where'],{'$or':_[_0x014e('0x28')](_0xb7d44c[_0x014e('0x30')],function(_0x3c776e){var _0x3db7f9={};_0x3db7f9[_0x3c776e]={'$like':'%'+_0x26b9fc[_0x014e('0x2c')]['filter']+'%'};return _0x3db7f9;})});}_0xb7d44c=_[_0x014e('0x35')]({},_0xb7d44c,_0x26b9fc[_0x014e('0x3d')]);return _0x390606[_0x014e('0x4c')](_0xb7d44c);}})[_0x014e('0x21')](function(_0x4914b1){if(_0x4914b1){_0x28a6f9=_0x4914b1[_0x014e('0x32')];if(!_0x26b9fc['query']['hasOwnProperty'](_0x014e('0x48'))){_0xb7d44c[_0x014e('0x1a')]=qs[_0x014e('0x1a')](_0x26b9fc[_0x014e('0x2c')][_0x014e('0x1a')]);_0xb7d44c[_0x014e('0x1b')]=qs[_0x014e('0x1b')](_0x26b9fc[_0x014e('0x2c')][_0x014e('0x1b')]);}return _0x390606[_0x014e('0x4c')](_0xb7d44c);}})[_0x014e('0x21')](function(_0x108022){if(_0x108022){return _0x108022?{'count':_0x28a6f9,'rows':_0x108022}:null;}})[_0x014e('0x21')](respondWithResult(_0x36993a,null))[_0x014e('0x3e')](handleError(_0x36993a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 51d9b6f..f0f49cc 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 _0xa9a3=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3e94b1,_0x14218b){var _0x4b8663=function(_0x138ce0){while(--_0x138ce0){_0x3e94b1['push'](_0x3e94b1['shift']());}};_0x4b8663(++_0x14218b);}(_0xa9a3,0x13e));var _0x3a9a=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xa9a3[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x3a9a('0x0'));var util=require(_0x3a9a('0x1'));var logger=require(_0x3a9a('0x2'))('api');var moment=require(_0x3a9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a9a('0x4'));var fs=require('fs');var path=require(_0x3a9a('0x5'));var rimraf=require(_0x3a9a('0x6'));var config=require(_0x3a9a('0x7'));var attributes=require(_0x3a9a('0x8'));module[_0x3a9a('0x9')]=function(_0x59daf6,_0x4d3ad7){return _0x59daf6[_0x3a9a('0xa')](_0x3a9a('0xb'),attributes,{'tableName':_0x3a9a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf898=['lodash','util','api','moment','bluebird','request-promise','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf898,0x14d));var _0x8f89=function(_0x4fad3b,_0x5a0d82){_0x4fad3b=_0x4fad3b-0x0;var _0x2b80ec=_0xf898[_0x4fad3b];return _0x2b80ec;};'use strict';var _=require(_0x8f89('0x0'));var util=require(_0x8f89('0x1'));var logger=require('../../config/logger')(_0x8f89('0x2'));var moment=require(_0x8f89('0x3'));var BPromise=require(_0x8f89('0x4'));var rp=require(_0x8f89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f89('0x6'));module[_0x8f89('0x7')]=function(_0x19321c,_0x43f8ee){return _0x19321c[_0x8f89('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index c7ff07d..2bb0137 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 _0x18e6=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x18e6,0x17a));var _0x618e=function(_0x339cd3,_0x23be07){_0x339cd3=_0x339cd3-0x0;var _0x1d09ce=_0x18e6[_0x339cd3];return _0x1d09ce;};'use strict';var _=require(_0x618e('0x0'));var util=require(_0x618e('0x1'));var moment=require(_0x618e('0x2'));var BPromise=require(_0x618e('0x3'));var rs=require(_0x618e('0x4'));var fs=require('fs');var Redis=require(_0x618e('0x5'));var db=require(_0x618e('0x6'))['db'];var utils=require(_0x618e('0x7'));var logger=require('../../config/logger')(_0x618e('0x8'));var config=require(_0x618e('0x9'));var jayson=require(_0x618e('0xa'));var client=jayson[_0x618e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ba484,_0x4d4e13,_0x29fa03){return new BPromise(function(_0x262bf7,_0x24543c){return client[_0x618e('0xc')](_0x4ba484,_0x29fa03)[_0x618e('0xd')](function(_0x29fa65){logger[_0x618e('0xe')](_0x618e('0xf'),_0x4d4e13,_0x618e('0x10'));logger['debug'](_0x618e('0x11'),_0x4d4e13,_0x618e('0x10'),JSON[_0x618e('0x12')](_0x29fa65));if(_0x29fa65['error']){if(_0x29fa65['error'][_0x618e('0x13')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d4e13,_0x29fa65[_0x618e('0x14')]['message']);return _0x24543c(_0x29fa65[_0x618e('0x14')][_0x618e('0x15')]);}logger[_0x618e('0x14')](_0x618e('0xf'),_0x4d4e13,_0x29fa65[_0x618e('0x14')]['message']);return _0x262bf7(_0x29fa65[_0x618e('0x14')][_0x618e('0x15')]);}else{logger[_0x618e('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d4e13,_0x618e('0x10'));_0x262bf7(_0x29fa65[_0x618e('0x16')][_0x618e('0x15')]);}})[_0x618e('0x17')](function(_0x186cb8){logger[_0x618e('0x14')](_0x618e('0xf'),_0x4d4e13,_0x186cb8);_0x24543c(_0x186cb8);});});} \ No newline at end of file +var _0x1324=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1324,0x17b));var _0x4132=function(_0x9ec5ea,_0x10b401){_0x9ec5ea=_0x9ec5ea-0x0;var _0x4f0d51=_0x1324[_0x9ec5ea];return _0x4f0d51;};'use strict';var _=require(_0x4132('0x0'));var util=require(_0x4132('0x1'));var moment=require(_0x4132('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4132('0x3'));var db=require(_0x4132('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4132('0x5'))(_0x4132('0x6'));var config=require(_0x4132('0x7'));var jayson=require(_0x4132('0x8'));var client=jayson['client'][_0x4132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x141f20,_0x1ce35a,_0x17e4c7){return new BPromise(function(_0x33cf74,_0x517bcc){return client[_0x4132('0xa')](_0x141f20,_0x17e4c7)[_0x4132('0xb')](function(_0x2a8bfb){logger[_0x4132('0xc')](_0x4132('0xd'),_0x1ce35a,_0x4132('0xe'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1ce35a,_0x4132('0xe'),JSON[_0x4132('0xf')](_0x2a8bfb));if(_0x2a8bfb[_0x4132('0x10')]){if(_0x2a8bfb[_0x4132('0x10')][_0x4132('0x11')]===0x1f4){logger[_0x4132('0x10')](_0x4132('0xd'),_0x1ce35a,_0x2a8bfb['error'][_0x4132('0x12')]);return _0x517bcc(_0x2a8bfb[_0x4132('0x10')]['message']);}logger[_0x4132('0x10')](_0x4132('0xd'),_0x1ce35a,_0x2a8bfb[_0x4132('0x10')]['message']);return _0x33cf74(_0x2a8bfb[_0x4132('0x10')]['message']);}else{logger[_0x4132('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ce35a,_0x4132('0xe'));_0x33cf74(_0x2a8bfb[_0x4132('0x13')][_0x4132('0x12')]);}})[_0x4132('0x14')](function(_0x525842){logger[_0x4132('0x10')](_0x4132('0xd'),_0x1ce35a,_0x525842);_0x517bcc(_0x525842);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 71de3b9..9d656f7 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 _0x8f7d=['/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8f7d,0x19f));var _0xd8f7=function(_0x5a1d39,_0x5a9dbf){_0x5a1d39=_0x5a1d39-0x0;var _0x3a77f2=_0x8f7d[_0x5a1d39];return _0x3a77f2;};'use strict';var multer=require(_0xd8f7('0x0'));var util=require(_0xd8f7('0x1'));var path=require(_0xd8f7('0x2'));var timeout=require(_0xd8f7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd8f7('0x4'));var auth=require(_0xd8f7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8f7('0x6'));router[_0xd8f7('0x7')]('/',auth[_0xd8f7('0x8')](),controller[_0xd8f7('0x9')]);router[_0xd8f7('0x7')](_0xd8f7('0xa'),auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xb')]);router['post']('/',auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xc')]);router['put'](_0xd8f7('0xa'),auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xd')]);router[_0xd8f7('0xe')]('/:id',auth[_0xd8f7('0x8')](),controller[_0xd8f7('0xf')]);module[_0xd8f7('0x10')]=router; \ No newline at end of file +var _0x9364=['fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','show','post','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0xd8312,_0x149ae6){var _0x1967f8=function(_0x38e269){while(--_0x38e269){_0xd8312['push'](_0xd8312['shift']());}};_0x1967f8(++_0x149ae6);}(_0x9364,0x1e9));var _0x4936=function(_0x9f1571,_0x28d299){_0x9f1571=_0x9f1571-0x0;var _0x564171=_0x9364[_0x9f1571];return _0x564171;};'use strict';var multer=require(_0x4936('0x0'));var util=require(_0x4936('0x1'));var path=require('path');var timeout=require(_0x4936('0x2'));var express=require(_0x4936('0x3'));var router=express[_0x4936('0x4')]();var fs_extra=require(_0x4936('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4936('0x6'));var config=require(_0x4936('0x7'));var controller=require(_0x4936('0x8'));router[_0x4936('0x9')]('/',auth['isAuthenticated'](),controller[_0x4936('0xa')]);router['get'](_0x4936('0xb'),auth['isAuthenticated'](),controller[_0x4936('0xc')]);router[_0x4936('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4936('0xb'),auth[_0x4936('0xe')](),controller[_0x4936('0xf')]);router[_0x4936('0x10')](_0x4936('0xb'),auth['isAuthenticated'](),controller[_0x4936('0x11')]);module[_0x4936('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index d4c80ed..1ebd51f 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 _0x0124=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x0124,0x19a));var _0x4012=function(_0x4f8d4b,_0x1b739d){_0x4f8d4b=_0x4f8d4b-0x0;var _0x19c786=_0x0124[_0x4f8d4b];return _0x19c786;};'use strict';var Sequelize=require(_0x4012('0x0'));module[_0x4012('0x1')]={'type':{'type':Sequelize[_0x4012('0x2')](_0x4012('0x3'),_0x4012('0x4'),_0x4012('0x5'),_0x4012('0x6'),'picklist'),'defaultValue':_0x4012('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4012('0x2')](_0x4012('0x3'),_0x4012('0x4'),_0x4012('0x5'))},'keyContent':{'type':Sequelize[_0x4012('0x7')]},'idField':{'type':Sequelize[_0x4012('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4012('0x7')]}}; \ No newline at end of file +var _0x53c6=['keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x45bf7f,_0x4e5f06){var _0x2b5458=function(_0x4f5934){while(--_0x4f5934){_0x45bf7f['push'](_0x45bf7f['shift']());}};_0x2b5458(++_0x4e5f06);}(_0x53c6,0x136));var _0x653c=function(_0x5a2d28,_0x1b9af8){_0x5a2d28=_0x5a2d28-0x0;var _0x346c9c=_0x53c6[_0x5a2d28];return _0x346c9c;};'use strict';var Sequelize=require(_0x653c('0x0'));module[_0x653c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x653c('0x2'),_0x653c('0x3'),_0x653c('0x4'),_0x653c('0x5'),'picklist'),'defaultValue':_0x653c('0x2')},'content':{'type':Sequelize[_0x653c('0x6')]},'key':{'type':Sequelize[_0x653c('0x6')]},'keyType':{'type':Sequelize[_0x653c('0x7')](_0x653c('0x2'),_0x653c('0x3'),_0x653c('0x4'))},'keyContent':{'type':Sequelize[_0x653c('0x6')]},'idField':{'type':Sequelize[_0x653c('0x6')]},'nameField':{'type':Sequelize[_0x653c('0x6')]},'customField':{'type':Sequelize[_0x653c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1dc7a6c..8b82494 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 _0x5011=['options','includeAll','include','findAll','rows','catch','show','params','find','SugarcrmField','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x47a935,_0x3aad48){var _0x2eb1d7=function(_0x38f80e){while(--_0x38f80e){_0x47a935['push'](_0x47a935['shift']());}};_0x2eb1d7(++_0x3aad48);}(_0x5011,0xf0));var _0x1501=function(_0x220d5b,_0x290a1f){_0x220d5b=_0x220d5b-0x0;var _0x54ce5f=_0x5011[_0x220d5b];return _0x54ce5f;};'use strict';var emlformat=require(_0x1501('0x0'));var rimraf=require(_0x1501('0x1'));var zipdir=require(_0x1501('0x2'));var jsonpatch=require(_0x1501('0x3'));var rp=require(_0x1501('0x4'));var moment=require(_0x1501('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1501('0x6'));var util=require(_0x1501('0x7'));var path=require(_0x1501('0x8'));var sox=require(_0x1501('0x9'));var csv=require(_0x1501('0xa'));var ejs=require(_0x1501('0xb'));var fs=require('fs');var fs_extra=require(_0x1501('0xc'));var _=require(_0x1501('0xd'));var squel=require(_0x1501('0xe'));var crypto=require(_0x1501('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1501('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1501('0x11'));var Papa=require(_0x1501('0x12'));var Redis=require('ioredis');var authService=require(_0x1501('0x13'));var qs=require(_0x1501('0x14'));var as=require(_0x1501('0x15'));var hardwareService=require(_0x1501('0x16'));var logger=require(_0x1501('0x17'))('api');var utils=require(_0x1501('0x18'));var config=require(_0x1501('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1501('0x1a'))['db'];function respondWithStatusCode(_0x5074ac,_0x5274b9){_0x5274b9=_0x5274b9||0xcc;return function(_0x307d91){if(_0x307d91){return _0x5074ac['sendStatus'](_0x5274b9);}return _0x5074ac[_0x1501('0x1b')](_0x5274b9)[_0x1501('0x1c')]();};}function respondWithResult(_0x4e0ec6,_0x5e9c3f){_0x5e9c3f=_0x5e9c3f||0xc8;return function(_0x40c2e8){if(_0x40c2e8){return _0x4e0ec6['status'](_0x5e9c3f)[_0x1501('0x1d')](_0x40c2e8);}};}function respondWithFilteredResult(_0x1afe17,_0xe1dab0){return function(_0x4d837c){if(_0x4d837c){var _0x19646e=typeof _0xe1dab0[_0x1501('0x1e')]===_0x1501('0x1f')&&typeof _0xe1dab0[_0x1501('0x20')]===_0x1501('0x1f');var _0x5a931d=_0x4d837c[_0x1501('0x21')];var _0x10205f=_0x19646e?0x0:_0xe1dab0[_0x1501('0x1e')];var _0x17f633=_0x19646e?_0x4d837c[_0x1501('0x21')]:_0xe1dab0[_0x1501('0x1e')]+_0xe1dab0[_0x1501('0x20')];var _0x4bb983;if(_0x17f633>=_0x5a931d){_0x17f633=_0x5a931d;_0x4bb983=0xc8;}else{_0x4bb983=0xce;}_0x1afe17[_0x1501('0x1b')](_0x4bb983);return _0x1afe17[_0x1501('0x22')](_0x1501('0x23'),_0x10205f+'-'+_0x17f633+'/'+_0x5a931d)[_0x1501('0x1d')](_0x4d837c);}return null;};}function patchUpdates(_0x189ab6){return function(_0x1d3873){try{jsonpatch[_0x1501('0x24')](_0x1d3873,_0x189ab6,!![]);}catch(_0x352da1){return BPromise[_0x1501('0x25')](_0x352da1);}return _0x1d3873[_0x1501('0x26')]();};}function saveUpdates(_0x44bee2,_0xef465e){return function(_0x26a71c){if(_0x26a71c){return _0x26a71c[_0x1501('0x27')](_0x44bee2)[_0x1501('0x28')](function(_0x346a97){return _0x346a97;});}return null;};}function removeEntity(_0x3361e4,_0x20fe00){return function(_0x1b8435){if(_0x1b8435){return _0x1b8435[_0x1501('0x29')]()[_0x1501('0x28')](function(){_0x3361e4[_0x1501('0x1b')](0xcc)[_0x1501('0x1c')]();});}};}function handleEntityNotFound(_0x29cb74,_0xb512cf){return function(_0x14aa18){if(!_0x14aa18){_0x29cb74[_0x1501('0x2a')](0x194);}return _0x14aa18;};}function handleError(_0x3beb20,_0x25f79c){_0x25f79c=_0x25f79c||0x1f4;return function(_0x407125){logger[_0x1501('0x2b')](_0x407125[_0x1501('0x2c')]);if(_0x407125['name']){delete _0x407125[_0x1501('0x2d')];}_0x3beb20[_0x1501('0x1b')](_0x25f79c)[_0x1501('0x2e')](_0x407125);};}exports['index']=function(_0x115ea2,_0xfa7e0a){var _0x44afbc={},_0x3763c3={},_0x1156f5={'count':0x0,'rows':[]};var _0x39a729=_[_0x1501('0x2f')](db['SugarcrmField']['rawAttributes'],function(_0x57fc0f){return{'name':_0x57fc0f[_0x1501('0x30')],'type':_0x57fc0f[_0x1501('0x31')]['key']};});_0x3763c3[_0x1501('0x32')]=_['map'](_0x39a729,_0x1501('0x2d'));_0x3763c3[_0x1501('0x33')]=_['keys'](_0x115ea2[_0x1501('0x33')]);_0x3763c3[_0x1501('0x34')]=_[_0x1501('0x35')](_0x3763c3[_0x1501('0x32')],_0x3763c3[_0x1501('0x33')]);_0x44afbc[_0x1501('0x36')]=_[_0x1501('0x35')](_0x3763c3[_0x1501('0x32')],qs[_0x1501('0x37')](_0x115ea2[_0x1501('0x33')][_0x1501('0x37')]));_0x44afbc['attributes']=_0x44afbc[_0x1501('0x36')]['length']?_0x44afbc[_0x1501('0x36')]:_0x3763c3[_0x1501('0x32')];if(!_0x115ea2['query'][_0x1501('0x38')](_0x1501('0x39'))){_0x44afbc[_0x1501('0x20')]=qs[_0x1501('0x20')](_0x115ea2[_0x1501('0x33')]['limit']);_0x44afbc['offset']=qs[_0x1501('0x1e')](_0x115ea2['query'][_0x1501('0x1e')]);}_0x44afbc['order']=qs['sort'](_0x115ea2[_0x1501('0x33')][_0x1501('0x3a')]);_0x44afbc[_0x1501('0x3b')]=qs['filters'](_[_0x1501('0x3c')](_0x115ea2[_0x1501('0x33')],_0x3763c3['filters']),_0x39a729);if(_0x115ea2[_0x1501('0x33')][_0x1501('0x3d')]){_0x44afbc[_0x1501('0x3b')]=_[_0x1501('0x3e')](_0x44afbc[_0x1501('0x3b')],{'$or':_[_0x1501('0x2f')](_0x39a729,function(_0x38a3cb){if(_0x38a3cb[_0x1501('0x31')]!==_0x1501('0x3f')){var _0x383c63={};_0x383c63[_0x38a3cb[_0x1501('0x2d')]]={'$like':'%'+_0x115ea2[_0x1501('0x33')][_0x1501('0x3d')]+'%'};return _0x383c63;}})});}_0x44afbc=_[_0x1501('0x3e')]({},_0x44afbc,_0x115ea2[_0x1501('0x40')]);var _0x286d28={'where':_0x44afbc['where']};return db['SugarcrmField'][_0x1501('0x21')](_0x286d28)[_0x1501('0x28')](function(_0x1fdd37){_0x1156f5[_0x1501('0x21')]=_0x1fdd37;if(_0x115ea2[_0x1501('0x33')][_0x1501('0x41')]){_0x44afbc[_0x1501('0x42')]=[{'all':!![]}];}return db['SugarcrmField'][_0x1501('0x43')](_0x44afbc);})[_0x1501('0x28')](function(_0x26d9ae){_0x1156f5[_0x1501('0x44')]=_0x26d9ae;return _0x1156f5;})['then'](respondWithFilteredResult(_0xfa7e0a,_0x44afbc))[_0x1501('0x45')](handleError(_0xfa7e0a,null));};exports[_0x1501('0x46')]=function(_0x4c65f9,_0x520358){var _0x4d99c={'raw':!![],'where':{'id':_0x4c65f9[_0x1501('0x47')]['id']}},_0x4c4492={};_0x4c4492[_0x1501('0x32')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x4c4492['query']=_['keys'](_0x4c65f9['query']);_0x4c4492[_0x1501('0x34')]=_[_0x1501('0x35')](_0x4c4492['model'],_0x4c4492[_0x1501('0x33')]);_0x4d99c[_0x1501('0x36')]=_[_0x1501('0x35')](_0x4c4492['model'],qs['fields'](_0x4c65f9[_0x1501('0x33')][_0x1501('0x37')]));_0x4d99c[_0x1501('0x36')]=_0x4d99c[_0x1501('0x36')]['length']?_0x4d99c[_0x1501('0x36')]:_0x4c4492[_0x1501('0x32')];if(_0x4c65f9[_0x1501('0x33')][_0x1501('0x41')]){_0x4d99c[_0x1501('0x42')]=[{'all':!![]}];}_0x4d99c=_['merge']({},_0x4d99c,_0x4c65f9[_0x1501('0x40')]);return db['SugarcrmField'][_0x1501('0x48')](_0x4d99c)[_0x1501('0x28')](handleEntityNotFound(_0x520358,null))[_0x1501('0x28')](respondWithResult(_0x520358,null))[_0x1501('0x45')](handleError(_0x520358,null));};exports['create']=function(_0x507cdb,_0x8bd1d6){return db[_0x1501('0x49')][_0x1501('0x4a')](_0x507cdb[_0x1501('0x4b')],{})['then'](respondWithResult(_0x8bd1d6,0xc9))[_0x1501('0x45')](handleError(_0x8bd1d6,null));};exports[_0x1501('0x27')]=function(_0x27e138,_0x3e7fae){if(_0x27e138[_0x1501('0x4b')]['id']){delete _0x27e138[_0x1501('0x4b')]['id'];}return db[_0x1501('0x49')]['find']({'where':{'id':_0x27e138[_0x1501('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e7fae,null))['then'](saveUpdates(_0x27e138[_0x1501('0x4b')],null))[_0x1501('0x28')](respondWithResult(_0x3e7fae,null))[_0x1501('0x45')](handleError(_0x3e7fae,null));};exports['destroy']=function(_0x224cae,_0xdca80b){return db['SugarcrmField'][_0x1501('0x48')]({'where':{'id':_0x224cae[_0x1501('0x47')]['id']}})[_0x1501('0x28')](handleEntityNotFound(_0xdca80b,null))[_0x1501('0x28')](removeEntity(_0xdca80b,null))[_0x1501('0x45')](handleError(_0xdca80b,null));}; \ No newline at end of file +var _0x1b40=['util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','destroy','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','SugarcrmField','includeAll','findAll','rows','then','catch','show','rawAttributes','length','include','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x4a65ac,_0x23e838){var _0x4562f3=function(_0x4896d8){while(--_0x4896d8){_0x4a65ac['push'](_0x4a65ac['shift']());}};_0x4562f3(++_0x23e838);}(_0x1b40,0x170));var _0x01b4=function(_0x34b624,_0x27cf25){_0x34b624=_0x34b624-0x0;var _0x58fe99=_0x1b40[_0x34b624];return _0x58fe99;};'use strict';var emlformat=require(_0x01b4('0x0'));var rimraf=require(_0x01b4('0x1'));var zipdir=require(_0x01b4('0x2'));var jsonpatch=require(_0x01b4('0x3'));var rp=require(_0x01b4('0x4'));var moment=require(_0x01b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x01b4('0x6'));var util=require(_0x01b4('0x7'));var path=require('path');var sox=require(_0x01b4('0x8'));var csv=require(_0x01b4('0x9'));var ejs=require(_0x01b4('0xa'));var fs=require('fs');var fs_extra=require(_0x01b4('0xb'));var _=require('lodash');var squel=require(_0x01b4('0xc'));var crypto=require(_0x01b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x01b4('0xe'));var toCsv=require(_0x01b4('0x9'));var querystring=require('querystring');var Papa=require(_0x01b4('0xf'));var Redis=require(_0x01b4('0x10'));var authService=require(_0x01b4('0x11'));var qs=require(_0x01b4('0x12'));var as=require(_0x01b4('0x13'));var hardwareService=require(_0x01b4('0x14'));var logger=require(_0x01b4('0x15'))('api');var utils=require(_0x01b4('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01b4('0x17'))['db'];function respondWithStatusCode(_0x4d114a,_0x4957d9){_0x4957d9=_0x4957d9||0xcc;return function(_0x26a397){if(_0x26a397){return _0x4d114a[_0x01b4('0x18')](_0x4957d9);}return _0x4d114a[_0x01b4('0x19')](_0x4957d9)[_0x01b4('0x1a')]();};}function respondWithResult(_0x5940cd,_0x1622f8){_0x1622f8=_0x1622f8||0xc8;return function(_0x4e2fee){if(_0x4e2fee){return _0x5940cd[_0x01b4('0x19')](_0x1622f8)[_0x01b4('0x1b')](_0x4e2fee);}};}function respondWithFilteredResult(_0x3c12e8,_0x2e14a5){return function(_0x2ca2c7){if(_0x2ca2c7){var _0x4449f2=typeof _0x2e14a5['offset']===_0x01b4('0x1c')&&typeof _0x2e14a5[_0x01b4('0x1d')]==='undefined';var _0x297ae5=_0x2ca2c7[_0x01b4('0x1e')];var _0x40d4ad=_0x4449f2?0x0:_0x2e14a5['offset'];var _0x2266ba=_0x4449f2?_0x2ca2c7[_0x01b4('0x1e')]:_0x2e14a5[_0x01b4('0x1f')]+_0x2e14a5['limit'];var _0x48d4e6;if(_0x2266ba>=_0x297ae5){_0x2266ba=_0x297ae5;_0x48d4e6=0xc8;}else{_0x48d4e6=0xce;}_0x3c12e8[_0x01b4('0x19')](_0x48d4e6);return _0x3c12e8[_0x01b4('0x20')](_0x01b4('0x21'),_0x40d4ad+'-'+_0x2266ba+'/'+_0x297ae5)[_0x01b4('0x1b')](_0x2ca2c7);}return null;};}function patchUpdates(_0x275db4){return function(_0x39222a){try{jsonpatch['apply'](_0x39222a,_0x275db4,!![]);}catch(_0x3a2e9e){return BPromise[_0x01b4('0x22')](_0x3a2e9e);}return _0x39222a['save']();};}function saveUpdates(_0x5ab2fc,_0x454766){return function(_0x5d3dec){if(_0x5d3dec){return _0x5d3dec['update'](_0x5ab2fc)['then'](function(_0x564345){return _0x564345;});}return null;};}function removeEntity(_0x56fa8f,_0x2f75aa){return function(_0x21dc50){if(_0x21dc50){return _0x21dc50[_0x01b4('0x23')]()['then'](function(){_0x56fa8f[_0x01b4('0x19')](0xcc)[_0x01b4('0x1a')]();});}};}function handleEntityNotFound(_0x4666d8,_0x171ab6){return function(_0x48b24a){if(!_0x48b24a){_0x4666d8[_0x01b4('0x18')](0x194);}return _0x48b24a;};}function handleError(_0x3c8c82,_0x1ec1d1){_0x1ec1d1=_0x1ec1d1||0x1f4;return function(_0x35b5f1){logger[_0x01b4('0x24')](_0x35b5f1[_0x01b4('0x25')]);if(_0x35b5f1[_0x01b4('0x26')]){delete _0x35b5f1['name'];}_0x3c8c82[_0x01b4('0x19')](_0x1ec1d1)[_0x01b4('0x27')](_0x35b5f1);};}exports[_0x01b4('0x28')]=function(_0x4176b0,_0x5a2349){var _0x623bf4={},_0x55b0dc={},_0x5d3caa={'count':0x0,'rows':[]};var _0x4f936b=_[_0x01b4('0x29')](db['SugarcrmField']['rawAttributes'],function(_0x5843b9){return{'name':_0x5843b9['fieldName'],'type':_0x5843b9['type'][_0x01b4('0x2a')]};});_0x55b0dc[_0x01b4('0x2b')]=_[_0x01b4('0x29')](_0x4f936b,_0x01b4('0x26'));_0x55b0dc[_0x01b4('0x2c')]=_[_0x01b4('0x2d')](_0x4176b0['query']);_0x55b0dc[_0x01b4('0x2e')]=_[_0x01b4('0x2f')](_0x55b0dc[_0x01b4('0x2b')],_0x55b0dc['query']);_0x623bf4[_0x01b4('0x30')]=_['intersection'](_0x55b0dc['model'],qs[_0x01b4('0x31')](_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x31')]));_0x623bf4[_0x01b4('0x30')]=_0x623bf4[_0x01b4('0x30')]['length']?_0x623bf4[_0x01b4('0x30')]:_0x55b0dc[_0x01b4('0x2b')];if(!_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x32')](_0x01b4('0x33'))){_0x623bf4['limit']=qs[_0x01b4('0x1d')](_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x1d')]);_0x623bf4[_0x01b4('0x1f')]=qs[_0x01b4('0x1f')](_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x1f')]);}_0x623bf4[_0x01b4('0x34')]=qs[_0x01b4('0x35')](_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x35')]);_0x623bf4[_0x01b4('0x36')]=qs[_0x01b4('0x2e')](_['pick'](_0x4176b0[_0x01b4('0x2c')],_0x55b0dc[_0x01b4('0x2e')]),_0x4f936b);if(_0x4176b0[_0x01b4('0x2c')]['filter']){_0x623bf4['where']=_[_0x01b4('0x37')](_0x623bf4[_0x01b4('0x36')],{'$or':_[_0x01b4('0x29')](_0x4f936b,function(_0x2af685){if(_0x2af685[_0x01b4('0x38')]!==_0x01b4('0x39')){var _0xf5cdaf={};_0xf5cdaf[_0x2af685[_0x01b4('0x26')]]={'$like':'%'+_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x3a')]+'%'};return _0xf5cdaf;}})});}_0x623bf4=_[_0x01b4('0x37')]({},_0x623bf4,_0x4176b0[_0x01b4('0x3b')]);var _0x16ae2f={'where':_0x623bf4[_0x01b4('0x36')]};return db[_0x01b4('0x3c')][_0x01b4('0x1e')](_0x16ae2f)['then'](function(_0xfcaef8){_0x5d3caa[_0x01b4('0x1e')]=_0xfcaef8;if(_0x4176b0[_0x01b4('0x2c')][_0x01b4('0x3d')]){_0x623bf4['include']=[{'all':!![]}];}return db[_0x01b4('0x3c')][_0x01b4('0x3e')](_0x623bf4);})['then'](function(_0xad6baf){_0x5d3caa[_0x01b4('0x3f')]=_0xad6baf;return _0x5d3caa;})[_0x01b4('0x40')](respondWithFilteredResult(_0x5a2349,_0x623bf4))[_0x01b4('0x41')](handleError(_0x5a2349,null));};exports[_0x01b4('0x42')]=function(_0x1ccd1b,_0x535109){var _0xff9b32={'raw':!![],'where':{'id':_0x1ccd1b['params']['id']}},_0x540980={};_0x540980['model']=_['keys'](db['SugarcrmField'][_0x01b4('0x43')]);_0x540980[_0x01b4('0x2c')]=_[_0x01b4('0x2d')](_0x1ccd1b[_0x01b4('0x2c')]);_0x540980[_0x01b4('0x2e')]=_[_0x01b4('0x2f')](_0x540980[_0x01b4('0x2b')],_0x540980[_0x01b4('0x2c')]);_0xff9b32['attributes']=_['intersection'](_0x540980[_0x01b4('0x2b')],qs[_0x01b4('0x31')](_0x1ccd1b[_0x01b4('0x2c')]['fields']));_0xff9b32['attributes']=_0xff9b32[_0x01b4('0x30')][_0x01b4('0x44')]?_0xff9b32['attributes']:_0x540980[_0x01b4('0x2b')];if(_0x1ccd1b['query'][_0x01b4('0x3d')]){_0xff9b32[_0x01b4('0x45')]=[{'all':!![]}];}_0xff9b32=_[_0x01b4('0x37')]({},_0xff9b32,_0x1ccd1b[_0x01b4('0x3b')]);return db[_0x01b4('0x3c')][_0x01b4('0x46')](_0xff9b32)['then'](handleEntityNotFound(_0x535109,null))[_0x01b4('0x40')](respondWithResult(_0x535109,null))[_0x01b4('0x41')](handleError(_0x535109,null));};exports[_0x01b4('0x47')]=function(_0x25bff3,_0x3d27e4){return db[_0x01b4('0x3c')][_0x01b4('0x47')](_0x25bff3['body'],{})[_0x01b4('0x40')](respondWithResult(_0x3d27e4,0xc9))[_0x01b4('0x41')](handleError(_0x3d27e4,null));};exports[_0x01b4('0x48')]=function(_0x2601b3,_0x3c1b23){if(_0x2601b3['body']['id']){delete _0x2601b3['body']['id'];}return db[_0x01b4('0x3c')][_0x01b4('0x46')]({'where':{'id':_0x2601b3['params']['id']}})[_0x01b4('0x40')](handleEntityNotFound(_0x3c1b23,null))[_0x01b4('0x40')](saveUpdates(_0x2601b3[_0x01b4('0x49')],null))[_0x01b4('0x40')](respondWithResult(_0x3c1b23,null))[_0x01b4('0x41')](handleError(_0x3c1b23,null));};exports[_0x01b4('0x23')]=function(_0xcb5299,_0xbfc3fa){return db[_0x01b4('0x3c')][_0x01b4('0x46')]({'where':{'id':_0xcb5299[_0x01b4('0x4a')]['id']}})['then'](handleEntityNotFound(_0xbfc3fa,null))[_0x01b4('0x40')](removeEntity(_0xbfc3fa,null))[_0x01b4('0x41')](handleError(_0xbfc3fa,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index f64ffca..e5b8b5e 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 _0x8c7c=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','idField'];(function(_0x5e2c2c,_0x32d4b7){var _0x2c90ed=function(_0x387042){while(--_0x387042){_0x5e2c2c['push'](_0x5e2c2c['shift']());}};_0x2c90ed(++_0x32d4b7);}(_0x8c7c,0x151));var _0xc8c7=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x8c7c[_0x287059];return _0x225c79;};'use strict';var _=require(_0xc8c7('0x0'));var util=require('util');var logger=require(_0xc8c7('0x1'))(_0xc8c7('0x2'));var moment=require(_0xc8c7('0x3'));var BPromise=require(_0xc8c7('0x4'));var rp=require(_0xc8c7('0x5'));var fs=require('fs');var path=require(_0xc8c7('0x6'));var rimraf=require('rimraf');var config=require(_0xc8c7('0x7'));var attributes=require(_0xc8c7('0x8'));module[_0xc8c7('0x9')]=function(_0x52c97f,_0x417a50){return _0x52c97f['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xc8c7('0xa'),_0xc8c7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99a6=['moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','../../config/logger','api'];(function(_0x514eba,_0x239f8a){var _0x143919=function(_0x405b16){while(--_0x405b16){_0x514eba['push'](_0x514eba['shift']());}};_0x143919(++_0x239f8a);}(_0x99a6,0x10b));var _0x699a=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x99a6[_0x1e06f1];return _0x34f77e;};'use strict';var _=require(_0x699a('0x0'));var util=require('util');var logger=require(_0x699a('0x1'))(_0x699a('0x2'));var moment=require(_0x699a('0x3'));var BPromise=require(_0x699a('0x4'));var rp=require(_0x699a('0x5'));var fs=require('fs');var path=require(_0x699a('0x6'));var rimraf=require(_0x699a('0x7'));var config=require('../../config/environment');var attributes=require(_0x699a('0x8'));module[_0x699a('0x9')]=function(_0x3da3c9,_0x23b5ad){return _0x3da3c9[_0x699a('0xa')](_0x699a('0xb'),attributes,{'tableName':_0x699a('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x699a('0xd'),_0x699a('0xe')],'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 db9327c..128d0a7 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 _0xdf0f=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0xdf0f,0x120));var _0xfdf0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdf0f[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xfdf0('0x0'));var moment=require(_0xfdf0('0x1'));var BPromise=require(_0xfdf0('0x2'));var rs=require(_0xfdf0('0x3'));var fs=require('fs');var Redis=require(_0xfdf0('0x4'));var db=require(_0xfdf0('0x5'))['db'];var utils=require(_0xfdf0('0x6'));var logger=require('../../config/logger')(_0xfdf0('0x7'));var config=require('../../config/environment');var jayson=require(_0xfdf0('0x8'));var client=jayson[_0xfdf0('0x9')][_0xfdf0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x114978,_0x1dc879,_0xb18a56){return new BPromise(function(_0x3b92aa,_0x147ab1){return client[_0xfdf0('0xb')](_0x114978,_0xb18a56)[_0xfdf0('0xc')](function(_0x1a042a){logger[_0xfdf0('0xd')](_0xfdf0('0xe'),_0x1dc879,_0xfdf0('0xf'));logger['debug'](_0xfdf0('0x10'),_0x1dc879,_0xfdf0('0xf'),JSON[_0xfdf0('0x11')](_0x1a042a));if(_0x1a042a[_0xfdf0('0x12')]){if(_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x13')]===0x1f4){logger[_0xfdf0('0x12')](_0xfdf0('0xe'),_0x1dc879,_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x14')]);return _0x147ab1(_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x14')]);}logger[_0xfdf0('0x12')](_0xfdf0('0xe'),_0x1dc879,_0x1a042a['error'][_0xfdf0('0x14')]);return _0x3b92aa(_0x1a042a[_0xfdf0('0x12')][_0xfdf0('0x14')]);}else{logger[_0xfdf0('0xd')](_0xfdf0('0xe'),_0x1dc879,_0xfdf0('0xf'));_0x3b92aa(_0x1a042a[_0xfdf0('0x15')][_0xfdf0('0x14')]);}})[_0xfdf0('0x16')](function(_0x17a929){logger['error'](_0xfdf0('0xe'),_0x1dc879,_0x17a929);_0x147ab1(_0x17a929);});});} \ No newline at end of file +var _0x2ba8=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f1170,_0x3b5783){var _0x127b7b=function(_0x30c5ed){while(--_0x30c5ed){_0x1f1170['push'](_0x1f1170['shift']());}};_0x127b7b(++_0x3b5783);}(_0x2ba8,0xf6));var _0x82ba=function(_0x2e56a6,_0x1ba53a){_0x2e56a6=_0x2e56a6-0x0;var _0xec744c=_0x2ba8[_0x2e56a6];return _0xec744c;};'use strict';var _=require(_0x82ba('0x0'));var util=require('util');var moment=require(_0x82ba('0x1'));var BPromise=require(_0x82ba('0x2'));var rs=require(_0x82ba('0x3'));var fs=require('fs');var Redis=require(_0x82ba('0x4'));var db=require(_0x82ba('0x5'))['db'];var utils=require(_0x82ba('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x82ba('0x7'));var client=jayson['client'][_0x82ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ac763,_0x20238e,_0x53d69a){return new BPromise(function(_0xb96180,_0x5036b4){return client[_0x82ba('0x9')](_0x1ac763,_0x53d69a)[_0x82ba('0xa')](function(_0x2d0a1a){logger[_0x82ba('0xb')](_0x82ba('0xc'),_0x20238e,_0x82ba('0xd'));logger[_0x82ba('0xe')](_0x82ba('0xf'),_0x20238e,_0x82ba('0xd'),JSON[_0x82ba('0x10')](_0x2d0a1a));if(_0x2d0a1a[_0x82ba('0x11')]){if(_0x2d0a1a[_0x82ba('0x11')][_0x82ba('0x12')]===0x1f4){logger['error'](_0x82ba('0xc'),_0x20238e,_0x2d0a1a[_0x82ba('0x11')][_0x82ba('0x13')]);return _0x5036b4(_0x2d0a1a['error'][_0x82ba('0x13')]);}logger[_0x82ba('0x11')](_0x82ba('0xc'),_0x20238e,_0x2d0a1a[_0x82ba('0x11')][_0x82ba('0x13')]);return _0xb96180(_0x2d0a1a[_0x82ba('0x11')][_0x82ba('0x13')]);}else{logger['info'](_0x82ba('0xc'),_0x20238e,_0x82ba('0xd'));_0xb96180(_0x2d0a1a[_0x82ba('0x14')]['message']);}})[_0x82ba('0x15')](function(_0x3163d8){logger[_0x82ba('0x11')](_0x82ba('0xc'),_0x20238e,_0x3163d8);_0x5036b4(_0x3163d8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 0c4b710..2b0b111 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 _0x7884=['../../config/environment','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f95d8,_0x5e0e23){var _0x443e52=function(_0x5c1f1d){while(--_0x5c1f1d){_0x2f95d8['push'](_0x2f95d8['shift']());}};_0x443e52(++_0x5e0e23);}(_0x7884,0x10d));var _0x4788=function(_0x3fca21,_0x229278){_0x3fca21=_0x3fca21-0x0;var _0x229356=_0x7884[_0x3fca21];return _0x229356;};'use strict';var multer=require(_0x4788('0x0'));var util=require(_0x4788('0x1'));var path=require(_0x4788('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4788('0x3')]();var fs_extra=require(_0x4788('0x4'));var auth=require(_0x4788('0x5'));var interaction=require(_0x4788('0x6'));var config=require(_0x4788('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x4788('0x8')]('/',auth[_0x4788('0x9')](),controller[_0x4788('0xa')]);router[_0x4788('0x8')]('/:id',auth[_0x4788('0x9')](),controller['show']);router[_0x4788('0x8')](_0x4788('0xb'),auth['isAuthenticated'](),controller[_0x4788('0xc')]);router['get'](_0x4788('0xd'),auth['isAuthenticated'](),controller[_0x4788('0xe')]);router[_0x4788('0xf')]('/',auth['isAuthenticated'](),controller[_0x4788('0x10')]);router[_0x4788('0xf')](_0x4788('0xb'),auth[_0x4788('0x9')](),controller[_0x4788('0x11')]);router[_0x4788('0x12')](_0x4788('0x13'),auth[_0x4788('0x9')](),controller[_0x4788('0x14')]);router[_0x4788('0x15')](_0x4788('0x13'),auth[_0x4788('0x9')](),controller[_0x4788('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3e03=['./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','update','delete','destroy','multer','util','../../components/auth/service','../../config/environment'];(function(_0x3d7b17,_0x261ccb){var _0x50a8ea=function(_0x316014){while(--_0x316014){_0x3d7b17['push'](_0x3d7b17['shift']());}};_0x50a8ea(++_0x261ccb);}(_0x3e03,0xc2));var _0x33e0=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x3e03[_0x274dd7];return _0x148829;};'use strict';var multer=require(_0x33e0('0x0'));var util=require(_0x33e0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x33e0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x33e0('0x3'));var controller=require(_0x33e0('0x4'));router[_0x33e0('0x5')]('/',auth[_0x33e0('0x6')](),controller[_0x33e0('0x7')]);router['get'](_0x33e0('0x8'),auth['isAuthenticated'](),controller[_0x33e0('0x9')]);router[_0x33e0('0x5')](_0x33e0('0xa'),auth[_0x33e0('0x6')](),controller[_0x33e0('0xb')]);router[_0x33e0('0x5')](_0x33e0('0xc'),auth[_0x33e0('0x6')](),controller[_0x33e0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x33e0('0xa'),auth[_0x33e0('0x6')](),controller[_0x33e0('0xe')]);router['put'](_0x33e0('0x8'),auth['isAuthenticated'](),controller[_0x33e0('0xf')]);router[_0x33e0('0x10')](_0x33e0('0x8'),auth[_0x33e0('0x6')](),controller[_0x33e0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index bddf976..71cc49f 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 _0xede0=['sequelize','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xede0,0x86));var _0x0ede=function(_0x1cef54,_0xad4e01){_0x1cef54=_0x1cef54-0x0;var _0x59f1c9=_0xede0[_0x1cef54];return _0x59f1c9;};'use strict';var Sequelize=require(_0x0ede('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0ede('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x51dc=['sequelize','exports','STRING','HelpDesk'];(function(_0x1fe87,_0x376769){var _0x1c0eb3=function(_0x536b6a){while(--_0x536b6a){_0x1fe87['push'](_0x1fe87['shift']());}};_0x1c0eb3(++_0x376769);}(_0x51dc,0x94));var _0xc51d=function(_0x268ba8,_0x4981d6){_0x268ba8=_0x268ba8-0x0;var _0x42758a=_0x51dc[_0x268ba8];return _0x42758a;};'use strict';var Sequelize=require(_0xc51d('0x0'));module[_0xc51d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc51d('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc51d('0x2')],'allowNull':![],'defaultValue':_0xc51d('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xc51d('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xc51d('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 8145209..ddeb956 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 _0x44c9=['includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','findOne','VtigerConfiguration','addConfiguration','AccountId','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','description','moduleName','remoteUri','accessKey','username','slice','substring','format','%s/webservice.php','GET','getchallenge','success','login','result','describe','sessionName','reference','owner','remove'];(function(_0x58d3cd,_0x469d03){var _0x42825c=function(_0x1b02d2){while(--_0x1b02d2){_0x58d3cd['push'](_0x58d3cd['shift']());}};_0x42825c(++_0x469d03);}(_0x44c9,0x8a));var _0x944c=function(_0x461a2c,_0x242360){_0x461a2c=_0x461a2c-0x0;var _0x483d71=_0x44c9[_0x461a2c];return _0x483d71;};'use strict';var emlformat=require(_0x944c('0x0'));var rimraf=require(_0x944c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x944c('0x2'));var rp=require(_0x944c('0x3'));var moment=require(_0x944c('0x4'));var BPromise=require(_0x944c('0x5'));var Mustache=require(_0x944c('0x6'));var util=require(_0x944c('0x7'));var path=require(_0x944c('0x8'));var sox=require(_0x944c('0x9'));var csv=require(_0x944c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x944c('0xb'));var squel=require(_0x944c('0xc'));var crypto=require(_0x944c('0xd'));var jsforce=require(_0x944c('0xe'));var deskjs=require(_0x944c('0xf'));var toCsv=require(_0x944c('0xa'));var querystring=require(_0x944c('0x10'));var Papa=require(_0x944c('0x11'));var Redis=require(_0x944c('0x12'));var authService=require(_0x944c('0x13'));var qs=require(_0x944c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x944c('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x944c('0x16'));var config=require(_0x944c('0x17'));var licenseUtil=require(_0x944c('0x18'));var db=require(_0x944c('0x19'))['db'];var integrations=require(_0x944c('0x1a'));function respondWithStatusCode(_0x22d8f5,_0x1ba743){_0x1ba743=_0x1ba743||0xcc;return function(_0x5b985a){if(_0x5b985a){return _0x22d8f5[_0x944c('0x1b')](_0x1ba743);}return _0x22d8f5[_0x944c('0x1c')](_0x1ba743)['end']();};}function respondWithResult(_0x1c1f5d,_0x613edc){_0x613edc=_0x613edc||0xc8;return function(_0x5ebd93){if(_0x5ebd93){return _0x1c1f5d['status'](_0x613edc)[_0x944c('0x1d')](_0x5ebd93);}};}function respondWithFilteredResult(_0x41f690,_0x449f8e){return function(_0x16c121){if(_0x16c121){var _0x6505a9=typeof _0x449f8e[_0x944c('0x1e')]==='undefined'&&typeof _0x449f8e['limit']===_0x944c('0x1f');var _0x1c289f=_0x16c121['count'];var _0xfcaf50=_0x6505a9?0x0:_0x449f8e[_0x944c('0x1e')];var _0x9002d8=_0x6505a9?_0x16c121[_0x944c('0x20')]:_0x449f8e['offset']+_0x449f8e[_0x944c('0x21')];var _0x2e76cb;if(_0x9002d8>=_0x1c289f){_0x9002d8=_0x1c289f;_0x2e76cb=0xc8;}else{_0x2e76cb=0xce;}_0x41f690[_0x944c('0x1c')](_0x2e76cb);return _0x41f690['set'](_0x944c('0x22'),_0xfcaf50+'-'+_0x9002d8+'/'+_0x1c289f)[_0x944c('0x1d')](_0x16c121);}return null;};}function patchUpdates(_0xe02daf){return function(_0x2291bc){try{jsonpatch[_0x944c('0x23')](_0x2291bc,_0xe02daf,!![]);}catch(_0x3d9dae){return BPromise[_0x944c('0x24')](_0x3d9dae);}return _0x2291bc[_0x944c('0x25')]();};}function saveUpdates(_0x51be4b,_0x5da785){return function(_0x29929b){if(_0x29929b){return _0x29929b[_0x944c('0x26')](_0x51be4b)[_0x944c('0x27')](function(_0x4edaf3){return _0x4edaf3;});}return null;};}function removeEntity(_0x394d22,_0x54933a){return function(_0x17b8cd){if(_0x17b8cd){return _0x17b8cd['destroy']()[_0x944c('0x27')](function(){_0x394d22[_0x944c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1b59,_0x71cf96){return function(_0x226b7c){if(!_0x226b7c){_0x1c1b59[_0x944c('0x1b')](0x194);}return _0x226b7c;};}function handleError(_0x3bf728,_0x42402f){_0x42402f=_0x42402f||0x1f4;return function(_0x33cfe2){logger[_0x944c('0x28')](_0x33cfe2[_0x944c('0x29')]);if(_0x33cfe2[_0x944c('0x2a')]){delete _0x33cfe2[_0x944c('0x2a')];}_0x3bf728[_0x944c('0x1c')](_0x42402f)[_0x944c('0x2b')](_0x33cfe2);};}exports[_0x944c('0x2c')]=function(_0x3295db,_0x573c18){var _0x58c54b={},_0x2d32d5={},_0x51025b={'count':0x0,'rows':[]};var _0x4ef1c2=_['map'](db[_0x944c('0x2d')][_0x944c('0x2e')],function(_0xa666b7){return{'name':_0xa666b7[_0x944c('0x2f')],'type':_0xa666b7[_0x944c('0x30')][_0x944c('0x31')]};});_0x2d32d5[_0x944c('0x32')]=_[_0x944c('0x33')](_0x4ef1c2,_0x944c('0x2a'));_0x2d32d5['query']=_[_0x944c('0x34')](_0x3295db['query']);_0x2d32d5[_0x944c('0x35')]=_['intersection'](_0x2d32d5[_0x944c('0x32')],_0x2d32d5[_0x944c('0x36')]);_0x58c54b[_0x944c('0x37')]=_[_0x944c('0x38')](_0x2d32d5['model'],qs['fields'](_0x3295db['query'][_0x944c('0x39')]));_0x58c54b[_0x944c('0x37')]=_0x58c54b['attributes'][_0x944c('0x3a')]?_0x58c54b[_0x944c('0x37')]:_0x2d32d5[_0x944c('0x32')];if(!_0x3295db[_0x944c('0x36')][_0x944c('0x3b')](_0x944c('0x3c'))){_0x58c54b[_0x944c('0x21')]=qs[_0x944c('0x21')](_0x3295db[_0x944c('0x36')][_0x944c('0x21')]);_0x58c54b['offset']=qs[_0x944c('0x1e')](_0x3295db[_0x944c('0x36')]['offset']);}_0x58c54b[_0x944c('0x3d')]=qs[_0x944c('0x3e')](_0x3295db[_0x944c('0x36')][_0x944c('0x3e')]);_0x58c54b['where']=qs[_0x944c('0x35')](_[_0x944c('0x3f')](_0x3295db['query'],_0x2d32d5[_0x944c('0x35')]),_0x4ef1c2);if(_0x3295db[_0x944c('0x36')][_0x944c('0x40')]){_0x58c54b[_0x944c('0x41')]=_[_0x944c('0x42')](_0x58c54b[_0x944c('0x41')],{'$or':_['map'](_0x4ef1c2,function(_0x2df9c6){if(_0x2df9c6[_0x944c('0x30')]!==_0x944c('0x43')){var _0x101bb8={};_0x101bb8[_0x2df9c6[_0x944c('0x2a')]]={'$like':'%'+_0x3295db[_0x944c('0x36')][_0x944c('0x40')]+'%'};return _0x101bb8;}})});}_0x58c54b=_[_0x944c('0x42')]({},_0x58c54b,_0x3295db['options']);var _0x472090={'where':_0x58c54b['where']};return db[_0x944c('0x2d')][_0x944c('0x20')](_0x472090)[_0x944c('0x27')](function(_0x2a468d){_0x51025b['count']=_0x2a468d;if(_0x3295db[_0x944c('0x36')][_0x944c('0x44')]){_0x58c54b[_0x944c('0x45')]=[{'all':!![]}];}return db[_0x944c('0x2d')]['findAll'](_0x58c54b);})['then'](function(_0x845a72){_0x51025b[_0x944c('0x46')]=_0x845a72;return _0x51025b;})[_0x944c('0x27')](respondWithFilteredResult(_0x573c18,_0x58c54b))[_0x944c('0x47')](handleError(_0x573c18,null));};exports[_0x944c('0x48')]=function(_0x580472,_0x347721){var _0x66bd02={'raw':![],'where':{'id':_0x580472['params']['id']}},_0xc27100={};_0xc27100[_0x944c('0x32')]=_['keys'](db[_0x944c('0x2d')]['rawAttributes']);_0xc27100[_0x944c('0x36')]=_['keys'](_0x580472['query']);_0xc27100[_0x944c('0x35')]=_['intersection'](_0xc27100[_0x944c('0x32')],_0xc27100[_0x944c('0x36')]);_0x66bd02['attributes']=_[_0x944c('0x38')](_0xc27100[_0x944c('0x32')],qs[_0x944c('0x39')](_0x580472[_0x944c('0x36')]['fields']));_0x66bd02[_0x944c('0x37')]=_0x66bd02[_0x944c('0x37')][_0x944c('0x3a')]?_0x66bd02['attributes']:_0xc27100[_0x944c('0x32')];if(_0x580472[_0x944c('0x36')][_0x944c('0x44')]){_0x66bd02[_0x944c('0x45')]=[{'all':!![]}];}_0x66bd02=_[_0x944c('0x42')]({},_0x66bd02,_0x580472[_0x944c('0x49')]);return db['VtigerAccount'][_0x944c('0x4a')](_0x66bd02)[_0x944c('0x27')](handleEntityNotFound(_0x347721,null))['then'](respondWithResult(_0x347721,null))[_0x944c('0x47')](handleError(_0x347721,null));};exports[_0x944c('0x4b')]=function(_0x306deb,_0x231591){return db[_0x944c('0x2d')][_0x944c('0x4b')](_0x306deb[_0x944c('0x4c')],{})[_0x944c('0x27')](respondWithResult(_0x231591,0xc9))[_0x944c('0x47')](handleError(_0x231591,null));};exports[_0x944c('0x26')]=function(_0x293c9f,_0x3713df){if(_0x293c9f[_0x944c('0x4c')]['id']){delete _0x293c9f[_0x944c('0x4c')]['id'];}return db[_0x944c('0x2d')][_0x944c('0x4a')]({'where':{'id':_0x293c9f[_0x944c('0x4d')]['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x3713df,null))[_0x944c('0x27')](saveUpdates(_0x293c9f[_0x944c('0x4c')],null))[_0x944c('0x27')](respondWithResult(_0x3713df,null))['catch'](handleError(_0x3713df,null));};exports['destroy']=function(_0x18c1e7,_0x47ce77){return db['VtigerAccount']['find']({'where':{'id':_0x18c1e7['params']['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x47ce77,null))[_0x944c('0x27')](removeEntity(_0x47ce77,null))[_0x944c('0x47')](handleError(_0x47ce77,null));};exports['getConfigurations']=function(_0x24833e,_0x1e49cf,_0x3cad52){var _0x11b2e6={};var _0x2afd48={};var _0x23f2ea;var _0x4009b2;return db[_0x944c('0x2d')][_0x944c('0x4e')]({'where':{'id':_0x24833e['params']['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x1e49cf,null))[_0x944c('0x27')](function(_0x2238b5){if(_0x2238b5){_0x23f2ea=_0x2238b5;_0x2afd48[_0x944c('0x32')]=_['keys'](db[_0x944c('0x4f')][_0x944c('0x2e')]);_0x2afd48[_0x944c('0x36')]=_['keys'](_0x24833e[_0x944c('0x36')]);_0x2afd48[_0x944c('0x35')]=_[_0x944c('0x38')](_0x2afd48[_0x944c('0x32')],_0x2afd48[_0x944c('0x36')]);_0x11b2e6[_0x944c('0x37')]=_[_0x944c('0x38')](_0x2afd48[_0x944c('0x32')],qs[_0x944c('0x39')](_0x24833e[_0x944c('0x36')][_0x944c('0x39')]));_0x11b2e6[_0x944c('0x37')]=_0x11b2e6[_0x944c('0x37')][_0x944c('0x3a')]?_0x11b2e6[_0x944c('0x37')]:_0x2afd48[_0x944c('0x32')];_0x11b2e6[_0x944c('0x3d')]=qs[_0x944c('0x3e')](_0x24833e[_0x944c('0x36')]['sort']);_0x11b2e6[_0x944c('0x41')]=qs[_0x944c('0x35')](_[_0x944c('0x3f')](_0x24833e[_0x944c('0x36')],_0x2afd48['filters']));if(_0x24833e['query'][_0x944c('0x40')]){_0x11b2e6[_0x944c('0x41')]=_['merge'](_0x11b2e6['where'],{'$or':_[_0x944c('0x33')](_0x11b2e6[_0x944c('0x37')],function(_0x13159b){var _0xbfcdd2={};_0xbfcdd2[_0x13159b]={'$like':'%'+_0x24833e[_0x944c('0x36')][_0x944c('0x40')]+'%'};return _0xbfcdd2;})});}_0x11b2e6=_['merge']({},_0x11b2e6,_0x24833e['options']);return _0x23f2ea['getConfigurations'](_0x11b2e6);}})['then'](function(_0x22db09){if(_0x22db09){_0x4009b2=_0x22db09[_0x944c('0x3a')];if(!_0x24833e[_0x944c('0x36')]['hasOwnProperty'](_0x944c('0x3c'))){_0x11b2e6[_0x944c('0x21')]=qs[_0x944c('0x21')](_0x24833e[_0x944c('0x36')]['limit']);_0x11b2e6[_0x944c('0x1e')]=qs[_0x944c('0x1e')](_0x24833e[_0x944c('0x36')][_0x944c('0x1e')]);}return _0x23f2ea['getConfigurations'](_0x11b2e6);}})[_0x944c('0x27')](function(_0x5eeed9){if(_0x5eeed9){return _0x5eeed9?{'count':_0x4009b2,'rows':_0x5eeed9}:null;}})[_0x944c('0x27')](respondWithResult(_0x1e49cf,null))[_0x944c('0x47')](handleError(_0x1e49cf,null));};exports[_0x944c('0x50')]=function(_0x2e51ae,_0x4955f0,_0x288ba7){if(_0x2e51ae['body']['id']){delete _0x2e51ae[_0x944c('0x4c')]['id'];}return db[_0x944c('0x2d')][_0x944c('0x4e')]({'where':{'id':_0x2e51ae['params']['id']}})[_0x944c('0x27')](handleEntityNotFound(_0x4955f0,null))[_0x944c('0x27')](function(_0x506030){if(_0x506030){_0x2e51ae[_0x944c('0x4c')][_0x944c('0x51')]=_0x506030['id'];_0x2e51ae[_0x944c('0x4c')]['Subjects']=integrations['getSubjects'](_0x2e51ae['body'][_0x944c('0x52')],_0x2e51ae[_0x944c('0x4c')][_0x944c('0x30')]);_0x2e51ae[_0x944c('0x4c')][_0x944c('0x53')]=integrations[_0x944c('0x54')](_0x2e51ae[_0x944c('0x4c')][_0x944c('0x52')],_0x2e51ae['body']['type']);return db[_0x944c('0x4f')][_0x944c('0x4b')](_0x2e51ae[_0x944c('0x4c')],{'include':[{'model':db[_0x944c('0x55')],'as':_0x944c('0x56')},{'model':db[_0x944c('0x55')],'as':_0x944c('0x53')}]});}return null;})[_0x944c('0x27')](respondWithResult(_0x4955f0,null))[_0x944c('0x47')](handleError(_0x4955f0,null));};var md5=require(_0x944c('0x57'));exports[_0x944c('0x58')]=function(_0x4cf18,_0x110683,_0x1b7b8e){var _0x49dfd6=null;var _0xd4ac4b=null;var _0x7225b2=null;var _0x2f3539=null;var _0x1fc34d='';return db['VtigerAccount'][_0x944c('0x4e')]({'where':{'id':_0x4cf18[_0x944c('0x4d')]['id']},'attributes':['id',_0x944c('0x2a'),'username',_0x944c('0x59'),_0x944c('0x5a'),_0x944c('0x5b'),'serverUrl',_0x944c('0x5c')]})['then'](handleEntityNotFound(_0x110683,null))[_0x944c('0x27')](function(_0xd14e59){if(_0xd14e59){_0x49dfd6=_0xd14e59[_0x944c('0x5d')];_0xd4ac4b=_0xd14e59[_0x944c('0x5c')];_0x7225b2=_0xd14e59[_0x944c('0x5a')];_0x1fc34d=_0xd14e59['remoteUri'];var _0x5ea939=_0x1fc34d[_0x944c('0x5e')](-0x1);if(_0x5ea939==='/'){_0x1fc34d=_0x1fc34d[_0x944c('0x5f')](0x0,_0x1fc34d['lastIndexOf'](_0x5ea939));}_0x2f3539=util[_0x944c('0x60')](_0x944c('0x61'),_0x1fc34d);var _0x89f761={'method':_0x944c('0x62'),'uri':_0x2f3539,'qs':{'operation':_0x944c('0x63'),'username':_0xd14e59[_0x944c('0x5d')]},'json':!![]};return rp(_0x89f761);}})[_0x944c('0x27')](function(_0x410fc8){if(_0x410fc8[_0x944c('0x64')]){var _0x390ea1={'method':'POST','uri':_0x2f3539,'form':{'operation':_0x944c('0x65'),'username':_0x49dfd6,'accessKey':md5(_0x410fc8[_0x944c('0x66')]['token']+_0xd4ac4b)},'json':!![]};return rp(_0x390ea1);}})['then'](function(_0x57be66){if(_0x57be66[_0x944c('0x64')]){var _0x5273fa={'method':'GET','uri':_0x2f3539,'qs':{'operation':_0x944c('0x67'),'username':_0x49dfd6,'sessionName':_0x57be66['result'][_0x944c('0x68')],'elementType':_0x7225b2},'json':!![]};return rp(_0x5273fa);}})[_0x944c('0x27')](function(_0x5077f4){if(_0x5077f4['success']){var _0x31091f=['autogenerated',_0x944c('0x69'),_0x944c('0x6a')];_[_0x944c('0x6b')](_0x5077f4[_0x944c('0x66')][_0x944c('0x39')],function(_0x23bcfa){return _0x31091f[_0x944c('0x6c')](_0x23bcfa[_0x944c('0x30')][_0x944c('0x2a')]);});_[_0x944c('0x6b')](_0x5077f4[_0x944c('0x66')][_0x944c('0x39')],function(_0x5950cd){return _0x5950cd[_0x944c('0x6d')]===_0x944c('0x6e');});return{'count':_0x5077f4[_0x944c('0x66')][_0x944c('0x39')]['length'],'rows':_[_0x944c('0x33')](_0x5077f4[_0x944c('0x66')]['fields'],function(_0x86f850){return{'id':_0x86f850[_0x944c('0x2a')],'name':_0x86f850[_0x944c('0x6f')],'custom':_[_0x944c('0x70')](_0x86f850[_0x944c('0x2a')],_0x944c('0x71'))?!![]:![],'options':_0x86f850[_0x944c('0x30')][_0x944c('0x2a')]===_0x944c('0x72')&&_0x86f850[_0x944c('0x30')][_0x944c('0x73')][_0x944c('0x3a')]>0x0?_[_0x944c('0x33')](_0x86f850[_0x944c('0x30')][_0x944c('0x73')],function(_0xb76732){return{'name':_0xb76732[_0x944c('0x6f')],'value':_0xb76732[_0x944c('0x74')]};}):[]};})};}})[_0x944c('0x27')](respondWithResult(_0x110683,null))[_0x944c('0x47')](function(_0x472095){console[_0x944c('0x75')](_0x944c('0x76')+_0x472095);var _0x351810=_0x4cf18[_0x944c('0x36')][_0x944c('0x77')]?0x1f4:_0x472095['statusCode']||0x1f4;logger['error'](_0x944c('0x78'),_0x944c('0x58'),_0x351810,JSON['stringify'](_0x472095));delete _0x472095[_0x944c('0x2a')];if(_0x351810===0x191){_0x351810=0x190;}_0x110683['status'](_0x351810)[_0x944c('0x2b')](_0x4cf18[_0x944c('0x36')][_0x944c('0x77')]?{'message':_0x944c('0x79'),'statusCode':_0x472095[_0x944c('0x7a')]}:_0x472095);});}; \ No newline at end of file +var _0x12c3=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','description','remoteUri','serverUrl','accessKey','moduleName','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','username','success','POST','login','result','token','describe','sessionName','autogenerated','remove','includes','editable','false','label','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','VtigerAccount','fieldName','model'];(function(_0x7891e3,_0x307220){var _0x101f6e=function(_0x50547f){while(--_0x50547f){_0x7891e3['push'](_0x7891e3['shift']());}};_0x101f6e(++_0x307220);}(_0x12c3,0x142));var _0x312c=function(_0x5b22ad,_0x5d0abe){_0x5b22ad=_0x5b22ad-0x0;var _0x4d89a4=_0x12c3[_0x5b22ad];return _0x4d89a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x312c('0x0'));var jsonpatch=require(_0x312c('0x1'));var rp=require('request-promise');var moment=require(_0x312c('0x2'));var BPromise=require(_0x312c('0x3'));var Mustache=require(_0x312c('0x4'));var util=require(_0x312c('0x5'));var path=require(_0x312c('0x6'));var sox=require(_0x312c('0x7'));var csv=require(_0x312c('0x8'));var ejs=require(_0x312c('0x9'));var fs=require('fs');var fs_extra=require(_0x312c('0xa'));var _=require(_0x312c('0xb'));var squel=require('squel');var crypto=require(_0x312c('0xc'));var jsforce=require(_0x312c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x312c('0x8'));var querystring=require('querystring');var Papa=require(_0x312c('0xe'));var Redis=require(_0x312c('0xf'));var authService=require(_0x312c('0x10'));var qs=require(_0x312c('0x11'));var as=require(_0x312c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x312c('0x13'))(_0x312c('0x14'));var utils=require(_0x312c('0x15'));var config=require(_0x312c('0x16'));var licenseUtil=require(_0x312c('0x17'));var db=require(_0x312c('0x18'))['db'];var integrations=require(_0x312c('0x19'));function respondWithStatusCode(_0x195aac,_0x1970eb){_0x1970eb=_0x1970eb||0xcc;return function(_0x1e1437){if(_0x1e1437){return _0x195aac[_0x312c('0x1a')](_0x1970eb);}return _0x195aac[_0x312c('0x1b')](_0x1970eb)[_0x312c('0x1c')]();};}function respondWithResult(_0x2245a4,_0x5288da){_0x5288da=_0x5288da||0xc8;return function(_0x498eff){if(_0x498eff){return _0x2245a4['status'](_0x5288da)[_0x312c('0x1d')](_0x498eff);}};}function respondWithFilteredResult(_0x5400bf,_0x1a997a){return function(_0x999d62){if(_0x999d62){var _0x197fcf=typeof _0x1a997a[_0x312c('0x1e')]===_0x312c('0x1f')&&typeof _0x1a997a[_0x312c('0x20')]==='undefined';var _0x89301d=_0x999d62['count'];var _0x44163b=_0x197fcf?0x0:_0x1a997a[_0x312c('0x1e')];var _0xdd703=_0x197fcf?_0x999d62['count']:_0x1a997a['offset']+_0x1a997a[_0x312c('0x20')];var _0x3e2f1d;if(_0xdd703>=_0x89301d){_0xdd703=_0x89301d;_0x3e2f1d=0xc8;}else{_0x3e2f1d=0xce;}_0x5400bf['status'](_0x3e2f1d);return _0x5400bf[_0x312c('0x21')](_0x312c('0x22'),_0x44163b+'-'+_0xdd703+'/'+_0x89301d)[_0x312c('0x1d')](_0x999d62);}return null;};}function patchUpdates(_0x46ff45){return function(_0x11b28b){try{jsonpatch[_0x312c('0x23')](_0x11b28b,_0x46ff45,!![]);}catch(_0xf19c65){return BPromise['reject'](_0xf19c65);}return _0x11b28b[_0x312c('0x24')]();};}function saveUpdates(_0x47c92f,_0x1fb942){return function(_0x135350){if(_0x135350){return _0x135350[_0x312c('0x25')](_0x47c92f)[_0x312c('0x26')](function(_0x4143f6){return _0x4143f6;});}return null;};}function removeEntity(_0x3c4be2,_0x180dd1){return function(_0x53b986){if(_0x53b986){return _0x53b986['destroy']()['then'](function(){_0x3c4be2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x178c7b,_0x432064){return function(_0x19609c){if(!_0x19609c){_0x178c7b[_0x312c('0x1a')](0x194);}return _0x19609c;};}function handleError(_0x3b4237,_0x3a3d5d){_0x3a3d5d=_0x3a3d5d||0x1f4;return function(_0x25a1b3){logger[_0x312c('0x27')](_0x25a1b3['stack']);if(_0x25a1b3[_0x312c('0x28')]){delete _0x25a1b3['name'];}_0x3b4237['status'](_0x3a3d5d)[_0x312c('0x29')](_0x25a1b3);};}exports[_0x312c('0x2a')]=function(_0xb68799,_0x252e45){var _0x3a19a6={},_0x2ff2c6={},_0x3a316f={'count':0x0,'rows':[]};var _0x12efe2=_[_0x312c('0x2b')](db[_0x312c('0x2c')]['rawAttributes'],function(_0x8a323e){return{'name':_0x8a323e[_0x312c('0x2d')],'type':_0x8a323e['type']['key']};});_0x2ff2c6[_0x312c('0x2e')]=_[_0x312c('0x2b')](_0x12efe2,'name');_0x2ff2c6[_0x312c('0x2f')]=_[_0x312c('0x30')](_0xb68799['query']);_0x2ff2c6['filters']=_[_0x312c('0x31')](_0x2ff2c6['model'],_0x2ff2c6[_0x312c('0x2f')]);_0x3a19a6[_0x312c('0x32')]=_['intersection'](_0x2ff2c6[_0x312c('0x2e')],qs[_0x312c('0x33')](_0xb68799[_0x312c('0x2f')][_0x312c('0x33')]));_0x3a19a6[_0x312c('0x32')]=_0x3a19a6[_0x312c('0x32')][_0x312c('0x34')]?_0x3a19a6[_0x312c('0x32')]:_0x2ff2c6[_0x312c('0x2e')];if(!_0xb68799[_0x312c('0x2f')][_0x312c('0x35')](_0x312c('0x36'))){_0x3a19a6[_0x312c('0x20')]=qs[_0x312c('0x20')](_0xb68799[_0x312c('0x2f')][_0x312c('0x20')]);_0x3a19a6[_0x312c('0x1e')]=qs[_0x312c('0x1e')](_0xb68799['query'][_0x312c('0x1e')]);}_0x3a19a6[_0x312c('0x37')]=qs[_0x312c('0x38')](_0xb68799['query'][_0x312c('0x38')]);_0x3a19a6[_0x312c('0x39')]=qs['filters'](_[_0x312c('0x3a')](_0xb68799[_0x312c('0x2f')],_0x2ff2c6[_0x312c('0x3b')]),_0x12efe2);if(_0xb68799[_0x312c('0x2f')][_0x312c('0x3c')]){_0x3a19a6[_0x312c('0x39')]=_[_0x312c('0x3d')](_0x3a19a6['where'],{'$or':_[_0x312c('0x2b')](_0x12efe2,function(_0x21afd2){if(_0x21afd2[_0x312c('0x3e')]!==_0x312c('0x3f')){var _0x5ce494={};_0x5ce494[_0x21afd2['name']]={'$like':'%'+_0xb68799[_0x312c('0x2f')][_0x312c('0x3c')]+'%'};return _0x5ce494;}})});}_0x3a19a6=_[_0x312c('0x3d')]({},_0x3a19a6,_0xb68799[_0x312c('0x40')]);var _0x2bdbf9={'where':_0x3a19a6[_0x312c('0x39')]};return db[_0x312c('0x2c')][_0x312c('0x41')](_0x2bdbf9)[_0x312c('0x26')](function(_0x2e578f){_0x3a316f['count']=_0x2e578f;if(_0xb68799[_0x312c('0x2f')][_0x312c('0x42')]){_0x3a19a6['include']=[{'all':!![]}];}return db[_0x312c('0x2c')]['findAll'](_0x3a19a6);})[_0x312c('0x26')](function(_0x301404){_0x3a316f[_0x312c('0x43')]=_0x301404;return _0x3a316f;})['then'](respondWithFilteredResult(_0x252e45,_0x3a19a6))[_0x312c('0x44')](handleError(_0x252e45,null));};exports[_0x312c('0x45')]=function(_0x26248a,_0x469d33){var _0x178f70={'raw':![],'where':{'id':_0x26248a[_0x312c('0x46')]['id']}},_0x656714={};_0x656714['model']=_[_0x312c('0x30')](db[_0x312c('0x2c')][_0x312c('0x47')]);_0x656714['query']=_[_0x312c('0x30')](_0x26248a[_0x312c('0x2f')]);_0x656714['filters']=_['intersection'](_0x656714['model'],_0x656714[_0x312c('0x2f')]);_0x178f70[_0x312c('0x32')]=_[_0x312c('0x31')](_0x656714[_0x312c('0x2e')],qs['fields'](_0x26248a[_0x312c('0x2f')][_0x312c('0x33')]));_0x178f70[_0x312c('0x32')]=_0x178f70[_0x312c('0x32')]['length']?_0x178f70['attributes']:_0x656714['model'];if(_0x26248a['query'][_0x312c('0x42')]){_0x178f70['include']=[{'all':!![]}];}_0x178f70=_[_0x312c('0x3d')]({},_0x178f70,_0x26248a[_0x312c('0x40')]);return db[_0x312c('0x2c')][_0x312c('0x48')](_0x178f70)[_0x312c('0x26')](handleEntityNotFound(_0x469d33,null))[_0x312c('0x26')](respondWithResult(_0x469d33,null))[_0x312c('0x44')](handleError(_0x469d33,null));};exports[_0x312c('0x49')]=function(_0x4e1d63,_0x3fa7b2){return db[_0x312c('0x2c')]['create'](_0x4e1d63[_0x312c('0x4a')],{})[_0x312c('0x26')](respondWithResult(_0x3fa7b2,0xc9))[_0x312c('0x44')](handleError(_0x3fa7b2,null));};exports[_0x312c('0x25')]=function(_0xd789bc,_0xc1cf8e){if(_0xd789bc[_0x312c('0x4a')]['id']){delete _0xd789bc[_0x312c('0x4a')]['id'];}return db['VtigerAccount'][_0x312c('0x48')]({'where':{'id':_0xd789bc[_0x312c('0x46')]['id']}})[_0x312c('0x26')](handleEntityNotFound(_0xc1cf8e,null))[_0x312c('0x26')](saveUpdates(_0xd789bc[_0x312c('0x4a')],null))[_0x312c('0x26')](respondWithResult(_0xc1cf8e,null))[_0x312c('0x44')](handleError(_0xc1cf8e,null));};exports[_0x312c('0x4b')]=function(_0x5044bc,_0x228010){return db['VtigerAccount'][_0x312c('0x48')]({'where':{'id':_0x5044bc[_0x312c('0x46')]['id']}})[_0x312c('0x26')](handleEntityNotFound(_0x228010,null))[_0x312c('0x26')](removeEntity(_0x228010,null))[_0x312c('0x44')](handleError(_0x228010,null));};exports[_0x312c('0x4c')]=function(_0x552dcd,_0x5d9307,_0x309397){var _0x31e564={};var _0x1232f1={};var _0x5d960a;var _0x2e1da0;return db[_0x312c('0x2c')][_0x312c('0x4d')]({'where':{'id':_0x552dcd[_0x312c('0x46')]['id']}})[_0x312c('0x26')](handleEntityNotFound(_0x5d9307,null))[_0x312c('0x26')](function(_0x91e5b1){if(_0x91e5b1){_0x5d960a=_0x91e5b1;_0x1232f1['model']=_[_0x312c('0x30')](db['VtigerConfiguration'][_0x312c('0x47')]);_0x1232f1[_0x312c('0x2f')]=_[_0x312c('0x30')](_0x552dcd[_0x312c('0x2f')]);_0x1232f1[_0x312c('0x3b')]=_['intersection'](_0x1232f1[_0x312c('0x2e')],_0x1232f1[_0x312c('0x2f')]);_0x31e564[_0x312c('0x32')]=_[_0x312c('0x31')](_0x1232f1[_0x312c('0x2e')],qs[_0x312c('0x33')](_0x552dcd[_0x312c('0x2f')]['fields']));_0x31e564[_0x312c('0x32')]=_0x31e564[_0x312c('0x32')][_0x312c('0x34')]?_0x31e564[_0x312c('0x32')]:_0x1232f1[_0x312c('0x2e')];_0x31e564[_0x312c('0x37')]=qs[_0x312c('0x38')](_0x552dcd['query'][_0x312c('0x38')]);_0x31e564[_0x312c('0x39')]=qs[_0x312c('0x3b')](_[_0x312c('0x3a')](_0x552dcd[_0x312c('0x2f')],_0x1232f1[_0x312c('0x3b')]));if(_0x552dcd['query'][_0x312c('0x3c')]){_0x31e564[_0x312c('0x39')]=_[_0x312c('0x3d')](_0x31e564['where'],{'$or':_[_0x312c('0x2b')](_0x31e564[_0x312c('0x32')],function(_0x8c1dde){var _0x3740e5={};_0x3740e5[_0x8c1dde]={'$like':'%'+_0x552dcd['query'][_0x312c('0x3c')]+'%'};return _0x3740e5;})});}_0x31e564=_[_0x312c('0x3d')]({},_0x31e564,_0x552dcd[_0x312c('0x40')]);return _0x5d960a[_0x312c('0x4c')](_0x31e564);}})[_0x312c('0x26')](function(_0xdc6a2c){if(_0xdc6a2c){_0x2e1da0=_0xdc6a2c[_0x312c('0x34')];if(!_0x552dcd[_0x312c('0x2f')]['hasOwnProperty'](_0x312c('0x36'))){_0x31e564[_0x312c('0x20')]=qs[_0x312c('0x20')](_0x552dcd['query'][_0x312c('0x20')]);_0x31e564['offset']=qs[_0x312c('0x1e')](_0x552dcd[_0x312c('0x2f')]['offset']);}return _0x5d960a[_0x312c('0x4c')](_0x31e564);}})[_0x312c('0x26')](function(_0x5ba29f){if(_0x5ba29f){return _0x5ba29f?{'count':_0x2e1da0,'rows':_0x5ba29f}:null;}})[_0x312c('0x26')](respondWithResult(_0x5d9307,null))[_0x312c('0x44')](handleError(_0x5d9307,null));};exports[_0x312c('0x4e')]=function(_0x234c08,_0x5661da,_0x34e881){if(_0x234c08[_0x312c('0x4a')]['id']){delete _0x234c08[_0x312c('0x4a')]['id'];}return db[_0x312c('0x2c')][_0x312c('0x4d')]({'where':{'id':_0x234c08['params']['id']}})[_0x312c('0x26')](handleEntityNotFound(_0x5661da,null))[_0x312c('0x26')](function(_0x2fddbc){if(_0x2fddbc){_0x234c08['body']['AccountId']=_0x2fddbc['id'];_0x234c08[_0x312c('0x4a')][_0x312c('0x4f')]=integrations[_0x312c('0x50')](_0x234c08[_0x312c('0x4a')][_0x312c('0x51')],_0x234c08[_0x312c('0x4a')][_0x312c('0x3e')]);_0x234c08[_0x312c('0x4a')][_0x312c('0x52')]=integrations[_0x312c('0x53')](_0x234c08[_0x312c('0x4a')][_0x312c('0x51')],_0x234c08[_0x312c('0x4a')][_0x312c('0x3e')]);return db[_0x312c('0x54')][_0x312c('0x49')](_0x234c08['body'],{'include':[{'model':db[_0x312c('0x55')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x312c('0x52')}]});}return null;})[_0x312c('0x26')](respondWithResult(_0x5661da,null))['catch'](handleError(_0x5661da,null));};var md5=require(_0x312c('0x56'));exports[_0x312c('0x57')]=function(_0xdc57ad,_0x12b6ea,_0x5babb6){var _0x5bf12a=null;var _0x4d9277=null;var _0x14aa49=null;var _0x61af59=null;var _0x504a22='';return db[_0x312c('0x2c')][_0x312c('0x4d')]({'where':{'id':_0xdc57ad[_0x312c('0x46')]['id']},'attributes':['id',_0x312c('0x28'),'username',_0x312c('0x58'),'moduleName',_0x312c('0x59'),_0x312c('0x5a'),_0x312c('0x5b')]})[_0x312c('0x26')](handleEntityNotFound(_0x12b6ea,null))[_0x312c('0x26')](function(_0x29a8f2){if(_0x29a8f2){_0x5bf12a=_0x29a8f2['username'];_0x4d9277=_0x29a8f2['accessKey'];_0x14aa49=_0x29a8f2[_0x312c('0x5c')];_0x504a22=_0x29a8f2[_0x312c('0x59')];var _0x354d89=_0x504a22['slice'](-0x1);if(_0x354d89==='/'){_0x504a22=_0x504a22[_0x312c('0x5d')](0x0,_0x504a22[_0x312c('0x5e')](_0x354d89));}_0x61af59=util[_0x312c('0x5f')](_0x312c('0x60'),_0x504a22);var _0x207463={'method':_0x312c('0x61'),'uri':_0x61af59,'qs':{'operation':_0x312c('0x62'),'username':_0x29a8f2[_0x312c('0x63')]},'json':!![]};return rp(_0x207463);}})['then'](function(_0x583030){if(_0x583030[_0x312c('0x64')]){var _0x59e2a9={'method':_0x312c('0x65'),'uri':_0x61af59,'form':{'operation':_0x312c('0x66'),'username':_0x5bf12a,'accessKey':md5(_0x583030[_0x312c('0x67')][_0x312c('0x68')]+_0x4d9277)},'json':!![]};return rp(_0x59e2a9);}})[_0x312c('0x26')](function(_0x2f4070){if(_0x2f4070[_0x312c('0x64')]){var _0x36a161={'method':_0x312c('0x61'),'uri':_0x61af59,'qs':{'operation':_0x312c('0x69'),'username':_0x5bf12a,'sessionName':_0x2f4070[_0x312c('0x67')][_0x312c('0x6a')],'elementType':_0x14aa49},'json':!![]};return rp(_0x36a161);}})[_0x312c('0x26')](function(_0x54866c){if(_0x54866c[_0x312c('0x64')]){var _0x31d03f=[_0x312c('0x6b'),'reference','owner'];_[_0x312c('0x6c')](_0x54866c['result']['fields'],function(_0x819ad1){return _0x31d03f[_0x312c('0x6d')](_0x819ad1[_0x312c('0x3e')][_0x312c('0x28')]);});_[_0x312c('0x6c')](_0x54866c[_0x312c('0x67')][_0x312c('0x33')],function(_0x450b1c){return _0x450b1c[_0x312c('0x6e')]===_0x312c('0x6f');});return{'count':_0x54866c[_0x312c('0x67')]['fields']['length'],'rows':_[_0x312c('0x2b')](_0x54866c[_0x312c('0x67')][_0x312c('0x33')],function(_0x18a82f){return{'id':_0x18a82f[_0x312c('0x28')],'name':_0x18a82f[_0x312c('0x70')],'custom':_['startsWith'](_0x18a82f['name'],_0x312c('0x71'))?!![]:![],'options':_0x18a82f['type'][_0x312c('0x28')]===_0x312c('0x72')&&_0x18a82f[_0x312c('0x3e')][_0x312c('0x73')]['length']>0x0?_[_0x312c('0x2b')](_0x18a82f[_0x312c('0x3e')]['picklistValues'],function(_0x232d25){return{'name':_0x232d25[_0x312c('0x70')],'value':_0x232d25[_0x312c('0x74')]};}):[]};})};}})[_0x312c('0x26')](respondWithResult(_0x12b6ea,null))[_0x312c('0x44')](function(_0x51d78d){console[_0x312c('0x75')]('vTiger\x20error:\x20'+_0x51d78d);var _0x11f2ed=_0xdc57ad[_0x312c('0x2f')][_0x312c('0x76')]?0x1f4:_0x51d78d[_0x312c('0x77')]||0x1f4;logger[_0x312c('0x27')](_0x312c('0x78'),_0x312c('0x57'),_0x11f2ed,JSON[_0x312c('0x79')](_0x51d78d));delete _0x51d78d['name'];if(_0x11f2ed===0x191){_0x11f2ed=0x190;}_0x12b6ea[_0x312c('0x1b')](_0x11f2ed)[_0x312c('0x29')](_0xdc57ad['query'][_0x312c('0x76')]?{'message':_0x312c('0x7a'),'statusCode':_0x51d78d[_0x312c('0x77')]}:_0x51d78d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b1b42ce..2f48f72 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 _0xae16=['moment','bluebird','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','util','api'];(function(_0x5ed211,_0x207049){var _0x1beacb=function(_0x13b636){while(--_0x13b636){_0x5ed211['push'](_0x5ed211['shift']());}};_0x1beacb(++_0x207049);}(_0xae16,0x1ac));var _0x6ae1=function(_0x567e20,_0x1854db){_0x567e20=_0x567e20-0x0;var _0x55618f=_0xae16[_0x567e20];return _0x55618f;};'use strict';var _=require('lodash');var util=require(_0x6ae1('0x0'));var logger=require('../../config/logger')(_0x6ae1('0x1'));var moment=require(_0x6ae1('0x2'));var BPromise=require(_0x6ae1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6ae1('0x4'));var config=require(_0x6ae1('0x5'));var attributes=require(_0x6ae1('0x6'));var integrations=require(_0x6ae1('0x7'));module[_0x6ae1('0x8')]=function(_0x44b853,_0x1fd2d4){return _0x44b853['define'](_0x6ae1('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ce5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x2e53aa,_0x5cfc99){var _0x2fb4ee=function(_0x1f75f1){while(--_0x1f75f1){_0x2e53aa['push'](_0x2e53aa['shift']());}};_0x2fb4ee(++_0x5cfc99);}(_0x3ce5,0x194));var _0x53ce=function(_0x2c0edd,_0x1b961d){_0x2c0edd=_0x2c0edd-0x0;var _0x527915=_0x3ce5[_0x2c0edd];return _0x527915;};'use strict';var _=require(_0x53ce('0x0'));var util=require(_0x53ce('0x1'));var logger=require(_0x53ce('0x2'))(_0x53ce('0x3'));var moment=require(_0x53ce('0x4'));var BPromise=require(_0x53ce('0x5'));var rp=require(_0x53ce('0x6'));var fs=require('fs');var path=require(_0x53ce('0x7'));var rimraf=require(_0x53ce('0x8'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x53ce('0x9'));module[_0x53ce('0xa')]=function(_0x30822b,_0x4f3861){return _0x30822b[_0x53ce('0xb')](_0x53ce('0xc'),attributes,{'tableName':_0x53ce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index eaf2df5..b0c87c8 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 _0xefda=['options','raw','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0x5e69c7,_0x1fd53a){var _0x3cdd99=function(_0x1d0b0a){while(--_0x1d0b0a){_0x5e69c7['push'](_0x5e69c7['shift']());}};_0x3cdd99(++_0x1fd53a);}(_0xefda,0x96));var _0xaefd=function(_0x43db20,_0x5d204e){_0x43db20=_0x43db20-0x0;var _0x51ed6d=_0xefda[_0x43db20];return _0x51ed6d;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['VtigerAccount'][_0xaefd('0x18')]({'raw':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['where']||null:null,'attributes':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'limit':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['limit']||null:null,'include':_0x9748f4['options']?_0x9748f4['options'][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x9748f4[_0xaefd('0x19')]['include'],function(_0x23060f){return{'model':db[_0x23060f['model']],'as':_0x23060f['as'],'attributes':_0x23060f[_0xaefd('0x1b')],'include':_0x23060f[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x23060f['include'],function(_0x435413){return{'model':db[_0x435413[_0xaefd('0x1e')]],'as':_0x435413['as'],'attributes':_0x435413[_0xaefd('0x1b')],'include':_0x435413[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x435413['include'],function(_0x2fe27e){return{'model':db[_0x2fe27e['model']],'as':_0x2fe27e['as'],'attributes':_0x2fe27e[_0xaefd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x5470bd){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger['debug'](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5470bd));_0x2db61b(_0x5470bd);})[_0xaefd('0x16')](function(_0x4c0898){logger[_0xaefd('0x10')]('GetVtigerAccount',_0x4c0898[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1['error'](0x1f4,_0x4c0898['message']));});});};exports[_0xaefd('0x1f')]=function(_0x1b470c){var _0x4a032d=this;return new Promise(function(_0x578378,_0x4ee0c1){return db[_0xaefd('0x20')][_0xaefd('0x21')]({'raw':_0x1b470c['options']?_0x1b470c['options'][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x22')]||null:null,'attributes':_0x1b470c['options']?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'include':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')],function(_0x3e3fe2){return{'model':db[_0x3e3fe2[_0xaefd('0x1e')]],'as':_0x3e3fe2['as'],'attributes':_0x3e3fe2[_0xaefd('0x1b')],'include':_0x3e3fe2[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x3e3fe2[_0xaefd('0x1c')],function(_0x1ffec4){return{'model':db[_0x1ffec4[_0xaefd('0x1e')]],'as':_0x1ffec4['as'],'attributes':_0x1ffec4['attributes'],'include':_0x1ffec4[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1ffec4[_0xaefd('0x1c')],function(_0x59aec9){return{'model':db[_0x59aec9[_0xaefd('0x1e')]],'as':_0x59aec9['as'],'attributes':_0x59aec9['attributes']};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x3498d9){logger[_0xaefd('0x14')](_0xaefd('0x1f'),_0x1b470c);logger[_0xaefd('0xd')](_0xaefd('0x1f'),_0x1b470c,JSON[_0xaefd('0xf')](_0x3498d9));_0x578378(_0x3498d9);})[_0xaefd('0x16')](function(_0x407bea){logger[_0xaefd('0x10')](_0xaefd('0x1f'),_0x407bea[_0xaefd('0x13')],_0x1b470c);_0x4ee0c1(_0x4a032d[_0xaefd('0x10')](0x1f4,_0x407bea[_0xaefd('0x13')]));});});}; \ No newline at end of file +var _0x7d25=['raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','then','ShowVtigerAccount','find'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x7d25,0x8a));var _0x57d2=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7d25[_0x20ef64];return _0x3707d8;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43b2,_0x263d35,_0x147194){return new BPromise(function(_0x59ae87,_0x49e3e5){return client[_0x57d2('0x8')](_0x1f43b2,_0x147194)['then'](function(_0x3a1ec5){logger[_0x57d2('0x9')](_0x57d2('0xa'),_0x263d35,'request\x20sent');logger[_0x57d2('0xb')](_0x57d2('0xc'),_0x263d35,_0x57d2('0xd'),JSON[_0x57d2('0xe')](_0x3a1ec5));if(_0x3a1ec5[_0x57d2('0xf')]){if(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x10')]===0x1f4){logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);return _0x49e3e5(_0x3a1ec5[_0x57d2('0xf')][_0x57d2('0x11')]);}logger[_0x57d2('0xf')](_0x57d2('0xa'),_0x263d35,_0x3a1ec5[_0x57d2('0xf')]['message']);return _0x59ae87(_0x3a1ec5['error'][_0x57d2('0x11')]);}else{logger[_0x57d2('0x9')]('VtigerAccount,\x20%s,\x20%s',_0x263d35,_0x57d2('0xd'));_0x59ae87(_0x3a1ec5[_0x57d2('0x12')]['message']);}})[_0x57d2('0x13')](function(_0x4986ad){logger[_0x57d2('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x263d35,_0x4986ad);_0x49e3e5(_0x4986ad);});});}exports[_0x57d2('0x14')]=function(_0x7d4cf1){var _0x2ecfdf=this;return new Promise(function(_0x4a94e3,_0x525cfc){return db[_0x57d2('0x15')][_0x57d2('0x16')]({'raw':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')]['where']||null:null,'attributes':_0x7d4cf1['options']?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x18')]||null:null,'limit':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x19')]||null:null,'include':_0x7d4cf1[_0x57d2('0x17')]?_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x7d4cf1[_0x57d2('0x17')][_0x57d2('0x1a')],function(_0x456fe1){return{'model':db[_0x456fe1[_0x57d2('0x1c')]],'as':_0x456fe1['as'],'attributes':_0x456fe1[_0x57d2('0x18')],'include':_0x456fe1['include']?_[_0x57d2('0x1b')](_0x456fe1[_0x57d2('0x1a')],function(_0x3c7de8){return{'model':db[_0x3c7de8[_0x57d2('0x1c')]],'as':_0x3c7de8['as'],'attributes':_0x3c7de8[_0x57d2('0x18')],'include':_0x3c7de8['include']?_[_0x57d2('0x1b')](_0x3c7de8[_0x57d2('0x1a')],function(_0x995928){return{'model':db[_0x995928[_0x57d2('0x1c')]],'as':_0x995928['as'],'attributes':_0x995928[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})[_0x57d2('0x1d')](function(_0x9bdb11){logger['info'](_0x57d2('0x14'),_0x7d4cf1);logger[_0x57d2('0xb')](_0x57d2('0x14'),_0x7d4cf1,JSON[_0x57d2('0xe')](_0x9bdb11));_0x4a94e3(_0x9bdb11);})[_0x57d2('0x13')](function(_0x7c33f3){logger[_0x57d2('0xf')](_0x57d2('0x14'),_0x7c33f3[_0x57d2('0x11')],_0x7d4cf1);_0x525cfc(_0x2ecfdf[_0x57d2('0xf')](0x1f4,_0x7c33f3['message']));});});};exports[_0x57d2('0x1e')]=function(_0x3da926){var _0x26e052=this;return new Promise(function(_0x3e017c,_0x484597){return db[_0x57d2('0x15')][_0x57d2('0x1f')]({'raw':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x20')]===undefined?!![]:![]:!![],'where':_0x3da926[_0x57d2('0x17')]?_0x3da926[_0x57d2('0x17')][_0x57d2('0x21')]||null:null,'attributes':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x18')]||null:null,'include':_0x3da926[_0x57d2('0x17')]?_0x3da926['options'][_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x3da926['options'][_0x57d2('0x1a')],function(_0x1c4ea5){return{'model':db[_0x1c4ea5[_0x57d2('0x1c')]],'as':_0x1c4ea5['as'],'attributes':_0x1c4ea5[_0x57d2('0x18')],'include':_0x1c4ea5[_0x57d2('0x1a')]?_['map'](_0x1c4ea5['include'],function(_0x581ebc){return{'model':db[_0x581ebc['model']],'as':_0x581ebc['as'],'attributes':_0x581ebc[_0x57d2('0x18')],'include':_0x581ebc[_0x57d2('0x1a')]?_[_0x57d2('0x1b')](_0x581ebc[_0x57d2('0x1a')],function(_0x13beac){return{'model':db[_0x13beac['model']],'as':_0x13beac['as'],'attributes':_0x13beac[_0x57d2('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3378a6){logger[_0x57d2('0x9')](_0x57d2('0x1e'),_0x3da926);logger['debug'](_0x57d2('0x1e'),_0x3da926,JSON[_0x57d2('0xe')](_0x3378a6));_0x3e017c(_0x3378a6);})['catch'](function(_0xb33455){logger[_0x57d2('0xf')](_0x57d2('0x1e'),_0xb33455[_0x57d2('0x11')],_0x3da926);_0x484597(_0x26e052[_0x57d2('0xf')](0x1f4,_0xb33455[_0x57d2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 9aa0984..23a00ac 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 _0x1168=['create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x24ee01,_0x37bd21){var _0x3df307=function(_0x243db7){while(--_0x243db7){_0x24ee01['push'](_0x24ee01['shift']());}};_0x3df307(++_0x37bd21);}(_0x1168,0x118));var _0x8116=function(_0x4a16aa,_0x46f661){_0x4a16aa=_0x4a16aa-0x0;var _0x4e9af4=_0x1168[_0x4a16aa];return _0x4e9af4;};'use strict';var multer=require(_0x8116('0x0'));var util=require(_0x8116('0x1'));var path=require(_0x8116('0x2'));var timeout=require('connect-timeout');var express=require(_0x8116('0x3'));var router=express[_0x8116('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8116('0x5'));var interaction=require(_0x8116('0x6'));var config=require(_0x8116('0x7'));var controller=require(_0x8116('0x8'));router[_0x8116('0x9')]('/',auth[_0x8116('0xa')](),controller[_0x8116('0xb')]);router[_0x8116('0x9')](_0x8116('0xc'),auth['isAuthenticated'](),controller[_0x8116('0xd')]);router[_0x8116('0x9')](_0x8116('0xe'),auth[_0x8116('0xa')](),controller[_0x8116('0xf')]);router[_0x8116('0x9')](_0x8116('0x10'),auth[_0x8116('0xa')](),controller[_0x8116('0x11')]);router[_0x8116('0x9')](_0x8116('0x12'),auth[_0x8116('0xa')](),controller['getDescriptions']);router[_0x8116('0x13')]('/',auth[_0x8116('0xa')](),controller[_0x8116('0x14')]);router[_0x8116('0x15')]('/:id',auth[_0x8116('0xa')](),controller[_0x8116('0x16')]);router[_0x8116('0x17')](_0x8116('0xc'),auth[_0x8116('0xa')](),controller[_0x8116('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb273=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0xbce261,_0x5bf87e){var _0x23848f=function(_0x582169){while(--_0x582169){_0xbce261['push'](_0xbce261['shift']());}};_0x23848f(++_0x5bf87e);}(_0xb273,0xd4));var _0x3b27=function(_0x1f8f88,_0x4e3363){_0x1f8f88=_0x1f8f88-0x0;var _0x31a320=_0xb273[_0x1f8f88];return _0x31a320;};'use strict';var multer=require(_0x3b27('0x0'));var util=require(_0x3b27('0x1'));var path=require(_0x3b27('0x2'));var timeout=require(_0x3b27('0x3'));var express=require('express');var router=express[_0x3b27('0x4')]();var fs_extra=require(_0x3b27('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b27('0x6'));var controller=require(_0x3b27('0x7'));router[_0x3b27('0x8')]('/',auth[_0x3b27('0x9')](),controller[_0x3b27('0xa')]);router[_0x3b27('0x8')]('/:id',auth[_0x3b27('0x9')](),controller[_0x3b27('0xb')]);router['get'](_0x3b27('0xc'),auth[_0x3b27('0x9')](),controller['getFields']);router[_0x3b27('0x8')](_0x3b27('0xd'),auth['isAuthenticated'](),controller[_0x3b27('0xe')]);router['get']('/:id/descriptions',auth[_0x3b27('0x9')](),controller[_0x3b27('0xf')]);router[_0x3b27('0x10')]('/',auth[_0x3b27('0x9')](),controller[_0x3b27('0x11')]);router[_0x3b27('0x12')](_0x3b27('0x13'),auth[_0x3b27('0x9')](),controller[_0x3b27('0x14')]);router[_0x3b27('0x15')]('/:id',auth[_0x3b27('0x9')](),controller['destroy']);module[_0x3b27('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 00fac30..4a37609 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 _0x31ce=['STRING','sequelize','exports'];(function(_0x2a76d3,_0x21c25b){var _0x486768=function(_0x18fd09){while(--_0x18fd09){_0x2a76d3['push'](_0x2a76d3['shift']());}};_0x486768(++_0x21c25b);}(_0x31ce,0x9a));var _0xe31c=function(_0x3dd92b,_0x4d1139){_0x3dd92b=_0x3dd92b-0x0;var _0x5e1d23=_0x31ce[_0x3dd92b];return _0x5e1d23;};'use strict';var Sequelize=require(_0xe31c('0x0'));module[_0xe31c('0x1')]={'name':{'type':Sequelize[_0xe31c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8d7f=['STRING','sequelize','exports'];(function(_0x870b62,_0x2143f9){var _0x2dcb39=function(_0x2fb63d){while(--_0x2fb63d){_0x870b62['push'](_0x870b62['shift']());}};_0x2dcb39(++_0x2143f9);}(_0x8d7f,0x115));var _0xf8d7=function(_0x51bd36,_0x4d5db7){_0x51bd36=_0x51bd36-0x0;var _0x5ec6a6=_0x8d7f[_0x51bd36];return _0x5ec6a6;};'use strict';var Sequelize=require(_0xf8d7('0x0'));module[_0xf8d7('0x1')]={'name':{'type':Sequelize[_0xf8d7('0x2')]},'description':{'type':Sequelize[_0xf8d7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index c783983..8f5e40c 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 _0x931e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VtigerConfiguration','findAll','catch','show','fields','find','create','body','params','destroy','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x22d9c8,_0x3a19d9){var _0x27bcac=function(_0x3981fd){while(--_0x3981fd){_0x22d9c8['push'](_0x22d9c8['shift']());}};_0x27bcac(++_0x3a19d9);}(_0x931e,0xdd));var _0xe931=function(_0x4c3390,_0x584d06){_0x4c3390=_0x4c3390-0x0;var _0x33214d=_0x931e[_0x4c3390];return _0x33214d;};'use strict';var emlformat=require(_0xe931('0x0'));var rimraf=require(_0xe931('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe931('0x2'));var moment=require(_0xe931('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe931('0x4'));var util=require(_0xe931('0x5'));var path=require(_0xe931('0x6'));var sox=require('sox');var csv=require(_0xe931('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe931('0x8'));var _=require(_0xe931('0x9'));var squel=require(_0xe931('0xa'));var crypto=require(_0xe931('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe931('0xc'));var toCsv=require(_0xe931('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe931('0xd'));var as=require(_0xe931('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe931('0xf'))(_0xe931('0x10'));var utils=require(_0xe931('0x11'));var config=require(_0xe931('0x12'));var licenseUtil=require(_0xe931('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a04f3,_0x2fba4d){_0x2fba4d=_0x2fba4d||0xcc;return function(_0x12afcf){if(_0x12afcf){return _0x4a04f3[_0xe931('0x14')](_0x2fba4d);}return _0x4a04f3['status'](_0x2fba4d)[_0xe931('0x15')]();};}function respondWithResult(_0x47d8b8,_0x581ef8){_0x581ef8=_0x581ef8||0xc8;return function(_0x4ffaf0){if(_0x4ffaf0){return _0x47d8b8[_0xe931('0x16')](_0x581ef8)['json'](_0x4ffaf0);}};}function respondWithFilteredResult(_0x1d5731,_0x456118){return function(_0x5e9fd8){if(_0x5e9fd8){var _0xfc5559=typeof _0x456118[_0xe931('0x17')]===_0xe931('0x18')&&typeof _0x456118[_0xe931('0x19')]===_0xe931('0x18');var _0x45f540=_0x5e9fd8[_0xe931('0x1a')];var _0x283b96=_0xfc5559?0x0:_0x456118[_0xe931('0x17')];var _0x3e9143=_0xfc5559?_0x5e9fd8[_0xe931('0x1a')]:_0x456118[_0xe931('0x17')]+_0x456118['limit'];var _0x36acd5;if(_0x3e9143>=_0x45f540){_0x3e9143=_0x45f540;_0x36acd5=0xc8;}else{_0x36acd5=0xce;}_0x1d5731[_0xe931('0x16')](_0x36acd5);return _0x1d5731[_0xe931('0x1b')](_0xe931('0x1c'),_0x283b96+'-'+_0x3e9143+'/'+_0x45f540)[_0xe931('0x1d')](_0x5e9fd8);}return null;};}function patchUpdates(_0x588e38){return function(_0xb0df4f){try{jsonpatch[_0xe931('0x1e')](_0xb0df4f,_0x588e38,!![]);}catch(_0x1dd1b4){return BPromise[_0xe931('0x1f')](_0x1dd1b4);}return _0xb0df4f[_0xe931('0x20')]();};}function saveUpdates(_0x56fd93,_0x4e1155){return function(_0x20e788){if(_0x20e788){return _0x20e788[_0xe931('0x21')](_0x56fd93)[_0xe931('0x22')](function(_0xca46f3){return _0xca46f3;});}return null;};}function removeEntity(_0xb49319,_0x52828f){return function(_0x1ca536){if(_0x1ca536){return _0x1ca536['destroy']()[_0xe931('0x22')](function(){_0xb49319[_0xe931('0x16')](0xcc)[_0xe931('0x15')]();});}};}function handleEntityNotFound(_0x31200e,_0x145f53){return function(_0x20dda1){if(!_0x20dda1){_0x31200e[_0xe931('0x14')](0x194);}return _0x20dda1;};}function handleError(_0xef002a,_0x382929){_0x382929=_0x382929||0x1f4;return function(_0x3b7b51){logger['error'](_0x3b7b51[_0xe931('0x23')]);if(_0x3b7b51[_0xe931('0x24')]){delete _0x3b7b51[_0xe931('0x24')];}_0xef002a[_0xe931('0x16')](_0x382929)[_0xe931('0x25')](_0x3b7b51);};}exports[_0xe931('0x26')]=function(_0xdde6cc,_0x583fdf){var _0x20696f={},_0x279575={},_0x2ac41e={'count':0x0,'rows':[]};var _0x337e31=_[_0xe931('0x27')](db['VtigerConfiguration'][_0xe931('0x28')],function(_0x309eaa){return{'name':_0x309eaa[_0xe931('0x29')],'type':_0x309eaa[_0xe931('0x2a')][_0xe931('0x2b')]};});_0x279575[_0xe931('0x2c')]=_[_0xe931('0x27')](_0x337e31,'name');_0x279575[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0xdde6cc[_0xe931('0x2d')]);_0x279575[_0xe931('0x2f')]=_[_0xe931('0x30')](_0x279575[_0xe931('0x2c')],_0x279575[_0xe931('0x2d')]);_0x20696f[_0xe931('0x31')]=_[_0xe931('0x30')](_0x279575[_0xe931('0x2c')],qs['fields'](_0xdde6cc[_0xe931('0x2d')]['fields']));_0x20696f[_0xe931('0x31')]=_0x20696f[_0xe931('0x31')][_0xe931('0x32')]?_0x20696f[_0xe931('0x31')]:_0x279575[_0xe931('0x2c')];if(!_0xdde6cc[_0xe931('0x2d')][_0xe931('0x33')](_0xe931('0x34'))){_0x20696f['limit']=qs[_0xe931('0x19')](_0xdde6cc[_0xe931('0x2d')][_0xe931('0x19')]);_0x20696f['offset']=qs[_0xe931('0x17')](_0xdde6cc['query'][_0xe931('0x17')]);}_0x20696f[_0xe931('0x35')]=qs[_0xe931('0x36')](_0xdde6cc[_0xe931('0x2d')][_0xe931('0x36')]);_0x20696f[_0xe931('0x37')]=qs[_0xe931('0x2f')](_['pick'](_0xdde6cc['query'],_0x279575[_0xe931('0x2f')]),_0x337e31);if(_0xdde6cc[_0xe931('0x2d')][_0xe931('0x38')]){_0x20696f[_0xe931('0x37')]=_[_0xe931('0x39')](_0x20696f[_0xe931('0x37')],{'$or':_[_0xe931('0x27')](_0x337e31,function(_0x240131){if(_0x240131[_0xe931('0x2a')]!==_0xe931('0x3a')){var _0x5adb36={};_0x5adb36[_0x240131['name']]={'$like':'%'+_0xdde6cc[_0xe931('0x2d')][_0xe931('0x38')]+'%'};return _0x5adb36;}})});}_0x20696f=_['merge']({},_0x20696f,_0xdde6cc[_0xe931('0x3b')]);var _0x104de3={'where':_0x20696f[_0xe931('0x37')]};return db['VtigerConfiguration']['count'](_0x104de3)[_0xe931('0x22')](function(_0x12a27b){_0x2ac41e[_0xe931('0x1a')]=_0x12a27b;if(_0xdde6cc[_0xe931('0x2d')][_0xe931('0x3c')]){_0x20696f[_0xe931('0x3d')]=[{'all':!![]}];}return db[_0xe931('0x3e')][_0xe931('0x3f')](_0x20696f);})[_0xe931('0x22')](function(_0x563ba0){_0x2ac41e['rows']=_0x563ba0;return _0x2ac41e;})[_0xe931('0x22')](respondWithFilteredResult(_0x583fdf,_0x20696f))[_0xe931('0x40')](handleError(_0x583fdf,null));};exports[_0xe931('0x41')]=function(_0x435ad6,_0x115191){var _0x22ee72={'raw':![],'where':{'id':_0x435ad6['params']['id']}},_0x427755={};_0x427755['model']=_[_0xe931('0x2e')](db[_0xe931('0x3e')][_0xe931('0x28')]);_0x427755[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0x435ad6[_0xe931('0x2d')]);_0x427755[_0xe931('0x2f')]=_['intersection'](_0x427755[_0xe931('0x2c')],_0x427755[_0xe931('0x2d')]);_0x22ee72['attributes']=_['intersection'](_0x427755['model'],qs['fields'](_0x435ad6[_0xe931('0x2d')][_0xe931('0x42')]));_0x22ee72[_0xe931('0x31')]=_0x22ee72[_0xe931('0x31')][_0xe931('0x32')]?_0x22ee72[_0xe931('0x31')]:_0x427755['model'];if(_0x435ad6[_0xe931('0x2d')][_0xe931('0x3c')]){_0x22ee72['include']=[{'all':!![]}];}_0x22ee72=_['merge']({},_0x22ee72,_0x435ad6[_0xe931('0x3b')]);return db[_0xe931('0x3e')][_0xe931('0x43')](_0x22ee72)[_0xe931('0x22')](handleEntityNotFound(_0x115191,null))[_0xe931('0x22')](respondWithResult(_0x115191,null))[_0xe931('0x40')](handleError(_0x115191,null));};exports[_0xe931('0x44')]=function(_0x3f3158,_0x433fcb){return db['VtigerConfiguration'][_0xe931('0x44')](_0x3f3158[_0xe931('0x45')],{})['then'](respondWithResult(_0x433fcb,0xc9))[_0xe931('0x40')](handleError(_0x433fcb,null));};exports[_0xe931('0x21')]=function(_0x51a6ba,_0x10304f){if(_0x51a6ba[_0xe931('0x45')]['id']){delete _0x51a6ba[_0xe931('0x45')]['id'];}return db[_0xe931('0x3e')][_0xe931('0x43')]({'where':{'id':_0x51a6ba[_0xe931('0x46')]['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x10304f,null))[_0xe931('0x22')](saveUpdates(_0x51a6ba[_0xe931('0x45')],null))[_0xe931('0x22')](respondWithResult(_0x10304f,null))[_0xe931('0x40')](handleError(_0x10304f,null));};exports[_0xe931('0x47')]=function(_0x558eea,_0x4e7ff4){return db[_0xe931('0x3e')]['find']({'where':{'id':_0x558eea[_0xe931('0x46')]['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x4e7ff4,null))[_0xe931('0x22')](removeEntity(_0x4e7ff4,null))[_0xe931('0x40')](handleError(_0x4e7ff4,null));};exports[_0xe931('0x48')]=function(_0x58044b,_0x4c9919,_0x2b6ac5){var _0x5bc0f7={};var _0x46a0cd={};var _0x1b45d6;var _0x38fae6;return db[_0xe931('0x3e')][_0xe931('0x49')]({'where':{'id':_0x58044b[_0xe931('0x46')]['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x4c9919,null))['then'](function(_0x1be2c7){if(_0x1be2c7){_0x1b45d6=_0x1be2c7;_0x46a0cd[_0xe931('0x2c')]=_[_0xe931('0x2e')](db[_0xe931('0x4a')]['rawAttributes']);_0x46a0cd[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0x58044b[_0xe931('0x2d')]);_0x46a0cd[_0xe931('0x2f')]=_['intersection'](_0x46a0cd[_0xe931('0x2c')],_0x46a0cd['query']);_0x5bc0f7['attributes']=_['intersection'](_0x46a0cd[_0xe931('0x2c')],qs[_0xe931('0x42')](_0x58044b[_0xe931('0x2d')]['fields']));_0x5bc0f7['attributes']=_0x5bc0f7[_0xe931('0x31')][_0xe931('0x32')]?_0x5bc0f7[_0xe931('0x31')]:_0x46a0cd[_0xe931('0x2c')];_0x5bc0f7[_0xe931('0x35')]=qs[_0xe931('0x36')](_0x58044b[_0xe931('0x2d')][_0xe931('0x36')]);_0x5bc0f7['where']=qs[_0xe931('0x2f')](_[_0xe931('0x4b')](_0x58044b[_0xe931('0x2d')],_0x46a0cd[_0xe931('0x2f')]));if(_0x58044b[_0xe931('0x2d')][_0xe931('0x38')]){_0x5bc0f7[_0xe931('0x37')]=_['merge'](_0x5bc0f7[_0xe931('0x37')],{'$or':_['map'](_0x5bc0f7[_0xe931('0x31')],function(_0x1a09f2){var _0x5edc9d={};_0x5edc9d[_0x1a09f2]={'$like':'%'+_0x58044b['query']['filter']+'%'};return _0x5edc9d;})});}_0x5bc0f7=_[_0xe931('0x39')]({},_0x5bc0f7,_0x58044b[_0xe931('0x3b')]);return _0x1b45d6[_0xe931('0x48')](_0x5bc0f7);}})['then'](function(_0x6994ad){if(_0x6994ad){_0x38fae6=_0x6994ad[_0xe931('0x32')];if(!_0x58044b[_0xe931('0x2d')][_0xe931('0x33')](_0xe931('0x34'))){_0x5bc0f7[_0xe931('0x19')]=qs[_0xe931('0x19')](_0x58044b[_0xe931('0x2d')]['limit']);_0x5bc0f7['offset']=qs['offset'](_0x58044b[_0xe931('0x2d')][_0xe931('0x17')]);}return _0x1b45d6['getFields'](_0x5bc0f7);}})[_0xe931('0x22')](function(_0xc9b5fa){if(_0xc9b5fa){return _0xc9b5fa?{'count':_0x38fae6,'rows':_0xc9b5fa}:null;}})[_0xe931('0x22')](respondWithResult(_0x4c9919,null))[_0xe931('0x40')](handleError(_0x4c9919,null));};exports[_0xe931('0x4c')]=function(_0x4a8dfe,_0x1c12ec,_0x391db1){var _0x4d37ca={};var _0x326c36={};var _0x31cb93;var _0x29d93b;return db[_0xe931('0x3e')][_0xe931('0x49')]({'where':{'id':_0x4a8dfe['params']['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x1c12ec,null))[_0xe931('0x22')](function(_0x476f16){if(_0x476f16){_0x31cb93=_0x476f16;_0x326c36[_0xe931('0x2c')]=_[_0xe931('0x2e')](db['VtigerField']['rawAttributes']);_0x326c36[_0xe931('0x2d')]=_[_0xe931('0x2e')](_0x4a8dfe[_0xe931('0x2d')]);_0x326c36[_0xe931('0x2f')]=_[_0xe931('0x30')](_0x326c36[_0xe931('0x2c')],_0x326c36[_0xe931('0x2d')]);_0x4d37ca[_0xe931('0x31')]=_['intersection'](_0x326c36[_0xe931('0x2c')],qs[_0xe931('0x42')](_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x42')]));_0x4d37ca[_0xe931('0x31')]=_0x4d37ca[_0xe931('0x31')][_0xe931('0x32')]?_0x4d37ca['attributes']:_0x326c36['model'];_0x4d37ca[_0xe931('0x35')]=qs[_0xe931('0x36')](_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x36')]);_0x4d37ca[_0xe931('0x37')]=qs[_0xe931('0x2f')](_[_0xe931('0x4b')](_0x4a8dfe[_0xe931('0x2d')],_0x326c36[_0xe931('0x2f')]));if(_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x38')]){_0x4d37ca[_0xe931('0x37')]=_['merge'](_0x4d37ca[_0xe931('0x37')],{'$or':_[_0xe931('0x27')](_0x4d37ca[_0xe931('0x31')],function(_0x3e34cb){var _0x49b852={};_0x49b852[_0x3e34cb]={'$like':'%'+_0x4a8dfe['query']['filter']+'%'};return _0x49b852;})});}_0x4d37ca=_['merge']({},_0x4d37ca,_0x4a8dfe[_0xe931('0x3b')]);return _0x31cb93['getSubjects'](_0x4d37ca);}})['then'](function(_0x18fd8){if(_0x18fd8){_0x29d93b=_0x18fd8['length'];if(!_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x33')](_0xe931('0x34'))){_0x4d37ca[_0xe931('0x19')]=qs[_0xe931('0x19')](_0x4a8dfe[_0xe931('0x2d')]['limit']);_0x4d37ca['offset']=qs[_0xe931('0x17')](_0x4a8dfe[_0xe931('0x2d')][_0xe931('0x17')]);}return _0x31cb93[_0xe931('0x4c')](_0x4d37ca);}})[_0xe931('0x22')](function(_0x14c1b0){if(_0x14c1b0){return _0x14c1b0?{'count':_0x29d93b,'rows':_0x14c1b0}:null;}})[_0xe931('0x22')](respondWithResult(_0x1c12ec,null))['catch'](handleError(_0x1c12ec,null));};exports['getDescriptions']=function(_0x11f588,_0x3c09c6,_0x1e85a6){var _0x3dbcd9={};var _0x150535={};var _0x714fd4;var _0x56fe10;return db['VtigerConfiguration'][_0xe931('0x49')]({'where':{'id':_0x11f588['params']['id']}})[_0xe931('0x22')](handleEntityNotFound(_0x3c09c6,null))['then'](function(_0x3aacdc){if(_0x3aacdc){_0x714fd4=_0x3aacdc;_0x150535['model']=_[_0xe931('0x2e')](db[_0xe931('0x4a')][_0xe931('0x28')]);_0x150535['query']=_[_0xe931('0x2e')](_0x11f588[_0xe931('0x2d')]);_0x150535['filters']=_[_0xe931('0x30')](_0x150535[_0xe931('0x2c')],_0x150535['query']);_0x3dbcd9[_0xe931('0x31')]=_[_0xe931('0x30')](_0x150535[_0xe931('0x2c')],qs[_0xe931('0x42')](_0x11f588[_0xe931('0x2d')][_0xe931('0x42')]));_0x3dbcd9[_0xe931('0x31')]=_0x3dbcd9[_0xe931('0x31')]['length']?_0x3dbcd9[_0xe931('0x31')]:_0x150535[_0xe931('0x2c')];_0x3dbcd9['order']=qs[_0xe931('0x36')](_0x11f588[_0xe931('0x2d')][_0xe931('0x36')]);_0x3dbcd9['where']=qs[_0xe931('0x2f')](_[_0xe931('0x4b')](_0x11f588['query'],_0x150535[_0xe931('0x2f')]));if(_0x11f588[_0xe931('0x2d')][_0xe931('0x38')]){_0x3dbcd9[_0xe931('0x37')]=_[_0xe931('0x39')](_0x3dbcd9[_0xe931('0x37')],{'$or':_[_0xe931('0x27')](_0x3dbcd9[_0xe931('0x31')],function(_0x258684){var _0x781779={};_0x781779[_0x258684]={'$like':'%'+_0x11f588[_0xe931('0x2d')][_0xe931('0x38')]+'%'};return _0x781779;})});}_0x3dbcd9=_['merge']({},_0x3dbcd9,_0x11f588[_0xe931('0x3b')]);return _0x714fd4[_0xe931('0x4d')](_0x3dbcd9);}})['then'](function(_0x4e108a){if(_0x4e108a){_0x56fe10=_0x4e108a['length'];if(!_0x11f588['query'][_0xe931('0x33')](_0xe931('0x34'))){_0x3dbcd9[_0xe931('0x19')]=qs[_0xe931('0x19')](_0x11f588[_0xe931('0x2d')][_0xe931('0x19')]);_0x3dbcd9['offset']=qs[_0xe931('0x17')](_0x11f588[_0xe931('0x2d')][_0xe931('0x17')]);}return _0x714fd4[_0xe931('0x4d')](_0x3dbcd9);}})[_0xe931('0x22')](function(_0x58c48b){if(_0x58c48b){return _0x58c48b?{'count':_0x56fe10,'rows':_0x58c48b}:null;}})['then'](respondWithResult(_0x3c09c6,null))[_0xe931('0x40')](handleError(_0x3c09c6,null));}; \ No newline at end of file +var _0x151a=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x544627,_0x3e7b3c){var _0x57da1f=function(_0x1a22a5){while(--_0x1a22a5){_0x544627['push'](_0x544627['shift']());}};_0x57da1f(++_0x3e7b3c);}(_0x151a,0x12f));var _0xa151=function(_0x75276e,_0x4a4015){_0x75276e=_0x75276e-0x0;var _0x3d8d88=_0x151a[_0x75276e];return _0x3d8d88;};'use strict';var emlformat=require(_0xa151('0x0'));var rimraf=require(_0xa151('0x1'));var zipdir=require(_0xa151('0x2'));var jsonpatch=require(_0xa151('0x3'));var rp=require('request-promise');var moment=require(_0xa151('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa151('0x5'));var util=require('util');var path=require(_0xa151('0x6'));var sox=require(_0xa151('0x7'));var csv=require('to-csv');var ejs=require(_0xa151('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa151('0x9'));var squel=require(_0xa151('0xa'));var crypto=require(_0xa151('0xb'));var jsforce=require(_0xa151('0xc'));var deskjs=require(_0xa151('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa151('0xe'));var Papa=require(_0xa151('0xf'));var Redis=require(_0xa151('0x10'));var authService=require(_0xa151('0x11'));var qs=require(_0xa151('0x12'));var as=require(_0xa151('0x13'));var hardwareService=require(_0xa151('0x14'));var logger=require(_0xa151('0x15'))(_0xa151('0x16'));var utils=require(_0xa151('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa151('0x18'));var db=require(_0xa151('0x19'))['db'];function respondWithStatusCode(_0x243120,_0x5387a2){_0x5387a2=_0x5387a2||0xcc;return function(_0x23879e){if(_0x23879e){return _0x243120['sendStatus'](_0x5387a2);}return _0x243120[_0xa151('0x1a')](_0x5387a2)[_0xa151('0x1b')]();};}function respondWithResult(_0x254406,_0x2e4a76){_0x2e4a76=_0x2e4a76||0xc8;return function(_0x16b76d){if(_0x16b76d){return _0x254406[_0xa151('0x1a')](_0x2e4a76)[_0xa151('0x1c')](_0x16b76d);}};}function respondWithFilteredResult(_0x4cfc29,_0x235115){return function(_0x51e2a8){if(_0x51e2a8){var _0x3131e8=typeof _0x235115[_0xa151('0x1d')]==='undefined'&&typeof _0x235115[_0xa151('0x1e')]===_0xa151('0x1f');var _0x1c3eb1=_0x51e2a8[_0xa151('0x20')];var _0x3bb57f=_0x3131e8?0x0:_0x235115['offset'];var _0x1c4438=_0x3131e8?_0x51e2a8[_0xa151('0x20')]:_0x235115[_0xa151('0x1d')]+_0x235115[_0xa151('0x1e')];var _0x21cb65;if(_0x1c4438>=_0x1c3eb1){_0x1c4438=_0x1c3eb1;_0x21cb65=0xc8;}else{_0x21cb65=0xce;}_0x4cfc29[_0xa151('0x1a')](_0x21cb65);return _0x4cfc29['set'](_0xa151('0x21'),_0x3bb57f+'-'+_0x1c4438+'/'+_0x1c3eb1)[_0xa151('0x1c')](_0x51e2a8);}return null;};}function patchUpdates(_0x409e0a){return function(_0x1c0614){try{jsonpatch[_0xa151('0x22')](_0x1c0614,_0x409e0a,!![]);}catch(_0x108106){return BPromise[_0xa151('0x23')](_0x108106);}return _0x1c0614[_0xa151('0x24')]();};}function saveUpdates(_0x824855,_0x4ba9c4){return function(_0x519b47){if(_0x519b47){return _0x519b47[_0xa151('0x25')](_0x824855)['then'](function(_0x57d51e){return _0x57d51e;});}return null;};}function removeEntity(_0x5b7eb2,_0x5b4b9b){return function(_0x181a97){if(_0x181a97){return _0x181a97[_0xa151('0x26')]()[_0xa151('0x27')](function(){_0x5b7eb2[_0xa151('0x1a')](0xcc)[_0xa151('0x1b')]();});}};}function handleEntityNotFound(_0x16a7da,_0x3087b0){return function(_0x188203){if(!_0x188203){_0x16a7da['sendStatus'](0x194);}return _0x188203;};}function handleError(_0x8c5bf9,_0x43cd67){_0x43cd67=_0x43cd67||0x1f4;return function(_0x2da3bf){logger['error'](_0x2da3bf[_0xa151('0x28')]);if(_0x2da3bf[_0xa151('0x29')]){delete _0x2da3bf[_0xa151('0x29')];}_0x8c5bf9[_0xa151('0x1a')](_0x43cd67)[_0xa151('0x2a')](_0x2da3bf);};}exports[_0xa151('0x2b')]=function(_0x63446,_0x3418f6){var _0xd15269={},_0x41ae5b={},_0x283b35={'count':0x0,'rows':[]};var _0x4e4f10=_[_0xa151('0x2c')](db[_0xa151('0x2d')][_0xa151('0x2e')],function(_0x3ceb6b){return{'name':_0x3ceb6b[_0xa151('0x2f')],'type':_0x3ceb6b[_0xa151('0x30')]['key']};});_0x41ae5b[_0xa151('0x31')]=_[_0xa151('0x2c')](_0x4e4f10,'name');_0x41ae5b[_0xa151('0x32')]=_['keys'](_0x63446[_0xa151('0x32')]);_0x41ae5b[_0xa151('0x33')]=_[_0xa151('0x34')](_0x41ae5b[_0xa151('0x31')],_0x41ae5b['query']);_0xd15269[_0xa151('0x35')]=_['intersection'](_0x41ae5b['model'],qs[_0xa151('0x36')](_0x63446[_0xa151('0x32')][_0xa151('0x36')]));_0xd15269[_0xa151('0x35')]=_0xd15269['attributes']['length']?_0xd15269['attributes']:_0x41ae5b['model'];if(!_0x63446[_0xa151('0x32')][_0xa151('0x37')]('nolimit')){_0xd15269[_0xa151('0x1e')]=qs[_0xa151('0x1e')](_0x63446[_0xa151('0x32')]['limit']);_0xd15269[_0xa151('0x1d')]=qs['offset'](_0x63446[_0xa151('0x32')]['offset']);}_0xd15269[_0xa151('0x38')]=qs['sort'](_0x63446[_0xa151('0x32')][_0xa151('0x39')]);_0xd15269[_0xa151('0x3a')]=qs['filters'](_[_0xa151('0x3b')](_0x63446['query'],_0x41ae5b['filters']),_0x4e4f10);if(_0x63446[_0xa151('0x32')][_0xa151('0x3c')]){_0xd15269['where']=_['merge'](_0xd15269[_0xa151('0x3a')],{'$or':_[_0xa151('0x2c')](_0x4e4f10,function(_0x1b0170){if(_0x1b0170['type']!=='VIRTUAL'){var _0x17dd65={};_0x17dd65[_0x1b0170[_0xa151('0x29')]]={'$like':'%'+_0x63446['query']['filter']+'%'};return _0x17dd65;}})});}_0xd15269=_[_0xa151('0x3d')]({},_0xd15269,_0x63446[_0xa151('0x3e')]);var _0x417d72={'where':_0xd15269[_0xa151('0x3a')]};return db['VtigerConfiguration']['count'](_0x417d72)[_0xa151('0x27')](function(_0x1668dc){_0x283b35['count']=_0x1668dc;if(_0x63446[_0xa151('0x32')][_0xa151('0x3f')]){_0xd15269[_0xa151('0x40')]=[{'all':!![]}];}return db[_0xa151('0x2d')][_0xa151('0x41')](_0xd15269);})['then'](function(_0xffdf5e){_0x283b35[_0xa151('0x42')]=_0xffdf5e;return _0x283b35;})[_0xa151('0x27')](respondWithFilteredResult(_0x3418f6,_0xd15269))[_0xa151('0x43')](handleError(_0x3418f6,null));};exports[_0xa151('0x44')]=function(_0x46684c,_0xc93324){var _0x31bc86={'raw':![],'where':{'id':_0x46684c[_0xa151('0x45')]['id']}},_0x22b2c2={};_0x22b2c2[_0xa151('0x31')]=_['keys'](db[_0xa151('0x2d')][_0xa151('0x2e')]);_0x22b2c2[_0xa151('0x32')]=_[_0xa151('0x46')](_0x46684c[_0xa151('0x32')]);_0x22b2c2[_0xa151('0x33')]=_[_0xa151('0x34')](_0x22b2c2[_0xa151('0x31')],_0x22b2c2[_0xa151('0x32')]);_0x31bc86[_0xa151('0x35')]=_[_0xa151('0x34')](_0x22b2c2[_0xa151('0x31')],qs[_0xa151('0x36')](_0x46684c[_0xa151('0x32')][_0xa151('0x36')]));_0x31bc86[_0xa151('0x35')]=_0x31bc86[_0xa151('0x35')][_0xa151('0x47')]?_0x31bc86[_0xa151('0x35')]:_0x22b2c2[_0xa151('0x31')];if(_0x46684c[_0xa151('0x32')]['includeAll']){_0x31bc86[_0xa151('0x40')]=[{'all':!![]}];}_0x31bc86=_[_0xa151('0x3d')]({},_0x31bc86,_0x46684c[_0xa151('0x3e')]);return db[_0xa151('0x2d')][_0xa151('0x48')](_0x31bc86)['then'](handleEntityNotFound(_0xc93324,null))[_0xa151('0x27')](respondWithResult(_0xc93324,null))[_0xa151('0x43')](handleError(_0xc93324,null));};exports[_0xa151('0x49')]=function(_0x6e696c,_0x3a7b30){return db['VtigerConfiguration'][_0xa151('0x49')](_0x6e696c[_0xa151('0x4a')],{})[_0xa151('0x27')](respondWithResult(_0x3a7b30,0xc9))[_0xa151('0x43')](handleError(_0x3a7b30,null));};exports[_0xa151('0x25')]=function(_0x49f66d,_0x45683f){if(_0x49f66d[_0xa151('0x4a')]['id']){delete _0x49f66d['body']['id'];}return db[_0xa151('0x2d')][_0xa151('0x48')]({'where':{'id':_0x49f66d[_0xa151('0x45')]['id']}})['then'](handleEntityNotFound(_0x45683f,null))[_0xa151('0x27')](saveUpdates(_0x49f66d[_0xa151('0x4a')],null))[_0xa151('0x27')](respondWithResult(_0x45683f,null))[_0xa151('0x43')](handleError(_0x45683f,null));};exports['destroy']=function(_0x53cb3f,_0x166ca3){return db[_0xa151('0x2d')]['find']({'where':{'id':_0x53cb3f[_0xa151('0x45')]['id']}})[_0xa151('0x27')](handleEntityNotFound(_0x166ca3,null))[_0xa151('0x27')](removeEntity(_0x166ca3,null))[_0xa151('0x43')](handleError(_0x166ca3,null));};exports['getFields']=function(_0xd73f10,_0x1ec37d,_0x218620){var _0x8b1e39={};var _0x36ab50={};var _0x143371;var _0x3ab6ee;return db[_0xa151('0x2d')]['findOne']({'where':{'id':_0xd73f10[_0xa151('0x45')]['id']}})[_0xa151('0x27')](handleEntityNotFound(_0x1ec37d,null))[_0xa151('0x27')](function(_0x5bccc6){if(_0x5bccc6){_0x143371=_0x5bccc6;_0x36ab50[_0xa151('0x31')]=_[_0xa151('0x46')](db['VtigerField'][_0xa151('0x2e')]);_0x36ab50['query']=_[_0xa151('0x46')](_0xd73f10[_0xa151('0x32')]);_0x36ab50[_0xa151('0x33')]=_[_0xa151('0x34')](_0x36ab50['model'],_0x36ab50[_0xa151('0x32')]);_0x8b1e39[_0xa151('0x35')]=_[_0xa151('0x34')](_0x36ab50[_0xa151('0x31')],qs[_0xa151('0x36')](_0xd73f10['query'][_0xa151('0x36')]));_0x8b1e39[_0xa151('0x35')]=_0x8b1e39[_0xa151('0x35')][_0xa151('0x47')]?_0x8b1e39[_0xa151('0x35')]:_0x36ab50[_0xa151('0x31')];_0x8b1e39['order']=qs[_0xa151('0x39')](_0xd73f10[_0xa151('0x32')][_0xa151('0x39')]);_0x8b1e39['where']=qs[_0xa151('0x33')](_[_0xa151('0x3b')](_0xd73f10['query'],_0x36ab50[_0xa151('0x33')]));if(_0xd73f10['query'][_0xa151('0x3c')]){_0x8b1e39[_0xa151('0x3a')]=_[_0xa151('0x3d')](_0x8b1e39['where'],{'$or':_[_0xa151('0x2c')](_0x8b1e39[_0xa151('0x35')],function(_0xc6abc2){var _0x2bc15d={};_0x2bc15d[_0xc6abc2]={'$like':'%'+_0xd73f10[_0xa151('0x32')][_0xa151('0x3c')]+'%'};return _0x2bc15d;})});}_0x8b1e39=_[_0xa151('0x3d')]({},_0x8b1e39,_0xd73f10[_0xa151('0x3e')]);return _0x143371[_0xa151('0x4b')](_0x8b1e39);}})['then'](function(_0x56a344){if(_0x56a344){_0x3ab6ee=_0x56a344[_0xa151('0x47')];if(!_0xd73f10[_0xa151('0x32')][_0xa151('0x37')]('nolimit')){_0x8b1e39[_0xa151('0x1e')]=qs[_0xa151('0x1e')](_0xd73f10[_0xa151('0x32')][_0xa151('0x1e')]);_0x8b1e39[_0xa151('0x1d')]=qs['offset'](_0xd73f10['query'][_0xa151('0x1d')]);}return _0x143371[_0xa151('0x4b')](_0x8b1e39);}})[_0xa151('0x27')](function(_0x461fc7){if(_0x461fc7){return _0x461fc7?{'count':_0x3ab6ee,'rows':_0x461fc7}:null;}})[_0xa151('0x27')](respondWithResult(_0x1ec37d,null))[_0xa151('0x43')](handleError(_0x1ec37d,null));};exports['getSubjects']=function(_0x509bec,_0x9e10c3,_0x5cd9dd){var _0x318094={};var _0x386ece={};var _0x451932;var _0x417d08;return db[_0xa151('0x2d')][_0xa151('0x4c')]({'where':{'id':_0x509bec[_0xa151('0x45')]['id']}})['then'](handleEntityNotFound(_0x9e10c3,null))[_0xa151('0x27')](function(_0x3be0d3){if(_0x3be0d3){_0x451932=_0x3be0d3;_0x386ece[_0xa151('0x31')]=_['keys'](db[_0xa151('0x4d')][_0xa151('0x2e')]);_0x386ece['query']=_[_0xa151('0x46')](_0x509bec['query']);_0x386ece['filters']=_['intersection'](_0x386ece[_0xa151('0x31')],_0x386ece[_0xa151('0x32')]);_0x318094['attributes']=_['intersection'](_0x386ece['model'],qs[_0xa151('0x36')](_0x509bec['query'][_0xa151('0x36')]));_0x318094[_0xa151('0x35')]=_0x318094[_0xa151('0x35')][_0xa151('0x47')]?_0x318094[_0xa151('0x35')]:_0x386ece[_0xa151('0x31')];_0x318094['order']=qs[_0xa151('0x39')](_0x509bec[_0xa151('0x32')][_0xa151('0x39')]);_0x318094[_0xa151('0x3a')]=qs[_0xa151('0x33')](_[_0xa151('0x3b')](_0x509bec['query'],_0x386ece[_0xa151('0x33')]));if(_0x509bec[_0xa151('0x32')][_0xa151('0x3c')]){_0x318094[_0xa151('0x3a')]=_[_0xa151('0x3d')](_0x318094[_0xa151('0x3a')],{'$or':_[_0xa151('0x2c')](_0x318094[_0xa151('0x35')],function(_0x266e82){var _0x482503={};_0x482503[_0x266e82]={'$like':'%'+_0x509bec[_0xa151('0x32')][_0xa151('0x3c')]+'%'};return _0x482503;})});}_0x318094=_['merge']({},_0x318094,_0x509bec[_0xa151('0x3e')]);return _0x451932[_0xa151('0x4e')](_0x318094);}})[_0xa151('0x27')](function(_0x4b3c5c){if(_0x4b3c5c){_0x417d08=_0x4b3c5c['length'];if(!_0x509bec[_0xa151('0x32')][_0xa151('0x37')]('nolimit')){_0x318094[_0xa151('0x1e')]=qs[_0xa151('0x1e')](_0x509bec[_0xa151('0x32')][_0xa151('0x1e')]);_0x318094[_0xa151('0x1d')]=qs[_0xa151('0x1d')](_0x509bec[_0xa151('0x32')][_0xa151('0x1d')]);}return _0x451932[_0xa151('0x4e')](_0x318094);}})[_0xa151('0x27')](function(_0xc975e4){if(_0xc975e4){return _0xc975e4?{'count':_0x417d08,'rows':_0xc975e4}:null;}})[_0xa151('0x27')](respondWithResult(_0x9e10c3,null))[_0xa151('0x43')](handleError(_0x9e10c3,null));};exports['getDescriptions']=function(_0x55aa60,_0x5d2480,_0xfb0132){var _0x289060={};var _0x4e3397={};var _0x4e1c03;var _0x95fd4c;return db[_0xa151('0x2d')][_0xa151('0x4c')]({'where':{'id':_0x55aa60[_0xa151('0x45')]['id']}})[_0xa151('0x27')](handleEntityNotFound(_0x5d2480,null))[_0xa151('0x27')](function(_0x22591c){if(_0x22591c){_0x4e1c03=_0x22591c;_0x4e3397[_0xa151('0x31')]=_[_0xa151('0x46')](db[_0xa151('0x4d')]['rawAttributes']);_0x4e3397[_0xa151('0x32')]=_[_0xa151('0x46')](_0x55aa60[_0xa151('0x32')]);_0x4e3397['filters']=_[_0xa151('0x34')](_0x4e3397[_0xa151('0x31')],_0x4e3397[_0xa151('0x32')]);_0x289060['attributes']=_['intersection'](_0x4e3397[_0xa151('0x31')],qs['fields'](_0x55aa60[_0xa151('0x32')][_0xa151('0x36')]));_0x289060[_0xa151('0x35')]=_0x289060[_0xa151('0x35')]['length']?_0x289060[_0xa151('0x35')]:_0x4e3397['model'];_0x289060[_0xa151('0x38')]=qs[_0xa151('0x39')](_0x55aa60[_0xa151('0x32')][_0xa151('0x39')]);_0x289060[_0xa151('0x3a')]=qs['filters'](_[_0xa151('0x3b')](_0x55aa60['query'],_0x4e3397[_0xa151('0x33')]));if(_0x55aa60[_0xa151('0x32')][_0xa151('0x3c')]){_0x289060[_0xa151('0x3a')]=_[_0xa151('0x3d')](_0x289060[_0xa151('0x3a')],{'$or':_[_0xa151('0x2c')](_0x289060[_0xa151('0x35')],function(_0x136da6){var _0x4d9d14={};_0x4d9d14[_0x136da6]={'$like':'%'+_0x55aa60[_0xa151('0x32')]['filter']+'%'};return _0x4d9d14;})});}_0x289060=_[_0xa151('0x3d')]({},_0x289060,_0x55aa60['options']);return _0x4e1c03[_0xa151('0x4f')](_0x289060);}})['then'](function(_0x541f88){if(_0x541f88){_0x95fd4c=_0x541f88[_0xa151('0x47')];if(!_0x55aa60[_0xa151('0x32')][_0xa151('0x37')](_0xa151('0x50'))){_0x289060[_0xa151('0x1e')]=qs[_0xa151('0x1e')](_0x55aa60['query'][_0xa151('0x1e')]);_0x289060[_0xa151('0x1d')]=qs[_0xa151('0x1d')](_0x55aa60['query']['offset']);}return _0x4e1c03[_0xa151('0x4f')](_0x289060);}})[_0xa151('0x27')](function(_0x29274b){if(_0x29274b){return _0x29274b?{'count':_0x95fd4c,'rows':_0x29274b}:null;}})['then'](respondWithResult(_0x5d2480,null))['catch'](handleError(_0x5d2480,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 0eeacc0..1f12e75 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 _0x63a3=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash','util'];(function(_0x667c6a,_0x2155cd){var _0x36396a=function(_0x29d602){while(--_0x29d602){_0x667c6a['push'](_0x667c6a['shift']());}};_0x36396a(++_0x2155cd);}(_0x63a3,0x170));var _0x363a=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x63a3[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x363a('0x0'));var util=require(_0x363a('0x1'));var logger=require(_0x363a('0x2'))('api');var moment=require(_0x363a('0x3'));var BPromise=require(_0x363a('0x4'));var rp=require(_0x363a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x363a('0x6'));var attributes=require(_0x363a('0x7'));module[_0x363a('0x8')]=function(_0x3ab702,_0x582e12){return _0x3ab702['define'](_0x363a('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6142=['exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x1e44a5,_0x35a714){var _0x54a65e=function(_0x5a89cf){while(--_0x5a89cf){_0x1e44a5['push'](_0x1e44a5['shift']());}};_0x54a65e(++_0x35a714);}(_0x6142,0x16c));var _0x2614=function(_0x265def,_0x33493a){_0x265def=_0x265def-0x0;var _0x57bf0d=_0x6142[_0x265def];return _0x57bf0d;};'use strict';var _=require('lodash');var util=require(_0x2614('0x0'));var logger=require(_0x2614('0x1'))(_0x2614('0x2'));var moment=require('moment');var BPromise=require(_0x2614('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2614('0x4'));var rimraf=require(_0x2614('0x5'));var config=require(_0x2614('0x6'));var attributes=require(_0x2614('0x7'));module[_0x2614('0x8')]=function(_0x193a0e,_0x3a7929){return _0x193a0e[_0x2614('0x9')](_0x2614('0xa'),attributes,{'tableName':_0x2614('0xb'),'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 53909d0..6d01ab6 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 _0x4665=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','lodash','util'];(function(_0x198373,_0x82a53a){var _0xa6d376=function(_0x24521b){while(--_0x24521b){_0x198373['push'](_0x198373['shift']());}};_0xa6d376(++_0x82a53a);}(_0x4665,0x1a2));var _0x5466=function(_0x3383ca,_0x30666d){_0x3383ca=_0x3383ca-0x0;var _0x1fd694=_0x4665[_0x3383ca];return _0x1fd694;};'use strict';var _=require(_0x5466('0x0'));var util=require(_0x5466('0x1'));var moment=require('moment');var BPromise=require(_0x5466('0x2'));var rs=require(_0x5466('0x3'));var fs=require('fs');var Redis=require(_0x5466('0x4'));var db=require(_0x5466('0x5'))['db'];var utils=require(_0x5466('0x6'));var logger=require(_0x5466('0x7'))(_0x5466('0x8'));var config=require(_0x5466('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5466('0xa')][_0x5466('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fb3cc,_0x1e2ea8,_0x79f00a){return new BPromise(function(_0x670e27,_0x5e3a06){return client[_0x5466('0xc')](_0x4fb3cc,_0x79f00a)[_0x5466('0xd')](function(_0x25a199){logger['info'](_0x5466('0xe'),_0x1e2ea8,'request\x20sent');logger['debug'](_0x5466('0xf'),_0x1e2ea8,_0x5466('0x10'),JSON['stringify'](_0x25a199));if(_0x25a199[_0x5466('0x11')]){if(_0x25a199['error']['code']===0x1f4){logger[_0x5466('0x11')](_0x5466('0xe'),_0x1e2ea8,_0x25a199['error'][_0x5466('0x12')]);return _0x5e3a06(_0x25a199[_0x5466('0x11')]['message']);}logger[_0x5466('0x11')](_0x5466('0xe'),_0x1e2ea8,_0x25a199['error'][_0x5466('0x12')]);return _0x670e27(_0x25a199[_0x5466('0x11')]['message']);}else{logger[_0x5466('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x1e2ea8,_0x5466('0x10'));_0x670e27(_0x25a199['result'][_0x5466('0x12')]);}})['catch'](function(_0x456ac2){logger[_0x5466('0x11')](_0x5466('0xe'),_0x1e2ea8,_0x456ac2);_0x5e3a06(_0x456ac2);});});} \ No newline at end of file +var _0x92f8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','lodash','util','bluebird'];(function(_0x3ae4f7,_0x43058e){var _0x42027c=function(_0x41d731){while(--_0x41d731){_0x3ae4f7['push'](_0x3ae4f7['shift']());}};_0x42027c(++_0x43058e);}(_0x92f8,0xc3));var _0x892f=function(_0x1832a0,_0x4ac21c){_0x1832a0=_0x1832a0-0x0;var _0x4fed96=_0x92f8[_0x1832a0];return _0x4fed96;};'use strict';var _=require(_0x892f('0x0'));var util=require(_0x892f('0x1'));var moment=require('moment');var BPromise=require(_0x892f('0x2'));var rs=require(_0x892f('0x3'));var fs=require('fs');var Redis=require(_0x892f('0x4'));var db=require(_0x892f('0x5'))['db'];var utils=require(_0x892f('0x6'));var logger=require(_0x892f('0x7'))(_0x892f('0x8'));var config=require(_0x892f('0x9'));var jayson=require(_0x892f('0xa'));var client=jayson[_0x892f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x567f20,_0x40c5ed,_0x478384){return new BPromise(function(_0x236349,_0x4d449f){return client[_0x892f('0xc')](_0x567f20,_0x478384)[_0x892f('0xd')](function(_0x1602fe){logger['info'](_0x892f('0xe'),_0x40c5ed,'request\x20sent');logger[_0x892f('0xf')](_0x892f('0x10'),_0x40c5ed,_0x892f('0x11'),JSON['stringify'](_0x1602fe));if(_0x1602fe['error']){if(_0x1602fe[_0x892f('0x12')][_0x892f('0x13')]===0x1f4){logger[_0x892f('0x12')](_0x892f('0xe'),_0x40c5ed,_0x1602fe[_0x892f('0x12')][_0x892f('0x14')]);return _0x4d449f(_0x1602fe['error']['message']);}logger['error'](_0x892f('0xe'),_0x40c5ed,_0x1602fe[_0x892f('0x12')][_0x892f('0x14')]);return _0x236349(_0x1602fe['error'][_0x892f('0x14')]);}else{logger[_0x892f('0x15')](_0x892f('0xe'),_0x40c5ed,_0x892f('0x11'));_0x236349(_0x1602fe['result'][_0x892f('0x14')]);}})['catch'](function(_0x1c01d6){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x40c5ed,_0x1c01d6);_0x4d449f(_0x1c01d6);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 59b14f7..8a0f32a 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 _0xfc94=['multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','update','destroy'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0xfc94,0x12c));var _0x4fc9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xfc94[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x4fc9('0x0'));var util=require('util');var path=require(_0x4fc9('0x1'));var timeout=require(_0x4fc9('0x2'));var express=require(_0x4fc9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4fc9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4fc9('0x5'));var controller=require(_0x4fc9('0x6'));router[_0x4fc9('0x7')]('/',auth[_0x4fc9('0x8')](),controller[_0x4fc9('0x9')]);router['get'](_0x4fc9('0xa'),auth[_0x4fc9('0x8')](),controller[_0x4fc9('0xb')]);router[_0x4fc9('0xc')]('/',auth[_0x4fc9('0x8')](),controller['create']);router['put']('/:id',auth[_0x4fc9('0x8')](),controller[_0x4fc9('0xd')]);router['delete'](_0x4fc9('0xa'),auth[_0x4fc9('0x8')](),controller[_0x4fc9('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb89d=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','destroy','exports','multer'];(function(_0x21dbbc,_0x2e2ba6){var _0x530be4=function(_0x5d8c8a){while(--_0x5d8c8a){_0x21dbbc['push'](_0x21dbbc['shift']());}};_0x530be4(++_0x2e2ba6);}(_0xb89d,0x15d));var _0xdb89=function(_0x16cb27,_0x3c0260){_0x16cb27=_0x16cb27-0x0;var _0x2392c7=_0xb89d[_0x16cb27];return _0x2392c7;};'use strict';var multer=require(_0xdb89('0x0'));var util=require('util');var path=require(_0xdb89('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb89('0x2'));var router=express['Router']();var fs_extra=require(_0xdb89('0x3'));var auth=require(_0xdb89('0x4'));var interaction=require(_0xdb89('0x5'));var config=require(_0xdb89('0x6'));var controller=require('./intVtigerField.controller');router[_0xdb89('0x7')]('/',auth[_0xdb89('0x8')](),controller[_0xdb89('0x9')]);router['get']('/:id',auth[_0xdb89('0x8')](),controller[_0xdb89('0xa')]);router[_0xdb89('0xb')]('/',auth[_0xdb89('0x8')](),controller['create']);router['put']('/:id',auth[_0xdb89('0x8')](),controller['update']);router['delete']('/:id',auth[_0xdb89('0x8')](),controller[_0xdb89('0xc')]);module[_0xdb89('0xd')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 36907b9..0d43b8e 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 _0xd6a4=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','string'];(function(_0x1ffc22,_0x288864){var _0x103432=function(_0x1070b4){while(--_0x1070b4){_0x1ffc22['push'](_0x1ffc22['shift']());}};_0x103432(++_0x288864);}(_0xd6a4,0x1ea));var _0x4d6a=function(_0xfebe2,_0x4b7532){_0xfebe2=_0xfebe2-0x0;var _0x19b4fa=_0xd6a4[_0xfebe2];return _0x19b4fa;};'use strict';var Sequelize=require(_0x4d6a('0x0'));module[_0x4d6a('0x1')]={'type':{'type':Sequelize[_0x4d6a('0x2')]('string',_0x4d6a('0x3'),_0x4d6a('0x4'),'keyValue','picklist'),'defaultValue':_0x4d6a('0x5')},'content':{'type':Sequelize[_0x4d6a('0x6')]},'key':{'type':Sequelize[_0x4d6a('0x6')]},'keyType':{'type':Sequelize[_0x4d6a('0x2')]('string',_0x4d6a('0x3'),_0x4d6a('0x4'))},'keyContent':{'type':Sequelize[_0x4d6a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4d6a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4d6a('0x6')]}}; \ No newline at end of file +var _0x57e4=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x260b6f,_0x1edc36){var _0x3f672e=function(_0x4b536c){while(--_0x4b536c){_0x260b6f['push'](_0x260b6f['shift']());}};_0x3f672e(++_0x1edc36);}(_0x57e4,0x129));var _0x457e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x57e4[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x457e('0x0')]={'type':{'type':Sequelize[_0x457e('0x1')](_0x457e('0x2'),_0x457e('0x3'),_0x457e('0x4'),_0x457e('0x5'),_0x457e('0x6')),'defaultValue':_0x457e('0x2')},'content':{'type':Sequelize[_0x457e('0x7')]},'key':{'type':Sequelize[_0x457e('0x7')]},'keyType':{'type':Sequelize[_0x457e('0x1')](_0x457e('0x2'),_0x457e('0x3'),_0x457e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x457e('0x7')]},'nameField':{'type':Sequelize[_0x457e('0x7')]},'customField':{'type':Sequelize[_0x457e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 8aa1039..7246806 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 _0x26f3=['moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','reject','update','then','error','stack','name','send','index','VtigerField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','destroy','fast-json-patch','request-promise'];(function(_0xdcb59d,_0x232425){var _0x4b9cae=function(_0x1510d2){while(--_0x1510d2){_0xdcb59d['push'](_0xdcb59d['shift']());}};_0x4b9cae(++_0x232425);}(_0x26f3,0x166));var _0x326f=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x26f3[_0x264b61];return _0x8fff4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x326f('0x0'));var rp=require(_0x326f('0x1'));var moment=require(_0x326f('0x2'));var BPromise=require(_0x326f('0x3'));var Mustache=require('mustache');var util=require(_0x326f('0x4'));var path=require(_0x326f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x326f('0x6'));var fs=require('fs');var fs_extra=require(_0x326f('0x7'));var _=require(_0x326f('0x8'));var squel=require(_0x326f('0x9'));var crypto=require(_0x326f('0xa'));var jsforce=require(_0x326f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x326f('0xc'));var querystring=require('querystring');var Papa=require(_0x326f('0xd'));var Redis=require(_0x326f('0xe'));var authService=require(_0x326f('0xf'));var qs=require(_0x326f('0x10'));var as=require(_0x326f('0x11'));var hardwareService=require(_0x326f('0x12'));var logger=require(_0x326f('0x13'))(_0x326f('0x14'));var utils=require(_0x326f('0x15'));var config=require(_0x326f('0x16'));var licenseUtil=require(_0x326f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2864b0,_0x39443c){_0x39443c=_0x39443c||0xcc;return function(_0x55dd9c){if(_0x55dd9c){return _0x2864b0[_0x326f('0x18')](_0x39443c);}return _0x2864b0[_0x326f('0x19')](_0x39443c)[_0x326f('0x1a')]();};}function respondWithResult(_0x4f3f6e,_0x1eba4d){_0x1eba4d=_0x1eba4d||0xc8;return function(_0x5f1c38){if(_0x5f1c38){return _0x4f3f6e[_0x326f('0x19')](_0x1eba4d)['json'](_0x5f1c38);}};}function respondWithFilteredResult(_0x5d5e77,_0x5d595b){return function(_0xdf0129){if(_0xdf0129){var _0x213981=typeof _0x5d595b['offset']===_0x326f('0x1b')&&typeof _0x5d595b['limit']===_0x326f('0x1b');var _0x117f92=_0xdf0129[_0x326f('0x1c')];var _0x5df00e=_0x213981?0x0:_0x5d595b[_0x326f('0x1d')];var _0x4293f6=_0x213981?_0xdf0129['count']:_0x5d595b['offset']+_0x5d595b[_0x326f('0x1e')];var _0x1e4c8e;if(_0x4293f6>=_0x117f92){_0x4293f6=_0x117f92;_0x1e4c8e=0xc8;}else{_0x1e4c8e=0xce;}_0x5d5e77['status'](_0x1e4c8e);return _0x5d5e77[_0x326f('0x1f')]('Content-Range',_0x5df00e+'-'+_0x4293f6+'/'+_0x117f92)['json'](_0xdf0129);}return null;};}function patchUpdates(_0x238e33){return function(_0x547311){try{jsonpatch['apply'](_0x547311,_0x238e33,!![]);}catch(_0xde80dd){return BPromise[_0x326f('0x20')](_0xde80dd);}return _0x547311['save']();};}function saveUpdates(_0x53a8e0,_0x1ee89c){return function(_0x46b36e){if(_0x46b36e){return _0x46b36e[_0x326f('0x21')](_0x53a8e0)[_0x326f('0x22')](function(_0x5c773e){return _0x5c773e;});}return null;};}function removeEntity(_0x4a66a8,_0x49fd10){return function(_0x2b4bd1){if(_0x2b4bd1){return _0x2b4bd1['destroy']()[_0x326f('0x22')](function(){_0x4a66a8[_0x326f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a8bf,_0x1b7537){return function(_0x2e39d0){if(!_0x2e39d0){_0x55a8bf[_0x326f('0x18')](0x194);}return _0x2e39d0;};}function handleError(_0x2d2401,_0x527c74){_0x527c74=_0x527c74||0x1f4;return function(_0x4e9d0a){logger[_0x326f('0x23')](_0x4e9d0a[_0x326f('0x24')]);if(_0x4e9d0a[_0x326f('0x25')]){delete _0x4e9d0a[_0x326f('0x25')];}_0x2d2401[_0x326f('0x19')](_0x527c74)[_0x326f('0x26')](_0x4e9d0a);};}exports[_0x326f('0x27')]=function(_0x53f104,_0x2e15c1){var _0x2fcb19={},_0xa6eefa={},_0x5e601a={'count':0x0,'rows':[]};var _0x29df1c=_['map'](db[_0x326f('0x28')][_0x326f('0x29')],function(_0x5c152d){return{'name':_0x5c152d['fieldName'],'type':_0x5c152d[_0x326f('0x2a')][_0x326f('0x2b')]};});_0xa6eefa[_0x326f('0x2c')]=_[_0x326f('0x2d')](_0x29df1c,_0x326f('0x25'));_0xa6eefa[_0x326f('0x2e')]=_[_0x326f('0x2f')](_0x53f104[_0x326f('0x2e')]);_0xa6eefa[_0x326f('0x30')]=_[_0x326f('0x31')](_0xa6eefa['model'],_0xa6eefa[_0x326f('0x2e')]);_0x2fcb19[_0x326f('0x32')]=_[_0x326f('0x31')](_0xa6eefa[_0x326f('0x2c')],qs[_0x326f('0x33')](_0x53f104[_0x326f('0x2e')]['fields']));_0x2fcb19[_0x326f('0x32')]=_0x2fcb19[_0x326f('0x32')][_0x326f('0x34')]?_0x2fcb19[_0x326f('0x32')]:_0xa6eefa['model'];if(!_0x53f104[_0x326f('0x2e')][_0x326f('0x35')]('nolimit')){_0x2fcb19[_0x326f('0x1e')]=qs[_0x326f('0x1e')](_0x53f104[_0x326f('0x2e')][_0x326f('0x1e')]);_0x2fcb19[_0x326f('0x1d')]=qs[_0x326f('0x1d')](_0x53f104[_0x326f('0x2e')][_0x326f('0x1d')]);}_0x2fcb19[_0x326f('0x36')]=qs[_0x326f('0x37')](_0x53f104[_0x326f('0x2e')][_0x326f('0x37')]);_0x2fcb19[_0x326f('0x38')]=qs[_0x326f('0x30')](_[_0x326f('0x39')](_0x53f104[_0x326f('0x2e')],_0xa6eefa[_0x326f('0x30')]),_0x29df1c);if(_0x53f104[_0x326f('0x2e')]['filter']){_0x2fcb19['where']=_[_0x326f('0x3a')](_0x2fcb19[_0x326f('0x38')],{'$or':_[_0x326f('0x2d')](_0x29df1c,function(_0x27c1ed){if(_0x27c1ed[_0x326f('0x2a')]!==_0x326f('0x3b')){var _0x5b6a8b={};_0x5b6a8b[_0x27c1ed[_0x326f('0x25')]]={'$like':'%'+_0x53f104[_0x326f('0x2e')][_0x326f('0x3c')]+'%'};return _0x5b6a8b;}})});}_0x2fcb19=_[_0x326f('0x3a')]({},_0x2fcb19,_0x53f104['options']);var _0xa9aa81={'where':_0x2fcb19[_0x326f('0x38')]};return db[_0x326f('0x28')][_0x326f('0x1c')](_0xa9aa81)[_0x326f('0x22')](function(_0x5196b2){_0x5e601a[_0x326f('0x1c')]=_0x5196b2;if(_0x53f104[_0x326f('0x2e')][_0x326f('0x3d')]){_0x2fcb19[_0x326f('0x3e')]=[{'all':!![]}];}return db[_0x326f('0x28')][_0x326f('0x3f')](_0x2fcb19);})['then'](function(_0x1ad9ec){_0x5e601a[_0x326f('0x40')]=_0x1ad9ec;return _0x5e601a;})[_0x326f('0x22')](respondWithFilteredResult(_0x2e15c1,_0x2fcb19))[_0x326f('0x41')](handleError(_0x2e15c1,null));};exports[_0x326f('0x42')]=function(_0x3bf6f7,_0x4e45ad){var _0xe432ab={'raw':!![],'where':{'id':_0x3bf6f7['params']['id']}},_0x4e8b54={};_0x4e8b54[_0x326f('0x2c')]=_[_0x326f('0x2f')](db[_0x326f('0x28')][_0x326f('0x29')]);_0x4e8b54[_0x326f('0x2e')]=_[_0x326f('0x2f')](_0x3bf6f7[_0x326f('0x2e')]);_0x4e8b54[_0x326f('0x30')]=_[_0x326f('0x31')](_0x4e8b54[_0x326f('0x2c')],_0x4e8b54[_0x326f('0x2e')]);_0xe432ab[_0x326f('0x32')]=_[_0x326f('0x31')](_0x4e8b54[_0x326f('0x2c')],qs[_0x326f('0x33')](_0x3bf6f7[_0x326f('0x2e')][_0x326f('0x33')]));_0xe432ab[_0x326f('0x32')]=_0xe432ab[_0x326f('0x32')][_0x326f('0x34')]?_0xe432ab[_0x326f('0x32')]:_0x4e8b54['model'];if(_0x3bf6f7['query'][_0x326f('0x3d')]){_0xe432ab[_0x326f('0x3e')]=[{'all':!![]}];}_0xe432ab=_['merge']({},_0xe432ab,_0x3bf6f7[_0x326f('0x43')]);return db[_0x326f('0x28')][_0x326f('0x44')](_0xe432ab)['then'](handleEntityNotFound(_0x4e45ad,null))[_0x326f('0x22')](respondWithResult(_0x4e45ad,null))[_0x326f('0x41')](handleError(_0x4e45ad,null));};exports[_0x326f('0x45')]=function(_0x158a7a,_0x4b40f1){return db['VtigerField'][_0x326f('0x45')](_0x158a7a['body'],{})[_0x326f('0x22')](respondWithResult(_0x4b40f1,0xc9))[_0x326f('0x41')](handleError(_0x4b40f1,null));};exports[_0x326f('0x21')]=function(_0x2f529a,_0x54a94c){if(_0x2f529a[_0x326f('0x46')]['id']){delete _0x2f529a['body']['id'];}return db['VtigerField']['find']({'where':{'id':_0x2f529a['params']['id']}})[_0x326f('0x22')](handleEntityNotFound(_0x54a94c,null))[_0x326f('0x22')](saveUpdates(_0x2f529a[_0x326f('0x46')],null))['then'](respondWithResult(_0x54a94c,null))[_0x326f('0x41')](handleError(_0x54a94c,null));};exports[_0x326f('0x47')]=function(_0x4b6664,_0x342d9f){return db['VtigerField'][_0x326f('0x44')]({'where':{'id':_0x4b6664['params']['id']}})[_0x326f('0x22')](handleEntityNotFound(_0x342d9f,null))[_0x326f('0x22')](removeEntity(_0x342d9f,null))[_0x326f('0x41')](handleError(_0x342d9f,null));}; \ No newline at end of file +var _0xa394=['index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','catch','params','includeAll','include','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send'];(function(_0x492c7c,_0x31e010){var _0x333691=function(_0x395856){while(--_0x395856){_0x492c7c['push'](_0x492c7c['shift']());}};_0x333691(++_0x31e010);}(_0xa394,0xbb));var _0x4a39=function(_0x3b1be4,_0x275aec){_0x3b1be4=_0x3b1be4-0x0;var _0x21b3fd=_0xa394[_0x3b1be4];return _0x21b3fd;};'use strict';var emlformat=require(_0x4a39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a39('0x1'));var jsonpatch=require(_0x4a39('0x2'));var rp=require(_0x4a39('0x3'));var moment=require('moment');var BPromise=require(_0x4a39('0x4'));var Mustache=require(_0x4a39('0x5'));var util=require(_0x4a39('0x6'));var path=require(_0x4a39('0x7'));var sox=require('sox');var csv=require(_0x4a39('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a39('0x9'));var _=require(_0x4a39('0xa'));var squel=require('squel');var crypto=require(_0x4a39('0xb'));var jsforce=require(_0x4a39('0xc'));var deskjs=require(_0x4a39('0xd'));var toCsv=require(_0x4a39('0x8'));var querystring=require(_0x4a39('0xe'));var Papa=require(_0x4a39('0xf'));var Redis=require(_0x4a39('0x10'));var authService=require(_0x4a39('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4a39('0x12'));var hardwareService=require(_0x4a39('0x13'));var logger=require(_0x4a39('0x14'))(_0x4a39('0x15'));var utils=require(_0x4a39('0x16'));var config=require(_0x4a39('0x17'));var licenseUtil=require(_0x4a39('0x18'));var db=require(_0x4a39('0x19'))['db'];function respondWithStatusCode(_0x8df825,_0x443ea7){_0x443ea7=_0x443ea7||0xcc;return function(_0x586371){if(_0x586371){return _0x8df825[_0x4a39('0x1a')](_0x443ea7);}return _0x8df825[_0x4a39('0x1b')](_0x443ea7)['end']();};}function respondWithResult(_0x34cd5f,_0x50bbac){_0x50bbac=_0x50bbac||0xc8;return function(_0x3656e7){if(_0x3656e7){return _0x34cd5f[_0x4a39('0x1b')](_0x50bbac)[_0x4a39('0x1c')](_0x3656e7);}};}function respondWithFilteredResult(_0x492c75,_0x48c909){return function(_0x4007b7){if(_0x4007b7){var _0x2365b9=typeof _0x48c909[_0x4a39('0x1d')]==='undefined'&&typeof _0x48c909[_0x4a39('0x1e')]===_0x4a39('0x1f');var _0x1711b9=_0x4007b7['count'];var _0x399136=_0x2365b9?0x0:_0x48c909[_0x4a39('0x1d')];var _0x46601d=_0x2365b9?_0x4007b7[_0x4a39('0x20')]:_0x48c909['offset']+_0x48c909[_0x4a39('0x1e')];var _0x42a455;if(_0x46601d>=_0x1711b9){_0x46601d=_0x1711b9;_0x42a455=0xc8;}else{_0x42a455=0xce;}_0x492c75[_0x4a39('0x1b')](_0x42a455);return _0x492c75[_0x4a39('0x21')](_0x4a39('0x22'),_0x399136+'-'+_0x46601d+'/'+_0x1711b9)[_0x4a39('0x1c')](_0x4007b7);}return null;};}function patchUpdates(_0x213ec6){return function(_0x18df4c){try{jsonpatch['apply'](_0x18df4c,_0x213ec6,!![]);}catch(_0x954c9e){return BPromise[_0x4a39('0x23')](_0x954c9e);}return _0x18df4c[_0x4a39('0x24')]();};}function saveUpdates(_0x106c4e,_0x1a43f4){return function(_0x1f54ad){if(_0x1f54ad){return _0x1f54ad[_0x4a39('0x25')](_0x106c4e)[_0x4a39('0x26')](function(_0x22aa83){return _0x22aa83;});}return null;};}function removeEntity(_0x4224cb,_0x256fdb){return function(_0x103f68){if(_0x103f68){return _0x103f68['destroy']()[_0x4a39('0x26')](function(){_0x4224cb[_0x4a39('0x1b')](0xcc)[_0x4a39('0x27')]();});}};}function handleEntityNotFound(_0x2d776a,_0x377c29){return function(_0x509602){if(!_0x509602){_0x2d776a[_0x4a39('0x1a')](0x194);}return _0x509602;};}function handleError(_0x512f6c,_0x255f38){_0x255f38=_0x255f38||0x1f4;return function(_0x1097d6){logger[_0x4a39('0x28')](_0x1097d6[_0x4a39('0x29')]);if(_0x1097d6[_0x4a39('0x2a')]){delete _0x1097d6[_0x4a39('0x2a')];}_0x512f6c[_0x4a39('0x1b')](_0x255f38)[_0x4a39('0x2b')](_0x1097d6);};}exports[_0x4a39('0x2c')]=function(_0x543825,_0x3f2a0c){var _0x4667e6={},_0x47d872={},_0x2b2cfb={'count':0x0,'rows':[]};var _0x686ba0=_[_0x4a39('0x2d')](db[_0x4a39('0x2e')][_0x4a39('0x2f')],function(_0x551f9b){return{'name':_0x551f9b[_0x4a39('0x30')],'type':_0x551f9b[_0x4a39('0x31')]['key']};});_0x47d872[_0x4a39('0x32')]=_[_0x4a39('0x2d')](_0x686ba0,'name');_0x47d872[_0x4a39('0x33')]=_[_0x4a39('0x34')](_0x543825[_0x4a39('0x33')]);_0x47d872[_0x4a39('0x35')]=_[_0x4a39('0x36')](_0x47d872['model'],_0x47d872[_0x4a39('0x33')]);_0x4667e6[_0x4a39('0x37')]=_[_0x4a39('0x36')](_0x47d872[_0x4a39('0x32')],qs['fields'](_0x543825[_0x4a39('0x33')][_0x4a39('0x38')]));_0x4667e6[_0x4a39('0x37')]=_0x4667e6['attributes'][_0x4a39('0x39')]?_0x4667e6[_0x4a39('0x37')]:_0x47d872[_0x4a39('0x32')];if(!_0x543825['query'][_0x4a39('0x3a')](_0x4a39('0x3b'))){_0x4667e6['limit']=qs[_0x4a39('0x1e')](_0x543825['query'][_0x4a39('0x1e')]);_0x4667e6['offset']=qs[_0x4a39('0x1d')](_0x543825['query'][_0x4a39('0x1d')]);}_0x4667e6[_0x4a39('0x3c')]=qs['sort'](_0x543825['query'][_0x4a39('0x3d')]);_0x4667e6[_0x4a39('0x3e')]=qs[_0x4a39('0x35')](_[_0x4a39('0x3f')](_0x543825[_0x4a39('0x33')],_0x47d872[_0x4a39('0x35')]),_0x686ba0);if(_0x543825[_0x4a39('0x33')]['filter']){_0x4667e6[_0x4a39('0x3e')]=_[_0x4a39('0x40')](_0x4667e6[_0x4a39('0x3e')],{'$or':_[_0x4a39('0x2d')](_0x686ba0,function(_0x108ae9){if(_0x108ae9[_0x4a39('0x31')]!==_0x4a39('0x41')){var _0x454010={};_0x454010[_0x108ae9[_0x4a39('0x2a')]]={'$like':'%'+_0x543825[_0x4a39('0x33')][_0x4a39('0x42')]+'%'};return _0x454010;}})});}_0x4667e6=_[_0x4a39('0x40')]({},_0x4667e6,_0x543825[_0x4a39('0x43')]);var _0x5ab578={'where':_0x4667e6['where']};return db[_0x4a39('0x2e')]['count'](_0x5ab578)[_0x4a39('0x26')](function(_0x144722){_0x2b2cfb[_0x4a39('0x20')]=_0x144722;if(_0x543825[_0x4a39('0x33')]['includeAll']){_0x4667e6['include']=[{'all':!![]}];}return db[_0x4a39('0x2e')][_0x4a39('0x44')](_0x4667e6);})['then'](function(_0x578250){_0x2b2cfb['rows']=_0x578250;return _0x2b2cfb;})[_0x4a39('0x26')](respondWithFilteredResult(_0x3f2a0c,_0x4667e6))[_0x4a39('0x45')](handleError(_0x3f2a0c,null));};exports['show']=function(_0x4adb74,_0x380dd8){var _0x2dee3e={'raw':!![],'where':{'id':_0x4adb74[_0x4a39('0x46')]['id']}},_0x519834={};_0x519834[_0x4a39('0x32')]=_[_0x4a39('0x34')](db[_0x4a39('0x2e')][_0x4a39('0x2f')]);_0x519834[_0x4a39('0x33')]=_[_0x4a39('0x34')](_0x4adb74[_0x4a39('0x33')]);_0x519834['filters']=_['intersection'](_0x519834[_0x4a39('0x32')],_0x519834['query']);_0x2dee3e[_0x4a39('0x37')]=_['intersection'](_0x519834[_0x4a39('0x32')],qs[_0x4a39('0x38')](_0x4adb74[_0x4a39('0x33')][_0x4a39('0x38')]));_0x2dee3e[_0x4a39('0x37')]=_0x2dee3e[_0x4a39('0x37')]['length']?_0x2dee3e['attributes']:_0x519834[_0x4a39('0x32')];if(_0x4adb74[_0x4a39('0x33')][_0x4a39('0x47')]){_0x2dee3e[_0x4a39('0x48')]=[{'all':!![]}];}_0x2dee3e=_[_0x4a39('0x40')]({},_0x2dee3e,_0x4adb74[_0x4a39('0x43')]);return db['VtigerField']['find'](_0x2dee3e)[_0x4a39('0x26')](handleEntityNotFound(_0x380dd8,null))[_0x4a39('0x26')](respondWithResult(_0x380dd8,null))[_0x4a39('0x45')](handleError(_0x380dd8,null));};exports[_0x4a39('0x49')]=function(_0x283aeb,_0x412306){return db[_0x4a39('0x2e')][_0x4a39('0x49')](_0x283aeb[_0x4a39('0x4a')],{})[_0x4a39('0x26')](respondWithResult(_0x412306,0xc9))[_0x4a39('0x45')](handleError(_0x412306,null));};exports[_0x4a39('0x25')]=function(_0xd95900,_0x3aa214){if(_0xd95900[_0x4a39('0x4a')]['id']){delete _0xd95900[_0x4a39('0x4a')]['id'];}return db[_0x4a39('0x2e')][_0x4a39('0x4b')]({'where':{'id':_0xd95900[_0x4a39('0x46')]['id']}})[_0x4a39('0x26')](handleEntityNotFound(_0x3aa214,null))[_0x4a39('0x26')](saveUpdates(_0xd95900[_0x4a39('0x4a')],null))['then'](respondWithResult(_0x3aa214,null))[_0x4a39('0x45')](handleError(_0x3aa214,null));};exports[_0x4a39('0x4c')]=function(_0x102431,_0x55253a){return db['VtigerField'][_0x4a39('0x4b')]({'where':{'id':_0x102431['params']['id']}})['then'](handleEntityNotFound(_0x55253a,null))['then'](removeEntity(_0x55253a,null))[_0x4a39('0x45')](handleError(_0x55253a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 7aea1ca..179ecde 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 _0x7ab7=['int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0x7ab7,0x164));var _0x77ab=function(_0x2961d1,_0xcd92f2){_0x2961d1=_0x2961d1-0x0;var _0x47d653=_0x7ab7[_0x2961d1];return _0x47d653;};'use strict';var _=require('lodash');var util=require(_0x77ab('0x0'));var logger=require(_0x77ab('0x1'))(_0x77ab('0x2'));var moment=require(_0x77ab('0x3'));var BPromise=require(_0x77ab('0x4'));var rp=require(_0x77ab('0x5'));var fs=require('fs');var path=require(_0x77ab('0x6'));var rimraf=require(_0x77ab('0x7'));var config=require(_0x77ab('0x8'));var attributes=require(_0x77ab('0x9'));module[_0x77ab('0xa')]=function(_0x78404,_0x5c43d6){return _0x78404['define'](_0x77ab('0xb'),attributes,{'tableName':_0x77ab('0xc'),'paranoid':![],'indexes':[{'name':_0x77ab('0xd'),'fields':[_0x77ab('0xe'),_0x77ab('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfebf=['vtiger_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','VtigerField','int_vtiger_fields'];(function(_0x16b287,_0x5d6d7c){var _0x4bb404=function(_0x501cbd){while(--_0x501cbd){_0x16b287['push'](_0x16b287['shift']());}};_0x4bb404(++_0x5d6d7c);}(_0xfebf,0x9d));var _0xffeb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfebf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xffeb('0x0'));var util=require(_0xffeb('0x1'));var logger=require('../../config/logger')(_0xffeb('0x2'));var moment=require('moment');var BPromise=require(_0xffeb('0x3'));var rp=require(_0xffeb('0x4'));var fs=require('fs');var path=require(_0xffeb('0x5'));var rimraf=require(_0xffeb('0x6'));var config=require(_0xffeb('0x7'));var attributes=require('./intVtigerField.attributes');module[_0xffeb('0x8')]=function(_0x47b35f,_0x4a2a77){return _0x47b35f['define'](_0xffeb('0x9'),attributes,{'tableName':_0xffeb('0xa'),'paranoid':![],'indexes':[{'name':_0xffeb('0xb'),'fields':[_0xffeb('0xc'),_0xffeb('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 312d104..e82e63a 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 _0xe1a7=['rpc','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18f396,_0x174d17){var _0x3ba532=function(_0x2bc92f){while(--_0x2bc92f){_0x18f396['push'](_0x18f396['shift']());}};_0x3ba532(++_0x174d17);}(_0xe1a7,0x151));var _0x7e1a=function(_0x2cd8a4,_0x3aa15c){_0x2cd8a4=_0x2cd8a4-0x0;var _0x37ff79=_0xe1a7[_0x2cd8a4];return _0x37ff79;};'use strict';var _=require(_0x7e1a('0x0'));var util=require(_0x7e1a('0x1'));var moment=require('moment');var BPromise=require(_0x7e1a('0x2'));var rs=require(_0x7e1a('0x3'));var fs=require('fs');var Redis=require(_0x7e1a('0x4'));var db=require(_0x7e1a('0x5'))['db'];var utils=require(_0x7e1a('0x6'));var logger=require(_0x7e1a('0x7'))(_0x7e1a('0x8'));var config=require('../../config/environment');var jayson=require(_0x7e1a('0x9'));var client=jayson[_0x7e1a('0xa')][_0x7e1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x436830,_0x3cfb60,_0x12edd8){return new BPromise(function(_0x2effed,_0x131a7b){return client[_0x7e1a('0xc')](_0x436830,_0x12edd8)[_0x7e1a('0xd')](function(_0x536a58){logger[_0x7e1a('0xe')](_0x7e1a('0xf'),_0x3cfb60,_0x7e1a('0x10'));logger[_0x7e1a('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3cfb60,_0x7e1a('0x10'),JSON[_0x7e1a('0x12')](_0x536a58));if(_0x536a58['error']){if(_0x536a58['error'][_0x7e1a('0x13')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x3cfb60,_0x536a58['error'][_0x7e1a('0x14')]);return _0x131a7b(_0x536a58['error']['message']);}logger[_0x7e1a('0x15')](_0x7e1a('0xf'),_0x3cfb60,_0x536a58[_0x7e1a('0x15')][_0x7e1a('0x14')]);return _0x2effed(_0x536a58[_0x7e1a('0x15')][_0x7e1a('0x14')]);}else{logger[_0x7e1a('0xe')]('VtigerField,\x20%s,\x20%s',_0x3cfb60,_0x7e1a('0x10'));_0x2effed(_0x536a58['result']['message']);}})[_0x7e1a('0x16')](function(_0x2371b8){logger['error'](_0x7e1a('0xf'),_0x3cfb60,_0x2371b8);_0x131a7b(_0x2371b8);});});} \ No newline at end of file +var _0x48a8=['http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x48a8,0x12c));var _0x848a=function(_0x105b5b,_0x52235e){_0x105b5b=_0x105b5b-0x0;var _0x24762a=_0x48a8[_0x105b5b];return _0x24762a;};'use strict';var _=require(_0x848a('0x0'));var util=require(_0x848a('0x1'));var moment=require(_0x848a('0x2'));var BPromise=require('bluebird');var rs=require(_0x848a('0x3'));var fs=require('fs');var Redis=require(_0x848a('0x4'));var db=require(_0x848a('0x5'))['db'];var utils=require(_0x848a('0x6'));var logger=require(_0x848a('0x7'))(_0x848a('0x8'));var config=require(_0x848a('0x9'));var jayson=require(_0x848a('0xa'));var client=jayson[_0x848a('0xb')][_0x848a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x223f64,_0x3679b0,_0x3197bf){return new BPromise(function(_0x989c35,_0x4fe702){return client[_0x848a('0xd')](_0x223f64,_0x3197bf)[_0x848a('0xe')](function(_0x46ffc0){logger[_0x848a('0xf')](_0x848a('0x10'),_0x3679b0,'request\x20sent');logger[_0x848a('0x11')](_0x848a('0x12'),_0x3679b0,_0x848a('0x13'),JSON['stringify'](_0x46ffc0));if(_0x46ffc0['error']){if(_0x46ffc0[_0x848a('0x14')][_0x848a('0x15')]===0x1f4){logger[_0x848a('0x14')](_0x848a('0x10'),_0x3679b0,_0x46ffc0[_0x848a('0x14')][_0x848a('0x16')]);return _0x4fe702(_0x46ffc0['error'][_0x848a('0x16')]);}logger[_0x848a('0x14')](_0x848a('0x10'),_0x3679b0,_0x46ffc0[_0x848a('0x14')][_0x848a('0x16')]);return _0x989c35(_0x46ffc0['error'][_0x848a('0x16')]);}else{logger['info'](_0x848a('0x10'),_0x3679b0,_0x848a('0x13'));_0x989c35(_0x46ffc0['result'][_0x848a('0x16')]);}})[_0x848a('0x17')](function(_0x3b78e3){logger[_0x848a('0x14')](_0x848a('0x10'),_0x3679b0,_0x3b78e3);_0x4fe702(_0x3b78e3);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d2e4de4..a493f94 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 _0xf072=['create','/:id/configurations','addConfiguration','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','post'];(function(_0x1fb7d1,_0x108781){var _0x2480d8=function(_0x9bc3d9){while(--_0x9bc3d9){_0x1fb7d1['push'](_0x1fb7d1['shift']());}};_0x2480d8(++_0x108781);}(_0xf072,0x131));var _0x2f07=function(_0x436c66,_0x22e375){_0x436c66=_0x436c66-0x0;var _0x4b2d50=_0xf072[_0x436c66];return _0x4b2d50;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require(_0x2f07('0x3'));var express=require('express');var router=express[_0x2f07('0x4')]();var fs_extra=require(_0x2f07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2f07('0x6'));var config=require(_0x2f07('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2f07('0xb')]);router[_0x2f07('0x8')]('/:id/configurations',auth[_0x2f07('0x9')](),controller['getConfigurations']);router[_0x2f07('0x8')](_0x2f07('0xc'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xd')]);router[_0x2f07('0xe')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xf')]);router['post'](_0x2f07('0x10'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);router['put'](_0x2f07('0x12'),auth[_0x2f07('0x9')](),controller['update']);router['delete']('/:id',auth[_0x2f07('0x9')](),controller['destroy']);module[_0x2f07('0x13')]=router; \ No newline at end of file +var _0x7bd5=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x7bd5,0x8e));var _0x57bd=function(_0xbbfcd6,_0x3972ea){_0xbbfcd6=_0xbbfcd6-0x0;var _0x1375ca=_0x7bd5[_0xbbfcd6];return _0x1375ca;};'use strict';var multer=require(_0x57bd('0x0'));var util=require('util');var path=require(_0x57bd('0x1'));var timeout=require(_0x57bd('0x2'));var express=require(_0x57bd('0x3'));var router=express[_0x57bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x57bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57bd('0x6'));var controller=require('./intZendeskAccount.controller');router[_0x57bd('0x7')]('/',auth[_0x57bd('0x8')](),controller[_0x57bd('0x9')]);router['get'](_0x57bd('0xa'),auth[_0x57bd('0x8')](),controller[_0x57bd('0xb')]);router[_0x57bd('0x7')](_0x57bd('0xc'),auth[_0x57bd('0x8')](),controller[_0x57bd('0xd')]);router[_0x57bd('0x7')](_0x57bd('0xe'),auth[_0x57bd('0x8')](),controller[_0x57bd('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x57bd('0x10')](_0x57bd('0xc'),auth[_0x57bd('0x8')](),controller[_0x57bd('0x11')]);router['put'](_0x57bd('0xa'),auth[_0x57bd('0x8')](),controller[_0x57bd('0x12')]);router[_0x57bd('0x13')](_0x57bd('0xa'),auth[_0x57bd('0x8')](),controller['destroy']);module[_0x57bd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 2998074..1cd5e56 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 _0x398a=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x5d8b52,_0x4337c7){var _0x53e4b9=function(_0x4c654){while(--_0x4c654){_0x5d8b52['push'](_0x5d8b52['shift']());}};_0x53e4b9(++_0x4337c7);}(_0x398a,0x11a));var _0xa398=function(_0x11075d,_0x4bcde0){_0x11075d=_0x11075d-0x0;var _0x89c58f=_0x398a[_0x11075d];return _0x89c58f;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'name':{'type':Sequelize[_0xa398('0x2')]},'description':{'type':Sequelize[_0xa398('0x2')]},'username':{'type':Sequelize[_0xa398('0x2')],'unique':_0xa398('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa398('0x4')},'authType':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x6'),_0xa398('0x7')),'defaultValue':_0xa398('0x6')},'serverUrl':{'type':Sequelize[_0xa398('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa398('0x5')](_0xa398('0x8'),_0xa398('0x9')),'defaultValue':_0xa398('0x8')}}; \ No newline at end of file +var _0x2a07=['exports','STRING','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize'];(function(_0x5ebe73,_0x13080f){var _0x292268=function(_0x56f62f){while(--_0x56f62f){_0x5ebe73['push'](_0x5ebe73['shift']());}};_0x292268(++_0x13080f);}(_0x2a07,0x74));var _0x72a0=function(_0x499ae7,_0x11541d){_0x499ae7=_0x499ae7-0x0;var _0xdfdd0f=_0x2a07[_0x499ae7];return _0xdfdd0f;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'name':{'type':Sequelize[_0x72a0('0x2')]},'description':{'type':Sequelize[_0x72a0('0x2')]},'username':{'type':Sequelize[_0x72a0('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x72a0('0x2')]},'token':{'type':Sequelize[_0x72a0('0x2')]},'remoteUri':{'type':Sequelize[_0x72a0('0x2')],'unique':_0x72a0('0x3')},'authType':{'type':Sequelize[_0x72a0('0x4')](_0x72a0('0x5'),_0x72a0('0x6')),'defaultValue':_0x72a0('0x5')},'serverUrl':{'type':Sequelize[_0x72a0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x72a0('0x4')](_0x72a0('0x7'),_0x72a0('0x8')),'defaultValue':_0x72a0('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 42a2d96..6e574b8 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 _0x80ed=['rawAttributes','sort','pick','filter','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','authType','remoteUri','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','includes','position','system_field_options','custom_field_options','test','statusCode','error','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','sendStatus','stack','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','options','ZendeskAccount','findAll','rows','catch','show','params','includeAll','create','body','find','getConfigurations','findOne'];(function(_0xa805d7,_0x386ef8){var _0x169393=function(_0x507358){while(--_0x507358){_0xa805d7['push'](_0xa805d7['shift']());}};_0x169393(++_0x386ef8);}(_0x80ed,0x11c));var _0xd80e=function(_0x43911a,_0x53a433){_0x43911a=_0x43911a-0x0;var _0xba321=_0x80ed[_0x43911a];return _0xba321;};'use strict';var emlformat=require(_0xd80e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd80e('0x1'));var jsonpatch=require(_0xd80e('0x2'));var rp=require(_0xd80e('0x3'));var moment=require('moment');var BPromise=require(_0xd80e('0x4'));var Mustache=require(_0xd80e('0x5'));var util=require(_0xd80e('0x6'));var path=require(_0xd80e('0x7'));var sox=require('sox');var csv=require(_0xd80e('0x8'));var ejs=require(_0xd80e('0x9'));var fs=require('fs');var fs_extra=require(_0xd80e('0xa'));var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x8'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var licenseUtil=require(_0xd80e('0x19'));var db=require(_0xd80e('0x1a'))['db'];var integrations=require(_0xd80e('0x1b'));function respondWithStatusCode(_0x1d3fcf,_0x4fb01c){_0x4fb01c=_0x4fb01c||0xcc;return function(_0x5691a1){if(_0x5691a1){return _0x1d3fcf['sendStatus'](_0x4fb01c);}return _0x1d3fcf['status'](_0x4fb01c)[_0xd80e('0x1c')]();};}function respondWithResult(_0x3d233b,_0x3096ae){_0x3096ae=_0x3096ae||0xc8;return function(_0x1e8b63){if(_0x1e8b63){return _0x3d233b[_0xd80e('0x1d')](_0x3096ae)['json'](_0x1e8b63);}};}function respondWithFilteredResult(_0x595683,_0x2c8c61){return function(_0x3124e8){if(_0x3124e8){var _0x3b48ae=typeof _0x2c8c61[_0xd80e('0x1e')]===_0xd80e('0x1f')&&typeof _0x2c8c61[_0xd80e('0x20')]===_0xd80e('0x1f');var _0x49e3e5=_0x3124e8[_0xd80e('0x21')];var _0x1cc576=_0x3b48ae?0x0:_0x2c8c61[_0xd80e('0x1e')];var _0x34e239=_0x3b48ae?_0x3124e8['count']:_0x2c8c61[_0xd80e('0x1e')]+_0x2c8c61[_0xd80e('0x20')];var _0xecfe74;if(_0x34e239>=_0x49e3e5){_0x34e239=_0x49e3e5;_0xecfe74=0xc8;}else{_0xecfe74=0xce;}_0x595683['status'](_0xecfe74);return _0x595683[_0xd80e('0x22')](_0xd80e('0x23'),_0x1cc576+'-'+_0x34e239+'/'+_0x49e3e5)[_0xd80e('0x24')](_0x3124e8);}return null;};}function patchUpdates(_0x147134){return function(_0x46b6eb){try{jsonpatch['apply'](_0x46b6eb,_0x147134,!![]);}catch(_0x4b6b8a){return BPromise[_0xd80e('0x25')](_0x4b6b8a);}return _0x46b6eb[_0xd80e('0x26')]();};}function saveUpdates(_0x3b39bf,_0x2d46e7){return function(_0x3eb3ca){if(_0x3eb3ca){return _0x3eb3ca[_0xd80e('0x27')](_0x3b39bf)[_0xd80e('0x28')](function(_0x5430b6){return _0x5430b6;});}return null;};}function removeEntity(_0x1fbf8a,_0x57d70){return function(_0x170109){if(_0x170109){return _0x170109['destroy']()[_0xd80e('0x28')](function(){_0x1fbf8a[_0xd80e('0x1d')](0xcc)[_0xd80e('0x1c')]();});}};}function handleEntityNotFound(_0x482779,_0x521aa4){return function(_0x5420e7){if(!_0x5420e7){_0x482779[_0xd80e('0x29')](0x194);}return _0x5420e7;};}function handleError(_0x4b8291,_0x9f9287){_0x9f9287=_0x9f9287||0x1f4;return function(_0x1044cc){logger['error'](_0x1044cc[_0xd80e('0x2a')]);if(_0x1044cc[_0xd80e('0x2b')]){delete _0x1044cc[_0xd80e('0x2b')];}_0x4b8291[_0xd80e('0x1d')](_0x9f9287)['send'](_0x1044cc);};}exports[_0xd80e('0x2c')]=function(_0x1ad3bc,_0x845451){var _0x39088b={},_0x2b1aaf={},_0x361946={'count':0x0,'rows':[]};var _0x289685=_[_0xd80e('0x2d')](db['ZendeskAccount']['rawAttributes'],function(_0x30f9bd){return{'name':_0x30f9bd[_0xd80e('0x2e')],'type':_0x30f9bd[_0xd80e('0x2f')][_0xd80e('0x30')]};});_0x2b1aaf[_0xd80e('0x31')]=_[_0xd80e('0x2d')](_0x289685,'name');_0x2b1aaf['query']=_[_0xd80e('0x32')](_0x1ad3bc[_0xd80e('0x33')]);_0x2b1aaf[_0xd80e('0x34')]=_[_0xd80e('0x35')](_0x2b1aaf[_0xd80e('0x31')],_0x2b1aaf[_0xd80e('0x33')]);_0x39088b[_0xd80e('0x36')]=_[_0xd80e('0x35')](_0x2b1aaf['model'],qs['fields'](_0x1ad3bc[_0xd80e('0x33')][_0xd80e('0x37')]));_0x39088b[_0xd80e('0x36')]=_0x39088b[_0xd80e('0x36')][_0xd80e('0x38')]?_0x39088b[_0xd80e('0x36')]:_0x2b1aaf[_0xd80e('0x31')];if(!_0x1ad3bc[_0xd80e('0x33')][_0xd80e('0x39')](_0xd80e('0x3a'))){_0x39088b['limit']=qs[_0xd80e('0x20')](_0x1ad3bc['query'][_0xd80e('0x20')]);_0x39088b[_0xd80e('0x1e')]=qs[_0xd80e('0x1e')](_0x1ad3bc[_0xd80e('0x33')]['offset']);}_0x39088b[_0xd80e('0x3b')]=qs['sort'](_0x1ad3bc[_0xd80e('0x33')]['sort']);_0x39088b[_0xd80e('0x3c')]=qs[_0xd80e('0x34')](_['pick'](_0x1ad3bc[_0xd80e('0x33')],_0x2b1aaf[_0xd80e('0x34')]),_0x289685);if(_0x1ad3bc[_0xd80e('0x33')]['filter']){_0x39088b[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x39088b[_0xd80e('0x3c')],{'$or':_[_0xd80e('0x2d')](_0x289685,function(_0x3c6f5f){if(_0x3c6f5f[_0xd80e('0x2f')]!==_0xd80e('0x3e')){var _0x137552={};_0x137552[_0x3c6f5f[_0xd80e('0x2b')]]={'$like':'%'+_0x1ad3bc['query']['filter']+'%'};return _0x137552;}})});}_0x39088b=_['merge']({},_0x39088b,_0x1ad3bc[_0xd80e('0x3f')]);var _0x3ff4b4={'where':_0x39088b['where']};return db[_0xd80e('0x40')]['count'](_0x3ff4b4)[_0xd80e('0x28')](function(_0x5ade19){_0x361946[_0xd80e('0x21')]=_0x5ade19;if(_0x1ad3bc[_0xd80e('0x33')]['includeAll']){_0x39088b['include']=[{'all':!![]}];}return db[_0xd80e('0x40')][_0xd80e('0x41')](_0x39088b);})[_0xd80e('0x28')](function(_0x3e65a7){_0x361946[_0xd80e('0x42')]=_0x3e65a7;return _0x361946;})[_0xd80e('0x28')](respondWithFilteredResult(_0x845451,_0x39088b))[_0xd80e('0x43')](handleError(_0x845451,null));};exports[_0xd80e('0x44')]=function(_0x91c6ed,_0x2da5f5){var _0x1bbb36={'raw':![],'where':{'id':_0x91c6ed[_0xd80e('0x45')]['id']}},_0x2e257e={};_0x2e257e[_0xd80e('0x31')]=_[_0xd80e('0x32')](db[_0xd80e('0x40')]['rawAttributes']);_0x2e257e['query']=_['keys'](_0x91c6ed[_0xd80e('0x33')]);_0x2e257e['filters']=_[_0xd80e('0x35')](_0x2e257e[_0xd80e('0x31')],_0x2e257e[_0xd80e('0x33')]);_0x1bbb36[_0xd80e('0x36')]=_[_0xd80e('0x35')](_0x2e257e[_0xd80e('0x31')],qs['fields'](_0x91c6ed['query']['fields']));_0x1bbb36[_0xd80e('0x36')]=_0x1bbb36['attributes'][_0xd80e('0x38')]?_0x1bbb36[_0xd80e('0x36')]:_0x2e257e[_0xd80e('0x31')];if(_0x91c6ed[_0xd80e('0x33')][_0xd80e('0x46')]){_0x1bbb36['include']=[{'all':!![]}];}_0x1bbb36=_[_0xd80e('0x3d')]({},_0x1bbb36,_0x91c6ed[_0xd80e('0x3f')]);return db[_0xd80e('0x40')]['find'](_0x1bbb36)[_0xd80e('0x28')](handleEntityNotFound(_0x2da5f5,null))[_0xd80e('0x28')](respondWithResult(_0x2da5f5,null))[_0xd80e('0x43')](handleError(_0x2da5f5,null));};exports['create']=function(_0x8d5cb8,_0x29aaa0){return db[_0xd80e('0x40')][_0xd80e('0x47')](_0x8d5cb8[_0xd80e('0x48')],{})[_0xd80e('0x28')](respondWithResult(_0x29aaa0,0xc9))['catch'](handleError(_0x29aaa0,null));};exports['update']=function(_0x275985,_0x27134e){if(_0x275985[_0xd80e('0x48')]['id']){delete _0x275985['body']['id'];}return db['ZendeskAccount'][_0xd80e('0x49')]({'where':{'id':_0x275985[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x27134e,null))[_0xd80e('0x28')](saveUpdates(_0x275985[_0xd80e('0x48')],null))['then'](respondWithResult(_0x27134e,null))[_0xd80e('0x43')](handleError(_0x27134e,null));};exports['destroy']=function(_0x46c781,_0x31107b){return db['ZendeskAccount'][_0xd80e('0x49')]({'where':{'id':_0x46c781[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x31107b,null))[_0xd80e('0x28')](removeEntity(_0x31107b,null))[_0xd80e('0x43')](handleError(_0x31107b,null));};exports[_0xd80e('0x4a')]=function(_0x18dbb0,_0x50be26,_0x178c51){var _0x377e68={};var _0x419df7={};var _0x4a66ca;var _0x52ab04;return db[_0xd80e('0x40')][_0xd80e('0x4b')]({'where':{'id':_0x18dbb0[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x50be26,null))[_0xd80e('0x28')](function(_0x8b7a70){if(_0x8b7a70){_0x4a66ca=_0x8b7a70;_0x419df7[_0xd80e('0x31')]=_[_0xd80e('0x32')](db['ZendeskConfiguration'][_0xd80e('0x4c')]);_0x419df7['query']=_[_0xd80e('0x32')](_0x18dbb0[_0xd80e('0x33')]);_0x419df7[_0xd80e('0x34')]=_[_0xd80e('0x35')](_0x419df7[_0xd80e('0x31')],_0x419df7[_0xd80e('0x33')]);_0x377e68['attributes']=_[_0xd80e('0x35')](_0x419df7['model'],qs[_0xd80e('0x37')](_0x18dbb0[_0xd80e('0x33')]['fields']));_0x377e68['attributes']=_0x377e68[_0xd80e('0x36')][_0xd80e('0x38')]?_0x377e68[_0xd80e('0x36')]:_0x419df7['model'];_0x377e68['order']=qs[_0xd80e('0x4d')](_0x18dbb0[_0xd80e('0x33')]['sort']);_0x377e68[_0xd80e('0x3c')]=qs[_0xd80e('0x34')](_[_0xd80e('0x4e')](_0x18dbb0['query'],_0x419df7[_0xd80e('0x34')]));if(_0x18dbb0['query'][_0xd80e('0x4f')]){_0x377e68[_0xd80e('0x3c')]=_[_0xd80e('0x3d')](_0x377e68[_0xd80e('0x3c')],{'$or':_['map'](_0x377e68[_0xd80e('0x36')],function(_0x564475){var _0x53b784={};_0x53b784[_0x564475]={'$like':'%'+_0x18dbb0['query'][_0xd80e('0x4f')]+'%'};return _0x53b784;})});}_0x377e68=_[_0xd80e('0x3d')]({},_0x377e68,_0x18dbb0[_0xd80e('0x3f')]);return _0x4a66ca[_0xd80e('0x4a')](_0x377e68);}})['then'](function(_0x1738ff){if(_0x1738ff){_0x52ab04=_0x1738ff[_0xd80e('0x38')];if(!_0x18dbb0['query'][_0xd80e('0x39')](_0xd80e('0x3a'))){_0x377e68[_0xd80e('0x20')]=qs[_0xd80e('0x20')](_0x18dbb0['query'][_0xd80e('0x20')]);_0x377e68[_0xd80e('0x1e')]=qs['offset'](_0x18dbb0[_0xd80e('0x33')][_0xd80e('0x1e')]);}return _0x4a66ca[_0xd80e('0x4a')](_0x377e68);}})['then'](function(_0x562ed7){if(_0x562ed7){return _0x562ed7?{'count':_0x52ab04,'rows':_0x562ed7}:null;}})['then'](respondWithResult(_0x50be26,null))['catch'](handleError(_0x50be26,null));};exports[_0xd80e('0x50')]=function(_0x4f283c,_0x3c8ad1,_0x1b0ad4){if(_0x4f283c[_0xd80e('0x48')]['id']){delete _0x4f283c['body']['id'];}return db[_0xd80e('0x40')][_0xd80e('0x4b')]({'where':{'id':_0x4f283c[_0xd80e('0x45')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x3c8ad1,null))[_0xd80e('0x28')](function(_0x2a34cd){if(_0x2a34cd){_0x4f283c[_0xd80e('0x48')][_0xd80e('0x51')]=_0x2a34cd['id'];_0x4f283c[_0xd80e('0x48')]['Subjects']=integrations['getSubjects'](_0x4f283c[_0xd80e('0x48')][_0xd80e('0x52')],_0x4f283c[_0xd80e('0x48')][_0xd80e('0x2f')]);_0x4f283c['body'][_0xd80e('0x53')]=integrations[_0xd80e('0x54')](_0x4f283c[_0xd80e('0x48')][_0xd80e('0x52')],_0x4f283c[_0xd80e('0x48')]['type']);return db[_0xd80e('0x55')][_0xd80e('0x47')](_0x4f283c[_0xd80e('0x48')],{'include':[{'model':db[_0xd80e('0x56')],'as':'Subjects'},{'model':db[_0xd80e('0x56')],'as':_0xd80e('0x53')}]});}return null;})[_0xd80e('0x28')](respondWithResult(_0x3c8ad1,null))[_0xd80e('0x43')](handleError(_0x3c8ad1,null));};exports[_0xd80e('0x57')]=function(_0x1edcf4,_0x5cb11c,_0x3e3176){var _0x393fb6='';return db['ZendeskAccount'][_0xd80e('0x4b')]({'where':{'id':_0x1edcf4[_0xd80e('0x45')]['id']},'attributes':['id',_0xd80e('0x58'),_0xd80e('0x59'),'token',_0xd80e('0x5a'),'remoteUri']})[_0xd80e('0x28')](handleEntityNotFound(_0x5cb11c,null))[_0xd80e('0x28')](function(_0x194743){if(_0x194743){_0x393fb6=_0x194743[_0xd80e('0x5b')];var _0x4186bd=_0x393fb6['slice'](-0x1);if(_0x4186bd==='/'){_0x393fb6=_0x393fb6[_0xd80e('0x5c')](0x0,_0x393fb6[_0xd80e('0x5d')](_0x4186bd));}var _0x25e86d={'method':_0xd80e('0x5e'),'uri':util['format'](_0xd80e('0x5f'),_0x393fb6,_0xd80e('0x60')),'json':!![]};switch(_0x194743['authType']){case _0xd80e('0x59'):_0x25e86d[_0xd80e('0x61')]={'Authorization':util[_0xd80e('0x62')](_0xd80e('0x63'),new Buffer(util[_0xd80e('0x62')](_0xd80e('0x64'),_0x194743['username'],_0x194743['password']))[_0xd80e('0x65')]('base64'))};break;case'token':_0x25e86d[_0xd80e('0x61')]={'Authorization':util[_0xd80e('0x62')](_0xd80e('0x63'),new Buffer(util[_0xd80e('0x62')](_0xd80e('0x66'),_0x194743[_0xd80e('0x58')],_0x194743[_0xd80e('0x67')]))[_0xd80e('0x65')]('base64'))};break;default:throw new db[(_0xd80e('0x68'))][(_0xd80e('0x69'))](_0xd80e('0x6a'));}return rp(_0x25e86d);}})[_0xd80e('0x28')](function(_0x575bf6){if(_0x575bf6){var _0x192178=[_0xd80e('0x6b'),'description',_0xd80e('0x6c'),_0xd80e('0x6d')];_['remove'](_0x575bf6[_0xd80e('0x60')],function(_0x160dc4){return _0x192178[_0xd80e('0x6e')](_0x160dc4[_0xd80e('0x2f')]);});return{'count':_0x575bf6[_0xd80e('0x60')][_0xd80e('0x38')],'rows':_[_0xd80e('0x2d')](_0x575bf6[_0xd80e('0x60')],function(_0x392a8b){return{'id':_0x392a8b['id'],'name':_0x392a8b[_0xd80e('0x6f')]>0x7?_0x392a8b['title']:_0x392a8b[_0xd80e('0x2f')],'custom':_0x392a8b[_0xd80e('0x6f')]>0x7?!![]:![],'options':_0x392a8b['system_field_options']?_0x392a8b[_0xd80e('0x70')]:_0x392a8b[_0xd80e('0x71')]?_0x392a8b[_0xd80e('0x71')]:[]};})};}})['then'](respondWithResult(_0x5cb11c,null))[_0xd80e('0x43')](function(_0x5277a2){var _0x30fc66=_0x1edcf4[_0xd80e('0x33')][_0xd80e('0x72')]?0x1f4:_0x5277a2[_0xd80e('0x73')]||0x1f4;logger[_0xd80e('0x74')]('getFields,\x20%s,\x20%s,\x20%s',_0xd80e('0x57'),_0x30fc66,JSON[_0xd80e('0x75')](_0x5277a2));delete _0x5277a2[_0xd80e('0x2b')];if(_0x30fc66===0x191){_0x30fc66=0x190;}_0x5cb11c[_0xd80e('0x1d')](_0x30fc66)[_0xd80e('0x76')](_0x1edcf4[_0xd80e('0x33')][_0xd80e('0x72')]?{'message':_0xd80e('0x77'),'statusCode':_0x5277a2[_0xd80e('0x73')]}:_0x5277a2);});}; \ No newline at end of file +var _0xd4f4=['base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','apply','reject','save','then','sendStatus','stack','name','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','filters','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','intersection','includeAll','find','create','update','body','params','destroy','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','username','toString'];(function(_0x55eb32,_0x2a8878){var _0x126ba9=function(_0x37329b){while(--_0x37329b){_0x55eb32['push'](_0x55eb32['shift']());}};_0x126ba9(++_0x2a8878);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x57845b,_0x215add){_0x57845b=_0x57845b-0x0;var _0x47c4b0=_0xd4f4[_0x57845b];return _0x47c4b0;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5b4f4e,_0x15fe6a){_0x15fe6a=_0x15fe6a||0xcc;return function(_0xe9b7a6){if(_0xe9b7a6){return _0x5b4f4e['sendStatus'](_0x15fe6a);}return _0x5b4f4e[_0x4d4f('0x1d')](_0x15fe6a)[_0x4d4f('0x1e')]();};}function respondWithResult(_0x1878b6,_0x59252c){_0x59252c=_0x59252c||0xc8;return function(_0x145804){if(_0x145804){return _0x1878b6[_0x4d4f('0x1d')](_0x59252c)[_0x4d4f('0x1f')](_0x145804);}};}function respondWithFilteredResult(_0x4a3364,_0x59bfb5){return function(_0x5e4ff5){if(_0x5e4ff5){var _0x18a528=typeof _0x59bfb5[_0x4d4f('0x20')]===_0x4d4f('0x21')&&typeof _0x59bfb5['limit']===_0x4d4f('0x21');var _0x17a437=_0x5e4ff5['count'];var _0x5dbbeb=_0x18a528?0x0:_0x59bfb5['offset'];var _0x5a58af=_0x18a528?_0x5e4ff5['count']:_0x59bfb5[_0x4d4f('0x20')]+_0x59bfb5[_0x4d4f('0x22')];var _0x433222;if(_0x5a58af>=_0x17a437){_0x5a58af=_0x17a437;_0x433222=0xc8;}else{_0x433222=0xce;}_0x4a3364[_0x4d4f('0x1d')](_0x433222);return _0x4a3364['set']('Content-Range',_0x5dbbeb+'-'+_0x5a58af+'/'+_0x17a437)[_0x4d4f('0x1f')](_0x5e4ff5);}return null;};}function patchUpdates(_0x4dd360){return function(_0x34a232){try{jsonpatch[_0x4d4f('0x23')](_0x34a232,_0x4dd360,!![]);}catch(_0x3d1e38){return BPromise[_0x4d4f('0x24')](_0x3d1e38);}return _0x34a232[_0x4d4f('0x25')]();};}function saveUpdates(_0x5beab4,_0x570520){return function(_0x4043f2){if(_0x4043f2){return _0x4043f2['update'](_0x5beab4)[_0x4d4f('0x26')](function(_0x3d5d93){return _0x3d5d93;});}return null;};}function removeEntity(_0x2d2fb3,_0x3f4a55){return function(_0xf3f7a4){if(_0xf3f7a4){return _0xf3f7a4['destroy']()[_0x4d4f('0x26')](function(){_0x2d2fb3[_0x4d4f('0x1d')](0xcc)[_0x4d4f('0x1e')]();});}};}function handleEntityNotFound(_0x28443b,_0x5cf9e7){return function(_0x51a7c5){if(!_0x51a7c5){_0x28443b[_0x4d4f('0x27')](0x194);}return _0x51a7c5;};}function handleError(_0xd51604,_0xa2492c){_0xa2492c=_0xa2492c||0x1f4;return function(_0x1f79f9){logger['error'](_0x1f79f9[_0x4d4f('0x28')]);if(_0x1f79f9[_0x4d4f('0x29')]){delete _0x1f79f9[_0x4d4f('0x29')];}_0xd51604[_0x4d4f('0x1d')](_0xa2492c)['send'](_0x1f79f9);};}exports[_0x4d4f('0x2a')]=function(_0x51cb3d,_0x1688bb){var _0x333a40={},_0x550040={},_0x2768f1={'count':0x0,'rows':[]};var _0x123383=_[_0x4d4f('0x2b')](db[_0x4d4f('0x2c')][_0x4d4f('0x2d')],function(_0x43a704){return{'name':_0x43a704['fieldName'],'type':_0x43a704[_0x4d4f('0x2e')][_0x4d4f('0x2f')]};});_0x550040[_0x4d4f('0x30')]=_[_0x4d4f('0x2b')](_0x123383,_0x4d4f('0x29'));_0x550040['query']=_[_0x4d4f('0x31')](_0x51cb3d['query']);_0x550040[_0x4d4f('0x32')]=_['intersection'](_0x550040['model'],_0x550040['query']);_0x333a40[_0x4d4f('0x33')]=_['intersection'](_0x550040[_0x4d4f('0x30')],qs[_0x4d4f('0x34')](_0x51cb3d[_0x4d4f('0x35')]['fields']));_0x333a40[_0x4d4f('0x33')]=_0x333a40[_0x4d4f('0x33')][_0x4d4f('0x36')]?_0x333a40['attributes']:_0x550040[_0x4d4f('0x30')];if(!_0x51cb3d['query'][_0x4d4f('0x37')](_0x4d4f('0x38'))){_0x333a40[_0x4d4f('0x22')]=qs[_0x4d4f('0x22')](_0x51cb3d[_0x4d4f('0x35')][_0x4d4f('0x22')]);_0x333a40[_0x4d4f('0x20')]=qs[_0x4d4f('0x20')](_0x51cb3d['query']['offset']);}_0x333a40[_0x4d4f('0x39')]=qs['sort'](_0x51cb3d['query'][_0x4d4f('0x3a')]);_0x333a40[_0x4d4f('0x3b')]=qs[_0x4d4f('0x32')](_[_0x4d4f('0x3c')](_0x51cb3d[_0x4d4f('0x35')],_0x550040['filters']),_0x123383);if(_0x51cb3d[_0x4d4f('0x35')][_0x4d4f('0x3d')]){_0x333a40['where']=_[_0x4d4f('0x3e')](_0x333a40[_0x4d4f('0x3b')],{'$or':_[_0x4d4f('0x2b')](_0x123383,function(_0x42f9ed){if(_0x42f9ed[_0x4d4f('0x2e')]!==_0x4d4f('0x3f')){var _0x20290e={};_0x20290e[_0x42f9ed[_0x4d4f('0x29')]]={'$like':'%'+_0x51cb3d[_0x4d4f('0x35')]['filter']+'%'};return _0x20290e;}})});}_0x333a40=_['merge']({},_0x333a40,_0x51cb3d[_0x4d4f('0x40')]);var _0x324a3c={'where':_0x333a40[_0x4d4f('0x3b')]};return db[_0x4d4f('0x2c')]['count'](_0x324a3c)['then'](function(_0x3afb4c){_0x2768f1[_0x4d4f('0x41')]=_0x3afb4c;if(_0x51cb3d['query']['includeAll']){_0x333a40[_0x4d4f('0x42')]=[{'all':!![]}];}return db[_0x4d4f('0x2c')]['findAll'](_0x333a40);})[_0x4d4f('0x26')](function(_0x330bca){_0x2768f1[_0x4d4f('0x43')]=_0x330bca;return _0x2768f1;})[_0x4d4f('0x26')](respondWithFilteredResult(_0x1688bb,_0x333a40))[_0x4d4f('0x44')](handleError(_0x1688bb,null));};exports['show']=function(_0x2b274e,_0x4c7c24){var _0x45a0c1={'raw':![],'where':{'id':_0x2b274e['params']['id']}},_0x5e4839={};_0x5e4839[_0x4d4f('0x30')]=_[_0x4d4f('0x31')](db[_0x4d4f('0x2c')]['rawAttributes']);_0x5e4839[_0x4d4f('0x35')]=_['keys'](_0x2b274e[_0x4d4f('0x35')]);_0x5e4839['filters']=_[_0x4d4f('0x45')](_0x5e4839[_0x4d4f('0x30')],_0x5e4839[_0x4d4f('0x35')]);_0x45a0c1[_0x4d4f('0x33')]=_[_0x4d4f('0x45')](_0x5e4839['model'],qs['fields'](_0x2b274e[_0x4d4f('0x35')][_0x4d4f('0x34')]));_0x45a0c1[_0x4d4f('0x33')]=_0x45a0c1[_0x4d4f('0x33')]['length']?_0x45a0c1['attributes']:_0x5e4839['model'];if(_0x2b274e[_0x4d4f('0x35')][_0x4d4f('0x46')]){_0x45a0c1[_0x4d4f('0x42')]=[{'all':!![]}];}_0x45a0c1=_[_0x4d4f('0x3e')]({},_0x45a0c1,_0x2b274e[_0x4d4f('0x40')]);return db[_0x4d4f('0x2c')][_0x4d4f('0x47')](_0x45a0c1)[_0x4d4f('0x26')](handleEntityNotFound(_0x4c7c24,null))[_0x4d4f('0x26')](respondWithResult(_0x4c7c24,null))[_0x4d4f('0x44')](handleError(_0x4c7c24,null));};exports[_0x4d4f('0x48')]=function(_0x1c290b,_0x5c7a41){return db[_0x4d4f('0x2c')][_0x4d4f('0x48')](_0x1c290b['body'],{})[_0x4d4f('0x26')](respondWithResult(_0x5c7a41,0xc9))['catch'](handleError(_0x5c7a41,null));};exports[_0x4d4f('0x49')]=function(_0x401466,_0x50a3b3){if(_0x401466[_0x4d4f('0x4a')]['id']){delete _0x401466[_0x4d4f('0x4a')]['id'];}return db[_0x4d4f('0x2c')][_0x4d4f('0x47')]({'where':{'id':_0x401466[_0x4d4f('0x4b')]['id']}})[_0x4d4f('0x26')](handleEntityNotFound(_0x50a3b3,null))[_0x4d4f('0x26')](saveUpdates(_0x401466[_0x4d4f('0x4a')],null))[_0x4d4f('0x26')](respondWithResult(_0x50a3b3,null))[_0x4d4f('0x44')](handleError(_0x50a3b3,null));};exports[_0x4d4f('0x4c')]=function(_0x3a21a6,_0x504d85){return db[_0x4d4f('0x2c')]['find']({'where':{'id':_0x3a21a6['params']['id']}})['then'](handleEntityNotFound(_0x504d85,null))[_0x4d4f('0x26')](removeEntity(_0x504d85,null))[_0x4d4f('0x44')](handleError(_0x504d85,null));};exports['getConfigurations']=function(_0x5f3252,_0x2a3bc4,_0x4c80c4){var _0x5adc7b={};var _0x3191b1={};var _0x528573;var _0x17b59e;return db[_0x4d4f('0x2c')][_0x4d4f('0x4d')]({'where':{'id':_0x5f3252[_0x4d4f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a3bc4,null))[_0x4d4f('0x26')](function(_0x2008c3){if(_0x2008c3){_0x528573=_0x2008c3;_0x3191b1[_0x4d4f('0x30')]=_[_0x4d4f('0x31')](db[_0x4d4f('0x4e')]['rawAttributes']);_0x3191b1[_0x4d4f('0x35')]=_['keys'](_0x5f3252[_0x4d4f('0x35')]);_0x3191b1['filters']=_[_0x4d4f('0x45')](_0x3191b1[_0x4d4f('0x30')],_0x3191b1['query']);_0x5adc7b[_0x4d4f('0x33')]=_[_0x4d4f('0x45')](_0x3191b1['model'],qs[_0x4d4f('0x34')](_0x5f3252['query'][_0x4d4f('0x34')]));_0x5adc7b['attributes']=_0x5adc7b['attributes'][_0x4d4f('0x36')]?_0x5adc7b[_0x4d4f('0x33')]:_0x3191b1[_0x4d4f('0x30')];_0x5adc7b[_0x4d4f('0x39')]=qs[_0x4d4f('0x3a')](_0x5f3252['query']['sort']);_0x5adc7b[_0x4d4f('0x3b')]=qs['filters'](_[_0x4d4f('0x3c')](_0x5f3252[_0x4d4f('0x35')],_0x3191b1[_0x4d4f('0x32')]));if(_0x5f3252[_0x4d4f('0x35')][_0x4d4f('0x3d')]){_0x5adc7b[_0x4d4f('0x3b')]=_['merge'](_0x5adc7b[_0x4d4f('0x3b')],{'$or':_[_0x4d4f('0x2b')](_0x5adc7b[_0x4d4f('0x33')],function(_0x4bb7ac){var _0x2011aa={};_0x2011aa[_0x4bb7ac]={'$like':'%'+_0x5f3252[_0x4d4f('0x35')][_0x4d4f('0x3d')]+'%'};return _0x2011aa;})});}_0x5adc7b=_['merge']({},_0x5adc7b,_0x5f3252[_0x4d4f('0x40')]);return _0x528573['getConfigurations'](_0x5adc7b);}})[_0x4d4f('0x26')](function(_0x2145ca){if(_0x2145ca){_0x17b59e=_0x2145ca[_0x4d4f('0x36')];if(!_0x5f3252[_0x4d4f('0x35')][_0x4d4f('0x37')](_0x4d4f('0x38'))){_0x5adc7b[_0x4d4f('0x22')]=qs[_0x4d4f('0x22')](_0x5f3252[_0x4d4f('0x35')]['limit']);_0x5adc7b[_0x4d4f('0x20')]=qs[_0x4d4f('0x20')](_0x5f3252['query'][_0x4d4f('0x20')]);}return _0x528573[_0x4d4f('0x4f')](_0x5adc7b);}})[_0x4d4f('0x26')](function(_0xae8fe){if(_0xae8fe){return _0xae8fe?{'count':_0x17b59e,'rows':_0xae8fe}:null;}})['then'](respondWithResult(_0x2a3bc4,null))[_0x4d4f('0x44')](handleError(_0x2a3bc4,null));};exports[_0x4d4f('0x50')]=function(_0x5995f2,_0x4d979a,_0x55552d){if(_0x5995f2[_0x4d4f('0x4a')]['id']){delete _0x5995f2['body']['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x5995f2[_0x4d4f('0x4b')]['id']}})[_0x4d4f('0x26')](handleEntityNotFound(_0x4d979a,null))['then'](function(_0x347bb1){if(_0x347bb1){_0x5995f2[_0x4d4f('0x4a')][_0x4d4f('0x51')]=_0x347bb1['id'];_0x5995f2[_0x4d4f('0x4a')][_0x4d4f('0x52')]=integrations[_0x4d4f('0x53')](_0x5995f2[_0x4d4f('0x4a')][_0x4d4f('0x54')],_0x5995f2['body'][_0x4d4f('0x2e')]);_0x5995f2['body'][_0x4d4f('0x55')]=integrations[_0x4d4f('0x56')](_0x5995f2[_0x4d4f('0x4a')]['channel'],_0x5995f2[_0x4d4f('0x4a')][_0x4d4f('0x2e')]);return db[_0x4d4f('0x4e')][_0x4d4f('0x48')](_0x5995f2['body'],{'include':[{'model':db[_0x4d4f('0x57')],'as':'Subjects'},{'model':db[_0x4d4f('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4d979a,null))[_0x4d4f('0x44')](handleError(_0x4d979a,null));};exports[_0x4d4f('0x58')]=function(_0x5dd9ff,_0x3ade3d,_0x53a18b){var _0x41ffe7='';return db[_0x4d4f('0x2c')][_0x4d4f('0x4d')]({'where':{'id':_0x5dd9ff[_0x4d4f('0x4b')]['id']},'attributes':['id','username',_0x4d4f('0x59'),_0x4d4f('0x5a'),_0x4d4f('0x5b'),'remoteUri']})[_0x4d4f('0x26')](handleEntityNotFound(_0x3ade3d,null))[_0x4d4f('0x26')](function(_0x21046c){if(_0x21046c){_0x41ffe7=_0x21046c[_0x4d4f('0x5c')];var _0x3c5aee=_0x41ffe7[_0x4d4f('0x5d')](-0x1);if(_0x3c5aee==='/'){_0x41ffe7=_0x41ffe7['substring'](0x0,_0x41ffe7['lastIndexOf'](_0x3c5aee));}var _0x2ce3ce={'method':_0x4d4f('0x5e'),'uri':util['format'](_0x4d4f('0x5f'),_0x41ffe7,_0x4d4f('0x60')),'json':!![]};switch(_0x21046c[_0x4d4f('0x5b')]){case _0x4d4f('0x59'):_0x2ce3ce[_0x4d4f('0x61')]={'Authorization':util[_0x4d4f('0x62')](_0x4d4f('0x63'),new Buffer(util[_0x4d4f('0x62')](_0x4d4f('0x64'),_0x21046c[_0x4d4f('0x65')],_0x21046c[_0x4d4f('0x59')]))[_0x4d4f('0x66')](_0x4d4f('0x67')))};break;case _0x4d4f('0x5a'):_0x2ce3ce[_0x4d4f('0x61')]={'Authorization':util['format'](_0x4d4f('0x63'),new Buffer(util[_0x4d4f('0x62')](_0x4d4f('0x68'),_0x21046c[_0x4d4f('0x65')],_0x21046c['token']))['toString'](_0x4d4f('0x67')))};break;default:throw new db[(_0x4d4f('0x69'))][(_0x4d4f('0x6a'))](_0x4d4f('0x6b'));}return rp(_0x2ce3ce);}})[_0x4d4f('0x26')](function(_0x2876b5){if(_0x2876b5){var _0x19a8fb=[_0x4d4f('0x6c'),_0x4d4f('0x6d'),_0x4d4f('0x6e'),'assignee'];_[_0x4d4f('0x6f')](_0x2876b5[_0x4d4f('0x60')],function(_0x101a0a){return _0x19a8fb[_0x4d4f('0x70')](_0x101a0a['type']);});return{'count':_0x2876b5['ticket_fields']['length'],'rows':_[_0x4d4f('0x2b')](_0x2876b5['ticket_fields'],function(_0x3e592b){return{'id':_0x3e592b['id'],'name':_0x3e592b[_0x4d4f('0x71')]>0x7?_0x3e592b[_0x4d4f('0x72')]:_0x3e592b[_0x4d4f('0x2e')],'custom':_0x3e592b[_0x4d4f('0x71')]>0x7?!![]:![],'options':_0x3e592b[_0x4d4f('0x73')]?_0x3e592b[_0x4d4f('0x73')]:_0x3e592b[_0x4d4f('0x74')]?_0x3e592b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x3ade3d,null))[_0x4d4f('0x44')](function(_0x59a813){var _0x3a81b7=_0x5dd9ff[_0x4d4f('0x35')][_0x4d4f('0x75')]?0x1f4:_0x59a813['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x4d4f('0x58'),_0x3a81b7,JSON['stringify'](_0x59a813));delete _0x59a813[_0x4d4f('0x29')];if(_0x3a81b7===0x191){_0x3a81b7=0x190;}_0x3ade3d['status'](_0x3a81b7)[_0x4d4f('0x76')](_0x5dd9ff[_0x4d4f('0x35')][_0x4d4f('0x75')]?{'message':_0x4d4f('0x77'),'statusCode':_0x59a813[_0x4d4f('0x78')]}:_0x59a813);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 98ec8d9..a0c2dc2 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 _0x1e98=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util'];(function(_0x98def1,_0x2be5b9){var _0x58bb48=function(_0x54e5ef){while(--_0x54e5ef){_0x98def1['push'](_0x98def1['shift']());}};_0x58bb48(++_0x2be5b9);}(_0x1e98,0x73));var _0x81e9=function(_0x48c841,_0x27374a){_0x48c841=_0x48c841-0x0;var _0x22c86f=_0x1e98[_0x48c841];return _0x22c86f;};'use strict';var _=require(_0x81e9('0x0'));var util=require(_0x81e9('0x1'));var logger=require(_0x81e9('0x2'))(_0x81e9('0x3'));var moment=require('moment');var BPromise=require(_0x81e9('0x4'));var rp=require(_0x81e9('0x5'));var fs=require('fs');var path=require(_0x81e9('0x6'));var rimraf=require('rimraf');var config=require(_0x81e9('0x7'));var attributes=require(_0x81e9('0x8'));var integrations=require(_0x81e9('0x9'));module[_0x81e9('0xa')]=function(_0x5829e3,_0x172098){return _0x5829e3[_0x81e9('0xb')]('ZendeskAccount',attributes,{'tableName':_0x81e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eb8=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts'];(function(_0x295ea9,_0x19d658){var _0x59a3fe=function(_0x35be54){while(--_0x35be54){_0x295ea9['push'](_0x295ea9['shift']());}};_0x59a3fe(++_0x19d658);}(_0x0eb8,0x134));var _0x80eb=function(_0x544b16,_0x2382b3){_0x544b16=_0x544b16-0x0;var _0x403860=_0x0eb8[_0x544b16];return _0x403860;};'use strict';var _=require('lodash');var util=require(_0x80eb('0x0'));var logger=require('../../config/logger')(_0x80eb('0x1'));var moment=require('moment');var BPromise=require(_0x80eb('0x2'));var rp=require(_0x80eb('0x3'));var fs=require('fs');var path=require(_0x80eb('0x4'));var rimraf=require(_0x80eb('0x5'));var config=require(_0x80eb('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x80eb('0x7'));module[_0x80eb('0x8')]=function(_0x1c6b19,_0x32b0ea){return _0x1c6b19['define'](_0x80eb('0x9'),attributes,{'tableName':_0x80eb('0xa'),'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 dcb79d7..f2e11a7 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 _0xcdcb=['code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','include','map','model','attributes','stringify','catch','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x408ff7,_0xfdf133){var _0x4b4abd=function(_0x472322){while(--_0x472322){_0x408ff7['push'](_0x408ff7['shift']());}};_0x4b4abd(++_0xfdf133);}(_0xcdcb,0x75));var _0xbcdc=function(_0x16cbab,_0x154522){_0x16cbab=_0x16cbab-0x0;var _0xe32356=_0xcdcb[_0x16cbab];return _0xe32356;};'use strict';var _=require('lodash');var util=require(_0xbcdc('0x0'));var moment=require(_0xbcdc('0x1'));var BPromise=require(_0xbcdc('0x2'));var rs=require(_0xbcdc('0x3'));var fs=require('fs');var Redis=require(_0xbcdc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcdc('0x5'));var logger=require(_0xbcdc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcdc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x280311,_0x868720,_0x5cba04){return new BPromise(function(_0xd1ab55,_0x391750){return client[_0xbcdc('0x8')](_0x280311,_0x5cba04)[_0xbcdc('0x9')](function(_0x247937){logger[_0xbcdc('0xa')](_0xbcdc('0xb'),_0x868720,_0xbcdc('0xc'));logger[_0xbcdc('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x868720,_0xbcdc('0xc'),JSON['stringify'](_0x247937));if(_0x247937[_0xbcdc('0xe')]){if(_0x247937[_0xbcdc('0xe')][_0xbcdc('0xf')]===0x1f4){logger[_0xbcdc('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x868720,_0x247937[_0xbcdc('0xe')][_0xbcdc('0x10')]);return _0x391750(_0x247937[_0xbcdc('0xe')][_0xbcdc('0x10')]);}logger[_0xbcdc('0xe')](_0xbcdc('0xb'),_0x868720,_0x247937[_0xbcdc('0xe')]['message']);return _0xd1ab55(_0x247937[_0xbcdc('0xe')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x868720,_0xbcdc('0xc'));_0xd1ab55(_0x247937[_0xbcdc('0x11')]['message']);}})['catch'](function(_0x152775){logger[_0xbcdc('0xe')](_0xbcdc('0xb'),_0x868720,_0x152775);_0x391750(_0x152775);});});}exports[_0xbcdc('0x12')]=function(_0x2b6150){var _0x543ce6=this;return new Promise(function(_0x271b39,_0x549abe){return db[_0xbcdc('0x13')][_0xbcdc('0x14')]({'raw':_0x2b6150['options']?_0x2b6150[_0xbcdc('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2b6150[_0xbcdc('0x15')]?_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x16')]||null:null,'attributes':_0x2b6150[_0xbcdc('0x15')]?_0x2b6150['options']['attributes']||null:null,'limit':_0x2b6150[_0xbcdc('0x15')]?_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x17')]||null:null,'include':_0x2b6150['options']?_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0x2b6150[_0xbcdc('0x15')][_0xbcdc('0x18')],function(_0x1ddab5){return{'model':db[_0x1ddab5[_0xbcdc('0x1a')]],'as':_0x1ddab5['as'],'attributes':_0x1ddab5[_0xbcdc('0x1b')],'include':_0x1ddab5[_0xbcdc('0x18')]?_['map'](_0x1ddab5[_0xbcdc('0x18')],function(_0x597e1f){return{'model':db[_0x597e1f['model']],'as':_0x597e1f['as'],'attributes':_0x597e1f[_0xbcdc('0x1b')],'include':_0x597e1f[_0xbcdc('0x18')]?_['map'](_0x597e1f[_0xbcdc('0x18')],function(_0x154412){return{'model':db[_0x154412[_0xbcdc('0x1a')]],'as':_0x154412['as'],'attributes':_0x154412['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcdc('0x9')](function(_0x29bc40){logger[_0xbcdc('0xa')]('GetZendeskAccount',_0x2b6150);logger[_0xbcdc('0xd')](_0xbcdc('0x12'),_0x2b6150,JSON[_0xbcdc('0x1c')](_0x29bc40));_0x271b39(_0x29bc40);})[_0xbcdc('0x1d')](function(_0x33472e){logger[_0xbcdc('0xe')](_0xbcdc('0x12'),_0x33472e[_0xbcdc('0x10')],_0x2b6150);_0x549abe(_0x543ce6[_0xbcdc('0xe')](0x1f4,_0x33472e[_0xbcdc('0x10')]));});});};exports[_0xbcdc('0x1e')]=function(_0x219c89){var _0x5e594c=this;return new Promise(function(_0x28682d,_0x2e2e89){return db[_0xbcdc('0x13')][_0xbcdc('0x1f')]({'raw':_0x219c89[_0xbcdc('0x15')]?_0x219c89[_0xbcdc('0x15')][_0xbcdc('0x20')]===undefined?!![]:![]:!![],'where':_0x219c89[_0xbcdc('0x15')]?_0x219c89[_0xbcdc('0x15')]['where']||null:null,'attributes':_0x219c89[_0xbcdc('0x15')]?_0x219c89[_0xbcdc('0x15')][_0xbcdc('0x1b')]||null:null,'include':_0x219c89['options']?_0x219c89[_0xbcdc('0x15')][_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0x219c89['options'][_0xbcdc('0x18')],function(_0xd66c0b){return{'model':db[_0xd66c0b['model']],'as':_0xd66c0b['as'],'attributes':_0xd66c0b['attributes'],'include':_0xd66c0b[_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0xd66c0b[_0xbcdc('0x18')],function(_0x60be38){return{'model':db[_0x60be38[_0xbcdc('0x1a')]],'as':_0x60be38['as'],'attributes':_0x60be38[_0xbcdc('0x1b')],'include':_0x60be38[_0xbcdc('0x18')]?_[_0xbcdc('0x19')](_0x60be38['include'],function(_0x5898d7){return{'model':db[_0x5898d7[_0xbcdc('0x1a')]],'as':_0x5898d7['as'],'attributes':_0x5898d7[_0xbcdc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x515ea4){logger['info']('ShowZendeskAccount',_0x219c89);logger['debug'](_0xbcdc('0x1e'),_0x219c89,JSON['stringify'](_0x515ea4));_0x28682d(_0x515ea4);})['catch'](function(_0x229b56){logger[_0xbcdc('0xe')](_0xbcdc('0x1e'),_0x229b56[_0xbcdc('0x10')],_0x219c89);_0x2e2e89(_0x5e594c[_0xbcdc('0xe')](0x1f4,_0x229b56[_0xbcdc('0x10')]));});});}; \ No newline at end of file +var _0x9f99=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','ZendeskAccount','findAll','options','raw','limit','include','map','model','attributes','GetZendeskAccount','find','where','ShowZendeskAccount','lodash','util','moment'];(function(_0x3d8e30,_0x2fc6aa){var _0x11b52b=function(_0x4ecd64){while(--_0x4ecd64){_0x3d8e30['push'](_0x3d8e30['shift']());}};_0x11b52b(++_0x2fc6aa);}(_0x9f99,0x1e7));var _0x99f9=function(_0x502f94,_0x20d782){_0x502f94=_0x502f94-0x0;var _0x506f95=_0x9f99[_0x502f94];return _0x506f95;};'use strict';var _=require(_0x99f9('0x0'));var util=require(_0x99f9('0x1'));var moment=require(_0x99f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x99f9('0x3'));var fs=require('fs');var Redis=require(_0x99f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99f9('0x5'));var logger=require(_0x99f9('0x6'))('rpc');var config=require(_0x99f9('0x7'));var jayson=require(_0x99f9('0x8'));var client=jayson['client'][_0x99f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b404b,_0x392ddf,_0x2d7918){return new BPromise(function(_0x2c12ef,_0xf9aea0){return client['request'](_0x4b404b,_0x2d7918)[_0x99f9('0xa')](function(_0x19df8c){logger['info'](_0x99f9('0xb'),_0x392ddf,_0x99f9('0xc'));logger[_0x99f9('0xd')](_0x99f9('0xe'),_0x392ddf,_0x99f9('0xc'),JSON[_0x99f9('0xf')](_0x19df8c));if(_0x19df8c['error']){if(_0x19df8c['error'][_0x99f9('0x10')]===0x1f4){logger[_0x99f9('0x11')](_0x99f9('0xb'),_0x392ddf,_0x19df8c[_0x99f9('0x11')][_0x99f9('0x12')]);return _0xf9aea0(_0x19df8c[_0x99f9('0x11')][_0x99f9('0x12')]);}logger[_0x99f9('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x392ddf,_0x19df8c['error']['message']);return _0x2c12ef(_0x19df8c[_0x99f9('0x11')][_0x99f9('0x12')]);}else{logger[_0x99f9('0x13')](_0x99f9('0xb'),_0x392ddf,_0x99f9('0xc'));_0x2c12ef(_0x19df8c[_0x99f9('0x14')][_0x99f9('0x12')]);}})[_0x99f9('0x15')](function(_0x3e95e5){logger[_0x99f9('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x392ddf,_0x3e95e5);_0xf9aea0(_0x3e95e5);});});}exports['GetZendeskAccount']=function(_0x1e82b9){var _0xe3b0e5=this;return new Promise(function(_0x41247c,_0x15af30){return db[_0x99f9('0x16')][_0x99f9('0x17')]({'raw':_0x1e82b9[_0x99f9('0x18')]?_0x1e82b9[_0x99f9('0x18')][_0x99f9('0x19')]===undefined?!![]:![]:!![],'where':_0x1e82b9[_0x99f9('0x18')]?_0x1e82b9[_0x99f9('0x18')]['where']||null:null,'attributes':_0x1e82b9[_0x99f9('0x18')]?_0x1e82b9[_0x99f9('0x18')]['attributes']||null:null,'limit':_0x1e82b9[_0x99f9('0x18')]?_0x1e82b9[_0x99f9('0x18')][_0x99f9('0x1a')]||null:null,'include':_0x1e82b9['options']?_0x1e82b9[_0x99f9('0x18')][_0x99f9('0x1b')]?_[_0x99f9('0x1c')](_0x1e82b9[_0x99f9('0x18')][_0x99f9('0x1b')],function(_0x7c6bde){return{'model':db[_0x7c6bde[_0x99f9('0x1d')]],'as':_0x7c6bde['as'],'attributes':_0x7c6bde[_0x99f9('0x1e')],'include':_0x7c6bde[_0x99f9('0x1b')]?_[_0x99f9('0x1c')](_0x7c6bde['include'],function(_0x4df8ab){return{'model':db[_0x4df8ab[_0x99f9('0x1d')]],'as':_0x4df8ab['as'],'attributes':_0x4df8ab[_0x99f9('0x1e')],'include':_0x4df8ab[_0x99f9('0x1b')]?_[_0x99f9('0x1c')](_0x4df8ab['include'],function(_0xc34584){return{'model':db[_0xc34584[_0x99f9('0x1d')]],'as':_0xc34584['as'],'attributes':_0xc34584[_0x99f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x99f9('0xa')](function(_0x228904){logger[_0x99f9('0x13')](_0x99f9('0x1f'),_0x1e82b9);logger['debug'](_0x99f9('0x1f'),_0x1e82b9,JSON[_0x99f9('0xf')](_0x228904));_0x41247c(_0x228904);})[_0x99f9('0x15')](function(_0x6f31fa){logger[_0x99f9('0x11')](_0x99f9('0x1f'),_0x6f31fa[_0x99f9('0x12')],_0x1e82b9);_0x15af30(_0xe3b0e5[_0x99f9('0x11')](0x1f4,_0x6f31fa[_0x99f9('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x917d98){var _0x251ea0=this;return new Promise(function(_0x544bd4,_0x18e79e){return db[_0x99f9('0x16')][_0x99f9('0x20')]({'raw':_0x917d98[_0x99f9('0x18')]?_0x917d98[_0x99f9('0x18')][_0x99f9('0x19')]===undefined?!![]:![]:!![],'where':_0x917d98[_0x99f9('0x18')]?_0x917d98['options'][_0x99f9('0x21')]||null:null,'attributes':_0x917d98[_0x99f9('0x18')]?_0x917d98['options']['attributes']||null:null,'include':_0x917d98[_0x99f9('0x18')]?_0x917d98[_0x99f9('0x18')]['include']?_[_0x99f9('0x1c')](_0x917d98[_0x99f9('0x18')]['include'],function(_0x520201){return{'model':db[_0x520201[_0x99f9('0x1d')]],'as':_0x520201['as'],'attributes':_0x520201[_0x99f9('0x1e')],'include':_0x520201['include']?_[_0x99f9('0x1c')](_0x520201['include'],function(_0x4bce02){return{'model':db[_0x4bce02[_0x99f9('0x1d')]],'as':_0x4bce02['as'],'attributes':_0x4bce02[_0x99f9('0x1e')],'include':_0x4bce02[_0x99f9('0x1b')]?_[_0x99f9('0x1c')](_0x4bce02[_0x99f9('0x1b')],function(_0x5883c1){return{'model':db[_0x5883c1['model']],'as':_0x5883c1['as'],'attributes':_0x5883c1[_0x99f9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53a43c){logger[_0x99f9('0x13')](_0x99f9('0x22'),_0x917d98);logger[_0x99f9('0xd')](_0x99f9('0x22'),_0x917d98,JSON[_0x99f9('0xf')](_0x53a43c));_0x544bd4(_0x53a43c);})[_0x99f9('0x15')](function(_0x63bf5b){logger[_0x99f9('0x11')](_0x99f9('0x22'),_0x63bf5b[_0x99f9('0x12')],_0x917d98);_0x18e79e(_0x251ea0[_0x99f9('0x11')](0x1f4,_0x63bf5b[_0x99f9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index da13629..9d2e3d5 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 _0x153f=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0xa69828,_0x152619){var _0x32eb63=function(_0x53f15){while(--_0x53f15){_0xa69828['push'](_0xa69828['shift']());}};_0x32eb63(++_0x152619);}(_0x153f,0x15b));var _0xf153=function(_0x4fa4fb,_0x5b8963){_0x4fa4fb=_0x4fa4fb-0x0;var _0x394418=_0x153f[_0x4fa4fb];return _0x394418;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['get'](_0xf153('0x11'),auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router['get'](_0xf153('0x13'),auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);router[_0xf153('0x15')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x15')](_0xf153('0x13'),auth[_0xf153('0xa')](),controller['setTags']);router[_0xf153('0x17')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x19')]);router[_0xf153('0x1a')](_0xf153('0x18'),auth[_0xf153('0xa')](),controller[_0xf153('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 57d7c08..d97ac79 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 _0xff62=['exports','STRING','sequelize'];(function(_0x57f886,_0x12d918){var _0x561e1d=function(_0x1d82f9){while(--_0x1d82f9){_0x57f886['push'](_0x57f886['shift']());}};_0x561e1d(++_0x12d918);}(_0xff62,0x149));var _0x2ff6=function(_0x5873fc,_0x18c3b0){_0x5873fc=_0x5873fc-0x0;var _0x33987a=_0xff62[_0x5873fc];return _0x33987a;};'use strict';var Sequelize=require(_0x2ff6('0x0'));module[_0x2ff6('0x1')]={'name':{'type':Sequelize[_0x2ff6('0x2')]},'description':{'type':Sequelize[_0x2ff6('0x2')]}}; \ No newline at end of file +var _0xe481=['STRING','exports'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xe481,0x1ab));var _0x1e48=function(_0x48b9ef,_0x34caac){_0x48b9ef=_0x48b9ef-0x0;var _0x62b00=_0xe481[_0x48b9ef];return _0x62b00;};'use strict';var Sequelize=require('sequelize');module[_0x1e48('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1e48('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b435396..e25a994 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 _0x4b68=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','error','name','send','index','ZendeskConfiguration','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x4c25cb,_0xce5c6c){var _0x5a61f2=function(_0x5ad642){while(--_0x5ad642){_0x4c25cb['push'](_0x4c25cb['shift']());}};_0x5a61f2(++_0xce5c6c);}(_0x4b68,0xe9));var _0x84b6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4b68[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x84b6('0x0'));var rimraf=require(_0x84b6('0x1'));var zipdir=require(_0x84b6('0x2'));var jsonpatch=require(_0x84b6('0x3'));var rp=require(_0x84b6('0x4'));var moment=require(_0x84b6('0x5'));var BPromise=require(_0x84b6('0x6'));var Mustache=require(_0x84b6('0x7'));var util=require('util');var path=require(_0x84b6('0x8'));var sox=require(_0x84b6('0x9'));var csv=require('to-csv');var ejs=require(_0x84b6('0xa'));var fs=require('fs');var fs_extra=require(_0x84b6('0xb'));var _=require(_0x84b6('0xc'));var squel=require(_0x84b6('0xd'));var crypto=require('crypto');var jsforce=require(_0x84b6('0xe'));var deskjs=require(_0x84b6('0xf'));var toCsv=require(_0x84b6('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x84b6('0x11'));var authService=require(_0x84b6('0x12'));var qs=require(_0x84b6('0x13'));var as=require(_0x84b6('0x14'));var hardwareService=require(_0x84b6('0x15'));var logger=require(_0x84b6('0x16'))(_0x84b6('0x17'));var utils=require('../../config/utils');var config=require(_0x84b6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x84b6('0x19'))['db'];function respondWithStatusCode(_0x446558,_0x1243a2){_0x1243a2=_0x1243a2||0xcc;return function(_0x5d12ea){if(_0x5d12ea){return _0x446558['sendStatus'](_0x1243a2);}return _0x446558[_0x84b6('0x1a')](_0x1243a2)[_0x84b6('0x1b')]();};}function respondWithResult(_0x5eb04d,_0x37b00c){_0x37b00c=_0x37b00c||0xc8;return function(_0x2f0d68){if(_0x2f0d68){return _0x5eb04d[_0x84b6('0x1a')](_0x37b00c)[_0x84b6('0x1c')](_0x2f0d68);}};}function respondWithFilteredResult(_0xc57d6e,_0x1fd92a){return function(_0x11fe88){if(_0x11fe88){var _0x298f1b=typeof _0x1fd92a[_0x84b6('0x1d')]===_0x84b6('0x1e')&&typeof _0x1fd92a['limit']===_0x84b6('0x1e');var _0x309c06=_0x11fe88['count'];var _0x46e1f1=_0x298f1b?0x0:_0x1fd92a['offset'];var _0x339a25=_0x298f1b?_0x11fe88[_0x84b6('0x1f')]:_0x1fd92a[_0x84b6('0x1d')]+_0x1fd92a[_0x84b6('0x20')];var _0x43cd95;if(_0x339a25>=_0x309c06){_0x339a25=_0x309c06;_0x43cd95=0xc8;}else{_0x43cd95=0xce;}_0xc57d6e['status'](_0x43cd95);return _0xc57d6e[_0x84b6('0x21')]('Content-Range',_0x46e1f1+'-'+_0x339a25+'/'+_0x309c06)['json'](_0x11fe88);}return null;};}function patchUpdates(_0xf3028d){return function(_0x42f500){try{jsonpatch[_0x84b6('0x22')](_0x42f500,_0xf3028d,!![]);}catch(_0x57a138){return BPromise['reject'](_0x57a138);}return _0x42f500[_0x84b6('0x23')]();};}function saveUpdates(_0x5418ca,_0x3c0794){return function(_0x5355bd){if(_0x5355bd){return _0x5355bd[_0x84b6('0x24')](_0x5418ca)['then'](function(_0x20f559){return _0x20f559;});}return null;};}function removeEntity(_0x5a88ae,_0x1eca8f){return function(_0x17b26d){if(_0x17b26d){return _0x17b26d[_0x84b6('0x25')]()[_0x84b6('0x26')](function(){_0x5a88ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56a894,_0x5d904f){return function(_0xf78fc3){if(!_0xf78fc3){_0x56a894['sendStatus'](0x194);}return _0xf78fc3;};}function handleError(_0x21cc95,_0x314fbb){_0x314fbb=_0x314fbb||0x1f4;return function(_0x429e2e){logger[_0x84b6('0x27')](_0x429e2e['stack']);if(_0x429e2e[_0x84b6('0x28')]){delete _0x429e2e[_0x84b6('0x28')];}_0x21cc95['status'](_0x314fbb)[_0x84b6('0x29')](_0x429e2e);};}exports[_0x84b6('0x2a')]=function(_0x36a0c7,_0x4230ec){var _0x487490={},_0x354345={},_0x1bbb7a={'count':0x0,'rows':[]};var _0x3a81a0=_['map'](db[_0x84b6('0x2b')]['rawAttributes'],function(_0x339f02){return{'name':_0x339f02[_0x84b6('0x2c')],'type':_0x339f02[_0x84b6('0x2d')]['key']};});_0x354345[_0x84b6('0x2e')]=_[_0x84b6('0x2f')](_0x3a81a0,_0x84b6('0x28'));_0x354345[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x36a0c7['query']);_0x354345[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x354345[_0x84b6('0x2e')],_0x354345[_0x84b6('0x30')]);_0x487490[_0x84b6('0x34')]=_[_0x84b6('0x33')](_0x354345[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x35')]));_0x487490['attributes']=_0x487490[_0x84b6('0x34')][_0x84b6('0x36')]?_0x487490[_0x84b6('0x34')]:_0x354345[_0x84b6('0x2e')];if(!_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x37')](_0x84b6('0x38'))){_0x487490['limit']=qs[_0x84b6('0x20')](_0x36a0c7['query'][_0x84b6('0x20')]);_0x487490['offset']=qs['offset'](_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x1d')]);}_0x487490[_0x84b6('0x39')]=qs['sort'](_0x36a0c7['query'][_0x84b6('0x3a')]);_0x487490[_0x84b6('0x3b')]=qs[_0x84b6('0x32')](_[_0x84b6('0x3c')](_0x36a0c7[_0x84b6('0x30')],_0x354345['filters']),_0x3a81a0);if(_0x36a0c7[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x487490[_0x84b6('0x3b')]=_[_0x84b6('0x3e')](_0x487490[_0x84b6('0x3b')],{'$or':_['map'](_0x3a81a0,function(_0x320b47){if(_0x320b47[_0x84b6('0x2d')]!==_0x84b6('0x3f')){var _0x4c2c91={};_0x4c2c91[_0x320b47['name']]={'$like':'%'+_0x36a0c7['query'][_0x84b6('0x3d')]+'%'};return _0x4c2c91;}})});}_0x487490=_[_0x84b6('0x3e')]({},_0x487490,_0x36a0c7[_0x84b6('0x40')]);var _0x1e033d={'where':_0x487490['where']};return db[_0x84b6('0x2b')][_0x84b6('0x1f')](_0x1e033d)[_0x84b6('0x26')](function(_0x1b1df8){_0x1bbb7a[_0x84b6('0x1f')]=_0x1b1df8;if(_0x36a0c7['query']['includeAll']){_0x487490[_0x84b6('0x41')]=[{'all':!![]}];}return db[_0x84b6('0x2b')][_0x84b6('0x42')](_0x487490);})[_0x84b6('0x26')](function(_0x59659f){_0x1bbb7a[_0x84b6('0x43')]=_0x59659f;return _0x1bbb7a;})[_0x84b6('0x26')](respondWithFilteredResult(_0x4230ec,_0x487490))[_0x84b6('0x44')](handleError(_0x4230ec,null));};exports[_0x84b6('0x45')]=function(_0x47e5c0,_0x5a855b){var _0x3d1e73={'raw':![],'where':{'id':_0x47e5c0[_0x84b6('0x46')]['id']}},_0x47815e={};_0x47815e[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db['ZendeskConfiguration'][_0x84b6('0x47')]);_0x47815e[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x47e5c0['query']);_0x47815e[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x47815e[_0x84b6('0x2e')],_0x47815e[_0x84b6('0x30')]);_0x3d1e73['attributes']=_['intersection'](_0x47815e[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0x47e5c0[_0x84b6('0x30')][_0x84b6('0x35')]));_0x3d1e73['attributes']=_0x3d1e73['attributes'][_0x84b6('0x36')]?_0x3d1e73[_0x84b6('0x34')]:_0x47815e[_0x84b6('0x2e')];if(_0x47e5c0['query'][_0x84b6('0x48')]){_0x3d1e73[_0x84b6('0x41')]=[{'all':!![]}];}_0x3d1e73=_[_0x84b6('0x3e')]({},_0x3d1e73,_0x47e5c0[_0x84b6('0x40')]);return db[_0x84b6('0x2b')][_0x84b6('0x49')](_0x3d1e73)[_0x84b6('0x26')](handleEntityNotFound(_0x5a855b,null))[_0x84b6('0x26')](respondWithResult(_0x5a855b,null))[_0x84b6('0x44')](handleError(_0x5a855b,null));};exports[_0x84b6('0x4a')]=function(_0x53f983,_0xd08edd){return db[_0x84b6('0x2b')][_0x84b6('0x4a')](_0x53f983[_0x84b6('0x4b')],{})['then'](respondWithResult(_0xd08edd,0xc9))['catch'](handleError(_0xd08edd,null));};exports['update']=function(_0x391c1d,_0x2d33bd){if(_0x391c1d[_0x84b6('0x4b')]['id']){delete _0x391c1d[_0x84b6('0x4b')]['id'];}return db['ZendeskConfiguration'][_0x84b6('0x49')]({'where':{'id':_0x391c1d['params']['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x2d33bd,null))[_0x84b6('0x26')](saveUpdates(_0x391c1d[_0x84b6('0x4b')],null))[_0x84b6('0x26')](respondWithResult(_0x2d33bd,null))['catch'](handleError(_0x2d33bd,null));};exports['destroy']=function(_0x37713e,_0x409c1c){return db[_0x84b6('0x2b')]['find']({'where':{'id':_0x37713e[_0x84b6('0x46')]['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x409c1c,null))[_0x84b6('0x26')](removeEntity(_0x409c1c,null))[_0x84b6('0x44')](handleError(_0x409c1c,null));};exports[_0x84b6('0x4c')]=function(_0x2a9f50,_0x3587f7,_0x31028e){var _0x9548df={};var _0x4e4317={};var _0x157b49;var _0x186432;return db[_0x84b6('0x2b')][_0x84b6('0x4d')]({'where':{'id':_0x2a9f50[_0x84b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x3587f7,null))['then'](function(_0xfb6f64){if(_0xfb6f64){_0x157b49=_0xfb6f64;_0x4e4317[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db['ZendeskField']['rawAttributes']);_0x4e4317[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x2a9f50[_0x84b6('0x30')]);_0x4e4317[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x4e4317[_0x84b6('0x2e')],_0x4e4317[_0x84b6('0x30')]);_0x9548df[_0x84b6('0x34')]=_[_0x84b6('0x33')](_0x4e4317['model'],qs[_0x84b6('0x35')](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x35')]));_0x9548df[_0x84b6('0x34')]=_0x9548df[_0x84b6('0x34')][_0x84b6('0x36')]?_0x9548df[_0x84b6('0x34')]:_0x4e4317[_0x84b6('0x2e')];_0x9548df[_0x84b6('0x39')]=qs[_0x84b6('0x3a')](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x3a')]);_0x9548df[_0x84b6('0x3b')]=qs[_0x84b6('0x32')](_[_0x84b6('0x3c')](_0x2a9f50['query'],_0x4e4317[_0x84b6('0x32')]));if(_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x9548df[_0x84b6('0x3b')]=_['merge'](_0x9548df[_0x84b6('0x3b')],{'$or':_[_0x84b6('0x2f')](_0x9548df[_0x84b6('0x34')],function(_0x5b5743){var _0x12dc9b={};_0x12dc9b[_0x5b5743]={'$like':'%'+_0x2a9f50['query'][_0x84b6('0x3d')]+'%'};return _0x12dc9b;})});}_0x9548df=_[_0x84b6('0x3e')]({},_0x9548df,_0x2a9f50[_0x84b6('0x40')]);return _0x157b49[_0x84b6('0x4c')](_0x9548df);}})['then'](function(_0x2bc298){if(_0x2bc298){_0x186432=_0x2bc298[_0x84b6('0x36')];if(!_0x2a9f50['query'][_0x84b6('0x37')](_0x84b6('0x38'))){_0x9548df[_0x84b6('0x20')]=qs[_0x84b6('0x20')](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x20')]);_0x9548df[_0x84b6('0x1d')]=qs['offset'](_0x2a9f50[_0x84b6('0x30')][_0x84b6('0x1d')]);}return _0x157b49[_0x84b6('0x4c')](_0x9548df);}})[_0x84b6('0x26')](function(_0x21de28){if(_0x21de28){return _0x21de28?{'count':_0x186432,'rows':_0x21de28}:null;}})[_0x84b6('0x26')](respondWithResult(_0x3587f7,null))[_0x84b6('0x44')](handleError(_0x3587f7,null));};exports['getSubjects']=function(_0xb2510c,_0x1fab74,_0x5e5706){var _0x50c995={};var _0x17f318={};var _0x28644b;var _0x39bd6b;return db[_0x84b6('0x2b')][_0x84b6('0x4d')]({'where':{'id':_0xb2510c[_0x84b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fab74,null))[_0x84b6('0x26')](function(_0x4ce9c3){if(_0x4ce9c3){_0x28644b=_0x4ce9c3;_0x17f318[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db[_0x84b6('0x4e')][_0x84b6('0x47')]);_0x17f318[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0xb2510c['query']);_0x17f318[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x17f318[_0x84b6('0x2e')],_0x17f318['query']);_0x50c995['attributes']=_[_0x84b6('0x33')](_0x17f318[_0x84b6('0x2e')],qs['fields'](_0xb2510c[_0x84b6('0x30')][_0x84b6('0x35')]));_0x50c995[_0x84b6('0x34')]=_0x50c995['attributes']['length']?_0x50c995[_0x84b6('0x34')]:_0x17f318[_0x84b6('0x2e')];_0x50c995[_0x84b6('0x39')]=qs['sort'](_0xb2510c['query'][_0x84b6('0x3a')]);_0x50c995['where']=qs['filters'](_[_0x84b6('0x3c')](_0xb2510c['query'],_0x17f318[_0x84b6('0x32')]));if(_0xb2510c[_0x84b6('0x30')]['filter']){_0x50c995[_0x84b6('0x3b')]=_['merge'](_0x50c995['where'],{'$or':_[_0x84b6('0x2f')](_0x50c995[_0x84b6('0x34')],function(_0x186515){var _0x23bcc0={};_0x23bcc0[_0x186515]={'$like':'%'+_0xb2510c[_0x84b6('0x30')][_0x84b6('0x3d')]+'%'};return _0x23bcc0;})});}_0x50c995=_[_0x84b6('0x3e')]({},_0x50c995,_0xb2510c['options']);return _0x28644b[_0x84b6('0x4f')](_0x50c995);}})[_0x84b6('0x26')](function(_0x3e42d0){if(_0x3e42d0){_0x39bd6b=_0x3e42d0[_0x84b6('0x36')];if(!_0xb2510c['query'][_0x84b6('0x37')](_0x84b6('0x38'))){_0x50c995[_0x84b6('0x20')]=qs[_0x84b6('0x20')](_0xb2510c[_0x84b6('0x30')]['limit']);_0x50c995['offset']=qs[_0x84b6('0x1d')](_0xb2510c[_0x84b6('0x30')]['offset']);}return _0x28644b[_0x84b6('0x4f')](_0x50c995);}})[_0x84b6('0x26')](function(_0x57dd63){if(_0x57dd63){return _0x57dd63?{'count':_0x39bd6b,'rows':_0x57dd63}:null;}})[_0x84b6('0x26')](respondWithResult(_0x1fab74,null))[_0x84b6('0x44')](handleError(_0x1fab74,null));};exports[_0x84b6('0x50')]=function(_0x3a14d9,_0x563ecc,_0x4f94b0){var _0x250d2a={};var _0xcd0a88={};var _0x478f6d;var _0x1f95b0;return db['ZendeskConfiguration'][_0x84b6('0x4d')]({'where':{'id':_0x3a14d9[_0x84b6('0x46')]['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x563ecc,null))[_0x84b6('0x26')](function(_0x111a65){if(_0x111a65){_0x478f6d=_0x111a65;_0xcd0a88[_0x84b6('0x2e')]=_[_0x84b6('0x31')](db[_0x84b6('0x4e')][_0x84b6('0x47')]);_0xcd0a88[_0x84b6('0x30')]=_[_0x84b6('0x31')](_0x3a14d9['query']);_0xcd0a88[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0xcd0a88[_0x84b6('0x2e')],_0xcd0a88[_0x84b6('0x30')]);_0x250d2a[_0x84b6('0x34')]=_[_0x84b6('0x33')](_0xcd0a88[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x35')]));_0x250d2a[_0x84b6('0x34')]=_0x250d2a[_0x84b6('0x34')][_0x84b6('0x36')]?_0x250d2a[_0x84b6('0x34')]:_0xcd0a88[_0x84b6('0x2e')];_0x250d2a['order']=qs[_0x84b6('0x3a')](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x3a')]);_0x250d2a['where']=qs[_0x84b6('0x32')](_[_0x84b6('0x3c')](_0x3a14d9[_0x84b6('0x30')],_0xcd0a88['filters']));if(_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x250d2a[_0x84b6('0x3b')]=_['merge'](_0x250d2a[_0x84b6('0x3b')],{'$or':_[_0x84b6('0x2f')](_0x250d2a[_0x84b6('0x34')],function(_0x2a1c6a){var _0x3e20c4={};_0x3e20c4[_0x2a1c6a]={'$like':'%'+_0x3a14d9['query']['filter']+'%'};return _0x3e20c4;})});}_0x250d2a=_[_0x84b6('0x3e')]({},_0x250d2a,_0x3a14d9['options']);return _0x478f6d['getDescriptions'](_0x250d2a);}})[_0x84b6('0x26')](function(_0x4bf101){if(_0x4bf101){_0x1f95b0=_0x4bf101[_0x84b6('0x36')];if(!_0x3a14d9['query']['hasOwnProperty'](_0x84b6('0x38'))){_0x250d2a[_0x84b6('0x20')]=qs['limit'](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x20')]);_0x250d2a[_0x84b6('0x1d')]=qs[_0x84b6('0x1d')](_0x3a14d9[_0x84b6('0x30')][_0x84b6('0x1d')]);}return _0x478f6d[_0x84b6('0x50')](_0x250d2a);}})[_0x84b6('0x26')](function(_0x2cae15){if(_0x2cae15){return _0x2cae15?{'count':_0x1f95b0,'rows':_0x2cae15}:null;}})['then'](respondWithResult(_0x563ecc,null))[_0x84b6('0x44')](handleError(_0x563ecc,null));};exports[_0x84b6('0x51')]=function(_0xd171e3,_0xfcd7f9,_0xbfe426){var _0x24f874={};var _0x559e95={};var _0x13dd97;var _0x144cfb;return db[_0x84b6('0x2b')][_0x84b6('0x4d')]({'where':{'id':_0xd171e3[_0x84b6('0x46')]['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0xfcd7f9,null))[_0x84b6('0x26')](function(_0x1ae0b3){if(_0x1ae0b3){_0x13dd97=_0x1ae0b3;_0x559e95['model']=_[_0x84b6('0x31')](db['Tag'][_0x84b6('0x47')]);_0x559e95[_0x84b6('0x30')]=_['keys'](_0xd171e3[_0x84b6('0x30')]);_0x559e95[_0x84b6('0x32')]=_[_0x84b6('0x33')](_0x559e95[_0x84b6('0x2e')],_0x559e95[_0x84b6('0x30')]);_0x24f874[_0x84b6('0x34')]=_['intersection'](_0x559e95[_0x84b6('0x2e')],qs[_0x84b6('0x35')](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x35')]));_0x24f874[_0x84b6('0x34')]=_0x24f874[_0x84b6('0x34')][_0x84b6('0x36')]?_0x24f874[_0x84b6('0x34')]:_0x559e95[_0x84b6('0x2e')];_0x24f874[_0x84b6('0x39')]=qs[_0x84b6('0x3a')](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x3a')]);_0x24f874[_0x84b6('0x3b')]=qs['filters'](_['pick'](_0xd171e3[_0x84b6('0x30')],_0x559e95[_0x84b6('0x32')]));if(_0xd171e3[_0x84b6('0x30')][_0x84b6('0x3d')]){_0x24f874['where']=_['merge'](_0x24f874[_0x84b6('0x3b')],{'$or':_['map'](_0x24f874[_0x84b6('0x34')],function(_0x58f2cc){var _0xa07927={};_0xa07927[_0x58f2cc]={'$like':'%'+_0xd171e3[_0x84b6('0x30')]['filter']+'%'};return _0xa07927;})});}_0x24f874=_[_0x84b6('0x3e')]({},_0x24f874,_0xd171e3[_0x84b6('0x40')]);return _0x13dd97[_0x84b6('0x51')](_0x24f874);}})[_0x84b6('0x26')](function(_0xdbe6b7){if(_0xdbe6b7){_0x144cfb=_0xdbe6b7[_0x84b6('0x36')];if(!_0xd171e3[_0x84b6('0x30')]['hasOwnProperty']('nolimit')){_0x24f874[_0x84b6('0x20')]=qs['limit'](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x20')]);_0x24f874[_0x84b6('0x1d')]=qs['offset'](_0xd171e3[_0x84b6('0x30')][_0x84b6('0x1d')]);}return _0x13dd97['getTags'](_0x24f874);}})['then'](function(_0x2cc2e8){if(_0x2cc2e8){return _0x2cc2e8?{'count':_0x144cfb,'rows':_0x2cc2e8}:null;}})[_0x84b6('0x26')](respondWithResult(_0xfcd7f9,null))[_0x84b6('0x44')](handleError(_0xfcd7f9,null));};exports[_0x84b6('0x52')]=function(_0x1bf2b7,_0x657806,_0x376695){if(_0x1bf2b7['body']['id']){delete _0x1bf2b7[_0x84b6('0x4b')]['id'];}return db[_0x84b6('0x2b')]['findOne']({'where':{'id':_0x1bf2b7['params']['id']}})[_0x84b6('0x26')](handleEntityNotFound(_0x657806,null))[_0x84b6('0x26')](function(_0x59ee1a){if(_0x59ee1a){return _0x59ee1a['setTags'](_0x1bf2b7['body'][_0x84b6('0x53')]||[]);}return null;})[_0x84b6('0x26')](respondWithResult(_0x657806,null))[_0x84b6('0x44')](handleError(_0x657806,null));}; \ No newline at end of file +var _0xfaaf=['sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','ZendeskConfiguration','findAll','rows','show','params','options','find','catch','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x25a97a,_0x3c9f86){var _0x511716=function(_0x24dc29){while(--_0x24dc29){_0x25a97a['push'](_0x25a97a['shift']());}};_0x511716(++_0x3c9f86);}(_0xfaaf,0x11e));var _0xffaa=function(_0x274a03,_0xa661ae){_0x274a03=_0x274a03-0x0;var _0x53b6dc=_0xfaaf[_0x274a03];return _0x53b6dc;};'use strict';var emlformat=require(_0xffaa('0x0'));var rimraf=require(_0xffaa('0x1'));var zipdir=require(_0xffaa('0x2'));var jsonpatch=require(_0xffaa('0x3'));var rp=require(_0xffaa('0x4'));var moment=require(_0xffaa('0x5'));var BPromise=require(_0xffaa('0x6'));var Mustache=require(_0xffaa('0x7'));var util=require('util');var path=require(_0xffaa('0x8'));var sox=require(_0xffaa('0x9'));var csv=require('to-csv');var ejs=require(_0xffaa('0xa'));var fs=require('fs');var fs_extra=require(_0xffaa('0xb'));var _=require(_0xffaa('0xc'));var squel=require('squel');var crypto=require(_0xffaa('0xd'));var jsforce=require(_0xffaa('0xe'));var deskjs=require(_0xffaa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xffaa('0x10'));var Papa=require('papaparse');var Redis=require(_0xffaa('0x11'));var authService=require(_0xffaa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xffaa('0x13'));var hardwareService=require(_0xffaa('0x14'));var logger=require('../../config/logger')(_0xffaa('0x15'));var utils=require(_0xffaa('0x16'));var config=require(_0xffaa('0x17'));var licenseUtil=require(_0xffaa('0x18'));var db=require(_0xffaa('0x19'))['db'];function respondWithStatusCode(_0x1373b3,_0x305a24){_0x305a24=_0x305a24||0xcc;return function(_0x579635){if(_0x579635){return _0x1373b3['sendStatus'](_0x305a24);}return _0x1373b3[_0xffaa('0x1a')](_0x305a24)[_0xffaa('0x1b')]();};}function respondWithResult(_0x33bc00,_0x5cab1e){_0x5cab1e=_0x5cab1e||0xc8;return function(_0x20263b){if(_0x20263b){return _0x33bc00[_0xffaa('0x1a')](_0x5cab1e)[_0xffaa('0x1c')](_0x20263b);}};}function respondWithFilteredResult(_0x3f66b1,_0x5025d1){return function(_0x383df1){if(_0x383df1){var _0x7a031b=typeof _0x5025d1[_0xffaa('0x1d')]===_0xffaa('0x1e')&&typeof _0x5025d1['limit']==='undefined';var _0x2ab82f=_0x383df1[_0xffaa('0x1f')];var _0x37ce99=_0x7a031b?0x0:_0x5025d1[_0xffaa('0x1d')];var _0x104e6e=_0x7a031b?_0x383df1['count']:_0x5025d1[_0xffaa('0x1d')]+_0x5025d1[_0xffaa('0x20')];var _0x20eec1;if(_0x104e6e>=_0x2ab82f){_0x104e6e=_0x2ab82f;_0x20eec1=0xc8;}else{_0x20eec1=0xce;}_0x3f66b1[_0xffaa('0x1a')](_0x20eec1);return _0x3f66b1[_0xffaa('0x21')](_0xffaa('0x22'),_0x37ce99+'-'+_0x104e6e+'/'+_0x2ab82f)['json'](_0x383df1);}return null;};}function patchUpdates(_0x3e707d){return function(_0x8f42d5){try{jsonpatch['apply'](_0x8f42d5,_0x3e707d,!![]);}catch(_0x46115a){return BPromise[_0xffaa('0x23')](_0x46115a);}return _0x8f42d5[_0xffaa('0x24')]();};}function saveUpdates(_0x269858,_0x343d6e){return function(_0x4ac880){if(_0x4ac880){return _0x4ac880[_0xffaa('0x25')](_0x269858)[_0xffaa('0x26')](function(_0x38dbe6){return _0x38dbe6;});}return null;};}function removeEntity(_0x156a93,_0x5aedcc){return function(_0x3a0bf0){if(_0x3a0bf0){return _0x3a0bf0[_0xffaa('0x27')]()[_0xffaa('0x26')](function(){_0x156a93[_0xffaa('0x1a')](0xcc)[_0xffaa('0x1b')]();});}};}function handleEntityNotFound(_0x17ba1f,_0x285615){return function(_0x30417d){if(!_0x30417d){_0x17ba1f[_0xffaa('0x28')](0x194);}return _0x30417d;};}function handleError(_0x2d489c,_0x3bb68f){_0x3bb68f=_0x3bb68f||0x1f4;return function(_0x569e77){logger['error'](_0x569e77[_0xffaa('0x29')]);if(_0x569e77[_0xffaa('0x2a')]){delete _0x569e77[_0xffaa('0x2a')];}_0x2d489c[_0xffaa('0x1a')](_0x3bb68f)[_0xffaa('0x2b')](_0x569e77);};}exports['index']=function(_0x1908fb,_0x599eae){var _0xd3a823={},_0x2edb7={},_0x1afe32={'count':0x0,'rows':[]};var _0xbcea98=_[_0xffaa('0x2c')](db['ZendeskConfiguration'][_0xffaa('0x2d')],function(_0x1bed81){return{'name':_0x1bed81[_0xffaa('0x2e')],'type':_0x1bed81['type'][_0xffaa('0x2f')]};});_0x2edb7[_0xffaa('0x30')]=_[_0xffaa('0x2c')](_0xbcea98,'name');_0x2edb7[_0xffaa('0x31')]=_[_0xffaa('0x32')](_0x1908fb[_0xffaa('0x31')]);_0x2edb7['filters']=_[_0xffaa('0x33')](_0x2edb7[_0xffaa('0x30')],_0x2edb7[_0xffaa('0x31')]);_0xd3a823[_0xffaa('0x34')]=_[_0xffaa('0x33')](_0x2edb7[_0xffaa('0x30')],qs[_0xffaa('0x35')](_0x1908fb['query'][_0xffaa('0x35')]));_0xd3a823[_0xffaa('0x34')]=_0xd3a823['attributes'][_0xffaa('0x36')]?_0xd3a823[_0xffaa('0x34')]:_0x2edb7[_0xffaa('0x30')];if(!_0x1908fb['query'][_0xffaa('0x37')](_0xffaa('0x38'))){_0xd3a823[_0xffaa('0x20')]=qs[_0xffaa('0x20')](_0x1908fb[_0xffaa('0x31')][_0xffaa('0x20')]);_0xd3a823[_0xffaa('0x1d')]=qs['offset'](_0x1908fb[_0xffaa('0x31')][_0xffaa('0x1d')]);}_0xd3a823[_0xffaa('0x39')]=qs[_0xffaa('0x3a')](_0x1908fb[_0xffaa('0x31')][_0xffaa('0x3a')]);_0xd3a823[_0xffaa('0x3b')]=qs[_0xffaa('0x3c')](_[_0xffaa('0x3d')](_0x1908fb[_0xffaa('0x31')],_0x2edb7[_0xffaa('0x3c')]),_0xbcea98);if(_0x1908fb[_0xffaa('0x31')][_0xffaa('0x3e')]){_0xd3a823[_0xffaa('0x3b')]=_[_0xffaa('0x3f')](_0xd3a823[_0xffaa('0x3b')],{'$or':_[_0xffaa('0x2c')](_0xbcea98,function(_0x1598c1){if(_0x1598c1[_0xffaa('0x40')]!==_0xffaa('0x41')){var _0x2494ac={};_0x2494ac[_0x1598c1['name']]={'$like':'%'+_0x1908fb[_0xffaa('0x31')][_0xffaa('0x3e')]+'%'};return _0x2494ac;}})});}_0xd3a823=_['merge']({},_0xd3a823,_0x1908fb['options']);var _0xac3c58={'where':_0xd3a823['where']};return db['ZendeskConfiguration'][_0xffaa('0x1f')](_0xac3c58)['then'](function(_0x1427cc){_0x1afe32['count']=_0x1427cc;if(_0x1908fb[_0xffaa('0x31')][_0xffaa('0x42')]){_0xd3a823[_0xffaa('0x43')]=[{'all':!![]}];}return db[_0xffaa('0x44')][_0xffaa('0x45')](_0xd3a823);})[_0xffaa('0x26')](function(_0x1dbed4){_0x1afe32[_0xffaa('0x46')]=_0x1dbed4;return _0x1afe32;})[_0xffaa('0x26')](respondWithFilteredResult(_0x599eae,_0xd3a823))['catch'](handleError(_0x599eae,null));};exports[_0xffaa('0x47')]=function(_0x298820,_0x312bfb){var _0x353ef3={'raw':![],'where':{'id':_0x298820[_0xffaa('0x48')]['id']}},_0x270e4a={};_0x270e4a[_0xffaa('0x30')]=_[_0xffaa('0x32')](db[_0xffaa('0x44')][_0xffaa('0x2d')]);_0x270e4a[_0xffaa('0x31')]=_['keys'](_0x298820[_0xffaa('0x31')]);_0x270e4a[_0xffaa('0x3c')]=_['intersection'](_0x270e4a[_0xffaa('0x30')],_0x270e4a[_0xffaa('0x31')]);_0x353ef3[_0xffaa('0x34')]=_[_0xffaa('0x33')](_0x270e4a[_0xffaa('0x30')],qs['fields'](_0x298820['query'][_0xffaa('0x35')]));_0x353ef3['attributes']=_0x353ef3['attributes']['length']?_0x353ef3[_0xffaa('0x34')]:_0x270e4a[_0xffaa('0x30')];if(_0x298820['query'][_0xffaa('0x42')]){_0x353ef3[_0xffaa('0x43')]=[{'all':!![]}];}_0x353ef3=_[_0xffaa('0x3f')]({},_0x353ef3,_0x298820[_0xffaa('0x49')]);return db['ZendeskConfiguration'][_0xffaa('0x4a')](_0x353ef3)[_0xffaa('0x26')](handleEntityNotFound(_0x312bfb,null))[_0xffaa('0x26')](respondWithResult(_0x312bfb,null))[_0xffaa('0x4b')](handleError(_0x312bfb,null));};exports[_0xffaa('0x4c')]=function(_0x3da398,_0x3aceb3){return db[_0xffaa('0x44')]['create'](_0x3da398[_0xffaa('0x4d')],{})[_0xffaa('0x26')](respondWithResult(_0x3aceb3,0xc9))[_0xffaa('0x4b')](handleError(_0x3aceb3,null));};exports[_0xffaa('0x25')]=function(_0x4e64b6,_0x150377){if(_0x4e64b6['body']['id']){delete _0x4e64b6[_0xffaa('0x4d')]['id'];}return db[_0xffaa('0x44')][_0xffaa('0x4a')]({'where':{'id':_0x4e64b6[_0xffaa('0x48')]['id']}})[_0xffaa('0x26')](handleEntityNotFound(_0x150377,null))['then'](saveUpdates(_0x4e64b6['body'],null))['then'](respondWithResult(_0x150377,null))['catch'](handleError(_0x150377,null));};exports[_0xffaa('0x27')]=function(_0x100522,_0x29c4d4){return db['ZendeskConfiguration'][_0xffaa('0x4a')]({'where':{'id':_0x100522[_0xffaa('0x48')]['id']}})[_0xffaa('0x26')](handleEntityNotFound(_0x29c4d4,null))[_0xffaa('0x26')](removeEntity(_0x29c4d4,null))[_0xffaa('0x4b')](handleError(_0x29c4d4,null));};exports[_0xffaa('0x4e')]=function(_0x5f0026,_0x53dd91,_0x2d398e){var _0x6832b6={};var _0x332a32={};var _0x40a257;var _0x530850;return db['ZendeskConfiguration'][_0xffaa('0x4f')]({'where':{'id':_0x5f0026['params']['id']}})[_0xffaa('0x26')](handleEntityNotFound(_0x53dd91,null))[_0xffaa('0x26')](function(_0x186e9b){if(_0x186e9b){_0x40a257=_0x186e9b;_0x332a32[_0xffaa('0x30')]=_[_0xffaa('0x32')](db[_0xffaa('0x50')][_0xffaa('0x2d')]);_0x332a32[_0xffaa('0x31')]=_[_0xffaa('0x32')](_0x5f0026[_0xffaa('0x31')]);_0x332a32['filters']=_['intersection'](_0x332a32[_0xffaa('0x30')],_0x332a32['query']);_0x6832b6[_0xffaa('0x34')]=_[_0xffaa('0x33')](_0x332a32['model'],qs[_0xffaa('0x35')](_0x5f0026[_0xffaa('0x31')][_0xffaa('0x35')]));_0x6832b6['attributes']=_0x6832b6[_0xffaa('0x34')][_0xffaa('0x36')]?_0x6832b6[_0xffaa('0x34')]:_0x332a32[_0xffaa('0x30')];_0x6832b6[_0xffaa('0x39')]=qs[_0xffaa('0x3a')](_0x5f0026[_0xffaa('0x31')][_0xffaa('0x3a')]);_0x6832b6[_0xffaa('0x3b')]=qs[_0xffaa('0x3c')](_[_0xffaa('0x3d')](_0x5f0026[_0xffaa('0x31')],_0x332a32[_0xffaa('0x3c')]));if(_0x5f0026['query'][_0xffaa('0x3e')]){_0x6832b6['where']=_[_0xffaa('0x3f')](_0x6832b6[_0xffaa('0x3b')],{'$or':_[_0xffaa('0x2c')](_0x6832b6[_0xffaa('0x34')],function(_0x174f51){var _0x509489={};_0x509489[_0x174f51]={'$like':'%'+_0x5f0026['query'][_0xffaa('0x3e')]+'%'};return _0x509489;})});}_0x6832b6=_[_0xffaa('0x3f')]({},_0x6832b6,_0x5f0026['options']);return _0x40a257[_0xffaa('0x4e')](_0x6832b6);}})[_0xffaa('0x26')](function(_0x568d69){if(_0x568d69){_0x530850=_0x568d69[_0xffaa('0x36')];if(!_0x5f0026['query'][_0xffaa('0x37')](_0xffaa('0x38'))){_0x6832b6[_0xffaa('0x20')]=qs[_0xffaa('0x20')](_0x5f0026[_0xffaa('0x31')][_0xffaa('0x20')]);_0x6832b6[_0xffaa('0x1d')]=qs['offset'](_0x5f0026[_0xffaa('0x31')][_0xffaa('0x1d')]);}return _0x40a257['getFields'](_0x6832b6);}})[_0xffaa('0x26')](function(_0x5d515b){if(_0x5d515b){return _0x5d515b?{'count':_0x530850,'rows':_0x5d515b}:null;}})[_0xffaa('0x26')](respondWithResult(_0x53dd91,null))[_0xffaa('0x4b')](handleError(_0x53dd91,null));};exports[_0xffaa('0x51')]=function(_0x1fc583,_0x5676f5,_0x1c3125){var _0x17734f={};var _0x2d74ee={};var _0x558ee4;var _0x153e2f;return db['ZendeskConfiguration'][_0xffaa('0x4f')]({'where':{'id':_0x1fc583['params']['id']}})['then'](handleEntityNotFound(_0x5676f5,null))[_0xffaa('0x26')](function(_0x1d09b5){if(_0x1d09b5){_0x558ee4=_0x1d09b5;_0x2d74ee[_0xffaa('0x30')]=_[_0xffaa('0x32')](db[_0xffaa('0x50')]['rawAttributes']);_0x2d74ee[_0xffaa('0x31')]=_[_0xffaa('0x32')](_0x1fc583[_0xffaa('0x31')]);_0x2d74ee[_0xffaa('0x3c')]=_[_0xffaa('0x33')](_0x2d74ee[_0xffaa('0x30')],_0x2d74ee[_0xffaa('0x31')]);_0x17734f[_0xffaa('0x34')]=_['intersection'](_0x2d74ee[_0xffaa('0x30')],qs[_0xffaa('0x35')](_0x1fc583[_0xffaa('0x31')][_0xffaa('0x35')]));_0x17734f['attributes']=_0x17734f['attributes'][_0xffaa('0x36')]?_0x17734f['attributes']:_0x2d74ee[_0xffaa('0x30')];_0x17734f[_0xffaa('0x39')]=qs[_0xffaa('0x3a')](_0x1fc583[_0xffaa('0x31')][_0xffaa('0x3a')]);_0x17734f[_0xffaa('0x3b')]=qs['filters'](_[_0xffaa('0x3d')](_0x1fc583[_0xffaa('0x31')],_0x2d74ee['filters']));if(_0x1fc583[_0xffaa('0x31')][_0xffaa('0x3e')]){_0x17734f[_0xffaa('0x3b')]=_[_0xffaa('0x3f')](_0x17734f['where'],{'$or':_[_0xffaa('0x2c')](_0x17734f['attributes'],function(_0x2796c6){var _0x82a38e={};_0x82a38e[_0x2796c6]={'$like':'%'+_0x1fc583[_0xffaa('0x31')]['filter']+'%'};return _0x82a38e;})});}_0x17734f=_[_0xffaa('0x3f')]({},_0x17734f,_0x1fc583[_0xffaa('0x49')]);return _0x558ee4[_0xffaa('0x51')](_0x17734f);}})[_0xffaa('0x26')](function(_0x4efed2){if(_0x4efed2){_0x153e2f=_0x4efed2['length'];if(!_0x1fc583['query']['hasOwnProperty']('nolimit')){_0x17734f['limit']=qs['limit'](_0x1fc583[_0xffaa('0x31')][_0xffaa('0x20')]);_0x17734f[_0xffaa('0x1d')]=qs[_0xffaa('0x1d')](_0x1fc583[_0xffaa('0x31')][_0xffaa('0x1d')]);}return _0x558ee4['getSubjects'](_0x17734f);}})[_0xffaa('0x26')](function(_0x5a7b0a){if(_0x5a7b0a){return _0x5a7b0a?{'count':_0x153e2f,'rows':_0x5a7b0a}:null;}})[_0xffaa('0x26')](respondWithResult(_0x5676f5,null))['catch'](handleError(_0x5676f5,null));};exports['getDescriptions']=function(_0x5e8059,_0x535295,_0x34af9b){var _0x5f1eac={};var _0x7dcc82={};var _0x5e9b7d;var _0x2e1d5b;return db[_0xffaa('0x44')][_0xffaa('0x4f')]({'where':{'id':_0x5e8059[_0xffaa('0x48')]['id']}})['then'](handleEntityNotFound(_0x535295,null))['then'](function(_0x382df0){if(_0x382df0){_0x5e9b7d=_0x382df0;_0x7dcc82[_0xffaa('0x30')]=_[_0xffaa('0x32')](db['ZendeskField']['rawAttributes']);_0x7dcc82[_0xffaa('0x31')]=_[_0xffaa('0x32')](_0x5e8059['query']);_0x7dcc82[_0xffaa('0x3c')]=_[_0xffaa('0x33')](_0x7dcc82[_0xffaa('0x30')],_0x7dcc82['query']);_0x5f1eac[_0xffaa('0x34')]=_[_0xffaa('0x33')](_0x7dcc82['model'],qs['fields'](_0x5e8059['query'][_0xffaa('0x35')]));_0x5f1eac['attributes']=_0x5f1eac['attributes'][_0xffaa('0x36')]?_0x5f1eac[_0xffaa('0x34')]:_0x7dcc82['model'];_0x5f1eac[_0xffaa('0x39')]=qs[_0xffaa('0x3a')](_0x5e8059[_0xffaa('0x31')][_0xffaa('0x3a')]);_0x5f1eac[_0xffaa('0x3b')]=qs[_0xffaa('0x3c')](_[_0xffaa('0x3d')](_0x5e8059[_0xffaa('0x31')],_0x7dcc82[_0xffaa('0x3c')]));if(_0x5e8059[_0xffaa('0x31')]['filter']){_0x5f1eac['where']=_['merge'](_0x5f1eac['where'],{'$or':_[_0xffaa('0x2c')](_0x5f1eac[_0xffaa('0x34')],function(_0x4e6da8){var _0x519d8a={};_0x519d8a[_0x4e6da8]={'$like':'%'+_0x5e8059[_0xffaa('0x31')][_0xffaa('0x3e')]+'%'};return _0x519d8a;})});}_0x5f1eac=_[_0xffaa('0x3f')]({},_0x5f1eac,_0x5e8059[_0xffaa('0x49')]);return _0x5e9b7d['getDescriptions'](_0x5f1eac);}})['then'](function(_0x4ba787){if(_0x4ba787){_0x2e1d5b=_0x4ba787[_0xffaa('0x36')];if(!_0x5e8059['query'][_0xffaa('0x37')](_0xffaa('0x38'))){_0x5f1eac[_0xffaa('0x20')]=qs['limit'](_0x5e8059[_0xffaa('0x31')]['limit']);_0x5f1eac[_0xffaa('0x1d')]=qs[_0xffaa('0x1d')](_0x5e8059[_0xffaa('0x31')][_0xffaa('0x1d')]);}return _0x5e9b7d[_0xffaa('0x52')](_0x5f1eac);}})[_0xffaa('0x26')](function(_0x18f6e2){if(_0x18f6e2){return _0x18f6e2?{'count':_0x2e1d5b,'rows':_0x18f6e2}:null;}})[_0xffaa('0x26')](respondWithResult(_0x535295,null))['catch'](handleError(_0x535295,null));};exports['getTags']=function(_0x6f6e8a,_0x434237,_0x375fc8){var _0x2260ed={};var _0x2193be={};var _0x522d40;var _0xf6e3d9;return db[_0xffaa('0x44')][_0xffaa('0x4f')]({'where':{'id':_0x6f6e8a[_0xffaa('0x48')]['id']}})[_0xffaa('0x26')](handleEntityNotFound(_0x434237,null))[_0xffaa('0x26')](function(_0x3e1977){if(_0x3e1977){_0x522d40=_0x3e1977;_0x2193be['model']=_[_0xffaa('0x32')](db['Tag']['rawAttributes']);_0x2193be[_0xffaa('0x31')]=_[_0xffaa('0x32')](_0x6f6e8a[_0xffaa('0x31')]);_0x2193be['filters']=_['intersection'](_0x2193be['model'],_0x2193be[_0xffaa('0x31')]);_0x2260ed[_0xffaa('0x34')]=_['intersection'](_0x2193be[_0xffaa('0x30')],qs[_0xffaa('0x35')](_0x6f6e8a[_0xffaa('0x31')][_0xffaa('0x35')]));_0x2260ed['attributes']=_0x2260ed['attributes'][_0xffaa('0x36')]?_0x2260ed['attributes']:_0x2193be[_0xffaa('0x30')];_0x2260ed[_0xffaa('0x39')]=qs[_0xffaa('0x3a')](_0x6f6e8a[_0xffaa('0x31')]['sort']);_0x2260ed['where']=qs[_0xffaa('0x3c')](_[_0xffaa('0x3d')](_0x6f6e8a[_0xffaa('0x31')],_0x2193be['filters']));if(_0x6f6e8a[_0xffaa('0x31')][_0xffaa('0x3e')]){_0x2260ed[_0xffaa('0x3b')]=_['merge'](_0x2260ed['where'],{'$or':_[_0xffaa('0x2c')](_0x2260ed['attributes'],function(_0x41bd32){var _0x20e03b={};_0x20e03b[_0x41bd32]={'$like':'%'+_0x6f6e8a[_0xffaa('0x31')][_0xffaa('0x3e')]+'%'};return _0x20e03b;})});}_0x2260ed=_['merge']({},_0x2260ed,_0x6f6e8a['options']);return _0x522d40[_0xffaa('0x53')](_0x2260ed);}})[_0xffaa('0x26')](function(_0x1e2f17){if(_0x1e2f17){_0xf6e3d9=_0x1e2f17[_0xffaa('0x36')];if(!_0x6f6e8a[_0xffaa('0x31')]['hasOwnProperty']('nolimit')){_0x2260ed[_0xffaa('0x20')]=qs['limit'](_0x6f6e8a[_0xffaa('0x31')][_0xffaa('0x20')]);_0x2260ed['offset']=qs[_0xffaa('0x1d')](_0x6f6e8a['query'][_0xffaa('0x1d')]);}return _0x522d40[_0xffaa('0x53')](_0x2260ed);}})[_0xffaa('0x26')](function(_0x2762b8){if(_0x2762b8){return _0x2762b8?{'count':_0xf6e3d9,'rows':_0x2762b8}:null;}})['then'](respondWithResult(_0x434237,null))['catch'](handleError(_0x434237,null));};exports['setTags']=function(_0x4b1115,_0x27cb2c,_0x4ba1c1){if(_0x4b1115[_0xffaa('0x4d')]['id']){delete _0x4b1115[_0xffaa('0x4d')]['id'];}return db[_0xffaa('0x44')][_0xffaa('0x4f')]({'where':{'id':_0x4b1115['params']['id']}})[_0xffaa('0x26')](handleEntityNotFound(_0x27cb2c,null))['then'](function(_0x354baa){if(_0x354baa){return _0x354baa[_0xffaa('0x54')](_0x4b1115[_0xffaa('0x4d')][_0xffaa('0x55')]||[]);}return null;})[_0xffaa('0x26')](respondWithResult(_0x27cb2c,null))[_0xffaa('0x4b')](handleError(_0x27cb2c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index cf9ac0c..c93e038 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 _0xb9be=['path','rimraf','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8207e,_0x374d8c){var _0x2bc725=function(_0x4f75a8){while(--_0x4f75a8){_0x8207e['push'](_0x8207e['shift']());}};_0x2bc725(++_0x374d8c);}(_0xb9be,0xc5));var _0xeb9b=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xb9be[_0x354164];return _0x5db9a8;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var logger=require(_0xeb9b('0x2'))(_0xeb9b('0x3'));var moment=require(_0xeb9b('0x4'));var BPromise=require(_0xeb9b('0x5'));var rp=require(_0xeb9b('0x6'));var fs=require('fs');var path=require(_0xeb9b('0x7'));var rimraf=require(_0xeb9b('0x8'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0xeb9b('0x9')]=function(_0x181810,_0x2529cb){return _0x181810['define'](_0xeb9b('0xa'),attributes,{'tableName':_0xeb9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7708=['../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','rimraf'];(function(_0x460e68,_0x38d31e){var _0x3cae7b=function(_0x500e86){while(--_0x500e86){_0x460e68['push'](_0x460e68['shift']());}};_0x3cae7b(++_0x38d31e);}(_0x7708,0x188));var _0x8770=function(_0x47f719,_0x2e559d){_0x47f719=_0x47f719-0x0;var _0x407f4e=_0x7708[_0x47f719];return _0x407f4e;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'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 af35aa4..fcf74f8 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 _0xd360=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','stringify','error','message','catch','lodash','util'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0xd360,0x1b3));var _0x0d36=function(_0x16217b,_0x2c4ce2){_0x16217b=_0x16217b-0x0;var _0x23bf38=_0xd360[_0x16217b];return _0x23bf38;};'use strict';var _=require(_0x0d36('0x0'));var util=require(_0x0d36('0x1'));var moment=require('moment');var BPromise=require(_0x0d36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d36('0x3'));var db=require(_0x0d36('0x4'))['db'];var utils=require(_0x0d36('0x5'));var logger=require(_0x0d36('0x6'))('rpc');var config=require(_0x0d36('0x7'));var jayson=require(_0x0d36('0x8'));var client=jayson[_0x0d36('0x9')][_0x0d36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52cb2,_0x8cf880,_0xe448b0){return new BPromise(function(_0x14c96f,_0x23fccf){return client[_0x0d36('0xb')](_0x52cb2,_0xe448b0)['then'](function(_0x1d8ccb){logger[_0x0d36('0xc')](_0x0d36('0xd'),_0x8cf880,'request\x20sent');logger[_0x0d36('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8cf880,'request\x20sent',JSON[_0x0d36('0xf')](_0x1d8ccb));if(_0x1d8ccb['error']){if(_0x1d8ccb[_0x0d36('0x10')]['code']===0x1f4){logger['error'](_0x0d36('0xd'),_0x8cf880,_0x1d8ccb[_0x0d36('0x10')]['message']);return _0x23fccf(_0x1d8ccb[_0x0d36('0x10')][_0x0d36('0x11')]);}logger['error'](_0x0d36('0xd'),_0x8cf880,_0x1d8ccb[_0x0d36('0x10')][_0x0d36('0x11')]);return _0x14c96f(_0x1d8ccb[_0x0d36('0x10')][_0x0d36('0x11')]);}else{logger[_0x0d36('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8cf880,'request\x20sent');_0x14c96f(_0x1d8ccb['result'][_0x0d36('0x11')]);}})[_0x0d36('0x12')](function(_0x2490a7){logger['error'](_0x0d36('0xd'),_0x8cf880,_0x2490a7);_0x23fccf(_0x2490a7);});});} \ No newline at end of file +var _0x4637=['../../config/environment','jayson/promise','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2e4cf9,_0x515fd9){var _0x39f63a=function(_0x33ef49){while(--_0x33ef49){_0x2e4cf9['push'](_0x2e4cf9['shift']());}};_0x39f63a(++_0x515fd9);}(_0x4637,0x86));var _0x7463=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x4637[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x7463('0x0'));var moment=require('moment');var BPromise=require(_0x7463('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7463('0x2'));var db=require(_0x7463('0x3'))['db'];var utils=require(_0x7463('0x4'));var logger=require('../../config/logger')(_0x7463('0x5'));var config=require(_0x7463('0x6'));var jayson=require(_0x7463('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16521f,_0xf5958,_0x51f0e8){return new BPromise(function(_0x2fe970,_0x15a82d){return client[_0x7463('0x8')](_0x16521f,_0x51f0e8)[_0x7463('0x9')](function(_0x500272){logger[_0x7463('0xa')](_0x7463('0xb'),_0xf5958,_0x7463('0xc'));logger[_0x7463('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xf5958,'request\x20sent',JSON[_0x7463('0xe')](_0x500272));if(_0x500272[_0x7463('0xf')]){if(_0x500272['error'][_0x7463('0x10')]===0x1f4){logger[_0x7463('0xf')](_0x7463('0xb'),_0xf5958,_0x500272[_0x7463('0xf')]['message']);return _0x15a82d(_0x500272['error'][_0x7463('0x11')]);}logger[_0x7463('0xf')](_0x7463('0xb'),_0xf5958,_0x500272[_0x7463('0xf')][_0x7463('0x11')]);return _0x2fe970(_0x500272[_0x7463('0xf')][_0x7463('0x11')]);}else{logger[_0x7463('0xa')](_0x7463('0xb'),_0xf5958,'request\x20sent');_0x2fe970(_0x500272[_0x7463('0x12')][_0x7463('0x11')]);}})[_0x7463('0x13')](function(_0x52e751){logger[_0x7463('0xf')](_0x7463('0xb'),_0xf5958,_0x52e751);_0x15a82d(_0x52e751);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a230799..9a9afd9 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 _0x2db5=['isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2db5,0x15f));var _0x52db=function(_0xe480f0,_0x4c0dc1){_0xe480f0=_0xe480f0-0x0;var _0x57b198=_0x2db5[_0xe480f0];return _0x57b198;};'use strict';var multer=require(_0x52db('0x0'));var util=require(_0x52db('0x1'));var path=require(_0x52db('0x2'));var timeout=require(_0x52db('0x3'));var express=require('express');var router=express[_0x52db('0x4')]();var fs_extra=require(_0x52db('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x52db('0x6'));var config=require(_0x52db('0x7'));var controller=require(_0x52db('0x8'));router[_0x52db('0x9')]('/',auth[_0x52db('0xa')](),controller[_0x52db('0xb')]);router[_0x52db('0x9')]('/:id',auth[_0x52db('0xa')](),controller[_0x52db('0xc')]);router['post']('/',auth[_0x52db('0xa')](),controller[_0x52db('0xd')]);router['put'](_0x52db('0xe'),auth[_0x52db('0xa')](),controller[_0x52db('0xf')]);router[_0x52db('0x10')](_0x52db('0xe'),auth['isAuthenticated'](),controller[_0x52db('0x11')]);module[_0x52db('0x12')]=router; \ No newline at end of file +var _0xce48=['fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','exports','multer','util','path','connect-timeout'];(function(_0x29d18e,_0xc9c313){var _0x1da276=function(_0x1785e6){while(--_0x1785e6){_0x29d18e['push'](_0x29d18e['shift']());}};_0x1da276(++_0xc9c313);}(_0xce48,0xd9));var _0x8ce4=function(_0x13fdfc,_0xb197c7){_0x13fdfc=_0x13fdfc-0x0;var _0x377fbb=_0xce48[_0x13fdfc];return _0x377fbb;};'use strict';var multer=require(_0x8ce4('0x0'));var util=require(_0x8ce4('0x1'));var path=require(_0x8ce4('0x2'));var timeout=require(_0x8ce4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ce4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8ce4('0x5'));var config=require(_0x8ce4('0x6'));var controller=require(_0x8ce4('0x7'));router[_0x8ce4('0x8')]('/',auth[_0x8ce4('0x9')](),controller[_0x8ce4('0xa')]);router[_0x8ce4('0x8')](_0x8ce4('0xb'),auth[_0x8ce4('0x9')](),controller[_0x8ce4('0xc')]);router[_0x8ce4('0xd')]('/',auth[_0x8ce4('0x9')](),controller['create']);router[_0x8ce4('0xe')](_0x8ce4('0xb'),auth[_0x8ce4('0x9')](),controller[_0x8ce4('0xf')]);router['delete']('/:id',auth[_0x8ce4('0x9')](),controller['destroy']);module[_0x8ce4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 88c73bc..888ea8d 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 _0x475a=['string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x475a,0xfa));var _0xa475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x475a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa475('0x0'));module[_0xa475('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa475('0x2'),_0xa475('0x3'),_0xa475('0x4'),'keyValue',_0xa475('0x5')),'defaultValue':_0xa475('0x2')},'content':{'type':Sequelize[_0xa475('0x6')]},'key':{'type':Sequelize[_0xa475('0x6')]},'keyType':{'type':Sequelize[_0xa475('0x7')](_0xa475('0x2'),_0xa475('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa475('0x6')]},'idField':{'type':Sequelize[_0xa475('0x6')]},'nameField':{'type':Sequelize[_0xa475('0x6')]},'customField':{'type':Sequelize[_0xa475('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa475('0x6')]}}; \ No newline at end of file +var _0xe4e5=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x4b3b62,_0x58c286){var _0x42120d=function(_0x2901ff){while(--_0x2901ff){_0x4b3b62['push'](_0x4b3b62['shift']());}};_0x42120d(++_0x58c286);}(_0xe4e5,0x1ab));var _0x5e4e=function(_0x44a5a3,_0x44e933){_0x44a5a3=_0x44a5a3-0x0;var _0x524520=_0xe4e5[_0x44a5a3];return _0x524520;};'use strict';var Sequelize=require(_0x5e4e('0x0'));module[_0x5e4e('0x1')]={'type':{'type':Sequelize[_0x5e4e('0x2')](_0x5e4e('0x3'),_0x5e4e('0x4'),'customVariable',_0x5e4e('0x5'),_0x5e4e('0x6')),'defaultValue':_0x5e4e('0x3')},'content':{'type':Sequelize[_0x5e4e('0x7')]},'key':{'type':Sequelize[_0x5e4e('0x7')]},'keyType':{'type':Sequelize[_0x5e4e('0x2')](_0x5e4e('0x3'),_0x5e4e('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5e4e('0x7')]},'idField':{'type':Sequelize[_0x5e4e('0x7')]},'nameField':{'type':Sequelize[_0x5e4e('0x7')]},'customField':{'type':Sequelize[_0x5e4e('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e4e('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 813eddf..17b9dde 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 _0xc5f5=['apply','reject','update','then','destroy','stack','name','ZendeskField','rawAttributes','fieldName','type','key','map','keys','filters','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','show','include','options','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range'];(function(_0x30e37f,_0x47866c){var _0x73585b=function(_0x35f4e9){while(--_0x35f4e9){_0x30e37f['push'](_0x30e37f['shift']());}};_0x73585b(++_0x47866c);}(_0xc5f5,0x1ca));var _0x5c5f=function(_0x2ceb47,_0x5c6f60){_0x2ceb47=_0x2ceb47-0x0;var _0x4a77b0=_0xc5f5[_0x2ceb47];return _0x4a77b0;};'use strict';var emlformat=require(_0x5c5f('0x0'));var rimraf=require(_0x5c5f('0x1'));var zipdir=require(_0x5c5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c5f('0x3'));var moment=require(_0x5c5f('0x4'));var BPromise=require(_0x5c5f('0x5'));var Mustache=require(_0x5c5f('0x6'));var util=require('util');var path=require(_0x5c5f('0x7'));var sox=require(_0x5c5f('0x8'));var csv=require(_0x5c5f('0x9'));var ejs=require(_0x5c5f('0xa'));var fs=require('fs');var fs_extra=require(_0x5c5f('0xb'));var _=require(_0x5c5f('0xc'));var squel=require(_0x5c5f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5c5f('0xe'));var Papa=require(_0x5c5f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c5f('0x10'));var as=require(_0x5c5f('0x11'));var hardwareService=require(_0x5c5f('0x12'));var logger=require(_0x5c5f('0x13'))(_0x5c5f('0x14'));var utils=require(_0x5c5f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c5f('0x16'))['db'];function respondWithStatusCode(_0x5efc36,_0x268199){_0x268199=_0x268199||0xcc;return function(_0x525f97){if(_0x525f97){return _0x5efc36[_0x5c5f('0x17')](_0x268199);}return _0x5efc36[_0x5c5f('0x18')](_0x268199)[_0x5c5f('0x19')]();};}function respondWithResult(_0x4ad927,_0x289700){_0x289700=_0x289700||0xc8;return function(_0x38cf7f){if(_0x38cf7f){return _0x4ad927[_0x5c5f('0x18')](_0x289700)['json'](_0x38cf7f);}};}function respondWithFilteredResult(_0x120717,_0x1deb60){return function(_0x5bba74){if(_0x5bba74){var _0x930701=typeof _0x1deb60[_0x5c5f('0x1a')]===_0x5c5f('0x1b')&&typeof _0x1deb60['limit']===_0x5c5f('0x1b');var _0x25bf16=_0x5bba74['count'];var _0x208b81=_0x930701?0x0:_0x1deb60[_0x5c5f('0x1a')];var _0x47dde7=_0x930701?_0x5bba74[_0x5c5f('0x1c')]:_0x1deb60['offset']+_0x1deb60[_0x5c5f('0x1d')];var _0x30688a;if(_0x47dde7>=_0x25bf16){_0x47dde7=_0x25bf16;_0x30688a=0xc8;}else{_0x30688a=0xce;}_0x120717[_0x5c5f('0x18')](_0x30688a);return _0x120717[_0x5c5f('0x1e')](_0x5c5f('0x1f'),_0x208b81+'-'+_0x47dde7+'/'+_0x25bf16)['json'](_0x5bba74);}return null;};}function patchUpdates(_0x5a491b){return function(_0x2b515b){try{jsonpatch[_0x5c5f('0x20')](_0x2b515b,_0x5a491b,!![]);}catch(_0x340158){return BPromise[_0x5c5f('0x21')](_0x340158);}return _0x2b515b['save']();};}function saveUpdates(_0x1188c9,_0xe71dda){return function(_0xedfe75){if(_0xedfe75){return _0xedfe75[_0x5c5f('0x22')](_0x1188c9)[_0x5c5f('0x23')](function(_0x353447){return _0x353447;});}return null;};}function removeEntity(_0x148168,_0x4a161c){return function(_0x5e8601){if(_0x5e8601){return _0x5e8601[_0x5c5f('0x24')]()[_0x5c5f('0x23')](function(){_0x148168[_0x5c5f('0x18')](0xcc)[_0x5c5f('0x19')]();});}};}function handleEntityNotFound(_0x4284a0,_0x539747){return function(_0x44aa93){if(!_0x44aa93){_0x4284a0[_0x5c5f('0x17')](0x194);}return _0x44aa93;};}function handleError(_0x2355a8,_0x38f7c2){_0x38f7c2=_0x38f7c2||0x1f4;return function(_0x189cd9){logger['error'](_0x189cd9[_0x5c5f('0x25')]);if(_0x189cd9[_0x5c5f('0x26')]){delete _0x189cd9['name'];}_0x2355a8[_0x5c5f('0x18')](_0x38f7c2)['send'](_0x189cd9);};}exports['index']=function(_0x5acf7a,_0x3a9a0c){var _0x5deae8={},_0x8afa0c={},_0x4fd7dc={'count':0x0,'rows':[]};var _0x15dcca=_['map'](db[_0x5c5f('0x27')][_0x5c5f('0x28')],function(_0x54b6d8){return{'name':_0x54b6d8[_0x5c5f('0x29')],'type':_0x54b6d8[_0x5c5f('0x2a')][_0x5c5f('0x2b')]};});_0x8afa0c['model']=_[_0x5c5f('0x2c')](_0x15dcca,_0x5c5f('0x26'));_0x8afa0c['query']=_[_0x5c5f('0x2d')](_0x5acf7a['query']);_0x8afa0c[_0x5c5f('0x2e')]=_['intersection'](_0x8afa0c[_0x5c5f('0x2f')],_0x8afa0c[_0x5c5f('0x30')]);_0x5deae8[_0x5c5f('0x31')]=_[_0x5c5f('0x32')](_0x8afa0c[_0x5c5f('0x2f')],qs[_0x5c5f('0x33')](_0x5acf7a['query'][_0x5c5f('0x33')]));_0x5deae8[_0x5c5f('0x31')]=_0x5deae8['attributes'][_0x5c5f('0x34')]?_0x5deae8[_0x5c5f('0x31')]:_0x8afa0c[_0x5c5f('0x2f')];if(!_0x5acf7a[_0x5c5f('0x30')]['hasOwnProperty'](_0x5c5f('0x35'))){_0x5deae8[_0x5c5f('0x1d')]=qs[_0x5c5f('0x1d')](_0x5acf7a['query'][_0x5c5f('0x1d')]);_0x5deae8[_0x5c5f('0x1a')]=qs[_0x5c5f('0x1a')](_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x1a')]);}_0x5deae8[_0x5c5f('0x36')]=qs[_0x5c5f('0x37')](_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x37')]);_0x5deae8[_0x5c5f('0x38')]=qs[_0x5c5f('0x2e')](_['pick'](_0x5acf7a[_0x5c5f('0x30')],_0x8afa0c['filters']),_0x15dcca);if(_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x39')]){_0x5deae8[_0x5c5f('0x38')]=_[_0x5c5f('0x3a')](_0x5deae8[_0x5c5f('0x38')],{'$or':_[_0x5c5f('0x2c')](_0x15dcca,function(_0x151e81){if(_0x151e81['type']!==_0x5c5f('0x3b')){var _0xd5137={};_0xd5137[_0x151e81['name']]={'$like':'%'+_0x5acf7a[_0x5c5f('0x30')][_0x5c5f('0x39')]+'%'};return _0xd5137;}})});}_0x5deae8=_[_0x5c5f('0x3a')]({},_0x5deae8,_0x5acf7a['options']);var _0x385ee3={'where':_0x5deae8['where']};return db[_0x5c5f('0x27')][_0x5c5f('0x1c')](_0x385ee3)['then'](function(_0x4a5bb2){_0x4fd7dc[_0x5c5f('0x1c')]=_0x4a5bb2;if(_0x5acf7a['query'][_0x5c5f('0x3c')]){_0x5deae8['include']=[{'all':!![]}];}return db[_0x5c5f('0x27')]['findAll'](_0x5deae8);})[_0x5c5f('0x23')](function(_0x46e84b){_0x4fd7dc[_0x5c5f('0x3d')]=_0x46e84b;return _0x4fd7dc;})[_0x5c5f('0x23')](respondWithFilteredResult(_0x3a9a0c,_0x5deae8))[_0x5c5f('0x3e')](handleError(_0x3a9a0c,null));};exports[_0x5c5f('0x3f')]=function(_0x1a8b4a,_0x47b005){var _0x2d4303={'raw':!![],'where':{'id':_0x1a8b4a['params']['id']}},_0x543a16={};_0x543a16[_0x5c5f('0x2f')]=_['keys'](db[_0x5c5f('0x27')][_0x5c5f('0x28')]);_0x543a16['query']=_['keys'](_0x1a8b4a[_0x5c5f('0x30')]);_0x543a16[_0x5c5f('0x2e')]=_[_0x5c5f('0x32')](_0x543a16['model'],_0x543a16[_0x5c5f('0x30')]);_0x2d4303['attributes']=_[_0x5c5f('0x32')](_0x543a16[_0x5c5f('0x2f')],qs[_0x5c5f('0x33')](_0x1a8b4a[_0x5c5f('0x30')][_0x5c5f('0x33')]));_0x2d4303[_0x5c5f('0x31')]=_0x2d4303[_0x5c5f('0x31')][_0x5c5f('0x34')]?_0x2d4303[_0x5c5f('0x31')]:_0x543a16[_0x5c5f('0x2f')];if(_0x1a8b4a['query']['includeAll']){_0x2d4303[_0x5c5f('0x40')]=[{'all':!![]}];}_0x2d4303=_[_0x5c5f('0x3a')]({},_0x2d4303,_0x1a8b4a[_0x5c5f('0x41')]);return db[_0x5c5f('0x27')]['find'](_0x2d4303)[_0x5c5f('0x23')](handleEntityNotFound(_0x47b005,null))[_0x5c5f('0x23')](respondWithResult(_0x47b005,null))['catch'](handleError(_0x47b005,null));};exports[_0x5c5f('0x42')]=function(_0x412d28,_0x54f900){return db['ZendeskField']['create'](_0x412d28[_0x5c5f('0x43')],{})['then'](respondWithResult(_0x54f900,0xc9))[_0x5c5f('0x3e')](handleError(_0x54f900,null));};exports[_0x5c5f('0x22')]=function(_0x16a282,_0x43a940){if(_0x16a282[_0x5c5f('0x43')]['id']){delete _0x16a282['body']['id'];}return db[_0x5c5f('0x27')][_0x5c5f('0x44')]({'where':{'id':_0x16a282[_0x5c5f('0x45')]['id']}})[_0x5c5f('0x23')](handleEntityNotFound(_0x43a940,null))[_0x5c5f('0x23')](saveUpdates(_0x16a282[_0x5c5f('0x43')],null))[_0x5c5f('0x23')](respondWithResult(_0x43a940,null))[_0x5c5f('0x3e')](handleError(_0x43a940,null));};exports[_0x5c5f('0x24')]=function(_0x45fcc7,_0x155fed){return db[_0x5c5f('0x27')][_0x5c5f('0x44')]({'where':{'id':_0x45fcc7['params']['id']}})[_0x5c5f('0x23')](handleEntityNotFound(_0x155fed,null))[_0x5c5f('0x23')](removeEntity(_0x155fed,null))[_0x5c5f('0x3e')](handleError(_0x155fed,null));}; \ No newline at end of file +var _0xc3a6=['../../config/environment','../../config/license/util','end','status','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','ZendeskField','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','count','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0xc3a6,0x116));var _0x6c3a=function(_0x46bc62,_0x44ea1d){_0x46bc62=_0x46bc62-0x0;var _0x31105b=_0xc3a6[_0x46bc62];return _0x31105b;};'use strict';var emlformat=require(_0x6c3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c3a('0x1'));var jsonpatch=require(_0x6c3a('0x2'));var rp=require(_0x6c3a('0x3'));var moment=require(_0x6c3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c3a('0x5'));var util=require(_0x6c3a('0x6'));var path=require(_0x6c3a('0x7'));var sox=require(_0x6c3a('0x8'));var csv=require(_0x6c3a('0x9'));var ejs=require(_0x6c3a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c3a('0xb'));var squel=require(_0x6c3a('0xc'));var crypto=require(_0x6c3a('0xd'));var jsforce=require(_0x6c3a('0xe'));var deskjs=require(_0x6c3a('0xf'));var toCsv=require(_0x6c3a('0x9'));var querystring=require(_0x6c3a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6c3a('0x11'));var as=require(_0x6c3a('0x12'));var hardwareService=require(_0x6c3a('0x13'));var logger=require('../../config/logger')(_0x6c3a('0x14'));var utils=require(_0x6c3a('0x15'));var config=require(_0x6c3a('0x16'));var licenseUtil=require(_0x6c3a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x130a74,_0x43b703){_0x43b703=_0x43b703||0xcc;return function(_0x28634b){if(_0x28634b){return _0x130a74['sendStatus'](_0x43b703);}return _0x130a74['status'](_0x43b703)[_0x6c3a('0x18')]();};}function respondWithResult(_0x3a3749,_0x570ff1){_0x570ff1=_0x570ff1||0xc8;return function(_0x4815f3){if(_0x4815f3){return _0x3a3749[_0x6c3a('0x19')](_0x570ff1)['json'](_0x4815f3);}};}function respondWithFilteredResult(_0x288be4,_0x3456c6){return function(_0x2cd4b6){if(_0x2cd4b6){var _0x3fc8e5=typeof _0x3456c6[_0x6c3a('0x1a')]===_0x6c3a('0x1b')&&typeof _0x3456c6[_0x6c3a('0x1c')]===_0x6c3a('0x1b');var _0x32d4bd=_0x2cd4b6['count'];var _0x580603=_0x3fc8e5?0x0:_0x3456c6[_0x6c3a('0x1a')];var _0x2318f5=_0x3fc8e5?_0x2cd4b6['count']:_0x3456c6['offset']+_0x3456c6[_0x6c3a('0x1c')];var _0x360867;if(_0x2318f5>=_0x32d4bd){_0x2318f5=_0x32d4bd;_0x360867=0xc8;}else{_0x360867=0xce;}_0x288be4[_0x6c3a('0x19')](_0x360867);return _0x288be4[_0x6c3a('0x1d')](_0x6c3a('0x1e'),_0x580603+'-'+_0x2318f5+'/'+_0x32d4bd)['json'](_0x2cd4b6);}return null;};}function patchUpdates(_0x19c366){return function(_0x575837){try{jsonpatch['apply'](_0x575837,_0x19c366,!![]);}catch(_0x132ab6){return BPromise[_0x6c3a('0x1f')](_0x132ab6);}return _0x575837[_0x6c3a('0x20')]();};}function saveUpdates(_0x7b38b3,_0xdd9de2){return function(_0x35f7cc){if(_0x35f7cc){return _0x35f7cc['update'](_0x7b38b3)[_0x6c3a('0x21')](function(_0x184d3c){return _0x184d3c;});}return null;};}function removeEntity(_0xca298e,_0x1b3606){return function(_0xb0aa9e){if(_0xb0aa9e){return _0xb0aa9e[_0x6c3a('0x22')]()[_0x6c3a('0x21')](function(){_0xca298e[_0x6c3a('0x19')](0xcc)[_0x6c3a('0x18')]();});}};}function handleEntityNotFound(_0x1182ae,_0x340fd7){return function(_0x8731f5){if(!_0x8731f5){_0x1182ae[_0x6c3a('0x23')](0x194);}return _0x8731f5;};}function handleError(_0x4e11b9,_0x1c65d5){_0x1c65d5=_0x1c65d5||0x1f4;return function(_0x2ea905){logger[_0x6c3a('0x24')](_0x2ea905[_0x6c3a('0x25')]);if(_0x2ea905[_0x6c3a('0x26')]){delete _0x2ea905[_0x6c3a('0x26')];}_0x4e11b9[_0x6c3a('0x19')](_0x1c65d5)[_0x6c3a('0x27')](_0x2ea905);};}exports[_0x6c3a('0x28')]=function(_0x3a8f08,_0x43be1b){var _0x1bee38={},_0x4f7cb0={},_0x1c41d7={'count':0x0,'rows':[]};var _0x31ebe5=_['map'](db[_0x6c3a('0x29')]['rawAttributes'],function(_0x48b85c){return{'name':_0x48b85c[_0x6c3a('0x2a')],'type':_0x48b85c[_0x6c3a('0x2b')][_0x6c3a('0x2c')]};});_0x4f7cb0[_0x6c3a('0x2d')]=_['map'](_0x31ebe5,_0x6c3a('0x26'));_0x4f7cb0[_0x6c3a('0x2e')]=_['keys'](_0x3a8f08['query']);_0x4f7cb0[_0x6c3a('0x2f')]=_[_0x6c3a('0x30')](_0x4f7cb0[_0x6c3a('0x2d')],_0x4f7cb0[_0x6c3a('0x2e')]);_0x1bee38[_0x6c3a('0x31')]=_['intersection'](_0x4f7cb0[_0x6c3a('0x2d')],qs[_0x6c3a('0x32')](_0x3a8f08['query']['fields']));_0x1bee38[_0x6c3a('0x31')]=_0x1bee38[_0x6c3a('0x31')]['length']?_0x1bee38['attributes']:_0x4f7cb0[_0x6c3a('0x2d')];if(!_0x3a8f08[_0x6c3a('0x2e')][_0x6c3a('0x33')](_0x6c3a('0x34'))){_0x1bee38['limit']=qs[_0x6c3a('0x1c')](_0x3a8f08['query'][_0x6c3a('0x1c')]);_0x1bee38[_0x6c3a('0x1a')]=qs[_0x6c3a('0x1a')](_0x3a8f08[_0x6c3a('0x2e')][_0x6c3a('0x1a')]);}_0x1bee38[_0x6c3a('0x35')]=qs[_0x6c3a('0x36')](_0x3a8f08['query'][_0x6c3a('0x36')]);_0x1bee38['where']=qs[_0x6c3a('0x2f')](_[_0x6c3a('0x37')](_0x3a8f08[_0x6c3a('0x2e')],_0x4f7cb0[_0x6c3a('0x2f')]),_0x31ebe5);if(_0x3a8f08[_0x6c3a('0x2e')][_0x6c3a('0x38')]){_0x1bee38[_0x6c3a('0x39')]=_[_0x6c3a('0x3a')](_0x1bee38[_0x6c3a('0x39')],{'$or':_[_0x6c3a('0x3b')](_0x31ebe5,function(_0x49dacf){if(_0x49dacf['type']!==_0x6c3a('0x3c')){var _0x137e56={};_0x137e56[_0x49dacf[_0x6c3a('0x26')]]={'$like':'%'+_0x3a8f08[_0x6c3a('0x2e')]['filter']+'%'};return _0x137e56;}})});}_0x1bee38=_[_0x6c3a('0x3a')]({},_0x1bee38,_0x3a8f08[_0x6c3a('0x3d')]);var _0x143599={'where':_0x1bee38[_0x6c3a('0x39')]};return db[_0x6c3a('0x29')][_0x6c3a('0x3e')](_0x143599)[_0x6c3a('0x21')](function(_0xdba024){_0x1c41d7[_0x6c3a('0x3e')]=_0xdba024;if(_0x3a8f08['query']['includeAll']){_0x1bee38[_0x6c3a('0x3f')]=[{'all':!![]}];}return db[_0x6c3a('0x29')][_0x6c3a('0x40')](_0x1bee38);})[_0x6c3a('0x21')](function(_0x3f3db8){_0x1c41d7['rows']=_0x3f3db8;return _0x1c41d7;})['then'](respondWithFilteredResult(_0x43be1b,_0x1bee38))[_0x6c3a('0x41')](handleError(_0x43be1b,null));};exports[_0x6c3a('0x42')]=function(_0xd98bf7,_0x4b7c8f){var _0x3b5440={'raw':!![],'where':{'id':_0xd98bf7[_0x6c3a('0x43')]['id']}},_0xa6c1e5={};_0xa6c1e5[_0x6c3a('0x2d')]=_[_0x6c3a('0x44')](db[_0x6c3a('0x29')]['rawAttributes']);_0xa6c1e5[_0x6c3a('0x2e')]=_[_0x6c3a('0x44')](_0xd98bf7[_0x6c3a('0x2e')]);_0xa6c1e5[_0x6c3a('0x2f')]=_['intersection'](_0xa6c1e5['model'],_0xa6c1e5['query']);_0x3b5440['attributes']=_[_0x6c3a('0x30')](_0xa6c1e5[_0x6c3a('0x2d')],qs['fields'](_0xd98bf7[_0x6c3a('0x2e')][_0x6c3a('0x32')]));_0x3b5440[_0x6c3a('0x31')]=_0x3b5440[_0x6c3a('0x31')][_0x6c3a('0x45')]?_0x3b5440[_0x6c3a('0x31')]:_0xa6c1e5[_0x6c3a('0x2d')];if(_0xd98bf7[_0x6c3a('0x2e')][_0x6c3a('0x46')]){_0x3b5440[_0x6c3a('0x3f')]=[{'all':!![]}];}_0x3b5440=_[_0x6c3a('0x3a')]({},_0x3b5440,_0xd98bf7[_0x6c3a('0x3d')]);return db[_0x6c3a('0x29')][_0x6c3a('0x47')](_0x3b5440)['then'](handleEntityNotFound(_0x4b7c8f,null))['then'](respondWithResult(_0x4b7c8f,null))[_0x6c3a('0x41')](handleError(_0x4b7c8f,null));};exports[_0x6c3a('0x48')]=function(_0x52de4e,_0x2e4d54){return db['ZendeskField'][_0x6c3a('0x48')](_0x52de4e[_0x6c3a('0x49')],{})[_0x6c3a('0x21')](respondWithResult(_0x2e4d54,0xc9))[_0x6c3a('0x41')](handleError(_0x2e4d54,null));};exports[_0x6c3a('0x4a')]=function(_0x53df51,_0x20c648){if(_0x53df51[_0x6c3a('0x49')]['id']){delete _0x53df51['body']['id'];}return db[_0x6c3a('0x29')][_0x6c3a('0x47')]({'where':{'id':_0x53df51[_0x6c3a('0x43')]['id']}})[_0x6c3a('0x21')](handleEntityNotFound(_0x20c648,null))['then'](saveUpdates(_0x53df51[_0x6c3a('0x49')],null))[_0x6c3a('0x21')](respondWithResult(_0x20c648,null))[_0x6c3a('0x41')](handleError(_0x20c648,null));};exports[_0x6c3a('0x22')]=function(_0x37c389,_0x209a75){return db['ZendeskField'][_0x6c3a('0x47')]({'where':{'id':_0x37c389[_0x6c3a('0x43')]['id']}})[_0x6c3a('0x21')](handleEntityNotFound(_0x209a75,null))['then'](removeEntity(_0x209a75,null))['catch'](handleError(_0x209a75,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 57867f4..397beb3 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 _0x6143=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6143,0xf7));var _0x3614=function(_0x83b8cf,_0x468d17){_0x83b8cf=_0x83b8cf-0x0;var _0x3d10bd=_0x6143[_0x83b8cf];return _0x3d10bd;};'use strict';var _=require('lodash');var util=require(_0x3614('0x0'));var logger=require(_0x3614('0x1'))(_0x3614('0x2'));var moment=require(_0x3614('0x3'));var BPromise=require(_0x3614('0x4'));var rp=require(_0x3614('0x5'));var fs=require('fs');var path=require(_0x3614('0x6'));var rimraf=require(_0x3614('0x7'));var config=require(_0x3614('0x8'));var attributes=require(_0x3614('0x9'));module[_0x3614('0xa')]=function(_0x5e4789,_0x381942){return _0x5e4789[_0x3614('0xb')](_0x3614('0xc'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x3614('0xd'),'fields':['idField',_0x3614('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87c7=['exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes'];(function(_0x2b4da3,_0x4f2129){var _0x19469e=function(_0x5b3d0c){while(--_0x5b3d0c){_0x2b4da3['push'](_0x2b4da3['shift']());}};_0x19469e(++_0x4f2129);}(_0x87c7,0x8d));var _0x787c=function(_0x23bc35,_0x334cc2){_0x23bc35=_0x23bc35-0x0;var _0x27d80d=_0x87c7[_0x23bc35];return _0x27d80d;};'use strict';var _=require('lodash');var util=require(_0x787c('0x0'));var logger=require(_0x787c('0x1'))(_0x787c('0x2'));var moment=require(_0x787c('0x3'));var BPromise=require(_0x787c('0x4'));var rp=require(_0x787c('0x5'));var fs=require('fs');var path=require(_0x787c('0x6'));var rimraf=require('rimraf');var config=require(_0x787c('0x7'));var attributes=require(_0x787c('0x8'));module[_0x787c('0x9')]=function(_0x28786e,_0x50285d){return _0x28786e[_0x787c('0xa')](_0x787c('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x787c('0xc'),'fields':[_0x787c('0xd'),_0x787c('0xe')],'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 d91df3b..9bb2dae 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 _0x12ce=['stringify','error','code','message','result','catch','lodash','moment','randomstring','../../config/logger','rpc','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3f8d9d,_0x21361b){var _0x198e8e=function(_0x4e115b){while(--_0x4e115b){_0x3f8d9d['push'](_0x3f8d9d['shift']());}};_0x198e8e(++_0x21361b);}(_0x12ce,0x11e));var _0xe12c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x12ce[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xe12c('0x0'));var util=require('util');var moment=require(_0xe12c('0x1'));var BPromise=require('bluebird');var rs=require(_0xe12c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe12c('0x3'))(_0xe12c('0x4'));var config=require('../../config/environment');var jayson=require(_0xe12c('0x5'));var client=jayson['client'][_0xe12c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4181a4,_0x9ad3ae,_0x2e8f7c){return new BPromise(function(_0x14087d,_0x1a3fda){return client[_0xe12c('0x7')](_0x4181a4,_0x2e8f7c)[_0xe12c('0x8')](function(_0x3b81cf){logger[_0xe12c('0x9')](_0xe12c('0xa'),_0x9ad3ae,_0xe12c('0xb'));logger[_0xe12c('0xc')](_0xe12c('0xd'),_0x9ad3ae,_0xe12c('0xb'),JSON[_0xe12c('0xe')](_0x3b81cf));if(_0x3b81cf[_0xe12c('0xf')]){if(_0x3b81cf[_0xe12c('0xf')][_0xe12c('0x10')]===0x1f4){logger[_0xe12c('0xf')](_0xe12c('0xa'),_0x9ad3ae,_0x3b81cf['error'][_0xe12c('0x11')]);return _0x1a3fda(_0x3b81cf[_0xe12c('0xf')][_0xe12c('0x11')]);}logger[_0xe12c('0xf')](_0xe12c('0xa'),_0x9ad3ae,_0x3b81cf[_0xe12c('0xf')]['message']);return _0x14087d(_0x3b81cf[_0xe12c('0xf')][_0xe12c('0x11')]);}else{logger[_0xe12c('0x9')]('ZendeskField,\x20%s,\x20%s',_0x9ad3ae,_0xe12c('0xb'));_0x14087d(_0x3b81cf[_0xe12c('0x12')][_0xe12c('0x11')]);}})[_0xe12c('0x13')](function(_0x553201){logger['error']('ZendeskField,\x20%s,\x20%s',_0x9ad3ae,_0x553201);_0x1a3fda(_0x553201);});});} \ No newline at end of file +var _0x6e31=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x6e31,0x132));var _0x16e3=function(_0x20343a,_0x40738f){_0x20343a=_0x20343a-0x0;var _0x43157c=_0x6e31[_0x20343a];return _0x43157c;};'use strict';var _=require(_0x16e3('0x0'));var util=require(_0x16e3('0x1'));var moment=require(_0x16e3('0x2'));var BPromise=require(_0x16e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16e3('0x4'));var db=require(_0x16e3('0x5'))['db'];var utils=require(_0x16e3('0x6'));var logger=require('../../config/logger')(_0x16e3('0x7'));var config=require(_0x16e3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x16e3('0x9')][_0x16e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x589d21,_0x56fe58,_0x37a2f4){return new BPromise(function(_0x1f371b,_0x20126b){return client['request'](_0x589d21,_0x37a2f4)[_0x16e3('0xb')](function(_0x24b926){logger[_0x16e3('0xc')](_0x16e3('0xd'),_0x56fe58,_0x16e3('0xe'));logger[_0x16e3('0xf')](_0x16e3('0x10'),_0x56fe58,_0x16e3('0xe'),JSON['stringify'](_0x24b926));if(_0x24b926[_0x16e3('0x11')]){if(_0x24b926[_0x16e3('0x11')][_0x16e3('0x12')]===0x1f4){logger[_0x16e3('0x11')](_0x16e3('0xd'),_0x56fe58,_0x24b926['error'][_0x16e3('0x13')]);return _0x20126b(_0x24b926[_0x16e3('0x11')][_0x16e3('0x13')]);}logger[_0x16e3('0x11')](_0x16e3('0xd'),_0x56fe58,_0x24b926[_0x16e3('0x11')][_0x16e3('0x13')]);return _0x1f371b(_0x24b926[_0x16e3('0x11')][_0x16e3('0x13')]);}else{logger[_0x16e3('0xc')](_0x16e3('0xd'),_0x56fe58,_0x16e3('0xe'));_0x1f371b(_0x24b926[_0x16e3('0x14')]['message']);}})[_0x16e3('0x15')](function(_0x3f80d8){logger[_0x16e3('0x11')](_0x16e3('0xd'),_0x56fe58,_0x3f80d8);_0x20126b(_0x3f80d8);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index d9061c6..20eb61a 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 _0x8d57=['put','delete','exports','multer','path','express','Router','fs-extra','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','addConfiguration'];(function(_0x2f023d,_0x29dfe5){var _0x4ef240=function(_0x49f1ec){while(--_0x49f1ec){_0x2f023d['push'](_0x2f023d['shift']());}};_0x4ef240(++_0x29dfe5);}(_0x8d57,0x1a1));var _0x78d5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d57[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x78d5('0x0'));var util=require('util');var path=require(_0x78d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x78d5('0x2'));var router=express[_0x78d5('0x3')]();var fs_extra=require(_0x78d5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x78d5('0x5'));router[_0x78d5('0x6')]('/',auth[_0x78d5('0x7')](),controller[_0x78d5('0x8')]);router['get'](_0x78d5('0x9'),auth[_0x78d5('0x7')](),controller[_0x78d5('0xa')]);router[_0x78d5('0x6')](_0x78d5('0xb'),auth[_0x78d5('0x7')](),controller['getConfigurations']);router[_0x78d5('0x6')]('/:id/fields',auth[_0x78d5('0x7')](),controller[_0x78d5('0xc')]);router[_0x78d5('0xd')]('/',auth[_0x78d5('0x7')](),controller['create']);router[_0x78d5('0xd')](_0x78d5('0xb'),auth[_0x78d5('0x7')](),controller[_0x78d5('0xe')]);router[_0x78d5('0xf')](_0x78d5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x78d5('0x10')](_0x78d5('0x9'),auth[_0x78d5('0x7')](),controller['destroy']);module[_0x78d5('0x11')]=router; \ No newline at end of file +var _0x02ad=['addConfiguration','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x2325db,_0x46a850){var _0x4c8dc9=function(_0x5864e4){while(--_0x5864e4){_0x2325db['push'](_0x2325db['shift']());}};_0x4c8dc9(++_0x46a850);}(_0x02ad,0xdf));var _0xd02a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x02ad[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require('multer');var util=require(_0xd02a('0x0'));var path=require(_0xd02a('0x1'));var timeout=require(_0xd02a('0x2'));var express=require(_0xd02a('0x3'));var router=express[_0xd02a('0x4')]();var fs_extra=require(_0xd02a('0x5'));var auth=require(_0xd02a('0x6'));var interaction=require(_0xd02a('0x7'));var config=require(_0xd02a('0x8'));var controller=require(_0xd02a('0x9'));router[_0xd02a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd02a('0xa')](_0xd02a('0xb'),auth[_0xd02a('0xc')](),controller['show']);router[_0xd02a('0xa')](_0xd02a('0xd'),auth[_0xd02a('0xc')](),controller[_0xd02a('0xe')]);router['get'](_0xd02a('0xf'),auth[_0xd02a('0xc')](),controller['getFields']);router[_0xd02a('0x10')]('/',auth[_0xd02a('0xc')](),controller['create']);router[_0xd02a('0x10')](_0xd02a('0xd'),auth['isAuthenticated'](),controller[_0xd02a('0x11')]);router['put'](_0xd02a('0xb'),auth[_0xd02a('0xc')](),controller['update']);router[_0xd02a('0x12')]('/:id',auth[_0xd02a('0xc')](),controller[_0xd02a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 2038b3d..2602be5 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 _0xbec5=['STRING','sequelize','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbec5,0xe5));var _0x5bec=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0xbec5[_0x27d8bc];return _0x4b04cb;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}}; \ No newline at end of file +var _0x9a19=['sequelize','exports','STRING'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x9a19,0x114));var _0x99a1=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x9a19[_0x11deef];return _0xe9ba85;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x99a1('0x2')]},'zone':{'type':Sequelize[_0x99a1('0x2')]},'clientId':{'type':Sequelize[_0x99a1('0x2')]},'clientSecret':{'type':Sequelize[_0x99a1('0x2')]},'serverUrl':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x99a1('0x2')]},'refreshToken':{'type':Sequelize[_0x99a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f543f13..7f1e5e0 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 _0xb184=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','create','body','find','findOne','ZohoConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','com','slice','substring','lastIndexOf','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','send','index','map','ZohoAccount','rawAttributes','type','key','model','name','query','keys','filters','intersection'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0xb184,0x14e));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4b18('0x0'));var rimraf=require(_0x4b18('0x1'));var zipdir=require(_0x4b18('0x2'));var jsonpatch=require(_0x4b18('0x3'));var rp=require(_0x4b18('0x4'));var moment=require('moment');var BPromise=require(_0x4b18('0x5'));var Mustache=require(_0x4b18('0x6'));var util=require(_0x4b18('0x7'));var path=require(_0x4b18('0x8'));var sox=require(_0x4b18('0x9'));var csv=require(_0x4b18('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b18('0xb'));var squel=require(_0x4b18('0xc'));var crypto=require(_0x4b18('0xd'));var jsforce=require(_0x4b18('0xe'));var deskjs=require(_0x4b18('0xf'));var toCsv=require(_0x4b18('0xa'));var querystring=require(_0x4b18('0x10'));var Papa=require(_0x4b18('0x11'));var Redis=require(_0x4b18('0x12'));var authService=require(_0x4b18('0x13'));var qs=require(_0x4b18('0x14'));var as=require(_0x4b18('0x15'));var hardwareService=require(_0x4b18('0x16'));var logger=require(_0x4b18('0x17'))(_0x4b18('0x18'));var utils=require(_0x4b18('0x19'));var config=require(_0x4b18('0x1a'));var licenseUtil=require(_0x4b18('0x1b'));var db=require(_0x4b18('0x1c'))['db'];var integrations=require(_0x4b18('0x1d'));function respondWithStatusCode(_0x1cbd8f,_0x1dae47){_0x1dae47=_0x1dae47||0xcc;return function(_0x57e08a){if(_0x57e08a){return _0x1cbd8f[_0x4b18('0x1e')](_0x1dae47);}return _0x1cbd8f['status'](_0x1dae47)[_0x4b18('0x1f')]();};}function respondWithResult(_0x207ec5,_0x30bd75){_0x30bd75=_0x30bd75||0xc8;return function(_0x73fa5f){if(_0x73fa5f){return _0x207ec5[_0x4b18('0x20')](_0x30bd75)[_0x4b18('0x21')](_0x73fa5f);}};}function respondWithFilteredResult(_0x4f9dba,_0x16a2b5){return function(_0x3432e0){if(_0x3432e0){var _0x2cee09=typeof _0x16a2b5['offset']===_0x4b18('0x22')&&typeof _0x16a2b5[_0x4b18('0x23')]===_0x4b18('0x22');var _0xca9808=_0x3432e0[_0x4b18('0x24')];var _0x4d7dfd=_0x2cee09?0x0:_0x16a2b5[_0x4b18('0x25')];var _0x3b536e=_0x2cee09?_0x3432e0[_0x4b18('0x24')]:_0x16a2b5[_0x4b18('0x25')]+_0x16a2b5[_0x4b18('0x23')];var _0x3e231f;if(_0x3b536e>=_0xca9808){_0x3b536e=_0xca9808;_0x3e231f=0xc8;}else{_0x3e231f=0xce;}_0x4f9dba['status'](_0x3e231f);return _0x4f9dba[_0x4b18('0x26')](_0x4b18('0x27'),_0x4d7dfd+'-'+_0x3b536e+'/'+_0xca9808)[_0x4b18('0x21')](_0x3432e0);}return null;};}function patchUpdates(_0x476990){return function(_0x317115){try{jsonpatch[_0x4b18('0x28')](_0x317115,_0x476990,!![]);}catch(_0x413a1a){return BPromise['reject'](_0x413a1a);}return _0x317115['save']();};}function saveUpdates(_0x3d1d23,_0x65bf49){return function(_0x4c3f43){if(_0x4c3f43){return _0x4c3f43[_0x4b18('0x29')](_0x3d1d23)[_0x4b18('0x2a')](function(_0x1efee1){return _0x1efee1;});}return null;};}function removeEntity(_0x1b14d2,_0x1f33fd){return function(_0x5cccf0){if(_0x5cccf0){return _0x5cccf0[_0x4b18('0x2b')]()[_0x4b18('0x2a')](function(){_0x1b14d2[_0x4b18('0x20')](0xcc)[_0x4b18('0x1f')]();});}};}function handleEntityNotFound(_0x23e99d,_0x101349){return function(_0x564632){if(!_0x564632){_0x23e99d[_0x4b18('0x1e')](0x194);}return _0x564632;};}function handleError(_0x5b5c25,_0x4ef64a){_0x4ef64a=_0x4ef64a||0x1f4;return function(_0x446d05){logger[_0x4b18('0x2c')](_0x446d05[_0x4b18('0x2d')]);if(_0x446d05['name']){delete _0x446d05['name'];}_0x5b5c25['status'](_0x4ef64a)[_0x4b18('0x2e')](_0x446d05);};}exports[_0x4b18('0x2f')]=function(_0x26d53e,_0x3b0cda){var _0x2ff6e5={},_0x52aec2={},_0x5a2cec={'count':0x0,'rows':[]};var _0x23c366=_[_0x4b18('0x30')](db[_0x4b18('0x31')][_0x4b18('0x32')],function(_0x8d865){return{'name':_0x8d865['fieldName'],'type':_0x8d865[_0x4b18('0x33')][_0x4b18('0x34')]};});_0x52aec2[_0x4b18('0x35')]=_[_0x4b18('0x30')](_0x23c366,_0x4b18('0x36'));_0x52aec2[_0x4b18('0x37')]=_[_0x4b18('0x38')](_0x26d53e[_0x4b18('0x37')]);_0x52aec2[_0x4b18('0x39')]=_[_0x4b18('0x3a')](_0x52aec2['model'],_0x52aec2[_0x4b18('0x37')]);_0x2ff6e5[_0x4b18('0x3b')]=_['intersection'](_0x52aec2[_0x4b18('0x35')],qs[_0x4b18('0x3c')](_0x26d53e[_0x4b18('0x37')]['fields']));_0x2ff6e5[_0x4b18('0x3b')]=_0x2ff6e5[_0x4b18('0x3b')][_0x4b18('0x3d')]?_0x2ff6e5[_0x4b18('0x3b')]:_0x52aec2[_0x4b18('0x35')];if(!_0x26d53e['query'][_0x4b18('0x3e')]('nolimit')){_0x2ff6e5[_0x4b18('0x23')]=qs[_0x4b18('0x23')](_0x26d53e['query']['limit']);_0x2ff6e5['offset']=qs[_0x4b18('0x25')](_0x26d53e[_0x4b18('0x37')][_0x4b18('0x25')]);}_0x2ff6e5[_0x4b18('0x3f')]=qs[_0x4b18('0x40')](_0x26d53e[_0x4b18('0x37')][_0x4b18('0x40')]);_0x2ff6e5[_0x4b18('0x41')]=qs[_0x4b18('0x39')](_[_0x4b18('0x42')](_0x26d53e[_0x4b18('0x37')],_0x52aec2[_0x4b18('0x39')]),_0x23c366);if(_0x26d53e[_0x4b18('0x37')][_0x4b18('0x43')]){_0x2ff6e5['where']=_[_0x4b18('0x44')](_0x2ff6e5[_0x4b18('0x41')],{'$or':_[_0x4b18('0x30')](_0x23c366,function(_0x1edf7d){if(_0x1edf7d[_0x4b18('0x33')]!==_0x4b18('0x45')){var _0x59bc33={};_0x59bc33[_0x1edf7d[_0x4b18('0x36')]]={'$like':'%'+_0x26d53e['query'][_0x4b18('0x43')]+'%'};return _0x59bc33;}})});}_0x2ff6e5=_[_0x4b18('0x44')]({},_0x2ff6e5,_0x26d53e['options']);var _0x9d69d={'where':_0x2ff6e5[_0x4b18('0x41')]};return db[_0x4b18('0x31')][_0x4b18('0x24')](_0x9d69d)[_0x4b18('0x2a')](function(_0x5ca7fa){_0x5a2cec[_0x4b18('0x24')]=_0x5ca7fa;if(_0x26d53e[_0x4b18('0x37')][_0x4b18('0x46')]){_0x2ff6e5[_0x4b18('0x47')]=[{'all':!![]}];}return db[_0x4b18('0x31')]['findAll'](_0x2ff6e5);})['then'](function(_0x47c001){_0x5a2cec[_0x4b18('0x48')]=_0x47c001;return _0x5a2cec;})[_0x4b18('0x2a')](respondWithFilteredResult(_0x3b0cda,_0x2ff6e5))[_0x4b18('0x49')](handleError(_0x3b0cda,null));};exports['show']=function(_0x5d7d1b,_0x2c0d5a){var _0xcf73ca={'raw':![],'where':{'id':_0x5d7d1b[_0x4b18('0x4a')]['id']}},_0x30e003={};_0x30e003[_0x4b18('0x35')]=_['keys'](db[_0x4b18('0x31')][_0x4b18('0x32')]);_0x30e003[_0x4b18('0x37')]=_[_0x4b18('0x38')](_0x5d7d1b[_0x4b18('0x37')]);_0x30e003[_0x4b18('0x39')]=_['intersection'](_0x30e003['model'],_0x30e003['query']);_0xcf73ca[_0x4b18('0x3b')]=_[_0x4b18('0x3a')](_0x30e003[_0x4b18('0x35')],qs[_0x4b18('0x3c')](_0x5d7d1b['query'][_0x4b18('0x3c')]));_0xcf73ca[_0x4b18('0x3b')]=_0xcf73ca[_0x4b18('0x3b')][_0x4b18('0x3d')]?_0xcf73ca['attributes']:_0x30e003[_0x4b18('0x35')];if(_0x5d7d1b[_0x4b18('0x37')][_0x4b18('0x46')]){_0xcf73ca['include']=[{'all':!![]}];}_0xcf73ca=_[_0x4b18('0x44')]({},_0xcf73ca,_0x5d7d1b[_0x4b18('0x4b')]);return db['ZohoAccount']['find'](_0xcf73ca)['then'](handleEntityNotFound(_0x2c0d5a,null))['then'](respondWithResult(_0x2c0d5a,null))[_0x4b18('0x49')](handleError(_0x2c0d5a,null));};exports[_0x4b18('0x4c')]=function(_0x327518,_0x5b3ff0){return db[_0x4b18('0x31')][_0x4b18('0x4c')](_0x327518[_0x4b18('0x4d')],{})[_0x4b18('0x2a')](respondWithResult(_0x5b3ff0,0xc9))[_0x4b18('0x49')](handleError(_0x5b3ff0,null));};exports[_0x4b18('0x29')]=function(_0x5472af,_0xd901f0){if(_0x5472af[_0x4b18('0x4d')]['id']){delete _0x5472af[_0x4b18('0x4d')]['id'];}return db['ZohoAccount'][_0x4b18('0x4e')]({'where':{'id':_0x5472af[_0x4b18('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd901f0,null))['then'](saveUpdates(_0x5472af['body'],null))[_0x4b18('0x2a')](respondWithResult(_0xd901f0,null))[_0x4b18('0x49')](handleError(_0xd901f0,null));};exports['destroy']=function(_0x3e5cc2,_0x38df95){return db['ZohoAccount'][_0x4b18('0x4e')]({'where':{'id':_0x3e5cc2['params']['id']}})[_0x4b18('0x2a')](handleEntityNotFound(_0x38df95,null))[_0x4b18('0x2a')](removeEntity(_0x38df95,null))[_0x4b18('0x49')](handleError(_0x38df95,null));};exports['getConfigurations']=function(_0x22ece7,_0xb7f530,_0x579633){var _0x2b648f={};var _0xe8010b={};var _0x225cbc;var _0x51f382;return db['ZohoAccount'][_0x4b18('0x4f')]({'where':{'id':_0x22ece7['params']['id']}})[_0x4b18('0x2a')](handleEntityNotFound(_0xb7f530,null))[_0x4b18('0x2a')](function(_0x227542){if(_0x227542){_0x225cbc=_0x227542;_0xe8010b[_0x4b18('0x35')]=_[_0x4b18('0x38')](db[_0x4b18('0x50')][_0x4b18('0x32')]);_0xe8010b[_0x4b18('0x37')]=_['keys'](_0x22ece7[_0x4b18('0x37')]);_0xe8010b[_0x4b18('0x39')]=_['intersection'](_0xe8010b[_0x4b18('0x35')],_0xe8010b[_0x4b18('0x37')]);_0x2b648f['attributes']=_[_0x4b18('0x3a')](_0xe8010b['model'],qs[_0x4b18('0x3c')](_0x22ece7[_0x4b18('0x37')]['fields']));_0x2b648f[_0x4b18('0x3b')]=_0x2b648f[_0x4b18('0x3b')]['length']?_0x2b648f[_0x4b18('0x3b')]:_0xe8010b[_0x4b18('0x35')];_0x2b648f[_0x4b18('0x3f')]=qs[_0x4b18('0x40')](_0x22ece7[_0x4b18('0x37')][_0x4b18('0x40')]);_0x2b648f[_0x4b18('0x41')]=qs['filters'](_[_0x4b18('0x42')](_0x22ece7['query'],_0xe8010b[_0x4b18('0x39')]));if(_0x22ece7[_0x4b18('0x37')]['filter']){_0x2b648f['where']=_[_0x4b18('0x44')](_0x2b648f['where'],{'$or':_[_0x4b18('0x30')](_0x2b648f[_0x4b18('0x3b')],function(_0x12a637){var _0x45976c={};_0x45976c[_0x12a637]={'$like':'%'+_0x22ece7[_0x4b18('0x37')][_0x4b18('0x43')]+'%'};return _0x45976c;})});}_0x2b648f=_[_0x4b18('0x44')]({},_0x2b648f,_0x22ece7[_0x4b18('0x4b')]);return _0x225cbc[_0x4b18('0x51')](_0x2b648f);}})['then'](function(_0x39a5bb){if(_0x39a5bb){_0x51f382=_0x39a5bb['length'];if(!_0x22ece7['query'][_0x4b18('0x3e')]('nolimit')){_0x2b648f[_0x4b18('0x23')]=qs[_0x4b18('0x23')](_0x22ece7[_0x4b18('0x37')]['limit']);_0x2b648f['offset']=qs[_0x4b18('0x25')](_0x22ece7[_0x4b18('0x37')][_0x4b18('0x25')]);}return _0x225cbc[_0x4b18('0x51')](_0x2b648f);}})['then'](function(_0x5a4194){if(_0x5a4194){return _0x5a4194?{'count':_0x51f382,'rows':_0x5a4194}:null;}})['then'](respondWithResult(_0xb7f530,null))[_0x4b18('0x49')](handleError(_0xb7f530,null));};exports[_0x4b18('0x52')]=function(_0x2e2b2b,_0x2946ad,_0x5e090f){if(_0x2e2b2b[_0x4b18('0x4d')]['id']){delete _0x2e2b2b['body']['id'];}return db[_0x4b18('0x31')]['findOne']({'where':{'id':_0x2e2b2b[_0x4b18('0x4a')]['id']}})[_0x4b18('0x2a')](handleEntityNotFound(_0x2946ad,null))[_0x4b18('0x2a')](function(_0x17f3dc){if(_0x17f3dc){_0x2e2b2b[_0x4b18('0x4d')]['AccountId']=_0x17f3dc['id'];_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x53')]=integrations[_0x4b18('0x54')](_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x55')],_0x2e2b2b['body'][_0x4b18('0x33')]);_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x56')]=integrations['getDescriptions'](_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x55')],_0x2e2b2b[_0x4b18('0x4d')][_0x4b18('0x33')]);return db[_0x4b18('0x50')][_0x4b18('0x4c')](_0x2e2b2b['body'],{'include':[{'model':db[_0x4b18('0x57')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x4b18('0x56')}]});}return null;})[_0x4b18('0x2a')](respondWithResult(_0x2946ad,null))[_0x4b18('0x49')](handleError(_0x2946ad,null));};function getAccessToken(_0x4ccb50){return new Promise(function(_0x1d3a36,_0x5d6a2c){var _0x329e61;switch(_0x4ccb50['zone']){case'US':_0x329e61='https://accounts.zoho.com';break;case'AU':_0x329e61='https://accounts.zoho.com.au';break;case'EU':_0x329e61='https://accounts.zoho.eu';break;case'IN':_0x329e61=_0x4b18('0x58');break;case'CN':_0x329e61=_0x4b18('0x59');break;default:_0x329e61=_0x4b18('0x5a');break;}var _0x5f5300={'method':'POST','uri':_0x329e61+_0x4b18('0x5b'),'qs':{'refresh_token':_0x4ccb50[_0x4b18('0x5c')],'client_id':_0x4ccb50[_0x4b18('0x5d')],'client_secret':_0x4ccb50[_0x4b18('0x5e')],'grant_type':_0x4b18('0x5f')},'json':!![]};return rp(_0x5f5300)[_0x4b18('0x2a')](function(_0xdccd53){if(_0xdccd53[_0x4b18('0x60')]){_0x1d3a36(_0xdccd53[_0x4b18('0x60')]);}else{_0x5d6a2c(_0x4b18('0x61'));}})['catch'](function(_0x3d603a){_0x5d6a2c(_0x3d603a);});});}exports[_0x4b18('0x62')]=function(_0x332e1a,_0x32cbbd,_0x550f80){var _0x364794,_0x41e801,_0x5ad9a1,_0x2d130d,_0xaec120;return db[_0x4b18('0x31')][_0x4b18('0x4f')]({'where':{'id':_0x332e1a['params']['id']},'attributes':['id',_0x4b18('0x63'),_0x4b18('0x64'),_0x4b18('0x5d'),_0x4b18('0x5e'),_0x4b18('0x65'),_0x4b18('0x66'),_0x4b18('0x5c')]})['then'](handleEntityNotFound(_0x32cbbd,null))[_0x4b18('0x2a')](function(_0x13c396){_0xaec120=_0x13c396;_0x364794=_0xaec120[_0x4b18('0x63')];_0x41e801=_0x364794==='zoho.eu'?'eu':_0x4b18('0x67');_0x5ad9a1=_0xaec120[_0x4b18('0x65')];var _0x49bf01=_0x5ad9a1[_0x4b18('0x68')](-0x1);if(_0x49bf01==='/'||_0x49bf01==='\x5c'||_0x49bf01===':'){_0x5ad9a1=_0x5ad9a1[_0x4b18('0x69')](0x0,_0x5ad9a1[_0x4b18('0x6a')](_0x49bf01));}if(!_0xaec120['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xaec120);})[_0x4b18('0x2a')](function(_0x42e5fb){if(_0x42e5fb){return rp({'method':_0x4b18('0x6b'),'uri':util[_0x4b18('0x6c')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x41e801),'qs':{'module':_0x4b18('0x6d')},'headers':{'Authorization':_0x4b18('0x6e')+_0x42e5fb},'json':!![]});}})[_0x4b18('0x2a')](function(_0x597963){if(_0x597963){if(_0x597963[_0x4b18('0x6f')]&&_0x597963[_0x4b18('0x6f')]['error']){throw new Error(_0x597963[_0x4b18('0x6f')]['error'][_0x4b18('0x70')]);}var _0x1d6c1b=[];var _0x28a997=[];var _0x800e92=[_0x4b18('0x71'),'Subject','Description',_0x4b18('0x72'),_0x4b18('0x73'),_0x4b18('0x74'),_0x4b18('0x75'),_0x4b18('0x76')];_0x28a997=_[_0x4b18('0x77')](_0x597963[_0x4b18('0x3c')],function(_0x2a998b){return _0x800e92[_0x4b18('0x78')](_0x2a998b[_0x4b18('0x79')]);});for(var _0x42f002=0x0;_0x42f002<_0x28a997['length'];_0x42f002++){if(_0x28a997[_0x42f002][_0x4b18('0x7a')]===![]){_0x1d6c1b[_0x4b18('0x7b')]({'id':_0x28a997[_0x42f002]['id'],'name':_0x28a997[_0x42f002]['display_label'],'custom':_0x28a997[_0x42f002][_0x4b18('0x7c')],'options':_0x28a997[_0x42f002]['data_type']===_0x4b18('0x7d')&&_0x28a997[_0x42f002][_0x4b18('0x7e')][_0x4b18('0x3d')]>-0x1?_['map'](_0x28a997[_0x42f002][_0x4b18('0x7e')],function(_0x4b76ab){return{'name':_0x4b76ab,'value':_0x4b76ab};}):[]});}}return{'count':_0x1d6c1b[_0x4b18('0x3d')],'rows':_0x1d6c1b};}else{return{'count':0x0,'rows':[]};}})[_0x4b18('0x2a')](respondWithResult(_0x32cbbd,null))[_0x4b18('0x49')](function(_0x42fd11){var _0x125e4e=_0x332e1a[_0x4b18('0x37')]['test']?0x1f4:_0x42fd11[_0x4b18('0x7f')]||0x1f4;logger[_0x4b18('0x2c')](_0x4b18('0x80'),_0x4b18('0x62'),_0x125e4e,JSON['stringify'](_0x42fd11));delete _0x42fd11[_0x4b18('0x36')];if(_0x125e4e===0x191){_0x125e4e=0x190;}_0x32cbbd['status'](_0x125e4e)[_0x4b18('0x2e')](_0x332e1a[_0x4b18('0x37')][_0x4b18('0x81')]?{'message':_0x4b18('0x82'),'statusCode':_0x42fd11[_0x4b18('0x7f')]}:_0x42fd11);});}; \ No newline at end of file +var _0x7678=['error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','getConfigurations','findOne','ZohoConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy'];(function(_0xce3a0b,_0x5b271b){var _0x1ca1b9=function(_0x1acd40){while(--_0x1acd40){_0xce3a0b['push'](_0xce3a0b['shift']());}};_0x1ca1b9(++_0x5b271b);}(_0x7678,0x1df));var _0x8767=function(_0x624839,_0x43d16a){_0x624839=_0x624839-0x0;var _0x2adb2c=_0x7678[_0x624839];return _0x2adb2c;};'use strict';var emlformat=require(_0x8767('0x0'));var rimraf=require(_0x8767('0x1'));var zipdir=require(_0x8767('0x2'));var jsonpatch=require(_0x8767('0x3'));var rp=require(_0x8767('0x4'));var moment=require('moment');var BPromise=require(_0x8767('0x5'));var Mustache=require(_0x8767('0x6'));var util=require('util');var path=require(_0x8767('0x7'));var sox=require('sox');var csv=require(_0x8767('0x8'));var ejs=require(_0x8767('0x9'));var fs=require('fs');var fs_extra=require(_0x8767('0xa'));var _=require(_0x8767('0xb'));var squel=require('squel');var crypto=require(_0x8767('0xc'));var jsforce=require(_0x8767('0xd'));var deskjs=require(_0x8767('0xe'));var toCsv=require(_0x8767('0x8'));var querystring=require('querystring');var Papa=require(_0x8767('0xf'));var Redis=require(_0x8767('0x10'));var authService=require(_0x8767('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8767('0x12'));var hardwareService=require(_0x8767('0x13'));var logger=require(_0x8767('0x14'))(_0x8767('0x15'));var utils=require(_0x8767('0x16'));var config=require(_0x8767('0x17'));var licenseUtil=require(_0x8767('0x18'));var db=require(_0x8767('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2b8312,_0x4e541a){_0x4e541a=_0x4e541a||0xcc;return function(_0x5e96ca){if(_0x5e96ca){return _0x2b8312[_0x8767('0x1a')](_0x4e541a);}return _0x2b8312['status'](_0x4e541a)[_0x8767('0x1b')]();};}function respondWithResult(_0x5de362,_0x3515a1){_0x3515a1=_0x3515a1||0xc8;return function(_0xbb4f47){if(_0xbb4f47){return _0x5de362[_0x8767('0x1c')](_0x3515a1)[_0x8767('0x1d')](_0xbb4f47);}};}function respondWithFilteredResult(_0x4e1563,_0x412911){return function(_0x59d1da){if(_0x59d1da){var _0x42114f=typeof _0x412911[_0x8767('0x1e')]===_0x8767('0x1f')&&typeof _0x412911[_0x8767('0x20')]===_0x8767('0x1f');var _0x3c0eb7=_0x59d1da[_0x8767('0x21')];var _0x4e9165=_0x42114f?0x0:_0x412911[_0x8767('0x1e')];var _0x3c2f0b=_0x42114f?_0x59d1da['count']:_0x412911[_0x8767('0x1e')]+_0x412911[_0x8767('0x20')];var _0x352d0d;if(_0x3c2f0b>=_0x3c0eb7){_0x3c2f0b=_0x3c0eb7;_0x352d0d=0xc8;}else{_0x352d0d=0xce;}_0x4e1563[_0x8767('0x1c')](_0x352d0d);return _0x4e1563[_0x8767('0x22')](_0x8767('0x23'),_0x4e9165+'-'+_0x3c2f0b+'/'+_0x3c0eb7)['json'](_0x59d1da);}return null;};}function patchUpdates(_0x5727d0){return function(_0xacde2c){try{jsonpatch['apply'](_0xacde2c,_0x5727d0,!![]);}catch(_0x1e41e9){return BPromise[_0x8767('0x24')](_0x1e41e9);}return _0xacde2c[_0x8767('0x25')]();};}function saveUpdates(_0xed5ebc,_0x1c5e9d){return function(_0x59df4b){if(_0x59df4b){return _0x59df4b[_0x8767('0x26')](_0xed5ebc)[_0x8767('0x27')](function(_0xe21140){return _0xe21140;});}return null;};}function removeEntity(_0x3f7728,_0x2b9b2e){return function(_0x4c7eeb){if(_0x4c7eeb){return _0x4c7eeb[_0x8767('0x28')]()['then'](function(){_0x3f7728[_0x8767('0x1c')](0xcc)[_0x8767('0x1b')]();});}};}function handleEntityNotFound(_0x2d3493,_0x1fbb07){return function(_0x461913){if(!_0x461913){_0x2d3493[_0x8767('0x1a')](0x194);}return _0x461913;};}function handleError(_0x5ec440,_0x3ebc56){_0x3ebc56=_0x3ebc56||0x1f4;return function(_0xd285ff){logger[_0x8767('0x29')](_0xd285ff[_0x8767('0x2a')]);if(_0xd285ff['name']){delete _0xd285ff[_0x8767('0x2b')];}_0x5ec440[_0x8767('0x1c')](_0x3ebc56)[_0x8767('0x2c')](_0xd285ff);};}exports['index']=function(_0x288b11,_0x81a4da){var _0xe909ef={},_0x4c47f7={},_0x107e9c={'count':0x0,'rows':[]};var _0x5aef86=_[_0x8767('0x2d')](db[_0x8767('0x2e')][_0x8767('0x2f')],function(_0x93ccd7){return{'name':_0x93ccd7[_0x8767('0x30')],'type':_0x93ccd7[_0x8767('0x31')]['key']};});_0x4c47f7[_0x8767('0x32')]=_[_0x8767('0x2d')](_0x5aef86,_0x8767('0x2b'));_0x4c47f7['query']=_['keys'](_0x288b11[_0x8767('0x33')]);_0x4c47f7[_0x8767('0x34')]=_[_0x8767('0x35')](_0x4c47f7['model'],_0x4c47f7[_0x8767('0x33')]);_0xe909ef[_0x8767('0x36')]=_[_0x8767('0x35')](_0x4c47f7[_0x8767('0x32')],qs[_0x8767('0x37')](_0x288b11['query'][_0x8767('0x37')]));_0xe909ef[_0x8767('0x36')]=_0xe909ef[_0x8767('0x36')]['length']?_0xe909ef[_0x8767('0x36')]:_0x4c47f7['model'];if(!_0x288b11['query'][_0x8767('0x38')](_0x8767('0x39'))){_0xe909ef['limit']=qs[_0x8767('0x20')](_0x288b11[_0x8767('0x33')][_0x8767('0x20')]);_0xe909ef[_0x8767('0x1e')]=qs[_0x8767('0x1e')](_0x288b11[_0x8767('0x33')][_0x8767('0x1e')]);}_0xe909ef[_0x8767('0x3a')]=qs[_0x8767('0x3b')](_0x288b11['query'][_0x8767('0x3b')]);_0xe909ef[_0x8767('0x3c')]=qs[_0x8767('0x34')](_[_0x8767('0x3d')](_0x288b11[_0x8767('0x33')],_0x4c47f7[_0x8767('0x34')]),_0x5aef86);if(_0x288b11['query'][_0x8767('0x3e')]){_0xe909ef[_0x8767('0x3c')]=_[_0x8767('0x3f')](_0xe909ef[_0x8767('0x3c')],{'$or':_[_0x8767('0x2d')](_0x5aef86,function(_0x1769e8){if(_0x1769e8[_0x8767('0x31')]!==_0x8767('0x40')){var _0x33b858={};_0x33b858[_0x1769e8['name']]={'$like':'%'+_0x288b11['query'][_0x8767('0x3e')]+'%'};return _0x33b858;}})});}_0xe909ef=_[_0x8767('0x3f')]({},_0xe909ef,_0x288b11[_0x8767('0x41')]);var _0x35979e={'where':_0xe909ef[_0x8767('0x3c')]};return db[_0x8767('0x2e')][_0x8767('0x21')](_0x35979e)['then'](function(_0x2de321){_0x107e9c[_0x8767('0x21')]=_0x2de321;if(_0x288b11[_0x8767('0x33')][_0x8767('0x42')]){_0xe909ef['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x8767('0x43')](_0xe909ef);})[_0x8767('0x27')](function(_0x151d7d){_0x107e9c[_0x8767('0x44')]=_0x151d7d;return _0x107e9c;})['then'](respondWithFilteredResult(_0x81a4da,_0xe909ef))[_0x8767('0x45')](handleError(_0x81a4da,null));};exports['show']=function(_0x158dc0,_0x1fc267){var _0x3f390d={'raw':![],'where':{'id':_0x158dc0[_0x8767('0x46')]['id']}},_0xefbba1={};_0xefbba1[_0x8767('0x32')]=_['keys'](db['ZohoAccount'][_0x8767('0x2f')]);_0xefbba1[_0x8767('0x33')]=_[_0x8767('0x47')](_0x158dc0[_0x8767('0x33')]);_0xefbba1['filters']=_['intersection'](_0xefbba1[_0x8767('0x32')],_0xefbba1[_0x8767('0x33')]);_0x3f390d['attributes']=_['intersection'](_0xefbba1['model'],qs[_0x8767('0x37')](_0x158dc0[_0x8767('0x33')][_0x8767('0x37')]));_0x3f390d[_0x8767('0x36')]=_0x3f390d[_0x8767('0x36')]['length']?_0x3f390d['attributes']:_0xefbba1[_0x8767('0x32')];if(_0x158dc0[_0x8767('0x33')][_0x8767('0x42')]){_0x3f390d[_0x8767('0x48')]=[{'all':!![]}];}_0x3f390d=_[_0x8767('0x3f')]({},_0x3f390d,_0x158dc0[_0x8767('0x41')]);return db['ZohoAccount'][_0x8767('0x49')](_0x3f390d)[_0x8767('0x27')](handleEntityNotFound(_0x1fc267,null))[_0x8767('0x27')](respondWithResult(_0x1fc267,null))['catch'](handleError(_0x1fc267,null));};exports[_0x8767('0x4a')]=function(_0x43f01b,_0x24ba00){return db[_0x8767('0x2e')][_0x8767('0x4a')](_0x43f01b['body'],{})[_0x8767('0x27')](respondWithResult(_0x24ba00,0xc9))[_0x8767('0x45')](handleError(_0x24ba00,null));};exports['update']=function(_0x5bb5c9,_0x4dd40e){if(_0x5bb5c9[_0x8767('0x4b')]['id']){delete _0x5bb5c9[_0x8767('0x4b')]['id'];}return db[_0x8767('0x2e')][_0x8767('0x49')]({'where':{'id':_0x5bb5c9[_0x8767('0x46')]['id']}})[_0x8767('0x27')](handleEntityNotFound(_0x4dd40e,null))[_0x8767('0x27')](saveUpdates(_0x5bb5c9[_0x8767('0x4b')],null))[_0x8767('0x27')](respondWithResult(_0x4dd40e,null))[_0x8767('0x45')](handleError(_0x4dd40e,null));};exports[_0x8767('0x28')]=function(_0x597070,_0x148e41){return db['ZohoAccount'][_0x8767('0x49')]({'where':{'id':_0x597070[_0x8767('0x46')]['id']}})[_0x8767('0x27')](handleEntityNotFound(_0x148e41,null))[_0x8767('0x27')](removeEntity(_0x148e41,null))[_0x8767('0x45')](handleError(_0x148e41,null));};exports[_0x8767('0x4c')]=function(_0x11292f,_0x5f3c65,_0x3e0e4d){var _0x3d94da={};var _0x157f5b={};var _0x3cbc6a;var _0x2a2ad4;return db[_0x8767('0x2e')][_0x8767('0x4d')]({'where':{'id':_0x11292f['params']['id']}})[_0x8767('0x27')](handleEntityNotFound(_0x5f3c65,null))[_0x8767('0x27')](function(_0x113c97){if(_0x113c97){_0x3cbc6a=_0x113c97;_0x157f5b[_0x8767('0x32')]=_[_0x8767('0x47')](db[_0x8767('0x4e')][_0x8767('0x2f')]);_0x157f5b[_0x8767('0x33')]=_[_0x8767('0x47')](_0x11292f[_0x8767('0x33')]);_0x157f5b[_0x8767('0x34')]=_[_0x8767('0x35')](_0x157f5b[_0x8767('0x32')],_0x157f5b[_0x8767('0x33')]);_0x3d94da['attributes']=_[_0x8767('0x35')](_0x157f5b['model'],qs[_0x8767('0x37')](_0x11292f[_0x8767('0x33')][_0x8767('0x37')]));_0x3d94da[_0x8767('0x36')]=_0x3d94da[_0x8767('0x36')]['length']?_0x3d94da['attributes']:_0x157f5b[_0x8767('0x32')];_0x3d94da[_0x8767('0x3a')]=qs['sort'](_0x11292f[_0x8767('0x33')][_0x8767('0x3b')]);_0x3d94da[_0x8767('0x3c')]=qs[_0x8767('0x34')](_[_0x8767('0x3d')](_0x11292f[_0x8767('0x33')],_0x157f5b[_0x8767('0x34')]));if(_0x11292f['query'][_0x8767('0x3e')]){_0x3d94da[_0x8767('0x3c')]=_['merge'](_0x3d94da[_0x8767('0x3c')],{'$or':_[_0x8767('0x2d')](_0x3d94da[_0x8767('0x36')],function(_0x7482e8){var _0xabf5b9={};_0xabf5b9[_0x7482e8]={'$like':'%'+_0x11292f['query']['filter']+'%'};return _0xabf5b9;})});}_0x3d94da=_['merge']({},_0x3d94da,_0x11292f[_0x8767('0x41')]);return _0x3cbc6a[_0x8767('0x4c')](_0x3d94da);}})[_0x8767('0x27')](function(_0x18cc83){if(_0x18cc83){_0x2a2ad4=_0x18cc83[_0x8767('0x4f')];if(!_0x11292f[_0x8767('0x33')][_0x8767('0x38')](_0x8767('0x39'))){_0x3d94da['limit']=qs[_0x8767('0x20')](_0x11292f[_0x8767('0x33')][_0x8767('0x20')]);_0x3d94da[_0x8767('0x1e')]=qs[_0x8767('0x1e')](_0x11292f['query'][_0x8767('0x1e')]);}return _0x3cbc6a[_0x8767('0x4c')](_0x3d94da);}})[_0x8767('0x27')](function(_0x230994){if(_0x230994){return _0x230994?{'count':_0x2a2ad4,'rows':_0x230994}:null;}})[_0x8767('0x27')](respondWithResult(_0x5f3c65,null))[_0x8767('0x45')](handleError(_0x5f3c65,null));};exports[_0x8767('0x50')]=function(_0x187d09,_0x1c7a13,_0x1ce508){if(_0x187d09[_0x8767('0x4b')]['id']){delete _0x187d09[_0x8767('0x4b')]['id'];}return db[_0x8767('0x2e')][_0x8767('0x4d')]({'where':{'id':_0x187d09[_0x8767('0x46')]['id']}})[_0x8767('0x27')](handleEntityNotFound(_0x1c7a13,null))[_0x8767('0x27')](function(_0x18432e){if(_0x18432e){_0x187d09['body'][_0x8767('0x51')]=_0x18432e['id'];_0x187d09[_0x8767('0x4b')][_0x8767('0x52')]=integrations[_0x8767('0x53')](_0x187d09[_0x8767('0x4b')]['channel'],_0x187d09[_0x8767('0x4b')][_0x8767('0x31')]);_0x187d09[_0x8767('0x4b')]['Descriptions']=integrations[_0x8767('0x54')](_0x187d09['body'][_0x8767('0x55')],_0x187d09[_0x8767('0x4b')][_0x8767('0x31')]);return db[_0x8767('0x4e')][_0x8767('0x4a')](_0x187d09[_0x8767('0x4b')],{'include':[{'model':db[_0x8767('0x56')],'as':_0x8767('0x52')},{'model':db['ZohoField'],'as':_0x8767('0x57')}]});}return null;})[_0x8767('0x27')](respondWithResult(_0x1c7a13,null))['catch'](handleError(_0x1c7a13,null));};function getAccessToken(_0xd010c6){return new Promise(function(_0x9c48b3,_0x554c6d){var _0x2ee786;switch(_0xd010c6[_0x8767('0x58')]){case'US':_0x2ee786=_0x8767('0x59');break;case'AU':_0x2ee786=_0x8767('0x5a');break;case'EU':_0x2ee786='https://accounts.zoho.eu';break;case'IN':_0x2ee786='https://accounts.zoho.in';break;case'CN':_0x2ee786='https://accounts.zoho.com.cn';break;default:_0x2ee786=_0x8767('0x5b');break;}var _0x327f50={'method':_0x8767('0x5c'),'uri':_0x2ee786+_0x8767('0x5d'),'qs':{'refresh_token':_0xd010c6[_0x8767('0x5e')],'client_id':_0xd010c6[_0x8767('0x5f')],'client_secret':_0xd010c6['clientSecret'],'grant_type':_0x8767('0x60')},'json':!![]};return rp(_0x327f50)[_0x8767('0x27')](function(_0x4ea3cf){if(_0x4ea3cf['access_token']){_0x9c48b3(_0x4ea3cf[_0x8767('0x61')]);}else{_0x554c6d(_0x8767('0x62'));}})[_0x8767('0x45')](function(_0x33d8f6){_0x554c6d(_0x33d8f6);});});}exports['getFields']=function(_0x4dda0b,_0x42b121,_0x4703bd){var _0x5d5584,_0x631c6e,_0x2707b1,_0x233bca,_0x322b4d;return db[_0x8767('0x2e')]['findOne']({'where':{'id':_0x4dda0b[_0x8767('0x46')]['id']},'attributes':['id','host',_0x8767('0x58'),_0x8767('0x5f'),'clientSecret',_0x8767('0x63'),_0x8767('0x64'),_0x8767('0x5e')]})['then'](handleEntityNotFound(_0x42b121,null))[_0x8767('0x27')](function(_0xcb7c58){_0x322b4d=_0xcb7c58;_0x5d5584=_0x322b4d['host'];_0x631c6e=_0x5d5584===_0x8767('0x65')?'eu':'com';_0x2707b1=_0x322b4d[_0x8767('0x63')];var _0x5028ba=_0x2707b1[_0x8767('0x66')](-0x1);if(_0x5028ba==='/'||_0x5028ba==='\x5c'||_0x5028ba===':'){_0x2707b1=_0x2707b1[_0x8767('0x67')](0x0,_0x2707b1[_0x8767('0x68')](_0x5028ba));}if(!_0x322b4d['refreshToken']){throw new Error(_0x8767('0x69'));}return getAccessToken(_0x322b4d);})[_0x8767('0x27')](function(_0x3fd0bf){if(_0x3fd0bf){return rp({'method':'GET','uri':util[_0x8767('0x6a')](_0x8767('0x6b'),_0x631c6e),'qs':{'module':'Calls'},'headers':{'Authorization':_0x8767('0x6c')+_0x3fd0bf},'json':!![]});}})['then'](function(_0x35458d){if(_0x35458d){if(_0x35458d['response']&&_0x35458d[_0x8767('0x6d')][_0x8767('0x29')]){throw new Error(_0x35458d[_0x8767('0x6d')][_0x8767('0x29')][_0x8767('0x6e')]);}var _0x58d011=[];var _0x241e72=[];var _0x3a2810=['Owner',_0x8767('0x6f'),'Description',_0x8767('0x70'),_0x8767('0x71'),_0x8767('0x72'),_0x8767('0x73'),_0x8767('0x74')];_0x241e72=_[_0x8767('0x75')](_0x35458d['fields'],function(_0xe07bbf){return _0x3a2810[_0x8767('0x76')](_0xe07bbf['api_name']);});for(var _0x2d2cb2=0x0;_0x2d2cb2<_0x241e72['length'];_0x2d2cb2++){if(_0x241e72[_0x2d2cb2][_0x8767('0x77')]===![]){_0x58d011['push']({'id':_0x241e72[_0x2d2cb2]['id'],'name':_0x241e72[_0x2d2cb2][_0x8767('0x78')],'custom':_0x241e72[_0x2d2cb2][_0x8767('0x79')],'options':_0x241e72[_0x2d2cb2][_0x8767('0x7a')]===_0x8767('0x7b')&&_0x241e72[_0x2d2cb2][_0x8767('0x7c')][_0x8767('0x4f')]>-0x1?_[_0x8767('0x2d')](_0x241e72[_0x2d2cb2]['pick_list_values'],function(_0x3633b9){return{'name':_0x3633b9,'value':_0x3633b9};}):[]});}}return{'count':_0x58d011[_0x8767('0x4f')],'rows':_0x58d011};}else{return{'count':0x0,'rows':[]};}})[_0x8767('0x27')](respondWithResult(_0x42b121,null))['catch'](function(_0x500399){var _0x1face6=_0x4dda0b['query'][_0x8767('0x7d')]?0x1f4:_0x500399[_0x8767('0x7e')]||0x1f4;logger[_0x8767('0x29')](_0x8767('0x7f'),_0x8767('0x80'),_0x1face6,JSON['stringify'](_0x500399));delete _0x500399[_0x8767('0x2b')];if(_0x1face6===0x191){_0x1face6=0x190;}_0x42b121[_0x8767('0x1c')](_0x1face6)[_0x8767('0x2c')](_0x4dda0b[_0x8767('0x33')][_0x8767('0x7d')]?{'message':_0x8767('0x81'),'statusCode':_0x500399[_0x8767('0x7e')]}:_0x500399);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index ace436d..e7f5cde 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 _0xcbd6=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','authorization_code','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcbd6,0x123));var _0x6cbd=function(_0x5f4ec3,_0x1b02e6){_0x5f4ec3=_0x5f4ec3-0x0;var _0x1cf954=_0xcbd6[_0x5f4ec3];return _0x1cf954;};'use strict';var _=require(_0x6cbd('0x0'));var util=require('util');var logger=require(_0x6cbd('0x1'))(_0x6cbd('0x2'));var moment=require(_0x6cbd('0x3'));var BPromise=require(_0x6cbd('0x4'));var rp=require(_0x6cbd('0x5'));var fs=require('fs');var path=require(_0x6cbd('0x6'));var rimraf=require('rimraf');var config=require(_0x6cbd('0x7'));var attributes=require(_0x6cbd('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6cbd('0x9')]=function(_0x3fd97f,_0x584881){return _0x3fd97f['define'](_0x6cbd('0xa'),attributes,{'tableName':_0x6cbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe3c89a,_0x42337a,_0x33dbfb){if(_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0xd'))||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0xe'))||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0xf'))||_0xe3c89a[_0x6cbd('0xc')]('clientSecret')||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0x10'))||_0xe3c89a[_0x6cbd('0xc')](_0x6cbd('0x11'))){var _0x2a9034,_0xec80af;_0x2a9034=_0xe3c89a['serverUrl'];var _0x349528=_0x2a9034[_0x6cbd('0x12')](-0x1);if(_0x349528==='/'||_0x349528==='\x5c'||_0x349528===':'){_0x2a9034=_0x2a9034[_0x6cbd('0x13')](0x0,_0x2a9034['lastIndexOf'](_0x349528));}switch(_0xe3c89a[_0x6cbd('0xd')]){case'US':_0xec80af='https://accounts.zoho.com';break;case'AU':_0xec80af=_0x6cbd('0x14');break;case'IN':_0xec80af=_0x6cbd('0x15');break;case'CN':_0xec80af=_0x6cbd('0x16');break;default:_0xec80af=_0x6cbd('0x17');break;}var _0x48e2f3={'method':_0x6cbd('0x18'),'uri':_0xec80af+_0x6cbd('0x19'),'form':{'grant_type':'authorization_code','client_id':_0xe3c89a[_0x6cbd('0xf')],'client_secret':_0xe3c89a[_0x6cbd('0x1a')],'redirect_uri':_0xe3c89a[_0x6cbd('0xe')],'code':_0xe3c89a[_0x6cbd('0x10')]},'headers':{'Content-Type':_0x6cbd('0x1b')}};return rp(_0x48e2f3)[_0x6cbd('0x1c')](function(_0x6531d8){var _0x2db792=JSON[_0x6cbd('0x1d')](_0x6531d8);if(_0x2db792[_0x6cbd('0x1e')]){_0xe3c89a[_0x6cbd('0x1f')]=_0x2db792[_0x6cbd('0x1e')];logger[_0x6cbd('0x20')](util[_0x6cbd('0x21')](_0x6cbd('0x22'),_0xe3c89a[_0x6cbd('0x23')],_0xe3c89a['id']));}else{logger[_0x6cbd('0x24')](util['format'](_0x6cbd('0x25'),_0xe3c89a['name'],_0xe3c89a['id']),util['inspect'](_0x2db792,{'showHidden':![],'depth':null}));}return _0x33dbfb(null,_0x42337a);})[_0x6cbd('0x26')](function(_0x1905c0){logger[_0x6cbd('0x24')](util['format'](_0x6cbd('0x25'),_0xe3c89a['name'],_0xe3c89a['id']),util[_0x6cbd('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x33dbfb(_0x1905c0);});}else{return _0x33dbfb(null,_0x42337a);}},'beforeUpdate':function(_0x5a6637,_0x104d9b,_0x227e7d){if(_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0xd'))||_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0xe'))||_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0xf'))||_0x5a6637['changed']('clientSecret')||_0x5a6637[_0x6cbd('0xc')](_0x6cbd('0x10'))||_0x5a6637['changed'](_0x6cbd('0x11'))){var _0x507851,_0x31c0f6;_0x507851=_0x5a6637[_0x6cbd('0xe')];var _0xf37d25=_0x507851[_0x6cbd('0x12')](-0x1);if(_0xf37d25==='/'||_0xf37d25==='\x5c'||_0xf37d25===':'){_0x507851=_0x507851[_0x6cbd('0x13')](0x0,_0x507851['lastIndexOf'](_0xf37d25));}switch(_0x5a6637[_0x6cbd('0xd')]){case'US':_0x31c0f6='https://accounts.zoho.com';break;case'AU':_0x31c0f6='https://accounts.zoho.com.au';break;case'IN':_0x31c0f6='https://accounts.zoho.in';break;case'CN':_0x31c0f6=_0x6cbd('0x16');break;default:_0x31c0f6=_0x6cbd('0x17');break;}var _0x303371={'method':_0x6cbd('0x18'),'uri':_0x31c0f6+_0x6cbd('0x19'),'form':{'grant_type':_0x6cbd('0x28'),'client_id':_0x5a6637['clientId'],'client_secret':_0x5a6637['clientSecret'],'redirect_uri':_0x5a6637['serverUrl'],'code':_0x5a6637['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x303371)[_0x6cbd('0x1c')](function(_0x5866f0){var _0x16b538=JSON[_0x6cbd('0x1d')](_0x5866f0);if(_0x16b538['refresh_token']){_0x5a6637[_0x6cbd('0x1f')]=_0x16b538[_0x6cbd('0x1e')];logger['info'](util['format'](_0x6cbd('0x22'),_0x5a6637[_0x6cbd('0x23')],_0x5a6637['id']));}else{logger[_0x6cbd('0x24')](util[_0x6cbd('0x21')](_0x6cbd('0x25'),_0x5a6637[_0x6cbd('0x23')],_0x5a6637['id']),util[_0x6cbd('0x27')](_0x16b538,{'showHidden':![],'depth':null}));}return _0x227e7d(null,_0x104d9b);})[_0x6cbd('0x26')](function(_0x50aed5){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a6637[_0x6cbd('0x23')],_0x5a6637['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x227e7d(_0x50aed5);});}else{return _0x227e7d(null,_0x104d9b);}}}});}; \ No newline at end of file +var _0xec2e=['application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','inspect','slice','https://accounts.zoho.com.au','https://accounts.zoho.in','parse','api','moment','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code'];(function(_0x401573,_0x5e02bc){var _0x51a04e=function(_0x350c92){while(--_0x350c92){_0x401573['push'](_0x401573['shift']());}};_0x51a04e(++_0x5e02bc);}(_0xec2e,0xf4));var _0xeec2=function(_0x6019c2,_0x381796){_0x6019c2=_0x6019c2-0x0;var _0x5944ec=_0xec2e[_0x6019c2];return _0x5944ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xeec2('0x0'));var moment=require(_0xeec2('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeec2('0x2'));var attributes=require(_0xeec2('0x3'));var integrations=require(_0xeec2('0x4'));module[_0xeec2('0x5')]=function(_0x1440d2,_0x54278f){return _0x1440d2['define'](_0xeec2('0x6'),attributes,{'tableName':_0xeec2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xed9b2f,_0x21cdf6,_0x392f08){if(_0xed9b2f['changed']('zone')||_0xed9b2f[_0xeec2('0x8')](_0xeec2('0x9'))||_0xed9b2f[_0xeec2('0x8')](_0xeec2('0xa'))||_0xed9b2f[_0xeec2('0x8')](_0xeec2('0xb'))||_0xed9b2f[_0xeec2('0x8')](_0xeec2('0xc'))||_0xed9b2f[_0xeec2('0x8')](_0xeec2('0xd'))){var _0x57ac72,_0x10dea1;_0x57ac72=_0xed9b2f[_0xeec2('0x9')];var _0x402090=_0x57ac72['slice'](-0x1);if(_0x402090==='/'||_0x402090==='\x5c'||_0x402090===':'){_0x57ac72=_0x57ac72[_0xeec2('0xe')](0x0,_0x57ac72[_0xeec2('0xf')](_0x402090));}switch(_0xed9b2f[_0xeec2('0x10')]){case'US':_0x10dea1=_0xeec2('0x11');break;case'AU':_0x10dea1='https://accounts.zoho.com.au';break;case'IN':_0x10dea1='https://accounts.zoho.in';break;case'CN':_0x10dea1=_0xeec2('0x12');break;default:_0x10dea1=_0xeec2('0x13');break;}var _0x3da185={'method':'POST','uri':_0x10dea1+_0xeec2('0x14'),'form':{'grant_type':_0xeec2('0x15'),'client_id':_0xed9b2f[_0xeec2('0xa')],'client_secret':_0xed9b2f[_0xeec2('0xb')],'redirect_uri':_0xed9b2f[_0xeec2('0x9')],'code':_0xed9b2f[_0xeec2('0xc')]},'headers':{'Content-Type':_0xeec2('0x16')}};return rp(_0x3da185)[_0xeec2('0x17')](function(_0x4e4c0a){var _0x54f685=JSON['parse'](_0x4e4c0a);if(_0x54f685[_0xeec2('0x18')]){_0xed9b2f[_0xeec2('0x19')]=_0x54f685['refresh_token'];logger[_0xeec2('0x1a')](util[_0xeec2('0x1b')](_0xeec2('0x1c'),_0xed9b2f['name'],_0xed9b2f['id']));}else{logger['error'](util[_0xeec2('0x1b')](_0xeec2('0x1d'),_0xed9b2f[_0xeec2('0x1e')],_0xed9b2f['id']),util['inspect'](_0x54f685,{'showHidden':![],'depth':null}));}return _0x392f08(null,_0x21cdf6);})[_0xeec2('0x1f')](function(_0xd68084){logger[_0xeec2('0x20')](util[_0xeec2('0x1b')](_0xeec2('0x1d'),_0xed9b2f[_0xeec2('0x1e')],_0xed9b2f['id']),util[_0xeec2('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x392f08(_0xd68084);});}else{return _0x392f08(null,_0x21cdf6);}},'beforeUpdate':function(_0x748dd9,_0x53f250,_0x594331){if(_0x748dd9['changed'](_0xeec2('0x10'))||_0x748dd9[_0xeec2('0x8')](_0xeec2('0x9'))||_0x748dd9['changed']('clientId')||_0x748dd9[_0xeec2('0x8')](_0xeec2('0xb'))||_0x748dd9[_0xeec2('0x8')](_0xeec2('0xc'))||_0x748dd9[_0xeec2('0x8')](_0xeec2('0xd'))){var _0x305ca4,_0x38b409;_0x305ca4=_0x748dd9[_0xeec2('0x9')];var _0x132488=_0x305ca4[_0xeec2('0x22')](-0x1);if(_0x132488==='/'||_0x132488==='\x5c'||_0x132488===':'){_0x305ca4=_0x305ca4['substring'](0x0,_0x305ca4[_0xeec2('0xf')](_0x132488));}switch(_0x748dd9[_0xeec2('0x10')]){case'US':_0x38b409='https://accounts.zoho.com';break;case'AU':_0x38b409=_0xeec2('0x23');break;case'IN':_0x38b409=_0xeec2('0x24');break;case'CN':_0x38b409=_0xeec2('0x12');break;default:_0x38b409='https://accounts.zoho.eu';break;}var _0x4ffac4={'method':'POST','uri':_0x38b409+'/oauth/v2/token','form':{'grant_type':_0xeec2('0x15'),'client_id':_0x748dd9['clientId'],'client_secret':_0x748dd9[_0xeec2('0xb')],'redirect_uri':_0x748dd9[_0xeec2('0x9')],'code':_0x748dd9[_0xeec2('0xc')]},'headers':{'Content-Type':_0xeec2('0x16')}};return rp(_0x4ffac4)[_0xeec2('0x17')](function(_0x14195b){var _0x2c749c=JSON[_0xeec2('0x25')](_0x14195b);if(_0x2c749c['refresh_token']){_0x748dd9[_0xeec2('0x19')]=_0x2c749c[_0xeec2('0x18')];logger[_0xeec2('0x1a')](util[_0xeec2('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x748dd9[_0xeec2('0x1e')],_0x748dd9['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x748dd9[_0xeec2('0x1e')],_0x748dd9['id']),util[_0xeec2('0x21')](_0x2c749c,{'showHidden':![],'depth':null}));}return _0x594331(null,_0x53f250);})['catch'](function(_0x43e0eb){logger[_0xeec2('0x20')](util[_0xeec2('0x1b')](_0xeec2('0x1d'),_0x748dd9[_0xeec2('0x1e')],_0x748dd9['id']),util[_0xeec2('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x594331(_0x43e0eb);});}else{return _0x594331(null,_0x53f250);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 72e404c..c4938f3 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 _0x10ad=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x22566a,_0xa0723f){var _0x1b8e3e=function(_0xdca8f4){while(--_0xdca8f4){_0x22566a['push'](_0x22566a['shift']());}};_0x1b8e3e(++_0xa0723f);}(_0x10ad,0xf4));var _0xd10a=function(_0xb1e6e0,_0x2a8ba9){_0xb1e6e0=_0xb1e6e0-0x0;var _0x342d16=_0x10ad[_0xb1e6e0];return _0x342d16;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd10a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd10a('0x1'));var db=require(_0xd10a('0x2'))['db'];var utils=require(_0xd10a('0x3'));var logger=require(_0xd10a('0x4'))('rpc');var config=require(_0xd10a('0x5'));var jayson=require(_0xd10a('0x6'));var client=jayson[_0xd10a('0x7')][_0xd10a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x429316,_0xdae354,_0x217329){return new BPromise(function(_0x194a4a,_0x5be3da){return client['request'](_0x429316,_0x217329)[_0xd10a('0x9')](function(_0x4d8613){logger[_0xd10a('0xa')](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));logger[_0xd10a('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xdae354,_0xd10a('0xc'),JSON[_0xd10a('0xe')](_0x4d8613));if(_0x4d8613[_0xd10a('0xf')]){if(_0x4d8613['error'][_0xd10a('0x10')]===0x1f4){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x5be3da(_0x4d8613[_0xd10a('0xf')]['message']);}logger['error'](_0xd10a('0xb'),_0xdae354,_0x4d8613[_0xd10a('0xf')][_0xd10a('0x11')]);return _0x194a4a(_0x4d8613[_0xd10a('0xf')]['message']);}else{logger['info'](_0xd10a('0xb'),_0xdae354,_0xd10a('0xc'));_0x194a4a(_0x4d8613[_0xd10a('0x12')][_0xd10a('0x11')]);}})[_0xd10a('0x13')](function(_0x33bb89){logger[_0xd10a('0xf')](_0xd10a('0xb'),_0xdae354,_0x33bb89);_0x5be3da(_0x33bb89);});});}exports[_0xd10a('0x14')]=function(_0x48a07b){var _0x589fb3=this;return new Promise(function(_0x40dd9f,_0x27d1a7){return db['ZohoAccount']['findAll']({'raw':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x16')]===undefined?!![]:![]:!![],'where':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x17')]||null:null,'attributes':_0x48a07b['options']?_0x48a07b['options'][_0xd10a('0x18')]||null:null,'limit':_0x48a07b['options']?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x19')]||null:null,'include':_0x48a07b[_0xd10a('0x15')]?_0x48a07b[_0xd10a('0x15')][_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x48a07b['options'][_0xd10a('0x1a')],function(_0x13eefe){return{'model':db[_0x13eefe[_0xd10a('0x1c')]],'as':_0x13eefe['as'],'attributes':_0x13eefe[_0xd10a('0x18')],'include':_0x13eefe[_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x13eefe[_0xd10a('0x1a')],function(_0x3715fe){return{'model':db[_0x3715fe['model']],'as':_0x3715fe['as'],'attributes':_0x3715fe['attributes'],'include':_0x3715fe['include']?_[_0xd10a('0x1b')](_0x3715fe[_0xd10a('0x1a')],function(_0x58f500){return{'model':db[_0x58f500[_0xd10a('0x1c')]],'as':_0x58f500['as'],'attributes':_0x58f500[_0xd10a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x9')](function(_0x152bd5){logger[_0xd10a('0xa')]('GetZohoAccount',_0x48a07b);logger[_0xd10a('0xd')](_0xd10a('0x14'),_0x48a07b,JSON[_0xd10a('0xe')](_0x152bd5));_0x40dd9f(_0x152bd5);})[_0xd10a('0x13')](function(_0x41e582){logger[_0xd10a('0xf')](_0xd10a('0x14'),_0x41e582[_0xd10a('0x11')],_0x48a07b);_0x27d1a7(_0x589fb3[_0xd10a('0xf')](0x1f4,_0x41e582[_0xd10a('0x11')]));});});};exports[_0xd10a('0x1d')]=function(_0x45e9fd){var _0x12ab07=this;return new Promise(function(_0xd7741,_0x4ad3d4){return db['ZohoAccount'][_0xd10a('0x1e')]({'raw':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')][_0xd10a('0x16')]===undefined?!![]:![]:!![],'where':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')]['where']||null:null,'attributes':_0x45e9fd[_0xd10a('0x15')]?_0x45e9fd[_0xd10a('0x15')]['attributes']||null:null,'include':_0x45e9fd['options']?_0x45e9fd[_0xd10a('0x15')][_0xd10a('0x1a')]?_[_0xd10a('0x1b')](_0x45e9fd[_0xd10a('0x15')]['include'],function(_0xa6aeeb){return{'model':db[_0xa6aeeb['model']],'as':_0xa6aeeb['as'],'attributes':_0xa6aeeb[_0xd10a('0x18')],'include':_0xa6aeeb['include']?_['map'](_0xa6aeeb[_0xd10a('0x1a')],function(_0x1bce2b){return{'model':db[_0x1bce2b[_0xd10a('0x1c')]],'as':_0x1bce2b['as'],'attributes':_0x1bce2b['attributes'],'include':_0x1bce2b[_0xd10a('0x1a')]?_['map'](_0x1bce2b[_0xd10a('0x1a')],function(_0x1ab0a2){return{'model':db[_0x1ab0a2[_0xd10a('0x1c')]],'as':_0x1ab0a2['as'],'attributes':_0x1ab0a2[_0xd10a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd10a('0x9')](function(_0x22ee6e){logger[_0xd10a('0xa')]('ShowZohoAccount',_0x45e9fd);logger[_0xd10a('0xd')](_0xd10a('0x1d'),_0x45e9fd,JSON[_0xd10a('0xe')](_0x22ee6e));_0xd7741(_0x22ee6e);})[_0xd10a('0x13')](function(_0x4997b0){logger[_0xd10a('0xf')](_0xd10a('0x1d'),_0x4997b0[_0xd10a('0x11')],_0x45e9fd);_0x4ad3d4(_0x12ab07['error'](0x1f4,_0x4997b0['message']));});});}; \ No newline at end of file +var _0x1aab=['options','raw','where','attributes','map','include','model','then','find','ShowZohoAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1aab,0x122));var _0xb1aa=function(_0x218490,_0x3b253d){_0x218490=_0x218490-0x0;var _0x4ca40f=_0x1aab[_0x218490];return _0x4ca40f;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x277448,_0x13a350,_0x283ad6){return new BPromise(function(_0x3415f7,_0x405387){return client[_0xb1aa('0xa')](_0x277448,_0x283ad6)['then'](function(_0x12067d){logger[_0xb1aa('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x13a350,_0xb1aa('0xc'));logger[_0xb1aa('0xd')](_0xb1aa('0xe'),_0x13a350,_0xb1aa('0xc'),JSON[_0xb1aa('0xf')](_0x12067d));if(_0x12067d[_0xb1aa('0x10')]){if(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x11')]===0x1f4){logger[_0xb1aa('0x10')](_0xb1aa('0x12'),_0x13a350,_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);return _0x405387(_0x12067d[_0xb1aa('0x10')][_0xb1aa('0x13')]);}logger[_0xb1aa('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x13a350,_0x12067d['error'][_0xb1aa('0x13')]);return _0x3415f7(_0x12067d['error'][_0xb1aa('0x13')]);}else{logger['info'](_0xb1aa('0x12'),_0x13a350,'request\x20sent');_0x3415f7(_0x12067d[_0xb1aa('0x14')]['message']);}})[_0xb1aa('0x15')](function(_0x408bf8){logger['error'](_0xb1aa('0x12'),_0x13a350,_0x408bf8);_0x405387(_0x408bf8);});});}exports[_0xb1aa('0x16')]=function(_0x1d1450){var _0x471116=this;return new Promise(function(_0x2c67f3,_0x19aa4c){return db[_0xb1aa('0x17')][_0xb1aa('0x18')]({'raw':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1b')]||null:null,'attributes':_0x1d1450['options']?_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1c')]||null:null,'limit':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')]['limit']||null:null,'include':_0x1d1450[_0xb1aa('0x19')]?_0x1d1450[_0xb1aa('0x19')]['include']?_[_0xb1aa('0x1d')](_0x1d1450[_0xb1aa('0x19')][_0xb1aa('0x1e')],function(_0x5f2aa7){return{'model':db[_0x5f2aa7['model']],'as':_0x5f2aa7['as'],'attributes':_0x5f2aa7[_0xb1aa('0x1c')],'include':_0x5f2aa7[_0xb1aa('0x1e')]?_[_0xb1aa('0x1d')](_0x5f2aa7[_0xb1aa('0x1e')],function(_0x3a9c9e){return{'model':db[_0x3a9c9e[_0xb1aa('0x1f')]],'as':_0x3a9c9e['as'],'attributes':_0x3a9c9e[_0xb1aa('0x1c')],'include':_0x3a9c9e[_0xb1aa('0x1e')]?_[_0xb1aa('0x1d')](_0x3a9c9e[_0xb1aa('0x1e')],function(_0x1cd714){return{'model':db[_0x1cd714[_0xb1aa('0x1f')]],'as':_0x1cd714['as'],'attributes':_0x1cd714[_0xb1aa('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x20')](function(_0x40c7ff){logger['info'](_0xb1aa('0x16'),_0x1d1450);logger[_0xb1aa('0xd')](_0xb1aa('0x16'),_0x1d1450,JSON[_0xb1aa('0xf')](_0x40c7ff));_0x2c67f3(_0x40c7ff);})['catch'](function(_0xa4a319){logger[_0xb1aa('0x10')]('GetZohoAccount',_0xa4a319[_0xb1aa('0x13')],_0x1d1450);_0x19aa4c(_0x471116[_0xb1aa('0x10')](0x1f4,_0xa4a319[_0xb1aa('0x13')]));});});};exports['ShowZohoAccount']=function(_0x25df88){var _0x120cc3=this;return new Promise(function(_0x4a785e,_0x4b8b7c){return db[_0xb1aa('0x17')][_0xb1aa('0x21')]({'raw':_0x25df88[_0xb1aa('0x19')]?_0x25df88[_0xb1aa('0x19')][_0xb1aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x25df88[_0xb1aa('0x19')]?_0x25df88['options'][_0xb1aa('0x1b')]||null:null,'attributes':_0x25df88['options']?_0x25df88['options']['attributes']||null:null,'include':_0x25df88[_0xb1aa('0x19')]?_0x25df88[_0xb1aa('0x19')][_0xb1aa('0x1e')]?_[_0xb1aa('0x1d')](_0x25df88[_0xb1aa('0x19')]['include'],function(_0x27a466){return{'model':db[_0x27a466[_0xb1aa('0x1f')]],'as':_0x27a466['as'],'attributes':_0x27a466[_0xb1aa('0x1c')],'include':_0x27a466['include']?_['map'](_0x27a466['include'],function(_0x4307b0){return{'model':db[_0x4307b0[_0xb1aa('0x1f')]],'as':_0x4307b0['as'],'attributes':_0x4307b0[_0xb1aa('0x1c')],'include':_0x4307b0[_0xb1aa('0x1e')]?_['map'](_0x4307b0[_0xb1aa('0x1e')],function(_0x8b71c){return{'model':db[_0x8b71c[_0xb1aa('0x1f')]],'as':_0x8b71c['as'],'attributes':_0x8b71c[_0xb1aa('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18989e){logger[_0xb1aa('0xb')](_0xb1aa('0x22'),_0x25df88);logger['debug'](_0xb1aa('0x22'),_0x25df88,JSON[_0xb1aa('0xf')](_0x18989e));_0x4a785e(_0x18989e);})[_0xb1aa('0x15')](function(_0x480ee3){logger[_0xb1aa('0x10')](_0xb1aa('0x22'),_0x480ee3[_0xb1aa('0x13')],_0x25df88);_0x4b8b7c(_0x120cc3[_0xb1aa('0x10')](0x1f4,_0x480ee3[_0xb1aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7eadf22..9ee82a2 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 _0x103f=['getFields','/:id/subjects','getDescriptions','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields'];(function(_0x25748b,_0x1b3f73){var _0x5068f1=function(_0x65ecc7){while(--_0x65ecc7){_0x25748b['push'](_0x25748b['shift']());}};_0x5068f1(++_0x1b3f73);}(_0x103f,0x17e));var _0xf103=function(_0x246df7,_0x2227f3){_0x246df7=_0x246df7-0x0;var _0x5d7ede=_0x103f[_0x246df7];return _0x5d7ede;};'use strict';var multer=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var path=require(_0xf103('0x2'));var timeout=require(_0xf103('0x3'));var express=require('express');var router=express[_0xf103('0x4')]();var fs_extra=require(_0xf103('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf103('0x6'));var config=require(_0xf103('0x7'));var controller=require(_0xf103('0x8'));router[_0xf103('0x9')]('/',auth[_0xf103('0xa')](),controller['index']);router[_0xf103('0x9')](_0xf103('0xb'),auth[_0xf103('0xa')](),controller[_0xf103('0xc')]);router[_0xf103('0x9')](_0xf103('0xd'),auth[_0xf103('0xa')](),controller[_0xf103('0xe')]);router[_0xf103('0x9')](_0xf103('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf103('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf103('0x10')]);router[_0xf103('0x11')]('/',auth[_0xf103('0xa')](),controller[_0xf103('0x12')]);router['put'](_0xf103('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf103('0x13')]('/:id',auth[_0xf103('0xa')](),controller[_0xf103('0x14')]);module[_0xf103('0x15')]=router; \ No newline at end of file +var _0xf0ad=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x5d74c6,_0x5c6fa1){var _0x948e92=function(_0x2fb54e){while(--_0x2fb54e){_0x5d74c6['push'](_0x5d74c6['shift']());}};_0x948e92(++_0x5c6fa1);}(_0xf0ad,0xe6));var _0xdf0a=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xf0ad[_0x1347f8];return _0x218368;};'use strict';var multer=require(_0xdf0a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf0a('0x1'));var express=require(_0xdf0a('0x2'));var router=express[_0xdf0a('0x3')]();var fs_extra=require(_0xdf0a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdf0a('0x5'));var controller=require(_0xdf0a('0x6'));router[_0xdf0a('0x7')]('/',auth[_0xdf0a('0x8')](),controller[_0xdf0a('0x9')]);router[_0xdf0a('0x7')](_0xdf0a('0xa'),auth[_0xdf0a('0x8')](),controller[_0xdf0a('0xb')]);router[_0xdf0a('0x7')](_0xdf0a('0xc'),auth[_0xdf0a('0x8')](),controller[_0xdf0a('0xd')]);router[_0xdf0a('0x7')](_0xdf0a('0xe'),auth[_0xdf0a('0x8')](),controller[_0xdf0a('0xf')]);router[_0xdf0a('0x7')](_0xdf0a('0x10'),auth[_0xdf0a('0x8')](),controller['getDescriptions']);router[_0xdf0a('0x11')]('/',auth['isAuthenticated'](),controller[_0xdf0a('0x12')]);router[_0xdf0a('0x13')]('/:id',auth[_0xdf0a('0x8')](),controller[_0xdf0a('0x14')]);router[_0xdf0a('0x15')]('/:id',auth[_0xdf0a('0x8')](),controller[_0xdf0a('0x16')]);module[_0xdf0a('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index eeff3cc..800e23d 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 _0xaced=['ENUM','lead','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x4a726e,_0x2ed66e){var _0x3650e3=function(_0x21f2e3){while(--_0x21f2e3){_0x4a726e['push'](_0x4a726e['shift']());}};_0x3650e3(++_0x2ed66e);}(_0xaced,0x18c));var _0xdace=function(_0x5023e8,_0x7e0cbc){_0x5023e8=_0x5023e8-0x0;var _0x4b9e26=_0xaced[_0x5023e8];return _0x4b9e26;};'use strict';var Sequelize=require(_0xdace('0x0'));module[_0xdace('0x1')]={'name':{'type':Sequelize[_0xdace('0x2')]},'moduleCreate':{'type':Sequelize[_0xdace('0x3')](_0xdace('0x4'),'contact',_0xdace('0x5')),'defaultValue':_0xdace('0x4')},'moduleSearch':{'type':Sequelize[_0xdace('0x3')](_0xdace('0x6'),'contact',_0xdace('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb660=['STRING','sequelize','exports','ENUM','lead','nothing','contact','contact_lead'];(function(_0x58ee27,_0x2eb40a){var _0x3053b2=function(_0x18e96b){while(--_0x18e96b){_0x58ee27['push'](_0x58ee27['shift']());}};_0x3053b2(++_0x2eb40a);}(_0xb660,0x179));var _0x0b66=function(_0x7fab38,_0x501063){_0x7fab38=_0x7fab38-0x0;var _0xb5c718=_0xb660[_0x7fab38];return _0xb5c718;};'use strict';var Sequelize=require(_0x0b66('0x0'));module[_0x0b66('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x0b66('0x2')](_0x0b66('0x3'),'contact',_0x0b66('0x4')),'defaultValue':_0x0b66('0x3')},'moduleSearch':{'type':Sequelize[_0x0b66('0x2')]('contact_lead',_0x0b66('0x5'),_0x0b66('0x3')),'defaultValue':_0x0b66('0x6')},'description':{'type':Sequelize[_0x0b66('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 09f97c2..477c14c 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 _0x5c39=['update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','ZohoConfiguration','include','rows','show','params','length','catch','create','body','find','destroy','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x5c39,0xd0));var _0x95c3=function(_0x506800,_0x1f947f){_0x506800=_0x506800-0x0;var _0x5bdd2e=_0x5c39[_0x506800];return _0x5bdd2e;};'use strict';var emlformat=require(_0x95c3('0x0'));var rimraf=require(_0x95c3('0x1'));var zipdir=require(_0x95c3('0x2'));var jsonpatch=require(_0x95c3('0x3'));var rp=require(_0x95c3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95c3('0x5'));var util=require(_0x95c3('0x6'));var path=require(_0x95c3('0x7'));var sox=require(_0x95c3('0x8'));var csv=require(_0x95c3('0x9'));var ejs=require(_0x95c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95c3('0xb'));var squel=require(_0x95c3('0xc'));var crypto=require(_0x95c3('0xd'));var jsforce=require(_0x95c3('0xe'));var deskjs=require(_0x95c3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x95c3('0x10'));var Papa=require(_0x95c3('0x11'));var Redis=require(_0x95c3('0x12'));var authService=require(_0x95c3('0x13'));var qs=require(_0x95c3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95c3('0x15'))(_0x95c3('0x16'));var utils=require(_0x95c3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x95c3('0x18'));var db=require(_0x95c3('0x19'))['db'];function respondWithStatusCode(_0x76fb5e,_0x22976c){_0x22976c=_0x22976c||0xcc;return function(_0x327ef1){if(_0x327ef1){return _0x76fb5e[_0x95c3('0x1a')](_0x22976c);}return _0x76fb5e[_0x95c3('0x1b')](_0x22976c)[_0x95c3('0x1c')]();};}function respondWithResult(_0x10d821,_0x27ea7b){_0x27ea7b=_0x27ea7b||0xc8;return function(_0x5eb068){if(_0x5eb068){return _0x10d821[_0x95c3('0x1b')](_0x27ea7b)['json'](_0x5eb068);}};}function respondWithFilteredResult(_0x1a3d65,_0x491b65){return function(_0x1b23e8){if(_0x1b23e8){var _0x1c4c63=typeof _0x491b65['offset']==='undefined'&&typeof _0x491b65[_0x95c3('0x1d')]===_0x95c3('0x1e');var _0x4d48df=_0x1b23e8[_0x95c3('0x1f')];var _0x355d0d=_0x1c4c63?0x0:_0x491b65[_0x95c3('0x20')];var _0x53c4b4=_0x1c4c63?_0x1b23e8[_0x95c3('0x1f')]:_0x491b65[_0x95c3('0x20')]+_0x491b65[_0x95c3('0x1d')];var _0x21abf9;if(_0x53c4b4>=_0x4d48df){_0x53c4b4=_0x4d48df;_0x21abf9=0xc8;}else{_0x21abf9=0xce;}_0x1a3d65[_0x95c3('0x1b')](_0x21abf9);return _0x1a3d65['set'](_0x95c3('0x21'),_0x355d0d+'-'+_0x53c4b4+'/'+_0x4d48df)[_0x95c3('0x22')](_0x1b23e8);}return null;};}function patchUpdates(_0x1836a5){return function(_0x19496c){try{jsonpatch[_0x95c3('0x23')](_0x19496c,_0x1836a5,!![]);}catch(_0x296368){return BPromise[_0x95c3('0x24')](_0x296368);}return _0x19496c[_0x95c3('0x25')]();};}function saveUpdates(_0x16e087,_0x1f3edc){return function(_0x9c6a62){if(_0x9c6a62){return _0x9c6a62[_0x95c3('0x26')](_0x16e087)[_0x95c3('0x27')](function(_0x56c1cf){return _0x56c1cf;});}return null;};}function removeEntity(_0x5c15a3,_0x3d3d22){return function(_0x20e117){if(_0x20e117){return _0x20e117['destroy']()['then'](function(){_0x5c15a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x247806,_0x38c0ef){return function(_0x198ddd){if(!_0x198ddd){_0x247806[_0x95c3('0x1a')](0x194);}return _0x198ddd;};}function handleError(_0x3041c2,_0x446243){_0x446243=_0x446243||0x1f4;return function(_0x190960){logger[_0x95c3('0x28')](_0x190960[_0x95c3('0x29')]);if(_0x190960['name']){delete _0x190960[_0x95c3('0x2a')];}_0x3041c2[_0x95c3('0x1b')](_0x446243)['send'](_0x190960);};}exports[_0x95c3('0x2b')]=function(_0x311f33,_0x5388c7){var _0x492211={},_0x50cc23={},_0xc4c959={'count':0x0,'rows':[]};var _0x5a1e8d=_['map'](db['ZohoConfiguration'][_0x95c3('0x2c')],function(_0x45f59d){return{'name':_0x45f59d[_0x95c3('0x2d')],'type':_0x45f59d['type'][_0x95c3('0x2e')]};});_0x50cc23[_0x95c3('0x2f')]=_[_0x95c3('0x30')](_0x5a1e8d,'name');_0x50cc23[_0x95c3('0x31')]=_[_0x95c3('0x32')](_0x311f33['query']);_0x50cc23[_0x95c3('0x33')]=_['intersection'](_0x50cc23[_0x95c3('0x2f')],_0x50cc23[_0x95c3('0x31')]);_0x492211[_0x95c3('0x34')]=_[_0x95c3('0x35')](_0x50cc23[_0x95c3('0x2f')],qs['fields'](_0x311f33[_0x95c3('0x31')][_0x95c3('0x36')]));_0x492211[_0x95c3('0x34')]=_0x492211['attributes']['length']?_0x492211['attributes']:_0x50cc23[_0x95c3('0x2f')];if(!_0x311f33[_0x95c3('0x31')][_0x95c3('0x37')](_0x95c3('0x38'))){_0x492211['limit']=qs['limit'](_0x311f33['query'][_0x95c3('0x1d')]);_0x492211[_0x95c3('0x20')]=qs['offset'](_0x311f33[_0x95c3('0x31')][_0x95c3('0x20')]);}_0x492211[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x311f33['query']['sort']);_0x492211['where']=qs['filters'](_[_0x95c3('0x3b')](_0x311f33['query'],_0x50cc23['filters']),_0x5a1e8d);if(_0x311f33[_0x95c3('0x31')][_0x95c3('0x3c')]){_0x492211['where']=_[_0x95c3('0x3d')](_0x492211['where'],{'$or':_[_0x95c3('0x30')](_0x5a1e8d,function(_0x48c25e){if(_0x48c25e[_0x95c3('0x3e')]!==_0x95c3('0x3f')){var _0x2c8ba0={};_0x2c8ba0[_0x48c25e['name']]={'$like':'%'+_0x311f33[_0x95c3('0x31')]['filter']+'%'};return _0x2c8ba0;}})});}_0x492211=_[_0x95c3('0x3d')]({},_0x492211,_0x311f33[_0x95c3('0x40')]);var _0x13e383={'where':_0x492211[_0x95c3('0x41')]};return db[_0x95c3('0x42')]['count'](_0x13e383)[_0x95c3('0x27')](function(_0x52d733){_0xc4c959['count']=_0x52d733;if(_0x311f33[_0x95c3('0x31')]['includeAll']){_0x492211[_0x95c3('0x43')]=[{'all':!![]}];}return db[_0x95c3('0x42')]['findAll'](_0x492211);})[_0x95c3('0x27')](function(_0x12992c){_0xc4c959[_0x95c3('0x44')]=_0x12992c;return _0xc4c959;})[_0x95c3('0x27')](respondWithFilteredResult(_0x5388c7,_0x492211))['catch'](handleError(_0x5388c7,null));};exports[_0x95c3('0x45')]=function(_0x371dd2,_0xede6ce){var _0x3711c9={'raw':![],'where':{'id':_0x371dd2[_0x95c3('0x46')]['id']}},_0x233c01={};_0x233c01[_0x95c3('0x2f')]=_[_0x95c3('0x32')](db[_0x95c3('0x42')][_0x95c3('0x2c')]);_0x233c01[_0x95c3('0x31')]=_[_0x95c3('0x32')](_0x371dd2[_0x95c3('0x31')]);_0x233c01['filters']=_[_0x95c3('0x35')](_0x233c01[_0x95c3('0x2f')],_0x233c01[_0x95c3('0x31')]);_0x3711c9[_0x95c3('0x34')]=_[_0x95c3('0x35')](_0x233c01[_0x95c3('0x2f')],qs[_0x95c3('0x36')](_0x371dd2[_0x95c3('0x31')]['fields']));_0x3711c9[_0x95c3('0x34')]=_0x3711c9['attributes'][_0x95c3('0x47')]?_0x3711c9[_0x95c3('0x34')]:_0x233c01[_0x95c3('0x2f')];if(_0x371dd2[_0x95c3('0x31')]['includeAll']){_0x3711c9[_0x95c3('0x43')]=[{'all':!![]}];}_0x3711c9=_['merge']({},_0x3711c9,_0x371dd2[_0x95c3('0x40')]);return db[_0x95c3('0x42')]['find'](_0x3711c9)[_0x95c3('0x27')](handleEntityNotFound(_0xede6ce,null))[_0x95c3('0x27')](respondWithResult(_0xede6ce,null))[_0x95c3('0x48')](handleError(_0xede6ce,null));};exports[_0x95c3('0x49')]=function(_0x3c2c42,_0x5449d7){return db['ZohoConfiguration'][_0x95c3('0x49')](_0x3c2c42[_0x95c3('0x4a')],{})[_0x95c3('0x27')](respondWithResult(_0x5449d7,0xc9))[_0x95c3('0x48')](handleError(_0x5449d7,null));};exports[_0x95c3('0x26')]=function(_0x4d9fef,_0x5929f1){if(_0x4d9fef[_0x95c3('0x4a')]['id']){delete _0x4d9fef[_0x95c3('0x4a')]['id'];}return db[_0x95c3('0x42')][_0x95c3('0x4b')]({'where':{'id':_0x4d9fef['params']['id']}})[_0x95c3('0x27')](handleEntityNotFound(_0x5929f1,null))[_0x95c3('0x27')](saveUpdates(_0x4d9fef[_0x95c3('0x4a')],null))[_0x95c3('0x27')](respondWithResult(_0x5929f1,null))[_0x95c3('0x48')](handleError(_0x5929f1,null));};exports[_0x95c3('0x4c')]=function(_0x2a0570,_0x28c8df){return db[_0x95c3('0x42')][_0x95c3('0x4b')]({'where':{'id':_0x2a0570[_0x95c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x28c8df,null))['then'](removeEntity(_0x28c8df,null))[_0x95c3('0x48')](handleError(_0x28c8df,null));};exports['getFields']=function(_0x5c2342,_0x2545e9,_0x2db6e3){var _0x1c80b6={};var _0x1e2e5f={};var _0x35cffe;var _0x3fbc8d;return db[_0x95c3('0x42')][_0x95c3('0x4d')]({'where':{'id':_0x5c2342[_0x95c3('0x46')]['id']}})[_0x95c3('0x27')](handleEntityNotFound(_0x2545e9,null))['then'](function(_0x517f8e){if(_0x517f8e){_0x35cffe=_0x517f8e;_0x1e2e5f[_0x95c3('0x2f')]=_[_0x95c3('0x32')](db[_0x95c3('0x4e')]['rawAttributes']);_0x1e2e5f['query']=_[_0x95c3('0x32')](_0x5c2342[_0x95c3('0x31')]);_0x1e2e5f[_0x95c3('0x33')]=_[_0x95c3('0x35')](_0x1e2e5f['model'],_0x1e2e5f[_0x95c3('0x31')]);_0x1c80b6['attributes']=_[_0x95c3('0x35')](_0x1e2e5f[_0x95c3('0x2f')],qs['fields'](_0x5c2342[_0x95c3('0x31')][_0x95c3('0x36')]));_0x1c80b6[_0x95c3('0x34')]=_0x1c80b6['attributes']['length']?_0x1c80b6[_0x95c3('0x34')]:_0x1e2e5f[_0x95c3('0x2f')];_0x1c80b6[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x5c2342[_0x95c3('0x31')][_0x95c3('0x3a')]);_0x1c80b6[_0x95c3('0x41')]=qs[_0x95c3('0x33')](_[_0x95c3('0x3b')](_0x5c2342[_0x95c3('0x31')],_0x1e2e5f[_0x95c3('0x33')]));if(_0x5c2342[_0x95c3('0x31')][_0x95c3('0x3c')]){_0x1c80b6[_0x95c3('0x41')]=_[_0x95c3('0x3d')](_0x1c80b6['where'],{'$or':_[_0x95c3('0x30')](_0x1c80b6[_0x95c3('0x34')],function(_0x165f56){var _0xb53646={};_0xb53646[_0x165f56]={'$like':'%'+_0x5c2342[_0x95c3('0x31')][_0x95c3('0x3c')]+'%'};return _0xb53646;})});}_0x1c80b6=_['merge']({},_0x1c80b6,_0x5c2342[_0x95c3('0x40')]);return _0x35cffe[_0x95c3('0x4f')](_0x1c80b6);}})[_0x95c3('0x27')](function(_0x8c188b){if(_0x8c188b){_0x3fbc8d=_0x8c188b[_0x95c3('0x47')];if(!_0x5c2342[_0x95c3('0x31')]['hasOwnProperty'](_0x95c3('0x38'))){_0x1c80b6[_0x95c3('0x1d')]=qs[_0x95c3('0x1d')](_0x5c2342[_0x95c3('0x31')][_0x95c3('0x1d')]);_0x1c80b6['offset']=qs[_0x95c3('0x20')](_0x5c2342[_0x95c3('0x31')]['offset']);}return _0x35cffe['getFields'](_0x1c80b6);}})[_0x95c3('0x27')](function(_0x2fa298){if(_0x2fa298){return _0x2fa298?{'count':_0x3fbc8d,'rows':_0x2fa298}:null;}})[_0x95c3('0x27')](respondWithResult(_0x2545e9,null))[_0x95c3('0x48')](handleError(_0x2545e9,null));};exports[_0x95c3('0x50')]=function(_0x5d6eac,_0x12593a,_0x131f25){var _0x3b0f06={};var _0x158795={};var _0x43188d;var _0x399c1a;return db[_0x95c3('0x42')][_0x95c3('0x4d')]({'where':{'id':_0x5d6eac[_0x95c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x12593a,null))['then'](function(_0x298e35){if(_0x298e35){_0x43188d=_0x298e35;_0x158795[_0x95c3('0x2f')]=_['keys'](db[_0x95c3('0x4e')][_0x95c3('0x2c')]);_0x158795[_0x95c3('0x31')]=_[_0x95c3('0x32')](_0x5d6eac[_0x95c3('0x31')]);_0x158795[_0x95c3('0x33')]=_[_0x95c3('0x35')](_0x158795[_0x95c3('0x2f')],_0x158795[_0x95c3('0x31')]);_0x3b0f06['attributes']=_[_0x95c3('0x35')](_0x158795[_0x95c3('0x2f')],qs[_0x95c3('0x36')](_0x5d6eac['query'][_0x95c3('0x36')]));_0x3b0f06[_0x95c3('0x34')]=_0x3b0f06[_0x95c3('0x34')][_0x95c3('0x47')]?_0x3b0f06[_0x95c3('0x34')]:_0x158795[_0x95c3('0x2f')];_0x3b0f06[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x5d6eac['query'][_0x95c3('0x3a')]);_0x3b0f06['where']=qs[_0x95c3('0x33')](_['pick'](_0x5d6eac['query'],_0x158795[_0x95c3('0x33')]));if(_0x5d6eac[_0x95c3('0x31')][_0x95c3('0x3c')]){_0x3b0f06[_0x95c3('0x41')]=_[_0x95c3('0x3d')](_0x3b0f06[_0x95c3('0x41')],{'$or':_['map'](_0x3b0f06[_0x95c3('0x34')],function(_0x57ce32){var _0x2c360b={};_0x2c360b[_0x57ce32]={'$like':'%'+_0x5d6eac[_0x95c3('0x31')][_0x95c3('0x3c')]+'%'};return _0x2c360b;})});}_0x3b0f06=_[_0x95c3('0x3d')]({},_0x3b0f06,_0x5d6eac[_0x95c3('0x40')]);return _0x43188d[_0x95c3('0x50')](_0x3b0f06);}})['then'](function(_0x5a0fca){if(_0x5a0fca){_0x399c1a=_0x5a0fca[_0x95c3('0x47')];if(!_0x5d6eac['query'][_0x95c3('0x37')](_0x95c3('0x38'))){_0x3b0f06[_0x95c3('0x1d')]=qs[_0x95c3('0x1d')](_0x5d6eac[_0x95c3('0x31')][_0x95c3('0x1d')]);_0x3b0f06['offset']=qs[_0x95c3('0x20')](_0x5d6eac['query']['offset']);}return _0x43188d[_0x95c3('0x50')](_0x3b0f06);}})[_0x95c3('0x27')](function(_0x1ac3f1){if(_0x1ac3f1){return _0x1ac3f1?{'count':_0x399c1a,'rows':_0x1ac3f1}:null;}})[_0x95c3('0x27')](respondWithResult(_0x12593a,null))['catch'](handleError(_0x12593a,null));};exports[_0x95c3('0x51')]=function(_0x3a20d0,_0x16aee9,_0x3e50f8){var _0x47e57d={};var _0xaba053={};var _0x593233;var _0x5b4789;return db[_0x95c3('0x42')][_0x95c3('0x4d')]({'where':{'id':_0x3a20d0['params']['id']}})['then'](handleEntityNotFound(_0x16aee9,null))[_0x95c3('0x27')](function(_0x6b6cd0){if(_0x6b6cd0){_0x593233=_0x6b6cd0;_0xaba053[_0x95c3('0x2f')]=_[_0x95c3('0x32')](db[_0x95c3('0x4e')]['rawAttributes']);_0xaba053[_0x95c3('0x31')]=_['keys'](_0x3a20d0[_0x95c3('0x31')]);_0xaba053[_0x95c3('0x33')]=_['intersection'](_0xaba053[_0x95c3('0x2f')],_0xaba053[_0x95c3('0x31')]);_0x47e57d[_0x95c3('0x34')]=_['intersection'](_0xaba053[_0x95c3('0x2f')],qs[_0x95c3('0x36')](_0x3a20d0['query'][_0x95c3('0x36')]));_0x47e57d[_0x95c3('0x34')]=_0x47e57d['attributes'][_0x95c3('0x47')]?_0x47e57d[_0x95c3('0x34')]:_0xaba053[_0x95c3('0x2f')];_0x47e57d[_0x95c3('0x39')]=qs[_0x95c3('0x3a')](_0x3a20d0['query'][_0x95c3('0x3a')]);_0x47e57d[_0x95c3('0x41')]=qs['filters'](_[_0x95c3('0x3b')](_0x3a20d0[_0x95c3('0x31')],_0xaba053['filters']));if(_0x3a20d0[_0x95c3('0x31')]['filter']){_0x47e57d['where']=_['merge'](_0x47e57d[_0x95c3('0x41')],{'$or':_['map'](_0x47e57d[_0x95c3('0x34')],function(_0x3018ab){var _0x23a4b7={};_0x23a4b7[_0x3018ab]={'$like':'%'+_0x3a20d0[_0x95c3('0x31')][_0x95c3('0x3c')]+'%'};return _0x23a4b7;})});}_0x47e57d=_[_0x95c3('0x3d')]({},_0x47e57d,_0x3a20d0['options']);return _0x593233[_0x95c3('0x51')](_0x47e57d);}})[_0x95c3('0x27')](function(_0x214200){if(_0x214200){_0x5b4789=_0x214200[_0x95c3('0x47')];if(!_0x3a20d0['query']['hasOwnProperty'](_0x95c3('0x38'))){_0x47e57d[_0x95c3('0x1d')]=qs[_0x95c3('0x1d')](_0x3a20d0[_0x95c3('0x31')][_0x95c3('0x1d')]);_0x47e57d['offset']=qs[_0x95c3('0x20')](_0x3a20d0[_0x95c3('0x31')][_0x95c3('0x20')]);}return _0x593233[_0x95c3('0x51')](_0x47e57d);}})[_0x95c3('0x27')](function(_0x3e7158){if(_0x3e7158){return _0x3e7158?{'count':_0x5b4789,'rows':_0x3e7158}:null;}})[_0x95c3('0x27')](respondWithResult(_0x16aee9,null))[_0x95c3('0x48')](handleError(_0x16aee9,null));}; \ No newline at end of file +var _0x3ae5=['name','send','index','map','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','ZohoConfiguration','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','update','destroy','params','getFields','getSubjects','findOne','ZohoField','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack'];(function(_0x576618,_0x2eb146){var _0x3cbfeb=function(_0x31c065){while(--_0x31c065){_0x576618['push'](_0x576618['shift']());}};_0x3cbfeb(++_0x2eb146);}(_0x3ae5,0x175));var _0x53ae=function(_0x560141,_0x58524c){_0x560141=_0x560141-0x0;var _0x2a4ec3=_0x3ae5[_0x560141];return _0x2a4ec3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x53ae('0x0'));var jsonpatch=require(_0x53ae('0x1'));var rp=require(_0x53ae('0x2'));var moment=require(_0x53ae('0x3'));var BPromise=require(_0x53ae('0x4'));var Mustache=require(_0x53ae('0x5'));var util=require(_0x53ae('0x6'));var path=require(_0x53ae('0x7'));var sox=require('sox');var csv=require(_0x53ae('0x8'));var ejs=require(_0x53ae('0x9'));var fs=require('fs');var fs_extra=require(_0x53ae('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x53ae('0xb'));var jsforce=require(_0x53ae('0xc'));var deskjs=require(_0x53ae('0xd'));var toCsv=require(_0x53ae('0x8'));var querystring=require(_0x53ae('0xe'));var Papa=require(_0x53ae('0xf'));var Redis=require(_0x53ae('0x10'));var authService=require(_0x53ae('0x11'));var qs=require(_0x53ae('0x12'));var as=require(_0x53ae('0x13'));var hardwareService=require(_0x53ae('0x14'));var logger=require(_0x53ae('0x15'))(_0x53ae('0x16'));var utils=require(_0x53ae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x53ae('0x18'));var db=require(_0x53ae('0x19'))['db'];function respondWithStatusCode(_0x2f8e6e,_0x1f1595){_0x1f1595=_0x1f1595||0xcc;return function(_0x1c4fa1){if(_0x1c4fa1){return _0x2f8e6e['sendStatus'](_0x1f1595);}return _0x2f8e6e[_0x53ae('0x1a')](_0x1f1595)[_0x53ae('0x1b')]();};}function respondWithResult(_0x591c51,_0x33c099){_0x33c099=_0x33c099||0xc8;return function(_0x4ea233){if(_0x4ea233){return _0x591c51['status'](_0x33c099)[_0x53ae('0x1c')](_0x4ea233);}};}function respondWithFilteredResult(_0x42fb62,_0x1d71d0){return function(_0xf0d57f){if(_0xf0d57f){var _0x1a0239=typeof _0x1d71d0['offset']===_0x53ae('0x1d')&&typeof _0x1d71d0[_0x53ae('0x1e')]==='undefined';var _0x23bbb3=_0xf0d57f[_0x53ae('0x1f')];var _0x5b3a70=_0x1a0239?0x0:_0x1d71d0[_0x53ae('0x20')];var _0x255984=_0x1a0239?_0xf0d57f['count']:_0x1d71d0['offset']+_0x1d71d0['limit'];var _0x5ecaa3;if(_0x255984>=_0x23bbb3){_0x255984=_0x23bbb3;_0x5ecaa3=0xc8;}else{_0x5ecaa3=0xce;}_0x42fb62[_0x53ae('0x1a')](_0x5ecaa3);return _0x42fb62[_0x53ae('0x21')](_0x53ae('0x22'),_0x5b3a70+'-'+_0x255984+'/'+_0x23bbb3)[_0x53ae('0x1c')](_0xf0d57f);}return null;};}function patchUpdates(_0x256712){return function(_0x518c8b){try{jsonpatch[_0x53ae('0x23')](_0x518c8b,_0x256712,!![]);}catch(_0x3c6e1f){return BPromise[_0x53ae('0x24')](_0x3c6e1f);}return _0x518c8b[_0x53ae('0x25')]();};}function saveUpdates(_0x577ef1,_0x18e9d1){return function(_0x4f35e5){if(_0x4f35e5){return _0x4f35e5['update'](_0x577ef1)['then'](function(_0x2af1af){return _0x2af1af;});}return null;};}function removeEntity(_0x1d1c90,_0x5cdb47){return function(_0x510c57){if(_0x510c57){return _0x510c57['destroy']()[_0x53ae('0x26')](function(){_0x1d1c90[_0x53ae('0x1a')](0xcc)[_0x53ae('0x1b')]();});}};}function handleEntityNotFound(_0x27cb8f,_0x30ec2e){return function(_0xdff7b0){if(!_0xdff7b0){_0x27cb8f[_0x53ae('0x27')](0x194);}return _0xdff7b0;};}function handleError(_0x21c400,_0x493e4e){_0x493e4e=_0x493e4e||0x1f4;return function(_0x3c27f9){logger[_0x53ae('0x28')](_0x3c27f9[_0x53ae('0x29')]);if(_0x3c27f9[_0x53ae('0x2a')]){delete _0x3c27f9[_0x53ae('0x2a')];}_0x21c400[_0x53ae('0x1a')](_0x493e4e)[_0x53ae('0x2b')](_0x3c27f9);};}exports[_0x53ae('0x2c')]=function(_0x39a23c,_0x19aa2f){var _0x2050db={},_0x19036d={},_0xca65a0={'count':0x0,'rows':[]};var _0x4616c9=_[_0x53ae('0x2d')](db['ZohoConfiguration']['rawAttributes'],function(_0x40f18e){return{'name':_0x40f18e['fieldName'],'type':_0x40f18e[_0x53ae('0x2e')][_0x53ae('0x2f')]};});_0x19036d[_0x53ae('0x30')]=_[_0x53ae('0x2d')](_0x4616c9,'name');_0x19036d[_0x53ae('0x31')]=_[_0x53ae('0x32')](_0x39a23c[_0x53ae('0x31')]);_0x19036d['filters']=_[_0x53ae('0x33')](_0x19036d[_0x53ae('0x30')],_0x19036d[_0x53ae('0x31')]);_0x2050db['attributes']=_[_0x53ae('0x33')](_0x19036d['model'],qs[_0x53ae('0x34')](_0x39a23c[_0x53ae('0x31')][_0x53ae('0x34')]));_0x2050db[_0x53ae('0x35')]=_0x2050db[_0x53ae('0x35')][_0x53ae('0x36')]?_0x2050db[_0x53ae('0x35')]:_0x19036d['model'];if(!_0x39a23c[_0x53ae('0x31')][_0x53ae('0x37')](_0x53ae('0x38'))){_0x2050db['limit']=qs[_0x53ae('0x1e')](_0x39a23c[_0x53ae('0x31')][_0x53ae('0x1e')]);_0x2050db[_0x53ae('0x20')]=qs[_0x53ae('0x20')](_0x39a23c['query'][_0x53ae('0x20')]);}_0x2050db[_0x53ae('0x39')]=qs[_0x53ae('0x3a')](_0x39a23c[_0x53ae('0x31')][_0x53ae('0x3a')]);_0x2050db[_0x53ae('0x3b')]=qs[_0x53ae('0x3c')](_[_0x53ae('0x3d')](_0x39a23c[_0x53ae('0x31')],_0x19036d[_0x53ae('0x3c')]),_0x4616c9);if(_0x39a23c[_0x53ae('0x31')][_0x53ae('0x3e')]){_0x2050db['where']=_['merge'](_0x2050db[_0x53ae('0x3b')],{'$or':_['map'](_0x4616c9,function(_0x1c5b32){if(_0x1c5b32[_0x53ae('0x2e')]!=='VIRTUAL'){var _0x367a2e={};_0x367a2e[_0x1c5b32['name']]={'$like':'%'+_0x39a23c['query']['filter']+'%'};return _0x367a2e;}})});}_0x2050db=_[_0x53ae('0x3f')]({},_0x2050db,_0x39a23c[_0x53ae('0x40')]);var _0x33b454={'where':_0x2050db[_0x53ae('0x3b')]};return db[_0x53ae('0x41')][_0x53ae('0x1f')](_0x33b454)[_0x53ae('0x26')](function(_0x57c41d){_0xca65a0[_0x53ae('0x1f')]=_0x57c41d;if(_0x39a23c[_0x53ae('0x31')][_0x53ae('0x42')]){_0x2050db[_0x53ae('0x43')]=[{'all':!![]}];}return db[_0x53ae('0x41')][_0x53ae('0x44')](_0x2050db);})[_0x53ae('0x26')](function(_0x3d6b89){_0xca65a0['rows']=_0x3d6b89;return _0xca65a0;})[_0x53ae('0x26')](respondWithFilteredResult(_0x19aa2f,_0x2050db))[_0x53ae('0x45')](handleError(_0x19aa2f,null));};exports[_0x53ae('0x46')]=function(_0x38ccd0,_0x11f9bb){var _0x2bc6d4={'raw':![],'where':{'id':_0x38ccd0['params']['id']}},_0x3ea13e={};_0x3ea13e['model']=_[_0x53ae('0x32')](db['ZohoConfiguration'][_0x53ae('0x47')]);_0x3ea13e[_0x53ae('0x31')]=_[_0x53ae('0x32')](_0x38ccd0[_0x53ae('0x31')]);_0x3ea13e[_0x53ae('0x3c')]=_['intersection'](_0x3ea13e[_0x53ae('0x30')],_0x3ea13e[_0x53ae('0x31')]);_0x2bc6d4[_0x53ae('0x35')]=_['intersection'](_0x3ea13e['model'],qs[_0x53ae('0x34')](_0x38ccd0[_0x53ae('0x31')][_0x53ae('0x34')]));_0x2bc6d4[_0x53ae('0x35')]=_0x2bc6d4[_0x53ae('0x35')][_0x53ae('0x36')]?_0x2bc6d4[_0x53ae('0x35')]:_0x3ea13e[_0x53ae('0x30')];if(_0x38ccd0[_0x53ae('0x31')][_0x53ae('0x42')]){_0x2bc6d4[_0x53ae('0x43')]=[{'all':!![]}];}_0x2bc6d4=_['merge']({},_0x2bc6d4,_0x38ccd0[_0x53ae('0x40')]);return db[_0x53ae('0x41')][_0x53ae('0x48')](_0x2bc6d4)['then'](handleEntityNotFound(_0x11f9bb,null))[_0x53ae('0x26')](respondWithResult(_0x11f9bb,null))[_0x53ae('0x45')](handleError(_0x11f9bb,null));};exports[_0x53ae('0x49')]=function(_0x203510,_0x355879){return db['ZohoConfiguration'][_0x53ae('0x49')](_0x203510[_0x53ae('0x4a')],{})[_0x53ae('0x26')](respondWithResult(_0x355879,0xc9))[_0x53ae('0x45')](handleError(_0x355879,null));};exports[_0x53ae('0x4b')]=function(_0x4d804a,_0x5444ed){if(_0x4d804a['body']['id']){delete _0x4d804a[_0x53ae('0x4a')]['id'];}return db[_0x53ae('0x41')][_0x53ae('0x48')]({'where':{'id':_0x4d804a['params']['id']}})['then'](handleEntityNotFound(_0x5444ed,null))[_0x53ae('0x26')](saveUpdates(_0x4d804a[_0x53ae('0x4a')],null))[_0x53ae('0x26')](respondWithResult(_0x5444ed,null))[_0x53ae('0x45')](handleError(_0x5444ed,null));};exports[_0x53ae('0x4c')]=function(_0x429a22,_0x311647){return db[_0x53ae('0x41')]['find']({'where':{'id':_0x429a22[_0x53ae('0x4d')]['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x311647,null))['then'](removeEntity(_0x311647,null))[_0x53ae('0x45')](handleError(_0x311647,null));};exports[_0x53ae('0x4e')]=function(_0x44928e,_0x193bb0,_0x230339){var _0x3ca5f9={};var _0x2429a6={};var _0x4f85bb;var _0x43aede;return db[_0x53ae('0x41')]['findOne']({'where':{'id':_0x44928e['params']['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x193bb0,null))[_0x53ae('0x26')](function(_0x768b5a){if(_0x768b5a){_0x4f85bb=_0x768b5a;_0x2429a6[_0x53ae('0x30')]=_[_0x53ae('0x32')](db['ZohoField']['rawAttributes']);_0x2429a6[_0x53ae('0x31')]=_[_0x53ae('0x32')](_0x44928e['query']);_0x2429a6[_0x53ae('0x3c')]=_[_0x53ae('0x33')](_0x2429a6[_0x53ae('0x30')],_0x2429a6[_0x53ae('0x31')]);_0x3ca5f9['attributes']=_[_0x53ae('0x33')](_0x2429a6['model'],qs[_0x53ae('0x34')](_0x44928e[_0x53ae('0x31')]['fields']));_0x3ca5f9[_0x53ae('0x35')]=_0x3ca5f9[_0x53ae('0x35')]['length']?_0x3ca5f9[_0x53ae('0x35')]:_0x2429a6[_0x53ae('0x30')];_0x3ca5f9[_0x53ae('0x39')]=qs[_0x53ae('0x3a')](_0x44928e[_0x53ae('0x31')][_0x53ae('0x3a')]);_0x3ca5f9[_0x53ae('0x3b')]=qs['filters'](_[_0x53ae('0x3d')](_0x44928e[_0x53ae('0x31')],_0x2429a6[_0x53ae('0x3c')]));if(_0x44928e[_0x53ae('0x31')][_0x53ae('0x3e')]){_0x3ca5f9[_0x53ae('0x3b')]=_[_0x53ae('0x3f')](_0x3ca5f9[_0x53ae('0x3b')],{'$or':_['map'](_0x3ca5f9[_0x53ae('0x35')],function(_0x252592){var _0x5b6a9a={};_0x5b6a9a[_0x252592]={'$like':'%'+_0x44928e[_0x53ae('0x31')]['filter']+'%'};return _0x5b6a9a;})});}_0x3ca5f9=_['merge']({},_0x3ca5f9,_0x44928e[_0x53ae('0x40')]);return _0x4f85bb[_0x53ae('0x4e')](_0x3ca5f9);}})['then'](function(_0x42eeb4){if(_0x42eeb4){_0x43aede=_0x42eeb4[_0x53ae('0x36')];if(!_0x44928e['query'][_0x53ae('0x37')]('nolimit')){_0x3ca5f9['limit']=qs[_0x53ae('0x1e')](_0x44928e[_0x53ae('0x31')][_0x53ae('0x1e')]);_0x3ca5f9[_0x53ae('0x20')]=qs[_0x53ae('0x20')](_0x44928e[_0x53ae('0x31')]['offset']);}return _0x4f85bb['getFields'](_0x3ca5f9);}})[_0x53ae('0x26')](function(_0x18c121){if(_0x18c121){return _0x18c121?{'count':_0x43aede,'rows':_0x18c121}:null;}})[_0x53ae('0x26')](respondWithResult(_0x193bb0,null))[_0x53ae('0x45')](handleError(_0x193bb0,null));};exports[_0x53ae('0x4f')]=function(_0x102fa1,_0x15bd11,_0x5873cf){var _0x461a7b={};var _0x1ac4f4={};var _0x431fb0;var _0x3a04ba;return db[_0x53ae('0x41')][_0x53ae('0x50')]({'where':{'id':_0x102fa1[_0x53ae('0x4d')]['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x15bd11,null))[_0x53ae('0x26')](function(_0xdeb10f){if(_0xdeb10f){_0x431fb0=_0xdeb10f;_0x1ac4f4[_0x53ae('0x30')]=_[_0x53ae('0x32')](db[_0x53ae('0x51')][_0x53ae('0x47')]);_0x1ac4f4[_0x53ae('0x31')]=_[_0x53ae('0x32')](_0x102fa1[_0x53ae('0x31')]);_0x1ac4f4[_0x53ae('0x3c')]=_['intersection'](_0x1ac4f4['model'],_0x1ac4f4[_0x53ae('0x31')]);_0x461a7b['attributes']=_[_0x53ae('0x33')](_0x1ac4f4[_0x53ae('0x30')],qs[_0x53ae('0x34')](_0x102fa1[_0x53ae('0x31')][_0x53ae('0x34')]));_0x461a7b[_0x53ae('0x35')]=_0x461a7b[_0x53ae('0x35')][_0x53ae('0x36')]?_0x461a7b['attributes']:_0x1ac4f4[_0x53ae('0x30')];_0x461a7b[_0x53ae('0x39')]=qs[_0x53ae('0x3a')](_0x102fa1[_0x53ae('0x31')][_0x53ae('0x3a')]);_0x461a7b[_0x53ae('0x3b')]=qs['filters'](_[_0x53ae('0x3d')](_0x102fa1['query'],_0x1ac4f4['filters']));if(_0x102fa1['query'][_0x53ae('0x3e')]){_0x461a7b[_0x53ae('0x3b')]=_['merge'](_0x461a7b[_0x53ae('0x3b')],{'$or':_[_0x53ae('0x2d')](_0x461a7b[_0x53ae('0x35')],function(_0x3d1d90){var _0xe55010={};_0xe55010[_0x3d1d90]={'$like':'%'+_0x102fa1['query'][_0x53ae('0x3e')]+'%'};return _0xe55010;})});}_0x461a7b=_[_0x53ae('0x3f')]({},_0x461a7b,_0x102fa1[_0x53ae('0x40')]);return _0x431fb0['getSubjects'](_0x461a7b);}})['then'](function(_0x2ac765){if(_0x2ac765){_0x3a04ba=_0x2ac765[_0x53ae('0x36')];if(!_0x102fa1[_0x53ae('0x31')][_0x53ae('0x37')](_0x53ae('0x38'))){_0x461a7b[_0x53ae('0x1e')]=qs[_0x53ae('0x1e')](_0x102fa1[_0x53ae('0x31')][_0x53ae('0x1e')]);_0x461a7b[_0x53ae('0x20')]=qs[_0x53ae('0x20')](_0x102fa1[_0x53ae('0x31')]['offset']);}return _0x431fb0[_0x53ae('0x4f')](_0x461a7b);}})[_0x53ae('0x26')](function(_0x12471d){if(_0x12471d){return _0x12471d?{'count':_0x3a04ba,'rows':_0x12471d}:null;}})[_0x53ae('0x26')](respondWithResult(_0x15bd11,null))[_0x53ae('0x45')](handleError(_0x15bd11,null));};exports[_0x53ae('0x52')]=function(_0x1367ea,_0x284bc5,_0x13dbdb){var _0x435d6a={};var _0x10121c={};var _0x168ef7;var _0x445604;return db[_0x53ae('0x41')]['findOne']({'where':{'id':_0x1367ea['params']['id']}})['then'](handleEntityNotFound(_0x284bc5,null))[_0x53ae('0x26')](function(_0xb812b7){if(_0xb812b7){_0x168ef7=_0xb812b7;_0x10121c[_0x53ae('0x30')]=_[_0x53ae('0x32')](db[_0x53ae('0x51')][_0x53ae('0x47')]);_0x10121c['query']=_[_0x53ae('0x32')](_0x1367ea[_0x53ae('0x31')]);_0x10121c[_0x53ae('0x3c')]=_[_0x53ae('0x33')](_0x10121c[_0x53ae('0x30')],_0x10121c[_0x53ae('0x31')]);_0x435d6a[_0x53ae('0x35')]=_[_0x53ae('0x33')](_0x10121c[_0x53ae('0x30')],qs[_0x53ae('0x34')](_0x1367ea[_0x53ae('0x31')][_0x53ae('0x34')]));_0x435d6a[_0x53ae('0x35')]=_0x435d6a[_0x53ae('0x35')]['length']?_0x435d6a[_0x53ae('0x35')]:_0x10121c[_0x53ae('0x30')];_0x435d6a['order']=qs[_0x53ae('0x3a')](_0x1367ea['query']['sort']);_0x435d6a[_0x53ae('0x3b')]=qs['filters'](_[_0x53ae('0x3d')](_0x1367ea['query'],_0x10121c[_0x53ae('0x3c')]));if(_0x1367ea[_0x53ae('0x31')][_0x53ae('0x3e')]){_0x435d6a['where']=_[_0x53ae('0x3f')](_0x435d6a[_0x53ae('0x3b')],{'$or':_['map'](_0x435d6a[_0x53ae('0x35')],function(_0x2a0df7){var _0x4a5d19={};_0x4a5d19[_0x2a0df7]={'$like':'%'+_0x1367ea[_0x53ae('0x31')][_0x53ae('0x3e')]+'%'};return _0x4a5d19;})});}_0x435d6a=_['merge']({},_0x435d6a,_0x1367ea[_0x53ae('0x40')]);return _0x168ef7[_0x53ae('0x52')](_0x435d6a);}})['then'](function(_0x5c38fa){if(_0x5c38fa){_0x445604=_0x5c38fa[_0x53ae('0x36')];if(!_0x1367ea[_0x53ae('0x31')][_0x53ae('0x37')](_0x53ae('0x38'))){_0x435d6a[_0x53ae('0x1e')]=qs[_0x53ae('0x1e')](_0x1367ea['query']['limit']);_0x435d6a['offset']=qs[_0x53ae('0x20')](_0x1367ea[_0x53ae('0x31')][_0x53ae('0x20')]);}return _0x168ef7[_0x53ae('0x52')](_0x435d6a);}})[_0x53ae('0x26')](function(_0xe57787){if(_0xe57787){return _0xe57787?{'count':_0x445604,'rows':_0xe57787}:null;}})[_0x53ae('0x26')](respondWithResult(_0x284bc5,null))['catch'](handleError(_0x284bc5,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3d51d25..9e24ae1 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 _0x35e1=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2c6464,_0x51817d){var _0x58e452=function(_0x39b8f3){while(--_0x39b8f3){_0x2c6464['push'](_0x2c6464['shift']());}};_0x58e452(++_0x51817d);}(_0x35e1,0x18e));var _0x135e=function(_0x52282a,_0x45aef7){_0x52282a=_0x52282a-0x0;var _0x3c66b4=_0x35e1[_0x52282a];return _0x3c66b4;};'use strict';var _=require(_0x135e('0x0'));var util=require('util');var logger=require(_0x135e('0x1'))(_0x135e('0x2'));var moment=require(_0x135e('0x3'));var BPromise=require(_0x135e('0x4'));var rp=require(_0x135e('0x5'));var fs=require('fs');var path=require(_0x135e('0x6'));var rimraf=require(_0x135e('0x7'));var config=require(_0x135e('0x8'));var attributes=require(_0x135e('0x9'));module[_0x135e('0xa')]=function(_0x3d05b2,_0x4fd49e){return _0x3d05b2[_0x135e('0xb')](_0x135e('0xc'),attributes,{'tableName':_0x135e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x680e=['bluebird','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x680e,0x1a8));var _0xe680=function(_0x1ff558,_0x293e0d){_0x1ff558=_0x1ff558-0x0;var _0xdd2dc0=_0x680e[_0x1ff558];return _0xdd2dc0;};'use strict';var _=require(_0xe680('0x0'));var util=require(_0xe680('0x1'));var logger=require(_0xe680('0x2'))(_0xe680('0x3'));var moment=require(_0xe680('0x4'));var BPromise=require(_0xe680('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe680('0x6'));var config=require(_0xe680('0x7'));var attributes=require(_0xe680('0x8'));module[_0xe680('0x9')]=function(_0x4d7a05,_0x31af47){return _0x4d7a05['define'](_0xe680('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 67b2272..0270911 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 _0xd695=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0xd695,0x1bc));var _0x5d69=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0xd695[_0xe7281f];return _0x90dc99;};'use strict';var _=require(_0x5d69('0x0'));var util=require(_0x5d69('0x1'));var moment=require(_0x5d69('0x2'));var BPromise=require(_0x5d69('0x3'));var rs=require(_0x5d69('0x4'));var fs=require('fs');var Redis=require(_0x5d69('0x5'));var db=require(_0x5d69('0x6'))['db'];var utils=require(_0x5d69('0x7'));var logger=require('../../config/logger')(_0x5d69('0x8'));var config=require(_0x5d69('0x9'));var jayson=require(_0x5d69('0xa'));var client=jayson[_0x5d69('0xb')][_0x5d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x314b04,_0xc9041a,_0x2c3d49){return new BPromise(function(_0x14a263,_0x2d59a3){return client['request'](_0x314b04,_0x2c3d49)[_0x5d69('0xd')](function(_0x59ef4a){logger[_0x5d69('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0xc9041a,_0x5d69('0xf'));logger[_0x5d69('0x10')](_0x5d69('0x11'),_0xc9041a,'request\x20sent',JSON[_0x5d69('0x12')](_0x59ef4a));if(_0x59ef4a[_0x5d69('0x13')]){if(_0x59ef4a['error'][_0x5d69('0x14')]===0x1f4){logger[_0x5d69('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0xc9041a,_0x59ef4a[_0x5d69('0x13')][_0x5d69('0x15')]);return _0x2d59a3(_0x59ef4a['error'][_0x5d69('0x15')]);}logger[_0x5d69('0x13')](_0x5d69('0x16'),_0xc9041a,_0x59ef4a[_0x5d69('0x13')]['message']);return _0x14a263(_0x59ef4a[_0x5d69('0x13')][_0x5d69('0x15')]);}else{logger[_0x5d69('0xe')](_0x5d69('0x16'),_0xc9041a,_0x5d69('0xf'));_0x14a263(_0x59ef4a[_0x5d69('0x17')][_0x5d69('0x15')]);}})[_0x5d69('0x18')](function(_0x3044d5){logger['error'](_0x5d69('0x16'),_0xc9041a,_0x3044d5);_0x2d59a3(_0x3044d5);});});} \ No newline at end of file +var _0xf084=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2f21f1,_0x76b0b3){var _0x4623a5=function(_0x528531){while(--_0x528531){_0x2f21f1['push'](_0x2f21f1['shift']());}};_0x4623a5(++_0x76b0b3);}(_0xf084,0xf0));var _0x4f08=function(_0x5dbd25,_0x4ef51a){_0x5dbd25=_0x5dbd25-0x0;var _0x5d0fbd=_0xf084[_0x5dbd25];return _0x5d0fbd;};'use strict';var _=require(_0x4f08('0x0'));var util=require(_0x4f08('0x1'));var moment=require(_0x4f08('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f08('0x3'));var fs=require('fs');var Redis=require(_0x4f08('0x4'));var db=require(_0x4f08('0x5'))['db'];var utils=require(_0x4f08('0x6'));var logger=require(_0x4f08('0x7'))(_0x4f08('0x8'));var config=require('../../config/environment');var jayson=require(_0x4f08('0x9'));var client=jayson[_0x4f08('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x427b16,_0x50f374,_0x5a2bc7){return new BPromise(function(_0x419eba,_0x2a9fea){return client[_0x4f08('0xb')](_0x427b16,_0x5a2bc7)[_0x4f08('0xc')](function(_0x295da0){logger[_0x4f08('0xd')](_0x4f08('0xe'),_0x50f374,_0x4f08('0xf'));logger[_0x4f08('0x10')](_0x4f08('0x11'),_0x50f374,_0x4f08('0xf'),JSON[_0x4f08('0x12')](_0x295da0));if(_0x295da0[_0x4f08('0x13')]){if(_0x295da0[_0x4f08('0x13')][_0x4f08('0x14')]===0x1f4){logger[_0x4f08('0x13')](_0x4f08('0xe'),_0x50f374,_0x295da0[_0x4f08('0x13')][_0x4f08('0x15')]);return _0x2a9fea(_0x295da0[_0x4f08('0x13')][_0x4f08('0x15')]);}logger['error'](_0x4f08('0xe'),_0x50f374,_0x295da0[_0x4f08('0x13')][_0x4f08('0x15')]);return _0x419eba(_0x295da0[_0x4f08('0x13')][_0x4f08('0x15')]);}else{logger[_0x4f08('0xd')](_0x4f08('0xe'),_0x50f374,'request\x20sent');_0x419eba(_0x295da0[_0x4f08('0x16')][_0x4f08('0x15')]);}})[_0x4f08('0x17')](function(_0x32916e){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x50f374,_0x32916e);_0x2a9fea(_0x32916e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0e155f5..d19e4c5 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 _0x45e1=['isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x766909,_0x510154){var _0x16bc3f=function(_0x5259c5){while(--_0x5259c5){_0x766909['push'](_0x766909['shift']());}};_0x16bc3f(++_0x510154);}(_0x45e1,0xaa));var _0x145e=function(_0x39f023,_0x40eb0b){_0x39f023=_0x39f023-0x0;var _0x56e418=_0x45e1[_0x39f023];return _0x56e418;};'use strict';var multer=require(_0x145e('0x0'));var util=require(_0x145e('0x1'));var path=require(_0x145e('0x2'));var timeout=require(_0x145e('0x3'));var express=require('express');var router=express[_0x145e('0x4')]();var fs_extra=require(_0x145e('0x5'));var auth=require(_0x145e('0x6'));var interaction=require(_0x145e('0x7'));var config=require(_0x145e('0x8'));var controller=require(_0x145e('0x9'));router['get']('/',auth[_0x145e('0xa')](),controller['index']);router[_0x145e('0xb')](_0x145e('0xc'),auth['isAuthenticated'](),controller[_0x145e('0xd')]);router[_0x145e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x145e('0xf')](_0x145e('0xc'),auth['isAuthenticated'](),controller[_0x145e('0x10')]);router[_0x145e('0x11')](_0x145e('0xc'),auth[_0x145e('0xa')](),controller[_0x145e('0x12')]);module[_0x145e('0x13')]=router; \ No newline at end of file +var _0xb15f=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x28b9dd,_0x2f2c7e){var _0x3c56ee=function(_0x13b03e){while(--_0x13b03e){_0x28b9dd['push'](_0x28b9dd['shift']());}};_0x3c56ee(++_0x2f2c7e);}(_0xb15f,0xe3));var _0xfb15=function(_0x5e8aee,_0x2c4046){_0x5e8aee=_0x5e8aee-0x0;var _0x5f3cfd=_0xb15f[_0x5e8aee];return _0x5f3cfd;};'use strict';var multer=require(_0xfb15('0x0'));var util=require(_0xfb15('0x1'));var path=require('path');var timeout=require(_0xfb15('0x2'));var express=require(_0xfb15('0x3'));var router=express[_0xfb15('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfb15('0x5'));var config=require(_0xfb15('0x6'));var controller=require('./intZohoField.controller');router[_0xfb15('0x7')]('/',auth[_0xfb15('0x8')](),controller[_0xfb15('0x9')]);router[_0xfb15('0x7')]('/:id',auth[_0xfb15('0x8')](),controller[_0xfb15('0xa')]);router[_0xfb15('0xb')]('/',auth[_0xfb15('0x8')](),controller[_0xfb15('0xc')]);router[_0xfb15('0xd')](_0xfb15('0xe'),auth[_0xfb15('0x8')](),controller[_0xfb15('0xf')]);router[_0xfb15('0x10')](_0xfb15('0xe'),auth[_0xfb15('0x8')](),controller[_0xfb15('0x11')]);module[_0xfb15('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2f6b1f2..896927b 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 _0x699e=['string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x699e,0x72));var _0xe699=function(_0x1c3539,_0x589831){_0x1c3539=_0x1c3539-0x0;var _0x3f79e1=_0x699e[_0x1c3539];return _0x3f79e1;};'use strict';var Sequelize=require(_0xe699('0x0'));module[_0xe699('0x1')]={'type':{'type':Sequelize[_0xe699('0x2')](_0xe699('0x3'),_0xe699('0x4'),'customVariable','keyValue',_0xe699('0x5')),'defaultValue':_0xe699('0x3')},'content':{'type':Sequelize[_0xe699('0x6')]},'key':{'type':Sequelize[_0xe699('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe699('0x3'),_0xe699('0x4'),_0xe699('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe699('0x6')]},'nameField':{'type':Sequelize[_0xe699('0x6')]},'customField':{'type':Sequelize[_0xe699('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe699('0x6')]}}; \ No newline at end of file +var _0x0bb1=['string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x36117d,_0x4b5f33){var _0x411eb5=function(_0x46cae7){while(--_0x46cae7){_0x36117d['push'](_0x36117d['shift']());}};_0x411eb5(++_0x4b5f33);}(_0x0bb1,0x142));var _0x10bb=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0x0bb1[_0x4dc0c8];return _0x26bf81;};'use strict';var Sequelize=require(_0x10bb('0x0'));module['exports']={'type':{'type':Sequelize[_0x10bb('0x1')](_0x10bb('0x2'),_0x10bb('0x3'),'customVariable',_0x10bb('0x4'),_0x10bb('0x5')),'defaultValue':_0x10bb('0x2')},'content':{'type':Sequelize[_0x10bb('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x10bb('0x2'),_0x10bb('0x3'),_0x10bb('0x7'))},'keyContent':{'type':Sequelize[_0x10bb('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x10bb('0x6')]},'customField':{'type':Sequelize[_0x10bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x10bb('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 851df6e..25f3471 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 _0x9dbe=['findAll','rows','catch','params','keys','length','includeAll','find','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','include'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0x9dbe,0x150));var _0xe9db=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x9dbe[_0x414297];return _0x51ea47;};'use strict';var emlformat=require(_0xe9db('0x0'));var rimraf=require(_0xe9db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9db('0x2'));var rp=require(_0xe9db('0x3'));var moment=require('moment');var BPromise=require(_0xe9db('0x4'));var Mustache=require('mustache');var util=require(_0xe9db('0x5'));var path=require(_0xe9db('0x6'));var sox=require(_0xe9db('0x7'));var csv=require(_0xe9db('0x8'));var ejs=require(_0xe9db('0x9'));var fs=require('fs');var fs_extra=require(_0xe9db('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe9db('0xb'));var deskjs=require(_0xe9db('0xc'));var toCsv=require(_0xe9db('0x8'));var querystring=require(_0xe9db('0xd'));var Papa=require('papaparse');var Redis=require(_0xe9db('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe9db('0xf'));var as=require(_0xe9db('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe9db('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a3026,_0x4a04df){_0x4a04df=_0x4a04df||0xcc;return function(_0x8958bd){if(_0x8958bd){return _0x5a3026['sendStatus'](_0x4a04df);}return _0x5a3026[_0xe9db('0x12')](_0x4a04df)[_0xe9db('0x13')]();};}function respondWithResult(_0x21904,_0x4a8292){_0x4a8292=_0x4a8292||0xc8;return function(_0x2f010c){if(_0x2f010c){return _0x21904[_0xe9db('0x12')](_0x4a8292)[_0xe9db('0x14')](_0x2f010c);}};}function respondWithFilteredResult(_0x21151c,_0x3a5001){return function(_0x3780f2){if(_0x3780f2){var _0x338d0e=typeof _0x3a5001[_0xe9db('0x15')]===_0xe9db('0x16')&&typeof _0x3a5001[_0xe9db('0x17')]===_0xe9db('0x16');var _0x4f8f38=_0x3780f2[_0xe9db('0x18')];var _0xb9464e=_0x338d0e?0x0:_0x3a5001['offset'];var _0x3f29f1=_0x338d0e?_0x3780f2[_0xe9db('0x18')]:_0x3a5001[_0xe9db('0x15')]+_0x3a5001[_0xe9db('0x17')];var _0x1e1f25;if(_0x3f29f1>=_0x4f8f38){_0x3f29f1=_0x4f8f38;_0x1e1f25=0xc8;}else{_0x1e1f25=0xce;}_0x21151c[_0xe9db('0x12')](_0x1e1f25);return _0x21151c[_0xe9db('0x19')]('Content-Range',_0xb9464e+'-'+_0x3f29f1+'/'+_0x4f8f38)[_0xe9db('0x14')](_0x3780f2);}return null;};}function patchUpdates(_0x356383){return function(_0x16ab50){try{jsonpatch[_0xe9db('0x1a')](_0x16ab50,_0x356383,!![]);}catch(_0x5aed99){return BPromise['reject'](_0x5aed99);}return _0x16ab50[_0xe9db('0x1b')]();};}function saveUpdates(_0x34db02,_0x55b779){return function(_0xa21dc){if(_0xa21dc){return _0xa21dc['update'](_0x34db02)[_0xe9db('0x1c')](function(_0x18ec77){return _0x18ec77;});}return null;};}function removeEntity(_0x6d81e1,_0x39a29){return function(_0x4e2e0e){if(_0x4e2e0e){return _0x4e2e0e[_0xe9db('0x1d')]()[_0xe9db('0x1c')](function(){_0x6d81e1[_0xe9db('0x12')](0xcc)[_0xe9db('0x13')]();});}};}function handleEntityNotFound(_0x2d8f9b,_0x1ff188){return function(_0x5b5e10){if(!_0x5b5e10){_0x2d8f9b[_0xe9db('0x1e')](0x194);}return _0x5b5e10;};}function handleError(_0xb0327f,_0xae204){_0xae204=_0xae204||0x1f4;return function(_0x562785){logger['error'](_0x562785[_0xe9db('0x1f')]);if(_0x562785[_0xe9db('0x20')]){delete _0x562785[_0xe9db('0x20')];}_0xb0327f[_0xe9db('0x12')](_0xae204)[_0xe9db('0x21')](_0x562785);};}exports['index']=function(_0x304501,_0x598057){var _0x6babea={},_0x3f627d={},_0x3ff59f={'count':0x0,'rows':[]};var _0x226e10=_['map'](db['ZohoField'][_0xe9db('0x22')],function(_0x1d2544){return{'name':_0x1d2544[_0xe9db('0x23')],'type':_0x1d2544['type']['key']};});_0x3f627d[_0xe9db('0x24')]=_[_0xe9db('0x25')](_0x226e10,'name');_0x3f627d[_0xe9db('0x26')]=_['keys'](_0x304501[_0xe9db('0x26')]);_0x3f627d[_0xe9db('0x27')]=_[_0xe9db('0x28')](_0x3f627d[_0xe9db('0x24')],_0x3f627d[_0xe9db('0x26')]);_0x6babea[_0xe9db('0x29')]=_[_0xe9db('0x28')](_0x3f627d[_0xe9db('0x24')],qs[_0xe9db('0x2a')](_0x304501[_0xe9db('0x26')][_0xe9db('0x2a')]));_0x6babea[_0xe9db('0x29')]=_0x6babea[_0xe9db('0x29')]['length']?_0x6babea['attributes']:_0x3f627d[_0xe9db('0x24')];if(!_0x304501[_0xe9db('0x26')][_0xe9db('0x2b')]('nolimit')){_0x6babea[_0xe9db('0x17')]=qs['limit'](_0x304501[_0xe9db('0x26')][_0xe9db('0x17')]);_0x6babea['offset']=qs['offset'](_0x304501['query'][_0xe9db('0x15')]);}_0x6babea[_0xe9db('0x2c')]=qs[_0xe9db('0x2d')](_0x304501['query']['sort']);_0x6babea[_0xe9db('0x2e')]=qs[_0xe9db('0x27')](_[_0xe9db('0x2f')](_0x304501[_0xe9db('0x26')],_0x3f627d[_0xe9db('0x27')]),_0x226e10);if(_0x304501[_0xe9db('0x26')][_0xe9db('0x30')]){_0x6babea['where']=_[_0xe9db('0x31')](_0x6babea[_0xe9db('0x2e')],{'$or':_['map'](_0x226e10,function(_0x4e38a6){if(_0x4e38a6['type']!==_0xe9db('0x32')){var _0x3c554a={};_0x3c554a[_0x4e38a6['name']]={'$like':'%'+_0x304501[_0xe9db('0x26')][_0xe9db('0x30')]+'%'};return _0x3c554a;}})});}_0x6babea=_[_0xe9db('0x31')]({},_0x6babea,_0x304501[_0xe9db('0x33')]);var _0x475870={'where':_0x6babea['where']};return db[_0xe9db('0x34')]['count'](_0x475870)[_0xe9db('0x1c')](function(_0x16d9f0){_0x3ff59f[_0xe9db('0x18')]=_0x16d9f0;if(_0x304501['query']['includeAll']){_0x6babea[_0xe9db('0x35')]=[{'all':!![]}];}return db[_0xe9db('0x34')][_0xe9db('0x36')](_0x6babea);})['then'](function(_0x5ffe9a){_0x3ff59f[_0xe9db('0x37')]=_0x5ffe9a;return _0x3ff59f;})[_0xe9db('0x1c')](respondWithFilteredResult(_0x598057,_0x6babea))[_0xe9db('0x38')](handleError(_0x598057,null));};exports['show']=function(_0x1369e3,_0x3a47b1){var _0x51232c={'raw':!![],'where':{'id':_0x1369e3[_0xe9db('0x39')]['id']}},_0x4b16cf={};_0x4b16cf['model']=_[_0xe9db('0x3a')](db[_0xe9db('0x34')][_0xe9db('0x22')]);_0x4b16cf['query']=_[_0xe9db('0x3a')](_0x1369e3[_0xe9db('0x26')]);_0x4b16cf[_0xe9db('0x27')]=_[_0xe9db('0x28')](_0x4b16cf['model'],_0x4b16cf[_0xe9db('0x26')]);_0x51232c['attributes']=_[_0xe9db('0x28')](_0x4b16cf['model'],qs['fields'](_0x1369e3[_0xe9db('0x26')][_0xe9db('0x2a')]));_0x51232c[_0xe9db('0x29')]=_0x51232c[_0xe9db('0x29')][_0xe9db('0x3b')]?_0x51232c[_0xe9db('0x29')]:_0x4b16cf['model'];if(_0x1369e3[_0xe9db('0x26')][_0xe9db('0x3c')]){_0x51232c['include']=[{'all':!![]}];}_0x51232c=_[_0xe9db('0x31')]({},_0x51232c,_0x1369e3[_0xe9db('0x33')]);return db['ZohoField'][_0xe9db('0x3d')](_0x51232c)[_0xe9db('0x1c')](handleEntityNotFound(_0x3a47b1,null))[_0xe9db('0x1c')](respondWithResult(_0x3a47b1,null))['catch'](handleError(_0x3a47b1,null));};exports['create']=function(_0x203eab,_0xc08be9){return db['ZohoField'][_0xe9db('0x3e')](_0x203eab['body'],{})[_0xe9db('0x1c')](respondWithResult(_0xc08be9,0xc9))[_0xe9db('0x38')](handleError(_0xc08be9,null));};exports[_0xe9db('0x3f')]=function(_0x7f645c,_0x1fff77){if(_0x7f645c['body']['id']){delete _0x7f645c[_0xe9db('0x40')]['id'];}return db[_0xe9db('0x34')][_0xe9db('0x3d')]({'where':{'id':_0x7f645c[_0xe9db('0x39')]['id']}})[_0xe9db('0x1c')](handleEntityNotFound(_0x1fff77,null))[_0xe9db('0x1c')](saveUpdates(_0x7f645c['body'],null))[_0xe9db('0x1c')](respondWithResult(_0x1fff77,null))['catch'](handleError(_0x1fff77,null));};exports[_0xe9db('0x1d')]=function(_0x24342d,_0x593186){return db[_0xe9db('0x34')]['find']({'where':{'id':_0x24342d[_0xe9db('0x39')]['id']}})[_0xe9db('0x1c')](handleEntityNotFound(_0x593186,null))['then'](removeEntity(_0x593186,null))[_0xe9db('0x38')](handleError(_0x593186,null));}; \ No newline at end of file +var _0x37e9=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../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','name','send','index','ZohoField','rawAttributes','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3d3fb7,_0x34c821){var _0x1cb955=function(_0x1eaa32){while(--_0x1eaa32){_0x3d3fb7['push'](_0x3d3fb7['shift']());}};_0x1cb955(++_0x34c821);}(_0x37e9,0x1f4));var _0x937e=function(_0x17a361,_0x2fd535){_0x17a361=_0x17a361-0x0;var _0x153b82=_0x37e9[_0x17a361];return _0x153b82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x937e('0x0'));var zipdir=require(_0x937e('0x1'));var jsonpatch=require(_0x937e('0x2'));var rp=require(_0x937e('0x3'));var moment=require(_0x937e('0x4'));var BPromise=require(_0x937e('0x5'));var Mustache=require('mustache');var util=require(_0x937e('0x6'));var path=require(_0x937e('0x7'));var sox=require(_0x937e('0x8'));var csv=require(_0x937e('0x9'));var ejs=require(_0x937e('0xa'));var fs=require('fs');var fs_extra=require(_0x937e('0xb'));var _=require('lodash');var squel=require(_0x937e('0xc'));var crypto=require(_0x937e('0xd'));var jsforce=require(_0x937e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x937e('0x9'));var querystring=require(_0x937e('0xf'));var Papa=require(_0x937e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x937e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x937e('0x12'));var logger=require(_0x937e('0x13'))(_0x937e('0x14'));var utils=require('../../config/utils');var config=require(_0x937e('0x15'));var licenseUtil=require(_0x937e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x128ed0,_0x3ad99f){_0x3ad99f=_0x3ad99f||0xcc;return function(_0x39dbc4){if(_0x39dbc4){return _0x128ed0[_0x937e('0x17')](_0x3ad99f);}return _0x128ed0[_0x937e('0x18')](_0x3ad99f)[_0x937e('0x19')]();};}function respondWithResult(_0x86ce18,_0x5028ed){_0x5028ed=_0x5028ed||0xc8;return function(_0x52edab){if(_0x52edab){return _0x86ce18[_0x937e('0x18')](_0x5028ed)[_0x937e('0x1a')](_0x52edab);}};}function respondWithFilteredResult(_0x5c4bd4,_0x276511){return function(_0x2735d5){if(_0x2735d5){var _0x11f8a1=typeof _0x276511[_0x937e('0x1b')]===_0x937e('0x1c')&&typeof _0x276511[_0x937e('0x1d')]===_0x937e('0x1c');var _0x92d7af=_0x2735d5[_0x937e('0x1e')];var _0xe76e5b=_0x11f8a1?0x0:_0x276511[_0x937e('0x1b')];var _0x4ae425=_0x11f8a1?_0x2735d5['count']:_0x276511[_0x937e('0x1b')]+_0x276511[_0x937e('0x1d')];var _0x18fc00;if(_0x4ae425>=_0x92d7af){_0x4ae425=_0x92d7af;_0x18fc00=0xc8;}else{_0x18fc00=0xce;}_0x5c4bd4[_0x937e('0x18')](_0x18fc00);return _0x5c4bd4[_0x937e('0x1f')](_0x937e('0x20'),_0xe76e5b+'-'+_0x4ae425+'/'+_0x92d7af)[_0x937e('0x1a')](_0x2735d5);}return null;};}function patchUpdates(_0xb3fdfe){return function(_0x5e95b5){try{jsonpatch[_0x937e('0x21')](_0x5e95b5,_0xb3fdfe,!![]);}catch(_0x4f5f3b){return BPromise[_0x937e('0x22')](_0x4f5f3b);}return _0x5e95b5[_0x937e('0x23')]();};}function saveUpdates(_0x267f0f,_0x35d7ef){return function(_0x1f7ba0){if(_0x1f7ba0){return _0x1f7ba0[_0x937e('0x24')](_0x267f0f)[_0x937e('0x25')](function(_0x56eecb){return _0x56eecb;});}return null;};}function removeEntity(_0x1f96de,_0x4f8e17){return function(_0x2e5a16){if(_0x2e5a16){return _0x2e5a16[_0x937e('0x26')]()[_0x937e('0x25')](function(){_0x1f96de['status'](0xcc)[_0x937e('0x19')]();});}};}function handleEntityNotFound(_0x300b56,_0x142423){return function(_0x3145fa){if(!_0x3145fa){_0x300b56[_0x937e('0x17')](0x194);}return _0x3145fa;};}function handleError(_0x381a08,_0x2aa18e){_0x2aa18e=_0x2aa18e||0x1f4;return function(_0x35ff0c){logger['error'](_0x35ff0c['stack']);if(_0x35ff0c[_0x937e('0x27')]){delete _0x35ff0c[_0x937e('0x27')];}_0x381a08[_0x937e('0x18')](_0x2aa18e)[_0x937e('0x28')](_0x35ff0c);};}exports[_0x937e('0x29')]=function(_0x539854,_0x511fe4){var _0x42300d={},_0x272f7e={},_0x4db4e8={'count':0x0,'rows':[]};var _0x3a5885=_['map'](db[_0x937e('0x2a')][_0x937e('0x2b')],function(_0x3d3050){return{'name':_0x3d3050['fieldName'],'type':_0x3d3050['type'][_0x937e('0x2c')]};});_0x272f7e['model']=_[_0x937e('0x2d')](_0x3a5885,_0x937e('0x27'));_0x272f7e[_0x937e('0x2e')]=_[_0x937e('0x2f')](_0x539854[_0x937e('0x2e')]);_0x272f7e[_0x937e('0x30')]=_[_0x937e('0x31')](_0x272f7e[_0x937e('0x32')],_0x272f7e['query']);_0x42300d[_0x937e('0x33')]=_[_0x937e('0x31')](_0x272f7e[_0x937e('0x32')],qs[_0x937e('0x34')](_0x539854[_0x937e('0x2e')][_0x937e('0x34')]));_0x42300d[_0x937e('0x33')]=_0x42300d[_0x937e('0x33')][_0x937e('0x35')]?_0x42300d[_0x937e('0x33')]:_0x272f7e[_0x937e('0x32')];if(!_0x539854[_0x937e('0x2e')][_0x937e('0x36')](_0x937e('0x37'))){_0x42300d['limit']=qs[_0x937e('0x1d')](_0x539854[_0x937e('0x2e')][_0x937e('0x1d')]);_0x42300d['offset']=qs[_0x937e('0x1b')](_0x539854['query'][_0x937e('0x1b')]);}_0x42300d[_0x937e('0x38')]=qs[_0x937e('0x39')](_0x539854[_0x937e('0x2e')][_0x937e('0x39')]);_0x42300d[_0x937e('0x3a')]=qs['filters'](_['pick'](_0x539854[_0x937e('0x2e')],_0x272f7e[_0x937e('0x30')]),_0x3a5885);if(_0x539854[_0x937e('0x2e')][_0x937e('0x3b')]){_0x42300d[_0x937e('0x3a')]=_[_0x937e('0x3c')](_0x42300d[_0x937e('0x3a')],{'$or':_['map'](_0x3a5885,function(_0x6ee2d1){if(_0x6ee2d1['type']!==_0x937e('0x3d')){var _0x97714={};_0x97714[_0x6ee2d1[_0x937e('0x27')]]={'$like':'%'+_0x539854[_0x937e('0x2e')][_0x937e('0x3b')]+'%'};return _0x97714;}})});}_0x42300d=_[_0x937e('0x3c')]({},_0x42300d,_0x539854[_0x937e('0x3e')]);var _0x304401={'where':_0x42300d[_0x937e('0x3a')]};return db[_0x937e('0x2a')]['count'](_0x304401)[_0x937e('0x25')](function(_0x5608f5){_0x4db4e8[_0x937e('0x1e')]=_0x5608f5;if(_0x539854[_0x937e('0x2e')][_0x937e('0x3f')]){_0x42300d[_0x937e('0x40')]=[{'all':!![]}];}return db[_0x937e('0x2a')]['findAll'](_0x42300d);})['then'](function(_0x199fa9){_0x4db4e8[_0x937e('0x41')]=_0x199fa9;return _0x4db4e8;})[_0x937e('0x25')](respondWithFilteredResult(_0x511fe4,_0x42300d))[_0x937e('0x42')](handleError(_0x511fe4,null));};exports[_0x937e('0x43')]=function(_0x2d3a93,_0x3c53a6){var _0x492eac={'raw':!![],'where':{'id':_0x2d3a93[_0x937e('0x44')]['id']}},_0xf1d634={};_0xf1d634['model']=_[_0x937e('0x2f')](db['ZohoField'][_0x937e('0x2b')]);_0xf1d634[_0x937e('0x2e')]=_[_0x937e('0x2f')](_0x2d3a93[_0x937e('0x2e')]);_0xf1d634['filters']=_[_0x937e('0x31')](_0xf1d634[_0x937e('0x32')],_0xf1d634[_0x937e('0x2e')]);_0x492eac['attributes']=_[_0x937e('0x31')](_0xf1d634[_0x937e('0x32')],qs[_0x937e('0x34')](_0x2d3a93[_0x937e('0x2e')]['fields']));_0x492eac['attributes']=_0x492eac['attributes'][_0x937e('0x35')]?_0x492eac[_0x937e('0x33')]:_0xf1d634['model'];if(_0x2d3a93[_0x937e('0x2e')][_0x937e('0x3f')]){_0x492eac[_0x937e('0x40')]=[{'all':!![]}];}_0x492eac=_[_0x937e('0x3c')]({},_0x492eac,_0x2d3a93['options']);return db[_0x937e('0x2a')][_0x937e('0x45')](_0x492eac)[_0x937e('0x25')](handleEntityNotFound(_0x3c53a6,null))[_0x937e('0x25')](respondWithResult(_0x3c53a6,null))[_0x937e('0x42')](handleError(_0x3c53a6,null));};exports[_0x937e('0x46')]=function(_0x2cc94e,_0x33ff1f){return db['ZohoField'][_0x937e('0x46')](_0x2cc94e[_0x937e('0x47')],{})[_0x937e('0x25')](respondWithResult(_0x33ff1f,0xc9))[_0x937e('0x42')](handleError(_0x33ff1f,null));};exports[_0x937e('0x24')]=function(_0xe160db,_0x19ec71){if(_0xe160db[_0x937e('0x47')]['id']){delete _0xe160db['body']['id'];}return db[_0x937e('0x2a')][_0x937e('0x45')]({'where':{'id':_0xe160db['params']['id']}})[_0x937e('0x25')](handleEntityNotFound(_0x19ec71,null))[_0x937e('0x25')](saveUpdates(_0xe160db[_0x937e('0x47')],null))['then'](respondWithResult(_0x19ec71,null))[_0x937e('0x42')](handleError(_0x19ec71,null));};exports[_0x937e('0x26')]=function(_0x5728a8,_0x4d7a7f){return db['ZohoField'][_0x937e('0x45')]({'where':{'id':_0x5728a8[_0x937e('0x44')]['id']}})[_0x937e('0x25')](handleEntityNotFound(_0x4d7a7f,null))['then'](removeEntity(_0x4d7a7f,null))['catch'](handleError(_0x4d7a7f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 7cf6a6a..223ef2d 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 _0x6050=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','zoho_unique_index','idField','FieldId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6050,0x196));var _0x0605=function(_0x360531,_0x2fac49){_0x360531=_0x360531-0x0;var _0x4017c8=_0x6050[_0x360531];return _0x4017c8;};'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('./intZohoField.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0605('0x9'),'fields':[_0x0605('0xa'),_0x0605('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d04=['request-promise','path','../../config/environment','./intZohoField.attributes','exports','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x10f1ed,_0x26ae24){var _0x5ea069=function(_0x4e4e59){while(--_0x4e4e59){_0x10f1ed['push'](_0x10f1ed['shift']());}};_0x5ea069(++_0x26ae24);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x43d0('0xb'),'fields':[_0x43d0('0xc'),_0x43d0('0xd')],'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 8d68117..1c97d8f 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 _0x20ee=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ee,0x8e));var _0xe20e=function(_0x581dc4,_0x3f0e09){_0x581dc4=_0x581dc4-0x0;var _0x565709=_0x20ee[_0x581dc4];return _0x565709;};'use strict';var _=require(_0xe20e('0x0'));var util=require(_0xe20e('0x1'));var moment=require(_0xe20e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20e('0x3'));var fs=require('fs');var Redis=require(_0xe20e('0x4'));var db=require(_0xe20e('0x5'))['db'];var utils=require(_0xe20e('0x6'));var logger=require(_0xe20e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe20e('0x8'));var client=jayson[_0xe20e('0x9')][_0xe20e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b5de,_0x5b1721,_0x58d15f){return new BPromise(function(_0x5189b7,_0x304dfc){return client[_0xe20e('0xb')](_0x9b5de,_0x58d15f)[_0xe20e('0xc')](function(_0x204eca){logger[_0xe20e('0xd')](_0xe20e('0xe'),_0x5b1721,_0xe20e('0xf'));logger[_0xe20e('0x10')](_0xe20e('0x11'),_0x5b1721,_0xe20e('0xf'),JSON['stringify'](_0x204eca));if(_0x204eca['error']){if(_0x204eca[_0xe20e('0x12')][_0xe20e('0x13')]===0x1f4){logger[_0xe20e('0x12')](_0xe20e('0xe'),_0x5b1721,_0x204eca[_0xe20e('0x12')][_0xe20e('0x14')]);return _0x304dfc(_0x204eca[_0xe20e('0x12')][_0xe20e('0x14')]);}logger[_0xe20e('0x12')]('ZohoField,\x20%s,\x20%s',_0x5b1721,_0x204eca[_0xe20e('0x12')]['message']);return _0x5189b7(_0x204eca[_0xe20e('0x12')][_0xe20e('0x14')]);}else{logger['info'](_0xe20e('0xe'),_0x5b1721,'request\x20sent');_0x5189b7(_0x204eca[_0xe20e('0x15')][_0xe20e('0x14')]);}})[_0xe20e('0x16')](function(_0x46f9ce){logger[_0xe20e('0x12')]('ZohoField,\x20%s,\x20%s',_0x5b1721,_0x46f9ce);_0x304dfc(_0x46f9ce);});});} \ No newline at end of file +var _0xfe8c=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x5795f5,_0xa4aa64){var _0x3c6736=function(_0x29e8dd){while(--_0x29e8dd){_0x5795f5['push'](_0x5795f5['shift']());}};_0x3c6736(++_0xa4aa64);}(_0xfe8c,0xd1));var _0xcfe8=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xfe8c[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0xcfe8('0x0'));var moment=require(_0xcfe8('0x1'));var BPromise=require('bluebird');var rs=require(_0xcfe8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfe8('0x3'))['db'];var utils=require(_0xcfe8('0x4'));var logger=require(_0xcfe8('0x5'))(_0xcfe8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcfe8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x10a75d,_0x2b7c2e,_0x497fe2){return new BPromise(function(_0x342bcd,_0x11133f){return client[_0xcfe8('0x8')](_0x10a75d,_0x497fe2)['then'](function(_0x3ed797){logger['info'](_0xcfe8('0x9'),_0x2b7c2e,_0xcfe8('0xa'));logger[_0xcfe8('0xb')](_0xcfe8('0xc'),_0x2b7c2e,'request\x20sent',JSON[_0xcfe8('0xd')](_0x3ed797));if(_0x3ed797[_0xcfe8('0xe')]){if(_0x3ed797[_0xcfe8('0xe')]['code']===0x1f4){logger[_0xcfe8('0xe')](_0xcfe8('0x9'),_0x2b7c2e,_0x3ed797[_0xcfe8('0xe')][_0xcfe8('0xf')]);return _0x11133f(_0x3ed797[_0xcfe8('0xe')][_0xcfe8('0xf')]);}logger['error'](_0xcfe8('0x9'),_0x2b7c2e,_0x3ed797[_0xcfe8('0xe')][_0xcfe8('0xf')]);return _0x342bcd(_0x3ed797[_0xcfe8('0xe')][_0xcfe8('0xf')]);}else{logger[_0xcfe8('0x10')](_0xcfe8('0x9'),_0x2b7c2e,_0xcfe8('0xa'));_0x342bcd(_0x3ed797[_0xcfe8('0x11')][_0xcfe8('0xf')]);}})[_0xcfe8('0x12')](function(_0x28a63d){logger['error'](_0xcfe8('0x9'),_0x2b7c2e,_0x28a63d);_0x11133f(_0x28a63d);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 617bcd3..006f5d4 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2d9f30,_0x258111){var _0x243932=function(_0x2eca4a){while(--_0x2eca4a){_0x2d9f30['push'](_0x2d9f30['shift']());}};_0x243932(++_0x258111);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1944e8,_0xbb9e1a){var _0xed9f4a=function(_0x4614c4){while(--_0x4614c4){_0x1944e8['push'](_0x1944e8['shift']());}};_0xed9f4a(++_0xbb9e1a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index c7c93e1..aabcf22 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 _0x4e37=['STRING','unique_name_and_version','app.js','BOOLEAN','sequelize','exports'];(function(_0x572744,_0x4a768c){var _0x32cb23=function(_0x5c87d3){while(--_0x5c87d3){_0x572744['push'](_0x572744['shift']());}};_0x32cb23(++_0x4a768c);}(_0x4e37,0x1a8));var _0x74e3=function(_0x253cdb,_0x142a36){_0x253cdb=_0x253cdb-0x0;var _0x1ae7f4=_0x4e37[_0x253cdb];return _0x1ae7f4;};'use strict';var Sequelize=require(_0x74e3('0x0'));module[_0x74e3('0x1')]={'name':{'type':Sequelize[_0x74e3('0x2')],'allowNull':![],'unique':_0x74e3('0x3')},'version':{'type':Sequelize[_0x74e3('0x2')],'allowNull':![],'unique':_0x74e3('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x74e3('0x4')},'filename':{'type':Sequelize[_0x74e3('0x2')]},'path':{'type':Sequelize[_0x74e3('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x74e3('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x74e3('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x74e3('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74e3('0x2')]},'link':{'type':Sequelize[_0x74e3('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xa0b6=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0b6,0x74));var _0x6a0b=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xa0b6[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0x6a0b('0x0'));module[_0x6a0b('0x1')]={'name':{'type':Sequelize[_0x6a0b('0x2')],'allowNull':![],'unique':_0x6a0b('0x3')},'version':{'type':Sequelize[_0x6a0b('0x2')],'allowNull':![],'unique':_0x6a0b('0x3')},'main':{'type':Sequelize[_0x6a0b('0x2')],'defaultValue':_0x6a0b('0x4')},'filename':{'type':Sequelize[_0x6a0b('0x2')]},'path':{'type':Sequelize[_0x6a0b('0x2')]},'type':{'type':Sequelize[_0x6a0b('0x2')]},'size':{'type':Sequelize[_0x6a0b('0x5')]},'active':{'type':Sequelize[_0x6a0b('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x6a0b('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x6a0b('0x2')],'unique':_0x6a0b('0x7')},'description':{'type':Sequelize[_0x6a0b('0x2')]},'title':{'type':Sequelize[_0x6a0b('0x2')]},'remoteUri':{'type':Sequelize[_0x6a0b('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 10ef65d..275e9b2 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 _0x90b1=['map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','Integration','includeAll','rows','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index'];(function(_0x5017db,_0x11968e){var _0x592d3d=function(_0x31eb21){while(--_0x31eb21){_0x5017db['push'](_0x5017db['shift']());}};_0x592d3d(++_0x11968e);}(_0x90b1,0x1bb));var _0x190b=function(_0x1a2edc,_0x718006){_0x1a2edc=_0x1a2edc-0x0;var _0xccd506=_0x90b1[_0x1a2edc];return _0xccd506;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['Integration'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['Integration'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4488df,_0x35c0bd){var _0x2d2709=function(_0x21035b){while(--_0x21035b){_0x4488df['push'](_0x4488df['shift']());}};_0x2d2709(++_0x35c0bd);}(_0x7a54,0x106));var _0x47a5=function(_0x53f15a,_0x5bfb46){_0x53f15a=_0x53f15a-0x0;var _0x13172f=_0x7a54[_0x53f15a];return _0x13172f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['Integration'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['Integration']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7947343..47225e7 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 _0x3c83=['exports','define','Integration','integrations','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x4a98c2,_0x22b8f5){var _0x1dc173=function(_0x81290b){while(--_0x81290b){_0x4a98c2['push'](_0x4a98c2['shift']());}};_0x1dc173(++_0x22b8f5);}(_0x3c83,0x1d2));var _0x33c8=function(_0xe91d80,_0x91bde5){_0xe91d80=_0xe91d80-0x0;var _0x1e17c4=_0x3c83[_0xe91d80];return _0x1e17c4;};'use strict';var _=require('lodash');var util=require(_0x33c8('0x0'));var logger=require(_0x33c8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x33c8('0x2'));var fs=require('fs');var path=require(_0x33c8('0x3'));var rimraf=require(_0x33c8('0x4'));var config=require(_0x33c8('0x5'));var attributes=require(_0x33c8('0x6'));module[_0x33c8('0x7')]=function(_0x4e92b3,_0x59c0cd){return _0x4e92b3[_0x33c8('0x8')](_0x33c8('0x9'),attributes,{'tableName':_0x33c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68c9=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Integration','integrations','util'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x68c9,0x14f));var _0x968c=function(_0x66cba6,_0x378795){_0x66cba6=_0x66cba6-0x0;var _0xe51ef0=_0x68c9[_0x66cba6];return _0xe51ef0;};'use strict';var _=require('lodash');var util=require(_0x968c('0x0'));var logger=require(_0x968c('0x1'))(_0x968c('0x2'));var moment=require(_0x968c('0x3'));var BPromise=require(_0x968c('0x4'));var rp=require(_0x968c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x968c('0x6'));var config=require(_0x968c('0x7'));var attributes=require('./integration.attributes');module[_0x968c('0x8')]=function(_0x7c855,_0x4fd56c){return _0x7c855[_0x968c('0x9')](_0x968c('0xa'),attributes,{'tableName':_0x968c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 3658870..7564cb8 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 _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x5d3416,_0x20c335){var _0x38da23=function(_0x247b4b){while(--_0x247b4b){_0x5d3416['push'](_0x5d3416['shift']());}};_0x38da23(++_0x20c335);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1ff7ef,_0x56c924){_0x1ff7ef=_0x1ff7ef-0x0;var _0x5eacf2=_0xdd4f[_0x1ff7ef];return _0x5eacf2;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x6a63dd,_0x3e221c){var _0x308c22=function(_0x24c7eb){while(--_0x24c7eb){_0x6a63dd['push'](_0x6a63dd['shift']());}};_0x308c22(++_0x3e221c);}(_0xdb28,0x106));var _0x8db2=function(_0x3f44af,_0x57b3db){_0x3f44af=_0x3f44af-0x0;var _0x53ffa4=_0xdb28[_0x3f44af];return _0x53ffa4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6715245..94e8f91 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 _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0xc5db78,_0x11278c){var _0x2542f0=function(_0x5ad2f4){while(--_0x5ad2f4){_0xc5db78['push'](_0xc5db78['shift']());}};_0x2542f0(++_0x11278c);}(_0xef0f,0x168));var _0xfef0=function(_0x327b46,_0x204583){_0x327b46=_0x327b46-0x0;var _0x24d461=_0xef0f[_0x327b46];return _0x24d461;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file +var _0xef0f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x9e67d9,_0x334389){var _0x58f387=function(_0x1dd58a){while(--_0x1dd58a){_0x9e67d9['push'](_0x9e67d9['shift']());}};_0x58f387(++_0x334389);}(_0xef0f,0x168));var _0xfef0=function(_0x1474b,_0x51f8c0){_0x1474b=_0x1474b-0x0;var _0x9d083f=_0xef0f[_0x1474b];return _0x9d083f;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 02a5c8d..0334fc2 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 _0x0805=['DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x43ca6f,_0x4d9b6e){var _0x1c83c0=function(_0x593d82){while(--_0x593d82){_0x43ca6f['push'](_0x43ca6f['shift']());}};_0x1c83c0(++_0x4d9b6e);}(_0x0805,0x17d));var _0x5080=function(_0xc67a6d,_0xbab1a7){_0xc67a6d=_0xc67a6d-0x0;var _0x27680e=_0x0805[_0xc67a6d];return _0x27680e;};'use strict';var Sequelize=require(_0x5080('0x0'));module[_0x5080('0x1')]={'integration':{'type':Sequelize[_0x5080('0x2')]},'eventChannel':{'type':Sequelize[_0x5080('0x2')]},'exitStatus':{'type':Sequelize[_0x5080('0x2')]},'ticketId':{'type':Sequelize[_0x5080('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5080('0x2')]},'calleridnum':{'type':Sequelize[_0x5080('0x2')]},'calleridname':{'type':Sequelize[_0x5080('0x2')]},'queue':{'type':Sequelize[_0x5080('0x2')]},'interface':{'type':Sequelize[_0x5080('0x2')]},'membername':{'type':Sequelize[_0x5080('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5080('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5080('0x3')]},'talktime':{'type':Sequelize[_0x5080('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5080('0x4')]},'reason':{'type':Sequelize[_0x5080('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5080('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5080('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5080('0x2')]},'channelstate':{'type':Sequelize[_0x5080('0x4')]},'channelstatedesc':{'type':Sequelize[_0x5080('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5080('0x2')]},'connectedlinename':{'type':Sequelize[_0x5080('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5080('0x2')]},'context':{'type':Sequelize[_0x5080('0x2')]},'exten':{'type':Sequelize[_0x5080('0x2')]},'priority':{'type':Sequelize[_0x5080('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5080('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5080('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5080('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5080('0x2')]},'destlanguage':{'type':Sequelize[_0x5080('0x2')]},'destaccountcode':{'type':Sequelize[_0x5080('0x2')]},'destcontext':{'type':Sequelize[_0x5080('0x2')]},'destexten':{'type':Sequelize[_0x5080('0x2')]},'destpriority':{'type':Sequelize[_0x5080('0x2')]},'destuniqueid':{'type':Sequelize[_0x5080('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x5080('0x2')]},'subject':{'type':Sequelize[_0x5080('0x2')]},'from':{'type':Sequelize[_0x5080('0x2')]},'to':{'type':Sequelize[_0x5080('0x2')]},'cc':{'type':Sequelize[_0x5080('0x2')]},'attachment':{'type':Sequelize[_0x5080('0x6')]},'html':{'type':Sequelize[_0x5080('0x6')]},'text':{'type':Sequelize[_0x5080('0x6')]},'status':{'type':Sequelize[_0x5080('0x7')](_0x5080('0x8'),_0x5080('0x9'),_0x5080('0xa'),_0x5080('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5080('0x2')]},'appdata':{'type':Sequelize[_0x5080('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4f4f=['RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT'];(function(_0x5b0e39,_0x486719){var _0x30962a=function(_0x3b87fc){while(--_0x3b87fc){_0x5b0e39['push'](_0x5b0e39['shift']());}};_0x30962a(++_0x486719);}(_0x4f4f,0x10a));var _0xf4f4=function(_0x169a75,_0x541a4e){_0x169a75=_0x169a75-0x0;var _0x38665b=_0x4f4f[_0x169a75];return _0x38665b;};'use strict';var Sequelize=require(_0xf4f4('0x0'));module[_0xf4f4('0x1')]={'integration':{'type':Sequelize[_0xf4f4('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xf4f4('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xf4f4('0x3')]},'contacts':{'type':Sequelize[_0xf4f4('0x2')]},'uniqueid':{'type':Sequelize[_0xf4f4('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf4f4('0x2')]},'queue':{'type':Sequelize[_0xf4f4('0x2')]},'interface':{'type':Sequelize[_0xf4f4('0x2')]},'membername':{'type':Sequelize[_0xf4f4('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xf4f4('0x3')]},'agentcomplete':{'type':Sequelize[_0xf4f4('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf4f4('0x5')]},'talktime':{'type':Sequelize[_0xf4f4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf4f4('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf4f4('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf4f4('0x5')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf4f4('0x5')]},'lastevent':{'type':Sequelize[_0xf4f4('0x2')]},'channel':{'type':Sequelize[_0xf4f4('0x2')]},'channelstate':{'type':Sequelize[_0xf4f4('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf4f4('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf4f4('0x2')]},'connectedlinename':{'type':Sequelize[_0xf4f4('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf4f4('0x2')]},'context':{'type':Sequelize[_0xf4f4('0x2')]},'exten':{'type':Sequelize[_0xf4f4('0x2')]},'priority':{'type':Sequelize[_0xf4f4('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf4f4('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf4f4('0x2')]},'destcalleridname':{'type':Sequelize[_0xf4f4('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf4f4('0x2')]},'destlanguage':{'type':Sequelize[_0xf4f4('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xf4f4('0x2')]},'destuniqueid':{'type':Sequelize[_0xf4f4('0x2')]},'messageId':{'type':Sequelize[_0xf4f4('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xf4f4('0x2')]},'from':{'type':Sequelize[_0xf4f4('0x2')]},'to':{'type':Sequelize[_0xf4f4('0x2')]},'cc':{'type':Sequelize[_0xf4f4('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xf4f4('0x6')]},'text':{'type':Sequelize[_0xf4f4('0x6')]},'status':{'type':Sequelize[_0xf4f4('0x7')](_0xf4f4('0x8'),'SENDING',_0xf4f4('0x9'),_0xf4f4('0xa'))},'url':{'type':Sequelize[_0xf4f4('0x2')]},'app':{'type':Sequelize[_0xf4f4('0x2')]},'appdata':{'type':Sequelize[_0xf4f4('0x2')]},'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 9769f72..fc49299 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 _0x2aa0=['IntegrationReport','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map'];(function(_0x57350d,_0x7af3d3){var _0x26739c=function(_0x2211f5){while(--_0x2211f5){_0x57350d['push'](_0x57350d['shift']());}};_0x26739c(++_0x7af3d3);}(_0x2aa0,0x6c));var _0x02aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2aa0[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x02aa('0x0'));var rimraf=require(_0x02aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02aa('0x2'));var rp=require(_0x02aa('0x3'));var moment=require('moment');var BPromise=require(_0x02aa('0x4'));var Mustache=require('mustache');var util=require(_0x02aa('0x5'));var path=require(_0x02aa('0x6'));var sox=require(_0x02aa('0x7'));var csv=require(_0x02aa('0x8'));var ejs=require(_0x02aa('0x9'));var fs=require('fs');var fs_extra=require(_0x02aa('0xa'));var _=require(_0x02aa('0xb'));var squel=require(_0x02aa('0xc'));var crypto=require(_0x02aa('0xd'));var jsforce=require(_0x02aa('0xe'));var deskjs=require(_0x02aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x02aa('0x10'));var Papa=require(_0x02aa('0x11'));var Redis=require('ioredis');var authService=require(_0x02aa('0x12'));var qs=require(_0x02aa('0x13'));var as=require(_0x02aa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x02aa('0x15'));var utils=require(_0x02aa('0x16'));var config=require(_0x02aa('0x17'));var licenseUtil=require(_0x02aa('0x18'));var db=require(_0x02aa('0x19'))['db'];function respondWithStatusCode(_0x54dc33,_0x4ba601){_0x4ba601=_0x4ba601||0xcc;return function(_0x545b5e){if(_0x545b5e){return _0x54dc33[_0x02aa('0x1a')](_0x4ba601);}return _0x54dc33[_0x02aa('0x1b')](_0x4ba601)[_0x02aa('0x1c')]();};}function respondWithResult(_0x24c2ce,_0x2a00da){_0x2a00da=_0x2a00da||0xc8;return function(_0x191bd3){if(_0x191bd3){return _0x24c2ce[_0x02aa('0x1b')](_0x2a00da)[_0x02aa('0x1d')](_0x191bd3);}};}function respondWithFilteredResult(_0x14988e,_0x3a0f8c){return function(_0x45ca70){if(_0x45ca70){var _0x3ebcdf=typeof _0x3a0f8c[_0x02aa('0x1e')]===_0x02aa('0x1f')&&typeof _0x3a0f8c[_0x02aa('0x20')]===_0x02aa('0x1f');var _0x119ede=_0x45ca70[_0x02aa('0x21')];var _0xb0bc12=_0x3ebcdf?0x0:_0x3a0f8c[_0x02aa('0x1e')];var _0x529726=_0x3ebcdf?_0x45ca70[_0x02aa('0x21')]:_0x3a0f8c[_0x02aa('0x1e')]+_0x3a0f8c['limit'];var _0x460f20;if(_0x529726>=_0x119ede){_0x529726=_0x119ede;_0x460f20=0xc8;}else{_0x460f20=0xce;}_0x14988e[_0x02aa('0x1b')](_0x460f20);return _0x14988e[_0x02aa('0x22')]('Content-Range',_0xb0bc12+'-'+_0x529726+'/'+_0x119ede)[_0x02aa('0x1d')](_0x45ca70);}return null;};}function patchUpdates(_0x5b1dee){return function(_0x4be864){try{jsonpatch[_0x02aa('0x23')](_0x4be864,_0x5b1dee,!![]);}catch(_0x320889){return BPromise[_0x02aa('0x24')](_0x320889);}return _0x4be864[_0x02aa('0x25')]();};}function saveUpdates(_0x549e50,_0xf74047){return function(_0x108c00){if(_0x108c00){return _0x108c00[_0x02aa('0x26')](_0x549e50)[_0x02aa('0x27')](function(_0x1d6586){return _0x1d6586;});}return null;};}function removeEntity(_0x45ea2c,_0x1ba751){return function(_0x192f19){if(_0x192f19){return _0x192f19[_0x02aa('0x28')]()[_0x02aa('0x27')](function(){_0x45ea2c[_0x02aa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4531f7,_0x136d90){return function(_0x446f54){if(!_0x446f54){_0x4531f7[_0x02aa('0x1a')](0x194);}return _0x446f54;};}function handleError(_0x258993,_0x350f46){_0x350f46=_0x350f46||0x1f4;return function(_0x21eb2a){logger[_0x02aa('0x29')](_0x21eb2a[_0x02aa('0x2a')]);if(_0x21eb2a['name']){delete _0x21eb2a[_0x02aa('0x2b')];}_0x258993['status'](_0x350f46)[_0x02aa('0x2c')](_0x21eb2a);};}exports['index']=function(_0x540ece,_0x5afd3d){var _0x57b1fc={},_0x20cf72={},_0x1ccf22={'count':0x0,'rows':[]};var _0xf93497=_[_0x02aa('0x2d')](db[_0x02aa('0x2e')]['rawAttributes'],function(_0x37a702){return{'name':_0x37a702[_0x02aa('0x2f')],'type':_0x37a702[_0x02aa('0x30')][_0x02aa('0x31')]};});_0x20cf72[_0x02aa('0x32')]=_[_0x02aa('0x2d')](_0xf93497,_0x02aa('0x2b'));_0x20cf72[_0x02aa('0x33')]=_[_0x02aa('0x34')](_0x540ece['query']);_0x20cf72[_0x02aa('0x35')]=_['intersection'](_0x20cf72[_0x02aa('0x32')],_0x20cf72['query']);_0x57b1fc[_0x02aa('0x36')]=_['intersection'](_0x20cf72[_0x02aa('0x32')],qs[_0x02aa('0x37')](_0x540ece[_0x02aa('0x33')]['fields']));_0x57b1fc['attributes']=_0x57b1fc['attributes'][_0x02aa('0x38')]?_0x57b1fc['attributes']:_0x20cf72[_0x02aa('0x32')];if(!_0x540ece[_0x02aa('0x33')][_0x02aa('0x39')]('nolimit')){_0x57b1fc[_0x02aa('0x20')]=qs[_0x02aa('0x20')](_0x540ece[_0x02aa('0x33')][_0x02aa('0x20')]);_0x57b1fc['offset']=qs['offset'](_0x540ece['query'][_0x02aa('0x1e')]);}_0x57b1fc[_0x02aa('0x3a')]=qs[_0x02aa('0x3b')](_0x540ece[_0x02aa('0x33')]['sort']);_0x57b1fc['where']=qs[_0x02aa('0x35')](_['pick'](_0x540ece[_0x02aa('0x33')],_0x20cf72[_0x02aa('0x35')]),_0xf93497);if(_0x540ece[_0x02aa('0x33')][_0x02aa('0x3c')]){_0x57b1fc[_0x02aa('0x3d')]=_[_0x02aa('0x3e')](_0x57b1fc[_0x02aa('0x3d')],{'$or':_[_0x02aa('0x2d')](_0xf93497,function(_0x1db368){if(_0x1db368[_0x02aa('0x30')]!==_0x02aa('0x3f')){var _0x36583c={};_0x36583c[_0x1db368[_0x02aa('0x2b')]]={'$like':'%'+_0x540ece['query']['filter']+'%'};return _0x36583c;}})});}_0x57b1fc=_[_0x02aa('0x3e')]({},_0x57b1fc,_0x540ece[_0x02aa('0x40')]);var _0x505eb2={'where':_0x57b1fc[_0x02aa('0x3d')]};return db[_0x02aa('0x2e')][_0x02aa('0x21')](_0x505eb2)[_0x02aa('0x27')](function(_0x405dff){_0x1ccf22['count']=_0x405dff;if(_0x540ece[_0x02aa('0x33')][_0x02aa('0x41')]){_0x57b1fc[_0x02aa('0x42')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x57b1fc);})['then'](function(_0x377ef5){_0x1ccf22[_0x02aa('0x43')]=_0x377ef5;return _0x1ccf22;})[_0x02aa('0x27')](respondWithFilteredResult(_0x5afd3d,_0x57b1fc))[_0x02aa('0x44')](handleError(_0x5afd3d,null));};exports[_0x02aa('0x45')]=function(_0x3511e0,_0x12cd02){var _0x5edf54={'raw':![],'where':{'id':_0x3511e0[_0x02aa('0x46')]['id']}},_0x203862={};_0x203862['model']=_[_0x02aa('0x34')](db[_0x02aa('0x2e')][_0x02aa('0x47')]);_0x203862['query']=_[_0x02aa('0x34')](_0x3511e0[_0x02aa('0x33')]);_0x203862[_0x02aa('0x35')]=_[_0x02aa('0x48')](_0x203862[_0x02aa('0x32')],_0x203862['query']);_0x5edf54['attributes']=_['intersection'](_0x203862['model'],qs[_0x02aa('0x37')](_0x3511e0[_0x02aa('0x33')][_0x02aa('0x37')]));_0x5edf54[_0x02aa('0x36')]=_0x5edf54[_0x02aa('0x36')][_0x02aa('0x38')]?_0x5edf54['attributes']:_0x203862[_0x02aa('0x32')];if(_0x3511e0[_0x02aa('0x33')][_0x02aa('0x41')]){_0x5edf54['include']=[{'all':!![]}];}_0x5edf54=_[_0x02aa('0x3e')]({},_0x5edf54,_0x3511e0['options']);return db['IntegrationReport'][_0x02aa('0x49')](_0x5edf54)[_0x02aa('0x27')](handleEntityNotFound(_0x12cd02,null))[_0x02aa('0x27')](respondWithResult(_0x12cd02,null))[_0x02aa('0x44')](handleError(_0x12cd02,null));};exports['create']=function(_0x54c5a9,_0x38b8d5){return db[_0x02aa('0x2e')][_0x02aa('0x4a')](_0x54c5a9[_0x02aa('0x4b')],{})['then'](respondWithResult(_0x38b8d5,0xc9))[_0x02aa('0x44')](handleError(_0x38b8d5,null));};exports['update']=function(_0x50d96d,_0x48635f){if(_0x50d96d[_0x02aa('0x4b')]['id']){delete _0x50d96d[_0x02aa('0x4b')]['id'];}return db[_0x02aa('0x2e')][_0x02aa('0x49')]({'where':{'id':_0x50d96d[_0x02aa('0x46')]['id']}})[_0x02aa('0x27')](handleEntityNotFound(_0x48635f,null))['then'](saveUpdates(_0x50d96d['body'],null))[_0x02aa('0x27')](respondWithResult(_0x48635f,null))['catch'](handleError(_0x48635f,null));};exports[_0x02aa('0x28')]=function(_0x53fc19,_0x223293){return db['IntegrationReport'][_0x02aa('0x49')]({'where':{'id':_0x53fc19[_0x02aa('0x46')]['id']}})[_0x02aa('0x27')](handleEntityNotFound(_0x223293,null))[_0x02aa('0x27')](removeEntity(_0x223293,null))[_0x02aa('0x44')](handleError(_0x223293,null));};exports['describe']=function(_0x239aef,_0x28c060){return db[_0x02aa('0x2e')][_0x02aa('0x4c')]()[_0x02aa('0x27')](respondWithResult(_0x28c060,null))[_0x02aa('0x44')](handleError(_0x28c060,null));}; \ No newline at end of file +var _0x4980=['index','map','IntegrationReport','fieldName','key','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','model','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name'];(function(_0x36c3c7,_0x52f866){var _0x52bc17=function(_0x2bd0f0){while(--_0x2bd0f0){_0x36c3c7['push'](_0x36c3c7['shift']());}};_0x52bc17(++_0x52f866);}(_0x4980,0x6e));var _0x0498=function(_0x1abef6,_0x7d68e2){_0x1abef6=_0x1abef6-0x0;var _0x48c50e=_0x4980[_0x1abef6];return _0x48c50e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0498('0x0'));var zipdir=require(_0x0498('0x1'));var jsonpatch=require(_0x0498('0x2'));var rp=require(_0x0498('0x3'));var moment=require(_0x0498('0x4'));var BPromise=require(_0x0498('0x5'));var Mustache=require('mustache');var util=require(_0x0498('0x6'));var path=require(_0x0498('0x7'));var sox=require(_0x0498('0x8'));var csv=require('to-csv');var ejs=require(_0x0498('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0498('0xa'));var squel=require(_0x0498('0xb'));var crypto=require(_0x0498('0xc'));var jsforce=require(_0x0498('0xd'));var deskjs=require(_0x0498('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0498('0xf'));var Papa=require(_0x0498('0x10'));var Redis=require(_0x0498('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0498('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0498('0x13'));var logger=require('../../config/logger')(_0x0498('0x14'));var utils=require('../../config/utils');var config=require(_0x0498('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0498('0x16'))['db'];function respondWithStatusCode(_0x1ba1ae,_0x2cbd01){_0x2cbd01=_0x2cbd01||0xcc;return function(_0x1bb8fd){if(_0x1bb8fd){return _0x1ba1ae['sendStatus'](_0x2cbd01);}return _0x1ba1ae[_0x0498('0x17')](_0x2cbd01)[_0x0498('0x18')]();};}function respondWithResult(_0x416ed2,_0x3f4fb0){_0x3f4fb0=_0x3f4fb0||0xc8;return function(_0x55b6ec){if(_0x55b6ec){return _0x416ed2['status'](_0x3f4fb0)[_0x0498('0x19')](_0x55b6ec);}};}function respondWithFilteredResult(_0x2eca6b,_0x1ca79c){return function(_0x45b85b){if(_0x45b85b){var _0x2a8fc3=typeof _0x1ca79c[_0x0498('0x1a')]===_0x0498('0x1b')&&typeof _0x1ca79c[_0x0498('0x1c')]===_0x0498('0x1b');var _0xc28e4d=_0x45b85b[_0x0498('0x1d')];var _0x4233cb=_0x2a8fc3?0x0:_0x1ca79c['offset'];var _0x4d7b17=_0x2a8fc3?_0x45b85b[_0x0498('0x1d')]:_0x1ca79c[_0x0498('0x1a')]+_0x1ca79c[_0x0498('0x1c')];var _0x471349;if(_0x4d7b17>=_0xc28e4d){_0x4d7b17=_0xc28e4d;_0x471349=0xc8;}else{_0x471349=0xce;}_0x2eca6b[_0x0498('0x17')](_0x471349);return _0x2eca6b['set'](_0x0498('0x1e'),_0x4233cb+'-'+_0x4d7b17+'/'+_0xc28e4d)['json'](_0x45b85b);}return null;};}function patchUpdates(_0x43807f){return function(_0x5414c3){try{jsonpatch[_0x0498('0x1f')](_0x5414c3,_0x43807f,!![]);}catch(_0x396b9e){return BPromise[_0x0498('0x20')](_0x396b9e);}return _0x5414c3[_0x0498('0x21')]();};}function saveUpdates(_0x14f38d,_0x23dfb0){return function(_0x52d175){if(_0x52d175){return _0x52d175[_0x0498('0x22')](_0x14f38d)[_0x0498('0x23')](function(_0x2126a3){return _0x2126a3;});}return null;};}function removeEntity(_0x596d1d,_0x58826a){return function(_0x563e01){if(_0x563e01){return _0x563e01[_0x0498('0x24')]()[_0x0498('0x23')](function(){_0x596d1d[_0x0498('0x17')](0xcc)[_0x0498('0x18')]();});}};}function handleEntityNotFound(_0xc57d07,_0x5b7ffa){return function(_0x7c07bd){if(!_0x7c07bd){_0xc57d07[_0x0498('0x25')](0x194);}return _0x7c07bd;};}function handleError(_0x2d6bab,_0x2a49cb){_0x2a49cb=_0x2a49cb||0x1f4;return function(_0x2ebd3e){logger[_0x0498('0x26')](_0x2ebd3e['stack']);if(_0x2ebd3e[_0x0498('0x27')]){delete _0x2ebd3e[_0x0498('0x27')];}_0x2d6bab['status'](_0x2a49cb)['send'](_0x2ebd3e);};}exports[_0x0498('0x28')]=function(_0x999c0e,_0x1cfd41){var _0x1c0223={},_0x4c7f46={},_0xdb44d5={'count':0x0,'rows':[]};var _0x590c44=_[_0x0498('0x29')](db[_0x0498('0x2a')]['rawAttributes'],function(_0x1c8703){return{'name':_0x1c8703[_0x0498('0x2b')],'type':_0x1c8703['type'][_0x0498('0x2c')]};});_0x4c7f46['model']=_[_0x0498('0x29')](_0x590c44,'name');_0x4c7f46[_0x0498('0x2d')]=_[_0x0498('0x2e')](_0x999c0e[_0x0498('0x2d')]);_0x4c7f46[_0x0498('0x2f')]=_[_0x0498('0x30')](_0x4c7f46['model'],_0x4c7f46[_0x0498('0x2d')]);_0x1c0223['attributes']=_[_0x0498('0x30')](_0x4c7f46['model'],qs[_0x0498('0x31')](_0x999c0e['query'][_0x0498('0x31')]));_0x1c0223[_0x0498('0x32')]=_0x1c0223[_0x0498('0x32')][_0x0498('0x33')]?_0x1c0223[_0x0498('0x32')]:_0x4c7f46['model'];if(!_0x999c0e['query'][_0x0498('0x34')](_0x0498('0x35'))){_0x1c0223[_0x0498('0x1c')]=qs[_0x0498('0x1c')](_0x999c0e[_0x0498('0x2d')][_0x0498('0x1c')]);_0x1c0223[_0x0498('0x1a')]=qs[_0x0498('0x1a')](_0x999c0e[_0x0498('0x2d')][_0x0498('0x1a')]);}_0x1c0223[_0x0498('0x36')]=qs['sort'](_0x999c0e[_0x0498('0x2d')][_0x0498('0x37')]);_0x1c0223[_0x0498('0x38')]=qs[_0x0498('0x2f')](_[_0x0498('0x39')](_0x999c0e[_0x0498('0x2d')],_0x4c7f46['filters']),_0x590c44);if(_0x999c0e[_0x0498('0x2d')][_0x0498('0x3a')]){_0x1c0223[_0x0498('0x38')]=_[_0x0498('0x3b')](_0x1c0223['where'],{'$or':_['map'](_0x590c44,function(_0x56c82c){if(_0x56c82c[_0x0498('0x3c')]!==_0x0498('0x3d')){var _0x348993={};_0x348993[_0x56c82c[_0x0498('0x27')]]={'$like':'%'+_0x999c0e[_0x0498('0x2d')]['filter']+'%'};return _0x348993;}})});}_0x1c0223=_[_0x0498('0x3b')]({},_0x1c0223,_0x999c0e['options']);var _0xed2b2d={'where':_0x1c0223[_0x0498('0x38')]};return db[_0x0498('0x2a')][_0x0498('0x1d')](_0xed2b2d)[_0x0498('0x23')](function(_0x496141){_0xdb44d5[_0x0498('0x1d')]=_0x496141;if(_0x999c0e[_0x0498('0x2d')][_0x0498('0x3e')]){_0x1c0223[_0x0498('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0x0498('0x40')](_0x1c0223);})[_0x0498('0x23')](function(_0xac3126){_0xdb44d5[_0x0498('0x41')]=_0xac3126;return _0xdb44d5;})[_0x0498('0x23')](respondWithFilteredResult(_0x1cfd41,_0x1c0223))[_0x0498('0x42')](handleError(_0x1cfd41,null));};exports[_0x0498('0x43')]=function(_0x2e286f,_0x189fa7){var _0x2c2950={'raw':![],'where':{'id':_0x2e286f[_0x0498('0x44')]['id']}},_0x160d94={};_0x160d94['model']=_[_0x0498('0x2e')](db[_0x0498('0x2a')][_0x0498('0x45')]);_0x160d94['query']=_[_0x0498('0x2e')](_0x2e286f[_0x0498('0x2d')]);_0x160d94[_0x0498('0x2f')]=_['intersection'](_0x160d94[_0x0498('0x46')],_0x160d94[_0x0498('0x2d')]);_0x2c2950[_0x0498('0x32')]=_[_0x0498('0x30')](_0x160d94['model'],qs[_0x0498('0x31')](_0x2e286f[_0x0498('0x2d')][_0x0498('0x31')]));_0x2c2950['attributes']=_0x2c2950[_0x0498('0x32')][_0x0498('0x33')]?_0x2c2950[_0x0498('0x32')]:_0x160d94[_0x0498('0x46')];if(_0x2e286f[_0x0498('0x2d')][_0x0498('0x3e')]){_0x2c2950['include']=[{'all':!![]}];}_0x2c2950=_[_0x0498('0x3b')]({},_0x2c2950,_0x2e286f['options']);return db[_0x0498('0x2a')][_0x0498('0x47')](_0x2c2950)[_0x0498('0x23')](handleEntityNotFound(_0x189fa7,null))['then'](respondWithResult(_0x189fa7,null))['catch'](handleError(_0x189fa7,null));};exports[_0x0498('0x48')]=function(_0x45fbb2,_0x246acb){return db['IntegrationReport'][_0x0498('0x48')](_0x45fbb2[_0x0498('0x49')],{})[_0x0498('0x23')](respondWithResult(_0x246acb,0xc9))[_0x0498('0x42')](handleError(_0x246acb,null));};exports[_0x0498('0x22')]=function(_0x28be01,_0x3c48a6){if(_0x28be01[_0x0498('0x49')]['id']){delete _0x28be01[_0x0498('0x49')]['id'];}return db[_0x0498('0x2a')][_0x0498('0x47')]({'where':{'id':_0x28be01[_0x0498('0x44')]['id']}})[_0x0498('0x23')](handleEntityNotFound(_0x3c48a6,null))[_0x0498('0x23')](saveUpdates(_0x28be01[_0x0498('0x49')],null))[_0x0498('0x23')](respondWithResult(_0x3c48a6,null))[_0x0498('0x42')](handleError(_0x3c48a6,null));};exports[_0x0498('0x24')]=function(_0x15bb01,_0x43619a){return db[_0x0498('0x2a')][_0x0498('0x47')]({'where':{'id':_0x15bb01[_0x0498('0x44')]['id']}})['then'](handleEntityNotFound(_0x43619a,null))[_0x0498('0x23')](removeEntity(_0x43619a,null))['catch'](handleError(_0x43619a,null));};exports[_0x0498('0x4a')]=function(_0x1f7ea2,_0x3e7f71){return db[_0x0498('0x2a')][_0x0498('0x4a')]()['then'](respondWithResult(_0x3e7f71,null))[_0x0498('0x42')](handleError(_0x3e7f71,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c5174fe..90a431a 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 _0xbf58=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration'];(function(_0x3de81c,_0x28c541){var _0x231571=function(_0x1329ed){while(--_0x1329ed){_0x3de81c['push'](_0x3de81c['shift']());}};_0x231571(++_0x28c541);}(_0xbf58,0x1e0));var _0x8bf5=function(_0x5bd87c,_0x58c1ed){_0x5bd87c=_0x5bd87c-0x0;var _0x39e3b3=_0xbf58[_0x5bd87c];return _0x39e3b3;};'use strict';var _=require(_0x8bf5('0x0'));var util=require(_0x8bf5('0x1'));var logger=require(_0x8bf5('0x2'))(_0x8bf5('0x3'));var moment=require(_0x8bf5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bf5('0x5'));var rimraf=require(_0x8bf5('0x6'));var config=require(_0x8bf5('0x7'));var attributes=require(_0x8bf5('0x8'));module['exports']=function(_0x560e72,_0x399dce){return _0x560e72[_0x8bf5('0x9')](_0x8bf5('0xa'),attributes,{'tableName':_0x8bf5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x450b=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x280411,_0x47a41e){var _0x336bb5=function(_0xc5166a){while(--_0xc5166a){_0x280411['push'](_0x280411['shift']());}};_0x336bb5(++_0x47a41e);}(_0x450b,0x1ed));var _0xb450=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x450b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb450('0x0'));var util=require(_0xb450('0x1'));var logger=require(_0xb450('0x2'))(_0xb450('0x3'));var moment=require(_0xb450('0x4'));var BPromise=require(_0xb450('0x5'));var rp=require(_0xb450('0x6'));var fs=require('fs');var path=require(_0xb450('0x7'));var rimraf=require(_0xb450('0x8'));var config=require(_0xb450('0x9'));var attributes=require('./integrationReport.attributes');module[_0xb450('0xa')]=function(_0x1ccdea,_0x27a3b0){return _0x1ccdea[_0xb450('0xb')](_0xb450('0xc'),attributes,{'tableName':_0xb450('0xd'),'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 9846321..aba6317 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'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')]('IntegrationReport,\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);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x298374,_0x4d34c4){var _0x42ada1=function(_0x1ed25b){while(--_0x1ed25b){_0x298374['push'](_0x298374['shift']());}};_0x42ada1(++_0x4d34c4);}(_0x2ef3,0xba));var _0x32ef=function(_0x13c276,_0x2e33fc){_0x13c276=_0x13c276-0x0;var _0x585962=_0x2ef3[_0x13c276];return _0x585962;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 608e6bd..640ee10 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 _0x46e1=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x29eb10,_0x190cb3){var _0x5371a2=function(_0x3109ea){while(--_0x3109ea){_0x29eb10['push'](_0x29eb10['shift']());}};_0x5371a2(++_0x190cb3);}(_0x46e1,0x155));var _0x146e=function(_0x4f2b2a,_0x3f44c0){_0x4f2b2a=_0x4f2b2a-0x0;var _0x2e4ca2=_0x46e1[_0x4f2b2a];return _0x2e4ca2;};'use strict';var multer=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var path=require(_0x146e('0x2'));var timeout=require(_0x146e('0x3'));var express=require(_0x146e('0x4'));var router=express[_0x146e('0x5')]();var fs_extra=require(_0x146e('0x6'));var auth=require(_0x146e('0x7'));var interaction=require(_0x146e('0x8'));var config=require(_0x146e('0x9'));var controller=require('./interval.controller');router[_0x146e('0xa')]('/',auth[_0x146e('0xb')](),controller[_0x146e('0xc')]);router[_0x146e('0xa')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0xe')]);router['get'](_0x146e('0xf'),auth['isAuthenticated'](),controller[_0x146e('0x10')]);router[_0x146e('0x11')]('/',auth[_0x146e('0xb')](),controller[_0x146e('0x12')]);router[_0x146e('0x11')](_0x146e('0xf'),auth['isAuthenticated'](),controller['addInterval']);router[_0x146e('0x11')](_0x146e('0x13'),auth[_0x146e('0xb')](),controller[_0x146e('0x14')]);router[_0x146e('0x15')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0x16')]);router['delete']('/:id',auth[_0x146e('0xb')](),controller[_0x146e('0x17')]);module[_0x146e('0x18')]=router; \ No newline at end of file +var _0xb079=['post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','index','isAuthenticated','show','/:id/sub_intervals','getIntervals'];(function(_0x3be795,_0x211987){var _0x1549f4=function(_0x1b23fa){while(--_0x1b23fa){_0x3be795['push'](_0x3be795['shift']());}};_0x1549f4(++_0x211987);}(_0xb079,0x133));var _0x9b07=function(_0x36b89c,_0x55cb2a){_0x36b89c=_0x36b89c-0x0;var _0x246228=_0xb079[_0x36b89c];return _0x246228;};'use strict';var multer=require(_0x9b07('0x0'));var util=require(_0x9b07('0x1'));var path=require(_0x9b07('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b07('0x3'));var router=express[_0x9b07('0x4')]();var fs_extra=require(_0x9b07('0x5'));var auth=require(_0x9b07('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9b07('0x7'));var controller=require(_0x9b07('0x8'));router[_0x9b07('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b07('0xa')]);router['get']('/:id',auth[_0x9b07('0xb')](),controller[_0x9b07('0xc')]);router[_0x9b07('0x9')](_0x9b07('0xd'),auth[_0x9b07('0xb')](),controller[_0x9b07('0xe')]);router[_0x9b07('0xf')]('/',auth[_0x9b07('0xb')](),controller['create']);router['post'](_0x9b07('0xd'),auth[_0x9b07('0xb')](),controller[_0x9b07('0x10')]);router[_0x9b07('0xf')](_0x9b07('0x11'),auth[_0x9b07('0xb')](),controller[_0x9b07('0x12')]);router[_0x9b07('0x13')]('/:id',auth[_0x9b07('0xb')](),controller['update']);router[_0x9b07('0x14')]('/:id',auth[_0x9b07('0xb')](),controller[_0x9b07('0x15')]);module[_0x9b07('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index e46ec21..0efe3e9 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 _0x96c8=['STRING','sequelize','exports'];(function(_0x301403,_0x22151f){var _0x5d980d=function(_0x336252){while(--_0x336252){_0x301403['push'](_0x301403['shift']());}};_0x5d980d(++_0x22151f);}(_0x96c8,0xd6));var _0x896c=function(_0x35a590,_0x2d7d79){_0x35a590=_0x35a590-0x0;var _0x12fe29=_0x96c8[_0x35a590];return _0x12fe29;};'use strict';var Sequelize=require(_0x896c('0x0'));module[_0x896c('0x1')]={'name':{'type':Sequelize[_0x896c('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x896c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x6975=['STRING','sequelize'];(function(_0x1a9dda,_0x25d932){var _0x488ba7=function(_0x4f02e5){while(--_0x4f02e5){_0x1a9dda['push'](_0x1a9dda['shift']());}};_0x488ba7(++_0x25d932);}(_0x6975,0x191));var _0x5697=function(_0x5b11e0,_0x48afdf){_0x5b11e0=_0x5b11e0-0x0;var _0x40256b=_0x6975[_0x5b11e0];return _0x40256b;};'use strict';var Sequelize=require(_0x5697('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5697('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 e058288..a4c94d0 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 _0xcf45=['../../config/logger','api','../../config/utils','../../config/license/util','../../components/extensions/rewrite','status','undefined','limit','offset','count','set','json','reject','save','update','then','get','Intervals','destroy','end','sendStatus','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','findOne','nolimit','sequelize','transaction','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x29fa3d,_0x45d24f){var _0x5d4bbf=function(_0x5b89ef){while(--_0x5b89ef){_0x29fa3d['push'](_0x29fa3d['shift']());}};_0x5d4bbf(++_0x45d24f);}(_0xcf45,0x100));var _0x5cf4=function(_0xc94941,_0x5a9cf2){_0xc94941=_0xc94941-0x0;var _0x4bcf9c=_0xcf45[_0xc94941];return _0x4bcf9c;};'use strict';var emlformat=require(_0x5cf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cf4('0x1'));var jsonpatch=require(_0x5cf4('0x2'));var rp=require('request-promise');var moment=require(_0x5cf4('0x3'));var BPromise=require(_0x5cf4('0x4'));var Mustache=require(_0x5cf4('0x5'));var util=require(_0x5cf4('0x6'));var path=require(_0x5cf4('0x7'));var sox=require(_0x5cf4('0x8'));var csv=require(_0x5cf4('0x9'));var ejs=require(_0x5cf4('0xa'));var fs=require('fs');var fs_extra=require(_0x5cf4('0xb'));var _=require(_0x5cf4('0xc'));var squel=require(_0x5cf4('0xd'));var crypto=require(_0x5cf4('0xe'));var jsforce=require(_0x5cf4('0xf'));var deskjs=require(_0x5cf4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5cf4('0x11'));var Papa=require(_0x5cf4('0x12'));var Redis=require(_0x5cf4('0x13'));var authService=require(_0x5cf4('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5cf4('0x15'));var hardwareService=require(_0x5cf4('0x16'));var logger=require(_0x5cf4('0x17'))(_0x5cf4('0x18'));var utils=require(_0x5cf4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5cf4('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require(_0x5cf4('0x1b'));function respondWithStatusCode(_0x4b06a2,_0x2eefbe){_0x2eefbe=_0x2eefbe||0xcc;return function(_0x5de29e){if(_0x5de29e){return _0x4b06a2['sendStatus'](_0x2eefbe);}return _0x4b06a2['status'](_0x2eefbe)['end']();};}function respondWithResult(_0xcb4a4b,_0x43cba9){_0x43cba9=_0x43cba9||0xc8;return function(_0x4ddbd4){if(_0x4ddbd4){return _0xcb4a4b[_0x5cf4('0x1c')](_0x43cba9)['json'](_0x4ddbd4);}};}function respondWithFilteredResult(_0x688ed0,_0x4753b0){return function(_0x517d21){if(_0x517d21){var _0x546c6d=typeof _0x4753b0['offset']===_0x5cf4('0x1d')&&typeof _0x4753b0[_0x5cf4('0x1e')]===_0x5cf4('0x1d');var _0x1ca315=_0x517d21['count'];var _0x16c08a=_0x546c6d?0x0:_0x4753b0[_0x5cf4('0x1f')];var _0x4427d7=_0x546c6d?_0x517d21[_0x5cf4('0x20')]:_0x4753b0[_0x5cf4('0x1f')]+_0x4753b0[_0x5cf4('0x1e')];var _0x24831c;if(_0x4427d7>=_0x1ca315){_0x4427d7=_0x1ca315;_0x24831c=0xc8;}else{_0x24831c=0xce;}_0x688ed0[_0x5cf4('0x1c')](_0x24831c);return _0x688ed0[_0x5cf4('0x21')]('Content-Range',_0x16c08a+'-'+_0x4427d7+'/'+_0x1ca315)[_0x5cf4('0x22')](_0x517d21);}return null;};}function patchUpdates(_0x233d78){return function(_0x9824d0){try{jsonpatch['apply'](_0x9824d0,_0x233d78,!![]);}catch(_0x3cb65f){return BPromise[_0x5cf4('0x23')](_0x3cb65f);}return _0x9824d0[_0x5cf4('0x24')]();};}function saveUpdates(_0x52a38b,_0x5afdcb){return function(_0x2bfa3d){if(_0x2bfa3d){return _0x2bfa3d[_0x5cf4('0x25')](_0x52a38b)[_0x5cf4('0x26')](function(_0x3b8494){return _0x3b8494;});}return null;};}function removeEntity(_0x239f22,_0x346927){return function(_0x8b335c){if(_0x8b335c){return _0x8b335c['destroy']()[_0x5cf4('0x26')](function(){var _0x2f6765=_0x8b335c[_0x5cf4('0x27')]({'plain':!![]});var _0x594855=_0x5cf4('0x28');return db['UserProfileResource'][_0x5cf4('0x29')]({'where':{'type':_0x594855,'resourceId':_0x2f6765['id']}})['then'](function(){return _0x8b335c;});})[_0x5cf4('0x26')](function(){_0x239f22['status'](0xcc)[_0x5cf4('0x2a')]();});}};}function handleEntityNotFound(_0x557a29,_0x6cfd8){return function(_0x38fce5){if(!_0x38fce5){_0x557a29[_0x5cf4('0x2b')](0x194);}return _0x38fce5;};}function handleError(_0x19cde9,_0x220fd9){_0x220fd9=_0x220fd9||0x1f4;return function(_0x6a13d8){logger[_0x5cf4('0x2c')](_0x6a13d8[_0x5cf4('0x2d')]);if(_0x6a13d8[_0x5cf4('0x2e')]){delete _0x6a13d8[_0x5cf4('0x2e')];}_0x19cde9[_0x5cf4('0x1c')](_0x220fd9)[_0x5cf4('0x2f')](_0x6a13d8);};}exports[_0x5cf4('0x30')]=function(_0x5e734b,_0x47ac4c){var _0x14fb8b={},_0x2f0110={},_0x4c6623={'count':0x0,'rows':[]};var _0x586f20=_[_0x5cf4('0x31')](db[_0x5cf4('0x32')][_0x5cf4('0x33')],function(_0x549ee9){return{'name':_0x549ee9[_0x5cf4('0x34')],'type':_0x549ee9[_0x5cf4('0x35')][_0x5cf4('0x36')]};});_0x2f0110[_0x5cf4('0x37')]=_['map'](_0x586f20,_0x5cf4('0x2e'));_0x2f0110['query']=_[_0x5cf4('0x38')](_0x5e734b[_0x5cf4('0x39')]);_0x2f0110['filters']=_[_0x5cf4('0x3a')](_0x2f0110[_0x5cf4('0x37')],_0x2f0110[_0x5cf4('0x39')]);_0x14fb8b[_0x5cf4('0x3b')]=_[_0x5cf4('0x3a')](_0x2f0110[_0x5cf4('0x37')],qs['fields'](_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x3c')]));_0x14fb8b['attributes']=_0x14fb8b['attributes'][_0x5cf4('0x3d')]?_0x14fb8b[_0x5cf4('0x3b')]:_0x2f0110[_0x5cf4('0x37')];if(!_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x3e')]('nolimit')){_0x14fb8b[_0x5cf4('0x1e')]=qs['limit'](_0x5e734b['query'][_0x5cf4('0x1e')]);_0x14fb8b['offset']=qs[_0x5cf4('0x1f')](_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x1f')]);}_0x14fb8b[_0x5cf4('0x3f')]=qs[_0x5cf4('0x40')](_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x40')]);_0x14fb8b[_0x5cf4('0x41')]=qs[_0x5cf4('0x42')](_[_0x5cf4('0x43')](_0x5e734b[_0x5cf4('0x39')],_0x2f0110[_0x5cf4('0x42')]),_0x586f20);if(_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x44')]){_0x14fb8b[_0x5cf4('0x41')]=_['merge'](_0x14fb8b[_0x5cf4('0x41')],{'$or':_[_0x5cf4('0x31')](_0x586f20,function(_0x4530a1){if(_0x4530a1[_0x5cf4('0x35')]!==_0x5cf4('0x45')){var _0x3a5e84={};_0x3a5e84[_0x4530a1[_0x5cf4('0x2e')]]={'$like':'%'+_0x5e734b['query'][_0x5cf4('0x44')]+'%'};return _0x3a5e84;}})});}_0x14fb8b=_[_0x5cf4('0x46')]({},_0x14fb8b,_0x5e734b['options']);var _0x5e9679={'where':_0x14fb8b[_0x5cf4('0x41')]};return db[_0x5cf4('0x32')]['count'](_0x5e9679)[_0x5cf4('0x26')](function(_0x443c5d){_0x4c6623['count']=_0x443c5d;if(_0x5e734b[_0x5cf4('0x39')][_0x5cf4('0x47')]){_0x14fb8b[_0x5cf4('0x48')]=[{'all':!![]}];}return db['Interval'][_0x5cf4('0x49')](_0x14fb8b);})[_0x5cf4('0x26')](function(_0x9a7dc9){_0x4c6623['rows']=_0x9a7dc9;return _0x4c6623;})[_0x5cf4('0x26')](respondWithFilteredResult(_0x47ac4c,_0x14fb8b))[_0x5cf4('0x4a')](handleError(_0x47ac4c,null));};exports['show']=function(_0x2c73d8,_0x48e410){var _0x121616={'raw':!![],'where':{'id':_0x2c73d8['params']['id']}},_0x207bbb={};_0x207bbb['model']=_[_0x5cf4('0x38')](db['Interval'][_0x5cf4('0x33')]);_0x207bbb['query']=_[_0x5cf4('0x38')](_0x2c73d8[_0x5cf4('0x39')]);_0x207bbb['filters']=_[_0x5cf4('0x3a')](_0x207bbb[_0x5cf4('0x37')],_0x207bbb['query']);_0x121616[_0x5cf4('0x3b')]=_[_0x5cf4('0x3a')](_0x207bbb[_0x5cf4('0x37')],qs[_0x5cf4('0x3c')](_0x2c73d8[_0x5cf4('0x39')][_0x5cf4('0x3c')]));_0x121616[_0x5cf4('0x3b')]=_0x121616['attributes'][_0x5cf4('0x3d')]?_0x121616[_0x5cf4('0x3b')]:_0x207bbb[_0x5cf4('0x37')];if(_0x2c73d8[_0x5cf4('0x39')]['includeAll']){_0x121616[_0x5cf4('0x48')]=[{'all':!![]}];}_0x121616=_[_0x5cf4('0x46')]({},_0x121616,_0x2c73d8[_0x5cf4('0x4b')]);return db['Interval']['find'](_0x121616)[_0x5cf4('0x26')](handleEntityNotFound(_0x48e410,null))[_0x5cf4('0x26')](respondWithResult(_0x48e410,null))[_0x5cf4('0x4a')](handleError(_0x48e410,null));};exports[_0x5cf4('0x4c')]=function(_0x26cd4c,_0x4c65df){return db[_0x5cf4('0x32')][_0x5cf4('0x4c')](_0x26cd4c[_0x5cf4('0x4d')],{})['then'](function(_0x4b80e4){var _0x2da3fc=_0x26cd4c['user'][_0x5cf4('0x27')]({'plain':!![]});if(!_0x2da3fc)throw new Error(_0x5cf4('0x4e'));if(_0x2da3fc['role']===_0x5cf4('0x4f')){var _0x489746=_0x4b80e4[_0x5cf4('0x27')]({'plain':!![]});var _0x459dc4=_0x5cf4('0x28');return db['UserProfileSection'][_0x5cf4('0x50')]({'where':{'name':_0x459dc4,'userProfileId':_0x2da3fc[_0x5cf4('0x51')]},'raw':!![]})[_0x5cf4('0x26')](function(_0x85d33){if(_0x85d33&&_0x85d33[_0x5cf4('0x52')]===0x0){return db[_0x5cf4('0x53')][_0x5cf4('0x4c')]({'name':_0x489746[_0x5cf4('0x2e')],'resourceId':_0x489746['id'],'type':_0x85d33[_0x5cf4('0x2e')],'sectionId':_0x85d33['id']},{})['then'](function(){return _0x4b80e4;});}else{return _0x4b80e4;}})[_0x5cf4('0x4a')](function(_0xe50090){logger[_0x5cf4('0x2c')](_0x5cf4('0x54'),_0xe50090);throw _0xe50090;});}return _0x4b80e4;})[_0x5cf4('0x26')](respondWithResult(_0x4c65df,0xc9))[_0x5cf4('0x4a')](handleError(_0x4c65df,null));};exports[_0x5cf4('0x25')]=function(_0xf7d930,_0x40e9f7){if(_0xf7d930[_0x5cf4('0x4d')]['id']){delete _0xf7d930['body']['id'];}return db[_0x5cf4('0x32')][_0x5cf4('0x50')]({'where':{'id':_0xf7d930[_0x5cf4('0x55')]['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x40e9f7,null))[_0x5cf4('0x26')](saveUpdates(_0xf7d930['body'],null))['then'](respondWithResult(_0x40e9f7,null))[_0x5cf4('0x4a')](handleError(_0x40e9f7,null));};exports[_0x5cf4('0x29')]=function(_0x450a6e,_0x1487eb){return db[_0x5cf4('0x32')][_0x5cf4('0x50')]({'where':{'id':_0x450a6e['params']['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x1487eb,null))[_0x5cf4('0x26')](removeEntity(_0x1487eb,null))[_0x5cf4('0x4a')](handleError(_0x1487eb,null));};exports[_0x5cf4('0x56')]=function(_0x168654,_0x462d4f,_0x9f78e6){if(_0x168654[_0x5cf4('0x4d')]['id']){delete _0x168654['body']['id'];}return db['Interval'][_0x5cf4('0x50')]({'where':{'id':_0x168654[_0x5cf4('0x55')]['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x462d4f,null))['then'](function(_0xbfad80){if(_0xbfad80){_0x168654[_0x5cf4('0x4d')][_0x5cf4('0x57')]=_0xbfad80['id'];return db[_0x5cf4('0x32')][_0x5cf4('0x4c')](_0x168654[_0x5cf4('0x4d')]);}})['then'](respondWithResult(_0x462d4f,null))['catch'](handleError(_0x462d4f,null));};exports[_0x5cf4('0x58')]=function(_0x40b74e,_0x41f3e1,_0x83ac19){var _0x1383d3={};var _0x204894={};var _0x5afd30;var _0x3de68e;return db[_0x5cf4('0x32')][_0x5cf4('0x59')]({'where':{'id':_0x40b74e[_0x5cf4('0x55')]['id']}})['then'](handleEntityNotFound(_0x41f3e1,null))[_0x5cf4('0x26')](function(_0x181283){if(_0x181283){_0x5afd30=_0x181283;_0x204894[_0x5cf4('0x37')]=_['keys'](db[_0x5cf4('0x32')][_0x5cf4('0x33')]);_0x204894[_0x5cf4('0x39')]=_[_0x5cf4('0x38')](_0x40b74e[_0x5cf4('0x39')]);_0x204894['filters']=_[_0x5cf4('0x3a')](_0x204894[_0x5cf4('0x37')],_0x204894[_0x5cf4('0x39')]);_0x1383d3[_0x5cf4('0x3b')]=_['intersection'](_0x204894[_0x5cf4('0x37')],qs[_0x5cf4('0x3c')](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x3c')]));_0x1383d3[_0x5cf4('0x3b')]=_0x1383d3[_0x5cf4('0x3b')][_0x5cf4('0x3d')]?_0x1383d3[_0x5cf4('0x3b')]:_0x204894[_0x5cf4('0x37')];_0x1383d3[_0x5cf4('0x3f')]=qs[_0x5cf4('0x40')](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x40')]);_0x1383d3[_0x5cf4('0x41')]=qs[_0x5cf4('0x42')](_['pick'](_0x40b74e[_0x5cf4('0x39')],_0x204894[_0x5cf4('0x42')]));if(_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x44')]){_0x1383d3[_0x5cf4('0x41')]=_['merge'](_0x1383d3[_0x5cf4('0x41')],{'$or':_[_0x5cf4('0x31')](_0x1383d3[_0x5cf4('0x3b')],function(_0x2c7caf){var _0xf722a1={};_0xf722a1[_0x2c7caf]={'$like':'%'+_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x44')]+'%'};return _0xf722a1;})});}_0x1383d3=_[_0x5cf4('0x46')]({},_0x1383d3,_0x40b74e['options']);return _0x5afd30[_0x5cf4('0x58')](_0x1383d3);}})[_0x5cf4('0x26')](function(_0x5da942){if(_0x5da942){_0x3de68e=_0x5da942[_0x5cf4('0x3d')];if(!_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x3e')](_0x5cf4('0x5a'))){_0x1383d3[_0x5cf4('0x1e')]=qs[_0x5cf4('0x1e')](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x1e')]);_0x1383d3[_0x5cf4('0x1f')]=qs['offset'](_0x40b74e[_0x5cf4('0x39')][_0x5cf4('0x1f')]);}return _0x5afd30[_0x5cf4('0x58')](_0x1383d3);}})[_0x5cf4('0x26')](function(_0x517a13){if(_0x517a13){return _0x517a13?{'count':_0x3de68e,'rows':_0x517a13}:null;}})[_0x5cf4('0x26')](respondWithResult(_0x41f3e1,null))[_0x5cf4('0x4a')](handleError(_0x41f3e1,null));};exports['addIntervals']=function(_0x4e7fd3,_0x59305f,_0x36c021){return db[_0x5cf4('0x32')]['findOne']({'where':{'id':_0x4e7fd3['params']['id']}})[_0x5cf4('0x26')](handleEntityNotFound(_0x59305f,null))[_0x5cf4('0x26')](function(_0x10ec38){if(_0x10ec38){return db[_0x5cf4('0x5b')][_0x5cf4('0x5c')](function(_0x423838){return db['Interval'][_0x5cf4('0x29')]({'where':{'IntervalId':_0x4e7fd3['params']['id']},'transaction':_0x423838})[_0x5cf4('0x26')](function(_0x3f54dc){var _0x2c1d34=_[_0x5cf4('0x31')](_0x4e7fd3[_0x5cf4('0x4d')],function(_0xa60079){delete _0xa60079['id'];_0xa60079[_0x5cf4('0x57')]=_0x4e7fd3[_0x5cf4('0x55')]['id'];return _0xa60079;});return db[_0x5cf4('0x32')]['bulkCreate'](_0x2c1d34,{'transaction':_0x423838});});})['then'](function(){return db['Interval'][_0x5cf4('0x49')]({'where':{'IntervalId':_0x4e7fd3[_0x5cf4('0x55')]['id']}});});}})[_0x5cf4('0x26')](respondWithResult(_0x59305f,null))['catch'](handleError(_0x59305f,null));}; \ No newline at end of file +var _0xff1d=['map','Interval','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','addIntervals','transaction','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','end','sendStatus','stack','name'];(function(_0x379d46,_0x2cfec4){var _0x30f7bd=function(_0x576482){while(--_0x576482){_0x379d46['push'](_0x379d46['shift']());}};_0x30f7bd(++_0x2cfec4);}(_0xff1d,0x130));var _0xdff1=function(_0x53f035,_0x4b5486){_0x53f035=_0x53f035-0x0;var _0x561cd3=_0xff1d[_0x53f035];return _0x561cd3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdff1('0x0'));var zipdir=require(_0xdff1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdff1('0x2'));var moment=require(_0xdff1('0x3'));var BPromise=require(_0xdff1('0x4'));var Mustache=require(_0xdff1('0x5'));var util=require(_0xdff1('0x6'));var path=require(_0xdff1('0x7'));var sox=require(_0xdff1('0x8'));var csv=require(_0xdff1('0x9'));var ejs=require(_0xdff1('0xa'));var fs=require('fs');var fs_extra=require(_0xdff1('0xb'));var _=require('lodash');var squel=require(_0xdff1('0xc'));var crypto=require('crypto');var jsforce=require(_0xdff1('0xd'));var deskjs=require(_0xdff1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdff1('0xf'));var Papa=require(_0xdff1('0x10'));var Redis=require('ioredis');var authService=require(_0xdff1('0x11'));var qs=require(_0xdff1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdff1('0x13'));var logger=require('../../config/logger')(_0xdff1('0x14'));var utils=require('../../config/utils');var config=require(_0xdff1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdff1('0x16'))['db'];var extensions=require(_0xdff1('0x17'));function respondWithStatusCode(_0x7ff509,_0x1ed7af){_0x1ed7af=_0x1ed7af||0xcc;return function(_0x31aed7){if(_0x31aed7){return _0x7ff509['sendStatus'](_0x1ed7af);}return _0x7ff509[_0xdff1('0x18')](_0x1ed7af)['end']();};}function respondWithResult(_0x1a03b7,_0x3866c4){_0x3866c4=_0x3866c4||0xc8;return function(_0x237225){if(_0x237225){return _0x1a03b7[_0xdff1('0x18')](_0x3866c4)[_0xdff1('0x19')](_0x237225);}};}function respondWithFilteredResult(_0x1b71b7,_0x40cfb6){return function(_0x1b46db){if(_0x1b46db){var _0x36a70f=typeof _0x40cfb6['offset']===_0xdff1('0x1a')&&typeof _0x40cfb6[_0xdff1('0x1b')]===_0xdff1('0x1a');var _0x17bb4d=_0x1b46db[_0xdff1('0x1c')];var _0x312b0e=_0x36a70f?0x0:_0x40cfb6[_0xdff1('0x1d')];var _0x10228c=_0x36a70f?_0x1b46db[_0xdff1('0x1c')]:_0x40cfb6['offset']+_0x40cfb6[_0xdff1('0x1b')];var _0x3e006b;if(_0x10228c>=_0x17bb4d){_0x10228c=_0x17bb4d;_0x3e006b=0xc8;}else{_0x3e006b=0xce;}_0x1b71b7[_0xdff1('0x18')](_0x3e006b);return _0x1b71b7['set'](_0xdff1('0x1e'),_0x312b0e+'-'+_0x10228c+'/'+_0x17bb4d)[_0xdff1('0x19')](_0x1b46db);}return null;};}function patchUpdates(_0x264eca){return function(_0x4215d8){try{jsonpatch[_0xdff1('0x1f')](_0x4215d8,_0x264eca,!![]);}catch(_0x49273a){return BPromise[_0xdff1('0x20')](_0x49273a);}return _0x4215d8[_0xdff1('0x21')]();};}function saveUpdates(_0x17a80a,_0x2a70a2){return function(_0x40f06f){if(_0x40f06f){return _0x40f06f[_0xdff1('0x22')](_0x17a80a)[_0xdff1('0x23')](function(_0x131db0){return _0x131db0;});}return null;};}function removeEntity(_0x1d5c5b,_0x29ffc3){return function(_0x42a49d){if(_0x42a49d){return _0x42a49d[_0xdff1('0x24')]()[_0xdff1('0x23')](function(){var _0x2a3961=_0x42a49d[_0xdff1('0x25')]({'plain':!![]});var _0x124382=_0xdff1('0x26');return db[_0xdff1('0x27')][_0xdff1('0x24')]({'where':{'type':_0x124382,'resourceId':_0x2a3961['id']}})[_0xdff1('0x23')](function(){return _0x42a49d;});})['then'](function(){_0x1d5c5b['status'](0xcc)[_0xdff1('0x28')]();});}};}function handleEntityNotFound(_0x4ea587,_0x4ab224){return function(_0x59f11a){if(!_0x59f11a){_0x4ea587[_0xdff1('0x29')](0x194);}return _0x59f11a;};}function handleError(_0x46f4f8,_0x58e937){_0x58e937=_0x58e937||0x1f4;return function(_0x252238){logger['error'](_0x252238[_0xdff1('0x2a')]);if(_0x252238[_0xdff1('0x2b')]){delete _0x252238['name'];}_0x46f4f8['status'](_0x58e937)['send'](_0x252238);};}exports['index']=function(_0x15d885,_0x4871af){var _0x2eaa27={},_0x187640={},_0x396444={'count':0x0,'rows':[]};var _0x2d5fd2=_[_0xdff1('0x2c')](db[_0xdff1('0x2d')][_0xdff1('0x2e')],function(_0x1d486b){return{'name':_0x1d486b[_0xdff1('0x2f')],'type':_0x1d486b[_0xdff1('0x30')]['key']};});_0x187640[_0xdff1('0x31')]=_[_0xdff1('0x2c')](_0x2d5fd2,'name');_0x187640[_0xdff1('0x32')]=_['keys'](_0x15d885[_0xdff1('0x32')]);_0x187640[_0xdff1('0x33')]=_[_0xdff1('0x34')](_0x187640[_0xdff1('0x31')],_0x187640[_0xdff1('0x32')]);_0x2eaa27[_0xdff1('0x35')]=_[_0xdff1('0x34')](_0x187640[_0xdff1('0x31')],qs['fields'](_0x15d885['query'][_0xdff1('0x36')]));_0x2eaa27['attributes']=_0x2eaa27['attributes'][_0xdff1('0x37')]?_0x2eaa27['attributes']:_0x187640[_0xdff1('0x31')];if(!_0x15d885[_0xdff1('0x32')][_0xdff1('0x38')]('nolimit')){_0x2eaa27[_0xdff1('0x1b')]=qs[_0xdff1('0x1b')](_0x15d885[_0xdff1('0x32')][_0xdff1('0x1b')]);_0x2eaa27[_0xdff1('0x1d')]=qs[_0xdff1('0x1d')](_0x15d885[_0xdff1('0x32')][_0xdff1('0x1d')]);}_0x2eaa27[_0xdff1('0x39')]=qs[_0xdff1('0x3a')](_0x15d885['query'][_0xdff1('0x3a')]);_0x2eaa27[_0xdff1('0x3b')]=qs[_0xdff1('0x33')](_[_0xdff1('0x3c')](_0x15d885['query'],_0x187640['filters']),_0x2d5fd2);if(_0x15d885['query'][_0xdff1('0x3d')]){_0x2eaa27[_0xdff1('0x3b')]=_[_0xdff1('0x3e')](_0x2eaa27['where'],{'$or':_[_0xdff1('0x2c')](_0x2d5fd2,function(_0x5d8c55){if(_0x5d8c55['type']!==_0xdff1('0x3f')){var _0x5842c3={};_0x5842c3[_0x5d8c55[_0xdff1('0x2b')]]={'$like':'%'+_0x15d885[_0xdff1('0x32')][_0xdff1('0x3d')]+'%'};return _0x5842c3;}})});}_0x2eaa27=_[_0xdff1('0x3e')]({},_0x2eaa27,_0x15d885[_0xdff1('0x40')]);var _0xd60036={'where':_0x2eaa27[_0xdff1('0x3b')]};return db[_0xdff1('0x2d')]['count'](_0xd60036)['then'](function(_0x294c6e){_0x396444[_0xdff1('0x1c')]=_0x294c6e;if(_0x15d885[_0xdff1('0x32')][_0xdff1('0x41')]){_0x2eaa27[_0xdff1('0x42')]=[{'all':!![]}];}return db['Interval'][_0xdff1('0x43')](_0x2eaa27);})[_0xdff1('0x23')](function(_0x360246){_0x396444[_0xdff1('0x44')]=_0x360246;return _0x396444;})[_0xdff1('0x23')](respondWithFilteredResult(_0x4871af,_0x2eaa27))[_0xdff1('0x45')](handleError(_0x4871af,null));};exports[_0xdff1('0x46')]=function(_0x2fde39,_0x9f4f9a){var _0x15e5c0={'raw':!![],'where':{'id':_0x2fde39[_0xdff1('0x47')]['id']}},_0x36eee4={};_0x36eee4['model']=_['keys'](db[_0xdff1('0x2d')][_0xdff1('0x2e')]);_0x36eee4[_0xdff1('0x32')]=_[_0xdff1('0x48')](_0x2fde39[_0xdff1('0x32')]);_0x36eee4[_0xdff1('0x33')]=_[_0xdff1('0x34')](_0x36eee4[_0xdff1('0x31')],_0x36eee4[_0xdff1('0x32')]);_0x15e5c0[_0xdff1('0x35')]=_[_0xdff1('0x34')](_0x36eee4[_0xdff1('0x31')],qs[_0xdff1('0x36')](_0x2fde39['query'][_0xdff1('0x36')]));_0x15e5c0['attributes']=_0x15e5c0[_0xdff1('0x35')][_0xdff1('0x37')]?_0x15e5c0[_0xdff1('0x35')]:_0x36eee4[_0xdff1('0x31')];if(_0x2fde39['query'][_0xdff1('0x41')]){_0x15e5c0['include']=[{'all':!![]}];}_0x15e5c0=_[_0xdff1('0x3e')]({},_0x15e5c0,_0x2fde39[_0xdff1('0x40')]);return db['Interval'][_0xdff1('0x49')](_0x15e5c0)['then'](handleEntityNotFound(_0x9f4f9a,null))[_0xdff1('0x23')](respondWithResult(_0x9f4f9a,null))[_0xdff1('0x45')](handleError(_0x9f4f9a,null));};exports['create']=function(_0x5f31e4,_0x2cba6a){return db[_0xdff1('0x2d')]['create'](_0x5f31e4['body'],{})[_0xdff1('0x23')](function(_0xa64ea0){var _0x47ef0f=_0x5f31e4[_0xdff1('0x4a')]['get']({'plain':!![]});if(!_0x47ef0f)throw new Error(_0xdff1('0x4b'));if(_0x47ef0f[_0xdff1('0x4c')]===_0xdff1('0x4a')){var _0x521f11=_0xa64ea0[_0xdff1('0x25')]({'plain':!![]});var _0x28d2c4='Intervals';return db[_0xdff1('0x4d')][_0xdff1('0x49')]({'where':{'name':_0x28d2c4,'userProfileId':_0x47ef0f['userProfileId']},'raw':!![]})[_0xdff1('0x23')](function(_0x32f9f6){if(_0x32f9f6&&_0x32f9f6[_0xdff1('0x4e')]===0x0){return db[_0xdff1('0x27')]['create']({'name':_0x521f11['name'],'resourceId':_0x521f11['id'],'type':_0x32f9f6['name'],'sectionId':_0x32f9f6['id']},{})[_0xdff1('0x23')](function(){return _0xa64ea0;});}else{return _0xa64ea0;}})['catch'](function(_0x9d07f0){logger[_0xdff1('0x4f')](_0xdff1('0x50'),_0x9d07f0);throw _0x9d07f0;});}return _0xa64ea0;})[_0xdff1('0x23')](respondWithResult(_0x2cba6a,0xc9))[_0xdff1('0x45')](handleError(_0x2cba6a,null));};exports[_0xdff1('0x22')]=function(_0x3812e4,_0x1805a3){if(_0x3812e4[_0xdff1('0x51')]['id']){delete _0x3812e4[_0xdff1('0x51')]['id'];}return db[_0xdff1('0x2d')][_0xdff1('0x49')]({'where':{'id':_0x3812e4[_0xdff1('0x47')]['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x1805a3,null))[_0xdff1('0x23')](saveUpdates(_0x3812e4[_0xdff1('0x51')],null))[_0xdff1('0x23')](respondWithResult(_0x1805a3,null))[_0xdff1('0x45')](handleError(_0x1805a3,null));};exports[_0xdff1('0x24')]=function(_0xf8c080,_0x1fc159){return db['Interval'][_0xdff1('0x49')]({'where':{'id':_0xf8c080['params']['id']}})['then'](handleEntityNotFound(_0x1fc159,null))[_0xdff1('0x23')](removeEntity(_0x1fc159,null))[_0xdff1('0x45')](handleError(_0x1fc159,null));};exports[_0xdff1('0x52')]=function(_0x27f627,_0x2a6d83,_0x9330e8){if(_0x27f627[_0xdff1('0x51')]['id']){delete _0x27f627['body']['id'];}return db['Interval'][_0xdff1('0x49')]({'where':{'id':_0x27f627[_0xdff1('0x47')]['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x2a6d83,null))[_0xdff1('0x23')](function(_0x4f7368){if(_0x4f7368){_0x27f627[_0xdff1('0x51')][_0xdff1('0x53')]=_0x4f7368['id'];return db['Interval']['create'](_0x27f627[_0xdff1('0x51')]);}})[_0xdff1('0x23')](respondWithResult(_0x2a6d83,null))[_0xdff1('0x45')](handleError(_0x2a6d83,null));};exports['getIntervals']=function(_0x16f043,_0x4ad92e,_0x2da8d9){var _0x1a6e39={};var _0x41c82e={};var _0x2fa61f;var _0x21a58f;return db[_0xdff1('0x2d')]['findOne']({'where':{'id':_0x16f043['params']['id']}})[_0xdff1('0x23')](handleEntityNotFound(_0x4ad92e,null))[_0xdff1('0x23')](function(_0x1f1f79){if(_0x1f1f79){_0x2fa61f=_0x1f1f79;_0x41c82e[_0xdff1('0x31')]=_[_0xdff1('0x48')](db[_0xdff1('0x2d')][_0xdff1('0x2e')]);_0x41c82e['query']=_['keys'](_0x16f043[_0xdff1('0x32')]);_0x41c82e[_0xdff1('0x33')]=_[_0xdff1('0x34')](_0x41c82e[_0xdff1('0x31')],_0x41c82e[_0xdff1('0x32')]);_0x1a6e39[_0xdff1('0x35')]=_['intersection'](_0x41c82e['model'],qs[_0xdff1('0x36')](_0x16f043[_0xdff1('0x32')][_0xdff1('0x36')]));_0x1a6e39[_0xdff1('0x35')]=_0x1a6e39[_0xdff1('0x35')]['length']?_0x1a6e39[_0xdff1('0x35')]:_0x41c82e[_0xdff1('0x31')];_0x1a6e39['order']=qs[_0xdff1('0x3a')](_0x16f043['query']['sort']);_0x1a6e39[_0xdff1('0x3b')]=qs[_0xdff1('0x33')](_[_0xdff1('0x3c')](_0x16f043[_0xdff1('0x32')],_0x41c82e[_0xdff1('0x33')]));if(_0x16f043[_0xdff1('0x32')][_0xdff1('0x3d')]){_0x1a6e39['where']=_[_0xdff1('0x3e')](_0x1a6e39[_0xdff1('0x3b')],{'$or':_[_0xdff1('0x2c')](_0x1a6e39[_0xdff1('0x35')],function(_0x4feb6c){var _0x2cbe36={};_0x2cbe36[_0x4feb6c]={'$like':'%'+_0x16f043[_0xdff1('0x32')]['filter']+'%'};return _0x2cbe36;})});}_0x1a6e39=_[_0xdff1('0x3e')]({},_0x1a6e39,_0x16f043[_0xdff1('0x40')]);return _0x2fa61f[_0xdff1('0x54')](_0x1a6e39);}})[_0xdff1('0x23')](function(_0x40382c){if(_0x40382c){_0x21a58f=_0x40382c[_0xdff1('0x37')];if(!_0x16f043[_0xdff1('0x32')][_0xdff1('0x38')]('nolimit')){_0x1a6e39['limit']=qs[_0xdff1('0x1b')](_0x16f043['query']['limit']);_0x1a6e39['offset']=qs[_0xdff1('0x1d')](_0x16f043[_0xdff1('0x32')][_0xdff1('0x1d')]);}return _0x2fa61f[_0xdff1('0x54')](_0x1a6e39);}})['then'](function(_0x180b77){if(_0x180b77){return _0x180b77?{'count':_0x21a58f,'rows':_0x180b77}:null;}})[_0xdff1('0x23')](respondWithResult(_0x4ad92e,null))[_0xdff1('0x45')](handleError(_0x4ad92e,null));};exports[_0xdff1('0x55')]=function(_0x489f09,_0x272562,_0x179571){return db[_0xdff1('0x2d')]['findOne']({'where':{'id':_0x489f09[_0xdff1('0x47')]['id']}})['then'](handleEntityNotFound(_0x272562,null))[_0xdff1('0x23')](function(_0x5c1f72){if(_0x5c1f72){return db['sequelize'][_0xdff1('0x56')](function(_0x29a21a){return db[_0xdff1('0x2d')]['destroy']({'where':{'IntervalId':_0x489f09[_0xdff1('0x47')]['id']},'transaction':_0x29a21a})['then'](function(_0x3265cf){var _0x44db1d=_[_0xdff1('0x2c')](_0x489f09[_0xdff1('0x51')],function(_0x5bb9fc){delete _0x5bb9fc['id'];_0x5bb9fc[_0xdff1('0x53')]=_0x489f09[_0xdff1('0x47')]['id'];return _0x5bb9fc;});return db[_0xdff1('0x2d')]['bulkCreate'](_0x44db1d,{'transaction':_0x29a21a});});})[_0xdff1('0x23')](function(){return db[_0xdff1('0x2d')][_0xdff1('0x43')]({'where':{'IntervalId':_0x489f09[_0xdff1('0x47')]['id']}});});}})['then'](respondWithResult(_0x272562,null))[_0xdff1('0x45')](handleError(_0x272562,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 2d28368..fe375f4 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 _0x9a2e=['Interval','rewrite','lodash','util','../../config/logger','path','rimraf','../../config/environment','exports','define'];(function(_0x493c5b,_0x4523de){var _0x3e487d=function(_0x3c4c48){while(--_0x3c4c48){_0x493c5b['push'](_0x493c5b['shift']());}};_0x3e487d(++_0x4523de);}(_0x9a2e,0xc0));var _0xe9a2=function(_0x1f4074,_0x23c424){_0x1f4074=_0x1f4074-0x0;var _0x4c1978=_0x9a2e[_0x1f4074];return _0x4c1978;};'use strict';var _=require(_0xe9a2('0x0'));var util=require(_0xe9a2('0x1'));var logger=require(_0xe9a2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9a2('0x3'));var rimraf=require(_0xe9a2('0x4'));var config=require(_0xe9a2('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0xe9a2('0x6')]=function(_0x15072a,_0x153f89){return _0x15072a[_0xe9a2('0x7')](_0xe9a2('0x8'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x408422,_0x34cf37){extensions[_0xe9a2('0x9')](_0x15072a,_0x408422);},'afterBulkCreate':function(_0x1296e2,_0xd1a6e0,_0x3e196e){_0x3e196e();extensions[_0xe9a2('0x9')](_0x15072a,_0x1296e2[0x0]);},'afterUpdate':function(_0x33aad0,_0x4cf311){extensions['rewrite'](_0x15072a,_0x33aad0);},'afterDestroy':function(_0x2f7d9f,_0x4505ab){extensions[_0xe9a2('0x9')](_0x15072a,_0x2f7d9f);}}});}; \ No newline at end of file +var _0x78b2=['rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals'];(function(_0x43eb6a,_0x7fcb44){var _0x544bd1=function(_0x34c030){while(--_0x34c030){_0x43eb6a['push'](_0x43eb6a['shift']());}};_0x544bd1(++_0x7fcb44);}(_0x78b2,0x91));var _0x278b=function(_0xaa808b,_0x580691){_0xaa808b=_0xaa808b-0x0;var _0x4cd1c7=_0x78b2[_0xaa808b];return _0x4cd1c7;};'use strict';var _=require(_0x278b('0x0'));var util=require(_0x278b('0x1'));var logger=require(_0x278b('0x2'))(_0x278b('0x3'));var moment=require(_0x278b('0x4'));var BPromise=require(_0x278b('0x5'));var rp=require(_0x278b('0x6'));var fs=require('fs');var path=require(_0x278b('0x7'));var rimraf=require(_0x278b('0x8'));var config=require(_0x278b('0x9'));var attributes=require(_0x278b('0xa'));var extensions=require(_0x278b('0xb'));module['exports']=function(_0x2e7588,_0x472891){return _0x2e7588[_0x278b('0xc')](_0x278b('0xd'),attributes,{'tableName':_0x278b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xfaf87,_0x3ba1bd){extensions[_0x278b('0xf')](_0x2e7588,_0xfaf87);},'afterBulkCreate':function(_0x1eb3c4,_0x2f5af3,_0x3c4c6e){_0x3c4c6e();extensions[_0x278b('0xf')](_0x2e7588,_0x1eb3c4[0x0]);},'afterUpdate':function(_0x38682e,_0x13bcae){extensions[_0x278b('0xf')](_0x2e7588,_0x38682e);},'afterDestroy':function(_0x3299c9,_0x1ea588){extensions[_0x278b('0xf')](_0x2e7588,_0x3299c9);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6d2698a..200cfbd 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(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 5d5e57f..3b2972b 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f812428..e74446c 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 _0xd525=['Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','utf8','end','status','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify'];(function(_0x5eb77d,_0x134a0){var _0x1d71f7=function(_0x298d16){while(--_0x298d16){_0x5eb77d['push'](_0x5eb77d['shift']());}};_0x1d71f7(++_0x134a0);}(_0xd525,0x7b));var _0x5d52=function(_0x39156d,_0x359d79){_0x39156d=_0x39156d-0x0;var _0x5ab4d5=_0xd525[_0x39156d];return _0x5ab4d5;};'use strict';var BPromise=require(_0x5d52('0x0'));var https=require('https');var logger=require(_0x5d52('0x1'))('api');var USERNAME='support';var PASSWORD=_0x5d52('0x2');function openIssue(_0x2046e0,_0x46359e){var _0x12807e={'fields':{'project':{'key':_0x2046e0[_0x5d52('0x3')]||_0x5d52('0x4')},'summary':(_0x2046e0[_0x5d52('0x5')]||'Report')+_0x5d52('0x6')+_0x2046e0['ip'],'description':_0x2046e0[_0x5d52('0x7')]||JSON[_0x5d52('0x8')](_0x2046e0),'issuetype':{'name':_0x2046e0['issuetype']||_0x5d52('0x9')}}};_0x12807e['fields'][_0x5d52('0xa')]=_0x2046e0[_0x5d52('0xb')];_0x12807e[_0x5d52('0xc')][_0x5d52('0xd')]=_0x2046e0[_0x5d52('0xe')];_0x12807e[_0x5d52('0xc')][_0x5d52('0xf')]=_0x2046e0[_0x5d52('0x10')];_0x12807e['fields'][_0x5d52('0x11')]=_0x2046e0[_0x5d52('0x12')];_0x12807e['fields'][_0x5d52('0x13')]=_0x2046e0[_0x5d52('0x14')];_0x12807e['fields'][_0x5d52('0x15')]=_0x2046e0['ip'];var _0x9fc5d7={'host':_0x5d52('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x5d52('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x5d52('0x18'),'Authorization':_0x5d52('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x5d52('0x1a')](_0x5d52('0x1b'))}};var _0x5f3bae=JSON['stringify'](_0x12807e);var _0xae0ef4=https[_0x5d52('0x1c')](_0x9fc5d7,function(_0x26ec54){_0x26ec54['setEncoding'](_0x5d52('0x1d'));var _0x4094e8='';_0x26ec54['on']('data',function(_0x1f1a38){_0x4094e8+=_0x1f1a38;});_0x26ec54['on'](_0x5d52('0x1e'),function(){if(_0x46359e){return _0x46359e[_0x5d52('0x1f')](_0x26ec54['statusCode'])['json'](JSON['parse'](_0x4094e8));}});});_0xae0ef4['on'](_0x5d52('0x20'),function(_0x2b46e6){if(_0x46359e){return _0x46359e[_0x5d52('0x1f')](0x1f4)[_0x5d52('0x21')]({'errors':[{'message':_0x5d52('0x22'),'type':_0x5d52('0x23')}]});}});_0xae0ef4[_0x5d52('0x24')](_0x5f3bae);_0xae0ef4[_0x5d52('0x1e')]();}exports['openIssue']=openIssue;exports[_0x5d52('0x25')]=function(_0x4fdb7d,_0x509882){_0x4fdb7d[_0x5d52('0x26')]['ip']=_0x4fdb7d[_0x5d52('0x27')][_0x5d52('0x28')]||_0x4fdb7d['connection'][_0x5d52('0x29')]||_0x4fdb7d[_0x5d52('0x2a')][_0x5d52('0x29')]||_0x4fdb7d[_0x5d52('0x2b')][_0x5d52('0x2a')][_0x5d52('0x29')];return openIssue(_0x4fdb7d[_0x5d52('0x26')],_0x509882);}; \ No newline at end of file +var _0x1333=['../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','stringify','email','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','status','json','parse','error','api.jira','end','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x1333,0x10c));var _0x3133=function(_0x48c1ff,_0x1f2c3c){_0x48c1ff=_0x48c1ff-0x0;var _0x177ed0=_0x1333[_0x48c1ff];return _0x177ed0;};'use strict';var BPromise=require(_0x3133('0x0'));var https=require(_0x3133('0x1'));var logger=require(_0x3133('0x2'))(_0x3133('0x3'));var USERNAME=_0x3133('0x4');var PASSWORD=_0x3133('0x5');function openIssue(_0x2cc63f,_0x447848){var _0x4e9201={'fields':{'project':{'key':_0x2cc63f[_0x3133('0x6')]||_0x3133('0x7')},'summary':(_0x2cc63f[_0x3133('0x8')]||_0x3133('0x9'))+_0x3133('0xa')+_0x2cc63f['ip'],'description':_0x2cc63f['description']||JSON[_0x3133('0xb')](_0x2cc63f),'issuetype':{'name':_0x2cc63f['issuetype']||'Bug'}}};_0x4e9201['fields']['customfield_11500']=_0x2cc63f[_0x3133('0xc')];_0x4e9201['fields'][_0x3133('0xd')]=_0x2cc63f[_0x3133('0xe')];_0x4e9201[_0x3133('0xf')][_0x3133('0x10')]=_0x2cc63f[_0x3133('0x11')];_0x4e9201[_0x3133('0xf')][_0x3133('0x12')]=_0x2cc63f['name'];_0x4e9201[_0x3133('0xf')]['customfield_11504']=_0x2cc63f[_0x3133('0x13')];_0x4e9201[_0x3133('0xf')][_0x3133('0x14')]=_0x2cc63f['ip'];var _0x54592d={'host':_0x3133('0x15'),'port':0x1bb,'path':_0x3133('0x16'),'method':_0x3133('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x3133('0x18'),'Authorization':_0x3133('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x3133('0x1a')](_0x3133('0x1b'))}};var _0x1a0f29=JSON['stringify'](_0x4e9201);var _0x2b3aac=https[_0x3133('0x1c')](_0x54592d,function(_0x25afaf){_0x25afaf[_0x3133('0x1d')](_0x3133('0x1e'));var _0x579562='';_0x25afaf['on']('data',function(_0x144032){_0x579562+=_0x144032;});_0x25afaf['on']('end',function(){if(_0x447848){return _0x447848[_0x3133('0x1f')](_0x25afaf['statusCode'])[_0x3133('0x20')](JSON[_0x3133('0x21')](_0x579562));}});});_0x2b3aac['on'](_0x3133('0x22'),function(_0x129241){if(_0x447848){return _0x447848[_0x3133('0x1f')](0x1f4)[_0x3133('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x3133('0x23')}]});}});_0x2b3aac['write'](_0x1a0f29);_0x2b3aac[_0x3133('0x24')]();}exports[_0x3133('0x25')]=openIssue;exports[_0x3133('0x26')]=function(_0x1d6331,_0xd20f21){_0x1d6331[_0x3133('0x27')]['ip']=_0x1d6331[_0x3133('0x28')][_0x3133('0x29')]||_0x1d6331[_0x3133('0x2a')][_0x3133('0x2b')]||_0x1d6331[_0x3133('0x2c')]['remoteAddress']||_0x1d6331['connection']['socket']['remoteAddress'];return openIssue(_0x1d6331[_0x3133('0x27')],_0xd20f21);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9bea144..082e8be 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 _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x521847,_0x2812cb){var _0x17d69d=function(_0x5c35f7){while(--_0x5c35f7){_0x521847['push'](_0x521847['shift']());}};_0x17d69d(++_0x2812cb);}(_0x91a7,0xe7));var _0x791a=function(_0x25c69f,_0x54f4cb){_0x25c69f=_0x25c69f-0x0;var _0x36dbd0=_0x91a7[_0x25c69f];return _0x36dbd0;};'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('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1be1=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','put','update','destroy','path','connect-timeout','Router'];(function(_0x4ef618,_0x32e77b){var _0x30743c=function(_0x59b51b){while(--_0x59b51b){_0x4ef618['push'](_0x4ef618['shift']());}};_0x30743c(++_0x32e77b);}(_0x1be1,0x192));var _0x11be=function(_0x2b31bb,_0x38ca67){_0x2b31bb=_0x2b31bb-0x0;var _0x4a9b32=_0x1be1[_0x2b31bb];return _0x4a9b32;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0xb')]('/',auth[_0x11be('0x8')](),controller['create']);router[_0x11be('0xc')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xd')]);router['delete'](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xe')]);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 6aeac31..a2efe00 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x5e4cb8,_0x14c69c){_0x5e4cb8=_0x5e4cb8-0x0;var _0x3bffb1=_0x7a54[_0x5e4cb8];return _0x3bffb1;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x2c48a3,_0x3359ec){_0x2c48a3=_0x2c48a3-0x0;var _0x2a027d=_0x7a54[_0x2c48a3];return _0x2a027d;};'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 ee04524..1d1ecb0 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 _0x5a93=['VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','merge'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x5a93,0xf6));var _0x35a9=function(_0x36c732,_0x37fa2a){_0x36c732=_0x36c732-0x0;var _0x45f202=_0x5a93[_0x36c732];return _0x45f202;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35a9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35a9('0x1'));var rp=require(_0x35a9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35a9('0x3'));var util=require(_0x35a9('0x4'));var path=require(_0x35a9('0x5'));var sox=require('sox');var csv=require(_0x35a9('0x6'));var ejs=require(_0x35a9('0x7'));var fs=require('fs');var fs_extra=require(_0x35a9('0x8'));var _=require(_0x35a9('0x9'));var squel=require(_0x35a9('0xa'));var crypto=require(_0x35a9('0xb'));var jsforce=require(_0x35a9('0xc'));var deskjs=require(_0x35a9('0xd'));var toCsv=require(_0x35a9('0x6'));var querystring=require(_0x35a9('0xe'));var Papa=require(_0x35a9('0xf'));var Redis=require(_0x35a9('0x10'));var authService=require(_0x35a9('0x11'));var qs=require(_0x35a9('0x12'));var as=require(_0x35a9('0x13'));var hardwareService=require(_0x35a9('0x14'));var logger=require(_0x35a9('0x15'))('api');var utils=require(_0x35a9('0x16'));var config=require(_0x35a9('0x17'));var licenseUtil=require(_0x35a9('0x18'));var db=require(_0x35a9('0x19'))['db'];function respondWithStatusCode(_0x49fe9f,_0x18322c){_0x18322c=_0x18322c||0xcc;return function(_0x1bd345){if(_0x1bd345){return _0x49fe9f[_0x35a9('0x1a')](_0x18322c);}return _0x49fe9f[_0x35a9('0x1b')](_0x18322c)['end']();};}function respondWithResult(_0x112b5e,_0x2e3faa){_0x2e3faa=_0x2e3faa||0xc8;return function(_0x76f27c){if(_0x76f27c){return _0x112b5e[_0x35a9('0x1b')](_0x2e3faa)['json'](_0x76f27c);}};}function respondWithFilteredResult(_0xb4c847,_0x47f65b){return function(_0x21b9f1){if(_0x21b9f1){var _0x5b0f9b=typeof _0x47f65b[_0x35a9('0x1c')]===_0x35a9('0x1d')&&typeof _0x47f65b[_0x35a9('0x1e')]===_0x35a9('0x1d');var _0x2a4786=_0x21b9f1[_0x35a9('0x1f')];var _0x56f31f=_0x5b0f9b?0x0:_0x47f65b[_0x35a9('0x1c')];var _0x4490d5=_0x5b0f9b?_0x21b9f1[_0x35a9('0x1f')]:_0x47f65b[_0x35a9('0x1c')]+_0x47f65b[_0x35a9('0x1e')];var _0x545462;if(_0x4490d5>=_0x2a4786){_0x4490d5=_0x2a4786;_0x545462=0xc8;}else{_0x545462=0xce;}_0xb4c847[_0x35a9('0x1b')](_0x545462);return _0xb4c847['set'](_0x35a9('0x20'),_0x56f31f+'-'+_0x4490d5+'/'+_0x2a4786)[_0x35a9('0x21')](_0x21b9f1);}return null;};}function patchUpdates(_0xb11616){return function(_0x2905a2){try{jsonpatch[_0x35a9('0x22')](_0x2905a2,_0xb11616,!![]);}catch(_0x6a7a9f){return BPromise[_0x35a9('0x23')](_0x6a7a9f);}return _0x2905a2[_0x35a9('0x24')]();};}function saveUpdates(_0x27032e,_0x5eb97d){return function(_0x32e07c){if(_0x32e07c){return _0x32e07c[_0x35a9('0x25')](_0x27032e)['then'](function(_0x59222a){return _0x59222a;});}return null;};}function removeEntity(_0x133bdf,_0x1dd1ab){return function(_0x1f9935){if(_0x1f9935){return _0x1f9935[_0x35a9('0x26')]()[_0x35a9('0x27')](function(){_0x133bdf['status'](0xcc)[_0x35a9('0x28')]();});}};}function handleEntityNotFound(_0xc31cd1,_0x98a89b){return function(_0x180472){if(!_0x180472){_0xc31cd1[_0x35a9('0x1a')](0x194);}return _0x180472;};}function handleError(_0x5ba62a,_0x484212){_0x484212=_0x484212||0x1f4;return function(_0x5dfc9f){logger[_0x35a9('0x29')](_0x5dfc9f['stack']);if(_0x5dfc9f[_0x35a9('0x2a')]){delete _0x5dfc9f[_0x35a9('0x2a')];}_0x5ba62a['status'](_0x484212)[_0x35a9('0x2b')](_0x5dfc9f);};}exports['index']=function(_0x1fc384,_0x42b5bd){var _0x59ae09={},_0x534455={},_0x16ee46={'count':0x0,'rows':[]};var _0x207444=_[_0x35a9('0x2c')](db[_0x35a9('0x2d')][_0x35a9('0x2e')],function(_0x15ac13){return{'name':_0x15ac13[_0x35a9('0x2f')],'type':_0x15ac13[_0x35a9('0x30')]['key']};});_0x534455[_0x35a9('0x31')]=_[_0x35a9('0x2c')](_0x207444,_0x35a9('0x2a'));_0x534455[_0x35a9('0x32')]=_[_0x35a9('0x33')](_0x1fc384[_0x35a9('0x32')]);_0x534455['filters']=_[_0x35a9('0x34')](_0x534455[_0x35a9('0x31')],_0x534455[_0x35a9('0x32')]);_0x59ae09['attributes']=_[_0x35a9('0x34')](_0x534455['model'],qs[_0x35a9('0x35')](_0x1fc384[_0x35a9('0x32')][_0x35a9('0x35')]));_0x59ae09[_0x35a9('0x36')]=_0x59ae09[_0x35a9('0x36')][_0x35a9('0x37')]?_0x59ae09['attributes']:_0x534455['model'];if(!_0x1fc384[_0x35a9('0x32')][_0x35a9('0x38')]('nolimit')){_0x59ae09['limit']=qs[_0x35a9('0x1e')](_0x1fc384['query']['limit']);_0x59ae09['offset']=qs[_0x35a9('0x1c')](_0x1fc384[_0x35a9('0x32')]['offset']);}_0x59ae09[_0x35a9('0x39')]=qs[_0x35a9('0x3a')](_0x1fc384[_0x35a9('0x32')][_0x35a9('0x3a')]);_0x59ae09['where']=qs[_0x35a9('0x3b')](_[_0x35a9('0x3c')](_0x1fc384[_0x35a9('0x32')],_0x534455[_0x35a9('0x3b')]),_0x207444);if(_0x1fc384[_0x35a9('0x32')]['filter']){_0x59ae09['where']=_[_0x35a9('0x3d')](_0x59ae09['where'],{'$or':_[_0x35a9('0x2c')](_0x207444,function(_0x22cef6){if(_0x22cef6[_0x35a9('0x30')]!==_0x35a9('0x3e')){var _0x2ef6b7={};_0x2ef6b7[_0x22cef6['name']]={'$like':'%'+_0x1fc384[_0x35a9('0x32')][_0x35a9('0x3f')]+'%'};return _0x2ef6b7;}})});}_0x59ae09=_['merge']({},_0x59ae09,_0x1fc384[_0x35a9('0x40')]);var _0x43a401={'where':_0x59ae09[_0x35a9('0x41')]};return db['JscriptyAnswerReport'][_0x35a9('0x1f')](_0x43a401)[_0x35a9('0x27')](function(_0x5c11ec){_0x16ee46[_0x35a9('0x1f')]=_0x5c11ec;if(_0x1fc384[_0x35a9('0x32')][_0x35a9('0x42')]){_0x59ae09[_0x35a9('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x35a9('0x44')](_0x59ae09);})['then'](function(_0x64c900){_0x16ee46[_0x35a9('0x45')]=_0x64c900;return _0x16ee46;})[_0x35a9('0x27')](respondWithFilteredResult(_0x42b5bd,_0x59ae09))[_0x35a9('0x46')](handleError(_0x42b5bd,null));};exports[_0x35a9('0x47')]=function(_0x12a376,_0x3f721f){var _0x34a560={'raw':!![],'where':{'id':_0x12a376[_0x35a9('0x48')]['id']}},_0x57f10d={};_0x57f10d[_0x35a9('0x31')]=_['keys'](db[_0x35a9('0x2d')][_0x35a9('0x2e')]);_0x57f10d[_0x35a9('0x32')]=_[_0x35a9('0x33')](_0x12a376[_0x35a9('0x32')]);_0x57f10d[_0x35a9('0x3b')]=_[_0x35a9('0x34')](_0x57f10d[_0x35a9('0x31')],_0x57f10d[_0x35a9('0x32')]);_0x34a560[_0x35a9('0x36')]=_[_0x35a9('0x34')](_0x57f10d[_0x35a9('0x31')],qs[_0x35a9('0x35')](_0x12a376[_0x35a9('0x32')][_0x35a9('0x35')]));_0x34a560[_0x35a9('0x36')]=_0x34a560[_0x35a9('0x36')][_0x35a9('0x37')]?_0x34a560[_0x35a9('0x36')]:_0x57f10d[_0x35a9('0x31')];if(_0x12a376[_0x35a9('0x32')]['includeAll']){_0x34a560[_0x35a9('0x43')]=[{'all':!![]}];}_0x34a560=_[_0x35a9('0x3d')]({},_0x34a560,_0x12a376['options']);return db[_0x35a9('0x2d')][_0x35a9('0x49')](_0x34a560)[_0x35a9('0x27')](handleEntityNotFound(_0x3f721f,null))[_0x35a9('0x27')](respondWithResult(_0x3f721f,null))[_0x35a9('0x46')](handleError(_0x3f721f,null));};exports[_0x35a9('0x4a')]=function(_0xa7dd8c,_0x278928){return db[_0x35a9('0x2d')][_0x35a9('0x4a')](_0xa7dd8c['body'],{})[_0x35a9('0x27')](respondWithResult(_0x278928,0xc9))[_0x35a9('0x46')](handleError(_0x278928,null));};exports[_0x35a9('0x25')]=function(_0x36e412,_0x484f8e){if(_0x36e412['body']['id']){delete _0x36e412[_0x35a9('0x4b')]['id'];}return db[_0x35a9('0x2d')][_0x35a9('0x49')]({'where':{'id':_0x36e412[_0x35a9('0x48')]['id']}})['then'](handleEntityNotFound(_0x484f8e,null))[_0x35a9('0x27')](saveUpdates(_0x36e412[_0x35a9('0x4b')],null))['then'](respondWithResult(_0x484f8e,null))[_0x35a9('0x46')](handleError(_0x484f8e,null));};exports[_0x35a9('0x26')]=function(_0x1ddcfb,_0xc6db73){return db[_0x35a9('0x2d')]['find']({'where':{'id':_0x1ddcfb[_0x35a9('0x48')]['id']}})[_0x35a9('0x27')](handleEntityNotFound(_0xc6db73,null))['then'](removeEntity(_0xc6db73,null))[_0x35a9('0x46')](handleError(_0xc6db73,null));};exports[_0x35a9('0x4c')]=function(_0x2cb891,_0x301a8c){return db[_0x35a9('0x2d')][_0x35a9('0x4c')]()[_0x35a9('0x27')](respondWithResult(_0x301a8c,null))[_0x35a9('0x46')](handleError(_0x301a8c,null));}; \ No newline at end of file +var _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf987,0x18a));var _0x7f98=function(_0x45f757,_0x5ded30){_0x45f757=_0x45f757-0x0;var _0xd1853a=_0xf987[_0x45f757];return _0xd1853a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['JscriptyAnswerReport']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['JscriptyAnswerReport'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['JscriptyAnswerReport'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['JscriptyAnswerReport'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 8d81d81..c684d12 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 _0x87d6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x5d960e,_0x3cd959){var _0x30d421=function(_0x1e0ebb){while(--_0x1e0ebb){_0x5d960e['push'](_0x5d960e['shift']());}};_0x30d421(++_0x3cd959);}(_0x87d6,0x1a3));var _0x687d=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x87d6[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x687d('0x0'));var util=require(_0x687d('0x1'));var logger=require(_0x687d('0x2'))(_0x687d('0x3'));var moment=require(_0x687d('0x4'));var BPromise=require(_0x687d('0x5'));var rp=require(_0x687d('0x6'));var fs=require('fs');var path=require(_0x687d('0x7'));var rimraf=require(_0x687d('0x8'));var config=require(_0x687d('0x9'));var attributes=require(_0x687d('0xa'));module[_0x687d('0xb')]=function(_0x3d45d2,_0x282c79){return _0x3d45d2[_0x687d('0xc')](_0x687d('0xd'),attributes,{'tableName':_0x687d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94c1=['./jscriptyAnswerReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x271d02,_0x5cd222){var _0x14112d=function(_0x43c775){while(--_0x43c775){_0x271d02['push'](_0x271d02['shift']());}};_0x14112d(++_0x5cd222);}(_0x94c1,0x147));var _0x194c=function(_0x5c4cad,_0x32699f){_0x5c4cad=_0x5c4cad-0x0;var _0x271c39=_0x94c1[_0x5c4cad];return _0x271c39;};'use strict';var _=require(_0x194c('0x0'));var util=require(_0x194c('0x1'));var logger=require(_0x194c('0x2'))(_0x194c('0x3'));var moment=require(_0x194c('0x4'));var BPromise=require(_0x194c('0x5'));var rp=require(_0x194c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x194c('0x7'));var config=require(_0x194c('0x8'));var attributes=require(_0x194c('0x9'));module[_0x194c('0xa')]=function(_0x25ce47,_0x534b0a){return _0x25ce47[_0x194c('0xb')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','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 d4da5d1..36c6709 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 _0xac14=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e2670,_0x195421){var _0x55280b=function(_0x3b32f1){while(--_0x3b32f1){_0x1e2670['push'](_0x1e2670['shift']());}};_0x55280b(++_0x195421);}(_0xac14,0x1a9));var _0x4ac1=function(_0x5f5544,_0x11b951){_0x5f5544=_0x5f5544-0x0;var _0x18314c=_0xac14[_0x5f5544];return _0x18314c;};'use strict';var _=require(_0x4ac1('0x0'));var util=require('util');var moment=require(_0x4ac1('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ac1('0x2'));var fs=require('fs');var Redis=require(_0x4ac1('0x3'));var db=require(_0x4ac1('0x4'))['db'];var utils=require(_0x4ac1('0x5'));var logger=require(_0x4ac1('0x6'))(_0x4ac1('0x7'));var config=require(_0x4ac1('0x8'));var jayson=require(_0x4ac1('0x9'));var client=jayson[_0x4ac1('0xa')][_0x4ac1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1578f6,_0x26cd9d,_0x3fd96a){return new BPromise(function(_0x3b2e8e,_0x31f88){return client[_0x4ac1('0xc')](_0x1578f6,_0x3fd96a)[_0x4ac1('0xd')](function(_0x4852d0){logger[_0x4ac1('0xe')](_0x4ac1('0xf'),_0x26cd9d,'request\x20sent');logger[_0x4ac1('0x10')](_0x4ac1('0x11'),_0x26cd9d,_0x4ac1('0x12'),JSON[_0x4ac1('0x13')](_0x4852d0));if(_0x4852d0[_0x4ac1('0x14')]){if(_0x4852d0[_0x4ac1('0x14')][_0x4ac1('0x15')]===0x1f4){logger[_0x4ac1('0x14')](_0x4ac1('0xf'),_0x26cd9d,_0x4852d0['error'][_0x4ac1('0x16')]);return _0x31f88(_0x4852d0[_0x4ac1('0x14')][_0x4ac1('0x16')]);}logger['error'](_0x4ac1('0xf'),_0x26cd9d,_0x4852d0['error']['message']);return _0x3b2e8e(_0x4852d0[_0x4ac1('0x14')][_0x4ac1('0x16')]);}else{logger[_0x4ac1('0xe')](_0x4ac1('0xf'),_0x26cd9d,_0x4ac1('0x12'));_0x3b2e8e(_0x4852d0['result'][_0x4ac1('0x16')]);}})[_0x4ac1('0x17')](function(_0x24546b){logger[_0x4ac1('0x14')](_0x4ac1('0xf'),_0x26cd9d,_0x24546b);_0x31f88(_0x24546b);});});} \ No newline at end of file +var _0x75ea=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75ea,0x7d));var _0xa75e=function(_0xc6508d,_0x407129){_0xc6508d=_0xc6508d-0x0;var _0x2e82dd=_0x75ea[_0xc6508d];return _0x2e82dd;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require('moment');var BPromise=require(_0xa75e('0x2'));var rs=require(_0xa75e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75e('0x4'))['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x9')][_0xa75e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f666f,_0x2c71ef,_0x148a23){return new BPromise(function(_0x31a28d,_0x351164){return client['request'](_0x1f666f,_0x148a23)['then'](function(_0x560baa){logger['info'](_0xa75e('0xb'),_0x2c71ef,'request\x20sent');logger[_0xa75e('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2c71ef,_0xa75e('0xd'),JSON[_0xa75e('0xe')](_0x560baa));if(_0x560baa['error']){if(_0x560baa[_0xa75e('0xf')][_0xa75e('0x10')]===0x1f4){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);return _0x351164(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}logger[_0xa75e('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2c71ef,_0x560baa[_0xa75e('0xf')]['message']);return _0x31a28d(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}else{logger['info'](_0xa75e('0xb'),_0x2c71ef,_0xa75e('0xd'));_0x31a28d(_0x560baa[_0xa75e('0x12')]['message']);}})[_0xa75e('0x13')](function(_0x315fde){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x315fde);_0x351164(_0x315fde);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index bb0ee74..2f57c84 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 _0x2bc1=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/sessions','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','update','/:id','exports','multer','util','path'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x2bc1,0x131));var _0x12bc=function(_0x31be63,_0xfaf7d8){_0x31be63=_0x31be63-0x0;var _0x5a996e=_0x2bc1[_0x31be63];return _0x5a996e;};'use strict';var multer=require(_0x12bc('0x0'));var util=require(_0x12bc('0x1'));var path=require(_0x12bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x12bc('0x3'));var router=express[_0x12bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x12bc('0x5'));var interaction=require(_0x12bc('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x12bc('0x7')]('/',auth[_0x12bc('0x8')](),controller[_0x12bc('0x9')]);router['get']('/:id',auth[_0x12bc('0x8')](),controller[_0x12bc('0xa')]);router[_0x12bc('0x7')](_0x12bc('0xb'),auth['isAuthenticated'](),controller['getSessions']);router['get']('/:id/answers',auth[_0x12bc('0x8')](),controller[_0x12bc('0xc')]);router[_0x12bc('0x7')](_0x12bc('0xd'),auth[_0x12bc('0x8')](),timeout('30s'),controller[_0x12bc('0xe')]);router[_0x12bc('0xf')]('/',auth[_0x12bc('0x8')](),controller[_0x12bc('0x10')]);router[_0x12bc('0xf')](_0x12bc('0x11'),auth[_0x12bc('0x8')](),controller[_0x12bc('0x12')]);router['put']('/:id',auth[_0x12bc('0x8')](),controller[_0x12bc('0x13')]);router['delete'](_0x12bc('0x14'),auth[_0x12bc('0x8')](),controller['destroy']);module[_0x12bc('0x15')]=router; \ No newline at end of file +var _0xe2bc=['../../config/environment','./jscriptyProject.controller','isAuthenticated','index','show','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3ae7fc,_0x586ce5){var _0x55b38f=function(_0x1fd47f){while(--_0x1fd47f){_0x3ae7fc['push'](_0x3ae7fc['shift']());}};_0x55b38f(++_0x586ce5);}(_0xe2bc,0x81));var _0xce2b=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xe2bc[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0xce2b('0x0'));var util=require(_0xce2b('0x1'));var path=require(_0xce2b('0x2'));var timeout=require(_0xce2b('0x3'));var express=require(_0xce2b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xce2b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce2b('0x6'));var controller=require(_0xce2b('0x7'));router['get']('/',auth[_0xce2b('0x8')](),controller[_0xce2b('0x9')]);router['get']('/:id',auth[_0xce2b('0x8')](),controller[_0xce2b('0xa')]);router[_0xce2b('0xb')](_0xce2b('0xc'),auth['isAuthenticated'](),controller[_0xce2b('0xd')]);router[_0xce2b('0xb')](_0xce2b('0xe'),auth['isAuthenticated'](),controller[_0xce2b('0xf')]);router[_0xce2b('0xb')](_0xce2b('0x10'),auth['isAuthenticated'](),timeout(_0xce2b('0x11')),controller[_0xce2b('0x12')]);router[_0xce2b('0x13')]('/',auth[_0xce2b('0x8')](),controller[_0xce2b('0x14')]);router['post'](_0xce2b('0x15'),auth[_0xce2b('0x8')](),controller[_0xce2b('0x16')]);router[_0xce2b('0x17')]('/:id',auth[_0xce2b('0x8')](),controller['update']);router['delete'](_0xce2b('0x18'),auth[_0xce2b('0x8')](),controller[_0xce2b('0x19')]);module[_0xce2b('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 b0faff7..743b6b3 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 _0xbd2a=['getDataValue','BOOLEAN','util','exports','name','STRING','TEXT','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x36f23a,_0x392225){var _0x29689e=function(_0x583193){while(--_0x583193){_0x36f23a['push'](_0x36f23a['shift']());}};_0x29689e(++_0x392225);}(_0xbd2a,0xc2));var _0xabd2=function(_0x30299b,_0x54b8f0){_0x30299b=_0x30299b-0x0;var _0x294256=_0xbd2a[_0x30299b];return _0x294256;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xabd2('0x0'));module[_0xabd2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xabd2('0x2')},'description':{'type':Sequelize[_0xabd2('0x3')]},'formData':{'type':Sequelize[_0xabd2('0x4')]('long'),'set':function(_0x372799){if(_[_0xabd2('0x5')](_0x372799)){this[_0xabd2('0x6')](_0xabd2('0x7'),JSON[_0xabd2('0x8')](_0x372799));}else if(_[_0xabd2('0x9')](_0x372799)){this[_0xabd2('0x6')](_0xabd2('0x7'),_0x372799);}else{this[_0xabd2('0x6')](_0xabd2('0x7'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xabd2('0xa')](_0xabd2('0x2'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xabd2('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xabd2('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x01bd=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','isObjectLike','setDataValue','formData'];(function(_0x43ff46,_0x27373e){var _0x3b3508=function(_0x4e5542){while(--_0x4e5542){_0x43ff46['push'](_0x43ff46['shift']());}};_0x3b3508(++_0x27373e);}(_0x01bd,0x137));var _0xd01b=function(_0x4915c2,_0x42d37b){_0x4915c2=_0x4915c2-0x0;var _0x5e26df=_0x01bd[_0x4915c2];return _0x5e26df;};'use strict';var Sequelize=require(_0xd01b('0x0'));var _=require(_0xd01b('0x1'));var util=require('util');module[_0xd01b('0x2')]={'name':{'type':Sequelize[_0xd01b('0x3')],'unique':_0xd01b('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd01b('0x5')]('long'),'set':function(_0x2574a2){if(_[_0xd01b('0x6')](_0x2574a2)){this[_0xd01b('0x7')](_0xd01b('0x8'),JSON[_0xd01b('0x9')](_0x2574a2));}else if(_[_0xd01b('0xa')](_0x2574a2)){this[_0xd01b('0x7')](_0xd01b('0x8'),_0x2574a2);}else{this[_0xd01b('0x7')]('formData',util[_0xd01b('0xb')](_0xd01b('0xc'),this[_0xd01b('0xd')](_0xd01b('0x4'))||'',this[_0xd01b('0xd')](_0xd01b('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd01b('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd01b('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 60d9077..cdde269 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 _0x9656=['startTime','starttime','parse','-createdAt','questionId','question','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','moment','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','../../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','apply','save','then','destroy','get','Projects','UserProfileResource','error','name','send','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','update','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace'];(function(_0x1fe7bf,_0x24493f){var _0x340e1f=function(_0x4e13df){while(--_0x4e13df){_0x1fe7bf['push'](_0x1fe7bf['shift']());}};_0x340e1f(++_0x24493f);}(_0x9656,0x15e));var _0x6965=function(_0x12d933,_0x29afe4){_0x12d933=_0x12d933-0x0;var _0x312ffe=_0x9656[_0x12d933];return _0x312ffe;};'use strict';var emlformat=require(_0x6965('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6965('0x1'));var jsonpatch=require(_0x6965('0x2'));var rp=require('request-promise');var moment=require(_0x6965('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6965('0x4'));var sox=require('sox');var csv=require(_0x6965('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6965('0x6'));var _=require('lodash');var squel=require(_0x6965('0x7'));var crypto=require(_0x6965('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6965('0x5'));var querystring=require(_0x6965('0x9'));var Papa=require(_0x6965('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6965('0xb'));var hardwareService=require(_0x6965('0xc'));var logger=require(_0x6965('0xd'))('api');var utils=require(_0x6965('0xe'));var config=require(_0x6965('0xf'));var licenseUtil=require(_0x6965('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48a1d0,_0x396c0a){_0x396c0a=_0x396c0a||0xcc;return function(_0x585d14){if(_0x585d14){return _0x48a1d0[_0x6965('0x11')](_0x396c0a);}return _0x48a1d0[_0x6965('0x12')](_0x396c0a)[_0x6965('0x13')]();};}function respondWithResult(_0x509f01,_0x2d52d5){_0x2d52d5=_0x2d52d5||0xc8;return function(_0x209912){if(_0x209912){return _0x509f01[_0x6965('0x12')](_0x2d52d5)[_0x6965('0x14')](_0x209912);}};}function respondWithFilteredResult(_0x3777b1,_0xd759ba){return function(_0x35e280){if(_0x35e280){var _0x40e4f3=typeof _0xd759ba[_0x6965('0x15')]===_0x6965('0x16')&&typeof _0xd759ba[_0x6965('0x17')]==='undefined';var _0x17f50e=_0x35e280[_0x6965('0x18')];var _0xc31577=_0x40e4f3?0x0:_0xd759ba['offset'];var _0x31e3f5=_0x40e4f3?_0x35e280[_0x6965('0x18')]:_0xd759ba[_0x6965('0x15')]+_0xd759ba[_0x6965('0x17')];var _0x130eff;if(_0x31e3f5>=_0x17f50e){_0x31e3f5=_0x17f50e;_0x130eff=0xc8;}else{_0x130eff=0xce;}_0x3777b1['status'](_0x130eff);return _0x3777b1[_0x6965('0x19')](_0x6965('0x1a'),_0xc31577+'-'+_0x31e3f5+'/'+_0x17f50e)[_0x6965('0x14')](_0x35e280);}return null;};}function patchUpdates(_0x263adc){return function(_0x5b9561){try{jsonpatch[_0x6965('0x1b')](_0x5b9561,_0x263adc,!![]);}catch(_0x414498){return BPromise['reject'](_0x414498);}return _0x5b9561[_0x6965('0x1c')]();};}function saveUpdates(_0x213e2c,_0x19148a){return function(_0x4e5015){if(_0x4e5015){return _0x4e5015['update'](_0x213e2c)[_0x6965('0x1d')](function(_0x38fd5b){return _0x38fd5b;});}return null;};}function removeEntity(_0x416ae4,_0x47d18b){return function(_0x175585){if(_0x175585){return _0x175585[_0x6965('0x1e')]()[_0x6965('0x1d')](function(){var _0x16a64a=_0x175585[_0x6965('0x1f')]({'plain':!![]});var _0x1726bb=_0x6965('0x20');return db[_0x6965('0x21')][_0x6965('0x1e')]({'where':{'type':_0x1726bb,'resourceId':_0x16a64a['id']}})[_0x6965('0x1d')](function(){return _0x175585;});})[_0x6965('0x1d')](function(){_0x416ae4[_0x6965('0x12')](0xcc)[_0x6965('0x13')]();});}};}function handleEntityNotFound(_0x4cf5ce,_0xd2e675){return function(_0x5ab0df){if(!_0x5ab0df){_0x4cf5ce[_0x6965('0x11')](0x194);}return _0x5ab0df;};}function handleError(_0x4fa13c,_0x1ee288){_0x1ee288=_0x1ee288||0x1f4;return function(_0x1ae67e){logger[_0x6965('0x22')](_0x1ae67e['stack']);if(_0x1ae67e[_0x6965('0x23')]){delete _0x1ae67e[_0x6965('0x23')];}_0x4fa13c[_0x6965('0x12')](_0x1ee288)[_0x6965('0x24')](_0x1ae67e);};}exports['index']=function(_0x35f56b,_0x16b353){var _0x144df0={},_0x5c36e7={},_0x49c8e8={'count':0x0,'rows':[]};var _0xcbd951=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x4de646){return{'name':_0x4de646['fieldName'],'type':_0x4de646[_0x6965('0x25')]['key']};});_0x5c36e7[_0x6965('0x26')]=_[_0x6965('0x27')](_0xcbd951,'name');_0x5c36e7[_0x6965('0x28')]=_['keys'](_0x35f56b[_0x6965('0x28')]);_0x5c36e7[_0x6965('0x29')]=_[_0x6965('0x2a')](_0x5c36e7[_0x6965('0x26')],_0x5c36e7[_0x6965('0x28')]);_0x144df0[_0x6965('0x2b')]=_[_0x6965('0x2a')](_0x5c36e7[_0x6965('0x26')],qs['fields'](_0x35f56b[_0x6965('0x28')][_0x6965('0x2c')]));_0x144df0[_0x6965('0x2b')]=_0x144df0[_0x6965('0x2b')]['length']?_0x144df0[_0x6965('0x2b')]:_0x5c36e7['model'];if(!_0x35f56b['query'][_0x6965('0x2d')](_0x6965('0x2e'))){_0x144df0[_0x6965('0x17')]=qs[_0x6965('0x17')](_0x35f56b['query'][_0x6965('0x17')]);_0x144df0[_0x6965('0x15')]=qs['offset'](_0x35f56b[_0x6965('0x28')][_0x6965('0x15')]);}_0x144df0[_0x6965('0x2f')]=qs[_0x6965('0x30')](_0x35f56b[_0x6965('0x28')][_0x6965('0x30')]);_0x144df0['where']=qs['filters'](_[_0x6965('0x31')](_0x35f56b[_0x6965('0x28')],_0x5c36e7[_0x6965('0x29')]),_0xcbd951);if(_0x35f56b['query'][_0x6965('0x32')]){_0x144df0['where']=_[_0x6965('0x33')](_0x144df0[_0x6965('0x34')],{'$or':_['map'](_0xcbd951,function(_0x2cf09c){if(_0x2cf09c[_0x6965('0x25')]!=='VIRTUAL'){var _0x56ec71={};_0x56ec71[_0x2cf09c['name']]={'$like':'%'+_0x35f56b[_0x6965('0x28')][_0x6965('0x32')]+'%'};return _0x56ec71;}})});}_0x144df0=_[_0x6965('0x33')]({},_0x144df0,_0x35f56b[_0x6965('0x35')]);var _0x36d526={'where':_0x144df0[_0x6965('0x34')]};return db['JscriptyProject'][_0x6965('0x18')](_0x36d526)[_0x6965('0x1d')](function(_0x2fe229){_0x49c8e8[_0x6965('0x18')]=_0x2fe229;if(_0x35f56b['query'][_0x6965('0x36')]){_0x144df0[_0x6965('0x37')]=[{'all':!![]}];}return db[_0x6965('0x38')][_0x6965('0x39')](_0x144df0);})[_0x6965('0x1d')](function(_0x1d660b){_0x49c8e8[_0x6965('0x3a')]=_0x1d660b;return _0x49c8e8;})[_0x6965('0x1d')](respondWithFilteredResult(_0x16b353,_0x144df0))[_0x6965('0x3b')](handleError(_0x16b353,null));};exports[_0x6965('0x3c')]=function(_0x39ef02,_0xd394fe){var _0x5f3d42={'raw':![],'where':{'id':_0x39ef02[_0x6965('0x3d')]['id']}},_0x120ec5={};_0x120ec5[_0x6965('0x26')]=_['keys'](db[_0x6965('0x38')][_0x6965('0x3e')]);_0x120ec5[_0x6965('0x28')]=_[_0x6965('0x3f')](_0x39ef02[_0x6965('0x28')]);_0x120ec5['filters']=_['intersection'](_0x120ec5[_0x6965('0x26')],_0x120ec5[_0x6965('0x28')]);_0x5f3d42[_0x6965('0x2b')]=_['intersection'](_0x120ec5[_0x6965('0x26')],qs[_0x6965('0x2c')](_0x39ef02[_0x6965('0x28')][_0x6965('0x2c')]));_0x5f3d42[_0x6965('0x2b')]=_0x5f3d42[_0x6965('0x2b')][_0x6965('0x40')]?_0x5f3d42[_0x6965('0x2b')]:_0x120ec5[_0x6965('0x26')];if(_0x39ef02['query'][_0x6965('0x36')]){_0x5f3d42[_0x6965('0x37')]=[{'all':!![]}];}_0x5f3d42=_[_0x6965('0x33')]({},_0x5f3d42,_0x39ef02[_0x6965('0x35')]);return db[_0x6965('0x38')][_0x6965('0x41')](_0x5f3d42)[_0x6965('0x1d')](handleEntityNotFound(_0xd394fe,null))[_0x6965('0x1d')](respondWithResult(_0xd394fe,null))['catch'](handleError(_0xd394fe,null));};exports[_0x6965('0x42')]=function(_0x344587,_0x49f3e5){return db[_0x6965('0x38')][_0x6965('0x42')](_0x344587['body'],{})[_0x6965('0x1d')](function(_0x36aeae){var _0x30862a=_0x344587[_0x6965('0x43')][_0x6965('0x1f')]({'plain':!![]});if(!_0x30862a)throw new Error(_0x6965('0x44'));if(_0x30862a[_0x6965('0x45')]===_0x6965('0x43')){var _0xfa8f2=_0x36aeae[_0x6965('0x1f')]({'plain':!![]});var _0x33a6a4=_0x6965('0x20');return db[_0x6965('0x46')][_0x6965('0x41')]({'where':{'name':_0x33a6a4,'userProfileId':_0x30862a[_0x6965('0x47')]},'raw':!![]})['then'](function(_0x21d1b0){if(_0x21d1b0&&_0x21d1b0[_0x6965('0x48')]===0x0){return db[_0x6965('0x21')][_0x6965('0x42')]({'name':_0xfa8f2['name'],'resourceId':_0xfa8f2['id'],'type':_0x21d1b0[_0x6965('0x23')],'sectionId':_0x21d1b0['id']},{})[_0x6965('0x1d')](function(){return _0x36aeae;});}else{return _0x36aeae;}})[_0x6965('0x3b')](function(_0x27fac5){logger['error'](_0x6965('0x49'),_0x27fac5);throw _0x27fac5;});}return _0x36aeae;})[_0x6965('0x1d')](respondWithResult(_0x49f3e5,0xc9))['catch'](handleError(_0x49f3e5,null));};exports[_0x6965('0x4a')]=function(_0x1cd77b,_0x38288d){var _0x3bdd93={'where':{'id':_0x1cd77b[_0x6965('0x3d')]['id']}},_0x132154={};_0x132154[_0x6965('0x26')]=_[_0x6965('0x3f')](db[_0x6965('0x38')][_0x6965('0x3e')]);_0x3bdd93['attributes']=_[_0x6965('0x2a')](_0x132154[_0x6965('0x26')],qs[_0x6965('0x2c')](_0x1cd77b['query'][_0x6965('0x2c')]));_0x3bdd93[_0x6965('0x2b')]=_0x3bdd93['attributes'][_0x6965('0x40')]?_0x3bdd93[_0x6965('0x2b')]:_0x132154['model'];if(_0x1cd77b[_0x6965('0x28')][_0x6965('0x36')]){_0x3bdd93[_0x6965('0x37')]=[{'all':!![]}];}_0x3bdd93=_[_0x6965('0x33')]({},_0x3bdd93,_0x1cd77b[_0x6965('0x35')]);return db[_0x6965('0x38')][_0x6965('0x41')](_0x3bdd93)[_0x6965('0x1d')](handleEntityNotFound(_0x38288d,null))[_0x6965('0x1d')](function(_0x3e41b2){if(_0x3e41b2){var _0x40f055=_0x3e41b2[_0x6965('0x1f')]({'plain':!![]});_0x40f055=qs['omit'](_0x40f055,['id',_0x6965('0x4b'),_0x6965('0x4c')]);_0x1cd77b[_0x6965('0x4d')]=_[_0x6965('0x4e')](_0x1cd77b[_0x6965('0x4d')],['id',_0x6965('0x4b'),_0x6965('0x4c')]);return db['JscriptyProject']['create'](_[_0x6965('0x33')](_0x40f055,_0x1cd77b[_0x6965('0x4d')]),{'include':_0x1cd77b[_0x6965('0x28')]['includeAll']?[{'all':!![]}]:undefined})[_0x6965('0x1d')](function(_0x4ad85a){var _0x287eaf=_0x1cd77b[_0x6965('0x43')][_0x6965('0x1f')]({'plain':!![]});if(!_0x287eaf)throw new Error(_0x6965('0x44'));if(_0x287eaf[_0x6965('0x45')]==='user'){var _0x2a7985=_0x4ad85a[_0x6965('0x1f')]({'plain':!![]});var _0xbf3eea=_0x6965('0x20');return db[_0x6965('0x46')]['find']({'where':{'name':_0xbf3eea,'userProfileId':_0x287eaf[_0x6965('0x47')]},'raw':!![]})['then'](function(_0x379cd2){if(_0x379cd2&&_0x379cd2['autoAssociation']===0x0){return db['UserProfileResource'][_0x6965('0x42')]({'name':_0x2a7985[_0x6965('0x23')],'resourceId':_0x2a7985['id'],'type':_0x379cd2[_0x6965('0x23')],'sectionId':_0x379cd2['id']},{})[_0x6965('0x1d')](function(){return _0x4ad85a;});}else{return _0x4ad85a;}})[_0x6965('0x3b')](function(_0x236d5d){logger[_0x6965('0x22')](_0x6965('0x49'),_0x236d5d);throw _0x236d5d;});}return _0x4ad85a;});}})['then'](respondWithResult(_0x38288d,0xc9))[_0x6965('0x3b')](handleError(_0x38288d,null));};exports[_0x6965('0x4f')]=function(_0x4041dc,_0x50d3ec){if(_0x4041dc['body']['id']){delete _0x4041dc[_0x6965('0x4d')]['id'];}return db[_0x6965('0x38')][_0x6965('0x41')]({'where':{'id':_0x4041dc[_0x6965('0x3d')]['id']}})[_0x6965('0x1d')](handleEntityNotFound(_0x50d3ec,null))[_0x6965('0x1d')](saveUpdates(_0x4041dc['body'],null))[_0x6965('0x1d')](respondWithResult(_0x50d3ec,null))[_0x6965('0x3b')](handleError(_0x50d3ec,null));};exports[_0x6965('0x1e')]=function(_0x4732ed,_0x415d86){return db[_0x6965('0x38')][_0x6965('0x41')]({'where':{'id':_0x4732ed[_0x6965('0x3d')]['id']}})['then'](handleEntityNotFound(_0x415d86,null))[_0x6965('0x1d')](removeEntity(_0x415d86,null))[_0x6965('0x3b')](handleError(_0x415d86,null));};exports['getSessions']=function(_0x5a2e1c,_0x95470d,_0x14d347){var _0x154996={'raw':!![],'where':{}};var _0x5e7dcb={};var _0x119ee4={'count':0x0,'rows':[]};return db[_0x6965('0x38')][_0x6965('0x50')]({'where':{'id':_0x5a2e1c[_0x6965('0x3d')]['id']}})['then'](handleEntityNotFound(_0x95470d,null))[_0x6965('0x1d')](function(_0x4e0c03){if(_0x4e0c03){_0x5e7dcb[_0x6965('0x26')]=_[_0x6965('0x3f')](db[_0x6965('0x51')]['rawAttributes']);_0x5e7dcb[_0x6965('0x28')]=_[_0x6965('0x3f')](_0x5a2e1c[_0x6965('0x28')]);_0x5e7dcb[_0x6965('0x29')]=_[_0x6965('0x2a')](_0x5e7dcb[_0x6965('0x26')],_0x5e7dcb['query']);_0x154996[_0x6965('0x2b')]=_[_0x6965('0x2a')](_0x5e7dcb[_0x6965('0x26')],qs[_0x6965('0x2c')](_0x5a2e1c[_0x6965('0x28')][_0x6965('0x2c')]));_0x154996[_0x6965('0x2b')]=_0x154996[_0x6965('0x2b')][_0x6965('0x40')]?_0x154996[_0x6965('0x2b')]:_0x5e7dcb[_0x6965('0x26')];if(!_0x5a2e1c[_0x6965('0x28')][_0x6965('0x2d')]('nolimit')){_0x154996[_0x6965('0x17')]=qs[_0x6965('0x17')](_0x5a2e1c[_0x6965('0x28')][_0x6965('0x17')]);_0x154996[_0x6965('0x15')]=qs['offset'](_0x5a2e1c[_0x6965('0x28')][_0x6965('0x15')]);}_0x154996['order']=qs['sort'](_0x5a2e1c[_0x6965('0x28')]['sort']);_0x154996[_0x6965('0x34')]=qs[_0x6965('0x29')](_[_0x6965('0x31')](_0x5a2e1c[_0x6965('0x28')],_0x5e7dcb[_0x6965('0x29')]));_0x154996[_0x6965('0x34')][_0x6965('0x52')]=_0x4e0c03['id'];if(_0x5a2e1c[_0x6965('0x28')][_0x6965('0x32')]){_0x154996['where']=_[_0x6965('0x33')](_0x154996[_0x6965('0x34')],{'$or':_[_0x6965('0x27')](_0x154996['attributes'],function(_0x373c5f){var _0x3441a8={};_0x3441a8[_0x373c5f]={'$like':'%'+_0x5a2e1c[_0x6965('0x28')]['filter']+'%'};return _0x3441a8;})});}_0x154996=_['merge']({},_0x154996,_0x5a2e1c['options']);return db[_0x6965('0x51')][_0x6965('0x18')]({'where':_0x154996['where']})[_0x6965('0x1d')](function(_0x2715a5){_0x119ee4[_0x6965('0x18')]=_0x2715a5;if(_0x5a2e1c[_0x6965('0x28')]['includeAll']){_0x154996[_0x6965('0x37')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x6965('0x39')](_0x154996);})[_0x6965('0x1d')](function(_0x521d99){_0x119ee4[_0x6965('0x3a')]=_0x521d99;return _0x119ee4;});}})['then'](respondWithFilteredResult(_0x95470d,_0x154996))[_0x6965('0x3b')](handleError(_0x95470d,null));};exports[_0x6965('0x53')]=function(_0x30f797,_0x298e62,_0x39cc5b){var _0x2e12d3={'raw':!![],'where':{}};var _0x34fb79={};var _0x2bbb76={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x6965('0x50')]({'where':{'id':_0x30f797[_0x6965('0x3d')]['id']}})[_0x6965('0x1d')](handleEntityNotFound(_0x298e62,null))[_0x6965('0x1d')](function(_0x1381c4){if(_0x1381c4){_0x34fb79['model']=_[_0x6965('0x3f')](db[_0x6965('0x54')][_0x6965('0x3e')]);_0x34fb79[_0x6965('0x28')]=_[_0x6965('0x3f')](_0x30f797[_0x6965('0x28')]);_0x34fb79['filters']=_[_0x6965('0x2a')](_0x34fb79[_0x6965('0x26')],_0x34fb79[_0x6965('0x28')]);_0x2e12d3['attributes']=_['intersection'](_0x34fb79['model'],qs[_0x6965('0x2c')](_0x30f797[_0x6965('0x28')][_0x6965('0x2c')]));_0x2e12d3[_0x6965('0x2b')]=_0x2e12d3['attributes'][_0x6965('0x40')]?_0x2e12d3[_0x6965('0x2b')]:_0x34fb79['model'];if(!_0x30f797[_0x6965('0x28')]['hasOwnProperty'](_0x6965('0x2e'))){_0x2e12d3[_0x6965('0x17')]=qs[_0x6965('0x17')](_0x30f797[_0x6965('0x28')]['limit']);_0x2e12d3[_0x6965('0x15')]=qs[_0x6965('0x15')](_0x30f797[_0x6965('0x28')][_0x6965('0x15')]);}_0x2e12d3['order']=qs[_0x6965('0x30')](_0x30f797[_0x6965('0x28')]['sort']);_0x2e12d3[_0x6965('0x34')]=qs[_0x6965('0x29')](_[_0x6965('0x31')](_0x30f797[_0x6965('0x28')],_0x34fb79[_0x6965('0x29')]));_0x2e12d3['where'][_0x6965('0x52')]=_0x1381c4['id'];if(_0x30f797[_0x6965('0x28')][_0x6965('0x32')]){_0x2e12d3[_0x6965('0x34')]=_[_0x6965('0x33')](_0x2e12d3[_0x6965('0x34')],{'$or':_[_0x6965('0x27')](_0x2e12d3[_0x6965('0x2b')],function(_0x2d0b0c){var _0x326aed={};_0x326aed[_0x2d0b0c]={'$like':'%'+_0x30f797['query'][_0x6965('0x32')]+'%'};return _0x326aed;})});}_0x2e12d3=_[_0x6965('0x33')]({},_0x2e12d3,_0x30f797[_0x6965('0x35')]);return db[_0x6965('0x54')][_0x6965('0x18')]({'where':_0x2e12d3['where']})[_0x6965('0x1d')](function(_0x4548fe){_0x2bbb76['count']=_0x4548fe;if(_0x30f797[_0x6965('0x28')][_0x6965('0x36')]){_0x2e12d3['include']=[{'all':!![]}];}return db[_0x6965('0x54')][_0x6965('0x39')](_0x2e12d3);})[_0x6965('0x1d')](function(_0x1cf512){_0x2bbb76[_0x6965('0x3a')]=_0x1cf512;return _0x2bbb76;});}})['then'](respondWithFilteredResult(_0x298e62,_0x2e12d3))[_0x6965('0x3b')](handleError(_0x298e62,null));};function char(_0x3e6dc2){return _0x6965('0x55')===typeof _0x3e6dc2?String[_0x6965('0x56')]['apply'](null,arguments):_0x3e6dc2;}function needsEncapsulation(_0x5d76e1){return!!_0x5d76e1&&(_0x5d76e1[_0x6965('0x57')]()[_0x6965('0x58')](char(0xd))>=0x0||_0x5d76e1[_0x6965('0x57')]()[_0x6965('0x58')](char(0xa))>=0x0||_0x5d76e1['toString']()['indexOf'](char(0x2c))>=0x0||_0x5d76e1[_0x6965('0x57')]()[_0x6965('0x58')](char(0x22))>=0x0);}function encapsulate(_0x3c0259){var _0x4be66f=char(0x22),_0x899c3d='\x5c'+char(0x22),_0x235aee=_0x3c0259[_0x6965('0x57')]()[_0x6965('0x59')](new RegExp(_0x4be66f,'g'),_0x899c3d);return _0x4be66f+_0x235aee+_0x4be66f;}exports['getSummary']=function(_0x4715c7,_0x4f13cd,_0x246e2c){var _0x14e09b,_0x17f3a8;var _0x2573af={'where':{'ProjectId':_0x4715c7[_0x6965('0x3d')]['id']}};if(_0x4715c7[_0x6965('0x28')][_0x6965('0x5a')]){_0x2573af[_0x6965('0x34')][_0x6965('0x5b')]=JSON[_0x6965('0x5c')](_0x4715c7['query'][_0x6965('0x5a')]);}return db[_0x6965('0x51')]['findAll'](_0x2573af)[_0x6965('0x1d')](handleEntityNotFound(_0x4f13cd,null))[_0x6965('0x1d')](function(_0x2f980d){if(_0x2f980d){_0x14e09b=_0x2f980d;return db['JscriptyQuestionReport'][_0x6965('0x39')]({'where':{'SessionId':{'$in':_[_0x6965('0x27')](_0x14e09b,'id')},'ProjectId':_0x4715c7[_0x6965('0x3d')]['id']},'order':_0x6965('0x5d')});}})[_0x6965('0x1d')](handleEntityNotFound(_0x4f13cd,null))['then'](function(_0x382568){if(_0x382568){_0x17f3a8=_0x382568;var _0x3ea746={};for(var _0x2eca03=0x0,_0xccea0a=_0x17f3a8[_0x6965('0x40')];_0x2eca03<_0xccea0a;_0x2eca03++){if(!_0x3ea746[_0x6965('0x2d')](_0x17f3a8[_0x2eca03]['questionId'])){_0x3ea746[_0x17f3a8[_0x2eca03][_0x6965('0x5e')]]=needsEncapsulation(_0x17f3a8[_0x2eca03][_0x6965('0x5f')])?encapsulate(_0x17f3a8[_0x2eca03][_0x6965('0x5f')]):_0x17f3a8[_0x2eca03][_0x6965('0x5f')];}}var _0x20725f=[],_0x4e92c2={};for(var _0x42e3a3=0x0,_0xf38753=_0x14e09b[_0x6965('0x40')];_0x42e3a3<_0xf38753;_0x42e3a3++){_0x4e92c2={'ProjectId':_0x4715c7[_0x6965('0x3d')]['id'],'SessionId':_0x14e09b[_0x42e3a3]['id'],'StartTime':moment(_0x14e09b[_0x42e3a3][_0x6965('0x5b')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3bbab3=0x0,_0x203354=_0x17f3a8[_0x6965('0x40')];_0x3bbab3<_0x203354;_0x3bbab3++){if(_0x17f3a8[_0x3bbab3]['SessionId']==_0x14e09b[_0x42e3a3]['id']&&_0x3ea746['hasOwnProperty'](_0x17f3a8[_0x3bbab3]['questionId'])){_0x4e92c2[_0x3ea746[_0x17f3a8[_0x3bbab3][_0x6965('0x5e')]]]=_0x17f3a8[_0x3bbab3][_0x6965('0x60')];}}for(var _0xafee79 in _0x3ea746){if(!_0x4e92c2['hasOwnProperty'](_0x3ea746[_0xafee79])){_0x4e92c2[_0x3ea746[_0xafee79]]=null;}}_0x20725f[_0x6965('0x61')](_0x4e92c2);}return _0x20725f;}})['then'](function(_0x26806f){if(!_[_0x6965('0x62')](_0x26806f)){var _0x26dbda=toCsv(_0x26806f);var _0x3a8712=Date[_0x6965('0x63')]();fs[_0x6965('0x64')](util[_0x6965('0x65')](_0x6965('0x66'),_0x4715c7['params']['id'],_0x3a8712),_0x26dbda);_0x4f13cd[_0x6965('0x67')](_0x6965('0x68'),_0x6965('0x69')+util[_0x6965('0x65')](_0x6965('0x6a'),_0x4715c7['params']['id'],_0x3a8712));_0x4f13cd[_0x6965('0x67')](_0x6965('0x6b'),_0x6965('0x6c'));return _0x4f13cd[_0x6965('0x6d')](util[_0x6965('0x65')](_0x6965('0x66'),_0x4715c7[_0x6965('0x3d')]['id'],_0x3a8712));}else{return _0x4f13cd[_0x6965('0x11')](0xcc);}})[_0x6965('0x3b')](handleError(_0x4f13cd,null));}; \ No newline at end of file +var _0xccbf=['ProjectId','getAnswers','findOne','JscriptyAnswerReport','order','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','get','Projects','UserProfileResource','then','sendStatus','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','JscriptySessionReport'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xccbf,0x1ef));var _0xfccb=function(_0x2abd98,_0x2cf43f){_0x2abd98=_0x2abd98-0x0;var _0x28e2d3=_0xccbf[_0x2abd98];return _0x28e2d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfccb('0x0'));var jsonpatch=require(_0xfccb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfccb('0x2'));var util=require(_0xfccb('0x3'));var path=require(_0xfccb('0x4'));var sox=require(_0xfccb('0x5'));var csv=require(_0xfccb('0x6'));var ejs=require(_0xfccb('0x7'));var fs=require('fs');var fs_extra=require(_0xfccb('0x8'));var _=require(_0xfccb('0x9'));var squel=require(_0xfccb('0xa'));var crypto=require(_0xfccb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfccb('0x6'));var querystring=require('querystring');var Papa=require(_0xfccb('0xc'));var Redis=require(_0xfccb('0xd'));var authService=require(_0xfccb('0xe'));var qs=require(_0xfccb('0xf'));var as=require(_0xfccb('0x10'));var hardwareService=require(_0xfccb('0x11'));var logger=require(_0xfccb('0x12'))('api');var utils=require(_0xfccb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfccb('0x14'));var db=require(_0xfccb('0x15'))['db'];function respondWithStatusCode(_0x294290,_0x6347e){_0x6347e=_0x6347e||0xcc;return function(_0x3feeb8){if(_0x3feeb8){return _0x294290['sendStatus'](_0x6347e);}return _0x294290[_0xfccb('0x16')](_0x6347e)[_0xfccb('0x17')]();};}function respondWithResult(_0x4dbc25,_0x24b877){_0x24b877=_0x24b877||0xc8;return function(_0x1ac34f){if(_0x1ac34f){return _0x4dbc25[_0xfccb('0x16')](_0x24b877)[_0xfccb('0x18')](_0x1ac34f);}};}function respondWithFilteredResult(_0x3ec8f6,_0x4b982c){return function(_0x45f2dc){if(_0x45f2dc){var _0x2c1cdb=typeof _0x4b982c[_0xfccb('0x19')]===_0xfccb('0x1a')&&typeof _0x4b982c['limit']===_0xfccb('0x1a');var _0xa7dde9=_0x45f2dc[_0xfccb('0x1b')];var _0x3ccfaf=_0x2c1cdb?0x0:_0x4b982c[_0xfccb('0x19')];var _0x44bc94=_0x2c1cdb?_0x45f2dc['count']:_0x4b982c[_0xfccb('0x19')]+_0x4b982c['limit'];var _0x2d1282;if(_0x44bc94>=_0xa7dde9){_0x44bc94=_0xa7dde9;_0x2d1282=0xc8;}else{_0x2d1282=0xce;}_0x3ec8f6[_0xfccb('0x16')](_0x2d1282);return _0x3ec8f6[_0xfccb('0x1c')]('Content-Range',_0x3ccfaf+'-'+_0x44bc94+'/'+_0xa7dde9)[_0xfccb('0x18')](_0x45f2dc);}return null;};}function patchUpdates(_0x385272){return function(_0x46c59a){try{jsonpatch[_0xfccb('0x1d')](_0x46c59a,_0x385272,!![]);}catch(_0x121b20){return BPromise[_0xfccb('0x1e')](_0x121b20);}return _0x46c59a[_0xfccb('0x1f')]();};}function saveUpdates(_0x587fe2,_0x5beeef){return function(_0x2baa04){if(_0x2baa04){return _0x2baa04[_0xfccb('0x20')](_0x587fe2)['then'](function(_0x35679f){return _0x35679f;});}return null;};}function removeEntity(_0x23c395,_0x343f15){return function(_0x2087c6){if(_0x2087c6){return _0x2087c6[_0xfccb('0x21')]()['then'](function(){var _0x3a86ed=_0x2087c6[_0xfccb('0x22')]({'plain':!![]});var _0x29e1f9=_0xfccb('0x23');return db[_0xfccb('0x24')][_0xfccb('0x21')]({'where':{'type':_0x29e1f9,'resourceId':_0x3a86ed['id']}})['then'](function(){return _0x2087c6;});})[_0xfccb('0x25')](function(){_0x23c395[_0xfccb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e5fa,_0x4edf31){return function(_0x2e9e0a){if(!_0x2e9e0a){_0x29e5fa[_0xfccb('0x26')](0x194);}return _0x2e9e0a;};}function handleError(_0x6ba751,_0x2dc7d1){_0x2dc7d1=_0x2dc7d1||0x1f4;return function(_0x54834f){logger[_0xfccb('0x27')](_0x54834f[_0xfccb('0x28')]);if(_0x54834f['name']){delete _0x54834f[_0xfccb('0x29')];}_0x6ba751[_0xfccb('0x16')](_0x2dc7d1)[_0xfccb('0x2a')](_0x54834f);};}exports[_0xfccb('0x2b')]=function(_0x5314b8,_0x3d7e72){var _0x26f6df={},_0xf35e06={},_0x3286f1={'count':0x0,'rows':[]};var _0x301e0b=_['map'](db[_0xfccb('0x2c')][_0xfccb('0x2d')],function(_0x30493f){return{'name':_0x30493f[_0xfccb('0x2e')],'type':_0x30493f[_0xfccb('0x2f')][_0xfccb('0x30')]};});_0xf35e06[_0xfccb('0x31')]=_[_0xfccb('0x32')](_0x301e0b,_0xfccb('0x29'));_0xf35e06[_0xfccb('0x33')]=_['keys'](_0x5314b8[_0xfccb('0x33')]);_0xf35e06[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0xf35e06[_0xfccb('0x31')],_0xf35e06[_0xfccb('0x33')]);_0x26f6df['attributes']=_[_0xfccb('0x35')](_0xf35e06[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x36')]));_0x26f6df['attributes']=_0x26f6df[_0xfccb('0x37')][_0xfccb('0x38')]?_0x26f6df[_0xfccb('0x37')]:_0xf35e06[_0xfccb('0x31')];if(!_0x5314b8[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x26f6df[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x26f6df[_0xfccb('0x19')]=qs[_0xfccb('0x19')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x26f6df['order']=qs[_0xfccb('0x3c')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3c')]);_0x26f6df[_0xfccb('0x3d')]=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x5314b8[_0xfccb('0x33')],_0xf35e06['filters']),_0x301e0b);if(_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x26f6df[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x26f6df[_0xfccb('0x3d')],{'$or':_['map'](_0x301e0b,function(_0x2fb449){if(_0x2fb449[_0xfccb('0x2f')]!==_0xfccb('0x41')){var _0x231e27={};_0x231e27[_0x2fb449[_0xfccb('0x29')]]={'$like':'%'+_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x231e27;}})});}_0x26f6df=_[_0xfccb('0x40')]({},_0x26f6df,_0x5314b8[_0xfccb('0x42')]);var _0x6b7a4b={'where':_0x26f6df[_0xfccb('0x3d')]};return db[_0xfccb('0x2c')][_0xfccb('0x1b')](_0x6b7a4b)[_0xfccb('0x25')](function(_0x300eb5){_0x3286f1[_0xfccb('0x1b')]=_0x300eb5;if(_0x5314b8['query'][_0xfccb('0x43')]){_0x26f6df[_0xfccb('0x44')]=[{'all':!![]}];}return db[_0xfccb('0x2c')][_0xfccb('0x45')](_0x26f6df);})['then'](function(_0x16da43){_0x3286f1[_0xfccb('0x46')]=_0x16da43;return _0x3286f1;})[_0xfccb('0x25')](respondWithFilteredResult(_0x3d7e72,_0x26f6df))['catch'](handleError(_0x3d7e72,null));};exports[_0xfccb('0x47')]=function(_0x51cc89,_0x3a6409){var _0x450a82={'raw':![],'where':{'id':_0x51cc89[_0xfccb('0x48')]['id']}},_0x4c1229={};_0x4c1229[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x2c')][_0xfccb('0x2d')]);_0x4c1229[_0xfccb('0x33')]=_[_0xfccb('0x49')](_0x51cc89[_0xfccb('0x33')]);_0x4c1229[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x4c1229['model'],_0x4c1229[_0xfccb('0x33')]);_0x450a82[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x4c1229['model'],qs[_0xfccb('0x36')](_0x51cc89[_0xfccb('0x33')][_0xfccb('0x36')]));_0x450a82[_0xfccb('0x37')]=_0x450a82[_0xfccb('0x37')]['length']?_0x450a82[_0xfccb('0x37')]:_0x4c1229['model'];if(_0x51cc89[_0xfccb('0x33')]['includeAll']){_0x450a82[_0xfccb('0x44')]=[{'all':!![]}];}_0x450a82=_['merge']({},_0x450a82,_0x51cc89[_0xfccb('0x42')]);return db[_0xfccb('0x2c')][_0xfccb('0x4a')](_0x450a82)['then'](handleEntityNotFound(_0x3a6409,null))[_0xfccb('0x25')](respondWithResult(_0x3a6409,null))['catch'](handleError(_0x3a6409,null));};exports['create']=function(_0x1dd08b,_0x7bb37c){return db[_0xfccb('0x2c')]['create'](_0x1dd08b[_0xfccb('0x4b')],{})[_0xfccb('0x25')](function(_0x467afe){var _0x11951a=_0x1dd08b[_0xfccb('0x4c')]['get']({'plain':!![]});if(!_0x11951a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11951a[_0xfccb('0x4d')]===_0xfccb('0x4c')){var _0x503c22=_0x467afe[_0xfccb('0x22')]({'plain':!![]});var _0x5045b5=_0xfccb('0x23');return db[_0xfccb('0x4e')][_0xfccb('0x4a')]({'where':{'name':_0x5045b5,'userProfileId':_0x11951a[_0xfccb('0x4f')]},'raw':!![]})[_0xfccb('0x25')](function(_0x237642){if(_0x237642&&_0x237642[_0xfccb('0x50')]===0x0){return db['UserProfileResource'][_0xfccb('0x51')]({'name':_0x503c22['name'],'resourceId':_0x503c22['id'],'type':_0x237642['name'],'sectionId':_0x237642['id']},{})[_0xfccb('0x25')](function(){return _0x467afe;});}else{return _0x467afe;}})['catch'](function(_0x3d86ef){logger['error'](_0xfccb('0x52'),_0x3d86ef);throw _0x3d86ef;});}return _0x467afe;})[_0xfccb('0x25')](respondWithResult(_0x7bb37c,0xc9))[_0xfccb('0x53')](handleError(_0x7bb37c,null));};exports[_0xfccb('0x54')]=function(_0x1d0dad,_0xea2af8){var _0x3a6530={'where':{'id':_0x1d0dad[_0xfccb('0x48')]['id']}},_0x4188c4={};_0x4188c4['model']=_[_0xfccb('0x49')](db[_0xfccb('0x2c')][_0xfccb('0x2d')]);_0x3a6530['attributes']=_[_0xfccb('0x35')](_0x4188c4[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x1d0dad[_0xfccb('0x33')]['fields']));_0x3a6530[_0xfccb('0x37')]=_0x3a6530['attributes'][_0xfccb('0x38')]?_0x3a6530[_0xfccb('0x37')]:_0x4188c4['model'];if(_0x1d0dad['query'][_0xfccb('0x43')]){_0x3a6530['include']=[{'all':!![]}];}_0x3a6530=_[_0xfccb('0x40')]({},_0x3a6530,_0x1d0dad[_0xfccb('0x42')]);return db[_0xfccb('0x2c')]['find'](_0x3a6530)[_0xfccb('0x25')](handleEntityNotFound(_0xea2af8,null))['then'](function(_0x1497bd){if(_0x1497bd){var _0x3e7319=_0x1497bd[_0xfccb('0x22')]({'plain':!![]});_0x3e7319=qs[_0xfccb('0x55')](_0x3e7319,['id','createdAt',_0xfccb('0x56')]);_0x1d0dad[_0xfccb('0x4b')]=_[_0xfccb('0x55')](_0x1d0dad[_0xfccb('0x4b')],['id',_0xfccb('0x57'),_0xfccb('0x56')]);return db['JscriptyProject'][_0xfccb('0x51')](_[_0xfccb('0x40')](_0x3e7319,_0x1d0dad[_0xfccb('0x4b')]),{'include':_0x1d0dad[_0xfccb('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0xfccb('0x25')](function(_0x3f82f9){var _0x6c1e39=_0x1d0dad[_0xfccb('0x4c')][_0xfccb('0x22')]({'plain':!![]});if(!_0x6c1e39)throw new Error(_0xfccb('0x58'));if(_0x6c1e39['role']===_0xfccb('0x4c')){var _0x3db3e4=_0x3f82f9[_0xfccb('0x22')]({'plain':!![]});var _0x5d19eb='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x5d19eb,'userProfileId':_0x6c1e39[_0xfccb('0x4f')]},'raw':!![]})[_0xfccb('0x25')](function(_0x52251a){if(_0x52251a&&_0x52251a[_0xfccb('0x50')]===0x0){return db['UserProfileResource'][_0xfccb('0x51')]({'name':_0x3db3e4[_0xfccb('0x29')],'resourceId':_0x3db3e4['id'],'type':_0x52251a[_0xfccb('0x29')],'sectionId':_0x52251a['id']},{})['then'](function(){return _0x3f82f9;});}else{return _0x3f82f9;}})[_0xfccb('0x53')](function(_0x302b4b){logger[_0xfccb('0x27')](_0xfccb('0x52'),_0x302b4b);throw _0x302b4b;});}return _0x3f82f9;});}})['then'](respondWithResult(_0xea2af8,0xc9))['catch'](handleError(_0xea2af8,null));};exports[_0xfccb('0x20')]=function(_0x5df317,_0xdb6347){if(_0x5df317[_0xfccb('0x4b')]['id']){delete _0x5df317[_0xfccb('0x4b')]['id'];}return db[_0xfccb('0x2c')][_0xfccb('0x4a')]({'where':{'id':_0x5df317['params']['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0xdb6347,null))[_0xfccb('0x25')](saveUpdates(_0x5df317[_0xfccb('0x4b')],null))['then'](respondWithResult(_0xdb6347,null))['catch'](handleError(_0xdb6347,null));};exports[_0xfccb('0x21')]=function(_0x347ed7,_0x121d6c){return db[_0xfccb('0x2c')]['find']({'where':{'id':_0x347ed7[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x121d6c,null))['then'](removeEntity(_0x121d6c,null))[_0xfccb('0x53')](handleError(_0x121d6c,null));};exports['getSessions']=function(_0x2c8fd9,_0x45dd06,_0x2749ae){var _0x4fad84={'raw':!![],'where':{}};var _0x1d03e8={};var _0x2924e4={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2c8fd9[_0xfccb('0x48')]['id']}})['then'](handleEntityNotFound(_0x45dd06,null))[_0xfccb('0x25')](function(_0x153075){if(_0x153075){_0x1d03e8['model']=_[_0xfccb('0x49')](db[_0xfccb('0x59')][_0xfccb('0x2d')]);_0x1d03e8[_0xfccb('0x33')]=_['keys'](_0x2c8fd9[_0xfccb('0x33')]);_0x1d03e8['filters']=_[_0xfccb('0x35')](_0x1d03e8[_0xfccb('0x31')],_0x1d03e8[_0xfccb('0x33')]);_0x4fad84['attributes']=_[_0xfccb('0x35')](_0x1d03e8[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x36')]));_0x4fad84[_0xfccb('0x37')]=_0x4fad84[_0xfccb('0x37')]['length']?_0x4fad84[_0xfccb('0x37')]:_0x1d03e8['model'];if(!_0x2c8fd9[_0xfccb('0x33')]['hasOwnProperty'](_0xfccb('0x3a'))){_0x4fad84[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x2c8fd9[_0xfccb('0x33')]['limit']);_0x4fad84['offset']=qs[_0xfccb('0x19')](_0x2c8fd9['query']['offset']);}_0x4fad84['order']=qs[_0xfccb('0x3c')](_0x2c8fd9['query'][_0xfccb('0x3c')]);_0x4fad84['where']=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x2c8fd9[_0xfccb('0x33')],_0x1d03e8[_0xfccb('0x34')]));_0x4fad84[_0xfccb('0x3d')][_0xfccb('0x5a')]=_0x153075['id'];if(_0x2c8fd9[_0xfccb('0x33')]['filter']){_0x4fad84[_0xfccb('0x3d')]=_['merge'](_0x4fad84[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x4fad84[_0xfccb('0x37')],function(_0x5e7fc3){var _0x5c7838={};_0x5c7838[_0x5e7fc3]={'$like':'%'+_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x5c7838;})});}_0x4fad84=_[_0xfccb('0x40')]({},_0x4fad84,_0x2c8fd9[_0xfccb('0x42')]);return db[_0xfccb('0x59')][_0xfccb('0x1b')]({'where':_0x4fad84[_0xfccb('0x3d')]})[_0xfccb('0x25')](function(_0x452d7a){_0x2924e4[_0xfccb('0x1b')]=_0x452d7a;if(_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x43')]){_0x4fad84[_0xfccb('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xfccb('0x45')](_0x4fad84);})[_0xfccb('0x25')](function(_0x2ab1cc){_0x2924e4[_0xfccb('0x46')]=_0x2ab1cc;return _0x2924e4;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x45dd06,_0x4fad84))[_0xfccb('0x53')](handleError(_0x45dd06,null));};exports[_0xfccb('0x5b')]=function(_0x363c1e,_0x5c0779,_0x4a6f51){var _0x35c6dd={'raw':!![],'where':{}};var _0x1961a0={};var _0x38d94c={'count':0x0,'rows':[]};return db[_0xfccb('0x2c')][_0xfccb('0x5c')]({'where':{'id':_0x363c1e[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x5c0779,null))['then'](function(_0x1b5961){if(_0x1b5961){_0x1961a0[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x5d')][_0xfccb('0x2d')]);_0x1961a0['query']=_[_0xfccb('0x49')](_0x363c1e[_0xfccb('0x33')]);_0x1961a0[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x1961a0['model'],_0x1961a0[_0xfccb('0x33')]);_0x35c6dd[_0xfccb('0x37')]=_['intersection'](_0x1961a0[_0xfccb('0x31')],qs['fields'](_0x363c1e[_0xfccb('0x33')]['fields']));_0x35c6dd['attributes']=_0x35c6dd['attributes']['length']?_0x35c6dd[_0xfccb('0x37')]:_0x1961a0[_0xfccb('0x31')];if(!_0x363c1e[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x35c6dd['limit']=qs[_0xfccb('0x3b')](_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x35c6dd[_0xfccb('0x19')]=qs['offset'](_0x363c1e[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x35c6dd[_0xfccb('0x5e')]=qs[_0xfccb('0x3c')](_0x363c1e['query'][_0xfccb('0x3c')]);_0x35c6dd[_0xfccb('0x3d')]=qs['filters'](_[_0xfccb('0x3e')](_0x363c1e[_0xfccb('0x33')],_0x1961a0[_0xfccb('0x34')]));_0x35c6dd[_0xfccb('0x3d')]['ProjectId']=_0x1b5961['id'];if(_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x35c6dd[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x35c6dd[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x35c6dd[_0xfccb('0x37')],function(_0x3b949b){var _0x1afb9e={};_0x1afb9e[_0x3b949b]={'$like':'%'+_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x1afb9e;})});}_0x35c6dd=_[_0xfccb('0x40')]({},_0x35c6dd,_0x363c1e['options']);return db[_0xfccb('0x5d')][_0xfccb('0x1b')]({'where':_0x35c6dd['where']})[_0xfccb('0x25')](function(_0x5783d6){_0x38d94c['count']=_0x5783d6;if(_0x363c1e[_0xfccb('0x33')][_0xfccb('0x43')]){_0x35c6dd[_0xfccb('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x35c6dd);})[_0xfccb('0x25')](function(_0x3de35e){_0x38d94c[_0xfccb('0x46')]=_0x3de35e;return _0x38d94c;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x5c0779,_0x35c6dd))['catch'](handleError(_0x5c0779,null));};function char(_0x45b22d){return'number'===typeof _0x45b22d?String['fromCharCode']['apply'](null,arguments):_0x45b22d;}function needsEncapsulation(_0x37fd9f){return!!_0x37fd9f&&(_0x37fd9f['toString']()['indexOf'](char(0xd))>=0x0||_0x37fd9f[_0xfccb('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x37fd9f[_0xfccb('0x5f')]()[_0xfccb('0x60')](char(0x2c))>=0x0||_0x37fd9f[_0xfccb('0x5f')]()[_0xfccb('0x60')](char(0x22))>=0x0);}function encapsulate(_0xcb1c31){var _0x2ead16=char(0x22),_0x49e272='\x5c'+char(0x22),_0x2e4e26=_0xcb1c31['toString']()[_0xfccb('0x61')](new RegExp(_0x2ead16,'g'),_0x49e272);return _0x2ead16+_0x2e4e26+_0x2ead16;}exports[_0xfccb('0x62')]=function(_0x11c643,_0x35e614,_0xbb397c){var _0x5bc8b4,_0x14c851;var _0x368b5e={'where':{'ProjectId':_0x11c643[_0xfccb('0x48')]['id']}};if(_0x11c643[_0xfccb('0x33')][_0xfccb('0x63')]){_0x368b5e[_0xfccb('0x3d')]['starttime']=JSON[_0xfccb('0x64')](_0x11c643[_0xfccb('0x33')][_0xfccb('0x63')]);}return db[_0xfccb('0x59')]['findAll'](_0x368b5e)['then'](handleEntityNotFound(_0x35e614,null))[_0xfccb('0x25')](function(_0x1d0d17){if(_0x1d0d17){_0x5bc8b4=_0x1d0d17;return db[_0xfccb('0x65')][_0xfccb('0x45')]({'where':{'SessionId':{'$in':_[_0xfccb('0x32')](_0x5bc8b4,'id')},'ProjectId':_0x11c643[_0xfccb('0x48')]['id']},'order':_0xfccb('0x66')});}})[_0xfccb('0x25')](handleEntityNotFound(_0x35e614,null))[_0xfccb('0x25')](function(_0x54dc80){if(_0x54dc80){_0x14c851=_0x54dc80;var _0x939693={};for(var _0x1d2982=0x0,_0x5f2f4f=_0x14c851[_0xfccb('0x38')];_0x1d2982<_0x5f2f4f;_0x1d2982++){if(!_0x939693[_0xfccb('0x39')](_0x14c851[_0x1d2982][_0xfccb('0x67')])){_0x939693[_0x14c851[_0x1d2982][_0xfccb('0x67')]]=needsEncapsulation(_0x14c851[_0x1d2982][_0xfccb('0x68')])?encapsulate(_0x14c851[_0x1d2982]['question']):_0x14c851[_0x1d2982]['question'];}}var _0x1584c6=[],_0x40eaca={};for(var _0x2178f9=0x0,_0xc38726=_0x5bc8b4[_0xfccb('0x38')];_0x2178f9<_0xc38726;_0x2178f9++){_0x40eaca={'ProjectId':_0x11c643[_0xfccb('0x48')]['id'],'SessionId':_0x5bc8b4[_0x2178f9]['id'],'StartTime':moment(_0x5bc8b4[_0x2178f9][_0xfccb('0x69')])[_0xfccb('0x6a')](_0xfccb('0x6b'))};for(var _0x4f4b8=0x0,_0x2c6f02=_0x14c851[_0xfccb('0x38')];_0x4f4b8<_0x2c6f02;_0x4f4b8++){if(_0x14c851[_0x4f4b8]['SessionId']==_0x5bc8b4[_0x2178f9]['id']&&_0x939693[_0xfccb('0x39')](_0x14c851[_0x4f4b8][_0xfccb('0x67')])){_0x40eaca[_0x939693[_0x14c851[_0x4f4b8]['questionId']]]=_0x14c851[_0x4f4b8][_0xfccb('0x6c')];}}for(var _0x1f5192 in _0x939693){if(!_0x40eaca[_0xfccb('0x39')](_0x939693[_0x1f5192])){_0x40eaca[_0x939693[_0x1f5192]]=null;}}_0x1584c6['push'](_0x40eaca);}return _0x1584c6;}})['then'](function(_0x315d9b){if(!_[_0xfccb('0x6d')](_0x315d9b)){var _0x12a8bb=toCsv(_0x315d9b);var _0x136977=Date['now']();fs[_0xfccb('0x6e')](util[_0xfccb('0x6a')](_0xfccb('0x6f'),_0x11c643[_0xfccb('0x48')]['id'],_0x136977),_0x12a8bb);_0x35e614['setHeader']('Content-disposition',_0xfccb('0x70')+util[_0xfccb('0x6a')](_0xfccb('0x71'),_0x11c643['params']['id'],_0x136977));_0x35e614[_0xfccb('0x72')](_0xfccb('0x73'),_0xfccb('0x74'));return _0x35e614['download'](util[_0xfccb('0x6a')](_0xfccb('0x6f'),_0x11c643[_0xfccb('0x48')]['id'],_0x136977));}else{return _0x35e614['sendStatus'](0xcc);}})[_0xfccb('0x53')](handleError(_0x35e614,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 6b38b8f..5c28496 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 _0x9b2a=['path','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b2a,0x127));var _0xa9b2=function(_0x4acbc6,_0x18aa65){_0x4acbc6=_0x4acbc6-0x0;var _0x36cd1e=_0x9b2a[_0x4acbc6];return _0x36cd1e;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var logger=require(_0xa9b2('0x1'))(_0xa9b2('0x2'));var moment=require(_0xa9b2('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9b2('0x4'));var fs=require('fs');var path=require(_0xa9b2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9b2('0x6'));module[_0xa9b2('0x7')]=function(_0x181a8f,_0xd7801e){return _0x181a8f['define'](_0xa9b2('0x8'),attributes,{'tableName':_0xa9b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bae=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api','bluebird','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7bae[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7ba('0x0'))(_0xe7ba('0x1'));var moment=require('moment');var BPromise=require(_0xe7ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ba('0x3'));var rimraf=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var attributes=require(_0xe7ba('0x6'));module[_0xe7ba('0x7')]=function(_0xfd3a22,_0x2d31df){return _0xfd3a22[_0xe7ba('0x8')](_0xe7ba('0x9'),attributes,{'tableName':_0xe7ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 1ae42b0..00a1b56 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 _0xbdb7=['request\x20sent','debug','JscriptyProject,\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','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x532c55,_0x4dab9a){_0x532c55=_0x532c55-0x0;var _0x1eefe9=_0xbdb7[_0x532c55];return _0x1eefe9;};'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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b4837,_0x4d9e73){var _0x29a0ee=function(_0x22ef88){while(--_0x22ef88){_0x2b4837['push'](_0x2b4837['shift']());}};_0x29a0ee(++_0x4d9e73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 45089ab..bcaf7e3 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 _0x8e13=['../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1c4fbf,_0x59a942){var _0x20e661=function(_0xabfc92){while(--_0xabfc92){_0x1c4fbf['push'](_0x1c4fbf['shift']());}};_0x20e661(++_0x59a942);}(_0x8e13,0x161));var _0x38e1=function(_0x1f3489,_0x4e8da2){_0x1f3489=_0x1f3489-0x0;var _0x12cd0d=_0x8e13[_0x1f3489];return _0x12cd0d;};'use strict';var multer=require(_0x38e1('0x0'));var util=require(_0x38e1('0x1'));var path=require(_0x38e1('0x2'));var timeout=require(_0x38e1('0x3'));var express=require(_0x38e1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x38e1('0x5'));var interaction=require(_0x38e1('0x6'));var config=require(_0x38e1('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x38e1('0x8')]);router[_0x38e1('0x9')](_0x38e1('0xa'),auth[_0x38e1('0xb')](),controller['describe']);router[_0x38e1('0x9')](_0x38e1('0xc'),auth[_0x38e1('0xb')](),controller[_0x38e1('0xd')]);router[_0x38e1('0xe')]('/',auth[_0x38e1('0xb')](),controller['create']);router[_0x38e1('0xf')]('/:id',auth[_0x38e1('0xb')](),controller[_0x38e1('0x10')]);router[_0x38e1('0x11')](_0x38e1('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc23b=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','post','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53a5c6,_0x55a3df){var _0x4e5e46=function(_0x31ee5c){while(--_0x31ee5c){_0x53a5c6['push'](_0x53a5c6['shift']());}};_0x4e5e46(++_0x55a3df);}(_0xc23b,0x88));var _0xbc23=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0xc23b[_0x2730da];return _0xfe9991;};'use strict';var multer=require(_0xbc23('0x0'));var util=require(_0xbc23('0x1'));var path=require('path');var timeout=require(_0xbc23('0x2'));var express=require(_0xbc23('0x3'));var router=express[_0xbc23('0x4')]();var fs_extra=require(_0xbc23('0x5'));var auth=require(_0xbc23('0x6'));var interaction=require(_0xbc23('0x7'));var config=require(_0xbc23('0x8'));var controller=require(_0xbc23('0x9'));router[_0xbc23('0xa')]('/',auth[_0xbc23('0xb')](),controller['index']);router[_0xbc23('0xa')]('/describe',auth[_0xbc23('0xb')](),controller[_0xbc23('0xc')]);router[_0xbc23('0xa')](_0xbc23('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xbc23('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbc23('0xf')]('/:id',auth[_0xbc23('0xb')](),controller['update']);router['delete'](_0xbc23('0xd'),auth[_0xbc23('0xb')](),controller[_0xbc23('0x10')]);module[_0xbc23('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index faca015..4634220 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(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x31a2bb,_0x2d23c1){_0x31a2bb=_0x31a2bb-0x0;var _0x415038=_0x7a54[_0x31a2bb];return _0x415038;};'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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x37b4d6,_0x1792de){_0x37b4d6=_0x37b4d6-0x0;var _0x11248d=_0x7a54[_0x37b4d6];return _0x11248d;};'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 487ecd7..f330130 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 _0xcd9e=['json','apply','reject','update','destroy','then','end','error','stack','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','keys','include','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xcd9e,0x1ee));var _0xecd9=function(_0xb01840,_0x4ab15d){_0xb01840=_0xb01840-0x0;var _0x1d38f9=_0xcd9e[_0xb01840];return _0x1d38f9;};'use strict';var emlformat=require(_0xecd9('0x0'));var rimraf=require(_0xecd9('0x1'));var zipdir=require(_0xecd9('0x2'));var jsonpatch=require(_0xecd9('0x3'));var rp=require(_0xecd9('0x4'));var moment=require(_0xecd9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xecd9('0x6'));var path=require('path');var sox=require(_0xecd9('0x7'));var csv=require(_0xecd9('0x8'));var ejs=require(_0xecd9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecd9('0xa'));var squel=require('squel');var crypto=require(_0xecd9('0xb'));var jsforce=require(_0xecd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xecd9('0x8'));var querystring=require(_0xecd9('0xd'));var Papa=require('papaparse');var Redis=require(_0xecd9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xecd9('0xf'));var as=require(_0xecd9('0x10'));var hardwareService=require(_0xecd9('0x11'));var logger=require(_0xecd9('0x12'))(_0xecd9('0x13'));var utils=require(_0xecd9('0x14'));var config=require(_0xecd9('0x15'));var licenseUtil=require(_0xecd9('0x16'));var db=require(_0xecd9('0x17'))['db'];function respondWithStatusCode(_0x989c1c,_0x5a3139){_0x5a3139=_0x5a3139||0xcc;return function(_0x6ba444){if(_0x6ba444){return _0x989c1c[_0xecd9('0x18')](_0x5a3139);}return _0x989c1c[_0xecd9('0x19')](_0x5a3139)['end']();};}function respondWithResult(_0x38822d,_0x10650a){_0x10650a=_0x10650a||0xc8;return function(_0x5d5ebb){if(_0x5d5ebb){return _0x38822d['status'](_0x10650a)['json'](_0x5d5ebb);}};}function respondWithFilteredResult(_0x36501e,_0x27dc68){return function(_0x1f32c6){if(_0x1f32c6){var _0x314343=typeof _0x27dc68[_0xecd9('0x1a')]===_0xecd9('0x1b')&&typeof _0x27dc68[_0xecd9('0x1c')]===_0xecd9('0x1b');var _0x5d8d6a=_0x1f32c6[_0xecd9('0x1d')];var _0x192b8e=_0x314343?0x0:_0x27dc68['offset'];var _0x46dd83=_0x314343?_0x1f32c6[_0xecd9('0x1d')]:_0x27dc68[_0xecd9('0x1a')]+_0x27dc68[_0xecd9('0x1c')];var _0x4786d4;if(_0x46dd83>=_0x5d8d6a){_0x46dd83=_0x5d8d6a;_0x4786d4=0xc8;}else{_0x4786d4=0xce;}_0x36501e[_0xecd9('0x19')](_0x4786d4);return _0x36501e['set'](_0xecd9('0x1e'),_0x192b8e+'-'+_0x46dd83+'/'+_0x5d8d6a)[_0xecd9('0x1f')](_0x1f32c6);}return null;};}function patchUpdates(_0x1a37f0){return function(_0x4bb755){try{jsonpatch[_0xecd9('0x20')](_0x4bb755,_0x1a37f0,!![]);}catch(_0x28b205){return BPromise[_0xecd9('0x21')](_0x28b205);}return _0x4bb755['save']();};}function saveUpdates(_0x49dd77,_0x582b39){return function(_0xda4895){if(_0xda4895){return _0xda4895[_0xecd9('0x22')](_0x49dd77)['then'](function(_0x1567d0){return _0x1567d0;});}return null;};}function removeEntity(_0x5c9dad,_0xd6b72a){return function(_0x406694){if(_0x406694){return _0x406694[_0xecd9('0x23')]()[_0xecd9('0x24')](function(){_0x5c9dad['status'](0xcc)[_0xecd9('0x25')]();});}};}function handleEntityNotFound(_0x215106,_0x241234){return function(_0x8ce901){if(!_0x8ce901){_0x215106[_0xecd9('0x18')](0x194);}return _0x8ce901;};}function handleError(_0x4a4f90,_0xe0bc17){_0xe0bc17=_0xe0bc17||0x1f4;return function(_0x4ea877){logger[_0xecd9('0x26')](_0x4ea877[_0xecd9('0x27')]);if(_0x4ea877['name']){delete _0x4ea877['name'];}_0x4a4f90[_0xecd9('0x19')](_0xe0bc17)[_0xecd9('0x28')](_0x4ea877);};}exports[_0xecd9('0x29')]=function(_0x2032b8,_0x37fcfa){var _0x2835b5={},_0x3461f5={},_0x5edb14={'count':0x0,'rows':[]};var _0x3fbbf6=_[_0xecd9('0x2a')](db[_0xecd9('0x2b')][_0xecd9('0x2c')],function(_0x3e7e2c){return{'name':_0x3e7e2c[_0xecd9('0x2d')],'type':_0x3e7e2c[_0xecd9('0x2e')][_0xecd9('0x2f')]};});_0x3461f5[_0xecd9('0x30')]=_['map'](_0x3fbbf6,_0xecd9('0x31'));_0x3461f5[_0xecd9('0x32')]=_['keys'](_0x2032b8[_0xecd9('0x32')]);_0x3461f5[_0xecd9('0x33')]=_['intersection'](_0x3461f5['model'],_0x3461f5['query']);_0x2835b5['attributes']=_[_0xecd9('0x34')](_0x3461f5[_0xecd9('0x30')],qs[_0xecd9('0x35')](_0x2032b8['query']['fields']));_0x2835b5['attributes']=_0x2835b5['attributes'][_0xecd9('0x36')]?_0x2835b5[_0xecd9('0x37')]:_0x3461f5[_0xecd9('0x30')];if(!_0x2032b8[_0xecd9('0x32')]['hasOwnProperty'](_0xecd9('0x38'))){_0x2835b5[_0xecd9('0x1c')]=qs[_0xecd9('0x1c')](_0x2032b8['query'][_0xecd9('0x1c')]);_0x2835b5[_0xecd9('0x1a')]=qs[_0xecd9('0x1a')](_0x2032b8[_0xecd9('0x32')][_0xecd9('0x1a')]);}_0x2835b5[_0xecd9('0x39')]=qs[_0xecd9('0x3a')](_0x2032b8[_0xecd9('0x32')]['sort']);_0x2835b5[_0xecd9('0x3b')]=qs[_0xecd9('0x33')](_[_0xecd9('0x3c')](_0x2032b8[_0xecd9('0x32')],_0x3461f5[_0xecd9('0x33')]),_0x3fbbf6);if(_0x2032b8[_0xecd9('0x32')][_0xecd9('0x3d')]){_0x2835b5[_0xecd9('0x3b')]=_[_0xecd9('0x3e')](_0x2835b5['where'],{'$or':_[_0xecd9('0x2a')](_0x3fbbf6,function(_0x3f7ace){if(_0x3f7ace[_0xecd9('0x2e')]!==_0xecd9('0x3f')){var _0x12f92a={};_0x12f92a[_0x3f7ace[_0xecd9('0x31')]]={'$like':'%'+_0x2032b8['query'][_0xecd9('0x3d')]+'%'};return _0x12f92a;}})});}_0x2835b5=_[_0xecd9('0x3e')]({},_0x2835b5,_0x2032b8['options']);var _0x52320d={'where':_0x2835b5['where']};return db[_0xecd9('0x2b')][_0xecd9('0x1d')](_0x52320d)[_0xecd9('0x24')](function(_0x36035b){_0x5edb14[_0xecd9('0x1d')]=_0x36035b;if(_0x2032b8[_0xecd9('0x32')][_0xecd9('0x40')]){_0x2835b5['include']=[{'all':!![]}];}return db[_0xecd9('0x2b')]['findAll'](_0x2835b5);})['then'](function(_0x47c6c5){_0x5edb14[_0xecd9('0x41')]=_0x47c6c5;return _0x5edb14;})[_0xecd9('0x24')](respondWithFilteredResult(_0x37fcfa,_0x2835b5))[_0xecd9('0x42')](handleError(_0x37fcfa,null));};exports['show']=function(_0x200574,_0x47d36a){var _0x159bd5={'raw':!![],'where':{'id':_0x200574['params']['id']}},_0x183d7c={};_0x183d7c[_0xecd9('0x30')]=_['keys'](db['JscriptyQuestionReport'][_0xecd9('0x2c')]);_0x183d7c['query']=_[_0xecd9('0x43')](_0x200574[_0xecd9('0x32')]);_0x183d7c[_0xecd9('0x33')]=_[_0xecd9('0x34')](_0x183d7c[_0xecd9('0x30')],_0x183d7c['query']);_0x159bd5['attributes']=_[_0xecd9('0x34')](_0x183d7c['model'],qs[_0xecd9('0x35')](_0x200574['query'][_0xecd9('0x35')]));_0x159bd5[_0xecd9('0x37')]=_0x159bd5[_0xecd9('0x37')][_0xecd9('0x36')]?_0x159bd5[_0xecd9('0x37')]:_0x183d7c[_0xecd9('0x30')];if(_0x200574[_0xecd9('0x32')][_0xecd9('0x40')]){_0x159bd5[_0xecd9('0x44')]=[{'all':!![]}];}_0x159bd5=_[_0xecd9('0x3e')]({},_0x159bd5,_0x200574[_0xecd9('0x45')]);return db[_0xecd9('0x2b')]['find'](_0x159bd5)[_0xecd9('0x24')](handleEntityNotFound(_0x47d36a,null))[_0xecd9('0x24')](respondWithResult(_0x47d36a,null))[_0xecd9('0x42')](handleError(_0x47d36a,null));};exports[_0xecd9('0x46')]=function(_0x498a55,_0x1cb792){return db['JscriptyQuestionReport'][_0xecd9('0x46')](_0x498a55[_0xecd9('0x47')],{})[_0xecd9('0x24')](respondWithResult(_0x1cb792,0xc9))[_0xecd9('0x42')](handleError(_0x1cb792,null));};exports[_0xecd9('0x22')]=function(_0x223145,_0x4c0425){if(_0x223145[_0xecd9('0x47')]['id']){delete _0x223145[_0xecd9('0x47')]['id'];}return db[_0xecd9('0x2b')][_0xecd9('0x48')]({'where':{'id':_0x223145[_0xecd9('0x49')]['id']}})[_0xecd9('0x24')](handleEntityNotFound(_0x4c0425,null))['then'](saveUpdates(_0x223145[_0xecd9('0x47')],null))[_0xecd9('0x24')](respondWithResult(_0x4c0425,null))[_0xecd9('0x42')](handleError(_0x4c0425,null));};exports['destroy']=function(_0x4692b9,_0x1b77d9){return db['JscriptyQuestionReport'][_0xecd9('0x48')]({'where':{'id':_0x4692b9[_0xecd9('0x49')]['id']}})[_0xecd9('0x24')](handleEntityNotFound(_0x1b77d9,null))[_0xecd9('0x24')](removeEntity(_0x1b77d9,null))[_0xecd9('0x42')](handleError(_0x1b77d9,null));};exports[_0xecd9('0x4a')]=function(_0x4b235d,_0x4d6bf7){return db[_0xecd9('0x2b')][_0xecd9('0x4a')]()['then'](respondWithResult(_0x4d6bf7,null))[_0xecd9('0x42')](handleError(_0x4d6bf7,null));}; \ No newline at end of file +var _0xeb04=['key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','name','map','JscriptyQuestionReport','rawAttributes','type'];(function(_0x157057,_0x5c9add){var _0x58c7c0=function(_0x329562){while(--_0x329562){_0x157057['push'](_0x157057['shift']());}};_0x58c7c0(++_0x5c9add);}(_0xeb04,0xad));var _0x4eb0=function(_0x4ae947,_0x2cc728){_0x4ae947=_0x4ae947-0x0;var _0x2a1529=_0xeb04[_0x4ae947];return _0x2a1529;};'use strict';var emlformat=require(_0x4eb0('0x0'));var rimraf=require(_0x4eb0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4eb0('0x2'));var rp=require('request-promise');var moment=require(_0x4eb0('0x3'));var BPromise=require(_0x4eb0('0x4'));var Mustache=require(_0x4eb0('0x5'));var util=require(_0x4eb0('0x6'));var path=require(_0x4eb0('0x7'));var sox=require(_0x4eb0('0x8'));var csv=require(_0x4eb0('0x9'));var ejs=require(_0x4eb0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb0('0xb'));var squel=require(_0x4eb0('0xc'));var crypto=require(_0x4eb0('0xd'));var jsforce=require(_0x4eb0('0xe'));var deskjs=require(_0x4eb0('0xf'));var toCsv=require(_0x4eb0('0x9'));var querystring=require('querystring');var Papa=require(_0x4eb0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4eb0('0x11'));var as=require(_0x4eb0('0x12'));var hardwareService=require(_0x4eb0('0x13'));var logger=require(_0x4eb0('0x14'))(_0x4eb0('0x15'));var utils=require(_0x4eb0('0x16'));var config=require(_0x4eb0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ce028,_0x2bb264){_0x2bb264=_0x2bb264||0xcc;return function(_0x15f125){if(_0x15f125){return _0x2ce028[_0x4eb0('0x18')](_0x2bb264);}return _0x2ce028[_0x4eb0('0x19')](_0x2bb264)[_0x4eb0('0x1a')]();};}function respondWithResult(_0x4facb6,_0x2ae2cb){_0x2ae2cb=_0x2ae2cb||0xc8;return function(_0x2a2fd2){if(_0x2a2fd2){return _0x4facb6[_0x4eb0('0x19')](_0x2ae2cb)[_0x4eb0('0x1b')](_0x2a2fd2);}};}function respondWithFilteredResult(_0x570371,_0x580f97){return function(_0x5c9715){if(_0x5c9715){var _0x8f113a=typeof _0x580f97[_0x4eb0('0x1c')]===_0x4eb0('0x1d')&&typeof _0x580f97[_0x4eb0('0x1e')]===_0x4eb0('0x1d');var _0x1001b3=_0x5c9715['count'];var _0x35b022=_0x8f113a?0x0:_0x580f97[_0x4eb0('0x1c')];var _0x312197=_0x8f113a?_0x5c9715[_0x4eb0('0x1f')]:_0x580f97[_0x4eb0('0x1c')]+_0x580f97[_0x4eb0('0x1e')];var _0x17fec6;if(_0x312197>=_0x1001b3){_0x312197=_0x1001b3;_0x17fec6=0xc8;}else{_0x17fec6=0xce;}_0x570371[_0x4eb0('0x19')](_0x17fec6);return _0x570371['set'](_0x4eb0('0x20'),_0x35b022+'-'+_0x312197+'/'+_0x1001b3)['json'](_0x5c9715);}return null;};}function patchUpdates(_0x4c073c){return function(_0x415575){try{jsonpatch['apply'](_0x415575,_0x4c073c,!![]);}catch(_0x34fff8){return BPromise[_0x4eb0('0x21')](_0x34fff8);}return _0x415575[_0x4eb0('0x22')]();};}function saveUpdates(_0x3c3bc6,_0x293066){return function(_0x21f59e){if(_0x21f59e){return _0x21f59e[_0x4eb0('0x23')](_0x3c3bc6)['then'](function(_0x79d1cf){return _0x79d1cf;});}return null;};}function removeEntity(_0x2b1dd5,_0x516f13){return function(_0x4d6193){if(_0x4d6193){return _0x4d6193[_0x4eb0('0x24')]()[_0x4eb0('0x25')](function(){_0x2b1dd5[_0x4eb0('0x19')](0xcc)[_0x4eb0('0x1a')]();});}};}function handleEntityNotFound(_0x2f383b,_0x5656cb){return function(_0x41067f){if(!_0x41067f){_0x2f383b[_0x4eb0('0x18')](0x194);}return _0x41067f;};}function handleError(_0x12a358,_0x4127cd){_0x4127cd=_0x4127cd||0x1f4;return function(_0x499118){logger['error'](_0x499118['stack']);if(_0x499118[_0x4eb0('0x26')]){delete _0x499118[_0x4eb0('0x26')];}_0x12a358[_0x4eb0('0x19')](_0x4127cd)['send'](_0x499118);};}exports['index']=function(_0x3e444c,_0xb87365){var _0x242171={},_0x51aade={},_0x53b4db={'count':0x0,'rows':[]};var _0x5b7892=_[_0x4eb0('0x27')](db[_0x4eb0('0x28')][_0x4eb0('0x29')],function(_0x7ddb42){return{'name':_0x7ddb42['fieldName'],'type':_0x7ddb42[_0x4eb0('0x2a')][_0x4eb0('0x2b')]};});_0x51aade['model']=_[_0x4eb0('0x27')](_0x5b7892,_0x4eb0('0x26'));_0x51aade['query']=_[_0x4eb0('0x2c')](_0x3e444c[_0x4eb0('0x2d')]);_0x51aade['filters']=_[_0x4eb0('0x2e')](_0x51aade[_0x4eb0('0x2f')],_0x51aade[_0x4eb0('0x2d')]);_0x242171[_0x4eb0('0x30')]=_['intersection'](_0x51aade[_0x4eb0('0x2f')],qs[_0x4eb0('0x31')](_0x3e444c[_0x4eb0('0x2d')]['fields']));_0x242171['attributes']=_0x242171[_0x4eb0('0x30')][_0x4eb0('0x32')]?_0x242171[_0x4eb0('0x30')]:_0x51aade['model'];if(!_0x3e444c[_0x4eb0('0x2d')][_0x4eb0('0x33')](_0x4eb0('0x34'))){_0x242171[_0x4eb0('0x1e')]=qs[_0x4eb0('0x1e')](_0x3e444c[_0x4eb0('0x2d')]['limit']);_0x242171[_0x4eb0('0x1c')]=qs['offset'](_0x3e444c[_0x4eb0('0x2d')]['offset']);}_0x242171[_0x4eb0('0x35')]=qs[_0x4eb0('0x36')](_0x3e444c['query']['sort']);_0x242171[_0x4eb0('0x37')]=qs['filters'](_[_0x4eb0('0x38')](_0x3e444c[_0x4eb0('0x2d')],_0x51aade[_0x4eb0('0x39')]),_0x5b7892);if(_0x3e444c[_0x4eb0('0x2d')][_0x4eb0('0x3a')]){_0x242171[_0x4eb0('0x37')]=_[_0x4eb0('0x3b')](_0x242171[_0x4eb0('0x37')],{'$or':_['map'](_0x5b7892,function(_0x8d0b4e){if(_0x8d0b4e[_0x4eb0('0x2a')]!==_0x4eb0('0x3c')){var _0x14576f={};_0x14576f[_0x8d0b4e[_0x4eb0('0x26')]]={'$like':'%'+_0x3e444c[_0x4eb0('0x2d')]['filter']+'%'};return _0x14576f;}})});}_0x242171=_[_0x4eb0('0x3b')]({},_0x242171,_0x3e444c[_0x4eb0('0x3d')]);var _0x5bccb2={'where':_0x242171[_0x4eb0('0x37')]};return db[_0x4eb0('0x28')][_0x4eb0('0x1f')](_0x5bccb2)[_0x4eb0('0x25')](function(_0x153fe6){_0x53b4db['count']=_0x153fe6;if(_0x3e444c['query']['includeAll']){_0x242171[_0x4eb0('0x3e')]=[{'all':!![]}];}return db[_0x4eb0('0x28')]['findAll'](_0x242171);})['then'](function(_0x3696d1){_0x53b4db[_0x4eb0('0x3f')]=_0x3696d1;return _0x53b4db;})[_0x4eb0('0x25')](respondWithFilteredResult(_0xb87365,_0x242171))[_0x4eb0('0x40')](handleError(_0xb87365,null));};exports[_0x4eb0('0x41')]=function(_0x1df5c9,_0x3401fd){var _0x50421d={'raw':!![],'where':{'id':_0x1df5c9[_0x4eb0('0x42')]['id']}},_0x2c746d={};_0x2c746d['model']=_[_0x4eb0('0x2c')](db[_0x4eb0('0x28')]['rawAttributes']);_0x2c746d[_0x4eb0('0x2d')]=_[_0x4eb0('0x2c')](_0x1df5c9[_0x4eb0('0x2d')]);_0x2c746d[_0x4eb0('0x39')]=_[_0x4eb0('0x2e')](_0x2c746d[_0x4eb0('0x2f')],_0x2c746d[_0x4eb0('0x2d')]);_0x50421d[_0x4eb0('0x30')]=_[_0x4eb0('0x2e')](_0x2c746d[_0x4eb0('0x2f')],qs[_0x4eb0('0x31')](_0x1df5c9[_0x4eb0('0x2d')][_0x4eb0('0x31')]));_0x50421d[_0x4eb0('0x30')]=_0x50421d[_0x4eb0('0x30')][_0x4eb0('0x32')]?_0x50421d[_0x4eb0('0x30')]:_0x2c746d['model'];if(_0x1df5c9[_0x4eb0('0x2d')][_0x4eb0('0x43')]){_0x50421d[_0x4eb0('0x3e')]=[{'all':!![]}];}_0x50421d=_['merge']({},_0x50421d,_0x1df5c9[_0x4eb0('0x3d')]);return db['JscriptyQuestionReport'][_0x4eb0('0x44')](_0x50421d)['then'](handleEntityNotFound(_0x3401fd,null))[_0x4eb0('0x25')](respondWithResult(_0x3401fd,null))[_0x4eb0('0x40')](handleError(_0x3401fd,null));};exports[_0x4eb0('0x45')]=function(_0x1e3e5e,_0xf57068){return db['JscriptyQuestionReport']['create'](_0x1e3e5e[_0x4eb0('0x46')],{})[_0x4eb0('0x25')](respondWithResult(_0xf57068,0xc9))['catch'](handleError(_0xf57068,null));};exports[_0x4eb0('0x23')]=function(_0x3531eb,_0xe1eba8){if(_0x3531eb[_0x4eb0('0x46')]['id']){delete _0x3531eb[_0x4eb0('0x46')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x3531eb[_0x4eb0('0x42')]['id']}})['then'](handleEntityNotFound(_0xe1eba8,null))[_0x4eb0('0x25')](saveUpdates(_0x3531eb[_0x4eb0('0x46')],null))['then'](respondWithResult(_0xe1eba8,null))[_0x4eb0('0x40')](handleError(_0xe1eba8,null));};exports[_0x4eb0('0x24')]=function(_0x554bbc,_0x2f591d){return db[_0x4eb0('0x28')]['find']({'where':{'id':_0x554bbc[_0x4eb0('0x42')]['id']}})[_0x4eb0('0x25')](handleEntityNotFound(_0x2f591d,null))[_0x4eb0('0x25')](removeEntity(_0x2f591d,null))[_0x4eb0('0x40')](handleError(_0x2f591d,null));};exports['describe']=function(_0x49cc6a,_0x56c7d6){return db[_0x4eb0('0x28')][_0x4eb0('0x47')]()['then'](respondWithResult(_0x56c7d6,null))[_0x4eb0('0x40')](handleError(_0x56c7d6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index c3a7713..d17d0fc 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 _0xc587=['exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x31f02b,_0x30a4d0){var _0x7b16d0=function(_0x9ca43b){while(--_0x9ca43b){_0x31f02b['push'](_0x31f02b['shift']());}};_0x7b16d0(++_0x30a4d0);}(_0xc587,0xf5));var _0x7c58=function(_0x139cf1,_0x4e068b){_0x139cf1=_0x139cf1-0x0;var _0x3b1aa7=_0xc587[_0x139cf1];return _0x3b1aa7;};'use strict';var _=require(_0x7c58('0x0'));var util=require('util');var logger=require(_0x7c58('0x1'))(_0x7c58('0x2'));var moment=require(_0x7c58('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c58('0x4'));var fs=require('fs');var path=require(_0x7c58('0x5'));var rimraf=require('rimraf');var config=require(_0x7c58('0x6'));var attributes=require(_0x7c58('0x7'));module[_0x7c58('0x8')]=function(_0x1b3786,_0x2b3352){return _0x1b3786[_0x7c58('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x7c58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc34a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','lodash'];(function(_0x389787,_0x684e7b){var _0x5855d7=function(_0x2b4423){while(--_0x2b4423){_0x389787['push'](_0x389787['shift']());}};_0x5855d7(++_0x684e7b);}(_0xc34a,0xb3));var _0xac34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac34('0x0'));var util=require('util');var logger=require(_0xac34('0x1'))(_0xac34('0x2'));var moment=require(_0xac34('0x3'));var BPromise=require(_0xac34('0x4'));var rp=require(_0xac34('0x5'));var fs=require('fs');var path=require(_0xac34('0x6'));var rimraf=require(_0xac34('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xac34('0x8')]=function(_0x314a37,_0x1d3c84){return _0x314a37[_0xac34('0x9')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 3338c07..c0ca4b1 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 _0x41ee=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x68a21c,_0x40a24e){var _0x532d51=function(_0x3a9ad4){while(--_0x3a9ad4){_0x68a21c['push'](_0x68a21c['shift']());}};_0x532d51(++_0x40a24e);}(_0x41ee,0x92));var _0xe41e=function(_0x2401e6,_0x2248d7){_0x2401e6=_0x2401e6-0x0;var _0xf06a43=_0x41ee[_0x2401e6];return _0xf06a43;};'use strict';var _=require(_0xe41e('0x0'));var util=require(_0xe41e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe41e('0x2'));var fs=require('fs');var Redis=require(_0xe41e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe41e('0x4'));var logger=require(_0xe41e('0x5'))(_0xe41e('0x6'));var config=require(_0xe41e('0x7'));var jayson=require(_0xe41e('0x8'));var client=jayson[_0xe41e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35c9a3,_0x54a6cf,_0x39a23e){return new BPromise(function(_0xb869f1,_0x5f1c42){return client['request'](_0x35c9a3,_0x39a23e)[_0xe41e('0xa')](function(_0x1691bd){logger[_0xe41e('0xb')](_0xe41e('0xc'),_0x54a6cf,_0xe41e('0xd'));logger[_0xe41e('0xe')](_0xe41e('0xf'),_0x54a6cf,_0xe41e('0xd'),JSON[_0xe41e('0x10')](_0x1691bd));if(_0x1691bd[_0xe41e('0x11')]){if(_0x1691bd[_0xe41e('0x11')]['code']===0x1f4){logger['error'](_0xe41e('0xc'),_0x54a6cf,_0x1691bd[_0xe41e('0x11')][_0xe41e('0x12')]);return _0x5f1c42(_0x1691bd['error'][_0xe41e('0x12')]);}logger[_0xe41e('0x11')](_0xe41e('0xc'),_0x54a6cf,_0x1691bd[_0xe41e('0x11')]['message']);return _0xb869f1(_0x1691bd[_0xe41e('0x11')][_0xe41e('0x12')]);}else{logger[_0xe41e('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x54a6cf,'request\x20sent');_0xb869f1(_0x1691bd[_0xe41e('0x13')][_0xe41e('0x12')]);}})['catch'](function(_0x4e943d){logger[_0xe41e('0x11')](_0xe41e('0xc'),_0x54a6cf,_0x4e943d);_0x5f1c42(_0x4e943d);});});} \ No newline at end of file +var _0xb10a=['randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird'];(function(_0x3afe47,_0x540116){var _0x35950a=function(_0x49dbd0){while(--_0x49dbd0){_0x3afe47['push'](_0x3afe47['shift']());}};_0x35950a(++_0x540116);}(_0xb10a,0x1b5));var _0xab10=function(_0xb38ee,_0x6fbc0a){_0xb38ee=_0xb38ee-0x0;var _0x57849c=_0xb10a[_0xb38ee];return _0x57849c;};'use strict';var _=require('lodash');var util=require(_0xab10('0x0'));var moment=require(_0xab10('0x1'));var BPromise=require(_0xab10('0x2'));var rs=require(_0xab10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab10('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab10('0x5'))(_0xab10('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab10('0x7')][_0xab10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4532f8,_0x59c4ab,_0x5e117b){return new BPromise(function(_0x230731,_0x44e451){return client[_0xab10('0x9')](_0x4532f8,_0x5e117b)[_0xab10('0xa')](function(_0x2ffe06){logger[_0xab10('0xb')](_0xab10('0xc'),_0x59c4ab,_0xab10('0xd'));logger[_0xab10('0xe')](_0xab10('0xf'),_0x59c4ab,_0xab10('0xd'),JSON[_0xab10('0x10')](_0x2ffe06));if(_0x2ffe06['error']){if(_0x2ffe06[_0xab10('0x11')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x59c4ab,_0x2ffe06[_0xab10('0x11')][_0xab10('0x12')]);return _0x44e451(_0x2ffe06[_0xab10('0x11')]['message']);}logger['error'](_0xab10('0xc'),_0x59c4ab,_0x2ffe06['error']['message']);return _0x230731(_0x2ffe06['error'][_0xab10('0x12')]);}else{logger[_0xab10('0xb')](_0xab10('0xc'),_0x59c4ab,'request\x20sent');_0x230731(_0x2ffe06[_0xab10('0x13')][_0xab10('0x12')]);}})['catch'](function(_0x1633dd){logger[_0xab10('0x11')](_0xab10('0xc'),_0x59c4ab,_0x1633dd);_0x44e451(_0x1633dd);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index da0f3b1..e69a417 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 _0x33af=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x374221,_0x4cb5b1){var _0x4daa58=function(_0x335572){while(--_0x335572){_0x374221['push'](_0x374221['shift']());}};_0x4daa58(++_0x4cb5b1);}(_0x33af,0xfc));var _0xf33a=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0x33af[_0x50cd41];return _0x399475;};'use strict';var multer=require(_0xf33a('0x0'));var util=require(_0xf33a('0x1'));var path=require('path');var timeout=require(_0xf33a('0x2'));var express=require(_0xf33a('0x3'));var router=express[_0xf33a('0x4')]();var fs_extra=require(_0xf33a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xf33a('0x7')]('/',auth[_0xf33a('0x8')](),controller[_0xf33a('0x9')]);router[_0xf33a('0x7')](_0xf33a('0xa'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xb')]);router[_0xf33a('0x7')](_0xf33a('0xc'),auth['isAuthenticated'](),controller[_0xf33a('0xd')]);router[_0xf33a('0x7')]('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0xf33a('0xe')]('/',auth[_0xf33a('0x8')](),controller[_0xf33a('0xf')]);router[_0xf33a('0x10')](_0xf33a('0xc'),auth[_0xf33a('0x8')](),controller[_0xf33a('0x11')]);router[_0xf33a('0x12')](_0xf33a('0xc'),auth[_0xf33a('0x8')](),controller[_0xf33a('0x13')]);module[_0xf33a('0x14')]=router; \ No newline at end of file +var _0x6f2f=['isAuthenticated','/:id','show','/:id/questions','getQuestions','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','index','/describe'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x6f2f,0x11b));var _0xf6f2=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x6f2f[_0x456fb1];return _0x4083d6;};'use strict';var multer=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var path=require(_0xf6f2('0x2'));var timeout=require(_0xf6f2('0x3'));var express=require(_0xf6f2('0x4'));var router=express['Router']();var fs_extra=require(_0xf6f2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf6f2('0x6'));var controller=require(_0xf6f2('0x7'));router[_0xf6f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xf6f2('0x9')]);router[_0xf6f2('0x8')](_0xf6f2('0xa'),auth[_0xf6f2('0xb')](),controller['describe']);router[_0xf6f2('0x8')](_0xf6f2('0xc'),auth[_0xf6f2('0xb')](),controller[_0xf6f2('0xd')]);router['get'](_0xf6f2('0xe'),auth[_0xf6f2('0xb')](),controller[_0xf6f2('0xf')]);router[_0xf6f2('0x10')]('/',auth[_0xf6f2('0xb')](),controller['create']);router['put'](_0xf6f2('0xc'),auth['isAuthenticated'](),controller[_0xf6f2('0x11')]);router[_0xf6f2('0x12')]('/:id',auth[_0xf6f2('0xb')](),controller[_0xf6f2('0x13')]);module[_0xf6f2('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 12b3330..2f030cd 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 _0x5447=['moment','sequelize','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5447,0xd0));var _0x7544=function(_0x100aef,_0x47fbae){_0x100aef=_0x100aef-0x0;var _0x2fd2b2=_0x5447[_0x100aef];return _0x2fd2b2;};'use strict';var moment=require(_0x7544('0x0'));var Sequelize=require(_0x7544('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x7544('0x2')],'set':function(_0x2ded22){this[_0x7544('0x3')]('starttime',_0x2ded22);this['setDataValue'](_0x7544('0x4'),moment()[_0x7544('0x5')](_0x7544('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x7544('0x7')]},'projectname':{'type':Sequelize[_0x7544('0x7')]},'queue':{'type':Sequelize[_0x7544('0x7')]},'uniqueid':{'type':Sequelize[_0x7544('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x17d2=['starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue'];(function(_0x3c6881,_0x1d5db4){var _0x2b2fe0=function(_0x27821b){while(--_0x27821b){_0x3c6881['push'](_0x3c6881['shift']());}};_0x2b2fe0(++_0x1d5db4);}(_0x17d2,0x19f));var _0x217d=function(_0x5c2616,_0x424bd2){_0x5c2616=_0x5c2616-0x0;var _0x3d3963=_0x17d2[_0x5c2616];return _0x3d3963;};'use strict';var moment=require(_0x217d('0x0'));var Sequelize=require(_0x217d('0x1'));module[_0x217d('0x2')]={'starttime':{'type':Sequelize[_0x217d('0x3')],'set':function(_0x514d35){this[_0x217d('0x4')](_0x217d('0x5'),_0x514d35);this[_0x217d('0x4')](_0x217d('0x6'),moment()['format'](_0x217d('0x7')));}},'endtime':{'type':Sequelize[_0x217d('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x217d('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x217d('0x8')]},'calleridnum':{'type':Sequelize[_0x217d('0x8')]},'completed':{'type':Sequelize[_0x217d('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 5e86dd0..82c30a6 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 _0xcf9c=['fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptySessionReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','type','VIRTUAL','filter','findAll','rows','catch','show','params','include','options','find','create','body','describe','JscriptyQuestionReport','hasOwnProperty','pick','SessionId','merge','includeAll','eml-format','rimraf','zip-dir'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcf9c,0x12d));var _0xccf9=function(_0x1e8eb4,_0x53a726){_0x1e8eb4=_0x1e8eb4-0x0;var _0x3e3e6e=_0xcf9c[_0x1e8eb4];return _0x3e3e6e;};'use strict';var emlformat=require(_0xccf9('0x0'));var rimraf=require(_0xccf9('0x1'));var zipdir=require(_0xccf9('0x2'));var jsonpatch=require(_0xccf9('0x3'));var rp=require(_0xccf9('0x4'));var moment=require(_0xccf9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xccf9('0x6'));var util=require(_0xccf9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xccf9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xccf9('0x9'));var _=require(_0xccf9('0xa'));var squel=require(_0xccf9('0xb'));var crypto=require('crypto');var jsforce=require(_0xccf9('0xc'));var deskjs=require(_0xccf9('0xd'));var toCsv=require(_0xccf9('0x8'));var querystring=require(_0xccf9('0xe'));var Papa=require(_0xccf9('0xf'));var Redis=require(_0xccf9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccf9('0x11'));var logger=require(_0xccf9('0x12'))(_0xccf9('0x13'));var utils=require(_0xccf9('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f679,_0x5c1b6a){_0x5c1b6a=_0x5c1b6a||0xcc;return function(_0x1053d2){if(_0x1053d2){return _0x11f679[_0xccf9('0x15')](_0x5c1b6a);}return _0x11f679[_0xccf9('0x16')](_0x5c1b6a)[_0xccf9('0x17')]();};}function respondWithResult(_0x171601,_0x2ad2b9){_0x2ad2b9=_0x2ad2b9||0xc8;return function(_0x5200bd){if(_0x5200bd){return _0x171601[_0xccf9('0x16')](_0x2ad2b9)[_0xccf9('0x18')](_0x5200bd);}};}function respondWithFilteredResult(_0x4f9e3b,_0x3e101d){return function(_0x33bf52){if(_0x33bf52){var _0x55252b=typeof _0x3e101d['offset']===_0xccf9('0x19')&&typeof _0x3e101d['limit']===_0xccf9('0x19');var _0x22ffb6=_0x33bf52['count'];var _0x1b5271=_0x55252b?0x0:_0x3e101d['offset'];var _0x12a2f7=_0x55252b?_0x33bf52[_0xccf9('0x1a')]:_0x3e101d[_0xccf9('0x1b')]+_0x3e101d[_0xccf9('0x1c')];var _0x37bd5f;if(_0x12a2f7>=_0x22ffb6){_0x12a2f7=_0x22ffb6;_0x37bd5f=0xc8;}else{_0x37bd5f=0xce;}_0x4f9e3b[_0xccf9('0x16')](_0x37bd5f);return _0x4f9e3b[_0xccf9('0x1d')](_0xccf9('0x1e'),_0x1b5271+'-'+_0x12a2f7+'/'+_0x22ffb6)['json'](_0x33bf52);}return null;};}function patchUpdates(_0x46a892){return function(_0x452039){try{jsonpatch[_0xccf9('0x1f')](_0x452039,_0x46a892,!![]);}catch(_0x41ce6b){return BPromise[_0xccf9('0x20')](_0x41ce6b);}return _0x452039[_0xccf9('0x21')]();};}function saveUpdates(_0x575dea,_0x15b9b8){return function(_0x56fdc0){if(_0x56fdc0){return _0x56fdc0[_0xccf9('0x22')](_0x575dea)[_0xccf9('0x23')](function(_0x56ac08){return _0x56ac08;});}return null;};}function removeEntity(_0x235457,_0x1b1e30){return function(_0x3209d7){if(_0x3209d7){return _0x3209d7[_0xccf9('0x24')]()[_0xccf9('0x23')](function(){_0x235457[_0xccf9('0x16')](0xcc)[_0xccf9('0x17')]();});}};}function handleEntityNotFound(_0x39da78,_0x58c246){return function(_0xb4883c){if(!_0xb4883c){_0x39da78[_0xccf9('0x15')](0x194);}return _0xb4883c;};}function handleError(_0x2a0a7f,_0x4abe61){_0x4abe61=_0x4abe61||0x1f4;return function(_0x1d672d){logger[_0xccf9('0x25')](_0x1d672d[_0xccf9('0x26')]);if(_0x1d672d['name']){delete _0x1d672d[_0xccf9('0x27')];}_0x2a0a7f[_0xccf9('0x16')](_0x4abe61)[_0xccf9('0x28')](_0x1d672d);};}exports['index']=function(_0x5ceb52,_0x9ee16c){var _0x250598={},_0x1876fe={},_0x4da9d6={'count':0x0,'rows':[]};var _0x2d5fc3=_[_0xccf9('0x29')](db[_0xccf9('0x2a')][_0xccf9('0x2b')],function(_0x35fad3){return{'name':_0x35fad3['fieldName'],'type':_0x35fad3['type']['key']};});_0x1876fe[_0xccf9('0x2c')]=_['map'](_0x2d5fc3,_0xccf9('0x27'));_0x1876fe[_0xccf9('0x2d')]=_[_0xccf9('0x2e')](_0x5ceb52[_0xccf9('0x2d')]);_0x1876fe[_0xccf9('0x2f')]=_['intersection'](_0x1876fe[_0xccf9('0x2c')],_0x1876fe[_0xccf9('0x2d')]);_0x250598[_0xccf9('0x30')]=_[_0xccf9('0x31')](_0x1876fe[_0xccf9('0x2c')],qs[_0xccf9('0x32')](_0x5ceb52[_0xccf9('0x2d')][_0xccf9('0x32')]));_0x250598[_0xccf9('0x30')]=_0x250598[_0xccf9('0x30')][_0xccf9('0x33')]?_0x250598['attributes']:_0x1876fe['model'];if(!_0x5ceb52[_0xccf9('0x2d')]['hasOwnProperty'](_0xccf9('0x34'))){_0x250598['limit']=qs[_0xccf9('0x1c')](_0x5ceb52[_0xccf9('0x2d')][_0xccf9('0x1c')]);_0x250598['offset']=qs[_0xccf9('0x1b')](_0x5ceb52['query'][_0xccf9('0x1b')]);}_0x250598[_0xccf9('0x35')]=qs['sort'](_0x5ceb52['query'][_0xccf9('0x36')]);_0x250598[_0xccf9('0x37')]=qs[_0xccf9('0x2f')](_['pick'](_0x5ceb52[_0xccf9('0x2d')],_0x1876fe['filters']),_0x2d5fc3);if(_0x5ceb52[_0xccf9('0x2d')]['filter']){_0x250598[_0xccf9('0x37')]=_['merge'](_0x250598[_0xccf9('0x37')],{'$or':_[_0xccf9('0x29')](_0x2d5fc3,function(_0x462cf3){if(_0x462cf3[_0xccf9('0x38')]!==_0xccf9('0x39')){var _0x1ef71e={};_0x1ef71e[_0x462cf3[_0xccf9('0x27')]]={'$like':'%'+_0x5ceb52[_0xccf9('0x2d')][_0xccf9('0x3a')]+'%'};return _0x1ef71e;}})});}_0x250598=_['merge']({},_0x250598,_0x5ceb52['options']);var _0x53cc00={'where':_0x250598[_0xccf9('0x37')]};return db[_0xccf9('0x2a')][_0xccf9('0x1a')](_0x53cc00)[_0xccf9('0x23')](function(_0x4886fa){_0x4da9d6[_0xccf9('0x1a')]=_0x4886fa;if(_0x5ceb52[_0xccf9('0x2d')]['includeAll']){_0x250598['include']=[{'all':!![]}];}return db[_0xccf9('0x2a')][_0xccf9('0x3b')](_0x250598);})[_0xccf9('0x23')](function(_0x3d31c6){_0x4da9d6[_0xccf9('0x3c')]=_0x3d31c6;return _0x4da9d6;})[_0xccf9('0x23')](respondWithFilteredResult(_0x9ee16c,_0x250598))[_0xccf9('0x3d')](handleError(_0x9ee16c,null));};exports[_0xccf9('0x3e')]=function(_0x31c56e,_0x105307){var _0x52b247={'raw':!![],'where':{'id':_0x31c56e[_0xccf9('0x3f')]['id']}},_0x16097e={};_0x16097e['model']=_['keys'](db[_0xccf9('0x2a')][_0xccf9('0x2b')]);_0x16097e[_0xccf9('0x2d')]=_['keys'](_0x31c56e['query']);_0x16097e['filters']=_['intersection'](_0x16097e[_0xccf9('0x2c')],_0x16097e['query']);_0x52b247[_0xccf9('0x30')]=_[_0xccf9('0x31')](_0x16097e[_0xccf9('0x2c')],qs['fields'](_0x31c56e[_0xccf9('0x2d')]['fields']));_0x52b247[_0xccf9('0x30')]=_0x52b247[_0xccf9('0x30')][_0xccf9('0x33')]?_0x52b247[_0xccf9('0x30')]:_0x16097e['model'];if(_0x31c56e[_0xccf9('0x2d')]['includeAll']){_0x52b247[_0xccf9('0x40')]=[{'all':!![]}];}_0x52b247=_['merge']({},_0x52b247,_0x31c56e[_0xccf9('0x41')]);return db[_0xccf9('0x2a')][_0xccf9('0x42')](_0x52b247)[_0xccf9('0x23')](handleEntityNotFound(_0x105307,null))[_0xccf9('0x23')](respondWithResult(_0x105307,null))['catch'](handleError(_0x105307,null));};exports[_0xccf9('0x43')]=function(_0x55c708,_0x17546f){return db[_0xccf9('0x2a')][_0xccf9('0x43')](_0x55c708['body'],{})[_0xccf9('0x23')](respondWithResult(_0x17546f,0xc9))['catch'](handleError(_0x17546f,null));};exports[_0xccf9('0x22')]=function(_0x7d8366,_0x290a41){if(_0x7d8366[_0xccf9('0x44')]['id']){delete _0x7d8366[_0xccf9('0x44')]['id'];}return db[_0xccf9('0x2a')][_0xccf9('0x42')]({'where':{'id':_0x7d8366['params']['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x290a41,null))['then'](saveUpdates(_0x7d8366['body'],null))[_0xccf9('0x23')](respondWithResult(_0x290a41,null))[_0xccf9('0x3d')](handleError(_0x290a41,null));};exports[_0xccf9('0x24')]=function(_0x17b2e7,_0x23cc43){return db[_0xccf9('0x2a')][_0xccf9('0x42')]({'where':{'id':_0x17b2e7['params']['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x23cc43,null))[_0xccf9('0x23')](removeEntity(_0x23cc43,null))[_0xccf9('0x3d')](handleError(_0x23cc43,null));};exports['describe']=function(_0x2fdf64,_0x2cbcd6){return db[_0xccf9('0x2a')][_0xccf9('0x45')]()[_0xccf9('0x23')](respondWithResult(_0x2cbcd6,null))[_0xccf9('0x3d')](handleError(_0x2cbcd6,null));};exports['getQuestions']=function(_0x16458a,_0x729995,_0x4a80fd){var _0x3df838={'raw':!![],'where':{}};var _0x23acc2={};var _0x56460f={'count':0x0,'rows':[]};return db[_0xccf9('0x2a')]['findOne']({'where':{'id':_0x16458a[_0xccf9('0x3f')]['id']}})[_0xccf9('0x23')](handleEntityNotFound(_0x729995,null))['then'](function(_0x4841ed){if(_0x4841ed){_0x23acc2[_0xccf9('0x2c')]=_['keys'](db[_0xccf9('0x46')][_0xccf9('0x2b')]);_0x23acc2['query']=_[_0xccf9('0x2e')](_0x16458a[_0xccf9('0x2d')]);_0x23acc2[_0xccf9('0x2f')]=_[_0xccf9('0x31')](_0x23acc2[_0xccf9('0x2c')],_0x23acc2[_0xccf9('0x2d')]);_0x3df838['attributes']=_[_0xccf9('0x31')](_0x23acc2['model'],qs[_0xccf9('0x32')](_0x16458a[_0xccf9('0x2d')][_0xccf9('0x32')]));_0x3df838[_0xccf9('0x30')]=_0x3df838['attributes'][_0xccf9('0x33')]?_0x3df838[_0xccf9('0x30')]:_0x23acc2[_0xccf9('0x2c')];if(!_0x16458a[_0xccf9('0x2d')][_0xccf9('0x47')]('nolimit')){_0x3df838[_0xccf9('0x1c')]=qs[_0xccf9('0x1c')](_0x16458a[_0xccf9('0x2d')][_0xccf9('0x1c')]);_0x3df838[_0xccf9('0x1b')]=qs[_0xccf9('0x1b')](_0x16458a['query'][_0xccf9('0x1b')]);}_0x3df838[_0xccf9('0x35')]=qs['sort'](_0x16458a[_0xccf9('0x2d')][_0xccf9('0x36')]);_0x3df838[_0xccf9('0x37')]=qs['filters'](_[_0xccf9('0x48')](_0x16458a[_0xccf9('0x2d')],_0x23acc2[_0xccf9('0x2f')]));_0x3df838[_0xccf9('0x37')][_0xccf9('0x49')]=_0x4841ed['id'];if(_0x16458a['query']['filter']){_0x3df838[_0xccf9('0x37')]=_[_0xccf9('0x4a')](_0x3df838[_0xccf9('0x37')],{'$or':_[_0xccf9('0x29')](_0x3df838[_0xccf9('0x30')],function(_0x22ec41){var _0x9bd16d={};_0x9bd16d[_0x22ec41]={'$like':'%'+_0x16458a[_0xccf9('0x2d')][_0xccf9('0x3a')]+'%'};return _0x9bd16d;})});}_0x3df838=_['merge']({},_0x3df838,_0x16458a[_0xccf9('0x41')]);return db[_0xccf9('0x46')][_0xccf9('0x1a')]({'where':_0x3df838[_0xccf9('0x37')]})[_0xccf9('0x23')](function(_0x32123b){_0x56460f[_0xccf9('0x1a')]=_0x32123b;if(_0x16458a[_0xccf9('0x2d')][_0xccf9('0x4b')]){_0x3df838[_0xccf9('0x40')]=[{'all':!![]}];}return db[_0xccf9('0x46')][_0xccf9('0x3b')](_0x3df838);})[_0xccf9('0x23')](function(_0xc602fd){_0x56460f[_0xccf9('0x3c')]=_0xc602fd;return _0x56460f;});}})['then'](respondWithFilteredResult(_0x729995,_0x3df838))[_0xccf9('0x3d')](handleError(_0x729995,null));}; \ No newline at end of file +var _0x4aa3=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','JscriptySessionReport','type','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','keys','rawAttributes','create','body','find','params','describe','getQuestions','hasOwnProperty','JscriptyQuestionReport','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x4aa3,0x86));var _0x34aa=function(_0xd12870,_0x491767){_0xd12870=_0xd12870-0x0;var _0x3ff4c6=_0x4aa3[_0xd12870];return _0x3ff4c6;};'use strict';var emlformat=require(_0x34aa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x34aa('0x1'));var rp=require(_0x34aa('0x2'));var moment=require(_0x34aa('0x3'));var BPromise=require(_0x34aa('0x4'));var Mustache=require(_0x34aa('0x5'));var util=require(_0x34aa('0x6'));var path=require('path');var sox=require(_0x34aa('0x7'));var csv=require(_0x34aa('0x8'));var ejs=require(_0x34aa('0x9'));var fs=require('fs');var fs_extra=require(_0x34aa('0xa'));var _=require(_0x34aa('0xb'));var squel=require('squel');var crypto=require(_0x34aa('0xc'));var jsforce=require(_0x34aa('0xd'));var deskjs=require(_0x34aa('0xe'));var toCsv=require(_0x34aa('0x8'));var querystring=require(_0x34aa('0xf'));var Papa=require('papaparse');var Redis=require(_0x34aa('0x10'));var authService=require(_0x34aa('0x11'));var qs=require(_0x34aa('0x12'));var as=require(_0x34aa('0x13'));var hardwareService=require(_0x34aa('0x14'));var logger=require('../../config/logger')(_0x34aa('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x34aa('0x16'));var db=require(_0x34aa('0x17'))['db'];function respondWithStatusCode(_0x25910a,_0xb8d7fd){_0xb8d7fd=_0xb8d7fd||0xcc;return function(_0x544c9b){if(_0x544c9b){return _0x25910a[_0x34aa('0x18')](_0xb8d7fd);}return _0x25910a[_0x34aa('0x19')](_0xb8d7fd)['end']();};}function respondWithResult(_0x447b04,_0x5703f7){_0x5703f7=_0x5703f7||0xc8;return function(_0x4a6927){if(_0x4a6927){return _0x447b04[_0x34aa('0x19')](_0x5703f7)[_0x34aa('0x1a')](_0x4a6927);}};}function respondWithFilteredResult(_0x1ad05c,_0x541645){return function(_0x2ed7aa){if(_0x2ed7aa){var _0x18b9f5=typeof _0x541645[_0x34aa('0x1b')]===_0x34aa('0x1c')&&typeof _0x541645[_0x34aa('0x1d')]===_0x34aa('0x1c');var _0x33df35=_0x2ed7aa[_0x34aa('0x1e')];var _0x243a50=_0x18b9f5?0x0:_0x541645[_0x34aa('0x1b')];var _0x17cbe5=_0x18b9f5?_0x2ed7aa[_0x34aa('0x1e')]:_0x541645[_0x34aa('0x1b')]+_0x541645[_0x34aa('0x1d')];var _0x9ddde2;if(_0x17cbe5>=_0x33df35){_0x17cbe5=_0x33df35;_0x9ddde2=0xc8;}else{_0x9ddde2=0xce;}_0x1ad05c[_0x34aa('0x19')](_0x9ddde2);return _0x1ad05c[_0x34aa('0x1f')](_0x34aa('0x20'),_0x243a50+'-'+_0x17cbe5+'/'+_0x33df35)[_0x34aa('0x1a')](_0x2ed7aa);}return null;};}function patchUpdates(_0x37c344){return function(_0x4a9b02){try{jsonpatch[_0x34aa('0x21')](_0x4a9b02,_0x37c344,!![]);}catch(_0x1b6fc6){return BPromise['reject'](_0x1b6fc6);}return _0x4a9b02[_0x34aa('0x22')]();};}function saveUpdates(_0x37a07d,_0x4d7e3d){return function(_0x5975ef){if(_0x5975ef){return _0x5975ef[_0x34aa('0x23')](_0x37a07d)[_0x34aa('0x24')](function(_0x8fc6f7){return _0x8fc6f7;});}return null;};}function removeEntity(_0x45b2aa,_0x4517c2){return function(_0x25d04e){if(_0x25d04e){return _0x25d04e[_0x34aa('0x25')]()[_0x34aa('0x24')](function(){_0x45b2aa[_0x34aa('0x19')](0xcc)[_0x34aa('0x26')]();});}};}function handleEntityNotFound(_0x2f25b3,_0x9c0559){return function(_0x459276){if(!_0x459276){_0x2f25b3[_0x34aa('0x18')](0x194);}return _0x459276;};}function handleError(_0x23890f,_0x49e747){_0x49e747=_0x49e747||0x1f4;return function(_0x385519){logger[_0x34aa('0x27')](_0x385519[_0x34aa('0x28')]);if(_0x385519[_0x34aa('0x29')]){delete _0x385519[_0x34aa('0x29')];}_0x23890f['status'](_0x49e747)[_0x34aa('0x2a')](_0x385519);};}exports[_0x34aa('0x2b')]=function(_0x2949ba,_0x513719){var _0x59e7b8={},_0x978180={},_0xfdc7b4={'count':0x0,'rows':[]};var _0xfa8389=_['map'](db[_0x34aa('0x2c')]['rawAttributes'],function(_0x5111e2){return{'name':_0x5111e2['fieldName'],'type':_0x5111e2[_0x34aa('0x2d')]['key']};});_0x978180[_0x34aa('0x2e')]=_[_0x34aa('0x2f')](_0xfa8389,_0x34aa('0x29'));_0x978180[_0x34aa('0x30')]=_['keys'](_0x2949ba[_0x34aa('0x30')]);_0x978180['filters']=_[_0x34aa('0x31')](_0x978180[_0x34aa('0x2e')],_0x978180[_0x34aa('0x30')]);_0x59e7b8['attributes']=_['intersection'](_0x978180['model'],qs['fields'](_0x2949ba[_0x34aa('0x30')][_0x34aa('0x32')]));_0x59e7b8[_0x34aa('0x33')]=_0x59e7b8[_0x34aa('0x33')][_0x34aa('0x34')]?_0x59e7b8[_0x34aa('0x33')]:_0x978180['model'];if(!_0x2949ba[_0x34aa('0x30')]['hasOwnProperty'](_0x34aa('0x35'))){_0x59e7b8[_0x34aa('0x1d')]=qs[_0x34aa('0x1d')](_0x2949ba[_0x34aa('0x30')]['limit']);_0x59e7b8[_0x34aa('0x1b')]=qs[_0x34aa('0x1b')](_0x2949ba[_0x34aa('0x30')][_0x34aa('0x1b')]);}_0x59e7b8[_0x34aa('0x36')]=qs['sort'](_0x2949ba[_0x34aa('0x30')][_0x34aa('0x37')]);_0x59e7b8[_0x34aa('0x38')]=qs[_0x34aa('0x39')](_[_0x34aa('0x3a')](_0x2949ba['query'],_0x978180[_0x34aa('0x39')]),_0xfa8389);if(_0x2949ba[_0x34aa('0x30')][_0x34aa('0x3b')]){_0x59e7b8['where']=_[_0x34aa('0x3c')](_0x59e7b8[_0x34aa('0x38')],{'$or':_[_0x34aa('0x2f')](_0xfa8389,function(_0x5c30d5){if(_0x5c30d5[_0x34aa('0x2d')]!=='VIRTUAL'){var _0x2ded35={};_0x2ded35[_0x5c30d5[_0x34aa('0x29')]]={'$like':'%'+_0x2949ba[_0x34aa('0x30')][_0x34aa('0x3b')]+'%'};return _0x2ded35;}})});}_0x59e7b8=_[_0x34aa('0x3c')]({},_0x59e7b8,_0x2949ba[_0x34aa('0x3d')]);var _0x1e9fd8={'where':_0x59e7b8[_0x34aa('0x38')]};return db[_0x34aa('0x2c')][_0x34aa('0x1e')](_0x1e9fd8)[_0x34aa('0x24')](function(_0x18d407){_0xfdc7b4[_0x34aa('0x1e')]=_0x18d407;if(_0x2949ba[_0x34aa('0x30')][_0x34aa('0x3e')]){_0x59e7b8[_0x34aa('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x59e7b8);})[_0x34aa('0x24')](function(_0x54568f){_0xfdc7b4[_0x34aa('0x40')]=_0x54568f;return _0xfdc7b4;})[_0x34aa('0x24')](respondWithFilteredResult(_0x513719,_0x59e7b8))[_0x34aa('0x41')](handleError(_0x513719,null));};exports[_0x34aa('0x42')]=function(_0x23a3e0,_0x2a4851){var _0x33583f={'raw':!![],'where':{'id':_0x23a3e0['params']['id']}},_0x146113={};_0x146113['model']=_[_0x34aa('0x43')](db[_0x34aa('0x2c')][_0x34aa('0x44')]);_0x146113['query']=_[_0x34aa('0x43')](_0x23a3e0['query']);_0x146113[_0x34aa('0x39')]=_[_0x34aa('0x31')](_0x146113[_0x34aa('0x2e')],_0x146113[_0x34aa('0x30')]);_0x33583f[_0x34aa('0x33')]=_[_0x34aa('0x31')](_0x146113[_0x34aa('0x2e')],qs['fields'](_0x23a3e0[_0x34aa('0x30')][_0x34aa('0x32')]));_0x33583f[_0x34aa('0x33')]=_0x33583f[_0x34aa('0x33')][_0x34aa('0x34')]?_0x33583f['attributes']:_0x146113[_0x34aa('0x2e')];if(_0x23a3e0[_0x34aa('0x30')][_0x34aa('0x3e')]){_0x33583f[_0x34aa('0x3f')]=[{'all':!![]}];}_0x33583f=_[_0x34aa('0x3c')]({},_0x33583f,_0x23a3e0[_0x34aa('0x3d')]);return db['JscriptySessionReport']['find'](_0x33583f)['then'](handleEntityNotFound(_0x2a4851,null))[_0x34aa('0x24')](respondWithResult(_0x2a4851,null))[_0x34aa('0x41')](handleError(_0x2a4851,null));};exports[_0x34aa('0x45')]=function(_0x2b2e6d,_0x3faf53){return db[_0x34aa('0x2c')][_0x34aa('0x45')](_0x2b2e6d['body'],{})[_0x34aa('0x24')](respondWithResult(_0x3faf53,0xc9))[_0x34aa('0x41')](handleError(_0x3faf53,null));};exports[_0x34aa('0x23')]=function(_0x39cafa,_0x1f5e08){if(_0x39cafa[_0x34aa('0x46')]['id']){delete _0x39cafa[_0x34aa('0x46')]['id'];}return db[_0x34aa('0x2c')][_0x34aa('0x47')]({'where':{'id':_0x39cafa[_0x34aa('0x48')]['id']}})[_0x34aa('0x24')](handleEntityNotFound(_0x1f5e08,null))[_0x34aa('0x24')](saveUpdates(_0x39cafa[_0x34aa('0x46')],null))[_0x34aa('0x24')](respondWithResult(_0x1f5e08,null))[_0x34aa('0x41')](handleError(_0x1f5e08,null));};exports['destroy']=function(_0x5a4edc,_0x2faa54){return db[_0x34aa('0x2c')][_0x34aa('0x47')]({'where':{'id':_0x5a4edc[_0x34aa('0x48')]['id']}})[_0x34aa('0x24')](handleEntityNotFound(_0x2faa54,null))['then'](removeEntity(_0x2faa54,null))[_0x34aa('0x41')](handleError(_0x2faa54,null));};exports[_0x34aa('0x49')]=function(_0x31e3a6,_0x325ce9){return db[_0x34aa('0x2c')][_0x34aa('0x49')]()[_0x34aa('0x24')](respondWithResult(_0x325ce9,null))[_0x34aa('0x41')](handleError(_0x325ce9,null));};exports[_0x34aa('0x4a')]=function(_0x5bfe99,_0x44ec96,_0x294f7c){var _0x561bc7={'raw':!![],'where':{}};var _0x448223={};var _0x51d138={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x5bfe99[_0x34aa('0x48')]['id']}})['then'](handleEntityNotFound(_0x44ec96,null))[_0x34aa('0x24')](function(_0x428f18){if(_0x428f18){_0x448223['model']=_[_0x34aa('0x43')](db['JscriptyQuestionReport'][_0x34aa('0x44')]);_0x448223[_0x34aa('0x30')]=_['keys'](_0x5bfe99[_0x34aa('0x30')]);_0x448223['filters']=_[_0x34aa('0x31')](_0x448223['model'],_0x448223[_0x34aa('0x30')]);_0x561bc7[_0x34aa('0x33')]=_['intersection'](_0x448223['model'],qs[_0x34aa('0x32')](_0x5bfe99[_0x34aa('0x30')][_0x34aa('0x32')]));_0x561bc7[_0x34aa('0x33')]=_0x561bc7[_0x34aa('0x33')][_0x34aa('0x34')]?_0x561bc7[_0x34aa('0x33')]:_0x448223['model'];if(!_0x5bfe99['query'][_0x34aa('0x4b')](_0x34aa('0x35'))){_0x561bc7['limit']=qs[_0x34aa('0x1d')](_0x5bfe99[_0x34aa('0x30')][_0x34aa('0x1d')]);_0x561bc7[_0x34aa('0x1b')]=qs[_0x34aa('0x1b')](_0x5bfe99[_0x34aa('0x30')][_0x34aa('0x1b')]);}_0x561bc7[_0x34aa('0x36')]=qs[_0x34aa('0x37')](_0x5bfe99[_0x34aa('0x30')]['sort']);_0x561bc7[_0x34aa('0x38')]=qs[_0x34aa('0x39')](_[_0x34aa('0x3a')](_0x5bfe99['query'],_0x448223['filters']));_0x561bc7[_0x34aa('0x38')]['SessionId']=_0x428f18['id'];if(_0x5bfe99[_0x34aa('0x30')][_0x34aa('0x3b')]){_0x561bc7['where']=_[_0x34aa('0x3c')](_0x561bc7[_0x34aa('0x38')],{'$or':_[_0x34aa('0x2f')](_0x561bc7['attributes'],function(_0xcad6be){var _0x47e979={};_0x47e979[_0xcad6be]={'$like':'%'+_0x5bfe99['query'][_0x34aa('0x3b')]+'%'};return _0x47e979;})});}_0x561bc7=_['merge']({},_0x561bc7,_0x5bfe99[_0x34aa('0x3d')]);return db[_0x34aa('0x4c')][_0x34aa('0x1e')]({'where':_0x561bc7['where']})['then'](function(_0x5818d1){_0x51d138[_0x34aa('0x1e')]=_0x5818d1;if(_0x5bfe99['query'][_0x34aa('0x3e')]){_0x561bc7[_0x34aa('0x3f')]=[{'all':!![]}];}return db[_0x34aa('0x4c')][_0x34aa('0x4d')](_0x561bc7);})[_0x34aa('0x24')](function(_0xa9790e){_0x51d138[_0x34aa('0x40')]=_0xa9790e;return _0x51d138;});}})[_0x34aa('0x24')](respondWithFilteredResult(_0x44ec96,_0x561bc7))[_0x34aa('0x41')](handleError(_0x44ec96,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 653c547..023fe5a 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 _0x6c7b=['path','rimraf','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','moment','request-promise'];(function(_0x204f09,_0x480987){var _0x54576e=function(_0x5f139a){while(--_0x5f139a){_0x204f09['push'](_0x204f09['shift']());}};_0x54576e(++_0x480987);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x352f8d,_0x1b40e5){_0x352f8d=_0x352f8d-0x0;var _0x5c5768=_0x6c7b[_0x352f8d];return _0x5c5768;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var fs=require('fs');var path=require(_0xb6c7('0x3'));var rimraf=require(_0xb6c7('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6c7('0x5'));module[_0xb6c7('0x6')]=function(_0xfe3eb9,_0x219abc){return _0xfe3eb9[_0xb6c7('0x7')]('JscriptySessionReport',attributes,{'tableName':_0xb6c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a3=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','JscriptySessionReport','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x5b3530,_0x252e01){_0x5b3530=_0x5b3530-0x0;var _0x31dce7=_0xc7a3[_0x5b3530];return _0x31dce7;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var logger=require(_0x3c7a('0x1'))(_0x3c7a('0x2'));var moment=require(_0x3c7a('0x3'));var BPromise=require(_0x3c7a('0x4'));var rp=require(_0x3c7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x3c7a('0x8')]=function(_0x2051ce,_0x2736c1){return _0x2051ce['define'](_0x3c7a('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 6bad8e0..4cfbd69 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 _0x7bd0=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bd0,0x111));var _0x07bd=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x7bd0[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('JscriptySessionReport,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});} \ No newline at end of file +var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch'];(function(_0x129f3b,_0x4a72d){var _0x24fee7=function(_0x165b58){while(--_0x165b58){_0x129f3b['push'](_0x129f3b['shift']());}};_0x24fee7(++_0x4a72d);}(_0xb44a,0x1c2));var _0xab44=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xb44a[_0x1b8f5a];return _0x594189;};'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')]('JscriptySessionReport,\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')]('JscriptySessionReport,\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);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 3388b50..f4886c1 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 _0xd730=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','isAuthenticated','exports'];(function(_0x3be20a,_0x223336){var _0x7382f6=function(_0x41c98f){while(--_0x41c98f){_0x3be20a['push'](_0x3be20a['shift']());}};_0x7382f6(++_0x223336);}(_0xd730,0xfd));var _0x0d73=function(_0x3fa330,_0x12dc4d){_0x3fa330=_0x3fa330-0x0;var _0xf0952f=_0xd730[_0x3fa330];return _0xf0952f;};'use strict';var multer=require('multer');var util=require(_0x0d73('0x0'));var path=require('path');var timeout=require(_0x0d73('0x1'));var express=require('express');var router=express[_0x0d73('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0d73('0x3'));var interaction=require(_0x0d73('0x4'));var config=require(_0x0d73('0x5'));var controller=require(_0x0d73('0x6'));router['get']('/',controller[_0x0d73('0x7')]);router[_0x0d73('0x8')]('/:id',auth[_0x0d73('0x9')](),controller['update']);module[_0x0d73('0xa')]=router; \ No newline at end of file +var _0x6317=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6317,0x11a));var _0x7631=function(_0x364e57,_0x208557){_0x364e57=_0x364e57-0x0;var _0x4ab3b8=_0x6317[_0x364e57];return _0x4ab3b8;};'use strict';var multer=require(_0x7631('0x0'));var util=require(_0x7631('0x1'));var path=require(_0x7631('0x2'));var timeout=require(_0x7631('0x3'));var express=require(_0x7631('0x4'));var router=express[_0x7631('0x5')]();var fs_extra=require(_0x7631('0x6'));var auth=require(_0x7631('0x7'));var interaction=require(_0x7631('0x8'));var config=require(_0x7631('0x9'));var controller=require(_0x7631('0xa'));router[_0x7631('0xb')]('/',controller['index']);router[_0x7631('0xc')](_0x7631('0xd'),auth[_0x7631('0xe')](),controller[_0x7631('0xf')]);module[_0x7631('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e4ea041..6ea9ed5 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 _0xcb61=['sequelize','exports','TEXT','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcb61,0x8c));var _0x1cb6=function(_0x1e151a,_0x30ee1d){_0x1e151a=_0x1e151a-0x0;var _0x3a4c44=_0xcb61[_0x1e151a];return _0x3a4c44;};'use strict';var Sequelize=require(_0x1cb6('0x0'));module[_0x1cb6('0x1')]={'license':{'type':Sequelize[_0x1cb6('0x2')]},'data1':{'type':Sequelize[_0x1cb6('0x3')]},'data2':{'type':Sequelize[_0x1cb6('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe28f=['exports','STRING'];(function(_0x3a348c,_0x194e94){var _0x3b653b=function(_0x385dbf){while(--_0x385dbf){_0x3a348c['push'](_0x3a348c['shift']());}};_0x3b653b(++_0x194e94);}(_0xe28f,0x186));var _0xfe28=function(_0x3ed312,_0x4edfac){_0x3ed312=_0x3ed312-0x0;var _0xe39b70=_0xe28f[_0x3ed312];return _0xe39b70;};'use strict';var Sequelize=require('sequelize');module[_0xfe28('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xfe28('0x1')]},'data2':{'type':Sequelize[_0xfe28('0x1')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 41c3fd3..3815d3a 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 _0x53ec=['Content-Range','apply','reject','save','then','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','find','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3dba67,_0x1fce94){var _0x581ea7=function(_0x13fda7){while(--_0x13fda7){_0x3dba67['push'](_0x3dba67['shift']());}};_0x581ea7(++_0x1fce94);}(_0x53ec,0x192));var _0xc53e=function(_0x3d8d0a,_0x11bb87){_0x3d8d0a=_0x3d8d0a-0x0;var _0x5b9df5=_0x53ec[_0x3d8d0a];return _0x5b9df5;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}var utilLicense=require('../../config/license/util');exports[_0xc53e('0x28')]=function(_0x5112d2,_0x5ce216){var _0x8f0ee6={'raw':!![],'where':{'id':0x1}},_0x6a62b0={};_0x6a62b0[_0xc53e('0x29')]=_[_0xc53e('0x2a')](db[_0xc53e('0x2b')][_0xc53e('0x2c')]);_0x6a62b0[_0xc53e('0x2d')]=_[_0xc53e('0x2a')](_0x5112d2['query']);_0x6a62b0[_0xc53e('0x2e')]=_[_0xc53e('0x2f')](_0x6a62b0[_0xc53e('0x29')],_0x6a62b0['query']);_0x8f0ee6[_0xc53e('0x30')]=_['intersection'](_0x6a62b0[_0xc53e('0x29')],qs[_0xc53e('0x31')](_0x5112d2['query']['fields']));_0x8f0ee6[_0xc53e('0x30')]=_0x8f0ee6[_0xc53e('0x30')][_0xc53e('0x32')]?_0x8f0ee6[_0xc53e('0x30')]:_0x6a62b0[_0xc53e('0x29')];_0x8f0ee6=_[_0xc53e('0x33')]({},_0x8f0ee6,_0x5112d2[_0xc53e('0x34')]);return utilLicense[_0xc53e('0x35')](_0x8f0ee6)['then'](respondWithResult(_0x5ce216,null))[_0xc53e('0x36')](handleError(_0x5ce216,null));};exports[_0xc53e('0x37')]=function(_0x19020b,_0x17ad32){if(_0x19020b[_0xc53e('0x38')]['id']){delete _0x19020b[_0xc53e('0x38')]['id'];}return db[_0xc53e('0x2b')][_0xc53e('0x39')]({'where':{'id':_0x19020b[_0xc53e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x17ad32,null))[_0xc53e('0x24')](function(_0x48d7d0){var _0x1059f3=_0x48d7d0[_0xc53e('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1059f3,_0x19020b[_0xc53e('0x38')][_0xc53e('0x3c')]);})[_0xc53e('0x24')](function(_0x5ed90b){if(!_0x5ed90b[_0xc53e('0x3d')]){return saveUpdates(_0x19020b[_0xc53e('0x38')],null);}return _0x5ed90b;})[_0xc53e('0x24')](respondWithResult(_0x17ad32,null))[_0xc53e('0x36')](handleError(_0x17ad32,null));}; \ No newline at end of file +var _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x244b18,_0x45ee2d){var _0xffe083=function(_0x535236){while(--_0x535236){_0x244b18['push'](_0x244b18['shift']());}};_0xffe083(++_0x45ee2d);}(_0x1261,0x144));var _0x1126=function(_0x5585f5,_0x167771){_0x5585f5=_0x5585f5-0x0;var _0x3439c9=_0x1261[_0x5585f5];return _0x3439c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 73acd35..5109507 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 _0xb2ad=['path','../../config/environment','./license.attributes','exports','license','util','api','moment','bluebird','request-promise'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x4958e7,_0x3eea43){_0x4958e7=_0x4958e7-0x0;var _0x40a80f=_0xb2ad[_0x4958e7];return _0x40a80f;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('License',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42f8=['rimraf','./license.attributes','exports','define','license','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x42f8,0x95));var _0x842f=function(_0x163a1b,_0x30a4ab){_0x163a1b=_0x163a1b-0x0;var _0xac5b23=_0x42f8[_0x163a1b];return _0xac5b23;};'use strict';var _=require(_0x842f('0x0'));var util=require(_0x842f('0x1'));var logger=require(_0x842f('0x2'))('api');var moment=require(_0x842f('0x3'));var BPromise=require(_0x842f('0x4'));var rp=require(_0x842f('0x5'));var fs=require('fs');var path=require(_0x842f('0x6'));var rimraf=require(_0x842f('0x7'));var config=require('../../config/environment');var attributes=require(_0x842f('0x8'));module[_0x842f('0x9')]=function(_0x60f34c,_0x30bacc){return _0x60f34c[_0x842f('0xa')]('License',attributes,{'tableName':_0x842f('0xb'),'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 b804773..3daac59 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 _0x0593=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2baec7,_0x23f8a1){var _0x3ef9d8=function(_0x48b426){while(--_0x48b426){_0x2baec7['push'](_0x2baec7['shift']());}};_0x3ef9d8(++_0x23f8a1);}(_0x0593,0x175));var _0x3059=function(_0x20fc14,_0x449fde){_0x20fc14=_0x20fc14-0x0;var _0xed7035=_0x0593[_0x20fc14];return _0xed7035;};'use strict';var _=require(_0x3059('0x0'));var util=require(_0x3059('0x1'));var moment=require(_0x3059('0x2'));var BPromise=require(_0x3059('0x3'));var rs=require(_0x3059('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3059('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3059('0x6'))(_0x3059('0x7'));var config=require('../../config/environment');var jayson=require(_0x3059('0x8'));var client=jayson[_0x3059('0x9')][_0x3059('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x312ac4,_0xcae229,_0x5bd18a){return new BPromise(function(_0x2de48d,_0x4254b2){return client['request'](_0x312ac4,_0x5bd18a)['then'](function(_0x2ec3e9){logger[_0x3059('0xb')](_0x3059('0xc'),_0xcae229,_0x3059('0xd'));logger[_0x3059('0xe')](_0x3059('0xf'),_0xcae229,_0x3059('0xd'),JSON['stringify'](_0x2ec3e9));if(_0x2ec3e9[_0x3059('0x10')]){if(_0x2ec3e9[_0x3059('0x10')][_0x3059('0x11')]===0x1f4){logger[_0x3059('0x10')](_0x3059('0xc'),_0xcae229,_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);return _0x4254b2(_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);}logger[_0x3059('0x10')]('License,\x20%s,\x20%s',_0xcae229,_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);return _0x2de48d(_0x2ec3e9[_0x3059('0x10')][_0x3059('0x12')]);}else{logger[_0x3059('0xb')](_0x3059('0xc'),_0xcae229,'request\x20sent');_0x2de48d(_0x2ec3e9[_0x3059('0x13')][_0x3059('0x12')]);}})[_0x3059('0x14')](function(_0x1e7459){logger[_0x3059('0x10')](_0x3059('0xc'),_0xcae229,_0x1e7459);_0x4254b2(_0x1e7459);});});} \ No newline at end of file +var _0x7682=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7682,0x10e));var _0x2768=function(_0x44588c,_0x161f18){_0x44588c=_0x44588c-0x0;var _0x4014fc=_0x7682[_0x44588c];return _0x4014fc;};'use strict';var _=require(_0x2768('0x0'));var util=require(_0x2768('0x1'));var moment=require(_0x2768('0x2'));var BPromise=require(_0x2768('0x3'));var rs=require(_0x2768('0x4'));var fs=require('fs');var Redis=require(_0x2768('0x5'));var db=require(_0x2768('0x6'))['db'];var utils=require(_0x2768('0x7'));var logger=require(_0x2768('0x8'))(_0x2768('0x9'));var config=require('../../config/environment');var jayson=require(_0x2768('0xa'));var client=jayson[_0x2768('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19e11c,_0x25ddf7,_0x43b12d){return new BPromise(function(_0x1cb33e,_0x4dd3ee){return client['request'](_0x19e11c,_0x43b12d)[_0x2768('0xc')](function(_0x85f03f){logger[_0x2768('0xd')](_0x2768('0xe'),_0x25ddf7,'request\x20sent');logger[_0x2768('0xf')](_0x2768('0x10'),_0x25ddf7,_0x2768('0x11'),JSON[_0x2768('0x12')](_0x85f03f));if(_0x85f03f[_0x2768('0x13')]){if(_0x85f03f['error'][_0x2768('0x14')]===0x1f4){logger[_0x2768('0x13')]('License,\x20%s,\x20%s',_0x25ddf7,_0x85f03f['error'][_0x2768('0x15')]);return _0x4dd3ee(_0x85f03f['error'][_0x2768('0x15')]);}logger[_0x2768('0x13')](_0x2768('0xe'),_0x25ddf7,_0x85f03f[_0x2768('0x13')]['message']);return _0x1cb33e(_0x85f03f['error']['message']);}else{logger[_0x2768('0xd')](_0x2768('0xe'),_0x25ddf7,_0x2768('0x11'));_0x1cb33e(_0x85f03f[_0x2768('0x16')][_0x2768('0x15')]);}})[_0x2768('0x17')](function(_0x37afc7){logger[_0x2768('0x13')](_0x2768('0xe'),_0x25ddf7,_0x37afc7);_0x4dd3ee(_0x37afc7);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 94ca216..05baa15 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 _0xffa3=['addInteraction','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','/:id/dispositions','addDisposition','post','addAnswer','addImap','addSmtp'];(function(_0xf66d47,_0x180a09){var _0x13e3bf=function(_0x284366){while(--_0x284366){_0xf66d47['push'](_0xf66d47['shift']());}};_0x13e3bf(++_0x180a09);}(_0xffa3,0x139));var _0x3ffa=function(_0x2417f9,_0x803ba4){_0x2417f9=_0x2417f9-0x0;var _0x142d82=_0xffa3[_0x2417f9];return _0x142d82;};'use strict';var multer=require('multer');var util=require(_0x3ffa('0x0'));var path=require(_0x3ffa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ffa('0x2'));var interaction=require(_0x3ffa('0x3'));var config=require(_0x3ffa('0x4'));var controller=require('./mailAccount.controller');router[_0x3ffa('0x5')]('/',auth[_0x3ffa('0x6')](),controller['index']);router[_0x3ffa('0x5')](_0x3ffa('0x7'),auth['isAuthenticated'](),controller[_0x3ffa('0x8')]);router['get'](_0x3ffa('0x9'),auth[_0x3ffa('0x6')](),controller['show']);router[_0x3ffa('0x5')]('/:id/dispositions',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0xa')]);router[_0x3ffa('0x5')](_0x3ffa('0xb'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0xc')]);router[_0x3ffa('0x5')](_0x3ffa('0xd'),auth['isAuthenticated'](),controller[_0x3ffa('0xe')]);router[_0x3ffa('0x5')](_0x3ffa('0xf'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x10')]);router[_0x3ffa('0x5')](_0x3ffa('0x11'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x12')]);router[_0x3ffa('0x5')](_0x3ffa('0x13'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x14')]);router[_0x3ffa('0x5')]('/:id/messages',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x15')]);router[_0x3ffa('0x5')](_0x3ffa('0x16'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x17')]);router[_0x3ffa('0x5')]('/:id/users',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x18')]);router['post'](_0x3ffa('0x19'),auth['isAuthenticated'](),controller[_0x3ffa('0x1a')]);router[_0x3ffa('0x1b')]('/:id/canned_answers',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x1c')]);router[_0x3ffa('0x1b')]('/',auth[_0x3ffa('0x6')](),controller['create']);router[_0x3ffa('0x1b')]('/:id/in_servers',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x1d')]);router['post'](_0x3ffa('0xf'),auth['isAuthenticated'](),controller[_0x3ffa('0x1e')]);router[_0x3ffa('0x1b')](_0x3ffa('0x11'),auth['isAuthenticated'](),controller[_0x3ffa('0x1f')]);router['post'](_0x3ffa('0x13'),auth[_0x3ffa('0x6')](),controller['addApplications']);router[_0x3ffa('0x1b')](_0x3ffa('0x20'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x21')]);router[_0x3ffa('0x1b')](_0x3ffa('0x22'),auth[_0x3ffa('0x6')](),controller['addAgents']);router[_0x3ffa('0x23')](_0x3ffa('0x9'),auth['isAuthenticated'](),controller[_0x3ffa('0x24')]);router[_0x3ffa('0x25')](_0x3ffa('0x19'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x26')]);router[_0x3ffa('0x25')](_0x3ffa('0xb'),auth['isAuthenticated'](),controller[_0x3ffa('0x27')]);router[_0x3ffa('0x25')]('/:id/in_servers',auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x28')]);router[_0x3ffa('0x25')]('/:id/out_servers',auth[_0x3ffa('0x6')](),controller['removeSmtp']);router['delete'](_0x3ffa('0x9'),auth[_0x3ffa('0x6')](),controller[_0x3ffa('0x29')]);router['delete'](_0x3ffa('0x22'),auth['isAuthenticated'](),controller[_0x3ffa('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x7de0=['getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp'];(function(_0x29ff67,_0x182b39){var _0x28f068=function(_0x52399d){while(--_0x52399d){_0x29ff67['push'](_0x29ff67['shift']());}};_0x28f068(++_0x182b39);}(_0x7de0,0x156));var _0x07de=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7de0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x07de('0x0'));var express=require(_0x07de('0x1'));var router=express[_0x07de('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x07de('0x3'));var interaction=require(_0x07de('0x4'));var config=require('../../config/environment');var controller=require(_0x07de('0x5'));router['get']('/',auth[_0x07de('0x6')](),controller['index']);router[_0x07de('0x7')](_0x07de('0x8'),auth[_0x07de('0x6')](),controller[_0x07de('0x9')]);router[_0x07de('0x7')](_0x07de('0xa'),auth[_0x07de('0x6')](),controller[_0x07de('0xb')]);router[_0x07de('0x7')](_0x07de('0xc'),auth['isAuthenticated'](),controller[_0x07de('0xd')]);router[_0x07de('0x7')](_0x07de('0xe'),auth['isAuthenticated'](),controller[_0x07de('0xf')]);router[_0x07de('0x7')](_0x07de('0x10'),auth['isAuthenticated'](),controller[_0x07de('0x11')]);router[_0x07de('0x7')](_0x07de('0x12'),auth['isAuthenticated'](),controller['getSmtp']);router[_0x07de('0x7')](_0x07de('0x13'),auth[_0x07de('0x6')](),controller[_0x07de('0x14')]);router['get'](_0x07de('0x15'),auth[_0x07de('0x6')](),controller['getApplications']);router['get'](_0x07de('0x16'),auth[_0x07de('0x6')](),controller[_0x07de('0x17')]);router['get'](_0x07de('0x18'),auth[_0x07de('0x6')](),controller[_0x07de('0x19')]);router[_0x07de('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x07de('0x1a')]);router[_0x07de('0x1b')](_0x07de('0xc'),auth[_0x07de('0x6')](),controller[_0x07de('0x1c')]);router[_0x07de('0x1b')](_0x07de('0xe'),auth['isAuthenticated'](),controller[_0x07de('0x1d')]);router['post']('/',auth[_0x07de('0x6')](),controller['create']);router['post'](_0x07de('0x10'),auth[_0x07de('0x6')](),controller[_0x07de('0x1e')]);router[_0x07de('0x1b')](_0x07de('0x12'),auth['isAuthenticated'](),controller[_0x07de('0x1f')]);router[_0x07de('0x1b')]('/:id/interactions',auth[_0x07de('0x6')](),controller[_0x07de('0x20')]);router[_0x07de('0x1b')](_0x07de('0x15'),auth[_0x07de('0x6')](),controller[_0x07de('0x21')]);router[_0x07de('0x1b')](_0x07de('0x22'),auth[_0x07de('0x6')](),controller[_0x07de('0x23')]);router[_0x07de('0x1b')](_0x07de('0x24'),auth[_0x07de('0x6')](),controller['addAgents']);router[_0x07de('0x25')](_0x07de('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x07de('0x26')](_0x07de('0xc'),auth[_0x07de('0x6')](),controller[_0x07de('0x27')]);router[_0x07de('0x26')]('/:id/canned_answers',auth[_0x07de('0x6')](),controller[_0x07de('0x28')]);router[_0x07de('0x26')](_0x07de('0x10'),auth['isAuthenticated'](),controller[_0x07de('0x29')]);router['delete'](_0x07de('0x12'),auth[_0x07de('0x6')](),controller[_0x07de('0x2a')]);router['delete'](_0x07de('0xa'),auth['isAuthenticated'](),controller[_0x07de('0x2b')]);router[_0x07de('0x26')](_0x07de('0x24'),auth['isAuthenticated'](),controller[_0x07de('0x2c')]);module[_0x07de('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 62d0da4..6cb3af3 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 _0xb205=['STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x13e072,_0x402c4a){var _0x1231b0=function(_0x11bfcf){while(--_0x11bfcf){_0x13e072['push'](_0x13e072['shift']());}};_0x1231b0(++_0x402c4a);}(_0xb205,0xf0));var _0x5b20=function(_0x637192,_0x561d88){_0x637192=_0x637192-0x0;var _0x5c674f=_0xb205[_0x637192];return _0x5c674f;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'description':{'type':Sequelize[_0x5b20('0x2')]},'name':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5b20('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5b20('0x4')](0x2)[_0x5b20('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5b20('0x6')],'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[_0x5b20('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5b20('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b20('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b20('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x5b20('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x5b20('0x3')],'defaultValue':![],'comment':_0x5b20('0x8'),'set':function(_0x5ebb0d){if(!_0x5ebb0d)this[_0x5b20('0x9')](_0x5b20('0xa'),null);this[_0x5b20('0x9')]('mandatoryDisposition',_0x5ebb0d);}}}; \ No newline at end of file +var _0x106f=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2341f8,_0x2cf224){var _0x419797=function(_0x164713){while(--_0x164713){_0x2341f8['push'](_0x2341f8['shift']());}};_0x419797(++_0x2cf224);}(_0x106f,0x162));var _0xf106=function(_0xc69916,_0x5ebbb6){_0xc69916=_0xc69916-0x0;var _0x8decf3=_0x106f[_0xc69916];return _0x8decf3;};'use strict';var Sequelize=require(_0xf106('0x0'));module[_0xf106('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf106('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xf106('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf106('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xf106('0x4')]},'markAsUnread':{'type':Sequelize[_0xf106('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf106('0x2')],'allowNull':![],'defaultValue':_0xf106('0x5')},'fontSize':{'type':Sequelize[_0xf106('0x6')](0x2)[_0xf106('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf106('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[_0xf106('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf106('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf106('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf106('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xf106('0x3')],'defaultValue':![],'comment':_0xf106('0x9'),'set':function(_0x47044b){if(!_0x47044b)this[_0xf106('0xa')](_0xf106('0xb'),null);this[_0xf106('0xa')](_0xf106('0xc'),_0x47044b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 674cc85..21ee013 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 _0x2785=['setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','internal','Tag','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','format','inlineCss','true','split','List','Contacts','%s\x20<%s>','attachments','root','server/files/attachments','basename','secure','auth','List\x20not\x20found','messageId','from','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','ValidationError','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','MailAccounts','UserProfileResource','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','params','keys','find','catch','body','describe','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','findAll','ids','CannedAnswer','getAnswers','ListId','isNil','active','description','cservice','user','pass','authentication','host','port','service','password','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap'];(function(_0x488b16,_0x3fa3f0){var _0x5bd8ce=function(_0x47b3d2){while(--_0x47b3d2){_0x488b16['push'](_0x488b16['shift']());}};_0x5bd8ce(++_0x3fa3f0);}(_0x2785,0x1be));var _0x5278=function(_0xfb3b3,_0x10db7a){_0xfb3b3=_0xfb3b3-0x0;var _0x36cae7=_0x2785[_0xfb3b3];return _0x36cae7;};'use strict';var emlformat=require(_0x5278('0x0'));var rimraf=require(_0x5278('0x1'));var zipdir=require(_0x5278('0x2'));var jsonpatch=require(_0x5278('0x3'));var rp=require(_0x5278('0x4'));var moment=require('moment');var BPromise=require(_0x5278('0x5'));var Mustache=require(_0x5278('0x6'));var util=require(_0x5278('0x7'));var path=require(_0x5278('0x8'));var sox=require(_0x5278('0x9'));var csv=require(_0x5278('0xa'));var ejs=require(_0x5278('0xb'));var fs=require('fs');var fs_extra=require(_0x5278('0xc'));var _=require(_0x5278('0xd'));var squel=require('squel');var crypto=require(_0x5278('0xe'));var jsforce=require(_0x5278('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5278('0xa'));var querystring=require(_0x5278('0x10'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require(_0x5278('0x11'));var Redis=require(_0x5278('0x12'));var authService=require(_0x5278('0x13'));var qs=require(_0x5278('0x14'));var as=require(_0x5278('0x15'));var hardwareService=require(_0x5278('0x16'));var logger=require(_0x5278('0x17'))('api');var utils=require(_0x5278('0x18'));var config=require(_0x5278('0x19'));var licenseUtil=require(_0x5278('0x1a'));var db=require(_0x5278('0x1b'))['db'];config[_0x5278('0x1c')]=_[_0x5278('0x1d')](config[_0x5278('0x1c')],{'host':_0x5278('0x1e'),'port':0x18eb});var socket=require(_0x5278('0x1f'))(new Redis(config[_0x5278('0x1c')]));require(_0x5278('0x20'))['register'](socket);var jayson=require(_0x5278('0x21'));var client=jayson[_0x5278('0x22')][_0x5278('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x3c3bad,_0x32c8f3,_0x205ba7,_0x568052){return new BPromise(function(_0x56fc5e,_0x23aa05){var _0x26465e=_0x568052||client;return _0x26465e[_0x5278('0x24')](_0x3c3bad,_0x205ba7)['then'](function(_0x55ec42){logger['info']('MailAccount,\x20%s,\x20%s',_0x32c8f3,'request\x20sent');logger[_0x5278('0x25')](_0x5278('0x26'),_0x32c8f3,_0x5278('0x27'),JSON[_0x5278('0x28')](_0x55ec42));if(_0x55ec42[_0x5278('0x29')]){if(_0x55ec42[_0x5278('0x29')][_0x5278('0x2a')]===0x1f4){logger[_0x5278('0x29')](_0x5278('0x2b'),_0x32c8f3,_0x55ec42[_0x5278('0x29')][_0x5278('0x2c')]);return _0x23aa05(_0x55ec42['error'][_0x5278('0x2c')]);}logger['error'](_0x5278('0x2b'),_0x32c8f3,_0x55ec42[_0x5278('0x29')]['message']);return _0x56fc5e(_0x55ec42[_0x5278('0x29')][_0x5278('0x2c')]);}else{logger[_0x5278('0x2d')]('MailAccount,\x20%s,\x20%s',_0x32c8f3,'request\x20sent');_0x56fc5e(_0x55ec42[_0x5278('0x2e')]['message']);}})['catch'](function(_0x110491){logger['error'](_0x5278('0x2b'),_0x32c8f3,_0x110491);_0x23aa05(_0x110491);});});}function respondWithStatusCode(_0x5b2d83,_0x3af2ce){_0x3af2ce=_0x3af2ce||0xcc;return function(_0x44806c){if(_0x44806c){return _0x5b2d83[_0x5278('0x2f')](_0x3af2ce);}return _0x5b2d83['status'](_0x3af2ce)[_0x5278('0x30')]();};}function respondWithResult(_0x17092b,_0x242bbd){_0x242bbd=_0x242bbd||0xc8;return function(_0x38673b){if(_0x38673b){return _0x17092b[_0x5278('0x31')](_0x242bbd)[_0x5278('0x32')](_0x38673b);}};}function respondWithFilteredResult(_0x31bd0e,_0x3119b3){return function(_0x5f4fa2){if(_0x5f4fa2){var _0x580a9e=typeof _0x3119b3['offset']===_0x5278('0x33')&&typeof _0x3119b3['limit']==='undefined';var _0x11f109=_0x5f4fa2[_0x5278('0x34')];var _0x4df62a=_0x580a9e?0x0:_0x3119b3[_0x5278('0x35')];var _0x1bb83b=_0x580a9e?_0x5f4fa2[_0x5278('0x34')]:_0x3119b3[_0x5278('0x35')]+_0x3119b3[_0x5278('0x36')];var _0x11073b;if(_0x1bb83b>=_0x11f109){_0x1bb83b=_0x11f109;_0x11073b=0xc8;}else{_0x11073b=0xce;}_0x31bd0e[_0x5278('0x31')](_0x11073b);return _0x31bd0e[_0x5278('0x37')](_0x5278('0x38'),_0x4df62a+'-'+_0x1bb83b+'/'+_0x11f109)[_0x5278('0x32')](_0x5f4fa2);}return null;};}function patchUpdates(_0x12de01){return function(_0x4e65a8){try{jsonpatch['apply'](_0x4e65a8,_0x12de01,!![]);}catch(_0x585a4a){return BPromise[_0x5278('0x39')](_0x585a4a);}return _0x4e65a8[_0x5278('0x3a')]();};}function saveUpdates(_0x6bb4e7,_0x1d2a3a){return function(_0x550e19){if(_0x550e19){return _0x550e19[_0x5278('0x3b')](_0x6bb4e7)['then'](function(_0x1c2ea9){return _0x1c2ea9;});}return null;};}function removeEntity(_0x6dad5b,_0xc8187b){return function(_0x4097f2){if(_0x4097f2){return _0x4097f2[_0x5278('0x3c')]()[_0x5278('0x3d')](function(){var _0x14be4a=_0x4097f2[_0x5278('0x3e')]({'plain':!![]});var _0xd00e32=_0x5278('0x3f');return db[_0x5278('0x40')][_0x5278('0x3c')]({'where':{'type':_0xd00e32,'resourceId':_0x14be4a['id']}})[_0x5278('0x3d')](function(){return _0x4097f2;});})['then'](function(){_0x6dad5b[_0x5278('0x31')](0xcc)[_0x5278('0x30')]();});}};}function handleEntityNotFound(_0x2d61e1,_0x87da4b){return function(_0xaa57d1){if(!_0xaa57d1){_0x2d61e1[_0x5278('0x2f')](0x194);}return _0xaa57d1;};}function handleError(_0x1b69e7,_0x1304d3){_0x1304d3=_0x1304d3||0x1f4;return function(_0x20659e){logger[_0x5278('0x29')](_0x20659e['stack']);if(_0x20659e[_0x5278('0x41')]){delete _0x20659e[_0x5278('0x41')];}_0x1b69e7['status'](_0x1304d3)[_0x5278('0x42')](_0x20659e);};}exports[_0x5278('0x43')]=function(_0x39d388,_0x15138d){var _0x1be384={'include':[{'model':db[_0x5278('0x44')],'as':_0x5278('0x45')},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47')},{'model':db[_0x5278('0x48')],'as':_0x5278('0x49')}]},_0x3a4c0a={},_0x3e0843={'count':0x0,'rows':[]};var _0x3becde=_['map'](db[_0x5278('0x4a')][_0x5278('0x4b')],function(_0x563067){return{'name':_0x563067[_0x5278('0x4c')],'type':_0x563067[_0x5278('0x4d')][_0x5278('0x4e')]};});_0x3a4c0a[_0x5278('0x4f')]=_['map'](_0x3becde,_0x5278('0x41'));_0x3a4c0a['query']=_['keys'](_0x39d388['query']);_0x3a4c0a[_0x5278('0x50')]=_[_0x5278('0x51')](_0x3a4c0a['model'],_0x3a4c0a['query']);_0x1be384['attributes']=_[_0x5278('0x51')](_0x3a4c0a[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x39d388[_0x5278('0x53')]['fields']));_0x1be384[_0x5278('0x54')]=_0x1be384[_0x5278('0x54')][_0x5278('0x55')]?_0x1be384[_0x5278('0x54')]:_0x3a4c0a['model'];if(!_0x39d388['query'][_0x5278('0x56')](_0x5278('0x57'))){_0x1be384[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x39d388[_0x5278('0x53')][_0x5278('0x36')]);_0x1be384[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x39d388['query'][_0x5278('0x35')]);}_0x1be384['order']=qs[_0x5278('0x58')](_0x39d388[_0x5278('0x53')]['sort']);_0x1be384[_0x5278('0x59')]=qs[_0x5278('0x50')](_['pick'](_0x39d388[_0x5278('0x53')],_0x3a4c0a[_0x5278('0x50')]),_0x3becde);if(_0x39d388['query'][_0x5278('0x5a')]){_0x1be384[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x1be384['where'],{'$or':_[_0x5278('0x5c')](_0x3becde,function(_0x2c2995){if(_0x2c2995[_0x5278('0x4d')]!==_0x5278('0x5d')){var _0x1e933f={};_0x1e933f[_0x2c2995[_0x5278('0x41')]]={'$like':'%'+_0x39d388[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x1e933f;}})});}_0x1be384=_['merge']({},_0x1be384,_0x39d388[_0x5278('0x5e')]);var _0x19d0ba={'where':_0x1be384[_0x5278('0x59')]};return db[_0x5278('0x4a')][_0x5278('0x34')](_0x19d0ba)[_0x5278('0x3d')](function(_0x330ca0){_0x3e0843[_0x5278('0x34')]=_0x330ca0;if(_0x39d388['query'][_0x5278('0x5f')]){_0x1be384[_0x5278('0x60')]=[{'all':!![]}];}return db[_0x5278('0x4a')]['findAll'](_0x1be384);})[_0x5278('0x3d')](function(_0x1247b9){_0x3e0843[_0x5278('0x61')]=_0x1247b9;return _0x3e0843;})[_0x5278('0x3d')](respondWithFilteredResult(_0x15138d,_0x1be384))['catch'](handleError(_0x15138d,null));};exports['show']=function(_0x40d525,_0x3b494d){var _0x113090={'raw':![],'where':{'id':_0x40d525[_0x5278('0x62')]['id']},'include':[{'model':db[_0x5278('0x44')],'as':'Imap'},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x32225c={};_0x32225c['model']=_[_0x5278('0x63')](db[_0x5278('0x4a')][_0x5278('0x4b')]);_0x32225c[_0x5278('0x53')]=_[_0x5278('0x63')](_0x40d525[_0x5278('0x53')]);_0x32225c['filters']=_[_0x5278('0x51')](_0x32225c[_0x5278('0x4f')],_0x32225c[_0x5278('0x53')]);_0x113090[_0x5278('0x54')]=_['intersection'](_0x32225c[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x40d525[_0x5278('0x53')][_0x5278('0x52')]));_0x113090[_0x5278('0x54')]=_0x113090[_0x5278('0x54')][_0x5278('0x55')]?_0x113090[_0x5278('0x54')]:_0x32225c[_0x5278('0x4f')];if(_0x40d525[_0x5278('0x53')][_0x5278('0x5f')]){_0x113090[_0x5278('0x60')]=[{'all':!![]}];}_0x113090=_['merge']({},_0x113090,_0x40d525['options']);return db['MailAccount'][_0x5278('0x64')](_0x113090)[_0x5278('0x3d')](handleEntityNotFound(_0x3b494d,null))[_0x5278('0x3d')](respondWithResult(_0x3b494d,null))[_0x5278('0x65')](handleError(_0x3b494d,null));};exports[_0x5278('0x3b')]=function(_0x166f37,_0x54e5fe){if(_0x166f37['body']['id']){delete _0x166f37[_0x5278('0x66')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x166f37[_0x5278('0x62')]['id']},'include':[{'model':db[_0x5278('0x44')],'as':_0x5278('0x45')},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47')},{'model':db[_0x5278('0x48')],'as':_0x5278('0x49')}]})[_0x5278('0x3d')](handleEntityNotFound(_0x54e5fe,null))[_0x5278('0x3d')](saveUpdates(_0x166f37[_0x5278('0x66')],null))[_0x5278('0x3d')](function(_0x8eb03f){if(_0x8eb03f&&_0x166f37['body']['Imap']){return db[_0x5278('0x44')]['update'](_0x166f37[_0x5278('0x66')][_0x5278('0x45')],{'where':{'MailAccountId':_0x8eb03f['id']}})[_0x5278('0x3d')](function(){return _0x8eb03f;});}return _0x8eb03f;})[_0x5278('0x3d')](function(_0x4284ea){if(_0x4284ea&&_0x166f37['body'][_0x5278('0x47')]){return db['MailServerOut'][_0x5278('0x3b')](_0x166f37[_0x5278('0x66')][_0x5278('0x47')],{'where':{'MailAccountId':_0x4284ea['id']}})[_0x5278('0x3d')](function(){return _0x4284ea;});}return _0x4284ea;})[_0x5278('0x3d')](respondWithResult(_0x54e5fe,null))['catch'](handleError(_0x54e5fe,null));};exports[_0x5278('0x67')]=function(_0x3ce343,_0x341dcc){return db[_0x5278('0x4a')][_0x5278('0x67')]()[_0x5278('0x3d')](respondWithResult(_0x341dcc,null))[_0x5278('0x65')](handleError(_0x341dcc,null));};exports['addDisposition']=function(_0x35a254,_0x15f1f1,_0x1ae0e2){if(_0x35a254['body']['id']){delete _0x35a254[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x35a254[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x15f1f1,null))[_0x5278('0x3d')](function(_0x1ff657){if(_0x1ff657){_0x35a254[_0x5278('0x66')][_0x5278('0x68')]=_0x1ff657['id'];return db[_0x5278('0x69')][_0x5278('0x6a')](_0x35a254[_0x5278('0x66')]);}})[_0x5278('0x3d')](respondWithResult(_0x15f1f1,null))['catch'](handleError(_0x15f1f1,null));};exports[_0x5278('0x6b')]=function(_0x5bfbce,_0x4460d8,_0x395931){var _0x2dee06={'raw':![],'where':{}};var _0x210cbb={};var _0x216b9e={'count':0x0,'rows':[]};return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x5bfbce[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x4460d8,null))['then'](function(_0x290ea5){if(_0x290ea5){_0x210cbb[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x69')][_0x5278('0x4b')]);_0x210cbb['query']=_[_0x5278('0x63')](_0x5bfbce[_0x5278('0x53')]);_0x210cbb[_0x5278('0x50')]=_[_0x5278('0x51')](_0x210cbb[_0x5278('0x4f')],_0x210cbb['query']);_0x2dee06[_0x5278('0x54')]=_[_0x5278('0x51')](_0x210cbb[_0x5278('0x4f')],qs['fields'](_0x5bfbce[_0x5278('0x53')]['fields']));_0x2dee06['attributes']=_0x2dee06[_0x5278('0x54')][_0x5278('0x55')]?_0x2dee06[_0x5278('0x54')]:_0x210cbb[_0x5278('0x4f')];if(!_0x5bfbce['query'][_0x5278('0x56')](_0x5278('0x57'))){_0x2dee06[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x5bfbce['query'][_0x5278('0x36')]);_0x2dee06[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x5bfbce[_0x5278('0x53')]['offset']);}_0x2dee06[_0x5278('0x6d')]=qs['sort'](_0x5bfbce[_0x5278('0x53')][_0x5278('0x58')]);_0x2dee06['where']=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x5bfbce['query'],_0x210cbb['filters']));_0x2dee06[_0x5278('0x59')]['MailAccountId']=_0x290ea5['id'];if(_0x5bfbce[_0x5278('0x53')][_0x5278('0x5a')]){_0x2dee06[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x2dee06[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x2dee06[_0x5278('0x54')],function(_0x4768b3){var _0x31775d={};_0x31775d[_0x4768b3]={'$like':'%'+_0x5bfbce['query'][_0x5278('0x5a')]+'%'};return _0x31775d;})});}_0x2dee06=_[_0x5278('0x5b')]({},_0x2dee06,_0x5bfbce['options']);return db[_0x5278('0x69')][_0x5278('0x34')]({'where':_0x2dee06[_0x5278('0x59')]})[_0x5278('0x3d')](function(_0x495566){_0x216b9e[_0x5278('0x34')]=_0x495566;if(_0x5bfbce['query'][_0x5278('0x5f')]){_0x2dee06[_0x5278('0x60')]=[{'all':!![]}];}return db[_0x5278('0x69')][_0x5278('0x6f')](_0x2dee06);})[_0x5278('0x3d')](function(_0x325c06){_0x216b9e[_0x5278('0x61')]=_0x325c06;return _0x216b9e;});}})['then'](respondWithFilteredResult(_0x4460d8,_0x2dee06))[_0x5278('0x65')](handleError(_0x4460d8,null));};exports['removeDispositions']=function(_0x2491b5,_0x4310a2,_0x34159c){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x2491b5[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x4310a2,null))['then'](function(_0x5dc829){if(_0x5dc829){return _0x5dc829['removeDispositions'](_0x2491b5[_0x5278('0x53')][_0x5278('0x70')]);}})[_0x5278('0x3d')](respondWithStatusCode(_0x4310a2,null))[_0x5278('0x65')](handleError(_0x4310a2,null));};exports['addAnswer']=function(_0x528309,_0x181799,_0x6a9f28){if(_0x528309[_0x5278('0x66')]['id']){delete _0x528309[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x528309['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x181799,null))['then'](function(_0x2f75e5){if(_0x2f75e5){_0x528309['body'][_0x5278('0x68')]=_0x2f75e5['id'];return db[_0x5278('0x71')][_0x5278('0x6a')](_0x528309['body']);}})[_0x5278('0x3d')](respondWithResult(_0x181799,null))[_0x5278('0x65')](handleError(_0x181799,null));};exports[_0x5278('0x72')]=function(_0x1ef343,_0x12d8c7,_0x59c3b2){var _0x5cb027={'raw':![],'where':{}};var _0x1fe7b7={};var _0x3419d8={'count':0x0,'rows':[]};return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x1ef343['params']['id']}})['then'](handleEntityNotFound(_0x12d8c7,null))['then'](function(_0x599e11){if(_0x599e11){_0x1fe7b7[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x71')]['rawAttributes']);_0x1fe7b7['query']=_['keys'](_0x1ef343['query']);_0x1fe7b7[_0x5278('0x50')]=_[_0x5278('0x51')](_0x1fe7b7[_0x5278('0x4f')],_0x1fe7b7[_0x5278('0x53')]);_0x5cb027['attributes']=_[_0x5278('0x51')](_0x1fe7b7[_0x5278('0x4f')],qs['fields'](_0x1ef343[_0x5278('0x53')][_0x5278('0x52')]));_0x5cb027[_0x5278('0x54')]=_0x5cb027[_0x5278('0x54')][_0x5278('0x55')]?_0x5cb027[_0x5278('0x54')]:_0x1fe7b7[_0x5278('0x4f')];if(!_0x1ef343[_0x5278('0x53')][_0x5278('0x56')](_0x5278('0x57'))){_0x5cb027['limit']=qs['limit'](_0x1ef343[_0x5278('0x53')][_0x5278('0x36')]);_0x5cb027[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x1ef343['query'][_0x5278('0x35')]);}_0x5cb027[_0x5278('0x6d')]=qs[_0x5278('0x58')](_0x1ef343[_0x5278('0x53')][_0x5278('0x58')]);_0x5cb027[_0x5278('0x59')]=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x1ef343['query'],_0x1fe7b7[_0x5278('0x50')]));_0x5cb027[_0x5278('0x59')]['MailAccountId']=_0x599e11['id'];if(_0x1ef343[_0x5278('0x53')][_0x5278('0x5a')]){_0x5cb027['where']=_[_0x5278('0x5b')](_0x5cb027['where'],{'$or':_[_0x5278('0x5c')](_0x5cb027[_0x5278('0x54')],function(_0x5293a5){var _0x1ae7ca={};_0x1ae7ca[_0x5293a5]={'$like':'%'+_0x1ef343[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x1ae7ca;})});}_0x5cb027=_[_0x5278('0x5b')]({},_0x5cb027,_0x1ef343[_0x5278('0x5e')]);return db[_0x5278('0x71')][_0x5278('0x34')]({'where':_0x5cb027[_0x5278('0x59')]})[_0x5278('0x3d')](function(_0x2300ba){_0x3419d8[_0x5278('0x34')]=_0x2300ba;if(_0x1ef343[_0x5278('0x53')][_0x5278('0x5f')]){_0x5cb027[_0x5278('0x60')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5cb027);})[_0x5278('0x3d')](function(_0x35a2a9){_0x3419d8[_0x5278('0x61')]=_0x35a2a9;return _0x3419d8;});}})[_0x5278('0x3d')](respondWithFilteredResult(_0x12d8c7,_0x5cb027))[_0x5278('0x65')](handleError(_0x12d8c7,null));};exports['removeAnswers']=function(_0x541b10,_0x338b29,_0x28308a){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x541b10[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x338b29,null))['then'](function(_0x16130d){if(_0x16130d){return _0x16130d['removeAnswers'](_0x541b10['query'][_0x5278('0x70')]);}})[_0x5278('0x3d')](respondWithStatusCode(_0x338b29,null))[_0x5278('0x65')](handleError(_0x338b29,null));};exports[_0x5278('0x6a')]=function(_0x26b10a,_0x6aafff){var _0x4c0211={'name':_0x26b10a[_0x5278('0x66')][_0x5278('0x41')],'key':_0x26b10a[_0x5278('0x66')][_0x5278('0x4e')],'email':_0x26b10a[_0x5278('0x66')]['email'],'ListId':_0x26b10a[_0x5278('0x66')][_0x5278('0x73')],'active':!_[_0x5278('0x74')](_0x26b10a[_0x5278('0x66')][_0x5278('0x75')])?_0x26b10a[_0x5278('0x66')][_0x5278('0x75')]:!![],'description':_0x26b10a['body'][_0x5278('0x76')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x26b10a[_0x5278('0x66')][_0x5278('0x77')])){if(_0x26b10a['body']['cauthentication']){_0x4c0211[_0x5278('0x45')][_0x5278('0x78')]=_0x4c0211['Smtp'][_0x5278('0x78')]=_0x26b10a[_0x5278('0x66')]['cuser'];_0x4c0211[_0x5278('0x45')]['password']=_0x4c0211[_0x5278('0x47')][_0x5278('0x79')]=_0x26b10a[_0x5278('0x66')]['cpassword'];}else{_0x4c0211['Imap'][_0x5278('0x7a')]=_0x4c0211[_0x5278('0x47')]['authentication']=![];}_0x4c0211['Imap'][_0x5278('0x7b')]=_0x26b10a[_0x5278('0x66')]['Imap'][_0x5278('0x7b')];_0x4c0211['Imap'][_0x5278('0x7c')]=_0x26b10a[_0x5278('0x66')][_0x5278('0x45')]['port'];_0x4c0211[_0x5278('0x47')]['host']=_0x26b10a[_0x5278('0x66')][_0x5278('0x47')][_0x5278('0x7b')];_0x4c0211[_0x5278('0x47')][_0x5278('0x7c')]=_0x26b10a[_0x5278('0x66')][_0x5278('0x47')]['port'];}else{_0x4c0211[_0x5278('0x45')][_0x5278('0x7d')]=_0x4c0211[_0x5278('0x47')][_0x5278('0x7d')]=_0x26b10a[_0x5278('0x66')][_0x5278('0x77')];_0x4c0211['Imap']['user']=_0x4c0211['Smtp'][_0x5278('0x78')]=_0x26b10a[_0x5278('0x66')]['cuser'];_0x4c0211[_0x5278('0x45')][_0x5278('0x7e')]=_0x4c0211['Smtp'][_0x5278('0x79')]=_0x26b10a['body'][_0x5278('0x7f')];}return db[_0x5278('0x4a')][_0x5278('0x6a')](_0x4c0211,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x5278('0x44')],'as':_0x5278('0x45')}]})[_0x5278('0x3d')](function(_0x1eda45){var _0x18b21d=_0x26b10a['user'][_0x5278('0x3e')]({'plain':!![]});if(!_0x18b21d)throw new Error(_0x5278('0x80'));if(_0x18b21d[_0x5278('0x81')]===_0x5278('0x78')){var _0x19b2c6=_0x1eda45['get']({'plain':!![]});return db[_0x5278('0x82')][_0x5278('0x64')]({'where':{'name':_0x5278('0x3f'),'userProfileId':_0x18b21d[_0x5278('0x83')]},'raw':!![]})['then'](function(_0x338c17){if(_0x338c17&&_0x338c17[_0x5278('0x84')]===0x0){return db[_0x5278('0x40')]['create']({'name':_0x19b2c6[_0x5278('0x41')],'resourceId':_0x19b2c6['id'],'type':_0x338c17[_0x5278('0x41')],'sectionId':_0x338c17['id']},{})[_0x5278('0x3d')](function(){return _0x1eda45;});}else{return _0x1eda45;}})[_0x5278('0x65')](function(_0x11859b){logger[_0x5278('0x29')](_0x5278('0x85'),_0x11859b);throw _0x11859b;});}return _0x1eda45;})['then'](respondWithResult(_0x6aafff,0xc9))['catch'](handleError(_0x6aafff,null));};exports['getImap']=function(_0x557e4c,_0x3c03a4,_0x34fd0b){return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x557e4c[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x3c03a4,null))[_0x5278('0x3d')](function(_0x3d68c4){if(_0x3d68c4){return _0x3d68c4[_0x5278('0x86')]();}return null;})[_0x5278('0x3d')](respondWithResult(_0x3c03a4,null))[_0x5278('0x65')](handleError(_0x3c03a4,null));};exports['addImap']=function(_0x39053e,_0x3e890e,_0xf04bf4){if(_0x39053e['body']['id']){delete _0x39053e[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x39053e[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e890e,null))[_0x5278('0x3d')](function(_0x45553f){if(_0x45553f){_0x39053e[_0x5278('0x66')]['MailAccountId']=_0x45553f['id'];return db[_0x5278('0x44')][_0x5278('0x6a')](_0x39053e[_0x5278('0x66')]);}})[_0x5278('0x3d')](respondWithResult(_0x3e890e,null))[_0x5278('0x65')](handleError(_0x3e890e,null));};exports[_0x5278('0x87')]=function(_0x2e22b3,_0x35b07f,_0x9a7d7c){return db['MailAccount'][_0x5278('0x6c')]({'where':{'id':_0x2e22b3[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x35b07f,null))[_0x5278('0x3d')](function(_0x389072){if(_0x389072){return _0x389072[_0x5278('0x88')](null);}return null;})[_0x5278('0x3d')](respondWithStatusCode(_0x35b07f,null))['catch'](handleError(_0x35b07f,null));};exports[_0x5278('0x89')]=function(_0x4d8f19,_0x21fcc2,_0x2571f3){return db[_0x5278('0x4a')]['findOne']({'where':{'id':_0x4d8f19['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x21fcc2,null))[_0x5278('0x3d')](function(_0x15acd6){if(_0x15acd6){return _0x15acd6['getSmtp']();}return null;})[_0x5278('0x3d')](respondWithResult(_0x21fcc2,null))[_0x5278('0x65')](handleError(_0x21fcc2,null));};exports[_0x5278('0x8a')]=function(_0x349ce8,_0x53cbe4,_0x3e2336){if(_0x349ce8[_0x5278('0x66')]['id']){delete _0x349ce8[_0x5278('0x66')]['id'];}return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x349ce8[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x53cbe4,null))[_0x5278('0x3d')](function(_0x12515a){if(_0x12515a){_0x349ce8['body'][_0x5278('0x68')]=_0x12515a['id'];return db[_0x5278('0x46')]['create'](_0x349ce8[_0x5278('0x66')]);}})[_0x5278('0x3d')](respondWithResult(_0x53cbe4,null))[_0x5278('0x65')](handleError(_0x53cbe4,null));};exports[_0x5278('0x8b')]=function(_0xe3e790,_0x11ba96,_0x5bac90){return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0xe3e790['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x11ba96,null))['then'](function(_0x1ae375){if(_0x1ae375){return _0x1ae375[_0x5278('0x8c')](null);}return null;})[_0x5278('0x3d')](respondWithStatusCode(_0x11ba96,null))[_0x5278('0x65')](handleError(_0x11ba96,null));};exports[_0x5278('0x8d')]=function(_0x40b08a,_0x2158e6,_0x49cc2b){return db[_0x5278('0x8e')]['find']({'where':{'id':_0x40b08a[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0x2158e6,null))[_0x5278('0x3d')](function(_0x173049){if(_0x173049){return _0x173049[_0x5278('0x8d')](_0x40b08a[_0x5278('0x66')][_0x5278('0x70')],_['omit'](_0x40b08a['body'],[_0x5278('0x70'),'id'])||{});}})['then'](respondWithResult(_0x2158e6,null))[_0x5278('0x65')](handleError(_0x2158e6,null));};exports[_0x5278('0x8f')]=function(_0x2c9eb7,_0xeec479,_0xc172c9){var _0x5c24a0={'raw':![],'where':{}};var _0x5090ae={};var _0x3e8a9f={'count':0x0,'rows':[]};return db['MailAccount'][_0x5278('0x6c')]({'where':{'id':_0x2c9eb7[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0xeec479,null))[_0x5278('0x3d')](function(_0x4751e0){if(_0x4751e0){_0x5090ae[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x8e')]['rawAttributes']);_0x5090ae['query']=_[_0x5278('0x63')](_0x2c9eb7[_0x5278('0x53')]);_0x5090ae[_0x5278('0x50')]=_['intersection'](_0x5090ae[_0x5278('0x4f')],_0x5090ae[_0x5278('0x53')]);_0x5c24a0[_0x5278('0x54')]=_[_0x5278('0x51')](_0x5090ae['model'],qs[_0x5278('0x52')](_0x2c9eb7[_0x5278('0x53')][_0x5278('0x52')]));_0x5c24a0[_0x5278('0x54')]=_0x5c24a0[_0x5278('0x54')]['length']?_0x5c24a0[_0x5278('0x54')]:_0x5090ae[_0x5278('0x4f')];if(!_0x2c9eb7[_0x5278('0x53')]['hasOwnProperty'](_0x5278('0x57'))){_0x5c24a0['limit']=qs[_0x5278('0x36')](_0x2c9eb7[_0x5278('0x53')][_0x5278('0x36')]);_0x5c24a0[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x2c9eb7[_0x5278('0x53')]['offset']);}_0x5c24a0[_0x5278('0x6d')]=qs['sort'](_0x2c9eb7[_0x5278('0x53')]['sort']);_0x5c24a0['where']=qs[_0x5278('0x50')](_['pick'](_0x2c9eb7['query'],_0x5090ae[_0x5278('0x50')]));_0x5c24a0[_0x5278('0x59')][_0x5278('0x68')]=_0x4751e0['id'];if(_0x2c9eb7['query'][_0x5278('0x5a')]){_0x5c24a0[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x5c24a0[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x5c24a0[_0x5278('0x54')],function(_0x120635){var _0x4e7047={};_0x4e7047[_0x120635]={'$like':'%'+_0x2c9eb7['query'][_0x5278('0x5a')]+'%'};return _0x4e7047;})});}_0x5c24a0=_[_0x5278('0x5b')]({},_0x5c24a0,_0x2c9eb7[_0x5278('0x5e')]);return db[_0x5278('0x8e')][_0x5278('0x34')]({'where':_0x5c24a0['where']})[_0x5278('0x3d')](function(_0x2c015b){_0x3e8a9f['count']=_0x2c015b;if(_0x2c9eb7[_0x5278('0x53')]['includeAll']){_0x5c24a0[_0x5278('0x60')]=[{'model':db[_0x5278('0x90')],'as':_0x5278('0x91'),'required':![]},{'model':db[_0x5278('0x92')],'as':_0x5278('0x93'),'attributes':[_0x5278('0x41'),'fullname',_0x5278('0x94')],'required':![]},{'model':db[_0x5278('0x95')],'as':'Tags','attributes':['id',_0x5278('0x41'),'color'],'where':_0x2c9eb7[_0x5278('0x53')]['tag']?{'id':_0x2c9eb7[_0x5278('0x53')][_0x5278('0x96')]}:undefined,'required':_0x2c9eb7[_0x5278('0x53')][_0x5278('0x96')]?!![]:![]}];}return db[_0x5278('0x8e')][_0x5278('0x6f')](_0x5c24a0);})['then'](function(_0x40990a){_0x3e8a9f[_0x5278('0x61')]=_0x40990a;return _0x3e8a9f;});}})[_0x5278('0x3d')](respondWithFilteredResult(_0xeec479,_0x5c24a0))['catch'](handleError(_0xeec479,null));};exports[_0x5278('0x97')]=function addApplications(_0x5f0263,_0x9698d7){var _0x45844a=_0x5f0263[_0x5278('0x62')]['id'];var _0x584f74=_0x5f0263['body'];var _0x5a1210=0xc8;var _0x4a9823=null;return db[_0x5278('0x98')]['transaction']({'isolationLevel':db['sequelize'][_0x5278('0x99')]['ISOLATION_LEVELS'][_0x5278('0x9a')]},function(_0xd8c539){return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x45844a},'transaction':_0xd8c539})[_0x5278('0x3d')](function(_0x1a5e0d){if(_0x1a5e0d){return db[_0x5278('0x9b')][_0x5278('0x3c')]({'where':{'MailAccountId':_0x45844a},'transaction':_0xd8c539})[_0x5278('0x3d')](function(){var _0x20078a=_[_0x5278('0x5c')](_0x584f74,function(_0x20b6d1){_0x20b6d1[_0x5278('0x68')]=_0x45844a;return _0x20b6d1;});return db['MailApplication'][_0x5278('0x9c')](_0x20078a,{'transaction':_0xd8c539});});}else{_0x5a1210=0x194;_0x4a9823=[];}});})[_0x5278('0x3d')](function(){if(_0x5a1210!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x45844a},'order':_0x5278('0x9d')})[_0x5278('0x3d')](function(_0x22518b){_0x4a9823=_0x22518b;});}})[_0x5278('0x65')](function(_0xb8f749){_0x5a1210=0x1f4;logger[_0x5278('0x29')](_0xb8f749['stack']);if(_0xb8f749[_0x5278('0x41')]){delete _0xb8f749[_0x5278('0x41')];}_0x4a9823=_0xb8f749;})['finally'](function(){if(_0x4a9823===null){_0x9698d7[_0x5278('0x2f')](_0x5a1210);}else{if(_0x5a1210===0x1f4){_0x9698d7[_0x5278('0x31')](_0x5a1210)['send'](_0x4a9823);}else{_0x9698d7[_0x5278('0x31')](_0x5a1210)[_0x5278('0x32')](_0x4a9823);}}});};exports[_0x5278('0x9e')]=function(_0x103d25,_0x3e93d2,_0x2b7396){var _0x376ab6={};var _0x8a54f2={};var _0x1566b8;var _0x6ea46e;return db[_0x5278('0x4a')]['findOne']({'where':{'id':_0x103d25[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x3e93d2,null))[_0x5278('0x3d')](function(_0x26ac7b){if(_0x26ac7b){_0x1566b8=_0x26ac7b;_0x8a54f2[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x9b')][_0x5278('0x4b')]);_0x8a54f2[_0x5278('0x53')]=_[_0x5278('0x63')](_0x103d25[_0x5278('0x53')]);_0x8a54f2[_0x5278('0x50')]=_[_0x5278('0x51')](_0x8a54f2['model'],_0x8a54f2[_0x5278('0x53')]);_0x376ab6['attributes']=_['intersection'](_0x8a54f2[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x103d25[_0x5278('0x53')][_0x5278('0x52')]));_0x376ab6[_0x5278('0x54')]=_0x376ab6[_0x5278('0x54')][_0x5278('0x55')]?_0x376ab6[_0x5278('0x54')]:_0x8a54f2['model'];_0x376ab6['order']=qs['sort'](_0x103d25[_0x5278('0x53')][_0x5278('0x58')]);_0x376ab6[_0x5278('0x59')]=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x103d25[_0x5278('0x53')],_0x8a54f2[_0x5278('0x50')]));if(_0x103d25['query'][_0x5278('0x5a')]){_0x376ab6[_0x5278('0x59')]=_['merge'](_0x376ab6[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x376ab6['attributes'],function(_0x1f84f0){var _0x1d1029={};_0x1d1029[_0x1f84f0]={'$like':'%'+_0x103d25['query'][_0x5278('0x5a')]+'%'};return _0x1d1029;})});}_0x376ab6=_[_0x5278('0x5b')]({},_0x376ab6,_0x103d25['options']);return _0x1566b8[_0x5278('0x9e')](_0x376ab6);}})[_0x5278('0x3d')](function(_0x129078){if(_0x129078){_0x6ea46e=_0x129078[_0x5278('0x55')];if(!_0x103d25[_0x5278('0x53')][_0x5278('0x56')](_0x5278('0x57'))){_0x376ab6[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x103d25[_0x5278('0x53')]['limit']);_0x376ab6[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x103d25[_0x5278('0x53')][_0x5278('0x35')]);}return _0x1566b8[_0x5278('0x9e')](_0x376ab6);}})['then'](function(_0x390f0c){if(_0x390f0c){return _0x390f0c?{'count':_0x6ea46e,'rows':_0x390f0c}:null;}})['then'](respondWithResult(_0x3e93d2,null))[_0x5278('0x65')](handleError(_0x3e93d2,null));};exports['getMessages']=function(_0x3e5eee,_0x3450c2,_0x3fce3b){var _0x60a9b0={'raw':!![],'where':{}};var _0x5d08a7={};var _0x251b4f={'count':0x0,'rows':[]};return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x3e5eee[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x3450c2,null))[_0x5278('0x3d')](function(_0x3b18ae){if(_0x3b18ae){_0x5d08a7[_0x5278('0x4f')]=_['keys'](db[_0x5278('0x9f')][_0x5278('0x4b')]);_0x5d08a7[_0x5278('0x53')]=_[_0x5278('0x63')](_0x3e5eee['query']);_0x5d08a7[_0x5278('0x50')]=_[_0x5278('0x51')](_0x5d08a7[_0x5278('0x4f')],_0x5d08a7['query']);_0x60a9b0[_0x5278('0x54')]=_['intersection'](_0x5d08a7[_0x5278('0x4f')],qs[_0x5278('0x52')](_0x3e5eee[_0x5278('0x53')][_0x5278('0x52')]));_0x60a9b0['attributes']=_0x60a9b0['attributes'][_0x5278('0x55')]?_0x60a9b0['attributes']:_0x5d08a7['model'];if(!_0x3e5eee[_0x5278('0x53')]['hasOwnProperty'](_0x5278('0x57'))){_0x60a9b0[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x3e5eee['query'][_0x5278('0x36')]);_0x60a9b0[_0x5278('0x35')]=qs[_0x5278('0x35')](_0x3e5eee[_0x5278('0x53')]['offset']);}_0x60a9b0[_0x5278('0x6d')]=qs['sort'](_0x3e5eee[_0x5278('0x53')][_0x5278('0x58')]);_0x60a9b0['where']=qs[_0x5278('0x50')](_[_0x5278('0x6e')](_0x3e5eee[_0x5278('0x53')],_0x5d08a7[_0x5278('0x50')]));_0x60a9b0[_0x5278('0x59')][_0x5278('0x68')]=_0x3b18ae['id'];if(_0x3e5eee[_0x5278('0x53')][_0x5278('0x5a')]){_0x60a9b0['where']=_[_0x5278('0x5b')](_0x60a9b0['where'],{'$or':_[_0x5278('0x5c')](_0x60a9b0[_0x5278('0x54')],function(_0x5ef586){var _0x12d3f={};_0x12d3f[_0x5ef586]={'$like':'%'+_0x3e5eee[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x12d3f;})});}if(_0x3e5eee[_0x5278('0x53')][_0x5278('0xa0')]){var _0x24c575=_0x3e5eee['query'][_0x5278('0xa0')]['split'](',');var _0x1bd35a={};_0x1bd35a[_0x24c575[0x0]]={'$gte':moment(_0x24c575[0x1])[_0x5278('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x60a9b0[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x60a9b0[_0x5278('0x59')],_0x1bd35a);}_0x60a9b0=_[_0x5278('0x5b')]({},_0x60a9b0,_0x3e5eee['options']);return db[_0x5278('0x9f')][_0x5278('0x34')]({'where':_0x60a9b0[_0x5278('0x59')]})[_0x5278('0x3d')](function(_0x3f975e){_0x251b4f[_0x5278('0x34')]=_0x3f975e;if(_0x3e5eee[_0x5278('0x53')][_0x5278('0x5f')]){_0x60a9b0[_0x5278('0x60')]=[{'all':!![]}];}return db[_0x5278('0x9f')]['findAll'](_0x60a9b0);})[_0x5278('0x3d')](function(_0x4eea7c){if(_0x3e5eee['query'][_0x5278('0xa2')]===_0x5278('0xa3')){for(var _0x399d5=0x0;_0x399d5<_0x4eea7c[_0x5278('0x55')];_0x399d5++){_0x4eea7c[_0x399d5]['body']=juice(_0x4eea7c[_0x399d5][_0x5278('0x66')]);}}_0x251b4f['rows']=_0x4eea7c;return _0x251b4f;});}})['then'](respondWithFilteredResult(_0x3450c2,_0x60a9b0))[_0x5278('0x65')](handleError(_0x3450c2,null));};exports[_0x5278('0x42')]=function(_0x2fb345,_0x121e06,_0x4ce2b3){var _0x53d5d8,_0xa68cbc={},_0x12b2b9;if(_0x2fb345[_0x5278('0x66')]['to']){_0x12b2b9=_0x2fb345['body']['to'][_0x5278('0xa4')](',')[0x0];}return db['MailAccount'][_0x5278('0x64')]({'where':{'id':_0x2fb345[_0x5278('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x5278('0xa5'),'include':[{'model':db[_0x5278('0x90')],'as':_0x5278('0xa6'),'where':{'email':_0x12b2b9},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x5278('0x46')],'as':_0x5278('0x47'),'raw':!![]}]})[_0x5278('0x3d')](handleEntityNotFound(_0x121e06,null))['then'](function(_0x9c401b){if(_0x9c401b){_0x53d5d8=_0x9c401b;if(_0x9c401b[_0x5278('0x47')]){if(_[_0x5278('0x74')](_0x2fb345['body']['from'])){_0x2fb345[_0x5278('0x66')]['from']=util[_0x5278('0xa1')](_0x5278('0xa7'),_0x9c401b[_0x5278('0x41')],_0x9c401b['email']||_0x9c401b[_0x5278('0x47')]['user']);}if(_0x2fb345['body'][_0x5278('0xa8')]&&_0x2fb345[_0x5278('0x66')]['attachments'][_0x5278('0x55')]){for(var _0x357117=0x0;_0x357117<_0x2fb345[_0x5278('0x66')]['attachments'][_0x5278('0x55')];_0x357117+=0x1){_0x2fb345[_0x5278('0x66')][_0x5278('0xa8')][_0x357117]={'filename':_0x2fb345[_0x5278('0x66')][_0x5278('0xa8')][_0x357117][_0x5278('0x41')],'path':path['join'](config[_0x5278('0xa9')],_0x5278('0xaa'),_0x2fb345['body'][_0x5278('0xa8')][_0x357117][_0x5278('0xab')])};}}var _0x213782={'tls':{'rejectUnauthorized':![]}};if(_[_0x5278('0x74')](_0x9c401b['Smtp']['service'])){if(_0x9c401b[_0x5278('0x47')][_0x5278('0x7a')]){_0x213782['auth']={'user':_0x9c401b[_0x5278('0x47')][_0x5278('0x78')],'pass':_0x9c401b['Smtp']['pass']};}_0x213782[_0x5278('0x7b')]=_0x9c401b['Smtp'][_0x5278('0x7b')];_0x213782[_0x5278('0x7c')]=_0x9c401b[_0x5278('0x47')]['port'];_0x213782[_0x5278('0xac')]=_0x9c401b['Smtp'][_0x5278('0xac')];}else{_0x213782[_0x5278('0x7d')]=_0x9c401b[_0x5278('0x47')][_0x5278('0x7d')];_0x213782[_0x5278('0xad')]={'user':_0x9c401b[_0x5278('0x47')][_0x5278('0x78')],'pass':_0x9c401b['Smtp']['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x213782,'message':_0x2fb345['body']});}else{throw new Error(_0x5278('0xae'));}}})[_0x5278('0x3d')](function(_0x2e3e16){if(_0x2e3e16){_0xa68cbc=_0x2e3e16;if(_0x53d5d8['List']){if(_0x53d5d8[_0x5278('0xa5')][_0x5278('0xa6')][_0x5278('0x55')]){return _0x53d5d8[_0x5278('0xa5')][_0x5278('0xa6')][0x0];}else{return db[_0x5278('0x90')][_0x5278('0x6a')](_[_0x5278('0x1d')](_0x2fb345[_0x5278('0x66')],{'firstName':_0x2fb345[_0x5278('0x66')]['to'],'email':_0x2fb345[_0x5278('0x66')]['to'],'phone':_0x2fb345[_0x5278('0x66')]['to'],'ListId':_0x53d5d8[_0x5278('0x73')]}));}}else{throw new Error(_0x5278('0xae'));}}})[_0x5278('0x3d')](function(_0x2a69dd){if(_0x2a69dd){var _0x4cf982={'UserId':_0x2fb345['user']['id'],'ContactId':_0x2a69dd['id'],'MailAccountId':_0x53d5d8['id'],'inReplyTo':_0xa68cbc[_0x5278('0xaf')],'to':_0x2fb345[_0x5278('0x66')][_0x5278('0xb0')],'cc':_0x2fb345[_0x5278('0x66')]['cc'],'subject':_0x2fb345[_0x5278('0x66')][_0x5278('0xb1')],'attach':_0x2fb345[_0x5278('0x66')][_0x5278('0xb2')],'firstMsgDirection':_0x5278('0xb3'),'lastMsgAt':moment()[_0x5278('0xa1')](_0x5278('0xb4')),'lastMsgDirection':'out','Messages':[_[_0x5278('0x5b')](_0x2fb345[_0x5278('0x66')],{'messageId':_0xa68cbc[_0x5278('0xaf')],'sentAt':moment()[_0x5278('0xa1')](_0x5278('0xb4')),'read':!![],'MailAccountId':_0x53d5d8['id'],'UserId':_0x2fb345[_0x5278('0x78')]['id'],'ContactId':_0x2a69dd['id']})]};if(_0x2fb345[_0x5278('0x66')]['Interaction']){_0x4cf982=_[_0x5278('0x5b')](_0x4cf982,_0x2fb345[_0x5278('0x66')][_0x5278('0xb5')]);}return db['MailInteraction']['create'](_0x4cf982,{'include':[{'model':db[_0x5278('0x9f')],'as':'Messages'}]});}})[_0x5278('0x3d')](respondWithResult(_0x121e06,null))['catch'](handleError(_0x121e06,null));};exports[_0x5278('0xb6')]=function(_0x20fa10,_0x198d78,_0x1ad381){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x20fa10[_0x5278('0x62')]['id']},'include':[{'model':db[_0x5278('0x46')],'as':_0x5278('0x47'),'raw':!![]}]})[_0x5278('0x3d')](handleEntityNotFound(_0x198d78,null))[_0x5278('0x3d')](function(_0x4c5921){if(_0x4c5921&&_0x4c5921[_0x5278('0x47')]){var _0x5ae6bf={'id':_0x4c5921['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4c5921[_0x5278('0x47')][_0x5278('0x7d')]){_0x5ae6bf[_0x5278('0x7d')]=_0x4c5921[_0x5278('0x47')][_0x5278('0x7d')];}else{_0x5ae6bf[_0x5278('0x7b')]=_0x4c5921[_0x5278('0x47')][_0x5278('0x7b')];_0x5ae6bf[_0x5278('0x7c')]=_0x4c5921[_0x5278('0x47')][_0x5278('0x7c')];_0x5ae6bf[_0x5278('0xac')]=_0x4c5921['Smtp'][_0x5278('0xac')];}if(_0x4c5921[_0x5278('0x47')][_0x5278('0x7a')]){_0x5ae6bf[_0x5278('0xad')]={'user':_0x4c5921[_0x5278('0x47')][_0x5278('0x78')],'pass':_0x4c5921[_0x5278('0x47')]['pass']};}return respondWithRpcPromise(_0x5278('0xb7'),_0x5278('0xb6'),{'account':_0x5ae6bf});}})[_0x5278('0x3d')](respondWithResult(_0x198d78,null))[_0x5278('0x65')](handleError(_0x198d78,null));};exports[_0x5278('0x3c')]=function(_0x2e327e,_0x2f2e64){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x2e327e[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x2f2e64,null))[_0x5278('0x3d')](function(_0x1317df){if(_0x1317df&&_0x1317df[_0x5278('0x7d')]){throw new db['Sequelize'][(_0x5278('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1317df;})[_0x5278('0x3d')](removeEntity(_0x2f2e64,null))[_0x5278('0x65')](handleError(_0x2f2e64,null));};exports['addAgents']=function(_0x4b7871,_0x2de888,_0x548d1e){return db[_0x5278('0x4a')][_0x5278('0x64')]({'where':{'id':_0x4b7871[_0x5278('0x62')]['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x2de888,null))[_0x5278('0x3d')](function(_0x3b0bd3){if(_0x3b0bd3){return _0x3b0bd3[_0x5278('0xb9')](_0x4b7871[_0x5278('0x66')][_0x5278('0x70')],_[_0x5278('0xba')](_0x4b7871['body'],[_0x5278('0x70'),'id'])||{})[_0x5278('0xbb')](function(_0x4f1004){for(var _0x17b04a=0x0;_0x17b04a<_0x4b7871[_0x5278('0x66')]['ids'][_0x5278('0x55')];_0x17b04a+=0x1){socket[_0x5278('0xbc')](_0x5278('0xbd'),{'UserId':Number(_0x4b7871[_0x5278('0x66')]['ids'][_0x17b04a]),'MailAccountId':Number(_0x4b7871['params']['id'])});}return _0x4f1004;});}})[_0x5278('0x3d')](respondWithResult(_0x2de888,null))[_0x5278('0x65')](handleError(_0x2de888,null));};exports[_0x5278('0xbe')]=function(_0xff40c9,_0x4b7fb6,_0x30516c){return db[_0x5278('0x4a')]['find']({'where':{'id':_0xff40c9[_0x5278('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b7fb6,null))[_0x5278('0x3d')](function(_0x160dc0){if(_0x160dc0){return _0x160dc0['removeAgents'](_0xff40c9[_0x5278('0x53')][_0x5278('0x70')])[_0x5278('0x3d')](function(){if(_[_0x5278('0xbf')](_0xff40c9[_0x5278('0x53')]['ids'])){for(var _0x242c82=0x0;_0x242c82<_0xff40c9[_0x5278('0x53')]['ids'][_0x5278('0x55')];_0x242c82+=0x1){socket[_0x5278('0xbc')](_0x5278('0xc0'),{'UserId':Number(_0xff40c9['query']['ids'][_0x242c82]),'MailAccountId':Number(_0xff40c9['params']['id'])});}}else{socket[_0x5278('0xbc')](_0x5278('0xc0'),{'UserId':Number(_0xff40c9[_0x5278('0x53')][_0x5278('0x70')]),'MailAccountId':Number(_0xff40c9[_0x5278('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x4b7fb6,null))[_0x5278('0x65')](handleError(_0x4b7fb6,null));};exports[_0x5278('0xc1')]=function(_0x1611d8,_0x32804c,_0x5571ec){var _0x43a129={};var _0x1afcb9={};var _0x14a2b9;var _0x524dc4;return db[_0x5278('0x4a')][_0x5278('0x6c')]({'where':{'id':_0x1611d8['params']['id']}})[_0x5278('0x3d')](handleEntityNotFound(_0x32804c,null))[_0x5278('0x3d')](function(_0xec8e06){if(_0xec8e06){_0x14a2b9=_0xec8e06;_0x1afcb9[_0x5278('0x4f')]=_[_0x5278('0x63')](db[_0x5278('0x92')][_0x5278('0x4b')]);_0x1afcb9[_0x5278('0x53')]=_[_0x5278('0x63')](_0x1611d8[_0x5278('0x53')]);_0x1afcb9[_0x5278('0x50')]=_[_0x5278('0x51')](_0x1afcb9[_0x5278('0x4f')],_0x1afcb9['query']);_0x43a129[_0x5278('0x54')]=_[_0x5278('0x51')](_0x1afcb9['model'],qs[_0x5278('0x52')](_0x1611d8[_0x5278('0x53')][_0x5278('0x52')]));_0x43a129['attributes']=_0x43a129[_0x5278('0x54')]['length']?_0x43a129[_0x5278('0x54')]:_0x1afcb9[_0x5278('0x4f')];_0x43a129[_0x5278('0x6d')]=qs[_0x5278('0x58')](_0x1611d8[_0x5278('0x53')][_0x5278('0x58')]);_0x43a129[_0x5278('0x59')]=qs['filters'](_[_0x5278('0x6e')](_0x1611d8['query'],_0x1afcb9[_0x5278('0x50')]));if(_0x1611d8['query'][_0x5278('0x5a')]){_0x43a129[_0x5278('0x59')]=_[_0x5278('0x5b')](_0x43a129[_0x5278('0x59')],{'$or':_[_0x5278('0x5c')](_0x43a129[_0x5278('0x54')],function(_0x5e5071){var _0x27e5ff={};_0x27e5ff[_0x5e5071]={'$like':'%'+_0x1611d8[_0x5278('0x53')][_0x5278('0x5a')]+'%'};return _0x27e5ff;})});}_0x43a129=_[_0x5278('0x5b')]({},_0x43a129,_0x1611d8[_0x5278('0x5e')]);return _0x14a2b9[_0x5278('0xc1')](_0x43a129);}})['then'](function(_0x58bfae){if(_0x58bfae){_0x524dc4=_0x58bfae['length'];if(!_0x1611d8[_0x5278('0x53')][_0x5278('0x56')](_0x5278('0x57'))){_0x43a129[_0x5278('0x36')]=qs[_0x5278('0x36')](_0x1611d8[_0x5278('0x53')]['limit']);_0x43a129[_0x5278('0x35')]=qs['offset'](_0x1611d8[_0x5278('0x53')][_0x5278('0x35')]);}return _0x14a2b9[_0x5278('0xc1')](_0x43a129);}})[_0x5278('0x3d')](function(_0x4aef88){if(_0x4aef88){return _0x4aef88?{'count':_0x524dc4,'rows':_0x4aef88}:null;}})[_0x5278('0x3d')](respondWithResult(_0x32804c,null))[_0x5278('0x65')](handleError(_0x32804c,null));}; \ No newline at end of file +var _0xf2d0=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','MailAccount','includeAll','include','findAll','rows','catch','show','params','find','body','describe','addDisposition','getDispositions','Disposition','removeDispositions','ids','MailAccountId','CannedAnswer','create','getAnswers','findOne','removeAnswers','ListId','isNil','active','cservice','cauthentication','user','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','color','tag','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','destroy','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','out','Messages','verifySmtp','VerifySmtp','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','juice','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','get','MailAccounts','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection'];(function(_0x5e82fc,_0x238ce8){var _0x10ba5c=function(_0x11b4ec){while(--_0x11b4ec){_0x5e82fc['push'](_0x5e82fc['shift']());}};_0x10ba5c(++_0x238ce8);}(_0xf2d0,0x137));var _0x0f2d=function(_0x57a9bc,_0x94124a){_0x57a9bc=_0x57a9bc-0x0;var _0x14cfc5=_0xf2d0[_0x57a9bc];return _0x14cfc5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f2d('0x0'));var zipdir=require(_0x0f2d('0x1'));var jsonpatch=require(_0x0f2d('0x2'));var rp=require(_0x0f2d('0x3'));var moment=require(_0x0f2d('0x4'));var BPromise=require(_0x0f2d('0x5'));var Mustache=require(_0x0f2d('0x6'));var util=require(_0x0f2d('0x7'));var path=require(_0x0f2d('0x8'));var sox=require('sox');var csv=require(_0x0f2d('0x9'));var ejs=require(_0x0f2d('0xa'));var fs=require('fs');var fs_extra=require(_0x0f2d('0xb'));var _=require(_0x0f2d('0xc'));var squel=require(_0x0f2d('0xd'));var crypto=require(_0x0f2d('0xe'));var jsforce=require(_0x0f2d('0xf'));var deskjs=require(_0x0f2d('0x10'));var toCsv=require(_0x0f2d('0x9'));var querystring=require('querystring');var Papa=require(_0x0f2d('0x11'));var htmlToText=require(_0x0f2d('0x12'));var juice=require(_0x0f2d('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f2d('0x14'));var hardwareService=require(_0x0f2d('0x15'));var logger=require(_0x0f2d('0x16'))(_0x0f2d('0x17'));var utils=require(_0x0f2d('0x18'));var config=require(_0x0f2d('0x19'));var licenseUtil=require(_0x0f2d('0x1a'));var db=require(_0x0f2d('0x1b'))['db'];config[_0x0f2d('0x1c')]=_[_0x0f2d('0x1d')](config[_0x0f2d('0x1c')],{'host':_0x0f2d('0x1e'),'port':0x18eb});var socket=require(_0x0f2d('0x1f'))(new Redis(config['redis']));require(_0x0f2d('0x20'))[_0x0f2d('0x21')](socket);var jayson=require(_0x0f2d('0x22'));var client=jayson[_0x0f2d('0x23')]['http']({'port':0x232b});function respondWithRpcPromise(_0x13e19c,_0x2aeb11,_0x6289e4,_0x5f2376){return new BPromise(function(_0x3efbaf,_0x5a8760){var _0x3b50c1=_0x5f2376||client;return _0x3b50c1[_0x0f2d('0x24')](_0x13e19c,_0x6289e4)[_0x0f2d('0x25')](function(_0x2e0ec7){logger[_0x0f2d('0x26')](_0x0f2d('0x27'),_0x2aeb11,_0x0f2d('0x28'));logger['debug'](_0x0f2d('0x29'),_0x2aeb11,_0x0f2d('0x28'),JSON[_0x0f2d('0x2a')](_0x2e0ec7));if(_0x2e0ec7['error']){if(_0x2e0ec7[_0x0f2d('0x2b')][_0x0f2d('0x2c')]===0x1f4){logger['error'](_0x0f2d('0x27'),_0x2aeb11,_0x2e0ec7[_0x0f2d('0x2b')][_0x0f2d('0x2d')]);return _0x5a8760(_0x2e0ec7[_0x0f2d('0x2b')][_0x0f2d('0x2d')]);}logger[_0x0f2d('0x2b')]('MailAccount,\x20%s,\x20%s',_0x2aeb11,_0x2e0ec7['error'][_0x0f2d('0x2d')]);return _0x3efbaf(_0x2e0ec7[_0x0f2d('0x2b')][_0x0f2d('0x2d')]);}else{logger['info'](_0x0f2d('0x27'),_0x2aeb11,'request\x20sent');_0x3efbaf(_0x2e0ec7['result'][_0x0f2d('0x2d')]);}})['catch'](function(_0x4642c6){logger[_0x0f2d('0x2b')](_0x0f2d('0x27'),_0x2aeb11,_0x4642c6);_0x5a8760(_0x4642c6);});});}function respondWithStatusCode(_0x58fa74,_0x526126){_0x526126=_0x526126||0xcc;return function(_0x54c7f8){if(_0x54c7f8){return _0x58fa74[_0x0f2d('0x2e')](_0x526126);}return _0x58fa74['status'](_0x526126)[_0x0f2d('0x2f')]();};}function respondWithResult(_0xba6027,_0x8d24ca){_0x8d24ca=_0x8d24ca||0xc8;return function(_0x5bc545){if(_0x5bc545){return _0xba6027['status'](_0x8d24ca)[_0x0f2d('0x30')](_0x5bc545);}};}function respondWithFilteredResult(_0xc7f0a6,_0x163e02){return function(_0x18b02b){if(_0x18b02b){var _0x932b24=typeof _0x163e02[_0x0f2d('0x31')]===_0x0f2d('0x32')&&typeof _0x163e02[_0x0f2d('0x33')]===_0x0f2d('0x32');var _0x416b2b=_0x18b02b['count'];var _0x5bbfd1=_0x932b24?0x0:_0x163e02[_0x0f2d('0x31')];var _0x579275=_0x932b24?_0x18b02b[_0x0f2d('0x34')]:_0x163e02[_0x0f2d('0x31')]+_0x163e02[_0x0f2d('0x33')];var _0x4c9e36;if(_0x579275>=_0x416b2b){_0x579275=_0x416b2b;_0x4c9e36=0xc8;}else{_0x4c9e36=0xce;}_0xc7f0a6[_0x0f2d('0x35')](_0x4c9e36);return _0xc7f0a6[_0x0f2d('0x36')](_0x0f2d('0x37'),_0x5bbfd1+'-'+_0x579275+'/'+_0x416b2b)[_0x0f2d('0x30')](_0x18b02b);}return null;};}function patchUpdates(_0x1e5a69){return function(_0x178263){try{jsonpatch[_0x0f2d('0x38')](_0x178263,_0x1e5a69,!![]);}catch(_0x24cbcc){return BPromise[_0x0f2d('0x39')](_0x24cbcc);}return _0x178263[_0x0f2d('0x3a')]();};}function saveUpdates(_0x4f5db9,_0x288064){return function(_0x255ebc){if(_0x255ebc){return _0x255ebc[_0x0f2d('0x3b')](_0x4f5db9)[_0x0f2d('0x25')](function(_0x27230d){return _0x27230d;});}return null;};}function removeEntity(_0x3f0d91,_0x22e679){return function(_0x4a57c1){if(_0x4a57c1){return _0x4a57c1['destroy']()[_0x0f2d('0x25')](function(){var _0x25dcb2=_0x4a57c1[_0x0f2d('0x3c')]({'plain':!![]});var _0x524158=_0x0f2d('0x3d');return db['UserProfileResource']['destroy']({'where':{'type':_0x524158,'resourceId':_0x25dcb2['id']}})[_0x0f2d('0x25')](function(){return _0x4a57c1;});})[_0x0f2d('0x25')](function(){_0x3f0d91[_0x0f2d('0x35')](0xcc)[_0x0f2d('0x2f')]();});}};}function handleEntityNotFound(_0x54c428,_0x1fcf8b){return function(_0x301b21){if(!_0x301b21){_0x54c428['sendStatus'](0x194);}return _0x301b21;};}function handleError(_0x41e73a,_0x215613){_0x215613=_0x215613||0x1f4;return function(_0x715369){logger[_0x0f2d('0x2b')](_0x715369[_0x0f2d('0x3e')]);if(_0x715369[_0x0f2d('0x3f')]){delete _0x715369[_0x0f2d('0x3f')];}_0x41e73a['status'](_0x215613)[_0x0f2d('0x40')](_0x715369);};}exports[_0x0f2d('0x41')]=function(_0x27bbd4,_0x49c68e){var _0x2e5026={'include':[{'model':db[_0x0f2d('0x42')],'as':_0x0f2d('0x43')},{'model':db[_0x0f2d('0x44')],'as':_0x0f2d('0x45')},{'model':db[_0x0f2d('0x46')],'as':_0x0f2d('0x47')}]},_0x27196c={},_0x22f8cb={'count':0x0,'rows':[]};var _0x52c422=_['map'](db['MailAccount'][_0x0f2d('0x48')],function(_0x36067c){return{'name':_0x36067c[_0x0f2d('0x49')],'type':_0x36067c[_0x0f2d('0x4a')][_0x0f2d('0x4b')]};});_0x27196c['model']=_[_0x0f2d('0x4c')](_0x52c422,_0x0f2d('0x3f'));_0x27196c['query']=_[_0x0f2d('0x4d')](_0x27bbd4[_0x0f2d('0x4e')]);_0x27196c[_0x0f2d('0x4f')]=_[_0x0f2d('0x50')](_0x27196c[_0x0f2d('0x51')],_0x27196c['query']);_0x2e5026[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x27196c[_0x0f2d('0x51')],qs[_0x0f2d('0x53')](_0x27bbd4[_0x0f2d('0x4e')][_0x0f2d('0x53')]));_0x2e5026[_0x0f2d('0x52')]=_0x2e5026[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x2e5026[_0x0f2d('0x52')]:_0x27196c[_0x0f2d('0x51')];if(!_0x27bbd4['query'][_0x0f2d('0x55')](_0x0f2d('0x56'))){_0x2e5026[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0x27bbd4[_0x0f2d('0x4e')][_0x0f2d('0x33')]);_0x2e5026[_0x0f2d('0x31')]=qs[_0x0f2d('0x31')](_0x27bbd4['query'][_0x0f2d('0x31')]);}_0x2e5026[_0x0f2d('0x57')]=qs[_0x0f2d('0x58')](_0x27bbd4[_0x0f2d('0x4e')]['sort']);_0x2e5026[_0x0f2d('0x59')]=qs[_0x0f2d('0x4f')](_[_0x0f2d('0x5a')](_0x27bbd4[_0x0f2d('0x4e')],_0x27196c[_0x0f2d('0x4f')]),_0x52c422);if(_0x27bbd4[_0x0f2d('0x4e')]['filter']){_0x2e5026[_0x0f2d('0x59')]=_[_0x0f2d('0x5b')](_0x2e5026[_0x0f2d('0x59')],{'$or':_['map'](_0x52c422,function(_0x59c5d1){if(_0x59c5d1[_0x0f2d('0x4a')]!==_0x0f2d('0x5c')){var _0x57fa02={};_0x57fa02[_0x59c5d1[_0x0f2d('0x3f')]]={'$like':'%'+_0x27bbd4[_0x0f2d('0x4e')][_0x0f2d('0x5d')]+'%'};return _0x57fa02;}})});}_0x2e5026=_[_0x0f2d('0x5b')]({},_0x2e5026,_0x27bbd4[_0x0f2d('0x5e')]);var _0x10d694={'where':_0x2e5026[_0x0f2d('0x59')]};return db[_0x0f2d('0x5f')][_0x0f2d('0x34')](_0x10d694)[_0x0f2d('0x25')](function(_0x201ef6){_0x22f8cb[_0x0f2d('0x34')]=_0x201ef6;if(_0x27bbd4[_0x0f2d('0x4e')][_0x0f2d('0x60')]){_0x2e5026[_0x0f2d('0x61')]=[{'all':!![]}];}return db['MailAccount'][_0x0f2d('0x62')](_0x2e5026);})['then'](function(_0x13c9e2){_0x22f8cb[_0x0f2d('0x63')]=_0x13c9e2;return _0x22f8cb;})[_0x0f2d('0x25')](respondWithFilteredResult(_0x49c68e,_0x2e5026))[_0x0f2d('0x64')](handleError(_0x49c68e,null));};exports[_0x0f2d('0x65')]=function(_0x553e72,_0x88de4d){var _0x375f37={'raw':![],'where':{'id':_0x553e72[_0x0f2d('0x66')]['id']},'include':[{'model':db[_0x0f2d('0x42')],'as':_0x0f2d('0x43')},{'model':db['MailServerOut'],'as':_0x0f2d('0x45')},{'model':db[_0x0f2d('0x46')],'as':'mandatoryDispositionPause'}]},_0x40c491={};_0x40c491[_0x0f2d('0x51')]=_[_0x0f2d('0x4d')](db[_0x0f2d('0x5f')]['rawAttributes']);_0x40c491[_0x0f2d('0x4e')]=_['keys'](_0x553e72[_0x0f2d('0x4e')]);_0x40c491['filters']=_[_0x0f2d('0x50')](_0x40c491['model'],_0x40c491['query']);_0x375f37[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x40c491['model'],qs[_0x0f2d('0x53')](_0x553e72[_0x0f2d('0x4e')][_0x0f2d('0x53')]));_0x375f37['attributes']=_0x375f37[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x375f37['attributes']:_0x40c491[_0x0f2d('0x51')];if(_0x553e72[_0x0f2d('0x4e')]['includeAll']){_0x375f37[_0x0f2d('0x61')]=[{'all':!![]}];}_0x375f37=_[_0x0f2d('0x5b')]({},_0x375f37,_0x553e72[_0x0f2d('0x5e')]);return db[_0x0f2d('0x5f')][_0x0f2d('0x67')](_0x375f37)[_0x0f2d('0x25')](handleEntityNotFound(_0x88de4d,null))[_0x0f2d('0x25')](respondWithResult(_0x88de4d,null))[_0x0f2d('0x64')](handleError(_0x88de4d,null));};exports['update']=function(_0x30612d,_0x5aba49){if(_0x30612d['body']['id']){delete _0x30612d[_0x0f2d('0x68')]['id'];}return db[_0x0f2d('0x5f')]['find']({'where':{'id':_0x30612d[_0x0f2d('0x66')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x0f2d('0x46')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5aba49,null))[_0x0f2d('0x25')](saveUpdates(_0x30612d[_0x0f2d('0x68')],null))['then'](function(_0x113dff){if(_0x113dff&&_0x30612d[_0x0f2d('0x68')]['Imap']){return db[_0x0f2d('0x42')][_0x0f2d('0x3b')](_0x30612d[_0x0f2d('0x68')][_0x0f2d('0x43')],{'where':{'MailAccountId':_0x113dff['id']}})[_0x0f2d('0x25')](function(){return _0x113dff;});}return _0x113dff;})[_0x0f2d('0x25')](function(_0x27c1de){if(_0x27c1de&&_0x30612d[_0x0f2d('0x68')][_0x0f2d('0x45')]){return db[_0x0f2d('0x44')]['update'](_0x30612d[_0x0f2d('0x68')][_0x0f2d('0x45')],{'where':{'MailAccountId':_0x27c1de['id']}})[_0x0f2d('0x25')](function(){return _0x27c1de;});}return _0x27c1de;})[_0x0f2d('0x25')](respondWithResult(_0x5aba49,null))[_0x0f2d('0x64')](handleError(_0x5aba49,null));};exports[_0x0f2d('0x69')]=function(_0x9817f4,_0x1c9d27){return db[_0x0f2d('0x5f')]['describe']()[_0x0f2d('0x25')](respondWithResult(_0x1c9d27,null))[_0x0f2d('0x64')](handleError(_0x1c9d27,null));};exports[_0x0f2d('0x6a')]=function(_0x32be63,_0x5f809a,_0x364b25){if(_0x32be63[_0x0f2d('0x68')]['id']){delete _0x32be63['body']['id'];}return db[_0x0f2d('0x5f')][_0x0f2d('0x67')]({'where':{'id':_0x32be63[_0x0f2d('0x66')]['id']}})['then'](handleEntityNotFound(_0x5f809a,null))[_0x0f2d('0x25')](function(_0x17124d){if(_0x17124d){_0x32be63[_0x0f2d('0x68')]['MailAccountId']=_0x17124d['id'];return db['Disposition']['create'](_0x32be63[_0x0f2d('0x68')]);}})['then'](respondWithResult(_0x5f809a,null))[_0x0f2d('0x64')](handleError(_0x5f809a,null));};exports[_0x0f2d('0x6b')]=function(_0x34d3cf,_0x35eb6a,_0x563cb9){var _0x310601={'raw':![],'where':{}};var _0x340567={};var _0x4b2d93={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x34d3cf[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x35eb6a,null))['then'](function(_0xcd76ad){if(_0xcd76ad){_0x340567[_0x0f2d('0x51')]=_[_0x0f2d('0x4d')](db[_0x0f2d('0x6c')][_0x0f2d('0x48')]);_0x340567[_0x0f2d('0x4e')]=_[_0x0f2d('0x4d')](_0x34d3cf['query']);_0x340567[_0x0f2d('0x4f')]=_['intersection'](_0x340567[_0x0f2d('0x51')],_0x340567[_0x0f2d('0x4e')]);_0x310601[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x340567['model'],qs['fields'](_0x34d3cf[_0x0f2d('0x4e')][_0x0f2d('0x53')]));_0x310601[_0x0f2d('0x52')]=_0x310601['attributes']['length']?_0x310601[_0x0f2d('0x52')]:_0x340567[_0x0f2d('0x51')];if(!_0x34d3cf[_0x0f2d('0x4e')][_0x0f2d('0x55')]('nolimit')){_0x310601[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0x34d3cf['query'][_0x0f2d('0x33')]);_0x310601[_0x0f2d('0x31')]=qs[_0x0f2d('0x31')](_0x34d3cf[_0x0f2d('0x4e')]['offset']);}_0x310601['order']=qs[_0x0f2d('0x58')](_0x34d3cf[_0x0f2d('0x4e')][_0x0f2d('0x58')]);_0x310601[_0x0f2d('0x59')]=qs[_0x0f2d('0x4f')](_[_0x0f2d('0x5a')](_0x34d3cf[_0x0f2d('0x4e')],_0x340567['filters']));_0x310601[_0x0f2d('0x59')]['MailAccountId']=_0xcd76ad['id'];if(_0x34d3cf[_0x0f2d('0x4e')][_0x0f2d('0x5d')]){_0x310601[_0x0f2d('0x59')]=_[_0x0f2d('0x5b')](_0x310601[_0x0f2d('0x59')],{'$or':_['map'](_0x310601[_0x0f2d('0x52')],function(_0x2b48fe){var _0x3cb5dd={};_0x3cb5dd[_0x2b48fe]={'$like':'%'+_0x34d3cf[_0x0f2d('0x4e')][_0x0f2d('0x5d')]+'%'};return _0x3cb5dd;})});}_0x310601=_[_0x0f2d('0x5b')]({},_0x310601,_0x34d3cf[_0x0f2d('0x5e')]);return db[_0x0f2d('0x6c')]['count']({'where':_0x310601[_0x0f2d('0x59')]})[_0x0f2d('0x25')](function(_0x6b59f6){_0x4b2d93[_0x0f2d('0x34')]=_0x6b59f6;if(_0x34d3cf['query'][_0x0f2d('0x60')]){_0x310601[_0x0f2d('0x61')]=[{'all':!![]}];}return db[_0x0f2d('0x6c')]['findAll'](_0x310601);})[_0x0f2d('0x25')](function(_0x506b94){_0x4b2d93[_0x0f2d('0x63')]=_0x506b94;return _0x4b2d93;});}})[_0x0f2d('0x25')](respondWithFilteredResult(_0x35eb6a,_0x310601))[_0x0f2d('0x64')](handleError(_0x35eb6a,null));};exports[_0x0f2d('0x6d')]=function(_0x4d05ac,_0x4d8e35,_0x142439){return db[_0x0f2d('0x5f')][_0x0f2d('0x67')]({'where':{'id':_0x4d05ac[_0x0f2d('0x66')]['id']}})['then'](handleEntityNotFound(_0x4d8e35,null))['then'](function(_0x57f4b0){if(_0x57f4b0){return _0x57f4b0[_0x0f2d('0x6d')](_0x4d05ac[_0x0f2d('0x4e')][_0x0f2d('0x6e')]);}})['then'](respondWithStatusCode(_0x4d8e35,null))[_0x0f2d('0x64')](handleError(_0x4d8e35,null));};exports['addAnswer']=function(_0x33b2d3,_0x449753,_0x254129){if(_0x33b2d3[_0x0f2d('0x68')]['id']){delete _0x33b2d3[_0x0f2d('0x68')]['id'];}return db[_0x0f2d('0x5f')][_0x0f2d('0x67')]({'where':{'id':_0x33b2d3[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x449753,null))[_0x0f2d('0x25')](function(_0x168bc7){if(_0x168bc7){_0x33b2d3[_0x0f2d('0x68')][_0x0f2d('0x6f')]=_0x168bc7['id'];return db[_0x0f2d('0x70')][_0x0f2d('0x71')](_0x33b2d3[_0x0f2d('0x68')]);}})['then'](respondWithResult(_0x449753,null))[_0x0f2d('0x64')](handleError(_0x449753,null));};exports[_0x0f2d('0x72')]=function(_0xbe1079,_0x12c00c,_0x1885d8){var _0x2c7af6={'raw':![],'where':{}};var _0x2ac60c={};var _0x29d3c6={'count':0x0,'rows':[]};return db[_0x0f2d('0x5f')][_0x0f2d('0x73')]({'where':{'id':_0xbe1079['params']['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x12c00c,null))[_0x0f2d('0x25')](function(_0x2772af){if(_0x2772af){_0x2ac60c[_0x0f2d('0x51')]=_[_0x0f2d('0x4d')](db[_0x0f2d('0x70')][_0x0f2d('0x48')]);_0x2ac60c[_0x0f2d('0x4e')]=_[_0x0f2d('0x4d')](_0xbe1079[_0x0f2d('0x4e')]);_0x2ac60c[_0x0f2d('0x4f')]=_['intersection'](_0x2ac60c[_0x0f2d('0x51')],_0x2ac60c[_0x0f2d('0x4e')]);_0x2c7af6[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x2ac60c[_0x0f2d('0x51')],qs[_0x0f2d('0x53')](_0xbe1079[_0x0f2d('0x4e')][_0x0f2d('0x53')]));_0x2c7af6[_0x0f2d('0x52')]=_0x2c7af6[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x2c7af6[_0x0f2d('0x52')]:_0x2ac60c[_0x0f2d('0x51')];if(!_0xbe1079[_0x0f2d('0x4e')][_0x0f2d('0x55')](_0x0f2d('0x56'))){_0x2c7af6[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0xbe1079['query'][_0x0f2d('0x33')]);_0x2c7af6[_0x0f2d('0x31')]=qs[_0x0f2d('0x31')](_0xbe1079[_0x0f2d('0x4e')]['offset']);}_0x2c7af6['order']=qs['sort'](_0xbe1079[_0x0f2d('0x4e')][_0x0f2d('0x58')]);_0x2c7af6[_0x0f2d('0x59')]=qs[_0x0f2d('0x4f')](_[_0x0f2d('0x5a')](_0xbe1079['query'],_0x2ac60c[_0x0f2d('0x4f')]));_0x2c7af6[_0x0f2d('0x59')][_0x0f2d('0x6f')]=_0x2772af['id'];if(_0xbe1079[_0x0f2d('0x4e')][_0x0f2d('0x5d')]){_0x2c7af6['where']=_[_0x0f2d('0x5b')](_0x2c7af6[_0x0f2d('0x59')],{'$or':_[_0x0f2d('0x4c')](_0x2c7af6['attributes'],function(_0x26e976){var _0x2e19f6={};_0x2e19f6[_0x26e976]={'$like':'%'+_0xbe1079[_0x0f2d('0x4e')][_0x0f2d('0x5d')]+'%'};return _0x2e19f6;})});}_0x2c7af6=_[_0x0f2d('0x5b')]({},_0x2c7af6,_0xbe1079['options']);return db[_0x0f2d('0x70')][_0x0f2d('0x34')]({'where':_0x2c7af6[_0x0f2d('0x59')]})[_0x0f2d('0x25')](function(_0x138d8f){_0x29d3c6['count']=_0x138d8f;if(_0xbe1079['query'][_0x0f2d('0x60')]){_0x2c7af6['include']=[{'all':!![]}];}return db[_0x0f2d('0x70')][_0x0f2d('0x62')](_0x2c7af6);})[_0x0f2d('0x25')](function(_0x526bd7){_0x29d3c6[_0x0f2d('0x63')]=_0x526bd7;return _0x29d3c6;});}})[_0x0f2d('0x25')](respondWithFilteredResult(_0x12c00c,_0x2c7af6))[_0x0f2d('0x64')](handleError(_0x12c00c,null));};exports['removeAnswers']=function(_0x14c413,_0x419cea,_0x4c84bf){return db[_0x0f2d('0x5f')]['find']({'where':{'id':_0x14c413[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x419cea,null))[_0x0f2d('0x25')](function(_0x2688e6){if(_0x2688e6){return _0x2688e6[_0x0f2d('0x74')](_0x14c413['query'][_0x0f2d('0x6e')]);}})[_0x0f2d('0x25')](respondWithStatusCode(_0x419cea,null))[_0x0f2d('0x64')](handleError(_0x419cea,null));};exports[_0x0f2d('0x71')]=function(_0x3626f0,_0x62ad11){var _0x238bae={'name':_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x3f')],'key':_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x4b')],'email':_0x3626f0[_0x0f2d('0x68')]['email'],'ListId':_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x75')],'active':!_[_0x0f2d('0x76')](_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x77')])?_0x3626f0['body']['active']:!![],'description':_0x3626f0['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x0f2d('0x76')](_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x78')])){if(_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x79')]){_0x238bae[_0x0f2d('0x43')][_0x0f2d('0x7a')]=_0x238bae[_0x0f2d('0x45')]['user']=_0x3626f0[_0x0f2d('0x68')]['cuser'];_0x238bae['Imap']['password']=_0x238bae[_0x0f2d('0x45')][_0x0f2d('0x7b')]=_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x7c')];}else{_0x238bae[_0x0f2d('0x43')][_0x0f2d('0x7d')]=_0x238bae[_0x0f2d('0x45')]['authentication']=![];}_0x238bae[_0x0f2d('0x43')][_0x0f2d('0x7e')]=_0x3626f0['body'][_0x0f2d('0x43')][_0x0f2d('0x7e')];_0x238bae['Imap'][_0x0f2d('0x7f')]=_0x3626f0['body'][_0x0f2d('0x43')]['port'];_0x238bae[_0x0f2d('0x45')]['host']=_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x45')]['host'];_0x238bae[_0x0f2d('0x45')]['port']=_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x45')][_0x0f2d('0x7f')];}else{_0x238bae[_0x0f2d('0x43')][_0x0f2d('0x80')]=_0x238bae[_0x0f2d('0x45')][_0x0f2d('0x80')]=_0x3626f0['body'][_0x0f2d('0x78')];_0x238bae['Imap'][_0x0f2d('0x7a')]=_0x238bae[_0x0f2d('0x45')][_0x0f2d('0x7a')]=_0x3626f0[_0x0f2d('0x68')]['cuser'];_0x238bae[_0x0f2d('0x43')][_0x0f2d('0x81')]=_0x238bae['Smtp'][_0x0f2d('0x7b')]=_0x3626f0[_0x0f2d('0x68')][_0x0f2d('0x7c')];}return db[_0x0f2d('0x5f')][_0x0f2d('0x71')](_0x238bae,{'include':[{'model':db[_0x0f2d('0x44')],'as':_0x0f2d('0x45')},{'model':db[_0x0f2d('0x42')],'as':_0x0f2d('0x43')}]})[_0x0f2d('0x25')](function(_0x15406e){var _0xf9c18e=_0x3626f0[_0x0f2d('0x7a')]['get']({'plain':!![]});if(!_0xf9c18e)throw new Error(_0x0f2d('0x82'));if(_0xf9c18e[_0x0f2d('0x83')]===_0x0f2d('0x7a')){var _0xf63ed4=_0x15406e[_0x0f2d('0x3c')]({'plain':!![]});return db[_0x0f2d('0x84')][_0x0f2d('0x67')]({'where':{'name':_0x0f2d('0x3d'),'userProfileId':_0xf9c18e[_0x0f2d('0x85')]},'raw':!![]})[_0x0f2d('0x25')](function(_0x79d3bc){if(_0x79d3bc&&_0x79d3bc[_0x0f2d('0x86')]===0x0){return db['UserProfileResource'][_0x0f2d('0x71')]({'name':_0xf63ed4[_0x0f2d('0x3f')],'resourceId':_0xf63ed4['id'],'type':_0x79d3bc[_0x0f2d('0x3f')],'sectionId':_0x79d3bc['id']},{})[_0x0f2d('0x25')](function(){return _0x15406e;});}else{return _0x15406e;}})['catch'](function(_0x4cadf0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cadf0);throw _0x4cadf0;});}return _0x15406e;})['then'](respondWithResult(_0x62ad11,0xc9))[_0x0f2d('0x64')](handleError(_0x62ad11,null));};exports[_0x0f2d('0x87')]=function(_0x45b002,_0x4a8122,_0x2ca705){return db['MailAccount']['findOne']({'where':{'id':_0x45b002['params']['id']}})['then'](handleEntityNotFound(_0x4a8122,null))[_0x0f2d('0x25')](function(_0xdf55ea){if(_0xdf55ea){return _0xdf55ea['getImap']();}return null;})[_0x0f2d('0x25')](respondWithResult(_0x4a8122,null))[_0x0f2d('0x64')](handleError(_0x4a8122,null));};exports[_0x0f2d('0x88')]=function(_0x103c39,_0x654eb0,_0x7079ae){if(_0x103c39[_0x0f2d('0x68')]['id']){delete _0x103c39[_0x0f2d('0x68')]['id'];}return db[_0x0f2d('0x5f')]['find']({'where':{'id':_0x103c39[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x654eb0,null))[_0x0f2d('0x25')](function(_0x2cc77a){if(_0x2cc77a){_0x103c39[_0x0f2d('0x68')]['MailAccountId']=_0x2cc77a['id'];return db[_0x0f2d('0x42')][_0x0f2d('0x71')](_0x103c39[_0x0f2d('0x68')]);}})['then'](respondWithResult(_0x654eb0,null))['catch'](handleError(_0x654eb0,null));};exports[_0x0f2d('0x89')]=function(_0x206750,_0x1523cd,_0x5503e7){return db['MailAccount'][_0x0f2d('0x73')]({'where':{'id':_0x206750[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x1523cd,null))[_0x0f2d('0x25')](function(_0x54d541){if(_0x54d541){return _0x54d541['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x1523cd,null))[_0x0f2d('0x64')](handleError(_0x1523cd,null));};exports['getSmtp']=function(_0x2fd463,_0x52848a,_0x49b99e){return db['MailAccount'][_0x0f2d('0x73')]({'where':{'id':_0x2fd463['params']['id']}})['then'](handleEntityNotFound(_0x52848a,null))[_0x0f2d('0x25')](function(_0x3dc9e1){if(_0x3dc9e1){return _0x3dc9e1[_0x0f2d('0x8a')]();}return null;})[_0x0f2d('0x25')](respondWithResult(_0x52848a,null))[_0x0f2d('0x64')](handleError(_0x52848a,null));};exports[_0x0f2d('0x8b')]=function(_0x1b96b5,_0x342e50,_0x26a7b0){if(_0x1b96b5[_0x0f2d('0x68')]['id']){delete _0x1b96b5['body']['id'];}return db[_0x0f2d('0x5f')][_0x0f2d('0x67')]({'where':{'id':_0x1b96b5[_0x0f2d('0x66')]['id']}})['then'](handleEntityNotFound(_0x342e50,null))[_0x0f2d('0x25')](function(_0xf1b0d8){if(_0xf1b0d8){_0x1b96b5[_0x0f2d('0x68')][_0x0f2d('0x6f')]=_0xf1b0d8['id'];return db[_0x0f2d('0x44')][_0x0f2d('0x71')](_0x1b96b5[_0x0f2d('0x68')]);}})[_0x0f2d('0x25')](respondWithResult(_0x342e50,null))[_0x0f2d('0x64')](handleError(_0x342e50,null));};exports[_0x0f2d('0x8c')]=function(_0x36dc39,_0x40636d,_0x3ec844){return db[_0x0f2d('0x5f')][_0x0f2d('0x73')]({'where':{'id':_0x36dc39['params']['id']}})['then'](handleEntityNotFound(_0x40636d,null))[_0x0f2d('0x25')](function(_0x30629a){if(_0x30629a){return _0x30629a['setSmtp'](null);}return null;})[_0x0f2d('0x25')](respondWithStatusCode(_0x40636d,null))[_0x0f2d('0x64')](handleError(_0x40636d,null));};exports['addInteraction']=function(_0x316be4,_0xa5e342,_0x484a8b){return db[_0x0f2d('0x8d')]['find']({'where':{'id':_0x316be4[_0x0f2d('0x66')]['id']}})['then'](handleEntityNotFound(_0xa5e342,null))[_0x0f2d('0x25')](function(_0x17b1ce){if(_0x17b1ce){return _0x17b1ce[_0x0f2d('0x8e')](_0x316be4[_0x0f2d('0x68')][_0x0f2d('0x6e')],_[_0x0f2d('0x8f')](_0x316be4[_0x0f2d('0x68')],['ids','id'])||{});}})[_0x0f2d('0x25')](respondWithResult(_0xa5e342,null))[_0x0f2d('0x64')](handleError(_0xa5e342,null));};exports[_0x0f2d('0x90')]=function(_0x96ef7e,_0x5232c9,_0x30e98d){var _0x1bb914={'raw':![],'where':{}};var _0x54d102={};var _0x5de5ae={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x96ef7e[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x5232c9,null))[_0x0f2d('0x25')](function(_0xd26737){if(_0xd26737){_0x54d102['model']=_['keys'](db[_0x0f2d('0x8d')][_0x0f2d('0x48')]);_0x54d102[_0x0f2d('0x4e')]=_[_0x0f2d('0x4d')](_0x96ef7e[_0x0f2d('0x4e')]);_0x54d102[_0x0f2d('0x4f')]=_['intersection'](_0x54d102[_0x0f2d('0x51')],_0x54d102[_0x0f2d('0x4e')]);_0x1bb914[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x54d102[_0x0f2d('0x51')],qs['fields'](_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x53')]));_0x1bb914[_0x0f2d('0x52')]=_0x1bb914[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x1bb914['attributes']:_0x54d102[_0x0f2d('0x51')];if(!_0x96ef7e[_0x0f2d('0x4e')]['hasOwnProperty'](_0x0f2d('0x56'))){_0x1bb914[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x33')]);_0x1bb914['offset']=qs[_0x0f2d('0x31')](_0x96ef7e['query'][_0x0f2d('0x31')]);}_0x1bb914[_0x0f2d('0x57')]=qs['sort'](_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x58')]);_0x1bb914[_0x0f2d('0x59')]=qs[_0x0f2d('0x4f')](_[_0x0f2d('0x5a')](_0x96ef7e['query'],_0x54d102[_0x0f2d('0x4f')]));_0x1bb914[_0x0f2d('0x59')][_0x0f2d('0x6f')]=_0xd26737['id'];if(_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x5d')]){_0x1bb914['where']=_[_0x0f2d('0x5b')](_0x1bb914[_0x0f2d('0x59')],{'$or':_['map'](_0x1bb914['attributes'],function(_0x31463f){var _0x139863={};_0x139863[_0x31463f]={'$like':'%'+_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x5d')]+'%'};return _0x139863;})});}_0x1bb914=_['merge']({},_0x1bb914,_0x96ef7e[_0x0f2d('0x5e')]);return db[_0x0f2d('0x8d')][_0x0f2d('0x34')]({'where':_0x1bb914[_0x0f2d('0x59')]})[_0x0f2d('0x25')](function(_0x467ef0){_0x5de5ae[_0x0f2d('0x34')]=_0x467ef0;if(_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x60')]){_0x1bb914[_0x0f2d('0x61')]=[{'model':db[_0x0f2d('0x91')],'as':_0x0f2d('0x92'),'required':![]},{'model':db[_0x0f2d('0x93')],'as':'Owner','attributes':[_0x0f2d('0x3f'),_0x0f2d('0x94'),_0x0f2d('0x95')],'required':![]},{'model':db[_0x0f2d('0x96')],'as':'Tags','attributes':['id','name',_0x0f2d('0x97')],'where':_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x98')]?{'id':_0x96ef7e[_0x0f2d('0x4e')]['tag']}:undefined,'required':_0x96ef7e[_0x0f2d('0x4e')][_0x0f2d('0x98')]?!![]:![]}];}return db[_0x0f2d('0x8d')][_0x0f2d('0x62')](_0x1bb914);})[_0x0f2d('0x25')](function(_0x1c6eec){_0x5de5ae['rows']=_0x1c6eec;return _0x5de5ae;});}})[_0x0f2d('0x25')](respondWithFilteredResult(_0x5232c9,_0x1bb914))[_0x0f2d('0x64')](handleError(_0x5232c9,null));};exports['addApplications']=function addApplications(_0x59b732,_0x13e310){var _0x41016c=_0x59b732[_0x0f2d('0x66')]['id'];var _0x2637ae=_0x59b732[_0x0f2d('0x68')];var _0x433f1d=0xc8;var _0x4afa4c=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0f2d('0x99')][_0x0f2d('0x9a')][_0x0f2d('0x9b')]['READ_COMMITTED']},function(_0x4ec00e){return db[_0x0f2d('0x5f')][_0x0f2d('0x73')]({'where':{'id':_0x41016c},'transaction':_0x4ec00e})[_0x0f2d('0x25')](function(_0x4d8a2b){if(_0x4d8a2b){return db[_0x0f2d('0x9c')][_0x0f2d('0x9d')]({'where':{'MailAccountId':_0x41016c},'transaction':_0x4ec00e})[_0x0f2d('0x25')](function(){var _0x7d8388=_[_0x0f2d('0x4c')](_0x2637ae,function(_0x3ca888){_0x3ca888['MailAccountId']=_0x41016c;return _0x3ca888;});return db['MailApplication'][_0x0f2d('0x9e')](_0x7d8388,{'transaction':_0x4ec00e});});}else{_0x433f1d=0x194;_0x4afa4c=[];}});})[_0x0f2d('0x25')](function(){if(_0x433f1d!==0x194){return db[_0x0f2d('0x9c')][_0x0f2d('0x9f')]({'where':{'MailAccountId':_0x41016c},'order':_0x0f2d('0xa0')})[_0x0f2d('0x25')](function(_0x5a53db){_0x4afa4c=_0x5a53db;});}})[_0x0f2d('0x64')](function(_0x3aa9d9){_0x433f1d=0x1f4;logger['error'](_0x3aa9d9[_0x0f2d('0x3e')]);if(_0x3aa9d9[_0x0f2d('0x3f')]){delete _0x3aa9d9[_0x0f2d('0x3f')];}_0x4afa4c=_0x3aa9d9;})['finally'](function(){if(_0x4afa4c===null){_0x13e310[_0x0f2d('0x2e')](_0x433f1d);}else{if(_0x433f1d===0x1f4){_0x13e310[_0x0f2d('0x35')](_0x433f1d)[_0x0f2d('0x40')](_0x4afa4c);}else{_0x13e310[_0x0f2d('0x35')](_0x433f1d)[_0x0f2d('0x30')](_0x4afa4c);}}});};exports['getApplications']=function(_0x30c345,_0x5f2b1d,_0x3c5ab9){var _0x26f21f={};var _0x5118c4={};var _0x5bb25f;var _0x36751c;return db['MailAccount'][_0x0f2d('0x73')]({'where':{'id':_0x30c345[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x5f2b1d,null))['then'](function(_0x441b32){if(_0x441b32){_0x5bb25f=_0x441b32;_0x5118c4[_0x0f2d('0x51')]=_[_0x0f2d('0x4d')](db[_0x0f2d('0x9c')]['rawAttributes']);_0x5118c4[_0x0f2d('0x4e')]=_[_0x0f2d('0x4d')](_0x30c345[_0x0f2d('0x4e')]);_0x5118c4[_0x0f2d('0x4f')]=_[_0x0f2d('0x50')](_0x5118c4[_0x0f2d('0x51')],_0x5118c4['query']);_0x26f21f[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x5118c4[_0x0f2d('0x51')],qs[_0x0f2d('0x53')](_0x30c345[_0x0f2d('0x4e')][_0x0f2d('0x53')]));_0x26f21f[_0x0f2d('0x52')]=_0x26f21f[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x26f21f['attributes']:_0x5118c4[_0x0f2d('0x51')];_0x26f21f[_0x0f2d('0x57')]=qs[_0x0f2d('0x58')](_0x30c345[_0x0f2d('0x4e')][_0x0f2d('0x58')]);_0x26f21f[_0x0f2d('0x59')]=qs['filters'](_[_0x0f2d('0x5a')](_0x30c345[_0x0f2d('0x4e')],_0x5118c4[_0x0f2d('0x4f')]));if(_0x30c345[_0x0f2d('0x4e')][_0x0f2d('0x5d')]){_0x26f21f[_0x0f2d('0x59')]=_[_0x0f2d('0x5b')](_0x26f21f[_0x0f2d('0x59')],{'$or':_[_0x0f2d('0x4c')](_0x26f21f[_0x0f2d('0x52')],function(_0x38ed77){var _0x56c52d={};_0x56c52d[_0x38ed77]={'$like':'%'+_0x30c345['query'][_0x0f2d('0x5d')]+'%'};return _0x56c52d;})});}_0x26f21f=_[_0x0f2d('0x5b')]({},_0x26f21f,_0x30c345[_0x0f2d('0x5e')]);return _0x5bb25f[_0x0f2d('0xa1')](_0x26f21f);}})[_0x0f2d('0x25')](function(_0x3d66fc){if(_0x3d66fc){_0x36751c=_0x3d66fc[_0x0f2d('0x54')];if(!_0x30c345['query']['hasOwnProperty'](_0x0f2d('0x56'))){_0x26f21f[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0x30c345[_0x0f2d('0x4e')][_0x0f2d('0x33')]);_0x26f21f[_0x0f2d('0x31')]=qs[_0x0f2d('0x31')](_0x30c345[_0x0f2d('0x4e')][_0x0f2d('0x31')]);}return _0x5bb25f[_0x0f2d('0xa1')](_0x26f21f);}})[_0x0f2d('0x25')](function(_0x2a28b7){if(_0x2a28b7){return _0x2a28b7?{'count':_0x36751c,'rows':_0x2a28b7}:null;}})[_0x0f2d('0x25')](respondWithResult(_0x5f2b1d,null))[_0x0f2d('0x64')](handleError(_0x5f2b1d,null));};exports['getMessages']=function(_0x26bc9d,_0x3c861b,_0x329d78){var _0x563a3f={'raw':!![],'where':{}};var _0x4fb22e={};var _0xa25f6f={'count':0x0,'rows':[]};return db[_0x0f2d('0x5f')][_0x0f2d('0x73')]({'where':{'id':_0x26bc9d['params']['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x3c861b,null))[_0x0f2d('0x25')](function(_0x3e71ad){if(_0x3e71ad){_0x4fb22e[_0x0f2d('0x51')]=_[_0x0f2d('0x4d')](db[_0x0f2d('0xa2')][_0x0f2d('0x48')]);_0x4fb22e['query']=_[_0x0f2d('0x4d')](_0x26bc9d['query']);_0x4fb22e[_0x0f2d('0x4f')]=_[_0x0f2d('0x50')](_0x4fb22e[_0x0f2d('0x51')],_0x4fb22e['query']);_0x563a3f[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x4fb22e[_0x0f2d('0x51')],qs['fields'](_0x26bc9d[_0x0f2d('0x4e')]['fields']));_0x563a3f[_0x0f2d('0x52')]=_0x563a3f[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x563a3f[_0x0f2d('0x52')]:_0x4fb22e['model'];if(!_0x26bc9d[_0x0f2d('0x4e')]['hasOwnProperty'](_0x0f2d('0x56'))){_0x563a3f[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0x26bc9d[_0x0f2d('0x4e')]['limit']);_0x563a3f['offset']=qs[_0x0f2d('0x31')](_0x26bc9d[_0x0f2d('0x4e')]['offset']);}_0x563a3f[_0x0f2d('0x57')]=qs[_0x0f2d('0x58')](_0x26bc9d[_0x0f2d('0x4e')]['sort']);_0x563a3f[_0x0f2d('0x59')]=qs[_0x0f2d('0x4f')](_[_0x0f2d('0x5a')](_0x26bc9d[_0x0f2d('0x4e')],_0x4fb22e[_0x0f2d('0x4f')]));_0x563a3f[_0x0f2d('0x59')][_0x0f2d('0x6f')]=_0x3e71ad['id'];if(_0x26bc9d[_0x0f2d('0x4e')][_0x0f2d('0x5d')]){_0x563a3f[_0x0f2d('0x59')]=_['merge'](_0x563a3f[_0x0f2d('0x59')],{'$or':_[_0x0f2d('0x4c')](_0x563a3f[_0x0f2d('0x52')],function(_0x2bae44){var _0x43c1f3={};_0x43c1f3[_0x2bae44]={'$like':'%'+_0x26bc9d['query']['filter']+'%'};return _0x43c1f3;})});}if(_0x26bc9d['query'][_0x0f2d('0xa3')]){var _0x4f144a=_0x26bc9d[_0x0f2d('0x4e')]['$gte'][_0x0f2d('0xa4')](',');var _0x4e4615={};_0x4e4615[_0x4f144a[0x0]]={'$gte':moment(_0x4f144a[0x1])[_0x0f2d('0xa5')](_0x0f2d('0xa6'))};_0x563a3f[_0x0f2d('0x59')]=_['merge'](_0x563a3f[_0x0f2d('0x59')],_0x4e4615);}_0x563a3f=_[_0x0f2d('0x5b')]({},_0x563a3f,_0x26bc9d[_0x0f2d('0x5e')]);return db[_0x0f2d('0xa2')][_0x0f2d('0x34')]({'where':_0x563a3f[_0x0f2d('0x59')]})[_0x0f2d('0x25')](function(_0x297e5f){_0xa25f6f[_0x0f2d('0x34')]=_0x297e5f;if(_0x26bc9d[_0x0f2d('0x4e')][_0x0f2d('0x60')]){_0x563a3f['include']=[{'all':!![]}];}return db[_0x0f2d('0xa2')][_0x0f2d('0x62')](_0x563a3f);})[_0x0f2d('0x25')](function(_0x51de0f){if(_0x26bc9d[_0x0f2d('0x4e')][_0x0f2d('0xa7')]==='true'){for(var _0x2a4a3d=0x0;_0x2a4a3d<_0x51de0f[_0x0f2d('0x54')];_0x2a4a3d++){_0x51de0f[_0x2a4a3d]['body']=juice(_0x51de0f[_0x2a4a3d][_0x0f2d('0x68')]);}}_0xa25f6f['rows']=_0x51de0f;return _0xa25f6f;});}})[_0x0f2d('0x25')](respondWithFilteredResult(_0x3c861b,_0x563a3f))[_0x0f2d('0x64')](handleError(_0x3c861b,null));};exports[_0x0f2d('0x40')]=function(_0x29b0a4,_0x377c3b,_0x253203){var _0x41eab7,_0x406478={},_0x5154a1;if(_0x29b0a4[_0x0f2d('0x68')]['to']){_0x5154a1=_0x29b0a4['body']['to'][_0x0f2d('0xa4')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x29b0a4[_0x0f2d('0x66')]['id']},'include':[{'model':db[_0x0f2d('0xa8')],'as':_0x0f2d('0xa9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x5154a1},'limit':0x1,'order':[[_0x0f2d('0xaa'),_0x0f2d('0xab')]]}]},{'model':db[_0x0f2d('0x44')],'as':_0x0f2d('0x45'),'raw':!![]}]})[_0x0f2d('0x25')](handleEntityNotFound(_0x377c3b,null))[_0x0f2d('0x25')](function(_0xeb7e26){if(_0xeb7e26){_0x41eab7=_0xeb7e26;if(_0xeb7e26[_0x0f2d('0x45')]){if(_[_0x0f2d('0x76')](_0x29b0a4['body']['from'])){_0x29b0a4[_0x0f2d('0x68')][_0x0f2d('0xac')]=util[_0x0f2d('0xa5')](_0x0f2d('0xad'),_0xeb7e26[_0x0f2d('0x3f')],_0xeb7e26[_0x0f2d('0xae')]||_0xeb7e26[_0x0f2d('0x45')]['user']);}if(_0x29b0a4[_0x0f2d('0x68')][_0x0f2d('0xaf')]&&_0x29b0a4[_0x0f2d('0x68')]['attachments']['length']){for(var _0x417637=0x0;_0x417637<_0x29b0a4[_0x0f2d('0x68')]['attachments'][_0x0f2d('0x54')];_0x417637+=0x1){_0x29b0a4[_0x0f2d('0x68')][_0x0f2d('0xaf')][_0x417637]={'filename':_0x29b0a4[_0x0f2d('0x68')]['attachments'][_0x417637]['name'],'path':path[_0x0f2d('0xb0')](config['root'],'server/files/attachments',_0x29b0a4[_0x0f2d('0x68')][_0x0f2d('0xaf')][_0x417637]['basename'])};}}var _0xf315c7={'tls':{'rejectUnauthorized':![]}};if(_[_0x0f2d('0x76')](_0xeb7e26[_0x0f2d('0x45')][_0x0f2d('0x80')])){if(_0xeb7e26[_0x0f2d('0x45')][_0x0f2d('0x7d')]){_0xf315c7[_0x0f2d('0xb1')]={'user':_0xeb7e26[_0x0f2d('0x45')][_0x0f2d('0x7a')],'pass':_0xeb7e26[_0x0f2d('0x45')][_0x0f2d('0x7b')]};}_0xf315c7[_0x0f2d('0x7e')]=_0xeb7e26['Smtp'][_0x0f2d('0x7e')];_0xf315c7[_0x0f2d('0x7f')]=_0xeb7e26[_0x0f2d('0x45')]['port'];_0xf315c7[_0x0f2d('0xb2')]=_0xeb7e26['Smtp']['secure'];}else{_0xf315c7[_0x0f2d('0x80')]=_0xeb7e26[_0x0f2d('0x45')][_0x0f2d('0x80')];_0xf315c7[_0x0f2d('0xb1')]={'user':_0xeb7e26['Smtp']['user'],'pass':_0xeb7e26[_0x0f2d('0x45')][_0x0f2d('0x7b')]};}return respondWithRpcPromise(_0x0f2d('0xb3'),_0x0f2d('0xb4'),{'account':_0xf315c7,'message':_0x29b0a4[_0x0f2d('0x68')]});}else{throw new Error(_0x0f2d('0xb5'));}}})[_0x0f2d('0x25')](function(_0x5a9daa){if(_0x5a9daa){_0x406478=_0x5a9daa;if(_0x41eab7['List']){if(_0x41eab7[_0x0f2d('0xa9')][_0x0f2d('0xb6')][_0x0f2d('0x54')]){return _0x41eab7['List'][_0x0f2d('0xb6')][0x0];}else{return db['CmContact'][_0x0f2d('0x71')](_[_0x0f2d('0x1d')](_0x29b0a4[_0x0f2d('0x68')],{'firstName':_0x29b0a4[_0x0f2d('0x68')]['to'],'email':_0x29b0a4['body']['to'],'phone':_0x29b0a4['body']['to'],'ListId':_0x41eab7['ListId']}));}}else{throw new Error(_0x0f2d('0xb5'));}}})[_0x0f2d('0x25')](function(_0x1c371b){if(_0x1c371b){var _0x23f08e={'UserId':_0x29b0a4[_0x0f2d('0x7a')]['id'],'ContactId':_0x1c371b['id'],'MailAccountId':_0x41eab7['id'],'inReplyTo':_0x406478[_0x0f2d('0xb7')],'to':_0x29b0a4[_0x0f2d('0x68')][_0x0f2d('0xac')],'cc':_0x29b0a4[_0x0f2d('0x68')]['cc'],'subject':_0x29b0a4['body'][_0x0f2d('0xb8')],'attach':_0x29b0a4[_0x0f2d('0x68')]['attach'],'firstMsgDirection':_0x0f2d('0xb9'),'lastMsgAt':moment()['format'](_0x0f2d('0xa6')),'lastMsgDirection':_0x0f2d('0xb9'),'Messages':[_[_0x0f2d('0x5b')](_0x29b0a4[_0x0f2d('0x68')],{'messageId':_0x406478[_0x0f2d('0xb7')],'sentAt':moment()[_0x0f2d('0xa5')](_0x0f2d('0xa6')),'read':!![],'MailAccountId':_0x41eab7['id'],'UserId':_0x29b0a4[_0x0f2d('0x7a')]['id'],'ContactId':_0x1c371b['id']})]};if(_0x29b0a4[_0x0f2d('0x68')]['Interaction']){_0x23f08e=_[_0x0f2d('0x5b')](_0x23f08e,_0x29b0a4[_0x0f2d('0x68')]['Interaction']);}return db[_0x0f2d('0x8d')]['create'](_0x23f08e,{'include':[{'model':db['MailMessage'],'as':_0x0f2d('0xba')}]});}})[_0x0f2d('0x25')](respondWithResult(_0x377c3b,null))['catch'](handleError(_0x377c3b,null));};exports[_0x0f2d('0xbb')]=function(_0x4b0cd8,_0x4ddd87,_0x1fd066){return db['MailAccount'][_0x0f2d('0x67')]({'where':{'id':_0x4b0cd8[_0x0f2d('0x66')]['id']},'include':[{'model':db[_0x0f2d('0x44')],'as':_0x0f2d('0x45'),'raw':!![]}]})[_0x0f2d('0x25')](handleEntityNotFound(_0x4ddd87,null))[_0x0f2d('0x25')](function(_0x3e412c){if(_0x3e412c&&_0x3e412c[_0x0f2d('0x45')]){var _0x1ac27b={'id':_0x3e412c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3e412c['Smtp']['service']){_0x1ac27b[_0x0f2d('0x80')]=_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0x80')];}else{_0x1ac27b['host']=_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0x7e')];_0x1ac27b[_0x0f2d('0x7f')]=_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0x7f')];_0x1ac27b[_0x0f2d('0xb2')]=_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0xb2')];}if(_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0x7d')]){_0x1ac27b[_0x0f2d('0xb1')]={'user':_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0x7a')],'pass':_0x3e412c[_0x0f2d('0x45')][_0x0f2d('0x7b')]};}return respondWithRpcPromise(_0x0f2d('0xbc'),_0x0f2d('0xbb'),{'account':_0x1ac27b});}})[_0x0f2d('0x25')](respondWithResult(_0x4ddd87,null))['catch'](handleError(_0x4ddd87,null));};exports[_0x0f2d('0x9d')]=function(_0x1ba39b,_0xfcfac6){return db[_0x0f2d('0x5f')][_0x0f2d('0x67')]({'where':{'id':_0x1ba39b[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0xfcfac6,null))[_0x0f2d('0x25')](function(_0x3e1586){if(_0x3e1586&&_0x3e1586[_0x0f2d('0x80')]){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3e1586;})[_0x0f2d('0x25')](removeEntity(_0xfcfac6,null))[_0x0f2d('0x64')](handleError(_0xfcfac6,null));};exports[_0x0f2d('0xbd')]=function(_0x58a4bb,_0x3da174,_0x41eb05){return db[_0x0f2d('0x5f')]['find']({'where':{'id':_0x58a4bb[_0x0f2d('0x66')]['id']}})[_0x0f2d('0x25')](handleEntityNotFound(_0x3da174,null))['then'](function(_0x399ea3){if(_0x399ea3){return _0x399ea3[_0x0f2d('0xbd')](_0x58a4bb['body'][_0x0f2d('0x6e')],_['omit'](_0x58a4bb[_0x0f2d('0x68')],[_0x0f2d('0x6e'),'id'])||{})['spread'](function(_0x5d3d6e){for(var _0x3a19c3=0x0;_0x3a19c3<_0x58a4bb[_0x0f2d('0x68')][_0x0f2d('0x6e')]['length'];_0x3a19c3+=0x1){socket[_0x0f2d('0xbe')](_0x0f2d('0xbf'),{'UserId':Number(_0x58a4bb[_0x0f2d('0x68')][_0x0f2d('0x6e')][_0x3a19c3]),'MailAccountId':Number(_0x58a4bb[_0x0f2d('0x66')]['id'])});}return _0x5d3d6e;});}})['then'](respondWithResult(_0x3da174,null))[_0x0f2d('0x64')](handleError(_0x3da174,null));};exports['removeAgents']=function(_0xb23e24,_0x25cfcd,_0x1c5fb8){return db[_0x0f2d('0x5f')]['find']({'where':{'id':_0xb23e24[_0x0f2d('0x66')]['id']}})['then'](handleEntityNotFound(_0x25cfcd,null))['then'](function(_0x38305c){if(_0x38305c){return _0x38305c[_0x0f2d('0xc0')](_0xb23e24[_0x0f2d('0x4e')][_0x0f2d('0x6e')])['then'](function(){if(_[_0x0f2d('0xc1')](_0xb23e24['query'][_0x0f2d('0x6e')])){for(var _0x5284cb=0x0;_0x5284cb<_0xb23e24[_0x0f2d('0x4e')][_0x0f2d('0x6e')][_0x0f2d('0x54')];_0x5284cb+=0x1){socket[_0x0f2d('0xbe')](_0x0f2d('0xc2'),{'UserId':Number(_0xb23e24['query'][_0x0f2d('0x6e')][_0x5284cb]),'MailAccountId':Number(_0xb23e24['params']['id'])});}}else{socket[_0x0f2d('0xbe')](_0x0f2d('0xc2'),{'UserId':Number(_0xb23e24['query'][_0x0f2d('0x6e')]),'MailAccountId':Number(_0xb23e24['params']['id'])});}});}})[_0x0f2d('0x25')](respondWithStatusCode(_0x25cfcd,null))[_0x0f2d('0x64')](handleError(_0x25cfcd,null));};exports[_0x0f2d('0xc3')]=function(_0x2c43bc,_0x4151eb,_0x434542){var _0x41e7c2={};var _0x4fe7f7={};var _0x45e16a;var _0x4fcd5a;return db[_0x0f2d('0x5f')][_0x0f2d('0x73')]({'where':{'id':_0x2c43bc['params']['id']}})['then'](handleEntityNotFound(_0x4151eb,null))[_0x0f2d('0x25')](function(_0x480775){if(_0x480775){_0x45e16a=_0x480775;_0x4fe7f7[_0x0f2d('0x51')]=_[_0x0f2d('0x4d')](db[_0x0f2d('0x93')][_0x0f2d('0x48')]);_0x4fe7f7[_0x0f2d('0x4e')]=_[_0x0f2d('0x4d')](_0x2c43bc[_0x0f2d('0x4e')]);_0x4fe7f7['filters']=_[_0x0f2d('0x50')](_0x4fe7f7[_0x0f2d('0x51')],_0x4fe7f7[_0x0f2d('0x4e')]);_0x41e7c2[_0x0f2d('0x52')]=_[_0x0f2d('0x50')](_0x4fe7f7[_0x0f2d('0x51')],qs[_0x0f2d('0x53')](_0x2c43bc['query'][_0x0f2d('0x53')]));_0x41e7c2[_0x0f2d('0x52')]=_0x41e7c2[_0x0f2d('0x52')][_0x0f2d('0x54')]?_0x41e7c2[_0x0f2d('0x52')]:_0x4fe7f7[_0x0f2d('0x51')];_0x41e7c2['order']=qs['sort'](_0x2c43bc[_0x0f2d('0x4e')]['sort']);_0x41e7c2[_0x0f2d('0x59')]=qs[_0x0f2d('0x4f')](_[_0x0f2d('0x5a')](_0x2c43bc['query'],_0x4fe7f7['filters']));if(_0x2c43bc[_0x0f2d('0x4e')][_0x0f2d('0x5d')]){_0x41e7c2['where']=_['merge'](_0x41e7c2[_0x0f2d('0x59')],{'$or':_[_0x0f2d('0x4c')](_0x41e7c2['attributes'],function(_0x1b5790){var _0x196619={};_0x196619[_0x1b5790]={'$like':'%'+_0x2c43bc['query'][_0x0f2d('0x5d')]+'%'};return _0x196619;})});}_0x41e7c2=_['merge']({},_0x41e7c2,_0x2c43bc[_0x0f2d('0x5e')]);return _0x45e16a[_0x0f2d('0xc3')](_0x41e7c2);}})['then'](function(_0x51e90a){if(_0x51e90a){_0x4fcd5a=_0x51e90a[_0x0f2d('0x54')];if(!_0x2c43bc[_0x0f2d('0x4e')][_0x0f2d('0x55')](_0x0f2d('0x56'))){_0x41e7c2[_0x0f2d('0x33')]=qs[_0x0f2d('0x33')](_0x2c43bc[_0x0f2d('0x4e')][_0x0f2d('0x33')]);_0x41e7c2[_0x0f2d('0x31')]=qs['offset'](_0x2c43bc[_0x0f2d('0x4e')][_0x0f2d('0x31')]);}return _0x45e16a[_0x0f2d('0xc3')](_0x41e7c2);}})['then'](function(_0x9f27b9){if(_0x9f27b9){return _0x9f27b9?{'count':_0x4fcd5a,'rows':_0x9f27b9}:null;}})[_0x0f2d('0x25')](respondWithResult(_0x4151eb,null))['catch'](handleError(_0x4151eb,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 1e81308..16cadf6 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 _0xef66=['MailAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1765ad,_0x3670ff){var _0x519d0e=function(_0x220e78){while(--_0x220e78){_0x1765ad['push'](_0x1765ad['shift']());}};_0x519d0e(++_0x3670ff);}(_0xef66,0x1db));var _0x6ef6=function(_0x5d3686,_0x128c5d){_0x5d3686=_0x5d3686-0x0;var _0x421b7b=_0xef66[_0x5d3686];return _0x421b7b;};'use strict';var EventEmitter=require(_0x6ef6('0x0'));var MailAccount=require(_0x6ef6('0x1'))['db'][_0x6ef6('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6ef6('0x3')](0x0);var events={'afterCreate':_0x6ef6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x447651){return function(_0x2443db,_0x337718,_0x1cc212){MailAccountEvents[_0x6ef6('0x5')](_0x447651+':'+_0x2443db['id'],_0x2443db);MailAccountEvents[_0x6ef6('0x5')](_0x447651,_0x2443db);_0x1cc212(null);};}for(var e in events){if(events[_0x6ef6('0x6')](e)){var event=events[e];MailAccount[_0x6ef6('0x7')](e,emitEvent(event));}}module[_0x6ef6('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x20de=['update','remove','emit','hook','events','MailAccount','setMaxListeners','save'];(function(_0x5b152b,_0x4806ce){var _0x4b3eed=function(_0xd145c1){while(--_0xd145c1){_0x5b152b['push'](_0x5b152b['shift']());}};_0x4b3eed(++_0x4806ce);}(_0x20de,0x134));var _0xe20d=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x20de[_0x1589dd];return _0x1bddd1;};'use strict';var EventEmitter=require(_0xe20d('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xe20d('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe20d('0x2')](0x0);var events={'afterCreate':_0xe20d('0x3'),'afterUpdate':_0xe20d('0x4'),'afterDestroy':_0xe20d('0x5')};function emitEvent(_0x39a7f3){return function(_0x31c533,_0x174186,_0x7b02d6){MailAccountEvents[_0xe20d('0x6')](_0x39a7f3+':'+_0x31c533['id'],_0x31c533);MailAccountEvents[_0xe20d('0x6')](_0x39a7f3,_0x31c533);_0x7b02d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xe20d('0x7')](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 2230f92..5fd0521 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 _0xa1e9=['exports','MailAccount','mail_accounts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x4d9bcd,_0x2e56d2){var _0x508ea2=function(_0x4c3de9){while(--_0x4c3de9){_0x4d9bcd['push'](_0x4d9bcd['shift']());}};_0x508ea2(++_0x2e56d2);}(_0xa1e9,0xc1));var _0x9a1e=function(_0x8f7825,_0xaa0ca0){_0x8f7825=_0x8f7825-0x0;var _0x29a7c9=_0xa1e9[_0x8f7825];return _0x29a7c9;};'use strict';var _=require(_0x9a1e('0x0'));var util=require(_0x9a1e('0x1'));var logger=require(_0x9a1e('0x2'))('api');var moment=require(_0x9a1e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a1e('0x4'));var rimraf=require(_0x9a1e('0x5'));var config=require(_0x9a1e('0x6'));var attributes=require('./mailAccount.attributes');module[_0x9a1e('0x7')]=function(_0x5ecf14,_0x59cf23){return _0x5ecf14['define'](_0x9a1e('0x8'),attributes,{'tableName':_0x9a1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2a7=['util','../../config/logger','moment','bluebird','path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash'];(function(_0x582758,_0x3e8722){var _0x51cac4=function(_0x46652f){while(--_0x46652f){_0x582758['push'](_0x582758['shift']());}};_0x51cac4(++_0x3e8722);}(_0xc2a7,0x1bb));var _0x7c2a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2a7[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7c2a('0x0'));var util=require(_0x7c2a('0x1'));var logger=require(_0x7c2a('0x2'))('api');var moment=require(_0x7c2a('0x3'));var BPromise=require(_0x7c2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c2a('0x5'));var rimraf=require('rimraf');var config=require(_0x7c2a('0x6'));var attributes=require(_0x7c2a('0x7'));module[_0x7c2a('0x8')]=function(_0x5952bc,_0x560dc4){return _0x5952bc[_0x7c2a('0x9')](_0x7c2a('0xa'),attributes,{'tableName':_0x7c2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 66a067a..bdc48cf 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 _0xd6c1=['asc','autoclose','push','length','close','*,*,*,*','create','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','MailMessage','originTo','originCc','originChannel','Attachment','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','model','map','ShowMailAccount','find','raw','NotifyMailAccount','body','mail','CmContact','rawAttributes','updatedAt','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','get','account','applications','priority'];(function(_0x1e2f38,_0x397605){var _0x4e76f3=function(_0xb991b3){while(--_0xb991b3){_0x1e2f38['push'](_0x1e2f38['shift']());}};_0x4e76f3(++_0x397605);}(_0xd6c1,0x1a9));var _0x1d6c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd6c1[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1d6c('0x0'));var util=require(_0x1d6c('0x1'));var moment=require(_0x1d6c('0x2'));var BPromise=require(_0x1d6c('0x3'));var rs=require(_0x1d6c('0x4'));var fs=require('fs');var Redis=require(_0x1d6c('0x5'));var db=require(_0x1d6c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d6c('0x7'))(_0x1d6c('0x8'));var config=require(_0x1d6c('0x9'));var jayson=require(_0x1d6c('0xa'));var client=jayson['client'][_0x1d6c('0xb')]({'port':0x232c});config[_0x1d6c('0xc')]=_[_0x1d6c('0xd')](config[_0x1d6c('0xc')],{'host':_0x1d6c('0xe'),'port':0x18eb});var socket=require(_0x1d6c('0xf'))(new Redis(config[_0x1d6c('0xc')]));require('./mailAccount.socket')[_0x1d6c('0x10')](socket);function respondWithRpcPromise(_0x4d22da,_0x1e8eb9,_0x5d8147){return new BPromise(function(_0x28ac2b,_0x17342e){return client[_0x1d6c('0x11')](_0x4d22da,_0x5d8147)[_0x1d6c('0x12')](function(_0xd6cf5d){logger[_0x1d6c('0x13')](_0x1d6c('0x14'),_0x1e8eb9,_0x1d6c('0x15'));logger[_0x1d6c('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x1e8eb9,_0x1d6c('0x15'),JSON[_0x1d6c('0x17')](_0xd6cf5d));if(_0xd6cf5d['error']){if(_0xd6cf5d['error'][_0x1d6c('0x18')]===0x1f4){logger[_0x1d6c('0x19')](_0x1d6c('0x14'),_0x1e8eb9,_0xd6cf5d[_0x1d6c('0x19')][_0x1d6c('0x1a')]);return _0x17342e(_0xd6cf5d[_0x1d6c('0x19')][_0x1d6c('0x1a')]);}logger['error'](_0x1d6c('0x14'),_0x1e8eb9,_0xd6cf5d[_0x1d6c('0x19')]['message']);return _0x28ac2b(_0xd6cf5d[_0x1d6c('0x19')]['message']);}else{logger[_0x1d6c('0x13')]('MailAccount,\x20%s,\x20%s',_0x1e8eb9,_0x1d6c('0x15'));_0x28ac2b(_0xd6cf5d['result']['message']);}})[_0x1d6c('0x1b')](function(_0x485fb8){logger[_0x1d6c('0x19')]('MailAccount,\x20%s,\x20%s',_0x1e8eb9,_0x485fb8);_0x17342e(_0x485fb8);});});}exports[_0x1d6c('0x1c')]=function(_0x50ad0e){var _0x4a1d00=this;return new Promise(function(_0x4df291,_0x339c28){return db[_0x1d6c('0x1d')][_0x1d6c('0x1e')]({'raw':_0x50ad0e[_0x1d6c('0x1f')]?_0x50ad0e[_0x1d6c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x50ad0e['options']?_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x20')]||null:null,'attributes':_0x50ad0e[_0x1d6c('0x1f')]?_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x21')]||null:null,'limit':_0x50ad0e[_0x1d6c('0x1f')]?_0x50ad0e['options'][_0x1d6c('0x22')]||null:null,'include':_0x50ad0e['options']?_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x23')]?_['map'](_0x50ad0e[_0x1d6c('0x1f')][_0x1d6c('0x23')],function(_0x11e9a1){return{'model':db[_0x11e9a1[_0x1d6c('0x24')]],'as':_0x11e9a1['as'],'attributes':_0x11e9a1[_0x1d6c('0x21')],'include':_0x11e9a1[_0x1d6c('0x23')]?_[_0x1d6c('0x25')](_0x11e9a1['include'],function(_0x3cc7b4){return{'model':db[_0x3cc7b4[_0x1d6c('0x24')]],'as':_0x3cc7b4['as'],'attributes':_0x3cc7b4[_0x1d6c('0x21')],'include':_0x3cc7b4[_0x1d6c('0x23')]?_[_0x1d6c('0x25')](_0x3cc7b4[_0x1d6c('0x23')],function(_0xc77527){return{'model':db[_0xc77527['model']],'as':_0xc77527['as'],'attributes':_0xc77527[_0x1d6c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1d6c('0x12')](function(_0x5d91a9){logger[_0x1d6c('0x13')](_0x1d6c('0x1c'),_0x50ad0e);logger[_0x1d6c('0x16')](_0x1d6c('0x1c'),_0x50ad0e,JSON[_0x1d6c('0x17')](_0x5d91a9));_0x4df291(_0x5d91a9);})[_0x1d6c('0x1b')](function(_0x4d4ecd){logger[_0x1d6c('0x19')](_0x1d6c('0x1c'),_0x4d4ecd['message'],_0x50ad0e);_0x339c28(_0x4a1d00[_0x1d6c('0x19')](0x1f4,_0x4d4ecd[_0x1d6c('0x1a')]));});});};exports[_0x1d6c('0x26')]=function(_0x15b81e){var _0x23e2fa=this;return new Promise(function(_0x21c719,_0x1bd3a0){return db['MailAccount'][_0x1d6c('0x27')]({'raw':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e[_0x1d6c('0x1f')][_0x1d6c('0x28')]===undefined?!![]:![]:!![],'where':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e[_0x1d6c('0x1f')]['where']||null:null,'attributes':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e['options']['attributes']||null:null,'include':_0x15b81e[_0x1d6c('0x1f')]?_0x15b81e[_0x1d6c('0x1f')][_0x1d6c('0x23')]?_[_0x1d6c('0x25')](_0x15b81e[_0x1d6c('0x1f')][_0x1d6c('0x23')],function(_0x2a959e){return{'model':db[_0x2a959e[_0x1d6c('0x24')]],'as':_0x2a959e['as'],'attributes':_0x2a959e['attributes'],'include':_0x2a959e['include']?_['map'](_0x2a959e[_0x1d6c('0x23')],function(_0x2ac20e){return{'model':db[_0x2ac20e[_0x1d6c('0x24')]],'as':_0x2ac20e['as'],'attributes':_0x2ac20e['attributes'],'include':_0x2ac20e[_0x1d6c('0x23')]?_['map'](_0x2ac20e['include'],function(_0x3209be){return{'model':db[_0x3209be[_0x1d6c('0x24')]],'as':_0x3209be['as'],'attributes':_0x3209be['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d6c('0x12')](function(_0x5e51d2){logger[_0x1d6c('0x13')](_0x1d6c('0x26'),_0x15b81e);logger[_0x1d6c('0x16')]('ShowMailAccount',_0x15b81e,JSON[_0x1d6c('0x17')](_0x5e51d2));_0x21c719(_0x5e51d2);})['catch'](function(_0x45cd86){logger[_0x1d6c('0x19')](_0x1d6c('0x26'),_0x45cd86[_0x1d6c('0x1a')],_0x15b81e);_0x1bd3a0(_0x23e2fa['error'](0x1f4,_0x45cd86[_0x1d6c('0x1a')]));});});};exports[_0x1d6c('0x29')]=function(_0x4a1f44){var _0x5a0fa9=this;return new Promise(function(_0x39d227,_0x5b530d){var _0x28b723={'body':_0x4a1f44[_0x1d6c('0x2a')],'channel':_0x1d6c('0x2b')};var _0x269fad=_['difference'](_['keys'](db[_0x1d6c('0x2c')][_0x1d6c('0x2d')]),['createdAt',_0x1d6c('0x2e'),'CompanyId',_0x1d6c('0x2f')]);var _0xa65a82=![];if(_0x4a1f44[_0x1d6c('0x2a')]['id']){delete _0x4a1f44[_0x1d6c('0x2a')]['id'];}if(_[_0x1d6c('0x30')](_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x31')])){return _0x5b530d(_0x5a0fa9['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x1d6c('0x30')](_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x2a')])||_0x4a1f44['body'][_0x1d6c('0x2a')]===''){return _0x5b530d(_0x5a0fa9[_0x1d6c('0x19')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1d6c('0x30')](_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x32')])){return _0x5b530d(_0x5a0fa9[_0x1d6c('0x19')](0x1f4,_0x1d6c('0x33')+_0x269fad));}if(!_[_0x1d6c('0x34')](_0x269fad,_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x32')])){return _0x5b530d(_0x5a0fa9[_0x1d6c('0x19')](0x1f4,_0x1d6c('0x35')+_0x269fad));}var _0x34dfd6={};_0x34dfd6[_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x32')]]=_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x31')];return db[_0x1d6c('0x1d')][_0x1d6c('0x27')]({'where':{'id':_0x4a1f44['account']['id']},'include':[{'model':db[_0x1d6c('0x36')],'as':_0x1d6c('0x37'),'include':[{'model':db[_0x1d6c('0x2c')],'as':_0x1d6c('0x38'),'where':_0x34dfd6,'limit':0x1,'order':[[_0x1d6c('0x2e'),_0x1d6c('0x39')]]}]},{'model':db[_0x1d6c('0x3a')],'as':_0x1d6c('0x3b')},{'model':db['MailServerOut'],'as':_0x1d6c('0x3c')}]})[_0x1d6c('0x12')](function(_0x5d5895){if(_0x5d5895&&_0x5d5895[_0x1d6c('0x37')]){var _0x5d87f1=_0x5d5895[_0x1d6c('0x3d')]({'plain':!![]});_0x28b723[_0x1d6c('0x3e')]=_['omit'](_0x5d87f1,[_0x1d6c('0x3b'),_0x1d6c('0x37')]);_0x28b723['applications']=_0x5d87f1[_0x1d6c('0x3b')];_0x28b723['list']=_0x5d87f1[_0x1d6c('0x37')];_0x28b723[_0x1d6c('0x3f')]=_['orderBy'](_0x28b723[_0x1d6c('0x3f')],[_0x1d6c('0x40')],[_0x1d6c('0x41')]);if(_0x28b723[_0x1d6c('0x3e')]&&_0x28b723['account'][_0x1d6c('0x42')]){_0x28b723['applications'][_0x1d6c('0x43')]({'id':0x0,'priority':_0x28b723[_0x1d6c('0x3f')][_0x1d6c('0x44')]+0x1,'app':_0x1d6c('0x45'),'appdata':_0x1d6c('0x42'),'interval':_0x1d6c('0x46')});}if(_0x28b723['account'][_0x1d6c('0x3b')]){delete _0x28b723[_0x1d6c('0x3e')][_0x1d6c('0x3b')];}if(_0x28b723['account'][_0x1d6c('0x37')]){delete _0x28b723['account'][_0x1d6c('0x37')];}if(_0x5d87f1[_0x1d6c('0x37')][_0x1d6c('0x38')]['length']){return _0x5d87f1[_0x1d6c('0x37')][_0x1d6c('0x38')][0x0];}var _0x335ead=_[_0x1d6c('0xd')](_0x4a1f44[_0x1d6c('0x2a')],{'firstName':_0x4a1f44['body']['from'],'ListId':_0x5d87f1[_0x1d6c('0x2f')]});_0x335ead[_0x4a1f44['body'][_0x1d6c('0x32')]]=_0x4a1f44[_0x1d6c('0x2a')]['from'];return db[_0x1d6c('0x2c')][_0x1d6c('0x47')](_0x335ead);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x565480){_0x28b723[_0x1d6c('0x48')]=_0x565480;if(_0x565480){if(!_0x4a1f44['body'][_0x1d6c('0x1a')][_0x1d6c('0x49')]){_0x4a1f44['body']['message']['messageId']=rs[_0x1d6c('0x4a')]()+'\x20'+_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x31')];}var _0x47b1fa={'ContactId':_0x565480['id'],'MailAccountId':_0x4a1f44[_0x1d6c('0x3e')]['id'],'inReplyTo':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['messageId'],'to':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['from'],'cc':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['cc'],'subject':_0x4a1f44[_0x1d6c('0x2a')]['message']['subject'],'attach':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x4b')],'lastMsgAt':moment()[_0x1d6c('0x4c')](_0x1d6c('0x4d')),'lastMsgDirection':'in'};return db[_0x1d6c('0x4e')]['find']({'where':{'closed':![],'MailAccountId':_0x4a1f44['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x1d6c('0x4f'),'attributes':[_0x1d6c('0x49')],'where':{'messageId':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x50')]}}]})[_0x1d6c('0x12')](function(_0x1e3afa){if(_0x1e3afa){return[_0x1e3afa,![]];}return db['MailInteraction']['create'](_0x47b1fa)[_0x1d6c('0x12')](function(_0x2d3ae4){return[_0x2d3ae4,!![]];});});}else{throw new Error(_0x1d6c('0x51'));}})[_0x1d6c('0x52')](function(_0x4ba25f,_0x3a74ba){if(_0x4ba25f){_0xa65a82=_0x3a74ba;if(!_0x3a74ba){return _0x4ba25f[_0x1d6c('0x53')]({'inReplyTo':_0x4a1f44[_0x1d6c('0x2a')]['message']['messageId'],'to':_0x4a1f44[_0x1d6c('0x2a')]['message'][_0x1d6c('0x31')],'cc':_0x4a1f44[_0x1d6c('0x2a')]['message']['cc'],'subject':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x54')],'attach':_0x4ba25f[_0x1d6c('0x4b')]?_0x4ba25f[_0x1d6c('0x4b')]:_0x4a1f44[_0x1d6c('0x2a')]['message'][_0x1d6c('0x4b')],'substatus':null,'substatusAt':moment()[_0x1d6c('0x4c')](_0x1d6c('0x4d')),'lastMsgAt':moment()['format'](_0x1d6c('0x4d')),'lastMsgDirection':'in'});}else{return _0x4ba25f;}}})[_0x1d6c('0x12')](function(_0x32bf4d){_0x28b723[_0x1d6c('0x55')]=_0x32bf4d[_0x1d6c('0x3d')]({'plain':!![]});_0x28b723[_0x1d6c('0x55')]['created']=_0xa65a82;return db[_0x1d6c('0x56')]['create']({'body':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x2a')],'MailAccountId':_0x4a1f44['account']['id'],'MailInteractionId':_0x32bf4d['id'],'direction':'in','ContactId':_0x28b723['contact']['id'],'messageId':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['messageId'],'from':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x31')],'to':_0x4a1f44['body'][_0x1d6c('0x1a')]['to'],'cc':_0x4a1f44['body'][_0x1d6c('0x1a')]['cc'],'subject':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['subject'],'attach':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x4b')],'Attachments':_0x4a1f44[_0x1d6c('0x2a')]['message']['attachments'],'originTo':_0x4a1f44['body'][_0x1d6c('0x1a')][_0x1d6c('0x57')],'originCc':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x58')],'bcc':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['bcc'],'ChatWebsiteId':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x4a1f44[_0x1d6c('0x2a')][_0x1d6c('0x1a')][_0x1d6c('0x59')]||'Email','ChatOfflineMessageId':_0x4a1f44[_0x1d6c('0x2a')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x1d6c('0x5a')],'as':'Attachments'}]});})[_0x1d6c('0x12')](function(_0x566cca){_0x28b723[_0x1d6c('0x1a')]=_0x566cca;if(_0x28b723[_0x1d6c('0x55')][_0x1d6c('0x5b')]){return db['User'][_0x1d6c('0x27')]({'attributes':['id',_0x1d6c('0x5c')],'where':{'id':_0x28b723[_0x1d6c('0x55')][_0x1d6c('0x5b')]}})[_0x1d6c('0x12')](function(_0x404df5){if(_0x404df5){_0x28b723[_0x1d6c('0x3f')][_0x1d6c('0x5d')]({'id':0x0,'priority':0x0,'app':_0x1d6c('0x5e'),'appdata':_0x404df5['name']+','+(_0x28b723[_0x1d6c('0x3e')][_0x1d6c('0x5f')]||0xa),'interval':_0x1d6c('0x46')});}return respondWithRpcPromise(_0x1d6c('0x60'),'startRouting',_0x28b723);});}return respondWithRpcPromise(_0x1d6c('0x60'),_0x1d6c('0x61'),_0x28b723);})[_0x1d6c('0x12')](function(_0x239bac){_0x39d227(_0x239bac);})['catch'](function(_0x213ced){_0x5b530d(_0x5a0fa9['error'](0x1f4,_0x213ced['message']));});});}; \ No newline at end of file +var _0x587b=['UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowMailAccount','MailAccount','find','debug','NotifyMailAccount','rawAttributes','createdAt','updatedAt','ListId','body','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','get','Applications','list','orderBy','applications','priority','asc','autoclose','push','length','close','*,*,*,*','from','CmContact','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','interaction','created','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments'];(function(_0x5990f9,_0x2c21df){var _0x89a579=function(_0x42b6fa){while(--_0x42b6fa){_0x5990f9['push'](_0x5990f9['shift']());}};_0x89a579(++_0x2c21df);}(_0x587b,0x19e));var _0xb587=function(_0x3aae08,_0x4badcd){_0x3aae08=_0x3aae08-0x0;var _0x25fe8c=_0x587b[_0x3aae08];return _0x25fe8c;};'use strict';var _=require(_0xb587('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb587('0x1'));var fs=require('fs');var Redis=require(_0xb587('0x2'));var db=require(_0xb587('0x3'))['db'];var utils=require(_0xb587('0x4'));var logger=require(_0xb587('0x5'))('rpc');var config=require(_0xb587('0x6'));var jayson=require(_0xb587('0x7'));var client=jayson[_0xb587('0x8')][_0xb587('0x9')]({'port':0x232c});config[_0xb587('0xa')]=_[_0xb587('0xb')](config[_0xb587('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb587('0xc'))[_0xb587('0xd')](socket);function respondWithRpcPromise(_0x30dca0,_0x15c317,_0x2204f1){return new BPromise(function(_0x62c52,_0x3b5554){return client[_0xb587('0xe')](_0x30dca0,_0x2204f1)[_0xb587('0xf')](function(_0x1bc773){logger[_0xb587('0x10')](_0xb587('0x11'),_0x15c317,_0xb587('0x12'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x15c317,_0xb587('0x12'),JSON[_0xb587('0x13')](_0x1bc773));if(_0x1bc773[_0xb587('0x14')]){if(_0x1bc773[_0xb587('0x14')][_0xb587('0x15')]===0x1f4){logger[_0xb587('0x14')](_0xb587('0x11'),_0x15c317,_0x1bc773[_0xb587('0x14')]['message']);return _0x3b5554(_0x1bc773[_0xb587('0x14')]['message']);}logger['error'](_0xb587('0x11'),_0x15c317,_0x1bc773[_0xb587('0x14')][_0xb587('0x16')]);return _0x62c52(_0x1bc773[_0xb587('0x14')][_0xb587('0x16')]);}else{logger[_0xb587('0x10')](_0xb587('0x11'),_0x15c317,_0xb587('0x12'));_0x62c52(_0x1bc773[_0xb587('0x17')][_0xb587('0x16')]);}})['catch'](function(_0x236df4){logger['error'](_0xb587('0x11'),_0x15c317,_0x236df4);_0x3b5554(_0x236df4);});});}exports[_0xb587('0x18')]=function(_0x2f0352){var _0x209710=this;return new Promise(function(_0x3401fd,_0x1b416b){return db['MailAccount'][_0xb587('0x19')]({'raw':_0x2f0352[_0xb587('0x1a')]?_0x2f0352[_0xb587('0x1a')][_0xb587('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f0352[_0xb587('0x1a')]?_0x2f0352[_0xb587('0x1a')][_0xb587('0x1c')]||null:null,'attributes':_0x2f0352[_0xb587('0x1a')]?_0x2f0352['options'][_0xb587('0x1d')]||null:null,'limit':_0x2f0352[_0xb587('0x1a')]?_0x2f0352[_0xb587('0x1a')][_0xb587('0x1e')]||null:null,'include':_0x2f0352[_0xb587('0x1a')]?_0x2f0352[_0xb587('0x1a')][_0xb587('0x1f')]?_['map'](_0x2f0352[_0xb587('0x1a')]['include'],function(_0x3e7671){return{'model':db[_0x3e7671[_0xb587('0x20')]],'as':_0x3e7671['as'],'attributes':_0x3e7671[_0xb587('0x1d')],'include':_0x3e7671['include']?_[_0xb587('0x21')](_0x3e7671[_0xb587('0x1f')],function(_0x37be21){return{'model':db[_0x37be21[_0xb587('0x20')]],'as':_0x37be21['as'],'attributes':_0x37be21[_0xb587('0x1d')],'include':_0x37be21[_0xb587('0x1f')]?_[_0xb587('0x21')](_0x37be21[_0xb587('0x1f')],function(_0x133ee0){return{'model':db[_0x133ee0[_0xb587('0x20')]],'as':_0x133ee0['as'],'attributes':_0x133ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0xb587('0xf')](function(_0x31f092){logger[_0xb587('0x10')](_0xb587('0x18'),_0x2f0352);logger['debug'](_0xb587('0x18'),_0x2f0352,JSON[_0xb587('0x13')](_0x31f092));_0x3401fd(_0x31f092);})[_0xb587('0x22')](function(_0x27d5dd){logger['error'](_0xb587('0x18'),_0x27d5dd[_0xb587('0x16')],_0x2f0352);_0x1b416b(_0x209710[_0xb587('0x14')](0x1f4,_0x27d5dd[_0xb587('0x16')]));});});};exports[_0xb587('0x23')]=function(_0x45380b){var _0x3ae9ef=this;return new Promise(function(_0x2dc0aa,_0x3856f9){return db[_0xb587('0x24')][_0xb587('0x25')]({'raw':_0x45380b[_0xb587('0x1a')]?_0x45380b[_0xb587('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x45380b[_0xb587('0x1a')]?_0x45380b[_0xb587('0x1a')][_0xb587('0x1c')]||null:null,'attributes':_0x45380b['options']?_0x45380b[_0xb587('0x1a')][_0xb587('0x1d')]||null:null,'include':_0x45380b[_0xb587('0x1a')]?_0x45380b['options'][_0xb587('0x1f')]?_['map'](_0x45380b[_0xb587('0x1a')][_0xb587('0x1f')],function(_0x1df073){return{'model':db[_0x1df073[_0xb587('0x20')]],'as':_0x1df073['as'],'attributes':_0x1df073[_0xb587('0x1d')],'include':_0x1df073['include']?_[_0xb587('0x21')](_0x1df073[_0xb587('0x1f')],function(_0x10cb42){return{'model':db[_0x10cb42[_0xb587('0x20')]],'as':_0x10cb42['as'],'attributes':_0x10cb42['attributes'],'include':_0x10cb42[_0xb587('0x1f')]?_[_0xb587('0x21')](_0x10cb42['include'],function(_0x43aff5){return{'model':db[_0x43aff5['model']],'as':_0x43aff5['as'],'attributes':_0x43aff5[_0xb587('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb587('0xf')](function(_0x55b3f4){logger['info'](_0xb587('0x23'),_0x45380b);logger[_0xb587('0x26')](_0xb587('0x23'),_0x45380b,JSON[_0xb587('0x13')](_0x55b3f4));_0x2dc0aa(_0x55b3f4);})[_0xb587('0x22')](function(_0x3b80e1){logger[_0xb587('0x14')](_0xb587('0x23'),_0x3b80e1[_0xb587('0x16')],_0x45380b);_0x3856f9(_0x3ae9ef[_0xb587('0x14')](0x1f4,_0x3b80e1[_0xb587('0x16')]));});});};exports[_0xb587('0x27')]=function(_0xada0dd){var _0x3ccd2b=this;return new Promise(function(_0x4deab5,_0x423bee){var _0x3e81e8={'body':_0xada0dd['body'],'channel':'mail'};var _0x59db8f=_['difference'](_['keys'](db['CmContact'][_0xb587('0x28')]),[_0xb587('0x29'),_0xb587('0x2a'),'CompanyId',_0xb587('0x2b')]);var _0x5df685=![];if(_0xada0dd[_0xb587('0x2c')]['id']){delete _0xada0dd['body']['id'];}if(_['isNil'](_0xada0dd['body']['from'])){return _0x423bee(_0x3ccd2b['error'](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0xada0dd['body'][_0xb587('0x2c')])||_0xada0dd[_0xb587('0x2c')]['body']===''){return _0x423bee(_0x3ccd2b[_0xb587('0x14')](0x1f4,_0xb587('0x2d')));}if(_[_0xb587('0x2e')](_0xada0dd[_0xb587('0x2c')]['mapKey'])){return _0x423bee(_0x3ccd2b[_0xb587('0x14')](0x1f4,_0xb587('0x2f')+_0x59db8f));}if(!_['includes'](_0x59db8f,_0xada0dd[_0xb587('0x2c')][_0xb587('0x30')])){return _0x423bee(_0x3ccd2b['error'](0x1f4,_0xb587('0x31')+_0x59db8f));}var _0x49f7dc={};_0x49f7dc[_0xada0dd[_0xb587('0x2c')]['mapKey']]=_0xada0dd['body']['from'];return db['MailAccount'][_0xb587('0x25')]({'where':{'id':_0xada0dd[_0xb587('0x32')]['id']},'include':[{'model':db[_0xb587('0x33')],'as':_0xb587('0x34'),'include':[{'model':db['CmContact'],'as':_0xb587('0x35'),'where':_0x49f7dc,'limit':0x1,'order':[['updatedAt',_0xb587('0x36')]]}]},{'model':db[_0xb587('0x37')],'as':'Applications'},{'model':db[_0xb587('0x38')],'as':_0xb587('0x39')}]})[_0xb587('0xf')](function(_0x5ce64d){if(_0x5ce64d&&_0x5ce64d['List']){var _0x5d85a5=_0x5ce64d[_0xb587('0x3a')]({'plain':!![]});_0x3e81e8[_0xb587('0x32')]=_['omit'](_0x5d85a5,['Applications',_0xb587('0x34')]);_0x3e81e8['applications']=_0x5d85a5[_0xb587('0x3b')];_0x3e81e8[_0xb587('0x3c')]=_0x5d85a5[_0xb587('0x34')];_0x3e81e8['applications']=_[_0xb587('0x3d')](_0x3e81e8[_0xb587('0x3e')],[_0xb587('0x3f')],[_0xb587('0x40')]);if(_0x3e81e8['account']&&_0x3e81e8[_0xb587('0x32')][_0xb587('0x41')]){_0x3e81e8[_0xb587('0x3e')][_0xb587('0x42')]({'id':0x0,'priority':_0x3e81e8['applications'][_0xb587('0x43')]+0x1,'app':_0xb587('0x44'),'appdata':'autoclose','interval':_0xb587('0x45')});}if(_0x3e81e8[_0xb587('0x32')]['Applications']){delete _0x3e81e8[_0xb587('0x32')]['Applications'];}if(_0x3e81e8['account'][_0xb587('0x34')]){delete _0x3e81e8[_0xb587('0x32')]['List'];}if(_0x5d85a5[_0xb587('0x34')]['Contacts'][_0xb587('0x43')]){return _0x5d85a5[_0xb587('0x34')][_0xb587('0x35')][0x0];}var _0x1e87b1=_[_0xb587('0xb')](_0xada0dd['body'],{'firstName':_0xada0dd[_0xb587('0x2c')][_0xb587('0x46')],'ListId':_0x5d85a5[_0xb587('0x2b')]});_0x1e87b1[_0xada0dd[_0xb587('0x2c')][_0xb587('0x30')]]=_0xada0dd['body']['from'];return db[_0xb587('0x47')][_0xb587('0x48')](_0x1e87b1);}else{throw new Error(_0xb587('0x49'));}})['then'](function(_0x2113a1){_0x3e81e8[_0xb587('0x4a')]=_0x2113a1;if(_0x2113a1){if(!_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4b')]){_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4b')]=rs['generate']()+'\x20'+_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x46')];}var _0x330916={'ContactId':_0x2113a1['id'],'MailAccountId':_0xada0dd[_0xb587('0x32')]['id'],'inReplyTo':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4b')],'to':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')]['from'],'cc':_0xada0dd[_0xb587('0x2c')]['message']['cc'],'subject':_0xada0dd['body'][_0xb587('0x16')][_0xb587('0x4c')],'attach':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4d')],'lastMsgAt':moment()[_0xb587('0x4e')](_0xb587('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xb587('0x25')]({'where':{'closed':![],'MailAccountId':_0xada0dd[_0xb587('0x32')]['id']},'include':[{'model':db[_0xb587('0x50')],'as':_0xb587('0x51'),'attributes':[_0xb587('0x4b')],'where':{'messageId':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x52')]}}]})[_0xb587('0xf')](function(_0x276eee){if(_0x276eee){return[_0x276eee,![]];}return db[_0xb587('0x53')][_0xb587('0x48')](_0x330916)['then'](function(_0x19ddd8){return[_0x19ddd8,!![]];});});}else{throw new Error(_0xb587('0x54'));}})[_0xb587('0x55')](function(_0x5e809f,_0x4d0b18){if(_0x5e809f){_0x5df685=_0x4d0b18;if(!_0x4d0b18){return _0x5e809f['update']({'inReplyTo':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4b')],'to':_0xada0dd['body'][_0xb587('0x16')][_0xb587('0x46')],'cc':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')]['cc'],'subject':_0xada0dd['body'][_0xb587('0x16')]['subject'],'attach':_0x5e809f['attach']?_0x5e809f[_0xb587('0x4d')]:_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4d')],'substatus':null,'substatusAt':moment()[_0xb587('0x4e')](_0xb587('0x4f')),'lastMsgAt':moment()[_0xb587('0x4e')](_0xb587('0x4f')),'lastMsgDirection':'in'});}else{return _0x5e809f;}}})[_0xb587('0xf')](function(_0x26b073){_0x3e81e8[_0xb587('0x56')]=_0x26b073['get']({'plain':!![]});_0x3e81e8[_0xb587('0x56')][_0xb587('0x57')]=_0x5df685;return db[_0xb587('0x50')][_0xb587('0x48')]({'body':_0xada0dd['body'][_0xb587('0x2c')],'MailAccountId':_0xada0dd[_0xb587('0x32')]['id'],'MailInteractionId':_0x26b073['id'],'direction':'in','ContactId':_0x3e81e8[_0xb587('0x4a')]['id'],'messageId':_0xada0dd['body'][_0xb587('0x16')][_0xb587('0x4b')],'from':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x46')],'to':_0xada0dd[_0xb587('0x2c')]['message']['to'],'cc':_0xada0dd[_0xb587('0x2c')]['message']['cc'],'subject':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x4c')],'attach':_0xada0dd[_0xb587('0x2c')]['message']['attach'],'Attachments':_0xada0dd['body'][_0xb587('0x16')][_0xb587('0x58')],'originTo':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x59')],'originCc':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x5a')],'bcc':_0xada0dd['body'][_0xb587('0x16')][_0xb587('0x5b')],'ChatWebsiteId':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')]['ChatWebsiteId']||null,'originChannel':_0xada0dd[_0xb587('0x2c')][_0xb587('0x16')][_0xb587('0x5c')]||_0xb587('0x5d'),'ChatOfflineMessageId':_0xada0dd['body'][_0xb587('0x16')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb587('0x5e')],'as':_0xb587('0x5f')}]});})[_0xb587('0xf')](function(_0x3ca125){_0x3e81e8['message']=_0x3ca125;if(_0x3e81e8[_0xb587('0x56')][_0xb587('0x60')]){return db['User'][_0xb587('0x25')]({'attributes':['id',_0xb587('0x61')],'where':{'id':_0x3e81e8[_0xb587('0x56')][_0xb587('0x60')]}})[_0xb587('0xf')](function(_0x508ab5){if(_0x508ab5){_0x3e81e8[_0xb587('0x3e')][_0xb587('0x62')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x508ab5[_0xb587('0x61')]+','+(_0x3e81e8[_0xb587('0x32')][_0xb587('0x63')]||0xa),'interval':_0xb587('0x45')});}return respondWithRpcPromise(_0xb587('0x64'),_0xb587('0x65'),_0x3e81e8);});}return respondWithRpcPromise(_0xb587('0x64'),_0xb587('0x65'),_0x3e81e8);})[_0xb587('0xf')](function(_0x5bac6e){_0x4deab5(_0x5bac6e);})['catch'](function(_0x357948){_0x423bee(_0x3ccd2b['error'](0x1f4,_0x357948['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 3a76c7a..60a8eb6 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 _0x929b=['removeListener','register','length','save','emit'];(function(_0x3b46b9,_0x1d78e7){var _0x46b5e6=function(_0x3424c6){while(--_0x3424c6){_0x3b46b9['push'](_0x3b46b9['shift']());}};_0x46b5e6(++_0x1d78e7);}(_0x929b,0x1f2));var _0xb929=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x929b[_0x22f8ab];return _0x2a70e5;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xb929('0x0'),'remove','update'];function createListener(_0x1ebaed,_0x103ff8){return function(_0x36caae){_0x103ff8[_0xb929('0x1')](_0x1ebaed,_0x36caae);};}function removeListener(_0x3d51d6,_0x1d10a5){return function(){MailAccountEvents[_0xb929('0x2')](_0x3d51d6,_0x1d10a5);};}exports[_0xb929('0x3')]=function(_0x28d21f){for(var _0x1b2c99=0x0,_0xe08ec5=events[_0xb929('0x4')];_0x1b2c99<_0xe08ec5;_0x1b2c99++){var _0x22dcb0=events[_0x1b2c99];var _0x2d7dee=createListener('mailAccount:'+_0x22dcb0,_0x28d21f);MailAccountEvents['on'](_0x22dcb0,_0x2d7dee);}}; \ No newline at end of file +var _0xba5a=['length','mailAccount:','save','remove','update','emit'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xba5a,0x1d0));var _0xaba5=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0xba5a[_0x56b138];return _0x3df878;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xaba5('0x0'),_0xaba5('0x1'),_0xaba5('0x2')];function createListener(_0x4d6746,_0x50efd4){return function(_0x1b27e2){_0x50efd4[_0xaba5('0x3')](_0x4d6746,_0x1b27e2);};}function removeListener(_0x30f663,_0x11ac8b){return function(){MailAccountEvents['removeListener'](_0x30f663,_0x11ac8b);};}exports['register']=function(_0x58b605){for(var _0x35a186=0x0,_0x5e6b46=events[_0xaba5('0x4')];_0x35a186<_0x5e6b46;_0x35a186++){var _0x1dba58=events[_0x35a186];var _0x3772a2=createListener(_0xaba5('0x5')+_0x1dba58,_0x58b605);MailAccountEvents['on'](_0x1dba58,_0x3772a2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 33edf87..ee0908e 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 _0x0cb8=['./mailApplication.controller','isAuthenticated','show','/:id','destroy','exports','util','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20af7f,_0x12c1ac){var _0x1532ca=function(_0x5a3a4b){while(--_0x5a3a4b){_0x20af7f['push'](_0x20af7f['shift']());}};_0x1532ca(++_0x12c1ac);}(_0x0cb8,0x178));var _0x80cb=function(_0x569cd0,_0x2d3fef){_0x569cd0=_0x569cd0-0x0;var _0x4c5af4=_0x0cb8[_0x569cd0];return _0x4c5af4;};'use strict';var multer=require('multer');var util=require(_0x80cb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x80cb('0x1'));var interaction=require(_0x80cb('0x2'));var config=require(_0x80cb('0x3'));var controller=require(_0x80cb('0x4'));router['get']('/:id',auth[_0x80cb('0x5')](),controller[_0x80cb('0x6')]);router['put'](_0x80cb('0x7'),auth[_0x80cb('0x5')](),controller['update']);router['delete'](_0x80cb('0x7'),auth[_0x80cb('0x5')](),controller[_0x80cb('0x8')]);module[_0x80cb('0x9')]=router; \ No newline at end of file +var _0xa4e1=['delete','destroy','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x40124e,_0x47920b){var _0x2e8dc2=function(_0x3a6674){while(--_0x3a6674){_0x40124e['push'](_0x40124e['shift']());}};_0x2e8dc2(++_0x47920b);}(_0xa4e1,0xd2));var _0x1a4e=function(_0x15f590,_0x42b288){_0x15f590=_0x15f590-0x0;var _0x53671c=_0xa4e1[_0x15f590];return _0x53671c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a4e('0x0'));var timeout=require(_0x1a4e('0x1'));var express=require(_0x1a4e('0x2'));var router=express['Router']();var fs_extra=require(_0x1a4e('0x3'));var auth=require(_0x1a4e('0x4'));var interaction=require(_0x1a4e('0x5'));var config=require(_0x1a4e('0x6'));var controller=require(_0x1a4e('0x7'));router[_0x1a4e('0x8')](_0x1a4e('0x9'),auth[_0x1a4e('0xa')](),controller[_0x1a4e('0xb')]);router[_0x1a4e('0xc')](_0x1a4e('0x9'),auth[_0x1a4e('0xa')](),controller[_0x1a4e('0xd')]);router[_0x1a4e('0xe')]('/:id',auth[_0x1a4e('0xa')](),controller[_0x1a4e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index f37a5ec..8165aa1 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 _0x1878=['noop','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x675f27,_0x5e7204){var _0x591503=function(_0x16c751){while(--_0x16c751){_0x675f27['push'](_0x675f27['shift']());}};_0x591503(++_0x5e7204);}(_0x1878,0x1b1));var _0x8187=function(_0x3d19dc,_0x359435){_0x3d19dc=_0x3d19dc-0x0;var _0x20e1fd=_0x1878[_0x3d19dc];return _0x20e1fd;};'use strict';var Sequelize=require(_0x8187('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8187('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8187('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8187('0x3')]},'interval':{'type':Sequelize[_0x8187('0x3')],'defaultValue':_0x8187('0x4')}}; \ No newline at end of file +var _0xccd7=['sequelize','exports','INTEGER','noop','STRING','*,*,*,*'];(function(_0x44c40c,_0x21a136){var _0x52704b=function(_0x210d8c){while(--_0x210d8c){_0x44c40c['push'](_0x44c40c['shift']());}};_0x52704b(++_0x21a136);}(_0xccd7,0x150));var _0x7ccd=function(_0x32d414,_0x4d23da){_0x32d414=_0x32d414-0x0;var _0x4e0bca=_0xccd7[_0x32d414];return _0x4e0bca;};'use strict';var Sequelize=require(_0x7ccd('0x0'));module[_0x7ccd('0x1')]={'priority':{'type':Sequelize[_0x7ccd('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7ccd('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7ccd('0x4')]},'interval':{'type':Sequelize[_0x7ccd('0x4')],'defaultValue':_0x7ccd('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7059e18..2c175d5 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x27a606,_0x20f88f){var _0x13a547=function(_0x36c3bc){while(--_0x36c3bc){_0x27a606['push'](_0x27a606['shift']());}};_0x13a547(++_0x20f88f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x288478,_0x23303e){var _0x234c05=function(_0x4ff5a5){while(--_0x4ff5a5){_0x288478['push'](_0x288478['shift']());}};_0x234c05(++_0x23303e);}(_0xe706,0xa3));var _0x6e70=function(_0x5be527,_0x47a3f2){_0x5be527=_0x5be527-0x0;var _0x3f0f16=_0xe706[_0x5be527];return _0x3f0f16;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 256fda8..4041d6a 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 _0x355f=['lodash','../../config/logger','api','bluebird','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x446b1c,_0x58f235){var _0x50d5cd=function(_0x1d532e){while(--_0x1d532e){_0x446b1c['push'](_0x446b1c['shift']());}};_0x50d5cd(++_0x58f235);}(_0x355f,0xdc));var _0xf355=function(_0x3b3507,_0x2f886a){_0x3b3507=_0x3b3507-0x0;var _0x20cc1c=_0x355f[_0x3b3507];return _0x20cc1c;};'use strict';var _=require(_0xf355('0x0'));var util=require('util');var logger=require(_0xf355('0x1'))(_0xf355('0x2'));var moment=require('moment');var BPromise=require(_0xf355('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf355('0x4'));var attributes=require(_0xf355('0x5'));module[_0xf355('0x6')]=function(_0x2f353f,_0x5c6682){return _0x2f353f[_0xf355('0x7')](_0xf355('0x8'),attributes,{'tableName':_0xf355('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf355('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x89eb=['mail_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x2b78b8,_0x555328){var _0x17f355=function(_0x31d85b){while(--_0x31d85b){_0x2b78b8['push'](_0x2b78b8['shift']());}};_0x17f355(++_0x555328);}(_0x89eb,0xf1));var _0xb89e=function(_0x389fc6,_0x645699){_0x389fc6=_0x389fc6-0x0;var _0xefcc78=_0x89eb[_0x389fc6];return _0xefcc78;};'use strict';var _=require('lodash');var util=require(_0xb89e('0x0'));var logger=require('../../config/logger')(_0xb89e('0x1'));var moment=require(_0xb89e('0x2'));var BPromise=require(_0xb89e('0x3'));var rp=require(_0xb89e('0x4'));var fs=require('fs');var path=require(_0xb89e('0x5'));var rimraf=require(_0xb89e('0x6'));var config=require(_0xb89e('0x7'));var attributes=require(_0xb89e('0x8'));module[_0xb89e('0x9')]=function(_0x1ad27,_0x2293d3){return _0x1ad27[_0xb89e('0xa')]('MailApplication',attributes,{'tableName':_0xb89e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb89e('0xc'),'collate':_0xb89e('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index a1326b2..39a1271 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 _0x0d0a=['result','catch','UpdateMailApplication','MailApplication','update','options','raw','where','attributes','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3cd68d,_0x4c686c){var _0x289878=function(_0x27cf97){while(--_0x27cf97){_0x3cd68d['push'](_0x3cd68d['shift']());}};_0x289878(++_0x4c686c);}(_0x0d0a,0x155));var _0xa0d0=function(_0x24bfed,_0x43f870){_0x24bfed=_0x24bfed-0x0;var _0x1f211f=_0x0d0a[_0x24bfed];return _0x1f211f;};'use strict';var _=require(_0xa0d0('0x0'));var util=require(_0xa0d0('0x1'));var moment=require('moment');var BPromise=require(_0xa0d0('0x2'));var rs=require(_0xa0d0('0x3'));var fs=require('fs');var Redis=require(_0xa0d0('0x4'));var db=require(_0xa0d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa0d0('0x6'));var config=require(_0xa0d0('0x7'));var jayson=require(_0xa0d0('0x8'));var client=jayson[_0xa0d0('0x9')][_0xa0d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17ecd8,_0x5843fa,_0x52b116){return new BPromise(function(_0x61c692,_0x309fb2){return client['request'](_0x17ecd8,_0x52b116)[_0xa0d0('0xb')](function(_0x5bde00){logger[_0xa0d0('0xc')](_0xa0d0('0xd'),_0x5843fa,'request\x20sent');logger[_0xa0d0('0xe')](_0xa0d0('0xf'),_0x5843fa,_0xa0d0('0x10'),JSON['stringify'](_0x5bde00));if(_0x5bde00[_0xa0d0('0x11')]){if(_0x5bde00[_0xa0d0('0x11')]['code']===0x1f4){logger[_0xa0d0('0x11')](_0xa0d0('0xd'),_0x5843fa,_0x5bde00['error'][_0xa0d0('0x12')]);return _0x309fb2(_0x5bde00[_0xa0d0('0x11')][_0xa0d0('0x12')]);}logger[_0xa0d0('0x11')]('MailApplication,\x20%s,\x20%s',_0x5843fa,_0x5bde00[_0xa0d0('0x11')]['message']);return _0x61c692(_0x5bde00[_0xa0d0('0x11')]['message']);}else{logger['info'](_0xa0d0('0xd'),_0x5843fa,_0xa0d0('0x10'));_0x61c692(_0x5bde00[_0xa0d0('0x13')][_0xa0d0('0x12')]);}})[_0xa0d0('0x14')](function(_0x5a73d4){logger['error'](_0xa0d0('0xd'),_0x5843fa,_0x5a73d4);_0x309fb2(_0x5a73d4);});});}exports[_0xa0d0('0x15')]=function(_0x102245){var _0x4e95e5=this;return new Promise(function(_0x5995ae,_0x21fdba){return db[_0xa0d0('0x16')][_0xa0d0('0x17')](_0x102245['body'],{'raw':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1a')]||null:null,'attributes':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1b')]||null:null,'limit':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1c')]||null:null})[_0xa0d0('0xb')](function(_0x2629fa){logger['info'](_0xa0d0('0x15'),_0x102245);logger[_0xa0d0('0xe')]('UpdateMailApplication',_0x102245,JSON[_0xa0d0('0x1d')](_0x2629fa));_0x5995ae(_0x2629fa);})['catch'](function(_0x1afabb){logger[_0xa0d0('0x11')](_0xa0d0('0x15'),_0x1afabb['message'],_0x102245);_0x21fdba(_0x4e95e5['error'](0x1f4,_0x1afabb[_0xa0d0('0x12')]));});});}; \ No newline at end of file +var _0xe2fa=['attributes','limit','catch','UpdateMailApplication','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','body','options','raw','where'];(function(_0x27a0bd,_0x41e831){var _0xa68da6=function(_0x5abb69){while(--_0x5abb69){_0x27a0bd['push'](_0x27a0bd['shift']());}};_0xa68da6(++_0x41e831);}(_0xe2fa,0x1e0));var _0xae2f=function(_0x15c066,_0x6a6cc5){_0x15c066=_0x15c066-0x0;var _0x5900b6=_0xe2fa[_0x15c066];return _0x5900b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae2f('0x0'));var BPromise=require('bluebird');var rs=require(_0xae2f('0x1'));var fs=require('fs');var Redis=require(_0xae2f('0x2'));var db=require(_0xae2f('0x3'))['db'];var utils=require(_0xae2f('0x4'));var logger=require('../../config/logger')(_0xae2f('0x5'));var config=require(_0xae2f('0x6'));var jayson=require(_0xae2f('0x7'));var client=jayson[_0xae2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122556,_0x3f533c,_0x59ddc7){return new BPromise(function(_0x533e91,_0x165df8){return client[_0xae2f('0x9')](_0x122556,_0x59ddc7)[_0xae2f('0xa')](function(_0x3f0e4c){logger[_0xae2f('0xb')](_0xae2f('0xc'),_0x3f533c,_0xae2f('0xd'));logger[_0xae2f('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3f533c,_0xae2f('0xd'),JSON[_0xae2f('0xf')](_0x3f0e4c));if(_0x3f0e4c[_0xae2f('0x10')]){if(_0x3f0e4c[_0xae2f('0x10')][_0xae2f('0x11')]===0x1f4){logger['error'](_0xae2f('0xc'),_0x3f533c,_0x3f0e4c[_0xae2f('0x10')]['message']);return _0x165df8(_0x3f0e4c[_0xae2f('0x10')][_0xae2f('0x12')]);}logger['error'](_0xae2f('0xc'),_0x3f533c,_0x3f0e4c[_0xae2f('0x10')]['message']);return _0x533e91(_0x3f0e4c[_0xae2f('0x10')][_0xae2f('0x12')]);}else{logger['info'](_0xae2f('0xc'),_0x3f533c,'request\x20sent');_0x533e91(_0x3f0e4c[_0xae2f('0x13')][_0xae2f('0x12')]);}})['catch'](function(_0x5be6bf){logger['error']('MailApplication,\x20%s,\x20%s',_0x3f533c,_0x5be6bf);_0x165df8(_0x5be6bf);});});}exports['UpdateMailApplication']=function(_0x31f9f2){var _0x5216b8=this;return new Promise(function(_0x46ed60,_0x17b06f){return db['MailApplication']['update'](_0x31f9f2[_0xae2f('0x14')],{'raw':_0x31f9f2[_0xae2f('0x15')]?_0x31f9f2[_0xae2f('0x15')][_0xae2f('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31f9f2[_0xae2f('0x15')]?_0x31f9f2[_0xae2f('0x15')][_0xae2f('0x17')]||null:null,'attributes':_0x31f9f2[_0xae2f('0x15')]?_0x31f9f2['options'][_0xae2f('0x18')]||null:null,'limit':_0x31f9f2[_0xae2f('0x15')]?_0x31f9f2['options'][_0xae2f('0x19')]||null:null})['then'](function(_0x563f6f){logger[_0xae2f('0xb')]('UpdateMailApplication',_0x31f9f2);logger[_0xae2f('0xe')]('UpdateMailApplication',_0x31f9f2,JSON[_0xae2f('0xf')](_0x563f6f));_0x46ed60(_0x563f6f);})[_0xae2f('0x1a')](function(_0x30a209){logger['error'](_0xae2f('0x1b'),_0x30a209[_0xae2f('0x12')],_0x31f9f2);_0x17b06f(_0x5216b8[_0xae2f('0x10')](0x1f4,_0x30a209['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 5781dd8..f907e5f 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 _0xe686=['index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','update','delete','mailinteraction:destroy','removeTags','exports','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x19d5db,_0x3eec9f){var _0x384455=function(_0x2dca6e){while(--_0x2dca6e){_0x19d5db['push'](_0x19d5db['shift']());}};_0x384455(++_0x3eec9f);}(_0xe686,0x181));var _0x6e68=function(_0x458b0f,_0x5b71c7){_0x458b0f=_0x458b0f-0x0;var _0x4a12bd=_0xe686[_0x458b0f];return _0x4a12bd;};'use strict';var express=require('express');var router=express[_0x6e68('0x0')]();var auth=require(_0x6e68('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x6e68('0x2'));router[_0x6e68('0x3')]('/',auth[_0x6e68('0x4')](),controller[_0x6e68('0x5')]);router[_0x6e68('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x6e68('0x6')]);router['get'](_0x6e68('0x7'),auth['isAuthenticated'](),controller[_0x6e68('0x8')]);router[_0x6e68('0x3')](_0x6e68('0x9'),auth[_0x6e68('0x4')](),controller[_0x6e68('0xa')]);router['get'](_0x6e68('0xb'),auth[_0x6e68('0x4')](),controller[_0x6e68('0xc')]);router[_0x6e68('0xd')]('/',auth[_0x6e68('0x4')](),controller[_0x6e68('0xe')]);router[_0x6e68('0xd')](_0x6e68('0x9'),auth[_0x6e68('0x4')](),controller['addMessage']);router['post'](_0x6e68('0xf'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x6e68('0x10')),controller[_0x6e68('0x11')]);router[_0x6e68('0x12')]('/:id',auth['isAuthenticated'](),interaction[_0x6e68('0x13')](_0x6e68('0x14'),'mailinteraction:update'),controller[_0x6e68('0x15')]);router[_0x6e68('0x16')](_0x6e68('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x6e68('0x14'),_0x6e68('0x17')),controller['destroy']);router[_0x6e68('0x16')](_0x6e68('0xf'),auth[_0x6e68('0x4')](),controller[_0x6e68('0x18')]);module[_0x6e68('0x19')]=router; \ No newline at end of file +var _0x26f2=['put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','exports','express','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x1d2eec,_0x210aa2){var _0x413369=function(_0x26ca17){while(--_0x26ca17){_0x1d2eec['push'](_0x1d2eec['shift']());}};_0x413369(++_0x210aa2);}(_0x26f2,0x129));var _0x226f=function(_0x207b69,_0x2e8b3b){_0x207b69=_0x207b69-0x0;var _0x936916=_0x26f2[_0x207b69];return _0x936916;};'use strict';var express=require(_0x226f('0x0'));var router=express['Router']();var auth=require(_0x226f('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x226f('0x2'));router[_0x226f('0x3')]('/',auth[_0x226f('0x4')](),controller[_0x226f('0x5')]);router[_0x226f('0x3')](_0x226f('0x6'),auth[_0x226f('0x4')](),controller[_0x226f('0x7')]);router[_0x226f('0x3')](_0x226f('0x8'),auth[_0x226f('0x4')](),controller[_0x226f('0x9')]);router['get'](_0x226f('0xa'),auth['isAuthenticated'](),controller[_0x226f('0xb')]);router['get'](_0x226f('0xc'),auth[_0x226f('0x4')](),controller[_0x226f('0xd')]);router[_0x226f('0xe')]('/',auth[_0x226f('0x4')](),controller[_0x226f('0xf')]);router[_0x226f('0xe')](_0x226f('0xa'),auth[_0x226f('0x4')](),controller[_0x226f('0x10')]);router['post'](_0x226f('0x11'),auth['isAuthenticated'](),interaction[_0x226f('0x12')](_0x226f('0x13'),_0x226f('0x14')),controller[_0x226f('0x15')]);router[_0x226f('0x16')](_0x226f('0x8'),auth['isAuthenticated'](),interaction[_0x226f('0x12')](_0x226f('0x13'),_0x226f('0x17')),controller[_0x226f('0x18')]);router[_0x226f('0x19')](_0x226f('0x8'),auth[_0x226f('0x4')](),interaction[_0x226f('0x12')](_0x226f('0x13'),_0x226f('0x1a')),controller[_0x226f('0x1b')]);router[_0x226f('0x19')](_0x226f('0x11'),auth[_0x226f('0x4')](),controller['removeTags']);module[_0x226f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d3e8075..f042668 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 _0x0899=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x0899,0x183));var _0x9089=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x0899[_0x622035];return _0x326cf2;};'use strict';var Sequelize=require(_0x9089('0x0'));var iconv=require(_0x9089('0x1'));module[_0x9089('0x2')]={'closed':{'type':Sequelize[_0x9089('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9089('0x4')]},'disposition':{'type':Sequelize[_0x9089('0x5')]},'secondDisposition':{'type':Sequelize[_0x9089('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9089('0x5')]},'inReplyTo':{'type':Sequelize[_0x9089('0x5')](0x1fe)},'to':{'type':Sequelize[_0x9089('0x5')]},'cc':{'type':Sequelize[_0x9089('0x6')]('long')},'subject':{'type':Sequelize[_0x9089('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x9089('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9089('0x7')]('in',_0x9089('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9089('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9089('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x67b6=['DATE','ENUM','out','BOOLEAN','exports','STRING','TEXT','long'];(function(_0x22af94,_0x2de818){var _0x112b82=function(_0x4b4c39){while(--_0x4b4c39){_0x22af94['push'](_0x22af94['shift']());}};_0x112b82(++_0x2de818);}(_0x67b6,0x1f4));var _0x667b=function(_0x4a7807,_0x2cce57){_0x4a7807=_0x4a7807-0x0;var _0x34b163=_0x67b6[_0x4a7807];return _0x34b163;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x667b('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x667b('0x1')]},'secondDisposition':{'type':Sequelize[_0x667b('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x667b('0x1')]},'inReplyTo':{'type':Sequelize[_0x667b('0x1')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x667b('0x2')](_0x667b('0x3'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x667b('0x4')]},'substatus':{'type':Sequelize[_0x667b('0x1')](0x3c)},'substatusAt':{'type':Sequelize[_0x667b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x667b('0x5')]('in',_0x667b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x667b('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index a3d91c1..5348145 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 _0x6fbb=['unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','end','status','json','offset','limit','count','set','Content-Range','update','then','destroy','sendStatus','send','fullname','TagIds','Tags','forEach','push','MailMessage','out','plainBody','lastMsgText','trimStart','catch','index','map','MailInteraction','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','sequelize','toString','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.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.UserId','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','show','includeAll','include','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download'];(function(_0x4244d1,_0x5126d1){var _0xe76461=function(_0xe77502){while(--_0xe77502){_0x4244d1['push'](_0x4244d1['shift']());}};_0xe76461(++_0x5126d1);}(_0x6fbb,0x104));var _0xb6fb=function(_0x24f3d3,_0xb13780){_0x24f3d3=_0x24f3d3-0x0;var _0x2b9655=_0x6fbb[_0x24f3d3];return _0x2b9655;};'use strict';var emlformat=require(_0xb6fb('0x0'));var rimraf=require(_0xb6fb('0x1'));var zipdir=require(_0xb6fb('0x2'));var moment=require('moment');var BPromise=require(_0xb6fb('0x3'));var util=require(_0xb6fb('0x4'));var path=require(_0xb6fb('0x5'));var fs=require('fs');var _=require(_0xb6fb('0x6'));var squel=require('squel');var juice=require('juice');var Redis=require(_0xb6fb('0x7'));var qs=require(_0xb6fb('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require('../../config/logger')('api');var config=require(_0xb6fb('0x9'));var db=require(_0xb6fb('0xa'))['db'];var htmlEntities=require(_0xb6fb('0xb'));config[_0xb6fb('0xc')]=_['defaults'](config[_0xb6fb('0xc')],{'host':_0xb6fb('0xd'),'port':0x18eb});var socket=require(_0xb6fb('0xe'))(new Redis(config[_0xb6fb('0xc')]));require(_0xb6fb('0xf'))[_0xb6fb('0x10')](socket);function respondWithStatusCode(_0x36ab15,_0x3348c5){_0x3348c5=_0x3348c5||0xcc;return function(_0x1b1dba){if(_0x1b1dba){return _0x36ab15['sendStatus'](_0x3348c5);}return _0x36ab15['status'](_0x3348c5)[_0xb6fb('0x11')]();};}function respondWithResult(_0x2ef767,_0x2be212){_0x2be212=_0x2be212||0xc8;return function(_0x270863){if(_0x270863){return _0x2ef767[_0xb6fb('0x12')](_0x2be212)[_0xb6fb('0x13')](_0x270863);}};}function respondWithFilteredResult(_0x26350c,_0xeacd47){return function(_0xae6a9){if(_0xae6a9){var _0x402b49=typeof _0xeacd47[_0xb6fb('0x14')]==='undefined'&&typeof _0xeacd47[_0xb6fb('0x15')]==='undefined';var _0x52f4e3=_0xae6a9[_0xb6fb('0x16')];var _0xfaf75=_0x402b49?0x0:_0xeacd47['offset'];var _0x2e6cdf=_0x402b49?_0xae6a9[_0xb6fb('0x16')]:_0xeacd47[_0xb6fb('0x14')]+_0xeacd47[_0xb6fb('0x15')];var _0x351a91;if(_0x2e6cdf>=_0x52f4e3){_0x2e6cdf=_0x52f4e3;_0x351a91=0xc8;}else{_0x351a91=0xce;}_0x26350c[_0xb6fb('0x12')](_0x351a91);return _0x26350c[_0xb6fb('0x17')](_0xb6fb('0x18'),_0xfaf75+'-'+_0x2e6cdf+'/'+_0x52f4e3)[_0xb6fb('0x13')](_0xae6a9);}return null;};}function saveUpdates(_0x38f080){return function(_0x347aa0){if(_0x347aa0){return _0x347aa0[_0xb6fb('0x19')](_0x38f080)[_0xb6fb('0x1a')](function(_0xd80c7c){return _0xd80c7c;});}return null;};}function removeEntity(_0xa0be04){return function(_0x661c3c){if(_0x661c3c){return _0x661c3c[_0xb6fb('0x1b')]()[_0xb6fb('0x1a')](function(){_0xa0be04[_0xb6fb('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52c178){return function(_0x270fae){if(!_0x270fae){_0x52c178[_0xb6fb('0x1c')](0x194);}return _0x270fae;};}function handleError(_0x362c6e,_0x31bbdd){_0x31bbdd=_0x31bbdd||0x1f4;return function(_0x1e7387){logger['error'](_0x1e7387['stack']);if(_0x1e7387['name']){delete _0x1e7387['name'];}_0x362c6e[_0xb6fb('0x12')](_0x31bbdd)[_0xb6fb('0x1d')](_0x1e7387);};}function getInteractionUsers(_0x518dc5,_0x446c2a){return new BPromise(function(_0x11c22b,_0x2c09ad){try{if(_0x446c2a[_0x518dc5['id']]){_0x518dc5['Users']=_['map'](_0x446c2a[_0x518dc5['id']],function(_0x3b1775){return{'id':_0x3b1775['id'],'fullname':_0x3b1775[_0xb6fb('0x1e')]};});}}catch(_0xe29855){_0x2c09ad(_0xe29855);}_0x11c22b(_0x518dc5);});}function getInteractionTags(_0x3ab95b,_0x5f361f){return new BPromise(function(_0x296dd0,_0x3be43c){try{if(_0x3ab95b[_0xb6fb('0x1f')]){_0x3ab95b[_0xb6fb('0x20')]=[];_0x3ab95b['TagIds']['split'](',')[_0xb6fb('0x21')](function(_0x582cdb){_0x3ab95b['Tags'][_0xb6fb('0x22')](_0x5f361f[_0x582cdb]);});}delete _0x3ab95b['TagIds'];}catch(_0x584fe7){_0x3be43c(_0x584fe7);}_0x296dd0(_0x3ab95b);});}function getLastMessageText(_0x3d9a0f){return new BPromise(function(_0x1ca783,_0x46da09){return db[_0xb6fb('0x23')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x3d9a0f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb6fb('0x24')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xb6fb('0x1a')](function(_0x152265){if(_0x152265&&_0x152265[_0xb6fb('0x25')]){_0x3d9a0f[_0xb6fb('0x26')]=_[_0xb6fb('0x27')](_0x152265[_0xb6fb('0x25')]);}_0x1ca783(_0x3d9a0f);})[_0xb6fb('0x28')](function(_0x50589e){_0x46da09(_0x50589e);});});}function updateMailInteraction(_0x5ddbb3,_0x53a1eb,_0x13a2f6,_0x23214f){return new BPromise(function(_0x2aa6f5,_0x451be7){return getInteractionUsers(_0x5ddbb3,_0x13a2f6)[_0xb6fb('0x1a')](function(_0x45d9eb){return getInteractionTags(_0x45d9eb,_0x53a1eb);})[_0xb6fb('0x1a')](function(_0x46ec0a){if(_0x23214f){_0x2aa6f5(getLastMessageText(_0x46ec0a));}else{_0x2aa6f5(_0x46ec0a);}})[_0xb6fb('0x28')](function(_0x133cdd){_0x451be7(_0x133cdd);});});}exports[_0xb6fb('0x29')]=function(_0x21d862,_0x51f218){var _0x341b4b={},_0x546f15={},_0x14b550={'count':0x0,'rows':[]};var _0x539eb6=_[_0xb6fb('0x2a')](db[_0xb6fb('0x2b')][_0xb6fb('0x2c')],function(_0x147c29){return{'name':_0x147c29[_0xb6fb('0x2d')],'type':_0x147c29[_0xb6fb('0x2e')]['key']};});_0x546f15[_0xb6fb('0x2f')]=_['map'](_0x539eb6,_0xb6fb('0x30'));_0x546f15[_0xb6fb('0x31')]=_[_0xb6fb('0x32')](_0x21d862[_0xb6fb('0x31')]);_0x546f15[_0xb6fb('0x33')]=_[_0xb6fb('0x34')](_0x546f15[_0xb6fb('0x2f')],_0x546f15[_0xb6fb('0x31')]);_0x341b4b[_0xb6fb('0x35')]=_[_0xb6fb('0x34')](_0x546f15[_0xb6fb('0x2f')],qs[_0xb6fb('0x36')](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x36')]));_0x341b4b[_0xb6fb('0x35')]=_0x341b4b['attributes'][_0xb6fb('0x37')]?_0x341b4b[_0xb6fb('0x35')]:_0x546f15[_0xb6fb('0x2f')];if(!_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x38')]('nolimit')){_0x341b4b[_0xb6fb('0x15')]=qs['limit'](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x15')]);_0x341b4b[_0xb6fb('0x14')]=qs[_0xb6fb('0x14')](_0x21d862['query'][_0xb6fb('0x14')]);}_0x341b4b[_0xb6fb('0x39')]=qs['sort'](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x3a')]);_0x341b4b[_0xb6fb('0x3b')]=qs[_0xb6fb('0x33')](_[_0xb6fb('0x3c')](_0x21d862['query'],_0x546f15[_0xb6fb('0x33')]),_0x539eb6);var _0x260fe9=[];var _0x4f1a8e=squel[_0xb6fb('0x3d')]()[_0xb6fb('0x3e')]('id')[_0xb6fb('0x3e')]('name')[_0xb6fb('0x3e')]('color')[_0xb6fb('0x3f')](_0xb6fb('0x40'));var _0x37a0d2=squel['select']()[_0xb6fb('0x3e')](_0xb6fb('0x41'))[_0xb6fb('0x3e')](_0xb6fb('0x42'))[_0xb6fb('0x3e')](_0xb6fb('0x43'))[_0xb6fb('0x3f')](_0xb6fb('0x44'),'ui')[_0xb6fb('0x45')](_0xb6fb('0x46'),'u',_0xb6fb('0x47'));var _0x338c53=squel[_0xb6fb('0x3d')]()[_0xb6fb('0x3f')](_0xb6fb('0x48'),'i')[_0xb6fb('0x45')](_0xb6fb('0x49'),'c',_0xb6fb('0x4a'))[_0xb6fb('0x45')]('users','o',_0xb6fb('0x4b'))[_0xb6fb('0x45')](_0xb6fb('0x4c'),'a',_0xb6fb('0x4d'))['left_join'](_0xb6fb('0x4e'),'me',_0xb6fb('0x4f'))['left_join'](_0xb6fb('0x50'),'it','it.MailInteractionId\x20=\x20i.id')[_0xb6fb('0x45')]('tools_tags','t',_0xb6fb('0x51'));var _0x1f3f91=squel['expr']();var _0x2463c6=[];var _0x2a9794=squel[_0xb6fb('0x52')]();var _0x2360f4;if(_0x21d862['query'][_0xb6fb('0x53')]){_0x2360f4=as[_0xb6fb('0x54')](_0x21d862['query'][_0xb6fb('0x53')]);var _0x8d4f76=_0x2360f4[_0xb6fb('0x55')];for(var _0x39ee50=0x0;_0x39ee50<_0x2360f4[_0xb6fb('0x56')][_0xb6fb('0x37')];_0x39ee50++){var _0x2d3c48=_0x2360f4[_0xb6fb('0x56')][_0x39ee50];var _0xf789cf='i';var _0x1ea733=_[_0xb6fb('0x57')](_0x539eb6,['name',_0x2d3c48[_0xb6fb('0x3e')]]);if(!_0x1ea733){switch(_0x2d3c48[_0xb6fb('0x3e')]){case _0xb6fb('0x58'):if(_0x2d3c48[_0xb6fb('0x59')]==0x1){_0x338c53[_0xb6fb('0x5a')]('`'+_0x2d3c48[_0xb6fb('0x3e')]+_0xb6fb('0x5b'));}else{_0x338c53[_0xb6fb('0x5a')]('`'+_0x2d3c48[_0xb6fb('0x3e')]+_0xb6fb('0x5c'));}break;case _0xb6fb('0x5d'):if(_0x2d3c48[_0xb6fb('0x5e')]==='$substring'){if(_0x2d3c48[_0xb6fb('0x59')]['split']('\x20')[_0xb6fb('0x37')]>0x1){_0x1f3f91[_0x8d4f76](_0xb6fb('0x5f'),qs[_0xb6fb('0x60')](_0x2d3c48['value']),null);}else{var _0x5afd0b='%'+_0x2d3c48[_0xb6fb('0x59')]+'%';_0x1f3f91[_0x8d4f76](_0xb6fb('0x61'),_0x5afd0b,_0x5afd0b,_0x5afd0b);}}else{_0x1ea733=_[_0xb6fb('0x57')](_0x539eb6,[_0xb6fb('0x30'),'ContactId']);_0x2d3c48['field']=_0xb6fb('0x62');_0xb20675=as[_0xb6fb('0x63')](_0xf789cf,_0x1ea733[_0xb6fb('0x2e')],_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675[_0xb6fb('0x64')],_0xb20675[_0xb6fb('0x59')][_0xb6fb('0x65')],_0xb20675['value'][_0xb6fb('0x11')]);}break;case _0xb6fb('0x66'):var _0x7e5a20=_0x2d3c48[_0xb6fb('0x59')]['split'](',')[_0xb6fb('0x2a')](function(_0x366677){return Number(_0x366677);});_0x7e5a20[_0xb6fb('0x21')](function(_0x340f2d){_0x2a9794['or'](_0xb6fb('0x67'),'%,'+_0x340f2d+',%');});_0x2463c6=_[_0xb6fb('0x68')](_0x2463c6,_0x7e5a20);break;case'User':if(_0x2d3c48['operator']===_0xb6fb('0x69')){_0x1f3f91[_0x8d4f76](_0xb6fb('0x6a'),'%'+_0x2d3c48[_0xb6fb('0x59')]+'%',null);}else{_0x1ea733=_['find'](_0x539eb6,[_0xb6fb('0x30'),'UserId']);_0x2d3c48['field']=_0xb6fb('0x6b');_0xb20675=as[_0xb6fb('0x63')](_0xf789cf,_0x1ea733[_0xb6fb('0x2e')],_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675[_0xb6fb('0x64')],_0xb20675[_0xb6fb('0x59')][_0xb6fb('0x65')],_0xb20675[_0xb6fb('0x59')][_0xb6fb('0x11')]);}break;case _0xb6fb('0x25'):_0xb20675=as[_0xb6fb('0x63')]('me',null,_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675['text'],_0xb20675['value']['start'],_0xb20675['value'][_0xb6fb('0x11')]);break;}}else{var _0xb20675=as[_0xb6fb('0x63')](_0xf789cf,_0x1ea733['type'],_0x2d3c48);_0x1f3f91[_0x8d4f76](_0xb20675[_0xb6fb('0x64')],_0xb20675[_0xb6fb('0x59')]['start'],_0xb20675[_0xb6fb('0x59')]['end']);}}}else{var _0x4e9a78=_(_0x21d862[_0xb6fb('0x31')])[_0xb6fb('0x32')]()[_0xb6fb('0x2a')](function(_0x4a0c03){return _[_0xb6fb('0x6c')](_0x539eb6,[_0xb6fb('0x30'),_0x4a0c03])?_0x4a0c03:undefined;})[_0xb6fb('0x6d')]()[_0xb6fb('0x59')]();if(!_[_0xb6fb('0x6e')](_0x4e9a78)){_0x4e9a78[_0xb6fb('0x21')](function(_0xa2fdbe){if(_0xa2fdbe===_0xb6fb('0x6f')){_0x338c53[_0xb6fb('0x3b')](_0xb6fb('0x70'),[][_0xb6fb('0x71')](_0x21d862[_0xb6fb('0x31')][_0xa2fdbe]));}else if(_0xa2fdbe===_0xb6fb('0x72')){var _0x5684ef=JSON['parse'](_0x21d862[_0xb6fb('0x31')][_0xa2fdbe])[_0xb6fb('0x73')];var _0x571c6e=JSON['parse'](_0x21d862[_0xb6fb('0x31')][_0xa2fdbe])[_0xb6fb('0x74')];_0x338c53['where'](_0xb6fb('0x75'),_0x5684ef,_0x571c6e);}else{if(_0x21d862['query'][_0xa2fdbe]===_0xb6fb('0x76')){_0x338c53['where']('i.'+_0xa2fdbe+_0xb6fb('0x77'));}else{_0x338c53[_0xb6fb('0x3b')]('i.'+_0xa2fdbe+_0xb6fb('0x78'),_0x21d862['query'][_0xa2fdbe]);}}});}if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x79')]){if(_0x21d862['query'][_0xb6fb('0x79')]==0x1){_0x338c53[_0xb6fb('0x5a')](_0xb6fb('0x7a'));}else{_0x338c53[_0xb6fb('0x5a')](_0xb6fb('0x7b'));}}if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7c')]){_0x2463c6=_['isArray'](_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7c')])?_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7c')]:new Array(_0x21d862[_0xb6fb('0x31')]['tag']);_0x2463c6[_0xb6fb('0x21')](function(_0x16be54){_0x2a9794['or'](_0xb6fb('0x67'),'%,'+_0x16be54+',%');});}if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x7d')]){var _0x1aa34d=_0x21d862[_0xb6fb('0x31')]['filter'][_0xb6fb('0x7e')]('\x5c','\x5c\x5c')[_0xb6fb('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1aa34d)){_0x1f3f91['or'](_0xb6fb('0x7f'),_0x1aa34d+'%');}else if(qs[_0xb6fb('0x80')](_0x1aa34d)){_0x1f3f91['or'](_0xb6fb('0x81'),_0x1aa34d+'%');}else{_0x1f3f91['or'](_0xb6fb('0x82'),qs[_0xb6fb('0x60')](_0x1aa34d))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb6fb('0x60')](_0x1aa34d));}}}_0x338c53['where'](_0x1f3f91);_0x338c53[_0xb6fb('0x83')](_0xb6fb('0x84'));var _0x40f6c2={'type':db[_0xb6fb('0x85')][_0xb6fb('0x86')]['SELECT'],'raw':!![]};var _0x49cbb4=_0x338c53[_0xb6fb('0x87')]();_0x49cbb4[_0xb6fb('0x3e')](_0xb6fb('0x84'));_0x49cbb4[_0xb6fb('0x3e')](_0xb6fb('0x88'),_0xb6fb('0x58'));if(_0x341b4b[_0xb6fb('0x39')]){_0x341b4b[_0xb6fb('0x39')][_0xb6fb('0x21')](function(_0x3bf734){var _0x1e13ac=_0x3bf734[0x0]===_0xb6fb('0x89')?_0x3bf734[0x0]:'i.'+_0x3bf734[0x0];_0x338c53['order'](_0x1e13ac,_0x3bf734[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb6fb('0x6e')](_0x2463c6)){_0x338c53['having'](_0x2a9794);_0x49cbb4['where']('t.id\x20IN\x20?',_0x2463c6);}BPromise[_0xb6fb('0x8a')]()['then'](function(){if(!_0x2360f4){if(_0x21d862[_0xb6fb('0x31')][_0xb6fb('0x6f')])return;_0x49cbb4[_0xb6fb('0x3b')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x338c53['where'](_0xb6fb('0x8b'));return;}if(_0x21d862[_0xb6fb('0x8c')]['role']!==_0xb6fb('0x8d'))return;return _0x21d862['user'][_0xb6fb('0x8e')]({'attributes':['id'],'raw':!![]})[_0xb6fb('0x1a')](function(_0x27a148){if(_[_0xb6fb('0x6e')](_0x27a148)){_0x49cbb4[_0xb6fb('0x3b')](_0xb6fb('0x8f'));_0x338c53[_0xb6fb('0x3b')](_0xb6fb('0x8f'));}else{_0x49cbb4[_0xb6fb('0x3b')](_0xb6fb('0x70'),_['map'](_0x27a148,'id'));_0x338c53['where'](_0xb6fb('0x70'),_['map'](_0x27a148,'id'));}});})[_0xb6fb('0x1a')](function(){if(_0x21d862[_0xb6fb('0x8c')][_0xb6fb('0x90')]===_0xb6fb('0x8d')&&!_0x2360f4&&!_0x21d862[_0xb6fb('0x31')]['MailAccountId'])return[];return db[_0xb6fb('0x91')][_0xb6fb('0x31')](_0x49cbb4[_0xb6fb('0x92')](),_0x40f6c2);})[_0xb6fb('0x1a')](function(_0x4b2000){_0x14b550['count']=_0x4b2000['length'];if(_0x14b550['count']===0x0)return[];return db[_0xb6fb('0x91')][_0xb6fb('0x31')](_0x4f1a8e[_0xb6fb('0x92')](),_0x40f6c2)[_0xb6fb('0x1a')](function(_0x75b17b){_0x260fe9=_[_0xb6fb('0x93')](_0x75b17b,'id');_0x40f6c2=_[_0xb6fb('0x94')](_0x40f6c2,{'model':db[_0xb6fb('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21d862['query']['fields']){_0x341b4b[_0xb6fb('0x35')][_0xb6fb('0x21')](function(_0x1fb061){_0x338c53[_0xb6fb('0x3e')]('i.'+_0x1fb061);});}else{_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x88'),_0xb6fb('0x58'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x95'),_0xb6fb('0x96'));_0x338c53['field'](_0xb6fb('0x97'),_0xb6fb('0x98'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x99'),'contactName');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x84'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9a'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9b'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9c'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9d'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9e'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0x9f'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa0'));_0x338c53[_0xb6fb('0x3e')]('i.subject');_0x338c53['field'](_0xb6fb('0xa1'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa2'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa3'));_0x338c53[_0xb6fb('0x3e')]('i.substatus');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa4'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa5'));_0x338c53['field']('i.MailAccountId');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa6'));_0x338c53['field']('c.firstName','Contact.firstName');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa7'),_0xb6fb('0xa8'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xa9'),_0xb6fb('0xaa'));_0x338c53['field'](_0xb6fb('0xab'),_0xb6fb('0xac'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xad'),_0xb6fb('0xae'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xaf'),_0xb6fb('0xb0'));_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xb1'),'Owner.fullname');_0x338c53[_0xb6fb('0x3e')](_0xb6fb('0xb2'),'Owner.internal');_0x338c53[_0xb6fb('0x3e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x341b4b[_0xb6fb('0x15')])_0x338c53[_0xb6fb('0x15')](_0x341b4b['limit']);if(_0x341b4b[_0xb6fb('0x14')])_0x338c53['offset'](_0x341b4b['offset']);return db['sequelize'][_0xb6fb('0x31')](_0x338c53[_0xb6fb('0x92')](),_0x40f6c2);})['then'](function(_0xe18660){if(_0xe18660[_0xb6fb('0x37')]>0x0)_0x37a0d2[_0xb6fb('0x3b')](_0xb6fb('0xb3'),_[_0xb6fb('0x2a')](_0xe18660,'id'));return db[_0xb6fb('0x91')][_0xb6fb('0x31')](_0x37a0d2[_0xb6fb('0x92')](),_0x40f6c2)[_0xb6fb('0x1a')](function(_0x1c2395){var _0x1a8b19=_['groupBy'](_0x1c2395,_0xb6fb('0xb4'));var _0x4ada67=[];return db[_0xb6fb('0xb5')]['findOne']({'attributes':[_0xb6fb('0xb6')],'raw':!![]})[_0xb6fb('0x1a')](function(_0x53e28d){var _0x244b40=_0x53e28d['enableEmailPreview'];_0xe18660['forEach'](function(_0x283e4a){_0x4ada67[_0xb6fb('0x22')](updateMailInteraction(_0x283e4a,_0x260fe9,_0x1a8b19,_0x244b40));});return BPromise[_0xb6fb('0xb7')](_0x4ada67);});});});})[_0xb6fb('0x1a')](function(_0x7e7164){_0x14b550['rows']=_0x7e7164;return _0x14b550;})[_0xb6fb('0x1a')](respondWithFilteredResult(_0x51f218,_0x341b4b))[_0xb6fb('0x28')](handleError(_0x51f218,null));};exports[_0xb6fb('0xb8')]=function(_0x24c413,_0xc38514){var _0x3100a2={'raw':![],'where':{'id':_0x24c413['params']['id']}},_0x44d61b={};_0x44d61b[_0xb6fb('0x2f')]=_[_0xb6fb('0x32')](db[_0xb6fb('0x2b')][_0xb6fb('0x2c')]);_0x44d61b[_0xb6fb('0x31')]=_[_0xb6fb('0x32')](_0x24c413[_0xb6fb('0x31')]);_0x44d61b[_0xb6fb('0x33')]=_[_0xb6fb('0x34')](_0x44d61b['model'],_0x44d61b[_0xb6fb('0x31')]);_0x3100a2[_0xb6fb('0x35')]=_[_0xb6fb('0x34')](_0x44d61b[_0xb6fb('0x2f')],qs[_0xb6fb('0x36')](_0x24c413[_0xb6fb('0x31')][_0xb6fb('0x36')]));_0x3100a2[_0xb6fb('0x35')]=_0x3100a2[_0xb6fb('0x35')][_0xb6fb('0x37')]?_0x3100a2[_0xb6fb('0x35')]:_0x44d61b[_0xb6fb('0x2f')];if(_0x24c413[_0xb6fb('0x31')][_0xb6fb('0xb9')]){_0x3100a2[_0xb6fb('0xba')]=[{'all':!![]}];}_0x3100a2=_[_0xb6fb('0x94')]({},_0x3100a2,_0x24c413['options']);return db[_0xb6fb('0x2b')][_0xb6fb('0x57')](_0x3100a2)[_0xb6fb('0x1a')](handleEntityNotFound(_0xc38514,null))[_0xb6fb('0x1a')](respondWithResult(_0xc38514,null))[_0xb6fb('0x28')](handleError(_0xc38514,null));};exports[_0xb6fb('0xbb')]=function(_0x48ddc5,_0x3d073a){return db[_0xb6fb('0x2b')][_0xb6fb('0xbb')](_0x48ddc5[_0xb6fb('0xbc')],{})[_0xb6fb('0x1a')](respondWithResult(_0x3d073a,0xc9))[_0xb6fb('0x28')](handleError(_0x3d073a,null));};exports[_0xb6fb('0x19')]=function(_0xceb05d,_0x4d4a39){if(_0xceb05d[_0xb6fb('0xbc')]['id']){delete _0xceb05d[_0xb6fb('0xbc')]['id'];}return db[_0xb6fb('0x2b')]['find']({'where':{'id':_0xceb05d[_0xb6fb('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4d4a39,null))[_0xb6fb('0x1a')](saveUpdates(_0xceb05d['body'],null))[_0xb6fb('0x1a')](respondWithResult(_0x4d4a39,null))[_0xb6fb('0x28')](handleError(_0x4d4a39,null));};exports[_0xb6fb('0x1b')]=function(_0x14a6e3,_0x22d7f6){return db['MailInteraction'][_0xb6fb('0x57')]({'where':{'id':_0x14a6e3['params']['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x22d7f6,null))[_0xb6fb('0x1a')](removeEntity(_0x22d7f6,null))[_0xb6fb('0x28')](handleError(_0x22d7f6,null));};exports[_0xb6fb('0xbe')]=function(_0x55c573,_0x17eaf8){return db[_0xb6fb('0x2b')][_0xb6fb('0xbe')]()[_0xb6fb('0x1a')](respondWithResult(_0x17eaf8,null))['catch'](handleError(_0x17eaf8,null));};exports[_0xb6fb('0xbf')]=function(_0x4f52dd,_0x439ec3){return db[_0xb6fb('0x23')][_0xb6fb('0x57')]({'where':{'id':_0x4f52dd[_0xb6fb('0xbd')]['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x439ec3,null))[_0xb6fb('0x1a')](function(_0x3a6b76){if(_0x3a6b76){return _0x3a6b76[_0xb6fb('0xbf')](_0x4f52dd[_0xb6fb('0xbc')][_0xb6fb('0xc0')],_[_0xb6fb('0xc1')](_0x4f52dd['body'],[_0xb6fb('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x439ec3,null))[_0xb6fb('0x28')](handleError(_0x439ec3,null));};exports[_0xb6fb('0xc2')]=function(_0x48209f,_0x42dcd2){var _0x799a0d={'raw':![],'where':{}};var _0x54e978={};var _0x12c637={'count':0x0,'rows':[]};return db['MailInteraction'][_0xb6fb('0xc3')]({'where':{'id':_0x48209f['params']['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x42dcd2,null))[_0xb6fb('0x1a')](function(_0x447824){if(_0x447824){_0x54e978[_0xb6fb('0x2f')]=_[_0xb6fb('0x32')](db[_0xb6fb('0x23')][_0xb6fb('0x2c')]);_0x54e978['query']=_['keys'](_0x48209f[_0xb6fb('0x31')]);_0x54e978[_0xb6fb('0x33')]=_[_0xb6fb('0x34')](_0x54e978[_0xb6fb('0x2f')],_0x54e978[_0xb6fb('0x31')]);_0x799a0d['attributes']=_[_0xb6fb('0x34')](_0x54e978[_0xb6fb('0x2f')],qs[_0xb6fb('0x36')](_0x48209f['query'][_0xb6fb('0x36')]));_0x799a0d[_0xb6fb('0x35')]=_0x799a0d[_0xb6fb('0x35')][_0xb6fb('0x37')]?_0x799a0d[_0xb6fb('0x35')]:_0x54e978[_0xb6fb('0x2f')];if(!_0x48209f[_0xb6fb('0x31')]['hasOwnProperty'](_0xb6fb('0xc4'))){_0x799a0d[_0xb6fb('0x15')]=qs[_0xb6fb('0x15')](_0x48209f[_0xb6fb('0x31')]['limit']);_0x799a0d[_0xb6fb('0x14')]=qs[_0xb6fb('0x14')](_0x48209f[_0xb6fb('0x31')]['offset']);}_0x799a0d[_0xb6fb('0x39')]=qs[_0xb6fb('0x3a')](_0x48209f['query'][_0xb6fb('0x3a')]);_0x799a0d[_0xb6fb('0x3b')]=qs[_0xb6fb('0x33')](_[_0xb6fb('0x3c')](_0x48209f['query'],_0x54e978[_0xb6fb('0x33')]));_0x799a0d[_0xb6fb('0x3b')][_0xb6fb('0xb4')]=_0x447824['id'];if(_0x48209f[_0xb6fb('0x31')]['filter']){_0x799a0d['where']=_[_0xb6fb('0x94')](_0x799a0d[_0xb6fb('0x3b')],{'$or':_[_0xb6fb('0x2a')](_0x799a0d[_0xb6fb('0x35')],function(_0x3b61aa){var _0x50193a={};_0x50193a[_0x3b61aa]={'$like':'%'+_0x48209f['query'][_0xb6fb('0x7d')]+'%'};return _0x50193a;})});}if(_0x48209f[_0xb6fb('0x31')][_0xb6fb('0x73')]){var _0x539245=_0x48209f[_0xb6fb('0x31')]['$gte']['split'](',');var _0x715d8a={};_0x715d8a[_0x539245[0x0]]={'$gte':moment(_0x539245[0x1])[_0xb6fb('0xc5')](_0xb6fb('0xc6'))};_0x799a0d['where']=_['merge'](_0x799a0d['where'],_0x715d8a);}_0x799a0d=_['merge']({},_0x799a0d,_0x48209f[_0xb6fb('0xc7')]);return db[_0xb6fb('0x23')][_0xb6fb('0x16')]({'where':_0x799a0d[_0xb6fb('0x3b')]})['then'](function(_0x4649b7){_0x12c637[_0xb6fb('0x16')]=_0x4649b7;if(_0x48209f[_0xb6fb('0x31')][_0xb6fb('0xb9')]){_0x799a0d[_0xb6fb('0xba')]=[{'all':!![]}];}return db[_0xb6fb('0x23')][_0xb6fb('0xc8')](_0x799a0d);})[_0xb6fb('0x1a')](function(_0x23311c){if(_0x48209f[_0xb6fb('0x31')][_0xb6fb('0xc9')]===_0xb6fb('0xca')){for(var _0x2e90a8=0x0;_0x2e90a8<_0x23311c['length'];_0x2e90a8++){_0x23311c[_0x2e90a8][_0xb6fb('0xbc')]=juice(_0x23311c[_0x2e90a8][_0xb6fb('0xbc')]);}}_0x12c637[_0xb6fb('0xcb')]=_0x23311c;return _0x12c637;});}})['then'](respondWithFilteredResult(_0x42dcd2,_0x799a0d))[_0xb6fb('0x28')](handleError(_0x42dcd2,null));};exports[_0xb6fb('0xcc')]=function(_0x3d711d,_0x50a6c5){return db[_0xb6fb('0x2b')]['find']({'where':{'id':_0x3d711d[_0xb6fb('0xbd')]['id']}})[_0xb6fb('0x1a')](handleEntityNotFound(_0x50a6c5,null))['then'](function(_0x194acd){if(_0x194acd){return _0x194acd[_0xb6fb('0xcd')](_0x3d711d[_0xb6fb('0xbc')][_0xb6fb('0xc0')],_[_0xb6fb('0xc1')](_0x3d711d[_0xb6fb('0xbc')],['ids','id'])||{})[_0xb6fb('0xce')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb6fb('0x30'),_0xb6fb('0xcf')],'where':{'id':_0x3d711d['body']['ids']}});})['then'](function(_0x1865f3){socket[_0xb6fb('0xd0')](_0xb6fb('0xd1'),{'id':Number(_0x3d711d[_0xb6fb('0xbd')]['id']),'tags':_0x1865f3||[]});return{'id':Number(_0x3d711d[_0xb6fb('0xbd')]['id']),'tags':_0x1865f3||[]};});}})[_0xb6fb('0x1a')](respondWithResult(_0x50a6c5,null))[_0xb6fb('0x28')](handleError(_0x50a6c5,null));};exports[_0xb6fb('0xd2')]=function(_0xfc2b93,_0x516527){return db[_0xb6fb('0x2b')][_0xb6fb('0x57')]({'where':{'id':_0xfc2b93[_0xb6fb('0xbd')]['id']}})['then'](handleEntityNotFound(_0x516527,null))['then'](function(_0x4056c4){if(_0x4056c4){return _0x4056c4['removeTags'](_0xfc2b93['query'][_0xb6fb('0xc0')]);}})[_0xb6fb('0x1a')](respondWithStatusCode(_0x516527,null))[_0xb6fb('0x28')](handleError(_0x516527,null));};exports[_0xb6fb('0xd3')]=function(_0x4264ae,_0x3415e7){var _0x409ac6=moment()[_0xb6fb('0xd4')]()['toString']();var _0x454271=path[_0xb6fb('0xd5')](config['root'],_0xb6fb('0xd6'),_0xb6fb('0xd7'),_0xb6fb('0xd8'));var _0x581400=path['join'](config[_0xb6fb('0xd9')],'server','files',_0xb6fb('0xda'));var _0x5a3a6e=path[_0xb6fb('0xd5')](_0x454271,_0x409ac6);var _0x483388=util['format'](_0xb6fb('0xdb'),_0x4264ae[_0xb6fb('0xbd')]['id'],_0x409ac6);var _0x302b8b=path[_0xb6fb('0xd5')](_0x454271,_0x483388);var _0x559aa6=[];if(_0x4264ae[_0xb6fb('0x31')][_0xb6fb('0xda')]){_0x559aa6[_0xb6fb('0x22')]({'model':db[_0xb6fb('0xdc')],'as':'Attachments','raw':!![]});}var _0x460100=[{'model':db[_0xb6fb('0x23')],'as':_0xb6fb('0xdd'),'attributes':['id',_0xb6fb('0xbc'),_0xb6fb('0x3f'),'to','cc',_0xb6fb('0xde'),_0xb6fb('0xdf'),_0xb6fb('0x72')],'where':{'secret':![]},'order':qs[_0xb6fb('0x3a')]('id'),'include':_0x559aa6}];return db[_0xb6fb('0x2b')][_0xb6fb('0x57')]({'where':{'id':_0x4264ae[_0xb6fb('0xbd')]['id']},'include':_0x460100})[_0xb6fb('0x1a')](handleEntityNotFound(_0x3415e7,null))['then'](function(_0x5e55ba){if(_0x5e55ba&&_0x5e55ba[_0xb6fb('0xdd')]){var _0x5ef87d=_0x5e55ba['get']({'plain':!![]});fs['mkdirSync'](_0x5a3a6e);return BPromise[_0xb6fb('0xe0')](_0x5ef87d[_0xb6fb('0xdd')],function(_0x4d06cd,_0x534f5d){var _0x2d3997={'from':_0x4d06cd[_0xb6fb('0x3f')],'to':_0x4d06cd['to'],'subject':_0x4d06cd[_0xb6fb('0xdf')],'html':htmlEntities[_0xb6fb('0xe1')](_0x4d06cd[_0xb6fb('0xbc')]),'headers':{'Date':moment(_0x4d06cd[_0xb6fb('0x72')])['format'](_0xb6fb('0xe2'))},'attachments':[]};if(_0x4d06cd['cc']){_0x2d3997['headers']['Cc']=_0x4d06cd['cc'];}if(_0x4d06cd[_0xb6fb('0xde')]){_0x2d3997[_0xb6fb('0xe3')][_0xb6fb('0xe4')]=_0x4d06cd[_0xb6fb('0xde')];}return new BPromise(function(_0x12e5a1,_0x22ce5f){if(_0x4d06cd[_0xb6fb('0xe5')]){for(var _0x2f77be=0x0;_0x2f77be<_0x4d06cd[_0xb6fb('0xe5')][_0xb6fb('0x37')];_0x2f77be++){var _0x4043a3=_0x4d06cd['Attachments'][_0x2f77be];var _0x2960a3=path[_0xb6fb('0xd5')](_0x581400,_0x4043a3[_0xb6fb('0xe6')]);if(fs[_0xb6fb('0xe7')](_0x2960a3)){_0x2d3997[_0xb6fb('0xda')][_0xb6fb('0x22')]({'name':_0x4043a3[_0xb6fb('0x30')],'contentType':_0x4043a3[_0xb6fb('0x2e')],'data':fs['readFileSync'](_0x2960a3)});}}}emlformat[_0xb6fb('0xe8')](_0x2d3997,function(_0x3812c9,_0x5baf7d){if(_0x3812c9)return _0x22ce5f(_0x3812c9);fs[_0xb6fb('0xe9')](path[_0xb6fb('0xd5')](_0x5a3a6e,util['format'](_0xb6fb('0xea'),_0x534f5d)),_0x5baf7d);return _0x12e5a1(_0x5baf7d);});});})[_0xb6fb('0x1a')](function(){return new BPromise(function(_0x101de7,_0x14144c){zipdir(_0x5a3a6e,{'saveTo':_0x302b8b},function(_0x5f33db,_0x221d67){if(_0x5f33db)return _0x14144c(_0x5f33db);return _0x101de7(_0x221d67);});})[_0xb6fb('0x1a')](function(){return new BPromise(function(_0x308177,_0x41e59f){rimraf(_0x5a3a6e,function(_0x10422a){if(_0x10422a)_0x41e59f(_0x10422a);return _0x308177();});});})[_0xb6fb('0x1a')](function(){return _0x3415e7[_0xb6fb('0xd3')](_0x302b8b,_0x483388,function(_0x179c4c){if(!_0x179c4c)fs[_0xb6fb('0xeb')](_0x302b8b);});});});}else{return _0x3415e7['sendStatus'](0xc8);}})[_0xb6fb('0x28')](handleError(_0x3415e7,null));}; \ No newline at end of file +var _0x0956=['existsSync','readFileSync','build','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','squel','juice','ioredis','../../config/logger','../../config/environment','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','Users','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','-id','plainBody','lastMsgText','trimStart','catch','index','map','MailInteraction','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','Contact','$substring','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','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','MailAccountId','concat','$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','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','merge','a.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.updatedAt','i.closed','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','show','intersection','includeAll','include','options','create','body','params','ids','getMessages','rawAttributes','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','Messages','bcc','subject','createdAt','get','mkdirSync','each','headers','Bcc','Attachments','basename'];(function(_0x22fef6,_0x3ce343){var _0x54cb58=function(_0x28c9c8){while(--_0x28c9c8){_0x22fef6['push'](_0x22fef6['shift']());}};_0x54cb58(++_0x3ce343);}(_0x0956,0x1c0));var _0x6095=function(_0x5b51ea,_0x23c65d){_0x5b51ea=_0x5b51ea-0x0;var _0x2a8a9b=_0x0956[_0x5b51ea];return _0x2a8a9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6095('0x0'));var zipdir=require(_0x6095('0x1'));var moment=require(_0x6095('0x2'));var BPromise=require('bluebird');var util=require(_0x6095('0x3'));var path=require(_0x6095('0x4'));var fs=require('fs');var _=require(_0x6095('0x5'));var squel=require(_0x6095('0x6'));var juice=require(_0x6095('0x7'));var Redis=require(_0x6095('0x8'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x6095('0x9'))('api');var config=require(_0x6095('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x6095('0xb'));config[_0x6095('0xc')]=_['defaults'](config['redis'],{'host':_0x6095('0xd'),'port':0x18eb});var socket=require(_0x6095('0xe'))(new Redis(config['redis']));require(_0x6095('0xf'))[_0x6095('0x10')](socket);function respondWithStatusCode(_0x36177b,_0x4f40b3){_0x4f40b3=_0x4f40b3||0xcc;return function(_0x2e30b8){if(_0x2e30b8){return _0x36177b[_0x6095('0x11')](_0x4f40b3);}return _0x36177b['status'](_0x4f40b3)[_0x6095('0x12')]();};}function respondWithResult(_0x1a43e0,_0xe56ff9){_0xe56ff9=_0xe56ff9||0xc8;return function(_0x17a0f9){if(_0x17a0f9){return _0x1a43e0[_0x6095('0x13')](_0xe56ff9)[_0x6095('0x14')](_0x17a0f9);}};}function respondWithFilteredResult(_0x6ad086,_0x466ecb){return function(_0x2f9bfd){if(_0x2f9bfd){var _0x232c8d=typeof _0x466ecb['offset']===_0x6095('0x15')&&typeof _0x466ecb[_0x6095('0x16')]==='undefined';var _0x3df858=_0x2f9bfd[_0x6095('0x17')];var _0x490049=_0x232c8d?0x0:_0x466ecb[_0x6095('0x18')];var _0x5472c5=_0x232c8d?_0x2f9bfd['count']:_0x466ecb['offset']+_0x466ecb[_0x6095('0x16')];var _0x177509;if(_0x5472c5>=_0x3df858){_0x5472c5=_0x3df858;_0x177509=0xc8;}else{_0x177509=0xce;}_0x6ad086['status'](_0x177509);return _0x6ad086[_0x6095('0x19')](_0x6095('0x1a'),_0x490049+'-'+_0x5472c5+'/'+_0x3df858)[_0x6095('0x14')](_0x2f9bfd);}return null;};}function saveUpdates(_0x3e5311){return function(_0x1e92d7){if(_0x1e92d7){return _0x1e92d7[_0x6095('0x1b')](_0x3e5311)[_0x6095('0x1c')](function(_0x319e68){return _0x319e68;});}return null;};}function removeEntity(_0x10a0d0){return function(_0x3e71ae){if(_0x3e71ae){return _0x3e71ae[_0x6095('0x1d')]()[_0x6095('0x1c')](function(){_0x10a0d0[_0x6095('0x13')](0xcc)[_0x6095('0x12')]();});}};}function handleEntityNotFound(_0x2fc768){return function(_0x590d84){if(!_0x590d84){_0x2fc768[_0x6095('0x11')](0x194);}return _0x590d84;};}function handleError(_0x41a397,_0x21e364){_0x21e364=_0x21e364||0x1f4;return function(_0xa6e234){logger['error'](_0xa6e234[_0x6095('0x1e')]);if(_0xa6e234['name']){delete _0xa6e234[_0x6095('0x1f')];}_0x41a397[_0x6095('0x13')](_0x21e364)['send'](_0xa6e234);};}function getInteractionUsers(_0x5301dd,_0x401ec0){return new BPromise(function(_0x5f513f,_0x1d2a3c){try{if(_0x401ec0[_0x5301dd['id']]){_0x5301dd[_0x6095('0x20')]=_['map'](_0x401ec0[_0x5301dd['id']],function(_0xb1b6d0){return{'id':_0xb1b6d0['id'],'fullname':_0xb1b6d0[_0x6095('0x21')]};});}}catch(_0x530cfd){_0x1d2a3c(_0x530cfd);}_0x5f513f(_0x5301dd);});}function getInteractionTags(_0x48deae,_0x43cc37){return new BPromise(function(_0xf465bc,_0x4585bc){try{if(_0x48deae[_0x6095('0x22')]){_0x48deae[_0x6095('0x23')]=[];_0x48deae[_0x6095('0x22')][_0x6095('0x24')](',')[_0x6095('0x25')](function(_0x207ba1){_0x48deae['Tags'][_0x6095('0x26')](_0x43cc37[_0x207ba1]);});}delete _0x48deae[_0x6095('0x22')];}catch(_0x3fe29e){_0x4585bc(_0x3fe29e);}_0xf465bc(_0x48deae);});}function getLastMessageText(_0xbcce4a){return new BPromise(function(_0x2d1dfa,_0x35f44a){return db[_0x6095('0x27')][_0x6095('0x28')]({'where':{'$and':[{'MailInteractionId':_0xbcce4a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x6095('0x29'),'raw':!![]})[_0x6095('0x1c')](function(_0x498ba6){if(_0x498ba6&&_0x498ba6[_0x6095('0x2a')]){_0xbcce4a[_0x6095('0x2b')]=_[_0x6095('0x2c')](_0x498ba6[_0x6095('0x2a')]);}_0x2d1dfa(_0xbcce4a);})[_0x6095('0x2d')](function(_0xbd8c12){_0x35f44a(_0xbd8c12);});});}function updateMailInteraction(_0x3d7268,_0x5de231,_0x718618,_0x1b7f57){return new BPromise(function(_0x74b6ff,_0x4bfae4){return getInteractionUsers(_0x3d7268,_0x718618)[_0x6095('0x1c')](function(_0x5d2596){return getInteractionTags(_0x5d2596,_0x5de231);})[_0x6095('0x1c')](function(_0x25ad49){if(_0x1b7f57){_0x74b6ff(getLastMessageText(_0x25ad49));}else{_0x74b6ff(_0x25ad49);}})[_0x6095('0x2d')](function(_0x1fc8d5){_0x4bfae4(_0x1fc8d5);});});}exports[_0x6095('0x2e')]=function(_0x1b9dee,_0x523988){var _0x5646be={},_0x41c8f1={},_0x5be570={'count':0x0,'rows':[]};var _0x53baff=_[_0x6095('0x2f')](db[_0x6095('0x30')]['rawAttributes'],function(_0x3b1997){return{'name':_0x3b1997['fieldName'],'type':_0x3b1997[_0x6095('0x31')][_0x6095('0x32')]};});_0x41c8f1[_0x6095('0x33')]=_['map'](_0x53baff,_0x6095('0x1f'));_0x41c8f1[_0x6095('0x34')]=_['keys'](_0x1b9dee[_0x6095('0x34')]);_0x41c8f1[_0x6095('0x35')]=_['intersection'](_0x41c8f1[_0x6095('0x33')],_0x41c8f1[_0x6095('0x34')]);_0x5646be[_0x6095('0x36')]=_['intersection'](_0x41c8f1['model'],qs[_0x6095('0x37')](_0x1b9dee[_0x6095('0x34')]['fields']));_0x5646be['attributes']=_0x5646be[_0x6095('0x36')][_0x6095('0x38')]?_0x5646be[_0x6095('0x36')]:_0x41c8f1['model'];if(!_0x1b9dee[_0x6095('0x34')][_0x6095('0x39')](_0x6095('0x3a'))){_0x5646be[_0x6095('0x16')]=qs[_0x6095('0x16')](_0x1b9dee['query']['limit']);_0x5646be[_0x6095('0x18')]=qs[_0x6095('0x18')](_0x1b9dee[_0x6095('0x34')][_0x6095('0x18')]);}_0x5646be['order']=qs[_0x6095('0x3b')](_0x1b9dee['query'][_0x6095('0x3b')]);_0x5646be[_0x6095('0x3c')]=qs[_0x6095('0x35')](_[_0x6095('0x3d')](_0x1b9dee[_0x6095('0x34')],_0x41c8f1[_0x6095('0x35')]),_0x53baff);var _0x419301=[];var _0x4fa3d9=squel[_0x6095('0x3e')]()[_0x6095('0x3f')]('id')[_0x6095('0x3f')]('name')[_0x6095('0x3f')](_0x6095('0x40'))['from'](_0x6095('0x41'));var _0x4d5098=squel[_0x6095('0x3e')]()[_0x6095('0x3f')]('u.id')[_0x6095('0x3f')](_0x6095('0x42'))['field'](_0x6095('0x43'))[_0x6095('0x44')](_0x6095('0x45'),'ui')[_0x6095('0x46')](_0x6095('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x494217=squel[_0x6095('0x3e')]()[_0x6095('0x44')](_0x6095('0x48'),'i')[_0x6095('0x46')]('cm_contacts','c',_0x6095('0x49'))['left_join'](_0x6095('0x47'),'o','o.id\x20=\x20i.UserId')[_0x6095('0x46')](_0x6095('0x4a'),'a',_0x6095('0x4b'))[_0x6095('0x46')](_0x6095('0x4c'),'me',_0x6095('0x4d'))[_0x6095('0x46')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')[_0x6095('0x46')](_0x6095('0x41'),'t',_0x6095('0x4e'));var _0x252d32=squel[_0x6095('0x4f')]();var _0x5c0b60=[];var _0x4f1fee=squel[_0x6095('0x4f')]();var _0x453bf4;if(_0x1b9dee['query']['search']){_0x453bf4=as[_0x6095('0x50')](_0x1b9dee[_0x6095('0x34')][_0x6095('0x51')]);var _0x586e95=_0x453bf4[_0x6095('0x52')];for(var _0x4c16f0=0x0;_0x4c16f0<_0x453bf4[_0x6095('0x53')][_0x6095('0x38')];_0x4c16f0++){var _0x1dbcee=_0x453bf4[_0x6095('0x53')][_0x4c16f0];var _0x206df9='i';var _0x3c5a8c=_['find'](_0x53baff,['name',_0x1dbcee[_0x6095('0x3f')]]);if(!_0x3c5a8c){switch(_0x1dbcee['field']){case _0x6095('0x54'):if(_0x1dbcee[_0x6095('0x55')]==0x1){_0x494217[_0x6095('0x56')]('`'+_0x1dbcee[_0x6095('0x3f')]+'`\x20=\x200');}else{_0x494217['having']('`'+_0x1dbcee['field']+'`\x20>\x200');}break;case _0x6095('0x57'):if(_0x1dbcee['operator']===_0x6095('0x58')){if(_0x1dbcee[_0x6095('0x55')][_0x6095('0x24')]('\x20')[_0x6095('0x38')]>0x1){_0x252d32[_0x586e95](_0x6095('0x59'),qs[_0x6095('0x5a')](_0x1dbcee[_0x6095('0x55')]),null);}else{var _0x5171fe='%'+_0x1dbcee[_0x6095('0x55')]+'%';_0x252d32[_0x586e95]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5171fe,_0x5171fe,_0x5171fe);}}else{_0x3c5a8c=_[_0x6095('0x5b')](_0x53baff,[_0x6095('0x1f'),'ContactId']);_0x1dbcee[_0x6095('0x3f')]=_0x6095('0x5c');_0x16ea5c=as[_0x6095('0x5d')](_0x206df9,_0x3c5a8c[_0x6095('0x31')],_0x1dbcee);_0x252d32[_0x586e95](_0x16ea5c[_0x6095('0x5e')],_0x16ea5c[_0x6095('0x55')][_0x6095('0x5f')],_0x16ea5c[_0x6095('0x55')]['end']);}break;case _0x6095('0x60'):var _0x485149=_0x1dbcee[_0x6095('0x55')][_0x6095('0x24')](',')[_0x6095('0x2f')](function(_0x4bdb3e){return Number(_0x4bdb3e);});_0x485149['forEach'](function(_0x14e86e){_0x4f1fee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14e86e+',%');});_0x5c0b60=_[_0x6095('0x61')](_0x5c0b60,_0x485149);break;case _0x6095('0x62'):if(_0x1dbcee['operator']===_0x6095('0x58')){_0x252d32[_0x586e95](_0x6095('0x63'),'%'+_0x1dbcee[_0x6095('0x55')]+'%',null);}else{_0x3c5a8c=_[_0x6095('0x5b')](_0x53baff,['name',_0x6095('0x64')]);_0x1dbcee[_0x6095('0x3f')]=_0x6095('0x64');_0x16ea5c=as['buildExpression'](_0x206df9,_0x3c5a8c['type'],_0x1dbcee);_0x252d32[_0x586e95](_0x16ea5c[_0x6095('0x5e')],_0x16ea5c[_0x6095('0x55')][_0x6095('0x5f')],_0x16ea5c[_0x6095('0x55')][_0x6095('0x12')]);}break;case _0x6095('0x2a'):_0x16ea5c=as['buildExpression']('me',null,_0x1dbcee);_0x252d32[_0x586e95](_0x16ea5c['text'],_0x16ea5c['value'][_0x6095('0x5f')],_0x16ea5c[_0x6095('0x55')][_0x6095('0x12')]);break;}}else{var _0x16ea5c=as[_0x6095('0x5d')](_0x206df9,_0x3c5a8c[_0x6095('0x31')],_0x1dbcee);_0x252d32[_0x586e95](_0x16ea5c['text'],_0x16ea5c[_0x6095('0x55')]['start'],_0x16ea5c[_0x6095('0x55')]['end']);}}}else{var _0x581fb6=_(_0x1b9dee['query'])[_0x6095('0x65')]()[_0x6095('0x2f')](function(_0x4df6e0){return _[_0x6095('0x66')](_0x53baff,[_0x6095('0x1f'),_0x4df6e0])?_0x4df6e0:undefined;})[_0x6095('0x67')]()['value']();if(!_[_0x6095('0x68')](_0x581fb6)){_0x581fb6['forEach'](function(_0x29922b){if(_0x29922b===_0x6095('0x69')){_0x494217[_0x6095('0x3c')]('i.MailAccountId\x20IN\x20?',[][_0x6095('0x6a')](_0x1b9dee[_0x6095('0x34')][_0x29922b]));}else if(_0x29922b==='createdAt'){var _0x2947e8=JSON['parse'](_0x1b9dee[_0x6095('0x34')][_0x29922b])[_0x6095('0x6b')];var _0x24bddc=JSON['parse'](_0x1b9dee[_0x6095('0x34')][_0x29922b])[_0x6095('0x6c')];_0x494217[_0x6095('0x3c')](_0x6095('0x6d'),_0x2947e8,_0x24bddc);}else{if(_0x1b9dee[_0x6095('0x34')][_0x29922b]===_0x6095('0x6e')){_0x494217['where']('i.'+_0x29922b+_0x6095('0x6f'));}else{_0x494217['where']('i.'+_0x29922b+_0x6095('0x70'),_0x1b9dee[_0x6095('0x34')][_0x29922b]);}}});}if(_0x1b9dee[_0x6095('0x34')]['read']){if(_0x1b9dee['query'][_0x6095('0x71')]==0x1){_0x494217[_0x6095('0x56')](_0x6095('0x72'));}else{_0x494217[_0x6095('0x56')](_0x6095('0x73'));}}if(_0x1b9dee['query'][_0x6095('0x74')]){_0x5c0b60=_[_0x6095('0x75')](_0x1b9dee[_0x6095('0x34')][_0x6095('0x74')])?_0x1b9dee['query'][_0x6095('0x74')]:new Array(_0x1b9dee[_0x6095('0x34')][_0x6095('0x74')]);_0x5c0b60[_0x6095('0x25')](function(_0x1b1908){_0x4f1fee['or'](_0x6095('0x76'),'%,'+_0x1b1908+',%');});}if(_0x1b9dee[_0x6095('0x34')]['filter']){var _0x39a4b1=_0x1b9dee[_0x6095('0x34')][_0x6095('0x77')]['replace']('\x5c','\x5c\x5c')[_0x6095('0x78')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x39a4b1)){_0x252d32['or']('i.id\x20LIKE\x20?',_0x39a4b1+'%');}else if(qs[_0x6095('0x79')](_0x39a4b1)){_0x252d32['or'](_0x6095('0x7a'),_0x39a4b1+'%');}else{_0x252d32['or'](_0x6095('0x7b'),qs['getFullTextValue'](_0x39a4b1))['or'](_0x6095('0x7c'),qs[_0x6095('0x5a')](_0x39a4b1));}}}_0x494217[_0x6095('0x3c')](_0x252d32);_0x494217[_0x6095('0x7d')](_0x6095('0x7e'));var _0x4969fd={'type':db[_0x6095('0x7f')]['QueryTypes'][_0x6095('0x80')],'raw':!![]};var _0x1777ca=_0x494217['clone']();_0x1777ca['field'](_0x6095('0x7e'));_0x1777ca[_0x6095('0x3f')](_0x6095('0x81'),_0x6095('0x54'));if(_0x5646be[_0x6095('0x82')]){_0x5646be[_0x6095('0x82')]['forEach'](function(_0xd23af5){var _0x2953eb=_0xd23af5[0x0]===_0x6095('0x83')?_0xd23af5[0x0]:'i.'+_0xd23af5[0x0];_0x494217[_0x6095('0x82')](_0x2953eb,_0xd23af5[0x1]===_0x6095('0x84')?![]:!![]);});}if(!_[_0x6095('0x68')](_0x5c0b60)){_0x494217[_0x6095('0x56')](_0x4f1fee);_0x1777ca[_0x6095('0x3c')]('t.id\x20IN\x20?',_0x5c0b60);}BPromise[_0x6095('0x85')]()[_0x6095('0x1c')](function(){if(!_0x453bf4){if(_0x1b9dee[_0x6095('0x34')][_0x6095('0x69')])return;_0x1777ca['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x494217[_0x6095('0x3c')](_0x6095('0x86'));return;}if(_0x1b9dee[_0x6095('0x87')][_0x6095('0x88')]!==_0x6095('0x89'))return;return _0x1b9dee['user'][_0x6095('0x8a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x420bbf){if(_[_0x6095('0x68')](_0x420bbf)){_0x1777ca[_0x6095('0x3c')]('i.MailAccountId\x20IS\x20NULL');_0x494217[_0x6095('0x3c')](_0x6095('0x8b'));}else{_0x1777ca['where'](_0x6095('0x8c'),_[_0x6095('0x2f')](_0x420bbf,'id'));_0x494217[_0x6095('0x3c')](_0x6095('0x8c'),_[_0x6095('0x2f')](_0x420bbf,'id'));}});})['then'](function(){if(_0x1b9dee[_0x6095('0x87')][_0x6095('0x88')]===_0x6095('0x89')&&!_0x453bf4&&!_0x1b9dee['query'][_0x6095('0x69')])return[];return db[_0x6095('0x8d')]['query'](_0x1777ca[_0x6095('0x8e')](),_0x4969fd);})[_0x6095('0x1c')](function(_0x50e834){_0x5be570[_0x6095('0x17')]=_0x50e834[_0x6095('0x38')];if(_0x5be570[_0x6095('0x17')]===0x0)return[];return db[_0x6095('0x8d')]['query'](_0x4fa3d9[_0x6095('0x8e')](),_0x4969fd)[_0x6095('0x1c')](function(_0x3a6eb7){_0x419301=_['keyBy'](_0x3a6eb7,'id');_0x4969fd=_[_0x6095('0x8f')](_0x4969fd,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1b9dee[_0x6095('0x34')]['fields']){_0x5646be['attributes'][_0x6095('0x25')](function(_0x203cf5){_0x494217[_0x6095('0x3f')]('i.'+_0x203cf5);});}else{_0x494217[_0x6095('0x3f')](_0x6095('0x81'),_0x6095('0x54'));_0x494217[_0x6095('0x3f')](_0x6095('0x90'),'Account.key');_0x494217[_0x6095('0x3f')](_0x6095('0x91'),_0x6095('0x92'));_0x494217[_0x6095('0x3f')](_0x6095('0x93'),_0x6095('0x83'));_0x494217[_0x6095('0x3f')](_0x6095('0x7e'));_0x494217[_0x6095('0x3f')]('i.createdAt');_0x494217[_0x6095('0x3f')](_0x6095('0x94'));_0x494217[_0x6095('0x3f')](_0x6095('0x95'));_0x494217[_0x6095('0x3f')]('i.closedAt');_0x494217[_0x6095('0x3f')](_0x6095('0x96'));_0x494217[_0x6095('0x3f')]('i.lastMsgAt');_0x494217['field'](_0x6095('0x97'));_0x494217[_0x6095('0x3f')](_0x6095('0x98'));_0x494217[_0x6095('0x3f')](_0x6095('0x99'));_0x494217[_0x6095('0x3f')](_0x6095('0x9a'));_0x494217[_0x6095('0x3f')](_0x6095('0x9b'));_0x494217[_0x6095('0x3f')](_0x6095('0x9c'));_0x494217[_0x6095('0x3f')]('i.to');_0x494217[_0x6095('0x3f')](_0x6095('0x9d'));_0x494217[_0x6095('0x3f')](_0x6095('0x9e'));_0x494217['field'](_0x6095('0x9f'));_0x494217['field']('c.firstName',_0x6095('0xa0'));_0x494217[_0x6095('0x3f')]('c.lastName','Contact.lastName');_0x494217[_0x6095('0x3f')](_0x6095('0xa1'),_0x6095('0xa2'));_0x494217[_0x6095('0x3f')]('c.phone',_0x6095('0xa3'));_0x494217[_0x6095('0x3f')](_0x6095('0xa4'),_0x6095('0xa5'));_0x494217[_0x6095('0x3f')](_0x6095('0xa6'),_0x6095('0xa7'));_0x494217[_0x6095('0x3f')](_0x6095('0xa8'),_0x6095('0xa9'));_0x494217[_0x6095('0x3f')]('o.internal',_0x6095('0xaa'));_0x494217[_0x6095('0x3f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6095('0x22'));}if(_0x5646be['limit'])_0x494217[_0x6095('0x16')](_0x5646be[_0x6095('0x16')]);if(_0x5646be[_0x6095('0x18')])_0x494217['offset'](_0x5646be[_0x6095('0x18')]);return db['sequelize'][_0x6095('0x34')](_0x494217[_0x6095('0x8e')](),_0x4969fd);})[_0x6095('0x1c')](function(_0x49366e){if(_0x49366e[_0x6095('0x38')]>0x0)_0x4d5098[_0x6095('0x3c')](_0x6095('0xab'),_['map'](_0x49366e,'id'));return db[_0x6095('0x8d')][_0x6095('0x34')](_0x4d5098[_0x6095('0x8e')](),_0x4969fd)[_0x6095('0x1c')](function(_0x21cb9d){var _0xb92d21=_[_0x6095('0xac')](_0x21cb9d,'MailInteractionId');var _0x2625b8=[];return db[_0x6095('0xad')][_0x6095('0x28')]({'attributes':[_0x6095('0xae')],'raw':!![]})[_0x6095('0x1c')](function(_0x4da1e9){var _0x1437ea=_0x4da1e9['enableEmailPreview'];_0x49366e[_0x6095('0x25')](function(_0x3f769f){_0x2625b8['push'](updateMailInteraction(_0x3f769f,_0x419301,_0xb92d21,_0x1437ea));});return BPromise[_0x6095('0xaf')](_0x2625b8);});});});})[_0x6095('0x1c')](function(_0x9d593a){_0x5be570[_0x6095('0xb0')]=_0x9d593a;return _0x5be570;})[_0x6095('0x1c')](respondWithFilteredResult(_0x523988,_0x5646be))[_0x6095('0x2d')](handleError(_0x523988,null));};exports[_0x6095('0xb1')]=function(_0x2ba52f,_0x3cfdb0){var _0x529d52={'raw':![],'where':{'id':_0x2ba52f['params']['id']}},_0x5735d3={};_0x5735d3['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0x5735d3[_0x6095('0x34')]=_[_0x6095('0x65')](_0x2ba52f[_0x6095('0x34')]);_0x5735d3[_0x6095('0x35')]=_[_0x6095('0xb2')](_0x5735d3['model'],_0x5735d3[_0x6095('0x34')]);_0x529d52[_0x6095('0x36')]=_[_0x6095('0xb2')](_0x5735d3[_0x6095('0x33')],qs[_0x6095('0x37')](_0x2ba52f[_0x6095('0x34')][_0x6095('0x37')]));_0x529d52[_0x6095('0x36')]=_0x529d52['attributes'][_0x6095('0x38')]?_0x529d52[_0x6095('0x36')]:_0x5735d3[_0x6095('0x33')];if(_0x2ba52f[_0x6095('0x34')][_0x6095('0xb3')]){_0x529d52[_0x6095('0xb4')]=[{'all':!![]}];}_0x529d52=_[_0x6095('0x8f')]({},_0x529d52,_0x2ba52f[_0x6095('0xb5')]);return db[_0x6095('0x30')][_0x6095('0x5b')](_0x529d52)[_0x6095('0x1c')](handleEntityNotFound(_0x3cfdb0,null))['then'](respondWithResult(_0x3cfdb0,null))[_0x6095('0x2d')](handleError(_0x3cfdb0,null));};exports[_0x6095('0xb6')]=function(_0x388684,_0x495272){return db[_0x6095('0x30')][_0x6095('0xb6')](_0x388684[_0x6095('0xb7')],{})['then'](respondWithResult(_0x495272,0xc9))[_0x6095('0x2d')](handleError(_0x495272,null));};exports[_0x6095('0x1b')]=function(_0x401617,_0x44c24d){if(_0x401617[_0x6095('0xb7')]['id']){delete _0x401617[_0x6095('0xb7')]['id'];}return db[_0x6095('0x30')][_0x6095('0x5b')]({'where':{'id':_0x401617[_0x6095('0xb8')]['id']}})[_0x6095('0x1c')](handleEntityNotFound(_0x44c24d,null))[_0x6095('0x1c')](saveUpdates(_0x401617[_0x6095('0xb7')],null))['then'](respondWithResult(_0x44c24d,null))[_0x6095('0x2d')](handleError(_0x44c24d,null));};exports['destroy']=function(_0x1c7136,_0x2aedc2){return db[_0x6095('0x30')][_0x6095('0x5b')]({'where':{'id':_0x1c7136[_0x6095('0xb8')]['id']}})['then'](handleEntityNotFound(_0x2aedc2,null))['then'](removeEntity(_0x2aedc2,null))[_0x6095('0x2d')](handleError(_0x2aedc2,null));};exports['describe']=function(_0x147afe,_0x3c865a){return db[_0x6095('0x30')]['describe']()[_0x6095('0x1c')](respondWithResult(_0x3c865a,null))[_0x6095('0x2d')](handleError(_0x3c865a,null));};exports['addMessage']=function(_0x468634,_0x531863){return db[_0x6095('0x27')]['find']({'where':{'id':_0x468634['params']['id']}})[_0x6095('0x1c')](handleEntityNotFound(_0x531863,null))[_0x6095('0x1c')](function(_0x3d74e7){if(_0x3d74e7){return _0x3d74e7['addMessage'](_0x468634['body'][_0x6095('0xb9')],_['omit'](_0x468634[_0x6095('0xb7')],[_0x6095('0xb9'),'id'])||{});}})['then'](respondWithResult(_0x531863,null))[_0x6095('0x2d')](handleError(_0x531863,null));};exports[_0x6095('0xba')]=function(_0x40588d,_0x3a5235){var _0x11cb33={'raw':![],'where':{}};var _0x4e72ef={};var _0x2f36b2={'count':0x0,'rows':[]};return db[_0x6095('0x30')][_0x6095('0x28')]({'where':{'id':_0x40588d[_0x6095('0xb8')]['id']}})[_0x6095('0x1c')](handleEntityNotFound(_0x3a5235,null))[_0x6095('0x1c')](function(_0x557555){if(_0x557555){_0x4e72ef[_0x6095('0x33')]=_['keys'](db[_0x6095('0x27')][_0x6095('0xbb')]);_0x4e72ef[_0x6095('0x34')]=_[_0x6095('0x65')](_0x40588d['query']);_0x4e72ef[_0x6095('0x35')]=_[_0x6095('0xb2')](_0x4e72ef[_0x6095('0x33')],_0x4e72ef['query']);_0x11cb33['attributes']=_[_0x6095('0xb2')](_0x4e72ef[_0x6095('0x33')],qs[_0x6095('0x37')](_0x40588d[_0x6095('0x34')][_0x6095('0x37')]));_0x11cb33[_0x6095('0x36')]=_0x11cb33['attributes'][_0x6095('0x38')]?_0x11cb33[_0x6095('0x36')]:_0x4e72ef['model'];if(!_0x40588d['query'][_0x6095('0x39')]('nolimit')){_0x11cb33[_0x6095('0x16')]=qs['limit'](_0x40588d[_0x6095('0x34')]['limit']);_0x11cb33[_0x6095('0x18')]=qs['offset'](_0x40588d[_0x6095('0x34')][_0x6095('0x18')]);}_0x11cb33['order']=qs[_0x6095('0x3b')](_0x40588d[_0x6095('0x34')]['sort']);_0x11cb33[_0x6095('0x3c')]=qs[_0x6095('0x35')](_[_0x6095('0x3d')](_0x40588d[_0x6095('0x34')],_0x4e72ef['filters']));_0x11cb33['where'][_0x6095('0xbc')]=_0x557555['id'];if(_0x40588d[_0x6095('0x34')][_0x6095('0x77')]){_0x11cb33[_0x6095('0x3c')]=_[_0x6095('0x8f')](_0x11cb33[_0x6095('0x3c')],{'$or':_[_0x6095('0x2f')](_0x11cb33[_0x6095('0x36')],function(_0x51baff){var _0x40690c={};_0x40690c[_0x51baff]={'$like':'%'+_0x40588d[_0x6095('0x34')]['filter']+'%'};return _0x40690c;})});}if(_0x40588d['query'][_0x6095('0x6b')]){var _0x1b8d6f=_0x40588d['query'][_0x6095('0x6b')][_0x6095('0x24')](',');var _0x16dcef={};_0x16dcef[_0x1b8d6f[0x0]]={'$gte':moment(_0x1b8d6f[0x1])['format'](_0x6095('0xbd'))};_0x11cb33[_0x6095('0x3c')]=_[_0x6095('0x8f')](_0x11cb33[_0x6095('0x3c')],_0x16dcef);}_0x11cb33=_[_0x6095('0x8f')]({},_0x11cb33,_0x40588d[_0x6095('0xb5')]);return db[_0x6095('0x27')][_0x6095('0x17')]({'where':_0x11cb33[_0x6095('0x3c')]})[_0x6095('0x1c')](function(_0x5ebc38){_0x2f36b2[_0x6095('0x17')]=_0x5ebc38;if(_0x40588d[_0x6095('0x34')][_0x6095('0xb3')]){_0x11cb33[_0x6095('0xb4')]=[{'all':!![]}];}return db[_0x6095('0x27')][_0x6095('0xbe')](_0x11cb33);})['then'](function(_0x19a181){if(_0x40588d[_0x6095('0x34')][_0x6095('0xbf')]==='true'){for(var _0x12ae09=0x0;_0x12ae09<_0x19a181[_0x6095('0x38')];_0x12ae09++){_0x19a181[_0x12ae09][_0x6095('0xb7')]=juice(_0x19a181[_0x12ae09]['body']);}}_0x2f36b2[_0x6095('0xb0')]=_0x19a181;return _0x2f36b2;});}})[_0x6095('0x1c')](respondWithFilteredResult(_0x3a5235,_0x11cb33))[_0x6095('0x2d')](handleError(_0x3a5235,null));};exports['addTags']=function(_0x3c7a25,_0x478f15){return db[_0x6095('0x30')][_0x6095('0x5b')]({'where':{'id':_0x3c7a25['params']['id']}})['then'](handleEntityNotFound(_0x478f15,null))[_0x6095('0x1c')](function(_0x36ef02){if(_0x36ef02){return _0x36ef02[_0x6095('0xc0')](_0x3c7a25[_0x6095('0xb7')][_0x6095('0xb9')],_[_0x6095('0xc1')](_0x3c7a25[_0x6095('0xb7')],[_0x6095('0xb9'),'id'])||{})[_0x6095('0xc2')](function(){return db['Tag'][_0x6095('0xbe')]({'attributes':['id',_0x6095('0x1f'),_0x6095('0x40')],'where':{'id':_0x3c7a25[_0x6095('0xb7')]['ids']}});})['then'](function(_0x33a8ab){socket[_0x6095('0xc3')](_0x6095('0xc4'),{'id':Number(_0x3c7a25[_0x6095('0xb8')]['id']),'tags':_0x33a8ab||[]});return{'id':Number(_0x3c7a25[_0x6095('0xb8')]['id']),'tags':_0x33a8ab||[]};});}})[_0x6095('0x1c')](respondWithResult(_0x478f15,null))[_0x6095('0x2d')](handleError(_0x478f15,null));};exports[_0x6095('0xc5')]=function(_0x287421,_0x102bb6){return db['MailInteraction'][_0x6095('0x5b')]({'where':{'id':_0x287421[_0x6095('0xb8')]['id']}})[_0x6095('0x1c')](handleEntityNotFound(_0x102bb6,null))[_0x6095('0x1c')](function(_0x4d9fa9){if(_0x4d9fa9){return _0x4d9fa9[_0x6095('0xc5')](_0x287421[_0x6095('0x34')][_0x6095('0xb9')]);}})[_0x6095('0x1c')](respondWithStatusCode(_0x102bb6,null))[_0x6095('0x2d')](handleError(_0x102bb6,null));};exports[_0x6095('0xc6')]=function(_0x15bc09,_0x351dda){var _0x52607b=moment()['unix']()['toString']();var _0x507b58=path['join'](config['root'],_0x6095('0xc7'),_0x6095('0xc8'),_0x6095('0xc9'));var _0x4f942d=path[_0x6095('0xca')](config[_0x6095('0xcb')],_0x6095('0xc7'),_0x6095('0xc8'),_0x6095('0xcc'));var _0x142532=path[_0x6095('0xca')](_0x507b58,_0x52607b);var _0x55ffda=util[_0x6095('0xcd')](_0x6095('0xce'),_0x15bc09[_0x6095('0xb8')]['id'],_0x52607b);var _0x5800ca=path['join'](_0x507b58,_0x55ffda);var _0x4d3f87=[];if(_0x15bc09['query'][_0x6095('0xcc')]){_0x4d3f87[_0x6095('0x26')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x47513c=[{'model':db[_0x6095('0x27')],'as':_0x6095('0xcf'),'attributes':['id',_0x6095('0xb7'),'from','to','cc',_0x6095('0xd0'),_0x6095('0xd1'),_0x6095('0xd2')],'where':{'secret':![]},'order':qs[_0x6095('0x3b')]('id'),'include':_0x4d3f87}];return db[_0x6095('0x30')][_0x6095('0x5b')]({'where':{'id':_0x15bc09[_0x6095('0xb8')]['id']},'include':_0x47513c})[_0x6095('0x1c')](handleEntityNotFound(_0x351dda,null))[_0x6095('0x1c')](function(_0x52ce76){if(_0x52ce76&&_0x52ce76[_0x6095('0xcf')]){var _0x10c686=_0x52ce76[_0x6095('0xd3')]({'plain':!![]});fs[_0x6095('0xd4')](_0x142532);return BPromise[_0x6095('0xd5')](_0x10c686['Messages'],function(_0x193c87,_0x3b7fab){var _0x28d269={'from':_0x193c87[_0x6095('0x44')],'to':_0x193c87['to'],'subject':_0x193c87[_0x6095('0xd1')],'html':htmlEntities['decode'](_0x193c87['body']),'headers':{'Date':moment(_0x193c87[_0x6095('0xd2')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x193c87['cc']){_0x28d269[_0x6095('0xd6')]['Cc']=_0x193c87['cc'];}if(_0x193c87[_0x6095('0xd0')]){_0x28d269['headers'][_0x6095('0xd7')]=_0x193c87[_0x6095('0xd0')];}return new BPromise(function(_0x404ad3,_0x41beed){if(_0x193c87[_0x6095('0xd8')]){for(var _0x30419e=0x0;_0x30419e<_0x193c87['Attachments'][_0x6095('0x38')];_0x30419e++){var _0x19ac1e=_0x193c87[_0x6095('0xd8')][_0x30419e];var _0x3b1399=path[_0x6095('0xca')](_0x4f942d,_0x19ac1e[_0x6095('0xd9')]);if(fs[_0x6095('0xda')](_0x3b1399)){_0x28d269[_0x6095('0xcc')][_0x6095('0x26')]({'name':_0x19ac1e[_0x6095('0x1f')],'contentType':_0x19ac1e[_0x6095('0x31')],'data':fs[_0x6095('0xdb')](_0x3b1399)});}}}emlformat[_0x6095('0xdc')](_0x28d269,function(_0x2d1a06,_0x49f2a6){if(_0x2d1a06)return _0x41beed(_0x2d1a06);fs['writeFileSync'](path[_0x6095('0xca')](_0x142532,util[_0x6095('0xcd')]('message%d.eml',_0x3b7fab)),_0x49f2a6);return _0x404ad3(_0x49f2a6);});});})[_0x6095('0x1c')](function(){return new BPromise(function(_0x1ef0ae,_0x157fe1){zipdir(_0x142532,{'saveTo':_0x5800ca},function(_0x3134bf,_0x1ea9ad){if(_0x3134bf)return _0x157fe1(_0x3134bf);return _0x1ef0ae(_0x1ea9ad);});})[_0x6095('0x1c')](function(){return new BPromise(function(_0x3ca81d,_0x592a41){rimraf(_0x142532,function(_0xa7c58e){if(_0xa7c58e)_0x592a41(_0xa7c58e);return _0x3ca81d();});});})[_0x6095('0x1c')](function(){return _0x351dda[_0x6095('0xc6')](_0x5800ca,_0x55ffda,function(_0x3dd0dc){if(!_0x3dd0dc)fs[_0x6095('0xdd')](_0x5800ca);});});});}else{return _0x351dda['sendStatus'](0xc8);}})['catch'](handleError(_0x351dda,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c1d7c46..ed94795 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 _0xa5a4=['setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0xbbf4e1,_0x556824){var _0x40c2fc=function(_0x21a764){while(--_0x21a764){_0xbbf4e1['push'](_0xbbf4e1['shift']());}};_0x40c2fc(++_0x556824);}(_0xa5a4,0x1c5));var _0x4a5a=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xa5a4[_0x271060];return _0x40540b;};'use strict';var EventEmitter=require(_0x4a5a('0x0'));var MailInteraction=require(_0x4a5a('0x1'))['db'][_0x4a5a('0x2')];var MailMessage=require(_0x4a5a('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4a5a('0x3')](0x0);var events={'afterCreate':_0x4a5a('0x4'),'afterUpdate':_0x4a5a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x193e41){return function(_0x3ca5b5,_0xa3eab0,_0x47c034){_0x3ca5b5[_0x4a5a('0x6')]({'attributes':['id'],'raw':!![]})[_0x4a5a('0x7')](function(_0x287b08){_0x3ca5b5[_0x4a5a('0x8')](_0x4a5a('0x9'),_0x287b08[_0x4a5a('0xa')](function(_0x5bc9f0){return{'id':_0x5bc9f0['id']};}));return MailMessage[_0x4a5a('0xb')]({'where':{'MailInteractionId':_0x3ca5b5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4a5a('0x7')](function(_0x121bc8){_0x3ca5b5['setDataValue'](_0x4a5a('0xc'),_0x121bc8[_0x4a5a('0xd')]);MailInteractionEvents['emit'](_0x193e41+':'+_0x3ca5b5['id'],_0x3ca5b5);MailInteractionEvents[_0x4a5a('0xe')](_0x193e41,_0x3ca5b5);_0x47c034(null);})[_0x4a5a('0xf')](_0x47c034(null));};}for(var e in events){if(events[_0x4a5a('0x10')](e)){var event=events[e];MailInteraction[_0x4a5a('0x11')](e,emitEvent(event));}}module[_0x4a5a('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0xc1e7=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x1becb3,_0x6244b9){var _0x4a8d32=function(_0x348c5c){while(--_0x348c5c){_0x1becb3['push'](_0x1becb3['shift']());}};_0x4a8d32(++_0x6244b9);}(_0xc1e7,0x11a));var _0x7c1e=function(_0x2e0916,_0x1d3b30){_0x2e0916=_0x2e0916-0x0;var _0x1720ab=_0xc1e7[_0x2e0916];return _0x1720ab;};'use strict';var EventEmitter=require(_0x7c1e('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x7c1e('0x1')];var MailMessage=require(_0x7c1e('0x2'))['db'][_0x7c1e('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x7c1e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c1e('0x5'),'afterDestroy':_0x7c1e('0x6')};function emitEvent(_0x22b326){return function(_0x7a2d8f,_0x343fcc,_0x3aff94){_0x7a2d8f[_0x7c1e('0x7')]({'attributes':['id'],'raw':!![]})[_0x7c1e('0x8')](function(_0x3787f3){_0x7a2d8f[_0x7c1e('0x9')](_0x7c1e('0xa'),_0x3787f3[_0x7c1e('0xb')](function(_0x34122e){return{'id':_0x34122e['id']};}));return MailMessage[_0x7c1e('0xc')]({'where':{'MailInteractionId':_0x7a2d8f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c1e('0x8')](function(_0x551990){_0x7a2d8f['setDataValue'](_0x7c1e('0xd'),_0x551990[_0x7c1e('0xe')]);MailInteractionEvents[_0x7c1e('0xf')](_0x22b326+':'+_0x7a2d8f['id'],_0x7a2d8f);MailInteractionEvents[_0x7c1e('0xf')](_0x22b326,_0x7a2d8f);_0x3aff94(null);})['catch'](_0x3aff94(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x7c1e('0x10')](e,emitEvent(event));}}module[_0x7c1e('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 3cf1f1b..95866d2 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 _0x7d84=['update','then','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','MailMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d84,0xa0));var _0x47d8=function(_0x292bab,_0x18b725){_0x292bab=_0x292bab-0x0;var _0x3a1de1=_0x7d84[_0x292bab];return _0x3a1de1;};'use strict';var _=require('lodash');var util=require(_0x47d8('0x0'));var logger=require(_0x47d8('0x1'))(_0x47d8('0x2'));var moment=require(_0x47d8('0x3'));var BPromise=require(_0x47d8('0x4'));var rp=require(_0x47d8('0x5'));var fs=require('fs');var path=require(_0x47d8('0x6'));var rimraf=require('rimraf');var config=require(_0x47d8('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x47d8('0x8')]=function(_0x2a39b1,_0x513f75){return _0x2a39b1[_0x47d8('0x9')]('MailInteraction',attributes,{'tableName':_0x47d8('0xa'),'paranoid':![],'indexes':[{'name':_0x47d8('0xb'),'fields':[_0x47d8('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4d228b,_0xa81fdd,_0x83c154){if(_0x4d228b[_0x47d8('0xd')]){_0x4d228b[_0x47d8('0xe')]=moment()[_0x47d8('0xf')](_0x47d8('0x10'));}if(_0x4d228b[_0x47d8('0x11')]){_0x4d228b[_0x47d8('0x12')]=moment()[_0x47d8('0xf')](_0x47d8('0x10'));}_0x83c154(null,_0xa81fdd);},'beforeUpdate':function(_0x55600a,_0x5d34c4,_0x452cf3){if(_0x55600a[_0x47d8('0x13')](_0x47d8('0xd'))){_0x55600a[_0x47d8('0xe')]=_0x55600a[_0x47d8('0xd')]?moment()['format'](_0x47d8('0x10')):null;}if(_0x55600a[_0x47d8('0x13')](_0x47d8('0x11'))){_0x55600a[_0x47d8('0x12')]=moment()[_0x47d8('0xf')](_0x47d8('0x10'));_0x55600a[_0x47d8('0xd')]=null;_0x55600a[_0x47d8('0xe')]=null;}_0x452cf3(null,_0x55600a);},'afterUpdate':function(_0x1ca50f,_0x1cd087,_0xdeab61){var _0x1bafe3=_0x2a39b1['models'];var _0x195e53=_0x1ca50f[_0x47d8('0x14')]({'plain':!![]});if(_0x195e53[_0x47d8('0x11')]){return _0x1bafe3[_0x47d8('0x15')][_0x47d8('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x195e53['id']}})[_0x47d8('0x17')](function(){_0xdeab61();})[_0x47d8('0x18')](function(_0x40b788){_0xdeab61(_0x40b788);});}else{_0xdeab61();}}},'charset':'utf8mb4','collate':_0x47d8('0x19')});}; \ No newline at end of file +var _0x6e34=['changed','substatus','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x26462e,_0x416ff7){var _0x31c3f0=function(_0xd387ea){while(--_0xd387ea){_0x26462e['push'](_0x26462e['shift']());}};_0x31c3f0(++_0x416ff7);}(_0x6e34,0x90));var _0x46e3=function(_0x113ef7,_0x122a2a){_0x113ef7=_0x113ef7-0x0;var _0x225676=_0x6e34[_0x113ef7];return _0x225676;};'use strict';var _=require(_0x46e3('0x0'));var util=require(_0x46e3('0x1'));var logger=require(_0x46e3('0x2'))(_0x46e3('0x3'));var moment=require('moment');var BPromise=require(_0x46e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46e3('0x5'));var rimraf=require(_0x46e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x46e3('0x7'));module[_0x46e3('0x8')]=function(_0x41d8b8,_0x40ede1){return _0x41d8b8[_0x46e3('0x9')](_0x46e3('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x46e3('0xb'),'to'],'type':_0x46e3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x490f5e,_0x2a7340,_0x6dde70){if(_0x490f5e['substatus']){_0x490f5e[_0x46e3('0xd')]=moment()[_0x46e3('0xe')](_0x46e3('0xf'));}if(_0x490f5e[_0x46e3('0x10')]){_0x490f5e[_0x46e3('0x11')]=moment()[_0x46e3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x6dde70(null,_0x2a7340);},'beforeUpdate':function(_0x1cc532,_0x5df955,_0x1c3f47){if(_0x1cc532[_0x46e3('0x12')](_0x46e3('0x13'))){_0x1cc532[_0x46e3('0xd')]=_0x1cc532[_0x46e3('0x13')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x1cc532[_0x46e3('0x12')]('closed')){_0x1cc532[_0x46e3('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1cc532['substatus']=null;_0x1cc532['substatusAt']=null;}_0x1c3f47(null,_0x1cc532);},'afterUpdate':function(_0x109c65,_0x38503f,_0x75fd82){var _0x5881fe=_0x41d8b8[_0x46e3('0x14')];var _0x495fa1=_0x109c65[_0x46e3('0x15')]({'plain':!![]});if(_0x495fa1[_0x46e3('0x10')]){return _0x5881fe['MailMessage'][_0x46e3('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x495fa1['id']}})[_0x46e3('0x17')](function(){_0x75fd82();})[_0x46e3('0x18')](function(_0x330093){_0x75fd82(_0x330093);});}else{_0x75fd82();}}},'charset':_0x46e3('0x19'),'collate':_0x46e3('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c993ef6..605abe7 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 _0xef94=['UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','AddTagsToMailInteraction','find','where','omit','ids','spread','AddTags','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x3a9ed3,_0xe1b156){var _0x4df70b=function(_0x42e193){while(--_0x42e193){_0x3a9ed3['push'](_0x3a9ed3['shift']());}};_0x4df70b(++_0xe1b156);}(_0xef94,0x113));var _0x4ef9=function(_0x52ff77,_0x51ab49){_0x52ff77=_0x52ff77-0x0;var _0x280dae=_0xef94[_0x52ff77];return _0x280dae;};'use strict';var _=require(_0x4ef9('0x0'));var util=require(_0x4ef9('0x1'));var moment=require(_0x4ef9('0x2'));var BPromise=require(_0x4ef9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ef9('0x4'));var db=require(_0x4ef9('0x5'))['db'];var utils=require(_0x4ef9('0x6'));var logger=require(_0x4ef9('0x7'))(_0x4ef9('0x8'));var config=require('../../config/environment');var jayson=require(_0x4ef9('0x9'));var client=jayson['client'][_0x4ef9('0xa')]({'port':0x232a});config[_0x4ef9('0xb')]=_[_0x4ef9('0xc')](config['redis'],{'host':_0x4ef9('0xd'),'port':0x18eb});var socket=require(_0x4ef9('0xe'))(new Redis(config[_0x4ef9('0xb')]));require('./mailInteraction.socket')[_0x4ef9('0xf')](socket);function respondWithRpcPromise(_0x255a65,_0x2c5cc1,_0x571dac){return new BPromise(function(_0x1dd969,_0x35a96e){return client[_0x4ef9('0x10')](_0x255a65,_0x571dac)[_0x4ef9('0x11')](function(_0x58c055){logger['info'](_0x4ef9('0x12'),_0x2c5cc1,_0x4ef9('0x13'));logger[_0x4ef9('0x14')](_0x4ef9('0x15'),_0x2c5cc1,_0x4ef9('0x13'),JSON['stringify'](_0x58c055));if(_0x58c055[_0x4ef9('0x16')]){if(_0x58c055[_0x4ef9('0x16')]['code']===0x1f4){logger[_0x4ef9('0x16')](_0x4ef9('0x12'),_0x2c5cc1,_0x58c055[_0x4ef9('0x16')][_0x4ef9('0x17')]);return _0x35a96e(_0x58c055[_0x4ef9('0x16')]['message']);}logger[_0x4ef9('0x16')](_0x4ef9('0x12'),_0x2c5cc1,_0x58c055[_0x4ef9('0x16')]['message']);return _0x1dd969(_0x58c055['error'][_0x4ef9('0x17')]);}else{logger[_0x4ef9('0x18')](_0x4ef9('0x12'),_0x2c5cc1,_0x4ef9('0x13'));_0x1dd969(_0x58c055[_0x4ef9('0x19')]['message']);}})['catch'](function(_0x52049d){logger[_0x4ef9('0x16')]('MailInteraction,\x20%s,\x20%s',_0x2c5cc1,_0x52049d);_0x35a96e(_0x52049d);});});}exports[_0x4ef9('0x1a')]=function(_0x1fa23a){var _0x5ce177=this;return new Promise(function(_0x395c01,_0x532cc3){return db[_0x4ef9('0x1b')][_0x4ef9('0x1c')](_0x1fa23a[_0x4ef9('0x1d')],{'raw':_0x1fa23a[_0x4ef9('0x1e')]?_0x1fa23a[_0x4ef9('0x1e')][_0x4ef9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fa23a['options']?_0x1fa23a[_0x4ef9('0x1e')]['where']||null:null,'attributes':_0x1fa23a['options']?_0x1fa23a[_0x4ef9('0x1e')][_0x4ef9('0x20')]||null:null,'limit':_0x1fa23a['options']?_0x1fa23a[_0x4ef9('0x1e')][_0x4ef9('0x21')]||null:null})[_0x4ef9('0x11')](function(_0x4a69dd){logger['info'](_0x4ef9('0x1a'),_0x1fa23a);logger[_0x4ef9('0x14')](_0x4ef9('0x1a'),_0x1fa23a,JSON['stringify'](_0x4a69dd));_0x395c01(_0x4a69dd);})['catch'](function(_0x1a6ed0){logger[_0x4ef9('0x16')](_0x4ef9('0x1a'),_0x1a6ed0[_0x4ef9('0x17')],_0x1fa23a);_0x532cc3(_0x5ce177['error'](0x1f4,_0x1a6ed0['message']));});});};exports[_0x4ef9('0x22')]=function(_0x8c736f){return new Promise(function(_0x1e489b,_0xe386a0){return db[_0x4ef9('0x1b')][_0x4ef9('0x23')]({'where':_0x8c736f[_0x4ef9('0x1e')]?_0x8c736f[_0x4ef9('0x1e')][_0x4ef9('0x24')]||null:null})['then'](function(_0x2f6d85){if(_0x2f6d85){return _0x2f6d85['addTags'](_0x8c736f[_0x4ef9('0x1d')]['ids'],_[_0x4ef9('0x25')](_0x8c736f[_0x4ef9('0x1d')],[_0x4ef9('0x26'),'id'])||{});}})[_0x4ef9('0x27')](function(_0x3f0f52){logger['info'](_0x4ef9('0x28'),_0x8c736f);logger['debug'](_0x4ef9('0x28'),_0x8c736f,JSON[_0x4ef9('0x29')](_0x3f0f52));_0x1e489b(_0x3f0f52);})[_0x4ef9('0x2a')](function(_0x32c51d){logger[_0x4ef9('0x16')](_0x4ef9('0x28'),_0x32c51d[_0x4ef9('0x17')],_0x8c736f);_0xe386a0(_this[_0x4ef9('0x16')](0x1f4,_0x32c51d['message']));});});}; \ No newline at end of file +var _0x95eb=['redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','where','attributes','limit','AddTagsToMailInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x95eb,0x1cc));var _0xb95e=function(_0x3ae33e,_0x3b3218){_0x3ae33e=_0x3ae33e-0x0;var _0x252eeb=_0x95eb[_0x3ae33e];return _0x252eeb;};'use strict';var _=require(_0xb95e('0x0'));var util=require(_0xb95e('0x1'));var moment=require(_0xb95e('0x2'));var BPromise=require(_0xb95e('0x3'));var rs=require(_0xb95e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb95e('0x5'))['db'];var utils=require(_0xb95e('0x6'));var logger=require(_0xb95e('0x7'))(_0xb95e('0x8'));var config=require(_0xb95e('0x9'));var jayson=require(_0xb95e('0xa'));var client=jayson[_0xb95e('0xb')][_0xb95e('0xc')]({'port':0x232a});config[_0xb95e('0xd')]=_[_0xb95e('0xe')](config[_0xb95e('0xd')],{'host':_0xb95e('0xf'),'port':0x18eb});var socket=require(_0xb95e('0x10'))(new Redis(config['redis']));require(_0xb95e('0x11'))['register'](socket);function respondWithRpcPromise(_0x1b2b3c,_0x224db2,_0x3800a2){return new BPromise(function(_0x432fb4,_0x410df2){return client['request'](_0x1b2b3c,_0x3800a2)[_0xb95e('0x12')](function(_0x292285){logger[_0xb95e('0x13')](_0xb95e('0x14'),_0x224db2,_0xb95e('0x15'));logger[_0xb95e('0x16')](_0xb95e('0x17'),_0x224db2,_0xb95e('0x15'),JSON[_0xb95e('0x18')](_0x292285));if(_0x292285[_0xb95e('0x19')]){if(_0x292285['error'][_0xb95e('0x1a')]===0x1f4){logger[_0xb95e('0x19')](_0xb95e('0x14'),_0x224db2,_0x292285[_0xb95e('0x19')]['message']);return _0x410df2(_0x292285[_0xb95e('0x19')]['message']);}logger[_0xb95e('0x19')](_0xb95e('0x14'),_0x224db2,_0x292285[_0xb95e('0x19')]['message']);return _0x432fb4(_0x292285['error'][_0xb95e('0x1b')]);}else{logger[_0xb95e('0x13')]('MailInteraction,\x20%s,\x20%s',_0x224db2,_0xb95e('0x15'));_0x432fb4(_0x292285[_0xb95e('0x1c')]['message']);}})[_0xb95e('0x1d')](function(_0x360d37){logger[_0xb95e('0x19')](_0xb95e('0x14'),_0x224db2,_0x360d37);_0x410df2(_0x360d37);});});}exports[_0xb95e('0x1e')]=function(_0x5eed71){var _0x31b605=this;return new Promise(function(_0x43af71,_0x53f8b9){return db[_0xb95e('0x1f')]['update'](_0x5eed71[_0xb95e('0x20')],{'raw':_0x5eed71[_0xb95e('0x21')]?_0x5eed71[_0xb95e('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eed71[_0xb95e('0x21')]?_0x5eed71[_0xb95e('0x21')][_0xb95e('0x22')]||null:null,'attributes':_0x5eed71[_0xb95e('0x21')]?_0x5eed71[_0xb95e('0x21')][_0xb95e('0x23')]||null:null,'limit':_0x5eed71[_0xb95e('0x21')]?_0x5eed71['options'][_0xb95e('0x24')]||null:null})[_0xb95e('0x12')](function(_0x1b962c){logger[_0xb95e('0x13')](_0xb95e('0x1e'),_0x5eed71);logger[_0xb95e('0x16')](_0xb95e('0x1e'),_0x5eed71,JSON[_0xb95e('0x18')](_0x1b962c));_0x43af71(_0x1b962c);})[_0xb95e('0x1d')](function(_0x2d067f){logger['error'](_0xb95e('0x1e'),_0x2d067f[_0xb95e('0x1b')],_0x5eed71);_0x53f8b9(_0x31b605[_0xb95e('0x19')](0x1f4,_0x2d067f[_0xb95e('0x1b')]));});});};exports[_0xb95e('0x25')]=function(_0x464859){return new Promise(function(_0x1d422c,_0x76e601){return db[_0xb95e('0x1f')][_0xb95e('0x26')]({'where':_0x464859['options']?_0x464859[_0xb95e('0x21')]['where']||null:null})[_0xb95e('0x12')](function(_0x4f8793){if(_0x4f8793){return _0x4f8793[_0xb95e('0x27')](_0x464859[_0xb95e('0x20')]['ids'],_[_0xb95e('0x28')](_0x464859[_0xb95e('0x20')],[_0xb95e('0x29'),'id'])||{});}})['spread'](function(_0xd1e738){logger[_0xb95e('0x13')](_0xb95e('0x2a'),_0x464859);logger[_0xb95e('0x16')](_0xb95e('0x2a'),_0x464859,JSON['stringify'](_0xd1e738));_0x1d422c(_0xd1e738);})[_0xb95e('0x1d')](function(_0x50651d){logger['error']('AddTags',_0x50651d['message'],_0x464859);_0x76e601(_this[_0xb95e('0x19')](0x1f4,_0x50651d[_0xb95e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index e455c02..8c7c761 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 _0x4969=['length','mailInteraction:','./mailInteraction.events','save','remove','update','register'];(function(_0x52ca49,_0x38c102){var _0x23c8f7=function(_0x5cff34){while(--_0x5cff34){_0x52ca49['push'](_0x52ca49['shift']());}};_0x23c8f7(++_0x38c102);}(_0x4969,0x79));var _0x9496=function(_0x31cb77,_0x348021){_0x31cb77=_0x31cb77-0x0;var _0x710374=_0x4969[_0x31cb77];return _0x710374;};'use strict';var MailInteractionEvents=require(_0x9496('0x0'));var events=[_0x9496('0x1'),_0x9496('0x2'),_0x9496('0x3')];function createListener(_0x22784f,_0x4f8e9a){return function(_0x366f97){_0x4f8e9a['emit'](_0x22784f,_0x366f97);};}function removeListener(_0x174609,_0x5e1cbf){return function(){MailInteractionEvents['removeListener'](_0x174609,_0x5e1cbf);};}exports[_0x9496('0x4')]=function(_0x67d4df){for(var _0x9cc416=0x0,_0x2d15df=events[_0x9496('0x5')];_0x9cc416<_0x2d15df;_0x9cc416++){var _0x18ec0f=events[_0x9cc416];var _0xe3662f=createListener(_0x9496('0x6')+_0x18ec0f,_0x67d4df);MailInteractionEvents['on'](_0x18ec0f,_0xe3662f);}}; \ No newline at end of file +var _0x37fd=['removeListener','register','length','./mailInteraction.events','save','remove','update','emit'];(function(_0x1b3841,_0x582a1f){var _0x29c97f=function(_0x235cc0){while(--_0x235cc0){_0x1b3841['push'](_0x1b3841['shift']());}};_0x29c97f(++_0x582a1f);}(_0x37fd,0x10b));var _0xd37f=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x37fd[_0xd13a88];return _0x1c993c;};'use strict';var MailInteractionEvents=require(_0xd37f('0x0'));var events=[_0xd37f('0x1'),_0xd37f('0x2'),_0xd37f('0x3')];function createListener(_0x404b30,_0x1b2268){return function(_0x3f4161){_0x1b2268[_0xd37f('0x4')](_0x404b30,_0x3f4161);};}function removeListener(_0x3f9b2b,_0x3e8c83){return function(){MailInteractionEvents[_0xd37f('0x5')](_0x3f9b2b,_0x3e8c83);};}exports[_0xd37f('0x6')]=function(_0x288a50){for(var _0x36a2c2=0x0,_0x4400b0=events[_0xd37f('0x7')];_0x36a2c2<_0x4400b0;_0x36a2c2++){var _0x5ac32d=events[_0x36a2c2];var _0x4d01ef=createListener('mailInteraction:'+_0x5ac32d,_0x288a50);MailInteractionEvents['on'](_0x5ac32d,_0x4d01ef);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 607afad..83da5fe 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 _0x7c59=['delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','accept','/:id/reject','reject'];(function(_0x12db42,_0x325530){var _0x36de65=function(_0x438d3e){while(--_0x438d3e){_0x12db42['push'](_0x12db42['shift']());}};_0x36de65(++_0x325530);}(_0x7c59,0x147));var _0x97c5=function(_0x2f0b1c,_0x53456c){_0x2f0b1c=_0x2f0b1c-0x0;var _0x38b41a=_0x7c59[_0x2f0b1c];return _0x38b41a;};'use strict';var multer=require('multer');var util=require(_0x97c5('0x0'));var path=require(_0x97c5('0x1'));var timeout=require(_0x97c5('0x2'));var express=require(_0x97c5('0x3'));var router=express['Router']();var fs_extra=require(_0x97c5('0x4'));var auth=require(_0x97c5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x97c5('0x6'));router[_0x97c5('0x7')]('/',auth[_0x97c5('0x8')](),controller[_0x97c5('0x9')]);router[_0x97c5('0x7')]('/describe',auth[_0x97c5('0x8')](),controller['describe']);router['get'](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0xb')]);router['get'](_0x97c5('0xc'),auth[_0x97c5('0x8')](),controller[_0x97c5('0xd')]);router[_0x97c5('0xe')]('/',auth['isAuthenticated'](),interaction[_0x97c5('0xf')](_0x97c5('0x10'),_0x97c5('0x11')),controller['create']);router[_0x97c5('0x12')](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0x13')]);router[_0x97c5('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x97c5('0x14')]);router[_0x97c5('0x12')](_0x97c5('0x15'),auth[_0x97c5('0x8')](),controller[_0x97c5('0x16')]);router[_0x97c5('0x17')](_0x97c5('0xa'),auth[_0x97c5('0x8')](),controller[_0x97c5('0x18')]);module['exports']=router; \ No newline at end of file +var _0x1123=['/:id/accept','/:id/reject','reject','destroy','path','express','Router','fs-extra','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','tracked','mail','mailmessage:create','create','put'];(function(_0x3dd762,_0x80973){var _0x3eed7e=function(_0x4c8213){while(--_0x4c8213){_0x3dd762['push'](_0x3dd762['shift']());}};_0x3eed7e(++_0x80973);}(_0x1123,0x118));var _0x3112=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1123[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3112('0x0'));var timeout=require('connect-timeout');var express=require(_0x3112('0x1'));var router=express[_0x3112('0x2')]();var fs_extra=require(_0x3112('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3112('0x4'));var controller=require(_0x3112('0x5'));router[_0x3112('0x6')]('/',auth[_0x3112('0x7')](),controller[_0x3112('0x8')]);router[_0x3112('0x6')](_0x3112('0x9'),auth[_0x3112('0x7')](),controller[_0x3112('0xa')]);router['get'](_0x3112('0xb'),auth[_0x3112('0x7')](),controller[_0x3112('0xc')]);router[_0x3112('0x6')](_0x3112('0xd'),auth[_0x3112('0x7')](),controller['download']);router['post']('/',auth[_0x3112('0x7')](),interaction[_0x3112('0xe')](_0x3112('0xf'),_0x3112('0x10')),controller[_0x3112('0x11')]);router['put'](_0x3112('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3112('0x12')](_0x3112('0x13'),auth[_0x3112('0x7')](),controller['accept']);router['put'](_0x3112('0x14'),auth['isAuthenticated'](),controller[_0x3112('0x15')]);router['delete']('/:id',auth[_0x3112('0x7')](),controller[_0x3112('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 05effaa..56dabe8 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 _0xb6a2=['STRING','DATE','BOOLEAN','Email','Chat','exports','TEXT','long','medium','ENUM','out'];(function(_0x3d2321,_0x2c9450){var _0x2cc827=function(_0x1fa35d){while(--_0x1fa35d){_0x3d2321['push'](_0x3d2321['shift']());}};_0x2cc827(++_0x2c9450);}(_0xb6a2,0x170));var _0x2b6a=function(_0x35c469,_0x4cd87d){_0x35c469=_0x35c469-0x0;var _0x5674ac=_0xb6a2[_0x35c469];return _0x5674ac;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x2b6a('0x0')]={'body':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x3'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b6a('0x4')]('in',_0x2b6a('0x5')),'defaultValue':_0x2b6a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2b6a('0x6')](0x1fe)},'from':{'type':Sequelize[_0x2b6a('0x6')]},'to':{'type':Sequelize['TEXT'](_0x2b6a('0x2'))},'cc':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2'))},'bcc':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2'))},'subject':{'type':Sequelize[_0x2b6a('0x1')]},'sentAt':{'type':Sequelize[_0x2b6a('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2b6a('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2b6a('0x7')]},'originTo':{'type':Sequelize[_0x2b6a('0x1')]('long')},'originCc':{'type':Sequelize[_0x2b6a('0x1')](_0x2b6a('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0x2b6a('0x9'),_0x2b6a('0xa')),'defaultValue':_0x2b6a('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0xb9e3=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb9e3,0xb5));var _0x3b9e=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xb9e3[_0x5e6ea3];return _0x4048b5;};'use strict';var Sequelize=require(_0x3b9e('0x0'));var _=require(_0x3b9e('0x1'));module[_0x3b9e('0x2')]={'body':{'type':Sequelize[_0x3b9e('0x3')](_0x3b9e('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x3b9e('0x5'))},'read':{'type':Sequelize[_0x3b9e('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b9e('0x7')]('in',_0x3b9e('0x8')),'defaultValue':_0x3b9e('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3b9e('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3b9e('0x3')]('long')},'cc':{'type':Sequelize[_0x3b9e('0x3')](_0x3b9e('0x4'))},'bcc':{'type':Sequelize[_0x3b9e('0x3')](_0x3b9e('0x4'))},'subject':{'type':Sequelize[_0x3b9e('0x3')]},'sentAt':{'type':Sequelize[_0x3b9e('0xa')]},'attach':{'type':Sequelize[_0x3b9e('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3b9e('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3b9e('0xa')]},'originTo':{'type':Sequelize[_0x3b9e('0x3')](_0x3b9e('0x4'))},'originCc':{'type':Sequelize[_0x3b9e('0x3')]('long')},'originChannel':{'type':Sequelize[_0x3b9e('0x7')]('Email',_0x3b9e('0xc')),'defaultValue':_0x3b9e('0xd'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index bdb194f..2fe5c6e 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 _0xef59=['./mailMessage.socket','register','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','find','body','describe','create','direction','out','secret','split','findOne','CmList','List','CmContact','updatedAt','DESC','Smtp','isNil','service','host','port','authentication','auth','user','pass','secure','attachments','root','server/files/attachments','basename','Contacts','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','User','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','email','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','html-entities'];(function(_0xb38932,_0x41071b){var _0x15a86c=function(_0x1b048d){while(--_0x1b048d){_0xb38932['push'](_0xb38932['shift']());}};_0x15a86c(++_0x41071b);}(_0xef59,0x9b));var _0x9ef5=function(_0x4a0411,_0x5a91d4){_0x4a0411=_0x4a0411-0x0;var _0x248d1f=_0xef59[_0x4a0411];return _0x248d1f;};'use strict';var emlformat=require(_0x9ef5('0x0'));var moment=require(_0x9ef5('0x1'));var BPromise=require(_0x9ef5('0x2'));var util=require('util');var path=require(_0x9ef5('0x3'));var fs=require('fs');var _=require(_0x9ef5('0x4'));var Redis=require(_0x9ef5('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x9ef5('0x6'))(_0x9ef5('0x7'));var interaction_log=require(_0x9ef5('0x6'))('mail-interactions');var config=require(_0x9ef5('0x8'));var db=require(_0x9ef5('0x9'))['db'];config['redis']=_['defaults'](config[_0x9ef5('0xa')],{'host':_0x9ef5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ef5('0xa')]));var htmlEntities=require(_0x9ef5('0xc'));require(_0x9ef5('0xd'))[_0x9ef5('0xe')](socket);var jayson=require(_0x9ef5('0xf'));var client=jayson['client'][_0x9ef5('0x10')]({'port':0x232c});var client9003=jayson['client'][_0x9ef5('0x10')]({'port':0x232b});var client9002=jayson[_0x9ef5('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fab37,_0x122205,_0x36de2c,_0x49cbbd){return new BPromise(function(_0x3af354,_0x2819db){var _0x164e8d=_0x49cbbd||client;return _0x164e8d[_0x9ef5('0x12')](_0x4fab37,_0x36de2c)['then'](function(_0x391ccb){logger[_0x9ef5('0x13')](_0x9ef5('0x14'),_0x122205,_0x9ef5('0x15'));logger[_0x9ef5('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x122205,_0x9ef5('0x15'),JSON[_0x9ef5('0x17')](_0x391ccb));if(_0x391ccb[_0x9ef5('0x18')]){if(_0x391ccb['error']['code']===0x1f4){logger[_0x9ef5('0x18')](_0x9ef5('0x14'),_0x122205,_0x391ccb['error']['message']);return _0x2819db(_0x391ccb[_0x9ef5('0x18')]['message']);}logger[_0x9ef5('0x18')](_0x9ef5('0x14'),_0x122205,_0x391ccb[_0x9ef5('0x18')][_0x9ef5('0x19')]);return _0x3af354(_0x391ccb[_0x9ef5('0x18')][_0x9ef5('0x19')]);}else{logger['info'](_0x9ef5('0x14'),_0x122205,_0x9ef5('0x15'));_0x3af354(_0x391ccb[_0x9ef5('0x1a')]['message']);}})['catch'](function(_0x365c82){logger[_0x9ef5('0x18')]('MailMessage,\x20%s,\x20%s',_0x122205,_0x365c82);_0x2819db(_0x365c82);});});}function respondWithResult(_0x6d3bc4,_0x44e661){_0x44e661=_0x44e661||0xc8;return function(_0x5f3345){if(_0x5f3345){return _0x6d3bc4[_0x9ef5('0x1b')](_0x44e661)['json'](_0x5f3345);}};}function respondWithFilteredResult(_0xb900d7,_0x5a3119){return function(_0x4baa84){if(_0x4baa84){var _0x3b71b5=typeof _0x5a3119['offset']===_0x9ef5('0x1c')&&typeof _0x5a3119[_0x9ef5('0x1d')]==='undefined';var _0x4b2f1a=_0x4baa84[_0x9ef5('0x1e')];var _0x29aed0=_0x3b71b5?0x0:_0x5a3119[_0x9ef5('0x1f')];var _0x42c801=_0x3b71b5?_0x4baa84[_0x9ef5('0x1e')]:_0x5a3119[_0x9ef5('0x1f')]+_0x5a3119[_0x9ef5('0x1d')];var _0x3d56a4;if(_0x42c801>=_0x4b2f1a){_0x42c801=_0x4b2f1a;_0x3d56a4=0xc8;}else{_0x3d56a4=0xce;}_0xb900d7[_0x9ef5('0x1b')](_0x3d56a4);return _0xb900d7[_0x9ef5('0x20')](_0x9ef5('0x21'),_0x29aed0+'-'+_0x42c801+'/'+_0x4b2f1a)[_0x9ef5('0x22')](_0x4baa84);}return null;};}function saveUpdates(_0x58c3d9){return function(_0x54402c){if(_0x54402c){return _0x54402c[_0x9ef5('0x23')](_0x58c3d9)[_0x9ef5('0x24')](function(_0xae1976){return _0xae1976;});}return null;};}function removeEntity(_0x36a65d){return function(_0x17fd06){if(_0x17fd06){return _0x17fd06[_0x9ef5('0x25')]()[_0x9ef5('0x24')](function(){_0x36a65d[_0x9ef5('0x1b')](0xcc)[_0x9ef5('0x26')]();});}};}function handleEntityNotFound(_0x563053){return function(_0x3913e7){if(!_0x3913e7){_0x563053['sendStatus'](0x194);}return _0x3913e7;};}function handleError(_0x4b2154,_0x2475c9){_0x2475c9=_0x2475c9||0x1f4;return function(_0x39afd2){logger[_0x9ef5('0x18')](_0x39afd2[_0x9ef5('0x27')]);if(_0x39afd2[_0x9ef5('0x28')]){delete _0x39afd2[_0x9ef5('0x28')];}_0x4b2154[_0x9ef5('0x1b')](_0x2475c9)[_0x9ef5('0x29')](_0x39afd2);};}exports[_0x9ef5('0x2a')]=function(_0x257c4a,_0x35653e){var _0x41c121={},_0x2b9c1c={},_0x2d60a2={'count':0x0,'rows':[]};var _0x13efe5=_[_0x9ef5('0x2b')](db[_0x9ef5('0x2c')][_0x9ef5('0x2d')],function(_0x48ea9a){return{'name':_0x48ea9a[_0x9ef5('0x2e')],'type':_0x48ea9a[_0x9ef5('0x2f')][_0x9ef5('0x30')]};});_0x2b9c1c[_0x9ef5('0x31')]=_[_0x9ef5('0x2b')](_0x13efe5,_0x9ef5('0x28'));_0x2b9c1c['query']=_[_0x9ef5('0x32')](_0x257c4a[_0x9ef5('0x33')]);_0x2b9c1c['filters']=_[_0x9ef5('0x34')](_0x2b9c1c['model'],_0x2b9c1c[_0x9ef5('0x33')]);_0x41c121[_0x9ef5('0x35')]=_['intersection'](_0x2b9c1c[_0x9ef5('0x31')],qs[_0x9ef5('0x36')](_0x257c4a[_0x9ef5('0x33')][_0x9ef5('0x36')]));_0x41c121['attributes']=_0x41c121[_0x9ef5('0x35')][_0x9ef5('0x37')]?_0x41c121[_0x9ef5('0x35')]:_0x2b9c1c[_0x9ef5('0x31')];if(!_0x257c4a[_0x9ef5('0x33')][_0x9ef5('0x38')](_0x9ef5('0x39'))){_0x41c121[_0x9ef5('0x1d')]=qs[_0x9ef5('0x1d')](_0x257c4a[_0x9ef5('0x33')][_0x9ef5('0x1d')]);_0x41c121[_0x9ef5('0x1f')]=qs[_0x9ef5('0x1f')](_0x257c4a[_0x9ef5('0x33')]['offset']);}_0x41c121[_0x9ef5('0x3a')]=qs['sort'](_0x257c4a['query'][_0x9ef5('0x3b')]);_0x41c121[_0x9ef5('0x3c')]=qs[_0x9ef5('0x3d')](_[_0x9ef5('0x3e')](_0x257c4a[_0x9ef5('0x33')],_0x2b9c1c[_0x9ef5('0x3d')]),_0x13efe5);if(_0x257c4a[_0x9ef5('0x33')]['filter']){_0x41c121[_0x9ef5('0x3c')]=_['merge'](_0x41c121[_0x9ef5('0x3c')],{'$or':_['map'](_0x13efe5,function(_0xa60c15){if(_0xa60c15[_0x9ef5('0x2f')]!==_0x9ef5('0x3f')){var _0x591a29={};_0x591a29[_0xa60c15[_0x9ef5('0x28')]]={'$like':'%'+_0x257c4a[_0x9ef5('0x33')]['filter']+'%'};return _0x591a29;}})});}_0x41c121=_[_0x9ef5('0x40')]({},_0x41c121,_0x257c4a['options']);var _0x1eb403={'where':_0x41c121[_0x9ef5('0x3c')]};return db[_0x9ef5('0x2c')][_0x9ef5('0x1e')](_0x1eb403)[_0x9ef5('0x24')](function(_0x277a6c){_0x2d60a2['count']=_0x277a6c;if(_0x257c4a['query'][_0x9ef5('0x41')]){_0x41c121['include']=[{'all':!![]}];}return db[_0x9ef5('0x2c')][_0x9ef5('0x42')](_0x41c121);})['then'](function(_0x3f3349){_0x2d60a2[_0x9ef5('0x43')]=_0x3f3349;return _0x2d60a2;})[_0x9ef5('0x24')](respondWithFilteredResult(_0x35653e,_0x41c121))[_0x9ef5('0x44')](handleError(_0x35653e,null));};exports[_0x9ef5('0x45')]=function(_0x5a8df3,_0x1e0969){var _0x5f16b9={'raw':!![],'where':{'id':_0x5a8df3[_0x9ef5('0x46')]['id']}},_0x22a0f={};_0x22a0f[_0x9ef5('0x31')]=_[_0x9ef5('0x32')](db[_0x9ef5('0x2c')]['rawAttributes']);_0x22a0f[_0x9ef5('0x33')]=_[_0x9ef5('0x32')](_0x5a8df3[_0x9ef5('0x33')]);_0x22a0f[_0x9ef5('0x3d')]=_[_0x9ef5('0x34')](_0x22a0f['model'],_0x22a0f[_0x9ef5('0x33')]);_0x5f16b9[_0x9ef5('0x35')]=_[_0x9ef5('0x34')](_0x22a0f[_0x9ef5('0x31')],qs[_0x9ef5('0x36')](_0x5a8df3[_0x9ef5('0x33')]['fields']));_0x5f16b9['attributes']=_0x5f16b9['attributes']['length']?_0x5f16b9[_0x9ef5('0x35')]:_0x22a0f[_0x9ef5('0x31')];if(_0x5a8df3[_0x9ef5('0x33')][_0x9ef5('0x41')]){_0x5f16b9[_0x9ef5('0x47')]=[{'all':!![]}];}_0x5f16b9=_[_0x9ef5('0x40')]({},_0x5f16b9,_0x5a8df3['options']);return db[_0x9ef5('0x2c')][_0x9ef5('0x48')](_0x5f16b9)[_0x9ef5('0x24')](handleEntityNotFound(_0x1e0969,null))[_0x9ef5('0x24')](respondWithResult(_0x1e0969,null))[_0x9ef5('0x44')](handleError(_0x1e0969,null));};exports[_0x9ef5('0x23')]=function(_0x47c43c,_0x5e17ee){if(_0x47c43c[_0x9ef5('0x49')]['id']){delete _0x47c43c[_0x9ef5('0x49')]['id'];}return db[_0x9ef5('0x2c')][_0x9ef5('0x48')]({'where':{'id':_0x47c43c[_0x9ef5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e17ee,null))[_0x9ef5('0x24')](saveUpdates(_0x47c43c['body'],null))[_0x9ef5('0x24')](respondWithResult(_0x5e17ee,null))['catch'](handleError(_0x5e17ee,null));};exports[_0x9ef5('0x25')]=function(_0xbf9ca9,_0x268f2e){return db['MailMessage'][_0x9ef5('0x48')]({'where':{'id':_0xbf9ca9['params']['id']}})[_0x9ef5('0x24')](handleEntityNotFound(_0x268f2e,null))[_0x9ef5('0x24')](removeEntity(_0x268f2e,null))['catch'](handleError(_0x268f2e,null));};exports[_0x9ef5('0x4a')]=function(_0x3c5130,_0xf7cf0f){return db['MailMessage']['describe']()['then'](respondWithResult(_0xf7cf0f,null))[_0x9ef5('0x44')](handleError(_0xf7cf0f,null));};exports[_0x9ef5('0x4b')]=function(_0x364093,_0xa643f4){return db[_0x9ef5('0x2c')][_0x9ef5('0x4b')](_0x364093[_0x9ef5('0x49')])[_0x9ef5('0x24')](function(_0x3e3c63){if(_0x3e3c63){if(_0x3e3c63[_0x9ef5('0x4c')]===_0x9ef5('0x4d')&&!_0x3e3c63[_0x9ef5('0x4e')]){var _0x38f56e,_0x494235,_0x591aa9;if(_0x364093['body']['to']){_0x494235=_0x364093[_0x9ef5('0x49')]['to'][_0x9ef5('0x4f')](',')[0x0];}return db['MailAccount'][_0x9ef5('0x50')]({'where':{'id':_0x3e3c63['MailAccountId']},'include':[{'model':db[_0x9ef5('0x51')],'as':_0x9ef5('0x52'),'include':[{'model':db[_0x9ef5('0x53')],'as':'Contacts','where':{'email':_0x494235},'limit':0x1,'order':[[_0x9ef5('0x54'),_0x9ef5('0x55')]]}]},{'model':db['MailServerOut'],'as':_0x9ef5('0x56'),'raw':!![]}]})['then'](function(_0x319cdd){_0x38f56e=_0x319cdd;if(_0x38f56e&&_0x38f56e['Smtp']){var _0x1b9d41={'tls':{'rejectUnauthorized':![]}};if(_[_0x9ef5('0x57')](_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x58')])){_0x1b9d41[_0x9ef5('0x59')]=_0x38f56e['Smtp']['host'];_0x1b9d41[_0x9ef5('0x5a')]=_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5a')];_0x1b9d41['secure']=_0x38f56e[_0x9ef5('0x56')]['secure'];if(_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5b')]){_0x1b9d41[_0x9ef5('0x5c')]={'user':_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5d')],'pass':_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5e')]};}}else{_0x1b9d41[_0x9ef5('0x58')]=_0x38f56e['Smtp'][_0x9ef5('0x58')];_0x1b9d41[_0x9ef5('0x5c')]={'user':_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5d')],'pass':_0x38f56e[_0x9ef5('0x56')]['pass']};_0x1b9d41[_0x9ef5('0x5f')]=_0x38f56e[_0x9ef5('0x56')][_0x9ef5('0x5f')];}if(_0x364093[_0x9ef5('0x49')][_0x9ef5('0x60')]&&_0x364093[_0x9ef5('0x49')]['attachments'][_0x9ef5('0x37')]){for(var _0x2074cb=0x0;_0x2074cb<_0x364093['body']['attachments']['length'];_0x2074cb+=0x1){_0x364093[_0x9ef5('0x49')][_0x9ef5('0x60')][_0x2074cb]={'filename':_0x364093['body'][_0x9ef5('0x60')][_0x2074cb][_0x9ef5('0x28')],'path':path['join'](config[_0x9ef5('0x61')],_0x9ef5('0x62'),_0x364093['body']['attachments'][_0x2074cb][_0x9ef5('0x63')])};}}_0x591aa9={'account':_0x1b9d41,'message':_0x364093['body']};return;}})[_0x9ef5('0x24')](function(){if(_0x38f56e[_0x9ef5('0x52')]){if(_0x38f56e[_0x9ef5('0x52')][_0x9ef5('0x64')][_0x9ef5('0x37')]){return _0x38f56e[_0x9ef5('0x52')][_0x9ef5('0x64')][0x0];}else{return db['CmContact'][_0x9ef5('0x4b')](_[_0x9ef5('0x65')](_0x364093[_0x9ef5('0x49')],{'firstName':_0x364093['body']['to'],'email':_0x364093[_0x9ef5('0x49')]['to'],'phone':_0x364093[_0x9ef5('0x49')]['to'],'ListId':_0x38f56e[_0x9ef5('0x66')]}));}}else{throw new Error(_0x9ef5('0x67'));}})[_0x9ef5('0x24')](function(){if(_0x591aa9){return respondWithRpcPromise('SendMail',_0x9ef5('0x68'),_0x591aa9,client9003)[_0x9ef5('0x24')](function(_0x19ac3f){return _0x3e3c63[_0x9ef5('0x23')]({'read':!![],'messageId':_0x19ac3f[_0x9ef5('0x69')],'sentAt':moment()[_0x9ef5('0x6a')](_0x9ef5('0x6b'))});})[_0x9ef5('0x44')](function(_0x5197ff){logger[_0x9ef5('0x18')]('%s',JSON['stringify'](_0x5197ff));return _0x3e3c63;});}return _0x3e3c63;});}return _0x3e3c63;}})[_0x9ef5('0x24')](respondWithResult(_0xa643f4,0xc9))[_0x9ef5('0x44')](handleError(_0xa643f4,null));};exports[_0x9ef5('0x6c')]=function(_0x2129af,_0x54635c){var _0x12b581={'agent':{},'channel':'mail'};if(_0x2129af[_0x9ef5('0x49')]['id']){delete _0x2129af[_0x9ef5('0x49')]['id'];}_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6d')]=!![];_0x2129af['body'][_0x9ef5('0x6e')]=moment()['format'](_0x9ef5('0x6b'));_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')]=_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')]||_0x2129af['user']['id'];_0x12b581[_0x9ef5('0x70')]['id']=_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')];return db[_0x9ef5('0x2c')][_0x9ef5('0x48')]({'where':{'id':_0x2129af[_0x9ef5('0x46')]['id'],'UserId':null}})[_0x9ef5('0x24')](handleEntityNotFound(_0x54635c,null))['then'](saveUpdates(_0x2129af[_0x9ef5('0x49')],null))[_0x9ef5('0x24')](function(_0x15fe22){if(_0x15fe22){_0x12b581[_0x9ef5('0x19')]=_0x15fe22[_0x9ef5('0x71')]({'plain':!![]});return db[_0x9ef5('0x72')][_0x9ef5('0x48')]({'where':{'id':_0x15fe22['MailInteractionId']}});}return null;})[_0x9ef5('0x24')](handleEntityNotFound(_0x54635c,null))[_0x9ef5('0x24')](function(_0x265a68){if(_0x265a68){return _0x265a68[_0x9ef5('0x23')]({'UserId':_0x2129af[_0x9ef5('0x49')]['UserId'],'read1stAt':_[_0x9ef5('0x57')](_0x265a68[_0x9ef5('0x73')])?moment()[_0x9ef5('0x6a')](_0x9ef5('0x6b')):undefined});}return null;})[_0x9ef5('0x24')](function(_0xc313be){if(_0xc313be){_0x12b581[_0x9ef5('0x74')]=_0xc313be['get']({'plain':!![]});interaction_log[_0x9ef5('0x13')](_0x9ef5('0x75'),_0x2129af[_0x9ef5('0x5d')]['id'],_0x2129af[_0x9ef5('0x5d')][_0x9ef5('0x28')],_0x2129af[_0x9ef5('0x5d')][_0x9ef5('0x76')],_0x12b581[_0x9ef5('0x74')]['id'],_0x2129af['body']?JSON[_0x9ef5('0x17')](_0x2129af['body']):_0x9ef5('0x77'));return respondWithRpcPromise(_0x9ef5('0x78'),_0x9ef5('0x79'),_0x12b581);}return null;})[_0x9ef5('0x24')](function(_0x273f91){var _0x35a7b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x273f91[_0x9ef5('0x19')]['ContactId'];return db[_0x9ef5('0x7a')][_0x9ef5('0x33')](_0x35a7b2,{'type':db[_0x9ef5('0x7b')][_0x9ef5('0x7c')][_0x9ef5('0x7d')],'raw':!![]})[_0x9ef5('0x24')](function(_0x31b4a2){return _0x31b4a2;});})['then'](function(_0x35cc1a){if(_0x35cc1a){_0x12b581[_0x9ef5('0x19')]['contact']=_0x35cc1a[0x0];if(!_0x2129af['body'][_0x9ef5('0x6f')])return;return db[_0x9ef5('0x7e')][_0x9ef5('0x48')]({'where':{'id':_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x6f')],'role':_0x9ef5('0x70')},'attributes':['id',_0x9ef5('0x28'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x9ef5('0x24')](function(_0x517311){if(!_0x517311)return null;_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x70')]=_0x517311;return _0x12b581;})[_0x9ef5('0x24')](function(_0x1514a4){if(_0x1514a4){if(_0x2129af[_0x9ef5('0x49')][_0x9ef5('0x7f')]){_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x80')]=util[_0x9ef5('0x6a')](_0x9ef5('0x81'),_0x2129af[_0x9ef5('0x5d')][_0x9ef5('0x28')]);_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x82')]=_0x12b581['channel'];_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x83')]=_0x12b581[_0x9ef5('0x82')];_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x84')]=_0x9ef5('0x6c');_0x12b581[_0x9ef5('0x19')][_0x9ef5('0x49')]=htmlToText[_0x9ef5('0x85')](_0x12b581['message']['body']);return respondWithRpcPromise(_0x9ef5('0x86'),_0x9ef5('0x86'),{'event':_0x9ef5('0x87'),'message':_0x12b581[_0x9ef5('0x19')]},client9002)[_0x9ef5('0x24')](function(){return _0x12b581;});}return _0x12b581;}return null;})[_0x9ef5('0x24')](respondWithResult(_0x54635c,null))['catch'](handleError(_0x54635c,null));};exports[_0x9ef5('0x88')]=function(_0x323cfc,_0x5f0472){var _0x34f08f={'agent':{},'channel':_0x9ef5('0x89')};if(_0x323cfc[_0x9ef5('0x49')]['id']){delete _0x323cfc['body']['id'];}_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')]=_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')]||_0x323cfc[_0x9ef5('0x5d')]['id'];_0x34f08f['agent']['id']=_0x323cfc[_0x9ef5('0x49')]['UserId'];return db[_0x9ef5('0x2c')]['find']({'where':{'id':_0x323cfc[_0x9ef5('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5f0472,null))[_0x9ef5('0x24')](function(_0x3dbc20){if(_0x3dbc20){_0x34f08f[_0x9ef5('0x19')]=_0x3dbc20[_0x9ef5('0x71')]({'plain':!![]});return db[_0x9ef5('0x72')][_0x9ef5('0x48')]({'where':{'id':_0x3dbc20[_0x9ef5('0x8a')]}});}return null;})[_0x9ef5('0x24')](handleEntityNotFound(_0x5f0472,null))[_0x9ef5('0x24')](function(_0x1d3da6){if(_0x1d3da6){_0x34f08f[_0x9ef5('0x74')]=_0x1d3da6[_0x9ef5('0x71')]({'plain':!![]});interaction_log[_0x9ef5('0x13')](_0x9ef5('0x8b'),_0x323cfc[_0x9ef5('0x5d')]['id'],_0x323cfc[_0x9ef5('0x5d')][_0x9ef5('0x28')],_0x323cfc[_0x9ef5('0x5d')][_0x9ef5('0x76')],_0x34f08f['interaction']['id'],_0x323cfc[_0x9ef5('0x49')]?JSON[_0x9ef5('0x17')](_0x323cfc['body']):_0x9ef5('0x77'));return respondWithRpcPromise(_0x9ef5('0x8c'),_0x9ef5('0x8d'),_0x34f08f);}return null;})['then'](function(_0xce4696){var _0x5eaabd=_0x9ef5('0x8e')+_0xce4696['message'][_0x9ef5('0x8f')];return db[_0x9ef5('0x7a')][_0x9ef5('0x33')](_0x5eaabd,{'type':db[_0x9ef5('0x7b')][_0x9ef5('0x7c')]['SELECT'],'raw':!![]})[_0x9ef5('0x24')](function(_0x419564){return _0x419564;});})['then'](function(_0x41d404){if(_0x41d404){_0x34f08f[_0x9ef5('0x19')][_0x9ef5('0x90')]=_0x41d404[0x0];if(!_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')])return;return db[_0x9ef5('0x7e')]['find']({'where':{'id':_0x323cfc[_0x9ef5('0x49')][_0x9ef5('0x6f')],'role':_0x9ef5('0x70')},'attributes':['id',_0x9ef5('0x28'),'fullname',_0x9ef5('0x91'),'internal'],'raw':!![]});}return null;})[_0x9ef5('0x24')](function(_0x2635d2){if(!_0x2635d2)return null;_0x34f08f['message'][_0x9ef5('0x70')]=_0x2635d2;return _0x34f08f;})[_0x9ef5('0x24')](function(_0x569691){if(_0x569691){_0x569691[_0x9ef5('0x19')]['interface']=util[_0x9ef5('0x6a')](_0x9ef5('0x81'),_0x323cfc[_0x9ef5('0x5d')][_0x9ef5('0x28')]);_0x569691[_0x9ef5('0x19')][_0x9ef5('0x82')]=_0x34f08f[_0x9ef5('0x82')];_0x569691[_0x9ef5('0x19')]['motionChannel']=_0x34f08f[_0x9ef5('0x82')];_0x569691[_0x9ef5('0x19')][_0x9ef5('0x84')]='reject';_0x569691[_0x9ef5('0x19')][_0x9ef5('0x49')]=htmlToText[_0x9ef5('0x85')](_0x34f08f[_0x9ef5('0x19')][_0x9ef5('0x49')]);respondWithRpcPromise(_0x9ef5('0x86'),_0x9ef5('0x86'),{'event':_0x9ef5('0x92'),'message':_0x569691['message']},client9002);return _0x34f08f;}return null;})[_0x9ef5('0x24')](respondWithResult(_0x5f0472,null))[_0x9ef5('0x44')](handleError(_0x5f0472,null));};exports[_0x9ef5('0x93')]=function(_0x1433a8,_0x47eba2){var _0x30298c=moment()[_0x9ef5('0x94')]()[_0x9ef5('0x95')]();var _0x543deb=path[_0x9ef5('0x96')](config[_0x9ef5('0x61')],_0x9ef5('0x97'),_0x9ef5('0x98'),_0x9ef5('0x99'));var _0x3c0f1d=path[_0x9ef5('0x96')](config[_0x9ef5('0x61')],_0x9ef5('0x97'),'files',_0x9ef5('0x60'));var _0x227ea4=util[_0x9ef5('0x6a')](_0x9ef5('0x9a'),_0x30298c);return db[_0x9ef5('0x2c')][_0x9ef5('0x48')]({'where':{'id':_0x1433a8[_0x9ef5('0x46')]['id']},'attributes':['id',_0x9ef5('0x49'),_0x9ef5('0x9b'),'to','cc',_0x9ef5('0x9c'),_0x9ef5('0x9d'),'createdAt'],'include':_0x1433a8['query'][_0x9ef5('0x60')]?[{'model':db[_0x9ef5('0x9e')],'as':_0x9ef5('0x9f')}]:undefined})[_0x9ef5('0x24')](handleEntityNotFound(_0x47eba2,null))['then'](function(_0x169554){if(_0x169554){var _0x36a682=_0x169554;var _0x2c19f0={'from':_0x36a682[_0x9ef5('0x9b')],'to':_0x36a682['to'],'subject':_0x36a682[_0x9ef5('0x9d')],'html':htmlEntities[_0x9ef5('0xa0')](_0x36a682[_0x9ef5('0x49')]),'headers':{'Date':moment(_0x36a682['createdAt'])['format'](_0x9ef5('0xa1'))},'attachments':[]};if(_0x169554['cc']){_0x2c19f0[_0x9ef5('0xa2')]['Cc']=_0x169554['cc'];}if(_0x169554['bcc']){_0x2c19f0['headers'][_0x9ef5('0xa3')]=_0x169554[_0x9ef5('0x9c')];}return new BPromise(function(_0x4670cf,_0x8db28f){if(_0x169554[_0x9ef5('0x9f')]){for(var _0x29ad43=0x0;_0x29ad43<_0x169554[_0x9ef5('0x9f')]['length'];_0x29ad43++){var _0x44ff3a=_0x169554[_0x9ef5('0x9f')][_0x29ad43];var _0x47dae9=path[_0x9ef5('0x96')](_0x3c0f1d,_0x44ff3a[_0x9ef5('0x63')]);if(fs[_0x9ef5('0xa4')](_0x47dae9)){_0x2c19f0[_0x9ef5('0x60')][_0x9ef5('0xa5')]({'name':_0x44ff3a[_0x9ef5('0x28')],'contentType':_0x44ff3a[_0x9ef5('0x2f')],'data':fs[_0x9ef5('0xa6')](_0x47dae9)});}}}emlformat['build'](_0x2c19f0,function(_0x541497,_0xaf7433){if(_0x541497)return _0x8db28f(_0x541497);fs['writeFileSync'](path['join'](_0x543deb,_0x227ea4),_0xaf7433);return _0x4670cf(_0xaf7433);});});}})[_0x9ef5('0x24')](function(_0x19be8a){if(_0x19be8a){return _0x47eba2['download'](path[_0x9ef5('0x96')](_0x543deb,_0x227ea4),_0x227ea4,function(_0x179f74){if(!_0x179f74)fs[_0x9ef5('0xa7')](path[_0x9ef5('0x96')](_0x543deb,_0x227ea4));});}})[_0x9ef5('0x44')](handleError(_0x47eba2,null));}; \ No newline at end of file +var _0xfa56=['existsSync','push','build','writeFileSync','eml-format','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','http','client','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','json','offset','undefined','limit','count','set','Content-Range','update','destroy','status','end','sendStatus','send','index','MailMessage','rawAttributes','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','includeAll','include','findAll','show','options','find','body','describe','create','out','secret','MailAccount','MailAccountId','CmList','List','CmContact','Smtp','isNil','service','host','port','secure','authentication','user','auth','pass','attachments','join','root','server/files/attachments','basename','Contacts','defaults','ListId','List\x20not\x20found','SendMail','messageId','mail','read','readAt','UserId','agent','MailInteraction','MailInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','params','RejectMessage','rejectMessage','fullname','rejectmessage','download','unix','server','tmp','files','message-%s.eml','from','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0xfa56,0x1ea));var _0x6fa5=function(_0x574104,_0x251c28){_0x574104=_0x574104-0x0;var _0x2782b2=_0xfa56[_0x574104];return _0x2782b2;};'use strict';var emlformat=require(_0x6fa5('0x0'));var moment=require('moment');var BPromise=require(_0x6fa5('0x1'));var util=require(_0x6fa5('0x2'));var path=require(_0x6fa5('0x3'));var fs=require('fs');var _=require(_0x6fa5('0x4'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x6fa5('0x5'));var logger=require(_0x6fa5('0x6'))(_0x6fa5('0x7'));var interaction_log=require(_0x6fa5('0x6'))('mail-interactions');var config=require(_0x6fa5('0x8'));var db=require(_0x6fa5('0x9'))['db'];config['redis']=_['defaults'](config[_0x6fa5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fa5('0xb'))(new Redis(config[_0x6fa5('0xa')]));var htmlEntities=require(_0x6fa5('0xc'));require(_0x6fa5('0xd'))[_0x6fa5('0xe')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6fa5('0xf')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x6fa5('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x218bd1,_0xb3e3b0,_0x4ec3a3,_0x345dfd){return new BPromise(function(_0x564ad7,_0x47500c){var _0x1e86e2=_0x345dfd||client;return _0x1e86e2[_0x6fa5('0x11')](_0x218bd1,_0x4ec3a3)[_0x6fa5('0x12')](function(_0x34d0a0){logger[_0x6fa5('0x13')]('MailMessage,\x20%s,\x20%s',_0xb3e3b0,'request\x20sent');logger['debug'](_0x6fa5('0x14'),_0xb3e3b0,_0x6fa5('0x15'),JSON[_0x6fa5('0x16')](_0x34d0a0));if(_0x34d0a0[_0x6fa5('0x17')]){if(_0x34d0a0[_0x6fa5('0x17')][_0x6fa5('0x18')]===0x1f4){logger[_0x6fa5('0x17')](_0x6fa5('0x19'),_0xb3e3b0,_0x34d0a0[_0x6fa5('0x17')][_0x6fa5('0x1a')]);return _0x47500c(_0x34d0a0[_0x6fa5('0x17')][_0x6fa5('0x1a')]);}logger[_0x6fa5('0x17')](_0x6fa5('0x19'),_0xb3e3b0,_0x34d0a0[_0x6fa5('0x17')][_0x6fa5('0x1a')]);return _0x564ad7(_0x34d0a0[_0x6fa5('0x17')][_0x6fa5('0x1a')]);}else{logger[_0x6fa5('0x13')](_0x6fa5('0x19'),_0xb3e3b0,_0x6fa5('0x15'));_0x564ad7(_0x34d0a0[_0x6fa5('0x1b')][_0x6fa5('0x1a')]);}})[_0x6fa5('0x1c')](function(_0x9466f8){logger[_0x6fa5('0x17')](_0x6fa5('0x19'),_0xb3e3b0,_0x9466f8);_0x47500c(_0x9466f8);});});}function respondWithResult(_0x1af764,_0x258850){_0x258850=_0x258850||0xc8;return function(_0x2c6ef){if(_0x2c6ef){return _0x1af764['status'](_0x258850)[_0x6fa5('0x1d')](_0x2c6ef);}};}function respondWithFilteredResult(_0x413c74,_0x9bf2b2){return function(_0x259a8d){if(_0x259a8d){var _0x4892fa=typeof _0x9bf2b2[_0x6fa5('0x1e')]===_0x6fa5('0x1f')&&typeof _0x9bf2b2[_0x6fa5('0x20')]===_0x6fa5('0x1f');var _0x57a5a2=_0x259a8d[_0x6fa5('0x21')];var _0x534298=_0x4892fa?0x0:_0x9bf2b2['offset'];var _0x46b210=_0x4892fa?_0x259a8d[_0x6fa5('0x21')]:_0x9bf2b2['offset']+_0x9bf2b2['limit'];var _0x54360b;if(_0x46b210>=_0x57a5a2){_0x46b210=_0x57a5a2;_0x54360b=0xc8;}else{_0x54360b=0xce;}_0x413c74['status'](_0x54360b);return _0x413c74[_0x6fa5('0x22')](_0x6fa5('0x23'),_0x534298+'-'+_0x46b210+'/'+_0x57a5a2)[_0x6fa5('0x1d')](_0x259a8d);}return null;};}function saveUpdates(_0x2c31f7){return function(_0x5c84ea){if(_0x5c84ea){return _0x5c84ea[_0x6fa5('0x24')](_0x2c31f7)[_0x6fa5('0x12')](function(_0x238a15){return _0x238a15;});}return null;};}function removeEntity(_0x2c74bd){return function(_0x469836){if(_0x469836){return _0x469836[_0x6fa5('0x25')]()[_0x6fa5('0x12')](function(){_0x2c74bd[_0x6fa5('0x26')](0xcc)[_0x6fa5('0x27')]();});}};}function handleEntityNotFound(_0x22843c){return function(_0x1b9fbb){if(!_0x1b9fbb){_0x22843c[_0x6fa5('0x28')](0x194);}return _0x1b9fbb;};}function handleError(_0x2ad8a0,_0x349d08){_0x349d08=_0x349d08||0x1f4;return function(_0xcb4d77){logger[_0x6fa5('0x17')](_0xcb4d77['stack']);if(_0xcb4d77['name']){delete _0xcb4d77['name'];}_0x2ad8a0[_0x6fa5('0x26')](_0x349d08)[_0x6fa5('0x29')](_0xcb4d77);};}exports[_0x6fa5('0x2a')]=function(_0x18784f,_0x3b28a8){var _0x3e50a4={},_0x21bc2f={},_0x18590d={'count':0x0,'rows':[]};var _0x354898=_['map'](db[_0x6fa5('0x2b')][_0x6fa5('0x2c')],function(_0x2cf430){return{'name':_0x2cf430['fieldName'],'type':_0x2cf430[_0x6fa5('0x2d')][_0x6fa5('0x2e')]};});_0x21bc2f[_0x6fa5('0x2f')]=_[_0x6fa5('0x30')](_0x354898,'name');_0x21bc2f['query']=_[_0x6fa5('0x31')](_0x18784f['query']);_0x21bc2f['filters']=_[_0x6fa5('0x32')](_0x21bc2f[_0x6fa5('0x2f')],_0x21bc2f[_0x6fa5('0x33')]);_0x3e50a4[_0x6fa5('0x34')]=_[_0x6fa5('0x32')](_0x21bc2f['model'],qs[_0x6fa5('0x35')](_0x18784f[_0x6fa5('0x33')][_0x6fa5('0x35')]));_0x3e50a4[_0x6fa5('0x34')]=_0x3e50a4['attributes'][_0x6fa5('0x36')]?_0x3e50a4['attributes']:_0x21bc2f['model'];if(!_0x18784f['query'][_0x6fa5('0x37')]('nolimit')){_0x3e50a4['limit']=qs[_0x6fa5('0x20')](_0x18784f[_0x6fa5('0x33')][_0x6fa5('0x20')]);_0x3e50a4[_0x6fa5('0x1e')]=qs[_0x6fa5('0x1e')](_0x18784f['query'][_0x6fa5('0x1e')]);}_0x3e50a4[_0x6fa5('0x38')]=qs['sort'](_0x18784f[_0x6fa5('0x33')][_0x6fa5('0x39')]);_0x3e50a4[_0x6fa5('0x3a')]=qs[_0x6fa5('0x3b')](_[_0x6fa5('0x3c')](_0x18784f[_0x6fa5('0x33')],_0x21bc2f[_0x6fa5('0x3b')]),_0x354898);if(_0x18784f[_0x6fa5('0x33')][_0x6fa5('0x3d')]){_0x3e50a4[_0x6fa5('0x3a')]=_[_0x6fa5('0x3e')](_0x3e50a4[_0x6fa5('0x3a')],{'$or':_['map'](_0x354898,function(_0x535098){if(_0x535098[_0x6fa5('0x2d')]!==_0x6fa5('0x3f')){var _0x10a1dd={};_0x10a1dd[_0x535098[_0x6fa5('0x40')]]={'$like':'%'+_0x18784f[_0x6fa5('0x33')][_0x6fa5('0x3d')]+'%'};return _0x10a1dd;}})});}_0x3e50a4=_[_0x6fa5('0x3e')]({},_0x3e50a4,_0x18784f['options']);var _0x27e46d={'where':_0x3e50a4[_0x6fa5('0x3a')]};return db['MailMessage']['count'](_0x27e46d)['then'](function(_0x4f275b){_0x18590d['count']=_0x4f275b;if(_0x18784f[_0x6fa5('0x33')][_0x6fa5('0x41')]){_0x3e50a4[_0x6fa5('0x42')]=[{'all':!![]}];}return db[_0x6fa5('0x2b')][_0x6fa5('0x43')](_0x3e50a4);})['then'](function(_0x5b4ad6){_0x18590d['rows']=_0x5b4ad6;return _0x18590d;})[_0x6fa5('0x12')](respondWithFilteredResult(_0x3b28a8,_0x3e50a4))[_0x6fa5('0x1c')](handleError(_0x3b28a8,null));};exports[_0x6fa5('0x44')]=function(_0x96b0bb,_0x1a8ae9){var _0x4a8134={'raw':!![],'where':{'id':_0x96b0bb['params']['id']}},_0x596138={};_0x596138[_0x6fa5('0x2f')]=_['keys'](db['MailMessage'][_0x6fa5('0x2c')]);_0x596138[_0x6fa5('0x33')]=_[_0x6fa5('0x31')](_0x96b0bb[_0x6fa5('0x33')]);_0x596138['filters']=_[_0x6fa5('0x32')](_0x596138[_0x6fa5('0x2f')],_0x596138['query']);_0x4a8134['attributes']=_['intersection'](_0x596138[_0x6fa5('0x2f')],qs['fields'](_0x96b0bb[_0x6fa5('0x33')][_0x6fa5('0x35')]));_0x4a8134['attributes']=_0x4a8134[_0x6fa5('0x34')][_0x6fa5('0x36')]?_0x4a8134[_0x6fa5('0x34')]:_0x596138[_0x6fa5('0x2f')];if(_0x96b0bb[_0x6fa5('0x33')][_0x6fa5('0x41')]){_0x4a8134[_0x6fa5('0x42')]=[{'all':!![]}];}_0x4a8134=_['merge']({},_0x4a8134,_0x96b0bb[_0x6fa5('0x45')]);return db['MailMessage'][_0x6fa5('0x46')](_0x4a8134)['then'](handleEntityNotFound(_0x1a8ae9,null))[_0x6fa5('0x12')](respondWithResult(_0x1a8ae9,null))['catch'](handleError(_0x1a8ae9,null));};exports['update']=function(_0x26aa98,_0x1bbe1b){if(_0x26aa98[_0x6fa5('0x47')]['id']){delete _0x26aa98[_0x6fa5('0x47')]['id'];}return db[_0x6fa5('0x2b')][_0x6fa5('0x46')]({'where':{'id':_0x26aa98['params']['id']}})[_0x6fa5('0x12')](handleEntityNotFound(_0x1bbe1b,null))[_0x6fa5('0x12')](saveUpdates(_0x26aa98[_0x6fa5('0x47')],null))[_0x6fa5('0x12')](respondWithResult(_0x1bbe1b,null))[_0x6fa5('0x1c')](handleError(_0x1bbe1b,null));};exports[_0x6fa5('0x25')]=function(_0x414761,_0x14425b){return db[_0x6fa5('0x2b')][_0x6fa5('0x46')]({'where':{'id':_0x414761['params']['id']}})[_0x6fa5('0x12')](handleEntityNotFound(_0x14425b,null))['then'](removeEntity(_0x14425b,null))[_0x6fa5('0x1c')](handleError(_0x14425b,null));};exports[_0x6fa5('0x48')]=function(_0x2dd56a,_0x4debb2){return db[_0x6fa5('0x2b')]['describe']()['then'](respondWithResult(_0x4debb2,null))[_0x6fa5('0x1c')](handleError(_0x4debb2,null));};exports[_0x6fa5('0x49')]=function(_0x45ce9f,_0x4f6b6c){return db[_0x6fa5('0x2b')][_0x6fa5('0x49')](_0x45ce9f[_0x6fa5('0x47')])['then'](function(_0x563e40){if(_0x563e40){if(_0x563e40['direction']===_0x6fa5('0x4a')&&!_0x563e40[_0x6fa5('0x4b')]){var _0x206793,_0x238be7,_0x132633;if(_0x45ce9f[_0x6fa5('0x47')]['to']){_0x238be7=_0x45ce9f[_0x6fa5('0x47')]['to']['split'](',')[0x0];}return db[_0x6fa5('0x4c')]['findOne']({'where':{'id':_0x563e40[_0x6fa5('0x4d')]},'include':[{'model':db[_0x6fa5('0x4e')],'as':_0x6fa5('0x4f'),'include':[{'model':db[_0x6fa5('0x50')],'as':'Contacts','where':{'email':_0x238be7},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':_0x6fa5('0x51'),'raw':!![]}]})['then'](function(_0x5845a2){_0x206793=_0x5845a2;if(_0x206793&&_0x206793[_0x6fa5('0x51')]){var _0x55642e={'tls':{'rejectUnauthorized':![]}};if(_[_0x6fa5('0x52')](_0x206793[_0x6fa5('0x51')][_0x6fa5('0x53')])){_0x55642e[_0x6fa5('0x54')]=_0x206793[_0x6fa5('0x51')][_0x6fa5('0x54')];_0x55642e[_0x6fa5('0x55')]=_0x206793[_0x6fa5('0x51')][_0x6fa5('0x55')];_0x55642e[_0x6fa5('0x56')]=_0x206793[_0x6fa5('0x51')]['secure'];if(_0x206793[_0x6fa5('0x51')][_0x6fa5('0x57')]){_0x55642e['auth']={'user':_0x206793[_0x6fa5('0x51')][_0x6fa5('0x58')],'pass':_0x206793[_0x6fa5('0x51')]['pass']};}}else{_0x55642e[_0x6fa5('0x53')]=_0x206793['Smtp']['service'];_0x55642e[_0x6fa5('0x59')]={'user':_0x206793[_0x6fa5('0x51')]['user'],'pass':_0x206793['Smtp'][_0x6fa5('0x5a')]};_0x55642e[_0x6fa5('0x56')]=_0x206793[_0x6fa5('0x51')][_0x6fa5('0x56')];}if(_0x45ce9f[_0x6fa5('0x47')][_0x6fa5('0x5b')]&&_0x45ce9f[_0x6fa5('0x47')][_0x6fa5('0x5b')][_0x6fa5('0x36')]){for(var _0x4cd4d4=0x0;_0x4cd4d4<_0x45ce9f[_0x6fa5('0x47')][_0x6fa5('0x5b')][_0x6fa5('0x36')];_0x4cd4d4+=0x1){_0x45ce9f[_0x6fa5('0x47')]['attachments'][_0x4cd4d4]={'filename':_0x45ce9f[_0x6fa5('0x47')][_0x6fa5('0x5b')][_0x4cd4d4][_0x6fa5('0x40')],'path':path[_0x6fa5('0x5c')](config[_0x6fa5('0x5d')],_0x6fa5('0x5e'),_0x45ce9f[_0x6fa5('0x47')]['attachments'][_0x4cd4d4][_0x6fa5('0x5f')])};}}_0x132633={'account':_0x55642e,'message':_0x45ce9f[_0x6fa5('0x47')]};return;}})[_0x6fa5('0x12')](function(){if(_0x206793[_0x6fa5('0x4f')]){if(_0x206793['List']['Contacts'][_0x6fa5('0x36')]){return _0x206793[_0x6fa5('0x4f')][_0x6fa5('0x60')][0x0];}else{return db[_0x6fa5('0x50')][_0x6fa5('0x49')](_[_0x6fa5('0x61')](_0x45ce9f[_0x6fa5('0x47')],{'firstName':_0x45ce9f[_0x6fa5('0x47')]['to'],'email':_0x45ce9f[_0x6fa5('0x47')]['to'],'phone':_0x45ce9f[_0x6fa5('0x47')]['to'],'ListId':_0x206793[_0x6fa5('0x62')]}));}}else{throw new Error(_0x6fa5('0x63'));}})['then'](function(){if(_0x132633){return respondWithRpcPromise(_0x6fa5('0x64'),'sendMail',_0x132633,client9003)['then'](function(_0x13391e){return _0x563e40[_0x6fa5('0x24')]({'read':!![],'messageId':_0x13391e[_0x6fa5('0x65')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6fa5('0x1c')](function(_0x59f208){logger[_0x6fa5('0x17')]('%s',JSON[_0x6fa5('0x16')](_0x59f208));return _0x563e40;});}return _0x563e40;});}return _0x563e40;}})['then'](respondWithResult(_0x4f6b6c,0xc9))['catch'](handleError(_0x4f6b6c,null));};exports['accept']=function(_0x1bd1ce,_0x278e66){var _0x2a4699={'agent':{},'channel':_0x6fa5('0x66')};if(_0x1bd1ce[_0x6fa5('0x47')]['id']){delete _0x1bd1ce[_0x6fa5('0x47')]['id'];}_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x67')]=!![];_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x68')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x69')]=_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x69')]||_0x1bd1ce['user']['id'];_0x2a4699[_0x6fa5('0x6a')]['id']=_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x69')];return db[_0x6fa5('0x2b')]['find']({'where':{'id':_0x1bd1ce['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x278e66,null))['then'](saveUpdates(_0x1bd1ce[_0x6fa5('0x47')],null))['then'](function(_0x188bf4){if(_0x188bf4){_0x2a4699[_0x6fa5('0x1a')]=_0x188bf4['get']({'plain':!![]});return db[_0x6fa5('0x6b')][_0x6fa5('0x46')]({'where':{'id':_0x188bf4[_0x6fa5('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x278e66,null))[_0x6fa5('0x12')](function(_0x2bea6f){if(_0x2bea6f){return _0x2bea6f[_0x6fa5('0x24')]({'UserId':_0x1bd1ce['body'][_0x6fa5('0x69')],'read1stAt':_['isNil'](_0x2bea6f[_0x6fa5('0x6d')])?moment()[_0x6fa5('0x6e')](_0x6fa5('0x6f')):undefined});}return null;})[_0x6fa5('0x12')](function(_0x189cbd){if(_0x189cbd){_0x2a4699[_0x6fa5('0x70')]=_0x189cbd[_0x6fa5('0x71')]({'plain':!![]});interaction_log[_0x6fa5('0x13')](_0x6fa5('0x72'),_0x1bd1ce['user']['id'],_0x1bd1ce['user'][_0x6fa5('0x40')],_0x1bd1ce['user'][_0x6fa5('0x73')],_0x2a4699[_0x6fa5('0x70')]['id'],_0x1bd1ce['body']?JSON[_0x6fa5('0x16')](_0x1bd1ce['body']):_0x6fa5('0x74'));return respondWithRpcPromise('AcceptMessage',_0x6fa5('0x75'),_0x2a4699);}return null;})[_0x6fa5('0x12')](function(_0x2d45f3){var _0x536786=_0x6fa5('0x76')+_0x2d45f3[_0x6fa5('0x1a')][_0x6fa5('0x77')];return db[_0x6fa5('0x78')][_0x6fa5('0x33')](_0x536786,{'type':db['Sequelize'][_0x6fa5('0x79')][_0x6fa5('0x7a')],'raw':!![]})[_0x6fa5('0x12')](function(_0x59e7b0){return _0x59e7b0;});})[_0x6fa5('0x12')](function(_0x173367){if(_0x173367){_0x2a4699['message'][_0x6fa5('0x7b')]=_0x173367[0x0];if(!_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x69')])return;return db[_0x6fa5('0x7c')][_0x6fa5('0x46')]({'where':{'id':_0x1bd1ce[_0x6fa5('0x47')]['UserId'],'role':'agent'},'attributes':['id',_0x6fa5('0x40'),'fullname',_0x6fa5('0x7d'),_0x6fa5('0x7e')],'raw':!![]});}return null;})[_0x6fa5('0x12')](function(_0x13c0f7){if(!_0x13c0f7)return null;_0x2a4699[_0x6fa5('0x1a')][_0x6fa5('0x6a')]=_0x13c0f7;return _0x2a4699;})['then'](function(_0x32580a){if(_0x32580a){if(_0x1bd1ce[_0x6fa5('0x47')][_0x6fa5('0x7f')]){_0x2a4699[_0x6fa5('0x1a')][_0x6fa5('0x80')]=util['format'](_0x6fa5('0x81'),_0x1bd1ce[_0x6fa5('0x58')]['name']);_0x2a4699['message']['channel']=_0x2a4699[_0x6fa5('0x82')];_0x2a4699[_0x6fa5('0x1a')][_0x6fa5('0x83')]=_0x2a4699[_0x6fa5('0x82')];_0x2a4699[_0x6fa5('0x1a')][_0x6fa5('0x84')]=_0x6fa5('0x85');_0x2a4699[_0x6fa5('0x1a')][_0x6fa5('0x47')]=htmlToText[_0x6fa5('0x86')](_0x2a4699[_0x6fa5('0x1a')]['body']);return respondWithRpcPromise(_0x6fa5('0x87'),_0x6fa5('0x87'),{'event':_0x6fa5('0x88'),'message':_0x2a4699[_0x6fa5('0x1a')]},client9002)[_0x6fa5('0x12')](function(){return _0x2a4699;});}return _0x2a4699;}return null;})[_0x6fa5('0x12')](respondWithResult(_0x278e66,null))[_0x6fa5('0x1c')](handleError(_0x278e66,null));};exports[_0x6fa5('0x89')]=function(_0x2414a2,_0x155ff3){var _0x1fb67a={'agent':{},'channel':_0x6fa5('0x66')};if(_0x2414a2['body']['id']){delete _0x2414a2[_0x6fa5('0x47')]['id'];}_0x2414a2[_0x6fa5('0x47')][_0x6fa5('0x69')]=_0x2414a2['body']['UserId']||_0x2414a2[_0x6fa5('0x58')]['id'];_0x1fb67a['agent']['id']=_0x2414a2[_0x6fa5('0x47')][_0x6fa5('0x69')];return db['MailMessage'][_0x6fa5('0x46')]({'where':{'id':_0x2414a2[_0x6fa5('0x8a')]['id'],'UserId':null}})[_0x6fa5('0x12')](handleEntityNotFound(_0x155ff3,null))[_0x6fa5('0x12')](function(_0x2c0343){if(_0x2c0343){_0x1fb67a[_0x6fa5('0x1a')]=_0x2c0343[_0x6fa5('0x71')]({'plain':!![]});return db[_0x6fa5('0x6b')][_0x6fa5('0x46')]({'where':{'id':_0x2c0343[_0x6fa5('0x6c')]}});}return null;})[_0x6fa5('0x12')](handleEntityNotFound(_0x155ff3,null))[_0x6fa5('0x12')](function(_0x4a039f){if(_0x4a039f){_0x1fb67a[_0x6fa5('0x70')]=_0x4a039f['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2414a2[_0x6fa5('0x58')]['id'],_0x2414a2['user']['name'],_0x2414a2['user'][_0x6fa5('0x73')],_0x1fb67a['interaction']['id'],_0x2414a2['body']?JSON['stringify'](_0x2414a2['body']):'null');return respondWithRpcPromise(_0x6fa5('0x8b'),_0x6fa5('0x8c'),_0x1fb67a);}return null;})[_0x6fa5('0x12')](function(_0xa04aca){var _0xd1053e=_0x6fa5('0x76')+_0xa04aca['message'][_0x6fa5('0x77')];return db['sequelize']['query'](_0xd1053e,{'type':db['Sequelize'][_0x6fa5('0x79')]['SELECT'],'raw':!![]})[_0x6fa5('0x12')](function(_0x2869c0){return _0x2869c0;});})[_0x6fa5('0x12')](function(_0x412b2b){if(_0x412b2b){_0x1fb67a[_0x6fa5('0x1a')]['contact']=_0x412b2b[0x0];if(!_0x2414a2['body'][_0x6fa5('0x69')])return;return db[_0x6fa5('0x7c')]['find']({'where':{'id':_0x2414a2[_0x6fa5('0x47')][_0x6fa5('0x69')],'role':_0x6fa5('0x6a')},'attributes':['id','name',_0x6fa5('0x8d'),_0x6fa5('0x7d'),_0x6fa5('0x7e')],'raw':!![]});}return null;})[_0x6fa5('0x12')](function(_0x35d6d5){if(!_0x35d6d5)return null;_0x1fb67a['message'][_0x6fa5('0x6a')]=_0x35d6d5;return _0x1fb67a;})[_0x6fa5('0x12')](function(_0x305aaa){if(_0x305aaa){_0x305aaa['message'][_0x6fa5('0x80')]=util[_0x6fa5('0x6e')](_0x6fa5('0x81'),_0x2414a2[_0x6fa5('0x58')][_0x6fa5('0x40')]);_0x305aaa[_0x6fa5('0x1a')]['channel']=_0x1fb67a[_0x6fa5('0x82')];_0x305aaa[_0x6fa5('0x1a')][_0x6fa5('0x83')]=_0x1fb67a[_0x6fa5('0x82')];_0x305aaa[_0x6fa5('0x1a')][_0x6fa5('0x84')]='reject';_0x305aaa[_0x6fa5('0x1a')][_0x6fa5('0x47')]=htmlToText[_0x6fa5('0x86')](_0x1fb67a['message']['body']);respondWithRpcPromise(_0x6fa5('0x87'),_0x6fa5('0x87'),{'event':_0x6fa5('0x8e'),'message':_0x305aaa[_0x6fa5('0x1a')]},client9002);return _0x1fb67a;}return null;})['then'](respondWithResult(_0x155ff3,null))[_0x6fa5('0x1c')](handleError(_0x155ff3,null));};exports[_0x6fa5('0x8f')]=function(_0x2c94a8,_0x2cd299){var _0x30cd3a=moment()[_0x6fa5('0x90')]()['toString']();var _0x36fe28=path[_0x6fa5('0x5c')](config[_0x6fa5('0x5d')],_0x6fa5('0x91'),'files',_0x6fa5('0x92'));var _0x5ca0aa=path['join'](config['root'],'server',_0x6fa5('0x93'),'attachments');var _0x2b9871=util[_0x6fa5('0x6e')](_0x6fa5('0x94'),_0x30cd3a);return db[_0x6fa5('0x2b')][_0x6fa5('0x46')]({'where':{'id':_0x2c94a8[_0x6fa5('0x8a')]['id']},'attributes':['id',_0x6fa5('0x47'),_0x6fa5('0x95'),'to','cc','bcc',_0x6fa5('0x96'),_0x6fa5('0x97')],'include':_0x2c94a8['query'][_0x6fa5('0x5b')]?[{'model':db[_0x6fa5('0x98')],'as':_0x6fa5('0x99')}]:undefined})[_0x6fa5('0x12')](handleEntityNotFound(_0x2cd299,null))[_0x6fa5('0x12')](function(_0x12b335){if(_0x12b335){var _0x30a426=_0x12b335;var _0x2c4556={'from':_0x30a426['from'],'to':_0x30a426['to'],'subject':_0x30a426[_0x6fa5('0x96')],'html':htmlEntities['decode'](_0x30a426[_0x6fa5('0x47')]),'headers':{'Date':moment(_0x30a426['createdAt'])[_0x6fa5('0x6e')](_0x6fa5('0x9a'))},'attachments':[]};if(_0x12b335['cc']){_0x2c4556[_0x6fa5('0x9b')]['Cc']=_0x12b335['cc'];}if(_0x12b335[_0x6fa5('0x9c')]){_0x2c4556['headers'][_0x6fa5('0x9d')]=_0x12b335[_0x6fa5('0x9c')];}return new BPromise(function(_0x261132,_0x3b7b40){if(_0x12b335['Attachments']){for(var _0x3e31e2=0x0;_0x3e31e2<_0x12b335['Attachments'][_0x6fa5('0x36')];_0x3e31e2++){var _0x47a3ba=_0x12b335[_0x6fa5('0x99')][_0x3e31e2];var _0x2f2298=path[_0x6fa5('0x5c')](_0x5ca0aa,_0x47a3ba['basename']);if(fs[_0x6fa5('0x9e')](_0x2f2298)){_0x2c4556[_0x6fa5('0x5b')][_0x6fa5('0x9f')]({'name':_0x47a3ba[_0x6fa5('0x40')],'contentType':_0x47a3ba['type'],'data':fs['readFileSync'](_0x2f2298)});}}}emlformat[_0x6fa5('0xa0')](_0x2c4556,function(_0x56ccb4,_0x565f1f){if(_0x56ccb4)return _0x3b7b40(_0x56ccb4);fs[_0x6fa5('0xa1')](path[_0x6fa5('0x5c')](_0x36fe28,_0x2b9871),_0x565f1f);return _0x261132(_0x565f1f);});});}})[_0x6fa5('0x12')](function(_0x3dfa76){if(_0x3dfa76){return _0x2cd299[_0x6fa5('0x8f')](path[_0x6fa5('0x5c')](_0x36fe28,_0x2b9871),_0x2b9871,function(_0x36c6c3){if(!_0x36c6c3)fs['unlinkSync'](path[_0x6fa5('0x5c')](_0x36fe28,_0x2b9871));});}})[_0x6fa5('0x1c')](handleError(_0x2cd299,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 5d9d9b0..82fabb6 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 _0x7e28=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x438df1,_0x4737de){var _0x2a8478=function(_0x28b33d){while(--_0x28b33d){_0x438df1['push'](_0x438df1['shift']());}};_0x2a8478(++_0x4737de);}(_0x7e28,0x1dd));var _0x87e2=function(_0x37e264,_0xb44ec0){_0x37e264=_0x37e264-0x0;var _0x26e4ff=_0x7e28[_0x37e264];return _0x26e4ff;};'use strict';var EventEmitter=require(_0x87e2('0x0'));var MailMessage=require(_0x87e2('0x1'))['db'][_0x87e2('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x87e2('0x3')](0x0);var events={'afterCreate':_0x87e2('0x4'),'afterUpdate':'update','afterDestroy':_0x87e2('0x5')};function emitEvent(_0x4742ae){return function(_0x54fe7f,_0x30e047,_0x6b36b2){MailMessageEvents[_0x87e2('0x6')](_0x4742ae+':'+_0x54fe7f['id'],_0x54fe7f);MailMessageEvents[_0x87e2('0x6')](_0x4742ae,_0x54fe7f);_0x6b36b2(null);};}for(var e in events){if(events[_0x87e2('0x7')](e)){var event=events[e];MailMessage[_0x87e2('0x8')](e,emitEvent(event));}}module[_0x87e2('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x5bba=['events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x20b1ca,_0xcaa99b){var _0x13a457=function(_0x49b381){while(--_0x49b381){_0x20b1ca['push'](_0x20b1ca['shift']());}};_0x13a457(++_0xcaa99b);}(_0x5bba,0x1ae));var _0xa5bb=function(_0x2867db,_0x5e8b5a){_0x2867db=_0x2867db-0x0;var _0x10cee6=_0x5bba[_0x2867db];return _0x10cee6;};'use strict';var EventEmitter=require(_0xa5bb('0x0'));var MailMessage=require(_0xa5bb('0x1'))['db'][_0xa5bb('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa5bb('0x3')](0x0);var events={'afterCreate':_0xa5bb('0x4'),'afterUpdate':_0xa5bb('0x5'),'afterDestroy':_0xa5bb('0x6')};function emitEvent(_0x414543){return function(_0x11fb8f,_0x99929b,_0x3352b3){MailMessageEvents[_0xa5bb('0x7')](_0x414543+':'+_0x11fb8f['id'],_0x11fb8f);MailMessageEvents[_0xa5bb('0x7')](_0x414543,_0x11fb8f);_0x3352b3(null);};}for(var e in events){if(events[_0xa5bb('0x8')](e)){var event=events[e];MailMessage[_0xa5bb('0x9')](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 d755138..d5cf67d 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 _0x4d73=['MailInteraction','findOne','MailInteractionId','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','get','toLowerCase','out','isNil','UserId'];(function(_0x582001,_0x4e4d3d){var _0x5953fc=function(_0x457207){while(--_0x457207){_0x582001['push'](_0x582001['shift']());}};_0x5953fc(++_0x4e4d3d);}(_0x4d73,0x111));var _0x34d7=function(_0xf52fb6,_0x550581){_0xf52fb6=_0xf52fb6-0x0;var _0x4784df=_0x4d73[_0xf52fb6];return _0x4784df;};'use strict';var _=require(_0x34d7('0x0'));var util=require('util');var logger=require(_0x34d7('0x1'))(_0x34d7('0x2'));var moment=require(_0x34d7('0x3'));var BPromise=require(_0x34d7('0x4'));var rp=require(_0x34d7('0x5'));var htmlToText=require(_0x34d7('0x6'));var fs=require('fs');var path=require(_0x34d7('0x7'));var rimraf=require(_0x34d7('0x8'));var config=require(_0x34d7('0x9'));var attributes=require(_0x34d7('0xa'));module['exports']=function(_0x33a986,_0x4e4f9a){return _0x33a986[_0x34d7('0xb')](_0x34d7('0xc'),attributes,{'tableName':_0x34d7('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x34d7('0xe')]},{'name':'fti_mail_messages','fields':[_0x34d7('0xf'),_0x34d7('0x10')],'type':_0x34d7('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47df40,_0x39323d,_0x47faa0){if(_0x47df40['body']){_0x47df40[_0x34d7('0xf')]=htmlToText['fromString'](_0x47df40[_0x34d7('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x47faa0(null,_0x39323d);},'afterCreate':function(_0x3e0e2d,_0x4a44c9,_0x4a63ca){var _0x272eb6=_0x33a986['models'];var _0x560dfc=_0x3e0e2d[_0x34d7('0x13')]({'plain':!![]});if(_0x560dfc['direction'][_0x34d7('0x14')]()==='in'||_0x560dfc['direction'][_0x34d7('0x14')]()===_0x34d7('0x15')&&!_0x560dfc['secret']&&!_[_0x34d7('0x16')](_0x560dfc[_0x34d7('0x17')])){_0x272eb6[_0x34d7('0x18')][_0x34d7('0x19')]({'where':{'id':_0x560dfc[_0x34d7('0x1a')]}})['then'](function(_0x4bc30c){if(_0x4bc30c){_0x4bc30c['update']({'lastMsgAt':_0x560dfc[_0x34d7('0x1b')],'lastMsgDirection':_0x560dfc[_0x34d7('0x1c')][_0x34d7('0x14')]()});}})[_0x34d7('0x1d')](function(_0x55f242){console[_0x34d7('0x1e')](_0x55f242);});}_0x4a63ca();}},'charset':_0x34d7('0x1f'),'collate':_0x34d7('0x20')});}; \ No newline at end of file +var _0x2d84=['get','toLowerCase','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports','define','mail_messages','messageId','plainBody','subject','fromString','body','models'];(function(_0x176a55,_0x19ac5a){var _0x240432=function(_0xee2566){while(--_0xee2566){_0x176a55['push'](_0x176a55['shift']());}};_0x240432(++_0x19ac5a);}(_0x2d84,0x1a2));var _0x42d8=function(_0x503dac,_0x1c587c){_0x503dac=_0x503dac-0x0;var _0x5d8213=_0x2d84[_0x503dac];return _0x5d8213;};'use strict';var _=require(_0x42d8('0x0'));var util=require(_0x42d8('0x1'));var logger=require(_0x42d8('0x2'))('api');var moment=require(_0x42d8('0x3'));var BPromise=require('bluebird');var rp=require(_0x42d8('0x4'));var htmlToText=require(_0x42d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42d8('0x6'));var config=require('../../config/environment');var attributes=require(_0x42d8('0x7'));module[_0x42d8('0x8')]=function(_0x45b9ad,_0x79b844){return _0x45b9ad[_0x42d8('0x9')]('MailMessage',attributes,{'tableName':_0x42d8('0xa'),'paranoid':![],'indexes':[{'name':_0x42d8('0xb'),'fields':[_0x42d8('0xb')]},{'name':'fti_mail_messages','fields':[_0x42d8('0xc'),_0x42d8('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40319f,_0x4adcfb,_0x405d8e){if(_0x40319f['body']){_0x40319f['plainBody']=htmlToText[_0x42d8('0xe')](_0x40319f[_0x42d8('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x405d8e(null,_0x4adcfb);},'afterCreate':function(_0x20a4d6,_0x559276,_0xb8ce76){var _0x48e25f=_0x45b9ad[_0x42d8('0x10')];var _0x3a2552=_0x20a4d6[_0x42d8('0x11')]({'plain':!![]});if(_0x3a2552['direction'][_0x42d8('0x12')]()==='in'||_0x3a2552['direction']['toLowerCase']()==='out'&&!_0x3a2552['secret']&&!_[_0x42d8('0x13')](_0x3a2552[_0x42d8('0x14')])){_0x48e25f['MailInteraction'][_0x42d8('0x15')]({'where':{'id':_0x3a2552[_0x42d8('0x16')]}})[_0x42d8('0x17')](function(_0x4afd4c){if(_0x4afd4c){_0x4afd4c[_0x42d8('0x18')]({'lastMsgAt':_0x3a2552[_0x42d8('0x19')],'lastMsgDirection':_0x3a2552['direction'][_0x42d8('0x12')]()});}})[_0x42d8('0x1a')](function(_0x115e0d){console['error'](_0x115e0d);});}_0xb8ce76();}},'charset':_0x42d8('0x1b'),'collate':_0x42d8('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 71f5baa..cb18567 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 _0x087b=['options','raw','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x087b,0x11a));var _0xb087=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x087b[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});config[_0xb087('0xb')]=_[_0xb087('0xc')](config[_0xb087('0xb')],{'host':_0xb087('0xd'),'port':0x18eb});var socket=require(_0xb087('0xe'))(new Redis(config[_0xb087('0xb')]));require(_0xb087('0xf'))[_0xb087('0x10')](socket);function respondWithRpcPromise(_0x379041,_0x583d25,_0x244abc){return new BPromise(function(_0x108451,_0x903a16){return client[_0xb087('0x11')](_0x379041,_0x244abc)[_0xb087('0x12')](function(_0x2f43e9){logger[_0xb087('0x13')]('MailMessage,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));logger[_0xb087('0x15')](_0xb087('0x16'),_0x583d25,'request\x20sent',JSON[_0xb087('0x17')](_0x2f43e9));if(_0x2f43e9[_0xb087('0x18')]){if(_0x2f43e9[_0xb087('0x18')][_0xb087('0x19')]===0x1f4){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);return _0x903a16(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}logger['error'](_0xb087('0x1a'),_0x583d25,_0x2f43e9[_0xb087('0x18')]['message']);return _0x108451(_0x2f43e9[_0xb087('0x18')][_0xb087('0x1b')]);}else{logger[_0xb087('0x13')]('MailMessage,\x20%s,\x20%s',_0x583d25,_0xb087('0x14'));_0x108451(_0x2f43e9[_0xb087('0x1c')][_0xb087('0x1b')]);}})[_0xb087('0x1d')](function(_0x4e333b){logger[_0xb087('0x18')](_0xb087('0x1a'),_0x583d25,_0x4e333b);_0x903a16(_0x4e333b);});});}exports[_0xb087('0x1e')]=function(_0x23c1b6){var _0x5b4ef0=this;return new Promise(function(_0x5aeab1,_0x5ea3dc){return db['MailMessage'][_0xb087('0x1f')](_0x23c1b6[_0xb087('0x20')],{'raw':_0x23c1b6[_0xb087('0x21')]?_0x23c1b6[_0xb087('0x21')][_0xb087('0x22')]===undefined?!![]:![]:!![]})[_0xb087('0x12')](function(_0x31ae01){logger['info'](_0xb087('0x1e'),_0x23c1b6);logger[_0xb087('0x15')](_0xb087('0x1e'),_0x23c1b6,JSON[_0xb087('0x17')](_0x31ae01));_0x5aeab1(_0x31ae01);})[_0xb087('0x1d')](function(_0x4d9028){logger[_0xb087('0x18')](_0xb087('0x1e'),_0x4d9028['message'],_0x23c1b6);_0x5ea3dc(_0x5b4ef0['error'](0x1f4,_0x4d9028['message']));});});}; \ No newline at end of file +var _0xf7b4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','MailMessage','create','body','options','raw','CreateMailMessage','lodash','bluebird'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xf7b4,0x152));var _0x4f7b=function(_0x487534,_0x2c5b9c){_0x487534=_0x487534-0x0;var _0x252c7b=_0xf7b4[_0x487534];return _0x252c7b;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./mailMessage.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('MailMessage,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});}exports['CreateMailMessage']=function(_0x1daa79){var _0x5adacb=this;return new Promise(function(_0x41cf36,_0x12374b){return db[_0x4f7b('0x1c')][_0x4f7b('0x1d')](_0x1daa79[_0x4f7b('0x1e')],{'raw':_0x1daa79[_0x4f7b('0x1f')]?_0x1daa79[_0x4f7b('0x1f')][_0x4f7b('0x20')]===undefined?!![]:![]:!![]})[_0x4f7b('0x10')](function(_0x5508bd){logger[_0x4f7b('0x11')](_0x4f7b('0x21'),_0x1daa79);logger[_0x4f7b('0x12')]('CreateMailMessage',_0x1daa79,JSON[_0x4f7b('0x15')](_0x5508bd));_0x41cf36(_0x5508bd);})[_0x4f7b('0x1b')](function(_0x5d22f4){logger[_0x4f7b('0x16')]('CreateMailMessage',_0x5d22f4[_0x4f7b('0x19')],_0x1daa79);_0x12374b(_0x5adacb[_0x4f7b('0x16')](0x1f4,_0x5d22f4[_0x4f7b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 421cf50..675983c 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 _0xb281=['emit','mailMessage:','./mailMessage.events','remove'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb281,0x176));var _0x1b28=function(_0x57590f,_0x29a371){_0x57590f=_0x57590f-0x0;var _0x21a86b=_0xb281[_0x57590f];return _0x21a86b;};'use strict';var MailMessageEvents=require(_0x1b28('0x0'));var events=['save',_0x1b28('0x1'),'update'];function createListener(_0x2c8462,_0x2ae00e){return function(_0x3abed6){_0x2ae00e[_0x1b28('0x2')](_0x2c8462,_0x3abed6);};}function removeListener(_0x55c70a,_0x179600){return function(){MailMessageEvents['removeListener'](_0x55c70a,_0x179600);};}exports['register']=function(_0x55d854){for(var _0x32b49c=0x0,_0x542069=events['length'];_0x32b49c<_0x542069;_0x32b49c++){var _0x346f18=events[_0x32b49c];var _0x4fd627=createListener(_0x1b28('0x3')+_0x346f18,_0x55d854);MailMessageEvents['on'](_0x346f18,_0x4fd627);}}; \ No newline at end of file +var _0xb6b5=['register','./mailMessage.events','save','remove','update','emit'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0xb6b5,0x1d5));var _0x5b6b=function(_0x4ee731,_0x5ca1b9){_0x4ee731=_0x4ee731-0x0;var _0x300b11=_0xb6b5[_0x4ee731];return _0x300b11;};'use strict';var MailMessageEvents=require(_0x5b6b('0x0'));var events=[_0x5b6b('0x1'),_0x5b6b('0x2'),_0x5b6b('0x3')];function createListener(_0x1ee77a,_0x40c7ac){return function(_0xeb8fa2){_0x40c7ac[_0x5b6b('0x4')](_0x1ee77a,_0xeb8fa2);};}function removeListener(_0x49f758,_0x4206be){return function(){MailMessageEvents['removeListener'](_0x49f758,_0x4206be);};}exports[_0x5b6b('0x5')]=function(_0x3708f3){for(var _0x565a67=0x0,_0x52d8e0=events['length'];_0x565a67<_0x52d8e0;_0x565a67++){var _0x55239f=events[_0x565a67];var _0x1e80ea=createListener('mailMessage:'+_0x55239f,_0x3708f3);MailMessageEvents['on'](_0x55239f,_0x1e80ea);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b215993..04fe692 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 _0x06a6=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','getMembers','/:id/teams','/:id/users','post','create','addAgents','put','/:id','update','delete','destroy','removeTeams','exports','multer','util','path'];(function(_0x5e761b,_0x355e38){var _0x98502c=function(_0x4e52d5){while(--_0x4e52d5){_0x5e761b['push'](_0x5e761b['shift']());}};_0x98502c(++_0x355e38);}(_0x06a6,0x93));var _0x606a=function(_0x1d7448,_0x481e34){_0x1d7448=_0x1d7448-0x0;var _0x4208ee=_0x06a6[_0x1d7448];return _0x4208ee;};'use strict';var multer=require(_0x606a('0x0'));var util=require(_0x606a('0x1'));var path=require(_0x606a('0x2'));var timeout=require(_0x606a('0x3'));var express=require(_0x606a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x606a('0x5'));var interaction=require(_0x606a('0x6'));var config=require(_0x606a('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x606a('0x8')](),controller[_0x606a('0x9')]);router[_0x606a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x606a('0xb')]);router[_0x606a('0xa')]('/:id',auth[_0x606a('0x8')](),controller['show']);router[_0x606a('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x606a('0xc')]);router[_0x606a('0xa')](_0x606a('0xd'),auth[_0x606a('0x8')](),controller['getTeams']);router['get'](_0x606a('0xe'),auth[_0x606a('0x8')](),controller['getAgents']);router[_0x606a('0xf')]('/',auth[_0x606a('0x8')](),controller[_0x606a('0x10')]);router[_0x606a('0xf')](_0x606a('0xd'),auth[_0x606a('0x8')](),controller['addTeams']);router[_0x606a('0xf')]('/:id/users',auth[_0x606a('0x8')](),controller[_0x606a('0x11')]);router[_0x606a('0x12')](_0x606a('0x13'),auth[_0x606a('0x8')](),controller[_0x606a('0x14')]);router[_0x606a('0x15')](_0x606a('0x13'),auth[_0x606a('0x8')](),controller[_0x606a('0x16')]);router[_0x606a('0x15')](_0x606a('0xd'),auth['isAuthenticated'](),controller[_0x606a('0x17')]);router[_0x606a('0x15')]('/:id/users',auth[_0x606a('0x8')](),controller['removeAgents']);module[_0x606a('0x18')]=router; \ No newline at end of file +var _0x96c4=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','exports','multer'];(function(_0x3413df,_0x3e85b0){var _0x5bbeff=function(_0x2e04e){while(--_0x2e04e){_0x3413df['push'](_0x3413df['shift']());}};_0x5bbeff(++_0x3e85b0);}(_0x96c4,0x12b));var _0x496c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x96c4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x496c('0x0'));var util=require(_0x496c('0x1'));var path=require(_0x496c('0x2'));var timeout=require(_0x496c('0x3'));var express=require('express');var router=express[_0x496c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x496c('0x5'));var interaction=require(_0x496c('0x6'));var config=require(_0x496c('0x7'));var controller=require(_0x496c('0x8'));router[_0x496c('0x9')]('/',auth['isAuthenticated'](),controller[_0x496c('0xa')]);router[_0x496c('0x9')](_0x496c('0xb'),auth[_0x496c('0xc')](),controller[_0x496c('0xd')]);router[_0x496c('0x9')](_0x496c('0xe'),auth[_0x496c('0xc')](),controller['show']);router[_0x496c('0x9')]('/:id/members',auth[_0x496c('0xc')](),controller['getMembers']);router['get'](_0x496c('0xf'),auth[_0x496c('0xc')](),controller[_0x496c('0x10')]);router[_0x496c('0x9')](_0x496c('0x11'),auth[_0x496c('0xc')](),controller[_0x496c('0x12')]);router[_0x496c('0x13')]('/',auth[_0x496c('0xc')](),controller[_0x496c('0x14')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x496c('0x15')]);router['post'](_0x496c('0x11'),auth[_0x496c('0xc')](),controller['addAgents']);router[_0x496c('0x16')]('/:id',auth[_0x496c('0xc')](),controller['update']);router[_0x496c('0x17')](_0x496c('0xe'),auth[_0x496c('0xc')](),controller['destroy']);router[_0x496c('0x17')](_0x496c('0xf'),auth[_0x496c('0xc')](),controller['removeTeams']);router[_0x496c('0x17')]('/:id/users',auth[_0x496c('0xc')](),controller['removeAgents']);module[_0x496c('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 57fa038..b557840 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 _0x106a=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x393436,_0x2100f4){var _0x1a54a4=function(_0x2318f3){while(--_0x2318f3){_0x393436['push'](_0x393436['shift']());}};_0x1a54a4(++_0x2100f4);}(_0x106a,0x1ee));var _0xa106=function(_0x2627e4,_0x1a02e0){_0x2627e4=_0x2627e4-0x0;var _0x102358=_0x106a[_0x2627e4];return _0x102358;};'use strict';var Sequelize=require(_0xa106('0x0'));module[_0xa106('0x1')]={'name':{'type':Sequelize[_0xa106('0x2')],'unique':_0xa106('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa106('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa106('0x5')](_0xa106('0x6'),'beepall',_0xa106('0x7'))}}; \ No newline at end of file +var _0x26fc=['rrmemory','beepall','roundrobin','sequelize','name','INTEGER'];(function(_0x402e99,_0x54c460){var _0x4b4af7=function(_0x1ebc2f){while(--_0x1ebc2f){_0x402e99['push'](_0x402e99['shift']());}};_0x4b4af7(++_0x54c460);}(_0x26fc,0x16b));var _0xc26f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x26fc[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xc26f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc26f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc26f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc26f('0x3'),_0xc26f('0x4'),_0xc26f('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c1e532e..8091b54 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 _0xea03=['merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','describe','getMembers','findOne','hasOwnProperty','filter','User','findAndCountAll','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','Agents','online','flatMap','sequelize','each','UserMailQueue','findOrCreate','forEach','emit','userMailQueue:save','ids','select','field','tq.TeamId','from','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','end','sendStatus','error','stack','name','send','map','MailQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xea03,0x15e));var _0x3ea0=function(_0x469add,_0x50ef21){_0x469add=_0x469add-0x0;var _0x2e8a26=_0xea03[_0x469add];return _0x2e8a26;};'use strict';var emlformat=require(_0x3ea0('0x0'));var rimraf=require(_0x3ea0('0x1'));var zipdir=require(_0x3ea0('0x2'));var jsonpatch=require(_0x3ea0('0x3'));var rp=require(_0x3ea0('0x4'));var moment=require(_0x3ea0('0x5'));var BPromise=require(_0x3ea0('0x6'));var Mustache=require('mustache');var util=require(_0x3ea0('0x7'));var path=require(_0x3ea0('0x8'));var sox=require(_0x3ea0('0x9'));var csv=require(_0x3ea0('0xa'));var ejs=require(_0x3ea0('0xb'));var fs=require('fs');var fs_extra=require(_0x3ea0('0xc'));var _=require(_0x3ea0('0xd'));var squel=require(_0x3ea0('0xe'));var crypto=require('crypto');var jsforce=require(_0x3ea0('0xf'));var deskjs=require(_0x3ea0('0x10'));var toCsv=require(_0x3ea0('0xa'));var querystring=require(_0x3ea0('0x11'));var Papa=require('papaparse');var Redis=require(_0x3ea0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3ea0('0x13'));var as=require(_0x3ea0('0x14'));var hardwareService=require(_0x3ea0('0x15'));var logger=require(_0x3ea0('0x16'))(_0x3ea0('0x17'));var utils=require(_0x3ea0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3ea0('0x19'));var db=require(_0x3ea0('0x1a'))['db'];config[_0x3ea0('0x1b')]=_[_0x3ea0('0x1c')](config[_0x3ea0('0x1b')],{'host':_0x3ea0('0x1d'),'port':0x18eb});var socket=require(_0x3ea0('0x1e'))(new Redis(config[_0x3ea0('0x1b')]));require(_0x3ea0('0x1f'))[_0x3ea0('0x20')](socket);function respondWithStatusCode(_0x45ab6a,_0x12e724){_0x12e724=_0x12e724||0xcc;return function(_0x585a8c){if(_0x585a8c){return _0x45ab6a['sendStatus'](_0x12e724);}return _0x45ab6a[_0x3ea0('0x21')](_0x12e724)['end']();};}function respondWithResult(_0x2f757f,_0x3a75e5){_0x3a75e5=_0x3a75e5||0xc8;return function(_0x3f85f4){if(_0x3f85f4){return _0x2f757f[_0x3ea0('0x21')](_0x3a75e5)[_0x3ea0('0x22')](_0x3f85f4);}};}function respondWithFilteredResult(_0x56edec,_0x2efbfd){return function(_0x514ec8){if(_0x514ec8){var _0xe87b35=typeof _0x2efbfd[_0x3ea0('0x23')]==='undefined'&&typeof _0x2efbfd[_0x3ea0('0x24')]===_0x3ea0('0x25');var _0x56bed1=_0x514ec8[_0x3ea0('0x26')];var _0xe618b3=_0xe87b35?0x0:_0x2efbfd[_0x3ea0('0x23')];var _0x541ae5=_0xe87b35?_0x514ec8['count']:_0x2efbfd[_0x3ea0('0x23')]+_0x2efbfd[_0x3ea0('0x24')];var _0x420a70;if(_0x541ae5>=_0x56bed1){_0x541ae5=_0x56bed1;_0x420a70=0xc8;}else{_0x420a70=0xce;}_0x56edec[_0x3ea0('0x21')](_0x420a70);return _0x56edec[_0x3ea0('0x27')]('Content-Range',_0xe618b3+'-'+_0x541ae5+'/'+_0x56bed1)[_0x3ea0('0x22')](_0x514ec8);}return null;};}function patchUpdates(_0xe73905){return function(_0x3cda1e){try{jsonpatch[_0x3ea0('0x28')](_0x3cda1e,_0xe73905,!![]);}catch(_0x4e8253){return BPromise[_0x3ea0('0x29')](_0x4e8253);}return _0x3cda1e[_0x3ea0('0x2a')]();};}function saveUpdates(_0x440ced,_0x3fcd8e){return function(_0x3fa1a9){if(_0x3fa1a9){return _0x3fa1a9[_0x3ea0('0x2b')](_0x440ced)[_0x3ea0('0x2c')](function(_0x26562d){return _0x26562d;});}return null;};}function removeEntity(_0x313a2b,_0x1d6031){return function(_0x277562){if(_0x277562){return _0x277562[_0x3ea0('0x2d')]()[_0x3ea0('0x2c')](function(){var _0x46d82f=_0x277562[_0x3ea0('0x2e')]({'plain':!![]});var _0x573f11=_0x3ea0('0x2f');return db[_0x3ea0('0x30')]['destroy']({'where':{'type':_0x573f11,'resourceId':_0x46d82f['id']}})[_0x3ea0('0x2c')](function(){return _0x277562;});})['then'](function(){_0x313a2b[_0x3ea0('0x21')](0xcc)[_0x3ea0('0x31')]();});}};}function handleEntityNotFound(_0x4fd347,_0x4c4b2f){return function(_0x5d403a){if(!_0x5d403a){_0x4fd347[_0x3ea0('0x32')](0x194);}return _0x5d403a;};}function handleError(_0x37dbc0,_0x23f8fa){_0x23f8fa=_0x23f8fa||0x1f4;return function(_0x24fb50){logger[_0x3ea0('0x33')](_0x24fb50[_0x3ea0('0x34')]);if(_0x24fb50[_0x3ea0('0x35')]){delete _0x24fb50[_0x3ea0('0x35')];}_0x37dbc0[_0x3ea0('0x21')](_0x23f8fa)[_0x3ea0('0x36')](_0x24fb50);};}exports['index']=function(_0x460875,_0x501ccb){var _0x67c14c={},_0x2aecd4={},_0x4d1c38={'count':0x0,'rows':[]};var _0x13d75c=_[_0x3ea0('0x37')](db[_0x3ea0('0x38')][_0x3ea0('0x39')],function(_0x247209){return{'name':_0x247209['fieldName'],'type':_0x247209[_0x3ea0('0x3a')][_0x3ea0('0x3b')]};});_0x2aecd4[_0x3ea0('0x3c')]=_[_0x3ea0('0x37')](_0x13d75c,_0x3ea0('0x35'));_0x2aecd4[_0x3ea0('0x3d')]=_[_0x3ea0('0x3e')](_0x460875[_0x3ea0('0x3d')]);_0x2aecd4[_0x3ea0('0x3f')]=_[_0x3ea0('0x40')](_0x2aecd4[_0x3ea0('0x3c')],_0x2aecd4[_0x3ea0('0x3d')]);_0x67c14c[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x2aecd4[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x460875['query'][_0x3ea0('0x42')]));_0x67c14c['attributes']=_0x67c14c[_0x3ea0('0x41')]['length']?_0x67c14c[_0x3ea0('0x41')]:_0x2aecd4[_0x3ea0('0x3c')];if(!_0x460875[_0x3ea0('0x3d')]['hasOwnProperty'](_0x3ea0('0x43'))){_0x67c14c[_0x3ea0('0x24')]=qs[_0x3ea0('0x24')](_0x460875['query'][_0x3ea0('0x24')]);_0x67c14c[_0x3ea0('0x23')]=qs[_0x3ea0('0x23')](_0x460875[_0x3ea0('0x3d')][_0x3ea0('0x23')]);}_0x67c14c[_0x3ea0('0x44')]=qs['sort'](_0x460875[_0x3ea0('0x3d')][_0x3ea0('0x45')]);_0x67c14c[_0x3ea0('0x46')]=qs[_0x3ea0('0x3f')](_[_0x3ea0('0x47')](_0x460875[_0x3ea0('0x3d')],_0x2aecd4[_0x3ea0('0x3f')]),_0x13d75c);if(_0x460875[_0x3ea0('0x3d')]['filter']){_0x67c14c[_0x3ea0('0x46')]=_['merge'](_0x67c14c[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x13d75c,function(_0x2090a6){if(_0x2090a6[_0x3ea0('0x3a')]!==_0x3ea0('0x48')){var _0x121573={};_0x121573[_0x2090a6[_0x3ea0('0x35')]]={'$like':'%'+_0x460875[_0x3ea0('0x3d')]['filter']+'%'};return _0x121573;}})});}_0x67c14c=_[_0x3ea0('0x49')]({},_0x67c14c,_0x460875[_0x3ea0('0x4a')]);var _0x4a6681={'where':_0x67c14c[_0x3ea0('0x46')]};return db[_0x3ea0('0x38')]['count'](_0x4a6681)[_0x3ea0('0x2c')](function(_0x217c29){_0x4d1c38[_0x3ea0('0x26')]=_0x217c29;if(_0x460875[_0x3ea0('0x3d')][_0x3ea0('0x4b')]){_0x67c14c[_0x3ea0('0x4c')]=[{'all':!![]}];}return db['MailQueue'][_0x3ea0('0x4d')](_0x67c14c);})[_0x3ea0('0x2c')](function(_0x2e4296){_0x4d1c38[_0x3ea0('0x4e')]=_0x2e4296;return _0x4d1c38;})['then'](respondWithFilteredResult(_0x501ccb,_0x67c14c))[_0x3ea0('0x4f')](handleError(_0x501ccb,null));};exports['show']=function(_0x39d8e2,_0x217326){var _0x4a3deb={'raw':!![],'where':{'id':_0x39d8e2[_0x3ea0('0x50')]['id']}},_0x49ab0f={};_0x49ab0f['model']=_['keys'](db[_0x3ea0('0x38')][_0x3ea0('0x39')]);_0x49ab0f['query']=_[_0x3ea0('0x3e')](_0x39d8e2['query']);_0x49ab0f['filters']=_['intersection'](_0x49ab0f[_0x3ea0('0x3c')],_0x49ab0f[_0x3ea0('0x3d')]);_0x4a3deb[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x49ab0f[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x39d8e2['query'][_0x3ea0('0x42')]));_0x4a3deb[_0x3ea0('0x41')]=_0x4a3deb[_0x3ea0('0x41')][_0x3ea0('0x51')]?_0x4a3deb['attributes']:_0x49ab0f[_0x3ea0('0x3c')];if(_0x39d8e2['query'][_0x3ea0('0x4b')]){_0x4a3deb['include']=[{'all':!![]}];}_0x4a3deb=_[_0x3ea0('0x49')]({},_0x4a3deb,_0x39d8e2['options']);return db['MailQueue'][_0x3ea0('0x52')](_0x4a3deb)['then'](handleEntityNotFound(_0x217326,null))[_0x3ea0('0x2c')](respondWithResult(_0x217326,null))[_0x3ea0('0x4f')](handleError(_0x217326,null));};exports[_0x3ea0('0x53')]=function(_0x503938,_0x1ed4ba){return db[_0x3ea0('0x38')][_0x3ea0('0x53')](_0x503938[_0x3ea0('0x54')],{})[_0x3ea0('0x2c')](function(_0x131a68){var _0x2a8037=_0x503938[_0x3ea0('0x55')]['get']({'plain':!![]});if(!_0x2a8037)throw new Error(_0x3ea0('0x56'));if(_0x2a8037['role']===_0x3ea0('0x55')){var _0x138742=_0x131a68['get']({'plain':!![]});var _0x260bfc=_0x3ea0('0x2f');return db[_0x3ea0('0x57')][_0x3ea0('0x52')]({'where':{'name':_0x260bfc,'userProfileId':_0x2a8037['userProfileId']},'raw':!![]})['then'](function(_0x726e45){if(_0x726e45&&_0x726e45[_0x3ea0('0x58')]===0x0){return db[_0x3ea0('0x30')][_0x3ea0('0x53')]({'name':_0x138742[_0x3ea0('0x35')],'resourceId':_0x138742['id'],'type':_0x726e45['name'],'sectionId':_0x726e45['id']},{})['then'](function(){return _0x131a68;});}else{return _0x131a68;}})[_0x3ea0('0x4f')](function(_0x9106e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9106e5);throw _0x9106e5;});}return _0x131a68;})[_0x3ea0('0x2c')](respondWithResult(_0x1ed4ba,0xc9))[_0x3ea0('0x4f')](handleError(_0x1ed4ba,null));};exports[_0x3ea0('0x2b')]=function(_0x12cbe4,_0x1fdda3){if(_0x12cbe4['body']['id']){delete _0x12cbe4[_0x3ea0('0x54')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x12cbe4[_0x3ea0('0x50')]['id']}})['then'](handleEntityNotFound(_0x1fdda3,null))['then'](saveUpdates(_0x12cbe4[_0x3ea0('0x54')],null))['then'](respondWithResult(_0x1fdda3,null))['catch'](handleError(_0x1fdda3,null));};exports[_0x3ea0('0x2d')]=function(_0x245099,_0x4335c5){return db['MailQueue'][_0x3ea0('0x52')]({'where':{'id':_0x245099[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x4335c5,null))[_0x3ea0('0x2c')](removeEntity(_0x4335c5,null))[_0x3ea0('0x4f')](handleError(_0x4335c5,null));};exports[_0x3ea0('0x59')]=function(_0x489fa7,_0x513a42){return db[_0x3ea0('0x38')][_0x3ea0('0x59')]()[_0x3ea0('0x2c')](respondWithResult(_0x513a42,null))[_0x3ea0('0x4f')](handleError(_0x513a42,null));};exports[_0x3ea0('0x5a')]=function(_0x2561b8,_0x595a92,_0x214bdf){var _0x571042={'raw':!![],'where':{}},_0x227e93={},_0x597210;return db['MailQueue'][_0x3ea0('0x5b')]({'where':{'id':_0x2561b8[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x595a92,null))[_0x3ea0('0x2c')](function(_0x119aa0){if(_0x119aa0){_0x597210=_0x119aa0[_0x3ea0('0x2e')]({'plain':!![]});_0x227e93[_0x3ea0('0x3c')]=_[_0x3ea0('0x3e')](db['UserMailQueue'][_0x3ea0('0x39')]);_0x227e93['query']=_[_0x3ea0('0x3e')](_0x2561b8[_0x3ea0('0x3d')]);_0x227e93[_0x3ea0('0x3f')]=_[_0x3ea0('0x40')](_0x227e93[_0x3ea0('0x3c')],_0x227e93['query']);_0x571042[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x227e93[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x2561b8[_0x3ea0('0x3d')]['fields']));_0x571042['attributes']=_0x571042['attributes'][_0x3ea0('0x51')]?_0x571042[_0x3ea0('0x41')]:_0x227e93[_0x3ea0('0x3c')];if(!_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x5c')](_0x3ea0('0x43'))){_0x571042['limit']=qs['limit'](_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x24')]);_0x571042[_0x3ea0('0x23')]=qs['offset'](_0x2561b8['query'][_0x3ea0('0x23')]);}_0x571042['order']=qs['sort'](_0x2561b8['query'][_0x3ea0('0x45')]);_0x571042[_0x3ea0('0x46')]=qs[_0x3ea0('0x3f')](_[_0x3ea0('0x47')](_0x2561b8['query'],_0x227e93[_0x3ea0('0x3f')]));_0x571042['where']['MailQueueId']=_0x119aa0['id'];if(_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x5d')]){_0x571042[_0x3ea0('0x46')]=_[_0x3ea0('0x49')](_0x571042[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x571042[_0x3ea0('0x41')],function(_0x207e5a){var _0x340a49={};_0x340a49[_0x207e5a]={'$like':'%'+_0x2561b8[_0x3ea0('0x3d')][_0x3ea0('0x5d')]+'%'};return _0x340a49;})});}_0x571042=_[_0x3ea0('0x49')]({},_0x571042,_0x2561b8[_0x3ea0('0x4a')]);return db['UserMailQueue'][_0x3ea0('0x4d')](_0x571042);}})[_0x3ea0('0x2c')](function(_0x5f2504){if(_0x5f2504){return db[_0x3ea0('0x5e')][_0x3ea0('0x5f')]({'where':{'id':_[_0x3ea0('0x37')](_0x5f2504,'UserId'),'role':_0x3ea0('0x60')},'attributes':['id','name',_0x3ea0('0x61'),_0x3ea0('0x62'),'createdAt']});}})[_0x3ea0('0x2c')](function(_0x5aa0d0){if(_0x5aa0d0){return{'count':_0x5aa0d0[_0x3ea0('0x26')],'rows':_['map'](_0x5aa0d0[_0x3ea0('0x4e')],function(_0x202267){return{'membername':_0x202267['name'],'UserId':_0x202267['id'],'queue_name':_0x597210[_0x3ea0('0x35')],'MailQueueId':_0x597210['id'],'interface':util[_0x3ea0('0x63')](_0x3ea0('0x64'),_0x3ea0('0x65'),_0x202267[_0x3ea0('0x35')]),'penalty':0x0,'paused':_0x202267[_0x3ea0('0x61')],'createdAt':_0x202267[_0x3ea0('0x66')],'updatedAt':_0x202267[_0x3ea0('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ea0('0x2c')](respondWithFilteredResult(_0x595a92,_0x571042))[_0x3ea0('0x4f')](handleError(_0x595a92,null));};exports[_0x3ea0('0x67')]=function(_0x42749f,_0x15e8bd,_0x5bfd5c){var _0x1122cf={};var _0x3bd7b3={};var _0x451b48;var _0x5801a5;return db[_0x3ea0('0x38')]['findOne']({'where':{'id':_0x42749f[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x15e8bd,null))[_0x3ea0('0x2c')](function(_0x4ad81d){if(_0x4ad81d){_0x451b48=_0x4ad81d;_0x3bd7b3[_0x3ea0('0x3c')]=_[_0x3ea0('0x3e')](db[_0x3ea0('0x68')][_0x3ea0('0x39')]);_0x3bd7b3[_0x3ea0('0x3d')]=_['keys'](_0x42749f[_0x3ea0('0x3d')]);_0x3bd7b3[_0x3ea0('0x3f')]=_[_0x3ea0('0x40')](_0x3bd7b3['model'],_0x3bd7b3[_0x3ea0('0x3d')]);_0x1122cf[_0x3ea0('0x41')]=_[_0x3ea0('0x40')](_0x3bd7b3[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x42749f['query'][_0x3ea0('0x42')]));_0x1122cf['attributes']=_0x1122cf['attributes'][_0x3ea0('0x51')]?_0x1122cf['attributes']:_0x3bd7b3[_0x3ea0('0x3c')];_0x1122cf['order']=qs[_0x3ea0('0x45')](_0x42749f[_0x3ea0('0x3d')]['sort']);_0x1122cf[_0x3ea0('0x46')]=qs['filters'](_[_0x3ea0('0x47')](_0x42749f[_0x3ea0('0x3d')],_0x3bd7b3[_0x3ea0('0x3f')]));if(_0x42749f[_0x3ea0('0x3d')]['filter']){_0x1122cf[_0x3ea0('0x46')]=_['merge'](_0x1122cf[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x1122cf[_0x3ea0('0x41')],function(_0x386091){var _0x18996e={};_0x18996e[_0x386091]={'$like':'%'+_0x42749f[_0x3ea0('0x3d')][_0x3ea0('0x5d')]+'%'};return _0x18996e;})});}_0x1122cf=_[_0x3ea0('0x49')]({},_0x1122cf,_0x42749f[_0x3ea0('0x4a')]);return _0x451b48[_0x3ea0('0x67')](_0x1122cf);}})[_0x3ea0('0x2c')](function(_0x5396ce){if(_0x5396ce){_0x5801a5=_0x5396ce['length'];if(!_0x42749f[_0x3ea0('0x3d')][_0x3ea0('0x5c')](_0x3ea0('0x43'))){_0x1122cf[_0x3ea0('0x24')]=qs[_0x3ea0('0x24')](_0x42749f[_0x3ea0('0x3d')]['limit']);_0x1122cf['offset']=qs[_0x3ea0('0x23')](_0x42749f['query'][_0x3ea0('0x23')]);}return _0x451b48[_0x3ea0('0x67')](_0x1122cf);}})[_0x3ea0('0x2c')](function(_0x1716e3){if(_0x1716e3){return _0x1716e3?{'count':_0x5801a5,'rows':_0x1716e3}:null;}})['then'](respondWithResult(_0x15e8bd,null))[_0x3ea0('0x4f')](handleError(_0x15e8bd,null));};exports[_0x3ea0('0x69')]=function(_0x22b1c7,_0x36e6af,_0x854ff9){var _0x184e40=_0x22b1c7[_0x3ea0('0x54')]['ids'];return db[_0x3ea0('0x68')][_0x3ea0('0x4d')]({'where':{'id':_0x184e40},'attributes':['id'],'include':[{'model':db[_0x3ea0('0x5e')],'as':_0x3ea0('0x6a'),'attributes':['id',_0x3ea0('0x35'),_0x3ea0('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0x3ea0('0x2c')](function(_0x4510b9){if(_0x4510b9){var _0x1082fb=_[_0x3ea0('0x6c')](_0x4510b9,function(_0x49256a){var _0x17a9f6=_0x49256a[_0x3ea0('0x2e')]({'plain':!![]});return _0x17a9f6['Agents'];});return db['MailQueue'][_0x3ea0('0x52')]({'where':{'id':_0x22b1c7[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](function(_0x368233){return db[_0x3ea0('0x6d')]['transaction'](function(_0x2f82f0){return _0x368233['addTeams'](_0x184e40,{'transaction':_0x2f82f0})[_0x3ea0('0x2c')](function(){return BPromise[_0x3ea0('0x6e')](_0x1082fb,function(_0x5179b2){return db[_0x3ea0('0x6f')][_0x3ea0('0x70')]({'where':{'UserId':_0x5179b2['id'],'MailQueueId':_0x22b1c7[_0x3ea0('0x50')]['id']},'transaction':_0x2f82f0});});})[_0x3ea0('0x2c')](function(){_0x1082fb[_0x3ea0('0x71')](function(_0x326dc3){socket[_0x3ea0('0x72')](_0x3ea0('0x73'),{'UserId':_0x326dc3['id'],'MailQueueId':_0x368233['id']});});});});});}})[_0x3ea0('0x2c')](respondWithStatusCode(_0x36e6af,null))[_0x3ea0('0x4f')](handleError(_0x36e6af,null));};exports['removeTeams']=function(_0x5aace2,_0x15713f,_0x5f5309){return db[_0x3ea0('0x68')][_0x3ea0('0x4d')]({'where':{'id':_0x5aace2[_0x3ea0('0x3d')][_0x3ea0('0x74')]},'attributes':['id'],'include':[{'model':db[_0x3ea0('0x5e')],'as':_0x3ea0('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x15713f,null))[_0x3ea0('0x2c')](function(_0x4c8065){var _0xa7a117=_[_0x3ea0('0x37')](_0x4c8065,'id');var _0x1aa541=[];var _0x3df196=[];var _0x2ec0bc=squel[_0x3ea0('0x75')]();_0x2ec0bc[_0x3ea0('0x76')](_0x3ea0('0x77'))[_0x3ea0('0x78')]('team_has_mail_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3ea0('0x46')]('MailQueueId\x20=\x20?',_0x5aace2[_0x3ea0('0x50')]['id']);for(var _0x919388=0x0;_0x919388<_0x4c8065[_0x3ea0('0x51')];_0x919388+=0x1){let _0x30f41f=_0x4c8065[_0x919388];for(var _0x4a0a87=0x0;_0x4a0a87<_0x30f41f[_0x3ea0('0x6a')][_0x3ea0('0x51')];_0x4a0a87+=0x1){let _0x5c8b24=_0x30f41f['Agents'][_0x4a0a87];var _0x2bdd0b=_0x2ec0bc[_0x3ea0('0x79')]();_0x2bdd0b[_0x3ea0('0x46')](_0x3ea0('0x7a'),_0x5c8b24['id']);_0x3df196[_0x3ea0('0x7b')](db['sequelize'][_0x3ea0('0x3d')](_0x2bdd0b[_0x3ea0('0x7c')](),{'type':db[_0x3ea0('0x6d')][_0x3ea0('0x7d')]['SELECT']})['then'](function(_0x5f03fb){if(_0x5f03fb[_0x3ea0('0x51')]===0x1){return _0x5c8b24['id'];}else{var _0x4771cb=_[_0x3ea0('0x7e')](_[_0x3ea0('0x37')](_0x5f03fb,_0x3ea0('0x7f')),function(_0x451e0d){return _[_0x3ea0('0x80')](_0xa7a117,_0x451e0d);});if(_0x4771cb){return _0x5c8b24['id'];}}}));}}return BPromise[_0x3ea0('0x81')](_0x3df196)[_0x3ea0('0x2c')](function(_0xe230f5){_0x1aa541=_(_0x1aa541)[_0x3ea0('0x82')](_0xe230f5)[_0x3ea0('0x83')]()['value']();return db[_0x3ea0('0x38')]['find']({'where':{'id':_0x5aace2[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](function(_0x4f8284){return db[_0x3ea0('0x6d')]['transaction'](function(_0xbc4332){return _0x4f8284[_0x3ea0('0x84')](_0x5aace2[_0x3ea0('0x3d')][_0x3ea0('0x74')],{'transaction':_0xbc4332})[_0x3ea0('0x2c')](function(){if(!_[_0x3ea0('0x85')](_0x1aa541)){return _0x4f8284[_0x3ea0('0x86')](_0x1aa541,{'transaction':_0xbc4332});}})[_0x3ea0('0x2c')](function(){_0x1aa541[_0x3ea0('0x71')](function(_0x553778){socket[_0x3ea0('0x72')](_0x3ea0('0x87'),{'UserId':_0x553778,'MailQueueId':_0x4f8284['id']});});});});});});})[_0x3ea0('0x2c')](respondWithStatusCode(_0x15713f,null))['catch'](handleError(_0x15713f,null));};exports[_0x3ea0('0x88')]=function(_0x540026,_0x444f6d,_0x1954f3){return db[_0x3ea0('0x38')][_0x3ea0('0x52')]({'where':{'id':_0x540026[_0x3ea0('0x50')]['id']}})['then'](handleEntityNotFound(_0x444f6d,null))['then'](function(_0x349e49){if(_0x349e49){return _0x349e49[_0x3ea0('0x88')](_0x540026['body'][_0x3ea0('0x74')],_[_0x3ea0('0x89')](_0x540026[_0x3ea0('0x54')],['ids','id'])||{})[_0x3ea0('0x8a')](function(_0x5a710a){for(var _0x4da028=0x0;_0x4da028<_0x540026[_0x3ea0('0x54')][_0x3ea0('0x74')][_0x3ea0('0x51')];_0x4da028+=0x1){socket['emit'](_0x3ea0('0x73'),{'UserId':Number(_0x540026[_0x3ea0('0x54')][_0x3ea0('0x74')][_0x4da028]),'MailQueueId':Number(_0x540026[_0x3ea0('0x50')]['id'])});}return _0x5a710a;});}})[_0x3ea0('0x2c')](respondWithResult(_0x444f6d,null))[_0x3ea0('0x4f')](handleError(_0x444f6d,null));};exports[_0x3ea0('0x86')]=function(_0x223955,_0x4b8b8b,_0x90ec0c){return db[_0x3ea0('0x38')][_0x3ea0('0x52')]({'where':{'id':_0x223955[_0x3ea0('0x50')]['id']}})['then'](handleEntityNotFound(_0x4b8b8b,null))[_0x3ea0('0x2c')](function(_0x54ebb4){if(_0x54ebb4){return _0x54ebb4[_0x3ea0('0x86')](_0x223955[_0x3ea0('0x3d')][_0x3ea0('0x74')])[_0x3ea0('0x2c')](function(){if(_[_0x3ea0('0x8b')](_0x223955[_0x3ea0('0x3d')][_0x3ea0('0x74')])){for(var _0x4c664e=0x0;_0x4c664e<_0x223955[_0x3ea0('0x3d')]['ids'][_0x3ea0('0x51')];_0x4c664e+=0x1){socket[_0x3ea0('0x72')](_0x3ea0('0x87'),{'UserId':Number(_0x223955['query']['ids'][_0x4c664e]),'MailQueueId':Number(_0x223955[_0x3ea0('0x50')]['id'])});}}else{socket['emit'](_0x3ea0('0x87'),{'UserId':Number(_0x223955['query']['ids']),'MailQueueId':Number(_0x223955[_0x3ea0('0x50')]['id'])});}});}})[_0x3ea0('0x2c')](respondWithStatusCode(_0x4b8b8b,null))[_0x3ea0('0x4f')](handleError(_0x4b8b8b,null));};exports['getAgents']=function(_0x3b0416,_0x226ff8,_0x2b8682){var _0x552144={};var _0x543467={};var _0x50f9fa;var _0x417092;return db['MailQueue'][_0x3ea0('0x5b')]({'where':{'id':_0x3b0416[_0x3ea0('0x50')]['id']}})[_0x3ea0('0x2c')](handleEntityNotFound(_0x226ff8,null))[_0x3ea0('0x2c')](function(_0x2963c8){if(_0x2963c8){_0x50f9fa=_0x2963c8;_0x543467[_0x3ea0('0x3c')]=_[_0x3ea0('0x3e')](db[_0x3ea0('0x5e')][_0x3ea0('0x39')]);_0x543467[_0x3ea0('0x3d')]=_[_0x3ea0('0x3e')](_0x3b0416[_0x3ea0('0x3d')]);_0x543467['filters']=_[_0x3ea0('0x40')](_0x543467['model'],_0x543467['query']);_0x552144['attributes']=_[_0x3ea0('0x40')](_0x543467[_0x3ea0('0x3c')],qs[_0x3ea0('0x42')](_0x3b0416[_0x3ea0('0x3d')][_0x3ea0('0x42')]));_0x552144[_0x3ea0('0x41')]=_0x552144[_0x3ea0('0x41')][_0x3ea0('0x51')]?_0x552144[_0x3ea0('0x41')]:_0x543467['model'];_0x552144[_0x3ea0('0x44')]=qs['sort'](_0x3b0416[_0x3ea0('0x3d')]['sort']);_0x552144[_0x3ea0('0x46')]=qs[_0x3ea0('0x3f')](_[_0x3ea0('0x47')](_0x3b0416[_0x3ea0('0x3d')],_0x543467['filters']));if(_0x3b0416[_0x3ea0('0x3d')]['filter']){_0x552144['where']=_['merge'](_0x552144[_0x3ea0('0x46')],{'$or':_[_0x3ea0('0x37')](_0x552144[_0x3ea0('0x41')],function(_0x5933c6){var _0x4f9003={};_0x4f9003[_0x5933c6]={'$like':'%'+_0x3b0416[_0x3ea0('0x3d')]['filter']+'%'};return _0x4f9003;})});}_0x552144=_[_0x3ea0('0x49')]({},_0x552144,_0x3b0416[_0x3ea0('0x4a')]);return _0x50f9fa['getAgents'](_0x552144);}})[_0x3ea0('0x2c')](function(_0x26dbbb){if(_0x26dbbb){_0x417092=_0x26dbbb[_0x3ea0('0x51')];if(!_0x3b0416[_0x3ea0('0x3d')][_0x3ea0('0x5c')](_0x3ea0('0x43'))){_0x552144['limit']=qs[_0x3ea0('0x24')](_0x3b0416[_0x3ea0('0x3d')]['limit']);_0x552144['offset']=qs[_0x3ea0('0x23')](_0x3b0416[_0x3ea0('0x3d')][_0x3ea0('0x23')]);}return _0x50f9fa[_0x3ea0('0x8c')](_0x552144);}})[_0x3ea0('0x2c')](function(_0x1c7390){if(_0x1c7390){return _0x1c7390?{'count':_0x417092,'rows':_0x1c7390}:null;}})['then'](respondWithResult(_0x226ff8,null))[_0x3ea0('0x4f')](handleError(_0x226ff8,null));}; \ No newline at end of file +var _0x0884=['voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','MailQueues','name','send','map','MailQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','mailPause','updatedAt','format','SIP','createdAt','getTeams','addTeams','ids','Team','findAll','Agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4088('0x0'));var rimraf=require(_0x4088('0x1'));var zipdir=require(_0x4088('0x2'));var jsonpatch=require(_0x4088('0x3'));var rp=require(_0x4088('0x4'));var moment=require(_0x4088('0x5'));var BPromise=require(_0x4088('0x6'));var Mustache=require('mustache');var util=require(_0x4088('0x7'));var path=require(_0x4088('0x8'));var sox=require(_0x4088('0x9'));var csv=require(_0x4088('0xa'));var ejs=require(_0x4088('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4088('0xc'));var crypto=require('crypto');var jsforce=require(_0x4088('0xd'));var deskjs=require(_0x4088('0xe'));var toCsv=require(_0x4088('0xa'));var querystring=require(_0x4088('0xf'));var Papa=require(_0x4088('0x10'));var Redis=require(_0x4088('0x11'));var authService=require(_0x4088('0x12'));var qs=require(_0x4088('0x13'));var as=require(_0x4088('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4088('0x15'))(_0x4088('0x16'));var utils=require(_0x4088('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4088('0x18'));var db=require(_0x4088('0x19'))['db'];config['redis']=_[_0x4088('0x1a')](config[_0x4088('0x1b')],{'host':_0x4088('0x1c'),'port':0x18eb});var socket=require(_0x4088('0x1d'))(new Redis(config[_0x4088('0x1b')]));require(_0x4088('0x1e'))[_0x4088('0x1f')](socket);function respondWithStatusCode(_0x30c843,_0x8505b5){_0x8505b5=_0x8505b5||0xcc;return function(_0x4a4743){if(_0x4a4743){return _0x30c843[_0x4088('0x20')](_0x8505b5);}return _0x30c843[_0x4088('0x21')](_0x8505b5)[_0x4088('0x22')]();};}function respondWithResult(_0x51ff21,_0x1f62b5){_0x1f62b5=_0x1f62b5||0xc8;return function(_0xe5ceab){if(_0xe5ceab){return _0x51ff21[_0x4088('0x21')](_0x1f62b5)[_0x4088('0x23')](_0xe5ceab);}};}function respondWithFilteredResult(_0x55712b,_0x155d65){return function(_0x24fe84){if(_0x24fe84){var _0xc7fc8e=typeof _0x155d65[_0x4088('0x24')]===_0x4088('0x25')&&typeof _0x155d65[_0x4088('0x26')]===_0x4088('0x25');var _0x3d7570=_0x24fe84[_0x4088('0x27')];var _0x396762=_0xc7fc8e?0x0:_0x155d65['offset'];var _0x4650e5=_0xc7fc8e?_0x24fe84['count']:_0x155d65['offset']+_0x155d65['limit'];var _0x5c49c8;if(_0x4650e5>=_0x3d7570){_0x4650e5=_0x3d7570;_0x5c49c8=0xc8;}else{_0x5c49c8=0xce;}_0x55712b[_0x4088('0x21')](_0x5c49c8);return _0x55712b[_0x4088('0x28')](_0x4088('0x29'),_0x396762+'-'+_0x4650e5+'/'+_0x3d7570)[_0x4088('0x23')](_0x24fe84);}return null;};}function patchUpdates(_0x5e8031){return function(_0x706539){try{jsonpatch[_0x4088('0x2a')](_0x706539,_0x5e8031,!![]);}catch(_0x3b61b3){return BPromise['reject'](_0x3b61b3);}return _0x706539['save']();};}function saveUpdates(_0x27ee8e,_0xdca2c0){return function(_0x3ae908){if(_0x3ae908){return _0x3ae908[_0x4088('0x2b')](_0x27ee8e)[_0x4088('0x2c')](function(_0x1274c5){return _0x1274c5;});}return null;};}function removeEntity(_0x5933cf,_0x482758){return function(_0x2e6f91){if(_0x2e6f91){return _0x2e6f91[_0x4088('0x2d')]()[_0x4088('0x2c')](function(){var _0x3f49f6=_0x2e6f91[_0x4088('0x2e')]({'plain':!![]});var _0x29f58b=_0x4088('0x2f');return db['UserProfileResource'][_0x4088('0x2d')]({'where':{'type':_0x29f58b,'resourceId':_0x3f49f6['id']}})['then'](function(){return _0x2e6f91;});})['then'](function(){_0x5933cf[_0x4088('0x21')](0xcc)[_0x4088('0x22')]();});}};}function handleEntityNotFound(_0x40b8a5,_0x5b2b91){return function(_0x2b0a9a){if(!_0x2b0a9a){_0x40b8a5[_0x4088('0x20')](0x194);}return _0x2b0a9a;};}function handleError(_0x2bc7dd,_0x510041){_0x510041=_0x510041||0x1f4;return function(_0x3338fa){logger['error'](_0x3338fa['stack']);if(_0x3338fa[_0x4088('0x30')]){delete _0x3338fa[_0x4088('0x30')];}_0x2bc7dd['status'](_0x510041)[_0x4088('0x31')](_0x3338fa);};}exports['index']=function(_0xdf7092,_0x170399){var _0x3b0b35={},_0x259ecd={},_0x15fcab={'count':0x0,'rows':[]};var _0x4e5b8f=_[_0x4088('0x32')](db[_0x4088('0x33')][_0x4088('0x34')],function(_0x5dd5ba){return{'name':_0x5dd5ba[_0x4088('0x35')],'type':_0x5dd5ba['type'][_0x4088('0x36')]};});_0x259ecd[_0x4088('0x37')]=_['map'](_0x4e5b8f,_0x4088('0x30'));_0x259ecd['query']=_[_0x4088('0x38')](_0xdf7092[_0x4088('0x39')]);_0x259ecd[_0x4088('0x3a')]=_[_0x4088('0x3b')](_0x259ecd[_0x4088('0x37')],_0x259ecd[_0x4088('0x39')]);_0x3b0b35['attributes']=_[_0x4088('0x3b')](_0x259ecd[_0x4088('0x37')],qs['fields'](_0xdf7092[_0x4088('0x39')][_0x4088('0x3c')]));_0x3b0b35['attributes']=_0x3b0b35['attributes'][_0x4088('0x3d')]?_0x3b0b35[_0x4088('0x3e')]:_0x259ecd[_0x4088('0x37')];if(!_0xdf7092[_0x4088('0x39')][_0x4088('0x3f')](_0x4088('0x40'))){_0x3b0b35['limit']=qs[_0x4088('0x26')](_0xdf7092[_0x4088('0x39')][_0x4088('0x26')]);_0x3b0b35['offset']=qs[_0x4088('0x24')](_0xdf7092[_0x4088('0x39')]['offset']);}_0x3b0b35[_0x4088('0x41')]=qs[_0x4088('0x42')](_0xdf7092[_0x4088('0x39')][_0x4088('0x42')]);_0x3b0b35[_0x4088('0x43')]=qs[_0x4088('0x3a')](_[_0x4088('0x44')](_0xdf7092[_0x4088('0x39')],_0x259ecd[_0x4088('0x3a')]),_0x4e5b8f);if(_0xdf7092[_0x4088('0x39')][_0x4088('0x45')]){_0x3b0b35['where']=_[_0x4088('0x46')](_0x3b0b35[_0x4088('0x43')],{'$or':_['map'](_0x4e5b8f,function(_0x5167b8){if(_0x5167b8[_0x4088('0x47')]!=='VIRTUAL'){var _0x4a4bfa={};_0x4a4bfa[_0x5167b8['name']]={'$like':'%'+_0xdf7092[_0x4088('0x39')]['filter']+'%'};return _0x4a4bfa;}})});}_0x3b0b35=_[_0x4088('0x46')]({},_0x3b0b35,_0xdf7092[_0x4088('0x48')]);var _0x9a6e2a={'where':_0x3b0b35[_0x4088('0x43')]};return db[_0x4088('0x33')]['count'](_0x9a6e2a)['then'](function(_0xcb50d6){_0x15fcab[_0x4088('0x27')]=_0xcb50d6;if(_0xdf7092[_0x4088('0x39')]['includeAll']){_0x3b0b35[_0x4088('0x49')]=[{'all':!![]}];}return db[_0x4088('0x33')]['findAll'](_0x3b0b35);})[_0x4088('0x2c')](function(_0x9cbf69){_0x15fcab[_0x4088('0x4a')]=_0x9cbf69;return _0x15fcab;})[_0x4088('0x2c')](respondWithFilteredResult(_0x170399,_0x3b0b35))[_0x4088('0x4b')](handleError(_0x170399,null));};exports[_0x4088('0x4c')]=function(_0x442b78,_0x13b683){var _0xec2f0e={'raw':!![],'where':{'id':_0x442b78[_0x4088('0x4d')]['id']}},_0x131f0d={};_0x131f0d[_0x4088('0x37')]=_[_0x4088('0x38')](db[_0x4088('0x33')][_0x4088('0x34')]);_0x131f0d[_0x4088('0x39')]=_[_0x4088('0x38')](_0x442b78[_0x4088('0x39')]);_0x131f0d[_0x4088('0x3a')]=_['intersection'](_0x131f0d[_0x4088('0x37')],_0x131f0d[_0x4088('0x39')]);_0xec2f0e[_0x4088('0x3e')]=_[_0x4088('0x3b')](_0x131f0d[_0x4088('0x37')],qs['fields'](_0x442b78['query'][_0x4088('0x3c')]));_0xec2f0e[_0x4088('0x3e')]=_0xec2f0e[_0x4088('0x3e')]['length']?_0xec2f0e[_0x4088('0x3e')]:_0x131f0d['model'];if(_0x442b78[_0x4088('0x39')][_0x4088('0x4e')]){_0xec2f0e[_0x4088('0x49')]=[{'all':!![]}];}_0xec2f0e=_['merge']({},_0xec2f0e,_0x442b78[_0x4088('0x48')]);return db[_0x4088('0x33')][_0x4088('0x4f')](_0xec2f0e)[_0x4088('0x2c')](handleEntityNotFound(_0x13b683,null))[_0x4088('0x2c')](respondWithResult(_0x13b683,null))[_0x4088('0x4b')](handleError(_0x13b683,null));};exports[_0x4088('0x50')]=function(_0x1f8095,_0x6af70){return db[_0x4088('0x33')][_0x4088('0x50')](_0x1f8095[_0x4088('0x51')],{})[_0x4088('0x2c')](function(_0x2bea46){var _0xdcb500=_0x1f8095[_0x4088('0x52')]['get']({'plain':!![]});if(!_0xdcb500)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdcb500[_0x4088('0x53')]===_0x4088('0x52')){var _0x19e292=_0x2bea46[_0x4088('0x2e')]({'plain':!![]});var _0x363087=_0x4088('0x2f');return db[_0x4088('0x54')][_0x4088('0x4f')]({'where':{'name':_0x363087,'userProfileId':_0xdcb500[_0x4088('0x55')]},'raw':!![]})['then'](function(_0x1bdbd6){if(_0x1bdbd6&&_0x1bdbd6['autoAssociation']===0x0){return db[_0x4088('0x56')][_0x4088('0x50')]({'name':_0x19e292['name'],'resourceId':_0x19e292['id'],'type':_0x1bdbd6[_0x4088('0x30')],'sectionId':_0x1bdbd6['id']},{})[_0x4088('0x2c')](function(){return _0x2bea46;});}else{return _0x2bea46;}})[_0x4088('0x4b')](function(_0x27a06b){logger[_0x4088('0x57')](_0x4088('0x58'),_0x27a06b);throw _0x27a06b;});}return _0x2bea46;})[_0x4088('0x2c')](respondWithResult(_0x6af70,0xc9))[_0x4088('0x4b')](handleError(_0x6af70,null));};exports['update']=function(_0x17d895,_0x114675){if(_0x17d895[_0x4088('0x51')]['id']){delete _0x17d895[_0x4088('0x51')]['id'];}return db[_0x4088('0x33')]['find']({'where':{'id':_0x17d895[_0x4088('0x4d')]['id']}})[_0x4088('0x2c')](handleEntityNotFound(_0x114675,null))['then'](saveUpdates(_0x17d895[_0x4088('0x51')],null))[_0x4088('0x2c')](respondWithResult(_0x114675,null))[_0x4088('0x4b')](handleError(_0x114675,null));};exports[_0x4088('0x2d')]=function(_0x53187c,_0x4b6f65){return db['MailQueue']['find']({'where':{'id':_0x53187c['params']['id']}})[_0x4088('0x2c')](handleEntityNotFound(_0x4b6f65,null))[_0x4088('0x2c')](removeEntity(_0x4b6f65,null))[_0x4088('0x4b')](handleError(_0x4b6f65,null));};exports[_0x4088('0x59')]=function(_0x2e71e0,_0x2a51f7){return db['MailQueue']['describe']()[_0x4088('0x2c')](respondWithResult(_0x2a51f7,null))[_0x4088('0x4b')](handleError(_0x2a51f7,null));};exports[_0x4088('0x5a')]=function(_0xc30cae,_0x23cc72,_0x34f577){var _0x3c1efc={'raw':!![],'where':{}},_0x42a222={},_0x3955cf;return db[_0x4088('0x33')][_0x4088('0x5b')]({'where':{'id':_0xc30cae[_0x4088('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23cc72,null))[_0x4088('0x2c')](function(_0x3dcd92){if(_0x3dcd92){_0x3955cf=_0x3dcd92[_0x4088('0x2e')]({'plain':!![]});_0x42a222[_0x4088('0x37')]=_[_0x4088('0x38')](db[_0x4088('0x5c')][_0x4088('0x34')]);_0x42a222[_0x4088('0x39')]=_[_0x4088('0x38')](_0xc30cae[_0x4088('0x39')]);_0x42a222['filters']=_[_0x4088('0x3b')](_0x42a222[_0x4088('0x37')],_0x42a222[_0x4088('0x39')]);_0x3c1efc[_0x4088('0x3e')]=_['intersection'](_0x42a222[_0x4088('0x37')],qs['fields'](_0xc30cae[_0x4088('0x39')]['fields']));_0x3c1efc[_0x4088('0x3e')]=_0x3c1efc['attributes'][_0x4088('0x3d')]?_0x3c1efc[_0x4088('0x3e')]:_0x42a222[_0x4088('0x37')];if(!_0xc30cae[_0x4088('0x39')]['hasOwnProperty']('nolimit')){_0x3c1efc[_0x4088('0x26')]=qs['limit'](_0xc30cae[_0x4088('0x39')][_0x4088('0x26')]);_0x3c1efc[_0x4088('0x24')]=qs['offset'](_0xc30cae['query']['offset']);}_0x3c1efc[_0x4088('0x41')]=qs[_0x4088('0x42')](_0xc30cae['query'][_0x4088('0x42')]);_0x3c1efc[_0x4088('0x43')]=qs[_0x4088('0x3a')](_[_0x4088('0x44')](_0xc30cae[_0x4088('0x39')],_0x42a222[_0x4088('0x3a')]));_0x3c1efc[_0x4088('0x43')][_0x4088('0x5d')]=_0x3dcd92['id'];if(_0xc30cae[_0x4088('0x39')][_0x4088('0x45')]){_0x3c1efc[_0x4088('0x43')]=_[_0x4088('0x46')](_0x3c1efc[_0x4088('0x43')],{'$or':_[_0x4088('0x32')](_0x3c1efc[_0x4088('0x3e')],function(_0x258d28){var _0x5663e1={};_0x5663e1[_0x258d28]={'$like':'%'+_0xc30cae[_0x4088('0x39')][_0x4088('0x45')]+'%'};return _0x5663e1;})});}_0x3c1efc=_[_0x4088('0x46')]({},_0x3c1efc,_0xc30cae[_0x4088('0x48')]);return db[_0x4088('0x5c')]['findAll'](_0x3c1efc);}})[_0x4088('0x2c')](function(_0x1c57ff){if(_0x1c57ff){return db[_0x4088('0x5e')][_0x4088('0x5f')]({'where':{'id':_[_0x4088('0x32')](_0x1c57ff,'UserId'),'role':'agent'},'attributes':['id',_0x4088('0x30'),_0x4088('0x60'),_0x4088('0x61'),'createdAt']});}})[_0x4088('0x2c')](function(_0x42cbc1){if(_0x42cbc1){return{'count':_0x42cbc1[_0x4088('0x27')],'rows':_[_0x4088('0x32')](_0x42cbc1[_0x4088('0x4a')],function(_0x4d5cf5){return{'membername':_0x4d5cf5['name'],'UserId':_0x4d5cf5['id'],'queue_name':_0x3955cf[_0x4088('0x30')],'MailQueueId':_0x3955cf['id'],'interface':util[_0x4088('0x62')]('%s/%s',_0x4088('0x63'),_0x4d5cf5[_0x4088('0x30')]),'penalty':0x0,'paused':_0x4d5cf5[_0x4088('0x60')],'createdAt':_0x4d5cf5[_0x4088('0x64')],'updatedAt':_0x4d5cf5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4088('0x2c')](respondWithFilteredResult(_0x23cc72,_0x3c1efc))[_0x4088('0x4b')](handleError(_0x23cc72,null));};exports['getTeams']=function(_0x137f13,_0x343591,_0x2bbb15){var _0x12e55b={};var _0x29a667={};var _0x17e3a6;var _0x2974ee;return db[_0x4088('0x33')][_0x4088('0x5b')]({'where':{'id':_0x137f13[_0x4088('0x4d')]['id']}})[_0x4088('0x2c')](handleEntityNotFound(_0x343591,null))[_0x4088('0x2c')](function(_0x576f52){if(_0x576f52){_0x17e3a6=_0x576f52;_0x29a667[_0x4088('0x37')]=_['keys'](db['Team']['rawAttributes']);_0x29a667[_0x4088('0x39')]=_['keys'](_0x137f13[_0x4088('0x39')]);_0x29a667['filters']=_['intersection'](_0x29a667[_0x4088('0x37')],_0x29a667[_0x4088('0x39')]);_0x12e55b[_0x4088('0x3e')]=_[_0x4088('0x3b')](_0x29a667[_0x4088('0x37')],qs[_0x4088('0x3c')](_0x137f13[_0x4088('0x39')][_0x4088('0x3c')]));_0x12e55b[_0x4088('0x3e')]=_0x12e55b[_0x4088('0x3e')][_0x4088('0x3d')]?_0x12e55b['attributes']:_0x29a667[_0x4088('0x37')];_0x12e55b[_0x4088('0x41')]=qs['sort'](_0x137f13[_0x4088('0x39')][_0x4088('0x42')]);_0x12e55b[_0x4088('0x43')]=qs[_0x4088('0x3a')](_[_0x4088('0x44')](_0x137f13[_0x4088('0x39')],_0x29a667[_0x4088('0x3a')]));if(_0x137f13[_0x4088('0x39')][_0x4088('0x45')]){_0x12e55b[_0x4088('0x43')]=_['merge'](_0x12e55b[_0x4088('0x43')],{'$or':_[_0x4088('0x32')](_0x12e55b[_0x4088('0x3e')],function(_0x2720cc){var _0x286776={};_0x286776[_0x2720cc]={'$like':'%'+_0x137f13['query'][_0x4088('0x45')]+'%'};return _0x286776;})});}_0x12e55b=_[_0x4088('0x46')]({},_0x12e55b,_0x137f13[_0x4088('0x48')]);return _0x17e3a6[_0x4088('0x65')](_0x12e55b);}})[_0x4088('0x2c')](function(_0x3012c8){if(_0x3012c8){_0x2974ee=_0x3012c8[_0x4088('0x3d')];if(!_0x137f13[_0x4088('0x39')][_0x4088('0x3f')]('nolimit')){_0x12e55b[_0x4088('0x26')]=qs['limit'](_0x137f13[_0x4088('0x39')][_0x4088('0x26')]);_0x12e55b['offset']=qs[_0x4088('0x24')](_0x137f13[_0x4088('0x39')]['offset']);}return _0x17e3a6[_0x4088('0x65')](_0x12e55b);}})[_0x4088('0x2c')](function(_0x311761){if(_0x311761){return _0x311761?{'count':_0x2974ee,'rows':_0x311761}:null;}})[_0x4088('0x2c')](respondWithResult(_0x343591,null))[_0x4088('0x4b')](handleError(_0x343591,null));};exports[_0x4088('0x66')]=function(_0x4e2122,_0x42b822,_0x1b30be){var _0x161705=_0x4e2122[_0x4088('0x51')][_0x4088('0x67')];return db[_0x4088('0x68')][_0x4088('0x69')]({'where':{'id':_0x161705},'attributes':['id'],'include':[{'model':db[_0x4088('0x5e')],'as':_0x4088('0x6a'),'attributes':['id',_0x4088('0x30'),'online',_0x4088('0x6b'),_0x4088('0x6c')],'raw':!![]}]})[_0x4088('0x2c')](function(_0x2534fe){if(_0x2534fe){var _0xa4118e=_[_0x4088('0x6d')](_0x2534fe,function(_0xf44469){var _0x4c4f7c=_0xf44469[_0x4088('0x2e')]({'plain':!![]});return _0x4c4f7c[_0x4088('0x6a')];});return db[_0x4088('0x33')][_0x4088('0x4f')]({'where':{'id':_0x4e2122[_0x4088('0x4d')]['id']}})[_0x4088('0x2c')](function(_0x55e0a2){return db[_0x4088('0x6e')][_0x4088('0x6f')](function(_0x2e1033){return _0x55e0a2[_0x4088('0x66')](_0x161705,{'transaction':_0x2e1033})[_0x4088('0x2c')](function(){return BPromise[_0x4088('0x70')](_0xa4118e,function(_0x4b0f53){return db[_0x4088('0x5c')]['findOrCreate']({'where':{'UserId':_0x4b0f53['id'],'MailQueueId':_0x4e2122[_0x4088('0x4d')]['id']},'transaction':_0x2e1033});});})[_0x4088('0x2c')](function(){_0xa4118e[_0x4088('0x71')](function(_0x3f4dc6){socket[_0x4088('0x72')]('userMailQueue:save',{'UserId':_0x3f4dc6['id'],'MailQueueId':_0x55e0a2['id']});});});});});}})[_0x4088('0x2c')](respondWithStatusCode(_0x42b822,null))['catch'](handleError(_0x42b822,null));};exports[_0x4088('0x73')]=function(_0x2fca98,_0x3670fd,_0x2399d2){return db['Team'][_0x4088('0x69')]({'where':{'id':_0x2fca98[_0x4088('0x39')][_0x4088('0x67')]},'attributes':['id'],'include':[{'model':db[_0x4088('0x5e')],'as':_0x4088('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x4088('0x2c')](handleEntityNotFound(_0x3670fd,null))[_0x4088('0x2c')](function(_0x12b71f){var _0x4cbd36=_[_0x4088('0x32')](_0x12b71f,'id');var _0x2314ee=[];var _0x11add1=[];var _0x155440=squel['select']();_0x155440[_0x4088('0x74')](_0x4088('0x75'))[_0x4088('0x76')](_0x4088('0x77'),'tq')[_0x4088('0x78')](_0x4088('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4088('0x7a'),_0x2fca98[_0x4088('0x4d')]['id']);for(var _0x155b95=0x0;_0x155b95<_0x12b71f[_0x4088('0x3d')];_0x155b95+=0x1){let _0x1dc7a6=_0x12b71f[_0x155b95];for(var _0xf54552=0x0;_0xf54552<_0x1dc7a6[_0x4088('0x6a')][_0x4088('0x3d')];_0xf54552+=0x1){let _0xef3c2=_0x1dc7a6['Agents'][_0xf54552];var _0x155d12=_0x155440[_0x4088('0x7b')]();_0x155d12[_0x4088('0x43')](_0x4088('0x7c'),_0xef3c2['id']);_0x11add1[_0x4088('0x7d')](db['sequelize']['query'](_0x155d12[_0x4088('0x7e')](),{'type':db[_0x4088('0x6e')][_0x4088('0x7f')][_0x4088('0x80')]})['then'](function(_0x3d1310){if(_0x3d1310[_0x4088('0x3d')]===0x1){return _0xef3c2['id'];}else{var _0xaebe80=_['every'](_['map'](_0x3d1310,_0x4088('0x81')),function(_0x2a6d4c){return _['includes'](_0x4cbd36,_0x2a6d4c);});if(_0xaebe80){return _0xef3c2['id'];}}}));}}return BPromise[_0x4088('0x82')](_0x11add1)[_0x4088('0x2c')](function(_0x37db8b){_0x2314ee=_(_0x2314ee)[_0x4088('0x83')](_0x37db8b)[_0x4088('0x84')]()[_0x4088('0x85')]();return db[_0x4088('0x33')]['find']({'where':{'id':_0x2fca98[_0x4088('0x4d')]['id']}})[_0x4088('0x2c')](function(_0x2567d8){return db[_0x4088('0x6e')]['transaction'](function(_0x5be53a){return _0x2567d8[_0x4088('0x73')](_0x2fca98['query'][_0x4088('0x67')],{'transaction':_0x5be53a})[_0x4088('0x2c')](function(){if(!_[_0x4088('0x86')](_0x2314ee)){return _0x2567d8['removeAgents'](_0x2314ee,{'transaction':_0x5be53a});}})[_0x4088('0x2c')](function(){_0x2314ee[_0x4088('0x71')](function(_0x12b866){socket[_0x4088('0x72')](_0x4088('0x87'),{'UserId':_0x12b866,'MailQueueId':_0x2567d8['id']});});});});});});})['then'](respondWithStatusCode(_0x3670fd,null))[_0x4088('0x4b')](handleError(_0x3670fd,null));};exports[_0x4088('0x88')]=function(_0x27c1bd,_0x440710,_0x172868){return db[_0x4088('0x33')]['find']({'where':{'id':_0x27c1bd[_0x4088('0x4d')]['id']}})[_0x4088('0x2c')](handleEntityNotFound(_0x440710,null))[_0x4088('0x2c')](function(_0x42df01){if(_0x42df01){return _0x42df01[_0x4088('0x88')](_0x27c1bd[_0x4088('0x51')][_0x4088('0x67')],_[_0x4088('0x89')](_0x27c1bd[_0x4088('0x51')],['ids','id'])||{})[_0x4088('0x8a')](function(_0x2dcc2e){for(var _0x65d10b=0x0;_0x65d10b<_0x27c1bd[_0x4088('0x51')][_0x4088('0x67')]['length'];_0x65d10b+=0x1){socket[_0x4088('0x72')](_0x4088('0x8b'),{'UserId':Number(_0x27c1bd[_0x4088('0x51')]['ids'][_0x65d10b]),'MailQueueId':Number(_0x27c1bd['params']['id'])});}return _0x2dcc2e;});}})[_0x4088('0x2c')](respondWithResult(_0x440710,null))[_0x4088('0x4b')](handleError(_0x440710,null));};exports[_0x4088('0x8c')]=function(_0x5b61ec,_0x507f22,_0x1057a9){return db['MailQueue'][_0x4088('0x4f')]({'where':{'id':_0x5b61ec[_0x4088('0x4d')]['id']}})['then'](handleEntityNotFound(_0x507f22,null))['then'](function(_0x476feb){if(_0x476feb){return _0x476feb['removeAgents'](_0x5b61ec[_0x4088('0x39')][_0x4088('0x67')])[_0x4088('0x2c')](function(){if(_[_0x4088('0x8d')](_0x5b61ec[_0x4088('0x39')][_0x4088('0x67')])){for(var _0x4cda1e=0x0;_0x4cda1e<_0x5b61ec['query'][_0x4088('0x67')][_0x4088('0x3d')];_0x4cda1e+=0x1){socket[_0x4088('0x72')]('userMailQueue:remove',{'UserId':Number(_0x5b61ec['query'][_0x4088('0x67')][_0x4cda1e]),'MailQueueId':Number(_0x5b61ec[_0x4088('0x4d')]['id'])});}}else{socket[_0x4088('0x72')](_0x4088('0x87'),{'UserId':Number(_0x5b61ec[_0x4088('0x39')][_0x4088('0x67')]),'MailQueueId':Number(_0x5b61ec[_0x4088('0x4d')]['id'])});}});}})[_0x4088('0x2c')](respondWithStatusCode(_0x507f22,null))[_0x4088('0x4b')](handleError(_0x507f22,null));};exports[_0x4088('0x8e')]=function(_0x47cfe6,_0x2fce38,_0x4994ab){var _0x4f408a={};var _0x32e83c={};var _0x5c3c69;var _0xcdcc5e;return db[_0x4088('0x33')][_0x4088('0x5b')]({'where':{'id':_0x47cfe6[_0x4088('0x4d')]['id']}})[_0x4088('0x2c')](handleEntityNotFound(_0x2fce38,null))['then'](function(_0x5599aa){if(_0x5599aa){_0x5c3c69=_0x5599aa;_0x32e83c[_0x4088('0x37')]=_[_0x4088('0x38')](db[_0x4088('0x5e')][_0x4088('0x34')]);_0x32e83c[_0x4088('0x39')]=_[_0x4088('0x38')](_0x47cfe6[_0x4088('0x39')]);_0x32e83c['filters']=_[_0x4088('0x3b')](_0x32e83c[_0x4088('0x37')],_0x32e83c['query']);_0x4f408a[_0x4088('0x3e')]=_['intersection'](_0x32e83c['model'],qs[_0x4088('0x3c')](_0x47cfe6[_0x4088('0x39')][_0x4088('0x3c')]));_0x4f408a[_0x4088('0x3e')]=_0x4f408a[_0x4088('0x3e')][_0x4088('0x3d')]?_0x4f408a[_0x4088('0x3e')]:_0x32e83c[_0x4088('0x37')];_0x4f408a[_0x4088('0x41')]=qs[_0x4088('0x42')](_0x47cfe6[_0x4088('0x39')][_0x4088('0x42')]);_0x4f408a[_0x4088('0x43')]=qs[_0x4088('0x3a')](_[_0x4088('0x44')](_0x47cfe6[_0x4088('0x39')],_0x32e83c[_0x4088('0x3a')]));if(_0x47cfe6[_0x4088('0x39')][_0x4088('0x45')]){_0x4f408a[_0x4088('0x43')]=_['merge'](_0x4f408a['where'],{'$or':_[_0x4088('0x32')](_0x4f408a[_0x4088('0x3e')],function(_0xf263a9){var _0x4e1d49={};_0x4e1d49[_0xf263a9]={'$like':'%'+_0x47cfe6[_0x4088('0x39')][_0x4088('0x45')]+'%'};return _0x4e1d49;})});}_0x4f408a=_[_0x4088('0x46')]({},_0x4f408a,_0x47cfe6[_0x4088('0x48')]);return _0x5c3c69[_0x4088('0x8e')](_0x4f408a);}})[_0x4088('0x2c')](function(_0x3214eb){if(_0x3214eb){_0xcdcc5e=_0x3214eb[_0x4088('0x3d')];if(!_0x47cfe6['query'][_0x4088('0x3f')](_0x4088('0x40'))){_0x4f408a[_0x4088('0x26')]=qs[_0x4088('0x26')](_0x47cfe6['query']['limit']);_0x4f408a[_0x4088('0x24')]=qs[_0x4088('0x24')](_0x47cfe6[_0x4088('0x39')][_0x4088('0x24')]);}return _0x5c3c69['getAgents'](_0x4f408a);}})['then'](function(_0x4b908e){if(_0x4b908e){return _0x4b908e?{'count':_0xcdcc5e,'rows':_0x4b908e}:null;}})[_0x4088('0x2c')](respondWithResult(_0x2fce38,null))[_0x4088('0x4b')](handleError(_0x2fce38,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f5c6ac8..addf7c3 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 _0x6825=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','save','remove'];(function(_0x1068e9,_0x95c929){var _0x1a5449=function(_0x2c7475){while(--_0x2c7475){_0x1068e9['push'](_0x1068e9['shift']());}};_0x1a5449(++_0x95c929);}(_0x6825,0x18c));var _0x5682=function(_0x14d902,_0x11c094){_0x14d902=_0x14d902-0x0;var _0x2a5480=_0x6825[_0x14d902];return _0x2a5480;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x5682('0x0'))['db'][_0x5682('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5682('0x2'),'afterUpdate':'update','afterDestroy':_0x5682('0x3')};function emitEvent(_0x2bb8fb){return function(_0x23a5e0,_0x293945,_0x504281){MailQueueEvents[_0x5682('0x4')](_0x2bb8fb+':'+_0x23a5e0['id'],_0x23a5e0);MailQueueEvents[_0x5682('0x4')](_0x2bb8fb,_0x23a5e0);_0x504281(null);};}for(var e in events){if(events[_0x5682('0x5')](e)){var event=events[e];MailQueue[_0x5682('0x6')](e,emitEvent(event));}}module[_0x5682('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x6a9b=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xc433d7,_0x50968e){var _0x2521e3=function(_0x1d974d){while(--_0x1d974d){_0xc433d7['push'](_0xc433d7['shift']());}};_0x2521e3(++_0x50968e);}(_0x6a9b,0x149));var _0xb6a9=function(_0x4dbf11,_0x36a91f){_0x4dbf11=_0x4dbf11-0x0;var _0x571bf9=_0x6a9b[_0x4dbf11];return _0x571bf9;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xb6a9('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6a9('0x1'),'afterUpdate':_0xb6a9('0x2'),'afterDestroy':_0xb6a9('0x3')};function emitEvent(_0x20cb50){return function(_0x3cedfa,_0x329d27,_0x183315){MailQueueEvents[_0xb6a9('0x4')](_0x20cb50+':'+_0x3cedfa['id'],_0x3cedfa);MailQueueEvents[_0xb6a9('0x4')](_0x20cb50,_0x3cedfa);_0x183315(null);};}for(var e in events){if(events[_0xb6a9('0x5')](e)){var event=events[e];MailQueue[_0xb6a9('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 2eeb238..1ac3904 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 _0x8d94=['moment','bluebird','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','api'];(function(_0x5101ec,_0x7b1185){var _0x28a366=function(_0x3560e1){while(--_0x3560e1){_0x5101ec['push'](_0x5101ec['shift']());}};_0x28a366(++_0x7b1185);}(_0x8d94,0x17d));var _0x48d9=function(_0x9ce5d1,_0x9f2aaf){_0x9ce5d1=_0x9ce5d1-0x0;var _0x7d4264=_0x8d94[_0x9ce5d1];return _0x7d4264;};'use strict';var _=require(_0x48d9('0x0'));var util=require('util');var logger=require(_0x48d9('0x1'))(_0x48d9('0x2'));var moment=require(_0x48d9('0x3'));var BPromise=require(_0x48d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48d9('0x5'));var rimraf=require('rimraf');var config=require(_0x48d9('0x6'));var attributes=require(_0x48d9('0x7'));module[_0x48d9('0x8')]=function(_0x2b72b0,_0xb846c9){return _0x2b72b0[_0x48d9('0x9')](_0x48d9('0xa'),attributes,{'tableName':_0x48d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x823b=['../../config/logger','request-promise','path','rimraf','../../config/environment','define','mail_queues','lodash','util'];(function(_0x5b2c66,_0x188f9d){var _0x1b1e53=function(_0x41940d){while(--_0x41940d){_0x5b2c66['push'](_0x5b2c66['shift']());}};_0x1b1e53(++_0x188f9d);}(_0x823b,0x178));var _0xb823=function(_0x12da69,_0x227663){_0x12da69=_0x12da69-0x0;var _0x4840bc=_0x823b[_0x12da69];return _0x4840bc;};'use strict';var _=require(_0xb823('0x0'));var util=require(_0xb823('0x1'));var logger=require(_0xb823('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb823('0x3'));var fs=require('fs');var path=require(_0xb823('0x4'));var rimraf=require(_0xb823('0x5'));var config=require(_0xb823('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x4c7387,_0x51413d){return _0x4c7387[_0xb823('0x7')]('MailQueue',attributes,{'tableName':_0xb823('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 1cb5980..db01436 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 _0x4bf2=['raw','where','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./mailQueue.socket','register','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','then','catch','ShowMailQueue','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bf2,0xa3));var _0x24bf=function(_0x14a513,_0x3239f){_0x14a513=_0x14a513-0x0;var _0x47236c=_0x4bf2[_0x14a513];return _0x47236c;};'use strict';var _=require('lodash');var util=require(_0x24bf('0x0'));var moment=require(_0x24bf('0x1'));var BPromise=require(_0x24bf('0x2'));var rs=require(_0x24bf('0x3'));var fs=require('fs');var Redis=require(_0x24bf('0x4'));var db=require(_0x24bf('0x5'))['db'];var utils=require(_0x24bf('0x6'));var logger=require(_0x24bf('0x7'))(_0x24bf('0x8'));var config=require(_0x24bf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x24bf('0xa')]['http']({'port':0x232a});config['redis']=_[_0x24bf('0xb')](config[_0x24bf('0xc')],{'host':_0x24bf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24bf('0xc')]));require(_0x24bf('0xe'))[_0x24bf('0xf')](socket);function respondWithRpcPromise(_0x184360,_0x4b879f,_0xfe1833){return new BPromise(function(_0x28cc72,_0x4fdab2){return client['request'](_0x184360,_0xfe1833)['then'](function(_0x92a028){logger['info'](_0x24bf('0x10'),_0x4b879f,'request\x20sent');logger[_0x24bf('0x11')](_0x24bf('0x12'),_0x4b879f,_0x24bf('0x13'),JSON['stringify'](_0x92a028));if(_0x92a028[_0x24bf('0x14')]){if(_0x92a028[_0x24bf('0x14')]['code']===0x1f4){logger[_0x24bf('0x14')](_0x24bf('0x10'),_0x4b879f,_0x92a028['error'][_0x24bf('0x15')]);return _0x4fdab2(_0x92a028['error']['message']);}logger[_0x24bf('0x14')](_0x24bf('0x10'),_0x4b879f,_0x92a028[_0x24bf('0x14')][_0x24bf('0x15')]);return _0x28cc72(_0x92a028[_0x24bf('0x14')][_0x24bf('0x15')]);}else{logger[_0x24bf('0x16')]('MailQueue,\x20%s,\x20%s',_0x4b879f,_0x24bf('0x13'));_0x28cc72(_0x92a028[_0x24bf('0x17')][_0x24bf('0x15')]);}})['catch'](function(_0x170c5e){logger[_0x24bf('0x14')]('MailQueue,\x20%s,\x20%s',_0x4b879f,_0x170c5e);_0x4fdab2(_0x170c5e);});});}exports[_0x24bf('0x18')]=function(_0x235377){var _0x3a7808=this;return new Promise(function(_0x2fde4a,_0x534799){return db[_0x24bf('0x19')][_0x24bf('0x1a')]({'raw':_0x235377['options']?_0x235377[_0x24bf('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x235377[_0x24bf('0x1b')]?_0x235377['options']['where']||null:null,'attributes':_0x235377['options']?_0x235377['options'][_0x24bf('0x1c')]||null:null,'limit':_0x235377[_0x24bf('0x1b')]?_0x235377[_0x24bf('0x1b')][_0x24bf('0x1d')]||null:null,'include':_0x235377[_0x24bf('0x1b')]?_0x235377[_0x24bf('0x1b')][_0x24bf('0x1e')]?_[_0x24bf('0x1f')](_0x235377['options'][_0x24bf('0x1e')],function(_0x17d027){return{'model':db[_0x17d027[_0x24bf('0x20')]],'as':_0x17d027['as'],'attributes':_0x17d027[_0x24bf('0x1c')],'include':_0x17d027['include']?_[_0x24bf('0x1f')](_0x17d027[_0x24bf('0x1e')],function(_0x47e9bd){return{'model':db[_0x47e9bd[_0x24bf('0x20')]],'as':_0x47e9bd['as'],'attributes':_0x47e9bd[_0x24bf('0x1c')],'include':_0x47e9bd[_0x24bf('0x1e')]?_['map'](_0x47e9bd[_0x24bf('0x1e')],function(_0x259c5a){return{'model':db[_0x259c5a[_0x24bf('0x20')]],'as':_0x259c5a['as'],'attributes':_0x259c5a[_0x24bf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x24bf('0x21')](function(_0x56e313){logger[_0x24bf('0x16')](_0x24bf('0x18'),_0x235377);logger[_0x24bf('0x11')]('GetMailQueue',_0x235377,JSON['stringify'](_0x56e313));_0x2fde4a(_0x56e313);})[_0x24bf('0x22')](function(_0x38abfc){logger[_0x24bf('0x14')]('GetMailQueue',_0x38abfc[_0x24bf('0x15')],_0x235377);_0x534799(_0x3a7808[_0x24bf('0x14')](0x1f4,_0x38abfc['message']));});});};exports[_0x24bf('0x23')]=function(_0x335690){var _0xe5e172=this;return new Promise(function(_0x1ea2c0,_0x290384){return db['MailQueue'][_0x24bf('0x24')]({'raw':_0x335690['options']?_0x335690[_0x24bf('0x1b')][_0x24bf('0x25')]===undefined?!![]:![]:!![],'where':_0x335690[_0x24bf('0x1b')]?_0x335690[_0x24bf('0x1b')][_0x24bf('0x26')]||null:null,'attributes':_0x335690['options']?_0x335690[_0x24bf('0x1b')]['attributes']||null:null,'include':_0x335690['options']?_0x335690['options']['include']?_[_0x24bf('0x1f')](_0x335690[_0x24bf('0x1b')][_0x24bf('0x1e')],function(_0x235980){return{'model':db[_0x235980[_0x24bf('0x20')]],'as':_0x235980['as'],'attributes':_0x235980['attributes'],'include':_0x235980[_0x24bf('0x1e')]?_[_0x24bf('0x1f')](_0x235980['include'],function(_0x4b3844){return{'model':db[_0x4b3844['model']],'as':_0x4b3844['as'],'attributes':_0x4b3844[_0x24bf('0x1c')],'include':_0x4b3844[_0x24bf('0x1e')]?_[_0x24bf('0x1f')](_0x4b3844[_0x24bf('0x1e')],function(_0x194ff8){return{'model':db[_0x194ff8['model']],'as':_0x194ff8['as'],'attributes':_0x194ff8[_0x24bf('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29fcb2){logger['info'](_0x24bf('0x23'),_0x335690);logger['debug'](_0x24bf('0x23'),_0x335690,JSON[_0x24bf('0x27')](_0x29fcb2));_0x1ea2c0(_0x29fcb2);})[_0x24bf('0x22')](function(_0xb757ac){logger[_0x24bf('0x14')](_0x24bf('0x23'),_0xb757ac[_0x24bf('0x15')],_0x335690);_0x290384(_0xe5e172[_0x24bf('0x14')](0x1f4,_0xb757ac[_0x24bf('0x15')]));});});}; \ No newline at end of file +var _0xb5e4=['error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4159e7,_0xaecbcc){var _0x40b0e7=function(_0x186299){while(--_0x186299){_0x4159e7['push'](_0x4159e7['shift']());}};_0x40b0e7(++_0xaecbcc);}(_0xb5e4,0x1da));var _0x4b5e=function(_0x34cd1c,_0x4175a0){_0x34cd1c=_0x34cd1c-0x0;var _0x1dd009=_0xb5e4[_0x34cd1c];return _0x1dd009;};'use strict';var _=require(_0x4b5e('0x0'));var util=require(_0x4b5e('0x1'));var moment=require(_0x4b5e('0x2'));var BPromise=require(_0x4b5e('0x3'));var rs=require(_0x4b5e('0x4'));var fs=require('fs');var Redis=require(_0x4b5e('0x5'));var db=require(_0x4b5e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b5e('0x7'))(_0x4b5e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4b5e('0x9')]['http']({'port':0x232a});config[_0x4b5e('0xa')]=_[_0x4b5e('0xb')](config[_0x4b5e('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b5e('0xa')]));require('./mailQueue.socket')[_0x4b5e('0xc')](socket);function respondWithRpcPromise(_0x1b0467,_0x539bc5,_0x3482a9){return new BPromise(function(_0x3d3e75,_0x3b9a85){return client[_0x4b5e('0xd')](_0x1b0467,_0x3482a9)[_0x4b5e('0xe')](function(_0x5846df){logger['info'](_0x4b5e('0xf'),_0x539bc5,_0x4b5e('0x10'));logger[_0x4b5e('0x11')](_0x4b5e('0x12'),_0x539bc5,_0x4b5e('0x10'),JSON[_0x4b5e('0x13')](_0x5846df));if(_0x5846df[_0x4b5e('0x14')]){if(_0x5846df['error'][_0x4b5e('0x15')]===0x1f4){logger[_0x4b5e('0x14')](_0x4b5e('0xf'),_0x539bc5,_0x5846df[_0x4b5e('0x14')][_0x4b5e('0x16')]);return _0x3b9a85(_0x5846df[_0x4b5e('0x14')][_0x4b5e('0x16')]);}logger[_0x4b5e('0x14')](_0x4b5e('0xf'),_0x539bc5,_0x5846df[_0x4b5e('0x14')]['message']);return _0x3d3e75(_0x5846df['error'][_0x4b5e('0x16')]);}else{logger[_0x4b5e('0x17')]('MailQueue,\x20%s,\x20%s',_0x539bc5,_0x4b5e('0x10'));_0x3d3e75(_0x5846df[_0x4b5e('0x18')][_0x4b5e('0x16')]);}})[_0x4b5e('0x19')](function(_0x100980){logger[_0x4b5e('0x14')](_0x4b5e('0xf'),_0x539bc5,_0x100980);_0x3b9a85(_0x100980);});});}exports[_0x4b5e('0x1a')]=function(_0x4a2f58){var _0x5ced8d=this;return new Promise(function(_0x1dca9f,_0x3dd55b){return db[_0x4b5e('0x1b')][_0x4b5e('0x1c')]({'raw':_0x4a2f58[_0x4b5e('0x1d')]?_0x4a2f58['options'][_0x4b5e('0x1e')]===undefined?!![]:![]:!![],'where':_0x4a2f58[_0x4b5e('0x1d')]?_0x4a2f58[_0x4b5e('0x1d')][_0x4b5e('0x1f')]||null:null,'attributes':_0x4a2f58[_0x4b5e('0x1d')]?_0x4a2f58[_0x4b5e('0x1d')][_0x4b5e('0x20')]||null:null,'limit':_0x4a2f58[_0x4b5e('0x1d')]?_0x4a2f58[_0x4b5e('0x1d')]['limit']||null:null,'include':_0x4a2f58[_0x4b5e('0x1d')]?_0x4a2f58[_0x4b5e('0x1d')][_0x4b5e('0x21')]?_[_0x4b5e('0x22')](_0x4a2f58[_0x4b5e('0x1d')][_0x4b5e('0x21')],function(_0x3c242a){return{'model':db[_0x3c242a['model']],'as':_0x3c242a['as'],'attributes':_0x3c242a[_0x4b5e('0x20')],'include':_0x3c242a[_0x4b5e('0x21')]?_[_0x4b5e('0x22')](_0x3c242a[_0x4b5e('0x21')],function(_0x3840dc){return{'model':db[_0x3840dc['model']],'as':_0x3840dc['as'],'attributes':_0x3840dc[_0x4b5e('0x20')],'include':_0x3840dc['include']?_['map'](_0x3840dc[_0x4b5e('0x21')],function(_0x3ab20c){return{'model':db[_0x3ab20c[_0x4b5e('0x23')]],'as':_0x3ab20c['as'],'attributes':_0x3ab20c[_0x4b5e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4b5e('0xe')](function(_0x2bee5d){logger['info'](_0x4b5e('0x1a'),_0x4a2f58);logger['debug']('GetMailQueue',_0x4a2f58,JSON[_0x4b5e('0x13')](_0x2bee5d));_0x1dca9f(_0x2bee5d);})[_0x4b5e('0x19')](function(_0xc72816){logger[_0x4b5e('0x14')](_0x4b5e('0x1a'),_0xc72816['message'],_0x4a2f58);_0x3dd55b(_0x5ced8d[_0x4b5e('0x14')](0x1f4,_0xc72816['message']));});});};exports[_0x4b5e('0x24')]=function(_0x418740){var _0xe0fbd0=this;return new Promise(function(_0x1f5b70,_0x194321){return db[_0x4b5e('0x1b')][_0x4b5e('0x25')]({'raw':_0x418740[_0x4b5e('0x1d')]?_0x418740[_0x4b5e('0x1d')][_0x4b5e('0x1e')]===undefined?!![]:![]:!![],'where':_0x418740[_0x4b5e('0x1d')]?_0x418740[_0x4b5e('0x1d')][_0x4b5e('0x1f')]||null:null,'attributes':_0x418740[_0x4b5e('0x1d')]?_0x418740[_0x4b5e('0x1d')]['attributes']||null:null,'include':_0x418740['options']?_0x418740[_0x4b5e('0x1d')][_0x4b5e('0x21')]?_[_0x4b5e('0x22')](_0x418740['options'][_0x4b5e('0x21')],function(_0x10d154){return{'model':db[_0x10d154[_0x4b5e('0x23')]],'as':_0x10d154['as'],'attributes':_0x10d154[_0x4b5e('0x20')],'include':_0x10d154[_0x4b5e('0x21')]?_['map'](_0x10d154[_0x4b5e('0x21')],function(_0x3eab3b){return{'model':db[_0x3eab3b['model']],'as':_0x3eab3b['as'],'attributes':_0x3eab3b[_0x4b5e('0x20')],'include':_0x3eab3b['include']?_[_0x4b5e('0x22')](_0x3eab3b['include'],function(_0x433fc9){return{'model':db[_0x433fc9[_0x4b5e('0x23')]],'as':_0x433fc9['as'],'attributes':_0x433fc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b5e('0xe')](function(_0x364f8a){logger[_0x4b5e('0x17')](_0x4b5e('0x24'),_0x418740);logger[_0x4b5e('0x11')]('ShowMailQueue',_0x418740,JSON[_0x4b5e('0x13')](_0x364f8a));_0x1f5b70(_0x364f8a);})['catch'](function(_0x43c315){logger['error'](_0x4b5e('0x24'),_0x43c315[_0x4b5e('0x16')],_0x418740);_0x194321(_0xe0fbd0[_0x4b5e('0x14')](0x1f4,_0x43c315[_0x4b5e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9371ade..10d9508 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 _0x57c0=['length','mailQueue:','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x569f4e,_0x2f449a){var _0x377df8=function(_0x4eaf2d){while(--_0x4eaf2d){_0x569f4e['push'](_0x569f4e['shift']());}};_0x377df8(++_0x2f449a);}(_0x57c0,0xba));var _0x057c=function(_0x27842c,_0x324fcb){_0x27842c=_0x27842c-0x0;var _0x493de8=_0x57c0[_0x27842c];return _0x493de8;};'use strict';var MailQueueEvents=require(_0x057c('0x0'));var events=[_0x057c('0x1'),'remove',_0x057c('0x2')];function createListener(_0x4bea9d,_0x1d19a8){return function(_0x20b16c){_0x1d19a8[_0x057c('0x3')](_0x4bea9d,_0x20b16c);};}function removeListener(_0x423d79,_0x2e577b){return function(){MailQueueEvents[_0x057c('0x4')](_0x423d79,_0x2e577b);};}exports[_0x057c('0x5')]=function(_0x446902){for(var _0x5a1286=0x0,_0x199cad=events[_0x057c('0x6')];_0x5a1286<_0x199cad;_0x5a1286++){var _0x22c3da=events[_0x5a1286];var _0x2fa8d4=createListener(_0x057c('0x7')+_0x22c3da,_0x446902);MailQueueEvents['on'](_0x22c3da,_0x2fa8d4);}}; \ No newline at end of file +var _0x957b=['remove','update','emit','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0x957b,0x1ee));var _0xb957=function(_0x5d59e8,_0x141b4f){_0x5d59e8=_0x5d59e8-0x0;var _0x1f13b6=_0x957b[_0x5d59e8];return _0x1f13b6;};'use strict';var MailQueueEvents=require(_0xb957('0x0'));var events=[_0xb957('0x1'),_0xb957('0x2'),_0xb957('0x3')];function createListener(_0x18b1c7,_0x35d5ef){return function(_0x470588){_0x35d5ef[_0xb957('0x4')](_0x18b1c7,_0x470588);};}function removeListener(_0x182ac3,_0xbf9442){return function(){MailQueueEvents['removeListener'](_0x182ac3,_0xbf9442);};}exports[_0xb957('0x5')]=function(_0x353ebf){for(var _0x4ecf91=0x0,_0x5daf95=events[_0xb957('0x6')];_0x4ecf91<_0x5daf95;_0x4ecf91++){var _0x3731f7=events[_0x4ecf91];var _0x5822f8=createListener(_0xb957('0x7')+_0x3731f7,_0x353ebf);MailQueueEvents['on'](_0x3731f7,_0x5822f8);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4ff6cd6..889bf14 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 _0xc38f=['create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x4710ed,_0x211c8c){var _0x3c1e56=function(_0x3ec711){while(--_0x3ec711){_0x4710ed['push'](_0x4710ed['shift']());}};_0x3c1e56(++_0x211c8c);}(_0xc38f,0x1e4));var _0xfc38=function(_0x43e699,_0x57a402){_0x43e699=_0x43e699-0x0;var _0x60d519=_0xc38f[_0x43e699];return _0x60d519;};'use strict';var multer=require(_0xfc38('0x0'));var util=require(_0xfc38('0x1'));var path=require(_0xfc38('0x2'));var timeout=require(_0xfc38('0x3'));var express=require(_0xfc38('0x4'));var router=express[_0xfc38('0x5')]();var fs_extra=require(_0xfc38('0x6'));var auth=require(_0xfc38('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfc38('0x8'));var controller=require(_0xfc38('0x9'));router[_0xfc38('0xa')]('/',auth[_0xfc38('0xb')](),controller[_0xfc38('0xc')]);router['get'](_0xfc38('0xd'),auth[_0xfc38('0xb')](),controller['describe']);router[_0xfc38('0xa')](_0xfc38('0xe'),auth[_0xfc38('0xb')](),controller[_0xfc38('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfc38('0x10')]);router['put']('/:id',auth[_0xfc38('0xb')](),controller[_0xfc38('0x11')]);router[_0xfc38('0x12')](_0xfc38('0xe'),auth[_0xfc38('0xb')](),controller[_0xfc38('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9393=['fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create','update','delete','exports','multer','connect-timeout','express','Router'];(function(_0x5a5f6d,_0x2b614b){var _0x14edb7=function(_0x59b567){while(--_0x59b567){_0x5a5f6d['push'](_0x5a5f6d['shift']());}};_0x14edb7(++_0x2b614b);}(_0x9393,0x119));var _0x3939=function(_0x95df58,_0x3f0de0){_0x95df58=_0x95df58-0x0;var _0x59b1a7=_0x9393[_0x95df58];return _0x59b1a7;};'use strict';var multer=require(_0x3939('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3939('0x1'));var express=require(_0x3939('0x2'));var router=express[_0x3939('0x3')]();var fs_extra=require(_0x3939('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3939('0x5'));var config=require(_0x3939('0x6'));var controller=require(_0x3939('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3939('0x8')]);router[_0x3939('0x9')](_0x3939('0xa'),auth[_0x3939('0xb')](),controller[_0x3939('0xc')]);router['get'](_0x3939('0xd'),auth['isAuthenticated'](),controller[_0x3939('0xe')]);router['post']('/',auth[_0x3939('0xb')](),controller[_0x3939('0xf')]);router['put']('/:id',auth[_0x3939('0xb')](),controller[_0x3939('0x10')]);router[_0x3939('0x11')](_0x3939('0xd'),auth[_0x3939('0xb')](),controller['destroy']);module[_0x3939('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 47eab4f..4e2c0ae 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 _0xfb63=['DATE','moment','sequelize','exports','STRING'];(function(_0x36a077,_0x1a1ff1){var _0x934cbd=function(_0x2016ba){while(--_0x2016ba){_0x36a077['push'](_0x36a077['shift']());}};_0x934cbd(++_0x1a1ff1);}(_0xfb63,0x12d));var _0x3fb6=function(_0x154722,_0x2c1460){_0x154722=_0x154722-0x0;var _0x11928c=_0xfb63[_0x154722];return _0x11928c;};'use strict';var moment=require(_0x3fb6('0x0'));var Sequelize=require(_0x3fb6('0x1'));module[_0x3fb6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3fb6('0x3')]},'joinAt':{'type':Sequelize[_0x3fb6('0x4')]},'leaveAt':{'type':Sequelize[_0x3fb6('0x4')]},'acceptAt':{'type':Sequelize[_0x3fb6('0x4')]},'exitAt':{'type':Sequelize[_0x3fb6('0x4')]},'reason':{'type':Sequelize[_0x3fb6('0x3')]}}; \ No newline at end of file +var _0x03e2=['STRING','DATE'];(function(_0x16f9b1,_0x41b003){var _0x229569=function(_0x3c58eb){while(--_0x3c58eb){_0x16f9b1['push'](_0x16f9b1['shift']());}};_0x229569(++_0x41b003);}(_0x03e2,0x13c));var _0x203e=function(_0x517174,_0x529215){_0x517174=_0x517174-0x0;var _0x35d02b=_0x03e2[_0x517174];return _0x35d02b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x203e('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x203e('0x0')]},'joinAt':{'type':Sequelize[_0x203e('0x1')]},'leaveAt':{'type':Sequelize[_0x203e('0x1')]},'acceptAt':{'type':Sequelize[_0x203e('0x1')]},'exitAt':{'type':Sequelize[_0x203e('0x1')]},'reason':{'type':Sequelize[_0x203e('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3db2469..80f3473 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 _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x34ca44,_0x2fc8b4){var _0x1f7920=function(_0x354aba){while(--_0x354aba){_0x34ca44['push'](_0x34ca44['shift']());}};_0x1f7920(++_0x2fc8b4);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));}; \ No newline at end of file +var _0x4bd3=['reject','save','destroy','then','error','name','send','index','map','MailQueueReport','fieldName','type','key','query','keys','intersection','model','attributes','length','nolimit','order','sort','filters','where','VIRTUAL','filter','options','includeAll','show','params','include','catch','create','update','body','find','describe','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x694e20,_0x140eeb){var _0x187b26=function(_0x3a1298){while(--_0x3a1298){_0x694e20['push'](_0x694e20['shift']());}};_0x187b26(++_0x140eeb);}(_0x4bd3,0x174));var _0x34bd=function(_0x25148a,_0x77f46){_0x25148a=_0x25148a-0x0;var _0x2b4703=_0x4bd3[_0x25148a];return _0x2b4703;};'use strict';var emlformat=require(_0x34bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x34bd('0x1'));var jsonpatch=require(_0x34bd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x34bd('0x3'));var util=require(_0x34bd('0x4'));var path=require(_0x34bd('0x5'));var sox=require('sox');var csv=require(_0x34bd('0x6'));var ejs=require(_0x34bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x6'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var as=require(_0x34bd('0x10'));var hardwareService=require(_0x34bd('0x11'));var logger=require(_0x34bd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x34bd('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275d80,_0x1f19b9){_0x1f19b9=_0x1f19b9||0xcc;return function(_0x282af4){if(_0x282af4){return _0x275d80[_0x34bd('0x14')](_0x1f19b9);}return _0x275d80[_0x34bd('0x15')](_0x1f19b9)[_0x34bd('0x16')]();};}function respondWithResult(_0x4134ee,_0x236f6b){_0x236f6b=_0x236f6b||0xc8;return function(_0xf6d2f2){if(_0xf6d2f2){return _0x4134ee['status'](_0x236f6b)[_0x34bd('0x17')](_0xf6d2f2);}};}function respondWithFilteredResult(_0x4d4955,_0x4e3886){return function(_0x6638ed){if(_0x6638ed){var _0x30b3f2=typeof _0x4e3886[_0x34bd('0x18')]===_0x34bd('0x19')&&typeof _0x4e3886[_0x34bd('0x1a')]===_0x34bd('0x19');var _0xd39d72=_0x6638ed[_0x34bd('0x1b')];var _0x3b4bf8=_0x30b3f2?0x0:_0x4e3886[_0x34bd('0x18')];var _0x4b5ebb=_0x30b3f2?_0x6638ed['count']:_0x4e3886[_0x34bd('0x18')]+_0x4e3886[_0x34bd('0x1a')];var _0x265e70;if(_0x4b5ebb>=_0xd39d72){_0x4b5ebb=_0xd39d72;_0x265e70=0xc8;}else{_0x265e70=0xce;}_0x4d4955[_0x34bd('0x15')](_0x265e70);return _0x4d4955[_0x34bd('0x1c')](_0x34bd('0x1d'),_0x3b4bf8+'-'+_0x4b5ebb+'/'+_0xd39d72)[_0x34bd('0x17')](_0x6638ed);}return null;};}function patchUpdates(_0x3d5f76){return function(_0x130bd0){try{jsonpatch['apply'](_0x130bd0,_0x3d5f76,!![]);}catch(_0x15c0d1){return BPromise[_0x34bd('0x1e')](_0x15c0d1);}return _0x130bd0[_0x34bd('0x1f')]();};}function saveUpdates(_0x14254b,_0x463224){return function(_0x5e0c06){if(_0x5e0c06){return _0x5e0c06['update'](_0x14254b)['then'](function(_0x4edf84){return _0x4edf84;});}return null;};}function removeEntity(_0x3dafe8,_0x503a60){return function(_0x10fc4b){if(_0x10fc4b){return _0x10fc4b[_0x34bd('0x20')]()[_0x34bd('0x21')](function(){_0x3dafe8['status'](0xcc)[_0x34bd('0x16')]();});}};}function handleEntityNotFound(_0x14479a,_0x4f0dff){return function(_0x457006){if(!_0x457006){_0x14479a['sendStatus'](0x194);}return _0x457006;};}function handleError(_0x29bda8,_0xb256e8){_0xb256e8=_0xb256e8||0x1f4;return function(_0x264c94){logger[_0x34bd('0x22')](_0x264c94['stack']);if(_0x264c94[_0x34bd('0x23')]){delete _0x264c94[_0x34bd('0x23')];}_0x29bda8['status'](_0xb256e8)[_0x34bd('0x24')](_0x264c94);};}exports[_0x34bd('0x25')]=function(_0x16581f,_0x3f675c){var _0x26b8e7={},_0x4500c8={},_0x177d43={'count':0x0,'rows':[]};var _0x58b431=_[_0x34bd('0x26')](db[_0x34bd('0x27')]['rawAttributes'],function(_0x5d1662){return{'name':_0x5d1662[_0x34bd('0x28')],'type':_0x5d1662[_0x34bd('0x29')][_0x34bd('0x2a')]};});_0x4500c8['model']=_['map'](_0x58b431,_0x34bd('0x23'));_0x4500c8[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x16581f[_0x34bd('0x2b')]);_0x4500c8['filters']=_[_0x34bd('0x2d')](_0x4500c8[_0x34bd('0x2e')],_0x4500c8[_0x34bd('0x2b')]);_0x26b8e7[_0x34bd('0x2f')]=_[_0x34bd('0x2d')](_0x4500c8[_0x34bd('0x2e')],qs['fields'](_0x16581f[_0x34bd('0x2b')]['fields']));_0x26b8e7[_0x34bd('0x2f')]=_0x26b8e7[_0x34bd('0x2f')][_0x34bd('0x30')]?_0x26b8e7['attributes']:_0x4500c8[_0x34bd('0x2e')];if(!_0x16581f[_0x34bd('0x2b')]['hasOwnProperty'](_0x34bd('0x31'))){_0x26b8e7[_0x34bd('0x1a')]=qs[_0x34bd('0x1a')](_0x16581f['query'][_0x34bd('0x1a')]);_0x26b8e7[_0x34bd('0x18')]=qs['offset'](_0x16581f[_0x34bd('0x2b')][_0x34bd('0x18')]);}_0x26b8e7[_0x34bd('0x32')]=qs[_0x34bd('0x33')](_0x16581f[_0x34bd('0x2b')][_0x34bd('0x33')]);_0x26b8e7['where']=qs['filters'](_['pick'](_0x16581f[_0x34bd('0x2b')],_0x4500c8[_0x34bd('0x34')]),_0x58b431);if(_0x16581f['query']['filter']){_0x26b8e7[_0x34bd('0x35')]=_['merge'](_0x26b8e7['where'],{'$or':_[_0x34bd('0x26')](_0x58b431,function(_0xb5a456){if(_0xb5a456[_0x34bd('0x29')]!==_0x34bd('0x36')){var _0x2af1af={};_0x2af1af[_0xb5a456['name']]={'$like':'%'+_0x16581f['query'][_0x34bd('0x37')]+'%'};return _0x2af1af;}})});}_0x26b8e7=_['merge']({},_0x26b8e7,_0x16581f[_0x34bd('0x38')]);var _0x2c9b7a={'where':_0x26b8e7[_0x34bd('0x35')]};return db[_0x34bd('0x27')][_0x34bd('0x1b')](_0x2c9b7a)['then'](function(_0x282297){_0x177d43[_0x34bd('0x1b')]=_0x282297;if(_0x16581f[_0x34bd('0x2b')][_0x34bd('0x39')]){_0x26b8e7['include']=[{'all':!![]}];}return db[_0x34bd('0x27')]['findAll'](_0x26b8e7);})[_0x34bd('0x21')](function(_0x560282){_0x177d43['rows']=_0x560282;return _0x177d43;})[_0x34bd('0x21')](respondWithFilteredResult(_0x3f675c,_0x26b8e7))['catch'](handleError(_0x3f675c,null));};exports[_0x34bd('0x3a')]=function(_0x3d3b96,_0x18e9f6){var _0x42a424={'raw':!![],'where':{'id':_0x3d3b96[_0x34bd('0x3b')]['id']}},_0x26d73e={};_0x26d73e[_0x34bd('0x2e')]=_['keys'](db['MailQueueReport']['rawAttributes']);_0x26d73e[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x3d3b96[_0x34bd('0x2b')]);_0x26d73e[_0x34bd('0x34')]=_['intersection'](_0x26d73e[_0x34bd('0x2e')],_0x26d73e[_0x34bd('0x2b')]);_0x42a424[_0x34bd('0x2f')]=_[_0x34bd('0x2d')](_0x26d73e[_0x34bd('0x2e')],qs['fields'](_0x3d3b96[_0x34bd('0x2b')]['fields']));_0x42a424['attributes']=_0x42a424[_0x34bd('0x2f')]['length']?_0x42a424[_0x34bd('0x2f')]:_0x26d73e[_0x34bd('0x2e')];if(_0x3d3b96[_0x34bd('0x2b')][_0x34bd('0x39')]){_0x42a424[_0x34bd('0x3c')]=[{'all':!![]}];}_0x42a424=_['merge']({},_0x42a424,_0x3d3b96['options']);return db[_0x34bd('0x27')]['find'](_0x42a424)[_0x34bd('0x21')](handleEntityNotFound(_0x18e9f6,null))[_0x34bd('0x21')](respondWithResult(_0x18e9f6,null))[_0x34bd('0x3d')](handleError(_0x18e9f6,null));};exports['create']=function(_0x4ad00c,_0x4f96dd){return db['MailQueueReport'][_0x34bd('0x3e')](_0x4ad00c['body'],{})[_0x34bd('0x21')](respondWithResult(_0x4f96dd,0xc9))['catch'](handleError(_0x4f96dd,null));};exports[_0x34bd('0x3f')]=function(_0x1d01d7,_0x1fa341){if(_0x1d01d7[_0x34bd('0x40')]['id']){delete _0x1d01d7[_0x34bd('0x40')]['id'];}return db['MailQueueReport'][_0x34bd('0x41')]({'where':{'id':_0x1d01d7[_0x34bd('0x3b')]['id']}})[_0x34bd('0x21')](handleEntityNotFound(_0x1fa341,null))[_0x34bd('0x21')](saveUpdates(_0x1d01d7[_0x34bd('0x40')],null))['then'](respondWithResult(_0x1fa341,null))[_0x34bd('0x3d')](handleError(_0x1fa341,null));};exports[_0x34bd('0x20')]=function(_0x5bcce5,_0x1fc735){return db[_0x34bd('0x27')]['find']({'where':{'id':_0x5bcce5['params']['id']}})[_0x34bd('0x21')](handleEntityNotFound(_0x1fc735,null))['then'](removeEntity(_0x1fc735,null))['catch'](handleError(_0x1fc735,null));};exports[_0x34bd('0x42')]=function(_0x5df6a5,_0x556ce8){return db['MailQueueReport']['describe']()['then'](respondWithResult(_0x556ce8,null))[_0x34bd('0x3d')](handleError(_0x556ce8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 26a03bc..56cac86 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 _0xedc3=['bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','lodash','util','../../config/logger','api','moment'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xedc3,0x7f));var _0x3edc=function(_0x4df7a0,_0x919c55){_0x4df7a0=_0x4df7a0-0x0;var _0x33e432=_0xedc3[_0x4df7a0];return _0x33e432;};'use strict';var _=require(_0x3edc('0x0'));var util=require(_0x3edc('0x1'));var logger=require(_0x3edc('0x2'))(_0x3edc('0x3'));var moment=require(_0x3edc('0x4'));var BPromise=require(_0x3edc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3edc('0x6'));var rimraf=require(_0x3edc('0x7'));var config=require(_0x3edc('0x8'));var attributes=require(_0x3edc('0x9'));module['exports']=function(_0x2f82c1,_0x5d564e){return _0x2f82c1[_0x3edc('0xa')](_0x3edc('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6c7=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','api','moment','bluebird','path'];(function(_0x119bc0,_0x10b32c){var _0x132e97=function(_0x1e37ba){while(--_0x1e37ba){_0x119bc0['push'](_0x119bc0['shift']());}};_0x132e97(++_0x10b32c);}(_0xa6c7,0x133));var _0x7a6c=function(_0x1616c1,_0x117701){_0x1616c1=_0x1616c1-0x0;var _0x4d1746=_0xa6c7[_0x1616c1];return _0x4d1746;};'use strict';var _=require('lodash');var util=require(_0x7a6c('0x0'));var logger=require('../../config/logger')(_0x7a6c('0x1'));var moment=require(_0x7a6c('0x2'));var BPromise=require(_0x7a6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a6c('0x4'));var rimraf=require(_0x7a6c('0x5'));var config=require(_0x7a6c('0x6'));var attributes=require(_0x7a6c('0x7'));module[_0x7a6c('0x8')]=function(_0x50856b,_0x5a1a63){return _0x50856b[_0x7a6c('0x9')](_0x7a6c('0xa'),attributes,{'tableName':_0x7a6c('0xb'),'paranoid':![],'indexes':[{'name':_0x7a6c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index be4cba0..186df85 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x34366b,_0x248c3c){var _0x33921b=function(_0x55946a){while(--_0x55946a){_0x34366b['push'](_0x34366b['shift']());}};_0x33921b(++_0x248c3c);}(_0xdb28,0x106));var _0x8db2=function(_0x20fa28,_0xc57b53){_0x20fa28=_0x20fa28-0x0;var _0x201b50=_0xdb28[_0x20fa28];return _0x201b50;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0xb661df,_0x34952a){var _0x447ed1=function(_0x592b4c){while(--_0x592b4c){_0xb661df['push'](_0xb661df['shift']());}};_0x447ed1(++_0x34952a);}(_0xdb28,0x106));var _0x8db2=function(_0x25a815,_0x4ba1c9){_0x25a815=_0x25a815-0x0;var _0xe28601=_0xdb28[_0x25a815];return _0xe28601;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index a2a6ef2..8f23f64 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x37116f,_0xadb079){var _0x925b84=function(_0x226e9){while(--_0x226e9){_0x37116f['push'](_0x37116f['shift']());}};_0x925b84(++_0xadb079);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xcb91[_0x609988];return _0x159984;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2d239e,_0x4e01dc){var _0x5db961=function(_0x175a3d){while(--_0x175a3d){_0x2d239e['push'](_0x2d239e['shift']());}};_0x5db961(++_0x4e01dc);}(_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 39de935..3559dc5 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 _0x97c1=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3f2a2b,_0x438f0b){var _0x4303c9=function(_0x19d12c){while(--_0x19d12c){_0x3f2a2b['push'](_0x3f2a2b['shift']());}};_0x4303c9(++_0x438f0b);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x197c('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x197c('0x2')]},'port':{'type':Sequelize[_0x197c('0x3')]},'tls':{'type':Sequelize[_0x197c('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x197c('0x2')],'defaultValue':_0x197c('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x197c('0x2')]}}; \ No newline at end of file +var _0x7794=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3544ca,_0x3e853f){var _0x21a6e8=function(_0x59efcd){while(--_0x59efcd){_0x3544ca['push'](_0x3544ca['shift']());}};_0x21a6e8(++_0x3e853f);}(_0x7794,0x7b));var _0x4779=function(_0x55055b,_0x2af086){_0x55055b=_0x55055b-0x0;var _0x532e03=_0x7794[_0x55055b];return _0x532e03;};'use strict';var Sequelize=require('sequelize');module[_0x4779('0x0')]={'description':{'type':Sequelize[_0x4779('0x1')]},'host':{'type':Sequelize[_0x4779('0x1')]},'authentication':{'type':Sequelize[_0x4779('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4779('0x1')]},'port':{'type':Sequelize[_0x4779('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4779('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x4779('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ee73666..34c399b 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 _0xebf0=['lodash','util','moment','bluebird','request-promise','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x2215bc,_0xfc961d){var _0x35fdba=function(_0xd2d9e6){while(--_0xd2d9e6){_0x2215bc['push'](_0x2215bc['shift']());}};_0x35fdba(++_0xfc961d);}(_0xebf0,0x108));var _0x0ebf=function(_0x524263,_0x495d04){_0x524263=_0x524263-0x0;var _0x8bcfcd=_0xebf0[_0x524263];return _0x8bcfcd;};'use strict';var _=require(_0x0ebf('0x0'));var util=require(_0x0ebf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0ebf('0x2'));var BPromise=require(_0x0ebf('0x3'));var rp=require(_0x0ebf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ebf('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ebf('0x6'));module[_0x0ebf('0x7')]=function(_0x394e55,_0x2289ad){return _0x394e55[_0x0ebf('0x8')](_0x0ebf('0x9'),attributes,{'tableName':_0x0ebf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03de=['request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','../../config/logger','moment','bluebird'];(function(_0x360483,_0xcaf71c){var _0x1abcce=function(_0x333b77){while(--_0x333b77){_0x360483['push'](_0x360483['shift']());}};_0x1abcce(++_0xcaf71c);}(_0x03de,0xf2));var _0xe03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe03d('0x0'));var util=require(_0xe03d('0x1'));var logger=require(_0xe03d('0x2'))('api');var moment=require(_0xe03d('0x3'));var BPromise=require(_0xe03d('0x4'));var rp=require(_0xe03d('0x5'));var fs=require('fs');var path=require(_0xe03d('0x6'));var rimraf=require(_0xe03d('0x7'));var config=require(_0xe03d('0x8'));var attributes=require(_0xe03d('0x9'));module[_0xe03d('0xa')]=function(_0x4d4d3f,_0x208323){return _0x4d4d3f[_0xe03d('0xb')](_0xe03d('0xc'),attributes,{'tableName':'mail_servers_in','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 dad4246..2456045 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 _0x9e0d=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailServerIn','options','raw','where','attributes','map','include','model','GetMailServerIn','lodash'];(function(_0x4742d0,_0x3667bd){var _0x43bc00=function(_0x5b03dd){while(--_0x5b03dd){_0x4742d0['push'](_0x4742d0['shift']());}};_0x43bc00(++_0x3667bd);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x45da6f,_0x3d85d3){_0x45da6f=_0x45da6f-0x0;var _0x1c7d63=_0x9e0d[_0x45da6f];return _0x1c7d63;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});}exports['GetMailServerIn']=function(_0x209c04){var _0x56421e=this;return new Promise(function(_0x483b74,_0x2fcad6){return db[_0xd9e0('0x16')]['findAll']({'raw':_0x209c04['options']?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x18')]===undefined?!![]:![]:!![],'where':_0x209c04['options']?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x19')]||null:null,'attributes':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')][_0xd9e0('0x1a')]||null:null,'limit':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['limit']||null:null,'include':_0x209c04[_0xd9e0('0x17')]?_0x209c04[_0xd9e0('0x17')]['include']?_[_0xd9e0('0x1b')](_0x209c04[_0xd9e0('0x17')]['include'],function(_0x357bd9){return{'model':db[_0x357bd9['model']],'as':_0x357bd9['as'],'attributes':_0x357bd9[_0xd9e0('0x1a')],'include':_0x357bd9[_0xd9e0('0x1c')]?_['map'](_0x357bd9[_0xd9e0('0x1c')],function(_0x53cf67){return{'model':db[_0x53cf67['model']],'as':_0x53cf67['as'],'attributes':_0x53cf67['attributes'],'include':_0x53cf67[_0xd9e0('0x1c')]?_[_0xd9e0('0x1b')](_0x53cf67[_0xd9e0('0x1c')],function(_0x1c36df){return{'model':db[_0x1c36df[_0xd9e0('0x1d')]],'as':_0x1c36df['as'],'attributes':_0x1c36df[_0xd9e0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd9e0('0xb')](function(_0x5d56ba){logger[_0xd9e0('0xc')](_0xd9e0('0x1e'),_0x209c04);logger[_0xd9e0('0xf')](_0xd9e0('0x1e'),_0x209c04,JSON[_0xd9e0('0x11')](_0x5d56ba));_0x483b74(_0x5d56ba);})['catch'](function(_0x4b4f7d){logger['error'](_0xd9e0('0x1e'),_0x4b4f7d[_0xd9e0('0x14')],_0x209c04);_0x2fcad6(_0x56421e['error'](0x1f4,_0x4b4f7d[_0xd9e0('0x14')]));});});}; \ No newline at end of file +var _0x634d=['MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','model','map','debug','stringify','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0xfb2f84,_0x90a57e){var _0x228a54=function(_0xb379a3){while(--_0xb379a3){_0xfb2f84['push'](_0xfb2f84['shift']());}};_0x228a54(++_0x90a57e);}(_0x634d,0x120));var _0xd634=function(_0x3efa41,_0x4190c5){_0x3efa41=_0x3efa41-0x0;var _0x5f6e50=_0x634d[_0x3efa41];return _0x5f6e50;};'use strict';var _=require(_0xd634('0x0'));var util=require(_0xd634('0x1'));var moment=require(_0xd634('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd634('0x3'))['db'];var utils=require(_0xd634('0x4'));var logger=require(_0xd634('0x5'))('rpc');var config=require(_0xd634('0x6'));var jayson=require(_0xd634('0x7'));var client=jayson['client'][_0xd634('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c930f,_0x121b88,_0x10c5d2){return new BPromise(function(_0x11b091,_0x14bfc7){return client['request'](_0x5c930f,_0x10c5d2)[_0xd634('0x9')](function(_0x38bb9e){logger['info'](_0xd634('0xa'),_0x121b88,_0xd634('0xb'));logger['debug'](_0xd634('0xc'),_0x121b88,'request\x20sent',JSON['stringify'](_0x38bb9e));if(_0x38bb9e['error']){if(_0x38bb9e[_0xd634('0xd')][_0xd634('0xe')]===0x1f4){logger[_0xd634('0xd')]('MailServerIn,\x20%s,\x20%s',_0x121b88,_0x38bb9e['error'][_0xd634('0xf')]);return _0x14bfc7(_0x38bb9e[_0xd634('0xd')][_0xd634('0xf')]);}logger['error'](_0xd634('0xa'),_0x121b88,_0x38bb9e[_0xd634('0xd')][_0xd634('0xf')]);return _0x11b091(_0x38bb9e[_0xd634('0xd')][_0xd634('0xf')]);}else{logger[_0xd634('0x10')](_0xd634('0xa'),_0x121b88,_0xd634('0xb'));_0x11b091(_0x38bb9e[_0xd634('0x11')]['message']);}})[_0xd634('0x12')](function(_0x123c26){logger[_0xd634('0xd')](_0xd634('0xa'),_0x121b88,_0x123c26);_0x14bfc7(_0x123c26);});});}exports[_0xd634('0x13')]=function(_0x271fa2){var _0x1a9696=this;return new Promise(function(_0x16ee0a,_0x17c604){return db[_0xd634('0x14')]['findAll']({'raw':_0x271fa2[_0xd634('0x15')]?_0x271fa2[_0xd634('0x15')][_0xd634('0x16')]===undefined?!![]:![]:!![],'where':_0x271fa2[_0xd634('0x15')]?_0x271fa2[_0xd634('0x15')][_0xd634('0x17')]||null:null,'attributes':_0x271fa2[_0xd634('0x15')]?_0x271fa2[_0xd634('0x15')][_0xd634('0x18')]||null:null,'limit':_0x271fa2[_0xd634('0x15')]?_0x271fa2['options']['limit']||null:null,'include':_0x271fa2[_0xd634('0x15')]?_0x271fa2[_0xd634('0x15')][_0xd634('0x19')]?_['map'](_0x271fa2[_0xd634('0x15')][_0xd634('0x19')],function(_0x55b212){return{'model':db[_0x55b212['model']],'as':_0x55b212['as'],'attributes':_0x55b212[_0xd634('0x18')],'include':_0x55b212['include']?_['map'](_0x55b212[_0xd634('0x19')],function(_0x1017b3){return{'model':db[_0x1017b3[_0xd634('0x1a')]],'as':_0x1017b3['as'],'attributes':_0x1017b3['attributes'],'include':_0x1017b3['include']?_[_0xd634('0x1b')](_0x1017b3['include'],function(_0x11a215){return{'model':db[_0x11a215[_0xd634('0x1a')]],'as':_0x11a215['as'],'attributes':_0x11a215[_0xd634('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd634('0x9')](function(_0x29182d){logger[_0xd634('0x10')](_0xd634('0x13'),_0x271fa2);logger[_0xd634('0x1c')](_0xd634('0x13'),_0x271fa2,JSON[_0xd634('0x1d')](_0x29182d));_0x16ee0a(_0x29182d);})[_0xd634('0x12')](function(_0x36311f){logger[_0xd634('0xd')](_0xd634('0x13'),_0x36311f[_0xd634('0xf')],_0x271fa2);_0x17c604(_0x1a9696[_0xd634('0xd')](0x1f4,_0x36311f[_0xd634('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 8b749a0..cee2811 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(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index f93613c..358ed70 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 _0x5120=['STRING','sequelize'];(function(_0x3be002,_0x1ac993){var _0x3e3664=function(_0x5c324c){while(--_0x5c324c){_0x3be002['push'](_0x3be002['shift']());}};_0x3e3664(++_0x1ac993);}(_0x5120,0xdf));var _0x0512=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0x5120[_0x1bb6aa];return _0x2ef28e;};'use strict';var Sequelize=require(_0x0512('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0512('0x1')]},'user':{'type':Sequelize[_0x0512('0x1')]},'pass':{'type':Sequelize[_0x0512('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x0512('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x8579=['sequelize','exports','STRING','INTEGER'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x8579,0x16c));var _0x9857=function(_0x17b634,_0x52106b){_0x17b634=_0x17b634-0x0;var _0x529eb6=_0x8579[_0x17b634];return _0x529eb6;};'use strict';var Sequelize=require(_0x9857('0x0'));module[_0x9857('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9857('0x2')]},'user':{'type':Sequelize[_0x9857('0x2')]},'pass':{'type':Sequelize[_0x9857('0x2')]},'port':{'type':Sequelize[_0x9857('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'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 5a94b65..d9a73d1 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 _0x6761=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','name','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','include','findAll','rows','show','params','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6761,0x85));var _0x1676=function(_0xa891af,_0x5ccb9f){_0xa891af=_0xa891af-0x0;var _0x32a3c5=_0x6761[_0xa891af];return _0x32a3c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1676('0x0'));var zipdir=require(_0x1676('0x1'));var jsonpatch=require(_0x1676('0x2'));var rp=require('request-promise');var moment=require(_0x1676('0x3'));var BPromise=require(_0x1676('0x4'));var Mustache=require(_0x1676('0x5'));var util=require('util');var path=require(_0x1676('0x6'));var sox=require(_0x1676('0x7'));var csv=require(_0x1676('0x8'));var ejs=require(_0x1676('0x9'));var fs=require('fs');var fs_extra=require(_0x1676('0xa'));var _=require(_0x1676('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1676('0xc'));var deskjs=require(_0x1676('0xd'));var toCsv=require(_0x1676('0x8'));var querystring=require(_0x1676('0xe'));var Papa=require(_0x1676('0xf'));var Redis=require(_0x1676('0x10'));var authService=require(_0x1676('0x11'));var qs=require(_0x1676('0x12'));var as=require(_0x1676('0x13'));var hardwareService=require(_0x1676('0x14'));var logger=require(_0x1676('0x15'))(_0x1676('0x16'));var utils=require(_0x1676('0x17'));var config=require(_0x1676('0x18'));var licenseUtil=require(_0x1676('0x19'));var db=require(_0x1676('0x1a'))['db'];function respondWithStatusCode(_0x17074f,_0x1130f4){_0x1130f4=_0x1130f4||0xcc;return function(_0x6f888b){if(_0x6f888b){return _0x17074f[_0x1676('0x1b')](_0x1130f4);}return _0x17074f[_0x1676('0x1c')](_0x1130f4)['end']();};}function respondWithResult(_0x4faa07,_0x2f4643){_0x2f4643=_0x2f4643||0xc8;return function(_0x453890){if(_0x453890){return _0x4faa07[_0x1676('0x1c')](_0x2f4643)[_0x1676('0x1d')](_0x453890);}};}function respondWithFilteredResult(_0x4e58a2,_0x4b4819){return function(_0x5b617){if(_0x5b617){var _0xdc416e=typeof _0x4b4819[_0x1676('0x1e')]===_0x1676('0x1f')&&typeof _0x4b4819[_0x1676('0x20')]===_0x1676('0x1f');var _0x3514f1=_0x5b617[_0x1676('0x21')];var _0xc93779=_0xdc416e?0x0:_0x4b4819['offset'];var _0x2ec2c8=_0xdc416e?_0x5b617[_0x1676('0x21')]:_0x4b4819[_0x1676('0x1e')]+_0x4b4819[_0x1676('0x20')];var _0x19e056;if(_0x2ec2c8>=_0x3514f1){_0x2ec2c8=_0x3514f1;_0x19e056=0xc8;}else{_0x19e056=0xce;}_0x4e58a2[_0x1676('0x1c')](_0x19e056);return _0x4e58a2[_0x1676('0x22')](_0x1676('0x23'),_0xc93779+'-'+_0x2ec2c8+'/'+_0x3514f1)['json'](_0x5b617);}return null;};}function patchUpdates(_0xc54753){return function(_0x28c32a){try{jsonpatch[_0x1676('0x24')](_0x28c32a,_0xc54753,!![]);}catch(_0x4f0f3a){return BPromise[_0x1676('0x25')](_0x4f0f3a);}return _0x28c32a['save']();};}function saveUpdates(_0x8bca9f,_0x1761c2){return function(_0xf3bccf){if(_0xf3bccf){return _0xf3bccf['update'](_0x8bca9f)[_0x1676('0x26')](function(_0x1831e0){return _0x1831e0;});}return null;};}function removeEntity(_0x2607d2,_0x15372c){return function(_0x1b9cfe){if(_0x1b9cfe){return _0x1b9cfe[_0x1676('0x27')]()[_0x1676('0x26')](function(){_0x2607d2[_0x1676('0x1c')](0xcc)[_0x1676('0x28')]();});}};}function handleEntityNotFound(_0x15232b,_0xd95675){return function(_0x3cc488){if(!_0x3cc488){_0x15232b[_0x1676('0x1b')](0x194);}return _0x3cc488;};}function handleError(_0x450fdc,_0x56f697){_0x56f697=_0x56f697||0x1f4;return function(_0x416e22){logger[_0x1676('0x29')](_0x416e22['stack']);if(_0x416e22[_0x1676('0x2a')]){delete _0x416e22[_0x1676('0x2a')];}_0x450fdc[_0x1676('0x1c')](_0x56f697)['send'](_0x416e22);};}exports[_0x1676('0x2b')]=function(_0xdbac69,_0x579923){var _0x5b7a82={},_0xa0a173={},_0x2301a0={'count':0x0,'rows':[]};var _0x555452=_[_0x1676('0x2c')](db[_0x1676('0x2d')][_0x1676('0x2e')],function(_0x373376){return{'name':_0x373376[_0x1676('0x2f')],'type':_0x373376[_0x1676('0x30')]['key']};});_0xa0a173[_0x1676('0x31')]=_[_0x1676('0x2c')](_0x555452,_0x1676('0x2a'));_0xa0a173[_0x1676('0x32')]=_[_0x1676('0x33')](_0xdbac69[_0x1676('0x32')]);_0xa0a173[_0x1676('0x34')]=_[_0x1676('0x35')](_0xa0a173[_0x1676('0x31')],_0xa0a173[_0x1676('0x32')]);_0x5b7a82[_0x1676('0x36')]=_[_0x1676('0x35')](_0xa0a173['model'],qs[_0x1676('0x37')](_0xdbac69[_0x1676('0x32')][_0x1676('0x37')]));_0x5b7a82[_0x1676('0x36')]=_0x5b7a82['attributes'][_0x1676('0x38')]?_0x5b7a82['attributes']:_0xa0a173[_0x1676('0x31')];if(!_0xdbac69[_0x1676('0x32')]['hasOwnProperty'](_0x1676('0x39'))){_0x5b7a82['limit']=qs[_0x1676('0x20')](_0xdbac69[_0x1676('0x32')][_0x1676('0x20')]);_0x5b7a82[_0x1676('0x1e')]=qs[_0x1676('0x1e')](_0xdbac69[_0x1676('0x32')][_0x1676('0x1e')]);}_0x5b7a82['order']=qs[_0x1676('0x3a')](_0xdbac69[_0x1676('0x32')]['sort']);_0x5b7a82['where']=qs['filters'](_[_0x1676('0x3b')](_0xdbac69[_0x1676('0x32')],_0xa0a173[_0x1676('0x34')]),_0x555452);if(_0xdbac69['query']['filter']){_0x5b7a82[_0x1676('0x3c')]=_[_0x1676('0x3d')](_0x5b7a82['where'],{'$or':_['map'](_0x555452,function(_0xf110df){if(_0xf110df[_0x1676('0x30')]!==_0x1676('0x3e')){var _0x223158={};_0x223158[_0xf110df[_0x1676('0x2a')]]={'$like':'%'+_0xdbac69['query'][_0x1676('0x3f')]+'%'};return _0x223158;}})});}_0x5b7a82=_[_0x1676('0x3d')]({},_0x5b7a82,_0xdbac69['options']);var _0x4ede4e={'where':_0x5b7a82[_0x1676('0x3c')]};return db['MailServerOut']['count'](_0x4ede4e)[_0x1676('0x26')](function(_0x371a7f){_0x2301a0[_0x1676('0x21')]=_0x371a7f;if(_0xdbac69['query']['includeAll']){_0x5b7a82[_0x1676('0x40')]=[{'all':!![]}];}return db[_0x1676('0x2d')][_0x1676('0x41')](_0x5b7a82);})[_0x1676('0x26')](function(_0x4c7a77){_0x2301a0[_0x1676('0x42')]=_0x4c7a77;return _0x2301a0;})['then'](respondWithFilteredResult(_0x579923,_0x5b7a82))['catch'](handleError(_0x579923,null));};exports[_0x1676('0x43')]=function(_0x13e593,_0x3e9348){var _0x4001e9={'raw':!![],'where':{'id':_0x13e593[_0x1676('0x44')]['id']}},_0x2fc31c={};_0x2fc31c[_0x1676('0x31')]=_[_0x1676('0x33')](db[_0x1676('0x2d')]['rawAttributes']);_0x2fc31c[_0x1676('0x32')]=_[_0x1676('0x33')](_0x13e593[_0x1676('0x32')]);_0x2fc31c[_0x1676('0x34')]=_['intersection'](_0x2fc31c[_0x1676('0x31')],_0x2fc31c[_0x1676('0x32')]);_0x4001e9[_0x1676('0x36')]=_[_0x1676('0x35')](_0x2fc31c[_0x1676('0x31')],qs[_0x1676('0x37')](_0x13e593[_0x1676('0x32')][_0x1676('0x37')]));_0x4001e9[_0x1676('0x36')]=_0x4001e9[_0x1676('0x36')]['length']?_0x4001e9[_0x1676('0x36')]:_0x2fc31c[_0x1676('0x31')];if(_0x13e593['query']['includeAll']){_0x4001e9[_0x1676('0x40')]=[{'all':!![]}];}_0x4001e9=_['merge']({},_0x4001e9,_0x13e593[_0x1676('0x45')]);return db[_0x1676('0x2d')][_0x1676('0x46')](_0x4001e9)[_0x1676('0x26')](handleEntityNotFound(_0x3e9348,null))[_0x1676('0x26')](respondWithResult(_0x3e9348,null))[_0x1676('0x47')](handleError(_0x3e9348,null));};exports[_0x1676('0x48')]=function(_0x2a8813,_0x12faa5){return db[_0x1676('0x2d')][_0x1676('0x48')](_0x2a8813[_0x1676('0x49')],{})[_0x1676('0x26')](respondWithResult(_0x12faa5,0xc9))['catch'](handleError(_0x12faa5,null));};exports['update']=function(_0xd5f87a,_0xb08181){if(_0xd5f87a[_0x1676('0x49')]['id']){delete _0xd5f87a[_0x1676('0x49')]['id'];}return db[_0x1676('0x2d')][_0x1676('0x46')]({'where':{'id':_0xd5f87a[_0x1676('0x44')]['id']}})[_0x1676('0x26')](handleEntityNotFound(_0xb08181,null))[_0x1676('0x26')](saveUpdates(_0xd5f87a[_0x1676('0x49')],null))[_0x1676('0x26')](respondWithResult(_0xb08181,null))['catch'](handleError(_0xb08181,null));};exports[_0x1676('0x27')]=function(_0x11659c,_0x4f72de){return db['MailServerOut'][_0x1676('0x46')]({'where':{'id':_0x11659c[_0x1676('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f72de,null))[_0x1676('0x26')](removeEntity(_0x4f72de,null))[_0x1676('0x47')](handleError(_0x4f72de,null));}; \ No newline at end of file +var _0x73cc=['Content-Range','json','apply','save','update','then','error','name','map','MailServerOut','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x38b5a5,_0x11314d){var _0x57587b=function(_0x56f202){while(--_0x56f202){_0x38b5a5['push'](_0x38b5a5['shift']());}};_0x57587b(++_0x11314d);}(_0x73cc,0x71));var _0xc73c=function(_0x451b13,_0x47bcb0){_0x451b13=_0x451b13-0x0;var _0xba77d1=_0x73cc[_0x451b13];return _0xba77d1;};'use strict';var emlformat=require(_0xc73c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc73c('0x1'));var jsonpatch=require(_0xc73c('0x2'));var rp=require(_0xc73c('0x3'));var moment=require(_0xc73c('0x4'));var BPromise=require(_0xc73c('0x5'));var Mustache=require(_0xc73c('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc73c('0x7'));var csv=require(_0xc73c('0x8'));var ejs=require(_0xc73c('0x9'));var fs=require('fs');var fs_extra=require(_0xc73c('0xa'));var _=require(_0xc73c('0xb'));var squel=require(_0xc73c('0xc'));var crypto=require(_0xc73c('0xd'));var jsforce=require(_0xc73c('0xe'));var deskjs=require(_0xc73c('0xf'));var toCsv=require(_0xc73c('0x8'));var querystring=require(_0xc73c('0x10'));var Papa=require(_0xc73c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc73c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc73c('0x13'));var logger=require(_0xc73c('0x14'))(_0xc73c('0x15'));var utils=require(_0xc73c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc73c('0x17'));var db=require(_0xc73c('0x18'))['db'];function respondWithStatusCode(_0x1537c5,_0x3ec87a){_0x3ec87a=_0x3ec87a||0xcc;return function(_0x1cda2d){if(_0x1cda2d){return _0x1537c5[_0xc73c('0x19')](_0x3ec87a);}return _0x1537c5[_0xc73c('0x1a')](_0x3ec87a)[_0xc73c('0x1b')]();};}function respondWithResult(_0x4edbbb,_0x52f89a){_0x52f89a=_0x52f89a||0xc8;return function(_0x1642f3){if(_0x1642f3){return _0x4edbbb[_0xc73c('0x1a')](_0x52f89a)['json'](_0x1642f3);}};}function respondWithFilteredResult(_0x5c4799,_0x3696af){return function(_0x1eba99){if(_0x1eba99){var _0x3e6cb7=typeof _0x3696af[_0xc73c('0x1c')]===_0xc73c('0x1d')&&typeof _0x3696af[_0xc73c('0x1e')]===_0xc73c('0x1d');var _0xf68e58=_0x1eba99[_0xc73c('0x1f')];var _0x16c213=_0x3e6cb7?0x0:_0x3696af[_0xc73c('0x1c')];var _0x34390d=_0x3e6cb7?_0x1eba99['count']:_0x3696af[_0xc73c('0x1c')]+_0x3696af[_0xc73c('0x1e')];var _0x473fea;if(_0x34390d>=_0xf68e58){_0x34390d=_0xf68e58;_0x473fea=0xc8;}else{_0x473fea=0xce;}_0x5c4799[_0xc73c('0x1a')](_0x473fea);return _0x5c4799[_0xc73c('0x20')](_0xc73c('0x21'),_0x16c213+'-'+_0x34390d+'/'+_0xf68e58)[_0xc73c('0x22')](_0x1eba99);}return null;};}function patchUpdates(_0x4a11c1){return function(_0x41cd61){try{jsonpatch[_0xc73c('0x23')](_0x41cd61,_0x4a11c1,!![]);}catch(_0x5e4888){return BPromise['reject'](_0x5e4888);}return _0x41cd61[_0xc73c('0x24')]();};}function saveUpdates(_0x515772,_0xe25f81){return function(_0xc57eb4){if(_0xc57eb4){return _0xc57eb4[_0xc73c('0x25')](_0x515772)[_0xc73c('0x26')](function(_0x305c1c){return _0x305c1c;});}return null;};}function removeEntity(_0x3edee0,_0x13e817){return function(_0x290e68){if(_0x290e68){return _0x290e68['destroy']()[_0xc73c('0x26')](function(){_0x3edee0[_0xc73c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaba26f,_0x141e9b){return function(_0x1c26e2){if(!_0x1c26e2){_0xaba26f[_0xc73c('0x19')](0x194);}return _0x1c26e2;};}function handleError(_0x30b751,_0x46a830){_0x46a830=_0x46a830||0x1f4;return function(_0x413f79){logger[_0xc73c('0x27')](_0x413f79['stack']);if(_0x413f79[_0xc73c('0x28')]){delete _0x413f79['name'];}_0x30b751[_0xc73c('0x1a')](_0x46a830)['send'](_0x413f79);};}exports['index']=function(_0xa202e7,_0x5c6754){var _0x166433={},_0x277027={},_0x3ebec2={'count':0x0,'rows':[]};var _0xc9dd7d=_[_0xc73c('0x29')](db[_0xc73c('0x2a')][_0xc73c('0x2b')],function(_0x424b48){return{'name':_0x424b48[_0xc73c('0x2c')],'type':_0x424b48['type'][_0xc73c('0x2d')]};});_0x277027[_0xc73c('0x2e')]=_[_0xc73c('0x29')](_0xc9dd7d,_0xc73c('0x28'));_0x277027[_0xc73c('0x2f')]=_['keys'](_0xa202e7['query']);_0x277027[_0xc73c('0x30')]=_['intersection'](_0x277027[_0xc73c('0x2e')],_0x277027[_0xc73c('0x2f')]);_0x166433[_0xc73c('0x31')]=_[_0xc73c('0x32')](_0x277027[_0xc73c('0x2e')],qs[_0xc73c('0x33')](_0xa202e7['query'][_0xc73c('0x33')]));_0x166433[_0xc73c('0x31')]=_0x166433[_0xc73c('0x31')][_0xc73c('0x34')]?_0x166433['attributes']:_0x277027['model'];if(!_0xa202e7[_0xc73c('0x2f')][_0xc73c('0x35')]('nolimit')){_0x166433[_0xc73c('0x1e')]=qs[_0xc73c('0x1e')](_0xa202e7['query'][_0xc73c('0x1e')]);_0x166433[_0xc73c('0x1c')]=qs[_0xc73c('0x1c')](_0xa202e7[_0xc73c('0x2f')][_0xc73c('0x1c')]);}_0x166433['order']=qs[_0xc73c('0x36')](_0xa202e7[_0xc73c('0x2f')]['sort']);_0x166433[_0xc73c('0x37')]=qs[_0xc73c('0x30')](_['pick'](_0xa202e7['query'],_0x277027['filters']),_0xc9dd7d);if(_0xa202e7['query']['filter']){_0x166433[_0xc73c('0x37')]=_[_0xc73c('0x38')](_0x166433[_0xc73c('0x37')],{'$or':_['map'](_0xc9dd7d,function(_0x5861ec){if(_0x5861ec[_0xc73c('0x39')]!==_0xc73c('0x3a')){var _0x57971c={};_0x57971c[_0x5861ec[_0xc73c('0x28')]]={'$like':'%'+_0xa202e7['query'][_0xc73c('0x3b')]+'%'};return _0x57971c;}})});}_0x166433=_[_0xc73c('0x38')]({},_0x166433,_0xa202e7[_0xc73c('0x3c')]);var _0x411ebd={'where':_0x166433['where']};return db[_0xc73c('0x2a')][_0xc73c('0x1f')](_0x411ebd)['then'](function(_0x36d506){_0x3ebec2[_0xc73c('0x1f')]=_0x36d506;if(_0xa202e7[_0xc73c('0x2f')][_0xc73c('0x3d')]){_0x166433[_0xc73c('0x3e')]=[{'all':!![]}];}return db[_0xc73c('0x2a')][_0xc73c('0x3f')](_0x166433);})[_0xc73c('0x26')](function(_0xedd114){_0x3ebec2[_0xc73c('0x40')]=_0xedd114;return _0x3ebec2;})[_0xc73c('0x26')](respondWithFilteredResult(_0x5c6754,_0x166433))[_0xc73c('0x41')](handleError(_0x5c6754,null));};exports[_0xc73c('0x42')]=function(_0x527bdc,_0xf6e608){var _0x40a0da={'raw':!![],'where':{'id':_0x527bdc[_0xc73c('0x43')]['id']}},_0x1152ea={};_0x1152ea[_0xc73c('0x2e')]=_[_0xc73c('0x44')](db[_0xc73c('0x2a')][_0xc73c('0x2b')]);_0x1152ea[_0xc73c('0x2f')]=_[_0xc73c('0x44')](_0x527bdc[_0xc73c('0x2f')]);_0x1152ea[_0xc73c('0x30')]=_[_0xc73c('0x32')](_0x1152ea[_0xc73c('0x2e')],_0x1152ea[_0xc73c('0x2f')]);_0x40a0da[_0xc73c('0x31')]=_[_0xc73c('0x32')](_0x1152ea[_0xc73c('0x2e')],qs['fields'](_0x527bdc['query'][_0xc73c('0x33')]));_0x40a0da['attributes']=_0x40a0da[_0xc73c('0x31')][_0xc73c('0x34')]?_0x40a0da[_0xc73c('0x31')]:_0x1152ea[_0xc73c('0x2e')];if(_0x527bdc['query'][_0xc73c('0x3d')]){_0x40a0da[_0xc73c('0x3e')]=[{'all':!![]}];}_0x40a0da=_['merge']({},_0x40a0da,_0x527bdc['options']);return db['MailServerOut'][_0xc73c('0x45')](_0x40a0da)[_0xc73c('0x26')](handleEntityNotFound(_0xf6e608,null))[_0xc73c('0x26')](respondWithResult(_0xf6e608,null))[_0xc73c('0x41')](handleError(_0xf6e608,null));};exports[_0xc73c('0x46')]=function(_0x68cc1f,_0x899032){return db['MailServerOut']['create'](_0x68cc1f['body'],{})[_0xc73c('0x26')](respondWithResult(_0x899032,0xc9))['catch'](handleError(_0x899032,null));};exports[_0xc73c('0x25')]=function(_0x49053f,_0x42507){if(_0x49053f[_0xc73c('0x47')]['id']){delete _0x49053f['body']['id'];}return db[_0xc73c('0x2a')][_0xc73c('0x45')]({'where':{'id':_0x49053f['params']['id']}})[_0xc73c('0x26')](handleEntityNotFound(_0x42507,null))[_0xc73c('0x26')](saveUpdates(_0x49053f[_0xc73c('0x47')],null))[_0xc73c('0x26')](respondWithResult(_0x42507,null))[_0xc73c('0x41')](handleError(_0x42507,null));};exports[_0xc73c('0x48')]=function(_0x58e421,_0x45039f){return db[_0xc73c('0x2a')][_0xc73c('0x45')]({'where':{'id':_0x58e421[_0xc73c('0x43')]['id']}})['then'](handleEntityNotFound(_0x45039f,null))['then'](removeEntity(_0x45039f,null))[_0xc73c('0x41')](handleError(_0x45039f,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 330e557..4738253 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 _0xb0cf=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x263845,_0xb4b6d2){var _0x3ec47d=function(_0x1d4af6){while(--_0x1d4af6){_0x263845['push'](_0x263845['shift']());}};_0x3ec47d(++_0xb4b6d2);}(_0xb0cf,0x16e));var _0xfb0c=function(_0x105639,_0x3e8689){_0x105639=_0x105639-0x0;var _0xf6c4c9=_0xb0cf[_0x105639];return _0xf6c4c9;};'use strict';var _=require(_0xfb0c('0x0'));var util=require(_0xfb0c('0x1'));var logger=require(_0xfb0c('0x2'))(_0xfb0c('0x3'));var moment=require(_0xfb0c('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb0c('0x5'));var fs=require('fs');var path=require(_0xfb0c('0x6'));var rimraf=require(_0xfb0c('0x7'));var config=require(_0xfb0c('0x8'));var attributes=require(_0xfb0c('0x9'));module[_0xfb0c('0xa')]=function(_0x1011f9,_0x3ff2c8){return _0x1011f9[_0xfb0c('0xb')](_0xfb0c('0xc'),attributes,{'tableName':_0xfb0c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37b5=['../../config/environment','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x18b333,_0x21db7a){var _0x3444cf=function(_0x24b23b){while(--_0x24b23b){_0x18b333['push'](_0x18b333['shift']());}};_0x3444cf(++_0x21db7a);}(_0x37b5,0x1d2));var _0x537b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x37b5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x537b('0x0'));var util=require('util');var logger=require(_0x537b('0x1'))(_0x537b('0x2'));var moment=require(_0x537b('0x3'));var BPromise=require(_0x537b('0x4'));var rp=require(_0x537b('0x5'));var fs=require('fs');var path=require(_0x537b('0x6'));var rimraf=require('rimraf');var config=require(_0x537b('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x5ebc29,_0xc6422f){return _0x5ebc29[_0x537b('0x8')](_0x537b('0x9'),attributes,{'tableName':_0x537b('0xa'),'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 bf5fe6c..0ecc32b 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1a8155,_0x432a76){var _0x54be6a=function(_0x4b6457){while(--_0x4b6457){_0x1a8155['push'](_0x1a8155['shift']());}};_0x54be6a(++_0x432a76);}(_0xdb28,0x106));var _0x8db2=function(_0x43a73d,_0x291598){_0x43a73d=_0x43a73d-0x0;var _0x1e90c5=_0xdb28[_0x43a73d];return _0x1e90c5;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3beb86,_0x10537c){var _0x385cb9=function(_0x556817){while(--_0x556817){_0x3beb86['push'](_0x3beb86['shift']());}};_0x385cb9(++_0x10537c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 32ac986..bb5bd0f 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 _0x5ff8=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4a30f1,_0x2e75a8){var _0x1e0a09=function(_0xfc5f54){while(--_0xfc5f54){_0x4a30f1['push'](_0x4a30f1['shift']());}};_0x1e0a09(++_0x2e75a8);}(_0x5ff8,0x17e));var _0x85ff=function(_0x4945d1,_0x561d33){_0x4945d1=_0x4945d1-0x0;var _0xa1fdc=_0x5ff8[_0x4945d1];return _0xa1fdc;};'use strict';var multer=require(_0x85ff('0x0'));var util=require('util');var path=require(_0x85ff('0x1'));var timeout=require(_0x85ff('0x2'));var express=require(_0x85ff('0x3'));var router=express[_0x85ff('0x4')]();var fs_extra=require(_0x85ff('0x5'));var auth=require(_0x85ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x85ff('0x7'));var controller=require(_0x85ff('0x8'));router[_0x85ff('0x9')]('/',auth[_0x85ff('0xa')](),controller[_0x85ff('0xb')]);router[_0x85ff('0x9')](_0x85ff('0xc'),auth[_0x85ff('0xa')](),controller[_0x85ff('0xd')]);router[_0x85ff('0x9')]('/:id',auth[_0x85ff('0xa')](),controller[_0x85ff('0xe')]);router[_0x85ff('0xf')]('/',auth[_0x85ff('0xa')](),controller[_0x85ff('0x10')]);router[_0x85ff('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x85ff('0x12')]);router[_0x85ff('0x13')]('/:id',auth[_0x85ff('0xa')](),controller[_0x85ff('0x14')]);module[_0x85ff('0x15')]=router; \ No newline at end of file +var _0x73a2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x73a2,0x1f4));var _0x273a=function(_0x12f478,_0x3563f2){_0x12f478=_0x12f478-0x0;var _0x23473f=_0x73a2[_0x12f478];return _0x23473f;};'use strict';var multer=require(_0x273a('0x0'));var util=require(_0x273a('0x1'));var path=require(_0x273a('0x2'));var timeout=require(_0x273a('0x3'));var express=require('express');var router=express[_0x273a('0x4')]();var fs_extra=require(_0x273a('0x5'));var auth=require(_0x273a('0x6'));var interaction=require(_0x273a('0x7'));var config=require(_0x273a('0x8'));var controller=require(_0x273a('0x9'));router[_0x273a('0xa')]('/',auth['isAuthenticated'](),controller[_0x273a('0xb')]);router[_0x273a('0xa')](_0x273a('0xc'),auth[_0x273a('0xd')](),controller[_0x273a('0xe')]);router[_0x273a('0xa')]('/:id',auth[_0x273a('0xd')](),controller['show']);router[_0x273a('0xf')]('/',auth[_0x273a('0xd')](),controller['create']);router[_0x273a('0x10')](_0x273a('0x11'),auth[_0x273a('0xd')](),controller['update']);router[_0x273a('0x12')](_0x273a('0x11'),auth[_0x273a('0xd')](),controller[_0x273a('0x13')]);module[_0x273a('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 685b230..6673ae2 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 _0x0d4d=['STRING','name','sequelize','exports'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x0d4d,0x132));var _0xd0d4=function(_0x1ec5c5,_0xbf3c1c){_0x1ec5c5=_0x1ec5c5-0x0;var _0x5b16a6=_0x0d4d[_0x1ec5c5];return _0x5b16a6;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':_0xd0d4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0d4('0x2')]}}; \ No newline at end of file +var _0x7fbe=['STRING','name'];(function(_0xd4d0c3,_0x27c7df){var _0x48b76c=function(_0x517e39){while(--_0x517e39){_0xd4d0c3['push'](_0xd4d0c3['shift']());}};_0x48b76c(++_0x27c7df);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0x7fbe[_0xb518e5];return _0x59c78e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe7fb('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 05879b4..0c02b00 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 _0x8052=['index','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','moment','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x27f926,_0x3c6d0e){var _0x16b939=function(_0x54b9fe){while(--_0x54b9fe){_0x27f926['push'](_0x27f926['shift']());}};_0x16b939(++_0x3c6d0e);}(_0x8052,0xbc));var _0x2805=function(_0x472619,_0x369fcc){_0x472619=_0x472619-0x0;var _0x14a669=_0x8052[_0x472619];return _0x14a669;};'use strict';var emlformat=require(_0x2805('0x0'));var rimraf=require(_0x2805('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2805('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2805('0x3'));var util=require(_0x2805('0x4'));var path=require(_0x2805('0x5'));var sox=require('sox');var csv=require(_0x2805('0x6'));var ejs=require(_0x2805('0x7'));var fs=require('fs');var fs_extra=require(_0x2805('0x8'));var _=require(_0x2805('0x9'));var squel=require(_0x2805('0xa'));var crypto=require('crypto');var jsforce=require(_0x2805('0xb'));var deskjs=require(_0x2805('0xc'));var toCsv=require(_0x2805('0x6'));var querystring=require('querystring');var Papa=require(_0x2805('0xd'));var Redis=require(_0x2805('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2805('0xf'));var as=require(_0x2805('0x10'));var hardwareService=require(_0x2805('0x11'));var logger=require(_0x2805('0x12'))(_0x2805('0x13'));var utils=require(_0x2805('0x14'));var config=require(_0x2805('0x15'));var licenseUtil=require(_0x2805('0x16'));var db=require(_0x2805('0x17'))['db'];function respondWithStatusCode(_0xe24c3a,_0x1b7220){_0x1b7220=_0x1b7220||0xcc;return function(_0xabb767){if(_0xabb767){return _0xe24c3a[_0x2805('0x18')](_0x1b7220);}return _0xe24c3a[_0x2805('0x19')](_0x1b7220)[_0x2805('0x1a')]();};}function respondWithResult(_0x1aa512,_0x273978){_0x273978=_0x273978||0xc8;return function(_0x30e2f5){if(_0x30e2f5){return _0x1aa512[_0x2805('0x19')](_0x273978)['json'](_0x30e2f5);}};}function respondWithFilteredResult(_0x2a8ccd,_0x298091){return function(_0x20d434){if(_0x20d434){var _0x33be63=typeof _0x298091[_0x2805('0x1b')]===_0x2805('0x1c')&&typeof _0x298091[_0x2805('0x1d')]===_0x2805('0x1c');var _0x32fe76=_0x20d434['count'];var _0x328f3f=_0x33be63?0x0:_0x298091['offset'];var _0x124a5d=_0x33be63?_0x20d434[_0x2805('0x1e')]:_0x298091[_0x2805('0x1b')]+_0x298091['limit'];var _0x44f8a7;if(_0x124a5d>=_0x32fe76){_0x124a5d=_0x32fe76;_0x44f8a7=0xc8;}else{_0x44f8a7=0xce;}_0x2a8ccd['status'](_0x44f8a7);return _0x2a8ccd[_0x2805('0x1f')](_0x2805('0x20'),_0x328f3f+'-'+_0x124a5d+'/'+_0x32fe76)[_0x2805('0x21')](_0x20d434);}return null;};}function patchUpdates(_0x4bd35c){return function(_0x48a4f8){try{jsonpatch[_0x2805('0x22')](_0x48a4f8,_0x4bd35c,!![]);}catch(_0x3d9440){return BPromise[_0x2805('0x23')](_0x3d9440);}return _0x48a4f8[_0x2805('0x24')]();};}function saveUpdates(_0x5089cd,_0x1ad218){return function(_0xbe10f2){if(_0xbe10f2){return _0xbe10f2[_0x2805('0x25')](_0x5089cd)[_0x2805('0x26')](function(_0xa626c3){return _0xa626c3;});}return null;};}function removeEntity(_0x2ef20f,_0x183641){return function(_0x22249d){if(_0x22249d){return _0x22249d[_0x2805('0x27')]()['then'](function(){_0x2ef20f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1509f4,_0xba5de){return function(_0x59fbc6){if(!_0x59fbc6){_0x1509f4['sendStatus'](0x194);}return _0x59fbc6;};}function handleError(_0x57943c,_0x448244){_0x448244=_0x448244||0x1f4;return function(_0x2ad8ba){logger[_0x2805('0x28')](_0x2ad8ba[_0x2805('0x29')]);if(_0x2ad8ba[_0x2805('0x2a')]){delete _0x2ad8ba[_0x2805('0x2a')];}_0x57943c[_0x2805('0x19')](_0x448244)['send'](_0x2ad8ba);};}exports[_0x2805('0x2b')]=function(_0x16ad39,_0x4b2d96){var _0x533061={},_0x1a86cf={},_0x5c6246={'count':0x0,'rows':[]};var _0x304d1d=_[_0x2805('0x2c')](db[_0x2805('0x2d')][_0x2805('0x2e')],function(_0x294b71){return{'name':_0x294b71['fieldName'],'type':_0x294b71['type'][_0x2805('0x2f')]};});_0x1a86cf[_0x2805('0x30')]=_[_0x2805('0x2c')](_0x304d1d,_0x2805('0x2a'));_0x1a86cf[_0x2805('0x31')]=_[_0x2805('0x32')](_0x16ad39[_0x2805('0x31')]);_0x1a86cf[_0x2805('0x33')]=_['intersection'](_0x1a86cf['model'],_0x1a86cf[_0x2805('0x31')]);_0x533061[_0x2805('0x34')]=_[_0x2805('0x35')](_0x1a86cf[_0x2805('0x30')],qs[_0x2805('0x36')](_0x16ad39[_0x2805('0x31')][_0x2805('0x36')]));_0x533061[_0x2805('0x34')]=_0x533061[_0x2805('0x34')][_0x2805('0x37')]?_0x533061[_0x2805('0x34')]:_0x1a86cf[_0x2805('0x30')];if(!_0x16ad39['query'][_0x2805('0x38')](_0x2805('0x39'))){_0x533061[_0x2805('0x1d')]=qs[_0x2805('0x1d')](_0x16ad39['query']['limit']);_0x533061[_0x2805('0x1b')]=qs[_0x2805('0x1b')](_0x16ad39[_0x2805('0x31')][_0x2805('0x1b')]);}_0x533061[_0x2805('0x3a')]=qs[_0x2805('0x3b')](_0x16ad39[_0x2805('0x31')]['sort']);_0x533061[_0x2805('0x3c')]=qs[_0x2805('0x33')](_[_0x2805('0x3d')](_0x16ad39[_0x2805('0x31')],_0x1a86cf[_0x2805('0x33')]),_0x304d1d);if(_0x16ad39[_0x2805('0x31')]['filter']){_0x533061[_0x2805('0x3c')]=_['merge'](_0x533061[_0x2805('0x3c')],{'$or':_['map'](_0x304d1d,function(_0x432753){if(_0x432753[_0x2805('0x3e')]!==_0x2805('0x3f')){var _0x29b04c={};_0x29b04c[_0x432753['name']]={'$like':'%'+_0x16ad39[_0x2805('0x31')][_0x2805('0x40')]+'%'};return _0x29b04c;}})});}_0x533061=_[_0x2805('0x41')]({},_0x533061,_0x16ad39[_0x2805('0x42')]);var _0x4bed60={'where':_0x533061[_0x2805('0x3c')]};return db[_0x2805('0x2d')][_0x2805('0x1e')](_0x4bed60)[_0x2805('0x26')](function(_0x1abf25){_0x5c6246[_0x2805('0x1e')]=_0x1abf25;if(_0x16ad39['query'][_0x2805('0x43')]){_0x533061[_0x2805('0x44')]=[{'all':!![]}];}return db[_0x2805('0x2d')]['findAll'](_0x533061);})[_0x2805('0x26')](function(_0x4c1b4c){_0x5c6246[_0x2805('0x45')]=_0x4c1b4c;return _0x5c6246;})[_0x2805('0x26')](respondWithFilteredResult(_0x4b2d96,_0x533061))[_0x2805('0x46')](handleError(_0x4b2d96,null));};exports[_0x2805('0x47')]=function(_0x2cd429,_0xf857fc){var _0x4f14e0={'raw':!![],'where':{'id':_0x2cd429['params']['id']}},_0x59b92c={};_0x59b92c['model']=_[_0x2805('0x32')](db[_0x2805('0x2d')]['rawAttributes']);_0x59b92c['query']=_[_0x2805('0x32')](_0x2cd429[_0x2805('0x31')]);_0x59b92c[_0x2805('0x33')]=_[_0x2805('0x35')](_0x59b92c['model'],_0x59b92c[_0x2805('0x31')]);_0x4f14e0[_0x2805('0x34')]=_[_0x2805('0x35')](_0x59b92c[_0x2805('0x30')],qs[_0x2805('0x36')](_0x2cd429[_0x2805('0x31')][_0x2805('0x36')]));_0x4f14e0[_0x2805('0x34')]=_0x4f14e0['attributes'][_0x2805('0x37')]?_0x4f14e0[_0x2805('0x34')]:_0x59b92c[_0x2805('0x30')];if(_0x2cd429['query'][_0x2805('0x43')]){_0x4f14e0['include']=[{'all':!![]}];}_0x4f14e0=_[_0x2805('0x41')]({},_0x4f14e0,_0x2cd429[_0x2805('0x42')]);return db['MailSubstatus'][_0x2805('0x48')](_0x4f14e0)[_0x2805('0x26')](handleEntityNotFound(_0xf857fc,null))[_0x2805('0x26')](respondWithResult(_0xf857fc,null))[_0x2805('0x46')](handleError(_0xf857fc,null));};exports[_0x2805('0x49')]=function(_0x395ffa,_0x870d96){return db[_0x2805('0x2d')]['create'](_0x395ffa['body'],{})[_0x2805('0x26')](respondWithResult(_0x870d96,0xc9))[_0x2805('0x46')](handleError(_0x870d96,null));};exports['update']=function(_0x3eaaa5,_0x2094ad){if(_0x3eaaa5['body']['id']){delete _0x3eaaa5[_0x2805('0x4a')]['id'];}return db[_0x2805('0x2d')]['find']({'where':{'id':_0x3eaaa5[_0x2805('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2094ad,null))[_0x2805('0x26')](saveUpdates(_0x3eaaa5[_0x2805('0x4a')],null))[_0x2805('0x26')](respondWithResult(_0x2094ad,null))[_0x2805('0x46')](handleError(_0x2094ad,null));};exports[_0x2805('0x27')]=function(_0x2a4265,_0x5c2228){return db[_0x2805('0x2d')][_0x2805('0x48')]({'where':{'id':_0x2a4265[_0x2805('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5c2228,null))[_0x2805('0x26')](removeEntity(_0x5c2228,null))['catch'](handleError(_0x5c2228,null));};exports[_0x2805('0x4c')]=function(_0x3f07b3,_0x12df29){return db['MailSubstatus']['describe']()[_0x2805('0x26')](respondWithResult(_0x12df29,null))[_0x2805('0x46')](handleError(_0x12df29,null));}; \ No newline at end of file +var _0x3b21=['describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','index','MailSubstatus','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','destroy'];(function(_0x422890,_0x434494){var _0x202cf0=function(_0x10e9f0){while(--_0x10e9f0){_0x422890['push'](_0x422890['shift']());}};_0x202cf0(++_0x434494);}(_0x3b21,0xca));var _0x13b2=function(_0x27faad,_0x952ba5){_0x27faad=_0x27faad-0x0;var _0x109840=_0x3b21[_0x27faad];return _0x109840;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13b2('0x0'));var zipdir=require(_0x13b2('0x1'));var jsonpatch=require(_0x13b2('0x2'));var rp=require(_0x13b2('0x3'));var moment=require(_0x13b2('0x4'));var BPromise=require(_0x13b2('0x5'));var Mustache=require('mustache');var util=require(_0x13b2('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x13b2('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x13b2('0x8'));var toCsv=require(_0x13b2('0x9'));var querystring=require(_0x13b2('0xa'));var Papa=require(_0x13b2('0xb'));var Redis=require(_0x13b2('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x13b2('0xd'));var as=require(_0x13b2('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x13b2('0xf'))('api');var utils=require(_0x13b2('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x13b2('0x11'));var db=require(_0x13b2('0x12'))['db'];function respondWithStatusCode(_0xa5c6b4,_0xccbd0c){_0xccbd0c=_0xccbd0c||0xcc;return function(_0x16db83){if(_0x16db83){return _0xa5c6b4['sendStatus'](_0xccbd0c);}return _0xa5c6b4[_0x13b2('0x13')](_0xccbd0c)[_0x13b2('0x14')]();};}function respondWithResult(_0x584f37,_0x43db68){_0x43db68=_0x43db68||0xc8;return function(_0xd77812){if(_0xd77812){return _0x584f37[_0x13b2('0x13')](_0x43db68)[_0x13b2('0x15')](_0xd77812);}};}function respondWithFilteredResult(_0xf34d98,_0x478376){return function(_0x253974){if(_0x253974){var _0x38dc99=typeof _0x478376['offset']===_0x13b2('0x16')&&typeof _0x478376['limit']===_0x13b2('0x16');var _0x398e0d=_0x253974[_0x13b2('0x17')];var _0x37eca=_0x38dc99?0x0:_0x478376['offset'];var _0x583ff5=_0x38dc99?_0x253974[_0x13b2('0x17')]:_0x478376[_0x13b2('0x18')]+_0x478376[_0x13b2('0x19')];var _0x5b0ba9;if(_0x583ff5>=_0x398e0d){_0x583ff5=_0x398e0d;_0x5b0ba9=0xc8;}else{_0x5b0ba9=0xce;}_0xf34d98['status'](_0x5b0ba9);return _0xf34d98['set'](_0x13b2('0x1a'),_0x37eca+'-'+_0x583ff5+'/'+_0x398e0d)[_0x13b2('0x15')](_0x253974);}return null;};}function patchUpdates(_0x33f9c9){return function(_0x35b3f3){try{jsonpatch[_0x13b2('0x1b')](_0x35b3f3,_0x33f9c9,!![]);}catch(_0x190c98){return BPromise[_0x13b2('0x1c')](_0x190c98);}return _0x35b3f3['save']();};}function saveUpdates(_0x534900,_0x256b25){return function(_0x1a6f32){if(_0x1a6f32){return _0x1a6f32[_0x13b2('0x1d')](_0x534900)[_0x13b2('0x1e')](function(_0x3def84){return _0x3def84;});}return null;};}function removeEntity(_0x1cf01c,_0x5409b6){return function(_0x55391d){if(_0x55391d){return _0x55391d['destroy']()['then'](function(){_0x1cf01c[_0x13b2('0x13')](0xcc)[_0x13b2('0x14')]();});}};}function handleEntityNotFound(_0x521e21,_0x8a7c6c){return function(_0x46011f){if(!_0x46011f){_0x521e21[_0x13b2('0x1f')](0x194);}return _0x46011f;};}function handleError(_0x4e768b,_0x3697a1){_0x3697a1=_0x3697a1||0x1f4;return function(_0x5960b5){logger[_0x13b2('0x20')](_0x5960b5[_0x13b2('0x21')]);if(_0x5960b5[_0x13b2('0x22')]){delete _0x5960b5['name'];}_0x4e768b[_0x13b2('0x13')](_0x3697a1)['send'](_0x5960b5);};}exports[_0x13b2('0x23')]=function(_0x476114,_0x38c7b9){var _0x36a290={},_0x4e8497={},_0x5639c1={'count':0x0,'rows':[]};var _0x2eda53=_['map'](db[_0x13b2('0x24')]['rawAttributes'],function(_0x49fdd1){return{'name':_0x49fdd1[_0x13b2('0x25')],'type':_0x49fdd1['type']['key']};});_0x4e8497[_0x13b2('0x26')]=_['map'](_0x2eda53,_0x13b2('0x22'));_0x4e8497['query']=_[_0x13b2('0x27')](_0x476114[_0x13b2('0x28')]);_0x4e8497[_0x13b2('0x29')]=_['intersection'](_0x4e8497[_0x13b2('0x26')],_0x4e8497[_0x13b2('0x28')]);_0x36a290['attributes']=_[_0x13b2('0x2a')](_0x4e8497[_0x13b2('0x26')],qs[_0x13b2('0x2b')](_0x476114['query']['fields']));_0x36a290[_0x13b2('0x2c')]=_0x36a290[_0x13b2('0x2c')][_0x13b2('0x2d')]?_0x36a290[_0x13b2('0x2c')]:_0x4e8497[_0x13b2('0x26')];if(!_0x476114[_0x13b2('0x28')][_0x13b2('0x2e')](_0x13b2('0x2f'))){_0x36a290[_0x13b2('0x19')]=qs[_0x13b2('0x19')](_0x476114[_0x13b2('0x28')][_0x13b2('0x19')]);_0x36a290[_0x13b2('0x18')]=qs['offset'](_0x476114[_0x13b2('0x28')][_0x13b2('0x18')]);}_0x36a290[_0x13b2('0x30')]=qs[_0x13b2('0x31')](_0x476114['query']['sort']);_0x36a290[_0x13b2('0x32')]=qs[_0x13b2('0x29')](_[_0x13b2('0x33')](_0x476114[_0x13b2('0x28')],_0x4e8497[_0x13b2('0x29')]),_0x2eda53);if(_0x476114[_0x13b2('0x28')]['filter']){_0x36a290['where']=_[_0x13b2('0x34')](_0x36a290[_0x13b2('0x32')],{'$or':_['map'](_0x2eda53,function(_0x478419){if(_0x478419[_0x13b2('0x35')]!==_0x13b2('0x36')){var _0x4971da={};_0x4971da[_0x478419[_0x13b2('0x22')]]={'$like':'%'+_0x476114[_0x13b2('0x28')]['filter']+'%'};return _0x4971da;}})});}_0x36a290=_[_0x13b2('0x34')]({},_0x36a290,_0x476114[_0x13b2('0x37')]);var _0x26b8ea={'where':_0x36a290[_0x13b2('0x32')]};return db[_0x13b2('0x24')][_0x13b2('0x17')](_0x26b8ea)['then'](function(_0x46c887){_0x5639c1[_0x13b2('0x17')]=_0x46c887;if(_0x476114['query']['includeAll']){_0x36a290[_0x13b2('0x38')]=[{'all':!![]}];}return db[_0x13b2('0x24')][_0x13b2('0x39')](_0x36a290);})[_0x13b2('0x1e')](function(_0x47d8ea){_0x5639c1['rows']=_0x47d8ea;return _0x5639c1;})[_0x13b2('0x1e')](respondWithFilteredResult(_0x38c7b9,_0x36a290))[_0x13b2('0x3a')](handleError(_0x38c7b9,null));};exports['show']=function(_0x337f0,_0xb3b6e8){var _0x4270fc={'raw':!![],'where':{'id':_0x337f0[_0x13b2('0x3b')]['id']}},_0x1ee20e={};_0x1ee20e[_0x13b2('0x26')]=_[_0x13b2('0x27')](db['MailSubstatus'][_0x13b2('0x3c')]);_0x1ee20e[_0x13b2('0x28')]=_[_0x13b2('0x27')](_0x337f0[_0x13b2('0x28')]);_0x1ee20e[_0x13b2('0x29')]=_['intersection'](_0x1ee20e[_0x13b2('0x26')],_0x1ee20e['query']);_0x4270fc['attributes']=_['intersection'](_0x1ee20e[_0x13b2('0x26')],qs['fields'](_0x337f0['query']['fields']));_0x4270fc[_0x13b2('0x2c')]=_0x4270fc['attributes']['length']?_0x4270fc[_0x13b2('0x2c')]:_0x1ee20e['model'];if(_0x337f0['query'][_0x13b2('0x3d')]){_0x4270fc[_0x13b2('0x38')]=[{'all':!![]}];}_0x4270fc=_[_0x13b2('0x34')]({},_0x4270fc,_0x337f0[_0x13b2('0x37')]);return db['MailSubstatus'][_0x13b2('0x3e')](_0x4270fc)[_0x13b2('0x1e')](handleEntityNotFound(_0xb3b6e8,null))['then'](respondWithResult(_0xb3b6e8,null))[_0x13b2('0x3a')](handleError(_0xb3b6e8,null));};exports[_0x13b2('0x3f')]=function(_0x58c1e9,_0x5e5987){return db[_0x13b2('0x24')][_0x13b2('0x3f')](_0x58c1e9[_0x13b2('0x40')],{})[_0x13b2('0x1e')](respondWithResult(_0x5e5987,0xc9))[_0x13b2('0x3a')](handleError(_0x5e5987,null));};exports[_0x13b2('0x1d')]=function(_0x1d689d,_0x3cb11f){if(_0x1d689d[_0x13b2('0x40')]['id']){delete _0x1d689d[_0x13b2('0x40')]['id'];}return db[_0x13b2('0x24')][_0x13b2('0x3e')]({'where':{'id':_0x1d689d[_0x13b2('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3cb11f,null))[_0x13b2('0x1e')](saveUpdates(_0x1d689d[_0x13b2('0x40')],null))[_0x13b2('0x1e')](respondWithResult(_0x3cb11f,null))[_0x13b2('0x3a')](handleError(_0x3cb11f,null));};exports[_0x13b2('0x41')]=function(_0x24e262,_0x22b34a){return db[_0x13b2('0x24')]['find']({'where':{'id':_0x24e262['params']['id']}})[_0x13b2('0x1e')](handleEntityNotFound(_0x22b34a,null))[_0x13b2('0x1e')](removeEntity(_0x22b34a,null))[_0x13b2('0x3a')](handleError(_0x22b34a,null));};exports[_0x13b2('0x42')]=function(_0x39cdcd,_0x237c2a){return db['MailSubstatus'][_0x13b2('0x42')]()['then'](respondWithResult(_0x237c2a,null))[_0x13b2('0x3a')](handleError(_0x237c2a,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 6b1bb3b..ed093bf 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 _0x3f5d=['./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','../../config/logger','moment','path','../../config/environment'];(function(_0x2c4ece,_0x1b49c1){var _0x4a75a0=function(_0x270cf5){while(--_0x270cf5){_0x2c4ece['push'](_0x2c4ece['shift']());}};_0x4a75a0(++_0x1b49c1);}(_0x3f5d,0x13f));var _0xd3f5=function(_0x260aff,_0x26a602){_0x260aff=_0x260aff-0x0;var _0x57a755=_0x3f5d[_0x260aff];return _0x57a755;};'use strict';var _=require(_0xd3f5('0x0'));var util=require('util');var logger=require(_0xd3f5('0x1'))('api');var moment=require(_0xd3f5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3f5('0x3'));var rimraf=require('rimraf');var config=require(_0xd3f5('0x4'));var attributes=require(_0xd3f5('0x5'));module['exports']=function(_0x1ad2fd,_0x34e133){return _0x1ad2fd[_0xd3f5('0x6')](_0xd3f5('0x7'),attributes,{'tableName':_0xd3f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0798=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','lodash'];(function(_0x3d3a19,_0x595596){var _0x4e5e65=function(_0xd5e1e){while(--_0xd5e1e){_0x3d3a19['push'](_0x3d3a19['shift']());}};_0x4e5e65(++_0x595596);}(_0x0798,0x1e0));var _0x8079=function(_0x4d2093,_0x57acf1){_0x4d2093=_0x4d2093-0x0;var _0x4ac559=_0x0798[_0x4d2093];return _0x4ac559;};'use strict';var _=require(_0x8079('0x0'));var util=require('util');var logger=require(_0x8079('0x1'))(_0x8079('0x2'));var moment=require(_0x8079('0x3'));var BPromise=require(_0x8079('0x4'));var rp=require(_0x8079('0x5'));var fs=require('fs');var path=require(_0x8079('0x6'));var rimraf=require(_0x8079('0x7'));var config=require(_0x8079('0x8'));var attributes=require(_0x8079('0x9'));module[_0x8079('0xa')]=function(_0x3dac97,_0x108211){return _0x3dac97['define'](_0x8079('0xb'),attributes,{'tableName':_0x8079('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1d23812..45bc010 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 _0x4457=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x52ce3e,_0x25abc7){var _0x49f0ef=function(_0x108653){while(--_0x108653){_0x52ce3e['push'](_0x52ce3e['shift']());}};_0x49f0ef(++_0x25abc7);}(_0x4457,0xa9));var _0x7445=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x4457[_0x5b2865];return _0x3cb4c6;};'use strict';var _=require('lodash');var util=require(_0x7445('0x0'));var moment=require(_0x7445('0x1'));var BPromise=require(_0x7445('0x2'));var rs=require(_0x7445('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7445('0x4'))['db'];var utils=require(_0x7445('0x5'));var logger=require('../../config/logger')(_0x7445('0x6'));var config=require(_0x7445('0x7'));var jayson=require(_0x7445('0x8'));var client=jayson[_0x7445('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x313a4f,_0x2767c9,_0x286aa0){return new BPromise(function(_0x7c2b2d,_0x17144a){return client[_0x7445('0xa')](_0x313a4f,_0x286aa0)['then'](function(_0x17e096){logger[_0x7445('0xb')](_0x7445('0xc'),_0x2767c9,_0x7445('0xd'));logger[_0x7445('0xe')](_0x7445('0xf'),_0x2767c9,'request\x20sent',JSON[_0x7445('0x10')](_0x17e096));if(_0x17e096['error']){if(_0x17e096[_0x7445('0x11')]['code']===0x1f4){logger[_0x7445('0x11')](_0x7445('0xc'),_0x2767c9,_0x17e096[_0x7445('0x11')][_0x7445('0x12')]);return _0x17144a(_0x17e096[_0x7445('0x11')][_0x7445('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2767c9,_0x17e096[_0x7445('0x11')]['message']);return _0x7c2b2d(_0x17e096[_0x7445('0x11')][_0x7445('0x12')]);}else{logger['info'](_0x7445('0xc'),_0x2767c9,'request\x20sent');_0x7c2b2d(_0x17e096[_0x7445('0x13')]['message']);}})[_0x7445('0x14')](function(_0x9dfcc9){logger[_0x7445('0x11')](_0x7445('0xc'),_0x2767c9,_0x9dfcc9);_0x17144a(_0x9dfcc9);});});} \ No newline at end of file +var _0x477f=['../../config/environment','jayson/promise','client','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x31b944,_0x5ce272){var _0xb09cc5=function(_0x53a38b){while(--_0x53a38b){_0x31b944['push'](_0x31b944['shift']());}};_0xb09cc5(++_0x5ce272);}(_0x477f,0x1dc));var _0xf477=function(_0x8cb3db,_0xbc7b4c){_0x8cb3db=_0x8cb3db-0x0;var _0x2d451d=_0x477f[_0x8cb3db];return _0x2d451d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf477('0x0'));var BPromise=require(_0xf477('0x1'));var rs=require(_0xf477('0x2'));var fs=require('fs');var Redis=require(_0xf477('0x3'));var db=require(_0xf477('0x4'))['db'];var utils=require(_0xf477('0x5'));var logger=require(_0xf477('0x6'))(_0xf477('0x7'));var config=require(_0xf477('0x8'));var jayson=require(_0xf477('0x9'));var client=jayson[_0xf477('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x345e47,_0x5928be,_0x4d51ec){return new BPromise(function(_0x3948e0,_0x1e1f4c){return client[_0xf477('0xb')](_0x345e47,_0x4d51ec)[_0xf477('0xc')](function(_0x3a203e){logger['info'](_0xf477('0xd'),_0x5928be,_0xf477('0xe'));logger[_0xf477('0xf')](_0xf477('0x10'),_0x5928be,_0xf477('0xe'),JSON['stringify'](_0x3a203e));if(_0x3a203e[_0xf477('0x11')]){if(_0x3a203e[_0xf477('0x11')][_0xf477('0x12')]===0x1f4){logger[_0xf477('0x11')](_0xf477('0xd'),_0x5928be,_0x3a203e[_0xf477('0x11')]['message']);return _0x1e1f4c(_0x3a203e['error'][_0xf477('0x13')]);}logger['error'](_0xf477('0xd'),_0x5928be,_0x3a203e['error'][_0xf477('0x13')]);return _0x3948e0(_0x3a203e['error']['message']);}else{logger[_0xf477('0x14')](_0xf477('0xd'),_0x5928be,_0xf477('0xe'));_0x3948e0(_0x3a203e['result'][_0xf477('0x13')]);}})[_0xf477('0x15')](function(_0x4a509f){logger[_0xf477('0x11')](_0xf477('0xd'),_0x5928be,_0x4a509f);_0x1e1f4c(_0x4a509f);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 17e86f0..df8cd9f 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 _0xe45b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','destroy','exports','multer','util','path'];(function(_0x5c85c8,_0x16110b){var _0x42d66f=function(_0x2c6dda){while(--_0x2c6dda){_0x5c85c8['push'](_0x5c85c8['shift']());}};_0x42d66f(++_0x16110b);}(_0xe45b,0xd9));var _0xbe45=function(_0x567883,_0x3e80ca){_0x567883=_0x567883-0x0;var _0x5429d8=_0xe45b[_0x567883];return _0x5429d8;};'use strict';var multer=require(_0xbe45('0x0'));var util=require(_0xbe45('0x1'));var path=require(_0xbe45('0x2'));var timeout=require(_0xbe45('0x3'));var express=require(_0xbe45('0x4'));var router=express[_0xbe45('0x5')]();var fs_extra=require(_0xbe45('0x6'));var auth=require(_0xbe45('0x7'));var interaction=require(_0xbe45('0x8'));var config=require(_0xbe45('0x9'));var controller=require(_0xbe45('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xbe45('0xb')]);router[_0xbe45('0xc')](_0xbe45('0xd'),auth[_0xbe45('0xe')](),controller[_0xbe45('0xf')]);router[_0xbe45('0xc')](_0xbe45('0x10'),auth[_0xbe45('0xe')](),controller[_0xbe45('0x11')]);router[_0xbe45('0x12')]('/',auth[_0xbe45('0xe')](),controller[_0xbe45('0x13')]);router['put'](_0xbe45('0x10'),auth[_0xbe45('0xe')](),controller['update']);router['delete']('/:id',auth[_0xbe45('0xe')](),controller[_0xbe45('0x14')]);module[_0xbe45('0x15')]=router; \ No newline at end of file +var _0x9f77=['index','/describe','describe','/:id','show','create','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x17ee38,_0x5bdff4){var _0x439a4e=function(_0x2c6e2b){while(--_0x2c6e2b){_0x17ee38['push'](_0x17ee38['shift']());}};_0x439a4e(++_0x5bdff4);}(_0x9f77,0x6d));var _0x79f7=function(_0x2a6060,_0x1bd2b3){_0x2a6060=_0x2a6060-0x0;var _0x50beeb=_0x9f77[_0x2a6060];return _0x50beeb;};'use strict';var multer=require(_0x79f7('0x0'));var util=require('util');var path=require(_0x79f7('0x1'));var timeout=require(_0x79f7('0x2'));var express=require(_0x79f7('0x3'));var router=express['Router']();var fs_extra=require(_0x79f7('0x4'));var auth=require(_0x79f7('0x5'));var interaction=require(_0x79f7('0x6'));var config=require(_0x79f7('0x7'));var controller=require(_0x79f7('0x8'));router[_0x79f7('0x9')]('/',auth[_0x79f7('0xa')](),controller[_0x79f7('0xb')]);router[_0x79f7('0x9')](_0x79f7('0xc'),auth[_0x79f7('0xa')](),controller[_0x79f7('0xd')]);router['get'](_0x79f7('0xe'),auth[_0x79f7('0xa')](),controller[_0x79f7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x79f7('0x10')]);router['put']('/:id',auth[_0x79f7('0xa')](),controller[_0x79f7('0x11')]);router[_0x79f7('0x12')](_0x79f7('0xe'),auth[_0x79f7('0xa')](),controller[_0x79f7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 35044d2..1239476 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0xfa5032,_0x5be306){var _0x41f425=function(_0x3771f7){while(--_0x3771f7){_0xfa5032['push'](_0xfa5032['shift']());}};_0x41f425(++_0x5be306);}(_0x4b84,0x1cc));var _0x44b8=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x4b84[_0x134c2e];return _0x2825db;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4841da,_0x1a5d31){var _0x8befd1=function(_0x17c9fc){while(--_0x17c9fc){_0x4841da['push'](_0x4841da['shift']());}};_0x8befd1(++_0x1a5d31);}(_0x34e8,0x12c));var _0x834e=function(_0x49e44e,_0x72587a){_0x49e44e=_0x49e44e-0x0;var _0x72ba94=_0x34e8[_0x49e44e];return _0x72ba94;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 60874f0..fead9f5 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 _0x35ec=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','MailTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2c91c0,_0x38b7f3){var _0x18c3d7=function(_0xd60931){while(--_0xd60931){_0x2c91c0['push'](_0x2c91c0['shift']());}};_0x18c3d7(++_0x38b7f3);}(_0x35ec,0xc5));var _0xc35e=function(_0x7b2713,_0x38f494){_0x7b2713=_0x7b2713-0x0;var _0x28fb59=_0x35ec[_0x7b2713];return _0x28fb59;};'use strict';var emlformat=require(_0xc35e('0x0'));var rimraf=require(_0xc35e('0x1'));var zipdir=require(_0xc35e('0x2'));var jsonpatch=require(_0xc35e('0x3'));var rp=require(_0xc35e('0x4'));var moment=require(_0xc35e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc35e('0x6'));var util=require(_0xc35e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc35e('0x8'));var ejs=require(_0xc35e('0x9'));var fs=require('fs');var fs_extra=require(_0xc35e('0xa'));var _=require(_0xc35e('0xb'));var squel=require(_0xc35e('0xc'));var crypto=require('crypto');var jsforce=require(_0xc35e('0xd'));var deskjs=require(_0xc35e('0xe'));var toCsv=require(_0xc35e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc35e('0xf'));var authService=require(_0xc35e('0x10'));var qs=require(_0xc35e('0x11'));var as=require(_0xc35e('0x12'));var hardwareService=require(_0xc35e('0x13'));var logger=require('../../config/logger')(_0xc35e('0x14'));var utils=require(_0xc35e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc35e('0x16'))['db'];function respondWithStatusCode(_0x14c53a,_0x322735){_0x322735=_0x322735||0xcc;return function(_0x4d2658){if(_0x4d2658){return _0x14c53a[_0xc35e('0x17')](_0x322735);}return _0x14c53a[_0xc35e('0x18')](_0x322735)[_0xc35e('0x19')]();};}function respondWithResult(_0x342a81,_0x319e3f){_0x319e3f=_0x319e3f||0xc8;return function(_0x3994c3){if(_0x3994c3){return _0x342a81['status'](_0x319e3f)['json'](_0x3994c3);}};}function respondWithFilteredResult(_0xf47354,_0x3cd94b){return function(_0x4710b5){if(_0x4710b5){var _0x17ad72=typeof _0x3cd94b[_0xc35e('0x1a')]==='undefined'&&typeof _0x3cd94b[_0xc35e('0x1b')]===_0xc35e('0x1c');var _0x536b47=_0x4710b5['count'];var _0x3cd68d=_0x17ad72?0x0:_0x3cd94b[_0xc35e('0x1a')];var _0x4f160a=_0x17ad72?_0x4710b5[_0xc35e('0x1d')]:_0x3cd94b[_0xc35e('0x1a')]+_0x3cd94b[_0xc35e('0x1b')];var _0x2b690f;if(_0x4f160a>=_0x536b47){_0x4f160a=_0x536b47;_0x2b690f=0xc8;}else{_0x2b690f=0xce;}_0xf47354[_0xc35e('0x18')](_0x2b690f);return _0xf47354[_0xc35e('0x1e')](_0xc35e('0x1f'),_0x3cd68d+'-'+_0x4f160a+'/'+_0x536b47)['json'](_0x4710b5);}return null;};}function patchUpdates(_0x3b7969){return function(_0x5a5586){try{jsonpatch[_0xc35e('0x20')](_0x5a5586,_0x3b7969,!![]);}catch(_0x31f5eb){return BPromise[_0xc35e('0x21')](_0x31f5eb);}return _0x5a5586['save']();};}function saveUpdates(_0x3fdfc3,_0x19eb37){return function(_0x229a49){if(_0x229a49){return _0x229a49[_0xc35e('0x22')](_0x3fdfc3)[_0xc35e('0x23')](function(_0x163469){return _0x163469;});}return null;};}function removeEntity(_0xfbd409,_0x25d3e0){return function(_0xdaf419){if(_0xdaf419){return _0xdaf419[_0xc35e('0x24')]()[_0xc35e('0x23')](function(){_0xfbd409['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa58a5,_0x4168e3){return function(_0x4d3f10){if(!_0x4d3f10){_0xaa58a5[_0xc35e('0x17')](0x194);}return _0x4d3f10;};}function handleError(_0x5b47e6,_0x1f1a02){_0x1f1a02=_0x1f1a02||0x1f4;return function(_0x13eca8){logger['error'](_0x13eca8['stack']);if(_0x13eca8[_0xc35e('0x25')]){delete _0x13eca8[_0xc35e('0x25')];}_0x5b47e6['status'](_0x1f1a02)[_0xc35e('0x26')](_0x13eca8);};}exports[_0xc35e('0x27')]=function(_0x10e215,_0x16efde){var _0x3301b7={},_0x228b4c={},_0x4a8e49={'count':0x0,'rows':[]};var _0x1cc7d3=_[_0xc35e('0x28')](db[_0xc35e('0x29')][_0xc35e('0x2a')],function(_0x1edca0){return{'name':_0x1edca0[_0xc35e('0x2b')],'type':_0x1edca0['type']['key']};});_0x228b4c[_0xc35e('0x2c')]=_[_0xc35e('0x28')](_0x1cc7d3,_0xc35e('0x25'));_0x228b4c[_0xc35e('0x2d')]=_[_0xc35e('0x2e')](_0x10e215[_0xc35e('0x2d')]);_0x228b4c[_0xc35e('0x2f')]=_[_0xc35e('0x30')](_0x228b4c[_0xc35e('0x2c')],_0x228b4c[_0xc35e('0x2d')]);_0x3301b7['attributes']=_[_0xc35e('0x30')](_0x228b4c[_0xc35e('0x2c')],qs[_0xc35e('0x31')](_0x10e215[_0xc35e('0x2d')][_0xc35e('0x31')]));_0x3301b7['attributes']=_0x3301b7['attributes'][_0xc35e('0x32')]?_0x3301b7[_0xc35e('0x33')]:_0x228b4c[_0xc35e('0x2c')];if(!_0x10e215['query'][_0xc35e('0x34')](_0xc35e('0x35'))){_0x3301b7[_0xc35e('0x1b')]=qs[_0xc35e('0x1b')](_0x10e215['query'][_0xc35e('0x1b')]);_0x3301b7[_0xc35e('0x1a')]=qs[_0xc35e('0x1a')](_0x10e215[_0xc35e('0x2d')][_0xc35e('0x1a')]);}_0x3301b7[_0xc35e('0x36')]=qs[_0xc35e('0x37')](_0x10e215[_0xc35e('0x2d')][_0xc35e('0x37')]);_0x3301b7[_0xc35e('0x38')]=qs['filters'](_['pick'](_0x10e215[_0xc35e('0x2d')],_0x228b4c[_0xc35e('0x2f')]),_0x1cc7d3);if(_0x10e215[_0xc35e('0x2d')]['filter']){_0x3301b7[_0xc35e('0x38')]=_[_0xc35e('0x39')](_0x3301b7[_0xc35e('0x38')],{'$or':_['map'](_0x1cc7d3,function(_0x4174aa){if(_0x4174aa['type']!==_0xc35e('0x3a')){var _0x398bce={};_0x398bce[_0x4174aa[_0xc35e('0x25')]]={'$like':'%'+_0x10e215['query'][_0xc35e('0x3b')]+'%'};return _0x398bce;}})});}_0x3301b7=_[_0xc35e('0x39')]({},_0x3301b7,_0x10e215[_0xc35e('0x3c')]);var _0x5e8195={'where':_0x3301b7[_0xc35e('0x38')]};return db[_0xc35e('0x29')][_0xc35e('0x1d')](_0x5e8195)[_0xc35e('0x23')](function(_0x49d57b){_0x4a8e49['count']=_0x49d57b;if(_0x10e215[_0xc35e('0x2d')][_0xc35e('0x3d')]){_0x3301b7[_0xc35e('0x3e')]=[{'all':!![]}];}return db[_0xc35e('0x29')]['findAll'](_0x3301b7);})[_0xc35e('0x23')](function(_0x59b68d){_0x4a8e49[_0xc35e('0x3f')]=_0x59b68d;return _0x4a8e49;})[_0xc35e('0x23')](respondWithFilteredResult(_0x16efde,_0x3301b7))[_0xc35e('0x40')](handleError(_0x16efde,null));};exports[_0xc35e('0x41')]=function(_0x1c85e8,_0x18e8a6){var _0x4a911d={'raw':!![],'where':{'id':_0x1c85e8['params']['id']}},_0x4734c0={};_0x4734c0[_0xc35e('0x2c')]=_[_0xc35e('0x2e')](db['MailTransferReport'][_0xc35e('0x2a')]);_0x4734c0['query']=_[_0xc35e('0x2e')](_0x1c85e8['query']);_0x4734c0['filters']=_[_0xc35e('0x30')](_0x4734c0[_0xc35e('0x2c')],_0x4734c0[_0xc35e('0x2d')]);_0x4a911d[_0xc35e('0x33')]=_['intersection'](_0x4734c0[_0xc35e('0x2c')],qs['fields'](_0x1c85e8[_0xc35e('0x2d')]['fields']));_0x4a911d[_0xc35e('0x33')]=_0x4a911d['attributes'][_0xc35e('0x32')]?_0x4a911d['attributes']:_0x4734c0['model'];if(_0x1c85e8[_0xc35e('0x2d')][_0xc35e('0x3d')]){_0x4a911d['include']=[{'all':!![]}];}_0x4a911d=_[_0xc35e('0x39')]({},_0x4a911d,_0x1c85e8['options']);return db[_0xc35e('0x29')][_0xc35e('0x42')](_0x4a911d)[_0xc35e('0x23')](handleEntityNotFound(_0x18e8a6,null))[_0xc35e('0x23')](respondWithResult(_0x18e8a6,null))[_0xc35e('0x40')](handleError(_0x18e8a6,null));};exports[_0xc35e('0x43')]=function(_0x3f455f,_0x47081c){return db[_0xc35e('0x29')][_0xc35e('0x43')](_0x3f455f[_0xc35e('0x44')],{})[_0xc35e('0x23')](respondWithResult(_0x47081c,0xc9))[_0xc35e('0x40')](handleError(_0x47081c,null));};exports['update']=function(_0x2d60d8,_0x788be3){if(_0x2d60d8['body']['id']){delete _0x2d60d8[_0xc35e('0x44')]['id'];}return db[_0xc35e('0x29')][_0xc35e('0x42')]({'where':{'id':_0x2d60d8[_0xc35e('0x45')]['id']}})['then'](handleEntityNotFound(_0x788be3,null))['then'](saveUpdates(_0x2d60d8[_0xc35e('0x44')],null))[_0xc35e('0x23')](respondWithResult(_0x788be3,null))[_0xc35e('0x40')](handleError(_0x788be3,null));};exports[_0xc35e('0x24')]=function(_0x685241,_0x5a0029){return db[_0xc35e('0x29')][_0xc35e('0x42')]({'where':{'id':_0x685241[_0xc35e('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a0029,null))[_0xc35e('0x23')](removeEntity(_0x5a0029,null))[_0xc35e('0x40')](handleError(_0x5a0029,null));};exports['describe']=function(_0x3ea909,_0x56a444){return db[_0xc35e('0x29')]['describe']()[_0xc35e('0x23')](respondWithResult(_0x56a444,null))[_0xc35e('0x40')](handleError(_0x56a444,null));}; \ No newline at end of file +var _0x7ed9=['status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','MailTransferReport','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x4b398d,_0x467601){var _0x419244=function(_0x184111){while(--_0x184111){_0x4b398d['push'](_0x4b398d['shift']());}};_0x419244(++_0x467601);}(_0x7ed9,0xcd));var _0x97ed=function(_0x48917f,_0x31e165){_0x48917f=_0x48917f-0x0;var _0x18b2df=_0x7ed9[_0x48917f];return _0x18b2df;};'use strict';var emlformat=require(_0x97ed('0x0'));var rimraf=require(_0x97ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97ed('0x2'));var rp=require(_0x97ed('0x3'));var moment=require(_0x97ed('0x4'));var BPromise=require(_0x97ed('0x5'));var Mustache=require('mustache');var util=require(_0x97ed('0x6'));var path=require(_0x97ed('0x7'));var sox=require('sox');var csv=require(_0x97ed('0x8'));var ejs=require(_0x97ed('0x9'));var fs=require('fs');var fs_extra=require(_0x97ed('0xa'));var _=require(_0x97ed('0xb'));var squel=require(_0x97ed('0xc'));var crypto=require(_0x97ed('0xd'));var jsforce=require(_0x97ed('0xe'));var deskjs=require(_0x97ed('0xf'));var toCsv=require(_0x97ed('0x8'));var querystring=require(_0x97ed('0x10'));var Papa=require('papaparse');var Redis=require(_0x97ed('0x11'));var authService=require(_0x97ed('0x12'));var qs=require(_0x97ed('0x13'));var as=require(_0x97ed('0x14'));var hardwareService=require(_0x97ed('0x15'));var logger=require(_0x97ed('0x16'))(_0x97ed('0x17'));var utils=require('../../config/utils');var config=require(_0x97ed('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x97ed('0x19'))['db'];function respondWithStatusCode(_0x1e7459,_0x47ac92){_0x47ac92=_0x47ac92||0xcc;return function(_0x15b303){if(_0x15b303){return _0x1e7459['sendStatus'](_0x47ac92);}return _0x1e7459[_0x97ed('0x1a')](_0x47ac92)[_0x97ed('0x1b')]();};}function respondWithResult(_0x1720d4,_0x3333ed){_0x3333ed=_0x3333ed||0xc8;return function(_0x3291b8){if(_0x3291b8){return _0x1720d4[_0x97ed('0x1a')](_0x3333ed)['json'](_0x3291b8);}};}function respondWithFilteredResult(_0x5339e8,_0x1a7e6b){return function(_0x1b94f2){if(_0x1b94f2){var _0x229f52=typeof _0x1a7e6b[_0x97ed('0x1c')]===_0x97ed('0x1d')&&typeof _0x1a7e6b[_0x97ed('0x1e')]===_0x97ed('0x1d');var _0x28bdd7=_0x1b94f2['count'];var _0x25e6b3=_0x229f52?0x0:_0x1a7e6b[_0x97ed('0x1c')];var _0x21a568=_0x229f52?_0x1b94f2['count']:_0x1a7e6b[_0x97ed('0x1c')]+_0x1a7e6b[_0x97ed('0x1e')];var _0x1b9cc5;if(_0x21a568>=_0x28bdd7){_0x21a568=_0x28bdd7;_0x1b9cc5=0xc8;}else{_0x1b9cc5=0xce;}_0x5339e8[_0x97ed('0x1a')](_0x1b9cc5);return _0x5339e8[_0x97ed('0x1f')](_0x97ed('0x20'),_0x25e6b3+'-'+_0x21a568+'/'+_0x28bdd7)[_0x97ed('0x21')](_0x1b94f2);}return null;};}function patchUpdates(_0x251036){return function(_0x1189f9){try{jsonpatch[_0x97ed('0x22')](_0x1189f9,_0x251036,!![]);}catch(_0x272750){return BPromise[_0x97ed('0x23')](_0x272750);}return _0x1189f9[_0x97ed('0x24')]();};}function saveUpdates(_0x202d1d,_0xefc3f1){return function(_0xb8da5c){if(_0xb8da5c){return _0xb8da5c[_0x97ed('0x25')](_0x202d1d)[_0x97ed('0x26')](function(_0x2f2113){return _0x2f2113;});}return null;};}function removeEntity(_0x31e8fa,_0x10a399){return function(_0x4dda88){if(_0x4dda88){return _0x4dda88[_0x97ed('0x27')]()[_0x97ed('0x26')](function(){_0x31e8fa[_0x97ed('0x1a')](0xcc)[_0x97ed('0x1b')]();});}};}function handleEntityNotFound(_0x1b2709,_0x22f366){return function(_0xc7476d){if(!_0xc7476d){_0x1b2709['sendStatus'](0x194);}return _0xc7476d;};}function handleError(_0x4f9eda,_0x27f175){_0x27f175=_0x27f175||0x1f4;return function(_0x4bd52b){logger[_0x97ed('0x28')](_0x4bd52b[_0x97ed('0x29')]);if(_0x4bd52b[_0x97ed('0x2a')]){delete _0x4bd52b[_0x97ed('0x2a')];}_0x4f9eda[_0x97ed('0x1a')](_0x27f175)['send'](_0x4bd52b);};}exports[_0x97ed('0x2b')]=function(_0x5ae171,_0x569835){var _0x37ef66={},_0x194367={},_0x10d431={'count':0x0,'rows':[]};var _0x448893=_[_0x97ed('0x2c')](db['MailTransferReport'][_0x97ed('0x2d')],function(_0x4e8885){return{'name':_0x4e8885[_0x97ed('0x2e')],'type':_0x4e8885[_0x97ed('0x2f')]['key']};});_0x194367[_0x97ed('0x30')]=_[_0x97ed('0x2c')](_0x448893,_0x97ed('0x2a'));_0x194367[_0x97ed('0x31')]=_[_0x97ed('0x32')](_0x5ae171[_0x97ed('0x31')]);_0x194367[_0x97ed('0x33')]=_['intersection'](_0x194367[_0x97ed('0x30')],_0x194367[_0x97ed('0x31')]);_0x37ef66['attributes']=_[_0x97ed('0x34')](_0x194367[_0x97ed('0x30')],qs[_0x97ed('0x35')](_0x5ae171[_0x97ed('0x31')][_0x97ed('0x35')]));_0x37ef66[_0x97ed('0x36')]=_0x37ef66[_0x97ed('0x36')]['length']?_0x37ef66[_0x97ed('0x36')]:_0x194367[_0x97ed('0x30')];if(!_0x5ae171[_0x97ed('0x31')]['hasOwnProperty']('nolimit')){_0x37ef66['limit']=qs[_0x97ed('0x1e')](_0x5ae171[_0x97ed('0x31')]['limit']);_0x37ef66[_0x97ed('0x1c')]=qs['offset'](_0x5ae171[_0x97ed('0x31')][_0x97ed('0x1c')]);}_0x37ef66[_0x97ed('0x37')]=qs[_0x97ed('0x38')](_0x5ae171[_0x97ed('0x31')][_0x97ed('0x38')]);_0x37ef66[_0x97ed('0x39')]=qs[_0x97ed('0x33')](_[_0x97ed('0x3a')](_0x5ae171[_0x97ed('0x31')],_0x194367['filters']),_0x448893);if(_0x5ae171['query'][_0x97ed('0x3b')]){_0x37ef66[_0x97ed('0x39')]=_[_0x97ed('0x3c')](_0x37ef66[_0x97ed('0x39')],{'$or':_['map'](_0x448893,function(_0x5cff76){if(_0x5cff76[_0x97ed('0x2f')]!==_0x97ed('0x3d')){var _0x2202c4={};_0x2202c4[_0x5cff76['name']]={'$like':'%'+_0x5ae171['query'][_0x97ed('0x3b')]+'%'};return _0x2202c4;}})});}_0x37ef66=_[_0x97ed('0x3c')]({},_0x37ef66,_0x5ae171[_0x97ed('0x3e')]);var _0x114469={'where':_0x37ef66[_0x97ed('0x39')]};return db[_0x97ed('0x3f')][_0x97ed('0x40')](_0x114469)[_0x97ed('0x26')](function(_0x38be99){_0x10d431[_0x97ed('0x40')]=_0x38be99;if(_0x5ae171[_0x97ed('0x31')]['includeAll']){_0x37ef66[_0x97ed('0x41')]=[{'all':!![]}];}return db[_0x97ed('0x3f')][_0x97ed('0x42')](_0x37ef66);})[_0x97ed('0x26')](function(_0x268dfa){_0x10d431[_0x97ed('0x43')]=_0x268dfa;return _0x10d431;})['then'](respondWithFilteredResult(_0x569835,_0x37ef66))[_0x97ed('0x44')](handleError(_0x569835,null));};exports[_0x97ed('0x45')]=function(_0x5bc26a,_0x976af8){var _0x4f84c3={'raw':!![],'where':{'id':_0x5bc26a[_0x97ed('0x46')]['id']}},_0x7b9bd0={};_0x7b9bd0[_0x97ed('0x30')]=_[_0x97ed('0x32')](db[_0x97ed('0x3f')][_0x97ed('0x2d')]);_0x7b9bd0[_0x97ed('0x31')]=_[_0x97ed('0x32')](_0x5bc26a['query']);_0x7b9bd0[_0x97ed('0x33')]=_[_0x97ed('0x34')](_0x7b9bd0[_0x97ed('0x30')],_0x7b9bd0[_0x97ed('0x31')]);_0x4f84c3[_0x97ed('0x36')]=_['intersection'](_0x7b9bd0['model'],qs[_0x97ed('0x35')](_0x5bc26a[_0x97ed('0x31')][_0x97ed('0x35')]));_0x4f84c3[_0x97ed('0x36')]=_0x4f84c3[_0x97ed('0x36')][_0x97ed('0x47')]?_0x4f84c3[_0x97ed('0x36')]:_0x7b9bd0[_0x97ed('0x30')];if(_0x5bc26a['query'][_0x97ed('0x48')]){_0x4f84c3[_0x97ed('0x41')]=[{'all':!![]}];}_0x4f84c3=_[_0x97ed('0x3c')]({},_0x4f84c3,_0x5bc26a['options']);return db[_0x97ed('0x3f')][_0x97ed('0x49')](_0x4f84c3)['then'](handleEntityNotFound(_0x976af8,null))[_0x97ed('0x26')](respondWithResult(_0x976af8,null))[_0x97ed('0x44')](handleError(_0x976af8,null));};exports[_0x97ed('0x4a')]=function(_0x4beb77,_0x287462){return db['MailTransferReport']['create'](_0x4beb77[_0x97ed('0x4b')],{})['then'](respondWithResult(_0x287462,0xc9))[_0x97ed('0x44')](handleError(_0x287462,null));};exports[_0x97ed('0x25')]=function(_0x191dcb,_0x3e1f57){if(_0x191dcb[_0x97ed('0x4b')]['id']){delete _0x191dcb['body']['id'];}return db[_0x97ed('0x3f')][_0x97ed('0x49')]({'where':{'id':_0x191dcb[_0x97ed('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e1f57,null))['then'](saveUpdates(_0x191dcb['body'],null))[_0x97ed('0x26')](respondWithResult(_0x3e1f57,null))[_0x97ed('0x44')](handleError(_0x3e1f57,null));};exports[_0x97ed('0x27')]=function(_0xe92ea8,_0x54a93c){return db[_0x97ed('0x3f')][_0x97ed('0x49')]({'where':{'id':_0xe92ea8[_0x97ed('0x46')]['id']}})['then'](handleEntityNotFound(_0x54a93c,null))[_0x97ed('0x26')](removeEntity(_0x54a93c,null))[_0x97ed('0x44')](handleError(_0x54a93c,null));};exports[_0x97ed('0x4c')]=function(_0x485b83,_0x71d48e){return db[_0x97ed('0x3f')][_0x97ed('0x4c')]()[_0x97ed('0x26')](respondWithResult(_0x71d48e,null))[_0x97ed('0x44')](handleError(_0x71d48e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 6551ba4..e743578 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 _0x4a06=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x107132,_0x13f848){var _0xeb25b1=function(_0xfe9356){while(--_0xfe9356){_0x107132['push'](_0x107132['shift']());}};_0xeb25b1(++_0x13f848);}(_0x4a06,0x1f2));var _0x64a0=function(_0xc18197,_0x372a47){_0xc18197=_0xc18197-0x0;var _0x5d1917=_0x4a06[_0xc18197];return _0x5d1917;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var logger=require(_0x64a0('0x2'))(_0x64a0('0x3'));var moment=require(_0x64a0('0x4'));var BPromise=require(_0x64a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a0('0x6'));var rimraf=require(_0x64a0('0x7'));var config=require(_0x64a0('0x8'));var attributes=require(_0x64a0('0x9'));module[_0x64a0('0xa')]=function(_0xba1d8f,_0x37464e){return _0xba1d8f[_0x64a0('0xb')](_0x64a0('0xc'),attributes,{'tableName':_0x64a0('0xd'),'paranoid':![],'indexes':[{'name':_0x64a0('0xe'),'fields':[_0x64a0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaab2=['rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xaab2,0xca));var _0x2aab=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xaab2[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x2aab('0x0'));var logger=require(_0x2aab('0x1'))(_0x2aab('0x2'));var moment=require('moment');var BPromise=require(_0x2aab('0x3'));var rp=require(_0x2aab('0x4'));var fs=require('fs');var path=require(_0x2aab('0x5'));var rimraf=require(_0x2aab('0x6'));var config=require(_0x2aab('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x2aab('0x8')]=function(_0x5b35ec,_0x3af395){return _0x5b35ec[_0x2aab('0x9')](_0x2aab('0xa'),attributes,{'tableName':_0x2aab('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2aab('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 d703d2f..4b60080 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 _0x54cc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xf6ad60,_0x27e422){var _0x430850=function(_0x2cc438){while(--_0x2cc438){_0xf6ad60['push'](_0xf6ad60['shift']());}};_0x430850(++_0x27e422);}(_0x54cc,0xa0));var _0xc54c=function(_0x31e321,_0x5c15f0){_0x31e321=_0x31e321-0x0;var _0x1e3d47=_0x54cc[_0x31e321];return _0x1e3d47;};'use strict';var _=require(_0xc54c('0x0'));var util=require('util');var moment=require(_0xc54c('0x1'));var BPromise=require(_0xc54c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc54c('0x3'));var db=require(_0xc54c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc54c('0x5'))(_0xc54c('0x6'));var config=require(_0xc54c('0x7'));var jayson=require(_0xc54c('0x8'));var client=jayson[_0xc54c('0x9')][_0xc54c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6dca6c,_0x1b06d8,_0x370893){return new BPromise(function(_0x2b3e0e,_0x108651){return client['request'](_0x6dca6c,_0x370893)[_0xc54c('0xb')](function(_0x1f9a3d){logger[_0xc54c('0xc')](_0xc54c('0xd'),_0x1b06d8,_0xc54c('0xe'));logger[_0xc54c('0xf')](_0xc54c('0x10'),_0x1b06d8,_0xc54c('0xe'),JSON[_0xc54c('0x11')](_0x1f9a3d));if(_0x1f9a3d[_0xc54c('0x12')]){if(_0x1f9a3d[_0xc54c('0x12')][_0xc54c('0x13')]===0x1f4){logger['error'](_0xc54c('0xd'),_0x1b06d8,_0x1f9a3d['error'][_0xc54c('0x14')]);return _0x108651(_0x1f9a3d['error'][_0xc54c('0x14')]);}logger[_0xc54c('0x12')](_0xc54c('0xd'),_0x1b06d8,_0x1f9a3d[_0xc54c('0x12')][_0xc54c('0x14')]);return _0x2b3e0e(_0x1f9a3d[_0xc54c('0x12')]['message']);}else{logger[_0xc54c('0xc')](_0xc54c('0xd'),_0x1b06d8,_0xc54c('0xe'));_0x2b3e0e(_0x1f9a3d[_0xc54c('0x15')][_0xc54c('0x14')]);}})[_0xc54c('0x16')](function(_0x8e4f10){logger['error'](_0xc54c('0xd'),_0x1b06d8,_0x8e4f10);_0x108651(_0x8e4f10);});});} \ No newline at end of file +var _0x50b9=['rpc','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ec9b9,_0x3ee75d){var _0x2850d7=function(_0x1a1ff4){while(--_0x1a1ff4){_0x5ec9b9['push'](_0x5ec9b9['shift']());}};_0x2850d7(++_0x3ee75d);}(_0x50b9,0x19e));var _0x950b=function(_0x45cd35,_0x41147c){_0x45cd35=_0x45cd35-0x0;var _0x16db84=_0x50b9[_0x45cd35];return _0x16db84;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x950b('0x0'));var BPromise=require('bluebird');var rs=require(_0x950b('0x1'));var fs=require('fs');var Redis=require(_0x950b('0x2'));var db=require(_0x950b('0x3'))['db'];var utils=require(_0x950b('0x4'));var logger=require(_0x950b('0x5'))(_0x950b('0x6'));var config=require('../../config/environment');var jayson=require(_0x950b('0x7'));var client=jayson[_0x950b('0x8')][_0x950b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x158f44,_0x98c417,_0x2c0d2d){return new BPromise(function(_0x211241,_0x2fe808){return client[_0x950b('0xa')](_0x158f44,_0x2c0d2d)['then'](function(_0x4f1d10){logger[_0x950b('0xb')](_0x950b('0xc'),_0x98c417,_0x950b('0xd'));logger[_0x950b('0xe')](_0x950b('0xf'),_0x98c417,_0x950b('0xd'),JSON[_0x950b('0x10')](_0x4f1d10));if(_0x4f1d10['error']){if(_0x4f1d10['error'][_0x950b('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x98c417,_0x4f1d10[_0x950b('0x12')][_0x950b('0x13')]);return _0x2fe808(_0x4f1d10[_0x950b('0x12')][_0x950b('0x13')]);}logger[_0x950b('0x12')](_0x950b('0xc'),_0x98c417,_0x4f1d10[_0x950b('0x12')][_0x950b('0x13')]);return _0x211241(_0x4f1d10[_0x950b('0x12')][_0x950b('0x13')]);}else{logger[_0x950b('0xb')](_0x950b('0xc'),_0x98c417,_0x950b('0xd'));_0x211241(_0x4f1d10['result'][_0x950b('0x13')]);}})['catch'](function(_0x399af5){logger[_0x950b('0x12')](_0x950b('0xc'),_0x98c417,_0x399af5);_0x2fe808(_0x399af5);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 8b68ced..3d61e5d 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 _0x7e68=['put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7e68,0x11c));var _0x87e6=function(_0x1adaac,_0x1fb30b){_0x1adaac=_0x1adaac-0x0;var _0x423bad=_0x7e68[_0x1adaac];return _0x423bad;};'use strict';var multer=require(_0x87e6('0x0'));var util=require(_0x87e6('0x1'));var path=require(_0x87e6('0x2'));var timeout=require(_0x87e6('0x3'));var express=require('express');var router=express[_0x87e6('0x4')]();var fs_extra=require(_0x87e6('0x5'));var auth=require(_0x87e6('0x6'));var interaction=require(_0x87e6('0x7'));var config=require('../../config/environment');var controller=require(_0x87e6('0x8'));router[_0x87e6('0x9')]('/',auth[_0x87e6('0xa')](),controller['index']);router[_0x87e6('0x9')](_0x87e6('0xb'),auth[_0x87e6('0xa')](),controller[_0x87e6('0xc')]);router[_0x87e6('0x9')](_0x87e6('0xd'),auth[_0x87e6('0xa')](),controller[_0x87e6('0xe')]);router[_0x87e6('0xf')]('/',auth[_0x87e6('0xa')](),controller['create']);router[_0x87e6('0x10')](_0x87e6('0xd'),auth['isAuthenticated'](),controller[_0x87e6('0x11')]);router[_0x87e6('0x12')](_0x87e6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x87e6('0x13')]=router; \ No newline at end of file +var _0xc142=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0xc142,0x110));var _0x2c14=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xc142[_0x31b5b2];return _0x364f13;};'use strict';var multer=require(_0x2c14('0x0'));var util=require(_0x2c14('0x1'));var path=require(_0x2c14('0x2'));var timeout=require(_0x2c14('0x3'));var express=require('express');var router=express[_0x2c14('0x4')]();var fs_extra=require(_0x2c14('0x5'));var auth=require(_0x2c14('0x6'));var interaction=require(_0x2c14('0x7'));var config=require(_0x2c14('0x8'));var controller=require('./memberReport.controller');router[_0x2c14('0x9')]('/',auth['isAuthenticated'](),controller[_0x2c14('0xa')]);router[_0x2c14('0x9')]('/describe',auth[_0x2c14('0xb')](),controller['describe']);router['get'](_0x2c14('0xc'),auth[_0x2c14('0xb')](),controller[_0x2c14('0xd')]);router[_0x2c14('0xe')]('/',auth[_0x2c14('0xb')](),controller[_0x2c14('0xf')]);router[_0x2c14('0x10')](_0x2c14('0xc'),auth[_0x2c14('0xb')](),controller[_0x2c14('0x11')]);router[_0x2c14('0x12')](_0x2c14('0xc'),auth['isAuthenticated'](),controller[_0x2c14('0x13')]);module[_0x2c14('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 3b628bb..627e59e 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 _0x0fec=['diff','seconds','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE'];(function(_0x8be777,_0x2f69f7){var _0x5f470a=function(_0x264a8b){while(--_0x264a8b){_0x8be777['push'](_0x8be777['shift']());}};_0x5f470a(++_0x2f69f7);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x11896b,_0xd83c89){_0x11896b=_0x11896b-0x0;var _0xd5a624=_0x0fec[_0x11896b];return _0xd5a624;};'use strict';var Sequelize=require(_0xc0fe('0x0'));var moment=require(_0xc0fe('0x1'));module[_0xc0fe('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc0fe('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc0fe('0x4'),'comment':_0xc0fe('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xc0fe('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3fce36){var _0x1073f0=moment(_0x3fce36);var _0x4cc359=moment(this['getDataValue']('enterAt'));var _0x326ab7=_0x1073f0[_0xc0fe('0x7')](_0x4cc359,_0xc0fe('0x8'));this['setDataValue']('exitAt',_0x3fce36);this['setDataValue'](_0xc0fe('0x9'),_0x326ab7||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xc0fe('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0xc0fe('0xb')},'data3':{'type':Sequelize[_0xc0fe('0x3')],'comment':_0xc0fe('0xc')},'data4':{'type':Sequelize[_0xc0fe('0x3')],'comment':_0xc0fe('0xd')},'data5':{'type':Sequelize[_0xc0fe('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xc0fe('0x3')]},'internal':{'type':Sequelize[_0xc0fe('0xe')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x257e=['moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x266ad3,_0x5ac8b0){var _0x481c3f=function(_0xe33f4f){while(--_0xe33f4f){_0x266ad3['push'](_0x266ad3['shift']());}};_0x481c3f(++_0x5ac8b0);}(_0x257e,0x1dc));var _0xe257=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x257e[_0x170772];return _0x3ef69c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe257('0x0'));module[_0xe257('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe257('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe257('0x2')],'defaultValue':_0xe257('0x3'),'comment':_0xe257('0x4')},'duration':{'type':Sequelize[_0xe257('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe257('0x6')],'set':function(_0x2a01fe){var _0x5dcd04=moment(_0x2a01fe);var _0x278e88=moment(this[_0xe257('0x7')](_0xe257('0x8')));var _0x558a9e=_0x5dcd04[_0xe257('0x9')](_0x278e88,_0xe257('0xa'));this[_0xe257('0xb')](_0xe257('0xc'),_0x2a01fe);this[_0xe257('0xb')]('duration',_0x558a9e||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xe257('0xd')},'data2':{'type':Sequelize[_0xe257('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xe257('0x2')],'comment':_0xe257('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0xe257('0xf')},'data5':{'type':Sequelize[_0xe257('0x2')],'comment':_0xe257('0x10')},'role':{'type':Sequelize[_0xe257('0x2')]},'internal':{'type':Sequelize[_0xe257('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 0342f18..23c0fd1 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4990f2,_0x592c9d){var _0x13aeec=function(_0x597de6){while(--_0x597de6){_0x4990f2['push'](_0x4990f2['shift']());}};_0x13aeec(++_0x592c9d);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +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(_0x2af036,_0x513c90){var _0x1cc2fa=function(_0x36e0a8){while(--_0x36e0a8){_0x2af036['push'](_0x2af036['shift']());}};_0x1cc2fa(++_0x513c90);}(_0x3e74,0x175));var _0x43e7=function(_0x1a205e,_0x1f2b3e){_0x1a205e=_0x1a205e-0x0;var _0x5c20c=_0x3e74[_0x1a205e];return _0x5c20c;};'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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 339169d..d113dc7 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 _0x5b20=['./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5b20,0x86));var _0x05b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5b20[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require(_0x05b2('0x5'));var rp=require(_0x05b2('0x6'));var fs=require('fs');var path=require(_0x05b2('0x7'));var rimraf=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var attributes=require(_0x05b2('0xa'));module['exports']=function(_0x22e0e2,_0x83fd18){return _0x22e0e2['define'](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'paranoid':![],'indexes':[{'name':_0x05b2('0xd'),'fields':[_0x05b2('0xe'),_0x05b2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a25=['MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define'];(function(_0x5ec7e2,_0x5b67df){var _0x506515=function(_0xfe6f22){while(--_0xfe6f22){_0x5ec7e2['push'](_0x5ec7e2['shift']());}};_0x506515(++_0x5b67df);}(_0x3a25,0x1f3));var _0x53a2=function(_0x29eeed,_0x4269cf){_0x29eeed=_0x29eeed-0x0;var _0x3350b2=_0x3a25[_0x29eeed];return _0x3350b2;};'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('bluebird');var rp=require(_0x53a2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53a2('0x6'));var config=require(_0x53a2('0x7'));var attributes=require(_0x53a2('0x8'));module[_0x53a2('0x9')]=function(_0x4f4da8,_0x5da79f){return _0x4f4da8[_0x53a2('0xa')](_0x53a2('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x53a2('0xc'),'fields':[_0x53a2('0xd'),_0x53a2('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 21722a8..1ae1bb3 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 _0x374c=['request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MemberReport,\x20%s,\x20%s','result','catch','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','then','debug','create','raw','CreateMemberReport','UpdateMemberReport','MemberReport','update','body','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x374c,0x1e3));var _0xc374=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x374c[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0xc374('0x0'));var moment=require(_0xc374('0x1'));var BPromise=require(_0xc374('0x2'));var rs=require(_0xc374('0x3'));var fs=require('fs');var Redis=require(_0xc374('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc374('0x5'));var logger=require('../../config/logger')(_0xc374('0x6'));var config=require(_0xc374('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc374('0x8')][_0xc374('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x264e9a,_0x229105,_0x43cae8){return new BPromise(function(_0x4fc640,_0x33acc1){return client['request'](_0x264e9a,_0x43cae8)['then'](function(_0x1c85eb){logger[_0xc374('0xa')]('MemberReport,\x20%s,\x20%s',_0x229105,_0xc374('0xb'));logger['debug'](_0xc374('0xc'),_0x229105,_0xc374('0xb'),JSON[_0xc374('0xd')](_0x1c85eb));if(_0x1c85eb['error']){if(_0x1c85eb[_0xc374('0xe')][_0xc374('0xf')]===0x1f4){logger[_0xc374('0xe')]('MemberReport,\x20%s,\x20%s',_0x229105,_0x1c85eb[_0xc374('0xe')][_0xc374('0x10')]);return _0x33acc1(_0x1c85eb[_0xc374('0xe')]['message']);}logger[_0xc374('0xe')]('MemberReport,\x20%s,\x20%s',_0x229105,_0x1c85eb[_0xc374('0xe')][_0xc374('0x10')]);return _0x4fc640(_0x1c85eb['error'][_0xc374('0x10')]);}else{logger[_0xc374('0xa')](_0xc374('0x11'),_0x229105,_0xc374('0xb'));_0x4fc640(_0x1c85eb[_0xc374('0x12')][_0xc374('0x10')]);}})[_0xc374('0x13')](function(_0x116d76){logger[_0xc374('0xe')](_0xc374('0x11'),_0x229105,_0x116d76);_0x33acc1(_0x116d76);});});}exports[_0xc374('0x14')]=function(_0x5957c5){var _0x57c828=this;return new Promise(function(_0x3553bb,_0x2feee7){return db['MemberReport'][_0xc374('0x15')]({'raw':_0x5957c5[_0xc374('0x16')]?_0x5957c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5957c5[_0xc374('0x16')]?_0x5957c5[_0xc374('0x16')][_0xc374('0x17')]||null:null,'attributes':_0x5957c5[_0xc374('0x16')]?_0x5957c5['options'][_0xc374('0x18')]||null:null,'limit':_0x5957c5[_0xc374('0x16')]?_0x5957c5[_0xc374('0x16')][_0xc374('0x19')]||null:null,'include':_0x5957c5[_0xc374('0x16')]?_0x5957c5[_0xc374('0x16')][_0xc374('0x1a')]?_[_0xc374('0x1b')](_0x5957c5[_0xc374('0x16')][_0xc374('0x1a')],function(_0x4110a5){return{'model':db[_0x4110a5['model']],'as':_0x4110a5['as'],'attributes':_0x4110a5[_0xc374('0x18')],'include':_0x4110a5[_0xc374('0x1a')]?_[_0xc374('0x1b')](_0x4110a5['include'],function(_0x460fe1){return{'model':db[_0x460fe1[_0xc374('0x1c')]],'as':_0x460fe1['as'],'attributes':_0x460fe1[_0xc374('0x18')],'include':_0x460fe1[_0xc374('0x1a')]?_['map'](_0x460fe1['include'],function(_0x4ad849){return{'model':db[_0x4ad849[_0xc374('0x1c')]],'as':_0x4ad849['as'],'attributes':_0x4ad849[_0xc374('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc374('0x1d')](function(_0x5530a3){logger[_0xc374('0xa')]('GetMemberReport',_0x5957c5);logger[_0xc374('0x1e')](_0xc374('0x14'),_0x5957c5,JSON[_0xc374('0xd')](_0x5530a3));_0x3553bb(_0x5530a3);})[_0xc374('0x13')](function(_0x2a87f2){logger[_0xc374('0xe')](_0xc374('0x14'),_0x2a87f2[_0xc374('0x10')],_0x5957c5);_0x2feee7(_0x57c828['error'](0x1f4,_0x2a87f2[_0xc374('0x10')]));});});};exports['CreateMemberReport']=function(_0x10736e){var _0x27abe6=this;return new Promise(function(_0x33327a,_0x1dcdaa){return db['MemberReport'][_0xc374('0x1f')](_0x10736e['body'],{'raw':_0x10736e[_0xc374('0x16')]?_0x10736e[_0xc374('0x16')][_0xc374('0x20')]===undefined?!![]:![]:!![]})[_0xc374('0x1d')](function(_0x14e8e9){logger[_0xc374('0xa')](_0xc374('0x21'),_0x10736e);logger[_0xc374('0x1e')](_0xc374('0x21'),_0x10736e,JSON[_0xc374('0xd')](_0x14e8e9));_0x33327a(_0x14e8e9);})[_0xc374('0x13')](function(_0x2076ec){logger['error'](_0xc374('0x21'),_0x2076ec['message'],_0x10736e);_0x1dcdaa(_0x27abe6[_0xc374('0xe')](0x1f4,_0x2076ec[_0xc374('0x10')]));});});};exports[_0xc374('0x22')]=function(_0x531295){var _0xefa3bf=this;return new Promise(function(_0x1d44a9,_0x5d5da7){return db[_0xc374('0x23')][_0xc374('0x24')](_0x531295[_0xc374('0x25')],{'raw':_0x531295[_0xc374('0x16')]?_0x531295[_0xc374('0x16')][_0xc374('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531295[_0xc374('0x16')]?_0x531295['options']['where']||null:null,'attributes':_0x531295['options']?_0x531295[_0xc374('0x16')][_0xc374('0x18')]||null:null,'limit':_0x531295[_0xc374('0x16')]?_0x531295[_0xc374('0x16')]['limit']||null:null})[_0xc374('0x1d')](function(_0x1595b2){logger[_0xc374('0xa')](_0xc374('0x22'),_0x531295);logger['debug']('UpdateMemberReport',_0x531295,JSON['stringify'](_0x1595b2));_0x1d44a9(_0x1595b2);})[_0xc374('0x13')](function(_0x295ec4){logger['error'](_0xc374('0x22'),_0x295ec4[_0xc374('0x10')],_0x531295);_0x5d5da7(_0xefa3bf['error'](0x1f4,_0x295ec4[_0xc374('0x10')]));});});}; \ No newline at end of file +var _0x7412=['UpdateMemberReport','lodash','bluebird','ioredis','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','map','model','CreateMemberReport','create','then','update','body'];(function(_0x2f6b28,_0x3dac49){var _0x454270=function(_0x3a21aa){while(--_0x3a21aa){_0x2f6b28['push'](_0x2f6b28['shift']());}};_0x454270(++_0x3dac49);}(_0x7412,0x161));var _0x2741=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x7412[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x2741('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2741('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2741('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2741('0x3')][_0x2741('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x415623,_0x500ac0,_0x1f1f0d){return new BPromise(function(_0x1f1451,_0x3883ec){return client[_0x2741('0x5')](_0x415623,_0x1f1f0d)['then'](function(_0x35923c){logger[_0x2741('0x6')](_0x2741('0x7'),_0x500ac0,_0x2741('0x8'));logger[_0x2741('0x9')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x500ac0,_0x2741('0x8'),JSON[_0x2741('0xa')](_0x35923c));if(_0x35923c[_0x2741('0xb')]){if(_0x35923c[_0x2741('0xb')][_0x2741('0xc')]===0x1f4){logger[_0x2741('0xb')](_0x2741('0x7'),_0x500ac0,_0x35923c[_0x2741('0xb')]['message']);return _0x3883ec(_0x35923c[_0x2741('0xb')][_0x2741('0xd')]);}logger[_0x2741('0xb')](_0x2741('0x7'),_0x500ac0,_0x35923c[_0x2741('0xb')][_0x2741('0xd')]);return _0x1f1451(_0x35923c[_0x2741('0xb')][_0x2741('0xd')]);}else{logger[_0x2741('0x6')]('MemberReport,\x20%s,\x20%s',_0x500ac0,_0x2741('0x8'));_0x1f1451(_0x35923c[_0x2741('0xe')]['message']);}})[_0x2741('0xf')](function(_0x4537c5){logger['error']('MemberReport,\x20%s,\x20%s',_0x500ac0,_0x4537c5);_0x3883ec(_0x4537c5);});});}exports[_0x2741('0x10')]=function(_0x8fb51f){var _0x14cfa8=this;return new Promise(function(_0x27feb7,_0x32cddc){return db[_0x2741('0x11')][_0x2741('0x12')]({'raw':_0x8fb51f[_0x2741('0x13')]?_0x8fb51f['options'][_0x2741('0x14')]===undefined?!![]:![]:!![],'where':_0x8fb51f['options']?_0x8fb51f[_0x2741('0x13')]['where']||null:null,'attributes':_0x8fb51f['options']?_0x8fb51f[_0x2741('0x13')][_0x2741('0x15')]||null:null,'limit':_0x8fb51f[_0x2741('0x13')]?_0x8fb51f['options'][_0x2741('0x16')]||null:null,'include':_0x8fb51f[_0x2741('0x13')]?_0x8fb51f[_0x2741('0x13')][_0x2741('0x17')]?_['map'](_0x8fb51f[_0x2741('0x13')][_0x2741('0x17')],function(_0x5e54fb){return{'model':db[_0x5e54fb['model']],'as':_0x5e54fb['as'],'attributes':_0x5e54fb[_0x2741('0x15')],'include':_0x5e54fb['include']?_['map'](_0x5e54fb[_0x2741('0x17')],function(_0x4d09c9){return{'model':db[_0x4d09c9['model']],'as':_0x4d09c9['as'],'attributes':_0x4d09c9[_0x2741('0x15')],'include':_0x4d09c9[_0x2741('0x17')]?_[_0x2741('0x18')](_0x4d09c9[_0x2741('0x17')],function(_0x53aab8){return{'model':db[_0x53aab8[_0x2741('0x19')]],'as':_0x53aab8['as'],'attributes':_0x53aab8[_0x2741('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x355327){logger[_0x2741('0x6')]('GetMemberReport',_0x8fb51f);logger[_0x2741('0x9')]('GetMemberReport',_0x8fb51f,JSON[_0x2741('0xa')](_0x355327));_0x27feb7(_0x355327);})['catch'](function(_0x1440e5){logger['error'](_0x2741('0x10'),_0x1440e5[_0x2741('0xd')],_0x8fb51f);_0x32cddc(_0x14cfa8[_0x2741('0xb')](0x1f4,_0x1440e5[_0x2741('0xd')]));});});};exports[_0x2741('0x1a')]=function(_0x29e4c5){var _0x3c0283=this;return new Promise(function(_0x43eba7,_0x2c1b98){return db[_0x2741('0x11')][_0x2741('0x1b')](_0x29e4c5['body'],{'raw':_0x29e4c5[_0x2741('0x13')]?_0x29e4c5[_0x2741('0x13')][_0x2741('0x14')]===undefined?!![]:![]:!![]})[_0x2741('0x1c')](function(_0x13c809){logger[_0x2741('0x6')]('CreateMemberReport',_0x29e4c5);logger[_0x2741('0x9')]('CreateMemberReport',_0x29e4c5,JSON['stringify'](_0x13c809));_0x43eba7(_0x13c809);})[_0x2741('0xf')](function(_0x4c48e6){logger[_0x2741('0xb')](_0x2741('0x1a'),_0x4c48e6[_0x2741('0xd')],_0x29e4c5);_0x2c1b98(_0x3c0283['error'](0x1f4,_0x4c48e6[_0x2741('0xd')]));});});};exports['UpdateMemberReport']=function(_0x222dbc){var _0x4530ca=this;return new Promise(function(_0x3795e3,_0x489e11){return db['MemberReport'][_0x2741('0x1d')](_0x222dbc[_0x2741('0x1e')],{'raw':_0x222dbc[_0x2741('0x13')]?_0x222dbc[_0x2741('0x13')][_0x2741('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222dbc['options']?_0x222dbc[_0x2741('0x13')]['where']||null:null,'attributes':_0x222dbc[_0x2741('0x13')]?_0x222dbc[_0x2741('0x13')][_0x2741('0x15')]||null:null,'limit':_0x222dbc[_0x2741('0x13')]?_0x222dbc['options'][_0x2741('0x16')]||null:null})[_0x2741('0x1c')](function(_0x2cf5a0){logger[_0x2741('0x6')](_0x2741('0x1f'),_0x222dbc);logger['debug'](_0x2741('0x1f'),_0x222dbc,JSON[_0x2741('0xa')](_0x2cf5a0));_0x3795e3(_0x2cf5a0);})[_0x2741('0xf')](function(_0x2abf1d){logger['error'](_0x2741('0x1f'),_0x2abf1d[_0x2741('0xd')],_0x222dbc);_0x489e11(_0x4530ca[_0x2741('0xb')](0x1f4,_0x2abf1d[_0x2741('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d9a539c..a12a732 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 _0x61de=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x464a1a,_0x1f5497){var _0x28bc61=function(_0x2d2480){while(--_0x2d2480){_0x464a1a['push'](_0x464a1a['shift']());}};_0x28bc61(++_0x1f5497);}(_0x61de,0x18c));var _0xe61d=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x61de[_0x1a36a5];return _0x746243;};'use strict';var multer=require(_0xe61d('0x0'));var util=require(_0xe61d('0x1'));var path=require(_0xe61d('0x2'));var timeout=require(_0xe61d('0x3'));var express=require(_0xe61d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe61d('0x5'));var interaction=require(_0xe61d('0x6'));var config=require(_0xe61d('0x7'));var controller=require(_0xe61d('0x8'));router[_0xe61d('0x9')]('/',controller[_0xe61d('0xa')]);module[_0xe61d('0xb')]=router; \ No newline at end of file +var _0xe080=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path'];(function(_0x11700d,_0x127081){var _0x21ba1d=function(_0x23df19){while(--_0x23df19){_0x11700d['push'](_0x11700d['shift']());}};_0x21ba1d(++_0x127081);}(_0xe080,0x141));var _0x0e08=function(_0x1e79ba,_0x5276f5){_0x1e79ba=_0x1e79ba-0x0;var _0x562a66=_0xe080[_0x1e79ba];return _0x562a66;};'use strict';var multer=require(_0x0e08('0x0'));var util=require(_0x0e08('0x1'));var path=require(_0x0e08('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e08('0x3'));var router=express[_0x0e08('0x4')]();var fs_extra=require(_0x0e08('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e08('0x6'));var config=require(_0x0e08('0x7'));var controller=require(_0x0e08('0x8'));router[_0x0e08('0x9')]('/',controller[_0x0e08('0xa')]);module[_0x0e08('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 7e86e4a..ad706a0 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 _0xa672=['exports','version'];(function(_0x5e6a48,_0x3e233c){var _0x365e83=function(_0x3f9cf9){while(--_0x3f9cf9){_0x5e6a48['push'](_0x5e6a48['shift']());}};_0x365e83(++_0x3e233c);}(_0xa672,0x19e));var _0x2a67=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xa672[_0xb24a3e];return _0x4038d7;};'use strict';var Sequelize=require('sequelize');module[_0x2a67('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x2a67('0x1')}}; \ No newline at end of file +var _0x0d22=['version','sequelize','STRING'];(function(_0x3709d9,_0x42d2b6){var _0x181199=function(_0x5d1505){while(--_0x5d1505){_0x3709d9['push'](_0x3709d9['shift']());}};_0x181199(++_0x42d2b6);}(_0x0d22,0x1e4));var _0x20d2=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x0d22[_0x1857d0];return _0x3e3c46;};'use strict';var Sequelize=require(_0x20d2('0x0'));module['exports']={'version':{'type':Sequelize[_0x20d2('0x1')],'unique':_0x20d2('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2e840d6..c5c1654 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 _0xc668=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Migration','include','findAll','catch','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0xc668,0x107));var _0x8c66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc668[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c66('0x0'));var zipdir=require(_0x8c66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c66('0x2'));var BPromise=require(_0x8c66('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c66('0x4'));var sox=require(_0x8c66('0x5'));var csv=require(_0x8c66('0x6'));var ejs=require(_0x8c66('0x7'));var fs=require('fs');var fs_extra=require(_0x8c66('0x8'));var _=require('lodash');var squel=require(_0x8c66('0x9'));var crypto=require(_0x8c66('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8c66('0xb'));var toCsv=require(_0x8c66('0x6'));var querystring=require(_0x8c66('0xc'));var Papa=require(_0x8c66('0xd'));var Redis=require(_0x8c66('0xe'));var authService=require(_0x8c66('0xf'));var qs=require(_0x8c66('0x10'));var as=require(_0x8c66('0x11'));var hardwareService=require(_0x8c66('0x12'));var logger=require(_0x8c66('0x13'))(_0x8c66('0x14'));var utils=require(_0x8c66('0x15'));var config=require(_0x8c66('0x16'));var licenseUtil=require(_0x8c66('0x17'));var db=require(_0x8c66('0x18'))['db'];function respondWithStatusCode(_0x1f62ee,_0x33b4f6){_0x33b4f6=_0x33b4f6||0xcc;return function(_0x380012){if(_0x380012){return _0x1f62ee[_0x8c66('0x19')](_0x33b4f6);}return _0x1f62ee[_0x8c66('0x1a')](_0x33b4f6)['end']();};}function respondWithResult(_0x5d3f53,_0x2206f7){_0x2206f7=_0x2206f7||0xc8;return function(_0x488876){if(_0x488876){return _0x5d3f53[_0x8c66('0x1a')](_0x2206f7)[_0x8c66('0x1b')](_0x488876);}};}function respondWithFilteredResult(_0x557fcd,_0x1bc5ea){return function(_0x5ac509){if(_0x5ac509){var _0x382122=typeof _0x1bc5ea['offset']===_0x8c66('0x1c')&&typeof _0x1bc5ea['limit']===_0x8c66('0x1c');var _0x97f96c=_0x5ac509[_0x8c66('0x1d')];var _0x3c6e1c=_0x382122?0x0:_0x1bc5ea[_0x8c66('0x1e')];var _0x4bbf9f=_0x382122?_0x5ac509[_0x8c66('0x1d')]:_0x1bc5ea[_0x8c66('0x1e')]+_0x1bc5ea[_0x8c66('0x1f')];var _0x56c9b9;if(_0x4bbf9f>=_0x97f96c){_0x4bbf9f=_0x97f96c;_0x56c9b9=0xc8;}else{_0x56c9b9=0xce;}_0x557fcd[_0x8c66('0x1a')](_0x56c9b9);return _0x557fcd[_0x8c66('0x20')](_0x8c66('0x21'),_0x3c6e1c+'-'+_0x4bbf9f+'/'+_0x97f96c)[_0x8c66('0x1b')](_0x5ac509);}return null;};}function patchUpdates(_0x8648db){return function(_0x30b82d){try{jsonpatch['apply'](_0x30b82d,_0x8648db,!![]);}catch(_0x5abce3){return BPromise['reject'](_0x5abce3);}return _0x30b82d['save']();};}function saveUpdates(_0x3b9cd2,_0x5e5f2b){return function(_0x3d548b){if(_0x3d548b){return _0x3d548b[_0x8c66('0x22')](_0x3b9cd2)[_0x8c66('0x23')](function(_0x5c37da){return _0x5c37da;});}return null;};}function removeEntity(_0x4934b6,_0x29cf26){return function(_0xf6157e){if(_0xf6157e){return _0xf6157e['destroy']()[_0x8c66('0x23')](function(){_0x4934b6[_0x8c66('0x1a')](0xcc)[_0x8c66('0x24')]();});}};}function handleEntityNotFound(_0x4747fe,_0x2a56b8){return function(_0x159be8){if(!_0x159be8){_0x4747fe[_0x8c66('0x19')](0x194);}return _0x159be8;};}function handleError(_0x534862,_0x3232bb){_0x3232bb=_0x3232bb||0x1f4;return function(_0x5e9462){logger[_0x8c66('0x25')](_0x5e9462[_0x8c66('0x26')]);if(_0x5e9462[_0x8c66('0x27')]){delete _0x5e9462['name'];}_0x534862[_0x8c66('0x1a')](_0x3232bb)[_0x8c66('0x28')](_0x5e9462);};}exports['index']=function(_0x43e5ac,_0x511ccc){var _0x570a14={},_0xa61bf4={},_0x18e0d0={'count':0x0,'rows':[]};var _0x1a066d=_[_0x8c66('0x29')](db['Migration'][_0x8c66('0x2a')],function(_0x3bcde6){return{'name':_0x3bcde6[_0x8c66('0x2b')],'type':_0x3bcde6[_0x8c66('0x2c')][_0x8c66('0x2d')]};});_0xa61bf4['model']=_[_0x8c66('0x29')](_0x1a066d,_0x8c66('0x27'));_0xa61bf4['query']=_[_0x8c66('0x2e')](_0x43e5ac['query']);_0xa61bf4[_0x8c66('0x2f')]=_[_0x8c66('0x30')](_0xa61bf4[_0x8c66('0x31')],_0xa61bf4[_0x8c66('0x32')]);_0x570a14[_0x8c66('0x33')]=_[_0x8c66('0x30')](_0xa61bf4[_0x8c66('0x31')],qs['fields'](_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x34')]));_0x570a14[_0x8c66('0x33')]=_0x570a14[_0x8c66('0x33')][_0x8c66('0x35')]?_0x570a14[_0x8c66('0x33')]:_0xa61bf4[_0x8c66('0x31')];if(!_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x36')](_0x8c66('0x37'))){_0x570a14[_0x8c66('0x1f')]=qs['limit'](_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x1f')]);_0x570a14[_0x8c66('0x1e')]=qs[_0x8c66('0x1e')](_0x43e5ac['query'][_0x8c66('0x1e')]);}_0x570a14[_0x8c66('0x38')]=qs[_0x8c66('0x39')](_0x43e5ac['query'][_0x8c66('0x39')]);_0x570a14[_0x8c66('0x3a')]=qs[_0x8c66('0x2f')](_[_0x8c66('0x3b')](_0x43e5ac[_0x8c66('0x32')],_0xa61bf4[_0x8c66('0x2f')]),_0x1a066d);if(_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x3c')]){_0x570a14[_0x8c66('0x3a')]=_['merge'](_0x570a14[_0x8c66('0x3a')],{'$or':_[_0x8c66('0x29')](_0x1a066d,function(_0x3b7ee3){if(_0x3b7ee3[_0x8c66('0x2c')]!==_0x8c66('0x3d')){var _0x11e69c={};_0x11e69c[_0x3b7ee3[_0x8c66('0x27')]]={'$like':'%'+_0x43e5ac[_0x8c66('0x32')][_0x8c66('0x3c')]+'%'};return _0x11e69c;}})});}_0x570a14=_[_0x8c66('0x3e')]({},_0x570a14,_0x43e5ac[_0x8c66('0x3f')]);var _0x5ccae8={'where':_0x570a14['where']};return db[_0x8c66('0x40')][_0x8c66('0x1d')](_0x5ccae8)[_0x8c66('0x23')](function(_0x9e299){_0x18e0d0[_0x8c66('0x1d')]=_0x9e299;if(_0x43e5ac['query']['includeAll']){_0x570a14[_0x8c66('0x41')]=[{'all':!![]}];}return db[_0x8c66('0x40')][_0x8c66('0x42')](_0x570a14);})[_0x8c66('0x23')](function(_0xd40151){_0x18e0d0['rows']=_0xd40151;return _0x18e0d0;})[_0x8c66('0x23')](respondWithFilteredResult(_0x511ccc,_0x570a14))[_0x8c66('0x43')](handleError(_0x511ccc,null));}; \ No newline at end of file +var _0x9fe0=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','then','destroy','error','name','send','index','Migration','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','include','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x254e62,_0x7ebec3){var _0x308d5a=function(_0x57354a){while(--_0x57354a){_0x254e62['push'](_0x254e62['shift']());}};_0x308d5a(++_0x7ebec3);}(_0x9fe0,0xee));var _0x09fe=function(_0x59f81e,_0x446c67){_0x59f81e=_0x59f81e-0x0;var _0x3a023c=_0x9fe0[_0x59f81e];return _0x3a023c;};'use strict';var emlformat=require(_0x09fe('0x0'));var rimraf=require(_0x09fe('0x1'));var zipdir=require(_0x09fe('0x2'));var jsonpatch=require(_0x09fe('0x3'));var rp=require(_0x09fe('0x4'));var moment=require(_0x09fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x09fe('0x6'));var util=require(_0x09fe('0x7'));var path=require(_0x09fe('0x8'));var sox=require(_0x09fe('0x9'));var csv=require(_0x09fe('0xa'));var ejs=require(_0x09fe('0xb'));var fs=require('fs');var fs_extra=require(_0x09fe('0xc'));var _=require(_0x09fe('0xd'));var squel=require(_0x09fe('0xe'));var crypto=require(_0x09fe('0xf'));var jsforce=require(_0x09fe('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x09fe('0xa'));var querystring=require('querystring');var Papa=require(_0x09fe('0x11'));var Redis=require('ioredis');var authService=require(_0x09fe('0x12'));var qs=require(_0x09fe('0x13'));var as=require(_0x09fe('0x14'));var hardwareService=require(_0x09fe('0x15'));var logger=require(_0x09fe('0x16'))(_0x09fe('0x17'));var utils=require('../../config/utils');var config=require(_0x09fe('0x18'));var licenseUtil=require(_0x09fe('0x19'));var db=require(_0x09fe('0x1a'))['db'];function respondWithStatusCode(_0x19932c,_0x385eda){_0x385eda=_0x385eda||0xcc;return function(_0x37d964){if(_0x37d964){return _0x19932c[_0x09fe('0x1b')](_0x385eda);}return _0x19932c[_0x09fe('0x1c')](_0x385eda)[_0x09fe('0x1d')]();};}function respondWithResult(_0x1ce11e,_0x3a6d2c){_0x3a6d2c=_0x3a6d2c||0xc8;return function(_0x4c2678){if(_0x4c2678){return _0x1ce11e[_0x09fe('0x1c')](_0x3a6d2c)[_0x09fe('0x1e')](_0x4c2678);}};}function respondWithFilteredResult(_0xe0ba27,_0x6b667){return function(_0x328262){if(_0x328262){var _0x1e2a40=typeof _0x6b667['offset']==='undefined'&&typeof _0x6b667['limit']==='undefined';var _0x1f0793=_0x328262[_0x09fe('0x1f')];var _0x48226c=_0x1e2a40?0x0:_0x6b667[_0x09fe('0x20')];var _0x24d45e=_0x1e2a40?_0x328262['count']:_0x6b667[_0x09fe('0x20')]+_0x6b667[_0x09fe('0x21')];var _0x44200f;if(_0x24d45e>=_0x1f0793){_0x24d45e=_0x1f0793;_0x44200f=0xc8;}else{_0x44200f=0xce;}_0xe0ba27[_0x09fe('0x1c')](_0x44200f);return _0xe0ba27[_0x09fe('0x22')]('Content-Range',_0x48226c+'-'+_0x24d45e+'/'+_0x1f0793)[_0x09fe('0x1e')](_0x328262);}return null;};}function patchUpdates(_0x1cb48e){return function(_0x1e3cbc){try{jsonpatch['apply'](_0x1e3cbc,_0x1cb48e,!![]);}catch(_0x2c0de3){return BPromise['reject'](_0x2c0de3);}return _0x1e3cbc[_0x09fe('0x23')]();};}function saveUpdates(_0x404c5c,_0x2c1c8a){return function(_0x3aec5f){if(_0x3aec5f){return _0x3aec5f['update'](_0x404c5c)[_0x09fe('0x24')](function(_0x384340){return _0x384340;});}return null;};}function removeEntity(_0x3cc8af,_0x18aec6){return function(_0x3b05b2){if(_0x3b05b2){return _0x3b05b2[_0x09fe('0x25')]()[_0x09fe('0x24')](function(){_0x3cc8af['status'](0xcc)[_0x09fe('0x1d')]();});}};}function handleEntityNotFound(_0x4615e5,_0x31d395){return function(_0x167589){if(!_0x167589){_0x4615e5[_0x09fe('0x1b')](0x194);}return _0x167589;};}function handleError(_0x4c1a38,_0x52b93c){_0x52b93c=_0x52b93c||0x1f4;return function(_0x53836a){logger[_0x09fe('0x26')](_0x53836a['stack']);if(_0x53836a[_0x09fe('0x27')]){delete _0x53836a[_0x09fe('0x27')];}_0x4c1a38[_0x09fe('0x1c')](_0x52b93c)[_0x09fe('0x28')](_0x53836a);};}exports[_0x09fe('0x29')]=function(_0x5a300b,_0x5e8926){var _0x2f5977={},_0x5874ca={},_0x2f8b7e={'count':0x0,'rows':[]};var _0x494cf2=_['map'](db[_0x09fe('0x2a')][_0x09fe('0x2b')],function(_0xd01ed5){return{'name':_0xd01ed5[_0x09fe('0x2c')],'type':_0xd01ed5['type'][_0x09fe('0x2d')]};});_0x5874ca['model']=_[_0x09fe('0x2e')](_0x494cf2,_0x09fe('0x27'));_0x5874ca[_0x09fe('0x2f')]=_[_0x09fe('0x30')](_0x5a300b[_0x09fe('0x2f')]);_0x5874ca[_0x09fe('0x31')]=_['intersection'](_0x5874ca[_0x09fe('0x32')],_0x5874ca[_0x09fe('0x2f')]);_0x2f5977[_0x09fe('0x33')]=_[_0x09fe('0x34')](_0x5874ca[_0x09fe('0x32')],qs[_0x09fe('0x35')](_0x5a300b[_0x09fe('0x2f')]['fields']));_0x2f5977[_0x09fe('0x33')]=_0x2f5977['attributes'][_0x09fe('0x36')]?_0x2f5977[_0x09fe('0x33')]:_0x5874ca[_0x09fe('0x32')];if(!_0x5a300b[_0x09fe('0x2f')][_0x09fe('0x37')]('nolimit')){_0x2f5977[_0x09fe('0x21')]=qs[_0x09fe('0x21')](_0x5a300b[_0x09fe('0x2f')][_0x09fe('0x21')]);_0x2f5977[_0x09fe('0x20')]=qs[_0x09fe('0x20')](_0x5a300b['query']['offset']);}_0x2f5977[_0x09fe('0x38')]=qs[_0x09fe('0x39')](_0x5a300b[_0x09fe('0x2f')]['sort']);_0x2f5977['where']=qs[_0x09fe('0x31')](_['pick'](_0x5a300b[_0x09fe('0x2f')],_0x5874ca[_0x09fe('0x31')]),_0x494cf2);if(_0x5a300b[_0x09fe('0x2f')][_0x09fe('0x3a')]){_0x2f5977[_0x09fe('0x3b')]=_[_0x09fe('0x3c')](_0x2f5977['where'],{'$or':_['map'](_0x494cf2,function(_0x4e5d53){if(_0x4e5d53[_0x09fe('0x3d')]!==_0x09fe('0x3e')){var _0x1968cf={};_0x1968cf[_0x4e5d53[_0x09fe('0x27')]]={'$like':'%'+_0x5a300b[_0x09fe('0x2f')][_0x09fe('0x3a')]+'%'};return _0x1968cf;}})});}_0x2f5977=_[_0x09fe('0x3c')]({},_0x2f5977,_0x5a300b[_0x09fe('0x3f')]);var _0x28a6ad={'where':_0x2f5977['where']};return db[_0x09fe('0x2a')][_0x09fe('0x1f')](_0x28a6ad)['then'](function(_0x2fb235){_0x2f8b7e['count']=_0x2fb235;if(_0x5a300b[_0x09fe('0x2f')]['includeAll']){_0x2f5977[_0x09fe('0x40')]=[{'all':!![]}];}return db[_0x09fe('0x2a')]['findAll'](_0x2f5977);})[_0x09fe('0x24')](function(_0x55499f){_0x2f8b7e['rows']=_0x55499f;return _0x2f8b7e;})[_0x09fe('0x24')](respondWithFilteredResult(_0x5e8926,_0x2f5977))['catch'](handleError(_0x5e8926,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index f64b9c7..8f1eaa2 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 _0x5a71=['define','Migration','migrations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x2e55d7,_0x2698a5){var _0x47750f=function(_0xcf96ee){while(--_0xcf96ee){_0x2e55d7['push'](_0x2e55d7['shift']());}};_0x47750f(++_0x2698a5);}(_0x5a71,0x1b3));var _0x15a7=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0x5a71[_0x5933fb];return _0x44d988;};'use strict';var _=require('lodash');var util=require(_0x15a7('0x0'));var logger=require(_0x15a7('0x1'))('api');var moment=require(_0x15a7('0x2'));var BPromise=require(_0x15a7('0x3'));var rp=require(_0x15a7('0x4'));var fs=require('fs');var path=require(_0x15a7('0x5'));var rimraf=require(_0x15a7('0x6'));var config=require(_0x15a7('0x7'));var attributes=require(_0x15a7('0x8'));module['exports']=function(_0x62442c,_0x3482b3){return _0x62442c[_0x15a7('0x9')](_0x15a7('0xa'),attributes,{'tableName':_0x15a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5c6=['define','Migration','migrations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./migration.attributes','exports'];(function(_0x472f1a,_0x1670d5){var _0x3ed84e=function(_0x48fab0){while(--_0x48fab0){_0x472f1a['push'](_0x472f1a['shift']());}};_0x3ed84e(++_0x1670d5);}(_0xd5c6,0xdb));var _0x6d5c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd5c6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x6d5c('0x0'));var util=require('util');var logger=require(_0x6d5c('0x1'))(_0x6d5c('0x2'));var moment=require('moment');var BPromise=require(_0x6d5c('0x3'));var rp=require(_0x6d5c('0x4'));var fs=require('fs');var path=require(_0x6d5c('0x5'));var rimraf=require(_0x6d5c('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d5c('0x7'));module[_0x6d5c('0x8')]=function(_0x23b6f2,_0x26457a){return _0x23b6f2[_0x6d5c('0x9')](_0x6d5c('0xa'),attributes,{'tableName':_0x6d5c('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 750559a..8dfd4d7 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 _0x4977=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x313927,_0x2b3a6d){var _0x545b28=function(_0x1be96e){while(--_0x1be96e){_0x313927['push'](_0x313927['shift']());}};_0x545b28(++_0x2b3a6d);}(_0x4977,0x1cd));var _0x7497=function(_0x4e3610,_0x18cc72){_0x4e3610=_0x4e3610-0x0;var _0x55a9be=_0x4977[_0x4e3610];return _0x55a9be;};'use strict';var _=require(_0x7497('0x0'));var util=require(_0x7497('0x1'));var moment=require(_0x7497('0x2'));var BPromise=require(_0x7497('0x3'));var rs=require(_0x7497('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7497('0x5'))['db'];var utils=require(_0x7497('0x6'));var logger=require(_0x7497('0x7'))(_0x7497('0x8'));var config=require(_0x7497('0x9'));var jayson=require(_0x7497('0xa'));var client=jayson['client'][_0x7497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21d9d5,_0x2cafd5,_0x15c322){return new BPromise(function(_0x180bf8,_0x54da2d){return client[_0x7497('0xc')](_0x21d9d5,_0x15c322)[_0x7497('0xd')](function(_0x5b4f54){logger[_0x7497('0xe')](_0x7497('0xf'),_0x2cafd5,_0x7497('0x10'));logger[_0x7497('0x11')](_0x7497('0x12'),_0x2cafd5,_0x7497('0x10'),JSON[_0x7497('0x13')](_0x5b4f54));if(_0x5b4f54[_0x7497('0x14')]){if(_0x5b4f54['error'][_0x7497('0x15')]===0x1f4){logger[_0x7497('0x14')]('Migration,\x20%s,\x20%s',_0x2cafd5,_0x5b4f54['error'][_0x7497('0x16')]);return _0x54da2d(_0x5b4f54[_0x7497('0x14')][_0x7497('0x16')]);}logger[_0x7497('0x14')](_0x7497('0xf'),_0x2cafd5,_0x5b4f54['error'][_0x7497('0x16')]);return _0x180bf8(_0x5b4f54['error'][_0x7497('0x16')]);}else{logger[_0x7497('0xe')](_0x7497('0xf'),_0x2cafd5,_0x7497('0x10'));_0x180bf8(_0x5b4f54[_0x7497('0x17')]['message']);}})[_0x7497('0x18')](function(_0x460b3e){logger[_0x7497('0x14')](_0x7497('0xf'),_0x2cafd5,_0x460b3e);_0x54da2d(_0x460b3e);});});} \ No newline at end of file +var _0x50c1=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','randomstring'];(function(_0x270efa,_0x54b87a){var _0x4842cd=function(_0xfea874){while(--_0xfea874){_0x270efa['push'](_0x270efa['shift']());}};_0x4842cd(++_0x54b87a);}(_0x50c1,0x1b6));var _0x150c=function(_0x37a329,_0x665181){_0x37a329=_0x37a329-0x0;var _0x5e985c=_0x50c1[_0x37a329];return _0x5e985c;};'use strict';var _=require(_0x150c('0x0'));var util=require('util');var moment=require(_0x150c('0x1'));var BPromise=require('bluebird');var rs=require(_0x150c('0x2'));var fs=require('fs');var Redis=require(_0x150c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x150c('0x4'));var logger=require(_0x150c('0x5'))(_0x150c('0x6'));var config=require(_0x150c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x150c('0x8')][_0x150c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ae5a9,_0x244e96,_0x19abd2){return new BPromise(function(_0x316817,_0x337c30){return client['request'](_0x4ae5a9,_0x19abd2)[_0x150c('0xa')](function(_0x155526){logger[_0x150c('0xb')](_0x150c('0xc'),_0x244e96,_0x150c('0xd'));logger[_0x150c('0xe')](_0x150c('0xf'),_0x244e96,'request\x20sent',JSON[_0x150c('0x10')](_0x155526));if(_0x155526['error']){if(_0x155526['error'][_0x150c('0x11')]===0x1f4){logger[_0x150c('0x12')](_0x150c('0xc'),_0x244e96,_0x155526[_0x150c('0x12')][_0x150c('0x13')]);return _0x337c30(_0x155526[_0x150c('0x12')][_0x150c('0x13')]);}logger[_0x150c('0x12')](_0x150c('0xc'),_0x244e96,_0x155526['error']['message']);return _0x316817(_0x155526['error'][_0x150c('0x13')]);}else{logger[_0x150c('0xb')](_0x150c('0xc'),_0x244e96,_0x150c('0xd'));_0x316817(_0x155526[_0x150c('0x14')][_0x150c('0x13')]);}})['catch'](function(_0x338982){logger[_0x150c('0x12')]('Migration,\x20%s,\x20%s',_0x244e96,_0x338982);_0x337c30(_0x338982);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d4607f8..33f19cd 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 _0x2cc4=['isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./network.controller','get'];(function(_0x51705b,_0x2d33da){var _0x342455=function(_0x12203d){while(--_0x12203d){_0x51705b['push'](_0x51705b['shift']());}};_0x342455(++_0x2d33da);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x2cc4[_0x166e96];return _0x553d73;};'use strict';var multer=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var path=require(_0x42cc('0x2'));var timeout=require(_0x42cc('0x3'));var express=require('express');var router=express[_0x42cc('0x4')]();var fs_extra=require(_0x42cc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x42cc('0x6'));router[_0x42cc('0x7')]('/',auth[_0x42cc('0x8')](),controller[_0x42cc('0x9')]);router[_0x42cc('0x7')]('/:id',auth[_0x42cc('0x8')](),controller[_0x42cc('0xa')]);router[_0x42cc('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x42cc('0xc')](_0x42cc('0xd'),auth[_0x42cc('0x8')](),controller[_0x42cc('0xe')]);router[_0x42cc('0xf')](_0x42cc('0xd'),auth[_0x42cc('0x8')](),controller[_0x42cc('0x10')]);module[_0x42cc('0x11')]=router; \ No newline at end of file +var _0xe1d1=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x2f693f,_0x297105){var _0x34891a=function(_0x33cf33){while(--_0x33cf33){_0x2f693f['push'](_0x2f693f['shift']());}};_0x34891a(++_0x297105);}(_0xe1d1,0x131));var _0x1e1d=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xe1d1[_0x556bb1];return _0x45455f;};'use strict';var multer=require(_0x1e1d('0x0'));var util=require(_0x1e1d('0x1'));var path=require('path');var timeout=require(_0x1e1d('0x2'));var express=require(_0x1e1d('0x3'));var router=express[_0x1e1d('0x4')]();var fs_extra=require(_0x1e1d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e1d('0x6'));var config=require(_0x1e1d('0x7'));var controller=require(_0x1e1d('0x8'));router[_0x1e1d('0x9')]('/',auth[_0x1e1d('0xa')](),controller[_0x1e1d('0xb')]);router['get'](_0x1e1d('0xc'),auth[_0x1e1d('0xa')](),controller[_0x1e1d('0xd')]);router[_0x1e1d('0xe')]('/',auth[_0x1e1d('0xa')](),controller[_0x1e1d('0xf')]);router['put'](_0x1e1d('0xc'),auth[_0x1e1d('0xa')](),controller[_0x1e1d('0x10')]);router[_0x1e1d('0x11')](_0x1e1d('0xc'),auth[_0x1e1d('0xa')](),controller[_0x1e1d('0x12')]);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 4f397fb..543d45b 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 _0xad2b=['turn','STRING','sequelize','exports','ENUM','stun'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xad2b,0xc2));var _0xbad2=function(_0x13d569,_0x357628){_0x13d569=_0x13d569-0x0;var _0x504564=_0xad2b[_0x13d569];return _0x504564;};'use strict';var Sequelize=require(_0xbad2('0x0'));module[_0xbad2('0x1')]={'type':{'type':Sequelize[_0xbad2('0x2')]('localnet','externip',_0xbad2('0x3'),_0xbad2('0x4'))},'value':{'type':Sequelize[_0xbad2('0x5')]},'username':{'type':Sequelize[_0xbad2('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x379d=['sequelize','exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x379d,0xe0));var _0xd379=function(_0x45ba11,_0xc3cfa0){_0x45ba11=_0x45ba11-0x0;var _0x43b07e=_0x379d[_0x45ba11];return _0x43b07e;};'use strict';var Sequelize=require(_0xd379('0x0'));module[_0xd379('0x1')]={'type':{'type':Sequelize[_0xd379('0x2')](_0xd379('0x3'),_0xd379('0x4'),_0xd379('0x5'),_0xd379('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd379('0x7')]},'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 e4b98fc..3a7fd68 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 _0xcb88=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','map','VIRTUAL','merge','options','Network','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','sequelize','transaction','body','type','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','toLowerCase','STUN','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','destroy','eml-format'];(function(_0x192cff,_0x361327){var _0x20d2f6=function(_0x37baf9){while(--_0x37baf9){_0x192cff['push'](_0x192cff['shift']());}};_0x20d2f6(++_0x361327);}(_0xcb88,0x14c));var _0x8cb8=function(_0x11e904,_0x469a24){_0x11e904=_0x11e904-0x0;var _0x380c89=_0xcb88[_0x11e904];return _0x380c89;};'use strict';var emlformat=require(_0x8cb8('0x0'));var rimraf=require(_0x8cb8('0x1'));var zipdir=require(_0x8cb8('0x2'));var jsonpatch=require(_0x8cb8('0x3'));var rp=require(_0x8cb8('0x4'));var moment=require('moment');var BPromise=require(_0x8cb8('0x5'));var Mustache=require(_0x8cb8('0x6'));var util=require(_0x8cb8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8cb8('0x8'));var ejs=require(_0x8cb8('0x9'));var fs=require('fs');var fs_extra=require(_0x8cb8('0xa'));var _=require(_0x8cb8('0xb'));var squel=require(_0x8cb8('0xc'));var crypto=require(_0x8cb8('0xd'));var jsforce=require(_0x8cb8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8cb8('0x8'));var querystring=require('querystring');var Papa=require(_0x8cb8('0xf'));var Redis=require('ioredis');var authService=require(_0x8cb8('0x10'));var qs=require(_0x8cb8('0x11'));var as=require(_0x8cb8('0x12'));var hardwareService=require(_0x8cb8('0x13'));var logger=require(_0x8cb8('0x14'))('api');var utils=require(_0x8cb8('0x15'));var config=require(_0x8cb8('0x16'));var licenseUtil=require(_0x8cb8('0x17'));var db=require(_0x8cb8('0x18'))['db'];var jayson=require(_0x8cb8('0x19'));var client=jayson[_0x8cb8('0x1a')][_0x8cb8('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x35c0b1,_0x2fb616,_0x25f198,_0x4f3cf2){return new BPromise(function(_0x22b22e,_0x49c725){var _0x4474f7=_0x4f3cf2||client;return _0x4474f7[_0x8cb8('0x1c')](_0x35c0b1,_0x25f198)[_0x8cb8('0x1d')](function(_0x3e90c7){logger[_0x8cb8('0x1e')](_0x8cb8('0x1f'),_0x2fb616,'request\x20sent');logger[_0x8cb8('0x20')](_0x8cb8('0x21'),_0x2fb616,_0x8cb8('0x22'),JSON[_0x8cb8('0x23')](_0x3e90c7));if(_0x3e90c7[_0x8cb8('0x24')]){if(_0x3e90c7[_0x8cb8('0x24')][_0x8cb8('0x25')]===0x1f4){logger[_0x8cb8('0x24')]('Network,\x20%s,\x20%s',_0x2fb616,_0x3e90c7[_0x8cb8('0x24')]['message']);return _0x49c725(_0x3e90c7['error'][_0x8cb8('0x26')]);}logger[_0x8cb8('0x24')](_0x8cb8('0x1f'),_0x2fb616,_0x3e90c7[_0x8cb8('0x24')][_0x8cb8('0x26')]);return _0x22b22e(_0x3e90c7[_0x8cb8('0x24')]['message']);}else{logger[_0x8cb8('0x1e')]('Network,\x20%s,\x20%s',_0x2fb616,'request\x20sent');_0x22b22e(_0x3e90c7['result']['message']);}})[_0x8cb8('0x27')](function(_0x6b4a4d){logger[_0x8cb8('0x24')](_0x8cb8('0x1f'),_0x2fb616,_0x6b4a4d);_0x49c725(_0x6b4a4d);});});}function respondWithStatusCode(_0x9c2f59,_0x3ed330){_0x3ed330=_0x3ed330||0xcc;return function(_0x466199){if(_0x466199){return _0x9c2f59[_0x8cb8('0x28')](_0x3ed330);}return _0x9c2f59[_0x8cb8('0x29')](_0x3ed330)[_0x8cb8('0x2a')]();};}function respondWithResult(_0xb1249c,_0x3c69da){_0x3c69da=_0x3c69da||0xc8;return function(_0x39c6c8){if(_0x39c6c8){return _0xb1249c[_0x8cb8('0x29')](_0x3c69da)[_0x8cb8('0x2b')](_0x39c6c8);}};}function respondWithFilteredResult(_0x34c151,_0x13353c){return function(_0x43e3aa){if(_0x43e3aa){var _0x24147b=typeof _0x13353c[_0x8cb8('0x2c')]===_0x8cb8('0x2d')&&typeof _0x13353c[_0x8cb8('0x2e')]==='undefined';var _0x367ca2=_0x43e3aa[_0x8cb8('0x2f')];var _0xba3765=_0x24147b?0x0:_0x13353c[_0x8cb8('0x2c')];var _0x1fa1b8=_0x24147b?_0x43e3aa[_0x8cb8('0x2f')]:_0x13353c[_0x8cb8('0x2c')]+_0x13353c['limit'];var _0x1790b0;if(_0x1fa1b8>=_0x367ca2){_0x1fa1b8=_0x367ca2;_0x1790b0=0xc8;}else{_0x1790b0=0xce;}_0x34c151[_0x8cb8('0x29')](_0x1790b0);return _0x34c151[_0x8cb8('0x30')](_0x8cb8('0x31'),_0xba3765+'-'+_0x1fa1b8+'/'+_0x367ca2)[_0x8cb8('0x2b')](_0x43e3aa);}return null;};}function patchUpdates(_0x1a29e8){return function(_0x52087c){try{jsonpatch[_0x8cb8('0x32')](_0x52087c,_0x1a29e8,!![]);}catch(_0x55f13c){return BPromise[_0x8cb8('0x33')](_0x55f13c);}return _0x52087c[_0x8cb8('0x34')]();};}function saveUpdates(_0x4c3327,_0x50c283){return function(_0x4359d2){if(_0x4359d2){return _0x4359d2[_0x8cb8('0x35')](_0x4c3327)[_0x8cb8('0x1d')](function(_0x4bfa06){return _0x4bfa06;});}return null;};}function removeEntity(_0x4449ef,_0x2e72a8){return function(_0x57f91a){if(_0x57f91a){return _0x57f91a['destroy']()['then'](function(){_0x4449ef[_0x8cb8('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169609,_0x21ff77){return function(_0x3797c5){if(!_0x3797c5){_0x169609['sendStatus'](0x194);}return _0x3797c5;};}function handleError(_0x550352,_0x18da44){_0x18da44=_0x18da44||0x1f4;return function(_0x38c4d0){logger['error'](_0x38c4d0[_0x8cb8('0x36')]);if(_0x38c4d0[_0x8cb8('0x37')]){delete _0x38c4d0['name'];}_0x550352[_0x8cb8('0x29')](_0x18da44)[_0x8cb8('0x38')](_0x38c4d0);};}exports[_0x8cb8('0x39')]=function(_0x3694a4,_0x5c3bca){var _0x25411f={},_0x12e217={},_0x2baef4={'count':0x0,'rows':[]};var _0x821dff=_['map'](db['Network']['rawAttributes'],function(_0xc1d75f){return{'name':_0xc1d75f['fieldName'],'type':_0xc1d75f['type']['key']};});_0x12e217[_0x8cb8('0x3a')]=_['map'](_0x821dff,'name');_0x12e217['query']=_[_0x8cb8('0x3b')](_0x3694a4[_0x8cb8('0x3c')]);_0x12e217[_0x8cb8('0x3d')]=_[_0x8cb8('0x3e')](_0x12e217[_0x8cb8('0x3a')],_0x12e217['query']);_0x25411f[_0x8cb8('0x3f')]=_[_0x8cb8('0x3e')](_0x12e217[_0x8cb8('0x3a')],qs[_0x8cb8('0x40')](_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x40')]));_0x25411f[_0x8cb8('0x3f')]=_0x25411f[_0x8cb8('0x3f')][_0x8cb8('0x41')]?_0x25411f[_0x8cb8('0x3f')]:_0x12e217[_0x8cb8('0x3a')];if(!_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x42')](_0x8cb8('0x43'))){_0x25411f[_0x8cb8('0x2e')]=qs[_0x8cb8('0x2e')](_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x2e')]);_0x25411f[_0x8cb8('0x2c')]=qs[_0x8cb8('0x2c')](_0x3694a4[_0x8cb8('0x3c')]['offset']);}_0x25411f[_0x8cb8('0x44')]=qs[_0x8cb8('0x45')](_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x45')]);_0x25411f['where']=qs[_0x8cb8('0x3d')](_['pick'](_0x3694a4[_0x8cb8('0x3c')],_0x12e217[_0x8cb8('0x3d')]),_0x821dff);if(_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x46')]){_0x25411f[_0x8cb8('0x47')]=_['merge'](_0x25411f[_0x8cb8('0x47')],{'$or':_[_0x8cb8('0x48')](_0x821dff,function(_0x29374e){if(_0x29374e['type']!==_0x8cb8('0x49')){var _0x3a81e9={};_0x3a81e9[_0x29374e[_0x8cb8('0x37')]]={'$like':'%'+_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x46')]+'%'};return _0x3a81e9;}})});}_0x25411f=_[_0x8cb8('0x4a')]({},_0x25411f,_0x3694a4[_0x8cb8('0x4b')]);var _0x5bb075={'where':_0x25411f[_0x8cb8('0x47')]};return db[_0x8cb8('0x4c')][_0x8cb8('0x2f')](_0x5bb075)['then'](function(_0x9d2f78){_0x2baef4[_0x8cb8('0x2f')]=_0x9d2f78;if(_0x3694a4[_0x8cb8('0x3c')][_0x8cb8('0x4d')]){_0x25411f['include']=[{'all':!![]}];}return db[_0x8cb8('0x4c')][_0x8cb8('0x4e')](_0x25411f);})[_0x8cb8('0x1d')](function(_0x3464d5){_0x2baef4[_0x8cb8('0x4f')]=_0x3464d5;return _0x2baef4;})[_0x8cb8('0x1d')](respondWithFilteredResult(_0x5c3bca,_0x25411f))[_0x8cb8('0x27')](handleError(_0x5c3bca,null));};exports[_0x8cb8('0x50')]=function(_0x48787c,_0x2a56c9){var _0x1e583b={'raw':!![],'where':{'id':_0x48787c[_0x8cb8('0x51')]['id']}},_0x457d3c={};_0x457d3c[_0x8cb8('0x3a')]=_[_0x8cb8('0x3b')](db[_0x8cb8('0x4c')][_0x8cb8('0x52')]);_0x457d3c['query']=_['keys'](_0x48787c[_0x8cb8('0x3c')]);_0x457d3c[_0x8cb8('0x3d')]=_[_0x8cb8('0x3e')](_0x457d3c[_0x8cb8('0x3a')],_0x457d3c['query']);_0x1e583b['attributes']=_['intersection'](_0x457d3c[_0x8cb8('0x3a')],qs[_0x8cb8('0x40')](_0x48787c['query'][_0x8cb8('0x40')]));_0x1e583b[_0x8cb8('0x3f')]=_0x1e583b[_0x8cb8('0x3f')][_0x8cb8('0x41')]?_0x1e583b['attributes']:_0x457d3c[_0x8cb8('0x3a')];if(_0x48787c[_0x8cb8('0x3c')][_0x8cb8('0x4d')]){_0x1e583b[_0x8cb8('0x53')]=[{'all':!![]}];}_0x1e583b=_[_0x8cb8('0x4a')]({},_0x1e583b,_0x48787c[_0x8cb8('0x4b')]);return db[_0x8cb8('0x4c')][_0x8cb8('0x54')](_0x1e583b)[_0x8cb8('0x1d')](handleEntityNotFound(_0x2a56c9,null))[_0x8cb8('0x1d')](respondWithResult(_0x2a56c9,null))[_0x8cb8('0x27')](handleError(_0x2a56c9,null));};exports[_0x8cb8('0x55')]=function(_0x20e529,_0x40e423,_0x2cdc11){var _0x499236;return db[_0x8cb8('0x56')][_0x8cb8('0x57')](function(_0x48d0d9){return db[_0x8cb8('0x4c')]['create'](_0x20e529[_0x8cb8('0x58')],{'raw':!![]})['then'](function(_0x532d8c){_0x499236=_0x532d8c;return db[_0x8cb8('0x4c')][_0x8cb8('0x4e')]({'where':{'type':_0x20e529[_0x8cb8('0x58')]['type']},'raw':!![]});})[_0x8cb8('0x1d')](function(_0x373401){if(_0x499236[_0x8cb8('0x59')]['toUpperCase']()=='STUN'){var _0x19b249=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x5d')),_0x8cb8('0x5e'));var _0x379325=ejs[_0x8cb8('0x5f')](_0x19b249,{'networks':_0x373401||[]});fs['writeFileSync'](_0x8cb8('0x60'),_0x379325);return respondWithRpcPromise('Reload',_0x8cb8('0x55'),{'module':_0x8cb8('0x61')});}else if(_0x499236[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x63')){var _0x388a07=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x64')),_0x8cb8('0x5e'));var _0x19cd62=ejs[_0x8cb8('0x5f')](_0x388a07,{'networks':_0x373401||[]});fs[_0x8cb8('0x65')](_0x8cb8('0x66'),_0x19cd62);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x55'),{'module':_0x8cb8('0x61')});}else{var _0x2580c9=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x55512f=ejs['render'](_0x2580c9,{'networks':_0x373401||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x20e529['body'][_0x8cb8('0x59')][_0x8cb8('0x68')]()),_0x55512f);return respondWithRpcPromise(_0x8cb8('0x67'),'create',{'module':'chan_sip.so'});}return null;})[_0x8cb8('0x1d')](function(){return _0x499236;});})[_0x8cb8('0x1d')](respondWithResult(_0x40e423,0xc9))['catch'](handleError(_0x40e423,null));};exports[_0x8cb8('0x35')]=function(_0x1ffe12,_0x505695,_0xf4cbca){var _0x445bdb;return db[_0x8cb8('0x56')]['transaction'](function(_0x2edac9){return db[_0x8cb8('0x4c')][_0x8cb8('0x54')]({'where':{'id':_0x1ffe12[_0x8cb8('0x51')]['id']}})[_0x8cb8('0x1d')](handleEntityNotFound(_0x505695,null))['then'](saveUpdates(_0x1ffe12['body'],null))['then'](function(_0x1a0adb){if(_0x1a0adb){_0x445bdb=_0x1a0adb;return db['Network']['findAll']({'where':{'type':_0x445bdb[_0x8cb8('0x59')]},'raw':!![]});}return null;})[_0x8cb8('0x1d')](function(_0x3e324e){if(_0x445bdb[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x69')){var _0xf133f1=fs['readFileSync'](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],'server/files/templates/stun_multiple.ejs'),_0x8cb8('0x5e'));var _0x57cb60=ejs[_0x8cb8('0x5f')](_0xf133f1,{'networks':_0x3e324e||[]});fs[_0x8cb8('0x65')]('/etc/asterisk/stun_xcally.conf',_0x57cb60);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x35'),{'module':_0x8cb8('0x61')});}else if(_0x445bdb[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x63')){var _0x3525ec=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x64')),_0x8cb8('0x5e'));var _0x47a660=ejs[_0x8cb8('0x5f')](_0x3525ec,{'networks':_0x3e324e||[]});fs[_0x8cb8('0x65')](_0x8cb8('0x66'),_0x47a660);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x35'),{'module':_0x8cb8('0x61')});}else{var _0x1a6ea2=fs['readFileSync'](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x6a')),_0x8cb8('0x5e'));var _0x4591a2=ejs[_0x8cb8('0x5f')](_0x1a6ea2,{'networks':_0x3e324e||[]});fs[_0x8cb8('0x65')](util[_0x8cb8('0x6b')](_0x8cb8('0x6c'),_0x1ffe12['body'][_0x8cb8('0x59')][_0x8cb8('0x68')]()),_0x4591a2);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x35'),{'module':_0x8cb8('0x6d')});}return null;})[_0x8cb8('0x1d')](function(_0x5a1f9c){if(_0x5a1f9c){return _0x445bdb;}return null;});})[_0x8cb8('0x1d')](respondWithResult(_0x505695,null))[_0x8cb8('0x27')](handleError(_0x505695,null));};exports[_0x8cb8('0x6e')]=function(_0x8f9f56,_0x375334,_0x52b5b1){var _0x1f7b43;return db[_0x8cb8('0x4c')][_0x8cb8('0x54')]({'where':{'id':_0x8f9f56[_0x8cb8('0x51')]['id']}})[_0x8cb8('0x1d')](function(_0x35af36){_0x1f7b43=_0x35af36;return _0x35af36;})[_0x8cb8('0x1d')](handleEntityNotFound(_0x375334,null))[_0x8cb8('0x1d')](removeEntity(_0x375334,null))['then'](function(){if(_0x1f7b43){return db[_0x8cb8('0x4c')][_0x8cb8('0x4e')]({'where':{'type':_0x1f7b43[_0x8cb8('0x59')]},'raw':!![]});}})[_0x8cb8('0x1d')](function(_0x20b6e8){if(_0x1f7b43['type']['toUpperCase']()==_0x8cb8('0x69')){var _0x252f01=fs['readFileSync'](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x5d')),'utf8');var _0x426886=ejs[_0x8cb8('0x5f')](_0x252f01,{'networks':_0x20b6e8||[]});fs[_0x8cb8('0x65')](_0x8cb8('0x60'),_0x426886);return respondWithRpcPromise('Reload',_0x8cb8('0x6e'),{'module':_0x8cb8('0x61')});}else if(_0x1f7b43[_0x8cb8('0x59')][_0x8cb8('0x62')]()==_0x8cb8('0x63')){var _0x1ec153=fs[_0x8cb8('0x5a')](path['join'](config[_0x8cb8('0x5c')],_0x8cb8('0x64')),_0x8cb8('0x5e'));var _0x4efa5b=ejs[_0x8cb8('0x5f')](_0x1ec153,{'networks':_0x20b6e8||[]});fs['writeFileSync'](_0x8cb8('0x66'),_0x4efa5b);return respondWithRpcPromise(_0x8cb8('0x67'),'destroy',{'module':_0x8cb8('0x61')});}else{var _0x251bee=fs[_0x8cb8('0x5a')](path[_0x8cb8('0x5b')](config[_0x8cb8('0x5c')],_0x8cb8('0x6a')),_0x8cb8('0x5e'));var _0x4a6e00=ejs[_0x8cb8('0x5f')](_0x251bee,{'networks':_0x20b6e8||[]});fs[_0x8cb8('0x65')](util['format'](_0x8cb8('0x6c'),_0x8f9f56[_0x8cb8('0x58')][_0x8cb8('0x59')]['toLowerCase']()),_0x4a6e00);return respondWithRpcPromise(_0x8cb8('0x67'),_0x8cb8('0x6e'),{'module':'chan_sip.so'});}return null;})[_0x8cb8('0x27')](handleError(_0x375334,null));}; \ No newline at end of file +var _0xbf94=['Reload','transaction','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','Network','findAll','rows','show','params','keys','find','create','sequelize','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','render','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xbf94,0x146));var _0x4bf9=function(_0x5f0006,_0x1eb019){_0x5f0006=_0x5f0006-0x0;var _0x507514=_0xbf94[_0x5f0006];return _0x507514;};'use strict';var emlformat=require(_0x4bf9('0x0'));var rimraf=require(_0x4bf9('0x1'));var zipdir=require(_0x4bf9('0x2'));var jsonpatch=require(_0x4bf9('0x3'));var rp=require('request-promise');var moment=require(_0x4bf9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bf9('0x5'));var util=require('util');var path=require(_0x4bf9('0x6'));var sox=require(_0x4bf9('0x7'));var csv=require('to-csv');var ejs=require(_0x4bf9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bf9('0x9'));var squel=require(_0x4bf9('0xa'));var crypto=require(_0x4bf9('0xb'));var jsforce=require(_0x4bf9('0xc'));var deskjs=require(_0x4bf9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4bf9('0xe'));var Papa=require('papaparse');var Redis=require(_0x4bf9('0xf'));var authService=require(_0x4bf9('0x10'));var qs=require(_0x4bf9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4bf9('0x12'));var logger=require('../../config/logger')(_0x4bf9('0x13'));var utils=require(_0x4bf9('0x14'));var config=require(_0x4bf9('0x15'));var licenseUtil=require(_0x4bf9('0x16'));var db=require(_0x4bf9('0x17'))['db'];var jayson=require(_0x4bf9('0x18'));var client=jayson[_0x4bf9('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407a24,_0x3cce61,_0x2b05d3,_0x489eb9){return new BPromise(function(_0x251dd1,_0x3cf4e3){var _0x2d9079=_0x489eb9||client;return _0x2d9079['request'](_0x407a24,_0x2b05d3)[_0x4bf9('0x1a')](function(_0x212add){logger[_0x4bf9('0x1b')]('Network,\x20%s,\x20%s',_0x3cce61,_0x4bf9('0x1c'));logger[_0x4bf9('0x1d')](_0x4bf9('0x1e'),_0x3cce61,_0x4bf9('0x1c'),JSON[_0x4bf9('0x1f')](_0x212add));if(_0x212add[_0x4bf9('0x20')]){if(_0x212add[_0x4bf9('0x20')][_0x4bf9('0x21')]===0x1f4){logger[_0x4bf9('0x20')](_0x4bf9('0x22'),_0x3cce61,_0x212add[_0x4bf9('0x20')]['message']);return _0x3cf4e3(_0x212add[_0x4bf9('0x20')][_0x4bf9('0x23')]);}logger[_0x4bf9('0x20')]('Network,\x20%s,\x20%s',_0x3cce61,_0x212add[_0x4bf9('0x20')][_0x4bf9('0x23')]);return _0x251dd1(_0x212add[_0x4bf9('0x20')]['message']);}else{logger[_0x4bf9('0x1b')](_0x4bf9('0x22'),_0x3cce61,_0x4bf9('0x1c'));_0x251dd1(_0x212add[_0x4bf9('0x24')][_0x4bf9('0x23')]);}})[_0x4bf9('0x25')](function(_0x43c04d){logger[_0x4bf9('0x20')](_0x4bf9('0x22'),_0x3cce61,_0x43c04d);_0x3cf4e3(_0x43c04d);});});}function respondWithStatusCode(_0x4665e0,_0x20edd6){_0x20edd6=_0x20edd6||0xcc;return function(_0x296f9f){if(_0x296f9f){return _0x4665e0[_0x4bf9('0x26')](_0x20edd6);}return _0x4665e0[_0x4bf9('0x27')](_0x20edd6)[_0x4bf9('0x28')]();};}function respondWithResult(_0x115161,_0x417293){_0x417293=_0x417293||0xc8;return function(_0x196535){if(_0x196535){return _0x115161[_0x4bf9('0x27')](_0x417293)[_0x4bf9('0x29')](_0x196535);}};}function respondWithFilteredResult(_0x58d3ac,_0xbc53a4){return function(_0x88b8d6){if(_0x88b8d6){var _0x3744a8=typeof _0xbc53a4[_0x4bf9('0x2a')]===_0x4bf9('0x2b')&&typeof _0xbc53a4['limit']===_0x4bf9('0x2b');var _0x274143=_0x88b8d6[_0x4bf9('0x2c')];var _0x469b25=_0x3744a8?0x0:_0xbc53a4[_0x4bf9('0x2a')];var _0x4436ae=_0x3744a8?_0x88b8d6[_0x4bf9('0x2c')]:_0xbc53a4[_0x4bf9('0x2a')]+_0xbc53a4[_0x4bf9('0x2d')];var _0x36d3b9;if(_0x4436ae>=_0x274143){_0x4436ae=_0x274143;_0x36d3b9=0xc8;}else{_0x36d3b9=0xce;}_0x58d3ac[_0x4bf9('0x27')](_0x36d3b9);return _0x58d3ac[_0x4bf9('0x2e')](_0x4bf9('0x2f'),_0x469b25+'-'+_0x4436ae+'/'+_0x274143)[_0x4bf9('0x29')](_0x88b8d6);}return null;};}function patchUpdates(_0x383ef7){return function(_0x4f51c9){try{jsonpatch['apply'](_0x4f51c9,_0x383ef7,!![]);}catch(_0x726717){return BPromise[_0x4bf9('0x30')](_0x726717);}return _0x4f51c9[_0x4bf9('0x31')]();};}function saveUpdates(_0x1c2c6c,_0x241509){return function(_0x386b6a){if(_0x386b6a){return _0x386b6a[_0x4bf9('0x32')](_0x1c2c6c)[_0x4bf9('0x1a')](function(_0xa80b44){return _0xa80b44;});}return null;};}function removeEntity(_0x38dc48,_0x45ffeb){return function(_0x26f9d5){if(_0x26f9d5){return _0x26f9d5[_0x4bf9('0x33')]()['then'](function(){_0x38dc48[_0x4bf9('0x27')](0xcc)[_0x4bf9('0x28')]();});}};}function handleEntityNotFound(_0x50b4df,_0x194149){return function(_0x46cf12){if(!_0x46cf12){_0x50b4df['sendStatus'](0x194);}return _0x46cf12;};}function handleError(_0x5568ac,_0x18955d){_0x18955d=_0x18955d||0x1f4;return function(_0x4bda70){logger[_0x4bf9('0x20')](_0x4bda70[_0x4bf9('0x34')]);if(_0x4bda70[_0x4bf9('0x35')]){delete _0x4bda70[_0x4bf9('0x35')];}_0x5568ac[_0x4bf9('0x27')](_0x18955d)['send'](_0x4bda70);};}exports[_0x4bf9('0x36')]=function(_0x318a07,_0x2ffd7b){var _0x2caa9b={},_0x43f6ef={},_0x32c7d3={'count':0x0,'rows':[]};var _0xf1f87c=_[_0x4bf9('0x37')](db['Network'][_0x4bf9('0x38')],function(_0x195449){return{'name':_0x195449['fieldName'],'type':_0x195449['type'][_0x4bf9('0x39')]};});_0x43f6ef[_0x4bf9('0x3a')]=_[_0x4bf9('0x37')](_0xf1f87c,_0x4bf9('0x35'));_0x43f6ef[_0x4bf9('0x3b')]=_['keys'](_0x318a07[_0x4bf9('0x3b')]);_0x43f6ef[_0x4bf9('0x3c')]=_[_0x4bf9('0x3d')](_0x43f6ef['model'],_0x43f6ef[_0x4bf9('0x3b')]);_0x2caa9b[_0x4bf9('0x3e')]=_['intersection'](_0x43f6ef[_0x4bf9('0x3a')],qs[_0x4bf9('0x3f')](_0x318a07['query'][_0x4bf9('0x3f')]));_0x2caa9b['attributes']=_0x2caa9b[_0x4bf9('0x3e')][_0x4bf9('0x40')]?_0x2caa9b['attributes']:_0x43f6ef[_0x4bf9('0x3a')];if(!_0x318a07[_0x4bf9('0x3b')][_0x4bf9('0x41')]('nolimit')){_0x2caa9b['limit']=qs[_0x4bf9('0x2d')](_0x318a07[_0x4bf9('0x3b')][_0x4bf9('0x2d')]);_0x2caa9b[_0x4bf9('0x2a')]=qs[_0x4bf9('0x2a')](_0x318a07[_0x4bf9('0x3b')][_0x4bf9('0x2a')]);}_0x2caa9b[_0x4bf9('0x42')]=qs[_0x4bf9('0x43')](_0x318a07['query']['sort']);_0x2caa9b[_0x4bf9('0x44')]=qs['filters'](_[_0x4bf9('0x45')](_0x318a07[_0x4bf9('0x3b')],_0x43f6ef[_0x4bf9('0x3c')]),_0xf1f87c);if(_0x318a07[_0x4bf9('0x3b')]['filter']){_0x2caa9b['where']=_[_0x4bf9('0x46')](_0x2caa9b['where'],{'$or':_[_0x4bf9('0x37')](_0xf1f87c,function(_0x42fa0d){if(_0x42fa0d[_0x4bf9('0x47')]!==_0x4bf9('0x48')){var _0x3c319b={};_0x3c319b[_0x42fa0d[_0x4bf9('0x35')]]={'$like':'%'+_0x318a07[_0x4bf9('0x3b')]['filter']+'%'};return _0x3c319b;}})});}_0x2caa9b=_[_0x4bf9('0x46')]({},_0x2caa9b,_0x318a07[_0x4bf9('0x49')]);var _0xcf8095={'where':_0x2caa9b[_0x4bf9('0x44')]};return db['Network'][_0x4bf9('0x2c')](_0xcf8095)['then'](function(_0x4ba270){_0x32c7d3[_0x4bf9('0x2c')]=_0x4ba270;if(_0x318a07['query'][_0x4bf9('0x4a')]){_0x2caa9b[_0x4bf9('0x4b')]=[{'all':!![]}];}return db[_0x4bf9('0x4c')][_0x4bf9('0x4d')](_0x2caa9b);})[_0x4bf9('0x1a')](function(_0x127e74){_0x32c7d3[_0x4bf9('0x4e')]=_0x127e74;return _0x32c7d3;})[_0x4bf9('0x1a')](respondWithFilteredResult(_0x2ffd7b,_0x2caa9b))[_0x4bf9('0x25')](handleError(_0x2ffd7b,null));};exports[_0x4bf9('0x4f')]=function(_0x3e87cf,_0x2ca02b){var _0x1c842f={'raw':!![],'where':{'id':_0x3e87cf[_0x4bf9('0x50')]['id']}},_0x3e170b={};_0x3e170b[_0x4bf9('0x3a')]=_[_0x4bf9('0x51')](db[_0x4bf9('0x4c')][_0x4bf9('0x38')]);_0x3e170b[_0x4bf9('0x3b')]=_[_0x4bf9('0x51')](_0x3e87cf[_0x4bf9('0x3b')]);_0x3e170b[_0x4bf9('0x3c')]=_[_0x4bf9('0x3d')](_0x3e170b['model'],_0x3e170b[_0x4bf9('0x3b')]);_0x1c842f[_0x4bf9('0x3e')]=_['intersection'](_0x3e170b['model'],qs[_0x4bf9('0x3f')](_0x3e87cf[_0x4bf9('0x3b')][_0x4bf9('0x3f')]));_0x1c842f[_0x4bf9('0x3e')]=_0x1c842f[_0x4bf9('0x3e')][_0x4bf9('0x40')]?_0x1c842f[_0x4bf9('0x3e')]:_0x3e170b[_0x4bf9('0x3a')];if(_0x3e87cf['query']['includeAll']){_0x1c842f[_0x4bf9('0x4b')]=[{'all':!![]}];}_0x1c842f=_[_0x4bf9('0x46')]({},_0x1c842f,_0x3e87cf[_0x4bf9('0x49')]);return db[_0x4bf9('0x4c')][_0x4bf9('0x52')](_0x1c842f)[_0x4bf9('0x1a')](handleEntityNotFound(_0x2ca02b,null))[_0x4bf9('0x1a')](respondWithResult(_0x2ca02b,null))['catch'](handleError(_0x2ca02b,null));};exports[_0x4bf9('0x53')]=function(_0x51c6a8,_0xfd677f,_0x22aea6){var _0x50df82;return db[_0x4bf9('0x54')]['transaction'](function(_0x2a6695){return db[_0x4bf9('0x4c')][_0x4bf9('0x53')](_0x51c6a8[_0x4bf9('0x55')],{'raw':!![]})[_0x4bf9('0x1a')](function(_0x4257b5){_0x50df82=_0x4257b5;return db[_0x4bf9('0x4c')][_0x4bf9('0x4d')]({'where':{'type':_0x51c6a8[_0x4bf9('0x55')][_0x4bf9('0x47')]},'raw':!![]});})[_0x4bf9('0x1a')](function(_0x3e942a){if(_0x50df82[_0x4bf9('0x47')][_0x4bf9('0x56')]()==_0x4bf9('0x57')){var _0xca6409=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config[_0x4bf9('0x5a')],_0x4bf9('0x5b')),_0x4bf9('0x5c'));var _0x2e05b8=ejs['render'](_0xca6409,{'networks':_0x3e942a||[]});fs[_0x4bf9('0x5d')](_0x4bf9('0x5e'),_0x2e05b8);return respondWithRpcPromise('Reload',_0x4bf9('0x53'),{'module':_0x4bf9('0x5f')});}else if(_0x50df82[_0x4bf9('0x47')]['toUpperCase']()==_0x4bf9('0x60')){var _0x31a655=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x4bf9('0x5c'));var _0x44568c=ejs[_0x4bf9('0x61')](_0x31a655,{'networks':_0x3e942a||[]});fs[_0x4bf9('0x5d')](_0x4bf9('0x62'),_0x44568c);return respondWithRpcPromise('Reload',_0x4bf9('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x1531d6=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config[_0x4bf9('0x5a')],'server/files/templates/network.ejs'),_0x4bf9('0x5c'));var _0x384b55=ejs[_0x4bf9('0x61')](_0x1531d6,{'networks':_0x3e942a||[]});fs[_0x4bf9('0x5d')](util[_0x4bf9('0x63')](_0x4bf9('0x64'),_0x51c6a8['body'][_0x4bf9('0x47')][_0x4bf9('0x65')]()),_0x384b55);return respondWithRpcPromise(_0x4bf9('0x66'),'create',{'module':'chan_sip.so'});}return null;})[_0x4bf9('0x1a')](function(){return _0x50df82;});})[_0x4bf9('0x1a')](respondWithResult(_0xfd677f,0xc9))[_0x4bf9('0x25')](handleError(_0xfd677f,null));};exports[_0x4bf9('0x32')]=function(_0x36f1af,_0xdb2965,_0x5eb971){var _0x5313f0;return db[_0x4bf9('0x54')][_0x4bf9('0x67')](function(_0x3242ec){return db['Network']['find']({'where':{'id':_0x36f1af[_0x4bf9('0x50')]['id']}})['then'](handleEntityNotFound(_0xdb2965,null))[_0x4bf9('0x1a')](saveUpdates(_0x36f1af[_0x4bf9('0x55')],null))['then'](function(_0x2c742d){if(_0x2c742d){_0x5313f0=_0x2c742d;return db[_0x4bf9('0x4c')][_0x4bf9('0x4d')]({'where':{'type':_0x5313f0['type']},'raw':!![]});}return null;})['then'](function(_0x303b1b){if(_0x5313f0['type'][_0x4bf9('0x56')]()==_0x4bf9('0x57')){var _0x4fb6ae=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config[_0x4bf9('0x5a')],'server/files/templates/stun_multiple.ejs'),_0x4bf9('0x5c'));var _0xfeefd=ejs['render'](_0x4fb6ae,{'networks':_0x303b1b||[]});fs[_0x4bf9('0x5d')](_0x4bf9('0x5e'),_0xfeefd);return respondWithRpcPromise(_0x4bf9('0x66'),'update',{'module':'res_stun_monitor.so'});}else if(_0x5313f0[_0x4bf9('0x47')]['toUpperCase']()==_0x4bf9('0x60')){var _0x247096=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config[_0x4bf9('0x5a')],_0x4bf9('0x68')),_0x4bf9('0x5c'));var _0x4064ef=ejs[_0x4bf9('0x61')](_0x247096,{'networks':_0x303b1b||[]});fs['writeFileSync'](_0x4bf9('0x62'),_0x4064ef);return respondWithRpcPromise(_0x4bf9('0x66'),'update',{'module':_0x4bf9('0x5f')});}else{var _0x3ff09e=fs[_0x4bf9('0x58')](path['join'](config['root'],_0x4bf9('0x69')),'utf8');var _0x31ec94=ejs['render'](_0x3ff09e,{'networks':_0x303b1b||[]});fs['writeFileSync'](util[_0x4bf9('0x63')](_0x4bf9('0x64'),_0x36f1af[_0x4bf9('0x55')][_0x4bf9('0x47')][_0x4bf9('0x65')]()),_0x31ec94);return respondWithRpcPromise(_0x4bf9('0x66'),'update',{'module':'chan_sip.so'});}return null;})['then'](function(_0xfec0e8){if(_0xfec0e8){return _0x5313f0;}return null;});})[_0x4bf9('0x1a')](respondWithResult(_0xdb2965,null))[_0x4bf9('0x25')](handleError(_0xdb2965,null));};exports[_0x4bf9('0x33')]=function(_0x180b82,_0x1c0da0,_0x694626){var _0x36b80f;return db[_0x4bf9('0x4c')][_0x4bf9('0x52')]({'where':{'id':_0x180b82[_0x4bf9('0x50')]['id']}})['then'](function(_0x5b5f50){_0x36b80f=_0x5b5f50;return _0x5b5f50;})[_0x4bf9('0x1a')](handleEntityNotFound(_0x1c0da0,null))[_0x4bf9('0x1a')](removeEntity(_0x1c0da0,null))[_0x4bf9('0x1a')](function(){if(_0x36b80f){return db[_0x4bf9('0x4c')][_0x4bf9('0x4d')]({'where':{'type':_0x36b80f[_0x4bf9('0x47')]},'raw':!![]});}})[_0x4bf9('0x1a')](function(_0x494722){if(_0x36b80f[_0x4bf9('0x47')][_0x4bf9('0x56')]()=='STUN'){var _0x1b1a37=fs['readFileSync'](path['join'](config['root'],_0x4bf9('0x5b')),_0x4bf9('0x5c'));var _0x29bfae=ejs[_0x4bf9('0x61')](_0x1b1a37,{'networks':_0x494722||[]});fs[_0x4bf9('0x5d')](_0x4bf9('0x5e'),_0x29bfae);return respondWithRpcPromise(_0x4bf9('0x66'),_0x4bf9('0x33'),{'module':'res_stun_monitor.so'});}else if(_0x36b80f[_0x4bf9('0x47')][_0x4bf9('0x56')]()==_0x4bf9('0x60')){var _0x2ba09b=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config[_0x4bf9('0x5a')],_0x4bf9('0x68')),_0x4bf9('0x5c'));var _0x411cf9=ejs[_0x4bf9('0x61')](_0x2ba09b,{'networks':_0x494722||[]});fs[_0x4bf9('0x5d')](_0x4bf9('0x62'),_0x411cf9);return respondWithRpcPromise(_0x4bf9('0x66'),_0x4bf9('0x33'),{'module':'res_stun_monitor.so'});}else{var _0x32d63c=fs[_0x4bf9('0x58')](path[_0x4bf9('0x59')](config['root'],_0x4bf9('0x69')),_0x4bf9('0x5c'));var _0x325f1b=ejs[_0x4bf9('0x61')](_0x32d63c,{'networks':_0x494722||[]});fs[_0x4bf9('0x5d')](util[_0x4bf9('0x63')](_0x4bf9('0x64'),_0x180b82[_0x4bf9('0x55')][_0x4bf9('0x47')][_0x4bf9('0x65')]()),_0x325f1b);return respondWithRpcPromise(_0x4bf9('0x66'),_0x4bf9('0x33'),{'module':_0x4bf9('0x6a')});}return null;})[_0x4bf9('0x25')](handleError(_0x1c0da0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index b63bf51..2f01dd6 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 _0x2504=['../../config/environment','./network.attributes','exports','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x2504,0xee));var _0x4250=function(_0x3602f4,_0xd49cdb){_0x3602f4=_0x3602f4-0x0;var _0x266499=_0x2504[_0x3602f4];return _0x266499;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var logger=require(_0x4250('0x2'))(_0x4250('0x3'));var moment=require(_0x4250('0x4'));var BPromise=require(_0x4250('0x5'));var rp=require(_0x4250('0x6'));var fs=require('fs');var path=require(_0x4250('0x7'));var rimraf=require(_0x4250('0x8'));var config=require(_0x4250('0x9'));var attributes=require(_0x4250('0xa'));module[_0x4250('0xb')]=function(_0x493da9,_0x473cb8){return _0x493da9['define']('Network',attributes,{'tableName':_0x4250('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc874=['../../config/logger','api','request-promise','path','rimraf','./network.attributes','exports','define','Network','network','lodash'];(function(_0x36398b,_0x46a031){var _0x460e1d=function(_0x5bb63c){while(--_0x5bb63c){_0x36398b['push'](_0x36398b['shift']());}};_0x460e1d(++_0x46a031);}(_0xc874,0x154));var _0x4c87=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0xc874[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var logger=require(_0x4c87('0x1'))(_0x4c87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c87('0x3'));var fs=require('fs');var path=require(_0x4c87('0x4'));var rimraf=require(_0x4c87('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c87('0x6'));module[_0x4c87('0x7')]=function(_0x5d63ae,_0x46e0f5){return _0x5d63ae[_0x4c87('0x8')](_0x4c87('0x9'),attributes,{'tableName':_0x4c87('0xa'),'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 02757f9..e92db52 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(_0x6f21f4,_0x5388c2){var _0x28933f=function(_0x105848){while(--_0x105848){_0x6f21f4['push'](_0x6f21f4['shift']());}};_0x28933f(++_0x5388c2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x595071,_0x1fa4fc){_0x595071=_0x595071-0x0;var _0x3c264d=_0x7a54[_0x595071];return _0x3c264d;};'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 cb8416d..b5f39f3 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 _0x9ca3=['removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete'];(function(_0x16ad4c,_0x7a1daa){var _0x2eec11=function(_0x15e717){while(--_0x15e717){_0x16ad4c['push'](_0x16ad4c['shift']());}};_0x2eec11(++_0x7a1daa);}(_0x9ca3,0x134));var _0x39ca=function(_0x1fc3b5,_0x37fa95){_0x1fc3b5=_0x1fc3b5-0x0;var _0x18a56c=_0x9ca3[_0x1fc3b5];return _0x18a56c;};'use strict';var multer=require(_0x39ca('0x0'));var util=require(_0x39ca('0x1'));var path=require(_0x39ca('0x2'));var timeout=require(_0x39ca('0x3'));var express=require(_0x39ca('0x4'));var router=express[_0x39ca('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x39ca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x39ca('0x7'));var controller=require('./openchannelAccount.controller');router[_0x39ca('0x8')]('/',auth[_0x39ca('0x9')](),controller[_0x39ca('0xa')]);router[_0x39ca('0x8')](_0x39ca('0xb'),auth[_0x39ca('0x9')](),controller['describe']);router['get'](_0x39ca('0xc'),auth[_0x39ca('0x9')](),controller[_0x39ca('0xd')]);router[_0x39ca('0x8')](_0x39ca('0xe'),auth[_0x39ca('0x9')](),controller[_0x39ca('0xf')]);router[_0x39ca('0x8')]('/:id/canned_answers',auth[_0x39ca('0x9')](),controller[_0x39ca('0x10')]);router[_0x39ca('0x8')](_0x39ca('0x11'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x12')]);router[_0x39ca('0x8')](_0x39ca('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x39ca('0x8')](_0x39ca('0x14'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x15')]);router[_0x39ca('0x16')]('/',auth[_0x39ca('0x9')](),controller['create']);router[_0x39ca('0x16')]('/:id/dispositions',auth[_0x39ca('0x9')](),controller[_0x39ca('0x17')]);router[_0x39ca('0x16')](_0x39ca('0x18'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x19')]);router[_0x39ca('0x16')](_0x39ca('0x1a'),controller[_0x39ca('0x1b')]);router[_0x39ca('0x16')]('/:id/applications',auth[_0x39ca('0x9')](),controller[_0x39ca('0x1c')]);router[_0x39ca('0x16')](_0x39ca('0x14'),auth[_0x39ca('0x9')](),controller[_0x39ca('0x1d')]);router['post'](_0x39ca('0x1e'),auth[_0x39ca('0x9')](),controller['send']);router[_0x39ca('0x1f')](_0x39ca('0xc'),auth['isAuthenticated'](),controller[_0x39ca('0x20')]);router[_0x39ca('0x21')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x39ca('0x21')]('/:id/dispositions',auth[_0x39ca('0x9')](),controller[_0x39ca('0x22')]);router[_0x39ca('0x21')]('/:id/canned_answers',auth[_0x39ca('0x9')](),controller[_0x39ca('0x23')]);router[_0x39ca('0x21')]('/:id/users',auth[_0x39ca('0x9')](),controller[_0x39ca('0x24')]);module[_0x39ca('0x25')]=router; \ No newline at end of file +var _0xb5fc=['send','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','post','create','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send'];(function(_0x3294a2,_0x5a75ce){var _0x30317a=function(_0x44e440){while(--_0x44e440){_0x3294a2['push'](_0x3294a2['shift']());}};_0x30317a(++_0x5a75ce);}(_0xb5fc,0xd8));var _0xcb5f=function(_0x2a4493,_0x4e514b){_0x2a4493=_0x2a4493-0x0;var _0xac7962=_0xb5fc[_0x2a4493];return _0xac7962;};'use strict';var multer=require(_0xcb5f('0x0'));var util=require(_0xcb5f('0x1'));var path=require(_0xcb5f('0x2'));var timeout=require(_0xcb5f('0x3'));var express=require('express');var router=express[_0xcb5f('0x4')]();var fs_extra=require(_0xcb5f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb5f('0x6'));var config=require(_0xcb5f('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcb5f('0x8')]);router[_0xcb5f('0x9')](_0xcb5f('0xa'),auth[_0xcb5f('0xb')](),controller['describe']);router[_0xcb5f('0x9')](_0xcb5f('0xc'),auth[_0xcb5f('0xb')](),controller['show']);router[_0xcb5f('0x9')](_0xcb5f('0xd'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0xe')]);router[_0xcb5f('0x9')](_0xcb5f('0xf'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x10')]);router[_0xcb5f('0x9')](_0xcb5f('0x11'),auth[_0xcb5f('0xb')](),controller['getApplications']);router['get'](_0xcb5f('0x12'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x13')]);router[_0xcb5f('0x9')]('/:id/users',auth[_0xcb5f('0xb')](),controller['getAgents']);router[_0xcb5f('0x14')]('/',auth['isAuthenticated'](),controller[_0xcb5f('0x15')]);router[_0xcb5f('0x14')](_0xcb5f('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xcb5f('0xf'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x16')]);router[_0xcb5f('0x14')](_0xcb5f('0x17'),controller[_0xcb5f('0x18')]);router[_0xcb5f('0x14')](_0xcb5f('0x11'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x19')]);router['post'](_0xcb5f('0x1a'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x1b')]);router[_0xcb5f('0x14')](_0xcb5f('0x1c'),auth['isAuthenticated'](),controller[_0xcb5f('0x1d')]);router['put'](_0xcb5f('0xc'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x1e')]);router[_0xcb5f('0x1f')](_0xcb5f('0xc'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x20')]);router['delete']('/:id/dispositions',auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x21')]);router[_0xcb5f('0x1f')](_0xcb5f('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xcb5f('0x1f')](_0xcb5f('0x1a'),auth[_0xcb5f('0xb')](),controller[_0xcb5f('0x22')]);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 4476c87..6384450 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 _0x3fc0=['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','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x41ffdb,_0x212ee2){var _0x2e1dad=function(_0x2f735b){while(--_0x2f735b){_0x41ffdb['push'](_0x41ffdb['shift']());}};_0x2e1dad(++_0x212ee2);}(_0x3fc0,0x1ab));var _0x03fc=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x3fc0[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x03fc('0x0'));var rs=require(_0x03fc('0x1'));module[_0x03fc('0x2')]={'name':{'type':Sequelize[_0x03fc('0x3')],'unique':_0x03fc('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x03fc('0x3')],'defaultValue':function(){return rs[_0x03fc('0x5')]();}},'replyUri':{'type':Sequelize[_0x03fc('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x03fc('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x03fc('0x6')],'defaultValue':function(){return _0x03fc('0x7');}},'notificationSound':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x03fc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x03fc('0x3')]},'queueTransfer':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x03fc('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x03fc('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x03fc('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x03fc('0x8')],'defaultValue':![],'comment':_0x03fc('0xb'),'set':function(_0x5e305e){if(!_0x5e305e)this[_0x03fc('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x03fc('0xd'),_0x5e305e);}}}; \ No newline at end of file +var _0xfa6c=['INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x5cb2eb,_0x544081){var _0xae80c0=function(_0x38ef17){while(--_0x38ef17){_0x5cb2eb['push'](_0x5cb2eb['shift']());}};_0xae80c0(++_0x544081);}(_0xfa6c,0x97));var _0xcfa6=function(_0x251025,_0xfd6100){_0x251025=_0x251025-0x0;var _0x35cb48=_0xfa6c[_0x251025];return _0x35cb48;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xcfa6('0x0'));module[_0xcfa6('0x1')]={'name':{'type':Sequelize[_0xcfa6('0x2')],'unique':_0xcfa6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcfa6('0x2')]},'token':{'type':Sequelize[_0xcfa6('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xcfa6('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcfa6('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xcfa6('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcfa6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xcfa6('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcfa6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcfa6('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcfa6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcfa6('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xcfa6('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xcfa6('0x6')],'defaultValue':![],'comment':_0xcfa6('0x8'),'set':function(_0x463f74){if(!_0x463f74)this['setDataValue'](_0xcfa6('0x9'),null);this[_0xcfa6('0xa')](_0xcfa6('0xb'),_0x463f74);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 344ee32..c70ceb9 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 _0x9a26=['count','set','Content-Range','json','apply','reject','save','update','destroy','OpenchannelAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','show','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','list','applications','orderBy','priority','asc','account','Applications','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','contact','messageId','interaction','created','autoclose','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','bulkCreate','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','offset','undefined','limit'];(function(_0x4d1691,_0x1e5151){var _0x350e14=function(_0x5c46c6){while(--_0x5c46c6){_0x4d1691['push'](_0x4d1691['shift']());}};_0x350e14(++_0x1e5151);}(_0x9a26,0x149));var _0x69a2=function(_0x37d8ae,_0x17e484){_0x37d8ae=_0x37d8ae-0x0;var _0x4de500=_0x9a26[_0x37d8ae];return _0x4de500;};'use strict';var emlformat=require(_0x69a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69a2('0x1'));var jsonpatch=require(_0x69a2('0x2'));var rp=require(_0x69a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x69a2('0x4'));var util=require(_0x69a2('0x5'));var path=require('path');var sox=require(_0x69a2('0x6'));var csv=require(_0x69a2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69a2('0x8'));var _=require('lodash');var squel=require(_0x69a2('0x9'));var crypto=require(_0x69a2('0xa'));var jsforce=require(_0x69a2('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x69a2('0xc'));var Papa=require(_0x69a2('0xd'));var Redis=require(_0x69a2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x69a2('0xf'));var as=require(_0x69a2('0x10'));var hardwareService=require(_0x69a2('0x11'));var logger=require(_0x69a2('0x12'))(_0x69a2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x69a2('0x14'));var db=require('../../mysqldb')['db'];config[_0x69a2('0x15')]=_[_0x69a2('0x16')](config[_0x69a2('0x15')],{'host':_0x69a2('0x17'),'port':0x18eb});var socket=require(_0x69a2('0x18'))(new Redis(config[_0x69a2('0x15')]));require(_0x69a2('0x19'))[_0x69a2('0x1a')](socket);var jayson=require(_0x69a2('0x1b'));var client=jayson[_0x69a2('0x1c')][_0x69a2('0x1d')]({'port':0x232c});var client9002=jayson[_0x69a2('0x1c')][_0x69a2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x15bbf6,_0x443c50,_0x313b08,_0x15c207){return new BPromise(function(_0x30462d,_0x3c33e8){var _0x3a047e=_0x15c207||client;return _0x3a047e['request'](_0x15bbf6,_0x313b08)[_0x69a2('0x1e')](function(_0x39b6d0){logger[_0x69a2('0x1f')](_0x69a2('0x20'),_0x443c50,_0x69a2('0x21'));logger[_0x69a2('0x22')](_0x69a2('0x23'),_0x443c50,_0x69a2('0x21'),JSON['stringify'](_0x39b6d0));if(_0x39b6d0['error']){if(_0x39b6d0[_0x69a2('0x24')]['code']===0x1f4){logger[_0x69a2('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x443c50,_0x39b6d0[_0x69a2('0x24')][_0x69a2('0x25')]);return _0x3c33e8(_0x39b6d0[_0x69a2('0x24')][_0x69a2('0x25')]);}logger[_0x69a2('0x24')](_0x69a2('0x20'),_0x443c50,_0x39b6d0[_0x69a2('0x24')]['message']);return _0x30462d(_0x39b6d0['error'][_0x69a2('0x25')]);}else{logger[_0x69a2('0x1f')](_0x69a2('0x20'),_0x443c50,_0x69a2('0x21'));_0x30462d(_0x39b6d0[_0x69a2('0x26')]['message']);}})[_0x69a2('0x27')](function(_0x271696){logger[_0x69a2('0x24')](_0x69a2('0x20'),_0x443c50,_0x271696);_0x3c33e8(_0x271696);});});}function respondWithStatusCode(_0xc0f704,_0x241ec8){_0x241ec8=_0x241ec8||0xcc;return function(_0x288519){if(_0x288519){return _0xc0f704[_0x69a2('0x28')](_0x241ec8);}return _0xc0f704[_0x69a2('0x29')](_0x241ec8)['end']();};}function respondWithResult(_0x4fdaf1,_0x5acb23){_0x5acb23=_0x5acb23||0xc8;return function(_0x2454f0){if(_0x2454f0){return _0x4fdaf1[_0x69a2('0x29')](_0x5acb23)['json'](_0x2454f0);}};}function respondWithFilteredResult(_0x20ea7d,_0x3718c9){return function(_0x53e65d){if(_0x53e65d){var _0x3be949=typeof _0x3718c9[_0x69a2('0x2a')]===_0x69a2('0x2b')&&typeof _0x3718c9[_0x69a2('0x2c')]===_0x69a2('0x2b');var _0x4059fe=_0x53e65d[_0x69a2('0x2d')];var _0x37115f=_0x3be949?0x0:_0x3718c9['offset'];var _0x5ed21a=_0x3be949?_0x53e65d[_0x69a2('0x2d')]:_0x3718c9[_0x69a2('0x2a')]+_0x3718c9[_0x69a2('0x2c')];var _0xd33be7;if(_0x5ed21a>=_0x4059fe){_0x5ed21a=_0x4059fe;_0xd33be7=0xc8;}else{_0xd33be7=0xce;}_0x20ea7d[_0x69a2('0x29')](_0xd33be7);return _0x20ea7d[_0x69a2('0x2e')](_0x69a2('0x2f'),_0x37115f+'-'+_0x5ed21a+'/'+_0x4059fe)[_0x69a2('0x30')](_0x53e65d);}return null;};}function patchUpdates(_0xe96eb6){return function(_0x5ea4ee){try{jsonpatch[_0x69a2('0x31')](_0x5ea4ee,_0xe96eb6,!![]);}catch(_0x1ce399){return BPromise[_0x69a2('0x32')](_0x1ce399);}return _0x5ea4ee[_0x69a2('0x33')]();};}function saveUpdates(_0x4947dc,_0x69cb75){return function(_0x20e2e3){if(_0x20e2e3){return _0x20e2e3[_0x69a2('0x34')](_0x4947dc)[_0x69a2('0x1e')](function(_0x31ce51){return _0x31ce51;});}return null;};}function removeEntity(_0x238c2c,_0x2d187d){return function(_0x28de42){if(_0x28de42){return _0x28de42[_0x69a2('0x35')]()[_0x69a2('0x1e')](function(){var _0x545905=_0x28de42['get']({'plain':!![]});var _0x14f631=_0x69a2('0x36');return db['UserProfileResource'][_0x69a2('0x35')]({'where':{'type':_0x14f631,'resourceId':_0x545905['id']}})[_0x69a2('0x1e')](function(){return _0x28de42;});})['then'](function(){_0x238c2c[_0x69a2('0x29')](0xcc)[_0x69a2('0x37')]();});}};}function handleEntityNotFound(_0xd31883,_0x357269){return function(_0x34a9a8){if(!_0x34a9a8){_0xd31883[_0x69a2('0x28')](0x194);}return _0x34a9a8;};}function handleError(_0x116800,_0x340456){_0x340456=_0x340456||0x1f4;return function(_0x1d5863){logger[_0x69a2('0x24')](_0x1d5863[_0x69a2('0x38')]);if(_0x1d5863['name']){delete _0x1d5863[_0x69a2('0x39')];}_0x116800[_0x69a2('0x29')](_0x340456)[_0x69a2('0x3a')](_0x1d5863);};}exports[_0x69a2('0x3b')]=function(_0x2f75c6,_0x3dd17d){var _0xe367c5={'include':[{'model':db[_0x69a2('0x3c')],'as':_0x69a2('0x3d')}]},_0x11e6b3={},_0x1635c2={'count':0x0,'rows':[]};var _0x11f63c=_[_0x69a2('0x3e')](db[_0x69a2('0x3f')]['rawAttributes'],function(_0x3a9db4){return{'name':_0x3a9db4['fieldName'],'type':_0x3a9db4[_0x69a2('0x40')]['key']};});_0x11e6b3[_0x69a2('0x41')]=_[_0x69a2('0x3e')](_0x11f63c,_0x69a2('0x39'));_0x11e6b3['query']=_[_0x69a2('0x42')](_0x2f75c6[_0x69a2('0x43')]);_0x11e6b3[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0x11e6b3[_0x69a2('0x41')],_0x11e6b3[_0x69a2('0x43')]);_0xe367c5[_0x69a2('0x46')]=_['intersection'](_0x11e6b3['model'],qs[_0x69a2('0x47')](_0x2f75c6[_0x69a2('0x43')]['fields']));_0xe367c5[_0x69a2('0x46')]=_0xe367c5[_0x69a2('0x46')][_0x69a2('0x48')]?_0xe367c5['attributes']:_0x11e6b3[_0x69a2('0x41')];if(!_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0xe367c5[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x2c')]);_0xe367c5[_0x69a2('0x2a')]=qs[_0x69a2('0x2a')](_0x2f75c6['query'][_0x69a2('0x2a')]);}_0xe367c5[_0x69a2('0x4b')]=qs[_0x69a2('0x4c')](_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x4c')]);_0xe367c5['where']=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0x2f75c6[_0x69a2('0x43')],_0x11e6b3['filters']),_0x11f63c);if(_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x4e')]){_0xe367c5[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0xe367c5['where'],{'$or':_[_0x69a2('0x3e')](_0x11f63c,function(_0x2b6d19){if(_0x2b6d19[_0x69a2('0x40')]!=='VIRTUAL'){var _0x1582e2={};_0x1582e2[_0x2b6d19[_0x69a2('0x39')]]={'$like':'%'+_0x2f75c6[_0x69a2('0x43')]['filter']+'%'};return _0x1582e2;}})});}_0xe367c5=_['merge']({},_0xe367c5,_0x2f75c6[_0x69a2('0x51')]);var _0x48a82f={'where':_0xe367c5['where']};return db[_0x69a2('0x3f')][_0x69a2('0x2d')](_0x48a82f)[_0x69a2('0x1e')](function(_0x2c951f){_0x1635c2[_0x69a2('0x2d')]=_0x2c951f;if(_0x2f75c6[_0x69a2('0x43')][_0x69a2('0x52')]){_0xe367c5['include']=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0xe367c5);})[_0x69a2('0x1e')](function(_0x2e7383){_0x1635c2['rows']=_0x2e7383;return _0x1635c2;})['then'](respondWithFilteredResult(_0x3dd17d,_0xe367c5))[_0x69a2('0x27')](handleError(_0x3dd17d,null));};exports[_0x69a2('0x53')]=function(_0xfa9606,_0x181735){var _0x24b30d={'raw':![],'where':{'id':_0xfa9606[_0x69a2('0x54')]['id']},'include':[{'model':db[_0x69a2('0x3c')],'as':_0x69a2('0x3d')}]},_0xaae1e0={};_0xaae1e0[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x3f')][_0x69a2('0x55')]);_0xaae1e0[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0xfa9606[_0x69a2('0x43')]);_0xaae1e0[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0xaae1e0[_0x69a2('0x41')],_0xaae1e0[_0x69a2('0x43')]);_0x24b30d[_0x69a2('0x46')]=_['intersection'](_0xaae1e0[_0x69a2('0x41')],qs['fields'](_0xfa9606['query'][_0x69a2('0x47')]));_0x24b30d['attributes']=_0x24b30d[_0x69a2('0x46')]['length']?_0x24b30d[_0x69a2('0x46')]:_0xaae1e0[_0x69a2('0x41')];if(_0xfa9606[_0x69a2('0x43')][_0x69a2('0x52')]){_0x24b30d[_0x69a2('0x56')]=[{'all':!![]}];}_0x24b30d=_[_0x69a2('0x50')]({},_0x24b30d,_0xfa9606[_0x69a2('0x51')]);return db[_0x69a2('0x3f')][_0x69a2('0x57')](_0x24b30d)[_0x69a2('0x1e')](handleEntityNotFound(_0x181735,null))[_0x69a2('0x1e')](respondWithResult(_0x181735,null))[_0x69a2('0x27')](handleError(_0x181735,null));};exports['create']=function(_0x3e3416,_0x4851e9){return db['OpenchannelAccount'][_0x69a2('0x58')](_0x3e3416[_0x69a2('0x59')],{})[_0x69a2('0x1e')](function(_0x297eb8){var _0xa80926=_0x3e3416[_0x69a2('0x5a')][_0x69a2('0x5b')]({'plain':!![]});if(!_0xa80926)throw new Error(_0x69a2('0x5c'));if(_0xa80926[_0x69a2('0x5d')]===_0x69a2('0x5a')){var _0x177873=_0x297eb8[_0x69a2('0x5b')]({'plain':!![]});var _0x4efa93=_0x69a2('0x36');return db[_0x69a2('0x5e')][_0x69a2('0x57')]({'where':{'name':_0x4efa93,'userProfileId':_0xa80926[_0x69a2('0x5f')]},'raw':!![]})['then'](function(_0x38218a){if(_0x38218a&&_0x38218a[_0x69a2('0x60')]===0x0){return db[_0x69a2('0x61')][_0x69a2('0x58')]({'name':_0x177873[_0x69a2('0x39')],'resourceId':_0x177873['id'],'type':_0x38218a[_0x69a2('0x39')],'sectionId':_0x38218a['id']},{})[_0x69a2('0x1e')](function(){return _0x297eb8;});}else{return _0x297eb8;}})[_0x69a2('0x27')](function(_0x32764e){logger[_0x69a2('0x24')](_0x69a2('0x62'),_0x32764e);throw _0x32764e;});}return _0x297eb8;})['then'](respondWithResult(_0x4851e9,0xc9))[_0x69a2('0x27')](handleError(_0x4851e9,null));};exports[_0x69a2('0x34')]=function(_0x33a1aa,_0x190850){if(_0x33a1aa['body']['id']){delete _0x33a1aa[_0x69a2('0x59')]['id'];}return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x33a1aa['params']['id']},'include':[{'model':db[_0x69a2('0x3c')],'as':_0x69a2('0x3d')}]})['then'](handleEntityNotFound(_0x190850,null))['then'](saveUpdates(_0x33a1aa['body'],null))[_0x69a2('0x1e')](respondWithResult(_0x190850,null))['catch'](handleError(_0x190850,null));};exports[_0x69a2('0x35')]=function(_0x4f426a,_0x50ba3a){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x4f426a[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x50ba3a,null))[_0x69a2('0x1e')](removeEntity(_0x50ba3a,null))['catch'](handleError(_0x50ba3a,null));};exports[_0x69a2('0x63')]=function(_0x42fb8d,_0x257e3e){return db[_0x69a2('0x3f')][_0x69a2('0x63')]()[_0x69a2('0x1e')](respondWithResult(_0x257e3e,null))[_0x69a2('0x27')](handleError(_0x257e3e,null));};exports[_0x69a2('0x64')]=function(_0x133fd5,_0x4d9251,_0xec8339){if(_0x133fd5[_0x69a2('0x59')]['id']){delete _0x133fd5[_0x69a2('0x59')]['id'];}return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x133fd5['params']['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x4d9251,null))['then'](function(_0x46db07){if(_0x46db07){_0x133fd5[_0x69a2('0x59')][_0x69a2('0x65')]=_0x46db07['id'];return db[_0x69a2('0x66')][_0x69a2('0x58')](_0x133fd5['body']);}})[_0x69a2('0x1e')](respondWithResult(_0x4d9251,null))[_0x69a2('0x27')](handleError(_0x4d9251,null));};exports[_0x69a2('0x67')]=function(_0x2ba802,_0x5d359b,_0x240fc0){var _0x4ad5ed={'raw':![],'where':{}};var _0x1d4b4f={};var _0x2689a2={'count':0x0,'rows':[]};return db[_0x69a2('0x3f')][_0x69a2('0x68')]({'where':{'id':_0x2ba802[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x5d359b,null))[_0x69a2('0x1e')](function(_0x351e3d){if(_0x351e3d){_0x1d4b4f[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x66')][_0x69a2('0x55')]);_0x1d4b4f[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x2ba802[_0x69a2('0x43')]);_0x1d4b4f[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0x1d4b4f['model'],_0x1d4b4f[_0x69a2('0x43')]);_0x4ad5ed['attributes']=_['intersection'](_0x1d4b4f[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0x2ba802[_0x69a2('0x43')][_0x69a2('0x47')]));_0x4ad5ed[_0x69a2('0x46')]=_0x4ad5ed['attributes'][_0x69a2('0x48')]?_0x4ad5ed[_0x69a2('0x46')]:_0x1d4b4f[_0x69a2('0x41')];if(!_0x2ba802[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0x4ad5ed[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2ba802[_0x69a2('0x43')][_0x69a2('0x2c')]);_0x4ad5ed[_0x69a2('0x2a')]=qs['offset'](_0x2ba802[_0x69a2('0x43')]['offset']);}_0x4ad5ed[_0x69a2('0x4b')]=qs['sort'](_0x2ba802[_0x69a2('0x43')][_0x69a2('0x4c')]);_0x4ad5ed[_0x69a2('0x4f')]=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0x2ba802[_0x69a2('0x43')],_0x1d4b4f[_0x69a2('0x44')]));_0x4ad5ed[_0x69a2('0x4f')][_0x69a2('0x65')]=_0x351e3d['id'];if(_0x2ba802[_0x69a2('0x43')]['filter']){_0x4ad5ed['where']=_[_0x69a2('0x50')](_0x4ad5ed[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x4ad5ed['attributes'],function(_0x40a999){var _0x3a551c={};_0x3a551c[_0x40a999]={'$like':'%'+_0x2ba802['query'][_0x69a2('0x4e')]+'%'};return _0x3a551c;})});}_0x4ad5ed=_[_0x69a2('0x50')]({},_0x4ad5ed,_0x2ba802[_0x69a2('0x51')]);return db[_0x69a2('0x66')][_0x69a2('0x2d')]({'where':_0x4ad5ed['where']})[_0x69a2('0x1e')](function(_0x82668a){_0x2689a2['count']=_0x82668a;if(_0x2ba802[_0x69a2('0x43')]['includeAll']){_0x4ad5ed[_0x69a2('0x56')]=[{'all':!![]}];}return db[_0x69a2('0x66')]['findAll'](_0x4ad5ed);})[_0x69a2('0x1e')](function(_0x5a8e7d){_0x2689a2['rows']=_0x5a8e7d;return _0x2689a2;});}})['then'](respondWithFilteredResult(_0x5d359b,_0x4ad5ed))[_0x69a2('0x27')](handleError(_0x5d359b,null));};exports[_0x69a2('0x69')]=function(_0x3addff,_0x5211fb,_0x5642e5){return db['OpenchannelAccount'][_0x69a2('0x57')]({'where':{'id':_0x3addff[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x5211fb,null))[_0x69a2('0x1e')](function(_0x4da4ee){if(_0x4da4ee){return _0x4da4ee[_0x69a2('0x69')](_0x3addff['query'][_0x69a2('0x6a')]);}})[_0x69a2('0x1e')](respondWithStatusCode(_0x5211fb,null))[_0x69a2('0x27')](handleError(_0x5211fb,null));};exports[_0x69a2('0x6b')]=function(_0x1cf69b,_0x3b9add,_0x158233){if(_0x1cf69b[_0x69a2('0x59')]['id']){delete _0x1cf69b[_0x69a2('0x59')]['id'];}return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x1cf69b[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x3b9add,null))[_0x69a2('0x1e')](function(_0x406ffa){if(_0x406ffa){_0x1cf69b[_0x69a2('0x59')]['OpenchannelAccountId']=_0x406ffa['id'];return db[_0x69a2('0x6c')]['create'](_0x1cf69b[_0x69a2('0x59')]);}})[_0x69a2('0x1e')](respondWithResult(_0x3b9add,null))[_0x69a2('0x27')](handleError(_0x3b9add,null));};exports[_0x69a2('0x6d')]=function(_0x16e763,_0x840bf4,_0x11d8a5){var _0x2a3181={'raw':![],'where':{}};var _0x43bf96={};var _0x4a93aa={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x16e763[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x840bf4,null))['then'](function(_0xd22b47){if(_0xd22b47){_0x43bf96[_0x69a2('0x41')]=_[_0x69a2('0x42')](db['CannedAnswer']['rawAttributes']);_0x43bf96[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x16e763['query']);_0x43bf96[_0x69a2('0x44')]=_['intersection'](_0x43bf96[_0x69a2('0x41')],_0x43bf96[_0x69a2('0x43')]);_0x2a3181['attributes']=_[_0x69a2('0x45')](_0x43bf96[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0x16e763[_0x69a2('0x43')][_0x69a2('0x47')]));_0x2a3181[_0x69a2('0x46')]=_0x2a3181[_0x69a2('0x46')]['length']?_0x2a3181['attributes']:_0x43bf96[_0x69a2('0x41')];if(!_0x16e763[_0x69a2('0x43')]['hasOwnProperty'](_0x69a2('0x4a'))){_0x2a3181[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x16e763[_0x69a2('0x43')]['limit']);_0x2a3181[_0x69a2('0x2a')]=qs[_0x69a2('0x2a')](_0x16e763[_0x69a2('0x43')]['offset']);}_0x2a3181[_0x69a2('0x4b')]=qs['sort'](_0x16e763[_0x69a2('0x43')][_0x69a2('0x4c')]);_0x2a3181[_0x69a2('0x4f')]=qs[_0x69a2('0x44')](_['pick'](_0x16e763[_0x69a2('0x43')],_0x43bf96[_0x69a2('0x44')]));_0x2a3181['where'][_0x69a2('0x65')]=_0xd22b47['id'];if(_0x16e763[_0x69a2('0x43')][_0x69a2('0x4e')]){_0x2a3181[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0x2a3181[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x2a3181['attributes'],function(_0xf2d6f2){var _0xd59d73={};_0xd59d73[_0xf2d6f2]={'$like':'%'+_0x16e763[_0x69a2('0x43')][_0x69a2('0x4e')]+'%'};return _0xd59d73;})});}_0x2a3181=_[_0x69a2('0x50')]({},_0x2a3181,_0x16e763[_0x69a2('0x51')]);return db['CannedAnswer']['count']({'where':_0x2a3181[_0x69a2('0x4f')]})[_0x69a2('0x1e')](function(_0x29e604){_0x4a93aa['count']=_0x29e604;if(_0x16e763[_0x69a2('0x43')]['includeAll']){_0x2a3181[_0x69a2('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2a3181);})[_0x69a2('0x1e')](function(_0x51784a){_0x4a93aa[_0x69a2('0x6e')]=_0x51784a;return _0x4a93aa;});}})['then'](respondWithFilteredResult(_0x840bf4,_0x2a3181))['catch'](handleError(_0x840bf4,null));};exports[_0x69a2('0x6f')]=function(_0x33d92c,_0x5e8749,_0x4a6d2f){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x33d92c['params']['id']}})['then'](handleEntityNotFound(_0x5e8749,null))[_0x69a2('0x1e')](function(_0x5e88a4){if(_0x5e88a4){return _0x5e88a4[_0x69a2('0x6f')](_0x33d92c['query'][_0x69a2('0x6a')]);}})['then'](respondWithStatusCode(_0x5e8749,null))[_0x69a2('0x27')](handleError(_0x5e8749,null));};exports['notify']=function(_0xa7525d,_0x21e4af,_0x29efa0){var _0x1f6872={'body':_0xa7525d['body'],'channel':_0x69a2('0x70')};var _0x26feb2=[];var _0x253396=[];var _0x122032={};var _0x35461a=![];return db[_0x69a2('0x71')][_0x69a2('0x63')]()[_0x69a2('0x1e')](function(_0x13bf6a){if(!_0x13bf6a){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x74'));}_0x26feb2=_[_0x69a2('0x75')](_['keys'](_0x13bf6a),['createdAt',_0x69a2('0x76')]);_0x253396=_['difference'](_[_0x69a2('0x42')](_0x13bf6a),['createdAt','updatedAt',_0x69a2('0x77'),_0x69a2('0x78')]);if(_0xa7525d[_0x69a2('0x59')]['id']){delete _0xa7525d[_0x69a2('0x59')]['id'];}if(_[_0x69a2('0x79')](_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7a')])){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x7b'));}if(_[_0x69a2('0x79')](_0xa7525d['body'][_0x69a2('0x59')])||_0xa7525d['body']['body']===''){throw new db['Sequelize'][(_0x69a2('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x69a2('0x79')](_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7c')])){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x7d')+_0x253396);}if(!_[_0x69a2('0x7e')](_0x253396,_0xa7525d['body'][_0x69a2('0x7c')])){throw new db[(_0x69a2('0x72'))][(_0x69a2('0x73'))](_0x69a2('0x7f')+_0x253396);}_0x122032[_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7c')]]=_0xa7525d['body'][_0x69a2('0x7a')];})[_0x69a2('0x1e')](function(){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0xa7525d['params']['id']},'include':[{'model':db['CmList'],'as':_0x69a2('0x80'),'include':[{'model':db[_0x69a2('0x71')],'as':_0x69a2('0x81'),'where':_0x122032,'limit':0x1,'order':[[_0x69a2('0x76'),_0x69a2('0x82')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x69a2('0x1e')](handleEntityNotFound(_0x21e4af,null))[_0x69a2('0x1e')](function(_0x1bac3e){if(_0x1bac3e&&_0x1bac3e[_0x69a2('0x80')]){_0x1f6872['account']=_0x1bac3e;_0x1f6872['applications']=_0x1bac3e['Applications'];_0x1f6872[_0x69a2('0x83')]=_0x1bac3e[_0x69a2('0x80')];_0x1f6872[_0x69a2('0x84')]=_[_0x69a2('0x85')](_0x1f6872[_0x69a2('0x84')],[_0x69a2('0x86')],[_0x69a2('0x87')]);if(_0x1f6872[_0x69a2('0x88')][_0x69a2('0x89')]){delete _0x1f6872[_0x69a2('0x88')][_0x69a2('0x89')];}if(_0x1f6872[_0x69a2('0x88')][_0x69a2('0x80')]&&_0x1f6872[_0x69a2('0x88')]['List']['Contacts'][_0x69a2('0x48')]){return _0x1f6872['account'][_0x69a2('0x80')]['Contacts'][0x0];}var _0x3b9b05=_[_0x69a2('0x16')](_0xa7525d[_0x69a2('0x59')],{'firstName':_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7a')],'ListId':_0x1bac3e['ListId']});_0x3b9b05[_0xa7525d[_0x69a2('0x59')][_0x69a2('0x7c')]]=_0xa7525d['body'][_0x69a2('0x7a')];return db[_0x69a2('0x71')][_0x69a2('0x58')](_0x3b9b05,{'fields':_0x26feb2,'raw':!![]});}})[_0x69a2('0x1e')](handleEntityNotFound(_0x21e4af,null))[_0x69a2('0x1e')](function(_0x256b5d){_0x1f6872['contact']=_0x256b5d;if(_0x256b5d){var _0x4aae65={'ContactId':_0x256b5d['id'],'OpenchannelAccountId':_0xa7525d[_0x69a2('0x54')]['id'],'from':(_0x256b5d[_0x69a2('0x8a')]||'')+'\x20'+(_0x256b5d[_0x69a2('0x8b')]||'')};var _0x26577c={'OpenchannelAccountId':_0xa7525d['params']['id'],'closed':![]};if(_0xa7525d['body'][_0x69a2('0x8c')]){_0x26577c['threadId']=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8c')];return db[_0x69a2('0x8d')][_0x69a2('0x57')]({'where':_0x26577c})[_0x69a2('0x1e')](function(_0x43d3f3){if(_0x43d3f3){return[_0x43d3f3,![]];}_0x4aae65[_0x69a2('0x8c')]=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8c')];_0x4aae65[_0x69a2('0x8e')]=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8e')];return db['OpenchannelInteraction'][_0x69a2('0x58')](_0x4aae65)[_0x69a2('0x1e')](function(_0x410fc5){return[_0x410fc5,!![]];});});}else{_0x26577c['threadId']=null;}_0x26577c['ContactId']=_0x256b5d['id'];return db[_0x69a2('0x8d')]['find']({'where':_0x26577c})[_0x69a2('0x1e')](function(_0x44a856){if(_0x44a856){return[_0x44a856,![]];}return db[_0x69a2('0x8d')][_0x69a2('0x58')](_0x4aae65)[_0x69a2('0x1e')](function(_0x38fa1a){return[_0x38fa1a,!![]];});});}})['spread'](function(_0x2be60b,_0x34d133){if(_0x2be60b){_0x35461a=_0x34d133;if(!_0x34d133){var _0x150586={'from':(_0x1f6872[_0x69a2('0x8f')][_0x69a2('0x8a')]||'')+'\x20'+(_0x1f6872[_0x69a2('0x8f')][_0x69a2('0x8b')]||'')};if(_0xa7525d[_0x69a2('0x59')][_0x69a2('0x8c')]&&_0xa7525d[_0x69a2('0x59')][_0x69a2('0x90')]&&_0xa7525d[_0x69a2('0x59')]['threadId']!=_0xa7525d[_0x69a2('0x59')][_0x69a2('0x90')]){_0x150586['threadId']=_0xa7525d['body'][_0x69a2('0x90')];}return _0x2be60b[_0x69a2('0x34')](_0x150586);}else{return _0x2be60b;}}})[_0x69a2('0x1e')](function(_0x255b30){_0x1f6872[_0x69a2('0x91')]=_0x255b30[_0x69a2('0x5b')]({'plain':!![]});_0x1f6872[_0x69a2('0x91')][_0x69a2('0x92')]=_0x35461a;if(_0x1f6872[_0x69a2('0x91')][_0x69a2('0x92')]){if(_0x1f6872[_0x69a2('0x88')][_0x69a2('0x93')]){_0x1f6872[_0x69a2('0x84')]['push']({'id':0x0,'priority':_0x1f6872['applications'][_0x69a2('0x48')]+0x1,'app':'close','appdata':_0x69a2('0x94'),'interval':_0x69a2('0x95')});}}return db[_0x69a2('0x96')][_0x69a2('0x58')]({'body':_0xa7525d[_0x69a2('0x59')][_0x69a2('0x59')],'OpenchannelAccountId':_0xa7525d['params']['id'],'OpenchannelInteractionId':_0x255b30['id'],'direction':'in','ContactId':_0x1f6872[_0x69a2('0x8f')]['id'],'AttachmentId':_0xa7525d[_0x69a2('0x59')][_0x69a2('0x97')]});})[_0x69a2('0x1e')](function(_0x45a7de){_0x1f6872[_0x69a2('0x25')]=_0x45a7de;if(_0x1f6872['interaction']['UserId']){return db[_0x69a2('0x98')][_0x69a2('0x57')]({'attributes':['id','name'],'where':{'id':_0x1f6872[_0x69a2('0x91')][_0x69a2('0x99')]}})['then'](function(_0x53ed4e){if(_0x53ed4e){_0x1f6872[_0x69a2('0x84')][_0x69a2('0x9a')]({'id':0x0,'priority':0x0,'app':_0x69a2('0x9b'),'appdata':_0x53ed4e[_0x69a2('0x39')]+','+(_0x1f6872['account']['waitForTheAssignedAgent']||0xa),'interval':_0x69a2('0x95')});_0x1f6872[_0x69a2('0x9c')]=![];}return respondWithRpcPromise(_0x69a2('0x9d'),_0x69a2('0x9e'),_0x1f6872);});}return respondWithRpcPromise(_0x69a2('0x9d'),'startRouting',_0x1f6872);})['then'](function(_0x19ccd3){respondWithRpcPromise(_0x69a2('0x9f'),_0x69a2('0x9f'),{'event':_0x69a2('0xa0'),'message':_0x19ccd3},client9002);return _0x19ccd3;})['then'](respondWithResult(_0x21e4af,null))['catch'](handleError(_0x21e4af,null));};exports[_0x69a2('0xa1')]=function(_0x46c2d3,_0x2c83e3,_0xaedd91){return db[_0x69a2('0x3f')]['findOne']({'where':{'id':_0x46c2d3[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x2c83e3,null))[_0x69a2('0x1e')](function(_0x463bfd){if(_0x463bfd){return db[_0x69a2('0xa2')]['transaction'](function(_0x6450de){return db['OpenchannelApplication'][_0x69a2('0x35')]({'where':{'OpenchannelAccountId':_0x46c2d3[_0x69a2('0x54')]['id']},'transaction':_0x6450de})[_0x69a2('0x1e')](function(_0x251862){var _0x38199c=_[_0x69a2('0x3e')](_0x46c2d3[_0x69a2('0x59')],function(_0x24fcb9){_0x24fcb9[_0x69a2('0x65')]=_0x46c2d3['params']['id'];return _0x24fcb9;});return db['OpenchannelApplication'][_0x69a2('0xa3')](_0x38199c,{'transaction':_0x6450de});});})[_0x69a2('0x1e')](function(){return db[_0x69a2('0xa4')][_0x69a2('0xa5')]({'where':{'OpenchannelAccountId':_0x46c2d3[_0x69a2('0x54')]['id']},'order':_0x69a2('0x86')});});}})[_0x69a2('0x1e')](respondWithResult(_0x2c83e3,null))[_0x69a2('0x27')](handleError(_0x2c83e3,null));};exports['getApplications']=function(_0x2f90c1,_0x3ce862,_0x4cfea2){var _0x54454f={};var _0x3162f9={};var _0x29ce2b;var _0x17ac1b;return db[_0x69a2('0x3f')][_0x69a2('0x68')]({'where':{'id':_0x2f90c1[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x3ce862,null))['then'](function(_0x1ca6c4){if(_0x1ca6c4){_0x29ce2b=_0x1ca6c4;_0x3162f9[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0xa4')][_0x69a2('0x55')]);_0x3162f9[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x2f90c1[_0x69a2('0x43')]);_0x3162f9[_0x69a2('0x44')]=_[_0x69a2('0x45')](_0x3162f9[_0x69a2('0x41')],_0x3162f9[_0x69a2('0x43')]);_0x54454f['attributes']=_['intersection'](_0x3162f9['model'],qs[_0x69a2('0x47')](_0x2f90c1[_0x69a2('0x43')][_0x69a2('0x47')]));_0x54454f['attributes']=_0x54454f['attributes'][_0x69a2('0x48')]?_0x54454f['attributes']:_0x3162f9[_0x69a2('0x41')];_0x54454f['order']=qs['sort'](_0x2f90c1['query'][_0x69a2('0x4c')]);_0x54454f['where']=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0x2f90c1['query'],_0x3162f9[_0x69a2('0x44')]));if(_0x2f90c1[_0x69a2('0x43')]['filter']){_0x54454f[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0x54454f[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x54454f[_0x69a2('0x46')],function(_0x2c61bc){var _0x57dbbb={};_0x57dbbb[_0x2c61bc]={'$like':'%'+_0x2f90c1[_0x69a2('0x43')]['filter']+'%'};return _0x57dbbb;})});}_0x54454f=_[_0x69a2('0x50')]({},_0x54454f,_0x2f90c1[_0x69a2('0x51')]);return _0x29ce2b[_0x69a2('0xa6')](_0x54454f);}})['then'](function(_0x202f1c){if(_0x202f1c){_0x17ac1b=_0x202f1c[_0x69a2('0x48')];if(!_0x2f90c1[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0x54454f[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2f90c1[_0x69a2('0x43')]['limit']);_0x54454f[_0x69a2('0x2a')]=qs[_0x69a2('0x2a')](_0x2f90c1[_0x69a2('0x43')][_0x69a2('0x2a')]);}return _0x29ce2b[_0x69a2('0xa6')](_0x54454f);}})['then'](function(_0x2e3a37){if(_0x2e3a37){return _0x2e3a37?{'count':_0x17ac1b,'rows':_0x2e3a37}:null;}})[_0x69a2('0x1e')](respondWithResult(_0x3ce862,null))[_0x69a2('0x27')](handleError(_0x3ce862,null));};exports[_0x69a2('0xa7')]=function(_0xba3cac,_0x2137c4,_0x41575b){var _0x56603e={'raw':![],'where':{}};var _0x2e7efc={};var _0x5efbea={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x69a2('0x68')]({'where':{'id':_0xba3cac[_0x69a2('0x54')]['id']}})['then'](handleEntityNotFound(_0x2137c4,null))[_0x69a2('0x1e')](function(_0x6afe2b){if(_0x6afe2b){_0x2e7efc[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x8d')][_0x69a2('0x55')]);_0x2e7efc[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0xba3cac[_0x69a2('0x43')]);_0x2e7efc['filters']=_['intersection'](_0x2e7efc[_0x69a2('0x41')],_0x2e7efc[_0x69a2('0x43')]);_0x56603e[_0x69a2('0x46')]=_[_0x69a2('0x45')](_0x2e7efc[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x47')]));_0x56603e[_0x69a2('0x46')]=_0x56603e[_0x69a2('0x46')][_0x69a2('0x48')]?_0x56603e['attributes']:_0x2e7efc[_0x69a2('0x41')];if(!_0xba3cac[_0x69a2('0x43')][_0x69a2('0x49')](_0x69a2('0x4a'))){_0x56603e[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x2c')]);_0x56603e['offset']=qs[_0x69a2('0x2a')](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x2a')]);}_0x56603e[_0x69a2('0x4b')]=qs['sort'](_0xba3cac[_0x69a2('0x43')][_0x69a2('0x4c')]);_0x56603e[_0x69a2('0x4f')]=qs[_0x69a2('0x44')](_[_0x69a2('0x4d')](_0xba3cac[_0x69a2('0x43')],_0x2e7efc[_0x69a2('0x44')]));_0x56603e[_0x69a2('0x4f')][_0x69a2('0x65')]=_0x6afe2b['id'];if(_0xba3cac[_0x69a2('0x43')][_0x69a2('0x4e')]){_0x56603e[_0x69a2('0x4f')]=_[_0x69a2('0x50')](_0x56603e[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x56603e['attributes'],function(_0x5bf4b5){var _0x2878a3={};_0x2878a3[_0x5bf4b5]={'$like':'%'+_0xba3cac[_0x69a2('0x43')]['filter']+'%'};return _0x2878a3;})});}_0x56603e=_[_0x69a2('0x50')]({},_0x56603e,_0xba3cac[_0x69a2('0x51')]);return db[_0x69a2('0x8d')][_0x69a2('0x2d')]({'where':_0x56603e[_0x69a2('0x4f')]})['then'](function(_0x181a63){_0x5efbea[_0x69a2('0x2d')]=_0x181a63;if(_0xba3cac['query'][_0x69a2('0x52')]){_0x56603e[_0x69a2('0x56')]=[{'model':db[_0x69a2('0x71')],'as':_0x69a2('0xa8'),'required':![]},{'model':db[_0x69a2('0x98')],'as':'Owner','attributes':[_0x69a2('0x39'),_0x69a2('0xa9'),_0x69a2('0xaa')],'required':![]},{'model':db['Tag'],'as':_0x69a2('0xab'),'attributes':['id',_0x69a2('0x39'),_0x69a2('0xac')],'where':_0xba3cac[_0x69a2('0x43')][_0x69a2('0xad')]?{'id':_0xba3cac[_0x69a2('0x43')][_0x69a2('0xad')]}:undefined,'required':_0xba3cac[_0x69a2('0x43')][_0x69a2('0xad')]?!![]:![]}];}return db[_0x69a2('0x8d')]['findAll'](_0x56603e);})['then'](function(_0x43eb2f){_0x5efbea[_0x69a2('0x6e')]=_0x43eb2f;return _0x5efbea;});}})[_0x69a2('0x1e')](respondWithFilteredResult(_0x2137c4,_0x56603e))['catch'](handleError(_0x2137c4,null));};exports[_0x69a2('0xae')]=function(_0x129b5e,_0xa60817,_0x50e564){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0x129b5e[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0xa60817,null))[_0x69a2('0x1e')](function(_0x2d5c2b){if(_0x2d5c2b){return _0x2d5c2b[_0x69a2('0xae')](_0x129b5e['body'][_0x69a2('0x6a')],_[_0x69a2('0xaf')](_0x129b5e[_0x69a2('0x59')],[_0x69a2('0x6a'),'id'])||{})[_0x69a2('0xb0')](function(_0x2c8e8f){for(var _0x1610ad=0x0;_0x1610ad<_0x129b5e[_0x69a2('0x59')]['ids'][_0x69a2('0x48')];_0x1610ad+=0x1){socket[_0x69a2('0xb1')](_0x69a2('0xb2'),{'UserId':Number(_0x129b5e[_0x69a2('0x59')][_0x69a2('0x6a')][_0x1610ad]),'OpenchannelAccountId':Number(_0x129b5e[_0x69a2('0x54')]['id'])});}return _0x2c8e8f;});}})[_0x69a2('0x1e')](respondWithResult(_0xa60817,null))[_0x69a2('0x27')](handleError(_0xa60817,null));};exports['removeAgents']=function(_0xfaabf6,_0x17dbc3,_0xe81c8b){return db[_0x69a2('0x3f')][_0x69a2('0x57')]({'where':{'id':_0xfaabf6[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x17dbc3,null))[_0x69a2('0x1e')](function(_0x303fe3){if(_0x303fe3){return _0x303fe3['removeAgents'](_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')])[_0x69a2('0x1e')](function(){if(_[_0x69a2('0xb3')](_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')])){for(var _0x3c410e=0x0;_0x3c410e<_0xfaabf6[_0x69a2('0x43')]['ids'][_0x69a2('0x48')];_0x3c410e+=0x1){socket[_0x69a2('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')][_0x3c410e]),'OpenchannelAccountId':Number(_0xfaabf6[_0x69a2('0x54')]['id'])});}}else{socket[_0x69a2('0xb1')](_0x69a2('0xb4'),{'UserId':Number(_0xfaabf6[_0x69a2('0x43')][_0x69a2('0x6a')]),'OpenchannelAccountId':Number(_0xfaabf6['params']['id'])});}});}})[_0x69a2('0x1e')](respondWithStatusCode(_0x17dbc3,null))[_0x69a2('0x27')](handleError(_0x17dbc3,null));};exports[_0x69a2('0xb5')]=function(_0x2cc533,_0x4f48f5,_0x4e8336){var _0x3ceebb={};var _0x8fb723={};var _0x1d9d34;var _0x1ff196;return db[_0x69a2('0x3f')]['findOne']({'where':{'id':_0x2cc533[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x4f48f5,null))[_0x69a2('0x1e')](function(_0x37362f){if(_0x37362f){_0x1d9d34=_0x37362f;_0x8fb723[_0x69a2('0x41')]=_[_0x69a2('0x42')](db[_0x69a2('0x98')]['rawAttributes']);_0x8fb723[_0x69a2('0x43')]=_[_0x69a2('0x42')](_0x2cc533['query']);_0x8fb723['filters']=_['intersection'](_0x8fb723[_0x69a2('0x41')],_0x8fb723[_0x69a2('0x43')]);_0x3ceebb[_0x69a2('0x46')]=_['intersection'](_0x8fb723[_0x69a2('0x41')],qs[_0x69a2('0x47')](_0x2cc533[_0x69a2('0x43')][_0x69a2('0x47')]));_0x3ceebb[_0x69a2('0x46')]=_0x3ceebb['attributes'][_0x69a2('0x48')]?_0x3ceebb[_0x69a2('0x46')]:_0x8fb723['model'];_0x3ceebb['order']=qs[_0x69a2('0x4c')](_0x2cc533[_0x69a2('0x43')]['sort']);_0x3ceebb[_0x69a2('0x4f')]=qs['filters'](_[_0x69a2('0x4d')](_0x2cc533[_0x69a2('0x43')],_0x8fb723['filters']));if(_0x2cc533[_0x69a2('0x43')][_0x69a2('0x4e')]){_0x3ceebb[_0x69a2('0x4f')]=_['merge'](_0x3ceebb[_0x69a2('0x4f')],{'$or':_[_0x69a2('0x3e')](_0x3ceebb[_0x69a2('0x46')],function(_0xe96a62){var _0x803f1c={};_0x803f1c[_0xe96a62]={'$like':'%'+_0x2cc533[_0x69a2('0x43')][_0x69a2('0x4e')]+'%'};return _0x803f1c;})});}_0x3ceebb=_[_0x69a2('0x50')]({},_0x3ceebb,_0x2cc533[_0x69a2('0x51')]);return _0x1d9d34[_0x69a2('0xb5')](_0x3ceebb);}})[_0x69a2('0x1e')](function(_0x2fb06b){if(_0x2fb06b){_0x1ff196=_0x2fb06b[_0x69a2('0x48')];if(!_0x2cc533[_0x69a2('0x43')][_0x69a2('0x49')]('nolimit')){_0x3ceebb[_0x69a2('0x2c')]=qs[_0x69a2('0x2c')](_0x2cc533[_0x69a2('0x43')][_0x69a2('0x2c')]);_0x3ceebb[_0x69a2('0x2a')]=qs['offset'](_0x2cc533['query'][_0x69a2('0x2a')]);}return _0x1d9d34[_0x69a2('0xb5')](_0x3ceebb);}})[_0x69a2('0x1e')](function(_0x578114){if(_0x578114){return _0x578114?{'count':_0x1ff196,'rows':_0x578114}:null;}})[_0x69a2('0x1e')](respondWithResult(_0x4f48f5,null))[_0x69a2('0x27')](handleError(_0x4f48f5,null));};exports[_0x69a2('0x3a')]=function(_0x3b9c12,_0x56b5e5,_0x40f7ef){var _0x19253f,_0x2334c5,_0x2dbc6e;if(_[_0x69a2('0x79')](_0x3b9c12[_0x69a2('0x59')][_0x69a2('0x59')])||_0x3b9c12['body'][_0x69a2('0x59')]===''){throw new db[(_0x69a2('0x72'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x69a2('0x79')](_0x3b9c12[_0x69a2('0x59')]['to'])){}_0x19253f=_0x3b9c12[_0x69a2('0x59')]['to'];return db[_0x69a2('0x3f')][_0x69a2('0x68')]({'where':{'id':_0x3b9c12[_0x69a2('0x54')]['id']}})[_0x69a2('0x1e')](handleEntityNotFound(_0x56b5e5,null))[_0x69a2('0x1e')](function(_0x1ba34b){if(_0x1ba34b){return db['OpenchannelAccount'][_0x69a2('0x57')]({'where':{'id':_0x1ba34b['id']},'include':[{'model':db[_0x69a2('0xb6')],'as':_0x69a2('0x80'),'include':[{'model':db[_0x69a2('0x71')],'as':_0x69a2('0x81'),'where':{[_0x1ba34b[_0x69a2('0x7c')]]:_0x19253f},'limit':0x1,'order':[['updatedAt',_0x69a2('0x82')]]}]}]})[_0x69a2('0x1e')](handleEntityNotFound(_0x56b5e5,null))[_0x69a2('0x1e')](function(_0x376f8e){if(_0x376f8e&&_0x376f8e[_0x69a2('0x80')]){_0x2334c5=_0x376f8e[_0x69a2('0x5b')]({'plain':!![]});if(_0x2334c5['List']&&_0x2334c5[_0x69a2('0x80')]['Contacts']['length']){return _0x2334c5[_0x69a2('0x80')]['Contacts'][0x0];}return db['CmContact'][_0x69a2('0x58')](_[_0x69a2('0x16')](_0x3b9c12[_0x69a2('0x59')],{'firstName':_0x19253f,[_0x376f8e['mapKey']]:_0x19253f,'phone':_0x19253f,'ListId':_0x2334c5['ListId']}));}})[_0x69a2('0x1e')](handleEntityNotFound(_0x56b5e5,null))[_0x69a2('0x1e')](function(_0x24d568){if(_0x24d568){_0x2dbc6e=_0x24d568;return db[_0x69a2('0x8d')][_0x69a2('0x57')]({'where':{'ContactId':_0x2dbc6e['id'],'closed':![],'OpenchannelAccountId':_0x2334c5['id']}})[_0x69a2('0x1e')](function(_0x22499f){if(_0x22499f){return[_0x22499f,![]];}return db[_0x69a2('0x8d')][_0x69a2('0x58')]({'UserId':_0x3b9c12[_0x69a2('0x5a')]['id'],'ContactId':_0x2dbc6e['id'],'OpenchannelAccountId':_0x2334c5['id'],'lastMsgDirection':_0x69a2('0xb7'),'Messages':[_[_0x69a2('0x50')](_0x3b9c12[_0x69a2('0x59')],{'read':![],'body':_0x3b9c12[_0x69a2('0x59')][_0x69a2('0x59')],'OpenchannelAccountId':_0x2334c5['id'],'UserId':_0x3b9c12['user']['id'],'ContactId':_0x2dbc6e['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x69a2('0xb8')}]})[_0x69a2('0x1e')](function(_0x175244){return[_0x175244,!![]];});});}})[_0x69a2('0xb0')](function(_0x5e862f,_0x163964){if(_0x163964){return _0x5e862f;}return db[_0x69a2('0x96')][_0x69a2('0x58')](_['merge'](_0x3b9c12[_0x69a2('0x59')],{'read':![],'body':_0x3b9c12[_0x69a2('0x59')][_0x69a2('0x59')],'OpenchannelAccountId':_0x2334c5['id'],'OpenchannelInteractionId':_0x5e862f['id'],'UserId':_0x3b9c12[_0x69a2('0x5a')]['id'],'ContactId':_0x2dbc6e['id']}))[_0x69a2('0x1e')](function(_0x2b52cd){_0x5e862f[_0x69a2('0xb9')][_0x69a2('0xb8')]=[];_0x5e862f['dataValues'][_0x69a2('0xb8')][_0x69a2('0xba')](_0x2b52cd['dataValues']);return _0x5e862f;});});}})[_0x69a2('0x1e')](respondWithResult(_0x56b5e5,null))['catch'](handleError(_0x56b5e5,null));}; \ No newline at end of file +var _0xb0df=['query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','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','OpenchannelAccountId','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','pick','filter','map','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','CmContact','Contacts','DESC','OpenchannelApplication','List','applications','Applications','list','priority','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','save','update','get','OpenchannelAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount'];(function(_0x37f73c,_0x56a1b1){var _0x40f3e5=function(_0x5b011c){while(--_0x5b011c){_0x37f73c['push'](_0x37f73c['shift']());}};_0x40f3e5(++_0x56a1b1);}(_0xb0df,0x132));var _0xfb0d=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0xb0df[_0x130705];return _0x1fa991;};'use strict';var emlformat=require(_0xfb0d('0x0'));var rimraf=require(_0xfb0d('0x1'));var zipdir=require(_0xfb0d('0x2'));var jsonpatch=require(_0xfb0d('0x3'));var rp=require(_0xfb0d('0x4'));var moment=require(_0xfb0d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfb0d('0x6'));var util=require('util');var path=require(_0xfb0d('0x7'));var sox=require(_0xfb0d('0x8'));var csv=require('to-csv');var ejs=require(_0xfb0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb0d('0xa'));var squel=require(_0xfb0d('0xb'));var crypto=require(_0xfb0d('0xc'));var jsforce=require(_0xfb0d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfb0d('0xe'));var Papa=require(_0xfb0d('0xf'));var Redis=require('ioredis');var authService=require(_0xfb0d('0x10'));var qs=require(_0xfb0d('0x11'));var as=require(_0xfb0d('0x12'));var hardwareService=require(_0xfb0d('0x13'));var logger=require(_0xfb0d('0x14'))('api');var utils=require(_0xfb0d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfb0d('0x16'));var db=require(_0xfb0d('0x17'))['db'];config[_0xfb0d('0x18')]=_[_0xfb0d('0x19')](config['redis'],{'host':_0xfb0d('0x1a'),'port':0x18eb});var socket=require(_0xfb0d('0x1b'))(new Redis(config[_0xfb0d('0x18')]));require('./openchannelAccount.socket')[_0xfb0d('0x1c')](socket);var jayson=require(_0xfb0d('0x1d'));var client=jayson[_0xfb0d('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xfb0d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x11e33b,_0x3e4b46,_0x203e7c,_0x3ad4de){return new BPromise(function(_0x107696,_0xda37c2){var _0x1f8666=_0x3ad4de||client;return _0x1f8666[_0xfb0d('0x20')](_0x11e33b,_0x203e7c)[_0xfb0d('0x21')](function(_0x3aa523){logger[_0xfb0d('0x22')](_0xfb0d('0x23'),_0x3e4b46,_0xfb0d('0x24'));logger[_0xfb0d('0x25')](_0xfb0d('0x26'),_0x3e4b46,'request\x20sent',JSON[_0xfb0d('0x27')](_0x3aa523));if(_0x3aa523[_0xfb0d('0x28')]){if(_0x3aa523[_0xfb0d('0x28')][_0xfb0d('0x29')]===0x1f4){logger[_0xfb0d('0x28')](_0xfb0d('0x23'),_0x3e4b46,_0x3aa523[_0xfb0d('0x28')][_0xfb0d('0x2a')]);return _0xda37c2(_0x3aa523[_0xfb0d('0x28')][_0xfb0d('0x2a')]);}logger['error'](_0xfb0d('0x23'),_0x3e4b46,_0x3aa523[_0xfb0d('0x28')][_0xfb0d('0x2a')]);return _0x107696(_0x3aa523[_0xfb0d('0x28')]['message']);}else{logger[_0xfb0d('0x22')](_0xfb0d('0x23'),_0x3e4b46,_0xfb0d('0x24'));_0x107696(_0x3aa523[_0xfb0d('0x2b')]['message']);}})[_0xfb0d('0x2c')](function(_0x127d99){logger[_0xfb0d('0x28')](_0xfb0d('0x23'),_0x3e4b46,_0x127d99);_0xda37c2(_0x127d99);});});}function respondWithStatusCode(_0x5eb8c6,_0x33f2c5){_0x33f2c5=_0x33f2c5||0xcc;return function(_0x2202b6){if(_0x2202b6){return _0x5eb8c6[_0xfb0d('0x2d')](_0x33f2c5);}return _0x5eb8c6['status'](_0x33f2c5)[_0xfb0d('0x2e')]();};}function respondWithResult(_0x6de2b6,_0x13c545){_0x13c545=_0x13c545||0xc8;return function(_0x396c03){if(_0x396c03){return _0x6de2b6['status'](_0x13c545)[_0xfb0d('0x2f')](_0x396c03);}};}function respondWithFilteredResult(_0x5769be,_0x35beca){return function(_0x1ade75){if(_0x1ade75){var _0x511e2e=typeof _0x35beca[_0xfb0d('0x30')]===_0xfb0d('0x31')&&typeof _0x35beca['limit']==='undefined';var _0x2536a5=_0x1ade75[_0xfb0d('0x32')];var _0x3e5e92=_0x511e2e?0x0:_0x35beca[_0xfb0d('0x30')];var _0x2729a1=_0x511e2e?_0x1ade75[_0xfb0d('0x32')]:_0x35beca['offset']+_0x35beca[_0xfb0d('0x33')];var _0x30f726;if(_0x2729a1>=_0x2536a5){_0x2729a1=_0x2536a5;_0x30f726=0xc8;}else{_0x30f726=0xce;}_0x5769be[_0xfb0d('0x34')](_0x30f726);return _0x5769be[_0xfb0d('0x35')]('Content-Range',_0x3e5e92+'-'+_0x2729a1+'/'+_0x2536a5)[_0xfb0d('0x2f')](_0x1ade75);}return null;};}function patchUpdates(_0x50ea70){return function(_0x49b487){try{jsonpatch['apply'](_0x49b487,_0x50ea70,!![]);}catch(_0x52bc49){return BPromise['reject'](_0x52bc49);}return _0x49b487[_0xfb0d('0x36')]();};}function saveUpdates(_0x558289,_0x52ed42){return function(_0x3479f2){if(_0x3479f2){return _0x3479f2[_0xfb0d('0x37')](_0x558289)[_0xfb0d('0x21')](function(_0x2e3a31){return _0x2e3a31;});}return null;};}function removeEntity(_0xdfaa27,_0x777135){return function(_0x34f3b6){if(_0x34f3b6){return _0x34f3b6['destroy']()['then'](function(){var _0x53d9c4=_0x34f3b6[_0xfb0d('0x38')]({'plain':!![]});var _0x139232=_0xfb0d('0x39');return db[_0xfb0d('0x3a')]['destroy']({'where':{'type':_0x139232,'resourceId':_0x53d9c4['id']}})[_0xfb0d('0x21')](function(){return _0x34f3b6;});})[_0xfb0d('0x21')](function(){_0xdfaa27[_0xfb0d('0x34')](0xcc)[_0xfb0d('0x2e')]();});}};}function handleEntityNotFound(_0x5e97ac,_0x2d00a5){return function(_0x2b663e){if(!_0x2b663e){_0x5e97ac['sendStatus'](0x194);}return _0x2b663e;};}function handleError(_0x4d993c,_0x387801){_0x387801=_0x387801||0x1f4;return function(_0x505e28){logger[_0xfb0d('0x28')](_0x505e28['stack']);if(_0x505e28[_0xfb0d('0x3b')]){delete _0x505e28[_0xfb0d('0x3b')];}_0x4d993c[_0xfb0d('0x34')](_0x387801)[_0xfb0d('0x3c')](_0x505e28);};}exports['index']=function(_0x3a11a6,_0x24e2d7){var _0x3a2524={'include':[{'model':db[_0xfb0d('0x3d')],'as':_0xfb0d('0x3e')}]},_0x112360={},_0x1d1fc8={'count':0x0,'rows':[]};var _0x1410cb=_['map'](db[_0xfb0d('0x3f')]['rawAttributes'],function(_0x4dd140){return{'name':_0x4dd140['fieldName'],'type':_0x4dd140['type']['key']};});_0x112360['model']=_['map'](_0x1410cb,_0xfb0d('0x3b'));_0x112360[_0xfb0d('0x40')]=_['keys'](_0x3a11a6[_0xfb0d('0x40')]);_0x112360[_0xfb0d('0x41')]=_['intersection'](_0x112360['model'],_0x112360[_0xfb0d('0x40')]);_0x3a2524[_0xfb0d('0x42')]=_[_0xfb0d('0x43')](_0x112360[_0xfb0d('0x44')],qs['fields'](_0x3a11a6[_0xfb0d('0x40')][_0xfb0d('0x45')]));_0x3a2524[_0xfb0d('0x42')]=_0x3a2524[_0xfb0d('0x42')][_0xfb0d('0x46')]?_0x3a2524['attributes']:_0x112360[_0xfb0d('0x44')];if(!_0x3a11a6['query']['hasOwnProperty'](_0xfb0d('0x47'))){_0x3a2524[_0xfb0d('0x33')]=qs[_0xfb0d('0x33')](_0x3a11a6['query'][_0xfb0d('0x33')]);_0x3a2524[_0xfb0d('0x30')]=qs[_0xfb0d('0x30')](_0x3a11a6['query'][_0xfb0d('0x30')]);}_0x3a2524[_0xfb0d('0x48')]=qs[_0xfb0d('0x49')](_0x3a11a6[_0xfb0d('0x40')][_0xfb0d('0x49')]);_0x3a2524[_0xfb0d('0x4a')]=qs['filters'](_['pick'](_0x3a11a6[_0xfb0d('0x40')],_0x112360[_0xfb0d('0x41')]),_0x1410cb);if(_0x3a11a6['query']['filter']){_0x3a2524[_0xfb0d('0x4a')]=_['merge'](_0x3a2524['where'],{'$or':_['map'](_0x1410cb,function(_0xab3467){if(_0xab3467['type']!==_0xfb0d('0x4b')){var _0x3170ef={};_0x3170ef[_0xab3467[_0xfb0d('0x3b')]]={'$like':'%'+_0x3a11a6[_0xfb0d('0x40')]['filter']+'%'};return _0x3170ef;}})});}_0x3a2524=_[_0xfb0d('0x4c')]({},_0x3a2524,_0x3a11a6[_0xfb0d('0x4d')]);var _0x23cb3f={'where':_0x3a2524['where']};return db['OpenchannelAccount'][_0xfb0d('0x32')](_0x23cb3f)[_0xfb0d('0x21')](function(_0x338316){_0x1d1fc8['count']=_0x338316;if(_0x3a11a6['query']['includeAll']){_0x3a2524[_0xfb0d('0x4e')]=[{'all':!![]}];}return db[_0xfb0d('0x3f')][_0xfb0d('0x4f')](_0x3a2524);})['then'](function(_0x20f8c8){_0x1d1fc8[_0xfb0d('0x50')]=_0x20f8c8;return _0x1d1fc8;})[_0xfb0d('0x21')](respondWithFilteredResult(_0x24e2d7,_0x3a2524))[_0xfb0d('0x2c')](handleError(_0x24e2d7,null));};exports[_0xfb0d('0x51')]=function(_0x3f4414,_0x129a84){var _0x3d0d8a={'raw':![],'where':{'id':_0x3f4414[_0xfb0d('0x52')]['id']},'include':[{'model':db[_0xfb0d('0x3d')],'as':_0xfb0d('0x3e')}]},_0xd8b1fe={};_0xd8b1fe['model']=_[_0xfb0d('0x53')](db[_0xfb0d('0x3f')]['rawAttributes']);_0xd8b1fe[_0xfb0d('0x40')]=_['keys'](_0x3f4414[_0xfb0d('0x40')]);_0xd8b1fe[_0xfb0d('0x41')]=_['intersection'](_0xd8b1fe['model'],_0xd8b1fe[_0xfb0d('0x40')]);_0x3d0d8a[_0xfb0d('0x42')]=_[_0xfb0d('0x43')](_0xd8b1fe[_0xfb0d('0x44')],qs[_0xfb0d('0x45')](_0x3f4414[_0xfb0d('0x40')][_0xfb0d('0x45')]));_0x3d0d8a[_0xfb0d('0x42')]=_0x3d0d8a[_0xfb0d('0x42')][_0xfb0d('0x46')]?_0x3d0d8a['attributes']:_0xd8b1fe[_0xfb0d('0x44')];if(_0x3f4414['query'][_0xfb0d('0x54')]){_0x3d0d8a[_0xfb0d('0x4e')]=[{'all':!![]}];}_0x3d0d8a=_[_0xfb0d('0x4c')]({},_0x3d0d8a,_0x3f4414[_0xfb0d('0x4d')]);return db[_0xfb0d('0x3f')][_0xfb0d('0x55')](_0x3d0d8a)['then'](handleEntityNotFound(_0x129a84,null))['then'](respondWithResult(_0x129a84,null))[_0xfb0d('0x2c')](handleError(_0x129a84,null));};exports[_0xfb0d('0x56')]=function(_0x2517ff,_0x1f7396){return db[_0xfb0d('0x3f')][_0xfb0d('0x56')](_0x2517ff[_0xfb0d('0x57')],{})[_0xfb0d('0x21')](function(_0x3e0112){var _0x124cc5=_0x2517ff[_0xfb0d('0x58')][_0xfb0d('0x38')]({'plain':!![]});if(!_0x124cc5)throw new Error(_0xfb0d('0x59'));if(_0x124cc5[_0xfb0d('0x5a')]===_0xfb0d('0x58')){var _0x2616e9=_0x3e0112[_0xfb0d('0x38')]({'plain':!![]});var _0x2f934b=_0xfb0d('0x39');return db[_0xfb0d('0x5b')][_0xfb0d('0x55')]({'where':{'name':_0x2f934b,'userProfileId':_0x124cc5[_0xfb0d('0x5c')]},'raw':!![]})[_0xfb0d('0x21')](function(_0x1965c1){if(_0x1965c1&&_0x1965c1[_0xfb0d('0x5d')]===0x0){return db[_0xfb0d('0x3a')][_0xfb0d('0x56')]({'name':_0x2616e9[_0xfb0d('0x3b')],'resourceId':_0x2616e9['id'],'type':_0x1965c1['name'],'sectionId':_0x1965c1['id']},{})[_0xfb0d('0x21')](function(){return _0x3e0112;});}else{return _0x3e0112;}})['catch'](function(_0x47bca5){logger[_0xfb0d('0x28')](_0xfb0d('0x5e'),_0x47bca5);throw _0x47bca5;});}return _0x3e0112;})['then'](respondWithResult(_0x1f7396,0xc9))[_0xfb0d('0x2c')](handleError(_0x1f7396,null));};exports[_0xfb0d('0x37')]=function(_0x51a92e,_0x3c6298){if(_0x51a92e[_0xfb0d('0x57')]['id']){delete _0x51a92e[_0xfb0d('0x57')]['id'];}return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0x51a92e['params']['id']},'include':[{'model':db['Pause'],'as':_0xfb0d('0x3e')}]})['then'](handleEntityNotFound(_0x3c6298,null))[_0xfb0d('0x21')](saveUpdates(_0x51a92e[_0xfb0d('0x57')],null))[_0xfb0d('0x21')](respondWithResult(_0x3c6298,null))[_0xfb0d('0x2c')](handleError(_0x3c6298,null));};exports[_0xfb0d('0x5f')]=function(_0x6183eb,_0xe8db86){return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0x6183eb[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0xe8db86,null))[_0xfb0d('0x21')](removeEntity(_0xe8db86,null))[_0xfb0d('0x2c')](handleError(_0xe8db86,null));};exports[_0xfb0d('0x60')]=function(_0x4f2048,_0x3a2332){return db['OpenchannelAccount'][_0xfb0d('0x60')]()[_0xfb0d('0x21')](respondWithResult(_0x3a2332,null))[_0xfb0d('0x2c')](handleError(_0x3a2332,null));};exports['addDisposition']=function(_0x340ee0,_0x2b926e,_0x354aca){if(_0x340ee0[_0xfb0d('0x57')]['id']){delete _0x340ee0[_0xfb0d('0x57')]['id'];}return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0x340ee0['params']['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x2b926e,null))['then'](function(_0x409d79){if(_0x409d79){_0x340ee0[_0xfb0d('0x57')][_0xfb0d('0x61')]=_0x409d79['id'];return db[_0xfb0d('0x62')][_0xfb0d('0x56')](_0x340ee0[_0xfb0d('0x57')]);}})[_0xfb0d('0x21')](respondWithResult(_0x2b926e,null))['catch'](handleError(_0x2b926e,null));};exports[_0xfb0d('0x63')]=function(_0x2469db,_0x46207f,_0x561528){var _0x22ecbc={'raw':![],'where':{}};var _0x34e597={};var _0x549d9c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfb0d('0x64')]({'where':{'id':_0x2469db[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x46207f,null))['then'](function(_0x2b2fd2){if(_0x2b2fd2){_0x34e597[_0xfb0d('0x44')]=_[_0xfb0d('0x53')](db[_0xfb0d('0x62')][_0xfb0d('0x65')]);_0x34e597[_0xfb0d('0x40')]=_[_0xfb0d('0x53')](_0x2469db['query']);_0x34e597[_0xfb0d('0x41')]=_[_0xfb0d('0x43')](_0x34e597['model'],_0x34e597[_0xfb0d('0x40')]);_0x22ecbc['attributes']=_[_0xfb0d('0x43')](_0x34e597[_0xfb0d('0x44')],qs[_0xfb0d('0x45')](_0x2469db[_0xfb0d('0x40')][_0xfb0d('0x45')]));_0x22ecbc[_0xfb0d('0x42')]=_0x22ecbc['attributes'][_0xfb0d('0x46')]?_0x22ecbc['attributes']:_0x34e597['model'];if(!_0x2469db[_0xfb0d('0x40')][_0xfb0d('0x66')](_0xfb0d('0x47'))){_0x22ecbc[_0xfb0d('0x33')]=qs[_0xfb0d('0x33')](_0x2469db[_0xfb0d('0x40')][_0xfb0d('0x33')]);_0x22ecbc[_0xfb0d('0x30')]=qs['offset'](_0x2469db[_0xfb0d('0x40')]['offset']);}_0x22ecbc[_0xfb0d('0x48')]=qs[_0xfb0d('0x49')](_0x2469db['query']['sort']);_0x22ecbc[_0xfb0d('0x4a')]=qs[_0xfb0d('0x41')](_[_0xfb0d('0x67')](_0x2469db['query'],_0x34e597['filters']));_0x22ecbc['where']['OpenchannelAccountId']=_0x2b2fd2['id'];if(_0x2469db[_0xfb0d('0x40')][_0xfb0d('0x68')]){_0x22ecbc['where']=_['merge'](_0x22ecbc[_0xfb0d('0x4a')],{'$or':_[_0xfb0d('0x69')](_0x22ecbc[_0xfb0d('0x42')],function(_0x5731d7){var _0x49c88a={};_0x49c88a[_0x5731d7]={'$like':'%'+_0x2469db[_0xfb0d('0x40')][_0xfb0d('0x68')]+'%'};return _0x49c88a;})});}_0x22ecbc=_[_0xfb0d('0x4c')]({},_0x22ecbc,_0x2469db[_0xfb0d('0x4d')]);return db[_0xfb0d('0x62')]['count']({'where':_0x22ecbc[_0xfb0d('0x4a')]})[_0xfb0d('0x21')](function(_0x1616cd){_0x549d9c[_0xfb0d('0x32')]=_0x1616cd;if(_0x2469db['query'][_0xfb0d('0x54')]){_0x22ecbc['include']=[{'all':!![]}];}return db[_0xfb0d('0x62')][_0xfb0d('0x4f')](_0x22ecbc);})['then'](function(_0x48f731){_0x549d9c[_0xfb0d('0x50')]=_0x48f731;return _0x549d9c;});}})[_0xfb0d('0x21')](respondWithFilteredResult(_0x46207f,_0x22ecbc))[_0xfb0d('0x2c')](handleError(_0x46207f,null));};exports[_0xfb0d('0x6a')]=function(_0xc97772,_0x19d282,_0x53e1a7){return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0xc97772[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x19d282,null))[_0xfb0d('0x21')](function(_0x5bf286){if(_0x5bf286){return _0x5bf286[_0xfb0d('0x6a')](_0xc97772[_0xfb0d('0x40')]['ids']);}})[_0xfb0d('0x21')](respondWithStatusCode(_0x19d282,null))['catch'](handleError(_0x19d282,null));};exports[_0xfb0d('0x6b')]=function(_0x576858,_0x412857,_0xfc18e1){if(_0x576858[_0xfb0d('0x57')]['id']){delete _0x576858[_0xfb0d('0x57')]['id'];}return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0x576858[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x412857,null))['then'](function(_0x4ec02d){if(_0x4ec02d){_0x576858[_0xfb0d('0x57')][_0xfb0d('0x61')]=_0x4ec02d['id'];return db[_0xfb0d('0x6c')][_0xfb0d('0x56')](_0x576858[_0xfb0d('0x57')]);}})[_0xfb0d('0x21')](respondWithResult(_0x412857,null))[_0xfb0d('0x2c')](handleError(_0x412857,null));};exports[_0xfb0d('0x6d')]=function(_0x4006a8,_0x310cb3,_0x754497){var _0x13d337={'raw':![],'where':{}};var _0x2f0a99={};var _0x59e278={'count':0x0,'rows':[]};return db[_0xfb0d('0x3f')][_0xfb0d('0x64')]({'where':{'id':_0x4006a8[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x310cb3,null))[_0xfb0d('0x21')](function(_0xc5b478){if(_0xc5b478){_0x2f0a99[_0xfb0d('0x44')]=_[_0xfb0d('0x53')](db[_0xfb0d('0x6c')][_0xfb0d('0x65')]);_0x2f0a99[_0xfb0d('0x40')]=_[_0xfb0d('0x53')](_0x4006a8['query']);_0x2f0a99['filters']=_[_0xfb0d('0x43')](_0x2f0a99['model'],_0x2f0a99[_0xfb0d('0x40')]);_0x13d337[_0xfb0d('0x42')]=_[_0xfb0d('0x43')](_0x2f0a99[_0xfb0d('0x44')],qs[_0xfb0d('0x45')](_0x4006a8[_0xfb0d('0x40')]['fields']));_0x13d337[_0xfb0d('0x42')]=_0x13d337[_0xfb0d('0x42')]['length']?_0x13d337[_0xfb0d('0x42')]:_0x2f0a99[_0xfb0d('0x44')];if(!_0x4006a8['query'][_0xfb0d('0x66')](_0xfb0d('0x47'))){_0x13d337['limit']=qs[_0xfb0d('0x33')](_0x4006a8[_0xfb0d('0x40')]['limit']);_0x13d337[_0xfb0d('0x30')]=qs[_0xfb0d('0x30')](_0x4006a8[_0xfb0d('0x40')][_0xfb0d('0x30')]);}_0x13d337[_0xfb0d('0x48')]=qs[_0xfb0d('0x49')](_0x4006a8[_0xfb0d('0x40')][_0xfb0d('0x49')]);_0x13d337['where']=qs[_0xfb0d('0x41')](_['pick'](_0x4006a8[_0xfb0d('0x40')],_0x2f0a99[_0xfb0d('0x41')]));_0x13d337[_0xfb0d('0x4a')][_0xfb0d('0x61')]=_0xc5b478['id'];if(_0x4006a8[_0xfb0d('0x40')]['filter']){_0x13d337[_0xfb0d('0x4a')]=_[_0xfb0d('0x4c')](_0x13d337[_0xfb0d('0x4a')],{'$or':_[_0xfb0d('0x69')](_0x13d337[_0xfb0d('0x42')],function(_0x32dafe){var _0x535be5={};_0x535be5[_0x32dafe]={'$like':'%'+_0x4006a8['query'][_0xfb0d('0x68')]+'%'};return _0x535be5;})});}_0x13d337=_[_0xfb0d('0x4c')]({},_0x13d337,_0x4006a8['options']);return db[_0xfb0d('0x6c')][_0xfb0d('0x32')]({'where':_0x13d337['where']})[_0xfb0d('0x21')](function(_0x4e4fe1){_0x59e278[_0xfb0d('0x32')]=_0x4e4fe1;if(_0x4006a8[_0xfb0d('0x40')]['includeAll']){_0x13d337['include']=[{'all':!![]}];}return db[_0xfb0d('0x6c')]['findAll'](_0x13d337);})[_0xfb0d('0x21')](function(_0x49c05b){_0x59e278['rows']=_0x49c05b;return _0x59e278;});}})[_0xfb0d('0x21')](respondWithFilteredResult(_0x310cb3,_0x13d337))['catch'](handleError(_0x310cb3,null));};exports[_0xfb0d('0x6e')]=function(_0x296d4f,_0x4cef88,_0xb224ec){return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0x296d4f[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x4cef88,null))[_0xfb0d('0x21')](function(_0x5695a2){if(_0x5695a2){return _0x5695a2[_0xfb0d('0x6e')](_0x296d4f['query'][_0xfb0d('0x6f')]);}})[_0xfb0d('0x21')](respondWithStatusCode(_0x4cef88,null))[_0xfb0d('0x2c')](handleError(_0x4cef88,null));};exports[_0xfb0d('0x70')]=function(_0x2045e2,_0x527ae3,_0x104323){var _0x79c999={'body':_0x2045e2[_0xfb0d('0x57')],'channel':'openchannel'};var _0x8e53bf=[];var _0x511573=[];var _0x24b242={};var _0x20a258=![];return db['CmContact']['describe']()[_0xfb0d('0x21')](function(_0x3f71ca){if(!_0x3f71ca){throw new db[(_0xfb0d('0x71'))][(_0xfb0d('0x72'))]('no\x20available\x20attributes');}_0x8e53bf=_[_0xfb0d('0x73')](_['keys'](_0x3f71ca),[_0xfb0d('0x74'),_0xfb0d('0x75')]);_0x511573=_[_0xfb0d('0x73')](_[_0xfb0d('0x53')](_0x3f71ca),[_0xfb0d('0x74'),_0xfb0d('0x75'),_0xfb0d('0x76'),_0xfb0d('0x77')]);if(_0x2045e2[_0xfb0d('0x57')]['id']){delete _0x2045e2[_0xfb0d('0x57')]['id'];}if(_['isNil'](_0x2045e2['body'][_0xfb0d('0x78')])){throw new db[(_0xfb0d('0x71'))]['ValidationError'](_0xfb0d('0x79'));}if(_[_0xfb0d('0x7a')](_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x57')])||_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x57')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfb0d('0x7a')](_0x2045e2[_0xfb0d('0x57')]['mapKey'])){throw new db[(_0xfb0d('0x71'))][(_0xfb0d('0x72'))](_0xfb0d('0x7b')+_0x511573);}if(!_[_0xfb0d('0x7c')](_0x511573,_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x7d')])){throw new db[(_0xfb0d('0x71'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x511573);}_0x24b242[_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x7d')]]=_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x78')];})[_0xfb0d('0x21')](function(){return db[_0xfb0d('0x3f')][_0xfb0d('0x55')]({'where':{'id':_0x2045e2[_0xfb0d('0x52')]['id']},'include':[{'model':db[_0xfb0d('0x7e')],'as':'List','include':[{'model':db[_0xfb0d('0x7f')],'as':_0xfb0d('0x80'),'where':_0x24b242,'limit':0x1,'order':[[_0xfb0d('0x75'),_0xfb0d('0x81')]]}]},{'model':db[_0xfb0d('0x82')],'as':'Applications'}]});})[_0xfb0d('0x21')](handleEntityNotFound(_0x527ae3,null))[_0xfb0d('0x21')](function(_0x342e0e){if(_0x342e0e&&_0x342e0e[_0xfb0d('0x83')]){_0x79c999['account']=_0x342e0e;_0x79c999[_0xfb0d('0x84')]=_0x342e0e[_0xfb0d('0x85')];_0x79c999[_0xfb0d('0x86')]=_0x342e0e[_0xfb0d('0x83')];_0x79c999['applications']=_['orderBy'](_0x79c999[_0xfb0d('0x84')],[_0xfb0d('0x87')],['asc']);if(_0x79c999[_0xfb0d('0x88')][_0xfb0d('0x85')]){delete _0x79c999[_0xfb0d('0x88')][_0xfb0d('0x85')];}if(_0x79c999['account']['List']&&_0x79c999[_0xfb0d('0x88')][_0xfb0d('0x83')][_0xfb0d('0x80')][_0xfb0d('0x46')]){return _0x79c999['account'][_0xfb0d('0x83')][_0xfb0d('0x80')][0x0];}var _0x1c0c0d=_[_0xfb0d('0x19')](_0x2045e2[_0xfb0d('0x57')],{'firstName':_0x2045e2['body'][_0xfb0d('0x78')],'ListId':_0x342e0e[_0xfb0d('0x77')]});_0x1c0c0d[_0x2045e2['body'][_0xfb0d('0x7d')]]=_0x2045e2['body'][_0xfb0d('0x78')];return db[_0xfb0d('0x7f')][_0xfb0d('0x56')](_0x1c0c0d,{'fields':_0x8e53bf,'raw':!![]});}})[_0xfb0d('0x21')](handleEntityNotFound(_0x527ae3,null))[_0xfb0d('0x21')](function(_0x476cc9){_0x79c999[_0xfb0d('0x89')]=_0x476cc9;if(_0x476cc9){var _0x421e28={'ContactId':_0x476cc9['id'],'OpenchannelAccountId':_0x2045e2['params']['id'],'from':(_0x476cc9[_0xfb0d('0x8a')]||'')+'\x20'+(_0x476cc9[_0xfb0d('0x8b')]||'')};var _0x229d60={'OpenchannelAccountId':_0x2045e2['params']['id'],'closed':![]};if(_0x2045e2['body']['threadId']){_0x229d60[_0xfb0d('0x8c')]=_0x2045e2['body']['threadId'];return db[_0xfb0d('0x8d')][_0xfb0d('0x55')]({'where':_0x229d60})[_0xfb0d('0x21')](function(_0x4681d1){if(_0x4681d1){return[_0x4681d1,![]];}_0x421e28[_0xfb0d('0x8c')]=_0x2045e2['body']['threadId'];_0x421e28[_0xfb0d('0x8e')]=_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x8e')];return db['OpenchannelInteraction']['create'](_0x421e28)[_0xfb0d('0x21')](function(_0x108d34){return[_0x108d34,!![]];});});}else{_0x229d60[_0xfb0d('0x8c')]=null;}_0x229d60[_0xfb0d('0x8f')]=_0x476cc9['id'];return db[_0xfb0d('0x8d')]['find']({'where':_0x229d60})['then'](function(_0x3f1c60){if(_0x3f1c60){return[_0x3f1c60,![]];}return db['OpenchannelInteraction'][_0xfb0d('0x56')](_0x421e28)[_0xfb0d('0x21')](function(_0x136384){return[_0x136384,!![]];});});}})[_0xfb0d('0x90')](function(_0x55511b,_0x5b7adc){if(_0x55511b){_0x20a258=_0x5b7adc;if(!_0x5b7adc){var _0x34c0b1={'from':(_0x79c999[_0xfb0d('0x89')][_0xfb0d('0x8a')]||'')+'\x20'+(_0x79c999[_0xfb0d('0x89')]['lastName']||'')};if(_0x2045e2[_0xfb0d('0x57')]['threadId']&&_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x91')]&&_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x8c')]!=_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x91')]){_0x34c0b1[_0xfb0d('0x8c')]=_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x91')];}return _0x55511b[_0xfb0d('0x37')](_0x34c0b1);}else{return _0x55511b;}}})[_0xfb0d('0x21')](function(_0x33f443){_0x79c999[_0xfb0d('0x92')]=_0x33f443[_0xfb0d('0x38')]({'plain':!![]});_0x79c999[_0xfb0d('0x92')][_0xfb0d('0x93')]=_0x20a258;if(_0x79c999[_0xfb0d('0x92')][_0xfb0d('0x93')]){if(_0x79c999[_0xfb0d('0x88')][_0xfb0d('0x94')]){_0x79c999[_0xfb0d('0x84')][_0xfb0d('0x95')]({'id':0x0,'priority':_0x79c999[_0xfb0d('0x84')]['length']+0x1,'app':_0xfb0d('0x96'),'appdata':_0xfb0d('0x97'),'interval':_0xfb0d('0x98')});}}return db[_0xfb0d('0x99')]['create']({'body':_0x2045e2[_0xfb0d('0x57')][_0xfb0d('0x57')],'OpenchannelAccountId':_0x2045e2['params']['id'],'OpenchannelInteractionId':_0x33f443['id'],'direction':'in','ContactId':_0x79c999[_0xfb0d('0x89')]['id'],'AttachmentId':_0x2045e2['body']['AttachmentId']});})[_0xfb0d('0x21')](function(_0x5615b1){_0x79c999[_0xfb0d('0x2a')]=_0x5615b1;if(_0x79c999[_0xfb0d('0x92')][_0xfb0d('0x9a')]){return db[_0xfb0d('0x9b')][_0xfb0d('0x55')]({'attributes':['id',_0xfb0d('0x3b')],'where':{'id':_0x79c999[_0xfb0d('0x92')][_0xfb0d('0x9a')]}})[_0xfb0d('0x21')](function(_0x7dc4b3){if(_0x7dc4b3){_0x79c999[_0xfb0d('0x84')][_0xfb0d('0x9c')]({'id':0x0,'priority':0x0,'app':_0xfb0d('0x9d'),'appdata':_0x7dc4b3[_0xfb0d('0x3b')]+','+(_0x79c999[_0xfb0d('0x88')][_0xfb0d('0x9e')]||0xa),'interval':_0xfb0d('0x98')});_0x79c999[_0xfb0d('0x9f')]=![];}return respondWithRpcPromise(_0xfb0d('0xa0'),_0xfb0d('0xa1'),_0x79c999);});}return respondWithRpcPromise(_0xfb0d('0xa0'),'startRouting',_0x79c999);})[_0xfb0d('0x21')](function(_0x5d3ffe){respondWithRpcPromise(_0xfb0d('0xa2'),_0xfb0d('0xa2'),{'event':_0xfb0d('0x70'),'message':_0x5d3ffe},client9002);return _0x5d3ffe;})[_0xfb0d('0x21')](respondWithResult(_0x527ae3,null))[_0xfb0d('0x2c')](handleError(_0x527ae3,null));};exports[_0xfb0d('0xa3')]=function(_0x223b91,_0xa2afe1,_0x50f878){return db[_0xfb0d('0x3f')][_0xfb0d('0x64')]({'where':{'id':_0x223b91[_0xfb0d('0x52')]['id']}})['then'](handleEntityNotFound(_0xa2afe1,null))[_0xfb0d('0x21')](function(_0x36d117){if(_0x36d117){return db['sequelize'][_0xfb0d('0xa4')](function(_0x588c3d){return db[_0xfb0d('0x82')][_0xfb0d('0x5f')]({'where':{'OpenchannelAccountId':_0x223b91[_0xfb0d('0x52')]['id']},'transaction':_0x588c3d})[_0xfb0d('0x21')](function(_0x59a114){var _0x26c259=_[_0xfb0d('0x69')](_0x223b91[_0xfb0d('0x57')],function(_0x535a76){_0x535a76[_0xfb0d('0x61')]=_0x223b91[_0xfb0d('0x52')]['id'];return _0x535a76;});return db[_0xfb0d('0x82')][_0xfb0d('0xa5')](_0x26c259,{'transaction':_0x588c3d});});})['then'](function(){return db['OpenchannelApplication'][_0xfb0d('0xa6')]({'where':{'OpenchannelAccountId':_0x223b91[_0xfb0d('0x52')]['id']},'order':'priority'});});}})[_0xfb0d('0x21')](respondWithResult(_0xa2afe1,null))[_0xfb0d('0x2c')](handleError(_0xa2afe1,null));};exports[_0xfb0d('0xa7')]=function(_0x178d4b,_0x5c72fb,_0x5cfe74){var _0x27e591={};var _0xba4686={};var _0x4ead4a;var _0x4937cb;return db[_0xfb0d('0x3f')][_0xfb0d('0x64')]({'where':{'id':_0x178d4b['params']['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x5c72fb,null))['then'](function(_0x310c5a){if(_0x310c5a){_0x4ead4a=_0x310c5a;_0xba4686[_0xfb0d('0x44')]=_[_0xfb0d('0x53')](db[_0xfb0d('0x82')][_0xfb0d('0x65')]);_0xba4686[_0xfb0d('0x40')]=_['keys'](_0x178d4b[_0xfb0d('0x40')]);_0xba4686[_0xfb0d('0x41')]=_[_0xfb0d('0x43')](_0xba4686[_0xfb0d('0x44')],_0xba4686[_0xfb0d('0x40')]);_0x27e591[_0xfb0d('0x42')]=_['intersection'](_0xba4686[_0xfb0d('0x44')],qs['fields'](_0x178d4b[_0xfb0d('0x40')][_0xfb0d('0x45')]));_0x27e591[_0xfb0d('0x42')]=_0x27e591[_0xfb0d('0x42')]['length']?_0x27e591[_0xfb0d('0x42')]:_0xba4686[_0xfb0d('0x44')];_0x27e591[_0xfb0d('0x48')]=qs[_0xfb0d('0x49')](_0x178d4b[_0xfb0d('0x40')]['sort']);_0x27e591['where']=qs[_0xfb0d('0x41')](_['pick'](_0x178d4b[_0xfb0d('0x40')],_0xba4686[_0xfb0d('0x41')]));if(_0x178d4b[_0xfb0d('0x40')][_0xfb0d('0x68')]){_0x27e591[_0xfb0d('0x4a')]=_['merge'](_0x27e591[_0xfb0d('0x4a')],{'$or':_['map'](_0x27e591[_0xfb0d('0x42')],function(_0x1c1e9c){var _0x41516c={};_0x41516c[_0x1c1e9c]={'$like':'%'+_0x178d4b[_0xfb0d('0x40')][_0xfb0d('0x68')]+'%'};return _0x41516c;})});}_0x27e591=_[_0xfb0d('0x4c')]({},_0x27e591,_0x178d4b[_0xfb0d('0x4d')]);return _0x4ead4a['getApplications'](_0x27e591);}})[_0xfb0d('0x21')](function(_0xb3a222){if(_0xb3a222){_0x4937cb=_0xb3a222[_0xfb0d('0x46')];if(!_0x178d4b[_0xfb0d('0x40')][_0xfb0d('0x66')](_0xfb0d('0x47'))){_0x27e591[_0xfb0d('0x33')]=qs[_0xfb0d('0x33')](_0x178d4b[_0xfb0d('0x40')][_0xfb0d('0x33')]);_0x27e591[_0xfb0d('0x30')]=qs[_0xfb0d('0x30')](_0x178d4b[_0xfb0d('0x40')]['offset']);}return _0x4ead4a[_0xfb0d('0xa7')](_0x27e591);}})[_0xfb0d('0x21')](function(_0x5ecbdf){if(_0x5ecbdf){return _0x5ecbdf?{'count':_0x4937cb,'rows':_0x5ecbdf}:null;}})['then'](respondWithResult(_0x5c72fb,null))[_0xfb0d('0x2c')](handleError(_0x5c72fb,null));};exports[_0xfb0d('0xa8')]=function(_0x2cb7a4,_0xf8ac04,_0x2013e0){var _0x19bf85={'raw':![],'where':{}};var _0x4a71a8={};var _0x5a4b64={'count':0x0,'rows':[]};return db[_0xfb0d('0x3f')][_0xfb0d('0x64')]({'where':{'id':_0x2cb7a4[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0xf8ac04,null))[_0xfb0d('0x21')](function(_0x467238){if(_0x467238){_0x4a71a8[_0xfb0d('0x44')]=_[_0xfb0d('0x53')](db['OpenchannelInteraction']['rawAttributes']);_0x4a71a8[_0xfb0d('0x40')]=_['keys'](_0x2cb7a4[_0xfb0d('0x40')]);_0x4a71a8[_0xfb0d('0x41')]=_[_0xfb0d('0x43')](_0x4a71a8[_0xfb0d('0x44')],_0x4a71a8[_0xfb0d('0x40')]);_0x19bf85[_0xfb0d('0x42')]=_[_0xfb0d('0x43')](_0x4a71a8[_0xfb0d('0x44')],qs['fields'](_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0x45')]));_0x19bf85[_0xfb0d('0x42')]=_0x19bf85['attributes']['length']?_0x19bf85[_0xfb0d('0x42')]:_0x4a71a8[_0xfb0d('0x44')];if(!_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0x66')](_0xfb0d('0x47'))){_0x19bf85[_0xfb0d('0x33')]=qs[_0xfb0d('0x33')](_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0x33')]);_0x19bf85['offset']=qs['offset'](_0x2cb7a4[_0xfb0d('0x40')]['offset']);}_0x19bf85['order']=qs[_0xfb0d('0x49')](_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0x49')]);_0x19bf85['where']=qs[_0xfb0d('0x41')](_[_0xfb0d('0x67')](_0x2cb7a4[_0xfb0d('0x40')],_0x4a71a8[_0xfb0d('0x41')]));_0x19bf85[_0xfb0d('0x4a')][_0xfb0d('0x61')]=_0x467238['id'];if(_0x2cb7a4['query'][_0xfb0d('0x68')]){_0x19bf85[_0xfb0d('0x4a')]=_['merge'](_0x19bf85['where'],{'$or':_[_0xfb0d('0x69')](_0x19bf85[_0xfb0d('0x42')],function(_0x1e46fd){var _0x13da08={};_0x13da08[_0x1e46fd]={'$like':'%'+_0x2cb7a4[_0xfb0d('0x40')]['filter']+'%'};return _0x13da08;})});}_0x19bf85=_[_0xfb0d('0x4c')]({},_0x19bf85,_0x2cb7a4['options']);return db[_0xfb0d('0x8d')][_0xfb0d('0x32')]({'where':_0x19bf85[_0xfb0d('0x4a')]})['then'](function(_0x3f4823){_0x5a4b64[_0xfb0d('0x32')]=_0x3f4823;if(_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0x54')]){_0x19bf85['include']=[{'model':db[_0xfb0d('0x7f')],'as':_0xfb0d('0xa9'),'required':![]},{'model':db[_0xfb0d('0x9b')],'as':_0xfb0d('0xaa'),'attributes':[_0xfb0d('0x3b'),_0xfb0d('0xab'),_0xfb0d('0xac')],'required':![]},{'model':db[_0xfb0d('0xad')],'as':'Tags','attributes':['id',_0xfb0d('0x3b'),_0xfb0d('0xae')],'where':_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0xaf')]?{'id':_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0xaf')]}:undefined,'required':_0x2cb7a4[_0xfb0d('0x40')][_0xfb0d('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x19bf85);})[_0xfb0d('0x21')](function(_0x2d73b6){_0x5a4b64['rows']=_0x2d73b6;return _0x5a4b64;});}})[_0xfb0d('0x21')](respondWithFilteredResult(_0xf8ac04,_0x19bf85))[_0xfb0d('0x2c')](handleError(_0xf8ac04,null));};exports[_0xfb0d('0xb0')]=function(_0x5eed20,_0xc862f2,_0x182e75){return db['OpenchannelAccount'][_0xfb0d('0x55')]({'where':{'id':_0x5eed20[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0xc862f2,null))[_0xfb0d('0x21')](function(_0x5c4659){if(_0x5c4659){return _0x5c4659[_0xfb0d('0xb0')](_0x5eed20['body']['ids'],_[_0xfb0d('0xb1')](_0x5eed20['body'],[_0xfb0d('0x6f'),'id'])||{})[_0xfb0d('0x90')](function(_0xd1ce07){for(var _0xec5970=0x0;_0xec5970<_0x5eed20[_0xfb0d('0x57')][_0xfb0d('0x6f')][_0xfb0d('0x46')];_0xec5970+=0x1){socket[_0xfb0d('0xb2')](_0xfb0d('0xb3'),{'UserId':Number(_0x5eed20[_0xfb0d('0x57')][_0xfb0d('0x6f')][_0xec5970]),'OpenchannelAccountId':Number(_0x5eed20['params']['id'])});}return _0xd1ce07;});}})[_0xfb0d('0x21')](respondWithResult(_0xc862f2,null))[_0xfb0d('0x2c')](handleError(_0xc862f2,null));};exports['removeAgents']=function(_0x247ae6,_0x3bc0f8,_0x316c55){return db[_0xfb0d('0x3f')]['find']({'where':{'id':_0x247ae6['params']['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x3bc0f8,null))[_0xfb0d('0x21')](function(_0x1d6f8b){if(_0x1d6f8b){return _0x1d6f8b[_0xfb0d('0xb4')](_0x247ae6[_0xfb0d('0x40')]['ids'])['then'](function(){if(_['isArray'](_0x247ae6[_0xfb0d('0x40')]['ids'])){for(var _0x59e3d8=0x0;_0x59e3d8<_0x247ae6[_0xfb0d('0x40')][_0xfb0d('0x6f')]['length'];_0x59e3d8+=0x1){socket[_0xfb0d('0xb2')](_0xfb0d('0xb5'),{'UserId':Number(_0x247ae6[_0xfb0d('0x40')][_0xfb0d('0x6f')][_0x59e3d8]),'OpenchannelAccountId':Number(_0x247ae6['params']['id'])});}}else{socket[_0xfb0d('0xb2')](_0xfb0d('0xb5'),{'UserId':Number(_0x247ae6[_0xfb0d('0x40')][_0xfb0d('0x6f')]),'OpenchannelAccountId':Number(_0x247ae6['params']['id'])});}});}})[_0xfb0d('0x21')](respondWithStatusCode(_0x3bc0f8,null))[_0xfb0d('0x2c')](handleError(_0x3bc0f8,null));};exports[_0xfb0d('0xb6')]=function(_0x2faf30,_0x5b3875,_0x1343ff){var _0x1a77c7={};var _0x39b1e5={};var _0x1e5a46;var _0x141c8f;return db['OpenchannelAccount'][_0xfb0d('0x64')]({'where':{'id':_0x2faf30['params']['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x5b3875,null))[_0xfb0d('0x21')](function(_0x49a085){if(_0x49a085){_0x1e5a46=_0x49a085;_0x39b1e5[_0xfb0d('0x44')]=_[_0xfb0d('0x53')](db[_0xfb0d('0x9b')]['rawAttributes']);_0x39b1e5[_0xfb0d('0x40')]=_[_0xfb0d('0x53')](_0x2faf30[_0xfb0d('0x40')]);_0x39b1e5[_0xfb0d('0x41')]=_['intersection'](_0x39b1e5[_0xfb0d('0x44')],_0x39b1e5[_0xfb0d('0x40')]);_0x1a77c7[_0xfb0d('0x42')]=_[_0xfb0d('0x43')](_0x39b1e5['model'],qs[_0xfb0d('0x45')](_0x2faf30['query']['fields']));_0x1a77c7[_0xfb0d('0x42')]=_0x1a77c7[_0xfb0d('0x42')][_0xfb0d('0x46')]?_0x1a77c7[_0xfb0d('0x42')]:_0x39b1e5['model'];_0x1a77c7['order']=qs['sort'](_0x2faf30[_0xfb0d('0x40')][_0xfb0d('0x49')]);_0x1a77c7['where']=qs[_0xfb0d('0x41')](_[_0xfb0d('0x67')](_0x2faf30[_0xfb0d('0x40')],_0x39b1e5['filters']));if(_0x2faf30[_0xfb0d('0x40')]['filter']){_0x1a77c7[_0xfb0d('0x4a')]=_[_0xfb0d('0x4c')](_0x1a77c7[_0xfb0d('0x4a')],{'$or':_[_0xfb0d('0x69')](_0x1a77c7[_0xfb0d('0x42')],function(_0x5cd62b){var _0x1d2b05={};_0x1d2b05[_0x5cd62b]={'$like':'%'+_0x2faf30[_0xfb0d('0x40')]['filter']+'%'};return _0x1d2b05;})});}_0x1a77c7=_[_0xfb0d('0x4c')]({},_0x1a77c7,_0x2faf30[_0xfb0d('0x4d')]);return _0x1e5a46['getAgents'](_0x1a77c7);}})[_0xfb0d('0x21')](function(_0x58e505){if(_0x58e505){_0x141c8f=_0x58e505[_0xfb0d('0x46')];if(!_0x2faf30[_0xfb0d('0x40')]['hasOwnProperty']('nolimit')){_0x1a77c7[_0xfb0d('0x33')]=qs[_0xfb0d('0x33')](_0x2faf30[_0xfb0d('0x40')][_0xfb0d('0x33')]);_0x1a77c7[_0xfb0d('0x30')]=qs['offset'](_0x2faf30['query']['offset']);}return _0x1e5a46['getAgents'](_0x1a77c7);}})['then'](function(_0x2f47bb){if(_0x2f47bb){return _0x2f47bb?{'count':_0x141c8f,'rows':_0x2f47bb}:null;}})[_0xfb0d('0x21')](respondWithResult(_0x5b3875,null))[_0xfb0d('0x2c')](handleError(_0x5b3875,null));};exports['send']=function(_0x3c79d3,_0x344b5a,_0x440d53){var _0x203138,_0x3a3261,_0x27cbb2;if(_[_0xfb0d('0x7a')](_0x3c79d3[_0xfb0d('0x57')]['body'])||_0x3c79d3[_0xfb0d('0x57')][_0xfb0d('0x57')]===''){throw new db[(_0xfb0d('0x71'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfb0d('0x7a')](_0x3c79d3[_0xfb0d('0x57')]['to'])){}_0x203138=_0x3c79d3[_0xfb0d('0x57')]['to'];return db[_0xfb0d('0x3f')][_0xfb0d('0x64')]({'where':{'id':_0x3c79d3[_0xfb0d('0x52')]['id']}})[_0xfb0d('0x21')](handleEntityNotFound(_0x344b5a,null))[_0xfb0d('0x21')](function(_0x4befff){if(_0x4befff){return db[_0xfb0d('0x3f')]['find']({'where':{'id':_0x4befff['id']},'include':[{'model':db[_0xfb0d('0x7e')],'as':_0xfb0d('0x83'),'include':[{'model':db['CmContact'],'as':_0xfb0d('0x80'),'where':{[_0x4befff[_0xfb0d('0x7d')]]:_0x203138},'limit':0x1,'order':[[_0xfb0d('0x75'),'DESC']]}]}]})[_0xfb0d('0x21')](handleEntityNotFound(_0x344b5a,null))['then'](function(_0x2ceace){if(_0x2ceace&&_0x2ceace[_0xfb0d('0x83')]){_0x3a3261=_0x2ceace[_0xfb0d('0x38')]({'plain':!![]});if(_0x3a3261[_0xfb0d('0x83')]&&_0x3a3261['List'][_0xfb0d('0x80')][_0xfb0d('0x46')]){return _0x3a3261[_0xfb0d('0x83')][_0xfb0d('0x80')][0x0];}return db['CmContact'][_0xfb0d('0x56')](_[_0xfb0d('0x19')](_0x3c79d3[_0xfb0d('0x57')],{'firstName':_0x203138,[_0x2ceace[_0xfb0d('0x7d')]]:_0x203138,'phone':_0x203138,'ListId':_0x3a3261[_0xfb0d('0x77')]}));}})[_0xfb0d('0x21')](handleEntityNotFound(_0x344b5a,null))['then'](function(_0x41731a){if(_0x41731a){_0x27cbb2=_0x41731a;return db[_0xfb0d('0x8d')]['find']({'where':{'ContactId':_0x27cbb2['id'],'closed':![],'OpenchannelAccountId':_0x3a3261['id']}})[_0xfb0d('0x21')](function(_0x3dee79){if(_0x3dee79){return[_0x3dee79,![]];}return db[_0xfb0d('0x8d')]['create']({'UserId':_0x3c79d3[_0xfb0d('0x58')]['id'],'ContactId':_0x27cbb2['id'],'OpenchannelAccountId':_0x3a3261['id'],'lastMsgDirection':'out','Messages':[_['merge'](_0x3c79d3[_0xfb0d('0x57')],{'read':![],'body':_0x3c79d3[_0xfb0d('0x57')][_0xfb0d('0x57')],'OpenchannelAccountId':_0x3a3261['id'],'UserId':_0x3c79d3[_0xfb0d('0x58')]['id'],'ContactId':_0x27cbb2['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xfb0d('0xb7')}]})[_0xfb0d('0x21')](function(_0x285a5e){return[_0x285a5e,!![]];});});}})[_0xfb0d('0x90')](function(_0x140b83,_0x4737b6){if(_0x4737b6){return _0x140b83;}return db['OpenchannelMessage'][_0xfb0d('0x56')](_[_0xfb0d('0x4c')](_0x3c79d3['body'],{'read':![],'body':_0x3c79d3[_0xfb0d('0x57')]['body'],'OpenchannelAccountId':_0x3a3261['id'],'OpenchannelInteractionId':_0x140b83['id'],'UserId':_0x3c79d3[_0xfb0d('0x58')]['id'],'ContactId':_0x27cbb2['id']}))[_0xfb0d('0x21')](function(_0x2b12f6){_0x140b83[_0xfb0d('0xb8')][_0xfb0d('0xb7')]=[];_0x140b83[_0xfb0d('0xb8')][_0xfb0d('0xb7')][_0xfb0d('0x95')](_0x2b12f6[_0xfb0d('0xb8')]);return _0x140b83;});});}})['then'](respondWithResult(_0x344b5a,null))[_0xfb0d('0x2c')](handleError(_0x344b5a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d95d668..2c1cb8d 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 _0x878f=['hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x352de7,_0xff4ac7){var _0x1fa898=function(_0x370537){while(--_0x370537){_0x352de7['push'](_0x352de7['shift']());}};_0x1fa898(++_0xff4ac7);}(_0x878f,0x173));var _0xf878=function(_0x19dc06,_0x387829){_0x19dc06=_0x19dc06-0x0;var _0x387a25=_0x878f[_0x19dc06];return _0x387a25;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xf878('0x0'))['db'][_0xf878('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf878('0x2')](0x0);var events={'afterCreate':_0xf878('0x3'),'afterUpdate':_0xf878('0x4'),'afterDestroy':_0xf878('0x5')};function emitEvent(_0x9e6783){return function(_0x45a37b,_0x240b48,_0xcf1927){OpenchannelAccountEvents[_0xf878('0x6')](_0x9e6783+':'+_0x45a37b['id'],_0x45a37b);OpenchannelAccountEvents['emit'](_0x9e6783,_0x45a37b);_0xcf1927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xf878('0x7')](e,emitEvent(event));}}module[_0xf878('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x4522=['OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x10a20e,_0x2ebc22){var _0xbb6a38=function(_0x4dcc61){while(--_0x4dcc61){_0x10a20e['push'](_0x10a20e['shift']());}};_0xbb6a38(++_0x2ebc22);}(_0x4522,0x1a0));var _0x2452=function(_0x370364,_0x23fe3b){_0x370364=_0x370364-0x0;var _0x5b89d9=_0x4522[_0x370364];return _0x5b89d9;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x2452('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x2452('0x1')](0x0);var events={'afterCreate':_0x2452('0x2'),'afterUpdate':'update','afterDestroy':_0x2452('0x3')};function emitEvent(_0x1fdf5b){return function(_0x35e30a,_0x2f21dc,_0x34ff44){OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b+':'+_0x35e30a['id'],_0x35e30a);OpenchannelAccountEvents[_0x2452('0x4')](_0x1fdf5b,_0x35e30a);_0x34ff44(null);};}for(var e in events){if(events[_0x2452('0x5')](e)){var event=events[e];OpenchannelAccount[_0x2452('0x6')](e,emitEvent(event));}}module[_0x2452('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 4155abb..7bbf7e5 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(_0x2c3a64,_0x1cbae3){var _0x16a141=function(_0x41b1d5){while(--_0x41b1d5){_0x2c3a64['push'](_0x2c3a64['shift']());}};_0x16a141(++_0x1cbae3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x20c9d2,_0xa5099e){var _0xba49fa=function(_0x570645){while(--_0x570645){_0x20c9d2['push'](_0x20c9d2['shift']());}};_0xba49fa(++_0xa5099e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 19e1cc3..d79b8d6 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 _0x8caf=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug'];(function(_0x3221ae,_0x10dd4c){var _0x314b92=function(_0x4886a0){while(--_0x4886a0){_0x3221ae['push'](_0x3221ae['shift']());}};_0x314b92(++_0x10dd4c);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x1cc4e1,_0x1629d4){_0x1cc4e1=_0x1cc4e1-0x0;var _0x192d47=_0x8caf[_0x1cc4e1];return _0x192d47;};'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});config['redis']=_[_0xf8ca('0xc')](config[_0xf8ca('0xd')],{'host':_0xf8ca('0xe'),'port':0x18eb});var socket=require(_0xf8ca('0xf'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0xf8ca('0x10')](socket);function respondWithRpcPromise(_0x576e9d,_0x2f67c5,_0x2e86a6){return new BPromise(function(_0x2daa43,_0x2be477){return client['request'](_0x576e9d,_0x2e86a6)[_0xf8ca('0x11')](function(_0x6f3f7b){logger[_0xf8ca('0x12')](_0xf8ca('0x13'),_0x2f67c5,'request\x20sent');logger[_0xf8ca('0x14')](_0xf8ca('0x15'),_0x2f67c5,'request\x20sent',JSON[_0xf8ca('0x16')](_0x6f3f7b));if(_0x6f3f7b[_0xf8ca('0x17')]){if(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x18')]===0x1f4){logger[_0xf8ca('0x17')](_0xf8ca('0x13'),_0x2f67c5,_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);return _0x2be477(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);}logger['error'](_0xf8ca('0x13'),_0x2f67c5,_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);return _0x2daa43(_0x6f3f7b[_0xf8ca('0x17')][_0xf8ca('0x19')]);}else{logger[_0xf8ca('0x12')](_0xf8ca('0x13'),_0x2f67c5,_0xf8ca('0x1a'));_0x2daa43(_0x6f3f7b['result'][_0xf8ca('0x19')]);}})[_0xf8ca('0x1b')](function(_0x17eefa){logger[_0xf8ca('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f67c5,_0x17eefa);_0x2be477(_0x17eefa);});});} \ No newline at end of file +var _0xbaf0=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','debug'];(function(_0x79544e,_0x592c7e){var _0x5b553b=function(_0x4c664b){while(--_0x4c664b){_0x79544e['push'](_0x79544e['shift']());}};_0x5b553b(++_0x592c7e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index cfd7a5d..69aed09 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 _0xedd9=['removeListener','register','length','openchannelAccount:','save','remove','update','emit'];(function(_0x418ddf,_0xd714a8){var _0x1be0d5=function(_0x27603c){while(--_0x27603c){_0x418ddf['push'](_0x418ddf['shift']());}};_0x1be0d5(++_0xd714a8);}(_0xedd9,0xfc));var _0x9edd=function(_0x249d4b,_0xf8d113){_0x249d4b=_0x249d4b-0x0;var _0x42f9db=_0xedd9[_0x249d4b];return _0x42f9db;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){OpenchannelAccountEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);OpenchannelAccountEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x644a=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x36f50f,_0x4626ab){var _0x949472=function(_0x419063){while(--_0x419063){_0x36f50f['push'](_0x36f50f['shift']());}};_0x949472(++_0x4626ab);}(_0x644a,0xfd));var _0xa644=function(_0xc8966a,_0x19753d){_0xc8966a=_0xc8966a-0x0;var _0x2a3be4=_0x644a[_0xc8966a];return _0x2a3be4;};'use strict';var OpenchannelAccountEvents=require(_0xa644('0x0'));var events=[_0xa644('0x1'),_0xa644('0x2'),_0xa644('0x3')];function createListener(_0x3a3218,_0x48801b){return function(_0x1423b7){_0x48801b[_0xa644('0x4')](_0x3a3218,_0x1423b7);};}function removeListener(_0x526de6,_0x4f6ed9){return function(){OpenchannelAccountEvents[_0xa644('0x5')](_0x526de6,_0x4f6ed9);};}exports[_0xa644('0x6')]=function(_0x3e1ca6){for(var _0x5d78a7=0x0,_0xa4af13=events[_0xa644('0x7')];_0x5d78a7<_0xa4af13;_0x5d78a7++){var _0x4f8b23=events[_0x5d78a7];var _0x15995f=createListener(_0xa644('0x8')+_0x4f8b23,_0x3e1ca6);OpenchannelAccountEvents['on'](_0x4f8b23,_0x15995f);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4a3682c..fa480e1 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 _0x0364=['isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','/:id','show','post','create','put'];(function(_0x430db0,_0x385280){var _0x11ee02=function(_0x402253){while(--_0x402253){_0x430db0['push'](_0x430db0['shift']());}};_0x11ee02(++_0x385280);}(_0x0364,0x16d));var _0x4036=function(_0x4e6e24,_0x2388a3){_0x4e6e24=_0x4e6e24-0x0;var _0x118f40=_0x0364[_0x4e6e24];return _0x118f40;};'use strict';var multer=require(_0x4036('0x0'));var util=require(_0x4036('0x1'));var path=require('path');var timeout=require(_0x4036('0x2'));var express=require('express');var router=express[_0x4036('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4036('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4036('0x5'));var controller=require(_0x4036('0x6'));router[_0x4036('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4036('0x8'),auth['isAuthenticated'](),controller[_0x4036('0x9')]);router[_0x4036('0xa')]('/',auth['isAuthenticated'](),controller[_0x4036('0xb')]);router[_0x4036('0xc')](_0x4036('0x8'),auth[_0x4036('0xd')](),controller[_0x4036('0xe')]);router[_0x4036('0xf')](_0x4036('0x8'),auth[_0x4036('0xd')](),controller[_0x4036('0x10')]);module[_0x4036('0x11')]=router; \ No newline at end of file +var _0x6763=['exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6763,0x177));var _0x3676=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0x6763[_0xf97eb0];return _0xea70f4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3676('0x0'));var express=require(_0x3676('0x1'));var router=express[_0x3676('0x2')]();var fs_extra=require(_0x3676('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3676('0x4'));var config=require('../../config/environment');var controller=require(_0x3676('0x5'));router[_0x3676('0x6')]('/',auth[_0x3676('0x7')](),controller[_0x3676('0x8')]);router[_0x3676('0x6')](_0x3676('0x9'),auth['isAuthenticated'](),controller[_0x3676('0xa')]);router[_0x3676('0xb')]('/',auth[_0x3676('0x7')](),controller[_0x3676('0xc')]);router[_0x3676('0xd')](_0x3676('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x3676('0xe')](_0x3676('0x9'),auth[_0x3676('0x7')](),controller[_0x3676('0xf')]);module[_0x3676('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9cb0a87..b2acf07 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 _0x2670=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2670,0xed));var _0x0267=function(_0x328fc2,_0x1fe6f3){_0x328fc2=_0x328fc2-0x0;var _0x136815=_0x2670[_0x328fc2];return _0x136815;};'use strict';var Sequelize=require(_0x0267('0x0'));module[_0x0267('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0267('0x2')],'allowNull':![],'defaultValue':_0x0267('0x3')},'appdata':{'type':Sequelize[_0x0267('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0267('0x2')],'defaultValue':_0x0267('0x5')}}; \ No newline at end of file +var _0xa11d=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x36dd03,_0x38389a){var _0x4795c9=function(_0x4e614f){while(--_0x4e614f){_0x36dd03['push'](_0x36dd03['shift']());}};_0x4795c9(++_0x38389a);}(_0xa11d,0x14a));var _0xda11=function(_0x4bab82,_0xf6ff48){_0x4bab82=_0x4bab82-0x0;var _0x140a53=_0xa11d[_0x4bab82];return _0x140a53;};'use strict';var Sequelize=require(_0xda11('0x0'));module[_0xda11('0x1')]={'priority':{'type':Sequelize[_0xda11('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xda11('0x3')],'allowNull':![],'defaultValue':_0xda11('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xda11('0x3')]},'interval':{'type':Sequelize[_0xda11('0x3')],'defaultValue':_0xda11('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 36d8f75..5d62ba6 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 _0x6e61=['include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','OpenchannelApplication','then','includeAll'];(function(_0x2dc1bc,_0x18255b){var _0x57fda9=function(_0x35e3f9){while(--_0x35e3f9){_0x2dc1bc['push'](_0x2dc1bc['shift']());}};_0x57fda9(++_0x18255b);}(_0x6e61,0x1ab));var _0x16e6=function(_0x300b55,_0x1ca5f8){_0x300b55=_0x300b55-0x0;var _0x144472=_0x6e61[_0x300b55];return _0x144472;};'use strict';var emlformat=require(_0x16e6('0x0'));var rimraf=require(_0x16e6('0x1'));var zipdir=require(_0x16e6('0x2'));var jsonpatch=require(_0x16e6('0x3'));var rp=require(_0x16e6('0x4'));var moment=require(_0x16e6('0x5'));var BPromise=require(_0x16e6('0x6'));var Mustache=require(_0x16e6('0x7'));var util=require('util');var path=require(_0x16e6('0x8'));var sox=require(_0x16e6('0x9'));var csv=require(_0x16e6('0xa'));var ejs=require(_0x16e6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x16e6('0xc'));var crypto=require(_0x16e6('0xd'));var jsforce=require(_0x16e6('0xe'));var deskjs=require(_0x16e6('0xf'));var toCsv=require(_0x16e6('0xa'));var querystring=require(_0x16e6('0x10'));var Papa=require(_0x16e6('0x11'));var Redis=require('ioredis');var authService=require(_0x16e6('0x12'));var qs=require(_0x16e6('0x13'));var as=require(_0x16e6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x16e6('0x15'))['db'];function respondWithStatusCode(_0x38e7c8,_0x404f36){_0x404f36=_0x404f36||0xcc;return function(_0x26e446){if(_0x26e446){return _0x38e7c8[_0x16e6('0x16')](_0x404f36);}return _0x38e7c8[_0x16e6('0x17')](_0x404f36)['end']();};}function respondWithResult(_0x1c2dcb,_0x432547){_0x432547=_0x432547||0xc8;return function(_0x2a3d46){if(_0x2a3d46){return _0x1c2dcb[_0x16e6('0x17')](_0x432547)[_0x16e6('0x18')](_0x2a3d46);}};}function respondWithFilteredResult(_0x533112,_0x44b12d){return function(_0x383144){if(_0x383144){var _0x2c75cf=typeof _0x44b12d['offset']===_0x16e6('0x19')&&typeof _0x44b12d[_0x16e6('0x1a')]===_0x16e6('0x19');var _0x13fe2a=_0x383144[_0x16e6('0x1b')];var _0x3c935b=_0x2c75cf?0x0:_0x44b12d[_0x16e6('0x1c')];var _0x269afc=_0x2c75cf?_0x383144[_0x16e6('0x1b')]:_0x44b12d[_0x16e6('0x1c')]+_0x44b12d[_0x16e6('0x1a')];var _0x43d43e;if(_0x269afc>=_0x13fe2a){_0x269afc=_0x13fe2a;_0x43d43e=0xc8;}else{_0x43d43e=0xce;}_0x533112[_0x16e6('0x17')](_0x43d43e);return _0x533112[_0x16e6('0x1d')](_0x16e6('0x1e'),_0x3c935b+'-'+_0x269afc+'/'+_0x13fe2a)['json'](_0x383144);}return null;};}function patchUpdates(_0x295f82){return function(_0x3a2f01){try{jsonpatch[_0x16e6('0x1f')](_0x3a2f01,_0x295f82,!![]);}catch(_0x2c3d92){return BPromise[_0x16e6('0x20')](_0x2c3d92);}return _0x3a2f01[_0x16e6('0x21')]();};}function saveUpdates(_0x5b97b2,_0x443bd3){return function(_0x4806e0){if(_0x4806e0){return _0x4806e0[_0x16e6('0x22')](_0x5b97b2)['then'](function(_0x2a0a58){return _0x2a0a58;});}return null;};}function removeEntity(_0x591d29,_0x5e1660){return function(_0x170246){if(_0x170246){return _0x170246[_0x16e6('0x23')]()['then'](function(){_0x591d29[_0x16e6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x247f03,_0x5a6ddd){return function(_0x374307){if(!_0x374307){_0x247f03['sendStatus'](0x194);}return _0x374307;};}function handleError(_0x905342,_0x4c1b5d){_0x4c1b5d=_0x4c1b5d||0x1f4;return function(_0x3f0cb2){logger[_0x16e6('0x24')](_0x3f0cb2[_0x16e6('0x25')]);if(_0x3f0cb2[_0x16e6('0x26')]){delete _0x3f0cb2[_0x16e6('0x26')];}_0x905342['status'](_0x4c1b5d)[_0x16e6('0x27')](_0x3f0cb2);};}exports['index']=function(_0x3ec73f,_0x15755a){var _0x55878f={},_0x5495f9={},_0x2f03b1={'count':0x0,'rows':[]};var _0x111ff6=_[_0x16e6('0x28')](db['OpenchannelApplication'][_0x16e6('0x29')],function(_0x4fa1e9){return{'name':_0x4fa1e9[_0x16e6('0x2a')],'type':_0x4fa1e9[_0x16e6('0x2b')][_0x16e6('0x2c')]};});_0x5495f9['model']=_[_0x16e6('0x28')](_0x111ff6,_0x16e6('0x26'));_0x5495f9[_0x16e6('0x2d')]=_[_0x16e6('0x2e')](_0x3ec73f[_0x16e6('0x2d')]);_0x5495f9[_0x16e6('0x2f')]=_[_0x16e6('0x30')](_0x5495f9[_0x16e6('0x31')],_0x5495f9[_0x16e6('0x2d')]);_0x55878f[_0x16e6('0x32')]=_[_0x16e6('0x30')](_0x5495f9['model'],qs[_0x16e6('0x33')](_0x3ec73f[_0x16e6('0x2d')]['fields']));_0x55878f['attributes']=_0x55878f['attributes'][_0x16e6('0x34')]?_0x55878f['attributes']:_0x5495f9[_0x16e6('0x31')];if(!_0x3ec73f[_0x16e6('0x2d')][_0x16e6('0x35')](_0x16e6('0x36'))){_0x55878f[_0x16e6('0x1a')]=qs[_0x16e6('0x1a')](_0x3ec73f['query']['limit']);_0x55878f[_0x16e6('0x1c')]=qs['offset'](_0x3ec73f[_0x16e6('0x2d')]['offset']);}_0x55878f['order']=qs[_0x16e6('0x37')](_0x3ec73f[_0x16e6('0x2d')][_0x16e6('0x37')]);_0x55878f[_0x16e6('0x38')]=qs[_0x16e6('0x2f')](_['pick'](_0x3ec73f[_0x16e6('0x2d')],_0x5495f9[_0x16e6('0x2f')]),_0x111ff6);if(_0x3ec73f[_0x16e6('0x2d')][_0x16e6('0x39')]){_0x55878f['where']=_[_0x16e6('0x3a')](_0x55878f[_0x16e6('0x38')],{'$or':_[_0x16e6('0x28')](_0x111ff6,function(_0x52ff6f){if(_0x52ff6f['type']!=='VIRTUAL'){var _0x3135e3={};_0x3135e3[_0x52ff6f['name']]={'$like':'%'+_0x3ec73f['query'][_0x16e6('0x39')]+'%'};return _0x3135e3;}})});}_0x55878f=_['merge']({},_0x55878f,_0x3ec73f[_0x16e6('0x3b')]);var _0x535917={'where':_0x55878f[_0x16e6('0x38')]};return db[_0x16e6('0x3c')][_0x16e6('0x1b')](_0x535917)[_0x16e6('0x3d')](function(_0x47255f){_0x2f03b1[_0x16e6('0x1b')]=_0x47255f;if(_0x3ec73f['query'][_0x16e6('0x3e')]){_0x55878f[_0x16e6('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x55878f);})['then'](function(_0x1f29a9){_0x2f03b1['rows']=_0x1f29a9;return _0x2f03b1;})[_0x16e6('0x3d')](respondWithFilteredResult(_0x15755a,_0x55878f))[_0x16e6('0x40')](handleError(_0x15755a,null));};exports[_0x16e6('0x41')]=function(_0xe71741,_0x2deffb){var _0x52d11a={'raw':!![],'where':{'id':_0xe71741['params']['id']}},_0x2745bf={};_0x2745bf[_0x16e6('0x31')]=_[_0x16e6('0x2e')](db[_0x16e6('0x3c')][_0x16e6('0x29')]);_0x2745bf[_0x16e6('0x2d')]=_[_0x16e6('0x2e')](_0xe71741[_0x16e6('0x2d')]);_0x2745bf[_0x16e6('0x2f')]=_[_0x16e6('0x30')](_0x2745bf[_0x16e6('0x31')],_0x2745bf[_0x16e6('0x2d')]);_0x52d11a[_0x16e6('0x32')]=_[_0x16e6('0x30')](_0x2745bf[_0x16e6('0x31')],qs['fields'](_0xe71741[_0x16e6('0x2d')]['fields']));_0x52d11a[_0x16e6('0x32')]=_0x52d11a[_0x16e6('0x32')][_0x16e6('0x34')]?_0x52d11a[_0x16e6('0x32')]:_0x2745bf[_0x16e6('0x31')];if(_0xe71741[_0x16e6('0x2d')][_0x16e6('0x3e')]){_0x52d11a[_0x16e6('0x3f')]=[{'all':!![]}];}_0x52d11a=_[_0x16e6('0x3a')]({},_0x52d11a,_0xe71741[_0x16e6('0x3b')]);return db[_0x16e6('0x3c')][_0x16e6('0x42')](_0x52d11a)[_0x16e6('0x3d')](handleEntityNotFound(_0x2deffb,null))['then'](respondWithResult(_0x2deffb,null))[_0x16e6('0x40')](handleError(_0x2deffb,null));};exports[_0x16e6('0x43')]=function(_0x4e101b,_0x21e4c5){return db[_0x16e6('0x3c')][_0x16e6('0x43')](_0x4e101b[_0x16e6('0x44')],{})['then'](respondWithResult(_0x21e4c5,0xc9))[_0x16e6('0x40')](handleError(_0x21e4c5,null));};exports['update']=function(_0xed5203,_0x128f39){if(_0xed5203[_0x16e6('0x44')]['id']){delete _0xed5203[_0x16e6('0x44')]['id'];}return db[_0x16e6('0x3c')][_0x16e6('0x42')]({'where':{'id':_0xed5203[_0x16e6('0x45')]['id']}})[_0x16e6('0x3d')](handleEntityNotFound(_0x128f39,null))['then'](saveUpdates(_0xed5203[_0x16e6('0x44')],null))[_0x16e6('0x3d')](respondWithResult(_0x128f39,null))[_0x16e6('0x40')](handleError(_0x128f39,null));};exports['destroy']=function(_0x1f453d,_0x2d074d){return db[_0x16e6('0x3c')][_0x16e6('0x42')]({'where':{'id':_0x1f453d[_0x16e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d074d,null))[_0x16e6('0x3d')](removeEntity(_0x2d074d,null))[_0x16e6('0x40')](handleError(_0x2d074d,null));}; \ No newline at end of file +var _0x5e63=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','keys','create','body','destroy','find','params'];(function(_0x2b03e2,_0x335e1e){var _0x51b704=function(_0x3f68d6){while(--_0x3f68d6){_0x2b03e2['push'](_0x2b03e2['shift']());}};_0x51b704(++_0x335e1e);}(_0x5e63,0x94));var _0x35e6=function(_0x3d2a90,_0x2073ae){_0x3d2a90=_0x3d2a90-0x0;var _0x33fb5c=_0x5e63[_0x3d2a90];return _0x33fb5c;};'use strict';var emlformat=require(_0x35e6('0x0'));var rimraf=require(_0x35e6('0x1'));var zipdir=require(_0x35e6('0x2'));var jsonpatch=require(_0x35e6('0x3'));var rp=require(_0x35e6('0x4'));var moment=require(_0x35e6('0x5'));var BPromise=require(_0x35e6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x35e6('0x7'));var sox=require(_0x35e6('0x8'));var csv=require('to-csv');var ejs=require(_0x35e6('0x9'));var fs=require('fs');var fs_extra=require(_0x35e6('0xa'));var _=require('lodash');var squel=require(_0x35e6('0xb'));var crypto=require('crypto');var jsforce=require(_0x35e6('0xc'));var deskjs=require(_0x35e6('0xd'));var toCsv=require(_0x35e6('0xe'));var querystring=require(_0x35e6('0xf'));var Papa=require(_0x35e6('0x10'));var Redis=require(_0x35e6('0x11'));var authService=require(_0x35e6('0x12'));var qs=require(_0x35e6('0x13'));var as=require(_0x35e6('0x14'));var hardwareService=require(_0x35e6('0x15'));var logger=require('../../config/logger')(_0x35e6('0x16'));var utils=require('../../config/utils');var config=require(_0x35e6('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x458e2c,_0x1f4a84){_0x1f4a84=_0x1f4a84||0xcc;return function(_0x547b58){if(_0x547b58){return _0x458e2c[_0x35e6('0x18')](_0x1f4a84);}return _0x458e2c[_0x35e6('0x19')](_0x1f4a84)[_0x35e6('0x1a')]();};}function respondWithResult(_0xf6d183,_0x56300e){_0x56300e=_0x56300e||0xc8;return function(_0x25faf3){if(_0x25faf3){return _0xf6d183[_0x35e6('0x19')](_0x56300e)[_0x35e6('0x1b')](_0x25faf3);}};}function respondWithFilteredResult(_0x241707,_0x37fd81){return function(_0xec4875){if(_0xec4875){var _0x276ccb=typeof _0x37fd81['offset']===_0x35e6('0x1c')&&typeof _0x37fd81['limit']===_0x35e6('0x1c');var _0x3e2069=_0xec4875[_0x35e6('0x1d')];var _0x1531f1=_0x276ccb?0x0:_0x37fd81[_0x35e6('0x1e')];var _0x38b110=_0x276ccb?_0xec4875[_0x35e6('0x1d')]:_0x37fd81[_0x35e6('0x1e')]+_0x37fd81[_0x35e6('0x1f')];var _0x1c4c21;if(_0x38b110>=_0x3e2069){_0x38b110=_0x3e2069;_0x1c4c21=0xc8;}else{_0x1c4c21=0xce;}_0x241707[_0x35e6('0x19')](_0x1c4c21);return _0x241707['set']('Content-Range',_0x1531f1+'-'+_0x38b110+'/'+_0x3e2069)[_0x35e6('0x1b')](_0xec4875);}return null;};}function patchUpdates(_0x34506c){return function(_0x5ce9f5){try{jsonpatch[_0x35e6('0x20')](_0x5ce9f5,_0x34506c,!![]);}catch(_0x527e50){return BPromise[_0x35e6('0x21')](_0x527e50);}return _0x5ce9f5[_0x35e6('0x22')]();};}function saveUpdates(_0x8e85be,_0x3da3c3){return function(_0x225442){if(_0x225442){return _0x225442[_0x35e6('0x23')](_0x8e85be)[_0x35e6('0x24')](function(_0x2fcfdf){return _0x2fcfdf;});}return null;};}function removeEntity(_0x3ee332,_0x2fd290){return function(_0x2e0a86){if(_0x2e0a86){return _0x2e0a86['destroy']()[_0x35e6('0x24')](function(){_0x3ee332['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x155e4f,_0x56f036){return function(_0x4d2d61){if(!_0x4d2d61){_0x155e4f[_0x35e6('0x18')](0x194);}return _0x4d2d61;};}function handleError(_0x101675,_0x5466a7){_0x5466a7=_0x5466a7||0x1f4;return function(_0x3d3fd9){logger[_0x35e6('0x25')](_0x3d3fd9[_0x35e6('0x26')]);if(_0x3d3fd9['name']){delete _0x3d3fd9[_0x35e6('0x27')];}_0x101675['status'](_0x5466a7)[_0x35e6('0x28')](_0x3d3fd9);};}exports[_0x35e6('0x29')]=function(_0x48c105,_0x3e8cd5){var _0x4d5dd9={},_0x53ea1d={},_0x5d70ab={'count':0x0,'rows':[]};var _0x234bbe=_[_0x35e6('0x2a')](db[_0x35e6('0x2b')][_0x35e6('0x2c')],function(_0x4f839a){return{'name':_0x4f839a[_0x35e6('0x2d')],'type':_0x4f839a['type'][_0x35e6('0x2e')]};});_0x53ea1d['model']=_[_0x35e6('0x2a')](_0x234bbe,_0x35e6('0x27'));_0x53ea1d[_0x35e6('0x2f')]=_['keys'](_0x48c105[_0x35e6('0x2f')]);_0x53ea1d[_0x35e6('0x30')]=_['intersection'](_0x53ea1d[_0x35e6('0x31')],_0x53ea1d['query']);_0x4d5dd9[_0x35e6('0x32')]=_[_0x35e6('0x33')](_0x53ea1d[_0x35e6('0x31')],qs[_0x35e6('0x34')](_0x48c105[_0x35e6('0x2f')][_0x35e6('0x34')]));_0x4d5dd9[_0x35e6('0x32')]=_0x4d5dd9[_0x35e6('0x32')][_0x35e6('0x35')]?_0x4d5dd9[_0x35e6('0x32')]:_0x53ea1d[_0x35e6('0x31')];if(!_0x48c105[_0x35e6('0x2f')]['hasOwnProperty']('nolimit')){_0x4d5dd9[_0x35e6('0x1f')]=qs[_0x35e6('0x1f')](_0x48c105[_0x35e6('0x2f')][_0x35e6('0x1f')]);_0x4d5dd9[_0x35e6('0x1e')]=qs[_0x35e6('0x1e')](_0x48c105[_0x35e6('0x2f')][_0x35e6('0x1e')]);}_0x4d5dd9[_0x35e6('0x36')]=qs[_0x35e6('0x37')](_0x48c105['query'][_0x35e6('0x37')]);_0x4d5dd9[_0x35e6('0x38')]=qs[_0x35e6('0x30')](_[_0x35e6('0x39')](_0x48c105['query'],_0x53ea1d[_0x35e6('0x30')]),_0x234bbe);if(_0x48c105['query'][_0x35e6('0x3a')]){_0x4d5dd9[_0x35e6('0x38')]=_[_0x35e6('0x3b')](_0x4d5dd9[_0x35e6('0x38')],{'$or':_[_0x35e6('0x2a')](_0x234bbe,function(_0x5a612b){if(_0x5a612b[_0x35e6('0x3c')]!==_0x35e6('0x3d')){var _0x3d07d0={};_0x3d07d0[_0x5a612b['name']]={'$like':'%'+_0x48c105[_0x35e6('0x2f')]['filter']+'%'};return _0x3d07d0;}})});}_0x4d5dd9=_[_0x35e6('0x3b')]({},_0x4d5dd9,_0x48c105[_0x35e6('0x3e')]);var _0x4d615b={'where':_0x4d5dd9[_0x35e6('0x38')]};return db[_0x35e6('0x2b')][_0x35e6('0x1d')](_0x4d615b)[_0x35e6('0x24')](function(_0x4e56f2){_0x5d70ab[_0x35e6('0x1d')]=_0x4e56f2;if(_0x48c105[_0x35e6('0x2f')][_0x35e6('0x3f')]){_0x4d5dd9[_0x35e6('0x40')]=[{'all':!![]}];}return db[_0x35e6('0x2b')]['findAll'](_0x4d5dd9);})[_0x35e6('0x24')](function(_0x1a6c90){_0x5d70ab[_0x35e6('0x41')]=_0x1a6c90;return _0x5d70ab;})[_0x35e6('0x24')](respondWithFilteredResult(_0x3e8cd5,_0x4d5dd9))[_0x35e6('0x42')](handleError(_0x3e8cd5,null));};exports[_0x35e6('0x43')]=function(_0x7d29e8,_0x319f60){var _0x32d23c={'raw':!![],'where':{'id':_0x7d29e8['params']['id']}},_0x368178={};_0x368178[_0x35e6('0x31')]=_[_0x35e6('0x44')](db[_0x35e6('0x2b')]['rawAttributes']);_0x368178[_0x35e6('0x2f')]=_[_0x35e6('0x44')](_0x7d29e8['query']);_0x368178[_0x35e6('0x30')]=_[_0x35e6('0x33')](_0x368178[_0x35e6('0x31')],_0x368178[_0x35e6('0x2f')]);_0x32d23c[_0x35e6('0x32')]=_[_0x35e6('0x33')](_0x368178[_0x35e6('0x31')],qs[_0x35e6('0x34')](_0x7d29e8[_0x35e6('0x2f')][_0x35e6('0x34')]));_0x32d23c[_0x35e6('0x32')]=_0x32d23c['attributes'][_0x35e6('0x35')]?_0x32d23c[_0x35e6('0x32')]:_0x368178[_0x35e6('0x31')];if(_0x7d29e8['query'][_0x35e6('0x3f')]){_0x32d23c[_0x35e6('0x40')]=[{'all':!![]}];}_0x32d23c=_[_0x35e6('0x3b')]({},_0x32d23c,_0x7d29e8[_0x35e6('0x3e')]);return db[_0x35e6('0x2b')]['find'](_0x32d23c)[_0x35e6('0x24')](handleEntityNotFound(_0x319f60,null))[_0x35e6('0x24')](respondWithResult(_0x319f60,null))['catch'](handleError(_0x319f60,null));};exports[_0x35e6('0x45')]=function(_0x4dfc6d,_0x1a5c7d){return db[_0x35e6('0x2b')][_0x35e6('0x45')](_0x4dfc6d[_0x35e6('0x46')],{})[_0x35e6('0x24')](respondWithResult(_0x1a5c7d,0xc9))['catch'](handleError(_0x1a5c7d,null));};exports[_0x35e6('0x23')]=function(_0x528f91,_0x2e9067){if(_0x528f91[_0x35e6('0x46')]['id']){delete _0x528f91[_0x35e6('0x46')]['id'];}return db[_0x35e6('0x2b')]['find']({'where':{'id':_0x528f91['params']['id']}})['then'](handleEntityNotFound(_0x2e9067,null))[_0x35e6('0x24')](saveUpdates(_0x528f91['body'],null))[_0x35e6('0x24')](respondWithResult(_0x2e9067,null))[_0x35e6('0x42')](handleError(_0x2e9067,null));};exports[_0x35e6('0x47')]=function(_0x1cc0af,_0x57e473){return db[_0x35e6('0x2b')][_0x35e6('0x48')]({'where':{'id':_0x1cc0af[_0x35e6('0x49')]['id']}})[_0x35e6('0x24')](handleEntityNotFound(_0x57e473,null))[_0x35e6('0x24')](removeEntity(_0x57e473,null))[_0x35e6('0x42')](handleError(_0x57e473,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 13e69df..d756113 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 _0xf5b2=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0xe85054,_0x26e82b){var _0x197608=function(_0x4f2557){while(--_0x4f2557){_0xe85054['push'](_0xe85054['shift']());}};_0x197608(++_0x26e82b);}(_0xf5b2,0xfc));var _0x2f5b=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xf5b2[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f5b('0x0'))('api');var moment=require(_0x2f5b('0x1'));var BPromise=require(_0x2f5b('0x2'));var rp=require(_0x2f5b('0x3'));var fs=require('fs');var path=require(_0x2f5b('0x4'));var rimraf=require('rimraf');var config=require(_0x2f5b('0x5'));var attributes=require(_0x2f5b('0x6'));module[_0x2f5b('0x7')]=function(_0x270cd5,_0x3f5d10){return _0x270cd5[_0x2f5b('0x8')](_0x2f5b('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f5b('0xa'),'collate':_0x2f5b('0xb')});}; \ No newline at end of file +var _0x47e0=['api','bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47e0,0x1ea));var _0x047e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x47e0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x047e('0x0'));var util=require(_0x047e('0x1'));var logger=require('../../config/logger')(_0x047e('0x2'));var moment=require('moment');var BPromise=require(_0x047e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x047e('0x4'));var config=require(_0x047e('0x5'));var attributes=require(_0x047e('0x6'));module[_0x047e('0x7')]=function(_0x4738dd,_0x1642e7){return _0x4738dd['define'](_0x047e('0x8'),attributes,{'tableName':_0x047e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x047e('0xa'),'collate':_0x047e('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5554076..cf5ac11 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 _0xcf67=['catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','OpenchannelApplication,\x20%s,\x20%s','result'];(function(_0x3b14ad,_0x5e4401){var _0x392677=function(_0x4c9139){while(--_0x4c9139){_0x3b14ad['push'](_0x3b14ad['shift']());}};_0x392677(++_0x5e4401);}(_0xcf67,0xf9));var _0x7cf6=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0xcf67[_0xb7b878];return _0x3c84b9;};'use strict';var _=require(_0x7cf6('0x0'));var util=require(_0x7cf6('0x1'));var moment=require(_0x7cf6('0x2'));var BPromise=require(_0x7cf6('0x3'));var rs=require(_0x7cf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cf6('0x5'))['db'];var utils=require(_0x7cf6('0x6'));var logger=require('../../config/logger')(_0x7cf6('0x7'));var config=require(_0x7cf6('0x8'));var jayson=require(_0x7cf6('0x9'));var client=jayson[_0x7cf6('0xa')][_0x7cf6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54e08a,_0x403f05,_0x1aad57){return new BPromise(function(_0x57bf6c,_0x3db960){return client[_0x7cf6('0xc')](_0x54e08a,_0x1aad57)[_0x7cf6('0xd')](function(_0x5608f3){logger[_0x7cf6('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x403f05,_0x7cf6('0xf'));logger['debug'](_0x7cf6('0x10'),_0x403f05,_0x7cf6('0xf'),JSON['stringify'](_0x5608f3));if(_0x5608f3[_0x7cf6('0x11')]){if(_0x5608f3[_0x7cf6('0x11')]['code']===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x403f05,_0x5608f3[_0x7cf6('0x11')][_0x7cf6('0x12')]);return _0x3db960(_0x5608f3['error']['message']);}logger[_0x7cf6('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x403f05,_0x5608f3[_0x7cf6('0x11')][_0x7cf6('0x12')]);return _0x57bf6c(_0x5608f3[_0x7cf6('0x11')]['message']);}else{logger[_0x7cf6('0xe')](_0x7cf6('0x13'),_0x403f05,_0x7cf6('0xf'));_0x57bf6c(_0x5608f3[_0x7cf6('0x14')][_0x7cf6('0x12')]);}})[_0x7cf6('0x15')](function(_0x4a6756){logger['error'](_0x7cf6('0x13'),_0x403f05,_0x4a6756);_0x3db960(_0x4a6756);});});}exports[_0x7cf6('0x16')]=function(_0x57a667){var _0x5215c3=this;return new Promise(function(_0x3e7e83,_0x4e36bb){return db[_0x7cf6('0x17')]['update'](_0x57a667[_0x7cf6('0x18')],{'raw':_0x57a667['options']?_0x57a667[_0x7cf6('0x19')][_0x7cf6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57a667[_0x7cf6('0x19')]?_0x57a667[_0x7cf6('0x19')][_0x7cf6('0x1b')]||null:null,'attributes':_0x57a667[_0x7cf6('0x19')]?_0x57a667['options'][_0x7cf6('0x1c')]||null:null,'limit':_0x57a667[_0x7cf6('0x19')]?_0x57a667[_0x7cf6('0x19')]['limit']||null:null})[_0x7cf6('0xd')](function(_0x317063){logger['info'](_0x7cf6('0x16'),_0x57a667);logger['debug'](_0x7cf6('0x16'),_0x57a667,JSON[_0x7cf6('0x1d')](_0x317063));_0x3e7e83(_0x317063);})[_0x7cf6('0x15')](function(_0x1026c1){logger[_0x7cf6('0x11')](_0x7cf6('0x16'),_0x1026c1[_0x7cf6('0x12')],_0x57a667);_0x4e36bb(_0x5215c3[_0x7cf6('0x11')](0x1f4,_0x1026c1['message']));});});}; \ No newline at end of file +var _0xd650=['stringify','lodash','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelApplication','update','body','options','raw','attributes','limit','then','UpdateOpenchannelApplication'];(function(_0x242bcf,_0x27c61b){var _0x405cd2=function(_0x570e4e){while(--_0x570e4e){_0x242bcf['push'](_0x242bcf['shift']());}};_0x405cd2(++_0x27c61b);}(_0xd650,0x151));var _0x0d65=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xd650[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x0d65('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d65('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d65('0x2'));var db=require(_0x0d65('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0d65('0x4'));var jayson=require(_0x0d65('0x5'));var client=jayson[_0x0d65('0x6')][_0x0d65('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x30b368,_0x194b63,_0x29222e){return new BPromise(function(_0x2f47d3,_0x3c304a){return client['request'](_0x30b368,_0x29222e)['then'](function(_0x5d4e76){logger[_0x0d65('0x8')](_0x0d65('0x9'),_0x194b63,_0x0d65('0xa'));logger[_0x0d65('0xb')](_0x0d65('0xc'),_0x194b63,_0x0d65('0xa'),JSON['stringify'](_0x5d4e76));if(_0x5d4e76[_0x0d65('0xd')]){if(_0x5d4e76[_0x0d65('0xd')][_0x0d65('0xe')]===0x1f4){logger['error'](_0x0d65('0x9'),_0x194b63,_0x5d4e76[_0x0d65('0xd')]['message']);return _0x3c304a(_0x5d4e76['error'][_0x0d65('0xf')]);}logger[_0x0d65('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x194b63,_0x5d4e76[_0x0d65('0xd')][_0x0d65('0xf')]);return _0x2f47d3(_0x5d4e76[_0x0d65('0xd')][_0x0d65('0xf')]);}else{logger[_0x0d65('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x194b63,_0x0d65('0xa'));_0x2f47d3(_0x5d4e76[_0x0d65('0x10')][_0x0d65('0xf')]);}})[_0x0d65('0x11')](function(_0x376e6d){logger['error'](_0x0d65('0x9'),_0x194b63,_0x376e6d);_0x3c304a(_0x376e6d);});});}exports['UpdateOpenchannelApplication']=function(_0x480bcd){var _0x59857b=this;return new Promise(function(_0x2de6a1,_0x4e03e0){return db[_0x0d65('0x12')][_0x0d65('0x13')](_0x480bcd[_0x0d65('0x14')],{'raw':_0x480bcd[_0x0d65('0x15')]?_0x480bcd[_0x0d65('0x15')][_0x0d65('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x480bcd[_0x0d65('0x15')]?_0x480bcd[_0x0d65('0x15')]['where']||null:null,'attributes':_0x480bcd[_0x0d65('0x15')]?_0x480bcd[_0x0d65('0x15')][_0x0d65('0x17')]||null:null,'limit':_0x480bcd['options']?_0x480bcd[_0x0d65('0x15')][_0x0d65('0x18')]||null:null})[_0x0d65('0x19')](function(_0x27ae40){logger[_0x0d65('0x8')](_0x0d65('0x1a'),_0x480bcd);logger[_0x0d65('0xb')](_0x0d65('0x1a'),_0x480bcd,JSON[_0x0d65('0x1b')](_0x27ae40));_0x2de6a1(_0x27ae40);})[_0x0d65('0x11')](function(_0x5d53a3){logger[_0x0d65('0xd')]('UpdateOpenchannelApplication',_0x5d53a3[_0x0d65('0xf')],_0x480bcd);_0x4e03e0(_0x59857b[_0x0d65('0xd')](0x1f4,_0x5d53a3[_0x0d65('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index c7bee36..d1ed728 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 _0x8163=['create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8163,0xad));var _0x3816=function(_0x265b3c,_0x11a590){_0x265b3c=_0x265b3c-0x0;var _0x30a6da=_0x8163[_0x265b3c];return _0x30a6da;};'use strict';var multer=require(_0x3816('0x0'));var util=require(_0x3816('0x1'));var path=require('path');var timeout=require(_0x3816('0x2'));var express=require(_0x3816('0x3'));var router=express[_0x3816('0x4')]();var fs_extra=require(_0x3816('0x5'));var auth=require(_0x3816('0x6'));var interaction=require(_0x3816('0x7'));var config=require(_0x3816('0x8'));var controller=require(_0x3816('0x9'));router[_0x3816('0xa')]('/',auth[_0x3816('0xb')](),controller[_0x3816('0xc')]);router[_0x3816('0xa')](_0x3816('0xd'),auth[_0x3816('0xb')](),controller[_0x3816('0xe')]);router[_0x3816('0xa')](_0x3816('0xf'),auth[_0x3816('0xb')](),controller[_0x3816('0x10')]);router[_0x3816('0xa')]('/:id/messages',auth[_0x3816('0xb')](),controller[_0x3816('0x11')]);router[_0x3816('0xa')]('/:id/download',auth[_0x3816('0xb')](),controller['download']);router[_0x3816('0x12')]('/',auth['isAuthenticated'](),controller[_0x3816('0x13')]);router[_0x3816('0x12')](_0x3816('0x14'),auth['isAuthenticated'](),controller[_0x3816('0x15')]);router['post'](_0x3816('0x16'),auth[_0x3816('0xb')](),interaction[_0x3816('0x17')](_0x3816('0x18'),_0x3816('0x19')),controller[_0x3816('0x1a')]);router['put'](_0x3816('0xf'),auth['isAuthenticated'](),interaction[_0x3816('0x17')]('openchannel',_0x3816('0x1b')),controller[_0x3816('0x1c')]);router[_0x3816('0x1d')](_0x3816('0xf'),auth[_0x3816('0xb')](),interaction[_0x3816('0x17')](_0x3816('0x18'),_0x3816('0x1e')),controller[_0x3816('0x1f')]);router[_0x3816('0x1d')](_0x3816('0x16'),auth[_0x3816('0xb')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x47c7=['addTags','openchannelinteraction:update','update','destroy','delete','removeTags','util','path','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','openchannel'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x47c7,0xf0));var _0x747c=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0x47c7[_0x1443eb];return _0x2b8810;};'use strict';var multer=require('multer');var util=require(_0x747c('0x0'));var path=require(_0x747c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x747c('0x2')]();var fs_extra=require(_0x747c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x747c('0x4'));var controller=require(_0x747c('0x5'));router[_0x747c('0x6')]('/',auth[_0x747c('0x7')](),controller[_0x747c('0x8')]);router['get'](_0x747c('0x9'),auth[_0x747c('0x7')](),controller['describe']);router[_0x747c('0x6')](_0x747c('0xa'),auth[_0x747c('0x7')](),controller['show']);router[_0x747c('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x747c('0xb')]);router[_0x747c('0x6')](_0x747c('0xc'),auth[_0x747c('0x7')](),controller[_0x747c('0xd')]);router[_0x747c('0xe')]('/',auth['isAuthenticated'](),controller[_0x747c('0xf')]);router['post'](_0x747c('0x10'),auth[_0x747c('0x7')](),controller[_0x747c('0x11')]);router['post'](_0x747c('0x12'),auth[_0x747c('0x7')](),interaction['tracked'](_0x747c('0x13'),'openchannelinteraction:addtags'),controller[_0x747c('0x14')]);router['put']('/:id',auth[_0x747c('0x7')](),interaction['tracked'](_0x747c('0x13'),_0x747c('0x15')),controller[_0x747c('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked']('openchannel','openchannelinteraction:destroy'),controller[_0x747c('0x17')]);router[_0x747c('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0x747c('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 250c41f..28dbbfd 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 _0x0fc8=['ENUM','out','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2468b5,_0x506b9e){var _0x1056e4=function(_0x26da1c){while(--_0x26da1c){_0x2468b5['push'](_0x2468b5['shift']());}};_0x1056e4(++_0x506b9e);}(_0x0fc8,0x145));var _0x80fc=function(_0x102e7a,_0x283e8e){_0x102e7a=_0x102e7a-0x0;var _0x5239cf=_0x0fc8[_0x102e7a];return _0x5239cf;};'use strict';var Sequelize=require(_0x80fc('0x0'));module[_0x80fc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x80fc('0x2')]},'thirdDisposition':{'type':Sequelize[_0x80fc('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x80fc('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x80fc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x80fc('0x4')]('in',_0x80fc('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x80fc('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x80fc('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xb205=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb205,0x156));var _0x5b20=function(_0x28fd65,_0x15fd55){_0x28fd65=_0x28fd65-0x0;var _0x2d5eb3=_0xb205[_0x28fd65];return _0x2d5eb3;};'use strict';var Sequelize=require(_0x5b20('0x0'));module['exports']={'closed':{'type':Sequelize[_0x5b20('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5b20('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5b20('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5b20('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5b20('0x2')]},'threadId':{'type':Sequelize[_0x5b20('0x3')]},'externalUrl':{'type':Sequelize[_0x5b20('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5b20('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5b20('0x4')]('in',_0x5b20('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5b20('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x5b20('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 9d19e4c..0a885db 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 _0x53ab=['Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','direction','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','map','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','from','u.fullname','ui.OpenchannelInteractionId','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','parseSearch','conditions','length','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','buildExpression','some','isEmpty','OpenchannelAccountId','concat','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`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','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','user','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','rows','show','includeAll','options','create','params','describe','addMessage','OpenchannelMessage','ids','omit','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','Account'];(function(_0x1f3eeb,_0x285352){var _0x91229=function(_0x312727){while(--_0x312727){_0x1f3eeb['push'](_0x1f3eeb['shift']());}};_0x91229(++_0x285352);}(_0x53ab,0x101));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb53a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb53a('0x1'));var jsonpatch=require(_0xb53a('0x2'));var rp=require('request-promise');var moment=require(_0xb53a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb53a('0x4'));var util=require(_0xb53a('0x5'));var path=require(_0xb53a('0x6'));var sox=require(_0xb53a('0x7'));var csv=require(_0xb53a('0x8'));var ejs=require(_0xb53a('0x9'));var fs=require('fs');var fs_extra=require(_0xb53a('0xa'));var _=require(_0xb53a('0xb'));var squel=require(_0xb53a('0xc'));var crypto=require('crypto');var jsforce=require(_0xb53a('0xd'));var deskjs=require(_0xb53a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb53a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb53a('0x10'));var as=require(_0xb53a('0x11'));var pdf=require(_0xb53a('0x12'));var hardwareService=require(_0xb53a('0x13'));var logger=require(_0xb53a('0x14'))(_0xb53a('0x15'));var utils=require(_0xb53a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb53a('0x17'));var db=require(_0xb53a('0x18'))['db'];config[_0xb53a('0x19')]=_['defaults'](config[_0xb53a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb53a('0x1a'))(new Redis(config[_0xb53a('0x19')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1cd080,_0x32df9b){_0x32df9b=_0x32df9b||0xcc;return function(_0x347fd8){if(_0x347fd8){return _0x1cd080['sendStatus'](_0x32df9b);}return _0x1cd080[_0xb53a('0x1b')](_0x32df9b)[_0xb53a('0x1c')]();};}function respondWithResult(_0x1873e3,_0x3cdcd5){_0x3cdcd5=_0x3cdcd5||0xc8;return function(_0x21fb1e){if(_0x21fb1e){return _0x1873e3['status'](_0x3cdcd5)['json'](_0x21fb1e);}};}function respondWithFilteredResult(_0x44d882,_0xaabc10){return function(_0x4de9d9){if(_0x4de9d9){var _0x43c5e2=typeof _0xaabc10[_0xb53a('0x1d')]==='undefined'&&typeof _0xaabc10[_0xb53a('0x1e')]==='undefined';var _0x28608e=_0x4de9d9[_0xb53a('0x1f')];var _0x23a6f4=_0x43c5e2?0x0:_0xaabc10[_0xb53a('0x1d')];var _0x2f290b=_0x43c5e2?_0x4de9d9[_0xb53a('0x1f')]:_0xaabc10[_0xb53a('0x1d')]+_0xaabc10[_0xb53a('0x1e')];var _0x163f16;if(_0x2f290b>=_0x28608e){_0x2f290b=_0x28608e;_0x163f16=0xc8;}else{_0x163f16=0xce;}_0x44d882[_0xb53a('0x1b')](_0x163f16);return _0x44d882[_0xb53a('0x20')](_0xb53a('0x21'),_0x23a6f4+'-'+_0x2f290b+'/'+_0x28608e)[_0xb53a('0x22')](_0x4de9d9);}return null;};}function patchUpdates(_0x565b56){return function(_0xd21200){try{jsonpatch[_0xb53a('0x23')](_0xd21200,_0x565b56,!![]);}catch(_0x354d9f){return BPromise['reject'](_0x354d9f);}return _0xd21200[_0xb53a('0x24')]();};}function saveUpdates(_0x4e168a,_0x5b7ab3){return function(_0x8d809a){if(_0x8d809a){return _0x8d809a[_0xb53a('0x25')](_0x4e168a)[_0xb53a('0x26')](function(_0x27c868){return _0x27c868;});}return null;};}function removeEntity(_0x2e3c42,_0x9cdc3c){return function(_0x101f39){if(_0x101f39){return _0x101f39[_0xb53a('0x27')]()[_0xb53a('0x26')](function(){_0x2e3c42[_0xb53a('0x1b')](0xcc)[_0xb53a('0x1c')]();});}};}function handleEntityNotFound(_0xbed537,_0x419c29){return function(_0x27c9e3){if(!_0x27c9e3){_0xbed537[_0xb53a('0x28')](0x194);}return _0x27c9e3;};}function handleError(_0x10bba3,_0x5b1e37){_0x5b1e37=_0x5b1e37||0x1f4;return function(_0x4045db){logger['error'](_0x4045db[_0xb53a('0x29')]);if(_0x4045db[_0xb53a('0x2a')]){delete _0x4045db[_0xb53a('0x2a')];}_0x10bba3[_0xb53a('0x1b')](_0x5b1e37)[_0xb53a('0x2b')](_0x4045db);};}function getInteractionUsers(_0x67d3c2,_0x52605a){return new BPromise(function(_0x3fd34b,_0x1b4599){try{if(_0x52605a[_0x67d3c2['id']]){_0x67d3c2['Users']=_[_0xb53a('0x2c')](_0x52605a[_0x67d3c2['id']],function(_0x2767c3){return{'id':_0x2767c3['id'],'fullname':_0x2767c3['fullname']};});}}catch(_0x3f0db5){_0x1b4599(_0x3f0db5);}_0x3fd34b(_0x67d3c2);});}function getInteractionTags(_0x51aa38,_0x2ee8d5){return new BPromise(function(_0x4f721c,_0x253220){try{if(_0x51aa38[_0xb53a('0x2d')]){_0x51aa38[_0xb53a('0x2e')]=[];_0x51aa38[_0xb53a('0x2d')][_0xb53a('0x2f')](',')[_0xb53a('0x30')](function(_0x3084a3){_0x51aa38['Tags'][_0xb53a('0x31')](_0x2ee8d5[_0x3084a3]);});}delete _0x51aa38[_0xb53a('0x2d')];}catch(_0x116564){_0x253220(_0x116564);}_0x4f721c(_0x51aa38);});}function updateOpenchannelInteraction(_0x303e2b,_0xf86b77,_0x1c439f){return new BPromise(function(_0x31a8aa,_0x5a4243){return getInteractionUsers(_0x303e2b,_0x1c439f)[_0xb53a('0x26')](function(_0x5bfa3f){return getInteractionTags(_0x5bfa3f,_0xf86b77);})[_0xb53a('0x26')](function(_0x48c6a3){_0x31a8aa(_0x48c6a3);})[_0xb53a('0x32')](function(_0x6d33d7){_0x5a4243(_0x6d33d7);});});}exports[_0xb53a('0x33')]=function(_0x44b286,_0x5e7db6){var _0x826038={},_0x3c7fc9={},_0xa750f8={'count':0x0,'rows':[]};var _0x4a20f3=_[_0xb53a('0x2c')](db[_0xb53a('0x34')][_0xb53a('0x35')],function(_0x2ab853){return{'name':_0x2ab853[_0xb53a('0x36')],'type':_0x2ab853[_0xb53a('0x37')]['key']};});_0x3c7fc9[_0xb53a('0x38')]=_[_0xb53a('0x2c')](_0x4a20f3,_0xb53a('0x2a'));_0x3c7fc9[_0xb53a('0x39')]=_[_0xb53a('0x3a')](_0x44b286[_0xb53a('0x39')]);_0x3c7fc9[_0xb53a('0x3b')]=_[_0xb53a('0x3c')](_0x3c7fc9[_0xb53a('0x38')],_0x3c7fc9[_0xb53a('0x39')]);_0x826038[_0xb53a('0x3d')]=_[_0xb53a('0x3c')](_0x3c7fc9[_0xb53a('0x38')],qs['fields'](_0x44b286[_0xb53a('0x39')][_0xb53a('0x3e')]));_0x826038[_0xb53a('0x3d')]=_0x826038[_0xb53a('0x3d')]['length']?_0x826038[_0xb53a('0x3d')]:_0x3c7fc9['model'];if(!_0x44b286['query']['hasOwnProperty'](_0xb53a('0x3f'))){_0x826038[_0xb53a('0x1e')]=qs['limit'](_0x44b286[_0xb53a('0x39')][_0xb53a('0x1e')]);_0x826038[_0xb53a('0x1d')]=qs[_0xb53a('0x1d')](_0x44b286[_0xb53a('0x39')][_0xb53a('0x1d')]);}_0x826038[_0xb53a('0x40')]=qs[_0xb53a('0x41')](_0x44b286[_0xb53a('0x39')][_0xb53a('0x41')]);_0x826038[_0xb53a('0x42')]=qs[_0xb53a('0x3b')](_[_0xb53a('0x43')](_0x44b286[_0xb53a('0x39')],_0x3c7fc9[_0xb53a('0x3b')]),_0x4a20f3);var _0x531cf1=[];var _0x4b4e6f=squel[_0xb53a('0x44')]()[_0xb53a('0x45')]('id')[_0xb53a('0x45')](_0xb53a('0x2a'))['field']('color')[_0xb53a('0x46')]('tools_tags');var _0x3b4937=squel['select']()[_0xb53a('0x45')]('u.id')[_0xb53a('0x45')](_0xb53a('0x47'))['field'](_0xb53a('0x48'))[_0xb53a('0x46')]('user_has_openchannel_interactions','ui')['left_join'](_0xb53a('0x49'),'u',_0xb53a('0x4a'));var _0x4a8c70=squel[_0xb53a('0x44')]()['from'](_0xb53a('0x4b'),'i')[_0xb53a('0x4c')]('cm_contacts','c',_0xb53a('0x4d'))['left_join'](_0xb53a('0x49'),'o',_0xb53a('0x4e'))['left_join'](_0xb53a('0x4f'),'a',_0xb53a('0x50'))[_0xb53a('0x4c')](_0xb53a('0x51'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xb53a('0x4c')](_0xb53a('0x52'),'it',_0xb53a('0x53'))[_0xb53a('0x4c')](_0xb53a('0x54'),'t','t.id\x20=\x20it.TagId');var _0x46113f=squel[_0xb53a('0x55')]();var _0x66dcdc=[];var _0x128c43=squel[_0xb53a('0x55')]();var _0x36d74e;if(_0x44b286[_0xb53a('0x39')]['search']){_0x36d74e=as[_0xb53a('0x56')](_0x44b286[_0xb53a('0x39')]['search']);var _0x2b0f7e=_0x36d74e['sqlOperator'];for(var _0x3456d2=0x0;_0x3456d2<_0x36d74e[_0xb53a('0x57')][_0xb53a('0x58')];_0x3456d2++){var _0x6c7c5a=_0x36d74e[_0xb53a('0x57')][_0x3456d2];var _0x4dfe92='i';var _0x59b100=_['find'](_0x4a20f3,['name',_0x6c7c5a[_0xb53a('0x45')]]);if(!_0x59b100){switch(_0x6c7c5a[_0xb53a('0x45')]){case _0xb53a('0x59'):if(_0x6c7c5a['value']==0x1){_0x4a8c70[_0xb53a('0x5a')]('`'+_0x6c7c5a[_0xb53a('0x45')]+_0xb53a('0x5b'));}else{_0x4a8c70[_0xb53a('0x5a')]('`'+_0x6c7c5a[_0xb53a('0x45')]+_0xb53a('0x5c'));}break;case _0xb53a('0x5d'):if(_0x6c7c5a[_0xb53a('0x5e')]===_0xb53a('0x5f')){if(_0x6c7c5a[_0xb53a('0x60')][_0xb53a('0x2f')]('\x20')[_0xb53a('0x58')]>0x1){_0x46113f[_0x2b0f7e](_0xb53a('0x61'),qs[_0xb53a('0x62')](_0x6c7c5a[_0xb53a('0x60')]),null);}else{var _0x11132f='%'+_0x6c7c5a[_0xb53a('0x60')]+'%';_0x46113f[_0x2b0f7e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x11132f,_0x11132f,_0x11132f);}}else{_0x59b100=_[_0xb53a('0x63')](_0x4a20f3,[_0xb53a('0x2a'),_0xb53a('0x64')]);_0x6c7c5a['field']=_0xb53a('0x64');_0x28216a=as['buildExpression'](_0x4dfe92,_0x59b100[_0xb53a('0x37')],_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a['text'],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')]['end']);}break;case _0xb53a('0x66'):var _0x26825e=_0x6c7c5a[_0xb53a('0x60')]['split'](',')['map'](function(_0x1f1a16){return Number(_0x1f1a16);});_0x26825e[_0xb53a('0x30')](function(_0x11304f){_0x128c43['or'](_0xb53a('0x67'),'%,'+_0x11304f+',%');});_0x66dcdc=_['union'](_0x66dcdc,_0x26825e);break;case _0xb53a('0x68'):if(_0x6c7c5a[_0xb53a('0x5e')]===_0xb53a('0x5f')){_0x46113f[_0x2b0f7e](_0xb53a('0x69'),'%'+_0x6c7c5a['value']+'%',null);}else{_0x59b100=_[_0xb53a('0x63')](_0x4a20f3,[_0xb53a('0x2a'),'UserId']);_0x6c7c5a['field']='UserId';_0x28216a=as['buildExpression'](_0x4dfe92,_0x59b100[_0xb53a('0x37')],_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a[_0xb53a('0x6a')],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')][_0xb53a('0x1c')]);}break;case _0xb53a('0x6b'):_0x28216a=as[_0xb53a('0x6c')]('me',null,_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a['text'],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')]['end']);break;}}else{var _0x28216a=as[_0xb53a('0x6c')](_0x4dfe92,_0x59b100[_0xb53a('0x37')],_0x6c7c5a);_0x46113f[_0x2b0f7e](_0x28216a['text'],_0x28216a[_0xb53a('0x60')][_0xb53a('0x65')],_0x28216a[_0xb53a('0x60')][_0xb53a('0x1c')]);}}}else{var _0x483fa8=_(_0x44b286[_0xb53a('0x39')])[_0xb53a('0x3a')]()[_0xb53a('0x2c')](function(_0x18d0bc){return _[_0xb53a('0x6d')](_0x4a20f3,[_0xb53a('0x2a'),_0x18d0bc])?_0x18d0bc:undefined;})['compact']()[_0xb53a('0x60')]();if(!_[_0xb53a('0x6e')](_0x483fa8)){_0x483fa8[_0xb53a('0x30')](function(_0x1ec0e6){if(_0x1ec0e6===_0xb53a('0x6f')){_0x4a8c70[_0xb53a('0x42')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xb53a('0x70')](_0x44b286[_0xb53a('0x39')][_0x1ec0e6]));}else if(_0x1ec0e6==='createdAt'){var _0x32bc9e=JSON['parse'](_0x44b286[_0xb53a('0x39')][_0x1ec0e6])[_0xb53a('0x71')];var _0xc5d8ab=JSON['parse'](_0x44b286['query'][_0x1ec0e6])[_0xb53a('0x72')];_0x4a8c70[_0xb53a('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x32bc9e,_0xc5d8ab);}else{if(_0x44b286[_0xb53a('0x39')][_0x1ec0e6]===_0xb53a('0x73')){_0x4a8c70[_0xb53a('0x42')]('i.'+_0x1ec0e6+_0xb53a('0x74'));}else{_0x4a8c70[_0xb53a('0x42')]('i.'+_0x1ec0e6+_0xb53a('0x75'),_0x44b286[_0xb53a('0x39')][_0x1ec0e6]);}}});}if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x76')]){if(_0x44b286[_0xb53a('0x39')]['read']==0x1){_0x4a8c70[_0xb53a('0x5a')](_0xb53a('0x77'));}else{_0x4a8c70[_0xb53a('0x5a')]('`unreadMessages`\x20>\x200');}}if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')]){_0x66dcdc=_[_0xb53a('0x79')](_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')])?_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')]:new Array(_0x44b286[_0xb53a('0x39')][_0xb53a('0x78')]);_0x66dcdc['forEach'](function(_0x107e3f){_0x128c43['or'](_0xb53a('0x67'),'%,'+_0x107e3f+',%');});}if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x7a')]){var _0x445a4e=_0x44b286[_0xb53a('0x39')]['filter'][_0xb53a('0x7b')]('\x5c','\x5c\x5c')[_0xb53a('0x7b')](/'/g,'\x27\x27');if(qs[_0xb53a('0x7c')](_0x445a4e)){_0x46113f['or'](_0xb53a('0x7d'),_0x445a4e+'%');}else{_0x46113f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x445a4e))['or']('i.from\x20LIKE\x20?',_0x445a4e+'%')['or'](_0xb53a('0x7e'),_0x445a4e+'%');}}}_0x4a8c70[_0xb53a('0x42')](_0x46113f);_0x4a8c70[_0xb53a('0x7f')](_0xb53a('0x80'));var _0x448ba1={'type':db[_0xb53a('0x81')][_0xb53a('0x82')]['SELECT'],'raw':!![]};var _0x5d0a1b=_0x4a8c70[_0xb53a('0x83')]();_0x5d0a1b[_0xb53a('0x45')](_0xb53a('0x80'));_0x5d0a1b[_0xb53a('0x45')](_0xb53a('0x84'),_0xb53a('0x59'));if(_0x826038['order']){_0x826038[_0xb53a('0x40')][_0xb53a('0x30')](function(_0xc32bd2){var _0x49a844=_0xc32bd2[0x0]===_0xb53a('0x85')?_0xc32bd2[0x0]:'i.'+_0xc32bd2[0x0];_0x4a8c70[_0xb53a('0x40')](_0x49a844,_0xc32bd2[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb53a('0x6e')](_0x66dcdc)){_0x4a8c70[_0xb53a('0x5a')](_0x128c43);_0x5d0a1b['where'](_0xb53a('0x86'),_0x66dcdc);}BPromise[_0xb53a('0x87')]()[_0xb53a('0x26')](function(){if(!_0x36d74e){if(_0x44b286[_0xb53a('0x39')]['OpenchannelAccountId'])return;_0x5d0a1b[_0xb53a('0x42')](_0xb53a('0x88'));_0x4a8c70[_0xb53a('0x42')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x44b286['user'][_0xb53a('0x89')]!==_0xb53a('0x8a'))return;return _0x44b286['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xb53a('0x26')](function(_0x1e76da){if(_[_0xb53a('0x6e')](_0x1e76da)){_0x5d0a1b[_0xb53a('0x42')](_0xb53a('0x8b'));_0x4a8c70[_0xb53a('0x42')](_0xb53a('0x8b'));}else{_0x5d0a1b['where'](_0xb53a('0x8c'),_['map'](_0x1e76da,'id'));_0x4a8c70[_0xb53a('0x42')](_0xb53a('0x8c'),_[_0xb53a('0x2c')](_0x1e76da,'id'));}});})[_0xb53a('0x26')](function(){if(_0x44b286[_0xb53a('0x8d')]['role']===_0xb53a('0x8a')&&!_0x36d74e&&!_0x44b286[_0xb53a('0x39')]['OpenchannelAccountId'])return[];return db[_0xb53a('0x8e')]['query'](_0x5d0a1b[_0xb53a('0x8f')](),_0x448ba1);})[_0xb53a('0x26')](function(_0x826d34){_0xa750f8[_0xb53a('0x1f')]=_0x826d34[_0xb53a('0x58')];if(_0xa750f8['count']===0x0)return[];return db[_0xb53a('0x8e')][_0xb53a('0x39')](_0x4b4e6f[_0xb53a('0x8f')](),_0x448ba1)[_0xb53a('0x26')](function(_0x5c8d5a){_0x531cf1=_[_0xb53a('0x90')](_0x5c8d5a,'id');_0x448ba1=_[_0xb53a('0x91')](_0x448ba1,{'model':db[_0xb53a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44b286[_0xb53a('0x39')][_0xb53a('0x3e')]){_0x826038[_0xb53a('0x3d')][_0xb53a('0x30')](function(_0x5e72f1){_0x4a8c70[_0xb53a('0x45')]('i.'+_0x5e72f1);});}else{_0x4a8c70[_0xb53a('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb53a('0x59'));_0x4a8c70['field']('a.key',_0xb53a('0x92'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x93'),_0xb53a('0x94'));_0x4a8c70['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4a8c70['field'](_0xb53a('0x95'));_0x4a8c70['field'](_0xb53a('0x96'),_0xb53a('0x97'));_0x4a8c70[_0xb53a('0x45')]('c.lastName',_0xb53a('0x98'));_0x4a8c70['field'](_0xb53a('0x99'),_0xb53a('0x9a'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x9b'),_0xb53a('0x9c'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x9d'),_0xb53a('0x9e'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0x9f'),_0xb53a('0xa0'));_0x4a8c70[_0xb53a('0x45')]('o.fullname',_0xb53a('0xa1'));_0x4a8c70['field'](_0xb53a('0xa2'),_0xb53a('0xa3'));_0x4a8c70[_0xb53a('0x45')](_0xb53a('0xa4'),_0xb53a('0x2d'));}if(_0x826038[_0xb53a('0x1e')])_0x4a8c70[_0xb53a('0x1e')](_0x826038['limit']);if(_0x826038[_0xb53a('0x1d')])_0x4a8c70['offset'](_0x826038[_0xb53a('0x1d')]);return db['sequelize'][_0xb53a('0x39')](_0x4a8c70[_0xb53a('0x8f')](),_0x448ba1);})[_0xb53a('0x26')](function(_0xd04c54){if(_0xd04c54[_0xb53a('0x58')]>0x0)_0x3b4937['where'](_0xb53a('0xa5'),_['map'](_0xd04c54,'id'));return db[_0xb53a('0x8e')][_0xb53a('0x39')](_0x3b4937[_0xb53a('0x8f')](),_0x448ba1)[_0xb53a('0x26')](function(_0x48c680){var _0x5b273c=_['groupBy'](_0x48c680,_0xb53a('0xa6'));var _0x20f26f=[];_0xd04c54[_0xb53a('0x30')](function(_0x478197){_0x20f26f[_0xb53a('0x31')](updateOpenchannelInteraction(_0x478197,_0x531cf1,_0x5b273c));});return BPromise['all'](_0x20f26f);});});})[_0xb53a('0x26')](function(_0x1085b3){_0xa750f8[_0xb53a('0xa7')]=_0x1085b3;return _0xa750f8;})['then'](respondWithFilteredResult(_0x5e7db6,_0x826038))[_0xb53a('0x32')](handleError(_0x5e7db6,null));};exports[_0xb53a('0xa8')]=function(_0x1a2952,_0x58de77){var _0x1a67f2={};if(_0x1a2952[_0xb53a('0x39')][_0xb53a('0x37')]&&_0x1a2952[_0xb53a('0x39')]['type']===_0xb53a('0x46')){_0x1a67f2[_0xb53a('0x46')]=_0x1a2952['params']['id'];}else{_0x1a67f2['id']=_0x1a2952['params']['id'];}var _0x7abd1b={'raw':![],'where':_0x1a67f2},_0x14971d={};_0x14971d[_0xb53a('0x38')]=_[_0xb53a('0x3a')](db[_0xb53a('0x34')][_0xb53a('0x35')]);_0x14971d[_0xb53a('0x39')]=_['keys'](_0x1a2952['query']);_0x14971d['filters']=_[_0xb53a('0x3c')](_0x14971d[_0xb53a('0x38')],_0x14971d['query']);_0x7abd1b[_0xb53a('0x3d')]=_['intersection'](_0x14971d[_0xb53a('0x38')],qs[_0xb53a('0x3e')](_0x1a2952[_0xb53a('0x39')]['fields']));_0x7abd1b[_0xb53a('0x3d')]=_0x7abd1b['attributes'][_0xb53a('0x58')]?_0x7abd1b[_0xb53a('0x3d')]:_0x14971d['model'];if(_0x1a2952[_0xb53a('0x39')][_0xb53a('0xa9')]){_0x7abd1b['include']=[{'all':!![]}];}_0x7abd1b=_[_0xb53a('0x91')]({},_0x7abd1b,_0x1a2952[_0xb53a('0xaa')]);return db[_0xb53a('0x34')]['find'](_0x7abd1b)[_0xb53a('0x26')](handleEntityNotFound(_0x58de77,null))[_0xb53a('0x26')](respondWithResult(_0x58de77,null))['catch'](handleError(_0x58de77,null));};exports[_0xb53a('0xab')]=function(_0x54d981,_0x866698){return db['OpenchannelInteraction'][_0xb53a('0xab')](_0x54d981[_0xb53a('0x6b')],{})[_0xb53a('0x26')](respondWithResult(_0x866698,0xc9))[_0xb53a('0x32')](handleError(_0x866698,null));};exports[_0xb53a('0x25')]=function(_0x45cd0b,_0x2777db){if(_0x45cd0b['body']['id']){delete _0x45cd0b[_0xb53a('0x6b')]['id'];}return db[_0xb53a('0x34')]['find']({'where':{'id':_0x45cd0b[_0xb53a('0xac')]['id']}})['then'](handleEntityNotFound(_0x2777db,null))['then'](saveUpdates(_0x45cd0b[_0xb53a('0x6b')],null))[_0xb53a('0x26')](respondWithResult(_0x2777db,null))[_0xb53a('0x32')](handleError(_0x2777db,null));};exports['destroy']=function(_0x4ac19f,_0x43d59e){return db[_0xb53a('0x34')][_0xb53a('0x63')]({'where':{'id':_0x4ac19f[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x43d59e,null))[_0xb53a('0x26')](removeEntity(_0x43d59e,null))[_0xb53a('0x32')](handleError(_0x43d59e,null));};exports['describe']=function(_0x59d2f8,_0x5c5c71){return db[_0xb53a('0x34')][_0xb53a('0xad')]()[_0xb53a('0x26')](respondWithResult(_0x5c5c71,null))[_0xb53a('0x32')](handleError(_0x5c5c71,null));};exports[_0xb53a('0xae')]=function(_0xd040d4,_0x595007,_0x24cb19){return db[_0xb53a('0xaf')][_0xb53a('0x63')]({'where':{'id':_0xd040d4[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x595007,null))[_0xb53a('0x26')](function(_0x5e5f3c){if(_0x5e5f3c){return _0x5e5f3c[_0xb53a('0xae')](_0xd040d4[_0xb53a('0x6b')][_0xb53a('0xb0')],_[_0xb53a('0xb1')](_0xd040d4[_0xb53a('0x6b')],[_0xb53a('0xb0'),'id'])||{});}})[_0xb53a('0x26')](respondWithResult(_0x595007,null))[_0xb53a('0x32')](handleError(_0x595007,null));};exports['getMessages']=function(_0x2c2933,_0x53194c,_0x567de1){var _0x2579e6={'raw':![],'where':{}};var _0x584d52={};var _0x5f4b45={'count':0x0,'rows':[]};return db[_0xb53a('0x34')][_0xb53a('0xb2')]({'where':{'id':_0x2c2933['params']['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x53194c,null))['then'](function(_0x5a853a){if(_0x5a853a){_0x584d52['model']=_[_0xb53a('0x3a')](db[_0xb53a('0xaf')][_0xb53a('0x35')]);_0x584d52[_0xb53a('0x39')]=_[_0xb53a('0x3a')](_0x2c2933['query']);_0x584d52['filters']=_[_0xb53a('0x3c')](_0x584d52['model'],_0x584d52[_0xb53a('0x39')]);_0x2579e6['attributes']=_[_0xb53a('0x3c')](_0x584d52[_0xb53a('0x38')],qs['fields'](_0x2c2933[_0xb53a('0x39')][_0xb53a('0x3e')]));_0x2579e6[_0xb53a('0x3d')]=_0x2579e6[_0xb53a('0x3d')][_0xb53a('0x58')]?_0x2579e6[_0xb53a('0x3d')]:_0x584d52[_0xb53a('0x38')];if(!_0x2c2933[_0xb53a('0x39')][_0xb53a('0xb3')](_0xb53a('0x3f'))){_0x2579e6['limit']=qs[_0xb53a('0x1e')](_0x2c2933[_0xb53a('0x39')][_0xb53a('0x1e')]);_0x2579e6[_0xb53a('0x1d')]=qs['offset'](_0x2c2933['query'][_0xb53a('0x1d')]);}_0x2579e6[_0xb53a('0x40')]=qs['sort'](_0x2c2933['query']['sort']);_0x2579e6[_0xb53a('0x42')]=qs[_0xb53a('0x3b')](_[_0xb53a('0x43')](_0x2c2933['query'],_0x584d52['filters']));_0x2579e6[_0xb53a('0x42')][_0xb53a('0xa6')]=_0x5a853a['id'];if(_0x2c2933[_0xb53a('0x39')][_0xb53a('0x7a')]){_0x2579e6['where']=_[_0xb53a('0x91')](_0x2579e6[_0xb53a('0x42')],{'$or':_[_0xb53a('0x2c')](_0x2579e6[_0xb53a('0x3d')],function(_0x5bf1e9){var _0x5cbda0={};_0x5cbda0[_0x5bf1e9]={'$like':'%'+_0x2c2933['query'][_0xb53a('0x7a')]+'%'};return _0x5cbda0;})});}if(_0x2c2933['query'][_0xb53a('0x71')]){var _0x29586d=_0x2c2933[_0xb53a('0x39')][_0xb53a('0x71')][_0xb53a('0x2f')](',');var _0x33caba={};_0x33caba[_0x29586d[0x0]]={'$gte':moment(_0x29586d[0x1])[_0xb53a('0xb4')](_0xb53a('0xb5'))};_0x2579e6[_0xb53a('0x42')]=_[_0xb53a('0x91')](_0x2579e6['where'],_0x33caba);}_0x2579e6=_[_0xb53a('0x91')]({},_0x2579e6,_0x2c2933[_0xb53a('0xaa')]);return db[_0xb53a('0xaf')][_0xb53a('0x1f')]({'where':_0x2579e6[_0xb53a('0x42')]})[_0xb53a('0x26')](function(_0x2573ea){_0x5f4b45[_0xb53a('0x1f')]=_0x2573ea;if(_0x2c2933[_0xb53a('0x39')]['includeAll']){_0x2579e6[_0xb53a('0xb6')]=[{'all':!![]}];}return db[_0xb53a('0xaf')]['findAll'](_0x2579e6);})[_0xb53a('0x26')](function(_0x2afc50){_0x5f4b45[_0xb53a('0xa7')]=_0x2afc50;return _0x5f4b45;});}})[_0xb53a('0x26')](respondWithFilteredResult(_0x53194c,_0x2579e6))[_0xb53a('0x32')](handleError(_0x53194c,null));};exports[_0xb53a('0xb7')]=function(_0x2c3f19,_0x17f579,_0x333b47){return db[_0xb53a('0x34')][_0xb53a('0x63')]({'where':{'id':_0x2c3f19[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x17f579,null))[_0xb53a('0x26')](function(_0x1a2a2a){if(_0x1a2a2a){return _0x1a2a2a[_0xb53a('0xb8')](_0x2c3f19[_0xb53a('0x6b')][_0xb53a('0xb0')],_[_0xb53a('0xb1')](_0x2c3f19['body'],[_0xb53a('0xb0'),'id'])||{})[_0xb53a('0xb9')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xb53a('0xba')],'where':{'id':_0x2c3f19[_0xb53a('0x6b')][_0xb53a('0xb0')]}});})['then'](function(_0x215383){socket[_0xb53a('0xbb')](_0xb53a('0xbc'),{'id':Number(_0x2c3f19[_0xb53a('0xac')]['id']),'tags':_0x215383||[]});return{'id':Number(_0x2c3f19[_0xb53a('0xac')]['id']),'tags':_0x215383||[]};});}})[_0xb53a('0x26')](respondWithResult(_0x17f579,null))[_0xb53a('0x32')](handleError(_0x17f579,null));};exports[_0xb53a('0xbd')]=function(_0x2a38f5,_0x37f822,_0x33c89d){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2a38f5[_0xb53a('0xac')]['id']}})[_0xb53a('0x26')](handleEntityNotFound(_0x37f822,null))[_0xb53a('0x26')](function(_0x253432){if(_0x253432){return _0x253432['removeTags'](_0x2a38f5[_0xb53a('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x37f822,null))[_0xb53a('0x32')](handleError(_0x37f822,null));};exports[_0xb53a('0xbe')]=function(_0x1b7b48,_0x42cf77){var _0x2e45e4=moment()[_0xb53a('0xbf')]()['toString']();var _0x573d74=path[_0xb53a('0xc0')](config[_0xb53a('0xc1')],_0xb53a('0xc2'),'files',_0xb53a('0xc3'));var _0x14eb1d=path['join'](config[_0xb53a('0xc1')],_0xb53a('0xc2'),'files',_0xb53a('0xc4'));var _0x26ad7a=path[_0xb53a('0xc0')](_0x573d74,_0x2e45e4);var _0x44a187=util[_0xb53a('0xb4')](_0xb53a('0xc5'),_0x1b7b48[_0xb53a('0xac')]['id'],_0x2e45e4);var _0x21fccb=path[_0xb53a('0xc0')](_0x573d74,_0x44a187);var _0x352f88=[];_0x352f88[_0xb53a('0x31')]({'model':db[_0xb53a('0x68')],'as':_0xb53a('0x68'),'attributes':['id',_0xb53a('0xc6')],'raw':!![]});_0x352f88[_0xb53a('0x31')]({'model':db[_0xb53a('0xc7')],'as':_0xb53a('0x5d'),'attributes':['id',_0xb53a('0xc8'),_0xb53a('0xc9')],'raw':!![]});if(_0x1b7b48[_0xb53a('0x39')][_0xb53a('0xc4')]){_0x352f88[_0xb53a('0x31')]({'model':db[_0xb53a('0xca')],'as':_0xb53a('0xca'),'raw':!![]});}var _0x8ef33=[{'model':db['OpenchannelMessage'],'as':_0xb53a('0xcb'),'attributes':['id',_0xb53a('0x6b'),_0xb53a('0xcc'),'direction',_0xb53a('0xcd'),_0xb53a('0x76')],'include':_0x352f88}];_0x8ef33[_0xb53a('0x31')]({'model':db['OpenchannelAccount'],'as':_0xb53a('0xce'),'attributes':['id',_0xb53a('0x2a')]});_0x8ef33[_0xb53a('0x31')]({'model':db[_0xb53a('0x68')],'as':_0xb53a('0xcf'),'attributes':['id','fullname']});return db[_0xb53a('0x34')][_0xb53a('0x63')]({'where':{'id':_0x1b7b48[_0xb53a('0xac')]['id']},'include':_0x8ef33})['then'](handleEntityNotFound(_0x42cf77,null))['then'](function(_0x159b11){if(_0x159b11){var _0x141565=_0x159b11[_0xb53a('0xd0')]({'plain':!![]});fs[_0xb53a('0xd1')](_0x26ad7a);var _0x560b56={'channel':_0xb53a('0xd2'),'account':_0x141565[_0xb53a('0xce')][_0xb53a('0x2a')],'agent':_0x141565['Owner']?_0x141565[_0xb53a('0xcf')][_0xb53a('0xc6')]:_0xb53a('0xd3'),'createdAt':moment(_0x141565[_0xb53a('0xcc')])[_0xb53a('0xb4')](_0xb53a('0xb5'))[_0xb53a('0x8f')](),'closedAt':_0x141565[_0xb53a('0xd4')]?moment(_0x141565[_0xb53a('0xd5')])['format'](_0xb53a('0xb5'))['toString']():'','disposition':_0x141565[_0xb53a('0xd6')],'visibility':_0x141565[_0xb53a('0xd7')]?_0xb53a('0xd8'):_0xb53a('0xd9'),'messages':_(_0x141565[_0xb53a('0xcb')])[_0xb53a('0x7a')]({'secret':![]})[_0xb53a('0x2c')](function(_0x4f7bc9){if(_0x4f7bc9[_0xb53a('0xca')]){var _0x10c742=path[_0xb53a('0xc0')](_0x14eb1d,_0x4f7bc9[_0xb53a('0xca')][_0xb53a('0xda')]);if(fs[_0xb53a('0xdb')](_0x10c742)){fs[_0xb53a('0xdc')](_0x10c742)[_0xb53a('0xdd')](fs[_0xb53a('0xde')](path['join'](_0x26ad7a,_0x4f7bc9[_0xb53a('0xca')][_0xb53a('0xda')])));}}return{'date':moment(_0x4f7bc9[_0xb53a('0xcc')])['format'](_0xb53a('0xb5'))['toString'](),'sender':_0x4f7bc9['direction']===_0xb53a('0xdf')?_0x4f7bc9[_0xb53a('0x68')]?_0x4f7bc9[_0xb53a('0x68')][_0xb53a('0xc6')]:_0xb53a('0xe0'):_0x4f7bc9[_0xb53a('0x5d')][_0xb53a('0xc8')]+(_0x4f7bc9[_0xb53a('0x5d')][_0xb53a('0xc9')]?'\x20'+_0x4f7bc9[_0xb53a('0x5d')][_0xb53a('0xc9')]:''),'body':_0x4f7bc9[_0xb53a('0xca')]?_0x4f7bc9['Attachment'][_0xb53a('0xda')]:_0x4f7bc9['body'],'direction':_0x4f7bc9[_0xb53a('0xe1')]===_0xb53a('0xdf')?'A':'C','secret':_0x4f7bc9[_0xb53a('0xcd')],'read':_0x4f7bc9[_0xb53a('0x76')],'attachment':_0x4f7bc9[_0xb53a('0xca')]};})[_0xb53a('0x60')]()};return ejs[_0xb53a('0xe2')](path['join'](config[_0xb53a('0xc1')],_0xb53a('0xc2'),'views',_0xb53a('0xe3')),{'interaction':_0x560b56})[_0xb53a('0x26')](function(_0x39c065){var _0x34bc59=path[_0xb53a('0xc0')](_0x26ad7a,_0xb53a('0xe4')+_0x141565['id']+'-'+_0x2e45e4+'.pdf');var _0x522054={'path':_0x34bc59,'channel':'Openchannel','interactionId':_0x141565['id']};return pdf[_0xb53a('0xe5')](_0x39c065,_0x522054);})[_0xb53a('0x26')](function(){return new BPromise(function(_0x475334,_0x3bc69f){zipdir(_0x26ad7a,{'saveTo':_0x21fccb},function(_0x1bec5a,_0x29e69b){if(_0x1bec5a)return _0x3bc69f(_0x1bec5a);return _0x475334(_0x29e69b);});})[_0xb53a('0x26')](function(){return new BPromise(function(_0x48d78e,_0x5b7320){rimraf(_0x26ad7a,function(_0x27ad55){if(_0x27ad55)_0x5b7320(_0x27ad55);return _0x48d78e();});});})[_0xb53a('0x26')](function(){return _0x42cf77[_0xb53a('0xbe')](_0x21fccb,_0x44a187,function(_0x4edb66){if(_0x4edb66){console['log'](_0xb53a('0xe6'),_0x4edb66);}else{fs[_0xb53a('0xe7')](_0x21fccb);}});});});}else{return _0x42cf77[_0xb53a('0x28')](0xc8);}})[_0xb53a('0x32')](handleError(_0x42cf77,null));}; \ No newline at end of file +var _0x6d45=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','start','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','$gte','$lte','where','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?','group','Sequelize','i.id','order','contactName','DESC','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','all','rows','catch','show','params','includeAll','include','create','describe','addMessage','OpenchannelMessage','ids','omit','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','format','fullname','CmContact','firstName','lastName','direction','secret','OpenchannelAccount','Owner','get','mkdirSync','Account','N.A.','closed','closedAt','disposition','Messages','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','downloadInteraction.ejs','transcript-','err','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','field','color','tools_tags','select','u.id','u.fullname','from','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring'];(function(_0x8036e9,_0xb2a199){var _0x34a8eb=function(_0xa35740){while(--_0xa35740){_0x8036e9['push'](_0x8036e9['shift']());}};_0x34a8eb(++_0xb2a199);}(_0x6d45,0x75));var _0x56d4=function(_0x21d1eb,_0x56f664){_0x21d1eb=_0x21d1eb-0x0;var _0x4cb8cd=_0x6d45[_0x21d1eb];return _0x4cb8cd;};'use strict';var emlformat=require(_0x56d4('0x0'));var rimraf=require(_0x56d4('0x1'));var zipdir=require(_0x56d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x56d4('0x3'));var BPromise=require(_0x56d4('0x4'));var Mustache=require('mustache');var util=require(_0x56d4('0x5'));var path=require(_0x56d4('0x6'));var sox=require(_0x56d4('0x7'));var csv=require(_0x56d4('0x8'));var ejs=require(_0x56d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x56d4('0xa'));var crypto=require(_0x56d4('0xb'));var jsforce=require(_0x56d4('0xc'));var deskjs=require(_0x56d4('0xd'));var toCsv=require(_0x56d4('0x8'));var querystring=require(_0x56d4('0xe'));var Papa=require(_0x56d4('0xf'));var Redis=require(_0x56d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x56d4('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x56d4('0x12'));var logger=require(_0x56d4('0x13'))(_0x56d4('0x14'));var utils=require(_0x56d4('0x15'));var config=require(_0x56d4('0x16'));var licenseUtil=require(_0x56d4('0x17'));var db=require(_0x56d4('0x18'))['db'];config['redis']=_[_0x56d4('0x19')](config[_0x56d4('0x1a')],{'host':_0x56d4('0x1b'),'port':0x18eb});var socket=require(_0x56d4('0x1c'))(new Redis(config[_0x56d4('0x1a')]));require(_0x56d4('0x1d'))[_0x56d4('0x1e')](socket);function respondWithStatusCode(_0x37ec8f,_0x277823){_0x277823=_0x277823||0xcc;return function(_0x39fed7){if(_0x39fed7){return _0x37ec8f[_0x56d4('0x1f')](_0x277823);}return _0x37ec8f[_0x56d4('0x20')](_0x277823)[_0x56d4('0x21')]();};}function respondWithResult(_0x485a97,_0x3d8a9e){_0x3d8a9e=_0x3d8a9e||0xc8;return function(_0x1283b1){if(_0x1283b1){return _0x485a97['status'](_0x3d8a9e)[_0x56d4('0x22')](_0x1283b1);}};}function respondWithFilteredResult(_0x25fa06,_0x384225){return function(_0x28e4c2){if(_0x28e4c2){var _0x46257d=typeof _0x384225[_0x56d4('0x23')]==='undefined'&&typeof _0x384225['limit']==='undefined';var _0x1e5380=_0x28e4c2[_0x56d4('0x24')];var _0x3d9416=_0x46257d?0x0:_0x384225[_0x56d4('0x23')];var _0x269383=_0x46257d?_0x28e4c2['count']:_0x384225[_0x56d4('0x23')]+_0x384225['limit'];var _0x585e84;if(_0x269383>=_0x1e5380){_0x269383=_0x1e5380;_0x585e84=0xc8;}else{_0x585e84=0xce;}_0x25fa06[_0x56d4('0x20')](_0x585e84);return _0x25fa06[_0x56d4('0x25')](_0x56d4('0x26'),_0x3d9416+'-'+_0x269383+'/'+_0x1e5380)[_0x56d4('0x22')](_0x28e4c2);}return null;};}function patchUpdates(_0x3ab77c){return function(_0x4a9060){try{jsonpatch[_0x56d4('0x27')](_0x4a9060,_0x3ab77c,!![]);}catch(_0x40bf32){return BPromise[_0x56d4('0x28')](_0x40bf32);}return _0x4a9060[_0x56d4('0x29')]();};}function saveUpdates(_0x49b2c2,_0x48a7c5){return function(_0xbc0e35){if(_0xbc0e35){return _0xbc0e35[_0x56d4('0x2a')](_0x49b2c2)[_0x56d4('0x2b')](function(_0x4070ed){return _0x4070ed;});}return null;};}function removeEntity(_0x2184ac,_0x3e5c2c){return function(_0x24ae98){if(_0x24ae98){return _0x24ae98[_0x56d4('0x2c')]()['then'](function(){_0x2184ac[_0x56d4('0x20')](0xcc)[_0x56d4('0x21')]();});}};}function handleEntityNotFound(_0x5e5792,_0x584df4){return function(_0x12a6a8){if(!_0x12a6a8){_0x5e5792[_0x56d4('0x1f')](0x194);}return _0x12a6a8;};}function handleError(_0x464e0f,_0x4b1815){_0x4b1815=_0x4b1815||0x1f4;return function(_0x467994){logger[_0x56d4('0x2d')](_0x467994[_0x56d4('0x2e')]);if(_0x467994['name']){delete _0x467994[_0x56d4('0x2f')];}_0x464e0f[_0x56d4('0x20')](_0x4b1815)[_0x56d4('0x30')](_0x467994);};}function getInteractionUsers(_0x12ff43,_0x59f287){return new BPromise(function(_0x539820,_0x14e04c){try{if(_0x59f287[_0x12ff43['id']]){_0x12ff43[_0x56d4('0x31')]=_[_0x56d4('0x32')](_0x59f287[_0x12ff43['id']],function(_0x763be1){return{'id':_0x763be1['id'],'fullname':_0x763be1['fullname']};});}}catch(_0x2cfc5a){_0x14e04c(_0x2cfc5a);}_0x539820(_0x12ff43);});}function getInteractionTags(_0xe4cd9d,_0x4dfe41){return new BPromise(function(_0x3b824e,_0x3c1dc3){try{if(_0xe4cd9d[_0x56d4('0x33')]){_0xe4cd9d[_0x56d4('0x34')]=[];_0xe4cd9d[_0x56d4('0x33')][_0x56d4('0x35')](',')[_0x56d4('0x36')](function(_0x658e39){_0xe4cd9d[_0x56d4('0x34')][_0x56d4('0x37')](_0x4dfe41[_0x658e39]);});}delete _0xe4cd9d[_0x56d4('0x33')];}catch(_0x47e0b1){_0x3c1dc3(_0x47e0b1);}_0x3b824e(_0xe4cd9d);});}function updateOpenchannelInteraction(_0xbac1e3,_0x21cac0,_0x34e736){return new BPromise(function(_0x479857,_0x27b59b){return getInteractionUsers(_0xbac1e3,_0x34e736)[_0x56d4('0x2b')](function(_0x1bd75f){return getInteractionTags(_0x1bd75f,_0x21cac0);})[_0x56d4('0x2b')](function(_0x5de96a){_0x479857(_0x5de96a);})['catch'](function(_0x41096c){_0x27b59b(_0x41096c);});});}exports[_0x56d4('0x38')]=function(_0x16bda7,_0x223e8d){var _0x2e8513={},_0x422598={},_0x22974a={'count':0x0,'rows':[]};var _0x2fd91e=_[_0x56d4('0x32')](db[_0x56d4('0x39')][_0x56d4('0x3a')],function(_0x6d9187){return{'name':_0x6d9187[_0x56d4('0x3b')],'type':_0x6d9187[_0x56d4('0x3c')][_0x56d4('0x3d')]};});_0x422598[_0x56d4('0x3e')]=_['map'](_0x2fd91e,_0x56d4('0x2f'));_0x422598[_0x56d4('0x3f')]=_[_0x56d4('0x40')](_0x16bda7['query']);_0x422598[_0x56d4('0x41')]=_[_0x56d4('0x42')](_0x422598[_0x56d4('0x3e')],_0x422598[_0x56d4('0x3f')]);_0x2e8513['attributes']=_[_0x56d4('0x42')](_0x422598[_0x56d4('0x3e')],qs['fields'](_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x43')]));_0x2e8513[_0x56d4('0x44')]=_0x2e8513[_0x56d4('0x44')][_0x56d4('0x45')]?_0x2e8513[_0x56d4('0x44')]:_0x422598['model'];if(!_0x16bda7['query'][_0x56d4('0x46')](_0x56d4('0x47'))){_0x2e8513[_0x56d4('0x48')]=qs[_0x56d4('0x48')](_0x16bda7['query'][_0x56d4('0x48')]);_0x2e8513[_0x56d4('0x23')]=qs['offset'](_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x23')]);}_0x2e8513['order']=qs[_0x56d4('0x49')](_0x16bda7[_0x56d4('0x3f')]['sort']);_0x2e8513['where']=qs[_0x56d4('0x41')](_[_0x56d4('0x4a')](_0x16bda7['query'],_0x422598[_0x56d4('0x41')]),_0x2fd91e);var _0x1e0243=[];var _0x249144=squel['select']()['field']('id')[_0x56d4('0x4b')]('name')[_0x56d4('0x4b')](_0x56d4('0x4c'))['from'](_0x56d4('0x4d'));var _0x5e6529=squel[_0x56d4('0x4e')]()[_0x56d4('0x4b')](_0x56d4('0x4f'))[_0x56d4('0x4b')](_0x56d4('0x50'))['field']('ui.OpenchannelInteractionId')[_0x56d4('0x51')]('user_has_openchannel_interactions','ui')[_0x56d4('0x52')](_0x56d4('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x22bd0d=squel[_0x56d4('0x4e')]()['from']('openchannel_interactions','i')[_0x56d4('0x52')]('cm_contacts','c',_0x56d4('0x54'))['left_join'](_0x56d4('0x53'),'o','o.id\x20=\x20i.UserId')[_0x56d4('0x52')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x56d4('0x55'),'me',_0x56d4('0x56'))[_0x56d4('0x52')](_0x56d4('0x57'),'it',_0x56d4('0x58'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3d6cd7=squel['expr']();var _0x42df8e=[];var _0xd3c996=squel[_0x56d4('0x59')]();var _0x564f64;if(_0x16bda7['query'][_0x56d4('0x5a')]){_0x564f64=as[_0x56d4('0x5b')](_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x5a')]);var _0x2ff9a1=_0x564f64['sqlOperator'];for(var _0x1fab26=0x0;_0x1fab26<_0x564f64[_0x56d4('0x5c')][_0x56d4('0x45')];_0x1fab26++){var _0x366306=_0x564f64['conditions'][_0x1fab26];var _0x317e0e='i';var _0x27ffbe=_['find'](_0x2fd91e,[_0x56d4('0x2f'),_0x366306['field']]);if(!_0x27ffbe){switch(_0x366306[_0x56d4('0x4b')]){case _0x56d4('0x5d'):if(_0x366306[_0x56d4('0x5e')]==0x1){_0x22bd0d[_0x56d4('0x5f')]('`'+_0x366306[_0x56d4('0x4b')]+_0x56d4('0x60'));}else{_0x22bd0d[_0x56d4('0x5f')]('`'+_0x366306[_0x56d4('0x4b')]+'`\x20>\x200');}break;case _0x56d4('0x61'):if(_0x366306['operator']==='$substring'){if(_0x366306[_0x56d4('0x5e')][_0x56d4('0x35')]('\x20')[_0x56d4('0x45')]>0x1){_0x3d6cd7[_0x2ff9a1]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x56d4('0x62')](_0x366306[_0x56d4('0x5e')]),null);}else{var _0x12381d='%'+_0x366306[_0x56d4('0x5e')]+'%';_0x3d6cd7[_0x2ff9a1](_0x56d4('0x63'),_0x12381d,_0x12381d,_0x12381d);}}else{_0x27ffbe=_[_0x56d4('0x64')](_0x2fd91e,[_0x56d4('0x2f'),_0x56d4('0x65')]);_0x366306[_0x56d4('0x4b')]=_0x56d4('0x65');_0x3628e7=as[_0x56d4('0x66')](_0x317e0e,_0x27ffbe[_0x56d4('0x3c')],_0x366306);_0x3d6cd7[_0x2ff9a1](_0x3628e7[_0x56d4('0x67')],_0x3628e7['value']['start'],_0x3628e7[_0x56d4('0x5e')][_0x56d4('0x21')]);}break;case _0x56d4('0x68'):var _0x120557=_0x366306[_0x56d4('0x5e')][_0x56d4('0x35')](',')[_0x56d4('0x32')](function(_0x44cb66){return Number(_0x44cb66);});_0x120557[_0x56d4('0x36')](function(_0x3c5f55){_0xd3c996['or'](_0x56d4('0x69'),'%,'+_0x3c5f55+',%');});_0x42df8e=_['union'](_0x42df8e,_0x120557);break;case _0x56d4('0x6a'):if(_0x366306[_0x56d4('0x6b')]===_0x56d4('0x6c')){_0x3d6cd7[_0x2ff9a1](_0x56d4('0x6d'),'%'+_0x366306[_0x56d4('0x5e')]+'%',null);}else{_0x27ffbe=_['find'](_0x2fd91e,[_0x56d4('0x2f'),_0x56d4('0x6e')]);_0x366306[_0x56d4('0x4b')]='UserId';_0x3628e7=as[_0x56d4('0x66')](_0x317e0e,_0x27ffbe['type'],_0x366306);_0x3d6cd7[_0x2ff9a1](_0x3628e7[_0x56d4('0x67')],_0x3628e7[_0x56d4('0x5e')]['start'],_0x3628e7['value']['end']);}break;case _0x56d4('0x6f'):_0x3628e7=as[_0x56d4('0x66')]('me',null,_0x366306);_0x3d6cd7[_0x2ff9a1](_0x3628e7[_0x56d4('0x67')],_0x3628e7[_0x56d4('0x5e')][_0x56d4('0x70')],_0x3628e7[_0x56d4('0x5e')][_0x56d4('0x21')]);break;}}else{var _0x3628e7=as['buildExpression'](_0x317e0e,_0x27ffbe[_0x56d4('0x3c')],_0x366306);_0x3d6cd7[_0x2ff9a1](_0x3628e7[_0x56d4('0x67')],_0x3628e7['value'][_0x56d4('0x70')],_0x3628e7[_0x56d4('0x5e')][_0x56d4('0x21')]);}}}else{var _0x1d31ff=_(_0x16bda7[_0x56d4('0x3f')])[_0x56d4('0x40')]()[_0x56d4('0x32')](function(_0x46bd6a){return _['some'](_0x2fd91e,[_0x56d4('0x2f'),_0x46bd6a])?_0x46bd6a:undefined;})[_0x56d4('0x71')]()[_0x56d4('0x5e')]();if(!_[_0x56d4('0x72')](_0x1d31ff)){_0x1d31ff[_0x56d4('0x36')](function(_0x1d20de){if(_0x1d20de===_0x56d4('0x73')){_0x22bd0d['where'](_0x56d4('0x74'),[]['concat'](_0x16bda7[_0x56d4('0x3f')][_0x1d20de]));}else if(_0x1d20de===_0x56d4('0x75')){var _0x4e0610=JSON['parse'](_0x16bda7[_0x56d4('0x3f')][_0x1d20de])[_0x56d4('0x76')];var _0x16fe99=JSON['parse'](_0x16bda7['query'][_0x1d20de])[_0x56d4('0x77')];_0x22bd0d[_0x56d4('0x78')](_0x56d4('0x79'),_0x4e0610,_0x16fe99);}else{if(_0x16bda7[_0x56d4('0x3f')][_0x1d20de]===_0x56d4('0x7a')){_0x22bd0d[_0x56d4('0x78')]('i.'+_0x1d20de+'\x20IS\x20NULL');}else{_0x22bd0d[_0x56d4('0x78')]('i.'+_0x1d20de+_0x56d4('0x7b'),_0x16bda7[_0x56d4('0x3f')][_0x1d20de]);}}});}if(_0x16bda7['query']['read']){if(_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x7c')]==0x1){_0x22bd0d[_0x56d4('0x5f')](_0x56d4('0x7d'));}else{_0x22bd0d[_0x56d4('0x5f')](_0x56d4('0x7e'));}}if(_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x7f')]){_0x42df8e=_[_0x56d4('0x80')](_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x7f')])?_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x7f')]:new Array(_0x16bda7['query'][_0x56d4('0x7f')]);_0x42df8e['forEach'](function(_0x27550a){_0xd3c996['or'](_0x56d4('0x69'),'%,'+_0x27550a+',%');});}if(_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x81')]){var _0x26a9fc=_0x16bda7[_0x56d4('0x3f')]['filter'][_0x56d4('0x82')]('\x5c','\x5c\x5c')[_0x56d4('0x82')](/'/g,'\x27\x27');if(qs[_0x56d4('0x83')](_0x26a9fc)){_0x3d6cd7['or'](_0x56d4('0x84'),_0x26a9fc+'%');}else{_0x3d6cd7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x56d4('0x62')](_0x26a9fc))['or']('i.from\x20LIKE\x20?',_0x26a9fc+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x26a9fc+'%');}}}_0x22bd0d[_0x56d4('0x78')](_0x3d6cd7);_0x22bd0d[_0x56d4('0x85')]('i.id');var _0x4ce3b7={'type':db[_0x56d4('0x86')]['QueryTypes']['SELECT'],'raw':!![]};var _0x473d1a=_0x22bd0d['clone']();_0x473d1a['field'](_0x56d4('0x87'));_0x473d1a[_0x56d4('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x56d4('0x5d'));if(_0x2e8513['order']){_0x2e8513[_0x56d4('0x88')][_0x56d4('0x36')](function(_0x1406ca){var _0xfd96f4=_0x1406ca[0x0]===_0x56d4('0x89')?_0x1406ca[0x0]:'i.'+_0x1406ca[0x0];_0x22bd0d['order'](_0xfd96f4,_0x1406ca[0x1]===_0x56d4('0x8a')?![]:!![]);});}if(!_[_0x56d4('0x72')](_0x42df8e)){_0x22bd0d[_0x56d4('0x5f')](_0xd3c996);_0x473d1a[_0x56d4('0x78')]('t.id\x20IN\x20?',_0x42df8e);}BPromise['resolve']()[_0x56d4('0x2b')](function(){if(!_0x564f64){if(_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x73')])return;_0x473d1a[_0x56d4('0x78')](_0x56d4('0x8b'));_0x22bd0d[_0x56d4('0x78')](_0x56d4('0x8b'));return;}if(_0x16bda7[_0x56d4('0x8c')][_0x56d4('0x8d')]!==_0x56d4('0x8e'))return;return _0x16bda7[_0x56d4('0x8c')][_0x56d4('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12d4b2){if(_[_0x56d4('0x72')](_0x12d4b2)){_0x473d1a[_0x56d4('0x78')](_0x56d4('0x90'));_0x22bd0d['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x473d1a['where'](_0x56d4('0x74'),_[_0x56d4('0x32')](_0x12d4b2,'id'));_0x22bd0d[_0x56d4('0x78')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x56d4('0x32')](_0x12d4b2,'id'));}});})[_0x56d4('0x2b')](function(){if(_0x16bda7['user'][_0x56d4('0x8d')]==='agent'&&!_0x564f64&&!_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x73')])return[];return db[_0x56d4('0x91')]['query'](_0x473d1a[_0x56d4('0x92')](),_0x4ce3b7);})['then'](function(_0x38f2ce){_0x22974a['count']=_0x38f2ce[_0x56d4('0x45')];if(_0x22974a[_0x56d4('0x24')]===0x0)return[];return db[_0x56d4('0x91')][_0x56d4('0x3f')](_0x249144[_0x56d4('0x92')](),_0x4ce3b7)['then'](function(_0xcdc59d){_0x1e0243=_[_0x56d4('0x93')](_0xcdc59d,'id');_0x4ce3b7=_[_0x56d4('0x94')](_0x4ce3b7,{'model':db[_0x56d4('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16bda7[_0x56d4('0x3f')][_0x56d4('0x43')]){_0x2e8513[_0x56d4('0x44')][_0x56d4('0x36')](function(_0x2ffdc8){_0x22bd0d[_0x56d4('0x4b')]('i.'+_0x2ffdc8);});}else{_0x22bd0d[_0x56d4('0x4b')](_0x56d4('0x95'),_0x56d4('0x5d'));_0x22bd0d[_0x56d4('0x4b')](_0x56d4('0x96'),_0x56d4('0x97'));_0x22bd0d[_0x56d4('0x4b')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x22bd0d[_0x56d4('0x4b')](_0x56d4('0x98'),_0x56d4('0x89'));_0x22bd0d[_0x56d4('0x4b')]('i.*');_0x22bd0d['field']('c.firstName',_0x56d4('0x99'));_0x22bd0d[_0x56d4('0x4b')](_0x56d4('0x9a'),_0x56d4('0x9b'));_0x22bd0d[_0x56d4('0x4b')](_0x56d4('0x9c'),_0x56d4('0x9d'));_0x22bd0d['field']('c.phone',_0x56d4('0x9e'));_0x22bd0d['field'](_0x56d4('0x9f'),_0x56d4('0xa0'));_0x22bd0d[_0x56d4('0x4b')](_0x56d4('0xa1'),_0x56d4('0xa2'));_0x22bd0d['field']('o.fullname','Owner.fullname');_0x22bd0d['field'](_0x56d4('0xa3'),_0x56d4('0xa4'));_0x22bd0d['field'](_0x56d4('0xa5'),_0x56d4('0x33'));}if(_0x2e8513[_0x56d4('0x48')])_0x22bd0d[_0x56d4('0x48')](_0x2e8513['limit']);if(_0x2e8513[_0x56d4('0x23')])_0x22bd0d[_0x56d4('0x23')](_0x2e8513[_0x56d4('0x23')]);return db[_0x56d4('0x91')][_0x56d4('0x3f')](_0x22bd0d[_0x56d4('0x92')](),_0x4ce3b7);})[_0x56d4('0x2b')](function(_0x34a4eb){if(_0x34a4eb[_0x56d4('0x45')]>0x0)_0x5e6529[_0x56d4('0x78')](_0x56d4('0xa6'),_[_0x56d4('0x32')](_0x34a4eb,'id'));return db[_0x56d4('0x91')][_0x56d4('0x3f')](_0x5e6529[_0x56d4('0x92')](),_0x4ce3b7)[_0x56d4('0x2b')](function(_0x20865f){var _0x34444c=_['groupBy'](_0x20865f,'OpenchannelInteractionId');var _0x270f55=[];_0x34a4eb[_0x56d4('0x36')](function(_0x49f199){_0x270f55['push'](updateOpenchannelInteraction(_0x49f199,_0x1e0243,_0x34444c));});return BPromise[_0x56d4('0xa7')](_0x270f55);});});})[_0x56d4('0x2b')](function(_0x52c88a){_0x22974a[_0x56d4('0xa8')]=_0x52c88a;return _0x22974a;})[_0x56d4('0x2b')](respondWithFilteredResult(_0x223e8d,_0x2e8513))[_0x56d4('0xa9')](handleError(_0x223e8d,null));};exports[_0x56d4('0xaa')]=function(_0x84eea7,_0x1da8e3){var _0x4b1da8={};if(_0x84eea7[_0x56d4('0x3f')][_0x56d4('0x3c')]&&_0x84eea7[_0x56d4('0x3f')]['type']===_0x56d4('0x51')){_0x4b1da8[_0x56d4('0x51')]=_0x84eea7[_0x56d4('0xab')]['id'];}else{_0x4b1da8['id']=_0x84eea7[_0x56d4('0xab')]['id'];}var _0x5354b5={'raw':![],'where':_0x4b1da8},_0x424c5e={};_0x424c5e[_0x56d4('0x3e')]=_['keys'](db[_0x56d4('0x39')][_0x56d4('0x3a')]);_0x424c5e[_0x56d4('0x3f')]=_[_0x56d4('0x40')](_0x84eea7[_0x56d4('0x3f')]);_0x424c5e[_0x56d4('0x41')]=_[_0x56d4('0x42')](_0x424c5e[_0x56d4('0x3e')],_0x424c5e[_0x56d4('0x3f')]);_0x5354b5['attributes']=_[_0x56d4('0x42')](_0x424c5e[_0x56d4('0x3e')],qs[_0x56d4('0x43')](_0x84eea7['query'][_0x56d4('0x43')]));_0x5354b5['attributes']=_0x5354b5[_0x56d4('0x44')][_0x56d4('0x45')]?_0x5354b5[_0x56d4('0x44')]:_0x424c5e[_0x56d4('0x3e')];if(_0x84eea7['query'][_0x56d4('0xac')]){_0x5354b5[_0x56d4('0xad')]=[{'all':!![]}];}_0x5354b5=_[_0x56d4('0x94')]({},_0x5354b5,_0x84eea7['options']);return db[_0x56d4('0x39')][_0x56d4('0x64')](_0x5354b5)[_0x56d4('0x2b')](handleEntityNotFound(_0x1da8e3,null))[_0x56d4('0x2b')](respondWithResult(_0x1da8e3,null))['catch'](handleError(_0x1da8e3,null));};exports[_0x56d4('0xae')]=function(_0x1ecd88,_0x3e09f8){return db['OpenchannelInteraction'][_0x56d4('0xae')](_0x1ecd88[_0x56d4('0x6f')],{})['then'](respondWithResult(_0x3e09f8,0xc9))[_0x56d4('0xa9')](handleError(_0x3e09f8,null));};exports[_0x56d4('0x2a')]=function(_0x473029,_0x1768e1){if(_0x473029['body']['id']){delete _0x473029['body']['id'];}return db[_0x56d4('0x39')][_0x56d4('0x64')]({'where':{'id':_0x473029['params']['id']}})[_0x56d4('0x2b')](handleEntityNotFound(_0x1768e1,null))[_0x56d4('0x2b')](saveUpdates(_0x473029[_0x56d4('0x6f')],null))['then'](respondWithResult(_0x1768e1,null))['catch'](handleError(_0x1768e1,null));};exports[_0x56d4('0x2c')]=function(_0x88fe3a,_0x423f52){return db[_0x56d4('0x39')][_0x56d4('0x64')]({'where':{'id':_0x88fe3a[_0x56d4('0xab')]['id']}})[_0x56d4('0x2b')](handleEntityNotFound(_0x423f52,null))[_0x56d4('0x2b')](removeEntity(_0x423f52,null))[_0x56d4('0xa9')](handleError(_0x423f52,null));};exports[_0x56d4('0xaf')]=function(_0xe2709,_0x4dd9cd){return db['OpenchannelInteraction'][_0x56d4('0xaf')]()['then'](respondWithResult(_0x4dd9cd,null))['catch'](handleError(_0x4dd9cd,null));};exports[_0x56d4('0xb0')]=function(_0x5aa837,_0x460bb4,_0x3f113a){return db[_0x56d4('0xb1')]['find']({'where':{'id':_0x5aa837[_0x56d4('0xab')]['id']}})[_0x56d4('0x2b')](handleEntityNotFound(_0x460bb4,null))['then'](function(_0x2c697d){if(_0x2c697d){return _0x2c697d[_0x56d4('0xb0')](_0x5aa837[_0x56d4('0x6f')][_0x56d4('0xb2')],_[_0x56d4('0xb3')](_0x5aa837[_0x56d4('0x6f')],['ids','id'])||{});}})[_0x56d4('0x2b')](respondWithResult(_0x460bb4,null))['catch'](handleError(_0x460bb4,null));};exports['getMessages']=function(_0x4099e0,_0x44dd5f,_0x4fdf3c){var _0x5e2a58={'raw':![],'where':{}};var _0x3a4146={};var _0x508814={'count':0x0,'rows':[]};return db[_0x56d4('0x39')][_0x56d4('0xb4')]({'where':{'id':_0x4099e0[_0x56d4('0xab')]['id']}})[_0x56d4('0x2b')](handleEntityNotFound(_0x44dd5f,null))[_0x56d4('0x2b')](function(_0x9d1af0){if(_0x9d1af0){_0x3a4146[_0x56d4('0x3e')]=_['keys'](db[_0x56d4('0xb1')]['rawAttributes']);_0x3a4146[_0x56d4('0x3f')]=_[_0x56d4('0x40')](_0x4099e0['query']);_0x3a4146[_0x56d4('0x41')]=_[_0x56d4('0x42')](_0x3a4146[_0x56d4('0x3e')],_0x3a4146[_0x56d4('0x3f')]);_0x5e2a58[_0x56d4('0x44')]=_['intersection'](_0x3a4146[_0x56d4('0x3e')],qs[_0x56d4('0x43')](_0x4099e0['query']['fields']));_0x5e2a58['attributes']=_0x5e2a58['attributes'][_0x56d4('0x45')]?_0x5e2a58[_0x56d4('0x44')]:_0x3a4146[_0x56d4('0x3e')];if(!_0x4099e0[_0x56d4('0x3f')][_0x56d4('0x46')](_0x56d4('0x47'))){_0x5e2a58[_0x56d4('0x48')]=qs[_0x56d4('0x48')](_0x4099e0[_0x56d4('0x3f')][_0x56d4('0x48')]);_0x5e2a58['offset']=qs[_0x56d4('0x23')](_0x4099e0['query'][_0x56d4('0x23')]);}_0x5e2a58['order']=qs['sort'](_0x4099e0['query'][_0x56d4('0x49')]);_0x5e2a58[_0x56d4('0x78')]=qs['filters'](_[_0x56d4('0x4a')](_0x4099e0['query'],_0x3a4146[_0x56d4('0x41')]));_0x5e2a58[_0x56d4('0x78')]['OpenchannelInteractionId']=_0x9d1af0['id'];if(_0x4099e0[_0x56d4('0x3f')]['filter']){_0x5e2a58[_0x56d4('0x78')]=_['merge'](_0x5e2a58['where'],{'$or':_[_0x56d4('0x32')](_0x5e2a58['attributes'],function(_0x1ad0ae){var _0x40d158={};_0x40d158[_0x1ad0ae]={'$like':'%'+_0x4099e0[_0x56d4('0x3f')][_0x56d4('0x81')]+'%'};return _0x40d158;})});}if(_0x4099e0['query'][_0x56d4('0x76')]){var _0x4f1a0f=_0x4099e0[_0x56d4('0x3f')][_0x56d4('0x76')][_0x56d4('0x35')](',');var _0x5cfce2={};_0x5cfce2[_0x4f1a0f[0x0]]={'$gte':moment(_0x4f1a0f[0x1])['format'](_0x56d4('0xb5'))};_0x5e2a58[_0x56d4('0x78')]=_[_0x56d4('0x94')](_0x5e2a58[_0x56d4('0x78')],_0x5cfce2);}_0x5e2a58=_[_0x56d4('0x94')]({},_0x5e2a58,_0x4099e0[_0x56d4('0xb6')]);return db['OpenchannelMessage'][_0x56d4('0x24')]({'where':_0x5e2a58['where']})[_0x56d4('0x2b')](function(_0x1384f8){_0x508814[_0x56d4('0x24')]=_0x1384f8;if(_0x4099e0[_0x56d4('0x3f')][_0x56d4('0xac')]){_0x5e2a58[_0x56d4('0xad')]=[{'all':!![]}];}return db[_0x56d4('0xb1')][_0x56d4('0xb7')](_0x5e2a58);})['then'](function(_0x475bc6){_0x508814[_0x56d4('0xa8')]=_0x475bc6;return _0x508814;});}})[_0x56d4('0x2b')](respondWithFilteredResult(_0x44dd5f,_0x5e2a58))[_0x56d4('0xa9')](handleError(_0x44dd5f,null));};exports[_0x56d4('0xb8')]=function(_0x128c5f,_0x1429b5,_0x5e1f61){return db['OpenchannelInteraction']['find']({'where':{'id':_0x128c5f[_0x56d4('0xab')]['id']}})[_0x56d4('0x2b')](handleEntityNotFound(_0x1429b5,null))[_0x56d4('0x2b')](function(_0x525a58){if(_0x525a58){return _0x525a58['setTags'](_0x128c5f[_0x56d4('0x6f')][_0x56d4('0xb2')],_[_0x56d4('0xb3')](_0x128c5f[_0x56d4('0x6f')],[_0x56d4('0xb2'),'id'])||{})[_0x56d4('0xb9')](function(){return db[_0x56d4('0x68')][_0x56d4('0xb7')]({'attributes':['id','name','color'],'where':{'id':_0x128c5f[_0x56d4('0x6f')]['ids']}});})[_0x56d4('0x2b')](function(_0x3511b6){socket[_0x56d4('0xba')](_0x56d4('0xbb'),{'id':Number(_0x128c5f['params']['id']),'tags':_0x3511b6||[]});return{'id':Number(_0x128c5f[_0x56d4('0xab')]['id']),'tags':_0x3511b6||[]};});}})[_0x56d4('0x2b')](respondWithResult(_0x1429b5,null))[_0x56d4('0xa9')](handleError(_0x1429b5,null));};exports[_0x56d4('0xbc')]=function(_0x3817d4,_0x34791d,_0x49300d){return db[_0x56d4('0x39')][_0x56d4('0x64')]({'where':{'id':_0x3817d4['params']['id']}})[_0x56d4('0x2b')](handleEntityNotFound(_0x34791d,null))[_0x56d4('0x2b')](function(_0x2fbc51){if(_0x2fbc51){return _0x2fbc51['removeTags'](_0x3817d4[_0x56d4('0x3f')]['ids']);}})[_0x56d4('0x2b')](respondWithStatusCode(_0x34791d,null))[_0x56d4('0xa9')](handleError(_0x34791d,null));};exports[_0x56d4('0xbd')]=function(_0x3697f3,_0x37c264){var _0x410eb0=moment()['unix']()[_0x56d4('0x92')]();var _0x217267=path[_0x56d4('0xbe')](config[_0x56d4('0xbf')],'server',_0x56d4('0xc0'),_0x56d4('0xc1'));var _0x43b63b=path[_0x56d4('0xbe')](config[_0x56d4('0xbf')],_0x56d4('0xc2'),_0x56d4('0xc0'),_0x56d4('0xc3'));var _0x49780e=path[_0x56d4('0xbe')](_0x217267,_0x410eb0);var _0x90fd4=util[_0x56d4('0xc4')]('transcript-%d-%s.zip',_0x3697f3[_0x56d4('0xab')]['id'],_0x410eb0);var _0x101958=path[_0x56d4('0xbe')](_0x217267,_0x90fd4);var _0x1aae85=[];_0x1aae85[_0x56d4('0x37')]({'model':db[_0x56d4('0x6a')],'as':_0x56d4('0x6a'),'attributes':['id',_0x56d4('0xc5')],'raw':!![]});_0x1aae85[_0x56d4('0x37')]({'model':db[_0x56d4('0xc6')],'as':_0x56d4('0x61'),'attributes':['id',_0x56d4('0xc7'),_0x56d4('0xc8')],'raw':!![]});if(_0x3697f3[_0x56d4('0x3f')]['attachments']){_0x1aae85[_0x56d4('0x37')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x490b59=[{'model':db[_0x56d4('0xb1')],'as':'Messages','attributes':['id','body',_0x56d4('0x75'),_0x56d4('0xc9'),_0x56d4('0xca'),_0x56d4('0x7c')],'include':_0x1aae85}];_0x490b59[_0x56d4('0x37')]({'model':db[_0x56d4('0xcb')],'as':'Account','attributes':['id','name']});_0x490b59['push']({'model':db[_0x56d4('0x6a')],'as':_0x56d4('0xcc'),'attributes':['id',_0x56d4('0xc5')]});return db[_0x56d4('0x39')][_0x56d4('0x64')]({'where':{'id':_0x3697f3[_0x56d4('0xab')]['id']},'include':_0x490b59})['then'](handleEntityNotFound(_0x37c264,null))[_0x56d4('0x2b')](function(_0x176a90){if(_0x176a90){var _0x532c66=_0x176a90[_0x56d4('0xcd')]({'plain':!![]});fs[_0x56d4('0xce')](_0x49780e);var _0x29fdc0={'channel':'Openchannel','account':_0x532c66[_0x56d4('0xcf')][_0x56d4('0x2f')],'agent':_0x532c66[_0x56d4('0xcc')]?_0x532c66[_0x56d4('0xcc')][_0x56d4('0xc5')]:_0x56d4('0xd0'),'createdAt':moment(_0x532c66[_0x56d4('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x56d4('0x92')](),'closedAt':_0x532c66[_0x56d4('0xd1')]?moment(_0x532c66[_0x56d4('0xd2')])[_0x56d4('0xc4')](_0x56d4('0xb5'))[_0x56d4('0x92')]():'','disposition':_0x532c66[_0x56d4('0xd3')],'visibility':_0x532c66['threadId']?'Public':'Private','messages':_(_0x532c66[_0x56d4('0xd4')])[_0x56d4('0x81')]({'secret':![]})['map'](function(_0x437993){if(_0x437993[_0x56d4('0xd5')]){var _0x53cda0=path['join'](_0x43b63b,_0x437993[_0x56d4('0xd5')][_0x56d4('0xd6')]);if(fs[_0x56d4('0xd7')](_0x53cda0)){fs[_0x56d4('0xd8')](_0x53cda0)[_0x56d4('0xd9')](fs[_0x56d4('0xda')](path[_0x56d4('0xbe')](_0x49780e,_0x437993[_0x56d4('0xd5')]['basename'])));}}return{'date':moment(_0x437993[_0x56d4('0x75')])[_0x56d4('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x56d4('0x92')](),'sender':_0x437993[_0x56d4('0xc9')]===_0x56d4('0xdb')?_0x437993[_0x56d4('0x6a')]?_0x437993[_0x56d4('0x6a')]['fullname']:_0x56d4('0xdc'):_0x437993['Contact']['firstName']+(_0x437993['Contact'][_0x56d4('0xc8')]?'\x20'+_0x437993['Contact'][_0x56d4('0xc8')]:''),'body':_0x437993[_0x56d4('0xd5')]?_0x437993[_0x56d4('0xd5')][_0x56d4('0xd6')]:_0x437993[_0x56d4('0x6f')],'direction':_0x437993[_0x56d4('0xc9')]===_0x56d4('0xdb')?'A':'C','secret':_0x437993[_0x56d4('0xca')],'read':_0x437993['read'],'attachment':_0x437993[_0x56d4('0xd5')]};})[_0x56d4('0x5e')]()};return ejs[_0x56d4('0xdd')](path[_0x56d4('0xbe')](config['root'],'server','views',_0x56d4('0xde')),{'interaction':_0x29fdc0})[_0x56d4('0x2b')](function(_0x3b2259){var _0x2f5af7=path[_0x56d4('0xbe')](_0x49780e,_0x56d4('0xdf')+_0x532c66['id']+'-'+_0x410eb0+'.pdf');var _0x47e20c={'path':_0x2f5af7,'channel':'Openchannel','interactionId':_0x532c66['id']};return pdf['createPdfFromHTML'](_0x3b2259,_0x47e20c);})[_0x56d4('0x2b')](function(){return new BPromise(function(_0x28920e,_0x44047b){zipdir(_0x49780e,{'saveTo':_0x101958},function(_0x426d04,_0x260e22){if(_0x426d04)return _0x44047b(_0x426d04);return _0x28920e(_0x260e22);});})[_0x56d4('0x2b')](function(){return new BPromise(function(_0x40e59e,_0x172dec){rimraf(_0x49780e,function(_0x3dd5b8){if(_0x3dd5b8)_0x172dec(_0x3dd5b8);return _0x40e59e();});});})[_0x56d4('0x2b')](function(){return _0x37c264[_0x56d4('0xbd')](_0x101958,_0x90fd4,function(_0x21625e){if(_0x21625e){console['log'](_0x56d4('0xe0'),_0x21625e);}else{fs[_0x56d4('0xe1')](_0x101958);}});});});}else{return _0x37c264['sendStatus'](0xc8);}})[_0x56d4('0xa9')](handleError(_0x37c264,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 17f75f9..3aaab06 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 _0xa3f7=['OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','events','OpenchannelInteraction'];(function(_0x9f316f,_0x598f59){var _0x2a53cc=function(_0x1d16b7){while(--_0x1d16b7){_0x9f316f['push'](_0x9f316f['shift']());}};_0x2a53cc(++_0x598f59);}(_0xa3f7,0x154));var _0x7a3f=function(_0x54357c,_0x162612){_0x54357c=_0x54357c-0x0;var _0x7c7c42=_0xa3f7[_0x54357c];return _0x7c7c42;};'use strict';var EventEmitter=require(_0x7a3f('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x7a3f('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x7a3f('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7a3f('0x3')](0x0);var events={'afterCreate':_0x7a3f('0x4'),'afterUpdate':_0x7a3f('0x5'),'afterDestroy':_0x7a3f('0x6')};function emitEvent(_0x570878){return function(_0x1ee7fd,_0x597aa1,_0x442ecc){_0x1ee7fd[_0x7a3f('0x7')]({'attributes':['id'],'raw':!![]})[_0x7a3f('0x8')](function(_0x5c4ac9){_0x1ee7fd['setDataValue'](_0x7a3f('0x9'),_0x5c4ac9[_0x7a3f('0xa')](function(_0x384810){return{'id':_0x384810['id']};}));return OpenchannelMessage[_0x7a3f('0xb')]({'where':{'OpenchannelInteractionId':_0x1ee7fd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7a3f('0x8')](function(_0x68d774){_0x1ee7fd[_0x7a3f('0xc')](_0x7a3f('0xd'),_0x68d774[_0x7a3f('0xe')]);OpenchannelInteractionEvents[_0x7a3f('0xf')](_0x570878+':'+_0x1ee7fd['id'],_0x1ee7fd);OpenchannelInteractionEvents[_0x7a3f('0xf')](_0x570878,_0x1ee7fd);_0x442ecc(null);})['catch'](_0x442ecc(null));};}for(var e in events){if(events[_0x7a3f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x7a3f('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x383c=['OpenchannelMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction'];(function(_0x40a0a4,_0x5d30d0){var _0x50cc17=function(_0x4ea52d){while(--_0x4ea52d){_0x40a0a4['push'](_0x40a0a4['shift']());}};_0x50cc17(++_0x5d30d0);}(_0x383c,0x76));var _0xc383=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x383c[_0x2c7618];return _0x5ce3f0;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xc383('0x0'))['db'][_0xc383('0x1')];var OpenchannelMessage=require(_0xc383('0x0'))['db'][_0xc383('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc383('0x3'),'afterDestroy':_0xc383('0x4')};function emitEvent(_0x818b0d){return function(_0x3a9302,_0x441c6f,_0x1d5ec9){_0x3a9302[_0xc383('0x5')]({'attributes':['id'],'raw':!![]})[_0xc383('0x6')](function(_0x1e5128){_0x3a9302[_0xc383('0x7')](_0xc383('0x8'),_0x1e5128[_0xc383('0x9')](function(_0x4d7e66){return{'id':_0x4d7e66['id']};}));return OpenchannelMessage[_0xc383('0xa')]({'where':{'OpenchannelInteractionId':_0x3a9302['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc383('0x6')](function(_0x27bd21){_0x3a9302['setDataValue']('unreadMessages',_0x27bd21[_0xc383('0xb')]);OpenchannelInteractionEvents[_0xc383('0xc')](_0x818b0d+':'+_0x3a9302['id'],_0x3a9302);OpenchannelInteractionEvents['emit'](_0x818b0d,_0x3a9302);_0x1d5ec9(null);})['catch'](_0x1d5ec9(null));};}for(var e in events){if(events[_0xc383('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xc383('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3a283f1..084147a 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 _0xd3ef=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird'];(function(_0x2afb35,_0x2ecbc5){var _0x2e17d6=function(_0xd78c03){while(--_0xd78c03){_0x2afb35['push'](_0x2afb35['shift']());}};_0x2e17d6(++_0x2ecbc5);}(_0xd3ef,0xdc));var _0xfd3e=function(_0x573f95,_0x39d1de){_0x573f95=_0x573f95-0x0;var _0xf4875f=_0xd3ef[_0x573f95];return _0xf4875f;};'use strict';var _=require(_0xfd3e('0x0'));var util=require('util');var logger=require(_0xfd3e('0x1'))('api');var moment=require(_0xfd3e('0x2'));var BPromise=require(_0xfd3e('0x3'));var rp=require(_0xfd3e('0x4'));var fs=require('fs');var path=require(_0xfd3e('0x5'));var rimraf=require(_0xfd3e('0x6'));var config=require(_0xfd3e('0x7'));var attributes=require(_0xfd3e('0x8'));module[_0xfd3e('0x9')]=function(_0xf4588c,_0x1c8c6b){return _0xf4588c['define'](_0xfd3e('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfd3e('0xb'),'hooks':{'beforeUpdate':function(_0x211c4f,_0x44c295,_0x426e82){if(_0x211c4f[_0xfd3e('0xc')]('closed')){_0x211c4f[_0xfd3e('0xd')]=moment()[_0xfd3e('0xe')](_0xfd3e('0xf'));}_0x426e82(null,_0x211c4f);}}});}; \ No newline at end of file +var _0x02f2=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x498577,_0x3c838e){var _0x32dd77=function(_0x4229ce){while(--_0x4229ce){_0x498577['push'](_0x498577['shift']());}};_0x32dd77(++_0x3c838e);}(_0x02f2,0x8e));var _0x202f=function(_0x4716e4,_0x3b7501){_0x4716e4=_0x4716e4-0x0;var _0x3f33a9=_0x02f2[_0x4716e4];return _0x3f33a9;};'use strict';var _=require(_0x202f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x202f('0x1'));var moment=require(_0x202f('0x2'));var BPromise=require(_0x202f('0x3'));var rp=require(_0x202f('0x4'));var fs=require('fs');var path=require(_0x202f('0x5'));var rimraf=require(_0x202f('0x6'));var config=require(_0x202f('0x7'));var attributes=require(_0x202f('0x8'));module[_0x202f('0x9')]=function(_0x3caf05,_0xc81c80){return _0x3caf05[_0x202f('0xa')](_0x202f('0xb'),attributes,{'tableName':_0x202f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x202f('0xd'),'collate':_0x202f('0xe'),'hooks':{'beforeUpdate':function(_0x7a780f,_0x316bd3,_0x4ee54b){if(_0x7a780f['changed'](_0x202f('0xf'))){_0x7a780f[_0x202f('0x10')]=moment()[_0x202f('0x11')](_0x202f('0x12'));}_0x4ee54b(null,_0x7a780f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 00556b3..dcd90c3 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 _0xd016=['socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x35c6df,_0x53ddc5){var _0x4ceda3=function(_0x33b932){while(--_0x33b932){_0x35c6df['push'](_0x35c6df['shift']());}};_0x4ceda3(++_0x53ddc5);}(_0xd016,0x96));var _0x6d01=function(_0x4cb648,_0x13fac1){_0x4cb648=_0x4cb648-0x0;var _0x3699a8=_0xd016[_0x4cb648];return _0x3699a8;};'use strict';var _=require(_0x6d01('0x0'));var util=require(_0x6d01('0x1'));var moment=require(_0x6d01('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d01('0x3'));var fs=require('fs');var Redis=require(_0x6d01('0x4'));var db=require(_0x6d01('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d01('0x6'))(_0x6d01('0x7'));var config=require(_0x6d01('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d01('0x9')][_0x6d01('0xa')]({'port':0x232a});config[_0x6d01('0xb')]=_[_0x6d01('0xc')](config[_0x6d01('0xb')],{'host':_0x6d01('0xd'),'port':0x18eb});var socket=require(_0x6d01('0xe'))(new Redis(config[_0x6d01('0xb')]));require(_0x6d01('0xf'))['register'](socket);function respondWithRpcPromise(_0xd8c28b,_0x226f89,_0x3fe94e){return new BPromise(function(_0x1e56be,_0x1b8f2a){return client[_0x6d01('0x10')](_0xd8c28b,_0x3fe94e)[_0x6d01('0x11')](function(_0x4b8dc8){logger[_0x6d01('0x12')](_0x6d01('0x13'),_0x226f89,_0x6d01('0x14'));logger[_0x6d01('0x15')](_0x6d01('0x16'),_0x226f89,_0x6d01('0x14'),JSON[_0x6d01('0x17')](_0x4b8dc8));if(_0x4b8dc8['error']){if(_0x4b8dc8[_0x6d01('0x18')]['code']===0x1f4){logger[_0x6d01('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x226f89,_0x4b8dc8[_0x6d01('0x18')][_0x6d01('0x19')]);return _0x1b8f2a(_0x4b8dc8[_0x6d01('0x18')][_0x6d01('0x19')]);}logger[_0x6d01('0x18')](_0x6d01('0x13'),_0x226f89,_0x4b8dc8[_0x6d01('0x18')][_0x6d01('0x19')]);return _0x1e56be(_0x4b8dc8[_0x6d01('0x18')]['message']);}else{logger[_0x6d01('0x12')](_0x6d01('0x13'),_0x226f89,'request\x20sent');_0x1e56be(_0x4b8dc8['result'][_0x6d01('0x19')]);}})[_0x6d01('0x1a')](function(_0x4ea57a){logger[_0x6d01('0x18')](_0x6d01('0x13'),_0x226f89,_0x4ea57a);_0x1b8f2a(_0x4ea57a);});});}exports[_0x6d01('0x1b')]=function(_0x180991){var _0x1bca2e=this;return new Promise(function(_0x3465a4,_0x4bbc11){return db[_0x6d01('0x1c')][_0x6d01('0x1d')](_0x180991[_0x6d01('0x1e')],{'raw':_0x180991[_0x6d01('0x1f')]?_0x180991[_0x6d01('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180991[_0x6d01('0x1f')]?_0x180991[_0x6d01('0x1f')][_0x6d01('0x20')]||null:null,'attributes':_0x180991[_0x6d01('0x1f')]?_0x180991['options'][_0x6d01('0x21')]||null:null,'limit':_0x180991[_0x6d01('0x1f')]?_0x180991[_0x6d01('0x1f')][_0x6d01('0x22')]||null:null})[_0x6d01('0x11')](function(_0x52cda6){logger['info']('UpdateOpenchannelInteraction',_0x180991);logger[_0x6d01('0x15')](_0x6d01('0x1b'),_0x180991,JSON['stringify'](_0x52cda6));_0x3465a4(_0x52cda6);})[_0x6d01('0x1a')](function(_0x4c4701){logger[_0x6d01('0x18')](_0x6d01('0x1b'),_0x4c4701[_0x6d01('0x19')],_0x180991);_0x4bbc11(_0x1bca2e[_0x6d01('0x18')](0x1f4,_0x4c4701['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x2cd65a){return new Promise(function(_0x232522,_0x2ca5e2){return db['OpenchannelInteraction'][_0x6d01('0x23')]({'where':_0x2cd65a[_0x6d01('0x1f')]?_0x2cd65a[_0x6d01('0x1f')]['where']||null:null})['then'](function(_0x2993d4){if(_0x2993d4){return _0x2993d4[_0x6d01('0x24')](_0x2cd65a['body'][_0x6d01('0x25')],_[_0x6d01('0x26')](_0x2cd65a['body'],[_0x6d01('0x25'),'id'])||{});}})[_0x6d01('0x27')](function(_0x35706c){logger['info'](_0x6d01('0x28'),_0x2cd65a);logger[_0x6d01('0x15')]('AddTags',_0x2cd65a,JSON[_0x6d01('0x17')](_0x35706c));_0x232522(_0x35706c);})[_0x6d01('0x1a')](function(_0x1574d4){logger[_0x6d01('0x18')]('AddTags',_0x1574d4[_0x6d01('0x19')],_0x2cd65a);_0x2ca5e2(_this[_0x6d01('0x18')](0x1f4,_0x1574d4[_0x6d01('0x19')]));});});}; \ No newline at end of file +var _0xa878=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x54c31e,_0x16fe63){var _0x47b995=function(_0x2e09c2){while(--_0x2e09c2){_0x54c31e['push'](_0x54c31e['shift']());}};_0x47b995(++_0x16fe63);}(_0xa878,0x175));var _0x8a87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa878[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8a87('0x0'));var util=require(_0x8a87('0x1'));var moment=require(_0x8a87('0x2'));var BPromise=require(_0x8a87('0x3'));var rs=require(_0x8a87('0x4'));var fs=require('fs');var Redis=require(_0x8a87('0x5'));var db=require(_0x8a87('0x6'))['db'];var utils=require(_0x8a87('0x7'));var logger=require('../../config/logger')(_0x8a87('0x8'));var config=require(_0x8a87('0x9'));var jayson=require(_0x8a87('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x8a87('0xb')]=_[_0x8a87('0xc')](config['redis'],{'host':_0x8a87('0xd'),'port':0x18eb});var socket=require(_0x8a87('0xe'))(new Redis(config[_0x8a87('0xb')]));require(_0x8a87('0xf'))[_0x8a87('0x10')](socket);function respondWithRpcPromise(_0x2a3164,_0x3036f9,_0x36877b){return new BPromise(function(_0x16c461,_0x398d87){return client[_0x8a87('0x11')](_0x2a3164,_0x36877b)[_0x8a87('0x12')](function(_0x5cd0ca){logger['info'](_0x8a87('0x13'),_0x3036f9,_0x8a87('0x14'));logger['debug'](_0x8a87('0x15'),_0x3036f9,_0x8a87('0x14'),JSON[_0x8a87('0x16')](_0x5cd0ca));if(_0x5cd0ca[_0x8a87('0x17')]){if(_0x5cd0ca[_0x8a87('0x17')][_0x8a87('0x18')]===0x1f4){logger[_0x8a87('0x17')](_0x8a87('0x13'),_0x3036f9,_0x5cd0ca[_0x8a87('0x17')][_0x8a87('0x19')]);return _0x398d87(_0x5cd0ca[_0x8a87('0x17')]['message']);}logger['error'](_0x8a87('0x13'),_0x3036f9,_0x5cd0ca['error'][_0x8a87('0x19')]);return _0x16c461(_0x5cd0ca['error']['message']);}else{logger[_0x8a87('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3036f9,_0x8a87('0x14'));_0x16c461(_0x5cd0ca['result'][_0x8a87('0x19')]);}})[_0x8a87('0x1b')](function(_0x408cad){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3036f9,_0x408cad);_0x398d87(_0x408cad);});});}exports[_0x8a87('0x1c')]=function(_0x4c5096){var _0xc1a1d5=this;return new Promise(function(_0x345036,_0x100a37){return db[_0x8a87('0x1d')][_0x8a87('0x1e')](_0x4c5096[_0x8a87('0x1f')],{'raw':_0x4c5096['options']?_0x4c5096[_0x8a87('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c5096[_0x8a87('0x20')]?_0x4c5096['options'][_0x8a87('0x21')]||null:null,'attributes':_0x4c5096['options']?_0x4c5096['options'][_0x8a87('0x22')]||null:null,'limit':_0x4c5096['options']?_0x4c5096['options'][_0x8a87('0x23')]||null:null})[_0x8a87('0x12')](function(_0x353008){logger[_0x8a87('0x1a')](_0x8a87('0x1c'),_0x4c5096);logger[_0x8a87('0x24')]('UpdateOpenchannelInteraction',_0x4c5096,JSON[_0x8a87('0x16')](_0x353008));_0x345036(_0x353008);})[_0x8a87('0x1b')](function(_0x5cccd5){logger[_0x8a87('0x17')](_0x8a87('0x1c'),_0x5cccd5['message'],_0x4c5096);_0x100a37(_0xc1a1d5[_0x8a87('0x17')](0x1f4,_0x5cccd5[_0x8a87('0x19')]));});});};exports[_0x8a87('0x25')]=function(_0x1ac381){return new Promise(function(_0x56e950,_0x4a9832){return db[_0x8a87('0x1d')][_0x8a87('0x26')]({'where':_0x1ac381['options']?_0x1ac381[_0x8a87('0x20')][_0x8a87('0x21')]||null:null})[_0x8a87('0x12')](function(_0x5a0446){if(_0x5a0446){return _0x5a0446['addTags'](_0x1ac381[_0x8a87('0x1f')][_0x8a87('0x27')],_['omit'](_0x1ac381[_0x8a87('0x1f')],[_0x8a87('0x27'),'id'])||{});}})[_0x8a87('0x28')](function(_0x116ffe){logger[_0x8a87('0x1a')]('AddTags',_0x1ac381);logger[_0x8a87('0x24')]('AddTags',_0x1ac381,JSON[_0x8a87('0x16')](_0x116ffe));_0x56e950(_0x116ffe);})[_0x8a87('0x1b')](function(_0x4055cb){logger['error'](_0x8a87('0x29'),_0x4055cb[_0x8a87('0x19')],_0x1ac381);_0x4a9832(_this[_0x8a87('0x17')](0x1f4,_0x4055cb[_0x8a87('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 6a08bf7..4af231b 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 _0xc543=['openchannelInteraction:','./openchannelInteraction.events','save','update','emit','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc543,0x71));var _0x3c54=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0xc543[_0x4c06ac];return _0x2333cb;};'use strict';var OpenchannelInteractionEvents=require(_0x3c54('0x0'));var events=[_0x3c54('0x1'),'remove',_0x3c54('0x2')];function createListener(_0x4942a6,_0xbfbe0c){return function(_0x313a68){_0xbfbe0c[_0x3c54('0x3')](_0x4942a6,_0x313a68);};}function removeListener(_0x5b5a22,_0x1d153a){return function(){OpenchannelInteractionEvents['removeListener'](_0x5b5a22,_0x1d153a);};}exports[_0x3c54('0x4')]=function(_0x5ce870){for(var _0x30d73a=0x0,_0x2e84f0=events[_0x3c54('0x5')];_0x30d73a<_0x2e84f0;_0x30d73a++){var _0xfa788=events[_0x30d73a];var _0x254f77=createListener(_0x3c54('0x6')+_0xfa788,_0x5ce870);OpenchannelInteractionEvents['on'](_0xfa788,_0x254f77);}}; \ No newline at end of file +var _0xf1c6=['emit','removeListener','openchannelInteraction:','./openchannelInteraction.events','update'];(function(_0x49685b,_0x13325a){var _0x2baa99=function(_0x277f21){while(--_0x277f21){_0x49685b['push'](_0x49685b['shift']());}};_0x2baa99(++_0x13325a);}(_0xf1c6,0x76));var _0x6f1c=function(_0x142359,_0x1ebf24){_0x142359=_0x142359-0x0;var _0x1e8b29=_0xf1c6[_0x142359];return _0x1e8b29;};'use strict';var OpenchannelInteractionEvents=require(_0x6f1c('0x0'));var events=['save','remove',_0x6f1c('0x1')];function createListener(_0xf72a04,_0x1d1ab5){return function(_0x36d06b){_0x1d1ab5[_0x6f1c('0x2')](_0xf72a04,_0x36d06b);};}function removeListener(_0x308597,_0x399626){return function(){OpenchannelInteractionEvents[_0x6f1c('0x3')](_0x308597,_0x399626);};}exports['register']=function(_0x289e5e){for(var _0x161433=0x0,_0x2cfb40=events['length'];_0x161433<_0x2cfb40;_0x161433++){var _0x274baa=events[_0x161433];var _0x3e1e77=createListener(_0x6f1c('0x4')+_0x274baa,_0x289e5e);OpenchannelInteractionEvents['on'](_0x274baa,_0x3e1e77);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f4a1b42..bb84fd3 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 _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(_0x852450,_0xd2456e){var _0x329404=function(_0x4d482b){while(--_0x4d482b){_0x852450['push'](_0x852450['shift']());}};_0x329404(++_0xd2456e);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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 +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x4ec009,_0x134e02){var _0x4d0dca=function(_0x33b332){while(--_0x33b332){_0x4ec009['push'](_0x4ec009['shift']());}};_0x4d0dca(++_0x134e02);}(_0xe706,0xa3));var _0x6e70=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0xe706[_0x2831cf];return _0x5ec206;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 99465cc..1130bd8 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 _0xe605=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x43bb5c,_0x5aefe5){var _0x106a0c=function(_0x5071bd){while(--_0x5071bd){_0x43bb5c['push'](_0x43bb5c['shift']());}};_0x106a0c(++_0x5aefe5);}(_0xe605,0x92));var _0x5e60=function(_0x58ea9c,_0x354b12){_0x58ea9c=_0x58ea9c-0x0;var _0x5ce4fd=_0xe605[_0x58ea9c];return _0x5ce4fd;};'use strict';var Sequelize=require(_0x5e60('0x0'));module[_0x5e60('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5e60('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5e60('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5e60('0x4')]('in',_0x5e60('0x5')),'defaultValue':_0x5e60('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5e60('0x6')]},'providerName':{'type':Sequelize[_0x5e60('0x7')]},'providerResponse':{'type':Sequelize[_0x5e60('0x8')]}}; \ No newline at end of file +var _0xdc91=['exports','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x11bcd0,_0xa95de4){var _0x228763=function(_0x23eebb){while(--_0x23eebb){_0x11bcd0['push'](_0x11bcd0['shift']());}};_0x228763(++_0xa95de4);}(_0xdc91,0x8b));var _0x1dc9=function(_0x2794b2,_0x3616b6){_0x2794b2=_0x2794b2-0x0;var _0xc0e97e=_0xdc91[_0x2794b2];return _0xc0e97e;};'use strict';var Sequelize=require(_0x1dc9('0x0'));module[_0x1dc9('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1dc9('0x2')]('in',_0x1dc9('0x3')),'defaultValue':_0x1dc9('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1dc9('0x4')]},'providerName':{'type':Sequelize[_0x1dc9('0x5')]},'providerResponse':{'type':Sequelize[_0x1dc9('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 888396e..62b19f3 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 _0x043a=['name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','findAll','rows','show','params','OpenchannelMessage','include','find','catch','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','rejectmessage','eml-format','rimraf','zip-dir','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','request','then','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x043a,0x1e4));var _0xa043=function(_0x36ba35,_0x50a084){_0x36ba35=_0x36ba35-0x0;var _0xf012c6=_0x043a[_0x36ba35];return _0xf012c6;};'use strict';var emlformat=require(_0xa043('0x0'));var rimraf=require(_0xa043('0x1'));var zipdir=require(_0xa043('0x2'));var jsonpatch=require(_0xa043('0x3'));var rp=require('request-promise');var moment=require(_0xa043('0x4'));var BPromise=require(_0xa043('0x5'));var Mustache=require(_0xa043('0x6'));var util=require(_0xa043('0x7'));var path=require('path');var sox=require(_0xa043('0x8'));var csv=require('to-csv');var ejs=require(_0xa043('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa043('0xa'));var squel=require(_0xa043('0xb'));var crypto=require(_0xa043('0xc'));var jsforce=require(_0xa043('0xd'));var deskjs=require(_0xa043('0xe'));var toCsv=require(_0xa043('0xf'));var querystring=require(_0xa043('0x10'));var Papa=require(_0xa043('0x11'));var Redis=require('ioredis');var authService=require(_0xa043('0x12'));var qs=require(_0xa043('0x13'));var as=require(_0xa043('0x14'));var hardwareService=require(_0xa043('0x15'));var logger=require(_0xa043('0x16'))(_0xa043('0x17'));var utils=require(_0xa043('0x18'));var config=require(_0xa043('0x19'));var licenseUtil=require(_0xa043('0x1a'));var db=require(_0xa043('0x1b'))['db'];config['redis']=_['defaults'](config[_0xa043('0x1c')],{'host':_0xa043('0x1d'),'port':0x18eb});var socket=require(_0xa043('0x1e'))(new Redis(config['redis']));require(_0xa043('0x1f'))[_0xa043('0x20')](socket);var jayson=require(_0xa043('0x21'));var client=jayson[_0xa043('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xa043('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x575f7d,_0x55b20f,_0x176329,_0x122f2e){return new BPromise(function(_0x10df07,_0x50d379){var _0x24757d=_0x122f2e||client;return _0x24757d[_0xa043('0x23')](_0x575f7d,_0x176329)[_0xa043('0x24')](function(_0x5b75fb){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x55b20f,'request\x20sent');logger[_0xa043('0x25')](_0xa043('0x26'),_0x55b20f,_0xa043('0x27'),JSON[_0xa043('0x28')](_0x5b75fb));if(_0x5b75fb[_0xa043('0x29')]){if(_0x5b75fb['error']['code']===0x1f4){logger[_0xa043('0x29')](_0xa043('0x2a'),_0x55b20f,_0x5b75fb[_0xa043('0x29')]['message']);return _0x50d379(_0x5b75fb[_0xa043('0x29')][_0xa043('0x2b')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x55b20f,_0x5b75fb[_0xa043('0x29')][_0xa043('0x2b')]);return _0x10df07(_0x5b75fb['error'][_0xa043('0x2b')]);}else{logger['info'](_0xa043('0x2a'),_0x55b20f,_0xa043('0x27'));_0x10df07(_0x5b75fb[_0xa043('0x2c')][_0xa043('0x2b')]);}})['catch'](function(_0x10446a){logger[_0xa043('0x29')](_0xa043('0x2a'),_0x55b20f,_0x10446a);_0x50d379(_0x10446a);});});}function respondWithStatusCode(_0x465860,_0x2f6a08){_0x2f6a08=_0x2f6a08||0xcc;return function(_0x295951){if(_0x295951){return _0x465860[_0xa043('0x2d')](_0x2f6a08);}return _0x465860[_0xa043('0x2e')](_0x2f6a08)[_0xa043('0x2f')]();};}function respondWithResult(_0x4be824,_0x439962){_0x439962=_0x439962||0xc8;return function(_0x3144cb){if(_0x3144cb){return _0x4be824[_0xa043('0x2e')](_0x439962)[_0xa043('0x30')](_0x3144cb);}};}function respondWithFilteredResult(_0x1071c9,_0xcc2739){return function(_0x15944f){if(_0x15944f){var _0x5247a8=typeof _0xcc2739[_0xa043('0x31')]===_0xa043('0x32')&&typeof _0xcc2739[_0xa043('0x33')]===_0xa043('0x32');var _0x59a1aa=_0x15944f[_0xa043('0x34')];var _0x3dd094=_0x5247a8?0x0:_0xcc2739[_0xa043('0x31')];var _0xd04cb6=_0x5247a8?_0x15944f[_0xa043('0x34')]:_0xcc2739[_0xa043('0x31')]+_0xcc2739[_0xa043('0x33')];var _0x3e4b36;if(_0xd04cb6>=_0x59a1aa){_0xd04cb6=_0x59a1aa;_0x3e4b36=0xc8;}else{_0x3e4b36=0xce;}_0x1071c9[_0xa043('0x2e')](_0x3e4b36);return _0x1071c9[_0xa043('0x35')]('Content-Range',_0x3dd094+'-'+_0xd04cb6+'/'+_0x59a1aa)['json'](_0x15944f);}return null;};}function patchUpdates(_0x2f2535){return function(_0x3ef78e){try{jsonpatch[_0xa043('0x36')](_0x3ef78e,_0x2f2535,!![]);}catch(_0x37e289){return BPromise[_0xa043('0x37')](_0x37e289);}return _0x3ef78e[_0xa043('0x38')]();};}function saveUpdates(_0x2829cb,_0x5c923a){return function(_0x117c6b){if(_0x117c6b){return _0x117c6b[_0xa043('0x39')](_0x2829cb)[_0xa043('0x24')](function(_0x481a4a){return _0x481a4a;});}return null;};}function removeEntity(_0x445130,_0x39baf4){return function(_0x4270b6){if(_0x4270b6){return _0x4270b6[_0xa043('0x3a')]()['then'](function(){_0x445130[_0xa043('0x2e')](0xcc)[_0xa043('0x2f')]();});}};}function handleEntityNotFound(_0x429a6c,_0x3305d3){return function(_0x12131f){if(!_0x12131f){_0x429a6c['sendStatus'](0x194);}return _0x12131f;};}function handleError(_0x56bf50,_0x50deca){_0x50deca=_0x50deca||0x1f4;return function(_0x160f17){logger['error'](_0x160f17[_0xa043('0x3b')]);if(_0x160f17[_0xa043('0x3c')]){delete _0x160f17[_0xa043('0x3c')];}_0x56bf50['status'](_0x50deca)[_0xa043('0x3d')](_0x160f17);};}exports[_0xa043('0x3e')]=function(_0x5243b5,_0xdd5e2a){var _0x7160f={},_0x4d6aee={},_0x242c5c={'count':0x0,'rows':[]};var _0x249db6=_[_0xa043('0x3f')](db['OpenchannelMessage']['rawAttributes'],function(_0x7cfe24){return{'name':_0x7cfe24[_0xa043('0x40')],'type':_0x7cfe24[_0xa043('0x41')]['key']};});_0x4d6aee[_0xa043('0x42')]=_[_0xa043('0x3f')](_0x249db6,_0xa043('0x3c'));_0x4d6aee[_0xa043('0x43')]=_[_0xa043('0x44')](_0x5243b5['query']);_0x4d6aee[_0xa043('0x45')]=_[_0xa043('0x46')](_0x4d6aee[_0xa043('0x42')],_0x4d6aee[_0xa043('0x43')]);_0x7160f[_0xa043('0x47')]=_[_0xa043('0x46')](_0x4d6aee[_0xa043('0x42')],qs[_0xa043('0x48')](_0x5243b5['query'][_0xa043('0x48')]));_0x7160f[_0xa043('0x47')]=_0x7160f[_0xa043('0x47')][_0xa043('0x49')]?_0x7160f[_0xa043('0x47')]:_0x4d6aee[_0xa043('0x42')];if(!_0x5243b5[_0xa043('0x43')][_0xa043('0x4a')](_0xa043('0x4b'))){_0x7160f[_0xa043('0x33')]=qs['limit'](_0x5243b5[_0xa043('0x43')]['limit']);_0x7160f[_0xa043('0x31')]=qs[_0xa043('0x31')](_0x5243b5[_0xa043('0x43')][_0xa043('0x31')]);}_0x7160f['order']=qs[_0xa043('0x4c')](_0x5243b5[_0xa043('0x43')]['sort']);_0x7160f['where']=qs['filters'](_[_0xa043('0x4d')](_0x5243b5['query'],_0x4d6aee[_0xa043('0x45')]),_0x249db6);if(_0x5243b5[_0xa043('0x43')][_0xa043('0x4e')]){_0x7160f['where']=_[_0xa043('0x4f')](_0x7160f[_0xa043('0x50')],{'$or':_[_0xa043('0x3f')](_0x249db6,function(_0x568406){if(_0x568406[_0xa043('0x41')]!=='VIRTUAL'){var _0x2609c9={};_0x2609c9[_0x568406[_0xa043('0x3c')]]={'$like':'%'+_0x5243b5[_0xa043('0x43')][_0xa043('0x4e')]+'%'};return _0x2609c9;}})});}_0x7160f=_[_0xa043('0x4f')]({},_0x7160f,_0x5243b5[_0xa043('0x51')]);var _0x487c12={'where':_0x7160f[_0xa043('0x50')]};return db['OpenchannelMessage'][_0xa043('0x34')](_0x487c12)[_0xa043('0x24')](function(_0x110ec7){_0x242c5c[_0xa043('0x34')]=_0x110ec7;if(_0x5243b5['query'][_0xa043('0x52')]){_0x7160f['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa043('0x53')](_0x7160f);})[_0xa043('0x24')](function(_0x523cff){_0x242c5c[_0xa043('0x54')]=_0x523cff;return _0x242c5c;})[_0xa043('0x24')](respondWithFilteredResult(_0xdd5e2a,_0x7160f))['catch'](handleError(_0xdd5e2a,null));};exports[_0xa043('0x55')]=function(_0x149d16,_0x466812){var _0x9f7309={'raw':!![],'where':{'id':_0x149d16[_0xa043('0x56')]['id']}},_0x4c88={};_0x4c88['model']=_['keys'](db[_0xa043('0x57')]['rawAttributes']);_0x4c88[_0xa043('0x43')]=_[_0xa043('0x44')](_0x149d16[_0xa043('0x43')]);_0x4c88[_0xa043('0x45')]=_[_0xa043('0x46')](_0x4c88['model'],_0x4c88[_0xa043('0x43')]);_0x9f7309['attributes']=_[_0xa043('0x46')](_0x4c88[_0xa043('0x42')],qs[_0xa043('0x48')](_0x149d16[_0xa043('0x43')]['fields']));_0x9f7309[_0xa043('0x47')]=_0x9f7309[_0xa043('0x47')][_0xa043('0x49')]?_0x9f7309['attributes']:_0x4c88[_0xa043('0x42')];if(_0x149d16['query']['includeAll']){_0x9f7309[_0xa043('0x58')]=[{'all':!![]}];}_0x9f7309=_[_0xa043('0x4f')]({},_0x9f7309,_0x149d16[_0xa043('0x51')]);return db[_0xa043('0x57')][_0xa043('0x59')](_0x9f7309)[_0xa043('0x24')](handleEntityNotFound(_0x466812,null))['then'](respondWithResult(_0x466812,null))[_0xa043('0x5a')](handleError(_0x466812,null));};exports[_0xa043('0x5b')]=function(_0xc64000,_0x5182b4){return db[_0xa043('0x57')]['create'](_0xc64000['body'],{})[_0xa043('0x24')](respondWithResult(_0x5182b4,0xc9))['catch'](handleError(_0x5182b4,null));};exports[_0xa043('0x39')]=function(_0x174b6e,_0x583f34){if(_0x174b6e[_0xa043('0x5c')]['id']){delete _0x174b6e['body']['id'];}return db[_0xa043('0x57')][_0xa043('0x59')]({'where':{'id':_0x174b6e[_0xa043('0x56')]['id']}})[_0xa043('0x24')](handleEntityNotFound(_0x583f34,null))['then'](saveUpdates(_0x174b6e[_0xa043('0x5c')],null))[_0xa043('0x24')](respondWithResult(_0x583f34,null))[_0xa043('0x5a')](handleError(_0x583f34,null));};exports[_0xa043('0x3a')]=function(_0x34988d,_0x507b75){return db['OpenchannelMessage'][_0xa043('0x59')]({'where':{'id':_0x34988d[_0xa043('0x56')]['id']}})['then'](handleEntityNotFound(_0x507b75,null))[_0xa043('0x24')](removeEntity(_0x507b75,null))[_0xa043('0x5a')](handleError(_0x507b75,null));};exports[_0xa043('0x5d')]=function(_0x54a46b,_0x5aadf1){return db[_0xa043('0x57')][_0xa043('0x5d')]()[_0xa043('0x24')](respondWithResult(_0x5aadf1,null))[_0xa043('0x5a')](handleError(_0x5aadf1,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xa043('0x5e')]=function(_0x25f5a6,_0x200656,_0xd52e72){var _0x297680={'agent':{},'channel':'openchannel'};if(_0x25f5a6[_0xa043('0x5c')]['id']){delete _0x25f5a6['body']['id'];}_0x25f5a6[_0xa043('0x5c')][_0xa043('0x5f')]=!![];_0x25f5a6[_0xa043('0x5c')][_0xa043('0x60')]=moment()[_0xa043('0x61')](_0xa043('0x62'));_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')]=_0x25f5a6[_0xa043('0x5c')]['UserId']||_0x25f5a6['user']['id'];_0x297680[_0xa043('0x64')]['id']=_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')];return db[_0xa043('0x57')][_0xa043('0x59')]({'where':{'id':_0x25f5a6[_0xa043('0x56')]['id'],'UserId':null}})[_0xa043('0x24')](handleEntityNotFound(_0x200656,null))[_0xa043('0x24')](saveUpdates(_0x25f5a6['body'],null))[_0xa043('0x24')](function(_0x27f29e){if(_0x27f29e){_0x297680['message']=_0x27f29e['get']({'plain':!![]});return db[_0xa043('0x65')][_0xa043('0x59')]({'where':{'id':_0x27f29e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x200656,null))[_0xa043('0x24')](function(_0x46957d){if(_0x46957d){return _0x46957d[_0xa043('0x39')]({'UserId':_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')],'read1stAt':_[_0xa043('0x66')](_0x46957d[_0xa043('0x67')])?moment()[_0xa043('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa043('0x24')](function(_0x449057){if(_0x449057){_0x297680[_0xa043('0x68')]=_0x449057[_0xa043('0x69')]({'plain':!![]});interaction_log[_0xa043('0x6a')](_0xa043('0x6b'),_0x25f5a6[_0xa043('0x6c')]['id'],_0x25f5a6[_0xa043('0x6c')][_0xa043('0x3c')],_0x25f5a6[_0xa043('0x6c')][_0xa043('0x6d')],_0x297680['interaction']['id'],_0x25f5a6[_0xa043('0x5c')]?JSON['stringify'](_0x25f5a6[_0xa043('0x5c')]):_0xa043('0x6e'));return respondWithRpcPromise(_0xa043('0x6f'),'acceptMessage',_0x297680);}return null;})[_0xa043('0x24')](function(_0x95c87f){var _0x516643=_0xa043('0x70')+_0x95c87f[_0xa043('0x2b')]['ContactId'];return db[_0xa043('0x71')]['query'](_0x516643,{'type':db[_0xa043('0x72')][_0xa043('0x73')]['SELECT'],'raw':!![]})[_0xa043('0x24')](function(_0x5021f2){return _0x5021f2;});})[_0xa043('0x24')](function(_0x4e59f7){if(_0x4e59f7){_0x297680[_0xa043('0x2b')][_0xa043('0x74')]=_0x4e59f7[0x0];if(!_0x25f5a6[_0xa043('0x5c')][_0xa043('0x63')])return;return db[_0xa043('0x75')][_0xa043('0x59')]({'where':{'id':_0x25f5a6['body']['UserId'],'role':_0xa043('0x64')},'attributes':['id',_0xa043('0x3c'),_0xa043('0x76'),_0xa043('0x77'),_0xa043('0x78')],'raw':!![]});}return null;})[_0xa043('0x24')](function(_0x1439b3){if(!_0x1439b3)return null;_0x297680['message'][_0xa043('0x64')]=_0x1439b3;return _0x297680;})[_0xa043('0x24')](function(_0x4e6bbe){if(_0x4e6bbe){if(_0x25f5a6[_0xa043('0x5c')][_0xa043('0x79')]){_0x297680[_0xa043('0x2b')]['interface']=util['format'](_0xa043('0x7a'),_0x25f5a6[_0xa043('0x6c')][_0xa043('0x3c')]);_0x297680[_0xa043('0x2b')]['channel']=_0x297680[_0xa043('0x7b')];_0x297680[_0xa043('0x2b')][_0xa043('0x7c')]=_0x297680[_0xa043('0x7b')];_0x297680[_0xa043('0x2b')][_0xa043('0x7d')]=_0xa043('0x5e');return respondWithRpcPromise(_0xa043('0x7e'),_0xa043('0x7e'),{'event':_0xa043('0x7f'),'message':_0x297680[_0xa043('0x2b')]},client9002)[_0xa043('0x24')](function(){return _0x297680;});}return _0x297680;}return null;})[_0xa043('0x24')](respondWithResult(_0x200656,null))[_0xa043('0x5a')](handleError(_0x200656,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xa043('0x37')]=function(_0x5f07c0,_0x824942,_0x25e3be){var _0x6624bf={'agent':{},'channel':_0xa043('0x80')};if(_0x5f07c0['body']['id']){delete _0x5f07c0['body']['id'];}_0x5f07c0['body']['UserId']=_0x5f07c0[_0xa043('0x5c')][_0xa043('0x63')]||_0x5f07c0['user']['id'];_0x6624bf[_0xa043('0x64')]['id']=_0x5f07c0[_0xa043('0x5c')][_0xa043('0x63')];return db[_0xa043('0x57')][_0xa043('0x59')]({'where':{'id':_0x5f07c0['params']['id'],'UserId':null}})[_0xa043('0x24')](handleEntityNotFound(_0x824942,null))[_0xa043('0x24')](function(_0xc19633){if(_0xc19633){_0x6624bf[_0xa043('0x2b')]=_0xc19633[_0xa043('0x69')]({'plain':!![]});return db[_0xa043('0x65')]['find']({'where':{'id':_0xc19633[_0xa043('0x81')]}});}return null;})[_0xa043('0x24')](handleEntityNotFound(_0x824942,null))[_0xa043('0x24')](function(_0x4e30e0){if(_0x4e30e0){_0x6624bf[_0xa043('0x68')]=_0x4e30e0[_0xa043('0x69')]({'plain':!![]});interaction_log[_0xa043('0x6a')](_0xa043('0x82'),_0x5f07c0[_0xa043('0x6c')]['id'],_0x5f07c0[_0xa043('0x6c')][_0xa043('0x3c')],_0x5f07c0[_0xa043('0x6c')][_0xa043('0x6d')],_0x6624bf['interaction']['id'],_0x5f07c0['body']?JSON[_0xa043('0x28')](_0x5f07c0[_0xa043('0x5c')]):'null');return respondWithRpcPromise(_0xa043('0x83'),_0xa043('0x84'),_0x6624bf);}return null;})[_0xa043('0x24')](function(_0x38fb4c){var _0x19b720='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38fb4c[_0xa043('0x2b')][_0xa043('0x85')];return db[_0xa043('0x71')][_0xa043('0x43')](_0x19b720,{'type':db[_0xa043('0x72')][_0xa043('0x73')][_0xa043('0x86')],'raw':!![]})[_0xa043('0x24')](function(_0xdc5b38){return _0xdc5b38;});})[_0xa043('0x24')](function(_0x20fd8c){if(_0x20fd8c){_0x6624bf[_0xa043('0x2b')][_0xa043('0x74')]=_0x20fd8c[0x0];if(!_0x5f07c0[_0xa043('0x5c')]['UserId'])return;return db[_0xa043('0x75')][_0xa043('0x59')]({'where':{'id':_0x5f07c0['body'][_0xa043('0x63')],'role':_0xa043('0x64')},'attributes':['id','name',_0xa043('0x76'),_0xa043('0x77'),_0xa043('0x78')],'raw':!![]});}return null;})[_0xa043('0x24')](function(_0x1f4207){if(!_0x1f4207)return null;_0x6624bf[_0xa043('0x2b')][_0xa043('0x64')]=_0x1f4207;return _0x6624bf;})[_0xa043('0x24')](function(_0x2bdab4){if(_0x2bdab4){_0x2bdab4[_0xa043('0x2b')]['interface']=util[_0xa043('0x61')](_0xa043('0x7a'),_0x5f07c0['user']['name']);_0x2bdab4[_0xa043('0x2b')]['channel']=_0x6624bf[_0xa043('0x7b')];_0x2bdab4['message'][_0xa043('0x7c')]=_0x6624bf[_0xa043('0x7b')];_0x2bdab4[_0xa043('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0xa043('0x7e'),{'event':_0xa043('0x87'),'message':_0x2bdab4[_0xa043('0x2b')]},client9002);return _0x6624bf;}return null;})[_0xa043('0x24')](respondWithResult(_0x824942,null))[_0xa043('0x5a')](handleError(_0x824942,null));}; \ No newline at end of file +var _0xd3e3=['Content-Range','reject','save','destroy','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelMessage','includeAll','findAll','rows','show','params','length','include','find','create','body','update','describe','../../config/logger','openchannel-interactions','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','isNil','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteractionId','null','RejectMessage','rejectMessage','QueryTypes','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x23f714,_0x52852d){var _0x28e54b=function(_0x2449d7){while(--_0x2449d7){_0x23f714['push'](_0x23f714['shift']());}};_0x28e54b(++_0x52852d);}(_0xd3e3,0xdd));var _0x3d3e=function(_0x9181ad,_0x1e03c7){_0x9181ad=_0x9181ad-0x0;var _0x3f0a90=_0xd3e3[_0x9181ad];return _0x3f0a90;};'use strict';var emlformat=require(_0x3d3e('0x0'));var rimraf=require(_0x3d3e('0x1'));var zipdir=require(_0x3d3e('0x2'));var jsonpatch=require(_0x3d3e('0x3'));var rp=require('request-promise');var moment=require(_0x3d3e('0x4'));var BPromise=require(_0x3d3e('0x5'));var Mustache=require('mustache');var util=require(_0x3d3e('0x6'));var path=require(_0x3d3e('0x7'));var sox=require('sox');var csv=require(_0x3d3e('0x8'));var ejs=require(_0x3d3e('0x9'));var fs=require('fs');var fs_extra=require(_0x3d3e('0xa'));var _=require(_0x3d3e('0xb'));var squel=require(_0x3d3e('0xc'));var crypto=require('crypto');var jsforce=require(_0x3d3e('0xd'));var deskjs=require(_0x3d3e('0xe'));var toCsv=require(_0x3d3e('0x8'));var querystring=require('querystring');var Papa=require(_0x3d3e('0xf'));var Redis=require(_0x3d3e('0x10'));var authService=require(_0x3d3e('0x11'));var qs=require(_0x3d3e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d3e('0x13'));var logger=require('../../config/logger')(_0x3d3e('0x14'));var utils=require(_0x3d3e('0x15'));var config=require(_0x3d3e('0x16'));var licenseUtil=require(_0x3d3e('0x17'));var db=require('../../mysqldb')['db'];config[_0x3d3e('0x18')]=_[_0x3d3e('0x19')](config['redis'],{'host':_0x3d3e('0x1a'),'port':0x18eb});var socket=require(_0x3d3e('0x1b'))(new Redis(config[_0x3d3e('0x18')]));require(_0x3d3e('0x1c'))[_0x3d3e('0x1d')](socket);var jayson=require(_0x3d3e('0x1e'));var client=jayson[_0x3d3e('0x1f')][_0x3d3e('0x20')]({'port':0x232c});var client9002=jayson[_0x3d3e('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3856e9,_0x2e664b,_0x2c5127,_0x47d8ff){return new BPromise(function(_0x59f0cb,_0x416206){var _0x5c19bf=_0x47d8ff||client;return _0x5c19bf[_0x3d3e('0x21')](_0x3856e9,_0x2c5127)[_0x3d3e('0x22')](function(_0x317242){logger[_0x3d3e('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x2e664b,'request\x20sent');logger[_0x3d3e('0x24')](_0x3d3e('0x25'),_0x2e664b,'request\x20sent',JSON[_0x3d3e('0x26')](_0x317242));if(_0x317242[_0x3d3e('0x27')]){if(_0x317242[_0x3d3e('0x27')][_0x3d3e('0x28')]===0x1f4){logger[_0x3d3e('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x2e664b,_0x317242['error'][_0x3d3e('0x29')]);return _0x416206(_0x317242[_0x3d3e('0x27')][_0x3d3e('0x29')]);}logger[_0x3d3e('0x27')](_0x3d3e('0x2a'),_0x2e664b,_0x317242[_0x3d3e('0x27')][_0x3d3e('0x29')]);return _0x59f0cb(_0x317242[_0x3d3e('0x27')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2e664b,_0x3d3e('0x2b'));_0x59f0cb(_0x317242[_0x3d3e('0x2c')][_0x3d3e('0x29')]);}})[_0x3d3e('0x2d')](function(_0x1e4116){logger[_0x3d3e('0x27')](_0x3d3e('0x2a'),_0x2e664b,_0x1e4116);_0x416206(_0x1e4116);});});}function respondWithStatusCode(_0x2ceb74,_0x4e77d9){_0x4e77d9=_0x4e77d9||0xcc;return function(_0x353b74){if(_0x353b74){return _0x2ceb74[_0x3d3e('0x2e')](_0x4e77d9);}return _0x2ceb74[_0x3d3e('0x2f')](_0x4e77d9)[_0x3d3e('0x30')]();};}function respondWithResult(_0xd3eb2e,_0x466471){_0x466471=_0x466471||0xc8;return function(_0x273ad1){if(_0x273ad1){return _0xd3eb2e['status'](_0x466471)[_0x3d3e('0x31')](_0x273ad1);}};}function respondWithFilteredResult(_0x470030,_0x16e7d9){return function(_0xb50dfa){if(_0xb50dfa){var _0x4498f0=typeof _0x16e7d9['offset']===_0x3d3e('0x32')&&typeof _0x16e7d9[_0x3d3e('0x33')]==='undefined';var _0xafdb65=_0xb50dfa[_0x3d3e('0x34')];var _0x9b1912=_0x4498f0?0x0:_0x16e7d9[_0x3d3e('0x35')];var _0x311bd9=_0x4498f0?_0xb50dfa['count']:_0x16e7d9[_0x3d3e('0x35')]+_0x16e7d9['limit'];var _0x4c7412;if(_0x311bd9>=_0xafdb65){_0x311bd9=_0xafdb65;_0x4c7412=0xc8;}else{_0x4c7412=0xce;}_0x470030[_0x3d3e('0x2f')](_0x4c7412);return _0x470030[_0x3d3e('0x36')](_0x3d3e('0x37'),_0x9b1912+'-'+_0x311bd9+'/'+_0xafdb65)[_0x3d3e('0x31')](_0xb50dfa);}return null;};}function patchUpdates(_0x3e3653){return function(_0x242f96){try{jsonpatch['apply'](_0x242f96,_0x3e3653,!![]);}catch(_0x31f44b){return BPromise[_0x3d3e('0x38')](_0x31f44b);}return _0x242f96[_0x3d3e('0x39')]();};}function saveUpdates(_0x58339f,_0xa1b2d6){return function(_0x27166e){if(_0x27166e){return _0x27166e['update'](_0x58339f)[_0x3d3e('0x22')](function(_0x48b20a){return _0x48b20a;});}return null;};}function removeEntity(_0x5f4d63,_0x538fbe){return function(_0x1750e4){if(_0x1750e4){return _0x1750e4[_0x3d3e('0x3a')]()['then'](function(){_0x5f4d63['status'](0xcc)[_0x3d3e('0x30')]();});}};}function handleEntityNotFound(_0x43a0c8,_0x4976b4){return function(_0x492b13){if(!_0x492b13){_0x43a0c8['sendStatus'](0x194);}return _0x492b13;};}function handleError(_0x382e23,_0x47ce8e){_0x47ce8e=_0x47ce8e||0x1f4;return function(_0x3767e1){logger[_0x3d3e('0x27')](_0x3767e1[_0x3d3e('0x3b')]);if(_0x3767e1[_0x3d3e('0x3c')]){delete _0x3767e1['name'];}_0x382e23[_0x3d3e('0x2f')](_0x47ce8e)[_0x3d3e('0x3d')](_0x3767e1);};}exports[_0x3d3e('0x3e')]=function(_0x437535,_0x6a33e5){var _0x5eef94={},_0x3a1db4={},_0xf6a8c={'count':0x0,'rows':[]};var _0x233b97=_[_0x3d3e('0x3f')](db['OpenchannelMessage']['rawAttributes'],function(_0x447da0){return{'name':_0x447da0[_0x3d3e('0x40')],'type':_0x447da0['type'][_0x3d3e('0x41')]};});_0x3a1db4['model']=_[_0x3d3e('0x3f')](_0x233b97,_0x3d3e('0x3c'));_0x3a1db4[_0x3d3e('0x42')]=_[_0x3d3e('0x43')](_0x437535['query']);_0x3a1db4[_0x3d3e('0x44')]=_[_0x3d3e('0x45')](_0x3a1db4[_0x3d3e('0x46')],_0x3a1db4[_0x3d3e('0x42')]);_0x5eef94['attributes']=_[_0x3d3e('0x45')](_0x3a1db4[_0x3d3e('0x46')],qs[_0x3d3e('0x47')](_0x437535[_0x3d3e('0x42')][_0x3d3e('0x47')]));_0x5eef94[_0x3d3e('0x48')]=_0x5eef94[_0x3d3e('0x48')]['length']?_0x5eef94[_0x3d3e('0x48')]:_0x3a1db4['model'];if(!_0x437535[_0x3d3e('0x42')][_0x3d3e('0x49')](_0x3d3e('0x4a'))){_0x5eef94[_0x3d3e('0x33')]=qs['limit'](_0x437535[_0x3d3e('0x42')]['limit']);_0x5eef94[_0x3d3e('0x35')]=qs[_0x3d3e('0x35')](_0x437535['query']['offset']);}_0x5eef94[_0x3d3e('0x4b')]=qs[_0x3d3e('0x4c')](_0x437535[_0x3d3e('0x42')]['sort']);_0x5eef94[_0x3d3e('0x4d')]=qs['filters'](_[_0x3d3e('0x4e')](_0x437535[_0x3d3e('0x42')],_0x3a1db4['filters']),_0x233b97);if(_0x437535['query']['filter']){_0x5eef94[_0x3d3e('0x4d')]=_[_0x3d3e('0x4f')](_0x5eef94[_0x3d3e('0x4d')],{'$or':_[_0x3d3e('0x3f')](_0x233b97,function(_0x41d6d2){if(_0x41d6d2['type']!==_0x3d3e('0x50')){var _0x1778b0={};_0x1778b0[_0x41d6d2[_0x3d3e('0x3c')]]={'$like':'%'+_0x437535[_0x3d3e('0x42')][_0x3d3e('0x51')]+'%'};return _0x1778b0;}})});}_0x5eef94=_[_0x3d3e('0x4f')]({},_0x5eef94,_0x437535[_0x3d3e('0x52')]);var _0xe599e={'where':_0x5eef94['where']};return db[_0x3d3e('0x53')][_0x3d3e('0x34')](_0xe599e)[_0x3d3e('0x22')](function(_0x50c771){_0xf6a8c[_0x3d3e('0x34')]=_0x50c771;if(_0x437535['query'][_0x3d3e('0x54')]){_0x5eef94['include']=[{'all':!![]}];}return db[_0x3d3e('0x53')][_0x3d3e('0x55')](_0x5eef94);})['then'](function(_0x1c8a6b){_0xf6a8c[_0x3d3e('0x56')]=_0x1c8a6b;return _0xf6a8c;})[_0x3d3e('0x22')](respondWithFilteredResult(_0x6a33e5,_0x5eef94))[_0x3d3e('0x2d')](handleError(_0x6a33e5,null));};exports[_0x3d3e('0x57')]=function(_0x263013,_0x1cdb4a){var _0x49a474={'raw':!![],'where':{'id':_0x263013[_0x3d3e('0x58')]['id']}},_0x67ee2a={};_0x67ee2a[_0x3d3e('0x46')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x67ee2a[_0x3d3e('0x42')]=_[_0x3d3e('0x43')](_0x263013[_0x3d3e('0x42')]);_0x67ee2a['filters']=_[_0x3d3e('0x45')](_0x67ee2a['model'],_0x67ee2a[_0x3d3e('0x42')]);_0x49a474['attributes']=_[_0x3d3e('0x45')](_0x67ee2a[_0x3d3e('0x46')],qs[_0x3d3e('0x47')](_0x263013[_0x3d3e('0x42')][_0x3d3e('0x47')]));_0x49a474['attributes']=_0x49a474[_0x3d3e('0x48')][_0x3d3e('0x59')]?_0x49a474[_0x3d3e('0x48')]:_0x67ee2a[_0x3d3e('0x46')];if(_0x263013[_0x3d3e('0x42')][_0x3d3e('0x54')]){_0x49a474[_0x3d3e('0x5a')]=[{'all':!![]}];}_0x49a474=_[_0x3d3e('0x4f')]({},_0x49a474,_0x263013['options']);return db[_0x3d3e('0x53')][_0x3d3e('0x5b')](_0x49a474)[_0x3d3e('0x22')](handleEntityNotFound(_0x1cdb4a,null))[_0x3d3e('0x22')](respondWithResult(_0x1cdb4a,null))[_0x3d3e('0x2d')](handleError(_0x1cdb4a,null));};exports['create']=function(_0x5988b4,_0x19c59f){return db[_0x3d3e('0x53')][_0x3d3e('0x5c')](_0x5988b4[_0x3d3e('0x5d')],{})[_0x3d3e('0x22')](respondWithResult(_0x19c59f,0xc9))[_0x3d3e('0x2d')](handleError(_0x19c59f,null));};exports[_0x3d3e('0x5e')]=function(_0x3e9e64,_0x1851cf){if(_0x3e9e64[_0x3d3e('0x5d')]['id']){delete _0x3e9e64[_0x3d3e('0x5d')]['id'];}return db[_0x3d3e('0x53')]['find']({'where':{'id':_0x3e9e64[_0x3d3e('0x58')]['id']}})[_0x3d3e('0x22')](handleEntityNotFound(_0x1851cf,null))['then'](saveUpdates(_0x3e9e64[_0x3d3e('0x5d')],null))[_0x3d3e('0x22')](respondWithResult(_0x1851cf,null))['catch'](handleError(_0x1851cf,null));};exports[_0x3d3e('0x3a')]=function(_0x359ae5,_0x37e2da){return db[_0x3d3e('0x53')][_0x3d3e('0x5b')]({'where':{'id':_0x359ae5['params']['id']}})[_0x3d3e('0x22')](handleEntityNotFound(_0x37e2da,null))['then'](removeEntity(_0x37e2da,null))[_0x3d3e('0x2d')](handleError(_0x37e2da,null));};exports[_0x3d3e('0x5f')]=function(_0x4f01f5,_0x40e026){return db[_0x3d3e('0x53')][_0x3d3e('0x5f')]()[_0x3d3e('0x22')](respondWithResult(_0x40e026,null))[_0x3d3e('0x2d')](handleError(_0x40e026,null));};var interaction_log=require(_0x3d3e('0x60'))(_0x3d3e('0x61'));exports['accept']=function(_0x2d7c4c,_0x4e0be5,_0x58f595){var _0x1b6cbe={'agent':{},'channel':_0x3d3e('0x62')};if(_0x2d7c4c[_0x3d3e('0x5d')]['id']){delete _0x2d7c4c[_0x3d3e('0x5d')]['id'];}_0x2d7c4c['body'][_0x3d3e('0x63')]=!![];_0x2d7c4c[_0x3d3e('0x5d')]['readAt']=moment()[_0x3d3e('0x64')](_0x3d3e('0x65'));_0x2d7c4c['body'][_0x3d3e('0x66')]=_0x2d7c4c[_0x3d3e('0x5d')]['UserId']||_0x2d7c4c['user']['id'];_0x1b6cbe[_0x3d3e('0x67')]['id']=_0x2d7c4c[_0x3d3e('0x5d')][_0x3d3e('0x66')];return db[_0x3d3e('0x53')]['find']({'where':{'id':_0x2d7c4c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e0be5,null))[_0x3d3e('0x22')](saveUpdates(_0x2d7c4c[_0x3d3e('0x5d')],null))[_0x3d3e('0x22')](function(_0x5e4f26){if(_0x5e4f26){_0x1b6cbe[_0x3d3e('0x29')]=_0x5e4f26['get']({'plain':!![]});return db[_0x3d3e('0x68')][_0x3d3e('0x5b')]({'where':{'id':_0x5e4f26['OpenchannelInteractionId']}});}return null;})[_0x3d3e('0x22')](handleEntityNotFound(_0x4e0be5,null))[_0x3d3e('0x22')](function(_0x3dd2d8){if(_0x3dd2d8){return _0x3dd2d8[_0x3d3e('0x5e')]({'UserId':_0x2d7c4c[_0x3d3e('0x5d')]['UserId'],'read1stAt':_[_0x3d3e('0x69')](_0x3dd2d8[_0x3d3e('0x6a')])?moment()[_0x3d3e('0x64')](_0x3d3e('0x65')):undefined});}return null;})[_0x3d3e('0x22')](function(_0x34ffa9){if(_0x34ffa9){_0x1b6cbe['interaction']=_0x34ffa9[_0x3d3e('0x6b')]({'plain':!![]});interaction_log[_0x3d3e('0x23')](_0x3d3e('0x6c'),_0x2d7c4c[_0x3d3e('0x6d')]['id'],_0x2d7c4c[_0x3d3e('0x6d')][_0x3d3e('0x3c')],_0x2d7c4c['user'][_0x3d3e('0x6e')],_0x1b6cbe[_0x3d3e('0x6f')]['id'],_0x2d7c4c['body']?JSON[_0x3d3e('0x26')](_0x2d7c4c['body']):'null');return respondWithRpcPromise(_0x3d3e('0x70'),'acceptMessage',_0x1b6cbe);}return null;})[_0x3d3e('0x22')](function(_0x49e7f7){var _0x467bae=_0x3d3e('0x71')+_0x49e7f7[_0x3d3e('0x29')][_0x3d3e('0x72')];return db[_0x3d3e('0x73')]['query'](_0x467bae,{'type':db[_0x3d3e('0x74')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3d3e('0x22')](function(_0x5edf7f){return _0x5edf7f;});})[_0x3d3e('0x22')](function(_0x25b8f1){if(_0x25b8f1){_0x1b6cbe[_0x3d3e('0x29')][_0x3d3e('0x75')]=_0x25b8f1[0x0];if(!_0x2d7c4c[_0x3d3e('0x5d')]['UserId'])return;return db[_0x3d3e('0x76')][_0x3d3e('0x5b')]({'where':{'id':_0x2d7c4c[_0x3d3e('0x5d')][_0x3d3e('0x66')],'role':_0x3d3e('0x67')},'attributes':['id',_0x3d3e('0x3c'),_0x3d3e('0x77'),_0x3d3e('0x78'),_0x3d3e('0x79')],'raw':!![]});}return null;})[_0x3d3e('0x22')](function(_0x1c6027){if(!_0x1c6027)return null;_0x1b6cbe[_0x3d3e('0x29')][_0x3d3e('0x67')]=_0x1c6027;return _0x1b6cbe;})[_0x3d3e('0x22')](function(_0x326a79){if(_0x326a79){if(_0x2d7c4c['body'][_0x3d3e('0x7a')]){_0x1b6cbe[_0x3d3e('0x29')][_0x3d3e('0x7b')]=util[_0x3d3e('0x64')](_0x3d3e('0x7c'),_0x2d7c4c[_0x3d3e('0x6d')][_0x3d3e('0x3c')]);_0x1b6cbe['message'][_0x3d3e('0x7d')]=_0x1b6cbe['channel'];_0x1b6cbe[_0x3d3e('0x29')][_0x3d3e('0x7e')]=_0x1b6cbe[_0x3d3e('0x7d')];_0x1b6cbe[_0x3d3e('0x29')][_0x3d3e('0x7f')]=_0x3d3e('0x80');return respondWithRpcPromise(_0x3d3e('0x81'),_0x3d3e('0x81'),{'event':_0x3d3e('0x82'),'message':_0x1b6cbe[_0x3d3e('0x29')]},client9002)[_0x3d3e('0x22')](function(){return _0x1b6cbe;});}return _0x1b6cbe;}return null;})[_0x3d3e('0x22')](respondWithResult(_0x4e0be5,null))[_0x3d3e('0x2d')](handleError(_0x4e0be5,null));};var interaction_log=require(_0x3d3e('0x60'))(_0x3d3e('0x61'));exports[_0x3d3e('0x38')]=function(_0xf15ff9,_0x2bdb70,_0x9400c4){var _0xba79de={'agent':{},'channel':_0x3d3e('0x62')};if(_0xf15ff9['body']['id']){delete _0xf15ff9[_0x3d3e('0x5d')]['id'];}_0xf15ff9[_0x3d3e('0x5d')][_0x3d3e('0x66')]=_0xf15ff9['body']['UserId']||_0xf15ff9[_0x3d3e('0x6d')]['id'];_0xba79de[_0x3d3e('0x67')]['id']=_0xf15ff9['body'][_0x3d3e('0x66')];return db[_0x3d3e('0x53')][_0x3d3e('0x5b')]({'where':{'id':_0xf15ff9[_0x3d3e('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2bdb70,null))[_0x3d3e('0x22')](function(_0x459f66){if(_0x459f66){_0xba79de['message']=_0x459f66[_0x3d3e('0x6b')]({'plain':!![]});return db['OpenchannelInteraction'][_0x3d3e('0x5b')]({'where':{'id':_0x459f66[_0x3d3e('0x83')]}});}return null;})[_0x3d3e('0x22')](handleEntityNotFound(_0x2bdb70,null))['then'](function(_0x79d040){if(_0x79d040){_0xba79de[_0x3d3e('0x6f')]=_0x79d040[_0x3d3e('0x6b')]({'plain':!![]});interaction_log[_0x3d3e('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf15ff9[_0x3d3e('0x6d')]['id'],_0xf15ff9[_0x3d3e('0x6d')][_0x3d3e('0x3c')],_0xf15ff9[_0x3d3e('0x6d')]['role'],_0xba79de[_0x3d3e('0x6f')]['id'],_0xf15ff9[_0x3d3e('0x5d')]?JSON[_0x3d3e('0x26')](_0xf15ff9['body']):_0x3d3e('0x84'));return respondWithRpcPromise(_0x3d3e('0x85'),_0x3d3e('0x86'),_0xba79de);}return null;})[_0x3d3e('0x22')](function(_0x26ded7){var _0x1ebe8d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26ded7[_0x3d3e('0x29')][_0x3d3e('0x72')];return db[_0x3d3e('0x73')][_0x3d3e('0x42')](_0x1ebe8d,{'type':db[_0x3d3e('0x74')][_0x3d3e('0x87')][_0x3d3e('0x88')],'raw':!![]})[_0x3d3e('0x22')](function(_0x240b31){return _0x240b31;});})[_0x3d3e('0x22')](function(_0x1c9318){if(_0x1c9318){_0xba79de[_0x3d3e('0x29')][_0x3d3e('0x75')]=_0x1c9318[0x0];if(!_0xf15ff9[_0x3d3e('0x5d')][_0x3d3e('0x66')])return;return db[_0x3d3e('0x76')][_0x3d3e('0x5b')]({'where':{'id':_0xf15ff9[_0x3d3e('0x5d')][_0x3d3e('0x66')],'role':'agent'},'attributes':['id','name',_0x3d3e('0x77'),_0x3d3e('0x78'),_0x3d3e('0x79')],'raw':!![]});}return null;})['then'](function(_0x206f6f){if(!_0x206f6f)return null;_0xba79de['message'][_0x3d3e('0x67')]=_0x206f6f;return _0xba79de;})[_0x3d3e('0x22')](function(_0x3cd4fa){if(_0x3cd4fa){_0x3cd4fa[_0x3d3e('0x29')][_0x3d3e('0x7b')]=util['format'](_0x3d3e('0x7c'),_0xf15ff9[_0x3d3e('0x6d')]['name']);_0x3cd4fa[_0x3d3e('0x29')][_0x3d3e('0x7d')]=_0xba79de[_0x3d3e('0x7d')];_0x3cd4fa['message'][_0x3d3e('0x7e')]=_0xba79de['channel'];_0x3cd4fa[_0x3d3e('0x29')]['event']=_0x3d3e('0x38');respondWithRpcPromise(_0x3d3e('0x81'),'EventManager',{'event':_0x3d3e('0x89'),'message':_0x3cd4fa[_0x3d3e('0x29')]},client9002);return _0xba79de;}return null;})[_0x3d3e('0x22')](respondWithResult(_0x2bdb70,null))[_0x3d3e('0x2d')](handleError(_0x2bdb70,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 7f83a28..a663cff 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 _0xf38d=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0x78598,_0x51fcbe){var _0x556e8d=function(_0x4fd0c6){while(--_0x4fd0c6){_0x78598['push'](_0x78598['shift']());}};_0x556e8d(++_0x51fcbe);}(_0xf38d,0x1b7));var _0xdf38=function(_0x13f11f,_0x2ea721){_0x13f11f=_0x13f11f-0x0;var _0x3fdb10=_0xf38d[_0x13f11f];return _0x3fdb10;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xdf38('0x0'))['db'][_0xdf38('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xdf38('0x2')](0x0);var events={'afterCreate':_0xdf38('0x3'),'afterUpdate':_0xdf38('0x4'),'afterDestroy':'remove'};function emitEvent(_0x177b64){return function(_0x134f94,_0x31c406,_0x3fea15){OpenchannelMessageEvents['emit'](_0x177b64+':'+_0x134f94['id'],_0x134f94);OpenchannelMessageEvents[_0xdf38('0x5')](_0x177b64,_0x134f94);_0x3fea15(null);};}for(var e in events){if(events[_0xdf38('0x6')](e)){var event=events[e];OpenchannelMessage[_0xdf38('0x7')](e,emitEvent(event));}}module[_0xdf38('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0989=['exports','events','OpenchannelMessage','setMaxListeners','emit','hasOwnProperty'];(function(_0x13edb6,_0x36d370){var _0x1f63ec=function(_0x386bfb){while(--_0x386bfb){_0x13edb6['push'](_0x13edb6['shift']());}};_0x1f63ec(++_0x36d370);}(_0x0989,0x16f));var _0x9098=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x0989[_0x511bd1];return _0x4c48ec;};'use strict';var EventEmitter=require(_0x9098('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x9098('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9098('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5523e4){return function(_0x70072,_0x405e0d,_0x180633){OpenchannelMessageEvents['emit'](_0x5523e4+':'+_0x70072['id'],_0x70072);OpenchannelMessageEvents[_0x9098('0x3')](_0x5523e4,_0x70072);_0x180633(null);};}for(var e in events){if(events[_0x9098('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x9098('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 57c0bd6..4630f2d 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x2372d7,_0x4e5c9d){var _0x39a7be=function(_0x35b2f3){while(--_0x35b2f3){_0x2372d7['push'](_0x2372d7['shift']());}};_0x39a7be(++_0x4e5c9d);}(_0x2032,0xd9));var _0x2203=function(_0x54e482,_0x3c1fe2){_0x54e482=_0x54e482-0x0;var _0x4b0d0f=_0x2032[_0x54e482];return _0x4b0d0f;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0xd7d1=['OpenchannelMessage,\x20%s,\x20%s','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','findOne','OpenchannelInteractionId','update','createdAt','catch','error','secret','CmContact','describe','then','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','afterCreate','format','length','omit','method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','Interaction'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x31b34a,_0x25850b){_0x31b34a=_0x31b34a-0x0;var _0xc3dd3c=_0xd7d1[_0x31b34a];return _0xc3dd3c;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[{'name':_0x1d7d('0xf'),'fields':[_0x1d7d('0x10')],'type':_0x1d7d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x155bfb,_0xa44223,_0x1ad06f){var _0x8b258b=_0x14b2b9[_0x1d7d('0x12')];var _0x547f7b=_0x155bfb[_0x1d7d('0x13')]({'plain':!![]});if(_0x547f7b['direction'][_0x1d7d('0x14')]()==='in'||_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()===_0x1d7d('0x16')&&!_0x547f7b['secret']&&!_[_0x1d7d('0x17')](_0x547f7b['UserId'])){_0x8b258b['OpenchannelInteraction'][_0x1d7d('0x18')]({'where':{'id':_0x547f7b[_0x1d7d('0x19')]}})['then'](function(_0x55dba7){if(_0x55dba7){_0x55dba7[_0x1d7d('0x1a')]({'lastMsgAt':_0x547f7b[_0x1d7d('0x1b')],'lastMsgDirection':_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()});}})[_0x1d7d('0x1c')](function(_0x53423f){console[_0x1d7d('0x1d')](_0x53423f);});}if(_0x547f7b[_0x1d7d('0x15')]==='out'&&!_0x547f7b[_0x1d7d('0x1e')]){var _0x162c3a;_0x8b258b[_0x1d7d('0x1f')][_0x1d7d('0x20')]()[_0x1d7d('0x21')](function(_0x4db4f2){return _0x8b258b[_0x1d7d('0x22')][_0x1d7d('0x23')]({'where':{'id':_0x547f7b['OpenchannelAccountId']},'include':[{'model':_0x8b258b['OpenchannelInteraction'],'as':_0x1d7d('0x24'),'where':{'id':_0x547f7b[_0x1d7d('0x19')]},'limit':0x1,'include':[{'model':_0x8b258b[_0x1d7d('0x1f')],'as':_0x1d7d('0x25'),'attributes':_[_0x1d7d('0x26')](_0x4db4f2)}]}]});})[_0x1d7d('0x21')](function(_0x54d401){_0x162c3a=_0x54d401[_0x1d7d('0x13')]({'plain':!![]});if(_0x162c3a&&_0x162c3a[_0x1d7d('0x27')]){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x162c3a[_0x1d7d('0x24')]&&_0x162c3a[_0x1d7d('0x24')][_0x1d7d('0x2b')]){_0x547f7b['Interaction']=_[_0x1d7d('0x2c')](_0x162c3a[_0x1d7d('0x24')][0x0],_0x1d7d('0x25'));_0x547f7b[_0x1d7d('0x25')]=_0x162c3a['Interactions'][0x0][_0x1d7d('0x25')];}var _0xa44223={'method':'POST','uri':encodeURI(_0x162c3a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xa44223[_0x1d7d('0x2d')]){case'GET':_0xa44223['qs']=_0x547f7b;break;case _0x1d7d('0x2e'):_0xa44223[_0x1d7d('0x10')]=_0x547f7b;break;}return rp(_0xa44223)[_0x1d7d('0x21')](function(_0x22c40d){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')](_0x1d7d('0x2f'),_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x22c40d[_0x1d7d('0x10')][_0x1d7d('0x30')]&&_0x22c40d[_0x1d7d('0x10')]['threadId']!=_0x547f7b['Interaction']['threadId']){return _0x8b258b[_0x1d7d('0x31')][_0x1d7d('0x1a')]({'threadId':_0x22c40d['body'][_0x1d7d('0x30')]},{'logging':!![],'where':{'id':_0x547f7b[_0x1d7d('0x32')]['id']}});}else{return;}})[_0x1d7d('0x21')](function(){return _0x155bfb[_0x1d7d('0x1a')]({'read':!![]});})[_0x1d7d('0x1c')](function(_0x22fec9){logger[_0x1d7d('0x1d')](_0x1d7d('0x33'),_0x1d7d('0x29'),util[_0x1d7d('0x34')](_0x22fec9,{'showHidden':![],'depth':null}));_0x1ad06f();});}else{_0x1ad06f();}})['finally'](function(){_0x1ad06f();});}else{_0x1ad06f();}}},'charset':'utf8mb4','collate':_0x1d7d('0x35')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 3229b2a..86f5b7d 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xe6daf,_0x4c6437){var _0x533bd3=function(_0x28bb3f){while(--_0x28bb3f){_0xe6daf['push'](_0xe6daf['shift']());}};_0x533bd3(++_0x4c6437);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f667b,_0x543d95){_0x2f667b=_0x2f667b-0x0;var _0x2724e5=_0x2ef3[_0x2f667b];return _0x2724e5;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2867a7,_0x5ebb5b){var _0x3f7f45=function(_0xfb97ea){while(--_0xfb97ea){_0x2867a7['push'](_0x2867a7['shift']());}};_0x3f7f45(++_0x5ebb5b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a60a777..6ec03d4 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 _0x5687=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x3ab0ec,_0x339990){var _0x226137=function(_0x7ab685){while(--_0x7ab685){_0x3ab0ec['push'](_0x3ab0ec['shift']());}};_0x226137(++_0x339990);}(_0x5687,0x1ce));var _0x7568=function(_0x4d03d8,_0x1000c1){_0x4d03d8=_0x4d03d8-0x0;var _0x1a6505=_0x5687[_0x4d03d8];return _0x1a6505;};'use strict';var OpenchannelMessageEvents=require(_0x7568('0x0'));var events=[_0x7568('0x1'),_0x7568('0x2'),_0x7568('0x3')];function createListener(_0x15ee08,_0x18182a){return function(_0xfb8891){_0x18182a[_0x7568('0x4')](_0x15ee08,_0xfb8891);};}function removeListener(_0x28894f,_0x58cfad){return function(){OpenchannelMessageEvents[_0x7568('0x5')](_0x28894f,_0x58cfad);};}exports[_0x7568('0x6')]=function(_0x327400){for(var _0x248492=0x0,_0x53ac94=events[_0x7568('0x7')];_0x248492<_0x53ac94;_0x248492++){var _0x1ad91f=events[_0x248492];var _0x500856=createListener(_0x7568('0x8')+_0x1ad91f,_0x327400);OpenchannelMessageEvents['on'](_0x1ad91f,_0x500856);}}; \ No newline at end of file +var _0x33de=['removeListener','./openchannelMessage.events','save','remove','update','emit'];(function(_0x1314a9,_0x4849ea){var _0x279c56=function(_0x3863cf){while(--_0x3863cf){_0x1314a9['push'](_0x1314a9['shift']());}};_0x279c56(++_0x4849ea);}(_0x33de,0x14b));var _0xe33d=function(_0x33c147,_0xd24400){_0x33c147=_0x33c147-0x0;var _0x216d7d=_0x33de[_0x33c147];return _0x216d7d;};'use strict';var OpenchannelMessageEvents=require(_0xe33d('0x0'));var events=[_0xe33d('0x1'),_0xe33d('0x2'),_0xe33d('0x3')];function createListener(_0x37b3ed,_0x1a1b8f){return function(_0x265204){_0x1a1b8f[_0xe33d('0x4')](_0x37b3ed,_0x265204);};}function removeListener(_0x84395f,_0x451e5a){return function(){OpenchannelMessageEvents[_0xe33d('0x5')](_0x84395f,_0x451e5a);};}exports['register']=function(_0x2eb9de){for(var _0x47b516=0x0,_0x58c9f2=events['length'];_0x47b516<_0x58c9f2;_0x47b516++){var _0x54e48e=events[_0x47b516];var _0x44ff2e=createListener('openchannelMessage:'+_0x54e48e,_0x2eb9de);OpenchannelMessageEvents['on'](_0x54e48e,_0x44ff2e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9eb8c6b..4fcee86 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 _0x473d=['index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x473d,0x76));var _0xd473=function(_0x5186e1,_0x40f98b){_0x5186e1=_0x5186e1-0x0;var _0x2636af=_0x473d[_0x5186e1];return _0x2636af;};'use strict';var multer=require(_0xd473('0x0'));var util=require(_0xd473('0x1'));var path=require(_0xd473('0x2'));var timeout=require('connect-timeout');var express=require(_0xd473('0x3'));var router=express['Router']();var fs_extra=require(_0xd473('0x4'));var auth=require(_0xd473('0x5'));var interaction=require(_0xd473('0x6'));var config=require(_0xd473('0x7'));var controller=require(_0xd473('0x8'));router['get']('/',auth[_0xd473('0x9')](),controller[_0xd473('0xa')]);router[_0xd473('0xb')](_0xd473('0xc'),auth[_0xd473('0x9')](),controller[_0xd473('0xd')]);router[_0xd473('0xb')](_0xd473('0xe'),auth[_0xd473('0x9')](),controller[_0xd473('0xf')]);router[_0xd473('0xb')](_0xd473('0x10'),auth[_0xd473('0x9')](),controller[_0xd473('0x11')]);router[_0xd473('0xb')](_0xd473('0x12'),auth[_0xd473('0x9')](),controller[_0xd473('0x13')]);router[_0xd473('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xd473('0x14')]);router[_0xd473('0x15')]('/',auth['isAuthenticated'](),controller[_0xd473('0x16')]);router[_0xd473('0x15')]('/:id/teams',auth[_0xd473('0x9')](),controller[_0xd473('0x17')]);router[_0xd473('0x15')](_0xd473('0x18'),auth[_0xd473('0x9')](),controller[_0xd473('0x19')]);router[_0xd473('0x1a')]('/:id',auth[_0xd473('0x9')](),controller[_0xd473('0x1b')]);router[_0xd473('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xd473('0x1d')]);router[_0xd473('0x1c')]('/:id/teams',auth[_0xd473('0x9')](),controller[_0xd473('0x1e')]);router[_0xd473('0x1c')](_0xd473('0x18'),auth[_0xd473('0x9')](),controller['removeAgents']);module[_0xd473('0x1f')]=router; \ No newline at end of file +var _0xb8a3=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents'];(function(_0x3678ec,_0x2c9641){var _0x5d82bd=function(_0x4006ce){while(--_0x4006ce){_0x3678ec['push'](_0x3678ec['shift']());}};_0x5d82bd(++_0x2c9641);}(_0xb8a3,0x12a));var _0x3b8a=function(_0x284a24,_0xebce8f){_0x284a24=_0x284a24-0x0;var _0x2dfdad=_0xb8a3[_0x284a24];return _0x2dfdad;};'use strict';var multer=require('multer');var util=require(_0x3b8a('0x0'));var path=require(_0x3b8a('0x1'));var timeout=require(_0x3b8a('0x2'));var express=require(_0x3b8a('0x3'));var router=express[_0x3b8a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b8a('0x5'));var interaction=require(_0x3b8a('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x3b8a('0x7')]('/',auth[_0x3b8a('0x8')](),controller['index']);router[_0x3b8a('0x7')](_0x3b8a('0x9'),auth['isAuthenticated'](),controller[_0x3b8a('0xa')]);router['get'](_0x3b8a('0xb'),auth[_0x3b8a('0x8')](),controller[_0x3b8a('0xc')]);router[_0x3b8a('0x7')](_0x3b8a('0xd'),auth[_0x3b8a('0x8')](),controller[_0x3b8a('0xe')]);router[_0x3b8a('0x7')]('/:id/teams',auth[_0x3b8a('0x8')](),controller[_0x3b8a('0xf')]);router[_0x3b8a('0x7')](_0x3b8a('0x10'),auth[_0x3b8a('0x8')](),controller['getAgents']);router[_0x3b8a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b8a('0x11')](_0x3b8a('0x12'),auth[_0x3b8a('0x8')](),controller[_0x3b8a('0x13')]);router[_0x3b8a('0x11')](_0x3b8a('0x10'),auth['isAuthenticated'](),controller[_0x3b8a('0x14')]);router[_0x3b8a('0x15')](_0x3b8a('0xb'),auth['isAuthenticated'](),controller[_0x3b8a('0x16')]);router[_0x3b8a('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3b8a('0x17')](_0x3b8a('0x12'),auth[_0x3b8a('0x8')](),controller[_0x3b8a('0x18')]);router[_0x3b8a('0x17')](_0x3b8a('0x10'),auth[_0x3b8a('0x8')](),controller[_0x3b8a('0x19')]);module[_0x3b8a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index b1b62a3..28c7384 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 _0x4af7=['ENUM','beepall','sequelize','STRING'];(function(_0x42593c,_0x25b52a){var _0x4d026d=function(_0x10826c){while(--_0x10826c){_0x42593c['push'](_0x42593c['shift']());}};_0x4d026d(++_0x25b52a);}(_0x4af7,0x1da));var _0x74af=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x4af7[_0x1597e2];return _0x4c8c0a;};'use strict';var Sequelize=require(_0x74af('0x0'));module['exports']={'name':{'type':Sequelize[_0x74af('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x74af('0x2')]('rrmemory',_0x74af('0x3'),'roundrobin')}}; \ No newline at end of file +var _0xa0cf=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xa0cf,0x169));var _0xfa0c=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xa0cf[_0x533e4e];return _0x1f14bb;};'use strict';var Sequelize=require(_0xfa0c('0x0'));module[_0xfa0c('0x1')]={'name':{'type':Sequelize[_0xfa0c('0x2')],'unique':_0xfa0c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa0c('0x2')]},'timeout':{'type':Sequelize[_0xfa0c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa0c('0x5')](_0xfa0c('0x6'),'beepall',_0xfa0c('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 05ed0bb..de0fa88 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 _0x18b6=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','describe','getMembers','nolimit','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','%s/%s','Team','getTeams','ids','findAll','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','Agents','clone'];(function(_0x2a38f0,_0x44fd07){var _0x2d1b98=function(_0x4abbb6){while(--_0x4abbb6){_0x2a38f0['push'](_0x2a38f0['shift']());}};_0x2d1b98(++_0x44fd07);}(_0x18b6,0x99));var _0x618b=function(_0x5df414,_0x34eb15){_0x5df414=_0x5df414-0x0;var _0x403b60=_0x18b6[_0x5df414];return _0x403b60;};'use strict';var emlformat=require(_0x618b('0x0'));var rimraf=require(_0x618b('0x1'));var zipdir=require(_0x618b('0x2'));var jsonpatch=require(_0x618b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x618b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x618b('0x5'));var sox=require(_0x618b('0x6'));var csv=require(_0x618b('0x7'));var ejs=require(_0x618b('0x8'));var fs=require('fs');var fs_extra=require(_0x618b('0x9'));var _=require('lodash');var squel=require(_0x618b('0xa'));var crypto=require('crypto');var jsforce=require(_0x618b('0xb'));var deskjs=require(_0x618b('0xc'));var toCsv=require(_0x618b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x618b('0xd'));var qs=require(_0x618b('0xe'));var as=require(_0x618b('0xf'));var hardwareService=require(_0x618b('0x10'));var logger=require(_0x618b('0x11'))('api');var utils=require(_0x618b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x618b('0x13'));var db=require(_0x618b('0x14'))['db'];config[_0x618b('0x15')]=_[_0x618b('0x16')](config[_0x618b('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x618b('0x17'))(new Redis(config[_0x618b('0x15')]));require(_0x618b('0x18'))[_0x618b('0x19')](socket);function respondWithStatusCode(_0x2fadd9,_0x2a5fe1){_0x2a5fe1=_0x2a5fe1||0xcc;return function(_0x3832ab){if(_0x3832ab){return _0x2fadd9[_0x618b('0x1a')](_0x2a5fe1);}return _0x2fadd9['status'](_0x2a5fe1)['end']();};}function respondWithResult(_0x56bad3,_0x4c5a46){_0x4c5a46=_0x4c5a46||0xc8;return function(_0x145436){if(_0x145436){return _0x56bad3[_0x618b('0x1b')](_0x4c5a46)[_0x618b('0x1c')](_0x145436);}};}function respondWithFilteredResult(_0x4b2147,_0x1fe830){return function(_0xbdf3c){if(_0xbdf3c){var _0x1ae0c5=typeof _0x1fe830[_0x618b('0x1d')]===_0x618b('0x1e')&&typeof _0x1fe830['limit']===_0x618b('0x1e');var _0x1d528a=_0xbdf3c[_0x618b('0x1f')];var _0x3fa387=_0x1ae0c5?0x0:_0x1fe830[_0x618b('0x1d')];var _0x1eb0e1=_0x1ae0c5?_0xbdf3c['count']:_0x1fe830['offset']+_0x1fe830[_0x618b('0x20')];var _0x461d14;if(_0x1eb0e1>=_0x1d528a){_0x1eb0e1=_0x1d528a;_0x461d14=0xc8;}else{_0x461d14=0xce;}_0x4b2147['status'](_0x461d14);return _0x4b2147['set'](_0x618b('0x21'),_0x3fa387+'-'+_0x1eb0e1+'/'+_0x1d528a)['json'](_0xbdf3c);}return null;};}function patchUpdates(_0x4b5e){return function(_0x55f0c6){try{jsonpatch[_0x618b('0x22')](_0x55f0c6,_0x4b5e,!![]);}catch(_0xa71167){return BPromise['reject'](_0xa71167);}return _0x55f0c6[_0x618b('0x23')]();};}function saveUpdates(_0x1c28f7,_0x5b75be){return function(_0x44acd8){if(_0x44acd8){return _0x44acd8['update'](_0x1c28f7)[_0x618b('0x24')](function(_0xe3474e){return _0xe3474e;});}return null;};}function removeEntity(_0x1478fb,_0x57c6bd){return function(_0x2b9f37){if(_0x2b9f37){return _0x2b9f37['destroy']()['then'](function(){var _0x10e39e=_0x2b9f37['get']({'plain':!![]});var _0x59ec58='OpenchannelQueues';return db[_0x618b('0x25')][_0x618b('0x26')]({'where':{'type':_0x59ec58,'resourceId':_0x10e39e['id']}})[_0x618b('0x24')](function(){return _0x2b9f37;});})[_0x618b('0x24')](function(){_0x1478fb[_0x618b('0x1b')](0xcc)[_0x618b('0x27')]();});}};}function handleEntityNotFound(_0x54370e,_0x2144a1){return function(_0x2ca82d){if(!_0x2ca82d){_0x54370e[_0x618b('0x1a')](0x194);}return _0x2ca82d;};}function handleError(_0x1b9d09,_0x304725){_0x304725=_0x304725||0x1f4;return function(_0x16add1){logger[_0x618b('0x28')](_0x16add1[_0x618b('0x29')]);if(_0x16add1[_0x618b('0x2a')]){delete _0x16add1[_0x618b('0x2a')];}_0x1b9d09[_0x618b('0x1b')](_0x304725)[_0x618b('0x2b')](_0x16add1);};}exports[_0x618b('0x2c')]=function(_0x45f2bf,_0x216ef2){var _0x531f58={},_0x4f56ce={},_0x14708c={'count':0x0,'rows':[]};var _0x14d67a=_[_0x618b('0x2d')](db[_0x618b('0x2e')][_0x618b('0x2f')],function(_0x569a86){return{'name':_0x569a86[_0x618b('0x30')],'type':_0x569a86[_0x618b('0x31')][_0x618b('0x32')]};});_0x4f56ce[_0x618b('0x33')]=_[_0x618b('0x2d')](_0x14d67a,'name');_0x4f56ce['query']=_[_0x618b('0x34')](_0x45f2bf['query']);_0x4f56ce['filters']=_[_0x618b('0x35')](_0x4f56ce[_0x618b('0x33')],_0x4f56ce[_0x618b('0x36')]);_0x531f58[_0x618b('0x37')]=_[_0x618b('0x35')](_0x4f56ce['model'],qs[_0x618b('0x38')](_0x45f2bf['query'][_0x618b('0x38')]));_0x531f58[_0x618b('0x37')]=_0x531f58[_0x618b('0x37')][_0x618b('0x39')]?_0x531f58[_0x618b('0x37')]:_0x4f56ce[_0x618b('0x33')];if(!_0x45f2bf['query'][_0x618b('0x3a')]('nolimit')){_0x531f58['limit']=qs[_0x618b('0x20')](_0x45f2bf[_0x618b('0x36')][_0x618b('0x20')]);_0x531f58['offset']=qs[_0x618b('0x1d')](_0x45f2bf[_0x618b('0x36')][_0x618b('0x1d')]);}_0x531f58[_0x618b('0x3b')]=qs[_0x618b('0x3c')](_0x45f2bf[_0x618b('0x36')][_0x618b('0x3c')]);_0x531f58[_0x618b('0x3d')]=qs[_0x618b('0x3e')](_[_0x618b('0x3f')](_0x45f2bf['query'],_0x4f56ce['filters']),_0x14d67a);if(_0x45f2bf[_0x618b('0x36')]['filter']){_0x531f58[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x531f58[_0x618b('0x3d')],{'$or':_[_0x618b('0x2d')](_0x14d67a,function(_0x3fce1b){if(_0x3fce1b[_0x618b('0x31')]!==_0x618b('0x41')){var _0x37d2b8={};_0x37d2b8[_0x3fce1b['name']]={'$like':'%'+_0x45f2bf[_0x618b('0x36')][_0x618b('0x42')]+'%'};return _0x37d2b8;}})});}_0x531f58=_['merge']({},_0x531f58,_0x45f2bf[_0x618b('0x43')]);var _0x1bcdb1={'where':_0x531f58['where']};return db[_0x618b('0x2e')][_0x618b('0x1f')](_0x1bcdb1)['then'](function(_0x30ac80){_0x14708c['count']=_0x30ac80;if(_0x45f2bf['query']['includeAll']){_0x531f58[_0x618b('0x44')]=[{'all':!![]}];}return db[_0x618b('0x2e')]['findAll'](_0x531f58);})[_0x618b('0x24')](function(_0x1078ad){_0x14708c['rows']=_0x1078ad;return _0x14708c;})[_0x618b('0x24')](respondWithFilteredResult(_0x216ef2,_0x531f58))[_0x618b('0x45')](handleError(_0x216ef2,null));};exports[_0x618b('0x46')]=function(_0x22a75c,_0x5b7772){var _0x392be1={'raw':!![],'where':{'id':_0x22a75c[_0x618b('0x47')]['id']}},_0x20d88a={};_0x20d88a['model']=_['keys'](db[_0x618b('0x2e')][_0x618b('0x2f')]);_0x20d88a['query']=_['keys'](_0x22a75c['query']);_0x20d88a[_0x618b('0x3e')]=_[_0x618b('0x35')](_0x20d88a['model'],_0x20d88a[_0x618b('0x36')]);_0x392be1['attributes']=_['intersection'](_0x20d88a[_0x618b('0x33')],qs['fields'](_0x22a75c['query'][_0x618b('0x38')]));_0x392be1[_0x618b('0x37')]=_0x392be1[_0x618b('0x37')]['length']?_0x392be1[_0x618b('0x37')]:_0x20d88a[_0x618b('0x33')];if(_0x22a75c[_0x618b('0x36')]['includeAll']){_0x392be1['include']=[{'all':!![]}];}_0x392be1=_[_0x618b('0x40')]({},_0x392be1,_0x22a75c[_0x618b('0x43')]);return db[_0x618b('0x2e')][_0x618b('0x48')](_0x392be1)['then'](handleEntityNotFound(_0x5b7772,null))[_0x618b('0x24')](respondWithResult(_0x5b7772,null))[_0x618b('0x45')](handleError(_0x5b7772,null));};exports[_0x618b('0x49')]=function(_0x24bbb3,_0x43b02e){return db[_0x618b('0x2e')]['create'](_0x24bbb3[_0x618b('0x4a')],{})[_0x618b('0x24')](function(_0x48d09a){var _0xe411ea=_0x24bbb3[_0x618b('0x4b')][_0x618b('0x4c')]({'plain':!![]});if(!_0xe411ea)throw new Error(_0x618b('0x4d'));if(_0xe411ea['role']===_0x618b('0x4b')){var _0xe736b5=_0x48d09a[_0x618b('0x4c')]({'plain':!![]});var _0x4a5bdd='OpenchannelQueues';return db[_0x618b('0x4e')][_0x618b('0x48')]({'where':{'name':_0x4a5bdd,'userProfileId':_0xe411ea[_0x618b('0x4f')]},'raw':!![]})[_0x618b('0x24')](function(_0x4085d0){if(_0x4085d0&&_0x4085d0[_0x618b('0x50')]===0x0){return db[_0x618b('0x25')][_0x618b('0x49')]({'name':_0xe736b5['name'],'resourceId':_0xe736b5['id'],'type':_0x4085d0[_0x618b('0x2a')],'sectionId':_0x4085d0['id']},{})[_0x618b('0x24')](function(){return _0x48d09a;});}else{return _0x48d09a;}})[_0x618b('0x45')](function(_0x44f519){logger[_0x618b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44f519);throw _0x44f519;});}return _0x48d09a;})[_0x618b('0x24')](respondWithResult(_0x43b02e,0xc9))[_0x618b('0x45')](handleError(_0x43b02e,null));};exports[_0x618b('0x51')]=function(_0x5df173,_0x1db56a){if(_0x5df173[_0x618b('0x4a')]['id']){delete _0x5df173[_0x618b('0x4a')]['id'];}return db['OpenchannelQueue'][_0x618b('0x48')]({'where':{'id':_0x5df173[_0x618b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1db56a,null))[_0x618b('0x24')](saveUpdates(_0x5df173[_0x618b('0x4a')],null))[_0x618b('0x24')](respondWithResult(_0x1db56a,null))[_0x618b('0x45')](handleError(_0x1db56a,null));};exports[_0x618b('0x26')]=function(_0x49b58a,_0x1e94e1){return db['OpenchannelQueue']['find']({'where':{'id':_0x49b58a['params']['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x1e94e1,null))[_0x618b('0x24')](removeEntity(_0x1e94e1,null))[_0x618b('0x45')](handleError(_0x1e94e1,null));};exports[_0x618b('0x52')]=function(_0x199e8d,_0x323360){return db[_0x618b('0x2e')][_0x618b('0x52')]()[_0x618b('0x24')](respondWithResult(_0x323360,null))[_0x618b('0x45')](handleError(_0x323360,null));};exports[_0x618b('0x53')]=function(_0x1d144a,_0x210aa9,_0x52129d){var _0x200c85={'raw':!![],'where':{}},_0xd67f6e={},_0x47fe1f;return db[_0x618b('0x2e')]['findOne']({'where':{'id':_0x1d144a['params']['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x210aa9,null))['then'](function(_0x5622ee){if(_0x5622ee){_0x47fe1f=_0x5622ee[_0x618b('0x4c')]({'plain':!![]});_0xd67f6e[_0x618b('0x33')]=_['keys'](db['UserOpenchannelQueue'][_0x618b('0x2f')]);_0xd67f6e['query']=_[_0x618b('0x34')](_0x1d144a['query']);_0xd67f6e[_0x618b('0x3e')]=_[_0x618b('0x35')](_0xd67f6e[_0x618b('0x33')],_0xd67f6e[_0x618b('0x36')]);_0x200c85[_0x618b('0x37')]=_['intersection'](_0xd67f6e[_0x618b('0x33')],qs['fields'](_0x1d144a[_0x618b('0x36')][_0x618b('0x38')]));_0x200c85[_0x618b('0x37')]=_0x200c85[_0x618b('0x37')][_0x618b('0x39')]?_0x200c85[_0x618b('0x37')]:_0xd67f6e['model'];if(!_0x1d144a[_0x618b('0x36')][_0x618b('0x3a')](_0x618b('0x54'))){_0x200c85[_0x618b('0x20')]=qs[_0x618b('0x20')](_0x1d144a[_0x618b('0x36')][_0x618b('0x20')]);_0x200c85[_0x618b('0x1d')]=qs[_0x618b('0x1d')](_0x1d144a[_0x618b('0x36')][_0x618b('0x1d')]);}_0x200c85[_0x618b('0x3b')]=qs[_0x618b('0x3c')](_0x1d144a[_0x618b('0x36')]['sort']);_0x200c85[_0x618b('0x3d')]=qs[_0x618b('0x3e')](_['pick'](_0x1d144a[_0x618b('0x36')],_0xd67f6e['filters']));_0x200c85[_0x618b('0x3d')]['OpenchannelQueueId']=_0x5622ee['id'];if(_0x1d144a[_0x618b('0x36')][_0x618b('0x42')]){_0x200c85[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x200c85[_0x618b('0x3d')],{'$or':_[_0x618b('0x2d')](_0x200c85[_0x618b('0x37')],function(_0x455018){var _0x57943e={};_0x57943e[_0x455018]={'$like':'%'+_0x1d144a[_0x618b('0x36')][_0x618b('0x42')]+'%'};return _0x57943e;})});}_0x200c85=_[_0x618b('0x40')]({},_0x200c85,_0x1d144a['options']);return db['UserOpenchannelQueue']['findAll'](_0x200c85);}})[_0x618b('0x24')](function(_0x55d150){if(_0x55d150){return db[_0x618b('0x55')][_0x618b('0x56')]({'where':{'id':_[_0x618b('0x2d')](_0x55d150,_0x618b('0x57')),'role':_0x618b('0x58')},'attributes':['id','name',_0x618b('0x59'),_0x618b('0x5a'),_0x618b('0x5b')]});}})[_0x618b('0x24')](function(_0x4c6ee4){if(_0x4c6ee4){return{'count':_0x4c6ee4[_0x618b('0x1f')],'rows':_[_0x618b('0x2d')](_0x4c6ee4[_0x618b('0x5c')],function(_0x136667){return{'membername':_0x136667[_0x618b('0x2a')],'UserId':_0x136667['id'],'queue_name':_0x47fe1f[_0x618b('0x2a')],'OpenchannelQueueId':_0x47fe1f['id'],'interface':util['format'](_0x618b('0x5d'),'SIP',_0x136667['name']),'penalty':0x0,'paused':_0x136667[_0x618b('0x59')],'createdAt':_0x136667['createdAt'],'updatedAt':_0x136667[_0x618b('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x618b('0x24')](respondWithFilteredResult(_0x210aa9,_0x200c85))[_0x618b('0x45')](handleError(_0x210aa9,null));};exports['getTeams']=function(_0x3e7937,_0x32b87a,_0x178f54){var _0x51f8e0={};var _0x4e7c66={};var _0x5d723d;var _0x84992d;return db[_0x618b('0x2e')]['findOne']({'where':{'id':_0x3e7937[_0x618b('0x47')]['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x32b87a,null))[_0x618b('0x24')](function(_0x5a5805){if(_0x5a5805){_0x5d723d=_0x5a5805;_0x4e7c66[_0x618b('0x33')]=_[_0x618b('0x34')](db[_0x618b('0x5e')][_0x618b('0x2f')]);_0x4e7c66[_0x618b('0x36')]=_['keys'](_0x3e7937['query']);_0x4e7c66[_0x618b('0x3e')]=_[_0x618b('0x35')](_0x4e7c66['model'],_0x4e7c66[_0x618b('0x36')]);_0x51f8e0['attributes']=_['intersection'](_0x4e7c66[_0x618b('0x33')],qs['fields'](_0x3e7937[_0x618b('0x36')]['fields']));_0x51f8e0[_0x618b('0x37')]=_0x51f8e0[_0x618b('0x37')][_0x618b('0x39')]?_0x51f8e0['attributes']:_0x4e7c66[_0x618b('0x33')];_0x51f8e0[_0x618b('0x3b')]=qs[_0x618b('0x3c')](_0x3e7937[_0x618b('0x36')][_0x618b('0x3c')]);_0x51f8e0['where']=qs[_0x618b('0x3e')](_[_0x618b('0x3f')](_0x3e7937[_0x618b('0x36')],_0x4e7c66[_0x618b('0x3e')]));if(_0x3e7937['query'][_0x618b('0x42')]){_0x51f8e0[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x51f8e0[_0x618b('0x3d')],{'$or':_[_0x618b('0x2d')](_0x51f8e0[_0x618b('0x37')],function(_0x543767){var _0x5e4408={};_0x5e4408[_0x543767]={'$like':'%'+_0x3e7937[_0x618b('0x36')][_0x618b('0x42')]+'%'};return _0x5e4408;})});}_0x51f8e0=_['merge']({},_0x51f8e0,_0x3e7937['options']);return _0x5d723d[_0x618b('0x5f')](_0x51f8e0);}})[_0x618b('0x24')](function(_0x1d5485){if(_0x1d5485){_0x84992d=_0x1d5485[_0x618b('0x39')];if(!_0x3e7937[_0x618b('0x36')][_0x618b('0x3a')](_0x618b('0x54'))){_0x51f8e0[_0x618b('0x20')]=qs[_0x618b('0x20')](_0x3e7937[_0x618b('0x36')]['limit']);_0x51f8e0[_0x618b('0x1d')]=qs['offset'](_0x3e7937[_0x618b('0x36')][_0x618b('0x1d')]);}return _0x5d723d[_0x618b('0x5f')](_0x51f8e0);}})[_0x618b('0x24')](function(_0x54beb5){if(_0x54beb5){return _0x54beb5?{'count':_0x84992d,'rows':_0x54beb5}:null;}})[_0x618b('0x24')](respondWithResult(_0x32b87a,null))[_0x618b('0x45')](handleError(_0x32b87a,null));};exports['addTeams']=function(_0x18c080,_0x33d2b4,_0x23613e){var _0x299b04=_0x18c080[_0x618b('0x4a')][_0x618b('0x60')];return db[_0x618b('0x5e')][_0x618b('0x61')]({'where':{'id':_0x299b04},'attributes':['id'],'include':[{'model':db[_0x618b('0x55')],'as':'Agents','attributes':['id','name',_0x618b('0x62'),_0x618b('0x63'),_0x618b('0x64')],'raw':!![]}]})['then'](function(_0x305a9d){if(_0x305a9d){var _0x1f4c3f=_[_0x618b('0x65')](_0x305a9d,function(_0x5bd4c6){var _0x5f1dc7=_0x5bd4c6[_0x618b('0x4c')]({'plain':!![]});return _0x5f1dc7['Agents'];});return db[_0x618b('0x2e')]['find']({'where':{'id':_0x18c080[_0x618b('0x47')]['id']}})[_0x618b('0x24')](function(_0x2fcdc7){return db[_0x618b('0x66')][_0x618b('0x67')](function(_0x472e49){return _0x2fcdc7['addTeams'](_0x299b04,{'transaction':_0x472e49})[_0x618b('0x24')](function(){return BPromise[_0x618b('0x68')](_0x1f4c3f,function(_0x4c1b30){return db['UserOpenchannelQueue'][_0x618b('0x69')]({'where':{'UserId':_0x4c1b30['id'],'OpenchannelQueueId':_0x18c080[_0x618b('0x47')]['id']},'transaction':_0x472e49});});})[_0x618b('0x24')](function(){_0x1f4c3f[_0x618b('0x6a')](function(_0x2cab97){socket[_0x618b('0x6b')]('userOpenchannelQueue:save',{'UserId':_0x2cab97['id'],'OpenchannelQueueId':_0x2fcdc7['id']});});});});});}})['then'](respondWithStatusCode(_0x33d2b4,null))['catch'](handleError(_0x33d2b4,null));};exports[_0x618b('0x6c')]=function(_0x3618d4,_0x4e6a5b,_0x4a38bd){return db[_0x618b('0x5e')]['findAll']({'where':{'id':_0x3618d4[_0x618b('0x36')][_0x618b('0x60')]},'attributes':['id'],'include':[{'model':db[_0x618b('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x618b('0x24')](handleEntityNotFound(_0x4e6a5b,null))['then'](function(_0x42c0f0){var _0x3fe538=_[_0x618b('0x2d')](_0x42c0f0,'id');var _0xa1389a=[];var _0x291f90=[];var _0xc94ae6=squel[_0x618b('0x6d')]();_0xc94ae6[_0x618b('0x6e')](_0x618b('0x6f'))[_0x618b('0x70')](_0x618b('0x71'),'tq')[_0x618b('0x72')]('user_has_teams','ut',_0x618b('0x73'))[_0x618b('0x3d')](_0x618b('0x74'),_0x3618d4['params']['id']);for(var _0x53e98d=0x0;_0x53e98d<_0x42c0f0[_0x618b('0x39')];_0x53e98d+=0x1){let _0x579886=_0x42c0f0[_0x53e98d];for(var _0x3e9b9d=0x0;_0x3e9b9d<_0x579886[_0x618b('0x75')][_0x618b('0x39')];_0x3e9b9d+=0x1){let _0x2797fb=_0x579886[_0x618b('0x75')][_0x3e9b9d];var _0x36cab4=_0xc94ae6[_0x618b('0x76')]();_0x36cab4[_0x618b('0x3d')](_0x618b('0x77'),_0x2797fb['id']);_0x291f90[_0x618b('0x78')](db[_0x618b('0x66')]['query'](_0x36cab4[_0x618b('0x79')](),{'type':db[_0x618b('0x66')][_0x618b('0x7a')][_0x618b('0x7b')]})['then'](function(_0x55901c){if(_0x55901c[_0x618b('0x39')]===0x1){return _0x2797fb['id'];}else{var _0xa8ccf6=_[_0x618b('0x7c')](_[_0x618b('0x2d')](_0x55901c,'TeamId'),function(_0x4ae3fc){return _[_0x618b('0x7d')](_0x3fe538,_0x4ae3fc);});if(_0xa8ccf6){return _0x2797fb['id'];}}}));}}return BPromise[_0x618b('0x7e')](_0x291f90)[_0x618b('0x24')](function(_0x5a544b){_0xa1389a=_(_0xa1389a)[_0x618b('0x7f')](_0x5a544b)[_0x618b('0x80')]()[_0x618b('0x81')]();return db[_0x618b('0x2e')][_0x618b('0x48')]({'where':{'id':_0x3618d4[_0x618b('0x47')]['id']}})[_0x618b('0x24')](function(_0x537e17){return db['sequelize'][_0x618b('0x67')](function(_0x1126eb){return _0x537e17[_0x618b('0x6c')](_0x3618d4[_0x618b('0x36')][_0x618b('0x60')],{'transaction':_0x1126eb})[_0x618b('0x24')](function(){if(!_['isEmpty'](_0xa1389a)){return _0x537e17[_0x618b('0x82')](_0xa1389a,{'transaction':_0x1126eb});}})[_0x618b('0x24')](function(){_0xa1389a[_0x618b('0x6a')](function(_0x368e58){socket[_0x618b('0x6b')](_0x618b('0x83'),{'UserId':_0x368e58,'OpenchannelQueueId':_0x537e17['id']});});});});});});})[_0x618b('0x24')](respondWithStatusCode(_0x4e6a5b,null))['catch'](handleError(_0x4e6a5b,null));};exports['addAgents']=function(_0x2889ef,_0x2da0f5,_0x26095d){return db[_0x618b('0x2e')][_0x618b('0x48')]({'where':{'id':_0x2889ef[_0x618b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2da0f5,null))[_0x618b('0x24')](function(_0x1449c4){if(_0x1449c4){return _0x1449c4['addAgents'](_0x2889ef[_0x618b('0x4a')]['ids'],_[_0x618b('0x84')](_0x2889ef[_0x618b('0x4a')],[_0x618b('0x60'),'id'])||{})[_0x618b('0x85')](function(_0x22bf93){for(var _0xf479c8=0x0;_0xf479c8<_0x2889ef[_0x618b('0x4a')]['ids'][_0x618b('0x39')];_0xf479c8+=0x1){socket[_0x618b('0x6b')]('userOpenchannelQueue:save',{'UserId':Number(_0x2889ef['body']['ids'][_0xf479c8]),'OpenchannelQueueId':Number(_0x2889ef[_0x618b('0x47')]['id'])});}return _0x22bf93;});}})[_0x618b('0x24')](respondWithResult(_0x2da0f5,null))[_0x618b('0x45')](handleError(_0x2da0f5,null));};exports['removeAgents']=function(_0x31dbd1,_0x5dcbc5,_0x3a43a0){return db[_0x618b('0x2e')][_0x618b('0x48')]({'where':{'id':_0x31dbd1[_0x618b('0x47')]['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x5dcbc5,null))[_0x618b('0x24')](function(_0x3ce823){if(_0x3ce823){return _0x3ce823[_0x618b('0x82')](_0x31dbd1[_0x618b('0x36')][_0x618b('0x60')])[_0x618b('0x24')](function(){if(_[_0x618b('0x86')](_0x31dbd1[_0x618b('0x36')][_0x618b('0x60')])){for(var _0x56cbe3=0x0;_0x56cbe3<_0x31dbd1['query']['ids'][_0x618b('0x39')];_0x56cbe3+=0x1){socket[_0x618b('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x31dbd1['query'][_0x618b('0x60')][_0x56cbe3]),'OpenchannelQueueId':Number(_0x31dbd1[_0x618b('0x47')]['id'])});}}else{socket[_0x618b('0x6b')](_0x618b('0x83'),{'UserId':Number(_0x31dbd1[_0x618b('0x36')][_0x618b('0x60')]),'OpenchannelQueueId':Number(_0x31dbd1[_0x618b('0x47')]['id'])});}});}})[_0x618b('0x24')](respondWithStatusCode(_0x5dcbc5,null))[_0x618b('0x45')](handleError(_0x5dcbc5,null));};exports['getAgents']=function(_0x428daa,_0x44255e,_0x56e69c){var _0x4a81e7={};var _0x1b5fdd={};var _0x4bacad;var _0xb5bd2d;return db[_0x618b('0x2e')]['findOne']({'where':{'id':_0x428daa[_0x618b('0x47')]['id']}})[_0x618b('0x24')](handleEntityNotFound(_0x44255e,null))[_0x618b('0x24')](function(_0x2dd0a7){if(_0x2dd0a7){_0x4bacad=_0x2dd0a7;_0x1b5fdd[_0x618b('0x33')]=_[_0x618b('0x34')](db['User']['rawAttributes']);_0x1b5fdd[_0x618b('0x36')]=_[_0x618b('0x34')](_0x428daa[_0x618b('0x36')]);_0x1b5fdd[_0x618b('0x3e')]=_[_0x618b('0x35')](_0x1b5fdd[_0x618b('0x33')],_0x1b5fdd[_0x618b('0x36')]);_0x4a81e7[_0x618b('0x37')]=_[_0x618b('0x35')](_0x1b5fdd[_0x618b('0x33')],qs[_0x618b('0x38')](_0x428daa[_0x618b('0x36')][_0x618b('0x38')]));_0x4a81e7[_0x618b('0x37')]=_0x4a81e7[_0x618b('0x37')][_0x618b('0x39')]?_0x4a81e7[_0x618b('0x37')]:_0x1b5fdd[_0x618b('0x33')];_0x4a81e7[_0x618b('0x3b')]=qs['sort'](_0x428daa[_0x618b('0x36')][_0x618b('0x3c')]);_0x4a81e7['where']=qs[_0x618b('0x3e')](_[_0x618b('0x3f')](_0x428daa[_0x618b('0x36')],_0x1b5fdd[_0x618b('0x3e')]));if(_0x428daa['query'][_0x618b('0x42')]){_0x4a81e7[_0x618b('0x3d')]=_[_0x618b('0x40')](_0x4a81e7['where'],{'$or':_[_0x618b('0x2d')](_0x4a81e7[_0x618b('0x37')],function(_0x3354ae){var _0x39aca2={};_0x39aca2[_0x3354ae]={'$like':'%'+_0x428daa['query']['filter']+'%'};return _0x39aca2;})});}_0x4a81e7=_['merge']({},_0x4a81e7,_0x428daa[_0x618b('0x43')]);return _0x4bacad['getAgents'](_0x4a81e7);}})['then'](function(_0x30477f){if(_0x30477f){_0xb5bd2d=_0x30477f[_0x618b('0x39')];if(!_0x428daa[_0x618b('0x36')][_0x618b('0x3a')](_0x618b('0x54'))){_0x4a81e7[_0x618b('0x20')]=qs[_0x618b('0x20')](_0x428daa[_0x618b('0x36')][_0x618b('0x20')]);_0x4a81e7[_0x618b('0x1d')]=qs[_0x618b('0x1d')](_0x428daa['query']['offset']);}return _0x4bacad[_0x618b('0x87')](_0x4a81e7);}})[_0x618b('0x24')](function(_0x42962e){if(_0x42962e){return _0x42962e?{'count':_0xb5bd2d,'rows':_0x42962e}:null;}})[_0x618b('0x24')](respondWithResult(_0x44255e,null))['catch'](handleError(_0x44255e,null));}; \ No newline at end of file +var _0x7b93=['findOne','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','User','updatedAt','%s/%s','openchannelPause','createdAt','getTeams','Team','addTeams','online','sequelize','transaction','each','removeTeams','ids','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','Agents','clone','push','toString','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','emit','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','OpenchannelQueues','then','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','model','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers'];(function(_0x1cc66c,_0x11162c){var _0x19b537=function(_0x515c67){while(--_0x515c67){_0x1cc66c['push'](_0x1cc66c['shift']());}};_0x19b537(++_0x11162c);}(_0x7b93,0xbd));var _0x37b9=function(_0x316f,_0x2516ff){_0x316f=_0x316f-0x0;var _0x323ce7=_0x7b93[_0x316f];return _0x323ce7;};'use strict';var emlformat=require(_0x37b9('0x0'));var rimraf=require(_0x37b9('0x1'));var zipdir=require(_0x37b9('0x2'));var jsonpatch=require(_0x37b9('0x3'));var rp=require('request-promise');var moment=require(_0x37b9('0x4'));var BPromise=require(_0x37b9('0x5'));var Mustache=require('mustache');var util=require(_0x37b9('0x6'));var path=require(_0x37b9('0x7'));var sox=require('sox');var csv=require(_0x37b9('0x8'));var ejs=require(_0x37b9('0x9'));var fs=require('fs');var fs_extra=require(_0x37b9('0xa'));var _=require(_0x37b9('0xb'));var squel=require('squel');var crypto=require(_0x37b9('0xc'));var jsforce=require(_0x37b9('0xd'));var deskjs=require(_0x37b9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x37b9('0xf'));var Papa=require(_0x37b9('0x10'));var Redis=require(_0x37b9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x37b9('0x12'));var as=require(_0x37b9('0x13'));var hardwareService=require(_0x37b9('0x14'));var logger=require(_0x37b9('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x37b9('0x16'));var licenseUtil=require(_0x37b9('0x17'));var db=require(_0x37b9('0x18'))['db'];config[_0x37b9('0x19')]=_[_0x37b9('0x1a')](config[_0x37b9('0x19')],{'host':_0x37b9('0x1b'),'port':0x18eb});var socket=require(_0x37b9('0x1c'))(new Redis(config[_0x37b9('0x19')]));require(_0x37b9('0x1d'))[_0x37b9('0x1e')](socket);function respondWithStatusCode(_0x4655ca,_0x1ea769){_0x1ea769=_0x1ea769||0xcc;return function(_0x56656e){if(_0x56656e){return _0x4655ca[_0x37b9('0x1f')](_0x1ea769);}return _0x4655ca[_0x37b9('0x20')](_0x1ea769)['end']();};}function respondWithResult(_0xd526e9,_0x463fff){_0x463fff=_0x463fff||0xc8;return function(_0x1eb95a){if(_0x1eb95a){return _0xd526e9['status'](_0x463fff)['json'](_0x1eb95a);}};}function respondWithFilteredResult(_0x129f16,_0x2a6499){return function(_0x25c811){if(_0x25c811){var _0x43413b=typeof _0x2a6499[_0x37b9('0x21')]===_0x37b9('0x22')&&typeof _0x2a6499['limit']===_0x37b9('0x22');var _0x3f1281=_0x25c811[_0x37b9('0x23')];var _0x1164d7=_0x43413b?0x0:_0x2a6499[_0x37b9('0x21')];var _0x4658e7=_0x43413b?_0x25c811[_0x37b9('0x23')]:_0x2a6499['offset']+_0x2a6499[_0x37b9('0x24')];var _0xcd5fbb;if(_0x4658e7>=_0x3f1281){_0x4658e7=_0x3f1281;_0xcd5fbb=0xc8;}else{_0xcd5fbb=0xce;}_0x129f16[_0x37b9('0x20')](_0xcd5fbb);return _0x129f16[_0x37b9('0x25')](_0x37b9('0x26'),_0x1164d7+'-'+_0x4658e7+'/'+_0x3f1281)['json'](_0x25c811);}return null;};}function patchUpdates(_0x59e918){return function(_0x27b20b){try{jsonpatch[_0x37b9('0x27')](_0x27b20b,_0x59e918,!![]);}catch(_0x3da1e3){return BPromise[_0x37b9('0x28')](_0x3da1e3);}return _0x27b20b[_0x37b9('0x29')]();};}function saveUpdates(_0x12adc9,_0x1a2352){return function(_0x59e009){if(_0x59e009){return _0x59e009['update'](_0x12adc9)['then'](function(_0x421dcf){return _0x421dcf;});}return null;};}function removeEntity(_0x1b6e87,_0xd2e069){return function(_0x1140e2){if(_0x1140e2){return _0x1140e2[_0x37b9('0x2a')]()['then'](function(){var _0x54f02b=_0x1140e2[_0x37b9('0x2b')]({'plain':!![]});var _0xf95e37=_0x37b9('0x2c');return db['UserProfileResource'][_0x37b9('0x2a')]({'where':{'type':_0xf95e37,'resourceId':_0x54f02b['id']}})[_0x37b9('0x2d')](function(){return _0x1140e2;});})['then'](function(){_0x1b6e87[_0x37b9('0x20')](0xcc)[_0x37b9('0x2e')]();});}};}function handleEntityNotFound(_0x4d5428,_0x166613){return function(_0x2973d9){if(!_0x2973d9){_0x4d5428[_0x37b9('0x1f')](0x194);}return _0x2973d9;};}function handleError(_0x55eef8,_0x54b549){_0x54b549=_0x54b549||0x1f4;return function(_0x3ea533){logger[_0x37b9('0x2f')](_0x3ea533[_0x37b9('0x30')]);if(_0x3ea533['name']){delete _0x3ea533[_0x37b9('0x31')];}_0x55eef8[_0x37b9('0x20')](_0x54b549)[_0x37b9('0x32')](_0x3ea533);};}exports[_0x37b9('0x33')]=function(_0x209f68,_0x3ad697){var _0x5e5f1c={},_0x4802c4={},_0x51f626={'count':0x0,'rows':[]};var _0x31367c=_[_0x37b9('0x34')](db[_0x37b9('0x35')][_0x37b9('0x36')],function(_0x1f1c41){return{'name':_0x1f1c41[_0x37b9('0x37')],'type':_0x1f1c41[_0x37b9('0x38')][_0x37b9('0x39')]};});_0x4802c4['model']=_[_0x37b9('0x34')](_0x31367c,_0x37b9('0x31'));_0x4802c4[_0x37b9('0x3a')]=_[_0x37b9('0x3b')](_0x209f68['query']);_0x4802c4['filters']=_['intersection'](_0x4802c4[_0x37b9('0x3c')],_0x4802c4[_0x37b9('0x3a')]);_0x5e5f1c['attributes']=_['intersection'](_0x4802c4[_0x37b9('0x3c')],qs[_0x37b9('0x3d')](_0x209f68[_0x37b9('0x3a')][_0x37b9('0x3d')]));_0x5e5f1c[_0x37b9('0x3e')]=_0x5e5f1c[_0x37b9('0x3e')][_0x37b9('0x3f')]?_0x5e5f1c[_0x37b9('0x3e')]:_0x4802c4[_0x37b9('0x3c')];if(!_0x209f68['query']['hasOwnProperty'](_0x37b9('0x40'))){_0x5e5f1c[_0x37b9('0x24')]=qs[_0x37b9('0x24')](_0x209f68[_0x37b9('0x3a')][_0x37b9('0x24')]);_0x5e5f1c[_0x37b9('0x21')]=qs[_0x37b9('0x21')](_0x209f68[_0x37b9('0x3a')][_0x37b9('0x21')]);}_0x5e5f1c['order']=qs[_0x37b9('0x41')](_0x209f68[_0x37b9('0x3a')][_0x37b9('0x41')]);_0x5e5f1c[_0x37b9('0x42')]=qs['filters'](_[_0x37b9('0x43')](_0x209f68['query'],_0x4802c4[_0x37b9('0x44')]),_0x31367c);if(_0x209f68['query'][_0x37b9('0x45')]){_0x5e5f1c[_0x37b9('0x42')]=_[_0x37b9('0x46')](_0x5e5f1c[_0x37b9('0x42')],{'$or':_[_0x37b9('0x34')](_0x31367c,function(_0x367162){if(_0x367162['type']!==_0x37b9('0x47')){var _0x445079={};_0x445079[_0x367162['name']]={'$like':'%'+_0x209f68['query'][_0x37b9('0x45')]+'%'};return _0x445079;}})});}_0x5e5f1c=_[_0x37b9('0x46')]({},_0x5e5f1c,_0x209f68[_0x37b9('0x48')]);var _0x31a32d={'where':_0x5e5f1c['where']};return db[_0x37b9('0x35')]['count'](_0x31a32d)[_0x37b9('0x2d')](function(_0x1525ad){_0x51f626[_0x37b9('0x23')]=_0x1525ad;if(_0x209f68['query'][_0x37b9('0x49')]){_0x5e5f1c[_0x37b9('0x4a')]=[{'all':!![]}];}return db[_0x37b9('0x35')][_0x37b9('0x4b')](_0x5e5f1c);})['then'](function(_0x43bd9d){_0x51f626[_0x37b9('0x4c')]=_0x43bd9d;return _0x51f626;})[_0x37b9('0x2d')](respondWithFilteredResult(_0x3ad697,_0x5e5f1c))['catch'](handleError(_0x3ad697,null));};exports[_0x37b9('0x4d')]=function(_0x42f1e1,_0x1b4ab0){var _0x38dcc1={'raw':!![],'where':{'id':_0x42f1e1['params']['id']}},_0x10edae={};_0x10edae[_0x37b9('0x3c')]=_[_0x37b9('0x3b')](db['OpenchannelQueue']['rawAttributes']);_0x10edae['query']=_['keys'](_0x42f1e1[_0x37b9('0x3a')]);_0x10edae['filters']=_[_0x37b9('0x4e')](_0x10edae[_0x37b9('0x3c')],_0x10edae['query']);_0x38dcc1[_0x37b9('0x3e')]=_[_0x37b9('0x4e')](_0x10edae[_0x37b9('0x3c')],qs[_0x37b9('0x3d')](_0x42f1e1[_0x37b9('0x3a')][_0x37b9('0x3d')]));_0x38dcc1[_0x37b9('0x3e')]=_0x38dcc1[_0x37b9('0x3e')][_0x37b9('0x3f')]?_0x38dcc1[_0x37b9('0x3e')]:_0x10edae['model'];if(_0x42f1e1[_0x37b9('0x3a')][_0x37b9('0x49')]){_0x38dcc1[_0x37b9('0x4a')]=[{'all':!![]}];}_0x38dcc1=_[_0x37b9('0x46')]({},_0x38dcc1,_0x42f1e1[_0x37b9('0x48')]);return db[_0x37b9('0x35')][_0x37b9('0x4f')](_0x38dcc1)[_0x37b9('0x2d')](handleEntityNotFound(_0x1b4ab0,null))[_0x37b9('0x2d')](respondWithResult(_0x1b4ab0,null))[_0x37b9('0x50')](handleError(_0x1b4ab0,null));};exports[_0x37b9('0x51')]=function(_0x219466,_0x418414){return db['OpenchannelQueue'][_0x37b9('0x51')](_0x219466[_0x37b9('0x52')],{})['then'](function(_0x2e2aca){var _0xc42963=_0x219466[_0x37b9('0x53')]['get']({'plain':!![]});if(!_0xc42963)throw new Error(_0x37b9('0x54'));if(_0xc42963[_0x37b9('0x55')]==='user'){var _0x4e70ca=_0x2e2aca['get']({'plain':!![]});var _0x1256fe=_0x37b9('0x2c');return db[_0x37b9('0x56')]['find']({'where':{'name':_0x1256fe,'userProfileId':_0xc42963[_0x37b9('0x57')]},'raw':!![]})[_0x37b9('0x2d')](function(_0x4298ca){if(_0x4298ca&&_0x4298ca['autoAssociation']===0x0){return db[_0x37b9('0x58')]['create']({'name':_0x4e70ca[_0x37b9('0x31')],'resourceId':_0x4e70ca['id'],'type':_0x4298ca[_0x37b9('0x31')],'sectionId':_0x4298ca['id']},{})[_0x37b9('0x2d')](function(){return _0x2e2aca;});}else{return _0x2e2aca;}})['catch'](function(_0x5df83b){logger[_0x37b9('0x2f')](_0x37b9('0x59'),_0x5df83b);throw _0x5df83b;});}return _0x2e2aca;})[_0x37b9('0x2d')](respondWithResult(_0x418414,0xc9))[_0x37b9('0x50')](handleError(_0x418414,null));};exports['update']=function(_0x4aeb9a,_0x49ccaf){if(_0x4aeb9a[_0x37b9('0x52')]['id']){delete _0x4aeb9a[_0x37b9('0x52')]['id'];}return db['OpenchannelQueue'][_0x37b9('0x4f')]({'where':{'id':_0x4aeb9a[_0x37b9('0x5a')]['id']}})[_0x37b9('0x2d')](handleEntityNotFound(_0x49ccaf,null))[_0x37b9('0x2d')](saveUpdates(_0x4aeb9a[_0x37b9('0x52')],null))[_0x37b9('0x2d')](respondWithResult(_0x49ccaf,null))[_0x37b9('0x50')](handleError(_0x49ccaf,null));};exports[_0x37b9('0x2a')]=function(_0x43d3ed,_0x10f789){return db[_0x37b9('0x35')][_0x37b9('0x4f')]({'where':{'id':_0x43d3ed[_0x37b9('0x5a')]['id']}})[_0x37b9('0x2d')](handleEntityNotFound(_0x10f789,null))[_0x37b9('0x2d')](removeEntity(_0x10f789,null))['catch'](handleError(_0x10f789,null));};exports[_0x37b9('0x5b')]=function(_0x517359,_0x549fdb){return db[_0x37b9('0x35')][_0x37b9('0x5b')]()[_0x37b9('0x2d')](respondWithResult(_0x549fdb,null))['catch'](handleError(_0x549fdb,null));};exports[_0x37b9('0x5c')]=function(_0x93a57b,_0x3027b9,_0x4ccf9c){var _0x2b7d57={'raw':!![],'where':{}},_0x5c08b6={},_0x258ca9;return db[_0x37b9('0x35')][_0x37b9('0x5d')]({'where':{'id':_0x93a57b[_0x37b9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3027b9,null))[_0x37b9('0x2d')](function(_0x1063fb){if(_0x1063fb){_0x258ca9=_0x1063fb[_0x37b9('0x2b')]({'plain':!![]});_0x5c08b6[_0x37b9('0x3c')]=_[_0x37b9('0x3b')](db[_0x37b9('0x5e')]['rawAttributes']);_0x5c08b6[_0x37b9('0x3a')]=_['keys'](_0x93a57b[_0x37b9('0x3a')]);_0x5c08b6[_0x37b9('0x44')]=_['intersection'](_0x5c08b6[_0x37b9('0x3c')],_0x5c08b6[_0x37b9('0x3a')]);_0x2b7d57[_0x37b9('0x3e')]=_['intersection'](_0x5c08b6[_0x37b9('0x3c')],qs[_0x37b9('0x3d')](_0x93a57b[_0x37b9('0x3a')]['fields']));_0x2b7d57[_0x37b9('0x3e')]=_0x2b7d57[_0x37b9('0x3e')][_0x37b9('0x3f')]?_0x2b7d57[_0x37b9('0x3e')]:_0x5c08b6[_0x37b9('0x3c')];if(!_0x93a57b[_0x37b9('0x3a')][_0x37b9('0x5f')](_0x37b9('0x40'))){_0x2b7d57[_0x37b9('0x24')]=qs[_0x37b9('0x24')](_0x93a57b[_0x37b9('0x3a')][_0x37b9('0x24')]);_0x2b7d57[_0x37b9('0x21')]=qs['offset'](_0x93a57b[_0x37b9('0x3a')][_0x37b9('0x21')]);}_0x2b7d57[_0x37b9('0x60')]=qs[_0x37b9('0x41')](_0x93a57b['query']['sort']);_0x2b7d57[_0x37b9('0x42')]=qs[_0x37b9('0x44')](_[_0x37b9('0x43')](_0x93a57b['query'],_0x5c08b6[_0x37b9('0x44')]));_0x2b7d57[_0x37b9('0x42')][_0x37b9('0x61')]=_0x1063fb['id'];if(_0x93a57b[_0x37b9('0x3a')][_0x37b9('0x45')]){_0x2b7d57['where']=_[_0x37b9('0x46')](_0x2b7d57[_0x37b9('0x42')],{'$or':_[_0x37b9('0x34')](_0x2b7d57[_0x37b9('0x3e')],function(_0x2cfe64){var _0x4f33a0={};_0x4f33a0[_0x2cfe64]={'$like':'%'+_0x93a57b[_0x37b9('0x3a')]['filter']+'%'};return _0x4f33a0;})});}_0x2b7d57=_['merge']({},_0x2b7d57,_0x93a57b[_0x37b9('0x48')]);return db[_0x37b9('0x5e')][_0x37b9('0x4b')](_0x2b7d57);}})[_0x37b9('0x2d')](function(_0x49368e){if(_0x49368e){return db[_0x37b9('0x62')]['findAndCountAll']({'where':{'id':_[_0x37b9('0x34')](_0x49368e,'UserId'),'role':'agent'},'attributes':['id',_0x37b9('0x31'),'openchannelPause',_0x37b9('0x63'),'createdAt']});}})[_0x37b9('0x2d')](function(_0x247dec){if(_0x247dec){return{'count':_0x247dec[_0x37b9('0x23')],'rows':_[_0x37b9('0x34')](_0x247dec['rows'],function(_0x2e35ee){return{'membername':_0x2e35ee['name'],'UserId':_0x2e35ee['id'],'queue_name':_0x258ca9[_0x37b9('0x31')],'OpenchannelQueueId':_0x258ca9['id'],'interface':util['format'](_0x37b9('0x64'),'SIP',_0x2e35ee['name']),'penalty':0x0,'paused':_0x2e35ee[_0x37b9('0x65')],'createdAt':_0x2e35ee[_0x37b9('0x66')],'updatedAt':_0x2e35ee[_0x37b9('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x37b9('0x2d')](respondWithFilteredResult(_0x3027b9,_0x2b7d57))[_0x37b9('0x50')](handleError(_0x3027b9,null));};exports[_0x37b9('0x67')]=function(_0x47a893,_0x36eaf3,_0x6a9eaf){var _0x3a9084={};var _0x327f28={};var _0x4129c8;var _0x1ec15a;return db[_0x37b9('0x35')][_0x37b9('0x5d')]({'where':{'id':_0x47a893['params']['id']}})[_0x37b9('0x2d')](handleEntityNotFound(_0x36eaf3,null))[_0x37b9('0x2d')](function(_0x485bbc){if(_0x485bbc){_0x4129c8=_0x485bbc;_0x327f28[_0x37b9('0x3c')]=_[_0x37b9('0x3b')](db[_0x37b9('0x68')]['rawAttributes']);_0x327f28[_0x37b9('0x3a')]=_[_0x37b9('0x3b')](_0x47a893[_0x37b9('0x3a')]);_0x327f28[_0x37b9('0x44')]=_[_0x37b9('0x4e')](_0x327f28[_0x37b9('0x3c')],_0x327f28[_0x37b9('0x3a')]);_0x3a9084[_0x37b9('0x3e')]=_[_0x37b9('0x4e')](_0x327f28[_0x37b9('0x3c')],qs['fields'](_0x47a893[_0x37b9('0x3a')]['fields']));_0x3a9084['attributes']=_0x3a9084[_0x37b9('0x3e')][_0x37b9('0x3f')]?_0x3a9084[_0x37b9('0x3e')]:_0x327f28[_0x37b9('0x3c')];_0x3a9084['order']=qs[_0x37b9('0x41')](_0x47a893[_0x37b9('0x3a')][_0x37b9('0x41')]);_0x3a9084[_0x37b9('0x42')]=qs[_0x37b9('0x44')](_[_0x37b9('0x43')](_0x47a893[_0x37b9('0x3a')],_0x327f28[_0x37b9('0x44')]));if(_0x47a893['query']['filter']){_0x3a9084[_0x37b9('0x42')]=_['merge'](_0x3a9084[_0x37b9('0x42')],{'$or':_[_0x37b9('0x34')](_0x3a9084[_0x37b9('0x3e')],function(_0x5d848b){var _0x4ce6e6={};_0x4ce6e6[_0x5d848b]={'$like':'%'+_0x47a893[_0x37b9('0x3a')][_0x37b9('0x45')]+'%'};return _0x4ce6e6;})});}_0x3a9084=_[_0x37b9('0x46')]({},_0x3a9084,_0x47a893[_0x37b9('0x48')]);return _0x4129c8[_0x37b9('0x67')](_0x3a9084);}})[_0x37b9('0x2d')](function(_0x46bb80){if(_0x46bb80){_0x1ec15a=_0x46bb80[_0x37b9('0x3f')];if(!_0x47a893[_0x37b9('0x3a')][_0x37b9('0x5f')](_0x37b9('0x40'))){_0x3a9084[_0x37b9('0x24')]=qs[_0x37b9('0x24')](_0x47a893[_0x37b9('0x3a')][_0x37b9('0x24')]);_0x3a9084[_0x37b9('0x21')]=qs['offset'](_0x47a893[_0x37b9('0x3a')][_0x37b9('0x21')]);}return _0x4129c8[_0x37b9('0x67')](_0x3a9084);}})[_0x37b9('0x2d')](function(_0x5c78ad){if(_0x5c78ad){return _0x5c78ad?{'count':_0x1ec15a,'rows':_0x5c78ad}:null;}})[_0x37b9('0x2d')](respondWithResult(_0x36eaf3,null))[_0x37b9('0x50')](handleError(_0x36eaf3,null));};exports[_0x37b9('0x69')]=function(_0x2550e1,_0xf5f018,_0x517b31){var _0x4c9294=_0x2550e1['body']['ids'];return db[_0x37b9('0x68')][_0x37b9('0x4b')]({'where':{'id':_0x4c9294},'attributes':['id'],'include':[{'model':db[_0x37b9('0x62')],'as':'Agents','attributes':['id',_0x37b9('0x31'),_0x37b9('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x37b9('0x2d')](function(_0x212dca){if(_0x212dca){var _0x4e0b9b=_['flatMap'](_0x212dca,function(_0x4ab26c){var _0x5a38c6=_0x4ab26c['get']({'plain':!![]});return _0x5a38c6['Agents'];});return db['OpenchannelQueue']['find']({'where':{'id':_0x2550e1[_0x37b9('0x5a')]['id']}})[_0x37b9('0x2d')](function(_0x225bd4){return db[_0x37b9('0x6b')][_0x37b9('0x6c')](function(_0x363023){return _0x225bd4[_0x37b9('0x69')](_0x4c9294,{'transaction':_0x363023})[_0x37b9('0x2d')](function(){return BPromise[_0x37b9('0x6d')](_0x4e0b9b,function(_0x37e328){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x37e328['id'],'OpenchannelQueueId':_0x2550e1[_0x37b9('0x5a')]['id']},'transaction':_0x363023});});})['then'](function(){_0x4e0b9b['forEach'](function(_0x36d404){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x36d404['id'],'OpenchannelQueueId':_0x225bd4['id']});});});});});}})[_0x37b9('0x2d')](respondWithStatusCode(_0xf5f018,null))['catch'](handleError(_0xf5f018,null));};exports[_0x37b9('0x6e')]=function(_0x39059a,_0x30c3de,_0x417549){return db['Team']['findAll']({'where':{'id':_0x39059a[_0x37b9('0x3a')][_0x37b9('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x37b9('0x2d')](handleEntityNotFound(_0x30c3de,null))['then'](function(_0x4a7cc6){var _0x31a8b0=_['map'](_0x4a7cc6,'id');var _0x27f5db=[];var _0x2628a4=[];var _0x25e28b=squel[_0x37b9('0x70')]();_0x25e28b[_0x37b9('0x71')](_0x37b9('0x72'))['from'](_0x37b9('0x73'),'tq')[_0x37b9('0x74')](_0x37b9('0x75'),'ut',_0x37b9('0x76'))['where'](_0x37b9('0x77'),_0x39059a[_0x37b9('0x5a')]['id']);for(var _0x1e5b93=0x0;_0x1e5b93<_0x4a7cc6['length'];_0x1e5b93+=0x1){let _0x4aff75=_0x4a7cc6[_0x1e5b93];for(var _0x2383ad=0x0;_0x2383ad<_0x4aff75[_0x37b9('0x78')][_0x37b9('0x3f')];_0x2383ad+=0x1){let _0x40cb91=_0x4aff75[_0x37b9('0x78')][_0x2383ad];var _0x1cdb18=_0x25e28b[_0x37b9('0x79')]();_0x1cdb18[_0x37b9('0x42')]('ut.UserId\x20=\x20?',_0x40cb91['id']);_0x2628a4[_0x37b9('0x7a')](db['sequelize'][_0x37b9('0x3a')](_0x1cdb18[_0x37b9('0x7b')](),{'type':db[_0x37b9('0x6b')]['QueryTypes'][_0x37b9('0x7c')]})['then'](function(_0x562d1d){if(_0x562d1d[_0x37b9('0x3f')]===0x1){return _0x40cb91['id'];}else{var _0x4ff306=_['every'](_[_0x37b9('0x34')](_0x562d1d,_0x37b9('0x7d')),function(_0x3284fe){return _[_0x37b9('0x7e')](_0x31a8b0,_0x3284fe);});if(_0x4ff306){return _0x40cb91['id'];}}}));}}return BPromise[_0x37b9('0x7f')](_0x2628a4)[_0x37b9('0x2d')](function(_0x1450d3){_0x27f5db=_(_0x27f5db)[_0x37b9('0x80')](_0x1450d3)[_0x37b9('0x81')]()[_0x37b9('0x82')]();return db[_0x37b9('0x35')][_0x37b9('0x4f')]({'where':{'id':_0x39059a['params']['id']}})['then'](function(_0x4c729f){return db[_0x37b9('0x6b')][_0x37b9('0x6c')](function(_0x3ffe67){return _0x4c729f[_0x37b9('0x6e')](_0x39059a[_0x37b9('0x3a')]['ids'],{'transaction':_0x3ffe67})[_0x37b9('0x2d')](function(){if(!_[_0x37b9('0x83')](_0x27f5db)){return _0x4c729f[_0x37b9('0x84')](_0x27f5db,{'transaction':_0x3ffe67});}})[_0x37b9('0x2d')](function(){_0x27f5db['forEach'](function(_0x27b112){socket['emit'](_0x37b9('0x85'),{'UserId':_0x27b112,'OpenchannelQueueId':_0x4c729f['id']});});});});});});})['then'](respondWithStatusCode(_0x30c3de,null))['catch'](handleError(_0x30c3de,null));};exports[_0x37b9('0x86')]=function(_0x13e5c2,_0x5b1ba1,_0x2c20d3){return db[_0x37b9('0x35')][_0x37b9('0x4f')]({'where':{'id':_0x13e5c2[_0x37b9('0x5a')]['id']}})[_0x37b9('0x2d')](handleEntityNotFound(_0x5b1ba1,null))[_0x37b9('0x2d')](function(_0x20c2bf){if(_0x20c2bf){return _0x20c2bf[_0x37b9('0x86')](_0x13e5c2['body']['ids'],_[_0x37b9('0x87')](_0x13e5c2['body'],['ids','id'])||{})[_0x37b9('0x88')](function(_0x2ac1c7){for(var _0x3d1674=0x0;_0x3d1674<_0x13e5c2[_0x37b9('0x52')]['ids'][_0x37b9('0x3f')];_0x3d1674+=0x1){socket[_0x37b9('0x89')](_0x37b9('0x8a'),{'UserId':Number(_0x13e5c2[_0x37b9('0x52')][_0x37b9('0x6f')][_0x3d1674]),'OpenchannelQueueId':Number(_0x13e5c2[_0x37b9('0x5a')]['id'])});}return _0x2ac1c7;});}})['then'](respondWithResult(_0x5b1ba1,null))['catch'](handleError(_0x5b1ba1,null));};exports[_0x37b9('0x84')]=function(_0x511187,_0x58beba,_0xcac9ce){return db[_0x37b9('0x35')]['find']({'where':{'id':_0x511187['params']['id']}})[_0x37b9('0x2d')](handleEntityNotFound(_0x58beba,null))[_0x37b9('0x2d')](function(_0x239279){if(_0x239279){return _0x239279[_0x37b9('0x84')](_0x511187[_0x37b9('0x3a')][_0x37b9('0x6f')])[_0x37b9('0x2d')](function(){if(_[_0x37b9('0x8b')](_0x511187['query']['ids'])){for(var _0x56f61b=0x0;_0x56f61b<_0x511187[_0x37b9('0x3a')][_0x37b9('0x6f')][_0x37b9('0x3f')];_0x56f61b+=0x1){socket['emit'](_0x37b9('0x85'),{'UserId':Number(_0x511187[_0x37b9('0x3a')][_0x37b9('0x6f')][_0x56f61b]),'OpenchannelQueueId':Number(_0x511187[_0x37b9('0x5a')]['id'])});}}else{socket[_0x37b9('0x89')](_0x37b9('0x85'),{'UserId':Number(_0x511187[_0x37b9('0x3a')][_0x37b9('0x6f')]),'OpenchannelQueueId':Number(_0x511187['params']['id'])});}});}})[_0x37b9('0x2d')](respondWithStatusCode(_0x58beba,null))[_0x37b9('0x50')](handleError(_0x58beba,null));};exports[_0x37b9('0x8c')]=function(_0x28535a,_0x514f06,_0x484141){var _0x4a35cb={};var _0x5c2508={};var _0x123060;var _0x1dd014;return db['OpenchannelQueue'][_0x37b9('0x5d')]({'where':{'id':_0x28535a['params']['id']}})[_0x37b9('0x2d')](handleEntityNotFound(_0x514f06,null))['then'](function(_0xfdf9a){if(_0xfdf9a){_0x123060=_0xfdf9a;_0x5c2508['model']=_['keys'](db['User']['rawAttributes']);_0x5c2508['query']=_[_0x37b9('0x3b')](_0x28535a[_0x37b9('0x3a')]);_0x5c2508['filters']=_[_0x37b9('0x4e')](_0x5c2508[_0x37b9('0x3c')],_0x5c2508[_0x37b9('0x3a')]);_0x4a35cb['attributes']=_[_0x37b9('0x4e')](_0x5c2508[_0x37b9('0x3c')],qs['fields'](_0x28535a[_0x37b9('0x3a')][_0x37b9('0x3d')]));_0x4a35cb[_0x37b9('0x3e')]=_0x4a35cb['attributes'][_0x37b9('0x3f')]?_0x4a35cb[_0x37b9('0x3e')]:_0x5c2508[_0x37b9('0x3c')];_0x4a35cb[_0x37b9('0x60')]=qs[_0x37b9('0x41')](_0x28535a['query'][_0x37b9('0x41')]);_0x4a35cb[_0x37b9('0x42')]=qs[_0x37b9('0x44')](_['pick'](_0x28535a[_0x37b9('0x3a')],_0x5c2508[_0x37b9('0x44')]));if(_0x28535a[_0x37b9('0x3a')][_0x37b9('0x45')]){_0x4a35cb[_0x37b9('0x42')]=_[_0x37b9('0x46')](_0x4a35cb[_0x37b9('0x42')],{'$or':_['map'](_0x4a35cb[_0x37b9('0x3e')],function(_0x542eab){var _0x1c6a09={};_0x1c6a09[_0x542eab]={'$like':'%'+_0x28535a[_0x37b9('0x3a')]['filter']+'%'};return _0x1c6a09;})});}_0x4a35cb=_[_0x37b9('0x46')]({},_0x4a35cb,_0x28535a['options']);return _0x123060[_0x37b9('0x8c')](_0x4a35cb);}})[_0x37b9('0x2d')](function(_0x4a15de){if(_0x4a15de){_0x1dd014=_0x4a15de['length'];if(!_0x28535a[_0x37b9('0x3a')]['hasOwnProperty'](_0x37b9('0x40'))){_0x4a35cb[_0x37b9('0x24')]=qs[_0x37b9('0x24')](_0x28535a['query']['limit']);_0x4a35cb['offset']=qs[_0x37b9('0x21')](_0x28535a[_0x37b9('0x3a')][_0x37b9('0x21')]);}return _0x123060[_0x37b9('0x8c')](_0x4a35cb);}})[_0x37b9('0x2d')](function(_0x5ec948){if(_0x5ec948){return _0x5ec948?{'count':_0x1dd014,'rows':_0x5ec948}:null;}})['then'](respondWithResult(_0x514f06,null))[_0x37b9('0x50')](handleError(_0x514f06,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 496649c..15a9932 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 _0xaac3=['events','../../mysqldb','remove','emit','hasOwnProperty','hook'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xaac3,0x102));var _0x3aac=function(_0x5d11af,_0x105daf){_0x5d11af=_0x5d11af-0x0;var _0x3ca491=_0xaac3[_0x5d11af];return _0x3ca491;};'use strict';var EventEmitter=require(_0x3aac('0x0'));var OpenchannelQueue=require(_0x3aac('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3aac('0x2')};function emitEvent(_0x161208){return function(_0x2165fa,_0x4ff852,_0x3f0a22){OpenchannelQueueEvents[_0x3aac('0x3')](_0x161208+':'+_0x2165fa['id'],_0x2165fa);OpenchannelQueueEvents[_0x3aac('0x3')](_0x161208,_0x2165fa);_0x3f0a22(null);};}for(var e in events){if(events[_0x3aac('0x4')](e)){var event=events[e];OpenchannelQueue[_0x3aac('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xd630=['remove','emit','hasOwnProperty','../../mysqldb','OpenchannelQueue','update'];(function(_0x5de55d,_0xe0b20){var _0xb08e32=function(_0x329290){while(--_0x329290){_0x5de55d['push'](_0x5de55d['shift']());}};_0xb08e32(++_0xe0b20);}(_0xd630,0x1b3));var _0x0d63=function(_0x5d45b4,_0x5935e7){_0x5d45b4=_0x5d45b4-0x0;var _0x349ada=_0xd630[_0x5d45b4];return _0x349ada;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x0d63('0x0'))['db'][_0x0d63('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0d63('0x2'),'afterDestroy':_0x0d63('0x3')};function emitEvent(_0x51c10b){return function(_0x1d45e5,_0x1f7b16,_0x261ef0){OpenchannelQueueEvents['emit'](_0x51c10b+':'+_0x1d45e5['id'],_0x1d45e5);OpenchannelQueueEvents[_0x0d63('0x4')](_0x51c10b,_0x1d45e5);_0x261ef0(null);};}for(var e in events){if(events[_0x0d63('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index bb8c4c4..b8c9205 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 _0x47c0=['bluebird','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x33055e,_0x54dff9){var _0x41dfb4=function(_0x5b4123){while(--_0x5b4123){_0x33055e['push'](_0x33055e['shift']());}};_0x41dfb4(++_0x54dff9);}(_0x47c0,0x97));var _0x047c=function(_0x15fb5b,_0xdab39d){_0x15fb5b=_0x15fb5b-0x0;var _0x10a1a1=_0x47c0[_0x15fb5b];return _0x10a1a1;};'use strict';var _=require(_0x047c('0x0'));var util=require(_0x047c('0x1'));var logger=require(_0x047c('0x2'))(_0x047c('0x3'));var moment=require(_0x047c('0x4'));var BPromise=require(_0x047c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x047c('0x6'));var config=require(_0x047c('0x7'));var attributes=require(_0x047c('0x8'));module[_0x047c('0x9')]=function(_0x5da111,_0x11ddec){return _0x5da111['define'](_0x047c('0xa'),attributes,{'tableName':_0x047c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0504=['rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x463dd6,_0x4eeef3){var _0x4800e4=function(_0x15b384){while(--_0x15b384){_0x463dd6['push'](_0x463dd6['shift']());}};_0x4800e4(++_0x4eeef3);}(_0x0504,0x118));var _0x4050=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x0504[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x4050('0x0'));var util=require('util');var logger=require(_0x4050('0x1'))('api');var moment=require(_0x4050('0x2'));var BPromise=require(_0x4050('0x3'));var rp=require(_0x4050('0x4'));var fs=require('fs');var path=require(_0x4050('0x5'));var rimraf=require(_0x4050('0x6'));var config=require(_0x4050('0x7'));var attributes=require(_0x4050('0x8'));module['exports']=function(_0x4aefb5,_0x5af12b){return _0x4aefb5[_0x4050('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x4050('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 01a8dc0..0fc1d0d 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 _0x2188=['GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','model','ShowOpenchannelQueue','find','raw','map','then','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x150f28,_0x303c14){var _0x4f3998=function(_0x473ce4){while(--_0x473ce4){_0x150f28['push'](_0x150f28['shift']());}};_0x4f3998(++_0x303c14);}(_0x2188,0x1d2));var _0x8218=function(_0x25bafe,_0xa87491){_0x25bafe=_0x25bafe-0x0;var _0x3a5407=_0x2188[_0x25bafe];return _0x3a5407;};'use strict';var _=require(_0x8218('0x0'));var util=require(_0x8218('0x1'));var moment=require(_0x8218('0x2'));var BPromise=require('bluebird');var rs=require(_0x8218('0x3'));var fs=require('fs');var Redis=require(_0x8218('0x4'));var db=require(_0x8218('0x5'))['db'];var utils=require(_0x8218('0x6'));var logger=require(_0x8218('0x7'))(_0x8218('0x8'));var config=require('../../config/environment');var jayson=require(_0x8218('0x9'));var client=jayson['client'][_0x8218('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8218('0xb')],{'host':_0x8218('0xc'),'port':0x18eb});var socket=require(_0x8218('0xd'))(new Redis(config[_0x8218('0xb')]));require(_0x8218('0xe'))[_0x8218('0xf')](socket);function respondWithRpcPromise(_0x563a01,_0x435fac,_0x295acd){return new BPromise(function(_0x3d7f2d,_0x43cffb){return client[_0x8218('0x10')](_0x563a01,_0x295acd)['then'](function(_0x261d0f){logger['info'](_0x8218('0x11'),_0x435fac,_0x8218('0x12'));logger[_0x8218('0x13')](_0x8218('0x14'),_0x435fac,_0x8218('0x12'),JSON[_0x8218('0x15')](_0x261d0f));if(_0x261d0f['error']){if(_0x261d0f[_0x8218('0x16')][_0x8218('0x17')]===0x1f4){logger[_0x8218('0x16')](_0x8218('0x11'),_0x435fac,_0x261d0f['error'][_0x8218('0x18')]);return _0x43cffb(_0x261d0f['error'][_0x8218('0x18')]);}logger['error'](_0x8218('0x11'),_0x435fac,_0x261d0f[_0x8218('0x16')][_0x8218('0x18')]);return _0x3d7f2d(_0x261d0f[_0x8218('0x16')][_0x8218('0x18')]);}else{logger['info'](_0x8218('0x11'),_0x435fac,_0x8218('0x12'));_0x3d7f2d(_0x261d0f['result'][_0x8218('0x18')]);}})[_0x8218('0x19')](function(_0x2e6b68){logger['error'](_0x8218('0x11'),_0x435fac,_0x2e6b68);_0x43cffb(_0x2e6b68);});});}exports[_0x8218('0x1a')]=function(_0x34903d){var _0x530a78=this;return new Promise(function(_0x16f2ae,_0x38a1a2){return db[_0x8218('0x1b')][_0x8218('0x1c')]({'raw':_0x34903d[_0x8218('0x1d')]?_0x34903d[_0x8218('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x34903d['options']?_0x34903d[_0x8218('0x1d')][_0x8218('0x1e')]||null:null,'attributes':_0x34903d['options']?_0x34903d[_0x8218('0x1d')][_0x8218('0x1f')]||null:null,'limit':_0x34903d[_0x8218('0x1d')]?_0x34903d[_0x8218('0x1d')][_0x8218('0x20')]||null:null,'include':_0x34903d[_0x8218('0x1d')]?_0x34903d['options'][_0x8218('0x21')]?_['map'](_0x34903d['options']['include'],function(_0x29f33c){return{'model':db[_0x29f33c[_0x8218('0x22')]],'as':_0x29f33c['as'],'attributes':_0x29f33c['attributes'],'include':_0x29f33c['include']?_['map'](_0x29f33c[_0x8218('0x21')],function(_0x3c6f6e){return{'model':db[_0x3c6f6e[_0x8218('0x22')]],'as':_0x3c6f6e['as'],'attributes':_0x3c6f6e['attributes'],'include':_0x3c6f6e[_0x8218('0x21')]?_['map'](_0x3c6f6e['include'],function(_0x150d5f){return{'model':db[_0x150d5f['model']],'as':_0x150d5f['as'],'attributes':_0x150d5f[_0x8218('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc00e69){logger['info'](_0x8218('0x1a'),_0x34903d);logger[_0x8218('0x13')](_0x8218('0x1a'),_0x34903d,JSON[_0x8218('0x15')](_0xc00e69));_0x16f2ae(_0xc00e69);})[_0x8218('0x19')](function(_0x3e27e3){logger['error']('GetOpenchannelQueue',_0x3e27e3[_0x8218('0x18')],_0x34903d);_0x38a1a2(_0x530a78[_0x8218('0x16')](0x1f4,_0x3e27e3['message']));});});};exports[_0x8218('0x23')]=function(_0x348de5){var _0x269df3=this;return new Promise(function(_0x18ee9d,_0x2f8fba){return db[_0x8218('0x1b')][_0x8218('0x24')]({'raw':_0x348de5[_0x8218('0x1d')]?_0x348de5['options'][_0x8218('0x25')]===undefined?!![]:![]:!![],'where':_0x348de5[_0x8218('0x1d')]?_0x348de5[_0x8218('0x1d')]['where']||null:null,'attributes':_0x348de5[_0x8218('0x1d')]?_0x348de5[_0x8218('0x1d')]['attributes']||null:null,'include':_0x348de5[_0x8218('0x1d')]?_0x348de5['options'][_0x8218('0x21')]?_['map'](_0x348de5[_0x8218('0x1d')][_0x8218('0x21')],function(_0x276722){return{'model':db[_0x276722['model']],'as':_0x276722['as'],'attributes':_0x276722[_0x8218('0x1f')],'include':_0x276722[_0x8218('0x21')]?_['map'](_0x276722[_0x8218('0x21')],function(_0x32ebee){return{'model':db[_0x32ebee[_0x8218('0x22')]],'as':_0x32ebee['as'],'attributes':_0x32ebee[_0x8218('0x1f')],'include':_0x32ebee[_0x8218('0x21')]?_[_0x8218('0x26')](_0x32ebee['include'],function(_0x1cb718){return{'model':db[_0x1cb718['model']],'as':_0x1cb718['as'],'attributes':_0x1cb718['attributes']};}):[]};}):[]};}):[]:[]})[_0x8218('0x27')](function(_0x12ab88){logger[_0x8218('0x28')](_0x8218('0x23'),_0x348de5);logger[_0x8218('0x13')](_0x8218('0x23'),_0x348de5,JSON[_0x8218('0x15')](_0x12ab88));_0x18ee9d(_0x12ab88);})[_0x8218('0x19')](function(_0xd8b2e2){logger[_0x8218('0x16')]('ShowOpenchannelQueue',_0xd8b2e2['message'],_0x348de5);_0x2f8fba(_0x269df3[_0x8218('0x16')](0x1f4,_0xd8b2e2[_0x8218('0x18')]));});});}; \ No newline at end of file +var _0x7de3=['randomstring','../../mysqldb','../../config/utils','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','limit','include','model','attributes','map','then','where','ShowOpenchannelQueue','lodash','util','moment','bluebird'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x7de3,0x149));var _0x37de=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x7de3[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x37de('0x0'));var util=require(_0x37de('0x1'));var moment=require(_0x37de('0x2'));var BPromise=require(_0x37de('0x3'));var rs=require(_0x37de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37de('0x5'))['db'];var utils=require(_0x37de('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x37de('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x37de('0x8')]=_[_0x37de('0x9')](config[_0x37de('0x8')],{'host':_0x37de('0xa'),'port':0x18eb});var socket=require(_0x37de('0xb'))(new Redis(config[_0x37de('0x8')]));require(_0x37de('0xc'))[_0x37de('0xd')](socket);function respondWithRpcPromise(_0x537b80,_0x5f3bfc,_0x413baf){return new BPromise(function(_0x1c3f5a,_0x465235){return client['request'](_0x537b80,_0x413baf)['then'](function(_0x4c67f0){logger[_0x37de('0xe')](_0x37de('0xf'),_0x5f3bfc,_0x37de('0x10'));logger[_0x37de('0x11')](_0x37de('0x12'),_0x5f3bfc,_0x37de('0x10'),JSON[_0x37de('0x13')](_0x4c67f0));if(_0x4c67f0['error']){if(_0x4c67f0['error'][_0x37de('0x14')]===0x1f4){logger[_0x37de('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x5f3bfc,_0x4c67f0['error'][_0x37de('0x16')]);return _0x465235(_0x4c67f0[_0x37de('0x15')][_0x37de('0x16')]);}logger[_0x37de('0x15')](_0x37de('0xf'),_0x5f3bfc,_0x4c67f0[_0x37de('0x15')]['message']);return _0x1c3f5a(_0x4c67f0[_0x37de('0x15')][_0x37de('0x16')]);}else{logger[_0x37de('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x5f3bfc,'request\x20sent');_0x1c3f5a(_0x4c67f0[_0x37de('0x17')][_0x37de('0x16')]);}})[_0x37de('0x18')](function(_0x1c56a9){logger['error'](_0x37de('0xf'),_0x5f3bfc,_0x1c56a9);_0x465235(_0x1c56a9);});});}exports[_0x37de('0x19')]=function(_0x5e279a){var _0x14bb40=this;return new Promise(function(_0x246898,_0x16d1da){return db[_0x37de('0x1a')]['findAll']({'raw':_0x5e279a[_0x37de('0x1b')]?_0x5e279a[_0x37de('0x1b')][_0x37de('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e279a[_0x37de('0x1b')]?_0x5e279a['options']['where']||null:null,'attributes':_0x5e279a['options']?_0x5e279a['options']['attributes']||null:null,'limit':_0x5e279a[_0x37de('0x1b')]?_0x5e279a[_0x37de('0x1b')][_0x37de('0x1d')]||null:null,'include':_0x5e279a[_0x37de('0x1b')]?_0x5e279a[_0x37de('0x1b')][_0x37de('0x1e')]?_['map'](_0x5e279a[_0x37de('0x1b')][_0x37de('0x1e')],function(_0x13ba4f){return{'model':db[_0x13ba4f[_0x37de('0x1f')]],'as':_0x13ba4f['as'],'attributes':_0x13ba4f[_0x37de('0x20')],'include':_0x13ba4f['include']?_[_0x37de('0x21')](_0x13ba4f[_0x37de('0x1e')],function(_0xf64929){return{'model':db[_0xf64929[_0x37de('0x1f')]],'as':_0xf64929['as'],'attributes':_0xf64929['attributes'],'include':_0xf64929[_0x37de('0x1e')]?_['map'](_0xf64929[_0x37de('0x1e')],function(_0x70987d){return{'model':db[_0x70987d[_0x37de('0x1f')]],'as':_0x70987d['as'],'attributes':_0x70987d['attributes']};}):[]};}):[]};}):[]:[]})[_0x37de('0x22')](function(_0x10f5d1){logger[_0x37de('0xe')]('GetOpenchannelQueue',_0x5e279a);logger[_0x37de('0x11')]('GetOpenchannelQueue',_0x5e279a,JSON[_0x37de('0x13')](_0x10f5d1));_0x246898(_0x10f5d1);})['catch'](function(_0xeafe74){logger['error'](_0x37de('0x19'),_0xeafe74[_0x37de('0x16')],_0x5e279a);_0x16d1da(_0x14bb40['error'](0x1f4,_0xeafe74[_0x37de('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x48b32c){var _0x56e712=this;return new Promise(function(_0xac314f,_0x56bbed){return db['OpenchannelQueue']['find']({'raw':_0x48b32c[_0x37de('0x1b')]?_0x48b32c[_0x37de('0x1b')][_0x37de('0x1c')]===undefined?!![]:![]:!![],'where':_0x48b32c[_0x37de('0x1b')]?_0x48b32c['options'][_0x37de('0x23')]||null:null,'attributes':_0x48b32c[_0x37de('0x1b')]?_0x48b32c[_0x37de('0x1b')][_0x37de('0x20')]||null:null,'include':_0x48b32c[_0x37de('0x1b')]?_0x48b32c[_0x37de('0x1b')][_0x37de('0x1e')]?_[_0x37de('0x21')](_0x48b32c['options'][_0x37de('0x1e')],function(_0x49d22f){return{'model':db[_0x49d22f['model']],'as':_0x49d22f['as'],'attributes':_0x49d22f[_0x37de('0x20')],'include':_0x49d22f[_0x37de('0x1e')]?_[_0x37de('0x21')](_0x49d22f[_0x37de('0x1e')],function(_0x44359e){return{'model':db[_0x44359e[_0x37de('0x1f')]],'as':_0x44359e['as'],'attributes':_0x44359e[_0x37de('0x20')],'include':_0x44359e['include']?_['map'](_0x44359e['include'],function(_0x58e60f){return{'model':db[_0x58e60f[_0x37de('0x1f')]],'as':_0x58e60f['as'],'attributes':_0x58e60f[_0x37de('0x20')]};}):[]};}):[]};}):[]:[]})[_0x37de('0x22')](function(_0x28416f){logger[_0x37de('0xe')](_0x37de('0x24'),_0x48b32c);logger['debug'](_0x37de('0x24'),_0x48b32c,JSON[_0x37de('0x13')](_0x28416f));_0xac314f(_0x28416f);})[_0x37de('0x18')](function(_0x1a51f2){logger[_0x37de('0x15')]('ShowOpenchannelQueue',_0x1a51f2[_0x37de('0x16')],_0x48b32c);_0x56bbed(_0x56e712[_0x37de('0x15')](0x1f4,_0x1a51f2[_0x37de('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index cc6efb5..6771587 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 _0x82ae=['openchannelQueue:','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82ae,0x1b7));var _0xe82a=function(_0x200858,_0x4ef46a){_0x200858=_0x200858-0x0;var _0xef3753=_0x82ae[_0x200858];return _0xef3753;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xe82a('0x0'),_0xe82a('0x1')];function createListener(_0x45d2f1,_0x5567b3){return function(_0x3a34b0){_0x5567b3[_0xe82a('0x2')](_0x45d2f1,_0x3a34b0);};}function removeListener(_0x3d1e77,_0x3819a3){return function(){OpenchannelQueueEvents['removeListener'](_0x3d1e77,_0x3819a3);};}exports[_0xe82a('0x3')]=function(_0x40d837){for(var _0x527e69=0x0,_0x5abb8f=events[_0xe82a('0x4')];_0x527e69<_0x5abb8f;_0x527e69++){var _0x6a01b1=events[_0x527e69];var _0x4fe037=createListener(_0xe82a('0x5')+_0x6a01b1,_0x40d837);OpenchannelQueueEvents['on'](_0x6a01b1,_0x4fe037);}}; \ No newline at end of file +var _0xf128=['register','length','openchannelQueue:','./openchannelQueue.events','remove','update','removeListener'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xf128,0xb9));var _0x8f12=function(_0x15fdff,_0x40d5b2){_0x15fdff=_0x15fdff-0x0;var _0x5450ed=_0xf128[_0x15fdff];return _0x5450ed;};'use strict';var OpenchannelQueueEvents=require(_0x8f12('0x0'));var events=['save',_0x8f12('0x1'),_0x8f12('0x2')];function createListener(_0x270c6b,_0x246762){return function(_0x54367e){_0x246762['emit'](_0x270c6b,_0x54367e);};}function removeListener(_0x57d50e,_0x56a7ec){return function(){OpenchannelQueueEvents[_0x8f12('0x3')](_0x57d50e,_0x56a7ec);};}exports[_0x8f12('0x4')]=function(_0x5c119c){for(var _0x3423ed=0x0,_0x198098=events[_0x8f12('0x5')];_0x3423ed<_0x198098;_0x3423ed++){var _0x1a1197=events[_0x3423ed];var _0x32efad=createListener(_0x8f12('0x6')+_0x1a1197,_0x5c119c);OpenchannelQueueEvents['on'](_0x1a1197,_0x32efad);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index bcca706..8320b1c 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 _0xe609=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe609,0xf0));var _0x9e60=function(_0x4576b7,_0x50057b){_0x4576b7=_0x4576b7-0x0;var _0x3a81e0=_0xe609[_0x4576b7];return _0x3a81e0;};'use strict';var multer=require(_0x9e60('0x0'));var util=require(_0x9e60('0x1'));var path=require(_0x9e60('0x2'));var timeout=require(_0x9e60('0x3'));var express=require(_0x9e60('0x4'));var router=express[_0x9e60('0x5')]();var fs_extra=require(_0x9e60('0x6'));var auth=require(_0x9e60('0x7'));var interaction=require(_0x9e60('0x8'));var config=require(_0x9e60('0x9'));var controller=require(_0x9e60('0xa'));router[_0x9e60('0xb')]('/',auth[_0x9e60('0xc')](),controller[_0x9e60('0xd')]);router[_0x9e60('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x9e60('0xe'),auth[_0x9e60('0xc')](),controller[_0x9e60('0xf')]);router[_0x9e60('0x10')]('/',auth[_0x9e60('0xc')](),controller['create']);router[_0x9e60('0x11')](_0x9e60('0xe'),auth[_0x9e60('0xc')](),controller[_0x9e60('0x12')]);router[_0x9e60('0x13')]('/:id',auth[_0x9e60('0xc')](),controller[_0x9e60('0x14')]);module[_0x9e60('0x15')]=router; \ No newline at end of file +var _0x6566=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x5d55a4,_0x4b885c){var _0x2373a9=function(_0x1a45ff){while(--_0x1a45ff){_0x5d55a4['push'](_0x5d55a4['shift']());}};_0x2373a9(++_0x4b885c);}(_0x6566,0x1e7));var _0x6656=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x6566[_0x2867d8];return _0x3b8176;};'use strict';var multer=require(_0x6656('0x0'));var util=require(_0x6656('0x1'));var path=require(_0x6656('0x2'));var timeout=require(_0x6656('0x3'));var express=require(_0x6656('0x4'));var router=express[_0x6656('0x5')]();var fs_extra=require(_0x6656('0x6'));var auth=require(_0x6656('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6656('0x8'));var controller=require(_0x6656('0x9'));router[_0x6656('0xa')]('/',auth[_0x6656('0xb')](),controller[_0x6656('0xc')]);router[_0x6656('0xa')]('/describe',auth[_0x6656('0xb')](),controller[_0x6656('0xd')]);router[_0x6656('0xa')](_0x6656('0xe'),auth[_0x6656('0xb')](),controller[_0x6656('0xf')]);router[_0x6656('0x10')]('/',auth[_0x6656('0xb')](),controller[_0x6656('0x11')]);router[_0x6656('0x12')](_0x6656('0xe'),auth[_0x6656('0xb')](),controller[_0x6656('0x13')]);router[_0x6656('0x14')](_0x6656('0xe'),auth[_0x6656('0xb')](),controller[_0x6656('0x15')]);module[_0x6656('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 9dd85ef..5048394 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 _0xe313=['sequelize','exports','STRING','DATE','moment'];(function(_0x39e7d0,_0xd3e3c0){var _0x33180a=function(_0x14878d){while(--_0x14878d){_0x39e7d0['push'](_0x39e7d0['shift']());}};_0x33180a(++_0xd3e3c0);}(_0xe313,0xe5));var _0x3e31=function(_0x13348a,_0x7a6e2d){_0x13348a=_0x13348a-0x0;var _0x5d71c9=_0xe313[_0x13348a];return _0x5d71c9;};'use strict';var moment=require(_0x3e31('0x0'));var Sequelize=require(_0x3e31('0x1'));module[_0x3e31('0x2')]={'uniqueid':{'type':Sequelize[_0x3e31('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3e31('0x3')]},'joinAt':{'type':Sequelize[_0x3e31('0x4')]},'leaveAt':{'type':Sequelize[_0x3e31('0x4')]},'acceptAt':{'type':Sequelize[_0x3e31('0x4')]},'exitAt':{'type':Sequelize[_0x3e31('0x4')]},'reason':{'type':Sequelize[_0x3e31('0x3')]}}; \ No newline at end of file +var _0x7758=['sequelize','exports','STRING','DATE','moment'];(function(_0x37a0ec,_0x23c3f3){var _0x296062=function(_0x23b606){while(--_0x23b606){_0x37a0ec['push'](_0x37a0ec['shift']());}};_0x296062(++_0x23c3f3);}(_0x7758,0xc2));var _0x8775=function(_0x4da221,_0x397bc){_0x4da221=_0x4da221-0x0;var _0x2a46fa=_0x7758[_0x4da221];return _0x2a46fa;};'use strict';var moment=require(_0x8775('0x0'));var Sequelize=require(_0x8775('0x1'));module[_0x8775('0x2')]={'uniqueid':{'type':Sequelize[_0x8775('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8775('0x3')]},'joinAt':{'type':Sequelize[_0x8775('0x4')]},'leaveAt':{'type':Sequelize[_0x8775('0x4')]},'acceptAt':{'type':Sequelize[_0x8775('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 5154404..d78f969 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 _0x31e3=['../../mysqldb','status','end','offset','limit','undefined','count','set','json','apply','save','destroy','then','sendStatus','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','order','where','pick','filter','merge','includeAll','include','catch','show','keys','fields','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x31e3,0x13d));var _0x331e=function(_0x5cce95,_0x3b8c5c){_0x5cce95=_0x5cce95-0x0;var _0xc0f440=_0x31e3[_0x5cce95];return _0xc0f440;};'use strict';var emlformat=require(_0x331e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x331e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x331e('0x2'));var moment=require(_0x331e('0x3'));var BPromise=require(_0x331e('0x4'));var Mustache=require('mustache');var util=require(_0x331e('0x5'));var path=require('path');var sox=require(_0x331e('0x6'));var csv=require(_0x331e('0x7'));var ejs=require(_0x331e('0x8'));var fs=require('fs');var fs_extra=require(_0x331e('0x9'));var _=require(_0x331e('0xa'));var squel=require(_0x331e('0xb'));var crypto=require('crypto');var jsforce=require(_0x331e('0xc'));var deskjs=require(_0x331e('0xd'));var toCsv=require(_0x331e('0x7'));var querystring=require(_0x331e('0xe'));var Papa=require(_0x331e('0xf'));var Redis=require('ioredis');var authService=require(_0x331e('0x10'));var qs=require(_0x331e('0x11'));var as=require(_0x331e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x331e('0x13'));var utils=require(_0x331e('0x14'));var config=require(_0x331e('0x15'));var licenseUtil=require(_0x331e('0x16'));var db=require(_0x331e('0x17'))['db'];function respondWithStatusCode(_0x1e8798,_0x3ce78d){_0x3ce78d=_0x3ce78d||0xcc;return function(_0xe94122){if(_0xe94122){return _0x1e8798['sendStatus'](_0x3ce78d);}return _0x1e8798[_0x331e('0x18')](_0x3ce78d)[_0x331e('0x19')]();};}function respondWithResult(_0x5a11d9,_0x9fbe8d){_0x9fbe8d=_0x9fbe8d||0xc8;return function(_0x513db8){if(_0x513db8){return _0x5a11d9[_0x331e('0x18')](_0x9fbe8d)['json'](_0x513db8);}};}function respondWithFilteredResult(_0x2d3e68,_0x3863ea){return function(_0x108b9c){if(_0x108b9c){var _0x41ad3f=typeof _0x3863ea[_0x331e('0x1a')]==='undefined'&&typeof _0x3863ea[_0x331e('0x1b')]===_0x331e('0x1c');var _0x2ce298=_0x108b9c[_0x331e('0x1d')];var _0x3c928a=_0x41ad3f?0x0:_0x3863ea['offset'];var _0x3d14f5=_0x41ad3f?_0x108b9c[_0x331e('0x1d')]:_0x3863ea['offset']+_0x3863ea[_0x331e('0x1b')];var _0x2b1056;if(_0x3d14f5>=_0x2ce298){_0x3d14f5=_0x2ce298;_0x2b1056=0xc8;}else{_0x2b1056=0xce;}_0x2d3e68[_0x331e('0x18')](_0x2b1056);return _0x2d3e68[_0x331e('0x1e')]('Content-Range',_0x3c928a+'-'+_0x3d14f5+'/'+_0x2ce298)[_0x331e('0x1f')](_0x108b9c);}return null;};}function patchUpdates(_0x282be9){return function(_0xeb06cf){try{jsonpatch[_0x331e('0x20')](_0xeb06cf,_0x282be9,!![]);}catch(_0x22e0f9){return BPromise['reject'](_0x22e0f9);}return _0xeb06cf[_0x331e('0x21')]();};}function saveUpdates(_0x43ecb5,_0x4b4996){return function(_0xfd512c){if(_0xfd512c){return _0xfd512c['update'](_0x43ecb5)['then'](function(_0x1d12e6){return _0x1d12e6;});}return null;};}function removeEntity(_0x316194,_0x47d8fc){return function(_0x30d768){if(_0x30d768){return _0x30d768[_0x331e('0x22')]()[_0x331e('0x23')](function(){_0x316194['status'](0xcc)[_0x331e('0x19')]();});}};}function handleEntityNotFound(_0x5752e7,_0x2a4974){return function(_0x1dc300){if(!_0x1dc300){_0x5752e7[_0x331e('0x24')](0x194);}return _0x1dc300;};}function handleError(_0x271fd7,_0x5c65a0){_0x5c65a0=_0x5c65a0||0x1f4;return function(_0x1993b2){logger['error'](_0x1993b2[_0x331e('0x25')]);if(_0x1993b2[_0x331e('0x26')]){delete _0x1993b2[_0x331e('0x26')];}_0x271fd7[_0x331e('0x18')](_0x5c65a0)['send'](_0x1993b2);};}exports[_0x331e('0x27')]=function(_0x3d84bf,_0x3fe423){var _0x4890f8={},_0x31978a={},_0x371bfe={'count':0x0,'rows':[]};var _0x4092df=_[_0x331e('0x28')](db[_0x331e('0x29')][_0x331e('0x2a')],function(_0x5f1a91){return{'name':_0x5f1a91[_0x331e('0x2b')],'type':_0x5f1a91[_0x331e('0x2c')]['key']};});_0x31978a['model']=_[_0x331e('0x28')](_0x4092df,_0x331e('0x26'));_0x31978a[_0x331e('0x2d')]=_['keys'](_0x3d84bf[_0x331e('0x2d')]);_0x31978a[_0x331e('0x2e')]=_[_0x331e('0x2f')](_0x31978a[_0x331e('0x30')],_0x31978a['query']);_0x4890f8[_0x331e('0x31')]=_[_0x331e('0x2f')](_0x31978a[_0x331e('0x30')],qs['fields'](_0x3d84bf['query']['fields']));_0x4890f8[_0x331e('0x31')]=_0x4890f8['attributes'][_0x331e('0x32')]?_0x4890f8[_0x331e('0x31')]:_0x31978a[_0x331e('0x30')];if(!_0x3d84bf[_0x331e('0x2d')][_0x331e('0x33')]('nolimit')){_0x4890f8[_0x331e('0x1b')]=qs[_0x331e('0x1b')](_0x3d84bf[_0x331e('0x2d')][_0x331e('0x1b')]);_0x4890f8[_0x331e('0x1a')]=qs[_0x331e('0x1a')](_0x3d84bf[_0x331e('0x2d')]['offset']);}_0x4890f8[_0x331e('0x34')]=qs['sort'](_0x3d84bf[_0x331e('0x2d')]['sort']);_0x4890f8[_0x331e('0x35')]=qs[_0x331e('0x2e')](_[_0x331e('0x36')](_0x3d84bf[_0x331e('0x2d')],_0x31978a[_0x331e('0x2e')]),_0x4092df);if(_0x3d84bf['query'][_0x331e('0x37')]){_0x4890f8['where']=_[_0x331e('0x38')](_0x4890f8[_0x331e('0x35')],{'$or':_[_0x331e('0x28')](_0x4092df,function(_0x5538d1){if(_0x5538d1[_0x331e('0x2c')]!=='VIRTUAL'){var _0xf2fdb5={};_0xf2fdb5[_0x5538d1['name']]={'$like':'%'+_0x3d84bf[_0x331e('0x2d')][_0x331e('0x37')]+'%'};return _0xf2fdb5;}})});}_0x4890f8=_[_0x331e('0x38')]({},_0x4890f8,_0x3d84bf['options']);var _0x40025c={'where':_0x4890f8[_0x331e('0x35')]};return db[_0x331e('0x29')][_0x331e('0x1d')](_0x40025c)[_0x331e('0x23')](function(_0x4618fe){_0x371bfe['count']=_0x4618fe;if(_0x3d84bf[_0x331e('0x2d')][_0x331e('0x39')]){_0x4890f8[_0x331e('0x3a')]=[{'all':!![]}];}return db[_0x331e('0x29')]['findAll'](_0x4890f8);})['then'](function(_0xec5bf3){_0x371bfe['rows']=_0xec5bf3;return _0x371bfe;})[_0x331e('0x23')](respondWithFilteredResult(_0x3fe423,_0x4890f8))[_0x331e('0x3b')](handleError(_0x3fe423,null));};exports[_0x331e('0x3c')]=function(_0x583414,_0x5519f1){var _0xd84002={'raw':!![],'where':{'id':_0x583414['params']['id']}},_0x124abc={};_0x124abc[_0x331e('0x30')]=_[_0x331e('0x3d')](db['OpenchannelQueueReport']['rawAttributes']);_0x124abc['query']=_[_0x331e('0x3d')](_0x583414[_0x331e('0x2d')]);_0x124abc[_0x331e('0x2e')]=_['intersection'](_0x124abc[_0x331e('0x30')],_0x124abc[_0x331e('0x2d')]);_0xd84002[_0x331e('0x31')]=_[_0x331e('0x2f')](_0x124abc[_0x331e('0x30')],qs[_0x331e('0x3e')](_0x583414[_0x331e('0x2d')][_0x331e('0x3e')]));_0xd84002[_0x331e('0x31')]=_0xd84002[_0x331e('0x31')][_0x331e('0x32')]?_0xd84002[_0x331e('0x31')]:_0x124abc['model'];if(_0x583414[_0x331e('0x2d')][_0x331e('0x39')]){_0xd84002[_0x331e('0x3a')]=[{'all':!![]}];}_0xd84002=_['merge']({},_0xd84002,_0x583414['options']);return db[_0x331e('0x29')][_0x331e('0x3f')](_0xd84002)[_0x331e('0x23')](handleEntityNotFound(_0x5519f1,null))[_0x331e('0x23')](respondWithResult(_0x5519f1,null))[_0x331e('0x3b')](handleError(_0x5519f1,null));};exports[_0x331e('0x40')]=function(_0x584c1f,_0x293dff){return db[_0x331e('0x29')][_0x331e('0x40')](_0x584c1f[_0x331e('0x41')],{})[_0x331e('0x23')](respondWithResult(_0x293dff,0xc9))[_0x331e('0x3b')](handleError(_0x293dff,null));};exports['update']=function(_0xe781cf,_0x51b3a4){if(_0xe781cf[_0x331e('0x41')]['id']){delete _0xe781cf[_0x331e('0x41')]['id'];}return db['OpenchannelQueueReport'][_0x331e('0x3f')]({'where':{'id':_0xe781cf[_0x331e('0x42')]['id']}})[_0x331e('0x23')](handleEntityNotFound(_0x51b3a4,null))['then'](saveUpdates(_0xe781cf['body'],null))[_0x331e('0x23')](respondWithResult(_0x51b3a4,null))['catch'](handleError(_0x51b3a4,null));};exports[_0x331e('0x22')]=function(_0x12f8fa,_0x47871e){return db[_0x331e('0x29')]['find']({'where':{'id':_0x12f8fa[_0x331e('0x42')]['id']}})[_0x331e('0x23')](handleEntityNotFound(_0x47871e,null))[_0x331e('0x23')](removeEntity(_0x47871e,null))[_0x331e('0x3b')](handleError(_0x47871e,null));};exports['describe']=function(_0xbb39ca,_0x5395bc){return db[_0x331e('0x29')][_0x331e('0x43')]()[_0x331e('0x23')](respondWithResult(_0x5395bc,null))['catch'](handleError(_0x5395bc,null));}; \ No newline at end of file +var _0x92bf=['intersection','fields','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','rows','catch','show','params','length','includeAll','include','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','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','offset','undefined','count','limit','Content-Range','json','reject','update','destroy','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','model','query','keys','filters','attributes'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x92bf,0x18d));var _0xf92b=function(_0x35d5ef,_0xf5d87d){_0x35d5ef=_0x35d5ef-0x0;var _0x40356f=_0x92bf[_0x35d5ef];return _0x40356f;};'use strict';var emlformat=require(_0xf92b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf92b('0x1'));var jsonpatch=require(_0xf92b('0x2'));var rp=require('request-promise');var moment=require(_0xf92b('0x3'));var BPromise=require(_0xf92b('0x4'));var Mustache=require(_0xf92b('0x5'));var util=require('util');var path=require(_0xf92b('0x6'));var sox=require(_0xf92b('0x7'));var csv=require('to-csv');var ejs=require(_0xf92b('0x8'));var fs=require('fs');var fs_extra=require(_0xf92b('0x9'));var _=require(_0xf92b('0xa'));var squel=require(_0xf92b('0xb'));var crypto=require(_0xf92b('0xc'));var jsforce=require(_0xf92b('0xd'));var deskjs=require(_0xf92b('0xe'));var toCsv=require(_0xf92b('0xf'));var querystring=require(_0xf92b('0x10'));var Papa=require(_0xf92b('0x11'));var Redis=require(_0xf92b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf92b('0x13'));var as=require(_0xf92b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf92b('0x15'))(_0xf92b('0x16'));var utils=require(_0xf92b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf92b('0x18'));var db=require(_0xf92b('0x19'))['db'];function respondWithStatusCode(_0x2d6e22,_0x1cb7e6){_0x1cb7e6=_0x1cb7e6||0xcc;return function(_0x10ea86){if(_0x10ea86){return _0x2d6e22[_0xf92b('0x1a')](_0x1cb7e6);}return _0x2d6e22[_0xf92b('0x1b')](_0x1cb7e6)[_0xf92b('0x1c')]();};}function respondWithResult(_0x52a554,_0x2c1d08){_0x2c1d08=_0x2c1d08||0xc8;return function(_0x5d227e){if(_0x5d227e){return _0x52a554[_0xf92b('0x1b')](_0x2c1d08)['json'](_0x5d227e);}};}function respondWithFilteredResult(_0x16a580,_0x16baa5){return function(_0x133b23){if(_0x133b23){var _0x4a7407=typeof _0x16baa5[_0xf92b('0x1d')]===_0xf92b('0x1e')&&typeof _0x16baa5['limit']===_0xf92b('0x1e');var _0x1bda62=_0x133b23[_0xf92b('0x1f')];var _0x3a826b=_0x4a7407?0x0:_0x16baa5[_0xf92b('0x1d')];var _0x4eaabc=_0x4a7407?_0x133b23[_0xf92b('0x1f')]:_0x16baa5[_0xf92b('0x1d')]+_0x16baa5[_0xf92b('0x20')];var _0x146dd6;if(_0x4eaabc>=_0x1bda62){_0x4eaabc=_0x1bda62;_0x146dd6=0xc8;}else{_0x146dd6=0xce;}_0x16a580[_0xf92b('0x1b')](_0x146dd6);return _0x16a580['set'](_0xf92b('0x21'),_0x3a826b+'-'+_0x4eaabc+'/'+_0x1bda62)[_0xf92b('0x22')](_0x133b23);}return null;};}function patchUpdates(_0x4e3ea2){return function(_0x300b3f){try{jsonpatch['apply'](_0x300b3f,_0x4e3ea2,!![]);}catch(_0x21a0a7){return BPromise[_0xf92b('0x23')](_0x21a0a7);}return _0x300b3f['save']();};}function saveUpdates(_0x5c77d8,_0x109605){return function(_0x5cb099){if(_0x5cb099){return _0x5cb099[_0xf92b('0x24')](_0x5c77d8)['then'](function(_0x22e36e){return _0x22e36e;});}return null;};}function removeEntity(_0x16af2c,_0x471b84){return function(_0xffb1e){if(_0xffb1e){return _0xffb1e[_0xf92b('0x25')]()[_0xf92b('0x26')](function(){_0x16af2c[_0xf92b('0x1b')](0xcc)[_0xf92b('0x1c')]();});}};}function handleEntityNotFound(_0x4cea3b,_0x1076f1){return function(_0x30d9ff){if(!_0x30d9ff){_0x4cea3b[_0xf92b('0x1a')](0x194);}return _0x30d9ff;};}function handleError(_0x3909d4,_0x326d9a){_0x326d9a=_0x326d9a||0x1f4;return function(_0x4eda9c){logger[_0xf92b('0x27')](_0x4eda9c[_0xf92b('0x28')]);if(_0x4eda9c[_0xf92b('0x29')]){delete _0x4eda9c['name'];}_0x3909d4['status'](_0x326d9a)[_0xf92b('0x2a')](_0x4eda9c);};}exports[_0xf92b('0x2b')]=function(_0x9906e3,_0x22d15d){var _0x42a007={},_0x32a670={},_0x5cda72={'count':0x0,'rows':[]};var _0x19a831=_[_0xf92b('0x2c')](db[_0xf92b('0x2d')][_0xf92b('0x2e')],function(_0x3092f1){return{'name':_0x3092f1[_0xf92b('0x2f')],'type':_0x3092f1['type']['key']};});_0x32a670[_0xf92b('0x30')]=_[_0xf92b('0x2c')](_0x19a831,_0xf92b('0x29'));_0x32a670[_0xf92b('0x31')]=_[_0xf92b('0x32')](_0x9906e3[_0xf92b('0x31')]);_0x32a670[_0xf92b('0x33')]=_['intersection'](_0x32a670[_0xf92b('0x30')],_0x32a670[_0xf92b('0x31')]);_0x42a007[_0xf92b('0x34')]=_[_0xf92b('0x35')](_0x32a670['model'],qs[_0xf92b('0x36')](_0x9906e3[_0xf92b('0x31')]['fields']));_0x42a007[_0xf92b('0x34')]=_0x42a007[_0xf92b('0x34')]['length']?_0x42a007[_0xf92b('0x34')]:_0x32a670['model'];if(!_0x9906e3[_0xf92b('0x31')][_0xf92b('0x37')]('nolimit')){_0x42a007[_0xf92b('0x20')]=qs[_0xf92b('0x20')](_0x9906e3['query'][_0xf92b('0x20')]);_0x42a007['offset']=qs[_0xf92b('0x1d')](_0x9906e3[_0xf92b('0x31')]['offset']);}_0x42a007[_0xf92b('0x38')]=qs['sort'](_0x9906e3['query'][_0xf92b('0x39')]);_0x42a007['where']=qs[_0xf92b('0x33')](_[_0xf92b('0x3a')](_0x9906e3['query'],_0x32a670[_0xf92b('0x33')]),_0x19a831);if(_0x9906e3[_0xf92b('0x31')]['filter']){_0x42a007[_0xf92b('0x3b')]=_[_0xf92b('0x3c')](_0x42a007[_0xf92b('0x3b')],{'$or':_[_0xf92b('0x2c')](_0x19a831,function(_0x176d54){if(_0x176d54[_0xf92b('0x3d')]!==_0xf92b('0x3e')){var _0x5dc2cb={};_0x5dc2cb[_0x176d54['name']]={'$like':'%'+_0x9906e3[_0xf92b('0x31')][_0xf92b('0x3f')]+'%'};return _0x5dc2cb;}})});}_0x42a007=_[_0xf92b('0x3c')]({},_0x42a007,_0x9906e3[_0xf92b('0x40')]);var _0x3fb35c={'where':_0x42a007[_0xf92b('0x3b')]};return db[_0xf92b('0x2d')]['count'](_0x3fb35c)['then'](function(_0x547dd9){_0x5cda72[_0xf92b('0x1f')]=_0x547dd9;if(_0x9906e3['query']['includeAll']){_0x42a007['include']=[{'all':!![]}];}return db[_0xf92b('0x2d')]['findAll'](_0x42a007);})[_0xf92b('0x26')](function(_0x4f0345){_0x5cda72[_0xf92b('0x41')]=_0x4f0345;return _0x5cda72;})['then'](respondWithFilteredResult(_0x22d15d,_0x42a007))[_0xf92b('0x42')](handleError(_0x22d15d,null));};exports[_0xf92b('0x43')]=function(_0x532d12,_0x271ab5){var _0x26d62c={'raw':!![],'where':{'id':_0x532d12[_0xf92b('0x44')]['id']}},_0x129d09={};_0x129d09[_0xf92b('0x30')]=_[_0xf92b('0x32')](db[_0xf92b('0x2d')][_0xf92b('0x2e')]);_0x129d09[_0xf92b('0x31')]=_[_0xf92b('0x32')](_0x532d12[_0xf92b('0x31')]);_0x129d09[_0xf92b('0x33')]=_[_0xf92b('0x35')](_0x129d09['model'],_0x129d09[_0xf92b('0x31')]);_0x26d62c[_0xf92b('0x34')]=_['intersection'](_0x129d09[_0xf92b('0x30')],qs[_0xf92b('0x36')](_0x532d12[_0xf92b('0x31')][_0xf92b('0x36')]));_0x26d62c[_0xf92b('0x34')]=_0x26d62c[_0xf92b('0x34')][_0xf92b('0x45')]?_0x26d62c[_0xf92b('0x34')]:_0x129d09[_0xf92b('0x30')];if(_0x532d12[_0xf92b('0x31')][_0xf92b('0x46')]){_0x26d62c[_0xf92b('0x47')]=[{'all':!![]}];}_0x26d62c=_['merge']({},_0x26d62c,_0x532d12[_0xf92b('0x40')]);return db[_0xf92b('0x2d')]['find'](_0x26d62c)[_0xf92b('0x26')](handleEntityNotFound(_0x271ab5,null))['then'](respondWithResult(_0x271ab5,null))['catch'](handleError(_0x271ab5,null));};exports[_0xf92b('0x48')]=function(_0xf3013a,_0x4436b7){return db[_0xf92b('0x2d')]['create'](_0xf3013a[_0xf92b('0x49')],{})[_0xf92b('0x26')](respondWithResult(_0x4436b7,0xc9))[_0xf92b('0x42')](handleError(_0x4436b7,null));};exports[_0xf92b('0x24')]=function(_0x34177e,_0x38edf2){if(_0x34177e['body']['id']){delete _0x34177e[_0xf92b('0x49')]['id'];}return db['OpenchannelQueueReport'][_0xf92b('0x4a')]({'where':{'id':_0x34177e[_0xf92b('0x44')]['id']}})['then'](handleEntityNotFound(_0x38edf2,null))['then'](saveUpdates(_0x34177e[_0xf92b('0x49')],null))[_0xf92b('0x26')](respondWithResult(_0x38edf2,null))[_0xf92b('0x42')](handleError(_0x38edf2,null));};exports[_0xf92b('0x25')]=function(_0x2a4677,_0x384b17){return db[_0xf92b('0x2d')][_0xf92b('0x4a')]({'where':{'id':_0x2a4677[_0xf92b('0x44')]['id']}})[_0xf92b('0x26')](handleEntityNotFound(_0x384b17,null))['then'](removeEntity(_0x384b17,null))[_0xf92b('0x42')](handleError(_0x384b17,null));};exports['describe']=function(_0x54ac02,_0x3bd745){return db[_0xf92b('0x2d')]['describe']()[_0xf92b('0x26')](respondWithResult(_0x3bd745,null))[_0xf92b('0x42')](handleError(_0x3bd745,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index fd388ca..793dbb4 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0x814b,0x1a2));var _0xb814=function(_0x347399,_0x42bbda){_0x347399=_0x347399-0x0;var _0x24e7be=_0x814b[_0x347399];return _0x24e7be;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x814b,0x1a2));var _0xb814=function(_0x234577,_0x3b9004){_0x234577=_0x234577-0x0;var _0x28fea6=_0x814b[_0x234577];return _0x28fea6;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index b907430..91f4314 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 _0x2b65=['jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','stringify','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x2b65,0x131));var _0x52b6=function(_0xf9b7a3,_0x2a66f4){_0xf9b7a3=_0xf9b7a3-0x0;var _0x25f0a2=_0x2b65[_0xf9b7a3];return _0x25f0a2;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d451f,_0x70579,_0x1af78f){return new BPromise(function(_0x432726,_0x27c5b9){return client['request'](_0x2d451f,_0x1af78f)[_0x52b6('0xd')](function(_0x1c2cb5){logger[_0x52b6('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x52b6('0xf'));logger[_0x52b6('0x10')](_0x52b6('0x11'),_0x70579,_0x52b6('0xf'),JSON['stringify'](_0x1c2cb5));if(_0x1c2cb5[_0x52b6('0x12')]){if(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x13')]===0x1f4){logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')]['message']);return _0x27c5b9(_0x1c2cb5[_0x52b6('0x12')]['message']);}logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);return _0x432726(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);}else{logger[_0x52b6('0xe')](_0x52b6('0x14'),_0x70579,_0x52b6('0xf'));_0x432726(_0x1c2cb5[_0x52b6('0x16')][_0x52b6('0x15')]);}})[_0x52b6('0x17')](function(_0x307594){logger[_0x52b6('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x307594);_0x27c5b9(_0x307594);});});}exports[_0x52b6('0x18')]=function(_0x2fa3ed){var _0x9bab0a=this;return new Promise(function(_0x47d203,_0x36d376){return db[_0x52b6('0x19')]['create'](_0x2fa3ed['body'],{'raw':_0x2fa3ed[_0x52b6('0x1a')]?_0x2fa3ed['options'][_0x52b6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2e472f){logger[_0x52b6('0xe')](_0x52b6('0x18'),_0x2fa3ed);logger[_0x52b6('0x10')]('CreateOpenchannelQueueReport',_0x2fa3ed,JSON[_0x52b6('0x1c')](_0x2e472f));_0x47d203(_0x2e472f);})[_0x52b6('0x17')](function(_0x1246db){logger[_0x52b6('0x12')](_0x52b6('0x18'),_0x1246db[_0x52b6('0x15')],_0x2fa3ed);_0x36d376(_0x9bab0a[_0x52b6('0x12')](0x1f4,_0x1246db[_0x52b6('0x15')]));});});};exports[_0x52b6('0x1d')]=function(_0x55aa4c){var _0x2a97c0=this;return new Promise(function(_0x2ff6f4,_0x3a2fb0){return db[_0x52b6('0x19')][_0x52b6('0x1e')](_0x55aa4c[_0x52b6('0x1f')],{'raw':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x20')]||null:null,'attributes':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x21')]||null:null,'limit':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c['options'][_0x52b6('0x22')]||null:null})[_0x52b6('0xd')](function(_0x1716b6){logger[_0x52b6('0xe')](_0x52b6('0x1d'),_0x55aa4c);logger[_0x52b6('0x10')](_0x52b6('0x1d'),_0x55aa4c,JSON['stringify'](_0x1716b6));_0x2ff6f4(_0x1716b6);})[_0x52b6('0x17')](function(_0x42ac9b){logger['error'](_0x52b6('0x1d'),_0x42ac9b[_0x52b6('0x15')],_0x55aa4c);_0x3a2fb0(_0x2a97c0[_0x52b6('0x12')](0x1f4,_0x42ac9b[_0x52b6('0x15')]));});});}; \ No newline at end of file +var _0x02a7=['raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','create','body','options'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x02a7,0x1a6));var _0x702a=function(_0x4774c3,_0x1256dd){_0x4774c3=_0x4774c3-0x0;var _0x3db2e2=_0x02a7[_0x4774c3];return _0x3db2e2;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}exports[_0x702a('0x16')]=function(_0x340dc2){var _0x2071ad=this;return new Promise(function(_0x3d1550,_0x1885eb){return db['OpenchannelQueueReport'][_0x702a('0x17')](_0x340dc2[_0x702a('0x18')],{'raw':_0x340dc2[_0x702a('0x19')]?_0x340dc2[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5b2998){logger['info'](_0x702a('0x16'),_0x340dc2);logger['debug'](_0x702a('0x16'),_0x340dc2,JSON[_0x702a('0xf')](_0x5b2998));_0x3d1550(_0x5b2998);})['catch'](function(_0x2ca064){logger[_0x702a('0x10')](_0x702a('0x16'),_0x2ca064[_0x702a('0x13')],_0x340dc2);_0x1885eb(_0x2071ad[_0x702a('0x10')](0x1f4,_0x2ca064['message']));});});};exports[_0x702a('0x1b')]=function(_0x544be5){var _0x5e6cce=this;return new Promise(function(_0x57d897,_0xa2be1d){return db[_0x702a('0x1c')]['update'](_0x544be5[_0x702a('0x18')],{'raw':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1d')]||null:null,'attributes':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1e')]||null:null,'limit':_0x544be5['options']?_0x544be5[_0x702a('0x19')]['limit']||null:null})[_0x702a('0x1f')](function(_0x51867d){logger[_0x702a('0xb')](_0x702a('0x1b'),_0x544be5);logger[_0x702a('0xd')]('UpdateOpenchannelQueueReport',_0x544be5,JSON[_0x702a('0xf')](_0x51867d));_0x57d897(_0x51867d);})[_0x702a('0x15')](function(_0x26e1d1){logger['error'](_0x702a('0x1b'),_0x26e1d1['message'],_0x544be5);_0xa2be1d(_0x5e6cce[_0x702a('0x10')](0x1f4,_0x26e1d1[_0x702a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 4dae7b3..5ece791 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 _0x2de1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2de1,0x89));var _0x12de=function(_0x32cd01,_0x591d5d){_0x32cd01=_0x32cd01-0x0;var _0x44d819=_0x2de1[_0x32cd01];return _0x44d819;};'use strict';var multer=require(_0x12de('0x0'));var util=require(_0x12de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x12de('0x2'));var router=express['Router']();var fs_extra=require(_0x12de('0x3'));var auth=require(_0x12de('0x4'));var interaction=require(_0x12de('0x5'));var config=require(_0x12de('0x6'));var controller=require(_0x12de('0x7'));router['get']('/',auth[_0x12de('0x8')](),controller[_0x12de('0x9')]);router[_0x12de('0xa')](_0x12de('0xb'),auth['isAuthenticated'](),controller[_0x12de('0xc')]);router['get'](_0x12de('0xd'),auth[_0x12de('0x8')](),controller[_0x12de('0xe')]);router[_0x12de('0xf')]('/',auth[_0x12de('0x8')](),controller['create']);router['put'](_0x12de('0xd'),auth[_0x12de('0x8')](),controller[_0x12de('0x10')]);router[_0x12de('0x11')](_0x12de('0xd'),auth[_0x12de('0x8')](),controller[_0x12de('0x12')]);module[_0x12de('0x13')]=router; \ No newline at end of file +var _0x3a03=['exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','index','get','describe','post','put','/:id','update','delete','destroy'];(function(_0x5dcef3,_0x12f167){var _0x187d86=function(_0x2e76a6){while(--_0x2e76a6){_0x5dcef3['push'](_0x5dcef3['shift']());}};_0x187d86(++_0x12f167);}(_0x3a03,0x1dd));var _0x33a0=function(_0x70d8e9,_0x14011e){_0x70d8e9=_0x70d8e9-0x0;var _0x46b7c8=_0x3a03[_0x70d8e9];return _0x46b7c8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x33a0('0x0'));var router=express[_0x33a0('0x1')]();var fs_extra=require(_0x33a0('0x2'));var auth=require(_0x33a0('0x3'));var interaction=require(_0x33a0('0x4'));var config=require('../../config/environment');var controller=require(_0x33a0('0x5'));router['get']('/',auth[_0x33a0('0x6')](),controller[_0x33a0('0x7')]);router[_0x33a0('0x8')]('/describe',auth[_0x33a0('0x6')](),controller[_0x33a0('0x9')]);router['get']('/:id',auth[_0x33a0('0x6')](),controller['show']);router[_0x33a0('0xa')]('/',auth[_0x33a0('0x6')](),controller['create']);router[_0x33a0('0xb')](_0x33a0('0xc'),auth[_0x33a0('0x6')](),controller[_0x33a0('0xd')]);router[_0x33a0('0xe')](_0x33a0('0xc'),auth[_0x33a0('0x6')](),controller[_0x33a0('0xf')]);module[_0x33a0('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 010434c..ea3182a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x37cc47,_0x127615){var _0x460104=function(_0x253c09){while(--_0x253c09){_0x37cc47['push'](_0x37cc47['shift']());}};_0x460104(++_0x127615);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x40b493,_0x4050de){_0x40b493=_0x40b493-0x0;var _0x548365=_0xcb91[_0x40b493];return _0x548365;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2bee54,_0x5063d0){var _0x3abf5d=function(_0x279a46){while(--_0x279a46){_0x2bee54['push'](_0x2bee54['shift']());}};_0x3abf5d(++_0x5063d0);}(_0xaa88,0x137));var _0x8aa8=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xaa88[_0x18fb16];return _0x147b0d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d32cbe6..79c2ca5 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 _0x32c8=['params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','OpenchannelTransferReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x4d338b,_0x4439c4){var _0xcaaf07=function(_0x41efd2){while(--_0x41efd2){_0x4d338b['push'](_0x4d338b['shift']());}};_0xcaaf07(++_0x4439c4);}(_0x32c8,0x17c));var _0x832c=function(_0x1664af,_0x4faf0d){_0x1664af=_0x1664af-0x0;var _0x794ed4=_0x32c8[_0x1664af];return _0x794ed4;};'use strict';var emlformat=require(_0x832c('0x0'));var rimraf=require(_0x832c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x832c('0x2'));var rp=require('request-promise');var moment=require(_0x832c('0x3'));var BPromise=require(_0x832c('0x4'));var Mustache=require(_0x832c('0x5'));var util=require(_0x832c('0x6'));var path=require('path');var sox=require(_0x832c('0x7'));var csv=require('to-csv');var ejs=require(_0x832c('0x8'));var fs=require('fs');var fs_extra=require(_0x832c('0x9'));var _=require(_0x832c('0xa'));var squel=require('squel');var crypto=require(_0x832c('0xb'));var jsforce=require(_0x832c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x832c('0xd'));var querystring=require(_0x832c('0xe'));var Papa=require('papaparse');var Redis=require(_0x832c('0xf'));var authService=require(_0x832c('0x10'));var qs=require(_0x832c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x832c('0x12'));var logger=require(_0x832c('0x13'))(_0x832c('0x14'));var utils=require(_0x832c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x832c('0x16'))['db'];function respondWithStatusCode(_0x357573,_0x1afe8f){_0x1afe8f=_0x1afe8f||0xcc;return function(_0x21698f){if(_0x21698f){return _0x357573[_0x832c('0x17')](_0x1afe8f);}return _0x357573[_0x832c('0x18')](_0x1afe8f)[_0x832c('0x19')]();};}function respondWithResult(_0x5466ae,_0x165812){_0x165812=_0x165812||0xc8;return function(_0x6cdeb3){if(_0x6cdeb3){return _0x5466ae[_0x832c('0x18')](_0x165812)[_0x832c('0x1a')](_0x6cdeb3);}};}function respondWithFilteredResult(_0x275434,_0x19256b){return function(_0x3009ce){if(_0x3009ce){var _0x3e80c7=typeof _0x19256b['offset']===_0x832c('0x1b')&&typeof _0x19256b[_0x832c('0x1c')]==='undefined';var _0x277c77=_0x3009ce[_0x832c('0x1d')];var _0x3b4f0e=_0x3e80c7?0x0:_0x19256b[_0x832c('0x1e')];var _0x4bb6e9=_0x3e80c7?_0x3009ce['count']:_0x19256b[_0x832c('0x1e')]+_0x19256b[_0x832c('0x1c')];var _0x388b80;if(_0x4bb6e9>=_0x277c77){_0x4bb6e9=_0x277c77;_0x388b80=0xc8;}else{_0x388b80=0xce;}_0x275434[_0x832c('0x18')](_0x388b80);return _0x275434[_0x832c('0x1f')]('Content-Range',_0x3b4f0e+'-'+_0x4bb6e9+'/'+_0x277c77)[_0x832c('0x1a')](_0x3009ce);}return null;};}function patchUpdates(_0x2baeb9){return function(_0x445f6d){try{jsonpatch[_0x832c('0x20')](_0x445f6d,_0x2baeb9,!![]);}catch(_0x321b00){return BPromise[_0x832c('0x21')](_0x321b00);}return _0x445f6d[_0x832c('0x22')]();};}function saveUpdates(_0x524d30,_0x16609c){return function(_0x51e2fc){if(_0x51e2fc){return _0x51e2fc[_0x832c('0x23')](_0x524d30)[_0x832c('0x24')](function(_0x5c6b18){return _0x5c6b18;});}return null;};}function removeEntity(_0x2cc11e,_0x2c6b58){return function(_0x1a37f9){if(_0x1a37f9){return _0x1a37f9[_0x832c('0x25')]()['then'](function(){_0x2cc11e['status'](0xcc)[_0x832c('0x19')]();});}};}function handleEntityNotFound(_0x33907f,_0x271e61){return function(_0xbe69d){if(!_0xbe69d){_0x33907f[_0x832c('0x17')](0x194);}return _0xbe69d;};}function handleError(_0x738560,_0x469f8c){_0x469f8c=_0x469f8c||0x1f4;return function(_0x2bb85c){logger[_0x832c('0x26')](_0x2bb85c[_0x832c('0x27')]);if(_0x2bb85c['name']){delete _0x2bb85c[_0x832c('0x28')];}_0x738560[_0x832c('0x18')](_0x469f8c)['send'](_0x2bb85c);};}exports[_0x832c('0x29')]=function(_0x37dfb8,_0x447a23){var _0x19332f={},_0x1e3df7={},_0x396622={'count':0x0,'rows':[]};var _0x542b21=_[_0x832c('0x2a')](db[_0x832c('0x2b')]['rawAttributes'],function(_0x5127bc){return{'name':_0x5127bc[_0x832c('0x2c')],'type':_0x5127bc['type'][_0x832c('0x2d')]};});_0x1e3df7[_0x832c('0x2e')]=_['map'](_0x542b21,_0x832c('0x28'));_0x1e3df7[_0x832c('0x2f')]=_[_0x832c('0x30')](_0x37dfb8[_0x832c('0x2f')]);_0x1e3df7[_0x832c('0x31')]=_[_0x832c('0x32')](_0x1e3df7[_0x832c('0x2e')],_0x1e3df7[_0x832c('0x2f')]);_0x19332f[_0x832c('0x33')]=_[_0x832c('0x32')](_0x1e3df7[_0x832c('0x2e')],qs[_0x832c('0x34')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x34')]));_0x19332f[_0x832c('0x33')]=_0x19332f[_0x832c('0x33')][_0x832c('0x35')]?_0x19332f[_0x832c('0x33')]:_0x1e3df7[_0x832c('0x2e')];if(!_0x37dfb8[_0x832c('0x2f')][_0x832c('0x36')](_0x832c('0x37'))){_0x19332f[_0x832c('0x1c')]=qs[_0x832c('0x1c')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x1c')]);_0x19332f[_0x832c('0x1e')]=qs[_0x832c('0x1e')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x1e')]);}_0x19332f[_0x832c('0x38')]=qs[_0x832c('0x39')](_0x37dfb8[_0x832c('0x2f')][_0x832c('0x39')]);_0x19332f[_0x832c('0x3a')]=qs[_0x832c('0x31')](_[_0x832c('0x3b')](_0x37dfb8['query'],_0x1e3df7['filters']),_0x542b21);if(_0x37dfb8[_0x832c('0x2f')][_0x832c('0x3c')]){_0x19332f[_0x832c('0x3a')]=_[_0x832c('0x3d')](_0x19332f[_0x832c('0x3a')],{'$or':_[_0x832c('0x2a')](_0x542b21,function(_0x56e5d6){if(_0x56e5d6[_0x832c('0x3e')]!==_0x832c('0x3f')){var _0x1257d2={};_0x1257d2[_0x56e5d6['name']]={'$like':'%'+_0x37dfb8[_0x832c('0x2f')]['filter']+'%'};return _0x1257d2;}})});}_0x19332f=_[_0x832c('0x3d')]({},_0x19332f,_0x37dfb8[_0x832c('0x40')]);var _0x527c05={'where':_0x19332f['where']};return db[_0x832c('0x2b')]['count'](_0x527c05)[_0x832c('0x24')](function(_0xf8ce44){_0x396622[_0x832c('0x1d')]=_0xf8ce44;if(_0x37dfb8[_0x832c('0x2f')][_0x832c('0x41')]){_0x19332f[_0x832c('0x42')]=[{'all':!![]}];}return db[_0x832c('0x2b')][_0x832c('0x43')](_0x19332f);})[_0x832c('0x24')](function(_0x277127){_0x396622[_0x832c('0x44')]=_0x277127;return _0x396622;})[_0x832c('0x24')](respondWithFilteredResult(_0x447a23,_0x19332f))[_0x832c('0x45')](handleError(_0x447a23,null));};exports['show']=function(_0x5497d7,_0x130aa2){var _0x541837={'raw':!![],'where':{'id':_0x5497d7[_0x832c('0x46')]['id']}},_0x3519cc={};_0x3519cc[_0x832c('0x2e')]=_['keys'](db[_0x832c('0x2b')]['rawAttributes']);_0x3519cc[_0x832c('0x2f')]=_[_0x832c('0x30')](_0x5497d7[_0x832c('0x2f')]);_0x3519cc[_0x832c('0x31')]=_[_0x832c('0x32')](_0x3519cc[_0x832c('0x2e')],_0x3519cc['query']);_0x541837[_0x832c('0x33')]=_[_0x832c('0x32')](_0x3519cc[_0x832c('0x2e')],qs['fields'](_0x5497d7['query'][_0x832c('0x34')]));_0x541837[_0x832c('0x33')]=_0x541837[_0x832c('0x33')]['length']?_0x541837[_0x832c('0x33')]:_0x3519cc['model'];if(_0x5497d7['query']['includeAll']){_0x541837['include']=[{'all':!![]}];}_0x541837=_[_0x832c('0x3d')]({},_0x541837,_0x5497d7[_0x832c('0x40')]);return db[_0x832c('0x2b')][_0x832c('0x47')](_0x541837)[_0x832c('0x24')](handleEntityNotFound(_0x130aa2,null))['then'](respondWithResult(_0x130aa2,null))[_0x832c('0x45')](handleError(_0x130aa2,null));};exports[_0x832c('0x48')]=function(_0x276f34,_0x5a7cf1){return db[_0x832c('0x2b')][_0x832c('0x48')](_0x276f34[_0x832c('0x49')],{})[_0x832c('0x24')](respondWithResult(_0x5a7cf1,0xc9))['catch'](handleError(_0x5a7cf1,null));};exports[_0x832c('0x23')]=function(_0x3154e4,_0x521911){if(_0x3154e4[_0x832c('0x49')]['id']){delete _0x3154e4[_0x832c('0x49')]['id'];}return db[_0x832c('0x2b')][_0x832c('0x47')]({'where':{'id':_0x3154e4['params']['id']}})[_0x832c('0x24')](handleEntityNotFound(_0x521911,null))['then'](saveUpdates(_0x3154e4[_0x832c('0x49')],null))['then'](respondWithResult(_0x521911,null))[_0x832c('0x45')](handleError(_0x521911,null));};exports['destroy']=function(_0x47d2fc,_0x5e4230){return db['OpenchannelTransferReport'][_0x832c('0x47')]({'where':{'id':_0x47d2fc[_0x832c('0x46')]['id']}})[_0x832c('0x24')](handleEntityNotFound(_0x5e4230,null))[_0x832c('0x24')](removeEntity(_0x5e4230,null))[_0x832c('0x45')](handleError(_0x5e4230,null));};exports[_0x832c('0x4a')]=function(_0x33a3c6,_0x5ede23){return db[_0x832c('0x2b')]['describe']()['then'](respondWithResult(_0x5ede23,null))[_0x832c('0x45')](handleError(_0x5ede23,null));}; \ No newline at end of file +var _0x6f3e=['lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','findAll','rows','show','params','rawAttributes','length','includeAll','include','find','catch','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','path','sox','fs-extra'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x6f3e,0x17e));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe6f3('0x0'));var rimraf=require(_0xe6f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe6f3('0x2'));var BPromise=require(_0xe6f3('0x3'));var Mustache=require(_0xe6f3('0x4'));var util=require('util');var path=require(_0xe6f3('0x5'));var sox=require(_0xe6f3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6f3('0x7'));var _=require(_0xe6f3('0x8'));var squel=require(_0xe6f3('0x9'));var crypto=require(_0xe6f3('0xa'));var jsforce=require(_0xe6f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe6f3('0xc'));var querystring=require(_0xe6f3('0xd'));var Papa=require(_0xe6f3('0xe'));var Redis=require(_0xe6f3('0xf'));var authService=require(_0xe6f3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe6f3('0x11'));var hardwareService=require(_0xe6f3('0x12'));var logger=require(_0xe6f3('0x13'))(_0xe6f3('0x14'));var utils=require('../../config/utils');var config=require(_0xe6f3('0x15'));var licenseUtil=require(_0xe6f3('0x16'));var db=require(_0xe6f3('0x17'))['db'];function respondWithStatusCode(_0x52bd90,_0x25ec59){_0x25ec59=_0x25ec59||0xcc;return function(_0x971243){if(_0x971243){return _0x52bd90[_0xe6f3('0x18')](_0x25ec59);}return _0x52bd90['status'](_0x25ec59)[_0xe6f3('0x19')]();};}function respondWithResult(_0x1d87e7,_0x2595f7){_0x2595f7=_0x2595f7||0xc8;return function(_0x1d76d3){if(_0x1d76d3){return _0x1d87e7['status'](_0x2595f7)[_0xe6f3('0x1a')](_0x1d76d3);}};}function respondWithFilteredResult(_0x143099,_0x5f2339){return function(_0x1090d6){if(_0x1090d6){var _0xf98635=typeof _0x5f2339[_0xe6f3('0x1b')]===_0xe6f3('0x1c')&&typeof _0x5f2339['limit']===_0xe6f3('0x1c');var _0x23e1cc=_0x1090d6[_0xe6f3('0x1d')];var _0x3b5a92=_0xf98635?0x0:_0x5f2339[_0xe6f3('0x1b')];var _0x35d4ef=_0xf98635?_0x1090d6[_0xe6f3('0x1d')]:_0x5f2339[_0xe6f3('0x1b')]+_0x5f2339[_0xe6f3('0x1e')];var _0x52dc15;if(_0x35d4ef>=_0x23e1cc){_0x35d4ef=_0x23e1cc;_0x52dc15=0xc8;}else{_0x52dc15=0xce;}_0x143099[_0xe6f3('0x1f')](_0x52dc15);return _0x143099[_0xe6f3('0x20')](_0xe6f3('0x21'),_0x3b5a92+'-'+_0x35d4ef+'/'+_0x23e1cc)['json'](_0x1090d6);}return null;};}function patchUpdates(_0x4d1f0b){return function(_0x245879){try{jsonpatch[_0xe6f3('0x22')](_0x245879,_0x4d1f0b,!![]);}catch(_0x40c4af){return BPromise[_0xe6f3('0x23')](_0x40c4af);}return _0x245879[_0xe6f3('0x24')]();};}function saveUpdates(_0x2033d8,_0x257ffd){return function(_0x1d3e16){if(_0x1d3e16){return _0x1d3e16[_0xe6f3('0x25')](_0x2033d8)['then'](function(_0x5ce7bb){return _0x5ce7bb;});}return null;};}function removeEntity(_0x5ad262,_0x56a2fe){return function(_0x3a599a){if(_0x3a599a){return _0x3a599a[_0xe6f3('0x26')]()[_0xe6f3('0x27')](function(){_0x5ad262[_0xe6f3('0x1f')](0xcc)[_0xe6f3('0x19')]();});}};}function handleEntityNotFound(_0x9d27eb,_0x39343f){return function(_0x2560f9){if(!_0x2560f9){_0x9d27eb[_0xe6f3('0x18')](0x194);}return _0x2560f9;};}function handleError(_0x1dcf4f,_0x37f11a){_0x37f11a=_0x37f11a||0x1f4;return function(_0x357edd){logger[_0xe6f3('0x28')](_0x357edd[_0xe6f3('0x29')]);if(_0x357edd[_0xe6f3('0x2a')]){delete _0x357edd[_0xe6f3('0x2a')];}_0x1dcf4f['status'](_0x37f11a)[_0xe6f3('0x2b')](_0x357edd);};}exports[_0xe6f3('0x2c')]=function(_0x5194c7,_0x44dd91){var _0x551e9b={},_0x567773={},_0xd9bccc={'count':0x0,'rows':[]};var _0x33c7d6=_[_0xe6f3('0x2d')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x5f526d){return{'name':_0x5f526d[_0xe6f3('0x2e')],'type':_0x5f526d[_0xe6f3('0x2f')]['key']};});_0x567773[_0xe6f3('0x30')]=_['map'](_0x33c7d6,_0xe6f3('0x2a'));_0x567773[_0xe6f3('0x31')]=_[_0xe6f3('0x32')](_0x5194c7[_0xe6f3('0x31')]);_0x567773[_0xe6f3('0x33')]=_[_0xe6f3('0x34')](_0x567773[_0xe6f3('0x30')],_0x567773[_0xe6f3('0x31')]);_0x551e9b['attributes']=_[_0xe6f3('0x34')](_0x567773[_0xe6f3('0x30')],qs[_0xe6f3('0x35')](_0x5194c7[_0xe6f3('0x31')][_0xe6f3('0x35')]));_0x551e9b[_0xe6f3('0x36')]=_0x551e9b[_0xe6f3('0x36')]['length']?_0x551e9b[_0xe6f3('0x36')]:_0x567773[_0xe6f3('0x30')];if(!_0x5194c7[_0xe6f3('0x31')]['hasOwnProperty'](_0xe6f3('0x37'))){_0x551e9b[_0xe6f3('0x1e')]=qs['limit'](_0x5194c7['query'][_0xe6f3('0x1e')]);_0x551e9b[_0xe6f3('0x1b')]=qs[_0xe6f3('0x1b')](_0x5194c7[_0xe6f3('0x31')][_0xe6f3('0x1b')]);}_0x551e9b[_0xe6f3('0x38')]=qs['sort'](_0x5194c7[_0xe6f3('0x31')][_0xe6f3('0x39')]);_0x551e9b[_0xe6f3('0x3a')]=qs['filters'](_[_0xe6f3('0x3b')](_0x5194c7[_0xe6f3('0x31')],_0x567773['filters']),_0x33c7d6);if(_0x5194c7[_0xe6f3('0x31')][_0xe6f3('0x3c')]){_0x551e9b[_0xe6f3('0x3a')]=_[_0xe6f3('0x3d')](_0x551e9b[_0xe6f3('0x3a')],{'$or':_[_0xe6f3('0x2d')](_0x33c7d6,function(_0x49d226){if(_0x49d226[_0xe6f3('0x2f')]!==_0xe6f3('0x3e')){var _0x350efa={};_0x350efa[_0x49d226[_0xe6f3('0x2a')]]={'$like':'%'+_0x5194c7['query'][_0xe6f3('0x3c')]+'%'};return _0x350efa;}})});}_0x551e9b=_[_0xe6f3('0x3d')]({},_0x551e9b,_0x5194c7[_0xe6f3('0x3f')]);var _0x5b1b5f={'where':_0x551e9b[_0xe6f3('0x3a')]};return db[_0xe6f3('0x40')][_0xe6f3('0x1d')](_0x5b1b5f)['then'](function(_0x2d1853){_0xd9bccc[_0xe6f3('0x1d')]=_0x2d1853;if(_0x5194c7[_0xe6f3('0x31')]['includeAll']){_0x551e9b['include']=[{'all':!![]}];}return db[_0xe6f3('0x40')][_0xe6f3('0x41')](_0x551e9b);})[_0xe6f3('0x27')](function(_0x3f6384){_0xd9bccc[_0xe6f3('0x42')]=_0x3f6384;return _0xd9bccc;})[_0xe6f3('0x27')](respondWithFilteredResult(_0x44dd91,_0x551e9b))['catch'](handleError(_0x44dd91,null));};exports[_0xe6f3('0x43')]=function(_0xc34c1c,_0x554af6){var _0x204f17={'raw':!![],'where':{'id':_0xc34c1c[_0xe6f3('0x44')]['id']}},_0x554c90={};_0x554c90['model']=_['keys'](db[_0xe6f3('0x40')][_0xe6f3('0x45')]);_0x554c90[_0xe6f3('0x31')]=_['keys'](_0xc34c1c[_0xe6f3('0x31')]);_0x554c90[_0xe6f3('0x33')]=_[_0xe6f3('0x34')](_0x554c90['model'],_0x554c90[_0xe6f3('0x31')]);_0x204f17[_0xe6f3('0x36')]=_['intersection'](_0x554c90[_0xe6f3('0x30')],qs[_0xe6f3('0x35')](_0xc34c1c[_0xe6f3('0x31')]['fields']));_0x204f17[_0xe6f3('0x36')]=_0x204f17['attributes'][_0xe6f3('0x46')]?_0x204f17[_0xe6f3('0x36')]:_0x554c90[_0xe6f3('0x30')];if(_0xc34c1c[_0xe6f3('0x31')][_0xe6f3('0x47')]){_0x204f17[_0xe6f3('0x48')]=[{'all':!![]}];}_0x204f17=_[_0xe6f3('0x3d')]({},_0x204f17,_0xc34c1c[_0xe6f3('0x3f')]);return db[_0xe6f3('0x40')][_0xe6f3('0x49')](_0x204f17)[_0xe6f3('0x27')](handleEntityNotFound(_0x554af6,null))[_0xe6f3('0x27')](respondWithResult(_0x554af6,null))[_0xe6f3('0x4a')](handleError(_0x554af6,null));};exports[_0xe6f3('0x4b')]=function(_0xe5b5d9,_0x5774e8){return db[_0xe6f3('0x40')]['create'](_0xe5b5d9[_0xe6f3('0x4c')],{})[_0xe6f3('0x27')](respondWithResult(_0x5774e8,0xc9))[_0xe6f3('0x4a')](handleError(_0x5774e8,null));};exports[_0xe6f3('0x25')]=function(_0x3fcf9e,_0x2b20d4){if(_0x3fcf9e['body']['id']){delete _0x3fcf9e['body']['id'];}return db['OpenchannelTransferReport'][_0xe6f3('0x49')]({'where':{'id':_0x3fcf9e[_0xe6f3('0x44')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x2b20d4,null))[_0xe6f3('0x27')](saveUpdates(_0x3fcf9e[_0xe6f3('0x4c')],null))[_0xe6f3('0x27')](respondWithResult(_0x2b20d4,null))[_0xe6f3('0x4a')](handleError(_0x2b20d4,null));};exports[_0xe6f3('0x26')]=function(_0x1138a5,_0x365519){return db[_0xe6f3('0x40')][_0xe6f3('0x49')]({'where':{'id':_0x1138a5[_0xe6f3('0x44')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x365519,null))['then'](removeEntity(_0x365519,null))[_0xe6f3('0x4a')](handleError(_0x365519,null));};exports[_0xe6f3('0x4d')]=function(_0x53d311,_0x33f2b0){return db[_0xe6f3('0x40')][_0xe6f3('0x4d')]()[_0xe6f3('0x27')](respondWithResult(_0x33f2b0,null))[_0xe6f3('0x4a')](handleError(_0x33f2b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4c95fcb..9ff593c 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 _0x15a3=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0xd9e622,_0x93d8ca){var _0x19aa69=function(_0x156bee){while(--_0x156bee){_0xd9e622['push'](_0xd9e622['shift']());}};_0x19aa69(++_0x93d8ca);}(_0x15a3,0xf8));var _0x315a=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x15a3[_0x42bb6d];return _0x1db89b;};'use strict';var _=require(_0x315a('0x0'));var util=require('util');var logger=require(_0x315a('0x1'))(_0x315a('0x2'));var moment=require(_0x315a('0x3'));var BPromise=require(_0x315a('0x4'));var rp=require(_0x315a('0x5'));var fs=require('fs');var path=require(_0x315a('0x6'));var rimraf=require('rimraf');var config=require(_0x315a('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x315a('0x8')]=function(_0x50e39f,_0x285a26){return _0x50e39f[_0x315a('0x9')](_0x315a('0xa'),attributes,{'tableName':_0x315a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x315a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c01=['rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','../../config/logger','moment','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3c01,0x1b4));var _0x13c0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3c01[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13c0('0x0'))('api');var moment=require(_0x13c0('0x1'));var BPromise=require('bluebird');var rp=require(_0x13c0('0x2'));var fs=require('fs');var path=require(_0x13c0('0x3'));var rimraf=require(_0x13c0('0x4'));var config=require('../../config/environment');var attributes=require(_0x13c0('0x5'));module[_0x13c0('0x6')]=function(_0xe9e8c5,_0x4c15f5){return _0xe9e8c5[_0x13c0('0x7')](_0x13c0('0x8'),attributes,{'tableName':_0x13c0('0x9'),'paranoid':![],'indexes':[{'name':_0x13c0('0xa'),'fields':[_0x13c0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 969ea62..cabfa49 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 _0x7250=['../../config/environment','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e6d2b,_0x16db67){var _0xb57205=function(_0x1aff41){while(--_0x1aff41){_0x1e6d2b['push'](_0x1e6d2b['shift']());}};_0xb57205(++_0x16db67);}(_0x7250,0x1b1));var _0x0725=function(_0x501e4a,_0x1a04d3){_0x501e4a=_0x501e4a-0x0;var _0x16384d=_0x7250[_0x501e4a];return _0x16384d;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var moment=require('moment');var BPromise=require(_0x0725('0x2'));var rs=require(_0x0725('0x3'));var fs=require('fs');var Redis=require(_0x0725('0x4'));var db=require(_0x0725('0x5'))['db'];var utils=require(_0x0725('0x6'));var logger=require(_0x0725('0x7'))('rpc');var config=require(_0x0725('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0725('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b8653,_0x14a2a7,_0x415a9c){return new BPromise(function(_0x49bed0,_0x2f34e5){return client[_0x0725('0xa')](_0x4b8653,_0x415a9c)[_0x0725('0xb')](function(_0xc12c1e){logger[_0x0725('0xc')](_0x0725('0xd'),_0x14a2a7,_0x0725('0xe'));logger['debug'](_0x0725('0xf'),_0x14a2a7,_0x0725('0xe'),JSON[_0x0725('0x10')](_0xc12c1e));if(_0xc12c1e['error']){if(_0xc12c1e['error'][_0x0725('0x11')]===0x1f4){logger[_0x0725('0x12')](_0x0725('0xd'),_0x14a2a7,_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);return _0x2f34e5(_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);}logger[_0x0725('0x12')](_0x0725('0xd'),_0x14a2a7,_0xc12c1e['error'][_0x0725('0x13')]);return _0x49bed0(_0xc12c1e[_0x0725('0x12')][_0x0725('0x13')]);}else{logger[_0x0725('0xc')](_0x0725('0xd'),_0x14a2a7,_0x0725('0xe'));_0x49bed0(_0xc12c1e['result']['message']);}})[_0x0725('0x14')](function(_0x58777d){logger[_0x0725('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x14a2a7,_0x58777d);_0x2f34e5(_0x58777d);});});} \ No newline at end of file +var _0x089f=['rpc','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0x089f,0x1c7));var _0xf089=function(_0x51538a,_0xe0d0e5){_0x51538a=_0x51538a-0x0;var _0x29f001=_0x089f[_0x51538a];return _0x29f001;};'use strict';var _=require('lodash');var util=require(_0xf089('0x0'));var moment=require(_0xf089('0x1'));var BPromise=require(_0xf089('0x2'));var rs=require(_0xf089('0x3'));var fs=require('fs');var Redis=require(_0xf089('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf089('0x5'));var logger=require(_0xf089('0x6'))(_0xf089('0x7'));var config=require('../../config/environment');var jayson=require(_0xf089('0x8'));var client=jayson[_0xf089('0x9')][_0xf089('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49b977,_0x21a3f7,_0x1987d9){return new BPromise(function(_0x115de6,_0x55e37a){return client[_0xf089('0xb')](_0x49b977,_0x1987d9)[_0xf089('0xc')](function(_0x433553){logger[_0xf089('0xd')](_0xf089('0xe'),_0x21a3f7,_0xf089('0xf'));logger['debug'](_0xf089('0x10'),_0x21a3f7,_0xf089('0xf'),JSON[_0xf089('0x11')](_0x433553));if(_0x433553['error']){if(_0x433553[_0xf089('0x12')][_0xf089('0x13')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x21a3f7,_0x433553[_0xf089('0x12')][_0xf089('0x14')]);return _0x55e37a(_0x433553['error'][_0xf089('0x14')]);}logger[_0xf089('0x12')](_0xf089('0xe'),_0x21a3f7,_0x433553[_0xf089('0x12')]['message']);return _0x115de6(_0x433553[_0xf089('0x12')]['message']);}else{logger[_0xf089('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x21a3f7,_0xf089('0xf'));_0x115de6(_0x433553['result'][_0xf089('0x14')]);}})[_0xf089('0x15')](function(_0x157371){logger[_0xf089('0x12')](_0xf089('0xe'),_0x21a3f7,_0x157371);_0x55e37a(_0x157371);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index d869d51..a252529 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 _0x0dc2=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','delete','destroy','exports'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x0dc2,0x1d1));var _0x20dc=function(_0x267ed1,_0x30b548){_0x267ed1=_0x267ed1-0x0;var _0x3cd023=_0x0dc2[_0x267ed1];return _0x3cd023;};'use strict';var multer=require('multer');var util=require(_0x20dc('0x0'));var path=require('path');var timeout=require(_0x20dc('0x1'));var express=require(_0x20dc('0x2'));var router=express['Router']();var fs_extra=require(_0x20dc('0x3'));var auth=require(_0x20dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x20dc('0x5'));var controller=require('./pause.controller');router[_0x20dc('0x6')]('/',auth[_0x20dc('0x7')](),controller[_0x20dc('0x8')]);router['get'](_0x20dc('0x9'),auth[_0x20dc('0x7')](),controller['show']);router[_0x20dc('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x20dc('0xb')](_0x20dc('0x9'),auth[_0x20dc('0x7')](),controller['update']);router[_0x20dc('0xc')](_0x20dc('0x9'),auth[_0x20dc('0x7')](),controller[_0x20dc('0xd')]);module[_0x20dc('0xe')]=router; \ No newline at end of file +var _0xfaba=['put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','./pause.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x487bed,_0x1e4020){var _0x527bb1=function(_0x2971a6){while(--_0x2971a6){_0x487bed['push'](_0x487bed['shift']());}};_0x527bb1(++_0x1e4020);}(_0xfaba,0x16a));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xafab('0x0'));var util=require(_0xafab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xafab('0x2')]();var fs_extra=require(_0xafab('0x3'));var auth=require(_0xafab('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xafab('0x5'));router[_0xafab('0x6')]('/',auth[_0xafab('0x7')](),controller['index']);router[_0xafab('0x6')](_0xafab('0x8'),auth['isAuthenticated'](),controller[_0xafab('0x9')]);router[_0xafab('0xa')]('/',auth['isAuthenticated'](),controller[_0xafab('0xb')]);router[_0xafab('0xc')](_0xafab('0x8'),auth['isAuthenticated'](),controller[_0xafab('0xd')]);router[_0xafab('0xe')](_0xafab('0x8'),auth[_0xafab('0x7')](),controller[_0xafab('0xf')]);module[_0xafab('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 7a73d42..863a938 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 _0x50c7=['STRING','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x50c7,0xc7));var _0x750c=function(_0xdbf292,_0x334876){_0xdbf292=_0xdbf292-0x0;var _0x45a542=_0x50c7[_0xdbf292];return _0x45a542;};'use strict';var Sequelize=require(_0x750c('0x0'));module[_0x750c('0x1')]={'name':{'type':Sequelize[_0x750c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x750c('0x2')]}}; \ No newline at end of file +var _0x5dae=['sequelize','STRING','name'];(function(_0x212fb0,_0x2c8748){var _0x3690d7=function(_0x4a3bf0){while(--_0x4a3bf0){_0x212fb0['push'](_0x212fb0['shift']());}};_0x3690d7(++_0x2c8748);}(_0x5dae,0x177));var _0xe5da=function(_0x20c71f,_0x2adbaf){_0x20c71f=_0x20c71f-0x0;var _0x27f17b=_0x5dae[_0x20c71f];return _0x27f17b;};'use strict';var Sequelize=require(_0xe5da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe5da('0x1')],'unique':_0xe5da('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe5da('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 37224d6..dcf073d 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 _0x7f08=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','then','destroy','Pauses','UserProfileResource','sendStatus','stack','name','send','index','map','Pause','fieldName','type','key','query','filters','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','model','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xd1214,_0x5ee273){var _0x1dac33=function(_0x1e5755){while(--_0x1e5755){_0xd1214['push'](_0xd1214['shift']());}};_0x1dac33(++_0x5ee273);}(_0x7f08,0x147));var _0x87f0=function(_0x3c8ddd,_0x3facdc){_0x3c8ddd=_0x3c8ddd-0x0;var _0x218c21=_0x7f08[_0x3c8ddd];return _0x218c21;};'use strict';var emlformat=require(_0x87f0('0x0'));var rimraf=require(_0x87f0('0x1'));var zipdir=require(_0x87f0('0x2'));var jsonpatch=require(_0x87f0('0x3'));var rp=require(_0x87f0('0x4'));var moment=require(_0x87f0('0x5'));var BPromise=require(_0x87f0('0x6'));var Mustache=require(_0x87f0('0x7'));var util=require(_0x87f0('0x8'));var path=require(_0x87f0('0x9'));var sox=require(_0x87f0('0xa'));var csv=require('to-csv');var ejs=require(_0x87f0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87f0('0xc'));var squel=require(_0x87f0('0xd'));var crypto=require(_0x87f0('0xe'));var jsforce=require(_0x87f0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x87f0('0x10'));var querystring=require(_0x87f0('0x11'));var Papa=require(_0x87f0('0x12'));var Redis=require(_0x87f0('0x13'));var authService=require(_0x87f0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x87f0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87f0('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x87f0('0x17'));var licenseUtil=require(_0x87f0('0x18'));var db=require(_0x87f0('0x19'))['db'];function respondWithStatusCode(_0x5927f6,_0x4fbf97){_0x4fbf97=_0x4fbf97||0xcc;return function(_0x75d16e){if(_0x75d16e){return _0x5927f6['sendStatus'](_0x4fbf97);}return _0x5927f6[_0x87f0('0x1a')](_0x4fbf97)[_0x87f0('0x1b')]();};}function respondWithResult(_0x15cbd2,_0x50311b){_0x50311b=_0x50311b||0xc8;return function(_0x495afb){if(_0x495afb){return _0x15cbd2[_0x87f0('0x1a')](_0x50311b)[_0x87f0('0x1c')](_0x495afb);}};}function respondWithFilteredResult(_0x50684b,_0x1d8ef1){return function(_0x114cf7){if(_0x114cf7){var _0x4a983b=typeof _0x1d8ef1['offset']==='undefined'&&typeof _0x1d8ef1[_0x87f0('0x1d')]===_0x87f0('0x1e');var _0xb29366=_0x114cf7[_0x87f0('0x1f')];var _0x3d71b6=_0x4a983b?0x0:_0x1d8ef1[_0x87f0('0x20')];var _0x35de54=_0x4a983b?_0x114cf7[_0x87f0('0x1f')]:_0x1d8ef1[_0x87f0('0x20')]+_0x1d8ef1['limit'];var _0x5157af;if(_0x35de54>=_0xb29366){_0x35de54=_0xb29366;_0x5157af=0xc8;}else{_0x5157af=0xce;}_0x50684b['status'](_0x5157af);return _0x50684b[_0x87f0('0x21')](_0x87f0('0x22'),_0x3d71b6+'-'+_0x35de54+'/'+_0xb29366)[_0x87f0('0x1c')](_0x114cf7);}return null;};}function patchUpdates(_0x515c7c){return function(_0x3132){try{jsonpatch['apply'](_0x3132,_0x515c7c,!![]);}catch(_0x2d29b7){return BPromise[_0x87f0('0x23')](_0x2d29b7);}return _0x3132['save']();};}function saveUpdates(_0x140a1b,_0x3200f7){return function(_0x310093){if(_0x310093){return _0x310093[_0x87f0('0x24')](_0x140a1b)[_0x87f0('0x25')](function(_0x577e80){return _0x577e80;});}return null;};}function removeEntity(_0x537ebb,_0x2967b6){return function(_0x261412){if(_0x261412){return _0x261412[_0x87f0('0x26')]()[_0x87f0('0x25')](function(){var _0x1f402f=_0x261412['get']({'plain':!![]});var _0x5d2446=_0x87f0('0x27');return db[_0x87f0('0x28')][_0x87f0('0x26')]({'where':{'type':_0x5d2446,'resourceId':_0x1f402f['id']}})[_0x87f0('0x25')](function(){return _0x261412;});})['then'](function(){_0x537ebb[_0x87f0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf8e85,_0x3dbff1){return function(_0x1e3685){if(!_0x1e3685){_0xcf8e85[_0x87f0('0x29')](0x194);}return _0x1e3685;};}function handleError(_0x1f3000,_0x30fb86){_0x30fb86=_0x30fb86||0x1f4;return function(_0x7ba809){logger['error'](_0x7ba809[_0x87f0('0x2a')]);if(_0x7ba809['name']){delete _0x7ba809[_0x87f0('0x2b')];}_0x1f3000[_0x87f0('0x1a')](_0x30fb86)[_0x87f0('0x2c')](_0x7ba809);};}exports[_0x87f0('0x2d')]=function(_0x32e23c,_0x10af9d){var _0x143cf0={},_0x1bf42f={},_0x169793={'count':0x0,'rows':[]};var _0x17f7c4=_[_0x87f0('0x2e')](db[_0x87f0('0x2f')]['rawAttributes'],function(_0x489089){return{'name':_0x489089[_0x87f0('0x30')],'type':_0x489089[_0x87f0('0x31')][_0x87f0('0x32')]};});_0x1bf42f['model']=_[_0x87f0('0x2e')](_0x17f7c4,'name');_0x1bf42f[_0x87f0('0x33')]=_['keys'](_0x32e23c[_0x87f0('0x33')]);_0x1bf42f[_0x87f0('0x34')]=_['intersection'](_0x1bf42f['model'],_0x1bf42f[_0x87f0('0x33')]);_0x143cf0[_0x87f0('0x35')]=_['intersection'](_0x1bf42f['model'],qs['fields'](_0x32e23c[_0x87f0('0x33')][_0x87f0('0x36')]));_0x143cf0[_0x87f0('0x35')]=_0x143cf0[_0x87f0('0x35')]['length']?_0x143cf0[_0x87f0('0x35')]:_0x1bf42f['model'];if(!_0x32e23c[_0x87f0('0x33')]['hasOwnProperty'](_0x87f0('0x37'))){_0x143cf0['limit']=qs[_0x87f0('0x1d')](_0x32e23c[_0x87f0('0x33')][_0x87f0('0x1d')]);_0x143cf0[_0x87f0('0x20')]=qs[_0x87f0('0x20')](_0x32e23c['query']['offset']);}_0x143cf0[_0x87f0('0x38')]=qs[_0x87f0('0x39')](_0x32e23c[_0x87f0('0x33')][_0x87f0('0x39')]);_0x143cf0['where']=qs['filters'](_[_0x87f0('0x3a')](_0x32e23c[_0x87f0('0x33')],_0x1bf42f[_0x87f0('0x34')]),_0x17f7c4);if(_0x32e23c[_0x87f0('0x33')][_0x87f0('0x3b')]){_0x143cf0[_0x87f0('0x3c')]=_[_0x87f0('0x3d')](_0x143cf0[_0x87f0('0x3c')],{'$or':_[_0x87f0('0x2e')](_0x17f7c4,function(_0x2f416f){if(_0x2f416f[_0x87f0('0x31')]!==_0x87f0('0x3e')){var _0x51a15e={};_0x51a15e[_0x2f416f[_0x87f0('0x2b')]]={'$like':'%'+_0x32e23c[_0x87f0('0x33')]['filter']+'%'};return _0x51a15e;}})});}_0x143cf0=_[_0x87f0('0x3d')]({},_0x143cf0,_0x32e23c[_0x87f0('0x3f')]);var _0x20bdcc={'where':_0x143cf0[_0x87f0('0x3c')]};return db[_0x87f0('0x2f')][_0x87f0('0x1f')](_0x20bdcc)[_0x87f0('0x25')](function(_0x438149){_0x169793['count']=_0x438149;if(_0x32e23c[_0x87f0('0x33')][_0x87f0('0x40')]){_0x143cf0[_0x87f0('0x41')]=[{'all':!![]}];}return db[_0x87f0('0x2f')][_0x87f0('0x42')](_0x143cf0);})[_0x87f0('0x25')](function(_0x3c9c6f){_0x169793[_0x87f0('0x43')]=_0x3c9c6f;return _0x169793;})[_0x87f0('0x25')](respondWithFilteredResult(_0x10af9d,_0x143cf0))[_0x87f0('0x44')](handleError(_0x10af9d,null));};exports[_0x87f0('0x45')]=function(_0x35fbac,_0x294dbf){var _0x179c31={'raw':!![],'where':{'id':_0x35fbac[_0x87f0('0x46')]['id']}},_0x515413={};_0x515413['model']=_[_0x87f0('0x47')](db[_0x87f0('0x2f')][_0x87f0('0x48')]);_0x515413['query']=_[_0x87f0('0x47')](_0x35fbac[_0x87f0('0x33')]);_0x515413[_0x87f0('0x34')]=_[_0x87f0('0x49')](_0x515413[_0x87f0('0x4a')],_0x515413['query']);_0x179c31[_0x87f0('0x35')]=_['intersection'](_0x515413[_0x87f0('0x4a')],qs[_0x87f0('0x36')](_0x35fbac['query'][_0x87f0('0x36')]));_0x179c31[_0x87f0('0x35')]=_0x179c31[_0x87f0('0x35')][_0x87f0('0x4b')]?_0x179c31['attributes']:_0x515413['model'];if(_0x35fbac[_0x87f0('0x33')][_0x87f0('0x40')]){_0x179c31[_0x87f0('0x41')]=[{'all':!![]}];}_0x179c31=_['merge']({},_0x179c31,_0x35fbac['options']);return db[_0x87f0('0x2f')]['find'](_0x179c31)[_0x87f0('0x25')](handleEntityNotFound(_0x294dbf,null))[_0x87f0('0x25')](respondWithResult(_0x294dbf,null))[_0x87f0('0x44')](handleError(_0x294dbf,null));};exports[_0x87f0('0x4c')]=function(_0x7b775,_0x2078b3){return db[_0x87f0('0x2f')]['create'](_0x7b775[_0x87f0('0x4d')],{})[_0x87f0('0x25')](function(_0x56ae40){var _0x4d0b29=_0x7b775[_0x87f0('0x4e')][_0x87f0('0x4f')]({'plain':!![]});if(!_0x4d0b29)throw new Error(_0x87f0('0x50'));if(_0x4d0b29[_0x87f0('0x51')]==='user'){var _0x10ec16=_0x56ae40[_0x87f0('0x4f')]({'plain':!![]});var _0x5db8cd='Pauses';return db[_0x87f0('0x52')]['find']({'where':{'name':_0x5db8cd,'userProfileId':_0x4d0b29[_0x87f0('0x53')]},'raw':!![]})[_0x87f0('0x25')](function(_0x206bb4){if(_0x206bb4&&_0x206bb4[_0x87f0('0x54')]===0x0){return db[_0x87f0('0x28')][_0x87f0('0x4c')]({'name':_0x10ec16[_0x87f0('0x2b')],'resourceId':_0x10ec16['id'],'type':_0x206bb4[_0x87f0('0x2b')],'sectionId':_0x206bb4['id']},{})[_0x87f0('0x25')](function(){return _0x56ae40;});}else{return _0x56ae40;}})[_0x87f0('0x44')](function(_0x159954){logger[_0x87f0('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x159954);throw _0x159954;});}return _0x56ae40;})[_0x87f0('0x25')](respondWithResult(_0x2078b3,0xc9))[_0x87f0('0x44')](handleError(_0x2078b3,null));};exports[_0x87f0('0x24')]=function(_0x57b90b,_0x278ac5){if(_0x57b90b[_0x87f0('0x4d')]['id']){delete _0x57b90b[_0x87f0('0x4d')]['id'];}return db[_0x87f0('0x2f')][_0x87f0('0x56')]({'where':{'id':_0x57b90b['params']['id']}})[_0x87f0('0x25')](handleEntityNotFound(_0x278ac5,null))[_0x87f0('0x25')](saveUpdates(_0x57b90b[_0x87f0('0x4d')],null))[_0x87f0('0x25')](respondWithResult(_0x278ac5,null))['catch'](handleError(_0x278ac5,null));};exports[_0x87f0('0x26')]=function(_0x565e95,_0x48d41c){return db[_0x87f0('0x2f')]['find']({'where':{'id':_0x565e95['params']['id']}})[_0x87f0('0x25')](handleEntityNotFound(_0x48d41c,null))[_0x87f0('0x25')](removeEntity(_0x48d41c,null))[_0x87f0('0x44')](handleError(_0x48d41c,null));}; \ No newline at end of file +var _0xb049=['path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','Pause','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','update','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xb049,0xeb));var _0x9b04=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb049[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x9b04('0x0'));var rimraf=require(_0x9b04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b04('0x2'));var rp=require(_0x9b04('0x3'));var moment=require(_0x9b04('0x4'));var BPromise=require(_0x9b04('0x5'));var Mustache=require(_0x9b04('0x6'));var util=require(_0x9b04('0x7'));var path=require(_0x9b04('0x8'));var sox=require(_0x9b04('0x9'));var csv=require(_0x9b04('0xa'));var ejs=require(_0x9b04('0xb'));var fs=require('fs');var fs_extra=require(_0x9b04('0xc'));var _=require('lodash');var squel=require(_0x9b04('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9b04('0xe'));var toCsv=require(_0x9b04('0xa'));var querystring=require('querystring');var Papa=require(_0x9b04('0xf'));var Redis=require(_0x9b04('0x10'));var authService=require(_0x9b04('0x11'));var qs=require(_0x9b04('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b04('0x13'));var logger=require(_0x9b04('0x14'))(_0x9b04('0x15'));var utils=require(_0x9b04('0x16'));var config=require(_0x9b04('0x17'));var licenseUtil=require(_0x9b04('0x18'));var db=require(_0x9b04('0x19'))['db'];function respondWithStatusCode(_0x1daef3,_0x3a083c){_0x3a083c=_0x3a083c||0xcc;return function(_0x1c9fdf){if(_0x1c9fdf){return _0x1daef3['sendStatus'](_0x3a083c);}return _0x1daef3['status'](_0x3a083c)[_0x9b04('0x1a')]();};}function respondWithResult(_0x1cff45,_0x9ae7da){_0x9ae7da=_0x9ae7da||0xc8;return function(_0xfda2ba){if(_0xfda2ba){return _0x1cff45[_0x9b04('0x1b')](_0x9ae7da)[_0x9b04('0x1c')](_0xfda2ba);}};}function respondWithFilteredResult(_0x55e446,_0x1e08b1){return function(_0x1190c9){if(_0x1190c9){var _0xe5ff22=typeof _0x1e08b1['offset']==='undefined'&&typeof _0x1e08b1[_0x9b04('0x1d')]===_0x9b04('0x1e');var _0x124177=_0x1190c9[_0x9b04('0x1f')];var _0x1b7bb9=_0xe5ff22?0x0:_0x1e08b1[_0x9b04('0x20')];var _0x4ef15e=_0xe5ff22?_0x1190c9['count']:_0x1e08b1[_0x9b04('0x20')]+_0x1e08b1[_0x9b04('0x1d')];var _0x1561c5;if(_0x4ef15e>=_0x124177){_0x4ef15e=_0x124177;_0x1561c5=0xc8;}else{_0x1561c5=0xce;}_0x55e446[_0x9b04('0x1b')](_0x1561c5);return _0x55e446[_0x9b04('0x21')](_0x9b04('0x22'),_0x1b7bb9+'-'+_0x4ef15e+'/'+_0x124177)[_0x9b04('0x1c')](_0x1190c9);}return null;};}function patchUpdates(_0x2b68fb){return function(_0x1039b7){try{jsonpatch[_0x9b04('0x23')](_0x1039b7,_0x2b68fb,!![]);}catch(_0x296991){return BPromise[_0x9b04('0x24')](_0x296991);}return _0x1039b7['save']();};}function saveUpdates(_0x43796f,_0x4f761b){return function(_0x219135){if(_0x219135){return _0x219135['update'](_0x43796f)['then'](function(_0x148dc2){return _0x148dc2;});}return null;};}function removeEntity(_0x33ebba,_0x3e23b6){return function(_0x115ac3){if(_0x115ac3){return _0x115ac3['destroy']()[_0x9b04('0x25')](function(){var _0x497705=_0x115ac3['get']({'plain':!![]});var _0x5249b5='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x5249b5,'resourceId':_0x497705['id']}})['then'](function(){return _0x115ac3;});})[_0x9b04('0x25')](function(){_0x33ebba['status'](0xcc)[_0x9b04('0x1a')]();});}};}function handleEntityNotFound(_0x4b4679,_0x224d09){return function(_0x29fddc){if(!_0x29fddc){_0x4b4679[_0x9b04('0x26')](0x194);}return _0x29fddc;};}function handleError(_0x2c080f,_0x1b6eb8){_0x1b6eb8=_0x1b6eb8||0x1f4;return function(_0x2124b){logger[_0x9b04('0x27')](_0x2124b[_0x9b04('0x28')]);if(_0x2124b[_0x9b04('0x29')]){delete _0x2124b[_0x9b04('0x29')];}_0x2c080f[_0x9b04('0x1b')](_0x1b6eb8)['send'](_0x2124b);};}exports['index']=function(_0x2ea882,_0x26accf){var _0x388fef={},_0x43c221={},_0x38c58d={'count':0x0,'rows':[]};var _0x40a6b1=_['map'](db[_0x9b04('0x2a')][_0x9b04('0x2b')],function(_0x20ade4){return{'name':_0x20ade4[_0x9b04('0x2c')],'type':_0x20ade4['type'][_0x9b04('0x2d')]};});_0x43c221['model']=_[_0x9b04('0x2e')](_0x40a6b1,'name');_0x43c221[_0x9b04('0x2f')]=_[_0x9b04('0x30')](_0x2ea882[_0x9b04('0x2f')]);_0x43c221[_0x9b04('0x31')]=_[_0x9b04('0x32')](_0x43c221[_0x9b04('0x33')],_0x43c221['query']);_0x388fef[_0x9b04('0x34')]=_[_0x9b04('0x32')](_0x43c221[_0x9b04('0x33')],qs['fields'](_0x2ea882[_0x9b04('0x2f')][_0x9b04('0x35')]));_0x388fef[_0x9b04('0x34')]=_0x388fef[_0x9b04('0x34')][_0x9b04('0x36')]?_0x388fef[_0x9b04('0x34')]:_0x43c221[_0x9b04('0x33')];if(!_0x2ea882[_0x9b04('0x2f')][_0x9b04('0x37')](_0x9b04('0x38'))){_0x388fef['limit']=qs['limit'](_0x2ea882['query'][_0x9b04('0x1d')]);_0x388fef[_0x9b04('0x20')]=qs['offset'](_0x2ea882[_0x9b04('0x2f')][_0x9b04('0x20')]);}_0x388fef[_0x9b04('0x39')]=qs[_0x9b04('0x3a')](_0x2ea882[_0x9b04('0x2f')]['sort']);_0x388fef[_0x9b04('0x3b')]=qs[_0x9b04('0x31')](_['pick'](_0x2ea882[_0x9b04('0x2f')],_0x43c221[_0x9b04('0x31')]),_0x40a6b1);if(_0x2ea882[_0x9b04('0x2f')]['filter']){_0x388fef[_0x9b04('0x3b')]=_[_0x9b04('0x3c')](_0x388fef[_0x9b04('0x3b')],{'$or':_['map'](_0x40a6b1,function(_0x43516b){if(_0x43516b[_0x9b04('0x3d')]!==_0x9b04('0x3e')){var _0x1afce0={};_0x1afce0[_0x43516b[_0x9b04('0x29')]]={'$like':'%'+_0x2ea882[_0x9b04('0x2f')][_0x9b04('0x3f')]+'%'};return _0x1afce0;}})});}_0x388fef=_[_0x9b04('0x3c')]({},_0x388fef,_0x2ea882[_0x9b04('0x40')]);var _0x2fd310={'where':_0x388fef[_0x9b04('0x3b')]};return db[_0x9b04('0x2a')][_0x9b04('0x1f')](_0x2fd310)[_0x9b04('0x25')](function(_0x560865){_0x38c58d[_0x9b04('0x1f')]=_0x560865;if(_0x2ea882['query'][_0x9b04('0x41')]){_0x388fef[_0x9b04('0x42')]=[{'all':!![]}];}return db[_0x9b04('0x2a')][_0x9b04('0x43')](_0x388fef);})['then'](function(_0x3fafcc){_0x38c58d['rows']=_0x3fafcc;return _0x38c58d;})['then'](respondWithFilteredResult(_0x26accf,_0x388fef))[_0x9b04('0x44')](handleError(_0x26accf,null));};exports['show']=function(_0x15c879,_0x593171){var _0x4231c6={'raw':!![],'where':{'id':_0x15c879[_0x9b04('0x45')]['id']}},_0x3bdd8e={};_0x3bdd8e[_0x9b04('0x33')]=_[_0x9b04('0x30')](db['Pause'][_0x9b04('0x2b')]);_0x3bdd8e[_0x9b04('0x2f')]=_[_0x9b04('0x30')](_0x15c879['query']);_0x3bdd8e[_0x9b04('0x31')]=_[_0x9b04('0x32')](_0x3bdd8e[_0x9b04('0x33')],_0x3bdd8e[_0x9b04('0x2f')]);_0x4231c6[_0x9b04('0x34')]=_[_0x9b04('0x32')](_0x3bdd8e[_0x9b04('0x33')],qs[_0x9b04('0x35')](_0x15c879[_0x9b04('0x2f')][_0x9b04('0x35')]));_0x4231c6[_0x9b04('0x34')]=_0x4231c6[_0x9b04('0x34')]['length']?_0x4231c6[_0x9b04('0x34')]:_0x3bdd8e['model'];if(_0x15c879[_0x9b04('0x2f')][_0x9b04('0x41')]){_0x4231c6[_0x9b04('0x42')]=[{'all':!![]}];}_0x4231c6=_[_0x9b04('0x3c')]({},_0x4231c6,_0x15c879[_0x9b04('0x40')]);return db[_0x9b04('0x2a')]['find'](_0x4231c6)[_0x9b04('0x25')](handleEntityNotFound(_0x593171,null))[_0x9b04('0x25')](respondWithResult(_0x593171,null))[_0x9b04('0x44')](handleError(_0x593171,null));};exports[_0x9b04('0x46')]=function(_0x113082,_0x37a879){return db['Pause'][_0x9b04('0x46')](_0x113082['body'],{})[_0x9b04('0x25')](function(_0x251b57){var _0xd35816=_0x113082[_0x9b04('0x47')]['get']({'plain':!![]});if(!_0xd35816)throw new Error(_0x9b04('0x48'));if(_0xd35816[_0x9b04('0x49')]==='user'){var _0x58268c=_0x251b57[_0x9b04('0x4a')]({'plain':!![]});var _0x4a9290='Pauses';return db['UserProfileSection'][_0x9b04('0x4b')]({'where':{'name':_0x4a9290,'userProfileId':_0xd35816[_0x9b04('0x4c')]},'raw':!![]})['then'](function(_0x30f330){if(_0x30f330&&_0x30f330[_0x9b04('0x4d')]===0x0){return db['UserProfileResource'][_0x9b04('0x46')]({'name':_0x58268c[_0x9b04('0x29')],'resourceId':_0x58268c['id'],'type':_0x30f330[_0x9b04('0x29')],'sectionId':_0x30f330['id']},{})[_0x9b04('0x25')](function(){return _0x251b57;});}else{return _0x251b57;}})['catch'](function(_0x4eccf1){logger[_0x9b04('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4eccf1);throw _0x4eccf1;});}return _0x251b57;})['then'](respondWithResult(_0x37a879,0xc9))[_0x9b04('0x44')](handleError(_0x37a879,null));};exports[_0x9b04('0x4e')]=function(_0x4d828f,_0x47eb1f){if(_0x4d828f['body']['id']){delete _0x4d828f['body']['id'];}return db[_0x9b04('0x2a')][_0x9b04('0x4b')]({'where':{'id':_0x4d828f['params']['id']}})[_0x9b04('0x25')](handleEntityNotFound(_0x47eb1f,null))[_0x9b04('0x25')](saveUpdates(_0x4d828f[_0x9b04('0x4f')],null))[_0x9b04('0x25')](respondWithResult(_0x47eb1f,null))['catch'](handleError(_0x47eb1f,null));};exports[_0x9b04('0x50')]=function(_0x94d2f8,_0x434bd8){return db['Pause'][_0x9b04('0x4b')]({'where':{'id':_0x94d2f8[_0x9b04('0x45')]['id']}})[_0x9b04('0x25')](handleEntityNotFound(_0x434bd8,null))[_0x9b04('0x25')](removeEntity(_0x434bd8,null))[_0x9b04('0x44')](handleError(_0x434bd8,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index c90036d..0295bfc 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 _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa7,0x178));var _0x76aa=function(_0x59a4fa,_0x5f0014){_0x59a4fa=_0x59a4fa-0x0;var _0x4552e0=_0x6aa7[_0x59a4fa];return _0x4552e0;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x389e1c,_0x2d766c){var _0x1792bd=function(_0x3724bf){while(--_0x3724bf){_0x389e1c['push'](_0x389e1c['shift']());}};_0x1792bd(++_0x2d766c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x7817be,_0x42af90){_0x7817be=_0x7817be-0x0;var _0x353205=_0x1cb9[_0x7817be];return _0x353205;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'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 cb88112..3d260ab 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x13ed2c,_0x990334){var _0x2f9562=function(_0x355f92){while(--_0x355f92){_0x13ed2c['push'](_0x13ed2c['shift']());}};_0x2f9562(++_0x990334);}(_0xb10b,0x12a));var _0xbb10=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xb10b[_0x3132e8];return _0x43eb8c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x27e06e,_0x57004f){var _0x41a1d3=function(_0x5bcdb1){while(--_0x5bcdb1){_0x27e06e['push'](_0x27e06e['shift']());}};_0x41a1d3(++_0x57004f);}(_0xb10b,0x12a));var _0xbb10=function(_0x394c4c,_0x201031){_0x394c4c=_0x394c4c-0x0;var _0x5bfa5a=_0xb10b[_0x394c4c];return _0x5bfa5a;};'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 a9e07f2..89bcead 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 _0x72b1=['./plugin.controller','get','isAuthenticated','index','/webhook','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6bb4fa,_0x4603e3){var _0x4cd4d0=function(_0x194f14){while(--_0x194f14){_0x6bb4fa['push'](_0x6bb4fa['shift']());}};_0x4cd4d0(++_0x4603e3);}(_0x72b1,0x16e));var _0x172b=function(_0x2dc997,_0xb3857f){_0x2dc997=_0x2dc997-0x0;var _0x26f739=_0x72b1[_0x2dc997];return _0x26f739;};'use strict';var multer=require(_0x172b('0x0'));var util=require('util');var path=require(_0x172b('0x1'));var timeout=require(_0x172b('0x2'));var express=require(_0x172b('0x3'));var router=express[_0x172b('0x4')]();var fs_extra=require(_0x172b('0x5'));var auth=require(_0x172b('0x6'));var interaction=require(_0x172b('0x7'));var config=require('../../config/environment');var controller=require(_0x172b('0x8'));router[_0x172b('0x9')]('/',auth[_0x172b('0xa')](),controller[_0x172b('0xb')]);router['get'](_0x172b('0xc'),controller['webhookGet']);router[_0x172b('0x9')]('/:id',auth[_0x172b('0xa')](),controller[_0x172b('0xd')]);router[_0x172b('0x9')](_0x172b('0xe'),auth['isAuthenticated'](),controller[_0x172b('0xf')]);var upload=multer({'storage':multer[_0x172b('0x10')]({'destination':function(_0x28aaad,_0x161c7c,_0xa4ada9){_0xa4ada9(null,path[_0x172b('0x11')](config[_0x172b('0x12')],'server/files/plugins'));},'filename':function(_0x13d285,_0x82727f,_0xdf832e){_0x82727f['originalname']=_0x82727f[_0x172b('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xdf832e(null,util[_0x172b('0x14')](_0x172b('0x15'),path['basename'](_0x82727f[_0x172b('0x13')],path[_0x172b('0x16')](_0x82727f[_0x172b('0x13')])),Date[_0x172b('0x17')](),path['extname'](_0x82727f['originalname'])));}})});router[_0x172b('0x18')]('/',upload[_0x172b('0x19')](_0x172b('0x1a')),controller[_0x172b('0x1b')]);router['post']('/webhook',controller[_0x172b('0x1c')]);router[_0x172b('0x1d')](_0x172b('0x1e'),auth[_0x172b('0xa')](),controller[_0x172b('0x1f')]);router['delete'](_0x172b('0x1e'),auth[_0x172b('0xa')](),controller[_0x172b('0x20')]);module[_0x172b('0x21')]=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x54bb83,_0x48f73f){var _0x33abd6=function(_0x4d903a){while(--_0x4d903a){_0x54bb83['push'](_0x54bb83['shift']());}};_0x33abd6(++_0x48f73f);}(_0x579c,0xda));var _0xc579=function(_0x38cd04,_0x2f578b){_0x38cd04=_0x38cd04-0x0;var _0x1741c0=_0x579c[_0x38cd04];return _0x1741c0;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3b82ca5..2f2dbaa 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 _0x4ce7=['exports','STRING','html','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x1c7e62,_0x1fdb74){var _0x44f89b=function(_0x54898c){while(--_0x54898c){_0x1c7e62['push'](_0x1c7e62['shift']());}};_0x44f89b(++_0x1fdb74);}(_0x4ce7,0x1c2));var _0x74ce=function(_0x54b1bb,_0x34b999){_0x54b1bb=_0x54b1bb-0x0;var _0x3d0610=_0x4ce7[_0x54b1bb];return _0x3d0610;};'use strict';var Sequelize=require(_0x74ce('0x0'));module[_0x74ce('0x1')]={'name':{'type':Sequelize[_0x74ce('0x2')]},'type':{'type':Sequelize['ENUM'](_0x74ce('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x74ce('0x2')],'comment':_0x74ce('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x74ce('0x5')},'sidebar':{'type':Sequelize[_0x74ce('0x6')](_0x74ce('0x7'),'agentOnly',_0x74ce('0x8'),_0x74ce('0x9')),'defaultValue':_0x74ce('0x8'),'comment':_0x74ce('0xa')},'icon':{'type':Sequelize[_0x74ce('0x2')]},'adminUrl':{'type':Sequelize[_0x74ce('0x2')]},'agentUrl':{'type':Sequelize[_0x74ce('0x2')]},'scriptName':{'type':Sequelize[_0x74ce('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0f0d=['adminOnly','agentOnly','always','sequelize','ENUM','html','TEXT','STRING','BOOLEAN'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0x0f0d,0x1b3));var _0xd0f0=function(_0x412b2a,_0x11fb8a){_0x412b2a=_0x412b2a-0x0;var _0x5872e3=_0x0f0d[_0x412b2a];return _0x5872e3;};'use strict';var Sequelize=require(_0xd0f0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd0f0('0x1')](_0xd0f0('0x2'),'script')},'description':{'type':Sequelize[_0xd0f0('0x3')]},'version':{'type':Sequelize[_0xd0f0('0x3')]},'path':{'type':Sequelize[_0xd0f0('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xd0f0('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xd0f0('0x1')](_0xd0f0('0x6'),_0xd0f0('0x7'),_0xd0f0('0x8'),'never'),'defaultValue':_0xd0f0('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xd0f0('0x4')]},'adminUrl':{'type':Sequelize[_0xd0f0('0x4')]},'agentUrl':{'type':Sequelize[_0xd0f0('0x4')]},'scriptName':{'type':Sequelize[_0xd0f0('0x4')]},'scriptPath':{'type':Sequelize[_0xd0f0('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index cf9f835..bc1234d 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 _0x0aff=['%s%s','headers','content-length','content-type','endsWith','statusCode','http://localhost:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','Plugins','UserProfileResource','end','name','send','index','map','Plugin','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','download','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method'];(function(_0x8e815a,_0x5248b6){var _0x4c01fa=function(_0x3965e3){while(--_0x3965e3){_0x8e815a['push'](_0x8e815a['shift']());}};_0x4c01fa(++_0x5248b6);}(_0x0aff,0xb5));var _0xf0af=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x0aff[_0x4d337e];return _0x247963;};'use strict';var emlformat=require(_0xf0af('0x0'));var rimraf=require(_0xf0af('0x1'));var zipdir=require(_0xf0af('0x2'));var jsonpatch=require(_0xf0af('0x3'));var rp=require(_0xf0af('0x4'));var moment=require(_0xf0af('0x5'));var BPromise=require(_0xf0af('0x6'));var Mustache=require(_0xf0af('0x7'));var util=require('util');var path=require(_0xf0af('0x8'));var sox=require(_0xf0af('0x9'));var csv=require(_0xf0af('0xa'));var ejs=require(_0xf0af('0xb'));var fs=require('fs');var fs_extra=require(_0xf0af('0xc'));var _=require(_0xf0af('0xd'));var squel=require(_0xf0af('0xe'));var crypto=require(_0xf0af('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf0af('0x10'));var toCsv=require(_0xf0af('0xa'));var querystring=require(_0xf0af('0x11'));var Papa=require(_0xf0af('0x12'));var extract=require(_0xf0af('0x13'));var rimraf=require(_0xf0af('0x1'));var archiver=require(_0xf0af('0x14'));var Redis=require(_0xf0af('0x15'));var authService=require(_0xf0af('0x16'));var qs=require(_0xf0af('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0af('0x18'));var logger=require(_0xf0af('0x19'))('api');var utils=require(_0xf0af('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xf0af('0x1b'));var db=require(_0xf0af('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xf0af('0x1d'),'port':0x18eb});var socket=require(_0xf0af('0x1e'))(new Redis(config[_0xf0af('0x1f')]));require(_0xf0af('0x20'))[_0xf0af('0x21')](socket);function respondWithStatusCode(_0x30f076,_0x303cb3){_0x303cb3=_0x303cb3||0xcc;return function(_0x5946a2){if(_0x5946a2){return _0x30f076[_0xf0af('0x22')](_0x303cb3);}return _0x30f076[_0xf0af('0x23')](_0x303cb3)['end']();};}function respondWithResult(_0xa2878,_0x340700){_0x340700=_0x340700||0xc8;return function(_0xfeff0){if(_0xfeff0){return _0xa2878[_0xf0af('0x23')](_0x340700)[_0xf0af('0x24')](_0xfeff0);}};}function respondWithFilteredResult(_0xe64431,_0x3d318f){return function(_0xdb9874){if(_0xdb9874){var _0x594362=typeof _0x3d318f[_0xf0af('0x25')]===_0xf0af('0x26')&&typeof _0x3d318f[_0xf0af('0x27')]===_0xf0af('0x26');var _0x363f9b=_0xdb9874[_0xf0af('0x28')];var _0xcadd70=_0x594362?0x0:_0x3d318f[_0xf0af('0x25')];var _0x25fb55=_0x594362?_0xdb9874['count']:_0x3d318f[_0xf0af('0x25')]+_0x3d318f[_0xf0af('0x27')];var _0x387098;if(_0x25fb55>=_0x363f9b){_0x25fb55=_0x363f9b;_0x387098=0xc8;}else{_0x387098=0xce;}_0xe64431['status'](_0x387098);return _0xe64431[_0xf0af('0x29')](_0xf0af('0x2a'),_0xcadd70+'-'+_0x25fb55+'/'+_0x363f9b)[_0xf0af('0x24')](_0xdb9874);}return null;};}function patchUpdates(_0x2b4021){return function(_0x51e183){try{jsonpatch[_0xf0af('0x2b')](_0x51e183,_0x2b4021,!![]);}catch(_0x2fce17){return BPromise[_0xf0af('0x2c')](_0x2fce17);}return _0x51e183['save']();};}function saveUpdates(_0x48620b,_0x2aca4f){return function(_0x528e96){if(_0x528e96){return _0x528e96[_0xf0af('0x2d')](_0x48620b)['then'](function(_0x4f47bd){return _0x4f47bd;});}return null;};}function removeEntity(_0x5d1349,_0x8854e8){return function(_0x2eb398){if(_0x2eb398){return _0x2eb398[_0xf0af('0x2e')]()[_0xf0af('0x2f')](function(){var _0x112f07=_0x2eb398['get']({'plain':!![]});var _0x34ecec=_0xf0af('0x30');return db[_0xf0af('0x31')][_0xf0af('0x2e')]({'where':{'type':_0x34ecec,'resourceId':_0x112f07['id']}})[_0xf0af('0x2f')](function(){return _0x2eb398;});})['then'](function(){_0x5d1349[_0xf0af('0x23')](0xcc)[_0xf0af('0x32')]();});}};}function handleEntityNotFound(_0x5c9813,_0x293ad6){return function(_0x2286f1){if(!_0x2286f1){_0x5c9813[_0xf0af('0x22')](0x194);}return _0x2286f1;};}function handleError(_0x14aee1,_0x387c41){_0x387c41=_0x387c41||0x1f4;return function(_0x43103e){logger['error'](_0x43103e['stack']);if(_0x43103e[_0xf0af('0x33')]){delete _0x43103e[_0xf0af('0x33')];}_0x14aee1[_0xf0af('0x23')](_0x387c41)[_0xf0af('0x34')](_0x43103e);};}exports[_0xf0af('0x35')]=function(_0x510fab,_0x1fdcf7){var _0x44befe={},_0x1bc8d8={},_0x557d49={'count':0x0,'rows':[]};var _0x36d0a8=_[_0xf0af('0x36')](db[_0xf0af('0x37')]['rawAttributes'],function(_0x24db3c){return{'name':_0x24db3c['fieldName'],'type':_0x24db3c[_0xf0af('0x38')][_0xf0af('0x39')]};});_0x1bc8d8['model']=_['map'](_0x36d0a8,'name');_0x1bc8d8[_0xf0af('0x3a')]=_['keys'](_0x510fab['query']);_0x1bc8d8[_0xf0af('0x3b')]=_['intersection'](_0x1bc8d8[_0xf0af('0x3c')],_0x1bc8d8['query']);_0x44befe[_0xf0af('0x3d')]=_[_0xf0af('0x3e')](_0x1bc8d8[_0xf0af('0x3c')],qs['fields'](_0x510fab[_0xf0af('0x3a')]['fields']));_0x44befe['attributes']=_0x44befe['attributes'][_0xf0af('0x3f')]?_0x44befe['attributes']:_0x1bc8d8['model'];if(!_0x510fab[_0xf0af('0x3a')][_0xf0af('0x40')](_0xf0af('0x41'))){_0x44befe[_0xf0af('0x27')]=qs[_0xf0af('0x27')](_0x510fab[_0xf0af('0x3a')][_0xf0af('0x27')]);_0x44befe[_0xf0af('0x25')]=qs['offset'](_0x510fab[_0xf0af('0x3a')][_0xf0af('0x25')]);}_0x44befe['order']=qs['sort'](_0x510fab[_0xf0af('0x3a')][_0xf0af('0x42')]);_0x44befe[_0xf0af('0x43')]=qs[_0xf0af('0x3b')](_[_0xf0af('0x44')](_0x510fab[_0xf0af('0x3a')],_0x1bc8d8[_0xf0af('0x3b')]),_0x36d0a8);if(_0x510fab[_0xf0af('0x3a')][_0xf0af('0x45')]){_0x44befe[_0xf0af('0x43')]=_[_0xf0af('0x46')](_0x44befe[_0xf0af('0x43')],{'$or':_[_0xf0af('0x36')](_0x36d0a8,function(_0x37a048){if(_0x37a048[_0xf0af('0x38')]!==_0xf0af('0x47')){var _0x597e96={};_0x597e96[_0x37a048[_0xf0af('0x33')]]={'$like':'%'+_0x510fab[_0xf0af('0x3a')][_0xf0af('0x45')]+'%'};return _0x597e96;}})});}_0x44befe=_[_0xf0af('0x46')]({},_0x44befe,_0x510fab[_0xf0af('0x48')]);var _0x16f3d3={'where':_0x44befe[_0xf0af('0x43')]};return db[_0xf0af('0x37')]['count'](_0x16f3d3)[_0xf0af('0x2f')](function(_0x189df0){_0x557d49['count']=_0x189df0;if(_0x510fab[_0xf0af('0x3a')][_0xf0af('0x49')]){_0x44befe[_0xf0af('0x4a')]=[{'all':!![]}];}return db[_0xf0af('0x37')][_0xf0af('0x4b')](_0x44befe);})['then'](function(_0x10cd9e){_0x557d49['rows']=_0x10cd9e;return _0x557d49;})[_0xf0af('0x2f')](respondWithFilteredResult(_0x1fdcf7,_0x44befe))[_0xf0af('0x4c')](handleError(_0x1fdcf7,null));};exports[_0xf0af('0x4d')]=function(_0x1c442e,_0x77485d){var _0x18491f={'raw':!![],'where':{'id':_0x1c442e[_0xf0af('0x4e')]['id']}},_0x418d24={};_0x418d24['model']=_[_0xf0af('0x4f')](db[_0xf0af('0x37')][_0xf0af('0x50')]);_0x418d24[_0xf0af('0x3a')]=_[_0xf0af('0x4f')](_0x1c442e[_0xf0af('0x3a')]);_0x418d24[_0xf0af('0x3b')]=_['intersection'](_0x418d24[_0xf0af('0x3c')],_0x418d24[_0xf0af('0x3a')]);_0x18491f[_0xf0af('0x3d')]=_['intersection'](_0x418d24[_0xf0af('0x3c')],qs[_0xf0af('0x51')](_0x1c442e['query'][_0xf0af('0x51')]));_0x18491f[_0xf0af('0x3d')]=_0x18491f[_0xf0af('0x3d')][_0xf0af('0x3f')]?_0x18491f[_0xf0af('0x3d')]:_0x418d24[_0xf0af('0x3c')];if(_0x1c442e[_0xf0af('0x3a')][_0xf0af('0x49')]){_0x18491f[_0xf0af('0x4a')]=[{'all':!![]}];}_0x18491f=_[_0xf0af('0x46')]({},_0x18491f,_0x1c442e[_0xf0af('0x48')]);return db[_0xf0af('0x37')]['find'](_0x18491f)[_0xf0af('0x2f')](handleEntityNotFound(_0x77485d,null))[_0xf0af('0x2f')](respondWithResult(_0x77485d,null))[_0xf0af('0x4c')](handleError(_0x77485d,null));};exports[_0xf0af('0x52')]=function(_0x36da24,_0x59a927,_0xa4c88){return db['Plugin'][_0xf0af('0x53')]({'where':{'id':_0x36da24['params']['id']},'attributes':[_0xf0af('0x33'),_0xf0af('0x8')],'raw':!![]})[_0xf0af('0x2f')](handleEntityNotFound(_0x59a927,null))[_0xf0af('0x2f')](function(_0x278fe1){if(_0x278fe1){var _0x5dfcea=path['join'](config[_0xf0af('0x54')],_0xf0af('0x55'),util[_0xf0af('0x56')](_0xf0af('0x57'),path[_0xf0af('0x58')](_0x278fe1['path'])));var _0x5e349a=fs[_0xf0af('0x59')](_0x5dfcea);var _0x14c840=archiver(_0xf0af('0x5a'),{'zlib':{'level':0x9}});_0x14c840['on'](_0xf0af('0x5b'),function(_0x452a26){if(_0x452a26[_0xf0af('0x5c')]===_0xf0af('0x5d')){logger[_0xf0af('0x5e')](_0x452a26);}else{throw new db[(_0xf0af('0x5f'))][(_0xf0af('0x60'))](_0xf0af('0x61'));}});_0x14c840['on']('error',function(_0x305df4){throw new db['Sequelize'][(_0xf0af('0x60'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x14c840[_0xf0af('0x62')](_0x5e349a);_0x14c840[_0xf0af('0x63')](_0xf0af('0x64'),{'cwd':path[_0xf0af('0x65')](config[_0xf0af('0x54')],_0xf0af('0x55'),path[_0xf0af('0x66')](_0x278fe1['path'])),'ignore':[path['join'](path['basename'](_0x278fe1[_0xf0af('0x8')]),_0xf0af('0x67')),path[_0xf0af('0x65')](path[_0xf0af('0x58')](_0x278fe1['path']),_0xf0af('0x68'))],'nodir':!![]})[_0xf0af('0x69')]();_0x5e349a['on'](_0xf0af('0x6a'),function(){if(!fs[_0xf0af('0x6b')](_0x5dfcea)){throw new db[(_0xf0af('0x5f'))]['Error'](_0xf0af('0x6c'));}return _0x59a927[_0xf0af('0x52')](_0x5dfcea,util[_0xf0af('0x56')](_0xf0af('0x57'),path[_0xf0af('0x58')](_0x278fe1[_0xf0af('0x8')])),function(_0x4c5a96){if(_0x4c5a96){throw new db[(_0xf0af('0x5f'))]['Error'](_0xf0af('0x6d'));}fs[_0xf0af('0x6e')](_0x5dfcea);logger[_0xf0af('0x6f')](_0xf0af('0x70'));logger[_0xf0af('0x6f')](_0xf0af('0x71'));});});}return null;})[_0xf0af('0x4c')](handleError(_0x59a927,null));};exports[_0xf0af('0x72')]=function(_0x231695,_0x3982ae,_0x3b38c4){var _0x1bf43c=path['basename'](_0x231695[_0xf0af('0x73')][_0xf0af('0x74')],path[_0xf0af('0x75')](_0x231695['file'][_0xf0af('0x74')]));var _0x56ee8a=path[_0xf0af('0x65')](config['root'],_0xf0af('0x55'),_0x231695['file'][_0xf0af('0x74')]);var _0x3d0448=path[_0xf0af('0x65')](config[_0xf0af('0x54')],_0xf0af('0x55'),_0x1bf43c);logger[_0xf0af('0x6f')]('Plugin\x20upload\x20filepath:\x20%s',_0x56ee8a);logger[_0xf0af('0x6f')](_0xf0af('0x76'),_0x3d0448);try{fs['chmodSync'](_0x56ee8a,parseInt('0777',0x8));extract(_0x56ee8a,{'dir':_0x3d0448},function(_0x360c5e){if(_0x360c5e){logger[_0xf0af('0x5e')](_0x360c5e);handleError(_0x360c5e,!![]);};var _0x51b834=fs[_0xf0af('0x77')](_0x3d0448);if(_0x51b834['length']>0x1){removeReferences(_0x56ee8a,_0x3d0448);logger[_0xf0af('0x5e')](_0xf0af('0x78'));return _0x3b38c4(new Error(_0xf0af('0x78')));}var _0x25b7c5=fs[_0xf0af('0x79')](path[_0xf0af('0x65')](_0x3d0448,_0x51b834[0x0]));if(_0x25b7c5[_0xf0af('0x7a')]()){removeReferences(_0x56ee8a,_0x3d0448);logger['error'](_0xf0af('0x78'));return _0x3b38c4(new Error('Invalid\x20plugin\x20structure'));}if(_0x25b7c5[_0xf0af('0x7b')]()){var _0x3e5770=fs[_0xf0af('0x77')](path[_0xf0af('0x65')](_0x3d0448,_0x51b834[0x0]));if(_0x3e5770[_0xf0af('0x3f')]===0x0){removeReferences(_0x56ee8a,_0x3d0448);logger['error'](_0xf0af('0x78'));return _0x3b38c4(new Error(_0xf0af('0x78')));}var _0x24e8c4=_0x3e5770[_0xf0af('0x7c')](function(_0x402b2b){return _0x402b2b==='manifest.json';});if(!_0x24e8c4){return _0x3b38c4(new Error('Plugin\x20manifest\x20missing'));}var _0x140fac=fs[_0xf0af('0x7d')](path[_0xf0af('0x65')](_0x3d0448,_0x51b834[0x0],_0xf0af('0x7e')));var _0x4db305=JSON['parse'](_0x140fac);if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x33')]){return _0x3b38c4(new Error(_0xf0af('0x7f')));}if(_0xf0af('0x26')==typeof _0x4db305['type']){return _0x3b38c4(new Error(_0xf0af('0x80')));}if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x81')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x4db305[_0xf0af('0x82')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4db305[_0xf0af('0x38')]==='html'){if(_0xf0af('0x26')==typeof _0x4db305['parameters'][_0xf0af('0x83')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x84')]&&_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x85')]){return _0x3b38c4(new Error(_0xf0af('0x86')));}}else if(_0x4db305[_0xf0af('0x38')]===_0xf0af('0x87')){if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x88')]){return _0x3b38c4(new Error(_0xf0af('0x89')));}if(_0xf0af('0x26')==typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x8a')]){return _0x3b38c4(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3b38c4(new Error(_0xf0af('0x8b')));}var _0x1ce5d9=_0x4db305['name'];var _0x1d691f=_0x4db305[_0xf0af('0x8c')];var _0xbccd12=_0x4db305[_0xf0af('0x38')];var _0x16a674=_0x4db305[_0xf0af('0x8d')]?_0x4db305[_0xf0af('0x8d')]:_0xf0af('0x8e');var _0x15fa10=_0x4db305[_0xf0af('0x8f')]?_0x4db305[_0xf0af('0x8f')]:_0xf0af('0x90');var _0x19e711='';var _0x416bf2='';var _0x589928='';var _0x583a13='';var _0x2aceb4=_0x4db305[_0xf0af('0x81')];if(_0xbccd12==='html'){if(_0xf0af('0x26')!=typeof _0x4db305[_0xf0af('0x82')]['views'][_0xf0af('0x84')]){var _0x1e1e7c=_0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x1e1e7c)){_0x19e711=path[_0xf0af('0x65')](_0xf0af('0x92'),_0x1bf43c,_0x51b834[0x0],_0x1e1e7c);}else{_0x19e711=_0x1e1e7c;}}else{logger[_0xf0af('0x6f')](_0xf0af('0x93'));}if(_0xf0af('0x26')!=typeof _0x4db305[_0xf0af('0x82')][_0xf0af('0x83')][_0xf0af('0x85')]){var _0x18254a=_0x4db305['parameters'][_0xf0af('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x18254a)){_0x416bf2=path[_0xf0af('0x65')]('plugins',_0x1bf43c,_0x51b834[0x0],_0x18254a);}else{_0x416bf2=_0x18254a;}}else{logger[_0xf0af('0x6f')](_0xf0af('0x94'));}}else if(_0xbccd12==='script'){_0x589928=_0x4db305['parameters']['scriptName'];_0x583a13=_0x4db305['parameters']['scriptPath'];if(_0xf0af('0x26')!=typeof _0x4db305[_0xf0af('0x82')]['views']){if(_0xf0af('0x26')!=typeof _0x4db305['parameters'][_0xf0af('0x83')][_0xf0af('0x84')]){var _0x1e1e7c=_0x4db305[_0xf0af('0x82')][_0xf0af('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x1e1e7c)){_0x19e711=path[_0xf0af('0x65')](_0xf0af('0x92'),_0x1bf43c,_0x51b834[0x0],_0x1e1e7c);}else{_0x19e711=_0x1e1e7c;}}if(_0xf0af('0x26')!=typeof _0x4db305['parameters'][_0xf0af('0x83')][_0xf0af('0x85')]){var _0x18254a=_0x4db305[_0xf0af('0x82')][_0xf0af('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf0af('0x91')](_0x18254a)){_0x416bf2=path[_0xf0af('0x65')](_0xf0af('0x92'),_0x1bf43c,_0x51b834[0x0],_0x18254a);}else{_0x416bf2=_0x18254a;}}}}var _0x4e9680={'name':_0x1ce5d9,'description':_0x1d691f,'path':path[_0xf0af('0x65')](_0x1bf43c,_0x51b834[0x0]),'type':_0xbccd12,'sidebar':_0x16a674,'icon':_0x15fa10,'adminUrl':_0x19e711,'agentUrl':_0x416bf2,'scriptName':_0x589928,'scriptPath':_0x583a13,'version':_0x2aceb4};removeReferences(_0x56ee8a,null);return db[_0xf0af('0x37')][_0xf0af('0x95')](_0x4e9680)[_0xf0af('0x2f')](function(_0x599afc){var _0x2c4d37={'role':_0x231695[_0xf0af('0x96')][_0xf0af('0x97')],'userProfileId':_0x231695[_0xf0af('0x96')][_0xf0af('0x98')]};if(!_0x2c4d37)throw new Error(_0xf0af('0x99'));if(_0x2c4d37['role']===_0xf0af('0x9a')){var _0x35c5e4=_0x599afc[_0xf0af('0x9b')]({'plain':!![]});return db[_0xf0af('0x9c')]['find']({'where':{'name':_0xf0af('0x30'),'userProfileId':_0x2c4d37[_0xf0af('0x98')]},'raw':!![]})['then'](function(_0x596589){if(_0x596589&&_0x596589[_0xf0af('0x9d')]===0x0){return db['UserProfileResource'][_0xf0af('0x95')]({'name':_0x35c5e4['name'],'resourceId':_0x35c5e4['id'],'type':_0x596589[_0xf0af('0x33')],'sectionId':_0x596589['id']},{})['then'](function(){return _0x599afc;});}else{return _0x599afc;}})[_0xf0af('0x4c')](function(_0x291a7e){logger[_0xf0af('0x5e')](_0xf0af('0x9e'),_0x291a7e);throw _0x291a7e;});}return _0x599afc;})[_0xf0af('0x2f')](respondWithResult(_0x3982ae,null))[_0xf0af('0x4c')](handleError(_0x3982ae,null));}});}catch(_0x39d080){_0x3982ae[_0xf0af('0x23')](0x1f4)[_0xf0af('0x34')](_0x39d080);}};function removeReferences(_0x33377c,_0x12ef02){try{if(_0x33377c){fs[_0xf0af('0x6e')](_0x33377c);logger['info']('Zip\x20archive\x20removed');}if(_0x12ef02){rimraf(_0x12ef02,function(){});logger[_0xf0af('0x6f')]('Extracted\x20folder\x20removed');}}catch(_0x2f0282){logger['error'](_0x2f0282);}}exports[_0xf0af('0x2d')]=function(_0x1ece34,_0x1c5b46,_0x18da66){return db[_0xf0af('0x37')][_0xf0af('0x53')]({'where':{'id':_0x1ece34[_0xf0af('0x4e')]['id']}})[_0xf0af('0x2f')](handleEntityNotFound(_0x1c5b46,null))['then'](saveUpdates(_0x1ece34[_0xf0af('0x96')],null))['then'](respondWithResult(_0x1c5b46,null))['catch'](handleError(_0x1c5b46,null));};exports['delete']=function(_0x17e0ae,_0x51dfda,_0x4fe755){return db[_0xf0af('0x37')][_0xf0af('0x53')]({'where':{'id':_0x17e0ae[_0xf0af('0x4e')]['id']}})['then'](function(_0x477fd6){if(_0x477fd6){return _0x477fd6[_0xf0af('0x2e')]();}})[_0xf0af('0x2f')](function(_0x403d48){rimraf(path[_0xf0af('0x65')](config[_0xf0af('0x54')],_0xf0af('0x55'),path[_0xf0af('0x66')](_0x403d48[_0xf0af('0x8')])),function(){});return _0x403d48;})[_0xf0af('0x2f')](handleEntityNotFound(_0x51dfda,null))['then'](respondWithStatusCode(_0x51dfda,null))[_0xf0af('0x4c')](handleError(_0x51dfda,null));};exports[_0xf0af('0x9f')]=function(_0x216a21,_0x48e5c8,_0x879c55){return BPromise[_0xf0af('0xa0')]()[_0xf0af('0x2f')](function(){if(!_0x216a21['query'][_0xf0af('0x8')]){throw new Error(_0xf0af('0xa1'));}if(!_0x216a21['query'][_0xf0af('0xa2')]){throw new Error(_0xf0af('0xa3'));}var _0x335527=_0x216a21[_0xf0af('0x3a')][_0xf0af('0xa4')]?_0x216a21['query'][_0xf0af('0xa4')]+':'+_0x216a21['query'][_0xf0af('0xa2')]:'http://localhost:'+_0x216a21['query'][_0xf0af('0xa2')];var _0x2e5e93=_0x216a21[_0xf0af('0x3a')][_0xf0af('0x24')]?_0x216a21[_0xf0af('0x3a')][_0xf0af('0x24')]:!![];var _0x4379e5=_0x216a21['query'][_0xf0af('0xa5')]?_0x216a21[_0xf0af('0x3a')]['encoding']:null;var _0x5c6926={'method':_0x216a21[_0xf0af('0xa6')],'uri':util[_0xf0af('0x56')](_0xf0af('0xa7'),_0x335527,_0x216a21[_0xf0af('0x3a')][_0xf0af('0x8')]),'json':_0x2e5e93,'resolveWithFullResponse':!![],'encoding':_0x4379e5,'qs':_0x216a21[_0xf0af('0x3a')]};if(_0x216a21[_0xf0af('0xa8')]){_0x5c6926[_0xf0af('0xa8')]=_0x216a21[_0xf0af('0xa8')];if(_0x5c6926['headers']['content-length']){delete _0x5c6926[_0xf0af('0xa8')][_0xf0af('0xa9')];}}if(_0x5c6926['headers']['content-type']){delete _0x5c6926[_0xf0af('0xa8')][_0xf0af('0xaa')];}return rp(_0x5c6926);})[_0xf0af('0x2f')](function(_0x54990f){if(_0x54990f){_0x48e5c8[_0xf0af('0x29')](_0x54990f[_0xf0af('0xa8')]);logger[_0xf0af('0x6f')](_0x54990f['body']);if(_[_0xf0af('0xab')](_0x216a21['query'][_0xf0af('0x8')],'download')&&_0x54990f['statusCode']==0x1f4){return _0x48e5c8[_0xf0af('0x22')](_0x54990f['statusCode']);}else{return _0x48e5c8[_0xf0af('0x23')](_0x54990f[_0xf0af('0xac')])[_0xf0af('0x34')](_0x54990f[_0xf0af('0x96')]);}}else{return _0x48e5c8['sendStatus'](0xc8);}})[_0xf0af('0x4c')](handleError(_0x48e5c8,null));};exports['webhookPost']=function(_0x9b23c3,_0x13cbcc,_0x1accd3){return BPromise['resolve']()[_0xf0af('0x2f')](function(){if(!_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0x8')]){throw new Error(_0xf0af('0xa1'));}if(!_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa2')]){throw new Error(_0xf0af('0xa3'));}var _0x58390a=_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa4')]?_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa4')]+':'+_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa2')]:_0xf0af('0xad')+_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa2')];var _0x2a1bbf=_0x9b23c3[_0xf0af('0x3a')]['json']?_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0x24')]:!![];var _0x513a90=_0x9b23c3[_0xf0af('0x3a')][_0xf0af('0xa5')]?_0x9b23c3['query'][_0xf0af('0xa5')]:null;var _0xb053f1={'method':_0x9b23c3['method'],'uri':util[_0xf0af('0x56')]('%s%s',_0x58390a,_0x9b23c3['query']['path']),'json':_0x2a1bbf,'resolveWithFullResponse':!![],'encoding':_0x513a90,'body':_0x9b23c3[_0xf0af('0x96')]};if(_0x9b23c3[_0xf0af('0xa8')]){_0xb053f1[_0xf0af('0xa8')]=_0x9b23c3[_0xf0af('0xa8')];if(_0xb053f1[_0xf0af('0xa8')][_0xf0af('0xa9')]){delete _0xb053f1['headers'][_0xf0af('0xa9')];}}if(_0xb053f1[_0xf0af('0xa8')][_0xf0af('0xaa')]){delete _0xb053f1[_0xf0af('0xa8')][_0xf0af('0xaa')];}return rp(_0xb053f1);})[_0xf0af('0x2f')](function(_0x3fcc15){if(_0x3fcc15){_0x13cbcc['set'](_0x3fcc15[_0xf0af('0xa8')]);logger[_0xf0af('0x6f')](_0x3fcc15[_0xf0af('0x96')]);return _0x13cbcc[_0xf0af('0x23')](_0x3fcc15[_0xf0af('0xac')])[_0xf0af('0x34')](_0x3fcc15[_0xf0af('0x96')]);}else{return _0x13cbcc[_0xf0af('0x22')](0xc8);}})[_0xf0af('0x4c')](handleError(_0x13cbcc,null));}; \ No newline at end of file +var _0x9d23=['count','offset','Content-Range','reject','save','then','destroy','Plugins','UserProfileResource','stack','name','index','map','Plugin','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','download','params','join','root','server/files/plugins','%s.zip','basename','createWriteStream','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Sequelize','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','limit'];(function(_0x509b86,_0x42e6f7){var _0x221b69=function(_0x345c8a){while(--_0x345c8a){_0x509b86['push'](_0x509b86['shift']());}};_0x221b69(++_0x42e6f7);}(_0x9d23,0x8c));var _0x39d2=function(_0x6488d3,_0x26b700){_0x6488d3=_0x6488d3-0x0;var _0x5af840=_0x9d23[_0x6488d3];return _0x5af840;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39d2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x39d2('0x1'));var rp=require(_0x39d2('0x2'));var moment=require(_0x39d2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x39d2('0x4'));var util=require(_0x39d2('0x5'));var path=require(_0x39d2('0x6'));var sox=require(_0x39d2('0x7'));var csv=require(_0x39d2('0x8'));var ejs=require(_0x39d2('0x9'));var fs=require('fs');var fs_extra=require(_0x39d2('0xa'));var _=require(_0x39d2('0xb'));var squel=require(_0x39d2('0xc'));var crypto=require(_0x39d2('0xd'));var jsforce=require(_0x39d2('0xe'));var deskjs=require(_0x39d2('0xf'));var toCsv=require(_0x39d2('0x8'));var querystring=require(_0x39d2('0x10'));var Papa=require(_0x39d2('0x11'));var extract=require(_0x39d2('0x12'));var rimraf=require('rimraf');var archiver=require(_0x39d2('0x13'));var Redis=require(_0x39d2('0x14'));var authService=require(_0x39d2('0x15'));var qs=require(_0x39d2('0x16'));var as=require(_0x39d2('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39d2('0x18'))(_0x39d2('0x19'));var utils=require(_0x39d2('0x1a'));var config=require(_0x39d2('0x1b'));var licenseUtil=require(_0x39d2('0x1c'));var db=require(_0x39d2('0x1d'))['db'];config[_0x39d2('0x1e')]=_[_0x39d2('0x1f')](config[_0x39d2('0x1e')],{'host':_0x39d2('0x20'),'port':0x18eb});var socket=require(_0x39d2('0x21'))(new Redis(config['redis']));require(_0x39d2('0x22'))[_0x39d2('0x23')](socket);function respondWithStatusCode(_0x5de7b7,_0x42224f){_0x42224f=_0x42224f||0xcc;return function(_0x3f5b0c){if(_0x3f5b0c){return _0x5de7b7[_0x39d2('0x24')](_0x42224f);}return _0x5de7b7[_0x39d2('0x25')](_0x42224f)[_0x39d2('0x26')]();};}function respondWithResult(_0x172927,_0x5bce91){_0x5bce91=_0x5bce91||0xc8;return function(_0x446362){if(_0x446362){return _0x172927['status'](_0x5bce91)[_0x39d2('0x27')](_0x446362);}};}function respondWithFilteredResult(_0x572178,_0x13fa80){return function(_0x423e18){if(_0x423e18){var _0x514d84=typeof _0x13fa80['offset']===_0x39d2('0x28')&&typeof _0x13fa80[_0x39d2('0x29')]===_0x39d2('0x28');var _0xe157a8=_0x423e18[_0x39d2('0x2a')];var _0x4afdb0=_0x514d84?0x0:_0x13fa80[_0x39d2('0x2b')];var _0x3efe80=_0x514d84?_0x423e18[_0x39d2('0x2a')]:_0x13fa80[_0x39d2('0x2b')]+_0x13fa80[_0x39d2('0x29')];var _0x575ecb;if(_0x3efe80>=_0xe157a8){_0x3efe80=_0xe157a8;_0x575ecb=0xc8;}else{_0x575ecb=0xce;}_0x572178[_0x39d2('0x25')](_0x575ecb);return _0x572178['set'](_0x39d2('0x2c'),_0x4afdb0+'-'+_0x3efe80+'/'+_0xe157a8)[_0x39d2('0x27')](_0x423e18);}return null;};}function patchUpdates(_0x2da20e){return function(_0xacc404){try{jsonpatch['apply'](_0xacc404,_0x2da20e,!![]);}catch(_0x1602e1){return BPromise[_0x39d2('0x2d')](_0x1602e1);}return _0xacc404[_0x39d2('0x2e')]();};}function saveUpdates(_0x1ef54b,_0x1236cc){return function(_0x4220dd){if(_0x4220dd){return _0x4220dd['update'](_0x1ef54b)[_0x39d2('0x2f')](function(_0x2582ca){return _0x2582ca;});}return null;};}function removeEntity(_0x4ac247,_0x3797fc){return function(_0xd66515){if(_0xd66515){return _0xd66515[_0x39d2('0x30')]()[_0x39d2('0x2f')](function(){var _0x5a9d3f=_0xd66515['get']({'plain':!![]});var _0x106d70=_0x39d2('0x31');return db[_0x39d2('0x32')][_0x39d2('0x30')]({'where':{'type':_0x106d70,'resourceId':_0x5a9d3f['id']}})[_0x39d2('0x2f')](function(){return _0xd66515;});})[_0x39d2('0x2f')](function(){_0x4ac247['status'](0xcc)[_0x39d2('0x26')]();});}};}function handleEntityNotFound(_0x2043f8,_0x3c276a){return function(_0x29520a){if(!_0x29520a){_0x2043f8[_0x39d2('0x24')](0x194);}return _0x29520a;};}function handleError(_0x4d1dca,_0x2f3311){_0x2f3311=_0x2f3311||0x1f4;return function(_0x3e4543){logger['error'](_0x3e4543[_0x39d2('0x33')]);if(_0x3e4543['name']){delete _0x3e4543[_0x39d2('0x34')];}_0x4d1dca['status'](_0x2f3311)['send'](_0x3e4543);};}exports[_0x39d2('0x35')]=function(_0x3de4bb,_0x282716){var _0x38cba3={},_0x4c22ea={},_0x56c25e={'count':0x0,'rows':[]};var _0x486544=_[_0x39d2('0x36')](db[_0x39d2('0x37')][_0x39d2('0x38')],function(_0x594979){return{'name':_0x594979[_0x39d2('0x39')],'type':_0x594979[_0x39d2('0x3a')]['key']};});_0x4c22ea[_0x39d2('0x3b')]=_[_0x39d2('0x36')](_0x486544,_0x39d2('0x34'));_0x4c22ea['query']=_[_0x39d2('0x3c')](_0x3de4bb[_0x39d2('0x3d')]);_0x4c22ea[_0x39d2('0x3e')]=_[_0x39d2('0x3f')](_0x4c22ea[_0x39d2('0x3b')],_0x4c22ea[_0x39d2('0x3d')]);_0x38cba3[_0x39d2('0x40')]=_[_0x39d2('0x3f')](_0x4c22ea[_0x39d2('0x3b')],qs['fields'](_0x3de4bb[_0x39d2('0x3d')][_0x39d2('0x41')]));_0x38cba3['attributes']=_0x38cba3['attributes']['length']?_0x38cba3[_0x39d2('0x40')]:_0x4c22ea[_0x39d2('0x3b')];if(!_0x3de4bb[_0x39d2('0x3d')]['hasOwnProperty'](_0x39d2('0x42'))){_0x38cba3[_0x39d2('0x29')]=qs[_0x39d2('0x29')](_0x3de4bb['query']['limit']);_0x38cba3[_0x39d2('0x2b')]=qs[_0x39d2('0x2b')](_0x3de4bb[_0x39d2('0x3d')][_0x39d2('0x2b')]);}_0x38cba3[_0x39d2('0x43')]=qs['sort'](_0x3de4bb[_0x39d2('0x3d')][_0x39d2('0x44')]);_0x38cba3['where']=qs['filters'](_[_0x39d2('0x45')](_0x3de4bb[_0x39d2('0x3d')],_0x4c22ea[_0x39d2('0x3e')]),_0x486544);if(_0x3de4bb[_0x39d2('0x3d')][_0x39d2('0x46')]){_0x38cba3[_0x39d2('0x47')]=_[_0x39d2('0x48')](_0x38cba3['where'],{'$or':_['map'](_0x486544,function(_0x15a988){if(_0x15a988[_0x39d2('0x3a')]!==_0x39d2('0x49')){var _0x2fee23={};_0x2fee23[_0x15a988[_0x39d2('0x34')]]={'$like':'%'+_0x3de4bb[_0x39d2('0x3d')][_0x39d2('0x46')]+'%'};return _0x2fee23;}})});}_0x38cba3=_[_0x39d2('0x48')]({},_0x38cba3,_0x3de4bb[_0x39d2('0x4a')]);var _0x1db75e={'where':_0x38cba3['where']};return db[_0x39d2('0x37')]['count'](_0x1db75e)['then'](function(_0x541aa0){_0x56c25e[_0x39d2('0x2a')]=_0x541aa0;if(_0x3de4bb[_0x39d2('0x3d')][_0x39d2('0x4b')]){_0x38cba3['include']=[{'all':!![]}];}return db[_0x39d2('0x37')][_0x39d2('0x4c')](_0x38cba3);})[_0x39d2('0x2f')](function(_0x413bca){_0x56c25e[_0x39d2('0x4d')]=_0x413bca;return _0x56c25e;})[_0x39d2('0x2f')](respondWithFilteredResult(_0x282716,_0x38cba3))[_0x39d2('0x4e')](handleError(_0x282716,null));};exports[_0x39d2('0x4f')]=function(_0x23bf7e,_0x4ca9be){var _0x268276={'raw':!![],'where':{'id':_0x23bf7e['params']['id']}},_0xca3033={};_0xca3033[_0x39d2('0x3b')]=_[_0x39d2('0x3c')](db[_0x39d2('0x37')][_0x39d2('0x38')]);_0xca3033['query']=_[_0x39d2('0x3c')](_0x23bf7e['query']);_0xca3033[_0x39d2('0x3e')]=_[_0x39d2('0x3f')](_0xca3033[_0x39d2('0x3b')],_0xca3033[_0x39d2('0x3d')]);_0x268276[_0x39d2('0x40')]=_[_0x39d2('0x3f')](_0xca3033[_0x39d2('0x3b')],qs[_0x39d2('0x41')](_0x23bf7e[_0x39d2('0x3d')][_0x39d2('0x41')]));_0x268276[_0x39d2('0x40')]=_0x268276[_0x39d2('0x40')][_0x39d2('0x50')]?_0x268276[_0x39d2('0x40')]:_0xca3033['model'];if(_0x23bf7e['query']['includeAll']){_0x268276[_0x39d2('0x51')]=[{'all':!![]}];}_0x268276=_[_0x39d2('0x48')]({},_0x268276,_0x23bf7e[_0x39d2('0x4a')]);return db[_0x39d2('0x37')][_0x39d2('0x52')](_0x268276)[_0x39d2('0x2f')](handleEntityNotFound(_0x4ca9be,null))[_0x39d2('0x2f')](respondWithResult(_0x4ca9be,null))[_0x39d2('0x4e')](handleError(_0x4ca9be,null));};exports[_0x39d2('0x53')]=function(_0x1272d2,_0x1194b8,_0x376bee){return db[_0x39d2('0x37')]['find']({'where':{'id':_0x1272d2[_0x39d2('0x54')]['id']},'attributes':[_0x39d2('0x34'),_0x39d2('0x6')],'raw':!![]})[_0x39d2('0x2f')](handleEntityNotFound(_0x1194b8,null))[_0x39d2('0x2f')](function(_0x5bff55){if(_0x5bff55){var _0x4b2c7e=path[_0x39d2('0x55')](config[_0x39d2('0x56')],_0x39d2('0x57'),util['format'](_0x39d2('0x58'),path[_0x39d2('0x59')](_0x5bff55[_0x39d2('0x6')])));var _0x334354=fs[_0x39d2('0x5a')](_0x4b2c7e);var _0x4f5291=archiver('zip',{'zlib':{'level':0x9}});_0x4f5291['on'](_0x39d2('0x5b'),function(_0x35aa55){if(_0x35aa55[_0x39d2('0x5c')]===_0x39d2('0x5d')){logger[_0x39d2('0x5e')](_0x35aa55);}else{throw new db['Sequelize'][(_0x39d2('0x5f'))](_0x39d2('0x60'));}});_0x4f5291['on'](_0x39d2('0x5e'),function(_0x230bda){throw new db['Sequelize'][(_0x39d2('0x5f'))](_0x39d2('0x60'));});_0x4f5291[_0x39d2('0x61')](_0x334354);_0x4f5291[_0x39d2('0x62')](_0x39d2('0x63'),{'cwd':path[_0x39d2('0x55')](config[_0x39d2('0x56')],'server/files/plugins',path['dirname'](_0x5bff55[_0x39d2('0x6')])),'ignore':[path[_0x39d2('0x55')](path['basename'](_0x5bff55['path']),_0x39d2('0x64')),path['join'](path[_0x39d2('0x59')](_0x5bff55[_0x39d2('0x6')]),_0x39d2('0x65'))],'nodir':!![]})[_0x39d2('0x66')]();_0x334354['on'](_0x39d2('0x67'),function(){if(!fs[_0x39d2('0x68')](_0x4b2c7e)){throw new db[(_0x39d2('0x69'))][(_0x39d2('0x5f'))]('Plugin\x20not\x20found');}return _0x1194b8['download'](_0x4b2c7e,util['format'](_0x39d2('0x58'),path[_0x39d2('0x59')](_0x5bff55[_0x39d2('0x6')])),function(_0x56e4cf){if(_0x56e4cf){throw new db['Sequelize'][(_0x39d2('0x5f'))](_0x39d2('0x6a'));}fs[_0x39d2('0x6b')](_0x4b2c7e);logger[_0x39d2('0x6c')](_0x39d2('0x6d'));logger[_0x39d2('0x6c')](_0x39d2('0x6e'));});});}return null;})[_0x39d2('0x4e')](handleError(_0x1194b8,null));};exports[_0x39d2('0x6f')]=function(_0x6d8a5b,_0x284b6c,_0xb6d420){var _0x413310=path[_0x39d2('0x59')](_0x6d8a5b[_0x39d2('0x70')][_0x39d2('0x71')],path[_0x39d2('0x72')](_0x6d8a5b['file'][_0x39d2('0x71')]));var _0x4df98d=path['join'](config[_0x39d2('0x56')],_0x39d2('0x57'),_0x6d8a5b['file'][_0x39d2('0x71')]);var _0x17360f=path['join'](config[_0x39d2('0x56')],_0x39d2('0x57'),_0x413310);logger[_0x39d2('0x6c')](_0x39d2('0x73'),_0x4df98d);logger[_0x39d2('0x6c')](_0x39d2('0x74'),_0x17360f);try{fs['chmodSync'](_0x4df98d,parseInt(_0x39d2('0x75'),0x8));extract(_0x4df98d,{'dir':_0x17360f},function(_0x1af55a){if(_0x1af55a){logger[_0x39d2('0x5e')](_0x1af55a);handleError(_0x1af55a,!![]);};var _0x1eb54d=fs[_0x39d2('0x76')](_0x17360f);if(_0x1eb54d[_0x39d2('0x50')]>0x1){removeReferences(_0x4df98d,_0x17360f);logger[_0x39d2('0x5e')]('Invalid\x20plugin\x20structure');return _0xb6d420(new Error(_0x39d2('0x77')));}var _0x46d1e8=fs[_0x39d2('0x78')](path[_0x39d2('0x55')](_0x17360f,_0x1eb54d[0x0]));if(_0x46d1e8[_0x39d2('0x79')]()){removeReferences(_0x4df98d,_0x17360f);logger[_0x39d2('0x5e')](_0x39d2('0x77'));return _0xb6d420(new Error(_0x39d2('0x77')));}if(_0x46d1e8[_0x39d2('0x7a')]()){var _0x2bb9fb=fs[_0x39d2('0x76')](path[_0x39d2('0x55')](_0x17360f,_0x1eb54d[0x0]));if(_0x2bb9fb[_0x39d2('0x50')]===0x0){removeReferences(_0x4df98d,_0x17360f);logger[_0x39d2('0x5e')](_0x39d2('0x77'));return _0xb6d420(new Error(_0x39d2('0x77')));}var _0x42404e=_0x2bb9fb[_0x39d2('0x7b')](function(_0x176164){return _0x176164==='manifest.json';});if(!_0x42404e){return _0xb6d420(new Error(_0x39d2('0x7c')));}var _0x25192d=fs[_0x39d2('0x7d')](path[_0x39d2('0x55')](_0x17360f,_0x1eb54d[0x0],_0x39d2('0x7e')));var _0xa68d9c=JSON['parse'](_0x25192d);if(_0x39d2('0x28')==typeof _0xa68d9c[_0x39d2('0x34')]){return _0xb6d420(new Error(_0x39d2('0x7f')));}if(_0x39d2('0x28')==typeof _0xa68d9c['type']){return _0xb6d420(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0xa68d9c[_0x39d2('0x80')]){return _0xb6d420(new Error(_0x39d2('0x81')));}if(_0x39d2('0x28')==typeof _0xa68d9c[_0x39d2('0x82')]){return _0xb6d420(new Error(_0x39d2('0x83')));}if(_0xa68d9c[_0x39d2('0x3a')]===_0x39d2('0x84')){if(_0x39d2('0x28')==typeof _0xa68d9c[_0x39d2('0x82')]['views']){return _0xb6d420(new Error(_0x39d2('0x85')));}if(_0x39d2('0x28')==typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')][_0x39d2('0x87')]&&_0x39d2('0x28')==typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')][_0x39d2('0x88')]){return _0xb6d420(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0xa68d9c[_0x39d2('0x3a')]===_0x39d2('0x89')){if(_0x39d2('0x28')==typeof _0xa68d9c['parameters'][_0x39d2('0x8a')]){return _0xb6d420(new Error(_0x39d2('0x8b')));}if(_0x39d2('0x28')==typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x8c')]){return _0xb6d420(new Error(_0x39d2('0x8d')));}}else{return _0xb6d420(new Error(_0x39d2('0x8e')));}var _0x502aaf=_0xa68d9c[_0x39d2('0x34')];var _0x24f097=_0xa68d9c['description'];var _0x24bd17=_0xa68d9c[_0x39d2('0x3a')];var _0x217518=_0xa68d9c['sidebar']?_0xa68d9c[_0x39d2('0x8f')]:_0x39d2('0x90');var _0x3dca2b=_0xa68d9c[_0x39d2('0x91')]?_0xa68d9c['icon']:_0x39d2('0x92');var _0x1fa8fa='';var _0x2b6242='';var _0x51f47b='';var _0x2f4f86='';var _0x10a2e9=_0xa68d9c[_0x39d2('0x80')];if(_0x24bd17==='html'){if(_0x39d2('0x28')!=typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')]['admin']){var _0x4bc670=_0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')][_0x39d2('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x39d2('0x93')](_0x4bc670)){_0x1fa8fa=path['join'](_0x39d2('0x94'),_0x413310,_0x1eb54d[0x0],_0x4bc670);}else{_0x1fa8fa=_0x4bc670;}}else{logger[_0x39d2('0x6c')](_0x39d2('0x95'));}if(_0x39d2('0x28')!=typeof _0xa68d9c[_0x39d2('0x82')]['views'][_0x39d2('0x88')]){var _0x1cc473=_0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')][_0x39d2('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x39d2('0x93')](_0x1cc473)){_0x2b6242=path[_0x39d2('0x55')](_0x39d2('0x94'),_0x413310,_0x1eb54d[0x0],_0x1cc473);}else{_0x2b6242=_0x1cc473;}}else{logger[_0x39d2('0x6c')](_0x39d2('0x96'));}}else if(_0x24bd17===_0x39d2('0x89')){_0x51f47b=_0xa68d9c[_0x39d2('0x82')][_0x39d2('0x8a')];_0x2f4f86=_0xa68d9c[_0x39d2('0x82')][_0x39d2('0x8c')];if(_0x39d2('0x28')!=typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')]){if(_0x39d2('0x28')!=typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')][_0x39d2('0x87')]){var _0x4bc670=_0xa68d9c['parameters'][_0x39d2('0x86')][_0x39d2('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x39d2('0x93')](_0x4bc670)){_0x1fa8fa=path['join'](_0x39d2('0x94'),_0x413310,_0x1eb54d[0x0],_0x4bc670);}else{_0x1fa8fa=_0x4bc670;}}if(_0x39d2('0x28')!=typeof _0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')]['agent']){var _0x1cc473=_0xa68d9c[_0x39d2('0x82')][_0x39d2('0x86')][_0x39d2('0x88')];if(!/^(f|ht)tps?:\/\//i[_0x39d2('0x93')](_0x1cc473)){_0x2b6242=path[_0x39d2('0x55')](_0x39d2('0x94'),_0x413310,_0x1eb54d[0x0],_0x1cc473);}else{_0x2b6242=_0x1cc473;}}}}var _0x367a30={'name':_0x502aaf,'description':_0x24f097,'path':path[_0x39d2('0x55')](_0x413310,_0x1eb54d[0x0]),'type':_0x24bd17,'sidebar':_0x217518,'icon':_0x3dca2b,'adminUrl':_0x1fa8fa,'agentUrl':_0x2b6242,'scriptName':_0x51f47b,'scriptPath':_0x2f4f86,'version':_0x10a2e9};removeReferences(_0x4df98d,null);return db['Plugin']['create'](_0x367a30)['then'](function(_0x3c3371){var _0xc6a137={'role':_0x6d8a5b[_0x39d2('0x97')][_0x39d2('0x98')],'userProfileId':_0x6d8a5b[_0x39d2('0x97')][_0x39d2('0x99')]};if(!_0xc6a137)throw new Error(_0x39d2('0x9a'));if(_0xc6a137[_0x39d2('0x98')]===_0x39d2('0x9b')){var _0x216055=_0x3c3371['get']({'plain':!![]});return db[_0x39d2('0x9c')][_0x39d2('0x52')]({'where':{'name':'Plugins','userProfileId':_0xc6a137[_0x39d2('0x99')]},'raw':!![]})[_0x39d2('0x2f')](function(_0x3aaf11){if(_0x3aaf11&&_0x3aaf11[_0x39d2('0x9d')]===0x0){return db[_0x39d2('0x32')][_0x39d2('0x9e')]({'name':_0x216055[_0x39d2('0x34')],'resourceId':_0x216055['id'],'type':_0x3aaf11['name'],'sectionId':_0x3aaf11['id']},{})[_0x39d2('0x2f')](function(){return _0x3c3371;});}else{return _0x3c3371;}})['catch'](function(_0x13b27b){logger[_0x39d2('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13b27b);throw _0x13b27b;});}return _0x3c3371;})[_0x39d2('0x2f')](respondWithResult(_0x284b6c,null))[_0x39d2('0x4e')](handleError(_0x284b6c,null));}});}catch(_0x13ae74){_0x284b6c[_0x39d2('0x25')](0x1f4)[_0x39d2('0x9f')](_0x13ae74);}};function removeReferences(_0x319da0,_0x38f641){try{if(_0x319da0){fs[_0x39d2('0x6b')](_0x319da0);logger[_0x39d2('0x6c')](_0x39d2('0xa0'));}if(_0x38f641){rimraf(_0x38f641,function(){});logger[_0x39d2('0x6c')](_0x39d2('0xa1'));}}catch(_0x38c8ee){logger['error'](_0x38c8ee);}}exports['update']=function(_0x2aefb4,_0x29d3f7,_0x247832){return db[_0x39d2('0x37')]['find']({'where':{'id':_0x2aefb4[_0x39d2('0x54')]['id']}})[_0x39d2('0x2f')](handleEntityNotFound(_0x29d3f7,null))[_0x39d2('0x2f')](saveUpdates(_0x2aefb4['body'],null))[_0x39d2('0x2f')](respondWithResult(_0x29d3f7,null))['catch'](handleError(_0x29d3f7,null));};exports[_0x39d2('0xa2')]=function(_0x438515,_0x9a6355,_0x4f51f5){return db[_0x39d2('0x37')][_0x39d2('0x52')]({'where':{'id':_0x438515[_0x39d2('0x54')]['id']}})[_0x39d2('0x2f')](function(_0x6111fd){if(_0x6111fd){return _0x6111fd[_0x39d2('0x30')]();}})['then'](function(_0x59109b){rimraf(path[_0x39d2('0x55')](config[_0x39d2('0x56')],'server/files/plugins',path[_0x39d2('0xa3')](_0x59109b['path'])),function(){});return _0x59109b;})[_0x39d2('0x2f')](handleEntityNotFound(_0x9a6355,null))['then'](respondWithStatusCode(_0x9a6355,null))[_0x39d2('0x4e')](handleError(_0x9a6355,null));};exports[_0x39d2('0xa4')]=function(_0x1216c7,_0x27c504,_0x1179f2){return BPromise[_0x39d2('0xa5')]()[_0x39d2('0x2f')](function(){if(!_0x1216c7[_0x39d2('0x3d')][_0x39d2('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1216c7[_0x39d2('0x3d')][_0x39d2('0xa6')]){throw new Error(_0x39d2('0xa7'));}var _0x14b370=_0x1216c7[_0x39d2('0x3d')][_0x39d2('0xa8')]?_0x1216c7[_0x39d2('0x3d')]['hostname']+':'+_0x1216c7[_0x39d2('0x3d')][_0x39d2('0xa6')]:_0x39d2('0xa9')+_0x1216c7['query'][_0x39d2('0xa6')];var _0x10d140=_0x1216c7['query']['json']?_0x1216c7[_0x39d2('0x3d')][_0x39d2('0x27')]:!![];var _0x3b9ebf=_0x1216c7[_0x39d2('0x3d')][_0x39d2('0xaa')]?_0x1216c7[_0x39d2('0x3d')][_0x39d2('0xaa')]:null;var _0x28d84f={'method':_0x1216c7['method'],'uri':util['format'](_0x39d2('0xab'),_0x14b370,_0x1216c7[_0x39d2('0x3d')]['path']),'json':_0x10d140,'resolveWithFullResponse':!![],'encoding':_0x3b9ebf,'qs':_0x1216c7[_0x39d2('0x3d')]};if(_0x1216c7[_0x39d2('0xac')]){_0x28d84f[_0x39d2('0xac')]=_0x1216c7[_0x39d2('0xac')];if(_0x28d84f[_0x39d2('0xac')]['content-length']){delete _0x28d84f[_0x39d2('0xac')][_0x39d2('0xad')];}}if(_0x28d84f[_0x39d2('0xac')][_0x39d2('0xae')]){delete _0x28d84f[_0x39d2('0xac')][_0x39d2('0xae')];}return rp(_0x28d84f);})['then'](function(_0x4232cc){if(_0x4232cc){_0x27c504[_0x39d2('0xaf')](_0x4232cc[_0x39d2('0xac')]);logger[_0x39d2('0x6c')](_0x4232cc[_0x39d2('0x97')]);if(_[_0x39d2('0xb0')](_0x1216c7['query']['path'],_0x39d2('0x53'))&&_0x4232cc['statusCode']==0x1f4){return _0x27c504[_0x39d2('0x24')](_0x4232cc[_0x39d2('0xb1')]);}else{return _0x27c504[_0x39d2('0x25')](_0x4232cc[_0x39d2('0xb1')])[_0x39d2('0x9f')](_0x4232cc[_0x39d2('0x97')]);}}else{return _0x27c504[_0x39d2('0x24')](0xc8);}})['catch'](handleError(_0x27c504,null));};exports[_0x39d2('0xb2')]=function(_0x41a8eb,_0x26356e,_0x14f70c){return BPromise[_0x39d2('0xa5')]()[_0x39d2('0x2f')](function(){if(!_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0x6')]){throw new Error(_0x39d2('0xb3'));}if(!_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0xa6')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4ce248=_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0xa8')]?_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0xa8')]+':'+_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0xa6')]:_0x39d2('0xa9')+_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0xa6')];var _0x22fbd7=_0x41a8eb['query'][_0x39d2('0x27')]?_0x41a8eb[_0x39d2('0x3d')]['json']:!![];var _0x4135ed=_0x41a8eb[_0x39d2('0x3d')]['encoding']?_0x41a8eb['query'][_0x39d2('0xaa')]:null;var _0x33d052={'method':_0x41a8eb[_0x39d2('0xb4')],'uri':util[_0x39d2('0xb5')](_0x39d2('0xab'),_0x4ce248,_0x41a8eb[_0x39d2('0x3d')][_0x39d2('0x6')]),'json':_0x22fbd7,'resolveWithFullResponse':!![],'encoding':_0x4135ed,'body':_0x41a8eb[_0x39d2('0x97')]};if(_0x41a8eb[_0x39d2('0xac')]){_0x33d052['headers']=_0x41a8eb[_0x39d2('0xac')];if(_0x33d052[_0x39d2('0xac')][_0x39d2('0xad')]){delete _0x33d052[_0x39d2('0xac')]['content-length'];}}if(_0x33d052['headers'][_0x39d2('0xae')]){delete _0x33d052[_0x39d2('0xac')][_0x39d2('0xae')];}return rp(_0x33d052);})['then'](function(_0x3cc8ce){if(_0x3cc8ce){_0x26356e['set'](_0x3cc8ce['headers']);logger[_0x39d2('0x6c')](_0x3cc8ce[_0x39d2('0x97')]);return _0x26356e[_0x39d2('0x25')](_0x3cc8ce['statusCode'])[_0x39d2('0x9f')](_0x3cc8ce[_0x39d2('0x97')]);}else{return _0x26356e['sendStatus'](0xc8);}})['catch'](handleError(_0x26356e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index df5486a..a4cea54 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 _0x41d9=['hook','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit'];(function(_0x3009e5,_0x2dc1f9){var _0x3494ff=function(_0x142c84){while(--_0x142c84){_0x3009e5['push'](_0x3009e5['shift']());}};_0x3494ff(++_0x2dc1f9);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x941d('0x0'));var Plugin=require(_0x941d('0x1'))['db'][_0x941d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x941d('0x3')](0x0);var events={'afterCreate':_0x941d('0x4'),'afterUpdate':_0x941d('0x5'),'afterDestroy':_0x941d('0x6')};function emitEvent(_0x55b5a6){return function(_0x446c52,_0x832a33,_0x5e562f){PluginEvents[_0x941d('0x7')](_0x55b5a6+':'+_0x446c52['id'],_0x446c52);PluginEvents[_0x941d('0x7')](_0x55b5a6,_0x446c52);_0x5e562f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x941d('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x363e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x363e,0x179));var _0xe363=function(_0x3607a4,_0x195859){_0x3607a4=_0x3607a4-0x0;var _0xb51734=_0x363e[_0x3607a4];return _0xb51734;};'use strict';var EventEmitter=require(_0xe363('0x0'));var Plugin=require(_0xe363('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xe363('0x2')](0x0);var events={'afterCreate':_0xe363('0x3'),'afterUpdate':_0xe363('0x4'),'afterDestroy':_0xe363('0x5')};function emitEvent(_0x179157){return function(_0x3809ea,_0x6e174a,_0x11775e){PluginEvents[_0xe363('0x6')](_0x179157+':'+_0x3809ea['id'],_0x3809ea);PluginEvents[_0xe363('0x6')](_0x179157,_0x3809ea);_0x11775e(null);};}for(var e in events){if(events[_0xe363('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xe363('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 18704aa..7d78e41 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 _0x7b27=['rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x525b56,_0xdaac84){var _0x4b82ef=function(_0x3f8b01){while(--_0x3f8b01){_0x525b56['push'](_0x525b56['shift']());}};_0x4b82ef(++_0xdaac84);}(_0x7b27,0x186));var _0x77b2=function(_0x471a7f,_0x5de150){_0x471a7f=_0x471a7f-0x0;var _0x3aa053=_0x7b27[_0x471a7f];return _0x3aa053;};'use strict';var _=require(_0x77b2('0x0'));var util=require('util');var logger=require(_0x77b2('0x1'))(_0x77b2('0x2'));var moment=require(_0x77b2('0x3'));var BPromise=require(_0x77b2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77b2('0x5'));var rimraf=require(_0x77b2('0x6'));var config=require('../../config/environment');var attributes=require(_0x77b2('0x7'));module[_0x77b2('0x8')]=function(_0x243b61,_0x569bce){return _0x243b61[_0x77b2('0x9')](_0x77b2('0xa'),attributes,{'tableName':_0x77b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa5c=['Plugin','plugins','lodash','util','../../config/logger','api','rimraf','exports'];(function(_0x385db8,_0x3e2ed0){var _0x1d4f57=function(_0x7f22){while(--_0x7f22){_0x385db8['push'](_0x385db8['shift']());}};_0x1d4f57(++_0x3e2ed0);}(_0xaa5c,0x1f2));var _0xcaa5=function(_0x592af2,_0x12cb00){_0x592af2=_0x592af2-0x0;var _0x2c1a07=_0xaa5c[_0x592af2];return _0x2c1a07;};'use strict';var _=require(_0xcaa5('0x0'));var util=require(_0xcaa5('0x1'));var logger=require(_0xcaa5('0x2'))(_0xcaa5('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(_0xcaa5('0x4'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0xcaa5('0x5')]=function(_0x42afd4,_0x1877d0){return _0x42afd4['define'](_0xcaa5('0x6'),attributes,{'tableName':_0xcaa5('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 1d20725..9680e41 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 _0xeee6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','body','options','raw','lodash','util','moment','randomstring'];(function(_0x1f5a09,_0x5c23e9){var _0x49be45=function(_0x138348){while(--_0x138348){_0x1f5a09['push'](_0x1f5a09['shift']());}};_0x49be45(++_0x5c23e9);}(_0xeee6,0x84));var _0x6eee=function(_0x34ef11,_0x518d62){_0x34ef11=_0x34ef11-0x0;var _0x3db266=_0xeee6[_0x34ef11];return _0x3db266;};'use strict';var _=require(_0x6eee('0x0'));var util=require(_0x6eee('0x1'));var moment=require(_0x6eee('0x2'));var BPromise=require('bluebird');var rs=require(_0x6eee('0x3'));var fs=require('fs');var Redis=require(_0x6eee('0x4'));var db=require(_0x6eee('0x5'))['db'];var utils=require(_0x6eee('0x6'));var logger=require(_0x6eee('0x7'))(_0x6eee('0x8'));var config=require(_0x6eee('0x9'));var jayson=require(_0x6eee('0xa'));var client=jayson[_0x6eee('0xb')][_0x6eee('0xc')]({'port':0x232a});config['redis']=_[_0x6eee('0xd')](config[_0x6eee('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x6eee('0xf'))(new Redis(config[_0x6eee('0xe')]));require('./plugin.socket')[_0x6eee('0x10')](socket);function respondWithRpcPromise(_0x29b96d,_0x332db2,_0x4e3449){return new BPromise(function(_0x3d44a3,_0x1c67ca){return client[_0x6eee('0x11')](_0x29b96d,_0x4e3449)[_0x6eee('0x12')](function(_0x4901af){logger[_0x6eee('0x13')]('Plugin,\x20%s,\x20%s',_0x332db2,_0x6eee('0x14'));logger[_0x6eee('0x15')](_0x6eee('0x16'),_0x332db2,_0x6eee('0x14'),JSON[_0x6eee('0x17')](_0x4901af));if(_0x4901af[_0x6eee('0x18')]){if(_0x4901af[_0x6eee('0x18')][_0x6eee('0x19')]===0x1f4){logger['error'](_0x6eee('0x1a'),_0x332db2,_0x4901af[_0x6eee('0x18')][_0x6eee('0x1b')]);return _0x1c67ca(_0x4901af[_0x6eee('0x18')]['message']);}logger['error'](_0x6eee('0x1a'),_0x332db2,_0x4901af[_0x6eee('0x18')][_0x6eee('0x1b')]);return _0x3d44a3(_0x4901af['error'][_0x6eee('0x1b')]);}else{logger[_0x6eee('0x13')](_0x6eee('0x1a'),_0x332db2,_0x6eee('0x14'));_0x3d44a3(_0x4901af[_0x6eee('0x1c')][_0x6eee('0x1b')]);}})[_0x6eee('0x1d')](function(_0x3d4f93){logger[_0x6eee('0x18')](_0x6eee('0x1a'),_0x332db2,_0x3d4f93);_0x1c67ca(_0x3d4f93);});});}exports[_0x6eee('0x1e')]=function(_0x47a2fb){var _0x3f33be=this;return new Promise(function(_0x5969bb,_0x4a1bba){return db['Plugin']['create'](_0x47a2fb[_0x6eee('0x1f')],{'raw':_0x47a2fb[_0x6eee('0x20')]?_0x47a2fb[_0x6eee('0x20')][_0x6eee('0x21')]===undefined?!![]:![]:!![]})[_0x6eee('0x12')](function(_0x241898){logger[_0x6eee('0x13')](_0x6eee('0x1e'),_0x47a2fb);logger[_0x6eee('0x15')](_0x6eee('0x1e'),_0x47a2fb,JSON[_0x6eee('0x17')](_0x241898));_0x5969bb(_0x241898);})['catch'](function(_0xed7c63){logger[_0x6eee('0x18')](_0x6eee('0x1e'),_0xed7c63[_0x6eee('0x1b')],_0x47a2fb);_0x4a1bba(_0x3f33be['error'](0x1f4,_0xed7c63[_0x6eee('0x1b')]));});});}; \ No newline at end of file +var _0x6727=['catch','Plugin','body','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dc320,_0x51a587){var _0x5d8f4f=function(_0x2cd123){while(--_0x2cd123){_0x3dc320['push'](_0x3dc320['shift']());}};_0x5d8f4f(++_0x51a587);}(_0x6727,0x17a));var _0x7672=function(_0x44ded7,_0x3ba04a){_0x44ded7=_0x44ded7-0x0;var _0xec38c6=_0x6727[_0x44ded7];return _0xec38c6;};'use strict';var _=require(_0x7672('0x0'));var util=require(_0x7672('0x1'));var moment=require(_0x7672('0x2'));var BPromise=require(_0x7672('0x3'));var rs=require(_0x7672('0x4'));var fs=require('fs');var Redis=require(_0x7672('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7672('0x6'));var logger=require('../../config/logger')(_0x7672('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7672('0x8')]({'port':0x232a});config[_0x7672('0x9')]=_[_0x7672('0xa')](config[_0x7672('0x9')],{'host':_0x7672('0xb'),'port':0x18eb});var socket=require(_0x7672('0xc'))(new Redis(config['redis']));require('./plugin.socket')[_0x7672('0xd')](socket);function respondWithRpcPromise(_0x1d0752,_0x1eb69a,_0x2206b5){return new BPromise(function(_0x147625,_0xcf939b){return client[_0x7672('0xe')](_0x1d0752,_0x2206b5)[_0x7672('0xf')](function(_0x44f956){logger[_0x7672('0x10')](_0x7672('0x11'),_0x1eb69a,_0x7672('0x12'));logger[_0x7672('0x13')](_0x7672('0x14'),_0x1eb69a,_0x7672('0x12'),JSON[_0x7672('0x15')](_0x44f956));if(_0x44f956[_0x7672('0x16')]){if(_0x44f956[_0x7672('0x16')][_0x7672('0x17')]===0x1f4){logger[_0x7672('0x16')](_0x7672('0x11'),_0x1eb69a,_0x44f956['error'][_0x7672('0x18')]);return _0xcf939b(_0x44f956[_0x7672('0x16')][_0x7672('0x18')]);}logger[_0x7672('0x16')](_0x7672('0x11'),_0x1eb69a,_0x44f956[_0x7672('0x16')]['message']);return _0x147625(_0x44f956['error'][_0x7672('0x18')]);}else{logger['info'](_0x7672('0x11'),_0x1eb69a,'request\x20sent');_0x147625(_0x44f956['result'][_0x7672('0x18')]);}})[_0x7672('0x19')](function(_0x284d0a){logger['error'](_0x7672('0x11'),_0x1eb69a,_0x284d0a);_0xcf939b(_0x284d0a);});});}exports['CreatePlugin']=function(_0x4199cb){var _0x46e65=this;return new Promise(function(_0x1e63ad,_0xf9f565){return db[_0x7672('0x1a')]['create'](_0x4199cb[_0x7672('0x1b')],{'raw':_0x4199cb[_0x7672('0x1c')]?_0x4199cb[_0x7672('0x1c')][_0x7672('0x1d')]===undefined?!![]:![]:!![]})[_0x7672('0xf')](function(_0x31b6c0){logger[_0x7672('0x10')](_0x7672('0x1e'),_0x4199cb);logger[_0x7672('0x13')](_0x7672('0x1e'),_0x4199cb,JSON[_0x7672('0x15')](_0x31b6c0));_0x1e63ad(_0x31b6c0);})[_0x7672('0x19')](function(_0x13d4dd){logger[_0x7672('0x16')]('CreatePlugin',_0x13d4dd[_0x7672('0x18')],_0x4199cb);_0xf9f565(_0x46e65['error'](0x1f4,_0x13d4dd[_0x7672('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 4619d65..08a95db 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 _0xad52=['register','length','plugin:','./plugin.events','emit','removeListener'];(function(_0x2476b5,_0x5f31ad){var _0x298d7f=function(_0x4521bb){while(--_0x4521bb){_0x2476b5['push'](_0x2476b5['shift']());}};_0x298d7f(++_0x5f31ad);}(_0xad52,0xb7));var _0x2ad5=function(_0x13dd37,_0x1a62d7){_0x13dd37=_0x13dd37-0x0;var _0x4018ef=_0xad52[_0x13dd37];return _0x4018ef;};'use strict';var PluginEvents=require(_0x2ad5('0x0'));var events=['save','remove','update'];function createListener(_0x37851e,_0x2bf92b){return function(_0x53ef0e){_0x2bf92b[_0x2ad5('0x1')](_0x37851e,_0x53ef0e);};}function removeListener(_0x4d9580,_0x429ad9){return function(){PluginEvents[_0x2ad5('0x2')](_0x4d9580,_0x429ad9);};}exports[_0x2ad5('0x3')]=function(_0x4dadc1){for(var _0x2ff9e0=0x0,_0x40453a=events[_0x2ad5('0x4')];_0x2ff9e0<_0x40453a;_0x2ff9e0++){var _0x1795a0=events[_0x2ff9e0];var _0x185307=createListener(_0x2ad5('0x5')+_0x1795a0,_0x4dadc1);PluginEvents['on'](_0x1795a0,_0x185307);}}; \ No newline at end of file +var _0x7b0b=['length','plugin:','./plugin.events','save','emit','removeListener','register'];(function(_0x304fef,_0x5ae8b2){var _0x3e5886=function(_0x16344d){while(--_0x16344d){_0x304fef['push'](_0x304fef['shift']());}};_0x3e5886(++_0x5ae8b2);}(_0x7b0b,0x87));var _0xb7b0=function(_0x499d64,_0x11302c){_0x499d64=_0x499d64-0x0;var _0x4de3a8=_0x7b0b[_0x499d64];return _0x4de3a8;};'use strict';var PluginEvents=require(_0xb7b0('0x0'));var events=[_0xb7b0('0x1'),'remove','update'];function createListener(_0x10b25d,_0x262ae3){return function(_0x10e683){_0x262ae3[_0xb7b0('0x2')](_0x10b25d,_0x10e683);};}function removeListener(_0x48a548,_0x3e18f4){return function(){PluginEvents[_0xb7b0('0x3')](_0x48a548,_0x3e18f4);};}exports[_0xb7b0('0x4')]=function(_0xc728b2){for(var _0x22b3de=0x0,_0x56e666=events[_0xb7b0('0x5')];_0x22b3de<_0x56e666;_0x22b3de++){var _0x1b2390=events[_0x22b3de];var _0x11266f=createListener(_0xb7b0('0x6')+_0x1b2390,_0xc728b2);PluginEvents['on'](_0x1b2390,_0x11266f);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 55861c3..fe45b9e 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(_0x24a346,_0x16ec9b){var _0x1b0794=function(_0x122ab2){while(--_0x122ab2){_0x24a346['push'](_0x24a346['shift']());}};_0x1b0794(++_0x16ec9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x33d560,_0x780b8){var _0x1eaf0f=function(_0x45655d){while(--_0x45655d){_0x33d560['push'](_0x33d560['shift']());}};_0x1eaf0f(++_0x780b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 1bfd0f9..6dcf020 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 _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x436985,_0x2e7f0b){var _0x2a8d4d=function(_0x9aadd4){while(--_0x9aadd4){_0x436985['push'](_0x436985['shift']());}};_0x2a8d4d(++_0x2e7f0b);}(_0xee5b,0x1f4));var _0xbee5=function(_0xd7c673,_0x2b510a){_0xd7c673=_0xd7c673-0x0;var _0x30d746=_0xee5b[_0xd7c673];return _0x30d746;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}}; \ No newline at end of file +var _0xc368=['update','restart','Unknown\x20status','destroy','delete','dump','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','npm\x20install','info','index','list','then','reject','name','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path'];(function(_0x73cac3,_0x990a72){var _0x52f105=function(_0x2b2e0a){while(--_0x2b2e0a){_0x73cac3['push'](_0x73cac3['shift']());}};_0x52f105(++_0x990a72);}(_0xc368,0x7b));var _0x8c36=function(_0x293c47,_0x41af21){_0x293c47=_0x293c47-0x0;var _0x3352a7=_0xc368[_0x293c47];return _0x3352a7;};'use strict';var _=require('lodash');var pm2=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var path=require(_0x8c36('0x2'));var exec=require(_0x8c36('0x3'))[_0x8c36('0x4')];var BPromise=require(_0x8c36('0x5'));function handleEntityNotFound(_0x5d3b27,_0x3e9034){return function(_0x3bb30e){if(!_0x3bb30e){_0x5d3b27[_0x8c36('0x6')](0x194);;}return _0x3bb30e;};}function respondWithResult(_0x1d3660,_0x5ebfc1){_0x5ebfc1=_0x5ebfc1||0xc8;return function(_0x554022){if(_0x554022){return _0x1d3660[_0x8c36('0x7')](_0x5ebfc1)[_0x8c36('0x8')](_0x554022);}return null;};}function handleError(_0x3e76be,_0x26bad1){_0x26bad1=_0x26bad1||0x1f4;return function(_0x3af839){logger[_0x8c36('0x9')](_0x3af839['stack']);if(_0x3af839['name']){delete _0x3af839['name'];}_0x3e76be[_0x8c36('0x7')](_0x26bad1)[_0x8c36('0xa')](_0x3af839);};}function execChildProcess(){return new BPromise(function(_0x5132f6,_0x36cb13){exec(_0x8c36('0xb'),function(_0x1d5c61,_0xe7857e,_0x2a8e73){logger[_0x8c36('0xc')](_0xe7857e);logger[_0x8c36('0xc')](_0x2a8e73);if(_0x1d5c61){logger[_0x8c36('0x9')](_0x1d5c61);return _0x36cb13(_0x1d5c61);}return _0x5132f6(_0xe7857e);});});}exports[_0x8c36('0xd')]=function(_0x11f8fa,_0x43736d){return pm2[_0x8c36('0xe')]()[_0x8c36('0xf')](function(_0x220f18){if(_0x220f18){var _0x5dfcd5=_[_0x8c36('0x10')](_0x220f18,function(_0x5e32ad){return _0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x12')||_0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x13');});return{'rows':_0x5dfcd5,'count':_0x5dfcd5[_0x8c36('0x14')]};}return null;})[_0x8c36('0xf')](respondWithResult(_0x43736d,null))[_0x8c36('0x15')](handleError(_0x43736d,null));};exports[_0x8c36('0x16')]=function(_0x30229e,_0x49cafe){return pm2[_0x8c36('0x17')](_0x30229e[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x49cafe,null))[_0x8c36('0xf')](handleEntityNotFound(_0x49cafe,null))[_0x8c36('0x15')](handleError(_0x49cafe,null));};exports['create']=function(_0x15100f,_0x409de0){if(_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')]&&_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]){var _0xfb9763=path[_0x8c36('0x1b')](__dirname,_0x8c36('0x1c'),_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]);var _0x14ee6b=process[_0x8c36('0x1d')]();process['chdir'](path['dirname'](_0xfb9763));return execChildProcess()['then'](function(_0x55b844){process[_0x8c36('0x1e')](_0x14ee6b);return pm2[_0x8c36('0x1f')]({'name':_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')],'script':_0xfb9763});})[_0x8c36('0xf')](function(_0x27c0df){pm2['dump']();return _0x27c0df[0x0];})[_0x8c36('0xf')](respondWithResult(_0x409de0,0xc9))['catch'](handleError(_0x409de0,null));}else{return _0x409de0[_0x8c36('0x7')](0x1f4)['send']({'message':_0x8c36('0x20')});}};exports[_0x8c36('0x21')]=function(_0x271ec4,_0x1010c8){if(_0x271ec4['body']['id']){delete _0x271ec4['body']['id'];}var _0x7e7e56={'online':_0x8c36('0x22'),'stopped':'stop'};if(_0x7e7e56['hasOwnProperty'](_0x271ec4[_0x8c36('0x19')][_0x8c36('0x7')])){return pm2[_0x7e7e56[_0x271ec4['body'][_0x8c36('0x7')]]](_0x271ec4[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x1010c8,0xc8))['catch'](handleError(_0x1010c8,null));}else{return _0x1010c8['status'](0x1f4)[_0x8c36('0xa')]({'message':_0x8c36('0x23')});}};exports[_0x8c36('0x24')]=function(_0x192ce3,_0x3ae970){if(_0x192ce3[_0x8c36('0x19')]['id']){delete _0x192ce3[_0x8c36('0x19')]['id'];}if(_0x192ce3[_0x8c36('0x18')]['id']){return pm2[_0x8c36('0x25')](_0x192ce3[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](function(_0x36648e){pm2[_0x8c36('0x26')]();return _0x36648e[0x0];})[_0x8c36('0xf')](respondWithResult(_0x3ae970,null))[_0x8c36('0x15')](handleError(_0x3ae970,null));}else{return _0x3ae970[_0x8c36('0x7')](0x1f4)[_0x8c36('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 ab2b109..f543f63 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 _0xebc4=['get','isAuthenticated','getQueues','Router','../../components/auth/service','./realtime.controller'];(function(_0x41f745,_0x4b5c4a){var _0x2cbbcb=function(_0x4d5c74){while(--_0x4d5c74){_0x41f745['push'](_0x41f745['shift']());}};_0x2cbbcb(++_0x4b5c4a);}(_0xebc4,0xf9));var _0x4ebc=function(_0x112ddb,_0x259b69){_0x112ddb=_0x112ddb-0x0;var _0x51fff1=_0xebc4[_0x112ddb];return _0x51fff1;};'use strict';var express=require('express');var router=express[_0x4ebc('0x0')]();var auth=require(_0x4ebc('0x1'));var controller=require(_0x4ebc('0x2'));router[_0x4ebc('0x3')]('/queues',auth[_0x4ebc('0x4')](),controller[_0x4ebc('0x5')]);module['exports']=router; \ No newline at end of file +var _0x7711=['getQueues','exports','express','Router','../../components/auth/service','/queues','isAuthenticated'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x7711,0xf7));var _0x1771=function(_0x20faf5,_0x4d0066){_0x20faf5=_0x20faf5-0x0;var _0x2d2306=_0x7711[_0x20faf5];return _0x2d2306;};'use strict';var express=require(_0x1771('0x0'));var router=express[_0x1771('0x1')]();var auth=require(_0x1771('0x2'));var controller=require('./realtime.controller');router['get'](_0x1771('0x3'),auth[_0x1771('0x4')](),controller[_0x1771('0x5')]);module[_0x1771('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d2b4b74..50f9ac8 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 _0xb952=['findAndCountAll','rows','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','client','http','undefined','limit','count','offset','status','set','Content-Range','json','error','stack','name','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','merge','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','voice','push','pTalking','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','loggedInDb','busy','outbound','find','pick','length','some','connectedlinenum','internal','toString','UserId','accountcode','voiceStatus','online','User','Queue','Pause','findAll','QueueId','agents','getQueues','chat','sms','fax','resolve','query','channel','toLowerCase','Invalid\x20channel','rawAttributes','fieldName','type','key','getOptions','user','role','QueueCampaigns','getResources'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb952,0xc5));var _0x2b95=function(_0x2b9b66,_0x481352){_0x2b9b66=_0x2b9b66-0x0;var _0x4ca35a=_0xb952[_0x2b9b66];return _0x4ca35a;};'use strict';var util=require(_0x2b95('0x0'));var _=require(_0x2b95('0x1'));var jayson=require(_0x2b95('0x2'));var qs=require(_0x2b95('0x3'));var logger=require(_0x2b95('0x4'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x2b95('0x5')][_0x2b95('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x2b95('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x2fe817,_0x15b871){return function(_0x33fb65){if(_0x33fb65){var _0x31aa22=typeof _0x15b871['offset']===_0x2b95('0x7')&&typeof _0x15b871[_0x2b95('0x8')]==='undefined';var _0xdb27a2=_0x33fb65['count'];var _0x2b7926=_0x31aa22?0x0:_0x15b871['offset'];var _0x16405e=_0x31aa22?_0x33fb65[_0x2b95('0x9')]:_0x15b871[_0x2b95('0xa')]+_0x15b871[_0x2b95('0x8')];var _0x5abce4;if(_0x16405e>=_0xdb27a2){_0x16405e=_0xdb27a2;_0x5abce4=0xc8;}else{_0x5abce4=0xce;}_0x2fe817[_0x2b95('0xb')](_0x5abce4);return _0x2fe817[_0x2b95('0xc')](_0x2b95('0xd'),_0x2b7926+'-'+_0x16405e+'/'+_0xdb27a2)[_0x2b95('0xe')](_0x33fb65);}return null;};}function handleError(_0x472399,_0x24ca62){_0x24ca62=_0x24ca62||0x1f4;return function(_0x585fe6){logger[_0x2b95('0xf')](_0x585fe6[_0x2b95('0x10')]);if(_0x585fe6[_0x2b95('0x11')]){delete _0x585fe6[_0x2b95('0x11')];}_0x472399[_0x2b95('0xb')](_0x24ca62)['send'](_0x585fe6);};}function getRealtimeAgents(){return new Promise(function(_0x4698d7,_0x2488fa){return amiClient[_0x2b95('0x12')]('Agents',{})[_0x2b95('0x13')](function(_0x18ec0a){if(_0x18ec0a['error'])throw new Error(_0x2b95('0x14'));var _0x2507da=_0x18ec0a[_0x2b95('0x15')];return routingClient[_0x2b95('0x12')](_0x2b95('0x16'),{})[_0x2b95('0x13')](function(_0x48c51f){if(_0x48c51f[_0x2b95('0xf')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x54143e=_0x48c51f[_0x2b95('0x15')];return _0x4698d7(_[_0x2b95('0x17')]({},_0x2507da,_0x54143e));});})['catch'](function(_0x3c1692){_0x2488fa(_0x3c1692);});});}function getRealtimeQueues(_0x305862,_0x350f6c){return new Promise(function(_0xc49e65,_0x40c733){var _0x1b01d1=_0x350f6c==='voice'?amiClient:routingClient;return _0x1b01d1[_0x2b95('0x12')](_[_0x2b95('0x18')](_0x350f6c)+_0x2b95('0x19'),_0x305862)[_0x2b95('0x13')](function(_0xd15295){if(_0xd15295['error'])throw new Error(util[_0x2b95('0x1a')](_0x2b95('0x1b'),_0x350f6c));return _0xc49e65(_0xd15295[_0x2b95('0x15')]);})[_0x2b95('0x1c')](function(_0x10e9ef){_0x40c733(_0x10e9ef);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4eabfe,_0xdca099){return amiClient[_0x2b95('0x12')](_0x2b95('0x1d'),{})[_0x2b95('0x13')](function(_0x5a449e){if(_0x5a449e['error'])throw new Error(_0x2b95('0x1e'));return _0x4eabfe(_0x5a449e[_0x2b95('0x15')]);})[_0x2b95('0x1c')](function(_0x3ab79b){_0xdca099(_0x3ab79b);});});}function initializeQueues(_0x415146,_0x205983,_0x5216cd,_0x3c7f19){var _0x27e089=[_0x2b95('0x1f'),_0x2b95('0x20'),_0x2b95('0x21'),_0x2b95('0x22'),_0x2b95('0x23')];if(_0x5216cd===_0x2b95('0x24')&&_0x3c7f19==='outbound'){_0x27e089[_0x2b95('0x25')](_0x2b95('0x26'),_0x2b95('0x27'),_0x2b95('0x28'),'dialActive',_0x2b95('0x29'),_0x2b95('0x2a'),_0x2b95('0x2b'),_0x2b95('0x2c'),_0x2b95('0x2d'),'erlangCallToSecond',_0x2b95('0x2e'),'erlangBusyFactor',_0x2b95('0x2f'),_0x2b95('0x30'),_0x2b95('0x31'),'predictiveIntervalAvailable',_0x2b95('0x32'),'predictiveIntervalAnsweredCalls',_0x2b95('0x33'),_0x2b95('0x34'),'predictiveIntervalAvgHoldtime',_0x2b95('0x35'));}return _0x415146[_0x2b95('0x36')](function(_0x4ae2f3){var _0xa241a8=_0x4ae2f3[_0x2b95('0x37')]({'plain':!![]});_0xa241a8['agents']=[];_0xa241a8[_0x2b95('0x23')]=0x0;_0xa241a8[_0x2b95('0x38')]=0x0;_0xa241a8[_0x2b95('0x1f')]=0x0;_0xa241a8[_0x2b95('0x20')]=0x0;_0xa241a8[_0x2b95('0x21')]=0x0;if(_0x5216cd===_0x2b95('0x24')){_0xa241a8[_0x2b95('0x22')]=0x0;_0xa241a8[_0x2b95('0x39')]=0x0;if(_0x3c7f19===_0x2b95('0x3a')){_0xa241a8['pTalking']=0x0;_0xa241a8[_0x2b95('0x27')]=0x0;}}var _0x5e26fd=_[_0x2b95('0x3b')](_0x205983,['id',_0xa241a8['id']]);if(_0x5e26fd)_[_0x2b95('0x17')](_0xa241a8,_[_0x2b95('0x3c')](_0x5e26fd,_0x27e089));return _0xa241a8;});}function updateAgentVoiceStatus(_0x52d677,_0x1301ef,_0xc30159){var _0x38b87f=_['filter'](_0xc30159,['queue',_0x1301ef[_0x2b95('0x11')]]);if(_0x38b87f[_0x2b95('0x3d')]===0x0)return _0x52d677[_0x2b95('0x39')]=!![];if(_[_0x2b95('0x3e')](_0x38b87f,[_0x2b95('0x3f'),_0x52d677[_0x2b95('0x40')][_0x2b95('0x41')]()]))return _0x52d677[_0x2b95('0x22')]=!![];if(!_0x52d677[_0x2b95('0x22')])return _0x52d677['busy']=!![];}function getVoiceQueueAgents(_0x2444ea,_0x421712,_0x445b38,_0x1ff574){var _0x3612be=_[_0x2b95('0x3b')](_0x421712,['id',_0x2444ea['id']]);if(!_0x3612be)return _0x2444ea;return _0x3612be['getMembers']({'raw':!![]})[_0x2b95('0x13')](function(_0x5b53e8){for(var _0x1d8ede=0x0;_0x1d8ede<_0x5b53e8['length'];_0x1d8ede++){var _0x1ec7b8=_[_0x2b95('0x3b')](_0x445b38,['id',_0x5b53e8[_0x1d8ede]['UserId']]);if(!_0x1ec7b8){_0x1ec7b8={'id':_0x5b53e8[_0x1d8ede]['UserId'],'name':_0x5b53e8[_0x1d8ede][_0x2b95('0x42')],'accountcode':'','online':![]};}var _0x4e6f64={'id':_0x1ec7b8['id'],'name':_0x1ec7b8[_0x2b95('0x11')],'internal':_0x1ec7b8[_0x2b95('0x43')],'online':Boolean(_0x1ec7b8['online']),'paused':Boolean(_0x5b53e8[_0x1d8ede]['paused'])};if(_0x1ec7b8[_0x2b95('0x44')]===_0x2b95('0x22'))updateAgentVoiceStatus(_0x4e6f64,_0x2444ea,_0x1ff574);if(_0x4e6f64[_0x2b95('0x45')])_0x2444ea[_0x2b95('0x38')]++;if(_0x4e6f64[_0x2b95('0x39')])_0x2444ea['busy']++;if(_0x4e6f64[_0x2b95('0x23')]&&!_0x4e6f64[_0x2b95('0x39')]&&!_0x4e6f64[_0x2b95('0x22')])_0x2444ea[_0x2b95('0x23')]++;_0x2444ea['agents'][_0x2b95('0x25')](_0x4e6f64);}return _0x2444ea;});}function getQueueAgents(_0x171c19,_0x1f08d9,_0x1abdc8){var _0x1a625c=_0x2b95('0x46')+_[_0x2b95('0x18')](_0x1abdc8)+_0x2b95('0x47');var _0x528359=_0x1abdc8+_0x2b95('0x48');return db[_0x1a625c][_0x2b95('0x49')]({'where':{[_[_0x2b95('0x18')](_0x1abdc8)+_0x2b95('0x4a')]:_0x171c19['id']},'raw':!![]})[_0x2b95('0x13')](function(_0x3e95f6){for(var _0x5e50f6=0x0;_0x5e50f6<_0x3e95f6[_0x2b95('0x3d')];_0x5e50f6++){var _0x546e4c=_[_0x2b95('0x3b')](_0x1f08d9,['id',_0x3e95f6[_0x5e50f6][_0x2b95('0x42')]]);if(!_0x546e4c){_0x546e4c={'id':_0x3e95f6[_0x5e50f6][_0x2b95('0x42')],'name':_0x3e95f6[_0x5e50f6][_0x2b95('0x42')],'online':![],['pauseField']:![]};}var _0x2f3803={'id':_0x546e4c['id'],'name':_0x546e4c[_0x2b95('0x11')],'online':Boolean(_0x546e4c[_0x2b95('0x45')]),'paused':Boolean(_0x546e4c[_0x528359])};if(_0x2f3803[_0x2b95('0x45')])_0x171c19[_0x2b95('0x38')]++;_0x171c19[_0x2b95('0x4b')][_0x2b95('0x25')](_0x2f3803);}return _0x171c19;});}exports[_0x2b95('0x4c')]=function(_0x470554,_0x1770be){var _0x3160f4=['mail',_0x2b95('0x4d'),_0x2b95('0x4e'),'openchannel',_0x2b95('0x4f'),'whatsapp',_0x2b95('0x24')];var _0x48640f={'count':0x0,'rows':[]},_0x1676b0={},_0x479ee2,_0x548aa7,_0x579f66,_0x8f36cc,_0x22644c;Promise[_0x2b95('0x50')]()[_0x2b95('0x13')](function(){if(_0x470554[_0x2b95('0x51')]['channel']){if(!_['includes'](_0x3160f4,_0x470554[_0x2b95('0x51')][_0x2b95('0x52')][_0x2b95('0x53')]()))throw new Error(_0x2b95('0x54'));_0x479ee2=_0x470554['query'][_0x2b95('0x52')][_0x2b95('0x53')]();}var _0x3650e3=_['startCase'](_0x479ee2)+_0x2b95('0x47');var _0xd34c97=_['map'](db[_0x3650e3][_0x2b95('0x55')],function(_0x559f1d){return{'name':_0x559f1d[_0x2b95('0x56')],'type':_0x559f1d[_0x2b95('0x57')][_0x2b95('0x58')]};});_0x1676b0=qs[_0x2b95('0x59')](_0xd34c97,_0x470554);if(_0x470554[_0x2b95('0x5a')][_0x2b95('0x5b')]===_0x2b95('0x5a')){var _0x1144d2={'params':{'id':_0x470554[_0x2b95('0x5a')]['userProfileId']},'query':{'section':_0x479ee2===_0x2b95('0x24')&&_0x470554['query'][_0x2b95('0x57')]===_0x2b95('0x3a')?_0x2b95('0x5c'):_[_0x2b95('0x18')](_0x479ee2)+_0x2b95('0x19'),'type':_0x470554[_0x2b95('0x51')][_0x2b95('0x57')],'nolimit':!![],'sort':'name','filter':_0x470554['query']['filter']}};return db['UserProfile'][_0x2b95('0x5d')](_0x1144d2);}return db[_0x3650e3][_0x2b95('0x5e')](_0x1676b0);})[_0x2b95('0x13')](function(_0x33d033){_0x48640f[_0x2b95('0x9')]=_0x33d033['count'];_0x548aa7=_0x33d033[_0x2b95('0x5f')];return getRealtimeQueues(_0x470554,_0x479ee2);})[_0x2b95('0x13')](function(_0x2c37fc){_0x8f36cc=_0x2c37fc[_0x2b95('0x5f')];return getRealtimeAgents();})[_0x2b95('0x13')](function(_0x40fce0){_0x579f66=_0x40fce0[_0x2b95('0x5f')];if(_0x479ee2!=_0x2b95('0x24'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2447c4){_0x22644c=_0x2447c4?_0x2447c4[_0x2b95('0x5f')]:[];return initializeQueues(_0x548aa7,_0x8f36cc,_0x479ee2,_0x470554[_0x2b95('0x51')][_0x2b95('0x57')]);})['then'](function(_0xbc454e){var _0x5b8718=_0xbc454e[_0x2b95('0x36')](function(_0x4f8841){if(_0x479ee2===_0x2b95('0x24'))return getVoiceQueueAgents(_0x4f8841,_0x548aa7,_0x579f66,_0x22644c);else return getQueueAgents(_0x4f8841,_0x579f66,_0x479ee2);});return Promise[_0x2b95('0x60')](_0x5b8718);})[_0x2b95('0x13')](function(_0xf822f){_0x48640f[_0x2b95('0x5f')]=_0xf822f;return _0x48640f;})[_0x2b95('0x13')](respondWithFilteredResult(_0x1770be,_0x1676b0))[_0x2b95('0x1c')](handleError(_0x1770be,null));}; \ No newline at end of file +var _0x11b8=['merge','catch','voice','startCase','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','loggedInDb','pTalking','pick','filter','length','busy','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','findAll','QueueId','getQueues','openchannel','fax','whatsapp','resolve','query','channel','toLowerCase','Queue','fieldName','key','role','user','userProfileId','type','Queues','UserProfile','getResources','findAndCountAll','rows','all','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','offset','undefined','limit','count','set','json','error','name','status','send','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)'];(function(_0x2dd1b0,_0xa3c423){var _0xb0b452=function(_0x303a65){while(--_0x303a65){_0x2dd1b0['push'](_0x2dd1b0['shift']());}};_0xb0b452(++_0xa3c423);}(_0x11b8,0x15d));var _0x811b=function(_0x1f885e,_0x83ce8){_0x1f885e=_0x1f885e-0x0;var _0xb76bca=_0x11b8[_0x1f885e];return _0xb76bca;};'use strict';var util=require('util');var _=require(_0x811b('0x0'));var jayson=require(_0x811b('0x1'));var qs=require(_0x811b('0x2'));var logger=require(_0x811b('0x3'))(_0x811b('0x4'));var db=require(_0x811b('0x5'))['db'];var amiClient=jayson[_0x811b('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x811b('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x134938,_0x4047a0){return function(_0x5f0313){if(_0x5f0313){var _0x382c05=typeof _0x4047a0[_0x811b('0x7')]===_0x811b('0x8')&&typeof _0x4047a0[_0x811b('0x9')]===_0x811b('0x8');var _0x31c585=_0x5f0313[_0x811b('0xa')];var _0x300e9f=_0x382c05?0x0:_0x4047a0[_0x811b('0x7')];var _0x618006=_0x382c05?_0x5f0313[_0x811b('0xa')]:_0x4047a0[_0x811b('0x7')]+_0x4047a0[_0x811b('0x9')];var _0x333922;if(_0x618006>=_0x31c585){_0x618006=_0x31c585;_0x333922=0xc8;}else{_0x333922=0xce;}_0x134938['status'](_0x333922);return _0x134938[_0x811b('0xb')]('Content-Range',_0x300e9f+'-'+_0x618006+'/'+_0x31c585)[_0x811b('0xc')](_0x5f0313);}return null;};}function handleError(_0x4f488d,_0x5ee5dd){_0x5ee5dd=_0x5ee5dd||0x1f4;return function(_0x5d3725){logger[_0x811b('0xd')](_0x5d3725['stack']);if(_0x5d3725[_0x811b('0xe')]){delete _0x5d3725['name'];}_0x4f488d[_0x811b('0xf')](_0x5ee5dd)[_0x811b('0x10')](_0x5d3725);};}function getRealtimeAgents(){return new Promise(function(_0x84a158,_0x239cea){return amiClient[_0x811b('0x11')]('Agents',{})[_0x811b('0x12')](function(_0x4e840f){if(_0x4e840f['error'])throw new Error(_0x811b('0x13'));var _0x34c44d=_0x4e840f[_0x811b('0x14')];return routingClient[_0x811b('0x11')](_0x811b('0x15'),{})[_0x811b('0x12')](function(_0x226d4b){if(_0x226d4b[_0x811b('0xd')])throw new Error(_0x811b('0x16'));var _0x2fc609=_0x226d4b['result'];return _0x84a158(_[_0x811b('0x17')]({},_0x34c44d,_0x2fc609));});})[_0x811b('0x18')](function(_0x3d1832){_0x239cea(_0x3d1832);});});}function getRealtimeQueues(_0xcad932,_0x279208){return new Promise(function(_0x2008d1,_0x272e0c){var _0x3c23ee=_0x279208===_0x811b('0x19')?amiClient:routingClient;return _0x3c23ee[_0x811b('0x11')](_[_0x811b('0x1a')](_0x279208)+'Queues',_0xcad932)[_0x811b('0x12')](function(_0x339f33){if(_0x339f33['error'])throw new Error(util[_0x811b('0x1b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x279208));return _0x2008d1(_0x339f33[_0x811b('0x14')]);})[_0x811b('0x18')](function(_0x2fb095){_0x272e0c(_0x2fb095);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x16020a,_0x32f265){return amiClient[_0x811b('0x11')](_0x811b('0x1c'),{})[_0x811b('0x12')](function(_0x5e4221){if(_0x5e4221[_0x811b('0xd')])throw new Error(_0x811b('0x1d'));return _0x16020a(_0x5e4221[_0x811b('0x14')]);})['catch'](function(_0x5a978d){_0x32f265(_0x5a978d);});});}function initializeQueues(_0x5a0d13,_0x56983a,_0x15b2d4,_0x37b382){var _0x3c8646=[_0x811b('0x1e'),_0x811b('0x1f'),_0x811b('0x20'),_0x811b('0x21'),_0x811b('0x22')];if(_0x15b2d4==='voice'&&_0x37b382===_0x811b('0x23')){_0x3c8646[_0x811b('0x24')]('pTalking',_0x811b('0x25'),_0x811b('0x26'),_0x811b('0x27'),_0x811b('0x28'),_0x811b('0x29'),_0x811b('0x2a'),'startProgressive','erlangCalls',_0x811b('0x2b'),'erlangAbandonmentRate',_0x811b('0x2c'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x811b('0x2d'),_0x811b('0x2e'),_0x811b('0x2f'),_0x811b('0x30'),'predictiveIntervalDroppedCallsTimeout',_0x811b('0x31'),_0x811b('0x32'),'predictiveIntervalAvgTalktime');}return _0x5a0d13[_0x811b('0x33')](function(_0x2f9114){var _0x338ddd=_0x2f9114[_0x811b('0x34')]({'plain':!![]});_0x338ddd[_0x811b('0x35')]=[];_0x338ddd['paused']=0x0;_0x338ddd[_0x811b('0x36')]=0x0;_0x338ddd[_0x811b('0x1e')]=0x0;_0x338ddd[_0x811b('0x1f')]=0x0;_0x338ddd[_0x811b('0x20')]=0x0;if(_0x15b2d4==='voice'){_0x338ddd['talking']=0x0;_0x338ddd['busy']=0x0;if(_0x37b382===_0x811b('0x23')){_0x338ddd[_0x811b('0x37')]=0x0;_0x338ddd[_0x811b('0x25')]=0x0;}}var _0x5cb0b8=_['find'](_0x56983a,['id',_0x338ddd['id']]);if(_0x5cb0b8)_[_0x811b('0x17')](_0x338ddd,_[_0x811b('0x38')](_0x5cb0b8,_0x3c8646));return _0x338ddd;});}function updateAgentVoiceStatus(_0x5cce8e,_0x5b8b20,_0x5bab98){var _0x3a971e=_[_0x811b('0x39')](_0x5bab98,['queue',_0x5b8b20['name']]);if(_0x3a971e[_0x811b('0x3a')]===0x0)return _0x5cce8e[_0x811b('0x3b')]=!![];if(_['some'](_0x3a971e,[_0x811b('0x3c'),_0x5cce8e[_0x811b('0x3d')][_0x811b('0x3e')]()]))return _0x5cce8e['talking']=!![];if(!_0x5cce8e[_0x811b('0x21')])return _0x5cce8e[_0x811b('0x3b')]=!![];}function getVoiceQueueAgents(_0x56d107,_0x545910,_0x104c03,_0x476db7){var _0x38f4db=_[_0x811b('0x3f')](_0x545910,['id',_0x56d107['id']]);if(!_0x38f4db)return _0x56d107;return _0x38f4db[_0x811b('0x40')]({'raw':!![]})[_0x811b('0x12')](function(_0x4bc2ef){for(var _0x1089ba=0x0;_0x1089ba<_0x4bc2ef[_0x811b('0x3a')];_0x1089ba++){var _0x42951b=_[_0x811b('0x3f')](_0x104c03,['id',_0x4bc2ef[_0x1089ba][_0x811b('0x41')]]);if(!_0x42951b){_0x42951b={'id':_0x4bc2ef[_0x1089ba][_0x811b('0x41')],'name':_0x4bc2ef[_0x1089ba][_0x811b('0x41')],'accountcode':'','online':![]};}var _0x8db878={'id':_0x42951b['id'],'name':_0x42951b[_0x811b('0xe')],'internal':_0x42951b[_0x811b('0x42')],'online':Boolean(_0x42951b[_0x811b('0x43')]),'paused':Boolean(_0x4bc2ef[_0x1089ba][_0x811b('0x22')])};if(_0x42951b[_0x811b('0x44')]===_0x811b('0x21'))updateAgentVoiceStatus(_0x8db878,_0x56d107,_0x476db7);if(_0x8db878[_0x811b('0x43')])_0x56d107[_0x811b('0x36')]++;if(_0x8db878[_0x811b('0x3b')])_0x56d107['busy']++;if(_0x8db878[_0x811b('0x22')]&&!_0x8db878[_0x811b('0x3b')]&&!_0x8db878[_0x811b('0x21')])_0x56d107['paused']++;_0x56d107[_0x811b('0x35')][_0x811b('0x24')](_0x8db878);}return _0x56d107;});}function getQueueAgents(_0x1e60b1,_0x479a33,_0x1e3429){var _0x331627=_0x811b('0x45')+_['startCase'](_0x1e3429)+'Queue';var _0xc340f0=_0x1e3429+'Pause';return db[_0x331627][_0x811b('0x46')]({'where':{[_[_0x811b('0x1a')](_0x1e3429)+_0x811b('0x47')]:_0x1e60b1['id']},'raw':!![]})[_0x811b('0x12')](function(_0xfbfc7a){for(var _0x2ede43=0x0;_0x2ede43<_0xfbfc7a[_0x811b('0x3a')];_0x2ede43++){var _0x2cc141=_[_0x811b('0x3f')](_0x479a33,['id',_0xfbfc7a[_0x2ede43][_0x811b('0x41')]]);if(!_0x2cc141){_0x2cc141={'id':_0xfbfc7a[_0x2ede43][_0x811b('0x41')],'name':_0xfbfc7a[_0x2ede43][_0x811b('0x41')],'online':![],['pauseField']:![]};}var _0x2191f5={'id':_0x2cc141['id'],'name':_0x2cc141['name'],'online':Boolean(_0x2cc141[_0x811b('0x43')]),'paused':Boolean(_0x2cc141[_0xc340f0])};if(_0x2191f5[_0x811b('0x43')])_0x1e60b1[_0x811b('0x36')]++;_0x1e60b1[_0x811b('0x35')][_0x811b('0x24')](_0x2191f5);}return _0x1e60b1;});}exports[_0x811b('0x48')]=function(_0xfacb94,_0x460318){var _0x43d261=['mail','chat','sms',_0x811b('0x49'),_0x811b('0x4a'),_0x811b('0x4b'),_0x811b('0x19')];var _0x3099e7={'count':0x0,'rows':[]},_0x2c0d1e={},_0x3cd756,_0x62ff37,_0xfe3ea7,_0x51fd67,_0x56a0d0;Promise[_0x811b('0x4c')]()[_0x811b('0x12')](function(){if(_0xfacb94[_0x811b('0x4d')][_0x811b('0x4e')]){if(!_['includes'](_0x43d261,_0xfacb94[_0x811b('0x4d')][_0x811b('0x4e')][_0x811b('0x4f')]()))throw new Error('Invalid\x20channel');_0x3cd756=_0xfacb94['query'][_0x811b('0x4e')][_0x811b('0x4f')]();}var _0x164839=_[_0x811b('0x1a')](_0x3cd756)+_0x811b('0x50');var _0x17aa24=_[_0x811b('0x33')](db[_0x164839]['rawAttributes'],function(_0x55dd67){return{'name':_0x55dd67[_0x811b('0x51')],'type':_0x55dd67['type'][_0x811b('0x52')]};});_0x2c0d1e=qs['getOptions'](_0x17aa24,_0xfacb94);if(_0xfacb94['user'][_0x811b('0x53')]==='user'){var _0x5a9ec2={'params':{'id':_0xfacb94[_0x811b('0x54')][_0x811b('0x55')]},'query':{'section':_0x3cd756===_0x811b('0x19')&&_0xfacb94['query'][_0x811b('0x56')]===_0x811b('0x23')?'QueueCampaigns':_['startCase'](_0x3cd756)+_0x811b('0x57'),'type':_0xfacb94[_0x811b('0x4d')][_0x811b('0x56')],'nolimit':!![],'sort':_0x811b('0xe'),'filter':_0xfacb94['query']['filter']}};return db[_0x811b('0x58')][_0x811b('0x59')](_0x5a9ec2);}return db[_0x164839][_0x811b('0x5a')](_0x2c0d1e);})[_0x811b('0x12')](function(_0xb8c9bd){_0x3099e7[_0x811b('0xa')]=_0xb8c9bd[_0x811b('0xa')];_0x62ff37=_0xb8c9bd[_0x811b('0x5b')];return getRealtimeQueues(_0xfacb94,_0x3cd756);})['then'](function(_0x189def){_0x51fd67=_0x189def[_0x811b('0x5b')];return getRealtimeAgents();})[_0x811b('0x12')](function(_0x40992a){_0xfe3ea7=_0x40992a[_0x811b('0x5b')];if(_0x3cd756!=_0x811b('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0x811b('0x12')](function(_0x56ff33){_0x56a0d0=_0x56ff33?_0x56ff33['rows']:[];return initializeQueues(_0x62ff37,_0x51fd67,_0x3cd756,_0xfacb94[_0x811b('0x4d')]['type']);})['then'](function(_0x4ef0d4){var _0x3a180c=_0x4ef0d4[_0x811b('0x33')](function(_0x5f4bba){if(_0x3cd756===_0x811b('0x19'))return getVoiceQueueAgents(_0x5f4bba,_0x62ff37,_0xfe3ea7,_0x56a0d0);else return getQueueAgents(_0x5f4bba,_0xfe3ea7,_0x3cd756);});return Promise[_0x811b('0x5c')](_0x3a180c);})['then'](function(_0x288e76){_0x3099e7[_0x811b('0x5b')]=_0x288e76;return _0x3099e7;})[_0x811b('0x12')](respondWithFilteredResult(_0x460318,_0x2c0d1e))[_0x811b('0x18')](handleError(_0x460318,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 9de215c..06b27e6 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x6f115b,_0x57eaea){var _0x5e0809=function(_0x4546cb){while(--_0x4546cb){_0x6f115b['push'](_0x6f115b['shift']());}};_0x5e0809(++_0x57eaea);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0xcb91[_0x34aec4];return _0x51e1a7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x97d56c,_0x23800e){var _0x538e64=function(_0x2cfe61){while(--_0x2cfe61){_0x97d56c['push'](_0x97d56c['shift']());}};_0x538e64(++_0x23800e);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f557c,_0x3de1e1){_0x3f557c=_0x3f557c-0x0;var _0x16a71a=_0xedd9[_0x3f557c];return _0x16a71a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 331da12..edfcafa 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 _0xce1a=['DATE','STRING','INTEGER','sequelize'];(function(_0x14f296,_0x435eef){var _0x12c777=function(_0x1baf3f){while(--_0x1baf3f){_0x14f296['push'](_0x14f296['shift']());}};_0x12c777(++_0x435eef);}(_0xce1a,0xbf));var _0xace1=function(_0x3dbce4,_0x656452){_0x3dbce4=_0x3dbce4-0x0;var _0x369770=_0xce1a[_0x3dbce4];return _0x369770;};'use strict';var Sequelize=require(_0xace1('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xace1('0x1')]},'uniqueid':{'type':Sequelize[_0xace1('0x2')]},'starttime':{'type':Sequelize[_0xace1('0x1')]},'responsetime':{'type':Sequelize[_0xace1('0x1')]},'ringtime':{'type':Sequelize[_0xace1('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xace1('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x307e=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x41facf,_0x4dcd47){var _0x5804fb=function(_0x25157a){while(--_0x25157a){_0x41facf['push'](_0x41facf['shift']());}};_0x5804fb(++_0x4dcd47);}(_0x307e,0xc9));var _0xe307=function(_0x19408a,_0x5c77e0){_0x19408a=_0x19408a-0x0;var _0x51c9c1=_0x307e[_0x19408a];return _0x51c9c1;};'use strict';var Sequelize=require(_0xe307('0x0'));module[_0xe307('0x1')]={'state':{'type':Sequelize[_0xe307('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe307('0x3')]},'scheduledat':{'type':Sequelize[_0xe307('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe307('0x4')]},'responsetime':{'type':Sequelize[_0xe307('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe307('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe307('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 6a18221..4674200 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 _0x26cb=['request-promise','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x1ad851,_0x5f664c){var _0x49de7b=function(_0x40c9b0){while(--_0x40c9b0){_0x1ad851['push'](_0x1ad851['shift']());}};_0x49de7b(++_0x5f664c);}(_0x26cb,0x133));var _0xb26c=function(_0x239866,_0x3ab44d){_0x239866=_0x239866-0x0;var _0x37af78=_0x26cb[_0x239866];return _0x37af78;};'use strict';var _=require(_0xb26c('0x0'));var util=require(_0xb26c('0x1'));var logger=require(_0xb26c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb26c('0x3'));var fs=require('fs');var path=require(_0xb26c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb26c('0x5'));module[_0xb26c('0x6')]=function(_0x3c2304,_0x85b9db){return _0x3c2304[_0xb26c('0x7')](_0xb26c('0x8'),attributes,{'tableName':_0xb26c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebf0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview'];(function(_0x2e0d6d,_0xfd559d){var _0xadc17e=function(_0x124b09){while(--_0x124b09){_0x2e0d6d['push'](_0x2e0d6d['shift']());}};_0xadc17e(++_0xfd559d);}(_0xebf0,0x1b3));var _0x0ebf=function(_0x47ffa8,_0x19542f){_0x47ffa8=_0x47ffa8-0x0;var _0x293ac0=_0xebf0[_0x47ffa8];return _0x293ac0;};'use strict';var _=require(_0x0ebf('0x0'));var util=require(_0x0ebf('0x1'));var logger=require(_0x0ebf('0x2'))(_0x0ebf('0x3'));var moment=require(_0x0ebf('0x4'));var BPromise=require(_0x0ebf('0x5'));var rp=require(_0x0ebf('0x6'));var fs=require('fs');var path=require(_0x0ebf('0x7'));var rimraf=require(_0x0ebf('0x8'));var config=require(_0x0ebf('0x9'));var attributes=require(_0x0ebf('0xa'));module[_0x0ebf('0xb')]=function(_0x5b3fcd,_0x108893){return _0x5b3fcd[_0x0ebf('0xc')](_0x0ebf('0xd'),attributes,{'tableName':_0x0ebf('0xe'),'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 3864762..4bf0e61 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 _0xb078=['ReportAgentPreview','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xb078,0xa1));var _0x8b07=function(_0x48749a,_0x5d7d69){_0x48749a=_0x48749a-0x0;var _0x18ab20=_0xb078[_0x48749a];return _0x18ab20;};'use strict';var _=require(_0x8b07('0x0'));var util=require(_0x8b07('0x1'));var moment=require(_0x8b07('0x2'));var BPromise=require(_0x8b07('0x3'));var rs=require(_0x8b07('0x4'));var fs=require('fs');var Redis=require(_0x8b07('0x5'));var db=require(_0x8b07('0x6'))['db'];var utils=require(_0x8b07('0x7'));var logger=require('../../config/logger')(_0x8b07('0x8'));var config=require(_0x8b07('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8b07('0xa')][_0x8b07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab8919,_0x300012,_0x495e77){return new BPromise(function(_0x5417e2,_0x38d211){return client[_0x8b07('0xc')](_0xab8919,_0x495e77)[_0x8b07('0xd')](function(_0x31ed18){logger[_0x8b07('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x300012,_0x8b07('0xf'));logger[_0x8b07('0x10')](_0x8b07('0x11'),_0x300012,'request\x20sent',JSON['stringify'](_0x31ed18));if(_0x31ed18['error']){if(_0x31ed18[_0x8b07('0x12')][_0x8b07('0x13')]===0x1f4){logger[_0x8b07('0x12')](_0x8b07('0x14'),_0x300012,_0x31ed18['error'][_0x8b07('0x15')]);return _0x38d211(_0x31ed18[_0x8b07('0x12')][_0x8b07('0x15')]);}logger[_0x8b07('0x12')](_0x8b07('0x14'),_0x300012,_0x31ed18[_0x8b07('0x12')][_0x8b07('0x15')]);return _0x5417e2(_0x31ed18[_0x8b07('0x12')]['message']);}else{logger['info'](_0x8b07('0x14'),_0x300012,_0x8b07('0xf'));_0x5417e2(_0x31ed18[_0x8b07('0x16')][_0x8b07('0x15')]);}})[_0x8b07('0x17')](function(_0x48fd2b){logger[_0x8b07('0x12')](_0x8b07('0x14'),_0x300012,_0x48fd2b);_0x38d211(_0x48fd2b);});});}exports[_0x8b07('0x18')]=function(_0x204df2){var _0x4ff7af=this;return new Promise(function(_0x89fe28,_0x174448){return db[_0x8b07('0x19')][_0x8b07('0x1a')](_0x204df2[_0x8b07('0x1b')],{'raw':_0x204df2[_0x8b07('0x1c')]?_0x204df2[_0x8b07('0x1c')][_0x8b07('0x1d')]===undefined?!![]:![]:!![]})[_0x8b07('0xd')](function(_0x1bacc9){logger[_0x8b07('0xe')]('CreateReportAgentPreview',_0x204df2);logger[_0x8b07('0x10')]('CreateReportAgentPreview',_0x204df2,JSON[_0x8b07('0x1e')](_0x1bacc9));_0x89fe28(_0x1bacc9);})[_0x8b07('0x17')](function(_0x20e806){logger['error'](_0x8b07('0x18'),_0x20e806[_0x8b07('0x15')],_0x204df2);_0x174448(_0x4ff7af['error'](0x1f4,_0x20e806['message']));});});}; \ No newline at end of file +var _0x717e=['debug','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x717e,0xfd));var _0xe717=function(_0x50af79,_0x26774e){_0x50af79=_0x50af79-0x0;var _0xebf22a=_0x717e[_0x50af79];return _0xebf22a;};'use strict';var _=require(_0xe717('0x0'));var util=require('util');var moment=require(_0xe717('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe717('0x2'));var db=require(_0xe717('0x3'))['db'];var utils=require(_0xe717('0x4'));var logger=require('../../config/logger')(_0xe717('0x5'));var config=require(_0xe717('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe717('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xef8635,_0x56b066,_0x19f84f){return new BPromise(function(_0x494eca,_0x4d50d0){return client['request'](_0xef8635,_0x19f84f)[_0xe717('0x8')](function(_0x2e2964){logger['info'](_0xe717('0x9'),_0x56b066,_0xe717('0xa'));logger[_0xe717('0xb')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x56b066,_0xe717('0xa'),JSON[_0xe717('0xc')](_0x2e2964));if(_0x2e2964[_0xe717('0xd')]){if(_0x2e2964[_0xe717('0xd')][_0xe717('0xe')]===0x1f4){logger[_0xe717('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x56b066,_0x2e2964[_0xe717('0xd')][_0xe717('0xf')]);return _0x4d50d0(_0x2e2964[_0xe717('0xd')][_0xe717('0xf')]);}logger[_0xe717('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x56b066,_0x2e2964['error']['message']);return _0x494eca(_0x2e2964[_0xe717('0xd')][_0xe717('0xf')]);}else{logger['info'](_0xe717('0x9'),_0x56b066,_0xe717('0xa'));_0x494eca(_0x2e2964[_0xe717('0x10')][_0xe717('0xf')]);}})[_0xe717('0x11')](function(_0x2ff42a){logger[_0xe717('0xd')](_0xe717('0x9'),_0x56b066,_0x2ff42a);_0x4d50d0(_0x2ff42a);});});}exports[_0xe717('0x12')]=function(_0x355d22){var _0x346d91=this;return new Promise(function(_0x5e466a,_0x9781){return db[_0xe717('0x13')][_0xe717('0x14')](_0x355d22[_0xe717('0x15')],{'raw':_0x355d22[_0xe717('0x16')]?_0x355d22[_0xe717('0x16')][_0xe717('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2fe789){logger['info'](_0xe717('0x12'),_0x355d22);logger[_0xe717('0xb')]('CreateReportAgentPreview',_0x355d22,JSON[_0xe717('0xc')](_0x2fe789));_0x5e466a(_0x2fe789);})[_0xe717('0x11')](function(_0x294866){logger[_0xe717('0xd')](_0xe717('0x12'),_0x294866[_0xe717('0xf')],_0x355d22);_0x9781(_0x346d91['error'](0x1f4,_0x294866[_0xe717('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index c03a1ba..28b523c 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 _0x8dd8=['openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts'];(function(_0x1b8248,_0xfaeb02){var _0x4fbc2a=function(_0x71b6e1){while(--_0x71b6e1){_0x1b8248['push'](_0x1b8248['shift']());}};_0x4fbc2a(++_0xfaeb02);}(_0x8dd8,0xe9));var _0x88dd=function(_0x54a36e,_0x47b214){_0x54a36e=_0x54a36e-0x0;var _0x5810a2=_0x8dd8[_0x54a36e];return _0x5810a2;};'use strict';var multer=require('multer');var util=require(_0x88dd('0x0'));var path=require(_0x88dd('0x1'));var express=require(_0x88dd('0x2'));var router=express[_0x88dd('0x3')]();var auth=require(_0x88dd('0x4'));var controller=require(_0x88dd('0x5'));router[_0x88dd('0x6')]('/voice/channels',auth[_0x88dd('0x7')](),controller[_0x88dd('0x8')]);router[_0x88dd('0x6')](_0x88dd('0x9'),auth[_0x88dd('0x7')](),controller[_0x88dd('0xa')]);router[_0x88dd('0x6')](_0x88dd('0xb'),auth['isAuthenticated'](),controller[_0x88dd('0xc')]);router[_0x88dd('0x6')]('/voice/queues',auth[_0x88dd('0x7')](),controller['voiceQueues']);router['get'](_0x88dd('0xd'),auth[_0x88dd('0x7')](),controller[_0x88dd('0xe')]);router['get'](_0x88dd('0xf'),auth['isAuthenticated'](),controller[_0x88dd('0x10')]);router[_0x88dd('0x6')](_0x88dd('0x11'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x12')]);router['get']('/openchannel/queues',auth[_0x88dd('0x7')](),controller[_0x88dd('0x13')]);router[_0x88dd('0x6')](_0x88dd('0x14'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x15')]);router['get']('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x88dd('0x16')]);router[_0x88dd('0x6')](_0x88dd('0x17'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x18')]);router[_0x88dd('0x6')]('/voice/queues/preview/:id',auth[_0x88dd('0x7')](),controller[_0x88dd('0x19')]);router['get'](_0x88dd('0x1a'),auth['isAuthenticated'](),controller[_0x88dd('0x1b')]);router[_0x88dd('0x6')](_0x88dd('0x1c'),auth['isAuthenticated'](),controller[_0x88dd('0x1d')]);router[_0x88dd('0x6')](_0x88dd('0x1e'),auth['isAuthenticated'](),controller[_0x88dd('0x1f')]);router['get'](_0x88dd('0x20'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x21')]);router[_0x88dd('0x6')](_0x88dd('0x22'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x23')]);router[_0x88dd('0x24')]('/voice/queues/:id',auth[_0x88dd('0x7')](),controller[_0x88dd('0x25')]);router[_0x88dd('0x6')](_0x88dd('0x26'),auth['isAuthenticated'](),controller[_0x88dd('0x27')]);router['get'](_0x88dd('0x28'),auth[_0x88dd('0x7')](),controller['outboundChannels']);router[_0x88dd('0x6')]('/agents',auth[_0x88dd('0x7')](),controller[_0x88dd('0x29')]);router[_0x88dd('0x24')](_0x88dd('0x2a'),auth['isAuthenticated'](),controller[_0x88dd('0x2b')]);router[_0x88dd('0x6')]('/telephones',auth[_0x88dd('0x7')](),controller[_0x88dd('0x2c')]);router[_0x88dd('0x6')](_0x88dd('0x2d'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x2e')]);router[_0x88dd('0x6')](_0x88dd('0x2f'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x30')]);router['get'](_0x88dd('0x31'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x32')]);router[_0x88dd('0x6')](_0x88dd('0x33'),auth['isAuthenticated'](),controller[_0x88dd('0x34')]);router[_0x88dd('0x6')](_0x88dd('0x35'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x36')]);router['get'](_0x88dd('0x37'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x38')]);router[_0x88dd('0x6')](_0x88dd('0x39'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x3a')]);router[_0x88dd('0x6')]('/sms/queues/waitinginteractions',auth[_0x88dd('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x88dd('0x6')](_0x88dd('0x3b'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x88dd('0x6')](_0x88dd('0x3c'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x3d')]);router[_0x88dd('0x3e')](_0x88dd('0x3f'),auth[_0x88dd('0x7')](),controller['queueNotify']('mail'));router[_0x88dd('0x6')](_0x88dd('0x40'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x41')]);router[_0x88dd('0x3e')](_0x88dd('0x42'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x43')](_0x88dd('0x44')));router[_0x88dd('0x6')](_0x88dd('0x45'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x46')]);router['post'](_0x88dd('0x47'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x43')](_0x88dd('0x48')));router[_0x88dd('0x6')](_0x88dd('0x49'),auth[_0x88dd('0x7')](),controller['showFaxQueues']);router['post'](_0x88dd('0x4a'),auth[_0x88dd('0x7')](),controller['queueNotify'](_0x88dd('0x4b')));router['get'](_0x88dd('0x4c'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x4d')]);router['post'](_0x88dd('0x4e'),auth['isAuthenticated'](),controller[_0x88dd('0x43')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth[_0x88dd('0x7')](),controller[_0x88dd('0x43')]('whatsapp'));router['get']('/sms/queues/:id',auth[_0x88dd('0x7')](),controller['showSmsQueues']);router[_0x88dd('0x6')](_0x88dd('0x4f'),auth['isAuthenticated'](),controller[_0x88dd('0x50')]);router[_0x88dd('0x3e')](_0x88dd('0x51'),auth[_0x88dd('0x7')](),controller[_0x88dd('0x52')]);module[_0x88dd('0x53')]=router; \ No newline at end of file +var _0x8796=['post','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','get','/voice/channels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues'];(function(_0x52fa9a,_0x24c576){var _0x33b234=function(_0x2e6825){while(--_0x2e6825){_0x52fa9a['push'](_0x52fa9a['shift']());}};_0x33b234(++_0x24c576);}(_0x8796,0x15c));var _0x6879=function(_0x5a42d9,_0x2d397e){_0x5a42d9=_0x5a42d9-0x0;var _0x190cf2=_0x8796[_0x5a42d9];return _0x190cf2;};'use strict';var multer=require(_0x6879('0x0'));var util=require(_0x6879('0x1'));var path=require('path');var express=require(_0x6879('0x2'));var router=express[_0x6879('0x3')]();var auth=require(_0x6879('0x4'));var controller=require('./rpc.controller');router[_0x6879('0x5')](_0x6879('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0x6879('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x6879('0x7')]);router[_0x6879('0x5')](_0x6879('0x8'),auth[_0x6879('0x9')](),controller[_0x6879('0xa')]);router['get'](_0x6879('0xb'),auth[_0x6879('0x9')](),controller[_0x6879('0xc')]);router[_0x6879('0x5')](_0x6879('0xd'),auth['isAuthenticated'](),controller[_0x6879('0xe')]);router[_0x6879('0x5')](_0x6879('0xf'),auth[_0x6879('0x9')](),controller[_0x6879('0x10')]);router[_0x6879('0x5')]('/mail/accounts',auth[_0x6879('0x9')](),controller[_0x6879('0x11')]);router[_0x6879('0x5')](_0x6879('0x12'),auth['isAuthenticated'](),controller[_0x6879('0x13')]);router[_0x6879('0x5')](_0x6879('0x14'),auth[_0x6879('0x9')](),controller['smsQueues']);router['get']('/whatsapp/queues',auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0x6879('0x15'),auth[_0x6879('0x9')](),controller[_0x6879('0x16')]);router[_0x6879('0x5')](_0x6879('0x17'),auth[_0x6879('0x9')](),controller[_0x6879('0x18')]);router[_0x6879('0x5')](_0x6879('0x19'),auth[_0x6879('0x9')](),controller[_0x6879('0x1a')]);router[_0x6879('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x6879('0x9')](),controller[_0x6879('0x1b')]);router[_0x6879('0x5')](_0x6879('0x1c'),auth[_0x6879('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x6879('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x6879('0x9')](),controller[_0x6879('0x1d')]);router[_0x6879('0x5')](_0x6879('0x1e'),auth[_0x6879('0x9')](),controller[_0x6879('0x1f')]);router['put']('/voice/queues/:id',auth[_0x6879('0x9')](),controller[_0x6879('0x20')]);router[_0x6879('0x5')](_0x6879('0x21'),auth[_0x6879('0x9')](),controller['outbound']);router['get'](_0x6879('0x22'),auth[_0x6879('0x9')](),controller[_0x6879('0x23')]);router[_0x6879('0x5')](_0x6879('0x24'),auth[_0x6879('0x9')](),controller[_0x6879('0x25')]);router[_0x6879('0x26')](_0x6879('0x27'),auth[_0x6879('0x9')](),controller[_0x6879('0x28')]);router[_0x6879('0x5')]('/telephones',auth['isAuthenticated'](),controller[_0x6879('0x29')]);router[_0x6879('0x5')](_0x6879('0x2a'),auth[_0x6879('0x9')](),controller[_0x6879('0x2b')]);router['get']('/campaigns',auth[_0x6879('0x9')](),controller[_0x6879('0x2c')]);router['get'](_0x6879('0x2d'),auth[_0x6879('0x9')](),controller['faxAccounts']);router[_0x6879('0x5')](_0x6879('0x2e'),auth[_0x6879('0x9')](),controller[_0x6879('0x2f')]);router[_0x6879('0x5')](_0x6879('0x30'),auth['isAuthenticated'](),controller[_0x6879('0x31')]);router[_0x6879('0x5')](_0x6879('0x32'),auth[_0x6879('0x9')](),controller[_0x6879('0x33')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x6879('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x6879('0x5')](_0x6879('0x34'),auth[_0x6879('0x9')](),controller[_0x6879('0x35')]);router[_0x6879('0x5')](_0x6879('0x36'),auth['isAuthenticated'](),controller[_0x6879('0x37')]);router['get'](_0x6879('0x38'),auth[_0x6879('0x9')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x6879('0x39'),auth['isAuthenticated'](),controller[_0x6879('0x3a')](_0x6879('0x3b')));router['get'](_0x6879('0x3c'),auth['isAuthenticated'](),controller[_0x6879('0x3d')]);router[_0x6879('0x3e')]('/chat/queues/:id/notify',auth[_0x6879('0x9')](),controller['queueNotify'](_0x6879('0x3f')));router[_0x6879('0x5')](_0x6879('0x40'),auth[_0x6879('0x9')](),controller[_0x6879('0x41')]);router[_0x6879('0x3e')]('/fax/queues/:id/notify',auth[_0x6879('0x9')](),controller['queueNotify'](_0x6879('0x42')));router[_0x6879('0x5')](_0x6879('0x43'),auth[_0x6879('0x9')](),controller[_0x6879('0x44')]);router['post'](_0x6879('0x45'),auth[_0x6879('0x9')](),controller[_0x6879('0x3a')]('openchannel'));router[_0x6879('0x5')](_0x6879('0x46'),auth[_0x6879('0x9')](),controller[_0x6879('0x47')]);router[_0x6879('0x3e')]('/sms/queues/:id/notify',auth[_0x6879('0x9')](),controller[_0x6879('0x3a')](_0x6879('0x48')));router['post'](_0x6879('0x49'),auth[_0x6879('0x9')](),controller['queueNotify'](_0x6879('0x4a')));router[_0x6879('0x5')](_0x6879('0x4b'),auth[_0x6879('0x9')](),controller[_0x6879('0x4c')]);router[_0x6879('0x5')](_0x6879('0x4d'),auth[_0x6879('0x9')](),controller[_0x6879('0x4e')]);router[_0x6879('0x3e')](_0x6879('0x4f'),auth[_0x6879('0x9')](),controller[_0x6879('0x50')]);module[_0x6879('0x51')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 4fb877f..e204f83 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 _0x425d=['http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','rows','find','query','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','ChatQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client'];(function(_0xc3704a,_0x1a3ff7){var _0x11e3b9=function(_0x3beab8){while(--_0x3beab8){_0xc3704a['push'](_0xc3704a['shift']());}};_0x11e3b9(++_0x1a3ff7);}(_0x425d,0x1e0));var _0xd425=function(_0x3f975a,_0xf22b0b){_0x3f975a=_0x3f975a-0x0;var _0x512370=_0x425d[_0x3f975a];return _0x512370;};'use strict';var BPromise=require(_0xd425('0x0'));var moment=require('moment');var _=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var db=require(_0xd425('0x3'))['db'];var logger=require(_0xd425('0x4'))(_0xd425('0x5'));var jayson=require(_0xd425('0x6'));var amiClient=jayson[_0xd425('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232b});var routingClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){var _0x262b02=_0x50b061?_0x50b061:amiClient;return _0x262b02[_0xd425('0x9')](_0x1d97d9,_0x1d2ed0)[_0xd425('0xa')](function(_0x2beb20){if(_0x2beb20[_0xd425('0xb')]){if(_0x2beb20[_0xd425('0xb')][_0xd425('0xc')]===0x1f4){return _0x374c3d(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}return _0xb6ba8e(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}else{_0xb6ba8e(_0x2beb20[_0xd425('0xe')]);}})[_0xd425('0xf')](function(_0x2385a5){_0x374c3d(_0x2385a5);});});}function respondWithResult(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xc8;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x10')](_0x3cacf7)['json'](_0x3b5de8);}return _0x9bb611[_0xd425('0x11')](0x194);};}function handleError(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0x1f4;return function(_0x5d3d60){logger[_0xd425('0xb')](_0x5d3d60[_0xd425('0x12')]);if(_0x5d3d60[_0xd425('0x13')]){delete _0x5d3d60[_0xd425('0x13')];}_0x17a498[_0xd425('0x10')](_0x336dc3)['send'](_0x5d3d60);};}function findById(_0x278626){return function(_0x471267){if(!_[_0xd425('0x14')](_0x278626)&&!_[_0xd425('0x14')](_0x471267)&&!_['isNil'](_0x471267[_0xd425('0x15')])){return _[_0xd425('0x16')](_0x471267[_0xd425('0x15')],function(_0x1155bc){return _0x1155bc['id']==_0x278626;});}return null;};}exports['voiceChannels']=function(_0x58a0c1,_0x5debc3){return respondWithRpcPromise('VoiceChannels',_0x58a0c1[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x5debc3,null))[_0xd425('0xf')](handleError(_0x5debc3,null));};exports['voiceChannelMixMonitor']=function(_0x355af0,_0x7e982e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd425('0x18')](_0x355af0[_0xd425('0x17')],_0x355af0[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x7e982e,null))[_0xd425('0xf')](handleError(_0x7e982e,null));};exports[_0xd425('0x1a')]=function(_0x2480a0,_0x3500bb){return respondWithRpcPromise(_0xd425('0x1b'),_[_0xd425('0x18')](_0x2480a0[_0xd425('0x17')],_0x2480a0[_0xd425('0x19')]))['then'](respondWithResult(_0x3500bb,null))[_0xd425('0xf')](handleError(_0x3500bb,null));};exports[_0xd425('0x1c')]=function(_0x398985,_0x1908a5){return respondWithRpcPromise(_0xd425('0x1d'),_0x398985[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x1908a5,null))['catch'](handleError(_0x1908a5,null));};exports[_0xd425('0x1e')]=function(_0x177de2,_0x1d8861){return respondWithRpcPromise('VoiceQueues',_0x177de2[_0xd425('0x17')])[_0xd425('0xa')](findById(_0x177de2[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x1d8861,null))[_0xd425('0xf')](handleError(_0x1d8861,null));};exports[_0xd425('0x1f')]=function(_0x2fd17a,_0x37b63c){return respondWithRpcPromise(_0xd425('0x20'),_[_0xd425('0x18')](_0x2fd17a['body'],_0x2fd17a[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x37b63c,null))[_0xd425('0xf')](handleError(_0x37b63c,null));};exports[_0xd425('0x21')]=function(_0x3275b1,_0x1abf33){return respondWithRpcPromise(_0xd425('0x22'),_[_0xd425('0x18')](_0x3275b1[_0xd425('0x17')],_0x3275b1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x1abf33,null))['catch'](handleError(_0x1abf33,null));};exports[_0xd425('0x23')]=function(_0x2a2a9b,_0x3120a4){return respondWithRpcPromise(_0xd425('0x24'),_0x2a2a9b[_0xd425('0x17')])['then'](respondWithResult(_0x3120a4,null))[_0xd425('0xf')](handleError(_0x3120a4,null));};exports[_0xd425('0x25')]=function(_0x4cfcd1,_0x574962){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd425('0x18')](_0x4cfcd1[_0xd425('0x17')],_0x4cfcd1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x574962,null))['catch'](handleError(_0x574962,null));};exports[_0xd425('0x26')]=function(_0x1d4414,_0x30a9dc){return respondWithRpcPromise(_0xd425('0x27'),_[_0xd425('0x18')](_0x1d4414[_0xd425('0x17')],_0x1d4414[_0xd425('0x19')]))['then'](respondWithResult(_0x30a9dc,null))[_0xd425('0xf')](handleError(_0x30a9dc,null));};exports['voiceQueuesChannelRedirect']=function(_0x22df81,_0x29cca9){return respondWithRpcPromise(_0xd425('0x28'),_['merge'](_0x22df81[_0xd425('0x17')],_0x22df81[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x29cca9,null))[_0xd425('0xf')](handleError(_0x29cca9,null));};exports['outbound']=function(_0x1d38fa,_0x3cf540){return respondWithRpcPromise('Outbound',_0x1d38fa['query'])['then'](respondWithResult(_0x3cf540,null))[_0xd425('0xf')](handleError(_0x3cf540,null));};exports[_0xd425('0x29')]=function(_0x1f30c1,_0x588688){return respondWithRpcPromise('OutboundChannels',_0x1f30c1['query'])[_0xd425('0xa')](respondWithResult(_0x588688,null))[_0xd425('0xf')](handleError(_0x588688,null));};exports[_0xd425('0x2a')]=function(_0x1d5017,_0xa9fd7c){var _0x14f3be;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'])[_0xd425('0xa')](function(_0x3c88a8){_0x14f3be=_0x3c88a8;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'],routingClient);})[_0xd425('0xa')](function(_0x2dffc7){return _[_0xd425('0x18')]({},_0x2dffc7,_0x14f3be);})['then'](respondWithResult(_0xa9fd7c,null))[_0xd425('0xf')](handleError(_0xa9fd7c,null));};exports[_0xd425('0x2c')]=function(_0x1c5ba6,_0x2d7a2f){if(_0x1c5ba6['body']&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]&&_0x1c5ba6[_0xd425('0x2f')]&&_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]){for(var _0x2f6bf7 in _0x1c5ba6[_0xd425('0x2d')]['interaction']){if(_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]['hasOwnProperty'](_0x2f6bf7)){db[_0xd425('0x30')]['findAll']({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6['user'][_0xd425('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1c5ba6[_0xd425('0x2d')]['interaction'][_0x2f6bf7]&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')]?{'$notIn':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7]}:{'$ne':null}}})['then'](function(_0x2e4b21){var _0x5f3cfd=moment()[_0xd425('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x78ed9b=0x0,_0x16f61c=_0x2e4b21[_0xd425('0x31')];_0x78ed9b<_0x16f61c;_0x78ed9b+=0x1){_0x2e4b21[_0x78ed9b][_0xd425('0x33')]({'exitAt':_0x5f3cfd});}});for(var _0x624543=0x0;_0x624543<_0x1c5ba6['body'][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')];_0x624543+=0x1){db[_0xd425('0x30')][_0xd425('0x34')]({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')]['name'],'type':_0xd425('0x35'),'uniqueid':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0x624543],'exitAt':null},'defaults':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')],'interface':_[_0xd425('0x14')](_0x1c5ba6['user'][_0xd425('0x36')])?util[_0xd425('0x32')]('SIP/%s',_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]):_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x36')],'type':'INTERACTION','enterAt':moment()[_0xd425('0x32')](_0xd425('0x37')),'role':_0xd425('0x38'),'internal':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x39')],'uniqueid':_0x1c5ba6['body']['interaction'][_0x2f6bf7][_0x624543]}});}}}}return respondWithRpcPromise(_0xd425('0x3a'),{'id':_0x1c5ba6['params']['id'],'capacity':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x3b')]},routingClient)['then'](respondWithResult(_0x2d7a2f,null))[_0xd425('0xf')](handleError(_0x2d7a2f,null));};exports['telephones']=function(_0x48d5b8,_0x39f588){return respondWithRpcPromise(_0xd425('0x3c'),_0x48d5b8[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x39f588,null))[_0xd425('0xf')](handleError(_0x39f588,null));};exports[_0xd425('0x3d')]=function(_0xeb3586,_0x4118fe){return respondWithRpcPromise('Trunks',_0xeb3586[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x4118fe,null))[_0xd425('0xf')](handleError(_0x4118fe,null));};exports[_0xd425('0x3e')]=function(_0x7b1080,_0x1c80c2){return respondWithRpcPromise(_0xd425('0x3f'),_0x7b1080[_0xd425('0x17')])['then'](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['chatQueues']=function(_0x145e76,_0x2c5d01){return respondWithRpcPromise(_0xd425('0x40'),_0x145e76[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x2c5d01,null))['catch'](handleError(_0x2c5d01,null));};exports['showChatQueues']=function(_0x5e1294,_0x254b8b){return respondWithRpcPromise(_0xd425('0x40'),_0x5e1294['query'],routingClient)[_0xd425('0xa')](findById(_0x5e1294[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x254b8b,null))['catch'](handleError(_0x254b8b,null));};exports['mailQueues']=function(_0x599cb5,_0x49d75e){return respondWithRpcPromise('MailQueues',_0x599cb5['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x49d75e,null))[_0xd425('0xf')](handleError(_0x49d75e,null));};exports[_0xd425('0x41')]=function(_0x5b2323,_0x3395d8){return respondWithRpcPromise('MailQueues',_0x5b2323[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5b2323[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x3395d8,null))[_0xd425('0xf')](handleError(_0x3395d8,null));};exports[_0xd425('0x42')]=function(_0xa21f7c,_0x3ca6a6){return respondWithRpcPromise(_0xd425('0x43'),_0xa21f7c['query'],mailClient)[_0xd425('0xa')](respondWithResult(_0x3ca6a6,null))[_0xd425('0xf')](handleError(_0x3ca6a6,null));};exports[_0xd425('0x44')]=function(_0xf22906,_0x5c4df8){return respondWithRpcPromise('OpenchannelQueues',_0xf22906[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5c4df8,null))[_0xd425('0xf')](handleError(_0x5c4df8,null));};exports[_0xd425('0x45')]=function(_0x464ed1,_0x2e0f00){return respondWithRpcPromise(_0xd425('0x46'),_0x464ed1[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x464ed1[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x2e0f00,null))[_0xd425('0xf')](handleError(_0x2e0f00,null));};exports[_0xd425('0x47')]=function(_0x28979e,_0x5e72db){return respondWithRpcPromise(_0xd425('0x48'),_0x28979e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5e72db,null))['catch'](handleError(_0x5e72db,null));};exports['showSmsQueues']=function(_0x5ade1a,_0x403cb3){return respondWithRpcPromise(_0xd425('0x48'),_0x5ade1a[_0xd425('0x17')],routingClient)['then'](findById(_0x5ade1a[_0xd425('0x19')]['id']))['then'](respondWithResult(_0x403cb3,null))[_0xd425('0xf')](handleError(_0x403cb3,null));};exports[_0xd425('0x49')]=function(_0x21d26e,_0x5113fc){return respondWithRpcPromise(_0xd425('0x4a'),_0x21d26e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5113fc,null))[_0xd425('0xf')](handleError(_0x5113fc,null));};exports[_0xd425('0x4b')]=function(_0x43b1a9,_0x38a762){return respondWithRpcPromise(_0xd425('0x4a'),_0x43b1a9[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x43b1a9[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x38a762,null))[_0xd425('0xf')](handleError(_0x38a762,null));};exports[_0xd425('0x4c')]=function(_0x445f98,_0x443126){return respondWithRpcPromise(_0xd425('0x4d'),_0x445f98[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x443126,null))['catch'](handleError(_0x443126,null));};exports[_0xd425('0x4e')]=function(_0x5c333a,_0x135048){return respondWithRpcPromise(_0xd425('0x4d'),_0x5c333a[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5c333a['params']['id']))[_0xd425('0xa')](respondWithResult(_0x135048,null))[_0xd425('0xf')](handleError(_0x135048,null));};exports[_0xd425('0x4f')]=function(_0x689332,_0x2536bd){return respondWithRpcPromise(_0xd425('0x50'),_0x689332['query'])['then'](respondWithResult(_0x2536bd,null))[_0xd425('0xf')](handleError(_0x2536bd,null));};exports[_0xd425('0x51')]=function(_0x5e76f5,_0x174081){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5e76f5[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x174081,null))[_0xd425('0xf')](handleError(_0x174081,null));};exports[_0xd425('0x52')]=function(_0x376134,_0x2514fa){return respondWithRpcPromise(_0xd425('0x53'),_0x376134['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x2514fa,null))[_0xd425('0xf')](handleError(_0x2514fa,null));};exports[_0xd425('0x54')]=function(_0x233efa,_0xfcba08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x233efa[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0xfcba08,null))['catch'](handleError(_0xfcba08,null));};exports[_0xd425('0x55')]=function(_0x4599b0,_0x48bed3){return respondWithRpcPromise(_0xd425('0x56'),_0x4599b0[_0xd425('0x17')],routingClient)[_0xd425('0xa')](function(_0xd923bb){if(_0x4599b0[_0xd425('0x17')]['type']!==undefined){var _0x454cce=_(_0xd923bb['rows'])[_0xd425('0x57')]([_0x4599b0[_0xd425('0x17')]['type'],_0x4599b0[_0xd425('0x19')]['id']])[_0xd425('0x58')](_0xd425('0x59'))[_0xd425('0x5a')]()['value']();return _0xd923bb['rows'][_0xd425('0x57')](function(_0x2312c1){return _0x454cce[_0xd425('0x5b')](_0x2312c1['queue_id'])>-0x1;});}else{return _0xd923bb[_0xd425('0x15')][_0xd425('0x57')](function(_0x5b932c){return _0x5b932c[_0xd425('0x59')]===parseInt(_0x4599b0['params']['id']);});}})[_0xd425('0xa')](respondWithResult(_0x48bed3,null))[_0xd425('0xf')](handleError(_0x48bed3,null));};exports[_0xd425('0x5c')]=function(_0x2493e7,_0x5750dc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2493e7[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5750dc,null))['catch'](handleError(_0x5750dc,null));};exports[_0xd425('0x5d')]=function(_0x389099,_0x51c9ad){return respondWithRpcPromise(_0xd425('0x5e'),_0x389099[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x51c9ad,null))[_0xd425('0xf')](handleError(_0x51c9ad,null));};exports[_0xd425('0x5f')]=function(_0xf251e6,_0x302066){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0xf251e6['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x302066,null))['catch'](handleError(_0x302066,null));};exports[_0xd425('0x60')]=function(_0x236030){return function(_0x58cad5,_0x244789){var _0x1c1c77,_0x5dac05;var _0x592c40=_[_0xd425('0x61')](_0x236030);var _0x242ed8=_0x236030===_0xd425('0x62')?_0xd425('0x63'):_0xd425('0x64');return db[_0x592c40+_0xd425('0x65')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x58cad5[_0xd425('0x19')]['id']}})['then'](function(_0x2cff42){if(_[_0xd425('0x14')](_0x2cff42)){throw new Error(_0x592c40+'\x20Queue\x20not\x20found');}_0x1c1c77=_0x2cff42;return db[_0x592c40+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x58cad5[_0xd425('0x2d')][_0xd425('0x68')]},'include':[{'model':db[_0x592c40+_0xd425('0x69')],'as':_0xd425('0x69')},{'model':db[_0x592c40+_0x242ed8],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0x334062){if(_[_0xd425('0x14')](_0x334062)){throw new Error(_0x592c40+_0xd425('0x6a'));}_0x5dac05=_0x334062;return _0x334062['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd425('0xa')](function(){var _0x498e81={'uniqueid':_0x236030+'.'+_0x5dac05['id']+'.'+_0x5dac05['Interaction']['id'],'FromUserId':_0x58cad5[_0xd425('0x2f')]['id'],'type':'queue'};_0x498e81[_0x592c40+_0xd425('0x6b')]=_0x5dac05['id'];_0x498e81[_0x592c40+_0xd425('0x6c')]=_0x5dac05[_0xd425('0x69')]['id'];_0x498e81[_0xd425('0x6d')+_0x592c40+_0x242ed8+'Id']=_0x5dac05[_0xd425('0x64')]['id'];_0x498e81['To'+_0x592c40+_0xd425('0x6e')]=_0x1c1c77['id'];return db[_0x592c40+_0xd425('0x6f')]['create'](_0x498e81);})[_0xd425('0xa')](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x236030,'interaction':_0x5dac05[_0xd425('0x69')],'message':_0x5dac05,'account':_0x5dac05[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x71'),'appdata':_0x1c1c77['name']+','+(_0x5dac05[_0xd425('0x64')][_0xd425('0x72')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})[_0xd425('0xa')](respondWithResult(_0x244789,null))[_0xd425('0xf')](handleError(_0x244789,null));};};exports[_0xd425('0x74')]=function(_0x409612,_0x4147eb){var _0x433e5d,_0x334226;if(_[_0xd425('0x14')](_0x409612[_0xd425('0x2d')]['channel'])){throw new Error(_0xd425('0x75'));}var _0x5d8a47=_0x409612[_0xd425('0x2d')][_0xd425('0x76')];var _0x1c03d6=_[_0xd425('0x61')](_0x5d8a47);var _0xf06395=_0x5d8a47==='chat'?_0xd425('0x63'):_0xd425('0x64');return db[_0xd425('0x77')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x409612[_0xd425('0x19')]['id'],'role':_0xd425('0x38')}})[_0xd425('0xa')](function(_0x568a83){if(_[_0xd425('0x14')](_0x568a83)){throw new Error('Agent\x20not\x20found');}_0x433e5d=_0x568a83;return db[_0x1c03d6+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x409612['body'][_0xd425('0x68')]},'include':[{'model':db[_0x1c03d6+_0xd425('0x69')],'as':'Interaction'},{'model':db[_0x1c03d6+_0xf06395],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0xca2955){if(_[_0xd425('0x14')](_0xca2955)){throw new Error(_0x1c03d6+_0xd425('0x6a'));}_0x334226=_0xca2955;return _0xca2955[_0xd425('0x78')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f1a48={'uniqueid':_0x5d8a47+'.'+_0x334226['id']+'.'+_0x334226['Interaction']['id'],'FromUserId':_0x409612[_0xd425('0x2f')]['id'],'type':'queue','ToUserId':_0x433e5d['id']};_0x3f1a48[_0x1c03d6+_0xd425('0x6b')]=_0x334226['id'];_0x3f1a48[_0x1c03d6+_0xd425('0x6c')]=_0x334226[_0xd425('0x69')]['id'];_0x3f1a48[_0xd425('0x6d')+_0x1c03d6+_0xf06395+'Id']=_0x334226['Account']['id'];return db[_0x1c03d6+'TransferReport']['create'](_0x3f1a48);})['then'](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x5d8a47,'interaction':_0x334226['Interaction'],'message':_0x334226,'account':_0x334226[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x38'),'appdata':_0x433e5d[_0xd425('0x13')]+','+(_0x334226[_0xd425('0x64')][_0xd425('0x79')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})['then'](respondWithResult(_0x4147eb,null))[_0xd425('0xf')](handleError(_0x4147eb,null));}; \ No newline at end of file +var _0x326f=['VoiceQueuesChannelHangup','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','From','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0x931a00,_0x5dabc0){var _0x2d946d=function(_0x567349){while(--_0x567349){_0x931a00['push'](_0x931a00['shift']());}};_0x2d946d(++_0x5dabc0);}(_0x326f,0xd1));var _0xf326=function(_0x4159af,_0x5f237a){_0x4159af=_0x4159af-0x0;var _0x3aabdc=_0x326f[_0x4159af];return _0x3aabdc;};'use strict';var BPromise=require(_0xf326('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xf326('0x1'));var db=require(_0xf326('0x2'))['db'];var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var jayson=require(_0xf326('0x5'));var amiClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232a});var mailClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232b});var routingClient=jayson[_0xf326('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=_0x165f95?_0x165f95:amiClient;return _0x4c206c['request'](_0x3c254d,_0x3851eb)[_0xf326('0x8')](function(_0x1fc80e){if(_0x1fc80e[_0xf326('0x9')]){if(_0x1fc80e[_0xf326('0x9')][_0xf326('0xa')]===0x1f4){return _0x515bfa(_0x1fc80e['error'][_0xf326('0xb')]);}return _0x1e7b8a(_0x1fc80e['error'][_0xf326('0xb')]);}else{_0x1e7b8a(_0x1fc80e['result']);}})[_0xf326('0xc')](function(_0x518ab5){_0x515bfa(_0x518ab5);});});}function respondWithResult(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xc8;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0xd')](_0x9ed463)[_0xf326('0xe')](_0x4b3966);}return _0x3162f9[_0xf326('0xf')](0x194);};}function handleError(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0x1f4;return function(_0x45c1b6){logger['error'](_0x45c1b6['stack']);if(_0x45c1b6[_0xf326('0x10')]){delete _0x45c1b6[_0xf326('0x10')];}_0x17a098[_0xf326('0xd')](_0x5c8483)[_0xf326('0x11')](_0x45c1b6);};}function findById(_0x292f4b){return function(_0x287a2a){if(!_[_0xf326('0x12')](_0x292f4b)&&!_[_0xf326('0x12')](_0x287a2a)&&!_['isNil'](_0x287a2a[_0xf326('0x13')])){return _[_0xf326('0x14')](_0x287a2a[_0xf326('0x13')],function(_0x31ffb9){return _0x31ffb9['id']==_0x292f4b;});}return null;};}exports[_0xf326('0x15')]=function(_0x311af0,_0x4d3d41){return respondWithRpcPromise('VoiceChannels',_0x311af0['query'])[_0xf326('0x8')](respondWithResult(_0x4d3d41,null))[_0xf326('0xc')](handleError(_0x4d3d41,null));};exports['voiceChannelMixMonitor']=function(_0x4cabce,_0x128c68){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x4cabce[_0xf326('0x16')],_0x4cabce[_0xf326('0x17')]))['then'](respondWithResult(_0x128c68,null))['catch'](handleError(_0x128c68,null));};exports[_0xf326('0x18')]=function(_0xb1efcf,_0x5f21a2){return respondWithRpcPromise(_0xf326('0x19'),_[_0xf326('0x1a')](_0xb1efcf[_0xf326('0x16')],_0xb1efcf[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5f21a2,null))[_0xf326('0xc')](handleError(_0x5f21a2,null));};exports['voiceQueues']=function(_0x55b9f4,_0x4f31f6){return respondWithRpcPromise(_0xf326('0x1b'),_0x55b9f4[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4f31f6,null))[_0xf326('0xc')](handleError(_0x4f31f6,null));};exports[_0xf326('0x1c')]=function(_0x410237,_0x5217d4){return respondWithRpcPromise(_0xf326('0x1b'),_0x410237[_0xf326('0x16')])[_0xf326('0x8')](findById(_0x410237['params']['id']))[_0xf326('0x8')](respondWithResult(_0x5217d4,null))['catch'](handleError(_0x5217d4,null));};exports['updateVoiceQueue']=function(_0x6a8e89,_0x1ae23a){return respondWithRpcPromise(_0xf326('0x1d'),_['merge'](_0x6a8e89[_0xf326('0x1e')],_0x6a8e89[_0xf326('0x17')]))['then'](respondWithResult(_0x1ae23a,null))[_0xf326('0xc')](handleError(_0x1ae23a,null));};exports[_0xf326('0x1f')]=function(_0xd77aba,_0x18d110){return respondWithRpcPromise(_0xf326('0x20'),_[_0xf326('0x1a')](_0xd77aba[_0xf326('0x16')],_0xd77aba[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x18d110,null))[_0xf326('0xc')](handleError(_0x18d110,null));};exports['voiceQueuesChannels']=function(_0x1035ed,_0x424104){return respondWithRpcPromise(_0xf326('0x21'),_0x1035ed['query'])[_0xf326('0x8')](respondWithResult(_0x424104,null))[_0xf326('0xc')](handleError(_0x424104,null));};exports[_0xf326('0x22')]=function(_0x4df451,_0x5b101d){return respondWithRpcPromise(_0xf326('0x23'),_[_0xf326('0x1a')](_0x4df451[_0xf326('0x16')],_0x4df451[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5b101d,null))[_0xf326('0xc')](handleError(_0x5b101d,null));};exports[_0xf326('0x24')]=function(_0x2d5f20,_0x580374){return respondWithRpcPromise(_0xf326('0x25'),_[_0xf326('0x1a')](_0x2d5f20['query'],_0x2d5f20[_0xf326('0x17')]))['then'](respondWithResult(_0x580374,null))[_0xf326('0xc')](handleError(_0x580374,null));};exports['voiceQueuesChannelRedirect']=function(_0x51f147,_0xadb020){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xf326('0x1a')](_0x51f147['query'],_0x51f147[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0xadb020,null))[_0xf326('0xc')](handleError(_0xadb020,null));};exports['outbound']=function(_0x3dcc7e,_0x4095e6){return respondWithRpcPromise('Outbound',_0x3dcc7e[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4095e6,null))[_0xf326('0xc')](handleError(_0x4095e6,null));};exports[_0xf326('0x26')]=function(_0x51076c,_0x2c4416){return respondWithRpcPromise(_0xf326('0x27'),_0x51076c[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x2c4416,null))[_0xf326('0xc')](handleError(_0x2c4416,null));};exports['agents']=function(_0x3e830d,_0x1b7bf6){var _0x5cfb97;return respondWithRpcPromise('Agents',_0x3e830d[_0xf326('0x16')])['then'](function(_0x55dfa8){_0x5cfb97=_0x55dfa8;return respondWithRpcPromise(_0xf326('0x28'),_0x3e830d['query'],routingClient);})[_0xf326('0x8')](function(_0x37a95b){return _[_0xf326('0x1a')]({},_0x37a95b,_0x5cfb97);})[_0xf326('0x8')](respondWithResult(_0x1b7bf6,null))['catch'](handleError(_0x1b7bf6,null));};exports[_0xf326('0x29')]=function(_0x45d344,_0x347e7b){if(_0x45d344[_0xf326('0x1e')]&&_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]&&_0x45d344[_0xf326('0x2b')]&&_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]){for(var _0x1227d3 in _0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]){if(_0x45d344['body'][_0xf326('0x2a')][_0xf326('0x2c')](_0x1227d3)){db[_0xf326('0x2d')][_0xf326('0x2e')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]&&_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')]?{'$notIn':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]}:{'$ne':null}}})[_0xf326('0x8')](function(_0x55361f){var _0x505344=moment()[_0xf326('0x30')](_0xf326('0x31'));for(var _0x5ed62e=0x0,_0x4bd865=_0x55361f[_0xf326('0x2f')];_0x5ed62e<_0x4bd865;_0x5ed62e+=0x1){_0x55361f[_0x5ed62e][_0xf326('0x32')]({'exitAt':_0x505344});}});for(var _0x21c98e=0x0;_0x21c98e<_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')];_0x21c98e+=0x1){db[_0xf326('0x2d')][_0xf326('0x33')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':_0xf326('0x34'),'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e],'exitAt':null},'defaults':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'interface':_[_0xf326('0x12')](_0x45d344[_0xf326('0x2b')][_0xf326('0x35')])?util[_0xf326('0x30')]('SIP/%s',_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]):_0x45d344[_0xf326('0x2b')][_0xf326('0x35')],'type':'INTERACTION','enterAt':moment()[_0xf326('0x30')](_0xf326('0x31')),'role':_0xf326('0x36'),'internal':_0x45d344[_0xf326('0x2b')]['internal'],'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e]}});}}}}return respondWithRpcPromise(_0xf326('0x37'),{'id':_0x45d344[_0xf326('0x17')]['id'],'capacity':_0x45d344[_0xf326('0x1e')]['capacity']},routingClient)['then'](respondWithResult(_0x347e7b,null))[_0xf326('0xc')](handleError(_0x347e7b,null));};exports[_0xf326('0x38')]=function(_0x2ff126,_0x4cb25b){return respondWithRpcPromise(_0xf326('0x39'),_0x2ff126[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4cb25b,null))['catch'](handleError(_0x4cb25b,null));};exports['trunks']=function(_0x36ef89,_0x5b4832){return respondWithRpcPromise(_0xf326('0x3a'),_0x36ef89['query'])[_0xf326('0x8')](respondWithResult(_0x5b4832,null))[_0xf326('0xc')](handleError(_0x5b4832,null));};exports[_0xf326('0x3b')]=function(_0x25e091,_0x212594){return respondWithRpcPromise(_0xf326('0x3c'),_0x25e091[_0xf326('0x16')])['then'](respondWithResult(_0x212594,null))[_0xf326('0xc')](handleError(_0x212594,null));};exports[_0xf326('0x3d')]=function(_0x424d24,_0x4b0d8e){return respondWithRpcPromise(_0xf326('0x3e'),_0x424d24[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4b0d8e,null))[_0xf326('0xc')](handleError(_0x4b0d8e,null));};exports[_0xf326('0x3f')]=function(_0x58fcf0,_0x161fb3){return respondWithRpcPromise(_0xf326('0x3e'),_0x58fcf0[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x58fcf0['params']['id']))[_0xf326('0x8')](respondWithResult(_0x161fb3,null))[_0xf326('0xc')](handleError(_0x161fb3,null));};exports[_0xf326('0x40')]=function(_0x29e52e,_0x4d3b9e){return respondWithRpcPromise('MailQueues',_0x29e52e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4d3b9e,null))['catch'](handleError(_0x4d3b9e,null));};exports[_0xf326('0x41')]=function(_0x29de71,_0x316609){return respondWithRpcPromise(_0xf326('0x42'),_0x29de71['query'],routingClient)[_0xf326('0x8')](findById(_0x29de71['params']['id']))['then'](respondWithResult(_0x316609,null))[_0xf326('0xc')](handleError(_0x316609,null));};exports['mailAccounts']=function(_0x173760,_0x52fb95){return respondWithRpcPromise(_0xf326('0x43'),_0x173760['query'],mailClient)['then'](respondWithResult(_0x52fb95,null))[_0xf326('0xc')](handleError(_0x52fb95,null));};exports[_0xf326('0x44')]=function(_0x33b259,_0x5d0177){return respondWithRpcPromise(_0xf326('0x45'),_0x33b259['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5d0177,null))[_0xf326('0xc')](handleError(_0x5d0177,null));};exports[_0xf326('0x46')]=function(_0x217897,_0xbd3a01){return respondWithRpcPromise(_0xf326('0x45'),_0x217897[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x217897[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0xbd3a01,null))[_0xf326('0xc')](handleError(_0xbd3a01,null));};exports[_0xf326('0x47')]=function(_0x40f7cb,_0x4ca1b8){return respondWithRpcPromise(_0xf326('0x48'),_0x40f7cb['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x4ca1b8,null))[_0xf326('0xc')](handleError(_0x4ca1b8,null));};exports['showSmsQueues']=function(_0x2b770c,_0x5283da){return respondWithRpcPromise(_0xf326('0x48'),_0x2b770c[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x2b770c[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x5283da,null))['catch'](handleError(_0x5283da,null));};exports['whatsappQueues']=function(_0x1209ca,_0x32fe3a){return respondWithRpcPromise(_0xf326('0x49'),_0x1209ca[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x32fe3a,null))['catch'](handleError(_0x32fe3a,null));};exports[_0xf326('0x4a')]=function(_0x471da8,_0x4aadc9){return respondWithRpcPromise('WhatsappQueues',_0x471da8['query'],routingClient)[_0xf326('0x8')](findById(_0x471da8[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x4aadc9,null))[_0xf326('0xc')](handleError(_0x4aadc9,null));};exports[_0xf326('0x4b')]=function(_0x23a56e,_0x230aea){return respondWithRpcPromise('FaxQueues',_0x23a56e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x230aea,null))[_0xf326('0xc')](handleError(_0x230aea,null));};exports[_0xf326('0x4c')]=function(_0x58de1e,_0x3717fe){return respondWithRpcPromise('FaxQueues',_0x58de1e['query'],routingClient)[_0xf326('0x8')](findById(_0x58de1e['params']['id']))[_0xf326('0x8')](respondWithResult(_0x3717fe,null))[_0xf326('0xc')](handleError(_0x3717fe,null));};exports[_0xf326('0x4d')]=function(_0x2ea5a2,_0x17cd36){return respondWithRpcPromise('FaxAccounts',_0x2ea5a2['query'])['then'](respondWithResult(_0x17cd36,null))[_0xf326('0xc')](handleError(_0x17cd36,null));};exports[_0xf326('0x4e')]=function(_0x229a34,_0x180616){return respondWithRpcPromise(_0xf326('0x4f'),_0x229a34['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x180616,null))[_0xf326('0xc')](handleError(_0x180616,null));};exports[_0xf326('0x50')]=function(_0x4f9a6a,_0x567492){return respondWithRpcPromise(_0xf326('0x51'),_0x4f9a6a[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x567492,null))['catch'](handleError(_0x567492,null));};exports[_0xf326('0x52')]=function(_0x5ba28d,_0xc3a897){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ba28d['query'],routingClient)['then'](respondWithResult(_0xc3a897,null))[_0xf326('0xc')](handleError(_0xc3a897,null));};exports[_0xf326('0x53')]=function(_0xd44071,_0x4838d5){return respondWithRpcPromise(_0xf326('0x54'),_0xd44071[_0xf326('0x16')],routingClient)[_0xf326('0x8')](function(_0x457f3d){if(_0xd44071[_0xf326('0x16')][_0xf326('0x55')]!==undefined){var _0x7f6d0e=_(_0x457f3d[_0xf326('0x13')])[_0xf326('0x56')]([_0xd44071['query'][_0xf326('0x55')],_0xd44071['params']['id']])[_0xf326('0x57')](_0xf326('0x58'))[_0xf326('0x59')]()['value']();return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x39c90d){return _0x7f6d0e['indexOf'](_0x39c90d[_0xf326('0x58')])>-0x1;});}else{return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x42c7cf){return _0x42c7cf['queue_id']===parseInt(_0xd44071[_0xf326('0x17')]['id']);});}})['then'](respondWithResult(_0x4838d5,null))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x5a')]=function(_0x2c36d3,_0x5af6b7){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c36d3['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5af6b7,null))['catch'](handleError(_0x5af6b7,null));};exports[_0xf326('0x5b')]=function(_0x37a564,_0x3434b2){return respondWithRpcPromise(_0xf326('0x5c'),_0x37a564[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x3434b2,null))['catch'](handleError(_0x3434b2,null));};exports[_0xf326('0x5d')]=function(_0x323926,_0x5f1724){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x323926[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x5f1724,null))[_0xf326('0xc')](handleError(_0x5f1724,null));};exports[_0xf326('0x5e')]=function(_0x153027){return function(_0x363e64,_0x19d676){var _0x6e662,_0x293600;var _0x8ca46f=_[_0xf326('0x5f')](_0x153027);var _0x499cbd=_0x153027===_0xf326('0x60')?_0xf326('0x61'):'Account';return db[_0x8ca46f+_0xf326('0x62')]['findOne']({'raw':!![],'where':{'id':_0x363e64[_0xf326('0x17')]['id']}})[_0xf326('0x8')](function(_0x14e8c0){if(_['isNil'](_0x14e8c0)){throw new Error(_0x8ca46f+_0xf326('0x63'));}_0x6e662=_0x14e8c0;return db[_0x8ca46f+_0xf326('0x64')][_0xf326('0x65')]({'where':{'id':_0x363e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x8ca46f+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x8ca46f+_0x499cbd],'as':_0xf326('0x68')}]});})[_0xf326('0x8')](function(_0x38b696){if(_[_0xf326('0x12')](_0x38b696)){throw new Error(_0x8ca46f+_0xf326('0x69'));}_0x293600=_0x38b696;return _0x38b696[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x1f990d={'uniqueid':_0x153027+'.'+_0x293600['id']+'.'+_0x293600['Interaction']['id'],'FromUserId':_0x363e64[_0xf326('0x2b')]['id'],'type':_0xf326('0x6b')};_0x1f990d[_0x8ca46f+'MessageId']=_0x293600['id'];_0x1f990d[_0x8ca46f+_0xf326('0x6c')]=_0x293600[_0xf326('0x67')]['id'];_0x1f990d['From'+_0x8ca46f+_0x499cbd+'Id']=_0x293600[_0xf326('0x68')]['id'];_0x1f990d['To'+_0x8ca46f+_0xf326('0x6d')]=_0x6e662['id'];return db[_0x8ca46f+_0xf326('0x6e')][_0xf326('0x6f')](_0x1f990d);})[_0xf326('0x8')](function(){return respondWithRpcPromise(_0xf326('0x70'),{'channel':_0x153027,'interaction':_0x293600[_0xf326('0x67')],'message':_0x293600,'account':_0x293600['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x6b'),'appdata':_0x6e662[_0xf326('0x10')]+','+(_0x293600[_0xf326('0x68')][_0xf326('0x71')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0x19d676,null))[_0xf326('0xc')](handleError(_0x19d676,null));};};exports[_0xf326('0x73')]=function(_0x486e64,_0xa8e05b){var _0x2e2103,_0x49c3da;if(_[_0xf326('0x12')](_0x486e64['body'][_0xf326('0x74')])){throw new Error(_0xf326('0x75'));}var _0x16bc97=_0x486e64[_0xf326('0x1e')][_0xf326('0x74')];var _0x3097cf=_[_0xf326('0x5f')](_0x16bc97);var _0x1eb29d=_0x16bc97===_0xf326('0x60')?_0xf326('0x61'):_0xf326('0x68');return db[_0xf326('0x76')][_0xf326('0x65')]({'raw':!![],'where':{'id':_0x486e64[_0xf326('0x17')]['id'],'role':'agent'}})[_0xf326('0x8')](function(_0xdb6e40){if(_[_0xf326('0x12')](_0xdb6e40)){throw new Error(_0xf326('0x77'));}_0x2e2103=_0xdb6e40;return db[_0x3097cf+_0xf326('0x64')]['findOne']({'where':{'id':_0x486e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x3097cf+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x3097cf+_0x1eb29d],'as':_0xf326('0x68')}]});})['then'](function(_0x4b6ec0){if(_[_0xf326('0x12')](_0x4b6ec0)){throw new Error(_0x3097cf+'\x20Message\x20not\x20found');}_0x49c3da=_0x4b6ec0;return _0x4b6ec0[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x29610a={'uniqueid':_0x16bc97+'.'+_0x49c3da['id']+'.'+_0x49c3da['Interaction']['id'],'FromUserId':_0x486e64['user']['id'],'type':_0xf326('0x6b'),'ToUserId':_0x2e2103['id']};_0x29610a[_0x3097cf+_0xf326('0x78')]=_0x49c3da['id'];_0x29610a[_0x3097cf+_0xf326('0x6c')]=_0x49c3da[_0xf326('0x67')]['id'];_0x29610a[_0xf326('0x79')+_0x3097cf+_0x1eb29d+'Id']=_0x49c3da['Account']['id'];return db[_0x3097cf+_0xf326('0x6e')][_0xf326('0x6f')](_0x29610a);})[_0xf326('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x16bc97,'interaction':_0x49c3da['Interaction'],'message':_0x49c3da,'account':_0x49c3da['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x36'),'appdata':_0x2e2103[_0xf326('0x10')]+','+(_0x49c3da[_0xf326('0x68')][_0xf326('0x7a')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0xa8e05b,null))[_0xf326('0xc')](handleError(_0xa8e05b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 8313faa..83b6de4 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 _0x8d81=['../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','run','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x8d81,0x1f1));var _0x18d8=function(_0x33dd8d,_0x26cc07){_0x33dd8d=_0x33dd8d-0x0;var _0x522b1a=_0x8d81[_0x33dd8d];return _0x522b1a;};'use strict';var multer=require(_0x18d8('0x0'));var util=require(_0x18d8('0x1'));var path=require('path');var timeout=require(_0x18d8('0x2'));var express=require(_0x18d8('0x3'));var router=express[_0x18d8('0x4')]();var fs_extra=require(_0x18d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x18d8('0x6'));var config=require(_0x18d8('0x7'));var controller=require(_0x18d8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x18d8('0x9')](_0x18d8('0xa'),auth[_0x18d8('0xb')](),controller[_0x18d8('0xc')]);router[_0x18d8('0x9')](_0x18d8('0xd'),auth['isAuthenticated'](),controller[_0x18d8('0xe')]);router[_0x18d8('0xf')]('/',auth[_0x18d8('0xb')](),controller[_0x18d8('0x10')]);router[_0x18d8('0x11')](_0x18d8('0xa'),auth[_0x18d8('0xb')](),controller[_0x18d8('0x12')]);router[_0x18d8('0x13')](_0x18d8('0xa'),auth['isAuthenticated'](),controller[_0x18d8('0x14')]);module['exports']=router; \ No newline at end of file +var _0x09f8=['delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','index','get','/:id','isAuthenticated','/:id/run','post','put','update'];(function(_0x760723,_0x9404d8){var _0x491190=function(_0x139b25){while(--_0x139b25){_0x760723['push'](_0x760723['shift']());}};_0x491190(++_0x9404d8);}(_0x09f8,0x134));var _0x809f=function(_0xe244a3,_0x19ace6){_0xe244a3=_0xe244a3-0x0;var _0x2234f4=_0x09f8[_0xe244a3];return _0x2234f4;};'use strict';var multer=require('multer');var util=require(_0x809f('0x0'));var path=require(_0x809f('0x1'));var timeout=require('connect-timeout');var express=require(_0x809f('0x2'));var router=express[_0x809f('0x3')]();var fs_extra=require(_0x809f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x809f('0x5'));var config=require(_0x809f('0x6'));var controller=require(_0x809f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x809f('0x8')]);router[_0x809f('0x9')](_0x809f('0xa'),auth[_0x809f('0xb')](),controller['show']);router[_0x809f('0x9')](_0x809f('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x809f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x809f('0xe')](_0x809f('0xa'),auth[_0x809f('0xb')](),controller[_0x809f('0xf')]);router[_0x809f('0x10')](_0x809f('0xa'),auth[_0x809f('0xb')](),controller[_0x809f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 31e30b6..023f19c 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 _0xb582=['months','weeks','days','hours','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb582,0xc9));var _0x2b58=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb582[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x2b58('0x0'));module[_0x2b58('0x1')]={'name':{'type':Sequelize[_0x2b58('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2b58('0x2')]},'active':{'type':Sequelize[_0x2b58('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2b58('0x2')],'allowNull':![],'defaultValue':_0x2b58('0x4')},'startAt':{'type':Sequelize[_0x2b58('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2b58('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2b58('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2b58('0x7'),'quarters',_0x2b58('0x8'),_0x2b58('0x9'),_0x2b58('0xa'),_0x2b58('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x2b58('0xa')},'output':{'type':Sequelize[_0x2b58('0xc')](_0x2b58('0xd'),_0x2b58('0xe'),_0x2b58('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x2b58('0xc')](_0x2b58('0x10'),_0x2b58('0x11')),'allowNull':![],'defaultValue':_0x2b58('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x2b58('0x2')]},'cc':{'type':Sequelize[_0x2b58('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa2a6=['custom','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','hours','minutes','days','csv','pdf','xlsx'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xa2a6,0x134));var _0x6a2a=function(_0x91a401,_0xb0fdd8){_0x91a401=_0x91a401-0x0;var _0xc832e3=_0xa2a6[_0x91a401];return _0xc832e3;};'use strict';var Sequelize=require(_0x6a2a('0x0'));module[_0x6a2a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6a2a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6a2a('0x3')},'startAt':{'type':Sequelize[_0x6a2a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6a2a('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6a2a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6a2a('0x6')](_0x6a2a('0x7'),_0x6a2a('0x8'),'months','weeks','days',_0x6a2a('0x9'),_0x6a2a('0xa')),'allowNull':![],'defaultValue':_0x6a2a('0xb')},'output':{'type':Sequelize[_0x6a2a('0x6')](_0x6a2a('0xc'),_0x6a2a('0xd'),_0x6a2a('0xe')),'allowNull':![],'defaultValue':_0x6a2a('0xc')},'type':{'type':Sequelize['ENUM'](_0x6a2a('0xf'),_0x6a2a('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6a2a('0x11')]},'bcc':{'type':Sequelize[_0x6a2a('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x6a2a('0x12')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index d61aa42..a0f8837 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 _0x9741=['nolimit','sort','pick','filter','where','merge','options','findAll','rows','keys','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','params','run','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','filters','intersection','fields','attributes','length','query'];(function(_0x40552c,_0x410889){var _0xdda8cf=function(_0x27dc6c){while(--_0x27dc6c){_0x40552c['push'](_0x40552c['shift']());}};_0xdda8cf(++_0x410889);}(_0x9741,0xb2));var _0x1974=function(_0x41c6ae,_0x313008){_0x41c6ae=_0x41c6ae-0x0;var _0x395a8a=_0x9741[_0x41c6ae];return _0x395a8a;};'use strict';var emlformat=require(_0x1974('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1974('0x1'));var BPromise=require(_0x1974('0x2'));var Mustache=require(_0x1974('0x3'));var util=require(_0x1974('0x4'));var path=require(_0x1974('0x5'));var sox=require(_0x1974('0x6'));var csv=require(_0x1974('0x7'));var ejs=require(_0x1974('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1974('0x9'));var squel=require(_0x1974('0xa'));var crypto=require(_0x1974('0xb'));var jsforce=require(_0x1974('0xc'));var deskjs=require(_0x1974('0xd'));var toCsv=require(_0x1974('0x7'));var querystring=require(_0x1974('0xe'));var Papa=require(_0x1974('0xf'));var Redis=require(_0x1974('0x10'));var authService=require(_0x1974('0x11'));var qs=require(_0x1974('0x12'));var as=require(_0x1974('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1974('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1974('0x15'))['db'];function respondWithStatusCode(_0x202ec7,_0x5201ae){_0x5201ae=_0x5201ae||0xcc;return function(_0x16e281){if(_0x16e281){return _0x202ec7['sendStatus'](_0x5201ae);}return _0x202ec7[_0x1974('0x16')](_0x5201ae)[_0x1974('0x17')]();};}function respondWithResult(_0x307b57,_0x137814){_0x137814=_0x137814||0xc8;return function(_0x3de8fd){if(_0x3de8fd){return _0x307b57[_0x1974('0x16')](_0x137814)[_0x1974('0x18')](_0x3de8fd);}};}function respondWithFilteredResult(_0x1ddf93,_0x1966a7){return function(_0x1c252d){if(_0x1c252d){var _0x5edb5b=typeof _0x1966a7[_0x1974('0x19')]===_0x1974('0x1a')&&typeof _0x1966a7[_0x1974('0x1b')]===_0x1974('0x1a');var _0x3539a8=_0x1c252d[_0x1974('0x1c')];var _0xf4eacf=_0x5edb5b?0x0:_0x1966a7[_0x1974('0x19')];var _0x5e5599=_0x5edb5b?_0x1c252d[_0x1974('0x1c')]:_0x1966a7['offset']+_0x1966a7[_0x1974('0x1b')];var _0x47e34d;if(_0x5e5599>=_0x3539a8){_0x5e5599=_0x3539a8;_0x47e34d=0xc8;}else{_0x47e34d=0xce;}_0x1ddf93[_0x1974('0x16')](_0x47e34d);return _0x1ddf93['set'](_0x1974('0x1d'),_0xf4eacf+'-'+_0x5e5599+'/'+_0x3539a8)[_0x1974('0x18')](_0x1c252d);}return null;};}function patchUpdates(_0x244425){return function(_0x2338bb){try{jsonpatch['apply'](_0x2338bb,_0x244425,!![]);}catch(_0xd3815a){return BPromise[_0x1974('0x1e')](_0xd3815a);}return _0x2338bb[_0x1974('0x1f')]();};}function saveUpdates(_0x2c9b21,_0x14104b){return function(_0xc7e563){if(_0xc7e563){return _0xc7e563[_0x1974('0x20')](_0x2c9b21)[_0x1974('0x21')](function(_0x5653d7){return _0x5653d7;});}return null;};}function removeEntity(_0x3553cf,_0x39bb1f){return function(_0x2cb7d3){if(_0x2cb7d3){return _0x2cb7d3[_0x1974('0x22')]()['then'](function(){var _0x1938c4=_0x2cb7d3[_0x1974('0x23')]({'plain':!![]});var _0x27c5e0=_0x1974('0x24');return db[_0x1974('0x25')][_0x1974('0x22')]({'where':{'type':_0x27c5e0,'resourceId':_0x1938c4['id']}})[_0x1974('0x21')](function(){return _0x2cb7d3;});})[_0x1974('0x21')](function(){_0x3553cf[_0x1974('0x16')](0xcc)[_0x1974('0x17')]();});}};}function handleEntityNotFound(_0x4df01f,_0x701c71){return function(_0x5cdd8b){if(!_0x5cdd8b){_0x4df01f[_0x1974('0x26')](0x194);}return _0x5cdd8b;};}function handleError(_0x449c17,_0x5addcd){_0x5addcd=_0x5addcd||0x1f4;return function(_0x334c39){logger['error'](_0x334c39[_0x1974('0x27')]);if(_0x334c39['name']){delete _0x334c39[_0x1974('0x28')];}_0x449c17[_0x1974('0x16')](_0x5addcd)[_0x1974('0x29')](_0x334c39);};}exports[_0x1974('0x2a')]=function(_0x18facc,_0xfcbaeb){var _0x41eff5={},_0x526953={},_0x40f88e={'count':0x0,'rows':[]};var _0x52f12f=_['map'](db[_0x1974('0x2b')][_0x1974('0x2c')],function(_0x28c720){return{'name':_0x28c720[_0x1974('0x2d')],'type':_0x28c720[_0x1974('0x2e')][_0x1974('0x2f')]};});_0x526953[_0x1974('0x30')]=_[_0x1974('0x31')](_0x52f12f,'name');_0x526953['query']=_['keys'](_0x18facc['query']);_0x526953[_0x1974('0x32')]=_[_0x1974('0x33')](_0x526953[_0x1974('0x30')],_0x526953['query']);_0x41eff5['attributes']=_[_0x1974('0x33')](_0x526953[_0x1974('0x30')],qs['fields'](_0x18facc['query'][_0x1974('0x34')]));_0x41eff5[_0x1974('0x35')]=_0x41eff5[_0x1974('0x35')][_0x1974('0x36')]?_0x41eff5[_0x1974('0x35')]:_0x526953[_0x1974('0x30')];if(!_0x18facc[_0x1974('0x37')]['hasOwnProperty'](_0x1974('0x38'))){_0x41eff5[_0x1974('0x1b')]=qs[_0x1974('0x1b')](_0x18facc[_0x1974('0x37')][_0x1974('0x1b')]);_0x41eff5['offset']=qs[_0x1974('0x19')](_0x18facc[_0x1974('0x37')]['offset']);}_0x41eff5['order']=qs[_0x1974('0x39')](_0x18facc[_0x1974('0x37')]['sort']);_0x41eff5['where']=qs['filters'](_[_0x1974('0x3a')](_0x18facc['query'],_0x526953['filters']),_0x52f12f);if(_0x18facc[_0x1974('0x37')][_0x1974('0x3b')]){_0x41eff5[_0x1974('0x3c')]=_[_0x1974('0x3d')](_0x41eff5['where'],{'$or':_[_0x1974('0x31')](_0x52f12f,function(_0x1133c7){if(_0x1133c7[_0x1974('0x2e')]!=='VIRTUAL'){var _0x3e3a0c={};_0x3e3a0c[_0x1133c7['name']]={'$like':'%'+_0x18facc['query'][_0x1974('0x3b')]+'%'};return _0x3e3a0c;}})});}_0x41eff5=_[_0x1974('0x3d')]({},_0x41eff5,_0x18facc[_0x1974('0x3e')]);var _0x5305c7={'where':_0x41eff5[_0x1974('0x3c')]};return db[_0x1974('0x2b')][_0x1974('0x1c')](_0x5305c7)[_0x1974('0x21')](function(_0x3ce877){_0x40f88e[_0x1974('0x1c')]=_0x3ce877;if(_0x18facc[_0x1974('0x37')]['includeAll']){_0x41eff5['include']=[{'all':!![]}];}return db[_0x1974('0x2b')][_0x1974('0x3f')](_0x41eff5);})[_0x1974('0x21')](function(_0x5525f0){_0x40f88e[_0x1974('0x40')]=_0x5525f0;return _0x40f88e;})[_0x1974('0x21')](respondWithFilteredResult(_0xfcbaeb,_0x41eff5))['catch'](handleError(_0xfcbaeb,null));};exports['show']=function(_0x1ffb6a,_0x3283cb){var _0xd5c68c={'raw':![],'where':{'id':_0x1ffb6a['params']['id']}},_0x386991={};_0x386991[_0x1974('0x30')]=_[_0x1974('0x41')](db[_0x1974('0x2b')][_0x1974('0x2c')]);_0x386991[_0x1974('0x37')]=_[_0x1974('0x41')](_0x1ffb6a[_0x1974('0x37')]);_0x386991[_0x1974('0x32')]=_[_0x1974('0x33')](_0x386991[_0x1974('0x30')],_0x386991[_0x1974('0x37')]);_0xd5c68c[_0x1974('0x35')]=_[_0x1974('0x33')](_0x386991['model'],qs[_0x1974('0x34')](_0x1ffb6a[_0x1974('0x37')]['fields']));_0xd5c68c['attributes']=_0xd5c68c[_0x1974('0x35')][_0x1974('0x36')]?_0xd5c68c[_0x1974('0x35')]:_0x386991[_0x1974('0x30')];if(_0x1ffb6a[_0x1974('0x37')][_0x1974('0x42')]){_0xd5c68c[_0x1974('0x43')]=[{'all':!![]}];}_0xd5c68c=_[_0x1974('0x3d')]({},_0xd5c68c,_0x1ffb6a['options']);return db[_0x1974('0x2b')][_0x1974('0x44')](_0xd5c68c)[_0x1974('0x21')](handleEntityNotFound(_0x3283cb,null))[_0x1974('0x21')](respondWithResult(_0x3283cb,null))[_0x1974('0x45')](handleError(_0x3283cb,null));};exports['create']=function(_0x5ee7f8,_0x3ec7b7){return db[_0x1974('0x2b')][_0x1974('0x46')](_0x5ee7f8[_0x1974('0x47')],{})[_0x1974('0x21')](function(_0x4adf10){var _0x384754=_0x5ee7f8[_0x1974('0x48')][_0x1974('0x23')]({'plain':!![]});if(!_0x384754)throw new Error(_0x1974('0x49'));if(_0x384754[_0x1974('0x4a')]===_0x1974('0x48')){var _0x3d448c=_0x4adf10[_0x1974('0x23')]({'plain':!![]});var _0x137213='Scheduler';return db['UserProfileSection'][_0x1974('0x44')]({'where':{'name':_0x137213,'userProfileId':_0x384754[_0x1974('0x4b')]},'raw':!![]})[_0x1974('0x21')](function(_0x15b031){if(_0x15b031&&_0x15b031['autoAssociation']===0x0){return db[_0x1974('0x25')]['create']({'name':_0x3d448c['name'],'resourceId':_0x3d448c['id'],'type':_0x15b031[_0x1974('0x28')],'sectionId':_0x15b031['id']},{})['then'](function(){return _0x4adf10;});}else{return _0x4adf10;}})[_0x1974('0x45')](function(_0x2cfcee){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cfcee);throw _0x2cfcee;});}return _0x4adf10;})[_0x1974('0x21')](respondWithResult(_0x3ec7b7,0xc9))[_0x1974('0x45')](handleError(_0x3ec7b7,null));};exports['update']=function(_0x33ac43,_0x15a38f){if(_0x33ac43[_0x1974('0x47')]['id']){delete _0x33ac43['body']['id'];}return db[_0x1974('0x2b')]['find']({'where':{'id':_0x33ac43[_0x1974('0x4c')]['id']}})[_0x1974('0x21')](handleEntityNotFound(_0x15a38f,null))[_0x1974('0x21')](saveUpdates(_0x33ac43[_0x1974('0x47')],null))[_0x1974('0x21')](respondWithResult(_0x15a38f,null))[_0x1974('0x45')](handleError(_0x15a38f,null));};exports['destroy']=function(_0x3c949b,_0x20a3c3){return db[_0x1974('0x2b')][_0x1974('0x44')]({'where':{'id':_0x3c949b[_0x1974('0x4c')]['id']}})[_0x1974('0x21')](handleEntityNotFound(_0x20a3c3,null))[_0x1974('0x21')](removeEntity(_0x20a3c3,null))[_0x1974('0x45')](handleError(_0x20a3c3,null));};exports[_0x1974('0x4d')]=function(_0x56056a,_0x20fd07,_0x3cf13b){var _0x51abd1=require('../../config/schedule');return db[_0x1974('0x2b')]['find']({'where':{'id':_0x56056a[_0x1974('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x20fd07,null))[_0x1974('0x21')](function(){_0x51abd1[_0x1974('0x4d')](_0x56056a[_0x1974('0x4c')]['id']);})[_0x1974('0x21')](respondWithStatusCode(_0x20fd07,null))[_0x1974('0x45')](handleError(_0x20fd07,null));}; \ No newline at end of file +var _0x2145=['VIRTUAL','merge','options','Schedule','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Scheduler','userProfileId','UserProfileResource','update','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','type'];(function(_0x4e3498,_0x530c7f){var _0x57f2fb=function(_0x96c8e){while(--_0x96c8e){_0x4e3498['push'](_0x4e3498['shift']());}};_0x57f2fb(++_0x530c7f);}(_0x2145,0x1b6));var _0x5214=function(_0x8ee35b,_0x2e4369){_0x8ee35b=_0x8ee35b-0x0;var _0x21bd6c=_0x2145[_0x8ee35b];return _0x21bd6c;};'use strict';var emlformat=require(_0x5214('0x0'));var rimraf=require(_0x5214('0x1'));var zipdir=require(_0x5214('0x2'));var jsonpatch=require(_0x5214('0x3'));var rp=require(_0x5214('0x4'));var moment=require(_0x5214('0x5'));var BPromise=require(_0x5214('0x6'));var Mustache=require(_0x5214('0x7'));var util=require(_0x5214('0x8'));var path=require(_0x5214('0x9'));var sox=require(_0x5214('0xa'));var csv=require(_0x5214('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5214('0xc'));var squel=require(_0x5214('0xd'));var crypto=require(_0x5214('0xe'));var jsforce=require(_0x5214('0xf'));var deskjs=require(_0x5214('0x10'));var toCsv=require(_0x5214('0xb'));var querystring=require(_0x5214('0x11'));var Papa=require(_0x5214('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5214('0x13'));var as=require(_0x5214('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5214('0x15'));var licenseUtil=require(_0x5214('0x16'));var db=require(_0x5214('0x17'))['db'];function respondWithStatusCode(_0x10c999,_0x990ac0){_0x990ac0=_0x990ac0||0xcc;return function(_0x18dce6){if(_0x18dce6){return _0x10c999[_0x5214('0x18')](_0x990ac0);}return _0x10c999[_0x5214('0x19')](_0x990ac0)[_0x5214('0x1a')]();};}function respondWithResult(_0x12b19b,_0x1ee7bf){_0x1ee7bf=_0x1ee7bf||0xc8;return function(_0x589bd0){if(_0x589bd0){return _0x12b19b[_0x5214('0x19')](_0x1ee7bf)[_0x5214('0x1b')](_0x589bd0);}};}function respondWithFilteredResult(_0x427591,_0x570956){return function(_0x33fd10){if(_0x33fd10){var _0x598048=typeof _0x570956[_0x5214('0x1c')]==='undefined'&&typeof _0x570956['limit']===_0x5214('0x1d');var _0x30427c=_0x33fd10[_0x5214('0x1e')];var _0xf7af15=_0x598048?0x0:_0x570956[_0x5214('0x1c')];var _0x1a33a0=_0x598048?_0x33fd10[_0x5214('0x1e')]:_0x570956[_0x5214('0x1c')]+_0x570956['limit'];var _0x1a1919;if(_0x1a33a0>=_0x30427c){_0x1a33a0=_0x30427c;_0x1a1919=0xc8;}else{_0x1a1919=0xce;}_0x427591['status'](_0x1a1919);return _0x427591['set'](_0x5214('0x1f'),_0xf7af15+'-'+_0x1a33a0+'/'+_0x30427c)[_0x5214('0x1b')](_0x33fd10);}return null;};}function patchUpdates(_0x715f76){return function(_0x19af2a){try{jsonpatch[_0x5214('0x20')](_0x19af2a,_0x715f76,!![]);}catch(_0x2ace33){return BPromise[_0x5214('0x21')](_0x2ace33);}return _0x19af2a['save']();};}function saveUpdates(_0x2400da,_0x455536){return function(_0x5450b1){if(_0x5450b1){return _0x5450b1['update'](_0x2400da)[_0x5214('0x22')](function(_0x4e69a6){return _0x4e69a6;});}return null;};}function removeEntity(_0x246dfc,_0x1ef58c){return function(_0x1a3007){if(_0x1a3007){return _0x1a3007[_0x5214('0x23')]()['then'](function(){var _0x228733=_0x1a3007['get']({'plain':!![]});var _0x39fe61='Scheduler';return db['UserProfileResource'][_0x5214('0x23')]({'where':{'type':_0x39fe61,'resourceId':_0x228733['id']}})[_0x5214('0x22')](function(){return _0x1a3007;});})[_0x5214('0x22')](function(){_0x246dfc[_0x5214('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x283faf,_0x283b75){return function(_0x364367){if(!_0x364367){_0x283faf[_0x5214('0x18')](0x194);}return _0x364367;};}function handleError(_0x56ed48,_0x308643){_0x308643=_0x308643||0x1f4;return function(_0x4425cd){logger[_0x5214('0x24')](_0x4425cd[_0x5214('0x25')]);if(_0x4425cd[_0x5214('0x26')]){delete _0x4425cd[_0x5214('0x26')];}_0x56ed48[_0x5214('0x19')](_0x308643)[_0x5214('0x27')](_0x4425cd);};}exports[_0x5214('0x28')]=function(_0x23f554,_0x4479b0){var _0x4e6c98={},_0x4a24b8={},_0x1ea8ee={'count':0x0,'rows':[]};var _0x32112f=_[_0x5214('0x29')](db['Schedule'][_0x5214('0x2a')],function(_0x4cc8d1){return{'name':_0x4cc8d1[_0x5214('0x2b')],'type':_0x4cc8d1['type'][_0x5214('0x2c')]};});_0x4a24b8[_0x5214('0x2d')]=_[_0x5214('0x29')](_0x32112f,_0x5214('0x26'));_0x4a24b8[_0x5214('0x2e')]=_[_0x5214('0x2f')](_0x23f554[_0x5214('0x2e')]);_0x4a24b8[_0x5214('0x30')]=_[_0x5214('0x31')](_0x4a24b8[_0x5214('0x2d')],_0x4a24b8[_0x5214('0x2e')]);_0x4e6c98[_0x5214('0x32')]=_[_0x5214('0x31')](_0x4a24b8[_0x5214('0x2d')],qs['fields'](_0x23f554[_0x5214('0x2e')][_0x5214('0x33')]));_0x4e6c98[_0x5214('0x32')]=_0x4e6c98[_0x5214('0x32')]['length']?_0x4e6c98[_0x5214('0x32')]:_0x4a24b8[_0x5214('0x2d')];if(!_0x23f554[_0x5214('0x2e')][_0x5214('0x34')](_0x5214('0x35'))){_0x4e6c98[_0x5214('0x36')]=qs[_0x5214('0x36')](_0x23f554[_0x5214('0x2e')][_0x5214('0x36')]);_0x4e6c98[_0x5214('0x1c')]=qs[_0x5214('0x1c')](_0x23f554[_0x5214('0x2e')][_0x5214('0x1c')]);}_0x4e6c98[_0x5214('0x37')]=qs[_0x5214('0x38')](_0x23f554[_0x5214('0x2e')][_0x5214('0x38')]);_0x4e6c98[_0x5214('0x39')]=qs[_0x5214('0x30')](_['pick'](_0x23f554[_0x5214('0x2e')],_0x4a24b8[_0x5214('0x30')]),_0x32112f);if(_0x23f554['query'][_0x5214('0x3a')]){_0x4e6c98[_0x5214('0x39')]=_['merge'](_0x4e6c98[_0x5214('0x39')],{'$or':_[_0x5214('0x29')](_0x32112f,function(_0x442e73){if(_0x442e73[_0x5214('0x3b')]!==_0x5214('0x3c')){var _0x729222={};_0x729222[_0x442e73['name']]={'$like':'%'+_0x23f554['query'][_0x5214('0x3a')]+'%'};return _0x729222;}})});}_0x4e6c98=_[_0x5214('0x3d')]({},_0x4e6c98,_0x23f554[_0x5214('0x3e')]);var _0x2aef1c={'where':_0x4e6c98['where']};return db[_0x5214('0x3f')][_0x5214('0x1e')](_0x2aef1c)[_0x5214('0x22')](function(_0x38fd5f){_0x1ea8ee[_0x5214('0x1e')]=_0x38fd5f;if(_0x23f554['query'][_0x5214('0x40')]){_0x4e6c98[_0x5214('0x41')]=[{'all':!![]}];}return db[_0x5214('0x3f')][_0x5214('0x42')](_0x4e6c98);})[_0x5214('0x22')](function(_0x3587ce){_0x1ea8ee[_0x5214('0x43')]=_0x3587ce;return _0x1ea8ee;})[_0x5214('0x22')](respondWithFilteredResult(_0x4479b0,_0x4e6c98))[_0x5214('0x44')](handleError(_0x4479b0,null));};exports[_0x5214('0x45')]=function(_0x490155,_0x36bcf9){var _0x5d2bb7={'raw':![],'where':{'id':_0x490155[_0x5214('0x46')]['id']}},_0x5abb49={};_0x5abb49[_0x5214('0x2d')]=_[_0x5214('0x2f')](db[_0x5214('0x3f')][_0x5214('0x2a')]);_0x5abb49[_0x5214('0x2e')]=_[_0x5214('0x2f')](_0x490155[_0x5214('0x2e')]);_0x5abb49[_0x5214('0x30')]=_[_0x5214('0x31')](_0x5abb49['model'],_0x5abb49['query']);_0x5d2bb7['attributes']=_[_0x5214('0x31')](_0x5abb49['model'],qs[_0x5214('0x33')](_0x490155['query'][_0x5214('0x33')]));_0x5d2bb7[_0x5214('0x32')]=_0x5d2bb7[_0x5214('0x32')][_0x5214('0x47')]?_0x5d2bb7[_0x5214('0x32')]:_0x5abb49[_0x5214('0x2d')];if(_0x490155[_0x5214('0x2e')][_0x5214('0x40')]){_0x5d2bb7[_0x5214('0x41')]=[{'all':!![]}];}_0x5d2bb7=_[_0x5214('0x3d')]({},_0x5d2bb7,_0x490155[_0x5214('0x3e')]);return db[_0x5214('0x3f')][_0x5214('0x48')](_0x5d2bb7)['then'](handleEntityNotFound(_0x36bcf9,null))[_0x5214('0x22')](respondWithResult(_0x36bcf9,null))[_0x5214('0x44')](handleError(_0x36bcf9,null));};exports[_0x5214('0x49')]=function(_0x55396b,_0x1c5023){return db[_0x5214('0x3f')]['create'](_0x55396b[_0x5214('0x4a')],{})[_0x5214('0x22')](function(_0x1d4104){var _0xe0b3e0=_0x55396b[_0x5214('0x4b')][_0x5214('0x4c')]({'plain':!![]});if(!_0xe0b3e0)throw new Error(_0x5214('0x4d'));if(_0xe0b3e0['role']===_0x5214('0x4b')){var _0x25327a=_0x1d4104[_0x5214('0x4c')]({'plain':!![]});var _0x3991ae=_0x5214('0x4e');return db['UserProfileSection'][_0x5214('0x48')]({'where':{'name':_0x3991ae,'userProfileId':_0xe0b3e0[_0x5214('0x4f')]},'raw':!![]})['then'](function(_0x242d2c){if(_0x242d2c&&_0x242d2c['autoAssociation']===0x0){return db[_0x5214('0x50')][_0x5214('0x49')]({'name':_0x25327a[_0x5214('0x26')],'resourceId':_0x25327a['id'],'type':_0x242d2c[_0x5214('0x26')],'sectionId':_0x242d2c['id']},{})[_0x5214('0x22')](function(){return _0x1d4104;});}else{return _0x1d4104;}})['catch'](function(_0x4d2eba){logger[_0x5214('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d2eba);throw _0x4d2eba;});}return _0x1d4104;})[_0x5214('0x22')](respondWithResult(_0x1c5023,0xc9))[_0x5214('0x44')](handleError(_0x1c5023,null));};exports[_0x5214('0x51')]=function(_0x3ab472,_0x4a4afd){if(_0x3ab472[_0x5214('0x4a')]['id']){delete _0x3ab472[_0x5214('0x4a')]['id'];}return db['Schedule'][_0x5214('0x48')]({'where':{'id':_0x3ab472[_0x5214('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a4afd,null))['then'](saveUpdates(_0x3ab472['body'],null))[_0x5214('0x22')](respondWithResult(_0x4a4afd,null))[_0x5214('0x44')](handleError(_0x4a4afd,null));};exports[_0x5214('0x23')]=function(_0x55561c,_0x4a58ab){return db[_0x5214('0x3f')][_0x5214('0x48')]({'where':{'id':_0x55561c[_0x5214('0x46')]['id']}})[_0x5214('0x22')](handleEntityNotFound(_0x4a58ab,null))['then'](removeEntity(_0x4a58ab,null))[_0x5214('0x44')](handleError(_0x4a58ab,null));};exports['run']=function(_0x694277,_0x53bffa,_0x1cc196){var _0x46c74d=require(_0x5214('0x52'));return db[_0x5214('0x3f')][_0x5214('0x48')]({'where':{'id':_0x694277['params']['id']},'raw':!![]})[_0x5214('0x22')](handleEntityNotFound(_0x53bffa,null))[_0x5214('0x22')](function(){_0x46c74d['run'](_0x694277['params']['id']);})[_0x5214('0x22')](respondWithStatusCode(_0x53bffa,null))[_0x5214('0x44')](handleError(_0x53bffa,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index ebdc060..c142408 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 _0xb16b=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x148ab5,_0x584ea2){var _0x1d87a1=function(_0x11d9f1){while(--_0x11d9f1){_0x148ab5['push'](_0x148ab5['shift']());}};_0x1d87a1(++_0x584ea2);}(_0xb16b,0x8c));var _0xbb16=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xb16b[_0x57474e];return _0xfaae8c;};'use strict';var _=require(_0xbb16('0x0'));var util=require(_0xbb16('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbb16('0x2'));var BPromise=require(_0xbb16('0x3'));var rp=require(_0xbb16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb16('0x5'));var config=require(_0xbb16('0x6'));var attributes=require('./schedule.attributes');module[_0xbb16('0x7')]=function(_0xa58fc0,_0x5050c9){return _0xa58fc0[_0xbb16('0x8')](_0xbb16('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe25b=['rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','api','request-promise'];(function(_0x2d392b,_0xdab741){var _0x56de8b=function(_0x2b8f54){while(--_0x2b8f54){_0x2d392b['push'](_0x2d392b['shift']());}};_0x56de8b(++_0xdab741);}(_0xe25b,0x7e));var _0xbe25=function(_0x515c82,_0x575eeb){_0x515c82=_0x515c82-0x0;var _0x2b2858=_0xe25b[_0x515c82];return _0x2b2858;};'use strict';var _=require(_0xbe25('0x0'));var util=require('util');var logger=require(_0xbe25('0x1'))(_0xbe25('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbe25('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe25('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe25('0x5'));module[_0xbe25('0x6')]=function(_0x4bf40c,_0x408b6d){return _0x4bf40c[_0xbe25('0x7')](_0xbe25('0x8'),attributes,{'tableName':_0xbe25('0x9'),'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 4617918..99217a9 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 _0x4fd8=['bluebird','randomstring','../../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','message','result','catch','lodash','util','moment'];(function(_0x4351ef,_0x178920){var _0x41a551=function(_0x337381){while(--_0x337381){_0x4351ef['push'](_0x4351ef['shift']());}};_0x41a551(++_0x178920);}(_0x4fd8,0x128));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84fd('0x0'));var util=require(_0x84fd('0x1'));var moment=require(_0x84fd('0x2'));var BPromise=require(_0x84fd('0x3'));var rs=require(_0x84fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84fd('0x5'))(_0x84fd('0x6'));var config=require(_0x84fd('0x7'));var jayson=require(_0x84fd('0x8'));var client=jayson[_0x84fd('0x9')][_0x84fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20b036,_0x5354fb,_0xafc230){return new BPromise(function(_0x1d8e83,_0x23752e){return client[_0x84fd('0xb')](_0x20b036,_0xafc230)[_0x84fd('0xc')](function(_0x4b3faf){logger[_0x84fd('0xd')](_0x84fd('0xe'),_0x5354fb,_0x84fd('0xf'));logger[_0x84fd('0x10')](_0x84fd('0x11'),_0x5354fb,_0x84fd('0xf'),JSON[_0x84fd('0x12')](_0x4b3faf));if(_0x4b3faf['error']){if(_0x4b3faf[_0x84fd('0x13')]['code']===0x1f4){logger['error'](_0x84fd('0xe'),_0x5354fb,_0x4b3faf[_0x84fd('0x13')][_0x84fd('0x14')]);return _0x23752e(_0x4b3faf[_0x84fd('0x13')][_0x84fd('0x14')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x5354fb,_0x4b3faf[_0x84fd('0x13')]['message']);return _0x1d8e83(_0x4b3faf[_0x84fd('0x13')][_0x84fd('0x14')]);}else{logger['info'](_0x84fd('0xe'),_0x5354fb,_0x84fd('0xf'));_0x1d8e83(_0x4b3faf[_0x84fd('0x15')][_0x84fd('0x14')]);}})[_0x84fd('0x16')](function(_0xd43051){logger[_0x84fd('0x13')](_0x84fd('0xe'),_0x5354fb,_0xd43051);_0x23752e(_0xd43051);});});} \ No newline at end of file +var _0x8ef6=['jayson/promise','http','then','info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4e9ca9,_0x20021c){var _0x50bd0f=function(_0x5aef98){while(--_0x5aef98){_0x4e9ca9['push'](_0x4e9ca9['shift']());}};_0x50bd0f(++_0x20021c);}(_0x8ef6,0x187));var _0x68ef=function(_0x588749,_0x13b799){_0x588749=_0x588749-0x0;var _0x4ada37=_0x8ef6[_0x588749];return _0x4ada37;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require('moment');var BPromise=require(_0x68ef('0x2'));var rs=require(_0x68ef('0x3'));var fs=require('fs');var Redis=require(_0x68ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x68ef('0x5'));var logger=require(_0x68ef('0x6'))(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var jayson=require(_0x68ef('0x9'));var client=jayson['client'][_0x68ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x188a75,_0x3d4c13,_0x29e786){return new BPromise(function(_0x5a26ae,_0x312f81){return client['request'](_0x188a75,_0x29e786)[_0x68ef('0xb')](function(_0x976910){logger[_0x68ef('0xc')](_0x68ef('0xd'),_0x3d4c13,'request\x20sent');logger['debug'](_0x68ef('0xe'),_0x3d4c13,_0x68ef('0xf'),JSON['stringify'](_0x976910));if(_0x976910[_0x68ef('0x10')]){if(_0x976910['error'][_0x68ef('0x11')]===0x1f4){logger['error'](_0x68ef('0xd'),_0x3d4c13,_0x976910[_0x68ef('0x10')][_0x68ef('0x12')]);return _0x312f81(_0x976910['error'][_0x68ef('0x12')]);}logger['error'](_0x68ef('0xd'),_0x3d4c13,_0x976910[_0x68ef('0x10')][_0x68ef('0x12')]);return _0x5a26ae(_0x976910['error'][_0x68ef('0x12')]);}else{logger[_0x68ef('0xc')](_0x68ef('0xd'),_0x3d4c13,'request\x20sent');_0x5a26ae(_0x976910[_0x68ef('0x13')][_0x68ef('0x12')]);}})['catch'](function(_0x488dea){logger['error']('Schedule,\x20%s,\x20%s',_0x3d4c13,_0x488dea);_0x312f81(_0x488dea);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7cc15d7..efa0289 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 _0x709e=['put','/:id','update','delete','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/download'];(function(_0x402f9b,_0x20d321){var _0xcd7db2=function(_0x2ff845){while(--_0x2ff845){_0x402f9b['push'](_0x402f9b['shift']());}};_0xcd7db2(++_0x20d321);}(_0x709e,0x199));var _0xe709=function(_0x1e12e8,_0x9f8894){_0x1e12e8=_0x1e12e8-0x0;var _0x251fc2=_0x709e[_0x1e12e8];return _0x251fc2;};'use strict';var multer=require(_0xe709('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe709('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe709('0x2'));var interaction=require(_0xe709('0x3'));var config=require(_0xe709('0x4'));var controller=require('./screenRecording.controller');router[_0xe709('0x5')]('/',auth[_0xe709('0x6')](),controller['index']);router[_0xe709('0x5')](_0xe709('0x7'),auth['isAuthenticated'](),controller[_0xe709('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe709('0x9')]);router['get'](_0xe709('0xa'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe709('0xb')](_0xe709('0xc'),auth[_0xe709('0x6')](),controller[_0xe709('0xd')]);router[_0xe709('0xe')](_0xe709('0xc'),auth[_0xe709('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0a31=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','create','put','update','delete','destroy','multer','util','express'];(function(_0xdef425,_0x240f76){var _0x49bbe6=function(_0x270950){while(--_0x270950){_0xdef425['push'](_0xdef425['shift']());}};_0x49bbe6(++_0x240f76);}(_0x0a31,0x162));var _0x10a3=function(_0x2e80fa,_0x19cd94){_0x2e80fa=_0x2e80fa-0x0;var _0x1ebe86=_0x0a31[_0x2e80fa];return _0x1ebe86;};'use strict';var multer=require(_0x10a3('0x0'));var util=require(_0x10a3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10a3('0x2'));var router=express[_0x10a3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x10a3('0x4'));var interaction=require(_0x10a3('0x5'));var config=require(_0x10a3('0x6'));var controller=require(_0x10a3('0x7'));router[_0x10a3('0x8')]('/',auth[_0x10a3('0x9')](),controller[_0x10a3('0xa')]);router[_0x10a3('0x8')](_0x10a3('0xb'),auth[_0x10a3('0x9')](),controller[_0x10a3('0xc')]);router[_0x10a3('0x8')](_0x10a3('0xd'),auth[_0x10a3('0x9')](),controller[_0x10a3('0xe')]);router[_0x10a3('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x10a3('0xf')]);router['post']('/',auth[_0x10a3('0x9')](),controller[_0x10a3('0x10')]);router[_0x10a3('0x11')](_0x10a3('0xd'),auth[_0x10a3('0x9')](),controller[_0x10a3('0x12')]);router[_0x10a3('0x13')](_0x10a3('0xd'),auth[_0x10a3('0x9')](),controller[_0x10a3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 090deb6..bda9dde 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 _0xd506=['getDataValue','updatedAt','sequelize','extname','STRING','replace','setDataValue','value','INTEGER','startedAt','subtract','closedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x2492a5,_0x20fcf6){var _0xdb3668=function(_0x63a38b){while(--_0x63a38b){_0x2492a5['push'](_0x2492a5['shift']());}};_0xdb3668(++_0x20fcf6);}(_0xd506,0x197));var _0x6d50=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd506[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x6d50('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0x6d50('0x1')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6d50('0x2')]},'value':{'type':Sequelize[_0x6d50('0x2')],'set':function(_0x1b0af3){var _0x4cf512=_0x1b0af3[_0x6d50('0x3')](/\\/g,'/');this[_0x6d50('0x4')](_0x6d50('0x5'),_0x4cf512);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6d50('0x6')],'set':function(_0x5012ed){this[_0x6d50('0x4')](_0x6d50('0x7'),moment()[_0x6d50('0x8')](_0x5012ed,'ms'));this[_0x6d50('0x4')](_0x6d50('0x9'),moment());this[_0x6d50('0x4')]('duration',_0x5012ed);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x6d50('0x7')))[_0x6d50('0xa')](_0x6d50('0xb'))[_0x6d50('0xc')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6d50('0xd')]('closedAt'))[_0x6d50('0xa')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6d50('0xd')]('createdAt'))[_0x6d50('0xa')](_0x6d50('0xb'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6d50('0xd')](_0x6d50('0xe')))[_0x6d50('0xa')]('MM-DD-YYYY\x20HH:mm')[_0x6d50('0xc')]();}}}; \ No newline at end of file +var _0xb2f3=['sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','subtract','setDataValue','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt'];(function(_0x39c06c,_0x542083){var _0x22f8c0=function(_0x56d1a9){while(--_0x56d1a9){_0x39c06c['push'](_0x39c06c['shift']());}};_0x22f8c0(++_0x542083);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb2f3[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x3b2f('0x0'));var moment=require(_0x3b2f('0x1'));var path=require(_0x3b2f('0x2'));var config=require(_0x3b2f('0x3'));module[_0x3b2f('0x4')]={'format':{'type':Sequelize[_0x3b2f('0x5')],'get':function(){return this[_0x3b2f('0x6')]('value')?path[_0x3b2f('0x7')](this[_0x3b2f('0x6')](_0x3b2f('0x8'))):undefined;}},'interactionid':{'type':Sequelize[_0x3b2f('0x9')]},'channel':{'type':Sequelize[_0x3b2f('0x9')]},'value':{'type':Sequelize[_0x3b2f('0x9')],'set':function(_0x26719d){var _0x4b3632=_0x26719d[_0x3b2f('0xa')](/\\/g,'/');this['setDataValue'](_0x3b2f('0x8'),_0x4b3632);}},'rating':{'type':Sequelize[_0x3b2f('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3b2f('0xb')],'set':function(_0x25134f){this['setDataValue']('startedAt',moment()[_0x3b2f('0xc')](_0x25134f,'ms'));this[_0x3b2f('0xd')](_0x3b2f('0xe'),moment());this[_0x3b2f('0xd')](_0x3b2f('0xf'),_0x25134f);}},'startedAt':{'type':Sequelize[_0x3b2f('0x10')],'get':function(){return moment(this[_0x3b2f('0x6')](_0x3b2f('0x11')))[_0x3b2f('0x12')](_0x3b2f('0x13'))[_0x3b2f('0x14')]();}},'closedAt':{'type':Sequelize[_0x3b2f('0x10')],'get':function(){return moment(this[_0x3b2f('0x6')](_0x3b2f('0xe')))[_0x3b2f('0x12')]('MM-DD-YYYY\x20HH:mm')[_0x3b2f('0x14')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x3b2f('0x6')](_0x3b2f('0x15')))['format'](_0x3b2f('0x13'))['toString']();}},'updatedAt':{'type':Sequelize[_0x3b2f('0x10')],'get':function(){return moment(this[_0x3b2f('0x6')](_0x3b2f('0x16')))[_0x3b2f('0x12')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 4f81c99..45fa246 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 _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x25d19f,_0x594c16){var _0xa51b5e=function(_0x5eb420){while(--_0x5eb420){_0x25d19f['push'](_0x25d19f['shift']());}};_0xa51b5e(++_0x594c16);}(_0x8958,0x93));var _0x8895=function(_0x5a55e3,_0x5c9bd5){_0x5a55e3=_0x5a55e3-0x0;var _0x1ed739=_0x8958[_0x5a55e3];return _0x1ed739;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));}; \ No newline at end of file +var _0x00bb=['json','undefined','limit','offset','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ScreenRecording','count','then','includeAll','include','rows','catch','show','params','length','options','find','body','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0x29d481,_0x214c7f){var _0x184315=function(_0x40f16c){while(--_0x40f16c){_0x29d481['push'](_0x29d481['shift']());}};_0x184315(++_0x214c7f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){_0x2896d1[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();});}};}function handleEntityNotFound(_0x3c9500,_0x8caadf){return function(_0x520e55){if(!_0x520e55){_0x3c9500['sendStatus'](0x194);}return _0x520e55;};}function handleError(_0x3785e9,_0x490380){_0x490380=_0x490380||0x1f4;return function(_0x550587){logger['error'](_0x550587[_0xb00b('0x20')]);if(_0x550587[_0xb00b('0x21')]){delete _0x550587[_0xb00b('0x21')];}_0x3785e9[_0xb00b('0x16')](_0x490380)[_0xb00b('0x22')](_0x550587);};}exports[_0xb00b('0x23')]=function(_0x15d3b9,_0x4a8d2b){var _0x22c22d={},_0x503c9c={},_0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x24')](db['ScreenRecording'][_0xb00b('0x25')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x26')],'type':_0x280ed3[_0xb00b('0x27')][_0xb00b('0x28')]};});_0x503c9c[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_[_0xb00b('0x24')](_0x348165,_0xb00b('0x21')),['format']);_0x503c9c[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x15d3b9['query']);_0x503c9c[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x503c9c['model'],_0x503c9c[_0xb00b('0x2b')]);_0x22c22d['attributes']=_[_0xb00b('0x2e')](_0x503c9c[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x22c22d[_0xb00b('0x30')]=_0x22c22d[_0xb00b('0x30')]['length']?_0x22c22d['attributes']:_0x503c9c['model'];if(!_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x22c22d[_0xb00b('0x19')]=qs['limit'](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x22c22d[_0xb00b('0x1a')]=qs[_0xb00b('0x1a')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x1a')]);}_0x22c22d[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x15d3b9['query']['sort']);_0x22c22d[_0xb00b('0x35')]=qs['filters'](_[_0xb00b('0x36')](_0x15d3b9[_0xb00b('0x2b')],_0x503c9c[_0xb00b('0x2d')]),_0x348165);if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x22c22d[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x22c22d['where'],{'$or':_[_0xb00b('0x24')](_0x348165,function(_0x25578e){if(_0x25578e[_0xb00b('0x27')]!==_0xb00b('0x39')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x21')]]={'$like':'%'+_0x15d3b9['query'][_0xb00b('0x37')]+'%'};return _0x2496e2;}})});}_0x22c22d=_[_0xb00b('0x38')]({},_0x22c22d,_0x15d3b9['options']);var _0x17ff34={'where':_0x22c22d[_0xb00b('0x35')]};return db[_0xb00b('0x3a')][_0xb00b('0x3b')](_0x17ff34)[_0xb00b('0x3c')](function(_0x5636b1){_0x450129[_0xb00b('0x3b')]=_0x5636b1;if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x3d')]){_0x22c22d[_0xb00b('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x22c22d);})[_0xb00b('0x3c')](function(_0xf6ae0c){_0x450129[_0xb00b('0x3f')]=_0xf6ae0c;return _0x450129;})[_0xb00b('0x3c')](respondWithFilteredResult(_0x4a8d2b,_0x22c22d))[_0xb00b('0x40')](handleError(_0x4a8d2b,null));};exports[_0xb00b('0x41')]=function(_0x275664,_0x493841){var _0x36200d={'raw':![],'where':{'id':_0x275664[_0xb00b('0x42')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x29')]=_[_0xb00b('0x2c')](db[_0xb00b('0x3a')][_0xb00b('0x25')]);_0x3b72c4[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x275664[_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x2b')]);_0x36200d[_0xb00b('0x30')]=_[_0xb00b('0x2e')](_0x3b72c4[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x275664[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x36200d[_0xb00b('0x30')]=_0x36200d[_0xb00b('0x30')][_0xb00b('0x43')]?_0x36200d[_0xb00b('0x30')]:_0x3b72c4[_0xb00b('0x29')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x38')]({},_0x36200d,_0x275664[_0xb00b('0x44')]);return db['ScreenRecording'][_0xb00b('0x45')](_0x36200d)[_0xb00b('0x3c')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x3c')](respondWithResult(_0x493841,null))[_0xb00b('0x40')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x3a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x3c')](respondWithResult(_0x172729,0xc9))[_0xb00b('0x40')](handleError(_0x172729,null));};exports['update']=function(_0x2228e9,_0x47a814){if(_0x2228e9['body']['id']){delete _0x2228e9['body']['id'];}delete _0x2228e9[_0xb00b('0x46')]['duration'];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x47')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x48')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x49')];return db['ScreenRecording']['find']({'where':{'id':_0x2228e9[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](handleEntityNotFound(_0x47a814,null))['then'](saveUpdates(_0x2228e9[_0xb00b('0x46')],null))[_0xb00b('0x3c')](respondWithResult(_0x47a814,null))['catch'](handleError(_0x47a814,null));};exports[_0xb00b('0x4a')]=function(_0x10e066,_0x3b5d82){return db['ScreenRecording']['describe']()[_0xb00b('0x3c')](respondWithResult(_0x3b5d82,null))[_0xb00b('0x40')](handleError(_0x3b5d82,null));};exports[_0xb00b('0x4b')]=function(_0xde3cc1,_0x489b49,_0x380acb){var _0x3f31e5=require('../../components/encryptor');var _0x4cd9fd=![];var _0x160965={};if(_0xde3cc1['query'][_0xb00b('0x27')]&&_0xde3cc1[_0xb00b('0x2b')][_0xb00b('0x27')]===_0xb00b('0x4c')){_0x160965[_0xb00b('0x4c')]=_0xde3cc1[_0xb00b('0x42')]['id'];}else{_0x160965['id']=_0xde3cc1['params']['id'];}return db[_0xb00b('0x3a')]['find']({'where':_0x160965,'attributes':['id',_0xb00b('0x49')],'raw':!![]})[_0xb00b('0x3c')](handleEntityNotFound(_0x489b49,null))[_0xb00b('0x3c')](function(_0x5ac79e){if(_0x5ac79e){var _0x248335=path[_0xb00b('0x4d')](config[_0xb00b('0x4e')],'server/files/screen_recordings',_0x5ac79e[_0xb00b('0x49')]);var _0x309ae6=util[_0xb00b('0x4f')](_0xb00b('0x50'),_0x248335);if(fs[_0xb00b('0x51')](_0x309ae6)){_0x4cd9fd=!![];return _0x3f31e5[_0xb00b('0x52')](_0x309ae6,_0x248335,config[_0xb00b('0x53')][_0xb00b('0x54')])['then'](function(){return _0x5ac79e;});}return _0x5ac79e;}})[_0xb00b('0x3c')](function(_0x2cbe80){if(_0x2cbe80){var _0x1b4860=path['join'](config[_0xb00b('0x4e')],_0xb00b('0x55'),_0x2cbe80[_0xb00b('0x49')]);if(!fs[_0xb00b('0x51')](_0x1b4860)){throw new db[(_0xb00b('0x56'))]['ValidationError'](_0xb00b('0x57'));}if(_0x2cbe80[_0xb00b('0x58')]){return _0x489b49[_0xb00b('0x4b')](_0x1b4860,_0x2cbe80[_0xb00b('0x58')]+path['extname'](_0x1b4860),function(){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}else{return _0x489b49[_0xb00b('0x4b')](_0x1b4860,function(_0x2c93db){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}}})[_0xb00b('0x40')](function(_0x1e5ed8){if(_0x1e5ed8[_0xb00b('0x5a')]==='ScreenRecording\x20not\x20found'){_0x489b49[_0xb00b('0x16')](0x194)['send'](_0xb00b('0x5b'));}else{return handleError(_0x489b49,null);}});};exports['destroy']=function(_0x3b3272,_0x530d4a){return db[_0xb00b('0x3a')]['find']({'where':{'id':_0x3b3272[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](function(_0x3bae02){if(_['isNil'](_0x3bae02)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bae02;})['then'](function(_0x21a53d){var _0x3126be=path[_0xb00b('0x4d')](config['root'],_0xb00b('0x55'),_0x21a53d[_0xb00b('0x49')]);logger[_0xb00b('0x5c')](_0xb00b('0x5d'),_0x3126be);if(!_[_0xb00b('0x5e')](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')]('File:\x20\x22'+_0x3126be+_0xb00b('0x5f'));fs[_0xb00b('0x60')](_0x3126be);}_0x3126be=_0x3126be+_0xb00b('0x61');if(!_['isNil'](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')](_0xb00b('0x62')+_0x3126be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3126be);}return _0x21a53d;})['then'](function(_0x5e9677){if(!_0x5e9677)throw new InternalError();return _0x5e9677[_0xb00b('0x1e')]();})['then'](function(){_0x530d4a[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();})['catch'](handleError(_0x530d4a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 7a40776..be14915 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 _0xa66b=['interactionid','util','api','moment','bluebird','path','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings'];(function(_0x2da811,_0x4a0a42){var _0xeb2f0c=function(_0x490748){while(--_0x490748){_0x2da811['push'](_0x2da811['shift']());}};_0xeb2f0c(++_0x4a0a42);}(_0xa66b,0x1ae));var _0xba66=function(_0x426de2,_0x24acaf){_0x426de2=_0x426de2-0x0;var _0x1dbafc=_0xa66b[_0x426de2];return _0x1dbafc;};'use strict';var _=require('lodash');var util=require(_0xba66('0x0'));var logger=require('../../config/logger')(_0xba66('0x1'));var moment=require(_0xba66('0x2'));var BPromise=require(_0xba66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba66('0x4'));var rimraf=require(_0xba66('0x5'));var config=require('../../config/environment');var attributes=require(_0xba66('0x6'));module['exports']=function(_0xc99b86,_0x1068df){return _0xc99b86[_0xba66('0x7')](_0xba66('0x8'),attributes,{'tableName':_0xba66('0x9'),'paranoid':![],'indexes':[{'name':_0xba66('0xa'),'fields':[_0xba66('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x891d=['define','interactionid','lodash','util','bluebird','request-promise','path','exports'];(function(_0x59a72c,_0x3475b7){var _0x58804b=function(_0x909b53){while(--_0x909b53){_0x59a72c['push'](_0x59a72c['shift']());}};_0x58804b(++_0x3475b7);}(_0x891d,0x1a2));var _0xd891=function(_0xee0152,_0xfe1ea7){_0xee0152=_0xee0152-0x0;var _0x1a69d1=_0x891d[_0xee0152];return _0x1a69d1;};'use strict';var _=require(_0xd891('0x0'));var util=require(_0xd891('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd891('0x2'));var rp=require(_0xd891('0x3'));var fs=require('fs');var path=require(_0xd891('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0xd891('0x5')]=function(_0x5df257,_0x16516d){return _0x5df257[_0xd891('0x6')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xd891('0x7'),'fields':[_0xd891('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index aeb74e6..2b206ae 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 _0x83a8=['rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x41e137,_0x34f2bb){var _0x41e9be=function(_0x2addd9){while(--_0x2addd9){_0x41e137['push'](_0x41e137['shift']());}};_0x41e9be(++_0x34f2bb);}(_0x83a8,0x16f));var _0x883a=function(_0x3709d3,_0x35300e){_0x3709d3=_0x3709d3-0x0;var _0x40025c=_0x83a8[_0x3709d3];return _0x40025c;};'use strict';var _=require(_0x883a('0x0'));var util=require('util');var moment=require(_0x883a('0x1'));var BPromise=require(_0x883a('0x2'));var rs=require(_0x883a('0x3'));var fs=require('fs');var Redis=require(_0x883a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x883a('0x5'));var logger=require(_0x883a('0x6'))(_0x883a('0x7'));var config=require(_0x883a('0x8'));var jayson=require(_0x883a('0x9'));var client=jayson['client'][_0x883a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277781,_0x5a581f,_0x273f3c){return new BPromise(function(_0x4986bd,_0x13e529){return client['request'](_0x277781,_0x273f3c)[_0x883a('0xb')](function(_0x3ba221){logger[_0x883a('0xc')](_0x883a('0xd'),_0x5a581f,_0x883a('0xe'));logger['debug'](_0x883a('0xf'),_0x5a581f,_0x883a('0xe'),JSON[_0x883a('0x10')](_0x3ba221));if(_0x3ba221[_0x883a('0x11')]){if(_0x3ba221[_0x883a('0x11')][_0x883a('0x12')]===0x1f4){logger[_0x883a('0x11')](_0x883a('0xd'),_0x5a581f,_0x3ba221[_0x883a('0x11')]['message']);return _0x13e529(_0x3ba221['error'][_0x883a('0x13')]);}logger[_0x883a('0x11')](_0x883a('0xd'),_0x5a581f,_0x3ba221['error'][_0x883a('0x13')]);return _0x4986bd(_0x3ba221[_0x883a('0x11')][_0x883a('0x13')]);}else{logger[_0x883a('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x5a581f,_0x883a('0xe'));_0x4986bd(_0x3ba221[_0x883a('0x14')][_0x883a('0x13')]);}})[_0x883a('0x15')](function(_0x1f7376){logger[_0x883a('0x11')](_0x883a('0xd'),_0x5a581f,_0x1f7376);_0x13e529(_0x1f7376);});});} \ No newline at end of file +var _0x08a9=['request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x16c2c1,_0x90e77a){var _0x389166=function(_0x2a4bd8){while(--_0x2a4bd8){_0x16c2c1['push'](_0x16c2c1['shift']());}};_0x389166(++_0x90e77a);}(_0x08a9,0x1c4));var _0x908a=function(_0x4a1446,_0x170e92){_0x4a1446=_0x4a1446-0x0;var _0xc1876e=_0x08a9[_0x4a1446];return _0xc1876e;};'use strict';var _=require(_0x908a('0x0'));var util=require('util');var moment=require(_0x908a('0x1'));var BPromise=require('bluebird');var rs=require(_0x908a('0x2'));var fs=require('fs');var Redis=require(_0x908a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x908a('0x4'));var logger=require(_0x908a('0x5'))(_0x908a('0x6'));var config=require(_0x908a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x908a('0x8')][_0x908a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x421ce7,_0x329844,_0x45d138){return new BPromise(function(_0x1d410a,_0x5531c7){return client[_0x908a('0xa')](_0x421ce7,_0x45d138)[_0x908a('0xb')](function(_0x54c175){logger[_0x908a('0xc')](_0x908a('0xd'),_0x329844,_0x908a('0xe'));logger[_0x908a('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x329844,_0x908a('0xe'),JSON[_0x908a('0x10')](_0x54c175));if(_0x54c175[_0x908a('0x11')]){if(_0x54c175[_0x908a('0x11')][_0x908a('0x12')]===0x1f4){logger[_0x908a('0x11')](_0x908a('0xd'),_0x329844,_0x54c175[_0x908a('0x11')]['message']);return _0x5531c7(_0x54c175[_0x908a('0x11')][_0x908a('0x13')]);}logger[_0x908a('0x11')](_0x908a('0xd'),_0x329844,_0x54c175[_0x908a('0x11')][_0x908a('0x13')]);return _0x1d410a(_0x54c175['error'][_0x908a('0x13')]);}else{logger[_0x908a('0xc')](_0x908a('0xd'),_0x329844,_0x908a('0xe'));_0x1d410a(_0x54c175['result'][_0x908a('0x13')]);}})[_0x908a('0x14')](function(_0x479d94){logger[_0x908a('0x11')](_0x908a('0xd'),_0x329844,_0x479d94);_0x5531c7(_0x479d94);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 872eddd..be802c2 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 _0x7cda=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','logo','extname','originalname','post','file','addLogo','server/files/images/logos/','format','%s%s','logologin','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','multer','util','path'];(function(_0x264beb,_0x4b52d9){var _0x4914ec=function(_0x1aec9b){while(--_0x1aec9b){_0x264beb['push'](_0x264beb['shift']());}};_0x4914ec(++_0x4b52d9);}(_0x7cda,0x189));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa7cd('0x0'));var util=require(_0xa7cd('0x1'));var path=require(_0xa7cd('0x2'));var timeout=require(_0xa7cd('0x3'));var express=require(_0xa7cd('0x4'));var router=express[_0xa7cd('0x5')]();var fs_extra=require(_0xa7cd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa7cd('0x7'));var config=require('../../config/environment');var controller=require(_0xa7cd('0x8'));router['get']('/',auth[_0xa7cd('0x9')](),controller[_0xa7cd('0xa')]);router[_0xa7cd('0xb')](_0xa7cd('0xc'),controller['getDate']);router[_0xa7cd('0xb')](_0xa7cd('0xd'),controller['show']);router['get'](_0xa7cd('0xe'),controller[_0xa7cd('0xf')]);router['get'](_0xa7cd('0x10'),controller[_0xa7cd('0x11')]);router[_0xa7cd('0xb')]('/:id/gdpr',controller[_0xa7cd('0x12')]);router[_0xa7cd('0xb')](_0xa7cd('0x13'),controller[_0xa7cd('0x14')]);router['get'](_0xa7cd('0x15'),controller[_0xa7cd('0x16')]);var upload=multer({'storage':multer[_0xa7cd('0x17')]({'destination':function(_0x1322cc,_0x473a29,_0x1a3686){_0x1a3686(null,path[_0xa7cd('0x18')](config[_0xa7cd('0x19')],'server/files/images/logos/'));},'filename':function(_0x49a44f,_0x105aba,_0x27782b){_0x27782b(null,util['format']('%s%s',_0xa7cd('0x1a'),path[_0xa7cd('0x1b')](_0x105aba[_0xa7cd('0x1c')])));}})});router[_0xa7cd('0x1d')](_0xa7cd('0xe'),upload['single'](_0xa7cd('0x1e')),controller[_0xa7cd('0x1f')]);var upload=multer({'storage':multer[_0xa7cd('0x17')]({'destination':function(_0x52919f,_0x32b26b,_0xee3ebe){_0xee3ebe(null,path[_0xa7cd('0x18')](config['root'],_0xa7cd('0x20')));},'filename':function(_0x222bfb,_0x4780ca,_0xfd327a){_0xfd327a(null,util[_0xa7cd('0x21')](_0xa7cd('0x22'),_0xa7cd('0x23'),path['extname'](_0x4780ca[_0xa7cd('0x1c')])));}})});router[_0xa7cd('0x1d')]('/:id/logo_login',upload[_0xa7cd('0x24')](_0xa7cd('0x1e')),controller[_0xa7cd('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c597a,_0x13dd4c,_0x52bd91){_0x52bd91(null,path[_0xa7cd('0x18')](config[_0xa7cd('0x19')],_0xa7cd('0x20')));},'filename':function(_0x412c38,_0xec496c,_0xd4ec26){_0xd4ec26(null,util[_0xa7cd('0x21')](_0xa7cd('0x22'),_0xa7cd('0x26'),path[_0xa7cd('0x1b')](_0xec496c[_0xa7cd('0x1c')])));}})});router[_0xa7cd('0x1d')]('/:id/preferred',upload['single'](_0xa7cd('0x1e')),controller[_0xa7cd('0x27')]);var upload=multer({'storage':multer[_0xa7cd('0x17')]({'destination':function(_0x3a82b0,_0x4efafd,_0x126b32){_0x126b32(null,path['join'](config[_0xa7cd('0x19')],_0xa7cd('0x20')));},'filename':function(_0x55e019,_0x36e9b0,_0x40a90d){_0x40a90d(null,util[_0xa7cd('0x21')](_0xa7cd('0x22'),_0xa7cd('0x28'),path['extname'](_0x36e9b0['originalname'])));}})});router[_0xa7cd('0x1d')](_0xa7cd('0x15'),upload[_0xa7cd('0x24')](_0xa7cd('0x1e')),controller[_0xa7cd('0x29')]);router[_0xa7cd('0x2a')](_0xa7cd('0xd'),auth['isAuthenticated'](),controller[_0xa7cd('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x83fc=['server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','logologin','addLogoLogin','favicon','single','addFavicon','isAuthenticated','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','/now','getDate','get','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x83fc,0x181));var _0xc83f=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x83fc[_0x1573ea];return _0x51c0e2;};'use strict';var multer=require(_0xc83f('0x0'));var util=require(_0xc83f('0x1'));var path=require(_0xc83f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc83f('0x3')]();var fs_extra=require(_0xc83f('0x4'));var auth=require(_0xc83f('0x5'));var interaction=require(_0xc83f('0x6'));var config=require(_0xc83f('0x7'));var controller=require(_0xc83f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc83f('0x9'),controller[_0xc83f('0xa')]);router[_0xc83f('0xb')](_0xc83f('0xc'),controller['show']);router[_0xc83f('0xb')](_0xc83f('0xd'),controller[_0xc83f('0xe')]);router[_0xc83f('0xb')](_0xc83f('0xf'),controller[_0xc83f('0x10')]);router[_0xc83f('0xb')](_0xc83f('0x11'),controller['gdpr']);router[_0xc83f('0xb')](_0xc83f('0x12'),controller[_0xc83f('0x13')]);router[_0xc83f('0xb')](_0xc83f('0x14'),controller[_0xc83f('0x15')]);var upload=multer({'storage':multer[_0xc83f('0x16')]({'destination':function(_0x11c1f5,_0x383481,_0x2bc72c){_0x2bc72c(null,path[_0xc83f('0x17')](config[_0xc83f('0x18')],_0xc83f('0x19')));},'filename':function(_0x5b7d92,_0x3ddc90,_0xeacdff){_0xeacdff(null,util[_0xc83f('0x1a')](_0xc83f('0x1b'),_0xc83f('0x1c'),path[_0xc83f('0x1d')](_0x3ddc90[_0xc83f('0x1e')])));}})});router[_0xc83f('0x1f')](_0xc83f('0xd'),upload['single'](_0xc83f('0x20')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4db625,_0x2a8931,_0x48f5af){_0x48f5af(null,path['join'](config[_0xc83f('0x18')],_0xc83f('0x19')));},'filename':function(_0x1da026,_0x3175c4,_0x56b8f1){_0x56b8f1(null,util[_0xc83f('0x1a')]('%s%s',_0xc83f('0x21'),path[_0xc83f('0x1d')](_0x3175c4['originalname'])));}})});router[_0xc83f('0x1f')](_0xc83f('0xf'),upload['single']('file'),controller[_0xc83f('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xad72cf,_0x5bc995,_0x47e7da){_0x47e7da(null,path[_0xc83f('0x17')](config['root'],_0xc83f('0x19')));},'filename':function(_0x5f1bb9,_0x1adaf2,_0x260809){_0x260809(null,util[_0xc83f('0x1a')](_0xc83f('0x1b'),'preferred',path[_0xc83f('0x1d')](_0x1adaf2[_0xc83f('0x1e')])));}})});router[_0xc83f('0x1f')](_0xc83f('0x12'),upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4773c0,_0xd96936,_0x168a76){_0x168a76(null,path[_0xc83f('0x17')](config[_0xc83f('0x18')],_0xc83f('0x19')));},'filename':function(_0x4ab8ea,_0x552e99,_0x573ee7){_0x573ee7(null,util['format']('%s%s',_0xc83f('0x23'),path[_0xc83f('0x1d')](_0x552e99[_0xc83f('0x1e')])));}})});router['post'](_0xc83f('0x14'),upload[_0xc83f('0x24')]('file'),controller[_0xc83f('0x25')]);router['put']('/:id',auth[_0xc83f('0x26')](),controller[_0xc83f('0x27')]);module[_0xc83f('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 d8e8764..c4d462c 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x2d886e,_0x39c9d3){var _0x1b8fb2=function(_0x2183db){while(--_0x2183db){_0x2d886e['push'](_0x2d886e['shift']());}};_0x1b8fb2(++_0x39c9d3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x5f2f[_0x28107d];return _0x2b1cbe;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x36c771,_0x43e17a){var _0x5a4bb2=function(_0x4137f1){while(--_0x4137f1){_0x36c771['push'](_0x36c771['shift']());}};_0x5a4bb2(++_0x43e17a);}(_0x7a54,0x106));var _0x47a5=function(_0x52c892,_0x29e5f4){_0x52c892=_0x52c892-0x0;var _0x137263=_0x7a54[_0x52c892];return _0x137263;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 5668ecb..35f283d 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 _0x865d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Setting','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','default_logo.svg','default','custom','Sequelize','upperFirst','download','getLogoLogin','getLicense','default_loginLogo.svg','ValidationError','\x20not\x20found','addPreferred','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x53cd39,_0x351f5e){var _0xb41d5f=function(_0x2cdbf2){while(--_0x2cdbf2){_0x53cd39['push'](_0x53cd39['shift']());}};_0xb41d5f(++_0x351f5e);}(_0x865d,0x1d9));var _0xd865=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x865d[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xd865('0x0'));var rimraf=require(_0xd865('0x1'));var zipdir=require(_0xd865('0x2'));var jsonpatch=require(_0xd865('0x3'));var rp=require(_0xd865('0x4'));var moment=require(_0xd865('0x5'));var BPromise=require(_0xd865('0x6'));var Mustache=require(_0xd865('0x7'));var util=require('util');var path=require(_0xd865('0x8'));var sox=require(_0xd865('0x9'));var csv=require(_0xd865('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd865('0xb'));var crypto=require(_0xd865('0xc'));var jsforce=require(_0xd865('0xd'));var deskjs=require(_0xd865('0xe'));var toCsv=require(_0xd865('0xa'));var querystring=require('querystring');var Papa=require(_0xd865('0xf'));var Redis=require(_0xd865('0x10'));var authService=require(_0xd865('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd865('0x12'));var hardwareService=require(_0xd865('0x13'));var logger=require(_0xd865('0x14'))(_0xd865('0x15'));var utils=require(_0xd865('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd865('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd865('0x18'));var client=jayson['client'][_0xd865('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x234e6e,_0x547b49,_0x14d301,_0x41dd56){return new BPromise(function(_0x1bface,_0x29ea17){var _0xf8e22b=_0x41dd56||client;return _0xf8e22b[_0xd865('0x1a')](_0x234e6e,_0x14d301)['then'](function(_0x272273){logger[_0xd865('0x1b')](_0xd865('0x1c'),_0x547b49,_0xd865('0x1d'));logger[_0xd865('0x1e')](_0xd865('0x1f'),_0x547b49,_0xd865('0x1d'),JSON[_0xd865('0x20')](_0x272273));if(_0x272273[_0xd865('0x21')]){if(_0x272273[_0xd865('0x21')][_0xd865('0x22')]===0x1f4){logger[_0xd865('0x21')](_0xd865('0x1c'),_0x547b49,_0x272273[_0xd865('0x21')][_0xd865('0x23')]);return _0x29ea17(_0x272273['error']['message']);}logger[_0xd865('0x21')](_0xd865('0x1c'),_0x547b49,_0x272273[_0xd865('0x21')]['message']);return _0x1bface(_0x272273['error'][_0xd865('0x23')]);}else{logger[_0xd865('0x1b')](_0xd865('0x1c'),_0x547b49,_0xd865('0x1d'));_0x1bface(_0x272273[_0xd865('0x24')]['message']);}})[_0xd865('0x25')](function(_0x5ede23){logger[_0xd865('0x21')]('Setting,\x20%s,\x20%s',_0x547b49,_0x5ede23);_0x29ea17(_0x5ede23);});});}function respondWithStatusCode(_0x360ffc,_0x34b99e){_0x34b99e=_0x34b99e||0xcc;return function(_0x1b1f49){if(_0x1b1f49){return _0x360ffc[_0xd865('0x26')](_0x34b99e);}return _0x360ffc[_0xd865('0x27')](_0x34b99e)[_0xd865('0x28')]();};}function respondWithResult(_0x563509,_0x219b36){_0x219b36=_0x219b36||0xc8;return function(_0x38c300){if(_0x38c300){return _0x563509[_0xd865('0x27')](_0x219b36)['json'](_0x38c300);}};}function respondWithFilteredResult(_0x330f7f,_0xa909b5){return function(_0xff4452){if(_0xff4452){var _0x5ab036=typeof _0xa909b5[_0xd865('0x29')]==='undefined'&&typeof _0xa909b5['limit']==='undefined';var _0x2e9ec5=_0xff4452[_0xd865('0x2a')];var _0x4e5711=_0x5ab036?0x0:_0xa909b5[_0xd865('0x29')];var _0x5a90e2=_0x5ab036?_0xff4452['count']:_0xa909b5[_0xd865('0x29')]+_0xa909b5['limit'];var _0x4a04b3;if(_0x5a90e2>=_0x2e9ec5){_0x5a90e2=_0x2e9ec5;_0x4a04b3=0xc8;}else{_0x4a04b3=0xce;}_0x330f7f[_0xd865('0x27')](_0x4a04b3);return _0x330f7f[_0xd865('0x2b')](_0xd865('0x2c'),_0x4e5711+'-'+_0x5a90e2+'/'+_0x2e9ec5)['json'](_0xff4452);}return null;};}function patchUpdates(_0x31d3a0){return function(_0x463da5){try{jsonpatch[_0xd865('0x2d')](_0x463da5,_0x31d3a0,!![]);}catch(_0x257d60){return BPromise[_0xd865('0x2e')](_0x257d60);}return _0x463da5[_0xd865('0x2f')]();};}function saveUpdates(_0x4bcead,_0x530ee0){return function(_0x3ce7e0){if(_0x3ce7e0){return _0x3ce7e0[_0xd865('0x30')](_0x4bcead)[_0xd865('0x31')](function(_0x7730ae){return _0x7730ae;});}return null;};}function removeEntity(_0x3f5d52,_0x304868){return function(_0x17c1eb){if(_0x17c1eb){return _0x17c1eb[_0xd865('0x32')]()['then'](function(){_0x3f5d52[_0xd865('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2becdc,_0x3b4e40){return function(_0x1b8ce3){if(!_0x1b8ce3){_0x2becdc[_0xd865('0x26')](0x194);}return _0x1b8ce3;};}function handleError(_0x2070b7,_0x36b0a5){_0x36b0a5=_0x36b0a5||0x1f4;return function(_0x2ae144){logger['error'](_0x2ae144[_0xd865('0x33')]);if(_0x2ae144[_0xd865('0x34')]){delete _0x2ae144[_0xd865('0x34')];}_0x2070b7['status'](_0x36b0a5)[_0xd865('0x35')](_0x2ae144);};}exports[_0xd865('0x36')]=function(_0x4cd5b6,_0xb05a29){var _0x5a2763={},_0x484600={},_0x5ef260={'count':0x0,'rows':[]};var _0x2000e5=_[_0xd865('0x37')](db[_0xd865('0x38')]['rawAttributes'],function(_0x442268){return{'name':_0x442268[_0xd865('0x39')],'type':_0x442268[_0xd865('0x3a')]['key']};});_0x484600[_0xd865('0x3b')]=_[_0xd865('0x37')](_0x2000e5,'name');_0x484600[_0xd865('0x3c')]=_['keys'](_0x4cd5b6[_0xd865('0x3c')]);_0x484600[_0xd865('0x3d')]=_[_0xd865('0x3e')](_0x484600[_0xd865('0x3b')],_0x484600[_0xd865('0x3c')]);_0x5a2763[_0xd865('0x3f')]=_['intersection'](_0x484600[_0xd865('0x3b')],qs[_0xd865('0x40')](_0x4cd5b6[_0xd865('0x3c')]['fields']));_0x5a2763[_0xd865('0x3f')]=_0x5a2763['attributes'][_0xd865('0x41')]?_0x5a2763['attributes']:_0x484600[_0xd865('0x3b')];if(!_0x4cd5b6['query']['hasOwnProperty'](_0xd865('0x42'))){_0x5a2763[_0xd865('0x43')]=qs[_0xd865('0x43')](_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x43')]);_0x5a2763[_0xd865('0x29')]=qs[_0xd865('0x29')](_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x29')]);}_0x5a2763[_0xd865('0x44')]=qs[_0xd865('0x45')](_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x45')]);_0x5a2763[_0xd865('0x46')]=qs[_0xd865('0x3d')](_['pick'](_0x4cd5b6[_0xd865('0x3c')],_0x484600[_0xd865('0x3d')]),_0x2000e5);if(_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x47')]){_0x5a2763[_0xd865('0x46')]=_[_0xd865('0x48')](_0x5a2763[_0xd865('0x46')],{'$or':_['map'](_0x2000e5,function(_0x57aebc){if(_0x57aebc[_0xd865('0x3a')]!==_0xd865('0x49')){var _0x2215d7={};_0x2215d7[_0x57aebc[_0xd865('0x34')]]={'$like':'%'+_0x4cd5b6[_0xd865('0x3c')]['filter']+'%'};return _0x2215d7;}})});}_0x5a2763=_['merge']({},_0x5a2763,_0x4cd5b6['options']);var _0x29bb5c={'where':_0x5a2763[_0xd865('0x46')]};return db[_0xd865('0x38')][_0xd865('0x2a')](_0x29bb5c)[_0xd865('0x31')](function(_0x29fb1a){_0x5ef260[_0xd865('0x2a')]=_0x29fb1a;if(_0x4cd5b6[_0xd865('0x3c')][_0xd865('0x4a')]){_0x5a2763[_0xd865('0x4b')]=[{'all':!![]}];}return db[_0xd865('0x38')][_0xd865('0x4c')](_0x5a2763);})['then'](function(_0x9a387e){_0x5ef260[_0xd865('0x4d')]=_0x9a387e;return _0x5ef260;})['then'](respondWithFilteredResult(_0xb05a29,_0x5a2763))[_0xd865('0x25')](handleError(_0xb05a29,null));};exports[_0xd865('0x4e')]=function(_0x41668b,_0xde9fc){var _0x37efbd={'raw':![],'where':{'id':_0x41668b[_0xd865('0x4f')]['id']}},_0x4a2b9b={};_0x4a2b9b[_0xd865('0x3b')]=_[_0xd865('0x50')](db[_0xd865('0x38')][_0xd865('0x51')]);_0x4a2b9b[_0xd865('0x3c')]=_[_0xd865('0x50')](_0x41668b[_0xd865('0x3c')]);_0x4a2b9b[_0xd865('0x3d')]=_[_0xd865('0x3e')](_0x4a2b9b[_0xd865('0x3b')],_0x4a2b9b[_0xd865('0x3c')]);_0x37efbd[_0xd865('0x3f')]=_[_0xd865('0x3e')](_0x4a2b9b[_0xd865('0x3b')],qs[_0xd865('0x40')](_0x41668b[_0xd865('0x3c')][_0xd865('0x40')]));_0x37efbd[_0xd865('0x3f')]=_0x37efbd[_0xd865('0x3f')][_0xd865('0x41')]?_0x37efbd[_0xd865('0x3f')]:_0x4a2b9b[_0xd865('0x3b')];if(_0x41668b[_0xd865('0x3c')][_0xd865('0x4a')]){_0x37efbd[_0xd865('0x4b')]=[{'all':!![]}];}_0x37efbd=_[_0xd865('0x48')]({},_0x37efbd,_0x41668b[_0xd865('0x52')]);return db['Setting'][_0xd865('0x53')](_0x37efbd)[_0xd865('0x31')](handleEntityNotFound(_0xde9fc,null))[_0xd865('0x31')](respondWithResult(_0xde9fc,null))['catch'](handleError(_0xde9fc,null));};exports['update']=function(_0x526e6a,_0x8452b0){if(_0x526e6a[_0xd865('0x54')]['id']){delete _0x526e6a['body']['id'];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x526e6a[_0xd865('0x4f')]['id']}})['then'](handleEntityNotFound(_0x8452b0,null))[_0xd865('0x31')](saveUpdates(_0x526e6a[_0xd865('0x54')],null))['then'](respondWithResult(_0x8452b0,null))[_0xd865('0x25')](handleError(_0x8452b0,null));};exports['addLogo']=function(_0x5a0a03,_0x3a3529,_0x4cabe6){if(_0x5a0a03['file']&&_0x5a0a03[_0xd865('0x55')][_0xd865('0x56')]){_0x5a0a03[_0xd865('0x54')][_0xd865('0x57')]=_0x5a0a03[_0xd865('0x55')][_0xd865('0x56')];}return db['Setting'][_0xd865('0x53')]({'where':{'id':_0x5a0a03['params']['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x3a3529,null))[_0xd865('0x31')](saveUpdates(_0x5a0a03[_0xd865('0x54')],null))['then'](respondWithResult(_0x3a3529,null))[_0xd865('0x25')](handleError(_0x3a3529,null));};exports[_0xd865('0x58')]=function(_0x5111fa,_0x16276b,_0x472f22){if(_0x5111fa[_0xd865('0x55')]&&_0x5111fa[_0xd865('0x55')][_0xd865('0x56')]){_0x5111fa['body'][_0xd865('0x59')]=_0x5111fa['file'][_0xd865('0x56')];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x5111fa[_0xd865('0x4f')]['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x16276b,null))[_0xd865('0x31')](saveUpdates(_0x5111fa['body'],null))[_0xd865('0x31')](respondWithResult(_0x16276b,null))[_0xd865('0x25')](handleError(_0x16276b,null));};var utilLicense=require('../../config/license/util');exports[_0xd865('0x5a')]=function(_0x3a3dbd,_0x562226,_0x449ac6){var _0x222411=_0xd865('0x5b');var _0xcd3c7c={'custom':![]};return utilLicense['getLicense']()[_0xd865('0x31')](function(_0x266642){if(_0x266642){_0xcd3c7c=_0x266642;}return db[_0xd865('0x38')]['find']({'where':{'id':_0x3a3dbd[_0xd865('0x4f')]['id']},'attributes':[_0xd865('0x57'),'loginLogo',_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),_0xd865('0x5f'),_0xd865('0x60'),'defaultFavicon'],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x562226,null))['then'](function(_0x9e1cd0){if(_0x9e1cd0){var _0x9263e5=_0x9e1cd0[_0xd865('0x57')]&&fs[_0xd865('0x61')](path['join'](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0x9e1cd0[_0xd865('0x57')])))?path['join'](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0x9e1cd0[_0xd865('0x57')])):path[_0xd865('0x64')](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0xd865('0x65')));var _0x449fa7=_0xd865('0x66')+_['upperFirst'](_0xd865('0x57'));if(_0x9e1cd0[_0x449fa7]||!_0xcd3c7c[_0xd865('0x67')]){_0x9263e5=path['join'](config[_0xd865('0x62')],_0x222411,_[_0xd865('0x63')](_0xd865('0x65')));}if(!fs[_0xd865('0x61')](_0x9263e5)){throw new db[(_0xd865('0x68'))]['ValidationError'](_[_0xd865('0x69')](_0xd865('0x57'))+'\x20not\x20found');}return _0x562226[_0xd865('0x6a')](_0x9263e5);}})[_0xd865('0x25')](handleError(_0x562226,null));};var utilLicense=require(_0xd865('0x17'));exports[_0xd865('0x6b')]=function(_0x406da2,_0x5d6575,_0x281254){var _0x529a28='server/files/images/logos';var _0x45392b={'custom':![]};return utilLicense[_0xd865('0x6c')]()['then'](function(_0x259fbf){if(_0x259fbf){_0x45392b=_0x259fbf;}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x406da2['params']['id']},'attributes':[_0xd865('0x57'),_0xd865('0x59'),_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),_0xd865('0x5f'),_0xd865('0x60'),'defaultFavicon'],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x5d6575,null))[_0xd865('0x31')](function(_0x2597e2){if(_0x2597e2){var _0x4ee66c=_0x2597e2['loginLogo']&&fs[_0xd865('0x61')](path[_0xd865('0x64')](config[_0xd865('0x62')],_0x529a28,_['toLower'](_0x2597e2[_0xd865('0x59')])))?path[_0xd865('0x64')](config['root'],_0x529a28,_['toLower'](_0x2597e2[_0xd865('0x59')])):path['join'](config[_0xd865('0x62')],_0x529a28,_[_0xd865('0x63')](_0xd865('0x6d')));var _0x5b1659=_0xd865('0x66')+_['upperFirst'](_0xd865('0x59'));if(_0x2597e2[_0x5b1659]||!_0x45392b[_0xd865('0x67')]){_0x4ee66c=path[_0xd865('0x64')](config[_0xd865('0x62')],_0x529a28,_[_0xd865('0x63')](_0xd865('0x6d')));}if(!fs[_0xd865('0x61')](_0x4ee66c)){throw new db[(_0xd865('0x68'))][(_0xd865('0x6e'))](_[_0xd865('0x69')](_0xd865('0x59'))+_0xd865('0x6f'));}return _0x5d6575[_0xd865('0x6a')](_0x4ee66c);}})[_0xd865('0x25')](handleError(_0x5d6575,null));};exports['gdpr']=function(_0x281f04,_0x5c3be4){return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x281f04[_0xd865('0x4f')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5c3be4,null))[_0xd865('0x25')](handleError(_0x5c3be4,null));};exports[_0xd865('0x70')]=function(_0x286ff5,_0x3226a8,_0x349703){if(_0x286ff5[_0xd865('0x55')]&&_0x286ff5[_0xd865('0x55')][_0xd865('0x56')]){_0x286ff5['body'][_0xd865('0x5c')]=_0x286ff5[_0xd865('0x55')]['filename'];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x286ff5[_0xd865('0x4f')]['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x3226a8,null))['then'](saveUpdates(_0x286ff5[_0xd865('0x54')],null))[_0xd865('0x31')](respondWithResult(_0x3226a8,null))[_0xd865('0x25')](handleError(_0x3226a8,null));};var utilLicense=require(_0xd865('0x17'));exports[_0xd865('0x71')]=function(_0x34241d,_0x5b775a,_0x28e6fd){var _0x4e11d6=_0xd865('0x5b');var _0x4a1a94={'custom':![]};return utilLicense[_0xd865('0x6c')]()[_0xd865('0x31')](function(_0x22dc34){if(_0x22dc34){_0x4a1a94=_0x22dc34;}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x34241d[_0xd865('0x4f')]['id']},'attributes':[_0xd865('0x57'),'loginLogo',_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),'defaultLoginLogo',_0xd865('0x60'),_0xd865('0x72')],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x5b775a,null))[_0xd865('0x31')](function(_0x6c896){if(_0x6c896){var _0x17f619=_0x6c896[_0xd865('0x5c')]&&fs['existsSync'](path['join'](config[_0xd865('0x62')],_0x4e11d6,_[_0xd865('0x63')](_0x6c896['preferred'])))?path[_0xd865('0x64')](config[_0xd865('0x62')],_0x4e11d6,_[_0xd865('0x63')](_0x6c896['preferred'])):path[_0xd865('0x64')](config[_0xd865('0x62')],_0x4e11d6,_['toLower'](_0xd865('0x73')));var _0x3c29fa=_0xd865('0x66')+_[_0xd865('0x69')](_0xd865('0x5c'));if(_0x6c896[_0x3c29fa]||!_0x4a1a94[_0xd865('0x67')]||!_0x4a1a94[_0xd865('0x5c')]){_0x17f619=path[_0xd865('0x64')](config[_0xd865('0x62')],_0x4e11d6,_[_0xd865('0x63')](_0xd865('0x73')));}if(!fs[_0xd865('0x61')](_0x17f619)){throw new db[(_0xd865('0x68'))][(_0xd865('0x6e'))](_[_0xd865('0x69')]('preferred')+_0xd865('0x6f'));}return _0x5b775a['download'](_0x17f619);}})[_0xd865('0x25')](handleError(_0x5b775a,null));};exports[_0xd865('0x74')]=function(_0xcf6a92,_0x133901,_0x1b9f96){if(_0xcf6a92[_0xd865('0x55')]&&_0xcf6a92[_0xd865('0x55')][_0xd865('0x56')]){_0xcf6a92[_0xd865('0x54')][_0xd865('0x5d')]=_0xcf6a92[_0xd865('0x55')][_0xd865('0x56')];}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0xcf6a92[_0xd865('0x4f')]['id']}})[_0xd865('0x31')](handleEntityNotFound(_0x133901,null))[_0xd865('0x31')](saveUpdates(_0xcf6a92[_0xd865('0x54')],null))[_0xd865('0x31')](respondWithResult(_0x133901,null))[_0xd865('0x25')](handleError(_0x133901,null));};var utilLicense=require(_0xd865('0x17'));exports[_0xd865('0x75')]=function(_0x6599c7,_0x1a1232,_0x520e77){var _0x20cb2e='server/files/images/logos';var _0x705aba={'custom':![]};return utilLicense[_0xd865('0x6c')]()[_0xd865('0x31')](function(_0x2d6a18){if(_0x2d6a18){_0x705aba=_0x2d6a18;}return db[_0xd865('0x38')][_0xd865('0x53')]({'where':{'id':_0x6599c7[_0xd865('0x4f')]['id']},'attributes':['logo','loginLogo',_0xd865('0x5c'),_0xd865('0x5d'),_0xd865('0x5e'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xd865('0x31')](handleEntityNotFound(_0x1a1232,null))[_0xd865('0x31')](function(_0x12071a){if(_0x12071a){var _0x394255=_0x12071a[_0xd865('0x5d')]&&fs[_0xd865('0x61')](path[_0xd865('0x64')](config[_0xd865('0x62')],_0x20cb2e,_[_0xd865('0x63')](_0x12071a[_0xd865('0x5d')])))?path['join'](config['root'],_0x20cb2e,_[_0xd865('0x63')](_0x12071a[_0xd865('0x5d')])):path[_0xd865('0x64')](config[_0xd865('0x62')],_0x20cb2e,_[_0xd865('0x63')](_0xd865('0x76')));var _0x2eed5b=_0xd865('0x66')+_['upperFirst'](_0xd865('0x5d'));if(_0x12071a[_0x2eed5b]||!_0x705aba[_0xd865('0x67')]){_0x394255=path[_0xd865('0x64')](config[_0xd865('0x62')],_0x20cb2e,_[_0xd865('0x63')](_0xd865('0x76')));}if(!fs[_0xd865('0x61')](_0x394255)){throw new db[(_0xd865('0x68'))][(_0xd865('0x6e'))](_[_0xd865('0x69')](_0xd865('0x5d'))+_0xd865('0x6f'));}return _0x1a1232[_0xd865('0x6a')](_0x394255);}})[_0xd865('0x25')](handleError(_0x1a1232,null));};exports['getDate']=function(_0x1977f0,_0x3f8da2){var _0x40841e={'offset':moment()[_0xd865('0x77')]()};_0x40841e[_0xd865('0x78')]=moment()['utcOffset'](_0x40841e['offset'])[_0xd865('0x79')](_0xd865('0x7a'));return _0x3f8da2['status'](0xc8)['send'](_0x40841e);}; \ No newline at end of file +var _0x87cb=['find','body','params','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','getPreferred','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','Setting','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows'];(function(_0x54f875,_0x2b84b9){var _0x587317=function(_0x24cb8f){while(--_0x24cb8f){_0x54f875['push'](_0x54f875['shift']());}};_0x587317(++_0x2b84b9);}(_0x87cb,0xaa));var _0xb87c=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x87cb[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require(_0xb87c('0x1'));var zipdir=require(_0xb87c('0x2'));var jsonpatch=require(_0xb87c('0x3'));var rp=require(_0xb87c('0x4'));var moment=require(_0xb87c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb87c('0x6'));var path=require(_0xb87c('0x7'));var sox=require(_0xb87c('0x8'));var csv=require(_0xb87c('0x9'));var ejs=require(_0xb87c('0xa'));var fs=require('fs');var fs_extra=require(_0xb87c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb87c('0xc'));var jsforce=require(_0xb87c('0xd'));var deskjs=require(_0xb87c('0xe'));var toCsv=require(_0xb87c('0x9'));var querystring=require(_0xb87c('0xf'));var Papa=require('papaparse');var Redis=require(_0xb87c('0x10'));var authService=require(_0xb87c('0x11'));var qs=require(_0xb87c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb87c('0x13'));var logger=require(_0xb87c('0x14'))(_0xb87c('0x15'));var utils=require(_0xb87c('0x16'));var config=require(_0xb87c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xb87c('0x18'));var client=jayson[_0xb87c('0x19')][_0xb87c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x5f49e2,_0xc4a5ca,_0x2cc3ad,_0x635bb){return new BPromise(function(_0x2aa935,_0x2c6679){var _0x3b8fb3=_0x635bb||client;return _0x3b8fb3[_0xb87c('0x1b')](_0x5f49e2,_0x2cc3ad)[_0xb87c('0x1c')](function(_0x132093){logger['info'](_0xb87c('0x1d'),_0xc4a5ca,_0xb87c('0x1e'));logger[_0xb87c('0x1f')](_0xb87c('0x20'),_0xc4a5ca,'request\x20sent',JSON[_0xb87c('0x21')](_0x132093));if(_0x132093['error']){if(_0x132093['error'][_0xb87c('0x22')]===0x1f4){logger[_0xb87c('0x23')](_0xb87c('0x1d'),_0xc4a5ca,_0x132093['error']['message']);return _0x2c6679(_0x132093['error']['message']);}logger[_0xb87c('0x23')]('Setting,\x20%s,\x20%s',_0xc4a5ca,_0x132093[_0xb87c('0x23')][_0xb87c('0x24')]);return _0x2aa935(_0x132093['error'][_0xb87c('0x24')]);}else{logger[_0xb87c('0x25')]('Setting,\x20%s,\x20%s',_0xc4a5ca,'request\x20sent');_0x2aa935(_0x132093[_0xb87c('0x26')][_0xb87c('0x24')]);}})[_0xb87c('0x27')](function(_0x18b7b6){logger['error'](_0xb87c('0x1d'),_0xc4a5ca,_0x18b7b6);_0x2c6679(_0x18b7b6);});});}function respondWithStatusCode(_0x4b20b8,_0x2e19d8){_0x2e19d8=_0x2e19d8||0xcc;return function(_0x81835){if(_0x81835){return _0x4b20b8[_0xb87c('0x28')](_0x2e19d8);}return _0x4b20b8[_0xb87c('0x29')](_0x2e19d8)[_0xb87c('0x2a')]();};}function respondWithResult(_0x1c493c,_0x38738e){_0x38738e=_0x38738e||0xc8;return function(_0x54cc61){if(_0x54cc61){return _0x1c493c['status'](_0x38738e)[_0xb87c('0x2b')](_0x54cc61);}};}function respondWithFilteredResult(_0x270caf,_0x514c2a){return function(_0x1103e0){if(_0x1103e0){var _0x8205ea=typeof _0x514c2a[_0xb87c('0x2c')]==='undefined'&&typeof _0x514c2a[_0xb87c('0x2d')]===_0xb87c('0x2e');var _0x338d7c=_0x1103e0[_0xb87c('0x2f')];var _0x4d6c1f=_0x8205ea?0x0:_0x514c2a[_0xb87c('0x2c')];var _0x10d80a=_0x8205ea?_0x1103e0[_0xb87c('0x2f')]:_0x514c2a[_0xb87c('0x2c')]+_0x514c2a[_0xb87c('0x2d')];var _0x590837;if(_0x10d80a>=_0x338d7c){_0x10d80a=_0x338d7c;_0x590837=0xc8;}else{_0x590837=0xce;}_0x270caf['status'](_0x590837);return _0x270caf[_0xb87c('0x30')](_0xb87c('0x31'),_0x4d6c1f+'-'+_0x10d80a+'/'+_0x338d7c)[_0xb87c('0x2b')](_0x1103e0);}return null;};}function patchUpdates(_0x14f974){return function(_0x25ccb1){try{jsonpatch[_0xb87c('0x32')](_0x25ccb1,_0x14f974,!![]);}catch(_0x301beb){return BPromise[_0xb87c('0x33')](_0x301beb);}return _0x25ccb1[_0xb87c('0x34')]();};}function saveUpdates(_0x228dab,_0x5a7f5b){return function(_0x4abded){if(_0x4abded){return _0x4abded[_0xb87c('0x35')](_0x228dab)[_0xb87c('0x1c')](function(_0x4831a2){return _0x4831a2;});}return null;};}function removeEntity(_0x35f6ec,_0x209733){return function(_0x2cd8a3){if(_0x2cd8a3){return _0x2cd8a3[_0xb87c('0x36')]()['then'](function(){_0x35f6ec['status'](0xcc)[_0xb87c('0x2a')]();});}};}function handleEntityNotFound(_0x2367e8,_0x3e3f7c){return function(_0x4aea22){if(!_0x4aea22){_0x2367e8[_0xb87c('0x28')](0x194);}return _0x4aea22;};}function handleError(_0x49ac9e,_0x3f7689){_0x3f7689=_0x3f7689||0x1f4;return function(_0x52163c){logger[_0xb87c('0x23')](_0x52163c[_0xb87c('0x37')]);if(_0x52163c['name']){delete _0x52163c['name'];}_0x49ac9e['status'](_0x3f7689)[_0xb87c('0x38')](_0x52163c);};}exports[_0xb87c('0x39')]=function(_0x562bb8,_0x2844ce){var _0x40e418={},_0x378b88={},_0x36cd66={'count':0x0,'rows':[]};var _0x21fcff=_[_0xb87c('0x3a')](db[_0xb87c('0x3b')][_0xb87c('0x3c')],function(_0xbe9a14){return{'name':_0xbe9a14[_0xb87c('0x3d')],'type':_0xbe9a14[_0xb87c('0x3e')][_0xb87c('0x3f')]};});_0x378b88[_0xb87c('0x40')]=_['map'](_0x21fcff,_0xb87c('0x41'));_0x378b88['query']=_[_0xb87c('0x42')](_0x562bb8[_0xb87c('0x43')]);_0x378b88[_0xb87c('0x44')]=_[_0xb87c('0x45')](_0x378b88[_0xb87c('0x40')],_0x378b88[_0xb87c('0x43')]);_0x40e418[_0xb87c('0x46')]=_['intersection'](_0x378b88[_0xb87c('0x40')],qs[_0xb87c('0x47')](_0x562bb8[_0xb87c('0x43')]['fields']));_0x40e418[_0xb87c('0x46')]=_0x40e418['attributes'][_0xb87c('0x48')]?_0x40e418[_0xb87c('0x46')]:_0x378b88[_0xb87c('0x40')];if(!_0x562bb8[_0xb87c('0x43')][_0xb87c('0x49')](_0xb87c('0x4a'))){_0x40e418[_0xb87c('0x2d')]=qs['limit'](_0x562bb8[_0xb87c('0x43')][_0xb87c('0x2d')]);_0x40e418[_0xb87c('0x2c')]=qs['offset'](_0x562bb8[_0xb87c('0x43')][_0xb87c('0x2c')]);}_0x40e418[_0xb87c('0x4b')]=qs['sort'](_0x562bb8[_0xb87c('0x43')][_0xb87c('0x4c')]);_0x40e418[_0xb87c('0x4d')]=qs[_0xb87c('0x44')](_[_0xb87c('0x4e')](_0x562bb8[_0xb87c('0x43')],_0x378b88[_0xb87c('0x44')]),_0x21fcff);if(_0x562bb8[_0xb87c('0x43')]['filter']){_0x40e418[_0xb87c('0x4d')]=_[_0xb87c('0x4f')](_0x40e418['where'],{'$or':_[_0xb87c('0x3a')](_0x21fcff,function(_0x1886de){if(_0x1886de[_0xb87c('0x3e')]!==_0xb87c('0x50')){var _0x59b112={};_0x59b112[_0x1886de[_0xb87c('0x41')]]={'$like':'%'+_0x562bb8['query'][_0xb87c('0x51')]+'%'};return _0x59b112;}})});}_0x40e418=_[_0xb87c('0x4f')]({},_0x40e418,_0x562bb8[_0xb87c('0x52')]);var _0x5510b0={'where':_0x40e418[_0xb87c('0x4d')]};return db['Setting']['count'](_0x5510b0)[_0xb87c('0x1c')](function(_0x558e2e){_0x36cd66['count']=_0x558e2e;if(_0x562bb8['query'][_0xb87c('0x53')]){_0x40e418['include']=[{'all':!![]}];}return db[_0xb87c('0x3b')][_0xb87c('0x54')](_0x40e418);})[_0xb87c('0x1c')](function(_0x2ab3a6){_0x36cd66[_0xb87c('0x55')]=_0x2ab3a6;return _0x36cd66;})['then'](respondWithFilteredResult(_0x2844ce,_0x40e418))[_0xb87c('0x27')](handleError(_0x2844ce,null));};exports['show']=function(_0x491572,_0x3a0f85){var _0x571471={'raw':![],'where':{'id':_0x491572['params']['id']}},_0x432c67={};_0x432c67['model']=_[_0xb87c('0x42')](db['Setting'][_0xb87c('0x3c')]);_0x432c67[_0xb87c('0x43')]=_[_0xb87c('0x42')](_0x491572[_0xb87c('0x43')]);_0x432c67[_0xb87c('0x44')]=_['intersection'](_0x432c67[_0xb87c('0x40')],_0x432c67[_0xb87c('0x43')]);_0x571471['attributes']=_[_0xb87c('0x45')](_0x432c67[_0xb87c('0x40')],qs[_0xb87c('0x47')](_0x491572[_0xb87c('0x43')][_0xb87c('0x47')]));_0x571471[_0xb87c('0x46')]=_0x571471[_0xb87c('0x46')][_0xb87c('0x48')]?_0x571471[_0xb87c('0x46')]:_0x432c67[_0xb87c('0x40')];if(_0x491572['query'][_0xb87c('0x53')]){_0x571471['include']=[{'all':!![]}];}_0x571471=_[_0xb87c('0x4f')]({},_0x571471,_0x491572[_0xb87c('0x52')]);return db[_0xb87c('0x3b')][_0xb87c('0x56')](_0x571471)[_0xb87c('0x1c')](handleEntityNotFound(_0x3a0f85,null))['then'](respondWithResult(_0x3a0f85,null))['catch'](handleError(_0x3a0f85,null));};exports[_0xb87c('0x35')]=function(_0x56b4e8,_0x7484df){if(_0x56b4e8[_0xb87c('0x57')]['id']){delete _0x56b4e8[_0xb87c('0x57')]['id'];}return db[_0xb87c('0x3b')]['find']({'where':{'id':_0x56b4e8[_0xb87c('0x58')]['id']}})[_0xb87c('0x1c')](handleEntityNotFound(_0x7484df,null))['then'](saveUpdates(_0x56b4e8['body'],null))[_0xb87c('0x1c')](respondWithResult(_0x7484df,null))[_0xb87c('0x27')](handleError(_0x7484df,null));};exports[_0xb87c('0x59')]=function(_0x8b114f,_0x43b1bc,_0x1f72d2){if(_0x8b114f[_0xb87c('0x5a')]&&_0x8b114f[_0xb87c('0x5a')]['filename']){_0x8b114f[_0xb87c('0x57')][_0xb87c('0x5b')]=_0x8b114f[_0xb87c('0x5a')][_0xb87c('0x5c')];}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x8b114f[_0xb87c('0x58')]['id']}})[_0xb87c('0x1c')](handleEntityNotFound(_0x43b1bc,null))[_0xb87c('0x1c')](saveUpdates(_0x8b114f[_0xb87c('0x57')],null))['then'](respondWithResult(_0x43b1bc,null))[_0xb87c('0x27')](handleError(_0x43b1bc,null));};exports[_0xb87c('0x5d')]=function(_0x17149d,_0x18fa7d,_0x59e0c7){if(_0x17149d[_0xb87c('0x5a')]&&_0x17149d[_0xb87c('0x5a')][_0xb87c('0x5c')]){_0x17149d[_0xb87c('0x57')][_0xb87c('0x5e')]=_0x17149d[_0xb87c('0x5a')][_0xb87c('0x5c')];}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x17149d['params']['id']}})[_0xb87c('0x1c')](handleEntityNotFound(_0x18fa7d,null))[_0xb87c('0x1c')](saveUpdates(_0x17149d[_0xb87c('0x57')],null))['then'](respondWithResult(_0x18fa7d,null))['catch'](handleError(_0x18fa7d,null));};var utilLicense=require(_0xb87c('0x5f'));exports[_0xb87c('0x60')]=function(_0x2a5bd2,_0x3145fe,_0x4110b3){var _0x56a9b1=_0xb87c('0x61');var _0x5b72d6={'custom':![]};return utilLicense[_0xb87c('0x62')]()[_0xb87c('0x1c')](function(_0x5e2f21){if(_0x5e2f21){_0x5b72d6=_0x5e2f21;}return db['Setting']['find']({'where':{'id':_0x2a5bd2[_0xb87c('0x58')]['id']},'attributes':[_0xb87c('0x5b'),_0xb87c('0x5e'),_0xb87c('0x63'),_0xb87c('0x64'),_0xb87c('0x65'),_0xb87c('0x66'),_0xb87c('0x67'),_0xb87c('0x68')],'raw':!![]});})[_0xb87c('0x1c')](handleEntityNotFound(_0x3145fe,null))[_0xb87c('0x1c')](function(_0x11eb1a){if(_0x11eb1a){var _0x3a1b6e=_0x11eb1a[_0xb87c('0x5b')]&&fs[_0xb87c('0x69')](path[_0xb87c('0x6a')](config['root'],_0x56a9b1,_[_0xb87c('0x6b')](_0x11eb1a[_0xb87c('0x5b')])))?path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x56a9b1,_['toLower'](_0x11eb1a[_0xb87c('0x5b')])):path[_0xb87c('0x6a')](config['root'],_0x56a9b1,_[_0xb87c('0x6b')](_0xb87c('0x6d')));var _0x34c81e=_0xb87c('0x6e')+_[_0xb87c('0x6f')](_0xb87c('0x5b'));if(_0x11eb1a[_0x34c81e]||!_0x5b72d6[_0xb87c('0x70')]){_0x3a1b6e=path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x56a9b1,_[_0xb87c('0x6b')](_0xb87c('0x6d')));}if(!fs[_0xb87c('0x69')](_0x3a1b6e)){throw new db[(_0xb87c('0x71'))][(_0xb87c('0x72'))](_[_0xb87c('0x6f')](_0xb87c('0x5b'))+_0xb87c('0x73'));}return _0x3145fe[_0xb87c('0x74')](_0x3a1b6e);}})[_0xb87c('0x27')](handleError(_0x3145fe,null));};var utilLicense=require(_0xb87c('0x5f'));exports[_0xb87c('0x75')]=function(_0x4a34df,_0x329e86,_0x19e11d){var _0x162f48=_0xb87c('0x61');var _0x147f9d={'custom':![]};return utilLicense['getLicense']()[_0xb87c('0x1c')](function(_0x43189d){if(_0x43189d){_0x147f9d=_0x43189d;}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x4a34df[_0xb87c('0x58')]['id']},'attributes':[_0xb87c('0x5b'),_0xb87c('0x5e'),_0xb87c('0x63'),'favicon',_0xb87c('0x65'),_0xb87c('0x66'),'defaultPreferred',_0xb87c('0x68')],'raw':!![]});})[_0xb87c('0x1c')](handleEntityNotFound(_0x329e86,null))[_0xb87c('0x1c')](function(_0x549592){if(_0x549592){var _0xa613af=_0x549592[_0xb87c('0x5e')]&&fs['existsSync'](path['join'](config['root'],_0x162f48,_[_0xb87c('0x6b')](_0x549592[_0xb87c('0x5e')])))?path['join'](config['root'],_0x162f48,_[_0xb87c('0x6b')](_0x549592[_0xb87c('0x5e')])):path['join'](config['root'],_0x162f48,_['toLower'](_0xb87c('0x76')));var _0x710857='default'+_[_0xb87c('0x6f')](_0xb87c('0x5e'));if(_0x549592[_0x710857]||!_0x147f9d['custom']){_0xa613af=path[_0xb87c('0x6a')](config['root'],_0x162f48,_['toLower'](_0xb87c('0x76')));}if(!fs['existsSync'](_0xa613af)){throw new db[(_0xb87c('0x71'))]['ValidationError'](_['upperFirst'](_0xb87c('0x5e'))+_0xb87c('0x73'));}return _0x329e86[_0xb87c('0x74')](_0xa613af);}})[_0xb87c('0x27')](handleError(_0x329e86,null));};exports[_0xb87c('0x77')]=function(_0x36d81e,_0x5b87ac){return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x36d81e['params']['id']},'attributes':[_0xb87c('0x78')]})[_0xb87c('0x1c')](respondWithResult(_0x5b87ac,null))[_0xb87c('0x27')](handleError(_0x5b87ac,null));};exports['addPreferred']=function(_0x375759,_0x20325f,_0x46ef44){if(_0x375759[_0xb87c('0x5a')]&&_0x375759['file'][_0xb87c('0x5c')]){_0x375759[_0xb87c('0x57')]['preferred']=_0x375759[_0xb87c('0x5a')][_0xb87c('0x5c')];}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x375759[_0xb87c('0x58')]['id']}})[_0xb87c('0x1c')](handleEntityNotFound(_0x20325f,null))[_0xb87c('0x1c')](saveUpdates(_0x375759[_0xb87c('0x57')],null))[_0xb87c('0x1c')](respondWithResult(_0x20325f,null))[_0xb87c('0x27')](handleError(_0x20325f,null));};var utilLicense=require(_0xb87c('0x5f'));exports[_0xb87c('0x79')]=function(_0x129415,_0x1e8d59,_0x43fae3){var _0x2eef04=_0xb87c('0x61');var _0x2ec61e={'custom':![]};return utilLicense[_0xb87c('0x62')]()['then'](function(_0x208a2e){if(_0x208a2e){_0x2ec61e=_0x208a2e;}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x129415[_0xb87c('0x58')]['id']},'attributes':[_0xb87c('0x5b'),_0xb87c('0x5e'),_0xb87c('0x63'),'favicon','defaultLogo',_0xb87c('0x66'),_0xb87c('0x67'),_0xb87c('0x68')],'raw':!![]});})['then'](handleEntityNotFound(_0x1e8d59,null))['then'](function(_0x2db502){if(_0x2db502){var _0x45814a=_0x2db502[_0xb87c('0x63')]&&fs['existsSync'](path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x2eef04,_[_0xb87c('0x6b')](_0x2db502[_0xb87c('0x63')])))?path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x2eef04,_[_0xb87c('0x6b')](_0x2db502[_0xb87c('0x63')])):path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x2eef04,_[_0xb87c('0x6b')]('default_preferred.png'));var _0x2adece=_0xb87c('0x6e')+_[_0xb87c('0x6f')](_0xb87c('0x63'));if(_0x2db502[_0x2adece]||!_0x2ec61e['custom']||!_0x2ec61e[_0xb87c('0x63')]){_0x45814a=path[_0xb87c('0x6a')](config['root'],_0x2eef04,_['toLower']('default_preferred.png'));}if(!fs[_0xb87c('0x69')](_0x45814a)){throw new db[(_0xb87c('0x71'))][(_0xb87c('0x72'))](_[_0xb87c('0x6f')]('preferred')+_0xb87c('0x73'));}return _0x1e8d59['download'](_0x45814a);}})['catch'](handleError(_0x1e8d59,null));};exports['addFavicon']=function(_0x718a65,_0x4d9751,_0x418782){if(_0x718a65['file']&&_0x718a65['file'][_0xb87c('0x5c')]){_0x718a65['body']['favicon']=_0x718a65[_0xb87c('0x5a')][_0xb87c('0x5c')];}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0x718a65['params']['id']}})['then'](handleEntityNotFound(_0x4d9751,null))[_0xb87c('0x1c')](saveUpdates(_0x718a65['body'],null))[_0xb87c('0x1c')](respondWithResult(_0x4d9751,null))[_0xb87c('0x27')](handleError(_0x4d9751,null));};var utilLicense=require('../../config/license/util');exports[_0xb87c('0x7a')]=function(_0xc1c031,_0x249576,_0x38d5ca){var _0x14d43b='server/files/images/logos';var _0x2a9d47={'custom':![]};return utilLicense[_0xb87c('0x62')]()[_0xb87c('0x1c')](function(_0xd1c0a2){if(_0xd1c0a2){_0x2a9d47=_0xd1c0a2;}return db[_0xb87c('0x3b')][_0xb87c('0x56')]({'where':{'id':_0xc1c031[_0xb87c('0x58')]['id']},'attributes':[_0xb87c('0x5b'),_0xb87c('0x5e'),'preferred','favicon',_0xb87c('0x65'),_0xb87c('0x66'),_0xb87c('0x67'),_0xb87c('0x68')],'raw':!![]});})['then'](handleEntityNotFound(_0x249576,null))[_0xb87c('0x1c')](function(_0x30d36e){if(_0x30d36e){var _0x225543=_0x30d36e[_0xb87c('0x64')]&&fs[_0xb87c('0x69')](path['join'](config[_0xb87c('0x6c')],_0x14d43b,_[_0xb87c('0x6b')](_0x30d36e[_0xb87c('0x64')])))?path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x14d43b,_['toLower'](_0x30d36e[_0xb87c('0x64')])):path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x14d43b,_[_0xb87c('0x6b')](_0xb87c('0x7b')));var _0x29892c='default'+_[_0xb87c('0x6f')]('favicon');if(_0x30d36e[_0x29892c]||!_0x2a9d47['custom']){_0x225543=path[_0xb87c('0x6a')](config[_0xb87c('0x6c')],_0x14d43b,_[_0xb87c('0x6b')](_0xb87c('0x7b')));}if(!fs[_0xb87c('0x69')](_0x225543)){throw new db['Sequelize']['ValidationError'](_[_0xb87c('0x6f')](_0xb87c('0x64'))+_0xb87c('0x73'));}return _0x249576[_0xb87c('0x74')](_0x225543);}})['catch'](handleError(_0x249576,null));};exports[_0xb87c('0x7c')]=function(_0x35ae22,_0x19cef7){var _0x5af160={'offset':moment()[_0xb87c('0x7d')]()};_0x5af160[_0xb87c('0x7e')]=moment()['utcOffset'](_0x5af160[_0xb87c('0x2c')])['format'](_0xb87c('0x7f'));return _0x19cef7[_0xb87c('0x29')](0xc8)[_0xb87c('0x38')](_0x5af160);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index aabd509..03fcaf5 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0x55ca,0x126));var _0xa55c=function(_0x246cbe,_0x19305c){_0x246cbe=_0x246cbe-0x0;var _0x855b0=_0x55ca[_0x246cbe];return _0x855b0;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x2e7c96,_0x27804d){var _0x36008e=function(_0xd03b6b){while(--_0xd03b6b){_0x2e7c96['push'](_0x2e7c96['shift']());}};_0x36008e(++_0x27804d);}(_0x008c,0x188));var _0xc008=function(_0x5e9d1f,_0x37c578){_0x5e9d1f=_0x5e9d1f-0x0;var _0x895bea=_0x008c[_0x5e9d1f];return _0x895bea;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0e73e66..7adbb00 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 _0x0d3f=['raw','options','where','attributes','include','map','model','then','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','client','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','ShowSetting','Setting'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d3f,0x79));var _0xf0d3=function(_0x16b992,_0x43d74c){_0x16b992=_0x16b992-0x0;var _0x385c78=_0x0d3f[_0x16b992];return _0x385c78;};'use strict';var _=require(_0xf0d3('0x0'));var util=require(_0xf0d3('0x1'));var moment=require(_0xf0d3('0x2'));var BPromise=require(_0xf0d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf0d3('0x5'))(_0xf0d3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf0d3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x269a2f,_0x2ce7a0,_0x44121a){return new BPromise(function(_0x3a0ef8,_0x3e2318){return client[_0xf0d3('0x8')](_0x269a2f,_0x44121a)['then'](function(_0x3b70d8){logger[_0xf0d3('0x9')]('Setting,\x20%s,\x20%s',_0x2ce7a0,_0xf0d3('0xa'));logger[_0xf0d3('0xb')](_0xf0d3('0xc'),_0x2ce7a0,_0xf0d3('0xa'),JSON[_0xf0d3('0xd')](_0x3b70d8));if(_0x3b70d8[_0xf0d3('0xe')]){if(_0x3b70d8['error']['code']===0x1f4){logger[_0xf0d3('0xe')](_0xf0d3('0xf'),_0x2ce7a0,_0x3b70d8[_0xf0d3('0xe')]['message']);return _0x3e2318(_0x3b70d8[_0xf0d3('0xe')][_0xf0d3('0x10')]);}logger['error'](_0xf0d3('0xf'),_0x2ce7a0,_0x3b70d8['error']['message']);return _0x3a0ef8(_0x3b70d8[_0xf0d3('0xe')]['message']);}else{logger[_0xf0d3('0x9')](_0xf0d3('0xf'),_0x2ce7a0,'request\x20sent');_0x3a0ef8(_0x3b70d8['result'][_0xf0d3('0x10')]);}})['catch'](function(_0x594247){logger['error'](_0xf0d3('0xf'),_0x2ce7a0,_0x594247);_0x3e2318(_0x594247);});});}exports[_0xf0d3('0x11')]=function(_0x3513ac){var _0x50e0c9=this;return new Promise(function(_0xcbf6c3,_0x1bcd2d){return db[_0xf0d3('0x12')]['find']({'raw':_0x3513ac['options']?_0x3513ac['options'][_0xf0d3('0x13')]===undefined?!![]:![]:!![],'where':_0x3513ac[_0xf0d3('0x14')]?_0x3513ac[_0xf0d3('0x14')][_0xf0d3('0x15')]||null:null,'attributes':_0x3513ac[_0xf0d3('0x14')]?_0x3513ac['options'][_0xf0d3('0x16')]||null:null,'include':_0x3513ac[_0xf0d3('0x14')]?_0x3513ac[_0xf0d3('0x14')][_0xf0d3('0x17')]?_[_0xf0d3('0x18')](_0x3513ac[_0xf0d3('0x14')][_0xf0d3('0x17')],function(_0x1cb629){return{'model':db[_0x1cb629[_0xf0d3('0x19')]],'as':_0x1cb629['as'],'attributes':_0x1cb629[_0xf0d3('0x16')],'include':_0x1cb629[_0xf0d3('0x17')]?_['map'](_0x1cb629[_0xf0d3('0x17')],function(_0x2ba3b1){return{'model':db[_0x2ba3b1[_0xf0d3('0x19')]],'as':_0x2ba3b1['as'],'attributes':_0x2ba3b1['attributes'],'include':_0x2ba3b1[_0xf0d3('0x17')]?_[_0xf0d3('0x18')](_0x2ba3b1[_0xf0d3('0x17')],function(_0x3242f6){return{'model':db[_0x3242f6['model']],'as':_0x3242f6['as'],'attributes':_0x3242f6[_0xf0d3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf0d3('0x1a')](function(_0x1f6a95){logger[_0xf0d3('0x9')](_0xf0d3('0x11'),_0x3513ac);logger[_0xf0d3('0xb')](_0xf0d3('0x11'),_0x3513ac,JSON['stringify'](_0x1f6a95));_0xcbf6c3(_0x1f6a95);})[_0xf0d3('0x1b')](function(_0xfd72f8){logger[_0xf0d3('0xe')](_0xf0d3('0x11'),_0xfd72f8[_0xf0d3('0x10')],_0x3513ac);_0x1bcd2d(_0x50e0c9[_0xf0d3('0xe')](0x1f4,_0xfd72f8['message']));});});}; \ No newline at end of file +var _0x2f87=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','attributes','include','map','model','then','debug','lodash','util','moment','bluebird'];(function(_0x5c3281,_0x1098f6){var _0x3375ac=function(_0x4ea15d){while(--_0x4ea15d){_0x5c3281['push'](_0x5c3281['shift']());}};_0x3375ac(++_0x1098f6);}(_0x2f87,0xbc));var _0x72f8=function(_0x37f1bf,_0x3012a1){_0x37f1bf=_0x37f1bf-0x0;var _0x3a00a1=_0x2f87[_0x37f1bf];return _0x3a00a1;};'use strict';var _=require(_0x72f8('0x0'));var util=require(_0x72f8('0x1'));var moment=require(_0x72f8('0x2'));var BPromise=require(_0x72f8('0x3'));var rs=require(_0x72f8('0x4'));var fs=require('fs');var Redis=require(_0x72f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x72f8('0x6'));var logger=require(_0x72f8('0x7'))('rpc');var config=require(_0x72f8('0x8'));var jayson=require(_0x72f8('0x9'));var client=jayson[_0x72f8('0xa')][_0x72f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x448c6e,_0x13166f,_0x159d98){return new BPromise(function(_0x322aef,_0x8c904b){return client['request'](_0x448c6e,_0x159d98)['then'](function(_0x36f78b){logger[_0x72f8('0xc')]('Setting,\x20%s,\x20%s',_0x13166f,_0x72f8('0xd'));logger['debug'](_0x72f8('0xe'),_0x13166f,_0x72f8('0xd'),JSON[_0x72f8('0xf')](_0x36f78b));if(_0x36f78b[_0x72f8('0x10')]){if(_0x36f78b['error'][_0x72f8('0x11')]===0x1f4){logger[_0x72f8('0x10')](_0x72f8('0x12'),_0x13166f,_0x36f78b[_0x72f8('0x10')][_0x72f8('0x13')]);return _0x8c904b(_0x36f78b[_0x72f8('0x10')][_0x72f8('0x13')]);}logger[_0x72f8('0x10')](_0x72f8('0x12'),_0x13166f,_0x36f78b['error'][_0x72f8('0x13')]);return _0x322aef(_0x36f78b['error']['message']);}else{logger[_0x72f8('0xc')]('Setting,\x20%s,\x20%s',_0x13166f,_0x72f8('0xd'));_0x322aef(_0x36f78b[_0x72f8('0x14')][_0x72f8('0x13')]);}})[_0x72f8('0x15')](function(_0x48f18c){logger[_0x72f8('0x10')](_0x72f8('0x12'),_0x13166f,_0x48f18c);_0x8c904b(_0x48f18c);});});}exports[_0x72f8('0x16')]=function(_0x4fb03a){var _0x51c2ce=this;return new Promise(function(_0x487a45,_0xe3e109){return db[_0x72f8('0x17')][_0x72f8('0x18')]({'raw':_0x4fb03a[_0x72f8('0x19')]?_0x4fb03a['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fb03a[_0x72f8('0x19')]?_0x4fb03a['options']['where']||null:null,'attributes':_0x4fb03a[_0x72f8('0x19')]?_0x4fb03a[_0x72f8('0x19')][_0x72f8('0x1a')]||null:null,'include':_0x4fb03a[_0x72f8('0x19')]?_0x4fb03a['options'][_0x72f8('0x1b')]?_[_0x72f8('0x1c')](_0x4fb03a[_0x72f8('0x19')]['include'],function(_0x47b2a4){return{'model':db[_0x47b2a4[_0x72f8('0x1d')]],'as':_0x47b2a4['as'],'attributes':_0x47b2a4['attributes'],'include':_0x47b2a4[_0x72f8('0x1b')]?_['map'](_0x47b2a4[_0x72f8('0x1b')],function(_0x2ba178){return{'model':db[_0x2ba178['model']],'as':_0x2ba178['as'],'attributes':_0x2ba178[_0x72f8('0x1a')],'include':_0x2ba178[_0x72f8('0x1b')]?_['map'](_0x2ba178[_0x72f8('0x1b')],function(_0x24dea5){return{'model':db[_0x24dea5[_0x72f8('0x1d')]],'as':_0x24dea5['as'],'attributes':_0x24dea5[_0x72f8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x72f8('0x1e')](function(_0x520831){logger['info'](_0x72f8('0x16'),_0x4fb03a);logger[_0x72f8('0x1f')]('ShowSetting',_0x4fb03a,JSON[_0x72f8('0xf')](_0x520831));_0x487a45(_0x520831);})[_0x72f8('0x15')](function(_0x45792d){logger['error'](_0x72f8('0x16'),_0x45792d[_0x72f8('0x13')],_0x4fb03a);_0xe3e109(_0x51c2ce[_0x72f8('0x10')](0x1f4,_0x45792d[_0x72f8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 96ec318..2902a0b 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x2992af,_0x1a9b57){var _0x141157=function(_0xace62f){while(--_0xace62f){_0x2992af['push'](_0x2992af['shift']());}};_0x141157(++_0x1a9b57);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x46c318,_0x3a5b3f){_0x46c318=_0x46c318-0x0;var _0x143050=_0x7fbe[_0x46c318];return _0x143050;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x326f,0xd1));var _0xf326=function(_0x4e7937,_0x5ab048){_0x4e7937=_0x4e7937-0x0;var _0x1b4f79=_0x326f[_0x4e7937];return _0x1b4f79;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 1010351..4ed9f2b 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 _0x41ae=['exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0xda8684,_0x40ac51){var _0x396c80=function(_0x4617e8){while(--_0x4617e8){_0xda8684['push'](_0xda8684['shift']());}};_0x396c80(++_0x40ac51);}(_0x41ae,0x11e));var _0xe41a=function(_0x19e96c,_0x56c275){_0x19e96c=_0x19e96c-0x0;var _0x4fe77c=_0x41ae[_0x19e96c];return _0x4fe77c;};'use strict';var Sequelize=require(_0xe41a('0x0'));var rs=require(_0xe41a('0x1'));module[_0xe41a('0x2')]={'name':{'type':Sequelize[_0xe41a('0x3')],'unique':_0xe41a('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe41a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe41a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe41a('0x3')],'defaultValue':function(){return rs[_0xe41a('0x5')]();}},'phone':{'type':Sequelize[_0xe41a('0x3')]},'type':{'type':Sequelize[_0xe41a('0x6')](_0xe41a('0x7'),_0xe41a('0x8'),_0xe41a('0x9'),_0xe41a('0xa'),_0xe41a('0xb'),'clickatell',_0xe41a('0xc'),_0xe41a('0xd'),_0xe41a('0xe'),_0xe41a('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xe41a('0x3')]},'authToken':{'type':Sequelize[_0xe41a('0x3')]},'smsMethod':{'type':Sequelize[_0xe41a('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xe41a('0x3')]},'applicationId':{'type':Sequelize[_0xe41a('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xe41a('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xe41a('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe41a('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe41a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe41a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe41a('0x12')],'comment':_0xe41a('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xe41a('0x11')],'defaultValue':![],'comment':_0xe41a('0x14'),'set':function(_0x381c03){if(!_0x381c03)this['setDataValue'](_0xe41a('0x15'),null);this[_0xe41a('0x16')](_0xe41a('0x17'),_0x381c03);}}}; \ No newline at end of file +var _0x092f=['bandwidth','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','twilio','skebby','clicksend','plivo'];(function(_0x23f983,_0x171719){var _0x3c87f9=function(_0x2beee7){while(--_0x2beee7){_0x23f983['push'](_0x23f983['shift']());}};_0x3c87f9(++_0x171719);}(_0x092f,0x1af));var _0xf092=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x092f[_0x263f4c];return _0x3a78d3;};'use strict';var Sequelize=require(_0xf092('0x0'));var rs=require('randomstring');module[_0xf092('0x1')]={'name':{'type':Sequelize[_0xf092('0x2')],'unique':_0xf092('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf092('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xf092('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xf092('0x2')]},'type':{'type':Sequelize[_0xf092('0x4')](_0xf092('0x5'),_0xf092('0x6'),'connectel',_0xf092('0x7'),_0xf092('0x8'),'clickatell',_0xf092('0x9'),_0xf092('0xa'),_0xf092('0xb'),_0xf092('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xf092('0x2')]},'authToken':{'type':Sequelize[_0xf092('0x2')]},'smsMethod':{'type':Sequelize[_0xf092('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xf092('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xf092('0x2')]},'applicationId':{'type':Sequelize[_0xf092('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xf092('0x2')]},'deliveryReport':{'type':Sequelize[_0xf092('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf092('0xe');}},'notificationSound':{'type':Sequelize[_0xf092('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf092('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf092('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf092('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf092('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf092('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf092('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf092('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf092('0xd')],'defaultValue':![],'comment':_0xf092('0x10'),'set':function(_0x50c7fe){if(!_0x50c7fe)this[_0xf092('0x11')](_0xf092('0x12'),null);this[_0xf092('0x11')](_0xf092('0x13'),_0x50c7fe);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 3a1d733..445653d 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 _0x6056=['keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','sms','SmsApplication','account','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','Body','messageId','from','sender','text','connectel','clicksend','plivo','infobip','results','originatingAddress','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','User','UserId','unshift','agent','Start','startRouting','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','json','sequelize','findAndCountAll','priority','getInteractions','Owner','fullname','internal','Tag','Tags','tag','List','out','Messages','dataValues','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','status_code','message_id','groupName','redif','DELIVERED','DELIVERED_TO_GATEWAY','bandwidth','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','offset','undefined','limit','count','set','apply','save','get','UserProfileResource','destroy','end','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','show','params'];(function(_0x58e0e,_0x122b69){var _0x1b5996=function(_0xe88577){while(--_0xe88577){_0x58e0e['push'](_0x58e0e['shift']());}};_0x1b5996(++_0x122b69);}(_0x6056,0x85));var _0x6605=function(_0x3a4b6c,_0x3b8490){_0x3a4b6c=_0x3a4b6c-0x0;var _0x59b956=_0x6056[_0x3a4b6c];return _0x59b956;};'use strict';var emlformat=require(_0x6605('0x0'));var rimraf=require(_0x6605('0x1'));var zipdir=require(_0x6605('0x2'));var jsonpatch=require(_0x6605('0x3'));var rp=require('request-promise');var moment=require(_0x6605('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6605('0x5'));var util=require(_0x6605('0x6'));var path=require(_0x6605('0x7'));var sox=require(_0x6605('0x8'));var csv=require(_0x6605('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6605('0xa'));var _=require(_0x6605('0xb'));var squel=require(_0x6605('0xc'));var crypto=require(_0x6605('0xd'));var jsforce=require(_0x6605('0xe'));var deskjs=require(_0x6605('0xf'));var toCsv=require(_0x6605('0x9'));var querystring=require(_0x6605('0x10'));var Papa=require(_0x6605('0x11'));var Redis=require(_0x6605('0x12'));var authService=require(_0x6605('0x13'));var qs=require(_0x6605('0x14'));var as=require(_0x6605('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6605('0x16'));var utils=require(_0x6605('0x17'));var config=require(_0x6605('0x18'));var licenseUtil=require(_0x6605('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6605('0x1a')](config[_0x6605('0x1b')],{'host':_0x6605('0x1c'),'port':0x18eb});var socket=require(_0x6605('0x1d'))(new Redis(config[_0x6605('0x1b')]));require(_0x6605('0x1e'))[_0x6605('0x1f')](socket);var jayson=require(_0x6605('0x20'));var client=jayson['client'][_0x6605('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x34732e,_0x10dd05,_0x309a8d,_0x3120a3){return new BPromise(function(_0x10e0c6,_0x39892f){var _0xb3c19c=_0x3120a3||client;return _0xb3c19c[_0x6605('0x22')](_0x34732e,_0x309a8d)[_0x6605('0x23')](function(_0xc3225a){logger[_0x6605('0x24')](_0x6605('0x25'),_0x10dd05,_0x6605('0x26'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x10dd05,_0x6605('0x26'),JSON[_0x6605('0x27')](_0xc3225a));if(_0xc3225a[_0x6605('0x28')]){if(_0xc3225a[_0x6605('0x28')][_0x6605('0x29')]===0x1f4){logger[_0x6605('0x28')]('SmsAccount,\x20%s,\x20%s',_0x10dd05,_0xc3225a[_0x6605('0x28')][_0x6605('0x2a')]);return _0x39892f(_0xc3225a[_0x6605('0x28')]['message']);}logger[_0x6605('0x28')](_0x6605('0x25'),_0x10dd05,_0xc3225a[_0x6605('0x28')][_0x6605('0x2a')]);return _0x10e0c6(_0xc3225a['error'][_0x6605('0x2a')]);}else{logger[_0x6605('0x24')](_0x6605('0x25'),_0x10dd05,_0x6605('0x26'));_0x10e0c6(_0xc3225a[_0x6605('0x2b')][_0x6605('0x2a')]);}})['catch'](function(_0x8f4aff){logger['error']('SmsAccount,\x20%s,\x20%s',_0x10dd05,_0x8f4aff);_0x39892f(_0x8f4aff);});});}function respondWithStatusCode(_0x4cb093,_0x11f3ce){_0x11f3ce=_0x11f3ce||0xcc;return function(_0x5d1d3c){if(_0x5d1d3c){return _0x4cb093['sendStatus'](_0x11f3ce);}return _0x4cb093[_0x6605('0x2c')](_0x11f3ce)['end']();};}function respondWithResult(_0x4ffc9a,_0x11779d){_0x11779d=_0x11779d||0xc8;return function(_0x597237){if(_0x597237){return _0x4ffc9a['status'](_0x11779d)['json'](_0x597237);}};}function respondWithFilteredResult(_0x255cd1,_0xbd0b1a){return function(_0x45ea86){if(_0x45ea86){var _0x3db741=typeof _0xbd0b1a[_0x6605('0x2d')]===_0x6605('0x2e')&&typeof _0xbd0b1a[_0x6605('0x2f')]===_0x6605('0x2e');var _0x26af91=_0x45ea86['count'];var _0x5629f4=_0x3db741?0x0:_0xbd0b1a['offset'];var _0x4ea1a0=_0x3db741?_0x45ea86[_0x6605('0x30')]:_0xbd0b1a[_0x6605('0x2d')]+_0xbd0b1a['limit'];var _0x33d6fc;if(_0x4ea1a0>=_0x26af91){_0x4ea1a0=_0x26af91;_0x33d6fc=0xc8;}else{_0x33d6fc=0xce;}_0x255cd1['status'](_0x33d6fc);return _0x255cd1[_0x6605('0x31')]('Content-Range',_0x5629f4+'-'+_0x4ea1a0+'/'+_0x26af91)['json'](_0x45ea86);}return null;};}function patchUpdates(_0x147b5f){return function(_0x508e02){try{jsonpatch[_0x6605('0x32')](_0x508e02,_0x147b5f,!![]);}catch(_0x28b46c){return BPromise['reject'](_0x28b46c);}return _0x508e02[_0x6605('0x33')]();};}function saveUpdates(_0x8a05e7,_0x5fbdde){return function(_0x58bc26){if(_0x58bc26){return _0x58bc26['update'](_0x8a05e7)[_0x6605('0x23')](function(_0x2644c1){return _0x2644c1;});}return null;};}function removeEntity(_0x5bae35,_0x4b8a8){return function(_0x1549c5){if(_0x1549c5){return _0x1549c5['destroy']()[_0x6605('0x23')](function(){var _0x6d5024=_0x1549c5[_0x6605('0x34')]({'plain':!![]});var _0x52128d='SmsAccounts';return db[_0x6605('0x35')][_0x6605('0x36')]({'where':{'type':_0x52128d,'resourceId':_0x6d5024['id']}})[_0x6605('0x23')](function(){return _0x1549c5;});})[_0x6605('0x23')](function(){_0x5bae35[_0x6605('0x2c')](0xcc)[_0x6605('0x37')]();});}};}function handleEntityNotFound(_0x444ee1,_0x2bd3a6){return function(_0x1ab9c4){if(!_0x1ab9c4){_0x444ee1[_0x6605('0x38')](0x194);}return _0x1ab9c4;};}function handleError(_0x39b64f,_0x5ae452){_0x5ae452=_0x5ae452||0x1f4;return function(_0x12a848){logger['error'](_0x12a848['stack']);if(_0x12a848[_0x6605('0x39')]){delete _0x12a848[_0x6605('0x39')];}_0x39b64f[_0x6605('0x2c')](_0x5ae452)[_0x6605('0x3a')](_0x12a848);};}exports[_0x6605('0x3b')]=function(_0x12d0ed,_0x2f4920){var _0x2a7130={'include':[{'model':db[_0x6605('0x3c')],'as':_0x6605('0x3d')}]},_0x1d0bbe={},_0x9ed7c6={'count':0x0,'rows':[]};var _0x500334=_[_0x6605('0x3e')](db[_0x6605('0x3f')][_0x6605('0x40')],function(_0x1f8ed7){return{'name':_0x1f8ed7[_0x6605('0x41')],'type':_0x1f8ed7[_0x6605('0x42')][_0x6605('0x43')]};});_0x1d0bbe['model']=_[_0x6605('0x3e')](_0x500334,_0x6605('0x39'));_0x1d0bbe[_0x6605('0x44')]=_['keys'](_0x12d0ed[_0x6605('0x44')]);_0x1d0bbe[_0x6605('0x45')]=_[_0x6605('0x46')](_0x1d0bbe[_0x6605('0x47')],_0x1d0bbe[_0x6605('0x44')]);_0x2a7130[_0x6605('0x48')]=_['intersection'](_0x1d0bbe[_0x6605('0x47')],qs[_0x6605('0x49')](_0x12d0ed[_0x6605('0x44')][_0x6605('0x49')]));_0x2a7130['attributes']=_0x2a7130[_0x6605('0x48')][_0x6605('0x4a')]?_0x2a7130[_0x6605('0x48')]:_0x1d0bbe['model'];if(!_0x12d0ed[_0x6605('0x44')][_0x6605('0x4b')](_0x6605('0x4c'))){_0x2a7130[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x12d0ed['query'][_0x6605('0x2f')]);_0x2a7130[_0x6605('0x2d')]=qs['offset'](_0x12d0ed[_0x6605('0x44')]['offset']);}_0x2a7130[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x12d0ed['query']['sort']);_0x2a7130[_0x6605('0x4f')]=qs[_0x6605('0x45')](_['pick'](_0x12d0ed[_0x6605('0x44')],_0x1d0bbe[_0x6605('0x45')]),_0x500334);if(_0x12d0ed['query']['filter']){_0x2a7130['where']=_[_0x6605('0x50')](_0x2a7130[_0x6605('0x4f')],{'$or':_['map'](_0x500334,function(_0x16c04c){if(_0x16c04c[_0x6605('0x42')]!=='VIRTUAL'){var _0x33cf46={};_0x33cf46[_0x16c04c[_0x6605('0x39')]]={'$like':'%'+_0x12d0ed[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x33cf46;}})});}_0x2a7130=_[_0x6605('0x50')]({},_0x2a7130,_0x12d0ed[_0x6605('0x52')]);var _0x5498f5={'where':_0x2a7130[_0x6605('0x4f')]};return db[_0x6605('0x3f')][_0x6605('0x30')](_0x5498f5)[_0x6605('0x23')](function(_0x452bee){_0x9ed7c6[_0x6605('0x30')]=_0x452bee;if(_0x12d0ed[_0x6605('0x44')][_0x6605('0x53')]){_0x2a7130[_0x6605('0x54')]=[{'all':!![]}];}return db[_0x6605('0x3f')][_0x6605('0x55')](_0x2a7130);})[_0x6605('0x23')](function(_0x3872a5){_0x9ed7c6['rows']=_0x3872a5;return _0x9ed7c6;})[_0x6605('0x23')](respondWithFilteredResult(_0x2f4920,_0x2a7130))['catch'](handleError(_0x2f4920,null));};exports[_0x6605('0x56')]=function(_0xdbe4b2,_0x2e3b69){var _0xe15d42={'raw':![],'where':{'id':_0xdbe4b2[_0x6605('0x57')]['id']},'include':[{'model':db[_0x6605('0x3c')],'as':_0x6605('0x3d')}]},_0x4178ee={};_0x4178ee[_0x6605('0x47')]=_[_0x6605('0x58')](db[_0x6605('0x3f')][_0x6605('0x40')]);_0x4178ee['query']=_[_0x6605('0x58')](_0xdbe4b2['query']);_0x4178ee[_0x6605('0x45')]=_[_0x6605('0x46')](_0x4178ee[_0x6605('0x47')],_0x4178ee[_0x6605('0x44')]);_0xe15d42[_0x6605('0x48')]=_[_0x6605('0x46')](_0x4178ee[_0x6605('0x47')],qs['fields'](_0xdbe4b2['query'][_0x6605('0x49')]));_0xe15d42[_0x6605('0x48')]=_0xe15d42[_0x6605('0x48')][_0x6605('0x4a')]?_0xe15d42[_0x6605('0x48')]:_0x4178ee['model'];if(_0xdbe4b2[_0x6605('0x44')][_0x6605('0x53')]){_0xe15d42[_0x6605('0x54')]=[{'all':!![]}];}_0xe15d42=_['merge']({},_0xe15d42,_0xdbe4b2[_0x6605('0x52')]);return db[_0x6605('0x3f')]['find'](_0xe15d42)[_0x6605('0x23')](handleEntityNotFound(_0x2e3b69,null))['then'](respondWithResult(_0x2e3b69,null))['catch'](handleError(_0x2e3b69,null));};exports[_0x6605('0x59')]=function(_0x4e9a0f,_0x25bdd1){return db[_0x6605('0x3f')][_0x6605('0x59')](_0x4e9a0f['body'],{})[_0x6605('0x23')](function(_0x3ce031){var _0x532885=_0x4e9a0f['user'][_0x6605('0x34')]({'plain':!![]});if(!_0x532885)throw new Error(_0x6605('0x5a'));if(_0x532885[_0x6605('0x5b')]===_0x6605('0x5c')){var _0x4a5f82=_0x3ce031['get']({'plain':!![]});var _0xe3b783='SmsAccounts';return db[_0x6605('0x5d')][_0x6605('0x5e')]({'where':{'name':_0xe3b783,'userProfileId':_0x532885['userProfileId']},'raw':!![]})[_0x6605('0x23')](function(_0x464d32){if(_0x464d32&&_0x464d32[_0x6605('0x5f')]===0x0){return db[_0x6605('0x35')][_0x6605('0x59')]({'name':_0x4a5f82[_0x6605('0x39')],'resourceId':_0x4a5f82['id'],'type':_0x464d32[_0x6605('0x39')],'sectionId':_0x464d32['id']},{})[_0x6605('0x23')](function(){return _0x3ce031;});}else{return _0x3ce031;}})[_0x6605('0x60')](function(_0x1f9a46){logger[_0x6605('0x28')](_0x6605('0x61'),_0x1f9a46);throw _0x1f9a46;});}return _0x3ce031;})[_0x6605('0x23')](respondWithResult(_0x25bdd1,0xc9))['catch'](handleError(_0x25bdd1,null));};exports[_0x6605('0x62')]=function(_0x19a62f,_0xb818ef){if(_0x19a62f[_0x6605('0x63')]['id']){delete _0x19a62f['body']['id'];}return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x19a62f['params']['id']},'include':[{'model':db[_0x6605('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xb818ef,null))['then'](saveUpdates(_0x19a62f['body'],null))[_0x6605('0x23')](respondWithResult(_0xb818ef,null))[_0x6605('0x60')](handleError(_0xb818ef,null));};exports[_0x6605('0x36')]=function(_0x44b9ac,_0x4d4d90){return db['SmsAccount'][_0x6605('0x5e')]({'where':{'id':_0x44b9ac[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4d4d90,null))[_0x6605('0x23')](removeEntity(_0x4d4d90,null))[_0x6605('0x60')](handleError(_0x4d4d90,null));};exports[_0x6605('0x64')]=function(_0x385a1a,_0x1089a2){return db[_0x6605('0x3f')]['describe']()['then'](respondWithResult(_0x1089a2,null))['catch'](handleError(_0x1089a2,null));};exports[_0x6605('0x65')]=function(_0x51b506,_0x36a45e,_0x45c532){if(_0x51b506['body']['id']){delete _0x51b506[_0x6605('0x63')]['id'];}return db['SmsAccount'][_0x6605('0x5e')]({'where':{'id':_0x51b506[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x36a45e,null))[_0x6605('0x23')](function(_0x465b47){if(_0x465b47){_0x51b506[_0x6605('0x63')][_0x6605('0x66')]=_0x465b47['id'];return db[_0x6605('0x67')][_0x6605('0x59')](_0x51b506[_0x6605('0x63')]);}})[_0x6605('0x23')](respondWithResult(_0x36a45e,null))['catch'](handleError(_0x36a45e,null));};exports[_0x6605('0x68')]=function(_0x368bc5,_0x52dc7d,_0x447580){var _0x54d92b={'raw':![],'where':{}};var _0x13f69b={};var _0x470f7d={'count':0x0,'rows':[]};return db[_0x6605('0x3f')][_0x6605('0x69')]({'where':{'id':_0x368bc5[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x52dc7d,null))['then'](function(_0x2d2f6e){if(_0x2d2f6e){_0x13f69b[_0x6605('0x47')]=_['keys'](db[_0x6605('0x67')][_0x6605('0x40')]);_0x13f69b[_0x6605('0x44')]=_[_0x6605('0x58')](_0x368bc5[_0x6605('0x44')]);_0x13f69b['filters']=_[_0x6605('0x46')](_0x13f69b['model'],_0x13f69b[_0x6605('0x44')]);_0x54d92b[_0x6605('0x48')]=_[_0x6605('0x46')](_0x13f69b['model'],qs['fields'](_0x368bc5['query'][_0x6605('0x49')]));_0x54d92b[_0x6605('0x48')]=_0x54d92b[_0x6605('0x48')][_0x6605('0x4a')]?_0x54d92b[_0x6605('0x48')]:_0x13f69b[_0x6605('0x47')];if(!_0x368bc5['query'][_0x6605('0x4b')](_0x6605('0x4c'))){_0x54d92b[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x368bc5[_0x6605('0x44')][_0x6605('0x2f')]);_0x54d92b[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x368bc5[_0x6605('0x44')][_0x6605('0x2d')]);}_0x54d92b[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x368bc5[_0x6605('0x44')][_0x6605('0x4e')]);_0x54d92b[_0x6605('0x4f')]=qs['filters'](_['pick'](_0x368bc5[_0x6605('0x44')],_0x13f69b[_0x6605('0x45')]));_0x54d92b[_0x6605('0x4f')][_0x6605('0x66')]=_0x2d2f6e['id'];if(_0x368bc5[_0x6605('0x44')][_0x6605('0x51')]){_0x54d92b[_0x6605('0x4f')]=_[_0x6605('0x50')](_0x54d92b[_0x6605('0x4f')],{'$or':_['map'](_0x54d92b[_0x6605('0x48')],function(_0xfc6ab3){var _0x46cac0={};_0x46cac0[_0xfc6ab3]={'$like':'%'+_0x368bc5[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x46cac0;})});}_0x54d92b=_[_0x6605('0x50')]({},_0x54d92b,_0x368bc5[_0x6605('0x52')]);return db[_0x6605('0x67')][_0x6605('0x30')]({'where':_0x54d92b[_0x6605('0x4f')]})[_0x6605('0x23')](function(_0x143bc0){_0x470f7d[_0x6605('0x30')]=_0x143bc0;if(_0x368bc5[_0x6605('0x44')]['includeAll']){_0x54d92b['include']=[{'all':!![]}];}return db[_0x6605('0x67')][_0x6605('0x55')](_0x54d92b);})['then'](function(_0x2928dc){_0x470f7d[_0x6605('0x6a')]=_0x2928dc;return _0x470f7d;});}})[_0x6605('0x23')](respondWithFilteredResult(_0x52dc7d,_0x54d92b))[_0x6605('0x60')](handleError(_0x52dc7d,null));};exports[_0x6605('0x6b')]=function(_0x47b3b8,_0x343c24,_0x5fef33){return db['SmsAccount'][_0x6605('0x5e')]({'where':{'id':_0x47b3b8[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x343c24,null))[_0x6605('0x23')](function(_0x3563aa){if(_0x3563aa){return _0x3563aa['removeDispositions'](_0x47b3b8['query'][_0x6605('0x6c')]);}})[_0x6605('0x23')](respondWithStatusCode(_0x343c24,null))['catch'](handleError(_0x343c24,null));};exports[_0x6605('0x6d')]=function(_0x324588,_0x57af2d,_0x38dbda){if(_0x324588[_0x6605('0x63')]['id']){delete _0x324588['body']['id'];}return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x324588[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x57af2d,null))['then'](function(_0x3f1c26){if(_0x3f1c26){_0x324588[_0x6605('0x63')][_0x6605('0x66')]=_0x3f1c26['id'];return db[_0x6605('0x6e')][_0x6605('0x59')](_0x324588[_0x6605('0x63')]);}})[_0x6605('0x23')](respondWithResult(_0x57af2d,null))[_0x6605('0x60')](handleError(_0x57af2d,null));};exports[_0x6605('0x6f')]=function(_0x41638c,_0x4941f1,_0x4ad319){var _0x1ed53c={'raw':![],'where':{}};var _0x372669={};var _0x1a661c={'count':0x0,'rows':[]};return db[_0x6605('0x3f')][_0x6605('0x69')]({'where':{'id':_0x41638c[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4941f1,null))[_0x6605('0x23')](function(_0x1e8074){if(_0x1e8074){_0x372669[_0x6605('0x47')]=_[_0x6605('0x58')](db[_0x6605('0x6e')][_0x6605('0x40')]);_0x372669[_0x6605('0x44')]=_[_0x6605('0x58')](_0x41638c['query']);_0x372669[_0x6605('0x45')]=_['intersection'](_0x372669[_0x6605('0x47')],_0x372669[_0x6605('0x44')]);_0x1ed53c[_0x6605('0x48')]=_[_0x6605('0x46')](_0x372669['model'],qs[_0x6605('0x49')](_0x41638c['query'][_0x6605('0x49')]));_0x1ed53c[_0x6605('0x48')]=_0x1ed53c[_0x6605('0x48')][_0x6605('0x4a')]?_0x1ed53c[_0x6605('0x48')]:_0x372669['model'];if(!_0x41638c['query'][_0x6605('0x4b')](_0x6605('0x4c'))){_0x1ed53c[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x41638c['query'][_0x6605('0x2f')]);_0x1ed53c['offset']=qs[_0x6605('0x2d')](_0x41638c[_0x6605('0x44')]['offset']);}_0x1ed53c[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x41638c[_0x6605('0x44')][_0x6605('0x4e')]);_0x1ed53c[_0x6605('0x4f')]=qs['filters'](_[_0x6605('0x70')](_0x41638c[_0x6605('0x44')],_0x372669['filters']));_0x1ed53c[_0x6605('0x4f')]['SmsAccountId']=_0x1e8074['id'];if(_0x41638c[_0x6605('0x44')]['filter']){_0x1ed53c[_0x6605('0x4f')]=_[_0x6605('0x50')](_0x1ed53c[_0x6605('0x4f')],{'$or':_['map'](_0x1ed53c[_0x6605('0x48')],function(_0x547638){var _0x53332f={};_0x53332f[_0x547638]={'$like':'%'+_0x41638c[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x53332f;})});}_0x1ed53c=_[_0x6605('0x50')]({},_0x1ed53c,_0x41638c['options']);return db[_0x6605('0x6e')][_0x6605('0x30')]({'where':_0x1ed53c[_0x6605('0x4f')]})[_0x6605('0x23')](function(_0x477d7d){_0x1a661c[_0x6605('0x30')]=_0x477d7d;if(_0x41638c[_0x6605('0x44')][_0x6605('0x53')]){_0x1ed53c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x6605('0x55')](_0x1ed53c);})['then'](function(_0x742adc){_0x1a661c[_0x6605('0x6a')]=_0x742adc;return _0x1a661c;});}})[_0x6605('0x23')](respondWithFilteredResult(_0x4941f1,_0x1ed53c))[_0x6605('0x60')](handleError(_0x4941f1,null));};exports[_0x6605('0x71')]=function(_0x30215b,_0x45ce71,_0x16a943){return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x30215b['params']['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x45ce71,null))[_0x6605('0x23')](function(_0x46757a){if(_0x46757a){return _0x46757a[_0x6605('0x71')](_0x30215b['query']['ids']);}})['then'](respondWithStatusCode(_0x45ce71,null))[_0x6605('0x60')](handleError(_0x45ce71,null));};exports['notify']=function(_0x2e0875,_0xdbfe90,_0x2a1d7c){var _0x1ea851={'channel':_0x6605('0x72')};var _0x573b7e=[];var _0x393159=[];var _0x492d29={};return db[_0x6605('0x3f')]['find']({'where':{'id':_0x2e0875[_0x6605('0x57')]['id']},'include':[{'model':db[_0x6605('0x73')],'as':'Applications'}]})['then'](handleEntityNotFound(_0xdbfe90,null))[_0x6605('0x23')](function(_0x2e11c9){_0x1ea851[_0x6605('0x74')]=_0x2e11c9;_0x1ea851['applications']=_[_0x6605('0x75')](_0x2e11c9[_0x6605('0x76')],['priority'],[_0x6605('0x77')]);if(_0x1ea851[_0x6605('0x74')][_0x6605('0x76')]){delete _0x1ea851['account']['Applications'];}return db[_0x6605('0x78')]['describe']();})[_0x6605('0x23')](function(_0x2195de){if(!_0x2195de){throw new db[(_0x6605('0x79'))][(_0x6605('0x7a'))](_0x6605('0x7b'));}_0x573b7e=_[_0x6605('0x7c')](_[_0x6605('0x58')](_0x2195de),[_0x6605('0x7d'),_0x6605('0x7e')]);_0x393159=_[_0x6605('0x7c')](_['keys'](_0x2195de),[_0x6605('0x7d'),'updatedAt','CompanyId',_0x6605('0x7f')]);_0x1ea851[_0x6605('0x63')]={'mapKey':_0x6605('0x80')};if(_0x1ea851['account'][_0x6605('0x42')]){switch(_0x1ea851[_0x6605('0x74')]['type']){case _0x6605('0x81'):_0x1ea851[_0x6605('0x63')]['from']=_0x2e0875[_0x6605('0x63')][_0x6605('0x82')];_0x1ea851['body']['body']=_0x2e0875[_0x6605('0x63')][_0x6605('0x83')];_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')]['MessageSid'];break;case'skebby':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]='+'+_0x2e0875[_0x6605('0x63')][_0x6605('0x86')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x87')];break;case _0x6605('0x88'):_0x1ea851['body'][_0x6605('0x85')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x85')];_0x1ea851[_0x6605('0x63')]['body']=_0x2e0875['body'][_0x6605('0x2a')];break;case _0x6605('0x89'):_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]=_0x2e0875['body']['from'];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875['body'][_0x6605('0x63')];_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875['body']['message_id'];break;case _0x6605('0x8a'):_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x82')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')]['Text'];_0x1ea851[_0x6605('0x63')]['messageId']=_0x2e0875[_0x6605('0x63')]['MessageUUID'];break;case _0x6605('0x8b'):_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]='+'+_0x2e0875[_0x6605('0x63')][_0x6605('0x8c')][0x0][_0x6605('0x85')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x8c')][0x0][_0x6605('0x87')];_0x1ea851['body']['messageId']=_0x2e0875[_0x6605('0x63')][_0x6605('0x8c')][0x0][_0x6605('0x84')];break;case'csc':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x8d')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')]['segmentedMessage'][_0x6605('0x2a')];break;case _0x6605('0x8e'):_0x1ea851['body'][_0x6605('0x85')]=_0x2e0875['body']['fromNumber'];_0x1ea851['body'][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x87')];_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x8f')];break;case'bandwidth':_0x1ea851[_0x6605('0x63')][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')][0x0][_0x6605('0x2a')]['id'];_0x1ea851[_0x6605('0x63')]['from']=_0x2e0875['body'][0x0][_0x6605('0x2a')][_0x6605('0x85')];_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]=_0x2e0875[_0x6605('0x63')][0x0]['message'][_0x6605('0x87')];break;case _0x6605('0x90'):_0x1ea851[_0x6605('0x63')]['from']=_0x2e0875[_0x6605('0x63')][_0x6605('0x85')];_0x1ea851['body']['body']=_0x2e0875[_0x6605('0x63')]['message'];_0x1ea851['body'][_0x6605('0x84')]=_0x2e0875[_0x6605('0x63')][_0x6605('0x91')];break;}}if(_0x1ea851[_0x6605('0x63')]['id']){delete _0x1ea851[_0x6605('0x63')]['id'];}if(_[_0x6605('0x92')](_0x1ea851[_0x6605('0x63')]['from'])){throw new db[(_0x6605('0x79'))]['ValidationError'](_0x6605('0x93'));}if(_[_0x6605('0x92')](_0x1ea851[_0x6605('0x63')][_0x6605('0x63')])||_0x1ea851[_0x6605('0x63')][_0x6605('0x63')]===''){throw new db[(_0x6605('0x79'))]['ValidationError'](_0x6605('0x94'));}if(_['isNil'](_0x1ea851['body'][_0x6605('0x95')])){throw new db[(_0x6605('0x79'))][(_0x6605('0x7a'))](_0x6605('0x96')+_0x393159);}if(!_[_0x6605('0x97')](_0x393159,_0x1ea851[_0x6605('0x63')][_0x6605('0x95')])){throw new db[(_0x6605('0x79'))][(_0x6605('0x7a'))](_0x6605('0x98')+_0x393159);}_0x492d29[_0x1ea851[_0x6605('0x63')][_0x6605('0x95')]]=_0x1ea851['body'][_0x6605('0x85')];return db[_0x6605('0x99')][_0x6605('0x5e')]({'where':{'id':_0x1ea851[_0x6605('0x74')][_0x6605('0x7f')]},'include':[{'model':db[_0x6605('0x78')],'as':'Contacts','where':_0x492d29,'limit':0x1,'order':[[_0x6605('0x7e'),_0x6605('0x9a')]]}]});})[_0x6605('0x23')](handleEntityNotFound(_0xdbfe90,null))[_0x6605('0x23')](function(_0x214530){if(_0x214530){_0x1ea851[_0x6605('0x9b')]=_[_0x6605('0x9c')](_0x214530,[_0x6605('0x9d')]);if(_0x214530['Contacts'][_0x6605('0x4a')]){return _0x214530[_0x6605('0x9d')][0x0];}var _0x4a0366=_[_0x6605('0x1a')](_0x1ea851[_0x6605('0x63')],{'firstName':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')],'ListId':_0x214530['id']});_0x4a0366[_0x1ea851[_0x6605('0x63')]['mapKey']]=_0x1ea851['body'][_0x6605('0x85')];return db[_0x6605('0x78')][_0x6605('0x59')](_0x4a0366,{'fields':_0x573b7e,'raw':!![]});}})[_0x6605('0x23')](handleEntityNotFound(_0xdbfe90,null))[_0x6605('0x23')](function(_0x2b6d90){if(_0x2b6d90){_0x1ea851['contact']=_0x2b6d90;var _0x299cb7={'ContactId':_0x2b6d90['id'],'phone':_0x1ea851[_0x6605('0x63')][_0x6605('0x85')],'SmsAccountId':_0x2e0875[_0x6605('0x57')]['id']};var _0x2a662b={'ContactId':_0x2b6d90['id'],'SmsAccountId':_0x2e0875[_0x6605('0x57')]['id'],'closed':![]};return db[_0x6605('0x9e')][_0x6605('0x5e')]({'where':_0x2a662b})[_0x6605('0x23')](function(_0x1e1dfd){if(_0x1e1dfd){return[_0x1e1dfd,![]];}return db[_0x6605('0x9e')][_0x6605('0x59')](_0x299cb7)[_0x6605('0x23')](function(_0xf5f993){return[_0xf5f993,!![]];});});}})[_0x6605('0x9f')](function(_0x4e6723,_0x50a29f){_0x1ea851[_0x6605('0xa0')]=_0x4e6723['get']({'plain':!![]});_0x1ea851[_0x6605('0xa0')][_0x6605('0xa1')]=![];if(_0x50a29f){if(_0x1ea851[_0x6605('0x74')][_0x6605('0xa2')]){_0x1ea851['applications'][_0x6605('0xa3')]({'id':0x0,'priority':_0x1ea851[_0x6605('0xa4')][_0x6605('0x4a')]+0x1,'app':_0x6605('0xa5'),'appdata':_0x6605('0xa6'),'interval':_0x6605('0xa7')});}_0x1ea851['interaction'][_0x6605('0xa1')]=!![];}return db[_0x6605('0xa8')][_0x6605('0x59')]({'phone':_0x1ea851['body'][_0x6605('0x85')],'messageId':_0x1ea851[_0x6605('0x63')][_0x6605('0x84')],'body':_0x1ea851[_0x6605('0x63')]['body'],'SmsAccountId':_0x2e0875['params']['id'],'SmsInteractionId':_0x4e6723['id'],'direction':'in','ContactId':_0x4e6723['ContactId'],'AttachmentId':_0x1ea851[_0x6605('0x63')][_0x6605('0xa9')]});})[_0x6605('0x23')](function(_0x50efeb){_0x1ea851[_0x6605('0x2a')]=_0x50efeb;if(_0x1ea851[_0x6605('0xa0')]['UserId']){return db[_0x6605('0xaa')][_0x6605('0x5e')]({'attributes':['id',_0x6605('0x39')],'where':{'id':_0x1ea851['interaction'][_0x6605('0xab')]}})['then'](function(_0x19d619){if(_0x19d619){_0x1ea851['applications'][_0x6605('0xac')]({'id':0x0,'priority':0x0,'app':_0x6605('0xad'),'appdata':_0x19d619['name']+','+(_0x1ea851['account']['waitForTheAssignedAgent']||0xa),'interval':_0x6605('0xa7')});}return respondWithRpcPromise(_0x6605('0xae'),'startRouting',_0x1ea851);});}return respondWithRpcPromise(_0x6605('0xae'),_0x6605('0xaf'),_0x1ea851);})[_0x6605('0x23')](function(_0x1442ca){if(_0x1442ca){var _0x2627d1=0xc8;var _0x19af46='receiveMessage';logger[_0x6605('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x19af46,_0x2627d1,'entity\x20found');logger[_0x6605('0xb0')](_0x6605('0xb1'),_0x19af46,_0x2627d1,'entity\x20found',JSON[_0x6605('0x27')](_0x1442ca));if(_0x1ea851[_0x6605('0x74')][_0x6605('0x42')]===_0x6605('0x81')){return _0xdbfe90[_0x6605('0x2c')](_0x2627d1)[_0x6605('0x31')](_0x6605('0xb2'),'text/xml')[_0x6605('0x3a')](_0x6605('0xb3'));}else{return _0xdbfe90['status'](_0x2627d1)[_0x6605('0xb4')](_0x1442ca);}}})['catch'](handleError(_0xdbfe90,null));};exports['addApplications']=function(_0x351427,_0x1fd492,_0x45a2a9){return db[_0x6605('0x3f')][_0x6605('0x69')]({'where':{'id':_0x351427[_0x6605('0x57')]['id']}})['then'](handleEntityNotFound(_0x1fd492,null))[_0x6605('0x23')](function(_0x249d94){if(_0x249d94){return db[_0x6605('0xb5')]['transaction'](function(_0x5bfc18){return db[_0x6605('0x73')][_0x6605('0x36')]({'where':{'SmsAccountId':_0x351427['params']['id']},'transaction':_0x5bfc18})[_0x6605('0x23')](function(_0xf69fbb){var _0x6a9ada=_[_0x6605('0x3e')](_0x351427['body'],function(_0x494350){_0x494350[_0x6605('0x66')]=_0x351427[_0x6605('0x57')]['id'];return _0x494350;});return db[_0x6605('0x73')]['bulkCreate'](_0x6a9ada,{'transaction':_0x5bfc18});});})[_0x6605('0x23')](function(){return db[_0x6605('0x73')][_0x6605('0xb6')]({'where':{'SmsAccountId':_0x351427[_0x6605('0x57')]['id']},'order':_0x6605('0xb7')});});}})[_0x6605('0x23')](respondWithResult(_0x1fd492,null))[_0x6605('0x60')](handleError(_0x1fd492,null));};exports['getApplications']=function(_0x393e94,_0x443786,_0x46dd02){var _0xbde371={};var _0x460908={};var _0x24cd67;var _0x18605c;return db[_0x6605('0x3f')]['findOne']({'where':{'id':_0x393e94['params']['id']}})['then'](handleEntityNotFound(_0x443786,null))[_0x6605('0x23')](function(_0x6db979){if(_0x6db979){_0x24cd67=_0x6db979;_0x460908[_0x6605('0x47')]=_['keys'](db[_0x6605('0x73')][_0x6605('0x40')]);_0x460908[_0x6605('0x44')]=_[_0x6605('0x58')](_0x393e94['query']);_0x460908[_0x6605('0x45')]=_[_0x6605('0x46')](_0x460908[_0x6605('0x47')],_0x460908['query']);_0xbde371['attributes']=_[_0x6605('0x46')](_0x460908[_0x6605('0x47')],qs[_0x6605('0x49')](_0x393e94[_0x6605('0x44')][_0x6605('0x49')]));_0xbde371[_0x6605('0x48')]=_0xbde371[_0x6605('0x48')][_0x6605('0x4a')]?_0xbde371['attributes']:_0x460908[_0x6605('0x47')];_0xbde371[_0x6605('0x4d')]=qs['sort'](_0x393e94[_0x6605('0x44')][_0x6605('0x4e')]);_0xbde371[_0x6605('0x4f')]=qs[_0x6605('0x45')](_[_0x6605('0x70')](_0x393e94[_0x6605('0x44')],_0x460908[_0x6605('0x45')]));if(_0x393e94[_0x6605('0x44')][_0x6605('0x51')]){_0xbde371[_0x6605('0x4f')]=_['merge'](_0xbde371[_0x6605('0x4f')],{'$or':_[_0x6605('0x3e')](_0xbde371[_0x6605('0x48')],function(_0x5df49f){var _0x14500c={};_0x14500c[_0x5df49f]={'$like':'%'+_0x393e94['query'][_0x6605('0x51')]+'%'};return _0x14500c;})});}_0xbde371=_[_0x6605('0x50')]({},_0xbde371,_0x393e94[_0x6605('0x52')]);return _0x24cd67['getApplications'](_0xbde371);}})['then'](function(_0x2f7bfd){if(_0x2f7bfd){_0x18605c=_0x2f7bfd['length'];if(!_0x393e94[_0x6605('0x44')][_0x6605('0x4b')](_0x6605('0x4c'))){_0xbde371[_0x6605('0x2f')]=qs['limit'](_0x393e94[_0x6605('0x44')][_0x6605('0x2f')]);_0xbde371[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x393e94[_0x6605('0x44')][_0x6605('0x2d')]);}return _0x24cd67['getApplications'](_0xbde371);}})['then'](function(_0x22422e){if(_0x22422e){return _0x22422e?{'count':_0x18605c,'rows':_0x22422e}:null;}})[_0x6605('0x23')](respondWithResult(_0x443786,null))[_0x6605('0x60')](handleError(_0x443786,null));};exports[_0x6605('0xb8')]=function(_0x4b786b,_0x32d0d7,_0x354701){var _0x2bd6c9={'raw':![],'where':{}};var _0x56d1a2={};var _0x2c6f49={'count':0x0,'rows':[]};return db[_0x6605('0x3f')]['findOne']({'where':{'id':_0x4b786b[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x32d0d7,null))['then'](function(_0xdd06f3){if(_0xdd06f3){_0x56d1a2[_0x6605('0x47')]=_[_0x6605('0x58')](db['SmsInteraction'][_0x6605('0x40')]);_0x56d1a2[_0x6605('0x44')]=_[_0x6605('0x58')](_0x4b786b[_0x6605('0x44')]);_0x56d1a2[_0x6605('0x45')]=_[_0x6605('0x46')](_0x56d1a2[_0x6605('0x47')],_0x56d1a2[_0x6605('0x44')]);_0x2bd6c9['attributes']=_[_0x6605('0x46')](_0x56d1a2[_0x6605('0x47')],qs[_0x6605('0x49')](_0x4b786b[_0x6605('0x44')]['fields']));_0x2bd6c9[_0x6605('0x48')]=_0x2bd6c9[_0x6605('0x48')][_0x6605('0x4a')]?_0x2bd6c9['attributes']:_0x56d1a2[_0x6605('0x47')];if(!_0x4b786b[_0x6605('0x44')][_0x6605('0x4b')](_0x6605('0x4c'))){_0x2bd6c9['limit']=qs[_0x6605('0x2f')](_0x4b786b[_0x6605('0x44')][_0x6605('0x2f')]);_0x2bd6c9[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x4b786b[_0x6605('0x44')]['offset']);}_0x2bd6c9['order']=qs[_0x6605('0x4e')](_0x4b786b[_0x6605('0x44')]['sort']);_0x2bd6c9['where']=qs[_0x6605('0x45')](_[_0x6605('0x70')](_0x4b786b[_0x6605('0x44')],_0x56d1a2[_0x6605('0x45')]));_0x2bd6c9[_0x6605('0x4f')][_0x6605('0x66')]=_0xdd06f3['id'];if(_0x4b786b['query'][_0x6605('0x51')]){_0x2bd6c9[_0x6605('0x4f')]=_[_0x6605('0x50')](_0x2bd6c9[_0x6605('0x4f')],{'$or':_[_0x6605('0x3e')](_0x2bd6c9[_0x6605('0x48')],function(_0x2bc76c){var _0x29342f={};_0x29342f[_0x2bc76c]={'$like':'%'+_0x4b786b[_0x6605('0x44')][_0x6605('0x51')]+'%'};return _0x29342f;})});}_0x2bd6c9=_['merge']({},_0x2bd6c9,_0x4b786b[_0x6605('0x52')]);return db[_0x6605('0x9e')][_0x6605('0x30')]({'where':_0x2bd6c9[_0x6605('0x4f')]})[_0x6605('0x23')](function(_0x2748f9){_0x2c6f49[_0x6605('0x30')]=_0x2748f9;if(_0x4b786b[_0x6605('0x44')][_0x6605('0x53')]){_0x2bd6c9[_0x6605('0x54')]=[{'model':db[_0x6605('0x78')],'as':'Contact','required':![]},{'model':db[_0x6605('0xaa')],'as':_0x6605('0xb9'),'attributes':['name',_0x6605('0xba'),_0x6605('0xbb')],'required':![]},{'model':db[_0x6605('0xbc')],'as':_0x6605('0xbd'),'attributes':['id','name','color'],'where':_0x4b786b[_0x6605('0x44')][_0x6605('0xbe')]?{'id':_0x4b786b[_0x6605('0x44')][_0x6605('0xbe')]}:undefined,'required':_0x4b786b['query'][_0x6605('0xbe')]?!![]:![]}];}return db[_0x6605('0x9e')][_0x6605('0x55')](_0x2bd6c9);})[_0x6605('0x23')](function(_0x2a7497){_0x2c6f49[_0x6605('0x6a')]=_0x2a7497;return _0x2c6f49;});}})[_0x6605('0x23')](respondWithFilteredResult(_0x32d0d7,_0x2bd6c9))[_0x6605('0x60')](handleError(_0x32d0d7,null));};exports['send']=function(_0x4a5623,_0x29e90a,_0x1f6fbe){var _0x293ed0,_0x5b4d69,_0x4b76cd;if(_['isNil'](_0x4a5623[_0x6605('0x63')][_0x6605('0x63')])||_0x4a5623[_0x6605('0x63')][_0x6605('0x63')]===''){throw new db[(_0x6605('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6605('0x92')](_0x4a5623[_0x6605('0x63')]['to'])){throw new db[(_0x6605('0x79'))]['ValidationError']('to\x20is\x20mandatory');}_0x293ed0=_0x4a5623['body']['to'];return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x4a5623[_0x6605('0x57')]['id']},'include':[{'model':db[_0x6605('0x99')],'as':_0x6605('0xbf'),'include':[{'model':db[_0x6605('0x78')],'as':_0x6605('0x9d'),'where':{'mobile':_0x293ed0},'limit':0x1,'order':[[_0x6605('0x7e'),'DESC']]}]}]})[_0x6605('0x23')](handleEntityNotFound(_0x29e90a,null))[_0x6605('0x23')](function(_0x151ec1){if(_0x151ec1&&_0x151ec1[_0x6605('0xbf')]){_0x5b4d69=_0x151ec1['get']({'plain':!![]});if(_0x5b4d69[_0x6605('0xbf')]&&_0x5b4d69['List']['Contacts'][_0x6605('0x4a')]){return _0x5b4d69[_0x6605('0xbf')][_0x6605('0x9d')][0x0];}return db[_0x6605('0x78')][_0x6605('0x59')](_[_0x6605('0x1a')](_0x4a5623[_0x6605('0x63')],{'firstName':_0x293ed0,'mobile':_0x293ed0,'phone':_0x293ed0,'ListId':_0x5b4d69[_0x6605('0x7f')]}));}})[_0x6605('0x23')](handleEntityNotFound(_0x29e90a,null))[_0x6605('0x23')](function(_0x5a9d14){if(_0x5a9d14){_0x4b76cd=_0x5a9d14;return db['SmsInteraction'][_0x6605('0x5e')]({'where':{'ContactId':_0x4b76cd['id'],'closed':![],'SmsAccountId':_0x5b4d69['id']}})[_0x6605('0x23')](function(_0x4ac949){if(_0x4ac949){return[_0x4ac949,![]];}return db['SmsInteraction']['create']({'UserId':_0x4a5623[_0x6605('0x5c')]['id'],'ContactId':_0x4b76cd['id'],'SmsAccountId':_0x5b4d69['id'],'phone':_0x293ed0,'firstMsgDirection':_0x6605('0xc0'),'Messages':[_[_0x6605('0x50')](_0x4a5623['body'],{'read':![],'body':_0x4a5623['body']['body'],'phone':_0x293ed0,'SmsAccountId':_0x5b4d69['id'],'UserId':_0x4a5623[_0x6605('0x5c')]['id'],'ContactId':_0x4b76cd['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x6605('0xc1')}]})[_0x6605('0x23')](function(_0x155e74){return[_0x155e74,!![]];});});}})[_0x6605('0x9f')](function(_0x1b552c,_0x3ddef4){if(_0x3ddef4){return _0x1b552c;}return db[_0x6605('0xa8')][_0x6605('0x59')](_[_0x6605('0x50')](_0x4a5623[_0x6605('0x63')],{'read':![],'body':_0x4a5623['body']['body'],'phone':_0x293ed0,'SmsAccountId':_0x5b4d69['id'],'SmsInteractionId':_0x1b552c['id'],'UserId':_0x4a5623['user']['id'],'ContactId':_0x4b76cd['id']}))[_0x6605('0x23')](function(_0xa629a9){_0x1b552c['dataValues'][_0x6605('0xc1')]=[];_0x1b552c[_0x6605('0xc2')][_0x6605('0xc1')][_0x6605('0xa3')](_0xa629a9[_0x6605('0xc2')]);return _0x1b552c;});})['then'](respondWithResult(_0x29e90a,null))[_0x6605('0x60')](handleError(_0x29e90a,null));};exports[_0x6605('0x2c')]=function(_0x13e965,_0x4cec93,_0x198a7d){if(_0x13e965[_0x6605('0x63')]['id']){delete _0x13e965[_0x6605('0x63')]['id'];}var _0xc59394,_0x37f106,_0x53539d;return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x13e965[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4cec93,null))[_0x6605('0x23')](function(_0x3a3c8f){if(_0x3a3c8f){_0x53539d=_0x3a3c8f;logger['debug'](_0x6605('0xc3'),'status',_0x6605('0xc4'),_0x3a3c8f[_0x6605('0x42')],util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));switch(_0x3a3c8f[_0x6605('0x42')]){case _0x6605('0xc6'):if(_0x13e965[_0x6605('0x63')][_0x6605('0xc7')]&&_0x13e965['body'][_0x6605('0x2c')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0x2c')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][_0x6605('0xc7')]}});}break;case _0x6605('0x88'):if(_0x13e965[_0x6605('0x63')][_0x6605('0xc8')]&&_0x13e965[_0x6605('0x63')]['statusInt']){_0x37f106=_0x13e965[_0x6605('0x63')]['statusInt'];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')]['requestid']}});}break;case _0x6605('0x89'):if(_0x13e965['body']['message_id']&&_0x13e965['body'][_0x6605('0xc9')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0xc9')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965['body'][_0x6605('0xca')]}});}break;case _0x6605('0x8b'):var _0x10065d=_0x13e965[_0x6605('0x63')]['results'][0x0];if(_0x10065d[_0x6605('0x84')]&&_0x10065d[_0x6605('0x2c')][_0x6605('0xcb')]==='DELIVERED'){_0x37f106=_0x10065d[_0x6605('0x2c')][_0x6605('0xcb')];return db[_0x6605('0xa8')]['find']({'where':{'messageId':_0x10065d[_0x6605('0x84')]}});}break;case'clickatell':if(_0x13e965['body'][_0x6605('0x84')]&&_0x13e965['body'][_0x6605('0x2c')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0x2c')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][_0x6605('0x84')]}});}break;case'bandwidth':if(_0x13e965['body'][0x0][_0x6605('0x2a')]['id']){_0x37f106=_0x13e965[_0x6605('0x63')][0x0][_0x6605('0x42')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][0x0][_0x6605('0x2a')]['id']}});}break;case _0x6605('0x90'):if(_0x13e965[_0x6605('0x63')][_0x6605('0xcc')]&&_0x13e965['body'][_0x6605('0x2c')]){_0x37f106=_0x13e965[_0x6605('0x63')][_0x6605('0x2c')];return db[_0x6605('0xa8')][_0x6605('0x5e')]({'where':{'messageId':_0x13e965[_0x6605('0x63')][_0x6605('0xcc')]}});}break;}}})[_0x6605('0x23')](handleEntityNotFound(_0x4cec93,null))[_0x6605('0x23')](function(_0x4b4165){if(_0x4b4165){_0xc59394=_0x4b4165;switch(_0x53539d[_0x6605('0x42')]){case _0x6605('0xc6'):if(_0x37f106===_0x6605('0xcd')){return _0xc59394['update']({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xc6'),util['inspect'](_0x13e965['body'],{'showHidden':![],'depth':null}));}break;case _0x6605('0x88'):if(_0x37f106==='1'){return _0xc59394['update']({'read':!![]});}else{logger['error'](_0x6605('0xc3'),'status','skebby',util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x13e965[_0x6605('0x63')]['error_code']&&_0x37f106>=0xc8&&_0x37f106<=0xce){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger[_0x6605('0x28')](_0x6605('0xc3'),'status',_0x6605('0x89'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2c3054=_0x13e965[_0x6605('0x63')][_0x6605('0x8c')][0x0];if(_0x2c3054[_0x6605('0x2c')][_0x6605('0xcb')]===_0x6605('0xcd')){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0x8b'),util[_0x6605('0xc5')](_0x13e965['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x37f106==_0x6605('0xce')||_0x37f106=='RECEIVED_BY_RECIPIENT'){return _0xc59394['update']({'read':!![]});}else{logger[_0x6605('0x28')](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0x8e'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case _0x6605('0xcf'):if(_0x37f106==_0x6605('0xd0')){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger[_0x6605('0x28')](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xcf'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x37f106===_0x6605('0xd1')||_0x37f106===_0x6605('0xd2')){return _0xc59394[_0x6605('0x62')]({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0x90'),util[_0x6605('0xc5')](_0x13e965[_0x6605('0x63')],{'showHidden':![],'depth':null}));}break;}return _0xc59394;}})[_0x6605('0x23')](respondWithResult(_0x4cec93,null))['catch'](handleError(_0x4cec93,null));};exports[_0x6605('0xd3')]=function(_0x1d4f38,_0x5eb6ff,_0x552a89){var _0x287eae,_0xdc61a2,_0x3145a7;return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x1d4f38['params']['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x5eb6ff,null))[_0x6605('0x23')](function(_0x3263ee){if(_0x3263ee){_0x3145a7=_0x3263ee;logger[_0x6605('0xb0')](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xc4'),_0x3263ee[_0x6605('0x42')],util[_0x6605('0xc5')](_0x1d4f38[_0x6605('0x44')],{'showHidden':![],'depth':null}));switch(_0x3263ee['type']){case _0x6605('0xd4'):if(_0x1d4f38[_0x6605('0x44')][_0x6605('0xd5')]&&_0x1d4f38[_0x6605('0x44')][_0x6605('0xd6')]){_0xdc61a2=_0x1d4f38[_0x6605('0x44')]['state'];return db[_0x6605('0xa8')]['find']({'where':{'messageId':_0x1d4f38['query'][_0x6605('0xd5')]}});}break;}}})[_0x6605('0x23')](handleEntityNotFound(_0x5eb6ff,null))[_0x6605('0x23')](function(_0x294586){if(_0x294586){_0x287eae=_0x294586;switch(_0x3145a7[_0x6605('0x42')]){case _0x6605('0xd4'):if(_0xdc61a2==='2'||_0xdc61a2==='6'){return _0x287eae['update']({'read':!![]});}else{logger['error'](_0x6605('0xc3'),_0x6605('0x2c'),_0x6605('0xd4'),util['inspect'](_0x1d4f38['query'],{'showHidden':![],'depth':null}));};break;}return _0x287eae;}})[_0x6605('0x23')](respondWithResult(_0x5eb6ff,null))[_0x6605('0x60')](handleError(_0x5eb6ff,null));};exports['addAgents']=function(_0x50f7a3,_0x558792,_0x1bad1b){return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0x50f7a3[_0x6605('0x57')]['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x558792,null))[_0x6605('0x23')](function(_0x14d09a){if(_0x14d09a){return _0x14d09a[_0x6605('0xd7')](_0x50f7a3[_0x6605('0x63')][_0x6605('0x6c')],_[_0x6605('0x9c')](_0x50f7a3[_0x6605('0x63')],[_0x6605('0x6c'),'id'])||{})['spread'](function(_0x54f01b){for(var _0x553c58=0x0;_0x553c58<_0x50f7a3[_0x6605('0x63')]['ids'][_0x6605('0x4a')];_0x553c58+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x50f7a3[_0x6605('0x63')][_0x6605('0x6c')][_0x553c58]),'SmsAccountId':Number(_0x50f7a3[_0x6605('0x57')]['id'])});}return _0x54f01b;});}})[_0x6605('0x23')](respondWithResult(_0x558792,null))[_0x6605('0x60')](handleError(_0x558792,null));};exports[_0x6605('0xd8')]=function(_0xa995db,_0x4d4095,_0xe9f87a){return db[_0x6605('0x3f')][_0x6605('0x5e')]({'where':{'id':_0xa995db['params']['id']}})[_0x6605('0x23')](handleEntityNotFound(_0x4d4095,null))[_0x6605('0x23')](function(_0x2bc1da){if(_0x2bc1da){return _0x2bc1da[_0x6605('0xd8')](_0xa995db[_0x6605('0x44')][_0x6605('0x6c')])[_0x6605('0x23')](function(){if(_[_0x6605('0xd9')](_0xa995db[_0x6605('0x44')][_0x6605('0x6c')])){for(var _0x2cc617=0x0;_0x2cc617<_0xa995db[_0x6605('0x44')]['ids']['length'];_0x2cc617+=0x1){socket[_0x6605('0xda')](_0x6605('0xdb'),{'UserId':Number(_0xa995db[_0x6605('0x44')]['ids'][_0x2cc617]),'SmsAccountId':Number(_0xa995db[_0x6605('0x57')]['id'])});}}else{socket[_0x6605('0xda')]('userSmsAccount:remove',{'UserId':Number(_0xa995db[_0x6605('0x44')][_0x6605('0x6c')]),'SmsAccountId':Number(_0xa995db['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4d4095,null))[_0x6605('0x60')](handleError(_0x4d4095,null));};exports[_0x6605('0xdc')]=function(_0x4db27c,_0x403968,_0x1fb93c){var _0xf01628={};var _0x20bae8={};var _0x2f44e5;var _0x35bb66;return db[_0x6605('0x3f')]['findOne']({'where':{'id':_0x4db27c[_0x6605('0x57')]['id']}})['then'](handleEntityNotFound(_0x403968,null))[_0x6605('0x23')](function(_0x56cce2){if(_0x56cce2){_0x2f44e5=_0x56cce2;_0x20bae8['model']=_[_0x6605('0x58')](db[_0x6605('0xaa')][_0x6605('0x40')]);_0x20bae8['query']=_[_0x6605('0x58')](_0x4db27c['query']);_0x20bae8[_0x6605('0x45')]=_[_0x6605('0x46')](_0x20bae8[_0x6605('0x47')],_0x20bae8[_0x6605('0x44')]);_0xf01628[_0x6605('0x48')]=_[_0x6605('0x46')](_0x20bae8[_0x6605('0x47')],qs[_0x6605('0x49')](_0x4db27c[_0x6605('0x44')]['fields']));_0xf01628[_0x6605('0x48')]=_0xf01628['attributes'][_0x6605('0x4a')]?_0xf01628[_0x6605('0x48')]:_0x20bae8[_0x6605('0x47')];_0xf01628[_0x6605('0x4d')]=qs[_0x6605('0x4e')](_0x4db27c[_0x6605('0x44')][_0x6605('0x4e')]);_0xf01628[_0x6605('0x4f')]=qs[_0x6605('0x45')](_['pick'](_0x4db27c['query'],_0x20bae8[_0x6605('0x45')]));if(_0x4db27c['query'][_0x6605('0x51')]){_0xf01628[_0x6605('0x4f')]=_['merge'](_0xf01628[_0x6605('0x4f')],{'$or':_[_0x6605('0x3e')](_0xf01628[_0x6605('0x48')],function(_0x3f21be){var _0x517ad4={};_0x517ad4[_0x3f21be]={'$like':'%'+_0x4db27c[_0x6605('0x44')]['filter']+'%'};return _0x517ad4;})});}_0xf01628=_[_0x6605('0x50')]({},_0xf01628,_0x4db27c[_0x6605('0x52')]);return _0x2f44e5[_0x6605('0xdc')](_0xf01628);}})[_0x6605('0x23')](function(_0x495f43){if(_0x495f43){_0x35bb66=_0x495f43[_0x6605('0x4a')];if(!_0x4db27c['query'][_0x6605('0x4b')](_0x6605('0x4c'))){_0xf01628[_0x6605('0x2f')]=qs[_0x6605('0x2f')](_0x4db27c[_0x6605('0x44')]['limit']);_0xf01628[_0x6605('0x2d')]=qs[_0x6605('0x2d')](_0x4db27c[_0x6605('0x44')][_0x6605('0x2d')]);}return _0x2f44e5[_0x6605('0xdc')](_0xf01628);}})[_0x6605('0x23')](function(_0xd77056){if(_0xd77056){return _0xd77056?{'count':_0x35bb66,'rows':_0xd77056}:null;}})[_0x6605('0x23')](respondWithResult(_0x403968,null))[_0x6605('0x60')](handleError(_0x403968,null));}; \ No newline at end of file +var _0xf04f=['error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','intelepeer','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','omit','emit','removeAgents','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','undefined','limit','count','offset','set','apply','reject','then','destroy','get','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','include','findAll','rows','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','SmsAccountId','Disposition','findOne','order','sort','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','SmsApplication','account','applications','Applications','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','MessageSid','sender','text','connectel','clicksend','message_id','From','Text','messageId','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','defaults','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','entity\x20found','Content-Type','text/xml','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','Tag','Tags','color','tag','Sequelize','to\x20is\x20mandatory','List','DESC','ListId','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf04f,0x1c5));var _0xff04=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf04f[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff04('0x0'));var zipdir=require(_0xff04('0x1'));var jsonpatch=require(_0xff04('0x2'));var rp=require('request-promise');var moment=require(_0xff04('0x3'));var BPromise=require(_0xff04('0x4'));var Mustache=require(_0xff04('0x5'));var util=require(_0xff04('0x6'));var path=require(_0xff04('0x7'));var sox=require('sox');var csv=require(_0xff04('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff04('0x9'));var _=require(_0xff04('0xa'));var squel=require('squel');var crypto=require(_0xff04('0xb'));var jsforce=require(_0xff04('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xff04('0x8'));var querystring=require(_0xff04('0xd'));var Papa=require(_0xff04('0xe'));var Redis=require(_0xff04('0xf'));var authService=require(_0xff04('0x10'));var qs=require(_0xff04('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff04('0x12'));var logger=require('../../config/logger')(_0xff04('0x13'));var utils=require(_0xff04('0x14'));var config=require(_0xff04('0x15'));var licenseUtil=require(_0xff04('0x16'));var db=require(_0xff04('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xff04('0x18'),'port':0x18eb});var socket=require(_0xff04('0x19'))(new Redis(config[_0xff04('0x1a')]));require(_0xff04('0x1b'))[_0xff04('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xff04('0x1d')][_0xff04('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3fa9a0,_0x6b25fe,_0xa67395,_0x3aef7e){return new BPromise(function(_0x22eedb,_0x3a8789){var _0x1448c2=_0x3aef7e||client;return _0x1448c2[_0xff04('0x1f')](_0x3fa9a0,_0xa67395)['then'](function(_0x554b8d){logger[_0xff04('0x20')](_0xff04('0x21'),_0x6b25fe,_0xff04('0x22'));logger[_0xff04('0x23')](_0xff04('0x24'),_0x6b25fe,_0xff04('0x22'),JSON[_0xff04('0x25')](_0x554b8d));if(_0x554b8d[_0xff04('0x26')]){if(_0x554b8d[_0xff04('0x26')]['code']===0x1f4){logger[_0xff04('0x26')](_0xff04('0x21'),_0x6b25fe,_0x554b8d[_0xff04('0x26')]['message']);return _0x3a8789(_0x554b8d[_0xff04('0x26')]['message']);}logger[_0xff04('0x26')](_0xff04('0x21'),_0x6b25fe,_0x554b8d[_0xff04('0x26')][_0xff04('0x27')]);return _0x22eedb(_0x554b8d[_0xff04('0x26')][_0xff04('0x27')]);}else{logger[_0xff04('0x20')](_0xff04('0x21'),_0x6b25fe,'request\x20sent');_0x22eedb(_0x554b8d[_0xff04('0x28')]['message']);}})[_0xff04('0x29')](function(_0x2fab59){logger[_0xff04('0x26')]('SmsAccount,\x20%s,\x20%s',_0x6b25fe,_0x2fab59);_0x3a8789(_0x2fab59);});});}function respondWithStatusCode(_0x4efec0,_0x57c0b4){_0x57c0b4=_0x57c0b4||0xcc;return function(_0x4d4bb6){if(_0x4d4bb6){return _0x4efec0['sendStatus'](_0x57c0b4);}return _0x4efec0[_0xff04('0x2a')](_0x57c0b4)[_0xff04('0x2b')]();};}function respondWithResult(_0x49a58c,_0x236218){_0x236218=_0x236218||0xc8;return function(_0x4c93e1){if(_0x4c93e1){return _0x49a58c[_0xff04('0x2a')](_0x236218)[_0xff04('0x2c')](_0x4c93e1);}};}function respondWithFilteredResult(_0x4bf293,_0x3fe5f1){return function(_0x1a01e2){if(_0x1a01e2){var _0x1ca206=typeof _0x3fe5f1['offset']===_0xff04('0x2d')&&typeof _0x3fe5f1[_0xff04('0x2e')]===_0xff04('0x2d');var _0xa74c86=_0x1a01e2[_0xff04('0x2f')];var _0x2b9fd2=_0x1ca206?0x0:_0x3fe5f1[_0xff04('0x30')];var _0x51e9bf=_0x1ca206?_0x1a01e2[_0xff04('0x2f')]:_0x3fe5f1[_0xff04('0x30')]+_0x3fe5f1['limit'];var _0x4c42e1;if(_0x51e9bf>=_0xa74c86){_0x51e9bf=_0xa74c86;_0x4c42e1=0xc8;}else{_0x4c42e1=0xce;}_0x4bf293[_0xff04('0x2a')](_0x4c42e1);return _0x4bf293[_0xff04('0x31')]('Content-Range',_0x2b9fd2+'-'+_0x51e9bf+'/'+_0xa74c86)[_0xff04('0x2c')](_0x1a01e2);}return null;};}function patchUpdates(_0x1ce5e6){return function(_0x2cc3fb){try{jsonpatch[_0xff04('0x32')](_0x2cc3fb,_0x1ce5e6,!![]);}catch(_0x5d744a){return BPromise[_0xff04('0x33')](_0x5d744a);}return _0x2cc3fb['save']();};}function saveUpdates(_0x1db7e3,_0x3e16f5){return function(_0x2432ef){if(_0x2432ef){return _0x2432ef['update'](_0x1db7e3)[_0xff04('0x34')](function(_0x4c9463){return _0x4c9463;});}return null;};}function removeEntity(_0x38d6b5,_0x1e6027){return function(_0x31a345){if(_0x31a345){return _0x31a345[_0xff04('0x35')]()['then'](function(){var _0x1039de=_0x31a345[_0xff04('0x36')]({'plain':!![]});var _0x15cf8b='SmsAccounts';return db['UserProfileResource'][_0xff04('0x35')]({'where':{'type':_0x15cf8b,'resourceId':_0x1039de['id']}})['then'](function(){return _0x31a345;});})['then'](function(){_0x38d6b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50158f,_0x156ff0){return function(_0x40b5fd){if(!_0x40b5fd){_0x50158f[_0xff04('0x37')](0x194);}return _0x40b5fd;};}function handleError(_0x4c7c0c,_0x8e6a3c){_0x8e6a3c=_0x8e6a3c||0x1f4;return function(_0x16ec65){logger[_0xff04('0x26')](_0x16ec65['stack']);if(_0x16ec65[_0xff04('0x38')]){delete _0x16ec65[_0xff04('0x38')];}_0x4c7c0c[_0xff04('0x2a')](_0x8e6a3c)[_0xff04('0x39')](_0x16ec65);};}exports[_0xff04('0x3a')]=function(_0x232920,_0x586643){var _0xf540f1={'include':[{'model':db[_0xff04('0x3b')],'as':_0xff04('0x3c')}]},_0x4e58de={},_0x30fc94={'count':0x0,'rows':[]};var _0x102516=_[_0xff04('0x3d')](db[_0xff04('0x3e')]['rawAttributes'],function(_0x4fc15e){return{'name':_0x4fc15e['fieldName'],'type':_0x4fc15e[_0xff04('0x3f')][_0xff04('0x40')]};});_0x4e58de[_0xff04('0x41')]=_[_0xff04('0x3d')](_0x102516,_0xff04('0x38'));_0x4e58de[_0xff04('0x42')]=_[_0xff04('0x43')](_0x232920['query']);_0x4e58de[_0xff04('0x44')]=_[_0xff04('0x45')](_0x4e58de[_0xff04('0x41')],_0x4e58de['query']);_0xf540f1[_0xff04('0x46')]=_['intersection'](_0x4e58de[_0xff04('0x41')],qs[_0xff04('0x47')](_0x232920[_0xff04('0x42')]['fields']));_0xf540f1[_0xff04('0x46')]=_0xf540f1['attributes'][_0xff04('0x48')]?_0xf540f1['attributes']:_0x4e58de[_0xff04('0x41')];if(!_0x232920[_0xff04('0x42')][_0xff04('0x49')](_0xff04('0x4a'))){_0xf540f1[_0xff04('0x2e')]=qs[_0xff04('0x2e')](_0x232920[_0xff04('0x42')][_0xff04('0x2e')]);_0xf540f1[_0xff04('0x30')]=qs[_0xff04('0x30')](_0x232920[_0xff04('0x42')]['offset']);}_0xf540f1['order']=qs['sort'](_0x232920[_0xff04('0x42')]['sort']);_0xf540f1[_0xff04('0x4b')]=qs[_0xff04('0x44')](_[_0xff04('0x4c')](_0x232920[_0xff04('0x42')],_0x4e58de['filters']),_0x102516);if(_0x232920[_0xff04('0x42')][_0xff04('0x4d')]){_0xf540f1['where']=_[_0xff04('0x4e')](_0xf540f1[_0xff04('0x4b')],{'$or':_['map'](_0x102516,function(_0x827785){if(_0x827785[_0xff04('0x3f')]!=='VIRTUAL'){var _0x4847a8={};_0x4847a8[_0x827785[_0xff04('0x38')]]={'$like':'%'+_0x232920[_0xff04('0x42')][_0xff04('0x4d')]+'%'};return _0x4847a8;}})});}_0xf540f1=_['merge']({},_0xf540f1,_0x232920[_0xff04('0x4f')]);var _0x5e8e48={'where':_0xf540f1[_0xff04('0x4b')]};return db['SmsAccount']['count'](_0x5e8e48)[_0xff04('0x34')](function(_0x255fa5){_0x30fc94[_0xff04('0x2f')]=_0x255fa5;if(_0x232920[_0xff04('0x42')]['includeAll']){_0xf540f1[_0xff04('0x50')]=[{'all':!![]}];}return db[_0xff04('0x3e')][_0xff04('0x51')](_0xf540f1);})['then'](function(_0x5f4d00){_0x30fc94[_0xff04('0x52')]=_0x5f4d00;return _0x30fc94;})[_0xff04('0x34')](respondWithFilteredResult(_0x586643,_0xf540f1))[_0xff04('0x29')](handleError(_0x586643,null));};exports[_0xff04('0x53')]=function(_0x1eb840,_0x22e733){var _0x3ef9c1={'raw':![],'where':{'id':_0x1eb840['params']['id']},'include':[{'model':db[_0xff04('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3a5163={};_0x3a5163[_0xff04('0x41')]=_['keys'](db[_0xff04('0x3e')][_0xff04('0x54')]);_0x3a5163[_0xff04('0x42')]=_[_0xff04('0x43')](_0x1eb840[_0xff04('0x42')]);_0x3a5163['filters']=_[_0xff04('0x45')](_0x3a5163[_0xff04('0x41')],_0x3a5163[_0xff04('0x42')]);_0x3ef9c1[_0xff04('0x46')]=_[_0xff04('0x45')](_0x3a5163[_0xff04('0x41')],qs[_0xff04('0x47')](_0x1eb840[_0xff04('0x42')]['fields']));_0x3ef9c1[_0xff04('0x46')]=_0x3ef9c1[_0xff04('0x46')][_0xff04('0x48')]?_0x3ef9c1['attributes']:_0x3a5163[_0xff04('0x41')];if(_0x1eb840['query'][_0xff04('0x55')]){_0x3ef9c1[_0xff04('0x50')]=[{'all':!![]}];}_0x3ef9c1=_[_0xff04('0x4e')]({},_0x3ef9c1,_0x1eb840[_0xff04('0x4f')]);return db[_0xff04('0x3e')][_0xff04('0x56')](_0x3ef9c1)[_0xff04('0x34')](handleEntityNotFound(_0x22e733,null))['then'](respondWithResult(_0x22e733,null))['catch'](handleError(_0x22e733,null));};exports[_0xff04('0x57')]=function(_0x4ddf35,_0x1a0fd1){return db[_0xff04('0x3e')]['create'](_0x4ddf35[_0xff04('0x58')],{})['then'](function(_0x18197a){var _0x3738d3=_0x4ddf35[_0xff04('0x59')][_0xff04('0x36')]({'plain':!![]});if(!_0x3738d3)throw new Error(_0xff04('0x5a'));if(_0x3738d3['role']==='user'){var _0x39f603=_0x18197a['get']({'plain':!![]});var _0xd8f1b0=_0xff04('0x5b');return db['UserProfileSection'][_0xff04('0x56')]({'where':{'name':_0xd8f1b0,'userProfileId':_0x3738d3[_0xff04('0x5c')]},'raw':!![]})[_0xff04('0x34')](function(_0x33274c){if(_0x33274c&&_0x33274c[_0xff04('0x5d')]===0x0){return db[_0xff04('0x5e')][_0xff04('0x57')]({'name':_0x39f603[_0xff04('0x38')],'resourceId':_0x39f603['id'],'type':_0x33274c['name'],'sectionId':_0x33274c['id']},{})[_0xff04('0x34')](function(){return _0x18197a;});}else{return _0x18197a;}})[_0xff04('0x29')](function(_0x2c9f65){logger[_0xff04('0x26')](_0xff04('0x5f'),_0x2c9f65);throw _0x2c9f65;});}return _0x18197a;})['then'](respondWithResult(_0x1a0fd1,0xc9))[_0xff04('0x29')](handleError(_0x1a0fd1,null));};exports[_0xff04('0x60')]=function(_0x1a0404,_0x271164){if(_0x1a0404[_0xff04('0x58')]['id']){delete _0x1a0404[_0xff04('0x58')]['id'];}return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0x1a0404[_0xff04('0x61')]['id']},'include':[{'model':db[_0xff04('0x3b')],'as':_0xff04('0x3c')}]})[_0xff04('0x34')](handleEntityNotFound(_0x271164,null))[_0xff04('0x34')](saveUpdates(_0x1a0404[_0xff04('0x58')],null))[_0xff04('0x34')](respondWithResult(_0x271164,null))[_0xff04('0x29')](handleError(_0x271164,null));};exports[_0xff04('0x35')]=function(_0x5d2d2b,_0x3da617){return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0x5d2d2b['params']['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x3da617,null))[_0xff04('0x34')](removeEntity(_0x3da617,null))[_0xff04('0x29')](handleError(_0x3da617,null));};exports['describe']=function(_0x249298,_0x27fe1a){return db['SmsAccount'][_0xff04('0x62')]()['then'](respondWithResult(_0x27fe1a,null))[_0xff04('0x29')](handleError(_0x27fe1a,null));};exports['addDisposition']=function(_0x2c4ea4,_0x3c1e6e,_0x58c311){if(_0x2c4ea4[_0xff04('0x58')]['id']){delete _0x2c4ea4[_0xff04('0x58')]['id'];}return db[_0xff04('0x3e')]['find']({'where':{'id':_0x2c4ea4[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x3c1e6e,null))[_0xff04('0x34')](function(_0x440e0e){if(_0x440e0e){_0x2c4ea4[_0xff04('0x58')][_0xff04('0x63')]=_0x440e0e['id'];return db[_0xff04('0x64')]['create'](_0x2c4ea4['body']);}})['then'](respondWithResult(_0x3c1e6e,null))['catch'](handleError(_0x3c1e6e,null));};exports['getDispositions']=function(_0x58733e,_0x5bf41e,_0x4675cb){var _0x387542={'raw':![],'where':{}};var _0x287aba={};var _0x1be6e8={'count':0x0,'rows':[]};return db[_0xff04('0x3e')][_0xff04('0x65')]({'where':{'id':_0x58733e[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x5bf41e,null))[_0xff04('0x34')](function(_0x2aafe5){if(_0x2aafe5){_0x287aba['model']=_[_0xff04('0x43')](db['Disposition'][_0xff04('0x54')]);_0x287aba[_0xff04('0x42')]=_['keys'](_0x58733e[_0xff04('0x42')]);_0x287aba[_0xff04('0x44')]=_['intersection'](_0x287aba[_0xff04('0x41')],_0x287aba[_0xff04('0x42')]);_0x387542[_0xff04('0x46')]=_[_0xff04('0x45')](_0x287aba[_0xff04('0x41')],qs[_0xff04('0x47')](_0x58733e[_0xff04('0x42')][_0xff04('0x47')]));_0x387542['attributes']=_0x387542[_0xff04('0x46')][_0xff04('0x48')]?_0x387542[_0xff04('0x46')]:_0x287aba[_0xff04('0x41')];if(!_0x58733e['query'][_0xff04('0x49')](_0xff04('0x4a'))){_0x387542[_0xff04('0x2e')]=qs[_0xff04('0x2e')](_0x58733e[_0xff04('0x42')][_0xff04('0x2e')]);_0x387542['offset']=qs['offset'](_0x58733e[_0xff04('0x42')]['offset']);}_0x387542[_0xff04('0x66')]=qs['sort'](_0x58733e[_0xff04('0x42')][_0xff04('0x67')]);_0x387542[_0xff04('0x4b')]=qs[_0xff04('0x44')](_[_0xff04('0x4c')](_0x58733e[_0xff04('0x42')],_0x287aba[_0xff04('0x44')]));_0x387542[_0xff04('0x4b')][_0xff04('0x63')]=_0x2aafe5['id'];if(_0x58733e[_0xff04('0x42')][_0xff04('0x4d')]){_0x387542[_0xff04('0x4b')]=_['merge'](_0x387542[_0xff04('0x4b')],{'$or':_['map'](_0x387542['attributes'],function(_0x5705ee){var _0x53b8da={};_0x53b8da[_0x5705ee]={'$like':'%'+_0x58733e[_0xff04('0x42')][_0xff04('0x4d')]+'%'};return _0x53b8da;})});}_0x387542=_[_0xff04('0x4e')]({},_0x387542,_0x58733e['options']);return db['Disposition'][_0xff04('0x2f')]({'where':_0x387542[_0xff04('0x4b')]})[_0xff04('0x34')](function(_0x5355b9){_0x1be6e8[_0xff04('0x2f')]=_0x5355b9;if(_0x58733e[_0xff04('0x42')][_0xff04('0x55')]){_0x387542[_0xff04('0x50')]=[{'all':!![]}];}return db[_0xff04('0x64')]['findAll'](_0x387542);})['then'](function(_0x4436fb){_0x1be6e8[_0xff04('0x52')]=_0x4436fb;return _0x1be6e8;});}})[_0xff04('0x34')](respondWithFilteredResult(_0x5bf41e,_0x387542))[_0xff04('0x29')](handleError(_0x5bf41e,null));};exports[_0xff04('0x68')]=function(_0x1804c0,_0x3da1a6,_0x18f706){return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0x1804c0[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x3da1a6,null))[_0xff04('0x34')](function(_0xb0f495){if(_0xb0f495){return _0xb0f495['removeDispositions'](_0x1804c0[_0xff04('0x42')][_0xff04('0x69')]);}})['then'](respondWithStatusCode(_0x3da1a6,null))[_0xff04('0x29')](handleError(_0x3da1a6,null));};exports[_0xff04('0x6a')]=function(_0x22baec,_0x1bc3b2,_0x6cfdbc){if(_0x22baec[_0xff04('0x58')]['id']){delete _0x22baec['body']['id'];}return db[_0xff04('0x3e')]['find']({'where':{'id':_0x22baec[_0xff04('0x61')]['id']}})['then'](handleEntityNotFound(_0x1bc3b2,null))[_0xff04('0x34')](function(_0x86c150){if(_0x86c150){_0x22baec[_0xff04('0x58')][_0xff04('0x63')]=_0x86c150['id'];return db['CannedAnswer'][_0xff04('0x57')](_0x22baec[_0xff04('0x58')]);}})[_0xff04('0x34')](respondWithResult(_0x1bc3b2,null))[_0xff04('0x29')](handleError(_0x1bc3b2,null));};exports['getAnswers']=function(_0x4a319a,_0x4c5f5a,_0x2a6768){var _0x1c556a={'raw':![],'where':{}};var _0x1b978b={};var _0x2566a6={'count':0x0,'rows':[]};return db[_0xff04('0x3e')][_0xff04('0x65')]({'where':{'id':_0x4a319a[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x4c5f5a,null))[_0xff04('0x34')](function(_0x2fa0a5){if(_0x2fa0a5){_0x1b978b[_0xff04('0x41')]=_['keys'](db[_0xff04('0x6b')][_0xff04('0x54')]);_0x1b978b[_0xff04('0x42')]=_[_0xff04('0x43')](_0x4a319a[_0xff04('0x42')]);_0x1b978b[_0xff04('0x44')]=_['intersection'](_0x1b978b[_0xff04('0x41')],_0x1b978b[_0xff04('0x42')]);_0x1c556a[_0xff04('0x46')]=_['intersection'](_0x1b978b[_0xff04('0x41')],qs[_0xff04('0x47')](_0x4a319a[_0xff04('0x42')][_0xff04('0x47')]));_0x1c556a[_0xff04('0x46')]=_0x1c556a[_0xff04('0x46')][_0xff04('0x48')]?_0x1c556a[_0xff04('0x46')]:_0x1b978b[_0xff04('0x41')];if(!_0x4a319a['query'][_0xff04('0x49')](_0xff04('0x4a'))){_0x1c556a['limit']=qs['limit'](_0x4a319a[_0xff04('0x42')][_0xff04('0x2e')]);_0x1c556a[_0xff04('0x30')]=qs[_0xff04('0x30')](_0x4a319a[_0xff04('0x42')][_0xff04('0x30')]);}_0x1c556a['order']=qs[_0xff04('0x67')](_0x4a319a[_0xff04('0x42')][_0xff04('0x67')]);_0x1c556a[_0xff04('0x4b')]=qs['filters'](_[_0xff04('0x4c')](_0x4a319a['query'],_0x1b978b[_0xff04('0x44')]));_0x1c556a[_0xff04('0x4b')]['SmsAccountId']=_0x2fa0a5['id'];if(_0x4a319a[_0xff04('0x42')][_0xff04('0x4d')]){_0x1c556a[_0xff04('0x4b')]=_['merge'](_0x1c556a['where'],{'$or':_[_0xff04('0x3d')](_0x1c556a['attributes'],function(_0x326ccb){var _0x14fb7b={};_0x14fb7b[_0x326ccb]={'$like':'%'+_0x4a319a['query'][_0xff04('0x4d')]+'%'};return _0x14fb7b;})});}_0x1c556a=_[_0xff04('0x4e')]({},_0x1c556a,_0x4a319a['options']);return db['CannedAnswer'][_0xff04('0x2f')]({'where':_0x1c556a[_0xff04('0x4b')]})[_0xff04('0x34')](function(_0x448403){_0x2566a6[_0xff04('0x2f')]=_0x448403;if(_0x4a319a['query'][_0xff04('0x55')]){_0x1c556a[_0xff04('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0xff04('0x51')](_0x1c556a);})[_0xff04('0x34')](function(_0x3c55c5){_0x2566a6[_0xff04('0x52')]=_0x3c55c5;return _0x2566a6;});}})['then'](respondWithFilteredResult(_0x4c5f5a,_0x1c556a))[_0xff04('0x29')](handleError(_0x4c5f5a,null));};exports[_0xff04('0x6c')]=function(_0x1ad652,_0x40acc0,_0x2bca5e){return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0x1ad652[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x40acc0,null))['then'](function(_0xb9d792){if(_0xb9d792){return _0xb9d792['removeAnswers'](_0x1ad652[_0xff04('0x42')][_0xff04('0x69')]);}})['then'](respondWithStatusCode(_0x40acc0,null))[_0xff04('0x29')](handleError(_0x40acc0,null));};exports[_0xff04('0x6d')]=function(_0x505c72,_0x5011f2,_0x3659d1){var _0x2365c0={'channel':'sms'};var _0x187b67=[];var _0x17b71a=[];var _0x5da1a6={};return db[_0xff04('0x3e')]['find']({'where':{'id':_0x505c72[_0xff04('0x61')]['id']},'include':[{'model':db[_0xff04('0x6e')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x5011f2,null))[_0xff04('0x34')](function(_0x57ef87){_0x2365c0[_0xff04('0x6f')]=_0x57ef87;_0x2365c0[_0xff04('0x70')]=_['orderBy'](_0x57ef87[_0xff04('0x71')],[_0xff04('0x72')],['asc']);if(_0x2365c0[_0xff04('0x6f')][_0xff04('0x71')]){delete _0x2365c0['account'][_0xff04('0x71')];}return db[_0xff04('0x73')]['describe']();})[_0xff04('0x34')](function(_0x53b92a){if(!_0x53b92a){throw new db['Sequelize']['ValidationError'](_0xff04('0x74'));}_0x187b67=_[_0xff04('0x75')](_[_0xff04('0x43')](_0x53b92a),[_0xff04('0x76'),'updatedAt']);_0x17b71a=_[_0xff04('0x75')](_[_0xff04('0x43')](_0x53b92a),[_0xff04('0x76'),_0xff04('0x77'),_0xff04('0x78'),'ListId']);_0x2365c0[_0xff04('0x58')]={'mapKey':_0xff04('0x79')};if(_0x2365c0[_0xff04('0x6f')][_0xff04('0x3f')]){switch(_0x2365c0[_0xff04('0x6f')][_0xff04('0x3f')]){case _0xff04('0x7a'):_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72[_0xff04('0x58')]['From'];_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')][_0xff04('0x7c')];_0x2365c0['body']['messageId']=_0x505c72[_0xff04('0x58')][_0xff04('0x7d')];break;case'skebby':_0x2365c0[_0xff04('0x58')]['from']='+'+_0x505c72[_0xff04('0x58')][_0xff04('0x7e')];_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')][_0xff04('0x7f')];break;case _0xff04('0x80'):_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72[_0xff04('0x58')][_0xff04('0x7b')];_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]=_0x505c72['body'][_0xff04('0x27')];break;case _0xff04('0x81'):_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72[_0xff04('0x58')]['from'];_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')][_0xff04('0x58')];_0x2365c0['body']['messageId']=_0x505c72[_0xff04('0x58')][_0xff04('0x82')];break;case'plivo':_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72['body'][_0xff04('0x83')];_0x2365c0['body']['body']=_0x505c72[_0xff04('0x58')][_0xff04('0x84')];_0x2365c0['body'][_0xff04('0x85')]=_0x505c72[_0xff04('0x58')][_0xff04('0x86')];break;case _0xff04('0x87'):_0x2365c0[_0xff04('0x58')]['from']='+'+_0x505c72['body'][_0xff04('0x88')][0x0][_0xff04('0x7b')];_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]=_0x505c72['body'][_0xff04('0x88')][0x0][_0xff04('0x7f')];_0x2365c0[_0xff04('0x58')][_0xff04('0x85')]=_0x505c72['body'][_0xff04('0x88')][0x0][_0xff04('0x85')];break;case _0xff04('0x89'):_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72[_0xff04('0x58')][_0xff04('0x8a')];_0x2365c0['body'][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')]['segmentedMessage'][_0xff04('0x27')];break;case _0xff04('0x8b'):_0x2365c0[_0xff04('0x58')]['from']=_0x505c72[_0xff04('0x58')][_0xff04('0x8c')];_0x2365c0['body'][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')][_0xff04('0x7f')];_0x2365c0[_0xff04('0x58')][_0xff04('0x85')]=_0x505c72[_0xff04('0x58')][_0xff04('0x8d')];break;case _0xff04('0x8e'):_0x2365c0[_0xff04('0x58')][_0xff04('0x85')]=_0x505c72[_0xff04('0x58')][0x0]['message']['id'];_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72[_0xff04('0x58')][0x0]['message'][_0xff04('0x7b')];_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')][0x0][_0xff04('0x27')][_0xff04('0x7f')];break;case'intelepeer':_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')]=_0x505c72['body'][_0xff04('0x7b')];_0x2365c0['body'][_0xff04('0x58')]=_0x505c72[_0xff04('0x58')][_0xff04('0x27')];_0x2365c0[_0xff04('0x58')][_0xff04('0x85')]=_0x505c72[_0xff04('0x58')][_0xff04('0x8f')];break;}}if(_0x2365c0[_0xff04('0x58')]['id']){delete _0x2365c0[_0xff04('0x58')]['id'];}if(_['isNil'](_0x2365c0[_0xff04('0x58')]['from'])){throw new db['Sequelize'][(_0xff04('0x90'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2365c0[_0xff04('0x58')][_0xff04('0x58')])||_0x2365c0[_0xff04('0x58')][_0xff04('0x58')]===''){throw new db['Sequelize'][(_0xff04('0x90'))](_0xff04('0x91'));}if(_[_0xff04('0x92')](_0x2365c0[_0xff04('0x58')]['mapKey'])){throw new db['Sequelize'][(_0xff04('0x90'))](_0xff04('0x93')+_0x17b71a);}if(!_[_0xff04('0x94')](_0x17b71a,_0x2365c0['body'][_0xff04('0x95')])){throw new db['Sequelize'][(_0xff04('0x90'))](_0xff04('0x96')+_0x17b71a);}_0x5da1a6[_0x2365c0[_0xff04('0x58')][_0xff04('0x95')]]=_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')];return db[_0xff04('0x97')]['find']({'where':{'id':_0x2365c0[_0xff04('0x6f')]['ListId']},'include':[{'model':db[_0xff04('0x73')],'as':'Contacts','where':_0x5da1a6,'limit':0x1,'order':[[_0xff04('0x77'),'DESC']]}]});})['then'](handleEntityNotFound(_0x5011f2,null))['then'](function(_0x13aa71){if(_0x13aa71){_0x2365c0['list']=_['omit'](_0x13aa71,[_0xff04('0x98')]);if(_0x13aa71['Contacts']['length']){return _0x13aa71['Contacts'][0x0];}var _0x3ff619=_[_0xff04('0x99')](_0x2365c0[_0xff04('0x58')],{'firstName':_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')],'ListId':_0x13aa71['id']});_0x3ff619[_0x2365c0[_0xff04('0x58')]['mapKey']]=_0x2365c0[_0xff04('0x58')][_0xff04('0x7b')];return db['CmContact'][_0xff04('0x57')](_0x3ff619,{'fields':_0x187b67,'raw':!![]});}})[_0xff04('0x34')](handleEntityNotFound(_0x5011f2,null))[_0xff04('0x34')](function(_0x2d12a3){if(_0x2d12a3){_0x2365c0['contact']=_0x2d12a3;var _0x551180={'ContactId':_0x2d12a3['id'],'phone':_0x2365c0['body']['from'],'SmsAccountId':_0x505c72[_0xff04('0x61')]['id']};var _0x53ef17={'ContactId':_0x2d12a3['id'],'SmsAccountId':_0x505c72[_0xff04('0x61')]['id'],'closed':![]};return db[_0xff04('0x9a')][_0xff04('0x56')]({'where':_0x53ef17})[_0xff04('0x34')](function(_0xabe49b){if(_0xabe49b){return[_0xabe49b,![]];}return db[_0xff04('0x9a')]['create'](_0x551180)['then'](function(_0x360f37){return[_0x360f37,!![]];});});}})[_0xff04('0x9b')](function(_0x9ed57f,_0x30aa83){_0x2365c0[_0xff04('0x9c')]=_0x9ed57f[_0xff04('0x36')]({'plain':!![]});_0x2365c0[_0xff04('0x9c')][_0xff04('0x9d')]=![];if(_0x30aa83){if(_0x2365c0[_0xff04('0x6f')][_0xff04('0x9e')]){_0x2365c0[_0xff04('0x70')][_0xff04('0x9f')]({'id':0x0,'priority':_0x2365c0[_0xff04('0x70')][_0xff04('0x48')]+0x1,'app':_0xff04('0xa0'),'appdata':_0xff04('0xa1'),'interval':_0xff04('0xa2')});}_0x2365c0['interaction'][_0xff04('0x9d')]=!![];}return db['SmsMessage'][_0xff04('0x57')]({'phone':_0x2365c0[_0xff04('0x58')]['from'],'messageId':_0x2365c0[_0xff04('0x58')][_0xff04('0x85')],'body':_0x2365c0[_0xff04('0x58')]['body'],'SmsAccountId':_0x505c72[_0xff04('0x61')]['id'],'SmsInteractionId':_0x9ed57f['id'],'direction':'in','ContactId':_0x9ed57f[_0xff04('0xa3')],'AttachmentId':_0x2365c0['body']['AttachmentId']});})['then'](function(_0x91f133){_0x2365c0['message']=_0x91f133;if(_0x2365c0[_0xff04('0x9c')][_0xff04('0xa4')]){return db[_0xff04('0xa5')][_0xff04('0x56')]({'attributes':['id',_0xff04('0x38')],'where':{'id':_0x2365c0['interaction'][_0xff04('0xa4')]}})[_0xff04('0x34')](function(_0x5ab679){if(_0x5ab679){_0x2365c0['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xff04('0xa6'),'appdata':_0x5ab679[_0xff04('0x38')]+','+(_0x2365c0[_0xff04('0x6f')][_0xff04('0xa7')]||0xa),'interval':_0xff04('0xa2')});}return respondWithRpcPromise('Start',_0xff04('0xa8'),_0x2365c0);});}return respondWithRpcPromise(_0xff04('0xa9'),'startRouting',_0x2365c0);})['then'](function(_0x1685df){if(_0x1685df){var _0x276a1a=0xc8;var _0x2ab3ee='receiveMessage';logger[_0xff04('0x20')](_0xff04('0x24'),_0x2ab3ee,_0x276a1a,_0xff04('0xaa'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2ab3ee,_0x276a1a,_0xff04('0xaa'),JSON['stringify'](_0x1685df));if(_0x2365c0[_0xff04('0x6f')]['type']===_0xff04('0x7a')){return _0x5011f2['status'](_0x276a1a)[_0xff04('0x31')](_0xff04('0xab'),_0xff04('0xac'))[_0xff04('0x39')]('\x0a');}else{return _0x5011f2[_0xff04('0x2a')](_0x276a1a)[_0xff04('0x2c')](_0x1685df);}}})[_0xff04('0x29')](handleError(_0x5011f2,null));};exports[_0xff04('0xad')]=function(_0x4e9505,_0x1d2afb,_0x3a5d4b){return db[_0xff04('0x3e')][_0xff04('0x65')]({'where':{'id':_0x4e9505[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x1d2afb,null))[_0xff04('0x34')](function(_0x44cfd6){if(_0x44cfd6){return db['sequelize'][_0xff04('0xae')](function(_0xc81c48){return db[_0xff04('0x6e')][_0xff04('0x35')]({'where':{'SmsAccountId':_0x4e9505['params']['id']},'transaction':_0xc81c48})[_0xff04('0x34')](function(_0x1fbbf7){var _0x175802=_[_0xff04('0x3d')](_0x4e9505[_0xff04('0x58')],function(_0x5184ae){_0x5184ae[_0xff04('0x63')]=_0x4e9505[_0xff04('0x61')]['id'];return _0x5184ae;});return db[_0xff04('0x6e')][_0xff04('0xaf')](_0x175802,{'transaction':_0xc81c48});});})[_0xff04('0x34')](function(){return db[_0xff04('0x6e')][_0xff04('0xb0')]({'where':{'SmsAccountId':_0x4e9505[_0xff04('0x61')]['id']},'order':_0xff04('0x72')});});}})['then'](respondWithResult(_0x1d2afb,null))[_0xff04('0x29')](handleError(_0x1d2afb,null));};exports[_0xff04('0xb1')]=function(_0x5d9934,_0x4350fe,_0x97ef97){var _0x1d354a={};var _0x579d75={};var _0x29c7a4;var _0x17dbe5;return db[_0xff04('0x3e')][_0xff04('0x65')]({'where':{'id':_0x5d9934[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x4350fe,null))[_0xff04('0x34')](function(_0x230854){if(_0x230854){_0x29c7a4=_0x230854;_0x579d75[_0xff04('0x41')]=_['keys'](db[_0xff04('0x6e')][_0xff04('0x54')]);_0x579d75[_0xff04('0x42')]=_[_0xff04('0x43')](_0x5d9934[_0xff04('0x42')]);_0x579d75[_0xff04('0x44')]=_[_0xff04('0x45')](_0x579d75[_0xff04('0x41')],_0x579d75[_0xff04('0x42')]);_0x1d354a[_0xff04('0x46')]=_[_0xff04('0x45')](_0x579d75['model'],qs['fields'](_0x5d9934[_0xff04('0x42')][_0xff04('0x47')]));_0x1d354a[_0xff04('0x46')]=_0x1d354a[_0xff04('0x46')][_0xff04('0x48')]?_0x1d354a[_0xff04('0x46')]:_0x579d75[_0xff04('0x41')];_0x1d354a[_0xff04('0x66')]=qs['sort'](_0x5d9934[_0xff04('0x42')]['sort']);_0x1d354a[_0xff04('0x4b')]=qs['filters'](_[_0xff04('0x4c')](_0x5d9934[_0xff04('0x42')],_0x579d75[_0xff04('0x44')]));if(_0x5d9934['query']['filter']){_0x1d354a[_0xff04('0x4b')]=_[_0xff04('0x4e')](_0x1d354a[_0xff04('0x4b')],{'$or':_[_0xff04('0x3d')](_0x1d354a['attributes'],function(_0x11289a){var _0x45d9c7={};_0x45d9c7[_0x11289a]={'$like':'%'+_0x5d9934[_0xff04('0x42')]['filter']+'%'};return _0x45d9c7;})});}_0x1d354a=_['merge']({},_0x1d354a,_0x5d9934['options']);return _0x29c7a4['getApplications'](_0x1d354a);}})[_0xff04('0x34')](function(_0x3d0a0f){if(_0x3d0a0f){_0x17dbe5=_0x3d0a0f[_0xff04('0x48')];if(!_0x5d9934[_0xff04('0x42')]['hasOwnProperty'](_0xff04('0x4a'))){_0x1d354a[_0xff04('0x2e')]=qs[_0xff04('0x2e')](_0x5d9934[_0xff04('0x42')][_0xff04('0x2e')]);_0x1d354a['offset']=qs[_0xff04('0x30')](_0x5d9934[_0xff04('0x42')]['offset']);}return _0x29c7a4['getApplications'](_0x1d354a);}})['then'](function(_0x5cf7e9){if(_0x5cf7e9){return _0x5cf7e9?{'count':_0x17dbe5,'rows':_0x5cf7e9}:null;}})[_0xff04('0x34')](respondWithResult(_0x4350fe,null))[_0xff04('0x29')](handleError(_0x4350fe,null));};exports[_0xff04('0xb2')]=function(_0xc4f1d0,_0x172bea,_0x2757da){var _0x37f4b9={'raw':![],'where':{}};var _0x49b690={};var _0x5ead05={'count':0x0,'rows':[]};return db[_0xff04('0x3e')][_0xff04('0x65')]({'where':{'id':_0xc4f1d0[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x172bea,null))[_0xff04('0x34')](function(_0x16f30c){if(_0x16f30c){_0x49b690[_0xff04('0x41')]=_[_0xff04('0x43')](db[_0xff04('0x9a')]['rawAttributes']);_0x49b690['query']=_[_0xff04('0x43')](_0xc4f1d0[_0xff04('0x42')]);_0x49b690['filters']=_[_0xff04('0x45')](_0x49b690[_0xff04('0x41')],_0x49b690['query']);_0x37f4b9[_0xff04('0x46')]=_[_0xff04('0x45')](_0x49b690[_0xff04('0x41')],qs[_0xff04('0x47')](_0xc4f1d0['query'][_0xff04('0x47')]));_0x37f4b9[_0xff04('0x46')]=_0x37f4b9['attributes'][_0xff04('0x48')]?_0x37f4b9[_0xff04('0x46')]:_0x49b690[_0xff04('0x41')];if(!_0xc4f1d0['query']['hasOwnProperty'](_0xff04('0x4a'))){_0x37f4b9[_0xff04('0x2e')]=qs[_0xff04('0x2e')](_0xc4f1d0[_0xff04('0x42')]['limit']);_0x37f4b9[_0xff04('0x30')]=qs[_0xff04('0x30')](_0xc4f1d0['query'][_0xff04('0x30')]);}_0x37f4b9[_0xff04('0x66')]=qs[_0xff04('0x67')](_0xc4f1d0[_0xff04('0x42')]['sort']);_0x37f4b9['where']=qs[_0xff04('0x44')](_[_0xff04('0x4c')](_0xc4f1d0[_0xff04('0x42')],_0x49b690[_0xff04('0x44')]));_0x37f4b9['where']['SmsAccountId']=_0x16f30c['id'];if(_0xc4f1d0[_0xff04('0x42')][_0xff04('0x4d')]){_0x37f4b9['where']=_['merge'](_0x37f4b9[_0xff04('0x4b')],{'$or':_[_0xff04('0x3d')](_0x37f4b9[_0xff04('0x46')],function(_0x19055b){var _0x56e52f={};_0x56e52f[_0x19055b]={'$like':'%'+_0xc4f1d0[_0xff04('0x42')][_0xff04('0x4d')]+'%'};return _0x56e52f;})});}_0x37f4b9=_[_0xff04('0x4e')]({},_0x37f4b9,_0xc4f1d0[_0xff04('0x4f')]);return db['SmsInteraction'][_0xff04('0x2f')]({'where':_0x37f4b9['where']})[_0xff04('0x34')](function(_0x3f609c){_0x5ead05['count']=_0x3f609c;if(_0xc4f1d0[_0xff04('0x42')][_0xff04('0x55')]){_0x37f4b9[_0xff04('0x50')]=[{'model':db[_0xff04('0x73')],'as':_0xff04('0xb3'),'required':![]},{'model':db['User'],'as':_0xff04('0xb4'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xff04('0xb5')],'as':_0xff04('0xb6'),'attributes':['id','name',_0xff04('0xb7')],'where':_0xc4f1d0['query'][_0xff04('0xb8')]?{'id':_0xc4f1d0[_0xff04('0x42')]['tag']}:undefined,'required':_0xc4f1d0[_0xff04('0x42')][_0xff04('0xb8')]?!![]:![]}];}return db[_0xff04('0x9a')][_0xff04('0x51')](_0x37f4b9);})[_0xff04('0x34')](function(_0x1e6052){_0x5ead05['rows']=_0x1e6052;return _0x5ead05;});}})['then'](respondWithFilteredResult(_0x172bea,_0x37f4b9))[_0xff04('0x29')](handleError(_0x172bea,null));};exports[_0xff04('0x39')]=function(_0x1236d7,_0x570e5d,_0x5a0dc2){var _0x421a48,_0x56f160,_0x38f8a1;if(_[_0xff04('0x92')](_0x1236d7['body'][_0xff04('0x58')])||_0x1236d7[_0xff04('0x58')][_0xff04('0x58')]===''){throw new db[(_0xff04('0xb9'))][(_0xff04('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xff04('0x92')](_0x1236d7[_0xff04('0x58')]['to'])){throw new db['Sequelize']['ValidationError'](_0xff04('0xba'));}_0x421a48=_0x1236d7[_0xff04('0x58')]['to'];return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0x1236d7[_0xff04('0x61')]['id']},'include':[{'model':db[_0xff04('0x97')],'as':_0xff04('0xbb'),'include':[{'model':db[_0xff04('0x73')],'as':_0xff04('0x98'),'where':{'mobile':_0x421a48},'limit':0x1,'order':[[_0xff04('0x77'),_0xff04('0xbc')]]}]}]})[_0xff04('0x34')](handleEntityNotFound(_0x570e5d,null))['then'](function(_0x4040b5){if(_0x4040b5&&_0x4040b5['List']){_0x56f160=_0x4040b5[_0xff04('0x36')]({'plain':!![]});if(_0x56f160[_0xff04('0xbb')]&&_0x56f160[_0xff04('0xbb')]['Contacts'][_0xff04('0x48')]){return _0x56f160['List'][_0xff04('0x98')][0x0];}return db['CmContact'][_0xff04('0x57')](_[_0xff04('0x99')](_0x1236d7[_0xff04('0x58')],{'firstName':_0x421a48,'mobile':_0x421a48,'phone':_0x421a48,'ListId':_0x56f160[_0xff04('0xbd')]}));}})['then'](handleEntityNotFound(_0x570e5d,null))[_0xff04('0x34')](function(_0x50b7e0){if(_0x50b7e0){_0x38f8a1=_0x50b7e0;return db[_0xff04('0x9a')][_0xff04('0x56')]({'where':{'ContactId':_0x38f8a1['id'],'closed':![],'SmsAccountId':_0x56f160['id']}})[_0xff04('0x34')](function(_0x26f347){if(_0x26f347){return[_0x26f347,![]];}return db['SmsInteraction']['create']({'UserId':_0x1236d7['user']['id'],'ContactId':_0x38f8a1['id'],'SmsAccountId':_0x56f160['id'],'phone':_0x421a48,'firstMsgDirection':_0xff04('0xbe'),'Messages':[_['merge'](_0x1236d7['body'],{'read':![],'body':_0x1236d7['body']['body'],'phone':_0x421a48,'SmsAccountId':_0x56f160['id'],'UserId':_0x1236d7['user']['id'],'ContactId':_0x38f8a1['id']})]},{'include':[{'model':db[_0xff04('0xbf')],'as':_0xff04('0xc0')}]})['then'](function(_0x5862b0){return[_0x5862b0,!![]];});});}})[_0xff04('0x9b')](function(_0x5b6221,_0x29961a){if(_0x29961a){return _0x5b6221;}return db[_0xff04('0xbf')]['create'](_[_0xff04('0x4e')](_0x1236d7[_0xff04('0x58')],{'read':![],'body':_0x1236d7[_0xff04('0x58')][_0xff04('0x58')],'phone':_0x421a48,'SmsAccountId':_0x56f160['id'],'SmsInteractionId':_0x5b6221['id'],'UserId':_0x1236d7[_0xff04('0x59')]['id'],'ContactId':_0x38f8a1['id']}))[_0xff04('0x34')](function(_0x3df571){_0x5b6221['dataValues'][_0xff04('0xc0')]=[];_0x5b6221[_0xff04('0xc1')]['Messages'][_0xff04('0x9f')](_0x3df571[_0xff04('0xc1')]);return _0x5b6221;});})[_0xff04('0x34')](respondWithResult(_0x570e5d,null))['catch'](handleError(_0x570e5d,null));};exports[_0xff04('0x2a')]=function(_0x124c4a,_0x1d27e1,_0x3905c1){if(_0x124c4a[_0xff04('0x58')]['id']){delete _0x124c4a['body']['id'];}var _0x3b1267,_0x3ff3e8,_0x459eec;return db['SmsAccount']['find']({'where':{'id':_0x124c4a[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x1d27e1,null))[_0xff04('0x34')](function(_0x3c3da9){if(_0x3c3da9){_0x459eec=_0x3c3da9;logger[_0xff04('0x23')](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0xc2'),_0x3c3da9[_0xff04('0x3f')],util[_0xff04('0xc3')](_0x124c4a[_0xff04('0x58')],{'showHidden':![],'depth':null}));switch(_0x3c3da9[_0xff04('0x3f')]){case _0xff04('0xc4'):if(_0x124c4a[_0xff04('0x58')][_0xff04('0xc5')]&&_0x124c4a[_0xff04('0x58')][_0xff04('0x2a')]){_0x3ff3e8=_0x124c4a[_0xff04('0x58')]['status'];return db[_0xff04('0xbf')][_0xff04('0x56')]({'where':{'messageId':_0x124c4a[_0xff04('0x58')][_0xff04('0xc5')]}});}break;case'connectel':if(_0x124c4a[_0xff04('0x58')]['requestid']&&_0x124c4a[_0xff04('0x58')][_0xff04('0xc6')]){_0x3ff3e8=_0x124c4a[_0xff04('0x58')]['statusInt'];return db[_0xff04('0xbf')]['find']({'where':{'messageId':_0x124c4a['body'][_0xff04('0xc7')]}});}break;case'clicksend':if(_0x124c4a[_0xff04('0x58')][_0xff04('0x82')]&&_0x124c4a[_0xff04('0x58')][_0xff04('0xc8')]){_0x3ff3e8=_0x124c4a['body'][_0xff04('0xc8')];return db[_0xff04('0xbf')]['find']({'where':{'messageId':_0x124c4a['body'][_0xff04('0x82')]}});}break;case'infobip':var _0x3678b8=_0x124c4a[_0xff04('0x58')]['results'][0x0];if(_0x3678b8[_0xff04('0x85')]&&_0x3678b8['status'][_0xff04('0xc9')]===_0xff04('0xca')){_0x3ff3e8=_0x3678b8[_0xff04('0x2a')][_0xff04('0xc9')];return db[_0xff04('0xbf')][_0xff04('0x56')]({'where':{'messageId':_0x3678b8[_0xff04('0x85')]}});}break;case _0xff04('0x8b'):if(_0x124c4a[_0xff04('0x58')][_0xff04('0x85')]&&_0x124c4a['body'][_0xff04('0x2a')]){_0x3ff3e8=_0x124c4a[_0xff04('0x58')]['status'];return db[_0xff04('0xbf')]['find']({'where':{'messageId':_0x124c4a[_0xff04('0x58')][_0xff04('0x85')]}});}break;case _0xff04('0x8e'):if(_0x124c4a[_0xff04('0x58')][0x0][_0xff04('0x27')]['id']){_0x3ff3e8=_0x124c4a[_0xff04('0x58')][0x0]['type'];return db['SmsMessage'][_0xff04('0x56')]({'where':{'messageId':_0x124c4a[_0xff04('0x58')][0x0][_0xff04('0x27')]['id']}});}break;case'intelepeer':if(_0x124c4a[_0xff04('0x58')][_0xff04('0xcb')]&&_0x124c4a[_0xff04('0x58')]['status']){_0x3ff3e8=_0x124c4a[_0xff04('0x58')]['status'];return db[_0xff04('0xbf')][_0xff04('0x56')]({'where':{'messageId':_0x124c4a[_0xff04('0x58')][_0xff04('0xcb')]}});}break;}}})[_0xff04('0x34')](handleEntityNotFound(_0x1d27e1,null))['then'](function(_0x5e159a){if(_0x5e159a){_0x3b1267=_0x5e159a;switch(_0x459eec[_0xff04('0x3f')]){case _0xff04('0xc4'):if(_0x3ff3e8==='DELIVERED'){return _0x3b1267['update']({'read':!![]});}else{logger['error'](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0xc4'),util[_0xff04('0xc3')](_0x124c4a[_0xff04('0x58')],{'showHidden':![],'depth':null}));}break;case _0xff04('0x80'):if(_0x3ff3e8==='1'){return _0x3b1267[_0xff04('0x60')]({'read':!![]});}else{logger[_0xff04('0x26')](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0xc4'),util[_0xff04('0xc3')](_0x124c4a[_0xff04('0x58')],{'showHidden':![],'depth':null}));}break;case _0xff04('0x81'):if(!_0x124c4a[_0xff04('0x58')][_0xff04('0xcc')]&&_0x3ff3e8>=0xc8&&_0x3ff3e8<=0xce){return _0x3b1267[_0xff04('0x60')]({'read':!![]});}else{logger[_0xff04('0x26')](_0xff04('0x24'),'status',_0xff04('0x81'),util[_0xff04('0xc3')](_0x124c4a[_0xff04('0x58')],{'showHidden':![],'depth':null}));}break;case _0xff04('0x87'):var _0x3cba9c=_0x124c4a[_0xff04('0x58')][_0xff04('0x88')][0x0];if(_0x3cba9c[_0xff04('0x2a')][_0xff04('0xc9')]===_0xff04('0xca')){return _0x3b1267[_0xff04('0x60')]({'read':!![]});}else{logger['error'](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0x87'),util['inspect'](_0x124c4a[_0xff04('0x58')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3ff3e8==_0xff04('0xcd')||_0x3ff3e8==_0xff04('0xce')){return _0x3b1267[_0xff04('0x60')]({'read':!![]});}else{logger[_0xff04('0x26')](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0x8b'),util['inspect'](_0x124c4a[_0xff04('0x58')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3ff3e8=='message-delivered'){return _0x3b1267[_0xff04('0x60')]({'read':!![]});}else{logger[_0xff04('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xff04('0x2a'),_0xff04('0x8e'),util[_0xff04('0xc3')](_0x124c4a['body'],{'showHidden':![],'depth':null}));}break;case _0xff04('0xcf'):if(_0x3ff3e8===_0xff04('0xd0')||_0x3ff3e8===_0xff04('0xd1')){return _0x3b1267[_0xff04('0x60')]({'read':!![]});}else{logger[_0xff04('0x26')](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0xcf'),util['inspect'](_0x124c4a['body'],{'showHidden':![],'depth':null}));}break;}return _0x3b1267;}})[_0xff04('0x34')](respondWithResult(_0x1d27e1,null))[_0xff04('0x29')](handleError(_0x1d27e1,null));};exports[_0xff04('0xd2')]=function(_0x1a40a1,_0x513d69,_0x10bb89){var _0x377801,_0x3ecb42,_0x1bbb18;return db['SmsAccount']['find']({'where':{'id':_0x1a40a1[_0xff04('0x61')]['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x513d69,null))[_0xff04('0x34')](function(_0x3146df){if(_0x3146df){_0x1bbb18=_0x3146df;logger['debug'](_0xff04('0x24'),_0xff04('0x2a'),'received\x20delivery\x20report\x20from',_0x3146df[_0xff04('0x3f')],util[_0xff04('0xc3')](_0x1a40a1['query'],{'showHidden':![],'depth':null}));switch(_0x3146df[_0xff04('0x3f')]){case _0xff04('0x89'):if(_0x1a40a1[_0xff04('0x42')]['message-id']&&_0x1a40a1[_0xff04('0x42')][_0xff04('0xd3')]){_0x3ecb42=_0x1a40a1['query'][_0xff04('0xd3')];return db[_0xff04('0xbf')][_0xff04('0x56')]({'where':{'messageId':_0x1a40a1[_0xff04('0x42')][_0xff04('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x513d69,null))[_0xff04('0x34')](function(_0x49d297){if(_0x49d297){_0x377801=_0x49d297;switch(_0x1bbb18[_0xff04('0x3f')]){case _0xff04('0x89'):if(_0x3ecb42==='2'||_0x3ecb42==='6'){return _0x377801['update']({'read':!![]});}else{logger[_0xff04('0x26')](_0xff04('0x24'),_0xff04('0x2a'),_0xff04('0x89'),util[_0xff04('0xc3')](_0x1a40a1[_0xff04('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x377801;}})[_0xff04('0x34')](respondWithResult(_0x513d69,null))[_0xff04('0x29')](handleError(_0x513d69,null));};exports[_0xff04('0xd5')]=function(_0xcb8a18,_0x36008e,_0x1768dd){return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0xcb8a18[_0xff04('0x61')]['id']}})['then'](handleEntityNotFound(_0x36008e,null))['then'](function(_0xa1dcbd){if(_0xa1dcbd){return _0xa1dcbd[_0xff04('0xd5')](_0xcb8a18[_0xff04('0x58')][_0xff04('0x69')],_[_0xff04('0xd6')](_0xcb8a18[_0xff04('0x58')],[_0xff04('0x69'),'id'])||{})['spread'](function(_0x12ff67){for(var _0x42828b=0x0;_0x42828b<_0xcb8a18[_0xff04('0x58')]['ids'][_0xff04('0x48')];_0x42828b+=0x1){socket[_0xff04('0xd7')]('userSmsAccount:save',{'UserId':Number(_0xcb8a18[_0xff04('0x58')]['ids'][_0x42828b]),'SmsAccountId':Number(_0xcb8a18['params']['id'])});}return _0x12ff67;});}})[_0xff04('0x34')](respondWithResult(_0x36008e,null))['catch'](handleError(_0x36008e,null));};exports[_0xff04('0xd8')]=function(_0x11f41d,_0x1e841c,_0x455743){return db[_0xff04('0x3e')][_0xff04('0x56')]({'where':{'id':_0x11f41d[_0xff04('0x61')]['id']}})['then'](handleEntityNotFound(_0x1e841c,null))[_0xff04('0x34')](function(_0x3134d0){if(_0x3134d0){return _0x3134d0[_0xff04('0xd8')](_0x11f41d[_0xff04('0x42')][_0xff04('0x69')])['then'](function(){if(_['isArray'](_0x11f41d['query'][_0xff04('0x69')])){for(var _0x4c39bf=0x0;_0x4c39bf<_0x11f41d[_0xff04('0x42')]['ids']['length'];_0x4c39bf+=0x1){socket[_0xff04('0xd7')]('userSmsAccount:remove',{'UserId':Number(_0x11f41d[_0xff04('0x42')][_0xff04('0x69')][_0x4c39bf]),'SmsAccountId':Number(_0x11f41d['params']['id'])});}}else{socket[_0xff04('0xd7')](_0xff04('0xd9'),{'UserId':Number(_0x11f41d['query'][_0xff04('0x69')]),'SmsAccountId':Number(_0x11f41d[_0xff04('0x61')]['id'])});}});}})[_0xff04('0x34')](respondWithStatusCode(_0x1e841c,null))['catch'](handleError(_0x1e841c,null));};exports[_0xff04('0xda')]=function(_0x5c7271,_0x41dafe,_0x3dd829){var _0x299fdb={};var _0x312cd8={};var _0x210654;var _0x581a21;return db[_0xff04('0x3e')][_0xff04('0x65')]({'where':{'id':_0x5c7271['params']['id']}})[_0xff04('0x34')](handleEntityNotFound(_0x41dafe,null))[_0xff04('0x34')](function(_0x33ef5a){if(_0x33ef5a){_0x210654=_0x33ef5a;_0x312cd8['model']=_[_0xff04('0x43')](db[_0xff04('0xa5')][_0xff04('0x54')]);_0x312cd8['query']=_[_0xff04('0x43')](_0x5c7271[_0xff04('0x42')]);_0x312cd8['filters']=_[_0xff04('0x45')](_0x312cd8[_0xff04('0x41')],_0x312cd8['query']);_0x299fdb[_0xff04('0x46')]=_[_0xff04('0x45')](_0x312cd8[_0xff04('0x41')],qs['fields'](_0x5c7271[_0xff04('0x42')]['fields']));_0x299fdb[_0xff04('0x46')]=_0x299fdb[_0xff04('0x46')][_0xff04('0x48')]?_0x299fdb[_0xff04('0x46')]:_0x312cd8[_0xff04('0x41')];_0x299fdb[_0xff04('0x66')]=qs['sort'](_0x5c7271[_0xff04('0x42')][_0xff04('0x67')]);_0x299fdb['where']=qs[_0xff04('0x44')](_[_0xff04('0x4c')](_0x5c7271[_0xff04('0x42')],_0x312cd8[_0xff04('0x44')]));if(_0x5c7271['query'][_0xff04('0x4d')]){_0x299fdb[_0xff04('0x4b')]=_[_0xff04('0x4e')](_0x299fdb[_0xff04('0x4b')],{'$or':_[_0xff04('0x3d')](_0x299fdb[_0xff04('0x46')],function(_0x267074){var _0x59b198={};_0x59b198[_0x267074]={'$like':'%'+_0x5c7271[_0xff04('0x42')][_0xff04('0x4d')]+'%'};return _0x59b198;})});}_0x299fdb=_[_0xff04('0x4e')]({},_0x299fdb,_0x5c7271[_0xff04('0x4f')]);return _0x210654[_0xff04('0xda')](_0x299fdb);}})[_0xff04('0x34')](function(_0x330459){if(_0x330459){_0x581a21=_0x330459['length'];if(!_0x5c7271[_0xff04('0x42')][_0xff04('0x49')]('nolimit')){_0x299fdb[_0xff04('0x2e')]=qs['limit'](_0x5c7271[_0xff04('0x42')][_0xff04('0x2e')]);_0x299fdb[_0xff04('0x30')]=qs[_0xff04('0x30')](_0x5c7271['query'][_0xff04('0x30')]);}return _0x210654[_0xff04('0xda')](_0x299fdb);}})[_0xff04('0x34')](function(_0x2e9283){if(_0x2e9283){return _0x2e9283?{'count':_0x581a21,'rows':_0x2e9283}:null;}})[_0xff04('0x34')](respondWithResult(_0x41dafe,null))[_0xff04('0x29')](handleError(_0x41dafe,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 62f4c50..7bd617d 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 _0x9b27=['hook','exports','events','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x13a1ed,_0x1f8a2a){var _0x2433a2=function(_0x2fbb9b){while(--_0x2fbb9b){_0x13a1ed['push'](_0x13a1ed['shift']());}};_0x2433a2(++_0x1f8a2a);}(_0x9b27,0x185));var _0x79b2=function(_0x14ddd4,_0x5b527d){_0x14ddd4=_0x14ddd4-0x0;var _0x421616=_0x9b27[_0x14ddd4];return _0x421616;};'use strict';var EventEmitter=require(_0x79b2('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x79b2('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x79b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79b2('0x3'),'afterDestroy':_0x79b2('0x4')};function emitEvent(_0x330a60){return function(_0x1ea54a,_0x370699,_0x33a8ec){SmsAccountEvents[_0x79b2('0x5')](_0x330a60+':'+_0x1ea54a['id'],_0x1ea54a);SmsAccountEvents[_0x79b2('0x5')](_0x330a60,_0x1ea54a);_0x33a8ec(null);};}for(var e in events){if(events[_0x79b2('0x6')](e)){var event=events[e];SmsAccount[_0x79b2('0x7')](e,emitEvent(event));}}module[_0x79b2('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xbbb8=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x556011,_0x13f9ae){var _0x1d2545=function(_0x20f858){while(--_0x20f858){_0x556011['push'](_0x556011['shift']());}};_0x1d2545(++_0x13f9ae);}(_0xbbb8,0xc0));var _0x8bbb=function(_0x49e91b,_0xcd65b){_0x49e91b=_0x49e91b-0x0;var _0x145142=_0xbbb8[_0x49e91b];return _0x145142;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x8bbb('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x8bbb('0x1')](0x0);var events={'afterCreate':_0x8bbb('0x2'),'afterUpdate':_0x8bbb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47e36f){return function(_0x28f23b,_0x124767,_0x4c19cb){SmsAccountEvents['emit'](_0x47e36f+':'+_0x28f23b['id'],_0x28f23b);SmsAccountEvents['emit'](_0x47e36f,_0x28f23b);_0x4c19cb(null);};}for(var e in events){if(events[_0x8bbb('0x4')](e)){var event=events[e];SmsAccount[_0x8bbb('0x5')](e,emitEvent(event));}}module[_0x8bbb('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index c79a7a5..6662003 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 _0x85be=['./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a3ab8,_0x5c9511){var _0x1a0ffa=function(_0x679894){while(--_0x679894){_0x5a3ab8['push'](_0x5a3ab8['shift']());}};_0x1a0ffa(++_0x5c9511);}(_0x85be,0x1d8));var _0xe85b=function(_0x5304c3,_0x2fffa5){_0x5304c3=_0x5304c3-0x0;var _0x2a98ee=_0x85be[_0x5304c3];return _0x2a98ee;};'use strict';var _=require(_0xe85b('0x0'));var util=require('util');var logger=require(_0xe85b('0x1'))(_0xe85b('0x2'));var moment=require('moment');var BPromise=require(_0xe85b('0x3'));var rp=require(_0xe85b('0x4'));var fs=require('fs');var path=require(_0xe85b('0x5'));var rimraf=require(_0xe85b('0x6'));var config=require(_0xe85b('0x7'));var attributes=require(_0xe85b('0x8'));module[_0xe85b('0x9')]=function(_0x2581bc,_0x26c7c5){return _0x2581bc['define'](_0xe85b('0xa'),attributes,{'tableName':_0xe85b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedcd=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','exports','define'];(function(_0x5242c9,_0x431a86){var _0x2f0d37=function(_0x37b0c4){while(--_0x37b0c4){_0x5242c9['push'](_0x5242c9['shift']());}};_0x2f0d37(++_0x431a86);}(_0xedcd,0xde));var _0xdedc=function(_0x28e3eb,_0x4398e5){_0x28e3eb=_0x28e3eb-0x0;var _0x208cb6=_0xedcd[_0x28e3eb];return _0x208cb6;};'use strict';var _=require(_0xdedc('0x0'));var util=require(_0xdedc('0x1'));var logger=require(_0xdedc('0x2'))(_0xdedc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdedc('0x4'));var fs=require('fs');var path=require(_0xdedc('0x5'));var rimraf=require(_0xdedc('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xdedc('0x7')]=function(_0x34e8a6,_0x21111c){return _0x34e8a6[_0xdedc('0x8')](_0xdedc('0x9'),attributes,{'tableName':_0xdedc('0xa'),'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 79f23a9..863438c 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 _0xd66d=['code','message','catch','ShowSmsAccount','SmsAccount','options','raw','include','map','model','attributes','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x18a4f7,_0x3f915c){var _0x368cf3=function(_0x173245){while(--_0x173245){_0x18a4f7['push'](_0x18a4f7['shift']());}};_0x368cf3(++_0x3f915c);}(_0xd66d,0x123));var _0xdd66=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xd66d[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0xdd66('0x0'));var util=require(_0xdd66('0x1'));var moment=require('moment');var BPromise=require(_0xdd66('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd66('0x3'));var db=require(_0xdd66('0x4'))['db'];var utils=require(_0xdd66('0x5'));var logger=require(_0xdd66('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd66('0x7')][_0xdd66('0x8')]({'port':0x232a});config[_0xdd66('0x9')]=_[_0xdd66('0xa')](config[_0xdd66('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd66('0x9')]));require('./smsAccount.socket')[_0xdd66('0xb')](socket);function respondWithRpcPromise(_0x3ed195,_0x55d6b4,_0xbbd3fd){return new BPromise(function(_0x21b6eb,_0x1f0ab2){return client[_0xdd66('0xc')](_0x3ed195,_0xbbd3fd)[_0xdd66('0xd')](function(_0x44c269){logger[_0xdd66('0xe')](_0xdd66('0xf'),_0x55d6b4,_0xdd66('0x10'));logger[_0xdd66('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x55d6b4,_0xdd66('0x10'),JSON['stringify'](_0x44c269));if(_0x44c269[_0xdd66('0x12')]){if(_0x44c269[_0xdd66('0x12')][_0xdd66('0x13')]===0x1f4){logger[_0xdd66('0x12')](_0xdd66('0xf'),_0x55d6b4,_0x44c269['error'][_0xdd66('0x14')]);return _0x1f0ab2(_0x44c269[_0xdd66('0x12')][_0xdd66('0x14')]);}logger['error'](_0xdd66('0xf'),_0x55d6b4,_0x44c269['error'][_0xdd66('0x14')]);return _0x21b6eb(_0x44c269['error'][_0xdd66('0x14')]);}else{logger[_0xdd66('0xe')](_0xdd66('0xf'),_0x55d6b4,_0xdd66('0x10'));_0x21b6eb(_0x44c269['result'][_0xdd66('0x14')]);}})[_0xdd66('0x15')](function(_0x17a9b6){logger['error'](_0xdd66('0xf'),_0x55d6b4,_0x17a9b6);_0x1f0ab2(_0x17a9b6);});});}exports[_0xdd66('0x16')]=function(_0x4a94ac){var _0x4cf537=this;return new Promise(function(_0x1f4d03,_0x1c4a77){return db[_0xdd66('0x17')]['find']({'raw':_0x4a94ac[_0xdd66('0x18')]?_0x4a94ac[_0xdd66('0x18')][_0xdd66('0x19')]===undefined?!![]:![]:!![],'where':_0x4a94ac[_0xdd66('0x18')]?_0x4a94ac[_0xdd66('0x18')]['where']||null:null,'attributes':_0x4a94ac[_0xdd66('0x18')]?_0x4a94ac[_0xdd66('0x18')]['attributes']||null:null,'include':_0x4a94ac['options']?_0x4a94ac[_0xdd66('0x18')][_0xdd66('0x1a')]?_[_0xdd66('0x1b')](_0x4a94ac['options'][_0xdd66('0x1a')],function(_0x4c755b){return{'model':db[_0x4c755b[_0xdd66('0x1c')]],'as':_0x4c755b['as'],'attributes':_0x4c755b[_0xdd66('0x1d')],'include':_0x4c755b[_0xdd66('0x1a')]?_[_0xdd66('0x1b')](_0x4c755b[_0xdd66('0x1a')],function(_0x270886){return{'model':db[_0x270886[_0xdd66('0x1c')]],'as':_0x270886['as'],'attributes':_0x270886[_0xdd66('0x1d')],'include':_0x270886[_0xdd66('0x1a')]?_[_0xdd66('0x1b')](_0x270886['include'],function(_0x4b1904){return{'model':db[_0x4b1904[_0xdd66('0x1c')]],'as':_0x4b1904['as'],'attributes':_0x4b1904[_0xdd66('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdd66('0xd')](function(_0x5490c9){logger['info'](_0xdd66('0x16'),_0x4a94ac);logger[_0xdd66('0x11')]('ShowSmsAccount',_0x4a94ac,JSON[_0xdd66('0x1e')](_0x5490c9));_0x1f4d03(_0x5490c9);})[_0xdd66('0x15')](function(_0x5c363b){logger['error'](_0xdd66('0x16'),_0x5c363b[_0xdd66('0x14')],_0x4a94ac);_0x1c4a77(_0x4cf537[_0xdd66('0x12')](0x1f4,_0x5c363b[_0xdd66('0x14')]));});});}; \ No newline at end of file +var _0xa31f=['request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','find','options','raw','where','attributes','include','map','model','then','ShowSmsAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request'];(function(_0xf4d9fe,_0x28b728){var _0x3b003e=function(_0x41b895){while(--_0x41b895){_0xf4d9fe['push'](_0xf4d9fe['shift']());}};_0x3b003e(++_0x28b728);}(_0xa31f,0x67));var _0xfa31=function(_0x56d4ec,_0x13fc6f){_0x56d4ec=_0x56d4ec-0x0;var _0x32021e=_0xa31f[_0x56d4ec];return _0x32021e;};'use strict';var _=require(_0xfa31('0x0'));var util=require(_0xfa31('0x1'));var moment=require(_0xfa31('0x2'));var BPromise=require(_0xfa31('0x3'));var rs=require(_0xfa31('0x4'));var fs=require('fs');var Redis=require(_0xfa31('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa31('0x6'));var logger=require(_0xfa31('0x7'))(_0xfa31('0x8'));var config=require(_0xfa31('0x9'));var jayson=require(_0xfa31('0xa'));var client=jayson[_0xfa31('0xb')][_0xfa31('0xc')]({'port':0x232a});config[_0xfa31('0xd')]=_[_0xfa31('0xe')](config['redis'],{'host':_0xfa31('0xf'),'port':0x18eb});var socket=require(_0xfa31('0x10'))(new Redis(config['redis']));require(_0xfa31('0x11'))[_0xfa31('0x12')](socket);function respondWithRpcPromise(_0x488032,_0x1f83f0,_0x56e9ff){return new BPromise(function(_0x14f5fd,_0x3e5b4d){return client[_0xfa31('0x13')](_0x488032,_0x56e9ff)['then'](function(_0x7cacb){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1f83f0,_0xfa31('0x14'));logger['debug'](_0xfa31('0x15'),_0x1f83f0,_0xfa31('0x14'),JSON[_0xfa31('0x16')](_0x7cacb));if(_0x7cacb[_0xfa31('0x17')]){if(_0x7cacb[_0xfa31('0x17')][_0xfa31('0x18')]===0x1f4){logger['error'](_0xfa31('0x19'),_0x1f83f0,_0x7cacb['error'][_0xfa31('0x1a')]);return _0x3e5b4d(_0x7cacb[_0xfa31('0x17')][_0xfa31('0x1a')]);}logger[_0xfa31('0x17')](_0xfa31('0x19'),_0x1f83f0,_0x7cacb['error'][_0xfa31('0x1a')]);return _0x14f5fd(_0x7cacb['error'][_0xfa31('0x1a')]);}else{logger[_0xfa31('0x1b')](_0xfa31('0x19'),_0x1f83f0,_0xfa31('0x14'));_0x14f5fd(_0x7cacb[_0xfa31('0x1c')]['message']);}})[_0xfa31('0x1d')](function(_0x365862){logger[_0xfa31('0x17')](_0xfa31('0x19'),_0x1f83f0,_0x365862);_0x3e5b4d(_0x365862);});});}exports['ShowSmsAccount']=function(_0x257be4){var _0x269dc3=this;return new Promise(function(_0x47fb29,_0x1211e3){return db['SmsAccount'][_0xfa31('0x1e')]({'raw':_0x257be4[_0xfa31('0x1f')]?_0x257be4[_0xfa31('0x1f')][_0xfa31('0x20')]===undefined?!![]:![]:!![],'where':_0x257be4[_0xfa31('0x1f')]?_0x257be4['options'][_0xfa31('0x21')]||null:null,'attributes':_0x257be4[_0xfa31('0x1f')]?_0x257be4[_0xfa31('0x1f')][_0xfa31('0x22')]||null:null,'include':_0x257be4['options']?_0x257be4[_0xfa31('0x1f')][_0xfa31('0x23')]?_[_0xfa31('0x24')](_0x257be4[_0xfa31('0x1f')]['include'],function(_0x2364a0){return{'model':db[_0x2364a0[_0xfa31('0x25')]],'as':_0x2364a0['as'],'attributes':_0x2364a0['attributes'],'include':_0x2364a0[_0xfa31('0x23')]?_['map'](_0x2364a0[_0xfa31('0x23')],function(_0x272f54){return{'model':db[_0x272f54['model']],'as':_0x272f54['as'],'attributes':_0x272f54[_0xfa31('0x22')],'include':_0x272f54[_0xfa31('0x23')]?_[_0xfa31('0x24')](_0x272f54[_0xfa31('0x23')],function(_0x410abc){return{'model':db[_0x410abc[_0xfa31('0x25')]],'as':_0x410abc['as'],'attributes':_0x410abc[_0xfa31('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfa31('0x26')](function(_0x4d6795){logger[_0xfa31('0x1b')](_0xfa31('0x27'),_0x257be4);logger[_0xfa31('0x28')]('ShowSmsAccount',_0x257be4,JSON[_0xfa31('0x16')](_0x4d6795));_0x47fb29(_0x4d6795);})[_0xfa31('0x1d')](function(_0x54f0de){logger[_0xfa31('0x17')](_0xfa31('0x27'),_0x54f0de[_0xfa31('0x1a')],_0x257be4);_0x1211e3(_0x269dc3[_0xfa31('0x17')](0x1f4,_0x54f0de[_0xfa31('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1612304..d6f7aac 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 2bdeed9..3ae5b33 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d7707,_0x9784ca){var _0x5d3421=function(_0x57dd26){while(--_0x57dd26){_0x4d7707['push'](_0x4d7707['shift']());}};_0x5d3421(++_0x9784ca);}(_0x34e8,0x12c));var _0x834e=function(_0x23d8c5,_0x4fd5c2){_0x23d8c5=_0x23d8c5-0x0;var _0x261dde=_0x34e8[_0x23d8c5];return _0x261dde;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x47511c,_0x159443){var _0x1bc8c2=function(_0x554983){while(--_0x554983){_0x47511c['push'](_0x47511c['shift']());}};_0x1bc8c2(++_0x159443);}(_0x55ca,0x126));var _0xa55c=function(_0xce06d0,_0xe944b9){_0xce06d0=_0xce06d0-0x0;var _0x360347=_0x55ca[_0xce06d0];return _0x360347;};'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 f282ea0..fc357e2 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 _0x2f55=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x4bf17d,_0x4b4d80){var _0x415bb9=function(_0x3b9833){while(--_0x3b9833){_0x4bf17d['push'](_0x4bf17d['shift']());}};_0x415bb9(++_0x4b4d80);}(_0x2f55,0x130));var _0x52f5=function(_0x4a15f8,_0x16b405){_0x4a15f8=_0x4a15f8-0x0;var _0x18ed0d=_0x2f55[_0x4a15f8];return _0x18ed0d;};'use strict';var Sequelize=require(_0x52f5('0x0'));module[_0x52f5('0x1')]={'priority':{'type':Sequelize[_0x52f5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x52f5('0x3')],'allowNull':![],'defaultValue':_0x52f5('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x52f5('0x3')]},'interval':{'type':Sequelize[_0x52f5('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xaf7e=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaf7e,0x14e));var _0xeaf7=function(_0x2ff9ac,_0x2e7168){_0x2ff9ac=_0x2ff9ac-0x0;var _0x4b2087=_0xaf7e[_0x2ff9ac];return _0x4b2087;};'use strict';var Sequelize=require('sequelize');module[_0xeaf7('0x0')]={'priority':{'type':Sequelize[_0xeaf7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xeaf7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xeaf7('0x3')]()},'description':{'type':Sequelize[_0xeaf7('0x2')]},'interval':{'type':Sequelize[_0xeaf7('0x2')],'defaultValue':_0xeaf7('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0e34740..923c8e1 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 _0xe87d=['status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','SmsApplication','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x184513,_0x3aa313){var _0x169d0b=function(_0x10dfae){while(--_0x10dfae){_0x184513['push'](_0x184513['shift']());}};_0x169d0b(++_0x3aa313);}(_0xe87d,0x1a7));var _0xde87=function(_0x9e9e16,_0x2d096d){_0x9e9e16=_0x9e9e16-0x0;var _0x4c6885=_0xe87d[_0x9e9e16];return _0x4c6885;};'use strict';var emlformat=require(_0xde87('0x0'));var rimraf=require(_0xde87('0x1'));var zipdir=require(_0xde87('0x2'));var jsonpatch=require(_0xde87('0x3'));var rp=require('request-promise');var moment=require(_0xde87('0x4'));var BPromise=require(_0xde87('0x5'));var Mustache=require(_0xde87('0x6'));var util=require(_0xde87('0x7'));var path=require(_0xde87('0x8'));var sox=require(_0xde87('0x9'));var csv=require(_0xde87('0xa'));var ejs=require(_0xde87('0xb'));var fs=require('fs');var fs_extra=require(_0xde87('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xde87('0xd'));var toCsv=require(_0xde87('0xa'));var querystring=require('querystring');var Papa=require(_0xde87('0xe'));var Redis=require(_0xde87('0xf'));var authService=require(_0xde87('0x10'));var qs=require(_0xde87('0x11'));var as=require(_0xde87('0x12'));var hardwareService=require(_0xde87('0x13'));var logger=require(_0xde87('0x14'))(_0xde87('0x15'));var utils=require(_0xde87('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xde87('0x17'));var db=require(_0xde87('0x18'))['db'];function respondWithStatusCode(_0x58a35d,_0x1441ba){_0x1441ba=_0x1441ba||0xcc;return function(_0x197bd2){if(_0x197bd2){return _0x58a35d[_0xde87('0x19')](_0x1441ba);}return _0x58a35d['status'](_0x1441ba)[_0xde87('0x1a')]();};}function respondWithResult(_0x3bc455,_0xe8389d){_0xe8389d=_0xe8389d||0xc8;return function(_0x5cd676){if(_0x5cd676){return _0x3bc455[_0xde87('0x1b')](_0xe8389d)[_0xde87('0x1c')](_0x5cd676);}};}function respondWithFilteredResult(_0x12377a,_0x1e741a){return function(_0x52f250){if(_0x52f250){var _0x6b7821=typeof _0x1e741a[_0xde87('0x1d')]===_0xde87('0x1e')&&typeof _0x1e741a[_0xde87('0x1f')]==='undefined';var _0x1d0583=_0x52f250[_0xde87('0x20')];var _0x49406b=_0x6b7821?0x0:_0x1e741a['offset'];var _0x426909=_0x6b7821?_0x52f250[_0xde87('0x20')]:_0x1e741a[_0xde87('0x1d')]+_0x1e741a[_0xde87('0x1f')];var _0x3a149d;if(_0x426909>=_0x1d0583){_0x426909=_0x1d0583;_0x3a149d=0xc8;}else{_0x3a149d=0xce;}_0x12377a['status'](_0x3a149d);return _0x12377a[_0xde87('0x21')]('Content-Range',_0x49406b+'-'+_0x426909+'/'+_0x1d0583)[_0xde87('0x1c')](_0x52f250);}return null;};}function patchUpdates(_0x437d35){return function(_0x548bcf){try{jsonpatch[_0xde87('0x22')](_0x548bcf,_0x437d35,!![]);}catch(_0x864036){return BPromise[_0xde87('0x23')](_0x864036);}return _0x548bcf[_0xde87('0x24')]();};}function saveUpdates(_0x1870ee,_0x839d96){return function(_0x4381a9){if(_0x4381a9){return _0x4381a9['update'](_0x1870ee)[_0xde87('0x25')](function(_0x25e7cc){return _0x25e7cc;});}return null;};}function removeEntity(_0x50d6b0,_0x19af13){return function(_0x29dcb6){if(_0x29dcb6){return _0x29dcb6[_0xde87('0x26')]()[_0xde87('0x25')](function(){_0x50d6b0[_0xde87('0x1b')](0xcc)[_0xde87('0x1a')]();});}};}function handleEntityNotFound(_0x20ffc6,_0x137e6c){return function(_0x23680b){if(!_0x23680b){_0x20ffc6[_0xde87('0x19')](0x194);}return _0x23680b;};}function handleError(_0x30730c,_0x580019){_0x580019=_0x580019||0x1f4;return function(_0x1f10e4){logger['error'](_0x1f10e4[_0xde87('0x27')]);if(_0x1f10e4[_0xde87('0x28')]){delete _0x1f10e4['name'];}_0x30730c[_0xde87('0x1b')](_0x580019)['send'](_0x1f10e4);};}exports['index']=function(_0x41cb18,_0x4a1fc3){var _0x4aee5c={},_0x5cb785={},_0x2ba630={'count':0x0,'rows':[]};var _0x362258=_[_0xde87('0x29')](db['SmsApplication'][_0xde87('0x2a')],function(_0x2e977f){return{'name':_0x2e977f[_0xde87('0x2b')],'type':_0x2e977f[_0xde87('0x2c')][_0xde87('0x2d')]};});_0x5cb785[_0xde87('0x2e')]=_[_0xde87('0x29')](_0x362258,_0xde87('0x28'));_0x5cb785[_0xde87('0x2f')]=_[_0xde87('0x30')](_0x41cb18['query']);_0x5cb785[_0xde87('0x31')]=_[_0xde87('0x32')](_0x5cb785[_0xde87('0x2e')],_0x5cb785[_0xde87('0x2f')]);_0x4aee5c[_0xde87('0x33')]=_[_0xde87('0x32')](_0x5cb785[_0xde87('0x2e')],qs[_0xde87('0x34')](_0x41cb18[_0xde87('0x2f')][_0xde87('0x34')]));_0x4aee5c[_0xde87('0x33')]=_0x4aee5c[_0xde87('0x33')]['length']?_0x4aee5c[_0xde87('0x33')]:_0x5cb785[_0xde87('0x2e')];if(!_0x41cb18[_0xde87('0x2f')][_0xde87('0x35')](_0xde87('0x36'))){_0x4aee5c[_0xde87('0x1f')]=qs[_0xde87('0x1f')](_0x41cb18[_0xde87('0x2f')][_0xde87('0x1f')]);_0x4aee5c[_0xde87('0x1d')]=qs[_0xde87('0x1d')](_0x41cb18['query']['offset']);}_0x4aee5c[_0xde87('0x37')]=qs[_0xde87('0x38')](_0x41cb18[_0xde87('0x2f')]['sort']);_0x4aee5c[_0xde87('0x39')]=qs[_0xde87('0x31')](_[_0xde87('0x3a')](_0x41cb18[_0xde87('0x2f')],_0x5cb785[_0xde87('0x31')]),_0x362258);if(_0x41cb18['query'][_0xde87('0x3b')]){_0x4aee5c[_0xde87('0x39')]=_['merge'](_0x4aee5c[_0xde87('0x39')],{'$or':_[_0xde87('0x29')](_0x362258,function(_0x38edcb){if(_0x38edcb['type']!==_0xde87('0x3c')){var _0x4bd0c5={};_0x4bd0c5[_0x38edcb[_0xde87('0x28')]]={'$like':'%'+_0x41cb18[_0xde87('0x2f')]['filter']+'%'};return _0x4bd0c5;}})});}_0x4aee5c=_[_0xde87('0x3d')]({},_0x4aee5c,_0x41cb18[_0xde87('0x3e')]);var _0x576891={'where':_0x4aee5c[_0xde87('0x39')]};return db['SmsApplication'][_0xde87('0x20')](_0x576891)[_0xde87('0x25')](function(_0x50b0c5){_0x2ba630[_0xde87('0x20')]=_0x50b0c5;if(_0x41cb18['query'][_0xde87('0x3f')]){_0x4aee5c[_0xde87('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0xde87('0x41')](_0x4aee5c);})[_0xde87('0x25')](function(_0x34a43e){_0x2ba630[_0xde87('0x42')]=_0x34a43e;return _0x2ba630;})[_0xde87('0x25')](respondWithFilteredResult(_0x4a1fc3,_0x4aee5c))[_0xde87('0x43')](handleError(_0x4a1fc3,null));};exports[_0xde87('0x44')]=function(_0x5a9321,_0x117e3b){var _0xc6d8f0={'raw':!![],'where':{'id':_0x5a9321['params']['id']}},_0x3da8f3={};_0x3da8f3[_0xde87('0x2e')]=_[_0xde87('0x30')](db[_0xde87('0x45')][_0xde87('0x2a')]);_0x3da8f3[_0xde87('0x2f')]=_['keys'](_0x5a9321[_0xde87('0x2f')]);_0x3da8f3[_0xde87('0x31')]=_['intersection'](_0x3da8f3[_0xde87('0x2e')],_0x3da8f3['query']);_0xc6d8f0[_0xde87('0x33')]=_[_0xde87('0x32')](_0x3da8f3['model'],qs['fields'](_0x5a9321[_0xde87('0x2f')][_0xde87('0x34')]));_0xc6d8f0[_0xde87('0x33')]=_0xc6d8f0[_0xde87('0x33')][_0xde87('0x46')]?_0xc6d8f0[_0xde87('0x33')]:_0x3da8f3['model'];if(_0x5a9321[_0xde87('0x2f')][_0xde87('0x3f')]){_0xc6d8f0['include']=[{'all':!![]}];}_0xc6d8f0=_[_0xde87('0x3d')]({},_0xc6d8f0,_0x5a9321[_0xde87('0x3e')]);return db['SmsApplication'][_0xde87('0x47')](_0xc6d8f0)['then'](handleEntityNotFound(_0x117e3b,null))[_0xde87('0x25')](respondWithResult(_0x117e3b,null))['catch'](handleError(_0x117e3b,null));};exports['create']=function(_0x57c4c1,_0x280148){return db['SmsApplication'][_0xde87('0x48')](_0x57c4c1[_0xde87('0x49')],{})['then'](respondWithResult(_0x280148,0xc9))[_0xde87('0x43')](handleError(_0x280148,null));};exports['update']=function(_0x17bbcb,_0x2a2222){if(_0x17bbcb[_0xde87('0x49')]['id']){delete _0x17bbcb[_0xde87('0x49')]['id'];}return db['SmsApplication'][_0xde87('0x47')]({'where':{'id':_0x17bbcb[_0xde87('0x4a')]['id']}})[_0xde87('0x25')](handleEntityNotFound(_0x2a2222,null))[_0xde87('0x25')](saveUpdates(_0x17bbcb[_0xde87('0x49')],null))[_0xde87('0x25')](respondWithResult(_0x2a2222,null))[_0xde87('0x43')](handleError(_0x2a2222,null));};exports[_0xde87('0x26')]=function(_0x946136,_0x5e7490){return db[_0xde87('0x45')][_0xde87('0x47')]({'where':{'id':_0x946136[_0xde87('0x4a')]['id']}})[_0xde87('0x25')](handleEntityNotFound(_0x5e7490,null))[_0xde87('0x25')](removeEntity(_0x5e7490,null))[_0xde87('0x43')](handleError(_0x5e7490,null));}; \ No newline at end of file +var _0x2cad=['undefined','count','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SmsApplication','include','findAll','rows','catch','show','intersection','options','create','body','update','find','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x43f59e,_0x26b413){var _0x431c20=function(_0x277e37){while(--_0x277e37){_0x43f59e['push'](_0x43f59e['shift']());}};_0x431c20(++_0x26b413);}(_0x2cad,0xc4));var _0xd2ca=function(_0x5dace2,_0x2e3de6){_0x5dace2=_0x5dace2-0x0;var _0x1762bf=_0x2cad[_0x5dace2];return _0x1762bf;};'use strict';var emlformat=require(_0xd2ca('0x0'));var rimraf=require(_0xd2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd2ca('0x2'));var rp=require(_0xd2ca('0x3'));var moment=require('moment');var BPromise=require(_0xd2ca('0x4'));var Mustache=require(_0xd2ca('0x5'));var util=require('util');var path=require(_0xd2ca('0x6'));var sox=require('sox');var csv=require(_0xd2ca('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd2ca('0x8'));var _=require('lodash');var squel=require(_0xd2ca('0x9'));var crypto=require(_0xd2ca('0xa'));var jsforce=require(_0xd2ca('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd2ca('0x7'));var querystring=require(_0xd2ca('0xc'));var Papa=require(_0xd2ca('0xd'));var Redis=require(_0xd2ca('0xe'));var authService=require(_0xd2ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd2ca('0x10'));var hardwareService=require(_0xd2ca('0x11'));var logger=require(_0xd2ca('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd2ca('0x13'));var licenseUtil=require(_0xd2ca('0x14'));var db=require(_0xd2ca('0x15'))['db'];function respondWithStatusCode(_0x269971,_0x26ccd9){_0x26ccd9=_0x26ccd9||0xcc;return function(_0x2bc06d){if(_0x2bc06d){return _0x269971[_0xd2ca('0x16')](_0x26ccd9);}return _0x269971['status'](_0x26ccd9)[_0xd2ca('0x17')]();};}function respondWithResult(_0x56a159,_0x9cfc02){_0x9cfc02=_0x9cfc02||0xc8;return function(_0x192db8){if(_0x192db8){return _0x56a159[_0xd2ca('0x18')](_0x9cfc02)['json'](_0x192db8);}};}function respondWithFilteredResult(_0x5e9f29,_0x12f46d){return function(_0x1529f5){if(_0x1529f5){var _0x192b66=typeof _0x12f46d[_0xd2ca('0x19')]===_0xd2ca('0x1a')&&typeof _0x12f46d['limit']==='undefined';var _0x4fb462=_0x1529f5['count'];var _0x5b9614=_0x192b66?0x0:_0x12f46d['offset'];var _0x401c34=_0x192b66?_0x1529f5[_0xd2ca('0x1b')]:_0x12f46d[_0xd2ca('0x19')]+_0x12f46d[_0xd2ca('0x1c')];var _0x373914;if(_0x401c34>=_0x4fb462){_0x401c34=_0x4fb462;_0x373914=0xc8;}else{_0x373914=0xce;}_0x5e9f29[_0xd2ca('0x18')](_0x373914);return _0x5e9f29[_0xd2ca('0x1d')](_0xd2ca('0x1e'),_0x5b9614+'-'+_0x401c34+'/'+_0x4fb462)[_0xd2ca('0x1f')](_0x1529f5);}return null;};}function patchUpdates(_0x164b2c){return function(_0x1b6095){try{jsonpatch[_0xd2ca('0x20')](_0x1b6095,_0x164b2c,!![]);}catch(_0x3aff07){return BPromise[_0xd2ca('0x21')](_0x3aff07);}return _0x1b6095[_0xd2ca('0x22')]();};}function saveUpdates(_0x205469,_0xf3fc19){return function(_0x233c92){if(_0x233c92){return _0x233c92['update'](_0x205469)[_0xd2ca('0x23')](function(_0x3f7d5a){return _0x3f7d5a;});}return null;};}function removeEntity(_0x62f21c,_0x548fa1){return function(_0x588416){if(_0x588416){return _0x588416['destroy']()[_0xd2ca('0x23')](function(){_0x62f21c[_0xd2ca('0x18')](0xcc)[_0xd2ca('0x17')]();});}};}function handleEntityNotFound(_0x570a42,_0x5f1502){return function(_0x1b64d5){if(!_0x1b64d5){_0x570a42[_0xd2ca('0x16')](0x194);}return _0x1b64d5;};}function handleError(_0x29b516,_0x55c39a){_0x55c39a=_0x55c39a||0x1f4;return function(_0x2e6ee7){logger[_0xd2ca('0x24')](_0x2e6ee7[_0xd2ca('0x25')]);if(_0x2e6ee7[_0xd2ca('0x26')]){delete _0x2e6ee7['name'];}_0x29b516[_0xd2ca('0x18')](_0x55c39a)[_0xd2ca('0x27')](_0x2e6ee7);};}exports['index']=function(_0x15b218,_0x28587e){var _0x5ded7f={},_0x113917={},_0x392be7={'count':0x0,'rows':[]};var _0x2bcbeb=_[_0xd2ca('0x28')](db['SmsApplication'][_0xd2ca('0x29')],function(_0x34b8f4){return{'name':_0x34b8f4[_0xd2ca('0x2a')],'type':_0x34b8f4['type'][_0xd2ca('0x2b')]};});_0x113917[_0xd2ca('0x2c')]=_['map'](_0x2bcbeb,_0xd2ca('0x26'));_0x113917[_0xd2ca('0x2d')]=_[_0xd2ca('0x2e')](_0x15b218['query']);_0x113917[_0xd2ca('0x2f')]=_['intersection'](_0x113917[_0xd2ca('0x2c')],_0x113917[_0xd2ca('0x2d')]);_0x5ded7f['attributes']=_['intersection'](_0x113917[_0xd2ca('0x2c')],qs[_0xd2ca('0x30')](_0x15b218[_0xd2ca('0x2d')][_0xd2ca('0x30')]));_0x5ded7f['attributes']=_0x5ded7f['attributes'][_0xd2ca('0x31')]?_0x5ded7f[_0xd2ca('0x32')]:_0x113917[_0xd2ca('0x2c')];if(!_0x15b218[_0xd2ca('0x2d')][_0xd2ca('0x33')](_0xd2ca('0x34'))){_0x5ded7f[_0xd2ca('0x1c')]=qs[_0xd2ca('0x1c')](_0x15b218['query'][_0xd2ca('0x1c')]);_0x5ded7f[_0xd2ca('0x19')]=qs[_0xd2ca('0x19')](_0x15b218[_0xd2ca('0x2d')][_0xd2ca('0x19')]);}_0x5ded7f[_0xd2ca('0x35')]=qs[_0xd2ca('0x36')](_0x15b218[_0xd2ca('0x2d')]['sort']);_0x5ded7f[_0xd2ca('0x37')]=qs['filters'](_[_0xd2ca('0x38')](_0x15b218[_0xd2ca('0x2d')],_0x113917[_0xd2ca('0x2f')]),_0x2bcbeb);if(_0x15b218[_0xd2ca('0x2d')][_0xd2ca('0x39')]){_0x5ded7f['where']=_[_0xd2ca('0x3a')](_0x5ded7f[_0xd2ca('0x37')],{'$or':_[_0xd2ca('0x28')](_0x2bcbeb,function(_0x4a41b9){if(_0x4a41b9['type']!==_0xd2ca('0x3b')){var _0x534aa6={};_0x534aa6[_0x4a41b9[_0xd2ca('0x26')]]={'$like':'%'+_0x15b218[_0xd2ca('0x2d')][_0xd2ca('0x39')]+'%'};return _0x534aa6;}})});}_0x5ded7f=_[_0xd2ca('0x3a')]({},_0x5ded7f,_0x15b218['options']);var _0x451ce2={'where':_0x5ded7f[_0xd2ca('0x37')]};return db[_0xd2ca('0x3c')][_0xd2ca('0x1b')](_0x451ce2)[_0xd2ca('0x23')](function(_0x5cddaf){_0x392be7[_0xd2ca('0x1b')]=_0x5cddaf;if(_0x15b218[_0xd2ca('0x2d')]['includeAll']){_0x5ded7f[_0xd2ca('0x3d')]=[{'all':!![]}];}return db[_0xd2ca('0x3c')][_0xd2ca('0x3e')](_0x5ded7f);})[_0xd2ca('0x23')](function(_0x52d90f){_0x392be7[_0xd2ca('0x3f')]=_0x52d90f;return _0x392be7;})[_0xd2ca('0x23')](respondWithFilteredResult(_0x28587e,_0x5ded7f))[_0xd2ca('0x40')](handleError(_0x28587e,null));};exports[_0xd2ca('0x41')]=function(_0x16eb2a,_0x1ce52c){var _0x396d4d={'raw':!![],'where':{'id':_0x16eb2a['params']['id']}},_0x48f555={};_0x48f555[_0xd2ca('0x2c')]=_['keys'](db[_0xd2ca('0x3c')][_0xd2ca('0x29')]);_0x48f555[_0xd2ca('0x2d')]=_[_0xd2ca('0x2e')](_0x16eb2a['query']);_0x48f555['filters']=_[_0xd2ca('0x42')](_0x48f555[_0xd2ca('0x2c')],_0x48f555[_0xd2ca('0x2d')]);_0x396d4d[_0xd2ca('0x32')]=_[_0xd2ca('0x42')](_0x48f555[_0xd2ca('0x2c')],qs[_0xd2ca('0x30')](_0x16eb2a[_0xd2ca('0x2d')]['fields']));_0x396d4d[_0xd2ca('0x32')]=_0x396d4d['attributes'][_0xd2ca('0x31')]?_0x396d4d[_0xd2ca('0x32')]:_0x48f555['model'];if(_0x16eb2a[_0xd2ca('0x2d')]['includeAll']){_0x396d4d[_0xd2ca('0x3d')]=[{'all':!![]}];}_0x396d4d=_['merge']({},_0x396d4d,_0x16eb2a[_0xd2ca('0x43')]);return db['SmsApplication']['find'](_0x396d4d)['then'](handleEntityNotFound(_0x1ce52c,null))[_0xd2ca('0x23')](respondWithResult(_0x1ce52c,null))[_0xd2ca('0x40')](handleError(_0x1ce52c,null));};exports[_0xd2ca('0x44')]=function(_0x5d0a36,_0x365fc8){return db['SmsApplication'][_0xd2ca('0x44')](_0x5d0a36[_0xd2ca('0x45')],{})[_0xd2ca('0x23')](respondWithResult(_0x365fc8,0xc9))['catch'](handleError(_0x365fc8,null));};exports[_0xd2ca('0x46')]=function(_0x1b414f,_0x140dfa){if(_0x1b414f[_0xd2ca('0x45')]['id']){delete _0x1b414f[_0xd2ca('0x45')]['id'];}return db[_0xd2ca('0x3c')][_0xd2ca('0x47')]({'where':{'id':_0x1b414f[_0xd2ca('0x48')]['id']}})[_0xd2ca('0x23')](handleEntityNotFound(_0x140dfa,null))[_0xd2ca('0x23')](saveUpdates(_0x1b414f[_0xd2ca('0x45')],null))[_0xd2ca('0x23')](respondWithResult(_0x140dfa,null))[_0xd2ca('0x40')](handleError(_0x140dfa,null));};exports[_0xd2ca('0x49')]=function(_0x3cb131,_0x1678c7){return db[_0xd2ca('0x3c')]['find']({'where':{'id':_0x3cb131[_0xd2ca('0x48')]['id']}})[_0xd2ca('0x23')](handleEntityNotFound(_0x1678c7,null))['then'](removeEntity(_0x1678c7,null))[_0xd2ca('0x40')](handleError(_0x1678c7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index b971be3..106fcca 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 _0x7497=['../../config/environment','exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x17149c,_0xe8ce82){var _0x451cea=function(_0xf1cd37){while(--_0xf1cd37){_0x17149c['push'](_0x17149c['shift']());}};_0x451cea(++_0xe8ce82);}(_0x7497,0xef));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var logger=require(_0x7749('0x2'))(_0x7749('0x3'));var moment=require(_0x7749('0x4'));var BPromise=require(_0x7749('0x5'));var rp=require(_0x7749('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7749('0x7'));var config=require(_0x7749('0x8'));var attributes=require('./smsApplication.attributes');module[_0x7749('0x9')]=function(_0x5a458e,_0x59e560){return _0x5a458e['define'](_0x7749('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7749('0xb'),'collate':_0x7749('0xc')});}; \ No newline at end of file +var _0xcb73=['moment','path','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x272146,_0x54b704){var _0x1940f2=function(_0x2391fe){while(--_0x2391fe){_0x272146['push'](_0x272146['shift']());}};_0x1940f2(++_0x54b704);}(_0xcb73,0xf9));var _0x3cb7=function(_0x1cd625,_0x283aeb){_0x1cd625=_0x1cd625-0x0;var _0x249a0e=_0xcb73[_0x1cd625];return _0x249a0e;};'use strict';var _=require(_0x3cb7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3cb7('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cb7('0x2'));var rimraf=require('rimraf');var config=require(_0x3cb7('0x3'));var attributes=require(_0x3cb7('0x4'));module[_0x3cb7('0x5')]=function(_0x3510af,_0x2dcf1c){return _0x3510af[_0x3cb7('0x6')]('SmsApplication',attributes,{'tableName':_0x3cb7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3cb7('0x8'),'collate':_0x3cb7('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 8615de9..b58a891 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(_0x2be2d3,_0xbe4083){var _0x386e0e=function(_0x2e9ea0){while(--_0x2e9ea0){_0x2be2d3['push'](_0x2be2d3['shift']());}};_0x386e0e(++_0xbe4083);}(_0x881e,0x146));var _0xe881=function(_0x3cef58,_0x32225b){_0x3cef58=_0x3cef58-0x0;var _0x2c33f3=_0x881e[_0x3cef58];return _0x2c33f3;};'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 _0x110e=['ioredis','../../mysqldb','../../config/utils','client','request','then','info','request\x20sent','debug','stringify','error','message','SmsApplication,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring'];(function(_0x382868,_0xb5acfd){var _0x43e191=function(_0x5b4a71){while(--_0x5b4a71){_0x382868['push'](_0x382868['shift']());}};_0x43e191(++_0xb5acfd);}(_0x110e,0x68));var _0xe110=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x110e[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var moment=require('moment');var BPromise=require(_0xe110('0x2'));var rs=require(_0xe110('0x3'));var fs=require('fs');var Redis=require(_0xe110('0x4'));var db=require(_0xe110('0x5'))['db'];var utils=require(_0xe110('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe110('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd83c,_0x1ebbac,_0x2b69c5){return new BPromise(function(_0x23c5ae,_0x44050a){return client[_0xe110('0x8')](_0x3dd83c,_0x2b69c5)[_0xe110('0x9')](function(_0x3c194a){logger[_0xe110('0xa')]('SmsApplication,\x20%s,\x20%s',_0x1ebbac,_0xe110('0xb'));logger[_0xe110('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x1ebbac,_0xe110('0xb'),JSON[_0xe110('0xd')](_0x3c194a));if(_0x3c194a[_0xe110('0xe')]){if(_0x3c194a[_0xe110('0xe')]['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x1ebbac,_0x3c194a[_0xe110('0xe')][_0xe110('0xf')]);return _0x44050a(_0x3c194a['error']['message']);}logger['error'](_0xe110('0x10'),_0x1ebbac,_0x3c194a[_0xe110('0xe')]['message']);return _0x23c5ae(_0x3c194a['error'][_0xe110('0xf')]);}else{logger['info'](_0xe110('0x10'),_0x1ebbac,_0xe110('0xb'));_0x23c5ae(_0x3c194a[_0xe110('0x11')][_0xe110('0xf')]);}})['catch'](function(_0xa23c0c){logger[_0xe110('0xe')]('SmsApplication,\x20%s,\x20%s',_0x1ebbac,_0xa23c0c);_0x44050a(_0xa23c0c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 2400a84..a14d0f7 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(_0x27657c,_0x36813e){var _0x12324a=function(_0x3f6eea){while(--_0x3f6eea){_0x27657c['push'](_0x27657c['shift']());}};_0x12324a(++_0x36813e);}(_0x8603,0x190));var _0x3860=function(_0x3f6834,_0x62927e){_0x3f6834=_0x3f6834-0x0;var _0x2b830d=_0x8603[_0x3f6834];return _0x2b830d;};'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 _0x93e9=['update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x3533b2,_0x2a7c0e){var _0x3b8997=function(_0x1f3ae6){while(--_0x1f3ae6){_0x3533b2['push'](_0x3533b2['shift']());}};_0x3b8997(++_0x2a7c0e);}(_0x93e9,0xcc));var _0x993e=function(_0xcd6e0f,_0x1e32d7){_0xcd6e0f=_0xcd6e0f-0x0;var _0x5466f8=_0x93e9[_0xcd6e0f];return _0x5466f8;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getMessages']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x993e('0x11')]('/',auth['isAuthenticated'](),controller[_0x993e('0x12')]);router['post']('/:id/messages',auth[_0x993e('0xa')](),controller[_0x993e('0x13')]);router[_0x993e('0x11')](_0x993e('0x14'),auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x17')),controller[_0x993e('0x18')]);router[_0x993e('0x19')](_0x993e('0xd'),auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x1a')),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')]('/:id',auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x1d')),controller[_0x993e('0x1e')]);router[_0x993e('0x1c')]('/:id/tags',auth[_0x993e('0xa')](),controller[_0x993e('0x1f')]);module[_0x993e('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 163355d..14da2a5 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 _0x36b2=['ENUM','out','BOOLEAN','sequelize','moment','exports','DATE','STRING'];(function(_0x5b2b34,_0xe14d30){var _0x31db59=function(_0xfdb941){while(--_0xfdb941){_0x5b2b34['push'](_0x5b2b34['shift']());}};_0x31db59(++_0xe14d30);}(_0x36b2,0x6b));var _0x236b=function(_0x42be2f,_0x4cab51){_0x42be2f=_0x42be2f-0x0;var _0x298acf=_0x36b2[_0x42be2f];return _0x298acf;};'use strict';var Sequelize=require(_0x236b('0x0'));var moment=require(_0x236b('0x1'));module[_0x236b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x236b('0x3')]},'disposition':{'type':Sequelize[_0x236b('0x4')]},'secondDisposition':{'type':Sequelize[_0x236b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x236b('0x4')]},'phone':{'type':Sequelize[_0x236b('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x236b('0x5')]('in',_0x236b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x236b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x236b('0x5')]('in',_0x236b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x236b('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x31af=['exports','STRING','DATE','out','ENUM','sequelize','moment'];(function(_0x2dc91f,_0x15f5e8){var _0x226177=function(_0x293d0f){while(--_0x293d0f){_0x2dc91f['push'](_0x2dc91f['shift']());}};_0x226177(++_0x15f5e8);}(_0x31af,0xde));var _0xf31a=function(_0x13d446,_0x3ba257){_0x13d446=_0x13d446-0x0;var _0x165c8c=_0x31af[_0x13d446];return _0x165c8c;};'use strict';var Sequelize=require(_0xf31a('0x0'));var moment=require(_0xf31a('0x1'));module[_0xf31a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf31a('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf31a('0x3')]},'note':{'type':Sequelize[_0xf31a('0x3')]},'phone':{'type':Sequelize[_0xf31a('0x3')]},'read1stAt':{'type':Sequelize[_0xf31a('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf31a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf31a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf31a('0x6')]('in',_0xf31a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 391ca14..0d374d6 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 _0xa6c4=['mkdirSync','Sms','Owner','closedAt','disposition','Messages','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','stack','name','send','Users','fullname','TagIds','Tags','push','then','catch','index','map','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','pick','field','color','from','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_messages','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','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','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`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?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','order','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','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','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','include','options','create','body','update','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','sort','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','Tag','smsInteractionTags:save','removeTags','download','unix','join','files','root','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','direction','secret','SmsAccount','Account'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6c4,0x1da));var _0x4a6c=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xa6c4[_0x3ff685];return _0x2046c9;};'use strict';var emlformat=require(_0x4a6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a6c('0x1'));var jsonpatch=require(_0x4a6c('0x2'));var rp=require(_0x4a6c('0x3'));var moment=require(_0x4a6c('0x4'));var BPromise=require(_0x4a6c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a6c('0x6'));var sox=require(_0x4a6c('0x7'));var csv=require('to-csv');var ejs=require(_0x4a6c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4a6c('0x9'));var jsforce=require(_0x4a6c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4a6c('0xb'));var querystring=require(_0x4a6c('0xc'));var Papa=require(_0x4a6c('0xd'));var Redis=require('ioredis');var authService=require(_0x4a6c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4a6c('0xf'));var hardwareService=require(_0x4a6c('0x10'));var logger=require(_0x4a6c('0x11'))(_0x4a6c('0x12'));var utils=require(_0x4a6c('0x13'));var config=require(_0x4a6c('0x14'));var licenseUtil=require(_0x4a6c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4a6c('0x16')](config[_0x4a6c('0x17')],{'host':_0x4a6c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a6c('0x17')]));require(_0x4a6c('0x19'))['register'](socket);function respondWithStatusCode(_0xc1e66f,_0x385b2a){_0x385b2a=_0x385b2a||0xcc;return function(_0x3f41bc){if(_0x3f41bc){return _0xc1e66f[_0x4a6c('0x1a')](_0x385b2a);}return _0xc1e66f[_0x4a6c('0x1b')](_0x385b2a)[_0x4a6c('0x1c')]();};}function respondWithResult(_0x3b15b3,_0x5c5204){_0x5c5204=_0x5c5204||0xc8;return function(_0x19d8b8){if(_0x19d8b8){return _0x3b15b3[_0x4a6c('0x1b')](_0x5c5204)[_0x4a6c('0x1d')](_0x19d8b8);}};}function respondWithFilteredResult(_0x16f6ef,_0x17896f){return function(_0x3e4e2b){if(_0x3e4e2b){var _0xe27609=typeof _0x17896f[_0x4a6c('0x1e')]===_0x4a6c('0x1f')&&typeof _0x17896f['limit']===_0x4a6c('0x1f');var _0x575295=_0x3e4e2b[_0x4a6c('0x20')];var _0x2dfeb8=_0xe27609?0x0:_0x17896f[_0x4a6c('0x1e')];var _0x1245f8=_0xe27609?_0x3e4e2b[_0x4a6c('0x20')]:_0x17896f[_0x4a6c('0x1e')]+_0x17896f[_0x4a6c('0x21')];var _0xf53d4;if(_0x1245f8>=_0x575295){_0x1245f8=_0x575295;_0xf53d4=0xc8;}else{_0xf53d4=0xce;}_0x16f6ef['status'](_0xf53d4);return _0x16f6ef['set'](_0x4a6c('0x22'),_0x2dfeb8+'-'+_0x1245f8+'/'+_0x575295)['json'](_0x3e4e2b);}return null;};}function patchUpdates(_0x26524f){return function(_0x3d4eb2){try{jsonpatch[_0x4a6c('0x23')](_0x3d4eb2,_0x26524f,!![]);}catch(_0x14d0c6){return BPromise['reject'](_0x14d0c6);}return _0x3d4eb2[_0x4a6c('0x24')]();};}function saveUpdates(_0x5336ac,_0x5f1bf1){return function(_0x44e24c){if(_0x44e24c){return _0x44e24c['update'](_0x5336ac)['then'](function(_0x1b95a5){return _0x1b95a5;});}return null;};}function removeEntity(_0x5e4590,_0x5afab4){return function(_0x501af9){if(_0x501af9){return _0x501af9['destroy']()['then'](function(){_0x5e4590['status'](0xcc)[_0x4a6c('0x1c')]();});}};}function handleEntityNotFound(_0x5a7996,_0x305f17){return function(_0x62d5ae){if(!_0x62d5ae){_0x5a7996['sendStatus'](0x194);}return _0x62d5ae;};}function handleError(_0x4505a7,_0x1f730f){_0x1f730f=_0x1f730f||0x1f4;return function(_0x4c1bb3){logger['error'](_0x4c1bb3[_0x4a6c('0x25')]);if(_0x4c1bb3[_0x4a6c('0x26')]){delete _0x4c1bb3[_0x4a6c('0x26')];}_0x4505a7[_0x4a6c('0x1b')](_0x1f730f)[_0x4a6c('0x27')](_0x4c1bb3);};}function getInteractionUsers(_0x1333e9,_0x4071cd){return new BPromise(function(_0x518a53,_0x522d36){try{if(_0x4071cd[_0x1333e9['id']]){_0x1333e9[_0x4a6c('0x28')]=_['map'](_0x4071cd[_0x1333e9['id']],function(_0x4d31a4){return{'id':_0x4d31a4['id'],'fullname':_0x4d31a4[_0x4a6c('0x29')]};});}}catch(_0x1fbe6e){_0x522d36(_0x1fbe6e);}_0x518a53(_0x1333e9);});}function getInteractionTags(_0xbc6546,_0x26e4e7){return new BPromise(function(_0x4727e5,_0x4d89c2){try{if(_0xbc6546[_0x4a6c('0x2a')]){_0xbc6546[_0x4a6c('0x2b')]=[];_0xbc6546[_0x4a6c('0x2a')]['split'](',')['forEach'](function(_0x4c4506){_0xbc6546[_0x4a6c('0x2b')][_0x4a6c('0x2c')](_0x26e4e7[_0x4c4506]);});}delete _0xbc6546['TagIds'];}catch(_0x5ae835){_0x4d89c2(_0x5ae835);}_0x4727e5(_0xbc6546);});}function updateSmsInteraction(_0x1caa0e,_0x37fdd0,_0x1fbbd6){return new BPromise(function(_0x51f0ad,_0x1b4492){return getInteractionUsers(_0x1caa0e,_0x1fbbd6)[_0x4a6c('0x2d')](function(_0x3a4958){return getInteractionTags(_0x3a4958,_0x37fdd0);})[_0x4a6c('0x2d')](function(_0x1d3eca){_0x51f0ad(_0x1d3eca);})[_0x4a6c('0x2e')](function(_0x4d563f){_0x1b4492(_0x4d563f);});});}exports[_0x4a6c('0x2f')]=function(_0xbc3fad,_0x4b4dbd){var _0xfd1356={},_0x1cf186={},_0x1ffe48={'count':0x0,'rows':[]};var _0x540731=_[_0x4a6c('0x30')](db[_0x4a6c('0x31')][_0x4a6c('0x32')],function(_0x5b48af){return{'name':_0x5b48af[_0x4a6c('0x33')],'type':_0x5b48af[_0x4a6c('0x34')][_0x4a6c('0x35')]};});_0x1cf186['model']=_[_0x4a6c('0x30')](_0x540731,_0x4a6c('0x26'));_0x1cf186[_0x4a6c('0x36')]=_[_0x4a6c('0x37')](_0xbc3fad['query']);_0x1cf186[_0x4a6c('0x38')]=_[_0x4a6c('0x39')](_0x1cf186[_0x4a6c('0x3a')],_0x1cf186[_0x4a6c('0x36')]);_0xfd1356[_0x4a6c('0x3b')]=_[_0x4a6c('0x39')](_0x1cf186[_0x4a6c('0x3a')],qs[_0x4a6c('0x3c')](_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x3c')]));_0xfd1356[_0x4a6c('0x3b')]=_0xfd1356[_0x4a6c('0x3b')][_0x4a6c('0x3d')]?_0xfd1356[_0x4a6c('0x3b')]:_0x1cf186[_0x4a6c('0x3a')];if(!_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x3e')](_0x4a6c('0x3f'))){_0xfd1356['limit']=qs['limit'](_0xbc3fad[_0x4a6c('0x36')]['limit']);_0xfd1356['offset']=qs[_0x4a6c('0x1e')](_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x1e')]);}_0xfd1356['order']=qs['sort'](_0xbc3fad[_0x4a6c('0x36')]['sort']);_0xfd1356['where']=qs[_0x4a6c('0x38')](_[_0x4a6c('0x40')](_0xbc3fad['query'],_0x1cf186[_0x4a6c('0x38')]),_0x540731);var _0x37abfc=[];var _0x22144d=squel['select']()[_0x4a6c('0x41')]('id')[_0x4a6c('0x41')]('name')[_0x4a6c('0x41')](_0x4a6c('0x42'))[_0x4a6c('0x43')](_0x4a6c('0x44'));var _0x595b0b=squel[_0x4a6c('0x45')]()[_0x4a6c('0x41')]('u.id')[_0x4a6c('0x41')](_0x4a6c('0x46'))['field'](_0x4a6c('0x47'))[_0x4a6c('0x43')](_0x4a6c('0x48'),'ui')['left_join'](_0x4a6c('0x49'),'u',_0x4a6c('0x4a'));var _0x4266cd=squel['select']()[_0x4a6c('0x43')]('sms_interactions','i')[_0x4a6c('0x4b')](_0x4a6c('0x4c'),'c',_0x4a6c('0x4d'))[_0x4a6c('0x4b')](_0x4a6c('0x49'),'o',_0x4a6c('0x4e'))[_0x4a6c('0x4b')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0x4a6c('0x4b')](_0x4a6c('0x4f'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join']('sms_interaction_has_tags','it',_0x4a6c('0x50'))['left_join'](_0x4a6c('0x44'),'t',_0x4a6c('0x51'));var _0x5afeb0=squel['expr']();var _0x8d9243=[];var _0x6d0703=squel[_0x4a6c('0x52')]();var _0x813868;if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x53')]){_0x813868=as[_0x4a6c('0x54')](_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x53')]);var _0x412ba4=_0x813868[_0x4a6c('0x55')];for(var _0x2ab081=0x0;_0x2ab081<_0x813868[_0x4a6c('0x56')][_0x4a6c('0x3d')];_0x2ab081++){var _0x55ed45=_0x813868[_0x4a6c('0x56')][_0x2ab081];var _0x407567='i';var _0x21b069=_[_0x4a6c('0x57')](_0x540731,['name',_0x55ed45[_0x4a6c('0x41')]]);if(!_0x21b069){switch(_0x55ed45['field']){case _0x4a6c('0x58'):if(_0x55ed45[_0x4a6c('0x59')]==0x1){_0x4266cd[_0x4a6c('0x5a')]('`'+_0x55ed45[_0x4a6c('0x41')]+'`\x20=\x200');}else{_0x4266cd[_0x4a6c('0x5a')]('`'+_0x55ed45[_0x4a6c('0x41')]+_0x4a6c('0x5b'));}break;case _0x4a6c('0x5c'):if(_0x55ed45[_0x4a6c('0x5d')]==='$substring'){if(_0x55ed45['value'][_0x4a6c('0x5e')]('\x20')[_0x4a6c('0x3d')]>0x1){_0x5afeb0[_0x412ba4](_0x4a6c('0x5f'),qs[_0x4a6c('0x60')](_0x55ed45['value']),null);}else{var _0x230cb8='%'+_0x55ed45['value']+'%';_0x5afeb0[_0x412ba4](_0x4a6c('0x61'),_0x230cb8,_0x230cb8,_0x230cb8);}}else{_0x21b069=_['find'](_0x540731,['name',_0x4a6c('0x62')]);_0x55ed45[_0x4a6c('0x41')]=_0x4a6c('0x62');_0x227602=as[_0x4a6c('0x63')](_0x407567,_0x21b069['type'],_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')]['start'],_0x227602[_0x4a6c('0x59')]['end']);}break;case'Tag':var _0x181ff6=_0x55ed45[_0x4a6c('0x59')][_0x4a6c('0x5e')](',')[_0x4a6c('0x30')](function(_0x4bebce){return Number(_0x4bebce);});_0x181ff6[_0x4a6c('0x65')](function(_0x2bb40c){_0x6d0703['or'](_0x4a6c('0x66'),'%,'+_0x2bb40c+',%');});_0x8d9243=_[_0x4a6c('0x67')](_0x8d9243,_0x181ff6);break;case'User':if(_0x55ed45[_0x4a6c('0x5d')]===_0x4a6c('0x68')){_0x5afeb0[_0x412ba4](_0x4a6c('0x69'),'%'+_0x55ed45[_0x4a6c('0x59')]+'%',null);}else{_0x21b069=_['find'](_0x540731,[_0x4a6c('0x26'),_0x4a6c('0x6a')]);_0x55ed45[_0x4a6c('0x41')]=_0x4a6c('0x6a');_0x227602=as[_0x4a6c('0x63')](_0x407567,_0x21b069[_0x4a6c('0x34')],_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')]['start'],_0x227602[_0x4a6c('0x59')][_0x4a6c('0x1c')]);}break;case'body':_0x227602=as[_0x4a6c('0x63')]('me',null,_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')]['start'],_0x227602[_0x4a6c('0x59')][_0x4a6c('0x1c')]);break;}}else{var _0x227602=as[_0x4a6c('0x63')](_0x407567,_0x21b069[_0x4a6c('0x34')],_0x55ed45);_0x5afeb0[_0x412ba4](_0x227602[_0x4a6c('0x64')],_0x227602[_0x4a6c('0x59')][_0x4a6c('0x6b')],_0x227602['value']['end']);}}}else{var _0x1da226=_(_0xbc3fad[_0x4a6c('0x36')])['keys']()['map'](function(_0x38be44){return _[_0x4a6c('0x6c')](_0x540731,[_0x4a6c('0x26'),_0x38be44])?_0x38be44:undefined;})['compact']()[_0x4a6c('0x59')]();if(!_[_0x4a6c('0x6d')](_0x1da226)){_0x1da226['forEach'](function(_0x3c78f0){if(_0x3c78f0===_0x4a6c('0x6e')){_0x4266cd['where'](_0x4a6c('0x6f'),[][_0x4a6c('0x70')](_0xbc3fad[_0x4a6c('0x36')][_0x3c78f0]));}else if(_0x3c78f0===_0x4a6c('0x71')){var _0xa32f94=JSON[_0x4a6c('0x72')](_0xbc3fad['query'][_0x3c78f0])[_0x4a6c('0x73')];var _0x4a8674=JSON[_0x4a6c('0x72')](_0xbc3fad[_0x4a6c('0x36')][_0x3c78f0])[_0x4a6c('0x74')];_0x4266cd[_0x4a6c('0x75')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xa32f94,_0x4a8674);}else{if(_0xbc3fad['query'][_0x3c78f0]===_0x4a6c('0x76')){_0x4266cd[_0x4a6c('0x75')]('i.'+_0x3c78f0+_0x4a6c('0x77'));}else{_0x4266cd['where']('i.'+_0x3c78f0+_0x4a6c('0x78'),_0xbc3fad[_0x4a6c('0x36')][_0x3c78f0]);}}});}if(_0xbc3fad[_0x4a6c('0x36')]['read']){if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x79')]==0x1){_0x4266cd[_0x4a6c('0x5a')](_0x4a6c('0x7a'));}else{_0x4266cd[_0x4a6c('0x5a')](_0x4a6c('0x7b'));}}if(_0xbc3fad[_0x4a6c('0x36')]['tag']){_0x8d9243=_['isArray'](_0xbc3fad['query'][_0x4a6c('0x7c')])?_0xbc3fad[_0x4a6c('0x36')]['tag']:new Array(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x7c')]);_0x8d9243[_0x4a6c('0x65')](function(_0x1cce2d){_0x6d0703['or'](_0x4a6c('0x66'),'%,'+_0x1cce2d+',%');});}if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x7d')]){var _0x31ca25=_0xbc3fad['query']['filter'][_0x4a6c('0x7e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x4a6c('0x7f')](_0x31ca25)){_0x5afeb0['or'](_0x4a6c('0x80'),_0x31ca25+'%')['or'](_0x4a6c('0x81'),_0x31ca25+'%');}else{_0x5afeb0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4a6c('0x60')](_0x31ca25))['or'](_0x4a6c('0x82'),_0x31ca25+'%');}}}_0x4266cd[_0x4a6c('0x75')](_0x5afeb0);_0x4266cd['group'](_0x4a6c('0x83'));var _0x44a232={'type':db[_0x4a6c('0x84')][_0x4a6c('0x85')][_0x4a6c('0x86')],'raw':!![]};var _0x4b21f5=_0x4266cd['clone']();_0x4b21f5[_0x4a6c('0x41')](_0x4a6c('0x83'));_0x4b21f5[_0x4a6c('0x41')](_0x4a6c('0x87'),_0x4a6c('0x58'));if(_0xfd1356['order']){_0xfd1356['order'][_0x4a6c('0x65')](function(_0x112070){var _0x3f8ba8=_0x112070[0x0]===_0x4a6c('0x88')?_0x112070[0x0]:'i.'+_0x112070[0x0];_0x4266cd[_0x4a6c('0x89')](_0x3f8ba8,_0x112070[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x8d9243)){_0x4266cd[_0x4a6c('0x5a')](_0x6d0703);_0x4b21f5['where'](_0x4a6c('0x8a'),_0x8d9243);}BPromise[_0x4a6c('0x8b')]()[_0x4a6c('0x2d')](function(){if(!_0x813868){if(_0xbc3fad[_0x4a6c('0x36')]['SmsAccountId'])return;_0x4b21f5[_0x4a6c('0x75')](_0x4a6c('0x8c'));_0x4266cd['where'](_0x4a6c('0x8c'));return;}if(_0xbc3fad[_0x4a6c('0x8d')]['role']!==_0x4a6c('0x8e'))return;return _0xbc3fad[_0x4a6c('0x8d')][_0x4a6c('0x8f')]({'attributes':['id'],'raw':!![]})[_0x4a6c('0x2d')](function(_0x1f79ef){if(_[_0x4a6c('0x6d')](_0x1f79ef)){_0x4b21f5[_0x4a6c('0x75')]('i.SmsAccountId\x20IS\x20NULL');_0x4266cd[_0x4a6c('0x75')](_0x4a6c('0x90'));}else{_0x4b21f5[_0x4a6c('0x75')](_0x4a6c('0x6f'),_['map'](_0x1f79ef,'id'));_0x4266cd[_0x4a6c('0x75')](_0x4a6c('0x6f'),_[_0x4a6c('0x30')](_0x1f79ef,'id'));}});})[_0x4a6c('0x2d')](function(){if(_0xbc3fad[_0x4a6c('0x8d')][_0x4a6c('0x91')]==='agent'&&!_0x813868&&!_0xbc3fad['query'][_0x4a6c('0x6e')])return[];return db[_0x4a6c('0x92')][_0x4a6c('0x36')](_0x4b21f5[_0x4a6c('0x93')](),_0x44a232);})[_0x4a6c('0x2d')](function(_0x5df52b){_0x1ffe48[_0x4a6c('0x20')]=_0x5df52b[_0x4a6c('0x3d')];if(_0x1ffe48[_0x4a6c('0x20')]===0x0)return[];return db[_0x4a6c('0x92')][_0x4a6c('0x36')](_0x22144d[_0x4a6c('0x93')](),_0x44a232)[_0x4a6c('0x2d')](function(_0x2ce3e){_0x37abfc=_[_0x4a6c('0x94')](_0x2ce3e,'id');_0x44a232=_[_0x4a6c('0x95')](_0x44a232,{'model':db[_0x4a6c('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbc3fad[_0x4a6c('0x36')][_0x4a6c('0x3c')]){_0xfd1356[_0x4a6c('0x3b')][_0x4a6c('0x65')](function(_0x460d72){_0x4266cd[_0x4a6c('0x41')]('i.'+_0x460d72);});}else{_0x4266cd['field'](_0x4a6c('0x87'),_0x4a6c('0x58'));_0x4266cd['field'](_0x4a6c('0x96'),_0x4a6c('0x97'));_0x4266cd['field'](_0x4a6c('0x98'),_0x4a6c('0x99'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9a'),_0x4a6c('0x88'));_0x4266cd[_0x4a6c('0x41')]('i.*');_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9b'),_0x4a6c('0x9c'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9d'),_0x4a6c('0x9e'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0x9f'),'Contact.email');_0x4266cd['field'](_0x4a6c('0xa0'),_0x4a6c('0xa1'));_0x4266cd[_0x4a6c('0x41')]('c.mobile',_0x4a6c('0xa2'));_0x4266cd['field'](_0x4a6c('0xa3'),_0x4a6c('0xa4'));_0x4266cd['field']('o.fullname','Owner.fullname');_0x4266cd['field'](_0x4a6c('0xa5'),_0x4a6c('0xa6'));_0x4266cd[_0x4a6c('0x41')](_0x4a6c('0xa7'),_0x4a6c('0x2a'));}if(_0xfd1356[_0x4a6c('0x21')])_0x4266cd[_0x4a6c('0x21')](_0xfd1356[_0x4a6c('0x21')]);if(_0xfd1356['offset'])_0x4266cd[_0x4a6c('0x1e')](_0xfd1356[_0x4a6c('0x1e')]);return db['sequelize'][_0x4a6c('0x36')](_0x4266cd[_0x4a6c('0x93')](),_0x44a232);})[_0x4a6c('0x2d')](function(_0x46d007){if(_0x46d007['length']>0x0)_0x595b0b[_0x4a6c('0x75')](_0x4a6c('0xa8'),_[_0x4a6c('0x30')](_0x46d007,'id'));return db[_0x4a6c('0x92')]['query'](_0x595b0b[_0x4a6c('0x93')](),_0x44a232)[_0x4a6c('0x2d')](function(_0x4f64c7){var _0x3fbf59=_[_0x4a6c('0xa9')](_0x4f64c7,_0x4a6c('0xaa'));var _0x59f05c=[];_0x46d007['forEach'](function(_0x55b65c){_0x59f05c[_0x4a6c('0x2c')](updateSmsInteraction(_0x55b65c,_0x37abfc,_0x3fbf59));});return BPromise[_0x4a6c('0xab')](_0x59f05c);});});})[_0x4a6c('0x2d')](function(_0x32491a){_0x1ffe48[_0x4a6c('0xac')]=_0x32491a;return _0x1ffe48;})['then'](respondWithFilteredResult(_0x4b4dbd,_0xfd1356))[_0x4a6c('0x2e')](handleError(_0x4b4dbd,null));};exports[_0x4a6c('0xad')]=function(_0x4454be,_0xdb4519){var _0x1e5cce={'raw':![],'where':{'id':_0x4454be[_0x4a6c('0xae')]['id']}},_0x3bfe50={};_0x3bfe50[_0x4a6c('0x3a')]=_[_0x4a6c('0x37')](db[_0x4a6c('0x31')][_0x4a6c('0x32')]);_0x3bfe50[_0x4a6c('0x36')]=_[_0x4a6c('0x37')](_0x4454be['query']);_0x3bfe50[_0x4a6c('0x38')]=_[_0x4a6c('0x39')](_0x3bfe50[_0x4a6c('0x3a')],_0x3bfe50[_0x4a6c('0x36')]);_0x1e5cce[_0x4a6c('0x3b')]=_['intersection'](_0x3bfe50[_0x4a6c('0x3a')],qs['fields'](_0x4454be['query']['fields']));_0x1e5cce['attributes']=_0x1e5cce['attributes']['length']?_0x1e5cce[_0x4a6c('0x3b')]:_0x3bfe50[_0x4a6c('0x3a')];if(_0x4454be['query']['includeAll']){_0x1e5cce[_0x4a6c('0xaf')]=[{'all':!![]}];}_0x1e5cce=_[_0x4a6c('0x95')]({},_0x1e5cce,_0x4454be[_0x4a6c('0xb0')]);return db[_0x4a6c('0x31')][_0x4a6c('0x57')](_0x1e5cce)[_0x4a6c('0x2d')](handleEntityNotFound(_0xdb4519,null))[_0x4a6c('0x2d')](respondWithResult(_0xdb4519,null))[_0x4a6c('0x2e')](handleError(_0xdb4519,null));};exports[_0x4a6c('0xb1')]=function(_0x2f8be3,_0xecb04b){return db[_0x4a6c('0x31')]['create'](_0x2f8be3[_0x4a6c('0xb2')],{})[_0x4a6c('0x2d')](respondWithResult(_0xecb04b,0xc9))['catch'](handleError(_0xecb04b,null));};exports[_0x4a6c('0xb3')]=function(_0x32d2e0,_0x14f3e4){if(_0x32d2e0[_0x4a6c('0xb2')]['id']){delete _0x32d2e0[_0x4a6c('0xb2')]['id'];}return db[_0x4a6c('0x31')][_0x4a6c('0x57')]({'where':{'id':_0x32d2e0['params']['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x14f3e4,null))[_0x4a6c('0x2d')](saveUpdates(_0x32d2e0[_0x4a6c('0xb2')],null))['then'](respondWithResult(_0x14f3e4,null))[_0x4a6c('0x2e')](handleError(_0x14f3e4,null));};exports[_0x4a6c('0xb4')]=function(_0x499a53,_0x235efc){return db[_0x4a6c('0x31')]['find']({'where':{'id':_0x499a53[_0x4a6c('0xae')]['id']}})['then'](handleEntityNotFound(_0x235efc,null))[_0x4a6c('0x2d')](removeEntity(_0x235efc,null))[_0x4a6c('0x2e')](handleError(_0x235efc,null));};exports[_0x4a6c('0xb5')]=function(_0x1a90ef,_0x2579b5){return db[_0x4a6c('0x31')][_0x4a6c('0xb5')]()[_0x4a6c('0x2d')](respondWithResult(_0x2579b5,null))[_0x4a6c('0x2e')](handleError(_0x2579b5,null));};exports[_0x4a6c('0xb6')]=function(_0x2b01d6,_0x29b2dd,_0x383c8c){return db[_0x4a6c('0xb7')]['find']({'where':{'id':_0x2b01d6[_0x4a6c('0xae')]['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x29b2dd,null))[_0x4a6c('0x2d')](function(_0x7b3d07){if(_0x7b3d07){return _0x7b3d07[_0x4a6c('0xb6')](_0x2b01d6[_0x4a6c('0xb2')][_0x4a6c('0xb8')],_['omit'](_0x2b01d6[_0x4a6c('0xb2')],[_0x4a6c('0xb8'),'id'])||{});}})[_0x4a6c('0x2d')](respondWithResult(_0x29b2dd,null))[_0x4a6c('0x2e')](handleError(_0x29b2dd,null));};exports[_0x4a6c('0xb9')]=function(_0xdc7408,_0x4cbc9d,_0x5c1c35){var _0x2b7cba={'raw':![],'where':{}};var _0x29a1={};var _0x2c4208={'count':0x0,'rows':[]};return db[_0x4a6c('0x31')][_0x4a6c('0xba')]({'where':{'id':_0xdc7408[_0x4a6c('0xae')]['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x4cbc9d,null))[_0x4a6c('0x2d')](function(_0x9d27b3){if(_0x9d27b3){_0x29a1['model']=_[_0x4a6c('0x37')](db[_0x4a6c('0xb7')][_0x4a6c('0x32')]);_0x29a1['query']=_[_0x4a6c('0x37')](_0xdc7408['query']);_0x29a1[_0x4a6c('0x38')]=_[_0x4a6c('0x39')](_0x29a1[_0x4a6c('0x3a')],_0x29a1[_0x4a6c('0x36')]);_0x2b7cba[_0x4a6c('0x3b')]=_['intersection'](_0x29a1[_0x4a6c('0x3a')],qs['fields'](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x3c')]));_0x2b7cba['attributes']=_0x2b7cba['attributes'][_0x4a6c('0x3d')]?_0x2b7cba[_0x4a6c('0x3b')]:_0x29a1['model'];if(!_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x3e')]('nolimit')){_0x2b7cba['limit']=qs[_0x4a6c('0x21')](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x21')]);_0x2b7cba[_0x4a6c('0x1e')]=qs[_0x4a6c('0x1e')](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x1e')]);}_0x2b7cba[_0x4a6c('0x89')]=qs[_0x4a6c('0xbb')](_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0xbb')]);_0x2b7cba[_0x4a6c('0x75')]=qs[_0x4a6c('0x38')](_[_0x4a6c('0x40')](_0xdc7408[_0x4a6c('0x36')],_0x29a1[_0x4a6c('0x38')]));_0x2b7cba[_0x4a6c('0x75')]['SmsInteractionId']=_0x9d27b3['id'];if(_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x7d')]){_0x2b7cba[_0x4a6c('0x75')]=_[_0x4a6c('0x95')](_0x2b7cba[_0x4a6c('0x75')],{'$or':_[_0x4a6c('0x30')](_0x2b7cba[_0x4a6c('0x3b')],function(_0x22b3d3){var _0x55e0a6={};_0x55e0a6[_0x22b3d3]={'$like':'%'+_0xdc7408[_0x4a6c('0x36')]['filter']+'%'};return _0x55e0a6;})});}if(_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x73')]){var _0x4c2e22=_0xdc7408[_0x4a6c('0x36')][_0x4a6c('0x73')]['split'](',');var _0x50268c={};_0x50268c[_0x4c2e22[0x0]]={'$gte':moment(_0x4c2e22[0x1])[_0x4a6c('0xbc')](_0x4a6c('0xbd'))};_0x2b7cba[_0x4a6c('0x75')]=_[_0x4a6c('0x95')](_0x2b7cba[_0x4a6c('0x75')],_0x50268c);}_0x2b7cba=_['merge']({},_0x2b7cba,_0xdc7408[_0x4a6c('0xb0')]);return db[_0x4a6c('0xb7')][_0x4a6c('0x20')]({'where':_0x2b7cba[_0x4a6c('0x75')]})['then'](function(_0x551ec8){_0x2c4208[_0x4a6c('0x20')]=_0x551ec8;if(_0xdc7408[_0x4a6c('0x36')]['includeAll']){_0x2b7cba[_0x4a6c('0xaf')]=[{'all':!![]}];}return db[_0x4a6c('0xb7')][_0x4a6c('0xbe')](_0x2b7cba);})[_0x4a6c('0x2d')](function(_0x96733f){_0x2c4208[_0x4a6c('0xac')]=_0x96733f;return _0x2c4208;});}})[_0x4a6c('0x2d')](respondWithFilteredResult(_0x4cbc9d,_0x2b7cba))[_0x4a6c('0x2e')](handleError(_0x4cbc9d,null));};exports[_0x4a6c('0xbf')]=function(_0x53a215,_0x2167e4,_0x14bd43){return db['SmsInteraction']['find']({'where':{'id':_0x53a215[_0x4a6c('0xae')]['id']}})['then'](handleEntityNotFound(_0x2167e4,null))['then'](function(_0x4c42fc){if(_0x4c42fc){return _0x4c42fc[_0x4a6c('0xc0')](_0x53a215['body'][_0x4a6c('0xb8')],_[_0x4a6c('0xc1')](_0x53a215[_0x4a6c('0xb2')],[_0x4a6c('0xb8'),'id'])||{})[_0x4a6c('0xc2')](function(){return db[_0x4a6c('0xc3')][_0x4a6c('0xbe')]({'attributes':['id',_0x4a6c('0x26'),_0x4a6c('0x42')],'where':{'id':_0x53a215[_0x4a6c('0xb2')]['ids']}});})[_0x4a6c('0x2d')](function(_0x2e0183){socket['emit'](_0x4a6c('0xc4'),{'id':Number(_0x53a215[_0x4a6c('0xae')]['id']),'tags':_0x2e0183||[]});return{'id':Number(_0x53a215['params']['id']),'tags':_0x2e0183||[]};});}})[_0x4a6c('0x2d')](respondWithResult(_0x2167e4,null))[_0x4a6c('0x2e')](handleError(_0x2167e4,null));};exports[_0x4a6c('0xc5')]=function(_0x46c281,_0x4a5d24,_0x58cebc){return db[_0x4a6c('0x31')][_0x4a6c('0x57')]({'where':{'id':_0x46c281[_0x4a6c('0xae')]['id']}})[_0x4a6c('0x2d')](handleEntityNotFound(_0x4a5d24,null))[_0x4a6c('0x2d')](function(_0x587709){if(_0x587709){return _0x587709['removeTags'](_0x46c281[_0x4a6c('0x36')][_0x4a6c('0xb8')]);}})['then'](respondWithStatusCode(_0x4a5d24,null))[_0x4a6c('0x2e')](handleError(_0x4a5d24,null));};exports[_0x4a6c('0xc6')]=function(_0x580247,_0x49ba89){var _0xcc561=moment()[_0x4a6c('0xc7')]()[_0x4a6c('0x93')]();var _0x1e1fbb=path[_0x4a6c('0xc8')](config['root'],'server',_0x4a6c('0xc9'),'tmp');var _0x4580ae=path[_0x4a6c('0xc8')](config[_0x4a6c('0xca')],'server',_0x4a6c('0xc9'),_0x4a6c('0xcb'));var _0x443d50=path[_0x4a6c('0xc8')](_0x1e1fbb,_0xcc561);var _0x4ddd4d=util[_0x4a6c('0xbc')](_0x4a6c('0xcc'),_0x580247[_0x4a6c('0xae')]['id'],_0xcc561);var _0x44c410=path[_0x4a6c('0xc8')](_0x1e1fbb,_0x4ddd4d);var _0x4a9244=[];_0x4a9244['push']({'model':db[_0x4a6c('0xcd')],'as':_0x4a6c('0xcd'),'attributes':['id',_0x4a6c('0x29')],'raw':!![]});_0x4a9244[_0x4a6c('0x2c')]({'model':db[_0x4a6c('0xce')],'as':_0x4a6c('0x5c'),'attributes':['id',_0x4a6c('0xcf'),_0x4a6c('0xd0')],'raw':!![]});var _0x5acd69=[{'model':db[_0x4a6c('0xb7')],'as':'Messages','attributes':['id',_0x4a6c('0xb2'),_0x4a6c('0x71'),_0x4a6c('0xd1'),_0x4a6c('0xd2'),_0x4a6c('0x79')],'include':_0x4a9244}];_0x5acd69[_0x4a6c('0x2c')]({'model':db[_0x4a6c('0xd3')],'as':_0x4a6c('0xd4'),'attributes':['id','name']});_0x5acd69['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x4a6c('0x29')]});return db[_0x4a6c('0x31')]['find']({'where':{'id':_0x580247['params']['id']},'include':_0x5acd69})[_0x4a6c('0x2d')](handleEntityNotFound(_0x49ba89,null))[_0x4a6c('0x2d')](function(_0x2d2487){if(_0x2d2487){var _0x5c2f2d=_0x2d2487['get']({'plain':!![]});fs[_0x4a6c('0xd5')](_0x443d50);var _0x2ec6ab={'channel':_0x4a6c('0xd6'),'account':_0x5c2f2d[_0x4a6c('0xd4')][_0x4a6c('0x26')],'agent':_0x5c2f2d[_0x4a6c('0xd7')]?_0x5c2f2d[_0x4a6c('0xd7')]['fullname']:'N.A.','createdAt':moment(_0x5c2f2d[_0x4a6c('0x71')])['format'](_0x4a6c('0xbd'))[_0x4a6c('0x93')](),'closedAt':_0x5c2f2d['closed']?moment(_0x5c2f2d[_0x4a6c('0xd8')])[_0x4a6c('0xbc')](_0x4a6c('0xbd'))[_0x4a6c('0x93')]():'','disposition':_0x5c2f2d[_0x4a6c('0xd9')],'messages':_(_0x5c2f2d[_0x4a6c('0xda')])[_0x4a6c('0x7d')]({'secret':![]})[_0x4a6c('0x30')](function(_0x180aee){return{'date':moment(_0x180aee['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4a6c('0x93')](),'sender':_0x180aee['direction']===_0x4a6c('0xdb')?_0x180aee['User']?_0x180aee[_0x4a6c('0xcd')][_0x4a6c('0x29')]:'System':_0x180aee[_0x4a6c('0x5c')][_0x4a6c('0xcf')]+(_0x180aee['Contact'][_0x4a6c('0xd0')]?'\x20'+_0x180aee[_0x4a6c('0x5c')][_0x4a6c('0xd0')]:''),'body':_0x180aee[_0x4a6c('0xb2')],'direction':_0x180aee[_0x4a6c('0xd1')]===_0x4a6c('0xdb')?'A':'C','secret':_0x180aee['secret'],'read':_0x180aee[_0x4a6c('0x79')]};})[_0x4a6c('0x59')]()};return ejs[_0x4a6c('0xdc')](path[_0x4a6c('0xc8')](config[_0x4a6c('0xca')],'server',_0x4a6c('0xdd'),_0x4a6c('0xde')),{'interaction':_0x2ec6ab})[_0x4a6c('0x2d')](function(_0x147bee){var _0x3f675c=path[_0x4a6c('0xc8')](_0x443d50,_0x4a6c('0xdf')+_0x5c2f2d['id']+'-'+_0xcc561+_0x4a6c('0xe0'));var _0x55b742={'path':_0x3f675c,'channel':_0x4a6c('0xd6'),'interactionId':_0x5c2f2d['id']};return pdf[_0x4a6c('0xe1')](_0x147bee,_0x55b742);})[_0x4a6c('0x2d')](function(){return new BPromise(function(_0x4e92d3,_0x4ff6b6){zipdir(_0x443d50,{'saveTo':_0x44c410},function(_0x59b560,_0x8c39cd){if(_0x59b560)return _0x4ff6b6(_0x59b560);return _0x4e92d3(_0x8c39cd);});})['then'](function(){return new BPromise(function(_0xec5e7f,_0x569457){rimraf(_0x443d50,function(_0x31f8ec){if(_0x31f8ec)_0x569457(_0x31f8ec);return _0xec5e7f();});});})[_0x4a6c('0x2d')](function(){return _0x49ba89[_0x4a6c('0xc6')](_0x44c410,_0x4ddd4d,function(_0x9875c8){if(_0x9875c8){console[_0x4a6c('0xe2')](_0x4a6c('0xe3'),_0x9875c8);}else{fs[_0x4a6c('0xe4')](_0x44c410);}});});});}else{return _0x49ba89[_0x4a6c('0x1a')](0xc8);}})[_0x4a6c('0x2e')](handleError(_0x49ba89,null));}; \ No newline at end of file +var _0x9819=['toString','sequelize','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','show','filters','includeAll','include','create','params','describe','addMessage','SmsMessage','ids','findOne','pick','format','options','findAll','rows','addTags','omit','spread','emit','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','direction','secret','Account','Owner','get','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Messages','out','System','firstName','renderFile','join','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','Tags','split','TagIds','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','cm_contacts','users','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','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?','UserId','text','body','start','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL'];(function(_0x534bc2,_0x46befa){var _0xad060f=function(_0x46ee33){while(--_0x46ee33){_0x534bc2['push'](_0x534bc2['shift']());}};_0xad060f(++_0x46befa);}(_0x9819,0x13e));var _0x9981=function(_0x31f871,_0x37cc48){_0x31f871=_0x31f871-0x0;var _0x3c3da6=_0x9819[_0x31f871];return _0x3c3da6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9981('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9981('0x1'));var rp=require(_0x9981('0x2'));var moment=require(_0x9981('0x3'));var BPromise=require(_0x9981('0x4'));var Mustache=require(_0x9981('0x5'));var util=require(_0x9981('0x6'));var path=require(_0x9981('0x7'));var sox=require('sox');var csv=require(_0x9981('0x8'));var ejs=require(_0x9981('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9981('0xa'));var jsforce=require(_0x9981('0xb'));var deskjs=require(_0x9981('0xc'));var toCsv=require(_0x9981('0x8'));var querystring=require(_0x9981('0xd'));var Papa=require(_0x9981('0xe'));var Redis=require(_0x9981('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9981('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x9981('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9981('0x12'))(_0x9981('0x13'));var utils=require(_0x9981('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9981('0x15'));var db=require(_0x9981('0x16'))['db'];config['redis']=_[_0x9981('0x17')](config[_0x9981('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9981('0x19'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x9981('0x1a')](socket);function respondWithStatusCode(_0xb2297d,_0x2068cb){_0x2068cb=_0x2068cb||0xcc;return function(_0x3e360f){if(_0x3e360f){return _0xb2297d[_0x9981('0x1b')](_0x2068cb);}return _0xb2297d['status'](_0x2068cb)[_0x9981('0x1c')]();};}function respondWithResult(_0x5780a2,_0x3ed359){_0x3ed359=_0x3ed359||0xc8;return function(_0x55c6be){if(_0x55c6be){return _0x5780a2[_0x9981('0x1d')](_0x3ed359)['json'](_0x55c6be);}};}function respondWithFilteredResult(_0x1b9e74,_0x3950dc){return function(_0x2ca1cf){if(_0x2ca1cf){var _0x32aa6d=typeof _0x3950dc[_0x9981('0x1e')]===_0x9981('0x1f')&&typeof _0x3950dc['limit']===_0x9981('0x1f');var _0x3284ba=_0x2ca1cf[_0x9981('0x20')];var _0x3e42df=_0x32aa6d?0x0:_0x3950dc['offset'];var _0x353f75=_0x32aa6d?_0x2ca1cf[_0x9981('0x20')]:_0x3950dc[_0x9981('0x1e')]+_0x3950dc[_0x9981('0x21')];var _0x39f6fc;if(_0x353f75>=_0x3284ba){_0x353f75=_0x3284ba;_0x39f6fc=0xc8;}else{_0x39f6fc=0xce;}_0x1b9e74[_0x9981('0x1d')](_0x39f6fc);return _0x1b9e74[_0x9981('0x22')](_0x9981('0x23'),_0x3e42df+'-'+_0x353f75+'/'+_0x3284ba)[_0x9981('0x24')](_0x2ca1cf);}return null;};}function patchUpdates(_0x159a44){return function(_0x109f64){try{jsonpatch['apply'](_0x109f64,_0x159a44,!![]);}catch(_0x27f62b){return BPromise[_0x9981('0x25')](_0x27f62b);}return _0x109f64[_0x9981('0x26')]();};}function saveUpdates(_0x583a77,_0x164ebb){return function(_0x5b1f3f){if(_0x5b1f3f){return _0x5b1f3f[_0x9981('0x27')](_0x583a77)[_0x9981('0x28')](function(_0xd603ca){return _0xd603ca;});}return null;};}function removeEntity(_0x2ecd73,_0x39df6b){return function(_0xe05b37){if(_0xe05b37){return _0xe05b37[_0x9981('0x29')]()[_0x9981('0x28')](function(){_0x2ecd73[_0x9981('0x1d')](0xcc)[_0x9981('0x1c')]();});}};}function handleEntityNotFound(_0x275aea,_0x2886fc){return function(_0x2aecd6){if(!_0x2aecd6){_0x275aea['sendStatus'](0x194);}return _0x2aecd6;};}function handleError(_0x1ba434,_0x3a32f1){_0x3a32f1=_0x3a32f1||0x1f4;return function(_0x5857f9){logger[_0x9981('0x2a')](_0x5857f9[_0x9981('0x2b')]);if(_0x5857f9[_0x9981('0x2c')]){delete _0x5857f9[_0x9981('0x2c')];}_0x1ba434['status'](_0x3a32f1)[_0x9981('0x2d')](_0x5857f9);};}function getInteractionUsers(_0x19b467,_0x2cbf16){return new BPromise(function(_0x225c9d,_0x2e99a2){try{if(_0x2cbf16[_0x19b467['id']]){_0x19b467[_0x9981('0x2e')]=_[_0x9981('0x2f')](_0x2cbf16[_0x19b467['id']],function(_0x10d99c){return{'id':_0x10d99c['id'],'fullname':_0x10d99c[_0x9981('0x30')]};});}}catch(_0x154a1a){_0x2e99a2(_0x154a1a);}_0x225c9d(_0x19b467);});}function getInteractionTags(_0x4b546f,_0x599c6d){return new BPromise(function(_0x29e599,_0x29c518){try{if(_0x4b546f['TagIds']){_0x4b546f[_0x9981('0x31')]=[];_0x4b546f['TagIds'][_0x9981('0x32')](',')['forEach'](function(_0x3cef0a){_0x4b546f[_0x9981('0x31')]['push'](_0x599c6d[_0x3cef0a]);});}delete _0x4b546f[_0x9981('0x33')];}catch(_0x47cb04){_0x29c518(_0x47cb04);}_0x29e599(_0x4b546f);});}function updateSmsInteraction(_0x384f6f,_0x35bd22,_0x5bb0fc){return new BPromise(function(_0x584fdc,_0x193d17){return getInteractionUsers(_0x384f6f,_0x5bb0fc)['then'](function(_0x2db1b0){return getInteractionTags(_0x2db1b0,_0x35bd22);})[_0x9981('0x28')](function(_0x16aa07){_0x584fdc(_0x16aa07);})[_0x9981('0x34')](function(_0x534722){_0x193d17(_0x534722);});});}exports[_0x9981('0x35')]=function(_0x5debdc,_0x1673f0){var _0x133925={},_0x4818ce={},_0x37822b={'count':0x0,'rows':[]};var _0x7ff0c1=_[_0x9981('0x2f')](db[_0x9981('0x36')][_0x9981('0x37')],function(_0x5ebfa7){return{'name':_0x5ebfa7[_0x9981('0x38')],'type':_0x5ebfa7[_0x9981('0x39')][_0x9981('0x3a')]};});_0x4818ce[_0x9981('0x3b')]=_['map'](_0x7ff0c1,_0x9981('0x2c'));_0x4818ce[_0x9981('0x3c')]=_[_0x9981('0x3d')](_0x5debdc[_0x9981('0x3c')]);_0x4818ce['filters']=_[_0x9981('0x3e')](_0x4818ce[_0x9981('0x3b')],_0x4818ce['query']);_0x133925[_0x9981('0x3f')]=_[_0x9981('0x3e')](_0x4818ce['model'],qs[_0x9981('0x40')](_0x5debdc[_0x9981('0x3c')][_0x9981('0x40')]));_0x133925['attributes']=_0x133925[_0x9981('0x3f')][_0x9981('0x41')]?_0x133925['attributes']:_0x4818ce[_0x9981('0x3b')];if(!_0x5debdc[_0x9981('0x3c')][_0x9981('0x42')](_0x9981('0x43'))){_0x133925['limit']=qs[_0x9981('0x21')](_0x5debdc['query'][_0x9981('0x21')]);_0x133925['offset']=qs[_0x9981('0x1e')](_0x5debdc[_0x9981('0x3c')][_0x9981('0x1e')]);}_0x133925['order']=qs['sort'](_0x5debdc[_0x9981('0x3c')][_0x9981('0x44')]);_0x133925[_0x9981('0x45')]=qs['filters'](_['pick'](_0x5debdc[_0x9981('0x3c')],_0x4818ce['filters']),_0x7ff0c1);var _0x205222=[];var _0x1214f1=squel[_0x9981('0x46')]()[_0x9981('0x47')]('id')[_0x9981('0x47')]('name')[_0x9981('0x47')](_0x9981('0x48'))[_0x9981('0x49')](_0x9981('0x4a'));var _0x47f787=squel[_0x9981('0x46')]()['field'](_0x9981('0x4b'))[_0x9981('0x47')](_0x9981('0x4c'))[_0x9981('0x47')](_0x9981('0x4d'))[_0x9981('0x49')](_0x9981('0x4e'),'ui')[_0x9981('0x4f')]('users','u','u.id\x20=\x20ui.UserId');var _0x218356=squel[_0x9981('0x46')]()[_0x9981('0x49')](_0x9981('0x50'),'i')[_0x9981('0x4f')](_0x9981('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9981('0x4f')](_0x9981('0x52'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x9981('0x53'),'a',_0x9981('0x54'))[_0x9981('0x4f')](_0x9981('0x55'),'me',_0x9981('0x56'))[_0x9981('0x4f')]('sms_interaction_has_tags','it',_0x9981('0x57'))[_0x9981('0x4f')](_0x9981('0x4a'),'t',_0x9981('0x58'));var _0x2f84fa=squel[_0x9981('0x59')]();var _0x3db8e3=[];var _0x1a2fd3=squel[_0x9981('0x59')]();var _0x2f2cc2;if(_0x5debdc[_0x9981('0x3c')][_0x9981('0x5a')]){_0x2f2cc2=as['parseSearch'](_0x5debdc[_0x9981('0x3c')][_0x9981('0x5a')]);var _0x4567a0=_0x2f2cc2[_0x9981('0x5b')];for(var _0xa52d09=0x0;_0xa52d09<_0x2f2cc2[_0x9981('0x5c')][_0x9981('0x41')];_0xa52d09++){var _0x5b6a03=_0x2f2cc2[_0x9981('0x5c')][_0xa52d09];var _0x5498fd='i';var _0x141829=_[_0x9981('0x5d')](_0x7ff0c1,[_0x9981('0x2c'),_0x5b6a03['field']]);if(!_0x141829){switch(_0x5b6a03[_0x9981('0x47')]){case _0x9981('0x5e'):if(_0x5b6a03['value']==0x1){_0x218356[_0x9981('0x5f')]('`'+_0x5b6a03[_0x9981('0x47')]+_0x9981('0x60'));}else{_0x218356[_0x9981('0x5f')]('`'+_0x5b6a03[_0x9981('0x47')]+_0x9981('0x61'));}break;case _0x9981('0x62'):if(_0x5b6a03['operator']===_0x9981('0x63')){if(_0x5b6a03[_0x9981('0x64')][_0x9981('0x32')]('\x20')['length']>0x1){_0x2f84fa[_0x4567a0](_0x9981('0x65'),qs[_0x9981('0x66')](_0x5b6a03[_0x9981('0x64')]),null);}else{var _0x5860a1='%'+_0x5b6a03[_0x9981('0x64')]+'%';_0x2f84fa[_0x4567a0](_0x9981('0x67'),_0x5860a1,_0x5860a1,_0x5860a1);}}else{_0x141829=_['find'](_0x7ff0c1,[_0x9981('0x2c'),_0x9981('0x68')]);_0x5b6a03[_0x9981('0x47')]='ContactId';_0x4f6cef=as[_0x9981('0x69')](_0x5498fd,_0x141829['type'],_0x5b6a03);_0x2f84fa[_0x4567a0](_0x4f6cef['text'],_0x4f6cef[_0x9981('0x64')]['start'],_0x4f6cef[_0x9981('0x64')][_0x9981('0x1c')]);}break;case _0x9981('0x6a'):var _0x5d2738=_0x5b6a03[_0x9981('0x64')]['split'](',')['map'](function(_0x1783b0){return Number(_0x1783b0);});_0x5d2738[_0x9981('0x6b')](function(_0xa991ac){_0x1a2fd3['or'](_0x9981('0x6c'),'%,'+_0xa991ac+',%');});_0x3db8e3=_[_0x9981('0x6d')](_0x3db8e3,_0x5d2738);break;case _0x9981('0x6e'):if(_0x5b6a03['operator']===_0x9981('0x63')){_0x2f84fa[_0x4567a0](_0x9981('0x6f'),'%'+_0x5b6a03[_0x9981('0x64')]+'%',null);}else{_0x141829=_['find'](_0x7ff0c1,['name',_0x9981('0x70')]);_0x5b6a03[_0x9981('0x47')]=_0x9981('0x70');_0x4f6cef=as[_0x9981('0x69')](_0x5498fd,_0x141829[_0x9981('0x39')],_0x5b6a03);_0x2f84fa[_0x4567a0](_0x4f6cef[_0x9981('0x71')],_0x4f6cef[_0x9981('0x64')]['start'],_0x4f6cef[_0x9981('0x64')][_0x9981('0x1c')]);}break;case _0x9981('0x72'):_0x4f6cef=as['buildExpression']('me',null,_0x5b6a03);_0x2f84fa[_0x4567a0](_0x4f6cef['text'],_0x4f6cef[_0x9981('0x64')][_0x9981('0x73')],_0x4f6cef[_0x9981('0x64')][_0x9981('0x1c')]);break;}}else{var _0x4f6cef=as[_0x9981('0x69')](_0x5498fd,_0x141829[_0x9981('0x39')],_0x5b6a03);_0x2f84fa[_0x4567a0](_0x4f6cef[_0x9981('0x71')],_0x4f6cef['value'][_0x9981('0x73')],_0x4f6cef[_0x9981('0x64')][_0x9981('0x1c')]);}}}else{var _0x3fd6c7=_(_0x5debdc['query'])[_0x9981('0x3d')]()['map'](function(_0x5678af){return _[_0x9981('0x74')](_0x7ff0c1,[_0x9981('0x2c'),_0x5678af])?_0x5678af:undefined;})[_0x9981('0x75')]()[_0x9981('0x64')]();if(!_[_0x9981('0x76')](_0x3fd6c7)){_0x3fd6c7[_0x9981('0x6b')](function(_0xa46aec){if(_0xa46aec===_0x9981('0x77')){_0x218356[_0x9981('0x45')](_0x9981('0x78'),[][_0x9981('0x79')](_0x5debdc['query'][_0xa46aec]));}else if(_0xa46aec===_0x9981('0x7a')){var _0x1521f0=JSON[_0x9981('0x7b')](_0x5debdc[_0x9981('0x3c')][_0xa46aec])[_0x9981('0x7c')];var _0x4fffff=JSON[_0x9981('0x7b')](_0x5debdc['query'][_0xa46aec])[_0x9981('0x7d')];_0x218356[_0x9981('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1521f0,_0x4fffff);}else{if(_0x5debdc[_0x9981('0x3c')][_0xa46aec]===_0x9981('0x7e')){_0x218356[_0x9981('0x45')]('i.'+_0xa46aec+_0x9981('0x7f'));}else{_0x218356[_0x9981('0x45')]('i.'+_0xa46aec+_0x9981('0x80'),_0x5debdc['query'][_0xa46aec]);}}});}if(_0x5debdc[_0x9981('0x3c')][_0x9981('0x81')]){if(_0x5debdc[_0x9981('0x3c')]['read']==0x1){_0x218356[_0x9981('0x5f')](_0x9981('0x82'));}else{_0x218356[_0x9981('0x5f')](_0x9981('0x83'));}}if(_0x5debdc['query'][_0x9981('0x84')]){_0x3db8e3=_[_0x9981('0x85')](_0x5debdc[_0x9981('0x3c')][_0x9981('0x84')])?_0x5debdc[_0x9981('0x3c')][_0x9981('0x84')]:new Array(_0x5debdc['query'][_0x9981('0x84')]);_0x3db8e3['forEach'](function(_0x3004ad){_0x1a2fd3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3004ad+',%');});}if(_0x5debdc['query']['filter']){var _0xc5ede3=_0x5debdc[_0x9981('0x3c')][_0x9981('0x86')][_0x9981('0x87')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xc5ede3)){_0x2f84fa['or']('i.id\x20LIKE\x20?',_0xc5ede3+'%')['or'](_0x9981('0x88'),_0xc5ede3+'%');}else{_0x2f84fa['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9981('0x66')](_0xc5ede3))['or'](_0x9981('0x89'),_0xc5ede3+'%');}}}_0x218356[_0x9981('0x45')](_0x2f84fa);_0x218356['group'](_0x9981('0x8a'));var _0x566571={'type':db[_0x9981('0x8b')][_0x9981('0x8c')][_0x9981('0x8d')],'raw':!![]};var _0x386558=_0x218356[_0x9981('0x8e')]();_0x386558['field'](_0x9981('0x8a'));_0x386558[_0x9981('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9981('0x5e'));if(_0x133925[_0x9981('0x8f')]){_0x133925[_0x9981('0x8f')][_0x9981('0x6b')](function(_0x149c0a){var _0x279aae=_0x149c0a[0x0]===_0x9981('0x90')?_0x149c0a[0x0]:'i.'+_0x149c0a[0x0];_0x218356['order'](_0x279aae,_0x149c0a[0x1]===_0x9981('0x91')?![]:!![]);});}if(!_[_0x9981('0x76')](_0x3db8e3)){_0x218356[_0x9981('0x5f')](_0x1a2fd3);_0x386558['where'](_0x9981('0x92'),_0x3db8e3);}BPromise[_0x9981('0x93')]()['then'](function(){if(!_0x2f2cc2){if(_0x5debdc[_0x9981('0x3c')][_0x9981('0x77')])return;_0x386558['where'](_0x9981('0x94'));_0x218356['where'](_0x9981('0x94'));return;}if(_0x5debdc[_0x9981('0x95')][_0x9981('0x96')]!==_0x9981('0x97'))return;return _0x5debdc[_0x9981('0x95')][_0x9981('0x98')]({'attributes':['id'],'raw':!![]})[_0x9981('0x28')](function(_0x2fc205){if(_[_0x9981('0x76')](_0x2fc205)){_0x386558[_0x9981('0x45')](_0x9981('0x99'));_0x218356[_0x9981('0x45')](_0x9981('0x99'));}else{_0x386558[_0x9981('0x45')]('i.SmsAccountId\x20IN\x20?',_[_0x9981('0x2f')](_0x2fc205,'id'));_0x218356[_0x9981('0x45')]('i.SmsAccountId\x20IN\x20?',_[_0x9981('0x2f')](_0x2fc205,'id'));}});})[_0x9981('0x28')](function(){if(_0x5debdc['user'][_0x9981('0x96')]===_0x9981('0x97')&&!_0x2f2cc2&&!_0x5debdc[_0x9981('0x3c')][_0x9981('0x77')])return[];return db['sequelize']['query'](_0x386558[_0x9981('0x9a')](),_0x566571);})[_0x9981('0x28')](function(_0x4dd5c5){_0x37822b[_0x9981('0x20')]=_0x4dd5c5[_0x9981('0x41')];if(_0x37822b[_0x9981('0x20')]===0x0)return[];return db[_0x9981('0x9b')][_0x9981('0x3c')](_0x1214f1['toString'](),_0x566571)[_0x9981('0x28')](function(_0x37a7dc){_0x205222=_['keyBy'](_0x37a7dc,'id');_0x566571=_[_0x9981('0x9c')](_0x566571,{'model':db[_0x9981('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5debdc[_0x9981('0x3c')][_0x9981('0x40')]){_0x133925[_0x9981('0x3f')][_0x9981('0x6b')](function(_0x254930){_0x218356[_0x9981('0x47')]('i.'+_0x254930);});}else{_0x218356[_0x9981('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9981('0x5e'));_0x218356[_0x9981('0x47')](_0x9981('0x9d'),_0x9981('0x9e'));_0x218356[_0x9981('0x47')](_0x9981('0x9f'),_0x9981('0xa0'));_0x218356['field'](_0x9981('0xa1'),_0x9981('0x90'));_0x218356[_0x9981('0x47')](_0x9981('0xa2'));_0x218356[_0x9981('0x47')](_0x9981('0xa3'),_0x9981('0xa4'));_0x218356[_0x9981('0x47')](_0x9981('0xa5'),_0x9981('0xa6'));_0x218356['field'](_0x9981('0xa7'),_0x9981('0xa8'));_0x218356[_0x9981('0x47')](_0x9981('0xa9'),_0x9981('0xaa'));_0x218356[_0x9981('0x47')](_0x9981('0xab'),_0x9981('0xac'));_0x218356[_0x9981('0x47')](_0x9981('0xad'),'Contact.fax');_0x218356[_0x9981('0x47')](_0x9981('0xae'),_0x9981('0xaf'));_0x218356['field'](_0x9981('0xb0'),'Owner.internal');_0x218356['field'](_0x9981('0xb1'),_0x9981('0x33'));}if(_0x133925[_0x9981('0x21')])_0x218356[_0x9981('0x21')](_0x133925[_0x9981('0x21')]);if(_0x133925[_0x9981('0x1e')])_0x218356['offset'](_0x133925[_0x9981('0x1e')]);return db['sequelize'][_0x9981('0x3c')](_0x218356[_0x9981('0x9a')](),_0x566571);})[_0x9981('0x28')](function(_0x4cfdea){if(_0x4cfdea[_0x9981('0x41')]>0x0)_0x47f787[_0x9981('0x45')](_0x9981('0xb2'),_[_0x9981('0x2f')](_0x4cfdea,'id'));return db[_0x9981('0x9b')]['query'](_0x47f787[_0x9981('0x9a')](),_0x566571)['then'](function(_0x4d001c){var _0x571584=_[_0x9981('0xb3')](_0x4d001c,_0x9981('0xb4'));var _0x277e1a=[];_0x4cfdea['forEach'](function(_0x3cc08c){_0x277e1a[_0x9981('0xb5')](updateSmsInteraction(_0x3cc08c,_0x205222,_0x571584));});return BPromise['all'](_0x277e1a);});});})[_0x9981('0x28')](function(_0x39df73){_0x37822b['rows']=_0x39df73;return _0x37822b;})['then'](respondWithFilteredResult(_0x1673f0,_0x133925))[_0x9981('0x34')](handleError(_0x1673f0,null));};exports[_0x9981('0xb6')]=function(_0x35bcea,_0x227e6b){var _0x29b7a6={'raw':![],'where':{'id':_0x35bcea['params']['id']}},_0x47143d={};_0x47143d[_0x9981('0x3b')]=_['keys'](db[_0x9981('0x36')][_0x9981('0x37')]);_0x47143d[_0x9981('0x3c')]=_[_0x9981('0x3d')](_0x35bcea[_0x9981('0x3c')]);_0x47143d[_0x9981('0xb7')]=_[_0x9981('0x3e')](_0x47143d['model'],_0x47143d['query']);_0x29b7a6[_0x9981('0x3f')]=_['intersection'](_0x47143d[_0x9981('0x3b')],qs['fields'](_0x35bcea[_0x9981('0x3c')][_0x9981('0x40')]));_0x29b7a6[_0x9981('0x3f')]=_0x29b7a6[_0x9981('0x3f')]['length']?_0x29b7a6[_0x9981('0x3f')]:_0x47143d[_0x9981('0x3b')];if(_0x35bcea['query'][_0x9981('0xb8')]){_0x29b7a6[_0x9981('0xb9')]=[{'all':!![]}];}_0x29b7a6=_['merge']({},_0x29b7a6,_0x35bcea['options']);return db[_0x9981('0x36')][_0x9981('0x5d')](_0x29b7a6)[_0x9981('0x28')](handleEntityNotFound(_0x227e6b,null))['then'](respondWithResult(_0x227e6b,null))[_0x9981('0x34')](handleError(_0x227e6b,null));};exports[_0x9981('0xba')]=function(_0x5a4f6e,_0x47eb58){return db[_0x9981('0x36')][_0x9981('0xba')](_0x5a4f6e[_0x9981('0x72')],{})[_0x9981('0x28')](respondWithResult(_0x47eb58,0xc9))[_0x9981('0x34')](handleError(_0x47eb58,null));};exports[_0x9981('0x27')]=function(_0x5e1a8b,_0x23ebfe){if(_0x5e1a8b[_0x9981('0x72')]['id']){delete _0x5e1a8b[_0x9981('0x72')]['id'];}return db[_0x9981('0x36')][_0x9981('0x5d')]({'where':{'id':_0x5e1a8b[_0x9981('0xbb')]['id']}})[_0x9981('0x28')](handleEntityNotFound(_0x23ebfe,null))[_0x9981('0x28')](saveUpdates(_0x5e1a8b[_0x9981('0x72')],null))[_0x9981('0x28')](respondWithResult(_0x23ebfe,null))[_0x9981('0x34')](handleError(_0x23ebfe,null));};exports['destroy']=function(_0x2988e7,_0x5401e3){return db[_0x9981('0x36')][_0x9981('0x5d')]({'where':{'id':_0x2988e7[_0x9981('0xbb')]['id']}})[_0x9981('0x28')](handleEntityNotFound(_0x5401e3,null))['then'](removeEntity(_0x5401e3,null))[_0x9981('0x34')](handleError(_0x5401e3,null));};exports[_0x9981('0xbc')]=function(_0x20c9bb,_0x46ca66){return db[_0x9981('0x36')][_0x9981('0xbc')]()['then'](respondWithResult(_0x46ca66,null))[_0x9981('0x34')](handleError(_0x46ca66,null));};exports[_0x9981('0xbd')]=function(_0x479eb1,_0x43700c,_0x3ae648){return db[_0x9981('0xbe')][_0x9981('0x5d')]({'where':{'id':_0x479eb1[_0x9981('0xbb')]['id']}})[_0x9981('0x28')](handleEntityNotFound(_0x43700c,null))['then'](function(_0x190132){if(_0x190132){return _0x190132[_0x9981('0xbd')](_0x479eb1[_0x9981('0x72')][_0x9981('0xbf')],_['omit'](_0x479eb1[_0x9981('0x72')],['ids','id'])||{});}})[_0x9981('0x28')](respondWithResult(_0x43700c,null))[_0x9981('0x34')](handleError(_0x43700c,null));};exports['getMessages']=function(_0x3b823c,_0x28689f,_0x22dd21){var _0x1d040b={'raw':![],'where':{}};var _0xa1223={};var _0x4fa801={'count':0x0,'rows':[]};return db[_0x9981('0x36')][_0x9981('0xc0')]({'where':{'id':_0x3b823c[_0x9981('0xbb')]['id']}})['then'](handleEntityNotFound(_0x28689f,null))['then'](function(_0x403888){if(_0x403888){_0xa1223[_0x9981('0x3b')]=_[_0x9981('0x3d')](db[_0x9981('0xbe')]['rawAttributes']);_0xa1223[_0x9981('0x3c')]=_[_0x9981('0x3d')](_0x3b823c[_0x9981('0x3c')]);_0xa1223[_0x9981('0xb7')]=_['intersection'](_0xa1223[_0x9981('0x3b')],_0xa1223['query']);_0x1d040b[_0x9981('0x3f')]=_[_0x9981('0x3e')](_0xa1223[_0x9981('0x3b')],qs['fields'](_0x3b823c['query'][_0x9981('0x40')]));_0x1d040b[_0x9981('0x3f')]=_0x1d040b[_0x9981('0x3f')][_0x9981('0x41')]?_0x1d040b[_0x9981('0x3f')]:_0xa1223[_0x9981('0x3b')];if(!_0x3b823c[_0x9981('0x3c')]['hasOwnProperty'](_0x9981('0x43'))){_0x1d040b[_0x9981('0x21')]=qs[_0x9981('0x21')](_0x3b823c['query'][_0x9981('0x21')]);_0x1d040b[_0x9981('0x1e')]=qs[_0x9981('0x1e')](_0x3b823c[_0x9981('0x3c')][_0x9981('0x1e')]);}_0x1d040b['order']=qs[_0x9981('0x44')](_0x3b823c[_0x9981('0x3c')]['sort']);_0x1d040b[_0x9981('0x45')]=qs[_0x9981('0xb7')](_[_0x9981('0xc1')](_0x3b823c['query'],_0xa1223[_0x9981('0xb7')]));_0x1d040b[_0x9981('0x45')][_0x9981('0xb4')]=_0x403888['id'];if(_0x3b823c[_0x9981('0x3c')][_0x9981('0x86')]){_0x1d040b['where']=_[_0x9981('0x9c')](_0x1d040b[_0x9981('0x45')],{'$or':_[_0x9981('0x2f')](_0x1d040b[_0x9981('0x3f')],function(_0x5b94ea){var _0x41cbf4={};_0x41cbf4[_0x5b94ea]={'$like':'%'+_0x3b823c[_0x9981('0x3c')][_0x9981('0x86')]+'%'};return _0x41cbf4;})});}if(_0x3b823c[_0x9981('0x3c')][_0x9981('0x7c')]){var _0x287139=_0x3b823c[_0x9981('0x3c')][_0x9981('0x7c')][_0x9981('0x32')](',');var _0x567c0c={};_0x567c0c[_0x287139[0x0]]={'$gte':moment(_0x287139[0x1])[_0x9981('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d040b['where']=_['merge'](_0x1d040b[_0x9981('0x45')],_0x567c0c);}_0x1d040b=_[_0x9981('0x9c')]({},_0x1d040b,_0x3b823c[_0x9981('0xc3')]);return db[_0x9981('0xbe')][_0x9981('0x20')]({'where':_0x1d040b[_0x9981('0x45')]})[_0x9981('0x28')](function(_0x490dd6){_0x4fa801['count']=_0x490dd6;if(_0x3b823c['query']['includeAll']){_0x1d040b[_0x9981('0xb9')]=[{'all':!![]}];}return db[_0x9981('0xbe')][_0x9981('0xc4')](_0x1d040b);})['then'](function(_0x29cb5f){_0x4fa801[_0x9981('0xc5')]=_0x29cb5f;return _0x4fa801;});}})[_0x9981('0x28')](respondWithFilteredResult(_0x28689f,_0x1d040b))['catch'](handleError(_0x28689f,null));};exports[_0x9981('0xc6')]=function(_0x39f3d8,_0x1974a3,_0x1f7355){return db['SmsInteraction'][_0x9981('0x5d')]({'where':{'id':_0x39f3d8['params']['id']}})[_0x9981('0x28')](handleEntityNotFound(_0x1974a3,null))[_0x9981('0x28')](function(_0x351606){if(_0x351606){return _0x351606['setTags'](_0x39f3d8['body']['ids'],_[_0x9981('0xc7')](_0x39f3d8[_0x9981('0x72')],['ids','id'])||{})[_0x9981('0xc8')](function(){return db[_0x9981('0x6a')][_0x9981('0xc4')]({'attributes':['id',_0x9981('0x2c'),_0x9981('0x48')],'where':{'id':_0x39f3d8[_0x9981('0x72')][_0x9981('0xbf')]}});})[_0x9981('0x28')](function(_0x5356fb){socket[_0x9981('0xc9')]('smsInteractionTags:save',{'id':Number(_0x39f3d8[_0x9981('0xbb')]['id']),'tags':_0x5356fb||[]});return{'id':Number(_0x39f3d8['params']['id']),'tags':_0x5356fb||[]};});}})[_0x9981('0x28')](respondWithResult(_0x1974a3,null))['catch'](handleError(_0x1974a3,null));};exports['removeTags']=function(_0x195c25,_0x3072c4,_0x5e470e){return db[_0x9981('0x36')][_0x9981('0x5d')]({'where':{'id':_0x195c25['params']['id']}})[_0x9981('0x28')](handleEntityNotFound(_0x3072c4,null))[_0x9981('0x28')](function(_0x1e8d36){if(_0x1e8d36){return _0x1e8d36[_0x9981('0xca')](_0x195c25[_0x9981('0x3c')][_0x9981('0xbf')]);}})[_0x9981('0x28')](respondWithStatusCode(_0x3072c4,null))['catch'](handleError(_0x3072c4,null));};exports['download']=function(_0x312faf,_0x4cee7f){var _0x3e1989=moment()[_0x9981('0xcb')]()[_0x9981('0x9a')]();var _0x2bb228=path['join'](config[_0x9981('0xcc')],_0x9981('0xcd'),_0x9981('0xce'),_0x9981('0xcf'));var _0x33d684=path['join'](config['root'],_0x9981('0xcd'),_0x9981('0xce'),_0x9981('0xd0'));var _0x3722bc=path['join'](_0x2bb228,_0x3e1989);var _0x201cef=util[_0x9981('0xc2')](_0x9981('0xd1'),_0x312faf[_0x9981('0xbb')]['id'],_0x3e1989);var _0x24e11f=path['join'](_0x2bb228,_0x201cef);var _0x1a907a=[];_0x1a907a[_0x9981('0xb5')]({'model':db[_0x9981('0x6e')],'as':_0x9981('0x6e'),'attributes':['id',_0x9981('0x30')],'raw':!![]});_0x1a907a[_0x9981('0xb5')]({'model':db[_0x9981('0xd2')],'as':_0x9981('0x62'),'attributes':['id','firstName',_0x9981('0xd3')],'raw':!![]});var _0x2fd422=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x9981('0x72'),_0x9981('0x7a'),_0x9981('0xd4'),_0x9981('0xd5'),'read'],'include':_0x1a907a}];_0x2fd422[_0x9981('0xb5')]({'model':db['SmsAccount'],'as':_0x9981('0xd6'),'attributes':['id',_0x9981('0x2c')]});_0x2fd422[_0x9981('0xb5')]({'model':db[_0x9981('0x6e')],'as':_0x9981('0xd7'),'attributes':['id',_0x9981('0x30')]});return db['SmsInteraction'][_0x9981('0x5d')]({'where':{'id':_0x312faf[_0x9981('0xbb')]['id']},'include':_0x2fd422})[_0x9981('0x28')](handleEntityNotFound(_0x4cee7f,null))[_0x9981('0x28')](function(_0x1790cf){if(_0x1790cf){var _0x162191=_0x1790cf[_0x9981('0xd8')]({'plain':!![]});fs['mkdirSync'](_0x3722bc);var _0x8bf05={'channel':_0x9981('0xd9'),'account':_0x162191[_0x9981('0xd6')][_0x9981('0x2c')],'agent':_0x162191[_0x9981('0xd7')]?_0x162191[_0x9981('0xd7')][_0x9981('0x30')]:_0x9981('0xda'),'createdAt':moment(_0x162191[_0x9981('0x7a')])[_0x9981('0xc2')](_0x9981('0xdb'))[_0x9981('0x9a')](),'closedAt':_0x162191[_0x9981('0xdc')]?moment(_0x162191[_0x9981('0xdd')])[_0x9981('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9981('0x9a')]():'','disposition':_0x162191[_0x9981('0xde')],'messages':_(_0x162191[_0x9981('0xdf')])[_0x9981('0x86')]({'secret':![]})[_0x9981('0x2f')](function(_0x45f323){return{'date':moment(_0x45f323[_0x9981('0x7a')])[_0x9981('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9981('0x9a')](),'sender':_0x45f323[_0x9981('0xd4')]===_0x9981('0xe0')?_0x45f323['User']?_0x45f323['User'][_0x9981('0x30')]:_0x9981('0xe1'):_0x45f323[_0x9981('0x62')][_0x9981('0xe2')]+(_0x45f323[_0x9981('0x62')][_0x9981('0xd3')]?'\x20'+_0x45f323[_0x9981('0x62')][_0x9981('0xd3')]:''),'body':_0x45f323[_0x9981('0x72')],'direction':_0x45f323[_0x9981('0xd4')]===_0x9981('0xe0')?'A':'C','secret':_0x45f323[_0x9981('0xd5')],'read':_0x45f323[_0x9981('0x81')]};})[_0x9981('0x64')]()};return ejs[_0x9981('0xe3')](path[_0x9981('0xe4')](config[_0x9981('0xcc')],'server',_0x9981('0xe5'),_0x9981('0xe6')),{'interaction':_0x8bf05})[_0x9981('0x28')](function(_0x456548){var _0x1a1d5e=path[_0x9981('0xe4')](_0x3722bc,_0x9981('0xe7')+_0x162191['id']+'-'+_0x3e1989+'.pdf');var _0x1ab7a7={'path':_0x1a1d5e,'channel':'Sms','interactionId':_0x162191['id']};return pdf[_0x9981('0xe8')](_0x456548,_0x1ab7a7);})[_0x9981('0x28')](function(){return new BPromise(function(_0x8a1391,_0x3f2bee){zipdir(_0x3722bc,{'saveTo':_0x24e11f},function(_0x4fcf47,_0x3850fd){if(_0x4fcf47)return _0x3f2bee(_0x4fcf47);return _0x8a1391(_0x3850fd);});})[_0x9981('0x28')](function(){return new BPromise(function(_0x1b7c6e,_0x380a5f){rimraf(_0x3722bc,function(_0x23622f){if(_0x23622f)_0x380a5f(_0x23622f);return _0x1b7c6e();});});})[_0x9981('0x28')](function(){return _0x4cee7f['download'](_0x24e11f,_0x201cef,function(_0x58d5a6){if(_0x58d5a6){console[_0x9981('0xe9')](_0x9981('0xea'),_0x58d5a6);}else{fs[_0x9981('0xeb')](_0x24e11f);}});});});}else{return _0x4cee7f[_0x9981('0x1b')](0xc8);}})[_0x9981('0x34')](handleError(_0x4cee7f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index da63573..7d21737 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 _0x8952=['Users','map','findAll','unreadMessages','catch','hasOwnProperty','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','setDataValue'];(function(_0x2d6bf3,_0x267f85){var _0x122b86=function(_0x307fa4){while(--_0x307fa4){_0x2d6bf3['push'](_0x2d6bf3['shift']());}};_0x122b86(++_0x267f85);}(_0x8952,0x17e));var _0x2895=function(_0x2c8b0b,_0x4ac922){_0x2c8b0b=_0x2c8b0b-0x0;var _0x4ee90b=_0x8952[_0x2c8b0b];return _0x4ee90b;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2895('0x0'))['db'][_0x2895('0x1')];var SmsMessage=require(_0x2895('0x0'))['db'][_0x2895('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2895('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2895('0x4'),'afterDestroy':_0x2895('0x5')};function emitEvent(_0x1f69f6){return function(_0x5b28c6,_0x32429c,_0x73c245){_0x5b28c6[_0x2895('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x526c32){_0x5b28c6[_0x2895('0x7')](_0x2895('0x8'),_0x526c32[_0x2895('0x9')](function(_0x294446){return{'id':_0x294446['id']};}));return SmsMessage[_0x2895('0xa')]({'where':{'SmsInteractionId':_0x5b28c6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x14fb67){_0x5b28c6['setDataValue'](_0x2895('0xb'),_0x14fb67['length']);SmsInteractionEvents['emit'](_0x1f69f6+':'+_0x5b28c6['id'],_0x5b28c6);SmsInteractionEvents['emit'](_0x1f69f6,_0x5b28c6);_0x73c245(null);})[_0x2895('0xc')](_0x73c245(null));};}for(var e in events){if(events[_0x2895('0xd')](e)){var event=events[e];SmsInteraction[_0x2895('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x02ce=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x1b3770,_0x538bcb){var _0x5379d5=function(_0x4a67fb){while(--_0x4a67fb){_0x1b3770['push'](_0x1b3770['shift']());}};_0x5379d5(++_0x538bcb);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5abbe5,_0x328bc3){_0x5abbe5=_0x5abbe5-0x0;var _0x52547b=_0x02ce[_0x5abbe5];return _0x52547b;};'use strict';var EventEmitter=require(_0xe02c('0x0'));var SmsInteraction=require(_0xe02c('0x1'))['db'][_0xe02c('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xe02c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe02c('0x4'),'afterUpdate':_0xe02c('0x5'),'afterDestroy':_0xe02c('0x6')};function emitEvent(_0xf4b764){return function(_0x41b41c,_0x229653,_0x3f7436){_0x41b41c[_0xe02c('0x7')]({'attributes':['id'],'raw':!![]})[_0xe02c('0x8')](function(_0x4fecb3){_0x41b41c['setDataValue'](_0xe02c('0x9'),_0x4fecb3[_0xe02c('0xa')](function(_0x469932){return{'id':_0x469932['id']};}));return SmsMessage[_0xe02c('0xb')]({'where':{'SmsInteractionId':_0x41b41c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe02c('0x8')](function(_0x18a398){_0x41b41c[_0xe02c('0xc')](_0xe02c('0xd'),_0x18a398[_0xe02c('0xe')]);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764+':'+_0x41b41c['id'],_0x41b41c);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764,_0x41b41c);_0x3f7436(null);})[_0xe02c('0x10')](_0x3f7436(null));};}for(var e in events){if(events[_0xe02c('0x11')](e)){var event=events[e];SmsInteraction[_0xe02c('0x12')](e,emitEvent(event));}}module[_0xe02c('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 322dd67..d7eafcc 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 _0xd6e3=['request-promise','path','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xd6e3,0x1ea));var _0x3d6e=function(_0x3c4e37,_0x37b07d){_0x3c4e37=_0x3c4e37-0x0;var _0x1d9efc=_0xd6e3[_0x3c4e37];return _0x1d9efc;};'use strict';var _=require('lodash');var util=require(_0x3d6e('0x0'));var logger=require(_0x3d6e('0x1'))(_0x3d6e('0x2'));var moment=require(_0x3d6e('0x3'));var BPromise=require(_0x3d6e('0x4'));var rp=require(_0x3d6e('0x5'));var fs=require('fs');var path=require(_0x3d6e('0x6'));var rimraf=require(_0x3d6e('0x7'));var config=require('../../config/environment');var attributes=require(_0x3d6e('0x8'));module['exports']=function(_0x55b47a,_0x5dfdc8){return _0x55b47a[_0x3d6e('0x9')](_0x3d6e('0xa'),attributes,{'tableName':_0x3d6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e6f59,_0xeef585,_0x263e9d){if(_0x2e6f59[_0x3d6e('0xc')]('closed')){_0x2e6f59['closedAt']=moment()[_0x3d6e('0xd')](_0x3d6e('0xe'));}_0x263e9d(null,_0x2e6f59);}}});}; \ No newline at end of file +var _0x3a4e=['api','moment','bluebird','path','../../config/environment','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x3a4e,0x15c));var _0xe3a4=function(_0x4aaf47,_0x5e28cf){_0x4aaf47=_0x4aaf47-0x0;var _0x528bba=_0x3a4e[_0x4aaf47];return _0x528bba;};'use strict';var _=require(_0xe3a4('0x0'));var util=require('util');var logger=require(_0xe3a4('0x1'))(_0xe3a4('0x2'));var moment=require(_0xe3a4('0x3'));var BPromise=require(_0xe3a4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3a4('0x5'));var rimraf=require('rimraf');var config=require(_0xe3a4('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x43f9fa,_0xd008f9){return _0x43f9fa[_0xe3a4('0x7')](_0xe3a4('0x8'),attributes,{'tableName':_0xe3a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x463cae,_0x1c255e,_0xfc8f56){if(_0x463cae[_0xe3a4('0xa')]('closed')){_0x463cae[_0xe3a4('0xb')]=moment()[_0xe3a4('0xc')](_0xe3a4('0xd'));}_0xfc8f56(null,_0x463cae);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 40d5b3e..23064a1 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 _0xd959=['redis','./smsInteraction.socket','register','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsInteraction,\x20%s,\x20%s','result','UpdateSmsInteraction','SmsInteraction','body','options','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost'];(function(_0x20edb2,_0x127ca7){var _0x24e94a=function(_0x52163a){while(--_0x52163a){_0x20edb2['push'](_0x20edb2['shift']());}};_0x24e94a(++_0x127ca7);}(_0xd959,0x67));var _0x9d95=function(_0x509922,_0x5c0ed4){_0x509922=_0x509922-0x0;var _0xe7ba01=_0xd959[_0x509922];return _0xe7ba01;};'use strict';var _=require('lodash');var util=require(_0x9d95('0x0'));var moment=require(_0x9d95('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d95('0x2'))['db'];var utils=require(_0x9d95('0x3'));var logger=require(_0x9d95('0x4'))(_0x9d95('0x5'));var config=require(_0x9d95('0x6'));var jayson=require(_0x9d95('0x7'));var client=jayson[_0x9d95('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9d95('0x9')](config['redis'],{'host':_0x9d95('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d95('0xb')]));require(_0x9d95('0xc'))[_0x9d95('0xd')](socket);function respondWithRpcPromise(_0x5c7076,_0x1af7cc,_0x133247){return new BPromise(function(_0x4cf1eb,_0x5b09b3){return client['request'](_0x5c7076,_0x133247)['then'](function(_0x21a09b){logger[_0x9d95('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x1af7cc,_0x9d95('0xf'));logger[_0x9d95('0x10')](_0x9d95('0x11'),_0x1af7cc,'request\x20sent',JSON[_0x9d95('0x12')](_0x21a09b));if(_0x21a09b[_0x9d95('0x13')]){if(_0x21a09b['error']['code']===0x1f4){logger[_0x9d95('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x1af7cc,_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);return _0x5b09b3(_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);}logger[_0x9d95('0x13')](_0x9d95('0x15'),_0x1af7cc,_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);return _0x4cf1eb(_0x21a09b[_0x9d95('0x13')][_0x9d95('0x14')]);}else{logger[_0x9d95('0xe')](_0x9d95('0x15'),_0x1af7cc,'request\x20sent');_0x4cf1eb(_0x21a09b[_0x9d95('0x16')]['message']);}})['catch'](function(_0x38a4ac){logger['error'](_0x9d95('0x15'),_0x1af7cc,_0x38a4ac);_0x5b09b3(_0x38a4ac);});});}exports[_0x9d95('0x17')]=function(_0x334052){var _0x577c16=this;return new Promise(function(_0x108a30,_0x26ef26){return db[_0x9d95('0x18')]['update'](_0x334052[_0x9d95('0x19')],{'raw':_0x334052['options']?_0x334052[_0x9d95('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x334052['options']?_0x334052[_0x9d95('0x1a')]['where']||null:null,'attributes':_0x334052[_0x9d95('0x1a')]?_0x334052[_0x9d95('0x1a')][_0x9d95('0x1b')]||null:null,'limit':_0x334052[_0x9d95('0x1a')]?_0x334052['options'][_0x9d95('0x1c')]||null:null})[_0x9d95('0x1d')](function(_0x15ac7a){logger[_0x9d95('0xe')](_0x9d95('0x17'),_0x334052);logger[_0x9d95('0x10')](_0x9d95('0x17'),_0x334052,JSON[_0x9d95('0x12')](_0x15ac7a));_0x108a30(_0x15ac7a);})['catch'](function(_0x2954cd){logger[_0x9d95('0x13')]('UpdateSmsInteraction',_0x2954cd['message'],_0x334052);_0x26ef26(_0x577c16[_0x9d95('0x13')](0x1f4,_0x2954cd[_0x9d95('0x14')]));});});};exports[_0x9d95('0x1e')]=function(_0x2c0442){return new Promise(function(_0x2b2103,_0x1ca101){return db[_0x9d95('0x18')][_0x9d95('0x1f')]({'where':_0x2c0442['options']?_0x2c0442[_0x9d95('0x1a')]['where']||null:null})[_0x9d95('0x1d')](function(_0xfd5c5a){if(_0xfd5c5a){return _0xfd5c5a[_0x9d95('0x20')](_0x2c0442[_0x9d95('0x19')][_0x9d95('0x21')],_[_0x9d95('0x22')](_0x2c0442['body'],[_0x9d95('0x21'),'id'])||{});}})[_0x9d95('0x23')](function(_0x429542){logger[_0x9d95('0xe')](_0x9d95('0x24'),_0x2c0442);logger[_0x9d95('0x10')](_0x9d95('0x24'),_0x2c0442,JSON['stringify'](_0x429542));_0x2b2103(_0x429542);})[_0x9d95('0x25')](function(_0x33c887){logger[_0x9d95('0x13')](_0x9d95('0x24'),_0x33c887['message'],_0x2c0442);_0x1ca101(_this[_0x9d95('0x13')](0x1f4,_0x33c887[_0x9d95('0x14')]));});});}; \ No newline at end of file +var _0xc519=['UpdateSmsInteraction','SmsInteraction','update','options','raw','where','limit','info','debug','AddTagsToSmsInteraction','find','addTags','ids','omit','body','spread','AddTags','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','redis','localhost','./smsInteraction.socket','register','request','then','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsInteraction,\x20%s,\x20%s','catch'];(function(_0x2768b3,_0x2c93a1){var _0x5c523d=function(_0x6e74ba){while(--_0x6e74ba){_0x2768b3['push'](_0x2768b3['shift']());}};_0x5c523d(++_0x2c93a1);}(_0xc519,0x11b));var _0x9c51=function(_0x1d00c7,_0x9b96b2){_0x1d00c7=_0x1d00c7-0x0;var _0x5b4f51=_0xc519[_0x1d00c7];return _0x5b4f51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9c51('0x0'));var BPromise=require('bluebird');var rs=require(_0x9c51('0x1'));var fs=require('fs');var Redis=require(_0x9c51('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9c51('0x3'))(_0x9c51('0x4'));var config=require('../../config/environment');var jayson=require(_0x9c51('0x5'));var client=jayson['client'][_0x9c51('0x6')]({'port':0x232a});config[_0x9c51('0x7')]=_['defaults'](config[_0x9c51('0x7')],{'host':_0x9c51('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c51('0x7')]));require(_0x9c51('0x9'))[_0x9c51('0xa')](socket);function respondWithRpcPromise(_0x270f26,_0x4c6156,_0xaecbf6){return new BPromise(function(_0x4771c4,_0x1e72dd){return client[_0x9c51('0xb')](_0x270f26,_0xaecbf6)[_0x9c51('0xc')](function(_0x2f879c){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x4c6156,_0x9c51('0xd'));logger['debug'](_0x9c51('0xe'),_0x4c6156,_0x9c51('0xd'),JSON[_0x9c51('0xf')](_0x2f879c));if(_0x2f879c[_0x9c51('0x10')]){if(_0x2f879c[_0x9c51('0x10')][_0x9c51('0x11')]===0x1f4){logger[_0x9c51('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x4c6156,_0x2f879c[_0x9c51('0x10')][_0x9c51('0x12')]);return _0x1e72dd(_0x2f879c[_0x9c51('0x10')][_0x9c51('0x12')]);}logger[_0x9c51('0x10')](_0x9c51('0x13'),_0x4c6156,_0x2f879c[_0x9c51('0x10')]['message']);return _0x4771c4(_0x2f879c[_0x9c51('0x10')]['message']);}else{logger['info'](_0x9c51('0x13'),_0x4c6156,'request\x20sent');_0x4771c4(_0x2f879c['result'][_0x9c51('0x12')]);}})[_0x9c51('0x14')](function(_0xdcb97f){logger[_0x9c51('0x10')](_0x9c51('0x13'),_0x4c6156,_0xdcb97f);_0x1e72dd(_0xdcb97f);});});}exports[_0x9c51('0x15')]=function(_0xbefc){var _0x145a9c=this;return new Promise(function(_0x2be3e5,_0x483b37){return db[_0x9c51('0x16')][_0x9c51('0x17')](_0xbefc['body'],{'raw':_0xbefc[_0x9c51('0x18')]?_0xbefc[_0x9c51('0x18')][_0x9c51('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbefc[_0x9c51('0x18')]?_0xbefc[_0x9c51('0x18')][_0x9c51('0x1a')]||null:null,'attributes':_0xbefc[_0x9c51('0x18')]?_0xbefc[_0x9c51('0x18')]['attributes']||null:null,'limit':_0xbefc[_0x9c51('0x18')]?_0xbefc[_0x9c51('0x18')][_0x9c51('0x1b')]||null:null})[_0x9c51('0xc')](function(_0x377d70){logger[_0x9c51('0x1c')]('UpdateSmsInteraction',_0xbefc);logger[_0x9c51('0x1d')](_0x9c51('0x15'),_0xbefc,JSON['stringify'](_0x377d70));_0x2be3e5(_0x377d70);})['catch'](function(_0x4eb9d7){logger['error'](_0x9c51('0x15'),_0x4eb9d7[_0x9c51('0x12')],_0xbefc);_0x483b37(_0x145a9c[_0x9c51('0x10')](0x1f4,_0x4eb9d7[_0x9c51('0x12')]));});});};exports[_0x9c51('0x1e')]=function(_0x1de683){return new Promise(function(_0x3faf85,_0x48db4a){return db[_0x9c51('0x16')][_0x9c51('0x1f')]({'where':_0x1de683[_0x9c51('0x18')]?_0x1de683[_0x9c51('0x18')]['where']||null:null})['then'](function(_0x286172){if(_0x286172){return _0x286172[_0x9c51('0x20')](_0x1de683['body'][_0x9c51('0x21')],_[_0x9c51('0x22')](_0x1de683[_0x9c51('0x23')],[_0x9c51('0x21'),'id'])||{});}})[_0x9c51('0x24')](function(_0x186b32){logger['info']('AddTags',_0x1de683);logger[_0x9c51('0x1d')](_0x9c51('0x25'),_0x1de683,JSON[_0x9c51('0xf')](_0x186b32));_0x3faf85(_0x186b32);})[_0x9c51('0x14')](function(_0x2c30bd){logger[_0x9c51('0x10')](_0x9c51('0x25'),_0x2c30bd[_0x9c51('0x12')],_0x1de683);_0x48db4a(_this[_0x9c51('0x10')](0x1f4,_0x2c30bd['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 4eae3d3..6e97e21 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 _0xa14c=['smsInteraction:','./smsInteraction.events','update','emit','removeListener','register','length'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0xa14c,0x182));var _0xca14=function(_0x5d4caa,_0x1cc966){_0x5d4caa=_0x5d4caa-0x0;var _0x4c8bbd=_0xa14c[_0x5d4caa];return _0x4c8bbd;};'use strict';var SmsInteractionEvents=require(_0xca14('0x0'));var events=['save','remove',_0xca14('0x1')];function createListener(_0x4eaf3b,_0x5c92a6){return function(_0x21f99c){_0x5c92a6[_0xca14('0x2')](_0x4eaf3b,_0x21f99c);};}function removeListener(_0x49f341,_0xa68aea){return function(){SmsInteractionEvents[_0xca14('0x3')](_0x49f341,_0xa68aea);};}exports[_0xca14('0x4')]=function(_0x12c303){for(var _0x437858=0x0,_0x5f41af=events[_0xca14('0x5')];_0x437858<_0x5f41af;_0x437858++){var _0x4dedfc=events[_0x437858];var _0x4a688e=createListener(_0xca14('0x6')+_0x4dedfc,_0x12c303);SmsInteractionEvents['on'](_0x4dedfc,_0x4a688e);}}; \ No newline at end of file +var _0x05a8=['save','remove','register','length','smsInteraction:','./smsInteraction.events'];(function(_0xd25425,_0x4b0376){var _0x3d71db=function(_0x25ed90){while(--_0x25ed90){_0xd25425['push'](_0xd25425['shift']());}};_0x3d71db(++_0x4b0376);}(_0x05a8,0x1c7));var _0x805a=function(_0x38f242,_0x2a4505){_0x38f242=_0x38f242-0x0;var _0x22378f=_0x05a8[_0x38f242];return _0x22378f;};'use strict';var SmsInteractionEvents=require(_0x805a('0x0'));var events=[_0x805a('0x1'),_0x805a('0x2'),'update'];function createListener(_0x479f24,_0x29a521){return function(_0x5c458c){_0x29a521['emit'](_0x479f24,_0x5c458c);};}function removeListener(_0x1ff52e,_0x1823a9){return function(){SmsInteractionEvents['removeListener'](_0x1ff52e,_0x1823a9);};}exports[_0x805a('0x3')]=function(_0x4c30a7){for(var _0x58b591=0x0,_0x480d67=events[_0x805a('0x4')];_0x58b591<_0x480d67;_0x58b591++){var _0x4b62a4=events[_0x58b591];var _0xe037de=createListener(_0x805a('0x5')+_0x4b62a4,_0x4c30a7);SmsInteractionEvents['on'](_0x4b62a4,_0xe037de);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ac816b7..8f00a8e 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 _0xf6c1=['get','isAuthenticated','index','describe','/:id','show','post','create','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36115d,_0x4071a1){var _0x58cd1f=function(_0x43c7bd){while(--_0x43c7bd){_0x36115d['push'](_0x36115d['shift']());}};_0x58cd1f(++_0x4071a1);}(_0xf6c1,0x149));var _0x1f6c=function(_0x9f9daa,_0x4f0c8f){_0x9f9daa=_0x9f9daa-0x0;var _0x3684d3=_0xf6c1[_0x9f9daa];return _0x3684d3;};'use strict';var multer=require(_0x1f6c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1f6c('0x1'));var express=require('express');var router=express[_0x1f6c('0x2')]();var fs_extra=require(_0x1f6c('0x3'));var auth=require(_0x1f6c('0x4'));var interaction=require(_0x1f6c('0x5'));var config=require(_0x1f6c('0x6'));var controller=require('./smsMessage.controller');router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router[_0x1f6c('0x7')]('/describe',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xa')]);router[_0x1f6c('0x7')](_0x1f6c('0xb'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xc')]);router[_0x1f6c('0xd')]('/',auth[_0x1f6c('0x8')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x1f6c('0xe')]);router[_0x1f6c('0xd')]('/:id/status',controller[_0x1f6c('0xf')]);router[_0x1f6c('0x10')]('/:id',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x11')]);router[_0x1f6c('0x10')](_0x1f6c('0x12'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x13')]);router[_0x1f6c('0x10')]('/:id/reject',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x14')]);router[_0x1f6c('0x15')](_0x1f6c('0xb'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x16')]);module[_0x1f6c('0x17')]=router; \ No newline at end of file +var _0x3f7c=['status','update','put','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','sms','create'];(function(_0x51b73e,_0xbb995e){var _0x105c5d=function(_0x456755){while(--_0x456755){_0x51b73e['push'](_0x51b73e['shift']());}};_0x105c5d(++_0xbb995e);}(_0x3f7c,0xaa));var _0xc3f7=function(_0x2dd379,_0x83ca47){_0x2dd379=_0x2dd379-0x0;var _0x364d5d=_0x3f7c[_0x2dd379];return _0x364d5d;};'use strict';var multer=require(_0xc3f7('0x0'));var util=require(_0xc3f7('0x1'));var path=require(_0xc3f7('0x2'));var timeout=require(_0xc3f7('0x3'));var express=require(_0xc3f7('0x4'));var router=express['Router']();var fs_extra=require(_0xc3f7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc3f7('0x6'));var config=require(_0xc3f7('0x7'));var controller=require(_0xc3f7('0x8'));router[_0xc3f7('0x9')]('/',auth[_0xc3f7('0xa')](),controller['index']);router[_0xc3f7('0x9')](_0xc3f7('0xb'),auth[_0xc3f7('0xa')](),controller[_0xc3f7('0xc')]);router[_0xc3f7('0x9')](_0xc3f7('0xd'),auth[_0xc3f7('0xa')](),controller[_0xc3f7('0xe')]);router[_0xc3f7('0xf')]('/',auth['isAuthenticated'](),interaction[_0xc3f7('0x10')](_0xc3f7('0x11'),'smsmessage:create'),controller[_0xc3f7('0x12')]);router['post']('/:id/status',controller[_0xc3f7('0x13')]);router['put'](_0xc3f7('0xd'),auth[_0xc3f7('0xa')](),controller[_0xc3f7('0x14')]);router[_0xc3f7('0x15')](_0xc3f7('0x16'),auth[_0xc3f7('0xa')](),controller[_0xc3f7('0x17')]);router[_0xc3f7('0x15')](_0xc3f7('0x18'),auth[_0xc3f7('0xa')](),controller['reject']);router[_0xc3f7('0x19')]('/:id',auth[_0xc3f7('0xa')](),controller['destroy']);module[_0xc3f7('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 554d9cf..255af65 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 _0xf64e=['exports','medium','ENUM','out','STRING','BOOLEAN'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0xf64e,0x66));var _0xef64=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf64e[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module[_0xef64('0x0')]={'body':{'type':Sequelize['TEXT'](_0xef64('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xef64('0x2')]('in',_0xef64('0x3')),'defaultValue':_0xef64('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xef64('0x4')](0xbe)},'phone':{'type':Sequelize[_0xef64('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xef64('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xef64('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x131a=['BOOLEAN','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x59c86e,_0x38ce57){var _0x48a50e=function(_0x1eeda5){while(--_0x1eeda5){_0x59c86e['push'](_0x59c86e['shift']());}};_0x48a50e(++_0x38ce57);}(_0x131a,0x18b));var _0xa131=function(_0x2fe52d,_0x519129){_0x2fe52d=_0x2fe52d-0x0;var _0x1faf89=_0x131a[_0x2fe52d];return _0x1faf89;};'use strict';var Sequelize=require(_0xa131('0x0'));module[_0xa131('0x1')]={'body':{'type':Sequelize[_0xa131('0x2')](_0xa131('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa131('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa131('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa131('0x6')](0xbe)},'phone':{'type':Sequelize[_0xa131('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa131('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa131('0x6')]},'providerResponse':{'type':Sequelize[_0xa131('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index a3e72de..0e4b4a3 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 _0x4628=['findAll','rows','params','length','include','create','body','find','destroy','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','rejectmessage','SmsAccountId','debug','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','DELIVERED','infobip','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','json','offset','limit','count','status','set','apply','reject','save','update','end','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','SmsMessage','includeAll'];(function(_0x53f8d3,_0x3e565e){var _0x520993=function(_0x20e05b){while(--_0x20e05b){_0x53f8d3['push'](_0x53f8d3['shift']());}};_0x520993(++_0x3e565e);}(_0x4628,0xd3));var _0x8462=function(_0x435a09,_0x26a21f){_0x435a09=_0x435a09-0x0;var _0x4dd280=_0x4628[_0x435a09];return _0x4dd280;};'use strict';var emlformat=require(_0x8462('0x0'));var rimraf=require(_0x8462('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8462('0x2'));var rp=require(_0x8462('0x3'));var moment=require(_0x8462('0x4'));var BPromise=require(_0x8462('0x5'));var Mustache=require(_0x8462('0x6'));var util=require('util');var path=require(_0x8462('0x7'));var sox=require(_0x8462('0x8'));var csv=require(_0x8462('0x9'));var ejs=require(_0x8462('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8462('0xb'));var squel=require('squel');var crypto=require(_0x8462('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8462('0xd'));var toCsv=require(_0x8462('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8462('0xe'));var authService=require(_0x8462('0xf'));var qs=require(_0x8462('0x10'));var as=require(_0x8462('0x11'));var hardwareService=require(_0x8462('0x12'));var logger=require(_0x8462('0x13'))('api');var utils=require(_0x8462('0x14'));var config=require(_0x8462('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8462('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x8462('0x17'),'port':0x18eb});var socket=require(_0x8462('0x18'))(new Redis(config[_0x8462('0x19')]));require('./smsMessage.socket')[_0x8462('0x1a')](socket);var jayson=require(_0x8462('0x1b'));var client=jayson[_0x8462('0x1c')][_0x8462('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x8462('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3a19a9,_0x4f3824,_0x3a261a,_0x2bdd11){return new BPromise(function(_0xabd292,_0x315db9){var _0x49ef1f=_0x2bdd11||client;return _0x49ef1f[_0x8462('0x1e')](_0x3a19a9,_0x3a261a)[_0x8462('0x1f')](function(_0x114157){logger[_0x8462('0x20')](_0x8462('0x21'),_0x4f3824,'request\x20sent');logger['debug'](_0x8462('0x22'),_0x4f3824,_0x8462('0x23'),JSON[_0x8462('0x24')](_0x114157));if(_0x114157[_0x8462('0x25')]){if(_0x114157['error']['code']===0x1f4){logger[_0x8462('0x25')](_0x8462('0x21'),_0x4f3824,_0x114157[_0x8462('0x25')][_0x8462('0x26')]);return _0x315db9(_0x114157[_0x8462('0x25')]['message']);}logger[_0x8462('0x25')]('SmsMessage,\x20%s,\x20%s',_0x4f3824,_0x114157['error']['message']);return _0xabd292(_0x114157['error'][_0x8462('0x26')]);}else{logger[_0x8462('0x20')](_0x8462('0x21'),_0x4f3824,_0x8462('0x23'));_0xabd292(_0x114157[_0x8462('0x27')][_0x8462('0x26')]);}})[_0x8462('0x28')](function(_0x5ca724){logger[_0x8462('0x25')](_0x8462('0x21'),_0x4f3824,_0x5ca724);_0x315db9(_0x5ca724);});});}function respondWithStatusCode(_0x1e5b0c,_0x412a21){_0x412a21=_0x412a21||0xcc;return function(_0x27b8b9){if(_0x27b8b9){return _0x1e5b0c[_0x8462('0x29')](_0x412a21);}return _0x1e5b0c['status'](_0x412a21)['end']();};}function respondWithResult(_0x593681,_0x3c9d95){_0x3c9d95=_0x3c9d95||0xc8;return function(_0x279637){if(_0x279637){return _0x593681['status'](_0x3c9d95)[_0x8462('0x2a')](_0x279637);}};}function respondWithFilteredResult(_0x3e4e30,_0xdafc1d){return function(_0x19adb8){if(_0x19adb8){var _0x5b5105=typeof _0xdafc1d[_0x8462('0x2b')]==='undefined'&&typeof _0xdafc1d[_0x8462('0x2c')]==='undefined';var _0x4541c8=_0x19adb8['count'];var _0x5994f0=_0x5b5105?0x0:_0xdafc1d[_0x8462('0x2b')];var _0x45efda=_0x5b5105?_0x19adb8[_0x8462('0x2d')]:_0xdafc1d[_0x8462('0x2b')]+_0xdafc1d['limit'];var _0x1add08;if(_0x45efda>=_0x4541c8){_0x45efda=_0x4541c8;_0x1add08=0xc8;}else{_0x1add08=0xce;}_0x3e4e30[_0x8462('0x2e')](_0x1add08);return _0x3e4e30[_0x8462('0x2f')]('Content-Range',_0x5994f0+'-'+_0x45efda+'/'+_0x4541c8)[_0x8462('0x2a')](_0x19adb8);}return null;};}function patchUpdates(_0x3fc528){return function(_0x51c206){try{jsonpatch[_0x8462('0x30')](_0x51c206,_0x3fc528,!![]);}catch(_0x45cd1b){return BPromise[_0x8462('0x31')](_0x45cd1b);}return _0x51c206[_0x8462('0x32')]();};}function saveUpdates(_0x3d7f2d,_0x2fe22c){return function(_0x19c2bf){if(_0x19c2bf){return _0x19c2bf[_0x8462('0x33')](_0x3d7f2d)['then'](function(_0x284ef5){return _0x284ef5;});}return null;};}function removeEntity(_0x6c2400,_0x50218a){return function(_0xd5a665){if(_0xd5a665){return _0xd5a665['destroy']()[_0x8462('0x1f')](function(){_0x6c2400['status'](0xcc)[_0x8462('0x34')]();});}};}function handleEntityNotFound(_0x8698d,_0x3f2c57){return function(_0x302877){if(!_0x302877){_0x8698d[_0x8462('0x29')](0x194);}return _0x302877;};}function handleError(_0x4809fb,_0x3fdf98){_0x3fdf98=_0x3fdf98||0x1f4;return function(_0x27eef6){logger[_0x8462('0x25')](_0x27eef6['stack']);if(_0x27eef6[_0x8462('0x35')]){delete _0x27eef6[_0x8462('0x35')];}_0x4809fb['status'](_0x3fdf98)[_0x8462('0x36')](_0x27eef6);};}exports['index']=function(_0x5d3047,_0x11a27f){var _0x4ca308={},_0x525f0f={},_0x3787d8={'count':0x0,'rows':[]};var _0x84f831=_[_0x8462('0x37')](db['SmsMessage'][_0x8462('0x38')],function(_0x5498f2){return{'name':_0x5498f2[_0x8462('0x39')],'type':_0x5498f2['type'][_0x8462('0x3a')]};});_0x525f0f[_0x8462('0x3b')]=_[_0x8462('0x37')](_0x84f831,'name');_0x525f0f[_0x8462('0x3c')]=_[_0x8462('0x3d')](_0x5d3047[_0x8462('0x3c')]);_0x525f0f[_0x8462('0x3e')]=_[_0x8462('0x3f')](_0x525f0f[_0x8462('0x3b')],_0x525f0f[_0x8462('0x3c')]);_0x4ca308[_0x8462('0x40')]=_[_0x8462('0x3f')](_0x525f0f[_0x8462('0x3b')],qs[_0x8462('0x41')](_0x5d3047[_0x8462('0x3c')][_0x8462('0x41')]));_0x4ca308[_0x8462('0x40')]=_0x4ca308['attributes']['length']?_0x4ca308[_0x8462('0x40')]:_0x525f0f[_0x8462('0x3b')];if(!_0x5d3047['query'][_0x8462('0x42')](_0x8462('0x43'))){_0x4ca308[_0x8462('0x2c')]=qs[_0x8462('0x2c')](_0x5d3047['query']['limit']);_0x4ca308[_0x8462('0x2b')]=qs[_0x8462('0x2b')](_0x5d3047[_0x8462('0x3c')][_0x8462('0x2b')]);}_0x4ca308[_0x8462('0x44')]=qs[_0x8462('0x45')](_0x5d3047[_0x8462('0x3c')]['sort']);_0x4ca308['where']=qs[_0x8462('0x3e')](_['pick'](_0x5d3047['query'],_0x525f0f['filters']),_0x84f831);if(_0x5d3047[_0x8462('0x3c')][_0x8462('0x46')]){_0x4ca308[_0x8462('0x47')]=_[_0x8462('0x48')](_0x4ca308[_0x8462('0x47')],{'$or':_[_0x8462('0x37')](_0x84f831,function(_0x2c0da7){if(_0x2c0da7['type']!=='VIRTUAL'){var _0x28bde7={};_0x28bde7[_0x2c0da7['name']]={'$like':'%'+_0x5d3047['query'][_0x8462('0x46')]+'%'};return _0x28bde7;}})});}_0x4ca308=_['merge']({},_0x4ca308,_0x5d3047['options']);var _0x35bcf9={'where':_0x4ca308[_0x8462('0x47')]};return db[_0x8462('0x49')][_0x8462('0x2d')](_0x35bcf9)[_0x8462('0x1f')](function(_0xdf4051){_0x3787d8[_0x8462('0x2d')]=_0xdf4051;if(_0x5d3047[_0x8462('0x3c')][_0x8462('0x4a')]){_0x4ca308['include']=[{'all':!![]}];}return db[_0x8462('0x49')][_0x8462('0x4b')](_0x4ca308);})['then'](function(_0x2b9c7a){_0x3787d8[_0x8462('0x4c')]=_0x2b9c7a;return _0x3787d8;})[_0x8462('0x1f')](respondWithFilteredResult(_0x11a27f,_0x4ca308))[_0x8462('0x28')](handleError(_0x11a27f,null));};exports['show']=function(_0x57752c,_0x407786){var _0x1c0091={'raw':!![],'where':{'id':_0x57752c[_0x8462('0x4d')]['id']}},_0x25815a={};_0x25815a[_0x8462('0x3b')]=_[_0x8462('0x3d')](db[_0x8462('0x49')][_0x8462('0x38')]);_0x25815a['query']=_[_0x8462('0x3d')](_0x57752c[_0x8462('0x3c')]);_0x25815a['filters']=_['intersection'](_0x25815a[_0x8462('0x3b')],_0x25815a[_0x8462('0x3c')]);_0x1c0091[_0x8462('0x40')]=_[_0x8462('0x3f')](_0x25815a[_0x8462('0x3b')],qs[_0x8462('0x41')](_0x57752c[_0x8462('0x3c')][_0x8462('0x41')]));_0x1c0091[_0x8462('0x40')]=_0x1c0091[_0x8462('0x40')][_0x8462('0x4e')]?_0x1c0091['attributes']:_0x25815a[_0x8462('0x3b')];if(_0x57752c['query']['includeAll']){_0x1c0091[_0x8462('0x4f')]=[{'all':!![]}];}_0x1c0091=_[_0x8462('0x48')]({},_0x1c0091,_0x57752c['options']);return db[_0x8462('0x49')]['find'](_0x1c0091)[_0x8462('0x1f')](handleEntityNotFound(_0x407786,null))[_0x8462('0x1f')](respondWithResult(_0x407786,null))[_0x8462('0x28')](handleError(_0x407786,null));};exports[_0x8462('0x50')]=function(_0x167f4c,_0x496b75){return db[_0x8462('0x49')][_0x8462('0x50')](_0x167f4c[_0x8462('0x51')],{})['then'](respondWithResult(_0x496b75,0xc9))['catch'](handleError(_0x496b75,null));};exports['update']=function(_0x73705f,_0x2c1d50){if(_0x73705f[_0x8462('0x51')]['id']){delete _0x73705f[_0x8462('0x51')]['id'];}return db['SmsMessage'][_0x8462('0x52')]({'where':{'id':_0x73705f[_0x8462('0x4d')]['id']}})[_0x8462('0x1f')](handleEntityNotFound(_0x2c1d50,null))[_0x8462('0x1f')](saveUpdates(_0x73705f[_0x8462('0x51')],null))['then'](respondWithResult(_0x2c1d50,null))[_0x8462('0x28')](handleError(_0x2c1d50,null));};exports[_0x8462('0x53')]=function(_0x2579dc,_0x5c26b4){return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0x2579dc[_0x8462('0x4d')]['id']}})[_0x8462('0x1f')](handleEntityNotFound(_0x5c26b4,null))[_0x8462('0x1f')](removeEntity(_0x5c26b4,null))['catch'](handleError(_0x5c26b4,null));};exports['describe']=function(_0x57405a,_0x380268){return db['SmsMessage']['describe']()[_0x8462('0x1f')](respondWithResult(_0x380268,null))[_0x8462('0x28')](handleError(_0x380268,null));};var interaction_log=require(_0x8462('0x13'))(_0x8462('0x54'));exports['accept']=function(_0xc2ff88,_0x4710c5,_0x5bee14){var _0x598ecc={'agent':{},'channel':_0x8462('0x55')};if(_0xc2ff88[_0x8462('0x51')]['id']){delete _0xc2ff88[_0x8462('0x51')]['id'];}_0xc2ff88[_0x8462('0x51')][_0x8462('0x56')]=!![];_0xc2ff88[_0x8462('0x51')]['readAt']=moment()[_0x8462('0x57')](_0x8462('0x58'));_0xc2ff88[_0x8462('0x51')][_0x8462('0x59')]=_0xc2ff88[_0x8462('0x51')][_0x8462('0x59')]||_0xc2ff88['user']['id'];_0x598ecc[_0x8462('0x5a')]['id']=_0xc2ff88[_0x8462('0x51')]['UserId'];return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0xc2ff88['params']['id'],'UserId':null}})[_0x8462('0x1f')](handleEntityNotFound(_0x4710c5,null))['then'](saveUpdates(_0xc2ff88[_0x8462('0x51')],null))['then'](function(_0x5b822f){if(_0x5b822f){_0x598ecc[_0x8462('0x26')]=_0x5b822f[_0x8462('0x5b')]({'plain':!![]});return db[_0x8462('0x5c')]['find']({'where':{'id':_0x5b822f[_0x8462('0x5d')]}});}return null;})[_0x8462('0x1f')](handleEntityNotFound(_0x4710c5,null))[_0x8462('0x1f')](function(_0x406f78){if(_0x406f78){return _0x406f78['update']({'UserId':_0xc2ff88['body']['UserId'],'read1stAt':_['isNil'](_0x406f78[_0x8462('0x5e')])?moment()['format'](_0x8462('0x58')):undefined});}return null;})[_0x8462('0x1f')](function(_0x56d100){if(_0x56d100){_0x598ecc['interaction']=_0x56d100['get']({'plain':!![]});interaction_log['info'](_0x8462('0x5f'),_0xc2ff88[_0x8462('0x60')]['id'],_0xc2ff88['user'][_0x8462('0x35')],_0xc2ff88['user']['role'],_0x598ecc[_0x8462('0x61')]['id'],_0xc2ff88['body']?JSON[_0x8462('0x24')](_0xc2ff88[_0x8462('0x51')]):_0x8462('0x62'));return respondWithRpcPromise(_0x8462('0x63'),_0x8462('0x64'),_0x598ecc);}return null;})['then'](function(_0x56fe49){var _0x140784=_0x8462('0x65')+_0x56fe49[_0x8462('0x26')][_0x8462('0x66')];return db['sequelize']['query'](_0x140784,{'type':db[_0x8462('0x67')]['QueryTypes'][_0x8462('0x68')],'raw':!![]})['then'](function(_0x15f294){return _0x15f294;});})[_0x8462('0x1f')](function(_0x27b9e8){if(_0x27b9e8){_0x598ecc[_0x8462('0x26')][_0x8462('0x69')]=_0x27b9e8[0x0];if(!_0xc2ff88['body']['UserId'])return;return db[_0x8462('0x6a')][_0x8462('0x52')]({'where':{'id':_0xc2ff88[_0x8462('0x51')][_0x8462('0x59')],'role':_0x8462('0x5a')},'attributes':['id','name',_0x8462('0x6b'),_0x8462('0x6c'),_0x8462('0x6d')],'raw':!![]});}return null;})[_0x8462('0x1f')](function(_0x3baec8){if(!_0x3baec8)return null;_0x598ecc[_0x8462('0x26')][_0x8462('0x5a')]=_0x3baec8;return _0x598ecc;})[_0x8462('0x1f')](function(_0x434852){if(_0x434852){if(_0xc2ff88['body'][_0x8462('0x6e')]){_0x598ecc[_0x8462('0x26')][_0x8462('0x6f')]=util['format'](_0x8462('0x70'),_0xc2ff88[_0x8462('0x60')][_0x8462('0x35')]);_0x598ecc[_0x8462('0x26')]['channel']=_0x598ecc[_0x8462('0x71')];_0x598ecc['message'][_0x8462('0x72')]=_0x598ecc[_0x8462('0x71')];_0x598ecc['message'][_0x8462('0x73')]=_0x8462('0x74');return respondWithRpcPromise(_0x8462('0x75'),_0x8462('0x75'),{'event':_0x8462('0x76'),'message':_0x598ecc['message']},client9002)[_0x8462('0x1f')](function(){return _0x598ecc;});}return _0x598ecc;}return null;})[_0x8462('0x1f')](respondWithResult(_0x4710c5,null))[_0x8462('0x28')](handleError(_0x4710c5,null));};var interaction_log=require(_0x8462('0x13'))(_0x8462('0x54'));exports[_0x8462('0x31')]=function(_0x4b20db,_0x5c9f8d,_0x500641){var _0x2d1357={'agent':{},'channel':_0x8462('0x55')};if(_0x4b20db['body']['id']){delete _0x4b20db[_0x8462('0x51')]['id'];}_0x4b20db['body'][_0x8462('0x59')]=_0x4b20db[_0x8462('0x51')][_0x8462('0x59')]||_0x4b20db[_0x8462('0x60')]['id'];_0x2d1357[_0x8462('0x5a')]['id']=_0x4b20db[_0x8462('0x51')]['UserId'];return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0x4b20db[_0x8462('0x4d')]['id'],'UserId':null}})[_0x8462('0x1f')](handleEntityNotFound(_0x5c9f8d,null))[_0x8462('0x1f')](function(_0x3964b6){if(_0x3964b6){_0x2d1357[_0x8462('0x26')]=_0x3964b6[_0x8462('0x5b')]({'plain':!![]});return db['SmsInteraction'][_0x8462('0x52')]({'where':{'id':_0x3964b6[_0x8462('0x5d')]}});}return null;})[_0x8462('0x1f')](handleEntityNotFound(_0x5c9f8d,null))[_0x8462('0x1f')](function(_0x2fbe3a){if(_0x2fbe3a){_0x2d1357[_0x8462('0x61')]=_0x2fbe3a['get']({'plain':!![]});interaction_log['info'](_0x8462('0x77'),_0x4b20db[_0x8462('0x60')]['id'],_0x4b20db[_0x8462('0x60')]['name'],_0x4b20db['user'][_0x8462('0x78')],_0x2d1357[_0x8462('0x61')]['id'],_0x4b20db[_0x8462('0x51')]?JSON['stringify'](_0x4b20db['body']):_0x8462('0x62'));return respondWithRpcPromise(_0x8462('0x79'),_0x8462('0x7a'),_0x2d1357);}return null;})[_0x8462('0x1f')](function(_0x3f0aff){var _0x1508c1=_0x8462('0x65')+_0x3f0aff[_0x8462('0x26')][_0x8462('0x66')];return db['sequelize']['query'](_0x1508c1,{'type':db[_0x8462('0x67')][_0x8462('0x7b')][_0x8462('0x68')],'raw':!![]})[_0x8462('0x1f')](function(_0x225b67){return _0x225b67;});})[_0x8462('0x1f')](function(_0x297a31){if(_0x297a31){_0x2d1357[_0x8462('0x26')][_0x8462('0x69')]=_0x297a31[0x0];if(!_0x4b20db['body'][_0x8462('0x59')])return;return db['User'][_0x8462('0x52')]({'where':{'id':_0x4b20db[_0x8462('0x51')][_0x8462('0x59')],'role':_0x8462('0x5a')},'attributes':['id','name',_0x8462('0x6b'),_0x8462('0x6c'),'internal'],'raw':!![]});}return null;})[_0x8462('0x1f')](function(_0x22307e){if(!_0x22307e)return null;_0x2d1357[_0x8462('0x26')][_0x8462('0x5a')]=_0x22307e;return _0x2d1357;})[_0x8462('0x1f')](function(_0x572ef0){if(_0x572ef0){_0x572ef0['message']['interface']=util[_0x8462('0x57')](_0x8462('0x70'),_0x4b20db['user'][_0x8462('0x35')]);_0x572ef0[_0x8462('0x26')][_0x8462('0x71')]=_0x2d1357[_0x8462('0x71')];_0x572ef0[_0x8462('0x26')][_0x8462('0x72')]=_0x2d1357[_0x8462('0x71')];_0x572ef0[_0x8462('0x26')][_0x8462('0x73')]=_0x8462('0x31');respondWithRpcPromise(_0x8462('0x75'),_0x8462('0x75'),{'event':_0x8462('0x7c'),'message':_0x572ef0[_0x8462('0x26')]},client9002);return _0x2d1357;}return null;})['then'](respondWithResult(_0x5c9f8d,null))[_0x8462('0x28')](handleError(_0x5c9f8d,null));};exports['status']=function(_0x14b078,_0x1b4938,_0x18f0c2){if(_0x14b078[_0x8462('0x51')]['id']){delete _0x14b078['body']['id'];}var _0x4e769c;return db[_0x8462('0x49')][_0x8462('0x52')]({'where':{'id':_0x14b078[_0x8462('0x4d')]['id']}})[_0x8462('0x1f')](handleEntityNotFound(_0x1b4938,null))[_0x8462('0x1f')](function(_0x1cc019){if(_0x1cc019){_0x4e769c=_0x1cc019;return db['SmsAccount'][_0x8462('0x52')]({'where':{'id':_0x1cc019[_0x8462('0x7d')]}});}})[_0x8462('0x1f')](handleEntityNotFound(_0x1b4938,null))[_0x8462('0x1f')](function(_0x1f4273){if(_0x1f4273){logger[_0x8462('0x7e')](_0x8462('0x22'),_0x8462('0x2e'),_0x8462('0x7f'),_0x1f4273[_0x8462('0x80')],util[_0x8462('0x81')](_0x14b078[_0x8462('0x51')],{'showHidden':![],'depth':null}));switch(_0x1f4273['type']){case _0x8462('0x82'):if(_0x14b078[_0x8462('0x51')]['MessageSid']&&_0x14b078[_0x8462('0x51')][_0x8462('0x83')]===_0x4e769c[_0x8462('0x84')]){return _0x4e769c[_0x8462('0x33')]({'read':!![]});}else{logger[_0x8462('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8462('0x82'),util[_0x8462('0x81')](_0x14b078['body'],{'showHidden':![],'depth':null}));}break;case _0x8462('0x85'):if(_0x14b078['body']['MessageUUID']&&_0x14b078['body'][_0x8462('0x86')]===_0x4e769c[_0x8462('0x84')]&&_['indexOf']([_0x8462('0x87'),_0x8462('0x88')],_0x14b078[_0x8462('0x51')][_0x8462('0x89')])>=0x0){return _0x4e769c[_0x8462('0x33')]({'read':!![]});}else{logger[_0x8462('0x25')](_0x8462('0x8a'),_0x8462('0x2e'),_0x8462('0x8b'),util[_0x8462('0x81')](_0x14b078[_0x8462('0x51')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x525983=_0x14b078[_0x8462('0x51')][_0x8462('0x8c')][0x0];if(_0x525983[_0x8462('0x2e')]['groupName']===_0x8462('0x8d')){return _0x4e769c[_0x8462('0x33')]({'read':!![]});}else{logger[_0x8462('0x25')](_0x8462('0x8a'),_0x8462('0x2e'),_0x8462('0x8e'),util[_0x8462('0x81')](_0x14b078[_0x8462('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x4e769c;}})['then'](respondWithResult(_0x1b4938,null))[_0x8462('0x28')](handleError(_0x1b4938,null));}; \ No newline at end of file +var _0x27fb=['null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','agent','fullname','email','interface','channel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','QueryTypes','User','internal','SIP/%s','event','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','name','send','index','SmsMessage','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','sms-interactions','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','isNil','read1stAt','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction'];(function(_0x5fb3b,_0x5af013){var _0x15fa4f=function(_0x71e2c8){while(--_0x71e2c8){_0x5fb3b['push'](_0x5fb3b['shift']());}};_0x15fa4f(++_0x5af013);}(_0x27fb,0x1de));var _0xb27f=function(_0x32f840,_0x326af6){_0x32f840=_0x32f840-0x0;var _0x40a7f3=_0x27fb[_0x32f840];return _0x40a7f3;};'use strict';var emlformat=require(_0xb27f('0x0'));var rimraf=require(_0xb27f('0x1'));var zipdir=require(_0xb27f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb27f('0x3'));var moment=require('moment');var BPromise=require(_0xb27f('0x4'));var Mustache=require(_0xb27f('0x5'));var util=require(_0xb27f('0x6'));var path=require('path');var sox=require(_0xb27f('0x7'));var csv=require('to-csv');var ejs=require(_0xb27f('0x8'));var fs=require('fs');var fs_extra=require(_0xb27f('0x9'));var _=require(_0xb27f('0xa'));var squel=require(_0xb27f('0xb'));var crypto=require(_0xb27f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb27f('0xd'));var toCsv=require(_0xb27f('0xe'));var querystring=require('querystring');var Papa=require(_0xb27f('0xf'));var Redis=require(_0xb27f('0x10'));var authService=require(_0xb27f('0x11'));var qs=require(_0xb27f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb27f('0x13'));var logger=require(_0xb27f('0x14'))('api');var utils=require(_0xb27f('0x15'));var config=require(_0xb27f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb27f('0x17'))['db'];config[_0xb27f('0x18')]=_[_0xb27f('0x19')](config[_0xb27f('0x18')],{'host':_0xb27f('0x1a'),'port':0x18eb});var socket=require(_0xb27f('0x1b'))(new Redis(config['redis']));require(_0xb27f('0x1c'))['register'](socket);var jayson=require(_0xb27f('0x1d'));var client=jayson['client'][_0xb27f('0x1e')]({'port':0x232c});var client9002=jayson[_0xb27f('0x1f')][_0xb27f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x11155b,_0x33520b,_0x5eb8e5,_0x2d179c){return new BPromise(function(_0x2b8ff5,_0x2ea4f7){var _0xfc4bd0=_0x2d179c||client;return _0xfc4bd0[_0xb27f('0x20')](_0x11155b,_0x5eb8e5)[_0xb27f('0x21')](function(_0x428a86){logger['info'](_0xb27f('0x22'),_0x33520b,_0xb27f('0x23'));logger[_0xb27f('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x33520b,_0xb27f('0x23'),JSON[_0xb27f('0x25')](_0x428a86));if(_0x428a86['error']){if(_0x428a86[_0xb27f('0x26')][_0xb27f('0x27')]===0x1f4){logger[_0xb27f('0x26')](_0xb27f('0x22'),_0x33520b,_0x428a86[_0xb27f('0x26')][_0xb27f('0x28')]);return _0x2ea4f7(_0x428a86[_0xb27f('0x26')]['message']);}logger[_0xb27f('0x26')]('SmsMessage,\x20%s,\x20%s',_0x33520b,_0x428a86[_0xb27f('0x26')][_0xb27f('0x28')]);return _0x2b8ff5(_0x428a86[_0xb27f('0x26')]['message']);}else{logger[_0xb27f('0x29')]('SmsMessage,\x20%s,\x20%s',_0x33520b,_0xb27f('0x23'));_0x2b8ff5(_0x428a86['result']['message']);}})[_0xb27f('0x2a')](function(_0x5b79c7){logger[_0xb27f('0x26')](_0xb27f('0x22'),_0x33520b,_0x5b79c7);_0x2ea4f7(_0x5b79c7);});});}function respondWithStatusCode(_0x4dd89c,_0x915737){_0x915737=_0x915737||0xcc;return function(_0x3fd1a5){if(_0x3fd1a5){return _0x4dd89c[_0xb27f('0x2b')](_0x915737);}return _0x4dd89c['status'](_0x915737)[_0xb27f('0x2c')]();};}function respondWithResult(_0x62fb34,_0x432a75){_0x432a75=_0x432a75||0xc8;return function(_0x1ea21d){if(_0x1ea21d){return _0x62fb34['status'](_0x432a75)[_0xb27f('0x2d')](_0x1ea21d);}};}function respondWithFilteredResult(_0x57cf52,_0xcf8c7a){return function(_0x443641){if(_0x443641){var _0x4ce30d=typeof _0xcf8c7a['offset']===_0xb27f('0x2e')&&typeof _0xcf8c7a['limit']===_0xb27f('0x2e');var _0x3ab759=_0x443641[_0xb27f('0x2f')];var _0x153341=_0x4ce30d?0x0:_0xcf8c7a['offset'];var _0x1fef0c=_0x4ce30d?_0x443641[_0xb27f('0x2f')]:_0xcf8c7a[_0xb27f('0x30')]+_0xcf8c7a[_0xb27f('0x31')];var _0xdee3f7;if(_0x1fef0c>=_0x3ab759){_0x1fef0c=_0x3ab759;_0xdee3f7=0xc8;}else{_0xdee3f7=0xce;}_0x57cf52[_0xb27f('0x32')](_0xdee3f7);return _0x57cf52[_0xb27f('0x33')](_0xb27f('0x34'),_0x153341+'-'+_0x1fef0c+'/'+_0x3ab759)[_0xb27f('0x2d')](_0x443641);}return null;};}function patchUpdates(_0x90fd2e){return function(_0x2e15c9){try{jsonpatch[_0xb27f('0x35')](_0x2e15c9,_0x90fd2e,!![]);}catch(_0x3b10a2){return BPromise[_0xb27f('0x36')](_0x3b10a2);}return _0x2e15c9[_0xb27f('0x37')]();};}function saveUpdates(_0x41a880,_0x4e0c0c){return function(_0x53d93d){if(_0x53d93d){return _0x53d93d[_0xb27f('0x38')](_0x41a880)['then'](function(_0x2cae9a){return _0x2cae9a;});}return null;};}function removeEntity(_0x515501,_0x3dcd47){return function(_0x5dace9){if(_0x5dace9){return _0x5dace9[_0xb27f('0x39')]()[_0xb27f('0x21')](function(){_0x515501[_0xb27f('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418e5c,_0x20a6b0){return function(_0x5c5153){if(!_0x5c5153){_0x418e5c[_0xb27f('0x2b')](0x194);}return _0x5c5153;};}function handleError(_0x3beb02,_0x2bce94){_0x2bce94=_0x2bce94||0x1f4;return function(_0x259078){logger[_0xb27f('0x26')](_0x259078['stack']);if(_0x259078[_0xb27f('0x3a')]){delete _0x259078[_0xb27f('0x3a')];}_0x3beb02[_0xb27f('0x32')](_0x2bce94)[_0xb27f('0x3b')](_0x259078);};}exports[_0xb27f('0x3c')]=function(_0x4ddcf1,_0x14023c){var _0x50ced1={},_0x3bdaa4={},_0x34ac9e={'count':0x0,'rows':[]};var _0x21d34c=_['map'](db[_0xb27f('0x3d')][_0xb27f('0x3e')],function(_0x4ab5de){return{'name':_0x4ab5de[_0xb27f('0x3f')],'type':_0x4ab5de['type'][_0xb27f('0x40')]};});_0x3bdaa4['model']=_[_0xb27f('0x41')](_0x21d34c,'name');_0x3bdaa4['query']=_[_0xb27f('0x42')](_0x4ddcf1[_0xb27f('0x43')]);_0x3bdaa4[_0xb27f('0x44')]=_[_0xb27f('0x45')](_0x3bdaa4[_0xb27f('0x46')],_0x3bdaa4[_0xb27f('0x43')]);_0x50ced1[_0xb27f('0x47')]=_[_0xb27f('0x45')](_0x3bdaa4['model'],qs[_0xb27f('0x48')](_0x4ddcf1[_0xb27f('0x43')][_0xb27f('0x48')]));_0x50ced1[_0xb27f('0x47')]=_0x50ced1[_0xb27f('0x47')][_0xb27f('0x49')]?_0x50ced1[_0xb27f('0x47')]:_0x3bdaa4['model'];if(!_0x4ddcf1['query'][_0xb27f('0x4a')]('nolimit')){_0x50ced1['limit']=qs[_0xb27f('0x31')](_0x4ddcf1['query'][_0xb27f('0x31')]);_0x50ced1['offset']=qs[_0xb27f('0x30')](_0x4ddcf1[_0xb27f('0x43')][_0xb27f('0x30')]);}_0x50ced1[_0xb27f('0x4b')]=qs[_0xb27f('0x4c')](_0x4ddcf1[_0xb27f('0x43')][_0xb27f('0x4c')]);_0x50ced1[_0xb27f('0x4d')]=qs[_0xb27f('0x44')](_[_0xb27f('0x4e')](_0x4ddcf1[_0xb27f('0x43')],_0x3bdaa4[_0xb27f('0x44')]),_0x21d34c);if(_0x4ddcf1[_0xb27f('0x43')][_0xb27f('0x4f')]){_0x50ced1[_0xb27f('0x4d')]=_[_0xb27f('0x50')](_0x50ced1['where'],{'$or':_[_0xb27f('0x41')](_0x21d34c,function(_0x59ca7d){if(_0x59ca7d[_0xb27f('0x51')]!=='VIRTUAL'){var _0x48d2da={};_0x48d2da[_0x59ca7d[_0xb27f('0x3a')]]={'$like':'%'+_0x4ddcf1['query'][_0xb27f('0x4f')]+'%'};return _0x48d2da;}})});}_0x50ced1=_[_0xb27f('0x50')]({},_0x50ced1,_0x4ddcf1[_0xb27f('0x52')]);var _0xf2c39d={'where':_0x50ced1['where']};return db[_0xb27f('0x3d')][_0xb27f('0x2f')](_0xf2c39d)[_0xb27f('0x21')](function(_0x1724c6){_0x34ac9e['count']=_0x1724c6;if(_0x4ddcf1[_0xb27f('0x43')][_0xb27f('0x53')]){_0x50ced1['include']=[{'all':!![]}];}return db[_0xb27f('0x3d')][_0xb27f('0x54')](_0x50ced1);})[_0xb27f('0x21')](function(_0x385abb){_0x34ac9e[_0xb27f('0x55')]=_0x385abb;return _0x34ac9e;})[_0xb27f('0x21')](respondWithFilteredResult(_0x14023c,_0x50ced1))[_0xb27f('0x2a')](handleError(_0x14023c,null));};exports[_0xb27f('0x56')]=function(_0x5171f3,_0x111c37){var _0x30fc02={'raw':!![],'where':{'id':_0x5171f3[_0xb27f('0x57')]['id']}},_0x2543ad={};_0x2543ad[_0xb27f('0x46')]=_[_0xb27f('0x42')](db[_0xb27f('0x3d')][_0xb27f('0x3e')]);_0x2543ad[_0xb27f('0x43')]=_[_0xb27f('0x42')](_0x5171f3[_0xb27f('0x43')]);_0x2543ad['filters']=_['intersection'](_0x2543ad[_0xb27f('0x46')],_0x2543ad['query']);_0x30fc02[_0xb27f('0x47')]=_[_0xb27f('0x45')](_0x2543ad[_0xb27f('0x46')],qs['fields'](_0x5171f3['query']['fields']));_0x30fc02['attributes']=_0x30fc02[_0xb27f('0x47')][_0xb27f('0x49')]?_0x30fc02[_0xb27f('0x47')]:_0x2543ad['model'];if(_0x5171f3[_0xb27f('0x43')][_0xb27f('0x53')]){_0x30fc02['include']=[{'all':!![]}];}_0x30fc02=_[_0xb27f('0x50')]({},_0x30fc02,_0x5171f3['options']);return db[_0xb27f('0x3d')][_0xb27f('0x58')](_0x30fc02)[_0xb27f('0x21')](handleEntityNotFound(_0x111c37,null))[_0xb27f('0x21')](respondWithResult(_0x111c37,null))[_0xb27f('0x2a')](handleError(_0x111c37,null));};exports[_0xb27f('0x59')]=function(_0x4d6dce,_0x80b722){return db[_0xb27f('0x3d')]['create'](_0x4d6dce[_0xb27f('0x5a')],{})[_0xb27f('0x21')](respondWithResult(_0x80b722,0xc9))[_0xb27f('0x2a')](handleError(_0x80b722,null));};exports['update']=function(_0x134a2e,_0x41997d){if(_0x134a2e['body']['id']){delete _0x134a2e['body']['id'];}return db[_0xb27f('0x3d')]['find']({'where':{'id':_0x134a2e[_0xb27f('0x57')]['id']}})['then'](handleEntityNotFound(_0x41997d,null))[_0xb27f('0x21')](saveUpdates(_0x134a2e[_0xb27f('0x5a')],null))[_0xb27f('0x21')](respondWithResult(_0x41997d,null))[_0xb27f('0x2a')](handleError(_0x41997d,null));};exports[_0xb27f('0x39')]=function(_0x1c9b5d,_0x28da2d){return db[_0xb27f('0x3d')][_0xb27f('0x58')]({'where':{'id':_0x1c9b5d[_0xb27f('0x57')]['id']}})[_0xb27f('0x21')](handleEntityNotFound(_0x28da2d,null))[_0xb27f('0x21')](removeEntity(_0x28da2d,null))[_0xb27f('0x2a')](handleError(_0x28da2d,null));};exports['describe']=function(_0x25aaa9,_0x35a47f){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x35a47f,null))[_0xb27f('0x2a')](handleError(_0x35a47f,null));};var interaction_log=require(_0xb27f('0x14'))(_0xb27f('0x5b'));exports[_0xb27f('0x5c')]=function(_0x1a1d90,_0x104837,_0x40dadf){var _0xe64d58={'agent':{},'channel':_0xb27f('0x5d')};if(_0x1a1d90['body']['id']){delete _0x1a1d90[_0xb27f('0x5a')]['id'];}_0x1a1d90[_0xb27f('0x5a')]['read']=!![];_0x1a1d90[_0xb27f('0x5a')]['readAt']=moment()[_0xb27f('0x5e')](_0xb27f('0x5f'));_0x1a1d90[_0xb27f('0x5a')]['UserId']=_0x1a1d90[_0xb27f('0x5a')]['UserId']||_0x1a1d90['user']['id'];_0xe64d58['agent']['id']=_0x1a1d90[_0xb27f('0x5a')][_0xb27f('0x60')];return db[_0xb27f('0x3d')][_0xb27f('0x58')]({'where':{'id':_0x1a1d90[_0xb27f('0x57')]['id'],'UserId':null}})[_0xb27f('0x21')](handleEntityNotFound(_0x104837,null))[_0xb27f('0x21')](saveUpdates(_0x1a1d90[_0xb27f('0x5a')],null))['then'](function(_0x23a805){if(_0x23a805){_0xe64d58[_0xb27f('0x28')]=_0x23a805['get']({'plain':!![]});return db[_0xb27f('0x61')]['find']({'where':{'id':_0x23a805[_0xb27f('0x62')]}});}return null;})[_0xb27f('0x21')](handleEntityNotFound(_0x104837,null))['then'](function(_0x4efb61){if(_0x4efb61){return _0x4efb61['update']({'UserId':_0x1a1d90[_0xb27f('0x5a')]['UserId'],'read1stAt':_[_0xb27f('0x63')](_0x4efb61[_0xb27f('0x64')])?moment()[_0xb27f('0x5e')](_0xb27f('0x5f')):undefined});}return null;})[_0xb27f('0x21')](function(_0x3a9e4e){if(_0x3a9e4e){_0xe64d58['interaction']=_0x3a9e4e[_0xb27f('0x65')]({'plain':!![]});interaction_log[_0xb27f('0x29')](_0xb27f('0x66'),_0x1a1d90['user']['id'],_0x1a1d90[_0xb27f('0x67')][_0xb27f('0x3a')],_0x1a1d90[_0xb27f('0x67')][_0xb27f('0x68')],_0xe64d58[_0xb27f('0x69')]['id'],_0x1a1d90['body']?JSON[_0xb27f('0x25')](_0x1a1d90[_0xb27f('0x5a')]):_0xb27f('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xe64d58);}return null;})['then'](function(_0x318069){var _0x377ca9=_0xb27f('0x6b')+_0x318069['message'][_0xb27f('0x6c')];return db['sequelize']['query'](_0x377ca9,{'type':db[_0xb27f('0x6d')]['QueryTypes'][_0xb27f('0x6e')],'raw':!![]})['then'](function(_0x1fe172){return _0x1fe172;});})[_0xb27f('0x21')](function(_0x16a5f8){if(_0x16a5f8){_0xe64d58[_0xb27f('0x28')]['contact']=_0x16a5f8[0x0];if(!_0x1a1d90['body'][_0xb27f('0x60')])return;return db['User'][_0xb27f('0x58')]({'where':{'id':_0x1a1d90['body'][_0xb27f('0x60')],'role':_0xb27f('0x6f')},'attributes':['id',_0xb27f('0x3a'),_0xb27f('0x70'),_0xb27f('0x71'),'internal'],'raw':!![]});}return null;})[_0xb27f('0x21')](function(_0x2258df){if(!_0x2258df)return null;_0xe64d58[_0xb27f('0x28')][_0xb27f('0x6f')]=_0x2258df;return _0xe64d58;})[_0xb27f('0x21')](function(_0x29f5d2){if(_0x29f5d2){if(_0x1a1d90[_0xb27f('0x5a')]['manual']){_0xe64d58[_0xb27f('0x28')][_0xb27f('0x72')]=util[_0xb27f('0x5e')]('SIP/%s',_0x1a1d90['user']['name']);_0xe64d58['message'][_0xb27f('0x73')]=_0xe64d58[_0xb27f('0x73')];_0xe64d58[_0xb27f('0x28')]['motionChannel']=_0xe64d58[_0xb27f('0x73')];_0xe64d58['message']['event']=_0xb27f('0x5c');return respondWithRpcPromise(_0xb27f('0x74'),_0xb27f('0x74'),{'event':_0xb27f('0x75'),'message':_0xe64d58[_0xb27f('0x28')]},client9002)[_0xb27f('0x21')](function(){return _0xe64d58;});}return _0xe64d58;}return null;})[_0xb27f('0x21')](respondWithResult(_0x104837,null))['catch'](handleError(_0x104837,null));};var interaction_log=require('../../config/logger')(_0xb27f('0x5b'));exports[_0xb27f('0x36')]=function(_0x2303ab,_0x5134bd,_0x1a19bf){var _0x246d4a={'agent':{},'channel':_0xb27f('0x5d')};if(_0x2303ab[_0xb27f('0x5a')]['id']){delete _0x2303ab[_0xb27f('0x5a')]['id'];}_0x2303ab['body']['UserId']=_0x2303ab[_0xb27f('0x5a')][_0xb27f('0x60')]||_0x2303ab[_0xb27f('0x67')]['id'];_0x246d4a[_0xb27f('0x6f')]['id']=_0x2303ab[_0xb27f('0x5a')][_0xb27f('0x60')];return db[_0xb27f('0x3d')]['find']({'where':{'id':_0x2303ab[_0xb27f('0x57')]['id'],'UserId':null}})[_0xb27f('0x21')](handleEntityNotFound(_0x5134bd,null))['then'](function(_0x54bb5c){if(_0x54bb5c){_0x246d4a['message']=_0x54bb5c[_0xb27f('0x65')]({'plain':!![]});return db[_0xb27f('0x61')][_0xb27f('0x58')]({'where':{'id':_0x54bb5c[_0xb27f('0x62')]}});}return null;})[_0xb27f('0x21')](handleEntityNotFound(_0x5134bd,null))['then'](function(_0x5a0b9d){if(_0x5a0b9d){_0x246d4a[_0xb27f('0x69')]=_0x5a0b9d[_0xb27f('0x65')]({'plain':!![]});interaction_log[_0xb27f('0x29')](_0xb27f('0x76'),_0x2303ab[_0xb27f('0x67')]['id'],_0x2303ab['user']['name'],_0x2303ab[_0xb27f('0x67')]['role'],_0x246d4a[_0xb27f('0x69')]['id'],_0x2303ab[_0xb27f('0x5a')]?JSON[_0xb27f('0x25')](_0x2303ab['body']):_0xb27f('0x6a'));return respondWithRpcPromise('RejectMessage',_0xb27f('0x77'),_0x246d4a);}return null;})[_0xb27f('0x21')](function(_0x2bf3fb){var _0x5c435b=_0xb27f('0x6b')+_0x2bf3fb['message'][_0xb27f('0x6c')];return db[_0xb27f('0x78')][_0xb27f('0x43')](_0x5c435b,{'type':db[_0xb27f('0x6d')][_0xb27f('0x79')]['SELECT'],'raw':!![]})[_0xb27f('0x21')](function(_0x47bb26){return _0x47bb26;});})[_0xb27f('0x21')](function(_0x52c88d){if(_0x52c88d){_0x246d4a[_0xb27f('0x28')]['contact']=_0x52c88d[0x0];if(!_0x2303ab[_0xb27f('0x5a')][_0xb27f('0x60')])return;return db[_0xb27f('0x7a')][_0xb27f('0x58')]({'where':{'id':_0x2303ab[_0xb27f('0x5a')][_0xb27f('0x60')],'role':_0xb27f('0x6f')},'attributes':['id',_0xb27f('0x3a'),_0xb27f('0x70'),_0xb27f('0x71'),_0xb27f('0x7b')],'raw':!![]});}return null;})[_0xb27f('0x21')](function(_0x163b78){if(!_0x163b78)return null;_0x246d4a[_0xb27f('0x28')][_0xb27f('0x6f')]=_0x163b78;return _0x246d4a;})[_0xb27f('0x21')](function(_0x16be5e){if(_0x16be5e){_0x16be5e[_0xb27f('0x28')][_0xb27f('0x72')]=util[_0xb27f('0x5e')](_0xb27f('0x7c'),_0x2303ab[_0xb27f('0x67')][_0xb27f('0x3a')]);_0x16be5e[_0xb27f('0x28')]['channel']=_0x246d4a[_0xb27f('0x73')];_0x16be5e[_0xb27f('0x28')]['motionChannel']=_0x246d4a[_0xb27f('0x73')];_0x16be5e[_0xb27f('0x28')][_0xb27f('0x7d')]=_0xb27f('0x36');respondWithRpcPromise(_0xb27f('0x74'),'EventManager',{'event':_0xb27f('0x7e'),'message':_0x16be5e[_0xb27f('0x28')]},client9002);return _0x246d4a;}return null;})[_0xb27f('0x21')](respondWithResult(_0x5134bd,null))[_0xb27f('0x2a')](handleError(_0x5134bd,null));};exports[_0xb27f('0x32')]=function(_0x4729f2,_0x38fed6,_0x30e2bc){if(_0x4729f2[_0xb27f('0x5a')]['id']){delete _0x4729f2['body']['id'];}var _0x26d465;return db[_0xb27f('0x3d')][_0xb27f('0x58')]({'where':{'id':_0x4729f2['params']['id']}})[_0xb27f('0x21')](handleEntityNotFound(_0x38fed6,null))[_0xb27f('0x21')](function(_0x593c2c){if(_0x593c2c){_0x26d465=_0x593c2c;return db[_0xb27f('0x7f')]['find']({'where':{'id':_0x593c2c[_0xb27f('0x80')]}});}})['then'](handleEntityNotFound(_0x38fed6,null))[_0xb27f('0x21')](function(_0xcb1cc5){if(_0xcb1cc5){logger[_0xb27f('0x24')](_0xb27f('0x81'),_0xb27f('0x32'),_0xb27f('0x82'),_0xcb1cc5['type'],util['inspect'](_0x4729f2[_0xb27f('0x5a')],{'showHidden':![],'depth':null}));switch(_0xcb1cc5[_0xb27f('0x51')]){case _0xb27f('0x83'):if(_0x4729f2[_0xb27f('0x5a')][_0xb27f('0x84')]&&_0x4729f2[_0xb27f('0x5a')][_0xb27f('0x84')]===_0x26d465[_0xb27f('0x85')]){return _0x26d465['update']({'read':!![]});}else{logger[_0xb27f('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb27f('0x32'),_0xb27f('0x83'),util[_0xb27f('0x86')](_0x4729f2[_0xb27f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xb27f('0x87'):if(_0x4729f2[_0xb27f('0x5a')][_0xb27f('0x88')]&&_0x4729f2[_0xb27f('0x5a')][_0xb27f('0x88')]===_0x26d465[_0xb27f('0x85')]&&_[_0xb27f('0x89')]([_0xb27f('0x8a'),_0xb27f('0x8b')],_0x4729f2[_0xb27f('0x5a')][_0xb27f('0x8c')])>=0x0){return _0x26d465[_0xb27f('0x38')]({'read':!![]});}else{logger[_0xb27f('0x26')](_0xb27f('0x8d'),'status',_0xb27f('0x8e'),util[_0xb27f('0x86')](_0x4729f2[_0xb27f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xb27f('0x8f'):var _0x503c22=_0x4729f2[_0xb27f('0x5a')][_0xb27f('0x90')][0x0];if(_0x503c22[_0xb27f('0x32')][_0xb27f('0x91')]==='DELIVERED'){return _0x26d465[_0xb27f('0x38')]({'read':!![]});}else{logger[_0xb27f('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb27f('0x32'),'infobip',util[_0xb27f('0x86')](_0x4729f2[_0xb27f('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x26d465;}})[_0xb27f('0x21')](respondWithResult(_0x38fed6,null))[_0xb27f('0x2a')](handleError(_0x38fed6,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 05e6575..573c0b7 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 _0xd5dc=['hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5c5eb8,_0x53e878){var _0x3bf307=function(_0x2e1a79){while(--_0x2e1a79){_0x5c5eb8['push'](_0x5c5eb8['shift']());}};_0x3bf307(++_0x53e878);}(_0xd5dc,0x122));var _0xcd5d=function(_0x44b1c5,_0x1e7fdf){_0x44b1c5=_0x44b1c5-0x0;var _0x365acd=_0xd5dc[_0x44b1c5];return _0x365acd;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xcd5d('0x0'))['db'][_0xcd5d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xcd5d('0x2')](0x0);var events={'afterCreate':_0xcd5d('0x3'),'afterUpdate':'update','afterDestroy':_0xcd5d('0x4')};function emitEvent(_0x259e7a){return function(_0x39a8ad,_0x424a3d,_0x32e14e){SmsMessageEvents[_0xcd5d('0x5')](_0x259e7a+':'+_0x39a8ad['id'],_0x39a8ad);SmsMessageEvents['emit'](_0x259e7a,_0x39a8ad);_0x32e14e(null);};}for(var e in events){if(events[_0xcd5d('0x6')](e)){var event=events[e];SmsMessage[_0xcd5d('0x7')](e,emitEvent(event));}}module[_0xcd5d('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xc486=['emit','hasOwnProperty','hook','events','SmsMessage','setMaxListeners','save'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xc486,0xc7));var _0x6c48=function(_0x5876ad,_0x2150c0){_0x5876ad=_0x5876ad-0x0;var _0x4d46f7=_0xc486[_0x5876ad];return _0x4d46f7;};'use strict';var EventEmitter=require(_0x6c48('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x6c48('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6c48('0x2')](0x0);var events={'afterCreate':_0x6c48('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d9646){return function(_0xf2629,_0x36cb48,_0x31182c){SmsMessageEvents[_0x6c48('0x4')](_0x3d9646+':'+_0xf2629['id'],_0xf2629);SmsMessageEvents[_0x6c48('0x4')](_0x3d9646,_0xf2629);_0x31182c(null);};}for(var e in events){if(events[_0x6c48('0x5')](e)){var event=events[e];SmsMessage[_0x6c48('0x6')](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 981fac5..4a34599 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 _0x1b73=['utf8mb4','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','catch','out','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','error','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','username','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','accountId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','intelepeer'];(function(_0x42ebd6,_0x3c8f5e){var _0x429d4e=function(_0x531cd3){while(--_0x531cd3){_0x42ebd6['push'](_0x42ebd6['shift']());}};_0x429d4e(++_0x3c8f5e);}(_0x1b73,0x1d5));var _0x31b7=function(_0x75f30e,_0x1bc242){_0x75f30e=_0x75f30e-0x0;var _0x967dca=_0x1b73[_0x75f30e];return _0x967dca;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var logger=require(_0x31b7('0x1'))(_0x31b7('0x2'));var moment=require(_0x31b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x31b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31b7('0x5'));var config=require(_0x31b7('0x6'));var attributes=require('./smsMessage.attributes');module[_0x31b7('0x7')]=function(_0x3d058f,_0x15c31e){return _0x3d058f['define'](_0x31b7('0x8'),attributes,{'tableName':_0x31b7('0x9'),'paranoid':![],'indexes':[{'name':_0x31b7('0xa'),'fields':[_0x31b7('0xa')]},{'name':_0x31b7('0xb'),'fields':[_0x31b7('0xc')],'type':_0x31b7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x499568,_0x268428,_0x3ea646){var _0x2497bd=_0x3d058f[_0x31b7('0xe')];var _0x1d1f0f=_0x499568[_0x31b7('0xf')]({'plain':!![]});if(_0x1d1f0f[_0x31b7('0x10')][_0x31b7('0x11')]()==='in'||_0x1d1f0f[_0x31b7('0x10')][_0x31b7('0x11')]()==='out'&&!_0x1d1f0f[_0x31b7('0x12')]&&!_[_0x31b7('0x13')](_0x1d1f0f[_0x31b7('0x14')])){_0x2497bd[_0x31b7('0x15')][_0x31b7('0x16')]({'where':{'id':_0x1d1f0f[_0x31b7('0x17')]}})[_0x31b7('0x18')](function(_0x34e917){if(_0x34e917){_0x34e917[_0x31b7('0x19')]({'lastMsgAt':_0x1d1f0f['createdAt'],'lastMsgDirection':_0x1d1f0f[_0x31b7('0x10')]['toLowerCase']()});}})[_0x31b7('0x1a')](function(_0xf213c9){console['error'](_0xf213c9);});}if(_0x1d1f0f[_0x31b7('0x10')]===_0x31b7('0x1b')&&!_0x1d1f0f[_0x31b7('0x12')]){var _0x39eee9;_0x2497bd[_0x31b7('0x1c')]['find']({'where':{'id':_0x1d1f0f[_0x31b7('0x1d')]},'raw':!![]})[_0x31b7('0x18')](function(_0x1dc28c){_0x39eee9=_0x1dc28c;if(_0x39eee9&&_0x39eee9[_0x31b7('0x1e')]){switch(_0x39eee9[_0x31b7('0x1e')]){case'twilio':var _0x19ad46=require(_0x31b7('0x1f'));if(_0x39eee9[_0x31b7('0x20')]&&_0x39eee9[_0x31b7('0x21')]&&_0x39eee9['phone']){var _0x892fe4=new _0x19ad46(_0x39eee9[_0x31b7('0x20')],_0x39eee9[_0x31b7('0x21')]);_0x892fe4[_0x31b7('0x22')]['create']({'body':_0x1d1f0f[_0x31b7('0xc')],'to':_0x1d1f0f[_0x31b7('0x23')],'from':_0x39eee9[_0x31b7('0x23')],'statusCallback':_0x39eee9[_0x31b7('0x24')]+_0x31b7('0x25')+_0x1d1f0f['id']+_0x31b7('0x26')+_0x39eee9[_0x31b7('0x27')]})[_0x31b7('0x18')](function(_0x3b0eff){if(_0x3b0eff['sid']){return _0x499568[_0x31b7('0x19')]({'messageId':_0x3b0eff[_0x31b7('0x28')]});}})[_0x31b7('0x1a')](function(_0x2c993b){logger['error'](_0x31b7('0x29'),'afterCreate',_0x31b7('0x1f'),util[_0x31b7('0x2a')](_0x2c993b,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x1f'),_0x31b7('0x2d'));}break;case _0x31b7('0x2e'):var _0x4e58e5='https://api.skebby.it/API/v1.0/REST/';if(_0x39eee9['username']&&_0x39eee9[_0x31b7('0x2f')]){var _0x39521d={'recipient':[_0x1d1f0f[_0x31b7('0x23')]],'message':_0x1d1f0f['body'],'message_type':_0x39eee9[_0x31b7('0x30')]};if(_0x39eee9[_0x31b7('0x30')]&&_0x39eee9[_0x31b7('0x30')]!=='SI'){_0x39521d[_0x31b7('0x31')]=_0x39eee9['phone'];}var _0xc974a2={'url':_0x4e58e5+_0x31b7('0x32')+_0x39eee9['username']+'&password='+_0x39eee9[_0x31b7('0x2f')],'method':_0x31b7('0x33')};rp(_0xc974a2)[_0x31b7('0x18')](function(_0x35f83c){var _0x53f1cb=_0x35f83c['split'](';');var _0x45f029={'user_key':_0x53f1cb[0x0],'session_key':_0x53f1cb[0x1]};_0xc974a2={'url':_0x4e58e5+_0x31b7('0x34'),'method':_0x31b7('0x35'),'headers':{'user_key':_0x45f029[_0x31b7('0x36')],'Session_key':_0x45f029[_0x31b7('0x37')]},'json':!![],'body':_0x39521d};return rp(_0xc974a2);})['then'](function(_0x4e6863){if(_0x4e6863[_0x31b7('0x38')]>=0x1){var _0x2234cd={'messageId':_0x4e6863['internal_order_id']};if(_0x39eee9[_0x31b7('0x30')]!=='GP'||!_0x39eee9[_0x31b7('0x39')]){_0x2234cd['read']=!![];}return _0x499568[_0x31b7('0x19')](_0x2234cd);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x2e'),util[_0x31b7('0x2a')](_0x4e6863,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x200314){return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x2e'),util[_0x31b7('0x2a')](_0x200314,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),_0x31b7('0x2e'),_0x31b7('0x3a'));}break;case _0x31b7('0x3b'):if(_0x39eee9[_0x31b7('0x21')]){var _0xe3e29f={'recipient':_0x1d1f0f[_0x31b7('0x23')],'message':_0x1d1f0f[_0x31b7('0xc')],'sender':_0x39eee9[_0x31b7('0x3c')]||_0x39eee9[_0x31b7('0x23')],'authorization':_0x39eee9['authToken']};var _0x268428={'method':_0x31b7('0x35'),'uri':_0x31b7('0x3d'),'body':_0xe3e29f,'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x5c9cec){var _0x20e865={'messageId':_0x5c9cec[_0x31b7('0x3e')]};if(!_0x39eee9['deliveryReport']){_0x20e865[_0x31b7('0x3f')]=!![];}return _0x499568['update'](_0x20e865);})['catch'](function(_0x6b2bbd){logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x3b'),util['inspect'](_0x6b2bbd,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x31b7('0x40'));}break;case _0x31b7('0x41'):if(_0x39eee9[_0x31b7('0x42')]&&_0x39eee9[_0x31b7('0x2f')]){var _0xe3e29f={'messages':[{'source':'xCALLY\x20Motion','to':_0x1d1f0f[_0x31b7('0x23')],'body':_0x1d1f0f['body'],'from':_0x39eee9[_0x31b7('0x3c')]||_0x39eee9[_0x31b7('0x23')]}]};var _0x3bf1f1=util[_0x31b7('0x43')]('%s:%s',_0x39eee9[_0x31b7('0x42')],_0x39eee9[_0x31b7('0x2f')]);var _0x268428={'method':'POST','uri':_0x31b7('0x44'),'body':_0xe3e29f,'headers':{'Authorization':util['format'](_0x31b7('0x45'),new Buffer(_0x3bf1f1)[_0x31b7('0x46')]('base64'))},'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x3b65de){if(_0x3b65de[_0x31b7('0x47')]>=0xc8&&_0x3b65de[_0x31b7('0x47')]<=0xce){if(_0x3b65de['data']&&_0x3b65de[_0x31b7('0x48')]['queued_count']>0x0){var _0x558d82=_[_0x31b7('0x49')](_0x3b65de[_0x31b7('0x48')][_0x31b7('0x22')]);var _0x104a71={'messageId':_0x558d82['message_id']};if(!_0x39eee9[_0x31b7('0x39')]){_0x104a71[_0x31b7('0x3f')]=!![];}return _0x499568['update'](_0x104a71);}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),'clickSend',util[_0x31b7('0x2a')](_0x3b65de,{'showHidden':![],'depth':null}));}}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x4a'),util[_0x31b7('0x2a')](_0x3b65de,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x40aead){logger['error'](_0x31b7('0x29'),'afterCreate','clickSend',util[_0x31b7('0x2a')](_0x40aead,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),'clickSend',_0x31b7('0x3a'));}break;case _0x31b7('0x4b'):if(_0x39eee9[_0x31b7('0x4c')]&&_0x39eee9['authToken']){var _0xe3e29f={'dst':_0x1d1f0f[_0x31b7('0x23')],'text':_0x1d1f0f[_0x31b7('0xc')],'src':_0x39eee9[_0x31b7('0x3c')]||_0x39eee9[_0x31b7('0x23')],'url':_0x39eee9[_0x31b7('0x24')]+_0x31b7('0x25')+_0x1d1f0f['id']+_0x31b7('0x26')+_0x39eee9['token']};var _0x3bf1f1=util[_0x31b7('0x43')](_0x31b7('0x4d'),_0x39eee9[_0x31b7('0x4c')],_0x39eee9[_0x31b7('0x21')]);var _0x268428={'method':'POST','uri':util[_0x31b7('0x43')](_0x31b7('0x4e'),_0x39eee9[_0x31b7('0x4c')]),'body':_0xe3e29f,'headers':{'Authorization':util[_0x31b7('0x43')](_0x31b7('0x45'),new Buffer(_0x3bf1f1)[_0x31b7('0x46')](_0x31b7('0x4f')))},'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x5a67a9){var _0x535a3c={'messageId':_0x5a67a9[_0x31b7('0x50')][0x0]};return _0x499568[_0x31b7('0x19')](_0x535a3c);})[_0x31b7('0x1a')](function(_0x36943d){logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x4b'),util[_0x31b7('0x2a')](_0x36943d,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x31b7('0x4b'),_0x31b7('0x51'));}break;case _0x31b7('0x52'):if(_0x39eee9[_0x31b7('0x42')]&&_0x39eee9['password']){if(_0x39eee9[_0x31b7('0x53')]){var _0x12b15d={'method':_0x31b7('0x35'),'uri':_0x39eee9[_0x31b7('0x53')]+_0x31b7('0x54'),'body':{'username':_0x39eee9[_0x31b7('0x42')],'password':_0x39eee9[_0x31b7('0x2f')]},'json':!![]};return rp(_0x12b15d)[_0x31b7('0x18')](function(_0x1c58a7){var _0x289a0b={'method':_0x31b7('0x35'),'uri':_0x39eee9['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x39eee9[_0x31b7('0x23')],'destinations':[{'to':_0x1d1f0f[_0x31b7('0x23')]}],'text':_0x1d1f0f[_0x31b7('0xc')],'notifyUrl':_0x39eee9[_0x31b7('0x24')]+_0x31b7('0x25')+_0x1d1f0f['id']+_0x31b7('0x26')+_0x39eee9['token'],'notifyContentType':_0x31b7('0x55'),'callbackData':_0x39eee9['phone']+';'+_0x1d1f0f['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x1c58a7[_0x31b7('0x27')]},'json':!![]};return rp(_0x289a0b)[_0x31b7('0x18')](function(_0x2ea5b6){if(_0x2ea5b6[_0x31b7('0x22')]){var _0x44934f={'messageId':_0x2ea5b6[_0x31b7('0x22')][0x0][_0x31b7('0xa')]};if(!_0x39eee9[_0x31b7('0x39')]){_0x44934f[_0x31b7('0x3f')]=!![];}return _0x499568[_0x31b7('0x19')](_0x44934f);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x52'),util[_0x31b7('0x2a')](_0x2ea5b6,{'showHidden':![],'depth':null}));}});})[_0x31b7('0x1a')](function(_0x317558){return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x52'),util[_0x31b7('0x2a')](_0x317558,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),'afterCreate',_0x31b7('0x52'),_0x31b7('0x56'));}}else{logger['error'](_0x31b7('0x29'),'afterCreate',_0x31b7('0x52'),_0x31b7('0x3a'));}break;case _0x31b7('0x57'):var _0x516eac=require('crypto');if(_0x39eee9[_0x31b7('0x58')]){var _0x52208e={};_0x52208e[_0x31b7('0x59')]=_0x39eee9[_0x31b7('0x42')];_0x52208e[_0x31b7('0x23')]=_0x1d1f0f[_0x31b7('0x23')];_0x52208e[_0x31b7('0x31')]=_0x39eee9[_0x31b7('0x23')];_0x52208e['text']=_0x1d1f0f[_0x31b7('0xc')];_0x52208e[_0x31b7('0x5a')]=+new Date();var _0x45ee19='';var _0x23a45e='';var _0x3c0cf8=Object[_0x31b7('0x5b')](_0x52208e);_0x3c0cf8[_0x31b7('0x5c')]();for(var _0x409a7c=0x0;_0x409a7c<_0x3c0cf8[_0x31b7('0x5d')];_0x409a7c++){if(_0x45ee19!=''){_0x45ee19+='&';}_0x45ee19+=_0x3c0cf8[_0x409a7c]+'='+encodeURIComponent(_0x52208e[_0x3c0cf8[_0x409a7c]]);_0x23a45e+=_0x52208e[_0x3c0cf8[_0x409a7c]];}_0x23a45e+=_0x39eee9[_0x31b7('0x58')];_0x23a45e=_0x516eac[_0x31b7('0x5e')](_0x31b7('0x5f'))[_0x31b7('0x19')](_0x23a45e)[_0x31b7('0x60')](_0x31b7('0x61'));if(_0x45ee19!==''){_0x45ee19+='&';}_0x45ee19+=_0x31b7('0x62')+_0x23a45e;var _0xc974a2={'method':_0x31b7('0x33'),'uri':_0x39eee9[_0x31b7('0x53')]+_0x31b7('0x63')+_0x45ee19,'json':!![]};return rp(_0xc974a2)[_0x31b7('0x18')](function(_0x2640db){var _0x3f9ef3=Object[_0x31b7('0x5b')](_0x2640db);if(_0x2640db[_0x3f9ef3[0x0]][_0x31b7('0x2b')]&&parseInt(_0x2640db[_0x3f9ef3[0x0]][_0x31b7('0x2b')])===0x0){var _0x14f87a={'messageId':_0x2640db[_0x3f9ef3[0x0]][_0x31b7('0x64')]};if(!_0x39eee9[_0x31b7('0x39')]){_0x14f87a[_0x31b7('0x3f')]=!![];}return _0x499568[_0x31b7('0x19')](_0x14f87a);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x57'),util[_0x31b7('0x2a')](_0x2640db[_0x31b7('0x2b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3c978d){return logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),_0x31b7('0x57'),util[_0x31b7('0x2a')](_0x3c978d,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),'afterCreate',_0x31b7('0x57'),_0x31b7('0x65'));}break;case _0x31b7('0x66'):if(_0x39eee9[_0x31b7('0x58')]){var _0x22aa06={'method':_0x31b7('0x35'),'uri':_0x31b7('0x67'),'headers':{'Authorization':_0x39eee9[_0x31b7('0x58')]},'body':{'content':_0x1d1f0f[_0x31b7('0xc')],'to':[_0x1d1f0f[_0x31b7('0x23')]],'from':_0x39eee9[_0x31b7('0x23')],'binary':![],'clientMessageId':_0x31b7('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x22aa06)['then'](function(_0x53dcd6){if(!_0x53dcd6[_0x31b7('0x2b')]){var _0x5d4fd3={'messageId':_0x53dcd6[_0x31b7('0x22')][0x0][_0x31b7('0x69')]};if(!_0x39eee9['deliveryReport']){_0x5d4fd3[_0x31b7('0x3f')]=!![];}return _0x499568[_0x31b7('0x19')](_0x5d4fd3);}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),'afterCreate','clickatell',util[_0x31b7('0x2a')](_0x53dcd6[_0x31b7('0x2b')],{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x332190){return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x66'),util[_0x31b7('0x2a')](_0x332190,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),'clickatell',_0x31b7('0x65'));}break;case'bandwidth':if(_0x39eee9[_0x31b7('0x42')]&&_0x39eee9[_0x31b7('0x2f')]){var _0x3bf1f1=util[_0x31b7('0x43')]('%s:%s',_0x39eee9['username'],_0x39eee9['password']);var _0x268428={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x39eee9[_0x31b7('0x6a')]+'/messages','body':{'to':[_0x1d1f0f[_0x31b7('0x23')]],'text':_0x1d1f0f[_0x31b7('0xc')],'from':_0x39eee9['phone'],'applicationId':_0x39eee9['applicationId']},'headers':{'Authorization':util[_0x31b7('0x43')](_0x31b7('0x45'),new Buffer(_0x3bf1f1)[_0x31b7('0x46')](_0x31b7('0x4f')))},'json':!![]};rp(_0x268428)[_0x31b7('0x18')](function(_0x56ebb9){if(_0x56ebb9['id']){var _0x228cb6={'messageId':_0x56ebb9['id']};return _0x499568[_0x31b7('0x19')](_0x228cb6);}else{logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x6b'),util['inspect'](_0x56ebb9,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x4028e3){logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x6b'),util['inspect'](_0x4028e3,{'showHidden':![],'depth':null}));});}else{logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),'bandwidth',_0x31b7('0x3a'));}break;case'intelepeer':if(_0x39eee9['apiKey']){var _0x39956e={};var _0xc974a2={'method':'POST','uri':_0x31b7('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x39eee9[_0x31b7('0x58')],'Content-Type':_0x31b7('0x55')},'body':{'from':_0x39eee9[_0x31b7('0x23')],'to':_0x1d1f0f[_0x31b7('0x23')],'text':_0x1d1f0f[_0x31b7('0xc')]},'json':!![]};return rp(_0xc974a2)['then'](function(_0x514d6b){if(_0x514d6b[_0x31b7('0x6d')]==0xca){_0x39956e[_0x31b7('0x6e')]=_0x514d6b;var _0x3f8b01={'method':'POST','uri':_0x31b7('0x6f'),'headers':{'Authorization':_0x31b7('0x70')+_0x39eee9[_0x31b7('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x39956e['message'][_0x31b7('0x71')]},'json':!![]};return rp(_0x3f8b01)['then'](function(_0x27132b){_0x39956e[_0x31b7('0x72')]=_0x27132b;var _0x5da016={'messageId':_0x39956e[_0x31b7('0x6e')]['refid'],'read':!![]};return _0x499568['update'](_0x5da016);});}else{return logger[_0x31b7('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31b7('0x2c'),_0x31b7('0x73'),util['inspect'](_0x514d6b,{'showHidden':![],'depth':null}));}})[_0x31b7('0x1a')](function(_0x4436d0){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x31b7('0x73'),util[_0x31b7('0x2a')](_0x4436d0,{'showHidden':![],'depth':null}));});}else{return logger[_0x31b7('0x2b')](_0x31b7('0x29'),_0x31b7('0x2c'),_0x31b7('0x73'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x3ea646();});}else{_0x3ea646();}}},'charset':_0x31b7('0x74'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf874=['uuid','apiMessageId','bandwidth','%s:%s','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','senderString','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','queued_count','head','message_id','clickSend','authId','/api/sms/messages/','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','infobip','baseUrl','/auth/1/session','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','sort','md5','hex','signature=','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell'];(function(_0x2280ff,_0x45b5b2){var _0x657217=function(_0x13ed6f){while(--_0x13ed6f){_0x2280ff['push'](_0x2280ff['shift']());}};_0x657217(++_0x45b5b2);}(_0xf874,0x177));var _0x4f87=function(_0x51b8ba,_0x5879ec){_0x51b8ba=_0x51b8ba-0x0;var _0x1a7f76=_0xf874[_0x51b8ba];return _0x1a7f76;};'use strict';var _=require(_0x4f87('0x0'));var util=require('util');var logger=require(_0x4f87('0x1'))(_0x4f87('0x2'));var moment=require(_0x4f87('0x3'));var BPromise=require(_0x4f87('0x4'));var rp=require(_0x4f87('0x5'));var fs=require('fs');var path=require(_0x4f87('0x6'));var rimraf=require(_0x4f87('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f87('0x8'));module[_0x4f87('0x9')]=function(_0x5d9a23,_0x50bcb8){return _0x5d9a23['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x4f87('0xa'),'fields':['messageId']},{'name':_0x4f87('0xb'),'fields':[_0x4f87('0xc')],'type':_0x4f87('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf43741,_0x4dfb28,_0x25dea7){var _0x364d09=_0x5d9a23[_0x4f87('0xe')];var _0x1777bb=_0xf43741[_0x4f87('0xf')]({'plain':!![]});if(_0x1777bb[_0x4f87('0x10')][_0x4f87('0x11')]()==='in'||_0x1777bb[_0x4f87('0x10')][_0x4f87('0x11')]()===_0x4f87('0x12')&&!_0x1777bb[_0x4f87('0x13')]&&!_['isNil'](_0x1777bb[_0x4f87('0x14')])){_0x364d09[_0x4f87('0x15')]['findOne']({'where':{'id':_0x1777bb['SmsInteractionId']}})[_0x4f87('0x16')](function(_0x5908c2){if(_0x5908c2){_0x5908c2[_0x4f87('0x17')]({'lastMsgAt':_0x1777bb[_0x4f87('0x18')],'lastMsgDirection':_0x1777bb[_0x4f87('0x10')][_0x4f87('0x11')]()});}})[_0x4f87('0x19')](function(_0x258dfc){console[_0x4f87('0x1a')](_0x258dfc);});}if(_0x1777bb[_0x4f87('0x10')]===_0x4f87('0x12')&&!_0x1777bb[_0x4f87('0x13')]){var _0x3ffd7b;_0x364d09[_0x4f87('0x1b')][_0x4f87('0x1c')]({'where':{'id':_0x1777bb[_0x4f87('0x1d')]},'raw':!![]})[_0x4f87('0x16')](function(_0x438cff){_0x3ffd7b=_0x438cff;if(_0x3ffd7b&&_0x3ffd7b[_0x4f87('0x1e')]){switch(_0x3ffd7b[_0x4f87('0x1e')]){case _0x4f87('0x1f'):var _0x4c5629=require(_0x4f87('0x1f'));if(_0x3ffd7b[_0x4f87('0x20')]&&_0x3ffd7b['authToken']&&_0x3ffd7b[_0x4f87('0x21')]){var _0x36c934=new _0x4c5629(_0x3ffd7b['accountSid'],_0x3ffd7b[_0x4f87('0x22')]);_0x36c934[_0x4f87('0x23')][_0x4f87('0x24')]({'body':_0x1777bb[_0x4f87('0xc')],'to':_0x1777bb['phone'],'from':_0x3ffd7b[_0x4f87('0x21')],'statusCallback':_0x3ffd7b[_0x4f87('0x25')]+'/api/sms/messages/'+_0x1777bb['id']+'/status?token='+_0x3ffd7b[_0x4f87('0x26')]})[_0x4f87('0x16')](function(_0x59914){if(_0x59914[_0x4f87('0x27')]){return _0xf43741[_0x4f87('0x17')]({'messageId':_0x59914[_0x4f87('0x27')]});}})[_0x4f87('0x19')](function(_0x339b14){logger['error'](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x1f'),util[_0x4f87('0x2a')](_0x339b14,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x1f'),_0x4f87('0x2b'));}break;case _0x4f87('0x2c'):var _0x152f63=_0x4f87('0x2d');if(_0x3ffd7b[_0x4f87('0x2e')]&&_0x3ffd7b[_0x4f87('0x2f')]){var _0x3df3b0={'recipient':[_0x1777bb[_0x4f87('0x21')]],'message':_0x1777bb[_0x4f87('0xc')],'message_type':_0x3ffd7b[_0x4f87('0x30')]};if(_0x3ffd7b[_0x4f87('0x30')]&&_0x3ffd7b['smsMethod']!=='SI'){_0x3df3b0[_0x4f87('0x31')]=_0x3ffd7b[_0x4f87('0x21')];}var _0x16550b={'url':_0x152f63+_0x4f87('0x32')+_0x3ffd7b[_0x4f87('0x2e')]+_0x4f87('0x33')+_0x3ffd7b[_0x4f87('0x2f')],'method':_0x4f87('0x34')};rp(_0x16550b)['then'](function(_0x1c8e17){var _0x370b0f=_0x1c8e17[_0x4f87('0x35')](';');var _0x54ff9a={'user_key':_0x370b0f[0x0],'session_key':_0x370b0f[0x1]};_0x16550b={'url':_0x152f63+_0x4f87('0x36'),'method':_0x4f87('0x37'),'headers':{'user_key':_0x54ff9a[_0x4f87('0x38')],'Session_key':_0x54ff9a[_0x4f87('0x39')]},'json':!![],'body':_0x3df3b0};return rp(_0x16550b);})[_0x4f87('0x16')](function(_0x2aaa94){if(_0x2aaa94['total_sent']>=0x1){var _0x2b3990={'messageId':_0x2aaa94[_0x4f87('0x3a')]};if(_0x3ffd7b[_0x4f87('0x30')]!=='GP'||!_0x3ffd7b['deliveryReport']){_0x2b3990[_0x4f87('0x3b')]=!![];}return _0xf43741[_0x4f87('0x17')](_0x2b3990);}else{return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),'skebby',util[_0x4f87('0x2a')](_0x2aaa94,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4c31e7){return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x2c'),util[_0x4f87('0x2a')](_0x4c31e7,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x2c'),_0x4f87('0x3c'));}break;case _0x4f87('0x3d'):if(_0x3ffd7b['authToken']){var _0x4c941b={'recipient':_0x1777bb[_0x4f87('0x21')],'message':_0x1777bb[_0x4f87('0xc')],'sender':_0x3ffd7b['senderString']||_0x3ffd7b['phone'],'authorization':_0x3ffd7b[_0x4f87('0x22')]};var _0x4dfb28={'method':'POST','uri':_0x4f87('0x3e'),'body':_0x4c941b,'json':!![]};rp(_0x4dfb28)[_0x4f87('0x16')](function(_0x52cba6){var _0x2ac552={'messageId':_0x52cba6['requestid']};if(!_0x3ffd7b[_0x4f87('0x3f')]){_0x2ac552[_0x4f87('0x3b')]=!![];}return _0xf43741[_0x4f87('0x17')](_0x2ac552);})[_0x4f87('0x19')](function(_0x59849a){logger[_0x4f87('0x1a')](_0x4f87('0x28'),'afterCreate',_0x4f87('0x3d'),util['inspect'](_0x59849a,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x4f87('0x40'));}break;case _0x4f87('0x41'):if(_0x3ffd7b[_0x4f87('0x2e')]&&_0x3ffd7b['password']){var _0x4c941b={'messages':[{'source':'xCALLY\x20Motion','to':_0x1777bb[_0x4f87('0x21')],'body':_0x1777bb[_0x4f87('0xc')],'from':_0x3ffd7b[_0x4f87('0x42')]||_0x3ffd7b['phone']}]};var _0x1d4b78=util[_0x4f87('0x43')]('%s:%s',_0x3ffd7b[_0x4f87('0x2e')],_0x3ffd7b[_0x4f87('0x2f')]);var _0x4dfb28={'method':_0x4f87('0x37'),'uri':_0x4f87('0x44'),'body':_0x4c941b,'headers':{'Authorization':util[_0x4f87('0x43')](_0x4f87('0x45'),new Buffer(_0x1d4b78)['toString'](_0x4f87('0x46')))},'json':!![]};rp(_0x4dfb28)['then'](function(_0x415bb0){if(_0x415bb0[_0x4f87('0x47')]>=0xc8&&_0x415bb0[_0x4f87('0x47')]<=0xce){if(_0x415bb0['data']&&_0x415bb0['data'][_0x4f87('0x48')]>0x0){var _0x1e0bf0=_[_0x4f87('0x49')](_0x415bb0['data'][_0x4f87('0x23')]);var _0x5dda2c={'messageId':_0x1e0bf0[_0x4f87('0x4a')]};if(!_0x3ffd7b[_0x4f87('0x3f')]){_0x5dda2c['read']=!![];}return _0xf43741[_0x4f87('0x17')](_0x5dda2c);}else{logger[_0x4f87('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f87('0x29'),'clickSend',util[_0x4f87('0x2a')](_0x415bb0,{'showHidden':![],'depth':null}));}}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x4b'),util[_0x4f87('0x2a')](_0x415bb0,{'showHidden':![],'depth':null}));}})[_0x4f87('0x19')](function(_0x393f2a){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x4f87('0x2a')](_0x393f2a,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),'afterCreate','clickSend',_0x4f87('0x3c'));}break;case'plivo':if(_0x3ffd7b[_0x4f87('0x4c')]&&_0x3ffd7b[_0x4f87('0x22')]){var _0x4c941b={'dst':_0x1777bb['phone'],'text':_0x1777bb[_0x4f87('0xc')],'src':_0x3ffd7b[_0x4f87('0x42')]||_0x3ffd7b[_0x4f87('0x21')],'url':_0x3ffd7b[_0x4f87('0x25')]+_0x4f87('0x4d')+_0x1777bb['id']+_0x4f87('0x4e')+_0x3ffd7b[_0x4f87('0x26')]};var _0x1d4b78=util['format']('%s:%s',_0x3ffd7b['authId'],_0x3ffd7b[_0x4f87('0x22')]);var _0x4dfb28={'method':'POST','uri':util[_0x4f87('0x43')](_0x4f87('0x4f'),_0x3ffd7b[_0x4f87('0x4c')]),'body':_0x4c941b,'headers':{'Authorization':util[_0x4f87('0x43')](_0x4f87('0x45'),new Buffer(_0x1d4b78)[_0x4f87('0x50')]('base64'))},'json':!![]};rp(_0x4dfb28)[_0x4f87('0x16')](function(_0x4c2b87){var _0xf0e5f1={'messageId':_0x4c2b87[_0x4f87('0x51')][0x0]};return _0xf43741['update'](_0xf0e5f1);})[_0x4f87('0x19')](function(_0x1e51fe){logger[_0x4f87('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f87('0x29'),'plivo',util['inspect'](_0x1e51fe,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x52'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x4f87('0x53'):if(_0x3ffd7b[_0x4f87('0x2e')]&&_0x3ffd7b['password']){if(_0x3ffd7b[_0x4f87('0x54')]){var _0x1b56d7={'method':_0x4f87('0x37'),'uri':_0x3ffd7b[_0x4f87('0x54')]+_0x4f87('0x55'),'body':{'username':_0x3ffd7b[_0x4f87('0x2e')],'password':_0x3ffd7b['password']},'json':!![]};return rp(_0x1b56d7)['then'](function(_0x2cb20e){var _0xdf0532={'method':'POST','uri':_0x3ffd7b['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3ffd7b[_0x4f87('0x21')],'destinations':[{'to':_0x1777bb[_0x4f87('0x21')]}],'text':_0x1777bb[_0x4f87('0xc')],'notifyUrl':_0x3ffd7b['remote']+_0x4f87('0x4d')+_0x1777bb['id']+_0x4f87('0x4e')+_0x3ffd7b[_0x4f87('0x26')],'notifyContentType':'application/json','callbackData':_0x3ffd7b[_0x4f87('0x21')]+';'+_0x1777bb[_0x4f87('0xc')]}]},'headers':{'Authorization':_0x4f87('0x56')+_0x2cb20e[_0x4f87('0x26')]},'json':!![]};return rp(_0xdf0532)[_0x4f87('0x16')](function(_0x4d9850){if(_0x4d9850[_0x4f87('0x23')]){var _0x48be42={'messageId':_0x4d9850['messages'][0x0]['messageId']};if(!_0x3ffd7b[_0x4f87('0x3f')]){_0x48be42[_0x4f87('0x3b')]=!![];}return _0xf43741[_0x4f87('0x17')](_0x48be42);}else{return logger[_0x4f87('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f87('0x29'),'infobip',util[_0x4f87('0x2a')](_0x4d9850,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x40e2de){return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),'infobip',util[_0x4f87('0x2a')](_0x40e2de,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x53'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),'afterCreate',_0x4f87('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4f87('0x57'):var _0x3505a4=require(_0x4f87('0x58'));if(_0x3ffd7b[_0x4f87('0x59')]){var _0xaec23={};_0xaec23[_0x4f87('0x5a')]=_0x3ffd7b['username'];_0xaec23[_0x4f87('0x21')]=_0x1777bb['phone'];_0xaec23['sender']=_0x3ffd7b[_0x4f87('0x21')];_0xaec23[_0x4f87('0x5b')]=_0x1777bb[_0x4f87('0xc')];_0xaec23[_0x4f87('0x5c')]=+new Date();var _0x183e16='';var _0x423d5e='';var _0x5d82fb=Object['keys'](_0xaec23);_0x5d82fb[_0x4f87('0x5d')]();for(var _0x412785=0x0;_0x412785<_0x5d82fb['length'];_0x412785++){if(_0x183e16!=''){_0x183e16+='&';}_0x183e16+=_0x5d82fb[_0x412785]+'='+encodeURIComponent(_0xaec23[_0x5d82fb[_0x412785]]);_0x423d5e+=_0xaec23[_0x5d82fb[_0x412785]];}_0x423d5e+=_0x3ffd7b[_0x4f87('0x59')];_0x423d5e=_0x3505a4['createHash'](_0x4f87('0x5e'))[_0x4f87('0x17')](_0x423d5e)['digest'](_0x4f87('0x5f'));if(_0x183e16!==''){_0x183e16+='&';}_0x183e16+=_0x4f87('0x60')+_0x423d5e;var _0x16550b={'method':_0x4f87('0x34'),'uri':_0x3ffd7b['baseUrl']+'/external/get/send.php?'+_0x183e16,'json':!![]};return rp(_0x16550b)[_0x4f87('0x16')](function(_0x2e0a9b){var _0x50be40=Object[_0x4f87('0x61')](_0x2e0a9b);if(_0x2e0a9b[_0x50be40[0x0]][_0x4f87('0x1a')]&&parseInt(_0x2e0a9b[_0x50be40[0x0]][_0x4f87('0x1a')])===0x0){var _0xab8923={'messageId':_0x2e0a9b[_0x50be40[0x0]][_0x4f87('0x62')]};if(!_0x3ffd7b[_0x4f87('0x3f')]){_0xab8923[_0x4f87('0x3b')]=!![];}return _0xf43741[_0x4f87('0x17')](_0xab8923);}else{return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x57'),util[_0x4f87('0x2a')](_0x2e0a9b[_0x4f87('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4f87('0x19')](function(_0x30bfc0){return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x57'),util['inspect'](_0x30bfc0,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x57'),_0x4f87('0x63'));}break;case _0x4f87('0x64'):if(_0x3ffd7b[_0x4f87('0x59')]){var _0x515b70={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3ffd7b['apiKey']},'body':{'content':_0x1777bb[_0x4f87('0xc')],'to':[_0x1777bb[_0x4f87('0x21')]],'from':_0x3ffd7b['phone'],'binary':![],'clientMessageId':_0x4f87('0x65'),'charset':'UTF-8'},'json':!![]};rp(_0x515b70)[_0x4f87('0x16')](function(_0xda3bd9){if(!_0xda3bd9[_0x4f87('0x1a')]){var _0x1ef61a={'messageId':_0xda3bd9['messages'][0x0][_0x4f87('0x66')]};if(!_0x3ffd7b[_0x4f87('0x3f')]){_0x1ef61a[_0x4f87('0x3b')]=!![];}return _0xf43741[_0x4f87('0x17')](_0x1ef61a);}else{return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x64'),util[_0x4f87('0x2a')](_0xda3bd9[_0x4f87('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4f87('0x19')](function(_0x2f7e6d){return logger[_0x4f87('0x1a')](_0x4f87('0x28'),'afterCreate',_0x4f87('0x64'),util[_0x4f87('0x2a')](_0x2f7e6d,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),'afterCreate',_0x4f87('0x64'),'Missing\x20parameters:\x20apiKey');}break;case _0x4f87('0x67'):if(_0x3ffd7b[_0x4f87('0x2e')]&&_0x3ffd7b[_0x4f87('0x2f')]){var _0x1d4b78=util['format'](_0x4f87('0x68'),_0x3ffd7b[_0x4f87('0x2e')],_0x3ffd7b[_0x4f87('0x2f')]);var _0x4dfb28={'method':_0x4f87('0x37'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3ffd7b[_0x4f87('0x69')]+_0x4f87('0x6a'),'body':{'to':[_0x1777bb[_0x4f87('0x21')]],'text':_0x1777bb[_0x4f87('0xc')],'from':_0x3ffd7b[_0x4f87('0x21')],'applicationId':_0x3ffd7b[_0x4f87('0x6b')]},'headers':{'Authorization':util[_0x4f87('0x43')](_0x4f87('0x45'),new Buffer(_0x1d4b78)[_0x4f87('0x50')]('base64'))},'json':!![]};rp(_0x4dfb28)[_0x4f87('0x16')](function(_0x2dcc3){if(_0x2dcc3['id']){var _0x583f2e={'messageId':_0x2dcc3['id']};return _0xf43741['update'](_0x583f2e);}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x67'),util['inspect'](_0x2dcc3,{'showHidden':![],'depth':null}));}})[_0x4f87('0x19')](function(_0x540d3b){logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x67'),util[_0x4f87('0x2a')](_0x540d3b,{'showHidden':![],'depth':null}));});}else{logger[_0x4f87('0x1a')](_0x4f87('0x28'),'afterCreate',_0x4f87('0x67'),_0x4f87('0x3c'));}break;case _0x4f87('0x6c'):if(_0x3ffd7b[_0x4f87('0x59')]){var _0x533963={};var _0x16550b={'method':_0x4f87('0x37'),'uri':_0x4f87('0x6d'),'headers':{'Authorization':_0x4f87('0x6e')+_0x3ffd7b[_0x4f87('0x59')],'Content-Type':_0x4f87('0x6f')},'body':{'from':_0x3ffd7b[_0x4f87('0x21')],'to':_0x1777bb[_0x4f87('0x21')],'text':_0x1777bb[_0x4f87('0xc')]},'json':!![]};return rp(_0x16550b)[_0x4f87('0x16')](function(_0x412e91){if(_0x412e91[_0x4f87('0x70')]==0xca){_0x533963[_0x4f87('0x71')]=_0x412e91;var _0x3846d1={'method':_0x4f87('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4f87('0x6e')+_0x3ffd7b['apiKey'],'Content-Type':_0x4f87('0x6f')},'body':{'refid':_0x533963[_0x4f87('0x71')][_0x4f87('0x72')]},'json':!![]};return rp(_0x3846d1)[_0x4f87('0x16')](function(_0x942b77){_0x533963[_0x4f87('0x73')]=_0x942b77;var _0x198626={'messageId':_0x533963[_0x4f87('0x71')][_0x4f87('0x72')],'read':!![]};return _0xf43741[_0x4f87('0x17')](_0x198626);});}else{return logger[_0x4f87('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f87('0x29'),'intelepeer',util[_0x4f87('0x2a')](_0x412e91,{'showHidden':![],'depth':null}));}})[_0x4f87('0x19')](function(_0x2e39fc){return logger[_0x4f87('0x1a')](_0x4f87('0x28'),_0x4f87('0x29'),'intelepeer',util[_0x4f87('0x2a')](_0x2e39fc,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x4f87('0x28'),_0x4f87('0x29'),_0x4f87('0x6c'),_0x4f87('0x74'));}break;}}})['finally'](function(){_0x25dea7();});}else{_0x25dea7();}}},'charset':_0x4f87('0x75'),'collate':_0x4f87('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 6decdcf..545ba87 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 _0xf68b=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register'];(function(_0x42b677,_0x5ddbd2){var _0x250fa4=function(_0x5dec89){while(--_0x5dec89){_0x42b677['push'](_0x42b677['shift']());}};_0x250fa4(++_0x5ddbd2);}(_0xf68b,0xeb));var _0xbf68=function(_0x33b9db,_0x2e0887){_0x33b9db=_0x33b9db-0x0;var _0x12490e=_0xf68b[_0x33b9db];return _0x12490e;};'use strict';var _=require(_0xbf68('0x0'));var util=require(_0xbf68('0x1'));var moment=require(_0xbf68('0x2'));var BPromise=require(_0xbf68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf68('0x4'));var db=require(_0xbf68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf68('0x6'))(_0xbf68('0x7'));var config=require(_0xbf68('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf68('0x9')][_0xbf68('0xa')]({'port':0x232a});config[_0xbf68('0xb')]=_[_0xbf68('0xc')](config['redis'],{'host':_0xbf68('0xd'),'port':0x18eb});var socket=require(_0xbf68('0xe'))(new Redis(config[_0xbf68('0xb')]));require(_0xbf68('0xf'))[_0xbf68('0x10')](socket);function respondWithRpcPromise(_0x7842a7,_0xba8e98,_0x1d0a34){return new BPromise(function(_0x57c272,_0xf7f7db){return client[_0xbf68('0x11')](_0x7842a7,_0x1d0a34)[_0xbf68('0x12')](function(_0x316eae){logger[_0xbf68('0x13')](_0xbf68('0x14'),_0xba8e98,_0xbf68('0x15'));logger['debug'](_0xbf68('0x16'),_0xba8e98,_0xbf68('0x15'),JSON[_0xbf68('0x17')](_0x316eae));if(_0x316eae[_0xbf68('0x18')]){if(_0x316eae[_0xbf68('0x18')][_0xbf68('0x19')]===0x1f4){logger[_0xbf68('0x18')](_0xbf68('0x14'),_0xba8e98,_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);return _0xf7f7db(_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);}logger['error'](_0xbf68('0x14'),_0xba8e98,_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);return _0x57c272(_0x316eae[_0xbf68('0x18')][_0xbf68('0x1a')]);}else{logger[_0xbf68('0x13')](_0xbf68('0x14'),_0xba8e98,_0xbf68('0x15'));_0x57c272(_0x316eae[_0xbf68('0x1b')][_0xbf68('0x1a')]);}})[_0xbf68('0x1c')](function(_0x516857){logger[_0xbf68('0x18')]('SmsMessage,\x20%s,\x20%s',_0xba8e98,_0x516857);_0xf7f7db(_0x516857);});});}exports[_0xbf68('0x1d')]=function(_0x1e9551){var _0x376079=this;return new Promise(function(_0x297768,_0x167389){return db[_0xbf68('0x1e')][_0xbf68('0x1f')](_0x1e9551[_0xbf68('0x20')],{'raw':_0x1e9551[_0xbf68('0x21')]?_0x1e9551[_0xbf68('0x21')][_0xbf68('0x22')]===undefined?!![]:![]:!![]})[_0xbf68('0x12')](function(_0xdf2094){logger['info']('CreateSmsMessage',_0x1e9551);logger[_0xbf68('0x23')](_0xbf68('0x1d'),_0x1e9551,JSON['stringify'](_0xdf2094));_0x297768(_0xdf2094);})[_0xbf68('0x1c')](function(_0x2f095c){logger[_0xbf68('0x18')]('CreateSmsMessage',_0x2f095c[_0xbf68('0x1a')],_0x1e9551);_0x167389(_0x376079['error'](0x1f4,_0x2f095c[_0xbf68('0x1a')]));});});}; \ No newline at end of file +var _0x4410=['result','catch','CreateSmsMessage','SmsMessage','create','body','options','then','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','socket.io-emitter','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x533a4c,_0x135724){var _0x958d80=function(_0x2f58b5){while(--_0x2f58b5){_0x533a4c['push'](_0x533a4c['shift']());}};_0x958d80(++_0x135724);}(_0x4410,0x104));var _0x0441=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x4410[_0x15d18f];return _0xd12bf7;};'use strict';var _=require(_0x0441('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0441('0x1'));var db=require(_0x0441('0x2'))['db'];var utils=require(_0x0441('0x3'));var logger=require(_0x0441('0x4'))(_0x0441('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0441('0x6')]=_[_0x0441('0x7')](config[_0x0441('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x0441('0x8'))(new Redis(config[_0x0441('0x6')]));require(_0x0441('0x9'))['register'](socket);function respondWithRpcPromise(_0x352d92,_0x1dbf93,_0x3dd7e1){return new BPromise(function(_0xe1f1f7,_0x5b1db8){return client[_0x0441('0xa')](_0x352d92,_0x3dd7e1)['then'](function(_0x1e49b3){logger[_0x0441('0xb')](_0x0441('0xc'),_0x1dbf93,_0x0441('0xd'));logger[_0x0441('0xe')](_0x0441('0xf'),_0x1dbf93,_0x0441('0xd'),JSON[_0x0441('0x10')](_0x1e49b3));if(_0x1e49b3[_0x0441('0x11')]){if(_0x1e49b3['error'][_0x0441('0x12')]===0x1f4){logger[_0x0441('0x11')](_0x0441('0xc'),_0x1dbf93,_0x1e49b3[_0x0441('0x11')][_0x0441('0x13')]);return _0x5b1db8(_0x1e49b3[_0x0441('0x11')][_0x0441('0x13')]);}logger[_0x0441('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dbf93,_0x1e49b3[_0x0441('0x11')][_0x0441('0x13')]);return _0xe1f1f7(_0x1e49b3[_0x0441('0x11')][_0x0441('0x13')]);}else{logger[_0x0441('0xb')](_0x0441('0xc'),_0x1dbf93,_0x0441('0xd'));_0xe1f1f7(_0x1e49b3[_0x0441('0x14')][_0x0441('0x13')]);}})[_0x0441('0x15')](function(_0x4611aa){logger[_0x0441('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dbf93,_0x4611aa);_0x5b1db8(_0x4611aa);});});}exports[_0x0441('0x16')]=function(_0x2670e3){var _0x44e478=this;return new Promise(function(_0x4e91f8,_0x4d1070){return db[_0x0441('0x17')][_0x0441('0x18')](_0x2670e3[_0x0441('0x19')],{'raw':_0x2670e3['options']?_0x2670e3[_0x0441('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0441('0x1b')](function(_0x205731){logger[_0x0441('0xb')](_0x0441('0x16'),_0x2670e3);logger[_0x0441('0xe')]('CreateSmsMessage',_0x2670e3,JSON[_0x0441('0x10')](_0x205731));_0x4e91f8(_0x205731);})['catch'](function(_0x183d4e){logger[_0x0441('0x11')]('CreateSmsMessage',_0x183d4e[_0x0441('0x13')],_0x2670e3);_0x4d1070(_0x44e478[_0x0441('0x11')](0x1f4,_0x183d4e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index fc20d8c..fa01b76 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 _0xda64=['register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x27dc6f,_0x5dbea8){var _0x461137=function(_0x406252){while(--_0x406252){_0x27dc6f['push'](_0x27dc6f['shift']());}};_0x461137(++_0x5dbea8);}(_0xda64,0x152));var _0x4da6=function(_0x3050ce,_0x5edb0b){_0x3050ce=_0x3050ce-0x0;var _0x40e80b=_0xda64[_0x3050ce];return _0x40e80b;};'use strict';var SmsMessageEvents=require(_0x4da6('0x0'));var events=[_0x4da6('0x1'),_0x4da6('0x2'),_0x4da6('0x3')];function createListener(_0x5441cb,_0x42aaf2){return function(_0x311124){_0x42aaf2['emit'](_0x5441cb,_0x311124);};}function removeListener(_0x47f3f3,_0xcac840){return function(){SmsMessageEvents['removeListener'](_0x47f3f3,_0xcac840);};}exports[_0x4da6('0x4')]=function(_0x5e54c8){for(var _0x545fb5=0x0,_0x4398e0=events['length'];_0x545fb5<_0x4398e0;_0x545fb5++){var _0x5af661=events[_0x545fb5];var _0x605d9c=createListener(_0x4da6('0x5')+_0x5af661,_0x5e54c8);SmsMessageEvents['on'](_0x5af661,_0x605d9c);}}; \ No newline at end of file +var _0x2092=['smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x73a665,_0x6ed407){var _0x2fa8d8=function(_0x24916d){while(--_0x24916d){_0x73a665['push'](_0x73a665['shift']());}};_0x2fa8d8(++_0x6ed407);}(_0x2092,0x161));var _0x2209=function(_0x5baee3,_0x4fafb6){_0x5baee3=_0x5baee3-0x0;var _0x14840a=_0x2092[_0x5baee3];return _0x14840a;};'use strict';var SmsMessageEvents=require(_0x2209('0x0'));var events=[_0x2209('0x1'),_0x2209('0x2'),_0x2209('0x3')];function createListener(_0x5a00f2,_0x1d4c87){return function(_0x41addc){_0x1d4c87[_0x2209('0x4')](_0x5a00f2,_0x41addc);};}function removeListener(_0x1d88d9,_0x25a59a){return function(){SmsMessageEvents[_0x2209('0x5')](_0x1d88d9,_0x25a59a);};}exports['register']=function(_0x4dc77e){for(var _0x4f9b23=0x0,_0x4d5f3e=events[_0x2209('0x6')];_0x4f9b23<_0x4d5f3e;_0x4f9b23++){var _0x5a3295=events[_0x4f9b23];var _0x67f9ff=createListener(_0x2209('0x7')+_0x5a3295,_0x4dc77e);SmsMessageEvents['on'](_0x5a3295,_0x67f9ff);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0117d13..cfa7266 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 _0x7192=['../../components/auth/service','../../components/interaction/service','./smsQueue.controller','index','get','/describe','/:id','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2c0c2e,_0x685550){var _0x409ebe=function(_0x176e80){while(--_0x176e80){_0x2c0c2e['push'](_0x2c0c2e['shift']());}};_0x409ebe(++_0x685550);}(_0x7192,0x123));var _0x2719=function(_0x2b2aae,_0x7f097e){_0x2b2aae=_0x2b2aae-0x0;var _0x1bd623=_0x7192[_0x2b2aae];return _0x1bd623;};'use strict';var multer=require(_0x2719('0x0'));var util=require(_0x2719('0x1'));var path=require(_0x2719('0x2'));var timeout=require(_0x2719('0x3'));var express=require('express');var router=express[_0x2719('0x4')]();var fs_extra=require(_0x2719('0x5'));var auth=require(_0x2719('0x6'));var interaction=require(_0x2719('0x7'));var config=require('../../config/environment');var controller=require(_0x2719('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2719('0x9')]);router[_0x2719('0xa')](_0x2719('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2719('0xc'),auth[_0x2719('0xd')](),controller['show']);router[_0x2719('0xa')]('/:id/members',auth[_0x2719('0xd')](),controller[_0x2719('0xe')]);router['get'](_0x2719('0xf'),auth[_0x2719('0xd')](),controller[_0x2719('0x10')]);router[_0x2719('0xa')](_0x2719('0x11'),auth[_0x2719('0xd')](),controller['getAgents']);router[_0x2719('0x12')]('/',auth[_0x2719('0xd')](),controller[_0x2719('0x13')]);router[_0x2719('0x12')](_0x2719('0xf'),auth[_0x2719('0xd')](),controller[_0x2719('0x14')]);router[_0x2719('0x12')](_0x2719('0x11'),auth[_0x2719('0xd')](),controller['addAgents']);router[_0x2719('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2719('0x16')]);router[_0x2719('0x17')]('/:id',auth[_0x2719('0xd')](),controller[_0x2719('0x18')]);router[_0x2719('0x17')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x2719('0x11'),auth[_0x2719('0xd')](),controller[_0x2719('0x19')]);module[_0x2719('0x1a')]=router; \ No newline at end of file +var _0xa078=['./smsQueue.controller','get','isAuthenticated','index','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4ef92f,_0x124223){var _0x4aa612=function(_0x1907f7){while(--_0x1907f7){_0x4ef92f['push'](_0x4ef92f['shift']());}};_0x4aa612(++_0x124223);}(_0xa078,0x17e));var _0x8a07=function(_0x5af535,_0x4c18de){_0x5af535=_0x5af535-0x0;var _0x584c2b=_0xa078[_0x5af535];return _0x584c2b;};'use strict';var multer=require(_0x8a07('0x0'));var util=require(_0x8a07('0x1'));var path=require(_0x8a07('0x2'));var timeout=require(_0x8a07('0x3'));var express=require(_0x8a07('0x4'));var router=express['Router']();var fs_extra=require(_0x8a07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8a07('0x6'));var config=require(_0x8a07('0x7'));var controller=require(_0x8a07('0x8'));router[_0x8a07('0x9')]('/',auth[_0x8a07('0xa')](),controller[_0x8a07('0xb')]);router[_0x8a07('0x9')]('/describe',auth[_0x8a07('0xa')](),controller['describe']);router[_0x8a07('0x9')](_0x8a07('0xc'),auth[_0x8a07('0xa')](),controller[_0x8a07('0xd')]);router[_0x8a07('0x9')]('/:id/members',auth[_0x8a07('0xa')](),controller[_0x8a07('0xe')]);router[_0x8a07('0x9')](_0x8a07('0xf'),auth[_0x8a07('0xa')](),controller[_0x8a07('0x10')]);router[_0x8a07('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x8a07('0x11')]);router[_0x8a07('0x12')]('/',auth[_0x8a07('0xa')](),controller[_0x8a07('0x13')]);router[_0x8a07('0x12')]('/:id/teams',auth[_0x8a07('0xa')](),controller[_0x8a07('0x14')]);router[_0x8a07('0x12')](_0x8a07('0x15'),auth['isAuthenticated'](),controller[_0x8a07('0x16')]);router[_0x8a07('0x17')](_0x8a07('0xc'),auth['isAuthenticated'](),controller[_0x8a07('0x18')]);router['delete'](_0x8a07('0xc'),auth[_0x8a07('0xa')](),controller[_0x8a07('0x19')]);router[_0x8a07('0x1a')](_0x8a07('0xf'),auth[_0x8a07('0xa')](),controller[_0x8a07('0x1b')]);router[_0x8a07('0x1a')](_0x8a07('0x15'),auth[_0x8a07('0xa')](),controller[_0x8a07('0x1c')]);module[_0x8a07('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 92e4b3f..29ff5fa 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 _0x9e6b=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x5ee58d,_0x1c8168){var _0xfc536d=function(_0x208f88){while(--_0x208f88){_0x5ee58d['push'](_0x5ee58d['shift']());}};_0xfc536d(++_0x1c8168);}(_0x9e6b,0xd4));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb9e6('0x0'));module[_0xb9e6('0x1')]={'name':{'type':Sequelize[_0xb9e6('0x2')],'unique':_0xb9e6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9e6('0x2')]},'timeout':{'type':Sequelize[_0xb9e6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9e6('0x5')](_0xb9e6('0x6'),_0xb9e6('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xcc4a=['STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcc4a,0x136));var _0xacc4=function(_0x3cce0f,_0x1355da){_0x3cce0f=_0x3cce0f-0x0;var _0x170a1e=_0xcc4a[_0x3cce0f];return _0x170a1e;};'use strict';var Sequelize=require(_0xacc4('0x0'));module[_0xacc4('0x1')]={'name':{'type':Sequelize[_0xacc4('0x2')],'unique':_0xacc4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xacc4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xacc4('0x4')](_0xacc4('0x5'),_0xacc4('0x6'),_0xacc4('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 24a30d6..9b9230f 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 _0x39d3=['VIRTUAL','includeAll','include','findAll','catch','show','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','voicePause','interface','Agents','sequelize','addTeams','findOrCreate','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','value','transaction','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0x39d3,0x1e5));var _0x339d=function(_0x2086ce,_0x5bffce){_0x2086ce=_0x2086ce-0x0;var _0x30b904=_0x39d3[_0x2086ce];return _0x30b904;};'use strict';var emlformat=require(_0x339d('0x0'));var rimraf=require(_0x339d('0x1'));var zipdir=require(_0x339d('0x2'));var jsonpatch=require(_0x339d('0x3'));var rp=require(_0x339d('0x4'));var moment=require('moment');var BPromise=require(_0x339d('0x5'));var Mustache=require(_0x339d('0x6'));var util=require(_0x339d('0x7'));var path=require(_0x339d('0x8'));var sox=require(_0x339d('0x9'));var csv=require(_0x339d('0xa'));var ejs=require(_0x339d('0xb'));var fs=require('fs');var fs_extra=require(_0x339d('0xc'));var _=require(_0x339d('0xd'));var squel=require(_0x339d('0xe'));var crypto=require(_0x339d('0xf'));var jsforce=require(_0x339d('0x10'));var deskjs=require(_0x339d('0x11'));var toCsv=require(_0x339d('0xa'));var querystring=require(_0x339d('0x12'));var Papa=require(_0x339d('0x13'));var Redis=require('ioredis');var authService=require(_0x339d('0x14'));var qs=require(_0x339d('0x15'));var as=require(_0x339d('0x16'));var hardwareService=require(_0x339d('0x17'));var logger=require(_0x339d('0x18'))(_0x339d('0x19'));var utils=require(_0x339d('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x339d('0x1b')]=_[_0x339d('0x1c')](config[_0x339d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x339d('0x1d'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x339d('0x1e')](socket);function respondWithStatusCode(_0x3598c0,_0xa77b10){_0xa77b10=_0xa77b10||0xcc;return function(_0x5b53fb){if(_0x5b53fb){return _0x3598c0[_0x339d('0x1f')](_0xa77b10);}return _0x3598c0[_0x339d('0x20')](_0xa77b10)[_0x339d('0x21')]();};}function respondWithResult(_0x2dab01,_0x1c98d2){_0x1c98d2=_0x1c98d2||0xc8;return function(_0x4c6136){if(_0x4c6136){return _0x2dab01[_0x339d('0x20')](_0x1c98d2)[_0x339d('0x22')](_0x4c6136);}};}function respondWithFilteredResult(_0x3dc1ce,_0x2337ea){return function(_0x2409fe){if(_0x2409fe){var _0x3fe3f5=typeof _0x2337ea[_0x339d('0x23')]===_0x339d('0x24')&&typeof _0x2337ea['limit']==='undefined';var _0x4b30a7=_0x2409fe[_0x339d('0x25')];var _0x4c8ddf=_0x3fe3f5?0x0:_0x2337ea[_0x339d('0x23')];var _0x401414=_0x3fe3f5?_0x2409fe[_0x339d('0x25')]:_0x2337ea['offset']+_0x2337ea[_0x339d('0x26')];var _0x1c305a;if(_0x401414>=_0x4b30a7){_0x401414=_0x4b30a7;_0x1c305a=0xc8;}else{_0x1c305a=0xce;}_0x3dc1ce[_0x339d('0x20')](_0x1c305a);return _0x3dc1ce['set'](_0x339d('0x27'),_0x4c8ddf+'-'+_0x401414+'/'+_0x4b30a7)[_0x339d('0x22')](_0x2409fe);}return null;};}function patchUpdates(_0x573e6f){return function(_0x5763b5){try{jsonpatch[_0x339d('0x28')](_0x5763b5,_0x573e6f,!![]);}catch(_0x20ae3a){return BPromise[_0x339d('0x29')](_0x20ae3a);}return _0x5763b5[_0x339d('0x2a')]();};}function saveUpdates(_0x18eda6,_0x243a53){return function(_0xe80a59){if(_0xe80a59){return _0xe80a59[_0x339d('0x2b')](_0x18eda6)[_0x339d('0x2c')](function(_0x45b5e1){return _0x45b5e1;});}return null;};}function removeEntity(_0x39b461,_0x460da7){return function(_0x3083d4){if(_0x3083d4){return _0x3083d4[_0x339d('0x2d')]()['then'](function(){var _0x51008e=_0x3083d4[_0x339d('0x2e')]({'plain':!![]});var _0x24b04b=_0x339d('0x2f');return db[_0x339d('0x30')][_0x339d('0x2d')]({'where':{'type':_0x24b04b,'resourceId':_0x51008e['id']}})[_0x339d('0x2c')](function(){return _0x3083d4;});})[_0x339d('0x2c')](function(){_0x39b461[_0x339d('0x20')](0xcc)[_0x339d('0x21')]();});}};}function handleEntityNotFound(_0x30b0a3,_0x18326f){return function(_0x362519){if(!_0x362519){_0x30b0a3[_0x339d('0x1f')](0x194);}return _0x362519;};}function handleError(_0x2bd74c,_0x24c8b7){_0x24c8b7=_0x24c8b7||0x1f4;return function(_0xb79635){logger[_0x339d('0x31')](_0xb79635[_0x339d('0x32')]);if(_0xb79635[_0x339d('0x33')]){delete _0xb79635[_0x339d('0x33')];}_0x2bd74c[_0x339d('0x20')](_0x24c8b7)['send'](_0xb79635);};}exports[_0x339d('0x34')]=function(_0xef274a,_0x26c2d0){var _0x3400d9={},_0x428817={},_0x3864cc={'count':0x0,'rows':[]};var _0x2cb1f6=_[_0x339d('0x35')](db[_0x339d('0x36')][_0x339d('0x37')],function(_0xe555e2){return{'name':_0xe555e2[_0x339d('0x38')],'type':_0xe555e2[_0x339d('0x39')][_0x339d('0x3a')]};});_0x428817[_0x339d('0x3b')]=_[_0x339d('0x35')](_0x2cb1f6,_0x339d('0x33'));_0x428817[_0x339d('0x3c')]=_[_0x339d('0x3d')](_0xef274a[_0x339d('0x3c')]);_0x428817[_0x339d('0x3e')]=_['intersection'](_0x428817[_0x339d('0x3b')],_0x428817['query']);_0x3400d9[_0x339d('0x3f')]=_[_0x339d('0x40')](_0x428817[_0x339d('0x3b')],qs[_0x339d('0x41')](_0xef274a['query'][_0x339d('0x41')]));_0x3400d9[_0x339d('0x3f')]=_0x3400d9[_0x339d('0x3f')][_0x339d('0x42')]?_0x3400d9['attributes']:_0x428817[_0x339d('0x3b')];if(!_0xef274a['query'][_0x339d('0x43')](_0x339d('0x44'))){_0x3400d9[_0x339d('0x26')]=qs[_0x339d('0x26')](_0xef274a[_0x339d('0x3c')]['limit']);_0x3400d9['offset']=qs[_0x339d('0x23')](_0xef274a[_0x339d('0x3c')][_0x339d('0x23')]);}_0x3400d9[_0x339d('0x45')]=qs['sort'](_0xef274a[_0x339d('0x3c')][_0x339d('0x46')]);_0x3400d9[_0x339d('0x47')]=qs[_0x339d('0x3e')](_[_0x339d('0x48')](_0xef274a[_0x339d('0x3c')],_0x428817['filters']),_0x2cb1f6);if(_0xef274a[_0x339d('0x3c')][_0x339d('0x49')]){_0x3400d9[_0x339d('0x47')]=_[_0x339d('0x4a')](_0x3400d9[_0x339d('0x47')],{'$or':_[_0x339d('0x35')](_0x2cb1f6,function(_0x11a084){if(_0x11a084[_0x339d('0x39')]!==_0x339d('0x4b')){var _0x77c96b={};_0x77c96b[_0x11a084['name']]={'$like':'%'+_0xef274a[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x77c96b;}})});}_0x3400d9=_[_0x339d('0x4a')]({},_0x3400d9,_0xef274a['options']);var _0xd9447f={'where':_0x3400d9[_0x339d('0x47')]};return db[_0x339d('0x36')][_0x339d('0x25')](_0xd9447f)[_0x339d('0x2c')](function(_0x253374){_0x3864cc[_0x339d('0x25')]=_0x253374;if(_0xef274a[_0x339d('0x3c')][_0x339d('0x4c')]){_0x3400d9[_0x339d('0x4d')]=[{'all':!![]}];}return db['SmsQueue'][_0x339d('0x4e')](_0x3400d9);})[_0x339d('0x2c')](function(_0x135813){_0x3864cc['rows']=_0x135813;return _0x3864cc;})[_0x339d('0x2c')](respondWithFilteredResult(_0x26c2d0,_0x3400d9))[_0x339d('0x4f')](handleError(_0x26c2d0,null));};exports[_0x339d('0x50')]=function(_0x60344d,_0x3cc109){var _0x1d31ba={'raw':!![],'where':{'id':_0x60344d['params']['id']}},_0xbcbe2c={};_0xbcbe2c[_0x339d('0x3b')]=_[_0x339d('0x3d')](db[_0x339d('0x36')][_0x339d('0x37')]);_0xbcbe2c['query']=_['keys'](_0x60344d[_0x339d('0x3c')]);_0xbcbe2c[_0x339d('0x3e')]=_[_0x339d('0x40')](_0xbcbe2c[_0x339d('0x3b')],_0xbcbe2c['query']);_0x1d31ba[_0x339d('0x3f')]=_['intersection'](_0xbcbe2c['model'],qs[_0x339d('0x41')](_0x60344d[_0x339d('0x3c')]['fields']));_0x1d31ba['attributes']=_0x1d31ba['attributes']['length']?_0x1d31ba[_0x339d('0x3f')]:_0xbcbe2c['model'];if(_0x60344d[_0x339d('0x3c')][_0x339d('0x4c')]){_0x1d31ba['include']=[{'all':!![]}];}_0x1d31ba=_[_0x339d('0x4a')]({},_0x1d31ba,_0x60344d[_0x339d('0x51')]);return db['SmsQueue'][_0x339d('0x52')](_0x1d31ba)[_0x339d('0x2c')](handleEntityNotFound(_0x3cc109,null))[_0x339d('0x2c')](respondWithResult(_0x3cc109,null))['catch'](handleError(_0x3cc109,null));};exports[_0x339d('0x53')]=function(_0x4fed5e,_0x3b0b03){return db['SmsQueue'][_0x339d('0x53')](_0x4fed5e[_0x339d('0x54')],{})[_0x339d('0x2c')](function(_0x281183){var _0x45c1ac=_0x4fed5e['user'][_0x339d('0x2e')]({'plain':!![]});if(!_0x45c1ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45c1ac['role']===_0x339d('0x55')){var _0x4fdd77=_0x281183['get']({'plain':!![]});var _0x30ebb0=_0x339d('0x2f');return db[_0x339d('0x56')][_0x339d('0x52')]({'where':{'name':_0x30ebb0,'userProfileId':_0x45c1ac[_0x339d('0x57')]},'raw':!![]})[_0x339d('0x2c')](function(_0x223b4e){if(_0x223b4e&&_0x223b4e[_0x339d('0x58')]===0x0){return db[_0x339d('0x30')][_0x339d('0x53')]({'name':_0x4fdd77[_0x339d('0x33')],'resourceId':_0x4fdd77['id'],'type':_0x223b4e[_0x339d('0x33')],'sectionId':_0x223b4e['id']},{})[_0x339d('0x2c')](function(){return _0x281183;});}else{return _0x281183;}})['catch'](function(_0x2ddba0){logger[_0x339d('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ddba0);throw _0x2ddba0;});}return _0x281183;})[_0x339d('0x2c')](respondWithResult(_0x3b0b03,0xc9))[_0x339d('0x4f')](handleError(_0x3b0b03,null));};exports['update']=function(_0x358284,_0x1d5cd4){if(_0x358284[_0x339d('0x54')]['id']){delete _0x358284[_0x339d('0x54')]['id'];}return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0x358284[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](handleEntityNotFound(_0x1d5cd4,null))[_0x339d('0x2c')](saveUpdates(_0x358284[_0x339d('0x54')],null))[_0x339d('0x2c')](respondWithResult(_0x1d5cd4,null))[_0x339d('0x4f')](handleError(_0x1d5cd4,null));};exports[_0x339d('0x2d')]=function(_0x449919,_0x1c730d){return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0x449919[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](handleEntityNotFound(_0x1c730d,null))['then'](removeEntity(_0x1c730d,null))[_0x339d('0x4f')](handleError(_0x1c730d,null));};exports['describe']=function(_0x44e3c4,_0xec384b){return db['SmsQueue'][_0x339d('0x5a')]()[_0x339d('0x2c')](respondWithResult(_0xec384b,null))[_0x339d('0x4f')](handleError(_0xec384b,null));};exports[_0x339d('0x5b')]=function(_0x49a037,_0x4d4522,_0x59043e){var _0x39af50={'raw':!![],'where':{}},_0xb1d004={},_0x553053;return db[_0x339d('0x36')][_0x339d('0x5c')]({'where':{'id':_0x49a037[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](handleEntityNotFound(_0x4d4522,null))[_0x339d('0x2c')](function(_0x1bf665){if(_0x1bf665){_0x553053=_0x1bf665['get']({'plain':!![]});_0xb1d004[_0x339d('0x3b')]=_['keys'](db[_0x339d('0x5d')][_0x339d('0x37')]);_0xb1d004[_0x339d('0x3c')]=_[_0x339d('0x3d')](_0x49a037[_0x339d('0x3c')]);_0xb1d004[_0x339d('0x3e')]=_[_0x339d('0x40')](_0xb1d004[_0x339d('0x3b')],_0xb1d004[_0x339d('0x3c')]);_0x39af50[_0x339d('0x3f')]=_[_0x339d('0x40')](_0xb1d004[_0x339d('0x3b')],qs[_0x339d('0x41')](_0x49a037[_0x339d('0x3c')][_0x339d('0x41')]));_0x39af50[_0x339d('0x3f')]=_0x39af50['attributes']['length']?_0x39af50[_0x339d('0x3f')]:_0xb1d004[_0x339d('0x3b')];if(!_0x49a037[_0x339d('0x3c')][_0x339d('0x43')](_0x339d('0x44'))){_0x39af50[_0x339d('0x26')]=qs['limit'](_0x49a037[_0x339d('0x3c')][_0x339d('0x26')]);_0x39af50[_0x339d('0x23')]=qs[_0x339d('0x23')](_0x49a037[_0x339d('0x3c')][_0x339d('0x23')]);}_0x39af50[_0x339d('0x45')]=qs[_0x339d('0x46')](_0x49a037[_0x339d('0x3c')][_0x339d('0x46')]);_0x39af50['where']=qs[_0x339d('0x3e')](_['pick'](_0x49a037['query'],_0xb1d004[_0x339d('0x3e')]));_0x39af50[_0x339d('0x47')][_0x339d('0x5e')]=_0x1bf665['id'];if(_0x49a037[_0x339d('0x3c')][_0x339d('0x49')]){_0x39af50[_0x339d('0x47')]=_['merge'](_0x39af50[_0x339d('0x47')],{'$or':_['map'](_0x39af50[_0x339d('0x3f')],function(_0x5b4067){var _0x1abd3a={};_0x1abd3a[_0x5b4067]={'$like':'%'+_0x49a037[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x1abd3a;})});}_0x39af50=_[_0x339d('0x4a')]({},_0x39af50,_0x49a037[_0x339d('0x51')]);return db[_0x339d('0x5d')][_0x339d('0x4e')](_0x39af50);}})[_0x339d('0x2c')](function(_0x56b69c){if(_0x56b69c){return db[_0x339d('0x5f')][_0x339d('0x60')]({'where':{'id':_[_0x339d('0x35')](_0x56b69c,_0x339d('0x61')),'role':'agent'},'attributes':['id',_0x339d('0x33'),_0x339d('0x62'),_0x339d('0x63'),_0x339d('0x64')]});}})[_0x339d('0x2c')](function(_0x56ce29){if(_0x56ce29){return{'count':_0x56ce29[_0x339d('0x25')],'rows':_[_0x339d('0x35')](_0x56ce29['rows'],function(_0x2d7a14){return{'membername':_0x2d7a14[_0x339d('0x33')],'UserId':_0x2d7a14['id'],'queue_name':_0x553053[_0x339d('0x33')],'SmsQueueId':_0x553053['id'],'interface':util[_0x339d('0x65')](_0x339d('0x66'),_0x339d('0x67'),_0x2d7a14[_0x339d('0x33')]),'penalty':0x0,'paused':_0x2d7a14[_0x339d('0x62')],'createdAt':_0x2d7a14[_0x339d('0x64')],'updatedAt':_0x2d7a14['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x339d('0x2c')](respondWithFilteredResult(_0x4d4522,_0x39af50))['catch'](handleError(_0x4d4522,null));};exports['getTeams']=function(_0x159970,_0x31a624,_0x20717f){var _0x37b925={};var _0x261ecf={};var _0x4b80a5;var _0x3de86c;return db[_0x339d('0x36')]['findOne']({'where':{'id':_0x159970[_0x339d('0x59')]['id']}})['then'](handleEntityNotFound(_0x31a624,null))[_0x339d('0x2c')](function(_0x18d9db){if(_0x18d9db){_0x4b80a5=_0x18d9db;_0x261ecf[_0x339d('0x3b')]=_[_0x339d('0x3d')](db[_0x339d('0x68')][_0x339d('0x37')]);_0x261ecf[_0x339d('0x3c')]=_[_0x339d('0x3d')](_0x159970[_0x339d('0x3c')]);_0x261ecf[_0x339d('0x3e')]=_[_0x339d('0x40')](_0x261ecf[_0x339d('0x3b')],_0x261ecf['query']);_0x37b925[_0x339d('0x3f')]=_[_0x339d('0x40')](_0x261ecf[_0x339d('0x3b')],qs[_0x339d('0x41')](_0x159970[_0x339d('0x3c')][_0x339d('0x41')]));_0x37b925[_0x339d('0x3f')]=_0x37b925[_0x339d('0x3f')][_0x339d('0x42')]?_0x37b925[_0x339d('0x3f')]:_0x261ecf['model'];_0x37b925[_0x339d('0x45')]=qs['sort'](_0x159970[_0x339d('0x3c')][_0x339d('0x46')]);_0x37b925['where']=qs[_0x339d('0x3e')](_['pick'](_0x159970[_0x339d('0x3c')],_0x261ecf[_0x339d('0x3e')]));if(_0x159970['query']['filter']){_0x37b925[_0x339d('0x47')]=_[_0x339d('0x4a')](_0x37b925[_0x339d('0x47')],{'$or':_[_0x339d('0x35')](_0x37b925[_0x339d('0x3f')],function(_0x50063c){var _0x35b3ae={};_0x35b3ae[_0x50063c]={'$like':'%'+_0x159970[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x35b3ae;})});}_0x37b925=_[_0x339d('0x4a')]({},_0x37b925,_0x159970[_0x339d('0x51')]);return _0x4b80a5[_0x339d('0x69')](_0x37b925);}})[_0x339d('0x2c')](function(_0x3a51d2){if(_0x3a51d2){_0x3de86c=_0x3a51d2['length'];if(!_0x159970[_0x339d('0x3c')]['hasOwnProperty']('nolimit')){_0x37b925[_0x339d('0x26')]=qs[_0x339d('0x26')](_0x159970[_0x339d('0x3c')][_0x339d('0x26')]);_0x37b925[_0x339d('0x23')]=qs[_0x339d('0x23')](_0x159970[_0x339d('0x3c')]['offset']);}return _0x4b80a5[_0x339d('0x69')](_0x37b925);}})[_0x339d('0x2c')](function(_0x190f33){if(_0x190f33){return _0x190f33?{'count':_0x3de86c,'rows':_0x190f33}:null;}})[_0x339d('0x2c')](respondWithResult(_0x31a624,null))[_0x339d('0x4f')](handleError(_0x31a624,null));};exports['addTeams']=function(_0xe41da1,_0x15a7d5,_0x2d0296){var _0x27f0fa=_0xe41da1[_0x339d('0x54')][_0x339d('0x6a')];return db[_0x339d('0x68')][_0x339d('0x4e')]({'where':{'id':_0x27f0fa},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x339d('0x33'),'online',_0x339d('0x6b'),_0x339d('0x6c')],'raw':!![]}]})[_0x339d('0x2c')](function(_0x310304){if(_0x310304){var _0x521a38=_['flatMap'](_0x310304,function(_0xaf16d3){var _0x2d5bf0=_0xaf16d3['get']({'plain':!![]});return _0x2d5bf0[_0x339d('0x6d')];});return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0xe41da1['params']['id']}})[_0x339d('0x2c')](function(_0xe499f0){return db[_0x339d('0x6e')]['transaction'](function(_0x451c31){return _0xe499f0[_0x339d('0x6f')](_0x27f0fa,{'transaction':_0x451c31})[_0x339d('0x2c')](function(){return BPromise['each'](_0x521a38,function(_0x39edae){return db[_0x339d('0x5d')][_0x339d('0x70')]({'where':{'UserId':_0x39edae['id'],'SmsQueueId':_0xe41da1[_0x339d('0x59')]['id']},'transaction':_0x451c31});});})['then'](function(){_0x521a38[_0x339d('0x71')](function(_0x146eb1){socket['emit'](_0x339d('0x72'),{'UserId':_0x146eb1['id'],'SmsQueueId':_0xe499f0['id']});});});});});}})[_0x339d('0x2c')](respondWithStatusCode(_0x15a7d5,null))[_0x339d('0x4f')](handleError(_0x15a7d5,null));};exports[_0x339d('0x73')]=function(_0x1e64d8,_0x59df3b,_0x1ae311){return db[_0x339d('0x68')][_0x339d('0x4e')]({'where':{'id':_0x1e64d8[_0x339d('0x3c')][_0x339d('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x339d('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x339d('0x2c')](handleEntityNotFound(_0x59df3b,null))[_0x339d('0x2c')](function(_0x5a935e){var _0x196089=_[_0x339d('0x35')](_0x5a935e,'id');var _0x3b757d=[];var _0x5a4e0d=[];var _0x554fe9=squel[_0x339d('0x74')]();_0x554fe9[_0x339d('0x75')](_0x339d('0x76'))[_0x339d('0x77')](_0x339d('0x78'),'tq')[_0x339d('0x79')](_0x339d('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x339d('0x47')]('SmsQueueId\x20=\x20?',_0x1e64d8[_0x339d('0x59')]['id']);for(var _0x325005=0x0;_0x325005<_0x5a935e[_0x339d('0x42')];_0x325005+=0x1){let _0x1eef4b=_0x5a935e[_0x325005];for(var _0x2a8aa6=0x0;_0x2a8aa6<_0x1eef4b['Agents'][_0x339d('0x42')];_0x2a8aa6+=0x1){let _0x2cc505=_0x1eef4b[_0x339d('0x6d')][_0x2a8aa6];var _0xf8765c=_0x554fe9[_0x339d('0x7b')]();_0xf8765c[_0x339d('0x47')](_0x339d('0x7c'),_0x2cc505['id']);_0x5a4e0d[_0x339d('0x7d')](db[_0x339d('0x6e')][_0x339d('0x3c')](_0xf8765c[_0x339d('0x7e')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x140100){if(_0x140100['length']===0x1){return _0x2cc505['id'];}else{var _0x5c1544=_[_0x339d('0x7f')](_[_0x339d('0x35')](_0x140100,_0x339d('0x80')),function(_0x2e330d){return _['includes'](_0x196089,_0x2e330d);});if(_0x5c1544){return _0x2cc505['id'];}}}));}}return BPromise[_0x339d('0x81')](_0x5a4e0d)[_0x339d('0x2c')](function(_0x203610){_0x3b757d=_(_0x3b757d)[_0x339d('0x82')](_0x203610)['compact']()[_0x339d('0x83')]();return db[_0x339d('0x36')][_0x339d('0x52')]({'where':{'id':_0x1e64d8[_0x339d('0x59')]['id']}})[_0x339d('0x2c')](function(_0x3b4cbd){return db['sequelize'][_0x339d('0x84')](function(_0x4080cc){return _0x3b4cbd['removeTeams'](_0x1e64d8[_0x339d('0x3c')]['ids'],{'transaction':_0x4080cc})[_0x339d('0x2c')](function(){if(!_[_0x339d('0x85')](_0x3b757d)){return _0x3b4cbd[_0x339d('0x86')](_0x3b757d,{'transaction':_0x4080cc});}})[_0x339d('0x2c')](function(){_0x3b757d['forEach'](function(_0x4474d5){socket[_0x339d('0x87')](_0x339d('0x88'),{'UserId':_0x4474d5,'SmsQueueId':_0x3b4cbd['id']});});});});});});})['then'](respondWithStatusCode(_0x59df3b,null))[_0x339d('0x4f')](handleError(_0x59df3b,null));};exports[_0x339d('0x89')]=function(_0x4d58b5,_0x1e8640,_0x18e67d){return db[_0x339d('0x36')]['find']({'where':{'id':_0x4d58b5['params']['id']}})['then'](handleEntityNotFound(_0x1e8640,null))['then'](function(_0x5b31e9){if(_0x5b31e9){return _0x5b31e9[_0x339d('0x89')](_0x4d58b5[_0x339d('0x54')][_0x339d('0x6a')],_[_0x339d('0x8a')](_0x4d58b5[_0x339d('0x54')],[_0x339d('0x6a'),'id'])||{})['spread'](function(_0x4dbba1){for(var _0x5431c0=0x0;_0x5431c0<_0x4d58b5[_0x339d('0x54')][_0x339d('0x6a')][_0x339d('0x42')];_0x5431c0+=0x1){socket[_0x339d('0x87')](_0x339d('0x72'),{'UserId':Number(_0x4d58b5[_0x339d('0x54')][_0x339d('0x6a')][_0x5431c0]),'SmsQueueId':Number(_0x4d58b5[_0x339d('0x59')]['id'])});}return _0x4dbba1;});}})[_0x339d('0x2c')](respondWithResult(_0x1e8640,null))[_0x339d('0x4f')](handleError(_0x1e8640,null));};exports[_0x339d('0x86')]=function(_0x252a64,_0x23f7de,_0x199657){return db['SmsQueue'][_0x339d('0x52')]({'where':{'id':_0x252a64[_0x339d('0x59')]['id']}})['then'](handleEntityNotFound(_0x23f7de,null))[_0x339d('0x2c')](function(_0x123382){if(_0x123382){return _0x123382[_0x339d('0x86')](_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')])['then'](function(){if(_['isArray'](_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')])){for(var _0x443ff8=0x0;_0x443ff8<_0x252a64['query'][_0x339d('0x6a')][_0x339d('0x42')];_0x443ff8+=0x1){socket[_0x339d('0x87')](_0x339d('0x88'),{'UserId':Number(_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')][_0x443ff8]),'SmsQueueId':Number(_0x252a64[_0x339d('0x59')]['id'])});}}else{socket[_0x339d('0x87')](_0x339d('0x88'),{'UserId':Number(_0x252a64[_0x339d('0x3c')][_0x339d('0x6a')]),'SmsQueueId':Number(_0x252a64[_0x339d('0x59')]['id'])});}});}})[_0x339d('0x2c')](respondWithStatusCode(_0x23f7de,null))[_0x339d('0x4f')](handleError(_0x23f7de,null));};exports['getAgents']=function(_0x3d3d71,_0x275f86,_0x1faeb4){var _0x7838de={};var _0x408216={};var _0x2d45d0;var _0x39de75;return db[_0x339d('0x36')]['findOne']({'where':{'id':_0x3d3d71['params']['id']}})['then'](handleEntityNotFound(_0x275f86,null))['then'](function(_0x1c817b){if(_0x1c817b){_0x2d45d0=_0x1c817b;_0x408216[_0x339d('0x3b')]=_[_0x339d('0x3d')](db['User'][_0x339d('0x37')]);_0x408216['query']=_[_0x339d('0x3d')](_0x3d3d71['query']);_0x408216[_0x339d('0x3e')]=_['intersection'](_0x408216[_0x339d('0x3b')],_0x408216[_0x339d('0x3c')]);_0x7838de[_0x339d('0x3f')]=_[_0x339d('0x40')](_0x408216[_0x339d('0x3b')],qs['fields'](_0x3d3d71[_0x339d('0x3c')][_0x339d('0x41')]));_0x7838de[_0x339d('0x3f')]=_0x7838de[_0x339d('0x3f')][_0x339d('0x42')]?_0x7838de['attributes']:_0x408216[_0x339d('0x3b')];_0x7838de['order']=qs['sort'](_0x3d3d71[_0x339d('0x3c')][_0x339d('0x46')]);_0x7838de[_0x339d('0x47')]=qs[_0x339d('0x3e')](_[_0x339d('0x48')](_0x3d3d71[_0x339d('0x3c')],_0x408216[_0x339d('0x3e')]));if(_0x3d3d71[_0x339d('0x3c')]['filter']){_0x7838de['where']=_[_0x339d('0x4a')](_0x7838de['where'],{'$or':_[_0x339d('0x35')](_0x7838de[_0x339d('0x3f')],function(_0x52eab2){var _0x13d01e={};_0x13d01e[_0x52eab2]={'$like':'%'+_0x3d3d71[_0x339d('0x3c')][_0x339d('0x49')]+'%'};return _0x13d01e;})});}_0x7838de=_[_0x339d('0x4a')]({},_0x7838de,_0x3d3d71[_0x339d('0x51')]);return _0x2d45d0[_0x339d('0x8b')](_0x7838de);}})['then'](function(_0x563497){if(_0x563497){_0x39de75=_0x563497[_0x339d('0x42')];if(!_0x3d3d71[_0x339d('0x3c')]['hasOwnProperty'](_0x339d('0x44'))){_0x7838de['limit']=qs[_0x339d('0x26')](_0x3d3d71[_0x339d('0x3c')]['limit']);_0x7838de[_0x339d('0x23')]=qs['offset'](_0x3d3d71['query'][_0x339d('0x23')]);}return _0x2d45d0['getAgents'](_0x7838de);}})[_0x339d('0x2c')](function(_0x50015c){if(_0x50015c){return _0x50015c?{'count':_0x39de75,'rows':_0x50015c}:null;}})[_0x339d('0x2c')](respondWithResult(_0x275f86,null))[_0x339d('0x4f')](handleError(_0x275f86,null));}; \ No newline at end of file +var _0x4b24=['mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','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','./smsQueue.socket','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','online','interface','flatMap','Agents','sequelize','each','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','isEmpty','removeAgents','forEach','emit','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x2b5403,_0x4a9ce0){var _0x1b1ede=function(_0x352e1b){while(--_0x352e1b){_0x2b5403['push'](_0x2b5403['shift']());}};_0x1b1ede(++_0x4a9ce0);}(_0x4b24,0x8a));var _0x44b2=function(_0xa76f6f,_0x306cb8){_0xa76f6f=_0xa76f6f-0x0;var _0x50cede=_0x4b24[_0xa76f6f];return _0x50cede;};'use strict';var emlformat=require(_0x44b2('0x0'));var rimraf=require(_0x44b2('0x1'));var zipdir=require(_0x44b2('0x2'));var jsonpatch=require(_0x44b2('0x3'));var rp=require(_0x44b2('0x4'));var moment=require('moment');var BPromise=require(_0x44b2('0x5'));var Mustache=require(_0x44b2('0x6'));var util=require('util');var path=require(_0x44b2('0x7'));var sox=require('sox');var csv=require(_0x44b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b2('0x9'));var _=require(_0x44b2('0xa'));var squel=require(_0x44b2('0xb'));var crypto=require(_0x44b2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x44b2('0xd'));var toCsv=require(_0x44b2('0x8'));var querystring=require('querystring');var Papa=require(_0x44b2('0xe'));var Redis=require(_0x44b2('0xf'));var authService=require(_0x44b2('0x10'));var qs=require(_0x44b2('0x11'));var as=require(_0x44b2('0x12'));var hardwareService=require(_0x44b2('0x13'));var logger=require(_0x44b2('0x14'))(_0x44b2('0x15'));var utils=require(_0x44b2('0x16'));var config=require(_0x44b2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x44b2('0x18')]=_['defaults'](config[_0x44b2('0x18')],{'host':_0x44b2('0x19'),'port':0x18eb});var socket=require(_0x44b2('0x1a'))(new Redis(config[_0x44b2('0x18')]));require(_0x44b2('0x1b'))['register'](socket);function respondWithStatusCode(_0x25950d,_0x30da25){_0x30da25=_0x30da25||0xcc;return function(_0x3c485f){if(_0x3c485f){return _0x25950d['sendStatus'](_0x30da25);}return _0x25950d[_0x44b2('0x1c')](_0x30da25)['end']();};}function respondWithResult(_0x417899,_0x365ee5){_0x365ee5=_0x365ee5||0xc8;return function(_0x33c098){if(_0x33c098){return _0x417899['status'](_0x365ee5)['json'](_0x33c098);}};}function respondWithFilteredResult(_0x182012,_0x4212d3){return function(_0x43237a){if(_0x43237a){var _0x3b38cc=typeof _0x4212d3[_0x44b2('0x1d')]==='undefined'&&typeof _0x4212d3[_0x44b2('0x1e')]==='undefined';var _0x5677f2=_0x43237a[_0x44b2('0x1f')];var _0x3b865f=_0x3b38cc?0x0:_0x4212d3[_0x44b2('0x1d')];var _0x2cb036=_0x3b38cc?_0x43237a[_0x44b2('0x1f')]:_0x4212d3[_0x44b2('0x1d')]+_0x4212d3[_0x44b2('0x1e')];var _0x38ad86;if(_0x2cb036>=_0x5677f2){_0x2cb036=_0x5677f2;_0x38ad86=0xc8;}else{_0x38ad86=0xce;}_0x182012[_0x44b2('0x1c')](_0x38ad86);return _0x182012[_0x44b2('0x20')](_0x44b2('0x21'),_0x3b865f+'-'+_0x2cb036+'/'+_0x5677f2)[_0x44b2('0x22')](_0x43237a);}return null;};}function patchUpdates(_0x12e7c3){return function(_0x499645){try{jsonpatch[_0x44b2('0x23')](_0x499645,_0x12e7c3,!![]);}catch(_0x3b3fa5){return BPromise[_0x44b2('0x24')](_0x3b3fa5);}return _0x499645[_0x44b2('0x25')]();};}function saveUpdates(_0x4cec60,_0xe9ec81){return function(_0x1a38f0){if(_0x1a38f0){return _0x1a38f0[_0x44b2('0x26')](_0x4cec60)[_0x44b2('0x27')](function(_0x12e901){return _0x12e901;});}return null;};}function removeEntity(_0x4a3a5e,_0x2b9342){return function(_0x3ea444){if(_0x3ea444){return _0x3ea444[_0x44b2('0x28')]()[_0x44b2('0x27')](function(){var _0x35ca15=_0x3ea444['get']({'plain':!![]});var _0x3e7627=_0x44b2('0x29');return db[_0x44b2('0x2a')][_0x44b2('0x28')]({'where':{'type':_0x3e7627,'resourceId':_0x35ca15['id']}})[_0x44b2('0x27')](function(){return _0x3ea444;});})[_0x44b2('0x27')](function(){_0x4a3a5e[_0x44b2('0x1c')](0xcc)[_0x44b2('0x2b')]();});}};}function handleEntityNotFound(_0x3f80f8,_0x2490ce){return function(_0x4e1928){if(!_0x4e1928){_0x3f80f8[_0x44b2('0x2c')](0x194);}return _0x4e1928;};}function handleError(_0x128f84,_0x12c4fc){_0x12c4fc=_0x12c4fc||0x1f4;return function(_0x60995c){logger[_0x44b2('0x2d')](_0x60995c[_0x44b2('0x2e')]);if(_0x60995c[_0x44b2('0x2f')]){delete _0x60995c['name'];}_0x128f84[_0x44b2('0x1c')](_0x12c4fc)[_0x44b2('0x30')](_0x60995c);};}exports[_0x44b2('0x31')]=function(_0x19f11d,_0x3eb16b){var _0x11e42e={},_0x2d9df9={},_0x4a6589={'count':0x0,'rows':[]};var _0x5c0d4e=_[_0x44b2('0x32')](db[_0x44b2('0x33')][_0x44b2('0x34')],function(_0x1fff65){return{'name':_0x1fff65[_0x44b2('0x35')],'type':_0x1fff65[_0x44b2('0x36')][_0x44b2('0x37')]};});_0x2d9df9[_0x44b2('0x38')]=_[_0x44b2('0x32')](_0x5c0d4e,'name');_0x2d9df9[_0x44b2('0x39')]=_[_0x44b2('0x3a')](_0x19f11d[_0x44b2('0x39')]);_0x2d9df9[_0x44b2('0x3b')]=_['intersection'](_0x2d9df9[_0x44b2('0x38')],_0x2d9df9[_0x44b2('0x39')]);_0x11e42e[_0x44b2('0x3c')]=_[_0x44b2('0x3d')](_0x2d9df9[_0x44b2('0x38')],qs['fields'](_0x19f11d[_0x44b2('0x39')][_0x44b2('0x3e')]));_0x11e42e[_0x44b2('0x3c')]=_0x11e42e['attributes'][_0x44b2('0x3f')]?_0x11e42e[_0x44b2('0x3c')]:_0x2d9df9['model'];if(!_0x19f11d['query'][_0x44b2('0x40')](_0x44b2('0x41'))){_0x11e42e[_0x44b2('0x1e')]=qs[_0x44b2('0x1e')](_0x19f11d[_0x44b2('0x39')][_0x44b2('0x1e')]);_0x11e42e[_0x44b2('0x1d')]=qs[_0x44b2('0x1d')](_0x19f11d[_0x44b2('0x39')][_0x44b2('0x1d')]);}_0x11e42e[_0x44b2('0x42')]=qs[_0x44b2('0x43')](_0x19f11d[_0x44b2('0x39')][_0x44b2('0x43')]);_0x11e42e['where']=qs[_0x44b2('0x3b')](_['pick'](_0x19f11d[_0x44b2('0x39')],_0x2d9df9[_0x44b2('0x3b')]),_0x5c0d4e);if(_0x19f11d[_0x44b2('0x39')]['filter']){_0x11e42e[_0x44b2('0x44')]=_[_0x44b2('0x45')](_0x11e42e[_0x44b2('0x44')],{'$or':_[_0x44b2('0x32')](_0x5c0d4e,function(_0x5b2e54){if(_0x5b2e54['type']!==_0x44b2('0x46')){var _0x5f0232={};_0x5f0232[_0x5b2e54[_0x44b2('0x2f')]]={'$like':'%'+_0x19f11d[_0x44b2('0x39')][_0x44b2('0x47')]+'%'};return _0x5f0232;}})});}_0x11e42e=_[_0x44b2('0x45')]({},_0x11e42e,_0x19f11d[_0x44b2('0x48')]);var _0x3ab8b0={'where':_0x11e42e[_0x44b2('0x44')]};return db[_0x44b2('0x33')]['count'](_0x3ab8b0)[_0x44b2('0x27')](function(_0x1c5780){_0x4a6589['count']=_0x1c5780;if(_0x19f11d['query'][_0x44b2('0x49')]){_0x11e42e[_0x44b2('0x4a')]=[{'all':!![]}];}return db[_0x44b2('0x33')][_0x44b2('0x4b')](_0x11e42e);})['then'](function(_0x4e84c1){_0x4a6589[_0x44b2('0x4c')]=_0x4e84c1;return _0x4a6589;})[_0x44b2('0x27')](respondWithFilteredResult(_0x3eb16b,_0x11e42e))['catch'](handleError(_0x3eb16b,null));};exports[_0x44b2('0x4d')]=function(_0x4f5bdb,_0x1dc9a8){var _0x23b162={'raw':!![],'where':{'id':_0x4f5bdb['params']['id']}},_0x5e6db7={};_0x5e6db7[_0x44b2('0x38')]=_[_0x44b2('0x3a')](db[_0x44b2('0x33')][_0x44b2('0x34')]);_0x5e6db7[_0x44b2('0x39')]=_[_0x44b2('0x3a')](_0x4f5bdb[_0x44b2('0x39')]);_0x5e6db7[_0x44b2('0x3b')]=_[_0x44b2('0x3d')](_0x5e6db7['model'],_0x5e6db7[_0x44b2('0x39')]);_0x23b162[_0x44b2('0x3c')]=_[_0x44b2('0x3d')](_0x5e6db7['model'],qs[_0x44b2('0x3e')](_0x4f5bdb[_0x44b2('0x39')][_0x44b2('0x3e')]));_0x23b162['attributes']=_0x23b162['attributes'][_0x44b2('0x3f')]?_0x23b162[_0x44b2('0x3c')]:_0x5e6db7[_0x44b2('0x38')];if(_0x4f5bdb[_0x44b2('0x39')][_0x44b2('0x49')]){_0x23b162[_0x44b2('0x4a')]=[{'all':!![]}];}_0x23b162=_[_0x44b2('0x45')]({},_0x23b162,_0x4f5bdb[_0x44b2('0x48')]);return db[_0x44b2('0x33')]['find'](_0x23b162)[_0x44b2('0x27')](handleEntityNotFound(_0x1dc9a8,null))[_0x44b2('0x27')](respondWithResult(_0x1dc9a8,null))[_0x44b2('0x4e')](handleError(_0x1dc9a8,null));};exports[_0x44b2('0x4f')]=function(_0xe0e8d1,_0x2022db){return db['SmsQueue']['create'](_0xe0e8d1[_0x44b2('0x50')],{})['then'](function(_0x527da4){var _0x13669b=_0xe0e8d1[_0x44b2('0x51')][_0x44b2('0x52')]({'plain':!![]});if(!_0x13669b)throw new Error(_0x44b2('0x53'));if(_0x13669b[_0x44b2('0x54')]===_0x44b2('0x51')){var _0x530954=_0x527da4[_0x44b2('0x52')]({'plain':!![]});var _0x4ae243=_0x44b2('0x29');return db[_0x44b2('0x55')][_0x44b2('0x56')]({'where':{'name':_0x4ae243,'userProfileId':_0x13669b[_0x44b2('0x57')]},'raw':!![]})[_0x44b2('0x27')](function(_0x2a1f3c){if(_0x2a1f3c&&_0x2a1f3c['autoAssociation']===0x0){return db[_0x44b2('0x2a')][_0x44b2('0x4f')]({'name':_0x530954[_0x44b2('0x2f')],'resourceId':_0x530954['id'],'type':_0x2a1f3c[_0x44b2('0x2f')],'sectionId':_0x2a1f3c['id']},{})['then'](function(){return _0x527da4;});}else{return _0x527da4;}})['catch'](function(_0x33a2ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33a2ea);throw _0x33a2ea;});}return _0x527da4;})[_0x44b2('0x27')](respondWithResult(_0x2022db,0xc9))[_0x44b2('0x4e')](handleError(_0x2022db,null));};exports[_0x44b2('0x26')]=function(_0x58df93,_0x38ada7){if(_0x58df93[_0x44b2('0x50')]['id']){delete _0x58df93['body']['id'];}return db[_0x44b2('0x33')][_0x44b2('0x56')]({'where':{'id':_0x58df93[_0x44b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x38ada7,null))[_0x44b2('0x27')](saveUpdates(_0x58df93['body'],null))['then'](respondWithResult(_0x38ada7,null))['catch'](handleError(_0x38ada7,null));};exports[_0x44b2('0x28')]=function(_0x50ea27,_0x30749a){return db[_0x44b2('0x33')]['find']({'where':{'id':_0x50ea27[_0x44b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x30749a,null))['then'](removeEntity(_0x30749a,null))[_0x44b2('0x4e')](handleError(_0x30749a,null));};exports[_0x44b2('0x59')]=function(_0x204638,_0x1948fc){return db[_0x44b2('0x33')][_0x44b2('0x59')]()[_0x44b2('0x27')](respondWithResult(_0x1948fc,null))[_0x44b2('0x4e')](handleError(_0x1948fc,null));};exports[_0x44b2('0x5a')]=function(_0x3fa342,_0x3d5aac,_0x5c8bd3){var _0x380389={'raw':!![],'where':{}},_0xb7aa7a={},_0x1fe3e4;return db[_0x44b2('0x33')][_0x44b2('0x5b')]({'where':{'id':_0x3fa342['params']['id']}})[_0x44b2('0x27')](handleEntityNotFound(_0x3d5aac,null))[_0x44b2('0x27')](function(_0x5e0911){if(_0x5e0911){_0x1fe3e4=_0x5e0911[_0x44b2('0x52')]({'plain':!![]});_0xb7aa7a['model']=_['keys'](db[_0x44b2('0x5c')][_0x44b2('0x34')]);_0xb7aa7a[_0x44b2('0x39')]=_[_0x44b2('0x3a')](_0x3fa342['query']);_0xb7aa7a[_0x44b2('0x3b')]=_[_0x44b2('0x3d')](_0xb7aa7a[_0x44b2('0x38')],_0xb7aa7a['query']);_0x380389[_0x44b2('0x3c')]=_[_0x44b2('0x3d')](_0xb7aa7a[_0x44b2('0x38')],qs['fields'](_0x3fa342[_0x44b2('0x39')][_0x44b2('0x3e')]));_0x380389[_0x44b2('0x3c')]=_0x380389[_0x44b2('0x3c')]['length']?_0x380389[_0x44b2('0x3c')]:_0xb7aa7a['model'];if(!_0x3fa342['query'][_0x44b2('0x40')](_0x44b2('0x41'))){_0x380389[_0x44b2('0x1e')]=qs['limit'](_0x3fa342[_0x44b2('0x39')][_0x44b2('0x1e')]);_0x380389[_0x44b2('0x1d')]=qs[_0x44b2('0x1d')](_0x3fa342['query'][_0x44b2('0x1d')]);}_0x380389[_0x44b2('0x42')]=qs[_0x44b2('0x43')](_0x3fa342[_0x44b2('0x39')][_0x44b2('0x43')]);_0x380389[_0x44b2('0x44')]=qs['filters'](_['pick'](_0x3fa342[_0x44b2('0x39')],_0xb7aa7a[_0x44b2('0x3b')]));_0x380389['where'][_0x44b2('0x5d')]=_0x5e0911['id'];if(_0x3fa342[_0x44b2('0x39')][_0x44b2('0x47')]){_0x380389[_0x44b2('0x44')]=_['merge'](_0x380389[_0x44b2('0x44')],{'$or':_[_0x44b2('0x32')](_0x380389['attributes'],function(_0x5ebb41){var _0x316682={};_0x316682[_0x5ebb41]={'$like':'%'+_0x3fa342[_0x44b2('0x39')][_0x44b2('0x47')]+'%'};return _0x316682;})});}_0x380389=_[_0x44b2('0x45')]({},_0x380389,_0x3fa342[_0x44b2('0x48')]);return db[_0x44b2('0x5c')][_0x44b2('0x4b')](_0x380389);}})[_0x44b2('0x27')](function(_0x41e86e){if(_0x41e86e){return db[_0x44b2('0x5e')][_0x44b2('0x5f')]({'where':{'id':_['map'](_0x41e86e,_0x44b2('0x60')),'role':_0x44b2('0x61')},'attributes':['id',_0x44b2('0x2f'),_0x44b2('0x62'),_0x44b2('0x63'),_0x44b2('0x64')]});}})[_0x44b2('0x27')](function(_0x4dc323){if(_0x4dc323){return{'count':_0x4dc323[_0x44b2('0x1f')],'rows':_[_0x44b2('0x32')](_0x4dc323['rows'],function(_0x2ca023){return{'membername':_0x2ca023['name'],'UserId':_0x2ca023['id'],'queue_name':_0x1fe3e4[_0x44b2('0x2f')],'SmsQueueId':_0x1fe3e4['id'],'interface':util[_0x44b2('0x65')](_0x44b2('0x66'),_0x44b2('0x67'),_0x2ca023['name']),'penalty':0x0,'paused':_0x2ca023['smsPause'],'createdAt':_0x2ca023[_0x44b2('0x64')],'updatedAt':_0x2ca023[_0x44b2('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44b2('0x27')](respondWithFilteredResult(_0x3d5aac,_0x380389))[_0x44b2('0x4e')](handleError(_0x3d5aac,null));};exports[_0x44b2('0x68')]=function(_0x558d82,_0x100608,_0x376c4a){var _0x147808={};var _0x2fb01b={};var _0x2bb8d8;var _0xd6d8e6;return db['SmsQueue'][_0x44b2('0x5b')]({'where':{'id':_0x558d82[_0x44b2('0x58')]['id']}})['then'](handleEntityNotFound(_0x100608,null))[_0x44b2('0x27')](function(_0x14369f){if(_0x14369f){_0x2bb8d8=_0x14369f;_0x2fb01b[_0x44b2('0x38')]=_['keys'](db[_0x44b2('0x69')][_0x44b2('0x34')]);_0x2fb01b[_0x44b2('0x39')]=_[_0x44b2('0x3a')](_0x558d82[_0x44b2('0x39')]);_0x2fb01b[_0x44b2('0x3b')]=_[_0x44b2('0x3d')](_0x2fb01b[_0x44b2('0x38')],_0x2fb01b[_0x44b2('0x39')]);_0x147808[_0x44b2('0x3c')]=_[_0x44b2('0x3d')](_0x2fb01b['model'],qs[_0x44b2('0x3e')](_0x558d82[_0x44b2('0x39')][_0x44b2('0x3e')]));_0x147808[_0x44b2('0x3c')]=_0x147808[_0x44b2('0x3c')][_0x44b2('0x3f')]?_0x147808[_0x44b2('0x3c')]:_0x2fb01b['model'];_0x147808[_0x44b2('0x42')]=qs[_0x44b2('0x43')](_0x558d82['query'][_0x44b2('0x43')]);_0x147808[_0x44b2('0x44')]=qs[_0x44b2('0x3b')](_[_0x44b2('0x6a')](_0x558d82[_0x44b2('0x39')],_0x2fb01b['filters']));if(_0x558d82[_0x44b2('0x39')][_0x44b2('0x47')]){_0x147808[_0x44b2('0x44')]=_[_0x44b2('0x45')](_0x147808[_0x44b2('0x44')],{'$or':_[_0x44b2('0x32')](_0x147808[_0x44b2('0x3c')],function(_0x34473f){var _0x4501d9={};_0x4501d9[_0x34473f]={'$like':'%'+_0x558d82[_0x44b2('0x39')][_0x44b2('0x47')]+'%'};return _0x4501d9;})});}_0x147808=_[_0x44b2('0x45')]({},_0x147808,_0x558d82[_0x44b2('0x48')]);return _0x2bb8d8[_0x44b2('0x68')](_0x147808);}})[_0x44b2('0x27')](function(_0x4665d5){if(_0x4665d5){_0xd6d8e6=_0x4665d5[_0x44b2('0x3f')];if(!_0x558d82['query'][_0x44b2('0x40')](_0x44b2('0x41'))){_0x147808[_0x44b2('0x1e')]=qs[_0x44b2('0x1e')](_0x558d82[_0x44b2('0x39')][_0x44b2('0x1e')]);_0x147808[_0x44b2('0x1d')]=qs[_0x44b2('0x1d')](_0x558d82['query'][_0x44b2('0x1d')]);}return _0x2bb8d8[_0x44b2('0x68')](_0x147808);}})['then'](function(_0x2fca41){if(_0x2fca41){return _0x2fca41?{'count':_0xd6d8e6,'rows':_0x2fca41}:null;}})[_0x44b2('0x27')](respondWithResult(_0x100608,null))[_0x44b2('0x4e')](handleError(_0x100608,null));};exports[_0x44b2('0x6b')]=function(_0x121526,_0x41d102,_0x3ba5fe){var _0x3884dc=_0x121526[_0x44b2('0x50')][_0x44b2('0x6c')];return db[_0x44b2('0x69')][_0x44b2('0x4b')]({'where':{'id':_0x3884dc},'attributes':['id'],'include':[{'model':db[_0x44b2('0x5e')],'as':'Agents','attributes':['id',_0x44b2('0x2f'),_0x44b2('0x6d'),'voicePause',_0x44b2('0x6e')],'raw':!![]}]})[_0x44b2('0x27')](function(_0x4a6739){if(_0x4a6739){var _0x296428=_[_0x44b2('0x6f')](_0x4a6739,function(_0x258720){var _0x5ad52c=_0x258720[_0x44b2('0x52')]({'plain':!![]});return _0x5ad52c[_0x44b2('0x70')];});return db['SmsQueue'][_0x44b2('0x56')]({'where':{'id':_0x121526[_0x44b2('0x58')]['id']}})['then'](function(_0x35b131){return db[_0x44b2('0x71')]['transaction'](function(_0x542f89){return _0x35b131[_0x44b2('0x6b')](_0x3884dc,{'transaction':_0x542f89})['then'](function(){return BPromise[_0x44b2('0x72')](_0x296428,function(_0x28bdd8){return db[_0x44b2('0x5c')]['findOrCreate']({'where':{'UserId':_0x28bdd8['id'],'SmsQueueId':_0x121526[_0x44b2('0x58')]['id']},'transaction':_0x542f89});});})[_0x44b2('0x27')](function(){_0x296428['forEach'](function(_0x398c9b){socket['emit'](_0x44b2('0x73'),{'UserId':_0x398c9b['id'],'SmsQueueId':_0x35b131['id']});});});});});}})[_0x44b2('0x27')](respondWithStatusCode(_0x41d102,null))[_0x44b2('0x4e')](handleError(_0x41d102,null));};exports[_0x44b2('0x74')]=function(_0x4ed740,_0x217330,_0x443943){return db[_0x44b2('0x69')]['findAll']({'where':{'id':_0x4ed740[_0x44b2('0x39')][_0x44b2('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x44b2('0x5e')],'as':_0x44b2('0x70'),'attributes':['id'],'raw':!![]}]})[_0x44b2('0x27')](handleEntityNotFound(_0x217330,null))['then'](function(_0x508d6d){var _0x40bb9a=_['map'](_0x508d6d,'id');var _0x51cfd2=[];var _0x20ecd3=[];var _0x5658d0=squel['select']();_0x5658d0[_0x44b2('0x75')](_0x44b2('0x76'))[_0x44b2('0x77')](_0x44b2('0x78'),'tq')[_0x44b2('0x79')](_0x44b2('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x44b2('0x7b'),_0x4ed740[_0x44b2('0x58')]['id']);for(var _0x3989f2=0x0;_0x3989f2<_0x508d6d[_0x44b2('0x3f')];_0x3989f2+=0x1){let _0x95772b=_0x508d6d[_0x3989f2];for(var _0x1f2cd4=0x0;_0x1f2cd4<_0x95772b[_0x44b2('0x70')][_0x44b2('0x3f')];_0x1f2cd4+=0x1){let _0x5a6aad=_0x95772b[_0x44b2('0x70')][_0x1f2cd4];var _0x2d167b=_0x5658d0[_0x44b2('0x7c')]();_0x2d167b['where'](_0x44b2('0x7d'),_0x5a6aad['id']);_0x20ecd3['push'](db[_0x44b2('0x71')][_0x44b2('0x39')](_0x2d167b[_0x44b2('0x7e')](),{'type':db['sequelize'][_0x44b2('0x7f')][_0x44b2('0x80')]})[_0x44b2('0x27')](function(_0x4b74b5){if(_0x4b74b5[_0x44b2('0x3f')]===0x1){return _0x5a6aad['id'];}else{var _0x28278f=_[_0x44b2('0x81')](_[_0x44b2('0x32')](_0x4b74b5,_0x44b2('0x82')),function(_0x1755c5){return _[_0x44b2('0x83')](_0x40bb9a,_0x1755c5);});if(_0x28278f){return _0x5a6aad['id'];}}}));}}return BPromise[_0x44b2('0x84')](_0x20ecd3)[_0x44b2('0x27')](function(_0x488575){_0x51cfd2=_(_0x51cfd2)['union'](_0x488575)[_0x44b2('0x85')]()[_0x44b2('0x86')]();return db[_0x44b2('0x33')]['find']({'where':{'id':_0x4ed740[_0x44b2('0x58')]['id']}})[_0x44b2('0x27')](function(_0xc808f6){return db[_0x44b2('0x71')][_0x44b2('0x87')](function(_0x59b0f0){return _0xc808f6[_0x44b2('0x74')](_0x4ed740[_0x44b2('0x39')][_0x44b2('0x6c')],{'transaction':_0x59b0f0})[_0x44b2('0x27')](function(){if(!_[_0x44b2('0x88')](_0x51cfd2)){return _0xc808f6[_0x44b2('0x89')](_0x51cfd2,{'transaction':_0x59b0f0});}})[_0x44b2('0x27')](function(){_0x51cfd2[_0x44b2('0x8a')](function(_0x31c3e1){socket[_0x44b2('0x8b')](_0x44b2('0x8c'),{'UserId':_0x31c3e1,'SmsQueueId':_0xc808f6['id']});});});});});});})[_0x44b2('0x27')](respondWithStatusCode(_0x217330,null))[_0x44b2('0x4e')](handleError(_0x217330,null));};exports[_0x44b2('0x8d')]=function(_0x165e4b,_0xd2b9d5,_0x54601b){return db['SmsQueue']['find']({'where':{'id':_0x165e4b[_0x44b2('0x58')]['id']}})['then'](handleEntityNotFound(_0xd2b9d5,null))[_0x44b2('0x27')](function(_0x58dc91){if(_0x58dc91){return _0x58dc91['addAgents'](_0x165e4b['body'][_0x44b2('0x6c')],_['omit'](_0x165e4b[_0x44b2('0x50')],['ids','id'])||{})['spread'](function(_0x49fbcf){for(var _0x16ec31=0x0;_0x16ec31<_0x165e4b['body'][_0x44b2('0x6c')][_0x44b2('0x3f')];_0x16ec31+=0x1){socket['emit'](_0x44b2('0x73'),{'UserId':Number(_0x165e4b['body'][_0x44b2('0x6c')][_0x16ec31]),'SmsQueueId':Number(_0x165e4b['params']['id'])});}return _0x49fbcf;});}})['then'](respondWithResult(_0xd2b9d5,null))[_0x44b2('0x4e')](handleError(_0xd2b9d5,null));};exports['removeAgents']=function(_0x1194b8,_0x5e17ee,_0x2194eb){return db[_0x44b2('0x33')]['find']({'where':{'id':_0x1194b8[_0x44b2('0x58')]['id']}})[_0x44b2('0x27')](handleEntityNotFound(_0x5e17ee,null))[_0x44b2('0x27')](function(_0x5c595d){if(_0x5c595d){return _0x5c595d['removeAgents'](_0x1194b8[_0x44b2('0x39')]['ids'])[_0x44b2('0x27')](function(){if(_[_0x44b2('0x8e')](_0x1194b8[_0x44b2('0x39')][_0x44b2('0x6c')])){for(var _0x5d8d47=0x0;_0x5d8d47<_0x1194b8[_0x44b2('0x39')][_0x44b2('0x6c')][_0x44b2('0x3f')];_0x5d8d47+=0x1){socket[_0x44b2('0x8b')](_0x44b2('0x8c'),{'UserId':Number(_0x1194b8[_0x44b2('0x39')][_0x44b2('0x6c')][_0x5d8d47]),'SmsQueueId':Number(_0x1194b8[_0x44b2('0x58')]['id'])});}}else{socket[_0x44b2('0x8b')](_0x44b2('0x8c'),{'UserId':Number(_0x1194b8[_0x44b2('0x39')][_0x44b2('0x6c')]),'SmsQueueId':Number(_0x1194b8[_0x44b2('0x58')]['id'])});}});}})[_0x44b2('0x27')](respondWithStatusCode(_0x5e17ee,null))[_0x44b2('0x4e')](handleError(_0x5e17ee,null));};exports[_0x44b2('0x8f')]=function(_0x2e83c9,_0x16d7d3,_0x5da4c3){var _0x11b56d={};var _0x18b9c1={};var _0x2a5bc6;var _0x41e691;return db[_0x44b2('0x33')][_0x44b2('0x5b')]({'where':{'id':_0x2e83c9[_0x44b2('0x58')]['id']}})[_0x44b2('0x27')](handleEntityNotFound(_0x16d7d3,null))[_0x44b2('0x27')](function(_0x279b24){if(_0x279b24){_0x2a5bc6=_0x279b24;_0x18b9c1['model']=_[_0x44b2('0x3a')](db[_0x44b2('0x5e')][_0x44b2('0x34')]);_0x18b9c1[_0x44b2('0x39')]=_[_0x44b2('0x3a')](_0x2e83c9[_0x44b2('0x39')]);_0x18b9c1[_0x44b2('0x3b')]=_[_0x44b2('0x3d')](_0x18b9c1[_0x44b2('0x38')],_0x18b9c1[_0x44b2('0x39')]);_0x11b56d[_0x44b2('0x3c')]=_['intersection'](_0x18b9c1['model'],qs[_0x44b2('0x3e')](_0x2e83c9[_0x44b2('0x39')][_0x44b2('0x3e')]));_0x11b56d[_0x44b2('0x3c')]=_0x11b56d['attributes'][_0x44b2('0x3f')]?_0x11b56d[_0x44b2('0x3c')]:_0x18b9c1['model'];_0x11b56d[_0x44b2('0x42')]=qs[_0x44b2('0x43')](_0x2e83c9['query'][_0x44b2('0x43')]);_0x11b56d[_0x44b2('0x44')]=qs[_0x44b2('0x3b')](_[_0x44b2('0x6a')](_0x2e83c9[_0x44b2('0x39')],_0x18b9c1[_0x44b2('0x3b')]));if(_0x2e83c9[_0x44b2('0x39')][_0x44b2('0x47')]){_0x11b56d[_0x44b2('0x44')]=_[_0x44b2('0x45')](_0x11b56d[_0x44b2('0x44')],{'$or':_['map'](_0x11b56d[_0x44b2('0x3c')],function(_0x2204ef){var _0x4bd759={};_0x4bd759[_0x2204ef]={'$like':'%'+_0x2e83c9[_0x44b2('0x39')][_0x44b2('0x47')]+'%'};return _0x4bd759;})});}_0x11b56d=_['merge']({},_0x11b56d,_0x2e83c9[_0x44b2('0x48')]);return _0x2a5bc6[_0x44b2('0x8f')](_0x11b56d);}})[_0x44b2('0x27')](function(_0xf75286){if(_0xf75286){_0x41e691=_0xf75286[_0x44b2('0x3f')];if(!_0x2e83c9[_0x44b2('0x39')][_0x44b2('0x40')](_0x44b2('0x41'))){_0x11b56d['limit']=qs[_0x44b2('0x1e')](_0x2e83c9[_0x44b2('0x39')][_0x44b2('0x1e')]);_0x11b56d[_0x44b2('0x1d')]=qs[_0x44b2('0x1d')](_0x2e83c9[_0x44b2('0x39')][_0x44b2('0x1d')]);}return _0x2a5bc6[_0x44b2('0x8f')](_0x11b56d);}})[_0x44b2('0x27')](function(_0x2d5835){if(_0x2d5835){return _0x2d5835?{'count':_0x41e691,'rows':_0x2d5835}:null;}})[_0x44b2('0x27')](respondWithResult(_0x16d7d3,null))[_0x44b2('0x4e')](handleError(_0x16d7d3,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index fd58895..480704c 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 _0x3100=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3100,0xc9));var _0x0310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3100[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0310('0x0'));var SmsQueue=require(_0x0310('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x0310('0x2')](0x0);var events={'afterCreate':_0x0310('0x3'),'afterUpdate':_0x0310('0x4'),'afterDestroy':_0x0310('0x5')};function emitEvent(_0x19651b){return function(_0x5a1056,_0x40eaa7,_0x366aa6){SmsQueueEvents[_0x0310('0x6')](_0x19651b+':'+_0x5a1056['id'],_0x5a1056);SmsQueueEvents[_0x0310('0x6')](_0x19651b,_0x5a1056);_0x366aa6(null);};}for(var e in events){if(events[_0x0310('0x7')](e)){var event=events[e];SmsQueue[_0x0310('0x8')](e,emitEvent(event));}}module[_0x0310('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xc653=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x7de33e,_0x46a873){var _0x9b0f8=function(_0x264f7f){while(--_0x264f7f){_0x7de33e['push'](_0x7de33e['shift']());}};_0x9b0f8(++_0x46a873);}(_0xc653,0x13c));var _0x3c65=function(_0x35dbcf,_0x125d42){_0x35dbcf=_0x35dbcf-0x0;var _0x59bc6a=_0xc653[_0x35dbcf];return _0x59bc6a;};'use strict';var EventEmitter=require(_0x3c65('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3c65('0x1')](0x0);var events={'afterCreate':_0x3c65('0x2'),'afterUpdate':_0x3c65('0x3'),'afterDestroy':_0x3c65('0x4')};function emitEvent(_0x5f02e8){return function(_0x1347e1,_0x5e8993,_0xc45945){SmsQueueEvents[_0x3c65('0x5')](_0x5f02e8+':'+_0x1347e1['id'],_0x1347e1);SmsQueueEvents[_0x3c65('0x5')](_0x5f02e8,_0x1347e1);_0xc45945(null);};}for(var e in events){if(events[_0x3c65('0x6')](e)){var event=events[e];SmsQueue[_0x3c65('0x7')](e,emitEvent(event));}}module[_0x3c65('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index bcbfe3a..f24c73d 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 _0x4e7d=['path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36afe7,_0x4bbd79){var _0xd28d41=function(_0x4255f6){while(--_0x4255f6){_0x36afe7['push'](_0x36afe7['shift']());}};_0xd28d41(++_0x4bbd79);}(_0x4e7d,0x77));var _0xd4e7=function(_0x197463,_0x2a3fc7){_0x197463=_0x197463-0x0;var _0x5e3278=_0x4e7d[_0x197463];return _0x5e3278;};'use strict';var _=require(_0xd4e7('0x0'));var util=require(_0xd4e7('0x1'));var logger=require(_0xd4e7('0x2'))(_0xd4e7('0x3'));var moment=require(_0xd4e7('0x4'));var BPromise=require(_0xd4e7('0x5'));var rp=require(_0xd4e7('0x6'));var fs=require('fs');var path=require(_0xd4e7('0x7'));var rimraf=require(_0xd4e7('0x8'));var config=require(_0xd4e7('0x9'));var attributes=require(_0xd4e7('0xa'));module[_0xd4e7('0xb')]=function(_0x4d3dd1,_0x49a3b7){return _0x4d3dd1[_0xd4e7('0xc')]('SmsQueue',attributes,{'tableName':_0xd4e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e71=['define','SmsQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x2e71,0x1e2));var _0x12e7=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x2e71[_0x44268d];return _0x4be92d;};'use strict';var _=require(_0x12e7('0x0'));var util=require(_0x12e7('0x1'));var logger=require('../../config/logger')(_0x12e7('0x2'));var moment=require(_0x12e7('0x3'));var BPromise=require(_0x12e7('0x4'));var rp=require(_0x12e7('0x5'));var fs=require('fs');var path=require(_0x12e7('0x6'));var rimraf=require(_0x12e7('0x7'));var config=require(_0x12e7('0x8'));var attributes=require('./smsQueue.attributes');module[_0x12e7('0x9')]=function(_0x418e4f,_0x22ca7d){return _0x418e4f[_0x12e7('0xa')](_0x12e7('0xb'),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 3bac1e0..8da996c 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 _0x7cc7=['error','code','message','SmsQueue,\x20%s,\x20%s','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','then','catch','ShowSmsQueue','find','model','info','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','debug','request\x20sent','stringify'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x7cc7,0x1af));var _0x77cc=function(_0x2f5d1d,_0x54ca1f){_0x2f5d1d=_0x2f5d1d-0x0;var _0x200f94=_0x7cc7[_0x2f5d1d];return _0x200f94;};'use strict';var _=require(_0x77cc('0x0'));var util=require(_0x77cc('0x1'));var moment=require(_0x77cc('0x2'));var BPromise=require(_0x77cc('0x3'));var rs=require(_0x77cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77cc('0x5'))(_0x77cc('0x6'));var config=require(_0x77cc('0x7'));var jayson=require(_0x77cc('0x8'));var client=jayson['client'][_0x77cc('0x9')]({'port':0x232a});config[_0x77cc('0xa')]=_[_0x77cc('0xb')](config['redis'],{'host':_0x77cc('0xc'),'port':0x18eb});var socket=require(_0x77cc('0xd'))(new Redis(config[_0x77cc('0xa')]));require(_0x77cc('0xe'))[_0x77cc('0xf')](socket);function respondWithRpcPromise(_0x55042c,_0x34e230,_0x3d4ea6){return new BPromise(function(_0x4dbc13,_0x4592c8){return client[_0x77cc('0x10')](_0x55042c,_0x3d4ea6)['then'](function(_0x255217){logger['info']('SmsQueue,\x20%s,\x20%s',_0x34e230,'request\x20sent');logger[_0x77cc('0x11')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x34e230,_0x77cc('0x12'),JSON[_0x77cc('0x13')](_0x255217));if(_0x255217[_0x77cc('0x14')]){if(_0x255217[_0x77cc('0x14')][_0x77cc('0x15')]===0x1f4){logger[_0x77cc('0x14')]('SmsQueue,\x20%s,\x20%s',_0x34e230,_0x255217[_0x77cc('0x14')]['message']);return _0x4592c8(_0x255217['error'][_0x77cc('0x16')]);}logger[_0x77cc('0x14')](_0x77cc('0x17'),_0x34e230,_0x255217['error']['message']);return _0x4dbc13(_0x255217['error'][_0x77cc('0x16')]);}else{logger['info'](_0x77cc('0x17'),_0x34e230,_0x77cc('0x12'));_0x4dbc13(_0x255217[_0x77cc('0x18')][_0x77cc('0x16')]);}})['catch'](function(_0x2244d1){logger[_0x77cc('0x14')](_0x77cc('0x17'),_0x34e230,_0x2244d1);_0x4592c8(_0x2244d1);});});}exports[_0x77cc('0x19')]=function(_0x3102fb){var _0x24c7b7=this;return new Promise(function(_0x51b2ec,_0x1557a0){return db[_0x77cc('0x1a')][_0x77cc('0x1b')]({'raw':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x1d')]===undefined?!![]:![]:!![],'where':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb['options'][_0x77cc('0x1e')]||null:null,'attributes':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x1f')]||null:null,'limit':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x20')]||null:null,'include':_0x3102fb[_0x77cc('0x1c')]?_0x3102fb['options'][_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x3102fb[_0x77cc('0x1c')][_0x77cc('0x21')],function(_0x10a854){return{'model':db[_0x10a854['model']],'as':_0x10a854['as'],'attributes':_0x10a854[_0x77cc('0x1f')],'include':_0x10a854[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x10a854[_0x77cc('0x21')],function(_0x1f0d0d){return{'model':db[_0x1f0d0d['model']],'as':_0x1f0d0d['as'],'attributes':_0x1f0d0d[_0x77cc('0x1f')],'include':_0x1f0d0d[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x1f0d0d[_0x77cc('0x21')],function(_0x5cf38b){return{'model':db[_0x5cf38b['model']],'as':_0x5cf38b['as'],'attributes':_0x5cf38b[_0x77cc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77cc('0x23')](function(_0x49122b){logger['info']('GetSmsQueue',_0x3102fb);logger[_0x77cc('0x11')](_0x77cc('0x19'),_0x3102fb,JSON[_0x77cc('0x13')](_0x49122b));_0x51b2ec(_0x49122b);})[_0x77cc('0x24')](function(_0x38a40f){logger[_0x77cc('0x14')](_0x77cc('0x19'),_0x38a40f[_0x77cc('0x16')],_0x3102fb);_0x1557a0(_0x24c7b7[_0x77cc('0x14')](0x1f4,_0x38a40f[_0x77cc('0x16')]));});});};exports[_0x77cc('0x25')]=function(_0x21659c){var _0x33f8a9=this;return new Promise(function(_0x440faf,_0x16a8dd){return db['SmsQueue'][_0x77cc('0x26')]({'raw':_0x21659c[_0x77cc('0x1c')]?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x1d')]===undefined?!![]:![]:!![],'where':_0x21659c[_0x77cc('0x1c')]?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x1e')]||null:null,'attributes':_0x21659c[_0x77cc('0x1c')]?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x1f')]||null:null,'include':_0x21659c['options']?_0x21659c[_0x77cc('0x1c')][_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x21659c[_0x77cc('0x1c')][_0x77cc('0x21')],function(_0x1ea2e7){return{'model':db[_0x1ea2e7['model']],'as':_0x1ea2e7['as'],'attributes':_0x1ea2e7[_0x77cc('0x1f')],'include':_0x1ea2e7[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x1ea2e7[_0x77cc('0x21')],function(_0x3e6be4){return{'model':db[_0x3e6be4[_0x77cc('0x27')]],'as':_0x3e6be4['as'],'attributes':_0x3e6be4['attributes'],'include':_0x3e6be4[_0x77cc('0x21')]?_[_0x77cc('0x22')](_0x3e6be4[_0x77cc('0x21')],function(_0x44b6c5){return{'model':db[_0x44b6c5['model']],'as':_0x44b6c5['as'],'attributes':_0x44b6c5['attributes']};}):[]};}):[]};}):[]:[]})[_0x77cc('0x23')](function(_0x8eda97){logger[_0x77cc('0x28')](_0x77cc('0x25'),_0x21659c);logger[_0x77cc('0x11')]('ShowSmsQueue',_0x21659c,JSON[_0x77cc('0x13')](_0x8eda97));_0x440faf(_0x8eda97);})[_0x77cc('0x24')](function(_0xcc8f46){logger[_0x77cc('0x14')]('ShowSmsQueue',_0xcc8f46[_0x77cc('0x16')],_0x21659c);_0x16a8dd(_0x33f8a9[_0x77cc('0x14')](0x1f4,_0xcc8f46[_0x77cc('0x16')]));});});}; \ No newline at end of file +var _0x11d6=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowSmsQueue','SmsQueue','find','then','util','moment','bluebird','randomstring','ioredis'];(function(_0xc8011b,_0x4a604e){var _0x4d43fb=function(_0x476bae){while(--_0x476bae){_0xc8011b['push'](_0xc8011b['shift']());}};_0x4d43fb(++_0x4a604e);}(_0x11d6,0x1db));var _0x611d=function(_0x19fa2a,_0x5dd7bc){_0x19fa2a=_0x19fa2a-0x0;var _0x4ee4fd=_0x11d6[_0x19fa2a];return _0x4ee4fd;};'use strict';var _=require('lodash');var util=require(_0x611d('0x0'));var moment=require(_0x611d('0x1'));var BPromise=require(_0x611d('0x2'));var rs=require(_0x611d('0x3'));var fs=require('fs');var Redis=require(_0x611d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x611d('0x5'));var logger=require(_0x611d('0x6'))(_0x611d('0x7'));var config=require(_0x611d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x611d('0x9')][_0x611d('0xa')]({'port':0x232a});config[_0x611d('0xb')]=_['defaults'](config['redis'],{'host':_0x611d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x611d('0xb')]));require(_0x611d('0xd'))[_0x611d('0xe')](socket);function respondWithRpcPromise(_0x379da9,_0x5f23a0,_0x2e92d6){return new BPromise(function(_0x35234c,_0x54f2c8){return client[_0x611d('0xf')](_0x379da9,_0x2e92d6)['then'](function(_0x2134bd){logger[_0x611d('0x10')](_0x611d('0x11'),_0x5f23a0,_0x611d('0x12'));logger[_0x611d('0x13')](_0x611d('0x14'),_0x5f23a0,_0x611d('0x12'),JSON[_0x611d('0x15')](_0x2134bd));if(_0x2134bd[_0x611d('0x16')]){if(_0x2134bd[_0x611d('0x16')][_0x611d('0x17')]===0x1f4){logger[_0x611d('0x16')](_0x611d('0x11'),_0x5f23a0,_0x2134bd[_0x611d('0x16')]['message']);return _0x54f2c8(_0x2134bd[_0x611d('0x16')][_0x611d('0x18')]);}logger[_0x611d('0x16')]('SmsQueue,\x20%s,\x20%s',_0x5f23a0,_0x2134bd['error'][_0x611d('0x18')]);return _0x35234c(_0x2134bd['error'][_0x611d('0x18')]);}else{logger[_0x611d('0x10')](_0x611d('0x11'),_0x5f23a0,'request\x20sent');_0x35234c(_0x2134bd['result'][_0x611d('0x18')]);}})['catch'](function(_0x5e66aa){logger[_0x611d('0x16')](_0x611d('0x11'),_0x5f23a0,_0x5e66aa);_0x54f2c8(_0x5e66aa);});});}exports[_0x611d('0x19')]=function(_0x1931f2){var _0x1debe7=this;return new Promise(function(_0x1eca06,_0x7365b3){return db['SmsQueue'][_0x611d('0x1a')]({'raw':_0x1931f2[_0x611d('0x1b')]?_0x1931f2['options'][_0x611d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1931f2[_0x611d('0x1b')]?_0x1931f2['options'][_0x611d('0x1d')]||null:null,'attributes':_0x1931f2[_0x611d('0x1b')]?_0x1931f2[_0x611d('0x1b')][_0x611d('0x1e')]||null:null,'limit':_0x1931f2[_0x611d('0x1b')]?_0x1931f2[_0x611d('0x1b')][_0x611d('0x1f')]||null:null,'include':_0x1931f2[_0x611d('0x1b')]?_0x1931f2[_0x611d('0x1b')][_0x611d('0x20')]?_['map'](_0x1931f2[_0x611d('0x1b')][_0x611d('0x20')],function(_0x371d4c){return{'model':db[_0x371d4c[_0x611d('0x21')]],'as':_0x371d4c['as'],'attributes':_0x371d4c[_0x611d('0x1e')],'include':_0x371d4c[_0x611d('0x20')]?_[_0x611d('0x22')](_0x371d4c[_0x611d('0x20')],function(_0x3c3f5f){return{'model':db[_0x3c3f5f['model']],'as':_0x3c3f5f['as'],'attributes':_0x3c3f5f[_0x611d('0x1e')],'include':_0x3c3f5f['include']?_[_0x611d('0x22')](_0x3c3f5f[_0x611d('0x20')],function(_0x242878){return{'model':db[_0x242878[_0x611d('0x21')]],'as':_0x242878['as'],'attributes':_0x242878['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xacfce2){logger[_0x611d('0x10')](_0x611d('0x19'),_0x1931f2);logger[_0x611d('0x13')](_0x611d('0x19'),_0x1931f2,JSON[_0x611d('0x15')](_0xacfce2));_0x1eca06(_0xacfce2);})[_0x611d('0x23')](function(_0xfbc739){logger[_0x611d('0x16')]('GetSmsQueue',_0xfbc739['message'],_0x1931f2);_0x7365b3(_0x1debe7['error'](0x1f4,_0xfbc739[_0x611d('0x18')]));});});};exports[_0x611d('0x24')]=function(_0x2ee65b){var _0x3f9a10=this;return new Promise(function(_0x980bf4,_0x21d7b1){return db[_0x611d('0x25')][_0x611d('0x26')]({'raw':_0x2ee65b['options']?_0x2ee65b[_0x611d('0x1b')][_0x611d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ee65b['options']?_0x2ee65b['options'][_0x611d('0x1d')]||null:null,'attributes':_0x2ee65b[_0x611d('0x1b')]?_0x2ee65b[_0x611d('0x1b')][_0x611d('0x1e')]||null:null,'include':_0x2ee65b['options']?_0x2ee65b[_0x611d('0x1b')][_0x611d('0x20')]?_[_0x611d('0x22')](_0x2ee65b[_0x611d('0x1b')]['include'],function(_0x124cf8){return{'model':db[_0x124cf8[_0x611d('0x21')]],'as':_0x124cf8['as'],'attributes':_0x124cf8[_0x611d('0x1e')],'include':_0x124cf8['include']?_[_0x611d('0x22')](_0x124cf8[_0x611d('0x20')],function(_0x42373a){return{'model':db[_0x42373a[_0x611d('0x21')]],'as':_0x42373a['as'],'attributes':_0x42373a[_0x611d('0x1e')],'include':_0x42373a['include']?_[_0x611d('0x22')](_0x42373a[_0x611d('0x20')],function(_0x4bb99b){return{'model':db[_0x4bb99b[_0x611d('0x21')]],'as':_0x4bb99b['as'],'attributes':_0x4bb99b[_0x611d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x611d('0x27')](function(_0x18e8a6){logger[_0x611d('0x10')](_0x611d('0x24'),_0x2ee65b);logger['debug'](_0x611d('0x24'),_0x2ee65b,JSON[_0x611d('0x15')](_0x18e8a6));_0x980bf4(_0x18e8a6);})[_0x611d('0x23')](function(_0x5c5c5e){logger[_0x611d('0x16')]('ShowSmsQueue',_0x5c5c5e[_0x611d('0x18')],_0x2ee65b);_0x21d7b1(_0x3f9a10[_0x611d('0x16')](0x1f4,_0x5c5c5e[_0x611d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fd4c75c..854e6d3 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 _0x7f93=['smsQueue:','./smsQueue.events','emit','length'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7f93,0xc5));var _0x37f9=function(_0x5e3d05,_0x500ae8){_0x5e3d05=_0x5e3d05-0x0;var _0x4c6cb0=_0x7f93[_0x5e3d05];return _0x4c6cb0;};'use strict';var SmsQueueEvents=require(_0x37f9('0x0'));var events=['save','remove','update'];function createListener(_0x4201e9,_0x1ac073){return function(_0x17650f){_0x1ac073[_0x37f9('0x1')](_0x4201e9,_0x17650f);};}function removeListener(_0x24036e,_0x5afa03){return function(){SmsQueueEvents['removeListener'](_0x24036e,_0x5afa03);};}exports['register']=function(_0x21b5d8){for(var _0x21b4a9=0x0,_0xcfa66b=events[_0x37f9('0x2')];_0x21b4a9<_0xcfa66b;_0x21b4a9++){var _0x612b58=events[_0x21b4a9];var _0xd1b72d=createListener(_0x37f9('0x3')+_0x612b58,_0x21b5d8);SmsQueueEvents['on'](_0x612b58,_0xd1b72d);}}; \ No newline at end of file +var _0x57f1=['save','remove','update','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x15bab4,_0x33eff0){var _0x30433d=function(_0xc91fb9){while(--_0xc91fb9){_0x15bab4['push'](_0x15bab4['shift']());}};_0x30433d(++_0x33eff0);}(_0x57f1,0x1e2));var _0x157f=function(_0xf5a599,_0x485419){_0xf5a599=_0xf5a599-0x0;var _0x5d0919=_0x57f1[_0xf5a599];return _0x5d0919;};'use strict';var SmsQueueEvents=require(_0x157f('0x0'));var events=[_0x157f('0x1'),_0x157f('0x2'),_0x157f('0x3')];function createListener(_0x552d26,_0x397883){return function(_0x16d128){_0x397883['emit'](_0x552d26,_0x16d128);};}function removeListener(_0x220f53,_0x477ea6){return function(){SmsQueueEvents[_0x157f('0x4')](_0x220f53,_0x477ea6);};}exports['register']=function(_0x1d8c7b){for(var _0x2ddc09=0x0,_0x427c43=events[_0x157f('0x5')];_0x2ddc09<_0x427c43;_0x2ddc09++){var _0x5e8543=events[_0x2ddc09];var _0x47d51d=createListener(_0x157f('0x6')+_0x5e8543,_0x1d8c7b);SmsQueueEvents['on'](_0x5e8543,_0x47d51d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 4b66f78..9d4e1e1 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 _0x647c=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0xcd0c63,_0xc0c46f){var _0xa84f9e=function(_0x2ebb32){while(--_0x2ebb32){_0xcd0c63['push'](_0xcd0c63['shift']());}};_0xa84f9e(++_0xc0c46f);}(_0x647c,0x1d3));var _0xc647=function(_0x1425e8,_0x2c195b){_0x1425e8=_0x1425e8-0x0;var _0x1cd239=_0x647c[_0x1425e8];return _0x1cd239;};'use strict';var multer=require(_0xc647('0x0'));var util=require('util');var path=require(_0xc647('0x1'));var timeout=require(_0xc647('0x2'));var express=require('express');var router=express[_0xc647('0x3')]();var fs_extra=require(_0xc647('0x4'));var auth=require(_0xc647('0x5'));var interaction=require(_0xc647('0x6'));var config=require(_0xc647('0x7'));var controller=require('./smsQueueReport.controller');router[_0xc647('0x8')]('/',auth[_0xc647('0x9')](),controller[_0xc647('0xa')]);router[_0xc647('0x8')](_0xc647('0xb'),auth[_0xc647('0x9')](),controller['describe']);router['get'](_0xc647('0xc'),auth[_0xc647('0x9')](),controller[_0xc647('0xd')]);router['post']('/',auth[_0xc647('0x9')](),controller[_0xc647('0xe')]);router[_0xc647('0xf')](_0xc647('0xc'),auth[_0xc647('0x9')](),controller[_0xc647('0x10')]);router[_0xc647('0x11')]('/:id',auth[_0xc647('0x9')](),controller[_0xc647('0x12')]);module[_0xc647('0x13')]=router; \ No newline at end of file +var _0x07cf=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x07cf,0xea));var _0xf07c=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x07cf[_0x3825a8];return _0xabc9bc;};'use strict';var multer=require(_0xf07c('0x0'));var util=require(_0xf07c('0x1'));var path=require('path');var timeout=require(_0xf07c('0x2'));var express=require(_0xf07c('0x3'));var router=express[_0xf07c('0x4')]();var fs_extra=require(_0xf07c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf07c('0x6'));var config=require(_0xf07c('0x7'));var controller=require(_0xf07c('0x8'));router[_0xf07c('0x9')]('/',auth[_0xf07c('0xa')](),controller['index']);router['get'](_0xf07c('0xb'),auth[_0xf07c('0xa')](),controller['describe']);router[_0xf07c('0x9')](_0xf07c('0xc'),auth[_0xf07c('0xa')](),controller[_0xf07c('0xd')]);router[_0xf07c('0xe')]('/',auth['isAuthenticated'](),controller[_0xf07c('0xf')]);router[_0xf07c('0x10')](_0xf07c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf07c('0x11')]('/:id',auth[_0xf07c('0xa')](),controller[_0xf07c('0x12')]);module[_0xf07c('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e058142..4655e86 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 _0xc180=['sequelize','exports','DATE','STRING','moment'];(function(_0x5a6c73,_0x4dfa7e){var _0x2dbe53=function(_0x1a8a9f){while(--_0x1a8a9f){_0x5a6c73['push'](_0x5a6c73['shift']());}};_0x2dbe53(++_0x4dfa7e);}(_0xc180,0x185));var _0x0c18=function(_0x2824be,_0x837356){_0x2824be=_0x2824be-0x0;var _0x160907=_0xc180[_0x2824be];return _0x160907;};'use strict';var moment=require(_0x0c18('0x0'));var Sequelize=require(_0x0c18('0x1'));module[_0x0c18('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0c18('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0c18('0x3')]},'exitAt':{'type':Sequelize[_0x0c18('0x3')]},'reason':{'type':Sequelize[_0x0c18('0x4')]}}; \ No newline at end of file +var _0xc42d=['DATE','moment','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc42d,0x1dc));var _0xdc42=function(_0x2f3815,_0x258cc3){_0x2f3815=_0x2f3815-0x0;var _0x4ffcd6=_0xc42d[_0x2f3815];return _0x4ffcd6;};'use strict';var moment=require(_0xdc42('0x0'));var Sequelize=require(_0xdc42('0x1'));module[_0xdc42('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdc42('0x3')]},'joinAt':{'type':Sequelize[_0xdc42('0x4')]},'leaveAt':{'type':Sequelize[_0xdc42('0x4')]},'acceptAt':{'type':Sequelize[_0xdc42('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdc42('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index f2c3867..50bd940 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 _0x3e4d=['order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','api','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','index','map','SmsQueueReport','type','key','name','query','filters','model','attributes','intersection','fields','length','nolimit'];(function(_0x4b1ee5,_0x138045){var _0x108717=function(_0x151d38){while(--_0x151d38){_0x4b1ee5['push'](_0x4b1ee5['shift']());}};_0x108717(++_0x138045);}(_0x3e4d,0x1a0));var _0xd3e4=function(_0x10a984,_0x12936b){_0x10a984=_0x10a984-0x0;var _0x3f9c0a=_0x3e4d[_0x10a984];return _0x3f9c0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd3e4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3e4('0x1'));var rp=require('request-promise');var moment=require(_0xd3e4('0x2'));var BPromise=require(_0xd3e4('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd3e4('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd3e4('0x5'));var fs=require('fs');var fs_extra=require(_0xd3e4('0x6'));var _=require(_0xd3e4('0x7'));var squel=require(_0xd3e4('0x8'));var crypto=require('crypto');var jsforce=require(_0xd3e4('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xd3e4('0xa'));var querystring=require(_0xd3e4('0xb'));var Papa=require(_0xd3e4('0xc'));var Redis=require(_0xd3e4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd3e4('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd3e4('0xf'))['db'];function respondWithStatusCode(_0x3b4bf1,_0x550558){_0x550558=_0x550558||0xcc;return function(_0x16ed1d){if(_0x16ed1d){return _0x3b4bf1[_0xd3e4('0x10')](_0x550558);}return _0x3b4bf1['status'](_0x550558)[_0xd3e4('0x11')]();};}function respondWithResult(_0x28135f,_0x1c1f97){_0x1c1f97=_0x1c1f97||0xc8;return function(_0x208ab2){if(_0x208ab2){return _0x28135f[_0xd3e4('0x12')](_0x1c1f97)[_0xd3e4('0x13')](_0x208ab2);}};}function respondWithFilteredResult(_0x54c155,_0x892c6){return function(_0x43ed36){if(_0x43ed36){var _0x1b8fbd=typeof _0x892c6[_0xd3e4('0x14')]===_0xd3e4('0x15')&&typeof _0x892c6['limit']===_0xd3e4('0x15');var _0x3c3bcc=_0x43ed36[_0xd3e4('0x16')];var _0x3e4305=_0x1b8fbd?0x0:_0x892c6[_0xd3e4('0x14')];var _0x23e2ed=_0x1b8fbd?_0x43ed36[_0xd3e4('0x16')]:_0x892c6[_0xd3e4('0x14')]+_0x892c6[_0xd3e4('0x17')];var _0x164c6d;if(_0x23e2ed>=_0x3c3bcc){_0x23e2ed=_0x3c3bcc;_0x164c6d=0xc8;}else{_0x164c6d=0xce;}_0x54c155[_0xd3e4('0x12')](_0x164c6d);return _0x54c155[_0xd3e4('0x18')]('Content-Range',_0x3e4305+'-'+_0x23e2ed+'/'+_0x3c3bcc)[_0xd3e4('0x13')](_0x43ed36);}return null;};}function patchUpdates(_0x35a809){return function(_0x2b9a75){try{jsonpatch[_0xd3e4('0x19')](_0x2b9a75,_0x35a809,!![]);}catch(_0x4d657e){return BPromise[_0xd3e4('0x1a')](_0x4d657e);}return _0x2b9a75[_0xd3e4('0x1b')]();};}function saveUpdates(_0xbfd7f6,_0x45eca6){return function(_0x2a0fc4){if(_0x2a0fc4){return _0x2a0fc4[_0xd3e4('0x1c')](_0xbfd7f6)[_0xd3e4('0x1d')](function(_0xf64abf){return _0xf64abf;});}return null;};}function removeEntity(_0x23a575,_0x33fa9a){return function(_0x216058){if(_0x216058){return _0x216058['destroy']()[_0xd3e4('0x1d')](function(){_0x23a575[_0xd3e4('0x12')](0xcc)[_0xd3e4('0x11')]();});}};}function handleEntityNotFound(_0x3491d5,_0x2211f0){return function(_0x2892d3){if(!_0x2892d3){_0x3491d5['sendStatus'](0x194);}return _0x2892d3;};}function handleError(_0x938241,_0x14b915){_0x14b915=_0x14b915||0x1f4;return function(_0x49b602){logger[_0xd3e4('0x1e')](_0x49b602[_0xd3e4('0x1f')]);if(_0x49b602['name']){delete _0x49b602['name'];}_0x938241[_0xd3e4('0x12')](_0x14b915)['send'](_0x49b602);};}exports[_0xd3e4('0x20')]=function(_0x3efb63,_0x59d7ff){var _0x1733ae={},_0x44c29a={},_0x26c0c9={'count':0x0,'rows':[]};var _0xc90e5d=_[_0xd3e4('0x21')](db[_0xd3e4('0x22')]['rawAttributes'],function(_0x83ac90){return{'name':_0x83ac90['fieldName'],'type':_0x83ac90[_0xd3e4('0x23')][_0xd3e4('0x24')]};});_0x44c29a['model']=_[_0xd3e4('0x21')](_0xc90e5d,_0xd3e4('0x25'));_0x44c29a[_0xd3e4('0x26')]=_['keys'](_0x3efb63[_0xd3e4('0x26')]);_0x44c29a[_0xd3e4('0x27')]=_['intersection'](_0x44c29a[_0xd3e4('0x28')],_0x44c29a['query']);_0x1733ae[_0xd3e4('0x29')]=_[_0xd3e4('0x2a')](_0x44c29a['model'],qs[_0xd3e4('0x2b')](_0x3efb63[_0xd3e4('0x26')][_0xd3e4('0x2b')]));_0x1733ae['attributes']=_0x1733ae[_0xd3e4('0x29')][_0xd3e4('0x2c')]?_0x1733ae[_0xd3e4('0x29')]:_0x44c29a[_0xd3e4('0x28')];if(!_0x3efb63['query']['hasOwnProperty'](_0xd3e4('0x2d'))){_0x1733ae[_0xd3e4('0x17')]=qs[_0xd3e4('0x17')](_0x3efb63[_0xd3e4('0x26')]['limit']);_0x1733ae[_0xd3e4('0x14')]=qs[_0xd3e4('0x14')](_0x3efb63[_0xd3e4('0x26')]['offset']);}_0x1733ae[_0xd3e4('0x2e')]=qs[_0xd3e4('0x2f')](_0x3efb63[_0xd3e4('0x26')][_0xd3e4('0x2f')]);_0x1733ae[_0xd3e4('0x30')]=qs[_0xd3e4('0x27')](_[_0xd3e4('0x31')](_0x3efb63['query'],_0x44c29a['filters']),_0xc90e5d);if(_0x3efb63[_0xd3e4('0x26')][_0xd3e4('0x32')]){_0x1733ae[_0xd3e4('0x30')]=_['merge'](_0x1733ae['where'],{'$or':_[_0xd3e4('0x21')](_0xc90e5d,function(_0xc7707d){if(_0xc7707d[_0xd3e4('0x23')]!==_0xd3e4('0x33')){var _0x583918={};_0x583918[_0xc7707d[_0xd3e4('0x25')]]={'$like':'%'+_0x3efb63['query'][_0xd3e4('0x32')]+'%'};return _0x583918;}})});}_0x1733ae=_[_0xd3e4('0x34')]({},_0x1733ae,_0x3efb63[_0xd3e4('0x35')]);var _0x5f3117={'where':_0x1733ae['where']};return db[_0xd3e4('0x22')][_0xd3e4('0x16')](_0x5f3117)[_0xd3e4('0x1d')](function(_0x266f71){_0x26c0c9[_0xd3e4('0x16')]=_0x266f71;if(_0x3efb63[_0xd3e4('0x26')]['includeAll']){_0x1733ae['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xd3e4('0x36')](_0x1733ae);})['then'](function(_0x4d36bf){_0x26c0c9['rows']=_0x4d36bf;return _0x26c0c9;})['then'](respondWithFilteredResult(_0x59d7ff,_0x1733ae))[_0xd3e4('0x37')](handleError(_0x59d7ff,null));};exports[_0xd3e4('0x38')]=function(_0x23dba4,_0x4a04a9){var _0xbb0339={'raw':!![],'where':{'id':_0x23dba4[_0xd3e4('0x39')]['id']}},_0x5637fa={};_0x5637fa['model']=_[_0xd3e4('0x3a')](db[_0xd3e4('0x22')]['rawAttributes']);_0x5637fa[_0xd3e4('0x26')]=_[_0xd3e4('0x3a')](_0x23dba4[_0xd3e4('0x26')]);_0x5637fa[_0xd3e4('0x27')]=_[_0xd3e4('0x2a')](_0x5637fa[_0xd3e4('0x28')],_0x5637fa['query']);_0xbb0339['attributes']=_['intersection'](_0x5637fa['model'],qs[_0xd3e4('0x2b')](_0x23dba4[_0xd3e4('0x26')][_0xd3e4('0x2b')]));_0xbb0339[_0xd3e4('0x29')]=_0xbb0339[_0xd3e4('0x29')]['length']?_0xbb0339[_0xd3e4('0x29')]:_0x5637fa[_0xd3e4('0x28')];if(_0x23dba4[_0xd3e4('0x26')][_0xd3e4('0x3b')]){_0xbb0339[_0xd3e4('0x3c')]=[{'all':!![]}];}_0xbb0339=_['merge']({},_0xbb0339,_0x23dba4['options']);return db[_0xd3e4('0x22')][_0xd3e4('0x3d')](_0xbb0339)['then'](handleEntityNotFound(_0x4a04a9,null))['then'](respondWithResult(_0x4a04a9,null))[_0xd3e4('0x37')](handleError(_0x4a04a9,null));};exports[_0xd3e4('0x3e')]=function(_0x2b61ac,_0x49c70e){return db[_0xd3e4('0x22')][_0xd3e4('0x3e')](_0x2b61ac[_0xd3e4('0x3f')],{})[_0xd3e4('0x1d')](respondWithResult(_0x49c70e,0xc9))['catch'](handleError(_0x49c70e,null));};exports['update']=function(_0x12b328,_0xa3127){if(_0x12b328[_0xd3e4('0x3f')]['id']){delete _0x12b328[_0xd3e4('0x3f')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x12b328[_0xd3e4('0x39')]['id']}})[_0xd3e4('0x1d')](handleEntityNotFound(_0xa3127,null))['then'](saveUpdates(_0x12b328[_0xd3e4('0x3f')],null))[_0xd3e4('0x1d')](respondWithResult(_0xa3127,null))[_0xd3e4('0x37')](handleError(_0xa3127,null));};exports[_0xd3e4('0x40')]=function(_0x129f60,_0x1819aa){return db[_0xd3e4('0x22')]['find']({'where':{'id':_0x129f60[_0xd3e4('0x39')]['id']}})[_0xd3e4('0x1d')](handleEntityNotFound(_0x1819aa,null))['then'](removeEntity(_0x1819aa,null))[_0xd3e4('0x37')](handleError(_0x1819aa,null));};exports[_0xd3e4('0x41')]=function(_0x596642,_0x30ba9e){return db[_0xd3e4('0x22')]['describe']()[_0xd3e4('0x1d')](respondWithResult(_0x30ba9e,null))[_0xd3e4('0x37')](handleError(_0x30ba9e,null));}; \ No newline at end of file +var _0x098f=['pick','filters','filter','where','merge','options','SmsQueueReport','then','includeAll','include','findAll','rows','catch','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2b88c3,_0x3d8770){var _0xa71d96=function(_0x2272fa){while(--_0x2272fa){_0x2b88c3['push'](_0x2b88c3['shift']());}};_0xa71d96(++_0x3d8770);}(_0x098f,0xe9));var _0xf098=function(_0x1a90da,_0x26b498){_0x1a90da=_0x1a90da-0x0;var _0x575b94=_0x098f[_0x1a90da];return _0x575b94;};'use strict';var emlformat=require(_0xf098('0x0'));var rimraf=require(_0xf098('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf098('0x2'));var moment=require(_0xf098('0x3'));var BPromise=require(_0xf098('0x4'));var Mustache=require(_0xf098('0x5'));var util=require(_0xf098('0x6'));var path=require(_0xf098('0x7'));var sox=require(_0xf098('0x8'));var csv=require(_0xf098('0x9'));var ejs=require(_0xf098('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf098('0xb'));var squel=require(_0xf098('0xc'));var crypto=require(_0xf098('0xd'));var jsforce=require(_0xf098('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf098('0x9'));var querystring=require(_0xf098('0xf'));var Papa=require(_0xf098('0x10'));var Redis=require(_0xf098('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf098('0x12'));var hardwareService=require(_0xf098('0x13'));var logger=require(_0xf098('0x14'))(_0xf098('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf098('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x348666,_0x216348){_0x216348=_0x216348||0xcc;return function(_0x2ab144){if(_0x2ab144){return _0x348666['sendStatus'](_0x216348);}return _0x348666[_0xf098('0x17')](_0x216348)[_0xf098('0x18')]();};}function respondWithResult(_0x432ef6,_0x2b2174){_0x2b2174=_0x2b2174||0xc8;return function(_0x40b335){if(_0x40b335){return _0x432ef6['status'](_0x2b2174)[_0xf098('0x19')](_0x40b335);}};}function respondWithFilteredResult(_0x1fdefc,_0x4a7e68){return function(_0x3dd18f){if(_0x3dd18f){var _0x288d32=typeof _0x4a7e68[_0xf098('0x1a')]===_0xf098('0x1b')&&typeof _0x4a7e68[_0xf098('0x1c')]==='undefined';var _0x1b7183=_0x3dd18f[_0xf098('0x1d')];var _0x146d41=_0x288d32?0x0:_0x4a7e68['offset'];var _0x3b7152=_0x288d32?_0x3dd18f[_0xf098('0x1d')]:_0x4a7e68[_0xf098('0x1a')]+_0x4a7e68[_0xf098('0x1c')];var _0x36ccc7;if(_0x3b7152>=_0x1b7183){_0x3b7152=_0x1b7183;_0x36ccc7=0xc8;}else{_0x36ccc7=0xce;}_0x1fdefc['status'](_0x36ccc7);return _0x1fdefc['set'](_0xf098('0x1e'),_0x146d41+'-'+_0x3b7152+'/'+_0x1b7183)[_0xf098('0x19')](_0x3dd18f);}return null;};}function patchUpdates(_0x1d28c4){return function(_0xfe96f7){try{jsonpatch[_0xf098('0x1f')](_0xfe96f7,_0x1d28c4,!![]);}catch(_0x88fdda){return BPromise['reject'](_0x88fdda);}return _0xfe96f7[_0xf098('0x20')]();};}function saveUpdates(_0x3da0c6,_0x1819db){return function(_0x352c16){if(_0x352c16){return _0x352c16[_0xf098('0x21')](_0x3da0c6)['then'](function(_0x12e1d8){return _0x12e1d8;});}return null;};}function removeEntity(_0x154af1,_0x1434f7){return function(_0x13a5dd){if(_0x13a5dd){return _0x13a5dd[_0xf098('0x22')]()['then'](function(){_0x154af1[_0xf098('0x17')](0xcc)[_0xf098('0x18')]();});}};}function handleEntityNotFound(_0x1c06e3,_0x59edd3){return function(_0xd50158){if(!_0xd50158){_0x1c06e3['sendStatus'](0x194);}return _0xd50158;};}function handleError(_0x4c0d20,_0xe97acd){_0xe97acd=_0xe97acd||0x1f4;return function(_0x5518c9){logger[_0xf098('0x23')](_0x5518c9['stack']);if(_0x5518c9[_0xf098('0x24')]){delete _0x5518c9[_0xf098('0x24')];}_0x4c0d20[_0xf098('0x17')](_0xe97acd)[_0xf098('0x25')](_0x5518c9);};}exports[_0xf098('0x26')]=function(_0x25a374,_0x42f08e){var _0x5626f8={},_0x13a00e={},_0x10ac0f={'count':0x0,'rows':[]};var _0x235883=_[_0xf098('0x27')](db['SmsQueueReport'][_0xf098('0x28')],function(_0x293612){return{'name':_0x293612[_0xf098('0x29')],'type':_0x293612[_0xf098('0x2a')][_0xf098('0x2b')]};});_0x13a00e['model']=_[_0xf098('0x27')](_0x235883,_0xf098('0x24'));_0x13a00e[_0xf098('0x2c')]=_[_0xf098('0x2d')](_0x25a374['query']);_0x13a00e['filters']=_[_0xf098('0x2e')](_0x13a00e[_0xf098('0x2f')],_0x13a00e['query']);_0x5626f8[_0xf098('0x30')]=_[_0xf098('0x2e')](_0x13a00e[_0xf098('0x2f')],qs[_0xf098('0x31')](_0x25a374[_0xf098('0x2c')][_0xf098('0x31')]));_0x5626f8[_0xf098('0x30')]=_0x5626f8[_0xf098('0x30')][_0xf098('0x32')]?_0x5626f8[_0xf098('0x30')]:_0x13a00e['model'];if(!_0x25a374[_0xf098('0x2c')][_0xf098('0x33')](_0xf098('0x34'))){_0x5626f8[_0xf098('0x1c')]=qs['limit'](_0x25a374[_0xf098('0x2c')][_0xf098('0x1c')]);_0x5626f8[_0xf098('0x1a')]=qs[_0xf098('0x1a')](_0x25a374[_0xf098('0x2c')][_0xf098('0x1a')]);}_0x5626f8[_0xf098('0x35')]=qs[_0xf098('0x36')](_0x25a374[_0xf098('0x2c')]['sort']);_0x5626f8['where']=qs['filters'](_[_0xf098('0x37')](_0x25a374[_0xf098('0x2c')],_0x13a00e[_0xf098('0x38')]),_0x235883);if(_0x25a374[_0xf098('0x2c')][_0xf098('0x39')]){_0x5626f8[_0xf098('0x3a')]=_[_0xf098('0x3b')](_0x5626f8[_0xf098('0x3a')],{'$or':_['map'](_0x235883,function(_0x66ecb3){if(_0x66ecb3[_0xf098('0x2a')]!=='VIRTUAL'){var _0x4e3a8f={};_0x4e3a8f[_0x66ecb3[_0xf098('0x24')]]={'$like':'%'+_0x25a374[_0xf098('0x2c')][_0xf098('0x39')]+'%'};return _0x4e3a8f;}})});}_0x5626f8=_[_0xf098('0x3b')]({},_0x5626f8,_0x25a374[_0xf098('0x3c')]);var _0x177588={'where':_0x5626f8[_0xf098('0x3a')]};return db[_0xf098('0x3d')]['count'](_0x177588)[_0xf098('0x3e')](function(_0x279783){_0x10ac0f[_0xf098('0x1d')]=_0x279783;if(_0x25a374['query'][_0xf098('0x3f')]){_0x5626f8[_0xf098('0x40')]=[{'all':!![]}];}return db[_0xf098('0x3d')][_0xf098('0x41')](_0x5626f8);})[_0xf098('0x3e')](function(_0x28b238){_0x10ac0f[_0xf098('0x42')]=_0x28b238;return _0x10ac0f;})[_0xf098('0x3e')](respondWithFilteredResult(_0x42f08e,_0x5626f8))[_0xf098('0x43')](handleError(_0x42f08e,null));};exports['show']=function(_0x231c28,_0x28e40b){var _0x2dba7f={'raw':!![],'where':{'id':_0x231c28['params']['id']}},_0x1c0501={};_0x1c0501[_0xf098('0x2f')]=_[_0xf098('0x2d')](db[_0xf098('0x3d')][_0xf098('0x28')]);_0x1c0501[_0xf098('0x2c')]=_[_0xf098('0x2d')](_0x231c28[_0xf098('0x2c')]);_0x1c0501[_0xf098('0x38')]=_[_0xf098('0x2e')](_0x1c0501[_0xf098('0x2f')],_0x1c0501[_0xf098('0x2c')]);_0x2dba7f['attributes']=_['intersection'](_0x1c0501[_0xf098('0x2f')],qs['fields'](_0x231c28[_0xf098('0x2c')][_0xf098('0x31')]));_0x2dba7f[_0xf098('0x30')]=_0x2dba7f[_0xf098('0x30')][_0xf098('0x32')]?_0x2dba7f[_0xf098('0x30')]:_0x1c0501[_0xf098('0x2f')];if(_0x231c28[_0xf098('0x2c')][_0xf098('0x3f')]){_0x2dba7f[_0xf098('0x40')]=[{'all':!![]}];}_0x2dba7f=_[_0xf098('0x3b')]({},_0x2dba7f,_0x231c28['options']);return db[_0xf098('0x3d')][_0xf098('0x44')](_0x2dba7f)['then'](handleEntityNotFound(_0x28e40b,null))[_0xf098('0x3e')](respondWithResult(_0x28e40b,null))['catch'](handleError(_0x28e40b,null));};exports['create']=function(_0x1bb107,_0x1f57fd){return db['SmsQueueReport'][_0xf098('0x45')](_0x1bb107[_0xf098('0x46')],{})[_0xf098('0x3e')](respondWithResult(_0x1f57fd,0xc9))[_0xf098('0x43')](handleError(_0x1f57fd,null));};exports[_0xf098('0x21')]=function(_0x457be4,_0x1ccc1c){if(_0x457be4[_0xf098('0x46')]['id']){delete _0x457be4[_0xf098('0x46')]['id'];}return db['SmsQueueReport'][_0xf098('0x44')]({'where':{'id':_0x457be4['params']['id']}})[_0xf098('0x3e')](handleEntityNotFound(_0x1ccc1c,null))['then'](saveUpdates(_0x457be4[_0xf098('0x46')],null))[_0xf098('0x3e')](respondWithResult(_0x1ccc1c,null))['catch'](handleError(_0x1ccc1c,null));};exports[_0xf098('0x22')]=function(_0x9002d,_0x383c4b){return db[_0xf098('0x3d')][_0xf098('0x44')]({'where':{'id':_0x9002d['params']['id']}})[_0xf098('0x3e')](handleEntityNotFound(_0x383c4b,null))[_0xf098('0x3e')](removeEntity(_0x383c4b,null))[_0xf098('0x43')](handleError(_0x383c4b,null));};exports[_0xf098('0x47')]=function(_0x336ac0,_0x1ad275){return db[_0xf098('0x3d')]['describe']()[_0xf098('0x3e')](respondWithResult(_0x1ad275,null))[_0xf098('0x43')](handleError(_0x1ad275,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index c7897cb..a6339b3 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f19d1,_0x7158d1){var _0x5bb56a=function(_0xe025ba){while(--_0xe025ba){_0x4f19d1['push'](_0x4f19d1['shift']());}};_0x5bb56a(++_0x7158d1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x1badc1,_0x19fd91){var _0x37e23d=function(_0x2a4983){while(--_0x2a4983){_0x1badc1['push'](_0x1badc1['shift']());}};_0x37e23d(++_0x19fd91);}(_0xe706,0xa3));var _0x6e70=function(_0x53a382,_0x21cfcf){_0x53a382=_0x53a382-0x0;var _0x150aca=_0xe706[_0x53a382];return _0x150aca;};'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 d2c2502..1b08325 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 _0x4bff=['code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','then','UpdateSmsQueueReport','body','options','raw','where','attributes','limit','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4bff,0xe0));var _0xf4bf=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4bff[_0x1203f];return _0x365f0a;};'use strict';var _=require('lodash');var util=require(_0xf4bf('0x0'));var moment=require(_0xf4bf('0x1'));var BPromise=require(_0xf4bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4bf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4bf('0x4'))(_0xf4bf('0x5'));var config=require(_0xf4bf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf4bf('0x7')][_0xf4bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49a777,_0x56a250,_0x5bf0f6){return new BPromise(function(_0x2e3e03,_0x3f9c39){return client['request'](_0x49a777,_0x5bf0f6)['then'](function(_0x2b3cca){logger[_0xf4bf('0x9')](_0xf4bf('0xa'),_0x56a250,_0xf4bf('0xb'));logger[_0xf4bf('0xc')](_0xf4bf('0xd'),_0x56a250,_0xf4bf('0xb'),JSON[_0xf4bf('0xe')](_0x2b3cca));if(_0x2b3cca[_0xf4bf('0xf')]){if(_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x10')]===0x1f4){logger[_0xf4bf('0xf')](_0xf4bf('0xa'),_0x56a250,_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x11')]);return _0x3f9c39(_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x11')]);}logger[_0xf4bf('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x56a250,_0x2b3cca[_0xf4bf('0xf')][_0xf4bf('0x11')]);return _0x2e3e03(_0x2b3cca['error'][_0xf4bf('0x11')]);}else{logger[_0xf4bf('0x9')](_0xf4bf('0xa'),_0x56a250,_0xf4bf('0xb'));_0x2e3e03(_0x2b3cca['result']['message']);}})[_0xf4bf('0x12')](function(_0x2409b4){logger[_0xf4bf('0xf')](_0xf4bf('0xa'),_0x56a250,_0x2409b4);_0x3f9c39(_0x2409b4);});});}exports[_0xf4bf('0x13')]=function(_0x5c47c5){var _0x3faf99=this;return new Promise(function(_0x43712f,_0x5da858){return db[_0xf4bf('0x14')][_0xf4bf('0x15')](_0x5c47c5['body'],{'raw':_0x5c47c5['options']?_0x5c47c5['options']['raw']===undefined?!![]:![]:!![]})[_0xf4bf('0x16')](function(_0x1c523f){logger['info'](_0xf4bf('0x13'),_0x5c47c5);logger[_0xf4bf('0xc')](_0xf4bf('0x13'),_0x5c47c5,JSON[_0xf4bf('0xe')](_0x1c523f));_0x43712f(_0x1c523f);})[_0xf4bf('0x12')](function(_0x1d552f){logger[_0xf4bf('0xf')]('CreateSmsQueueReport',_0x1d552f[_0xf4bf('0x11')],_0x5c47c5);_0x5da858(_0x3faf99['error'](0x1f4,_0x1d552f[_0xf4bf('0x11')]));});});};exports[_0xf4bf('0x17')]=function(_0x1ae20f){var _0x149ba5=this;return new Promise(function(_0x2b9cda,_0x75d19f){return db[_0xf4bf('0x14')]['update'](_0x1ae20f[_0xf4bf('0x18')],{'raw':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1b')]||null:null,'attributes':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1c')]||null:null,'limit':_0x1ae20f[_0xf4bf('0x19')]?_0x1ae20f[_0xf4bf('0x19')][_0xf4bf('0x1d')]||null:null})['then'](function(_0x15b42f){logger[_0xf4bf('0x9')](_0xf4bf('0x17'),_0x1ae20f);logger[_0xf4bf('0xc')]('UpdateSmsQueueReport',_0x1ae20f,JSON[_0xf4bf('0xe')](_0x15b42f));_0x2b9cda(_0x15b42f);})[_0xf4bf('0x12')](function(_0x1838a0){logger[_0xf4bf('0xf')]('UpdateSmsQueueReport',_0x1838a0[_0xf4bf('0x11')],_0x1ae20f);_0x75d19f(_0x149ba5[_0xf4bf('0xf')](0x1f4,_0x1838a0[_0xf4bf('0x11')]));});});}; \ No newline at end of file +var _0x4deb=['catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x2ea818,_0xd67551){var _0x370338=function(_0x5c02c4){while(--_0x5c02c4){_0x2ea818['push'](_0x2ea818['shift']());}};_0x370338(++_0xd67551);}(_0x4deb,0xaa));var _0xb4de=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0x4deb[_0xcd49bd];return _0xb6ee44;};'use strict';var _=require(_0xb4de('0x0'));var util=require(_0xb4de('0x1'));var moment=require(_0xb4de('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4de('0x3'));var fs=require('fs');var Redis=require(_0xb4de('0x4'));var db=require(_0xb4de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4de('0x6'))(_0xb4de('0x7'));var config=require(_0xb4de('0x8'));var jayson=require(_0xb4de('0x9'));var client=jayson[_0xb4de('0xa')][_0xb4de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x453eeb,_0x451668,_0x5b0cfd){return new BPromise(function(_0x36107b,_0x140282){return client[_0xb4de('0xc')](_0x453eeb,_0x5b0cfd)[_0xb4de('0xd')](function(_0x4a62b8){logger[_0xb4de('0xe')](_0xb4de('0xf'),_0x451668,_0xb4de('0x10'));logger[_0xb4de('0x11')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x451668,_0xb4de('0x10'),JSON['stringify'](_0x4a62b8));if(_0x4a62b8[_0xb4de('0x12')]){if(_0x4a62b8['error'][_0xb4de('0x13')]===0x1f4){logger[_0xb4de('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x451668,_0x4a62b8[_0xb4de('0x12')][_0xb4de('0x14')]);return _0x140282(_0x4a62b8[_0xb4de('0x12')][_0xb4de('0x14')]);}logger[_0xb4de('0x12')](_0xb4de('0xf'),_0x451668,_0x4a62b8['error']['message']);return _0x36107b(_0x4a62b8[_0xb4de('0x12')]['message']);}else{logger[_0xb4de('0xe')](_0xb4de('0xf'),_0x451668,_0xb4de('0x10'));_0x36107b(_0x4a62b8[_0xb4de('0x15')]['message']);}})[_0xb4de('0x16')](function(_0x50581c){logger['error'](_0xb4de('0xf'),_0x451668,_0x50581c);_0x140282(_0x50581c);});});}exports[_0xb4de('0x17')]=function(_0x219c56){var _0x3f8297=this;return new Promise(function(_0x4deaf2,_0x4d21b3){return db[_0xb4de('0x18')][_0xb4de('0x19')](_0x219c56[_0xb4de('0x1a')],{'raw':_0x219c56[_0xb4de('0x1b')]?_0x219c56['options'][_0xb4de('0x1c')]===undefined?!![]:![]:!![]})[_0xb4de('0xd')](function(_0x2e852b){logger['info']('CreateSmsQueueReport',_0x219c56);logger['debug']('CreateSmsQueueReport',_0x219c56,JSON['stringify'](_0x2e852b));_0x4deaf2(_0x2e852b);})[_0xb4de('0x16')](function(_0x104a1e){logger[_0xb4de('0x12')](_0xb4de('0x17'),_0x104a1e[_0xb4de('0x14')],_0x219c56);_0x4d21b3(_0x3f8297[_0xb4de('0x12')](0x1f4,_0x104a1e[_0xb4de('0x14')]));});});};exports[_0xb4de('0x1d')]=function(_0x648aa7){var _0x45947f=this;return new Promise(function(_0x1d8db7,_0x206d5){return db['SmsQueueReport'][_0xb4de('0x1e')](_0x648aa7[_0xb4de('0x1a')],{'raw':_0x648aa7['options']?_0x648aa7[_0xb4de('0x1b')][_0xb4de('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x648aa7[_0xb4de('0x1b')]?_0x648aa7[_0xb4de('0x1b')][_0xb4de('0x1f')]||null:null,'attributes':_0x648aa7[_0xb4de('0x1b')]?_0x648aa7['options']['attributes']||null:null,'limit':_0x648aa7[_0xb4de('0x1b')]?_0x648aa7[_0xb4de('0x1b')]['limit']||null:null})[_0xb4de('0xd')](function(_0x24ad8f){logger['info'](_0xb4de('0x1d'),_0x648aa7);logger[_0xb4de('0x11')](_0xb4de('0x1d'),_0x648aa7,JSON['stringify'](_0x24ad8f));_0x1d8db7(_0x24ad8f);})[_0xb4de('0x16')](function(_0x54749d){logger[_0xb4de('0x12')]('UpdateSmsQueueReport',_0x54749d[_0xb4de('0x14')],_0x648aa7);_0x206d5(_0x45947f[_0xb4de('0x12')](0x1f4,_0x54749d[_0xb4de('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 72ba0fd..0067ac2 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 _0x56e6=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x56e6,0x6b));var _0x656e=function(_0x34233f,_0x2988db){_0x34233f=_0x34233f-0x0;var _0x1f4999=_0x56e6[_0x34233f];return _0x1f4999;};'use strict';var multer=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var path=require(_0x656e('0x2'));var timeout=require(_0x656e('0x3'));var express=require(_0x656e('0x4'));var router=express[_0x656e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x656e('0x6'));var interaction=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var controller=require(_0x656e('0x9'));router[_0x656e('0xa')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0xc')]);router['get'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0xe')]);router[_0x656e('0xa')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x10')]);router[_0x656e('0x11')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0x12')]);router[_0x656e('0x13')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x14')]);router['delete']('/:id',auth[_0x656e('0xb')](),controller[_0x656e('0x15')]);module[_0x656e('0x16')]=router; \ No newline at end of file +var _0x0faf=['./smsTransferReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x522be6,_0x81f173){var _0x3bd60c=function(_0x263372){while(--_0x263372){_0x522be6['push'](_0x522be6['shift']());}};_0x3bd60c(++_0x81f173);}(_0x0faf,0x132));var _0xf0fa=function(_0x26793a,_0x49cf51){_0x26793a=_0x26793a-0x0;var _0x575efb=_0x0faf[_0x26793a];return _0x575efb;};'use strict';var multer=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var timeout=require(_0xf0fa('0x2'));var express=require(_0xf0fa('0x3'));var router=express[_0xf0fa('0x4')]();var fs_extra=require(_0xf0fa('0x5'));var auth=require(_0xf0fa('0x6'));var interaction=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var controller=require(_0xf0fa('0x9'));router['get']('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0xb')]);router[_0xf0fa('0xc')](_0xf0fa('0xd'),auth[_0xf0fa('0xa')](),controller['describe']);router[_0xf0fa('0xc')](_0xf0fa('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xf0fa('0xf')]('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x10')]);router[_0xf0fa('0x11')](_0xf0fa('0xe'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x12')]);router[_0xf0fa('0x13')]('/:id',auth[_0xf0fa('0xa')](),controller['destroy']);module[_0xf0fa('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 9c4a210..8ce6db9 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x9bde,0xe1));var _0xe9bd=function(_0x349897,_0x1fb45d){_0x349897=_0x349897-0x0;var _0x59cd3a=_0x9bde[_0x349897];return _0x59cd3a;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3c61af,_0x207a6c){var _0xcfc52e=function(_0x1083c2){while(--_0x1083c2){_0x3c61af['push'](_0x3c61af['shift']());}};_0xcfc52e(++_0x207a6c);}(_0xaa88,0x137));var _0x8aa8=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0xaa88[_0x1ba43c];return _0x2f60eb;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 903fdfd..84ce722 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 _0xc789=['pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where'];(function(_0x4ffa9d,_0x56c145){var _0x377fd3=function(_0x270769){while(--_0x270769){_0x4ffa9d['push'](_0x4ffa9d['shift']());}};_0x377fd3(++_0x56c145);}(_0xc789,0xe6));var _0x9c78=function(_0x3966f0,_0x2cca42){_0x3966f0=_0x3966f0-0x0;var _0x2f71db=_0xc789[_0x3966f0];return _0x2f71db;};'use strict';var emlformat=require(_0x9c78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c78('0x1'));var jsonpatch=require(_0x9c78('0x2'));var rp=require(_0x9c78('0x3'));var moment=require(_0x9c78('0x4'));var BPromise=require(_0x9c78('0x5'));var Mustache=require(_0x9c78('0x6'));var util=require(_0x9c78('0x7'));var path=require(_0x9c78('0x8'));var sox=require(_0x9c78('0x9'));var csv=require(_0x9c78('0xa'));var ejs=require(_0x9c78('0xb'));var fs=require('fs');var fs_extra=require(_0x9c78('0xc'));var _=require(_0x9c78('0xd'));var squel=require(_0x9c78('0xe'));var crypto=require(_0x9c78('0xf'));var jsforce=require(_0x9c78('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9c78('0xa'));var querystring=require('querystring');var Papa=require(_0x9c78('0x11'));var Redis=require(_0x9c78('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9c78('0x13'));var as=require(_0x9c78('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9c78('0x15'));var utils=require(_0x9c78('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9c78('0x17'));var db=require(_0x9c78('0x18'))['db'];function respondWithStatusCode(_0x1a4378,_0x377a75){_0x377a75=_0x377a75||0xcc;return function(_0x52ab2e){if(_0x52ab2e){return _0x1a4378[_0x9c78('0x19')](_0x377a75);}return _0x1a4378['status'](_0x377a75)[_0x9c78('0x1a')]();};}function respondWithResult(_0x22a37f,_0x37c05b){_0x37c05b=_0x37c05b||0xc8;return function(_0x27f208){if(_0x27f208){return _0x22a37f[_0x9c78('0x1b')](_0x37c05b)[_0x9c78('0x1c')](_0x27f208);}};}function respondWithFilteredResult(_0x23498e,_0x32836b){return function(_0x22b127){if(_0x22b127){var _0x196381=typeof _0x32836b[_0x9c78('0x1d')]==='undefined'&&typeof _0x32836b['limit']===_0x9c78('0x1e');var _0x539993=_0x22b127[_0x9c78('0x1f')];var _0x2a0a5f=_0x196381?0x0:_0x32836b[_0x9c78('0x1d')];var _0x2c0f94=_0x196381?_0x22b127[_0x9c78('0x1f')]:_0x32836b[_0x9c78('0x1d')]+_0x32836b[_0x9c78('0x20')];var _0xca4082;if(_0x2c0f94>=_0x539993){_0x2c0f94=_0x539993;_0xca4082=0xc8;}else{_0xca4082=0xce;}_0x23498e[_0x9c78('0x1b')](_0xca4082);return _0x23498e[_0x9c78('0x21')](_0x9c78('0x22'),_0x2a0a5f+'-'+_0x2c0f94+'/'+_0x539993)[_0x9c78('0x1c')](_0x22b127);}return null;};}function patchUpdates(_0x30c6ce){return function(_0x375057){try{jsonpatch[_0x9c78('0x23')](_0x375057,_0x30c6ce,!![]);}catch(_0x46a8a2){return BPromise['reject'](_0x46a8a2);}return _0x375057[_0x9c78('0x24')]();};}function saveUpdates(_0x2ee7d5,_0x4c92d3){return function(_0x3155df){if(_0x3155df){return _0x3155df['update'](_0x2ee7d5)[_0x9c78('0x25')](function(_0x173e85){return _0x173e85;});}return null;};}function removeEntity(_0xc0cde2,_0x87d0c1){return function(_0x593e54){if(_0x593e54){return _0x593e54['destroy']()[_0x9c78('0x25')](function(){_0xc0cde2[_0x9c78('0x1b')](0xcc)[_0x9c78('0x1a')]();});}};}function handleEntityNotFound(_0x49bdd3,_0x1a23c5){return function(_0x5f531a){if(!_0x5f531a){_0x49bdd3[_0x9c78('0x19')](0x194);}return _0x5f531a;};}function handleError(_0x5f404b,_0x36ef39){_0x36ef39=_0x36ef39||0x1f4;return function(_0x42caa5){logger[_0x9c78('0x26')](_0x42caa5['stack']);if(_0x42caa5['name']){delete _0x42caa5[_0x9c78('0x27')];}_0x5f404b[_0x9c78('0x1b')](_0x36ef39)[_0x9c78('0x28')](_0x42caa5);};}exports['index']=function(_0x375118,_0x30f4d8){var _0x387df6={},_0x463808={},_0x20ff0c={'count':0x0,'rows':[]};var _0x1d51d4=_[_0x9c78('0x29')](db[_0x9c78('0x2a')][_0x9c78('0x2b')],function(_0x49e8ff){return{'name':_0x49e8ff[_0x9c78('0x2c')],'type':_0x49e8ff[_0x9c78('0x2d')][_0x9c78('0x2e')]};});_0x463808[_0x9c78('0x2f')]=_['map'](_0x1d51d4,'name');_0x463808[_0x9c78('0x30')]=_[_0x9c78('0x31')](_0x375118[_0x9c78('0x30')]);_0x463808[_0x9c78('0x32')]=_[_0x9c78('0x33')](_0x463808[_0x9c78('0x2f')],_0x463808['query']);_0x387df6[_0x9c78('0x34')]=_['intersection'](_0x463808[_0x9c78('0x2f')],qs[_0x9c78('0x35')](_0x375118[_0x9c78('0x30')][_0x9c78('0x35')]));_0x387df6[_0x9c78('0x34')]=_0x387df6[_0x9c78('0x34')][_0x9c78('0x36')]?_0x387df6[_0x9c78('0x34')]:_0x463808['model'];if(!_0x375118[_0x9c78('0x30')][_0x9c78('0x37')]('nolimit')){_0x387df6[_0x9c78('0x20')]=qs[_0x9c78('0x20')](_0x375118['query'][_0x9c78('0x20')]);_0x387df6['offset']=qs[_0x9c78('0x1d')](_0x375118[_0x9c78('0x30')][_0x9c78('0x1d')]);}_0x387df6['order']=qs[_0x9c78('0x38')](_0x375118[_0x9c78('0x30')][_0x9c78('0x38')]);_0x387df6[_0x9c78('0x39')]=qs[_0x9c78('0x32')](_[_0x9c78('0x3a')](_0x375118['query'],_0x463808[_0x9c78('0x32')]),_0x1d51d4);if(_0x375118['query']['filter']){_0x387df6[_0x9c78('0x39')]=_['merge'](_0x387df6[_0x9c78('0x39')],{'$or':_['map'](_0x1d51d4,function(_0x421e40){if(_0x421e40[_0x9c78('0x2d')]!==_0x9c78('0x3b')){var _0x3f6345={};_0x3f6345[_0x421e40[_0x9c78('0x27')]]={'$like':'%'+_0x375118['query'][_0x9c78('0x3c')]+'%'};return _0x3f6345;}})});}_0x387df6=_['merge']({},_0x387df6,_0x375118[_0x9c78('0x3d')]);var _0x4e39e9={'where':_0x387df6[_0x9c78('0x39')]};return db[_0x9c78('0x2a')]['count'](_0x4e39e9)[_0x9c78('0x25')](function(_0x248c24){_0x20ff0c[_0x9c78('0x1f')]=_0x248c24;if(_0x375118[_0x9c78('0x30')][_0x9c78('0x3e')]){_0x387df6[_0x9c78('0x3f')]=[{'all':!![]}];}return db[_0x9c78('0x2a')][_0x9c78('0x40')](_0x387df6);})[_0x9c78('0x25')](function(_0x1b45fb){_0x20ff0c[_0x9c78('0x41')]=_0x1b45fb;return _0x20ff0c;})[_0x9c78('0x25')](respondWithFilteredResult(_0x30f4d8,_0x387df6))[_0x9c78('0x42')](handleError(_0x30f4d8,null));};exports['show']=function(_0x345b26,_0x354f49){var _0x4b191e={'raw':!![],'where':{'id':_0x345b26[_0x9c78('0x43')]['id']}},_0x276ea5={};_0x276ea5[_0x9c78('0x2f')]=_[_0x9c78('0x31')](db[_0x9c78('0x2a')]['rawAttributes']);_0x276ea5['query']=_[_0x9c78('0x31')](_0x345b26[_0x9c78('0x30')]);_0x276ea5[_0x9c78('0x32')]=_[_0x9c78('0x33')](_0x276ea5[_0x9c78('0x2f')],_0x276ea5['query']);_0x4b191e[_0x9c78('0x34')]=_[_0x9c78('0x33')](_0x276ea5[_0x9c78('0x2f')],qs[_0x9c78('0x35')](_0x345b26[_0x9c78('0x30')][_0x9c78('0x35')]));_0x4b191e[_0x9c78('0x34')]=_0x4b191e[_0x9c78('0x34')][_0x9c78('0x36')]?_0x4b191e[_0x9c78('0x34')]:_0x276ea5[_0x9c78('0x2f')];if(_0x345b26[_0x9c78('0x30')][_0x9c78('0x3e')]){_0x4b191e[_0x9c78('0x3f')]=[{'all':!![]}];}_0x4b191e=_['merge']({},_0x4b191e,_0x345b26['options']);return db[_0x9c78('0x2a')][_0x9c78('0x44')](_0x4b191e)[_0x9c78('0x25')](handleEntityNotFound(_0x354f49,null))['then'](respondWithResult(_0x354f49,null))[_0x9c78('0x42')](handleError(_0x354f49,null));};exports[_0x9c78('0x45')]=function(_0x572f43,_0x44ee29){return db[_0x9c78('0x2a')][_0x9c78('0x45')](_0x572f43[_0x9c78('0x46')],{})[_0x9c78('0x25')](respondWithResult(_0x44ee29,0xc9))[_0x9c78('0x42')](handleError(_0x44ee29,null));};exports['update']=function(_0x204ea1,_0x452db8){if(_0x204ea1[_0x9c78('0x46')]['id']){delete _0x204ea1[_0x9c78('0x46')]['id'];}return db[_0x9c78('0x2a')][_0x9c78('0x44')]({'where':{'id':_0x204ea1['params']['id']}})['then'](handleEntityNotFound(_0x452db8,null))[_0x9c78('0x25')](saveUpdates(_0x204ea1[_0x9c78('0x46')],null))[_0x9c78('0x25')](respondWithResult(_0x452db8,null))[_0x9c78('0x42')](handleError(_0x452db8,null));};exports['destroy']=function(_0x3e6b8f,_0x2da007){return db[_0x9c78('0x2a')][_0x9c78('0x44')]({'where':{'id':_0x3e6b8f[_0x9c78('0x43')]['id']}})[_0x9c78('0x25')](handleEntityNotFound(_0x2da007,null))[_0x9c78('0x25')](removeEntity(_0x2da007,null))[_0x9c78('0x42')](handleError(_0x2da007,null));};exports[_0x9c78('0x47')]=function(_0x2f4b58,_0x34b20e){return db[_0x9c78('0x2a')]['describe']()['then'](respondWithResult(_0x34b20e,null))[_0x9c78('0x42')](handleError(_0x34b20e,null));}; \ No newline at end of file +var _0x46ed=['undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x46ed,0x80));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require(_0xd46e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require(_0xd46e('0x5'));var Mustache=require(_0xd46e('0x6'));var util=require(_0xd46e('0x7'));var path=require(_0xd46e('0x8'));var sox=require(_0xd46e('0x9'));var csv=require(_0xd46e('0xa'));var ejs=require(_0xd46e('0xb'));var fs=require('fs');var fs_extra=require(_0xd46e('0xc'));var _=require(_0xd46e('0xd'));var squel=require('squel');var crypto=require(_0xd46e('0xe'));var jsforce=require(_0xd46e('0xf'));var deskjs=require(_0xd46e('0x10'));var toCsv=require(_0xd46e('0xa'));var querystring=require('querystring');var Papa=require(_0xd46e('0x11'));var Redis=require('ioredis');var authService=require(_0xd46e('0x12'));var qs=require(_0xd46e('0x13'));var as=require(_0xd46e('0x14'));var hardwareService=require(_0xd46e('0x15'));var logger=require(_0xd46e('0x16'))(_0xd46e('0x17'));var utils=require('../../config/utils');var config=require(_0xd46e('0x18'));var licenseUtil=require(_0xd46e('0x19'));var db=require(_0xd46e('0x1a'))['db'];function respondWithStatusCode(_0x2f2c6c,_0x5e802c){_0x5e802c=_0x5e802c||0xcc;return function(_0x9e2f04){if(_0x9e2f04){return _0x2f2c6c[_0xd46e('0x1b')](_0x5e802c);}return _0x2f2c6c[_0xd46e('0x1c')](_0x5e802c)[_0xd46e('0x1d')]();};}function respondWithResult(_0x4f4075,_0x47e8e7){_0x47e8e7=_0x47e8e7||0xc8;return function(_0x4e2f03){if(_0x4e2f03){return _0x4f4075[_0xd46e('0x1c')](_0x47e8e7)[_0xd46e('0x1e')](_0x4e2f03);}};}function respondWithFilteredResult(_0x388414,_0x40911c){return function(_0x337029){if(_0x337029){var _0x215686=typeof _0x40911c[_0xd46e('0x1f')]==='undefined'&&typeof _0x40911c['limit']===_0xd46e('0x20');var _0x902b5=_0x337029[_0xd46e('0x21')];var _0x4e518a=_0x215686?0x0:_0x40911c[_0xd46e('0x1f')];var _0x12b600=_0x215686?_0x337029[_0xd46e('0x21')]:_0x40911c[_0xd46e('0x1f')]+_0x40911c[_0xd46e('0x22')];var _0x62cc32;if(_0x12b600>=_0x902b5){_0x12b600=_0x902b5;_0x62cc32=0xc8;}else{_0x62cc32=0xce;}_0x388414[_0xd46e('0x1c')](_0x62cc32);return _0x388414['set'](_0xd46e('0x23'),_0x4e518a+'-'+_0x12b600+'/'+_0x902b5)[_0xd46e('0x1e')](_0x337029);}return null;};}function patchUpdates(_0x560c1f){return function(_0x1c404b){try{jsonpatch['apply'](_0x1c404b,_0x560c1f,!![]);}catch(_0x186dbe){return BPromise[_0xd46e('0x24')](_0x186dbe);}return _0x1c404b[_0xd46e('0x25')]();};}function saveUpdates(_0x11ce4d,_0x5a7fbc){return function(_0x39682f){if(_0x39682f){return _0x39682f[_0xd46e('0x26')](_0x11ce4d)[_0xd46e('0x27')](function(_0x3777f2){return _0x3777f2;});}return null;};}function removeEntity(_0x17c5d3,_0x5d15e0){return function(_0x479593){if(_0x479593){return _0x479593['destroy']()['then'](function(){_0x17c5d3[_0xd46e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331f11,_0x5d1120){return function(_0x519c1a){if(!_0x519c1a){_0x331f11[_0xd46e('0x1b')](0x194);}return _0x519c1a;};}function handleError(_0x40bb3e,_0x5d51b7){_0x5d51b7=_0x5d51b7||0x1f4;return function(_0x154c19){logger[_0xd46e('0x28')](_0x154c19[_0xd46e('0x29')]);if(_0x154c19['name']){delete _0x154c19[_0xd46e('0x2a')];}_0x40bb3e[_0xd46e('0x1c')](_0x5d51b7)[_0xd46e('0x2b')](_0x154c19);};}exports[_0xd46e('0x2c')]=function(_0x15da52,_0x81ce61){var _0x5231f0={},_0x2167b3={},_0x4d21e2={'count':0x0,'rows':[]};var _0x50adfe=_[_0xd46e('0x2d')](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x5aed2e){return{'name':_0x5aed2e[_0xd46e('0x30')],'type':_0x5aed2e[_0xd46e('0x31')][_0xd46e('0x32')]};});_0x2167b3[_0xd46e('0x33')]=_[_0xd46e('0x2d')](_0x50adfe,_0xd46e('0x2a'));_0x2167b3[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x15da52[_0xd46e('0x34')]);_0x2167b3['filters']=_[_0xd46e('0x36')](_0x2167b3['model'],_0x2167b3[_0xd46e('0x34')]);_0x5231f0['attributes']=_[_0xd46e('0x36')](_0x2167b3[_0xd46e('0x33')],qs[_0xd46e('0x37')](_0x15da52[_0xd46e('0x34')]['fields']));_0x5231f0[_0xd46e('0x38')]=_0x5231f0[_0xd46e('0x38')][_0xd46e('0x39')]?_0x5231f0['attributes']:_0x2167b3[_0xd46e('0x33')];if(!_0x15da52[_0xd46e('0x34')][_0xd46e('0x3a')](_0xd46e('0x3b'))){_0x5231f0[_0xd46e('0x22')]=qs[_0xd46e('0x22')](_0x15da52[_0xd46e('0x34')][_0xd46e('0x22')]);_0x5231f0[_0xd46e('0x1f')]=qs[_0xd46e('0x1f')](_0x15da52['query']['offset']);}_0x5231f0[_0xd46e('0x3c')]=qs[_0xd46e('0x3d')](_0x15da52[_0xd46e('0x34')][_0xd46e('0x3d')]);_0x5231f0['where']=qs[_0xd46e('0x3e')](_[_0xd46e('0x3f')](_0x15da52[_0xd46e('0x34')],_0x2167b3[_0xd46e('0x3e')]),_0x50adfe);if(_0x15da52[_0xd46e('0x34')][_0xd46e('0x40')]){_0x5231f0[_0xd46e('0x41')]=_[_0xd46e('0x42')](_0x5231f0[_0xd46e('0x41')],{'$or':_['map'](_0x50adfe,function(_0x39dd28){if(_0x39dd28[_0xd46e('0x31')]!==_0xd46e('0x43')){var _0x17de56={};_0x17de56[_0x39dd28['name']]={'$like':'%'+_0x15da52[_0xd46e('0x34')][_0xd46e('0x40')]+'%'};return _0x17de56;}})});}_0x5231f0=_[_0xd46e('0x42')]({},_0x5231f0,_0x15da52[_0xd46e('0x44')]);var _0x562b52={'where':_0x5231f0['where']};return db['SmsTransferReport'][_0xd46e('0x21')](_0x562b52)[_0xd46e('0x27')](function(_0x466797){_0x4d21e2['count']=_0x466797;if(_0x15da52[_0xd46e('0x34')]['includeAll']){_0x5231f0[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x5231f0);})[_0xd46e('0x27')](function(_0x12a8c7){_0x4d21e2[_0xd46e('0x47')]=_0x12a8c7;return _0x4d21e2;})[_0xd46e('0x27')](respondWithFilteredResult(_0x81ce61,_0x5231f0))[_0xd46e('0x48')](handleError(_0x81ce61,null));};exports[_0xd46e('0x49')]=function(_0x142e9f,_0x43b8b4){var _0x5266b7={'raw':!![],'where':{'id':_0x142e9f[_0xd46e('0x4a')]['id']}},_0x1c1fb9={};_0x1c1fb9[_0xd46e('0x33')]=_['keys'](db['SmsTransferReport'][_0xd46e('0x2f')]);_0x1c1fb9[_0xd46e('0x34')]=_['keys'](_0x142e9f[_0xd46e('0x34')]);_0x1c1fb9[_0xd46e('0x3e')]=_[_0xd46e('0x36')](_0x1c1fb9[_0xd46e('0x33')],_0x1c1fb9[_0xd46e('0x34')]);_0x5266b7['attributes']=_[_0xd46e('0x36')](_0x1c1fb9[_0xd46e('0x33')],qs[_0xd46e('0x37')](_0x142e9f['query'][_0xd46e('0x37')]));_0x5266b7[_0xd46e('0x38')]=_0x5266b7['attributes'][_0xd46e('0x39')]?_0x5266b7['attributes']:_0x1c1fb9[_0xd46e('0x33')];if(_0x142e9f[_0xd46e('0x34')][_0xd46e('0x4b')]){_0x5266b7['include']=[{'all':!![]}];}_0x5266b7=_[_0xd46e('0x42')]({},_0x5266b7,_0x142e9f[_0xd46e('0x44')]);return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x5266b7)[_0xd46e('0x27')](handleEntityNotFound(_0x43b8b4,null))[_0xd46e('0x27')](respondWithResult(_0x43b8b4,null))[_0xd46e('0x48')](handleError(_0x43b8b4,null));};exports[_0xd46e('0x4d')]=function(_0x44090f,_0x44a512){return db['SmsTransferReport'][_0xd46e('0x4d')](_0x44090f['body'],{})['then'](respondWithResult(_0x44a512,0xc9))[_0xd46e('0x48')](handleError(_0x44a512,null));};exports[_0xd46e('0x26')]=function(_0x4f7b91,_0x413f33){if(_0x4f7b91[_0xd46e('0x4e')]['id']){delete _0x4f7b91['body']['id'];}return db[_0xd46e('0x2e')][_0xd46e('0x4c')]({'where':{'id':_0x4f7b91[_0xd46e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x413f33,null))[_0xd46e('0x27')](saveUpdates(_0x4f7b91[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x413f33,null))['catch'](handleError(_0x413f33,null));};exports['destroy']=function(_0x402451,_0xa0509b){return db['SmsTransferReport'][_0xd46e('0x4c')]({'where':{'id':_0x402451[_0xd46e('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa0509b,null))['then'](removeEntity(_0xa0509b,null))[_0xd46e('0x48')](handleError(_0xa0509b,null));};exports[_0xd46e('0x4f')]=function(_0x188b7,_0x45e0a0){return db[_0xd46e('0x2e')]['describe']()[_0xd46e('0x27')](respondWithResult(_0x45e0a0,null))[_0xd46e('0x48')](handleError(_0x45e0a0,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index dcaa500..2334bb5 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 _0xb85a=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsTransferReport.attributes','exports','report_sms_transfer','uniqueid'];(function(_0x24bfff,_0x2a78ab){var _0xf8a4fd=function(_0x56fabc){while(--_0x56fabc){_0x24bfff['push'](_0x24bfff['shift']());}};_0xf8a4fd(++_0x2a78ab);}(_0xb85a,0xb0));var _0xab85=function(_0x104c9b,_0x56944d){_0x104c9b=_0x104c9b-0x0;var _0x39ba4d=_0xb85a[_0x104c9b];return _0x39ba4d;};'use strict';var _=require('lodash');var util=require(_0xab85('0x0'));var logger=require(_0xab85('0x1'))(_0xab85('0x2'));var moment=require(_0xab85('0x3'));var BPromise=require(_0xab85('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab85('0x5'));var config=require(_0xab85('0x6'));var attributes=require(_0xab85('0x7'));module[_0xab85('0x8')]=function(_0x386c9e,_0x487a2e){return _0x386c9e['define']('SmsTransferReport',attributes,{'tableName':_0xab85('0x9'),'paranoid':![],'indexes':[{'name':_0xab85('0xa'),'fields':[_0xab85('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12dc=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x2b630f,_0x1c0a47){var _0x7c0bd0=function(_0x289f46){while(--_0x289f46){_0x2b630f['push'](_0x2b630f['shift']());}};_0x7c0bd0(++_0x1c0a47);}(_0x12dc,0xb4));var _0xc12d=function(_0x2cbed5,_0x52001b){_0x2cbed5=_0x2cbed5-0x0;var _0x36ce18=_0x12dc[_0x2cbed5];return _0x36ce18;};'use strict';var _=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var logger=require('../../config/logger')(_0xc12d('0x2'));var moment=require(_0xc12d('0x3'));var BPromise=require(_0xc12d('0x4'));var rp=require(_0xc12d('0x5'));var fs=require('fs');var path=require(_0xc12d('0x6'));var rimraf=require(_0xc12d('0x7'));var config=require(_0xc12d('0x8'));var attributes=require(_0xc12d('0x9'));module[_0xc12d('0xa')]=function(_0x5383da,_0x3148cf){return _0x5383da[_0xc12d('0xb')](_0xc12d('0xc'),attributes,{'tableName':_0xc12d('0xd'),'paranoid':![],'indexes':[{'name':_0xc12d('0xe'),'fields':[_0xc12d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7ffab48..590ab68 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 _0x8c25=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','request'];(function(_0x3b320d,_0x16a0bd){var _0x1340c6=function(_0x5d681){while(--_0x5d681){_0x3b320d['push'](_0x3b320d['shift']());}};_0x1340c6(++_0x16a0bd);}(_0x8c25,0x15e));var _0x58c2=function(_0x2376ac,_0x3fbb7c){_0x2376ac=_0x2376ac-0x0;var _0x428e54=_0x8c25[_0x2376ac];return _0x428e54;};'use strict';var _=require(_0x58c2('0x0'));var util=require(_0x58c2('0x1'));var moment=require(_0x58c2('0x2'));var BPromise=require(_0x58c2('0x3'));var rs=require(_0x58c2('0x4'));var fs=require('fs');var Redis=require(_0x58c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x58c2('0x7'));var client=jayson['client'][_0x58c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4be512,_0x5f3536,_0x331863){return new BPromise(function(_0xddbb7e,_0x52cfa7){return client[_0x58c2('0x9')](_0x4be512,_0x331863)[_0x58c2('0xa')](function(_0xf9aef5){logger[_0x58c2('0xb')](_0x58c2('0xc'),_0x5f3536,_0x58c2('0xd'));logger[_0x58c2('0xe')](_0x58c2('0xf'),_0x5f3536,'request\x20sent',JSON[_0x58c2('0x10')](_0xf9aef5));if(_0xf9aef5[_0x58c2('0x11')]){if(_0xf9aef5[_0x58c2('0x11')]['code']===0x1f4){logger[_0x58c2('0x11')](_0x58c2('0xc'),_0x5f3536,_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);return _0x52cfa7(_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);}logger[_0x58c2('0x11')](_0x58c2('0xc'),_0x5f3536,_0xf9aef5[_0x58c2('0x11')][_0x58c2('0x12')]);return _0xddbb7e(_0xf9aef5['error']['message']);}else{logger[_0x58c2('0xb')](_0x58c2('0xc'),_0x5f3536,_0x58c2('0xd'));_0xddbb7e(_0xf9aef5[_0x58c2('0x13')][_0x58c2('0x12')]);}})['catch'](function(_0x3a6312){logger[_0x58c2('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x5f3536,_0x3a6312);_0x52cfa7(_0x3a6312);});});} \ 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','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1f4a03,_0x3f5a8e){var _0x137487=function(_0x866278){while(--_0x866278){_0x1f4a03['push'](_0x1f4a03['shift']());}};_0x137487(++_0x3f5a8e);}(_0x8ef6,0xf2));var _0x68ef=function(_0x488a6c,_0x323f37){_0x488a6c=_0x488a6c-0x0;var _0x32b88c=_0x8ef6[_0x488a6c];return _0x32b88c;};'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')]('SmsTransferReport,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 31f0d07..e01af33 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 _0xc9c1=['put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','/:id/download','diskStorage','join','root','originalname','format','basename','extname','now','post','single','file','create'];(function(_0x5975ee,_0x37076e){var _0x4534c3=function(_0x16283e){while(--_0x16283e){_0x5975ee['push'](_0x5975ee['shift']());}};_0x4534c3(++_0x37076e);}(_0xc9c1,0x15a));var _0x1c9c=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xc9c1[_0x18a79d];return _0x4f8848;};'use strict';var multer=require(_0x1c9c('0x0'));var util=require(_0x1c9c('0x1'));var path=require(_0x1c9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c9c('0x3'));var router=express[_0x1c9c('0x4')]();var fs_extra=require(_0x1c9c('0x5'));var auth=require(_0x1c9c('0x6'));var interaction=require(_0x1c9c('0x7'));var config=require('../../config/environment');var controller=require(_0x1c9c('0x8'));router[_0x1c9c('0x9')]('/',auth[_0x1c9c('0xa')](),controller[_0x1c9c('0xb')]);router[_0x1c9c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1c9c('0xc')]);router['get'](_0x1c9c('0xd'),auth[_0x1c9c('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x1c9c('0xe')]({'destination':function(_0x2b08bf,_0x48bcfd,_0x260289){_0x260289(null,path[_0x1c9c('0xf')](config[_0x1c9c('0x10')],'server/files/sounds/original/'));},'filename':function(_0x136a59,_0x66312f,_0x176ef6){_0x66312f[_0x1c9c('0x11')]=_0x66312f[_0x1c9c('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x176ef6(null,util[_0x1c9c('0x12')]('%s-%s%s',path[_0x1c9c('0x13')](_0x66312f[_0x1c9c('0x11')],path[_0x1c9c('0x14')](_0x66312f[_0x1c9c('0x11')])),Date[_0x1c9c('0x15')](),path[_0x1c9c('0x14')](_0x66312f[_0x1c9c('0x11')])));}})});router[_0x1c9c('0x16')]('/',upload[_0x1c9c('0x17')](_0x1c9c('0x18')),controller[_0x1c9c('0x19')]);router[_0x1c9c('0x1a')](_0x1c9c('0x1b'),auth[_0x1c9c('0xa')](),controller[_0x1c9c('0x1c')]);router['delete'](_0x1c9c('0x1b'),auth['isAuthenticated'](),controller[_0x1c9c('0x1d')]);module[_0x1c9c('0x1e')]=router; \ No newline at end of file +var _0x7b5e=['replace','format','%s-%s%s','basename','now','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','index','get','/:id','isAuthenticated','show','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x7b5e,0x174));var _0xe7b5=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x7b5e[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xe7b5('0x0'));var util=require(_0xe7b5('0x1'));var path=require(_0xe7b5('0x2'));var timeout=require(_0xe7b5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe7b5('0x4'));var auth=require(_0xe7b5('0x5'));var interaction=require(_0xe7b5('0x6'));var config=require('../../config/environment');var controller=require(_0xe7b5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe7b5('0x8')]);router[_0xe7b5('0x9')](_0xe7b5('0xa'),auth[_0xe7b5('0xb')](),controller[_0xe7b5('0xc')]);router[_0xe7b5('0x9')]('/:id/download',auth[_0xe7b5('0xb')](),controller['download']);var upload=multer({'storage':multer[_0xe7b5('0xd')]({'destination':function(_0x511327,_0x30ab2a,_0x30349e){_0x30349e(null,path[_0xe7b5('0xe')](config[_0xe7b5('0xf')],_0xe7b5('0x10')));},'filename':function(_0x2acae3,_0x40db82,_0x1175cc){_0x40db82[_0xe7b5('0x11')]=_0x40db82[_0xe7b5('0x11')][_0xe7b5('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1175cc(null,util[_0xe7b5('0x13')](_0xe7b5('0x14'),path[_0xe7b5('0x15')](_0x40db82['originalname'],path['extname'](_0x40db82[_0xe7b5('0x11')])),Date[_0xe7b5('0x16')](),path['extname'](_0x40db82[_0xe7b5('0x11')])));}})});router[_0xe7b5('0x17')]('/',upload[_0xe7b5('0x18')](_0xe7b5('0x19')),controller['create']);router[_0xe7b5('0x1a')]('/:id',auth[_0xe7b5('0xb')](),controller[_0xe7b5('0x1b')]);router[_0xe7b5('0x1c')](_0xe7b5('0xa'),auth['isAuthenticated'](),controller[_0xe7b5('0x1c')]);module[_0xe7b5('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 6b73887..2676cae 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 _0xcdc4=['STRING','BIGINT','INTEGER','FLOAT','exports'];(function(_0x28c89b,_0x2510b3){var _0x176500=function(_0x3dfee2){while(--_0x3dfee2){_0x28c89b['push'](_0x28c89b['shift']());}};_0x176500(++_0x2510b3);}(_0xcdc4,0x199));var _0x4cdc=function(_0x4ea98d,_0x5c3a56){_0x4ea98d=_0x4ea98d-0x0;var _0x151023=_0xcdc4[_0x4ea98d];return _0x151023;};'use strict';var Sequelize=require('sequelize');module[_0x4cdc('0x0')]={'name':{'type':Sequelize[_0x4cdc('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x4cdc('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x4cdc('0x1')]},'original_format':{'type':Sequelize[_0x4cdc('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x4cdc('0x2')]},'original_channelCount':{'type':Sequelize[_0x4cdc('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x4cdc('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x4cdc('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x4cdc('0x2')]},'converted_channelCount':{'type':Sequelize[_0x4cdc('0x3')]},'converted_bitRate':{'type':Sequelize[_0x4cdc('0x2')]},'converted_sampleRate':{'type':Sequelize[_0x4cdc('0x3')]}}; \ No newline at end of file +var _0x32a5=['INTEGER','sequelize','exports','name','STRING','FLOAT','BIGINT'];(function(_0xc67c27,_0x468910){var _0x47f997=function(_0x493254){while(--_0x493254){_0xc67c27['push'](_0xc67c27['shift']());}};_0x47f997(++_0x468910);}(_0x32a5,0xe8));var _0x532a=function(_0x345cb3,_0x5388bd){_0x345cb3=_0x345cb3-0x0;var _0xb72317=_0x32a5[_0x345cb3];return _0xb72317;};'use strict';var Sequelize=require(_0x532a('0x0'));module[_0x532a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x532a('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x532a('0x3')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x532a('0x3')]},'original_format':{'type':Sequelize[_0x532a('0x3')]},'original_duration':{'type':Sequelize[_0x532a('0x4')]},'original_sampleCount':{'type':Sequelize[_0x532a('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x532a('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x532a('0x3')]},'converted_duration':{'type':Sequelize[_0x532a('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x532a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x532a('0x6')]},'converted_bitRate':{'type':Sequelize[_0x532a('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x532a('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b69fbc4..5cf1f20 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 _0x834b=['description','delete','format','original_format','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','Sound','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','download','save_name','converted_format','existsSync','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','root','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','body','userProfileId','role','user','UserProfileSection','Sounds','autoAssociation','UserProfileResource'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x834b,0x1dd));var _0xb834=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x834b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb834('0x0'));var zipdir=require(_0xb834('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb834('0x2'));var moment=require(_0xb834('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb834('0x4'));var util=require(_0xb834('0x5'));var path=require(_0xb834('0x6'));var sox=require(_0xb834('0x7'));var csv=require(_0xb834('0x8'));var ejs=require(_0xb834('0x9'));var fs=require('fs');var fs_extra=require(_0xb834('0xa'));var _=require(_0xb834('0xb'));var squel=require('squel');var crypto=require(_0xb834('0xc'));var jsforce=require(_0xb834('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb834('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb834('0xe'));var authService=require(_0xb834('0xf'));var qs=require(_0xb834('0x10'));var as=require(_0xb834('0x11'));var hardwareService=require(_0xb834('0x12'));var logger=require(_0xb834('0x13'))(_0xb834('0x14'));var utils=require(_0xb834('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb834('0x16'))['db'];function respondWithStatusCode(_0x1d14a2,_0x2849b1){_0x2849b1=_0x2849b1||0xcc;return function(_0x3db052){if(_0x3db052){return _0x1d14a2['sendStatus'](_0x2849b1);}return _0x1d14a2[_0xb834('0x17')](_0x2849b1)[_0xb834('0x18')]();};}function respondWithResult(_0x145e3a,_0x2c95cb){_0x2c95cb=_0x2c95cb||0xc8;return function(_0x114541){if(_0x114541){return _0x145e3a['status'](_0x2c95cb)['json'](_0x114541);}};}function respondWithFilteredResult(_0x1a212a,_0x511be8){return function(_0x3d97cc){if(_0x3d97cc){var _0x5cecba=typeof _0x511be8[_0xb834('0x19')]===_0xb834('0x1a')&&typeof _0x511be8[_0xb834('0x1b')]===_0xb834('0x1a');var _0x33a23b=_0x3d97cc['count'];var _0x4d2c02=_0x5cecba?0x0:_0x511be8[_0xb834('0x19')];var _0x57c5c1=_0x5cecba?_0x3d97cc[_0xb834('0x1c')]:_0x511be8[_0xb834('0x19')]+_0x511be8[_0xb834('0x1b')];var _0x4567ed;if(_0x57c5c1>=_0x33a23b){_0x57c5c1=_0x33a23b;_0x4567ed=0xc8;}else{_0x4567ed=0xce;}_0x1a212a[_0xb834('0x17')](_0x4567ed);return _0x1a212a[_0xb834('0x1d')](_0xb834('0x1e'),_0x4d2c02+'-'+_0x57c5c1+'/'+_0x33a23b)['json'](_0x3d97cc);}return null;};}function patchUpdates(_0xc51013){return function(_0x1a4d2f){try{jsonpatch['apply'](_0x1a4d2f,_0xc51013,!![]);}catch(_0x5947af){return BPromise[_0xb834('0x1f')](_0x5947af);}return _0x1a4d2f[_0xb834('0x20')]();};}function saveUpdates(_0x11789e,_0x1beac7){return function(_0x4763e1){if(_0x4763e1){return _0x4763e1[_0xb834('0x21')](_0x11789e)['then'](function(_0x4fc1c1){return _0x4fc1c1;});}return null;};}function removeEntity(_0x1ddd80,_0x48bcd1){return function(_0x50321e){if(_0x50321e){return _0x50321e[_0xb834('0x22')]()[_0xb834('0x23')](function(){var _0x6c61a9=_0x50321e['get']({'plain':!![]});var _0x50c577='Sounds';return db['UserProfileResource'][_0xb834('0x22')]({'where':{'type':_0x50c577,'resourceId':_0x6c61a9['id']}})['then'](function(){return _0x50321e;});})[_0xb834('0x23')](function(){_0x1ddd80['status'](0xcc)[_0xb834('0x18')]();});}};}function handleEntityNotFound(_0x3b810d,_0x1e0f6f){return function(_0x403f4f){if(!_0x403f4f){_0x3b810d['sendStatus'](0x194);}return _0x403f4f;};}function handleError(_0x5725ec,_0x3c886f){_0x3c886f=_0x3c886f||0x1f4;return function(_0x2d9a77){logger[_0xb834('0x24')](_0x2d9a77[_0xb834('0x25')]);if(_0x2d9a77[_0xb834('0x26')]){delete _0x2d9a77[_0xb834('0x26')];}_0x5725ec[_0xb834('0x17')](_0x3c886f)[_0xb834('0x27')](_0x2d9a77);};}exports['index']=function(_0x2500ea,_0xbf27af){var _0x5e2dd8={},_0x23db2a={},_0x41b9e1={'count':0x0,'rows':[]};var _0x9b477d=_['map'](db[_0xb834('0x28')][_0xb834('0x29')],function(_0x4d3078){return{'name':_0x4d3078[_0xb834('0x2a')],'type':_0x4d3078[_0xb834('0x2b')][_0xb834('0x2c')]};});_0x23db2a[_0xb834('0x2d')]=_[_0xb834('0x2e')](_0x9b477d,'name');_0x23db2a['query']=_[_0xb834('0x2f')](_0x2500ea['query']);_0x23db2a[_0xb834('0x30')]=_[_0xb834('0x31')](_0x23db2a[_0xb834('0x2d')],_0x23db2a[_0xb834('0x32')]);_0x5e2dd8[_0xb834('0x33')]=_[_0xb834('0x31')](_0x23db2a[_0xb834('0x2d')],qs['fields'](_0x2500ea[_0xb834('0x32')][_0xb834('0x34')]));_0x5e2dd8[_0xb834('0x33')]=_0x5e2dd8[_0xb834('0x33')]['length']?_0x5e2dd8[_0xb834('0x33')]:_0x23db2a[_0xb834('0x2d')];if(!_0x2500ea[_0xb834('0x32')][_0xb834('0x35')]('nolimit')){_0x5e2dd8[_0xb834('0x1b')]=qs[_0xb834('0x1b')](_0x2500ea[_0xb834('0x32')][_0xb834('0x1b')]);_0x5e2dd8[_0xb834('0x19')]=qs[_0xb834('0x19')](_0x2500ea['query'][_0xb834('0x19')]);}_0x5e2dd8[_0xb834('0x36')]=qs[_0xb834('0x37')](_0x2500ea['query'][_0xb834('0x37')]);_0x5e2dd8[_0xb834('0x38')]=qs[_0xb834('0x30')](_['pick'](_0x2500ea[_0xb834('0x32')],_0x23db2a[_0xb834('0x30')]),_0x9b477d);if(_0x2500ea[_0xb834('0x32')][_0xb834('0x39')]){_0x5e2dd8[_0xb834('0x38')]=_[_0xb834('0x3a')](_0x5e2dd8[_0xb834('0x38')],{'$or':_[_0xb834('0x2e')](_0x9b477d,function(_0x48b528){if(_0x48b528[_0xb834('0x2b')]!==_0xb834('0x3b')){var _0x4cffd8={};_0x4cffd8[_0x48b528[_0xb834('0x26')]]={'$like':'%'+_0x2500ea['query']['filter']+'%'};return _0x4cffd8;}})});}_0x5e2dd8=_[_0xb834('0x3a')]({},_0x5e2dd8,_0x2500ea[_0xb834('0x3c')]);var _0x5e8077={'where':_0x5e2dd8[_0xb834('0x38')]};return db[_0xb834('0x28')]['count'](_0x5e8077)[_0xb834('0x23')](function(_0x2c49ef){_0x41b9e1[_0xb834('0x1c')]=_0x2c49ef;if(_0x2500ea[_0xb834('0x32')][_0xb834('0x3d')]){_0x5e2dd8[_0xb834('0x3e')]=[{'all':!![]}];}return db[_0xb834('0x28')][_0xb834('0x3f')](_0x5e2dd8);})['then'](function(_0x23fde7){_0x41b9e1[_0xb834('0x40')]=_0x23fde7;return _0x41b9e1;})[_0xb834('0x23')](respondWithFilteredResult(_0xbf27af,_0x5e2dd8))['catch'](handleError(_0xbf27af,null));};exports['show']=function(_0x38ecb2,_0xe8cffe){var _0x3b2e4e={'raw':!![],'where':{'id':_0x38ecb2[_0xb834('0x41')]['id']}},_0x423095={};_0x423095[_0xb834('0x2d')]=_[_0xb834('0x2f')](db[_0xb834('0x28')][_0xb834('0x29')]);_0x423095['query']=_[_0xb834('0x2f')](_0x38ecb2[_0xb834('0x32')]);_0x423095[_0xb834('0x30')]=_['intersection'](_0x423095[_0xb834('0x2d')],_0x423095[_0xb834('0x32')]);_0x3b2e4e['attributes']=_[_0xb834('0x31')](_0x423095[_0xb834('0x2d')],qs[_0xb834('0x34')](_0x38ecb2['query']['fields']));_0x3b2e4e[_0xb834('0x33')]=_0x3b2e4e[_0xb834('0x33')][_0xb834('0x42')]?_0x3b2e4e[_0xb834('0x33')]:_0x423095[_0xb834('0x2d')];if(_0x38ecb2[_0xb834('0x32')][_0xb834('0x3d')]){_0x3b2e4e[_0xb834('0x3e')]=[{'all':!![]}];}_0x3b2e4e=_[_0xb834('0x3a')]({},_0x3b2e4e,_0x38ecb2[_0xb834('0x3c')]);return db[_0xb834('0x28')][_0xb834('0x43')](_0x3b2e4e)[_0xb834('0x23')](handleEntityNotFound(_0xe8cffe,null))[_0xb834('0x23')](respondWithResult(_0xe8cffe,null))[_0xb834('0x44')](handleError(_0xe8cffe,null));};exports[_0xb834('0x45')]=function(_0xd07ce1,_0x4dc886,_0x5aab0e){return db[_0xb834('0x28')]['find']({'where':{'id':_0xd07ce1[_0xb834('0x41')]['id']},'attributes':[_0xb834('0x26'),_0xb834('0x46'),_0xb834('0x47')],'raw':!![]})[_0xb834('0x23')](handleEntityNotFound(_0x4dc886,null))[_0xb834('0x23')](function(_0x5d1682){if(_0x5d1682){if(!fs[_0xb834('0x48')](path['join'](config['root'],_0xb834('0x49'),_0x5d1682[_0xb834('0x46')]+'.'+_0x5d1682[_0xb834('0x47')]))){throw new db[(_0xb834('0x4a'))][(_0xb834('0x4b'))](_0xb834('0x4c'));}return _0x4dc886[_0xb834('0x45')](path[_0xb834('0x4d')](config[_0xb834('0x4e')],_0xb834('0x49'),util['format']('%s.%s',_0x5d1682['save_name'],_0x5d1682[_0xb834('0x47')])),util['format'](_0xb834('0x4f'),_0x5d1682[_0xb834('0x26')],_0x5d1682[_0xb834('0x47')]));}return null;})[_0xb834('0x44')](handleError(_0x4dc886,null));};exports[_0xb834('0x50')]=function(_0x31f07a,_0x329a11,_0x1f36a3){var _0x5a404a={'name':path[_0xb834('0x51')](_0x31f07a[_0xb834('0x52')]['originalname'],path[_0xb834('0x53')](_0x31f07a['file'][_0xb834('0x54')])),'save_name':path['basename'](_0x31f07a[_0xb834('0x52')][_0xb834('0x55')],path[_0xb834('0x53')](_0x31f07a['file'][_0xb834('0x55')])),'original_format':path['extname'](_0x31f07a['file'][_0xb834('0x54')])[_0xb834('0x56')](0x1),'converted_format':_0xb834('0x57')};var _0x515c70=path[_0xb834('0x4d')](config[_0xb834('0x4e')],_0xb834('0x58'),_0x31f07a[_0xb834('0x52')][_0xb834('0x55')]);var _0xef2f84=path[_0xb834('0x4d')](config[_0xb834('0x4e')],_0xb834('0x49'),util['format'](_0xb834('0x4f'),path['basename'](_0x31f07a['file'][_0xb834('0x55')],path[_0xb834('0x53')](_0x31f07a[_0xb834('0x52')][_0xb834('0x55')])),_0x5a404a[_0xb834('0x47')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x515c70);logger[_0xb834('0x59')](_0xb834('0x5a'),_0xef2f84);try{fs[_0xb834('0x5b')](_0x515c70,parseInt(_0xb834('0x5c'),0x8));var _0x3fa09f=sox[_0xb834('0x5d')](_0x515c70,_0xef2f84,{'sampleRate':0x1f40,'format':_0xb834('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3fa09f['on'](_0xb834('0x24'),function(_0x422b3f){fs['unlinkSync'](_0x515c70);_0x329a11['status'](0x1f4)[_0xb834('0x27')](_0x422b3f);});_0x3fa09f['on']('src',function(_0x4745b6){_0x5a404a['original_duration']=isNaN(_0x4745b6['duration'])?null:_0x4745b6[_0xb834('0x5e')]*0x3e8;_0x5a404a[_0xb834('0x5f')]=isNaN(_0x4745b6[_0xb834('0x60')])?null:_0x4745b6['sampleCount'];_0x5a404a[_0xb834('0x61')]=isNaN(_0x4745b6[_0xb834('0x62')])?null:_0x4745b6['channelCount'];_0x5a404a['original_bitRate']=isNaN(_0x4745b6[_0xb834('0x63')])?null:_0x4745b6['bitRate'];_0x5a404a['original_sampleRate']=isNaN(_0x4745b6[_0xb834('0x64')])?null:_0x4745b6[_0xb834('0x64')];});_0x3fa09f['on'](_0xb834('0x65'),function(_0x424a8e){_0x5a404a[_0xb834('0x66')]=isNaN(_0x424a8e[_0xb834('0x5e')])?null:_0x424a8e[_0xb834('0x5e')]*0x3e8;_0x5a404a[_0xb834('0x67')]=isNaN(_0x424a8e[_0xb834('0x60')])?null:_0x424a8e[_0xb834('0x60')];_0x5a404a[_0xb834('0x68')]=isNaN(_0x424a8e[_0xb834('0x62')])?null:_0x424a8e['channelCount'];_0x5a404a['converted_bitRate']=isNaN(_0x424a8e['bitRate'])?null:_0x424a8e[_0xb834('0x63')];_0x5a404a['converted_sampleRate']=isNaN(_0x424a8e[_0xb834('0x64')])?null:_0x424a8e[_0xb834('0x64')];});_0x3fa09f['on'](_0xb834('0x18'),function(){fs[_0xb834('0x5b')](_0xef2f84,parseInt('0777',0x8));return db[_0xb834('0x28')][_0xb834('0x50')](_0x5a404a)[_0xb834('0x23')](function(_0x398e40){var _0x5372c7={'role':_0x31f07a[_0xb834('0x69')]['role'],'userProfileId':_0x31f07a[_0xb834('0x69')][_0xb834('0x6a')]};if(!_0x5372c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5372c7[_0xb834('0x6b')]===_0xb834('0x6c')){var _0x52521b=_0x398e40['get']({'plain':!![]});return db[_0xb834('0x6d')][_0xb834('0x43')]({'where':{'name':_0xb834('0x6e'),'userProfileId':_0x5372c7[_0xb834('0x6a')]},'raw':!![]})[_0xb834('0x23')](function(_0x598656){if(_0x598656&&_0x598656[_0xb834('0x6f')]===0x0){return db[_0xb834('0x70')][_0xb834('0x50')]({'name':_0x52521b[_0xb834('0x26')],'resourceId':_0x52521b['id'],'type':_0x598656[_0xb834('0x26')],'sectionId':_0x598656['id']},{})['then'](function(){return _0x398e40;});}else{return _0x398e40;}})[_0xb834('0x44')](function(_0x184214){logger[_0xb834('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x184214);throw _0x184214;});}return _0x398e40;})[_0xb834('0x23')](respondWithResult(_0x329a11,null))['catch'](handleError(_0x329a11,null));});_0x3fa09f['start']();}catch(_0x3f0fa6){_0x329a11['status'](0x1f4)[_0xb834('0x27')](_0x3f0fa6);}};exports[_0xb834('0x21')]=function(_0x55ec7a,_0x5248f3,_0x477f36){return db[_0xb834('0x28')]['find']({'where':{'id':_0x55ec7a['params']['id']}})[_0xb834('0x23')](handleEntityNotFound(_0x5248f3,null))[_0xb834('0x23')](saveUpdates(_['pick'](_0x55ec7a[_0xb834('0x69')],[_0xb834('0x26'),_0xb834('0x71')]),null))['then'](respondWithResult(_0x5248f3,null))['catch'](handleError(_0x5248f3,null));};exports[_0xb834('0x72')]=function(_0x25148b,_0x35783d,_0x577aee){return db[_0xb834('0x28')][_0xb834('0x43')]({'where':{'id':_0x25148b['params']['id']}})[_0xb834('0x23')](function(_0x5ffeaa){if(_0x5ffeaa){return _0x5ffeaa['destroy']();}})[_0xb834('0x23')](function(_0x621e2){var _0x141e9c=path['join'](config[_0xb834('0x4e')],_0xb834('0x58'),util[_0xb834('0x73')](_0xb834('0x4f'),_0x621e2[_0xb834('0x46')],_0x621e2[_0xb834('0x74')]));var _0x24d800=path['join'](config[_0xb834('0x4e')],_0xb834('0x49'),util[_0xb834('0x73')](_0xb834('0x4f'),_0x621e2[_0xb834('0x46')],_0x621e2['converted_format']));fs[_0xb834('0x75')](_0x141e9c);fs[_0xb834('0x75')](_0x24d800);return _0x621e2;})['then'](function(_0x244dc2){if(_0x244dc2){return _0x35783d[_0xb834('0x17')](0xcc)[_0xb834('0x18')]();}})[_0xb834('0x23')](handleEntityNotFound(_0x35783d,null))[_0xb834('0x44')](handleError(_0x35783d,null));}; \ No newline at end of file +var _0xbe31=['wav','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','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','offset','undefined','limit','count','Content-Range','json','reject','update','then','destroy','get','Sounds','UserProfileResource','end','stack','name','send','index','map','Sound','type','key','query','filters','model','attributes','fields','length','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','intersection','include','find','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','originalname','extname','file','basename','filename'];(function(_0x35e1a0,_0x192033){var _0x3a7133=function(_0x2be064){while(--_0x2be064){_0x35e1a0['push'](_0x35e1a0['shift']());}};_0x3a7133(++_0x192033);}(_0xbe31,0x98));var _0x1be3=function(_0x64a67,_0x16278f){_0x64a67=_0x64a67-0x0;var _0x408007=_0xbe31[_0x64a67];return _0x408007;};'use strict';var emlformat=require(_0x1be3('0x0'));var rimraf=require(_0x1be3('0x1'));var zipdir=require(_0x1be3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1be3('0x3'));var moment=require(_0x1be3('0x4'));var BPromise=require(_0x1be3('0x5'));var Mustache=require(_0x1be3('0x6'));var util=require(_0x1be3('0x7'));var path=require('path');var sox=require(_0x1be3('0x8'));var csv=require(_0x1be3('0x9'));var ejs=require(_0x1be3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1be3('0xb'));var crypto=require(_0x1be3('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1be3('0x9'));var querystring=require(_0x1be3('0xd'));var Papa=require(_0x1be3('0xe'));var Redis=require(_0x1be3('0xf'));var authService=require(_0x1be3('0x10'));var qs=require(_0x1be3('0x11'));var as=require(_0x1be3('0x12'));var hardwareService=require(_0x1be3('0x13'));var logger=require(_0x1be3('0x14'))(_0x1be3('0x15'));var utils=require(_0x1be3('0x16'));var config=require(_0x1be3('0x17'));var licenseUtil=require(_0x1be3('0x18'));var db=require(_0x1be3('0x19'))['db'];function respondWithStatusCode(_0x56a251,_0x2e317e){_0x2e317e=_0x2e317e||0xcc;return function(_0x1add39){if(_0x1add39){return _0x56a251[_0x1be3('0x1a')](_0x2e317e);}return _0x56a251[_0x1be3('0x1b')](_0x2e317e)['end']();};}function respondWithResult(_0x34c280,_0x40255f){_0x40255f=_0x40255f||0xc8;return function(_0x3697bd){if(_0x3697bd){return _0x34c280[_0x1be3('0x1b')](_0x40255f)['json'](_0x3697bd);}};}function respondWithFilteredResult(_0x53cdff,_0x16b797){return function(_0x442933){if(_0x442933){var _0x2457b0=typeof _0x16b797[_0x1be3('0x1c')]===_0x1be3('0x1d')&&typeof _0x16b797[_0x1be3('0x1e')]==='undefined';var _0x193027=_0x442933[_0x1be3('0x1f')];var _0x490e00=_0x2457b0?0x0:_0x16b797[_0x1be3('0x1c')];var _0x1f06ab=_0x2457b0?_0x442933['count']:_0x16b797[_0x1be3('0x1c')]+_0x16b797[_0x1be3('0x1e')];var _0x51208b;if(_0x1f06ab>=_0x193027){_0x1f06ab=_0x193027;_0x51208b=0xc8;}else{_0x51208b=0xce;}_0x53cdff[_0x1be3('0x1b')](_0x51208b);return _0x53cdff['set'](_0x1be3('0x20'),_0x490e00+'-'+_0x1f06ab+'/'+_0x193027)[_0x1be3('0x21')](_0x442933);}return null;};}function patchUpdates(_0x30e210){return function(_0x56d6d4){try{jsonpatch['apply'](_0x56d6d4,_0x30e210,!![]);}catch(_0x48c979){return BPromise[_0x1be3('0x22')](_0x48c979);}return _0x56d6d4['save']();};}function saveUpdates(_0x36bf73,_0x4ac27d){return function(_0x5e6acd){if(_0x5e6acd){return _0x5e6acd[_0x1be3('0x23')](_0x36bf73)[_0x1be3('0x24')](function(_0x596df1){return _0x596df1;});}return null;};}function removeEntity(_0x162b5e,_0x3fa1c6){return function(_0x14d7e1){if(_0x14d7e1){return _0x14d7e1[_0x1be3('0x25')]()[_0x1be3('0x24')](function(){var _0x244e99=_0x14d7e1[_0x1be3('0x26')]({'plain':!![]});var _0x8931e3=_0x1be3('0x27');return db[_0x1be3('0x28')][_0x1be3('0x25')]({'where':{'type':_0x8931e3,'resourceId':_0x244e99['id']}})[_0x1be3('0x24')](function(){return _0x14d7e1;});})[_0x1be3('0x24')](function(){_0x162b5e[_0x1be3('0x1b')](0xcc)[_0x1be3('0x29')]();});}};}function handleEntityNotFound(_0x2befb4,_0x3af65e){return function(_0x5801a2){if(!_0x5801a2){_0x2befb4[_0x1be3('0x1a')](0x194);}return _0x5801a2;};}function handleError(_0x3fb6fc,_0x38fa87){_0x38fa87=_0x38fa87||0x1f4;return function(_0x50eb5c){logger['error'](_0x50eb5c[_0x1be3('0x2a')]);if(_0x50eb5c[_0x1be3('0x2b')]){delete _0x50eb5c[_0x1be3('0x2b')];}_0x3fb6fc[_0x1be3('0x1b')](_0x38fa87)[_0x1be3('0x2c')](_0x50eb5c);};}exports[_0x1be3('0x2d')]=function(_0x4381a0,_0x25143e){var _0x422a6f={},_0x563fd6={},_0x717417={'count':0x0,'rows':[]};var _0xfdc004=_[_0x1be3('0x2e')](db[_0x1be3('0x2f')]['rawAttributes'],function(_0x307f79){return{'name':_0x307f79['fieldName'],'type':_0x307f79[_0x1be3('0x30')][_0x1be3('0x31')]};});_0x563fd6['model']=_[_0x1be3('0x2e')](_0xfdc004,'name');_0x563fd6[_0x1be3('0x32')]=_['keys'](_0x4381a0[_0x1be3('0x32')]);_0x563fd6[_0x1be3('0x33')]=_['intersection'](_0x563fd6[_0x1be3('0x34')],_0x563fd6[_0x1be3('0x32')]);_0x422a6f[_0x1be3('0x35')]=_['intersection'](_0x563fd6[_0x1be3('0x34')],qs[_0x1be3('0x36')](_0x4381a0[_0x1be3('0x32')][_0x1be3('0x36')]));_0x422a6f['attributes']=_0x422a6f[_0x1be3('0x35')][_0x1be3('0x37')]?_0x422a6f['attributes']:_0x563fd6[_0x1be3('0x34')];if(!_0x4381a0[_0x1be3('0x32')]['hasOwnProperty']('nolimit')){_0x422a6f['limit']=qs[_0x1be3('0x1e')](_0x4381a0[_0x1be3('0x32')]['limit']);_0x422a6f[_0x1be3('0x1c')]=qs['offset'](_0x4381a0[_0x1be3('0x32')][_0x1be3('0x1c')]);}_0x422a6f['order']=qs[_0x1be3('0x38')](_0x4381a0[_0x1be3('0x32')][_0x1be3('0x38')]);_0x422a6f['where']=qs[_0x1be3('0x33')](_['pick'](_0x4381a0['query'],_0x563fd6[_0x1be3('0x33')]),_0xfdc004);if(_0x4381a0[_0x1be3('0x32')]['filter']){_0x422a6f[_0x1be3('0x39')]=_[_0x1be3('0x3a')](_0x422a6f[_0x1be3('0x39')],{'$or':_['map'](_0xfdc004,function(_0x14b846){if(_0x14b846[_0x1be3('0x30')]!==_0x1be3('0x3b')){var _0x45dacf={};_0x45dacf[_0x14b846['name']]={'$like':'%'+_0x4381a0[_0x1be3('0x32')][_0x1be3('0x3c')]+'%'};return _0x45dacf;}})});}_0x422a6f=_[_0x1be3('0x3a')]({},_0x422a6f,_0x4381a0[_0x1be3('0x3d')]);var _0x3cbbcf={'where':_0x422a6f[_0x1be3('0x39')]};return db[_0x1be3('0x2f')][_0x1be3('0x1f')](_0x3cbbcf)['then'](function(_0x264b06){_0x717417['count']=_0x264b06;if(_0x4381a0[_0x1be3('0x32')][_0x1be3('0x3e')]){_0x422a6f['include']=[{'all':!![]}];}return db['Sound'][_0x1be3('0x3f')](_0x422a6f);})['then'](function(_0x258451){_0x717417[_0x1be3('0x40')]=_0x258451;return _0x717417;})['then'](respondWithFilteredResult(_0x25143e,_0x422a6f))[_0x1be3('0x41')](handleError(_0x25143e,null));};exports[_0x1be3('0x42')]=function(_0x46e75d,_0x107035){var _0x21caf3={'raw':!![],'where':{'id':_0x46e75d[_0x1be3('0x43')]['id']}},_0x561824={};_0x561824[_0x1be3('0x34')]=_[_0x1be3('0x44')](db[_0x1be3('0x2f')][_0x1be3('0x45')]);_0x561824[_0x1be3('0x32')]=_[_0x1be3('0x44')](_0x46e75d['query']);_0x561824[_0x1be3('0x33')]=_[_0x1be3('0x46')](_0x561824[_0x1be3('0x34')],_0x561824[_0x1be3('0x32')]);_0x21caf3['attributes']=_[_0x1be3('0x46')](_0x561824[_0x1be3('0x34')],qs['fields'](_0x46e75d[_0x1be3('0x32')][_0x1be3('0x36')]));_0x21caf3[_0x1be3('0x35')]=_0x21caf3['attributes']['length']?_0x21caf3[_0x1be3('0x35')]:_0x561824[_0x1be3('0x34')];if(_0x46e75d[_0x1be3('0x32')][_0x1be3('0x3e')]){_0x21caf3[_0x1be3('0x47')]=[{'all':!![]}];}_0x21caf3=_[_0x1be3('0x3a')]({},_0x21caf3,_0x46e75d[_0x1be3('0x3d')]);return db[_0x1be3('0x2f')][_0x1be3('0x48')](_0x21caf3)[_0x1be3('0x24')](handleEntityNotFound(_0x107035,null))[_0x1be3('0x24')](respondWithResult(_0x107035,null))[_0x1be3('0x41')](handleError(_0x107035,null));};exports[_0x1be3('0x49')]=function(_0x337945,_0x262c3d,_0x582dfa){return db[_0x1be3('0x2f')][_0x1be3('0x48')]({'where':{'id':_0x337945[_0x1be3('0x43')]['id']},'attributes':[_0x1be3('0x2b'),'save_name',_0x1be3('0x4a')],'raw':!![]})[_0x1be3('0x24')](handleEntityNotFound(_0x262c3d,null))[_0x1be3('0x24')](function(_0x22e419){if(_0x22e419){if(!fs['existsSync'](path[_0x1be3('0x4b')](config[_0x1be3('0x4c')],_0x1be3('0x4d'),_0x22e419[_0x1be3('0x4e')]+'.'+_0x22e419[_0x1be3('0x4a')]))){throw new db[(_0x1be3('0x4f'))][(_0x1be3('0x50'))](_0x1be3('0x51'));}return _0x262c3d[_0x1be3('0x49')](path[_0x1be3('0x4b')](config['root'],'server/files/sounds/converted',util[_0x1be3('0x52')](_0x1be3('0x53'),_0x22e419[_0x1be3('0x4e')],_0x22e419['converted_format'])),util['format'](_0x1be3('0x53'),_0x22e419[_0x1be3('0x2b')],_0x22e419[_0x1be3('0x4a')]));}return null;})['catch'](handleError(_0x262c3d,null));};exports[_0x1be3('0x54')]=function(_0x4a1c4b,_0x5a1433,_0x5d9364){var _0x27574a={'name':path['basename'](_0x4a1c4b['file'][_0x1be3('0x55')],path[_0x1be3('0x56')](_0x4a1c4b[_0x1be3('0x57')][_0x1be3('0x55')])),'save_name':path[_0x1be3('0x58')](_0x4a1c4b[_0x1be3('0x57')][_0x1be3('0x59')],path[_0x1be3('0x56')](_0x4a1c4b['file'][_0x1be3('0x59')])),'original_format':path[_0x1be3('0x56')](_0x4a1c4b[_0x1be3('0x57')][_0x1be3('0x55')])['substring'](0x1),'converted_format':_0x1be3('0x5a')};var _0x462d8f=path[_0x1be3('0x4b')](config['root'],'server/files/sounds/original',_0x4a1c4b[_0x1be3('0x57')][_0x1be3('0x59')]);var _0x431278=path[_0x1be3('0x4b')](config['root'],'server/files/sounds/converted',util[_0x1be3('0x52')](_0x1be3('0x53'),path[_0x1be3('0x58')](_0x4a1c4b[_0x1be3('0x57')][_0x1be3('0x59')],path['extname'](_0x4a1c4b[_0x1be3('0x57')][_0x1be3('0x59')])),_0x27574a[_0x1be3('0x4a')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x462d8f);logger[_0x1be3('0x5b')](_0x1be3('0x5c'),_0x431278);try{fs[_0x1be3('0x5d')](_0x462d8f,parseInt(_0x1be3('0x5e'),0x8));var _0x5f0f77=sox[_0x1be3('0x5f')](_0x462d8f,_0x431278,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5f0f77['on'](_0x1be3('0x60'),function(_0x458e96){fs[_0x1be3('0x61')](_0x462d8f);_0x5a1433[_0x1be3('0x1b')](0x1f4)['send'](_0x458e96);});_0x5f0f77['on'](_0x1be3('0x62'),function(_0x264a2c){_0x27574a[_0x1be3('0x63')]=isNaN(_0x264a2c[_0x1be3('0x64')])?null:_0x264a2c['duration']*0x3e8;_0x27574a[_0x1be3('0x65')]=isNaN(_0x264a2c[_0x1be3('0x66')])?null:_0x264a2c[_0x1be3('0x66')];_0x27574a[_0x1be3('0x67')]=isNaN(_0x264a2c[_0x1be3('0x68')])?null:_0x264a2c['channelCount'];_0x27574a['original_bitRate']=isNaN(_0x264a2c['bitRate'])?null:_0x264a2c[_0x1be3('0x69')];_0x27574a['original_sampleRate']=isNaN(_0x264a2c['sampleRate'])?null:_0x264a2c[_0x1be3('0x6a')];});_0x5f0f77['on'](_0x1be3('0x6b'),function(_0x43f9fd){_0x27574a['converted_duration']=isNaN(_0x43f9fd[_0x1be3('0x64')])?null:_0x43f9fd['duration']*0x3e8;_0x27574a[_0x1be3('0x6c')]=isNaN(_0x43f9fd[_0x1be3('0x66')])?null:_0x43f9fd['sampleCount'];_0x27574a[_0x1be3('0x6d')]=isNaN(_0x43f9fd[_0x1be3('0x68')])?null:_0x43f9fd[_0x1be3('0x68')];_0x27574a[_0x1be3('0x6e')]=isNaN(_0x43f9fd[_0x1be3('0x69')])?null:_0x43f9fd[_0x1be3('0x69')];_0x27574a['converted_sampleRate']=isNaN(_0x43f9fd[_0x1be3('0x6a')])?null:_0x43f9fd[_0x1be3('0x6a')];});_0x5f0f77['on'](_0x1be3('0x29'),function(){fs[_0x1be3('0x5d')](_0x431278,parseInt(_0x1be3('0x5e'),0x8));return db[_0x1be3('0x2f')][_0x1be3('0x54')](_0x27574a)[_0x1be3('0x24')](function(_0x35b4a2){var _0x432d65={'role':_0x4a1c4b[_0x1be3('0x6f')][_0x1be3('0x70')],'userProfileId':_0x4a1c4b['body'][_0x1be3('0x71')]};if(!_0x432d65)throw new Error(_0x1be3('0x72'));if(_0x432d65[_0x1be3('0x70')]==='user'){var _0xe3871c=_0x35b4a2[_0x1be3('0x26')]({'plain':!![]});return db[_0x1be3('0x73')][_0x1be3('0x48')]({'where':{'name':'Sounds','userProfileId':_0x432d65['userProfileId']},'raw':!![]})[_0x1be3('0x24')](function(_0x441b8e){if(_0x441b8e&&_0x441b8e[_0x1be3('0x74')]===0x0){return db[_0x1be3('0x28')]['create']({'name':_0xe3871c[_0x1be3('0x2b')],'resourceId':_0xe3871c['id'],'type':_0x441b8e['name'],'sectionId':_0x441b8e['id']},{})[_0x1be3('0x24')](function(){return _0x35b4a2;});}else{return _0x35b4a2;}})['catch'](function(_0x542763){logger[_0x1be3('0x60')](_0x1be3('0x75'),_0x542763);throw _0x542763;});}return _0x35b4a2;})[_0x1be3('0x24')](respondWithResult(_0x5a1433,null))[_0x1be3('0x41')](handleError(_0x5a1433,null));});_0x5f0f77[_0x1be3('0x76')]();}catch(_0x31ffdf){_0x5a1433[_0x1be3('0x1b')](0x1f4)[_0x1be3('0x2c')](_0x31ffdf);}};exports['update']=function(_0x456ec3,_0x13d5a7,_0x259fba){return db[_0x1be3('0x2f')][_0x1be3('0x48')]({'where':{'id':_0x456ec3[_0x1be3('0x43')]['id']}})[_0x1be3('0x24')](handleEntityNotFound(_0x13d5a7,null))[_0x1be3('0x24')](saveUpdates(_['pick'](_0x456ec3['body'],[_0x1be3('0x2b'),'description']),null))[_0x1be3('0x24')](respondWithResult(_0x13d5a7,null))[_0x1be3('0x41')](handleError(_0x13d5a7,null));};exports['delete']=function(_0x197f33,_0x4436d7,_0x1aaa5f){return db[_0x1be3('0x2f')]['find']({'where':{'id':_0x197f33[_0x1be3('0x43')]['id']}})[_0x1be3('0x24')](function(_0x13af52){if(_0x13af52){return _0x13af52[_0x1be3('0x25')]();}})[_0x1be3('0x24')](function(_0x13ab41){var _0x5906ea=path[_0x1be3('0x4b')](config[_0x1be3('0x4c')],_0x1be3('0x77'),util[_0x1be3('0x52')]('%s.%s',_0x13ab41[_0x1be3('0x4e')],_0x13ab41[_0x1be3('0x78')]));var _0x48baa6=path[_0x1be3('0x4b')](config[_0x1be3('0x4c')],'server/files/sounds/converted',util[_0x1be3('0x52')]('%s.%s',_0x13ab41[_0x1be3('0x4e')],_0x13ab41[_0x1be3('0x4a')]));fs[_0x1be3('0x61')](_0x5906ea);fs['unlinkSync'](_0x48baa6);return _0x13ab41;})[_0x1be3('0x24')](function(_0x34f7b9){if(_0x34f7b9){return _0x4436d7[_0x1be3('0x1b')](0xcc)[_0x1be3('0x29')]();}})[_0x1be3('0x24')](handleEntityNotFound(_0x4436d7,null))[_0x1be3('0x41')](handleError(_0x4436d7,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 5b749aa..ca68a96 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 _0x1cae=['moment','rimraf','exports','Sound','lodash','util','../../config/logger','api'];(function(_0x4be24f,_0x2b4b23){var _0x5ce2c3=function(_0x4f6829){while(--_0x4f6829){_0x4be24f['push'](_0x4be24f['shift']());}};_0x5ce2c3(++_0x2b4b23);}(_0x1cae,0x11c));var _0xe1ca=function(_0x4cbd85,_0x3c4c4f){_0x4cbd85=_0x4cbd85-0x0;var _0x1e9cba=_0x1cae[_0x4cbd85];return _0x1e9cba;};'use strict';var _=require(_0xe1ca('0x0'));var util=require(_0xe1ca('0x1'));var logger=require(_0xe1ca('0x2'))(_0xe1ca('0x3'));var moment=require(_0xe1ca('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1ca('0x5'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0xe1ca('0x6')]=function(_0x463149,_0x24d113){return _0x463149['define'](_0xe1ca('0x7'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe289=['define','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x182d14,_0x21c99e){var _0x1a7400=function(_0x42de89){while(--_0x42de89){_0x182d14['push'](_0x182d14['shift']());}};_0x1a7400(++_0x21c99e);}(_0xe289,0x8f));var _0x9e28=function(_0x35116d,_0x30c8c7){_0x35116d=_0x35116d-0x0;var _0x16b2ab=_0xe289[_0x35116d];return _0x16b2ab;};'use strict';var _=require(_0x9e28('0x0'));var util=require(_0x9e28('0x1'));var logger=require(_0x9e28('0x2'))(_0x9e28('0x3'));var moment=require('moment');var BPromise=require(_0x9e28('0x4'));var rp=require(_0x9e28('0x5'));var fs=require('fs');var path=require(_0x9e28('0x6'));var rimraf=require(_0x9e28('0x7'));var config=require(_0x9e28('0x8'));var attributes=require(_0x9e28('0x9'));module[_0x9e28('0xa')]=function(_0x2f30c5,_0x288276){return _0x2f30c5[_0x9e28('0xb')](_0x9e28('0xc'),attributes,{'tableName':_0x9e28('0xd'),'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 b2a7985..ab8fce8 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 _0xf2c0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','options','where','attributes','model','include','map','stringify','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf2c0,0x9f));var _0x0f2c=function(_0xa6dac,_0x463a69){_0xa6dac=_0xa6dac-0x0;var _0x2e1551=_0xf2c0[_0xa6dac];return _0x2e1551;};'use strict';var _=require(_0x0f2c('0x0'));var util=require(_0x0f2c('0x1'));var moment=require(_0x0f2c('0x2'));var BPromise=require(_0x0f2c('0x3'));var rs=require(_0x0f2c('0x4'));var fs=require('fs');var Redis=require(_0x0f2c('0x5'));var db=require(_0x0f2c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f2c('0x7'))(_0x0f2c('0x8'));var config=require(_0x0f2c('0x9'));var jayson=require(_0x0f2c('0xa'));var client=jayson[_0x0f2c('0xb')][_0x0f2c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x137127,_0x2a7242,_0x480acf){return new BPromise(function(_0x1e16d4,_0x30ab8e){return client['request'](_0x137127,_0x480acf)[_0x0f2c('0xd')](function(_0x56997c){logger[_0x0f2c('0xe')]('Sound,\x20%s,\x20%s',_0x2a7242,_0x0f2c('0xf'));logger['debug'](_0x0f2c('0x10'),_0x2a7242,'request\x20sent',JSON['stringify'](_0x56997c));if(_0x56997c[_0x0f2c('0x11')]){if(_0x56997c[_0x0f2c('0x11')][_0x0f2c('0x12')]===0x1f4){logger[_0x0f2c('0x11')](_0x0f2c('0x13'),_0x2a7242,_0x56997c['error']['message']);return _0x30ab8e(_0x56997c[_0x0f2c('0x11')][_0x0f2c('0x14')]);}logger['error']('Sound,\x20%s,\x20%s',_0x2a7242,_0x56997c[_0x0f2c('0x11')][_0x0f2c('0x14')]);return _0x1e16d4(_0x56997c['error'][_0x0f2c('0x14')]);}else{logger[_0x0f2c('0xe')](_0x0f2c('0x13'),_0x2a7242,_0x0f2c('0xf'));_0x1e16d4(_0x56997c[_0x0f2c('0x15')]['message']);}})[_0x0f2c('0x16')](function(_0xdcb3be){logger[_0x0f2c('0x11')]('Sound,\x20%s,\x20%s',_0x2a7242,_0xdcb3be);_0x30ab8e(_0xdcb3be);});});}exports[_0x0f2c('0x17')]=function(_0x177319){var _0x4f6114=this;return new Promise(function(_0x27c36b,_0x368bef){return db[_0x0f2c('0x18')]['find']({'raw':_0x177319[_0x0f2c('0x19')]?_0x177319[_0x0f2c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x177319[_0x0f2c('0x19')]?_0x177319[_0x0f2c('0x19')][_0x0f2c('0x1a')]||null:null,'attributes':_0x177319[_0x0f2c('0x19')]?_0x177319['options'][_0x0f2c('0x1b')]||null:null,'include':_0x177319[_0x0f2c('0x19')]?_0x177319[_0x0f2c('0x19')]['include']?_['map'](_0x177319[_0x0f2c('0x19')]['include'],function(_0x2a9efa){return{'model':db[_0x2a9efa[_0x0f2c('0x1c')]],'as':_0x2a9efa['as'],'attributes':_0x2a9efa['attributes'],'include':_0x2a9efa[_0x0f2c('0x1d')]?_[_0x0f2c('0x1e')](_0x2a9efa[_0x0f2c('0x1d')],function(_0x318a11){return{'model':db[_0x318a11[_0x0f2c('0x1c')]],'as':_0x318a11['as'],'attributes':_0x318a11[_0x0f2c('0x1b')],'include':_0x318a11[_0x0f2c('0x1d')]?_['map'](_0x318a11['include'],function(_0x367a33){return{'model':db[_0x367a33['model']],'as':_0x367a33['as'],'attributes':_0x367a33[_0x0f2c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0f2c('0xd')](function(_0x4a3991){logger['info'](_0x0f2c('0x17'),_0x177319);logger['debug'](_0x0f2c('0x17'),_0x177319,JSON[_0x0f2c('0x1f')](_0x4a3991));_0x27c36b(_0x4a3991);})['catch'](function(_0x1c8561){logger['error'](_0x0f2c('0x17'),_0x1c8561[_0x0f2c('0x14')],_0x177319);_0x368bef(_0x4f6114[_0x0f2c('0x11')](0x1f4,_0x1c8561['message']));});});}; \ No newline at end of file +var _0x47f1=['Sound','options','attributes','include','map','model','stringify','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSound'];(function(_0x4a5520,_0xaa8ed9){var _0x50d96e=function(_0x1b387c){while(--_0x1b387c){_0x4a5520['push'](_0x4a5520['shift']());}};_0x50d96e(++_0xaa8ed9);}(_0x47f1,0x174));var _0x147f=function(_0x513c84,_0x3e5390){_0x513c84=_0x513c84-0x0;var _0x2f2c2b=_0x47f1[_0x513c84];return _0x2f2c2b;};'use strict';var _=require(_0x147f('0x0'));var util=require(_0x147f('0x1'));var moment=require(_0x147f('0x2'));var BPromise=require(_0x147f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x147f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x147f('0x5'))(_0x147f('0x6'));var config=require(_0x147f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x147f('0x8')][_0x147f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb9a8d0,_0x1d912e,_0x18258a){return new BPromise(function(_0x37cb53,_0x5e27d8){return client[_0x147f('0xa')](_0xb9a8d0,_0x18258a)['then'](function(_0xee63ff){logger[_0x147f('0xb')](_0x147f('0xc'),_0x1d912e,_0x147f('0xd'));logger['debug'](_0x147f('0xe'),_0x1d912e,_0x147f('0xd'),JSON['stringify'](_0xee63ff));if(_0xee63ff[_0x147f('0xf')]){if(_0xee63ff[_0x147f('0xf')][_0x147f('0x10')]===0x1f4){logger[_0x147f('0xf')](_0x147f('0xc'),_0x1d912e,_0xee63ff[_0x147f('0xf')][_0x147f('0x11')]);return _0x5e27d8(_0xee63ff['error'][_0x147f('0x11')]);}logger[_0x147f('0xf')]('Sound,\x20%s,\x20%s',_0x1d912e,_0xee63ff[_0x147f('0xf')][_0x147f('0x11')]);return _0x37cb53(_0xee63ff['error'][_0x147f('0x11')]);}else{logger[_0x147f('0xb')](_0x147f('0xc'),_0x1d912e,'request\x20sent');_0x37cb53(_0xee63ff[_0x147f('0x12')][_0x147f('0x11')]);}})['catch'](function(_0x20e987){logger['error']('Sound,\x20%s,\x20%s',_0x1d912e,_0x20e987);_0x5e27d8(_0x20e987);});});}exports[_0x147f('0x13')]=function(_0x3e717a){var _0x4e229b=this;return new Promise(function(_0x2cd842,_0x3af574){return db[_0x147f('0x14')]['find']({'raw':_0x3e717a[_0x147f('0x15')]?_0x3e717a[_0x147f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3e717a[_0x147f('0x15')]?_0x3e717a[_0x147f('0x15')]['where']||null:null,'attributes':_0x3e717a['options']?_0x3e717a['options'][_0x147f('0x16')]||null:null,'include':_0x3e717a['options']?_0x3e717a[_0x147f('0x15')][_0x147f('0x17')]?_[_0x147f('0x18')](_0x3e717a[_0x147f('0x15')][_0x147f('0x17')],function(_0xfb2f9b){return{'model':db[_0xfb2f9b['model']],'as':_0xfb2f9b['as'],'attributes':_0xfb2f9b[_0x147f('0x16')],'include':_0xfb2f9b[_0x147f('0x17')]?_[_0x147f('0x18')](_0xfb2f9b[_0x147f('0x17')],function(_0x256160){return{'model':db[_0x256160['model']],'as':_0x256160['as'],'attributes':_0x256160[_0x147f('0x16')],'include':_0x256160[_0x147f('0x17')]?_['map'](_0x256160[_0x147f('0x17')],function(_0x2b7ab6){return{'model':db[_0x2b7ab6[_0x147f('0x19')]],'as':_0x2b7ab6['as'],'attributes':_0x2b7ab6[_0x147f('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xea3274){logger[_0x147f('0xb')](_0x147f('0x13'),_0x3e717a);logger['debug'](_0x147f('0x13'),_0x3e717a,JSON[_0x147f('0x1a')](_0xea3274));_0x2cd842(_0xea3274);})[_0x147f('0x1b')](function(_0xd4e232){logger[_0x147f('0xf')](_0x147f('0x13'),_0xd4e232[_0x147f('0x11')],_0x3e717a);_0x3af574(_0x4e229b['error'](0x1f4,_0xd4e232[_0x147f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f618d72..f0a472d 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(_0x1ca122,_0x5cab7c){var _0x50d1ba=function(_0x562ae9){while(--_0x562ae9){_0x1ca122['push'](_0x1ca122['shift']());}};_0x50d1ba(++_0x5cab7c);}(_0xda2d,0x102));var _0xdda2=function(_0x19dcf9,_0x3e0613){_0x19dcf9=_0x19dcf9-0x0;var _0xf094b3=_0xda2d[_0x19dcf9];return _0xf094b3;};'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 _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3be18a,_0x168c54){var _0x280b3b=function(_0x3152ec){while(--_0x3152ec){_0x3be18a['push'](_0x3be18a['shift']());}};_0x280b3b(++_0x168c54);}(_0xac4a,0x13f));var _0xaac4=function(_0x2716f0,_0x45b002){_0x2716f0=_0x2716f0-0x0;var _0x4cb4ba=_0xac4a[_0x2716f0];return _0x4cb4ba;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index ba6e152..7ca307e 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 _0x2ef4=['out','exports','STRING','TEXT','medium','ENUM'];(function(_0x370c57,_0x5023b9){var _0x5d3b28=function(_0x19104b){while(--_0x19104b){_0x370c57['push'](_0x370c57['shift']());}};_0x5d3b28(++_0x5023b9);}(_0x2ef4,0xe5));var _0x42ef=function(_0x59a135,_0x5316d8){_0x59a135=_0x59a135-0x0;var _0x3cd388=_0x2ef4[_0x59a135];return _0x3cd388;};'use strict';var Sequelize=require('sequelize');module[_0x42ef('0x0')]={'uniqueid':{'type':Sequelize[_0x42ef('0x1')]},'body':{'type':Sequelize[_0x42ef('0x2')](_0x42ef('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x42ef('0x4')]('in',_0x42ef('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x42ef('0x1')]},'providerResponse':{'type':Sequelize[_0x42ef('0x2')]}}; \ No newline at end of file +var _0x87f4=['out','exports','STRING','medium','ENUM'];(function(_0x1abb18,_0x3960ec){var _0x2a4e44=function(_0x15895d){while(--_0x15895d){_0x1abb18['push'](_0x1abb18['shift']());}};_0x2a4e44(++_0x3960ec);}(_0x87f4,0x17d));var _0x487f=function(_0x5c1932,_0x5b1a24){_0x5c1932=_0x5c1932-0x0;var _0x2e8728=_0x87f4[_0x5c1932];return _0x2e8728;};'use strict';var Sequelize=require('sequelize');module[_0x487f('0x0')]={'uniqueid':{'type':Sequelize[_0x487f('0x1')]},'body':{'type':Sequelize['TEXT'](_0x487f('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x487f('0x3')]('in',_0x487f('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x487f('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 3accd8a..97d7572 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 _0x5d2f=['end','json','offset','limit','count','Content-Range','apply','save','then','destroy','error','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2a0a14,_0x21f6e2){var _0x22736e=function(_0x3efdf1){while(--_0x3efdf1){_0x2a0a14['push'](_0x2a0a14['shift']());}};_0x22736e(++_0x21f6e2);}(_0x5d2f,0x17d));var _0xf5d2=function(_0x21c09f,_0x6ce866){_0x21c09f=_0x21c09f-0x0;var _0x164d58=_0x5d2f[_0x21c09f];return _0x164d58;};'use strict';var emlformat=require(_0xf5d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5d2('0x1'));var jsonpatch=require(_0xf5d2('0x2'));var rp=require(_0xf5d2('0x3'));var moment=require(_0xf5d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf5d2('0x5'));var util=require(_0xf5d2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf5d2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5d2('0x8'));var _=require(_0xf5d2('0x9'));var squel=require(_0xf5d2('0xa'));var crypto=require('crypto');var jsforce=require(_0xf5d2('0xb'));var deskjs=require(_0xf5d2('0xc'));var toCsv=require(_0xf5d2('0x7'));var querystring=require(_0xf5d2('0xd'));var Papa=require(_0xf5d2('0xe'));var Redis=require(_0xf5d2('0xf'));var authService=require(_0xf5d2('0x10'));var qs=require(_0xf5d2('0x11'));var as=require(_0xf5d2('0x12'));var hardwareService=require(_0xf5d2('0x13'));var logger=require(_0xf5d2('0x14'))('api');var utils=require(_0xf5d2('0x15'));var config=require(_0xf5d2('0x16'));var licenseUtil=require(_0xf5d2('0x17'));var db=require(_0xf5d2('0x18'))['db'];function respondWithStatusCode(_0x862893,_0x45a78b){_0x45a78b=_0x45a78b||0xcc;return function(_0x18643d){if(_0x18643d){return _0x862893[_0xf5d2('0x19')](_0x45a78b);}return _0x862893[_0xf5d2('0x1a')](_0x45a78b)[_0xf5d2('0x1b')]();};}function respondWithResult(_0x4e3dbe,_0x3feeae){_0x3feeae=_0x3feeae||0xc8;return function(_0x235d16){if(_0x235d16){return _0x4e3dbe[_0xf5d2('0x1a')](_0x3feeae)[_0xf5d2('0x1c')](_0x235d16);}};}function respondWithFilteredResult(_0x19ff31,_0x10ebe5){return function(_0x1925d0){if(_0x1925d0){var _0x294af7=typeof _0x10ebe5[_0xf5d2('0x1d')]==='undefined'&&typeof _0x10ebe5[_0xf5d2('0x1e')]==='undefined';var _0x4feb1e=_0x1925d0[_0xf5d2('0x1f')];var _0xcce1ad=_0x294af7?0x0:_0x10ebe5[_0xf5d2('0x1d')];var _0x1f1d54=_0x294af7?_0x1925d0[_0xf5d2('0x1f')]:_0x10ebe5[_0xf5d2('0x1d')]+_0x10ebe5[_0xf5d2('0x1e')];var _0x20623c;if(_0x1f1d54>=_0x4feb1e){_0x1f1d54=_0x4feb1e;_0x20623c=0xc8;}else{_0x20623c=0xce;}_0x19ff31[_0xf5d2('0x1a')](_0x20623c);return _0x19ff31['set'](_0xf5d2('0x20'),_0xcce1ad+'-'+_0x1f1d54+'/'+_0x4feb1e)[_0xf5d2('0x1c')](_0x1925d0);}return null;};}function patchUpdates(_0x2b46ef){return function(_0x451743){try{jsonpatch[_0xf5d2('0x21')](_0x451743,_0x2b46ef,!![]);}catch(_0x2c5a3e){return BPromise['reject'](_0x2c5a3e);}return _0x451743[_0xf5d2('0x22')]();};}function saveUpdates(_0x1805e7,_0x446b27){return function(_0x43e3d4){if(_0x43e3d4){return _0x43e3d4['update'](_0x1805e7)[_0xf5d2('0x23')](function(_0x380234){return _0x380234;});}return null;};}function removeEntity(_0x1acdd1,_0x23dd3d){return function(_0xcbe249){if(_0xcbe249){return _0xcbe249[_0xf5d2('0x24')]()['then'](function(){_0x1acdd1[_0xf5d2('0x1a')](0xcc)[_0xf5d2('0x1b')]();});}};}function handleEntityNotFound(_0x285c31,_0x14c57a){return function(_0x5b07d0){if(!_0x5b07d0){_0x285c31[_0xf5d2('0x19')](0x194);}return _0x5b07d0;};}function handleError(_0x2e35e7,_0x2733eb){_0x2733eb=_0x2733eb||0x1f4;return function(_0x5f04ef){logger[_0xf5d2('0x25')](_0x5f04ef['stack']);if(_0x5f04ef[_0xf5d2('0x26')]){delete _0x5f04ef[_0xf5d2('0x26')];}_0x2e35e7[_0xf5d2('0x1a')](_0x2733eb)['send'](_0x5f04ef);};}exports[_0xf5d2('0x27')]=function(_0x5a4ce6,_0x4db99c){var _0x217a7e={},_0x581a79={},_0x4c9bb0={'count':0x0,'rows':[]};var _0x56f99c=_[_0xf5d2('0x28')](db[_0xf5d2('0x29')][_0xf5d2('0x2a')],function(_0x29727b){return{'name':_0x29727b[_0xf5d2('0x2b')],'type':_0x29727b[_0xf5d2('0x2c')][_0xf5d2('0x2d')]};});_0x581a79[_0xf5d2('0x2e')]=_['map'](_0x56f99c,'name');_0x581a79[_0xf5d2('0x2f')]=_[_0xf5d2('0x30')](_0x5a4ce6[_0xf5d2('0x2f')]);_0x581a79[_0xf5d2('0x31')]=_[_0xf5d2('0x32')](_0x581a79['model'],_0x581a79[_0xf5d2('0x2f')]);_0x217a7e[_0xf5d2('0x33')]=_['intersection'](_0x581a79[_0xf5d2('0x2e')],qs['fields'](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x34')]));_0x217a7e[_0xf5d2('0x33')]=_0x217a7e[_0xf5d2('0x33')][_0xf5d2('0x35')]?_0x217a7e[_0xf5d2('0x33')]:_0x581a79['model'];if(!_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x36')]('nolimit')){_0x217a7e[_0xf5d2('0x1e')]=qs[_0xf5d2('0x1e')](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x1e')]);_0x217a7e[_0xf5d2('0x1d')]=qs[_0xf5d2('0x1d')](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x1d')]);}_0x217a7e['order']=qs['sort'](_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x37')]);_0x217a7e[_0xf5d2('0x38')]=qs[_0xf5d2('0x31')](_['pick'](_0x5a4ce6['query'],_0x581a79['filters']),_0x56f99c);if(_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x39')]){_0x217a7e[_0xf5d2('0x38')]=_[_0xf5d2('0x3a')](_0x217a7e['where'],{'$or':_[_0xf5d2('0x28')](_0x56f99c,function(_0x225e2b){if(_0x225e2b[_0xf5d2('0x2c')]!=='VIRTUAL'){var _0x21959b={};_0x21959b[_0x225e2b[_0xf5d2('0x26')]]={'$like':'%'+_0x5a4ce6[_0xf5d2('0x2f')][_0xf5d2('0x39')]+'%'};return _0x21959b;}})});}_0x217a7e=_[_0xf5d2('0x3a')]({},_0x217a7e,_0x5a4ce6[_0xf5d2('0x3b')]);var _0x1c8d0e={'where':_0x217a7e['where']};return db['SquareMessage'][_0xf5d2('0x1f')](_0x1c8d0e)[_0xf5d2('0x23')](function(_0x23bfbf){_0x4c9bb0[_0xf5d2('0x1f')]=_0x23bfbf;if(_0x5a4ce6['query'][_0xf5d2('0x3c')]){_0x217a7e[_0xf5d2('0x3d')]=[{'all':!![]}];}return db[_0xf5d2('0x29')][_0xf5d2('0x3e')](_0x217a7e);})['then'](function(_0x23dc08){_0x4c9bb0['rows']=_0x23dc08;return _0x4c9bb0;})[_0xf5d2('0x23')](respondWithFilteredResult(_0x4db99c,_0x217a7e))[_0xf5d2('0x3f')](handleError(_0x4db99c,null));};exports['show']=function(_0x5b8645,_0x1b2faa){var _0x115957={'raw':!![],'where':{'id':_0x5b8645[_0xf5d2('0x40')]['id']}},_0x1d2914={};_0x1d2914[_0xf5d2('0x2e')]=_['keys'](db[_0xf5d2('0x29')][_0xf5d2('0x2a')]);_0x1d2914['query']=_[_0xf5d2('0x30')](_0x5b8645[_0xf5d2('0x2f')]);_0x1d2914[_0xf5d2('0x31')]=_[_0xf5d2('0x32')](_0x1d2914[_0xf5d2('0x2e')],_0x1d2914[_0xf5d2('0x2f')]);_0x115957[_0xf5d2('0x33')]=_[_0xf5d2('0x32')](_0x1d2914['model'],qs[_0xf5d2('0x34')](_0x5b8645[_0xf5d2('0x2f')][_0xf5d2('0x34')]));_0x115957[_0xf5d2('0x33')]=_0x115957[_0xf5d2('0x33')][_0xf5d2('0x35')]?_0x115957[_0xf5d2('0x33')]:_0x1d2914[_0xf5d2('0x2e')];if(_0x5b8645['query'][_0xf5d2('0x3c')]){_0x115957[_0xf5d2('0x3d')]=[{'all':!![]}];}_0x115957=_['merge']({},_0x115957,_0x5b8645[_0xf5d2('0x3b')]);return db[_0xf5d2('0x29')][_0xf5d2('0x41')](_0x115957)[_0xf5d2('0x23')](handleEntityNotFound(_0x1b2faa,null))[_0xf5d2('0x23')](respondWithResult(_0x1b2faa,null))[_0xf5d2('0x3f')](handleError(_0x1b2faa,null));};exports[_0xf5d2('0x42')]=function(_0x23a0bc,_0x5e4115){return db[_0xf5d2('0x29')][_0xf5d2('0x42')](_0x23a0bc[_0xf5d2('0x43')],{})[_0xf5d2('0x23')](respondWithResult(_0x5e4115,0xc9))[_0xf5d2('0x3f')](handleError(_0x5e4115,null));};exports['update']=function(_0x4b2b6e,_0x37b3e0){if(_0x4b2b6e['body']['id']){delete _0x4b2b6e[_0xf5d2('0x43')]['id'];}return db[_0xf5d2('0x29')][_0xf5d2('0x41')]({'where':{'id':_0x4b2b6e['params']['id']}})[_0xf5d2('0x23')](handleEntityNotFound(_0x37b3e0,null))[_0xf5d2('0x23')](saveUpdates(_0x4b2b6e[_0xf5d2('0x43')],null))[_0xf5d2('0x23')](respondWithResult(_0x37b3e0,null))[_0xf5d2('0x3f')](handleError(_0x37b3e0,null));};exports['destroy']=function(_0x831fcd,_0x1a14db){return db[_0xf5d2('0x29')][_0xf5d2('0x41')]({'where':{'id':_0x831fcd['params']['id']}})[_0xf5d2('0x23')](handleEntityNotFound(_0x1a14db,null))[_0xf5d2('0x23')](removeEntity(_0x1a14db,null))[_0xf5d2('0x3f')](handleError(_0x1a14db,null));}; \ No newline at end of file +var _0x1af1=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','index','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','destroy','eml-format'];(function(_0x159044,_0x34e696){var _0x3e8369=function(_0x435dfd){while(--_0x435dfd){_0x159044['push'](_0x159044['shift']());}};_0x3e8369(++_0x34e696);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x11af('0x0'));var rimraf=require(_0x11af('0x1'));var zipdir=require(_0x11af('0x2'));var jsonpatch=require(_0x11af('0x3'));var rp=require(_0x11af('0x4'));var moment=require(_0x11af('0x5'));var BPromise=require(_0x11af('0x6'));var Mustache=require(_0x11af('0x7'));var util=require(_0x11af('0x8'));var path=require(_0x11af('0x9'));var sox=require('sox');var csv=require(_0x11af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11af('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x11af('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x11af('0xd'));var toCsv=require('to-csv');var querystring=require(_0x11af('0xe'));var Papa=require(_0x11af('0xf'));var Redis=require(_0x11af('0x10'));var authService=require(_0x11af('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x11af('0x12'));var hardwareService=require(_0x11af('0x13'));var logger=require(_0x11af('0x14'))(_0x11af('0x15'));var utils=require(_0x11af('0x16'));var config=require(_0x11af('0x17'));var licenseUtil=require(_0x11af('0x18'));var db=require(_0x11af('0x19'))['db'];function respondWithStatusCode(_0x3a91d0,_0x4c0628){_0x4c0628=_0x4c0628||0xcc;return function(_0x4ea9c1){if(_0x4ea9c1){return _0x3a91d0[_0x11af('0x1a')](_0x4c0628);}return _0x3a91d0[_0x11af('0x1b')](_0x4c0628)[_0x11af('0x1c')]();};}function respondWithResult(_0x573aae,_0x3f1771){_0x3f1771=_0x3f1771||0xc8;return function(_0xe586c4){if(_0xe586c4){return _0x573aae['status'](_0x3f1771)[_0x11af('0x1d')](_0xe586c4);}};}function respondWithFilteredResult(_0x285563,_0x2292c8){return function(_0x23ed21){if(_0x23ed21){var _0x27b563=typeof _0x2292c8[_0x11af('0x1e')]===_0x11af('0x1f')&&typeof _0x2292c8[_0x11af('0x20')]===_0x11af('0x1f');var _0x12e78c=_0x23ed21[_0x11af('0x21')];var _0x9bbc2d=_0x27b563?0x0:_0x2292c8[_0x11af('0x1e')];var _0x27a6b8=_0x27b563?_0x23ed21[_0x11af('0x21')]:_0x2292c8[_0x11af('0x1e')]+_0x2292c8[_0x11af('0x20')];var _0xa557f7;if(_0x27a6b8>=_0x12e78c){_0x27a6b8=_0x12e78c;_0xa557f7=0xc8;}else{_0xa557f7=0xce;}_0x285563[_0x11af('0x1b')](_0xa557f7);return _0x285563[_0x11af('0x22')]('Content-Range',_0x9bbc2d+'-'+_0x27a6b8+'/'+_0x12e78c)[_0x11af('0x1d')](_0x23ed21);}return null;};}function patchUpdates(_0x2e2bf5){return function(_0x5a16e5){try{jsonpatch[_0x11af('0x23')](_0x5a16e5,_0x2e2bf5,!![]);}catch(_0x204333){return BPromise[_0x11af('0x24')](_0x204333);}return _0x5a16e5[_0x11af('0x25')]();};}function saveUpdates(_0x4c3f45,_0x2f7ac8){return function(_0x3fa89f){if(_0x3fa89f){return _0x3fa89f[_0x11af('0x26')](_0x4c3f45)[_0x11af('0x27')](function(_0x514ea8){return _0x514ea8;});}return null;};}function removeEntity(_0x8eeed,_0x61a534){return function(_0x1b1110){if(_0x1b1110){return _0x1b1110['destroy']()[_0x11af('0x27')](function(){_0x8eeed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ef63,_0x2dc1a0){return function(_0x3d2170){if(!_0x3d2170){_0x57ef63[_0x11af('0x1a')](0x194);}return _0x3d2170;};}function handleError(_0x3c1068,_0x34633c){_0x34633c=_0x34633c||0x1f4;return function(_0x20fedb){logger[_0x11af('0x28')](_0x20fedb[_0x11af('0x29')]);if(_0x20fedb[_0x11af('0x2a')]){delete _0x20fedb[_0x11af('0x2a')];}_0x3c1068[_0x11af('0x1b')](_0x34633c)['send'](_0x20fedb);};}exports[_0x11af('0x2b')]=function(_0x15f2ee,_0x31e05e){var _0x11eafc={},_0xfc1d23={},_0x4bdc20={'count':0x0,'rows':[]};var _0x2d0dcb=_['map'](db[_0x11af('0x2c')][_0x11af('0x2d')],function(_0x154e61){return{'name':_0x154e61[_0x11af('0x2e')],'type':_0x154e61[_0x11af('0x2f')][_0x11af('0x30')]};});_0xfc1d23[_0x11af('0x31')]=_['map'](_0x2d0dcb,_0x11af('0x2a'));_0xfc1d23[_0x11af('0x32')]=_[_0x11af('0x33')](_0x15f2ee[_0x11af('0x32')]);_0xfc1d23[_0x11af('0x34')]=_['intersection'](_0xfc1d23[_0x11af('0x31')],_0xfc1d23[_0x11af('0x32')]);_0x11eafc['attributes']=_[_0x11af('0x35')](_0xfc1d23['model'],qs[_0x11af('0x36')](_0x15f2ee[_0x11af('0x32')][_0x11af('0x36')]));_0x11eafc[_0x11af('0x37')]=_0x11eafc['attributes'][_0x11af('0x38')]?_0x11eafc[_0x11af('0x37')]:_0xfc1d23[_0x11af('0x31')];if(!_0x15f2ee['query']['hasOwnProperty']('nolimit')){_0x11eafc[_0x11af('0x20')]=qs[_0x11af('0x20')](_0x15f2ee['query']['limit']);_0x11eafc[_0x11af('0x1e')]=qs[_0x11af('0x1e')](_0x15f2ee['query'][_0x11af('0x1e')]);}_0x11eafc[_0x11af('0x39')]=qs[_0x11af('0x3a')](_0x15f2ee[_0x11af('0x32')]['sort']);_0x11eafc[_0x11af('0x3b')]=qs[_0x11af('0x34')](_[_0x11af('0x3c')](_0x15f2ee[_0x11af('0x32')],_0xfc1d23['filters']),_0x2d0dcb);if(_0x15f2ee[_0x11af('0x32')][_0x11af('0x3d')]){_0x11eafc[_0x11af('0x3b')]=_['merge'](_0x11eafc[_0x11af('0x3b')],{'$or':_[_0x11af('0x3e')](_0x2d0dcb,function(_0x2f4c99){if(_0x2f4c99['type']!==_0x11af('0x3f')){var _0x155dba={};_0x155dba[_0x2f4c99['name']]={'$like':'%'+_0x15f2ee['query'][_0x11af('0x3d')]+'%'};return _0x155dba;}})});}_0x11eafc=_['merge']({},_0x11eafc,_0x15f2ee['options']);var _0x51318a={'where':_0x11eafc[_0x11af('0x3b')]};return db[_0x11af('0x2c')][_0x11af('0x21')](_0x51318a)['then'](function(_0x4ba216){_0x4bdc20[_0x11af('0x21')]=_0x4ba216;if(_0x15f2ee[_0x11af('0x32')][_0x11af('0x40')]){_0x11eafc[_0x11af('0x41')]=[{'all':!![]}];}return db[_0x11af('0x2c')][_0x11af('0x42')](_0x11eafc);})['then'](function(_0x17c024){_0x4bdc20[_0x11af('0x43')]=_0x17c024;return _0x4bdc20;})[_0x11af('0x27')](respondWithFilteredResult(_0x31e05e,_0x11eafc))[_0x11af('0x44')](handleError(_0x31e05e,null));};exports[_0x11af('0x45')]=function(_0x32e228,_0x12c682){var _0x436ac5={'raw':!![],'where':{'id':_0x32e228[_0x11af('0x46')]['id']}},_0x295243={};_0x295243['model']=_['keys'](db[_0x11af('0x2c')][_0x11af('0x2d')]);_0x295243['query']=_['keys'](_0x32e228['query']);_0x295243['filters']=_['intersection'](_0x295243[_0x11af('0x31')],_0x295243[_0x11af('0x32')]);_0x436ac5['attributes']=_[_0x11af('0x35')](_0x295243[_0x11af('0x31')],qs[_0x11af('0x36')](_0x32e228[_0x11af('0x32')]['fields']));_0x436ac5[_0x11af('0x37')]=_0x436ac5[_0x11af('0x37')]['length']?_0x436ac5[_0x11af('0x37')]:_0x295243[_0x11af('0x31')];if(_0x32e228['query'][_0x11af('0x40')]){_0x436ac5[_0x11af('0x41')]=[{'all':!![]}];}_0x436ac5=_[_0x11af('0x47')]({},_0x436ac5,_0x32e228[_0x11af('0x48')]);return db[_0x11af('0x2c')][_0x11af('0x49')](_0x436ac5)[_0x11af('0x27')](handleEntityNotFound(_0x12c682,null))[_0x11af('0x27')](respondWithResult(_0x12c682,null))[_0x11af('0x44')](handleError(_0x12c682,null));};exports[_0x11af('0x4a')]=function(_0x32c532,_0x49063d){return db[_0x11af('0x2c')][_0x11af('0x4a')](_0x32c532[_0x11af('0x4b')],{})[_0x11af('0x27')](respondWithResult(_0x49063d,0xc9))['catch'](handleError(_0x49063d,null));};exports[_0x11af('0x26')]=function(_0x3425e8,_0xcfe4a8){if(_0x3425e8[_0x11af('0x4b')]['id']){delete _0x3425e8[_0x11af('0x4b')]['id'];}return db[_0x11af('0x2c')]['find']({'where':{'id':_0x3425e8[_0x11af('0x46')]['id']}})['then'](handleEntityNotFound(_0xcfe4a8,null))['then'](saveUpdates(_0x3425e8[_0x11af('0x4b')],null))[_0x11af('0x27')](respondWithResult(_0xcfe4a8,null))[_0x11af('0x44')](handleError(_0xcfe4a8,null));};exports[_0x11af('0x4c')]=function(_0x27e80c,_0x5ce515){return db['SquareMessage'][_0x11af('0x49')]({'where':{'id':_0x27e80c[_0x11af('0x46')]['id']}})[_0x11af('0x27')](handleEntityNotFound(_0x5ce515,null))[_0x11af('0x27')](removeEntity(_0x5ce515,null))[_0x11af('0x44')](handleError(_0x5ce515,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 47702f2..4e529e8 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 _0x1835=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','SquareMessage','square_messages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1835,0x108));var _0x5183=function(_0x46a262,_0x355ec8){_0x46a262=_0x46a262-0x0;var _0x2fb92f=_0x1835[_0x46a262];return _0x2fb92f;};'use strict';var _=require(_0x5183('0x0'));var util=require(_0x5183('0x1'));var logger=require(_0x5183('0x2'))(_0x5183('0x3'));var moment=require('moment');var BPromise=require(_0x5183('0x4'));var rp=require(_0x5183('0x5'));var fs=require('fs');var path=require(_0x5183('0x6'));var rimraf=require('rimraf');var config=require(_0x5183('0x7'));var attributes=require(_0x5183('0x8'));module['exports']=function(_0x3b0a2d,_0x4e3792){return _0x3b0a2d['define'](_0x5183('0x9'),attributes,{'tableName':_0x5183('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc94=['util','../../config/logger','moment','bluebird','../../config/environment','exports','square_messages'];(function(_0x43905b,_0x9388f2){var _0x11451c=function(_0x27c547){while(--_0x27c547){_0x43905b['push'](_0x43905b['shift']());}};_0x11451c(++_0x9388f2);}(_0xdc94,0x69));var _0x4dc9=function(_0x50bf66,_0x47bb81){_0x50bf66=_0x50bf66-0x0;var _0x1db19e=_0xdc94[_0x50bf66];return _0x1db19e;};'use strict';var _=require('lodash');var util=require(_0x4dc9('0x0'));var logger=require(_0x4dc9('0x1'))('api');var moment=require(_0x4dc9('0x2'));var BPromise=require(_0x4dc9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4dc9('0x4'));var attributes=require('./squareMessage.attributes');module[_0x4dc9('0x5')]=function(_0x284dee,_0x55698a){return _0x284dee['define']('SquareMessage',attributes,{'tableName':_0x4dc9('0x6'),'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 029c324..bb3f67f 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 _0xb9a1=['options','raw','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','body'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0xb9a1,0x1b3));var _0x1b9a=function(_0x372e53,_0x26ceaf){_0x372e53=_0x372e53-0x0;var _0x450285=_0xb9a1[_0x372e53];return _0x450285;};'use strict';var _=require('lodash');var util=require(_0x1b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b9a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b9a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b9a('0x3'))(_0x1b9a('0x4'));var config=require(_0x1b9a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1b9a('0x6')][_0x1b9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3708c0,_0x2874d6,_0x1dd667){return new BPromise(function(_0x19c658,_0x581efa){return client[_0x1b9a('0x8')](_0x3708c0,_0x1dd667)['then'](function(_0x56e07f){logger[_0x1b9a('0x9')]('SquareMessage,\x20%s,\x20%s',_0x2874d6,_0x1b9a('0xa'));logger[_0x1b9a('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2874d6,_0x1b9a('0xa'),JSON[_0x1b9a('0xc')](_0x56e07f));if(_0x56e07f[_0x1b9a('0xd')]){if(_0x56e07f['error'][_0x1b9a('0xe')]===0x1f4){logger[_0x1b9a('0xd')](_0x1b9a('0xf'),_0x2874d6,_0x56e07f[_0x1b9a('0xd')][_0x1b9a('0x10')]);return _0x581efa(_0x56e07f[_0x1b9a('0xd')]['message']);}logger[_0x1b9a('0xd')](_0x1b9a('0xf'),_0x2874d6,_0x56e07f[_0x1b9a('0xd')][_0x1b9a('0x10')]);return _0x19c658(_0x56e07f[_0x1b9a('0xd')][_0x1b9a('0x10')]);}else{logger[_0x1b9a('0x9')](_0x1b9a('0xf'),_0x2874d6,'request\x20sent');_0x19c658(_0x56e07f[_0x1b9a('0x11')]['message']);}})['catch'](function(_0x76a0f2){logger[_0x1b9a('0xd')](_0x1b9a('0xf'),_0x2874d6,_0x76a0f2);_0x581efa(_0x76a0f2);});});}exports[_0x1b9a('0x12')]=function(_0x2a3e48){var _0xf60e30=this;return new Promise(function(_0xb85578,_0x5cb706){return db[_0x1b9a('0x13')]['create'](_0x2a3e48[_0x1b9a('0x14')],{'raw':_0x2a3e48[_0x1b9a('0x15')]?_0x2a3e48[_0x1b9a('0x15')][_0x1b9a('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x939bc3){logger[_0x1b9a('0x9')](_0x1b9a('0x12'),_0x2a3e48);logger['debug']('CreateSquareMessage',_0x2a3e48,JSON['stringify'](_0x939bc3));_0xb85578(_0x939bc3);})[_0x1b9a('0x17')](function(_0x23b842){logger[_0x1b9a('0xd')]('CreateSquareMessage',_0x23b842[_0x1b9a('0x10')],_0x2a3e48);_0x5cb706(_0xf60e30['error'](0x1f4,_0x23b842['message']));});});}; \ No newline at end of file +var _0x742a=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareMessage','create','body','options','raw','then','CreateSquareMessage','lodash'];(function(_0x2f1133,_0x36346e){var _0x4b8df1=function(_0x39162c){while(--_0x39162c){_0x2f1133['push'](_0x2f1133['shift']());}};_0x4b8df1(++_0x36346e);}(_0x742a,0x11d));var _0xa742=function(_0x3b0042,_0x8e7550){_0x3b0042=_0x3b0042-0x0;var _0x41bf57=_0x742a[_0x3b0042];return _0x41bf57;};'use strict';var _=require(_0xa742('0x0'));var util=require('util');var moment=require(_0xa742('0x1'));var BPromise=require(_0xa742('0x2'));var rs=require(_0xa742('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa742('0x4'))['db'];var utils=require(_0xa742('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa742('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x269fbf,_0x434222,_0x3318a0){return new BPromise(function(_0x53a6d5,_0x402d55){return client[_0xa742('0x7')](_0x269fbf,_0x3318a0)['then'](function(_0x27f196){logger[_0xa742('0x8')](_0xa742('0x9'),_0x434222,_0xa742('0xa'));logger[_0xa742('0xb')](_0xa742('0xc'),_0x434222,_0xa742('0xa'),JSON[_0xa742('0xd')](_0x27f196));if(_0x27f196[_0xa742('0xe')]){if(_0x27f196[_0xa742('0xe')][_0xa742('0xf')]===0x1f4){logger[_0xa742('0xe')](_0xa742('0x9'),_0x434222,_0x27f196[_0xa742('0xe')][_0xa742('0x10')]);return _0x402d55(_0x27f196[_0xa742('0xe')][_0xa742('0x10')]);}logger[_0xa742('0xe')](_0xa742('0x9'),_0x434222,_0x27f196[_0xa742('0xe')][_0xa742('0x10')]);return _0x53a6d5(_0x27f196[_0xa742('0xe')][_0xa742('0x10')]);}else{logger[_0xa742('0x8')](_0xa742('0x9'),_0x434222,_0xa742('0xa'));_0x53a6d5(_0x27f196[_0xa742('0x11')][_0xa742('0x10')]);}})[_0xa742('0x12')](function(_0x48548d){logger[_0xa742('0xe')]('SquareMessage,\x20%s,\x20%s',_0x434222,_0x48548d);_0x402d55(_0x48548d);});});}exports['CreateSquareMessage']=function(_0x43df82){var _0x55ac29=this;return new Promise(function(_0x221abb,_0x224921){return db[_0xa742('0x13')][_0xa742('0x14')](_0x43df82[_0xa742('0x15')],{'raw':_0x43df82[_0xa742('0x16')]?_0x43df82[_0xa742('0x16')][_0xa742('0x17')]===undefined?!![]:![]:!![]})[_0xa742('0x18')](function(_0x1aaec9){logger[_0xa742('0x8')]('CreateSquareMessage',_0x43df82);logger[_0xa742('0xb')](_0xa742('0x19'),_0x43df82,JSON[_0xa742('0xd')](_0x1aaec9));_0x221abb(_0x1aaec9);})[_0xa742('0x12')](function(_0x11a709){logger[_0xa742('0xe')](_0xa742('0x19'),_0x11a709[_0xa742('0x10')],_0x43df82);_0x224921(_0x55ac29[_0xa742('0xe')](0x1f4,_0x11a709[_0xa742('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 7c1cda5..3367f50 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 _0x3403=['destroy','exports','multer','path','connect-timeout','../../components/interaction/service','./squareOdbc.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x3403,0x68));var _0x3340=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3403[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x3340('0x0'));var util=require('util');var path=require(_0x3340('0x1'));var timeout=require(_0x3340('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3340('0x3'));var config=require('../../config/environment');var controller=require(_0x3340('0x4'));router[_0x3340('0x5')]('/',auth['isAuthenticated'](),controller[_0x3340('0x6')]);router['get']('/:id',auth[_0x3340('0x7')](),controller[_0x3340('0x8')]);router['get']('/:id/test',auth[_0x3340('0x7')](),timeout('15s'),controller['test']);router[_0x3340('0x9')]('/',auth['isAuthenticated'](),controller[_0x3340('0xa')]);router[_0x3340('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3340('0xc')]);router[_0x3340('0xd')](_0x3340('0xe'),auth[_0x3340('0x7')](),controller[_0x3340('0xf')]);module[_0x3340('0x10')]=router; \ No newline at end of file +var _0x2da4=['update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','post','create','put'];(function(_0x142215,_0x3002ee){var _0x28ca5c=function(_0x38a0c9){while(--_0x38a0c9){_0x142215['push'](_0x142215['shift']());}};_0x28ca5c(++_0x3002ee);}(_0x2da4,0x14d));var _0x42da=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2da4[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x42da('0x0'));var util=require(_0x42da('0x1'));var path=require(_0x42da('0x2'));var timeout=require(_0x42da('0x3'));var express=require('express');var router=express[_0x42da('0x4')]();var fs_extra=require(_0x42da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x42da('0x6'));var config=require(_0x42da('0x7'));var controller=require(_0x42da('0x8'));router[_0x42da('0x9')]('/',auth[_0x42da('0xa')](),controller[_0x42da('0xb')]);router[_0x42da('0x9')](_0x42da('0xc'),auth[_0x42da('0xa')](),controller[_0x42da('0xd')]);router['get'](_0x42da('0xe'),auth[_0x42da('0xa')](),timeout(_0x42da('0xf')),controller['test']);router[_0x42da('0x10')]('/',auth['isAuthenticated'](),controller[_0x42da('0x11')]);router[_0x42da('0x12')](_0x42da('0xc'),auth[_0x42da('0xa')](),controller[_0x42da('0x13')]);router[_0x42da('0x14')](_0x42da('0xc'),auth[_0x42da('0xa')](),controller[_0x42da('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index f1cc07c..294d4f1 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 _0x6ae0=['name','exports','STRING'];(function(_0x4dd91d,_0x7de3f6){var _0x2f0699=function(_0xed81c4){while(--_0xed81c4){_0x4dd91d['push'](_0x4dd91d['shift']());}};_0x2f0699(++_0x7de3f6);}(_0x6ae0,0x112));var _0x06ae=function(_0x45b4c8,_0x2c0c03){_0x45b4c8=_0x45b4c8-0x0;var _0x33126b=_0x6ae0[_0x45b4c8];return _0x33126b;};'use strict';var Sequelize=require('sequelize');module[_0x06ae('0x0')]={'name':{'type':Sequelize[_0x06ae('0x1')],'unique':_0x06ae('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x06ae('0x1')]},'description':{'type':Sequelize[_0x06ae('0x1')]}}; \ No newline at end of file +var _0xbec4=['exports','name','STRING','sequelize'];(function(_0x5926c9,_0x35d6c5){var _0x28a7c0=function(_0x4d226c){while(--_0x4d226c){_0x5926c9['push'](_0x5926c9['shift']());}};_0x28a7c0(++_0x35d6c5);}(_0xbec4,0x12f));var _0x4bec=function(_0x4b1f0f,_0x533eb5){_0x4b1f0f=_0x4b1f0f-0x0;var _0x19def9=_0xbec4[_0x4b1f0f];return _0x19def9;};'use strict';var Sequelize=require(_0x4bec('0x0'));module[_0x4bec('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4bec('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x4bec('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 88437f8..8cb5fc3 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 _0x6ded=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','openSync','closeSync','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','get','ODBC','end','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','length','includeAll','include','find','create','user','UserProfileSection','userProfileId'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x6ded,0x162));var _0xd6de=function(_0xf70ae9,_0x2b04bd){_0xf70ae9=_0xf70ae9-0x0;var _0x4c6ffb=_0x6ded[_0xf70ae9];return _0x4c6ffb;};'use strict';var emlformat=require(_0xd6de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd6de('0x1'));var rp=require('request-promise');var moment=require(_0xd6de('0x2'));var BPromise=require(_0xd6de('0x3'));var Mustache=require(_0xd6de('0x4'));var util=require(_0xd6de('0x5'));var path=require(_0xd6de('0x6'));var sox=require('sox');var csv=require(_0xd6de('0x7'));var ejs=require(_0xd6de('0x8'));var fs=require('fs');var fs_extra=require(_0xd6de('0x9'));var _=require(_0xd6de('0xa'));var squel=require(_0xd6de('0xb'));var crypto=require(_0xd6de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd6de('0xd'));var toCsv=require(_0xd6de('0x7'));var querystring=require(_0xd6de('0xe'));var Papa=require(_0xd6de('0xf'));var Redis=require(_0xd6de('0x10'));var authService=require(_0xd6de('0x11'));var qs=require(_0xd6de('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6de('0x13'));var logger=require(_0xd6de('0x14'))(_0xd6de('0x15'));var utils=require(_0xd6de('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6de('0x17'));var db=require(_0xd6de('0x18'))['db'];function respondWithStatusCode(_0x1050fe,_0x4d16f0){_0x4d16f0=_0x4d16f0||0xcc;return function(_0x3e9ffe){if(_0x3e9ffe){return _0x1050fe[_0xd6de('0x19')](_0x4d16f0);}return _0x1050fe['status'](_0x4d16f0)['end']();};}function respondWithResult(_0x3545d3,_0x2b5912){_0x2b5912=_0x2b5912||0xc8;return function(_0x157a83){if(_0x157a83){return _0x3545d3[_0xd6de('0x1a')](_0x2b5912)[_0xd6de('0x1b')](_0x157a83);}};}function respondWithFilteredResult(_0x1a5ce4,_0x434eeb){return function(_0xa8b8e){if(_0xa8b8e){var _0x401daa=typeof _0x434eeb['offset']===_0xd6de('0x1c')&&typeof _0x434eeb[_0xd6de('0x1d')]===_0xd6de('0x1c');var _0x36abf6=_0xa8b8e[_0xd6de('0x1e')];var _0x49f85e=_0x401daa?0x0:_0x434eeb[_0xd6de('0x1f')];var _0x3eac60=_0x401daa?_0xa8b8e[_0xd6de('0x1e')]:_0x434eeb[_0xd6de('0x1f')]+_0x434eeb[_0xd6de('0x1d')];var _0x12911b;if(_0x3eac60>=_0x36abf6){_0x3eac60=_0x36abf6;_0x12911b=0xc8;}else{_0x12911b=0xce;}_0x1a5ce4[_0xd6de('0x1a')](_0x12911b);return _0x1a5ce4['set'](_0xd6de('0x20'),_0x49f85e+'-'+_0x3eac60+'/'+_0x36abf6)[_0xd6de('0x1b')](_0xa8b8e);}return null;};}function patchUpdates(_0x7f0b64){return function(_0x3d1371){try{jsonpatch[_0xd6de('0x21')](_0x3d1371,_0x7f0b64,!![]);}catch(_0x5e40c4){return BPromise[_0xd6de('0x22')](_0x5e40c4);}return _0x3d1371['save']();};}function saveUpdates(_0x340ea9,_0x2633fd){return function(_0x5f0493){if(_0x5f0493){return _0x5f0493['update'](_0x340ea9)[_0xd6de('0x23')](function(_0x40009d){return _0x40009d;});}return null;};}function removeEntity(_0x359616,_0x4899c6){return function(_0x12c0b5){if(_0x12c0b5){return _0x12c0b5[_0xd6de('0x24')]()['then'](function(){var _0x5775f2=_0x12c0b5[_0xd6de('0x25')]({'plain':!![]});var _0x5b3de0=_0xd6de('0x26');return db['UserProfileResource'][_0xd6de('0x24')]({'where':{'type':_0x5b3de0,'resourceId':_0x5775f2['id']}})['then'](function(){return _0x12c0b5;});})[_0xd6de('0x23')](function(){_0x359616[_0xd6de('0x1a')](0xcc)[_0xd6de('0x27')]();});}};}function handleEntityNotFound(_0x2c90e0,_0x5f1757){return function(_0xf01c47){if(!_0xf01c47){_0x2c90e0[_0xd6de('0x19')](0x194);}return _0xf01c47;};}function handleError(_0x3034b4,_0x2308db){_0x2308db=_0x2308db||0x1f4;return function(_0x38f188){logger['error'](_0x38f188[_0xd6de('0x28')]);if(_0x38f188['name']){delete _0x38f188['name'];}_0x3034b4[_0xd6de('0x1a')](_0x2308db)[_0xd6de('0x29')](_0x38f188);};}exports[_0xd6de('0x2a')]=function(_0x53f445,_0x8db982){var _0x153e21={},_0x17e64a={},_0x3d048e={'count':0x0,'rows':[]};var _0x3d31c5=_[_0xd6de('0x2b')](db[_0xd6de('0x2c')][_0xd6de('0x2d')],function(_0x2d0d15){return{'name':_0x2d0d15[_0xd6de('0x2e')],'type':_0x2d0d15['type'][_0xd6de('0x2f')]};});_0x17e64a[_0xd6de('0x30')]=_[_0xd6de('0x2b')](_0x3d31c5,_0xd6de('0x31'));_0x17e64a[_0xd6de('0x32')]=_[_0xd6de('0x33')](_0x53f445['query']);_0x17e64a['filters']=_[_0xd6de('0x34')](_0x17e64a[_0xd6de('0x30')],_0x17e64a[_0xd6de('0x32')]);_0x153e21[_0xd6de('0x35')]=_[_0xd6de('0x34')](_0x17e64a[_0xd6de('0x30')],qs[_0xd6de('0x36')](_0x53f445[_0xd6de('0x32')][_0xd6de('0x36')]));_0x153e21[_0xd6de('0x35')]=_0x153e21[_0xd6de('0x35')]['length']?_0x153e21[_0xd6de('0x35')]:_0x17e64a[_0xd6de('0x30')];if(!_0x53f445['query'][_0xd6de('0x37')]('nolimit')){_0x153e21[_0xd6de('0x1d')]=qs[_0xd6de('0x1d')](_0x53f445[_0xd6de('0x32')][_0xd6de('0x1d')]);_0x153e21[_0xd6de('0x1f')]=qs[_0xd6de('0x1f')](_0x53f445[_0xd6de('0x32')][_0xd6de('0x1f')]);}_0x153e21[_0xd6de('0x38')]=qs[_0xd6de('0x39')](_0x53f445[_0xd6de('0x32')]['sort']);_0x153e21[_0xd6de('0x3a')]=qs[_0xd6de('0x3b')](_['pick'](_0x53f445[_0xd6de('0x32')],_0x17e64a[_0xd6de('0x3b')]),_0x3d31c5);if(_0x53f445['query'][_0xd6de('0x3c')]){_0x153e21[_0xd6de('0x3a')]=_[_0xd6de('0x3d')](_0x153e21[_0xd6de('0x3a')],{'$or':_[_0xd6de('0x2b')](_0x3d31c5,function(_0x38ec29){if(_0x38ec29['type']!==_0xd6de('0x3e')){var _0x23ffec={};_0x23ffec[_0x38ec29[_0xd6de('0x31')]]={'$like':'%'+_0x53f445['query'][_0xd6de('0x3c')]+'%'};return _0x23ffec;}})});}_0x153e21=_[_0xd6de('0x3d')]({},_0x153e21,_0x53f445[_0xd6de('0x3f')]);var _0x25a8cd={'where':_0x153e21[_0xd6de('0x3a')]};return db['SquareOdbc'][_0xd6de('0x1e')](_0x25a8cd)['then'](function(_0x2c7bc5){_0x3d048e[_0xd6de('0x1e')]=_0x2c7bc5;if(_0x53f445[_0xd6de('0x32')]['includeAll']){_0x153e21['include']=[{'all':!![]}];}return db[_0xd6de('0x2c')][_0xd6de('0x40')](_0x153e21);})[_0xd6de('0x23')](function(_0x2fc76d){_0x3d048e[_0xd6de('0x41')]=_0x2fc76d;return _0x3d048e;})[_0xd6de('0x23')](respondWithFilteredResult(_0x8db982,_0x153e21))[_0xd6de('0x42')](handleError(_0x8db982,null));};exports[_0xd6de('0x43')]=function(_0x134388,_0x4774f4){var _0x14618d={'raw':!![],'where':{'id':_0x134388['params']['id']}},_0x2a37df={};_0x2a37df[_0xd6de('0x30')]=_[_0xd6de('0x33')](db[_0xd6de('0x2c')][_0xd6de('0x2d')]);_0x2a37df[_0xd6de('0x32')]=_[_0xd6de('0x33')](_0x134388[_0xd6de('0x32')]);_0x2a37df[_0xd6de('0x3b')]=_[_0xd6de('0x34')](_0x2a37df['model'],_0x2a37df[_0xd6de('0x32')]);_0x14618d['attributes']=_['intersection'](_0x2a37df['model'],qs[_0xd6de('0x36')](_0x134388[_0xd6de('0x32')][_0xd6de('0x36')]));_0x14618d['attributes']=_0x14618d['attributes'][_0xd6de('0x44')]?_0x14618d['attributes']:_0x2a37df[_0xd6de('0x30')];if(_0x134388[_0xd6de('0x32')][_0xd6de('0x45')]){_0x14618d[_0xd6de('0x46')]=[{'all':!![]}];}_0x14618d=_[_0xd6de('0x3d')]({},_0x14618d,_0x134388['options']);return db[_0xd6de('0x2c')][_0xd6de('0x47')](_0x14618d)[_0xd6de('0x23')](handleEntityNotFound(_0x4774f4,null))[_0xd6de('0x23')](respondWithResult(_0x4774f4,null))['catch'](handleError(_0x4774f4,null));};exports[_0xd6de('0x48')]=function(_0x31e025,_0x37a094){return db['SquareOdbc']['create'](_0x31e025['body'],{})[_0xd6de('0x23')](function(_0x852c44){var _0x2c6f25=_0x31e025[_0xd6de('0x49')][_0xd6de('0x25')]({'plain':!![]});if(!_0x2c6f25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c6f25['role']==='user'){var _0x13a7fc=_0x852c44[_0xd6de('0x25')]({'plain':!![]});var _0xa8766a='ODBC';return db[_0xd6de('0x4a')][_0xd6de('0x47')]({'where':{'name':_0xa8766a,'userProfileId':_0x2c6f25[_0xd6de('0x4b')]},'raw':!![]})[_0xd6de('0x23')](function(_0x5881ee){if(_0x5881ee&&_0x5881ee[_0xd6de('0x4c')]===0x0){return db['UserProfileResource'][_0xd6de('0x48')]({'name':_0x13a7fc[_0xd6de('0x31')],'resourceId':_0x13a7fc['id'],'type':_0x5881ee[_0xd6de('0x31')],'sectionId':_0x5881ee['id']},{})['then'](function(){return _0x852c44;});}else{return _0x852c44;}})[_0xd6de('0x42')](function(_0xbbf33b){logger[_0xd6de('0x4d')](_0xd6de('0x4e'),_0xbbf33b);throw _0xbbf33b;});}return _0x852c44;})[_0xd6de('0x23')](respondWithResult(_0x37a094,0xc9))['catch'](handleError(_0x37a094,null));};exports['update']=function(_0x2f3bae,_0x13e032){if(_0x2f3bae[_0xd6de('0x4f')]['id']){delete _0x2f3bae[_0xd6de('0x4f')]['id'];}return db[_0xd6de('0x2c')][_0xd6de('0x47')]({'where':{'id':_0x2f3bae[_0xd6de('0x50')]['id']}})[_0xd6de('0x23')](handleEntityNotFound(_0x13e032,null))[_0xd6de('0x23')](saveUpdates(_0x2f3bae['body'],null))[_0xd6de('0x23')](respondWithResult(_0x13e032,null))[_0xd6de('0x42')](handleError(_0x13e032,null));};exports['destroy']=function(_0xf158,_0x4bc5ab){return db[_0xd6de('0x2c')][_0xd6de('0x47')]({'where':{'id':_0xf158[_0xd6de('0x50')]['id']}})[_0xd6de('0x23')](handleEntityNotFound(_0x4bc5ab,null))['then'](removeEntity(_0x4bc5ab,null))[_0xd6de('0x42')](handleError(_0x4bc5ab,null));};exports[_0xd6de('0x51')]=function(_0x1ddf50,_0x52c4f4,_0x49889d){var _0x30f418;return db[_0xd6de('0x2c')][_0xd6de('0x47')]({'where':{'id':_0x1ddf50[_0xd6de('0x50')]['id']},'attributes':['id',_0xd6de('0x52')]})[_0xd6de('0x23')](handleEntityNotFound(_0x52c4f4,null))[_0xd6de('0x23')](function(_0x3cdf79){if(_0x3cdf79){var _0x28ea1b=require(_0xd6de('0x53'))();_0x28ea1b[_0xd6de('0x54')](_0x3cdf79[_0xd6de('0x52')]);_0x28ea1b[_0xd6de('0x55')]();return _0x3cdf79;}})[_0xd6de('0x23')](respondWithResult(_0x52c4f4,null))[_0xd6de('0x42')](handleError(_0x52c4f4,null));}; \ No newline at end of file +var _0xc709=['lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','status','json','offset','undefined','count','Content-Range','apply','reject','get','ODBC','UserProfileResource','destroy','then','end','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','SquareOdbc','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','openSync','closeSync','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra'];(function(_0x1fe7b8,_0x3baee9){var _0x5ef591=function(_0x45f41a){while(--_0x45f41a){_0x1fe7b8['push'](_0x1fe7b8['shift']());}};_0x5ef591(++_0x3baee9);}(_0xc709,0x1ef));var _0x9c70=function(_0x118afa,_0x4bf0c1){_0x118afa=_0x118afa-0x0;var _0x167d76=_0xc709[_0x118afa];return _0x167d76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c70('0x0'));var zipdir=require(_0x9c70('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c70('0x2'));var moment=require(_0x9c70('0x3'));var BPromise=require(_0x9c70('0x4'));var Mustache=require('mustache');var util=require(_0x9c70('0x5'));var path=require('path');var sox=require(_0x9c70('0x6'));var csv=require('to-csv');var ejs=require(_0x9c70('0x7'));var fs=require('fs');var fs_extra=require(_0x9c70('0x8'));var _=require(_0x9c70('0x9'));var squel=require('squel');var crypto=require(_0x9c70('0xa'));var jsforce=require(_0x9c70('0xb'));var deskjs=require(_0x9c70('0xc'));var toCsv=require(_0x9c70('0xd'));var querystring=require('querystring');var Papa=require(_0x9c70('0xe'));var Redis=require(_0x9c70('0xf'));var authService=require(_0x9c70('0x10'));var qs=require(_0x9c70('0x11'));var as=require(_0x9c70('0x12'));var hardwareService=require(_0x9c70('0x13'));var logger=require(_0x9c70('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9c70('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3508e2,_0x338cf7){_0x338cf7=_0x338cf7||0xcc;return function(_0x2c6e5f){if(_0x2c6e5f){return _0x3508e2['sendStatus'](_0x338cf7);}return _0x3508e2['status'](_0x338cf7)['end']();};}function respondWithResult(_0x494084,_0x180f3f){_0x180f3f=_0x180f3f||0xc8;return function(_0x5f53a1){if(_0x5f53a1){return _0x494084[_0x9c70('0x16')](_0x180f3f)[_0x9c70('0x17')](_0x5f53a1);}};}function respondWithFilteredResult(_0x25e58f,_0x463f0f){return function(_0x3598b9){if(_0x3598b9){var _0x19951a=typeof _0x463f0f[_0x9c70('0x18')]===_0x9c70('0x19')&&typeof _0x463f0f['limit']===_0x9c70('0x19');var _0x30f728=_0x3598b9[_0x9c70('0x1a')];var _0x2d6027=_0x19951a?0x0:_0x463f0f['offset'];var _0x1339eb=_0x19951a?_0x3598b9[_0x9c70('0x1a')]:_0x463f0f['offset']+_0x463f0f['limit'];var _0x3b88f9;if(_0x1339eb>=_0x30f728){_0x1339eb=_0x30f728;_0x3b88f9=0xc8;}else{_0x3b88f9=0xce;}_0x25e58f[_0x9c70('0x16')](_0x3b88f9);return _0x25e58f['set'](_0x9c70('0x1b'),_0x2d6027+'-'+_0x1339eb+'/'+_0x30f728)[_0x9c70('0x17')](_0x3598b9);}return null;};}function patchUpdates(_0x42d24d){return function(_0x1b03eb){try{jsonpatch[_0x9c70('0x1c')](_0x1b03eb,_0x42d24d,!![]);}catch(_0x3930a4){return BPromise[_0x9c70('0x1d')](_0x3930a4);}return _0x1b03eb['save']();};}function saveUpdates(_0x3a09e5,_0x465b92){return function(_0x10da14){if(_0x10da14){return _0x10da14['update'](_0x3a09e5)['then'](function(_0xae84f){return _0xae84f;});}return null;};}function removeEntity(_0x2ed10b,_0x5478ad){return function(_0xfbb029){if(_0xfbb029){return _0xfbb029['destroy']()['then'](function(){var _0x2ee6e8=_0xfbb029[_0x9c70('0x1e')]({'plain':!![]});var _0x4ee5d6=_0x9c70('0x1f');return db[_0x9c70('0x20')][_0x9c70('0x21')]({'where':{'type':_0x4ee5d6,'resourceId':_0x2ee6e8['id']}})[_0x9c70('0x22')](function(){return _0xfbb029;});})[_0x9c70('0x22')](function(){_0x2ed10b[_0x9c70('0x16')](0xcc)[_0x9c70('0x23')]();});}};}function handleEntityNotFound(_0xb49db,_0x2d3ffd){return function(_0x252c44){if(!_0x252c44){_0xb49db[_0x9c70('0x24')](0x194);}return _0x252c44;};}function handleError(_0x24f4ab,_0x12c9b9){_0x12c9b9=_0x12c9b9||0x1f4;return function(_0x43df96){logger[_0x9c70('0x25')](_0x43df96[_0x9c70('0x26')]);if(_0x43df96[_0x9c70('0x27')]){delete _0x43df96[_0x9c70('0x27')];}_0x24f4ab[_0x9c70('0x16')](_0x12c9b9)[_0x9c70('0x28')](_0x43df96);};}exports[_0x9c70('0x29')]=function(_0xc6eb33,_0x586da6){var _0x26566b={},_0x1bde89={},_0x1d8ebc={'count':0x0,'rows':[]};var _0x54da85=_['map'](db['SquareOdbc'][_0x9c70('0x2a')],function(_0x55aaa5){return{'name':_0x55aaa5['fieldName'],'type':_0x55aaa5[_0x9c70('0x2b')][_0x9c70('0x2c')]};});_0x1bde89[_0x9c70('0x2d')]=_[_0x9c70('0x2e')](_0x54da85,_0x9c70('0x27'));_0x1bde89[_0x9c70('0x2f')]=_[_0x9c70('0x30')](_0xc6eb33[_0x9c70('0x2f')]);_0x1bde89['filters']=_[_0x9c70('0x31')](_0x1bde89[_0x9c70('0x2d')],_0x1bde89[_0x9c70('0x2f')]);_0x26566b[_0x9c70('0x32')]=_[_0x9c70('0x31')](_0x1bde89['model'],qs[_0x9c70('0x33')](_0xc6eb33[_0x9c70('0x2f')]['fields']));_0x26566b[_0x9c70('0x32')]=_0x26566b[_0x9c70('0x32')][_0x9c70('0x34')]?_0x26566b['attributes']:_0x1bde89[_0x9c70('0x2d')];if(!_0xc6eb33[_0x9c70('0x2f')][_0x9c70('0x35')]('nolimit')){_0x26566b[_0x9c70('0x36')]=qs[_0x9c70('0x36')](_0xc6eb33[_0x9c70('0x2f')][_0x9c70('0x36')]);_0x26566b['offset']=qs[_0x9c70('0x18')](_0xc6eb33[_0x9c70('0x2f')]['offset']);}_0x26566b[_0x9c70('0x37')]=qs['sort'](_0xc6eb33[_0x9c70('0x2f')][_0x9c70('0x38')]);_0x26566b[_0x9c70('0x39')]=qs[_0x9c70('0x3a')](_['pick'](_0xc6eb33[_0x9c70('0x2f')],_0x1bde89[_0x9c70('0x3a')]),_0x54da85);if(_0xc6eb33[_0x9c70('0x2f')][_0x9c70('0x3b')]){_0x26566b[_0x9c70('0x39')]=_[_0x9c70('0x3c')](_0x26566b[_0x9c70('0x39')],{'$or':_[_0x9c70('0x2e')](_0x54da85,function(_0x31a87f){if(_0x31a87f['type']!==_0x9c70('0x3d')){var _0x352876={};_0x352876[_0x31a87f[_0x9c70('0x27')]]={'$like':'%'+_0xc6eb33[_0x9c70('0x2f')][_0x9c70('0x3b')]+'%'};return _0x352876;}})});}_0x26566b=_[_0x9c70('0x3c')]({},_0x26566b,_0xc6eb33[_0x9c70('0x3e')]);var _0x1573e5={'where':_0x26566b[_0x9c70('0x39')]};return db['SquareOdbc'][_0x9c70('0x1a')](_0x1573e5)[_0x9c70('0x22')](function(_0x3d4b54){_0x1d8ebc[_0x9c70('0x1a')]=_0x3d4b54;if(_0xc6eb33[_0x9c70('0x2f')][_0x9c70('0x3f')]){_0x26566b[_0x9c70('0x40')]=[{'all':!![]}];}return db['SquareOdbc'][_0x9c70('0x41')](_0x26566b);})[_0x9c70('0x22')](function(_0x2d45be){_0x1d8ebc[_0x9c70('0x42')]=_0x2d45be;return _0x1d8ebc;})['then'](respondWithFilteredResult(_0x586da6,_0x26566b))[_0x9c70('0x43')](handleError(_0x586da6,null));};exports['show']=function(_0x824d4b,_0x26fa86){var _0x1bbca0={'raw':!![],'where':{'id':_0x824d4b[_0x9c70('0x44')]['id']}},_0x3ab38f={};_0x3ab38f[_0x9c70('0x2d')]=_[_0x9c70('0x30')](db[_0x9c70('0x45')][_0x9c70('0x2a')]);_0x3ab38f[_0x9c70('0x2f')]=_[_0x9c70('0x30')](_0x824d4b[_0x9c70('0x2f')]);_0x3ab38f[_0x9c70('0x3a')]=_[_0x9c70('0x31')](_0x3ab38f[_0x9c70('0x2d')],_0x3ab38f['query']);_0x1bbca0[_0x9c70('0x32')]=_[_0x9c70('0x31')](_0x3ab38f[_0x9c70('0x2d')],qs['fields'](_0x824d4b[_0x9c70('0x2f')][_0x9c70('0x33')]));_0x1bbca0[_0x9c70('0x32')]=_0x1bbca0[_0x9c70('0x32')][_0x9c70('0x34')]?_0x1bbca0[_0x9c70('0x32')]:_0x3ab38f[_0x9c70('0x2d')];if(_0x824d4b[_0x9c70('0x2f')][_0x9c70('0x3f')]){_0x1bbca0['include']=[{'all':!![]}];}_0x1bbca0=_[_0x9c70('0x3c')]({},_0x1bbca0,_0x824d4b['options']);return db[_0x9c70('0x45')][_0x9c70('0x46')](_0x1bbca0)['then'](handleEntityNotFound(_0x26fa86,null))[_0x9c70('0x22')](respondWithResult(_0x26fa86,null))[_0x9c70('0x43')](handleError(_0x26fa86,null));};exports[_0x9c70('0x47')]=function(_0x260abc,_0x47b9a1){return db[_0x9c70('0x45')][_0x9c70('0x47')](_0x260abc[_0x9c70('0x48')],{})[_0x9c70('0x22')](function(_0x4d5df0){var _0x4044dc=_0x260abc['user'][_0x9c70('0x1e')]({'plain':!![]});if(!_0x4044dc)throw new Error(_0x9c70('0x49'));if(_0x4044dc[_0x9c70('0x4a')]===_0x9c70('0x4b')){var _0x17622c=_0x4d5df0[_0x9c70('0x1e')]({'plain':!![]});var _0x48bae7='ODBC';return db[_0x9c70('0x4c')][_0x9c70('0x46')]({'where':{'name':_0x48bae7,'userProfileId':_0x4044dc['userProfileId']},'raw':!![]})[_0x9c70('0x22')](function(_0x2d5557){if(_0x2d5557&&_0x2d5557[_0x9c70('0x4d')]===0x0){return db[_0x9c70('0x20')]['create']({'name':_0x17622c[_0x9c70('0x27')],'resourceId':_0x17622c['id'],'type':_0x2d5557[_0x9c70('0x27')],'sectionId':_0x2d5557['id']},{})[_0x9c70('0x22')](function(){return _0x4d5df0;});}else{return _0x4d5df0;}})[_0x9c70('0x43')](function(_0x593708){logger[_0x9c70('0x25')](_0x9c70('0x4e'),_0x593708);throw _0x593708;});}return _0x4d5df0;})[_0x9c70('0x22')](respondWithResult(_0x47b9a1,0xc9))[_0x9c70('0x43')](handleError(_0x47b9a1,null));};exports[_0x9c70('0x4f')]=function(_0x2f2345,_0x3413de){if(_0x2f2345[_0x9c70('0x48')]['id']){delete _0x2f2345[_0x9c70('0x48')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x2f2345[_0x9c70('0x44')]['id']}})[_0x9c70('0x22')](handleEntityNotFound(_0x3413de,null))[_0x9c70('0x22')](saveUpdates(_0x2f2345[_0x9c70('0x48')],null))[_0x9c70('0x22')](respondWithResult(_0x3413de,null))[_0x9c70('0x43')](handleError(_0x3413de,null));};exports['destroy']=function(_0x4b3413,_0x52ccb8){return db[_0x9c70('0x45')][_0x9c70('0x46')]({'where':{'id':_0x4b3413[_0x9c70('0x44')]['id']}})[_0x9c70('0x22')](handleEntityNotFound(_0x52ccb8,null))[_0x9c70('0x22')](removeEntity(_0x52ccb8,null))['catch'](handleError(_0x52ccb8,null));};exports['test']=function(_0x264eec,_0x37dfcc,_0x29158a){var _0x3cc793;return db[_0x9c70('0x45')]['find']({'where':{'id':_0x264eec[_0x9c70('0x44')]['id']},'attributes':['id',_0x9c70('0x50')]})[_0x9c70('0x22')](handleEntityNotFound(_0x37dfcc,null))['then'](function(_0x3fa804){if(_0x3fa804){var _0x2288f4=require(_0x9c70('0x51'))();_0x2288f4[_0x9c70('0x52')](_0x3fa804[_0x9c70('0x50')]);_0x2288f4[_0x9c70('0x53')]();return _0x3fa804;}})['then'](respondWithResult(_0x37dfcc,null))['catch'](handleError(_0x37dfcc,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 719f7cc..12516f8 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 _0x2b41=['moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x2b41,0xbd));var _0x12b4=function(_0x330412,_0xfeadf4){_0x330412=_0x330412-0x0;var _0x3f18b4=_0x2b41[_0x330412];return _0x3f18b4;};'use strict';var _=require('lodash');var util=require(_0x12b4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x12b4('0x1'));var BPromise=require(_0x12b4('0x2'));var rp=require(_0x12b4('0x3'));var fs=require('fs');var path=require(_0x12b4('0x4'));var rimraf=require(_0x12b4('0x5'));var config=require('../../config/environment');var attributes=require(_0x12b4('0x6'));module['exports']=function(_0x5cba7f,_0x4109ae){return _0x5cba7f[_0x12b4('0x7')](_0x12b4('0x8'),attributes,{'tableName':_0x12b4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68f2=['define','SquareOdbc','square_odbc','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x223e7e,_0xc4ff46){var _0x3d5d10=function(_0x7aaffb){while(--_0x7aaffb){_0x223e7e['push'](_0x223e7e['shift']());}};_0x3d5d10(++_0xc4ff46);}(_0x68f2,0x13b));var _0x268f=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x68f2[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0x268f('0x0'));var logger=require(_0x268f('0x1'))(_0x268f('0x2'));var moment=require(_0x268f('0x3'));var BPromise=require(_0x268f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x268f('0x5'));var rimraf=require(_0x268f('0x6'));var config=require(_0x268f('0x7'));var attributes=require(_0x268f('0x8'));module[_0x268f('0x9')]=function(_0x1c1eb7,_0xdf5f8f){return _0x1c1eb7[_0x268f('0xa')](_0x268f('0xb'),attributes,{'tableName':_0x268f('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 25642f6..dccdd53 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 _0x5062=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','SquareOdbc','options','attributes','include','map','model','ShowSquareOdbc','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x5062,0x131));var _0x2506=function(_0x35b242,_0x4399a2){_0x35b242=_0x35b242-0x0;var _0x343538=_0x5062[_0x35b242];return _0x343538;};'use strict';var _=require('lodash');var util=require(_0x2506('0x0'));var moment=require(_0x2506('0x1'));var BPromise=require(_0x2506('0x2'));var rs=require(_0x2506('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2506('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2506('0x5'))(_0x2506('0x6'));var config=require(_0x2506('0x7'));var jayson=require(_0x2506('0x8'));var client=jayson[_0x2506('0x9')][_0x2506('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x120f15,_0x5480c2,_0x182110){return new BPromise(function(_0x1f11e1,_0x2e42ca){return client[_0x2506('0xb')](_0x120f15,_0x182110)[_0x2506('0xc')](function(_0x2b4440){logger['info'](_0x2506('0xd'),_0x5480c2,_0x2506('0xe'));logger[_0x2506('0xf')](_0x2506('0x10'),_0x5480c2,_0x2506('0xe'),JSON[_0x2506('0x11')](_0x2b4440));if(_0x2b4440['error']){if(_0x2b4440[_0x2506('0x12')]['code']===0x1f4){logger[_0x2506('0x12')](_0x2506('0xd'),_0x5480c2,_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);return _0x2e42ca(_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);}logger[_0x2506('0x12')](_0x2506('0xd'),_0x5480c2,_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);return _0x1f11e1(_0x2b4440[_0x2506('0x12')][_0x2506('0x13')]);}else{logger[_0x2506('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x5480c2,'request\x20sent');_0x1f11e1(_0x2b4440['result'][_0x2506('0x13')]);}})[_0x2506('0x15')](function(_0x1f5a56){logger[_0x2506('0x12')](_0x2506('0xd'),_0x5480c2,_0x1f5a56);_0x2e42ca(_0x1f5a56);});});}exports['ShowSquareOdbc']=function(_0x5582f3){var _0x1a3d7b=this;return new Promise(function(_0x2180b8,_0x468808){return db[_0x2506('0x16')]['find']({'raw':_0x5582f3[_0x2506('0x17')]?_0x5582f3[_0x2506('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5582f3['options']?_0x5582f3[_0x2506('0x17')]['where']||null:null,'attributes':_0x5582f3['options']?_0x5582f3['options'][_0x2506('0x18')]||null:null,'include':_0x5582f3[_0x2506('0x17')]?_0x5582f3[_0x2506('0x17')][_0x2506('0x19')]?_[_0x2506('0x1a')](_0x5582f3[_0x2506('0x17')][_0x2506('0x19')],function(_0x113d13){return{'model':db[_0x113d13[_0x2506('0x1b')]],'as':_0x113d13['as'],'attributes':_0x113d13[_0x2506('0x18')],'include':_0x113d13[_0x2506('0x19')]?_[_0x2506('0x1a')](_0x113d13[_0x2506('0x19')],function(_0x3892cc){return{'model':db[_0x3892cc[_0x2506('0x1b')]],'as':_0x3892cc['as'],'attributes':_0x3892cc[_0x2506('0x18')],'include':_0x3892cc[_0x2506('0x19')]?_[_0x2506('0x1a')](_0x3892cc[_0x2506('0x19')],function(_0x40a48f){return{'model':db[_0x40a48f[_0x2506('0x1b')]],'as':_0x40a48f['as'],'attributes':_0x40a48f[_0x2506('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20a3ce){logger['info'](_0x2506('0x1c'),_0x5582f3);logger[_0x2506('0xf')]('ShowSquareOdbc',_0x5582f3,JSON[_0x2506('0x11')](_0x20a3ce));_0x2180b8(_0x20a3ce);})['catch'](function(_0x3e4ae7){logger[_0x2506('0x12')](_0x2506('0x1c'),_0x3e4ae7[_0x2506('0x13')],_0x5582f3);_0x468808(_0x1a3d7b[_0x2506('0x12')](0x1f4,_0x3e4ae7[_0x2506('0x13')]));});});}; \ No newline at end of file +var _0xae6b=['ShowSquareOdbc','SquareOdbc','options','where','attributes','include','model','map','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','stringify','error','SquareOdbc,\x20%s,\x20%s','message','catch'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xae6b,0xb1));var _0xbae6=function(_0x103f5d,_0xb26b06){_0x103f5d=_0x103f5d-0x0;var _0x4900eb=_0xae6b[_0x103f5d];return _0x4900eb;};'use strict';var _=require(_0xbae6('0x0'));var util=require('util');var moment=require(_0xbae6('0x1'));var BPromise=require(_0xbae6('0x2'));var rs=require(_0xbae6('0x3'));var fs=require('fs');var Redis=require(_0xbae6('0x4'));var db=require(_0xbae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbae6('0x6'))(_0xbae6('0x7'));var config=require('../../config/environment');var jayson=require(_0xbae6('0x8'));var client=jayson[_0xbae6('0x9')][_0xbae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e1465,_0x396eb5,_0x4c1cbb){return new BPromise(function(_0x28c47b,_0x334993){return client['request'](_0x1e1465,_0x4c1cbb)[_0xbae6('0xb')](function(_0x2e377b){logger[_0xbae6('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x396eb5,_0xbae6('0xd'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x396eb5,_0xbae6('0xd'),JSON[_0xbae6('0xe')](_0x2e377b));if(_0x2e377b['error']){if(_0x2e377b[_0xbae6('0xf')]['code']===0x1f4){logger[_0xbae6('0xf')](_0xbae6('0x10'),_0x396eb5,_0x2e377b[_0xbae6('0xf')][_0xbae6('0x11')]);return _0x334993(_0x2e377b['error'][_0xbae6('0x11')]);}logger[_0xbae6('0xf')](_0xbae6('0x10'),_0x396eb5,_0x2e377b[_0xbae6('0xf')][_0xbae6('0x11')]);return _0x28c47b(_0x2e377b[_0xbae6('0xf')][_0xbae6('0x11')]);}else{logger['info'](_0xbae6('0x10'),_0x396eb5,'request\x20sent');_0x28c47b(_0x2e377b['result'][_0xbae6('0x11')]);}})[_0xbae6('0x12')](function(_0x271691){logger['error'](_0xbae6('0x10'),_0x396eb5,_0x271691);_0x334993(_0x271691);});});}exports[_0xbae6('0x13')]=function(_0x4f111d){var _0x12fa22=this;return new Promise(function(_0x23069f,_0x5e06fa){return db[_0xbae6('0x14')]['find']({'raw':_0x4f111d['options']?_0x4f111d[_0xbae6('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4f111d[_0xbae6('0x15')]?_0x4f111d['options'][_0xbae6('0x16')]||null:null,'attributes':_0x4f111d['options']?_0x4f111d[_0xbae6('0x15')][_0xbae6('0x17')]||null:null,'include':_0x4f111d[_0xbae6('0x15')]?_0x4f111d[_0xbae6('0x15')][_0xbae6('0x18')]?_['map'](_0x4f111d[_0xbae6('0x15')][_0xbae6('0x18')],function(_0x496412){return{'model':db[_0x496412[_0xbae6('0x19')]],'as':_0x496412['as'],'attributes':_0x496412['attributes'],'include':_0x496412[_0xbae6('0x18')]?_[_0xbae6('0x1a')](_0x496412['include'],function(_0xd74a9c){return{'model':db[_0xd74a9c[_0xbae6('0x19')]],'as':_0xd74a9c['as'],'attributes':_0xd74a9c[_0xbae6('0x17')],'include':_0xd74a9c['include']?_[_0xbae6('0x1a')](_0xd74a9c[_0xbae6('0x18')],function(_0x5602c7){return{'model':db[_0x5602c7[_0xbae6('0x19')]],'as':_0x5602c7['as'],'attributes':_0x5602c7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4574e9){logger['info'](_0xbae6('0x13'),_0x4f111d);logger[_0xbae6('0x1b')](_0xbae6('0x13'),_0x4f111d,JSON['stringify'](_0x4574e9));_0x23069f(_0x4574e9);})['catch'](function(_0x30e90a){logger[_0xbae6('0xf')](_0xbae6('0x13'),_0x30e90a[_0xbae6('0x11')],_0x4f111d);_0x5e06fa(_0x12fa22[_0xbae6('0xf')](0x1f4,_0x30e90a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 5857a0f..4b7ce43 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 _0xa1cc=['isAuthenticated','index','show','post','create','/:id/users','addUsers','/:id','delete','destroy','removeUsers','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./squareProject.controller','get'];(function(_0x2d224c,_0x4602fa){var _0x47f222=function(_0x44633f){while(--_0x44633f){_0x2d224c['push'](_0x2d224c['shift']());}};_0x47f222(++_0x4602fa);}(_0xa1cc,0x10f));var _0xca1c=function(_0x299615,_0x196441){_0x299615=_0x299615-0x0;var _0x47b824=_0xa1cc[_0x299615];return _0x47b824;};'use strict';var multer=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var path=require(_0xca1c('0x2'));var timeout=require('connect-timeout');var express=require(_0xca1c('0x3'));var router=express[_0xca1c('0x4')]();var fs_extra=require(_0xca1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca1c('0x6'));var config=require('../../config/environment');var controller=require(_0xca1c('0x7'));router[_0xca1c('0x8')]('/',auth[_0xca1c('0x9')](),controller[_0xca1c('0xa')]);router['get']('/:id',auth[_0xca1c('0x9')](),controller[_0xca1c('0xb')]);router[_0xca1c('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getUsers']);router[_0xca1c('0xc')]('/',auth['isAuthenticated'](),controller[_0xca1c('0xd')]);router[_0xca1c('0xc')](_0xca1c('0xe'),auth[_0xca1c('0x9')](),controller[_0xca1c('0xf')]);router['put'](_0xca1c('0x10'),auth[_0xca1c('0x9')](),controller['update']);router[_0xca1c('0x11')]('/:id',auth[_0xca1c('0x9')](),controller[_0xca1c('0x12')]);router[_0xca1c('0x11')]('/:id/users',auth[_0xca1c('0x9')](),controller[_0xca1c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc19a=['getUsers','post','create','addUsers','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','isAuthenticated','index','/:id','/:id/users'];(function(_0x3eff47,_0x2796a1){var _0x8c1be2=function(_0x43d039){while(--_0x43d039){_0x3eff47['push'](_0x3eff47['shift']());}};_0x8c1be2(++_0x2796a1);}(_0xc19a,0x7f));var _0xac19=function(_0xc0ce99,_0x2b6ac3){_0xc0ce99=_0xc0ce99-0x0;var _0x4e2138=_0xc19a[_0xc0ce99];return _0x4e2138;};'use strict';var multer=require(_0xac19('0x0'));var util=require(_0xac19('0x1'));var path=require(_0xac19('0x2'));var timeout=require(_0xac19('0x3'));var express=require('express');var router=express[_0xac19('0x4')]();var fs_extra=require(_0xac19('0x5'));var auth=require(_0xac19('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xac19('0x7'));var controller=require(_0xac19('0x8'));router['get']('/',auth[_0xac19('0x9')](),controller[_0xac19('0xa')]);router['get'](_0xac19('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xac19('0xc'),auth[_0xac19('0x9')](),controller[_0xac19('0xd')]);router[_0xac19('0xe')]('/',auth[_0xac19('0x9')](),controller[_0xac19('0xf')]);router[_0xac19('0xe')](_0xac19('0xc'),auth['isAuthenticated'](),controller[_0xac19('0x10')]);router[_0xac19('0x11')](_0xac19('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xac19('0x9')](),controller[_0xac19('0x12')]);router['delete']('/:id/users',auth[_0xac19('0x9')](),controller['removeUsers']);module[_0xac19('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index ac4360b..71650ef 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 _0x6519=['utf8','production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0xa9e99e,_0x2166c7){var _0x1d0bb0=function(_0x4e3140){while(--_0x4e3140){_0xa9e99e['push'](_0xa9e99e['shift']());}};_0x1d0bb0(++_0x2166c7);}(_0x6519,0x163));var _0x9651=function(_0x225d44,_0x399b52){_0x225d44=_0x225d44-0x0;var _0x4aa98a=_0x6519[_0x225d44];return _0x4aa98a;};'use strict';var Sequelize=require(_0x9651('0x0'));module[_0x9651('0x1')]={'name':{'type':Sequelize[_0x9651('0x2')],'unique':_0x9651('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9651('0x2')]},'notes':{'type':Sequelize[_0x9651('0x4')]},'preproduction':{'type':Sequelize[_0x9651('0x5')](_0x9651('0x6')),'get':function(){if(this[_0x9651('0x7')](_0x9651('0x8'))){return this['getDataValue'](_0x9651('0x8'))['toString'](_0x9651('0x9'));}}},'production':{'type':Sequelize[_0x9651('0x5')](_0x9651('0x6')),'get':function(){if(this['getDataValue'](_0x9651('0xa'))){return this[_0x9651('0x7')](_0x9651('0xa'))[_0x9651('0xb')](_0x9651('0x9'));}}},'savedAt':{'type':Sequelize[_0x9651('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xfffd=['sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8','DATE'];(function(_0x2f36d2,_0x24285c){var _0x147f7f=function(_0x41db50){while(--_0x41db50){_0x2f36d2['push'](_0x2f36d2['shift']());}};_0x147f7f(++_0x24285c);}(_0xfffd,0xea));var _0xdfff=function(_0x4a7ee2,_0x8a6fe7){_0x4a7ee2=_0x4a7ee2-0x0;var _0x1d1fd9=_0xfffd[_0x4a7ee2];return _0x1d1fd9;};'use strict';var Sequelize=require(_0xdfff('0x0'));module[_0xdfff('0x1')]={'name':{'type':Sequelize[_0xdfff('0x2')],'unique':_0xdfff('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdfff('0x2')]},'notes':{'type':Sequelize[_0xdfff('0x4')]},'preproduction':{'type':Sequelize[_0xdfff('0x5')](_0xdfff('0x6')),'get':function(){if(this[_0xdfff('0x7')](_0xdfff('0x8'))){return this[_0xdfff('0x7')](_0xdfff('0x8'))[_0xdfff('0x9')]('utf8');}}},'production':{'type':Sequelize[_0xdfff('0x5')]('long'),'get':function(){if(this[_0xdfff('0x7')](_0xdfff('0xa'))){return this['getDataValue']('production')[_0xdfff('0x9')](_0xdfff('0xb'));}}},'savedAt':{'type':Sequelize[_0xdfff('0xc')]},'publishedAt':{'type':Sequelize[_0xdfff('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 1f7cc82..bb48bc5 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 _0x63be=['error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','filter','getUsers','catch','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','limit','undefined','offset','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource'];(function(_0x643bf4,_0x2d888f){var _0x3657b3=function(_0x2a3231){while(--_0x2a3231){_0x643bf4['push'](_0x643bf4['shift']());}};_0x3657b3(++_0x2d888f);}(_0x63be,0x94));var _0xe63b=function(_0x51e7f6,_0x572d69){_0x51e7f6=_0x51e7f6-0x0;var _0x3eb052=_0x63be[_0x51e7f6];return _0x3eb052;};'use strict';var emlformat=require(_0xe63b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe63b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe63b('0x2'));var BPromise=require(_0xe63b('0x3'));var Mustache=require(_0xe63b('0x4'));var util=require(_0xe63b('0x5'));var path=require(_0xe63b('0x6'));var sox=require('sox');var csv=require(_0xe63b('0x7'));var ejs=require(_0xe63b('0x8'));var fs=require('fs');var fs_extra=require(_0xe63b('0x9'));var _=require(_0xe63b('0xa'));var squel=require(_0xe63b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe63b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe63b('0xd'));var Papa=require('papaparse');var Redis=require(_0xe63b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe63b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe63b('0x10'))(_0xe63b('0x11'));var utils=require('../../config/utils');var config=require(_0xe63b('0x12'));var licenseUtil=require(_0xe63b('0x13'));var db=require(_0xe63b('0x14'))['db'];config[_0xe63b('0x15')]=_[_0xe63b('0x16')](config[_0xe63b('0x15')],{'host':_0xe63b('0x17'),'port':0x18eb});var socket=require(_0xe63b('0x18'))(new Redis(config[_0xe63b('0x15')]));require(_0xe63b('0x19'))[_0xe63b('0x1a')](socket);function respondWithStatusCode(_0x350afc,_0x4cbfd7){_0x4cbfd7=_0x4cbfd7||0xcc;return function(_0x450844){if(_0x450844){return _0x350afc[_0xe63b('0x1b')](_0x4cbfd7);}return _0x350afc['status'](_0x4cbfd7)[_0xe63b('0x1c')]();};}function respondWithResult(_0x494d79,_0x57c7b0){_0x57c7b0=_0x57c7b0||0xc8;return function(_0x3b46e7){if(_0x3b46e7){return _0x494d79['status'](_0x57c7b0)['json'](_0x3b46e7);}};}function respondWithFilteredResult(_0x348008,_0x5f2f57){return function(_0x30cd97){if(_0x30cd97){var _0x4a2be0=typeof _0x5f2f57['offset']==='undefined'&&typeof _0x5f2f57[_0xe63b('0x1d')]===_0xe63b('0x1e');var _0x10e36f=_0x30cd97['count'];var _0x49c569=_0x4a2be0?0x0:_0x5f2f57[_0xe63b('0x1f')];var _0x5b6f40=_0x4a2be0?_0x30cd97[_0xe63b('0x20')]:_0x5f2f57[_0xe63b('0x1f')]+_0x5f2f57['limit'];var _0x23efb2;if(_0x5b6f40>=_0x10e36f){_0x5b6f40=_0x10e36f;_0x23efb2=0xc8;}else{_0x23efb2=0xce;}_0x348008[_0xe63b('0x21')](_0x23efb2);return _0x348008[_0xe63b('0x22')](_0xe63b('0x23'),_0x49c569+'-'+_0x5b6f40+'/'+_0x10e36f)[_0xe63b('0x24')](_0x30cd97);}return null;};}function patchUpdates(_0x2a4d94){return function(_0xf8f37e){try{jsonpatch[_0xe63b('0x25')](_0xf8f37e,_0x2a4d94,!![]);}catch(_0x351233){return BPromise[_0xe63b('0x26')](_0x351233);}return _0xf8f37e[_0xe63b('0x27')]();};}function saveUpdates(_0x4f5815,_0x3d0171){return function(_0x410feb){if(_0x410feb){return _0x410feb[_0xe63b('0x28')](_0x4f5815)[_0xe63b('0x29')](function(_0x126024){return _0x126024;});}return null;};}function removeEntity(_0x4e33c5,_0x275855){return function(_0x5fdc15){if(_0x5fdc15){return _0x5fdc15[_0xe63b('0x2a')]()[_0xe63b('0x29')](function(){var _0x8fb7d6=_0x5fdc15[_0xe63b('0x2b')]({'plain':!![]});var _0x3c9123=_0xe63b('0x2c');return db[_0xe63b('0x2d')]['destroy']({'where':{'type':_0x3c9123,'resourceId':_0x8fb7d6['id']}})['then'](function(){return _0x5fdc15;});})[_0xe63b('0x29')](function(){_0x4e33c5['status'](0xcc)[_0xe63b('0x1c')]();});}};}function handleEntityNotFound(_0xd2d95,_0x47ca1a){return function(_0x2407e8){if(!_0x2407e8){_0xd2d95[_0xe63b('0x1b')](0x194);}return _0x2407e8;};}function handleError(_0x29e995,_0x5dad79){_0x5dad79=_0x5dad79||0x1f4;return function(_0x5cd073){logger[_0xe63b('0x2e')](_0x5cd073[_0xe63b('0x2f')]);if(_0x5cd073['name']){delete _0x5cd073[_0xe63b('0x30')];}_0x29e995[_0xe63b('0x21')](_0x5dad79)[_0xe63b('0x31')](_0x5cd073);};}exports[_0xe63b('0x32')]=function(_0x432029,_0x81fb64){var _0x5db180={},_0x483510={},_0xd4b88b={'count':0x0,'rows':[]};var _0x492486=_[_0xe63b('0x33')](db[_0xe63b('0x34')][_0xe63b('0x35')],function(_0x1ace9b){return{'name':_0x1ace9b[_0xe63b('0x36')],'type':_0x1ace9b[_0xe63b('0x37')][_0xe63b('0x38')]};});_0x483510[_0xe63b('0x39')]=_[_0xe63b('0x33')](_0x492486,'name');_0x483510[_0xe63b('0x3a')]=_[_0xe63b('0x3b')](_0x432029['query']);_0x483510[_0xe63b('0x3c')]=_[_0xe63b('0x3d')](_0x483510[_0xe63b('0x39')],_0x483510['query']);_0x5db180[_0xe63b('0x3e')]=_['intersection'](_0x483510[_0xe63b('0x39')],qs[_0xe63b('0x3f')](_0x432029[_0xe63b('0x3a')]['fields']));_0x5db180['attributes']=_0x5db180['attributes'][_0xe63b('0x40')]?_0x5db180[_0xe63b('0x3e')]:_0x483510['model'];if(!_0x432029['query'][_0xe63b('0x41')](_0xe63b('0x42'))){_0x5db180[_0xe63b('0x1d')]=qs[_0xe63b('0x1d')](_0x432029[_0xe63b('0x3a')][_0xe63b('0x1d')]);_0x5db180[_0xe63b('0x1f')]=qs[_0xe63b('0x1f')](_0x432029[_0xe63b('0x3a')][_0xe63b('0x1f')]);}_0x5db180[_0xe63b('0x43')]=qs['sort'](_0x432029[_0xe63b('0x3a')][_0xe63b('0x44')]);_0x5db180['where']=qs[_0xe63b('0x3c')](_[_0xe63b('0x45')](_0x432029[_0xe63b('0x3a')],_0x483510[_0xe63b('0x3c')]),_0x492486);if(_0x432029[_0xe63b('0x3a')]['filter']){_0x5db180[_0xe63b('0x46')]=_['merge'](_0x5db180[_0xe63b('0x46')],{'$or':_[_0xe63b('0x33')](_0x492486,function(_0x26f2e5){if(_0x26f2e5[_0xe63b('0x37')]!==_0xe63b('0x47')){var _0x460f40={};_0x460f40[_0x26f2e5[_0xe63b('0x30')]]={'$like':'%'+_0x432029[_0xe63b('0x3a')]['filter']+'%'};return _0x460f40;}})});}_0x5db180=_[_0xe63b('0x48')]({},_0x5db180,_0x432029[_0xe63b('0x49')]);var _0x1e3a6f={'where':_0x5db180['where']};return db[_0xe63b('0x34')][_0xe63b('0x20')](_0x1e3a6f)[_0xe63b('0x29')](function(_0x4c1a38){_0xd4b88b[_0xe63b('0x20')]=_0x4c1a38;if(_0x432029[_0xe63b('0x3a')][_0xe63b('0x4a')]){_0x5db180['include']=[{'all':!![]}];}return db['SquareProject'][_0xe63b('0x4b')](_0x5db180);})[_0xe63b('0x29')](function(_0x261899){_0xd4b88b[_0xe63b('0x4c')]=_0x261899;return _0xd4b88b;})[_0xe63b('0x29')](respondWithFilteredResult(_0x81fb64,_0x5db180))['catch'](handleError(_0x81fb64,null));};exports[_0xe63b('0x4d')]=function(_0x1392e5,_0x360581){var _0x18d7e9={'raw':![],'where':{'id':_0x1392e5[_0xe63b('0x4e')]['id']}},_0x47edc9={};_0x47edc9[_0xe63b('0x39')]=_[_0xe63b('0x3b')](db[_0xe63b('0x34')]['rawAttributes']);_0x47edc9[_0xe63b('0x3a')]=_[_0xe63b('0x3b')](_0x1392e5[_0xe63b('0x3a')]);_0x47edc9[_0xe63b('0x3c')]=_[_0xe63b('0x3d')](_0x47edc9[_0xe63b('0x39')],_0x47edc9[_0xe63b('0x3a')]);_0x18d7e9['attributes']=_[_0xe63b('0x3d')](_0x47edc9['model'],qs[_0xe63b('0x3f')](_0x1392e5[_0xe63b('0x3a')][_0xe63b('0x3f')]));_0x18d7e9['attributes']=_0x18d7e9[_0xe63b('0x3e')][_0xe63b('0x40')]?_0x18d7e9['attributes']:_0x47edc9[_0xe63b('0x39')];if(_0x1392e5[_0xe63b('0x3a')][_0xe63b('0x4a')]){_0x18d7e9['include']=[{'all':!![]}];}_0x18d7e9=_[_0xe63b('0x48')]({},_0x18d7e9,_0x1392e5['options']);return db['SquareProject'][_0xe63b('0x4f')](_0x18d7e9)[_0xe63b('0x29')](handleEntityNotFound(_0x360581,null))[_0xe63b('0x29')](respondWithResult(_0x360581,null))['catch'](handleError(_0x360581,null));};exports[_0xe63b('0x50')]=function(_0x4905ce,_0x51a910){return db[_0xe63b('0x34')][_0xe63b('0x50')](_0x4905ce['body'],{})[_0xe63b('0x29')](function(_0x446624){var _0x585da3=_0x4905ce['user'][_0xe63b('0x2b')]({'plain':!![]});if(!_0x585da3)throw new Error(_0xe63b('0x51'));if(_0x585da3['role']===_0xe63b('0x52')){var _0x4c05ad=_0x446624[_0xe63b('0x2b')]({'plain':!![]});var _0x4aa46c=_0xe63b('0x2c');return db[_0xe63b('0x53')][_0xe63b('0x4f')]({'where':{'name':_0x4aa46c,'userProfileId':_0x585da3[_0xe63b('0x54')]},'raw':!![]})[_0xe63b('0x29')](function(_0x77c671){if(_0x77c671&&_0x77c671['autoAssociation']===0x0){return db[_0xe63b('0x2d')][_0xe63b('0x50')]({'name':_0x4c05ad['name'],'resourceId':_0x4c05ad['id'],'type':_0x77c671[_0xe63b('0x30')],'sectionId':_0x77c671['id']},{})[_0xe63b('0x29')](function(){return _0x446624;});}else{return _0x446624;}})['catch'](function(_0x525fe7){logger['error'](_0xe63b('0x55'),_0x525fe7);throw _0x525fe7;});}return _0x446624;})[_0xe63b('0x29')](respondWithResult(_0x51a910,0xc9))['catch'](handleError(_0x51a910,null));};exports[_0xe63b('0x28')]=function(_0x3ef71a,_0x571801){if(_0x3ef71a[_0xe63b('0x56')]['id']){delete _0x3ef71a['body']['id'];}return db[_0xe63b('0x34')][_0xe63b('0x4f')]({'where':{'id':_0x3ef71a['params']['id']}})['then'](handleEntityNotFound(_0x571801,null))[_0xe63b('0x29')](saveUpdates(_0x3ef71a[_0xe63b('0x56')],null))[_0xe63b('0x29')](respondWithResult(_0x571801,null))['catch'](handleError(_0x571801,null));};exports[_0xe63b('0x2a')]=function(_0x3d6330,_0x22dede){return db[_0xe63b('0x34')]['find']({'where':{'id':_0x3d6330[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x22dede,null))[_0xe63b('0x29')](removeEntity(_0x22dede,null))['catch'](handleError(_0x22dede,null));};exports[_0xe63b('0x57')]=function(_0x548e0c,_0x3f945b,_0x2c2a29){return db[_0xe63b('0x34')][_0xe63b('0x4f')]({'where':{'id':_0x548e0c[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x3f945b,null))['then'](function(_0x40b851){if(_0x40b851){return _0x40b851[_0xe63b('0x57')](_0x548e0c[_0xe63b('0x56')][_0xe63b('0x58')],_[_0xe63b('0x59')](_0x548e0c[_0xe63b('0x56')],[_0xe63b('0x58'),'id'])||{});}})[_0xe63b('0x29')](respondWithResult(_0x3f945b,null))['catch'](handleError(_0x3f945b,null));};exports['removeUsers']=function(_0x2cc994,_0x212f91,_0x38b16f){return db[_0xe63b('0x34')][_0xe63b('0x4f')]({'where':{'id':_0x2cc994[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x212f91,null))['then'](function(_0x46ca08){if(_0x46ca08){return _0x46ca08[_0xe63b('0x5a')](_0x2cc994[_0xe63b('0x3a')][_0xe63b('0x58')])['then'](function(){if(_[_0xe63b('0x5b')](_0x2cc994['query']['ids'])){for(var _0x2ae8df=0x0;_0x2ae8df<_0x2cc994['query'][_0xe63b('0x58')][_0xe63b('0x40')];_0x2ae8df+=0x1){socket[_0xe63b('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x2cc994[_0xe63b('0x3a')]['ids'][_0x2ae8df]),'SquareProjectId':Number(_0x2cc994[_0xe63b('0x4e')]['id'])});}}else{socket[_0xe63b('0x5c')](_0xe63b('0x5d'),{'UserId':Number(_0x2cc994['query'][_0xe63b('0x58')]),'SquareProjectId':Number(_0x2cc994[_0xe63b('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x212f91,null))['catch'](handleError(_0x212f91,null));};exports['getUsers']=function(_0xff2e5a,_0x304310,_0x3ad392){var _0x1b458b={};var _0x7084c7={};var _0x2426e6;var _0x38bafc;return db[_0xe63b('0x34')]['findOne']({'where':{'id':_0xff2e5a[_0xe63b('0x4e')]['id']}})[_0xe63b('0x29')](handleEntityNotFound(_0x304310,null))[_0xe63b('0x29')](function(_0x58ea16){if(_0x58ea16){_0x2426e6=_0x58ea16;_0x7084c7['model']=_[_0xe63b('0x3b')](db['User']['rawAttributes']);_0x7084c7[_0xe63b('0x3a')]=_[_0xe63b('0x3b')](_0xff2e5a['query']);_0x7084c7[_0xe63b('0x3c')]=_[_0xe63b('0x3d')](_0x7084c7[_0xe63b('0x39')],_0x7084c7['query']);_0x1b458b['attributes']=_[_0xe63b('0x3d')](_0x7084c7['model'],qs['fields'](_0xff2e5a['query'][_0xe63b('0x3f')]));_0x1b458b[_0xe63b('0x3e')]=_0x1b458b[_0xe63b('0x3e')][_0xe63b('0x40')]?_0x1b458b[_0xe63b('0x3e')]:_0x7084c7[_0xe63b('0x39')];_0x1b458b['order']=qs[_0xe63b('0x44')](_0xff2e5a['query'][_0xe63b('0x44')]);_0x1b458b[_0xe63b('0x46')]=qs[_0xe63b('0x3c')](_[_0xe63b('0x45')](_0xff2e5a['query'],_0x7084c7[_0xe63b('0x3c')]));if(_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x5e')]){_0x1b458b[_0xe63b('0x46')]=_[_0xe63b('0x48')](_0x1b458b['where'],{'$or':_['map'](_0x1b458b[_0xe63b('0x3e')],function(_0x442cbe){var _0x41d544={};_0x41d544[_0x442cbe]={'$like':'%'+_0xff2e5a[_0xe63b('0x3a')]['filter']+'%'};return _0x41d544;})});}_0x1b458b=_[_0xe63b('0x48')]({},_0x1b458b,_0xff2e5a[_0xe63b('0x49')]);return _0x2426e6['getUsers'](_0x1b458b);}})[_0xe63b('0x29')](function(_0x4ccb5d){if(_0x4ccb5d){_0x38bafc=_0x4ccb5d[_0xe63b('0x40')];if(!_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x41')](_0xe63b('0x42'))){_0x1b458b[_0xe63b('0x1d')]=qs[_0xe63b('0x1d')](_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x1d')]);_0x1b458b[_0xe63b('0x1f')]=qs[_0xe63b('0x1f')](_0xff2e5a[_0xe63b('0x3a')][_0xe63b('0x1f')]);}return _0x2426e6[_0xe63b('0x5f')](_0x1b458b);}})['then'](function(_0x4b5e26){if(_0x4b5e26){return _0x4b5e26?{'count':_0x38bafc,'rows':_0x4b5e26}:null;}})['then'](respondWithResult(_0x304310,null))[_0xe63b('0x60')](handleError(_0x304310,null));}; \ No newline at end of file +var _0x715e=['hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','count','include','SquareProject','rows','params','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ids','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','pick','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','send','index','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x3e3529,_0x5bbf81){var _0x4dd0b5=function(_0x1b6a45){while(--_0x1b6a45){_0x3e3529['push'](_0x3e3529['shift']());}};_0x4dd0b5(++_0x5bbf81);}(_0x715e,0x7b));var _0xe715=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x715e[_0x24061a];return _0x82054e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe715('0x0'));var zipdir=require(_0xe715('0x1'));var jsonpatch=require(_0xe715('0x2'));var rp=require('request-promise');var moment=require(_0xe715('0x3'));var BPromise=require(_0xe715('0x4'));var Mustache=require(_0xe715('0x5'));var util=require(_0xe715('0x6'));var path=require(_0xe715('0x7'));var sox=require(_0xe715('0x8'));var csv=require(_0xe715('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe715('0xa'));var _=require('lodash');var squel=require(_0xe715('0xb'));var crypto=require(_0xe715('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe715('0xd'));var toCsv=require(_0xe715('0x9'));var querystring=require('querystring');var Papa=require(_0xe715('0xe'));var Redis=require(_0xe715('0xf'));var authService=require(_0xe715('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe715('0x11'));var hardwareService=require(_0xe715('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe715('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe715('0x14'));var db=require(_0xe715('0x15'))['db'];config['redis']=_[_0xe715('0x16')](config[_0xe715('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe715('0x18'))(new Redis(config[_0xe715('0x17')]));require(_0xe715('0x19'))[_0xe715('0x1a')](socket);function respondWithStatusCode(_0x428669,_0x1a1039){_0x1a1039=_0x1a1039||0xcc;return function(_0x3f9e7c){if(_0x3f9e7c){return _0x428669[_0xe715('0x1b')](_0x1a1039);}return _0x428669[_0xe715('0x1c')](_0x1a1039)[_0xe715('0x1d')]();};}function respondWithResult(_0x5de3aa,_0x41e75e){_0x41e75e=_0x41e75e||0xc8;return function(_0x33e409){if(_0x33e409){return _0x5de3aa[_0xe715('0x1c')](_0x41e75e)[_0xe715('0x1e')](_0x33e409);}};}function respondWithFilteredResult(_0x41cfb9,_0xc3f43e){return function(_0x13ac1f){if(_0x13ac1f){var _0x1fe1d2=typeof _0xc3f43e[_0xe715('0x1f')]===_0xe715('0x20')&&typeof _0xc3f43e[_0xe715('0x21')]==='undefined';var _0x45eed1=_0x13ac1f['count'];var _0xb89e89=_0x1fe1d2?0x0:_0xc3f43e[_0xe715('0x1f')];var _0x1555d0=_0x1fe1d2?_0x13ac1f['count']:_0xc3f43e[_0xe715('0x1f')]+_0xc3f43e['limit'];var _0x58e015;if(_0x1555d0>=_0x45eed1){_0x1555d0=_0x45eed1;_0x58e015=0xc8;}else{_0x58e015=0xce;}_0x41cfb9[_0xe715('0x1c')](_0x58e015);return _0x41cfb9['set'](_0xe715('0x22'),_0xb89e89+'-'+_0x1555d0+'/'+_0x45eed1)[_0xe715('0x1e')](_0x13ac1f);}return null;};}function patchUpdates(_0x3579fb){return function(_0x2dc219){try{jsonpatch[_0xe715('0x23')](_0x2dc219,_0x3579fb,!![]);}catch(_0x53826e){return BPromise[_0xe715('0x24')](_0x53826e);}return _0x2dc219[_0xe715('0x25')]();};}function saveUpdates(_0x42dbef,_0x226fc0){return function(_0x13e379){if(_0x13e379){return _0x13e379[_0xe715('0x26')](_0x42dbef)[_0xe715('0x27')](function(_0xc9824a){return _0xc9824a;});}return null;};}function removeEntity(_0x12f8a6,_0x52b9f0){return function(_0x33bb37){if(_0x33bb37){return _0x33bb37[_0xe715('0x28')]()['then'](function(){var _0x5da6ee=_0x33bb37[_0xe715('0x29')]({'plain':!![]});var _0x1c93a9='SquareProjects';return db[_0xe715('0x2a')][_0xe715('0x28')]({'where':{'type':_0x1c93a9,'resourceId':_0x5da6ee['id']}})[_0xe715('0x27')](function(){return _0x33bb37;});})[_0xe715('0x27')](function(){_0x12f8a6[_0xe715('0x1c')](0xcc)[_0xe715('0x1d')]();});}};}function handleEntityNotFound(_0x27ab6a,_0x4fc0f3){return function(_0x177d9d){if(!_0x177d9d){_0x27ab6a[_0xe715('0x1b')](0x194);}return _0x177d9d;};}function handleError(_0x306dde,_0x2e0c95){_0x2e0c95=_0x2e0c95||0x1f4;return function(_0x345ce6){logger[_0xe715('0x2b')](_0x345ce6['stack']);if(_0x345ce6['name']){delete _0x345ce6['name'];}_0x306dde[_0xe715('0x1c')](_0x2e0c95)[_0xe715('0x2c')](_0x345ce6);};}exports[_0xe715('0x2d')]=function(_0x42cc50,_0x4fed11){var _0x4f3343={},_0x57d06e={},_0x1abb5d={'count':0x0,'rows':[]};var _0x18ab26=_['map'](db['SquareProject'][_0xe715('0x2e')],function(_0x3ef997){return{'name':_0x3ef997['fieldName'],'type':_0x3ef997[_0xe715('0x2f')][_0xe715('0x30')]};});_0x57d06e[_0xe715('0x31')]=_['map'](_0x18ab26,_0xe715('0x32'));_0x57d06e[_0xe715('0x33')]=_[_0xe715('0x34')](_0x42cc50[_0xe715('0x33')]);_0x57d06e[_0xe715('0x35')]=_[_0xe715('0x36')](_0x57d06e[_0xe715('0x31')],_0x57d06e['query']);_0x4f3343[_0xe715('0x37')]=_[_0xe715('0x36')](_0x57d06e[_0xe715('0x31')],qs[_0xe715('0x38')](_0x42cc50[_0xe715('0x33')]['fields']));_0x4f3343[_0xe715('0x37')]=_0x4f3343[_0xe715('0x37')]['length']?_0x4f3343[_0xe715('0x37')]:_0x57d06e[_0xe715('0x31')];if(!_0x42cc50['query'][_0xe715('0x39')](_0xe715('0x3a'))){_0x4f3343[_0xe715('0x21')]=qs['limit'](_0x42cc50[_0xe715('0x33')][_0xe715('0x21')]);_0x4f3343[_0xe715('0x1f')]=qs[_0xe715('0x1f')](_0x42cc50['query'][_0xe715('0x1f')]);}_0x4f3343[_0xe715('0x3b')]=qs['sort'](_0x42cc50[_0xe715('0x33')][_0xe715('0x3c')]);_0x4f3343[_0xe715('0x3d')]=qs[_0xe715('0x35')](_['pick'](_0x42cc50[_0xe715('0x33')],_0x57d06e[_0xe715('0x35')]),_0x18ab26);if(_0x42cc50[_0xe715('0x33')][_0xe715('0x3e')]){_0x4f3343[_0xe715('0x3d')]=_[_0xe715('0x3f')](_0x4f3343['where'],{'$or':_[_0xe715('0x40')](_0x18ab26,function(_0x1632e4){if(_0x1632e4[_0xe715('0x2f')]!==_0xe715('0x41')){var _0x3db0f1={};_0x3db0f1[_0x1632e4[_0xe715('0x32')]]={'$like':'%'+_0x42cc50[_0xe715('0x33')][_0xe715('0x3e')]+'%'};return _0x3db0f1;}})});}_0x4f3343=_[_0xe715('0x3f')]({},_0x4f3343,_0x42cc50[_0xe715('0x42')]);var _0x432cd3={'where':_0x4f3343[_0xe715('0x3d')]};return db['SquareProject'][_0xe715('0x43')](_0x432cd3)[_0xe715('0x27')](function(_0x1dc340){_0x1abb5d[_0xe715('0x43')]=_0x1dc340;if(_0x42cc50[_0xe715('0x33')]['includeAll']){_0x4f3343[_0xe715('0x44')]=[{'all':!![]}];}return db[_0xe715('0x45')]['findAll'](_0x4f3343);})[_0xe715('0x27')](function(_0x1554ed){_0x1abb5d[_0xe715('0x46')]=_0x1554ed;return _0x1abb5d;})['then'](respondWithFilteredResult(_0x4fed11,_0x4f3343))['catch'](handleError(_0x4fed11,null));};exports['show']=function(_0x9c44b6,_0x397fb6){var _0x39a40d={'raw':![],'where':{'id':_0x9c44b6[_0xe715('0x47')]['id']}},_0x135c41={};_0x135c41[_0xe715('0x31')]=_[_0xe715('0x34')](db[_0xe715('0x45')][_0xe715('0x2e')]);_0x135c41[_0xe715('0x33')]=_[_0xe715('0x34')](_0x9c44b6[_0xe715('0x33')]);_0x135c41[_0xe715('0x35')]=_[_0xe715('0x36')](_0x135c41[_0xe715('0x31')],_0x135c41[_0xe715('0x33')]);_0x39a40d[_0xe715('0x37')]=_[_0xe715('0x36')](_0x135c41[_0xe715('0x31')],qs[_0xe715('0x38')](_0x9c44b6['query'][_0xe715('0x38')]));_0x39a40d[_0xe715('0x37')]=_0x39a40d[_0xe715('0x37')][_0xe715('0x48')]?_0x39a40d[_0xe715('0x37')]:_0x135c41[_0xe715('0x31')];if(_0x9c44b6[_0xe715('0x33')][_0xe715('0x49')]){_0x39a40d[_0xe715('0x44')]=[{'all':!![]}];}_0x39a40d=_[_0xe715('0x3f')]({},_0x39a40d,_0x9c44b6[_0xe715('0x42')]);return db[_0xe715('0x45')][_0xe715('0x4a')](_0x39a40d)[_0xe715('0x27')](handleEntityNotFound(_0x397fb6,null))[_0xe715('0x27')](respondWithResult(_0x397fb6,null))[_0xe715('0x4b')](handleError(_0x397fb6,null));};exports[_0xe715('0x4c')]=function(_0x2c14e1,_0x3e4f8d){return db[_0xe715('0x45')][_0xe715('0x4c')](_0x2c14e1[_0xe715('0x4d')],{})[_0xe715('0x27')](function(_0x40d4d0){var _0x9c733d=_0x2c14e1['user'][_0xe715('0x29')]({'plain':!![]});if(!_0x9c733d)throw new Error(_0xe715('0x4e'));if(_0x9c733d[_0xe715('0x4f')]===_0xe715('0x50')){var _0x1aed6e=_0x40d4d0['get']({'plain':!![]});var _0x2f4eb7=_0xe715('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x2f4eb7,'userProfileId':_0x9c733d['userProfileId']},'raw':!![]})[_0xe715('0x27')](function(_0x5eba68){if(_0x5eba68&&_0x5eba68['autoAssociation']===0x0){return db['UserProfileResource'][_0xe715('0x4c')]({'name':_0x1aed6e[_0xe715('0x32')],'resourceId':_0x1aed6e['id'],'type':_0x5eba68[_0xe715('0x32')],'sectionId':_0x5eba68['id']},{})[_0xe715('0x27')](function(){return _0x40d4d0;});}else{return _0x40d4d0;}})[_0xe715('0x4b')](function(_0x3f0e4a){logger[_0xe715('0x2b')](_0xe715('0x52'),_0x3f0e4a);throw _0x3f0e4a;});}return _0x40d4d0;})[_0xe715('0x27')](respondWithResult(_0x3e4f8d,0xc9))[_0xe715('0x4b')](handleError(_0x3e4f8d,null));};exports['update']=function(_0x1a8178,_0x763648){if(_0x1a8178[_0xe715('0x4d')]['id']){delete _0x1a8178[_0xe715('0x4d')]['id'];}return db[_0xe715('0x45')][_0xe715('0x4a')]({'where':{'id':_0x1a8178[_0xe715('0x47')]['id']}})[_0xe715('0x27')](handleEntityNotFound(_0x763648,null))['then'](saveUpdates(_0x1a8178[_0xe715('0x4d')],null))[_0xe715('0x27')](respondWithResult(_0x763648,null))[_0xe715('0x4b')](handleError(_0x763648,null));};exports[_0xe715('0x28')]=function(_0x2887f2,_0x5a18ea){return db[_0xe715('0x45')][_0xe715('0x4a')]({'where':{'id':_0x2887f2['params']['id']}})[_0xe715('0x27')](handleEntityNotFound(_0x5a18ea,null))[_0xe715('0x27')](removeEntity(_0x5a18ea,null))[_0xe715('0x4b')](handleError(_0x5a18ea,null));};exports['addUsers']=function(_0x398810,_0x90e981,_0x25cb5c){return db[_0xe715('0x45')][_0xe715('0x4a')]({'where':{'id':_0x398810[_0xe715('0x47')]['id']}})[_0xe715('0x27')](handleEntityNotFound(_0x90e981,null))[_0xe715('0x27')](function(_0x570e75){if(_0x570e75){return _0x570e75['addUsers'](_0x398810['body']['ids'],_['omit'](_0x398810['body'],[_0xe715('0x53'),'id'])||{});}})[_0xe715('0x27')](respondWithResult(_0x90e981,null))[_0xe715('0x4b')](handleError(_0x90e981,null));};exports[_0xe715('0x54')]=function(_0x2eb0b5,_0x43b1fe,_0x357dd3){return db[_0xe715('0x45')][_0xe715('0x4a')]({'where':{'id':_0x2eb0b5[_0xe715('0x47')]['id']}})[_0xe715('0x27')](handleEntityNotFound(_0x43b1fe,null))[_0xe715('0x27')](function(_0x44cb6c){if(_0x44cb6c){return _0x44cb6c[_0xe715('0x54')](_0x2eb0b5[_0xe715('0x33')]['ids'])[_0xe715('0x27')](function(){if(_[_0xe715('0x55')](_0x2eb0b5['query'][_0xe715('0x53')])){for(var _0x5b9ae5=0x0;_0x5b9ae5<_0x2eb0b5[_0xe715('0x33')][_0xe715('0x53')][_0xe715('0x48')];_0x5b9ae5+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x2eb0b5[_0xe715('0x33')]['ids'][_0x5b9ae5]),'SquareProjectId':Number(_0x2eb0b5[_0xe715('0x47')]['id'])});}}else{socket['emit'](_0xe715('0x56'),{'UserId':Number(_0x2eb0b5[_0xe715('0x33')][_0xe715('0x53')]),'SquareProjectId':Number(_0x2eb0b5[_0xe715('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x43b1fe,null))[_0xe715('0x4b')](handleError(_0x43b1fe,null));};exports[_0xe715('0x57')]=function(_0x4e63b2,_0x52b9a6,_0xeda477){var _0x363569={};var _0x4383c2={};var _0x5a9cbe;var _0x31f952;return db[_0xe715('0x45')][_0xe715('0x58')]({'where':{'id':_0x4e63b2[_0xe715('0x47')]['id']}})[_0xe715('0x27')](handleEntityNotFound(_0x52b9a6,null))[_0xe715('0x27')](function(_0x585e51){if(_0x585e51){_0x5a9cbe=_0x585e51;_0x4383c2[_0xe715('0x31')]=_[_0xe715('0x34')](db['User'][_0xe715('0x2e')]);_0x4383c2[_0xe715('0x33')]=_['keys'](_0x4e63b2[_0xe715('0x33')]);_0x4383c2['filters']=_[_0xe715('0x36')](_0x4383c2[_0xe715('0x31')],_0x4383c2[_0xe715('0x33')]);_0x363569[_0xe715('0x37')]=_[_0xe715('0x36')](_0x4383c2[_0xe715('0x31')],qs['fields'](_0x4e63b2[_0xe715('0x33')][_0xe715('0x38')]));_0x363569[_0xe715('0x37')]=_0x363569['attributes'][_0xe715('0x48')]?_0x363569[_0xe715('0x37')]:_0x4383c2[_0xe715('0x31')];_0x363569[_0xe715('0x3b')]=qs[_0xe715('0x3c')](_0x4e63b2[_0xe715('0x33')]['sort']);_0x363569['where']=qs[_0xe715('0x35')](_[_0xe715('0x59')](_0x4e63b2[_0xe715('0x33')],_0x4383c2['filters']));if(_0x4e63b2[_0xe715('0x33')]['filter']){_0x363569[_0xe715('0x3d')]=_[_0xe715('0x3f')](_0x363569[_0xe715('0x3d')],{'$or':_[_0xe715('0x40')](_0x363569[_0xe715('0x37')],function(_0x38f545){var _0x540587={};_0x540587[_0x38f545]={'$like':'%'+_0x4e63b2[_0xe715('0x33')]['filter']+'%'};return _0x540587;})});}_0x363569=_[_0xe715('0x3f')]({},_0x363569,_0x4e63b2[_0xe715('0x42')]);return _0x5a9cbe['getUsers'](_0x363569);}})[_0xe715('0x27')](function(_0x3c6ebc){if(_0x3c6ebc){_0x31f952=_0x3c6ebc[_0xe715('0x48')];if(!_0x4e63b2[_0xe715('0x33')][_0xe715('0x39')](_0xe715('0x3a'))){_0x363569['limit']=qs['limit'](_0x4e63b2[_0xe715('0x33')][_0xe715('0x21')]);_0x363569[_0xe715('0x1f')]=qs[_0xe715('0x1f')](_0x4e63b2['query'][_0xe715('0x1f')]);}return _0x5a9cbe['getUsers'](_0x363569);}})[_0xe715('0x27')](function(_0x20e956){if(_0x20e956){return _0x20e956?{'count':_0x31f952,'rows':_0x20e956}:null;}})[_0xe715('0x27')](respondWithResult(_0x52b9a6,null))['catch'](handleError(_0x52b9a6,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6d76b85..d937fa1 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 _0x9f0b=['emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0xa9b16f,_0x1ec464){var _0x5299da=function(_0x102d2f){while(--_0x102d2f){_0xa9b16f['push'](_0xa9b16f['shift']());}};_0x5299da(++_0x1ec464);}(_0x9f0b,0x1e0));var _0xb9f0=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x9f0b[_0x35181c];return _0xe14bf9;};'use strict';var EventEmitter=require(_0xb9f0('0x0'));var SquareProject=require(_0xb9f0('0x1'))['db'][_0xb9f0('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb9f0('0x3')](0x0);var events={'afterCreate':_0xb9f0('0x4'),'afterUpdate':_0xb9f0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f1a6b){return function(_0x4cb330,_0x103a49,_0x3cb1d9){SquareProjectEvents[_0xb9f0('0x6')](_0x4f1a6b+':'+_0x4cb330['id'],_0x4cb330);SquareProjectEvents[_0xb9f0('0x6')](_0x4f1a6b,_0x4cb330);_0x3cb1d9(null);};}for(var e in events){if(events[_0xb9f0('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xb9f0('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x7a5e=['hook','events','save','update','emit','hasOwnProperty'];(function(_0x9117ad,_0x386be4){var _0x540f0c=function(_0x4e117a){while(--_0x4e117a){_0x9117ad['push'](_0x9117ad['shift']());}};_0x540f0c(++_0x386be4);}(_0x7a5e,0x103));var _0xe7a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a5e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xe7a5('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe7a5('0x1'),'afterUpdate':_0xe7a5('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5ad6ae){return function(_0x5c9d97,_0x5db443,_0x51004e){SquareProjectEvents[_0xe7a5('0x3')](_0x5ad6ae+':'+_0x5c9d97['id'],_0x5c9d97);SquareProjectEvents[_0xe7a5('0x3')](_0x5ad6ae,_0x5c9d97);_0x51004e(null);};}for(var e in events){if(events[_0xe7a5('0x4')](e)){var event=events[e];SquareProject[_0xe7a5('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index ebae450..e0a7aaa 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 _0x4925=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','production'];(function(_0x25d6ea,_0xbc9fe6){var _0x38b18f=function(_0x2b0a11){while(--_0x2b0a11){_0x25d6ea['push'](_0x25d6ea['shift']());}};_0x38b18f(++_0xbc9fe6);}(_0x4925,0xf1));var _0x5492=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x4925[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x5492('0x0'));var util=require(_0x5492('0x1'));var logger=require(_0x5492('0x2'))(_0x5492('0x3'));var moment=require(_0x5492('0x4'));var BPromise=require(_0x5492('0x5'));var rp=require(_0x5492('0x6'));var fs=require('fs');var path=require(_0x5492('0x7'));var rimraf=require(_0x5492('0x8'));var config=require(_0x5492('0x9'));var attributes=require(_0x5492('0xa'));module[_0x5492('0xb')]=function(_0x433d64,_0x210456){return _0x433d64[_0x5492('0xc')](_0x5492('0xd'),attributes,{'tableName':_0x5492('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8010ae,_0x25f3ee,_0x401667){if(_0x8010ae[_0x5492('0xf')](_0x5492('0x10'))){_0x8010ae['savedAt']=moment()[_0x5492('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x8010ae[_0x5492('0xf')](_0x5492('0x12'))){_0x8010ae['publishedAt']=moment()[_0x5492('0x11')](_0x5492('0x13'));}_0x401667(null,_0x8010ae);}}});}; \ No newline at end of file +var _0x8ba1=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt'];(function(_0x14a54a,_0x38a5c0){var _0x4d1dbe=function(_0x933ed8){while(--_0x933ed8){_0x14a54a['push'](_0x14a54a['shift']());}};_0x4d1dbe(++_0x38a5c0);}(_0x8ba1,0x19e));var _0x18ba=function(_0x2b7de0,_0x3caa50){_0x2b7de0=_0x2b7de0-0x0;var _0x407157=_0x8ba1[_0x2b7de0];return _0x407157;};'use strict';var _=require('lodash');var util=require(_0x18ba('0x0'));var logger=require(_0x18ba('0x1'))('api');var moment=require(_0x18ba('0x2'));var BPromise=require(_0x18ba('0x3'));var rp=require(_0x18ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18ba('0x5'));var config=require(_0x18ba('0x6'));var attributes=require('./squareProject.attributes');module[_0x18ba('0x7')]=function(_0x475280,_0x20ee68){return _0x475280[_0x18ba('0x8')](_0x18ba('0x9'),attributes,{'tableName':_0x18ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc3030a,_0x997350,_0x4ec5ad){if(_0xc3030a[_0x18ba('0xb')](_0x18ba('0xc'))){_0xc3030a[_0x18ba('0xd')]=moment()[_0x18ba('0xe')](_0x18ba('0xf'));}if(_0xc3030a[_0x18ba('0xb')](_0x18ba('0x10'))){_0xc3030a[_0x18ba('0x11')]=moment()['format'](_0x18ba('0xf'));}_0x4ec5ad(null,_0xc3030a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index d7cf31c..ea4f155 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 _0x4c1a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','debug','request\x20sent','stringify','error','SquareProject,\x20%s,\x20%s','message','info','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','map','include','model','lodash','moment','bluebird','randomstring'];(function(_0x2e0e1a,_0x1c2ec2){var _0xd46d6b=function(_0x4ed379){while(--_0x4ed379){_0x2e0e1a['push'](_0x2e0e1a['shift']());}};_0xd46d6b(++_0x1c2ec2);}(_0x4c1a,0xe0));var _0xa4c1=function(_0x458d3b,_0xa004c){_0x458d3b=_0x458d3b-0x0;var _0x19333e=_0x4c1a[_0x458d3b];return _0x19333e;};'use strict';var _=require(_0xa4c1('0x0'));var util=require('util');var moment=require(_0xa4c1('0x1'));var BPromise=require(_0xa4c1('0x2'));var rs=require(_0xa4c1('0x3'));var fs=require('fs');var Redis=require(_0xa4c1('0x4'));var db=require(_0xa4c1('0x5'))['db'];var utils=require(_0xa4c1('0x6'));var logger=require('../../config/logger')(_0xa4c1('0x7'));var config=require(_0xa4c1('0x8'));var jayson=require(_0xa4c1('0x9'));var client=jayson[_0xa4c1('0xa')][_0xa4c1('0xb')]({'port':0x232a});config[_0xa4c1('0xc')]=_[_0xa4c1('0xd')](config['redis'],{'host':_0xa4c1('0xe'),'port':0x18eb});var socket=require(_0xa4c1('0xf'))(new Redis(config[_0xa4c1('0xc')]));require(_0xa4c1('0x10'))[_0xa4c1('0x11')](socket);function respondWithRpcPromise(_0x1ce2f4,_0xf71eae,_0x32a605){return new BPromise(function(_0x249c11,_0xe752ae){return client[_0xa4c1('0x12')](_0x1ce2f4,_0x32a605)[_0xa4c1('0x13')](function(_0x18af98){logger['info']('SquareProject,\x20%s,\x20%s',_0xf71eae,'request\x20sent');logger[_0xa4c1('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0xf71eae,_0xa4c1('0x15'),JSON[_0xa4c1('0x16')](_0x18af98));if(_0x18af98[_0xa4c1('0x17')]){if(_0x18af98['error']['code']===0x1f4){logger[_0xa4c1('0x17')](_0xa4c1('0x18'),_0xf71eae,_0x18af98[_0xa4c1('0x17')]['message']);return _0xe752ae(_0x18af98[_0xa4c1('0x17')][_0xa4c1('0x19')]);}logger[_0xa4c1('0x17')](_0xa4c1('0x18'),_0xf71eae,_0x18af98[_0xa4c1('0x17')][_0xa4c1('0x19')]);return _0x249c11(_0x18af98[_0xa4c1('0x17')][_0xa4c1('0x19')]);}else{logger[_0xa4c1('0x1a')](_0xa4c1('0x18'),_0xf71eae,_0xa4c1('0x15'));_0x249c11(_0x18af98[_0xa4c1('0x1b')][_0xa4c1('0x19')]);}})[_0xa4c1('0x1c')](function(_0x2db6df){logger[_0xa4c1('0x17')](_0xa4c1('0x18'),_0xf71eae,_0x2db6df);_0xe752ae(_0x2db6df);});});}exports[_0xa4c1('0x1d')]=function(_0x5d2382){var _0x4b3faa=this;return new Promise(function(_0x3f470b,_0x14a5c4){return db[_0xa4c1('0x1e')][_0xa4c1('0x1f')]({'raw':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382['options'][_0xa4c1('0x21')]===undefined?!![]:![]:!![],'where':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382[_0xa4c1('0x20')]['where']||null:null,'attributes':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382['options'][_0xa4c1('0x22')]||null:null,'include':_0x5d2382[_0xa4c1('0x20')]?_0x5d2382[_0xa4c1('0x20')]['include']?_[_0xa4c1('0x23')](_0x5d2382[_0xa4c1('0x20')][_0xa4c1('0x24')],function(_0x1cfc81){return{'model':db[_0x1cfc81[_0xa4c1('0x25')]],'as':_0x1cfc81['as'],'attributes':_0x1cfc81[_0xa4c1('0x22')],'include':_0x1cfc81[_0xa4c1('0x24')]?_[_0xa4c1('0x23')](_0x1cfc81['include'],function(_0x34717d){return{'model':db[_0x34717d[_0xa4c1('0x25')]],'as':_0x34717d['as'],'attributes':_0x34717d[_0xa4c1('0x22')],'include':_0x34717d[_0xa4c1('0x24')]?_[_0xa4c1('0x23')](_0x34717d['include'],function(_0x3091cf){return{'model':db[_0x3091cf['model']],'as':_0x3091cf['as'],'attributes':_0x3091cf[_0xa4c1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41ccbc){logger[_0xa4c1('0x1a')](_0xa4c1('0x1d'),_0x5d2382);logger[_0xa4c1('0x14')](_0xa4c1('0x1d'),_0x5d2382,JSON[_0xa4c1('0x16')](_0x41ccbc));_0x3f470b(_0x41ccbc);})['catch'](function(_0x5c5a6c){logger[_0xa4c1('0x17')](_0xa4c1('0x1d'),_0x5c5a6c['message'],_0x5d2382);_0x14a5c4(_0x4b3faa[_0xa4c1('0x17')](0x1f4,_0x5c5a6c[_0xa4c1('0x19')]));});});}; \ No newline at end of file +var _0x3b38=['client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','SquareProject,\x20%s,\x20%s','message','catch','SquareProject','find','options','raw','where','attributes','include','map','model','ShowSquareProject','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x100331,_0x44c8d0){var _0x2bbd7a=function(_0x56de6b){while(--_0x56de6b){_0x100331['push'](_0x100331['shift']());}};_0x2bbd7a(++_0x44c8d0);}(_0x3b38,0x64));var _0x83b3=function(_0x47bb9c,_0x4c2542){_0x47bb9c=_0x47bb9c-0x0;var _0x135a85=_0x3b38[_0x47bb9c];return _0x135a85;};'use strict';var _=require(_0x83b3('0x0'));var util=require(_0x83b3('0x1'));var moment=require('moment');var BPromise=require(_0x83b3('0x2'));var rs=require(_0x83b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83b3('0x4'))['db'];var utils=require(_0x83b3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x83b3('0x6'));var jayson=require(_0x83b3('0x7'));var client=jayson[_0x83b3('0x8')]['http']({'port':0x232a});config[_0x83b3('0x9')]=_[_0x83b3('0xa')](config[_0x83b3('0x9')],{'host':_0x83b3('0xb'),'port':0x18eb});var socket=require(_0x83b3('0xc'))(new Redis(config[_0x83b3('0x9')]));require(_0x83b3('0xd'))[_0x83b3('0xe')](socket);function respondWithRpcPromise(_0x1a950a,_0x2decf4,_0x23677a){return new BPromise(function(_0x1d4cea,_0x92c58a){return client[_0x83b3('0xf')](_0x1a950a,_0x23677a)[_0x83b3('0x10')](function(_0x430926){logger[_0x83b3('0x11')]('SquareProject,\x20%s,\x20%s',_0x2decf4,_0x83b3('0x12'));logger[_0x83b3('0x13')](_0x83b3('0x14'),_0x2decf4,_0x83b3('0x12'),JSON[_0x83b3('0x15')](_0x430926));if(_0x430926[_0x83b3('0x16')]){if(_0x430926[_0x83b3('0x16')]['code']===0x1f4){logger[_0x83b3('0x16')](_0x83b3('0x17'),_0x2decf4,_0x430926[_0x83b3('0x16')]['message']);return _0x92c58a(_0x430926['error'][_0x83b3('0x18')]);}logger[_0x83b3('0x16')](_0x83b3('0x17'),_0x2decf4,_0x430926['error'][_0x83b3('0x18')]);return _0x1d4cea(_0x430926[_0x83b3('0x16')][_0x83b3('0x18')]);}else{logger[_0x83b3('0x11')](_0x83b3('0x17'),_0x2decf4,_0x83b3('0x12'));_0x1d4cea(_0x430926['result'][_0x83b3('0x18')]);}})[_0x83b3('0x19')](function(_0x51cba1){logger[_0x83b3('0x16')](_0x83b3('0x17'),_0x2decf4,_0x51cba1);_0x92c58a(_0x51cba1);});});}exports['ShowSquareProject']=function(_0x5ae7e6){var _0x2176ef=this;return new Promise(function(_0x435989,_0x4c4162){return db[_0x83b3('0x1a')][_0x83b3('0x1b')]({'raw':_0x5ae7e6[_0x83b3('0x1c')]?_0x5ae7e6[_0x83b3('0x1c')][_0x83b3('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ae7e6['options']?_0x5ae7e6[_0x83b3('0x1c')][_0x83b3('0x1e')]||null:null,'attributes':_0x5ae7e6[_0x83b3('0x1c')]?_0x5ae7e6['options'][_0x83b3('0x1f')]||null:null,'include':_0x5ae7e6[_0x83b3('0x1c')]?_0x5ae7e6['options'][_0x83b3('0x20')]?_['map'](_0x5ae7e6[_0x83b3('0x1c')][_0x83b3('0x20')],function(_0x3b6ab1){return{'model':db[_0x3b6ab1['model']],'as':_0x3b6ab1['as'],'attributes':_0x3b6ab1[_0x83b3('0x1f')],'include':_0x3b6ab1['include']?_[_0x83b3('0x21')](_0x3b6ab1[_0x83b3('0x20')],function(_0x5ea664){return{'model':db[_0x5ea664[_0x83b3('0x22')]],'as':_0x5ea664['as'],'attributes':_0x5ea664[_0x83b3('0x1f')],'include':_0x5ea664[_0x83b3('0x20')]?_[_0x83b3('0x21')](_0x5ea664[_0x83b3('0x20')],function(_0x16930c){return{'model':db[_0x16930c[_0x83b3('0x22')]],'as':_0x16930c['as'],'attributes':_0x16930c[_0x83b3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x482367){logger[_0x83b3('0x11')](_0x83b3('0x23'),_0x5ae7e6);logger['debug']('ShowSquareProject',_0x5ae7e6,JSON['stringify'](_0x482367));_0x435989(_0x482367);})[_0x83b3('0x19')](function(_0xc7a6c9){logger[_0x83b3('0x16')](_0x83b3('0x23'),_0xc7a6c9[_0x83b3('0x18')],_0x5ae7e6);_0x4c4162(_0x2176ef['error'](0x1f4,_0xc7a6c9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e01950c..d8ceda3 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 _0x0624=['removeListener','register','length','squareProject:','save','update','emit'];(function(_0x4003f6,_0x3a8f3e){var _0x534c36=function(_0x25bf64){while(--_0x25bf64){_0x4003f6['push'](_0x4003f6['shift']());}};_0x534c36(++_0x3a8f3e);}(_0x0624,0xc8));var _0x4062=function(_0x5df7bd,_0x111492){_0x5df7bd=_0x5df7bd-0x0;var _0x3eb982=_0x0624[_0x5df7bd];return _0x3eb982;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x4062('0x0'),'remove',_0x4062('0x1')];function createListener(_0x1a621e,_0x208810){return function(_0x129511){_0x208810[_0x4062('0x2')](_0x1a621e,_0x129511);};}function removeListener(_0x4150ab,_0x16961c){return function(){SquareProjectEvents[_0x4062('0x3')](_0x4150ab,_0x16961c);};}exports[_0x4062('0x4')]=function(_0x72f99a){for(var _0x2eca98=0x0,_0x37295b=events[_0x4062('0x5')];_0x2eca98<_0x37295b;_0x2eca98++){var _0x8cc655=events[_0x2eca98];var _0x1ecddf=createListener(_0x4062('0x6')+_0x8cc655,_0x72f99a);SquareProjectEvents['on'](_0x8cc655,_0x1ecddf);}}; \ No newline at end of file +var _0x8ca1=['length','removeListener','register'];(function(_0xfd60ef,_0x408ad0){var _0x1ed88d=function(_0x495e92){while(--_0x495e92){_0xfd60ef['push'](_0xfd60ef['shift']());}};_0x1ed88d(++_0x408ad0);}(_0x8ca1,0x1f3));var _0x18ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ca1[_0x14add3];return _0x4a174f;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove','update'];function createListener(_0x53dfd0,_0x2fbac6){return function(_0x2def36){_0x2fbac6['emit'](_0x53dfd0,_0x2def36);};}function removeListener(_0x3955a1,_0xdfdf45){return function(){SquareProjectEvents[_0x18ca('0x0')](_0x3955a1,_0xdfdf45);};}exports[_0x18ca('0x1')]=function(_0xa2b87d){for(var _0x353180=0x0,_0x1faacd=events[_0x18ca('0x2')];_0x353180<_0x1faacd;_0x353180++){var _0x21d778=events[_0x353180];var _0xf3c778=createListener('squareProject:'+_0x21d778,_0xa2b87d);SquareProjectEvents['on'](_0x21d778,_0xf3c778);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b61fc46..195d525 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x4a79bd,_0x3f7827){var _0x26fd6a=function(_0x193ee6){while(--_0x193ee6){_0x4a79bd['push'](_0x4a79bd['shift']());}};_0x26fd6a(++_0x3f7827);}(_0x326f,0xd1));var _0xf326=function(_0xb547e,_0x10f2c8){_0xb547e=_0xb547e-0x0;var _0xc7657d=_0x326f[_0xb547e];return _0xc7657d;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0295,0x1f0));var _0x5029=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x0295[_0xdeefbd];return _0x4ff63f;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/download',auth[_0x5029('0x8')](),controller['download']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a775394..b4dc3e7 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 _0xda19=['getDataValue','exports','STRING','VIRTUAL'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0xda19,0xd5));var _0x9da1=function(_0x2cea85,_0x47f20b){_0x2cea85=_0x2cea85-0x0;var _0x47760e=_0xda19[_0x2cea85];return _0x47760e;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'uniqueid':{'type':Sequelize[_0x9da1('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9da1('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'dnid':{'type':Sequelize[_0x9da1('0x1')]},'projectName':{'type':Sequelize[_0x9da1('0x1')]},'saveName':{'type':Sequelize[_0x9da1('0x1')]},'filename':{'type':Sequelize[_0x9da1('0x1')]},'savePath':{'type':Sequelize[_0x9da1('0x1')]},'format':{'type':Sequelize[_0x9da1('0x2')],'get':function(){var _0x2c3cdd='';var _0x1c24e6=this[_0x9da1('0x3')]('savePath');if(_0x1c24e6){_0x2c3cdd=_0x1c24e6['substring'](_0x1c24e6['lastIndexOf']('.'));}return _0x2c3cdd;}}}; \ No newline at end of file +var _0x1cb9=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x1bbb97,_0x49c1aa){var _0x3b1941=function(_0x35eaea){while(--_0x35eaea){_0x1bbb97['push'](_0x1bbb97['shift']());}};_0x3b1941(++_0x49c1aa);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3ed27c,_0x368ee1){_0x3ed27c=_0x3ed27c-0x0;var _0x3c01af=_0x1cb9[_0x3ed27c];return _0x3c01af;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x91cb('0x1')]},'callerid':{'type':Sequelize[_0x91cb('0x1')]},'calleridname':{'type':Sequelize[_0x91cb('0x1')]},'context':{'type':Sequelize[_0x91cb('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x91cb('0x1')]},'accountcode':{'type':Sequelize[_0x91cb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x91cb('0x1')]},'saveName':{'type':Sequelize[_0x91cb('0x1')]},'filename':{'type':Sequelize[_0x91cb('0x1')]},'savePath':{'type':Sequelize[_0x91cb('0x1')]},'format':{'type':Sequelize[_0x91cb('0x2')],'get':function(){var _0x8f8a3b='';var _0x4c1f56=this[_0x91cb('0x3')]('savePath');if(_0x4c1f56){_0x8f8a3b=_0x4c1f56[_0x91cb('0x4')](_0x4c1f56['lastIndexOf']('.'));}return _0x8f8a3b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 87d8e8e..66ca341 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 _0x8131=['length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','send','index','map','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8131,0xe5));var _0x1813=function(_0x5d198a,_0x4fc0e8){_0x5d198a=_0x5d198a-0x0;var _0xba47e3=_0x8131[_0x5d198a];return _0xba47e3;};'use strict';var emlformat=require(_0x1813('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1813('0x1'));var jsonpatch=require(_0x1813('0x2'));var rp=require(_0x1813('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1813('0x4'));var path=require(_0x1813('0x5'));var sox=require(_0x1813('0x6'));var csv=require(_0x1813('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1813('0x8'));var _=require('lodash');var squel=require(_0x1813('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1813('0xa'));var toCsv=require(_0x1813('0x7'));var querystring=require(_0x1813('0xb'));var Papa=require(_0x1813('0xc'));var Redis=require(_0x1813('0xd'));var authService=require(_0x1813('0xe'));var qs=require(_0x1813('0xf'));var as=require(_0x1813('0x10'));var hardwareService=require(_0x1813('0x11'));var logger=require(_0x1813('0x12'))('api');var utils=require(_0x1813('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1813('0x14'))['db'];function respondWithStatusCode(_0x1b357e,_0x4af240){_0x4af240=_0x4af240||0xcc;return function(_0x572b81){if(_0x572b81){return _0x1b357e[_0x1813('0x15')](_0x4af240);}return _0x1b357e[_0x1813('0x16')](_0x4af240)[_0x1813('0x17')]();};}function respondWithResult(_0x920a9b,_0x26d0d9){_0x26d0d9=_0x26d0d9||0xc8;return function(_0xb484f9){if(_0xb484f9){return _0x920a9b['status'](_0x26d0d9)[_0x1813('0x18')](_0xb484f9);}};}function respondWithFilteredResult(_0x3caf8f,_0x3b80ed){return function(_0x56291f){if(_0x56291f){var _0x39669f=typeof _0x3b80ed[_0x1813('0x19')]==='undefined'&&typeof _0x3b80ed['limit']===_0x1813('0x1a');var _0x219828=_0x56291f[_0x1813('0x1b')];var _0x22502b=_0x39669f?0x0:_0x3b80ed[_0x1813('0x19')];var _0x5e5911=_0x39669f?_0x56291f[_0x1813('0x1b')]:_0x3b80ed[_0x1813('0x19')]+_0x3b80ed[_0x1813('0x1c')];var _0x4d5b6f;if(_0x5e5911>=_0x219828){_0x5e5911=_0x219828;_0x4d5b6f=0xc8;}else{_0x4d5b6f=0xce;}_0x3caf8f[_0x1813('0x16')](_0x4d5b6f);return _0x3caf8f[_0x1813('0x1d')](_0x1813('0x1e'),_0x22502b+'-'+_0x5e5911+'/'+_0x219828)['json'](_0x56291f);}return null;};}function patchUpdates(_0x5dbdcd){return function(_0x28d34c){try{jsonpatch['apply'](_0x28d34c,_0x5dbdcd,!![]);}catch(_0x4fbd88){return BPromise[_0x1813('0x1f')](_0x4fbd88);}return _0x28d34c[_0x1813('0x20')]();};}function saveUpdates(_0x4d137b,_0x373763){return function(_0x22a3c8){if(_0x22a3c8){return _0x22a3c8[_0x1813('0x21')](_0x4d137b)['then'](function(_0x12d302){return _0x12d302;});}return null;};}function removeEntity(_0x456447,_0x1471cc){return function(_0x5ca8d4){if(_0x5ca8d4){return _0x5ca8d4['destroy']()[_0x1813('0x22')](function(){_0x456447['status'](0xcc)[_0x1813('0x17')]();});}};}function handleEntityNotFound(_0x540f02,_0x194d53){return function(_0x532078){if(!_0x532078){_0x540f02[_0x1813('0x15')](0x194);}return _0x532078;};}function handleError(_0x24e377,_0x53968f){_0x53968f=_0x53968f||0x1f4;return function(_0x586469){logger[_0x1813('0x23')](_0x586469[_0x1813('0x24')]);if(_0x586469['name']){delete _0x586469['name'];}_0x24e377[_0x1813('0x16')](_0x53968f)[_0x1813('0x25')](_0x586469);};}exports[_0x1813('0x26')]=function(_0x571083,_0x5076fc){var _0x38b85c={},_0x316eb6={},_0x26ff37={'count':0x0,'rows':[]};var _0x4f8c59=_[_0x1813('0x27')](db['SquareRecording']['rawAttributes'],function(_0x270b28){return{'name':_0x270b28[_0x1813('0x28')],'type':_0x270b28['type'][_0x1813('0x29')]};});_0x316eb6[_0x1813('0x2a')]=_['map'](_0x4f8c59,_0x1813('0x2b'));_0x316eb6[_0x1813('0x2c')]=_[_0x1813('0x2d')](_0x571083[_0x1813('0x2c')]);_0x316eb6[_0x1813('0x2e')]=_[_0x1813('0x2f')](_0x316eb6[_0x1813('0x2a')],_0x316eb6[_0x1813('0x2c')]);_0x38b85c[_0x1813('0x30')]=_[_0x1813('0x2f')](_0x316eb6[_0x1813('0x2a')],qs[_0x1813('0x31')](_0x571083[_0x1813('0x2c')][_0x1813('0x31')]));_0x38b85c['attributes']=_0x38b85c['attributes'][_0x1813('0x32')]?_0x38b85c[_0x1813('0x30')]:_0x316eb6[_0x1813('0x2a')];if(!_0x571083['query']['hasOwnProperty']('nolimit')){_0x38b85c[_0x1813('0x1c')]=qs['limit'](_0x571083[_0x1813('0x2c')][_0x1813('0x1c')]);_0x38b85c['offset']=qs[_0x1813('0x19')](_0x571083[_0x1813('0x2c')][_0x1813('0x19')]);}_0x38b85c[_0x1813('0x33')]=qs[_0x1813('0x34')](_0x571083[_0x1813('0x2c')][_0x1813('0x34')]);_0x38b85c[_0x1813('0x35')]=qs['filters'](_[_0x1813('0x36')](_0x571083['query'],_0x316eb6[_0x1813('0x2e')]),_0x4f8c59);if(_0x571083[_0x1813('0x2c')]['filter']){_0x38b85c[_0x1813('0x35')]=_[_0x1813('0x37')](_0x38b85c[_0x1813('0x35')],{'$or':_[_0x1813('0x27')](_0x4f8c59,function(_0x5e2bc1){if(_0x5e2bc1[_0x1813('0x38')]!==_0x1813('0x39')){var _0x56b1f0={};_0x56b1f0[_0x5e2bc1['name']]={'$like':'%'+_0x571083['query'][_0x1813('0x3a')]+'%'};return _0x56b1f0;}})});}_0x38b85c=_['merge']({},_0x38b85c,_0x571083[_0x1813('0x3b')]);var _0x4db07d={'where':_0x38b85c['where']};return db[_0x1813('0x3c')][_0x1813('0x1b')](_0x4db07d)[_0x1813('0x22')](function(_0xed1fcf){_0x26ff37[_0x1813('0x1b')]=_0xed1fcf;if(_0x571083[_0x1813('0x2c')][_0x1813('0x3d')]){_0x38b85c[_0x1813('0x3e')]=[{'all':!![]}];}return db[_0x1813('0x3c')][_0x1813('0x3f')](_0x38b85c);})[_0x1813('0x22')](function(_0x4a6702){_0x26ff37[_0x1813('0x40')]=_0x4a6702;return _0x26ff37;})[_0x1813('0x22')](respondWithFilteredResult(_0x5076fc,_0x38b85c))[_0x1813('0x41')](handleError(_0x5076fc,null));};exports[_0x1813('0x42')]=function(_0x5653bf,_0x2b1242){var _0x1f8bc5={'raw':!![],'where':{'id':_0x5653bf[_0x1813('0x43')]['id']}},_0x1b7c80={};_0x1b7c80[_0x1813('0x2a')]=_['keys'](db['SquareRecording']['rawAttributes']);_0x1b7c80['query']=_[_0x1813('0x2d')](_0x5653bf[_0x1813('0x2c')]);_0x1b7c80['filters']=_[_0x1813('0x2f')](_0x1b7c80[_0x1813('0x2a')],_0x1b7c80[_0x1813('0x2c')]);_0x1f8bc5[_0x1813('0x30')]=_['intersection'](_0x1b7c80[_0x1813('0x2a')],qs[_0x1813('0x31')](_0x5653bf[_0x1813('0x2c')][_0x1813('0x31')]));_0x1f8bc5['attributes']=_0x1f8bc5['attributes'][_0x1813('0x32')]?_0x1f8bc5[_0x1813('0x30')]:_0x1b7c80[_0x1813('0x2a')];if(_0x5653bf[_0x1813('0x2c')][_0x1813('0x3d')]){_0x1f8bc5[_0x1813('0x3e')]=[{'all':!![]}];}_0x1f8bc5=_[_0x1813('0x37')]({},_0x1f8bc5,_0x5653bf[_0x1813('0x3b')]);return db[_0x1813('0x3c')][_0x1813('0x44')](_0x1f8bc5)[_0x1813('0x22')](handleEntityNotFound(_0x2b1242,null))[_0x1813('0x22')](respondWithResult(_0x2b1242,null))[_0x1813('0x41')](handleError(_0x2b1242,null));};exports['create']=function(_0x519d22,_0x4359c9){return db[_0x1813('0x3c')][_0x1813('0x45')](_0x519d22['body'],{})[_0x1813('0x22')](respondWithResult(_0x4359c9,0xc9))[_0x1813('0x41')](handleError(_0x4359c9,null));};exports['update']=function(_0x588d02,_0x970fbb){if(_0x588d02[_0x1813('0x46')]['id']){delete _0x588d02[_0x1813('0x46')]['id'];}return db[_0x1813('0x3c')][_0x1813('0x44')]({'where':{'id':_0x588d02[_0x1813('0x43')]['id']}})[_0x1813('0x22')](handleEntityNotFound(_0x970fbb,null))[_0x1813('0x22')](saveUpdates(_0x588d02['body'],null))[_0x1813('0x22')](respondWithResult(_0x970fbb,null))[_0x1813('0x41')](handleError(_0x970fbb,null));};exports[_0x1813('0x47')]=function(_0x5676b4,_0x160557,_0x5dea9d){var _0x3180b3=require(_0x1813('0x48'));var _0x5b770d=![];var _0x459177={};if(_0x5676b4['query']['type']&&_0x5676b4[_0x1813('0x2c')][_0x1813('0x38')]===_0x1813('0x49')){_0x459177['uniqueid']=_0x5676b4[_0x1813('0x43')]['id'];}else{_0x459177['id']=_0x5676b4['params']['id'];}return db[_0x1813('0x3c')][_0x1813('0x44')]({'where':_0x459177,'attributes':['id',_0x1813('0x4a'),_0x1813('0x4b')],'raw':!![]})[_0x1813('0x22')](handleEntityNotFound(_0x160557,null))['then'](function(_0x1be838){if(_0x1be838){var _0x544d03=_0x1be838[_0x1813('0x4a')];var _0x2fedc6=util[_0x1813('0x4c')]('%s.cypher',_0x544d03);if(fs[_0x1813('0x4d')](_0x2fedc6)){_0x5b770d=!![];return _0x3180b3['decryptFile'](_0x2fedc6,_0x544d03,config[_0x1813('0x4e')][_0x1813('0x4f')])[_0x1813('0x22')](function(){return _0x1be838;});}return _0x1be838;}})[_0x1813('0x22')](function(_0x49ea39){if(_0x49ea39){var _0xadad56=_0x49ea39[_0x1813('0x4a')];if(!fs[_0x1813('0x4d')](_0xadad56)){throw new db[(_0x1813('0x50'))]['ValidationError'](_0x1813('0x51'));}if(_0x49ea39[_0x1813('0x4b')]){return _0x160557[_0x1813('0x47')](_0xadad56,_0x49ea39[_0x1813('0x4b')]+path[_0x1813('0x52')](_0xadad56),function(){if(_0x5b770d){fs[_0x1813('0x53')](_0xadad56);}});}else{return _0x160557[_0x1813('0x47')](_0xadad56,function(_0xf594ac){if(_0x5b770d){fs[_0x1813('0x53')](_0xadad56);}});}}})[_0x1813('0x41')](function(_0x1ccd60){if(_0x1ccd60[_0x1813('0x54')]==='SquareRecording\x20not\x20found'){_0x160557[_0x1813('0x16')](0x194)[_0x1813('0x25')]('Not\x20found');}else{return handleError(_0x160557,null);}});};exports[_0x1813('0x55')]=function(_0x539988,_0x2c41c1){return db[_0x1813('0x3c')]['find']({'where':{'id':_0x539988[_0x1813('0x43')]['id']}})[_0x1813('0x22')](function(_0x52e20f){if(_[_0x1813('0x56')](_0x52e20f)){throw new ReferenceError(_0x1813('0x57'));}return _0x52e20f;})[_0x1813('0x22')](function(_0x52a7ee){var _0x5081d8=_0x52a7ee[_0x1813('0x4a')];logger[_0x1813('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x5081d8);if(!_[_0x1813('0x56')](_0x52a7ee[_0x1813('0x4a')])&&fs[_0x1813('0x4d')](_0x5081d8)){logger['info'](_0x1813('0x59')+_0x5081d8+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1813('0x5a')](_0x5081d8);}_0x5081d8=_0x5081d8+_0x1813('0x5b');if(!_[_0x1813('0x56')](_0x52a7ee[_0x1813('0x4a')])&&fs[_0x1813('0x4d')](_0x5081d8)){logger[_0x1813('0x58')](_0x1813('0x59')+_0x5081d8+_0x1813('0x5c'));fs[_0x1813('0x5a')](_0x5081d8);}return _0x52a7ee;})[_0x1813('0x22')](function(_0x2fd9d2){if(!_0x2fd9d2)throw new InternalError();return _0x2fd9d2['destroy']();})[_0x1813('0x22')](function(){_0x2c41c1[_0x1813('0x16')](0xcc)['end']();})[_0x1813('0x41')](handleError(_0x2c41c1,null));}; \ No newline at end of file +var _0x08b5=['sort','where','pick','filter','merge','VIRTUAL','includeAll','SquareRecording','findAll','params','keys','include','options','catch','create','body','find','../../components/encryptor','uniqueid','format','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','Content-Range','save','update','then','error','send','index','map','type','key','model','name','query','filters','intersection','attributes','fields','length'];(function(_0x6ec16,_0x2e8212){var _0x2b62ac=function(_0x3aa462){while(--_0x3aa462){_0x6ec16['push'](_0x6ec16['shift']());}};_0x2b62ac(++_0x2e8212);}(_0x08b5,0x87));var _0x508b=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x08b5[_0x24061a];return _0x82054e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x508b('0x0'));var zipdir=require(_0x508b('0x1'));var jsonpatch=require(_0x508b('0x2'));var rp=require(_0x508b('0x3'));var moment=require(_0x508b('0x4'));var BPromise=require(_0x508b('0x5'));var Mustache=require('mustache');var util=require(_0x508b('0x6'));var path=require(_0x508b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x508b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x508b('0x9'));var squel=require(_0x508b('0xa'));var crypto=require(_0x508b('0xb'));var jsforce=require(_0x508b('0xc'));var deskjs=require(_0x508b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x508b('0xe'));var Papa=require(_0x508b('0xf'));var Redis=require('ioredis');var authService=require(_0x508b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x508b('0x11'));var hardwareService=require(_0x508b('0x12'));var logger=require(_0x508b('0x13'))(_0x508b('0x14'));var utils=require('../../config/utils');var config=require(_0x508b('0x15'));var licenseUtil=require(_0x508b('0x16'));var db=require(_0x508b('0x17'))['db'];function respondWithStatusCode(_0x24805e,_0xc716ed){_0xc716ed=_0xc716ed||0xcc;return function(_0x277787){if(_0x277787){return _0x24805e[_0x508b('0x18')](_0xc716ed);}return _0x24805e[_0x508b('0x19')](_0xc716ed)[_0x508b('0x1a')]();};}function respondWithResult(_0x42fd73,_0x3c416f){_0x3c416f=_0x3c416f||0xc8;return function(_0x944836){if(_0x944836){return _0x42fd73[_0x508b('0x19')](_0x3c416f)[_0x508b('0x1b')](_0x944836);}};}function respondWithFilteredResult(_0x2a39b4,_0x421337){return function(_0x2bfd99){if(_0x2bfd99){var _0x1055f7=typeof _0x421337[_0x508b('0x1c')]==='undefined'&&typeof _0x421337['limit']==='undefined';var _0x1b9005=_0x2bfd99[_0x508b('0x1d')];var _0x9046ef=_0x1055f7?0x0:_0x421337['offset'];var _0xf82695=_0x1055f7?_0x2bfd99['count']:_0x421337['offset']+_0x421337[_0x508b('0x1e')];var _0x4280b3;if(_0xf82695>=_0x1b9005){_0xf82695=_0x1b9005;_0x4280b3=0xc8;}else{_0x4280b3=0xce;}_0x2a39b4[_0x508b('0x19')](_0x4280b3);return _0x2a39b4['set'](_0x508b('0x1f'),_0x9046ef+'-'+_0xf82695+'/'+_0x1b9005)['json'](_0x2bfd99);}return null;};}function patchUpdates(_0x375ec5){return function(_0x3c8c77){try{jsonpatch['apply'](_0x3c8c77,_0x375ec5,!![]);}catch(_0x594e15){return BPromise['reject'](_0x594e15);}return _0x3c8c77[_0x508b('0x20')]();};}function saveUpdates(_0x3ac6be,_0xaaf721){return function(_0xc4162a){if(_0xc4162a){return _0xc4162a[_0x508b('0x21')](_0x3ac6be)[_0x508b('0x22')](function(_0x6666a9){return _0x6666a9;});}return null;};}function removeEntity(_0x119e09,_0x4ffc95){return function(_0x5b1027){if(_0x5b1027){return _0x5b1027['destroy']()[_0x508b('0x22')](function(){_0x119e09[_0x508b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f2953,_0x9a2e71){return function(_0x200596){if(!_0x200596){_0x2f2953[_0x508b('0x18')](0x194);}return _0x200596;};}function handleError(_0x15547d,_0x38f055){_0x38f055=_0x38f055||0x1f4;return function(_0x24e82d){logger[_0x508b('0x23')](_0x24e82d['stack']);if(_0x24e82d['name']){delete _0x24e82d['name'];}_0x15547d[_0x508b('0x19')](_0x38f055)[_0x508b('0x24')](_0x24e82d);};}exports[_0x508b('0x25')]=function(_0x492be1,_0x3e24df){var _0x32369b={},_0x5b501a={},_0x41e20b={'count':0x0,'rows':[]};var _0xea1c77=_[_0x508b('0x26')](db['SquareRecording']['rawAttributes'],function(_0x2dcfb8){return{'name':_0x2dcfb8['fieldName'],'type':_0x2dcfb8[_0x508b('0x27')][_0x508b('0x28')]};});_0x5b501a[_0x508b('0x29')]=_[_0x508b('0x26')](_0xea1c77,_0x508b('0x2a'));_0x5b501a['query']=_['keys'](_0x492be1[_0x508b('0x2b')]);_0x5b501a[_0x508b('0x2c')]=_[_0x508b('0x2d')](_0x5b501a[_0x508b('0x29')],_0x5b501a[_0x508b('0x2b')]);_0x32369b[_0x508b('0x2e')]=_[_0x508b('0x2d')](_0x5b501a[_0x508b('0x29')],qs[_0x508b('0x2f')](_0x492be1[_0x508b('0x2b')][_0x508b('0x2f')]));_0x32369b[_0x508b('0x2e')]=_0x32369b[_0x508b('0x2e')][_0x508b('0x30')]?_0x32369b[_0x508b('0x2e')]:_0x5b501a[_0x508b('0x29')];if(!_0x492be1[_0x508b('0x2b')]['hasOwnProperty']('nolimit')){_0x32369b[_0x508b('0x1e')]=qs[_0x508b('0x1e')](_0x492be1[_0x508b('0x2b')][_0x508b('0x1e')]);_0x32369b['offset']=qs[_0x508b('0x1c')](_0x492be1[_0x508b('0x2b')][_0x508b('0x1c')]);}_0x32369b['order']=qs['sort'](_0x492be1[_0x508b('0x2b')][_0x508b('0x31')]);_0x32369b[_0x508b('0x32')]=qs[_0x508b('0x2c')](_[_0x508b('0x33')](_0x492be1[_0x508b('0x2b')],_0x5b501a['filters']),_0xea1c77);if(_0x492be1['query'][_0x508b('0x34')]){_0x32369b['where']=_[_0x508b('0x35')](_0x32369b[_0x508b('0x32')],{'$or':_[_0x508b('0x26')](_0xea1c77,function(_0x2c7e13){if(_0x2c7e13[_0x508b('0x27')]!==_0x508b('0x36')){var _0x4abb54={};_0x4abb54[_0x2c7e13[_0x508b('0x2a')]]={'$like':'%'+_0x492be1[_0x508b('0x2b')]['filter']+'%'};return _0x4abb54;}})});}_0x32369b=_[_0x508b('0x35')]({},_0x32369b,_0x492be1['options']);var _0x45094d={'where':_0x32369b[_0x508b('0x32')]};return db['SquareRecording']['count'](_0x45094d)[_0x508b('0x22')](function(_0x1cbd16){_0x41e20b[_0x508b('0x1d')]=_0x1cbd16;if(_0x492be1[_0x508b('0x2b')][_0x508b('0x37')]){_0x32369b['include']=[{'all':!![]}];}return db[_0x508b('0x38')][_0x508b('0x39')](_0x32369b);})['then'](function(_0x702b9d){_0x41e20b['rows']=_0x702b9d;return _0x41e20b;})[_0x508b('0x22')](respondWithFilteredResult(_0x3e24df,_0x32369b))['catch'](handleError(_0x3e24df,null));};exports['show']=function(_0x305a52,_0x4c5360){var _0x700d6a={'raw':!![],'where':{'id':_0x305a52[_0x508b('0x3a')]['id']}},_0x52b1c6={};_0x52b1c6['model']=_[_0x508b('0x3b')](db[_0x508b('0x38')]['rawAttributes']);_0x52b1c6['query']=_[_0x508b('0x3b')](_0x305a52[_0x508b('0x2b')]);_0x52b1c6[_0x508b('0x2c')]=_['intersection'](_0x52b1c6['model'],_0x52b1c6['query']);_0x700d6a['attributes']=_[_0x508b('0x2d')](_0x52b1c6['model'],qs[_0x508b('0x2f')](_0x305a52['query']['fields']));_0x700d6a[_0x508b('0x2e')]=_0x700d6a[_0x508b('0x2e')]['length']?_0x700d6a[_0x508b('0x2e')]:_0x52b1c6[_0x508b('0x29')];if(_0x305a52[_0x508b('0x2b')][_0x508b('0x37')]){_0x700d6a[_0x508b('0x3c')]=[{'all':!![]}];}_0x700d6a=_[_0x508b('0x35')]({},_0x700d6a,_0x305a52[_0x508b('0x3d')]);return db[_0x508b('0x38')]['find'](_0x700d6a)[_0x508b('0x22')](handleEntityNotFound(_0x4c5360,null))[_0x508b('0x22')](respondWithResult(_0x4c5360,null))[_0x508b('0x3e')](handleError(_0x4c5360,null));};exports[_0x508b('0x3f')]=function(_0x4510de,_0x327493){return db['SquareRecording']['create'](_0x4510de[_0x508b('0x40')],{})['then'](respondWithResult(_0x327493,0xc9))[_0x508b('0x3e')](handleError(_0x327493,null));};exports[_0x508b('0x21')]=function(_0x4e473a,_0x483981){if(_0x4e473a[_0x508b('0x40')]['id']){delete _0x4e473a[_0x508b('0x40')]['id'];}return db[_0x508b('0x38')][_0x508b('0x41')]({'where':{'id':_0x4e473a[_0x508b('0x3a')]['id']}})[_0x508b('0x22')](handleEntityNotFound(_0x483981,null))['then'](saveUpdates(_0x4e473a[_0x508b('0x40')],null))[_0x508b('0x22')](respondWithResult(_0x483981,null))['catch'](handleError(_0x483981,null));};exports['download']=function(_0x341dd0,_0x2b64a3,_0x4a20d6){var _0x2eb19a=require(_0x508b('0x42'));var _0x37ba72=![];var _0x25a9f4={};if(_0x341dd0['query'][_0x508b('0x27')]&&_0x341dd0[_0x508b('0x2b')][_0x508b('0x27')]===_0x508b('0x43')){_0x25a9f4[_0x508b('0x43')]=_0x341dd0[_0x508b('0x3a')]['id'];}else{_0x25a9f4['id']=_0x341dd0[_0x508b('0x3a')]['id'];}return db[_0x508b('0x38')]['find']({'where':_0x25a9f4,'attributes':['id','savePath','filename'],'raw':!![]})[_0x508b('0x22')](handleEntityNotFound(_0x2b64a3,null))[_0x508b('0x22')](function(_0x13a1a3){if(_0x13a1a3){var _0x4f5bfe=_0x13a1a3['savePath'];var _0x1b55b1=util[_0x508b('0x44')](_0x508b('0x45'),_0x4f5bfe);if(fs[_0x508b('0x46')](_0x1b55b1)){_0x37ba72=!![];return _0x2eb19a[_0x508b('0x47')](_0x1b55b1,_0x4f5bfe,config[_0x508b('0x48')][_0x508b('0x49')])['then'](function(){return _0x13a1a3;});}return _0x13a1a3;}})[_0x508b('0x22')](function(_0xa7ae1e){if(_0xa7ae1e){var _0x28bb17=_0xa7ae1e[_0x508b('0x4a')];if(!fs[_0x508b('0x46')](_0x28bb17)){throw new db[(_0x508b('0x4b'))][(_0x508b('0x4c'))](_0x508b('0x4d'));}if(_0xa7ae1e[_0x508b('0x4e')]){return _0x2b64a3[_0x508b('0x4f')](_0x28bb17,_0xa7ae1e[_0x508b('0x4e')]+path[_0x508b('0x50')](_0x28bb17),function(){if(_0x37ba72){fs[_0x508b('0x51')](_0x28bb17);}});}else{return _0x2b64a3[_0x508b('0x4f')](_0x28bb17,function(_0xc6858){if(_0x37ba72){fs[_0x508b('0x51')](_0x28bb17);}});}}})[_0x508b('0x3e')](function(_0x5ee503){if(_0x5ee503[_0x508b('0x52')]===_0x508b('0x4d')){_0x2b64a3[_0x508b('0x19')](0x194)[_0x508b('0x24')](_0x508b('0x53'));}else{return handleError(_0x2b64a3,null);}});};exports[_0x508b('0x54')]=function(_0x5aa413,_0x4685de){return db[_0x508b('0x38')]['find']({'where':{'id':_0x5aa413['params']['id']}})['then'](function(_0x22df9f){if(_['isNil'](_0x22df9f)){throw new ReferenceError(_0x508b('0x55'));}return _0x22df9f;})[_0x508b('0x22')](function(_0x3dadad){var _0x2b48db=_0x3dadad[_0x508b('0x4a')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2b48db);if(!_['isNil'](_0x3dadad[_0x508b('0x4a')])&&fs['existsSync'](_0x2b48db)){logger[_0x508b('0x56')](_0x508b('0x57')+_0x2b48db+_0x508b('0x58'));fs[_0x508b('0x59')](_0x2b48db);}_0x2b48db=_0x2b48db+_0x508b('0x5a');if(!_[_0x508b('0x5b')](_0x3dadad[_0x508b('0x4a')])&&fs[_0x508b('0x46')](_0x2b48db)){logger[_0x508b('0x56')](_0x508b('0x57')+_0x2b48db+_0x508b('0x58'));fs[_0x508b('0x59')](_0x2b48db);}return _0x3dadad;})['then'](function(_0x559d78){if(!_0x559d78)throw new InternalError();return _0x559d78[_0x508b('0x54')]();})[_0x508b('0x22')](function(){_0x4685de['status'](0xcc)[_0x508b('0x1a')]();})[_0x508b('0x3e')](handleError(_0x4685de,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 01c32fb..d5eb9d0 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 _0x0a05=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','square_recordings','lodash','util'];(function(_0x4caef8,_0x31fe01){var _0x305585=function(_0x4c27e5){while(--_0x4c27e5){_0x4caef8['push'](_0x4caef8['shift']());}};_0x305585(++_0x31fe01);}(_0x0a05,0x9e));var _0x50a0=function(_0x263204,_0x19286b){_0x263204=_0x263204-0x0;var _0xed3987=_0x0a05[_0x263204];return _0xed3987;};'use strict';var _=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var logger=require(_0x50a0('0x2'))(_0x50a0('0x3'));var moment=require(_0x50a0('0x4'));var BPromise=require(_0x50a0('0x5'));var rp=require(_0x50a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50a0('0x7'));var config=require('../../config/environment');var attributes=require(_0x50a0('0x8'));module['exports']=function(_0x3546f9,_0x41a18d){return _0x3546f9['define']('SquareRecording',attributes,{'tableName':_0x50a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b78=['define','SquareRecording','util','../../config/logger','api','bluebird','request-promise','./squareRecording.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0b78,0x1d6));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x80b7('0x0'));var logger=require(_0x80b7('0x1'))(_0x80b7('0x2'));var moment=require('moment');var BPromise=require(_0x80b7('0x3'));var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x80b7('0x5'));module[_0x80b7('0x6')]=function(_0x2809e7,_0x3b21f3){return _0x2809e7[_0x80b7('0x7')](_0x80b7('0x8'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 76de5f4..afcae17 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 _0x32f9=['stringify','error','code','message','catch','CreateSquareRecording','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0xc1078,_0x87768b){var _0x1eb9bd=function(_0x5c35f9){while(--_0x5c35f9){_0xc1078['push'](_0xc1078['shift']());}};_0x1eb9bd(++_0x87768b);}(_0x32f9,0x118));var _0x932f=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x32f9[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x932f('0x0'));var util=require('util');var moment=require(_0x932f('0x1'));var BPromise=require(_0x932f('0x2'));var rs=require(_0x932f('0x3'));var fs=require('fs');var Redis=require(_0x932f('0x4'));var db=require(_0x932f('0x5'))['db'];var utils=require(_0x932f('0x6'));var logger=require(_0x932f('0x7'))(_0x932f('0x8'));var config=require(_0x932f('0x9'));var jayson=require(_0x932f('0xa'));var client=jayson[_0x932f('0xb')][_0x932f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x597c48,_0x3e5ba5,_0x9f4cfe){return new BPromise(function(_0x916d49,_0x50080b){return client[_0x932f('0xd')](_0x597c48,_0x9f4cfe)[_0x932f('0xe')](function(_0x3ebd11){logger[_0x932f('0xf')](_0x932f('0x10'),_0x3e5ba5,_0x932f('0x11'));logger[_0x932f('0x12')](_0x932f('0x13'),_0x3e5ba5,_0x932f('0x11'),JSON[_0x932f('0x14')](_0x3ebd11));if(_0x3ebd11[_0x932f('0x15')]){if(_0x3ebd11[_0x932f('0x15')][_0x932f('0x16')]===0x1f4){logger[_0x932f('0x15')](_0x932f('0x10'),_0x3e5ba5,_0x3ebd11[_0x932f('0x15')][_0x932f('0x17')]);return _0x50080b(_0x3ebd11['error'][_0x932f('0x17')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x3e5ba5,_0x3ebd11[_0x932f('0x15')][_0x932f('0x17')]);return _0x916d49(_0x3ebd11[_0x932f('0x15')][_0x932f('0x17')]);}else{logger[_0x932f('0xf')](_0x932f('0x10'),_0x3e5ba5,'request\x20sent');_0x916d49(_0x3ebd11['result'][_0x932f('0x17')]);}})[_0x932f('0x18')](function(_0x5401dd){logger[_0x932f('0x15')](_0x932f('0x10'),_0x3e5ba5,_0x5401dd);_0x50080b(_0x5401dd);});});}exports[_0x932f('0x19')]=function(_0x3b5491){var _0x3e6a00=this;return new Promise(function(_0x55e2e8,_0x4517a3){return db['SquareRecording'][_0x932f('0x1a')](_0x3b5491[_0x932f('0x1b')],{'raw':_0x3b5491[_0x932f('0x1c')]?_0x3b5491[_0x932f('0x1c')][_0x932f('0x1d')]===undefined?!![]:![]:!![]})[_0x932f('0xe')](function(_0x5f24ad){logger[_0x932f('0xf')](_0x932f('0x19'),_0x3b5491);logger[_0x932f('0x12')](_0x932f('0x19'),_0x3b5491,JSON[_0x932f('0x14')](_0x5f24ad));_0x55e2e8(_0x5f24ad);})[_0x932f('0x18')](function(_0xb904ad){logger[_0x932f('0x15')]('CreateSquareRecording',_0xb904ad['message'],_0x3b5491);_0x4517a3(_0x3e6a00[_0x932f('0x15')](0x1f4,_0xb904ad[_0x932f('0x17')]));});});}; \ No newline at end of file +var _0x0f1d=['message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41ffe4,_0x3a04ae){var _0x1ba9f3=function(_0x53a6b5){while(--_0x53a6b5){_0x41ffe4['push'](_0x41ffe4['shift']());}};_0x1ba9f3(++_0x3a04ae);}(_0x0f1d,0x1cd));var _0xd0f1=function(_0x3416d9,_0x6a56f9){_0x3416d9=_0x3416d9-0x0;var _0x589ad9=_0x0f1d[_0x3416d9];return _0x589ad9;};'use strict';var _=require(_0xd0f1('0x0'));var util=require(_0xd0f1('0x1'));var moment=require(_0xd0f1('0x2'));var BPromise=require(_0xd0f1('0x3'));var rs=require(_0xd0f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0f1('0x5'))['db'];var utils=require(_0xd0f1('0x6'));var logger=require(_0xd0f1('0x7'))('rpc');var config=require(_0xd0f1('0x8'));var jayson=require(_0xd0f1('0x9'));var client=jayson[_0xd0f1('0xa')][_0xd0f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2db01b,_0x365e70,_0x1907ea){return new BPromise(function(_0x587aaf,_0x379693){return client[_0xd0f1('0xc')](_0x2db01b,_0x1907ea)['then'](function(_0x13fbb5){logger[_0xd0f1('0xd')](_0xd0f1('0xe'),_0x365e70,_0xd0f1('0xf'));logger['debug'](_0xd0f1('0x10'),_0x365e70,_0xd0f1('0xf'),JSON[_0xd0f1('0x11')](_0x13fbb5));if(_0x13fbb5[_0xd0f1('0x12')]){if(_0x13fbb5[_0xd0f1('0x12')]['code']===0x1f4){logger[_0xd0f1('0x12')](_0xd0f1('0xe'),_0x365e70,_0x13fbb5['error'][_0xd0f1('0x13')]);return _0x379693(_0x13fbb5[_0xd0f1('0x12')][_0xd0f1('0x13')]);}logger['error'](_0xd0f1('0xe'),_0x365e70,_0x13fbb5['error'][_0xd0f1('0x13')]);return _0x587aaf(_0x13fbb5[_0xd0f1('0x12')]['message']);}else{logger[_0xd0f1('0xd')](_0xd0f1('0xe'),_0x365e70,_0xd0f1('0xf'));_0x587aaf(_0x13fbb5[_0xd0f1('0x14')][_0xd0f1('0x13')]);}})[_0xd0f1('0x15')](function(_0x10b5e5){logger['error'](_0xd0f1('0xe'),_0x365e70,_0x10b5e5);_0x379693(_0x10b5e5);});});}exports[_0xd0f1('0x16')]=function(_0x2cbea9){var _0x2d5ec1=this;return new Promise(function(_0x162c7d,_0x372847){return db[_0xd0f1('0x17')][_0xd0f1('0x18')](_0x2cbea9[_0xd0f1('0x19')],{'raw':_0x2cbea9[_0xd0f1('0x1a')]?_0x2cbea9['options'][_0xd0f1('0x1b')]===undefined?!![]:![]:!![]})[_0xd0f1('0x1c')](function(_0x169d81){logger[_0xd0f1('0xd')](_0xd0f1('0x16'),_0x2cbea9);logger[_0xd0f1('0x1d')](_0xd0f1('0x16'),_0x2cbea9,JSON[_0xd0f1('0x11')](_0x169d81));_0x162c7d(_0x169d81);})[_0xd0f1('0x15')](function(_0x23e2f9){logger[_0xd0f1('0x12')](_0xd0f1('0x16'),_0x23e2f9[_0xd0f1('0x13')],_0x2cbea9);_0x372847(_0x2d5ec1[_0xd0f1('0x12')](0x1f4,_0x23e2f9[_0xd0f1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index de8daf1..241fc29 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x82f94d,_0x47935a){var _0x435f41=function(_0x455b96){while(--_0x455b96){_0x82f94d['push'](_0x82f94d['shift']());}};_0x435f41(++_0x47935a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 516b733..f0716f9 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 _0x7640=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x397b4a,_0x34e886){var _0x2576d5=function(_0x55c256){while(--_0x55c256){_0x397b4a['push'](_0x397b4a['shift']());}};_0x2576d5(++_0x34e886);}(_0x7640,0xdc));var _0x0764=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x7640[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0x0764('0x0'));module[_0x0764('0x1')]={'network':{'type':Sequelize[_0x0764('0x2')]},'network_script':{'type':Sequelize[_0x0764('0x2')]},'request':{'type':Sequelize[_0x0764('0x2')]},'channel':{'type':Sequelize[_0x0764('0x2')]},'language':{'type':Sequelize[_0x0764('0x2')]},'type':{'type':Sequelize[_0x0764('0x2')]},'uniqueid':{'type':Sequelize[_0x0764('0x2')]},'version':{'type':Sequelize[_0x0764('0x2')]},'callerid':{'type':Sequelize[_0x0764('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x0764('0x2')]},'callingani2':{'type':Sequelize[_0x0764('0x2')]},'callington':{'type':Sequelize[_0x0764('0x2')]},'callingtns':{'type':Sequelize[_0x0764('0x2')]},'dnid':{'type':Sequelize[_0x0764('0x2')]},'rdnis':{'type':Sequelize[_0x0764('0x2')]},'context':{'type':Sequelize[_0x0764('0x2')]},'extension':{'type':Sequelize[_0x0764('0x2')]},'priority':{'type':Sequelize[_0x0764('0x2')]},'enhanced':{'type':Sequelize[_0x0764('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0764('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0764('0x3')]},'leaveAt':{'type':Sequelize[_0x0764('0x3')]},'bot':{'type':Sequelize[_0x0764('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7d4d=['DATE','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7d4d,0xd9));var _0xd7d4=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x7d4d[_0x42ebba];return _0x3fd2af;};'use strict';var Sequelize=require('sequelize');module[_0xd7d4('0x0')]={'network':{'type':Sequelize[_0xd7d4('0x1')]},'network_script':{'type':Sequelize[_0xd7d4('0x1')]},'request':{'type':Sequelize[_0xd7d4('0x1')]},'channel':{'type':Sequelize[_0xd7d4('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd7d4('0x1')]},'uniqueid':{'type':Sequelize[_0xd7d4('0x1')]},'version':{'type':Sequelize[_0xd7d4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd7d4('0x1')]},'callingpres':{'type':Sequelize[_0xd7d4('0x1')]},'callingani2':{'type':Sequelize[_0xd7d4('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd7d4('0x1')]},'dnid':{'type':Sequelize[_0xd7d4('0x1')]},'rdnis':{'type':Sequelize[_0xd7d4('0x1')]},'context':{'type':Sequelize[_0xd7d4('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xd7d4('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xd7d4('0x1')]},'project_name':{'type':Sequelize[_0xd7d4('0x1')]},'joinAt':{'type':Sequelize[_0xd7d4('0x2')]},'leaveAt':{'type':Sequelize[_0xd7d4('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d34d918..a735c0e 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 _0x7ec0=['VIRTUAL','options','SquareReport','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','name','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0x7ec0,0xe7));var _0x07ec=function(_0x2a4767,_0xd1f908){_0x2a4767=_0x2a4767-0x0;var _0x2ec9ca=_0x7ec0[_0x2a4767];return _0x2ec9ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07ec('0x0'));var zipdir=require(_0x07ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07ec('0x2'));var moment=require(_0x07ec('0x3'));var BPromise=require(_0x07ec('0x4'));var Mustache=require(_0x07ec('0x5'));var util=require(_0x07ec('0x6'));var path=require(_0x07ec('0x7'));var sox=require(_0x07ec('0x8'));var csv=require('to-csv');var ejs=require(_0x07ec('0x9'));var fs=require('fs');var fs_extra=require(_0x07ec('0xa'));var _=require(_0x07ec('0xb'));var squel=require('squel');var crypto=require(_0x07ec('0xc'));var jsforce=require(_0x07ec('0xd'));var deskjs=require(_0x07ec('0xe'));var toCsv=require(_0x07ec('0xf'));var querystring=require(_0x07ec('0x10'));var Papa=require(_0x07ec('0x11'));var Redis=require('ioredis');var authService=require(_0x07ec('0x12'));var qs=require(_0x07ec('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x07ec('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x07ec('0x15'))['db'];function respondWithStatusCode(_0x4dcdd7,_0x264fb9){_0x264fb9=_0x264fb9||0xcc;return function(_0x2c0a36){if(_0x2c0a36){return _0x4dcdd7[_0x07ec('0x16')](_0x264fb9);}return _0x4dcdd7[_0x07ec('0x17')](_0x264fb9)['end']();};}function respondWithResult(_0x461fba,_0x1a03a3){_0x1a03a3=_0x1a03a3||0xc8;return function(_0x1d2a90){if(_0x1d2a90){return _0x461fba[_0x07ec('0x17')](_0x1a03a3)[_0x07ec('0x18')](_0x1d2a90);}};}function respondWithFilteredResult(_0x2086f4,_0x35ccfd){return function(_0x2d1590){if(_0x2d1590){var _0x2a7429=typeof _0x35ccfd[_0x07ec('0x19')]===_0x07ec('0x1a')&&typeof _0x35ccfd[_0x07ec('0x1b')]===_0x07ec('0x1a');var _0x4d97cb=_0x2d1590[_0x07ec('0x1c')];var _0xaa8e72=_0x2a7429?0x0:_0x35ccfd['offset'];var _0x5e9e1c=_0x2a7429?_0x2d1590[_0x07ec('0x1c')]:_0x35ccfd[_0x07ec('0x19')]+_0x35ccfd[_0x07ec('0x1b')];var _0x1d8ac6;if(_0x5e9e1c>=_0x4d97cb){_0x5e9e1c=_0x4d97cb;_0x1d8ac6=0xc8;}else{_0x1d8ac6=0xce;}_0x2086f4[_0x07ec('0x17')](_0x1d8ac6);return _0x2086f4['set'](_0x07ec('0x1d'),_0xaa8e72+'-'+_0x5e9e1c+'/'+_0x4d97cb)[_0x07ec('0x18')](_0x2d1590);}return null;};}function patchUpdates(_0x1a9f5d){return function(_0x4d5d6d){try{jsonpatch['apply'](_0x4d5d6d,_0x1a9f5d,!![]);}catch(_0x411e23){return BPromise[_0x07ec('0x1e')](_0x411e23);}return _0x4d5d6d[_0x07ec('0x1f')]();};}function saveUpdates(_0xd9b98,_0x52c2b7){return function(_0x36da78){if(_0x36da78){return _0x36da78[_0x07ec('0x20')](_0xd9b98)[_0x07ec('0x21')](function(_0x5c4560){return _0x5c4560;});}return null;};}function removeEntity(_0x397c50,_0x4de5f6){return function(_0x513c7c){if(_0x513c7c){return _0x513c7c[_0x07ec('0x22')]()[_0x07ec('0x21')](function(){_0x397c50[_0x07ec('0x17')](0xcc)[_0x07ec('0x23')]();});}};}function handleEntityNotFound(_0x1c7593,_0x28106e){return function(_0x9f4f12){if(!_0x9f4f12){_0x1c7593[_0x07ec('0x16')](0x194);}return _0x9f4f12;};}function handleError(_0x5d079f,_0x3670ec){_0x3670ec=_0x3670ec||0x1f4;return function(_0x437a6b){logger[_0x07ec('0x24')](_0x437a6b['stack']);if(_0x437a6b[_0x07ec('0x25')]){delete _0x437a6b[_0x07ec('0x25')];}_0x5d079f[_0x07ec('0x17')](_0x3670ec)['send'](_0x437a6b);};}exports['index']=function(_0x46fe75,_0x2c1065){var _0x47d1b8={},_0x130433={},_0x3e638b={'count':0x0,'rows':[]};var _0x1b252d=_['map'](db['SquareReport']['rawAttributes'],function(_0x1b5044){return{'name':_0x1b5044[_0x07ec('0x26')],'type':_0x1b5044[_0x07ec('0x27')]['key']};});_0x130433['model']=_[_0x07ec('0x28')](_0x1b252d,_0x07ec('0x25'));_0x130433[_0x07ec('0x29')]=_[_0x07ec('0x2a')](_0x46fe75['query']);_0x130433[_0x07ec('0x2b')]=_[_0x07ec('0x2c')](_0x130433[_0x07ec('0x2d')],_0x130433[_0x07ec('0x29')]);_0x47d1b8['attributes']=_[_0x07ec('0x2c')](_0x130433['model'],qs[_0x07ec('0x2e')](_0x46fe75[_0x07ec('0x29')][_0x07ec('0x2e')]));_0x47d1b8[_0x07ec('0x2f')]=_0x47d1b8[_0x07ec('0x2f')][_0x07ec('0x30')]?_0x47d1b8[_0x07ec('0x2f')]:_0x130433[_0x07ec('0x2d')];if(!_0x46fe75[_0x07ec('0x29')][_0x07ec('0x31')](_0x07ec('0x32'))){_0x47d1b8[_0x07ec('0x1b')]=qs['limit'](_0x46fe75[_0x07ec('0x29')][_0x07ec('0x1b')]);_0x47d1b8[_0x07ec('0x19')]=qs[_0x07ec('0x19')](_0x46fe75[_0x07ec('0x29')][_0x07ec('0x19')]);}_0x47d1b8[_0x07ec('0x33')]=qs[_0x07ec('0x34')](_0x46fe75[_0x07ec('0x29')]['sort']);_0x47d1b8[_0x07ec('0x35')]=qs[_0x07ec('0x2b')](_[_0x07ec('0x36')](_0x46fe75[_0x07ec('0x29')],_0x130433[_0x07ec('0x2b')]),_0x1b252d);if(_0x46fe75[_0x07ec('0x29')][_0x07ec('0x37')]){_0x47d1b8[_0x07ec('0x35')]=_[_0x07ec('0x38')](_0x47d1b8[_0x07ec('0x35')],{'$or':_[_0x07ec('0x28')](_0x1b252d,function(_0xf87c9e){if(_0xf87c9e[_0x07ec('0x27')]!==_0x07ec('0x39')){var _0x4b8522={};_0x4b8522[_0xf87c9e[_0x07ec('0x25')]]={'$like':'%'+_0x46fe75[_0x07ec('0x29')][_0x07ec('0x37')]+'%'};return _0x4b8522;}})});}_0x47d1b8=_[_0x07ec('0x38')]({},_0x47d1b8,_0x46fe75[_0x07ec('0x3a')]);var _0x2da0ef={'where':_0x47d1b8['where']};return db[_0x07ec('0x3b')][_0x07ec('0x1c')](_0x2da0ef)[_0x07ec('0x21')](function(_0x5f2cc7){_0x3e638b[_0x07ec('0x1c')]=_0x5f2cc7;if(_0x46fe75[_0x07ec('0x29')]['includeAll']){_0x47d1b8[_0x07ec('0x3c')]=[{'all':!![]}];}return db[_0x07ec('0x3b')][_0x07ec('0x3d')](_0x47d1b8);})[_0x07ec('0x21')](function(_0x5bddd2){_0x3e638b[_0x07ec('0x3e')]=_0x5bddd2;return _0x3e638b;})['then'](respondWithFilteredResult(_0x2c1065,_0x47d1b8))[_0x07ec('0x3f')](handleError(_0x2c1065,null));};exports[_0x07ec('0x40')]=function(_0x34cc74,_0x48ad54){var _0x3982fc={'raw':!![],'where':{'id':_0x34cc74['params']['id']}},_0x3562f7={};_0x3562f7[_0x07ec('0x2d')]=_['keys'](db[_0x07ec('0x3b')][_0x07ec('0x41')]);_0x3562f7[_0x07ec('0x29')]=_[_0x07ec('0x2a')](_0x34cc74[_0x07ec('0x29')]);_0x3562f7[_0x07ec('0x2b')]=_[_0x07ec('0x2c')](_0x3562f7[_0x07ec('0x2d')],_0x3562f7[_0x07ec('0x29')]);_0x3982fc['attributes']=_[_0x07ec('0x2c')](_0x3562f7[_0x07ec('0x2d')],qs[_0x07ec('0x2e')](_0x34cc74[_0x07ec('0x29')][_0x07ec('0x2e')]));_0x3982fc['attributes']=_0x3982fc[_0x07ec('0x2f')][_0x07ec('0x30')]?_0x3982fc['attributes']:_0x3562f7[_0x07ec('0x2d')];if(_0x34cc74[_0x07ec('0x29')][_0x07ec('0x42')]){_0x3982fc[_0x07ec('0x3c')]=[{'all':!![]}];}_0x3982fc=_[_0x07ec('0x38')]({},_0x3982fc,_0x34cc74[_0x07ec('0x3a')]);return db[_0x07ec('0x3b')][_0x07ec('0x43')](_0x3982fc)[_0x07ec('0x21')](handleEntityNotFound(_0x48ad54,null))['then'](respondWithResult(_0x48ad54,null))['catch'](handleError(_0x48ad54,null));};exports['create']=function(_0x437c2e,_0x322691){return db[_0x07ec('0x3b')][_0x07ec('0x44')](_0x437c2e[_0x07ec('0x45')],{})[_0x07ec('0x21')](respondWithResult(_0x322691,0xc9))['catch'](handleError(_0x322691,null));};exports[_0x07ec('0x20')]=function(_0xfd8c1e,_0x1a8f7d){if(_0xfd8c1e[_0x07ec('0x45')]['id']){delete _0xfd8c1e[_0x07ec('0x45')]['id'];}return db['SquareReport'][_0x07ec('0x43')]({'where':{'id':_0xfd8c1e[_0x07ec('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a8f7d,null))[_0x07ec('0x21')](saveUpdates(_0xfd8c1e['body'],null))['then'](respondWithResult(_0x1a8f7d,null))[_0x07ec('0x3f')](handleError(_0x1a8f7d,null));};exports['destroy']=function(_0x3ed7da,_0x1ff694){return db[_0x07ec('0x3b')]['find']({'where':{'id':_0x3ed7da[_0x07ec('0x46')]['id']}})[_0x07ec('0x21')](handleEntityNotFound(_0x1ff694,null))['then'](removeEntity(_0x1ff694,null))['catch'](handleError(_0x1ff694,null));};exports[_0x07ec('0x47')]=function(_0x1307a4,_0x3851be){return db[_0x07ec('0x3b')][_0x07ec('0x47')]()[_0x07ec('0x21')](respondWithResult(_0x3851be,null))['catch'](handleError(_0x3851be,null));}; \ No newline at end of file +var _0xb993=['include','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','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','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','SquareReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','fields'];(function(_0x31dd0c,_0x4f11b5){var _0x26fa85=function(_0x4f9bb4){while(--_0x4f9bb4){_0x31dd0c['push'](_0x31dd0c['shift']());}};_0x26fa85(++_0x4f11b5);}(_0xb993,0x1c7));var _0x3b99=function(_0x384de0,_0x128354){_0x384de0=_0x384de0-0x0;var _0x35d5ba=_0xb993[_0x384de0];return _0x35d5ba;};'use strict';var emlformat=require(_0x3b99('0x0'));var rimraf=require(_0x3b99('0x1'));var zipdir=require(_0x3b99('0x2'));var jsonpatch=require(_0x3b99('0x3'));var rp=require(_0x3b99('0x4'));var moment=require('moment');var BPromise=require(_0x3b99('0x5'));var Mustache=require(_0x3b99('0x6'));var util=require('util');var path=require(_0x3b99('0x7'));var sox=require(_0x3b99('0x8'));var csv=require(_0x3b99('0x9'));var ejs=require(_0x3b99('0xa'));var fs=require('fs');var fs_extra=require(_0x3b99('0xb'));var _=require(_0x3b99('0xc'));var squel=require(_0x3b99('0xd'));var crypto=require(_0x3b99('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3b99('0x9'));var querystring=require(_0x3b99('0xf'));var Papa=require(_0x3b99('0x10'));var Redis=require('ioredis');var authService=require(_0x3b99('0x11'));var qs=require(_0x3b99('0x12'));var as=require(_0x3b99('0x13'));var hardwareService=require(_0x3b99('0x14'));var logger=require(_0x3b99('0x15'))(_0x3b99('0x16'));var utils=require(_0x3b99('0x17'));var config=require(_0x3b99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b99('0x19'))['db'];function respondWithStatusCode(_0x58b69b,_0x1cb3f5){_0x1cb3f5=_0x1cb3f5||0xcc;return function(_0x19cd94){if(_0x19cd94){return _0x58b69b['sendStatus'](_0x1cb3f5);}return _0x58b69b[_0x3b99('0x1a')](_0x1cb3f5)[_0x3b99('0x1b')]();};}function respondWithResult(_0x209483,_0xa8fae2){_0xa8fae2=_0xa8fae2||0xc8;return function(_0x3a0e67){if(_0x3a0e67){return _0x209483[_0x3b99('0x1a')](_0xa8fae2)[_0x3b99('0x1c')](_0x3a0e67);}};}function respondWithFilteredResult(_0x1851d2,_0x4f61c4){return function(_0x385da4){if(_0x385da4){var _0x36ba63=typeof _0x4f61c4[_0x3b99('0x1d')]===_0x3b99('0x1e')&&typeof _0x4f61c4[_0x3b99('0x1f')]===_0x3b99('0x1e');var _0x3fdded=_0x385da4[_0x3b99('0x20')];var _0x5dcd4a=_0x36ba63?0x0:_0x4f61c4[_0x3b99('0x1d')];var _0x20f66c=_0x36ba63?_0x385da4[_0x3b99('0x20')]:_0x4f61c4[_0x3b99('0x1d')]+_0x4f61c4['limit'];var _0x4bb071;if(_0x20f66c>=_0x3fdded){_0x20f66c=_0x3fdded;_0x4bb071=0xc8;}else{_0x4bb071=0xce;}_0x1851d2[_0x3b99('0x1a')](_0x4bb071);return _0x1851d2[_0x3b99('0x21')](_0x3b99('0x22'),_0x5dcd4a+'-'+_0x20f66c+'/'+_0x3fdded)[_0x3b99('0x1c')](_0x385da4);}return null;};}function patchUpdates(_0xff649d){return function(_0x4aac43){try{jsonpatch['apply'](_0x4aac43,_0xff649d,!![]);}catch(_0xca386d){return BPromise['reject'](_0xca386d);}return _0x4aac43[_0x3b99('0x23')]();};}function saveUpdates(_0x1a836e,_0x546364){return function(_0x166ca0){if(_0x166ca0){return _0x166ca0[_0x3b99('0x24')](_0x1a836e)['then'](function(_0x5ba773){return _0x5ba773;});}return null;};}function removeEntity(_0x589ed7,_0x2d7c40){return function(_0x380962){if(_0x380962){return _0x380962[_0x3b99('0x25')]()[_0x3b99('0x26')](function(){_0x589ed7[_0x3b99('0x1a')](0xcc)[_0x3b99('0x1b')]();});}};}function handleEntityNotFound(_0x17be9a,_0x33d66a){return function(_0x208898){if(!_0x208898){_0x17be9a[_0x3b99('0x27')](0x194);}return _0x208898;};}function handleError(_0x49f66e,_0xbb41b2){_0xbb41b2=_0xbb41b2||0x1f4;return function(_0x5ce158){logger[_0x3b99('0x28')](_0x5ce158[_0x3b99('0x29')]);if(_0x5ce158[_0x3b99('0x2a')]){delete _0x5ce158[_0x3b99('0x2a')];}_0x49f66e['status'](_0xbb41b2)[_0x3b99('0x2b')](_0x5ce158);};}exports['index']=function(_0x48d445,_0x391983){var _0x1ac167={},_0x5f2ea8={},_0xe13a05={'count':0x0,'rows':[]};var _0x44a981=_['map'](db[_0x3b99('0x2c')][_0x3b99('0x2d')],function(_0x46d0f4){return{'name':_0x46d0f4[_0x3b99('0x2e')],'type':_0x46d0f4[_0x3b99('0x2f')][_0x3b99('0x30')]};});_0x5f2ea8[_0x3b99('0x31')]=_[_0x3b99('0x32')](_0x44a981,_0x3b99('0x2a'));_0x5f2ea8[_0x3b99('0x33')]=_[_0x3b99('0x34')](_0x48d445[_0x3b99('0x33')]);_0x5f2ea8[_0x3b99('0x35')]=_[_0x3b99('0x36')](_0x5f2ea8[_0x3b99('0x31')],_0x5f2ea8[_0x3b99('0x33')]);_0x1ac167[_0x3b99('0x37')]=_[_0x3b99('0x36')](_0x5f2ea8['model'],qs['fields'](_0x48d445[_0x3b99('0x33')]['fields']));_0x1ac167[_0x3b99('0x37')]=_0x1ac167[_0x3b99('0x37')]['length']?_0x1ac167[_0x3b99('0x37')]:_0x5f2ea8['model'];if(!_0x48d445[_0x3b99('0x33')][_0x3b99('0x38')](_0x3b99('0x39'))){_0x1ac167[_0x3b99('0x1f')]=qs[_0x3b99('0x1f')](_0x48d445[_0x3b99('0x33')]['limit']);_0x1ac167[_0x3b99('0x1d')]=qs['offset'](_0x48d445[_0x3b99('0x33')][_0x3b99('0x1d')]);}_0x1ac167[_0x3b99('0x3a')]=qs['sort'](_0x48d445[_0x3b99('0x33')]['sort']);_0x1ac167[_0x3b99('0x3b')]=qs['filters'](_[_0x3b99('0x3c')](_0x48d445[_0x3b99('0x33')],_0x5f2ea8['filters']),_0x44a981);if(_0x48d445[_0x3b99('0x33')][_0x3b99('0x3d')]){_0x1ac167[_0x3b99('0x3b')]=_['merge'](_0x1ac167[_0x3b99('0x3b')],{'$or':_[_0x3b99('0x32')](_0x44a981,function(_0x110b3a){if(_0x110b3a[_0x3b99('0x2f')]!==_0x3b99('0x3e')){var _0x1e6185={};_0x1e6185[_0x110b3a[_0x3b99('0x2a')]]={'$like':'%'+_0x48d445[_0x3b99('0x33')][_0x3b99('0x3d')]+'%'};return _0x1e6185;}})});}_0x1ac167=_[_0x3b99('0x3f')]({},_0x1ac167,_0x48d445[_0x3b99('0x40')]);var _0x1d4ed6={'where':_0x1ac167[_0x3b99('0x3b')]};return db[_0x3b99('0x2c')][_0x3b99('0x20')](_0x1d4ed6)[_0x3b99('0x26')](function(_0x3c9bfc){_0xe13a05[_0x3b99('0x20')]=_0x3c9bfc;if(_0x48d445[_0x3b99('0x33')][_0x3b99('0x41')]){_0x1ac167['include']=[{'all':!![]}];}return db[_0x3b99('0x2c')]['findAll'](_0x1ac167);})[_0x3b99('0x26')](function(_0x27c358){_0xe13a05[_0x3b99('0x42')]=_0x27c358;return _0xe13a05;})[_0x3b99('0x26')](respondWithFilteredResult(_0x391983,_0x1ac167))[_0x3b99('0x43')](handleError(_0x391983,null));};exports[_0x3b99('0x44')]=function(_0x594a49,_0x2220e0){var _0x20123e={'raw':!![],'where':{'id':_0x594a49['params']['id']}},_0x2b2629={};_0x2b2629[_0x3b99('0x31')]=_['keys'](db['SquareReport'][_0x3b99('0x2d')]);_0x2b2629[_0x3b99('0x33')]=_[_0x3b99('0x34')](_0x594a49[_0x3b99('0x33')]);_0x2b2629[_0x3b99('0x35')]=_[_0x3b99('0x36')](_0x2b2629[_0x3b99('0x31')],_0x2b2629[_0x3b99('0x33')]);_0x20123e[_0x3b99('0x37')]=_[_0x3b99('0x36')](_0x2b2629[_0x3b99('0x31')],qs['fields'](_0x594a49[_0x3b99('0x33')][_0x3b99('0x45')]));_0x20123e[_0x3b99('0x37')]=_0x20123e['attributes']['length']?_0x20123e[_0x3b99('0x37')]:_0x2b2629['model'];if(_0x594a49[_0x3b99('0x33')]['includeAll']){_0x20123e[_0x3b99('0x46')]=[{'all':!![]}];}_0x20123e=_[_0x3b99('0x3f')]({},_0x20123e,_0x594a49[_0x3b99('0x40')]);return db[_0x3b99('0x2c')]['find'](_0x20123e)[_0x3b99('0x26')](handleEntityNotFound(_0x2220e0,null))[_0x3b99('0x26')](respondWithResult(_0x2220e0,null))[_0x3b99('0x43')](handleError(_0x2220e0,null));};exports[_0x3b99('0x47')]=function(_0x300787,_0x3d5cd2){return db['SquareReport'][_0x3b99('0x47')](_0x300787[_0x3b99('0x48')],{})[_0x3b99('0x26')](respondWithResult(_0x3d5cd2,0xc9))[_0x3b99('0x43')](handleError(_0x3d5cd2,null));};exports['update']=function(_0x196951,_0x4894f7){if(_0x196951['body']['id']){delete _0x196951[_0x3b99('0x48')]['id'];}return db[_0x3b99('0x2c')][_0x3b99('0x49')]({'where':{'id':_0x196951[_0x3b99('0x4a')]['id']}})[_0x3b99('0x26')](handleEntityNotFound(_0x4894f7,null))[_0x3b99('0x26')](saveUpdates(_0x196951['body'],null))[_0x3b99('0x26')](respondWithResult(_0x4894f7,null))[_0x3b99('0x43')](handleError(_0x4894f7,null));};exports['destroy']=function(_0x36948e,_0x379726){return db['SquareReport'][_0x3b99('0x49')]({'where':{'id':_0x36948e[_0x3b99('0x4a')]['id']}})[_0x3b99('0x26')](handleEntityNotFound(_0x379726,null))['then'](removeEntity(_0x379726,null))[_0x3b99('0x43')](handleError(_0x379726,null));};exports['describe']=function(_0x32dfa2,_0x5a3f1d){return db[_0x3b99('0x2c')]['describe']()[_0x3b99('0x26')](respondWithResult(_0x5a3f1d,null))[_0x3b99('0x43')](handleError(_0x5a3f1d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 7dd6f94..cd9e38a 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 _0xe065=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe065,0xc6));var _0x5e06=function(_0x1988e3,_0x1f19fb){_0x1988e3=_0x1988e3-0x0;var _0x3952f4=_0xe065[_0x1988e3];return _0x3952f4;};'use strict';var _=require(_0x5e06('0x0'));var util=require('util');var logger=require(_0x5e06('0x1'))(_0x5e06('0x2'));var moment=require(_0x5e06('0x3'));var BPromise=require(_0x5e06('0x4'));var rp=require(_0x5e06('0x5'));var fs=require('fs');var path=require(_0x5e06('0x6'));var rimraf=require(_0x5e06('0x7'));var config=require(_0x5e06('0x8'));var attributes=require(_0x5e06('0x9'));module[_0x5e06('0xa')]=function(_0x3c1dca,_0x40f66e){return _0x3c1dca[_0x5e06('0xb')](_0x5e06('0xc'),attributes,{'tableName':_0x5e06('0xd'),'paranoid':![],'indexes':[{'name':_0x5e06('0xe'),'fields':[_0x5e06('0xf'),_0x5e06('0x10')]},{'name':_0x5e06('0x11'),'fields':[_0x5e06('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc5a9=['uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x19a2dc,_0x39eaf4){var _0x5405ef=function(_0x4ced77){while(--_0x4ced77){_0x19a2dc['push'](_0x19a2dc['shift']());}};_0x5405ef(++_0x39eaf4);}(_0xc5a9,0x1b4));var _0x9c5a=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xc5a9[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x9c5a('0x0'));var util=require('util');var logger=require(_0x9c5a('0x1'))(_0x9c5a('0x2'));var moment=require('moment');var BPromise=require(_0x9c5a('0x3'));var rp=require(_0x9c5a('0x4'));var fs=require('fs');var path=require(_0x9c5a('0x5'));var rimraf=require(_0x9c5a('0x6'));var config=require(_0x9c5a('0x7'));var attributes=require(_0x9c5a('0x8'));module[_0x9c5a('0x9')]=function(_0x2caf3e,_0x3fcdd4){return _0x2caf3e[_0x9c5a('0xa')](_0x9c5a('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x9c5a('0xc'),'fields':[_0x9c5a('0xd'),_0x9c5a('0xe')]},{'name':'leaveAt','fields':[_0x9c5a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 1bbc3b8..3d99486 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 _0xd200=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','options','raw','debug','CreateSquareReport','catch','UpdateSquareReport','SquareReport','update','body','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s'];(function(_0x57834a,_0xfac574){var _0x5788d9=function(_0x290392){while(--_0x290392){_0x57834a['push'](_0x57834a['shift']());}};_0x5788d9(++_0xfac574);}(_0xd200,0x1b2));var _0x0d20=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xd200[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x0d20('0x0'));var util=require('util');var moment=require(_0x0d20('0x1'));var BPromise=require(_0x0d20('0x2'));var rs=require(_0x0d20('0x3'));var fs=require('fs');var Redis=require(_0x0d20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d20('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0d20('0x6'));var jayson=require(_0x0d20('0x7'));var client=jayson[_0x0d20('0x8')][_0x0d20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bbcac,_0x569c81,_0x9ee98a){return new BPromise(function(_0x5bf515,_0xa38fd4){return client[_0x0d20('0xa')](_0x5bbcac,_0x9ee98a)[_0x0d20('0xb')](function(_0x54e539){logger[_0x0d20('0xc')](_0x0d20('0xd'),_0x569c81,'request\x20sent');logger['debug'](_0x0d20('0xe'),_0x569c81,'request\x20sent',JSON[_0x0d20('0xf')](_0x54e539));if(_0x54e539[_0x0d20('0x10')]){if(_0x54e539[_0x0d20('0x10')][_0x0d20('0x11')]===0x1f4){logger[_0x0d20('0x10')](_0x0d20('0xd'),_0x569c81,_0x54e539[_0x0d20('0x10')][_0x0d20('0x12')]);return _0xa38fd4(_0x54e539[_0x0d20('0x10')][_0x0d20('0x12')]);}logger[_0x0d20('0x10')](_0x0d20('0xd'),_0x569c81,_0x54e539['error'][_0x0d20('0x12')]);return _0x5bf515(_0x54e539[_0x0d20('0x10')][_0x0d20('0x12')]);}else{logger[_0x0d20('0xc')]('SquareReport,\x20%s,\x20%s',_0x569c81,'request\x20sent');_0x5bf515(_0x54e539[_0x0d20('0x13')][_0x0d20('0x12')]);}})['catch'](function(_0x765c85){logger[_0x0d20('0x10')](_0x0d20('0xd'),_0x569c81,_0x765c85);_0xa38fd4(_0x765c85);});});}exports['CreateSquareReport']=function(_0x57311d){var _0x497ed2=this;return new Promise(function(_0x42eff5,_0x3f52ce){return db['SquareReport'][_0x0d20('0x14')](_0x57311d['body'],{'raw':_0x57311d[_0x0d20('0x15')]?_0x57311d[_0x0d20('0x15')][_0x0d20('0x16')]===undefined?!![]:![]:!![]})[_0x0d20('0xb')](function(_0x3823f2){logger[_0x0d20('0xc')]('CreateSquareReport',_0x57311d);logger[_0x0d20('0x17')](_0x0d20('0x18'),_0x57311d,JSON[_0x0d20('0xf')](_0x3823f2));_0x42eff5(_0x3823f2);})[_0x0d20('0x19')](function(_0x26499b){logger['error'](_0x0d20('0x18'),_0x26499b[_0x0d20('0x12')],_0x57311d);_0x3f52ce(_0x497ed2[_0x0d20('0x10')](0x1f4,_0x26499b[_0x0d20('0x12')]));});});};exports[_0x0d20('0x1a')]=function(_0x4a332b){var _0x27025a=this;return new Promise(function(_0x51d4e5,_0x194b8a){return db[_0x0d20('0x1b')][_0x0d20('0x1c')](_0x4a332b[_0x0d20('0x1d')],{'raw':_0x4a332b['options']?_0x4a332b[_0x0d20('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a332b['options']?_0x4a332b['options']['where']||null:null,'attributes':_0x4a332b[_0x0d20('0x15')]?_0x4a332b[_0x0d20('0x15')][_0x0d20('0x1e')]||null:null,'limit':_0x4a332b[_0x0d20('0x15')]?_0x4a332b[_0x0d20('0x15')][_0x0d20('0x1f')]||null:null})['then'](function(_0x241a4f){logger[_0x0d20('0xc')](_0x0d20('0x1a'),_0x4a332b);logger[_0x0d20('0x17')]('UpdateSquareReport',_0x4a332b,JSON[_0x0d20('0xf')](_0x241a4f));_0x51d4e5(_0x241a4f);})[_0x0d20('0x19')](function(_0x109a1b){logger[_0x0d20('0x10')](_0x0d20('0x1a'),_0x109a1b[_0x0d20('0x12')],_0x4a332b);_0x194b8a(_0x27025a[_0x0d20('0x10')](0x1f4,_0x109a1b[_0x0d20('0x12')]));});});}; \ No newline at end of file +var _0x0c0c=['result','catch','CreateSquareReport','create','body','raw','UpdateSquareReport','SquareReport','options','where','attributes','limit','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1ca93c,_0x3271ab){var _0x185169=function(_0x507763){while(--_0x507763){_0x1ca93c['push'](_0x1ca93c['shift']());}};_0x185169(++_0x3271ab);}(_0x0c0c,0x90));var _0xc0c0=function(_0x4ad479,_0x2ebe8b){_0x4ad479=_0x4ad479-0x0;var _0x5b0594=_0x0c0c[_0x4ad479];return _0x5b0594;};'use strict';var _=require('lodash');var util=require(_0xc0c0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc0c0('0x1'));var fs=require('fs');var Redis=require(_0xc0c0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0c0('0x3'));var logger=require(_0xc0c0('0x4'))(_0xc0c0('0x5'));var config=require(_0xc0c0('0x6'));var jayson=require(_0xc0c0('0x7'));var client=jayson[_0xc0c0('0x8')][_0xc0c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x468ae2,_0x34a51c,_0x50046a){return new BPromise(function(_0x3e75cc,_0x5c1e24){return client[_0xc0c0('0xa')](_0x468ae2,_0x50046a)[_0xc0c0('0xb')](function(_0x57b2d2){logger[_0xc0c0('0xc')](_0xc0c0('0xd'),_0x34a51c,_0xc0c0('0xe'));logger[_0xc0c0('0xf')](_0xc0c0('0x10'),_0x34a51c,_0xc0c0('0xe'),JSON[_0xc0c0('0x11')](_0x57b2d2));if(_0x57b2d2[_0xc0c0('0x12')]){if(_0x57b2d2['error'][_0xc0c0('0x13')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x34a51c,_0x57b2d2[_0xc0c0('0x12')][_0xc0c0('0x14')]);return _0x5c1e24(_0x57b2d2[_0xc0c0('0x12')][_0xc0c0('0x14')]);}logger[_0xc0c0('0x12')](_0xc0c0('0xd'),_0x34a51c,_0x57b2d2['error'][_0xc0c0('0x14')]);return _0x3e75cc(_0x57b2d2['error'][_0xc0c0('0x14')]);}else{logger[_0xc0c0('0xc')](_0xc0c0('0xd'),_0x34a51c,_0xc0c0('0xe'));_0x3e75cc(_0x57b2d2[_0xc0c0('0x15')][_0xc0c0('0x14')]);}})[_0xc0c0('0x16')](function(_0xae71d2){logger[_0xc0c0('0x12')]('SquareReport,\x20%s,\x20%s',_0x34a51c,_0xae71d2);_0x5c1e24(_0xae71d2);});});}exports[_0xc0c0('0x17')]=function(_0xae7305){var _0xf400cd=this;return new Promise(function(_0x33f49b,_0x49c5b6){return db['SquareReport'][_0xc0c0('0x18')](_0xae7305[_0xc0c0('0x19')],{'raw':_0xae7305['options']?_0xae7305['options'][_0xc0c0('0x1a')]===undefined?!![]:![]:!![]})[_0xc0c0('0xb')](function(_0x5dbd17){logger[_0xc0c0('0xc')](_0xc0c0('0x17'),_0xae7305);logger[_0xc0c0('0xf')]('CreateSquareReport',_0xae7305,JSON[_0xc0c0('0x11')](_0x5dbd17));_0x33f49b(_0x5dbd17);})[_0xc0c0('0x16')](function(_0x324b17){logger[_0xc0c0('0x12')](_0xc0c0('0x17'),_0x324b17[_0xc0c0('0x14')],_0xae7305);_0x49c5b6(_0xf400cd[_0xc0c0('0x12')](0x1f4,_0x324b17['message']));});});};exports[_0xc0c0('0x1b')]=function(_0x25e418){var _0x166e07=this;return new Promise(function(_0x581700,_0xd038df){return db[_0xc0c0('0x1c')]['update'](_0x25e418[_0xc0c0('0x19')],{'raw':_0x25e418[_0xc0c0('0x1d')]?_0x25e418[_0xc0c0('0x1d')][_0xc0c0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e418[_0xc0c0('0x1d')]?_0x25e418[_0xc0c0('0x1d')][_0xc0c0('0x1e')]||null:null,'attributes':_0x25e418[_0xc0c0('0x1d')]?_0x25e418[_0xc0c0('0x1d')][_0xc0c0('0x1f')]||null:null,'limit':_0x25e418['options']?_0x25e418[_0xc0c0('0x1d')][_0xc0c0('0x20')]||null:null})[_0xc0c0('0xb')](function(_0x11cc09){logger[_0xc0c0('0xc')](_0xc0c0('0x1b'),_0x25e418);logger[_0xc0c0('0xf')](_0xc0c0('0x1b'),_0x25e418,JSON[_0xc0c0('0x11')](_0x11cc09));_0x581700(_0x11cc09);})[_0xc0c0('0x16')](function(_0x42c263){logger[_0xc0c0('0x12')](_0xc0c0('0x1b'),_0x42c263[_0xc0c0('0x14')],_0x25e418);_0xd038df(_0x166e07[_0xc0c0('0x12')](0x1f4,_0x42c263[_0xc0c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 61bd91f..0f39256 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 _0x6f02=['post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','index','get','/describe','describe','/:id','isAuthenticated','show'];(function(_0x2e2219,_0x490ba9){var _0x1f5937=function(_0x339b6e){while(--_0x339b6e){_0x2e2219['push'](_0x2e2219['shift']());}};_0x1f5937(++_0x490ba9);}(_0x6f02,0x1bd));var _0x26f0=function(_0x601730,_0x282c03){_0x601730=_0x601730-0x0;var _0x280c7c=_0x6f02[_0x601730];return _0x280c7c;};'use strict';var multer=require(_0x26f0('0x0'));var util=require(_0x26f0('0x1'));var path=require(_0x26f0('0x2'));var timeout=require(_0x26f0('0x3'));var express=require(_0x26f0('0x4'));var router=express[_0x26f0('0x5')]();var fs_extra=require(_0x26f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x26f0('0x7'));var config=require(_0x26f0('0x8'));var controller=require(_0x26f0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x26f0('0xa')]);router[_0x26f0('0xb')](_0x26f0('0xc'),auth['isAuthenticated'](),controller[_0x26f0('0xd')]);router[_0x26f0('0xb')](_0x26f0('0xe'),auth[_0x26f0('0xf')](),controller[_0x26f0('0x10')]);router[_0x26f0('0x11')]('/',auth[_0x26f0('0xf')](),controller['create']);router[_0x26f0('0x12')](_0x26f0('0xe'),auth['isAuthenticated'](),controller[_0x26f0('0x13')]);router['delete'](_0x26f0('0xe'),auth[_0x26f0('0xf')](),controller[_0x26f0('0x14')]);module['exports']=router; \ No newline at end of file +var _0x27ce=['/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x27ce,0x7a));var _0xe27c=function(_0x47e476,_0x3c0833){_0x47e476=_0x47e476-0x0;var _0x92b74=_0x27ce[_0x47e476];return _0x92b74;};'use strict';var multer=require(_0xe27c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe27c('0x1'));var express=require(_0xe27c('0x2'));var router=express['Router']();var fs_extra=require(_0xe27c('0x3'));var auth=require(_0xe27c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe27c('0x5'));var controller=require('./squareReportDetail.controller');router[_0xe27c('0x6')]('/',auth[_0xe27c('0x7')](),controller[_0xe27c('0x8')]);router[_0xe27c('0x6')](_0xe27c('0x9'),auth[_0xe27c('0x7')](),controller[_0xe27c('0xa')]);router['get'](_0xe27c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe27c('0xc')]('/',auth['isAuthenticated'](),controller[_0xe27c('0xd')]);router[_0xe27c('0xe')](_0xe27c('0xb'),auth[_0xe27c('0x7')](),controller[_0xe27c('0xf')]);router[_0xe27c('0x10')](_0xe27c('0xb'),auth[_0xe27c('0x7')](),controller[_0xe27c('0x11')]);module[_0xe27c('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 9351810..10e4abd 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 _0x3142=['exports','STRING','TEXT','sequelize'];(function(_0x5cef41,_0x15681b){var _0x5f40bd=function(_0x261e30){while(--_0x261e30){_0x5cef41['push'](_0x5cef41['shift']());}};_0x5f40bd(++_0x15681b);}(_0x3142,0x1e3));var _0x2314=function(_0x3330c7,_0x36fdb9){_0x3330c7=_0x3330c7-0x0;var _0x5662e3=_0x3142[_0x3330c7];return _0x5662e3;};'use strict';var Sequelize=require(_0x2314('0x0'));module[_0x2314('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x2314('0x2')]},'application':{'type':Sequelize[_0x2314('0x2')]},'data':{'type':Sequelize[_0x2314('0x3')]},'project_name':{'type':Sequelize[_0x2314('0x2')]},'callerid':{'type':Sequelize[_0x2314('0x2')]}}; \ No newline at end of file +var _0x28af=['exports','STRING','TEXT','sequelize'];(function(_0x151c38,_0x3d5723){var _0x18a987=function(_0x32eb6a){while(--_0x32eb6a){_0x151c38['push'](_0x151c38['shift']());}};_0x18a987(++_0x3d5723);}(_0x28af,0xbf));var _0xf28a=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0x28af[_0x330414];return _0x99dbff;};'use strict';var Sequelize=require(_0xf28a('0x0'));module[_0xf28a('0x1')]={'uniqueid':{'type':Sequelize[_0xf28a('0x2')]},'node':{'type':Sequelize[_0xf28a('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xf28a('0x3')]},'project_name':{'type':Sequelize[_0xf28a('0x2')]},'callerid':{'type':Sequelize[_0xf28a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index aab60aa..77d5c2b 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 _0xb0e4=['intersection','model','fields','length','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','send','index','map','SquareDetailsReport','fieldName','key','name','keys','query','filters','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb0e4,0x67));var _0x4b0e=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xb0e4[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x4b0e('0x0'));var rimraf=require(_0x4b0e('0x1'));var zipdir=require(_0x4b0e('0x2'));var jsonpatch=require(_0x4b0e('0x3'));var rp=require('request-promise');var moment=require(_0x4b0e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4b0e('0x5'));var sox=require('sox');var csv=require(_0x4b0e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b0e('0x7'));var _=require(_0x4b0e('0x8'));var squel=require(_0x4b0e('0x9'));var crypto=require(_0x4b0e('0xa'));var jsforce=require(_0x4b0e('0xb'));var deskjs=require(_0x4b0e('0xc'));var toCsv=require(_0x4b0e('0x6'));var querystring=require(_0x4b0e('0xd'));var Papa=require(_0x4b0e('0xe'));var Redis=require(_0x4b0e('0xf'));var authService=require(_0x4b0e('0x10'));var qs=require(_0x4b0e('0x11'));var as=require(_0x4b0e('0x12'));var hardwareService=require(_0x4b0e('0x13'));var logger=require(_0x4b0e('0x14'))(_0x4b0e('0x15'));var utils=require(_0x4b0e('0x16'));var config=require(_0x4b0e('0x17'));var licenseUtil=require(_0x4b0e('0x18'));var db=require(_0x4b0e('0x19'))['db'];function respondWithStatusCode(_0x5a306b,_0x18702e){_0x18702e=_0x18702e||0xcc;return function(_0x5a4a31){if(_0x5a4a31){return _0x5a306b[_0x4b0e('0x1a')](_0x18702e);}return _0x5a306b[_0x4b0e('0x1b')](_0x18702e)[_0x4b0e('0x1c')]();};}function respondWithResult(_0x2b4fec,_0x23b697){_0x23b697=_0x23b697||0xc8;return function(_0x44040b){if(_0x44040b){return _0x2b4fec[_0x4b0e('0x1b')](_0x23b697)['json'](_0x44040b);}};}function respondWithFilteredResult(_0x19f1a1,_0x242060){return function(_0x93f233){if(_0x93f233){var _0x5359c6=typeof _0x242060[_0x4b0e('0x1d')]===_0x4b0e('0x1e')&&typeof _0x242060[_0x4b0e('0x1f')]===_0x4b0e('0x1e');var _0x577a21=_0x93f233['count'];var _0x166edd=_0x5359c6?0x0:_0x242060[_0x4b0e('0x1d')];var _0x342bdd=_0x5359c6?_0x93f233['count']:_0x242060['offset']+_0x242060[_0x4b0e('0x1f')];var _0x312ba6;if(_0x342bdd>=_0x577a21){_0x342bdd=_0x577a21;_0x312ba6=0xc8;}else{_0x312ba6=0xce;}_0x19f1a1['status'](_0x312ba6);return _0x19f1a1[_0x4b0e('0x20')](_0x4b0e('0x21'),_0x166edd+'-'+_0x342bdd+'/'+_0x577a21)[_0x4b0e('0x22')](_0x93f233);}return null;};}function patchUpdates(_0x7c8b11){return function(_0x227075){try{jsonpatch[_0x4b0e('0x23')](_0x227075,_0x7c8b11,!![]);}catch(_0x163d29){return BPromise[_0x4b0e('0x24')](_0x163d29);}return _0x227075[_0x4b0e('0x25')]();};}function saveUpdates(_0x4daa9e,_0x294482){return function(_0x1cb238){if(_0x1cb238){return _0x1cb238[_0x4b0e('0x26')](_0x4daa9e)[_0x4b0e('0x27')](function(_0x588ea4){return _0x588ea4;});}return null;};}function removeEntity(_0x3275d3,_0x240a48){return function(_0x21560a){if(_0x21560a){return _0x21560a[_0x4b0e('0x28')]()[_0x4b0e('0x27')](function(){_0x3275d3['status'](0xcc)[_0x4b0e('0x1c')]();});}};}function handleEntityNotFound(_0x4de021,_0x38af17){return function(_0x14677e){if(!_0x14677e){_0x4de021['sendStatus'](0x194);}return _0x14677e;};}function handleError(_0x3b56cb,_0x1ea91d){_0x1ea91d=_0x1ea91d||0x1f4;return function(_0x542c6c){logger['error'](_0x542c6c[_0x4b0e('0x29')]);if(_0x542c6c['name']){delete _0x542c6c['name'];}_0x3b56cb[_0x4b0e('0x1b')](_0x1ea91d)[_0x4b0e('0x2a')](_0x542c6c);};}exports[_0x4b0e('0x2b')]=function(_0x54ac75,_0x43e1e9){var _0x3b3630={},_0x2e0bf5={},_0x47c558={'count':0x0,'rows':[]};var _0x391c0a=_[_0x4b0e('0x2c')](db[_0x4b0e('0x2d')]['rawAttributes'],function(_0x1b35e1){return{'name':_0x1b35e1[_0x4b0e('0x2e')],'type':_0x1b35e1['type'][_0x4b0e('0x2f')]};});_0x2e0bf5['model']=_['map'](_0x391c0a,_0x4b0e('0x30'));_0x2e0bf5['query']=_[_0x4b0e('0x31')](_0x54ac75[_0x4b0e('0x32')]);_0x2e0bf5[_0x4b0e('0x33')]=_['intersection'](_0x2e0bf5['model'],_0x2e0bf5['query']);_0x3b3630[_0x4b0e('0x34')]=_[_0x4b0e('0x35')](_0x2e0bf5[_0x4b0e('0x36')],qs[_0x4b0e('0x37')](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x37')]));_0x3b3630[_0x4b0e('0x34')]=_0x3b3630['attributes'][_0x4b0e('0x38')]?_0x3b3630['attributes']:_0x2e0bf5['model'];if(!_0x54ac75['query']['hasOwnProperty'](_0x4b0e('0x39'))){_0x3b3630['limit']=qs['limit'](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x1f')]);_0x3b3630['offset']=qs[_0x4b0e('0x1d')](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x1d')]);}_0x3b3630['order']=qs[_0x4b0e('0x3a')](_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x3a')]);_0x3b3630['where']=qs[_0x4b0e('0x33')](_[_0x4b0e('0x3b')](_0x54ac75[_0x4b0e('0x32')],_0x2e0bf5[_0x4b0e('0x33')]),_0x391c0a);if(_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x3c')]){_0x3b3630['where']=_[_0x4b0e('0x3d')](_0x3b3630[_0x4b0e('0x3e')],{'$or':_[_0x4b0e('0x2c')](_0x391c0a,function(_0x452254){if(_0x452254[_0x4b0e('0x3f')]!==_0x4b0e('0x40')){var _0x13df84={};_0x13df84[_0x452254[_0x4b0e('0x30')]]={'$like':'%'+_0x54ac75['query'][_0x4b0e('0x3c')]+'%'};return _0x13df84;}})});}_0x3b3630=_[_0x4b0e('0x3d')]({},_0x3b3630,_0x54ac75[_0x4b0e('0x41')]);var _0x52e66e={'where':_0x3b3630[_0x4b0e('0x3e')]};return db['SquareDetailsReport'][_0x4b0e('0x42')](_0x52e66e)[_0x4b0e('0x27')](function(_0x444e1b){_0x47c558[_0x4b0e('0x42')]=_0x444e1b;if(_0x54ac75[_0x4b0e('0x32')][_0x4b0e('0x43')]){_0x3b3630[_0x4b0e('0x44')]=[{'all':!![]}];}return db[_0x4b0e('0x2d')][_0x4b0e('0x45')](_0x3b3630);})[_0x4b0e('0x27')](function(_0x27d626){_0x47c558[_0x4b0e('0x46')]=_0x27d626;return _0x47c558;})['then'](respondWithFilteredResult(_0x43e1e9,_0x3b3630))[_0x4b0e('0x47')](handleError(_0x43e1e9,null));};exports['show']=function(_0x3ba17d,_0x39feb9){var _0x159777={'raw':!![],'where':{'id':_0x3ba17d[_0x4b0e('0x48')]['id']}},_0x1db9f8={};_0x1db9f8[_0x4b0e('0x36')]=_[_0x4b0e('0x31')](db[_0x4b0e('0x2d')][_0x4b0e('0x49')]);_0x1db9f8['query']=_['keys'](_0x3ba17d[_0x4b0e('0x32')]);_0x1db9f8[_0x4b0e('0x33')]=_[_0x4b0e('0x35')](_0x1db9f8['model'],_0x1db9f8[_0x4b0e('0x32')]);_0x159777['attributes']=_[_0x4b0e('0x35')](_0x1db9f8[_0x4b0e('0x36')],qs[_0x4b0e('0x37')](_0x3ba17d[_0x4b0e('0x32')][_0x4b0e('0x37')]));_0x159777[_0x4b0e('0x34')]=_0x159777[_0x4b0e('0x34')][_0x4b0e('0x38')]?_0x159777[_0x4b0e('0x34')]:_0x1db9f8['model'];if(_0x3ba17d[_0x4b0e('0x32')][_0x4b0e('0x43')]){_0x159777[_0x4b0e('0x44')]=[{'all':!![]}];}_0x159777=_[_0x4b0e('0x3d')]({},_0x159777,_0x3ba17d['options']);return db['SquareDetailsReport']['find'](_0x159777)['then'](handleEntityNotFound(_0x39feb9,null))['then'](respondWithResult(_0x39feb9,null))[_0x4b0e('0x47')](handleError(_0x39feb9,null));};exports[_0x4b0e('0x4a')]=function(_0x2da7be,_0x5bae66){return db[_0x4b0e('0x2d')]['create'](_0x2da7be[_0x4b0e('0x4b')],{})[_0x4b0e('0x27')](respondWithResult(_0x5bae66,0xc9))[_0x4b0e('0x47')](handleError(_0x5bae66,null));};exports['update']=function(_0x4730a5,_0x31c104){if(_0x4730a5[_0x4b0e('0x4b')]['id']){delete _0x4730a5['body']['id'];}return db[_0x4b0e('0x2d')][_0x4b0e('0x4c')]({'where':{'id':_0x4730a5[_0x4b0e('0x48')]['id']}})[_0x4b0e('0x27')](handleEntityNotFound(_0x31c104,null))['then'](saveUpdates(_0x4730a5[_0x4b0e('0x4b')],null))[_0x4b0e('0x27')](respondWithResult(_0x31c104,null))[_0x4b0e('0x47')](handleError(_0x31c104,null));};exports[_0x4b0e('0x28')]=function(_0x2eae1f,_0x46b55f){return db[_0x4b0e('0x2d')][_0x4b0e('0x4c')]({'where':{'id':_0x2eae1f[_0x4b0e('0x48')]['id']}})[_0x4b0e('0x27')](handleEntityNotFound(_0x46b55f,null))[_0x4b0e('0x27')](removeEntity(_0x46b55f,null))[_0x4b0e('0x47')](handleError(_0x46b55f,null));};exports[_0x4b0e('0x4d')]=function(_0x5cc78d,_0x317028){return db[_0x4b0e('0x2d')][_0x4b0e('0x4d')]()[_0x4b0e('0x27')](respondWithResult(_0x317028,null))['catch'](handleError(_0x317028,null));}; \ No newline at end of file +var _0x1e48=['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','limit','undefined','count','Content-Range','reject','save','update','then','destroy','stack','name','index','map','SquareDetailsReport','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','where','merge','filter','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','desk.js'];(function(_0x4a90b0,_0x165611){var _0xa65af0=function(_0x32df4d){while(--_0x32df4d){_0x4a90b0['push'](_0x4a90b0['shift']());}};_0xa65af0(++_0x165611);}(_0x1e48,0x81));var _0x81e4=function(_0x4dc8fc,_0x27d9a5){_0x4dc8fc=_0x4dc8fc-0x0;var _0x18d77f=_0x1e48[_0x4dc8fc];return _0x18d77f;};'use strict';var emlformat=require(_0x81e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81e4('0x1'));var jsonpatch=require(_0x81e4('0x2'));var rp=require(_0x81e4('0x3'));var moment=require(_0x81e4('0x4'));var BPromise=require(_0x81e4('0x5'));var Mustache=require('mustache');var util=require(_0x81e4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x81e4('0x7'));var ejs=require(_0x81e4('0x8'));var fs=require('fs');var fs_extra=require(_0x81e4('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x81e4('0xa'));var toCsv=require('to-csv');var querystring=require(_0x81e4('0xb'));var Papa=require(_0x81e4('0xc'));var Redis=require(_0x81e4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x81e4('0xe'));var as=require(_0x81e4('0xf'));var hardwareService=require(_0x81e4('0x10'));var logger=require(_0x81e4('0x11'))(_0x81e4('0x12'));var utils=require(_0x81e4('0x13'));var config=require(_0x81e4('0x14'));var licenseUtil=require(_0x81e4('0x15'));var db=require(_0x81e4('0x16'))['db'];function respondWithStatusCode(_0x52e12c,_0x2cca2d){_0x2cca2d=_0x2cca2d||0xcc;return function(_0x45dc81){if(_0x45dc81){return _0x52e12c[_0x81e4('0x17')](_0x2cca2d);}return _0x52e12c[_0x81e4('0x18')](_0x2cca2d)[_0x81e4('0x19')]();};}function respondWithResult(_0x4d5da6,_0x1fb5fc){_0x1fb5fc=_0x1fb5fc||0xc8;return function(_0x50e6c5){if(_0x50e6c5){return _0x4d5da6[_0x81e4('0x18')](_0x1fb5fc)[_0x81e4('0x1a')](_0x50e6c5);}};}function respondWithFilteredResult(_0x53e02b,_0xe3558e){return function(_0x5e78d9){if(_0x5e78d9){var _0x347362=typeof _0xe3558e[_0x81e4('0x1b')]==='undefined'&&typeof _0xe3558e[_0x81e4('0x1c')]===_0x81e4('0x1d');var _0x4576cc=_0x5e78d9[_0x81e4('0x1e')];var _0x410958=_0x347362?0x0:_0xe3558e[_0x81e4('0x1b')];var _0x3292d7=_0x347362?_0x5e78d9[_0x81e4('0x1e')]:_0xe3558e[_0x81e4('0x1b')]+_0xe3558e[_0x81e4('0x1c')];var _0x300196;if(_0x3292d7>=_0x4576cc){_0x3292d7=_0x4576cc;_0x300196=0xc8;}else{_0x300196=0xce;}_0x53e02b['status'](_0x300196);return _0x53e02b['set'](_0x81e4('0x1f'),_0x410958+'-'+_0x3292d7+'/'+_0x4576cc)[_0x81e4('0x1a')](_0x5e78d9);}return null;};}function patchUpdates(_0x8ecb39){return function(_0x498ff4){try{jsonpatch['apply'](_0x498ff4,_0x8ecb39,!![]);}catch(_0x582180){return BPromise[_0x81e4('0x20')](_0x582180);}return _0x498ff4[_0x81e4('0x21')]();};}function saveUpdates(_0x2a5d17,_0x4367f3){return function(_0x297cb0){if(_0x297cb0){return _0x297cb0[_0x81e4('0x22')](_0x2a5d17)[_0x81e4('0x23')](function(_0x4c14d9){return _0x4c14d9;});}return null;};}function removeEntity(_0x344786,_0x4e6cce){return function(_0x41bb96){if(_0x41bb96){return _0x41bb96[_0x81e4('0x24')]()['then'](function(){_0x344786['status'](0xcc)[_0x81e4('0x19')]();});}};}function handleEntityNotFound(_0x2962dd,_0x8a9496){return function(_0x3c8615){if(!_0x3c8615){_0x2962dd[_0x81e4('0x17')](0x194);}return _0x3c8615;};}function handleError(_0x10907d,_0x1300d9){_0x1300d9=_0x1300d9||0x1f4;return function(_0x2654f3){logger['error'](_0x2654f3[_0x81e4('0x25')]);if(_0x2654f3[_0x81e4('0x26')]){delete _0x2654f3['name'];}_0x10907d[_0x81e4('0x18')](_0x1300d9)['send'](_0x2654f3);};}exports[_0x81e4('0x27')]=function(_0x44c07c,_0x5e4e68){var _0x5518db={},_0x52ff64={},_0x2f1757={'count':0x0,'rows':[]};var _0x30d154=_[_0x81e4('0x28')](db[_0x81e4('0x29')][_0x81e4('0x2a')],function(_0x33f7ca){return{'name':_0x33f7ca['fieldName'],'type':_0x33f7ca[_0x81e4('0x2b')][_0x81e4('0x2c')]};});_0x52ff64['model']=_[_0x81e4('0x28')](_0x30d154,_0x81e4('0x26'));_0x52ff64[_0x81e4('0x2d')]=_[_0x81e4('0x2e')](_0x44c07c[_0x81e4('0x2d')]);_0x52ff64['filters']=_[_0x81e4('0x2f')](_0x52ff64['model'],_0x52ff64[_0x81e4('0x2d')]);_0x5518db['attributes']=_[_0x81e4('0x2f')](_0x52ff64[_0x81e4('0x30')],qs[_0x81e4('0x31')](_0x44c07c[_0x81e4('0x2d')]['fields']));_0x5518db[_0x81e4('0x32')]=_0x5518db[_0x81e4('0x32')][_0x81e4('0x33')]?_0x5518db[_0x81e4('0x32')]:_0x52ff64['model'];if(!_0x44c07c['query']['hasOwnProperty'](_0x81e4('0x34'))){_0x5518db['limit']=qs[_0x81e4('0x1c')](_0x44c07c[_0x81e4('0x2d')][_0x81e4('0x1c')]);_0x5518db['offset']=qs['offset'](_0x44c07c[_0x81e4('0x2d')][_0x81e4('0x1b')]);}_0x5518db[_0x81e4('0x35')]=qs[_0x81e4('0x36')](_0x44c07c[_0x81e4('0x2d')][_0x81e4('0x36')]);_0x5518db['where']=qs[_0x81e4('0x37')](_['pick'](_0x44c07c[_0x81e4('0x2d')],_0x52ff64[_0x81e4('0x37')]),_0x30d154);if(_0x44c07c[_0x81e4('0x2d')]['filter']){_0x5518db[_0x81e4('0x38')]=_[_0x81e4('0x39')](_0x5518db[_0x81e4('0x38')],{'$or':_[_0x81e4('0x28')](_0x30d154,function(_0x15f60c){if(_0x15f60c[_0x81e4('0x2b')]!=='VIRTUAL'){var _0x34ea9d={};_0x34ea9d[_0x15f60c[_0x81e4('0x26')]]={'$like':'%'+_0x44c07c['query'][_0x81e4('0x3a')]+'%'};return _0x34ea9d;}})});}_0x5518db=_[_0x81e4('0x39')]({},_0x5518db,_0x44c07c['options']);var _0x2edf11={'where':_0x5518db['where']};return db[_0x81e4('0x29')][_0x81e4('0x1e')](_0x2edf11)[_0x81e4('0x23')](function(_0x550ab4){_0x2f1757['count']=_0x550ab4;if(_0x44c07c[_0x81e4('0x2d')][_0x81e4('0x3b')]){_0x5518db[_0x81e4('0x3c')]=[{'all':!![]}];}return db[_0x81e4('0x29')][_0x81e4('0x3d')](_0x5518db);})[_0x81e4('0x23')](function(_0x1b9e1b){_0x2f1757['rows']=_0x1b9e1b;return _0x2f1757;})['then'](respondWithFilteredResult(_0x5e4e68,_0x5518db))[_0x81e4('0x3e')](handleError(_0x5e4e68,null));};exports[_0x81e4('0x3f')]=function(_0x522b33,_0x4a3bfd){var _0x54598e={'raw':!![],'where':{'id':_0x522b33[_0x81e4('0x40')]['id']}},_0x96e62b={};_0x96e62b[_0x81e4('0x30')]=_[_0x81e4('0x2e')](db['SquareDetailsReport']['rawAttributes']);_0x96e62b[_0x81e4('0x2d')]=_[_0x81e4('0x2e')](_0x522b33[_0x81e4('0x2d')]);_0x96e62b['filters']=_[_0x81e4('0x2f')](_0x96e62b[_0x81e4('0x30')],_0x96e62b[_0x81e4('0x2d')]);_0x54598e[_0x81e4('0x32')]=_['intersection'](_0x96e62b[_0x81e4('0x30')],qs['fields'](_0x522b33['query'][_0x81e4('0x31')]));_0x54598e['attributes']=_0x54598e[_0x81e4('0x32')][_0x81e4('0x33')]?_0x54598e[_0x81e4('0x32')]:_0x96e62b[_0x81e4('0x30')];if(_0x522b33['query'][_0x81e4('0x3b')]){_0x54598e[_0x81e4('0x3c')]=[{'all':!![]}];}_0x54598e=_[_0x81e4('0x39')]({},_0x54598e,_0x522b33[_0x81e4('0x41')]);return db[_0x81e4('0x29')]['find'](_0x54598e)[_0x81e4('0x23')](handleEntityNotFound(_0x4a3bfd,null))[_0x81e4('0x23')](respondWithResult(_0x4a3bfd,null))['catch'](handleError(_0x4a3bfd,null));};exports[_0x81e4('0x42')]=function(_0x588e04,_0x5b539f){return db['SquareDetailsReport'][_0x81e4('0x42')](_0x588e04['body'],{})[_0x81e4('0x23')](respondWithResult(_0x5b539f,0xc9))[_0x81e4('0x3e')](handleError(_0x5b539f,null));};exports['update']=function(_0x2ea4e2,_0x46a69e){if(_0x2ea4e2[_0x81e4('0x43')]['id']){delete _0x2ea4e2[_0x81e4('0x43')]['id'];}return db['SquareDetailsReport'][_0x81e4('0x44')]({'where':{'id':_0x2ea4e2[_0x81e4('0x40')]['id']}})['then'](handleEntityNotFound(_0x46a69e,null))[_0x81e4('0x23')](saveUpdates(_0x2ea4e2[_0x81e4('0x43')],null))[_0x81e4('0x23')](respondWithResult(_0x46a69e,null))['catch'](handleError(_0x46a69e,null));};exports[_0x81e4('0x24')]=function(_0x708296,_0x3452d6){return db['SquareDetailsReport'][_0x81e4('0x44')]({'where':{'id':_0x708296[_0x81e4('0x40')]['id']}})[_0x81e4('0x23')](handleEntityNotFound(_0x3452d6,null))['then'](removeEntity(_0x3452d6,null))[_0x81e4('0x3e')](handleError(_0x3452d6,null));};exports['describe']=function(_0x109f89,_0x3de84b){return db[_0x81e4('0x29')][_0x81e4('0x45')]()[_0x81e4('0x23')](respondWithResult(_0x3de84b,null))['catch'](handleError(_0x3de84b,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 0b1b3ca..c62b246 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 _0xfdf8=['rimraf','../../config/environment','exports','define','SquareDetailsReport','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0xc76ae7,_0x1428aa){var _0x128025=function(_0x4e2443){while(--_0x4e2443){_0xc76ae7['push'](_0xc76ae7['shift']());}};_0x128025(++_0x1428aa);}(_0xfdf8,0x123));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8fdf('0x0'));var util=require(_0x8fdf('0x1'));var logger=require(_0x8fdf('0x2'))('api');var moment=require(_0x8fdf('0x3'));var BPromise=require(_0x8fdf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fdf('0x5'));var rimraf=require(_0x8fdf('0x6'));var config=require(_0x8fdf('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x8fdf('0x8')]=function(_0x3f134e,_0x3fedf6){return _0x3f134e[_0x8fdf('0x9')](_0x8fdf('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c4a=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','moment','request-promise'];(function(_0x19fab3,_0xb34da7){var _0x3b7971=function(_0x5d3334){while(--_0x5d3334){_0x19fab3['push'](_0x19fab3['shift']());}};_0x3b7971(++_0xb34da7);}(_0x9c4a,0x164));var _0xa9c4=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x9c4a[_0x100e36];return _0x1df0c9;};'use strict';var _=require(_0xa9c4('0x0'));var util=require(_0xa9c4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa9c4('0x2'));var BPromise=require('bluebird');var rp=require(_0xa9c4('0x3'));var fs=require('fs');var path=require(_0xa9c4('0x4'));var rimraf=require(_0xa9c4('0x5'));var config=require(_0xa9c4('0x6'));var attributes=require(_0xa9c4('0x7'));module[_0xa9c4('0x8')]=function(_0x3f8303,_0x4efa77){return _0x3f8303[_0xa9c4('0x9')](_0xa9c4('0xa'),attributes,{'tableName':_0xa9c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 59ef6fe..0b9aac4 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 _0x594d=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','create','options','raw','CreateSquareDetailsReport','stringify','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x788ccb,_0x1e422f){var _0x1c9d99=function(_0x2d3ca7){while(--_0x2d3ca7){_0x788ccb['push'](_0x788ccb['shift']());}};_0x1c9d99(++_0x1e422f);}(_0x594d,0x92));var _0xd594=function(_0x18ccd4,_0x8bf39a){_0x18ccd4=_0x18ccd4-0x0;var _0x56d0fb=_0x594d[_0x18ccd4];return _0x56d0fb;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});}exports['CreateSquareDetailsReport']=function(_0x232776){var _0x4ea0d5=this;return new Promise(function(_0x54f640,_0x3ae9be){return db['SquareDetailsReport'][_0xd594('0x14')](_0x232776['body'],{'raw':_0x232776[_0xd594('0x15')]?_0x232776['options'][_0xd594('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3b0fda){logger[_0xd594('0xb')](_0xd594('0x17'),_0x232776);logger[_0xd594('0xd')](_0xd594('0x17'),_0x232776,JSON[_0xd594('0x18')](_0x3b0fda));_0x54f640(_0x3b0fda);})[_0xd594('0x19')](function(_0x2b8495){logger[_0xd594('0x10')](_0xd594('0x17'),_0x2b8495[_0xd594('0x12')],_0x232776);_0x3ae9be(_0x4ea0d5[_0xd594('0x10')](0x1f4,_0x2b8495[_0xd594('0x12')]));});});}; \ No newline at end of file +var _0xcae2=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','then','stringify','lodash'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rs=require(_0x2cae('0x4'));var fs=require('fs');var Redis=require(_0x2cae('0x5'));var db=require(_0x2cae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cae('0x7'))(_0x2cae('0x8'));var config=require(_0x2cae('0x9'));var jayson=require(_0x2cae('0xa'));var client=jayson['client'][_0x2cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feff6,_0x1e1a3d,_0x25b6a2){return new BPromise(function(_0x2e7498,_0x49e1d1){return client['request'](_0x1feff6,_0x25b6a2)['then'](function(_0x49f0d3){logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));logger[_0x2cae('0xf')](_0x2cae('0x10'),_0x1e1a3d,_0x2cae('0xe'),JSON['stringify'](_0x49f0d3));if(_0x49f0d3[_0x2cae('0x11')]){if(_0x49f0d3['error'][_0x2cae('0x12')]===0x1f4){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x49e1d1(_0x49f0d3[_0x2cae('0x11')]['message']);}logger[_0x2cae('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x2e7498(_0x49f0d3['error'][_0x2cae('0x13')]);}else{logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));_0x2e7498(_0x49f0d3['result'][_0x2cae('0x13')]);}})[_0x2cae('0x14')](function(_0x4a89e1){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x4a89e1);_0x49e1d1(_0x4a89e1);});});}exports[_0x2cae('0x15')]=function(_0xe6314f){var _0x2813b1=this;return new Promise(function(_0x164aee,_0x398290){return db[_0x2cae('0x16')]['create'](_0xe6314f['body'],{'raw':_0xe6314f[_0x2cae('0x17')]?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![]})[_0x2cae('0x19')](function(_0x2f4f5c){logger[_0x2cae('0xc')](_0x2cae('0x15'),_0xe6314f);logger['debug']('CreateSquareDetailsReport',_0xe6314f,JSON[_0x2cae('0x1a')](_0x2f4f5c));_0x164aee(_0x2f4f5c);})[_0x2cae('0x14')](function(_0x5d800e){logger['error']('CreateSquareDetailsReport',_0x5d800e[_0x2cae('0x13')],_0xe6314f);_0x398290(_0x2813b1[_0x2cae('0x11')](0x1f4,_0x5d800e['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index ea5fdb0..3ae257d 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 _0xc6f1=['killProcess','express','Router','get','/process/:pid/kill','isAuthenticated'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc6f1,0x133));var _0x1c6f=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xc6f1[_0x3cb152];return _0x4f54c3;};'use strict';var express=require(_0x1c6f('0x0'));var router=express[_0x1c6f('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x1c6f('0x2')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1c6f('0x3'),auth[_0x1c6f('0x4')](),controller[_0x1c6f('0x5')]);module['exports']=router; \ No newline at end of file +var _0x80a5=['express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x48f81a,_0xd654da){var _0x26da57=function(_0xd95d69){while(--_0xd95d69){_0x48f81a['push'](_0x48f81a['shift']());}};_0x26da57(++_0xd654da);}(_0x80a5,0xea));var _0x580a=function(_0x396404,_0x2768f2){_0x396404=_0x396404-0x0;var _0x4730d8=_0x80a5[_0x396404];return _0x4730d8;};'use strict';var express=require(_0x580a('0x0'));var router=express[_0x580a('0x1')]();var auth=require(_0x580a('0x2'));var controller=require(_0x580a('0x3'));router[_0x580a('0x4')]('/',auth['isAuthenticated'](),controller[_0x580a('0x5')]);router[_0x580a('0x4')](_0x580a('0x6'),auth[_0x580a('0x7')](),controller[_0x580a('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index dacd4db..4094ee9 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 _0xfab5=['split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json','killProcess','format','params','pid'];(function(_0xa32db1,_0x9fcec5){var _0x34f30b=function(_0x16866b){while(--_0x16866b){_0xa32db1['push'](_0xa32db1['shift']());}};_0x34f30b(++_0x9fcec5);}(_0xfab5,0xe9));var _0x5fab=function(_0x3d7a9e,_0x1686d7){_0x3d7a9e=_0x3d7a9e-0x0;var _0x28c9b8=_0xfab5[_0x3d7a9e];return _0x28c9b8;};'use strict';var info=require(_0x5fab('0x0'));var exec=require(_0x5fab('0x1'))['exec'];var logger=require(_0x5fab('0x2'))('api');var util=require(_0x5fab('0x3'));var BPromise=require(_0x5fab('0x4'));var _=require(_0x5fab('0x5'));function handleError(_0x51cf28,_0x26d5ef,_0x2088c7){_0x26d5ef=_0x26d5ef||0x1f4;return function(_0x310fc4){logger['error'](_0x5fab('0x6'),_0x2088c7,_0x26d5ef,util[_0x5fab('0x7')](_0x310fc4,{'showHidden':![],'depth':null}));delete _0x310fc4[_0x5fab('0x8')];_0x51cf28[_0x5fab('0x9')](_0x26d5ef)['send'](_0x310fc4);};}exports[_0x5fab('0xa')]=function(_0x33caff,_0x45b158){return info['getAllData']()[_0x5fab('0xb')](function(_0x29396a){return _0x45b158['status'](0xc8)[_0x5fab('0xc')](_0x29396a);})['catch'](function(_0x23640a){return _0x45b158[_0x5fab('0x9')](0x1f4)[_0x5fab('0xc')](_0x23640a);});};exports[_0x5fab('0xd')]=function(_0x3bbd51,_0x3b8e2b){var _0x132dfe=['components/import/cm'];return new BPromise(function(_0x2b1665,_0x9bf43){return exec(util[_0x5fab('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3bbd51[_0x5fab('0xf')][_0x5fab('0x10')]),function(_0x108da9,_0x59fcfa,_0x4e63b7){if(_0x108da9){return _0x9bf43(_0x108da9);}return _0x2b1665(_0x59fcfa);});})['then'](function(_0x1766a4){var _0x1be0a4=![];var _0x15eabb=_0x1766a4[_0x5fab('0x11')](/\n/);for(var _0x3dd093=0x0,_0x5c0505=_0x132dfe[_0x5fab('0x12')];_0x3dd093<_0x5c0505,_0x1be0a4===![];_0x3dd093+=0x1){if(_0x1766a4[_0x5fab('0x13')](_0x132dfe[_0x3dd093])>=0x0){_0x1be0a4=!![];}}if(!_0x1be0a4){throw new Error(util[_0x5fab('0xe')](_0x5fab('0x14'),_0x3bbd51['params'][_0x5fab('0x10')]));}process[_0x5fab('0x15')](_0x3bbd51[_0x5fab('0xf')][_0x5fab('0x10')],_0x5fab('0x16'));return _0x3b8e2b[_0x5fab('0x9')](0xc8)[_0x5fab('0xc')]({'message':util[_0x5fab('0xe')](_0x5fab('0x17'),_0x3bbd51['params'][_0x5fab('0x10')])});})[_0x5fab('0x18')](handleError(_0x3b8e2b,null,'killProcess'));}; \ No newline at end of file +var _0x811b=['params','pid','length','indexOf','kill','SIGINT','systeminformation','child_process','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x811b,0xb5));var _0xb811=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0x811b[_0x4b8156];return _0x4a819c;};'use strict';var info=require(_0xb811('0x0'));var exec=require(_0xb811('0x1'))['exec'];var logger=require(_0xb811('0x2'))(_0xb811('0x3'));var util=require(_0xb811('0x4'));var BPromise=require(_0xb811('0x5'));var _=require('lodash');function handleError(_0x193bd5,_0x284410,_0x1ab6c8){_0x284410=_0x284410||0x1f4;return function(_0x41d783){logger[_0xb811('0x6')](_0xb811('0x7'),_0x1ab6c8,_0x284410,util[_0xb811('0x8')](_0x41d783,{'showHidden':![],'depth':null}));delete _0x41d783[_0xb811('0x9')];_0x193bd5[_0xb811('0xa')](_0x284410)[_0xb811('0xb')](_0x41d783);};}exports[_0xb811('0xc')]=function(_0x3ad92c,_0x41175d){return info[_0xb811('0xd')]()[_0xb811('0xe')](function(_0x26a686){return _0x41175d[_0xb811('0xa')](0xc8)[_0xb811('0xf')](_0x26a686);})['catch'](function(_0x368bf7){return _0x41175d[_0xb811('0xa')](0x1f4)[_0xb811('0xf')](_0x368bf7);});};exports[_0xb811('0x10')]=function(_0xc5d66d,_0x10b00b){var _0x59d808=['components/import/cm'];return new BPromise(function(_0x232a54,_0x2b4b84){return exec(util[_0xb811('0x11')](_0xb811('0x12'),_0xc5d66d[_0xb811('0x13')][_0xb811('0x14')]),function(_0x11dc3c,_0x5dd6c5,_0x1fadaf){if(_0x11dc3c){return _0x2b4b84(_0x11dc3c);}return _0x232a54(_0x5dd6c5);});})['then'](function(_0x2f1d9f){var _0x2b9006=![];var _0x67ed42=_0x2f1d9f['split'](/\n/);for(var _0x5ac3c6=0x0,_0x2b87f8=_0x59d808[_0xb811('0x15')];_0x5ac3c6<_0x2b87f8,_0x2b9006===![];_0x5ac3c6+=0x1){if(_0x2f1d9f[_0xb811('0x16')](_0x59d808[_0x5ac3c6])>=0x0){_0x2b9006=!![];}}if(!_0x2b9006){throw new Error(util[_0xb811('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xc5d66d[_0xb811('0x13')]['pid']));}process[_0xb811('0x17')](_0xc5d66d[_0xb811('0x13')][_0xb811('0x14')],_0xb811('0x18'));return _0x10b00b['status'](0xc8)[_0xb811('0xf')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xc5d66d[_0xb811('0x13')][_0xb811('0x14')])});})['catch'](handleError(_0x10b00b,null,_0xb811('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 1b0c006..e23d961 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 _0x8c7d=['put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','post'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x8c7d,0xe1));var _0xd8c7=function(_0x5fb6c7,_0x5bb772){_0x5fb6c7=_0x5fb6c7-0x0;var _0x250d8f=_0x8c7d[_0x5fb6c7];return _0x250d8f;};'use strict';var multer=require(_0xd8c7('0x0'));var util=require('util');var path=require(_0xd8c7('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8c7('0x2'));var router=express[_0xd8c7('0x3')]();var fs_extra=require(_0xd8c7('0x4'));var auth=require(_0xd8c7('0x5'));var interaction=require(_0xd8c7('0x6'));var config=require(_0xd8c7('0x7'));var controller=require(_0xd8c7('0x8'));router[_0xd8c7('0x9')]('/',auth[_0xd8c7('0xa')](),controller['index']);router['get'](_0xd8c7('0xb'),auth[_0xd8c7('0xa')](),controller['show']);router[_0xd8c7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8c7('0xd')](_0xd8c7('0xb'),auth[_0xd8c7('0xa')](),controller[_0xd8c7('0xe')]);router['delete'](_0xd8c7('0xb'),auth['isAuthenticated'](),controller[_0xd8c7('0xf')]);module[_0xd8c7('0x10')]=router; \ No newline at end of file +var _0xbc72=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','exports','multer','path'];(function(_0xc42312,_0x12d070){var _0x2c3062=function(_0x42d615){while(--_0x42d615){_0xc42312['push'](_0xc42312['shift']());}};_0x2c3062(++_0x12d070);}(_0xbc72,0x18e));var _0x2bc7=function(_0x442b70,_0x1530e5){_0x442b70=_0x442b70-0x0;var _0x1c2c7d=_0xbc72[_0x442b70];return _0x1c2c7d;};'use strict';var multer=require(_0x2bc7('0x0'));var util=require('util');var path=require(_0x2bc7('0x1'));var timeout=require(_0x2bc7('0x2'));var express=require('express');var router=express[_0x2bc7('0x3')]();var fs_extra=require(_0x2bc7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2bc7('0x5'));var config=require(_0x2bc7('0x6'));var controller=require('./tag.controller');router[_0x2bc7('0x7')]('/',auth[_0x2bc7('0x8')](),controller[_0x2bc7('0x9')]);router[_0x2bc7('0x7')](_0x2bc7('0xa'),auth[_0x2bc7('0x8')](),controller[_0x2bc7('0xb')]);router[_0x2bc7('0xc')]('/',auth[_0x2bc7('0x8')](),controller[_0x2bc7('0xd')]);router['put'](_0x2bc7('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2bc7('0xe')](_0x2bc7('0xa'),auth[_0x2bc7('0x8')](),controller['destroy']);module[_0x2bc7('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 0fb0c82..8ab163a 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 _0x0e21=['exports','STRING','name','#0091EA'];(function(_0xd95342,_0xb75bf6){var _0x54d694=function(_0x1190c1){while(--_0x1190c1){_0xd95342['push'](_0xd95342['shift']());}};_0x54d694(++_0xb75bf6);}(_0x0e21,0xe8));var _0x10e2=function(_0x5e4be2,_0x4d7944){_0x5e4be2=_0x5e4be2-0x0;var _0x2e223c=_0x0e21[_0x5e4be2];return _0x2e223c;};'use strict';var Sequelize=require('sequelize');module[_0x10e2('0x0')]={'name':{'type':Sequelize[_0x10e2('0x1')],'unique':_0x10e2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x10e2('0x3')},'description':{'type':Sequelize[_0x10e2('0x1')]}}; \ No newline at end of file +var _0xa958=['sequelize','STRING','name','#0091EA'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa958,0x94));var _0x8a95=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xa958[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x8a95('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a95('0x1')],'unique':_0x8a95('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8a95('0x1')],'defaultValue':_0x8a95('0x3')},'description':{'type':Sequelize[_0x8a95('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 36685e3..3540d54 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 _0x9c44=['update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','send','index','Tag','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','keys','include','find','catch','create','body','user','Tags','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3365a7,_0x180fd5){var _0x23a58c=function(_0x3befe2){while(--_0x3befe2){_0x3365a7['push'](_0x3365a7['shift']());}};_0x23a58c(++_0x180fd5);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){var _0x5850f2=_0x26c640[_0x49c4('0x24')]({'plain':!![]});var _0x9cb797='Tags';return db[_0x49c4('0x25')][_0x49c4('0x23')]({'where':{'type':_0x9cb797,'resourceId':_0x5850f2['id']}})[_0x49c4('0x26')](function(){return _0x26c640;});})[_0x49c4('0x26')](function(){_0x2263ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x449960,_0x53c199){return function(_0x3800b7){if(!_0x3800b7){_0x449960[_0x49c4('0x27')](0x194);}return _0x3800b7;};}function handleError(_0x3f1708,_0x372a47){_0x372a47=_0x372a47||0x1f4;return function(_0x5987ae){logger[_0x49c4('0x28')](_0x5987ae[_0x49c4('0x29')]);if(_0x5987ae[_0x49c4('0x2a')]){delete _0x5987ae[_0x49c4('0x2a')];}_0x3f1708[_0x49c4('0x16')](_0x372a47)[_0x49c4('0x2b')](_0x5987ae);};}exports[_0x49c4('0x2c')]=function(_0x427b26,_0x17b50f){var _0x2cbd88={},_0x46f7ea={},_0x4ea6ea={'count':0x0,'rows':[]};var _0x4f4495=_['map'](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x1eb035){return{'name':_0x1eb035[_0x49c4('0x2f')],'type':_0x1eb035[_0x49c4('0x30')]['key']};});_0x46f7ea[_0x49c4('0x31')]=_[_0x49c4('0x32')](_0x4f4495,_0x49c4('0x2a'));_0x46f7ea[_0x49c4('0x33')]=_['keys'](_0x427b26['query']);_0x46f7ea[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x46f7ea[_0x49c4('0x31')],_0x46f7ea[_0x49c4('0x33')]);_0x2cbd88[_0x49c4('0x36')]=_['intersection'](_0x46f7ea[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x427b26[_0x49c4('0x33')]['fields']));_0x2cbd88['attributes']=_0x2cbd88[_0x49c4('0x36')][_0x49c4('0x38')]?_0x2cbd88[_0x49c4('0x36')]:_0x46f7ea[_0x49c4('0x31')];if(!_0x427b26[_0x49c4('0x33')][_0x49c4('0x39')](_0x49c4('0x3a'))){_0x2cbd88[_0x49c4('0x1b')]=qs[_0x49c4('0x1b')](_0x427b26['query'][_0x49c4('0x1b')]);_0x2cbd88['offset']=qs[_0x49c4('0x19')](_0x427b26[_0x49c4('0x33')][_0x49c4('0x19')]);}_0x2cbd88[_0x49c4('0x3b')]=qs['sort'](_0x427b26[_0x49c4('0x33')][_0x49c4('0x3c')]);_0x2cbd88[_0x49c4('0x3d')]=qs['filters'](_[_0x49c4('0x3e')](_0x427b26[_0x49c4('0x33')],_0x46f7ea[_0x49c4('0x34')]),_0x4f4495);if(_0x427b26[_0x49c4('0x33')][_0x49c4('0x3f')]){_0x2cbd88[_0x49c4('0x3d')]=_[_0x49c4('0x40')](_0x2cbd88[_0x49c4('0x3d')],{'$or':_[_0x49c4('0x32')](_0x4f4495,function(_0x2f1105){if(_0x2f1105[_0x49c4('0x30')]!=='VIRTUAL'){var _0x2d2510={};_0x2d2510[_0x2f1105[_0x49c4('0x2a')]]={'$like':'%'+_0x427b26[_0x49c4('0x33')][_0x49c4('0x3f')]+'%'};return _0x2d2510;}})});}_0x2cbd88=_[_0x49c4('0x40')]({},_0x2cbd88,_0x427b26[_0x49c4('0x41')]);var _0x1be62d={'where':_0x2cbd88[_0x49c4('0x3d')]};return db[_0x49c4('0x2d')][_0x49c4('0x1c')](_0x1be62d)[_0x49c4('0x26')](function(_0xa3d59e){_0x4ea6ea[_0x49c4('0x1c')]=_0xa3d59e;if(_0x427b26['query'][_0x49c4('0x42')]){_0x2cbd88['include']=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x43')](_0x2cbd88);})[_0x49c4('0x26')](function(_0x1480da){_0x4ea6ea[_0x49c4('0x44')]=_0x1480da;return _0x4ea6ea;})[_0x49c4('0x26')](respondWithFilteredResult(_0x17b50f,_0x2cbd88))['catch'](handleError(_0x17b50f,null));};exports['show']=function(_0x20490b,_0x1e7bdc){var _0x38349b={'raw':!![],'where':{'id':_0x20490b['params']['id']}},_0x117151={};_0x117151[_0x49c4('0x31')]=_[_0x49c4('0x45')](db[_0x49c4('0x2d')][_0x49c4('0x2e')]);_0x117151[_0x49c4('0x33')]=_[_0x49c4('0x45')](_0x20490b[_0x49c4('0x33')]);_0x117151[_0x49c4('0x34')]=_[_0x49c4('0x35')](_0x117151['model'],_0x117151[_0x49c4('0x33')]);_0x38349b['attributes']=_[_0x49c4('0x35')](_0x117151[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x20490b[_0x49c4('0x33')][_0x49c4('0x37')]));_0x38349b['attributes']=_0x38349b[_0x49c4('0x36')][_0x49c4('0x38')]?_0x38349b[_0x49c4('0x36')]:_0x117151[_0x49c4('0x31')];if(_0x20490b[_0x49c4('0x33')][_0x49c4('0x42')]){_0x38349b[_0x49c4('0x46')]=[{'all':!![]}];}_0x38349b=_['merge']({},_0x38349b,_0x20490b[_0x49c4('0x41')]);return db['Tag'][_0x49c4('0x47')](_0x38349b)[_0x49c4('0x26')](handleEntityNotFound(_0x1e7bdc,null))[_0x49c4('0x26')](respondWithResult(_0x1e7bdc,null))[_0x49c4('0x48')](handleError(_0x1e7bdc,null));};exports[_0x49c4('0x49')]=function(_0x30bea5,_0x2c6be1){return db['Tag'][_0x49c4('0x49')](_0x30bea5[_0x49c4('0x4a')],{})['then'](function(_0x1e1ac4){var _0xaece5f=_0x30bea5[_0x49c4('0x4b')][_0x49c4('0x24')]({'plain':!![]});if(!_0xaece5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaece5f['role']===_0x49c4('0x4b')){var _0x4e8221=_0x1e1ac4[_0x49c4('0x24')]({'plain':!![]});var _0x1f941f=_0x49c4('0x4c');return db[_0x49c4('0x4d')][_0x49c4('0x47')]({'where':{'name':_0x1f941f,'userProfileId':_0xaece5f[_0x49c4('0x4e')]},'raw':!![]})[_0x49c4('0x26')](function(_0x563f0b){if(_0x563f0b&&_0x563f0b[_0x49c4('0x4f')]===0x0){return db[_0x49c4('0x25')][_0x49c4('0x49')]({'name':_0x4e8221[_0x49c4('0x2a')],'resourceId':_0x4e8221['id'],'type':_0x563f0b[_0x49c4('0x2a')],'sectionId':_0x563f0b['id']},{})[_0x49c4('0x26')](function(){return _0x1e1ac4;});}else{return _0x1e1ac4;}})[_0x49c4('0x48')](function(_0x25d174){logger[_0x49c4('0x28')](_0x49c4('0x50'),_0x25d174);throw _0x25d174;});}return _0x1e1ac4;})['then'](respondWithResult(_0x2c6be1,0xc9))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x22')]=function(_0x3f9a9d,_0x527e74){if(_0x3f9a9d['body']['id']){delete _0x3f9a9d[_0x49c4('0x4a')]['id'];}return db['Tag']['find']({'where':{'id':_0x3f9a9d[_0x49c4('0x51')]['id']}})[_0x49c4('0x26')](handleEntityNotFound(_0x527e74,null))[_0x49c4('0x26')](saveUpdates(_0x3f9a9d[_0x49c4('0x4a')],null))[_0x49c4('0x26')](respondWithResult(_0x527e74,null))[_0x49c4('0x48')](handleError(_0x527e74,null));};exports[_0x49c4('0x23')]=function(_0x50798e,_0x859dde){return db[_0x49c4('0x2d')][_0x49c4('0x47')]({'where':{'id':_0x50798e[_0x49c4('0x51')]['id']}})[_0x49c4('0x26')](handleEntityNotFound(_0x859dde,null))[_0x49c4('0x26')](removeEntity(_0x859dde,null))['catch'](handleError(_0x859dde,null));}; \ No newline at end of file +var _0x9b9b=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','userProfileId','autoAssociation','error','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','Tag','rawAttributes','type','key'];(function(_0x39c341,_0x2f47ff){var _0x58f61e=function(_0x101e79){while(--_0x101e79){_0x39c341['push'](_0x39c341['shift']());}};_0x58f61e(++_0x2f47ff);}(_0x9b9b,0x114));var _0xb9b9=function(_0x154f21,_0x3c7f37){_0x154f21=_0x154f21-0x0;var _0x5ae16f=_0x9b9b[_0x154f21];return _0x5ae16f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9b9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb9b9('0x1'));var moment=require(_0xb9b9('0x2'));var BPromise=require(_0xb9b9('0x3'));var Mustache=require(_0xb9b9('0x4'));var util=require(_0xb9b9('0x5'));var path=require(_0xb9b9('0x6'));var sox=require(_0xb9b9('0x7'));var csv=require(_0xb9b9('0x8'));var ejs=require(_0xb9b9('0x9'));var fs=require('fs');var fs_extra=require(_0xb9b9('0xa'));var _=require(_0xb9b9('0xb'));var squel=require(_0xb9b9('0xc'));var crypto=require(_0xb9b9('0xd'));var jsforce=require(_0xb9b9('0xe'));var deskjs=require(_0xb9b9('0xf'));var toCsv=require(_0xb9b9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb9b9('0x10'));var authService=require(_0xb9b9('0x11'));var qs=require(_0xb9b9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9b9('0x13'));var logger=require(_0xb9b9('0x14'))(_0xb9b9('0x15'));var utils=require('../../config/utils');var config=require(_0xb9b9('0x16'));var licenseUtil=require(_0xb9b9('0x17'));var db=require(_0xb9b9('0x18'))['db'];function respondWithStatusCode(_0x26fa04,_0x230fea){_0x230fea=_0x230fea||0xcc;return function(_0x135cdc){if(_0x135cdc){return _0x26fa04['sendStatus'](_0x230fea);}return _0x26fa04['status'](_0x230fea)[_0xb9b9('0x19')]();};}function respondWithResult(_0x4ef543,_0xe78d58){_0xe78d58=_0xe78d58||0xc8;return function(_0x50e5d6){if(_0x50e5d6){return _0x4ef543[_0xb9b9('0x1a')](_0xe78d58)[_0xb9b9('0x1b')](_0x50e5d6);}};}function respondWithFilteredResult(_0x21fa2a,_0x29794c){return function(_0x177ad9){if(_0x177ad9){var _0x3fd09c=typeof _0x29794c[_0xb9b9('0x1c')]===_0xb9b9('0x1d')&&typeof _0x29794c['limit']===_0xb9b9('0x1d');var _0x48d9ae=_0x177ad9[_0xb9b9('0x1e')];var _0x3e6d23=_0x3fd09c?0x0:_0x29794c[_0xb9b9('0x1c')];var _0x11bb05=_0x3fd09c?_0x177ad9['count']:_0x29794c[_0xb9b9('0x1c')]+_0x29794c[_0xb9b9('0x1f')];var _0x398f3d;if(_0x11bb05>=_0x48d9ae){_0x11bb05=_0x48d9ae;_0x398f3d=0xc8;}else{_0x398f3d=0xce;}_0x21fa2a[_0xb9b9('0x1a')](_0x398f3d);return _0x21fa2a[_0xb9b9('0x20')](_0xb9b9('0x21'),_0x3e6d23+'-'+_0x11bb05+'/'+_0x48d9ae)[_0xb9b9('0x1b')](_0x177ad9);}return null;};}function patchUpdates(_0x3d0edb){return function(_0xb16391){try{jsonpatch[_0xb9b9('0x22')](_0xb16391,_0x3d0edb,!![]);}catch(_0xbf7c16){return BPromise[_0xb9b9('0x23')](_0xbf7c16);}return _0xb16391[_0xb9b9('0x24')]();};}function saveUpdates(_0x4e33a0,_0x10b7e1){return function(_0xe1e1d7){if(_0xe1e1d7){return _0xe1e1d7[_0xb9b9('0x25')](_0x4e33a0)['then'](function(_0x9898bc){return _0x9898bc;});}return null;};}function removeEntity(_0x46525d,_0x5efa01){return function(_0x18e2ca){if(_0x18e2ca){return _0x18e2ca[_0xb9b9('0x26')]()[_0xb9b9('0x27')](function(){var _0x40b801=_0x18e2ca[_0xb9b9('0x28')]({'plain':!![]});var _0x5299fb='Tags';return db[_0xb9b9('0x29')][_0xb9b9('0x26')]({'where':{'type':_0x5299fb,'resourceId':_0x40b801['id']}})['then'](function(){return _0x18e2ca;});})[_0xb9b9('0x27')](function(){_0x46525d[_0xb9b9('0x1a')](0xcc)[_0xb9b9('0x19')]();});}};}function handleEntityNotFound(_0x21f68f,_0x125f6c){return function(_0x54bf18){if(!_0x54bf18){_0x21f68f[_0xb9b9('0x2a')](0x194);}return _0x54bf18;};}function handleError(_0x554850,_0x1e0c5e){_0x1e0c5e=_0x1e0c5e||0x1f4;return function(_0xe28f3c){logger['error'](_0xe28f3c[_0xb9b9('0x2b')]);if(_0xe28f3c[_0xb9b9('0x2c')]){delete _0xe28f3c[_0xb9b9('0x2c')];}_0x554850['status'](_0x1e0c5e)[_0xb9b9('0x2d')](_0xe28f3c);};}exports[_0xb9b9('0x2e')]=function(_0x2e1d12,_0x300453){var _0x4f002a={},_0xc40dda={},_0xdbc1f1={'count':0x0,'rows':[]};var _0x49757e=_[_0xb9b9('0x2f')](db[_0xb9b9('0x30')][_0xb9b9('0x31')],function(_0xc47845){return{'name':_0xc47845['fieldName'],'type':_0xc47845[_0xb9b9('0x32')][_0xb9b9('0x33')]};});_0xc40dda[_0xb9b9('0x34')]=_[_0xb9b9('0x2f')](_0x49757e,'name');_0xc40dda[_0xb9b9('0x35')]=_[_0xb9b9('0x36')](_0x2e1d12['query']);_0xc40dda[_0xb9b9('0x37')]=_[_0xb9b9('0x38')](_0xc40dda[_0xb9b9('0x34')],_0xc40dda[_0xb9b9('0x35')]);_0x4f002a[_0xb9b9('0x39')]=_[_0xb9b9('0x38')](_0xc40dda['model'],qs[_0xb9b9('0x3a')](_0x2e1d12[_0xb9b9('0x35')]['fields']));_0x4f002a[_0xb9b9('0x39')]=_0x4f002a[_0xb9b9('0x39')][_0xb9b9('0x3b')]?_0x4f002a['attributes']:_0xc40dda[_0xb9b9('0x34')];if(!_0x2e1d12['query'][_0xb9b9('0x3c')]('nolimit')){_0x4f002a[_0xb9b9('0x1f')]=qs[_0xb9b9('0x1f')](_0x2e1d12[_0xb9b9('0x35')][_0xb9b9('0x1f')]);_0x4f002a[_0xb9b9('0x1c')]=qs[_0xb9b9('0x1c')](_0x2e1d12[_0xb9b9('0x35')]['offset']);}_0x4f002a['order']=qs[_0xb9b9('0x3d')](_0x2e1d12[_0xb9b9('0x35')][_0xb9b9('0x3d')]);_0x4f002a['where']=qs[_0xb9b9('0x37')](_['pick'](_0x2e1d12[_0xb9b9('0x35')],_0xc40dda[_0xb9b9('0x37')]),_0x49757e);if(_0x2e1d12[_0xb9b9('0x35')][_0xb9b9('0x3e')]){_0x4f002a[_0xb9b9('0x3f')]=_[_0xb9b9('0x40')](_0x4f002a[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x2f')](_0x49757e,function(_0x496cf){if(_0x496cf[_0xb9b9('0x32')]!=='VIRTUAL'){var _0xf484fd={};_0xf484fd[_0x496cf[_0xb9b9('0x2c')]]={'$like':'%'+_0x2e1d12[_0xb9b9('0x35')][_0xb9b9('0x3e')]+'%'};return _0xf484fd;}})});}_0x4f002a=_[_0xb9b9('0x40')]({},_0x4f002a,_0x2e1d12[_0xb9b9('0x41')]);var _0x36717c={'where':_0x4f002a[_0xb9b9('0x3f')]};return db[_0xb9b9('0x30')][_0xb9b9('0x1e')](_0x36717c)['then'](function(_0x357b9c){_0xdbc1f1[_0xb9b9('0x1e')]=_0x357b9c;if(_0x2e1d12[_0xb9b9('0x35')][_0xb9b9('0x42')]){_0x4f002a['include']=[{'all':!![]}];}return db[_0xb9b9('0x30')]['findAll'](_0x4f002a);})['then'](function(_0x3e374e){_0xdbc1f1[_0xb9b9('0x43')]=_0x3e374e;return _0xdbc1f1;})['then'](respondWithFilteredResult(_0x300453,_0x4f002a))['catch'](handleError(_0x300453,null));};exports[_0xb9b9('0x44')]=function(_0x1a5888,_0x375543){var _0x3f4388={'raw':!![],'where':{'id':_0x1a5888[_0xb9b9('0x45')]['id']}},_0x493786={};_0x493786[_0xb9b9('0x34')]=_[_0xb9b9('0x36')](db['Tag']['rawAttributes']);_0x493786[_0xb9b9('0x35')]=_['keys'](_0x1a5888[_0xb9b9('0x35')]);_0x493786[_0xb9b9('0x37')]=_[_0xb9b9('0x38')](_0x493786[_0xb9b9('0x34')],_0x493786['query']);_0x3f4388[_0xb9b9('0x39')]=_[_0xb9b9('0x38')](_0x493786[_0xb9b9('0x34')],qs[_0xb9b9('0x3a')](_0x1a5888[_0xb9b9('0x35')][_0xb9b9('0x3a')]));_0x3f4388[_0xb9b9('0x39')]=_0x3f4388[_0xb9b9('0x39')][_0xb9b9('0x3b')]?_0x3f4388[_0xb9b9('0x39')]:_0x493786[_0xb9b9('0x34')];if(_0x1a5888[_0xb9b9('0x35')]['includeAll']){_0x3f4388[_0xb9b9('0x46')]=[{'all':!![]}];}_0x3f4388=_['merge']({},_0x3f4388,_0x1a5888[_0xb9b9('0x41')]);return db[_0xb9b9('0x30')][_0xb9b9('0x47')](_0x3f4388)[_0xb9b9('0x27')](handleEntityNotFound(_0x375543,null))['then'](respondWithResult(_0x375543,null))[_0xb9b9('0x48')](handleError(_0x375543,null));};exports['create']=function(_0x2b3e22,_0x576c06){return db[_0xb9b9('0x30')][_0xb9b9('0x49')](_0x2b3e22[_0xb9b9('0x4a')],{})[_0xb9b9('0x27')](function(_0x25bfa1){var _0x1a406c=_0x2b3e22[_0xb9b9('0x4b')][_0xb9b9('0x28')]({'plain':!![]});if(!_0x1a406c)throw new Error(_0xb9b9('0x4c'));if(_0x1a406c['role']==='user'){var _0x4da7d8=_0x25bfa1[_0xb9b9('0x28')]({'plain':!![]});var _0x504c1d=_0xb9b9('0x4d');return db[_0xb9b9('0x4e')][_0xb9b9('0x47')]({'where':{'name':_0x504c1d,'userProfileId':_0x1a406c[_0xb9b9('0x4f')]},'raw':!![]})['then'](function(_0x39c444){if(_0x39c444&&_0x39c444[_0xb9b9('0x50')]===0x0){return db['UserProfileResource'][_0xb9b9('0x49')]({'name':_0x4da7d8[_0xb9b9('0x2c')],'resourceId':_0x4da7d8['id'],'type':_0x39c444['name'],'sectionId':_0x39c444['id']},{})['then'](function(){return _0x25bfa1;});}else{return _0x25bfa1;}})[_0xb9b9('0x48')](function(_0x2bbe9f){logger[_0xb9b9('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bbe9f);throw _0x2bbe9f;});}return _0x25bfa1;})[_0xb9b9('0x27')](respondWithResult(_0x576c06,0xc9))[_0xb9b9('0x48')](handleError(_0x576c06,null));};exports['update']=function(_0x17b032,_0xb0b883){if(_0x17b032[_0xb9b9('0x4a')]['id']){delete _0x17b032[_0xb9b9('0x4a')]['id'];}return db['Tag'][_0xb9b9('0x47')]({'where':{'id':_0x17b032[_0xb9b9('0x45')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0xb0b883,null))['then'](saveUpdates(_0x17b032[_0xb9b9('0x4a')],null))[_0xb9b9('0x27')](respondWithResult(_0xb0b883,null))[_0xb9b9('0x48')](handleError(_0xb0b883,null));};exports[_0xb9b9('0x26')]=function(_0x1e88f1,_0x49956d){return db['Tag'][_0xb9b9('0x47')]({'where':{'id':_0x1e88f1[_0xb9b9('0x45')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x49956d,null))[_0xb9b9('0x27')](removeEntity(_0x49956d,null))[_0xb9b9('0x48')](handleError(_0x49956d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 769dace..2f6db8f 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 _0xe3f2=['api','bluebird','request-promise','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe3f2,0x101));var _0x2e3f=function(_0x234812,_0x24207a){_0x234812=_0x234812-0x0;var _0xf9e306=_0xe3f2[_0x234812];return _0xf9e306;};'use strict';var _=require(_0x2e3f('0x0'));var util=require(_0x2e3f('0x1'));var logger=require(_0x2e3f('0x2'))(_0x2e3f('0x3'));var moment=require('moment');var BPromise=require(_0x2e3f('0x4'));var rp=require(_0x2e3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e3f('0x6'));module['exports']=function(_0x19756d,_0x101606){return _0x19756d[_0x2e3f('0x7')](_0x2e3f('0x8'),attributes,{'tableName':_0x2e3f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3021=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x5aecfa,_0x7efd61){var _0x49b880=function(_0x200041){while(--_0x200041){_0x5aecfa['push'](_0x5aecfa['shift']());}};_0x49b880(++_0x7efd61);}(_0x3021,0x1b0));var _0x1302=function(_0x1b742b,_0x355731){_0x1b742b=_0x1b742b-0x0;var _0x3c9993=_0x3021[_0x1b742b];return _0x3c9993;};'use strict';var _=require(_0x1302('0x0'));var util=require('util');var logger=require(_0x1302('0x1'))('api');var moment=require(_0x1302('0x2'));var BPromise=require(_0x1302('0x3'));var rp=require(_0x1302('0x4'));var fs=require('fs');var path=require(_0x1302('0x5'));var rimraf=require(_0x1302('0x6'));var config=require(_0x1302('0x7'));var attributes=require(_0x1302('0x8'));module[_0x1302('0x9')]=function(_0x2bd488,_0x43890d){return _0x2bd488[_0x1302('0xa')](_0x1302('0xb'),attributes,{'tableName':'tools_tags','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 9d2fbc2..b9e865a 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 _0x7a59=['debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x7a59,0x16e));var _0x97a5=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7a59[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97a5('0x1'));var rs=require(_0x97a5('0x2'));var fs=require('fs');var Redis=require(_0x97a5('0x3'));var db=require(_0x97a5('0x4'))['db'];var utils=require(_0x97a5('0x5'));var logger=require('../../config/logger')(_0x97a5('0x6'));var config=require(_0x97a5('0x7'));var jayson=require(_0x97a5('0x8'));var client=jayson['client'][_0x97a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d32f,_0x2663b9,_0x2c0efa){return new BPromise(function(_0x27e8a6,_0x156789){return client[_0x97a5('0xa')](_0x52d32f,_0x2c0efa)['then'](function(_0x4f34e8){logger[_0x97a5('0xb')](_0x97a5('0xc'),_0x2663b9,_0x97a5('0xd'));logger[_0x97a5('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2663b9,'request\x20sent',JSON[_0x97a5('0xf')](_0x4f34e8));if(_0x4f34e8[_0x97a5('0x10')]){if(_0x4f34e8[_0x97a5('0x10')]['code']===0x1f4){logger[_0x97a5('0x10')](_0x97a5('0xc'),_0x2663b9,_0x4f34e8['error']['message']);return _0x156789(_0x4f34e8[_0x97a5('0x10')][_0x97a5('0x11')]);}logger['error']('Tag,\x20%s,\x20%s',_0x2663b9,_0x4f34e8['error']['message']);return _0x27e8a6(_0x4f34e8[_0x97a5('0x10')][_0x97a5('0x11')]);}else{logger[_0x97a5('0xb')]('Tag,\x20%s,\x20%s',_0x2663b9,_0x97a5('0xd'));_0x27e8a6(_0x4f34e8[_0x97a5('0x12')]['message']);}})[_0x97a5('0x13')](function(_0x5ee8ca){logger[_0x97a5('0x10')]('Tag,\x20%s,\x20%s',_0x2663b9,_0x5ee8ca);_0x156789(_0x5ee8ca);});});} \ No newline at end of file +var _0xb2b3=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0xb2b3,0x71));var _0x3b2b=function(_0x11ccd5,_0x250600){_0x11ccd5=_0x11ccd5-0x0;var _0x32ab7b=_0xb2b3[_0x11ccd5];return _0x32ab7b;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var moment=require(_0x3b2b('0x2'));var BPromise=require(_0x3b2b('0x3'));var rs=require(_0x3b2b('0x4'));var fs=require('fs');var Redis=require(_0x3b2b('0x5'));var db=require(_0x3b2b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2b('0x7'))(_0x3b2b('0x8'));var config=require(_0x3b2b('0x9'));var jayson=require(_0x3b2b('0xa'));var client=jayson[_0x3b2b('0xb')][_0x3b2b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x83e7ef,_0x24b585,_0x1a9054){return new BPromise(function(_0x3ec416,_0x33b807){return client[_0x3b2b('0xd')](_0x83e7ef,_0x1a9054)['then'](function(_0x430be0){logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));logger[_0x3b2b('0x11')](_0x3b2b('0x12'),_0x24b585,'request\x20sent',JSON['stringify'](_0x430be0));if(_0x430be0[_0x3b2b('0x13')]){if(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x14')]===0x1f4){logger[_0x3b2b('0x13')]('Tag,\x20%s,\x20%s',_0x24b585,_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);return _0x33b807(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);}logger[_0x3b2b('0x13')](_0x3b2b('0xf'),_0x24b585,_0x430be0['error'][_0x3b2b('0x15')]);return _0x3ec416(_0x430be0[_0x3b2b('0x13')]['message']);}else{logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));_0x3ec416(_0x430be0['result'][_0x3b2b('0x15')]);}})['catch'](function(_0x21743d){logger[_0x3b2b('0x13')]('Tag,\x20%s,\x20%s',_0x24b585,_0x21743d);_0x33b807(_0x21743d);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b816cc8..514f1f8 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 810436a..ed544a5 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 _0xd8b0=['exports','sequelize'];(function(_0x25ef57,_0x4167c3){var _0x2857fa=function(_0x108166){while(--_0x108166){_0x25ef57['push'](_0x25ef57['shift']());}};_0x2857fa(++_0x4167c3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe706,0xa3));var _0x6e70=function(_0x4ba811,_0x4428f2){_0x4ba811=_0x4ba811-0x0;var _0x3b616f=_0xe706[_0x4ba811];return _0x3b616f;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 7e106d4..f2875ab 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 _0x9480=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','order','sort','where','pick','VIRTUAL','filter','Team','include','rows','catch','show','params','fields','includeAll','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','find','userProfileId','autoAssociation','sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserMailQueue','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','add','ids','remove','addAgents','isArray','Chat','Sms','Fax','Openchannel','Whatsapp','through','Voice','User','Queue','findOrCreate','emit','Queue:save','QueueId','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','penalty','all','spread','removeAgents','Mail','transaction','getAgents','keys','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x9480,0x128));var _0x0948=function(_0x46f4bb,_0x7dc8a9){_0x46f4bb=_0x46f4bb-0x0;var _0x29f2af=_0x9480[_0x46f4bb];return _0x29f2af;};'use strict';var emlformat=require(_0x0948('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0948('0x1'));var jsonpatch=require(_0x0948('0x2'));var rp=require(_0x0948('0x3'));var moment=require('moment');var BPromise=require(_0x0948('0x4'));var Mustache=require(_0x0948('0x5'));var util=require(_0x0948('0x6'));var path=require(_0x0948('0x7'));var sox=require(_0x0948('0x8'));var csv=require(_0x0948('0x9'));var ejs=require(_0x0948('0xa'));var fs=require('fs');var fs_extra=require(_0x0948('0xb'));var _=require(_0x0948('0xc'));var squel=require(_0x0948('0xd'));var crypto=require(_0x0948('0xe'));var jsforce=require(_0x0948('0xf'));var deskjs=require(_0x0948('0x10'));var toCsv=require(_0x0948('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0948('0x11'));var authService=require(_0x0948('0x12'));var qs=require(_0x0948('0x13'));var as=require(_0x0948('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0948('0x15'))(_0x0948('0x16'));var utils=require(_0x0948('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0948('0x18'));var db=require(_0x0948('0x19'))['db'];config[_0x0948('0x1a')]=_[_0x0948('0x1b')](config['redis'],{'host':_0x0948('0x1c'),'port':0x18eb});var socket=require(_0x0948('0x1d'))(new Redis(config[_0x0948('0x1a')]));require(_0x0948('0x1e'))[_0x0948('0x1f')](socket);function respondWithStatusCode(_0x124f17,_0x144aaa){_0x144aaa=_0x144aaa||0xcc;return function(_0x30494e){if(_0x30494e){return _0x124f17['sendStatus'](_0x144aaa);}return _0x124f17[_0x0948('0x20')](_0x144aaa)[_0x0948('0x21')]();};}function respondWithResult(_0x3094bd,_0x4dc397){_0x4dc397=_0x4dc397||0xc8;return function(_0x155dc7){if(_0x155dc7){return _0x3094bd[_0x0948('0x20')](_0x4dc397)[_0x0948('0x22')](_0x155dc7);}};}function respondWithFilteredResult(_0x5f40de,_0x1a4e0c){return function(_0x168a9a){if(_0x168a9a){var _0x51dc2e=typeof _0x1a4e0c[_0x0948('0x23')]===_0x0948('0x24')&&typeof _0x1a4e0c[_0x0948('0x25')]===_0x0948('0x24');var _0x422ebd=_0x168a9a[_0x0948('0x26')];var _0x543f7c=_0x51dc2e?0x0:_0x1a4e0c[_0x0948('0x23')];var _0x1b67f8=_0x51dc2e?_0x168a9a[_0x0948('0x26')]:_0x1a4e0c[_0x0948('0x23')]+_0x1a4e0c['limit'];var _0x439437;if(_0x1b67f8>=_0x422ebd){_0x1b67f8=_0x422ebd;_0x439437=0xc8;}else{_0x439437=0xce;}_0x5f40de[_0x0948('0x20')](_0x439437);return _0x5f40de['set'](_0x0948('0x27'),_0x543f7c+'-'+_0x1b67f8+'/'+_0x422ebd)[_0x0948('0x22')](_0x168a9a);}return null;};}function patchUpdates(_0x44c11a){return function(_0x51dc6f){try{jsonpatch['apply'](_0x51dc6f,_0x44c11a,!![]);}catch(_0x24f4f8){return BPromise[_0x0948('0x28')](_0x24f4f8);}return _0x51dc6f[_0x0948('0x29')]();};}function saveUpdates(_0x75c5c7,_0x3dbae2){return function(_0x379c02){if(_0x379c02){return _0x379c02[_0x0948('0x2a')](_0x75c5c7)[_0x0948('0x2b')](function(_0x300a67){return _0x300a67;});}return null;};}function handleEntityNotFound(_0x389fcf,_0x17d5b1){return function(_0x26ca08){if(!_0x26ca08){_0x389fcf['sendStatus'](0x194);}return _0x26ca08;};}function handleError(_0x5e4bd9,_0x3b8e56){_0x3b8e56=_0x3b8e56||0x1f4;return function(_0x4d1643){logger[_0x0948('0x2c')](_0x4d1643[_0x0948('0x2d')]);if(_0x4d1643[_0x0948('0x2e')]){delete _0x4d1643[_0x0948('0x2e')];}_0x5e4bd9[_0x0948('0x20')](_0x3b8e56)['send'](_0x4d1643);};}exports['index']=function(_0x5ae5f6,_0x4d1a4f){var _0x436b8a={},_0x1b9a5e={},_0x1a3588={'count':0x0,'rows':[]};var _0x5cc3a9=_['map'](db['Team'][_0x0948('0x2f')],function(_0x1e5537){return{'name':_0x1e5537[_0x0948('0x30')],'type':_0x1e5537[_0x0948('0x31')][_0x0948('0x32')]};});_0x1b9a5e[_0x0948('0x33')]=_[_0x0948('0x34')](_0x5cc3a9,'name');_0x1b9a5e['query']=_['keys'](_0x5ae5f6[_0x0948('0x35')]);_0x1b9a5e[_0x0948('0x36')]=_[_0x0948('0x37')](_0x1b9a5e[_0x0948('0x33')],_0x1b9a5e['query']);_0x436b8a[_0x0948('0x38')]=_[_0x0948('0x37')](_0x1b9a5e['model'],qs['fields'](_0x5ae5f6[_0x0948('0x35')]['fields']));_0x436b8a[_0x0948('0x38')]=_0x436b8a[_0x0948('0x38')][_0x0948('0x39')]?_0x436b8a['attributes']:_0x1b9a5e[_0x0948('0x33')];if(!_0x5ae5f6[_0x0948('0x35')]['hasOwnProperty']('nolimit')){_0x436b8a[_0x0948('0x25')]=qs[_0x0948('0x25')](_0x5ae5f6[_0x0948('0x35')][_0x0948('0x25')]);_0x436b8a[_0x0948('0x23')]=qs[_0x0948('0x23')](_0x5ae5f6[_0x0948('0x35')]['offset']);}_0x436b8a[_0x0948('0x3a')]=qs[_0x0948('0x3b')](_0x5ae5f6['query'][_0x0948('0x3b')]);_0x436b8a[_0x0948('0x3c')]=qs[_0x0948('0x36')](_[_0x0948('0x3d')](_0x5ae5f6[_0x0948('0x35')],_0x1b9a5e[_0x0948('0x36')]),_0x5cc3a9);if(_0x5ae5f6[_0x0948('0x35')]['filter']){_0x436b8a[_0x0948('0x3c')]=_['merge'](_0x436b8a['where'],{'$or':_[_0x0948('0x34')](_0x5cc3a9,function(_0x34f434){if(_0x34f434[_0x0948('0x31')]!==_0x0948('0x3e')){var _0x2be71d={};_0x2be71d[_0x34f434[_0x0948('0x2e')]]={'$like':'%'+_0x5ae5f6['query'][_0x0948('0x3f')]+'%'};return _0x2be71d;}})});}_0x436b8a=_['merge']({},_0x436b8a,_0x5ae5f6['options']);var _0x47a00a={'where':_0x436b8a[_0x0948('0x3c')]};return db[_0x0948('0x40')][_0x0948('0x26')](_0x47a00a)[_0x0948('0x2b')](function(_0x154b28){_0x1a3588[_0x0948('0x26')]=_0x154b28;if(_0x5ae5f6[_0x0948('0x35')]['includeAll']){_0x436b8a[_0x0948('0x41')]=[{'all':!![]}];}return db[_0x0948('0x40')]['findAll'](_0x436b8a);})['then'](function(_0x2b5ff0){_0x1a3588[_0x0948('0x42')]=_0x2b5ff0;return _0x1a3588;})[_0x0948('0x2b')](respondWithFilteredResult(_0x4d1a4f,_0x436b8a))[_0x0948('0x43')](handleError(_0x4d1a4f,null));};exports[_0x0948('0x44')]=function(_0x363b2a,_0x40815a){var _0x39aff6={'raw':![],'where':{'id':_0x363b2a[_0x0948('0x45')]['id']}},_0x1e4b62={};_0x1e4b62[_0x0948('0x33')]=_['keys'](db[_0x0948('0x40')][_0x0948('0x2f')]);_0x1e4b62[_0x0948('0x35')]=_['keys'](_0x363b2a[_0x0948('0x35')]);_0x1e4b62[_0x0948('0x36')]=_[_0x0948('0x37')](_0x1e4b62['model'],_0x1e4b62[_0x0948('0x35')]);_0x39aff6[_0x0948('0x38')]=_[_0x0948('0x37')](_0x1e4b62[_0x0948('0x33')],qs[_0x0948('0x46')](_0x363b2a['query'][_0x0948('0x46')]));_0x39aff6[_0x0948('0x38')]=_0x39aff6[_0x0948('0x38')][_0x0948('0x39')]?_0x39aff6[_0x0948('0x38')]:_0x1e4b62['model'];if(_0x363b2a[_0x0948('0x35')][_0x0948('0x47')]){_0x39aff6[_0x0948('0x41')]=[{'all':!![]}];}_0x39aff6=_[_0x0948('0x48')]({},_0x39aff6,_0x363b2a[_0x0948('0x49')]);return db[_0x0948('0x40')]['find'](_0x39aff6)[_0x0948('0x2b')](handleEntityNotFound(_0x40815a,null))['then'](respondWithResult(_0x40815a,null))[_0x0948('0x43')](handleError(_0x40815a,null));};exports[_0x0948('0x4a')]=function(_0x3da91b,_0xca12d3){return db[_0x0948('0x40')]['create'](_0x3da91b[_0x0948('0x4b')],{})['then'](function(_0x2d542f){var _0x25bfe9=_0x3da91b['user'][_0x0948('0x4c')]({'plain':!![]});if(!_0x25bfe9)throw new Error(_0x0948('0x4d'));if(_0x25bfe9[_0x0948('0x4e')]===_0x0948('0x4f')){var _0x16b2f9=_0x2d542f['get']({'plain':!![]});var _0x564df7=_0x0948('0x50');return db['UserProfileSection'][_0x0948('0x51')]({'where':{'name':_0x564df7,'userProfileId':_0x25bfe9[_0x0948('0x52')]},'raw':!![]})[_0x0948('0x2b')](function(_0x10dfce){if(_0x10dfce&&_0x10dfce[_0x0948('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x16b2f9[_0x0948('0x2e')],'resourceId':_0x16b2f9['id'],'type':_0x10dfce[_0x0948('0x2e')],'sectionId':_0x10dfce['id']},{})[_0x0948('0x2b')](function(){return _0x2d542f;});}else{return _0x2d542f;}})['catch'](function(_0x1bb2f5){logger[_0x0948('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bb2f5);throw _0x1bb2f5;});}return _0x2d542f;})[_0x0948('0x2b')](respondWithResult(_0xca12d3,0xc9))[_0x0948('0x43')](handleError(_0xca12d3,null));};exports[_0x0948('0x2a')]=function(_0x2da8c5,_0x4f9185){if(_0x2da8c5[_0x0948('0x4b')]['id']){delete _0x2da8c5['body']['id'];}return db['Team'][_0x0948('0x51')]({'where':{'id':_0x2da8c5[_0x0948('0x45')]['id']}})[_0x0948('0x2b')](handleEntityNotFound(_0x4f9185,null))[_0x0948('0x2b')](saveUpdates(_0x2da8c5[_0x0948('0x4b')],null))['then'](respondWithResult(_0x4f9185,null))['catch'](handleError(_0x4f9185,null));};exports['destroy']=function(_0x48bd71,_0x3c6329){var _0x276005=_0x48bd71[_0x0948('0x45')]['id'];var _0x219f59=[];return db[_0x0948('0x54')]['transaction'](function(_0x25172b){var _0x2d5100='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x276005;return db[_0x0948('0x54')]['query'](_0x2d5100,{'type':db[_0x0948('0x55')]['QueryTypes'][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b})[_0x0948('0x2b')](function(_0x8fb804){_0x219f59=_[_0x0948('0x34')](_0x8fb804,function(_0x12a6be){return Number(_0x12a6be[_0x0948('0x57')]);});})['then'](function(){var _0x15f237=_0x0948('0x58')+_0x276005;return db['sequelize'][_0x0948('0x35')](_0x15f237,{'type':db[_0x0948('0x55')]['QueryTypes'][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x8ee0a4){var _0x5350cf=_['map'](_0x8ee0a4,function(_0x296c47){return Number(_0x296c47[_0x0948('0x59')]);});return db[_0x0948('0x5a')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'VoiceQueueId':{'$in':_0x5350cf}},'transaction':_0x25172b});})['then'](function(){var _0x1002ba=_0x0948('0x5c')+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x1002ba,{'type':db['Sequelize'][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x5df8ac){var _0x23ec67=_[_0x0948('0x34')](_0x5df8ac,function(_0x2efc26){return Number(_0x2efc26['MailQueueId']);});return db[_0x0948('0x5e')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'MailQueueId':{'$in':_0x23ec67}},'transaction':_0x25172b});})['then'](function(){var _0x266495='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x276005;return db['sequelize'][_0x0948('0x35')](_0x266495,{'type':db['Sequelize'][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x9c8cf8){var _0x3bc273=_['map'](_0x9c8cf8,function(_0x14467f){return Number(_0x14467f[_0x0948('0x5f')]);});return db[_0x0948('0x60')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'SmsQueueId':{'$in':_0x3bc273}},'transaction':_0x25172b});})['then'](function(){var _0x57844d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x57844d,{'type':db['Sequelize'][_0x0948('0x5d')]['SELECT'],'raw':!![],'transaction':_0x25172b});})['then'](function(_0x74aefb){var _0x62ab90=_[_0x0948('0x34')](_0x74aefb,function(_0x4f05c7){return Number(_0x4f05c7[_0x0948('0x61')]);});return db[_0x0948('0x62')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'ChatQueueId':{'$in':_0x62ab90}},'transaction':_0x25172b});})['then'](function(){var _0x54148b=_0x0948('0x63')+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x54148b,{'type':db['Sequelize'][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x48877b){var _0x489f87=_[_0x0948('0x34')](_0x48877b,function(_0x48f5c3){return Number(_0x48f5c3[_0x0948('0x64')]);});return db[_0x0948('0x65')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'FaxQueueId':{'$in':_0x489f87}},'transaction':_0x25172b});})['then'](function(){var _0x5e1e10=_0x0948('0x66')+_0x276005;return db[_0x0948('0x54')][_0x0948('0x35')](_0x5e1e10,{'type':db['Sequelize']['QueryTypes'][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x3dfe06){var _0x5de399=_[_0x0948('0x34')](_0x3dfe06,function(_0x348056){return Number(_0x348056['OpenchannelQueueId']);});return db[_0x0948('0x67')]['destroy']({'where':{'UserId':{'$in':_0x219f59},'OpenchannelQueueId':{'$in':_0x5de399}},'transaction':_0x25172b});})['then'](function(){var _0x478b02=_0x0948('0x68')+_0x276005;return db[_0x0948('0x54')]['query'](_0x478b02,{'type':db[_0x0948('0x55')][_0x0948('0x5d')][_0x0948('0x56')],'raw':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x4aa5a1){var _0x340c19=_['map'](_0x4aa5a1,function(_0x35cff5){return Number(_0x35cff5[_0x0948('0x69')]);});return db[_0x0948('0x6a')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'WhatsappQueueId':{'$in':_0x340c19}},'transaction':_0x25172b});})[_0x0948('0x2b')](function(){return db[_0x0948('0x6b')][_0x0948('0x51')]({'where':{'TeamId':_0x276005}});})[_0x0948('0x2b')](function(_0x31e507){if(_0x31e507===null){return;}return db[_0x0948('0x6c')][_0x0948('0x5b')]({'where':{'UserId':{'$in':_0x219f59},'VoicePrefixId':_0x31e507[_0x0948('0x6d')]},'transaction':_0x25172b});})[_0x0948('0x2b')](function(){return db[_0x0948('0x40')]['destroy']({'where':{'id':_0x276005},'cascade':!![],'transaction':_0x25172b});})[_0x0948('0x2b')](function(_0x1e543b){if(_0x1e543b===0x0){_0x3c6329[_0x0948('0x6e')](0x194);}else{return db['UserProfileResource'][_0x0948('0x5b')]({'where':{'type':'Teams','resourceId':_0x276005},'cascade':!![],'transaction':_0x25172b})['then'](function(){_0x3c6329[_0x0948('0x20')](0xcc)['end']();});}})[_0x0948('0x43')](function(_0x1c94f3){_0x3c6329[_0x0948('0x20')](0x1f4)['send'](_0x1c94f3);});});};exports['getQueues']=function(_0x5cb6a2,_0x4eed57,_0x1e03ff){return db[_0x0948('0x40')][_0x0948('0x6f')]({'where':{'id':_0x5cb6a2[_0x0948('0x45')]['id']}})[_0x0948('0x2b')](handleEntityNotFound(_0x4eed57,null))[_0x0948('0x2b')](function(_0x382f1b){if(!_0x5cb6a2[_0x0948('0x35')][_0x0948('0x70')]||!utils[_0x0948('0x71')](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x70')])){throw new db['Sequelize'][(_0x0948('0x72'))](_0x0948('0x73'));}var _0xa0f340={};var _0x22da4d={};_0x22da4d['model']=_['keys'](db[_[_0x0948('0x74')](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x70')][_0x0948('0x75')]())+'Queue'][_0x0948('0x2f')]);_0x22da4d['query']=_['keys'](_0x5cb6a2[_0x0948('0x35')]);_0x22da4d[_0x0948('0x36')]=_[_0x0948('0x37')](_0x22da4d[_0x0948('0x33')],_0x22da4d[_0x0948('0x35')]);_0xa0f340['attributes']=_['intersection'](_0x22da4d[_0x0948('0x33')],qs['fields'](_0x5cb6a2[_0x0948('0x35')]['fields']));_0xa0f340[_0x0948('0x38')]=_0xa0f340[_0x0948('0x38')]['length']?_0xa0f340['attributes']:_0x22da4d[_0x0948('0x33')];_0xa0f340[_0x0948('0x25')]=qs['limit'](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x25')]);_0xa0f340[_0x0948('0x23')]=qs['offset'](_0x5cb6a2['query'][_0x0948('0x23')]);_0xa0f340[_0x0948('0x3a')]=qs[_0x0948('0x3b')](_0x5cb6a2[_0x0948('0x35')][_0x0948('0x3b')]);_0xa0f340[_0x0948('0x3c')]=qs['filters'](_[_0x0948('0x3d')](_0x5cb6a2[_0x0948('0x35')],_0x22da4d[_0x0948('0x36')]));_0xa0f340=_[_0x0948('0x48')]({},_0xa0f340,_0x5cb6a2[_0x0948('0x49')]);return _0x382f1b[_0x0948('0x4c')+_['capitalize'](_0x5cb6a2[_0x0948('0x35')]['channel'][_0x0948('0x75')]())+_0x0948('0x76')](_0xa0f340);})[_0x0948('0x2b')](respondWithResult(_0x4eed57,null))[_0x0948('0x43')](handleError(_0x4eed57,null));};exports[_0x0948('0x77')]=function(_0x39f749,_0x4b20c6,_0x20ca13){return db[_0x0948('0x40')]['findOne']({'where':{'id':_0x39f749['params']['id']}})[_0x0948('0x2b')](function(_0x47dd9b){if(_0x47dd9b){if(!_0x39f749[_0x0948('0x4b')][_0x0948('0x70')]||!utils[_0x0948('0x71')](_0x39f749[_0x0948('0x4b')]['channel'])){throw new db[(_0x0948('0x55'))][(_0x0948('0x72'))](_0x0948('0x73'));}return _0x47dd9b[_0x0948('0x78')+_[_0x0948('0x74')](_0x39f749['body']['channel'][_0x0948('0x75')]())+_0x0948('0x76')](_0x39f749[_0x0948('0x4b')][_0x0948('0x79')]);}return null;})['then'](handleEntityNotFound(_0x4b20c6,null))['then'](respondWithStatusCode(_0x4b20c6,null))['catch'](handleError(_0x4b20c6,null));};exports['removeQueues']=function(_0x37ee01,_0x146cf6,_0x5a5798){return db['Team'][_0x0948('0x6f')]({'where':{'id':_0x37ee01['params']['id']}})[_0x0948('0x2b')](function(_0x1caf27){if(_0x1caf27){if(!_0x37ee01[_0x0948('0x35')][_0x0948('0x70')]||!utils[_0x0948('0x71')](_0x37ee01['query'][_0x0948('0x70')])){throw new db[(_0x0948('0x55'))][(_0x0948('0x72'))]('Unknown\x20channel');}return _0x1caf27[_0x0948('0x7a')+_[_0x0948('0x74')](_0x37ee01['query'][_0x0948('0x70')][_0x0948('0x75')]())+_0x0948('0x76')](_0x37ee01[_0x0948('0x35')][_0x0948('0x79')]);}return null;})['then'](handleEntityNotFound(_0x146cf6,null))[_0x0948('0x2b')](respondWithStatusCode(_0x146cf6,null))[_0x0948('0x43')](handleError(_0x146cf6,null));};exports[_0x0948('0x7b')]=function(_0x2642ae,_0x505f90){var _0x1ba326=_[_0x0948('0x7c')](_0x2642ae[_0x0948('0x4b')]['ids'])?_0x2642ae[_0x0948('0x4b')][_0x0948('0x79')]:[_0x2642ae[_0x0948('0x4b')]['ids']];var _0x4ce129=_0x2642ae[_0x0948('0x45')]['id'];return db[_0x0948('0x40')]['find']({'where':{'id':_0x4ce129}})[_0x0948('0x2b')](handleEntityNotFound(_0x505f90,null))[_0x0948('0x2b')](function(_0x9b28b1){if(_0x9b28b1){var _0x20ec50=['Voice',_0x0948('0x7d'),'Mail',_0x0948('0x7e'),_0x0948('0x7f'),_0x0948('0x80'),_0x0948('0x81')];return db[_0x0948('0x54')]['transaction'](function(_0x3fa9a8){var _0xf524f4=_[_0x0948('0x34')](_0x20ec50,function(_0x4d6327){var _0x47dabf={'attributes':['id',_0x0948('0x2e')]};if(_0x4d6327==='Voice'){_0x47dabf[_0x0948('0x82')]={'attributes':['penalty']};}return _0x9b28b1[_0x0948('0x4c')+_0x4d6327+_0x0948('0x76')](_0x47dabf)[_0x0948('0x2b')](function(_0x4a4fd8){var _0x582d50=_[_0x0948('0x34')](_0x4a4fd8,function(_0xf2e452){var _0x5320bb=_['map'](_0x1ba326,function(_0x1d9562){var _0x416749={'where':{'UserId':_0x1d9562,[_0x4d6327+'QueueId']:_0xf2e452['id']},'transaction':_0x3fa9a8};if(_0x4d6327===_0x0948('0x83')){_0x416749[_0x0948('0x1b')]={'penalty':_0xf2e452['TeamVoiceQueue']['penalty']};}return db[_0x0948('0x84')+_0x4d6327+_0x0948('0x85')][_0x0948('0x86')](_0x416749)[_0x0948('0x2b')](function(){socket[_0x0948('0x87')](_0x0948('0x4f')+_0x4d6327+_0x0948('0x88'),{'UserId':_0x1d9562,[_0x4d6327+_0x0948('0x89')]:_0xf2e452['id']});if(_0x4d6327!=='Voice'){return;}return db['User'][_0x0948('0x8a')]({'where':{'id':_0x1ba326,'online':0x1},'attributes':['id','name',_0x0948('0x8b'),_0x0948('0x8c'),_0x0948('0x8d')],'raw':!![]})['then'](function(_0x22333f){var _0x1bf8ec=_['map'](_0x22333f,function(_0x2069f4){return db[_0x0948('0x8e')][_0x0948('0x8f')]({'membername':_0x2069f4[_0x0948('0x2e')],'UserId':_0x2069f4['id'],'queue_name':_0xf2e452[_0x0948('0x2e')],'VoiceQueueId':_0xf2e452['id'],'interface':_[_0x0948('0x90')](_0x2069f4[_0x0948('0x8d')])?util[_0x0948('0x91')](_0x0948('0x92'),_0x2069f4[_0x0948('0x2e')]):_0x2069f4['interface'],'paused':_0x2069f4[_0x0948('0x8c')]||![],'penalty':_0xf2e452['TeamVoiceQueue'][_0x0948('0x93')]},{'transaction':_0x3fa9a8});});return Promise[_0x0948('0x94')](_0x1bf8ec);});});});return Promise[_0x0948('0x94')](_0x5320bb);});return Promise[_0x0948('0x94')](_0x582d50);})['then'](function(){return db[_0x0948('0x6b')]['findOne']({'where':{'teamId':_0x4ce129}})[_0x0948('0x2b')](function(_0x195ece){if(_0x195ece){var _0x2ce63d=_[_0x0948('0x34')](_0x1ba326,function(_0x375e24){db[_0x0948('0x6c')][_0x0948('0x8f')]({'UserId':_0x375e24,'VoicePrefixId':_0x195ece['VoicePrefixId']});});return Promise[_0x0948('0x94')](_0x2ce63d);}});});});return Promise[_0x0948('0x94')](_0xf524f4)[_0x0948('0x2b')](function(){return _0x9b28b1[_0x0948('0x7b')](_0x1ba326,{'transaction':_0x3fa9a8})[_0x0948('0x95')](function(_0x203515){return _0x203515;});});});}})[_0x0948('0x2b')](respondWithResult(_0x505f90,null))[_0x0948('0x43')](handleError(_0x505f90,null));};exports[_0x0948('0x96')]=function(_0x5313c9,_0x1ae8f3){var _0x3d23f7=_[_0x0948('0x7c')](_0x5313c9[_0x0948('0x35')]['ids'])?_0x5313c9['query'][_0x0948('0x79')]:[_0x5313c9[_0x0948('0x35')][_0x0948('0x79')]];var _0x1cc63a=_0x5313c9[_0x0948('0x45')]['id'];return db['Team'][_0x0948('0x51')]({'where':{'id':_0x1cc63a}})[_0x0948('0x2b')](handleEntityNotFound(_0x1ae8f3,null))[_0x0948('0x2b')](function(_0x4be1d0){if(_0x4be1d0){var _0x2c3adb=[_0x0948('0x83'),_0x0948('0x7d'),_0x0948('0x97'),_0x0948('0x7e'),_0x0948('0x7f'),_0x0948('0x80'),'Whatsapp'];return db[_0x0948('0x54')][_0x0948('0x98')](function(_0x54a21a){var _0x442f2d=_['map'](_0x2c3adb,function(_0xfba336){var _0x276366={'attributes':['id',_0x0948('0x2e')]};return _0x4be1d0['get'+_0xfba336+_0x0948('0x76')](_0x276366)[_0x0948('0x2b')](function(_0x252da8){var _0x3fe0e7=_[_0x0948('0x34')](_0x252da8,function(_0x27c7af){return _0x27c7af[_0x0948('0x96')](_0x3d23f7,{'transaction':_0x54a21a})[_0x0948('0x2b')](function(){var _0x2aadaa=_[_0x0948('0x34')](_0x3d23f7,function(_0x2a0409){socket[_0x0948('0x87')](_0x0948('0x4f')+_0xfba336+'Queue:remove',{'UserId':Number(_0x2a0409),[_0xfba336+_0x0948('0x89')]:_0x27c7af['id']});if(_0xfba336!==_0x0948('0x83')){return;}return db[_0x0948('0x8e')][_0x0948('0x5b')]({'where':{'VoiceQueueId':_0x27c7af['id'],'UserId':_0x2a0409},'transaction':_0x54a21a});});return Promise[_0x0948('0x94')](_0x2aadaa);});});return Promise[_0x0948('0x94')](_0x3fe0e7);});});return Promise[_0x0948('0x94')](_0x442f2d)[_0x0948('0x2b')](function(){return _0x4be1d0['removeAgents'](_0x3d23f7,{'transaction':_0x54a21a});})['then'](function(){return db[_0x0948('0x6b')][_0x0948('0x6f')]({'where':{'teamId':_0x1cc63a}})[_0x0948('0x2b')](function(_0x1d2acf){if(_0x1d2acf){var _0x32c662=_[_0x0948('0x34')](_0x3d23f7,function(_0x572835){db[_0x0948('0x6c')][_0x0948('0x5b')]({'where':{'UserId':_0x572835,'VoicePrefixId':_0x1d2acf[_0x0948('0x6d')]}});});return Promise[_0x0948('0x94')](_0x32c662);}});});});}})[_0x0948('0x2b')](respondWithStatusCode(_0x1ae8f3,null))['catch'](handleError(_0x1ae8f3,null));};exports[_0x0948('0x99')]=function(_0x18df17,_0x3e60c1,_0x2a7309){var _0x2536c2={};var _0x4852ce={};var _0x336550;var _0x1e3fde;return db[_0x0948('0x40')][_0x0948('0x6f')]({'where':{'id':_0x18df17[_0x0948('0x45')]['id']}})[_0x0948('0x2b')](handleEntityNotFound(_0x3e60c1,null))[_0x0948('0x2b')](function(_0x22fc14){if(_0x22fc14){_0x336550=_0x22fc14;_0x4852ce[_0x0948('0x33')]=_[_0x0948('0x9a')](db['User']['rawAttributes']);_0x4852ce[_0x0948('0x35')]=_[_0x0948('0x9a')](_0x18df17[_0x0948('0x35')]);_0x4852ce[_0x0948('0x36')]=_[_0x0948('0x37')](_0x4852ce['model'],_0x4852ce[_0x0948('0x35')]);_0x2536c2['attributes']=_[_0x0948('0x37')](_0x4852ce[_0x0948('0x33')],qs[_0x0948('0x46')](_0x18df17[_0x0948('0x35')][_0x0948('0x46')]));_0x2536c2['attributes']=_0x2536c2[_0x0948('0x38')][_0x0948('0x39')]?_0x2536c2['attributes']:_0x4852ce[_0x0948('0x33')];_0x2536c2[_0x0948('0x3a')]=qs['sort'](_0x18df17['query'][_0x0948('0x3b')]);_0x2536c2[_0x0948('0x3c')]=qs[_0x0948('0x36')](_[_0x0948('0x3d')](_0x18df17[_0x0948('0x35')],_0x4852ce[_0x0948('0x36')]));if(_0x18df17[_0x0948('0x35')][_0x0948('0x3f')]){_0x2536c2[_0x0948('0x3c')]=_[_0x0948('0x48')](_0x2536c2[_0x0948('0x3c')],{'$or':_['map'](_0x2536c2[_0x0948('0x38')],function(_0x46a135){var _0x11594d={};_0x11594d[_0x46a135]={'$like':'%'+_0x18df17['query'][_0x0948('0x3f')]+'%'};return _0x11594d;})});}_0x2536c2=_['merge']({},_0x2536c2,_0x18df17[_0x0948('0x49')]);return _0x336550[_0x0948('0x99')](_0x2536c2);}})[_0x0948('0x2b')](function(_0x2cb57d){if(_0x2cb57d){_0x1e3fde=_0x2cb57d[_0x0948('0x39')];if(!_0x18df17[_0x0948('0x35')][_0x0948('0x9b')](_0x0948('0x9c'))){_0x2536c2[_0x0948('0x25')]=qs[_0x0948('0x25')](_0x18df17[_0x0948('0x35')]['limit']);_0x2536c2[_0x0948('0x23')]=qs['offset'](_0x18df17[_0x0948('0x35')][_0x0948('0x23')]);}return _0x336550[_0x0948('0x99')](_0x2536c2);}})['then'](function(_0xc0b013){if(_0xc0b013){return _0xc0b013?{'count':_0x1e3fde,'rows':_0xc0b013}:null;}})[_0x0948('0x2b')](respondWithResult(_0x3e60c1,null))[_0x0948('0x43')](handleError(_0x3e60c1,null));}; \ No newline at end of file +var _0x2624=['defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filters','filter','where','type','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','rawAttributes','include','create','body','user','get','role','Teams','UserProfileSection','find','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','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','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','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','end','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','merge','capitalize','Queues','addQueues','findOne','add','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','Queue:save','User','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','all','TeamVoicePrefix','removeAgents','Sms','Queue:remove','order','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x36b6a0,_0x58581e){var _0x42b95e=function(_0x1fed4a){while(--_0x1fed4a){_0x36b6a0['push'](_0x36b6a0['shift']());}};_0x42b95e(++_0x58581e);}(_0x2624,0x1c5));var _0x4262=function(_0x5cdbf6,_0x5ea228){_0x5cdbf6=_0x5cdbf6-0x0;var _0x34a01d=_0x2624[_0x5cdbf6];return _0x34a01d;};'use strict';var emlformat=require(_0x4262('0x0'));var rimraf=require(_0x4262('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4262('0x2'));var rp=require(_0x4262('0x3'));var moment=require(_0x4262('0x4'));var BPromise=require(_0x4262('0x5'));var Mustache=require(_0x4262('0x6'));var util=require(_0x4262('0x7'));var path=require(_0x4262('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4262('0x9'));var _=require(_0x4262('0xa'));var squel=require(_0x4262('0xb'));var crypto=require(_0x4262('0xc'));var jsforce=require(_0x4262('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4262('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4262('0xf'));var qs=require(_0x4262('0x10'));var as=require(_0x4262('0x11'));var hardwareService=require(_0x4262('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x4262('0x13'));var config=require(_0x4262('0x14'));var licenseUtil=require(_0x4262('0x15'));var db=require(_0x4262('0x16'))['db'];config[_0x4262('0x17')]=_[_0x4262('0x18')](config[_0x4262('0x17')],{'host':_0x4262('0x19'),'port':0x18eb});var socket=require(_0x4262('0x1a'))(new Redis(config[_0x4262('0x17')]));require(_0x4262('0x1b'))[_0x4262('0x1c')](socket);function respondWithStatusCode(_0x23bd16,_0x23d278){_0x23d278=_0x23d278||0xcc;return function(_0x3818ca){if(_0x3818ca){return _0x23bd16[_0x4262('0x1d')](_0x23d278);}return _0x23bd16['status'](_0x23d278)['end']();};}function respondWithResult(_0x26ff86,_0x538a08){_0x538a08=_0x538a08||0xc8;return function(_0x4a8273){if(_0x4a8273){return _0x26ff86['status'](_0x538a08)[_0x4262('0x1e')](_0x4a8273);}};}function respondWithFilteredResult(_0x422794,_0x5bf620){return function(_0x1a6440){if(_0x1a6440){var _0x2554d1=typeof _0x5bf620[_0x4262('0x1f')]===_0x4262('0x20')&&typeof _0x5bf620[_0x4262('0x21')]===_0x4262('0x20');var _0x3d5df6=_0x1a6440[_0x4262('0x22')];var _0x313119=_0x2554d1?0x0:_0x5bf620[_0x4262('0x1f')];var _0x9926ac=_0x2554d1?_0x1a6440[_0x4262('0x22')]:_0x5bf620[_0x4262('0x1f')]+_0x5bf620[_0x4262('0x21')];var _0x59a853;if(_0x9926ac>=_0x3d5df6){_0x9926ac=_0x3d5df6;_0x59a853=0xc8;}else{_0x59a853=0xce;}_0x422794[_0x4262('0x23')](_0x59a853);return _0x422794[_0x4262('0x24')](_0x4262('0x25'),_0x313119+'-'+_0x9926ac+'/'+_0x3d5df6)[_0x4262('0x1e')](_0x1a6440);}return null;};}function patchUpdates(_0x47b877){return function(_0x44579b){try{jsonpatch[_0x4262('0x26')](_0x44579b,_0x47b877,!![]);}catch(_0x4b5562){return BPromise[_0x4262('0x27')](_0x4b5562);}return _0x44579b[_0x4262('0x28')]();};}function saveUpdates(_0x4d5acd,_0x2268f7){return function(_0x29ef1f){if(_0x29ef1f){return _0x29ef1f[_0x4262('0x29')](_0x4d5acd)[_0x4262('0x2a')](function(_0x54fb01){return _0x54fb01;});}return null;};}function handleEntityNotFound(_0x415fe7,_0xb13df0){return function(_0x59e4c7){if(!_0x59e4c7){_0x415fe7[_0x4262('0x1d')](0x194);}return _0x59e4c7;};}function handleError(_0x279d81,_0x47b8a9){_0x47b8a9=_0x47b8a9||0x1f4;return function(_0x46a041){logger[_0x4262('0x2b')](_0x46a041[_0x4262('0x2c')]);if(_0x46a041[_0x4262('0x2d')]){delete _0x46a041[_0x4262('0x2d')];}_0x279d81['status'](_0x47b8a9)[_0x4262('0x2e')](_0x46a041);};}exports[_0x4262('0x2f')]=function(_0x22f6b1,_0x48ee3d){var _0x5d259c={},_0xad131={},_0x587268={'count':0x0,'rows':[]};var _0x599806=_[_0x4262('0x30')](db[_0x4262('0x31')]['rawAttributes'],function(_0x1d7f6d){return{'name':_0x1d7f6d[_0x4262('0x32')],'type':_0x1d7f6d['type'][_0x4262('0x33')]};});_0xad131[_0x4262('0x34')]=_[_0x4262('0x30')](_0x599806,_0x4262('0x2d'));_0xad131['query']=_['keys'](_0x22f6b1[_0x4262('0x35')]);_0xad131['filters']=_[_0x4262('0x36')](_0xad131[_0x4262('0x34')],_0xad131[_0x4262('0x35')]);_0x5d259c['attributes']=_['intersection'](_0xad131['model'],qs[_0x4262('0x37')](_0x22f6b1[_0x4262('0x35')][_0x4262('0x37')]));_0x5d259c[_0x4262('0x38')]=_0x5d259c['attributes'][_0x4262('0x39')]?_0x5d259c[_0x4262('0x38')]:_0xad131[_0x4262('0x34')];if(!_0x22f6b1[_0x4262('0x35')][_0x4262('0x3a')]('nolimit')){_0x5d259c[_0x4262('0x21')]=qs['limit'](_0x22f6b1[_0x4262('0x35')][_0x4262('0x21')]);_0x5d259c[_0x4262('0x1f')]=qs[_0x4262('0x1f')](_0x22f6b1['query']['offset']);}_0x5d259c['order']=qs[_0x4262('0x3b')](_0x22f6b1[_0x4262('0x35')][_0x4262('0x3b')]);_0x5d259c['where']=qs['filters'](_[_0x4262('0x3c')](_0x22f6b1[_0x4262('0x35')],_0xad131[_0x4262('0x3d')]),_0x599806);if(_0x22f6b1[_0x4262('0x35')][_0x4262('0x3e')]){_0x5d259c[_0x4262('0x3f')]=_['merge'](_0x5d259c['where'],{'$or':_[_0x4262('0x30')](_0x599806,function(_0x281fa4){if(_0x281fa4[_0x4262('0x40')]!==_0x4262('0x41')){var _0x117a36={};_0x117a36[_0x281fa4[_0x4262('0x2d')]]={'$like':'%'+_0x22f6b1[_0x4262('0x35')][_0x4262('0x3e')]+'%'};return _0x117a36;}})});}_0x5d259c=_['merge']({},_0x5d259c,_0x22f6b1[_0x4262('0x42')]);var _0x407c80={'where':_0x5d259c[_0x4262('0x3f')]};return db[_0x4262('0x31')]['count'](_0x407c80)[_0x4262('0x2a')](function(_0x22fb0d){_0x587268[_0x4262('0x22')]=_0x22fb0d;if(_0x22f6b1['query'][_0x4262('0x43')]){_0x5d259c['include']=[{'all':!![]}];}return db['Team'][_0x4262('0x44')](_0x5d259c);})[_0x4262('0x2a')](function(_0x577ddb){_0x587268['rows']=_0x577ddb;return _0x587268;})[_0x4262('0x2a')](respondWithFilteredResult(_0x48ee3d,_0x5d259c))[_0x4262('0x45')](handleError(_0x48ee3d,null));};exports[_0x4262('0x46')]=function(_0x4c33e6,_0x55b720){var _0x47b6c3={'raw':![],'where':{'id':_0x4c33e6[_0x4262('0x47')]['id']}},_0x3745d6={};_0x3745d6['model']=_[_0x4262('0x48')](db[_0x4262('0x31')][_0x4262('0x49')]);_0x3745d6['query']=_[_0x4262('0x48')](_0x4c33e6['query']);_0x3745d6[_0x4262('0x3d')]=_[_0x4262('0x36')](_0x3745d6[_0x4262('0x34')],_0x3745d6['query']);_0x47b6c3[_0x4262('0x38')]=_['intersection'](_0x3745d6[_0x4262('0x34')],qs[_0x4262('0x37')](_0x4c33e6[_0x4262('0x35')][_0x4262('0x37')]));_0x47b6c3['attributes']=_0x47b6c3[_0x4262('0x38')][_0x4262('0x39')]?_0x47b6c3['attributes']:_0x3745d6[_0x4262('0x34')];if(_0x4c33e6['query'][_0x4262('0x43')]){_0x47b6c3[_0x4262('0x4a')]=[{'all':!![]}];}_0x47b6c3=_['merge']({},_0x47b6c3,_0x4c33e6[_0x4262('0x42')]);return db[_0x4262('0x31')]['find'](_0x47b6c3)['then'](handleEntityNotFound(_0x55b720,null))['then'](respondWithResult(_0x55b720,null))[_0x4262('0x45')](handleError(_0x55b720,null));};exports[_0x4262('0x4b')]=function(_0x47d83a,_0x14259d){return db['Team'][_0x4262('0x4b')](_0x47d83a[_0x4262('0x4c')],{})['then'](function(_0x4f497e){var _0x2524bd=_0x47d83a[_0x4262('0x4d')][_0x4262('0x4e')]({'plain':!![]});if(!_0x2524bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2524bd[_0x4262('0x4f')]==='user'){var _0x101a95=_0x4f497e['get']({'plain':!![]});var _0x5a20a5=_0x4262('0x50');return db[_0x4262('0x51')][_0x4262('0x52')]({'where':{'name':_0x5a20a5,'userProfileId':_0x2524bd['userProfileId']},'raw':!![]})[_0x4262('0x2a')](function(_0x3a764a){if(_0x3a764a&&_0x3a764a['autoAssociation']===0x0){return db[_0x4262('0x53')]['create']({'name':_0x101a95[_0x4262('0x2d')],'resourceId':_0x101a95['id'],'type':_0x3a764a[_0x4262('0x2d')],'sectionId':_0x3a764a['id']},{})[_0x4262('0x2a')](function(){return _0x4f497e;});}else{return _0x4f497e;}})[_0x4262('0x45')](function(_0x51785a){logger[_0x4262('0x2b')](_0x4262('0x54'),_0x51785a);throw _0x51785a;});}return _0x4f497e;})[_0x4262('0x2a')](respondWithResult(_0x14259d,0xc9))[_0x4262('0x45')](handleError(_0x14259d,null));};exports['update']=function(_0x2f91e6,_0x3d9d44){if(_0x2f91e6[_0x4262('0x4c')]['id']){delete _0x2f91e6['body']['id'];}return db[_0x4262('0x31')][_0x4262('0x52')]({'where':{'id':_0x2f91e6['params']['id']}})['then'](handleEntityNotFound(_0x3d9d44,null))['then'](saveUpdates(_0x2f91e6['body'],null))[_0x4262('0x2a')](respondWithResult(_0x3d9d44,null))['catch'](handleError(_0x3d9d44,null));};exports[_0x4262('0x55')]=function(_0x3bf681,_0x453415){var _0x1bda36=_0x3bf681[_0x4262('0x47')]['id'];var _0x122311=[];return db[_0x4262('0x56')][_0x4262('0x57')](function(_0x24e00a){var _0x228d89=_0x4262('0x58')+_0x1bda36;return db['sequelize'][_0x4262('0x35')](_0x228d89,{'type':db[_0x4262('0x59')]['QueryTypes'][_0x4262('0x5a')],'raw':!![],'transaction':_0x24e00a})[_0x4262('0x2a')](function(_0x23db69){_0x122311=_[_0x4262('0x30')](_0x23db69,function(_0x176bbd){return Number(_0x176bbd[_0x4262('0x5b')]);});})['then'](function(){var _0x574f34=_0x4262('0x5c')+_0x1bda36;return db[_0x4262('0x56')][_0x4262('0x35')](_0x574f34,{'type':db[_0x4262('0x59')][_0x4262('0x5d')][_0x4262('0x5a')],'raw':!![],'transaction':_0x24e00a});})[_0x4262('0x2a')](function(_0x2b8124){var _0x1f5c7c=_[_0x4262('0x30')](_0x2b8124,function(_0x4abd27){return Number(_0x4abd27[_0x4262('0x5e')]);});return db[_0x4262('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x122311},'VoiceQueueId':{'$in':_0x1f5c7c}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){var _0x2b409e=_0x4262('0x60')+_0x1bda36;return db[_0x4262('0x56')][_0x4262('0x35')](_0x2b409e,{'type':db[_0x4262('0x59')]['QueryTypes'][_0x4262('0x5a')],'raw':!![],'transaction':_0x24e00a});})[_0x4262('0x2a')](function(_0x70685){var _0x236e91=_[_0x4262('0x30')](_0x70685,function(_0x519e62){return Number(_0x519e62[_0x4262('0x61')]);});return db[_0x4262('0x62')][_0x4262('0x55')]({'where':{'UserId':{'$in':_0x122311},'MailQueueId':{'$in':_0x236e91}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){var _0x10a2c1=_0x4262('0x63')+_0x1bda36;return db[_0x4262('0x56')][_0x4262('0x35')](_0x10a2c1,{'type':db['Sequelize'][_0x4262('0x5d')]['SELECT'],'raw':!![],'transaction':_0x24e00a});})[_0x4262('0x2a')](function(_0x21f266){var _0x295296=_['map'](_0x21f266,function(_0x567da4){return Number(_0x567da4[_0x4262('0x64')]);});return db['UserSmsQueue'][_0x4262('0x55')]({'where':{'UserId':{'$in':_0x122311},'SmsQueueId':{'$in':_0x295296}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){var _0x4b5b61=_0x4262('0x65')+_0x1bda36;return db[_0x4262('0x56')][_0x4262('0x35')](_0x4b5b61,{'type':db[_0x4262('0x59')]['QueryTypes'][_0x4262('0x5a')],'raw':!![],'transaction':_0x24e00a});})['then'](function(_0x6d6c1c){var _0x240788=_['map'](_0x6d6c1c,function(_0x32b74e){return Number(_0x32b74e[_0x4262('0x66')]);});return db[_0x4262('0x67')]['destroy']({'where':{'UserId':{'$in':_0x122311},'ChatQueueId':{'$in':_0x240788}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){var _0x250d3d=_0x4262('0x68')+_0x1bda36;return db[_0x4262('0x56')]['query'](_0x250d3d,{'type':db[_0x4262('0x59')][_0x4262('0x5d')]['SELECT'],'raw':!![],'transaction':_0x24e00a});})['then'](function(_0x26a661){var _0x252720=_[_0x4262('0x30')](_0x26a661,function(_0x2cb5c1){return Number(_0x2cb5c1['FaxQueueId']);});return db[_0x4262('0x69')][_0x4262('0x55')]({'where':{'UserId':{'$in':_0x122311},'FaxQueueId':{'$in':_0x252720}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){var _0xd39f47=_0x4262('0x6a')+_0x1bda36;return db[_0x4262('0x56')][_0x4262('0x35')](_0xd39f47,{'type':db['Sequelize'][_0x4262('0x5d')][_0x4262('0x5a')],'raw':!![],'transaction':_0x24e00a});})[_0x4262('0x2a')](function(_0x5349c5){var _0x3bf885=_[_0x4262('0x30')](_0x5349c5,function(_0x5a64a2){return Number(_0x5a64a2[_0x4262('0x6b')]);});return db[_0x4262('0x6c')][_0x4262('0x55')]({'where':{'UserId':{'$in':_0x122311},'OpenchannelQueueId':{'$in':_0x3bf885}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){var _0x39eb02=_0x4262('0x6d')+_0x1bda36;return db['sequelize'][_0x4262('0x35')](_0x39eb02,{'type':db['Sequelize'][_0x4262('0x5d')][_0x4262('0x5a')],'raw':!![],'transaction':_0x24e00a});})[_0x4262('0x2a')](function(_0x4cbe76){var _0x28fc0a=_[_0x4262('0x30')](_0x4cbe76,function(_0x2411f0){return Number(_0x2411f0[_0x4262('0x6e')]);});return db[_0x4262('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x122311},'WhatsappQueueId':{'$in':_0x28fc0a}},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){return db['TeamVoicePrefix'][_0x4262('0x52')]({'where':{'TeamId':_0x1bda36}});})[_0x4262('0x2a')](function(_0x5c38ec){if(_0x5c38ec===null){return;}return db[_0x4262('0x70')][_0x4262('0x55')]({'where':{'UserId':{'$in':_0x122311},'VoicePrefixId':_0x5c38ec[_0x4262('0x71')]},'transaction':_0x24e00a});})[_0x4262('0x2a')](function(){return db[_0x4262('0x31')][_0x4262('0x55')]({'where':{'id':_0x1bda36},'cascade':!![],'transaction':_0x24e00a});})[_0x4262('0x2a')](function(_0x3cc9c1){if(_0x3cc9c1===0x0){_0x453415[_0x4262('0x1d')](0x194);}else{return db[_0x4262('0x53')][_0x4262('0x55')]({'where':{'type':_0x4262('0x50'),'resourceId':_0x1bda36},'cascade':!![],'transaction':_0x24e00a})[_0x4262('0x2a')](function(){_0x453415[_0x4262('0x23')](0xcc)[_0x4262('0x72')]();});}})[_0x4262('0x45')](function(_0x1186c3){_0x453415['status'](0x1f4)[_0x4262('0x2e')](_0x1186c3);});});};exports['getQueues']=function(_0x2d0a77,_0x3c6df3,_0x266d15){return db[_0x4262('0x31')]['findOne']({'where':{'id':_0x2d0a77[_0x4262('0x47')]['id']}})[_0x4262('0x2a')](handleEntityNotFound(_0x3c6df3,null))[_0x4262('0x2a')](function(_0x14308e){if(!_0x2d0a77['query']['channel']||!utils[_0x4262('0x73')](_0x2d0a77[_0x4262('0x35')][_0x4262('0x74')])){throw new db[(_0x4262('0x59'))][(_0x4262('0x75'))](_0x4262('0x76'));}var _0x3b7eb7={};var _0xcd3c20={};_0xcd3c20['model']=_[_0x4262('0x48')](db[_['capitalize'](_0x2d0a77[_0x4262('0x35')][_0x4262('0x74')][_0x4262('0x77')]())+_0x4262('0x78')]['rawAttributes']);_0xcd3c20['query']=_[_0x4262('0x48')](_0x2d0a77[_0x4262('0x35')]);_0xcd3c20[_0x4262('0x3d')]=_[_0x4262('0x36')](_0xcd3c20[_0x4262('0x34')],_0xcd3c20[_0x4262('0x35')]);_0x3b7eb7[_0x4262('0x38')]=_[_0x4262('0x36')](_0xcd3c20['model'],qs[_0x4262('0x37')](_0x2d0a77['query'][_0x4262('0x37')]));_0x3b7eb7[_0x4262('0x38')]=_0x3b7eb7[_0x4262('0x38')][_0x4262('0x39')]?_0x3b7eb7[_0x4262('0x38')]:_0xcd3c20['model'];_0x3b7eb7['limit']=qs[_0x4262('0x21')](_0x2d0a77[_0x4262('0x35')]['limit']);_0x3b7eb7[_0x4262('0x1f')]=qs[_0x4262('0x1f')](_0x2d0a77[_0x4262('0x35')]['offset']);_0x3b7eb7['order']=qs[_0x4262('0x3b')](_0x2d0a77[_0x4262('0x35')][_0x4262('0x3b')]);_0x3b7eb7['where']=qs['filters'](_[_0x4262('0x3c')](_0x2d0a77['query'],_0xcd3c20[_0x4262('0x3d')]));_0x3b7eb7=_[_0x4262('0x79')]({},_0x3b7eb7,_0x2d0a77[_0x4262('0x42')]);return _0x14308e['get'+_[_0x4262('0x7a')](_0x2d0a77[_0x4262('0x35')][_0x4262('0x74')]['toLowerCase']())+_0x4262('0x7b')](_0x3b7eb7);})['then'](respondWithResult(_0x3c6df3,null))['catch'](handleError(_0x3c6df3,null));};exports[_0x4262('0x7c')]=function(_0x578d93,_0x5689b8,_0xc19ea6){return db[_0x4262('0x31')][_0x4262('0x7d')]({'where':{'id':_0x578d93['params']['id']}})[_0x4262('0x2a')](function(_0x3f0f63){if(_0x3f0f63){if(!_0x578d93[_0x4262('0x4c')][_0x4262('0x74')]||!utils[_0x4262('0x73')](_0x578d93[_0x4262('0x4c')][_0x4262('0x74')])){throw new db['Sequelize'][(_0x4262('0x75'))](_0x4262('0x76'));}return _0x3f0f63[_0x4262('0x7e')+_[_0x4262('0x7a')](_0x578d93[_0x4262('0x4c')][_0x4262('0x74')][_0x4262('0x77')]())+_0x4262('0x7b')](_0x578d93[_0x4262('0x4c')]['ids']);}return null;})[_0x4262('0x2a')](handleEntityNotFound(_0x5689b8,null))['then'](respondWithStatusCode(_0x5689b8,null))[_0x4262('0x45')](handleError(_0x5689b8,null));};exports[_0x4262('0x7f')]=function(_0x5b7e0c,_0x4dd3bc,_0xb6b5da){return db[_0x4262('0x31')][_0x4262('0x7d')]({'where':{'id':_0x5b7e0c['params']['id']}})['then'](function(_0x160b75){if(_0x160b75){if(!_0x5b7e0c['query'][_0x4262('0x74')]||!utils[_0x4262('0x73')](_0x5b7e0c[_0x4262('0x35')][_0x4262('0x74')])){throw new db[(_0x4262('0x59'))][(_0x4262('0x75'))](_0x4262('0x76'));}return _0x160b75[_0x4262('0x80')+_[_0x4262('0x7a')](_0x5b7e0c[_0x4262('0x35')][_0x4262('0x74')][_0x4262('0x77')]())+_0x4262('0x7b')](_0x5b7e0c[_0x4262('0x35')][_0x4262('0x81')]);}return null;})[_0x4262('0x2a')](handleEntityNotFound(_0x4dd3bc,null))[_0x4262('0x2a')](respondWithStatusCode(_0x4dd3bc,null))['catch'](handleError(_0x4dd3bc,null));};exports[_0x4262('0x82')]=function(_0x196b42,_0x263404){var _0x677e07=_[_0x4262('0x83')](_0x196b42['body'][_0x4262('0x81')])?_0x196b42[_0x4262('0x4c')][_0x4262('0x81')]:[_0x196b42[_0x4262('0x4c')][_0x4262('0x81')]];var _0x2c153d=_0x196b42['params']['id'];return db[_0x4262('0x31')][_0x4262('0x52')]({'where':{'id':_0x2c153d}})[_0x4262('0x2a')](handleEntityNotFound(_0x263404,null))['then'](function(_0x3b4239){if(_0x3b4239){var _0x456aba=[_0x4262('0x84'),_0x4262('0x85'),_0x4262('0x86'),'Sms',_0x4262('0x87'),_0x4262('0x88'),_0x4262('0x89')];return db[_0x4262('0x56')][_0x4262('0x57')](function(_0x4d7e30){var _0x4061bc=_[_0x4262('0x30')](_0x456aba,function(_0xcf0e93){var _0x24d46e={'attributes':['id','name']};if(_0xcf0e93===_0x4262('0x84')){_0x24d46e['through']={'attributes':[_0x4262('0x8a')]};}return _0x3b4239[_0x4262('0x4e')+_0xcf0e93+_0x4262('0x7b')](_0x24d46e)[_0x4262('0x2a')](function(_0x4cd122){var _0x435c83=_['map'](_0x4cd122,function(_0x49902a){var _0xdeb7ec=_[_0x4262('0x30')](_0x677e07,function(_0x113100){var _0x4c62f0={'where':{'UserId':_0x113100,[_0xcf0e93+_0x4262('0x8b')]:_0x49902a['id']},'transaction':_0x4d7e30};if(_0xcf0e93===_0x4262('0x84')){_0x4c62f0[_0x4262('0x18')]={'penalty':_0x49902a[_0x4262('0x8c')]['penalty']};}return db['User'+_0xcf0e93+_0x4262('0x78')][_0x4262('0x8d')](_0x4c62f0)[_0x4262('0x2a')](function(){socket[_0x4262('0x8e')](_0x4262('0x4d')+_0xcf0e93+_0x4262('0x8f'),{'UserId':_0x113100,[_0xcf0e93+_0x4262('0x8b')]:_0x49902a['id']});if(_0xcf0e93!==_0x4262('0x84')){return;}return db[_0x4262('0x90')]['findAll']({'where':{'id':_0x677e07,'online':0x1},'attributes':['id',_0x4262('0x2d'),_0x4262('0x91'),_0x4262('0x92'),'interface'],'raw':!![]})[_0x4262('0x2a')](function(_0x3017f0){var _0xdc6c26=_[_0x4262('0x30')](_0x3017f0,function(_0x5e6835){return db[_0x4262('0x93')][_0x4262('0x94')]({'membername':_0x5e6835[_0x4262('0x2d')],'UserId':_0x5e6835['id'],'queue_name':_0x49902a[_0x4262('0x2d')],'VoiceQueueId':_0x49902a['id'],'interface':_[_0x4262('0x95')](_0x5e6835[_0x4262('0x96')])?util['format'](_0x4262('0x97'),_0x5e6835[_0x4262('0x2d')]):_0x5e6835[_0x4262('0x96')],'paused':_0x5e6835[_0x4262('0x92')]||![],'penalty':_0x49902a[_0x4262('0x8c')]['penalty']},{'transaction':_0x4d7e30});});return Promise[_0x4262('0x98')](_0xdc6c26);});});});return Promise[_0x4262('0x98')](_0xdeb7ec);});return Promise[_0x4262('0x98')](_0x435c83);})[_0x4262('0x2a')](function(){return db[_0x4262('0x99')][_0x4262('0x7d')]({'where':{'teamId':_0x2c153d}})[_0x4262('0x2a')](function(_0x4d018a){if(_0x4d018a){var _0x2abe3b=_[_0x4262('0x30')](_0x677e07,function(_0x3273af){db[_0x4262('0x70')][_0x4262('0x94')]({'UserId':_0x3273af,'VoicePrefixId':_0x4d018a['VoicePrefixId']});});return Promise['all'](_0x2abe3b);}});});});return Promise['all'](_0x4061bc)[_0x4262('0x2a')](function(){return _0x3b4239[_0x4262('0x82')](_0x677e07,{'transaction':_0x4d7e30})['spread'](function(_0x111311){return _0x111311;});});});}})['then'](respondWithResult(_0x263404,null))[_0x4262('0x45')](handleError(_0x263404,null));};exports[_0x4262('0x9a')]=function(_0x4565f8,_0x688ed2){var _0xde9dd8=_[_0x4262('0x83')](_0x4565f8['query']['ids'])?_0x4565f8[_0x4262('0x35')][_0x4262('0x81')]:[_0x4565f8['query'][_0x4262('0x81')]];var _0x543b8d=_0x4565f8[_0x4262('0x47')]['id'];return db[_0x4262('0x31')][_0x4262('0x52')]({'where':{'id':_0x543b8d}})[_0x4262('0x2a')](handleEntityNotFound(_0x688ed2,null))[_0x4262('0x2a')](function(_0x59c758){if(_0x59c758){var _0x4c4dc2=[_0x4262('0x84'),_0x4262('0x85'),'Mail',_0x4262('0x9b'),_0x4262('0x87'),'Openchannel',_0x4262('0x89')];return db[_0x4262('0x56')][_0x4262('0x57')](function(_0x5bd0b4){var _0x1f5d0b=_[_0x4262('0x30')](_0x4c4dc2,function(_0x3c303d){var _0x3913bd={'attributes':['id',_0x4262('0x2d')]};return _0x59c758[_0x4262('0x4e')+_0x3c303d+'Queues'](_0x3913bd)['then'](function(_0xd5271f){var _0x4e17ae=_['map'](_0xd5271f,function(_0x173e3d){return _0x173e3d[_0x4262('0x9a')](_0xde9dd8,{'transaction':_0x5bd0b4})['then'](function(){var _0x43b10c=_[_0x4262('0x30')](_0xde9dd8,function(_0x103fcc){socket[_0x4262('0x8e')](_0x4262('0x4d')+_0x3c303d+_0x4262('0x9c'),{'UserId':Number(_0x103fcc),[_0x3c303d+'QueueId']:_0x173e3d['id']});if(_0x3c303d!==_0x4262('0x84')){return;}return db[_0x4262('0x93')][_0x4262('0x55')]({'where':{'VoiceQueueId':_0x173e3d['id'],'UserId':_0x103fcc},'transaction':_0x5bd0b4});});return Promise[_0x4262('0x98')](_0x43b10c);});});return Promise[_0x4262('0x98')](_0x4e17ae);});});return Promise[_0x4262('0x98')](_0x1f5d0b)['then'](function(){return _0x59c758[_0x4262('0x9a')](_0xde9dd8,{'transaction':_0x5bd0b4});})[_0x4262('0x2a')](function(){return db[_0x4262('0x99')][_0x4262('0x7d')]({'where':{'teamId':_0x543b8d}})[_0x4262('0x2a')](function(_0x109527){if(_0x109527){var _0x203062=_[_0x4262('0x30')](_0xde9dd8,function(_0x7ec58d){db[_0x4262('0x70')][_0x4262('0x55')]({'where':{'UserId':_0x7ec58d,'VoicePrefixId':_0x109527['VoicePrefixId']}});});return Promise['all'](_0x203062);}});});});}})[_0x4262('0x2a')](respondWithStatusCode(_0x688ed2,null))[_0x4262('0x45')](handleError(_0x688ed2,null));};exports['getAgents']=function(_0x3d5a35,_0x37ba4a,_0x18ffe3){var _0x2a3fe3={};var _0xfa4dc={};var _0x83cc0a;var _0x1d17eb;return db[_0x4262('0x31')][_0x4262('0x7d')]({'where':{'id':_0x3d5a35[_0x4262('0x47')]['id']}})[_0x4262('0x2a')](handleEntityNotFound(_0x37ba4a,null))[_0x4262('0x2a')](function(_0x49f6d5){if(_0x49f6d5){_0x83cc0a=_0x49f6d5;_0xfa4dc[_0x4262('0x34')]=_['keys'](db[_0x4262('0x90')][_0x4262('0x49')]);_0xfa4dc['query']=_[_0x4262('0x48')](_0x3d5a35['query']);_0xfa4dc['filters']=_[_0x4262('0x36')](_0xfa4dc[_0x4262('0x34')],_0xfa4dc[_0x4262('0x35')]);_0x2a3fe3[_0x4262('0x38')]=_[_0x4262('0x36')](_0xfa4dc[_0x4262('0x34')],qs[_0x4262('0x37')](_0x3d5a35[_0x4262('0x35')]['fields']));_0x2a3fe3[_0x4262('0x38')]=_0x2a3fe3[_0x4262('0x38')]['length']?_0x2a3fe3[_0x4262('0x38')]:_0xfa4dc[_0x4262('0x34')];_0x2a3fe3[_0x4262('0x9d')]=qs[_0x4262('0x3b')](_0x3d5a35[_0x4262('0x35')][_0x4262('0x3b')]);_0x2a3fe3[_0x4262('0x3f')]=qs[_0x4262('0x3d')](_[_0x4262('0x3c')](_0x3d5a35['query'],_0xfa4dc[_0x4262('0x3d')]));if(_0x3d5a35[_0x4262('0x35')][_0x4262('0x3e')]){_0x2a3fe3['where']=_[_0x4262('0x79')](_0x2a3fe3[_0x4262('0x3f')],{'$or':_[_0x4262('0x30')](_0x2a3fe3[_0x4262('0x38')],function(_0xd0e3d1){var _0x408c0d={};_0x408c0d[_0xd0e3d1]={'$like':'%'+_0x3d5a35[_0x4262('0x35')]['filter']+'%'};return _0x408c0d;})});}_0x2a3fe3=_[_0x4262('0x79')]({},_0x2a3fe3,_0x3d5a35['options']);return _0x83cc0a['getAgents'](_0x2a3fe3);}})[_0x4262('0x2a')](function(_0xbe8fb3){if(_0xbe8fb3){_0x1d17eb=_0xbe8fb3[_0x4262('0x39')];if(!_0x3d5a35[_0x4262('0x35')][_0x4262('0x3a')](_0x4262('0x9e'))){_0x2a3fe3['limit']=qs[_0x4262('0x21')](_0x3d5a35[_0x4262('0x35')][_0x4262('0x21')]);_0x2a3fe3[_0x4262('0x1f')]=qs[_0x4262('0x1f')](_0x3d5a35['query'][_0x4262('0x1f')]);}return _0x83cc0a['getAgents'](_0x2a3fe3);}})['then'](function(_0x473b29){if(_0x473b29){return _0x473b29?{'count':_0x1d17eb,'rows':_0x473b29}:null;}})['then'](respondWithResult(_0x37ba4a,null))[_0x4262('0x45')](handleError(_0x37ba4a,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 2d6979a..464f5de 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 _0x60ad=['hook','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60ad,0x133));var _0xd60a=function(_0x6e7e94,_0x3b9414){_0x6e7e94=_0x6e7e94-0x0;var _0x1212e2=_0x60ad[_0x6e7e94];return _0x1212e2;};'use strict';var EventEmitter=require(_0xd60a('0x0'));var Team=require(_0xd60a('0x1'))['db'][_0xd60a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xd60a('0x3')](0x0);var events={'afterCreate':_0xd60a('0x4'),'afterUpdate':_0xd60a('0x5'),'afterDestroy':_0xd60a('0x6')};function emitEvent(_0x1add8b){return function(_0x257ef2,_0x5e0f93,_0x5e2481){TeamEvents[_0xd60a('0x7')](_0x1add8b+':'+_0x257ef2['id'],_0x257ef2);TeamEvents['emit'](_0x1add8b,_0x257ef2);_0x5e2481(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd60a('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x29a1=['remove','emit','hasOwnProperty','events','../../mysqldb','Team','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x29a1,0x199));var _0x129a=function(_0x1d67e6,_0x5c8445){_0x1d67e6=_0x1d67e6-0x0;var _0x4e74d8=_0x29a1[_0x1d67e6];return _0x4e74d8;};'use strict';var EventEmitter=require(_0x129a('0x0'));var Team=require(_0x129a('0x1'))['db'][_0x129a('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x129a('0x3'),'afterUpdate':'update','afterDestroy':_0x129a('0x4')};function emitEvent(_0x1184f3){return function(_0x4989b0,_0x318b59,_0x17c8e7){TeamEvents[_0x129a('0x5')](_0x1184f3+':'+_0x4989b0['id'],_0x4989b0);TeamEvents[_0x129a('0x5')](_0x1184f3,_0x4989b0);_0x17c8e7(null);};}for(var e in events){if(events[_0x129a('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 5e8ca1c..e8aad16 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 _0x8aca=['./team.attributes','define','Team','teams','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2710d4,_0x5097c9){var _0x396ee8=function(_0x2802f2){while(--_0x2802f2){_0x2710d4['push'](_0x2710d4['shift']());}};_0x396ee8(++_0x5097c9);}(_0x8aca,0x100));var _0xa8ac=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8aca[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xa8ac('0x0'));var util=require('util');var logger=require(_0xa8ac('0x1'))(_0xa8ac('0x2'));var moment=require(_0xa8ac('0x3'));var BPromise=require(_0xa8ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8ac('0x5'));var rimraf=require(_0xa8ac('0x6'));var config=require(_0xa8ac('0x7'));var attributes=require(_0xa8ac('0x8'));module['exports']=function(_0x1248c5,_0x2ee54d){return _0x1248c5[_0xa8ac('0x9')](_0xa8ac('0xa'),attributes,{'tableName':_0xa8ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd566=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','teams','lodash','util'];(function(_0x505df7,_0x4d4172){var _0x190166=function(_0xcdcf72){while(--_0xcdcf72){_0x505df7['push'](_0x505df7['shift']());}};_0x190166(++_0x4d4172);}(_0xd566,0x11e));var _0x6d56=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd566[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6d56('0x0'));var util=require(_0x6d56('0x1'));var logger=require(_0x6d56('0x2'))(_0x6d56('0x3'));var moment=require(_0x6d56('0x4'));var BPromise=require('bluebird');var rp=require(_0x6d56('0x5'));var fs=require('fs');var path=require(_0x6d56('0x6'));var rimraf=require(_0x6d56('0x7'));var config=require(_0x6d56('0x8'));var attributes=require('./team.attributes');module[_0x6d56('0x9')]=function(_0x4b7a37,_0x9925a1){return _0x4b7a37[_0x6d56('0xa')]('Team',attributes,{'tableName':_0x6d56('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 b42ea0b..1e734fb 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 _0x4ff1=['request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','Team,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','then','info'];(function(_0x1fa7d8,_0x404a41){var _0x6a3ee5=function(_0x50b6fe){while(--_0x50b6fe){_0x1fa7d8['push'](_0x1fa7d8['shift']());}};_0x6a3ee5(++_0x404a41);}(_0x4ff1,0xf6));var _0x14ff=function(_0x63a69b,_0x296888){_0x63a69b=_0x63a69b-0x0;var _0x425fa1=_0x4ff1[_0x63a69b];return _0x425fa1;};'use strict';var _=require(_0x14ff('0x0'));var util=require('util');var moment=require(_0x14ff('0x1'));var BPromise=require(_0x14ff('0x2'));var rs=require(_0x14ff('0x3'));var fs=require('fs');var Redis=require(_0x14ff('0x4'));var db=require(_0x14ff('0x5'))['db'];var utils=require(_0x14ff('0x6'));var logger=require(_0x14ff('0x7'))(_0x14ff('0x8'));var config=require(_0x14ff('0x9'));var jayson=require(_0x14ff('0xa'));var client=jayson['client'][_0x14ff('0xb')]({'port':0x232a});config[_0x14ff('0xc')]=_['defaults'](config[_0x14ff('0xc')],{'host':_0x14ff('0xd'),'port':0x18eb});var socket=require(_0x14ff('0xe'))(new Redis(config[_0x14ff('0xc')]));require(_0x14ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x3431b6,_0x4c6ee2,_0x39f48b){return new BPromise(function(_0x3190c1,_0x306898){return client['request'](_0x3431b6,_0x39f48b)[_0x14ff('0x10')](function(_0x2e3de5){logger[_0x14ff('0x11')]('Team,\x20%s,\x20%s',_0x4c6ee2,_0x14ff('0x12'));logger[_0x14ff('0x13')](_0x14ff('0x14'),_0x4c6ee2,_0x14ff('0x12'),JSON['stringify'](_0x2e3de5));if(_0x2e3de5['error']){if(_0x2e3de5[_0x14ff('0x15')]['code']===0x1f4){logger[_0x14ff('0x15')](_0x14ff('0x16'),_0x4c6ee2,_0x2e3de5[_0x14ff('0x15')]['message']);return _0x306898(_0x2e3de5[_0x14ff('0x15')][_0x14ff('0x17')]);}logger[_0x14ff('0x15')](_0x14ff('0x16'),_0x4c6ee2,_0x2e3de5[_0x14ff('0x15')][_0x14ff('0x17')]);return _0x3190c1(_0x2e3de5['error']['message']);}else{logger[_0x14ff('0x11')](_0x14ff('0x16'),_0x4c6ee2,'request\x20sent');_0x3190c1(_0x2e3de5['result']['message']);}})['catch'](function(_0x24fbce){logger[_0x14ff('0x15')]('Team,\x20%s,\x20%s',_0x4c6ee2,_0x24fbce);_0x306898(_0x24fbce);});});} \ No newline at end of file +var _0xc903=['request','info','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket'];(function(_0x53d9a7,_0x44c4a3){var _0x1c8958=function(_0x597d99){while(--_0x597d99){_0x53d9a7['push'](_0x53d9a7['shift']());}};_0x1c8958(++_0x44c4a3);}(_0xc903,0x128));var _0x3c90=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0xc903[_0x39cd3c];return _0x47a0ae;};'use strict';var _=require(_0x3c90('0x0'));var util=require(_0x3c90('0x1'));var moment=require(_0x3c90('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c90('0x3'));var fs=require('fs');var Redis=require(_0x3c90('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c90('0x5'));var logger=require(_0x3c90('0x6'))(_0x3c90('0x7'));var config=require(_0x3c90('0x8'));var jayson=require(_0x3c90('0x9'));var client=jayson[_0x3c90('0xa')][_0x3c90('0xb')]({'port':0x232a});config[_0x3c90('0xc')]=_[_0x3c90('0xd')](config[_0x3c90('0xc')],{'host':_0x3c90('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3c90('0xf'))['register'](socket);function respondWithRpcPromise(_0xcfc65b,_0x1dee0f,_0x5bb730){return new BPromise(function(_0x15dc9c,_0x58d16e){return client[_0x3c90('0x10')](_0xcfc65b,_0x5bb730)['then'](function(_0x26e1f3){logger[_0x3c90('0x11')]('Team,\x20%s,\x20%s',_0x1dee0f,'request\x20sent');logger[_0x3c90('0x12')](_0x3c90('0x13'),_0x1dee0f,'request\x20sent',JSON[_0x3c90('0x14')](_0x26e1f3));if(_0x26e1f3[_0x3c90('0x15')]){if(_0x26e1f3[_0x3c90('0x15')][_0x3c90('0x16')]===0x1f4){logger[_0x3c90('0x15')](_0x3c90('0x17'),_0x1dee0f,_0x26e1f3[_0x3c90('0x15')][_0x3c90('0x18')]);return _0x58d16e(_0x26e1f3[_0x3c90('0x15')][_0x3c90('0x18')]);}logger['error']('Team,\x20%s,\x20%s',_0x1dee0f,_0x26e1f3[_0x3c90('0x15')][_0x3c90('0x18')]);return _0x15dc9c(_0x26e1f3[_0x3c90('0x15')][_0x3c90('0x18')]);}else{logger[_0x3c90('0x11')](_0x3c90('0x17'),_0x1dee0f,_0x3c90('0x19'));_0x15dc9c(_0x26e1f3['result'][_0x3c90('0x18')]);}})['catch'](function(_0x515e58){logger['error'](_0x3c90('0x17'),_0x1dee0f,_0x515e58);_0x58d16e(_0x515e58);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0608886..f4c67ab 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 _0x237d=['save','remove','update','emit','removeListener','./team.events'];(function(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0x237d,0x1d9));var _0xd237=function(_0x2abb3b,_0x1308b1){_0x2abb3b=_0x2abb3b-0x0;var _0x543c74=_0x237d[_0x2abb3b];return _0x543c74;};'use strict';var TeamEvents=require(_0xd237('0x0'));var events=[_0xd237('0x1'),_0xd237('0x2'),_0xd237('0x3')];function createListener(_0x4d5e1c,_0x173f47){return function(_0x12d819){_0x173f47[_0xd237('0x4')](_0x4d5e1c,_0x12d819);};}function removeListener(_0x16967d,_0x1de407){return function(){TeamEvents[_0xd237('0x5')](_0x16967d,_0x1de407);};}exports['register']=function(_0x1dfaa5){for(var _0x37e6c0=0x0,_0x5ca6e7=events['length'];_0x37e6c0<_0x5ca6e7;_0x37e6c0++){var _0x5390d7=events[_0x37e6c0];var _0x1df838=createListener('team:'+_0x5390d7,_0x1dfaa5);TeamEvents['on'](_0x5390d7,_0x1df838);}}; \ No newline at end of file +var _0x3e82=['remove','update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x5d59a6,_0x56ec92){var _0x29040d=function(_0x33c7b2){while(--_0x33c7b2){_0x5d59a6['push'](_0x5d59a6['shift']());}};_0x29040d(++_0x56ec92);}(_0x3e82,0x18a));var _0x23e8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e82[_0x40a045];return _0x1a687c;};'use strict';var TeamEvents=require(_0x23e8('0x0'));var events=[_0x23e8('0x1'),_0x23e8('0x2'),_0x23e8('0x3')];function createListener(_0x32cc46,_0x27d25b){return function(_0x20ea7d){_0x27d25b[_0x23e8('0x4')](_0x32cc46,_0x20ea7d);};}function removeListener(_0x37b91e,_0x245546){return function(){TeamEvents[_0x23e8('0x5')](_0x37b91e,_0x245546);};}exports[_0x23e8('0x6')]=function(_0x2da65f){for(var _0x5742ac=0x0,_0x29effc=events[_0x23e8('0x7')];_0x5742ac<_0x29effc;_0x5742ac++){var _0x16a3bb=events[_0x5742ac];var _0x164c59=createListener(_0x23e8('0x8')+_0x16a3bb,_0x2da65f);TeamEvents['on'](_0x16a3bb,_0x164c59);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 2a5ea10..c9c4b0a 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 _0xa663=['INTEGER','sequelize','exports'];(function(_0x5231c6,_0xe7d50e){var _0x209ad9=function(_0x40871c){while(--_0x40871c){_0x5231c6['push'](_0x5231c6['shift']());}};_0x209ad9(++_0xe7d50e);}(_0xa663,0xc7));var _0x3a66=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0xa663[_0x5ad771];return _0x5b5dce;};'use strict';var Sequelize=require(_0x3a66('0x0'));module[_0x3a66('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x3a66('0x2')]}}; \ No newline at end of file +var _0x16d2=['sequelize','exports','INTEGER'];(function(_0x86e101,_0x37a431){var _0x14f3d6=function(_0x273bd8){while(--_0x273bd8){_0x86e101['push'](_0x86e101['shift']());}};_0x14f3d6(++_0x37a431);}(_0x16d2,0x123));var _0x216d=function(_0x5b6a86,_0x59489c){_0x5b6a86=_0x5b6a86-0x0;var _0x425888=_0x16d2[_0x5b6a86];return _0x425888;};'use strict';var Sequelize=require(_0x216d('0x0'));module[_0x216d('0x1')]={'TeamId':{'type':Sequelize[_0x216d('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x216d('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 2dbf18d..e14f8ea 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 _0x8721=['bluebird','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger'];(function(_0x1f9ee0,_0x2152a2){var _0x4274b5=function(_0x4c72bd){while(--_0x4c72bd){_0x1f9ee0['push'](_0x1f9ee0['shift']());}};_0x4274b5(++_0x2152a2);}(_0x8721,0xd9));var _0x1872=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x8721[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0x1872('0x0'));var util=require(_0x1872('0x1'));var logger=require(_0x1872('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1872('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1872('0x4'));var attributes=require(_0x1872('0x5'));module[_0x1872('0x6')]=function(_0x47ca3a,_0x4befaf){return _0x47ca3a[_0x1872('0x7')](_0x1872('0x8'),attributes,{'tableName':_0x1872('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc15c=['../../config/logger','api','moment','request-promise','../../config/environment','team_has_voice_prefixes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc15c,0xae));var _0xcc15=function(_0xcb84ab,_0x1a3dda){_0xcb84ab=_0xcb84ab-0x0;var _0x4cb5ac=_0xc15c[_0xcb84ab];return _0x4cb5ac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcc15('0x0'))(_0xcc15('0x1'));var moment=require(_0xcc15('0x2'));var BPromise=require('bluebird');var rp=require(_0xcc15('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc15('0x4'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x11ae7e,_0x15135d){return _0x11ae7e['define']('TeamVoicePrefix',attributes,{'tableName':_0xcc15('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b63cef4..173102d 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x178015,_0x4bcd41){var _0x5ef3c5=function(_0x17c930){while(--_0x17c930){_0x178015['push'](_0x178015['shift']());}};_0x5ef3c5(++_0x4bcd41);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x372802,_0xee7bdb){var _0x11986c=function(_0x2a395f){while(--_0x2a395f){_0x372802['push'](_0x372802['shift']());}};_0x11986c(++_0xee7bdb);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index fc828b9..e29b415 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 _0xe1bc=['exports','INTEGER'];(function(_0xd3b8cc,_0x58b6fe){var _0x3b2d31=function(_0x405031){while(--_0x405031){_0xd3b8cc['push'](_0xd3b8cc['shift']());}};_0x3b2d31(++_0x58b6fe);}(_0xe1bc,0xf4));var _0xce1b=function(_0x408fa0,_0x55b6a7){_0x408fa0=_0x408fa0-0x0;var _0x3235a2=_0xe1bc[_0x408fa0];return _0x3235a2;};'use strict';var Sequelize=require('sequelize');module[_0xce1b('0x0')]={'penalty':{'type':Sequelize[_0xce1b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa1a6=['exports','INTEGER','sequelize'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xa1a6,0x10d));var _0x6a1a=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0xa1a6[_0x1e17eb];return _0x4de4c7;};'use strict';var Sequelize=require(_0x6a1a('0x0'));module[_0x6a1a('0x1')]={'penalty':{'type':Sequelize[_0x6a1a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 9c125f4..d2c0dbd 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 _0xea89=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./teamVoiceQueue.attributes','exports','define'];(function(_0x3dea20,_0x1e8e02){var _0x47f0a7=function(_0x519bb9){while(--_0x519bb9){_0x3dea20['push'](_0x3dea20['shift']());}};_0x47f0a7(++_0x1e8e02);}(_0xea89,0x1e2));var _0x9ea8=function(_0x57160c,_0x3cf2c3){_0x57160c=_0x57160c-0x0;var _0x5682d8=_0xea89[_0x57160c];return _0x5682d8;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var logger=require(_0x9ea8('0x2'))(_0x9ea8('0x3'));var moment=require(_0x9ea8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ea8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ea8('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ea8('0x7'));module[_0x9ea8('0x8')]=function(_0x2c6e50,_0x184f38){return _0x2c6e50[_0x9ea8('0x9')](_0x9ea8('0xa'),attributes,{'tableName':_0x9ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b2a=['path','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b2a,0x127));var _0xa9b2=function(_0x208989,_0x3e5476){_0x208989=_0x208989-0x0;var _0x500e38=_0x9b2a[_0x208989];return _0x500e38;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var logger=require(_0xa9b2('0x1'))(_0xa9b2('0x2'));var moment=require(_0xa9b2('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9b2('0x4'));var fs=require('fs');var path=require(_0xa9b2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9b2('0x6'));module[_0xa9b2('0x7')]=function(_0x181a8f,_0xd7801e){return _0x181a8f['define'](_0xa9b2('0x8'),attributes,{'tableName':_0xa9b2('0x9'),'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 3f5182e..ae45c2c 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 _0xfb92=['client','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x50424f,_0x50aa88){var _0xd5e2de=function(_0x31dc63){while(--_0x31dc63){_0x50424f['push'](_0x50424f['shift']());}};_0xd5e2de(++_0x50aa88);}(_0xfb92,0x1e3));var _0x2fb9=function(_0x32bc9b,_0xe08042){_0x32bc9b=_0x32bc9b-0x0;var _0x2ed308=_0xfb92[_0x32bc9b];return _0x2ed308;};'use strict';var _=require(_0x2fb9('0x0'));var util=require('util');var moment=require(_0x2fb9('0x1'));var BPromise=require(_0x2fb9('0x2'));var rs=require(_0x2fb9('0x3'));var fs=require('fs');var Redis=require(_0x2fb9('0x4'));var db=require(_0x2fb9('0x5'))['db'];var utils=require(_0x2fb9('0x6'));var logger=require(_0x2fb9('0x7'))(_0x2fb9('0x8'));var config=require(_0x2fb9('0x9'));var jayson=require(_0x2fb9('0xa'));var client=jayson[_0x2fb9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5087b2,_0x5399f7,_0x21a33b){return new BPromise(function(_0x24651f,_0x35057b){return client['request'](_0x5087b2,_0x21a33b)['then'](function(_0x44c896){logger[_0x2fb9('0xc')](_0x2fb9('0xd'),_0x5399f7,_0x2fb9('0xe'));logger['debug'](_0x2fb9('0xf'),_0x5399f7,'request\x20sent',JSON['stringify'](_0x44c896));if(_0x44c896['error']){if(_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x11')]===0x1f4){logger[_0x2fb9('0x10')](_0x2fb9('0xd'),_0x5399f7,_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x12')]);return _0x35057b(_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x12')]);}logger[_0x2fb9('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5399f7,_0x44c896[_0x2fb9('0x10')][_0x2fb9('0x12')]);return _0x24651f(_0x44c896[_0x2fb9('0x10')]['message']);}else{logger[_0x2fb9('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5399f7,'request\x20sent');_0x24651f(_0x44c896['result'][_0x2fb9('0x12')]);}})['catch'](function(_0x511cb9){logger['error'](_0x2fb9('0xd'),_0x5399f7,_0x511cb9);_0x35057b(_0x511cb9);});});} \ No newline at end of file +var _0x2242=['code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x817c1,_0x22e891){var _0x3e1282=function(_0x44049a){while(--_0x44049a){_0x817c1['push'](_0x817c1['shift']());}};_0x3e1282(++_0x22e891);}(_0x2242,0x1a3));var _0x2224=function(_0x1bed1a,_0x383eaf){_0x1bed1a=_0x1bed1a-0x0;var _0x10b373=_0x2242[_0x1bed1a];return _0x10b373;};'use strict';var _=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var moment=require(_0x2224('0x2'));var BPromise=require('bluebird');var rs=require(_0x2224('0x3'));var fs=require('fs');var Redis=require(_0x2224('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2224('0x5'));var logger=require(_0x2224('0x6'))('rpc');var config=require(_0x2224('0x7'));var jayson=require(_0x2224('0x8'));var client=jayson[_0x2224('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28833b,_0x16893c,_0x35f807){return new BPromise(function(_0x25c6d4,_0x18149e){return client[_0x2224('0xa')](_0x28833b,_0x35f807)[_0x2224('0xb')](function(_0x147bd7){logger[_0x2224('0xc')](_0x2224('0xd'),_0x16893c,_0x2224('0xe'));logger[_0x2224('0xf')](_0x2224('0x10'),_0x16893c,_0x2224('0xe'),JSON[_0x2224('0x11')](_0x147bd7));if(_0x147bd7['error']){if(_0x147bd7['error'][_0x2224('0x12')]===0x1f4){logger[_0x2224('0x13')](_0x2224('0xd'),_0x16893c,_0x147bd7[_0x2224('0x13')]['message']);return _0x18149e(_0x147bd7[_0x2224('0x13')][_0x2224('0x14')]);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x16893c,_0x147bd7[_0x2224('0x13')][_0x2224('0x14')]);return _0x25c6d4(_0x147bd7['error']['message']);}else{logger[_0x2224('0xc')](_0x2224('0xd'),_0x16893c,_0x2224('0xe'));_0x25c6d4(_0x147bd7[_0x2224('0x15')][_0x2224('0x14')]);}})[_0x2224('0x16')](function(_0x34d045){logger[_0x2224('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x16893c,_0x34d045);_0x18149e(_0x34d045);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index acd404f..de9c9d5 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 _0x414f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','multer','path','connect-timeout','Router','fs-extra'];(function(_0xa2cd61,_0x5cee7a){var _0x16f0ed=function(_0xce30c8){while(--_0xce30c8){_0xa2cd61['push'](_0xa2cd61['shift']());}};_0x16f0ed(++_0x5cee7a);}(_0x414f,0x13f));var _0xf414=function(_0x4c00a3,_0x2d23e2){_0x4c00a3=_0x4c00a3-0x0;var _0x893854=_0x414f[_0x4c00a3];return _0x893854;};'use strict';var multer=require(_0xf414('0x0'));var util=require('util');var path=require(_0xf414('0x1'));var timeout=require(_0xf414('0x2'));var express=require('express');var router=express[_0xf414('0x3')]();var fs_extra=require(_0xf414('0x4'));var auth=require(_0xf414('0x5'));var interaction=require(_0xf414('0x6'));var config=require(_0xf414('0x7'));var controller=require(_0xf414('0x8'));router[_0xf414('0x9')]('/',auth['isAuthenticated'](),controller[_0xf414('0xa')]);router['get'](_0xf414('0xb'),auth[_0xf414('0xc')](),controller[_0xf414('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf414('0xe')]);router[_0xf414('0xf')](_0xf414('0xb'),auth[_0xf414('0xc')](),controller[_0xf414('0x10')]);router[_0xf414('0x11')](_0xf414('0xb'),auth[_0xf414('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc2a2=['create','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','post'];(function(_0x576063,_0x49fdbd){var _0x44aa77=function(_0x3e57fe){while(--_0x3e57fe){_0x576063['push'](_0x576063['shift']());}};_0x44aa77(++_0x49fdbd);}(_0xc2a2,0x84));var _0x2c2a=function(_0x28defb,_0x293b77){_0x28defb=_0x28defb-0x0;var _0x56d863=_0xc2a2[_0x28defb];return _0x56d863;};'use strict';var multer=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var path=require(_0x2c2a('0x2'));var timeout=require(_0x2c2a('0x3'));var express=require('express');var router=express[_0x2c2a('0x4')]();var fs_extra=require(_0x2c2a('0x5'));var auth=require(_0x2c2a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c2a('0x7'));var controller=require(_0x2c2a('0x8'));router[_0x2c2a('0x9')]('/',auth[_0x2c2a('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2c2a('0xb')]('/',auth['isAuthenticated'](),controller[_0x2c2a('0xc')]);router['put'](_0x2c2a('0xd'),auth[_0x2c2a('0xa')](),controller[_0x2c2a('0xe')]);router[_0x2c2a('0xf')](_0x2c2a('0xd'),auth[_0x2c2a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index eb875ee..9a269ea 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 _0xe7b7=['TEXT','sequelize','exports','STRING'];(function(_0x2a90f2,_0x4dcd95){var _0x3799f3=function(_0x86472b){while(--_0x86472b){_0x2a90f2['push'](_0x2a90f2['shift']());}};_0x3799f3(++_0x4dcd95);}(_0xe7b7,0x1c9));var _0x7e7b=function(_0x575a40,_0x1ade64){_0x575a40=_0x575a40-0x0;var _0x3404a3=_0xe7b7[_0x575a40];return _0x3404a3;};'use strict';var Sequelize=require(_0x7e7b('0x0'));module[_0x7e7b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7e7b('0x2')]},'html':{'type':Sequelize[_0x7e7b('0x3')]}}; \ No newline at end of file +var _0x4367=['sequelize','exports','STRING','TEXT'];(function(_0x54d52c,_0x55b8d9){var _0x28f99e=function(_0x4e9ef1){while(--_0x4e9ef1){_0x54d52c['push'](_0x54d52c['shift']());}};_0x28f99e(++_0x55b8d9);}(_0x4367,0xac));var _0x7436=function(_0x32017e,_0x546c4c){_0x32017e=_0x32017e-0x0;var _0x19981c=_0x4367[_0x32017e];return _0x19981c;};'use strict';var Sequelize=require(_0x7436('0x0'));module[_0x7436('0x1')]={'name':{'type':Sequelize[_0x7436('0x2')]},'description':{'type':Sequelize[_0x7436('0x2')]},'html':{'type':Sequelize[_0x7436('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index c7ee4ed..5ee22a0 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 _0xb897=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','Templates','UserProfileResource','then','error','name','send','index','map','Template','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','rows','catch','params','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x301593,_0x14d1df){var _0x2efb3f=function(_0x59c569){while(--_0x59c569){_0x301593['push'](_0x301593['shift']());}};_0x2efb3f(++_0x14d1df);}(_0xb897,0xfe));var _0x7b89=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xb897[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x7b89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b89('0x1'));var jsonpatch=require(_0x7b89('0x2'));var rp=require(_0x7b89('0x3'));var moment=require('moment');var BPromise=require(_0x7b89('0x4'));var Mustache=require(_0x7b89('0x5'));var util=require(_0x7b89('0x6'));var path=require(_0x7b89('0x7'));var sox=require(_0x7b89('0x8'));var csv=require(_0x7b89('0x9'));var ejs=require(_0x7b89('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b89('0xb'));var squel=require(_0x7b89('0xc'));var crypto=require(_0x7b89('0xd'));var jsforce=require(_0x7b89('0xe'));var deskjs=require(_0x7b89('0xf'));var toCsv=require(_0x7b89('0x9'));var querystring=require(_0x7b89('0x10'));var Papa=require(_0x7b89('0x11'));var Redis=require('ioredis');var authService=require(_0x7b89('0x12'));var qs=require(_0x7b89('0x13'));var as=require(_0x7b89('0x14'));var hardwareService=require(_0x7b89('0x15'));var logger=require(_0x7b89('0x16'))(_0x7b89('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b89('0x18'));var db=require(_0x7b89('0x19'))['db'];function respondWithStatusCode(_0x247b62,_0x41fa4d){_0x41fa4d=_0x41fa4d||0xcc;return function(_0x17865d){if(_0x17865d){return _0x247b62['sendStatus'](_0x41fa4d);}return _0x247b62[_0x7b89('0x1a')](_0x41fa4d)[_0x7b89('0x1b')]();};}function respondWithResult(_0x24bbd3,_0x4fe754){_0x4fe754=_0x4fe754||0xc8;return function(_0x1c0381){if(_0x1c0381){return _0x24bbd3[_0x7b89('0x1a')](_0x4fe754)[_0x7b89('0x1c')](_0x1c0381);}};}function respondWithFilteredResult(_0x38b58a,_0x4db766){return function(_0x1bb61d){if(_0x1bb61d){var _0x366c24=typeof _0x4db766[_0x7b89('0x1d')]==='undefined'&&typeof _0x4db766[_0x7b89('0x1e')]===_0x7b89('0x1f');var _0x50c278=_0x1bb61d[_0x7b89('0x20')];var _0x1b4906=_0x366c24?0x0:_0x4db766[_0x7b89('0x1d')];var _0x58b57e=_0x366c24?_0x1bb61d['count']:_0x4db766[_0x7b89('0x1d')]+_0x4db766[_0x7b89('0x1e')];var _0x4fdb3a;if(_0x58b57e>=_0x50c278){_0x58b57e=_0x50c278;_0x4fdb3a=0xc8;}else{_0x4fdb3a=0xce;}_0x38b58a[_0x7b89('0x1a')](_0x4fdb3a);return _0x38b58a[_0x7b89('0x21')](_0x7b89('0x22'),_0x1b4906+'-'+_0x58b57e+'/'+_0x50c278)[_0x7b89('0x1c')](_0x1bb61d);}return null;};}function patchUpdates(_0x65b5d7){return function(_0x2ab979){try{jsonpatch[_0x7b89('0x23')](_0x2ab979,_0x65b5d7,!![]);}catch(_0x5e58d3){return BPromise[_0x7b89('0x24')](_0x5e58d3);}return _0x2ab979[_0x7b89('0x25')]();};}function saveUpdates(_0x4a4c04,_0x55b5b6){return function(_0x36d34b){if(_0x36d34b){return _0x36d34b[_0x7b89('0x26')](_0x4a4c04)['then'](function(_0x3028c6){return _0x3028c6;});}return null;};}function removeEntity(_0x59cc34,_0x24b740){return function(_0x1da0a0){if(_0x1da0a0){return _0x1da0a0[_0x7b89('0x27')]()['then'](function(){var _0x268f55=_0x1da0a0[_0x7b89('0x28')]({'plain':!![]});var _0x4455b6=_0x7b89('0x29');return db[_0x7b89('0x2a')][_0x7b89('0x27')]({'where':{'type':_0x4455b6,'resourceId':_0x268f55['id']}})[_0x7b89('0x2b')](function(){return _0x1da0a0;});})[_0x7b89('0x2b')](function(){_0x59cc34[_0x7b89('0x1a')](0xcc)[_0x7b89('0x1b')]();});}};}function handleEntityNotFound(_0x3d7609,_0xd5b0ce){return function(_0x11788a){if(!_0x11788a){_0x3d7609['sendStatus'](0x194);}return _0x11788a;};}function handleError(_0x7fb88e,_0x1a3be1){_0x1a3be1=_0x1a3be1||0x1f4;return function(_0x2ede9c){logger[_0x7b89('0x2c')](_0x2ede9c['stack']);if(_0x2ede9c[_0x7b89('0x2d')]){delete _0x2ede9c[_0x7b89('0x2d')];}_0x7fb88e[_0x7b89('0x1a')](_0x1a3be1)[_0x7b89('0x2e')](_0x2ede9c);};}exports[_0x7b89('0x2f')]=function(_0x40462d,_0x13f943){var _0x198f17={},_0x6c316e={},_0x3dbda6={'count':0x0,'rows':[]};var _0x1537da=_[_0x7b89('0x30')](db[_0x7b89('0x31')]['rawAttributes'],function(_0x1e5c64){return{'name':_0x1e5c64[_0x7b89('0x32')],'type':_0x1e5c64['type'][_0x7b89('0x33')]};});_0x6c316e[_0x7b89('0x34')]=_[_0x7b89('0x30')](_0x1537da,_0x7b89('0x2d'));_0x6c316e['query']=_[_0x7b89('0x35')](_0x40462d[_0x7b89('0x36')]);_0x6c316e[_0x7b89('0x37')]=_['intersection'](_0x6c316e[_0x7b89('0x34')],_0x6c316e['query']);_0x198f17[_0x7b89('0x38')]=_['intersection'](_0x6c316e['model'],qs['fields'](_0x40462d[_0x7b89('0x36')][_0x7b89('0x39')]));_0x198f17[_0x7b89('0x38')]=_0x198f17[_0x7b89('0x38')][_0x7b89('0x3a')]?_0x198f17[_0x7b89('0x38')]:_0x6c316e[_0x7b89('0x34')];if(!_0x40462d['query'][_0x7b89('0x3b')]('nolimit')){_0x198f17[_0x7b89('0x1e')]=qs[_0x7b89('0x1e')](_0x40462d[_0x7b89('0x36')][_0x7b89('0x1e')]);_0x198f17[_0x7b89('0x1d')]=qs[_0x7b89('0x1d')](_0x40462d[_0x7b89('0x36')][_0x7b89('0x1d')]);}_0x198f17[_0x7b89('0x3c')]=qs[_0x7b89('0x3d')](_0x40462d['query'][_0x7b89('0x3d')]);_0x198f17[_0x7b89('0x3e')]=qs[_0x7b89('0x37')](_['pick'](_0x40462d[_0x7b89('0x36')],_0x6c316e[_0x7b89('0x37')]),_0x1537da);if(_0x40462d[_0x7b89('0x36')][_0x7b89('0x3f')]){_0x198f17['where']=_[_0x7b89('0x40')](_0x198f17[_0x7b89('0x3e')],{'$or':_[_0x7b89('0x30')](_0x1537da,function(_0x4c0be0){if(_0x4c0be0[_0x7b89('0x41')]!==_0x7b89('0x42')){var _0x5371b3={};_0x5371b3[_0x4c0be0['name']]={'$like':'%'+_0x40462d['query'][_0x7b89('0x3f')]+'%'};return _0x5371b3;}})});}_0x198f17=_[_0x7b89('0x40')]({},_0x198f17,_0x40462d[_0x7b89('0x43')]);var _0x20c2e2={'where':_0x198f17['where']};return db[_0x7b89('0x31')][_0x7b89('0x20')](_0x20c2e2)[_0x7b89('0x2b')](function(_0xb72dc0){_0x3dbda6[_0x7b89('0x20')]=_0xb72dc0;if(_0x40462d[_0x7b89('0x36')]['includeAll']){_0x198f17['include']=[{'all':!![]}];}return db[_0x7b89('0x31')]['findAll'](_0x198f17);})[_0x7b89('0x2b')](function(_0x2a7fba){_0x3dbda6[_0x7b89('0x44')]=_0x2a7fba;return _0x3dbda6;})['then'](respondWithFilteredResult(_0x13f943,_0x198f17))[_0x7b89('0x45')](handleError(_0x13f943,null));};exports['show']=function(_0x39e631,_0x1f4efe){var _0xdef5df={'raw':!![],'where':{'id':_0x39e631[_0x7b89('0x46')]['id']}},_0x1abe14={};_0x1abe14['model']=_[_0x7b89('0x35')](db['Template'][_0x7b89('0x47')]);_0x1abe14[_0x7b89('0x36')]=_[_0x7b89('0x35')](_0x39e631[_0x7b89('0x36')]);_0x1abe14[_0x7b89('0x37')]=_[_0x7b89('0x48')](_0x1abe14[_0x7b89('0x34')],_0x1abe14[_0x7b89('0x36')]);_0xdef5df['attributes']=_[_0x7b89('0x48')](_0x1abe14[_0x7b89('0x34')],qs[_0x7b89('0x39')](_0x39e631[_0x7b89('0x36')]['fields']));_0xdef5df['attributes']=_0xdef5df[_0x7b89('0x38')][_0x7b89('0x3a')]?_0xdef5df[_0x7b89('0x38')]:_0x1abe14['model'];if(_0x39e631[_0x7b89('0x36')]['includeAll']){_0xdef5df['include']=[{'all':!![]}];}_0xdef5df=_[_0x7b89('0x40')]({},_0xdef5df,_0x39e631[_0x7b89('0x43')]);return db[_0x7b89('0x31')][_0x7b89('0x49')](_0xdef5df)[_0x7b89('0x2b')](handleEntityNotFound(_0x1f4efe,null))[_0x7b89('0x2b')](respondWithResult(_0x1f4efe,null))['catch'](handleError(_0x1f4efe,null));};exports[_0x7b89('0x4a')]=function(_0x2d34dc,_0xaacee3){return db['Template']['create'](_0x2d34dc[_0x7b89('0x4b')],{})['then'](function(_0x406564){var _0x44b82c=_0x2d34dc[_0x7b89('0x4c')]['get']({'plain':!![]});if(!_0x44b82c)throw new Error(_0x7b89('0x4d'));if(_0x44b82c[_0x7b89('0x4e')]===_0x7b89('0x4c')){var _0x143516=_0x406564['get']({'plain':!![]});var _0x52edc6=_0x7b89('0x29');return db[_0x7b89('0x4f')]['find']({'where':{'name':_0x52edc6,'userProfileId':_0x44b82c[_0x7b89('0x50')]},'raw':!![]})[_0x7b89('0x2b')](function(_0xa0aa2a){if(_0xa0aa2a&&_0xa0aa2a[_0x7b89('0x51')]===0x0){return db[_0x7b89('0x2a')][_0x7b89('0x4a')]({'name':_0x143516[_0x7b89('0x2d')],'resourceId':_0x143516['id'],'type':_0xa0aa2a[_0x7b89('0x2d')],'sectionId':_0xa0aa2a['id']},{})[_0x7b89('0x2b')](function(){return _0x406564;});}else{return _0x406564;}})['catch'](function(_0xeae356){logger[_0x7b89('0x2c')](_0x7b89('0x52'),_0xeae356);throw _0xeae356;});}return _0x406564;})[_0x7b89('0x2b')](respondWithResult(_0xaacee3,0xc9))['catch'](handleError(_0xaacee3,null));};exports[_0x7b89('0x26')]=function(_0x49fe93,_0x3bde48){if(_0x49fe93[_0x7b89('0x4b')]['id']){delete _0x49fe93['body']['id'];}return db[_0x7b89('0x31')]['find']({'where':{'id':_0x49fe93['params']['id']}})['then'](handleEntityNotFound(_0x3bde48,null))[_0x7b89('0x2b')](saveUpdates(_0x49fe93[_0x7b89('0x4b')],null))[_0x7b89('0x2b')](respondWithResult(_0x3bde48,null))['catch'](handleError(_0x3bde48,null));};exports[_0x7b89('0x27')]=function(_0xb374ef,_0x22b6d5){return db[_0x7b89('0x31')]['find']({'where':{'id':_0xb374ef[_0x7b89('0x46')]['id']}})[_0x7b89('0x2b')](handleEntityNotFound(_0x22b6d5,null))[_0x7b89('0x2b')](removeEntity(_0x22b6d5,null))[_0x7b89('0x45')](handleError(_0x22b6d5,null));}; \ No newline at end of file +var _0x14a0=['get','Templates','UserProfileResource','stack','name','send','Template','rawAttributes','fieldName','type','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy'];(function(_0x265e69,_0x426159){var _0x505b43=function(_0x16ba15){while(--_0x16ba15){_0x265e69['push'](_0x265e69['shift']());}};_0x505b43(++_0x426159);}(_0x14a0,0x1b7));var _0x014a=function(_0x380e21,_0x5f5032){_0x380e21=_0x380e21-0x0;var _0x27e052=_0x14a0[_0x380e21];return _0x27e052;};'use strict';var emlformat=require(_0x014a('0x0'));var rimraf=require(_0x014a('0x1'));var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x014a('0x4'));var Mustache=require('mustache');var util=require(_0x014a('0x5'));var path=require(_0x014a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x014a('0x7'));var fs=require('fs');var fs_extra=require(_0x014a('0x8'));var _=require('lodash');var squel=require(_0x014a('0x9'));var crypto=require(_0x014a('0xa'));var jsforce=require(_0x014a('0xb'));var deskjs=require(_0x014a('0xc'));var toCsv=require(_0x014a('0xd'));var querystring=require('querystring');var Papa=require(_0x014a('0xe'));var Redis=require(_0x014a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x014a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x014a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x014a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];function respondWithStatusCode(_0x304474,_0x4cc910){_0x4cc910=_0x4cc910||0xcc;return function(_0x2806d0){if(_0x2806d0){return _0x304474[_0x014a('0x15')](_0x4cc910);}return _0x304474[_0x014a('0x16')](_0x4cc910)[_0x014a('0x17')]();};}function respondWithResult(_0x497801,_0xcd573b){_0xcd573b=_0xcd573b||0xc8;return function(_0x25deb8){if(_0x25deb8){return _0x497801[_0x014a('0x16')](_0xcd573b)[_0x014a('0x18')](_0x25deb8);}};}function respondWithFilteredResult(_0x27302e,_0x289172){return function(_0x3f9a52){if(_0x3f9a52){var _0x709736=typeof _0x289172[_0x014a('0x19')]===_0x014a('0x1a')&&typeof _0x289172[_0x014a('0x1b')]===_0x014a('0x1a');var _0x497e8c=_0x3f9a52[_0x014a('0x1c')];var _0x41316d=_0x709736?0x0:_0x289172[_0x014a('0x19')];var _0x469fc5=_0x709736?_0x3f9a52[_0x014a('0x1c')]:_0x289172[_0x014a('0x19')]+_0x289172[_0x014a('0x1b')];var _0x5711d5;if(_0x469fc5>=_0x497e8c){_0x469fc5=_0x497e8c;_0x5711d5=0xc8;}else{_0x5711d5=0xce;}_0x27302e[_0x014a('0x16')](_0x5711d5);return _0x27302e[_0x014a('0x1d')](_0x014a('0x1e'),_0x41316d+'-'+_0x469fc5+'/'+_0x497e8c)['json'](_0x3f9a52);}return null;};}function patchUpdates(_0x1ab80b){return function(_0x3045ca){try{jsonpatch[_0x014a('0x1f')](_0x3045ca,_0x1ab80b,!![]);}catch(_0x4dfd30){return BPromise['reject'](_0x4dfd30);}return _0x3045ca[_0x014a('0x20')]();};}function saveUpdates(_0x48c4c7,_0x4a7141){return function(_0x3c8580){if(_0x3c8580){return _0x3c8580['update'](_0x48c4c7)[_0x014a('0x21')](function(_0x121e3c){return _0x121e3c;});}return null;};}function removeEntity(_0x4d146b,_0x583935){return function(_0x316b6f){if(_0x316b6f){return _0x316b6f[_0x014a('0x22')]()['then'](function(){var _0x3439c2=_0x316b6f[_0x014a('0x23')]({'plain':!![]});var _0x54e432=_0x014a('0x24');return db[_0x014a('0x25')][_0x014a('0x22')]({'where':{'type':_0x54e432,'resourceId':_0x3439c2['id']}})[_0x014a('0x21')](function(){return _0x316b6f;});})[_0x014a('0x21')](function(){_0x4d146b[_0x014a('0x16')](0xcc)[_0x014a('0x17')]();});}};}function handleEntityNotFound(_0x26bc8f,_0x4f1a85){return function(_0x4dac48){if(!_0x4dac48){_0x26bc8f['sendStatus'](0x194);}return _0x4dac48;};}function handleError(_0x1d2ecf,_0x771882){_0x771882=_0x771882||0x1f4;return function(_0x562e0e){logger['error'](_0x562e0e[_0x014a('0x26')]);if(_0x562e0e['name']){delete _0x562e0e[_0x014a('0x27')];}_0x1d2ecf[_0x014a('0x16')](_0x771882)[_0x014a('0x28')](_0x562e0e);};}exports['index']=function(_0x53435e,_0x5d5ec5){var _0x117cb1={},_0x351d4d={},_0x4104db={'count':0x0,'rows':[]};var _0x78394b=_['map'](db[_0x014a('0x29')][_0x014a('0x2a')],function(_0x5b8044){return{'name':_0x5b8044[_0x014a('0x2b')],'type':_0x5b8044[_0x014a('0x2c')]['key']};});_0x351d4d[_0x014a('0x2d')]=_[_0x014a('0x2e')](_0x78394b,_0x014a('0x27'));_0x351d4d['query']=_[_0x014a('0x2f')](_0x53435e[_0x014a('0x30')]);_0x351d4d['filters']=_[_0x014a('0x31')](_0x351d4d['model'],_0x351d4d['query']);_0x117cb1['attributes']=_['intersection'](_0x351d4d[_0x014a('0x2d')],qs[_0x014a('0x32')](_0x53435e[_0x014a('0x30')][_0x014a('0x32')]));_0x117cb1[_0x014a('0x33')]=_0x117cb1[_0x014a('0x33')]['length']?_0x117cb1[_0x014a('0x33')]:_0x351d4d[_0x014a('0x2d')];if(!_0x53435e['query'][_0x014a('0x34')]('nolimit')){_0x117cb1[_0x014a('0x1b')]=qs[_0x014a('0x1b')](_0x53435e[_0x014a('0x30')][_0x014a('0x1b')]);_0x117cb1[_0x014a('0x19')]=qs['offset'](_0x53435e[_0x014a('0x30')][_0x014a('0x19')]);}_0x117cb1[_0x014a('0x35')]=qs[_0x014a('0x36')](_0x53435e[_0x014a('0x30')][_0x014a('0x36')]);_0x117cb1[_0x014a('0x37')]=qs[_0x014a('0x38')](_[_0x014a('0x39')](_0x53435e[_0x014a('0x30')],_0x351d4d[_0x014a('0x38')]),_0x78394b);if(_0x53435e['query'][_0x014a('0x3a')]){_0x117cb1[_0x014a('0x37')]=_[_0x014a('0x3b')](_0x117cb1['where'],{'$or':_[_0x014a('0x2e')](_0x78394b,function(_0x3a4601){if(_0x3a4601['type']!==_0x014a('0x3c')){var _0x30c5a0={};_0x30c5a0[_0x3a4601[_0x014a('0x27')]]={'$like':'%'+_0x53435e['query'][_0x014a('0x3a')]+'%'};return _0x30c5a0;}})});}_0x117cb1=_['merge']({},_0x117cb1,_0x53435e[_0x014a('0x3d')]);var _0x45a06f={'where':_0x117cb1[_0x014a('0x37')]};return db[_0x014a('0x29')][_0x014a('0x1c')](_0x45a06f)['then'](function(_0xf51d10){_0x4104db[_0x014a('0x1c')]=_0xf51d10;if(_0x53435e['query']['includeAll']){_0x117cb1[_0x014a('0x3e')]=[{'all':!![]}];}return db[_0x014a('0x29')][_0x014a('0x3f')](_0x117cb1);})[_0x014a('0x21')](function(_0x5bc555){_0x4104db[_0x014a('0x40')]=_0x5bc555;return _0x4104db;})['then'](respondWithFilteredResult(_0x5d5ec5,_0x117cb1))[_0x014a('0x41')](handleError(_0x5d5ec5,null));};exports['show']=function(_0x4aa4f6,_0x11592b){var _0x2143c1={'raw':!![],'where':{'id':_0x4aa4f6['params']['id']}},_0x40bd71={};_0x40bd71['model']=_[_0x014a('0x2f')](db['Template'][_0x014a('0x2a')]);_0x40bd71['query']=_[_0x014a('0x2f')](_0x4aa4f6[_0x014a('0x30')]);_0x40bd71[_0x014a('0x38')]=_[_0x014a('0x31')](_0x40bd71['model'],_0x40bd71[_0x014a('0x30')]);_0x2143c1[_0x014a('0x33')]=_['intersection'](_0x40bd71[_0x014a('0x2d')],qs[_0x014a('0x32')](_0x4aa4f6[_0x014a('0x30')][_0x014a('0x32')]));_0x2143c1[_0x014a('0x33')]=_0x2143c1[_0x014a('0x33')][_0x014a('0x42')]?_0x2143c1[_0x014a('0x33')]:_0x40bd71['model'];if(_0x4aa4f6[_0x014a('0x30')][_0x014a('0x43')]){_0x2143c1[_0x014a('0x3e')]=[{'all':!![]}];}_0x2143c1=_[_0x014a('0x3b')]({},_0x2143c1,_0x4aa4f6[_0x014a('0x3d')]);return db[_0x014a('0x29')][_0x014a('0x44')](_0x2143c1)['then'](handleEntityNotFound(_0x11592b,null))[_0x014a('0x21')](respondWithResult(_0x11592b,null))[_0x014a('0x41')](handleError(_0x11592b,null));};exports[_0x014a('0x45')]=function(_0x487944,_0x432e43){return db[_0x014a('0x29')][_0x014a('0x45')](_0x487944[_0x014a('0x46')],{})[_0x014a('0x21')](function(_0x229568){var _0x375f0c=_0x487944[_0x014a('0x47')]['get']({'plain':!![]});if(!_0x375f0c)throw new Error(_0x014a('0x48'));if(_0x375f0c[_0x014a('0x49')]===_0x014a('0x47')){var _0x323cf4=_0x229568['get']({'plain':!![]});var _0x54f624='Templates';return db[_0x014a('0x4a')]['find']({'where':{'name':_0x54f624,'userProfileId':_0x375f0c[_0x014a('0x4b')]},'raw':!![]})[_0x014a('0x21')](function(_0x47e110){if(_0x47e110&&_0x47e110[_0x014a('0x4c')]===0x0){return db[_0x014a('0x25')][_0x014a('0x45')]({'name':_0x323cf4[_0x014a('0x27')],'resourceId':_0x323cf4['id'],'type':_0x47e110['name'],'sectionId':_0x47e110['id']},{})[_0x014a('0x21')](function(){return _0x229568;});}else{return _0x229568;}})[_0x014a('0x41')](function(_0x33341e){logger[_0x014a('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33341e);throw _0x33341e;});}return _0x229568;})[_0x014a('0x21')](respondWithResult(_0x432e43,0xc9))[_0x014a('0x41')](handleError(_0x432e43,null));};exports['update']=function(_0x7f325,_0x3d5f96){if(_0x7f325[_0x014a('0x46')]['id']){delete _0x7f325[_0x014a('0x46')]['id'];}return db[_0x014a('0x29')]['find']({'where':{'id':_0x7f325[_0x014a('0x4e')]['id']}})[_0x014a('0x21')](handleEntityNotFound(_0x3d5f96,null))['then'](saveUpdates(_0x7f325['body'],null))[_0x014a('0x21')](respondWithResult(_0x3d5f96,null))[_0x014a('0x41')](handleError(_0x3d5f96,null));};exports[_0x014a('0x22')]=function(_0x17d504,_0x175431){return db[_0x014a('0x29')][_0x014a('0x44')]({'where':{'id':_0x17d504[_0x014a('0x4e')]['id']}})[_0x014a('0x21')](handleEntityNotFound(_0x175431,null))[_0x014a('0x21')](removeEntity(_0x175431,null))[_0x014a('0x41')](handleError(_0x175431,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 7f800e6..ed1a2b6 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 _0x7595=['tools_templates','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','define','Template'];(function(_0x189371,_0x41008e){var _0xd76c39=function(_0x1cbb20){while(--_0x1cbb20){_0x189371['push'](_0x189371['shift']());}};_0xd76c39(++_0x41008e);}(_0x7595,0x121));var _0x5759=function(_0x241e61,_0x51e5ea){_0x241e61=_0x241e61-0x0;var _0x409de4=_0x7595[_0x241e61];return _0x409de4;};'use strict';var _=require(_0x5759('0x0'));var util=require(_0x5759('0x1'));var logger=require('../../config/logger')(_0x5759('0x2'));var moment=require(_0x5759('0x3'));var BPromise=require('bluebird');var rp=require(_0x5759('0x4'));var fs=require('fs');var path=require(_0x5759('0x5'));var rimraf=require(_0x5759('0x6'));var config=require(_0x5759('0x7'));var attributes=require(_0x5759('0x8'));module['exports']=function(_0x3792a2,_0x445add){return _0x3792a2[_0x5759('0x9')](_0x5759('0xa'),attributes,{'tableName':_0x5759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc037=['Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','define'];(function(_0x50eed5,_0x56bbc4){var _0xb6c491=function(_0x23e5c3){while(--_0x23e5c3){_0x50eed5['push'](_0x50eed5['shift']());}};_0xb6c491(++_0x56bbc4);}(_0xc037,0x1e3));var _0x7c03=function(_0x51579f,_0x161595){_0x51579f=_0x51579f-0x0;var _0x1755f0=_0xc037[_0x51579f];return _0x1755f0;};'use strict';var _=require(_0x7c03('0x0'));var util=require(_0x7c03('0x1'));var logger=require(_0x7c03('0x2'))(_0x7c03('0x3'));var moment=require(_0x7c03('0x4'));var BPromise=require(_0x7c03('0x5'));var rp=require(_0x7c03('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c03('0x7'));var config=require(_0x7c03('0x8'));var attributes=require(_0x7c03('0x9'));module['exports']=function(_0x53984b,_0x6d49f2){return _0x53984b[_0x7c03('0xa')](_0x7c03('0xb'),attributes,{'tableName':_0x7c03('0xc'),'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 79b7860..8571b91 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 _0xf5fd=['error','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf5fd,0xe0));var _0xdf5f=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xf5fd[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0xdf5f('0x0'));var util=require('util');var moment=require(_0xdf5f('0x1'));var BPromise=require('bluebird');var rs=require(_0xdf5f('0x2'));var fs=require('fs');var Redis=require(_0xdf5f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf5f('0x4'));var logger=require('../../config/logger')(_0xdf5f('0x5'));var config=require('../../config/environment');var jayson=require(_0xdf5f('0x6'));var client=jayson[_0xdf5f('0x7')][_0xdf5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a4f39,_0x98b947,_0x3846e3){return new BPromise(function(_0x3f35e5,_0x380ff0){return client['request'](_0x1a4f39,_0x3846e3)[_0xdf5f('0x9')](function(_0x2937eb){logger[_0xdf5f('0xa')](_0xdf5f('0xb'),_0x98b947,_0xdf5f('0xc'));logger[_0xdf5f('0xd')](_0xdf5f('0xe'),_0x98b947,_0xdf5f('0xc'),JSON[_0xdf5f('0xf')](_0x2937eb));if(_0x2937eb[_0xdf5f('0x10')]){if(_0x2937eb[_0xdf5f('0x10')]['code']===0x1f4){logger['error'](_0xdf5f('0xb'),_0x98b947,_0x2937eb[_0xdf5f('0x10')]['message']);return _0x380ff0(_0x2937eb[_0xdf5f('0x10')][_0xdf5f('0x11')]);}logger['error'](_0xdf5f('0xb'),_0x98b947,_0x2937eb[_0xdf5f('0x10')]['message']);return _0x3f35e5(_0x2937eb[_0xdf5f('0x10')][_0xdf5f('0x11')]);}else{logger[_0xdf5f('0xa')]('Template,\x20%s,\x20%s',_0x98b947,_0xdf5f('0xc'));_0x3f35e5(_0x2937eb[_0xdf5f('0x12')][_0xdf5f('0x11')]);}})['catch'](function(_0x4f3991){logger[_0xdf5f('0x10')](_0xdf5f('0xb'),_0x98b947,_0x4f3991);_0x380ff0(_0x4f3991);});});}exports[_0xdf5f('0x13')]=function(_0x28cb38){var _0x30281e=this;return new Promise(function(_0xf22982,_0x3dd5a0){return db[_0xdf5f('0x14')][_0xdf5f('0x15')]({'raw':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38['options'][_0xdf5f('0x17')]===undefined?!![]:![]:!![],'where':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38['options']['where']||null:null,'attributes':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38[_0xdf5f('0x16')][_0xdf5f('0x18')]||null:null,'limit':_0x28cb38[_0xdf5f('0x16')]?_0x28cb38[_0xdf5f('0x16')][_0xdf5f('0x19')]||null:null,'include':_0x28cb38['options']?_0x28cb38[_0xdf5f('0x16')][_0xdf5f('0x1a')]?_['map'](_0x28cb38[_0xdf5f('0x16')]['include'],function(_0x38ef20){return{'model':db[_0x38ef20['model']],'as':_0x38ef20['as'],'attributes':_0x38ef20['attributes'],'include':_0x38ef20[_0xdf5f('0x1a')]?_[_0xdf5f('0x1b')](_0x38ef20[_0xdf5f('0x1a')],function(_0x5b31a3){return{'model':db[_0x5b31a3[_0xdf5f('0x1c')]],'as':_0x5b31a3['as'],'attributes':_0x5b31a3['attributes'],'include':_0x5b31a3[_0xdf5f('0x1a')]?_['map'](_0x5b31a3['include'],function(_0x54ae10){return{'model':db[_0x54ae10[_0xdf5f('0x1c')]],'as':_0x54ae10['as'],'attributes':_0x54ae10[_0xdf5f('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f5d4c){logger[_0xdf5f('0xa')]('GetTemplate',_0x28cb38);logger[_0xdf5f('0xd')](_0xdf5f('0x13'),_0x28cb38,JSON[_0xdf5f('0xf')](_0x3f5d4c));_0xf22982(_0x3f5d4c);})[_0xdf5f('0x1d')](function(_0x3a88c6){logger[_0xdf5f('0x10')]('GetTemplate',_0x3a88c6['message'],_0x28cb38);_0x3dd5a0(_0x30281e[_0xdf5f('0x10')](0x1f4,_0x3a88c6[_0xdf5f('0x11')]));});});}; \ No newline at end of file +var _0xf998=['info','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','Template,\x20%s,\x20%s','request\x20sent','result','catch','GetTemplate','Template','findAll','options','attributes','include','map','model','stringify','util','randomstring','ioredis','../../mysqldb','rpc','client','then'];(function(_0x44b6c9,_0x1f623f){var _0x5e2701=function(_0x244065){while(--_0x244065){_0x44b6c9['push'](_0x44b6c9['shift']());}};_0x5e2701(++_0x1f623f);}(_0xf998,0x7b));var _0x8f99=function(_0x4bc413,_0x4a5161){_0x4bc413=_0x4bc413-0x0;var _0x13910d=_0xf998[_0x4bc413];return _0x13910d;};'use strict';var _=require('lodash');var util=require(_0x8f99('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8f99('0x1'));var fs=require('fs');var Redis=require(_0x8f99('0x2'));var db=require(_0x8f99('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8f99('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8f99('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43ac1c,_0x47661b,_0xf416cf){return new BPromise(function(_0x22f89d,_0x19239e){return client['request'](_0x43ac1c,_0xf416cf)[_0x8f99('0x6')](function(_0x5ae226){logger[_0x8f99('0x7')]('Template,\x20%s,\x20%s',_0x47661b,'request\x20sent');logger[_0x8f99('0x8')](_0x8f99('0x9'),_0x47661b,'request\x20sent',JSON['stringify'](_0x5ae226));if(_0x5ae226[_0x8f99('0xa')]){if(_0x5ae226[_0x8f99('0xa')][_0x8f99('0xb')]===0x1f4){logger[_0x8f99('0xa')]('Template,\x20%s,\x20%s',_0x47661b,_0x5ae226[_0x8f99('0xa')][_0x8f99('0xc')]);return _0x19239e(_0x5ae226[_0x8f99('0xa')]['message']);}logger[_0x8f99('0xa')](_0x8f99('0xd'),_0x47661b,_0x5ae226[_0x8f99('0xa')][_0x8f99('0xc')]);return _0x22f89d(_0x5ae226[_0x8f99('0xa')]['message']);}else{logger[_0x8f99('0x7')]('Template,\x20%s,\x20%s',_0x47661b,_0x8f99('0xe'));_0x22f89d(_0x5ae226[_0x8f99('0xf')][_0x8f99('0xc')]);}})[_0x8f99('0x10')](function(_0x269e08){logger[_0x8f99('0xa')](_0x8f99('0xd'),_0x47661b,_0x269e08);_0x19239e(_0x269e08);});});}exports[_0x8f99('0x11')]=function(_0x3b86b1){var _0x286af2=this;return new Promise(function(_0x2b746f,_0x100877){return db[_0x8f99('0x12')][_0x8f99('0x13')]({'raw':_0x3b86b1[_0x8f99('0x14')]?_0x3b86b1[_0x8f99('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3b86b1[_0x8f99('0x14')]?_0x3b86b1[_0x8f99('0x14')]['where']||null:null,'attributes':_0x3b86b1['options']?_0x3b86b1[_0x8f99('0x14')][_0x8f99('0x15')]||null:null,'limit':_0x3b86b1[_0x8f99('0x14')]?_0x3b86b1['options']['limit']||null:null,'include':_0x3b86b1[_0x8f99('0x14')]?_0x3b86b1[_0x8f99('0x14')][_0x8f99('0x16')]?_[_0x8f99('0x17')](_0x3b86b1['options']['include'],function(_0x358257){return{'model':db[_0x358257[_0x8f99('0x18')]],'as':_0x358257['as'],'attributes':_0x358257['attributes'],'include':_0x358257[_0x8f99('0x16')]?_[_0x8f99('0x17')](_0x358257[_0x8f99('0x16')],function(_0x169068){return{'model':db[_0x169068[_0x8f99('0x18')]],'as':_0x169068['as'],'attributes':_0x169068[_0x8f99('0x15')],'include':_0x169068[_0x8f99('0x16')]?_[_0x8f99('0x17')](_0x169068[_0x8f99('0x16')],function(_0x317120){return{'model':db[_0x317120[_0x8f99('0x18')]],'as':_0x317120['as'],'attributes':_0x317120[_0x8f99('0x15')]};}):[]};}):[]};}):[]:[]})[_0x8f99('0x6')](function(_0x44f51f){logger[_0x8f99('0x7')](_0x8f99('0x11'),_0x3b86b1);logger[_0x8f99('0x8')](_0x8f99('0x11'),_0x3b86b1,JSON[_0x8f99('0x19')](_0x44f51f));_0x2b746f(_0x44f51f);})['catch'](function(_0x111231){logger['error'](_0x8f99('0x11'),_0x111231['message'],_0x3b86b1);_0x100877(_0x286af2[_0x8f99('0xa')](0x1f4,_0x111231[_0x8f99('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 6d2d2be..33e01ab 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 _0xae3f=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition','put','/:id','delete'];(function(_0xa68a32,_0x54036d){var _0x1e4b16=function(_0x4e68c9){while(--_0x4e68c9){_0xa68a32['push'](_0xa68a32['shift']());}};_0x1e4b16(++_0x54036d);}(_0xae3f,0x136));var _0xfae3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xae3f[_0x46e363];return _0x3fb059;};'use strict';var multer=require('multer');var util=require(_0xfae3('0x0'));var path=require(_0xfae3('0x1'));var timeout=require(_0xfae3('0x2'));var express=require(_0xfae3('0x3'));var router=express[_0xfae3('0x4')]();var fs_extra=require(_0xfae3('0x5'));var auth=require(_0xfae3('0x6'));var interaction=require(_0xfae3('0x7'));var config=require(_0xfae3('0x8'));var controller=require(_0xfae3('0x9'));router[_0xfae3('0xa')]('/',auth[_0xfae3('0xb')](),controller[_0xfae3('0xc')]);router[_0xfae3('0xa')]('/:id',auth[_0xfae3('0xb')](),controller[_0xfae3('0xd')]);router[_0xfae3('0xa')](_0xfae3('0xe'),auth[_0xfae3('0xb')](),controller[_0xfae3('0xf')]);router['get'](_0xfae3('0x10'),auth[_0xfae3('0xb')](),controller[_0xfae3('0x11')]);router[_0xfae3('0xa')](_0xfae3('0x12'),auth[_0xfae3('0xb')](),controller[_0xfae3('0x13')]);router[_0xfae3('0x14')]('/',auth[_0xfae3('0xb')](),controller[_0xfae3('0x15')]);router[_0xfae3('0x14')](_0xfae3('0xe'),auth[_0xfae3('0xb')](),controller['addAllCondition']);router['post'](_0xfae3('0x10'),auth[_0xfae3('0xb')](),controller[_0xfae3('0x16')]);router[_0xfae3('0x14')](_0xfae3('0x12'),auth['isAuthenticated'](),controller['addAction']);router[_0xfae3('0x17')](_0xfae3('0x18'),auth[_0xfae3('0xb')](),controller['update']);router[_0xfae3('0x19')](_0xfae3('0x18'),auth['isAuthenticated'](),controller[_0xfae3('0x1a')]);module[_0xfae3('0x1b')]=router; \ No newline at end of file +var _0x02a4=['addAnyCondition','post','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','index','/:id','show','isAuthenticated','getAllConditions','/:id/any_conditions','/:id/actions','create','/:id/all_conditions','addAllCondition'];(function(_0x15e927,_0x346938){var _0x331a0d=function(_0x5dceaf){while(--_0x5dceaf){_0x15e927['push'](_0x15e927['shift']());}};_0x331a0d(++_0x346938);}(_0x02a4,0x19d));var _0x402a=function(_0x334df6,_0x515668){_0x334df6=_0x334df6-0x0;var _0x2666d8=_0x02a4[_0x334df6];return _0x2666d8;};'use strict';var multer=require(_0x402a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x402a('0x1'));var express=require(_0x402a('0x2'));var router=express[_0x402a('0x3')]();var fs_extra=require(_0x402a('0x4'));var auth=require(_0x402a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x402a('0x6'));var controller=require(_0x402a('0x7'));router[_0x402a('0x8')]('/',auth['isAuthenticated'](),controller[_0x402a('0x9')]);router[_0x402a('0x8')](_0x402a('0xa'),auth['isAuthenticated'](),controller[_0x402a('0xb')]);router[_0x402a('0x8')]('/:id/all_conditions',auth[_0x402a('0xc')](),controller[_0x402a('0xd')]);router[_0x402a('0x8')](_0x402a('0xe'),auth['isAuthenticated'](),controller['getAnyConditions']);router['get'](_0x402a('0xf'),auth[_0x402a('0xc')](),controller['getActions']);router['post']('/',auth[_0x402a('0xc')](),controller[_0x402a('0x10')]);router['post'](_0x402a('0x11'),auth[_0x402a('0xc')](),controller[_0x402a('0x12')]);router['post']('/:id/any_conditions',auth[_0x402a('0xc')](),controller[_0x402a('0x13')]);router[_0x402a('0x14')](_0x402a('0xf'),auth[_0x402a('0xc')](),controller['addAction']);router['put'](_0x402a('0xa'),auth['isAuthenticated'](),controller[_0x402a('0x15')]);router[_0x402a('0x16')](_0x402a('0xa'),auth[_0x402a('0xc')](),controller['destroy']);module[_0x402a('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index c255258..903cf68 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 _0x81e6=['STRING','BOOLEAN','exports'];(function(_0x3a0f87,_0x449ec5){var _0x155c60=function(_0x4dbe7c){while(--_0x4dbe7c){_0x3a0f87['push'](_0x3a0f87['shift']());}};_0x155c60(++_0x449ec5);}(_0x81e6,0x10a));var _0x681e=function(_0x354594,_0x2a4b90){_0x354594=_0x354594-0x0;var _0x4a5943=_0x81e6[_0x354594];return _0x4a5943;};'use strict';var Sequelize=require('sequelize');module[_0x681e('0x0')]={'name':{'type':Sequelize[_0x681e('0x1')]},'channel':{'type':Sequelize[_0x681e('0x1')]},'description':{'type':Sequelize[_0x681e('0x1')]},'status':{'type':Sequelize[_0x681e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xcada=['BOOLEAN','sequelize','STRING'];(function(_0x3fe50a,_0x26ac32){var _0x305ec4=function(_0x161fd8){while(--_0x161fd8){_0x3fe50a['push'](_0x3fe50a['shift']());}};_0x305ec4(++_0x26ac32);}(_0xcada,0x139));var _0xacad=function(_0x2eb326,_0x253107){_0x2eb326=_0x2eb326-0x0;var _0x814bb9=_0xcada[_0x2eb326];return _0x814bb9;};'use strict';var Sequelize=require(_0xacad('0x0'));module['exports']={'name':{'type':Sequelize[_0xacad('0x1')]},'channel':{'type':Sequelize[_0xacad('0x1')]},'description':{'type':Sequelize[_0xacad('0x1')]},'status':{'type':Sequelize[_0xacad('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 389cefc..e34a89f 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 _0x5fc7=['where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','length','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','userProfileId','autoAssociation','UserProfileResource','body','find','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','hasOwnProperty','nolimit','getAnyConditions','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x5fc7,0x141));var _0x75fc=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x5fc7[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require(_0x75fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75fc('0x1'));var jsonpatch=require(_0x75fc('0x2'));var rp=require(_0x75fc('0x3'));var moment=require(_0x75fc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x75fc('0x5'));var path=require(_0x75fc('0x6'));var sox=require(_0x75fc('0x7'));var csv=require(_0x75fc('0x8'));var ejs=require(_0x75fc('0x9'));var fs=require('fs');var fs_extra=require(_0x75fc('0xa'));var _=require(_0x75fc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x75fc('0xc'));var deskjs=require(_0x75fc('0xd'));var toCsv=require(_0x75fc('0x8'));var querystring=require(_0x75fc('0xe'));var Papa=require(_0x75fc('0xf'));var Redis=require('ioredis');var authService=require(_0x75fc('0x10'));var qs=require(_0x75fc('0x11'));var as=require(_0x75fc('0x12'));var hardwareService=require(_0x75fc('0x13'));var logger=require(_0x75fc('0x14'))(_0x75fc('0x15'));var utils=require(_0x75fc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x75fc('0x17'));var db=require(_0x75fc('0x18'))['db'];function respondWithStatusCode(_0x4d6af9,_0xcb1843){_0xcb1843=_0xcb1843||0xcc;return function(_0x108efd){if(_0x108efd){return _0x4d6af9['sendStatus'](_0xcb1843);}return _0x4d6af9[_0x75fc('0x19')](_0xcb1843)['end']();};}function respondWithResult(_0x2d1947,_0x1e51ec){_0x1e51ec=_0x1e51ec||0xc8;return function(_0x2bf248){if(_0x2bf248){return _0x2d1947[_0x75fc('0x19')](_0x1e51ec)[_0x75fc('0x1a')](_0x2bf248);}};}function respondWithFilteredResult(_0x288c47,_0x47516c){return function(_0x10c292){if(_0x10c292){var _0x5eab43=typeof _0x47516c[_0x75fc('0x1b')]===_0x75fc('0x1c')&&typeof _0x47516c[_0x75fc('0x1d')]===_0x75fc('0x1c');var _0x57f0fb=_0x10c292[_0x75fc('0x1e')];var _0xd7a7d2=_0x5eab43?0x0:_0x47516c[_0x75fc('0x1b')];var _0x3e196d=_0x5eab43?_0x10c292['count']:_0x47516c[_0x75fc('0x1b')]+_0x47516c[_0x75fc('0x1d')];var _0x51c6a9;if(_0x3e196d>=_0x57f0fb){_0x3e196d=_0x57f0fb;_0x51c6a9=0xc8;}else{_0x51c6a9=0xce;}_0x288c47[_0x75fc('0x19')](_0x51c6a9);return _0x288c47[_0x75fc('0x1f')](_0x75fc('0x20'),_0xd7a7d2+'-'+_0x3e196d+'/'+_0x57f0fb)[_0x75fc('0x1a')](_0x10c292);}return null;};}function patchUpdates(_0x5bb375){return function(_0x3c0d6b){try{jsonpatch[_0x75fc('0x21')](_0x3c0d6b,_0x5bb375,!![]);}catch(_0x7d5431){return BPromise[_0x75fc('0x22')](_0x7d5431);}return _0x3c0d6b[_0x75fc('0x23')]();};}function saveUpdates(_0x5519b8,_0x3daa51){return function(_0x3c9b1c){if(_0x3c9b1c){return _0x3c9b1c[_0x75fc('0x24')](_0x5519b8)[_0x75fc('0x25')](function(_0x3cdfc5){return _0x3cdfc5;});}return null;};}function removeEntity(_0x399628,_0x348771){return function(_0x2ffcba){if(_0x2ffcba){return _0x2ffcba[_0x75fc('0x26')]()[_0x75fc('0x25')](function(){var _0x399b80=_0x2ffcba['get']({'plain':!![]});var _0x234253='Triggers';return db['UserProfileResource'][_0x75fc('0x26')]({'where':{'type':_0x234253,'resourceId':_0x399b80['id']}})['then'](function(){return _0x2ffcba;});})['then'](function(){_0x399628[_0x75fc('0x19')](0xcc)[_0x75fc('0x27')]();});}};}function handleEntityNotFound(_0x26b2d3,_0x14643c){return function(_0x3ef293){if(!_0x3ef293){_0x26b2d3[_0x75fc('0x28')](0x194);}return _0x3ef293;};}function handleError(_0x242858,_0x546363){_0x546363=_0x546363||0x1f4;return function(_0x1cf7eb){logger[_0x75fc('0x29')](_0x1cf7eb['stack']);if(_0x1cf7eb[_0x75fc('0x2a')]){delete _0x1cf7eb[_0x75fc('0x2a')];}_0x242858[_0x75fc('0x19')](_0x546363)['send'](_0x1cf7eb);};}exports[_0x75fc('0x2b')]=function(_0x5d577e,_0x588ea4){var _0x159118={},_0x54db12={},_0x2df2cd={'count':0x0,'rows':[]};var _0x413fd2=_[_0x75fc('0x2c')](db[_0x75fc('0x2d')][_0x75fc('0x2e')],function(_0x578f09){return{'name':_0x578f09[_0x75fc('0x2f')],'type':_0x578f09[_0x75fc('0x30')][_0x75fc('0x31')]};});_0x54db12[_0x75fc('0x32')]=_[_0x75fc('0x2c')](_0x413fd2,_0x75fc('0x2a'));_0x54db12[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x5d577e[_0x75fc('0x33')]);_0x54db12[_0x75fc('0x35')]=_[_0x75fc('0x36')](_0x54db12[_0x75fc('0x32')],_0x54db12['query']);_0x159118['attributes']=_['intersection'](_0x54db12[_0x75fc('0x32')],qs[_0x75fc('0x37')](_0x5d577e['query'][_0x75fc('0x37')]));_0x159118[_0x75fc('0x38')]=_0x159118[_0x75fc('0x38')]['length']?_0x159118[_0x75fc('0x38')]:_0x54db12[_0x75fc('0x32')];if(!_0x5d577e['query']['hasOwnProperty']('nolimit')){_0x159118[_0x75fc('0x1d')]=qs[_0x75fc('0x1d')](_0x5d577e['query'][_0x75fc('0x1d')]);_0x159118['offset']=qs['offset'](_0x5d577e['query']['offset']);}_0x159118[_0x75fc('0x39')]=qs[_0x75fc('0x3a')](_0x5d577e[_0x75fc('0x33')]['sort']);_0x159118[_0x75fc('0x3b')]=qs[_0x75fc('0x35')](_[_0x75fc('0x3c')](_0x5d577e[_0x75fc('0x33')],_0x54db12[_0x75fc('0x35')]),_0x413fd2);if(_0x5d577e[_0x75fc('0x33')]['filter']){_0x159118['where']=_[_0x75fc('0x3d')](_0x159118[_0x75fc('0x3b')],{'$or':_[_0x75fc('0x2c')](_0x413fd2,function(_0x3329e0){if(_0x3329e0[_0x75fc('0x30')]!==_0x75fc('0x3e')){var _0x5921f9={};_0x5921f9[_0x3329e0[_0x75fc('0x2a')]]={'$like':'%'+_0x5d577e['query'][_0x75fc('0x3f')]+'%'};return _0x5921f9;}})});}_0x159118=_[_0x75fc('0x3d')]({},_0x159118,_0x5d577e[_0x75fc('0x40')]);var _0x19b1d6={'where':_0x159118[_0x75fc('0x3b')]};return db[_0x75fc('0x2d')][_0x75fc('0x1e')](_0x19b1d6)[_0x75fc('0x25')](function(_0x1d8b0c){_0x2df2cd[_0x75fc('0x1e')]=_0x1d8b0c;if(_0x5d577e[_0x75fc('0x33')][_0x75fc('0x41')]){_0x159118[_0x75fc('0x42')]=[{'all':!![]}];}return db[_0x75fc('0x2d')][_0x75fc('0x43')](_0x159118);})[_0x75fc('0x25')](function(_0x3c1f2e){_0x2df2cd['rows']=_0x3c1f2e;return _0x2df2cd;})[_0x75fc('0x25')](respondWithFilteredResult(_0x588ea4,_0x159118))['catch'](handleError(_0x588ea4,null));};exports[_0x75fc('0x44')]=function(_0x5f0d94,_0x2ac8bc){var _0x348ed6={'raw':![],'where':{'id':_0x5f0d94[_0x75fc('0x45')]['id']}},_0x396ad5={};_0x396ad5[_0x75fc('0x32')]=_[_0x75fc('0x34')](db['Trigger'][_0x75fc('0x2e')]);_0x396ad5[_0x75fc('0x33')]=_['keys'](_0x5f0d94['query']);_0x396ad5[_0x75fc('0x35')]=_['intersection'](_0x396ad5[_0x75fc('0x32')],_0x396ad5[_0x75fc('0x33')]);_0x348ed6['attributes']=_[_0x75fc('0x36')](_0x396ad5[_0x75fc('0x32')],qs['fields'](_0x5f0d94[_0x75fc('0x33')][_0x75fc('0x37')]));_0x348ed6[_0x75fc('0x38')]=_0x348ed6[_0x75fc('0x38')][_0x75fc('0x46')]?_0x348ed6[_0x75fc('0x38')]:_0x396ad5['model'];if(_0x5f0d94[_0x75fc('0x33')][_0x75fc('0x41')]){_0x348ed6['include']=[{'all':!![]}];}_0x348ed6=_[_0x75fc('0x3d')]({},_0x348ed6,_0x5f0d94[_0x75fc('0x40')]);return db[_0x75fc('0x2d')]['find'](_0x348ed6)['then'](handleEntityNotFound(_0x2ac8bc,null))[_0x75fc('0x25')](respondWithResult(_0x2ac8bc,null))[_0x75fc('0x47')](handleError(_0x2ac8bc,null));};exports[_0x75fc('0x48')]=function(_0x24d776,_0x33bb06){return db[_0x75fc('0x2d')][_0x75fc('0x48')](_0x24d776['body'],{})[_0x75fc('0x25')](function(_0x2be8fd){var _0x5ed46d=_0x24d776[_0x75fc('0x49')][_0x75fc('0x4a')]({'plain':!![]});if(!_0x5ed46d)throw new Error(_0x75fc('0x4b'));if(_0x5ed46d[_0x75fc('0x4c')]===_0x75fc('0x49')){var _0x416f42=_0x2be8fd[_0x75fc('0x4a')]({'plain':!![]});var _0x2e4487=_0x75fc('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x2e4487,'userProfileId':_0x5ed46d[_0x75fc('0x4e')]},'raw':!![]})[_0x75fc('0x25')](function(_0x2e9f54){if(_0x2e9f54&&_0x2e9f54[_0x75fc('0x4f')]===0x0){return db[_0x75fc('0x50')][_0x75fc('0x48')]({'name':_0x416f42[_0x75fc('0x2a')],'resourceId':_0x416f42['id'],'type':_0x2e9f54['name'],'sectionId':_0x2e9f54['id']},{})[_0x75fc('0x25')](function(){return _0x2be8fd;});}else{return _0x2be8fd;}})['catch'](function(_0x287bef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x287bef);throw _0x287bef;});}return _0x2be8fd;})['then'](respondWithResult(_0x33bb06,0xc9))[_0x75fc('0x47')](handleError(_0x33bb06,null));};exports[_0x75fc('0x24')]=function(_0x40e30a,_0x1b9a33){if(_0x40e30a[_0x75fc('0x51')]['id']){delete _0x40e30a['body']['id'];}return db['Trigger'][_0x75fc('0x52')]({'where':{'id':_0x40e30a[_0x75fc('0x45')]['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x1b9a33,null))[_0x75fc('0x25')](saveUpdates(_0x40e30a[_0x75fc('0x51')],null))[_0x75fc('0x25')](respondWithResult(_0x1b9a33,null))[_0x75fc('0x47')](handleError(_0x1b9a33,null));};exports['destroy']=function(_0x62a5bf,_0x271875){return db[_0x75fc('0x2d')][_0x75fc('0x52')]({'where':{'id':_0x62a5bf[_0x75fc('0x45')]['id']}})['then'](handleEntityNotFound(_0x271875,null))[_0x75fc('0x25')](removeEntity(_0x271875,null))[_0x75fc('0x47')](handleError(_0x271875,null));};exports[_0x75fc('0x53')]=function(_0x55904d,_0x44c057,_0xf96464){if(_0x55904d[_0x75fc('0x51')]['id']){delete _0x55904d[_0x75fc('0x51')]['id'];}return db[_0x75fc('0x2d')][_0x75fc('0x52')]({'where':{'id':_0x55904d[_0x75fc('0x45')]['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x44c057,null))[_0x75fc('0x25')](function(_0xef495){if(_0xef495){_0x55904d['body'][_0x75fc('0x54')]=_0xef495['id'];return db[_0x75fc('0x55')][_0x75fc('0x48')](_0x55904d[_0x75fc('0x51')]);}})[_0x75fc('0x25')](respondWithResult(_0x44c057,null))['catch'](handleError(_0x44c057,null));};exports[_0x75fc('0x56')]=function(_0x2bcfff,_0x48a6dd,_0xffe3e9){if(_0x2bcfff['body']['id']){delete _0x2bcfff[_0x75fc('0x51')]['id'];}return db[_0x75fc('0x2d')]['find']({'where':{'id':_0x2bcfff['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x48a6dd,null))['then'](function(_0x1b7afc){if(_0x1b7afc){_0x2bcfff[_0x75fc('0x51')][_0x75fc('0x57')]=_0x1b7afc['id'];return db['Condition'][_0x75fc('0x48')](_0x2bcfff[_0x75fc('0x51')]);}})['then'](respondWithResult(_0x48a6dd,null))[_0x75fc('0x47')](handleError(_0x48a6dd,null));};exports[_0x75fc('0x58')]=function(_0x2ee124,_0x4454d5,_0x5f147d){var _0x54457c={};var _0xba6a3f={};var _0x29b5fc;var _0x20e3eb;return db[_0x75fc('0x2d')]['findOne']({'where':{'id':_0x2ee124['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x4454d5,null))['then'](function(_0x3279dd){if(_0x3279dd){_0x29b5fc=_0x3279dd;_0xba6a3f[_0x75fc('0x32')]=_[_0x75fc('0x34')](db[_0x75fc('0x55')]['rawAttributes']);_0xba6a3f[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x2ee124['query']);_0xba6a3f['filters']=_['intersection'](_0xba6a3f[_0x75fc('0x32')],_0xba6a3f[_0x75fc('0x33')]);_0x54457c[_0x75fc('0x38')]=_[_0x75fc('0x36')](_0xba6a3f[_0x75fc('0x32')],qs[_0x75fc('0x37')](_0x2ee124[_0x75fc('0x33')][_0x75fc('0x37')]));_0x54457c['attributes']=_0x54457c[_0x75fc('0x38')][_0x75fc('0x46')]?_0x54457c['attributes']:_0xba6a3f[_0x75fc('0x32')];_0x54457c[_0x75fc('0x39')]=qs[_0x75fc('0x3a')](_0x2ee124['query']['sort']);_0x54457c[_0x75fc('0x3b')]=qs[_0x75fc('0x35')](_[_0x75fc('0x3c')](_0x2ee124['query'],_0xba6a3f[_0x75fc('0x35')]));if(_0x2ee124[_0x75fc('0x33')][_0x75fc('0x3f')]){_0x54457c[_0x75fc('0x3b')]=_[_0x75fc('0x3d')](_0x54457c[_0x75fc('0x3b')],{'$or':_[_0x75fc('0x2c')](_0x54457c['attributes'],function(_0x31b4d1){var _0x337cc1={};_0x337cc1[_0x31b4d1]={'$like':'%'+_0x2ee124[_0x75fc('0x33')][_0x75fc('0x3f')]+'%'};return _0x337cc1;})});}_0x54457c=_['merge']({},_0x54457c,_0x2ee124[_0x75fc('0x40')]);return _0x29b5fc['getAllConditions'](_0x54457c);}})[_0x75fc('0x25')](function(_0x187de2){if(_0x187de2){_0x20e3eb=_0x187de2['length'];if(!_0x2ee124[_0x75fc('0x33')][_0x75fc('0x59')]('nolimit')){_0x54457c[_0x75fc('0x1d')]=qs['limit'](_0x2ee124[_0x75fc('0x33')][_0x75fc('0x1d')]);_0x54457c[_0x75fc('0x1b')]=qs[_0x75fc('0x1b')](_0x2ee124['query'][_0x75fc('0x1b')]);}return _0x29b5fc[_0x75fc('0x58')](_0x54457c);}})['then'](function(_0x104b13){if(_0x104b13){return _0x104b13?{'count':_0x20e3eb,'rows':_0x104b13}:null;}})[_0x75fc('0x25')](respondWithResult(_0x4454d5,null))[_0x75fc('0x47')](handleError(_0x4454d5,null));};exports['getAnyConditions']=function(_0x139536,_0x136b3f,_0x56af03){var _0x395175={};var _0x3716d5={};var _0x233e2c;var _0x522ea1;return db[_0x75fc('0x2d')]['findOne']({'where':{'id':_0x139536['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x136b3f,null))['then'](function(_0x23ef99){if(_0x23ef99){_0x233e2c=_0x23ef99;_0x3716d5[_0x75fc('0x32')]=_[_0x75fc('0x34')](db[_0x75fc('0x55')][_0x75fc('0x2e')]);_0x3716d5[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x139536[_0x75fc('0x33')]);_0x3716d5[_0x75fc('0x35')]=_[_0x75fc('0x36')](_0x3716d5['model'],_0x3716d5[_0x75fc('0x33')]);_0x395175[_0x75fc('0x38')]=_[_0x75fc('0x36')](_0x3716d5['model'],qs[_0x75fc('0x37')](_0x139536['query'][_0x75fc('0x37')]));_0x395175[_0x75fc('0x38')]=_0x395175[_0x75fc('0x38')][_0x75fc('0x46')]?_0x395175[_0x75fc('0x38')]:_0x3716d5[_0x75fc('0x32')];_0x395175[_0x75fc('0x39')]=qs['sort'](_0x139536['query']['sort']);_0x395175[_0x75fc('0x3b')]=qs['filters'](_[_0x75fc('0x3c')](_0x139536['query'],_0x3716d5[_0x75fc('0x35')]));if(_0x139536['query']['filter']){_0x395175['where']=_[_0x75fc('0x3d')](_0x395175[_0x75fc('0x3b')],{'$or':_[_0x75fc('0x2c')](_0x395175[_0x75fc('0x38')],function(_0xa0185){var _0x59cca8={};_0x59cca8[_0xa0185]={'$like':'%'+_0x139536[_0x75fc('0x33')][_0x75fc('0x3f')]+'%'};return _0x59cca8;})});}_0x395175=_[_0x75fc('0x3d')]({},_0x395175,_0x139536['options']);return _0x233e2c['getAnyConditions'](_0x395175);}})[_0x75fc('0x25')](function(_0x1e07ad){if(_0x1e07ad){_0x522ea1=_0x1e07ad[_0x75fc('0x46')];if(!_0x139536[_0x75fc('0x33')][_0x75fc('0x59')](_0x75fc('0x5a'))){_0x395175[_0x75fc('0x1d')]=qs[_0x75fc('0x1d')](_0x139536[_0x75fc('0x33')][_0x75fc('0x1d')]);_0x395175['offset']=qs[_0x75fc('0x1b')](_0x139536[_0x75fc('0x33')][_0x75fc('0x1b')]);}return _0x233e2c[_0x75fc('0x5b')](_0x395175);}})[_0x75fc('0x25')](function(_0x12c45a){if(_0x12c45a){return _0x12c45a?{'count':_0x522ea1,'rows':_0x12c45a}:null;}})[_0x75fc('0x25')](respondWithResult(_0x136b3f,null))[_0x75fc('0x47')](handleError(_0x136b3f,null));};exports['addAction']=function(_0x364382,_0x114c60,_0x4c41d2){if(_0x364382[_0x75fc('0x51')]['id']){delete _0x364382[_0x75fc('0x51')]['id'];}return db[_0x75fc('0x2d')][_0x75fc('0x52')]({'where':{'id':_0x364382['params']['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x114c60,null))[_0x75fc('0x25')](function(_0x4cc1d0){if(_0x4cc1d0){_0x364382[_0x75fc('0x51')][_0x75fc('0x5c')]=_0x4cc1d0['id'];return db[_0x75fc('0x5d')][_0x75fc('0x48')](_0x364382[_0x75fc('0x51')]);}})[_0x75fc('0x25')](respondWithResult(_0x114c60,null))[_0x75fc('0x47')](handleError(_0x114c60,null));};exports[_0x75fc('0x5e')]=function(_0x25da4f,_0x904ae8,_0x4e8a06){var _0x1cea29={};var _0x1a5026={};var _0x5a7116;var _0x326d0e;return db[_0x75fc('0x2d')]['findOne']({'where':{'id':_0x25da4f[_0x75fc('0x45')]['id']}})[_0x75fc('0x25')](handleEntityNotFound(_0x904ae8,null))[_0x75fc('0x25')](function(_0x1ac5ee){if(_0x1ac5ee){_0x5a7116=_0x1ac5ee;_0x1a5026['model']=_[_0x75fc('0x34')](db[_0x75fc('0x5d')][_0x75fc('0x2e')]);_0x1a5026[_0x75fc('0x33')]=_[_0x75fc('0x34')](_0x25da4f['query']);_0x1a5026[_0x75fc('0x35')]=_[_0x75fc('0x36')](_0x1a5026[_0x75fc('0x32')],_0x1a5026[_0x75fc('0x33')]);_0x1cea29[_0x75fc('0x38')]=_[_0x75fc('0x36')](_0x1a5026[_0x75fc('0x32')],qs['fields'](_0x25da4f[_0x75fc('0x33')]['fields']));_0x1cea29[_0x75fc('0x38')]=_0x1cea29['attributes'][_0x75fc('0x46')]?_0x1cea29[_0x75fc('0x38')]:_0x1a5026[_0x75fc('0x32')];_0x1cea29[_0x75fc('0x39')]=qs[_0x75fc('0x3a')](_0x25da4f[_0x75fc('0x33')]['sort']);_0x1cea29['where']=qs[_0x75fc('0x35')](_[_0x75fc('0x3c')](_0x25da4f['query'],_0x1a5026[_0x75fc('0x35')]));if(_0x25da4f[_0x75fc('0x33')][_0x75fc('0x3f')]){_0x1cea29[_0x75fc('0x3b')]=_[_0x75fc('0x3d')](_0x1cea29['where'],{'$or':_[_0x75fc('0x2c')](_0x1cea29['attributes'],function(_0x165b64){var _0x279469={};_0x279469[_0x165b64]={'$like':'%'+_0x25da4f[_0x75fc('0x33')][_0x75fc('0x3f')]+'%'};return _0x279469;})});}_0x1cea29=_[_0x75fc('0x3d')]({},_0x1cea29,_0x25da4f[_0x75fc('0x40')]);return _0x5a7116[_0x75fc('0x5e')](_0x1cea29);}})[_0x75fc('0x25')](function(_0x36fe1a){if(_0x36fe1a){_0x326d0e=_0x36fe1a[_0x75fc('0x46')];if(!_0x25da4f[_0x75fc('0x33')][_0x75fc('0x59')]('nolimit')){_0x1cea29['limit']=qs[_0x75fc('0x1d')](_0x25da4f[_0x75fc('0x33')][_0x75fc('0x1d')]);_0x1cea29[_0x75fc('0x1b')]=qs[_0x75fc('0x1b')](_0x25da4f[_0x75fc('0x33')][_0x75fc('0x1b')]);}return _0x5a7116[_0x75fc('0x5e')](_0x1cea29);}})['then'](function(_0x40e413){if(_0x40e413){return _0x40e413?{'count':_0x326d0e,'rows':_0x40e413}:null;}})[_0x75fc('0x25')](respondWithResult(_0x904ae8,null))[_0x75fc('0x47')](handleError(_0x904ae8,null));}; \ No newline at end of file +var _0xdc27=['util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','destroy','error','name','map','Trigger','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','request-promise','moment','mustache'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xdc27,0x16b));var _0x7dc2=function(_0x4d03f4,_0x10ab16){_0x4d03f4=_0x4d03f4-0x0;var _0x59318a=_0xdc27[_0x4d03f4];return _0x59318a;};'use strict';var emlformat=require(_0x7dc2('0x0'));var rimraf=require(_0x7dc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc2('0x2'));var moment=require(_0x7dc2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7dc2('0x4'));var util=require(_0x7dc2('0x5'));var path=require(_0x7dc2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7dc2('0x7'));var fs=require('fs');var fs_extra=require(_0x7dc2('0x8'));var _=require(_0x7dc2('0x9'));var squel=require(_0x7dc2('0xa'));var crypto=require('crypto');var jsforce=require(_0x7dc2('0xb'));var deskjs=require(_0x7dc2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7dc2('0xd'));var Papa=require(_0x7dc2('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc2('0xf'));var qs=require(_0x7dc2('0x10'));var as=require(_0x7dc2('0x11'));var hardwareService=require(_0x7dc2('0x12'));var logger=require('../../config/logger')(_0x7dc2('0x13'));var utils=require(_0x7dc2('0x14'));var config=require(_0x7dc2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7dc2('0x16'))['db'];function respondWithStatusCode(_0x3867dc,_0x379ab6){_0x379ab6=_0x379ab6||0xcc;return function(_0x135188){if(_0x135188){return _0x3867dc[_0x7dc2('0x17')](_0x379ab6);}return _0x3867dc[_0x7dc2('0x18')](_0x379ab6)['end']();};}function respondWithResult(_0x261b48,_0xc2cfc4){_0xc2cfc4=_0xc2cfc4||0xc8;return function(_0x472ab3){if(_0x472ab3){return _0x261b48[_0x7dc2('0x18')](_0xc2cfc4)[_0x7dc2('0x19')](_0x472ab3);}};}function respondWithFilteredResult(_0x495ed2,_0x1a49e1){return function(_0x4ec613){if(_0x4ec613){var _0x1c431e=typeof _0x1a49e1[_0x7dc2('0x1a')]===_0x7dc2('0x1b')&&typeof _0x1a49e1[_0x7dc2('0x1c')]==='undefined';var _0x20608a=_0x4ec613[_0x7dc2('0x1d')];var _0x343208=_0x1c431e?0x0:_0x1a49e1[_0x7dc2('0x1a')];var _0x24c19b=_0x1c431e?_0x4ec613[_0x7dc2('0x1d')]:_0x1a49e1[_0x7dc2('0x1a')]+_0x1a49e1['limit'];var _0x4273f0;if(_0x24c19b>=_0x20608a){_0x24c19b=_0x20608a;_0x4273f0=0xc8;}else{_0x4273f0=0xce;}_0x495ed2[_0x7dc2('0x18')](_0x4273f0);return _0x495ed2[_0x7dc2('0x1e')](_0x7dc2('0x1f'),_0x343208+'-'+_0x24c19b+'/'+_0x20608a)['json'](_0x4ec613);}return null;};}function patchUpdates(_0x23bbb5){return function(_0x5257b8){try{jsonpatch[_0x7dc2('0x20')](_0x5257b8,_0x23bbb5,!![]);}catch(_0x1fc415){return BPromise[_0x7dc2('0x21')](_0x1fc415);}return _0x5257b8[_0x7dc2('0x22')]();};}function saveUpdates(_0x463ac4,_0x362aec){return function(_0x16c5d4){if(_0x16c5d4){return _0x16c5d4['update'](_0x463ac4)['then'](function(_0x4b21b8){return _0x4b21b8;});}return null;};}function removeEntity(_0x56f481,_0x7d3a9a){return function(_0x2803dd){if(_0x2803dd){return _0x2803dd['destroy']()[_0x7dc2('0x23')](function(){var _0xe5e39c=_0x2803dd[_0x7dc2('0x24')]({'plain':!![]});var _0x40cf2d='Triggers';return db['UserProfileResource'][_0x7dc2('0x25')]({'where':{'type':_0x40cf2d,'resourceId':_0xe5e39c['id']}})[_0x7dc2('0x23')](function(){return _0x2803dd;});})[_0x7dc2('0x23')](function(){_0x56f481['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x273966,_0x5748b5){return function(_0x2266c0){if(!_0x2266c0){_0x273966[_0x7dc2('0x17')](0x194);}return _0x2266c0;};}function handleError(_0x82719,_0x4159f6){_0x4159f6=_0x4159f6||0x1f4;return function(_0x553efa){logger[_0x7dc2('0x26')](_0x553efa['stack']);if(_0x553efa[_0x7dc2('0x27')]){delete _0x553efa[_0x7dc2('0x27')];}_0x82719[_0x7dc2('0x18')](_0x4159f6)['send'](_0x553efa);};}exports['index']=function(_0x142839,_0x5349aa){var _0x5794da={},_0x2cd6ff={},_0x4de943={'count':0x0,'rows':[]};var _0x40b6c5=_[_0x7dc2('0x28')](db[_0x7dc2('0x29')][_0x7dc2('0x2a')],function(_0x3473a7){return{'name':_0x3473a7['fieldName'],'type':_0x3473a7[_0x7dc2('0x2b')][_0x7dc2('0x2c')]};});_0x2cd6ff[_0x7dc2('0x2d')]=_[_0x7dc2('0x28')](_0x40b6c5,_0x7dc2('0x27'));_0x2cd6ff[_0x7dc2('0x2e')]=_['keys'](_0x142839[_0x7dc2('0x2e')]);_0x2cd6ff[_0x7dc2('0x2f')]=_[_0x7dc2('0x30')](_0x2cd6ff[_0x7dc2('0x2d')],_0x2cd6ff[_0x7dc2('0x2e')]);_0x5794da[_0x7dc2('0x31')]=_[_0x7dc2('0x30')](_0x2cd6ff[_0x7dc2('0x2d')],qs[_0x7dc2('0x32')](_0x142839[_0x7dc2('0x2e')][_0x7dc2('0x32')]));_0x5794da[_0x7dc2('0x31')]=_0x5794da[_0x7dc2('0x31')][_0x7dc2('0x33')]?_0x5794da[_0x7dc2('0x31')]:_0x2cd6ff['model'];if(!_0x142839[_0x7dc2('0x2e')]['hasOwnProperty'](_0x7dc2('0x34'))){_0x5794da[_0x7dc2('0x1c')]=qs[_0x7dc2('0x1c')](_0x142839['query'][_0x7dc2('0x1c')]);_0x5794da[_0x7dc2('0x1a')]=qs[_0x7dc2('0x1a')](_0x142839[_0x7dc2('0x2e')][_0x7dc2('0x1a')]);}_0x5794da[_0x7dc2('0x35')]=qs[_0x7dc2('0x36')](_0x142839['query'][_0x7dc2('0x36')]);_0x5794da['where']=qs[_0x7dc2('0x2f')](_[_0x7dc2('0x37')](_0x142839[_0x7dc2('0x2e')],_0x2cd6ff[_0x7dc2('0x2f')]),_0x40b6c5);if(_0x142839['query']['filter']){_0x5794da['where']=_[_0x7dc2('0x38')](_0x5794da[_0x7dc2('0x39')],{'$or':_[_0x7dc2('0x28')](_0x40b6c5,function(_0x3c1aaa){if(_0x3c1aaa[_0x7dc2('0x2b')]!==_0x7dc2('0x3a')){var _0x411574={};_0x411574[_0x3c1aaa['name']]={'$like':'%'+_0x142839['query'][_0x7dc2('0x3b')]+'%'};return _0x411574;}})});}_0x5794da=_['merge']({},_0x5794da,_0x142839['options']);var _0x4b6c9c={'where':_0x5794da[_0x7dc2('0x39')]};return db[_0x7dc2('0x29')][_0x7dc2('0x1d')](_0x4b6c9c)[_0x7dc2('0x23')](function(_0x44d000){_0x4de943[_0x7dc2('0x1d')]=_0x44d000;if(_0x142839[_0x7dc2('0x2e')][_0x7dc2('0x3c')]){_0x5794da[_0x7dc2('0x3d')]=[{'all':!![]}];}return db['Trigger'][_0x7dc2('0x3e')](_0x5794da);})['then'](function(_0x9fdf22){_0x4de943[_0x7dc2('0x3f')]=_0x9fdf22;return _0x4de943;})[_0x7dc2('0x23')](respondWithFilteredResult(_0x5349aa,_0x5794da))[_0x7dc2('0x40')](handleError(_0x5349aa,null));};exports[_0x7dc2('0x41')]=function(_0x914ac5,_0x496b5f){var _0x5d3b6a={'raw':![],'where':{'id':_0x914ac5[_0x7dc2('0x42')]['id']}},_0x100410={};_0x100410[_0x7dc2('0x2d')]=_['keys'](db[_0x7dc2('0x29')][_0x7dc2('0x2a')]);_0x100410[_0x7dc2('0x2e')]=_[_0x7dc2('0x43')](_0x914ac5[_0x7dc2('0x2e')]);_0x100410[_0x7dc2('0x2f')]=_[_0x7dc2('0x30')](_0x100410[_0x7dc2('0x2d')],_0x100410[_0x7dc2('0x2e')]);_0x5d3b6a[_0x7dc2('0x31')]=_['intersection'](_0x100410[_0x7dc2('0x2d')],qs['fields'](_0x914ac5[_0x7dc2('0x2e')][_0x7dc2('0x32')]));_0x5d3b6a[_0x7dc2('0x31')]=_0x5d3b6a[_0x7dc2('0x31')][_0x7dc2('0x33')]?_0x5d3b6a[_0x7dc2('0x31')]:_0x100410[_0x7dc2('0x2d')];if(_0x914ac5[_0x7dc2('0x2e')][_0x7dc2('0x3c')]){_0x5d3b6a[_0x7dc2('0x3d')]=[{'all':!![]}];}_0x5d3b6a=_['merge']({},_0x5d3b6a,_0x914ac5[_0x7dc2('0x44')]);return db[_0x7dc2('0x29')][_0x7dc2('0x45')](_0x5d3b6a)[_0x7dc2('0x23')](handleEntityNotFound(_0x496b5f,null))[_0x7dc2('0x23')](respondWithResult(_0x496b5f,null))['catch'](handleError(_0x496b5f,null));};exports[_0x7dc2('0x46')]=function(_0x4c79ee,_0xcefe2a){return db[_0x7dc2('0x29')][_0x7dc2('0x46')](_0x4c79ee[_0x7dc2('0x47')],{})[_0x7dc2('0x23')](function(_0x5f265c){var _0x285663=_0x4c79ee['user'][_0x7dc2('0x24')]({'plain':!![]});if(!_0x285663)throw new Error(_0x7dc2('0x48'));if(_0x285663['role']===_0x7dc2('0x49')){var _0x2ccb97=_0x5f265c[_0x7dc2('0x24')]({'plain':!![]});var _0x2e58f7='Triggers';return db[_0x7dc2('0x4a')][_0x7dc2('0x45')]({'where':{'name':_0x2e58f7,'userProfileId':_0x285663[_0x7dc2('0x4b')]},'raw':!![]})[_0x7dc2('0x23')](function(_0x1271a8){if(_0x1271a8&&_0x1271a8[_0x7dc2('0x4c')]===0x0){return db[_0x7dc2('0x4d')]['create']({'name':_0x2ccb97[_0x7dc2('0x27')],'resourceId':_0x2ccb97['id'],'type':_0x1271a8[_0x7dc2('0x27')],'sectionId':_0x1271a8['id']},{})[_0x7dc2('0x23')](function(){return _0x5f265c;});}else{return _0x5f265c;}})[_0x7dc2('0x40')](function(_0x2fb47a){logger['error'](_0x7dc2('0x4e'),_0x2fb47a);throw _0x2fb47a;});}return _0x5f265c;})[_0x7dc2('0x23')](respondWithResult(_0xcefe2a,0xc9))[_0x7dc2('0x40')](handleError(_0xcefe2a,null));};exports[_0x7dc2('0x4f')]=function(_0x30a512,_0x3a0748){if(_0x30a512['body']['id']){delete _0x30a512[_0x7dc2('0x47')]['id'];}return db[_0x7dc2('0x29')][_0x7dc2('0x45')]({'where':{'id':_0x30a512[_0x7dc2('0x42')]['id']}})[_0x7dc2('0x23')](handleEntityNotFound(_0x3a0748,null))['then'](saveUpdates(_0x30a512[_0x7dc2('0x47')],null))['then'](respondWithResult(_0x3a0748,null))[_0x7dc2('0x40')](handleError(_0x3a0748,null));};exports[_0x7dc2('0x25')]=function(_0x9aa853,_0x5cfb2a){return db[_0x7dc2('0x29')][_0x7dc2('0x45')]({'where':{'id':_0x9aa853[_0x7dc2('0x42')]['id']}})[_0x7dc2('0x23')](handleEntityNotFound(_0x5cfb2a,null))['then'](removeEntity(_0x5cfb2a,null))[_0x7dc2('0x40')](handleError(_0x5cfb2a,null));};exports[_0x7dc2('0x50')]=function(_0x56c286,_0xde93cf,_0x22f8ac){if(_0x56c286['body']['id']){delete _0x56c286[_0x7dc2('0x47')]['id'];}return db[_0x7dc2('0x29')][_0x7dc2('0x45')]({'where':{'id':_0x56c286[_0x7dc2('0x42')]['id']}})['then'](handleEntityNotFound(_0xde93cf,null))['then'](function(_0xa5b63c){if(_0xa5b63c){_0x56c286['body'][_0x7dc2('0x51')]=_0xa5b63c['id'];return db[_0x7dc2('0x52')][_0x7dc2('0x46')](_0x56c286[_0x7dc2('0x47')]);}})['then'](respondWithResult(_0xde93cf,null))['catch'](handleError(_0xde93cf,null));};exports['addAnyCondition']=function(_0x1e94a0,_0x59c111,_0x30bd8d){if(_0x1e94a0['body']['id']){delete _0x1e94a0[_0x7dc2('0x47')]['id'];}return db[_0x7dc2('0x29')][_0x7dc2('0x45')]({'where':{'id':_0x1e94a0[_0x7dc2('0x42')]['id']}})[_0x7dc2('0x23')](handleEntityNotFound(_0x59c111,null))[_0x7dc2('0x23')](function(_0x3fbd5b){if(_0x3fbd5b){_0x1e94a0[_0x7dc2('0x47')][_0x7dc2('0x53')]=_0x3fbd5b['id'];return db[_0x7dc2('0x52')][_0x7dc2('0x46')](_0x1e94a0[_0x7dc2('0x47')]);}})[_0x7dc2('0x23')](respondWithResult(_0x59c111,null))[_0x7dc2('0x40')](handleError(_0x59c111,null));};exports[_0x7dc2('0x54')]=function(_0x5b0295,_0x4a1a5e,_0x5a3df6){var _0x4fac06={};var _0x50c3ec={};var _0x3a645e;var _0x226380;return db[_0x7dc2('0x29')][_0x7dc2('0x55')]({'where':{'id':_0x5b0295[_0x7dc2('0x42')]['id']}})['then'](handleEntityNotFound(_0x4a1a5e,null))[_0x7dc2('0x23')](function(_0x2a82f3){if(_0x2a82f3){_0x3a645e=_0x2a82f3;_0x50c3ec['model']=_[_0x7dc2('0x43')](db[_0x7dc2('0x52')][_0x7dc2('0x2a')]);_0x50c3ec[_0x7dc2('0x2e')]=_[_0x7dc2('0x43')](_0x5b0295[_0x7dc2('0x2e')]);_0x50c3ec[_0x7dc2('0x2f')]=_[_0x7dc2('0x30')](_0x50c3ec[_0x7dc2('0x2d')],_0x50c3ec[_0x7dc2('0x2e')]);_0x4fac06[_0x7dc2('0x31')]=_[_0x7dc2('0x30')](_0x50c3ec[_0x7dc2('0x2d')],qs['fields'](_0x5b0295[_0x7dc2('0x2e')]['fields']));_0x4fac06['attributes']=_0x4fac06[_0x7dc2('0x31')]['length']?_0x4fac06[_0x7dc2('0x31')]:_0x50c3ec['model'];_0x4fac06[_0x7dc2('0x35')]=qs[_0x7dc2('0x36')](_0x5b0295[_0x7dc2('0x2e')][_0x7dc2('0x36')]);_0x4fac06[_0x7dc2('0x39')]=qs['filters'](_[_0x7dc2('0x37')](_0x5b0295['query'],_0x50c3ec[_0x7dc2('0x2f')]));if(_0x5b0295[_0x7dc2('0x2e')][_0x7dc2('0x3b')]){_0x4fac06[_0x7dc2('0x39')]=_[_0x7dc2('0x38')](_0x4fac06[_0x7dc2('0x39')],{'$or':_['map'](_0x4fac06[_0x7dc2('0x31')],function(_0x1fd117){var _0x35a475={};_0x35a475[_0x1fd117]={'$like':'%'+_0x5b0295['query'][_0x7dc2('0x3b')]+'%'};return _0x35a475;})});}_0x4fac06=_[_0x7dc2('0x38')]({},_0x4fac06,_0x5b0295[_0x7dc2('0x44')]);return _0x3a645e['getAllConditions'](_0x4fac06);}})[_0x7dc2('0x23')](function(_0x31d337){if(_0x31d337){_0x226380=_0x31d337[_0x7dc2('0x33')];if(!_0x5b0295[_0x7dc2('0x2e')][_0x7dc2('0x56')](_0x7dc2('0x34'))){_0x4fac06[_0x7dc2('0x1c')]=qs[_0x7dc2('0x1c')](_0x5b0295[_0x7dc2('0x2e')][_0x7dc2('0x1c')]);_0x4fac06[_0x7dc2('0x1a')]=qs['offset'](_0x5b0295['query'][_0x7dc2('0x1a')]);}return _0x3a645e[_0x7dc2('0x54')](_0x4fac06);}})[_0x7dc2('0x23')](function(_0x892a49){if(_0x892a49){return _0x892a49?{'count':_0x226380,'rows':_0x892a49}:null;}})[_0x7dc2('0x23')](respondWithResult(_0x4a1a5e,null))[_0x7dc2('0x40')](handleError(_0x4a1a5e,null));};exports[_0x7dc2('0x57')]=function(_0x1d95a6,_0x3860f8,_0x570d0a){var _0x1911ea={};var _0xdafbfb={};var _0x41e316;var _0x177d4e;return db[_0x7dc2('0x29')]['findOne']({'where':{'id':_0x1d95a6[_0x7dc2('0x42')]['id']}})[_0x7dc2('0x23')](handleEntityNotFound(_0x3860f8,null))[_0x7dc2('0x23')](function(_0x52826b){if(_0x52826b){_0x41e316=_0x52826b;_0xdafbfb[_0x7dc2('0x2d')]=_[_0x7dc2('0x43')](db['Condition']['rawAttributes']);_0xdafbfb[_0x7dc2('0x2e')]=_[_0x7dc2('0x43')](_0x1d95a6[_0x7dc2('0x2e')]);_0xdafbfb[_0x7dc2('0x2f')]=_[_0x7dc2('0x30')](_0xdafbfb[_0x7dc2('0x2d')],_0xdafbfb[_0x7dc2('0x2e')]);_0x1911ea['attributes']=_[_0x7dc2('0x30')](_0xdafbfb[_0x7dc2('0x2d')],qs[_0x7dc2('0x32')](_0x1d95a6[_0x7dc2('0x2e')]['fields']));_0x1911ea['attributes']=_0x1911ea[_0x7dc2('0x31')]['length']?_0x1911ea[_0x7dc2('0x31')]:_0xdafbfb[_0x7dc2('0x2d')];_0x1911ea['order']=qs[_0x7dc2('0x36')](_0x1d95a6[_0x7dc2('0x2e')][_0x7dc2('0x36')]);_0x1911ea[_0x7dc2('0x39')]=qs[_0x7dc2('0x2f')](_[_0x7dc2('0x37')](_0x1d95a6[_0x7dc2('0x2e')],_0xdafbfb['filters']));if(_0x1d95a6[_0x7dc2('0x2e')]['filter']){_0x1911ea[_0x7dc2('0x39')]=_[_0x7dc2('0x38')](_0x1911ea[_0x7dc2('0x39')],{'$or':_['map'](_0x1911ea[_0x7dc2('0x31')],function(_0x5e8bb3){var _0xbe411b={};_0xbe411b[_0x5e8bb3]={'$like':'%'+_0x1d95a6[_0x7dc2('0x2e')][_0x7dc2('0x3b')]+'%'};return _0xbe411b;})});}_0x1911ea=_[_0x7dc2('0x38')]({},_0x1911ea,_0x1d95a6[_0x7dc2('0x44')]);return _0x41e316[_0x7dc2('0x57')](_0x1911ea);}})[_0x7dc2('0x23')](function(_0x5642bd){if(_0x5642bd){_0x177d4e=_0x5642bd[_0x7dc2('0x33')];if(!_0x1d95a6[_0x7dc2('0x2e')]['hasOwnProperty'](_0x7dc2('0x34'))){_0x1911ea[_0x7dc2('0x1c')]=qs[_0x7dc2('0x1c')](_0x1d95a6[_0x7dc2('0x2e')][_0x7dc2('0x1c')]);_0x1911ea[_0x7dc2('0x1a')]=qs[_0x7dc2('0x1a')](_0x1d95a6['query'][_0x7dc2('0x1a')]);}return _0x41e316[_0x7dc2('0x57')](_0x1911ea);}})[_0x7dc2('0x23')](function(_0x5db7a2){if(_0x5db7a2){return _0x5db7a2?{'count':_0x177d4e,'rows':_0x5db7a2}:null;}})[_0x7dc2('0x23')](respondWithResult(_0x3860f8,null))[_0x7dc2('0x40')](handleError(_0x3860f8,null));};exports[_0x7dc2('0x58')]=function(_0xddd39a,_0x894b0f,_0x460e7f){if(_0xddd39a['body']['id']){delete _0xddd39a[_0x7dc2('0x47')]['id'];}return db[_0x7dc2('0x29')][_0x7dc2('0x45')]({'where':{'id':_0xddd39a[_0x7dc2('0x42')]['id']}})['then'](handleEntityNotFound(_0x894b0f,null))[_0x7dc2('0x23')](function(_0x465218){if(_0x465218){_0xddd39a[_0x7dc2('0x47')][_0x7dc2('0x59')]=_0x465218['id'];return db['Action']['create'](_0xddd39a['body']);}})['then'](respondWithResult(_0x894b0f,null))[_0x7dc2('0x40')](handleError(_0x894b0f,null));};exports[_0x7dc2('0x5a')]=function(_0x25564f,_0x308f56,_0x4afc4d){var _0x2980dd={};var _0x2068cd={};var _0x4a0a2d;var _0x44778e;return db[_0x7dc2('0x29')]['findOne']({'where':{'id':_0x25564f['params']['id']}})[_0x7dc2('0x23')](handleEntityNotFound(_0x308f56,null))[_0x7dc2('0x23')](function(_0x826b8e){if(_0x826b8e){_0x4a0a2d=_0x826b8e;_0x2068cd[_0x7dc2('0x2d')]=_[_0x7dc2('0x43')](db[_0x7dc2('0x5b')]['rawAttributes']);_0x2068cd[_0x7dc2('0x2e')]=_[_0x7dc2('0x43')](_0x25564f[_0x7dc2('0x2e')]);_0x2068cd[_0x7dc2('0x2f')]=_[_0x7dc2('0x30')](_0x2068cd[_0x7dc2('0x2d')],_0x2068cd[_0x7dc2('0x2e')]);_0x2980dd[_0x7dc2('0x31')]=_['intersection'](_0x2068cd[_0x7dc2('0x2d')],qs[_0x7dc2('0x32')](_0x25564f[_0x7dc2('0x2e')]['fields']));_0x2980dd[_0x7dc2('0x31')]=_0x2980dd[_0x7dc2('0x31')][_0x7dc2('0x33')]?_0x2980dd['attributes']:_0x2068cd[_0x7dc2('0x2d')];_0x2980dd['order']=qs[_0x7dc2('0x36')](_0x25564f[_0x7dc2('0x2e')][_0x7dc2('0x36')]);_0x2980dd[_0x7dc2('0x39')]=qs['filters'](_[_0x7dc2('0x37')](_0x25564f[_0x7dc2('0x2e')],_0x2068cd['filters']));if(_0x25564f['query'][_0x7dc2('0x3b')]){_0x2980dd['where']=_[_0x7dc2('0x38')](_0x2980dd['where'],{'$or':_[_0x7dc2('0x28')](_0x2980dd[_0x7dc2('0x31')],function(_0x1078e6){var _0x108165={};_0x108165[_0x1078e6]={'$like':'%'+_0x25564f[_0x7dc2('0x2e')][_0x7dc2('0x3b')]+'%'};return _0x108165;})});}_0x2980dd=_[_0x7dc2('0x38')]({},_0x2980dd,_0x25564f['options']);return _0x4a0a2d[_0x7dc2('0x5a')](_0x2980dd);}})[_0x7dc2('0x23')](function(_0x3f1b42){if(_0x3f1b42){_0x44778e=_0x3f1b42['length'];if(!_0x25564f[_0x7dc2('0x2e')][_0x7dc2('0x56')](_0x7dc2('0x34'))){_0x2980dd[_0x7dc2('0x1c')]=qs[_0x7dc2('0x1c')](_0x25564f[_0x7dc2('0x2e')][_0x7dc2('0x1c')]);_0x2980dd[_0x7dc2('0x1a')]=qs[_0x7dc2('0x1a')](_0x25564f['query'][_0x7dc2('0x1a')]);}return _0x4a0a2d['getActions'](_0x2980dd);}})['then'](function(_0x46057b){if(_0x46057b){return _0x46057b?{'count':_0x44778e,'rows':_0x46057b}:null;}})[_0x7dc2('0x23')](respondWithResult(_0x308f56,null))['catch'](handleError(_0x308f56,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index edfccb5..e3dd5af 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 _0xfd7b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','util'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xfd7b[_0x2ff238];return _0x204a56;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var logger=require(_0xbfd7('0x1'))(_0xbfd7('0x2'));var moment=require(_0xbfd7('0x3'));var BPromise=require(_0xbfd7('0x4'));var rp=require(_0xbfd7('0x5'));var fs=require('fs');var path=require(_0xbfd7('0x6'));var rimraf=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var attributes=require(_0xbfd7('0x9'));module[_0xbfd7('0xa')]=function(_0x2ad158,_0x639dd4){return _0x2ad158['define'](_0xbfd7('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5455=['util','../../config/logger','api','moment','bluebird','request-promise','path','./trigger.attributes','exports','define','Trigger'];(function(_0x35e507,_0x281b64){var _0x310ccb=function(_0x43a20f){while(--_0x43a20f){_0x35e507['push'](_0x35e507['shift']());}};_0x310ccb(++_0x281b64);}(_0x5455,0x197));var _0x5545=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5455[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var logger=require(_0x5545('0x1'))(_0x5545('0x2'));var moment=require(_0x5545('0x3'));var BPromise=require(_0x5545('0x4'));var rp=require(_0x5545('0x5'));var fs=require('fs');var path=require(_0x5545('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5545('0x7'));module[_0x5545('0x8')]=function(_0x5c22f1,_0x5a6ac7){return _0x5c22f1[_0x5545('0x9')](_0x5545('0xa'),attributes,{'tableName':'tools_triggers','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 de739ba..c806077 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 _0xf9ee=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','options','where','attributes','include','map','model','catch','ShowTrigger','find','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x334ec3,_0x1eaf31){var _0x4ca002=function(_0x5ef717){while(--_0x5ef717){_0x334ec3['push'](_0x334ec3['shift']());}};_0x4ca002(++_0x1eaf31);}(_0xf9ee,0x1c2));var _0xef9e=function(_0x2fba43,_0x4dc6b1){_0x2fba43=_0x2fba43-0x0;var _0x4a9480=_0xf9ee[_0x2fba43];return _0x4a9480;};'use strict';var _=require(_0xef9e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xef9e('0x1'));var fs=require('fs');var Redis=require(_0xef9e('0x2'));var db=require(_0xef9e('0x3'))['db'];var utils=require(_0xef9e('0x4'));var logger=require(_0xef9e('0x5'))(_0xef9e('0x6'));var config=require('../../config/environment');var jayson=require(_0xef9e('0x7'));var client=jayson['client'][_0xef9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20d2aa,_0x4eb102,_0x54e5d0){return new BPromise(function(_0xa21ef1,_0x285c63){return client[_0xef9e('0x9')](_0x20d2aa,_0x54e5d0)[_0xef9e('0xa')](function(_0x4d2c82){logger[_0xef9e('0xb')]('Trigger,\x20%s,\x20%s',_0x4eb102,_0xef9e('0xc'));logger[_0xef9e('0xd')](_0xef9e('0xe'),_0x4eb102,_0xef9e('0xc'),JSON[_0xef9e('0xf')](_0x4d2c82));if(_0x4d2c82[_0xef9e('0x10')]){if(_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x11')]===0x1f4){logger[_0xef9e('0x10')](_0xef9e('0x12'),_0x4eb102,_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x13')]);return _0x285c63(_0x4d2c82[_0xef9e('0x10')]['message']);}logger['error'](_0xef9e('0x12'),_0x4eb102,_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x13')]);return _0xa21ef1(_0x4d2c82[_0xef9e('0x10')][_0xef9e('0x13')]);}else{logger[_0xef9e('0xb')](_0xef9e('0x12'),_0x4eb102,'request\x20sent');_0xa21ef1(_0x4d2c82[_0xef9e('0x14')]['message']);}})['catch'](function(_0x1b544b){logger[_0xef9e('0x10')](_0xef9e('0x12'),_0x4eb102,_0x1b544b);_0x285c63(_0x1b544b);});});}exports[_0xef9e('0x15')]=function(_0xa1a551){var _0x58a964=this;return new Promise(function(_0x3a5da4,_0x7872db){return db[_0xef9e('0x16')]['findAll']({'raw':_0xa1a551['options']?_0xa1a551[_0xef9e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa1a551[_0xef9e('0x17')]?_0xa1a551[_0xef9e('0x17')][_0xef9e('0x18')]||null:null,'attributes':_0xa1a551[_0xef9e('0x17')]?_0xa1a551[_0xef9e('0x17')][_0xef9e('0x19')]||null:null,'limit':_0xa1a551['options']?_0xa1a551[_0xef9e('0x17')]['limit']||null:null,'include':_0xa1a551[_0xef9e('0x17')]?_0xa1a551[_0xef9e('0x17')][_0xef9e('0x1a')]?_[_0xef9e('0x1b')](_0xa1a551[_0xef9e('0x17')][_0xef9e('0x1a')],function(_0x1ce8f6){return{'model':db[_0x1ce8f6['model']],'as':_0x1ce8f6['as'],'attributes':_0x1ce8f6[_0xef9e('0x19')],'include':_0x1ce8f6[_0xef9e('0x1a')]?_[_0xef9e('0x1b')](_0x1ce8f6['include'],function(_0x5226b5){return{'model':db[_0x5226b5[_0xef9e('0x1c')]],'as':_0x5226b5['as'],'attributes':_0x5226b5[_0xef9e('0x19')],'include':_0x5226b5[_0xef9e('0x1a')]?_['map'](_0x5226b5[_0xef9e('0x1a')],function(_0x23de0b){return{'model':db[_0x23de0b[_0xef9e('0x1c')]],'as':_0x23de0b['as'],'attributes':_0x23de0b[_0xef9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xef9e('0xa')](function(_0x3bc84d){logger[_0xef9e('0xb')](_0xef9e('0x15'),_0xa1a551);logger[_0xef9e('0xd')](_0xef9e('0x15'),_0xa1a551,JSON[_0xef9e('0xf')](_0x3bc84d));_0x3a5da4(_0x3bc84d);})[_0xef9e('0x1d')](function(_0x6a74d){logger[_0xef9e('0x10')](_0xef9e('0x15'),_0x6a74d[_0xef9e('0x13')],_0xa1a551);_0x7872db(_0x58a964[_0xef9e('0x10')](0x1f4,_0x6a74d[_0xef9e('0x13')]));});});};exports[_0xef9e('0x1e')]=function(_0x4a611e){var _0x459f79=this;return new Promise(function(_0x5ea09f,_0x24c633){return db[_0xef9e('0x16')][_0xef9e('0x1f')]({'raw':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')][_0xef9e('0x20')]===undefined?!![]:![]:!![],'where':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')][_0xef9e('0x18')]||null:null,'attributes':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')]['attributes']||null:null,'include':_0x4a611e[_0xef9e('0x17')]?_0x4a611e[_0xef9e('0x17')][_0xef9e('0x1a')]?_['map'](_0x4a611e[_0xef9e('0x17')][_0xef9e('0x1a')],function(_0x2fe7de){return{'model':db[_0x2fe7de['model']],'as':_0x2fe7de['as'],'attributes':_0x2fe7de[_0xef9e('0x19')],'include':_0x2fe7de[_0xef9e('0x1a')]?_[_0xef9e('0x1b')](_0x2fe7de[_0xef9e('0x1a')],function(_0x162b9f){return{'model':db[_0x162b9f[_0xef9e('0x1c')]],'as':_0x162b9f['as'],'attributes':_0x162b9f['attributes'],'include':_0x162b9f[_0xef9e('0x1a')]?_['map'](_0x162b9f['include'],function(_0x44e768){return{'model':db[_0x44e768[_0xef9e('0x1c')]],'as':_0x44e768['as'],'attributes':_0x44e768[_0xef9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af1dd){logger[_0xef9e('0xb')]('ShowTrigger',_0x4a611e);logger[_0xef9e('0xd')](_0xef9e('0x1e'),_0x4a611e,JSON[_0xef9e('0xf')](_0x4af1dd));_0x5ea09f(_0x4af1dd);})[_0xef9e('0x1d')](function(_0x5184f8){logger[_0xef9e('0x10')](_0xef9e('0x1e'),_0x5184f8[_0xef9e('0x13')],_0x4a611e);_0x24c633(_0x459f79['error'](0x1f4,_0x5184f8[_0xef9e('0x13')]));});});}; \ No newline at end of file +var _0x115a=['include','map','model','attributes','then','ShowTrigger','Trigger','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrigger','findAll','options','where'];(function(_0x1f5677,_0x2bf8da){var _0x1d41b4=function(_0x2da96c){while(--_0x2da96c){_0x1f5677['push'](_0x1f5677['shift']());}};_0x1d41b4(++_0x2bf8da);}(_0x115a,0xda));var _0xa115=function(_0x1dff52,_0x232f1d){_0x1dff52=_0x1dff52-0x0;var _0x334279=_0x115a[_0x1dff52];return _0x334279;};'use strict';var _=require('lodash');var util=require(_0xa115('0x0'));var moment=require(_0xa115('0x1'));var BPromise=require('bluebird');var rs=require(_0xa115('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa115('0x3'))['db'];var utils=require(_0xa115('0x4'));var logger=require(_0xa115('0x5'))('rpc');var config=require(_0xa115('0x6'));var jayson=require(_0xa115('0x7'));var client=jayson[_0xa115('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7db931,_0x2cbab8,_0x5b41a8){return new BPromise(function(_0x2d4835,_0x20cebf){return client['request'](_0x7db931,_0x5b41a8)['then'](function(_0x3638a9){logger['info'](_0xa115('0x9'),_0x2cbab8,_0xa115('0xa'));logger[_0xa115('0xb')](_0xa115('0xc'),_0x2cbab8,_0xa115('0xa'),JSON[_0xa115('0xd')](_0x3638a9));if(_0x3638a9['error']){if(_0x3638a9['error']['code']===0x1f4){logger[_0xa115('0xe')](_0xa115('0x9'),_0x2cbab8,_0x3638a9[_0xa115('0xe')][_0xa115('0xf')]);return _0x20cebf(_0x3638a9[_0xa115('0xe')]['message']);}logger[_0xa115('0xe')](_0xa115('0x9'),_0x2cbab8,_0x3638a9['error']['message']);return _0x2d4835(_0x3638a9[_0xa115('0xe')][_0xa115('0xf')]);}else{logger[_0xa115('0x10')](_0xa115('0x9'),_0x2cbab8,_0xa115('0xa'));_0x2d4835(_0x3638a9[_0xa115('0x11')][_0xa115('0xf')]);}})['catch'](function(_0x330ab0){logger['error'](_0xa115('0x9'),_0x2cbab8,_0x330ab0);_0x20cebf(_0x330ab0);});});}exports[_0xa115('0x12')]=function(_0xc22269){var _0x164991=this;return new Promise(function(_0x1df393,_0x566b90){return db['Trigger'][_0xa115('0x13')]({'raw':_0xc22269['options']?_0xc22269[_0xa115('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xc22269[_0xa115('0x14')]?_0xc22269[_0xa115('0x14')][_0xa115('0x15')]||null:null,'attributes':_0xc22269[_0xa115('0x14')]?_0xc22269[_0xa115('0x14')]['attributes']||null:null,'limit':_0xc22269['options']?_0xc22269['options']['limit']||null:null,'include':_0xc22269['options']?_0xc22269[_0xa115('0x14')][_0xa115('0x16')]?_[_0xa115('0x17')](_0xc22269[_0xa115('0x14')][_0xa115('0x16')],function(_0x27579e){return{'model':db[_0x27579e[_0xa115('0x18')]],'as':_0x27579e['as'],'attributes':_0x27579e[_0xa115('0x19')],'include':_0x27579e['include']?_[_0xa115('0x17')](_0x27579e[_0xa115('0x16')],function(_0x58313b){return{'model':db[_0x58313b[_0xa115('0x18')]],'as':_0x58313b['as'],'attributes':_0x58313b[_0xa115('0x19')],'include':_0x58313b[_0xa115('0x16')]?_[_0xa115('0x17')](_0x58313b[_0xa115('0x16')],function(_0x2a4007){return{'model':db[_0x2a4007[_0xa115('0x18')]],'as':_0x2a4007['as'],'attributes':_0x2a4007[_0xa115('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa115('0x1a')](function(_0x31a98c){logger[_0xa115('0x10')](_0xa115('0x12'),_0xc22269);logger[_0xa115('0xb')](_0xa115('0x12'),_0xc22269,JSON[_0xa115('0xd')](_0x31a98c));_0x1df393(_0x31a98c);})['catch'](function(_0x34ce94){logger['error'](_0xa115('0x12'),_0x34ce94[_0xa115('0xf')],_0xc22269);_0x566b90(_0x164991[_0xa115('0xe')](0x1f4,_0x34ce94[_0xa115('0xf')]));});});};exports[_0xa115('0x1b')]=function(_0x6611a3){var _0x31328a=this;return new Promise(function(_0x5689dc,_0x158e6d){return db[_0xa115('0x1c')]['find']({'raw':_0x6611a3[_0xa115('0x14')]?_0x6611a3[_0xa115('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x6611a3['options']?_0x6611a3['options']['where']||null:null,'attributes':_0x6611a3[_0xa115('0x14')]?_0x6611a3['options'][_0xa115('0x19')]||null:null,'include':_0x6611a3['options']?_0x6611a3[_0xa115('0x14')][_0xa115('0x16')]?_[_0xa115('0x17')](_0x6611a3[_0xa115('0x14')]['include'],function(_0x387f79){return{'model':db[_0x387f79[_0xa115('0x18')]],'as':_0x387f79['as'],'attributes':_0x387f79['attributes'],'include':_0x387f79[_0xa115('0x16')]?_['map'](_0x387f79[_0xa115('0x16')],function(_0xaabb5d){return{'model':db[_0xaabb5d['model']],'as':_0xaabb5d['as'],'attributes':_0xaabb5d[_0xa115('0x19')],'include':_0xaabb5d[_0xa115('0x16')]?_[_0xa115('0x17')](_0xaabb5d[_0xa115('0x16')],function(_0x143dcb){return{'model':db[_0x143dcb[_0xa115('0x18')]],'as':_0x143dcb['as'],'attributes':_0x143dcb[_0xa115('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x247346){logger[_0xa115('0x10')](_0xa115('0x1b'),_0x6611a3);logger[_0xa115('0xb')](_0xa115('0x1b'),_0x6611a3,JSON[_0xa115('0xd')](_0x247346));_0x5689dc(_0x247346);})[_0xa115('0x1d')](function(_0x1e4a79){logger[_0xa115('0xe')](_0xa115('0x1b'),_0x1e4a79[_0xa115('0xf')],_0x6611a3);_0x158e6d(_0x31328a['error'](0x1f4,_0x1e4a79[_0xa115('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b72d8aa..a2ff9c8 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 _0xd3ab=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','clone','put','update'];(function(_0x4a7c20,_0x2bcda5){var _0x4c86fd=function(_0x5f1ea3){while(--_0x5f1ea3){_0x4a7c20['push'](_0x4a7c20['shift']());}};_0x4c86fd(++_0x2bcda5);}(_0xd3ab,0xe7));var _0xbd3a=function(_0x439824,_0x56bb00){_0x439824=_0x439824-0x0;var _0x358bf8=_0xd3ab[_0x439824];return _0x358bf8;};'use strict';var multer=require(_0xbd3a('0x0'));var util=require('util');var path=require(_0xbd3a('0x1'));var timeout=require(_0xbd3a('0x2'));var express=require(_0xbd3a('0x3'));var router=express[_0xbd3a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd3a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd3a('0x6'));var controller=require(_0xbd3a('0x7'));router['get']('/',auth[_0xbd3a('0x8')](),controller[_0xbd3a('0x9')]);router[_0xbd3a('0xa')](_0xbd3a('0xb'),auth[_0xbd3a('0x8')](),controller[_0xbd3a('0xc')]);router['post']('/:id/clone',auth[_0xbd3a('0x8')](),controller[_0xbd3a('0xd')]);router['post']('/',auth[_0xbd3a('0x8')](),controller['create']);router[_0xbd3a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xbd3a('0xf')]);router[_0xbd3a('0x10')]('/:id',auth[_0xbd3a('0x8')](),controller[_0xbd3a('0x11')]);module[_0xbd3a('0x12')]=router; \ No newline at end of file +var _0x65f3=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x65f3,0x70));var _0x365f=function(_0x5c5c44,_0x514f05){_0x5c5c44=_0x5c5c44-0x0;var _0x3cd96f=_0x65f3[_0x5c5c44];return _0x3cd96f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x365f('0x0'));var timeout=require(_0x365f('0x1'));var express=require('express');var router=express[_0x365f('0x2')]();var fs_extra=require(_0x365f('0x3'));var auth=require(_0x365f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x365f('0x5'));var controller=require('./trunk.controller');router[_0x365f('0x6')]('/',auth[_0x365f('0x7')](),controller[_0x365f('0x8')]);router[_0x365f('0x6')](_0x365f('0x9'),auth[_0x365f('0x7')](),controller[_0x365f('0xa')]);router[_0x365f('0xb')](_0x365f('0xc'),auth['isAuthenticated'](),controller[_0x365f('0xd')]);router[_0x365f('0xb')]('/',auth[_0x365f('0x7')](),controller['create']);router[_0x365f('0xe')](_0x365f('0x9'),auth['isAuthenticated'](),controller[_0x365f('0xf')]);router[_0x365f('0x10')]('/:id',auth[_0x365f('0x7')](),controller[_0x365f('0x11')]);module[_0x365f('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index af682c5..9ece910 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 _0xe039=['never','INTEGER','accept','refuse','originate','pai','fingerprint','active','passive','actpass','dynamic','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure'];(function(_0x81edcc,_0x288b9d){var _0x6dc6b3=function(_0x1688ff){while(--_0x1688ff){_0x81edcc['push'](_0x81edcc['shift']());}};_0x6dc6b3(++_0x288b9d);}(_0xe039,0x171));var _0x9e03=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xe039[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require('sequelize');module[_0x9e03('0x0')]={'name':{'type':Sequelize[_0x9e03('0x1')],'allowNull':![],'unique':_0x9e03('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x4'),_0x9e03('0x5'),_0x9e03('0x6')),'allowNull':![],'defaultValue':_0x9e03('0x4')},'context':{'type':Sequelize[_0x9e03('0x1')],'allowNull':![],'defaultValue':_0x9e03('0x7')},'callingpres':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x8'),_0x9e03('0x9'),_0x9e03('0xa'),_0x9e03('0xb'),_0x9e03('0xc'),_0x9e03('0xd'),_0x9e03('0xe'),_0x9e03('0xf'))},'deny':{'type':Sequelize[_0x9e03('0x1')]},'permit':{'type':Sequelize[_0x9e03('0x1')]},'secret':{'type':Sequelize[_0x9e03('0x1')]},'md5secret':{'type':Sequelize[_0x9e03('0x1')]},'remotesecret':{'type':Sequelize[_0x9e03('0x1')]},'transport':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':_0x9e03('0x10'),'set':function(_0x2d1252){this[_0x9e03('0x11')]('transport',_0x2d1252?_0x2d1252[_0x9e03('0x12')](','):null);},'get':function(){return this[_0x9e03('0x13')](_0x9e03('0x14'))?this[_0x9e03('0x13')](_0x9e03('0x14'))['split'](','):null;},'comment':_0x9e03('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9e03('0x16'),_0x9e03('0x17'),_0x9e03('0x18'),_0x9e03('0x19'),_0x9e03('0x1a')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no',_0x9e03('0x1c'),_0x9e03('0x1d'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9e03('0x1')]},'directmediadeny':{'type':Sequelize[_0x9e03('0x1')]},'nat':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':_0x9e03('0x1e'),'set':function(_0x167a6a){this[_0x9e03('0x11')](_0x9e03('0x1f'),_0x167a6a?_0x167a6a[_0x9e03('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x9e03('0x1f'))?this[_0x9e03('0x13')](_0x9e03('0x1f'))[_0x9e03('0x20')](','):null;},'comment':_0x9e03('0x21')},'callgroup':{'type':Sequelize[_0x9e03('0x1')]},'namedcallgroup':{'type':Sequelize[_0x9e03('0x1')]},'pickupgroup':{'type':Sequelize[_0x9e03('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x9e03('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e03('0x22'),'set':function(_0x8244c5){this[_0x9e03('0x11')](_0x9e03('0x23'),_0x8244c5?_0x8244c5['join'](';'):_0x9e03('0x22'));},'get':function(){return this[_0x9e03('0x13')]('allow')?this[_0x9e03('0x13')]('allow')[_0x9e03('0x20')](';'):null;},'comment':_0x9e03('0x24')},'autoframing':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x9e03('0x25'),'set':function(_0x19ff84){this[_0x9e03('0x11')]('insecure',_0x19ff84?_0x19ff84['join'](','):null);},'get':function(){return this['getDataValue'](_0x9e03('0x26'))?this['getDataValue']('insecure')[_0x9e03('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x9e03('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no',_0x9e03('0x27'))},'promiscredir':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x9e03('0x28')](0xb)},'setvar':{'type':Sequelize[_0x9e03('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9e03('0x1')]},'callcounter':{'type':Sequelize[_0x9e03('0x3')]('yes','no'),'defaultValue':_0x9e03('0x1b')},'busylevel':{'type':Sequelize[_0x9e03('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9e03('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9e03('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9e03('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9e03('0x3')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x29'),_0x9e03('0x2a'),_0x9e03('0x2b'))},'session_expires':{'type':Sequelize[_0x9e03('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x9e03('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x9e03('0x3')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x9e03('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x9e03('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9e03('0x28')](0x5)},'qualify':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no'),'defaultValue':_0x9e03('0x1b')},'keepalive':{'type':Sequelize[_0x9e03('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x9e03('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x9e03('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9e03('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x9e03('0x3')]('yes','no',_0x9e03('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9e03('0x1')]},'callbackextension':{'type':Sequelize[_0x9e03('0x1')]},'timert1':{'type':Sequelize[_0x9e03('0x28')](0xb)},'timerb':{'type':Sequelize[_0x9e03('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x9e03('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x9e03('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9e03('0x1')]},'use_q850_reason':{'type':Sequelize[_0x9e03('0x1')]},'maxforwards':{'type':Sequelize[_0x9e03('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x9e03('0x1b'),'no',_0x9e03('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x9e03('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9e03('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x9e03('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x9e03('0x2e'),_0x9e03('0x2f'),_0x9e03('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9e03('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9e03('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9e03('0x3')](_0x9e03('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x9e03('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x9e03('0x1')]},'mohinterpret':{'type':Sequelize[_0x9e03('0x1')]},'mohsuggest':{'type':Sequelize[_0x9e03('0x1')]},'parkinglot':{'type':Sequelize[_0x9e03('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':_0x9e03('0x31')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x9e03('0x1c'),_0x9e03('0x1d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9e03('0x1')]},'otherFields':{'type':Sequelize[_0x9e03('0x1')]},'active':{'type':Sequelize[_0x9e03('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9e03('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xbfc0=['ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x3b5540,_0x5f5926){var _0x1bae9a=function(_0x1addfb){while(--_0x1addfb){_0x3b5540['push'](_0x3b5540['shift']());}};_0x1bae9a(++_0x5f5926);}(_0xbfc0,0x14c));var _0x0bfc=function(_0x232eb7,_0x199b07){_0x232eb7=_0x232eb7-0x0;var _0xd7fb8=_0xbfc0[_0x232eb7];return _0xd7fb8;};'use strict';var Sequelize=require('sequelize');module[_0x0bfc('0x0')]={'name':{'type':Sequelize[_0x0bfc('0x1')],'allowNull':![],'unique':_0x0bfc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x4'),_0x0bfc('0x5'),_0x0bfc('0x6')),'allowNull':![],'defaultValue':_0x0bfc('0x4')},'context':{'type':Sequelize[_0x0bfc('0x1')],'allowNull':![],'defaultValue':_0x0bfc('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x0bfc('0x8'),_0x0bfc('0x9'),_0x0bfc('0xa'),_0x0bfc('0xb'),_0x0bfc('0xc'),_0x0bfc('0xd'),_0x0bfc('0xe'),_0x0bfc('0xf'))},'deny':{'type':Sequelize[_0x0bfc('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x0bfc('0x1')]},'md5secret':{'type':Sequelize[_0x0bfc('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0bfc('0x1')],'defaultValue':'udp','set':function(_0x247328){this[_0x0bfc('0x10')](_0x0bfc('0x11'),_0x247328?_0x247328[_0x0bfc('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x0bfc('0x11'))?this[_0x0bfc('0x13')](_0x0bfc('0x11'))['split'](','):null;},'comment':_0x0bfc('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0bfc('0x15'),_0x0bfc('0x16'),_0x0bfc('0x17'),'inband',_0x0bfc('0x18')),'defaultValue':_0x0bfc('0x15')},'directmedia':{'type':Sequelize[_0x0bfc('0x3')]('yes','no',_0x0bfc('0x19'),_0x0bfc('0x1a'),_0x0bfc('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0bfc('0x1')]},'directmediadeny':{'type':Sequelize[_0x0bfc('0x1')]},'nat':{'type':Sequelize[_0x0bfc('0x1')],'defaultValue':_0x0bfc('0x1d'),'set':function(_0x2f7a14){this[_0x0bfc('0x10')](_0x0bfc('0x1e'),_0x2f7a14?_0x2f7a14[_0x0bfc('0x12')](','):null);},'get':function(){return this[_0x0bfc('0x13')](_0x0bfc('0x1e'))?this[_0x0bfc('0x13')]('nat')['split'](','):null;},'comment':_0x0bfc('0x1f')},'callgroup':{'type':Sequelize[_0x0bfc('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0bfc('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x0bfc('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0bfc('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0bfc('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x0bfc('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x304a56){this[_0x0bfc('0x10')]('allow',_0x304a56?_0x304a56[_0x0bfc('0x12')](';'):_0x0bfc('0x20'));},'get':function(){return this[_0x0bfc('0x13')]('allow')?this[_0x0bfc('0x13')](_0x0bfc('0x21'))[_0x0bfc('0x22')](';'):null;},'comment':_0x0bfc('0x23')},'autoframing':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0bfc('0x24'),'set':function(_0x1607b6){this[_0x0bfc('0x10')](_0x0bfc('0x25'),_0x1607b6?_0x1607b6[_0x0bfc('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x0bfc('0x25'))?this[_0x0bfc('0x13')]('insecure')[_0x0bfc('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no','never')},'promiscredir':{'type':Sequelize[_0x0bfc('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0bfc('0x1')]},'callerid':{'type':Sequelize[_0x0bfc('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x0bfc('0x1')]},'callcounter':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x0bfc('0x1')]},'template':{'type':Sequelize[_0x0bfc('0x1')]},'videosupport':{'type':Sequelize[_0x0bfc('0x3')]('yes','no',_0x0bfc('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x28'),_0x0bfc('0x29'),'originate')},'session_expires':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x2a'),_0x0bfc('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x0bfc('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0bfc('0x1')]},'fromuser':{'type':Sequelize[_0x0bfc('0x1')]},'port':{'type':Sequelize[_0x0bfc('0x26')](0x5)},'qualify':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no',_0x0bfc('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0bfc('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x0bfc('0x1')]},'contactdeny':{'type':Sequelize[_0x0bfc('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x0bfc('0x1')]},'use_q850_reason':{'type':Sequelize[_0x0bfc('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0bfc('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x0bfc('0x3')]('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no')},'dtlsverify':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no',_0x0bfc('0x2d'),_0x0bfc('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x0bfc('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x0bfc('0x1')]},'dtlscafile':{'type':Sequelize[_0x0bfc('0x1')]},'dtlscapath':{'type':Sequelize[_0x0bfc('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x0bfc('0x2f'),_0x0bfc('0x30'),_0x0bfc('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0bfc('0x1')]},'usereqphone':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0bfc('0x1')]},'recordofffeature':{'type':Sequelize[_0x0bfc('0x1')]},'call_limit':{'type':Sequelize[_0x0bfc('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0x0bfc('0x3')](_0x0bfc('0x1c'),'no')},'vmexten':{'type':Sequelize[_0x0bfc('0x1')]},'mohinterpret':{'type':Sequelize[_0x0bfc('0x1')]},'mohsuggest':{'type':Sequelize[_0x0bfc('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0bfc('0x1')],'defaultValue':_0x0bfc('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0x0bfc('0x1c'),'no','nonat',_0x0bfc('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0bfc('0x1')]},'otherFields':{'type':Sequelize[_0x0bfc('0x1')]},'active':{'type':Sequelize[_0x0bfc('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0bfc('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 1c0af80..921fd1c 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 _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x40659a,_0xed5f45){var _0x44a44a=function(_0x193f9a){while(--_0x193f9a){_0x40659a['push'](_0x40659a['shift']());}};_0x44a44a(++_0xed5f45);}(_0x425d,0x1e0));var _0xd425=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x425d[_0x1857c6];return _0x51011c;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file +var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x27e6f3,_0xe49002){var _0x30d748=function(_0x2876cf){while(--_0x2876cf){_0x27e6f3['push'](_0x27e6f3['shift']());}};_0x30d748(++_0xe49002);}(_0x425d,0x1e0));var _0xd425=function(_0x3e8c07,_0x2e27b6){_0x3e8c07=_0x3e8c07-0x0;var _0x14d3e5=_0x425d[_0x3e8c07];return _0x14d3e5;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 1aa835d..241d167 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 _0x211b=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x2861fd,_0x45a1e6){var _0x443ecb=function(_0x1ebd2e){while(--_0x1ebd2e){_0x2861fd['push'](_0x2861fd['shift']());}};_0x443ecb(++_0x45a1e6);}(_0x211b,0x144));var _0xb211=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x211b[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xb211('0x0'));var util=require(_0xb211('0x1'));var logger=require(_0xb211('0x2'))(_0xb211('0x3'));var moment=require('moment');var BPromise=require(_0xb211('0x4'));var rp=require(_0xb211('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb211('0x6'));var config=require('../../config/environment');var attributes=require(_0xb211('0x7'));module[_0xb211('0x8')]=function(_0x384887,_0x26ce98){return _0x384887[_0xb211('0x9')](_0xb211('0xa'),attributes,{'tableName':_0xb211('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d95=['path','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','api','request-promise'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x3d95,0xf0));var _0x53d9=function(_0x10c188,_0x50e0f){_0x10c188=_0x10c188-0x0;var _0x490c55=_0x3d95[_0x10c188];return _0x490c55;};'use strict';var _=require(_0x53d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x53d9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53d9('0x2'));var fs=require('fs');var path=require(_0x53d9('0x3'));var rimraf=require('rimraf');var config=require(_0x53d9('0x4'));var attributes=require(_0x53d9('0x5'));module[_0x53d9('0x6')]=function(_0x479f08,_0x1c81b5){return _0x479f08[_0x53d9('0x7')](_0x53d9('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index aea4a57..fa309aa 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 _0x1750=['options','raw','where','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','Trunk','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x1750,0xbb));var _0x0175=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1750[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0175('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0175('0x1'));var rs=require(_0x0175('0x2'));var fs=require('fs');var Redis=require(_0x0175('0x3'));var db=require(_0x0175('0x4'))['db'];var utils=require(_0x0175('0x5'));var logger=require(_0x0175('0x6'))(_0x0175('0x7'));var config=require(_0x0175('0x8'));var jayson=require(_0x0175('0x9'));var client=jayson[_0x0175('0xa')][_0x0175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe15,_0x32c41a,_0x57c1a8){return new BPromise(function(_0x37c961,_0x49f802){return client['request'](_0x49fe15,_0x57c1a8)['then'](function(_0x38fd90){logger[_0x0175('0xc')](_0x0175('0xd'),_0x32c41a,_0x0175('0xe'));logger[_0x0175('0xf')](_0x0175('0x10'),_0x32c41a,_0x0175('0xe'),JSON[_0x0175('0x11')](_0x38fd90));if(_0x38fd90[_0x0175('0x12')]){if(_0x38fd90[_0x0175('0x12')]['code']===0x1f4){logger[_0x0175('0x12')]('Trunk,\x20%s,\x20%s',_0x32c41a,_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);return _0x49f802(_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);}logger[_0x0175('0x12')]('Trunk,\x20%s,\x20%s',_0x32c41a,_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);return _0x37c961(_0x38fd90[_0x0175('0x12')][_0x0175('0x13')]);}else{logger[_0x0175('0xc')](_0x0175('0xd'),_0x32c41a,'request\x20sent');_0x37c961(_0x38fd90[_0x0175('0x14')][_0x0175('0x13')]);}})[_0x0175('0x15')](function(_0x414a14){logger['error'](_0x0175('0xd'),_0x32c41a,_0x414a14);_0x49f802(_0x414a14);});});}exports['GetTrunk']=function(_0x42320a){var _0x3ebbd7=this;return new Promise(function(_0x4f274a,_0x202a19){return db['Trunk'][_0x0175('0x16')]({'raw':_0x42320a[_0x0175('0x17')]?_0x42320a[_0x0175('0x17')][_0x0175('0x18')]===undefined?!![]:![]:!![],'where':_0x42320a[_0x0175('0x17')]?_0x42320a[_0x0175('0x17')][_0x0175('0x19')]||null:null,'attributes':_0x42320a['options']?_0x42320a[_0x0175('0x17')][_0x0175('0x1a')]||null:null,'limit':_0x42320a[_0x0175('0x17')]?_0x42320a[_0x0175('0x17')][_0x0175('0x1b')]||null:null,'include':_0x42320a['options']?_0x42320a[_0x0175('0x17')][_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x42320a[_0x0175('0x17')][_0x0175('0x1c')],function(_0x55113b){return{'model':db[_0x55113b[_0x0175('0x1e')]],'as':_0x55113b['as'],'attributes':_0x55113b[_0x0175('0x1a')],'include':_0x55113b[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x55113b[_0x0175('0x1c')],function(_0x2a7ee9){return{'model':db[_0x2a7ee9[_0x0175('0x1e')]],'as':_0x2a7ee9['as'],'attributes':_0x2a7ee9[_0x0175('0x1a')],'include':_0x2a7ee9[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x2a7ee9[_0x0175('0x1c')],function(_0x1ebba0){return{'model':db[_0x1ebba0['model']],'as':_0x1ebba0['as'],'attributes':_0x1ebba0[_0x0175('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0175('0x1f')](function(_0x376b37){logger['info']('GetTrunk',_0x42320a);logger[_0x0175('0xf')](_0x0175('0x20'),_0x42320a,JSON[_0x0175('0x11')](_0x376b37));_0x4f274a(_0x376b37);})[_0x0175('0x15')](function(_0x3eff86){logger['error'](_0x0175('0x20'),_0x3eff86['message'],_0x42320a);_0x202a19(_0x3ebbd7[_0x0175('0x12')](0x1f4,_0x3eff86[_0x0175('0x13')]));});});};exports[_0x0175('0x21')]=function(_0x406416){var _0x3de7f0=this;return new Promise(function(_0x31bff5,_0xa47c56){return db[_0x0175('0x22')]['find']({'raw':_0x406416['options']?_0x406416['options'][_0x0175('0x18')]===undefined?!![]:![]:!![],'where':_0x406416[_0x0175('0x17')]?_0x406416[_0x0175('0x17')]['where']||null:null,'attributes':_0x406416[_0x0175('0x17')]?_0x406416['options']['attributes']||null:null,'include':_0x406416[_0x0175('0x17')]?_0x406416[_0x0175('0x17')][_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x406416[_0x0175('0x17')][_0x0175('0x1c')],function(_0xbacdc2){return{'model':db[_0xbacdc2[_0x0175('0x1e')]],'as':_0xbacdc2['as'],'attributes':_0xbacdc2[_0x0175('0x1a')],'include':_0xbacdc2[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0xbacdc2[_0x0175('0x1c')],function(_0x3aafdf){return{'model':db[_0x3aafdf[_0x0175('0x1e')]],'as':_0x3aafdf['as'],'attributes':_0x3aafdf[_0x0175('0x1a')],'include':_0x3aafdf[_0x0175('0x1c')]?_[_0x0175('0x1d')](_0x3aafdf['include'],function(_0x55648f){return{'model':db[_0x55648f[_0x0175('0x1e')]],'as':_0x55648f['as'],'attributes':_0x55648f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0175('0x1f')](function(_0x5efa80){logger['info'](_0x0175('0x21'),_0x406416);logger[_0x0175('0xf')]('ShowTrunk',_0x406416,JSON['stringify'](_0x5efa80));_0x31bff5(_0x5efa80);})['catch'](function(_0x269492){logger['error']('ShowTrunk',_0x269492[_0x0175('0x13')],_0x406416);_0xa47c56(_0x3de7f0[_0x0175('0x12')](0x1f4,_0x269492[_0x0175('0x13')]));});});}; \ No newline at end of file +var _0x2d30=['../../config/utils','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','model','map','ShowTrunk','find','lodash','moment','ioredis','../../mysqldb'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2d30,0xbc));var _0x02d3=function(_0x210b93,_0x133e6d){_0x210b93=_0x210b93-0x0;var _0x2b020f=_0x2d30[_0x210b93];return _0x2b020f;};'use strict';var _=require(_0x02d3('0x0'));var util=require('util');var moment=require(_0x02d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02d3('0x2'));var db=require(_0x02d3('0x3'))['db'];var utils=require(_0x02d3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x02d3('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x02d3('0x6')][_0x02d3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35deb5,_0x122fd5,_0x388fbb){return new BPromise(function(_0x376b70,_0xdbedcf){return client[_0x02d3('0x8')](_0x35deb5,_0x388fbb)[_0x02d3('0x9')](function(_0x291706){logger[_0x02d3('0xa')](_0x02d3('0xb'),_0x122fd5,_0x02d3('0xc'));logger[_0x02d3('0xd')](_0x02d3('0xe'),_0x122fd5,_0x02d3('0xc'),JSON[_0x02d3('0xf')](_0x291706));if(_0x291706[_0x02d3('0x10')]){if(_0x291706['error'][_0x02d3('0x11')]===0x1f4){logger[_0x02d3('0x10')](_0x02d3('0xb'),_0x122fd5,_0x291706['error'][_0x02d3('0x12')]);return _0xdbedcf(_0x291706[_0x02d3('0x10')][_0x02d3('0x12')]);}logger[_0x02d3('0x10')](_0x02d3('0xb'),_0x122fd5,_0x291706[_0x02d3('0x10')][_0x02d3('0x12')]);return _0x376b70(_0x291706[_0x02d3('0x10')][_0x02d3('0x12')]);}else{logger[_0x02d3('0xa')]('Trunk,\x20%s,\x20%s',_0x122fd5,_0x02d3('0xc'));_0x376b70(_0x291706['result'][_0x02d3('0x12')]);}})[_0x02d3('0x13')](function(_0x370e50){logger['error'](_0x02d3('0xb'),_0x122fd5,_0x370e50);_0xdbedcf(_0x370e50);});});}exports[_0x02d3('0x14')]=function(_0x3ec08c){var _0x351a89=this;return new Promise(function(_0x15a245,_0x46f575){return db[_0x02d3('0x15')][_0x02d3('0x16')]({'raw':_0x3ec08c[_0x02d3('0x17')]?_0x3ec08c[_0x02d3('0x17')][_0x02d3('0x18')]===undefined?!![]:![]:!![],'where':_0x3ec08c['options']?_0x3ec08c[_0x02d3('0x17')][_0x02d3('0x19')]||null:null,'attributes':_0x3ec08c['options']?_0x3ec08c[_0x02d3('0x17')][_0x02d3('0x1a')]||null:null,'limit':_0x3ec08c[_0x02d3('0x17')]?_0x3ec08c['options']['limit']||null:null,'include':_0x3ec08c[_0x02d3('0x17')]?_0x3ec08c[_0x02d3('0x17')]['include']?_['map'](_0x3ec08c[_0x02d3('0x17')][_0x02d3('0x1b')],function(_0x1a2375){return{'model':db[_0x1a2375[_0x02d3('0x1c')]],'as':_0x1a2375['as'],'attributes':_0x1a2375[_0x02d3('0x1a')],'include':_0x1a2375[_0x02d3('0x1b')]?_[_0x02d3('0x1d')](_0x1a2375['include'],function(_0x248e10){return{'model':db[_0x248e10[_0x02d3('0x1c')]],'as':_0x248e10['as'],'attributes':_0x248e10[_0x02d3('0x1a')],'include':_0x248e10[_0x02d3('0x1b')]?_[_0x02d3('0x1d')](_0x248e10[_0x02d3('0x1b')],function(_0x395034){return{'model':db[_0x395034[_0x02d3('0x1c')]],'as':_0x395034['as'],'attributes':_0x395034['attributes']};}):[]};}):[]};}):[]:[]})[_0x02d3('0x9')](function(_0x7d7e99){logger['info'](_0x02d3('0x14'),_0x3ec08c);logger[_0x02d3('0xd')](_0x02d3('0x14'),_0x3ec08c,JSON['stringify'](_0x7d7e99));_0x15a245(_0x7d7e99);})['catch'](function(_0x24ce76){logger['error'](_0x02d3('0x14'),_0x24ce76['message'],_0x3ec08c);_0x46f575(_0x351a89[_0x02d3('0x10')](0x1f4,_0x24ce76[_0x02d3('0x12')]));});});};exports[_0x02d3('0x1e')]=function(_0x100d29){var _0x51de4b=this;return new Promise(function(_0x453e55,_0x11dd9c){return db[_0x02d3('0x15')][_0x02d3('0x1f')]({'raw':_0x100d29[_0x02d3('0x17')]?_0x100d29['options'][_0x02d3('0x18')]===undefined?!![]:![]:!![],'where':_0x100d29['options']?_0x100d29['options'][_0x02d3('0x19')]||null:null,'attributes':_0x100d29[_0x02d3('0x17')]?_0x100d29['options'][_0x02d3('0x1a')]||null:null,'include':_0x100d29['options']?_0x100d29[_0x02d3('0x17')][_0x02d3('0x1b')]?_[_0x02d3('0x1d')](_0x100d29[_0x02d3('0x17')]['include'],function(_0x15b7b9){return{'model':db[_0x15b7b9[_0x02d3('0x1c')]],'as':_0x15b7b9['as'],'attributes':_0x15b7b9[_0x02d3('0x1a')],'include':_0x15b7b9[_0x02d3('0x1b')]?_['map'](_0x15b7b9[_0x02d3('0x1b')],function(_0x5de9b3){return{'model':db[_0x5de9b3['model']],'as':_0x5de9b3['as'],'attributes':_0x5de9b3[_0x02d3('0x1a')],'include':_0x5de9b3[_0x02d3('0x1b')]?_['map'](_0x5de9b3[_0x02d3('0x1b')],function(_0x46f024){return{'model':db[_0x46f024[_0x02d3('0x1c')]],'as':_0x46f024['as'],'attributes':_0x46f024[_0x02d3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x02d3('0x9')](function(_0x547cc8){logger[_0x02d3('0xa')](_0x02d3('0x1e'),_0x100d29);logger[_0x02d3('0xd')](_0x02d3('0x1e'),_0x100d29,JSON['stringify'](_0x547cc8));_0x453e55(_0x547cc8);})[_0x02d3('0x13')](function(_0x598872){logger[_0x02d3('0x10')](_0x02d3('0x1e'),_0x598872[_0x02d3('0x12')],_0x100d29);_0x11dd9c(_0x51de4b['error'](0x1f4,_0x598872[_0x02d3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 3881393..77c7559 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 _0xb580=['addSmsAccounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','update','put','delete','removeQueues','/:id','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/prefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','file','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xb580,0x1cf));var _0x0b58=function(_0x71e052,_0x35434c){_0x71e052=_0x71e052-0x0;var _0x13e2c5=_0xb580[_0x71e052];return _0x13e2c5;};'use strict';var multer=require(_0x0b58('0x0'));var util=require(_0x0b58('0x1'));var path=require(_0x0b58('0x2'));var timeout=require(_0x0b58('0x3'));var express=require('express');var router=express[_0x0b58('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0b58('0x5'));var config=require('../../config/environment');var controller=require(_0x0b58('0x6'));router[_0x0b58('0x7')]('/',auth[_0x0b58('0x8')](),controller[_0x0b58('0x9')]);router[_0x0b58('0x7')](_0x0b58('0xa'),auth[_0x0b58('0x8')](),controller[_0x0b58('0xb')]);router[_0x0b58('0x7')](_0x0b58('0xc'),auth[_0x0b58('0x8')](),controller['whoami']);router['get'](_0x0b58('0xd'),auth['isAuthenticated'](),controller[_0x0b58('0xe')]);router[_0x0b58('0x7')]('/:id',auth[_0x0b58('0x8')](),controller[_0x0b58('0xf')]);router[_0x0b58('0x7')](_0x0b58('0x10'),controller[_0x0b58('0x11')]);router['get'](_0x0b58('0x12'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x13')]);router['get'](_0x0b58('0x14'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x15')]);router[_0x0b58('0x7')](_0x0b58('0x16'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x17')]);router[_0x0b58('0x7')]('/:id/queues_rt',auth[_0x0b58('0x8')](),controller[_0x0b58('0x18')]);router['get'](_0x0b58('0x19'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x1a')]);router[_0x0b58('0x7')](_0x0b58('0x1b'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x1c')]);router['get']('/:id/screen_recordings',auth[_0x0b58('0x8')](),controller[_0x0b58('0x1d')]);router[_0x0b58('0x7')](_0x0b58('0x1e'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x1f')]);router[_0x0b58('0x7')](_0x0b58('0x20'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x21')]);router[_0x0b58('0x7')]('/:id/mail/interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x22')]);router[_0x0b58('0x7')]('/:id/sms/interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x23')]);router[_0x0b58('0x7')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x0b58('0x7')](_0x0b58('0x24'),auth['isAuthenticated'](),controller[_0x0b58('0x25')]);router[_0x0b58('0x7')](_0x0b58('0x26'),auth['isAuthenticated'](),controller[_0x0b58('0x27')]);router[_0x0b58('0x7')](_0x0b58('0x28'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x29')]);router[_0x0b58('0x7')]('/:id/agents',auth[_0x0b58('0x8')](),controller['getAgents']);router[_0x0b58('0x7')](_0x0b58('0x2a'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router['get'](_0x0b58('0x2b'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x0b58('0x7')]('/:id/mail_accounts',auth[_0x0b58('0x8')](),controller[_0x0b58('0x2c')]);router[_0x0b58('0x7')](_0x0b58('0x2d'),auth[_0x0b58('0x8')](),controller['getOpenchannelAccounts']);router[_0x0b58('0x7')](_0x0b58('0x2e'),auth[_0x0b58('0x8')](),controller['getSmsAccounts']);router[_0x0b58('0x7')](_0x0b58('0x2f'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x30')]);router[_0x0b58('0x7')](_0x0b58('0x31'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x0b58('0x7')]('/:id/square_projects',auth[_0x0b58('0x8')](),controller[_0x0b58('0x32')]);router[_0x0b58('0x7')](_0x0b58('0x33'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x34')]);router[_0x0b58('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x0b58('0x35')]);router['post'](_0x0b58('0x14'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x36')]);router[_0x0b58('0x37')]('/',auth[_0x0b58('0x8')](),controller[_0x0b58('0x38')]);router[_0x0b58('0x37')]('/create_many',auth[_0x0b58('0x8')](),controller[_0x0b58('0x39')]);router['post']('/:id/queues',auth[_0x0b58('0x8')](),controller[_0x0b58('0x3a')]);var upload=multer({'storage':multer[_0x0b58('0x3b')]({'destination':function(_0x36e056,_0x2e7185,_0x13189d){_0x13189d(null,path[_0x0b58('0x3c')](config[_0x0b58('0x3d')],_0x0b58('0x3e')));},'filename':function(_0x2a1c50,_0x5ce2a7,_0xd41e6e){_0xd41e6e(null,util[_0x0b58('0x3f')]('%s-%s',Date[_0x0b58('0x40')](),_0x5ce2a7[_0x0b58('0x41')]));}})});router[_0x0b58('0x37')](_0x0b58('0x10'),upload['single'](_0x0b58('0x42')),controller[_0x0b58('0x43')]);router[_0x0b58('0x37')]('/:id/login',auth[_0x0b58('0x8')](),controller[_0x0b58('0x44')]);router['post'](_0x0b58('0x45'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x46')]);router[_0x0b58('0x37')]('/:id/pause',auth['isAuthenticated'](),controller[_0x0b58('0x47')]);router[_0x0b58('0x37')](_0x0b58('0x48'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x49')]);router[_0x0b58('0x37')](_0x0b58('0x26'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x4a')]);router[_0x0b58('0x37')](_0x0b58('0x4b'),auth[_0x0b58('0x8')](),controller['addChatInteractions']);router[_0x0b58('0x37')](_0x0b58('0x4c'),auth[_0x0b58('0x8')](),controller['addMailInteractions']);router[_0x0b58('0x37')]('/:id/fax_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x4d')]);router[_0x0b58('0x37')](_0x0b58('0x4e'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x4f')]);router[_0x0b58('0x37')](_0x0b58('0x50'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x51')]);router[_0x0b58('0x37')](_0x0b58('0x52'),auth[_0x0b58('0x8')](),controller['addWhatsappInteractions']);router[_0x0b58('0x37')](_0x0b58('0x2b'),auth['isAuthenticated'](),controller[_0x0b58('0x53')]);router[_0x0b58('0x37')](_0x0b58('0x54'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x55')]);router['post'](_0x0b58('0x2d'),auth['isAuthenticated'](),controller[_0x0b58('0x56')]);router[_0x0b58('0x37')](_0x0b58('0x2e'),auth['isAuthenticated'](),controller[_0x0b58('0x57')]);router[_0x0b58('0x37')](_0x0b58('0x2f'),auth[_0x0b58('0x8')](),controller['addChatWebsites']);router[_0x0b58('0x37')](_0x0b58('0x31'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x58')]);router[_0x0b58('0x37')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x0b58('0x59')]);router[_0x0b58('0x37')](_0x0b58('0x5a'),auth[_0x0b58('0x8')](),controller['createApiKey']);router['put']('/:id',auth[_0x0b58('0x8')](),controller[_0x0b58('0x5b')]);router[_0x0b58('0x5c')]('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0x0b58('0x5d')](_0x0b58('0x16'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x5e')]);router[_0x0b58('0x5d')]('/:id/teams',auth[_0x0b58('0x8')](),controller['removeTeams']);router[_0x0b58('0x5d')](_0x0b58('0x5f'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x60')]);router[_0x0b58('0x5d')]('/:id/chat_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x61')]);router[_0x0b58('0x5d')](_0x0b58('0x4c'),auth['isAuthenticated'](),controller[_0x0b58('0x62')]);router[_0x0b58('0x5d')]('/:id/fax_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x63')]);router['delete']('/:id/sms_interactions',auth[_0x0b58('0x8')](),controller[_0x0b58('0x64')]);router[_0x0b58('0x5d')](_0x0b58('0x50'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x65')]);router[_0x0b58('0x5d')](_0x0b58('0x52'),auth['isAuthenticated'](),controller[_0x0b58('0x66')]);router[_0x0b58('0x5d')](_0x0b58('0x2b'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x67')]);router[_0x0b58('0x5d')](_0x0b58('0x54'),auth['isAuthenticated'](),controller[_0x0b58('0x68')]);router[_0x0b58('0x5d')](_0x0b58('0x2d'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x69')]);router['delete'](_0x0b58('0x2e'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x6a')]);router[_0x0b58('0x5d')](_0x0b58('0x2f'),auth[_0x0b58('0x8')](),controller['removeChatWebsites']);router[_0x0b58('0x5d')](_0x0b58('0x31'),auth[_0x0b58('0x8')](),controller[_0x0b58('0x6b')]);router[_0x0b58('0x5d')]('/:id/square_projects',auth[_0x0b58('0x8')](),controller[_0x0b58('0x6c')]);router['delete']('/:id/api_key',auth[_0x0b58('0x8')](),controller[_0x0b58('0x6d')]);module['exports']=router; \ No newline at end of file +var _0x894d=['../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/recordings','getRecordings','getScreenRecordings','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','login','logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/openchannel_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','update','put','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x894d,0x14b));var _0xd894=function(_0x1854b9,_0x2b01e2){_0x1854b9=_0x1854b9-0x0;var _0x18e78e=_0x894d[_0x1854b9];return _0x18e78e;};'use strict';var multer=require(_0xd894('0x0'));var util=require(_0xd894('0x1'));var path=require(_0xd894('0x2'));var timeout=require('connect-timeout');var express=require(_0xd894('0x3'));var router=express[_0xd894('0x4')]();var fs_extra=require(_0xd894('0x5'));var auth=require(_0xd894('0x6'));var interaction=require(_0xd894('0x7'));var config=require(_0xd894('0x8'));var controller=require(_0xd894('0x9'));router['get']('/',auth[_0xd894('0xa')](),controller[_0xd894('0xb')]);router[_0xd894('0xc')](_0xd894('0xd'),auth[_0xd894('0xa')](),controller['describe']);router['get'](_0xd894('0xe'),auth[_0xd894('0xa')](),controller[_0xd894('0xf')]);router[_0xd894('0xc')](_0xd894('0x10'),auth[_0xd894('0xa')](),controller[_0xd894('0x11')]);router[_0xd894('0xc')](_0xd894('0x12'),auth['isAuthenticated'](),controller[_0xd894('0x13')]);router[_0xd894('0xc')](_0xd894('0x14'),controller[_0xd894('0x15')]);router[_0xd894('0xc')](_0xd894('0x16'),auth[_0xd894('0xa')](),controller[_0xd894('0x17')]);router[_0xd894('0xc')](_0xd894('0x18'),auth[_0xd894('0xa')](),controller[_0xd894('0x19')]);router[_0xd894('0xc')](_0xd894('0x1a'),auth[_0xd894('0xa')](),controller[_0xd894('0x1b')]);router[_0xd894('0xc')](_0xd894('0x1c'),auth[_0xd894('0xa')](),controller['getVoiceQueuesRt']);router[_0xd894('0xc')]('/:id/groups',auth[_0xd894('0xa')](),controller['getGroups']);router['get'](_0xd894('0x1d'),auth[_0xd894('0xa')](),controller[_0xd894('0x1e')]);router[_0xd894('0xc')]('/:id/screen_recordings',auth[_0xd894('0xa')](),controller[_0xd894('0x1f')]);router['get']('/:id/chat/interactions',auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0xd894('0x20'),auth[_0xd894('0xa')](),controller['getOpenchannelInteractions']);router[_0xd894('0xc')](_0xd894('0x21'),auth['isAuthenticated'](),controller[_0xd894('0x22')]);router['get']('/:id/sms/interactions',auth[_0xd894('0xa')](),controller[_0xd894('0x23')]);router['get'](_0xd894('0x24'),auth[_0xd894('0xa')](),controller[_0xd894('0x25')]);router[_0xd894('0xc')](_0xd894('0x26'),auth['isAuthenticated'](),controller[_0xd894('0x27')]);router['get'](_0xd894('0x28'),auth[_0xd894('0xa')](),controller[_0xd894('0x29')]);router[_0xd894('0xc')](_0xd894('0x2a'),auth[_0xd894('0xa')](),controller['getLists']);router[_0xd894('0xc')](_0xd894('0x2b'),auth[_0xd894('0xa')](),controller[_0xd894('0x2c')]);router[_0xd894('0xc')](_0xd894('0x2d'),auth['isAuthenticated'](),controller[_0xd894('0x2e')]);router[_0xd894('0xc')](_0xd894('0x2f'),auth[_0xd894('0xa')](),controller[_0xd894('0x30')]);router[_0xd894('0xc')](_0xd894('0x31'),auth['isAuthenticated'](),controller[_0xd894('0x32')]);router[_0xd894('0xc')]('/:id/openchannel_accounts',auth[_0xd894('0xa')](),controller['getOpenchannelAccounts']);router['get'](_0xd894('0x33'),auth[_0xd894('0xa')](),controller[_0xd894('0x34')]);router[_0xd894('0xc')](_0xd894('0x35'),auth[_0xd894('0xa')](),controller['getChatWebsites']);router[_0xd894('0xc')](_0xd894('0x36'),auth['isAuthenticated'](),controller[_0xd894('0x37')]);router[_0xd894('0xc')](_0xd894('0x38'),auth[_0xd894('0xa')](),controller[_0xd894('0x39')]);router[_0xd894('0xc')](_0xd894('0x3a'),auth[_0xd894('0xa')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0xd894('0xa')](),controller['getApiKey']);router[_0xd894('0x3b')](_0xd894('0x18'),auth['isAuthenticated'](),controller[_0xd894('0x3c')]);router[_0xd894('0x3b')]('/',auth[_0xd894('0xa')](),controller[_0xd894('0x3d')]);router[_0xd894('0x3b')](_0xd894('0x3e'),auth[_0xd894('0xa')](),controller[_0xd894('0x3f')]);router[_0xd894('0x3b')](_0xd894('0x1a'),auth['isAuthenticated'](),controller[_0xd894('0x40')]);var upload=multer({'storage':multer[_0xd894('0x41')]({'destination':function(_0xfc8ac,_0x38899b,_0x30150c){_0x30150c(null,path[_0xd894('0x42')](config['root'],_0xd894('0x43')));},'filename':function(_0x4cfb07,_0x3cf4b0,_0x2f558f){_0x2f558f(null,util['format'](_0xd894('0x44'),Date[_0xd894('0x45')](),_0x3cf4b0[_0xd894('0x46')]));}})});router[_0xd894('0x3b')](_0xd894('0x14'),upload[_0xd894('0x47')](_0xd894('0x48')),controller[_0xd894('0x49')]);router[_0xd894('0x3b')]('/:id/login',auth['isAuthenticated'](),controller[_0xd894('0x4a')]);router[_0xd894('0x3b')]('/:id/logout',auth['isAuthenticated'](),controller[_0xd894('0x4b')]);router[_0xd894('0x3b')](_0xd894('0x4c'),auth[_0xd894('0xa')](),controller['pause']);router[_0xd894('0x3b')](_0xd894('0x4d'),auth[_0xd894('0xa')](),controller['unpause']);router[_0xd894('0x3b')](_0xd894('0x28'),auth[_0xd894('0xa')](),controller[_0xd894('0x4e')]);router[_0xd894('0x3b')](_0xd894('0x4f'),auth[_0xd894('0xa')](),controller[_0xd894('0x50')]);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xd894('0x3b')](_0xd894('0x51'),auth[_0xd894('0xa')](),controller[_0xd894('0x52')]);router[_0xd894('0x3b')](_0xd894('0x53'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0xd894('0x3b')](_0xd894('0x54'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0xd894('0x3b')](_0xd894('0x55'),auth['isAuthenticated'](),controller[_0xd894('0x56')]);router[_0xd894('0x3b')](_0xd894('0x2f'),auth['isAuthenticated'](),controller[_0xd894('0x57')]);router[_0xd894('0x3b')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0xd894('0x58'),auth[_0xd894('0xa')](),controller['addOpenchannelAccounts']);router[_0xd894('0x3b')](_0xd894('0x33'),auth['isAuthenticated'](),controller[_0xd894('0x59')]);router[_0xd894('0x3b')](_0xd894('0x35'),auth[_0xd894('0xa')](),controller[_0xd894('0x5a')]);router[_0xd894('0x3b')](_0xd894('0x36'),auth[_0xd894('0xa')](),controller[_0xd894('0x5b')]);router[_0xd894('0x3b')](_0xd894('0x38'),auth[_0xd894('0xa')](),controller['addSquareProjects']);router[_0xd894('0x3b')](_0xd894('0x5c'),auth['isAuthenticated'](),controller[_0xd894('0x5d')]);router['put']('/:id',auth[_0xd894('0xa')](),controller[_0xd894('0x5e')]);router[_0xd894('0x5f')]('/:id/password',auth[_0xd894('0xa')](),controller[_0xd894('0x60')]);router['delete'](_0xd894('0x1a'),auth['isAuthenticated'](),controller[_0xd894('0x61')]);router[_0xd894('0x62')]('/:id/teams',auth[_0xd894('0xa')](),controller[_0xd894('0x63')]);router[_0xd894('0x62')]('/:id',auth[_0xd894('0xa')](),controller[_0xd894('0x64')]);router[_0xd894('0x62')](_0xd894('0x4f'),auth[_0xd894('0xa')](),controller[_0xd894('0x65')]);router[_0xd894('0x62')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xd894('0x66')]);router[_0xd894('0x62')]('/:id/fax_interactions',auth[_0xd894('0xa')](),controller[_0xd894('0x67')]);router[_0xd894('0x62')](_0xd894('0x53'),auth[_0xd894('0xa')](),controller['removeSmsInteractions']);router['delete'](_0xd894('0x54'),auth[_0xd894('0xa')](),controller[_0xd894('0x68')]);router[_0xd894('0x62')](_0xd894('0x55'),auth[_0xd894('0xa')](),controller[_0xd894('0x69')]);router['delete'](_0xd894('0x2f'),auth['isAuthenticated'](),controller[_0xd894('0x6a')]);router[_0xd894('0x62')]('/:id/mail_accounts',auth[_0xd894('0xa')](),controller['removeMailAccounts']);router[_0xd894('0x62')](_0xd894('0x58'),auth[_0xd894('0xa')](),controller[_0xd894('0x6b')]);router[_0xd894('0x62')](_0xd894('0x33'),auth[_0xd894('0xa')](),controller[_0xd894('0x6c')]);router['delete'](_0xd894('0x35'),auth[_0xd894('0xa')](),controller[_0xd894('0x6d')]);router[_0xd894('0x62')](_0xd894('0x36'),auth[_0xd894('0xa')](),controller[_0xd894('0x6e')]);router[_0xd894('0x62')]('/:id/square_projects',auth[_0xd894('0xa')](),controller[_0xd894('0x6f')]);router[_0xd894('0x62')](_0xd894('0x5c'),auth[_0xd894('0xa')](),controller['removeApiKey']);module[_0xd894('0x70')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7fd85a9..407836f 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 _0x2e88=['PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','info','shortinfo','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','always','accept','originate','uac','fingerprint','certificate','active','passive','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED'];(function(_0x21bc6d,_0x36b1d4){var _0x3d24bb=function(_0x3e83e8){while(--_0x3e83e8){_0x21bc6d['push'](_0x21bc6d['shift']());}};_0x3d24bb(++_0x36b1d4);}(_0x2e88,0x95));var _0x82e8=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x2e88[_0x4a29a9];return _0x386570;};'use strict';var Sequelize=require(_0x82e8('0x0'));var moment=require(_0x82e8('0x1'));var util=require(_0x82e8('0x2'));var _=require(_0x82e8('0x3'));module[_0x82e8('0x4')]={'name':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x40c9c5){this[_0x82e8('0x6')]('name',_0x40c9c5);this[_0x82e8('0x6')](_0x82e8('0x7'),_0x40c9c5);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'set':function(_0x1e2496){this[_0x82e8('0x6')](_0x82e8('0x8'),_0x1e2496);this[_0x82e8('0x6')](_0x82e8('0x9'),util[_0x82e8('0xa')](_0x82e8('0xb'),_0x1e2496,this[_0x82e8('0xc')](_0x82e8('0xd'))));}},'alias':{'type':Sequelize[_0x82e8('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x82e8('0xe'),'validate':{'isEmail':!![]},'set':function(_0x24f4a1){if(_0x24f4a1){this[_0x82e8('0x6')](_0x82e8('0xe'),_0x24f4a1[_0x82e8('0xf')]());}}},'role':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x11'),'user',_0x82e8('0x12'),_0x82e8('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x82e8('0x5')],'defaultValue':_0x82e8('0x14')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x82e8('0xd'),'set':function(_0x2c9569){this[_0x82e8('0x6')](_0x82e8('0xd'),_0x2c9569);this['setDataValue'](_0x82e8('0x15'),_0x2c9569);this[_0x82e8('0x6')](_0x82e8('0x9'),util[_0x82e8('0xa')](_0x82e8('0xb'),this['getDataValue'](_0x82e8('0x8')),_0x2c9569));}},'salt':{'type':Sequelize[_0x82e8('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x82e8('0x5')]},'address':{'type':Sequelize[_0x82e8('0x5')]},'zipcode':{'type':Sequelize[_0x82e8('0x5')]},'userpic':{'type':Sequelize[_0x82e8('0x5')]},'city':{'type':Sequelize[_0x82e8('0x5')]},'country':{'type':Sequelize[_0x82e8('0x5')]},'online':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x82e8('0x17')},'lastPauseAt':{'type':Sequelize[_0x82e8('0x18')]},'chatCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x1a')},'ipaddr':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x82e8('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x1b'),_0x82e8('0x1c'),_0x82e8('0x1d')),'allowNull':!![],'defaultValue':_0x82e8('0x1b')},'context':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x1e')},'callingpres':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x1f'),_0x82e8('0x20'),_0x82e8('0x21'),'ALLOWED',_0x82e8('0x22'),_0x82e8('0x23'),_0x82e8('0x24'),_0x82e8('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x26'),'set':function(_0x579308){this[_0x82e8('0x6')](_0x82e8('0x27'),_0x579308?_0x579308[_0x82e8('0x28')](','):null);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x27'))?this[_0x82e8('0xc')](_0x82e8('0x27'))[_0x82e8('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x82e8('0x10')]('rfc2833',_0x82e8('0x2a'),_0x82e8('0x2b'),'inband','auto'),'allowNull':!![],'defaultValue':_0x82e8('0x2c')},'directmedia':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no',_0x82e8('0x2e'),_0x82e8('0x2f'),_0x82e8('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'defaultValue':_0x82e8('0x31'),'set':function(_0x22c86b){this[_0x82e8('0x6')]('nat',_0x22c86b?_0x22c86b[_0x82e8('0x28')](','):null);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x32'))?this['getDataValue'](_0x82e8('0x32'))[_0x82e8('0x29')](','):null;},'comment':_0x82e8('0x33')},'callgroup':{'type':Sequelize[_0x82e8('0x5')]},'namedcallgroup':{'type':Sequelize[_0x82e8('0x5')]},'pickupgroup':{'type':Sequelize[_0x82e8('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x82e8('0x5')]},'language':{'type':Sequelize[_0x82e8('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x82e8('0x5')]},'disallow':{'type':Sequelize[_0x82e8('0x5')],'allowNull':![],'defaultValue':_0x82e8('0x34')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82e8('0x35'),'set':function(_0x3f379d){this[_0x82e8('0x6')](_0x82e8('0x36'),_0x3f379d?_0x3f379d[_0x82e8('0x28')](';'):_0x82e8('0x35'));},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x36'))?this[_0x82e8('0xc')](_0x82e8('0x36'))[_0x82e8('0x29')](';'):null;},'comment':_0x82e8('0x37')},'autoframing':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![],'set':function(_0x4fba12){this[_0x82e8('0x6')]('insecure',_0x4fba12?_0x4fba12[_0x82e8('0x28')](','):null);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x38'))?this[_0x82e8('0xc')](_0x82e8('0x38'))[_0x82e8('0x29')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no',_0x82e8('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no',_0x82e8('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x82e8('0x3b'),'refuse',_0x82e8('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x82e8('0x3d'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x82e8('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x82e8('0x10')]('yes','no',_0x82e8('0x3e'),_0x82e8('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x82e8('0x40'),_0x82e8('0x41'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x82e8('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x82e8('0x10')](_0x82e8('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x82e8('0x10')]('yes','no',_0x82e8('0x2e'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x82e8('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x82e8('0x18')]},'passwordResetAt':{'type':Sequelize[_0x82e8('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0,'set':function(_0x238782){this[_0x82e8('0x6')](_0x82e8('0x42'),_0x238782);var _0x31c307=this[_0x82e8('0x43')]({'plain':!![]});switch(_0x238782){case 0x0:case 0x1:var _0x28e78e=_0x31c307[_0x82e8('0x27')]?_[_0x82e8('0x44')](_0x31c307[_0x82e8('0x27')])?_0x31c307[_0x82e8('0x27')][_0x82e8('0x28')]():_0x31c307[_0x82e8('0x27')]:_0x82e8('0x26');if(_0x28e78e===_0x82e8('0x45')){_0x28e78e=_0x82e8('0x26');}this['setDataValue'](_0x82e8('0x27'),_0x28e78e);this[_0x82e8('0x6')](_0x82e8('0x46'),'no');this[_0x82e8('0x6')](_0x82e8('0x47'),null);this[_0x82e8('0x6')](_0x82e8('0x48'),null);this[_0x82e8('0x6')](_0x82e8('0x49'),null);this[_0x82e8('0x6')](_0x82e8('0x4a'),null);this['setDataValue'](_0x82e8('0x4b'),null);this[_0x82e8('0x6')](_0x82e8('0x4c'),null);this[_0x82e8('0x6')](_0x82e8('0x4d'),null);this[_0x82e8('0x6')](_0x82e8('0x4e'),null);this[_0x82e8('0x6')](_0x82e8('0x4f'),'no');break;case 0x2:this[_0x82e8('0x6')](_0x82e8('0x27'),_0x82e8('0x45'));this[_0x82e8('0x6')](_0x82e8('0x46'),_0x82e8('0x2d'));this[_0x82e8('0x6')](_0x82e8('0x47'),'yes');this[_0x82e8('0x6')](_0x82e8('0x48'),_0x82e8('0x2d'));this[_0x82e8('0x6')](_0x82e8('0x49'),_0x82e8('0x2d'));this[_0x82e8('0x6')]('dtlsenable',_0x82e8('0x2d'));this[_0x82e8('0x6')]('dtlsverify','no');this['setDataValue'](_0x82e8('0x4c'),'actpass');this['setDataValue'](_0x82e8('0x4d'),_0x31c307[_0x82e8('0x4d')]||'/etc/pki/tls/certs/motion.crt');this[_0x82e8('0x6')]('dtlsprivatekey',_0x31c307[_0x82e8('0x4e')]||'/etc/pki/tls/private/motion.key');this[_0x82e8('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x82e8('0x50')],'set':function(_0x56e35c){this[_0x82e8('0x6')](_0x82e8('0x51'),_0x56e35c?_0x56e35c[_0x82e8('0x28')](','):[]);},'get':function(){return this[_0x82e8('0xc')](_0x82e8('0x51'))?_[_0x82e8('0x52')](this[_0x82e8('0xc')](_0x82e8('0x51'))[_0x82e8('0x29')](','),function(_0x414a37){return parseInt(_0x414a37,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x82e8('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x82e8('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x82e8('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x82e8('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x82e8('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x82e8('0x53')],'get':function(){return this['getDataValue'](_0x82e8('0x54'))?this[_0x82e8('0xc')](_0x82e8('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x82e8('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![],'set':function(_0x4a8da3){if(typeof _0x4a8da3===_0x82e8('0x55')){var _0x36d2df=_0x4a8da3==='1'?!![]:_0x4a8da3==='0'?![]:_0x4a8da3===_0x82e8('0x56')?!![]:_0x4a8da3===_0x82e8('0x57')?![]:![];this[_0x82e8('0x6')](_0x82e8('0x58'),_0x36d2df);}else{this[_0x82e8('0x6')]('screenrecording',_0x4a8da3);}}},'blocked':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![],'set':function(_0x27fd4a){this[_0x82e8('0x6')](_0x82e8('0x59'),_0x27fd4a);if(_0x27fd4a===!![]){this[_0x82e8('0x6')]('blockedAt',moment());this['setDataValue'](_0x82e8('0x5a'),0x0);}else{this[_0x82e8('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x82e8('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x82e8('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x82e8('0x19')](0x5)[_0x82e8('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x82e8('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7a3e=['util','exports','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','accountcode','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','nonat','update','outgoing','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','DATE','TEXT','showWebBar','get','isArray','udp','encryption','force_avp','icesupport','dtlsenable','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','dtlsverify','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment'];(function(_0x5ba0a2,_0x20eea3){var _0x75c625=function(_0x3c77d4){while(--_0x3c77d4){_0x5ba0a2['push'](_0x5ba0a2['shift']());}};_0x75c625(++_0x20eea3);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x3d3ba9,_0x6ec682){_0x3d3ba9=_0x3d3ba9-0x0;var _0x3f7b30=_0x7a3e[_0x3d3ba9];return _0x3f7b30;};'use strict';var Sequelize=require(_0xe7a3('0x0'));var moment=require(_0xe7a3('0x1'));var util=require(_0xe7a3('0x2'));var _=require('lodash');module[_0xe7a3('0x3')]={'name':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x522203){this[_0xe7a3('0x5')](_0xe7a3('0x6'),_0x522203);this[_0xe7a3('0x5')]('defaultuser',_0x522203);},'comment':_0xe7a3('0x7')},'fullname':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':![],'set':function(_0x46ecf7){this[_0xe7a3('0x5')](_0xe7a3('0x8'),_0x46ecf7);this['setDataValue'](_0xe7a3('0x9'),util[_0xe7a3('0xa')](_0xe7a3('0xb'),_0x46ecf7,this[_0xe7a3('0xc')]('internal')));}},'alias':{'type':Sequelize[_0xe7a3('0x4')]},'email':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':![],'unique':_0xe7a3('0xd'),'validate':{'isEmail':!![]},'set':function(_0x10537e){if(_0x10537e){this[_0xe7a3('0x5')](_0xe7a3('0xd'),_0x10537e[_0xe7a3('0xe')]());}}},'role':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x10'),_0xe7a3('0x11'),_0xe7a3('0x12'),_0xe7a3('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xe7a3('0x4')],'defaultValue':_0xe7a3('0x14')},'internal':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':![],'unique':_0xe7a3('0x16'),'set':function(_0x4fb862){this['setDataValue'](_0xe7a3('0x16'),_0x4fb862);this[_0xe7a3('0x5')](_0xe7a3('0x17'),_0x4fb862);this[_0xe7a3('0x5')](_0xe7a3('0x9'),util[_0xe7a3('0xa')](_0xe7a3('0xb'),this[_0xe7a3('0xc')](_0xe7a3('0x8')),_0x4fb862));}},'salt':{'type':Sequelize[_0xe7a3('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe7a3('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xe7a3('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe7a3('0x4')]},'online':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xe7a3('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xe7a3('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![],'defaultValue':_0xe7a3('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xe7a3('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x1b'),_0xe7a3('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xe7a3('0x1b')},'context':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![],'defaultValue':_0xe7a3('0x1c')},'callingpres':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x1d'),_0xe7a3('0x1e'),_0xe7a3('0x1f'),_0xe7a3('0x20'),_0xe7a3('0x21'),_0xe7a3('0x22'),_0xe7a3('0x23'),_0xe7a3('0x24')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x567f44){this[_0xe7a3('0x5')](_0xe7a3('0x25'),_0x567f44?_0x567f44[_0xe7a3('0x26')](','):null);},'get':function(){return this[_0xe7a3('0xc')]('transport')?this[_0xe7a3('0xc')](_0xe7a3('0x25'))[_0xe7a3('0x27')](','):null;},'comment':_0xe7a3('0x28')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe7a3('0x29'),_0xe7a3('0x2a'),_0xe7a3('0x2b'),_0xe7a3('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0xe7a3('0x29')},'directmedia':{'type':Sequelize[_0xe7a3('0xf')]('yes','no',_0xe7a3('0x2d'),_0xe7a3('0x2e'),_0xe7a3('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![],'defaultValue':_0xe7a3('0x31'),'set':function(_0x5f51d5){this[_0xe7a3('0x5')](_0xe7a3('0x32'),_0x5f51d5?_0x5f51d5[_0xe7a3('0x26')](','):null);},'get':function(){return this[_0xe7a3('0xc')]('nat')?this[_0xe7a3('0xc')](_0xe7a3('0x32'))[_0xe7a3('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe7a3('0x4')]},'pickupgroup':{'type':Sequelize[_0xe7a3('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xe7a3('0x4')]},'language':{'type':Sequelize[_0xe7a3('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe7a3('0x4')]},'disallow':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':![],'defaultValue':_0xe7a3('0x33')},'allow':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':![],'defaultValue':_0xe7a3('0x34'),'set':function(_0x483b59){this[_0xe7a3('0x5')](_0xe7a3('0x35'),_0x483b59?_0x483b59['join'](';'):_0xe7a3('0x34'));},'get':function(){return this[_0xe7a3('0xc')](_0xe7a3('0x35'))?this[_0xe7a3('0xc')]('allow')[_0xe7a3('0x27')](';'):null;},'comment':_0xe7a3('0x36')},'autoframing':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![],'set':function(_0x261820){this[_0xe7a3('0x5')]('insecure',_0x261820?_0x261820[_0xe7a3('0x26')](','):null);},'get':function(){return this['getDataValue'](_0xe7a3('0x37'))?this[_0xe7a3('0xc')](_0xe7a3('0x37'))[_0xe7a3('0x27')](','):null;},'comment':_0xe7a3('0x38')},'trustrpid':{'type':Sequelize[_0xe7a3('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe7a3('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no',_0xe7a3('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xe7a3('0x30'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![],'defaultValue':_0xe7a3('0x3a')},'amaflags':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![],'defaultValue':_0xe7a3('0x30')},'busylevel':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xe7a3('0x30'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xe7a3('0x30'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xe7a3('0x3b'),'refuse',_0xe7a3('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xe7a3('0x3d'),_0xe7a3('0x3e')),'allowNull':!![],'defaultValue':_0xe7a3('0x3e')},'t38pt_usertpsource':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![],'defaultValue':_0xe7a3('0x30')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe7a3('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xe7a3('0x30'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no',_0xe7a3('0x3f'),_0xe7a3('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x41'),_0xe7a3('0x42'),_0xe7a3('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xe7a3('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xe7a3('0xf')]('yes','no',_0xe7a3('0x2d'),'update',_0xe7a3('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xe7a3('0x45')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xe7a3('0x46')]},'showWebBar':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0,'set':function(_0x5c0d60){this[_0xe7a3('0x5')](_0xe7a3('0x47'),_0x5c0d60);var _0x17db38=this[_0xe7a3('0x48')]({'plain':!![]});switch(_0x5c0d60){case 0x0:case 0x1:var _0x37bcb4=_0x17db38[_0xe7a3('0x25')]?_[_0xe7a3('0x49')](_0x17db38[_0xe7a3('0x25')])?_0x17db38[_0xe7a3('0x25')][_0xe7a3('0x26')]():_0x17db38[_0xe7a3('0x25')]:_0xe7a3('0x4a');if(_0x37bcb4==='wss'){_0x37bcb4=_0xe7a3('0x4a');}this[_0xe7a3('0x5')](_0xe7a3('0x25'),_0x37bcb4);this[_0xe7a3('0x5')](_0xe7a3('0x4b'),'no');this[_0xe7a3('0x5')]('avpf',null);this[_0xe7a3('0x5')](_0xe7a3('0x4c'),null);this[_0xe7a3('0x5')](_0xe7a3('0x4d'),null);this['setDataValue'](_0xe7a3('0x4e'),null);this['setDataValue']('dtlsverify',null);this[_0xe7a3('0x5')]('dtlssetup',null);this['setDataValue'](_0xe7a3('0x4f'),null);this[_0xe7a3('0x5')](_0xe7a3('0x50'),null);this[_0xe7a3('0x5')](_0xe7a3('0x51'),'no');break;case 0x2:this[_0xe7a3('0x5')](_0xe7a3('0x25'),_0xe7a3('0x52'));this[_0xe7a3('0x5')](_0xe7a3('0x4b'),_0xe7a3('0x30'));this[_0xe7a3('0x5')](_0xe7a3('0x53'),_0xe7a3('0x30'));this[_0xe7a3('0x5')](_0xe7a3('0x4c'),_0xe7a3('0x30'));this['setDataValue'](_0xe7a3('0x4d'),_0xe7a3('0x30'));this[_0xe7a3('0x5')](_0xe7a3('0x4e'),_0xe7a3('0x30'));this['setDataValue'](_0xe7a3('0x54'),'no');this[_0xe7a3('0x5')](_0xe7a3('0x55'),_0xe7a3('0x43'));this['setDataValue'](_0xe7a3('0x4f'),_0x17db38['dtlscertfile']||_0xe7a3('0x56'));this[_0xe7a3('0x5')](_0xe7a3('0x50'),_0x17db38[_0xe7a3('0x50')]||_0xe7a3('0x57'));this[_0xe7a3('0x5')](_0xe7a3('0x51'),_0xe7a3('0x30'));break;default:}}},'permissions':{'type':Sequelize[_0xe7a3('0x46')],'set':function(_0x4ee689){this[_0xe7a3('0x5')](_0xe7a3('0x58'),_0x4ee689?_0x4ee689['join'](','):[]);},'get':function(){return this['getDataValue'](_0xe7a3('0x58'))?_[_0xe7a3('0x59')](this[_0xe7a3('0xc')](_0xe7a3('0x58'))[_0xe7a3('0x27')](','),function(_0x53e90b){return parseInt(_0x53e90b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xe7a3('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xe7a3('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xe7a3('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xe7a3('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xe7a3('0xf')](_0xe7a3('0x30'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe7a3('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xe7a3('0x5a')],'get':function(){return this[_0xe7a3('0xc')](_0xe7a3('0x5b'))?this[_0xe7a3('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0xe7a3('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xe7a3('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![],'set':function(_0x5d37ca){if(typeof _0x5d37ca===_0xe7a3('0x5c')){var _0x5b6439=_0x5d37ca==='1'?!![]:_0x5d37ca==='0'?![]:_0x5d37ca==='true'?!![]:_0x5d37ca===_0xe7a3('0x5d')?![]:![];this[_0xe7a3('0x5')]('screenrecording',_0x5b6439);}else{this['setDataValue'](_0xe7a3('0x5e'),_0x5d37ca);}}},'blocked':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![],'set':function(_0x1b6978){this[_0xe7a3('0x5')](_0xe7a3('0x5f'),_0x1b6978);if(_0x1b6978===!![]){this[_0xe7a3('0x5')](_0xe7a3('0x60'),moment());this[_0xe7a3('0x5')](_0xe7a3('0x61'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xe7a3('0x45')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xe7a3('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xe7a3('0x15')](0x5)[_0xe7a3('0x62')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe7a3('0x18')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 1c06b19..aa79022 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 _0xd117=['register','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','offset','limit','count','set','update','get','Users','Agents','agent','Telephones','map','value','includes','role','destroy','stack','name','send','index','rawAttributes','fieldName','key','filter','salt','where','User','query','include','attributes','push','rows','openTabs','true','chat','dataValues','sms','whatsapp','all','params','model','differenceBy','keys','password','filters','intersection','fields','includeAll','merge','options','find','openchannel','mail','body','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','QueryTypes','SELECT','length','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','103','104','105','106','107','108','100','114','115','create','user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','each','telephone','isEmpty','some','compact','UserProfileResource','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','findAll','format','UserVoiceQueueRt','upsert','isValidChannel','Unknown\x20channel','remove','Queue:remove','addAvatar','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','fax','ChatOpenTabs','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','order','sort','pick','CmList','Tag','color','tag','Queue','Unknown\x20role','hasOwnProperty','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','concat','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','Pause','getTeams','Team','addTeams','Voice','setDataValue','Chat','getMailQueues','getSmsQueues','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','VoicePrefixId','removeTeams','getChatQueues','Mail','removeAgent','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','lastName','Contact','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','token','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','VoiceQueue','inbound','flatten','lower','col','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','ringing','busy','slice','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./user.socket'];(function(_0x52b56c,_0x3f700e){var _0x391621=function(_0x210dee){while(--_0x210dee){_0x52b56c['push'](_0x52b56c['shift']());}};_0x391621(++_0x3f700e);}(_0xd117,0x182));var _0x7d11=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xd117[_0x11005e];return _0x29338f;};'use strict';var moment=require(_0x7d11('0x0'));var BPromise=require(_0x7d11('0x1'));var util=require(_0x7d11('0x2'));var path=require(_0x7d11('0x3'));var fs=require('fs');var _=require(_0x7d11('0x4'));var squel=require(_0x7d11('0x5'));var jayson=require(_0x7d11('0x6'));var Redis=require(_0x7d11('0x7'));var authService=require(_0x7d11('0x8'));var qs=require(_0x7d11('0x9'));var logger=require(_0x7d11('0xa'))(_0x7d11('0xb'));var utils=require(_0x7d11('0xc'));var config=require(_0x7d11('0xd'));var licenseUtil=require(_0x7d11('0xe'));var db=require(_0x7d11('0xf'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x7d11('0x10')]));require(_0x7d11('0x11'))[_0x7d11('0x12')](socket);config['redis']=_[_0x7d11('0x13')](config[_0x7d11('0x10')],{'host':_0x7d11('0x14'),'port':0x18eb});var client=jayson['client'][_0x7d11('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x48b0f1,_0x58a6fd,_0xb15984,_0x5c6d5d){return new BPromise(function(_0x4a8668,_0xc52a95){var _0x48f576=_0x5c6d5d||client;return _0x48f576[_0x7d11('0x16')](_0x48b0f1,_0xb15984)[_0x7d11('0x17')](function(_0x5ee572){logger[_0x7d11('0x18')](_0x7d11('0x19'),_0x58a6fd,'request\x20sent');logger[_0x7d11('0x1a')](_0x7d11('0x1b'),_0x58a6fd,_0x7d11('0x1c'),JSON[_0x7d11('0x1d')](_0x5ee572));if(_0x5ee572[_0x7d11('0x1e')]){if(_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x1f')]===0x1f4){logger[_0x7d11('0x1e')]('User,\x20%s,\x20%s',_0x58a6fd,_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x20')]);return _0xc52a95(_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x20')]);}logger[_0x7d11('0x1e')]('User,\x20%s,\x20%s',_0x58a6fd,_0x5ee572[_0x7d11('0x1e')][_0x7d11('0x20')]);return _0x4a8668(_0x5ee572['error']['message']);}else{logger[_0x7d11('0x18')]('User,\x20%s,\x20%s',_0x58a6fd,_0x7d11('0x1c'));_0x4a8668(_0x5ee572['result'][_0x7d11('0x20')]);}})[_0x7d11('0x21')](function(_0x328f8e){logger[_0x7d11('0x1e')](_0x7d11('0x19'),_0x58a6fd,_0x328f8e);_0xc52a95(_0x328f8e);});});}function respondWithStatusCode(_0x117bb9,_0x4297f8){_0x4297f8=_0x4297f8||0xcc;return function(_0x3d2574){if(_0x3d2574){return _0x117bb9['sendStatus'](_0x4297f8);}return _0x117bb9[_0x7d11('0x22')](_0x4297f8)['end']();};}function respondWithResult(_0x58455b,_0x5c3898){_0x5c3898=_0x5c3898||0xc8;return function(_0x27a818){if(_0x27a818){return _0x58455b[_0x7d11('0x22')](_0x5c3898)[_0x7d11('0x23')](_0x27a818);}};}function respondWithFilteredResult(_0x1a7853,_0x355d14){return function(_0xd938df){if(_0xd938df){var _0x282e5c=typeof _0x355d14[_0x7d11('0x24')]==='undefined'&&typeof _0x355d14[_0x7d11('0x25')]==='undefined';var _0x4bfa76=_0xd938df['count'];var _0x3ba092=_0x282e5c?0x0:_0x355d14['offset'];var _0x180e1e=_0x282e5c?_0xd938df[_0x7d11('0x26')]:_0x355d14[_0x7d11('0x24')]+_0x355d14['limit'];var _0x46f76a;if(_0x180e1e>=_0x4bfa76){_0x180e1e=_0x4bfa76;_0x46f76a=0xc8;}else{_0x46f76a=0xce;}_0x1a7853[_0x7d11('0x22')](_0x46f76a);return _0x1a7853[_0x7d11('0x27')]('Content-Range',_0x3ba092+'-'+_0x180e1e+'/'+_0x4bfa76)[_0x7d11('0x23')](_0xd938df);}return null;};}function saveUpdates(_0x35a789){return function(_0x18c049){if(_0x18c049){return _0x18c049[_0x7d11('0x28')](_0x35a789)['then'](function(_0x1a7745){return _0x1a7745;});}return null;};}function removeEntity(_0x512f7f){return function(_0x1bc218){if(_0x1bc218){return _0x1bc218['destroy']()[_0x7d11('0x17')](function(){var _0xba4e80=_0x1bc218[_0x7d11('0x29')]({'plain':!![]});if(_0xba4e80['role']==='admin')return;var _0x8e0a53=[{'name':_0x7d11('0x2a'),'value':'user','ignore':!![]},{'name':_0x7d11('0x2b'),'value':_0x7d11('0x2c'),'ignore':![]},{'name':_0x7d11('0x2d'),'value':'telephone','ignore':![]}];var _0x9c6609=_(_0x8e0a53)['filter']('ignore')[_0x7d11('0x2e')]('value')[_0x7d11('0x2f')]();if(_[_0x7d11('0x30')](_0x9c6609,_0xba4e80[_0x7d11('0x31')])){return;}var _0x35b997=_['find'](_0x8e0a53,[_0x7d11('0x2f'),_0xba4e80[_0x7d11('0x31')]])['name'];return db['UserProfileResource'][_0x7d11('0x32')]({'where':{'type':_0x35b997,'resourceId':_0xba4e80['id']}})[_0x7d11('0x17')](function(){return _0x1bc218;});})['then'](function(){_0x512f7f[_0x7d11('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c0113){return function(_0x1286d6){if(!_0x1286d6){_0x5c0113['sendStatus'](0x194);}return _0x1286d6;};}function handleError(_0x4e53be,_0x3414cd){_0x3414cd=_0x3414cd||0x1f4;return function(_0x30e2fa){logger[_0x7d11('0x1e')](_0x30e2fa[_0x7d11('0x33')]);if(_0x30e2fa[_0x7d11('0x34')]){delete _0x30e2fa[_0x7d11('0x34')];}_0x4e53be[_0x7d11('0x22')](_0x3414cd)[_0x7d11('0x35')](_0x30e2fa);};}exports[_0x7d11('0x36')]=function(_0x16cf5d,_0x1a9f18){var _0x779731={},_0x5d2305={'count':0x0,'rows':[]};var _0x157731=_(db['User'][_0x7d11('0x37')])[_0x7d11('0x2e')](function(_0x36be62){return{'name':_0x36be62[_0x7d11('0x38')],'type':_0x36be62['type'][_0x7d11('0x39')]};})[_0x7d11('0x3a')](function(_0x19284){return!_[_0x7d11('0x30')](['password',_0x7d11('0x3b')],_0x19284['name']);})[_0x7d11('0x2f')]();_0x779731=qs['getOptions'](_0x157731,_0x16cf5d);var _0xede1cc={'where':_0x779731[_0x7d11('0x3c')]};return db[_0x7d11('0x3d')][_0x7d11('0x26')](_0xede1cc)['then'](function(_0x57b827){_0x5d2305[_0x7d11('0x26')]=_0x57b827;if(_0x16cf5d[_0x7d11('0x3e')]['includeAll']){_0x779731[_0x7d11('0x3f')]=[{'all':!![]}];}if(!_[_0x7d11('0x30')](_0x779731[_0x7d11('0x40')],'id')){_0x779731[_0x7d11('0x40')][_0x7d11('0x41')]('id');}return db[_0x7d11('0x3d')]['findAll'](_0x779731);})[_0x7d11('0x17')](function(_0x5cf6a6){_0x5d2305[_0x7d11('0x42')]=_0x5cf6a6;if(_0x16cf5d[_0x7d11('0x3e')][_0x7d11('0x43')]===_0x7d11('0x44')){var _0x2a0c2f=[];for(var _0x29da73=0x0;_0x29da73<_0x5d2305['rows']['length'];_0x29da73++){_0x2a0c2f['push'](get_open_tabs(_0x7d11('0x45'),_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x47'),_0x5d2305['rows'][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs('fax',_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs('mail',_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs('openchannel',_0x5d2305[_0x7d11('0x42')][_0x29da73]['dataValues']));_0x2a0c2f[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x48'),_0x5d2305[_0x7d11('0x42')][_0x29da73][_0x7d11('0x46')]));}return BPromise[_0x7d11('0x49')](_0x2a0c2f)[_0x7d11('0x17')](function(_0x161213){return _0x5d2305;});}else{return _0x5d2305;}})[_0x7d11('0x17')](respondWithFilteredResult(_0x1a9f18,_0x779731))[_0x7d11('0x21')](handleError(_0x1a9f18,null));};exports['show']=function(_0x50d458,_0x49a21c){var _0x10c0e9={'raw':![],'where':{'id':_0x50d458[_0x7d11('0x4a')]['id']}},_0x1e5bb5={};_0x1e5bb5[_0x7d11('0x4b')]=_[_0x7d11('0x4c')](_[_0x7d11('0x4d')](db[_0x7d11('0x3d')][_0x7d11('0x37')]),[_0x7d11('0x4e'),_0x7d11('0x3b')]);_0x1e5bb5[_0x7d11('0x3e')]=_[_0x7d11('0x4d')](_0x50d458['query']);_0x1e5bb5[_0x7d11('0x4f')]=_[_0x7d11('0x50')](_0x1e5bb5[_0x7d11('0x4b')],_0x1e5bb5['query']);_0x10c0e9['attributes']=_[_0x7d11('0x50')](_0x1e5bb5[_0x7d11('0x4b')],qs[_0x7d11('0x51')](_0x50d458['query']['fields']));_0x10c0e9[_0x7d11('0x40')]=_0x10c0e9[_0x7d11('0x40')]['length']?_0x10c0e9[_0x7d11('0x40')]:_0x1e5bb5[_0x7d11('0x4b')];if(_0x50d458[_0x7d11('0x3e')][_0x7d11('0x52')]){_0x10c0e9['include']=[{'all':!![]}];}_0x10c0e9=_[_0x7d11('0x53')]({},_0x10c0e9,_0x50d458[_0x7d11('0x54')]);if(!_[_0x7d11('0x30')](_0x10c0e9['attributes'],'id')){_0x10c0e9['attributes'][_0x7d11('0x41')]('id');}return db[_0x7d11('0x3d')][_0x7d11('0x55')](_0x10c0e9)[_0x7d11('0x17')](handleEntityNotFound(_0x49a21c,null))[_0x7d11('0x17')](function(_0x4c7d7a){var _0x46a8e1=[];values=_0x4c7d7a;if(_0x50d458[_0x7d11('0x3e')][_0x7d11('0x43')]===_0x7d11('0x44')){_0x46a8e1['push'](get_open_tabs('chat',_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x47'),_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x56'),_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x48'),_0x4c7d7a[_0x7d11('0x46')]));_0x46a8e1['push'](get_open_tabs('fax',_0x4c7d7a['dataValues']));_0x46a8e1[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x57'),_0x4c7d7a[_0x7d11('0x46')]));return BPromise['all'](_0x46a8e1);}else{return values;}})[_0x7d11('0x17')](function(_0x222375){return values;})[_0x7d11('0x17')](respondWithResult(_0x49a21c,null))[_0x7d11('0x21')](handleError(_0x49a21c,null));};exports[_0x7d11('0x28')]=function(_0x178a3a,_0x505573){if(_0x178a3a[_0x7d11('0x58')]['id']){delete _0x178a3a[_0x7d11('0x58')]['id'];}delete _0x178a3a[_0x7d11('0x58')]['role'];return db['User']['find']({'where':{'id':_0x178a3a['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x505573,null))['then'](saveUpdates(_0x178a3a['body'],null))['then'](respondWithResult(_0x505573,null))[_0x7d11('0x21')](handleError(_0x505573,null));};exports[_0x7d11('0x59')]=function(_0x1072f1,_0x407f2c){return db[_0x7d11('0x3d')][_0x7d11('0x59')]()['then'](respondWithResult(_0x407f2c,null))[_0x7d11('0x21')](handleError(_0x407f2c,null));};exports['addContacts']=function(_0x34aab4,_0x49f904){return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x34aab4['params']['id']}})[_0x7d11('0x17')](handleEntityNotFound(_0x49f904,null))[_0x7d11('0x17')](function(_0x2581d5){if(_0x2581d5){return _0x2581d5[_0x7d11('0x5a')](_0x34aab4['body']['ids'],_[_0x7d11('0x5b')](_0x34aab4[_0x7d11('0x58')],[_0x7d11('0x5c'),'id'])||{});}})[_0x7d11('0x17')](respondWithResult(_0x49f904,null))[_0x7d11('0x21')](handleError(_0x49f904,null));};function validateUser(_0x492183){return new BPromise(function(_0x2b9ba0,_0x5ad800){if(_0x492183[_0x7d11('0x5d')])return _0x2b9ba0(_0x492183);return db[_0x7d11('0x5e')][_0x7d11('0x5f')](0x1)[_0x7d11('0x17')](function(_0x4df2da){if(_0x4df2da[_0x7d11('0x60')])authService['validatePasswordPattern'](_0x492183[_0x7d11('0x4e')]);db[_0x7d11('0x3d')][_0x7d11('0x61')](_0x7d11('0x5d'))[_0x7d11('0x17')](function(_0x776b20){if(_[_0x7d11('0x62')](_0x776b20)){_0x492183[_0x7d11('0x5d')]=_0x4df2da[_0x7d11('0x63')]||0x1;return;}if(_[_0x7d11('0x62')](_0x4df2da[_0x7d11('0x63')])||_0x4df2da[_0x7d11('0x63')]===_0x776b20){_0x492183[_0x7d11('0x5d')]=_0x776b20+0x1;return;}if(_0x4df2da[_0x7d11('0x63')]>_0x776b20){_0x492183['internal']=_0x4df2da[_0x7d11('0x63')];return;}return db['sequelize'][_0x7d11('0x3e')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x7d11('0x64')][_0x7d11('0x65')][_0x7d11('0x66')]})[_0x7d11('0x17')](function(_0x4aac67){if(_0x4aac67&&_0x4aac67['length']){for(var _0x1351ee=0x0,_0x15938b=_0x4aac67[_0x7d11('0x67')];_0x1351ee<_0x15938b&&_['isNil'](_0x492183[_0x7d11('0x5d')]);_0x1351ee++){if(_0x4df2da[_0x7d11('0x63')]<=_0x4aac67[_0x1351ee][_0x7d11('0x68')]){_0x492183[_0x7d11('0x5d')]=_0x4aac67[_0x1351ee][_0x7d11('0x68')];}else if(_0x4df2da[_0x7d11('0x63')]>_0x4aac67[_0x1351ee]['from']&&_0x4df2da[_0x7d11('0x63')]<=_0x4aac67[_0x1351ee]['to']){_0x492183['internal']=_0x4df2da[_0x7d11('0x63')];}}}if(_['isNil'](_0x492183['internal'])){_0x492183[_0x7d11('0x5d')]=_0x776b20+0x1;}return _0x2b9ba0(_0x492183);});});})[_0x7d11('0x21')](function(_0xeed31b){_0x5ad800(_0xeed31b);});});}function updateUser(_0x14ee15){return new BPromise(function(_0x119da7,_0x2da548){try{if(_0x14ee15[_0x7d11('0x69')]){_0x14ee15[_0x7d11('0x6a')]=_0x14ee15[_0x7d11('0x5d')];_0x14ee15[_0x7d11('0x6b')]={'mailbox':_0x14ee15[_0x7d11('0x5d')],'password':_0x14ee15['password'],'fullname':_0x14ee15[_0x7d11('0x6c')],'email':_0x14ee15['email']};}if(_0x14ee15[_0x7d11('0x31')]===_0x7d11('0x2c')){if(!_0x14ee15[_0x7d11('0x6d')])_0x14ee15[_0x7d11('0x6d')]=[_0x7d11('0x6e'),_0x7d11('0x6f'),_0x7d11('0x70'),'113','110',_0x7d11('0x71'),_0x7d11('0x72'),_0x7d11('0x73'),_0x7d11('0x74'),_0x7d11('0x75'),'109',_0x7d11('0x76'),'111',_0x7d11('0x77'),_0x7d11('0x78')];}_0x119da7(_0x14ee15);}catch(_0x1bddb4){_0x2da548(_0x1bddb4);}});}exports[_0x7d11('0x79')]=function(_0x1b5e35,_0x1c02c8){if(_0x1b5e35[_0x7d11('0x7a')][_0x7d11('0x31')]==='agent')throw new Error('Unauthorized');if(_0x1b5e35[_0x7d11('0x58')][_0x7d11('0x31')]===_0x7d11('0x7a')&&_0x1b5e35['user']['role']!==_0x7d11('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x1b5e35[_0x7d11('0x58')][_0x7d11('0x31')]===_0x7d11('0x7b')&&_0x1b5e35[_0x7d11('0x7a')]['role']!==_0x7d11('0x7b')){throw new Error(_0x7d11('0x7c'));}return licenseUtil[_0x7d11('0x7d')]([_0x1b5e35[_0x7d11('0x58')]])[_0x7d11('0x17')](function(){return validateUser(_0x1b5e35[_0x7d11('0x58')]);})[_0x7d11('0x17')](function(_0x1b719a){return updateUser(_0x1b719a)['then'](function(_0x41f989){if(_0x41f989[_0x7d11('0x31')]===_0x7d11('0x7b')){_0x41f989[_0x7d11('0x7e')]=_0x1b5e35[_0x7d11('0x7a')]['settingsEnabled'];delete _0x41f989[_0x7d11('0x7f')];}return _0x41f989;});})[_0x7d11('0x17')](function(_0xa4d2ad){return db[_0x7d11('0x3d')][_0x7d11('0x79')](_0xa4d2ad,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x1fdae2){if(_0x1b5e35['body'][_0x7d11('0x31')]==='user')return _0x1fdae2;if(_0x1b5e35['user'][_0x7d11('0x31')]!==_0x7d11('0x7a'))return _0x1fdae2;return db[_0x7d11('0x80')][_0x7d11('0x55')]({'where':{'name':_0x1fdae2[_0x7d11('0x31')]===_0x7d11('0x2c')?_0x7d11('0x2b'):_0x7d11('0x2d'),'userProfileId':_0x1b5e35[_0x7d11('0x7a')][_0x7d11('0x7f')]},'raw':!![]})['then'](function(_0xfdfcb7){if(!_0xfdfcb7||_0xfdfcb7[_0x7d11('0x81')]!=0x0)return _0x1fdae2;return db['UserProfileResource'][_0x7d11('0x79')]({'name':_0x1fdae2[_0x7d11('0x34')],'resourceId':_0x1fdae2['id'],'type':_0xfdfcb7[_0x7d11('0x34')],'sectionId':_0xfdfcb7['id']},{})[_0x7d11('0x17')](function(){return _0x1fdae2;});})['catch'](function(_0x573fa9){logger[_0x7d11('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x573fa9);throw _0x573fa9;});})[_0x7d11('0x17')](respondWithResult(_0x1c02c8,0xc9))[_0x7d11('0x21')](handleError(_0x1c02c8,null));};exports[_0x7d11('0x82')]=function(_0x13ccd5,_0x1565d9){var _0x269f3f=_0x13ccd5[_0x7d11('0x58')];var _0x596228=[];if(_0x13ccd5[_0x7d11('0x7a')][_0x7d11('0x31')]===_0x7d11('0x2c'))throw new Error(_0x7d11('0x83'));if(_['some'](_0x269f3f,[_0x7d11('0x31'),_0x7d11('0x7a')])&&_0x13ccd5['user'][_0x7d11('0x31')]!==_0x7d11('0x7b')){throw new Error(_0x7d11('0x84'));}if(_['some'](_0x269f3f,[_0x7d11('0x31'),_0x7d11('0x7b')])&&_0x13ccd5['user'][_0x7d11('0x31')]!==_0x7d11('0x7b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x7d11('0x7d')](_0x269f3f)['then'](function(){return validateUser(_0x269f3f[0x0]);})['then'](function(){for(var _0x4ba3f6=0x1;_0x4ba3f6<_0x269f3f['length'];_0x4ba3f6++){var _0x526e65=_0x269f3f[_0x4ba3f6-0x1][_0x7d11('0x5d')];if(!_0x269f3f[_0x4ba3f6][_0x7d11('0x5d')])_0x269f3f[_0x4ba3f6][_0x7d11('0x5d')]=_0x526e65+0x1;_0x596228[_0x7d11('0x41')](validateUser(_0x269f3f[_0x4ba3f6]));}return BPromise[_0x7d11('0x49')](_0x596228);})[_0x7d11('0x17')](function(){_0x596228=[];for(var _0x1a2df6=0x0;_0x1a2df6<_0x269f3f[_0x7d11('0x67')];_0x1a2df6++){_0x596228[_0x7d11('0x41')](updateUser(_0x269f3f[_0x1a2df6]));}return BPromise['all'](_0x596228);})['then'](function(){return BPromise[_0x7d11('0x85')](_0x269f3f,function(_0x158e0f){return db['User']['create'](_0x158e0f,{'include':[{'model':db[_0x7d11('0x6b')],'as':_0x7d11('0x6b')}]})[_0x7d11('0x17')](function(_0x391d7){_0x158e0f['id']=_0x391d7['id'];return _0x158e0f;});});})['then'](function(_0x542596){if(_0x13ccd5['body'][_0x7d11('0x31')]===_0x7d11('0x7a'))return _0x542596;if(_0x13ccd5[_0x7d11('0x7a')]['role']!==_0x7d11('0x7a'))return _0x542596;var _0x238cfd=_['some'](_0x542596,function(_0x4aafef){return _0x4aafef[_0x7d11('0x31')]==='agent'||_0x4aafef['role']===_0x7d11('0x86');});if(!_0x238cfd)return _0x542596;return db[_0x7d11('0x80')]['findAll']({'where':{'name':{'$or':['Agents',_0x7d11('0x2d')]},'userProfileId':_0x13ccd5[_0x7d11('0x7a')][_0x7d11('0x7f')]},'raw':!![]})[_0x7d11('0x17')](function(_0x4af02c){if(_[_0x7d11('0x87')](_0x4af02c)||!_[_0x7d11('0x88')](_0x4af02c,[_0x7d11('0x81'),0x0]))return _0x542596;_0x596228=[];var _0x83416b=_(_0x4af02c)['map'](function(_0xdd679a){if(_0xdd679a[_0x7d11('0x81')]===0x1)return;return _0xdd679a[_0x7d11('0x34')]==='Agents'?_0x7d11('0x2c'):'telephone';})[_0x7d11('0x89')]()['value']();for(var _0x1a0e19=0x0;_0x1a0e19<_0x542596[_0x7d11('0x67')];_0x1a0e19++){if(!_[_0x7d11('0x30')](_0x83416b,_0x542596[_0x1a0e19][_0x7d11('0x31')]))return;var _0x38094f=_0x542596[_0x1a0e19][_0x7d11('0x31')]==='agent'?'Agents':_0x7d11('0x2d');_0x596228[_0x7d11('0x41')](db[_0x7d11('0x8a')][_0x7d11('0x79')]({'name':_0x542596[_0x1a0e19]['name'],'resourceId':_0x542596[_0x1a0e19]['id'],'type':_0x38094f,'sectionId':_[_0x7d11('0x55')](_0x4af02c,[_0x7d11('0x34'),_0x38094f])['id']},{}));}return BPromise[_0x7d11('0x49')](_0x596228);});})[_0x7d11('0x17')](respondWithResult(_0x1565d9,0xc9))['catch'](handleError(_0x1565d9,null));};exports[_0x7d11('0x8b')]=function(_0x2bac2a,_0x3aad38){if(_0x2bac2a[_0x7d11('0x58')]['id']){delete _0x2bac2a[_0x7d11('0x58')]['id'];}return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x2bac2a[_0x7d11('0x4a')]['id']}})['then'](function(_0xe03909){if(!_0xe03909)return null;if(_0xe03909['id']===_0x2bac2a['user']['id']){if(!_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8c')]||!_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0x90'));}if(!_0xe03909[_0x7d11('0x91')](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8c')])){throw new db['Sequelize'][(_0x7d11('0x8f'))]('Wrong\x20credentials');}if(_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8c')]===_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x2bac2a[_0x7d11('0x7a')][_0x7d11('0x31')]==='admin'){if(!_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0x92'));}}else if(_0x2bac2a['user']['role']==='user'){if(!_0x2bac2a['body'][_0x7d11('0x8d')]){throw new db[(_0x7d11('0x8e'))]['ValidationError'](_0x7d11('0x92'));}if(_0xe03909[_0x7d11('0x31')]!==_0x7d11('0x2c')){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0x83'));}}else{throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))]('Unauthorized');}return _0xe03909;})[_0x7d11('0x17')](handleEntityNotFound(_0x3aad38,null))[_0x7d11('0x17')](function(_0x54fd6a){return db[_0x7d11('0x5e')][_0x7d11('0x93')]({'attributes':['id',_0x7d11('0x60'),_0x7d11('0x94'),_0x7d11('0x95')]})[_0x7d11('0x17')](function(_0x1b8ad6){if(_0x1b8ad6[_0x7d11('0x60')])authService[_0x7d11('0x96')](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')]);if(!_0x1b8ad6[_0x7d11('0x94')]||!_0x54fd6a['previousPasswords'])return _0x54fd6a;authService['validatePasswordHistory'](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')],_0x54fd6a[_0x7d11('0x97')],_0x1b8ad6['passwordHistoryLimit']);return _0x54fd6a;})[_0x7d11('0x17')](saveUpdates({'password':_0x2bac2a['body'][_0x7d11('0x8d')],'passwordResetAt':_0x2bac2a[_0x7d11('0x7a')]['id']==_0x2bac2a[_0x7d11('0x4a')]['id']?moment():null,'previousPasswords':authService[_0x7d11('0x98')](_0x2bac2a[_0x7d11('0x58')][_0x7d11('0x8d')],_0x54fd6a[_0x7d11('0x97')])},null));})[_0x7d11('0x17')](respondWithResult(_0x3aad38,null))[_0x7d11('0x21')](handleError(_0x3aad38,null));};exports[_0x7d11('0x99')]=function(_0x358178,_0x460c72){var _0x2c3a17=_0x358178[_0x7d11('0x58')][_0x7d11('0x9a')];return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x358178[_0x7d11('0x4a')]['id']},'attributes':['id','name','role',_0x7d11('0x9b'),_0x7d11('0x9c'),_0x7d11('0x9d'),_0x7d11('0x9e')]})[_0x7d11('0x17')](handleEntityNotFound(_0x460c72,null))['then'](function(_0x59d543){if(_0x59d543){if(!utils['isValidChannel'](_0x2c3a17)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x59d543[_0x7d11('0x9f')+_[_0x7d11('0xa0')](_0x2c3a17[_0x7d11('0xa1')]())+_0x7d11('0xa2')](_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')],{'penalty':_0x358178[_0x7d11('0x58')][_0x7d11('0xa3')]||0x0})[_0x7d11('0xa4')](function(_0x1570be){for(var _0x4135f7=0x0;_0x4135f7<_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')]['length'];_0x4135f7+=0x1){var _0x51b469={'UserId':Number(_0x358178['params']['id'])};_0x51b469[_['capitalize'](_0x2c3a17['toLowerCase']())+_0x7d11('0xa5')]=Number(_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')][_0x4135f7]);socket[_0x7d11('0xa6')](_0x7d11('0x7a')+_[_0x7d11('0xa0')](_0x2c3a17[_0x7d11('0xa1')]())+_0x7d11('0xa7'),_0x51b469);}return _0x1570be;})[_0x7d11('0x17')](function(){if(_0x2c3a17===_0x7d11('0xa8')){return db['VoiceQueue'][_0x7d11('0xa9')]({'where':{'id':_0x358178[_0x7d11('0x58')][_0x7d11('0x5c')]||[]},'raw':!![],'attributes':['id',_0x7d11('0x34')]});}})[_0x7d11('0x17')](function(_0x43a20c){var _0x53887c=_0x59d543[_0x7d11('0x29')]({'plain':!![]});var _0x25c8e4=[];if(_0x2c3a17===_0x7d11('0xa8')&&_0x53887c[_0x7d11('0x31')]==='agent'&&_0x53887c[_0x7d11('0x9b')]){for(var _0xbdc907=0x0;_0xbdc907<_0x43a20c['length'];_0xbdc907+=0x1){_0x25c8e4[_0x7d11('0x41')]({'membername':_0x53887c[_0x7d11('0x34')],'UserId':_0x53887c['id'],'queue_name':_0x43a20c[_0xbdc907][_0x7d11('0x34')],'VoiceQueueId':_0x43a20c[_0xbdc907]['id'],'interface':_['isNil'](_0x53887c[_0x7d11('0x9e')])?util[_0x7d11('0xaa')]('SIP/%s',_0x53887c[_0x7d11('0x34')]):_0x53887c[_0x7d11('0x9e')],'paused':_0x53887c[_0x7d11('0x9d')]||![],'penalty':_0x358178[_0x7d11('0x58')]['penalty']||0x0});}return BPromise['each'](_0x25c8e4,function(_0x83a280){return db[_0x7d11('0xab')][_0x7d11('0xac')](_0x83a280);});}return _0x59d543;});}})[_0x7d11('0x17')](respondWithStatusCode(_0x460c72,null))[_0x7d11('0x21')](handleError(_0x460c72,null));};exports['removeQueues']=function(_0x462e6b,_0x1398e8){var _0x45f8e0;return db[_0x7d11('0x3d')]['find']({'where':{'id':_0x462e6b[_0x7d11('0x4a')]['id']},'attributes':['id',_0x7d11('0x34'),_0x7d11('0x31')]})['then'](handleEntityNotFound(_0x1398e8,null))[_0x7d11('0x17')](function(_0x3fb52a){if(_0x3fb52a){_0x45f8e0=_0x3fb52a;if(!_0x462e6b[_0x7d11('0x3e')]['channel']||!utils[_0x7d11('0xad')](_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x9a')])){throw new db[(_0x7d11('0x8e'))][(_0x7d11('0x8f'))](_0x7d11('0xae'));}return _0x3fb52a[_0x7d11('0xaf')+_['capitalize'](_0x462e6b[_0x7d11('0x3e')]['channel'][_0x7d11('0xa1')]())+_0x7d11('0xa2')](_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x5c')]);}})['then'](function(_0x2e4eac){if(_['isArray'](_0x462e6b['query'][_0x7d11('0x5c')])){for(var _0x1ebd24=0x0;_0x1ebd24<_0x462e6b['query'][_0x7d11('0x5c')]['length'];_0x1ebd24+=0x1){var _0x451e24={'UserId':Number(_0x462e6b['params']['id'])};_0x451e24[_['capitalize'](_0x462e6b[_0x7d11('0x3e')]['channel'][_0x7d11('0xa1')]())+_0x7d11('0xa5')]=Number(_0x462e6b['query'][_0x7d11('0x5c')][_0x1ebd24]);socket['emit']('user'+_[_0x7d11('0xa0')](_0x462e6b['query']['channel']['toLowerCase']())+_0x7d11('0xb0'),_0x451e24);}}else{var _0x451e24={'UserId':Number(_0x462e6b[_0x7d11('0x4a')]['id'])};_0x451e24[_[_0x7d11('0xa0')](_0x462e6b[_0x7d11('0x3e')]['channel'][_0x7d11('0xa1')]())+_0x7d11('0xa5')]=Number(_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x5c')]);socket[_0x7d11('0xa6')](_0x7d11('0x7a')+_['capitalize'](_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x9a')][_0x7d11('0xa1')]())+_0x7d11('0xb0'),_0x451e24);}return _0x2e4eac;})[_0x7d11('0x17')](function(){if(_0x462e6b[_0x7d11('0x3e')]['channel']===_0x7d11('0xa8')){return db[_0x7d11('0xab')][_0x7d11('0x32')]({'where':{'UserId':_0x462e6b['params']['id'],'VoiceQueueId':_0x462e6b[_0x7d11('0x3e')][_0x7d11('0x5c')]},'individualHooks':!![]})[_0x7d11('0x17')](function(){return _0x45f8e0;});}return _0x45f8e0;})['then'](respondWithStatusCode(_0x1398e8,null))[_0x7d11('0x21')](handleError(_0x1398e8,null));};exports[_0x7d11('0xb1')]=function(_0x945c35,_0xd55b9b){_0x945c35[_0x7d11('0x58')]['userpic']=_0x945c35[_0x7d11('0xb2')][_0x7d11('0xb3')];return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x945c35[_0x7d11('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd55b9b,null))['then'](saveUpdates(_0x945c35[_0x7d11('0x58')],null))[_0x7d11('0x17')](respondWithResult(_0xd55b9b,null))[_0x7d11('0x21')](handleError(_0xd55b9b,null));};exports[_0x7d11('0xb4')]=function(_0x388028,_0x3e8c11){var _0x3aceef=path[_0x7d11('0xb5')](config[_0x7d11('0xb6')],_0x7d11('0xb7'));return db[_0x7d11('0x3d')][_0x7d11('0x55')]({'where':{'id':_0x388028['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x3e8c11,null))[_0x7d11('0x17')](function(_0x2ff073){if(_0x2ff073){if(_[_0x7d11('0x62')](_0x2ff073[_0x7d11('0xb8')])){return _0x3e8c11[_0x7d11('0xb9')](_0x3aceef);}else{if(!fs[_0x7d11('0xba')](path[_0x7d11('0xb5')](config[_0x7d11('0xb6')],_0x7d11('0xbb'),_0x2ff073['userpic']))){return _0x3e8c11[_0x7d11('0xb9')](_0x3aceef);}return _0x3e8c11[_0x7d11('0xb9')](path[_0x7d11('0xb5')](config['root'],_0x7d11('0xbb'),_0x2ff073[_0x7d11('0xb8')]));}}})[_0x7d11('0x21')](handleError(_0x3e8c11,null));};exports[_0x7d11('0xbc')]=function(_0x39c200,_0x250b96){return db['User'][_0x7d11('0x55')]({'where':{'id':_0x39c200['params']['id']},'attributes':['id']})[_0x7d11('0x17')](handleEntityNotFound(_0x250b96,null))[_0x7d11('0x17')](function(_0x248f58){var _0x1b65aa=[];values=_0x248f58[_0x7d11('0x46')];_0x1b65aa['push'](get_open_tabs('chat',_0x248f58['dataValues']));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x47'),_0x248f58[_0x7d11('0x46')]));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x56'),_0x248f58['dataValues']));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0x48'),_0x248f58['dataValues']));_0x1b65aa[_0x7d11('0x41')](get_open_tabs(_0x7d11('0xbd'),_0x248f58[_0x7d11('0x46')]));_0x1b65aa[_0x7d11('0x41')](get_open_tabs('mail',_0x248f58['dataValues']));return BPromise[_0x7d11('0x49')](_0x1b65aa);})['then'](function(_0x10890c){var _0x58e579=[];if(_0x10890c){for(var _0x3604e7=0x0;_0x3604e7=_0x20a161){_0x29abdb=_0x20a161;_0x28f710=0xc8;}else{_0x28f710=0xce;}_0x524e42['status'](_0x28f710);return _0x524e42[_0x65f6('0x22')](_0x65f6('0x23'),_0x5cb131+'-'+_0x29abdb+'/'+_0x20a161)[_0x65f6('0x1d')](_0x471a33);}return null;};}function saveUpdates(_0x559330){return function(_0x4ac04b){if(_0x4ac04b){return _0x4ac04b['update'](_0x559330)[_0x65f6('0x24')](function(_0x3c032f){return _0x3c032f;});}return null;};}function removeEntity(_0x4344b3){return function(_0x408ccc){if(_0x408ccc){return _0x408ccc[_0x65f6('0x25')]()[_0x65f6('0x24')](function(){var _0x144e55=_0x408ccc['get']({'plain':!![]});if(_0x144e55['role']===_0x65f6('0x26'))return;var _0x27e284=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x65f6('0x27'),'value':_0x65f6('0x28'),'ignore':![]},{'name':_0x65f6('0x29'),'value':_0x65f6('0x2a'),'ignore':![]}];var _0x1217fd=_(_0x27e284)[_0x65f6('0x2b')]('ignore')[_0x65f6('0x2c')](_0x65f6('0x2d'))[_0x65f6('0x2d')]();if(_['includes'](_0x1217fd,_0x144e55[_0x65f6('0x2e')])){return;}var _0x2a7aa8=_[_0x65f6('0x2f')](_0x27e284,[_0x65f6('0x2d'),_0x144e55[_0x65f6('0x2e')]])[_0x65f6('0x30')];return db['UserProfileResource'][_0x65f6('0x25')]({'where':{'type':_0x2a7aa8,'resourceId':_0x144e55['id']}})[_0x65f6('0x24')](function(){return _0x408ccc;});})['then'](function(){_0x4344b3[_0x65f6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b403b){return function(_0x50494b){if(!_0x50494b){_0x2b403b[_0x65f6('0x1b')](0x194);}return _0x50494b;};}function handleError(_0x24f7fd,_0x5ce050){_0x5ce050=_0x5ce050||0x1f4;return function(_0x12dee6){logger[_0x65f6('0x18')](_0x12dee6[_0x65f6('0x31')]);if(_0x12dee6['name']){delete _0x12dee6['name'];}_0x24f7fd[_0x65f6('0x1c')](_0x5ce050)['send'](_0x12dee6);};}exports[_0x65f6('0x32')]=function(_0x4e6653,_0x22d760){var _0x2b9675={},_0x5e97f1={'count':0x0,'rows':[]};var _0x44b809=_(db['User']['rawAttributes'])[_0x65f6('0x2c')](function(_0x44f0f7){return{'name':_0x44f0f7[_0x65f6('0x33')],'type':_0x44f0f7[_0x65f6('0x34')][_0x65f6('0x35')]};})[_0x65f6('0x2b')](function(_0x1a55da){return!_[_0x65f6('0x36')](['password',_0x65f6('0x37')],_0x1a55da['name']);})[_0x65f6('0x2d')]();_0x2b9675=qs[_0x65f6('0x38')](_0x44b809,_0x4e6653);var _0x4ba7db={'where':_0x2b9675[_0x65f6('0x39')]};return db['User'][_0x65f6('0x21')](_0x4ba7db)[_0x65f6('0x24')](function(_0x413819){_0x5e97f1[_0x65f6('0x21')]=_0x413819;if(_0x4e6653[_0x65f6('0x3a')][_0x65f6('0x3b')]){_0x2b9675[_0x65f6('0x3c')]=[{'all':!![]}];}if(!_[_0x65f6('0x36')](_0x2b9675[_0x65f6('0x3d')],'id')){_0x2b9675['attributes'][_0x65f6('0x3e')]('id');}return db[_0x65f6('0x3f')][_0x65f6('0x40')](_0x2b9675);})[_0x65f6('0x24')](function(_0x83e2d9){_0x5e97f1[_0x65f6('0x41')]=_0x83e2d9;if(_0x4e6653[_0x65f6('0x3a')][_0x65f6('0x42')]===_0x65f6('0x43')){var _0x2abbed=[];for(var _0xcf19da=0x0;_0xcf19da<_0x5e97f1[_0x65f6('0x41')][_0x65f6('0x44')];_0xcf19da++){_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da]['dataValues']));_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed['push'](get_open_tabs(_0x65f6('0x48'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed['push'](get_open_tabs(_0x65f6('0x49'),_0x5e97f1[_0x65f6('0x41')][_0xcf19da][_0x65f6('0x47')]));_0x2abbed[_0x65f6('0x3e')](get_open_tabs('openchannel',_0x5e97f1[_0x65f6('0x41')][_0xcf19da]['dataValues']));_0x2abbed[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x4a'),_0x5e97f1['rows'][_0xcf19da][_0x65f6('0x47')]));}return BPromise['all'](_0x2abbed)[_0x65f6('0x24')](function(_0x4d9b76){return _0x5e97f1;});}else{return _0x5e97f1;}})[_0x65f6('0x24')](respondWithFilteredResult(_0x22d760,_0x2b9675))[_0x65f6('0x1a')](handleError(_0x22d760,null));};exports[_0x65f6('0x4b')]=function(_0x3837b2,_0x4d30c5){var _0x51bf6c={'raw':![],'where':{'id':_0x3837b2[_0x65f6('0x4c')]['id']}},_0x198e2f={};_0x198e2f[_0x65f6('0x4d')]=_[_0x65f6('0x4e')](_[_0x65f6('0x4f')](db[_0x65f6('0x3f')][_0x65f6('0x50')]),[_0x65f6('0x51'),_0x65f6('0x37')]);_0x198e2f['query']=_[_0x65f6('0x4f')](_0x3837b2[_0x65f6('0x3a')]);_0x198e2f[_0x65f6('0x52')]=_['intersection'](_0x198e2f[_0x65f6('0x4d')],_0x198e2f[_0x65f6('0x3a')]);_0x51bf6c['attributes']=_[_0x65f6('0x53')](_0x198e2f[_0x65f6('0x4d')],qs['fields'](_0x3837b2[_0x65f6('0x3a')]['fields']));_0x51bf6c[_0x65f6('0x3d')]=_0x51bf6c[_0x65f6('0x3d')][_0x65f6('0x44')]?_0x51bf6c['attributes']:_0x198e2f[_0x65f6('0x4d')];if(_0x3837b2[_0x65f6('0x3a')]['includeAll']){_0x51bf6c[_0x65f6('0x3c')]=[{'all':!![]}];}_0x51bf6c=_[_0x65f6('0x54')]({},_0x51bf6c,_0x3837b2['options']);if(!_[_0x65f6('0x36')](_0x51bf6c[_0x65f6('0x3d')],'id')){_0x51bf6c[_0x65f6('0x3d')][_0x65f6('0x3e')]('id');}return db[_0x65f6('0x3f')][_0x65f6('0x2f')](_0x51bf6c)[_0x65f6('0x24')](handleEntityNotFound(_0x4d30c5,null))[_0x65f6('0x24')](function(_0x4f69d8){var _0x52c5a4=[];values=_0x4f69d8;if(_0x3837b2['query'][_0x65f6('0x42')]===_0x65f6('0x43')){_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x4f69d8['dataValues']));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4['push'](get_open_tabs(_0x65f6('0x55'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs('whatsapp',_0x4f69d8['dataValues']));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x48'),_0x4f69d8[_0x65f6('0x47')]));_0x52c5a4[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x49'),_0x4f69d8[_0x65f6('0x47')]));return BPromise[_0x65f6('0x56')](_0x52c5a4);}else{return values;}})[_0x65f6('0x24')](function(_0x2d8b5b){return values;})[_0x65f6('0x24')](respondWithResult(_0x4d30c5,null))[_0x65f6('0x1a')](handleError(_0x4d30c5,null));};exports[_0x65f6('0x57')]=function(_0x30adee,_0x3e3143){if(_0x30adee['body']['id']){delete _0x30adee[_0x65f6('0x58')]['id'];}delete _0x30adee[_0x65f6('0x58')][_0x65f6('0x2e')];return db['User'][_0x65f6('0x2f')]({'where':{'id':_0x30adee[_0x65f6('0x4c')]['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x3e3143,null))[_0x65f6('0x24')](saveUpdates(_0x30adee['body'],null))[_0x65f6('0x24')](respondWithResult(_0x3e3143,null))[_0x65f6('0x1a')](handleError(_0x3e3143,null));};exports[_0x65f6('0x59')]=function(_0x3e0d8b,_0x553ff0){return db[_0x65f6('0x3f')][_0x65f6('0x59')]()['then'](respondWithResult(_0x553ff0,null))[_0x65f6('0x1a')](handleError(_0x553ff0,null));};exports[_0x65f6('0x5a')]=function(_0x36c316,_0x51549d){return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x36c316[_0x65f6('0x4c')]['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x51549d,null))[_0x65f6('0x24')](function(_0x334fa1){if(_0x334fa1){return _0x334fa1['addContacts'](_0x36c316['body']['ids'],_[_0x65f6('0x5b')](_0x36c316[_0x65f6('0x58')],[_0x65f6('0x5c'),'id'])||{});}})[_0x65f6('0x24')](respondWithResult(_0x51549d,null))[_0x65f6('0x1a')](handleError(_0x51549d,null));};function validateUser(_0x304cf9){return new BPromise(function(_0x4c5cd2,_0xfbfebc){if(_0x304cf9[_0x65f6('0x5d')])return _0x4c5cd2(_0x304cf9);return db['Setting'][_0x65f6('0x5e')](0x1)[_0x65f6('0x24')](function(_0x477489){if(_0x477489['securePassword'])authService[_0x65f6('0x5f')](_0x304cf9[_0x65f6('0x51')]);db['User'][_0x65f6('0x60')](_0x65f6('0x5d'))[_0x65f6('0x24')](function(_0x417b44){if(_[_0x65f6('0x61')](_0x417b44)){_0x304cf9[_0x65f6('0x5d')]=_0x477489[_0x65f6('0x62')]||0x1;return;}if(_['isNil'](_0x477489['min_internal'])||_0x477489[_0x65f6('0x62')]===_0x417b44){_0x304cf9[_0x65f6('0x5d')]=_0x417b44+0x1;return;}if(_0x477489['min_internal']>_0x417b44){_0x304cf9[_0x65f6('0x5d')]=_0x477489['min_internal'];return;}return db[_0x65f6('0x63')]['query'](_0x65f6('0x64'),{'type':db[_0x65f6('0x63')][_0x65f6('0x65')][_0x65f6('0x66')]})[_0x65f6('0x24')](function(_0x264e6c){if(_0x264e6c&&_0x264e6c[_0x65f6('0x44')]){for(var _0x1cc66a=0x0,_0x2405a7=_0x264e6c['length'];_0x1cc66a<_0x2405a7&&_['isNil'](_0x304cf9[_0x65f6('0x5d')]);_0x1cc66a++){if(_0x477489[_0x65f6('0x62')]<=_0x264e6c[_0x1cc66a][_0x65f6('0x67')]){_0x304cf9['internal']=_0x264e6c[_0x1cc66a]['from'];}else if(_0x477489[_0x65f6('0x62')]>_0x264e6c[_0x1cc66a][_0x65f6('0x67')]&&_0x477489[_0x65f6('0x62')]<=_0x264e6c[_0x1cc66a]['to']){_0x304cf9[_0x65f6('0x5d')]=_0x477489[_0x65f6('0x62')];}}}if(_[_0x65f6('0x61')](_0x304cf9['internal'])){_0x304cf9['internal']=_0x417b44+0x1;}return _0x4c5cd2(_0x304cf9);});});})[_0x65f6('0x1a')](function(_0x244f30){_0xfbfebc(_0x244f30);});});}function updateUser(_0x5543bc){return new BPromise(function(_0x219bf8,_0x4a8b60){try{if(_0x5543bc[_0x65f6('0x68')]){_0x5543bc[_0x65f6('0x69')]=_0x5543bc[_0x65f6('0x5d')];_0x5543bc[_0x65f6('0x6a')]={'mailbox':_0x5543bc['internal'],'password':_0x5543bc[_0x65f6('0x51')],'fullname':_0x5543bc[_0x65f6('0x6b')],'email':_0x5543bc[_0x65f6('0x6c')]};}if(_0x5543bc['role']==='agent'){if(!_0x5543bc[_0x65f6('0x6d')])_0x5543bc['permissions']=[_0x65f6('0x6e'),_0x65f6('0x6f'),_0x65f6('0x70'),_0x65f6('0x71'),'110','104','105',_0x65f6('0x72'),_0x65f6('0x73'),_0x65f6('0x74'),'109',_0x65f6('0x75'),_0x65f6('0x76'),_0x65f6('0x77'),'115'];}_0x219bf8(_0x5543bc);}catch(_0x40d0f7){_0x4a8b60(_0x40d0f7);}});}exports[_0x65f6('0x78')]=function(_0x4a3eab,_0x758e80){if(_0x4a3eab[_0x65f6('0x79')]['role']===_0x65f6('0x28'))throw new Error('Unauthorized');if(_0x4a3eab[_0x65f6('0x58')]['role']===_0x65f6('0x79')&&_0x4a3eab[_0x65f6('0x79')]['role']!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7a'));}if(_0x4a3eab[_0x65f6('0x58')][_0x65f6('0x2e')]===_0x65f6('0x26')&&_0x4a3eab[_0x65f6('0x79')][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7b'));}return licenseUtil[_0x65f6('0x7c')]([_0x4a3eab[_0x65f6('0x58')]])['then'](function(){return validateUser(_0x4a3eab[_0x65f6('0x58')]);})[_0x65f6('0x24')](function(_0x15c8b7){return updateUser(_0x15c8b7)[_0x65f6('0x24')](function(_0x5694f9){if(_0x5694f9[_0x65f6('0x2e')]===_0x65f6('0x26')){_0x5694f9['settingsEnabled']=_0x4a3eab[_0x65f6('0x79')]['settingsEnabled'];delete _0x5694f9[_0x65f6('0x7d')];}return _0x5694f9;});})['then'](function(_0x31f6c1){return db[_0x65f6('0x3f')]['create'](_0x31f6c1,{'include':[{'model':db['VoiceMail'],'as':_0x65f6('0x6a')}]});})[_0x65f6('0x24')](function(_0x5158c9){if(_0x4a3eab[_0x65f6('0x58')][_0x65f6('0x2e')]===_0x65f6('0x79'))return _0x5158c9;if(_0x4a3eab['user'][_0x65f6('0x2e')]!==_0x65f6('0x79'))return _0x5158c9;return db['UserProfileSection'][_0x65f6('0x2f')]({'where':{'name':_0x5158c9['role']===_0x65f6('0x28')?'Agents':'Telephones','userProfileId':_0x4a3eab[_0x65f6('0x79')][_0x65f6('0x7d')]},'raw':!![]})[_0x65f6('0x24')](function(_0xc82d69){if(!_0xc82d69||_0xc82d69[_0x65f6('0x7e')]!=0x0)return _0x5158c9;return db[_0x65f6('0x7f')][_0x65f6('0x78')]({'name':_0x5158c9[_0x65f6('0x30')],'resourceId':_0x5158c9['id'],'type':_0xc82d69['name'],'sectionId':_0xc82d69['id']},{})['then'](function(){return _0x5158c9;});})[_0x65f6('0x1a')](function(_0x590801){logger[_0x65f6('0x18')](_0x65f6('0x80'),_0x590801);throw _0x590801;});})[_0x65f6('0x24')](respondWithResult(_0x758e80,0xc9))[_0x65f6('0x1a')](handleError(_0x758e80,null));};exports[_0x65f6('0x81')]=function(_0x56bd9d,_0x398cac){var _0x257247=_0x56bd9d[_0x65f6('0x58')];var _0x576ecd=[];if(_0x56bd9d[_0x65f6('0x79')][_0x65f6('0x2e')]===_0x65f6('0x28'))throw new Error(_0x65f6('0x82'));if(_[_0x65f6('0x83')](_0x257247,[_0x65f6('0x2e'),'user'])&&_0x56bd9d['user'][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x7a'));}if(_[_0x65f6('0x83')](_0x257247,['role','admin'])&&_0x56bd9d[_0x65f6('0x79')][_0x65f6('0x2e')]!==_0x65f6('0x26')){throw new Error(_0x65f6('0x84'));}return licenseUtil[_0x65f6('0x7c')](_0x257247)[_0x65f6('0x24')](function(){return validateUser(_0x257247[0x0]);})['then'](function(){for(var _0x4d607a=0x1;_0x4d607a<_0x257247['length'];_0x4d607a++){var _0x2c59f6=_0x257247[_0x4d607a-0x1][_0x65f6('0x5d')];if(!_0x257247[_0x4d607a][_0x65f6('0x5d')])_0x257247[_0x4d607a][_0x65f6('0x5d')]=_0x2c59f6+0x1;_0x576ecd['push'](validateUser(_0x257247[_0x4d607a]));}return BPromise['all'](_0x576ecd);})[_0x65f6('0x24')](function(){_0x576ecd=[];for(var _0x27e44b=0x0;_0x27e44b<_0x257247['length'];_0x27e44b++){_0x576ecd[_0x65f6('0x3e')](updateUser(_0x257247[_0x27e44b]));}return BPromise['all'](_0x576ecd);})[_0x65f6('0x24')](function(){return BPromise['each'](_0x257247,function(_0x3a30ed){return db[_0x65f6('0x3f')]['create'](_0x3a30ed,{'include':[{'model':db[_0x65f6('0x6a')],'as':_0x65f6('0x6a')}]})[_0x65f6('0x24')](function(_0x9f6e0c){_0x3a30ed['id']=_0x9f6e0c['id'];return _0x3a30ed;});});})[_0x65f6('0x24')](function(_0x144db0){if(_0x56bd9d['body'][_0x65f6('0x2e')]==='user')return _0x144db0;if(_0x56bd9d[_0x65f6('0x79')]['role']!==_0x65f6('0x79'))return _0x144db0;var _0x3528be=_[_0x65f6('0x83')](_0x144db0,function(_0x41e59a){return _0x41e59a['role']===_0x65f6('0x28')||_0x41e59a[_0x65f6('0x2e')]===_0x65f6('0x2a');});if(!_0x3528be)return _0x144db0;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x65f6('0x27'),_0x65f6('0x29')]},'userProfileId':_0x56bd9d['user'][_0x65f6('0x7d')]},'raw':!![]})[_0x65f6('0x24')](function(_0x2837fb){if(_['isEmpty'](_0x2837fb)||!_[_0x65f6('0x83')](_0x2837fb,[_0x65f6('0x7e'),0x0]))return _0x144db0;_0x576ecd=[];var _0x5df361=_(_0x2837fb)[_0x65f6('0x2c')](function(_0x7136bc){if(_0x7136bc[_0x65f6('0x7e')]===0x1)return;return _0x7136bc['name']===_0x65f6('0x27')?_0x65f6('0x28'):_0x65f6('0x2a');})['compact']()[_0x65f6('0x2d')]();for(var _0x4febfa=0x0;_0x4febfa<_0x144db0[_0x65f6('0x44')];_0x4febfa++){if(!_[_0x65f6('0x36')](_0x5df361,_0x144db0[_0x4febfa][_0x65f6('0x2e')]))return;var _0x22be6e=_0x144db0[_0x4febfa][_0x65f6('0x2e')]===_0x65f6('0x28')?'Agents':_0x65f6('0x29');_0x576ecd[_0x65f6('0x3e')](db[_0x65f6('0x7f')][_0x65f6('0x78')]({'name':_0x144db0[_0x4febfa][_0x65f6('0x30')],'resourceId':_0x144db0[_0x4febfa]['id'],'type':_0x22be6e,'sectionId':_['find'](_0x2837fb,['name',_0x22be6e])['id']},{}));}return BPromise['all'](_0x576ecd);});})[_0x65f6('0x24')](respondWithResult(_0x398cac,0xc9))[_0x65f6('0x1a')](handleError(_0x398cac,null));};exports[_0x65f6('0x85')]=function(_0x59b715,_0x151cee){if(_0x59b715['body']['id']){delete _0x59b715['body']['id'];}return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x59b715['params']['id']}})[_0x65f6('0x24')](function(_0x3c5053){if(!_0x3c5053)return null;if(_0x3c5053['id']===_0x59b715[_0x65f6('0x79')]['id']){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x86')]||!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x8a'));}if(!_0x3c5053[_0x65f6('0x8b')](_0x59b715[_0x65f6('0x58')]['oldPassword'])){throw new db[(_0x65f6('0x88'))]['ValidationError']('Wrong\x20credentials');}if(_0x59b715[_0x65f6('0x58')][_0x65f6('0x86')]===_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db['Sequelize'][(_0x65f6('0x89'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x59b715['user'][_0x65f6('0x2e')]===_0x65f6('0x26')){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x59b715[_0x65f6('0x79')]['role']===_0x65f6('0x79')){if(!_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')]){throw new db['Sequelize'][(_0x65f6('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3c5053['role']!==_0x65f6('0x28')){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x82'));}}else{throw new db[(_0x65f6('0x88'))]['ValidationError'](_0x65f6('0x82'));}return _0x3c5053;})[_0x65f6('0x24')](handleEntityNotFound(_0x151cee,null))[_0x65f6('0x24')](function(_0x223409){return db['Setting'][_0x65f6('0x8c')]({'attributes':['id',_0x65f6('0x8d'),_0x65f6('0x8e'),_0x65f6('0x8f')]})[_0x65f6('0x24')](function(_0x1438f5){if(_0x1438f5[_0x65f6('0x8d')])authService[_0x65f6('0x5f')](_0x59b715['body'][_0x65f6('0x87')]);if(!_0x1438f5[_0x65f6('0x8e')]||!_0x223409[_0x65f6('0x90')])return _0x223409;authService[_0x65f6('0x91')](_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')],_0x223409['previousPasswords'],_0x1438f5[_0x65f6('0x8f')]);return _0x223409;})[_0x65f6('0x24')](saveUpdates({'password':_0x59b715['body'][_0x65f6('0x87')],'passwordResetAt':_0x59b715['user']['id']==_0x59b715[_0x65f6('0x4c')]['id']?moment():null,'previousPasswords':authService[_0x65f6('0x92')](_0x59b715[_0x65f6('0x58')][_0x65f6('0x87')],_0x223409[_0x65f6('0x90')])},null));})['then'](respondWithResult(_0x151cee,null))[_0x65f6('0x1a')](handleError(_0x151cee,null));};exports[_0x65f6('0x93')]=function(_0x2394eb,_0x31870f){var _0x99ca39=_0x2394eb['body']['channel'];return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x2394eb[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0x30'),'role','online','loginInPause',_0x65f6('0x94'),_0x65f6('0x95')]})[_0x65f6('0x24')](handleEntityNotFound(_0x31870f,null))['then'](function(_0x12730b){if(_0x12730b){if(!utils[_0x65f6('0x96')](_0x99ca39)){throw new db[(_0x65f6('0x88'))][(_0x65f6('0x89'))](_0x65f6('0x97'));}return _0x12730b['add'+_[_0x65f6('0x98')](_0x99ca39[_0x65f6('0x99')]())+'Queues'](_0x2394eb['body'][_0x65f6('0x5c')],{'penalty':_0x2394eb[_0x65f6('0x58')][_0x65f6('0x9a')]||0x0})[_0x65f6('0x9b')](function(_0x17bbc9){for(var _0x57dffb=0x0;_0x57dffb<_0x2394eb[_0x65f6('0x58')]['ids'][_0x65f6('0x44')];_0x57dffb+=0x1){var _0x5d181a={'UserId':Number(_0x2394eb[_0x65f6('0x4c')]['id'])};_0x5d181a[_['capitalize'](_0x99ca39[_0x65f6('0x99')]())+'QueueId']=Number(_0x2394eb[_0x65f6('0x58')][_0x65f6('0x5c')][_0x57dffb]);socket['emit']('user'+_[_0x65f6('0x98')](_0x99ca39[_0x65f6('0x99')]())+_0x65f6('0x9c'),_0x5d181a);}return _0x17bbc9;})[_0x65f6('0x24')](function(){if(_0x99ca39===_0x65f6('0x9d')){return db[_0x65f6('0x9e')][_0x65f6('0x40')]({'where':{'id':_0x2394eb[_0x65f6('0x58')][_0x65f6('0x5c')]||[]},'raw':!![],'attributes':['id',_0x65f6('0x30')]});}})[_0x65f6('0x24')](function(_0x6babec){var _0x264d8b=_0x12730b[_0x65f6('0x9f')]({'plain':!![]});var _0x377855=[];if(_0x99ca39===_0x65f6('0x9d')&&_0x264d8b[_0x65f6('0x2e')]==='agent'&&_0x264d8b[_0x65f6('0xa0')]){for(var _0x91d7bf=0x0;_0x91d7bf<_0x6babec[_0x65f6('0x44')];_0x91d7bf+=0x1){_0x377855[_0x65f6('0x3e')]({'membername':_0x264d8b[_0x65f6('0x30')],'UserId':_0x264d8b['id'],'queue_name':_0x6babec[_0x91d7bf][_0x65f6('0x30')],'VoiceQueueId':_0x6babec[_0x91d7bf]['id'],'interface':_[_0x65f6('0x61')](_0x264d8b[_0x65f6('0x95')])?util[_0x65f6('0xa1')]('SIP/%s',_0x264d8b[_0x65f6('0x30')]):_0x264d8b[_0x65f6('0x95')],'paused':_0x264d8b[_0x65f6('0x94')]||![],'penalty':_0x2394eb[_0x65f6('0x58')]['penalty']||0x0});}return BPromise[_0x65f6('0xa2')](_0x377855,function(_0x39dedf){return db['UserVoiceQueueRt'][_0x65f6('0xa3')](_0x39dedf);});}return _0x12730b;});}})[_0x65f6('0x24')](respondWithStatusCode(_0x31870f,null))[_0x65f6('0x1a')](handleError(_0x31870f,null));};exports[_0x65f6('0xa4')]=function(_0x2b89d5,_0x409dd7){var _0x5f068a;return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x2b89d5[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0x30'),'role']})['then'](handleEntityNotFound(_0x409dd7,null))['then'](function(_0x83e627){if(_0x83e627){_0x5f068a=_0x83e627;if(!_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')]||!utils[_0x65f6('0x96')](_0x2b89d5[_0x65f6('0x3a')]['channel'])){throw new db['Sequelize'][(_0x65f6('0x89'))](_0x65f6('0x97'));}return _0x83e627[_0x65f6('0xa6')+_['capitalize'](_0x2b89d5['query'][_0x65f6('0xa5')]['toLowerCase']())+_0x65f6('0xa7')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')]);}})[_0x65f6('0x24')](function(_0x4632d0){if(_[_0x65f6('0xa8')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')])){for(var _0x8f7173=0x0;_0x8f7173<_0x2b89d5['query'][_0x65f6('0x5c')][_0x65f6('0x44')];_0x8f7173+=0x1){var _0x28b9f4={'UserId':Number(_0x2b89d5[_0x65f6('0x4c')]['id'])};_0x28b9f4[_['capitalize'](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')][_0x65f6('0x99')]())+'QueueId']=Number(_0x2b89d5[_0x65f6('0x3a')]['ids'][_0x8f7173]);socket['emit'](_0x65f6('0x79')+_[_0x65f6('0x98')](_0x2b89d5['query'][_0x65f6('0xa5')]['toLowerCase']())+_0x65f6('0xa9'),_0x28b9f4);}}else{var _0x28b9f4={'UserId':Number(_0x2b89d5[_0x65f6('0x4c')]['id'])};_0x28b9f4[_[_0x65f6('0x98')](_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0xa5')][_0x65f6('0x99')]())+_0x65f6('0xaa')]=Number(_0x2b89d5['query'][_0x65f6('0x5c')]);socket[_0x65f6('0xab')](_0x65f6('0x79')+_[_0x65f6('0x98')](_0x2b89d5[_0x65f6('0x3a')]['channel'][_0x65f6('0x99')]())+'Queue:remove',_0x28b9f4);}return _0x4632d0;})[_0x65f6('0x24')](function(){if(_0x2b89d5['query'][_0x65f6('0xa5')]===_0x65f6('0x9d')){return db[_0x65f6('0xac')][_0x65f6('0x25')]({'where':{'UserId':_0x2b89d5[_0x65f6('0x4c')]['id'],'VoiceQueueId':_0x2b89d5[_0x65f6('0x3a')][_0x65f6('0x5c')]},'individualHooks':!![]})[_0x65f6('0x24')](function(){return _0x5f068a;});}return _0x5f068a;})[_0x65f6('0x24')](respondWithStatusCode(_0x409dd7,null))[_0x65f6('0x1a')](handleError(_0x409dd7,null));};exports[_0x65f6('0xad')]=function(_0x2eb04c,_0x3739fd){_0x2eb04c[_0x65f6('0x58')][_0x65f6('0xae')]=_0x2eb04c[_0x65f6('0xaf')][_0x65f6('0xb0')];return db['User'][_0x65f6('0x2f')]({'where':{'id':_0x2eb04c['params']['id']}})[_0x65f6('0x24')](handleEntityNotFound(_0x3739fd,null))[_0x65f6('0x24')](saveUpdates(_0x2eb04c[_0x65f6('0x58')],null))[_0x65f6('0x24')](respondWithResult(_0x3739fd,null))[_0x65f6('0x1a')](handleError(_0x3739fd,null));};exports[_0x65f6('0xb1')]=function(_0x5afc8c,_0xb55829){var _0x1ac0bd=path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb4'));return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x5afc8c[_0x65f6('0x4c')]['id']},'attributes':['id',_0x65f6('0xae')],'raw':!![]})[_0x65f6('0x24')](handleEntityNotFound(_0xb55829,null))[_0x65f6('0x24')](function(_0x4ecd83){if(_0x4ecd83){if(_['isNil'](_0x4ecd83[_0x65f6('0xae')])){return _0xb55829[_0x65f6('0xb5')](_0x1ac0bd);}else{if(!fs[_0x65f6('0xb6')](path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb7'),_0x4ecd83[_0x65f6('0xae')]))){return _0xb55829['download'](_0x1ac0bd);}return _0xb55829[_0x65f6('0xb5')](path[_0x65f6('0xb2')](config[_0x65f6('0xb3')],_0x65f6('0xb7'),_0x4ecd83[_0x65f6('0xae')]));}}})[_0x65f6('0x1a')](handleError(_0xb55829,null));};exports[_0x65f6('0xb8')]=function(_0x47274e,_0x253c2e){return db[_0x65f6('0x3f')][_0x65f6('0x2f')]({'where':{'id':_0x47274e[_0x65f6('0x4c')]['id']},'attributes':['id']})[_0x65f6('0x24')](handleEntityNotFound(_0x253c2e,null))['then'](function(_0x59d9d5){var _0x56e0c0=[];values=_0x59d9d5[_0x65f6('0x47')];_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x45'),_0x59d9d5['dataValues']));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x46'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0['push'](get_open_tabs(_0x65f6('0x55'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0['push'](get_open_tabs(_0x65f6('0x4a'),_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs('fax',_0x59d9d5[_0x65f6('0x47')]));_0x56e0c0[_0x65f6('0x3e')](get_open_tabs(_0x65f6('0x49'),_0x59d9d5[_0x65f6('0x47')]));return BPromise[_0x65f6('0x56')](_0x56e0c0);})[_0x65f6('0x24')](function(_0x2558e8){var _0xa5af18=[];if(_0x2558e8){for(var _0x51474e=0x0;_0x51474e=_0xb14357[_0x6349('0x51')]){throw new Error(_0x6349('0x52'));}})[_0x6349('0xd')](function(){if(_0x48693b){return db[_0x6349('0x3e')][_0x6349('0x4a')]({'where':{'membername':_0x48693b[_0x6349('0x27')]},'individualHooks':!![]});}})[_0x6349('0xd')](function(){if(_0x48693b){return _0x48693b['getVoiceQueues']({'raw':!![]});}})[_0x6349('0xd')](function(_0x16d8dd){if(_0x48693b){if(_0x16d8dd){var _0x563f2c=[];_0x459033=_0x16d8dd;if(_0x459033[_0x6349('0x2d')]){for(var _0x4b98fb=0x0;_0x4b98fb<_0x459033[_0x6349('0x2d')];_0x4b98fb++){_0x563f2c['push'](db['UserVoiceQueueRt'][_0x6349('0x53')]({'membername':_0x48693b[_0x6349('0x27')],'UserId':_0x48693b['id'],'queue_name':_0x459033[_0x4b98fb][_0x6349('0x27')],'VoiceQueueId':_0x459033[_0x4b98fb]['id'],'interface':_0x1ac4db,'paused':_0x48693b[_0x6349('0x4d')]||![],'penalty':_0x459033[_0x4b98fb][_0x6349('0x54')]||0x0}));}return BPromise[_0x6349('0x48')](_0x563f2c);}}}})[_0x6349('0xd')](function(){if(_0x48693b){return db[_0x6349('0x35')][_0x6349('0x19')]({'where':{'membername':_0x48693b[_0x6349('0x27')],'exitAt':null}});}})[_0x6349('0xd')](function(_0x1f9548){if(_0x48693b){if(_0x1f9548&&_0x1f9548['length']){var _0x3d3184=[];_0x1f9548[_0x6349('0x47')](function(_0x4927d8){_0x3d3184[_0x6349('0x30')](_0x4927d8[_0x6349('0x2b')]({'exitAt':moment()['format'](_0x6349('0x2e'))}));});return BPromise[_0x6349('0x48')](_0x3d3184);}}})[_0x6349('0xd')](function(_0x373232){if(_0x48693b){var _0x50d5e3=[];var _0x22ea82=[];var _0x2283b7=utils[_0x6349('0x55')]();var _0x4cb860={'membername':_0x48693b['name'],'interface':_0x1ac4db,'enterAt':moment()[_0x6349('0x31')](_0x6349('0x2e')),'role':_0x48693b[_0x6349('0x28')],'internal':_0x48693b['internal']};_0x2283b7['forEach'](function(_0x308018){_0x50d5e3[_0x6349('0x30')](_[_0x6349('0x56')]({'channel':_0x308018,'type':_0x6349('0x57'),'data1':'callysquare','data2':_0x1ac4db},_0x4cb860));if(_0x48693b[_0x6349('0x4d')]){_0x22ea82['push'](_['merge']({'channel':_0x308018,'type':_0x6349('0x2c'),'data1':_0x6349('0x58')},_0x4cb860));}});return db['MemberReport'][_0x6349('0x36')](_0x50d5e3[_0x6349('0x59')](_0x22ea82),{'individualHooks':!![]});}})['then'](function(){if(_0x48693b){return _0x48693b['update']({'online':!![],'lastLoginAt':moment()['format'](_0x6349('0x2e')),'voicePause':_0x48693b[_0x6349('0x4d')]||![],'mailPause':_0x48693b[_0x6349('0x4d')]||![],'chatPause':_0x48693b[_0x6349('0x4d')]||![],'faxPause':_0x48693b[_0x6349('0x4d')]||![],'smsPause':_0x48693b[_0x6349('0x4d')]||![],'openchannelPause':_0x48693b[_0x6349('0x4d')]||![],'pauseType':_0x48693b[_0x6349('0x4d')]?_0x6349('0x58'):null,'lastPauseAt':moment()[_0x6349('0x31')](_0x6349('0x2e')),'interface':_0x1ac4db});}})[_0x6349('0xd')](function(_0xb1fca){_0x4e7aff(_0xb1fca);})[_0x6349('0x17')](function(_0x4ae0ab){_0x1304ec(_0x149c81[_0x6349('0x12')](0x1f4,_0x4ae0ab[_0x6349('0x15')]));});});}; \ No newline at end of file +var _0xeaaa=['../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','GetUser','User','options','where','attributes','include','model','map','ShowUser','find','raw','catch','name','internal','interface','update','MemberReport','findAll','PAUSE','format','length','updateAttributes','getChannels','forEach','push','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','role','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','sms','openchannel','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','LOGIN','callysquare','loginInPause','merge','LOGININPAUSE','concat','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2612a2,_0x2fc91f){var _0x41310b=function(_0x2d6d65){while(--_0x2d6d65){_0x2612a2['push'](_0x2612a2['shift']());}};_0x41310b(++_0x2fc91f);}(_0xeaaa,0xae));var _0xaeaa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeaaa[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xaeaa('0x0'));var util=require(_0xaeaa('0x1'));var moment=require('moment');var BPromise=require(_0xaeaa('0x2'));var rs=require(_0xaeaa('0x3'));var fs=require('fs');var Redis=require(_0xaeaa('0x4'));var db=require(_0xaeaa('0x5'))['db'];var utils=require(_0xaeaa('0x6'));var logger=require(_0xaeaa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaeaa('0x8'));var client=jayson['client'][_0xaeaa('0x9')]({'port':0x232a});config[_0xaeaa('0xa')]=_[_0xaeaa('0xb')](config[_0xaeaa('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaeaa('0xa')]));require(_0xaeaa('0xc'))[_0xaeaa('0xd')](socket);function respondWithRpcPromise(_0x2deb08,_0x27b87a,_0x28f744){return new BPromise(function(_0x1b7442,_0xa2a92){return client[_0xaeaa('0xe')](_0x2deb08,_0x28f744)[_0xaeaa('0xf')](function(_0x2c7d57){logger[_0xaeaa('0x10')]('User,\x20%s,\x20%s',_0x27b87a,_0xaeaa('0x11'));logger[_0xaeaa('0x12')](_0xaeaa('0x13'),_0x27b87a,_0xaeaa('0x11'),JSON[_0xaeaa('0x14')](_0x2c7d57));if(_0x2c7d57[_0xaeaa('0x15')]){if(_0x2c7d57[_0xaeaa('0x15')][_0xaeaa('0x16')]===0x1f4){logger[_0xaeaa('0x15')](_0xaeaa('0x17'),_0x27b87a,_0x2c7d57[_0xaeaa('0x15')][_0xaeaa('0x18')]);return _0xa2a92(_0x2c7d57[_0xaeaa('0x15')][_0xaeaa('0x18')]);}logger['error'](_0xaeaa('0x17'),_0x27b87a,_0x2c7d57[_0xaeaa('0x15')][_0xaeaa('0x18')]);return _0x1b7442(_0x2c7d57[_0xaeaa('0x15')][_0xaeaa('0x18')]);}else{logger[_0xaeaa('0x10')](_0xaeaa('0x17'),_0x27b87a,_0xaeaa('0x11'));_0x1b7442(_0x2c7d57[_0xaeaa('0x19')]['message']);}})['catch'](function(_0x1b6d45){logger[_0xaeaa('0x15')](_0xaeaa('0x17'),_0x27b87a,_0x1b6d45);_0xa2a92(_0x1b6d45);});});}exports[_0xaeaa('0x1a')]=function(_0x1f6b89){var _0x279edd=this;return new Promise(function(_0x1e2e4e,_0x4e1336){return db[_0xaeaa('0x1b')]['findAll']({'raw':_0x1f6b89[_0xaeaa('0x1c')]?_0x1f6b89[_0xaeaa('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6b89[_0xaeaa('0x1c')]?_0x1f6b89[_0xaeaa('0x1c')][_0xaeaa('0x1d')]||null:null,'attributes':_0x1f6b89[_0xaeaa('0x1c')]?_0x1f6b89[_0xaeaa('0x1c')][_0xaeaa('0x1e')]||null:null,'limit':_0x1f6b89[_0xaeaa('0x1c')]?_0x1f6b89['options']['limit']||null:null,'include':_0x1f6b89[_0xaeaa('0x1c')]?_0x1f6b89[_0xaeaa('0x1c')]['include']?_['map'](_0x1f6b89['options'][_0xaeaa('0x1f')],function(_0x123f1c){return{'model':db[_0x123f1c['model']],'as':_0x123f1c['as'],'attributes':_0x123f1c[_0xaeaa('0x1e')],'include':_0x123f1c[_0xaeaa('0x1f')]?_['map'](_0x123f1c[_0xaeaa('0x1f')],function(_0x404523){return{'model':db[_0x404523[_0xaeaa('0x20')]],'as':_0x404523['as'],'attributes':_0x404523[_0xaeaa('0x1e')],'include':_0x404523[_0xaeaa('0x1f')]?_[_0xaeaa('0x21')](_0x404523[_0xaeaa('0x1f')],function(_0x5984c9){return{'model':db[_0x5984c9[_0xaeaa('0x20')]],'as':_0x5984c9['as'],'attributes':_0x5984c9[_0xaeaa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaeaa('0xf')](function(_0x2765ce){logger[_0xaeaa('0x10')](_0xaeaa('0x1a'),_0x1f6b89);logger[_0xaeaa('0x12')](_0xaeaa('0x1a'),_0x1f6b89,JSON[_0xaeaa('0x14')](_0x2765ce));_0x1e2e4e(_0x2765ce);})['catch'](function(_0x588ceb){logger[_0xaeaa('0x15')]('GetUser',_0x588ceb[_0xaeaa('0x18')],_0x1f6b89);_0x4e1336(_0x279edd[_0xaeaa('0x15')](0x1f4,_0x588ceb[_0xaeaa('0x18')]));});});};exports[_0xaeaa('0x22')]=function(_0x573d0b){var _0xe3ed28=this;return new Promise(function(_0x8a2808,_0x260a2b){return db[_0xaeaa('0x1b')][_0xaeaa('0x23')]({'raw':_0x573d0b[_0xaeaa('0x1c')]?_0x573d0b[_0xaeaa('0x1c')][_0xaeaa('0x24')]===undefined?!![]:![]:!![],'where':_0x573d0b[_0xaeaa('0x1c')]?_0x573d0b[_0xaeaa('0x1c')][_0xaeaa('0x1d')]||null:null,'attributes':_0x573d0b[_0xaeaa('0x1c')]?_0x573d0b[_0xaeaa('0x1c')][_0xaeaa('0x1e')]||null:null,'include':_0x573d0b[_0xaeaa('0x1c')]?_0x573d0b[_0xaeaa('0x1c')][_0xaeaa('0x1f')]?_[_0xaeaa('0x21')](_0x573d0b[_0xaeaa('0x1c')][_0xaeaa('0x1f')],function(_0x931fea){return{'model':db[_0x931fea[_0xaeaa('0x20')]],'as':_0x931fea['as'],'attributes':_0x931fea['attributes'],'include':_0x931fea[_0xaeaa('0x1f')]?_['map'](_0x931fea[_0xaeaa('0x1f')],function(_0x44caed){return{'model':db[_0x44caed['model']],'as':_0x44caed['as'],'attributes':_0x44caed[_0xaeaa('0x1e')],'include':_0x44caed[_0xaeaa('0x1f')]?_[_0xaeaa('0x21')](_0x44caed['include'],function(_0x2a2e82){return{'model':db[_0x2a2e82['model']],'as':_0x2a2e82['as'],'attributes':_0x2a2e82['attributes']};}):[]};}):[]};}):[]:[]})[_0xaeaa('0xf')](function(_0x3d9097){logger[_0xaeaa('0x10')](_0xaeaa('0x22'),_0x573d0b);logger[_0xaeaa('0x12')](_0xaeaa('0x22'),_0x573d0b,JSON[_0xaeaa('0x14')](_0x3d9097));_0x8a2808(_0x3d9097);})[_0xaeaa('0x25')](function(_0x1aba62){logger[_0xaeaa('0x15')](_0xaeaa('0x22'),_0x1aba62[_0xaeaa('0x18')],_0x573d0b);_0x260a2b(_0xe3ed28[_0xaeaa('0x15')](0x1f4,_0x1aba62[_0xaeaa('0x18')]));});});};exports['PauseUser']=function(_0x117c22){var _0x3980d4=this;return new Promise(function(_0x206087,_0x4df69a){var _0x14e593;return db[_0xaeaa('0x1b')][_0xaeaa('0x23')]({'where':_0x117c22[_0xaeaa('0x1c')][_0xaeaa('0x1d')]||{},'attributes':['id',_0xaeaa('0x26'),'role',_0xaeaa('0x27'),_0xaeaa('0x28')]})[_0xaeaa('0xf')](function(_0x26d54b){if(_0x26d54b){_0x14e593=_0x26d54b;return db['UserVoiceQueueRt'][_0xaeaa('0x29')]({'paused':0x1},{'where':{'UserId':_0x14e593['id']},'individualHooks':!![]});}})['then'](function(){if(_0x14e593){return db[_0xaeaa('0x2a')][_0xaeaa('0x2b')]({'where':{'membername':_0x14e593[_0xaeaa('0x26')],'type':_0xaeaa('0x2c'),'exitAt':null}});}})[_0xaeaa('0xf')](function(_0x5eb929){if(_0x14e593){if(_0x5eb929&&_0x5eb929['length']){var _0x107721=moment()[_0xaeaa('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2fa56c=0x0,_0x2ca1dc=_0x5eb929[_0xaeaa('0x2e')];_0x2fa56c<_0x2ca1dc;_0x2fa56c++){_0x5eb929[_0x2fa56c][_0xaeaa('0x2f')]({'exitAt':_0x107721});}}}})[_0xaeaa('0xf')](function(){if(_0x14e593){var _0x2160f3=[];var _0x4eee73=utils[_0xaeaa('0x30')]();_0x4eee73[_0xaeaa('0x31')](function(_0x181580){_0x2160f3[_0xaeaa('0x32')]({'channel':_0x181580,'membername':_0x14e593[_0xaeaa('0x26')],'interface':_['isNil'](_0x14e593[_0xaeaa('0x28')])?util[_0xaeaa('0x2d')](_0xaeaa('0x33'),_0x14e593[_0xaeaa('0x26')]):_0x14e593['interface'],'type':'PAUSE','enterAt':moment()['format'](_0xaeaa('0x34')),'data1':_0x117c22[_0xaeaa('0x35')]['type']||_0xaeaa('0x36'),'role':_0x14e593[_0xaeaa('0x37')],'internal':_0x14e593[_0xaeaa('0x27')],'uniqueid':_0x117c22[_0xaeaa('0x35')]['uniqueid']||null});});return db[_0xaeaa('0x2a')][_0xaeaa('0x38')](_0x2160f3,{'individualHooks':!![]});}})[_0xaeaa('0xf')](function(){if(_0x14e593){return _0x14e593[_0xaeaa('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x117c22[_0xaeaa('0x35')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xaeaa('0x34'))});}})[_0xaeaa('0xf')](function(_0x140e38){_0x206087(_0x140e38);})['catch'](function(_0x3dcdfb){_0x4df69a(_0x3980d4['error'](0x1f4,_0x3dcdfb[_0xaeaa('0x18')]));});});};exports[_0xaeaa('0x39')]=function(_0x28bd9e){var _0x4e752f=this;return new Promise(function(_0xa89951,_0x41aa98){var _0x5dc269;return db['User'][_0xaeaa('0x3a')]({'where':_0x28bd9e['options'][_0xaeaa('0x1d')]||{},'attributes':['id',_0xaeaa('0x26')]})[_0xaeaa('0xf')](function(_0x4fb8a4){if(_0x4fb8a4){_0x5dc269=_0x4fb8a4;if(_0x28bd9e['body'][_0xaeaa('0x3b')]&&!utils[_0xaeaa('0x3c')](_0x28bd9e[_0xaeaa('0x35')][_0xaeaa('0x3b')])){throw new Error(_0xaeaa('0x3d'));}switch(_0x28bd9e['body'][_0xaeaa('0x3b')]){case _0xaeaa('0x3e'):return db[_0xaeaa('0x3f')][_0xaeaa('0x29')]({'paused':0x0},{'where':{'UserId':_0x5dc269['id']}})[_0xaeaa('0xf')](function(){return db[_0xaeaa('0x2a')][_0xaeaa('0x23')]({'where':{'channel':_0x28bd9e[_0xaeaa('0x35')][_0xaeaa('0x3b')],'membername':_0x5dc269[_0xaeaa('0x26')],'type':_0xaeaa('0x2c'),'exitAt':null}});})['then'](function(_0x2f67a7){if(_0x2f67a7){return _0x2f67a7[_0xaeaa('0x29')]({'exitAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34')),'data2':_0xaeaa('0x40')},{'individualHooks':!![]});}return null;})[_0xaeaa('0xf')](function(){return _0x5dc269[_0xaeaa('0x29')]({'voicePause':![]});});case _0xaeaa('0x41'):case'chat':case'fax':case _0xaeaa('0x42'):case _0xaeaa('0x43'):case'whatsapp':return db['MemberReport'][_0xaeaa('0x23')]({'where':{'channel':_0x28bd9e[_0xaeaa('0x35')][_0xaeaa('0x3b')],'membername':_0x5dc269['name'],'type':_0xaeaa('0x2c'),'exitAt':null}})[_0xaeaa('0xf')](function(_0x17571f){return _0x17571f['update']({'exitAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34')),'data2':_0xaeaa('0x40')},{'individualHooks':!![]});})['then'](function(){var _0x5302fd={};_[_0xaeaa('0x44')](_0x5302fd,util['format'](_0xaeaa('0x45'),_0x28bd9e[_0xaeaa('0x35')][_0xaeaa('0x3b')],_0xaeaa('0x46')),![]);return _0x5dc269['update'](_0x5302fd);});default:return db[_0xaeaa('0x3f')]['update']({'paused':0x0},{'where':{'UserId':_0x5dc269['id']}})[_0xaeaa('0xf')](function(){return db[_0xaeaa('0x2a')]['findAll']({'where':{'membername':_0x5dc269[_0xaeaa('0x26')],'type':_0xaeaa('0x2c'),'exitAt':null}});})[_0xaeaa('0xf')](function(_0x327740){var _0x385fed=[];_0x327740[_0xaeaa('0x31')](function(_0x4c7ae4){_0x385fed[_0xaeaa('0x32')](_0x4c7ae4[_0xaeaa('0x29')]({'exitAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34')),'data2':_0xaeaa('0x40')}));});return BPromise[_0xaeaa('0x47')](_0x385fed);})[_0xaeaa('0xf')](function(){return _0x5dc269[_0xaeaa('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x4a0f5a){_0xa89951(_0x4a0f5a);})[_0xaeaa('0x25')](function(_0x2658c5){_0x41aa98(_0x4e752f[_0xaeaa('0x15')](0x1f4,_0x2658c5[_0xaeaa('0x18')]));});});};exports[_0xaeaa('0x48')]=function(_0xf1efe7){var _0x3a70eb=this;return new Promise(function(_0xf2e997,_0x4a45c9){var _0x51fe56;return db[_0xaeaa('0x1b')][_0xaeaa('0x3a')]({'where':_0xf1efe7[_0xaeaa('0x1c')][_0xaeaa('0x1d')]||{},'attributes':['id',_0xaeaa('0x26')]})[_0xaeaa('0xf')](function(_0x29ec65){if(_0x29ec65){_0x51fe56=_0x29ec65;return db['UserVoiceQueueRt'][_0xaeaa('0x49')]({'where':{'membername':_0x51fe56[_0xaeaa('0x26')]},'individualHooks':!![]});}})[_0xaeaa('0xf')](function(){if(_0x51fe56){return db['MemberReport']['findAll']({'where':{'membername':_0x51fe56['name'],'exitAt':null}});}})['then'](function(_0x3ad6fd){if(_0x51fe56){if(_0x3ad6fd&&_0x3ad6fd[_0xaeaa('0x2e')]){var _0x1097b8=[];_0x3ad6fd['forEach'](function(_0x48c219){_0x1097b8[_0xaeaa('0x32')](_0x48c219['update']({'exitAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34'))}));});return BPromise[_0xaeaa('0x47')](_0x1097b8);}}})[_0xaeaa('0xf')](function(){if(_0x51fe56){return _0x51fe56['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x4d5162){_0xf2e997(_0x4d5162);})[_0xaeaa('0x25')](function(_0x166625){_0x4a45c9(_0x3a70eb[_0xaeaa('0x15')](0x1f4,_0x166625[_0xaeaa('0x18')]));});});};exports[_0xaeaa('0x4a')]=function(_0x21988a){var _0x1da7ef=this;return new Promise(function(_0x16f6e4,_0x35987d){var _0x404312;var _0x401677;var _0x2ef6d9;var _0x3a6b78;return db[_0xaeaa('0x1b')][_0xaeaa('0x3a')]({'where':_0x21988a[_0xaeaa('0x1c')][_0xaeaa('0x1d')]||{},'attributes':['id',_0xaeaa('0x26'),'role',_0xaeaa('0x4b'),_0xaeaa('0x4c'),'internal','loginInPause','interface']})['then'](function(_0x29c1eb){if(_0x29c1eb){_0x404312=_0x29c1eb;_0x3a6b78=_0x21988a[_0xaeaa('0x35')][_0xaeaa('0x28')]?_0x21988a[_0xaeaa('0x35')][_0xaeaa('0x28')]:util['format']('SIP/%s',_0x404312[_0xaeaa('0x26')]);return db[_0xaeaa('0x1b')][_0xaeaa('0x4d')]({'where':{'role':_0xaeaa('0x4e'),'online':!![],'id':{'$ne':_0x404312['id']}}});}})[_0xaeaa('0xf')](function(_0x4cf469){if(_0x4cf469){_0x2ef6d9=_0x4cf469;return require(_0xaeaa('0x4f'))[_0xaeaa('0x50')]();}})[_0xaeaa('0xf')](function(_0x676d7e){if(_0x676d7e&&_0x676d7e['agents']&&_0x2ef6d9>=_0x676d7e[_0xaeaa('0x51')]){throw new Error(_0xaeaa('0x52'));}})[_0xaeaa('0xf')](function(){if(_0x404312){return db[_0xaeaa('0x3f')]['destroy']({'where':{'membername':_0x404312[_0xaeaa('0x26')]},'individualHooks':!![]});}})[_0xaeaa('0xf')](function(){if(_0x404312){return _0x404312[_0xaeaa('0x53')]({'raw':!![]});}})['then'](function(_0x22afec){if(_0x404312){if(_0x22afec){var _0x2323dc=[];_0x401677=_0x22afec;if(_0x401677[_0xaeaa('0x2e')]){for(var _0x14296a=0x0;_0x14296a<_0x401677[_0xaeaa('0x2e')];_0x14296a++){_0x2323dc['push'](db[_0xaeaa('0x3f')]['upsert']({'membername':_0x404312[_0xaeaa('0x26')],'UserId':_0x404312['id'],'queue_name':_0x401677[_0x14296a][_0xaeaa('0x26')],'VoiceQueueId':_0x401677[_0x14296a]['id'],'interface':_0x3a6b78,'paused':_0x404312['loginInPause']||![],'penalty':_0x401677[_0x14296a]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x2323dc);}}}})[_0xaeaa('0xf')](function(){if(_0x404312){return db[_0xaeaa('0x2a')]['findAll']({'where':{'membername':_0x404312['name'],'exitAt':null}});}})[_0xaeaa('0xf')](function(_0x3e0c51){if(_0x404312){if(_0x3e0c51&&_0x3e0c51[_0xaeaa('0x2e')]){var _0x48549d=[];_0x3e0c51[_0xaeaa('0x31')](function(_0x16e0de){_0x48549d['push'](_0x16e0de[_0xaeaa('0x29')]({'exitAt':moment()[_0xaeaa('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x48549d);}}})[_0xaeaa('0xf')](function(_0x5e1e14){if(_0x404312){var _0x44367f=[];var _0x3c7545=[];var _0x14a508=utils[_0xaeaa('0x30')]();var _0x2ce806={'membername':_0x404312[_0xaeaa('0x26')],'interface':_0x3a6b78,'enterAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34')),'role':_0x404312[_0xaeaa('0x37')],'internal':_0x404312['internal']};_0x14a508[_0xaeaa('0x31')](function(_0x47c6dc){_0x44367f[_0xaeaa('0x32')](_['merge']({'channel':_0x47c6dc,'type':_0xaeaa('0x54'),'data1':_0xaeaa('0x55'),'data2':_0x3a6b78},_0x2ce806));if(_0x404312[_0xaeaa('0x56')]){_0x3c7545[_0xaeaa('0x32')](_[_0xaeaa('0x57')]({'channel':_0x47c6dc,'type':'PAUSE','data1':_0xaeaa('0x58')},_0x2ce806));}});return db['MemberReport']['bulkCreate'](_0x44367f[_0xaeaa('0x59')](_0x3c7545),{'individualHooks':!![]});}})[_0xaeaa('0xf')](function(){if(_0x404312){return _0x404312[_0xaeaa('0x29')]({'online':!![],'lastLoginAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34')),'voicePause':_0x404312[_0xaeaa('0x56')]||![],'mailPause':_0x404312[_0xaeaa('0x56')]||![],'chatPause':_0x404312[_0xaeaa('0x56')]||![],'faxPause':_0x404312[_0xaeaa('0x56')]||![],'smsPause':_0x404312[_0xaeaa('0x56')]||![],'openchannelPause':_0x404312[_0xaeaa('0x56')]||![],'pauseType':_0x404312[_0xaeaa('0x56')]?_0xaeaa('0x58'):null,'lastPauseAt':moment()[_0xaeaa('0x2d')](_0xaeaa('0x34')),'interface':_0x3a6b78});}})[_0xaeaa('0xf')](function(_0x5e3dcf){_0x16f6e4(_0x5e3dcf);})['catch'](function(_0x564725){_0x35987d(_0x1da7ef[_0xaeaa('0x15')](0x1f4,_0x564725['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b126c06..61abfac 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 _0xffca=['update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x1ef230,_0x34f0c8){var _0x239c06=function(_0x3c9c69){while(--_0x3c9c69){_0x1ef230['push'](_0x1ef230['shift']());}};_0x239c06(++_0x34f0c8);}(_0xffca,0xee));var _0xaffc=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xffca[_0x1d1779];return _0x2377e9;};'use strict';var UserEvents=require(_0xaffc('0x0'));var events=[_0xaffc('0x1'),'remove',_0xaffc('0x2')];function createListener(_0x2a7bc8,_0x2dcc2d){return function(_0x303cdd){_0x2dcc2d[_0xaffc('0x3')](_0x2a7bc8,_0x303cdd);};}function removeListener(_0x45964d,_0x288582){return function(){UserEvents[_0xaffc('0x4')](_0x45964d,_0x288582);};}exports[_0xaffc('0x5')]=function(_0xc34b){for(var _0x171bbe=0x0,_0x1ff058=events[_0xaffc('0x6')];_0x171bbe<_0x1ff058;_0x171bbe++){var _0x3d950a=events[_0x171bbe];var _0x1759d6=createListener(_0xaffc('0x7')+_0x3d950a,_0xc34b);UserEvents['on'](_0x3d950a,_0x1759d6);}}; \ No newline at end of file +var _0xf1b7=['./user.events','update','emit','register','user:'];(function(_0x546a88,_0x48d512){var _0x60ec43=function(_0x39d2e8){while(--_0x39d2e8){_0x546a88['push'](_0x546a88['shift']());}};_0x60ec43(++_0x48d512);}(_0xf1b7,0x12c));var _0x7f1b=function(_0x24a233,_0x5bcca4){_0x24a233=_0x24a233-0x0;var _0x4a577f=_0xf1b7[_0x24a233];return _0x4a577f;};'use strict';var UserEvents=require(_0x7f1b('0x0'));var events=['save','remove',_0x7f1b('0x1')];function createListener(_0x18e5de,_0x173988){return function(_0x681b7d){_0x173988[_0x7f1b('0x2')](_0x18e5de,_0x681b7d);};}function removeListener(_0x32441f,_0x568618){return function(){UserEvents['removeListener'](_0x32441f,_0x568618);};}exports[_0x7f1b('0x3')]=function(_0x483296){for(var _0x5c5873=0x0,_0x52950=events['length'];_0x5c5873<_0x52950;_0x5c5873++){var _0x214025=events[_0x5c5873];var _0x425191=createListener(_0x7f1b('0x4')+_0x214025,_0x483296);UserEvents['on'](_0x214025,_0x425191);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 175800c..d2c0127 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x218bd4,_0x4827c4){var _0x510c95=function(_0x57b4fb){while(--_0x57b4fb){_0x218bd4['push'](_0x218bd4['shift']());}};_0x510c95(++_0x4827c4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xcb91[_0x1f27df];return _0x286ee2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f4d0d,_0x4ac6b3){var _0x1988b3=function(_0x46b3d7){while(--_0x46b3d7){_0x3f4d0d['push'](_0x3f4d0d['shift']());}};_0x1988b3(++_0x4ac6b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f6d975f..91c3d33 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 _0x85e7=['INTEGER','sequelize'];(function(_0x21e615,_0x5de4b1){var _0x2f08f7=function(_0x27f595){while(--_0x27f595){_0x21e615['push'](_0x21e615['shift']());}};_0x2f08f7(++_0x5de4b1);}(_0x85e7,0xad));var _0x785e=function(_0x3a1fef,_0xd04dca){_0x3a1fef=_0x3a1fef-0x0;var _0x20265a=_0x85e7[_0x3a1fef];return _0x20265a;};'use strict';var Sequelize=require(_0x785e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x785e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e88=['sequelize'];(function(_0x2673a0,_0x1bb873){var _0x277121=function(_0x16c47e){while(--_0x16c47e){_0x2673a0['push'](_0x2673a0['shift']());}};_0x277121(++_0x1bb873);}(_0x7e88,0x149));var _0x87e8=function(_0x294350,_0x4b4275){_0x294350=_0x294350-0x0;var _0x4b15b5=_0x7e88[_0x294350];return _0x4b15b5;};'use strict';var Sequelize=require(_0x87e8('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 35fb428..94d6eec 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 _0xb2bf=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x3a68dc,_0x516ece){var _0x90087b=function(_0x50891a){while(--_0x50891a){_0x3a68dc['push'](_0x3a68dc['shift']());}};_0x90087b(++_0x516ece);}(_0xb2bf,0x6a));var _0xfb2b=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb2bf[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xfb2b('0x0'));var util=require(_0xfb2b('0x1'));var logger=require(_0xfb2b('0x2'))(_0xfb2b('0x3'));var moment=require(_0xfb2b('0x4'));var BPromise=require(_0xfb2b('0x5'));var rp=require(_0xfb2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb2b('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb2b('0x8'));module['exports']=function(_0x4167dc,_0x468678){return _0x4167dc[_0xfb2b('0x9')](_0xfb2b('0xa'),attributes,{'tableName':_0xfb2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x905c=['../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','util','api','moment','bluebird','request-promise','path'];(function(_0x21fe98,_0x55db4c){var _0x19dde3=function(_0x3c38ae){while(--_0x3c38ae){_0x21fe98['push'](_0x21fe98['shift']());}};_0x19dde3(++_0x55db4c);}(_0x905c,0x12e));var _0xc905=function(_0x5197f9,_0x792a72){_0x5197f9=_0x5197f9-0x0;var _0x32f8eb=_0x905c[_0x5197f9];return _0x32f8eb;};'use strict';var _=require('lodash');var util=require(_0xc905('0x0'));var logger=require('../../config/logger')(_0xc905('0x1'));var moment=require(_0xc905('0x2'));var BPromise=require(_0xc905('0x3'));var rp=require(_0xc905('0x4'));var fs=require('fs');var path=require(_0xc905('0x5'));var rimraf=require('rimraf');var config=require(_0xc905('0x6'));var attributes=require(_0xc905('0x7'));module['exports']=function(_0x4b9566,_0x555200){return _0x4b9566[_0xc905('0x8')](_0xc905('0x9'),attributes,{'tableName':_0xc905('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 4594d11..0a9673f 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 _0x6518=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x6518,0xd3));var _0x8651=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x6518[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require('lodash');var util=require(_0x8651('0x0'));var moment=require(_0x8651('0x1'));var BPromise=require(_0x8651('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8651('0x3'));var db=require(_0x8651('0x4'))['db'];var utils=require(_0x8651('0x5'));var logger=require(_0x8651('0x6'))(_0x8651('0x7'));var config=require('../../config/environment');var jayson=require(_0x8651('0x8'));var client=jayson[_0x8651('0x9')][_0x8651('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e9a8,_0x2ad776,_0x253c4c){return new BPromise(function(_0x31016a,_0x17a356){return client[_0x8651('0xb')](_0x19e9a8,_0x253c4c)[_0x8651('0xc')](function(_0x25060d){logger[_0x8651('0xd')](_0x8651('0xe'),_0x2ad776,_0x8651('0xf'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2ad776,_0x8651('0xf'),JSON[_0x8651('0x10')](_0x25060d));if(_0x25060d[_0x8651('0x11')]){if(_0x25060d['error'][_0x8651('0x12')]===0x1f4){logger[_0x8651('0x11')](_0x8651('0xe'),_0x2ad776,_0x25060d[_0x8651('0x11')][_0x8651('0x13')]);return _0x17a356(_0x25060d[_0x8651('0x11')]['message']);}logger[_0x8651('0x11')](_0x8651('0xe'),_0x2ad776,_0x25060d[_0x8651('0x11')][_0x8651('0x13')]);return _0x31016a(_0x25060d[_0x8651('0x11')]['message']);}else{logger[_0x8651('0xd')](_0x8651('0xe'),_0x2ad776,'request\x20sent');_0x31016a(_0x25060d['result'][_0x8651('0x13')]);}})[_0x8651('0x14')](function(_0x286fd1){logger[_0x8651('0x11')](_0x8651('0xe'),_0x2ad776,_0x286fd1);_0x17a356(_0x286fd1);});});} \ No newline at end of file +var _0xab62=['UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x574373,_0x741377){var _0x20de7c=function(_0x1108ba){while(--_0x1108ba){_0x574373['push'](_0x574373['shift']());}};_0x20de7c(++_0x741377);}(_0xab62,0xd3));var _0x2ab6=function(_0x4619bd,_0xbc16ff){_0x4619bd=_0x4619bd-0x0;var _0x5e4f8c=_0xab62[_0x4619bd];return _0x5e4f8c;};'use strict';var _=require(_0x2ab6('0x0'));var util=require(_0x2ab6('0x1'));var moment=require(_0x2ab6('0x2'));var BPromise=require(_0x2ab6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ab6('0x4'));var db=require(_0x2ab6('0x5'))['db'];var utils=require(_0x2ab6('0x6'));var logger=require(_0x2ab6('0x7'))(_0x2ab6('0x8'));var config=require('../../config/environment');var jayson=require(_0x2ab6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a6103,_0x72dab4,_0x4684b2){return new BPromise(function(_0x3b1ad1,_0x35d42d){return client[_0x2ab6('0xa')](_0x2a6103,_0x4684b2)[_0x2ab6('0xb')](function(_0x24888e){logger[_0x2ab6('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x72dab4,_0x2ab6('0xd'));logger[_0x2ab6('0xe')](_0x2ab6('0xf'),_0x72dab4,'request\x20sent',JSON[_0x2ab6('0x10')](_0x24888e));if(_0x24888e[_0x2ab6('0x11')]){if(_0x24888e[_0x2ab6('0x11')][_0x2ab6('0x12')]===0x1f4){logger[_0x2ab6('0x11')](_0x2ab6('0x13'),_0x72dab4,_0x24888e['error'][_0x2ab6('0x14')]);return _0x35d42d(_0x24888e[_0x2ab6('0x11')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x72dab4,_0x24888e[_0x2ab6('0x11')][_0x2ab6('0x14')]);return _0x3b1ad1(_0x24888e[_0x2ab6('0x11')][_0x2ab6('0x14')]);}else{logger[_0x2ab6('0xc')](_0x2ab6('0x13'),_0x72dab4,_0x2ab6('0xd'));_0x3b1ad1(_0x24888e[_0x2ab6('0x15')]['message']);}})[_0x2ab6('0x16')](function(_0x4d9ff1){logger[_0x2ab6('0x11')](_0x2ab6('0x13'),_0x72dab4,_0x4d9ff1);_0x35d42d(_0x4d9ff1);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ab2f163..6a625e8 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ccdd9,_0x4f24fe){var _0x69441b=function(_0x140acd){while(--_0x140acd){_0x4ccdd9['push'](_0x4ccdd9['shift']());}};_0x69441b(++_0x4f24fe);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xcb91[_0x25a42a];return _0x1129b1;};'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(_0x1703ee,_0x3cb3b1){var _0x2a91a6=function(_0x29d70f){while(--_0x29d70f){_0x1703ee['push'](_0x1703ee['shift']());}};_0x2a91a6(++_0x3cb3b1);}(_0xe706,0xa3));var _0x6e70=function(_0x1cac87,_0x369e25){_0x1cac87=_0x1cac87-0x0;var _0xf6ed36=_0xe706[_0x1cac87];return _0xf6ed36;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f40fe7c..d7a97fb 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 _0x4662=['exports','INTEGER','STRING','sequelize'];(function(_0x4aee32,_0x20d7a8){var _0x23dd47=function(_0x8042b9){while(--_0x8042b9){_0x4aee32['push'](_0x4aee32['shift']());}};_0x23dd47(++_0x20d7a8);}(_0x4662,0x1e7));var _0x2466=function(_0x1e0c63,_0x17f775){_0x1e0c63=_0x1e0c63-0x0;var _0xe5331e=_0x4662[_0x1e0c63];return _0xe5331e;};'use strict';var Sequelize=require(_0x2466('0x0'));module[_0x2466('0x1')]={'penalty':{'type':Sequelize[_0x2466('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2466('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2466('0x3')]}}; \ No newline at end of file +var _0xd2ab=['STRING','sequelize','exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2ab,0x19d));var _0xbd2a=function(_0x268221,_0x2338fe){_0x268221=_0x268221-0x0;var _0x3e806b=_0xd2ab[_0x268221];return _0x3e806b;};'use strict';var Sequelize=require(_0xbd2a('0x0'));module[_0xbd2a('0x1')]={'penalty':{'type':Sequelize[_0xbd2a('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xbd2a('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index e9c412b..9682cee 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 _0x8c7d=['user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','./userFaxQueue.attributes','exports'];(function(_0x13e766,_0x322ff3){var _0x419c8b=function(_0x326601){while(--_0x326601){_0x13e766['push'](_0x13e766['shift']());}};_0x419c8b(++_0x322ff3);}(_0x8c7d,0x1e9));var _0xd8c7=function(_0x149505,_0x39caa9){_0x149505=_0x149505-0x0;var _0x335ab7=_0x8c7d[_0x149505];return _0x335ab7;};'use strict';var _=require(_0xd8c7('0x0'));var util=require('util');var logger=require(_0xd8c7('0x1'))('api');var moment=require(_0xd8c7('0x2'));var BPromise=require(_0xd8c7('0x3'));var rp=require(_0xd8c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd8c7('0x5'));module[_0xd8c7('0x6')]=function(_0x2cc331,_0x48e375){return _0x2cc331['define']('UserFaxQueue',attributes,{'tableName':_0xd8c7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda06=['request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x170add,_0x206e45){var _0x1249f1=function(_0x3dc950){while(--_0x3dc950){_0x170add['push'](_0x170add['shift']());}};_0x1249f1(++_0x206e45);}(_0xda06,0x1dc));var _0x6da0=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0xda06[_0x506d2f];return _0x101255;};'use strict';var _=require(_0x6da0('0x0'));var util=require(_0x6da0('0x1'));var logger=require(_0x6da0('0x2'))('api');var moment=require(_0x6da0('0x3'));var BPromise=require('bluebird');var rp=require(_0x6da0('0x4'));var fs=require('fs');var path=require(_0x6da0('0x5'));var rimraf=require(_0x6da0('0x6'));var config=require('../../config/environment');var attributes=require(_0x6da0('0x7'));module[_0x6da0('0x8')]=function(_0x18e6c4,_0x24552c){return _0x18e6c4[_0x6da0('0x9')](_0x6da0('0xa'),attributes,{'tableName':_0x6da0('0xb'),'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 0dc4ef8..64d4640 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 _0x5408=['UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2f516a,_0xc079de){var _0x27afb2=function(_0x44b5e5){while(--_0x44b5e5){_0x2f516a['push'](_0x2f516a['shift']());}};_0x27afb2(++_0xc079de);}(_0x5408,0x1a7));var _0x8540=function(_0x3855fd,_0x26003f){_0x3855fd=_0x3855fd-0x0;var _0x226a53=_0x5408[_0x3855fd];return _0x226a53;};'use strict';var _=require(_0x8540('0x0'));var util=require(_0x8540('0x1'));var moment=require(_0x8540('0x2'));var BPromise=require(_0x8540('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8540('0x4'))['db'];var utils=require(_0x8540('0x5'));var logger=require(_0x8540('0x6'))(_0x8540('0x7'));var config=require(_0x8540('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8540('0x9')][_0x8540('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30b447,_0x590947,_0x5c226b){return new BPromise(function(_0x3c5c84,_0x515d70){return client[_0x8540('0xb')](_0x30b447,_0x5c226b)[_0x8540('0xc')](function(_0xaa706e){logger[_0x8540('0xd')](_0x8540('0xe'),_0x590947,'request\x20sent');logger['debug'](_0x8540('0xf'),_0x590947,_0x8540('0x10'),JSON[_0x8540('0x11')](_0xaa706e));if(_0xaa706e[_0x8540('0x12')]){if(_0xaa706e['error'][_0x8540('0x13')]===0x1f4){logger['error'](_0x8540('0xe'),_0x590947,_0xaa706e['error']['message']);return _0x515d70(_0xaa706e[_0x8540('0x12')]['message']);}logger[_0x8540('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x590947,_0xaa706e['error'][_0x8540('0x14')]);return _0x3c5c84(_0xaa706e[_0x8540('0x12')][_0x8540('0x14')]);}else{logger['info'](_0x8540('0xe'),_0x590947,_0x8540('0x10'));_0x3c5c84(_0xaa706e[_0x8540('0x15')][_0x8540('0x14')]);}})[_0x8540('0x16')](function(_0x4b0c16){logger[_0x8540('0x12')](_0x8540('0xe'),_0x590947,_0x4b0c16);_0x515d70(_0x4b0c16);});});} \ No newline at end of file +var _0x4b18=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x1bae58,_0x4415ad){var _0x38f5df=function(_0xf223bb){while(--_0xf223bb){_0x1bae58['push'](_0x1bae58['shift']());}};_0x38f5df(++_0x4415ad);}(_0x4b18,0xc5));var _0x84b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b18[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x84b1('0x0'));var moment=require(_0x84b1('0x1'));var BPromise=require(_0x84b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84b1('0x3'));var db=require(_0x84b1('0x4'))['db'];var utils=require(_0x84b1('0x5'));var logger=require(_0x84b1('0x6'))(_0x84b1('0x7'));var config=require('../../config/environment');var jayson=require(_0x84b1('0x8'));var client=jayson['client'][_0x84b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d5837,_0x497ddc,_0x52eafe){return new BPromise(function(_0x189145,_0x3affab){return client[_0x84b1('0xa')](_0x5d5837,_0x52eafe)[_0x84b1('0xb')](function(_0x139282){logger[_0x84b1('0xc')](_0x84b1('0xd'),_0x497ddc,_0x84b1('0xe'));logger['debug'](_0x84b1('0xf'),_0x497ddc,'request\x20sent',JSON['stringify'](_0x139282));if(_0x139282[_0x84b1('0x10')]){if(_0x139282[_0x84b1('0x10')]['code']===0x1f4){logger[_0x84b1('0x10')](_0x84b1('0xd'),_0x497ddc,_0x139282[_0x84b1('0x10')][_0x84b1('0x11')]);return _0x3affab(_0x139282[_0x84b1('0x10')][_0x84b1('0x11')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x497ddc,_0x139282[_0x84b1('0x10')]['message']);return _0x189145(_0x139282[_0x84b1('0x10')]['message']);}else{logger[_0x84b1('0xc')](_0x84b1('0xd'),_0x497ddc,'request\x20sent');_0x189145(_0x139282['result'][_0x84b1('0x11')]);}})[_0x84b1('0x12')](function(_0x48b38f){logger[_0x84b1('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x497ddc,_0x48b38f);_0x3affab(_0x48b38f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index cceef1d..0411655 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xd14582,_0x2db904){var _0x2c9d0e=function(_0x3d2056){while(--_0x3d2056){_0xd14582['push'](_0xd14582['shift']());}};_0x2c9d0e(++_0x2db904);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d1cd7,_0x19dd0f){_0x4d1cd7=_0x4d1cd7-0x0;var _0x43465f=_0xedd9[_0x4d1cd7];return _0x43465f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2c658a,_0x18d39e){var _0x26806e=function(_0x1943f7){while(--_0x1943f7){_0x2c658a['push'](_0x2c658a['shift']());}};_0x26806e(++_0x18d39e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 70a391b..c0748aa 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 _0x2316=['sequelize','exports','INTEGER'];(function(_0x571bb5,_0x328877){var _0x518c26=function(_0x397d95){while(--_0x397d95){_0x571bb5['push'](_0x571bb5['shift']());}};_0x518c26(++_0x328877);}(_0x2316,0xa8));var _0x6231=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x2316[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x6231('0x0'));module[_0x6231('0x1')]={'penalty':{'type':Sequelize[_0x6231('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd09a=['exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd09a,0x109));var _0xad09=function(_0x5ad92f,_0x1b2cff){_0x5ad92f=_0x5ad92f-0x0;var _0x17115e=_0xd09a[_0x5ad92f];return _0x17115e;};'use strict';var Sequelize=require('sequelize');module[_0xad09('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index bbfeb25..9a9e357 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 _0x7484=['define','UserMailQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x4e053d,_0x5bf868){var _0x5bfad7=function(_0x16057e){while(--_0x16057e){_0x4e053d['push'](_0x4e053d['shift']());}};_0x5bfad7(++_0x5bf868);}(_0x7484,0x77));var _0x4748=function(_0x2853dd,_0x36df3b){_0x2853dd=_0x2853dd-0x0;var _0x420394=_0x7484[_0x2853dd];return _0x420394;};'use strict';var _=require(_0x4748('0x0'));var util=require(_0x4748('0x1'));var logger=require('../../config/logger')(_0x4748('0x2'));var moment=require(_0x4748('0x3'));var BPromise=require(_0x4748('0x4'));var rp=require(_0x4748('0x5'));var fs=require('fs');var path=require(_0x4748('0x6'));var rimraf=require(_0x4748('0x7'));var config=require(_0x4748('0x8'));var attributes=require(_0x4748('0x9'));module[_0x4748('0xa')]=function(_0xe47cd9,_0x319698){return _0xe47cd9[_0x4748('0xb')](_0x4748('0xc'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe70a=['exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0xe70a,0x122));var _0xae70=function(_0x4f4165,_0x464f5c){_0x4f4165=_0x4f4165-0x0;var _0x55dcf1=_0xe70a[_0x4f4165];return _0x55dcf1;};'use strict';var _=require(_0xae70('0x0'));var util=require(_0xae70('0x1'));var logger=require('../../config/logger')(_0xae70('0x2'));var moment=require('moment');var BPromise=require(_0xae70('0x3'));var rp=require(_0xae70('0x4'));var fs=require('fs');var path=require(_0xae70('0x5'));var rimraf=require(_0xae70('0x6'));var config=require(_0xae70('0x7'));var attributes=require(_0xae70('0x8'));module[_0xae70('0x9')]=function(_0x1db7a5,_0x30f3a2){return _0x1db7a5[_0xae70('0xa')](_0xae70('0xb'),attributes,{'tableName':_0xae70('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 1627af3..3693db0 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0xf62e5,_0x257638){var _0x1c3006=function(_0x174c6e){while(--_0x174c6e){_0xf62e5['push'](_0xf62e5['shift']());}};_0x1c3006(++_0x257638);}(_0x3e74,0x175));var _0x43e7=function(_0x365ab0,_0x4cd01c){_0x365ab0=_0x365ab0-0x0;var _0x1d0274=_0x3e74[_0x365ab0];return _0x1d0274;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3ab5a9,_0x314966){var _0x5bd108=function(_0x245568){while(--_0x245568){_0x3ab5a9['push'](_0x3ab5a9['shift']());}};_0x5bd108(++_0x314966);}(_0x34e8,0x12c));var _0x834e=function(_0x3302fe,_0x4d9754){_0x3302fe=_0x3302fe-0x0;var _0x184efd=_0x34e8[_0x3302fe];return _0x184efd;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 9610ae0..cecc17b 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 _0xb709=['post','sendUserNotification','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c3b41,_0x50f776){var _0x41e3fe=function(_0x512069){while(--_0x512069){_0x1c3b41['push'](_0x1c3b41['shift']());}};_0x41e3fe(++_0x50f776);}(_0xb709,0xb3));var _0x9b70=function(_0x1d0770,_0x4711d4){_0x1d0770=_0x1d0770-0x0;var _0x5bc7fa=_0xb709[_0x1d0770];return _0x5bc7fa;};'use strict';var multer=require(_0x9b70('0x0'));var util=require(_0x9b70('0x1'));var path=require(_0x9b70('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b70('0x3'));var router=express['Router']();var fs_extra=require(_0x9b70('0x4'));var auth=require(_0x9b70('0x5'));var interaction=require(_0x9b70('0x6'));var config=require(_0x9b70('0x7'));var controller=require('./userNotification.controller');router[_0x9b70('0x8')]('/',auth['isAuthenticated'](),controller[_0x9b70('0x9')]);module[_0x9b70('0xa')]=router; \ No newline at end of file +var _0xeac7=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xeac7,0x180));var _0x7eac=function(_0x31af3f,_0xa52e75){_0x31af3f=_0x31af3f-0x0;var _0x2e29ec=_0xeac7[_0x31af3f];return _0x2e29ec;};'use strict';var multer=require(_0x7eac('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7eac('0x1'));var express=require(_0x7eac('0x2'));var router=express[_0x7eac('0x3')]();var fs_extra=require(_0x7eac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7eac('0x5'));var config=require(_0x7eac('0x6'));var controller=require(_0x7eac('0x7'));router[_0x7eac('0x8')]('/',auth[_0x7eac('0x9')](),controller['sendUserNotification']);module[_0x7eac('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index e4161b8..f0f7f7e 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 _0xe332=['BOOLEAN','TEXT','STRING'];(function(_0x1154ba,_0x47348e){var _0x4cf72f=function(_0x1fb0a3){while(--_0x1fb0a3){_0x1154ba['push'](_0x1154ba['shift']());}};_0x4cf72f(++_0x47348e);}(_0xe332,0x1f3));var _0x2e33=function(_0x48140f,_0xde8c45){_0x48140f=_0x48140f-0x0;var _0x270bf8=_0xe332[_0x48140f];return _0x270bf8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2e33('0x0')]},'senderName':{'type':Sequelize[_0x2e33('0x1')]},'recipientsId':{'type':Sequelize[_0x2e33('0x0')]},'recipientsDescription':{'type':Sequelize[_0x2e33('0x1')]},'beep':{'type':Sequelize[_0x2e33('0x2')]}}; \ No newline at end of file +var _0xf722=['STRING','BOOLEAN','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf722,0x132));var _0x2f72=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf722[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x2f72('0x0')]={'body':{'type':Sequelize[_0x2f72('0x1')]},'senderName':{'type':Sequelize[_0x2f72('0x2')]},'recipientsId':{'type':Sequelize[_0x2f72('0x1')]},'recipientsDescription':{'type':Sequelize[_0x2f72('0x2')]},'beep':{'type':Sequelize[_0x2f72('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index cc01adf..6d5ff05 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 _0x7031=['body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','User','ids','replace','queue','push','all','union','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','offset','limit','undefined','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','sendUserNotification'];(function(_0x2b50e4,_0x34e191){var _0x23341d=function(_0x6ac722){while(--_0x6ac722){_0x2b50e4['push'](_0x2b50e4['shift']());}};_0x23341d(++_0x34e191);}(_0x7031,0x109));var _0x1703=function(_0x2e09cf,_0x3e042f){_0x2e09cf=_0x2e09cf-0x0;var _0x251a4f=_0x7031[_0x2e09cf];return _0x251a4f;};'use strict';var emlformat=require(_0x1703('0x0'));var rimraf=require(_0x1703('0x1'));var zipdir=require(_0x1703('0x2'));var jsonpatch=require(_0x1703('0x3'));var rp=require('request-promise');var moment=require(_0x1703('0x4'));var BPromise=require(_0x1703('0x5'));var Mustache=require(_0x1703('0x6'));var util=require(_0x1703('0x7'));var path=require(_0x1703('0x8'));var sox=require(_0x1703('0x9'));var csv=require(_0x1703('0xa'));var ejs=require(_0x1703('0xb'));var fs=require('fs');var fs_extra=require(_0x1703('0xc'));var _=require(_0x1703('0xd'));var squel=require(_0x1703('0xe'));var crypto=require(_0x1703('0xf'));var jsforce=require(_0x1703('0x10'));var deskjs=require(_0x1703('0x11'));var toCsv=require(_0x1703('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1703('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1703('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1703('0x14'))(_0x1703('0x15'));var utils=require(_0x1703('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1703('0x17'));var db=require(_0x1703('0x18'))['db'];config[_0x1703('0x19')]=_[_0x1703('0x1a')](config[_0x1703('0x19')],{'host':_0x1703('0x1b'),'port':0x18eb});var socket=require(_0x1703('0x1c'))(new Redis(config[_0x1703('0x19')]));require(_0x1703('0x1d'))[_0x1703('0x1e')](socket);function respondWithStatusCode(_0x240500,_0x59a25e){_0x59a25e=_0x59a25e||0xcc;return function(_0xd14058){if(_0xd14058){return _0x240500[_0x1703('0x1f')](_0x59a25e);}return _0x240500[_0x1703('0x20')](_0x59a25e)['end']();};}function respondWithResult(_0x1ab174,_0x38d086){_0x38d086=_0x38d086||0xc8;return function(_0x417d83){if(_0x417d83){return _0x1ab174[_0x1703('0x20')](_0x38d086)['json'](_0x417d83);}};}function respondWithFilteredResult(_0x5b3667,_0x447a42){return function(_0x317e3b){if(_0x317e3b){var _0xaae875=typeof _0x447a42[_0x1703('0x21')]==='undefined'&&typeof _0x447a42[_0x1703('0x22')]===_0x1703('0x23');var _0x2c3860=_0x317e3b['count'];var _0x5f293f=_0xaae875?0x0:_0x447a42[_0x1703('0x21')];var _0x35f562=_0xaae875?_0x317e3b['count']:_0x447a42[_0x1703('0x21')]+_0x447a42[_0x1703('0x22')];var _0x4230db;if(_0x35f562>=_0x2c3860){_0x35f562=_0x2c3860;_0x4230db=0xc8;}else{_0x4230db=0xce;}_0x5b3667[_0x1703('0x20')](_0x4230db);return _0x5b3667[_0x1703('0x24')](_0x1703('0x25'),_0x5f293f+'-'+_0x35f562+'/'+_0x2c3860)[_0x1703('0x26')](_0x317e3b);}return null;};}function patchUpdates(_0x4b44d9){return function(_0x47d0bd){try{jsonpatch['apply'](_0x47d0bd,_0x4b44d9,!![]);}catch(_0x3d633a){return BPromise[_0x1703('0x27')](_0x3d633a);}return _0x47d0bd[_0x1703('0x28')]();};}function saveUpdates(_0x37f192,_0x1f1594){return function(_0x2e48b4){if(_0x2e48b4){return _0x2e48b4[_0x1703('0x29')](_0x37f192)['then'](function(_0x30e041){return _0x30e041;});}return null;};}function removeEntity(_0x1bc574,_0x5e2006){return function(_0x498c65){if(_0x498c65){return _0x498c65[_0x1703('0x2a')]()[_0x1703('0x2b')](function(){_0x1bc574[_0x1703('0x20')](0xcc)[_0x1703('0x2c')]();});}};}function handleEntityNotFound(_0x215b1d,_0x45c6b3){return function(_0x395b5b){if(!_0x395b5b){_0x215b1d['sendStatus'](0x194);}return _0x395b5b;};}function handleError(_0x38128d,_0xb3d0ed){_0xb3d0ed=_0xb3d0ed||0x1f4;return function(_0x2c9676){logger[_0x1703('0x2d')](_0x2c9676[_0x1703('0x2e')]);if(_0x2c9676[_0x1703('0x2f')]){delete _0x2c9676[_0x1703('0x2f')];}_0x38128d['status'](_0xb3d0ed)[_0x1703('0x30')](_0x2c9676);};}exports[_0x1703('0x31')]=function(_0x5e75a3,_0x50e806,_0x478da9){if(!_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')]('text')&&!_0x5e75a3[_0x1703('0x32')]['hasOwnProperty']('TemplateId')){throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x36'));}else{if(_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')]('TemplateId')&&!_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')](_0x1703('0x37'))){throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x38'));}if(!_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')](_0x1703('0x39'))){throw new db['Sequelize']['ValidationError'](_0x1703('0x3a'));}else{try{var _0x13e087=JSON[_0x1703('0x3b')](_0x5e75a3[_0x1703('0x32')][_0x1703('0x39')]);}catch(_0x28989f){logger['error'](_0x28989f);throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x3c'));}var _0x283038=['chatqueue',_0x1703('0x3d'),_0x1703('0x3e'),_0x1703('0x3f'),_0x1703('0x40'),_0x1703('0x41'),_0x1703('0x42'),'team',_0x1703('0x43')];if(_[_0x1703('0x44')](_0x13e087,function(_0x42c120){return!_[_0x1703('0x45')](_0x283038,_0x42c120[_0x1703('0x46')][_0x1703('0x47')]());})){throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x48'));}}}var _0x4247d2={};_0x4247d2[_0x1703('0x49')]=_0x5e75a3[_0x1703('0x32')][_0x1703('0x33')]('senderName')?_0x5e75a3['body'][_0x1703('0x49')]:_0x5e75a3[_0x1703('0x43')]['fullname'];_0x4247d2[_0x1703('0x4a')]=_[_0x1703('0x4b')](_0x5e75a3[_0x1703('0x32')][_0x1703('0x4a')])?null:_0x5e75a3[_0x1703('0x32')][_0x1703('0x4a')];_0x4247d2[_0x1703('0x4c')]=_0x5e75a3['body'][_0x1703('0x4c')]||![];_0x4247d2['SenderId']=_0x5e75a3[_0x1703('0x43')]['id'];return getContent(_0x5e75a3['body'])[_0x1703('0x2b')](function(_0x3edad7){_0x4247d2[_0x1703('0x32')]=_0x3edad7;return getRecipients(_0x13e087);})[_0x1703('0x2b')](function(_0xebf523){_0x4247d2[_0x1703('0x4d')]=_[_0x1703('0x4e')](_0xebf523)[_0x1703('0x4f')](',');return db['sequelize'][_0x1703('0x50')](function(_0x2169ff){return db[_0x1703('0x51')][_0x1703('0x52')](_0x4247d2,{'raw':!![],'transaction':_0x2169ff})[_0x1703('0x2b')](function(_0x4b2f38){var _0x15524e={'sender':_0x4247d2[_0x1703('0x49')],'description':_0x4247d2['recipientsDescription'],'content':_0x4247d2[_0x1703('0x32')],'beep':_0x4247d2[_0x1703('0x4c')]};_0xebf523[_0x1703('0x53')](function(_0x4cc081){_0x15524e[_0x1703('0x54')]=_0x4cc081;socket[_0x1703('0x55')](_0x1703('0x56'),_0x15524e);});return _0x4b2f38;});});})['then'](respondWithResult(_0x50e806,0xc9))[_0x1703('0x57')](handleError(_0x50e806,null));};function getContent(_0x28a0dc){return new BPromise(function(_0x4875a2,_0x2f908c){if(_0x28a0dc[_0x1703('0x58')]){_0x4875a2(_0x28a0dc['text']);return;}return db[_0x1703('0x59')]['findOne']({'attributes':['html'],'where':{'id':_0x28a0dc[_0x1703('0x5a')]},'raw':!![]})[_0x1703('0x2b')](function(_0x548ab5){if(!_0x548ab5)throw new db[(_0x1703('0x34'))][(_0x1703('0x35'))](_0x1703('0x5b'));var _0x38b115=Mustache[_0x1703('0x5c')](_0x548ab5[_0x1703('0x5d')],_0x28a0dc[_0x1703('0x37')]);_0x4875a2(_0x38b115);})['catch'](function(_0x449e8d){_0x2f908c(_0x449e8d);});});}function getRecipients(_0x385033){return new BPromise(function(_0x3db1c2,_0x53777c){var _0x51b1cf=[];var _0x5c1683=[];_0x385033['forEach'](function(_0x527b48){var _0x39f1db=_['startCase'](_0x527b48[_0x1703('0x46')]['toLowerCase']());if(_0x39f1db===_0x1703('0x5e')){_0x51b1cf=_['union'](_0x51b1cf,_0x527b48[_0x1703('0x5f')]);}else{if(_[_0x1703('0x45')](_0x39f1db,'queue'))_0x39f1db=_0x39f1db[_0x1703('0x60')](_0x1703('0x61'),'Queue');_0x527b48[_0x1703('0x5f')]['forEach'](function(_0x5c475c){_0x5c1683[_0x1703('0x62')](getAgents(_0x39f1db,_0x5c475c));});}});return BPromise[_0x1703('0x63')](_0x5c1683)[_0x1703('0x2b')](function(_0x585eca){_0x51b1cf=_[_0x1703('0x64')](_0x51b1cf,_[_0x1703('0x65')](_0x585eca));_0x3db1c2(_0x51b1cf);})['catch'](function(_0x11c0e2){_0x53777c(_0x11c0e2);});});}function getAgents(_0x2d3526,_0x303513){return new BPromise(function(_0x55c28e,_0x4127c8){return db[_0x2d3526][_0x1703('0x66')]({'where':{'id':_0x303513}})[_0x1703('0x2b')](function(_0x220f68){return _0x220f68[_0x1703('0x67')]({'attributes':['id'],'raw':!![]})['then'](function(_0x107078){var _0x178a7e=_[_0x1703('0x68')](_0x107078,'id');_0x55c28e(_0x178a7e);});})['catch'](function(_0x4e16ea){_0x4127c8(_0x4e16ea);});});} \ No newline at end of file +var _0x98ec=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','recipient','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','model','User','union','ids','queue','Queue','flatten','findOne','getAgents','map','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x98ec,0x1d9));var _0xc98e=function(_0x2063bc,_0x1aa93b){_0x2063bc=_0x2063bc-0x0;var _0x2b352b=_0x98ec[_0x2063bc];return _0x2b352b;};'use strict';var emlformat=require(_0xc98e('0x0'));var rimraf=require(_0xc98e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc98e('0x2'));var rp=require('request-promise');var moment=require(_0xc98e('0x3'));var BPromise=require(_0xc98e('0x4'));var Mustache=require(_0xc98e('0x5'));var util=require(_0xc98e('0x6'));var path=require(_0xc98e('0x7'));var sox=require(_0xc98e('0x8'));var csv=require(_0xc98e('0x9'));var ejs=require(_0xc98e('0xa'));var fs=require('fs');var fs_extra=require(_0xc98e('0xb'));var _=require(_0xc98e('0xc'));var squel=require('squel');var crypto=require(_0xc98e('0xd'));var jsforce=require(_0xc98e('0xe'));var deskjs=require(_0xc98e('0xf'));var toCsv=require(_0xc98e('0x9'));var querystring=require(_0xc98e('0x10'));var Papa=require(_0xc98e('0x11'));var Redis=require('ioredis');var authService=require(_0xc98e('0x12'));var qs=require(_0xc98e('0x13'));var as=require(_0xc98e('0x14'));var hardwareService=require(_0xc98e('0x15'));var logger=require(_0xc98e('0x16'))('api');var utils=require(_0xc98e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc98e('0x18'));var db=require(_0xc98e('0x19'))['db'];config[_0xc98e('0x1a')]=_[_0xc98e('0x1b')](config['redis'],{'host':_0xc98e('0x1c'),'port':0x18eb});var socket=require(_0xc98e('0x1d'))(new Redis(config[_0xc98e('0x1a')]));require('./userNotification.socket')[_0xc98e('0x1e')](socket);function respondWithStatusCode(_0x125173,_0x47acda){_0x47acda=_0x47acda||0xcc;return function(_0x333148){if(_0x333148){return _0x125173['sendStatus'](_0x47acda);}return _0x125173[_0xc98e('0x1f')](_0x47acda)[_0xc98e('0x20')]();};}function respondWithResult(_0x15b432,_0x4e0919){_0x4e0919=_0x4e0919||0xc8;return function(_0x4715c1){if(_0x4715c1){return _0x15b432['status'](_0x4e0919)['json'](_0x4715c1);}};}function respondWithFilteredResult(_0x3b93d0,_0x5f5a15){return function(_0x2d0122){if(_0x2d0122){var _0x1a8a76=typeof _0x5f5a15['offset']===_0xc98e('0x21')&&typeof _0x5f5a15['limit']===_0xc98e('0x21');var _0x59d55a=_0x2d0122[_0xc98e('0x22')];var _0x56a83d=_0x1a8a76?0x0:_0x5f5a15[_0xc98e('0x23')];var _0x2b629d=_0x1a8a76?_0x2d0122[_0xc98e('0x22')]:_0x5f5a15['offset']+_0x5f5a15['limit'];var _0x3bce97;if(_0x2b629d>=_0x59d55a){_0x2b629d=_0x59d55a;_0x3bce97=0xc8;}else{_0x3bce97=0xce;}_0x3b93d0[_0xc98e('0x1f')](_0x3bce97);return _0x3b93d0[_0xc98e('0x24')](_0xc98e('0x25'),_0x56a83d+'-'+_0x2b629d+'/'+_0x59d55a)[_0xc98e('0x26')](_0x2d0122);}return null;};}function patchUpdates(_0x4d8682){return function(_0x25391c){try{jsonpatch[_0xc98e('0x27')](_0x25391c,_0x4d8682,!![]);}catch(_0x5b133b){return BPromise[_0xc98e('0x28')](_0x5b133b);}return _0x25391c[_0xc98e('0x29')]();};}function saveUpdates(_0x2ae728,_0xb255b7){return function(_0x245eda){if(_0x245eda){return _0x245eda[_0xc98e('0x2a')](_0x2ae728)['then'](function(_0x34e074){return _0x34e074;});}return null;};}function removeEntity(_0x3ed56e,_0x461e5f){return function(_0x57a3df){if(_0x57a3df){return _0x57a3df[_0xc98e('0x2b')]()[_0xc98e('0x2c')](function(){_0x3ed56e[_0xc98e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x206cb2,_0x1eb55f){return function(_0x533878){if(!_0x533878){_0x206cb2[_0xc98e('0x2d')](0x194);}return _0x533878;};}function handleError(_0x198714,_0x4d41b8){_0x4d41b8=_0x4d41b8||0x1f4;return function(_0x117b8a){logger[_0xc98e('0x2e')](_0x117b8a[_0xc98e('0x2f')]);if(_0x117b8a['name']){delete _0x117b8a['name'];}_0x198714[_0xc98e('0x1f')](_0x4d41b8)[_0xc98e('0x30')](_0x117b8a);};}exports['sendUserNotification']=function(_0x3d9316,_0x1c638d,_0x1a5c7a){if(!_0x3d9316[_0xc98e('0x31')][_0xc98e('0x32')](_0xc98e('0x33'))&&!_0x3d9316[_0xc98e('0x31')][_0xc98e('0x32')](_0xc98e('0x34'))){throw new db[(_0xc98e('0x35'))][(_0xc98e('0x36'))](_0xc98e('0x37'));}else{if(_0x3d9316[_0xc98e('0x31')][_0xc98e('0x32')](_0xc98e('0x34'))&&!_0x3d9316[_0xc98e('0x31')][_0xc98e('0x32')](_0xc98e('0x38'))){throw new db[(_0xc98e('0x35'))][(_0xc98e('0x36'))](_0xc98e('0x39'));}if(!_0x3d9316['body']['hasOwnProperty'](_0xc98e('0x3a'))){throw new db[(_0xc98e('0x35'))][(_0xc98e('0x36'))](_0xc98e('0x3b'));}else{try{var _0x45c46b=JSON['parse'](_0x3d9316['body'][_0xc98e('0x3a')]);}catch(_0xf6679){logger[_0xc98e('0x2e')](_0xf6679);throw new db[(_0xc98e('0x35'))]['ValidationError'](_0xc98e('0x3c'));}var _0x2fcce4=[_0xc98e('0x3d'),_0xc98e('0x3e'),_0xc98e('0x3f'),_0xc98e('0x40'),_0xc98e('0x41'),'voicequeue','whatsappqueue',_0xc98e('0x42'),'user'];if(_[_0xc98e('0x43')](_0x45c46b,function(_0x4f2f58){return!_[_0xc98e('0x44')](_0x2fcce4,_0x4f2f58['model'][_0xc98e('0x45')]());})){throw new db[(_0xc98e('0x35'))][(_0xc98e('0x36'))](_0xc98e('0x46'));}}}var _0xc399a0={};_0xc399a0[_0xc98e('0x47')]=_0x3d9316[_0xc98e('0x31')][_0xc98e('0x32')](_0xc98e('0x47'))?_0x3d9316[_0xc98e('0x31')][_0xc98e('0x47')]:_0x3d9316[_0xc98e('0x48')][_0xc98e('0x49')];_0xc399a0[_0xc98e('0x4a')]=_['isEmpty'](_0x3d9316[_0xc98e('0x31')][_0xc98e('0x4a')])?null:_0x3d9316[_0xc98e('0x31')][_0xc98e('0x4a')];_0xc399a0[_0xc98e('0x4b')]=_0x3d9316[_0xc98e('0x31')][_0xc98e('0x4b')]||![];_0xc399a0[_0xc98e('0x4c')]=_0x3d9316[_0xc98e('0x48')]['id'];return getContent(_0x3d9316['body'])[_0xc98e('0x2c')](function(_0x218d5d){_0xc399a0[_0xc98e('0x31')]=_0x218d5d;return getRecipients(_0x45c46b);})[_0xc98e('0x2c')](function(_0x44032c){_0xc399a0[_0xc98e('0x4d')]=_[_0xc98e('0x4e')](_0x44032c)[_0xc98e('0x4f')](',');return db[_0xc98e('0x50')][_0xc98e('0x51')](function(_0x3bfc50){return db['UserNotification'][_0xc98e('0x52')](_0xc399a0,{'raw':!![],'transaction':_0x3bfc50})[_0xc98e('0x2c')](function(_0x56219e){var _0x4c9d10={'sender':_0xc399a0[_0xc98e('0x47')],'description':_0xc399a0[_0xc98e('0x4a')],'content':_0xc399a0[_0xc98e('0x31')],'beep':_0xc399a0[_0xc98e('0x4b')]};_0x44032c[_0xc98e('0x53')](function(_0x2cd436){_0x4c9d10[_0xc98e('0x54')]=_0x2cd436;socket['emit'](_0xc98e('0x55'),_0x4c9d10);});return _0x56219e;});});})[_0xc98e('0x2c')](respondWithResult(_0x1c638d,0xc9))[_0xc98e('0x56')](handleError(_0x1c638d,null));};function getContent(_0x2b00c7){return new BPromise(function(_0x3537b7,_0xd06adb){if(_0x2b00c7[_0xc98e('0x33')]){_0x3537b7(_0x2b00c7['text']);return;}return db['Template']['findOne']({'attributes':[_0xc98e('0x57')],'where':{'id':_0x2b00c7[_0xc98e('0x34')]},'raw':!![]})[_0xc98e('0x2c')](function(_0x37be5f){if(!_0x37be5f)throw new db[(_0xc98e('0x35'))][(_0xc98e('0x36'))](_0xc98e('0x58'));var _0x572051=Mustache['render'](_0x37be5f[_0xc98e('0x57')],_0x2b00c7[_0xc98e('0x38')]);_0x3537b7(_0x572051);})[_0xc98e('0x56')](function(_0x52196c){_0xd06adb(_0x52196c);});});}function getRecipients(_0x35bdda){return new BPromise(function(_0x264932,_0x1dabf2){var _0x2d154e=[];var _0x16793f=[];_0x35bdda[_0xc98e('0x53')](function(_0x1d89ba){var _0x329209=_['startCase'](_0x1d89ba[_0xc98e('0x59')]['toLowerCase']());if(_0x329209===_0xc98e('0x5a')){_0x2d154e=_[_0xc98e('0x5b')](_0x2d154e,_0x1d89ba[_0xc98e('0x5c')]);}else{if(_[_0xc98e('0x44')](_0x329209,'queue'))_0x329209=_0x329209['replace'](_0xc98e('0x5d'),_0xc98e('0x5e'));_0x1d89ba['ids'][_0xc98e('0x53')](function(_0x263092){_0x16793f['push'](getAgents(_0x329209,_0x263092));});}});return BPromise['all'](_0x16793f)[_0xc98e('0x2c')](function(_0x1727b2){_0x2d154e=_[_0xc98e('0x5b')](_0x2d154e,_[_0xc98e('0x5f')](_0x1727b2));_0x264932(_0x2d154e);})['catch'](function(_0x21e9ce){_0x1dabf2(_0x21e9ce);});});}function getAgents(_0x4588d9,_0x245911){return new BPromise(function(_0x236b2c,_0x339ff4){return db[_0x4588d9][_0xc98e('0x60')]({'where':{'id':_0x245911}})[_0xc98e('0x2c')](function(_0x409417){return _0x409417[_0xc98e('0x61')]({'attributes':['id'],'raw':!![]})[_0xc98e('0x2c')](function(_0x3c9f12){var _0x183ca4=_[_0xc98e('0x62')](_0x3c9f12,'id');_0x236b2c(_0x183ca4);});})['catch'](function(_0x89f193){_0x339ff4(_0x89f193);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 844b654..6155e78 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 _0xb67d=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4b61e0,_0x1a57e4){var _0x4ccf87=function(_0x19574f){while(--_0x19574f){_0x4b61e0['push'](_0x4b61e0['shift']());}};_0x4ccf87(++_0x1a57e4);}(_0xb67d,0x75));var _0xdb67=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb67d[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xdb67('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb67('0x1')](0x0);var events={'afterCreate':_0xdb67('0x2'),'afterUpdate':_0xdb67('0x3'),'afterDestroy':_0xdb67('0x4')};function emitEvent(_0x47690e){return function(_0x414f8d,_0x233b30,_0x239691){UserNotificationEvents['emit'](_0x47690e+':'+_0x414f8d['id'],_0x414f8d);UserNotificationEvents[_0xdb67('0x5')](_0x47690e,_0x414f8d);_0x239691(null);};}for(var e in events){if(events[_0xdb67('0x6')](e)){var event=events[e];UserNotification[_0xdb67('0x7')](e,emitEvent(event));}}module[_0xdb67('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x714d=['setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification'];(function(_0x8d71ad,_0x3b6b41){var _0xa17bfe=function(_0x3b7bbf){while(--_0x3b7bbf){_0x8d71ad['push'](_0x8d71ad['shift']());}};_0xa17bfe(++_0x3b6b41);}(_0x714d,0x145));var _0xd714=function(_0x5932fa,_0x5ce238){_0x5932fa=_0x5932fa-0x0;var _0xa97e3c=_0x714d[_0x5932fa];return _0xa97e3c;};'use strict';var EventEmitter=require(_0xd714('0x0'));var UserNotification=require(_0xd714('0x1'))['db'][_0xd714('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xd714('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x42e2a8){return function(_0x49705c,_0x271cdc,_0x44ebdd){UserNotificationEvents[_0xd714('0x4')](_0x42e2a8+':'+_0x49705c['id'],_0x49705c);UserNotificationEvents[_0xd714('0x4')](_0x42e2a8,_0x49705c);_0x44ebdd(null);};}for(var e in events){if(events[_0xd714('0x5')](e)){var event=events[e];UserNotification[_0xd714('0x6')](e,emitEvent(event));}}module[_0xd714('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 9c9adca..7ec35c3 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 _0x3e53=['moment','bluebird','request-promise','../../config/environment','./userNotification.attributes','define','UserNotification','lodash','../../config/logger'];(function(_0x286885,_0x20dfbb){var _0x5bbb9b=function(_0x10b015){while(--_0x10b015){_0x286885['push'](_0x286885['shift']());}};_0x5bbb9b(++_0x20dfbb);}(_0x3e53,0xe8));var _0x33e5=function(_0x50d092,_0x338024){_0x50d092=_0x50d092-0x0;var _0x4a08ec=_0x3e53[_0x50d092];return _0x4a08ec;};'use strict';var _=require(_0x33e5('0x0'));var util=require('util');var logger=require(_0x33e5('0x1'))('api');var moment=require(_0x33e5('0x2'));var BPromise=require(_0x33e5('0x3'));var rp=require(_0x33e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x33e5('0x5'));var attributes=require(_0x33e5('0x6'));module['exports']=function(_0x4d0a53,_0x5caa74){return _0x4d0a53[_0x33e5('0x7')](_0x33e5('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1222=['path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise'];(function(_0x529851,_0x576458){var _0x143770=function(_0x48fa62){while(--_0x48fa62){_0x529851['push'](_0x529851['shift']());}};_0x143770(++_0x576458);}(_0x1222,0x1c9));var _0x2122=function(_0x2418fb,_0x37dcdd){_0x2418fb=_0x2418fb-0x0;var _0x2c11f0=_0x1222[_0x2418fb];return _0x2c11f0;};'use strict';var _=require(_0x2122('0x0'));var util=require('util');var logger=require(_0x2122('0x1'))(_0x2122('0x2'));var moment=require(_0x2122('0x3'));var BPromise=require('bluebird');var rp=require(_0x2122('0x4'));var fs=require('fs');var path=require(_0x2122('0x5'));var rimraf=require(_0x2122('0x6'));var config=require(_0x2122('0x7'));var attributes=require(_0x2122('0x8'));module['exports']=function(_0x57b0ad,_0xda354f){return _0x57b0ad[_0x2122('0x9')](_0x2122('0xa'),attributes,{'tableName':_0x2122('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2122('0xc'),'collate':_0x2122('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 5921e23..bb7788a 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 _0xc366=['UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./userNotification.socket','register'];(function(_0x24691b,_0x112c4c){var _0x1dd903=function(_0x3b01a4){while(--_0x3b01a4){_0x24691b['push'](_0x24691b['shift']());}};_0x1dd903(++_0x112c4c);}(_0xc366,0x158));var _0x6c36=function(_0x2a9b95,_0x42b084){_0x2a9b95=_0x2a9b95-0x0;var _0x168ef2=_0xc366[_0x2a9b95];return _0x168ef2;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require('moment');var BPromise=require(_0x6c36('0x2'));var rs=require(_0x6c36('0x3'));var fs=require('fs');var Redis=require(_0x6c36('0x4'));var db=require(_0x6c36('0x5'))['db'];var utils=require(_0x6c36('0x6'));var logger=require('../../config/logger')(_0x6c36('0x7'));var config=require(_0x6c36('0x8'));var jayson=require(_0x6c36('0x9'));var client=jayson['client'][_0x6c36('0xa')]({'port':0x232a});config['redis']=_[_0x6c36('0xb')](config[_0x6c36('0xc')],{'host':_0x6c36('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c36('0xc')]));require(_0x6c36('0xe'))[_0x6c36('0xf')](socket);function respondWithRpcPromise(_0x43dd4c,_0x58a7a6,_0x596ffc){return new BPromise(function(_0x4751db,_0x329e12){return client['request'](_0x43dd4c,_0x596ffc)['then'](function(_0x13e8e6){logger['info'](_0x6c36('0x10'),_0x58a7a6,_0x6c36('0x11'));logger[_0x6c36('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x58a7a6,'request\x20sent',JSON['stringify'](_0x13e8e6));if(_0x13e8e6[_0x6c36('0x13')]){if(_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x14')]===0x1f4){logger[_0x6c36('0x13')](_0x6c36('0x10'),_0x58a7a6,_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);return _0x329e12(_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);}logger['error'](_0x6c36('0x10'),_0x58a7a6,_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);return _0x4751db(_0x13e8e6[_0x6c36('0x13')][_0x6c36('0x15')]);}else{logger[_0x6c36('0x16')]('UserNotification,\x20%s,\x20%s',_0x58a7a6,_0x6c36('0x11'));_0x4751db(_0x13e8e6['result'][_0x6c36('0x15')]);}})[_0x6c36('0x17')](function(_0x363d32){logger[_0x6c36('0x13')](_0x6c36('0x10'),_0x58a7a6,_0x363d32);_0x329e12(_0x363d32);});});} \ No newline at end of file +var _0x5f78=['register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x5f78,0x180));var _0x85f7=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x5f78[_0x1fd675];return _0x16b554;};'use strict';var _=require(_0x85f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x85f7('0x1'));var rs=require(_0x85f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x85f7('0x3'))(_0x85f7('0x4'));var config=require(_0x85f7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x85f7('0x6')]['http']({'port':0x232a});config['redis']=_[_0x85f7('0x7')](config[_0x85f7('0x8')],{'host':_0x85f7('0x9'),'port':0x18eb});var socket=require(_0x85f7('0xa'))(new Redis(config[_0x85f7('0x8')]));require(_0x85f7('0xb'))[_0x85f7('0xc')](socket);function respondWithRpcPromise(_0x500d19,_0x4dcd2a,_0x398437){return new BPromise(function(_0x2a4817,_0x2b31aa){return client[_0x85f7('0xd')](_0x500d19,_0x398437)['then'](function(_0x8b6d29){logger[_0x85f7('0xe')](_0x85f7('0xf'),_0x4dcd2a,_0x85f7('0x10'));logger[_0x85f7('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x4dcd2a,_0x85f7('0x10'),JSON['stringify'](_0x8b6d29));if(_0x8b6d29['error']){if(_0x8b6d29[_0x85f7('0x12')][_0x85f7('0x13')]===0x1f4){logger[_0x85f7('0x12')]('UserNotification,\x20%s,\x20%s',_0x4dcd2a,_0x8b6d29[_0x85f7('0x12')][_0x85f7('0x14')]);return _0x2b31aa(_0x8b6d29[_0x85f7('0x12')][_0x85f7('0x14')]);}logger[_0x85f7('0x12')]('UserNotification,\x20%s,\x20%s',_0x4dcd2a,_0x8b6d29[_0x85f7('0x12')][_0x85f7('0x14')]);return _0x2a4817(_0x8b6d29[_0x85f7('0x12')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x4dcd2a,'request\x20sent');_0x2a4817(_0x8b6d29['result']['message']);}})[_0x85f7('0x15')](function(_0x44bffc){logger['error'](_0x85f7('0xf'),_0x4dcd2a,_0x44bffc);_0x2b31aa(_0x44bffc);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 986b175..60a951a 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 _0x690e=['length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x5c9113,_0x217c53){var _0x5e2921=function(_0x10bb73){while(--_0x10bb73){_0x5c9113['push'](_0x5c9113['shift']());}};_0x5e2921(++_0x217c53);}(_0x690e,0x1c4));var _0xe690=function(_0x69c3cf,_0x174e0c){_0x69c3cf=_0x69c3cf-0x0;var _0x10d535=_0x690e[_0x69c3cf];return _0x10d535;};'use strict';var UserNotificationEvents=require(_0xe690('0x0'));var events=[_0xe690('0x1'),_0xe690('0x2'),_0xe690('0x3')];function createListener(_0xf0bd9e,_0x5656d9){return function(_0x4e889c){_0x5656d9[_0xe690('0x4')](_0xf0bd9e,_0x4e889c);};}function removeListener(_0x4f044f,_0x195c7c){return function(){UserNotificationEvents[_0xe690('0x5')](_0x4f044f,_0x195c7c);};}exports[_0xe690('0x6')]=function(_0x11cd6a){for(var _0x2ced51=0x0,_0xa6a45a=events[_0xe690('0x7')];_0x2ced51<_0xa6a45a;_0x2ced51++){var _0x5d76b3=events[_0x2ced51];var _0x554fe6=createListener(_0xe690('0x8')+_0x5d76b3,_0x11cd6a);UserNotificationEvents['on'](_0x5d76b3,_0x554fe6);}}; \ No newline at end of file +var _0xa1a2=['length','userNotification:','save','remove','update','register'];(function(_0x511d23,_0x3a88d9){var _0x285fef=function(_0x2878bb){while(--_0x2878bb){_0x511d23['push'](_0x511d23['shift']());}};_0x285fef(++_0x3a88d9);}(_0xa1a2,0x1b2));var _0x2a1a=function(_0x19d2dd,_0x52bed1){_0x19d2dd=_0x19d2dd-0x0;var _0x2cf049=_0xa1a2[_0x19d2dd];return _0x2cf049;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x2a1a('0x0'),_0x2a1a('0x1'),_0x2a1a('0x2')];function createListener(_0xe49c10,_0x1d9a45){return function(_0x33a5ca){_0x1d9a45['emit'](_0xe49c10,_0x33a5ca);};}function removeListener(_0xa17748,_0x5b670f){return function(){UserNotificationEvents['removeListener'](_0xa17748,_0x5b670f);};}exports[_0x2a1a('0x3')]=function(_0x6ebb90){for(var _0x1ea025=0x0,_0x88b7ac=events[_0x2a1a('0x4')];_0x1ea025<_0x88b7ac;_0x1ea025++){var _0x4c6a8e=events[_0x1ea025];var _0x59226d=createListener(_0x2a1a('0x5')+_0x4c6a8e,_0x6ebb90);UserNotificationEvents['on'](_0x4c6a8e,_0x59226d);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8224661..b4c04c0 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xe21040,_0x28de1a){var _0x388bf6=function(_0x465fa4){while(--_0x465fa4){_0xe21040['push'](_0xe21040['shift']());}};_0x388bf6(++_0x28de1a);}(_0x70e0,0x17b));var _0x070e=function(_0xff7c05,_0x2456ca){_0xff7c05=_0xff7c05-0x0;var _0x1c1ab9=_0x70e0[_0xff7c05];return _0x1c1ab9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2f1ddd,_0x38c2b6){var _0x5410e1=function(_0x2bf775){while(--_0x2bf775){_0x2f1ddd['push'](_0x2f1ddd['shift']());}};_0x5410e1(++_0x38c2b6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 41b53fb..b9f158c 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 _0x8da5=['INTEGER','sequelize'];(function(_0xc11940,_0x4fcfbb){var _0x2ccb04=function(_0x3c8a06){while(--_0x3c8a06){_0xc11940['push'](_0xc11940['shift']());}};_0x2ccb04(++_0x4fcfbb);}(_0x8da5,0x71));var _0x58da=function(_0xcb1e77,_0x333133){_0xcb1e77=_0xcb1e77-0x0;var _0x417c86=_0x8da5[_0xcb1e77];return _0x417c86;};'use strict';var Sequelize=require(_0x58da('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x58da('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x54c0=['exports'];(function(_0xebb3eb,_0x2d0561){var _0x215c12=function(_0x24701d){while(--_0x24701d){_0xebb3eb['push'](_0xebb3eb['shift']());}};_0x215c12(++_0x2d0561);}(_0x54c0,0x1ee));var _0x054c=function(_0x2ce50e,_0x219f2a){_0x2ce50e=_0x2ce50e-0x0;var _0x12acbc=_0x54c0[_0x2ce50e];return _0x12acbc;};'use strict';var Sequelize=require('sequelize');module[_0x054c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 2784a89..de7c429 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 _0xde54=['path','rimraf','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x27036b,_0x1b8ec4){var _0x388eba=function(_0x2c561e){while(--_0x2c561e){_0x27036b['push'](_0x27036b['shift']());}};_0x388eba(++_0x1b8ec4);}(_0xde54,0xc0));var _0x4de5=function(_0x292e76,_0x1a4ffe){_0x292e76=_0x292e76-0x0;var _0xabc64a=_0xde54[_0x292e76];return _0xabc64a;};'use strict';var _=require(_0x4de5('0x0'));var util=require(_0x4de5('0x1'));var logger=require(_0x4de5('0x2'))(_0x4de5('0x3'));var moment=require(_0x4de5('0x4'));var BPromise=require(_0x4de5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4de5('0x6'));var rimraf=require(_0x4de5('0x7'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x4de5('0x8')]=function(_0x2f75b0,_0x45d750){return _0x2f75b0[_0x4de5('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x4de5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8b2=['define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','exports'];(function(_0x37b6c4,_0x4a522e){var _0x54cfcc=function(_0x5dff62){while(--_0x5dff62){_0x37b6c4['push'](_0x37b6c4['shift']());}};_0x54cfcc(++_0x4a522e);}(_0xa8b2,0xb3));var _0x2a8b=function(_0x62d57,_0x57774a){_0x62d57=_0x62d57-0x0;var _0x5211b4=_0xa8b2[_0x62d57];return _0x5211b4;};'use strict';var _=require('lodash');var util=require(_0x2a8b('0x0'));var logger=require(_0x2a8b('0x1'))('api');var moment=require(_0x2a8b('0x2'));var BPromise=require(_0x2a8b('0x3'));var rp=require(_0x2a8b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a8b('0x5'));var config=require('../../config/environment');var attributes=require(_0x2a8b('0x6'));module[_0x2a8b('0x7')]=function(_0x23892e,_0xcfeab6){return _0x23892e[_0x2a8b('0x8')](_0x2a8b('0x9'),attributes,{'tableName':_0x2a8b('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 def253c..11ac9e8 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 _0x942e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x1d866b,_0x51edc4){var _0x53042c=function(_0x1bd6b0){while(--_0x1bd6b0){_0x1d866b['push'](_0x1d866b['shift']());}};_0x53042c(++_0x51edc4);}(_0x942e,0xac));var _0xe942=function(_0x28e9a5,_0x24c442){_0x28e9a5=_0x28e9a5-0x0;var _0x1c07ff=_0x942e[_0x28e9a5];return _0x1c07ff;};'use strict';var _=require(_0xe942('0x0'));var util=require(_0xe942('0x1'));var moment=require(_0xe942('0x2'));var BPromise=require(_0xe942('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe942('0x4'));var db=require(_0xe942('0x5'))['db'];var utils=require(_0xe942('0x6'));var logger=require(_0xe942('0x7'))('rpc');var config=require(_0xe942('0x8'));var jayson=require(_0xe942('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29aa02,_0x228c1c,_0x3c7c96){return new BPromise(function(_0x3751ae,_0x4cda4c){return client[_0xe942('0xa')](_0x29aa02,_0x3c7c96)['then'](function(_0x56c77e){logger[_0xe942('0xb')](_0xe942('0xc'),_0x228c1c,'request\x20sent');logger[_0xe942('0xd')](_0xe942('0xe'),_0x228c1c,'request\x20sent',JSON[_0xe942('0xf')](_0x56c77e));if(_0x56c77e[_0xe942('0x10')]){if(_0x56c77e[_0xe942('0x10')][_0xe942('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x228c1c,_0x56c77e[_0xe942('0x10')][_0xe942('0x12')]);return _0x4cda4c(_0x56c77e['error'][_0xe942('0x12')]);}logger['error'](_0xe942('0xc'),_0x228c1c,_0x56c77e[_0xe942('0x10')]['message']);return _0x3751ae(_0x56c77e[_0xe942('0x10')][_0xe942('0x12')]);}else{logger[_0xe942('0xb')](_0xe942('0xc'),_0x228c1c,_0xe942('0x13'));_0x3751ae(_0x56c77e[_0xe942('0x14')][_0xe942('0x12')]);}})[_0xe942('0x15')](function(_0x10d6db){logger[_0xe942('0x10')](_0xe942('0xc'),_0x228c1c,_0x10d6db);_0x4cda4c(_0x10d6db);});});} \ No newline at end of file +var _0xa785=['request','then','request\x20sent','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x439823,_0x16f522){var _0x1be419=function(_0x4fac93){while(--_0x4fac93){_0x439823['push'](_0x439823['shift']());}};_0x1be419(++_0x16f522);}(_0xa785,0xb1));var _0x5a78=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0xa785[_0xbc4659];return _0x5831f9;};'use strict';var _=require('lodash');var util=require(_0x5a78('0x0'));var moment=require(_0x5a78('0x1'));var BPromise=require(_0x5a78('0x2'));var rs=require(_0x5a78('0x3'));var fs=require('fs');var Redis=require(_0x5a78('0x4'));var db=require(_0x5a78('0x5'))['db'];var utils=require(_0x5a78('0x6'));var logger=require('../../config/logger')(_0x5a78('0x7'));var config=require(_0x5a78('0x8'));var jayson=require(_0x5a78('0x9'));var client=jayson[_0x5a78('0xa')][_0x5a78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f24af,_0x57b6be,_0x523f32){return new BPromise(function(_0x3b3f30,_0x1cca1c){return client[_0x5a78('0xc')](_0x4f24af,_0x523f32)[_0x5a78('0xd')](function(_0x2ece1a){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x57b6be,_0x5a78('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x57b6be,_0x5a78('0xe'),JSON['stringify'](_0x2ece1a));if(_0x2ece1a['error']){if(_0x2ece1a[_0x5a78('0xf')][_0x5a78('0x10')]===0x1f4){logger[_0x5a78('0xf')](_0x5a78('0x11'),_0x57b6be,_0x2ece1a[_0x5a78('0xf')][_0x5a78('0x12')]);return _0x1cca1c(_0x2ece1a[_0x5a78('0xf')][_0x5a78('0x12')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x57b6be,_0x2ece1a['error'][_0x5a78('0x12')]);return _0x3b3f30(_0x2ece1a[_0x5a78('0xf')][_0x5a78('0x12')]);}else{logger['info'](_0x5a78('0x11'),_0x57b6be,_0x5a78('0xe'));_0x3b3f30(_0x2ece1a[_0x5a78('0x13')]['message']);}})[_0x5a78('0x14')](function(_0x33e2d3){logger['error'](_0x5a78('0x11'),_0x57b6be,_0x33e2d3);_0x1cca1c(_0x33e2d3);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4b28c42..dd90bb8 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 _0xee14=['post','create','/:id/clone','clone','/:id/sections','addResources','put','destroy','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getSections','/:id/resources','getResources'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xee14,0x166));var _0x4ee1=function(_0x3dc269,_0x48a7d5){_0x3dc269=_0x3dc269-0x0;var _0x4e9df7=_0xee14[_0x3dc269];return _0x4e9df7;};'use strict';var multer=require(_0x4ee1('0x0'));var util=require('util');var path=require(_0x4ee1('0x1'));var timeout=require(_0x4ee1('0x2'));var express=require(_0x4ee1('0x3'));var router=express[_0x4ee1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4ee1('0x9')]);router[_0x4ee1('0xa')](_0x4ee1('0xb'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xa')](_0x4ee1('0xe'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0xa')]('/:id/sections',auth['isAuthenticated'](),controller[_0x4ee1('0x10')]);router[_0x4ee1('0xa')](_0x4ee1('0x11'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x12')]);router[_0x4ee1('0x13')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x14')]);router['post'](_0x4ee1('0x15'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x16')]);router['post'](_0x4ee1('0x17'),auth[_0x4ee1('0xc')](),controller['addSections']);router['post'](_0x4ee1('0x11'),auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x18')]);router[_0x4ee1('0x19')](_0x4ee1('0xe'),auth[_0x4ee1('0xc')](),controller['update']);router['delete']('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x1a')]);router[_0x4ee1('0x1b')](_0x4ee1('0x17'),auth[_0x4ee1('0xc')](),controller['removeSections']);router[_0x4ee1('0x1b')](_0x4ee1('0x11'),auth[_0x4ee1('0xc')](),controller['removeResources']);module[_0x4ee1('0x1c')]=router; \ No newline at end of file +var _0x60bb=['describe','show','/:id/sections','getSections','/:id/resources','getResources','create','clone','addSections','post','addResources','/:id','update','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','/describe'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x60bb,0x1e1));var _0xb60b=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x60bb[_0x27beea];return _0x122645;};'use strict';var multer=require(_0xb60b('0x0'));var util=require(_0xb60b('0x1'));var path=require(_0xb60b('0x2'));var timeout=require(_0xb60b('0x3'));var express=require(_0xb60b('0x4'));var router=express[_0xb60b('0x5')]();var fs_extra=require(_0xb60b('0x6'));var auth=require(_0xb60b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb60b('0x8'));router[_0xb60b('0x9')]('/',auth[_0xb60b('0xa')](),controller['index']);router[_0xb60b('0x9')](_0xb60b('0xb'),auth[_0xb60b('0xa')](),controller[_0xb60b('0xc')]);router[_0xb60b('0x9')]('/:id',auth[_0xb60b('0xa')](),controller[_0xb60b('0xd')]);router[_0xb60b('0x9')](_0xb60b('0xe'),auth[_0xb60b('0xa')](),controller[_0xb60b('0xf')]);router[_0xb60b('0x9')](_0xb60b('0x10'),auth['isAuthenticated'](),controller[_0xb60b('0x11')]);router['post']('/',auth[_0xb60b('0xa')](),controller[_0xb60b('0x12')]);router['post']('/:id/clone',auth[_0xb60b('0xa')](),controller[_0xb60b('0x13')]);router['post'](_0xb60b('0xe'),auth[_0xb60b('0xa')](),controller[_0xb60b('0x14')]);router[_0xb60b('0x15')](_0xb60b('0x10'),auth[_0xb60b('0xa')](),controller[_0xb60b('0x16')]);router['put'](_0xb60b('0x17'),auth[_0xb60b('0xa')](),controller[_0xb60b('0x18')]);router[_0xb60b('0x19')](_0xb60b('0x17'),auth[_0xb60b('0xa')](),controller['destroy']);router[_0xb60b('0x19')]('/:id/sections',auth[_0xb60b('0xa')](),controller[_0xb60b('0x1a')]);router['delete'](_0xb60b('0x10'),auth[_0xb60b('0xa')](),controller[_0xb60b('0x1b')]);module[_0xb60b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 53e1532..ff6aa9f 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 _0xe349=['crudPermissions','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x121213,_0x4aef44){var _0x730a11=function(_0x39f7ec){while(--_0x39f7ec){_0x121213['push'](_0x121213['shift']());}};_0x730a11(++_0x4aef44);}(_0xe349,0x1b4));var _0x9e34=function(_0xd2e2ab,_0x2440cf){_0xd2e2ab=_0xd2e2ab-0x0;var _0x1703a2=_0xe349[_0xd2e2ab];return _0x1703a2;};'use strict';var Sequelize=require('sequelize');module[_0x9e34('0x0')]={'name':{'type':Sequelize[_0x9e34('0x1')],'allowNull':![],'unique':_0x9e34('0x2')},'crudPermissions':{'type':Sequelize[_0x9e34('0x1')],'set':function(_0x2d9de5){this[_0x9e34('0x3')](_0x9e34('0x4'),_0x2d9de5?_0x2d9de5['join'](''):[]);},'get':function(){return this[_0x9e34('0x5')]('crudPermissions')?this[_0x9e34('0x5')](_0x9e34('0x4'))[_0x9e34('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9e34('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9e34('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1572=['STRING','name','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports'];(function(_0x28aa0e,_0x43c6ed){var _0x223835=function(_0x1bde32){while(--_0x1bde32){_0x28aa0e['push'](_0x28aa0e['shift']());}};_0x223835(++_0x43c6ed);}(_0x1572,0x1de));var _0x2157=function(_0x13e6a5,_0xb6b4c3){_0x13e6a5=_0x13e6a5-0x0;var _0x406667=_0x1572[_0x13e6a5];return _0x406667;};'use strict';var Sequelize=require(_0x2157('0x0'));module[_0x2157('0x1')]={'name':{'type':Sequelize[_0x2157('0x2')],'allowNull':![],'unique':_0x2157('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1f14d8){this[_0x2157('0x4')]('crudPermissions',_0x1f14d8?_0x1f14d8[_0x2157('0x5')](''):[]);},'get':function(){return this[_0x2157('0x6')](_0x2157('0x7'))?this[_0x2157('0x6')](_0x2157('0x7'))[_0x2157('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2157('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2157('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2157('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2157('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x2157('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2157('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2157('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2157('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 75f6c26..a46de63 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 _0xf954=['params','create','body','clone','find','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','destroy','describe','sectionId','push','removeSections','ids','enabled','includes','isEmpty','subsections','findOne','Dashboard','resourceId','Plugin','forEach','addResources','bulkCreate','getResources','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x26448d,_0x3230af){var _0x37cc01=function(_0x4ca3d0){while(--_0x4ca3d0){_0x26448d['push'](_0x26448d['shift']());}};_0x37cc01(++_0x3230af);}(_0xf954,0x10e));var _0x4f95=function(_0x289531,_0x1180e5){_0x289531=_0x289531-0x0;var _0x2e7019=_0xf954[_0x289531];return _0x2e7019;};'use strict';var emlformat=require(_0x4f95('0x0'));var rimraf=require(_0x4f95('0x1'));var zipdir=require(_0x4f95('0x2'));var jsonpatch=require(_0x4f95('0x3'));var rp=require(_0x4f95('0x4'));var moment=require(_0x4f95('0x5'));var BPromise=require(_0x4f95('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f95('0x7'));var sox=require(_0x4f95('0x8'));var csv=require(_0x4f95('0x9'));var ejs=require(_0x4f95('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f95('0xb'));var squel=require(_0x4f95('0xc'));var crypto=require(_0x4f95('0xd'));var jsforce=require(_0x4f95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4f95('0xf'));var Papa=require(_0x4f95('0x10'));var Redis=require(_0x4f95('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f95('0x12'));var logger=require(_0x4f95('0x13'))(_0x4f95('0x14'));var utils=require(_0x4f95('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4f95('0x16'));var db=require(_0x4f95('0x17'))['db'];config[_0x4f95('0x18')]=_[_0x4f95('0x19')](config[_0x4f95('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f95('0x1a'))(new Redis(config[_0x4f95('0x18')]));require(_0x4f95('0x1b'))[_0x4f95('0x1c')](socket);function respondWithStatusCode(_0x56d995,_0x397de4){_0x397de4=_0x397de4||0xcc;return function(_0x315a9f){if(_0x315a9f){return _0x56d995[_0x4f95('0x1d')](_0x397de4);}return _0x56d995['status'](_0x397de4)[_0x4f95('0x1e')]();};}function respondWithResult(_0x451dc2,_0x1d9bd1){_0x1d9bd1=_0x1d9bd1||0xc8;return function(_0x12d95e){if(_0x12d95e){return _0x451dc2[_0x4f95('0x1f')](_0x1d9bd1)[_0x4f95('0x20')](_0x12d95e);}};}function respondWithFilteredResult(_0x2aa444,_0x25f9ca){return function(_0x235c03){if(_0x235c03){var _0x3a3508=typeof _0x25f9ca['offset']===_0x4f95('0x21')&&typeof _0x25f9ca[_0x4f95('0x22')]===_0x4f95('0x21');var _0x2d2595=_0x235c03[_0x4f95('0x23')];var _0x351427=_0x3a3508?0x0:_0x25f9ca[_0x4f95('0x24')];var _0x3586c0=_0x3a3508?_0x235c03[_0x4f95('0x23')]:_0x25f9ca['offset']+_0x25f9ca[_0x4f95('0x22')];var _0xf70461;if(_0x3586c0>=_0x2d2595){_0x3586c0=_0x2d2595;_0xf70461=0xc8;}else{_0xf70461=0xce;}_0x2aa444[_0x4f95('0x1f')](_0xf70461);return _0x2aa444[_0x4f95('0x25')](_0x4f95('0x26'),_0x351427+'-'+_0x3586c0+'/'+_0x2d2595)[_0x4f95('0x20')](_0x235c03);}return null;};}function patchUpdates(_0xe49db2){return function(_0x2e3872){try{jsonpatch[_0x4f95('0x27')](_0x2e3872,_0xe49db2,!![]);}catch(_0x10cab5){return BPromise[_0x4f95('0x28')](_0x10cab5);}return _0x2e3872[_0x4f95('0x29')]();};}function saveUpdates(_0x1e675c,_0x4f9e55){return function(_0x11992a){if(_0x11992a){return _0x11992a[_0x4f95('0x2a')](_0x1e675c)[_0x4f95('0x2b')](function(_0x34a4de){return _0x34a4de;});}return null;};}function removeEntity(_0x3875fe,_0x14ba9f){return function(_0x303f65){if(_0x303f65){return _0x303f65['destroy']()[_0x4f95('0x2b')](function(){_0x3875fe['status'](0xcc)[_0x4f95('0x1e')]();});}};}function handleEntityNotFound(_0x2036ee,_0x224a0a){return function(_0x1079fd){if(!_0x1079fd){_0x2036ee[_0x4f95('0x1d')](0x194);}return _0x1079fd;};}function handleError(_0x4993da,_0x2cb1bb){_0x2cb1bb=_0x2cb1bb||0x1f4;return function(_0x2dc278){logger[_0x4f95('0x2c')](_0x2dc278[_0x4f95('0x2d')]);if(_0x2dc278[_0x4f95('0x2e')]){delete _0x2dc278[_0x4f95('0x2e')];}_0x4993da[_0x4f95('0x1f')](_0x2cb1bb)[_0x4f95('0x2f')](_0x2dc278);};}exports['index']=function(_0x5d9c7a,_0x5ea525){var _0x4cb67d={},_0x5515b4={},_0x40d115={'count':0x0,'rows':[]};var _0xc3837a=_[_0x4f95('0x30')](db[_0x4f95('0x31')][_0x4f95('0x32')],function(_0x3bff09){return{'name':_0x3bff09[_0x4f95('0x33')],'type':_0x3bff09[_0x4f95('0x34')]['key']};});_0x5515b4[_0x4f95('0x35')]=_[_0x4f95('0x30')](_0xc3837a,_0x4f95('0x2e'));_0x5515b4[_0x4f95('0x36')]=_[_0x4f95('0x37')](_0x5d9c7a[_0x4f95('0x36')]);_0x5515b4[_0x4f95('0x38')]=_[_0x4f95('0x39')](_0x5515b4['model'],_0x5515b4[_0x4f95('0x36')]);_0x4cb67d[_0x4f95('0x3a')]=_[_0x4f95('0x39')](_0x5515b4[_0x4f95('0x35')],qs[_0x4f95('0x3b')](_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x3b')]));_0x4cb67d[_0x4f95('0x3a')]=_0x4cb67d[_0x4f95('0x3a')][_0x4f95('0x3c')]?_0x4cb67d[_0x4f95('0x3a')]:_0x5515b4[_0x4f95('0x35')];if(!_0x5d9c7a[_0x4f95('0x36')]['hasOwnProperty']('nolimit')){_0x4cb67d[_0x4f95('0x22')]=qs[_0x4f95('0x22')](_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x22')]);_0x4cb67d[_0x4f95('0x24')]=qs['offset'](_0x5d9c7a['query'][_0x4f95('0x24')]);}_0x4cb67d[_0x4f95('0x3d')]=qs[_0x4f95('0x3e')](_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x3e')]);_0x4cb67d[_0x4f95('0x3f')]=qs['filters'](_[_0x4f95('0x40')](_0x5d9c7a[_0x4f95('0x36')],_0x5515b4[_0x4f95('0x38')]),_0xc3837a);if(_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x41')]){_0x4cb67d[_0x4f95('0x3f')]=_[_0x4f95('0x42')](_0x4cb67d['where'],{'$or':_['map'](_0xc3837a,function(_0x5af4ab){if(_0x5af4ab['type']!==_0x4f95('0x43')){var _0x3a1650={};_0x3a1650[_0x5af4ab['name']]={'$like':'%'+_0x5d9c7a['query']['filter']+'%'};return _0x3a1650;}})});}_0x4cb67d=_[_0x4f95('0x42')]({},_0x4cb67d,_0x5d9c7a[_0x4f95('0x44')]);var _0x2f79a8={'where':_0x4cb67d[_0x4f95('0x3f')]};return db[_0x4f95('0x31')]['count'](_0x2f79a8)[_0x4f95('0x2b')](function(_0x2af149){_0x40d115[_0x4f95('0x23')]=_0x2af149;if(_0x5d9c7a[_0x4f95('0x36')][_0x4f95('0x45')]){_0x4cb67d[_0x4f95('0x46')]=[{'all':!![]}];}return db[_0x4f95('0x31')][_0x4f95('0x47')](_0x4cb67d);})[_0x4f95('0x2b')](function(_0x572606){_0x40d115[_0x4f95('0x48')]=_0x572606;return _0x40d115;})[_0x4f95('0x2b')](respondWithFilteredResult(_0x5ea525,_0x4cb67d))[_0x4f95('0x49')](handleError(_0x5ea525,null));};exports[_0x4f95('0x4a')]=function(_0x3510c9,_0x56a578){var _0x5541c7={'raw':![],'where':{'id':_0x3510c9[_0x4f95('0x4b')]['id']}},_0x55ff83={};_0x55ff83[_0x4f95('0x35')]=_[_0x4f95('0x37')](db['UserProfile']['rawAttributes']);_0x55ff83[_0x4f95('0x36')]=_[_0x4f95('0x37')](_0x3510c9[_0x4f95('0x36')]);_0x55ff83['filters']=_[_0x4f95('0x39')](_0x55ff83[_0x4f95('0x35')],_0x55ff83['query']);_0x5541c7['attributes']=_[_0x4f95('0x39')](_0x55ff83[_0x4f95('0x35')],qs[_0x4f95('0x3b')](_0x3510c9[_0x4f95('0x36')][_0x4f95('0x3b')]));_0x5541c7[_0x4f95('0x3a')]=_0x5541c7[_0x4f95('0x3a')][_0x4f95('0x3c')]?_0x5541c7[_0x4f95('0x3a')]:_0x55ff83[_0x4f95('0x35')];if(_0x3510c9[_0x4f95('0x36')]['includeAll']){_0x5541c7[_0x4f95('0x46')]=[{'all':!![]}];}_0x5541c7=_[_0x4f95('0x42')]({},_0x5541c7,_0x3510c9[_0x4f95('0x44')]);return db[_0x4f95('0x31')]['find'](_0x5541c7)[_0x4f95('0x2b')](handleEntityNotFound(_0x56a578,null))[_0x4f95('0x2b')](respondWithResult(_0x56a578,null))[_0x4f95('0x49')](handleError(_0x56a578,null));};exports[_0x4f95('0x4c')]=function(_0x3b66b8,_0x43c97b){return db['UserProfile'][_0x4f95('0x4c')](_0x3b66b8[_0x4f95('0x4d')],{})[_0x4f95('0x2b')](respondWithResult(_0x43c97b,0xc9))[_0x4f95('0x49')](handleError(_0x43c97b,null));};exports[_0x4f95('0x4e')]=function(_0x3c57ab,_0x3ea1bf){var _0x59a820={'where':{'id':_0x3c57ab['params']['id']}},_0x107c7a={};_0x107c7a[_0x4f95('0x35')]=_[_0x4f95('0x37')](db[_0x4f95('0x31')]['rawAttributes']);_0x59a820['attributes']=_[_0x4f95('0x39')](_0x107c7a['model'],qs[_0x4f95('0x3b')](_0x3c57ab[_0x4f95('0x36')][_0x4f95('0x3b')]));_0x59a820[_0x4f95('0x3a')]=_0x59a820[_0x4f95('0x3a')]['length']?_0x59a820[_0x4f95('0x3a')]:_0x107c7a['model'];if(_0x3c57ab[_0x4f95('0x36')][_0x4f95('0x45')]){_0x59a820[_0x4f95('0x46')]=[{'all':!![]}];}_0x59a820=_[_0x4f95('0x42')]({},_0x59a820,_0x3c57ab[_0x4f95('0x44')]);return db[_0x4f95('0x31')][_0x4f95('0x4f')](_0x59a820)[_0x4f95('0x2b')](handleEntityNotFound(_0x3ea1bf,null))[_0x4f95('0x2b')](function(_0x22bef4){if(_0x22bef4){var _0x4be724=_0x22bef4[_0x4f95('0x50')]({'plain':!![]});_0x4be724=qs[_0x4f95('0x51')](_0x4be724,['id','createdAt',_0x4f95('0x52'),_0x4f95('0x53')]);_0x3c57ab[_0x4f95('0x4d')]=_[_0x4f95('0x51')](_0x3c57ab[_0x4f95('0x4d')],['id',_0x4f95('0x54'),_0x4f95('0x52')]);return db[_0x4f95('0x55')][_0x4f95('0x56')](function(_0x346b55){return db[_0x4f95('0x31')][_0x4f95('0x4c')](_[_0x4f95('0x42')](_0x4be724,_0x3c57ab['body']),{'include':_0x3c57ab[_0x4f95('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x346b55})[_0x4f95('0x2b')](function(_0x25847e){var _0x370c84=_0x25847e[_0x4f95('0x50')]({'plain':!![]});return db[_0x4f95('0x57')][_0x4f95('0x47')]({'where':{'userProfileId':_0x3c57ab[_0x4f95('0x4b')]['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x3289a8){if(_0x3289a8){return BPromise[_0x4f95('0x58')](_0x3289a8,function(_0x55fff3){return new BPromise(function(_0x20cc1d,_0x266089){if(_0x55fff3[_0x4f95('0x59')]===null||_0x55fff3[_0x4f95('0x59')]===0x1)_0x20cc1d(null);return db[_0x4f95('0x5a')]['findAll']({'where':{'sectionId':_0x55fff3['id']},'raw':!![]})['then'](function(_0x4527de){var _0x1c1611=_[_0x4f95('0x30')](_0x4527de,function(_0x49208c){return qs[_0x4f95('0x51')](_0x49208c,['id',_0x4f95('0x54'),_0x4f95('0x52'),'sectionId']);});_0x20cc1d(_0x1c1611);})['catch'](function(_0x52c8ec){_0x266089(_0x52c8ec);});})[_0x4f95('0x2b')](function(_0x3767cb){var _0x180178=qs[_0x4f95('0x51')](_0x55fff3,['id',_0x4f95('0x54'),_0x4f95('0x52')]);_0x180178[_0x4f95('0x5b')]=_0x370c84['id'];if(_0x3767cb)_0x180178[_0x4f95('0x5c')]=_0x3767cb;return _0x180178;})[_0x4f95('0x2b')](function(_0x115015){return db[_0x4f95('0x57')]['create'](_0x115015,{'include':[{'model':db['UserProfileResource'],'as':_0x4f95('0x5c')}],'raw':!![],'transaction':_0x346b55});});})[_0x4f95('0x2b')](function(){return _0x370c84;});}});});});}})['then'](respondWithResult(_0x3ea1bf,0xc9))[_0x4f95('0x49')](handleError(_0x3ea1bf,null));};exports[_0x4f95('0x2a')]=function(_0x3d976d,_0xc01bc8){if(_0x3d976d[_0x4f95('0x4d')]['id']){delete _0x3d976d['body']['id'];}return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x3d976d[_0x4f95('0x4b')]['id']}})[_0x4f95('0x2b')](handleEntityNotFound(_0xc01bc8,null))['then'](saveUpdates(_0x3d976d['body'],null))[_0x4f95('0x2b')](respondWithResult(_0xc01bc8,null))[_0x4f95('0x49')](handleError(_0xc01bc8,null));};exports[_0x4f95('0x5d')]=function(_0x3f640f,_0x1e8506){return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x3f640f[_0x4f95('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e8506,null))[_0x4f95('0x2b')](removeEntity(_0x1e8506,null))[_0x4f95('0x49')](handleError(_0x1e8506,null));};exports[_0x4f95('0x5e')]=function(_0x1bf4e1,_0x1b9946){return db['UserProfile']['describe']()['then'](respondWithResult(_0x1b9946,null))['catch'](handleError(_0x1b9946,null));};exports['addSections']=function(_0xcfbebc,_0x1f5c00){var _0x4b139e=_0xcfbebc['body'];return db[_0x4f95('0x31')]['find']({'where':{'id':_0xcfbebc['params']['id']}})['then'](handleEntityNotFound(_0x1f5c00,null))['then'](function(_0x371bbf){if(_0x371bbf){return db[_0x4f95('0x55')]['transaction'](function(_0x45f6e7){return db['UserProfileSection'][_0x4f95('0x5d')]({'where':{'userProfileId':_0xcfbebc[_0x4f95('0x4b')]['id'],'sectionId':_[_0x4f95('0x30')](_0x4b139e,function(_0x5cc2d7){return _0x5cc2d7[_0x4f95('0x5f')];})},'transaction':_0x45f6e7})[_0x4f95('0x2b')](function(){var _0xc4ae77=_[_0x4f95('0x30')](_0x4b139e,function(_0x3a1ebf){_0x3a1ebf[_0x4f95('0x5b')]=_0xcfbebc[_0x4f95('0x4b')]['id'];return _0x3a1ebf;});var _0x585a9b=[];return BPromise['each'](_0xc4ae77,function(_0x53b774){return db[_0x4f95('0x57')][_0x4f95('0x4c')](_0x53b774,{'include':[{'model':db[_0x4f95('0x5a')],'as':_0x4f95('0x5c')}],'raw':!![],'transaction':_0x45f6e7})['then'](function(_0x7abfa2){_0x585a9b[_0x4f95('0x60')](_0x7abfa2[_0x4f95('0x50')]({'plain':!![]}));});})[_0x4f95('0x2b')](function(){return _0x585a9b;});});});}})[_0x4f95('0x2b')](function(_0xb7b493){return _0xb7b493;})['then'](respondWithResult(_0x1f5c00,null))['catch'](handleError(_0x1f5c00,null));};exports[_0x4f95('0x61')]=function(_0x2955b7,_0xe451af){var _0x1a7ccc;return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x2955b7['params']['id']},'attributes':['id',_0x4f95('0x2e')]})[_0x4f95('0x2b')](handleEntityNotFound(_0xe451af,null))['then'](function(_0x408629){if(_0x408629){_0x1a7ccc=_0x408629;return db[_0x4f95('0x57')][_0x4f95('0x5d')]({'where':{'userProfileId':_0x2955b7[_0x4f95('0x4b')]['id'],'sectionId':_0x2955b7[_0x4f95('0x36')][_0x4f95('0x62')]}});}})[_0x4f95('0x2b')](function(){return _0x1a7ccc;})[_0x4f95('0x2b')](respondWithStatusCode(_0xe451af,null))[_0x4f95('0x49')](handleError(_0xe451af,null));};exports['getSections']=function(_0x56bd85,_0x47ad28){var _0x471163=[];var _0x1da1d3=[];return db['UserProfileSection'][_0x4f95('0x47')]({'where':{'userProfileId':_0x56bd85[_0x4f95('0x4b')]['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x69d16){_0x471163=_[_0x4f95('0x41')](_0x69d16,function(_0x4473fd){return _0x4473fd[_0x4f95('0x63')]===0x1||_[_0x4f95('0x64')]([0x3eb,0x709],_0x4473fd[_0x4f95('0x5f')]);});if(!_[_0x4f95('0x65')](_0x471163)){return _[_0x4f95('0x30')](_0x471163,function(_0x2f936a){return _0x2f936a[_0x4f95('0x5f')];});}else{return;}})['then'](function(_0x28229e){if(_0x28229e)_0x1da1d3=_0x28229e;if(_[_0x4f95('0x64')](_0x1da1d3,0x64)){var _0x54d3be=_[_0x4f95('0x4f')](_0x471163,{'sectionId':0x64});return hasDefaultDashboard(_0x54d3be)['then'](function(_0x4035ad){return _[_0x4f95('0x30')](_0x471163,function(_0x350d7b){if(_0x350d7b[_0x4f95('0x5f')]===0x64){_0x350d7b['subsections']=_0x4035ad;}return _0x350d7b;});});}else{return;}})['then'](function(_0x49935e){if(_0x49935e)_0x471163=_0x49935e;if(_[_0x4f95('0x64')](_0x1da1d3,0x3eb)){var _0x36b893=_[_0x4f95('0x4f')](_0x471163,{'sectionId':0x3eb});return getCustomDashboards(_0x36b893)[_0x4f95('0x2b')](function(_0x2b0cbb){return _[_0x4f95('0x30')](_0x471163,function(_0x4db100){if(_0x36b893[_0x4f95('0x63')]){if(_0x4db100[_0x4f95('0x5f')]===0x3eb){_0x4db100['subsections']=_0x2b0cbb;}}else{if(_0x4db100[_0x4f95('0x5f')]===0x64){_0x4db100[_0x4f95('0x66')]=_0x2b0cbb;}}return _0x4db100;});});}else{return;}})[_0x4f95('0x2b')](function(_0x1f93d7){if(_0x1f93d7)_0x471163=_0x1f93d7;if(_[_0x4f95('0x64')](_0x1da1d3,0x709)){var _0x5abe95=_['find'](_0x471163,{'sectionId':0x709});return getPlugins(_0x5abe95)['then'](function(_0x2c3a60){if(_0x5abe95[_0x4f95('0x63')]){return _['map'](_0x471163,function(_0x519949){if(_0x519949[_0x4f95('0x5f')]===0x709){_0x519949['subsections']=_0x2c3a60;}return _0x519949;});}else{var _0x4d1490={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2c3a60};var _0x42af2=_[_0x4f95('0x30')](_0x471163);_0x42af2[_0x4f95('0x60')](_0x4d1490);return _0x42af2;}});}else{return;}})[_0x4f95('0x2b')](function(_0x24050e){if(_0x24050e)_0x471163=_0x24050e;return _[_0x4f95('0x41')](_0x471163,[_0x4f95('0x63'),0x1]);})[_0x4f95('0x2b')](respondWithResult(_0x47ad28,null))[_0x4f95('0x49')](handleError(_0x47ad28,null));};function hasDefaultDashboard(_0xffc205){var _0x4ac12b=[0x65];return new BPromise(function(_0x58d8a5,_0x48663a){try{if(_0xffc205[_0x4f95('0x59')]){_0x58d8a5(_0x4ac12b);}else{return db['UserProfileResource'][_0x4f95('0x67')]({'where':{'sectionId':_0xffc205['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x4ef439){_0x4ef439?_0x58d8a5(_0x4ac12b):_0x58d8a5();});}}catch(_0x22ea3b){_0x48663a(_0x22ea3b);}});}function getCustomDashboards(_0x4a8c00){var _0x1b07a5=[];return new BPromise(function(_0x462cd5,_0x24a78b){try{if(_0x4a8c00[_0x4f95('0x59')]){return db[_0x4f95('0x68')][_0x4f95('0x47')]({'raw':!![]})[_0x4f95('0x2b')](function(_0x26b78a){_0x26b78a['forEach'](function(_0x8b666a){_0x1b07a5[_0x4f95('0x60')](_0x8b666a['id']+0x1869f);});_0x462cd5(_0x1b07a5);});}else{return db[_0x4f95('0x5a')]['findAll']({'where':{'sectionId':_0x4a8c00['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x4d91ef){_0x4d91ef['forEach'](function(_0x181015){_0x1b07a5['push'](_0x181015[_0x4f95('0x69')]+0x1869f);});_0x462cd5(_0x1b07a5);});}}catch(_0x5d67ae){_0x24a78b(_0x5d67ae);}});}function getPlugins(_0x43503f){var _0x30c926=[];return new BPromise(function(_0x15e7d7,_0x3528bc){try{if(_0x43503f[_0x4f95('0x59')]){return db[_0x4f95('0x6a')][_0x4f95('0x47')]({'raw':!![]})[_0x4f95('0x2b')](function(_0x3b417d){_0x3b417d[_0x4f95('0x6b')](function(_0x1167d2){_0x30c926['push'](_0x1167d2['id']+0x15b38);});_0x15e7d7(_0x30c926);});}else{return db[_0x4f95('0x5a')][_0x4f95('0x47')]({'where':{'sectionId':_0x43503f['id']},'raw':!![]})[_0x4f95('0x2b')](function(_0x2fbe2a){_0x2fbe2a[_0x4f95('0x6b')](function(_0x2efc96){_0x30c926[_0x4f95('0x60')](_0x2efc96[_0x4f95('0x69')]+0x15b38);});_0x15e7d7(_0x30c926);});}}catch(_0x18dd5c){_0x3528bc(_0x18dd5c);}});}exports[_0x4f95('0x6c')]=function(_0x5687ad,_0x1d05e8){return db['UserProfile'][_0x4f95('0x4f')]({'where':{'id':_0x5687ad['params']['id']}})['then'](handleEntityNotFound(_0x1d05e8,null))[_0x4f95('0x2b')](function(_0x76b2c1){if(_0x76b2c1){return db['sequelize'][_0x4f95('0x56')](function(_0x261808){return db[_0x4f95('0x57')][_0x4f95('0x47')]({'where':{'userProfileId':_0x5687ad[_0x4f95('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0x4f95('0x2b')](function(_0xf2350d){if(_0xf2350d){return db[_0x4f95('0x57')][_0x4f95('0x5d')]({'where':{'userProfileId':_0x5687ad[_0x4f95('0x4b')]['id'],'id':_[_0x4f95('0x30')](_0xf2350d,function(_0x147634){return _0x147634['id'];})},'transaction':_0x261808});}})[_0x4f95('0x2b')](function(_0x56a0cb){var _0x42e01a=_['map'](_0x5687ad[_0x4f95('0x4d')],function(_0x476617){_0x476617['userProfileId']=_0x5687ad['params']['id'];return _0x476617;});return db[_0x4f95('0x57')]['bulkCreate'](_0x42e01a,{'raw':!![],'transaction':_0x261808});})[_0x4f95('0x2b')](function(_0x269bc6){var _0x35880c=_[_0x4f95('0x41')](_['map'](_0x269bc6,function(_0x3bbf9c){return _0x3bbf9c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x35880c){return db[_0x4f95('0x57')][_0x4f95('0x47')]({'where':{'userProfileId':_0x5687ad['params']['id'],'sectionId':_[_0x4f95('0x30')](_0x35880c,function(_0x4b1b7d){return _0x4b1b7d['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x4f95('0x2b')](function(_0x267d5e){var _0x55a6e4=_[_0x4f95('0x30')](_0x5687ad['body'],function(_0x1d6769){_0x1d6769[_0x4f95('0x5b')]=_0x5687ad[_0x4f95('0x4b')]['id'];return _0x1d6769;});return db[_0x4f95('0x5a')][_0x4f95('0x6d')](_0x55a6e4,{'raw':!![],'transaction':_0x261808});});}})['catch'](handleError(_0x1d05e8,null));});}})[_0x4f95('0x2b')](function(_0x1af1f8){var _0x43cd86=_[_0x4f95('0x30')](_0x1af1f8,function(_0x1d67bb){return _0x1d67bb[_0x4f95('0x50')]({'plain':!![]});});})[_0x4f95('0x2b')](respondWithResult(_0x1d05e8,null))[_0x4f95('0x49')](handleError(_0x1d05e8,null));};exports['removeResources']=function(_0x2145d1,_0x4add4f,_0x55c846){return db[_0x4f95('0x31')][_0x4f95('0x4f')]({'where':{'id':_0x2145d1[_0x4f95('0x4b')]['id']}})[_0x4f95('0x2b')](handleEntityNotFound(_0x4add4f,null))[_0x4f95('0x2b')](function(_0x331b82){if(_0x331b82){return _0x331b82['removeResources'](_0x2145d1[_0x4f95('0x36')][_0x4f95('0x62')]);}})[_0x4f95('0x2b')](respondWithStatusCode(_0x4add4f,null))['catch'](handleError(_0x4add4f,null));};exports[_0x4f95('0x6e')]=function(_0x422ad4,_0xbad018){var _0x3c0156={};if(!_0x422ad4[_0x4f95('0x36')]['section'])throw new Error(_0x4f95('0x6f'));if(!_0x422ad4[_0x4f95('0x36')][_0x4f95('0x70')](_0x4f95('0x71'))){_0x3c0156[_0x4f95('0x22')]=qs[_0x4f95('0x22')](_0x422ad4[_0x4f95('0x36')]['limit']);_0x3c0156[_0x4f95('0x24')]=qs[_0x4f95('0x24')](_0x422ad4[_0x4f95('0x36')][_0x4f95('0x24')]);}return db['UserProfile'][_0x4f95('0x4f')]({'where':{'id':_0x422ad4[_0x4f95('0x4b')]['id']}})[_0x4f95('0x2b')](function(_0x2ca0f7){if(!_0x2ca0f7)throw new Error(_0x4f95('0x72')+_0x422ad4[_0x4f95('0x4b')]['id']);return db[_0x4f95('0x31')][_0x4f95('0x6e')](_0x422ad4);})[_0x4f95('0x2b')](respondWithFilteredResult(_0xbad018,_0x3c0156))['catch'](handleError(_0xbad018,null));}; \ No newline at end of file +var _0x8952=['include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','describe','addSections','sectionId','userProfileId','Resources','push','get','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8952,0x17e));var _0x2895=function(_0x29b52f,_0x19c657){_0x29b52f=_0x29b52f-0x0;var _0x4c3680=_0x8952[_0x29b52f];return _0x4c3680;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];config[_0x2895('0x15')]=_['defaults'](config[_0x2895('0x15')],{'host':_0x2895('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2895('0x17'))[_0x2895('0x18')](socket);function respondWithStatusCode(_0x5777a0,_0x2198c3){_0x2198c3=_0x2198c3||0xcc;return function(_0xd8192e){if(_0xd8192e){return _0x5777a0[_0x2895('0x19')](_0x2198c3);}return _0x5777a0[_0x2895('0x1a')](_0x2198c3)[_0x2895('0x1b')]();};}function respondWithResult(_0x2627e6,_0x6a5c7e){_0x6a5c7e=_0x6a5c7e||0xc8;return function(_0x31bb7f){if(_0x31bb7f){return _0x2627e6[_0x2895('0x1a')](_0x6a5c7e)[_0x2895('0x1c')](_0x31bb7f);}};}function respondWithFilteredResult(_0x10a1bf,_0x183b05){return function(_0xbf8b63){if(_0xbf8b63){var _0x2cb505=typeof _0x183b05[_0x2895('0x1d')]===_0x2895('0x1e')&&typeof _0x183b05[_0x2895('0x1f')]===_0x2895('0x1e');var _0x5a8eab=_0xbf8b63['count'];var _0x493851=_0x2cb505?0x0:_0x183b05[_0x2895('0x1d')];var _0x12c2fb=_0x2cb505?_0xbf8b63[_0x2895('0x20')]:_0x183b05['offset']+_0x183b05[_0x2895('0x1f')];var _0x190b79;if(_0x12c2fb>=_0x5a8eab){_0x12c2fb=_0x5a8eab;_0x190b79=0xc8;}else{_0x190b79=0xce;}_0x10a1bf[_0x2895('0x1a')](_0x190b79);return _0x10a1bf[_0x2895('0x21')](_0x2895('0x22'),_0x493851+'-'+_0x12c2fb+'/'+_0x5a8eab)['json'](_0xbf8b63);}return null;};}function patchUpdates(_0x30c6c3){return function(_0x5e93a4){try{jsonpatch['apply'](_0x5e93a4,_0x30c6c3,!![]);}catch(_0x142e58){return BPromise[_0x2895('0x23')](_0x142e58);}return _0x5e93a4[_0x2895('0x24')]();};}function saveUpdates(_0x511286,_0x4e884f){return function(_0x3a72fa){if(_0x3a72fa){return _0x3a72fa[_0x2895('0x25')](_0x511286)[_0x2895('0x26')](function(_0x4a21cf){return _0x4a21cf;});}return null;};}function removeEntity(_0x3d3320,_0x3690ce){return function(_0x480604){if(_0x480604){return _0x480604[_0x2895('0x27')]()[_0x2895('0x26')](function(){_0x3d3320[_0x2895('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320661,_0x30f491){return function(_0x5eedfc){if(!_0x5eedfc){_0x320661[_0x2895('0x19')](0x194);}return _0x5eedfc;};}function handleError(_0x501898,_0x5d70f5){_0x5d70f5=_0x5d70f5||0x1f4;return function(_0x18a935){logger['error'](_0x18a935[_0x2895('0x28')]);if(_0x18a935[_0x2895('0x29')]){delete _0x18a935['name'];}_0x501898['status'](_0x5d70f5)[_0x2895('0x2a')](_0x18a935);};}exports[_0x2895('0x2b')]=function(_0x190e07,_0x14e343){var _0x14d150={},_0xa61689={},_0x34e110={'count':0x0,'rows':[]};var _0x546514=_[_0x2895('0x2c')](db[_0x2895('0x2d')][_0x2895('0x2e')],function(_0x5546eb){return{'name':_0x5546eb[_0x2895('0x2f')],'type':_0x5546eb[_0x2895('0x30')][_0x2895('0x31')]};});_0xa61689[_0x2895('0x32')]=_['map'](_0x546514,_0x2895('0x29'));_0xa61689[_0x2895('0x33')]=_[_0x2895('0x34')](_0x190e07[_0x2895('0x33')]);_0xa61689[_0x2895('0x35')]=_['intersection'](_0xa61689['model'],_0xa61689[_0x2895('0x33')]);_0x14d150[_0x2895('0x36')]=_['intersection'](_0xa61689[_0x2895('0x32')],qs['fields'](_0x190e07[_0x2895('0x33')][_0x2895('0x37')]));_0x14d150['attributes']=_0x14d150[_0x2895('0x36')]['length']?_0x14d150[_0x2895('0x36')]:_0xa61689['model'];if(!_0x190e07['query'][_0x2895('0x38')](_0x2895('0x39'))){_0x14d150[_0x2895('0x1f')]=qs['limit'](_0x190e07[_0x2895('0x33')][_0x2895('0x1f')]);_0x14d150[_0x2895('0x1d')]=qs[_0x2895('0x1d')](_0x190e07[_0x2895('0x33')][_0x2895('0x1d')]);}_0x14d150[_0x2895('0x3a')]=qs[_0x2895('0x3b')](_0x190e07[_0x2895('0x33')][_0x2895('0x3b')]);_0x14d150['where']=qs[_0x2895('0x35')](_[_0x2895('0x3c')](_0x190e07[_0x2895('0x33')],_0xa61689[_0x2895('0x35')]),_0x546514);if(_0x190e07[_0x2895('0x33')][_0x2895('0x3d')]){_0x14d150[_0x2895('0x3e')]=_['merge'](_0x14d150['where'],{'$or':_[_0x2895('0x2c')](_0x546514,function(_0x29dc63){if(_0x29dc63[_0x2895('0x30')]!==_0x2895('0x3f')){var _0x21bf07={};_0x21bf07[_0x29dc63[_0x2895('0x29')]]={'$like':'%'+_0x190e07['query']['filter']+'%'};return _0x21bf07;}})});}_0x14d150=_[_0x2895('0x40')]({},_0x14d150,_0x190e07[_0x2895('0x41')]);var _0x5ce598={'where':_0x14d150['where']};return db[_0x2895('0x2d')][_0x2895('0x20')](_0x5ce598)[_0x2895('0x26')](function(_0x28967f){_0x34e110[_0x2895('0x20')]=_0x28967f;if(_0x190e07[_0x2895('0x33')]['includeAll']){_0x14d150[_0x2895('0x42')]=[{'all':!![]}];}return db[_0x2895('0x2d')][_0x2895('0x43')](_0x14d150);})[_0x2895('0x26')](function(_0x4af6d6){_0x34e110[_0x2895('0x44')]=_0x4af6d6;return _0x34e110;})[_0x2895('0x26')](respondWithFilteredResult(_0x14e343,_0x14d150))[_0x2895('0x45')](handleError(_0x14e343,null));};exports[_0x2895('0x46')]=function(_0x564983,_0x4ef9fe){var _0x46580f={'raw':![],'where':{'id':_0x564983[_0x2895('0x47')]['id']}},_0x19ce85={};_0x19ce85[_0x2895('0x32')]=_[_0x2895('0x34')](db['UserProfile']['rawAttributes']);_0x19ce85[_0x2895('0x33')]=_[_0x2895('0x34')](_0x564983[_0x2895('0x33')]);_0x19ce85[_0x2895('0x35')]=_[_0x2895('0x48')](_0x19ce85[_0x2895('0x32')],_0x19ce85[_0x2895('0x33')]);_0x46580f['attributes']=_[_0x2895('0x48')](_0x19ce85[_0x2895('0x32')],qs[_0x2895('0x37')](_0x564983[_0x2895('0x33')][_0x2895('0x37')]));_0x46580f[_0x2895('0x36')]=_0x46580f[_0x2895('0x36')][_0x2895('0x49')]?_0x46580f['attributes']:_0x19ce85[_0x2895('0x32')];if(_0x564983[_0x2895('0x33')][_0x2895('0x4a')]){_0x46580f['include']=[{'all':!![]}];}_0x46580f=_[_0x2895('0x40')]({},_0x46580f,_0x564983[_0x2895('0x41')]);return db['UserProfile'][_0x2895('0x4b')](_0x46580f)[_0x2895('0x26')](handleEntityNotFound(_0x4ef9fe,null))[_0x2895('0x26')](respondWithResult(_0x4ef9fe,null))[_0x2895('0x45')](handleError(_0x4ef9fe,null));};exports[_0x2895('0x4c')]=function(_0x3cc331,_0x11e53a){return db['UserProfile'][_0x2895('0x4c')](_0x3cc331[_0x2895('0x4d')],{})['then'](respondWithResult(_0x11e53a,0xc9))['catch'](handleError(_0x11e53a,null));};exports['clone']=function(_0x212a1f,_0xe552b6){var _0x3f17c3={'where':{'id':_0x212a1f[_0x2895('0x47')]['id']}},_0x1d2ab6={};_0x1d2ab6[_0x2895('0x32')]=_[_0x2895('0x34')](db[_0x2895('0x2d')][_0x2895('0x2e')]);_0x3f17c3[_0x2895('0x36')]=_[_0x2895('0x48')](_0x1d2ab6[_0x2895('0x32')],qs[_0x2895('0x37')](_0x212a1f[_0x2895('0x33')][_0x2895('0x37')]));_0x3f17c3[_0x2895('0x36')]=_0x3f17c3[_0x2895('0x36')][_0x2895('0x49')]?_0x3f17c3[_0x2895('0x36')]:_0x1d2ab6[_0x2895('0x32')];if(_0x212a1f[_0x2895('0x33')][_0x2895('0x4a')]){_0x3f17c3[_0x2895('0x42')]=[{'all':!![]}];}_0x3f17c3=_[_0x2895('0x40')]({},_0x3f17c3,_0x212a1f[_0x2895('0x41')]);return db[_0x2895('0x2d')][_0x2895('0x4b')](_0x3f17c3)[_0x2895('0x26')](handleEntityNotFound(_0xe552b6,null))[_0x2895('0x26')](function(_0x4128f1){if(_0x4128f1){var _0x6ea75f=_0x4128f1['get']({'plain':!![]});_0x6ea75f=qs[_0x2895('0x4e')](_0x6ea75f,['id',_0x2895('0x4f'),_0x2895('0x50'),_0x2895('0x51')]);_0x212a1f[_0x2895('0x4d')]=_[_0x2895('0x4e')](_0x212a1f['body'],['id',_0x2895('0x4f'),'updatedAt']);return db[_0x2895('0x52')][_0x2895('0x53')](function(_0x319795){return db[_0x2895('0x2d')][_0x2895('0x4c')](_['merge'](_0x6ea75f,_0x212a1f['body']),{'include':_0x212a1f[_0x2895('0x33')][_0x2895('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x319795})[_0x2895('0x26')](function(_0x5c76aa){var _0x258f69=_0x5c76aa['get']({'plain':!![]});return db[_0x2895('0x54')]['findAll']({'where':{'userProfileId':_0x212a1f['params']['id']},'raw':!![]})['then'](function(_0x58cfd6){if(_0x58cfd6){return BPromise[_0x2895('0x55')](_0x58cfd6,function(_0x2ff725){return new BPromise(function(_0x402e00,_0x4336c){if(_0x2ff725[_0x2895('0x56')]===null||_0x2ff725[_0x2895('0x56')]===0x1)_0x402e00(null);return db[_0x2895('0x57')]['findAll']({'where':{'sectionId':_0x2ff725['id']},'raw':!![]})[_0x2895('0x26')](function(_0x1e777d){var _0x5b742b=_[_0x2895('0x2c')](_0x1e777d,function(_0x59b6c3){return qs['omit'](_0x59b6c3,['id',_0x2895('0x4f'),_0x2895('0x50'),'sectionId']);});_0x402e00(_0x5b742b);})[_0x2895('0x45')](function(_0x3c5e32){_0x4336c(_0x3c5e32);});})[_0x2895('0x26')](function(_0x6a0c18){var _0x52616a=qs[_0x2895('0x4e')](_0x2ff725,['id','createdAt',_0x2895('0x50')]);_0x52616a['userProfileId']=_0x258f69['id'];if(_0x6a0c18)_0x52616a['Resources']=_0x6a0c18;return _0x52616a;})[_0x2895('0x26')](function(_0x58f96a){return db[_0x2895('0x54')][_0x2895('0x4c')](_0x58f96a,{'include':[{'model':db[_0x2895('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x319795});});})[_0x2895('0x26')](function(){return _0x258f69;});}});});});}})[_0x2895('0x26')](respondWithResult(_0xe552b6,0xc9))['catch'](handleError(_0xe552b6,null));};exports['update']=function(_0x147074,_0x347445){if(_0x147074['body']['id']){delete _0x147074[_0x2895('0x4d')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x147074[_0x2895('0x47')]['id']}})[_0x2895('0x26')](handleEntityNotFound(_0x347445,null))[_0x2895('0x26')](saveUpdates(_0x147074['body'],null))[_0x2895('0x26')](respondWithResult(_0x347445,null))[_0x2895('0x45')](handleError(_0x347445,null));};exports[_0x2895('0x27')]=function(_0x1fe575,_0x3ad06e){return db[_0x2895('0x2d')][_0x2895('0x4b')]({'where':{'id':_0x1fe575['params']['id']}})[_0x2895('0x26')](handleEntityNotFound(_0x3ad06e,null))[_0x2895('0x26')](removeEntity(_0x3ad06e,null))[_0x2895('0x45')](handleError(_0x3ad06e,null));};exports[_0x2895('0x58')]=function(_0x2d2753,_0x66fc7e){return db[_0x2895('0x2d')][_0x2895('0x58')]()['then'](respondWithResult(_0x66fc7e,null))[_0x2895('0x45')](handleError(_0x66fc7e,null));};exports[_0x2895('0x59')]=function(_0x16f369,_0x2288ff){var _0xb7d7e5=_0x16f369[_0x2895('0x4d')];return db[_0x2895('0x2d')][_0x2895('0x4b')]({'where':{'id':_0x16f369[_0x2895('0x47')]['id']}})[_0x2895('0x26')](handleEntityNotFound(_0x2288ff,null))['then'](function(_0x477385){if(_0x477385){return db[_0x2895('0x52')][_0x2895('0x53')](function(_0x29f677){return db[_0x2895('0x54')][_0x2895('0x27')]({'where':{'userProfileId':_0x16f369[_0x2895('0x47')]['id'],'sectionId':_[_0x2895('0x2c')](_0xb7d7e5,function(_0x203609){return _0x203609[_0x2895('0x5a')];})},'transaction':_0x29f677})['then'](function(){var _0x37824b=_[_0x2895('0x2c')](_0xb7d7e5,function(_0x40990a){_0x40990a[_0x2895('0x5b')]=_0x16f369[_0x2895('0x47')]['id'];return _0x40990a;});var _0x4f4931=[];return BPromise[_0x2895('0x55')](_0x37824b,function(_0x1ce803){return db['UserProfileSection']['create'](_0x1ce803,{'include':[{'model':db['UserProfileResource'],'as':_0x2895('0x5c')}],'raw':!![],'transaction':_0x29f677})[_0x2895('0x26')](function(_0x3c498f){_0x4f4931[_0x2895('0x5d')](_0x3c498f[_0x2895('0x5e')]({'plain':!![]}));});})['then'](function(){return _0x4f4931;});});});}})['then'](function(_0x2edb26){return _0x2edb26;})['then'](respondWithResult(_0x2288ff,null))[_0x2895('0x45')](handleError(_0x2288ff,null));};exports['removeSections']=function(_0x2f82a1,_0x3de634){var _0x51c182;return db[_0x2895('0x2d')][_0x2895('0x4b')]({'where':{'id':_0x2f82a1[_0x2895('0x47')]['id']},'attributes':['id',_0x2895('0x29')]})['then'](handleEntityNotFound(_0x3de634,null))['then'](function(_0x10ca0f){if(_0x10ca0f){_0x51c182=_0x10ca0f;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2f82a1[_0x2895('0x47')]['id'],'sectionId':_0x2f82a1[_0x2895('0x33')][_0x2895('0x5f')]}});}})[_0x2895('0x26')](function(){return _0x51c182;})['then'](respondWithStatusCode(_0x3de634,null))[_0x2895('0x45')](handleError(_0x3de634,null));};exports[_0x2895('0x60')]=function(_0x25c56a,_0x3721ff){var _0x8fcb17=[];var _0x45e80c=[];return db[_0x2895('0x54')][_0x2895('0x43')]({'where':{'userProfileId':_0x25c56a[_0x2895('0x47')]['id']},'raw':!![]})[_0x2895('0x26')](function(_0x3a6acc){_0x8fcb17=_[_0x2895('0x3d')](_0x3a6acc,function(_0x569d87){return _0x569d87[_0x2895('0x61')]===0x1||_[_0x2895('0x62')]([0x3eb,0x709],_0x569d87[_0x2895('0x5a')]);});if(!_['isEmpty'](_0x8fcb17)){return _[_0x2895('0x2c')](_0x8fcb17,function(_0x123bab){return _0x123bab['sectionId'];});}else{return;}})[_0x2895('0x26')](function(_0x1693b6){if(_0x1693b6)_0x45e80c=_0x1693b6;if(_[_0x2895('0x62')](_0x45e80c,0x64)){var _0x5c7fbb=_[_0x2895('0x4b')](_0x8fcb17,{'sectionId':0x64});return hasDefaultDashboard(_0x5c7fbb)[_0x2895('0x26')](function(_0x1774e8){return _[_0x2895('0x2c')](_0x8fcb17,function(_0x504a53){if(_0x504a53[_0x2895('0x5a')]===0x64){_0x504a53[_0x2895('0x63')]=_0x1774e8;}return _0x504a53;});});}else{return;}})[_0x2895('0x26')](function(_0x4aea3f){if(_0x4aea3f)_0x8fcb17=_0x4aea3f;if(_[_0x2895('0x62')](_0x45e80c,0x3eb)){var _0x4e2f47=_[_0x2895('0x4b')](_0x8fcb17,{'sectionId':0x3eb});return getCustomDashboards(_0x4e2f47)[_0x2895('0x26')](function(_0x38c93e){return _[_0x2895('0x2c')](_0x8fcb17,function(_0x570dd9){if(_0x4e2f47[_0x2895('0x61')]){if(_0x570dd9[_0x2895('0x5a')]===0x3eb){_0x570dd9[_0x2895('0x63')]=_0x38c93e;}}else{if(_0x570dd9['sectionId']===0x64){_0x570dd9[_0x2895('0x63')]=_0x38c93e;}}return _0x570dd9;});});}else{return;}})['then'](function(_0x2b8739){if(_0x2b8739)_0x8fcb17=_0x2b8739;if(_[_0x2895('0x62')](_0x45e80c,0x709)){var _0x4d3666=_['find'](_0x8fcb17,{'sectionId':0x709});return getPlugins(_0x4d3666)[_0x2895('0x26')](function(_0x2953ab){if(_0x4d3666['enabled']){return _[_0x2895('0x2c')](_0x8fcb17,function(_0x3ecb62){if(_0x3ecb62['sectionId']===0x709){_0x3ecb62[_0x2895('0x63')]=_0x2953ab;}return _0x3ecb62;});}else{var _0x2ca3a5={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2953ab};var _0x41812c=_[_0x2895('0x2c')](_0x8fcb17);_0x41812c[_0x2895('0x5d')](_0x2ca3a5);return _0x41812c;}});}else{return;}})['then'](function(_0x21c4c0){if(_0x21c4c0)_0x8fcb17=_0x21c4c0;return _[_0x2895('0x3d')](_0x8fcb17,[_0x2895('0x61'),0x1]);})[_0x2895('0x26')](respondWithResult(_0x3721ff,null))[_0x2895('0x45')](handleError(_0x3721ff,null));};function hasDefaultDashboard(_0x479270){var _0x3d414d=[0x65];return new BPromise(function(_0x289c14,_0x1b5a28){try{if(_0x479270[_0x2895('0x56')]){_0x289c14(_0x3d414d);}else{return db['UserProfileResource'][_0x2895('0x64')]({'where':{'sectionId':_0x479270['id']},'raw':!![]})[_0x2895('0x26')](function(_0x198c58){_0x198c58?_0x289c14(_0x3d414d):_0x289c14();});}}catch(_0x2dbd94){_0x1b5a28(_0x2dbd94);}});}function getCustomDashboards(_0x56b9ef){var _0x473b07=[];return new BPromise(function(_0x3ab611,_0x36e345){try{if(_0x56b9ef[_0x2895('0x56')]){return db[_0x2895('0x65')][_0x2895('0x43')]({'raw':!![]})['then'](function(_0x2bbca4){_0x2bbca4[_0x2895('0x66')](function(_0x2d20b3){_0x473b07['push'](_0x2d20b3['id']+0x1869f);});_0x3ab611(_0x473b07);});}else{return db['UserProfileResource'][_0x2895('0x43')]({'where':{'sectionId':_0x56b9ef['id']},'raw':!![]})[_0x2895('0x26')](function(_0x1fa0c5){_0x1fa0c5[_0x2895('0x66')](function(_0xc8a6e3){_0x473b07['push'](_0xc8a6e3[_0x2895('0x67')]+0x1869f);});_0x3ab611(_0x473b07);});}}catch(_0x837eef){_0x36e345(_0x837eef);}});}function getPlugins(_0x3f2e65){var _0x5da9af=[];return new BPromise(function(_0x5c0937,_0x32490a){try{if(_0x3f2e65[_0x2895('0x56')]){return db[_0x2895('0x68')]['findAll']({'raw':!![]})[_0x2895('0x26')](function(_0x4fe84e){_0x4fe84e[_0x2895('0x66')](function(_0x256a05){_0x5da9af['push'](_0x256a05['id']+0x15b38);});_0x5c0937(_0x5da9af);});}else{return db[_0x2895('0x57')][_0x2895('0x43')]({'where':{'sectionId':_0x3f2e65['id']},'raw':!![]})[_0x2895('0x26')](function(_0x3b9920){_0x3b9920[_0x2895('0x66')](function(_0x433a4b){_0x5da9af[_0x2895('0x5d')](_0x433a4b[_0x2895('0x67')]+0x15b38);});_0x5c0937(_0x5da9af);});}}catch(_0x2d6167){_0x32490a(_0x2d6167);}});}exports[_0x2895('0x69')]=function(_0x32baef,_0x3d2996){return db[_0x2895('0x2d')][_0x2895('0x4b')]({'where':{'id':_0x32baef['params']['id']}})['then'](handleEntityNotFound(_0x3d2996,null))['then'](function(_0x4f47e2){if(_0x4f47e2){return db[_0x2895('0x52')][_0x2895('0x53')](function(_0x44ac67){return db[_0x2895('0x54')][_0x2895('0x43')]({'where':{'userProfileId':_0x32baef[_0x2895('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x2895('0x26')](function(_0x26e451){if(_0x26e451){return db[_0x2895('0x54')][_0x2895('0x27')]({'where':{'userProfileId':_0x32baef[_0x2895('0x47')]['id'],'id':_[_0x2895('0x2c')](_0x26e451,function(_0xd7ddec){return _0xd7ddec['id'];})},'transaction':_0x44ac67});}})[_0x2895('0x26')](function(_0x4e271a){var _0x378743=_[_0x2895('0x2c')](_0x32baef[_0x2895('0x4d')],function(_0x5a651e){_0x5a651e['userProfileId']=_0x32baef[_0x2895('0x47')]['id'];return _0x5a651e;});return db[_0x2895('0x54')]['bulkCreate'](_0x378743,{'raw':!![],'transaction':_0x44ac67});})[_0x2895('0x26')](function(_0x58fca3){var _0x105daf=_[_0x2895('0x3d')](_[_0x2895('0x2c')](_0x58fca3,function(_0xe06543){return _0xe06543[_0x2895('0x5e')]({'plain':!![]});}),{'includeAll':![]});if(_0x105daf){return db[_0x2895('0x54')][_0x2895('0x43')]({'where':{'userProfileId':_0x32baef['params']['id'],'sectionId':_[_0x2895('0x2c')](_0x105daf,function(_0x31a00d){return _0x31a00d['sectionId'];})},'attributes':['id',_0x2895('0x5a')],'raw':!![]})[_0x2895('0x26')](function(_0x5297ec){var _0x1cf787=_[_0x2895('0x2c')](_0x32baef[_0x2895('0x4d')],function(_0x5399d9){_0x5399d9[_0x2895('0x5b')]=_0x32baef[_0x2895('0x47')]['id'];return _0x5399d9;});return db[_0x2895('0x57')][_0x2895('0x6a')](_0x1cf787,{'raw':!![],'transaction':_0x44ac67});});}})[_0x2895('0x45')](handleError(_0x3d2996,null));});}})[_0x2895('0x26')](function(_0x1bada9){var _0x3d3e82=_[_0x2895('0x2c')](_0x1bada9,function(_0x11b9ec){return _0x11b9ec['get']({'plain':!![]});});})[_0x2895('0x26')](respondWithResult(_0x3d2996,null))[_0x2895('0x45')](handleError(_0x3d2996,null));};exports[_0x2895('0x6b')]=function(_0x3a766d,_0x3ea24c,_0x335ff0){return db[_0x2895('0x2d')]['find']({'where':{'id':_0x3a766d[_0x2895('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ea24c,null))[_0x2895('0x26')](function(_0x590171){if(_0x590171){return _0x590171[_0x2895('0x6b')](_0x3a766d[_0x2895('0x33')][_0x2895('0x5f')]);}})[_0x2895('0x26')](respondWithStatusCode(_0x3ea24c,null))[_0x2895('0x45')](handleError(_0x3ea24c,null));};exports['getResources']=function(_0x3f024f,_0x1acec1){var _0x1f9a2a={};if(!_0x3f024f[_0x2895('0x33')][_0x2895('0x6c')])throw new Error(_0x2895('0x6d'));if(!_0x3f024f[_0x2895('0x33')]['hasOwnProperty'](_0x2895('0x39'))){_0x1f9a2a[_0x2895('0x1f')]=qs[_0x2895('0x1f')](_0x3f024f[_0x2895('0x33')]['limit']);_0x1f9a2a[_0x2895('0x1d')]=qs[_0x2895('0x1d')](_0x3f024f[_0x2895('0x33')]['offset']);}return db[_0x2895('0x2d')][_0x2895('0x4b')]({'where':{'id':_0x3f024f[_0x2895('0x47')]['id']}})[_0x2895('0x26')](function(_0x1dcc85){if(!_0x1dcc85)throw new Error(_0x2895('0x6e')+_0x3f024f[_0x2895('0x47')]['id']);return db[_0x2895('0x2d')][_0x2895('0x6f')](_0x3f024f);})[_0x2895('0x26')](respondWithFilteredResult(_0x1acec1,_0x1f9a2a))[_0x2895('0x45')](handleError(_0x1acec1,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 71bf51f..3721478 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 _0xb2ad=['hasOwnProperty','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x5cfaf5,_0x1c4530){var _0x30468e=function(_0x4b97ed){while(--_0x4b97ed){_0x5cfaf5['push'](_0x5cfaf5['shift']());}};_0x30468e(++_0x1c4530);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x37c841,_0x3820d9){_0x37c841=_0x37c841-0x0;var _0x585ae6=_0xb2ad[_0x37c841];return _0x585ae6;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xdb2a('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xdb2a('0x1')](0x0);var events={'afterCreate':_0xdb2a('0x2'),'afterUpdate':_0xdb2a('0x3'),'afterDestroy':_0xdb2a('0x4')};function emitEvent(_0xf8768){return function(_0x505753,_0x244b13,_0x23ada5){UserProfileEvents[_0xdb2a('0x5')](_0xf8768+':'+_0x505753['id'],_0x505753);UserProfileEvents[_0xdb2a('0x5')](_0xf8768,_0x505753);_0x23ada5(null);};}for(var e in events){if(events[_0xdb2a('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x82d8=['hasOwnProperty','hook','exports','events','UserProfile','update','emit'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x82d8,0xff));var _0x882d=function(_0x2acb5c,_0x10aba8){_0x2acb5c=_0x2acb5c-0x0;var _0x3a7933=_0x82d8[_0x2acb5c];return _0x3a7933;};'use strict';var EventEmitter=require(_0x882d('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x882d('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x882d('0x2'),'afterDestroy':'remove'};function emitEvent(_0xd91d36){return function(_0x5d3b3f,_0x5d0953,_0x25747e){UserProfileEvents[_0x882d('0x3')](_0xd91d36+':'+_0x5d3b3f['id'],_0x5d3b3f);UserProfileEvents[_0x882d('0x3')](_0xd91d36,_0x5d3b3f);_0x25747e(null);};}for(var e in events){if(events[_0x882d('0x4')](e)){var event=events[e];UserProfile[_0x882d('0x5')](e,emitEvent(event));}}module[_0x882d('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 91bdc4f..1fbbaba 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 _0x187d=['chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','membername','Telephones','User','telephone','queue','type','inbound','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','VoiceQueue','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','trunks','Trunk','Variable','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','union','ignore','push','rawAttributes','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','autoAssociation','include','reportType','DefaultReports','custom','count','rows','Tags','color','tag','ThroughTags','openTabs','true','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','name','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','SquareProject','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue'];(function(_0x1f591d,_0x3e63d5){var _0x4b1d3b=function(_0x312a89){while(--_0x312a89){_0x1f591d['push'](_0x1f591d['shift']());}};_0x4b1d3b(++_0x3e63d5);}(_0x187d,0x93));var _0xd187=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x187d[_0xbe200f];return _0x192597;};'use strict';var _=require(_0xd187('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xd187('0x1'));var squel=require(_0xd187('0x2'));module[_0xd187('0x3')]=function(_0x1cb41f){var _0x18498b=_0x1cb41f[_0xd187('0x4')];function _0x58622a(_0x28fa0b,_0x163807){return new Promise(function(_0x4ebc8d,_0x1d2533){if(!_0x163807)return _0x4ebc8d(null);var _0x58ee7=_0x163807[_0xd187('0x5')]?{[_0x163807[_0xd187('0x5')][_0xd187('0x6')]]:_0x163807[_0xd187('0x5')][_0xd187('0x7')]}:undefined;return _0x18498b[_0x28fa0b][_0xd187('0x8')]({'where':_0x58ee7,'raw':!![]})['then'](function(_0x342539){_0x163807[_0xd187('0x9')]=_[_0xd187('0xa')](_0x342539,'id');_0x4ebc8d(_0x163807);})[_0xd187('0xb')](function(_0x33ca45){_0x1d2533(_0x33ca45);});});}function _0x2a61a4(_0x59c194,_0x10d467){return new Promise(function(_0x412ccf,_0x18237b){var _0x5e6180=_0x59c194[_0xd187('0x5')]?{[_0x59c194[_0xd187('0x5')][_0xd187('0x6')]]:_0x59c194['filter'][_0xd187('0x7')]}:undefined;return _0x18498b[_0x59c194[_0xd187('0xc')]][_0xd187('0x8')]({'where':_0x5e6180,'raw':!![]})[_0xd187('0xd')](function(_0x517b25){_0x10d467[_0xd187('0x9')]=_[_0xd187('0xa')](_0x517b25,function(_0x45ab10){return _0x45ab10[_0xd187('0xe')];});_0x412ccf(_0x10d467);})['catch'](function(_0x245d3e){_0x18237b(_0x245d3e);});});}function _0x52a208(_0x5cf218,_0x40ed84,_0x5a4986){if(!_0x40ed84)return Promise['resolve'](null);return new Promise(function(_0x207b36,_0x2b3290){return _0x18498b[_0xd187('0xf')][_0xd187('0x8')]({'where':{'sectionId':_0x40ed84['id']},'raw':!![]})[_0xd187('0xd')](function(_0x253a7e){if(_0x5cf218[_0xd187('0x6')]&&_0x5cf218[_0xd187('0x6')]!=='id'){_0x40ed84[_0xd187('0x9')]=_[_0xd187('0xa')](_0x253a7e,function(_0x170d5c){return _0x170d5c[_0x5cf218[_0xd187('0x6')]];});}else{if(_0x5a4986===_0xd187('0x10')){_0x40ed84['associatedResources']=_[_0xd187('0xa')](_0x253a7e,function(_0x81b988){return{'id':_0x81b988[_0xd187('0x11')],'type':_0x81b988['type']};});}else{_0x40ed84['associatedResources']=_['map'](_0x253a7e,function(_0x435d94){return _0x435d94[_0xd187('0x11')];});}}_0x207b36(_0x40ed84);})[_0xd187('0xb')](function(_0x4f62c8){_0x2b3290(_0x4f62c8);});});}function _0x2c07c8(_0x57186b,_0x145771){var _0x5a7a23={'parentSections':[]};switch(_0x57186b[_0xd187('0x12')]()){case'squareprojects':_0x5a7a23['childModel']=_0xd187('0x13');break;case'odbc':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x15');break;case'squarerecordings':_0x5a7a23['childModel']=_0xd187('0x16');_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x18'),'field':_0xd187('0xe'),'foreignKey':'projectName'}];break;case _0xd187('0x19'):_0x5a7a23[_0xd187('0x14')]='JscriptyProject';break;case _0xd187('0x1a'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1b');_0x5a7a23['parentSections']=[{'name':_0xd187('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xd187('0x1d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x1e');break;case _0xd187('0x1f'):_0x5a7a23['childModel']=_0xd187('0x20');break;case _0xd187('0x21'):_0x5a7a23['childModel']='CmCustomField';break;case _0xd187('0x22'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x23');break;case _0xd187('0x24'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x25');break;case _0xd187('0x26'):_0x5a7a23[_0xd187('0x14')]='FaxQueue';break;case _0xd187('0x27'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x28');break;case'inboundroutes':case _0xd187('0x29'):case'outboundroutes':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2a');break;case _0xd187('0x2b'):_0x5a7a23['childModel']='VoiceContext';break;case _0xd187('0x2c'):_0x5a7a23[_0xd187('0x14')]='VoiceMail';break;case _0xd187('0x2d'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x2e');_0x5a7a23['parentSections']=[{'name':'Agents','field':_0xd187('0xe'),'foreignKey':_0xd187('0x2f'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':_0xd187('0x30'),'field':'name','foreignKey':_0xd187('0x2f'),'model':_0xd187('0x31'),'filter':{'field':'role','value':[_0xd187('0x32')]}},{'name':'VoiceQueues','field':_0xd187('0xe'),'foreignKey':_0xd187('0x33'),'model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x35')]}},{'name':'QueueCampaigns','field':_0xd187('0xe'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xd187('0x34'),'value':[_0xd187('0x36')]}}];break;case _0xd187('0x37'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x38');break;case'chanspies':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x39');break;case _0xd187('0x3a'):_0x5a7a23['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x5a7a23['childModel']=_0xd187('0x3b');break;case _0xd187('0x3c'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3d');break;case _0xd187('0x3e'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x3f');break;case _0xd187('0x40'):_0x5a7a23['childModel']=_0xd187('0x41');break;case _0xd187('0x42'):_0x5a7a23[_0xd187('0x14')]='OpenchannelQueue';break;case _0xd187('0x43'):_0x5a7a23['childModel']=_0xd187('0x44');break;case _0xd187('0x45'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x46');break;case _0xd187('0x47'):_0x5a7a23['childModel']=_0xd187('0x48');break;case _0xd187('0x49'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4a');break;case'whatsappaccounts':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4b');break;case'teams':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4c');break;case'voicequeues':case'queuecampaigns':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x4d');if(_0x145771){_0x5a7a23['parentSections']=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xd187('0x4e'):case _0xd187('0x4f'):case _0xd187('0x50'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x31');if(_0x145771){_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x51'),'filter':{'field':'role','value':[_0xd187('0x52'),_0xd187('0x53')]},'ignore':!![]},{'name':_0xd187('0x54')},{'name':_0xd187('0x30')}];}break;case _0xd187('0x55'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x56');break;case _0xd187('0x57'):_0x5a7a23['childModel']=_0xd187('0x58');break;case _0xd187('0x59'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x5a');break;case _0xd187('0x5b'):_0x5a7a23['childModel']=_0xd187('0x5c');break;case _0xd187('0x5d'):_0x5a7a23['childModel']=_0xd187('0x5e');break;case _0xd187('0x5f'):_0x5a7a23['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x5a7a23['childModel']=_0xd187('0x31');break;case _0xd187('0x60'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x61');break;case _0xd187('0x62'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x63');break;case'customdashboards':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x64');break;case _0xd187('0x65'):_0x5a7a23[_0xd187('0x14')]='Interval';break;case _0xd187('0x66'):_0x5a7a23['childModel']='Pause';break;case _0xd187('0x67'):_0x5a7a23['childModel']=_0xd187('0x68');break;case _0xd187('0x69'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6a');break;case _0xd187('0x6b'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x6c');break;case _0xd187('0x6d'):_0x5a7a23[_0xd187('0x14')]='Template';break;case _0xd187('0x6e'):_0x5a7a23[_0xd187('0x14')]='Trigger';break;case _0xd187('0x6f'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x70');break;case'variables':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x71');break;case'plugins':_0x5a7a23[_0xd187('0x14')]=_0xd187('0x72');break;case'extractedreports':_0x5a7a23[_0xd187('0x14')]='AnalyticExtractedReport';_0x5a7a23[_0xd187('0x17')]=[{'name':_0xd187('0x73'),'field':'id','foreignKey':_0xd187('0x74')}];break;case _0xd187('0x75'):_0x5a7a23[_0xd187('0x14')]=_0xd187('0x76');break;}return _0x5a7a23;}function _0x1675d9(_0x4eddd5,_0xcef6ca){var _0x298b46=_0x4eddd5[_0xd187('0x77')](0x0)['toUpperCase']()+_0x4eddd5[_0xd187('0x78')](0x1);var _0x23428f={'type':_0x18498b[_0xd187('0x79')][_0xd187('0x7a')][_0xd187('0x7b')],'raw':!![]};return new Promise(function(_0x2c4f4d,_0x10ebf4){var _0x202f73=squel[_0xd187('0x7c')]()[_0xd187('0x6')](_0xd187('0x7d')+_0x298b46+_0xd187('0x7e'),'id')[_0xd187('0x6')](_0xd187('0x7f'))[_0xd187('0x80')](_0xd187('0x81')+_0x4eddd5+_0xd187('0x82'),'ui')[_0xd187('0x83')](_0xd187('0x84'),_0xcef6ca['id']);return _0x18498b[_0xd187('0x85')]['query'](_0x202f73[_0xd187('0x86')](),_0x23428f)['then'](function(_0x13d118){_0xcef6ca[_0x298b46+_0xd187('0x87')]=_0x13d118;_0x2c4f4d(_0x13d118);})[_0xd187('0xb')](function(_0x4225e6){_0x10ebf4(_0x4225e6);});});}return _0x1cb41f['define'](_0xd187('0x88'),attributes,{'tableName':_0xd187('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f89a6){var _0x509815={'raw':![],'where':{}};var _0x3613ee={};var _0x2c2a62={'count':0x0,'rows':[]};var _0x2870ad=_0x4f89a6[_0xd187('0x8a')]['section'];var _0x2c1df4=_0x4f89a6['query'][_0xd187('0x8b')]||![];var _0x2f6a72=_0x2c07c8(_0x2870ad,_0x2c1df4);if(!_0x2f6a72[_0xd187('0x14')])throw new Error(_0xd187('0x8c')+_0x2870ad+'\x27');var _0x57cad7=[{'name':_0x2870ad}];if(!_[_0xd187('0x8d')](_0x2f6a72[_0xd187('0x17')]))_0x57cad7=_0x2f6a72[_0xd187('0x17')];var _0x9e82c=[];for(var _0x151f3c=0x0;_0x151f3c<_0x57cad7['length'];_0x151f3c++){_0x9e82c['push'](_0x18498b[_0xd187('0x8e')][_0xd187('0x8f')]({'where':{'userProfileId':_0x4f89a6[_0xd187('0x90')]['id'],'name':_0x57cad7[_0x151f3c][_0xd187('0xe')]},'raw':!![]}));}return Promise[_0xd187('0x91')](_0x9e82c)[_0xd187('0xd')](function(_0x2dccff){var _0x1291cc=_[_0xd187('0x5')](_0x2dccff,function(_0x3765b0){return _0x3765b0?_0x3765b0:undefined;});var _0x379e89=_[_0xd187('0x5')](_0x57cad7,['ignore',!![]]);var _0x35df1e=_[_0xd187('0x8d')](_0x1291cc)&&_['isEmpty'](_0x379e89)?null:_[_0xd187('0x92')](_0x379e89,_0x1291cc);if(!_0x35df1e)return null;var _0x1a9979=[];for(var _0x4bec3e=0x0;_0x4bec3e<_0x35df1e['length'];_0x4bec3e++){var _0x32ba2a=_[_0xd187('0x8f')](_0x57cad7,function(_0x2ac56f){return _0x35df1e[_0x4bec3e]?_0x2ac56f[_0xd187('0xe')]===_0x35df1e[_0x4bec3e]['name']:null;});if(_0x32ba2a){if(_0x35df1e[_0x4bec3e][_0xd187('0x93')]){_0x1a9979[_0xd187('0x94')](_0x58622a(_0x2f6a72['childModel'],_0x35df1e[_0x4bec3e]));}else{if(!_0x35df1e[_0x4bec3e]['autoAssociation']){_0x1a9979[_0xd187('0x94')](_0x52a208(_0x32ba2a,_0x35df1e[_0x4bec3e],_0x2f6a72['childModel']));}else{if(_0x32ba2a[_0xd187('0xc')]){_0x1a9979[_0xd187('0x94')](_0x2a61a4(_0x32ba2a,_0x35df1e[_0x4bec3e]));}}}}}return Promise['all'](_0x1a9979);})[_0xd187('0xd')](function(_0x570c1c){var _0x317bc3=_0x570c1c;var _0x4f2875=null;if(_0x317bc3){_0x4f2875=_0x317bc3['length']===0x1?_0x317bc3[0x0]:null;}if(!_0x4f2875&&!_0x317bc3)return _0x2c2a62;var _0x4a1988=_0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x95')];_0x3613ee[_0xd187('0xc')]=_[_0xd187('0x96')](_0x4a1988);_0x3613ee[_0xd187('0x8a')]=_[_0xd187('0x96')](_0x4f89a6[_0xd187('0x8a')]);_0x3613ee[_0xd187('0x97')]=_['intersection'](_0x3613ee[_0xd187('0xc')],_0x3613ee[_0xd187('0x8a')]);_0x509815[_0xd187('0x98')]=_['intersection'](_0x3613ee[_0xd187('0xc')],qs[_0xd187('0x99')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0x99')]));_0x509815['attributes']=_0x509815[_0xd187('0x98')][_0xd187('0x9a')]?_0x509815['attributes']:_0x3613ee[_0xd187('0xc')];if(!_0x4f89a6[_0xd187('0x8a')][_0xd187('0x9b')](_0xd187('0x9c'))){_0x509815['limit']=qs[_0xd187('0x9d')](_0x4f89a6[_0xd187('0x8a')]['limit']);_0x509815[_0xd187('0x9e')]=qs['offset'](_0x4f89a6['query']['offset']);}_0x509815[_0xd187('0x9f')]=qs[_0xd187('0xa0')](_0x4f89a6[_0xd187('0x8a')][_0xd187('0xa0')]);_0x509815[_0xd187('0x83')]=qs[_0xd187('0x97')](_['pick'](_0x4f89a6[_0xd187('0x8a')],_0x3613ee[_0xd187('0x97')]));if(_0x4f89a6['query']['filter']){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$or':_[_0xd187('0xa')](_0x4a1988,function(_0x3fe450){if(_0x3fe450[_0xd187('0x34')]['key']!==_0xd187('0xa2')){var _0x134cc2={};_0x134cc2[_0x3fe450[_0xd187('0x6')]]={'$like':'%'+_0x4f89a6[_0xd187('0x8a')][_0xd187('0x5')]+'%'};return _0x134cc2;}})});}var _0x2879ff=[];var _0x1982cd=null;var _0x1e58d4={};if(_0x4f2875){_0x1982cd=_[_0xd187('0x8f')](_0x57cad7,[_0xd187('0xe'),_0x4f2875[_0xd187('0xe')]]);if(_0x1982cd[_0xd187('0x6')]){_0x1e58d4={};if(_0x2f6a72['childModel']==='AnalyticExtractedReport'){_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_[_0xd187('0xa')](_0x4f2875[_0xd187('0x9')],'id');}else{_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x4f2875[_0xd187('0x9')];}_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{_0x509815['where']['id']=_0x4f2875[_0xd187('0x9')];}}else{for(var _0x5541ef=0x0;_0x5541ef<_0x317bc3[_0xd187('0x9a')];_0x5541ef++){_0x1982cd=_['find'](_0x57cad7,['name',_0x317bc3[_0x5541ef][_0xd187('0xe')]]);if(_0x1982cd['field']){_0x1e58d4={};_0x1e58d4[_0x1982cd[_0xd187('0xa3')]]=_0x317bc3[_0x5541ef][_0xd187('0x9')];_0x2879ff[_0xd187('0x94')](_0x1e58d4);}else{if(!_0x509815[_0xd187('0x83')]['id'])_0x509815[_0xd187('0x83')]['id']=[];_0x317bc3[_0x5541ef][_0xd187('0x9')][_0xd187('0xa4')](function(_0x37fd5a){_0x509815[_0xd187('0x83')]['id'][_0xd187('0x94')](_0x37fd5a);});}}}if(!_[_0xd187('0x8d')](_0x2879ff)){_0x509815[_0xd187('0x83')]=_[_0xd187('0xa1')](_0x509815[_0xd187('0x83')],{'$and':{'$or':_0x2879ff}});}_0x509815=_[_0xd187('0xa1')]({},_0x509815,_0x4f89a6['options']);if(_0x4f2875&&!_0x4f2875[_0xd187('0xa5')]&&_0x2f6a72[_0xd187('0x14')]===_0xd187('0x10')){if(_0x4f89a6[_0xd187('0x8a')]['includeAll']){_0x509815[_0xd187('0xa6')]=[{'all':!![]}];}return _0x18498b[_0x2f6a72[_0xd187('0x14')]]['findAll'](_0x509815)['then'](function(_0x20b680){var _0x3c993a=[];_0x20b680[_0xd187('0xa4')](function(_0x435fe8){var _0x371869;switch(_0x435fe8[_0xd187('0xa7')]){case'default':_0x371869=_[_0xd187('0x8f')](_0x4f2875[_0xd187('0x9')],function(_0x5b7870){return _0x5b7870['id']===_0x435fe8[_0xd187('0x74')]&&_0x5b7870[_0xd187('0x34')]===_0xd187('0xa8');});break;case _0xd187('0xa9'):_0x371869=_['find'](_0x4f2875['associatedResources'],function(_0x18d48d){return _0x18d48d['id']===_0x435fe8[_0xd187('0x74')]&&_0x18d48d[_0xd187('0x34')]==='CustomReports';});break;}if(_0x371869)_0x3c993a[_0xd187('0x94')](_0x435fe8);});_0x2c2a62[_0xd187('0xaa')]=_0x3c993a[_0xd187('0x9a')];_0x2c2a62[_0xd187('0xab')]=_0x3c993a;return _0x2c2a62;});}else{return _0x18498b[_0x2f6a72['childModel']][_0xd187('0xaa')]({'where':_0x509815['where']})['then'](function(_0x4a9310){_0x2c2a62['count']=_0x4a9310;if(_0x4f89a6['query']['includeAll']){if(_0x2f6a72['childModel']===_0xd187('0x1b')){_0x509815[_0xd187('0xa6')]=[{'model':_0x18498b['Tag'],'as':_0xd187('0xac'),'attributes':['id',_0xd187('0xe'),_0xd187('0xad')],'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]},{'model':_0x18498b['Tag'],'as':_0xd187('0xaf'),'attributes':['id','name',_0xd187('0xad')],'through':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?{'attributes':[],'where':{'TagId':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]||undefined}}:{},'required':_0x4f89a6[_0xd187('0x8a')][_0xd187('0xae')]?!![]:![]}];}else{_0x509815['include']=[{'all':!![]}];}}return _0x18498b[_0x2f6a72[_0xd187('0x14')]][_0xd187('0x8')](_0x509815);})['then'](function(_0x2afb14){_0x2c2a62[_0xd187('0xab')]=_0x2afb14;if(_0x2870ad==='Agents'&&_0x4f89a6[_0xd187('0x8a')][_0xd187('0xb0')]===_0xd187('0xb1')){var _0x45b522=[];for(var _0x78604d=0x0;_0x78604d<_0x2c2a62[_0xd187('0xab')][_0xd187('0x9a')];_0x78604d++){_0x45b522[_0xd187('0x94')](_0x1675d9('chat',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb3'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9('fax',_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522['push'](_0x1675d9(_0xd187('0xb4'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb5'),_0x2c2a62[_0xd187('0xab')][_0x78604d]['dataValues']));_0x45b522[_0xd187('0x94')](_0x1675d9(_0xd187('0xb6'),_0x2c2a62[_0xd187('0xab')][_0x78604d][_0xd187('0xb2')]));}return Promise[_0xd187('0x91')](_0x45b522)[_0xd187('0xd')](function(){return _0x2c2a62;});}return _0x2c2a62;});}});}}});}; \ No newline at end of file +var _0x71ab=['whatsappaccounts','teams','Team','voicequeues','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','ui.','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','section','mergeResources','isEmpty','length','find','params','all','union','autoAssociation','push','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','merge','key','forEach','options','include','DefaultReports','CustomReports','count','rows','includeAll','color','ThroughTags','tag','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','./userProfile.attributes','squel','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','UserProfileResource','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','User','agent','role','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue'];(function(_0x20780a,_0x3d011e){var _0x1327ff=function(_0x5c939a){while(--_0x5c939a){_0x20780a['push'](_0x20780a['shift']());}};_0x1327ff(++_0x3d011e);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var attributes=require(_0xb71a('0x0'));var qs=require('../../components/parsers/qs');var squel=require(_0xb71a('0x1'));module['exports']=function(_0x3e985a){var _0x3f0529=_0x3e985a[_0xb71a('0x2')];function _0x4094b2(_0x37ce74,_0x3c6438){return new Promise(function(_0x2192e8,_0x38d931){if(!_0x3c6438)return _0x2192e8(null);var _0x22c072=_0x3c6438[_0xb71a('0x3')]?{[_0x3c6438[_0xb71a('0x3')][_0xb71a('0x4')]]:_0x3c6438[_0xb71a('0x3')][_0xb71a('0x5')]}:undefined;return _0x3f0529[_0x37ce74][_0xb71a('0x6')]({'where':_0x22c072,'raw':!![]})[_0xb71a('0x7')](function(_0x378c96){_0x3c6438[_0xb71a('0x8')]=_['map'](_0x378c96,'id');_0x2192e8(_0x3c6438);})[_0xb71a('0x9')](function(_0x58956d){_0x38d931(_0x58956d);});});}function _0x3d7bd7(_0x343d2f,_0x24f5fd){return new Promise(function(_0x591311,_0x3909b4){var _0x4c167a=_0x343d2f[_0xb71a('0x3')]?{[_0x343d2f['filter']['field']]:_0x343d2f[_0xb71a('0x3')][_0xb71a('0x5')]}:undefined;return _0x3f0529[_0x343d2f[_0xb71a('0xa')]][_0xb71a('0x6')]({'where':_0x4c167a,'raw':!![]})['then'](function(_0x47ee48){_0x24f5fd['associatedResources']=_[_0xb71a('0xb')](_0x47ee48,function(_0xc189cd){return _0xc189cd[_0xb71a('0xc')];});_0x591311(_0x24f5fd);})[_0xb71a('0x9')](function(_0x3cd0f0){_0x3909b4(_0x3cd0f0);});});}function _0x1e9363(_0x31def2,_0x2ec64a,_0x7710a8){if(!_0x2ec64a)return Promise['resolve'](null);return new Promise(function(_0x1ca65e,_0x2d6369){return _0x3f0529[_0xb71a('0xd')][_0xb71a('0x6')]({'where':{'sectionId':_0x2ec64a['id']},'raw':!![]})[_0xb71a('0x7')](function(_0xf83e73){if(_0x31def2[_0xb71a('0x4')]&&_0x31def2[_0xb71a('0x4')]!=='id'){_0x2ec64a[_0xb71a('0x8')]=_[_0xb71a('0xb')](_0xf83e73,function(_0x16394a){return _0x16394a[_0x31def2['field']];});}else{if(_0x7710a8==='AnalyticExtractedReport'){_0x2ec64a[_0xb71a('0x8')]=_[_0xb71a('0xb')](_0xf83e73,function(_0x4a4f4e){return{'id':_0x4a4f4e['resourceId'],'type':_0x4a4f4e[_0xb71a('0xe')]};});}else{_0x2ec64a['associatedResources']=_[_0xb71a('0xb')](_0xf83e73,function(_0x4227c7){return _0x4227c7[_0xb71a('0xf')];});}}_0x1ca65e(_0x2ec64a);})[_0xb71a('0x9')](function(_0x38a728){_0x2d6369(_0x38a728);});});}function _0x14b2a1(_0x2f4fac,_0x14aac7){var _0x5f3f19={'parentSections':[]};switch(_0x2f4fac[_0xb71a('0x10')]()){case _0xb71a('0x11'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x13');break;case _0xb71a('0x14'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x15');break;case _0xb71a('0x16'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x17');_0x5f3f19[_0xb71a('0x18')]=[{'name':_0xb71a('0x19'),'field':_0xb71a('0xc'),'foreignKey':'projectName'}];break;case _0xb71a('0x1a'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x1b');break;case _0xb71a('0x1c'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x1d');_0x5f3f19[_0xb71a('0x18')]=[{'name':_0xb71a('0x1e'),'field':'id','foreignKey':_0xb71a('0x1f')}];break;case _0xb71a('0x20'):_0x5f3f19[_0xb71a('0x12')]='CmList';break;case'companies':_0x5f3f19[_0xb71a('0x12')]='CmCompany';break;case _0xb71a('0x21'):_0x5f3f19[_0xb71a('0x12')]='CmCustomField';break;case _0xb71a('0x22'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x23');break;case _0xb71a('0x24'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x25');break;case'faxqueues':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x26');break;case _0xb71a('0x27'):_0x5f3f19[_0xb71a('0x12')]='FaxAccount';break;case _0xb71a('0x28'):case _0xb71a('0x29'):case _0xb71a('0x2a'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x2b');break;case _0xb71a('0x2c'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x2d');break;case _0xb71a('0x2e'):_0x5f3f19[_0xb71a('0x12')]='VoiceMail';break;case'voicerecordings':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x2f');_0x5f3f19[_0xb71a('0x18')]=[{'name':_0xb71a('0x30'),'field':_0xb71a('0xc'),'foreignKey':_0xb71a('0x31'),'model':_0xb71a('0x32'),'filter':{'field':'role','value':[_0xb71a('0x33')]}},{'name':'Telephones','field':_0xb71a('0xc'),'foreignKey':_0xb71a('0x31'),'model':_0xb71a('0x32'),'filter':{'field':_0xb71a('0x34'),'value':['telephone']}},{'name':_0xb71a('0x35'),'field':_0xb71a('0xc'),'foreignKey':_0xb71a('0x36'),'model':_0xb71a('0x37'),'filter':{'field':_0xb71a('0xe'),'value':[_0xb71a('0x38')]}},{'name':_0xb71a('0x39'),'field':_0xb71a('0xc'),'foreignKey':_0xb71a('0x36'),'model':'VoiceQueue','filter':{'field':_0xb71a('0xe'),'value':['outbound']}}];break;case _0xb71a('0x3a'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x3b');break;case _0xb71a('0x3c'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x3d');break;case'voiceprefixes':_0x5f3f19['childModel']='VoicePrefix';break;case _0xb71a('0x3e'):_0x5f3f19['childModel']=_0xb71a('0x3f');break;case _0xb71a('0x40'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x41');break;case _0xb71a('0x42'):_0x5f3f19[_0xb71a('0x12')]='MailAccount';break;case _0xb71a('0x43'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x44');break;case _0xb71a('0x45'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x46');break;case'openchannelaccounts':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x47');break;case _0xb71a('0x48'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x49');break;case _0xb71a('0x4a'):_0x5f3f19[_0xb71a('0x12')]='SmsAccount';break;case'whatsappqueues':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x4b');break;case _0xb71a('0x4c'):_0x5f3f19[_0xb71a('0x12')]='WhatsappAccount';break;case _0xb71a('0x4d'):_0x5f3f19['childModel']=_0xb71a('0x4e');break;case _0xb71a('0x4f'):case'queuecampaigns':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x37');if(_0x14aac7){_0x5f3f19[_0xb71a('0x18')]=[{'name':_0xb71a('0x35')},{'name':'QueueCampaigns'}];}break;case _0xb71a('0x50'):case _0xb71a('0x51'):case _0xb71a('0x52'):_0x5f3f19['childModel']=_0xb71a('0x32');if(_0x14aac7){_0x5f3f19[_0xb71a('0x18')]=[{'name':_0xb71a('0x53'),'filter':{'field':'role','value':[_0xb71a('0x54'),_0xb71a('0x55')]},'ignore':!![]},{'name':_0xb71a('0x30')},{'name':_0xb71a('0x56')}];}break;case _0xb71a('0x57'):_0x5f3f19['childModel']=_0xb71a('0x58');break;case _0xb71a('0x59'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x5a');break;case'freshdeskaccounts':_0x5f3f19['childModel']=_0xb71a('0x5b');break;case _0xb71a('0x5c'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x5d');break;case _0xb71a('0x5e'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x5f');break;case _0xb71a('0x60'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x61');break;case'vtigeraccounts':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x32');break;case'cannedanswers':_0x5f3f19[_0xb71a('0x12')]='CannedAnswer';break;case _0xb71a('0x62'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x63');break;case _0xb71a('0x64'):_0x5f3f19[_0xb71a('0x12')]='Dashboard';break;case _0xb71a('0x65'):_0x5f3f19['childModel']=_0xb71a('0x66');break;case _0xb71a('0x67'):_0x5f3f19['childModel']='Pause';break;case _0xb71a('0x68'):_0x5f3f19[_0xb71a('0x12')]='Schedule';break;case'sounds':_0x5f3f19['childModel']=_0xb71a('0x69');break;case'tags':_0x5f3f19['childModel']=_0xb71a('0x6a');break;case _0xb71a('0x6b'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x6c');break;case'triggers':_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x6d');break;case _0xb71a('0x6e'):_0x5f3f19['childModel']=_0xb71a('0x6f');break;case _0xb71a('0x70'):_0x5f3f19['childModel']=_0xb71a('0x71');break;case _0xb71a('0x72'):_0x5f3f19[_0xb71a('0x12')]='Plugin';break;case _0xb71a('0x73'):_0x5f3f19['childModel']=_0xb71a('0x74');_0x5f3f19[_0xb71a('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0xb71a('0x75')}];break;case _0xb71a('0x76'):_0x5f3f19[_0xb71a('0x12')]=_0xb71a('0x77');break;}return _0x5f3f19;}function _0x41a1fc(_0x3b6762,_0x3dfd97){var _0x535ab6=_0x3b6762['charAt'](0x0)[_0xb71a('0x78')]()+_0x3b6762[_0xb71a('0x79')](0x1);var _0x2cf6a3={'type':_0x3f0529[_0xb71a('0x7a')][_0xb71a('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x5a45df,_0x6ceada){var _0xc931ab=squel['select']()[_0xb71a('0x4')](_0xb71a('0x7c')+_0x535ab6+'InteractionId','id')[_0xb71a('0x4')](_0xb71a('0x7d'))[_0xb71a('0x7e')](_0xb71a('0x7f')+_0x3b6762+'_interactions','ui')[_0xb71a('0x80')](_0xb71a('0x81'),_0x3dfd97['id']);return _0x3f0529['sequelize'][_0xb71a('0x82')](_0xc931ab[_0xb71a('0x83')](),_0x2cf6a3)[_0xb71a('0x7')](function(_0x2881a3){_0x3dfd97[_0x535ab6+_0xb71a('0x84')]=_0x2881a3;_0x5a45df(_0x2881a3);})[_0xb71a('0x9')](function(_0x288862){_0x6ceada(_0x288862);});});}return _0x3e985a[_0xb71a('0x85')]('UserProfile',attributes,{'tableName':_0xb71a('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3a5431){var _0x526065={'raw':![],'where':{}};var _0x41fe0c={};var _0x2dbaa2={'count':0x0,'rows':[]};var _0x52fac6=_0x3a5431[_0xb71a('0x82')][_0xb71a('0x87')];var _0x10b715=_0x3a5431[_0xb71a('0x82')][_0xb71a('0x88')]||![];var _0x1c4160=_0x14b2a1(_0x52fac6,_0x10b715);if(!_0x1c4160['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x52fac6+'\x27');var _0x248c74=[{'name':_0x52fac6}];if(!_[_0xb71a('0x89')](_0x1c4160[_0xb71a('0x18')]))_0x248c74=_0x1c4160['parentSections'];var _0xe93fd=[];for(var _0x5e58f7=0x0;_0x5e58f7<_0x248c74[_0xb71a('0x8a')];_0x5e58f7++){_0xe93fd['push'](_0x3f0529['UserProfileSection'][_0xb71a('0x8b')]({'where':{'userProfileId':_0x3a5431[_0xb71a('0x8c')]['id'],'name':_0x248c74[_0x5e58f7][_0xb71a('0xc')]},'raw':!![]}));}return Promise[_0xb71a('0x8d')](_0xe93fd)[_0xb71a('0x7')](function(_0x4eca80){var _0x2b758b=_['filter'](_0x4eca80,function(_0x1adf18){return _0x1adf18?_0x1adf18:undefined;});var _0x312e46=_[_0xb71a('0x3')](_0x248c74,['ignore',!![]]);var _0x4d9dc8=_[_0xb71a('0x89')](_0x2b758b)&&_[_0xb71a('0x89')](_0x312e46)?null:_[_0xb71a('0x8e')](_0x312e46,_0x2b758b);if(!_0x4d9dc8)return null;var _0x3e2c72=[];for(var _0x9eff28=0x0;_0x9eff28<_0x4d9dc8['length'];_0x9eff28++){var _0x210fa0=_[_0xb71a('0x8b')](_0x248c74,function(_0x1063ab){return _0x4d9dc8[_0x9eff28]?_0x1063ab[_0xb71a('0xc')]===_0x4d9dc8[_0x9eff28][_0xb71a('0xc')]:null;});if(_0x210fa0){if(_0x4d9dc8[_0x9eff28]['ignore']){_0x3e2c72['push'](_0x4094b2(_0x1c4160[_0xb71a('0x12')],_0x4d9dc8[_0x9eff28]));}else{if(!_0x4d9dc8[_0x9eff28][_0xb71a('0x8f')]){_0x3e2c72[_0xb71a('0x90')](_0x1e9363(_0x210fa0,_0x4d9dc8[_0x9eff28],_0x1c4160[_0xb71a('0x12')]));}else{if(_0x210fa0[_0xb71a('0xa')]){_0x3e2c72[_0xb71a('0x90')](_0x3d7bd7(_0x210fa0,_0x4d9dc8[_0x9eff28]));}}}}}return Promise[_0xb71a('0x8d')](_0x3e2c72);})['then'](function(_0x45f4b2){var _0x27c15e=_0x45f4b2;var _0x55d263=null;if(_0x27c15e){_0x55d263=_0x27c15e[_0xb71a('0x8a')]===0x1?_0x27c15e[0x0]:null;}if(!_0x55d263&&!_0x27c15e)return _0x2dbaa2;var _0x20dc19=_0x3f0529[_0x1c4160[_0xb71a('0x12')]]['rawAttributes'];_0x41fe0c[_0xb71a('0xa')]=_[_0xb71a('0x91')](_0x20dc19);_0x41fe0c[_0xb71a('0x82')]=_['keys'](_0x3a5431[_0xb71a('0x82')]);_0x41fe0c[_0xb71a('0x92')]=_[_0xb71a('0x93')](_0x41fe0c[_0xb71a('0xa')],_0x41fe0c[_0xb71a('0x82')]);_0x526065[_0xb71a('0x94')]=_[_0xb71a('0x93')](_0x41fe0c[_0xb71a('0xa')],qs['fields'](_0x3a5431[_0xb71a('0x82')][_0xb71a('0x95')]));_0x526065[_0xb71a('0x94')]=_0x526065[_0xb71a('0x94')][_0xb71a('0x8a')]?_0x526065[_0xb71a('0x94')]:_0x41fe0c[_0xb71a('0xa')];if(!_0x3a5431['query'][_0xb71a('0x96')]('nolimit')){_0x526065[_0xb71a('0x97')]=qs[_0xb71a('0x97')](_0x3a5431['query'][_0xb71a('0x97')]);_0x526065['offset']=qs[_0xb71a('0x98')](_0x3a5431['query'][_0xb71a('0x98')]);}_0x526065[_0xb71a('0x99')]=qs[_0xb71a('0x9a')](_0x3a5431[_0xb71a('0x82')]['sort']);_0x526065[_0xb71a('0x80')]=qs[_0xb71a('0x92')](_['pick'](_0x3a5431[_0xb71a('0x82')],_0x41fe0c['filters']));if(_0x3a5431['query']['filter']){_0x526065['where']=_[_0xb71a('0x9b')](_0x526065[_0xb71a('0x80')],{'$or':_[_0xb71a('0xb')](_0x20dc19,function(_0x5554e8){if(_0x5554e8[_0xb71a('0xe')][_0xb71a('0x9c')]!=='VIRTUAL'){var _0x299349={};_0x299349[_0x5554e8[_0xb71a('0x4')]]={'$like':'%'+_0x3a5431[_0xb71a('0x82')][_0xb71a('0x3')]+'%'};return _0x299349;}})});}var _0x3209d3=[];var _0x16fbc1=null;var _0x537d00={};if(_0x55d263){_0x16fbc1=_[_0xb71a('0x8b')](_0x248c74,[_0xb71a('0xc'),_0x55d263[_0xb71a('0xc')]]);if(_0x16fbc1[_0xb71a('0x4')]){_0x537d00={};if(_0x1c4160[_0xb71a('0x12')]===_0xb71a('0x74')){_0x537d00[_0x16fbc1['foreignKey']]=_[_0xb71a('0xb')](_0x55d263[_0xb71a('0x8')],'id');}else{_0x537d00[_0x16fbc1['foreignKey']]=_0x55d263[_0xb71a('0x8')];}_0x3209d3[_0xb71a('0x90')](_0x537d00);}else{_0x526065[_0xb71a('0x80')]['id']=_0x55d263['associatedResources'];}}else{for(var _0x3ab7f5=0x0;_0x3ab7f5<_0x27c15e[_0xb71a('0x8a')];_0x3ab7f5++){_0x16fbc1=_[_0xb71a('0x8b')](_0x248c74,['name',_0x27c15e[_0x3ab7f5][_0xb71a('0xc')]]);if(_0x16fbc1[_0xb71a('0x4')]){_0x537d00={};_0x537d00[_0x16fbc1['foreignKey']]=_0x27c15e[_0x3ab7f5][_0xb71a('0x8')];_0x3209d3[_0xb71a('0x90')](_0x537d00);}else{if(!_0x526065[_0xb71a('0x80')]['id'])_0x526065[_0xb71a('0x80')]['id']=[];_0x27c15e[_0x3ab7f5]['associatedResources'][_0xb71a('0x9d')](function(_0x20cb10){_0x526065[_0xb71a('0x80')]['id'][_0xb71a('0x90')](_0x20cb10);});}}}if(!_['isEmpty'](_0x3209d3)){_0x526065[_0xb71a('0x80')]=_[_0xb71a('0x9b')](_0x526065['where'],{'$and':{'$or':_0x3209d3}});}_0x526065=_[_0xb71a('0x9b')]({},_0x526065,_0x3a5431[_0xb71a('0x9e')]);if(_0x55d263&&!_0x55d263['autoAssociation']&&_0x1c4160[_0xb71a('0x12')]===_0xb71a('0x74')){if(_0x3a5431[_0xb71a('0x82')]['includeAll']){_0x526065[_0xb71a('0x9f')]=[{'all':!![]}];}return _0x3f0529[_0x1c4160[_0xb71a('0x12')]][_0xb71a('0x6')](_0x526065)[_0xb71a('0x7')](function(_0x397e34){var _0xc552ac=[];_0x397e34[_0xb71a('0x9d')](function(_0x2e087e){var _0x19d364;switch(_0x2e087e['reportType']){case'default':_0x19d364=_[_0xb71a('0x8b')](_0x55d263[_0xb71a('0x8')],function(_0x4158ff){return _0x4158ff['id']===_0x2e087e[_0xb71a('0x75')]&&_0x4158ff[_0xb71a('0xe')]===_0xb71a('0xa0');});break;case'custom':_0x19d364=_[_0xb71a('0x8b')](_0x55d263['associatedResources'],function(_0x123323){return _0x123323['id']===_0x2e087e['reportId']&&_0x123323[_0xb71a('0xe')]===_0xb71a('0xa1');});break;}if(_0x19d364)_0xc552ac['push'](_0x2e087e);});_0x2dbaa2[_0xb71a('0xa2')]=_0xc552ac[_0xb71a('0x8a')];_0x2dbaa2[_0xb71a('0xa3')]=_0xc552ac;return _0x2dbaa2;});}else{return _0x3f0529[_0x1c4160[_0xb71a('0x12')]][_0xb71a('0xa2')]({'where':_0x526065['where']})[_0xb71a('0x7')](function(_0x3807e6){_0x2dbaa2['count']=_0x3807e6;if(_0x3a5431[_0xb71a('0x82')][_0xb71a('0xa4')]){if(_0x1c4160['childModel']===_0xb71a('0x1d')){_0x526065[_0xb71a('0x9f')]=[{'model':_0x3f0529[_0xb71a('0x6a')],'as':'Tags','attributes':['id',_0xb71a('0xc'),_0xb71a('0xa5')],'required':_0x3a5431[_0xb71a('0x82')]['tag']?!![]:![]},{'model':_0x3f0529[_0xb71a('0x6a')],'as':_0xb71a('0xa6'),'attributes':['id',_0xb71a('0xc'),_0xb71a('0xa5')],'through':_0x3a5431[_0xb71a('0x82')]['tag']?{'attributes':[],'where':{'TagId':_0x3a5431[_0xb71a('0x82')]['tag']||undefined}}:{},'required':_0x3a5431[_0xb71a('0x82')][_0xb71a('0xa7')]?!![]:![]}];}else{_0x526065[_0xb71a('0x9f')]=[{'all':!![]}];}}return _0x3f0529[_0x1c4160['childModel']]['findAll'](_0x526065);})[_0xb71a('0x7')](function(_0x13d2e0){_0x2dbaa2[_0xb71a('0xa3')]=_0x13d2e0;if(_0x52fac6===_0xb71a('0x30')&&_0x3a5431[_0xb71a('0x82')][_0xb71a('0xa8')]===_0xb71a('0xa9')){var _0x442ec0=[];for(var _0x24efc1=0x0;_0x24efc1<_0x2dbaa2[_0xb71a('0xa3')][_0xb71a('0x8a')];_0x24efc1++){_0x442ec0[_0xb71a('0x90')](_0x41a1fc(_0xb71a('0xaa'),_0x2dbaa2[_0xb71a('0xa3')][_0x24efc1][_0xb71a('0xab')]));_0x442ec0['push'](_0x41a1fc(_0xb71a('0xac'),_0x2dbaa2[_0xb71a('0xa3')][_0x24efc1][_0xb71a('0xab')]));_0x442ec0['push'](_0x41a1fc('fax',_0x2dbaa2['rows'][_0x24efc1][_0xb71a('0xab')]));_0x442ec0['push'](_0x41a1fc(_0xb71a('0xad'),_0x2dbaa2[_0xb71a('0xa3')][_0x24efc1]['dataValues']));_0x442ec0['push'](_0x41a1fc(_0xb71a('0xae'),_0x2dbaa2[_0xb71a('0xa3')][_0x24efc1][_0xb71a('0xab')]));_0x442ec0[_0xb71a('0x90')](_0x41a1fc(_0xb71a('0xaf'),_0x2dbaa2[_0xb71a('0xa3')][_0x24efc1][_0xb71a('0xab')]));}return Promise[_0xb71a('0x8d')](_0x442ec0)[_0xb71a('0x7')](function(){return _0x2dbaa2;});}return _0x2dbaa2;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index b0f6cc1..b256f5b 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 _0xa24d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa24d,0x1c1));var _0xda24=function(_0x22b2df,_0x59214b){_0x22b2df=_0x22b2df-0x0;var _0x3ddde7=_0xa24d[_0x22b2df];return _0x3ddde7;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require(_0xda24('0x4'));var fs=require('fs');var Redis=require(_0xda24('0x5'));var db=require(_0xda24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});config[_0xda24('0xc')]=_['defaults'](config[_0xda24('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xda24('0xd'))(new Redis(config[_0xda24('0xc')]));require(_0xda24('0xe'))[_0xda24('0xf')](socket);function respondWithRpcPromise(_0x54f108,_0x243fc8,_0x3374a7){return new BPromise(function(_0x22776c,_0x3a508b){return client[_0xda24('0x10')](_0x54f108,_0x3374a7)['then'](function(_0x32c867){logger['info'](_0xda24('0x11'),_0x243fc8,_0xda24('0x12'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x243fc8,_0xda24('0x12'),JSON[_0xda24('0x13')](_0x32c867));if(_0x32c867[_0xda24('0x14')]){if(_0x32c867[_0xda24('0x14')]['code']===0x1f4){logger[_0xda24('0x14')]('UserProfile,\x20%s,\x20%s',_0x243fc8,_0x32c867[_0xda24('0x14')][_0xda24('0x15')]);return _0x3a508b(_0x32c867['error']['message']);}logger[_0xda24('0x14')](_0xda24('0x11'),_0x243fc8,_0x32c867[_0xda24('0x14')][_0xda24('0x15')]);return _0x22776c(_0x32c867[_0xda24('0x14')][_0xda24('0x15')]);}else{logger[_0xda24('0x16')](_0xda24('0x11'),_0x243fc8,_0xda24('0x12'));_0x22776c(_0x32c867['result'][_0xda24('0x15')]);}})[_0xda24('0x17')](function(_0x52b393){logger[_0xda24('0x14')]('UserProfile,\x20%s,\x20%s',_0x243fc8,_0x52b393);_0x3a508b(_0x52b393);});});} \ No newline at end of file +var _0xeda7=['redis','defaults','localhost','socket.io-emitter','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xfe8bef,_0x453526){var _0x20659f=function(_0x1f3483){while(--_0x1f3483){_0xfe8bef['push'](_0xfe8bef['shift']());}};_0x20659f(++_0x453526);}(_0xeda7,0x196));var _0x7eda=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xeda7[_0x3430aa];return _0x2ac5c;};'use strict';var _=require(_0x7eda('0x0'));var util=require(_0x7eda('0x1'));var moment=require(_0x7eda('0x2'));var BPromise=require(_0x7eda('0x3'));var rs=require(_0x7eda('0x4'));var fs=require('fs');var Redis=require(_0x7eda('0x5'));var db=require(_0x7eda('0x6'))['db'];var utils=require(_0x7eda('0x7'));var logger=require(_0x7eda('0x8'))(_0x7eda('0x9'));var config=require(_0x7eda('0xa'));var jayson=require(_0x7eda('0xb'));var client=jayson[_0x7eda('0xc')][_0x7eda('0xd')]({'port':0x232a});config[_0x7eda('0xe')]=_[_0x7eda('0xf')](config[_0x7eda('0xe')],{'host':_0x7eda('0x10'),'port':0x18eb});var socket=require(_0x7eda('0x11'))(new Redis(config[_0x7eda('0xe')]));require('./userProfile.socket')[_0x7eda('0x12')](socket);function respondWithRpcPromise(_0x506476,_0x4f69a7,_0x1a0e32){return new BPromise(function(_0x177458,_0x3dfcdb){return client[_0x7eda('0x13')](_0x506476,_0x1a0e32)['then'](function(_0x53792a){logger[_0x7eda('0x14')](_0x7eda('0x15'),_0x4f69a7,_0x7eda('0x16'));logger[_0x7eda('0x17')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4f69a7,_0x7eda('0x16'),JSON['stringify'](_0x53792a));if(_0x53792a[_0x7eda('0x18')]){if(_0x53792a[_0x7eda('0x18')][_0x7eda('0x19')]===0x1f4){logger[_0x7eda('0x18')](_0x7eda('0x15'),_0x4f69a7,_0x53792a[_0x7eda('0x18')][_0x7eda('0x1a')]);return _0x3dfcdb(_0x53792a[_0x7eda('0x18')][_0x7eda('0x1a')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x4f69a7,_0x53792a[_0x7eda('0x18')]['message']);return _0x177458(_0x53792a['error'][_0x7eda('0x1a')]);}else{logger[_0x7eda('0x14')](_0x7eda('0x15'),_0x4f69a7,_0x7eda('0x16'));_0x177458(_0x53792a[_0x7eda('0x1b')]['message']);}})['catch'](function(_0x5dc833){logger[_0x7eda('0x18')]('UserProfile,\x20%s,\x20%s',_0x4f69a7,_0x5dc833);_0x3dfcdb(_0x5dc833);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 7418b21..69c710e 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 _0x5ef8=['emit','removeListener','register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5ef8,0x176));var _0x85ef=function(_0x137f8f,_0x412ec2){_0x137f8f=_0x137f8f-0x0;var _0x35056e=_0x5ef8[_0x137f8f];return _0x35056e;};'use strict';var UserProfileEvents=require(_0x85ef('0x0'));var events=[_0x85ef('0x1'),_0x85ef('0x2'),_0x85ef('0x3')];function createListener(_0x1a8ec8,_0x4e3dea){return function(_0x49e812){_0x4e3dea[_0x85ef('0x4')](_0x1a8ec8,_0x49e812);};}function removeListener(_0x5909d6,_0x741d92){return function(){UserProfileEvents[_0x85ef('0x5')](_0x5909d6,_0x741d92);};}exports[_0x85ef('0x6')]=function(_0x2479e8){for(var _0x45e4c7=0x0,_0x6745f1=events[_0x85ef('0x7')];_0x45e4c7<_0x6745f1;_0x45e4c7++){var _0x3ad724=events[_0x45e4c7];var _0x4ac2db=createListener(_0x85ef('0x8')+_0x3ad724,_0x2479e8);UserProfileEvents['on'](_0x3ad724,_0x4ac2db);}}; \ No newline at end of file +var _0x57ca=['./userProfile.events','save','emit','removeListener','register'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x57ca,0x19a));var _0xa57c=function(_0x1f5bab,_0x3410af){_0x1f5bab=_0x1f5bab-0x0;var _0x201423=_0x57ca[_0x1f5bab];return _0x201423;};'use strict';var UserProfileEvents=require(_0xa57c('0x0'));var events=[_0xa57c('0x1'),'remove','update'];function createListener(_0x4e5eae,_0x5e266c){return function(_0x54b5d2){_0x5e266c[_0xa57c('0x2')](_0x4e5eae,_0x54b5d2);};}function removeListener(_0x101d7d,_0x31e7a1){return function(){UserProfileEvents[_0xa57c('0x3')](_0x101d7d,_0x31e7a1);};}exports[_0xa57c('0x4')]=function(_0x1517bf){for(var _0x5a6efd=0x0,_0x17d714=events['length'];_0x5a6efd<_0x17d714;_0x5a6efd++){var _0x192b2f=events[_0x5a6efd];var _0x209e21=createListener('userProfile:'+_0x192b2f,_0x1517bf);UserProfileEvents['on'](_0x192b2f,_0x209e21);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index da26349..465f850 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 _0x7453=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','destroy','multer','connect-timeout','Router'];(function(_0x4afc2c,_0x336a88){var _0x164084=function(_0x14b783){while(--_0x14b783){_0x4afc2c['push'](_0x4afc2c['shift']());}};_0x164084(++_0x336a88);}(_0x7453,0x1e3));var _0x3745=function(_0x5cc255,_0x345bd7){_0x5cc255=_0x5cc255-0x0;var _0x417e36=_0x7453[_0x5cc255];return _0x417e36;};'use strict';var multer=require(_0x3745('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3745('0x1'));var express=require('express');var router=express[_0x3745('0x2')]();var fs_extra=require(_0x3745('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3745('0x4'));var config=require(_0x3745('0x5'));var controller=require(_0x3745('0x6'));router[_0x3745('0x7')]('/',auth[_0x3745('0x8')](),controller[_0x3745('0x9')]);router[_0x3745('0x7')](_0x3745('0xa'),auth[_0x3745('0x8')](),controller[_0x3745('0xb')]);router[_0x3745('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3745('0xc')]);router['post']('/',auth[_0x3745('0x8')](),controller[_0x3745('0xd')]);router[_0x3745('0xe')](_0x3745('0xf'),auth[_0x3745('0x8')](),controller[_0x3745('0x10')]);router['delete'](_0x3745('0xf'),auth[_0x3745('0x8')](),controller[_0x3745('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8373=['post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','show'];(function(_0x450e5c,_0x1017ec){var _0x259e66=function(_0x49e30f){while(--_0x49e30f){_0x450e5c['push'](_0x450e5c['shift']());}};_0x259e66(++_0x1017ec);}(_0x8373,0x1e2));var _0x3837=function(_0x387bec,_0x438a51){_0x387bec=_0x387bec-0x0;var _0x2c5885=_0x8373[_0x387bec];return _0x2c5885;};'use strict';var multer=require(_0x3837('0x0'));var util=require('util');var path=require(_0x3837('0x1'));var timeout=require(_0x3837('0x2'));var express=require(_0x3837('0x3'));var router=express['Router']();var fs_extra=require(_0x3837('0x4'));var auth=require(_0x3837('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3837('0x6'));var controller=require(_0x3837('0x7'));router[_0x3837('0x8')]('/',auth[_0x3837('0x9')](),controller['index']);router[_0x3837('0x8')]('/describe',auth[_0x3837('0x9')](),controller[_0x3837('0xa')]);router[_0x3837('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3837('0xb')]);router[_0x3837('0xc')]('/',auth[_0x3837('0x9')](),controller[_0x3837('0xd')]);router[_0x3837('0xe')](_0x3837('0xf'),auth[_0x3837('0x9')](),controller['update']);router[_0x3837('0x10')](_0x3837('0xf'),auth[_0x3837('0x9')](),controller[_0x3837('0x11')]);module[_0x3837('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e23582d..c4763fa 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 _0xe821=['exports','STRING','sequelize'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xe821,0xd7));var _0x1e82=function(_0x2ca57d,_0x4eabd9){_0x2ca57d=_0x2ca57d-0x0;var _0xe99fdf=_0xe821[_0x2ca57d];return _0xe99fdf;};'use strict';var Sequelize=require(_0x1e82('0x0'));module[_0x1e82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x1e82('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5619=['STRING','INTEGER','exports'];(function(_0x72c194,_0x1a953a){var _0x1f4f68=function(_0x43bcdd){while(--_0x43bcdd){_0x72c194['push'](_0x72c194['shift']());}};_0x1f4f68(++_0x1a953a);}(_0x5619,0x143));var _0x9561=function(_0x3efcf1,_0xfa83c3){_0x3efcf1=_0x3efcf1-0x0;var _0x4ef023=_0x5619[_0x3efcf1];return _0x4ef023;};'use strict';var Sequelize=require('sequelize');module[_0x9561('0x0')]={'name':{'type':Sequelize[_0x9561('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9561('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9561('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index dd4bb07..814e9a8 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 _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x6343,0x168));var _0x3634=function(_0x56500f,_0x3f35bd){_0x56500f=_0x56500f-0x0;var _0x357f57=_0x6343[_0x56500f];return _0x357f57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','UserProfileResource','includeAll','rows','catch','show'];(function(_0x5234d1,_0x49df0b){var _0x23022f=function(_0x346141){while(--_0x346141){_0x5234d1['push'](_0x5234d1['shift']());}};_0x23022f(++_0x49df0b);}(_0x0295,0x1f0));var _0x5029=function(_0x32d9fe,_0x213473){_0x32d9fe=_0x32d9fe-0x0;var _0x1b8f8e=_0x0295[_0x32d9fe];return _0x1b8f8e;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['UserProfileResource'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['UserProfileResource'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};exports['describe']=function(_0x544fb3,_0x1510bb){return db[_0x5029('0x3b')]['describe']()[_0x5029('0x20')](respondWithResult(_0x1510bb,null))['catch'](handleError(_0x1510bb,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 96a9a9e..9934406 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 _0xdbe1=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','bluebird','request-promise'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xdbe1,0xed));var _0x1dbe=function(_0x4fcd48,_0x125ff3){_0x4fcd48=_0x4fcd48-0x0;var _0x18005d=_0xdbe1[_0x4fcd48];return _0x18005d;};'use strict';var _=require(_0x1dbe('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1dbe('0x1'));var rp=require(_0x1dbe('0x2'));var fs=require('fs');var path=require(_0x1dbe('0x3'));var rimraf=require(_0x1dbe('0x4'));var config=require(_0x1dbe('0x5'));var attributes=require(_0x1dbe('0x6'));module[_0x1dbe('0x7')]=function(_0x361c83,_0x3c62f7){return _0x361c83['define']('UserProfileResource',attributes,{'tableName':_0x1dbe('0x8'),'paranoid':![],'indexes':[{'name':_0x1dbe('0x9'),'fields':[_0x1dbe('0xa'),_0x1dbe('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x301e=['exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0xd78352,_0x591e03){var _0x24d4d0=function(_0x141ff4){while(--_0x141ff4){_0xd78352['push'](_0xd78352['shift']());}};_0x24d4d0(++_0x591e03);}(_0x301e,0x1f4));var _0xe301=function(_0x140ec6,_0x30c252){_0x140ec6=_0x140ec6-0x0;var _0x3ae4f3=_0x301e[_0x140ec6];return _0x3ae4f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe301('0x0'))('api');var moment=require(_0xe301('0x1'));var BPromise=require(_0xe301('0x2'));var rp=require(_0xe301('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe301('0x4'));var config=require(_0xe301('0x5'));var attributes=require(_0xe301('0x6'));module[_0xe301('0x7')]=function(_0x16bd03,_0x36e631){return _0x16bd03[_0xe301('0x8')]('UserProfileResource',attributes,{'tableName':_0xe301('0x9'),'paranoid':![],'indexes':[{'name':_0xe301('0xa'),'fields':[_0xe301('0xb'),_0xe301('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 139a563..b04742c 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 _0x1b5c=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x1b5c,0x105));var _0xc1b5=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x1b5c[_0x34e752];return _0x7c6347;};'use strict';var _=require('lodash');var util=require(_0xc1b5('0x0'));var moment=require(_0xc1b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1b5('0x3'))['db'];var utils=require(_0xc1b5('0x4'));var logger=require(_0xc1b5('0x5'))(_0xc1b5('0x6'));var config=require(_0xc1b5('0x7'));var jayson=require(_0xc1b5('0x8'));var client=jayson[_0xc1b5('0x9')][_0xc1b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8fb495,_0x3f77dd,_0x32a25d){return new BPromise(function(_0x33b41b,_0x43c98e){return client[_0xc1b5('0xb')](_0x8fb495,_0x32a25d)[_0xc1b5('0xc')](function(_0x3f862b){logger[_0xc1b5('0xd')](_0xc1b5('0xe'),_0x3f77dd,_0xc1b5('0xf'));logger[_0xc1b5('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3f77dd,_0xc1b5('0xf'),JSON[_0xc1b5('0x11')](_0x3f862b));if(_0x3f862b['error']){if(_0x3f862b[_0xc1b5('0x12')][_0xc1b5('0x13')]===0x1f4){logger[_0xc1b5('0x12')](_0xc1b5('0xe'),_0x3f77dd,_0x3f862b['error'][_0xc1b5('0x14')]);return _0x43c98e(_0x3f862b['error'][_0xc1b5('0x14')]);}logger[_0xc1b5('0x12')](_0xc1b5('0xe'),_0x3f77dd,_0x3f862b['error'][_0xc1b5('0x14')]);return _0x33b41b(_0x3f862b[_0xc1b5('0x12')][_0xc1b5('0x14')]);}else{logger['info'](_0xc1b5('0xe'),_0x3f77dd,'request\x20sent');_0x33b41b(_0x3f862b[_0xc1b5('0x15')][_0xc1b5('0x14')]);}})[_0xc1b5('0x16')](function(_0x2f48d3){logger[_0xc1b5('0x12')](_0xc1b5('0xe'),_0x3f77dd,_0x2f48d3);_0x43c98e(_0x2f48d3);});});} \ No newline at end of file +var _0x5bc8=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','error','message','info'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x5bc8,0x1f0));var _0x85bc=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x5bc8[_0x492af5];return _0x59f529;};'use strict';var _=require(_0x85bc('0x0'));var util=require(_0x85bc('0x1'));var moment=require(_0x85bc('0x2'));var BPromise=require(_0x85bc('0x3'));var rs=require(_0x85bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x85bc('0x5'));var logger=require('../../config/logger')(_0x85bc('0x6'));var config=require(_0x85bc('0x7'));var jayson=require(_0x85bc('0x8'));var client=jayson['client'][_0x85bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe4b1a,_0x10bf5d,_0x5c5a3d){return new BPromise(function(_0x294221,_0xd012de){return client['request'](_0xbe4b1a,_0x5c5a3d)[_0x85bc('0xa')](function(_0x3678b6){logger['info'](_0x85bc('0xb'),_0x10bf5d,'request\x20sent');logger[_0x85bc('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x10bf5d,_0x85bc('0xd'),JSON['stringify'](_0x3678b6));if(_0x3678b6['error']){if(_0x3678b6[_0x85bc('0xe')]['code']===0x1f4){logger[_0x85bc('0xe')](_0x85bc('0xb'),_0x10bf5d,_0x3678b6['error'][_0x85bc('0xf')]);return _0xd012de(_0x3678b6[_0x85bc('0xe')]['message']);}logger[_0x85bc('0xe')](_0x85bc('0xb'),_0x10bf5d,_0x3678b6[_0x85bc('0xe')][_0x85bc('0xf')]);return _0x294221(_0x3678b6[_0x85bc('0xe')][_0x85bc('0xf')]);}else{logger[_0x85bc('0x10')](_0x85bc('0xb'),_0x10bf5d,_0x85bc('0xd'));_0x294221(_0x3678b6[_0x85bc('0x11')][_0x85bc('0xf')]);}})[_0x85bc('0x12')](function(_0x3236d4){logger['error'](_0x85bc('0xb'),_0x10bf5d,_0x3236d4);_0xd012de(_0x3236d4);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 52cc8bd..b8eb393 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 _0x0824=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0824,0x160));var _0x4082=function(_0x5c0598,_0x46fd74){_0x5c0598=_0x5c0598-0x0;var _0x2ba2cb=_0x0824[_0x5c0598];return _0x2ba2cb;};'use strict';var multer=require(_0x4082('0x0'));var util=require(_0x4082('0x1'));var path=require(_0x4082('0x2'));var timeout=require(_0x4082('0x3'));var express=require(_0x4082('0x4'));var router=express['Router']();var fs_extra=require(_0x4082('0x5'));var auth=require(_0x4082('0x6'));var interaction=require(_0x4082('0x7'));var config=require(_0x4082('0x8'));var controller=require('./userProfileSection.controller');router[_0x4082('0x9')]('/',auth[_0x4082('0xa')](),controller['index']);router[_0x4082('0x9')](_0x4082('0xb'),auth[_0x4082('0xa')](),controller[_0x4082('0xc')]);router['get']('/:id',auth[_0x4082('0xa')](),controller[_0x4082('0xd')]);router[_0x4082('0xe')]('/',auth['isAuthenticated'](),controller[_0x4082('0xf')]);router[_0x4082('0x10')](_0x4082('0x11'),auth['isAuthenticated'](),controller[_0x4082('0x12')]);router[_0x4082('0x13')](_0x4082('0x11'),auth[_0x4082('0xa')](),controller[_0x4082('0x14')]);module[_0x4082('0x15')]=router; \ No newline at end of file +var _0xb9a3=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x4773e5,_0x343e96){var _0x31ac07=function(_0x108942){while(--_0x108942){_0x4773e5['push'](_0x4773e5['shift']());}};_0x31ac07(++_0x343e96);}(_0xb9a3,0xaf));var _0x3b9a=function(_0x184e67,_0x1f7cf7){_0x184e67=_0x184e67-0x0;var _0x275a74=_0xb9a3[_0x184e67];return _0x275a74;};'use strict';var multer=require(_0x3b9a('0x0'));var util=require(_0x3b9a('0x1'));var path=require(_0x3b9a('0x2'));var timeout=require(_0x3b9a('0x3'));var express=require(_0x3b9a('0x4'));var router=express[_0x3b9a('0x5')]();var fs_extra=require(_0x3b9a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3b9a('0x7'));var config=require(_0x3b9a('0x8'));var controller=require(_0x3b9a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b9a('0xa')]);router[_0x3b9a('0xb')](_0x3b9a('0xc'),auth[_0x3b9a('0xd')](),controller['describe']);router[_0x3b9a('0xb')](_0x3b9a('0xe'),auth[_0x3b9a('0xd')](),controller[_0x3b9a('0xf')]);router[_0x3b9a('0x10')]('/',auth['isAuthenticated'](),controller[_0x3b9a('0x11')]);router[_0x3b9a('0x12')](_0x3b9a('0xe'),auth['isAuthenticated'](),controller[_0x3b9a('0x13')]);router[_0x3b9a('0x14')]('/:id',auth[_0x3b9a('0xd')](),controller['destroy']);module[_0x3b9a('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 7ae0228..434424b 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 _0x97c1=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x1da32d,_0x231aea){var _0x26e82f=function(_0x5e155c){while(--_0x5e155c){_0x1da32d['push'](_0x1da32d['shift']());}};_0x26e82f(++_0x231aea);}(_0x97c1,0xdf));var _0x197c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x97c1[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x197c('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x197c('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x197c('0x2')],'set':function(_0x26833e){this[_0x197c('0x4')](_0x197c('0x5'),_0x26833e?_0x26833e['join'](''):[]);},'get':function(){return this['getDataValue'](_0x197c('0x5'))?this[_0x197c('0x6')](_0x197c('0x5'))[_0x197c('0x7')](''):[];}}}; \ No newline at end of file +var _0x13f6=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports'];(function(_0x44a27e,_0x1bb750){var _0x1ae404=function(_0x4b677){while(--_0x4b677){_0x44a27e['push'](_0x44a27e['shift']());}};_0x1ae404(++_0x1bb750);}(_0x13f6,0x124));var _0x613f=function(_0x38f522,_0x33bd57){_0x38f522=_0x38f522-0x0;var _0x39bec5=_0x13f6[_0x38f522];return _0x39bec5;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x613f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x613f('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x613f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x179f6e){this[_0x613f('0x4')](_0x613f('0x5'),_0x179f6e?_0x179f6e['join'](''):[]);},'get':function(){return this[_0x613f('0x6')](_0x613f('0x5'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index deb00f7..63cc4d6 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 _0xbe60=['catch','find','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','stack','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','show','params','create','body'];(function(_0x12e4c7,_0x849a6){var _0x299805=function(_0x26c863){while(--_0x26c863){_0x12e4c7['push'](_0x12e4c7['shift']());}};_0x299805(++_0x849a6);}(_0xbe60,0xd6));var _0x0be6=function(_0x17dab3,_0x3bab88){_0x17dab3=_0x17dab3-0x0;var _0x192c74=_0xbe60[_0x17dab3];return _0x192c74;};'use strict';var emlformat=require(_0x0be6('0x0'));var rimraf=require(_0x0be6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0be6('0x2'));var rp=require('request-promise');var moment=require(_0x0be6('0x3'));var BPromise=require(_0x0be6('0x4'));var Mustache=require(_0x0be6('0x5'));var util=require(_0x0be6('0x6'));var path=require(_0x0be6('0x7'));var sox=require(_0x0be6('0x8'));var csv=require(_0x0be6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0be6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0be6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0be6('0xc'));var Papa=require(_0x0be6('0xd'));var Redis=require('ioredis');var authService=require(_0x0be6('0xe'));var qs=require(_0x0be6('0xf'));var as=require(_0x0be6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0be6('0x11'))(_0x0be6('0x12'));var utils=require(_0x0be6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c9322,_0x104876){_0x104876=_0x104876||0xcc;return function(_0x84e489){if(_0x84e489){return _0x3c9322[_0x0be6('0x14')](_0x104876);}return _0x3c9322[_0x0be6('0x15')](_0x104876)[_0x0be6('0x16')]();};}function respondWithResult(_0x24d576,_0x2efd12){_0x2efd12=_0x2efd12||0xc8;return function(_0xba1f50){if(_0xba1f50){return _0x24d576['status'](_0x2efd12)[_0x0be6('0x17')](_0xba1f50);}};}function respondWithFilteredResult(_0x31469c,_0xdf597){return function(_0x4df642){if(_0x4df642){var _0xb04ad0=typeof _0xdf597[_0x0be6('0x18')]==='undefined'&&typeof _0xdf597[_0x0be6('0x19')]===_0x0be6('0x1a');var _0xe3e551=_0x4df642[_0x0be6('0x1b')];var _0x15bee6=_0xb04ad0?0x0:_0xdf597[_0x0be6('0x18')];var _0x38b737=_0xb04ad0?_0x4df642['count']:_0xdf597[_0x0be6('0x18')]+_0xdf597['limit'];var _0x492ad7;if(_0x38b737>=_0xe3e551){_0x38b737=_0xe3e551;_0x492ad7=0xc8;}else{_0x492ad7=0xce;}_0x31469c[_0x0be6('0x15')](_0x492ad7);return _0x31469c[_0x0be6('0x1c')](_0x0be6('0x1d'),_0x15bee6+'-'+_0x38b737+'/'+_0xe3e551)[_0x0be6('0x17')](_0x4df642);}return null;};}function patchUpdates(_0xc9dbd5){return function(_0x9d928b){try{jsonpatch[_0x0be6('0x1e')](_0x9d928b,_0xc9dbd5,!![]);}catch(_0x2833ea){return BPromise[_0x0be6('0x1f')](_0x2833ea);}return _0x9d928b['save']();};}function saveUpdates(_0x78b1ff,_0x30e37a){return function(_0x2bca92){if(_0x2bca92){return _0x2bca92['update'](_0x78b1ff)[_0x0be6('0x20')](function(_0x281de0){return _0x281de0;});}return null;};}function removeEntity(_0x556674,_0x26eebf){return function(_0x24ccbd){if(_0x24ccbd){return _0x24ccbd['destroy']()[_0x0be6('0x20')](function(){_0x556674['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42fd27,_0x5c9a80){return function(_0x402262){if(!_0x402262){_0x42fd27['sendStatus'](0x194);}return _0x402262;};}function handleError(_0x33f9fc,_0x5f443c){_0x5f443c=_0x5f443c||0x1f4;return function(_0x5de113){logger['error'](_0x5de113[_0x0be6('0x21')]);if(_0x5de113['name']){delete _0x5de113['name'];}_0x33f9fc[_0x0be6('0x15')](_0x5f443c)[_0x0be6('0x22')](_0x5de113);};}exports[_0x0be6('0x23')]=function(_0xe3e239,_0x5d4eb8){var _0xad94e3={},_0x2bd8e1={},_0x289a10={'count':0x0,'rows':[]};var _0x1b289b=_[_0x0be6('0x24')](db[_0x0be6('0x25')][_0x0be6('0x26')],function(_0x50d88f){return{'name':_0x50d88f['fieldName'],'type':_0x50d88f[_0x0be6('0x27')][_0x0be6('0x28')]};});_0x2bd8e1[_0x0be6('0x29')]=_[_0x0be6('0x24')](_0x1b289b,'name');_0x2bd8e1[_0x0be6('0x2a')]=_[_0x0be6('0x2b')](_0xe3e239[_0x0be6('0x2a')]);_0x2bd8e1[_0x0be6('0x2c')]=_[_0x0be6('0x2d')](_0x2bd8e1[_0x0be6('0x29')],_0x2bd8e1[_0x0be6('0x2a')]);_0xad94e3[_0x0be6('0x2e')]=_[_0x0be6('0x2d')](_0x2bd8e1['model'],qs[_0x0be6('0x2f')](_0xe3e239[_0x0be6('0x2a')]['fields']));_0xad94e3[_0x0be6('0x2e')]=_0xad94e3[_0x0be6('0x2e')][_0x0be6('0x30')]?_0xad94e3[_0x0be6('0x2e')]:_0x2bd8e1[_0x0be6('0x29')];if(!_0xe3e239['query'][_0x0be6('0x31')](_0x0be6('0x32'))){_0xad94e3[_0x0be6('0x19')]=qs[_0x0be6('0x19')](_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x19')]);_0xad94e3[_0x0be6('0x18')]=qs[_0x0be6('0x18')](_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x18')]);}_0xad94e3['order']=qs[_0x0be6('0x33')](_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x33')]);_0xad94e3[_0x0be6('0x34')]=qs[_0x0be6('0x2c')](_[_0x0be6('0x35')](_0xe3e239[_0x0be6('0x2a')],_0x2bd8e1[_0x0be6('0x2c')]),_0x1b289b);if(_0xe3e239[_0x0be6('0x2a')]['filter']){_0xad94e3[_0x0be6('0x34')]=_['merge'](_0xad94e3[_0x0be6('0x34')],{'$or':_[_0x0be6('0x24')](_0x1b289b,function(_0x23874f){if(_0x23874f[_0x0be6('0x27')]!==_0x0be6('0x36')){var _0x18187c={};_0x18187c[_0x23874f[_0x0be6('0x37')]]={'$like':'%'+_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x38')]+'%'};return _0x18187c;}})});}_0xad94e3=_['merge']({},_0xad94e3,_0xe3e239[_0x0be6('0x39')]);var _0x2a6986={'where':_0xad94e3['where']};return db['UserProfileSection'][_0x0be6('0x1b')](_0x2a6986)[_0x0be6('0x20')](function(_0x43ca93){_0x289a10['count']=_0x43ca93;if(_0xe3e239[_0x0be6('0x2a')][_0x0be6('0x3a')]){_0xad94e3[_0x0be6('0x3b')]=[{'all':!![]}];}return db[_0x0be6('0x25')][_0x0be6('0x3c')](_0xad94e3);})[_0x0be6('0x20')](function(_0xca2a60){_0x289a10[_0x0be6('0x3d')]=_0xca2a60;return _0x289a10;})['then'](respondWithFilteredResult(_0x5d4eb8,_0xad94e3))['catch'](handleError(_0x5d4eb8,null));};exports[_0x0be6('0x3e')]=function(_0x3b204e,_0xf75184){var _0xf23d0b={'raw':![],'where':{'id':_0x3b204e[_0x0be6('0x3f')]['id']}},_0x269a65={};_0x269a65[_0x0be6('0x29')]=_[_0x0be6('0x2b')](db[_0x0be6('0x25')][_0x0be6('0x26')]);_0x269a65['query']=_[_0x0be6('0x2b')](_0x3b204e[_0x0be6('0x2a')]);_0x269a65[_0x0be6('0x2c')]=_['intersection'](_0x269a65[_0x0be6('0x29')],_0x269a65['query']);_0xf23d0b['attributes']=_[_0x0be6('0x2d')](_0x269a65['model'],qs[_0x0be6('0x2f')](_0x3b204e['query'][_0x0be6('0x2f')]));_0xf23d0b[_0x0be6('0x2e')]=_0xf23d0b[_0x0be6('0x2e')][_0x0be6('0x30')]?_0xf23d0b[_0x0be6('0x2e')]:_0x269a65[_0x0be6('0x29')];if(_0x3b204e['query']['includeAll']){_0xf23d0b['include']=[{'all':!![]}];}_0xf23d0b=_['merge']({},_0xf23d0b,_0x3b204e['options']);return db[_0x0be6('0x25')]['find'](_0xf23d0b)[_0x0be6('0x20')](handleEntityNotFound(_0xf75184,null))[_0x0be6('0x20')](respondWithResult(_0xf75184,null))['catch'](handleError(_0xf75184,null));};exports[_0x0be6('0x40')]=function(_0x5aa141,_0x50e6b8){return db[_0x0be6('0x25')]['create'](_0x5aa141[_0x0be6('0x41')],{})[_0x0be6('0x20')](respondWithResult(_0x50e6b8,0xc9))[_0x0be6('0x42')](handleError(_0x50e6b8,null));};exports['update']=function(_0x4781db,_0x2bff7a){if(_0x4781db[_0x0be6('0x41')]['id']){delete _0x4781db[_0x0be6('0x41')]['id'];}return db[_0x0be6('0x25')][_0x0be6('0x43')]({'where':{'id':_0x4781db['params']['id']}})['then'](handleEntityNotFound(_0x2bff7a,null))[_0x0be6('0x20')](saveUpdates(_0x4781db['body'],null))[_0x0be6('0x20')](respondWithResult(_0x2bff7a,null))['catch'](handleError(_0x2bff7a,null));};exports[_0x0be6('0x44')]=function(_0x6878cd,_0x1c07e6){return db['UserProfileSection'][_0x0be6('0x43')]({'where':{'id':_0x6878cd['params']['id']}})[_0x0be6('0x20')](handleEntityNotFound(_0x1c07e6,null))['then'](removeEntity(_0x1c07e6,null))[_0x0be6('0x42')](handleError(_0x1c07e6,null));};exports[_0x0be6('0x45')]=function(_0x1d13d5,_0xfef7ed){return db[_0x0be6('0x25')][_0x0be6('0x45')]()[_0x0be6('0x20')](respondWithResult(_0xfef7ed,null))[_0x0be6('0x42')](handleError(_0xfef7ed,null));}; \ No newline at end of file +var _0xc2a5=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x340c09,_0xc08941){var _0x1cc1b6=function(_0x193f75){while(--_0x193f75){_0x340c09['push'](_0x340c09['shift']());}};_0x1cc1b6(++_0xc08941);}(_0xc2a5,0x19c));var _0x5c2a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc2a5[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x5c2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c2a('0x2'));var moment=require(_0x5c2a('0x3'));var BPromise=require(_0x5c2a('0x4'));var Mustache=require(_0x5c2a('0x5'));var util=require(_0x5c2a('0x6'));var path=require(_0x5c2a('0x7'));var sox=require(_0x5c2a('0x8'));var csv=require(_0x5c2a('0x9'));var ejs=require(_0x5c2a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c2a('0xb'));var squel=require(_0x5c2a('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c2a('0xd'));var deskjs=require(_0x5c2a('0xe'));var toCsv=require(_0x5c2a('0x9'));var querystring=require(_0x5c2a('0xf'));var Papa=require(_0x5c2a('0x10'));var Redis=require(_0x5c2a('0x11'));var authService=require(_0x5c2a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5c2a('0x13'));var hardwareService=require(_0x5c2a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5c2a('0x15'));var config=require(_0x5c2a('0x16'));var licenseUtil=require(_0x5c2a('0x17'));var db=require(_0x5c2a('0x18'))['db'];function respondWithStatusCode(_0x1dea3b,_0x2eaf8a){_0x2eaf8a=_0x2eaf8a||0xcc;return function(_0x5d60e7){if(_0x5d60e7){return _0x1dea3b['sendStatus'](_0x2eaf8a);}return _0x1dea3b[_0x5c2a('0x19')](_0x2eaf8a)[_0x5c2a('0x1a')]();};}function respondWithResult(_0x434ed3,_0x430c20){_0x430c20=_0x430c20||0xc8;return function(_0x33b7c2){if(_0x33b7c2){return _0x434ed3[_0x5c2a('0x19')](_0x430c20)['json'](_0x33b7c2);}};}function respondWithFilteredResult(_0x407b98,_0x2dcc16){return function(_0x50f129){if(_0x50f129){var _0x897544=typeof _0x2dcc16[_0x5c2a('0x1b')]===_0x5c2a('0x1c')&&typeof _0x2dcc16[_0x5c2a('0x1d')]===_0x5c2a('0x1c');var _0x37df5c=_0x50f129[_0x5c2a('0x1e')];var _0x22d467=_0x897544?0x0:_0x2dcc16[_0x5c2a('0x1b')];var _0x281ef9=_0x897544?_0x50f129[_0x5c2a('0x1e')]:_0x2dcc16[_0x5c2a('0x1b')]+_0x2dcc16['limit'];var _0x57801e;if(_0x281ef9>=_0x37df5c){_0x281ef9=_0x37df5c;_0x57801e=0xc8;}else{_0x57801e=0xce;}_0x407b98[_0x5c2a('0x19')](_0x57801e);return _0x407b98[_0x5c2a('0x1f')](_0x5c2a('0x20'),_0x22d467+'-'+_0x281ef9+'/'+_0x37df5c)[_0x5c2a('0x21')](_0x50f129);}return null;};}function patchUpdates(_0x22e471){return function(_0x5d52bd){try{jsonpatch[_0x5c2a('0x22')](_0x5d52bd,_0x22e471,!![]);}catch(_0x598380){return BPromise[_0x5c2a('0x23')](_0x598380);}return _0x5d52bd[_0x5c2a('0x24')]();};}function saveUpdates(_0x346d11,_0x1af7de){return function(_0x2f6666){if(_0x2f6666){return _0x2f6666[_0x5c2a('0x25')](_0x346d11)[_0x5c2a('0x26')](function(_0x3d8540){return _0x3d8540;});}return null;};}function removeEntity(_0x17afa5,_0x6d4eee){return function(_0x521055){if(_0x521055){return _0x521055[_0x5c2a('0x27')]()[_0x5c2a('0x26')](function(){_0x17afa5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dfbe5,_0x1dcead){return function(_0x20dda2){if(!_0x20dda2){_0x2dfbe5[_0x5c2a('0x28')](0x194);}return _0x20dda2;};}function handleError(_0x493bfd,_0x470702){_0x470702=_0x470702||0x1f4;return function(_0x17fbd5){logger[_0x5c2a('0x29')](_0x17fbd5['stack']);if(_0x17fbd5[_0x5c2a('0x2a')]){delete _0x17fbd5['name'];}_0x493bfd[_0x5c2a('0x19')](_0x470702)[_0x5c2a('0x2b')](_0x17fbd5);};}exports['index']=function(_0xd1cfe2,_0x417cd9){var _0xbe59d1={},_0x3cbfc9={},_0x4a4818={'count':0x0,'rows':[]};var _0x5a0b27=_[_0x5c2a('0x2c')](db[_0x5c2a('0x2d')][_0x5c2a('0x2e')],function(_0xdfc060){return{'name':_0xdfc060[_0x5c2a('0x2f')],'type':_0xdfc060[_0x5c2a('0x30')][_0x5c2a('0x31')]};});_0x3cbfc9[_0x5c2a('0x32')]=_['map'](_0x5a0b27,_0x5c2a('0x2a'));_0x3cbfc9[_0x5c2a('0x33')]=_[_0x5c2a('0x34')](_0xd1cfe2[_0x5c2a('0x33')]);_0x3cbfc9[_0x5c2a('0x35')]=_[_0x5c2a('0x36')](_0x3cbfc9['model'],_0x3cbfc9[_0x5c2a('0x33')]);_0xbe59d1[_0x5c2a('0x37')]=_[_0x5c2a('0x36')](_0x3cbfc9[_0x5c2a('0x32')],qs[_0x5c2a('0x38')](_0xd1cfe2[_0x5c2a('0x33')]['fields']));_0xbe59d1[_0x5c2a('0x37')]=_0xbe59d1[_0x5c2a('0x37')][_0x5c2a('0x39')]?_0xbe59d1[_0x5c2a('0x37')]:_0x3cbfc9[_0x5c2a('0x32')];if(!_0xd1cfe2[_0x5c2a('0x33')][_0x5c2a('0x3a')](_0x5c2a('0x3b'))){_0xbe59d1[_0x5c2a('0x1d')]=qs['limit'](_0xd1cfe2[_0x5c2a('0x33')]['limit']);_0xbe59d1[_0x5c2a('0x1b')]=qs[_0x5c2a('0x1b')](_0xd1cfe2[_0x5c2a('0x33')][_0x5c2a('0x1b')]);}_0xbe59d1['order']=qs[_0x5c2a('0x3c')](_0xd1cfe2[_0x5c2a('0x33')][_0x5c2a('0x3c')]);_0xbe59d1[_0x5c2a('0x3d')]=qs[_0x5c2a('0x35')](_[_0x5c2a('0x3e')](_0xd1cfe2[_0x5c2a('0x33')],_0x3cbfc9[_0x5c2a('0x35')]),_0x5a0b27);if(_0xd1cfe2[_0x5c2a('0x33')][_0x5c2a('0x3f')]){_0xbe59d1[_0x5c2a('0x3d')]=_[_0x5c2a('0x40')](_0xbe59d1[_0x5c2a('0x3d')],{'$or':_[_0x5c2a('0x2c')](_0x5a0b27,function(_0x331ed0){if(_0x331ed0[_0x5c2a('0x30')]!==_0x5c2a('0x41')){var _0xf79e83={};_0xf79e83[_0x331ed0['name']]={'$like':'%'+_0xd1cfe2[_0x5c2a('0x33')][_0x5c2a('0x3f')]+'%'};return _0xf79e83;}})});}_0xbe59d1=_[_0x5c2a('0x40')]({},_0xbe59d1,_0xd1cfe2[_0x5c2a('0x42')]);var _0x23fc83={'where':_0xbe59d1[_0x5c2a('0x3d')]};return db['UserProfileSection'][_0x5c2a('0x1e')](_0x23fc83)[_0x5c2a('0x26')](function(_0x43bc0a){_0x4a4818['count']=_0x43bc0a;if(_0xd1cfe2[_0x5c2a('0x33')][_0x5c2a('0x43')]){_0xbe59d1[_0x5c2a('0x44')]=[{'all':!![]}];}return db[_0x5c2a('0x2d')][_0x5c2a('0x45')](_0xbe59d1);})[_0x5c2a('0x26')](function(_0x19ca3c){_0x4a4818[_0x5c2a('0x46')]=_0x19ca3c;return _0x4a4818;})[_0x5c2a('0x26')](respondWithFilteredResult(_0x417cd9,_0xbe59d1))[_0x5c2a('0x47')](handleError(_0x417cd9,null));};exports[_0x5c2a('0x48')]=function(_0x23f339,_0x11f5d7){var _0x62f2e3={'raw':![],'where':{'id':_0x23f339[_0x5c2a('0x49')]['id']}},_0x395b4d={};_0x395b4d['model']=_[_0x5c2a('0x34')](db[_0x5c2a('0x2d')]['rawAttributes']);_0x395b4d[_0x5c2a('0x33')]=_['keys'](_0x23f339[_0x5c2a('0x33')]);_0x395b4d[_0x5c2a('0x35')]=_[_0x5c2a('0x36')](_0x395b4d[_0x5c2a('0x32')],_0x395b4d['query']);_0x62f2e3[_0x5c2a('0x37')]=_[_0x5c2a('0x36')](_0x395b4d['model'],qs[_0x5c2a('0x38')](_0x23f339['query'][_0x5c2a('0x38')]));_0x62f2e3[_0x5c2a('0x37')]=_0x62f2e3[_0x5c2a('0x37')][_0x5c2a('0x39')]?_0x62f2e3[_0x5c2a('0x37')]:_0x395b4d[_0x5c2a('0x32')];if(_0x23f339[_0x5c2a('0x33')]['includeAll']){_0x62f2e3[_0x5c2a('0x44')]=[{'all':!![]}];}_0x62f2e3=_[_0x5c2a('0x40')]({},_0x62f2e3,_0x23f339['options']);return db[_0x5c2a('0x2d')][_0x5c2a('0x4a')](_0x62f2e3)[_0x5c2a('0x26')](handleEntityNotFound(_0x11f5d7,null))['then'](respondWithResult(_0x11f5d7,null))['catch'](handleError(_0x11f5d7,null));};exports[_0x5c2a('0x4b')]=function(_0x8e7c34,_0xed1360){return db[_0x5c2a('0x2d')][_0x5c2a('0x4b')](_0x8e7c34[_0x5c2a('0x4c')],{})['then'](respondWithResult(_0xed1360,0xc9))[_0x5c2a('0x47')](handleError(_0xed1360,null));};exports[_0x5c2a('0x25')]=function(_0x290cfa,_0x360f2a){if(_0x290cfa[_0x5c2a('0x4c')]['id']){delete _0x290cfa['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x290cfa['params']['id']}})[_0x5c2a('0x26')](handleEntityNotFound(_0x360f2a,null))[_0x5c2a('0x26')](saveUpdates(_0x290cfa[_0x5c2a('0x4c')],null))[_0x5c2a('0x26')](respondWithResult(_0x360f2a,null))[_0x5c2a('0x47')](handleError(_0x360f2a,null));};exports['destroy']=function(_0x407d4c,_0x1cbf53){return db[_0x5c2a('0x2d')]['find']({'where':{'id':_0x407d4c[_0x5c2a('0x49')]['id']}})[_0x5c2a('0x26')](handleEntityNotFound(_0x1cbf53,null))[_0x5c2a('0x26')](removeEntity(_0x1cbf53,null))['catch'](handleError(_0x1cbf53,null));};exports[_0x5c2a('0x4d')]=function(_0x2855bc,_0x5b5eb4){return db[_0x5c2a('0x2d')][_0x5c2a('0x4d')]()[_0x5c2a('0x26')](respondWithResult(_0x5b5eb4,null))[_0x5c2a('0x47')](handleError(_0x5b5eb4,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 206aa2a..8cbf65c 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 _0xbb0e=['request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x29a134,_0x194c27){var _0x136398=function(_0x1def82){while(--_0x1def82){_0x29a134['push'](_0x29a134['shift']());}};_0x136398(++_0x194c27);}(_0xbb0e,0xfa));var _0xebb0=function(_0x243b40,_0x23989d){_0x243b40=_0x243b40-0x0;var _0x621fa8=_0xbb0e[_0x243b40];return _0x621fa8;};'use strict';var _=require(_0xebb0('0x0'));var util=require(_0xebb0('0x1'));var logger=require(_0xebb0('0x2'))('api');var moment=require(_0xebb0('0x3'));var BPromise=require(_0xebb0('0x4'));var rp=require(_0xebb0('0x5'));var fs=require('fs');var path=require(_0xebb0('0x6'));var rimraf=require(_0xebb0('0x7'));var config=require(_0xebb0('0x8'));var attributes=require(_0xebb0('0x9'));module[_0xebb0('0xa')]=function(_0x5b2dd0,_0x28ba8a){return _0x5b2dd0[_0xebb0('0xb')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xebb0('0xc'),'fields':[_0xebb0('0xd'),_0xebb0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71d3=['../../config/logger','api','moment','bluebird','path','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x71d3,0xb4));var _0x371d=function(_0x587220,_0x2ca043){_0x587220=_0x587220-0x0;var _0x17518a=_0x71d3[_0x587220];return _0x17518a;};'use strict';var _=require(_0x371d('0x0'));var util=require(_0x371d('0x1'));var logger=require(_0x371d('0x2'))(_0x371d('0x3'));var moment=require(_0x371d('0x4'));var BPromise=require(_0x371d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x371d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x371d('0x7'));module[_0x371d('0x8')]=function(_0x560370,_0x13be14){return _0x560370[_0x371d('0x9')](_0x371d('0xa'),attributes,{'tableName':_0x371d('0xb'),'paranoid':![],'indexes':[{'name':_0x371d('0xc'),'fields':[_0x371d('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 43aaf14..41965e0 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 _0xfe5e=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x9bbbcb,_0x181ae6){var _0x444240=function(_0x39abf8){while(--_0x39abf8){_0x9bbbcb['push'](_0x9bbbcb['shift']());}};_0x444240(++_0x181ae6);}(_0xfe5e,0x176));var _0xefe5=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0xfe5e[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require('lodash');var util=require(_0xefe5('0x0'));var moment=require('moment');var BPromise=require(_0xefe5('0x1'));var rs=require(_0xefe5('0x2'));var fs=require('fs');var Redis=require(_0xefe5('0x3'));var db=require(_0xefe5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xefe5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xefe5('0x6')][_0xefe5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4254e7,_0x59a38d,_0xa3f10d){return new BPromise(function(_0x3489ec,_0x1e62e0){return client[_0xefe5('0x8')](_0x4254e7,_0xa3f10d)[_0xefe5('0x9')](function(_0x18e139){logger[_0xefe5('0xa')](_0xefe5('0xb'),_0x59a38d,_0xefe5('0xc'));logger[_0xefe5('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x59a38d,'request\x20sent',JSON[_0xefe5('0xe')](_0x18e139));if(_0x18e139['error']){if(_0x18e139[_0xefe5('0xf')][_0xefe5('0x10')]===0x1f4){logger[_0xefe5('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x59a38d,_0x18e139['error'][_0xefe5('0x11')]);return _0x1e62e0(_0x18e139['error'][_0xefe5('0x11')]);}logger[_0xefe5('0xf')](_0xefe5('0xb'),_0x59a38d,_0x18e139[_0xefe5('0xf')][_0xefe5('0x11')]);return _0x3489ec(_0x18e139[_0xefe5('0xf')]['message']);}else{logger[_0xefe5('0xa')](_0xefe5('0xb'),_0x59a38d,_0xefe5('0xc'));_0x3489ec(_0x18e139[_0xefe5('0x12')]['message']);}})[_0xefe5('0x13')](function(_0x1975fa){logger[_0xefe5('0xf')](_0xefe5('0xb'),_0x59a38d,_0x1975fa);_0x1e62e0(_0x1975fa);});});} \ No newline at end of file +var _0x84bf=['error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug'];(function(_0x4b7131,_0x5efa94){var _0x128e5e=function(_0x3413db){while(--_0x3413db){_0x4b7131['push'](_0x4b7131['shift']());}};_0x128e5e(++_0x5efa94);}(_0x84bf,0x1a8));var _0xf84b=function(_0x26b479,_0x25e2c5){_0x26b479=_0x26b479-0x0;var _0x3b98dd=_0x84bf[_0x26b479];return _0x3b98dd;};'use strict';var _=require(_0xf84b('0x0'));var util=require(_0xf84b('0x1'));var moment=require(_0xf84b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf84b('0x3'));var fs=require('fs');var Redis=require(_0xf84b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf84b('0x5'));var config=require(_0xf84b('0x6'));var jayson=require(_0xf84b('0x7'));var client=jayson[_0xf84b('0x8')][_0xf84b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16e07b,_0x16c5a4,_0x49445b){return new BPromise(function(_0x42e333,_0x57056f){return client[_0xf84b('0xa')](_0x16e07b,_0x49445b)['then'](function(_0xe5b02c){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x16c5a4,_0xf84b('0xb'));logger[_0xf84b('0xc')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x16c5a4,_0xf84b('0xb'),JSON['stringify'](_0xe5b02c));if(_0xe5b02c['error']){if(_0xe5b02c[_0xf84b('0xd')][_0xf84b('0xe')]===0x1f4){logger['error'](_0xf84b('0xf'),_0x16c5a4,_0xe5b02c[_0xf84b('0xd')][_0xf84b('0x10')]);return _0x57056f(_0xe5b02c['error']['message']);}logger[_0xf84b('0xd')](_0xf84b('0xf'),_0x16c5a4,_0xe5b02c[_0xf84b('0xd')][_0xf84b('0x10')]);return _0x42e333(_0xe5b02c[_0xf84b('0xd')][_0xf84b('0x10')]);}else{logger['info'](_0xf84b('0xf'),_0x16c5a4,_0xf84b('0xb'));_0x42e333(_0xe5b02c[_0xf84b('0x11')][_0xf84b('0x10')]);}})[_0xf84b('0x12')](function(_0x1bfbb9){logger[_0xf84b('0xd')](_0xf84b('0xf'),_0x16c5a4,_0x1bfbb9);_0x57056f(_0x1bfbb9);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 4151745..db6e21f 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3504f7,_0x16a32c){var _0x4afb61=function(_0x44f455){while(--_0x44f455){_0x3504f7['push'](_0x3504f7['shift']());}};_0x4afb61(++_0x16a32c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xcb91[_0x156a0d];return _0x98a9ba;};'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(_0x224fb9,_0x2a97f6){var _0x2c7212=function(_0x988ff2){while(--_0x988ff2){_0x224fb9['push'](_0x224fb9['shift']());}};_0x2c7212(++_0x2a97f6);}(_0xe706,0xa3));var _0x6e70=function(_0x4e7fa9,_0x29d247){_0x4e7fa9=_0x4e7fa9-0x0;var _0x401f9e=_0xe706[_0x4e7fa9];return _0x401f9e;};'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 cf1671f..de0089b 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 _0xc57c=['INTEGER','sequelize'];(function(_0x4fe221,_0x2b805c){var _0x513eb3=function(_0x2f5a8d){while(--_0x2f5a8d){_0x4fe221['push'](_0x4fe221['shift']());}};_0x513eb3(++_0x2b805c);}(_0xc57c,0x9f));var _0xcc57=function(_0x3babec,_0x4d1223){_0x3babec=_0x3babec-0x0;var _0x395125=_0xc57c[_0x3babec];return _0x395125;};'use strict';var Sequelize=require(_0xcc57('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcc57('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8a7=['sequelize'];(function(_0x4fbf33,_0x318fbc){var _0x1997d2=function(_0xe41ffc){while(--_0xe41ffc){_0x4fbf33['push'](_0x4fbf33['shift']());}};_0x1997d2(++_0x318fbc);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x480c5e,_0x242dc2){_0x480c5e=_0x480c5e-0x0;var _0x259ce9=_0xd8a7[_0x480c5e];return _0x259ce9;};'use strict';var Sequelize=require(_0x7d8a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 5b6892b..aefaeb0 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 _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','UserSmsQueue','user_has_sms_queues'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9206,0x176));var _0x6920=function(_0x16ad96,_0x51849c){_0x16ad96=_0x16ad96-0x0;var _0xca0aaa=_0x9206[_0x16ad96];return _0xca0aaa;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','UserSmsQueue','user_has_sms_queues'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9206,0x176));var _0x6920=function(_0x18a304,_0x43247c){_0x18a304=_0x18a304-0x0;var _0xa28a77=_0x9206[_0x18a304];return _0xa28a77;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index bfa5cac..0328f68 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 _0xf09b=['code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3724d7,_0x21491d){var _0x3557e7=function(_0x317a18){while(--_0x317a18){_0x3724d7['push'](_0x3724d7['shift']());}};_0x3557e7(++_0x21491d);}(_0xf09b,0x144));var _0xbf09=function(_0x16d47e,_0x2ec993){_0x16d47e=_0x16d47e-0x0;var _0x46a14a=_0xf09b[_0x16d47e];return _0x46a14a;};'use strict';var _=require(_0xbf09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbf09('0x1'));var fs=require('fs');var Redis=require(_0xbf09('0x2'));var db=require(_0xbf09('0x3'))['db'];var utils=require(_0xbf09('0x4'));var logger=require(_0xbf09('0x5'))(_0xbf09('0x6'));var config=require(_0xbf09('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x354994,_0x35bce1,_0x44873d){return new BPromise(function(_0x3f997d,_0x4e59ad){return client[_0xbf09('0x9')](_0x354994,_0x44873d)['then'](function(_0xfae478){logger[_0xbf09('0xa')](_0xbf09('0xb'),_0x35bce1,_0xbf09('0xc'));logger[_0xbf09('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x35bce1,_0xbf09('0xc'),JSON[_0xbf09('0xe')](_0xfae478));if(_0xfae478[_0xbf09('0xf')]){if(_0xfae478[_0xbf09('0xf')][_0xbf09('0x10')]===0x1f4){logger[_0xbf09('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x35bce1,_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);return _0x4e59ad(_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);}logger['error'](_0xbf09('0xb'),_0x35bce1,_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);return _0x3f997d(_0xfae478[_0xbf09('0xf')][_0xbf09('0x11')]);}else{logger[_0xbf09('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x35bce1,_0xbf09('0xc'));_0x3f997d(_0xfae478[_0xbf09('0x12')][_0xbf09('0x11')]);}})[_0xbf09('0x13')](function(_0x1431df){logger[_0xbf09('0xf')](_0xbf09('0xb'),_0x35bce1,_0x1431df);_0x4e59ad(_0x1431df);});});} \ No newline at end of file +var _0x92e0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring'];(function(_0x384809,_0x29cdf1){var _0x4eeba5=function(_0x46bba0){while(--_0x46bba0){_0x384809['push'](_0x384809['shift']());}};_0x4eeba5(++_0x29cdf1);}(_0x92e0,0x1df));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x092e('0x0'));var moment=require(_0x092e('0x1'));var BPromise=require(_0x092e('0x2'));var rs=require(_0x092e('0x3'));var fs=require('fs');var Redis=require(_0x092e('0x4'));var db=require(_0x092e('0x5'))['db'];var utils=require(_0x092e('0x6'));var logger=require(_0x092e('0x7'))('rpc');var config=require(_0x092e('0x8'));var jayson=require(_0x092e('0x9'));var client=jayson[_0x092e('0xa')][_0x092e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33369a,_0xe753d0,_0xb4c902){return new BPromise(function(_0x2e820f,_0x203e18){return client['request'](_0x33369a,_0xb4c902)[_0x092e('0xc')](function(_0x3b7596){logger['info'](_0x092e('0xd'),_0xe753d0,_0x092e('0xe'));logger[_0x092e('0xf')](_0x092e('0x10'),_0xe753d0,'request\x20sent',JSON[_0x092e('0x11')](_0x3b7596));if(_0x3b7596['error']){if(_0x3b7596[_0x092e('0x12')][_0x092e('0x13')]===0x1f4){logger[_0x092e('0x12')](_0x092e('0xd'),_0xe753d0,_0x3b7596[_0x092e('0x12')]['message']);return _0x203e18(_0x3b7596[_0x092e('0x12')][_0x092e('0x14')]);}logger[_0x092e('0x12')](_0x092e('0xd'),_0xe753d0,_0x3b7596[_0x092e('0x12')]['message']);return _0x2e820f(_0x3b7596[_0x092e('0x12')][_0x092e('0x14')]);}else{logger[_0x092e('0x15')](_0x092e('0xd'),_0xe753d0,_0x092e('0xe'));_0x2e820f(_0x3b7596[_0x092e('0x16')][_0x092e('0x14')]);}})['catch'](function(_0x53628a){logger[_0x092e('0x12')](_0x092e('0xd'),_0xe753d0,_0x53628a);_0x203e18(_0x53628a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 6bb9ba2..c760d4a 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 _0xe9dc=['exports'];(function(_0x34ab11,_0x310543){var _0x28d563=function(_0x572390){while(--_0x572390){_0x34ab11['push'](_0x34ab11['shift']());}};_0x28d563(++_0x310543);}(_0xe9dc,0xcb));var _0xce9d=function(_0x1b8faa,_0x57a8ae){_0x1b8faa=_0x1b8faa-0x0;var _0x4afb97=_0xe9dc[_0x1b8faa];return _0x4afb97;};'use strict';var Sequelize=require('sequelize');module[_0xce9d('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe8a1=['exports','INTEGER','sequelize'];(function(_0x50952b,_0x46476a){var _0x21cbec=function(_0x653c92){while(--_0x653c92){_0x50952b['push'](_0x50952b['shift']());}};_0x21cbec(++_0x46476a);}(_0xe8a1,0x77));var _0x1e8a=function(_0x1854be,_0x14a80b){_0x1854be=_0x1854be-0x0;var _0x3ba8bf=_0xe8a1[_0x1854be];return _0x3ba8bf;};'use strict';var Sequelize=require(_0x1e8a('0x0'));module[_0x1e8a('0x1')]={'UserId':{'type':Sequelize[_0x1e8a('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1e8a('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 7834d8c..8df84dc 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(_0x592ace,_0x5dbc0e){var _0x1a4334=function(_0x15ba5c){while(--_0x15ba5c){_0x592ace['push'](_0x592ace['shift']());}};_0x1a4334(++_0x5dbc0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x203707,_0x3b3bba){var _0x66c73e=function(_0x50f4fb){while(--_0x50f4fb){_0x203707['push'](_0x203707['shift']());}};_0x66c73e(++_0x3b3bba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 ab9b95c..5f1b7bb 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2449cb,_0x33c174){var _0x1f48a0=function(_0x3c0f12){while(--_0x3c0f12){_0x2449cb['push'](_0x2449cb['shift']());}};_0x1f48a0(++_0x33c174);}(_0x70e0,0x17b));var _0x070e=function(_0x15d97b,_0x34014d){_0x15d97b=_0x15d97b-0x0;var _0x39f9f5=_0x70e0[_0x15d97b];return _0x39f9f5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5aa589,_0xa65924){var _0x1925fe=function(_0x306f4d){while(--_0x306f4d){_0x5aa589['push'](_0x5aa589['shift']());}};_0x1925fe(++_0xa65924);}(_0xe706,0xa3));var _0x6e70=function(_0x5234a6,_0x314a5d){_0x5234a6=_0x5234a6-0x0;var _0x1f8955=_0xe706[_0x5234a6];return _0x1f8955;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 1f27d3b..25479ef 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 _0xd5ec=['INTEGER','sequelize','exports'];(function(_0x4ca2b5,_0x539411){var _0x542dc8=function(_0x128bd9){while(--_0x128bd9){_0x4ca2b5['push'](_0x4ca2b5['shift']());}};_0x542dc8(++_0x539411);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xd5ec[_0x4cbf20];return _0x582ae4;};'use strict';var Sequelize=require(_0xcd5e('0x0'));module[_0xcd5e('0x1')]={'penalty':{'type':Sequelize[_0xcd5e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbf4b=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf4b,0x99));var _0xbbf4=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xbf4b[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0xbbf4('0x0'));module[_0xbbf4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index d029f10..101eb37 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 _0x68d0=['./userVoiceQueue.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x68d0,0x175));var _0x068d=function(_0x24bfd4,_0x263061){_0x24bfd4=_0x24bfd4-0x0;var _0x235252=_0x68d0[_0x24bfd4];return _0x235252;};'use strict';var _=require(_0x068d('0x0'));var util=require('util');var logger=require(_0x068d('0x1'))(_0x068d('0x2'));var moment=require(_0x068d('0x3'));var BPromise=require('bluebird');var rp=require(_0x068d('0x4'));var fs=require('fs');var path=require(_0x068d('0x5'));var rimraf=require('rimraf');var config=require(_0x068d('0x6'));var attributes=require(_0x068d('0x7'));module[_0x068d('0x8')]=function(_0x53778e,_0x1a05d0){return _0x53778e[_0x068d('0x9')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb409=['./userVoiceQueue.attributes','define','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x672779,_0x33e3f2){var _0x20c555=function(_0x5b0dc4){while(--_0x5b0dc4){_0x672779['push'](_0x672779['shift']());}};_0x20c555(++_0x33e3f2);}(_0xb409,0x16a));var _0x9b40=function(_0x4b418b,_0x56084d){_0x4b418b=_0x4b418b-0x0;var _0xd7fa42=_0xb409[_0x4b418b];return _0xd7fa42;};'use strict';var _=require(_0x9b40('0x0'));var util=require(_0x9b40('0x1'));var logger=require('../../config/logger')(_0x9b40('0x2'));var moment=require(_0x9b40('0x3'));var BPromise=require(_0x9b40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b40('0x5'));var rimraf=require('rimraf');var config=require(_0x9b40('0x6'));var attributes=require(_0x9b40('0x7'));module['exports']=function(_0x2b7782,_0x10e727){return _0x2b7782[_0x9b40('0x8')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index cd677b7..522bb90 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 _0x5df4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x2338e0,_0x2dd331){var _0x4b6b3a=function(_0x1e22ba){while(--_0x1e22ba){_0x2338e0['push'](_0x2338e0['shift']());}};_0x4b6b3a(++_0x2dd331);}(_0x5df4,0x11f));var _0x45df=function(_0x3dd907,_0x3c7e3d){_0x3dd907=_0x3dd907-0x0;var _0x5f3bf8=_0x5df4[_0x3dd907];return _0x5f3bf8;};'use strict';var _=require(_0x45df('0x0'));var util=require(_0x45df('0x1'));var moment=require(_0x45df('0x2'));var BPromise=require(_0x45df('0x3'));var rs=require(_0x45df('0x4'));var fs=require('fs');var Redis=require(_0x45df('0x5'));var db=require(_0x45df('0x6'))['db'];var utils=require(_0x45df('0x7'));var logger=require('../../config/logger')(_0x45df('0x8'));var config=require(_0x45df('0x9'));var jayson=require(_0x45df('0xa'));var client=jayson[_0x45df('0xb')][_0x45df('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15060f,_0x454f4a,_0x1cd0af){return new BPromise(function(_0x40661d,_0x139a1d){return client[_0x45df('0xd')](_0x15060f,_0x1cd0af)[_0x45df('0xe')](function(_0x28ef27){logger[_0x45df('0xf')](_0x45df('0x10'),_0x454f4a,_0x45df('0x11'));logger[_0x45df('0x12')](_0x45df('0x13'),_0x454f4a,_0x45df('0x11'),JSON[_0x45df('0x14')](_0x28ef27));if(_0x28ef27[_0x45df('0x15')]){if(_0x28ef27['error'][_0x45df('0x16')]===0x1f4){logger[_0x45df('0x15')](_0x45df('0x10'),_0x454f4a,_0x28ef27[_0x45df('0x15')][_0x45df('0x17')]);return _0x139a1d(_0x28ef27[_0x45df('0x15')][_0x45df('0x17')]);}logger[_0x45df('0x15')](_0x45df('0x10'),_0x454f4a,_0x28ef27['error'][_0x45df('0x17')]);return _0x40661d(_0x28ef27['error'][_0x45df('0x17')]);}else{logger[_0x45df('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x454f4a,_0x45df('0x11'));_0x40661d(_0x28ef27['result'][_0x45df('0x17')]);}})['catch'](function(_0x5591ec){logger[_0x45df('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x454f4a,_0x5591ec);_0x139a1d(_0x5591ec);});});} \ No newline at end of file +var _0x283d=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x283d,0xc1));var _0xd283=function(_0x36df81,_0x34fc9e){_0x36df81=_0x36df81-0x0;var _0x2ad5a4=_0x283d[_0x36df81];return _0x2ad5a4;};'use strict';var _=require(_0xd283('0x0'));var util=require(_0xd283('0x1'));var moment=require(_0xd283('0x2'));var BPromise=require(_0xd283('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd283('0x4'));var db=require(_0xd283('0x5'))['db'];var utils=require(_0xd283('0x6'));var logger=require(_0xd283('0x7'))(_0xd283('0x8'));var config=require(_0xd283('0x9'));var jayson=require(_0xd283('0xa'));var client=jayson[_0xd283('0xb')][_0xd283('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b85fa,_0x4001b2,_0x401dd4){return new BPromise(function(_0x518166,_0x22bf87){return client[_0xd283('0xd')](_0x5b85fa,_0x401dd4)['then'](function(_0x4f59c1){logger[_0xd283('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x4001b2,_0xd283('0xf'));logger[_0xd283('0x10')](_0xd283('0x11'),_0x4001b2,_0xd283('0xf'),JSON[_0xd283('0x12')](_0x4f59c1));if(_0x4f59c1[_0xd283('0x13')]){if(_0x4f59c1[_0xd283('0x13')][_0xd283('0x14')]===0x1f4){logger[_0xd283('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x4001b2,_0x4f59c1[_0xd283('0x13')]['message']);return _0x22bf87(_0x4f59c1[_0xd283('0x13')]['message']);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4001b2,_0x4f59c1[_0xd283('0x13')][_0xd283('0x15')]);return _0x518166(_0x4f59c1[_0xd283('0x13')][_0xd283('0x15')]);}else{logger[_0xd283('0xe')](_0xd283('0x16'),_0x4001b2,'request\x20sent');_0x518166(_0x4f59c1['result'][_0xd283('0x15')]);}})[_0xd283('0x17')](function(_0x86051c){logger[_0xd283('0x13')](_0xd283('0x16'),_0x4001b2,_0x86051c);_0x22bf87(_0x86051c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 7a5fc11..95af5e8 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4851ff,_0x1c9a8d){var _0x26773b=function(_0x26c33e){while(--_0x26c33e){_0x4851ff['push'](_0x4851ff['shift']());}};_0x26773b(++_0x1c9a8d);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x514a50,_0xc8f2e7){var _0x3432a8=function(_0xa2c3ef){while(--_0xa2c3ef){_0x514a50['push'](_0x514a50['shift']());}};_0x3432a8(++_0xc8f2e7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xcb91[_0x2ac4af];return _0x3a36df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c097014..8b4b0ad 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 _0xde4e=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1e86b5,_0x42143c){var _0x5a8538=function(_0x28d23a){while(--_0x28d23a){_0x1e86b5['push'](_0x1e86b5['shift']());}};_0x5a8538(++_0x42143c);}(_0xde4e,0x1ec));var _0xede4=function(_0x447413,_0x1835da){_0x447413=_0x447413-0x0;var _0x3247a9=_0xde4e[_0x447413];return _0x3247a9;};'use strict';var Sequelize=require(_0xede4('0x0'));module[_0xede4('0x1')]={'uniqueid':{'type':Sequelize[_0xede4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xede4('0x3')},'membername':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'comment':_0xede4('0x3')},'UserId':{'type':Sequelize[_0xede4('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xede4('0x3')},'VoiceQueueId':{'type':Sequelize[_0xede4('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xede4('0x4')],'allowNull':![],'unique':_0xede4('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xede4('0x2')](0xb),'defaultValue':0x0,'comment':_0xede4('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xede4('0x3')}}; \ No newline at end of file +var _0x31a2=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0xde241c,_0x2dced6){var _0x3037ad=function(_0x5df117){while(--_0x5df117){_0xde241c['push'](_0xde241c['shift']());}};_0x3037ad(++_0x2dced6);}(_0x31a2,0xda));var _0x231a=function(_0x3c7d23,_0x2f3094){_0x3c7d23=_0x3c7d23-0x0;var _0x50eb90=_0x31a2[_0x3c7d23];return _0x50eb90;};'use strict';var Sequelize=require(_0x231a('0x0'));module[_0x231a('0x1')]={'uniqueid':{'type':Sequelize[_0x231a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x231a('0x3')},'membername':{'type':Sequelize[_0x231a('0x4')],'allowNull':![],'comment':_0x231a('0x3')},'UserId':{'type':Sequelize[_0x231a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x231a('0x5'),'comment':_0x231a('0x3')},'VoiceQueueId':{'type':Sequelize[_0x231a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x231a('0x4')],'allowNull':![],'unique':_0x231a('0x5'),'comment':_0x231a('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x231a('0x3')},'paused':{'type':Sequelize[_0x231a('0x2')](0xb),'defaultValue':0x0,'comment':_0x231a('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index b6b6743..0f5b066 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 _0x69e3=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x260a35,_0x2f7c1c){var _0x10ba0a=function(_0x1bddb2){while(--_0x1bddb2){_0x260a35['push'](_0x260a35['shift']());}};_0x10ba0a(++_0x2f7c1c);}(_0x69e3,0x9b));var _0x369e=function(_0x267280,_0x447862){_0x267280=_0x267280-0x0;var _0x1015ef=_0x69e3[_0x267280];return _0x1015ef;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x369e('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x369e('0x1')](0x0);var events={'afterCreate':_0x369e('0x2'),'afterUpdate':_0x369e('0x3'),'afterDestroy':_0x369e('0x4')};function emitEvent(_0x4f6951){return function(_0x180097,_0x1e65e4,_0x4acaa4){UserVoiceQueueRtEvents[_0x369e('0x5')](_0x4f6951+':'+_0x180097['id'],_0x180097);UserVoiceQueueRtEvents[_0x369e('0x5')](_0x4f6951,_0x180097);_0x4acaa4(null);};}for(var e in events){if(events[_0x369e('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x369e('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa9d6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','UserVoiceQueueRt'];(function(_0x376c1f,_0x4a70ae){var _0x1295e4=function(_0x52e170){while(--_0x52e170){_0x376c1f['push'](_0x376c1f['shift']());}};_0x1295e4(++_0x4a70ae);}(_0xa9d6,0x87));var _0x6a9d=function(_0x259ce9,_0x582513){_0x259ce9=_0x259ce9-0x0;var _0x276047=_0xa9d6[_0x259ce9];return _0x276047;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x6a9d('0x0')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6a9d('0x1')](0x0);var events={'afterCreate':_0x6a9d('0x2'),'afterUpdate':_0x6a9d('0x3'),'afterDestroy':_0x6a9d('0x4')};function emitEvent(_0x405d85){return function(_0x25d645,_0x939e3,_0x2bff7c){UserVoiceQueueRtEvents[_0x6a9d('0x5')](_0x405d85+':'+_0x25d645['id'],_0x25d645);UserVoiceQueueRtEvents[_0x6a9d('0x5')](_0x405d85,_0x25d645);_0x2bff7c(null);};}for(var e in events){if(events[_0x6a9d('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x6a9d('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c00b099..2f5dea9 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 _0xa293=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','api','moment','bluebird'];(function(_0x41db4d,_0xad6d70){var _0x17047b=function(_0x287fbd){while(--_0x287fbd){_0x41db4d['push'](_0x41db4d['shift']());}};_0x17047b(++_0xad6d70);}(_0xa293,0x1f0));var _0x3a29=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa293[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x3a29('0x0'));var logger=require('../../config/logger')(_0x3a29('0x1'));var moment=require(_0x3a29('0x2'));var BPromise=require(_0x3a29('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3a29('0x4'));var config=require(_0x3a29('0x5'));var attributes=require(_0x3a29('0x6'));module[_0x3a29('0x7')]=function(_0x15dde3,_0x45b218){return _0x15dde3['define'](_0x3a29('0x8'),attributes,{'tableName':_0x3a29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5e0=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xc5e0,0xa0));var _0x0c5e=function(_0x5e9945,_0x104e7b){_0x5e9945=_0x5e9945-0x0;var _0x231011=_0xc5e0[_0x5e9945];return _0x231011;};'use strict';var _=require(_0x0c5e('0x0'));var util=require(_0x0c5e('0x1'));var logger=require(_0x0c5e('0x2'))(_0x0c5e('0x3'));var moment=require(_0x0c5e('0x4'));var BPromise=require(_0x0c5e('0x5'));var rp=require(_0x0c5e('0x6'));var fs=require('fs');var path=require(_0x0c5e('0x7'));var rimraf=require(_0x0c5e('0x8'));var config=require(_0x0c5e('0x9'));var attributes=require(_0x0c5e('0xa'));module[_0x0c5e('0xb')]=function(_0x8ff335,_0x252449){return _0x8ff335[_0x0c5e('0xc')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 1efe8c5..b34d965 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 _0x3873=['client','redis','defaults','localhost','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3caa00,_0x294435){var _0x3d478f=function(_0x1e7879){while(--_0x1e7879){_0x3caa00['push'](_0x3caa00['shift']());}};_0x3d478f(++_0x294435);}(_0x3873,0xc9));var _0x3387=function(_0x41aa5a,_0x2dbf0f){_0x41aa5a=_0x41aa5a-0x0;var _0x2e37a4=_0x3873[_0x41aa5a];return _0x2e37a4;};'use strict';var _=require(_0x3387('0x0'));var util=require(_0x3387('0x1'));var moment=require(_0x3387('0x2'));var BPromise=require(_0x3387('0x3'));var rs=require(_0x3387('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3387('0x5'))['db'];var utils=require(_0x3387('0x6'));var logger=require(_0x3387('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3387('0x8'));var client=jayson[_0x3387('0x9')]['http']({'port':0x232a});config[_0x3387('0xa')]=_[_0x3387('0xb')](config[_0x3387('0xa')],{'host':_0x3387('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3387('0xa')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x3f803d,_0x5a22c7,_0x4167eb){return new BPromise(function(_0x2b531d,_0x566761){return client['request'](_0x3f803d,_0x4167eb)[_0x3387('0xd')](function(_0x20a55a){logger['info'](_0x3387('0xe'),_0x5a22c7,_0x3387('0xf'));logger[_0x3387('0x10')](_0x3387('0x11'),_0x5a22c7,'request\x20sent',JSON[_0x3387('0x12')](_0x20a55a));if(_0x20a55a[_0x3387('0x13')]){if(_0x20a55a[_0x3387('0x13')][_0x3387('0x14')]===0x1f4){logger['error'](_0x3387('0xe'),_0x5a22c7,_0x20a55a[_0x3387('0x13')][_0x3387('0x15')]);return _0x566761(_0x20a55a['error'][_0x3387('0x15')]);}logger['error'](_0x3387('0xe'),_0x5a22c7,_0x20a55a['error']['message']);return _0x2b531d(_0x20a55a[_0x3387('0x13')]['message']);}else{logger[_0x3387('0x16')](_0x3387('0xe'),_0x5a22c7,'request\x20sent');_0x2b531d(_0x20a55a[_0x3387('0x17')][_0x3387('0x15')]);}})['catch'](function(_0x642521){logger[_0x3387('0x13')](_0x3387('0xe'),_0x5a22c7,_0x642521);_0x566761(_0x642521);});});}exports[_0x3387('0x18')]=function(_0x4efff9){var _0x1987c3=this;return new Promise(function(_0x1b97cb,_0x2decd6){return db[_0x3387('0x19')][_0x3387('0x1a')]({'raw':_0x4efff9[_0x3387('0x1b')]?_0x4efff9[_0x3387('0x1b')][_0x3387('0x1c')]===undefined?!![]:![]:!![],'where':_0x4efff9[_0x3387('0x1b')]?_0x4efff9[_0x3387('0x1b')][_0x3387('0x1d')]||null:null,'attributes':[[db[_0x3387('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3387('0x1e')][_0x3387('0x1f')](_0x3387('0x20')))),_0x3387('0x21')]]})[_0x3387('0xd')](function(_0x3dd8da){logger[_0x3387('0x16')](_0x3387('0x18'),_0x4efff9);logger[_0x3387('0x10')](_0x3387('0x18'),_0x4efff9,JSON['stringify'](_0x3dd8da));_0x1b97cb(_0x3dd8da);})[_0x3387('0x22')](function(_0x518a85){logger[_0x3387('0x13')](_0x3387('0x18'),_0x518a85[_0x3387('0x15')],_0x4efff9);_0x2decd6(_0x1987c3[_0x3387('0x13')](0x1f4,_0x518a85['message']));});});}; \ No newline at end of file +var _0x2547=['raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','then','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options'];(function(_0x487496,_0x201994){var _0xed83e3=function(_0x4aa9eb){while(--_0x4aa9eb){_0x487496['push'](_0x487496['shift']());}};_0xed83e3(++_0x201994);}(_0x2547,0x9b));var _0x7254=function(_0x420862,_0x42a2f4){_0x420862=_0x420862-0x0;var _0x43d6e7=_0x2547[_0x420862];return _0x43d6e7;};'use strict';var _=require(_0x7254('0x0'));var util=require(_0x7254('0x1'));var moment=require(_0x7254('0x2'));var BPromise=require('bluebird');var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7254('0x4'))['db'];var utils=require(_0x7254('0x5'));var logger=require(_0x7254('0x6'))('rpc');var config=require(_0x7254('0x7'));var jayson=require(_0x7254('0x8'));var client=jayson[_0x7254('0x9')][_0x7254('0xa')]({'port':0x232a});config[_0x7254('0xb')]=_[_0x7254('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7254('0xd'))(new Redis(config['redis']));require(_0x7254('0xe'))[_0x7254('0xf')](socket);function respondWithRpcPromise(_0x53d5c,_0x3a8341,_0x352b9d){return new BPromise(function(_0x86f414,_0x18a646){return client[_0x7254('0x10')](_0x53d5c,_0x352b9d)['then'](function(_0x519c16){logger['info'](_0x7254('0x11'),_0x3a8341,_0x7254('0x12'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3a8341,'request\x20sent',JSON[_0x7254('0x13')](_0x519c16));if(_0x519c16['error']){if(_0x519c16[_0x7254('0x14')][_0x7254('0x15')]===0x1f4){logger[_0x7254('0x14')](_0x7254('0x11'),_0x3a8341,_0x519c16[_0x7254('0x14')][_0x7254('0x16')]);return _0x18a646(_0x519c16['error'][_0x7254('0x16')]);}logger[_0x7254('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3a8341,_0x519c16[_0x7254('0x14')][_0x7254('0x16')]);return _0x86f414(_0x519c16[_0x7254('0x14')][_0x7254('0x16')]);}else{logger[_0x7254('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3a8341,_0x7254('0x12'));_0x86f414(_0x519c16[_0x7254('0x18')][_0x7254('0x16')]);}})[_0x7254('0x19')](function(_0x1eca38){logger[_0x7254('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3a8341,_0x1eca38);_0x18a646(_0x1eca38);});});}exports[_0x7254('0x1a')]=function(_0x3f3a95){var _0x4106bc=this;return new Promise(function(_0xd90835,_0x57cfeb){return db[_0x7254('0x1b')][_0x7254('0x1c')]({'raw':_0x3f3a95[_0x7254('0x1d')]?_0x3f3a95[_0x7254('0x1d')][_0x7254('0x1e')]===undefined?!![]:![]:!![],'where':_0x3f3a95[_0x7254('0x1d')]?_0x3f3a95['options'][_0x7254('0x1f')]||null:null,'attributes':[[db[_0x7254('0x20')]['fn']('COUNT',db[_0x7254('0x20')]['fn']('IF',db[_0x7254('0x20')][_0x7254('0x21')](_0x7254('0x22')))),'outboundQueuePauses']]})[_0x7254('0x23')](function(_0x197ba9){logger['info'](_0x7254('0x1a'),_0x3f3a95);logger[_0x7254('0x24')](_0x7254('0x1a'),_0x3f3a95,JSON[_0x7254('0x13')](_0x197ba9));_0xd90835(_0x197ba9);})[_0x7254('0x19')](function(_0x344a05){logger[_0x7254('0x14')](_0x7254('0x1a'),_0x344a05['message'],_0x3f3a95);_0x57cfeb(_0x4106bc[_0x7254('0x14')](0x1f4,_0x344a05[_0x7254('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b880eac..afdb8c0 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 _0x5a2a=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x4940bf,_0x23f29e){var _0x2d7d57=function(_0x50a867){while(--_0x50a867){_0x4940bf['push'](_0x4940bf['shift']());}};_0x2d7d57(++_0x23f29e);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x136e3f,_0x100db1){_0x136e3f=_0x136e3f-0x0;var _0x52f8ab=_0x5a2a[_0x136e3f];return _0x52f8ab;};'use strict';var UserVoiceQueueRtEvents=require(_0xa5a2('0x0'));var events=[_0xa5a2('0x1'),_0xa5a2('0x2'),_0xa5a2('0x3')];function createListener(_0x5d3456,_0x525e94){return function(_0x48308f){_0x525e94[_0xa5a2('0x4')](_0x5d3456,_0x48308f);};}function removeListener(_0x2cf196,_0x479d0a){return function(){UserVoiceQueueRtEvents[_0xa5a2('0x5')](_0x2cf196,_0x479d0a);};}exports[_0xa5a2('0x6')]=function(_0x2e97d3){for(var _0x55728b=0x0,_0x179722=events['length'];_0x55728b<_0x179722;_0x55728b++){var _0x38a5fe=events[_0x55728b];var _0x97f75c=createListener(_0xa5a2('0x7')+_0x38a5fe,_0x2e97d3);UserVoiceQueueRtEvents['on'](_0x38a5fe,_0x97f75c);}}; \ No newline at end of file +var _0x308a=['remove','update','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x20ffee,_0x4c40f4){var _0x280c4d=function(_0x42d88f){while(--_0x42d88f){_0x20ffee['push'](_0x20ffee['shift']());}};_0x280c4d(++_0x4c40f4);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var UserVoiceQueueRtEvents=require(_0xa308('0x0'));var events=['save',_0xa308('0x1'),_0xa308('0x2')];function createListener(_0x25cba2,_0x844924){return function(_0x599262){_0x844924['emit'](_0x25cba2,_0x599262);};}function removeListener(_0x3a294d,_0x99d71a){return function(){UserVoiceQueueRtEvents[_0xa308('0x3')](_0x3a294d,_0x99d71a);};}exports[_0xa308('0x4')]=function(_0x26d8a4){for(var _0x322331=0x0,_0xc30239=events['length'];_0x322331<_0xc30239;_0x322331++){var _0x5b8a23=events[_0x322331];var _0x2ca45e=createListener(_0xa308('0x5')+_0x5b8a23,_0x26d8a4);UserVoiceQueueRtEvents['on'](_0x5b8a23,_0x2ca45e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 24975be..bc1b277 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x40d296,_0x37eb65){var _0xf9a9f1=function(_0x52930d){while(--_0x52930d){_0x40d296['push'](_0x40d296['shift']());}};_0xf9a9f1(++_0x37eb65);}(_0xe706,0xa3));var _0x6e70=function(_0x517724,_0x51e5c0){_0x517724=_0x517724-0x0;var _0x4c73a5=_0xe706[_0x517724];return _0x4c73a5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19ee06,_0xf03a06){var _0x517478=function(_0x51058e){while(--_0x51058e){_0x19ee06['push'](_0x19ee06['shift']());}};_0x517478(++_0xf03a06);}(_0xe706,0xa3));var _0x6e70=function(_0x6d97b2,_0x3c1332){_0x6d97b2=_0x6d97b2-0x0;var _0x514465=_0xe706[_0x6d97b2];return _0x514465;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 72dc0ec..841c3e5 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 _0xedcb=['INTEGER','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xedcb,0x1eb));var _0xbedc=function(_0x19d6c1,_0x154e43){_0x19d6c1=_0x19d6c1-0x0;var _0x216ff7=_0xedcb[_0x19d6c1];return _0x216ff7;};'use strict';var Sequelize=require('sequelize');module[_0xbedc('0x0')]={'penalty':{'type':Sequelize[_0xbedc('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe3e0=['exports','INTEGER'];(function(_0x27e150,_0x358be2){var _0x4c238c=function(_0x593c42){while(--_0x593c42){_0x27e150['push'](_0x27e150['shift']());}};_0x4c238c(++_0x358be2);}(_0xe3e0,0x188));var _0x0e3e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe3e0[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require('sequelize');module[_0x0e3e('0x0')]={'penalty':{'type':Sequelize[_0x0e3e('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 779e26e..0b19d59 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 _0x3363=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api'];(function(_0x1efb37,_0x36569f){var _0x154cb0=function(_0x575ea4){while(--_0x575ea4){_0x1efb37['push'](_0x1efb37['shift']());}};_0x154cb0(++_0x36569f);}(_0x3363,0x115));var _0x3336=function(_0x44a57e,_0x320cad){_0x44a57e=_0x44a57e-0x0;var _0x8632f=_0x3363[_0x44a57e];return _0x8632f;};'use strict';var _=require('lodash');var util=require(_0x3336('0x0'));var logger=require(_0x3336('0x1'))(_0x3336('0x2'));var moment=require(_0x3336('0x3'));var BPromise=require(_0x3336('0x4'));var rp=require(_0x3336('0x5'));var fs=require('fs');var path=require(_0x3336('0x6'));var rimraf=require(_0x3336('0x7'));var config=require(_0x3336('0x8'));var attributes=require(_0x3336('0x9'));module[_0x3336('0xa')]=function(_0x261075,_0x3694d8){return _0x261075[_0x3336('0xb')](_0x3336('0xc'),attributes,{'tableName':_0x3336('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87c8=['./userWhatsappQueue.attributes','exports','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x179bd7,_0x51271e){var _0x3d93ce=function(_0x1a5002){while(--_0x1a5002){_0x179bd7['push'](_0x179bd7['shift']());}};_0x3d93ce(++_0x51271e);}(_0x87c8,0x7c));var _0x887c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x87c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x887c('0x0'));var util=require(_0x887c('0x1'));var logger=require('../../config/logger')(_0x887c('0x2'));var moment=require(_0x887c('0x3'));var BPromise=require(_0x887c('0x4'));var rp=require(_0x887c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x887c('0x6'));var config=require(_0x887c('0x7'));var attributes=require(_0x887c('0x8'));module[_0x887c('0x9')]=function(_0x5126b4,_0x3950d){return _0x5126b4['define']('UserWhatsappQueue',attributes,{'tableName':_0x887c('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 76ad5eb..a21eb10 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 _0x5d54=['../../config/logger','rpc','../../config/environment','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','ioredis','../../config/utils'];(function(_0x5c72f5,_0x3fbd86){var _0x4b35cb=function(_0x2104c6){while(--_0x2104c6){_0x5c72f5['push'](_0x5c72f5['shift']());}};_0x4b35cb(++_0x3fbd86);}(_0x5d54,0x1be));var _0x45d5=function(_0x206eec,_0x1d4bbf){_0x206eec=_0x206eec-0x0;var _0x2f7e08=_0x5d54[_0x206eec];return _0x2f7e08;};'use strict';var _=require(_0x45d5('0x0'));var util=require('util');var moment=require(_0x45d5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45d5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x45d5('0x3'));var logger=require(_0x45d5('0x4'))(_0x45d5('0x5'));var config=require(_0x45d5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45d5('0x7')][_0x45d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48a9b7,_0x5d4cf5,_0x31773d){return new BPromise(function(_0x1d425e,_0x25a20c){return client['request'](_0x48a9b7,_0x31773d)[_0x45d5('0x9')](function(_0x2a218f){logger[_0x45d5('0xa')](_0x45d5('0xb'),_0x5d4cf5,_0x45d5('0xc'));logger[_0x45d5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5d4cf5,_0x45d5('0xc'),JSON[_0x45d5('0xe')](_0x2a218f));if(_0x2a218f['error']){if(_0x2a218f[_0x45d5('0xf')]['code']===0x1f4){logger[_0x45d5('0xf')](_0x45d5('0xb'),_0x5d4cf5,_0x2a218f[_0x45d5('0xf')][_0x45d5('0x10')]);return _0x25a20c(_0x2a218f[_0x45d5('0xf')][_0x45d5('0x10')]);}logger[_0x45d5('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5d4cf5,_0x2a218f[_0x45d5('0xf')][_0x45d5('0x10')]);return _0x1d425e(_0x2a218f['error'][_0x45d5('0x10')]);}else{logger[_0x45d5('0xa')](_0x45d5('0xb'),_0x5d4cf5,_0x45d5('0xc'));_0x1d425e(_0x2a218f['result'][_0x45d5('0x10')]);}})[_0x45d5('0x11')](function(_0x3ceb08){logger['error'](_0x45d5('0xb'),_0x5d4cf5,_0x3ceb08);_0x25a20c(_0x3ceb08);});});} \ No newline at end of file +var _0x60a5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment'];(function(_0x3345cf,_0x5878c3){var _0x418b08=function(_0x396af9){while(--_0x396af9){_0x3345cf['push'](_0x3345cf['shift']());}};_0x418b08(++_0x5878c3);}(_0x60a5,0x91));var _0x560a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x60a5[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x560a('0x0'));var util=require('util');var moment=require(_0x560a('0x1'));var BPromise=require('bluebird');var rs=require(_0x560a('0x2'));var fs=require('fs');var Redis=require(_0x560a('0x3'));var db=require(_0x560a('0x4'))['db'];var utils=require(_0x560a('0x5'));var logger=require(_0x560a('0x6'))('rpc');var config=require(_0x560a('0x7'));var jayson=require(_0x560a('0x8'));var client=jayson[_0x560a('0x9')][_0x560a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17a4fe,_0x27ff40,_0x40c77b){return new BPromise(function(_0x2b3d93,_0x3caf16){return client['request'](_0x17a4fe,_0x40c77b)[_0x560a('0xb')](function(_0x319270){logger[_0x560a('0xc')](_0x560a('0xd'),_0x27ff40,'request\x20sent');logger[_0x560a('0xe')](_0x560a('0xf'),_0x27ff40,_0x560a('0x10'),JSON['stringify'](_0x319270));if(_0x319270[_0x560a('0x11')]){if(_0x319270[_0x560a('0x11')][_0x560a('0x12')]===0x1f4){logger[_0x560a('0x11')](_0x560a('0xd'),_0x27ff40,_0x319270[_0x560a('0x11')]['message']);return _0x3caf16(_0x319270[_0x560a('0x11')][_0x560a('0x13')]);}logger[_0x560a('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x27ff40,_0x319270[_0x560a('0x11')][_0x560a('0x13')]);return _0x2b3d93(_0x319270[_0x560a('0x11')][_0x560a('0x13')]);}else{logger[_0x560a('0xc')](_0x560a('0xd'),_0x27ff40,_0x560a('0x10'));_0x2b3d93(_0x319270[_0x560a('0x14')][_0x560a('0x13')]);}})['catch'](function(_0x3af3af){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x27ff40,_0x3af3af);_0x3caf16(_0x3af3af);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 0035bd6..c64a64f 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 _0x279d=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x279d,0x1d8));var _0xd279=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x279d[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0xd279('0x0'));var util=require(_0xd279('0x1'));var path=require(_0xd279('0x2'));var timeout=require(_0xd279('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd279('0x4'));var auth=require(_0xd279('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd279('0x6'));var controller=require(_0xd279('0x7'));router[_0xd279('0x8')]('/',auth[_0xd279('0x9')](),controller[_0xd279('0xa')]);router[_0xd279('0x8')](_0xd279('0xb'),auth['isAuthenticated'](),controller[_0xd279('0xc')]);router[_0xd279('0xd')]('/',auth[_0xd279('0x9')](),controller[_0xd279('0xe')]);router[_0xd279('0xf')](_0xd279('0xb'),auth[_0xd279('0x9')](),controller[_0xd279('0x10')]);router[_0xd279('0x11')](_0xd279('0xb'),auth[_0xd279('0x9')](),controller['destroy']);module[_0xd279('0x12')]=router; \ No newline at end of file +var _0xff98=['fs-extra','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','util','path','connect-timeout','express'];(function(_0x21d8bb,_0x39a957){var _0x4a9d05=function(_0x124795){while(--_0x124795){_0x21d8bb['push'](_0x21d8bb['shift']());}};_0x4a9d05(++_0x39a957);}(_0xff98,0x9c));var _0x8ff9=function(_0x203514,_0x299e10){_0x203514=_0x203514-0x0;var _0xf371d2=_0xff98[_0x203514];return _0xf371d2;};'use strict';var multer=require('multer');var util=require(_0x8ff9('0x0'));var path=require(_0x8ff9('0x1'));var timeout=require(_0x8ff9('0x2'));var express=require(_0x8ff9('0x3'));var router=express['Router']();var fs_extra=require(_0x8ff9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8ff9('0x5'));var config=require('../../config/environment');var controller=require(_0x8ff9('0x6'));router['get']('/',auth[_0x8ff9('0x7')](),controller[_0x8ff9('0x8')]);router[_0x8ff9('0x9')](_0x8ff9('0xa'),auth[_0x8ff9('0x7')](),controller[_0x8ff9('0xb')]);router[_0x8ff9('0xc')]('/',auth[_0x8ff9('0x7')](),controller['create']);router[_0x8ff9('0xd')](_0x8ff9('0xa'),auth[_0x8ff9('0x7')](),controller[_0x8ff9('0xe')]);router[_0x8ff9('0xf')](_0x8ff9('0xa'),auth[_0x8ff9('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 2dc2b36..6cde2b0 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 _0x5dbc=['STRING','name','sequelize'];(function(_0x393ae3,_0x279c90){var _0x355bf1=function(_0x54624c){while(--_0x54624c){_0x393ae3['push'](_0x393ae3['shift']());}};_0x355bf1(++_0x279c90);}(_0x5dbc,0x16a));var _0xc5db=function(_0x47f057,_0x2cc340){_0x47f057=_0x47f057-0x0;var _0xa4173d=_0x5dbc[_0x47f057];return _0xa4173d;};'use strict';var Sequelize=require(_0xc5db('0x0'));module['exports']={'name':{'type':Sequelize[_0xc5db('0x1')],'unique':_0xc5db('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc5db('0x1')]}}; \ No newline at end of file +var _0x28ed=['exports','name','STRING'];(function(_0x58b193,_0x37a37e){var _0x1af4c1=function(_0xdb119f){while(--_0xdb119f){_0x58b193['push'](_0x58b193['shift']());}};_0x1af4c1(++_0x37a37e);}(_0x28ed,0x1b9));var _0xd28e=function(_0x43ba73,_0x88b5e7){_0x43ba73=_0x43ba73-0x0;var _0x36df80=_0x28ed[_0x43ba73];return _0x36df80;};'use strict';var Sequelize=require('sequelize');module[_0xd28e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xd28e('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd28e('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 35fc5ba..449ebe0 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 _0x562d=['show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','get','Variables','UserProfileResource','then','error','stack','name','send','index','map','Variable','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','include','rows','catch'];(function(_0xf5fbb7,_0xdb7f69){var _0x330d55=function(_0x45fd85){while(--_0x45fd85){_0xf5fbb7['push'](_0xf5fbb7['shift']());}};_0x330d55(++_0xdb7f69);}(_0x562d,0xb3));var _0xd562=function(_0x27f538,_0x1756e1){_0x27f538=_0x27f538-0x0;var _0xb2dd39=_0x562d[_0x27f538];return _0xb2dd39;};'use strict';var emlformat=require(_0xd562('0x0'));var rimraf=require(_0xd562('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd562('0x2'));var rp=require(_0xd562('0x3'));var moment=require('moment');var BPromise=require(_0xd562('0x4'));var Mustache=require(_0xd562('0x5'));var util=require(_0xd562('0x6'));var path=require(_0xd562('0x7'));var sox=require(_0xd562('0x8'));var csv=require(_0xd562('0x9'));var ejs=require(_0xd562('0xa'));var fs=require('fs');var fs_extra=require(_0xd562('0xb'));var _=require('lodash');var squel=require(_0xd562('0xc'));var crypto=require(_0xd562('0xd'));var jsforce=require(_0xd562('0xe'));var deskjs=require(_0xd562('0xf'));var toCsv=require(_0xd562('0x9'));var querystring=require(_0xd562('0x10'));var Papa=require(_0xd562('0x11'));var Redis=require(_0xd562('0x12'));var authService=require(_0xd562('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd562('0x14'));var hardwareService=require(_0xd562('0x15'));var logger=require(_0xd562('0x16'))(_0xd562('0x17'));var utils=require(_0xd562('0x18'));var config=require(_0xd562('0x19'));var licenseUtil=require(_0xd562('0x1a'));var db=require(_0xd562('0x1b'))['db'];function respondWithStatusCode(_0x4f9110,_0x16d03f){_0x16d03f=_0x16d03f||0xcc;return function(_0x497a96){if(_0x497a96){return _0x4f9110[_0xd562('0x1c')](_0x16d03f);}return _0x4f9110['status'](_0x16d03f)[_0xd562('0x1d')]();};}function respondWithResult(_0x2946a1,_0x5315b0){_0x5315b0=_0x5315b0||0xc8;return function(_0x128683){if(_0x128683){return _0x2946a1[_0xd562('0x1e')](_0x5315b0)[_0xd562('0x1f')](_0x128683);}};}function respondWithFilteredResult(_0x362357,_0x3b8f3c){return function(_0xed6631){if(_0xed6631){var _0x4f4536=typeof _0x3b8f3c['offset']===_0xd562('0x20')&&typeof _0x3b8f3c['limit']===_0xd562('0x20');var _0x2b2824=_0xed6631[_0xd562('0x21')];var _0x18167d=_0x4f4536?0x0:_0x3b8f3c[_0xd562('0x22')];var _0x3c118e=_0x4f4536?_0xed6631['count']:_0x3b8f3c[_0xd562('0x22')]+_0x3b8f3c[_0xd562('0x23')];var _0x5357c4;if(_0x3c118e>=_0x2b2824){_0x3c118e=_0x2b2824;_0x5357c4=0xc8;}else{_0x5357c4=0xce;}_0x362357[_0xd562('0x1e')](_0x5357c4);return _0x362357[_0xd562('0x24')](_0xd562('0x25'),_0x18167d+'-'+_0x3c118e+'/'+_0x2b2824)[_0xd562('0x1f')](_0xed6631);}return null;};}function patchUpdates(_0x23aaf8){return function(_0x46a9f4){try{jsonpatch['apply'](_0x46a9f4,_0x23aaf8,!![]);}catch(_0x5bc17f){return BPromise['reject'](_0x5bc17f);}return _0x46a9f4[_0xd562('0x26')]();};}function saveUpdates(_0x25bd76,_0x23c828){return function(_0x3b5a08){if(_0x3b5a08){return _0x3b5a08[_0xd562('0x27')](_0x25bd76)['then'](function(_0x29854d){return _0x29854d;});}return null;};}function removeEntity(_0x26075a,_0x4cd64d){return function(_0x25d3e4){if(_0x25d3e4){return _0x25d3e4[_0xd562('0x28')]()['then'](function(){var _0x3922cd=_0x25d3e4[_0xd562('0x29')]({'plain':!![]});var _0x4f8811=_0xd562('0x2a');return db[_0xd562('0x2b')][_0xd562('0x28')]({'where':{'type':_0x4f8811,'resourceId':_0x3922cd['id']}})[_0xd562('0x2c')](function(){return _0x25d3e4;});})[_0xd562('0x2c')](function(){_0x26075a[_0xd562('0x1e')](0xcc)[_0xd562('0x1d')]();});}};}function handleEntityNotFound(_0x2982fb,_0x430d19){return function(_0x2ed18c){if(!_0x2ed18c){_0x2982fb[_0xd562('0x1c')](0x194);}return _0x2ed18c;};}function handleError(_0x126fa9,_0x2cc1e7){_0x2cc1e7=_0x2cc1e7||0x1f4;return function(_0x44a855){logger[_0xd562('0x2d')](_0x44a855[_0xd562('0x2e')]);if(_0x44a855[_0xd562('0x2f')]){delete _0x44a855[_0xd562('0x2f')];}_0x126fa9[_0xd562('0x1e')](_0x2cc1e7)[_0xd562('0x30')](_0x44a855);};}exports[_0xd562('0x31')]=function(_0x5ae9a0,_0x11e96a){var _0x323b3a={},_0xc0b953={},_0x4f72b3={'count':0x0,'rows':[]};var _0x4af343=_[_0xd562('0x32')](db[_0xd562('0x33')][_0xd562('0x34')],function(_0x3591b2){return{'name':_0x3591b2['fieldName'],'type':_0x3591b2[_0xd562('0x35')]['key']};});_0xc0b953[_0xd562('0x36')]=_[_0xd562('0x32')](_0x4af343,_0xd562('0x2f'));_0xc0b953[_0xd562('0x37')]=_[_0xd562('0x38')](_0x5ae9a0[_0xd562('0x37')]);_0xc0b953[_0xd562('0x39')]=_[_0xd562('0x3a')](_0xc0b953[_0xd562('0x36')],_0xc0b953[_0xd562('0x37')]);_0x323b3a['attributes']=_['intersection'](_0xc0b953[_0xd562('0x36')],qs[_0xd562('0x3b')](_0x5ae9a0['query'][_0xd562('0x3b')]));_0x323b3a[_0xd562('0x3c')]=_0x323b3a[_0xd562('0x3c')][_0xd562('0x3d')]?_0x323b3a[_0xd562('0x3c')]:_0xc0b953[_0xd562('0x36')];if(!_0x5ae9a0[_0xd562('0x37')][_0xd562('0x3e')](_0xd562('0x3f'))){_0x323b3a['limit']=qs[_0xd562('0x23')](_0x5ae9a0[_0xd562('0x37')]['limit']);_0x323b3a['offset']=qs[_0xd562('0x22')](_0x5ae9a0[_0xd562('0x37')][_0xd562('0x22')]);}_0x323b3a['order']=qs[_0xd562('0x40')](_0x5ae9a0[_0xd562('0x37')][_0xd562('0x40')]);_0x323b3a[_0xd562('0x41')]=qs[_0xd562('0x39')](_['pick'](_0x5ae9a0['query'],_0xc0b953[_0xd562('0x39')]),_0x4af343);if(_0x5ae9a0[_0xd562('0x37')][_0xd562('0x42')]){_0x323b3a['where']=_['merge'](_0x323b3a[_0xd562('0x41')],{'$or':_[_0xd562('0x32')](_0x4af343,function(_0x3548c0){if(_0x3548c0[_0xd562('0x35')]!==_0xd562('0x43')){var _0xb823f7={};_0xb823f7[_0x3548c0[_0xd562('0x2f')]]={'$like':'%'+_0x5ae9a0['query'][_0xd562('0x42')]+'%'};return _0xb823f7;}})});}_0x323b3a=_[_0xd562('0x44')]({},_0x323b3a,_0x5ae9a0[_0xd562('0x45')]);var _0x45fca1={'where':_0x323b3a['where']};return db[_0xd562('0x33')]['count'](_0x45fca1)[_0xd562('0x2c')](function(_0x493b4e){_0x4f72b3['count']=_0x493b4e;if(_0x5ae9a0[_0xd562('0x37')]['includeAll']){_0x323b3a[_0xd562('0x46')]=[{'all':!![]}];}return db[_0xd562('0x33')]['findAll'](_0x323b3a);})['then'](function(_0x518a25){_0x4f72b3[_0xd562('0x47')]=_0x518a25;return _0x4f72b3;})[_0xd562('0x2c')](respondWithFilteredResult(_0x11e96a,_0x323b3a))[_0xd562('0x48')](handleError(_0x11e96a,null));};exports[_0xd562('0x49')]=function(_0x2ca3ec,_0x57fb4a){var _0x40c34a={'raw':!![],'where':{'id':_0x2ca3ec['params']['id']}},_0x341387={};_0x341387[_0xd562('0x36')]=_['keys'](db[_0xd562('0x33')][_0xd562('0x34')]);_0x341387['query']=_[_0xd562('0x38')](_0x2ca3ec[_0xd562('0x37')]);_0x341387[_0xd562('0x39')]=_[_0xd562('0x3a')](_0x341387[_0xd562('0x36')],_0x341387[_0xd562('0x37')]);_0x40c34a['attributes']=_['intersection'](_0x341387[_0xd562('0x36')],qs[_0xd562('0x3b')](_0x2ca3ec[_0xd562('0x37')][_0xd562('0x3b')]));_0x40c34a[_0xd562('0x3c')]=_0x40c34a['attributes'][_0xd562('0x3d')]?_0x40c34a[_0xd562('0x3c')]:_0x341387[_0xd562('0x36')];if(_0x2ca3ec[_0xd562('0x37')][_0xd562('0x4a')]){_0x40c34a[_0xd562('0x46')]=[{'all':!![]}];}_0x40c34a=_[_0xd562('0x44')]({},_0x40c34a,_0x2ca3ec['options']);return db[_0xd562('0x33')][_0xd562('0x4b')](_0x40c34a)['then'](handleEntityNotFound(_0x57fb4a,null))[_0xd562('0x2c')](respondWithResult(_0x57fb4a,null))[_0xd562('0x48')](handleError(_0x57fb4a,null));};exports[_0xd562('0x4c')]=function(_0x1a2ab4,_0x371b7f){return db[_0xd562('0x33')]['create'](_0x1a2ab4[_0xd562('0x4d')],{})[_0xd562('0x2c')](function(_0x4fd35d){var _0x43b787=_0x1a2ab4['user'][_0xd562('0x29')]({'plain':!![]});if(!_0x43b787)throw new Error(_0xd562('0x4e'));if(_0x43b787[_0xd562('0x4f')]===_0xd562('0x50')){var _0x59a03b=_0x4fd35d['get']({'plain':!![]});var _0x24cc8a=_0xd562('0x2a');return db[_0xd562('0x51')][_0xd562('0x4b')]({'where':{'name':_0x24cc8a,'userProfileId':_0x43b787[_0xd562('0x52')]},'raw':!![]})['then'](function(_0x52fa17){if(_0x52fa17&&_0x52fa17['autoAssociation']===0x0){return db['UserProfileResource'][_0xd562('0x4c')]({'name':_0x59a03b[_0xd562('0x2f')],'resourceId':_0x59a03b['id'],'type':_0x52fa17[_0xd562('0x2f')],'sectionId':_0x52fa17['id']},{})[_0xd562('0x2c')](function(){return _0x4fd35d;});}else{return _0x4fd35d;}})[_0xd562('0x48')](function(_0x31f9e5){logger[_0xd562('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31f9e5);throw _0x31f9e5;});}return _0x4fd35d;})[_0xd562('0x2c')](respondWithResult(_0x371b7f,0xc9))[_0xd562('0x48')](handleError(_0x371b7f,null));};exports[_0xd562('0x27')]=function(_0x20fce8,_0x26ee74){if(_0x20fce8[_0xd562('0x4d')]['id']){delete _0x20fce8['body']['id'];}return db['Variable'][_0xd562('0x4b')]({'where':{'id':_0x20fce8['params']['id']}})[_0xd562('0x2c')](handleEntityNotFound(_0x26ee74,null))[_0xd562('0x2c')](saveUpdates(_0x20fce8[_0xd562('0x4d')],null))[_0xd562('0x2c')](respondWithResult(_0x26ee74,null))[_0xd562('0x48')](handleError(_0x26ee74,null));};exports[_0xd562('0x28')]=function(_0x2b9122,_0x2c0f01){return db[_0xd562('0x33')][_0xd562('0x4b')]({'where':{'id':_0x2b9122[_0xd562('0x53')]['id']}})[_0xd562('0x2c')](handleEntityNotFound(_0x2c0f01,null))[_0xd562('0x2c')](removeEntity(_0x2c0f01,null))[_0xd562('0x48')](handleError(_0x2c0f01,null));}; \ No newline at end of file +var _0x6955=['fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','eml-format','rimraf','zip-dir','fast-json-patch','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/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','Variables','error','stack','name','send','index','map','Variable','rawAttributes'];(function(_0x4fc77f,_0x147d4d){var _0x3d7eaf=function(_0x324ef3){while(--_0x324ef3){_0x4fc77f['push'](_0x4fc77f['shift']());}};_0x3d7eaf(++_0x147d4d);}(_0x6955,0x1d8));var _0x5695=function(_0x13b677,_0x441ab5){_0x13b677=_0x13b677-0x0;var _0x120a3d=_0x6955[_0x13b677];return _0x120a3d;};'use strict';var emlformat=require(_0x5695('0x0'));var rimraf=require(_0x5695('0x1'));var zipdir=require(_0x5695('0x2'));var jsonpatch=require(_0x5695('0x3'));var rp=require(_0x5695('0x4'));var moment=require(_0x5695('0x5'));var BPromise=require(_0x5695('0x6'));var Mustache=require(_0x5695('0x7'));var util=require(_0x5695('0x8'));var path=require(_0x5695('0x9'));var sox=require(_0x5695('0xa'));var csv=require('to-csv');var ejs=require(_0x5695('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5695('0xc'));var squel=require(_0x5695('0xd'));var crypto=require(_0x5695('0xe'));var jsforce=require(_0x5695('0xf'));var deskjs=require(_0x5695('0x10'));var toCsv=require(_0x5695('0x11'));var querystring=require(_0x5695('0x12'));var Papa=require(_0x5695('0x13'));var Redis=require(_0x5695('0x14'));var authService=require(_0x5695('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x5695('0x16'));var hardwareService=require(_0x5695('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x5695('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5695('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb72363,_0x2c0af2){_0x2c0af2=_0x2c0af2||0xcc;return function(_0x31154d){if(_0x31154d){return _0xb72363[_0x5695('0x1a')](_0x2c0af2);}return _0xb72363['status'](_0x2c0af2)[_0x5695('0x1b')]();};}function respondWithResult(_0x142722,_0x3ddaf4){_0x3ddaf4=_0x3ddaf4||0xc8;return function(_0x1af757){if(_0x1af757){return _0x142722['status'](_0x3ddaf4)[_0x5695('0x1c')](_0x1af757);}};}function respondWithFilteredResult(_0x49addd,_0x25960c){return function(_0x1f74b9){if(_0x1f74b9){var _0x40893f=typeof _0x25960c[_0x5695('0x1d')]===_0x5695('0x1e')&&typeof _0x25960c[_0x5695('0x1f')]===_0x5695('0x1e');var _0x49f512=_0x1f74b9[_0x5695('0x20')];var _0x339b40=_0x40893f?0x0:_0x25960c[_0x5695('0x1d')];var _0x339ec7=_0x40893f?_0x1f74b9[_0x5695('0x20')]:_0x25960c[_0x5695('0x1d')]+_0x25960c[_0x5695('0x1f')];var _0x133f63;if(_0x339ec7>=_0x49f512){_0x339ec7=_0x49f512;_0x133f63=0xc8;}else{_0x133f63=0xce;}_0x49addd[_0x5695('0x21')](_0x133f63);return _0x49addd['set'](_0x5695('0x22'),_0x339b40+'-'+_0x339ec7+'/'+_0x49f512)[_0x5695('0x1c')](_0x1f74b9);}return null;};}function patchUpdates(_0x4b794c){return function(_0x5accb6){try{jsonpatch[_0x5695('0x23')](_0x5accb6,_0x4b794c,!![]);}catch(_0xa98ada){return BPromise[_0x5695('0x24')](_0xa98ada);}return _0x5accb6[_0x5695('0x25')]();};}function saveUpdates(_0x5d0e89,_0x4879f8){return function(_0x406465){if(_0x406465){return _0x406465[_0x5695('0x26')](_0x5d0e89)[_0x5695('0x27')](function(_0x16cf3b){return _0x16cf3b;});}return null;};}function removeEntity(_0x267f10,_0x5b2069){return function(_0x12bc85){if(_0x12bc85){return _0x12bc85[_0x5695('0x28')]()[_0x5695('0x27')](function(){var _0x4946b4=_0x12bc85['get']({'plain':!![]});var _0x4f191d=_0x5695('0x29');return db['UserProfileResource'][_0x5695('0x28')]({'where':{'type':_0x4f191d,'resourceId':_0x4946b4['id']}})[_0x5695('0x27')](function(){return _0x12bc85;});})[_0x5695('0x27')](function(){_0x267f10['status'](0xcc)[_0x5695('0x1b')]();});}};}function handleEntityNotFound(_0x5589ad,_0x3ccb6e){return function(_0x4448c3){if(!_0x4448c3){_0x5589ad[_0x5695('0x1a')](0x194);}return _0x4448c3;};}function handleError(_0x1d07d9,_0x52cd50){_0x52cd50=_0x52cd50||0x1f4;return function(_0x597d56){logger[_0x5695('0x2a')](_0x597d56[_0x5695('0x2b')]);if(_0x597d56[_0x5695('0x2c')]){delete _0x597d56[_0x5695('0x2c')];}_0x1d07d9['status'](_0x52cd50)[_0x5695('0x2d')](_0x597d56);};}exports[_0x5695('0x2e')]=function(_0x4fb9ae,_0x8423fe){var _0x1f8a25={},_0x2a9986={},_0x402e16={'count':0x0,'rows':[]};var _0x405742=_[_0x5695('0x2f')](db[_0x5695('0x30')][_0x5695('0x31')],function(_0x385b73){return{'name':_0x385b73[_0x5695('0x32')],'type':_0x385b73['type']['key']};});_0x2a9986[_0x5695('0x33')]=_[_0x5695('0x2f')](_0x405742,_0x5695('0x2c'));_0x2a9986[_0x5695('0x34')]=_[_0x5695('0x35')](_0x4fb9ae['query']);_0x2a9986[_0x5695('0x36')]=_[_0x5695('0x37')](_0x2a9986[_0x5695('0x33')],_0x2a9986[_0x5695('0x34')]);_0x1f8a25[_0x5695('0x38')]=_[_0x5695('0x37')](_0x2a9986[_0x5695('0x33')],qs[_0x5695('0x39')](_0x4fb9ae[_0x5695('0x34')][_0x5695('0x39')]));_0x1f8a25[_0x5695('0x38')]=_0x1f8a25[_0x5695('0x38')][_0x5695('0x3a')]?_0x1f8a25['attributes']:_0x2a9986['model'];if(!_0x4fb9ae[_0x5695('0x34')][_0x5695('0x3b')](_0x5695('0x3c'))){_0x1f8a25['limit']=qs[_0x5695('0x1f')](_0x4fb9ae[_0x5695('0x34')][_0x5695('0x1f')]);_0x1f8a25[_0x5695('0x1d')]=qs['offset'](_0x4fb9ae[_0x5695('0x34')]['offset']);}_0x1f8a25[_0x5695('0x3d')]=qs[_0x5695('0x3e')](_0x4fb9ae[_0x5695('0x34')]['sort']);_0x1f8a25[_0x5695('0x3f')]=qs[_0x5695('0x36')](_[_0x5695('0x40')](_0x4fb9ae[_0x5695('0x34')],_0x2a9986[_0x5695('0x36')]),_0x405742);if(_0x4fb9ae[_0x5695('0x34')]['filter']){_0x1f8a25['where']=_[_0x5695('0x41')](_0x1f8a25[_0x5695('0x3f')],{'$or':_[_0x5695('0x2f')](_0x405742,function(_0x24a5d3){if(_0x24a5d3['type']!==_0x5695('0x42')){var _0x5a1ba9={};_0x5a1ba9[_0x24a5d3[_0x5695('0x2c')]]={'$like':'%'+_0x4fb9ae[_0x5695('0x34')][_0x5695('0x43')]+'%'};return _0x5a1ba9;}})});}_0x1f8a25=_[_0x5695('0x41')]({},_0x1f8a25,_0x4fb9ae[_0x5695('0x44')]);var _0x55f3e6={'where':_0x1f8a25[_0x5695('0x3f')]};return db[_0x5695('0x30')][_0x5695('0x20')](_0x55f3e6)['then'](function(_0x239342){_0x402e16[_0x5695('0x20')]=_0x239342;if(_0x4fb9ae[_0x5695('0x34')][_0x5695('0x45')]){_0x1f8a25[_0x5695('0x46')]=[{'all':!![]}];}return db[_0x5695('0x30')][_0x5695('0x47')](_0x1f8a25);})[_0x5695('0x27')](function(_0x39dfdd){_0x402e16[_0x5695('0x48')]=_0x39dfdd;return _0x402e16;})[_0x5695('0x27')](respondWithFilteredResult(_0x8423fe,_0x1f8a25))['catch'](handleError(_0x8423fe,null));};exports[_0x5695('0x49')]=function(_0x40f425,_0x5df50d){var _0x5917fb={'raw':!![],'where':{'id':_0x40f425[_0x5695('0x4a')]['id']}},_0xc5dc5b={};_0xc5dc5b[_0x5695('0x33')]=_[_0x5695('0x35')](db[_0x5695('0x30')][_0x5695('0x31')]);_0xc5dc5b[_0x5695('0x34')]=_[_0x5695('0x35')](_0x40f425['query']);_0xc5dc5b[_0x5695('0x36')]=_[_0x5695('0x37')](_0xc5dc5b['model'],_0xc5dc5b[_0x5695('0x34')]);_0x5917fb['attributes']=_[_0x5695('0x37')](_0xc5dc5b[_0x5695('0x33')],qs[_0x5695('0x39')](_0x40f425[_0x5695('0x34')]['fields']));_0x5917fb[_0x5695('0x38')]=_0x5917fb[_0x5695('0x38')][_0x5695('0x3a')]?_0x5917fb[_0x5695('0x38')]:_0xc5dc5b['model'];if(_0x40f425[_0x5695('0x34')][_0x5695('0x45')]){_0x5917fb[_0x5695('0x46')]=[{'all':!![]}];}_0x5917fb=_[_0x5695('0x41')]({},_0x5917fb,_0x40f425[_0x5695('0x44')]);return db[_0x5695('0x30')][_0x5695('0x4b')](_0x5917fb)[_0x5695('0x27')](handleEntityNotFound(_0x5df50d,null))['then'](respondWithResult(_0x5df50d,null))['catch'](handleError(_0x5df50d,null));};exports[_0x5695('0x4c')]=function(_0x5c73a4,_0x487313){return db['Variable']['create'](_0x5c73a4[_0x5695('0x4d')],{})[_0x5695('0x27')](function(_0x462c77){var _0x331241=_0x5c73a4[_0x5695('0x4e')][_0x5695('0x4f')]({'plain':!![]});if(!_0x331241)throw new Error(_0x5695('0x50'));if(_0x331241['role']==='user'){var _0x557081=_0x462c77['get']({'plain':!![]});var _0x23954a='Variables';return db[_0x5695('0x51')][_0x5695('0x4b')]({'where':{'name':_0x23954a,'userProfileId':_0x331241[_0x5695('0x52')]},'raw':!![]})[_0x5695('0x27')](function(_0x17d84a){if(_0x17d84a&&_0x17d84a[_0x5695('0x53')]===0x0){return db[_0x5695('0x54')][_0x5695('0x4c')]({'name':_0x557081[_0x5695('0x2c')],'resourceId':_0x557081['id'],'type':_0x17d84a[_0x5695('0x2c')],'sectionId':_0x17d84a['id']},{})['then'](function(){return _0x462c77;});}else{return _0x462c77;}})['catch'](function(_0x560e50){logger[_0x5695('0x2a')](_0x5695('0x55'),_0x560e50);throw _0x560e50;});}return _0x462c77;})['then'](respondWithResult(_0x487313,0xc9))[_0x5695('0x56')](handleError(_0x487313,null));};exports[_0x5695('0x26')]=function(_0x57ace0,_0x262587){if(_0x57ace0[_0x5695('0x4d')]['id']){delete _0x57ace0['body']['id'];}return db[_0x5695('0x30')][_0x5695('0x4b')]({'where':{'id':_0x57ace0['params']['id']}})['then'](handleEntityNotFound(_0x262587,null))[_0x5695('0x27')](saveUpdates(_0x57ace0['body'],null))[_0x5695('0x27')](respondWithResult(_0x262587,null))[_0x5695('0x56')](handleError(_0x262587,null));};exports['destroy']=function(_0x26e76d,_0x178db5){return db['Variable'][_0x5695('0x4b')]({'where':{'id':_0x26e76d['params']['id']}})[_0x5695('0x27')](handleEntityNotFound(_0x178db5,null))[_0x5695('0x27')](removeEntity(_0x178db5,null))[_0x5695('0x56')](handleError(_0x178db5,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f1da36d..3e07f00 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 _0xd01c=['./variable.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x39ddd0,_0x530c16){var _0x39dd96=function(_0x1b7d66){while(--_0x1b7d66){_0x39ddd0['push'](_0x39ddd0['shift']());}};_0x39dd96(++_0x530c16);}(_0xd01c,0x19d));var _0xcd01=function(_0x3a2a77,_0x46d419){_0x3a2a77=_0x3a2a77-0x0;var _0x486a19=_0xd01c[_0x3a2a77];return _0x486a19;};'use strict';var _=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var logger=require(_0xcd01('0x2'))(_0xcd01('0x3'));var moment=require(_0xcd01('0x4'));var BPromise=require(_0xcd01('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcd01('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd01('0x7'));module[_0xcd01('0x8')]=function(_0x1ce208,_0x25d7a8){return _0x1ce208[_0xcd01('0x9')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc64f=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./variable.attributes','define','Variable'];(function(_0x12be24,_0x3dbefb){var _0x4748fb=function(_0x12ab57){while(--_0x12ab57){_0x12be24['push'](_0x12be24['shift']());}};_0x4748fb(++_0x3dbefb);}(_0xc64f,0x1d5));var _0xfc64=function(_0xa29ef4,_0x60343c){_0xa29ef4=_0xa29ef4-0x0;var _0x1943e2=_0xc64f[_0xa29ef4];return _0x1943e2;};'use strict';var _=require(_0xfc64('0x0'));var util=require(_0xfc64('0x1'));var logger=require(_0xfc64('0x2'))(_0xfc64('0x3'));var moment=require(_0xfc64('0x4'));var BPromise=require(_0xfc64('0x5'));var rp=require(_0xfc64('0x6'));var fs=require('fs');var path=require(_0xfc64('0x7'));var rimraf=require('rimraf');var config=require(_0xfc64('0x8'));var attributes=require(_0xfc64('0x9'));module['exports']=function(_0x4cfaa1,_0x385b25){return _0x4cfaa1[_0xfc64('0xa')](_0xfc64('0xb'),attributes,{'tableName':_0xfc64('0xc'),'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 3136cd1..9e260c9 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 _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xa41a,0x6b));var _0xaa41=function(_0xd04a1d,_0x636ea2){_0xd04a1d=_0xd04a1d-0x0;var _0xd609fa=_0xa41a[_0xd04a1d];return _0xd609fa;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x120f94,_0x5ce5de){var _0x4a70cc=function(_0x450ecf){while(--_0x450ecf){_0x120f94['push'](_0x120f94['shift']());}};_0x4a70cc(++_0x5ce5de);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xa21c85,_0x1dabfa){_0xa21c85=_0xa21c85-0x0;var _0x490538=_0x7fbe[_0xa21c85];return _0x490538;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a1cf10b..47b8390 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 _0xbfe7=['express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/pull','pull','restart','/migrations','migrations','exports'];(function(_0x389057,_0x3e56c9){var _0x7cdee=function(_0x4321bb){while(--_0x4321bb){_0x389057['push'](_0x389057['shift']());}};_0x7cdee(++_0x3e56c9);}(_0xbfe7,0xb4));var _0x7bfe=function(_0x37d393,_0x2e9ec1){_0x37d393=_0x37d393-0x0;var _0x3e614a=_0xbfe7[_0x37d393];return _0x3e614a;};'use strict';var express=require(_0x7bfe('0x0'));var router=express[_0x7bfe('0x1')]();var auth=require(_0x7bfe('0x2'));var controller=require(_0x7bfe('0x3'));router[_0x7bfe('0x4')]('/',controller['index']);router[_0x7bfe('0x4')](_0x7bfe('0x5'),auth[_0x7bfe('0x6')](),auth[_0x7bfe('0x7')](),controller[_0x7bfe('0x8')]);router['get']('/reset',auth[_0x7bfe('0x6')](),auth[_0x7bfe('0x7')](),controller['reset']);router[_0x7bfe('0x4')](_0x7bfe('0x9'),auth[_0x7bfe('0x6')](),auth[_0x7bfe('0x7')](),controller[_0x7bfe('0xa')]);router[_0x7bfe('0x4')]('/restart',auth[_0x7bfe('0x6')](),controller[_0x7bfe('0xb')]);router['get'](_0x7bfe('0xc'),controller[_0x7bfe('0xd')]);module[_0x7bfe('0xe')]=router; \ No newline at end of file +var _0x4568=['isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/migrations','exports','Router','./version.controller','get','index'];(function(_0x339d9c,_0x5ec5a2){var _0x17c848=function(_0xaa760){while(--_0xaa760){_0x339d9c['push'](_0x339d9c['shift']());}};_0x17c848(++_0x5ec5a2);}(_0x4568,0xcc));var _0x8456=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x4568[_0x2283dc];return _0x16db90;};'use strict';var express=require('express');var router=express[_0x8456('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x8456('0x1'));router[_0x8456('0x2')]('/',controller[_0x8456('0x3')]);router[_0x8456('0x2')]('/fetch',auth[_0x8456('0x4')](),auth[_0x8456('0x5')](),controller[_0x8456('0x6')]);router[_0x8456('0x2')](_0x8456('0x7'),auth[_0x8456('0x4')](),auth['canUpdate'](),controller[_0x8456('0x8')]);router['get'](_0x8456('0x9'),auth[_0x8456('0x4')](),auth[_0x8456('0x5')](),controller[_0x8456('0xa')]);router[_0x8456('0x2')]('/restart',auth[_0x8456('0x4')](),controller['restart']);router[_0x8456('0x2')](_0x8456('0xb'),controller['migrations']);module[_0x8456('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3173f46..3534e09 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 _0x12b3=['map','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','fetch','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','length','.js','push','Migration','getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x12b3,0x1b6));var _0x312b=function(_0xb3bbc8,_0x2a3635){_0xb3bbc8=_0xb3bbc8-0x0;var _0x3254b7=_0x12b3[_0xb3bbc8];return _0x3254b7;};'use strict';var Umzug=require('umzug');var path=require(_0x312b('0x0'));var fs=require('fs');var _=require(_0x312b('0x1'));var pkginfo=require(_0x312b('0x2'))(module,_0x312b('0x3'));var compareVersions=require(_0x312b('0x4'));var exec=require(_0x312b('0x5'))['exec'];var db=require(_0x312b('0x6'))['db'];var config=require(_0x312b('0x7'));var pm2=require(_0x312b('0x8'));var logger=require(_0x312b('0x9'))('update');var git=require(_0x312b('0xa'))(config[_0x312b('0xb')]);exports['index']=function(_0x18a451,_0x29af7b){var _0x1e10c8={'current':module[_0x312b('0xc')][_0x312b('0x3')],'phonebar':0x2};if(_0x18a451[_0x312b('0xd')]&&_0x18a451[_0x312b('0xd')][_0x312b('0xe')]){return git[_0x312b('0xf')]()['tags'](function(_0x241061,_0x4e6ac9){_0x1e10c8[_0x312b('0xe')]=(_0x241061?module[_0x312b('0xc')][_0x312b('0x3')]:_0x4e6ac9[_0x312b('0xe')])||_0x312b('0x10');return _0x29af7b[_0x312b('0x11')](0xc8)['json'](_0x1e10c8);});}else{return _0x29af7b[_0x312b('0x11')](0xc8)[_0x312b('0x12')](_0x1e10c8);}};exports[_0x312b('0xf')]=function(_0x30ed48,_0x591884){return git[_0x312b('0xf')]([_0x312b('0x13'),_0x312b('0x14')],function(_0x563186){if(_0x563186){logger[_0x312b('0x15')](_0x563186);return _0x591884[_0x312b('0x11')](0x1f4)[_0x312b('0x12')](_0x563186);}logger[_0x312b('0x16')](_0x312b('0x17'));return _0x591884[_0x312b('0x11')](0xc8)['json']({'output':_0x312b('0x18')});});};exports['reset']=function(_0x5e91ac,_0x5e3010){return git[_0x312b('0x19')]([_0x312b('0x1a'),_0x312b('0x1b')],function(_0x281c20){if(_0x281c20){logger[_0x312b('0x15')](_0x281c20);return _0x5e3010[_0x312b('0x11')](0x1f4)['json'](_0x281c20);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5e3010['status'](0xc8)['json']({'output':_0x312b('0x1c')});});};exports[_0x312b('0x1d')]=function(_0x11f8fa,_0x5d7b11){exec(_0x312b('0x1e'),function(_0x32149e,_0x133444,_0x32c434){logger[_0x312b('0x16')](_0x133444);logger['info'](_0x32c434);if(_0x32149e){logger[_0x312b('0x15')](_0x32149e);return _0x5d7b11['status'](0x1f4)[_0x312b('0x12')](_0x32149e);}return _0x5d7b11[_0x312b('0x11')](0xc8)[_0x312b('0x12')]({'output':_0x133444});});};exports[_0x312b('0x1f')]=function(_0xe50042,_0x4913aa){return pm2[_0x312b('0x1f')](_0x312b('0x20'))[_0x312b('0x21')](function(_0x11479b){logger[_0x312b('0x16')](_0x312b('0x22'),_0x11479b);return _0x4913aa[_0x312b('0x11')](0xc8)[_0x312b('0x12')]({'output':_0x312b('0x23')});})['catch'](function(_0x5d09a0){logger[_0x312b('0x15')](_0x5d09a0);return _0x4913aa[_0x312b('0x11')](0x1f4)[_0x312b('0x12')](_0x5d09a0);});};exports[_0x312b('0x24')]=function(_0x4c2f46,_0x331ae4){var _0x3c249a=fs[_0x312b('0x25')](path['join'](config['root'],'server',_0x312b('0x24')));var _0x138d4a=[];for(var _0x3d413=0x0;_0x3d413<_0x3c249a[_0x312b('0x26')];_0x3d413++){var _0x23804c=_0x3c249a[_0x3d413]['replace'](_0x312b('0x27'),'');if(compareVersions(module[_0x312b('0xc')][_0x312b('0x3')],_0x23804c)===-0x1){_0x138d4a[_0x312b('0x28')](_0x23804c);}}if(_0x138d4a[_0x312b('0x26')]){var _0x54c2f1=_0x138d4a['sort'](compareVersions);var _0x1f285b=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x312b('0x29')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db['sequelize'][_0x312b('0x2a')](),db[_0x312b('0x2b')][_0x312b('0x2c')],function(){throw new Error(_0x312b('0x2d'));}],'path':path[_0x312b('0x2e')](config[_0x312b('0xb')],_0x312b('0x2f'),_0x312b('0x24')),'pattern':/\.js$/}});_0x1f285b['up']({'migrations':_[_0x312b('0x30')](_0x54c2f1,function(_0x3ef51e){return _0x3ef51e+_0x312b('0x27');})})['then'](function(){return _0x331ae4[_0x312b('0x11')](0xc8)[_0x312b('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x312b('0xc')][_0x312b('0x3')]+_0x312b('0x31')+_[_0x312b('0x32')](_0x54c2f1),'migrations':_[_0x312b('0x2e')](_0x54c2f1)});})[_0x312b('0x33')](function(_0x4fba91){if(_0x4fba91 instanceof db[_0x312b('0x2b')][_0x312b('0x34')]){return _0x331ae4['status'](0xc8)[_0x312b('0x12')]({'output':_0x312b('0x35')});}else{return _0x331ae4['status'](0x1f4)[_0x312b('0x12')](_0x4fba91);}});}else{return _0x331ae4['status'](0xc8)[_0x312b('0x12')]({'output':_0x312b('0x35')});}}; \ No newline at end of file +var _0x579c=['then','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','getQueryInterface','constructor'];(function(_0x58df89,_0x26af59){var _0x499885=function(_0x532d0b){while(--_0x532d0b){_0x58df89['push'](_0x58df89['shift']());}};_0x499885(++_0x26af59);}(_0x579c,0x69));var _0xc579=function(_0x80a04e,_0x3cbe93){_0x80a04e=_0x80a04e-0x0;var _0x4b9dd9=_0x579c[_0x80a04e];return _0x4b9dd9;};'use strict';var Umzug=require(_0xc579('0x0'));var path=require(_0xc579('0x1'));var fs=require('fs');var _=require(_0xc579('0x2'));var pkginfo=require('pkginfo')(module,_0xc579('0x3'));var compareVersions=require(_0xc579('0x4'));var exec=require('child_process')['exec'];var db=require(_0xc579('0x5'))['db'];var config=require(_0xc579('0x6'));var pm2=require(_0xc579('0x7'));var logger=require('../../config/logger')('update');var git=require(_0xc579('0x8'))(config[_0xc579('0x9')]);exports[_0xc579('0xa')]=function(_0x5f121f,_0x5ab519){var _0x355cfd={'current':module[_0xc579('0xb')][_0xc579('0x3')],'phonebar':0x2};if(_0x5f121f[_0xc579('0xc')]&&_0x5f121f[_0xc579('0xc')][_0xc579('0xd')]){return git[_0xc579('0xe')]()[_0xc579('0xf')](function(_0x168e05,_0x5d05af){_0x355cfd['latest']=(_0x168e05?module[_0xc579('0xb')]['version']:_0x5d05af[_0xc579('0xd')])||_0xc579('0x10');return _0x5ab519['status'](0xc8)[_0xc579('0x11')](_0x355cfd);});}else{return _0x5ab519[_0xc579('0x12')](0xc8)[_0xc579('0x11')](_0x355cfd);}};exports['fetch']=function(_0x42c174,_0x34dbe1){return git[_0xc579('0xe')]([_0xc579('0x13'),_0xc579('0x14')],function(_0x3c92ff){if(_0x3c92ff){logger[_0xc579('0x15')](_0x3c92ff);return _0x34dbe1[_0xc579('0x12')](0x1f4)[_0xc579('0x11')](_0x3c92ff);}logger[_0xc579('0x16')](_0xc579('0x17'));return _0x34dbe1[_0xc579('0x12')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc579('0x18')]=function(_0x3c1fd8,_0xbdc98){return git[_0xc579('0x18')](['--hard',_0xc579('0x19')],function(_0x4839a1){if(_0x4839a1){logger[_0xc579('0x15')](_0x4839a1);return _0xbdc98[_0xc579('0x12')](0x1f4)['json'](_0x4839a1);}logger['info'](_0xc579('0x1a'));return _0xbdc98[_0xc579('0x12')](0xc8)['json']({'output':_0xc579('0x1b')});});};exports[_0xc579('0x1c')]=function(_0x4c83fc,_0x125cad){exec('npm\x20install\x20--production',function(_0x295243,_0x70d980,_0x3e0e85){logger[_0xc579('0x16')](_0x70d980);logger[_0xc579('0x16')](_0x3e0e85);if(_0x295243){logger['error'](_0x295243);return _0x125cad['status'](0x1f4)[_0xc579('0x11')](_0x295243);}return _0x125cad[_0xc579('0x12')](0xc8)[_0xc579('0x11')]({'output':_0x70d980});});};exports[_0xc579('0x1d')]=function(_0xf00f97,_0xdf35a8){return pm2[_0xc579('0x1d')](_0xc579('0x1e'))['then'](function(_0x2e74ae){logger['info'](_0xc579('0x1f'),_0x2e74ae);return _0xdf35a8['status'](0xc8)['json']({'output':_0xc579('0x20')});})['catch'](function(_0x1b9ded){logger[_0xc579('0x15')](_0x1b9ded);return _0xdf35a8[_0xc579('0x12')](0x1f4)['json'](_0x1b9ded);});};exports[_0xc579('0x21')]=function(_0x210747,_0x2481b1){var _0x4f8f64=fs[_0xc579('0x22')](path[_0xc579('0x23')](config['root'],_0xc579('0x24'),_0xc579('0x21')));var _0x5ef31b=[];for(var _0x2dee62=0x0;_0x2dee62<_0x4f8f64[_0xc579('0x25')];_0x2dee62++){var _0x518087=_0x4f8f64[_0x2dee62][_0xc579('0x26')](_0xc579('0x27'),'');if(compareVersions(module[_0xc579('0xb')][_0xc579('0x3')],_0x518087)===-0x1){_0x5ef31b[_0xc579('0x28')](_0x518087);}}if(_0x5ef31b['length']){var _0x183592=_0x5ef31b[_0xc579('0x29')](compareVersions);var _0xada2eb=new Umzug({'storage':_0xc579('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0xc579('0x3')},'migrations':{'params':[db[_0xc579('0x2a')][_0xc579('0x2b')](),db[_0xc579('0x2a')][_0xc579('0x2c')],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[_0xc579('0x23')](config[_0xc579('0x9')],'server',_0xc579('0x21')),'pattern':/\.js$/}});_0xada2eb['up']({'migrations':_['map'](_0x183592,function(_0x3b123b){return _0x3b123b+_0xc579('0x27');})})[_0xc579('0x2d')](function(){return _0x2481b1[_0xc579('0x12')](0xc8)[_0xc579('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xc579('0x3')]+'\x20to\x20'+_[_0xc579('0x2e')](_0x183592),'migrations':_[_0xc579('0x23')](_0x183592)});})[_0xc579('0x2f')](function(_0x278158){if(_0x278158 instanceof db[_0xc579('0x2a')][_0xc579('0x30')]){return _0x2481b1[_0xc579('0x12')](0xc8)[_0xc579('0x11')]({'output':_0xc579('0x31')});}else{return _0x2481b1[_0xc579('0x12')](0x1f4)[_0xc579('0x11')](_0x278158);}});}else{return _0x2481b1[_0xc579('0x12')](0xc8)[_0xc579('0x11')]({'output':_0xc579('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index dfa235e..d897dd3 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 _0x5435=['post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x5435,0x9d));var _0x5543=function(_0x3addcd,_0x34fec3){_0x3addcd=_0x3addcd-0x0;var _0x388b0c=_0x5435[_0x3addcd];return _0x388b0c;};'use strict';var multer=require('multer');var util=require(_0x5543('0x0'));var path=require('path');var timeout=require(_0x5543('0x1'));var express=require(_0x5543('0x2'));var router=express[_0x5543('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5543('0x4'));var interaction=require(_0x5543('0x5'));var config=require(_0x5543('0x6'));var controller=require(_0x5543('0x7'));router[_0x5543('0x8')]('/',auth['isAuthenticated'](),controller[_0x5543('0x9')]);router[_0x5543('0x8')](_0x5543('0xa'),auth['isAuthenticated'](),controller[_0x5543('0xb')]);router['get'](_0x5543('0xc'),auth[_0x5543('0xd')](),controller['show']);router[_0x5543('0xe')]('/',auth[_0x5543('0xd')](),controller[_0x5543('0xf')]);router[_0x5543('0x10')]('/:id',auth[_0x5543('0xd')](),controller['update']);router[_0x5543('0x11')](_0x5543('0xc'),auth[_0x5543('0xd')](),controller['destroy']);module[_0x5543('0x12')]=router; \ No newline at end of file +var _0xb279=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb279,0x181));var _0x9b27=function(_0x379141,_0x2137f1){_0x379141=_0x379141-0x0;var _0x22ca20=_0xb279[_0x379141];return _0x22ca20;};'use strict';var multer=require(_0x9b27('0x0'));var util=require(_0x9b27('0x1'));var path=require(_0x9b27('0x2'));var timeout=require(_0x9b27('0x3'));var express=require(_0x9b27('0x4'));var router=express[_0x9b27('0x5')]();var fs_extra=require(_0x9b27('0x6'));var auth=require(_0x9b27('0x7'));var interaction=require(_0x9b27('0x8'));var config=require('../../config/environment');var controller=require(_0x9b27('0x9'));router[_0x9b27('0xa')]('/',auth[_0x9b27('0xb')](),controller[_0x9b27('0xc')]);router['get'](_0x9b27('0xd'),auth[_0x9b27('0xb')](),controller[_0x9b27('0xe')]);router['get'](_0x9b27('0xf'),auth['isAuthenticated'](),controller[_0x9b27('0x10')]);router['post']('/',auth[_0x9b27('0xb')](),controller[_0x9b27('0x11')]);router[_0x9b27('0x12')](_0x9b27('0xf'),auth[_0x9b27('0xb')](),controller[_0x9b27('0x13')]);router['delete'](_0x9b27('0xf'),auth[_0x9b27('0xb')](),controller[_0x9b27('0x14')]);module[_0x9b27('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 0cb767e..68e31f3 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 _0x8ed7=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x8ed7,0x8b));var _0x78ed=function(_0x512c4b,_0x1ae2b7){_0x512c4b=_0x512c4b-0x0;var _0x1211c2=_0x8ed7[_0x512c4b];return _0x1211c2;};'use strict';var Sequelize=require('sequelize');module[_0x78ed('0x0')]={'type':{'type':Sequelize[_0x78ed('0x1')]},'uniqueid':{'type':Sequelize[_0x78ed('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x78ed('0x1')]},'interface':{'type':Sequelize[_0x78ed('0x1')]},'membername':{'type':Sequelize[_0x78ed('0x1')]},'agentcalledAt':{'type':Sequelize[_0x78ed('0x2')]},'agentconnectAt':{'type':Sequelize[_0x78ed('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x78ed('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x78ed('0x2')]},'agentdumpAt':{'type':Sequelize[_0x78ed('0x2')]},'holdtime':{'type':Sequelize[_0x78ed('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x78ed('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x78ed('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x78ed('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x78ed('0x1')]},'channelstate':{'type':Sequelize[_0x78ed('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x78ed('0x1')]},'connectedlinename':{'type':Sequelize[_0x78ed('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x78ed('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x78ed('0x1')]},'priority':{'type':Sequelize[_0x78ed('0x1')]},'destchannel':{'type':Sequelize[_0x78ed('0x1')]},'destchannelstate':{'type':Sequelize[_0x78ed('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x78ed('0x1')]},'destcalleridnum':{'type':Sequelize[_0x78ed('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x78ed('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x78ed('0x1')]},'destuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x78ed('0x1')]},'transfer':{'type':Sequelize[_0x78ed('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x78ed('0x1')],'comment':_0x78ed('0x5')},'transferexten':{'type':Sequelize[_0x78ed('0x1')]},'transferuniqueid':{'type':Sequelize[_0x78ed('0x1')]},'agententerreason':{'type':Sequelize[_0x78ed('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x93e9=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0xfd68f2,_0x5b7112){var _0x5e8dae=function(_0x441169){while(--_0x441169){_0xfd68f2['push'](_0xfd68f2['shift']());}};_0x5e8dae(++_0x5b7112);}(_0x93e9,0xcc));var _0x993e=function(_0x10993e,_0x547aa9){_0x10993e=_0x10993e-0x0;var _0x683146=_0x93e9[_0x10993e];return _0x683146;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'type':{'type':Sequelize[_0x993e('0x2')]},'uniqueid':{'type':Sequelize[_0x993e('0x2')]},'calleridnum':{'type':Sequelize[_0x993e('0x2')]},'calleridname':{'type':Sequelize[_0x993e('0x2')]},'queue':{'type':Sequelize[_0x993e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x993e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x993e('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x993e('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x993e('0x3')]},'agentdumpAt':{'type':Sequelize[_0x993e('0x3')]},'holdtime':{'type':Sequelize[_0x993e('0x4')]},'agentcomplete':{'type':Sequelize[_0x993e('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x993e('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x993e('0x4')]},'agentacw':{'type':Sequelize[_0x993e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x993e('0x4')]},'reason':{'type':Sequelize[_0x993e('0x2')]},'lastevent':{'type':Sequelize[_0x993e('0x2')]},'channel':{'type':Sequelize[_0x993e('0x2')]},'channelstate':{'type':Sequelize[_0x993e('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x993e('0x2')]},'connectedlinename':{'type':Sequelize[_0x993e('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x993e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x993e('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x993e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x993e('0x2')]},'destcalleridname':{'type':Sequelize[_0x993e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x993e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x993e('0x2')]},'destlanguage':{'type':Sequelize[_0x993e('0x2')]},'destaccountcode':{'type':Sequelize[_0x993e('0x2')]},'destcontext':{'type':Sequelize[_0x993e('0x2')]},'destexten':{'type':Sequelize[_0x993e('0x2')]},'destpriority':{'type':Sequelize[_0x993e('0x2')]},'destuniqueid':{'type':Sequelize[_0x993e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x993e('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x993e('0x2')]},'transfer':{'type':Sequelize[_0x993e('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x993e('0x2')],'comment':_0x993e('0x6')},'transferexten':{'type':Sequelize[_0x993e('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x993e('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 bc1f3c3..51ffc03 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(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 65fc996..7874e32 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 _0xeedf=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_agent','destuniqueid'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xeedf,0x12c));var _0xfeed=function(_0x2d12b3,_0x217abc){_0x2d12b3=_0x2d12b3-0x0;var _0x2880c5=_0xeedf[_0x2d12b3];return _0x2880c5;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var moment=require(_0xfeed('0x3'));var BPromise=require('bluebird');var rp=require(_0xfeed('0x4'));var fs=require('fs');var path=require(_0xfeed('0x5'));var rimraf=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0xfeed('0x8')]=function(_0x2c211d,_0x5df4fe){return _0x2c211d[_0xfeed('0x9')]('VoiceAgentReport',attributes,{'tableName':_0xfeed('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xfeed('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0689=['uniqueid','destuniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x55d012,_0x7bb95d){var _0x2c60ba=function(_0x37816b){while(--_0x37816b){_0x55d012['push'](_0x55d012['shift']());}};_0x2c60ba(++_0x7bb95d);}(_0x0689,0x161));var _0x9068=function(_0x214902,_0x1666f4){_0x214902=_0x214902-0x0;var _0x2d6b5a=_0x0689[_0x214902];return _0x2d6b5a;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x9068('0xb'),_0x9068('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index ffa87f8..d6f2ce8 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 _0x9c29=['VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateVoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x9c29,0x12a));var _0x99c2=function(_0x478541,_0xb68256){_0x478541=_0x478541-0x0;var _0x5b0b05=_0x9c29[_0x478541];return _0x5b0b05;};'use strict';var _=require(_0x99c2('0x0'));var util=require(_0x99c2('0x1'));var moment=require(_0x99c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x99c2('0x3'));var fs=require('fs');var Redis=require(_0x99c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x99c2('0x5'))(_0x99c2('0x6'));var config=require(_0x99c2('0x7'));var jayson=require(_0x99c2('0x8'));var client=jayson[_0x99c2('0x9')][_0x99c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42698c,_0x492d17,_0x48dc07){return new BPromise(function(_0x52d601,_0x413ace){return client['request'](_0x42698c,_0x48dc07)[_0x99c2('0xb')](function(_0x1270e0){logger['info'](_0x99c2('0xc'),_0x492d17,_0x99c2('0xd'));logger[_0x99c2('0xe')](_0x99c2('0xf'),_0x492d17,_0x99c2('0xd'),JSON['stringify'](_0x1270e0));if(_0x1270e0[_0x99c2('0x10')]){if(_0x1270e0[_0x99c2('0x10')]['code']===0x1f4){logger[_0x99c2('0x10')](_0x99c2('0xc'),_0x492d17,_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);return _0x413ace(_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);}logger[_0x99c2('0x10')](_0x99c2('0xc'),_0x492d17,_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);return _0x52d601(_0x1270e0[_0x99c2('0x10')][_0x99c2('0x11')]);}else{logger[_0x99c2('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x492d17,_0x99c2('0xd'));_0x52d601(_0x1270e0[_0x99c2('0x13')][_0x99c2('0x11')]);}})[_0x99c2('0x14')](function(_0x277804){logger[_0x99c2('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x492d17,_0x277804);_0x413ace(_0x277804);});});}exports[_0x99c2('0x15')]=function(_0x594b16){var _0x1b7a5e=this;return new Promise(function(_0x291154,_0x486c1c){return db['VoiceAgentReport'][_0x99c2('0x16')](_0x594b16[_0x99c2('0x17')],{'raw':_0x594b16[_0x99c2('0x18')]?_0x594b16['options'][_0x99c2('0x19')]===undefined?!![]:![]:!![]})[_0x99c2('0xb')](function(_0x257e8e){logger[_0x99c2('0x12')]('CreateVoiceAgentReport',_0x594b16);logger[_0x99c2('0xe')](_0x99c2('0x15'),_0x594b16,JSON[_0x99c2('0x1a')](_0x257e8e));_0x291154(_0x257e8e);})[_0x99c2('0x14')](function(_0x27771e){logger[_0x99c2('0x10')](_0x99c2('0x15'),_0x27771e[_0x99c2('0x11')],_0x594b16);_0x486c1c(_0x1b7a5e[_0x99c2('0x10')](0x1f4,_0x27771e['message']));});});};exports[_0x99c2('0x1b')]=function(_0x5e92bd){var _0x1c4bc2=this;return new Promise(function(_0xf2e1ad,_0x77fb52){return db['VoiceAgentReport']['update'](_0x5e92bd[_0x99c2('0x17')],{'raw':_0x5e92bd[_0x99c2('0x18')]?_0x5e92bd[_0x99c2('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e92bd['options']?_0x5e92bd[_0x99c2('0x18')][_0x99c2('0x1c')]||null:null,'attributes':_0x5e92bd['options']?_0x5e92bd[_0x99c2('0x18')][_0x99c2('0x1d')]||null:null,'limit':_0x5e92bd[_0x99c2('0x18')]?_0x5e92bd['options'][_0x99c2('0x1e')]||null:null})[_0x99c2('0xb')](function(_0x17da37){logger[_0x99c2('0x12')](_0x99c2('0x1b'),_0x5e92bd);logger[_0x99c2('0xe')](_0x99c2('0x1b'),_0x5e92bd,JSON[_0x99c2('0x1a')](_0x17da37));_0xf2e1ad(_0x17da37);})[_0x99c2('0x14')](function(_0xce0d8a){logger['error'](_0x99c2('0x1b'),_0xce0d8a[_0x99c2('0x11')],_0x5e92bd);_0x77fb52(_0x1c4bc2[_0x99c2('0x10')](0x1f4,_0xce0d8a[_0x99c2('0x11')]));});});}; \ No newline at end of file +var _0x7d19=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','body','where','limit','lodash','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d19,0x81));var _0x97d1=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0x7d19[_0x19e928];return _0x4e941f;};'use strict';var _=require(_0x97d1('0x0'));var util=require(_0x97d1('0x1'));var moment=require('moment');var BPromise=require(_0x97d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x97d1('0x4'));var logger=require(_0x97d1('0x5'))(_0x97d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x97d1('0x7'));var client=jayson[_0x97d1('0x8')][_0x97d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x434f95,_0x55f90d,_0xbed2cf){return new BPromise(function(_0x4eef1f,_0x54bdd9){return client[_0x97d1('0xa')](_0x434f95,_0xbed2cf)['then'](function(_0x30a8ba){logger[_0x97d1('0xb')](_0x97d1('0xc'),_0x55f90d,_0x97d1('0xd'));logger[_0x97d1('0xe')](_0x97d1('0xf'),_0x55f90d,'request\x20sent',JSON[_0x97d1('0x10')](_0x30a8ba));if(_0x30a8ba[_0x97d1('0x11')]){if(_0x30a8ba[_0x97d1('0x11')][_0x97d1('0x12')]===0x1f4){logger[_0x97d1('0x11')](_0x97d1('0xc'),_0x55f90d,_0x30a8ba['error'][_0x97d1('0x13')]);return _0x54bdd9(_0x30a8ba['error']['message']);}logger['error'](_0x97d1('0xc'),_0x55f90d,_0x30a8ba[_0x97d1('0x11')]['message']);return _0x4eef1f(_0x30a8ba[_0x97d1('0x11')][_0x97d1('0x13')]);}else{logger[_0x97d1('0xb')](_0x97d1('0xc'),_0x55f90d,'request\x20sent');_0x4eef1f(_0x30a8ba[_0x97d1('0x14')][_0x97d1('0x13')]);}})[_0x97d1('0x15')](function(_0xc70018){logger[_0x97d1('0x11')](_0x97d1('0xc'),_0x55f90d,_0xc70018);_0x54bdd9(_0xc70018);});});}exports['CreateVoiceAgentReport']=function(_0x5676a0){var _0x276e0e=this;return new Promise(function(_0x578d20,_0x5dfbd7){return db[_0x97d1('0x16')][_0x97d1('0x17')](_0x5676a0['body'],{'raw':_0x5676a0[_0x97d1('0x18')]?_0x5676a0['options'][_0x97d1('0x19')]===undefined?!![]:![]:!![]})[_0x97d1('0x1a')](function(_0xd57255){logger[_0x97d1('0xb')](_0x97d1('0x1b'),_0x5676a0);logger[_0x97d1('0xe')](_0x97d1('0x1b'),_0x5676a0,JSON[_0x97d1('0x10')](_0xd57255));_0x578d20(_0xd57255);})['catch'](function(_0x4361e3){logger[_0x97d1('0x11')](_0x97d1('0x1b'),_0x4361e3[_0x97d1('0x13')],_0x5676a0);_0x5dfbd7(_0x276e0e[_0x97d1('0x11')](0x1f4,_0x4361e3[_0x97d1('0x13')]));});});};exports[_0x97d1('0x1c')]=function(_0x551dac){var _0x256139=this;return new Promise(function(_0xd97323,_0x574bfb){return db[_0x97d1('0x16')][_0x97d1('0x1d')](_0x551dac[_0x97d1('0x1e')],{'raw':_0x551dac[_0x97d1('0x18')]?_0x551dac[_0x97d1('0x18')][_0x97d1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551dac[_0x97d1('0x18')]?_0x551dac[_0x97d1('0x18')][_0x97d1('0x1f')]||null:null,'attributes':_0x551dac[_0x97d1('0x18')]?_0x551dac[_0x97d1('0x18')]['attributes']||null:null,'limit':_0x551dac[_0x97d1('0x18')]?_0x551dac['options'][_0x97d1('0x20')]||null:null})[_0x97d1('0x1a')](function(_0x482a51){logger[_0x97d1('0xb')](_0x97d1('0x1c'),_0x551dac);logger[_0x97d1('0xe')](_0x97d1('0x1c'),_0x551dac,JSON[_0x97d1('0x10')](_0x482a51));_0xd97323(_0x482a51);})[_0x97d1('0x15')](function(_0x5d85a5){logger[_0x97d1('0x11')](_0x97d1('0x1c'),_0x5d85a5[_0x97d1('0x13')],_0x551dac);_0x574bfb(_0x256139[_0x97d1('0x11')](0x1f4,_0x5d85a5['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 22d82c9..3617b29 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 _0xcd59=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x5724cb,_0x3e07a1){var _0x52a188=function(_0x3971ab){while(--_0x3971ab){_0x5724cb['push'](_0x5724cb['shift']());}};_0x52a188(++_0x3e07a1);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4f8100,_0x928620){_0x4f8100=_0x4f8100-0x0;var _0x360262=_0xcd59[_0x4f8100];return _0x360262;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['describe']);router[_0x9cd5('0xa')](_0x9cd5('0xe'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0x10')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router[_0x9cd5('0x12')]('/:id',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);router[_0x9cd5('0x14')](_0x9cd5('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9cd5('0x15')]=router; \ No newline at end of file +var _0xdbf5=['show','post','put','update','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2f0537,_0x50f871){_0x2f0537=_0x2f0537-0x0;var _0x2095d3=_0xdbf5[_0x2f0537];return _0x2095d3;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')]('/',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xa')]);router[_0x5dbf('0x8')](_0x5dbf('0xb'),auth[_0x5dbf('0x9')](),controller['describe']);router[_0x5dbf('0x8')]('/:id',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xc')]);router[_0x5dbf('0xd')]('/',auth[_0x5dbf('0x9')](),controller['create']);router[_0x5dbf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5dbf('0xf')]);router['delete']('/:id',auth[_0x5dbf('0x9')](),controller['destroy']);module[_0x5dbf('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 5a0f15a..938901b 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 _0x3746=['ENUM','internal','outbound','dialer','STRING','DATE','INTEGER','sequelize','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x3746,0xa9));var _0x6374=function(_0x14ec38,_0x561a3f){_0x14ec38=_0x14ec38-0x0;var _0x56b283=_0x3746[_0x14ec38];return _0x56b283;};'use strict';var Sequelize=require(_0x6374('0x0'));module[_0x6374('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6374('0x2')]('inbound',_0x6374('0x3'),_0x6374('0x4'),'inbound-fax','outbound-fax',_0x6374('0x5'))},'tag':{'type':Sequelize[_0x6374('0x6')]},'accountcode':{'type':Sequelize[_0x6374('0x6')]},'source':{'type':Sequelize[_0x6374('0x6')]},'destination':{'type':Sequelize[_0x6374('0x6')]},'destinationcontext':{'type':Sequelize[_0x6374('0x6')]},'callerid':{'type':Sequelize[_0x6374('0x6')]},'channel':{'type':Sequelize[_0x6374('0x6')]},'destinationchannel':{'type':Sequelize[_0x6374('0x6')]},'lastapplication':{'type':Sequelize[_0x6374('0x6')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x6374('0x7')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6374('0x7')]},'endtime':{'type':Sequelize[_0x6374('0x7')]},'duration':{'type':Sequelize[_0x6374('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6374('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6374('0x6')]},'amaflags':{'type':Sequelize[_0x6374('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x6374('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x6374('0x6')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6374('0x6')]},'prefix':{'type':Sequelize[_0x6374('0x6')]},'routeid':{'type':Sequelize[_0x6374('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9918=['sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x3328b4,_0x403a24){var _0x530143=function(_0x53db2a){while(--_0x53db2a){_0x3328b4['push'](_0x3328b4['shift']());}};_0x530143(++_0x403a24);}(_0x9918,0x186));var _0x8991=function(_0x23166e,_0x131e40){_0x23166e=_0x23166e-0x0;var _0x3d00c9=_0x9918[_0x23166e];return _0x3d00c9;};'use strict';var Sequelize=require(_0x8991('0x0'));module[_0x8991('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8991('0x2')](_0x8991('0x3'),_0x8991('0x4'),_0x8991('0x5'),_0x8991('0x6'),_0x8991('0x7'),_0x8991('0x8'))},'tag':{'type':Sequelize[_0x8991('0x9')]},'accountcode':{'type':Sequelize[_0x8991('0x9')]},'source':{'type':Sequelize[_0x8991('0x9')]},'destination':{'type':Sequelize[_0x8991('0x9')]},'destinationcontext':{'type':Sequelize[_0x8991('0x9')]},'callerid':{'type':Sequelize[_0x8991('0x9')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8991('0xa')]},'starttime':{'type':Sequelize[_0x8991('0xb')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8991('0xb')]},'endtime':{'type':Sequelize[_0x8991('0xb')]},'duration':{'type':Sequelize[_0x8991('0xc')]},'billableseconds':{'type':Sequelize[_0x8991('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8991('0x9')]},'amaflags':{'type':Sequelize[_0x8991('0x9')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x8991('0x9')]},'userSecondDisposition':{'type':Sequelize[_0x8991('0x9')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8991('0x9')]},'routeid':{'type':Sequelize[_0x8991('0xc')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index a2e24d9..131f8e2 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x2ef3,0xba));var _0x32ef=function(_0x348868,_0x2a3efd){_0x348868=_0x348868-0x0;var _0x1bc539=_0x2ef3[_0x348868];return _0x1bc539;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x3c89b8,_0x21f649){var _0x290244=function(_0x35d203){while(--_0x35d203){_0x3c89b8['push'](_0x3c89b8['shift']());}};_0x290244(++_0x21f649);}(_0xdb28,0x106));var _0x8db2=function(_0x4016e3,_0x2f275a){_0x4016e3=_0x4016e3-0x0;var _0x32cc20=_0xdb28[_0x4016e3];return _0x32cc20;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 2dcc8ba..3740751 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 _0x8ca7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ca7,0x9b));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x78ca('0x1'));var BPromise=require(_0x78ca('0x2'));var rp=require(_0x78ca('0x3'));var fs=require('fs');var path=require(_0x78ca('0x4'));var rimraf=require(_0x78ca('0x5'));var config=require(_0x78ca('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x78ca('0x7')]=function(_0x348764,_0xb3b329){return _0x348764[_0x78ca('0x8')](_0x78ca('0x9'),attributes,{'tableName':_0x78ca('0xa'),'paranoid':![],'indexes':[{'fields':[_0x78ca('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe698=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x282739,_0x728fe1){var _0x402696=function(_0x55200e){while(--_0x55200e){_0x282739['push'](_0x282739['shift']());}};_0x402696(++_0x728fe1);}(_0xe698,0xb4));var _0x8e69=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe698[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x8e69('0x0'));var util=require(_0x8e69('0x1'));var logger=require('../../config/logger')(_0x8e69('0x2'));var moment=require(_0x8e69('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e69('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e69('0x5'));var config=require(_0x8e69('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x8e69('0x7')]=function(_0x149a05,_0x1091b3){return _0x149a05[_0x8e69('0x8')](_0x8e69('0x9'),attributes,{'tableName':_0x8e69('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8e69('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 d57c20b..a2246ca 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 _0xf9cc=['model','GetVoiceCallReport','catch','create','CreateVoiceCallReport','debug','stringify','UpdateVoiceCallReport','VoiceCallReport','update','limit','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','findAll','options','raw','where','attributes','include','map'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf9cc,0xa0));var _0xcf9c=function(_0x9c9f71,_0x260003){_0x9c9f71=_0x9c9f71-0x0;var _0x36ce9c=_0xf9cc[_0x9c9f71];return _0x36ce9c;};'use strict';var _=require('lodash');var util=require(_0xcf9c('0x0'));var moment=require(_0xcf9c('0x1'));var BPromise=require(_0xcf9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf9c('0x3'));var db=require(_0xcf9c('0x4'))['db'];var utils=require(_0xcf9c('0x5'));var logger=require('../../config/logger')(_0xcf9c('0x6'));var config=require(_0xcf9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf9c('0x8')][_0xcf9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba292,_0x5e995c,_0x303f1d){return new BPromise(function(_0x405821,_0x203c58){return client[_0xcf9c('0xa')](_0x2ba292,_0x303f1d)['then'](function(_0x9f1ada){logger[_0xcf9c('0xb')](_0xcf9c('0xc'),_0x5e995c,_0xcf9c('0xd'));logger['debug'](_0xcf9c('0xe'),_0x5e995c,'request\x20sent',JSON['stringify'](_0x9f1ada));if(_0x9f1ada['error']){if(_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x10')]===0x1f4){logger[_0xcf9c('0xf')](_0xcf9c('0xc'),_0x5e995c,_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x11')]);return _0x203c58(_0x9f1ada['error']['message']);}logger[_0xcf9c('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x5e995c,_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x11')]);return _0x405821(_0x9f1ada[_0xcf9c('0xf')][_0xcf9c('0x11')]);}else{logger[_0xcf9c('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x5e995c,_0xcf9c('0xd'));_0x405821(_0x9f1ada['result']['message']);}})['catch'](function(_0x177446){logger[_0xcf9c('0xf')](_0xcf9c('0xc'),_0x5e995c,_0x177446);_0x203c58(_0x177446);});});}exports['GetVoiceCallReport']=function(_0x45c1be){var _0x3fa1fe=this;return new Promise(function(_0x34ea30,_0x49b391){return db['VoiceCallReport'][_0xcf9c('0x12')]({'raw':_0x45c1be[_0xcf9c('0x13')]?_0x45c1be['options'][_0xcf9c('0x14')]===undefined?!![]:![]:!![],'where':_0x45c1be[_0xcf9c('0x13')]?_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x15')]||null:null,'attributes':_0x45c1be['options']?_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x16')]||null:null,'limit':_0x45c1be['options']?_0x45c1be[_0xcf9c('0x13')]['limit']||null:null,'include':_0x45c1be[_0xcf9c('0x13')]?_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x17')]?_[_0xcf9c('0x18')](_0x45c1be[_0xcf9c('0x13')][_0xcf9c('0x17')],function(_0x1c1479){return{'model':db[_0x1c1479['model']],'as':_0x1c1479['as'],'attributes':_0x1c1479[_0xcf9c('0x16')],'include':_0x1c1479[_0xcf9c('0x17')]?_[_0xcf9c('0x18')](_0x1c1479[_0xcf9c('0x17')],function(_0xe954c8){return{'model':db[_0xe954c8[_0xcf9c('0x19')]],'as':_0xe954c8['as'],'attributes':_0xe954c8[_0xcf9c('0x16')],'include':_0xe954c8[_0xcf9c('0x17')]?_[_0xcf9c('0x18')](_0xe954c8['include'],function(_0x49e9e8){return{'model':db[_0x49e9e8[_0xcf9c('0x19')]],'as':_0x49e9e8['as'],'attributes':_0x49e9e8[_0xcf9c('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3902b2){logger[_0xcf9c('0xb')](_0xcf9c('0x1a'),_0x45c1be);logger['debug'](_0xcf9c('0x1a'),_0x45c1be,JSON['stringify'](_0x3902b2));_0x34ea30(_0x3902b2);})[_0xcf9c('0x1b')](function(_0x5cb012){logger[_0xcf9c('0xf')]('GetVoiceCallReport',_0x5cb012[_0xcf9c('0x11')],_0x45c1be);_0x49b391(_0x3fa1fe[_0xcf9c('0xf')](0x1f4,_0x5cb012[_0xcf9c('0x11')]));});});};exports['CreateVoiceCallReport']=function(_0x2a3537){var _0x2a3e29=this;return new Promise(function(_0x47a2f6,_0x4f2d84){return db['VoiceCallReport'][_0xcf9c('0x1c')](_0x2a3537['body'],{'raw':_0x2a3537[_0xcf9c('0x13')]?_0x2a3537[_0xcf9c('0x13')][_0xcf9c('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x90142b){logger[_0xcf9c('0xb')](_0xcf9c('0x1d'),_0x2a3537);logger[_0xcf9c('0x1e')]('CreateVoiceCallReport',_0x2a3537,JSON[_0xcf9c('0x1f')](_0x90142b));_0x47a2f6(_0x90142b);})[_0xcf9c('0x1b')](function(_0x3f4b39){logger[_0xcf9c('0xf')](_0xcf9c('0x1d'),_0x3f4b39[_0xcf9c('0x11')],_0x2a3537);_0x4f2d84(_0x2a3e29[_0xcf9c('0xf')](0x1f4,_0x3f4b39['message']));});});};exports[_0xcf9c('0x20')]=function(_0xcf3d9e){var _0x7e9f90=this;return new Promise(function(_0xa16f8f,_0x3b463b){return db[_0xcf9c('0x21')][_0xcf9c('0x22')](_0xcf3d9e['body'],{'raw':_0xcf3d9e['options']?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcf3d9e[_0xcf9c('0x13')]?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x15')]||null:null,'attributes':_0xcf3d9e[_0xcf9c('0x13')]?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x16')]||null:null,'limit':_0xcf3d9e[_0xcf9c('0x13')]?_0xcf3d9e[_0xcf9c('0x13')][_0xcf9c('0x23')]||null:null})[_0xcf9c('0x24')](function(_0xa4d91d){logger[_0xcf9c('0xb')]('UpdateVoiceCallReport',_0xcf3d9e);logger[_0xcf9c('0x1e')](_0xcf9c('0x20'),_0xcf3d9e,JSON[_0xcf9c('0x1f')](_0xa4d91d));_0xa16f8f(_0xa4d91d);})[_0xcf9c('0x1b')](function(_0x57f163){logger[_0xcf9c('0xf')](_0xcf9c('0x20'),_0x57f163['message'],_0xcf3d9e);_0x3b463b(_0x7e9f90[_0xcf9c('0xf')](0x1f4,_0x57f163[_0xcf9c('0x11')]));});});}; \ No newline at end of file +var _0x3954=['map','model','attributes','CreateVoiceCallReport','create','debug','update','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include'];(function(_0x3826c5,_0x1ec9f3){var _0x17f29c=function(_0x1050d2){while(--_0x1050d2){_0x3826c5['push'](_0x3826c5['shift']());}};_0x17f29c(++_0x1ec9f3);}(_0x3954,0x121));var _0x4395=function(_0x44b424,_0x5e0753){_0x44b424=_0x44b424-0x0;var _0xa0f365=_0x3954[_0x44b424];return _0xa0f365;};'use strict';var _=require(_0x4395('0x0'));var util=require(_0x4395('0x1'));var moment=require(_0x4395('0x2'));var BPromise=require(_0x4395('0x3'));var rs=require(_0x4395('0x4'));var fs=require('fs');var Redis=require(_0x4395('0x5'));var db=require(_0x4395('0x6'))['db'];var utils=require(_0x4395('0x7'));var logger=require(_0x4395('0x8'))(_0x4395('0x9'));var config=require(_0x4395('0xa'));var jayson=require(_0x4395('0xb'));var client=jayson[_0x4395('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407ed5,_0x484672,_0xd713cf){return new BPromise(function(_0x281621,_0x7c94b7){return client[_0x4395('0xd')](_0x407ed5,_0xd713cf)[_0x4395('0xe')](function(_0x4edc42){logger[_0x4395('0xf')](_0x4395('0x10'),_0x484672,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x484672,_0x4395('0x11'),JSON[_0x4395('0x12')](_0x4edc42));if(_0x4edc42[_0x4395('0x13')]){if(_0x4edc42[_0x4395('0x13')][_0x4395('0x14')]===0x1f4){logger[_0x4395('0x13')](_0x4395('0x10'),_0x484672,_0x4edc42[_0x4395('0x13')][_0x4395('0x15')]);return _0x7c94b7(_0x4edc42[_0x4395('0x13')][_0x4395('0x15')]);}logger['error'](_0x4395('0x10'),_0x484672,_0x4edc42[_0x4395('0x13')][_0x4395('0x15')]);return _0x281621(_0x4edc42[_0x4395('0x13')][_0x4395('0x15')]);}else{logger[_0x4395('0xf')](_0x4395('0x10'),_0x484672,_0x4395('0x11'));_0x281621(_0x4edc42[_0x4395('0x16')][_0x4395('0x15')]);}})[_0x4395('0x17')](function(_0x33b78d){logger[_0x4395('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x484672,_0x33b78d);_0x7c94b7(_0x33b78d);});});}exports[_0x4395('0x18')]=function(_0x1ea228){var _0x5e8707=this;return new Promise(function(_0xc13661,_0xd52dba){return db[_0x4395('0x19')]['findAll']({'raw':_0x1ea228[_0x4395('0x1a')]?_0x1ea228[_0x4395('0x1a')][_0x4395('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ea228[_0x4395('0x1a')]?_0x1ea228[_0x4395('0x1a')][_0x4395('0x1c')]||null:null,'attributes':_0x1ea228[_0x4395('0x1a')]?_0x1ea228[_0x4395('0x1a')]['attributes']||null:null,'limit':_0x1ea228[_0x4395('0x1a')]?_0x1ea228['options'][_0x4395('0x1d')]||null:null,'include':_0x1ea228[_0x4395('0x1a')]?_0x1ea228[_0x4395('0x1a')][_0x4395('0x1e')]?_[_0x4395('0x1f')](_0x1ea228['options'][_0x4395('0x1e')],function(_0x19a31c){return{'model':db[_0x19a31c[_0x4395('0x20')]],'as':_0x19a31c['as'],'attributes':_0x19a31c['attributes'],'include':_0x19a31c[_0x4395('0x1e')]?_[_0x4395('0x1f')](_0x19a31c[_0x4395('0x1e')],function(_0x54e113){return{'model':db[_0x54e113['model']],'as':_0x54e113['as'],'attributes':_0x54e113[_0x4395('0x21')],'include':_0x54e113[_0x4395('0x1e')]?_['map'](_0x54e113[_0x4395('0x1e')],function(_0x50ad3a){return{'model':db[_0x50ad3a[_0x4395('0x20')]],'as':_0x50ad3a['as'],'attributes':_0x50ad3a[_0x4395('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4395('0xe')](function(_0x49b546){logger[_0x4395('0xf')]('GetVoiceCallReport',_0x1ea228);logger['debug']('GetVoiceCallReport',_0x1ea228,JSON[_0x4395('0x12')](_0x49b546));_0xc13661(_0x49b546);})['catch'](function(_0xa60bde){logger[_0x4395('0x13')](_0x4395('0x18'),_0xa60bde[_0x4395('0x15')],_0x1ea228);_0xd52dba(_0x5e8707[_0x4395('0x13')](0x1f4,_0xa60bde[_0x4395('0x15')]));});});};exports[_0x4395('0x22')]=function(_0x244e50){var _0x2ac5d6=this;return new Promise(function(_0x33d5b4,_0x1b56d2){return db[_0x4395('0x19')][_0x4395('0x23')](_0x244e50['body'],{'raw':_0x244e50['options']?_0x244e50[_0x4395('0x1a')][_0x4395('0x1b')]===undefined?!![]:![]:!![]})[_0x4395('0xe')](function(_0x530a69){logger[_0x4395('0xf')](_0x4395('0x22'),_0x244e50);logger[_0x4395('0x24')]('CreateVoiceCallReport',_0x244e50,JSON['stringify'](_0x530a69));_0x33d5b4(_0x530a69);})[_0x4395('0x17')](function(_0x4f00d2){logger[_0x4395('0x13')](_0x4395('0x22'),_0x4f00d2[_0x4395('0x15')],_0x244e50);_0x1b56d2(_0x2ac5d6[_0x4395('0x13')](0x1f4,_0x4f00d2[_0x4395('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x51cc59){var _0x54e97c=this;return new Promise(function(_0x284a08,_0x1f4f9e){return db['VoiceCallReport'][_0x4395('0x25')](_0x51cc59[_0x4395('0x26')],{'raw':_0x51cc59['options']?_0x51cc59[_0x4395('0x1a')][_0x4395('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51cc59[_0x4395('0x1a')]?_0x51cc59[_0x4395('0x1a')][_0x4395('0x1c')]||null:null,'attributes':_0x51cc59[_0x4395('0x1a')]?_0x51cc59[_0x4395('0x1a')][_0x4395('0x21')]||null:null,'limit':_0x51cc59['options']?_0x51cc59[_0x4395('0x1a')]['limit']||null:null})[_0x4395('0xe')](function(_0x18a6cf){logger[_0x4395('0xf')]('UpdateVoiceCallReport',_0x51cc59);logger[_0x4395('0x24')](_0x4395('0x27'),_0x51cc59,JSON[_0x4395('0x12')](_0x18a6cf));_0x284a08(_0x18a6cf);})[_0x4395('0x17')](function(_0x5e8983){logger[_0x4395('0x13')]('UpdateVoiceCallReport',_0x5e8983[_0x4395('0x15')],_0x51cc59);_0x1f4f9e(_0x54e97c['error'](0x1f4,_0x5e8983[_0x4395('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index de9108d..d4adced 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 _0xf008=['put','/:id','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0xc5caf7,_0xc6d31b){var _0x509351=function(_0x531902){while(--_0x531902){_0xc5caf7['push'](_0xc5caf7['shift']());}};_0x509351(++_0xc6d31b);}(_0xf008,0xc9));var _0x8f00=function(_0x31fbfb,_0x43fc1e){_0x31fbfb=_0x31fbfb-0x0;var _0x2e3697=_0xf008[_0x31fbfb];return _0x2e3697;};'use strict';var multer=require('multer');var util=require(_0x8f00('0x0'));var path=require(_0x8f00('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f00('0x2'));var router=express['Router']();var fs_extra=require(_0x8f00('0x3'));var auth=require(_0x8f00('0x4'));var interaction=require(_0x8f00('0x5'));var config=require('../../config/environment');var controller=require(_0x8f00('0x6'));router[_0x8f00('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x8f00('0x8')](),controller['show']);router['post']('/',auth[_0x8f00('0x8')](),controller['create']);router[_0x8f00('0x9')](_0x8f00('0xa'),auth[_0x8f00('0x8')](),controller[_0x8f00('0xb')]);router[_0x8f00('0xc')](_0x8f00('0xa'),auth[_0x8f00('0x8')](),controller[_0x8f00('0xd')]);module['exports']=router; \ No newline at end of file +var _0x7dc5=['fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','index','show','post','create','put','isAuthenticated','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router'];(function(_0x3d0135,_0x45ccbb){var _0x56cd45=function(_0x579524){while(--_0x579524){_0x3d0135['push'](_0x3d0135['shift']());}};_0x56cd45(++_0x45ccbb);}(_0x7dc5,0xa6));var _0x57dc=function(_0xf94131,_0x58b63d){_0xf94131=_0xf94131-0x0;var _0xdf5c19=_0x7dc5[_0xf94131];return _0xdf5c19;};'use strict';var multer=require(_0x57dc('0x0'));var util=require('util');var path=require(_0x57dc('0x1'));var timeout=require(_0x57dc('0x2'));var express=require(_0x57dc('0x3'));var router=express[_0x57dc('0x4')]();var fs_extra=require(_0x57dc('0x5'));var auth=require(_0x57dc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x57dc('0x7'));router[_0x57dc('0x8')]('/',auth['isAuthenticated'](),controller[_0x57dc('0x9')]);router[_0x57dc('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x57dc('0xa')]);router[_0x57dc('0xb')]('/',auth['isAuthenticated'](),controller[_0x57dc('0xc')]);router[_0x57dc('0xd')]('/:id',auth[_0x57dc('0xe')](),controller[_0x57dc('0xf')]);router[_0x57dc('0x10')](_0x57dc('0x11'),auth['isAuthenticated'](),controller[_0x57dc('0x12')]);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 4e54e98..403133c 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 _0xfbb2=['setDataValue','options','split','BOOLEAN','sequelize','exports','STRING'];(function(_0xdd0f4b,_0x5e40d7){var _0x2c4621=function(_0x3bfdf6){while(--_0x3bfdf6){_0xdd0f4b['push'](_0xdd0f4b['shift']());}};_0x2c4621(++_0x5e40d7);}(_0xfbb2,0x9e));var _0x2fbb=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xfbb2[_0xabfec4];return _0x7bafa2;};'use strict';var Sequelize=require(_0x2fbb('0x0'));module[_0x2fbb('0x1')]={'name':{'type':Sequelize[_0x2fbb('0x2')]},'prefix':{'type':Sequelize[_0x2fbb('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x2fbb('0x2')],'set':function(_0xc2a02a){this[_0x2fbb('0x3')](_0x2fbb('0x4'),_0xc2a02a?_0xc2a02a['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this['getDataValue']('options')[_0x2fbb('0x5')](''):[];}},'auth':{'type':Sequelize[_0x2fbb('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x2fbb('0x2')]},'record':{'type':Sequelize[_0x2fbb('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2fbb('0x2')]},'description':{'type':Sequelize[_0x2fbb('0x2')]}}; \ No newline at end of file +var _0xbf59=['exports','STRING','name','setDataValue','options','join','getDataValue','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf59,0x1a8));var _0x9bf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf59[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9bf5('0x0')]={'name':{'type':Sequelize[_0x9bf5('0x1')]},'prefix':{'type':Sequelize[_0x9bf5('0x1')],'unique':_0x9bf5('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x9bf5('0x1')],'set':function(_0x58fb42){this[_0x9bf5('0x3')](_0x9bf5('0x4'),_0x58fb42?_0x58fb42[_0x9bf5('0x5')](''):[]);},'get':function(){return this[_0x9bf5('0x6')](_0x9bf5('0x4'))?this[_0x9bf5('0x6')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x9bf5('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x9bf5('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9bf5('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index eaf7e03..6e22507 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 _0x593e=['UserProfileResource','error','name','send','index','map','VoiceChanSpy','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','ChanSpies'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x593e,0xcb));var _0xe593=function(_0x38da50,_0x39a07f){_0x38da50=_0x38da50-0x0;var _0x32d1d3=_0x593e[_0x38da50];return _0x32d1d3;};'use strict';var emlformat=require(_0xe593('0x0'));var rimraf=require(_0xe593('0x1'));var zipdir=require(_0xe593('0x2'));var jsonpatch=require(_0xe593('0x3'));var rp=require(_0xe593('0x4'));var moment=require(_0xe593('0x5'));var BPromise=require(_0xe593('0x6'));var Mustache=require(_0xe593('0x7'));var util=require('util');var path=require(_0xe593('0x8'));var sox=require(_0xe593('0x9'));var csv=require(_0xe593('0xa'));var ejs=require(_0xe593('0xb'));var fs=require('fs');var fs_extra=require(_0xe593('0xc'));var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var licenseUtil=require(_0xe593('0x1a'));var db=require(_0xe593('0x1b'))['db'];function respondWithStatusCode(_0x8ee313,_0x31dad0){_0x31dad0=_0x31dad0||0xcc;return function(_0x24c9fd){if(_0x24c9fd){return _0x8ee313[_0xe593('0x1c')](_0x31dad0);}return _0x8ee313[_0xe593('0x1d')](_0x31dad0)[_0xe593('0x1e')]();};}function respondWithResult(_0x499819,_0x2907e4){_0x2907e4=_0x2907e4||0xc8;return function(_0x1de391){if(_0x1de391){return _0x499819['status'](_0x2907e4)[_0xe593('0x1f')](_0x1de391);}};}function respondWithFilteredResult(_0x44837b,_0x5d4c6a){return function(_0x2ae9b6){if(_0x2ae9b6){var _0x40416c=typeof _0x5d4c6a[_0xe593('0x20')]===_0xe593('0x21')&&typeof _0x5d4c6a[_0xe593('0x22')]===_0xe593('0x21');var _0x48f3b4=_0x2ae9b6[_0xe593('0x23')];var _0x470d07=_0x40416c?0x0:_0x5d4c6a['offset'];var _0xd1020e=_0x40416c?_0x2ae9b6[_0xe593('0x23')]:_0x5d4c6a['offset']+_0x5d4c6a[_0xe593('0x22')];var _0x3dba1b;if(_0xd1020e>=_0x48f3b4){_0xd1020e=_0x48f3b4;_0x3dba1b=0xc8;}else{_0x3dba1b=0xce;}_0x44837b[_0xe593('0x1d')](_0x3dba1b);return _0x44837b[_0xe593('0x24')](_0xe593('0x25'),_0x470d07+'-'+_0xd1020e+'/'+_0x48f3b4)[_0xe593('0x1f')](_0x2ae9b6);}return null;};}function patchUpdates(_0x3d2a51){return function(_0x4ea53f){try{jsonpatch['apply'](_0x4ea53f,_0x3d2a51,!![]);}catch(_0x1634d4){return BPromise['reject'](_0x1634d4);}return _0x4ea53f['save']();};}function saveUpdates(_0x1bb8e8,_0x3c65b5){return function(_0x57379d){if(_0x57379d){return _0x57379d[_0xe593('0x26')](_0x1bb8e8)['then'](function(_0x1672bf){return _0x1672bf;});}return null;};}function removeEntity(_0x2c191f,_0x185cea){return function(_0x44d997){if(_0x44d997){return _0x44d997[_0xe593('0x27')]()[_0xe593('0x28')](function(){var _0x20a098=_0x44d997[_0xe593('0x29')]({'plain':!![]});var _0x4fc483=_0xe593('0x2a');return db[_0xe593('0x2b')]['destroy']({'where':{'type':_0x4fc483,'resourceId':_0x20a098['id']}})['then'](function(){return _0x44d997;});})[_0xe593('0x28')](function(){_0x2c191f[_0xe593('0x1d')](0xcc)[_0xe593('0x1e')]();});}};}function handleEntityNotFound(_0x43699d,_0x3b66bc){return function(_0x27a3d2){if(!_0x27a3d2){_0x43699d['sendStatus'](0x194);}return _0x27a3d2;};}function handleError(_0x350e2b,_0x54e5e2){_0x54e5e2=_0x54e5e2||0x1f4;return function(_0x1dacf6){logger[_0xe593('0x2c')](_0x1dacf6['stack']);if(_0x1dacf6[_0xe593('0x2d')]){delete _0x1dacf6['name'];}_0x350e2b[_0xe593('0x1d')](_0x54e5e2)[_0xe593('0x2e')](_0x1dacf6);};}exports[_0xe593('0x2f')]=function(_0x501e54,_0x1ae8d9){var _0x13f44={},_0x3066ed={},_0x338222={'count':0x0,'rows':[]};var _0x2588be=_[_0xe593('0x30')](db[_0xe593('0x31')]['rawAttributes'],function(_0x4098a9){return{'name':_0x4098a9[_0xe593('0x32')],'type':_0x4098a9['type'][_0xe593('0x33')]};});_0x3066ed['model']=_[_0xe593('0x30')](_0x2588be,_0xe593('0x2d'));_0x3066ed[_0xe593('0x34')]=_[_0xe593('0x35')](_0x501e54[_0xe593('0x34')]);_0x3066ed[_0xe593('0x36')]=_[_0xe593('0x37')](_0x3066ed[_0xe593('0x38')],_0x3066ed[_0xe593('0x34')]);_0x13f44[_0xe593('0x39')]=_['intersection'](_0x3066ed[_0xe593('0x38')],qs[_0xe593('0x3a')](_0x501e54[_0xe593('0x34')]['fields']));_0x13f44['attributes']=_0x13f44[_0xe593('0x39')]['length']?_0x13f44[_0xe593('0x39')]:_0x3066ed[_0xe593('0x38')];if(!_0x501e54[_0xe593('0x34')][_0xe593('0x3b')](_0xe593('0x3c'))){_0x13f44[_0xe593('0x22')]=qs[_0xe593('0x22')](_0x501e54['query']['limit']);_0x13f44[_0xe593('0x20')]=qs['offset'](_0x501e54[_0xe593('0x34')]['offset']);}_0x13f44[_0xe593('0x3d')]=qs['sort'](_0x501e54['query'][_0xe593('0x3e')]);_0x13f44[_0xe593('0x3f')]=qs[_0xe593('0x36')](_['pick'](_0x501e54['query'],_0x3066ed['filters']),_0x2588be);if(_0x501e54[_0xe593('0x34')]['filter']){_0x13f44[_0xe593('0x3f')]=_[_0xe593('0x40')](_0x13f44[_0xe593('0x3f')],{'$or':_[_0xe593('0x30')](_0x2588be,function(_0x50249e){if(_0x50249e[_0xe593('0x41')]!=='VIRTUAL'){var _0x36c08e={};_0x36c08e[_0x50249e['name']]={'$like':'%'+_0x501e54['query']['filter']+'%'};return _0x36c08e;}})});}_0x13f44=_[_0xe593('0x40')]({},_0x13f44,_0x501e54['options']);var _0x3addf0={'where':_0x13f44[_0xe593('0x3f')]};return db[_0xe593('0x31')]['count'](_0x3addf0)[_0xe593('0x28')](function(_0x3f9784){_0x338222[_0xe593('0x23')]=_0x3f9784;if(_0x501e54[_0xe593('0x34')][_0xe593('0x42')]){_0x13f44[_0xe593('0x43')]=[{'all':!![]}];}return db[_0xe593('0x31')][_0xe593('0x44')](_0x13f44);})['then'](function(_0x211065){_0x338222[_0xe593('0x45')]=_0x211065;return _0x338222;})[_0xe593('0x28')](respondWithFilteredResult(_0x1ae8d9,_0x13f44))[_0xe593('0x46')](handleError(_0x1ae8d9,null));};exports[_0xe593('0x47')]=function(_0x4d3018,_0x4a9a5f){var _0x3fd874={'raw':![],'where':{'id':_0x4d3018[_0xe593('0x48')]['id']}},_0x380429={};_0x380429['model']=_[_0xe593('0x35')](db[_0xe593('0x31')]['rawAttributes']);_0x380429['query']=_[_0xe593('0x35')](_0x4d3018[_0xe593('0x34')]);_0x380429[_0xe593('0x36')]=_['intersection'](_0x380429[_0xe593('0x38')],_0x380429[_0xe593('0x34')]);_0x3fd874[_0xe593('0x39')]=_[_0xe593('0x37')](_0x380429['model'],qs['fields'](_0x4d3018['query']['fields']));_0x3fd874[_0xe593('0x39')]=_0x3fd874['attributes'][_0xe593('0x49')]?_0x3fd874[_0xe593('0x39')]:_0x380429[_0xe593('0x38')];if(_0x4d3018[_0xe593('0x34')][_0xe593('0x42')]){_0x3fd874[_0xe593('0x43')]=[{'all':!![]}];}_0x3fd874=_[_0xe593('0x40')]({},_0x3fd874,_0x4d3018[_0xe593('0x4a')]);return db['VoiceChanSpy'][_0xe593('0x4b')](_0x3fd874)[_0xe593('0x28')](handleEntityNotFound(_0x4a9a5f,null))[_0xe593('0x28')](respondWithResult(_0x4a9a5f,null))['catch'](handleError(_0x4a9a5f,null));};exports[_0xe593('0x4c')]=function(_0x5dfdb1,_0x39ec9e){return db[_0xe593('0x31')][_0xe593('0x4c')](_0x5dfdb1['body'],{})['then'](function(_0x7431a3){var _0x45beb1=_0x5dfdb1['user']['get']({'plain':!![]});if(!_0x45beb1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45beb1['role']==='user'){var _0x383645=_0x7431a3[_0xe593('0x29')]({'plain':!![]});var _0x1ed8b5=_0xe593('0x2a');return db[_0xe593('0x4d')][_0xe593('0x4b')]({'where':{'name':_0x1ed8b5,'userProfileId':_0x45beb1[_0xe593('0x4e')]},'raw':!![]})[_0xe593('0x28')](function(_0x355ad8){if(_0x355ad8&&_0x355ad8[_0xe593('0x4f')]===0x0){return db[_0xe593('0x2b')][_0xe593('0x4c')]({'name':_0x383645[_0xe593('0x2d')],'resourceId':_0x383645['id'],'type':_0x355ad8[_0xe593('0x2d')],'sectionId':_0x355ad8['id']},{})[_0xe593('0x28')](function(){return _0x7431a3;});}else{return _0x7431a3;}})[_0xe593('0x46')](function(_0x5d60c3){logger[_0xe593('0x2c')](_0xe593('0x50'),_0x5d60c3);throw _0x5d60c3;});}return _0x7431a3;})[_0xe593('0x28')](respondWithResult(_0x39ec9e,0xc9))[_0xe593('0x46')](handleError(_0x39ec9e,null));};exports[_0xe593('0x26')]=function(_0x8130b2,_0x363643){if(_0x8130b2[_0xe593('0x51')]['id']){delete _0x8130b2[_0xe593('0x51')]['id'];}return db[_0xe593('0x31')][_0xe593('0x4b')]({'where':{'id':_0x8130b2[_0xe593('0x48')]['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x363643,null))[_0xe593('0x28')](saveUpdates(_0x8130b2[_0xe593('0x51')],null))['then'](respondWithResult(_0x363643,null))[_0xe593('0x46')](handleError(_0x363643,null));};exports[_0xe593('0x27')]=function(_0x142d0f,_0x24d061){return db[_0xe593('0x31')]['find']({'where':{'id':_0x142d0f['params']['id']}})[_0xe593('0x28')](handleEntityNotFound(_0x24d061,null))[_0xe593('0x28')](removeEntity(_0x24d061,null))[_0xe593('0x46')](handleError(_0x24d061,null));}; \ No newline at end of file +var _0xb48d=['path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','VoiceChanSpy','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x107578,_0x191c1f){var _0x5013f5=function(_0x57bf7e){while(--_0x57bf7e){_0x107578['push'](_0x107578['shift']());}};_0x5013f5(++_0x191c1f);}(_0xb48d,0x194));var _0xdb48=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xb48d[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require(_0xdb48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb48('0x2'));var moment=require(_0xdb48('0x3'));var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require('util');var path=require(_0xdb48('0x6'));var sox=require('sox');var csv=require(_0xdb48('0x7'));var ejs=require(_0xdb48('0x8'));var fs=require('fs');var fs_extra=require(_0xdb48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xa'));var jsforce=require(_0xdb48('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb48('0x7'));var querystring=require(_0xdb48('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xd'));var authService=require(_0xdb48('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0xf'));var logger=require(_0xdb48('0x10'))(_0xdb48('0x11'));var utils=require('../../config/utils');var config=require(_0xdb48('0x12'));var licenseUtil=require(_0xdb48('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaa4906,_0x3cbfee){_0x3cbfee=_0x3cbfee||0xcc;return function(_0x41e006){if(_0x41e006){return _0xaa4906[_0xdb48('0x14')](_0x3cbfee);}return _0xaa4906[_0xdb48('0x15')](_0x3cbfee)[_0xdb48('0x16')]();};}function respondWithResult(_0x5ebbdd,_0x43df86){_0x43df86=_0x43df86||0xc8;return function(_0x142eaf){if(_0x142eaf){return _0x5ebbdd[_0xdb48('0x15')](_0x43df86)['json'](_0x142eaf);}};}function respondWithFilteredResult(_0x28412d,_0x518dac){return function(_0x453d6b){if(_0x453d6b){var _0x3180d7=typeof _0x518dac[_0xdb48('0x17')]===_0xdb48('0x18')&&typeof _0x518dac[_0xdb48('0x19')]==='undefined';var _0x488997=_0x453d6b[_0xdb48('0x1a')];var _0x38099a=_0x3180d7?0x0:_0x518dac['offset'];var _0x3f98b0=_0x3180d7?_0x453d6b[_0xdb48('0x1a')]:_0x518dac['offset']+_0x518dac['limit'];var _0x1432a9;if(_0x3f98b0>=_0x488997){_0x3f98b0=_0x488997;_0x1432a9=0xc8;}else{_0x1432a9=0xce;}_0x28412d[_0xdb48('0x15')](_0x1432a9);return _0x28412d[_0xdb48('0x1b')]('Content-Range',_0x38099a+'-'+_0x3f98b0+'/'+_0x488997)[_0xdb48('0x1c')](_0x453d6b);}return null;};}function patchUpdates(_0x3d1b69){return function(_0x58604e){try{jsonpatch[_0xdb48('0x1d')](_0x58604e,_0x3d1b69,!![]);}catch(_0x3fb75a){return BPromise[_0xdb48('0x1e')](_0x3fb75a);}return _0x58604e[_0xdb48('0x1f')]();};}function saveUpdates(_0x3921d8,_0x5e63b3){return function(_0x2746c4){if(_0x2746c4){return _0x2746c4[_0xdb48('0x20')](_0x3921d8)[_0xdb48('0x21')](function(_0x5a33a0){return _0x5a33a0;});}return null;};}function removeEntity(_0x5aedc1,_0x52c046){return function(_0x3ad23a){if(_0x3ad23a){return _0x3ad23a[_0xdb48('0x22')]()[_0xdb48('0x21')](function(){var _0x51eeb9=_0x3ad23a[_0xdb48('0x23')]({'plain':!![]});var _0x4d29d1=_0xdb48('0x24');return db[_0xdb48('0x25')][_0xdb48('0x22')]({'where':{'type':_0x4d29d1,'resourceId':_0x51eeb9['id']}})['then'](function(){return _0x3ad23a;});})['then'](function(){_0x5aedc1[_0xdb48('0x15')](0xcc)[_0xdb48('0x16')]();});}};}function handleEntityNotFound(_0xf473a0,_0x529ff4){return function(_0x333db7){if(!_0x333db7){_0xf473a0[_0xdb48('0x14')](0x194);}return _0x333db7;};}function handleError(_0x4dce04,_0x48f9dc){_0x48f9dc=_0x48f9dc||0x1f4;return function(_0x31edb6){logger[_0xdb48('0x26')](_0x31edb6[_0xdb48('0x27')]);if(_0x31edb6[_0xdb48('0x28')]){delete _0x31edb6['name'];}_0x4dce04[_0xdb48('0x15')](_0x48f9dc)[_0xdb48('0x29')](_0x31edb6);};}exports[_0xdb48('0x2a')]=function(_0x560ad6,_0x43e857){var _0xb0afbd={},_0x9972c0={},_0x3bb0fa={'count':0x0,'rows':[]};var _0xbac8a=_[_0xdb48('0x2b')](db['VoiceChanSpy'][_0xdb48('0x2c')],function(_0x1fd8a0){return{'name':_0x1fd8a0[_0xdb48('0x2d')],'type':_0x1fd8a0[_0xdb48('0x2e')][_0xdb48('0x2f')]};});_0x9972c0[_0xdb48('0x30')]=_['map'](_0xbac8a,'name');_0x9972c0[_0xdb48('0x31')]=_[_0xdb48('0x32')](_0x560ad6[_0xdb48('0x31')]);_0x9972c0[_0xdb48('0x33')]=_[_0xdb48('0x34')](_0x9972c0[_0xdb48('0x30')],_0x9972c0[_0xdb48('0x31')]);_0xb0afbd[_0xdb48('0x35')]=_[_0xdb48('0x34')](_0x9972c0['model'],qs[_0xdb48('0x36')](_0x560ad6[_0xdb48('0x31')][_0xdb48('0x36')]));_0xb0afbd[_0xdb48('0x35')]=_0xb0afbd['attributes']['length']?_0xb0afbd[_0xdb48('0x35')]:_0x9972c0[_0xdb48('0x30')];if(!_0x560ad6[_0xdb48('0x31')][_0xdb48('0x37')](_0xdb48('0x38'))){_0xb0afbd[_0xdb48('0x19')]=qs[_0xdb48('0x19')](_0x560ad6[_0xdb48('0x31')]['limit']);_0xb0afbd['offset']=qs[_0xdb48('0x17')](_0x560ad6['query'][_0xdb48('0x17')]);}_0xb0afbd[_0xdb48('0x39')]=qs[_0xdb48('0x3a')](_0x560ad6[_0xdb48('0x31')][_0xdb48('0x3a')]);_0xb0afbd[_0xdb48('0x3b')]=qs[_0xdb48('0x33')](_[_0xdb48('0x3c')](_0x560ad6['query'],_0x9972c0[_0xdb48('0x33')]),_0xbac8a);if(_0x560ad6[_0xdb48('0x31')]['filter']){_0xb0afbd[_0xdb48('0x3b')]=_[_0xdb48('0x3d')](_0xb0afbd[_0xdb48('0x3b')],{'$or':_[_0xdb48('0x2b')](_0xbac8a,function(_0x4f3102){if(_0x4f3102['type']!==_0xdb48('0x3e')){var _0x39f3cf={};_0x39f3cf[_0x4f3102['name']]={'$like':'%'+_0x560ad6['query'][_0xdb48('0x3f')]+'%'};return _0x39f3cf;}})});}_0xb0afbd=_[_0xdb48('0x3d')]({},_0xb0afbd,_0x560ad6[_0xdb48('0x40')]);var _0x38dc0e={'where':_0xb0afbd['where']};return db['VoiceChanSpy'][_0xdb48('0x1a')](_0x38dc0e)[_0xdb48('0x21')](function(_0x171c9e){_0x3bb0fa[_0xdb48('0x1a')]=_0x171c9e;if(_0x560ad6[_0xdb48('0x31')][_0xdb48('0x41')]){_0xb0afbd[_0xdb48('0x42')]=[{'all':!![]}];}return db[_0xdb48('0x43')][_0xdb48('0x44')](_0xb0afbd);})['then'](function(_0x3accdb){_0x3bb0fa[_0xdb48('0x45')]=_0x3accdb;return _0x3bb0fa;})['then'](respondWithFilteredResult(_0x43e857,_0xb0afbd))[_0xdb48('0x46')](handleError(_0x43e857,null));};exports['show']=function(_0x3dbd88,_0x4e18a5){var _0x1df2e3={'raw':![],'where':{'id':_0x3dbd88[_0xdb48('0x47')]['id']}},_0x114121={};_0x114121[_0xdb48('0x30')]=_[_0xdb48('0x32')](db[_0xdb48('0x43')][_0xdb48('0x2c')]);_0x114121[_0xdb48('0x31')]=_[_0xdb48('0x32')](_0x3dbd88[_0xdb48('0x31')]);_0x114121[_0xdb48('0x33')]=_[_0xdb48('0x34')](_0x114121[_0xdb48('0x30')],_0x114121[_0xdb48('0x31')]);_0x1df2e3[_0xdb48('0x35')]=_[_0xdb48('0x34')](_0x114121[_0xdb48('0x30')],qs[_0xdb48('0x36')](_0x3dbd88[_0xdb48('0x31')]['fields']));_0x1df2e3['attributes']=_0x1df2e3[_0xdb48('0x35')][_0xdb48('0x48')]?_0x1df2e3[_0xdb48('0x35')]:_0x114121['model'];if(_0x3dbd88[_0xdb48('0x31')][_0xdb48('0x41')]){_0x1df2e3[_0xdb48('0x42')]=[{'all':!![]}];}_0x1df2e3=_[_0xdb48('0x3d')]({},_0x1df2e3,_0x3dbd88[_0xdb48('0x40')]);return db['VoiceChanSpy'][_0xdb48('0x49')](_0x1df2e3)['then'](handleEntityNotFound(_0x4e18a5,null))[_0xdb48('0x21')](respondWithResult(_0x4e18a5,null))[_0xdb48('0x46')](handleError(_0x4e18a5,null));};exports[_0xdb48('0x4a')]=function(_0x3317ca,_0x5d0742){return db[_0xdb48('0x43')]['create'](_0x3317ca[_0xdb48('0x4b')],{})[_0xdb48('0x21')](function(_0x35865b){var _0x2bca97=_0x3317ca[_0xdb48('0x4c')][_0xdb48('0x23')]({'plain':!![]});if(!_0x2bca97)throw new Error(_0xdb48('0x4d'));if(_0x2bca97[_0xdb48('0x4e')]===_0xdb48('0x4c')){var _0x3c1669=_0x35865b['get']({'plain':!![]});var _0x4b689a=_0xdb48('0x24');return db[_0xdb48('0x4f')][_0xdb48('0x49')]({'where':{'name':_0x4b689a,'userProfileId':_0x2bca97[_0xdb48('0x50')]},'raw':!![]})['then'](function(_0x5c9b2d){if(_0x5c9b2d&&_0x5c9b2d['autoAssociation']===0x0){return db[_0xdb48('0x25')][_0xdb48('0x4a')]({'name':_0x3c1669[_0xdb48('0x28')],'resourceId':_0x3c1669['id'],'type':_0x5c9b2d['name'],'sectionId':_0x5c9b2d['id']},{})[_0xdb48('0x21')](function(){return _0x35865b;});}else{return _0x35865b;}})['catch'](function(_0x255d47){logger[_0xdb48('0x26')](_0xdb48('0x51'),_0x255d47);throw _0x255d47;});}return _0x35865b;})['then'](respondWithResult(_0x5d0742,0xc9))['catch'](handleError(_0x5d0742,null));};exports[_0xdb48('0x20')]=function(_0x835b7c,_0x254918){if(_0x835b7c[_0xdb48('0x4b')]['id']){delete _0x835b7c['body']['id'];}return db[_0xdb48('0x43')][_0xdb48('0x49')]({'where':{'id':_0x835b7c[_0xdb48('0x47')]['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x254918,null))[_0xdb48('0x21')](saveUpdates(_0x835b7c[_0xdb48('0x4b')],null))[_0xdb48('0x21')](respondWithResult(_0x254918,null))['catch'](handleError(_0x254918,null));};exports['destroy']=function(_0x36145b,_0x1c14a0){return db[_0xdb48('0x43')][_0xdb48('0x49')]({'where':{'id':_0x36145b['params']['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x1c14a0,null))[_0xdb48('0x21')](removeEntity(_0x1c14a0,null))['catch'](handleError(_0x1c14a0,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 69b45c0..63f6f40 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 _0x9e20=['then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','context','from-sip','format','%s%s','merge','Set','CDR(type)=%s','MixMonitor','recordingFormat','auth','push','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal','User','findAll','agent'];(function(_0xddbc7c,_0x31b191){var _0x25da11=function(_0x3f10cf){while(--_0x3f10cf){_0xddbc7c['push'](_0xddbc7c['shift']());}};_0x25da11(++_0x31b191);}(_0x9e20,0x1ea));var _0x09e2=function(_0x328648,_0x2bfd47){_0x328648=_0x328648-0x0;var _0x1a9bbe=_0x9e20[_0x328648];return _0x1a9bbe;};'use strict';var _=require(_0x09e2('0x0'));var util=require(_0x09e2('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x515f4f,_0x2eca2f,_0xb405eb){var _0x4ff4c5=0x1;var _0x255ab5=[];var _0xb661bb={'context':_0x2eca2f[_0x09e2('0x2')]||_0x09e2('0x3'),'exten':util[_0x09e2('0x4')](_0x09e2('0x5'),_0x515f4f['prefix'],_0xb405eb),'type':'system','isApp':![],'ChanSpyId':_0x515f4f['id'],'UserId':_0x2eca2f['id']};_0x255ab5['push'](_[_0x09e2('0x6')]({'app':_0x09e2('0x7'),'appdata':util['format'](_0x09e2('0x8'),'chanspy'),'priority':_0x4ff4c5++},_0xb661bb));if(_0x515f4f['record']){_0x255ab5['push'](_[_0x09e2('0x6')]({'app':_0x09e2('0x9'),'appdata':util[_0x09e2('0x4')]('${UNIQUEID}.%s,a',_0x515f4f[_0x09e2('0xa')]),'priority':_0x4ff4c5++},_0xb661bb));}if(_0x515f4f[_0x09e2('0xb')]){_0x255ab5[_0x09e2('0xc')](_[_0x09e2('0x6')]({'app':_0x09e2('0xd'),'appdata':_0x515f4f[_0x09e2('0xe')],'priority':_0x4ff4c5++},_0xb661bb));}_0x255ab5[_0x09e2('0xc')](_['merge']({'app':_0x09e2('0xf'),'appdata':util[_0x09e2('0x4')](_0x09e2('0x10'),_0x2eca2f[_0x09e2('0x11')],_0x515f4f['options']?_0x515f4f[_0x09e2('0x12')][_0x09e2('0x13')](''):''),'priority':_0x4ff4c5++},_0xb661bb));if(_0x515f4f[_0x09e2('0x14')]){_0x255ab5[_0x09e2('0xc')](_[_0x09e2('0x6')]({'app':_0x09e2('0x15'),'priority':_0x4ff4c5++},_0xb661bb));}return _0x255ab5;};var getChanSpyApplications=function(_0xa5d172,_0x390e63){var _0x2501b6=[];for(var _0xdb9238=0x0,_0x51320d=0x1;_0xdb9238<_0x390e63[_0x09e2('0x16')];_0xdb9238++,_0x51320d=0x1){_0x2501b6=_0x2501b6[_0x09e2('0x17')](getUserApplications(_0xa5d172,_0x390e63[_0xdb9238],_0x390e63[_0xdb9238][_0x09e2('0x18')]));if(_0x390e63[_0xdb9238][_0x09e2('0x18')]!=_0x390e63[_0xdb9238]['name']){_0x2501b6=_0x2501b6[_0x09e2('0x17')](getUserApplications(_0xa5d172,_0x390e63[_0xdb9238],_0x390e63[_0xdb9238][_0x09e2('0x11')]));}}return _0x2501b6;};var getChanSpyPromise=function(_0x38fbb0,_0x1f40ba){return new BPromise(function(_0x3fb30,_0x310f3e){return _0x38fbb0[_0x09e2('0x19')][_0x09e2('0x1a')]({'attributes':['id',_0x09e2('0x11'),_0x09e2('0x18')],'where':{'role':_0x09e2('0x1b'),'chanspy':!![]},'raw':!![]})[_0x09e2('0x1c')](function(_0x5253c9){if(_0x5253c9){return _0x3fb30(getChanSpyApplications(_0x1f40ba,_0x5253c9));}return _0x3fb30([]);})[_0x09e2('0x1d')](function(_0x1836f2){_0x310f3e(_0x1836f2);});});};module[_0x09e2('0x1e')]=function(_0x3a9f8b,_0x9bc2b4){var _0x4dde78=_0x3a9f8b[_0x09e2('0x1f')];return _0x3a9f8b[_0x09e2('0x20')](_0x09e2('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e4db1,_0x38569a,_0x4b9740){return getChanSpyPromise(_0x4dde78,_0x1e4db1)[_0x09e2('0x1c')](function(_0x44c1e5){if(_0x44c1e5&&_0x44c1e5[_0x09e2('0x16')]){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x23')](_0x44c1e5);}})[_0x09e2('0x1c')](function(){_0x4b9740();})[_0x09e2('0x1d')](function(_0x1f93e8){_0x4b9740(_0x1f93e8);});},'afterUpdate':function(_0x2c1fb2,_0x2367e4,_0x1a0e7b){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x24')]({'where':{'ChanSpyId':_0x2c1fb2['id']}})[_0x09e2('0x1c')](function(){return getChanSpyPromise(_0x4dde78,_0x2c1fb2);})[_0x09e2('0x1c')](function(_0x1efaa5){if(_0x1efaa5&&_0x1efaa5[_0x09e2('0x16')]){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x23')](_0x1efaa5);}})['then'](function(){_0x1a0e7b();})[_0x09e2('0x1d')](function(_0x3817a6){_0x1a0e7b(_0x3817a6);});},'afterDestroy':function(_0x9732e1,_0x4e9d9a,_0x1b8c07){return _0x4dde78[_0x09e2('0x22')][_0x09e2('0x24')]({'where':{'ChanSpyId':_0x9732e1['id']}})[_0x09e2('0x1c')](function(){_0x1b8c07();})[_0x09e2('0x1d')](function(_0x30037c){_0x1b8c07(_0x30037c);});}}});}; \ No newline at end of file +var _0xded4=['destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','internal','concat','User','agent','then','models','define','voice_chanspy','VoiceExtension','bulkCreate','catch'];(function(_0x3ac6d6,_0xa00fd7){var _0x589387=function(_0x542757){while(--_0x542757){_0x3ac6d6['push'](_0x3ac6d6['shift']());}};_0x589387(++_0xa00fd7);}(_0xded4,0x129));var _0x4ded=function(_0x304239,_0x3441b3){_0x304239=_0x304239-0x0;var _0x4e05b7=_0xded4[_0x304239];return _0x4e05b7;};'use strict';var _=require(_0x4ded('0x0'));var util=require(_0x4ded('0x1'));var BPromise=require(_0x4ded('0x2'));var attributes=require(_0x4ded('0x3'));var getUserApplications=function(_0x128e8f,_0x53b319,_0x2abd87){var _0x514fcb=0x1;var _0x15b049=[];var _0xfce7e3={'context':_0x53b319['context']||_0x4ded('0x4'),'exten':util[_0x4ded('0x5')](_0x4ded('0x6'),_0x128e8f['prefix'],_0x2abd87),'type':_0x4ded('0x7'),'isApp':![],'ChanSpyId':_0x128e8f['id'],'UserId':_0x53b319['id']};_0x15b049[_0x4ded('0x8')](_[_0x4ded('0x9')]({'app':_0x4ded('0xa'),'appdata':util[_0x4ded('0x5')](_0x4ded('0xb'),_0x4ded('0xc')),'priority':_0x514fcb++},_0xfce7e3));if(_0x128e8f[_0x4ded('0xd')]){_0x15b049['push'](_[_0x4ded('0x9')]({'app':_0x4ded('0xe'),'appdata':util[_0x4ded('0x5')](_0x4ded('0xf'),_0x128e8f['recordingFormat']),'priority':_0x514fcb++},_0xfce7e3));}if(_0x128e8f[_0x4ded('0x10')]){_0x15b049[_0x4ded('0x8')](_[_0x4ded('0x9')]({'app':_0x4ded('0x11'),'appdata':_0x128e8f[_0x4ded('0x12')],'priority':_0x514fcb++},_0xfce7e3));}_0x15b049[_0x4ded('0x8')](_[_0x4ded('0x9')]({'app':_0x4ded('0x13'),'appdata':util['format'](_0x4ded('0x14'),_0x53b319[_0x4ded('0x15')],_0x128e8f[_0x4ded('0x16')]?_0x128e8f[_0x4ded('0x16')][_0x4ded('0x17')](''):''),'priority':_0x514fcb++},_0xfce7e3));if(_0x128e8f[_0x4ded('0xd')]){_0x15b049[_0x4ded('0x8')](_['merge']({'app':'StopMixMonitor','priority':_0x514fcb++},_0xfce7e3));}return _0x15b049;};var getChanSpyApplications=function(_0x3f7bdb,_0x3777ad){var _0x3d98d7=[];for(var _0x39d0c1=0x0,_0x22f97a=0x1;_0x39d0c1<_0x3777ad[_0x4ded('0x18')];_0x39d0c1++,_0x22f97a=0x1){_0x3d98d7=_0x3d98d7['concat'](getUserApplications(_0x3f7bdb,_0x3777ad[_0x39d0c1],_0x3777ad[_0x39d0c1][_0x4ded('0x19')]));if(_0x3777ad[_0x39d0c1][_0x4ded('0x19')]!=_0x3777ad[_0x39d0c1][_0x4ded('0x15')]){_0x3d98d7=_0x3d98d7[_0x4ded('0x1a')](getUserApplications(_0x3f7bdb,_0x3777ad[_0x39d0c1],_0x3777ad[_0x39d0c1]['name']));}}return _0x3d98d7;};var getChanSpyPromise=function(_0x5457e2,_0x153b02){return new BPromise(function(_0x4a1a4e,_0x1d6f19){return _0x5457e2[_0x4ded('0x1b')]['findAll']({'attributes':['id',_0x4ded('0x15'),'internal'],'where':{'role':_0x4ded('0x1c'),'chanspy':!![]},'raw':!![]})[_0x4ded('0x1d')](function(_0x181ae1){if(_0x181ae1){return _0x4a1a4e(getChanSpyApplications(_0x153b02,_0x181ae1));}return _0x4a1a4e([]);})['catch'](function(_0x14990c){_0x1d6f19(_0x14990c);});});};module['exports']=function(_0x53606b,_0x108cb5){var _0x4c0d72=_0x53606b[_0x4ded('0x1e')];return _0x53606b[_0x4ded('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x4ded('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fd4a2,_0x25b70c,_0x4e3d81){return getChanSpyPromise(_0x4c0d72,_0x3fd4a2)['then'](function(_0x5517a6){if(_0x5517a6&&_0x5517a6[_0x4ded('0x18')]){return _0x4c0d72[_0x4ded('0x21')][_0x4ded('0x22')](_0x5517a6);}})[_0x4ded('0x1d')](function(){_0x4e3d81();})[_0x4ded('0x23')](function(_0x42c279){_0x4e3d81(_0x42c279);});},'afterUpdate':function(_0x55948c,_0x44da52,_0xe78b6b){return _0x4c0d72[_0x4ded('0x21')][_0x4ded('0x24')]({'where':{'ChanSpyId':_0x55948c['id']}})[_0x4ded('0x1d')](function(){return getChanSpyPromise(_0x4c0d72,_0x55948c);})['then'](function(_0xef2d63){if(_0xef2d63&&_0xef2d63[_0x4ded('0x18')]){return _0x4c0d72['VoiceExtension'][_0x4ded('0x22')](_0xef2d63);}})['then'](function(){_0xe78b6b();})[_0x4ded('0x23')](function(_0x117902){_0xe78b6b(_0x117902);});},'afterDestroy':function(_0xb1ed23,_0x4a835a,_0xbd3fab){return _0x4c0d72[_0x4ded('0x21')][_0x4ded('0x24')]({'where':{'ChanSpyId':_0xb1ed23['id']}})[_0x4ded('0x1d')](function(){_0xbd3fab();})[_0x4ded('0x23')](function(_0x572bbc){_0xbd3fab(_0x572bbc);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index df53165..c47c232 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 _0xda65=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x51ff5e,_0x3838b5){var _0x80c916=function(_0x37ef19){while(--_0x37ef19){_0x51ff5e['push'](_0x51ff5e['shift']());}};_0x80c916(++_0x3838b5);}(_0xda65,0x1d0));var _0x5da6=function(_0x50712e,_0x1dae91){_0x50712e=_0x50712e-0x0;var _0x558e54=_0xda65[_0x50712e];return _0x558e54;};'use strict';var _=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var moment=require(_0x5da6('0x2'));var BPromise=require('bluebird');var rs=require(_0x5da6('0x3'));var fs=require('fs');var Redis=require(_0x5da6('0x4'));var db=require(_0x5da6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5da6('0x6'));var config=require(_0x5da6('0x7'));var jayson=require(_0x5da6('0x8'));var client=jayson[_0x5da6('0x9')][_0x5da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51924c,_0x35aff9,_0x4a7040){return new BPromise(function(_0x55108e,_0x40722c){return client['request'](_0x51924c,_0x4a7040)[_0x5da6('0xb')](function(_0x20cb14){logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));logger[_0x5da6('0xf')](_0x5da6('0x10'),_0x35aff9,_0x5da6('0xe'),JSON['stringify'](_0x20cb14));if(_0x20cb14[_0x5da6('0x11')]){if(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x12')]===0x1f4){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x40722c(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}logger['error'](_0x5da6('0xd'),_0x35aff9,_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);return _0x55108e(_0x20cb14[_0x5da6('0x11')][_0x5da6('0x13')]);}else{logger[_0x5da6('0xc')](_0x5da6('0xd'),_0x35aff9,_0x5da6('0xe'));_0x55108e(_0x20cb14[_0x5da6('0x14')][_0x5da6('0x13')]);}})['catch'](function(_0x5207e5){logger[_0x5da6('0x11')](_0x5da6('0xd'),_0x35aff9,_0x5207e5);_0x40722c(_0x5207e5);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xda3f,0xec));var _0xfda3=function(_0x5d2a46,_0x8f5cac){_0x5d2a46=_0x5d2a46-0x0;var _0x6915ca=_0xda3f[_0x5d2a46];return _0x6915ca;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 1409a2b..e5d4922 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 _0xc7f8=['isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0xc7f8,0x184));var _0x8c7f=function(_0x38e319,_0x4416be){_0x38e319=_0x38e319-0x0;var _0xce9889=_0xc7f8[_0x38e319];return _0xce9889;};'use strict';var multer=require(_0x8c7f('0x0'));var util=require(_0x8c7f('0x1'));var path=require(_0x8c7f('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c7f('0x3'));var router=express[_0x8c7f('0x4')]();var fs_extra=require(_0x8c7f('0x5'));var auth=require(_0x8c7f('0x6'));var interaction=require(_0x8c7f('0x7'));var config=require(_0x8c7f('0x8'));var controller=require(_0x8c7f('0x9'));router[_0x8c7f('0xa')]('/',auth[_0x8c7f('0xb')](),controller['index']);router[_0x8c7f('0xa')]('/:id',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0xc')]);router[_0x8c7f('0xd')]('/',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0xe')]);router[_0x8c7f('0xf')]('/:id',auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x10')]);router[_0x8c7f('0x11')](_0x8c7f('0x12'),auth[_0x8c7f('0xb')](),controller[_0x8c7f('0x13')]);module[_0x8c7f('0x14')]=router; \ No newline at end of file +var _0xa6b0=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','put'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xa6b0,0xad));var _0x0a6b=function(_0x125b65,_0x559682){_0x125b65=_0x125b65-0x0;var _0xabece7=_0xa6b0[_0x125b65];return _0xabece7;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require(_0x0a6b('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a6b('0x3'));var router=express[_0x0a6b('0x4')]();var fs_extra=require(_0x0a6b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var controller=require('./voiceContext.controller');router[_0x0a6b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a6b('0x9')]);router[_0x0a6b('0x8')](_0x0a6b('0xa'),auth[_0x0a6b('0xb')](),controller[_0x0a6b('0xc')]);router['post']('/',auth[_0x0a6b('0xb')](),controller['create']);router[_0x0a6b('0xd')]('/:id',auth[_0x0a6b('0xb')](),controller['update']);router[_0x0a6b('0xe')](_0x0a6b('0xa'),auth['isAuthenticated'](),controller[_0x0a6b('0xf')]);module[_0x0a6b('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index b64e106..31cd5ed 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 _0x7b14=['BOOLEAN','sequelize','STRING','name'];(function(_0x239110,_0x5160b1){var _0x1c1e7c=function(_0xeb1264){while(--_0xeb1264){_0x239110['push'](_0x239110['shift']());}};_0x1c1e7c(++_0x5160b1);}(_0x7b14,0x1b5));var _0x47b1=function(_0x2d519b,_0x2ba15b){_0x2d519b=_0x2d519b-0x0;var _0x5948ae=_0x7b14[_0x2d519b];return _0x5948ae;};'use strict';var Sequelize=require(_0x47b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x47b1('0x1')],'unique':_0x47b1('0x2')},'description':{'type':Sequelize[_0x47b1('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x47b1('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x21dc=['STRING','BOOLEAN','sequelize','exports','name'];(function(_0x24b773,_0x392c26){var _0x35f6c9=function(_0x37b5c3){while(--_0x37b5c3){_0x24b773['push'](_0x24b773['shift']());}};_0x35f6c9(++_0x392c26);}(_0x21dc,0x13d));var _0xc21d=function(_0x4594cb,_0x256ecd){_0x4594cb=_0x4594cb-0x0;var _0x13b3a2=_0x21dc[_0x4594cb];return _0x13b3a2;};'use strict';var Sequelize=require(_0xc21d('0x0'));module[_0xc21d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc21d('0x2')},'description':{'type':Sequelize[_0xc21d('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc21d('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 3dd44d9..3343428 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 _0x8fb6=['render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','join','writeFileSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','reject','save','get','Contexts','UserProfileResource','destroy','name','send','index','VoiceContext','rawAttributes','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','root','server/files/templates/context.ejs','utf8'];(function(_0x2409cb,_0x219fb1){var _0x1682d7=function(_0x481a50){while(--_0x481a50){_0x2409cb['push'](_0x2409cb['shift']());}};_0x1682d7(++_0x219fb1);}(_0x8fb6,0x76));var _0x68fb=function(_0x1f7f9f,_0x330b00){_0x1f7f9f=_0x1f7f9f-0x0;var _0x5d999f=_0x8fb6[_0x1f7f9f];return _0x5d999f;};'use strict';var emlformat=require(_0x68fb('0x0'));var rimraf=require(_0x68fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x68fb('0x2'));var rp=require(_0x68fb('0x3'));var moment=require('moment');var BPromise=require(_0x68fb('0x4'));var Mustache=require(_0x68fb('0x5'));var util=require(_0x68fb('0x6'));var path=require(_0x68fb('0x7'));var sox=require(_0x68fb('0x8'));var csv=require('to-csv');var ejs=require(_0x68fb('0x9'));var fs=require('fs');var fs_extra=require(_0x68fb('0xa'));var _=require(_0x68fb('0xb'));var squel=require('squel');var crypto=require(_0x68fb('0xc'));var jsforce=require(_0x68fb('0xd'));var deskjs=require(_0x68fb('0xe'));var toCsv=require(_0x68fb('0xf'));var querystring=require('querystring');var Papa=require(_0x68fb('0x10'));var Redis=require(_0x68fb('0x11'));var authService=require(_0x68fb('0x12'));var qs=require(_0x68fb('0x13'));var as=require(_0x68fb('0x14'));var hardwareService=require(_0x68fb('0x15'));var logger=require('../../config/logger')(_0x68fb('0x16'));var utils=require(_0x68fb('0x17'));var config=require(_0x68fb('0x18'));var licenseUtil=require(_0x68fb('0x19'));var db=require(_0x68fb('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x68fb('0x1b')][_0x68fb('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x206050,_0x7b174f,_0x439c85,_0x37a539){return new BPromise(function(_0x2611a4,_0x32c877){var _0xa82cd4=_0x37a539||client;return _0xa82cd4[_0x68fb('0x1d')](_0x206050,_0x439c85)[_0x68fb('0x1e')](function(_0x5b0484){logger[_0x68fb('0x1f')](_0x68fb('0x20'),_0x7b174f,_0x68fb('0x21'));logger[_0x68fb('0x22')](_0x68fb('0x23'),_0x7b174f,_0x68fb('0x21'),JSON[_0x68fb('0x24')](_0x5b0484));if(_0x5b0484['error']){if(_0x5b0484[_0x68fb('0x25')][_0x68fb('0x26')]===0x1f4){logger[_0x68fb('0x25')](_0x68fb('0x20'),_0x7b174f,_0x5b0484['error'][_0x68fb('0x27')]);return _0x32c877(_0x5b0484[_0x68fb('0x25')][_0x68fb('0x27')]);}logger[_0x68fb('0x25')](_0x68fb('0x20'),_0x7b174f,_0x5b0484[_0x68fb('0x25')][_0x68fb('0x27')]);return _0x2611a4(_0x5b0484[_0x68fb('0x25')][_0x68fb('0x27')]);}else{logger[_0x68fb('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x7b174f,'request\x20sent');_0x2611a4(_0x5b0484[_0x68fb('0x28')][_0x68fb('0x27')]);}})[_0x68fb('0x29')](function(_0x35be7c){logger[_0x68fb('0x25')]('VoiceContext,\x20%s,\x20%s',_0x7b174f,_0x35be7c);_0x32c877(_0x35be7c);});});}function respondWithStatusCode(_0x59a303,_0x8dbbeb){_0x8dbbeb=_0x8dbbeb||0xcc;return function(_0xa8f414){if(_0xa8f414){return _0x59a303[_0x68fb('0x2a')](_0x8dbbeb);}return _0x59a303['status'](_0x8dbbeb)[_0x68fb('0x2b')]();};}function respondWithResult(_0xc0f811,_0x520aab){_0x520aab=_0x520aab||0xc8;return function(_0x134d4d){if(_0x134d4d){return _0xc0f811['status'](_0x520aab)[_0x68fb('0x2c')](_0x134d4d);}};}function respondWithFilteredResult(_0x6f8771,_0x548de9){return function(_0x33db9b){if(_0x33db9b){var _0x5bbe9d=typeof _0x548de9[_0x68fb('0x2d')]===_0x68fb('0x2e')&&typeof _0x548de9['limit']===_0x68fb('0x2e');var _0x31e3b0=_0x33db9b[_0x68fb('0x2f')];var _0x26197c=_0x5bbe9d?0x0:_0x548de9[_0x68fb('0x2d')];var _0x5ec3b7=_0x5bbe9d?_0x33db9b['count']:_0x548de9[_0x68fb('0x2d')]+_0x548de9['limit'];var _0x254d6c;if(_0x5ec3b7>=_0x31e3b0){_0x5ec3b7=_0x31e3b0;_0x254d6c=0xc8;}else{_0x254d6c=0xce;}_0x6f8771[_0x68fb('0x30')](_0x254d6c);return _0x6f8771[_0x68fb('0x31')](_0x68fb('0x32'),_0x26197c+'-'+_0x5ec3b7+'/'+_0x31e3b0)[_0x68fb('0x2c')](_0x33db9b);}return null;};}function patchUpdates(_0x427a16){return function(_0x247da7){try{jsonpatch['apply'](_0x247da7,_0x427a16,!![]);}catch(_0x3b9532){return BPromise[_0x68fb('0x33')](_0x3b9532);}return _0x247da7[_0x68fb('0x34')]();};}function saveUpdates(_0x29f35f,_0x52eb0c){return function(_0x3d9102){if(_0x3d9102){return _0x3d9102['update'](_0x29f35f)[_0x68fb('0x1e')](function(_0x48b9b7){return _0x48b9b7;});}return null;};}function removeEntity(_0x169a5b,_0xc9f53c){return function(_0x382825){if(_0x382825){return _0x382825['destroy']()[_0x68fb('0x1e')](function(){var _0x3bc017=_0x382825[_0x68fb('0x35')]({'plain':!![]});var _0x205e8e=_0x68fb('0x36');return db[_0x68fb('0x37')][_0x68fb('0x38')]({'where':{'type':_0x205e8e,'resourceId':_0x3bc017['id']}})[_0x68fb('0x1e')](function(){return _0x382825;});})[_0x68fb('0x1e')](function(){_0x169a5b[_0x68fb('0x30')](0xcc)[_0x68fb('0x2b')]();});}};}function handleEntityNotFound(_0x1bb79f,_0x36fddd){return function(_0x418098){if(!_0x418098){_0x1bb79f['sendStatus'](0x194);}return _0x418098;};}function handleError(_0x2bc1af,_0x50d4cd){_0x50d4cd=_0x50d4cd||0x1f4;return function(_0x156c27){logger[_0x68fb('0x25')](_0x156c27['stack']);if(_0x156c27[_0x68fb('0x39')]){delete _0x156c27[_0x68fb('0x39')];}_0x2bc1af[_0x68fb('0x30')](_0x50d4cd)[_0x68fb('0x3a')](_0x156c27);};}exports[_0x68fb('0x3b')]=function(_0x48519c,_0x26bce9){var _0x11d302={},_0x37664f={},_0xe0521d={'count':0x0,'rows':[]};var _0x7741cf=_['map'](db[_0x68fb('0x3c')][_0x68fb('0x3d')],function(_0x342e87){return{'name':_0x342e87['fieldName'],'type':_0x342e87[_0x68fb('0x3e')]['key']};});_0x37664f['model']=_[_0x68fb('0x3f')](_0x7741cf,_0x68fb('0x39'));_0x37664f[_0x68fb('0x40')]=_[_0x68fb('0x41')](_0x48519c[_0x68fb('0x40')]);_0x37664f[_0x68fb('0x42')]=_['intersection'](_0x37664f[_0x68fb('0x43')],_0x37664f[_0x68fb('0x40')]);_0x11d302[_0x68fb('0x44')]=_[_0x68fb('0x45')](_0x37664f[_0x68fb('0x43')],qs['fields'](_0x48519c[_0x68fb('0x40')][_0x68fb('0x46')]));_0x11d302['attributes']=_0x11d302[_0x68fb('0x44')][_0x68fb('0x47')]?_0x11d302['attributes']:_0x37664f['model'];if(!_0x48519c[_0x68fb('0x40')][_0x68fb('0x48')](_0x68fb('0x49'))){_0x11d302['limit']=qs['limit'](_0x48519c[_0x68fb('0x40')]['limit']);_0x11d302[_0x68fb('0x2d')]=qs[_0x68fb('0x2d')](_0x48519c[_0x68fb('0x40')][_0x68fb('0x2d')]);}_0x11d302[_0x68fb('0x4a')]=qs['sort'](_0x48519c[_0x68fb('0x40')][_0x68fb('0x4b')]);_0x11d302[_0x68fb('0x4c')]=qs[_0x68fb('0x42')](_[_0x68fb('0x4d')](_0x48519c[_0x68fb('0x40')],_0x37664f['filters']),_0x7741cf);if(_0x48519c[_0x68fb('0x40')][_0x68fb('0x4e')]){_0x11d302['where']=_[_0x68fb('0x4f')](_0x11d302[_0x68fb('0x4c')],{'$or':_['map'](_0x7741cf,function(_0x52b219){if(_0x52b219[_0x68fb('0x3e')]!==_0x68fb('0x50')){var _0x557d58={};_0x557d58[_0x52b219[_0x68fb('0x39')]]={'$like':'%'+_0x48519c['query'][_0x68fb('0x4e')]+'%'};return _0x557d58;}})});}_0x11d302=_[_0x68fb('0x4f')]({},_0x11d302,_0x48519c[_0x68fb('0x51')]);var _0x430b50={'where':_0x11d302['where']};return db[_0x68fb('0x3c')][_0x68fb('0x2f')](_0x430b50)[_0x68fb('0x1e')](function(_0x57e759){_0xe0521d['count']=_0x57e759;if(_0x48519c[_0x68fb('0x40')][_0x68fb('0x52')]){_0x11d302['include']=[{'all':!![]}];}return db['VoiceContext'][_0x68fb('0x53')](_0x11d302);})['then'](function(_0x232615){_0xe0521d[_0x68fb('0x54')]=_0x232615;return _0xe0521d;})[_0x68fb('0x1e')](respondWithFilteredResult(_0x26bce9,_0x11d302))[_0x68fb('0x29')](handleError(_0x26bce9,null));};exports[_0x68fb('0x55')]=function(_0x40fbf5,_0x5545a5){var _0x317c20={'raw':![],'where':{'id':_0x40fbf5[_0x68fb('0x56')]['id']}},_0xe436ce={};_0xe436ce[_0x68fb('0x43')]=_[_0x68fb('0x41')](db[_0x68fb('0x3c')]['rawAttributes']);_0xe436ce[_0x68fb('0x40')]=_[_0x68fb('0x41')](_0x40fbf5[_0x68fb('0x40')]);_0xe436ce[_0x68fb('0x42')]=_[_0x68fb('0x45')](_0xe436ce['model'],_0xe436ce[_0x68fb('0x40')]);_0x317c20[_0x68fb('0x44')]=_[_0x68fb('0x45')](_0xe436ce[_0x68fb('0x43')],qs[_0x68fb('0x46')](_0x40fbf5[_0x68fb('0x40')]['fields']));_0x317c20['attributes']=_0x317c20['attributes'][_0x68fb('0x47')]?_0x317c20[_0x68fb('0x44')]:_0xe436ce[_0x68fb('0x43')];if(_0x40fbf5[_0x68fb('0x40')][_0x68fb('0x52')]){_0x317c20['include']=[{'all':!![]}];}_0x317c20=_[_0x68fb('0x4f')]({},_0x317c20,_0x40fbf5[_0x68fb('0x51')]);return db[_0x68fb('0x3c')][_0x68fb('0x57')](_0x317c20)[_0x68fb('0x1e')](handleEntityNotFound(_0x5545a5,null))['then'](respondWithResult(_0x5545a5,null))[_0x68fb('0x29')](handleError(_0x5545a5,null));};exports[_0x68fb('0x58')]=function(_0x3690b8,_0x101cf8,_0x52aee1){var _0x40ca20;return db['VoiceContext'][_0x68fb('0x58')](_0x3690b8['body'],{'raw':!![]})[_0x68fb('0x1e')](function(_0x445612){_0x40ca20=_0x445612;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x68fb('0x1e')](function(_0x1076c0){var _0x4532a0=fs['readFileSync'](path['join'](config[_0x68fb('0x59')],_0x68fb('0x5a')),_0x68fb('0x5b'));var _0x513fd4=ejs[_0x68fb('0x5c')](_0x4532a0,{'contexts':_0x1076c0||[]});fs['writeFileSync'](_0x68fb('0x5d'),_0x513fd4);})[_0x68fb('0x1e')](function(){return respondWithRpcPromise(_0x68fb('0x5e'),'create',{'module':_0x68fb('0x5f')});})[_0x68fb('0x1e')](function(){var _0x3dacfa=_0x3690b8['user']['get']({'plain':!![]});if(!_0x3dacfa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dacfa[_0x68fb('0x60')]===_0x68fb('0x61')){var _0x5bf450=_0x40ca20[_0x68fb('0x35')]({'plain':!![]});return db[_0x68fb('0x62')][_0x68fb('0x57')]({'where':{'name':_0x68fb('0x36'),'userProfileId':_0x3dacfa[_0x68fb('0x63')]},'raw':!![]})['then'](function(_0x12eaac){if(_0x12eaac&&_0x12eaac[_0x68fb('0x64')]===0x0){return db['UserProfileResource'][_0x68fb('0x58')]({'name':_0x5bf450[_0x68fb('0x39')],'resourceId':_0x5bf450['id'],'type':_0x12eaac[_0x68fb('0x39')],'sectionId':_0x12eaac['id']},{})[_0x68fb('0x1e')](function(){return _0x40ca20;});}else{return _0x40ca20;}})[_0x68fb('0x29')](function(_0x2791ab){logger[_0x68fb('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2791ab);throw _0x2791ab;});}return _0x40ca20;})['then'](respondWithResult(_0x101cf8,0xc9))[_0x68fb('0x29')](handleError(_0x101cf8,null));};exports[_0x68fb('0x65')]=function(_0x1d1aa7,_0x5540b4,_0x27ffcc){var _0x3e3345;return db[_0x68fb('0x3c')]['find']({'where':{'id':_0x1d1aa7[_0x68fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x5540b4,null))['then'](saveUpdates(_0x1d1aa7[_0x68fb('0x66')],null))[_0x68fb('0x1e')](function(_0xf5476e){if(_0xf5476e){_0x3e3345=_0xf5476e;return db[_0x68fb('0x3c')]['findAll']({'raw':!![]});}})['then'](function(_0x1cc54b){var _0x58a77d=fs['readFileSync'](path['join'](config[_0x68fb('0x59')],_0x68fb('0x5a')),'utf8');var _0x93f14d=ejs[_0x68fb('0x5c')](_0x58a77d,{'contexts':_0x1cc54b||[]});fs['writeFileSync'](_0x68fb('0x5d'),_0x93f14d);})[_0x68fb('0x1e')](function(){return respondWithRpcPromise(_0x68fb('0x5e'),_0x68fb('0x65'),{'module':_0x68fb('0x5f')});})[_0x68fb('0x1e')](function(){return _0x3e3345;})[_0x68fb('0x1e')](respondWithResult(_0x5540b4,null))[_0x68fb('0x29')](handleError(_0x5540b4,null));};exports[_0x68fb('0x38')]=function(_0x3a40fd,_0x103251,_0x161d85){var _0x538945;return db[_0x68fb('0x3c')][_0x68fb('0x57')]({'where':{'id':_0x3a40fd[_0x68fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x103251,null))[_0x68fb('0x1e')](removeEntity(_0x103251,null))[_0x68fb('0x1e')](function(){return db['VoiceContext'][_0x68fb('0x53')]({'raw':!![]});})[_0x68fb('0x1e')](function(_0x1d0eff){var _0x36168a=fs['readFileSync'](path[_0x68fb('0x67')](config[_0x68fb('0x59')],'server/files/templates/context.ejs'),_0x68fb('0x5b'));var _0x2e687a=ejs[_0x68fb('0x5c')](_0x36168a,{'contexts':_0x1d0eff});fs[_0x68fb('0x68')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2e687a);return respondWithRpcPromise(_0x68fb('0x5e'),_0x68fb('0x38'),{'module':_0x68fb('0x5f')});})[_0x68fb('0x29')](handleError(_0x103251,null));}; \ No newline at end of file +var _0x9424=['update','get','Contexts','UserProfileResource','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','render','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0xb01be4,_0x71a0e2){var _0x1526ad=function(_0x30657d){while(--_0x30657d){_0xb01be4['push'](_0xb01be4['shift']());}};_0x1526ad(++_0x71a0e2);}(_0x9424,0x1eb));var _0x4942=function(_0x7b0c96,_0x469ee0){_0x7b0c96=_0x7b0c96-0x0;var _0x54179e=_0x9424[_0x7b0c96];return _0x54179e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4942('0x0'));var zipdir=require(_0x4942('0x1'));var jsonpatch=require(_0x4942('0x2'));var rp=require(_0x4942('0x3'));var moment=require(_0x4942('0x4'));var BPromise=require(_0x4942('0x5'));var Mustache=require(_0x4942('0x6'));var util=require('util');var path=require(_0x4942('0x7'));var sox=require(_0x4942('0x8'));var csv=require(_0x4942('0x9'));var ejs=require(_0x4942('0xa'));var fs=require('fs');var fs_extra=require(_0x4942('0xb'));var _=require('lodash');var squel=require(_0x4942('0xc'));var crypto=require(_0x4942('0xd'));var jsforce=require(_0x4942('0xe'));var deskjs=require(_0x4942('0xf'));var toCsv=require(_0x4942('0x9'));var querystring=require('querystring');var Papa=require(_0x4942('0x10'));var Redis=require(_0x4942('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4942('0x12'));var as=require(_0x4942('0x13'));var hardwareService=require(_0x4942('0x14'));var logger=require(_0x4942('0x15'))(_0x4942('0x16'));var utils=require(_0x4942('0x17'));var config=require(_0x4942('0x18'));var licenseUtil=require(_0x4942('0x19'));var db=require(_0x4942('0x1a'))['db'];var jayson=require(_0x4942('0x1b'));var client=jayson[_0x4942('0x1c')][_0x4942('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1cd5bd,_0xa196df,_0x4c06a7,_0x586f11){return new BPromise(function(_0x4eb3dd,_0x4b04f7){var _0xa90fb3=_0x586f11||client;return _0xa90fb3[_0x4942('0x1e')](_0x1cd5bd,_0x4c06a7)[_0x4942('0x1f')](function(_0x368e84){logger['info'](_0x4942('0x20'),_0xa196df,_0x4942('0x21'));logger[_0x4942('0x22')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xa196df,_0x4942('0x21'),JSON[_0x4942('0x23')](_0x368e84));if(_0x368e84['error']){if(_0x368e84[_0x4942('0x24')][_0x4942('0x25')]===0x1f4){logger[_0x4942('0x24')](_0x4942('0x20'),_0xa196df,_0x368e84[_0x4942('0x24')]['message']);return _0x4b04f7(_0x368e84[_0x4942('0x24')][_0x4942('0x26')]);}logger[_0x4942('0x24')]('VoiceContext,\x20%s,\x20%s',_0xa196df,_0x368e84[_0x4942('0x24')][_0x4942('0x26')]);return _0x4eb3dd(_0x368e84[_0x4942('0x24')]['message']);}else{logger['info'](_0x4942('0x20'),_0xa196df,_0x4942('0x21'));_0x4eb3dd(_0x368e84[_0x4942('0x27')][_0x4942('0x26')]);}})[_0x4942('0x28')](function(_0x42b99f){logger[_0x4942('0x24')](_0x4942('0x20'),_0xa196df,_0x42b99f);_0x4b04f7(_0x42b99f);});});}function respondWithStatusCode(_0x477197,_0x5ec32e){_0x5ec32e=_0x5ec32e||0xcc;return function(_0x39d9ca){if(_0x39d9ca){return _0x477197[_0x4942('0x29')](_0x5ec32e);}return _0x477197[_0x4942('0x2a')](_0x5ec32e)[_0x4942('0x2b')]();};}function respondWithResult(_0x325f2b,_0x509c2b){_0x509c2b=_0x509c2b||0xc8;return function(_0x52ed43){if(_0x52ed43){return _0x325f2b[_0x4942('0x2a')](_0x509c2b)['json'](_0x52ed43);}};}function respondWithFilteredResult(_0x4df786,_0x4c107c){return function(_0x4af9c1){if(_0x4af9c1){var _0x4b98e9=typeof _0x4c107c[_0x4942('0x2c')]===_0x4942('0x2d')&&typeof _0x4c107c[_0x4942('0x2e')]===_0x4942('0x2d');var _0x9c4698=_0x4af9c1[_0x4942('0x2f')];var _0x4f5696=_0x4b98e9?0x0:_0x4c107c['offset'];var _0x23146a=_0x4b98e9?_0x4af9c1[_0x4942('0x2f')]:_0x4c107c[_0x4942('0x2c')]+_0x4c107c['limit'];var _0x12ba58;if(_0x23146a>=_0x9c4698){_0x23146a=_0x9c4698;_0x12ba58=0xc8;}else{_0x12ba58=0xce;}_0x4df786[_0x4942('0x2a')](_0x12ba58);return _0x4df786[_0x4942('0x30')](_0x4942('0x31'),_0x4f5696+'-'+_0x23146a+'/'+_0x9c4698)[_0x4942('0x32')](_0x4af9c1);}return null;};}function patchUpdates(_0x5b2bd6){return function(_0x1fb163){try{jsonpatch[_0x4942('0x33')](_0x1fb163,_0x5b2bd6,!![]);}catch(_0xd69040){return BPromise[_0x4942('0x34')](_0xd69040);}return _0x1fb163[_0x4942('0x35')]();};}function saveUpdates(_0x58b701,_0x10a275){return function(_0x1b122a){if(_0x1b122a){return _0x1b122a[_0x4942('0x36')](_0x58b701)[_0x4942('0x1f')](function(_0x4058a0){return _0x4058a0;});}return null;};}function removeEntity(_0xf90488,_0xf2e04a){return function(_0x21356c){if(_0x21356c){return _0x21356c['destroy']()[_0x4942('0x1f')](function(){var _0x1a275a=_0x21356c[_0x4942('0x37')]({'plain':!![]});var _0x57a34a=_0x4942('0x38');return db[_0x4942('0x39')][_0x4942('0x3a')]({'where':{'type':_0x57a34a,'resourceId':_0x1a275a['id']}})[_0x4942('0x1f')](function(){return _0x21356c;});})[_0x4942('0x1f')](function(){_0xf90488[_0x4942('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8fd1,_0x1b41be){return function(_0x3108e5){if(!_0x3108e5){_0x3c8fd1[_0x4942('0x29')](0x194);}return _0x3108e5;};}function handleError(_0x525fbf,_0x7e37d8){_0x7e37d8=_0x7e37d8||0x1f4;return function(_0x33174e){logger[_0x4942('0x24')](_0x33174e[_0x4942('0x3b')]);if(_0x33174e['name']){delete _0x33174e[_0x4942('0x3c')];}_0x525fbf[_0x4942('0x2a')](_0x7e37d8)[_0x4942('0x3d')](_0x33174e);};}exports[_0x4942('0x3e')]=function(_0x5178cb,_0x477106){var _0x29a56b={},_0x40a7e8={},_0x32277d={'count':0x0,'rows':[]};var _0x2f70c0=_[_0x4942('0x3f')](db[_0x4942('0x40')][_0x4942('0x41')],function(_0x3d718a){return{'name':_0x3d718a[_0x4942('0x42')],'type':_0x3d718a['type']['key']};});_0x40a7e8[_0x4942('0x43')]=_['map'](_0x2f70c0,_0x4942('0x3c'));_0x40a7e8['query']=_['keys'](_0x5178cb[_0x4942('0x44')]);_0x40a7e8['filters']=_[_0x4942('0x45')](_0x40a7e8[_0x4942('0x43')],_0x40a7e8['query']);_0x29a56b[_0x4942('0x46')]=_[_0x4942('0x45')](_0x40a7e8['model'],qs[_0x4942('0x47')](_0x5178cb[_0x4942('0x44')]['fields']));_0x29a56b[_0x4942('0x46')]=_0x29a56b['attributes'][_0x4942('0x48')]?_0x29a56b[_0x4942('0x46')]:_0x40a7e8[_0x4942('0x43')];if(!_0x5178cb[_0x4942('0x44')]['hasOwnProperty'](_0x4942('0x49'))){_0x29a56b[_0x4942('0x2e')]=qs[_0x4942('0x2e')](_0x5178cb[_0x4942('0x44')][_0x4942('0x2e')]);_0x29a56b[_0x4942('0x2c')]=qs[_0x4942('0x2c')](_0x5178cb[_0x4942('0x44')][_0x4942('0x2c')]);}_0x29a56b[_0x4942('0x4a')]=qs['sort'](_0x5178cb[_0x4942('0x44')][_0x4942('0x4b')]);_0x29a56b['where']=qs['filters'](_[_0x4942('0x4c')](_0x5178cb[_0x4942('0x44')],_0x40a7e8[_0x4942('0x4d')]),_0x2f70c0);if(_0x5178cb['query'][_0x4942('0x4e')]){_0x29a56b['where']=_[_0x4942('0x4f')](_0x29a56b['where'],{'$or':_[_0x4942('0x3f')](_0x2f70c0,function(_0x36d541){if(_0x36d541[_0x4942('0x50')]!==_0x4942('0x51')){var _0x20ad60={};_0x20ad60[_0x36d541[_0x4942('0x3c')]]={'$like':'%'+_0x5178cb[_0x4942('0x44')][_0x4942('0x4e')]+'%'};return _0x20ad60;}})});}_0x29a56b=_['merge']({},_0x29a56b,_0x5178cb['options']);var _0x3bcb73={'where':_0x29a56b['where']};return db['VoiceContext'][_0x4942('0x2f')](_0x3bcb73)['then'](function(_0x59a083){_0x32277d[_0x4942('0x2f')]=_0x59a083;if(_0x5178cb[_0x4942('0x44')][_0x4942('0x52')]){_0x29a56b[_0x4942('0x53')]=[{'all':!![]}];}return db[_0x4942('0x40')][_0x4942('0x54')](_0x29a56b);})[_0x4942('0x1f')](function(_0x2d94e6){_0x32277d[_0x4942('0x55')]=_0x2d94e6;return _0x32277d;})[_0x4942('0x1f')](respondWithFilteredResult(_0x477106,_0x29a56b))[_0x4942('0x28')](handleError(_0x477106,null));};exports[_0x4942('0x56')]=function(_0x5b3125,_0x4c70fa){var _0x2af427={'raw':![],'where':{'id':_0x5b3125[_0x4942('0x57')]['id']}},_0x1f5af1={};_0x1f5af1[_0x4942('0x43')]=_[_0x4942('0x58')](db[_0x4942('0x40')]['rawAttributes']);_0x1f5af1[_0x4942('0x44')]=_[_0x4942('0x58')](_0x5b3125[_0x4942('0x44')]);_0x1f5af1[_0x4942('0x4d')]=_[_0x4942('0x45')](_0x1f5af1[_0x4942('0x43')],_0x1f5af1[_0x4942('0x44')]);_0x2af427[_0x4942('0x46')]=_[_0x4942('0x45')](_0x1f5af1['model'],qs[_0x4942('0x47')](_0x5b3125[_0x4942('0x44')][_0x4942('0x47')]));_0x2af427[_0x4942('0x46')]=_0x2af427[_0x4942('0x46')][_0x4942('0x48')]?_0x2af427['attributes']:_0x1f5af1[_0x4942('0x43')];if(_0x5b3125['query']['includeAll']){_0x2af427[_0x4942('0x53')]=[{'all':!![]}];}_0x2af427=_[_0x4942('0x4f')]({},_0x2af427,_0x5b3125[_0x4942('0x59')]);return db[_0x4942('0x40')][_0x4942('0x5a')](_0x2af427)[_0x4942('0x1f')](handleEntityNotFound(_0x4c70fa,null))['then'](respondWithResult(_0x4c70fa,null))[_0x4942('0x28')](handleError(_0x4c70fa,null));};exports[_0x4942('0x5b')]=function(_0x350e4a,_0x21993a,_0x519b58){var _0x229b7d;return db[_0x4942('0x40')][_0x4942('0x5b')](_0x350e4a[_0x4942('0x5c')],{'raw':!![]})[_0x4942('0x1f')](function(_0x1bc825){_0x229b7d=_0x1bc825;return db[_0x4942('0x40')][_0x4942('0x54')]({'raw':!![]});})[_0x4942('0x1f')](function(_0x2ca7b7){var _0x970a7a=fs['readFileSync'](path[_0x4942('0x5d')](config[_0x4942('0x5e')],_0x4942('0x5f')),_0x4942('0x60'));var _0xfa6b48=ejs['render'](_0x970a7a,{'contexts':_0x2ca7b7||[]});fs[_0x4942('0x61')](_0x4942('0x62'),_0xfa6b48);})[_0x4942('0x1f')](function(){return respondWithRpcPromise(_0x4942('0x63'),_0x4942('0x5b'),{'module':_0x4942('0x64')});})[_0x4942('0x1f')](function(){var _0x810c82=_0x350e4a[_0x4942('0x65')]['get']({'plain':!![]});if(!_0x810c82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x810c82[_0x4942('0x66')]==='user'){var _0x384f92=_0x229b7d[_0x4942('0x37')]({'plain':!![]});return db[_0x4942('0x67')][_0x4942('0x5a')]({'where':{'name':_0x4942('0x38'),'userProfileId':_0x810c82[_0x4942('0x68')]},'raw':!![]})[_0x4942('0x1f')](function(_0x407b7a){if(_0x407b7a&&_0x407b7a[_0x4942('0x69')]===0x0){return db[_0x4942('0x39')][_0x4942('0x5b')]({'name':_0x384f92[_0x4942('0x3c')],'resourceId':_0x384f92['id'],'type':_0x407b7a[_0x4942('0x3c')],'sectionId':_0x407b7a['id']},{})[_0x4942('0x1f')](function(){return _0x229b7d;});}else{return _0x229b7d;}})[_0x4942('0x28')](function(_0x394ce8){logger[_0x4942('0x24')](_0x4942('0x6a'),_0x394ce8);throw _0x394ce8;});}return _0x229b7d;})[_0x4942('0x1f')](respondWithResult(_0x21993a,0xc9))['catch'](handleError(_0x21993a,null));};exports[_0x4942('0x36')]=function(_0xd8d2e3,_0x394a9e,_0x462f32){var _0x295fe6;return db['VoiceContext'][_0x4942('0x5a')]({'where':{'id':_0xd8d2e3['params']['id']}})['then'](handleEntityNotFound(_0x394a9e,null))[_0x4942('0x1f')](saveUpdates(_0xd8d2e3['body'],null))[_0x4942('0x1f')](function(_0x3f82c1){if(_0x3f82c1){_0x295fe6=_0x3f82c1;return db['VoiceContext'][_0x4942('0x54')]({'raw':!![]});}})['then'](function(_0x4f7b67){var _0x1db09b=fs[_0x4942('0x6b')](path[_0x4942('0x5d')](config['root'],'server/files/templates/context.ejs'),_0x4942('0x60'));var _0x315a2f=ejs[_0x4942('0x6c')](_0x1db09b,{'contexts':_0x4f7b67||[]});fs[_0x4942('0x61')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x315a2f);})[_0x4942('0x1f')](function(){return respondWithRpcPromise(_0x4942('0x63'),_0x4942('0x36'),{'module':'chan_sip.so'});})['then'](function(){return _0x295fe6;})['then'](respondWithResult(_0x394a9e,null))[_0x4942('0x28')](handleError(_0x394a9e,null));};exports[_0x4942('0x3a')]=function(_0x4a1b9f,_0x27a795,_0x116692){var _0x41a227;return db[_0x4942('0x40')][_0x4942('0x5a')]({'where':{'id':_0x4a1b9f[_0x4942('0x57')]['id']}})[_0x4942('0x1f')](handleEntityNotFound(_0x27a795,null))['then'](removeEntity(_0x27a795,null))[_0x4942('0x1f')](function(){return db[_0x4942('0x40')][_0x4942('0x54')]({'raw':!![]});})[_0x4942('0x1f')](function(_0x49b127){var _0x301fea=fs['readFileSync'](path['join'](config['root'],'server/files/templates/context.ejs'),_0x4942('0x60'));var _0x4638b5=ejs[_0x4942('0x6c')](_0x301fea,{'contexts':_0x49b127});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x4638b5);return respondWithRpcPromise(_0x4942('0x63'),_0x4942('0x3a'),{'module':_0x4942('0x64')});})['catch'](handleError(_0x27a795,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c520ea8..545d051 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 _0x2ba7=['bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2ba7,0xe9));var _0x72ba=function(_0x36ad89,_0x524fde){_0x36ad89=_0x36ad89-0x0;var _0x2af7d4=_0x2ba7[_0x36ad89];return _0x2af7d4;};'use strict';var _=require(_0x72ba('0x0'));var util=require(_0x72ba('0x1'));var logger=require(_0x72ba('0x2'))(_0x72ba('0x3'));var moment=require(_0x72ba('0x4'));var BPromise=require(_0x72ba('0x5'));var rp=require(_0x72ba('0x6'));var fs=require('fs');var path=require(_0x72ba('0x7'));var rimraf=require(_0x72ba('0x8'));var config=require('../../config/environment');var attributes=require(_0x72ba('0x9'));module[_0x72ba('0xa')]=function(_0x234a34,_0x47e97d){return _0x234a34[_0x72ba('0xb')](_0x72ba('0xc'),attributes,{'tableName':_0x72ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a2e=['define','VoiceContext','voice_contexts','util','../../config/logger','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x4337d8,_0xe39ff2){var _0x5780a2=function(_0x318e03){while(--_0x318e03){_0x4337d8['push'](_0x4337d8['shift']());}};_0x5780a2(++_0xe39ff2);}(_0x0a2e,0xc1));var _0xe0a2=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x0a2e[_0x4ed1d4];return _0x28e363;};'use strict';var _=require('lodash');var util=require(_0xe0a2('0x0'));var logger=require(_0xe0a2('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe0a2('0x2'));var rimraf=require(_0xe0a2('0x3'));var config=require(_0xe0a2('0x4'));var attributes=require(_0xe0a2('0x5'));module[_0xe0a2('0x6')]=function(_0x2cd758,_0x24d1c9){return _0x2cd758[_0xe0a2('0x7')](_0xe0a2('0x8'),attributes,{'tableName':_0xe0a2('0x9'),'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 2776bd2..b440108 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 _0x23a3=['stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x27e7f6,_0xb9d675){var _0x50eff6=function(_0x354fa6){while(--_0x354fa6){_0x27e7f6['push'](_0x27e7f6['shift']());}};_0x50eff6(++_0xb9d675);}(_0x23a3,0x131));var _0x323a=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x23a3[_0x1b5aea];return _0x51cae9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x323a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x323a('0x1'));var db=require(_0x323a('0x2'))['db'];var utils=require(_0x323a('0x3'));var logger=require(_0x323a('0x4'))(_0x323a('0x5'));var config=require(_0x323a('0x6'));var jayson=require(_0x323a('0x7'));var client=jayson[_0x323a('0x8')][_0x323a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad5a,_0x3452d3,_0x3544bd){return new BPromise(function(_0x568996,_0x385a54){return client[_0x323a('0xa')](_0x50ad5a,_0x3544bd)[_0x323a('0xb')](function(_0x4a74bd){logger[_0x323a('0xc')](_0x323a('0xd'),_0x3452d3,_0x323a('0xe'));logger[_0x323a('0xf')](_0x323a('0x10'),_0x3452d3,_0x323a('0xe'),JSON[_0x323a('0x11')](_0x4a74bd));if(_0x4a74bd[_0x323a('0x12')]){if(_0x4a74bd[_0x323a('0x12')][_0x323a('0x13')]===0x1f4){logger[_0x323a('0x12')](_0x323a('0xd'),_0x3452d3,_0x4a74bd[_0x323a('0x12')][_0x323a('0x14')]);return _0x385a54(_0x4a74bd['error'][_0x323a('0x14')]);}logger['error'](_0x323a('0xd'),_0x3452d3,_0x4a74bd['error']['message']);return _0x568996(_0x4a74bd[_0x323a('0x12')]['message']);}else{logger[_0x323a('0xc')]('VoiceContext,\x20%s,\x20%s',_0x3452d3,_0x323a('0xe'));_0x568996(_0x4a74bd[_0x323a('0x15')]['message']);}})[_0x323a('0x16')](function(_0x32674f){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3452d3,_0x32674f);_0x385a54(_0x32674f);});});} \ No newline at end of file +var _0xb875=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x47d10a,_0x2e7ff0){var _0x1561fb=function(_0x3bf450){while(--_0x3bf450){_0x47d10a['push'](_0x47d10a['shift']());}};_0x1561fb(++_0x2e7ff0);}(_0xb875,0x167));var _0x5b87=function(_0x58528c,_0x132caf){_0x58528c=_0x58528c-0x0;var _0x350d0e=_0xb875[_0x58528c];return _0x350d0e;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b87('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b87('0x2'))['db'];var utils=require(_0x5b87('0x3'));var logger=require('../../config/logger')(_0x5b87('0x4'));var config=require(_0x5b87('0x5'));var jayson=require(_0x5b87('0x6'));var client=jayson[_0x5b87('0x7')][_0x5b87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b27af,_0x1fc1a8,_0x46b1bf){return new BPromise(function(_0x1fb944,_0xb2888){return client['request'](_0x5b27af,_0x46b1bf)[_0x5b87('0x9')](function(_0x537f81){logger[_0x5b87('0xa')](_0x5b87('0xb'),_0x1fc1a8,_0x5b87('0xc'));logger[_0x5b87('0xd')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1fc1a8,'request\x20sent',JSON[_0x5b87('0xe')](_0x537f81));if(_0x537f81[_0x5b87('0xf')]){if(_0x537f81['error'][_0x5b87('0x10')]===0x1f4){logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x537f81[_0x5b87('0xf')][_0x5b87('0x11')]);return _0xb2888(_0x537f81[_0x5b87('0xf')][_0x5b87('0x11')]);}logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x537f81['error'][_0x5b87('0x11')]);return _0x1fb944(_0x537f81['error'][_0x5b87('0x11')]);}else{logger[_0x5b87('0xa')]('VoiceContext,\x20%s,\x20%s',_0x1fc1a8,'request\x20sent');_0x1fb944(_0x537f81[_0x5b87('0x12')]['message']);}})[_0x5b87('0x13')](function(_0x175452){logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x175452);_0xb2888(_0x175452);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b2835de..7d767a5 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 _0xe032=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x37a3e8,_0x3bbccb){var _0x3fa03c=function(_0x38e819){while(--_0x38e819){_0x37a3e8['push'](_0x37a3e8['shift']());}};_0x3fa03c(++_0x3bbccb);}(_0xe032,0x175));var _0x2e03=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0xe032[_0x37a9d7];return _0x1343d3;};'use strict';var multer=require(_0x2e03('0x0'));var util=require(_0x2e03('0x1'));var path=require(_0x2e03('0x2'));var timeout=require(_0x2e03('0x3'));var express=require(_0x2e03('0x4'));var router=express[_0x2e03('0x5')]();var fs_extra=require(_0x2e03('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2e03('0x7'));var config=require('../../config/environment');var controller=require(_0x2e03('0x8'));router['get']('/',auth[_0x2e03('0x9')](),controller[_0x2e03('0xa')]);router[_0x2e03('0xb')](_0x2e03('0xc'),auth[_0x2e03('0x9')](),controller[_0x2e03('0xd')]);router[_0x2e03('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2e03('0xe')]);router[_0x2e03('0xf')]('/',auth[_0x2e03('0x9')](),controller[_0x2e03('0x10')]);router[_0x2e03('0x11')](_0x2e03('0x12'),auth[_0x2e03('0x9')](),controller[_0x2e03('0x13')]);router['delete']('/:id',auth[_0x2e03('0x9')](),controller[_0x2e03('0x14')]);module[_0x2e03('0x15')]=router; \ No newline at end of file +var _0x4fef=['get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller'];(function(_0x40c838,_0x5abfc0){var _0x2f8eb1=function(_0x360ca1){while(--_0x360ca1){_0x40c838['push'](_0x40c838['shift']());}};_0x2f8eb1(++_0x5abfc0);}(_0x4fef,0x10f));var _0xf4fe=function(_0x276f09,_0x4093a){_0x276f09=_0x276f09-0x0;var _0x9f40c8=_0x4fef[_0x276f09];return _0x9f40c8;};'use strict';var multer=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var path=require('path');var timeout=require(_0xf4fe('0x2'));var express=require('express');var router=express[_0xf4fe('0x3')]();var fs_extra=require(_0xf4fe('0x4'));var auth=require(_0xf4fe('0x5'));var interaction=require(_0xf4fe('0x6'));var config=require(_0xf4fe('0x7'));var controller=require(_0xf4fe('0x8'));router[_0xf4fe('0x9')]('/',auth[_0xf4fe('0xa')](),controller['index']);router[_0xf4fe('0x9')](_0xf4fe('0xb'),auth['isAuthenticated'](),controller[_0xf4fe('0xc')]);router[_0xf4fe('0x9')](_0xf4fe('0xd'),auth[_0xf4fe('0xa')](),controller[_0xf4fe('0xe')]);router[_0xf4fe('0xf')]('/',auth[_0xf4fe('0xa')](),controller[_0xf4fe('0x10')]);router['put'](_0xf4fe('0xd'),auth['isAuthenticated'](),controller[_0xf4fe('0x11')]);router[_0xf4fe('0x12')](_0xf4fe('0xd'),auth[_0xf4fe('0xa')](),controller[_0xf4fe('0x13')]);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 86ad4b8..5cab0db 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x48b528,_0x367191){var _0x3bff6a=function(_0xcc3b2e){while(--_0xcc3b2e){_0x48b528['push'](_0x48b528['shift']());}};_0x3bff6a(++_0x367191);}(_0x9a19,0x114));var _0x99a1=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9a19[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file +var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x318081,_0x27e14c){var _0xa5d268=function(_0x54d4c9){while(--_0x54d4c9){_0x318081['push'](_0x318081['shift']());}};_0xa5d268(++_0x27e14c);}(_0x008c,0x188));var _0xc008=function(_0x53d0f2,_0x461fff){_0x53d0f2=_0x53d0f2-0x0;var _0x4039fe=_0x008c[_0x53d0f2];return _0x4039fe;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 835517f..2ade9c0 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 _0xff97=['offset','undefined','limit','count','set','apply','reject','then','destroy','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','filters','pick','filter','where','merge','options','rows','catch','params','length','includeAll','find','create','body','update','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0xff97,0x73));var _0x7ff9=function(_0xd2e160,_0x3f3f48){_0xd2e160=_0xd2e160-0x0;var _0x557fb6=_0xff97[_0xd2e160];return _0x557fb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ff9('0x0'));var zipdir=require(_0x7ff9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ff9('0x2'));var moment=require('moment');var BPromise=require(_0x7ff9('0x3'));var Mustache=require(_0x7ff9('0x4'));var util=require(_0x7ff9('0x5'));var path=require(_0x7ff9('0x6'));var sox=require('sox');var csv=require(_0x7ff9('0x7'));var ejs=require(_0x7ff9('0x8'));var fs=require('fs');var fs_extra=require(_0x7ff9('0x9'));var _=require(_0x7ff9('0xa'));var squel=require(_0x7ff9('0xb'));var crypto=require(_0x7ff9('0xc'));var jsforce=require(_0x7ff9('0xd'));var deskjs=require(_0x7ff9('0xe'));var toCsv=require(_0x7ff9('0x7'));var querystring=require(_0x7ff9('0xf'));var Papa=require(_0x7ff9('0x10'));var Redis=require('ioredis');var authService=require(_0x7ff9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ff9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7ff9('0x13'));var config=require(_0x7ff9('0x14'));var licenseUtil=require(_0x7ff9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485d81,_0x3eba60){_0x3eba60=_0x3eba60||0xcc;return function(_0x567887){if(_0x567887){return _0x485d81[_0x7ff9('0x16')](_0x3eba60);}return _0x485d81[_0x7ff9('0x17')](_0x3eba60)['end']();};}function respondWithResult(_0x16b067,_0x1f5ff2){_0x1f5ff2=_0x1f5ff2||0xc8;return function(_0x3433e1){if(_0x3433e1){return _0x16b067[_0x7ff9('0x17')](_0x1f5ff2)[_0x7ff9('0x18')](_0x3433e1);}};}function respondWithFilteredResult(_0x1888f8,_0x409fbb){return function(_0xdd2583){if(_0xdd2583){var _0x4b9fc0=typeof _0x409fbb[_0x7ff9('0x19')]===_0x7ff9('0x1a')&&typeof _0x409fbb[_0x7ff9('0x1b')]===_0x7ff9('0x1a');var _0x433e21=_0xdd2583[_0x7ff9('0x1c')];var _0x327952=_0x4b9fc0?0x0:_0x409fbb['offset'];var _0x5cc922=_0x4b9fc0?_0xdd2583[_0x7ff9('0x1c')]:_0x409fbb['offset']+_0x409fbb[_0x7ff9('0x1b')];var _0x5604f0;if(_0x5cc922>=_0x433e21){_0x5cc922=_0x433e21;_0x5604f0=0xc8;}else{_0x5604f0=0xce;}_0x1888f8[_0x7ff9('0x17')](_0x5604f0);return _0x1888f8[_0x7ff9('0x1d')]('Content-Range',_0x327952+'-'+_0x5cc922+'/'+_0x433e21)[_0x7ff9('0x18')](_0xdd2583);}return null;};}function patchUpdates(_0x5e9998){return function(_0x17f4df){try{jsonpatch[_0x7ff9('0x1e')](_0x17f4df,_0x5e9998,!![]);}catch(_0x39509e){return BPromise[_0x7ff9('0x1f')](_0x39509e);}return _0x17f4df['save']();};}function saveUpdates(_0x7e795b,_0x45d81b){return function(_0x4a6805){if(_0x4a6805){return _0x4a6805['update'](_0x7e795b)[_0x7ff9('0x20')](function(_0x19850d){return _0x19850d;});}return null;};}function removeEntity(_0x251809,_0x389931){return function(_0x37f78e){if(_0x37f78e){return _0x37f78e[_0x7ff9('0x21')]()['then'](function(){_0x251809['status'](0xcc)[_0x7ff9('0x22')]();});}};}function handleEntityNotFound(_0x44593c,_0x1e8531){return function(_0x57eb1f){if(!_0x57eb1f){_0x44593c[_0x7ff9('0x16')](0x194);}return _0x57eb1f;};}function handleError(_0x5a117d,_0x563db2){_0x563db2=_0x563db2||0x1f4;return function(_0x47fc09){logger[_0x7ff9('0x23')](_0x47fc09[_0x7ff9('0x24')]);if(_0x47fc09['name']){delete _0x47fc09[_0x7ff9('0x25')];}_0x5a117d[_0x7ff9('0x17')](_0x563db2)[_0x7ff9('0x26')](_0x47fc09);};}exports[_0x7ff9('0x27')]=function(_0x337652,_0x3e8efb){var _0x18a2b9={},_0xcdcf1={},_0x3711c4={'count':0x0,'rows':[]};var _0x25fd2d=_[_0x7ff9('0x28')](db[_0x7ff9('0x29')][_0x7ff9('0x2a')],function(_0x1242bf){return{'name':_0x1242bf[_0x7ff9('0x2b')],'type':_0x1242bf[_0x7ff9('0x2c')][_0x7ff9('0x2d')]};});_0xcdcf1[_0x7ff9('0x2e')]=_[_0x7ff9('0x28')](_0x25fd2d,'name');_0xcdcf1[_0x7ff9('0x2f')]=_[_0x7ff9('0x30')](_0x337652[_0x7ff9('0x2f')]);_0xcdcf1['filters']=_['intersection'](_0xcdcf1['model'],_0xcdcf1['query']);_0x18a2b9[_0x7ff9('0x31')]=_[_0x7ff9('0x32')](_0xcdcf1[_0x7ff9('0x2e')],qs[_0x7ff9('0x33')](_0x337652['query'][_0x7ff9('0x33')]));_0x18a2b9[_0x7ff9('0x31')]=_0x18a2b9[_0x7ff9('0x31')]['length']?_0x18a2b9[_0x7ff9('0x31')]:_0xcdcf1['model'];if(!_0x337652[_0x7ff9('0x2f')][_0x7ff9('0x34')]('nolimit')){_0x18a2b9[_0x7ff9('0x1b')]=qs[_0x7ff9('0x1b')](_0x337652[_0x7ff9('0x2f')][_0x7ff9('0x1b')]);_0x18a2b9[_0x7ff9('0x19')]=qs[_0x7ff9('0x19')](_0x337652['query'][_0x7ff9('0x19')]);}_0x18a2b9['order']=qs[_0x7ff9('0x35')](_0x337652['query']['sort']);_0x18a2b9['where']=qs[_0x7ff9('0x36')](_[_0x7ff9('0x37')](_0x337652[_0x7ff9('0x2f')],_0xcdcf1[_0x7ff9('0x36')]),_0x25fd2d);if(_0x337652['query'][_0x7ff9('0x38')]){_0x18a2b9[_0x7ff9('0x39')]=_[_0x7ff9('0x3a')](_0x18a2b9['where'],{'$or':_[_0x7ff9('0x28')](_0x25fd2d,function(_0x456395){if(_0x456395['type']!=='VIRTUAL'){var _0x4f651f={};_0x4f651f[_0x456395[_0x7ff9('0x25')]]={'$like':'%'+_0x337652[_0x7ff9('0x2f')][_0x7ff9('0x38')]+'%'};return _0x4f651f;}})});}_0x18a2b9=_[_0x7ff9('0x3a')]({},_0x18a2b9,_0x337652[_0x7ff9('0x3b')]);var _0x3c2b8e={'where':_0x18a2b9[_0x7ff9('0x39')]};return db[_0x7ff9('0x29')]['count'](_0x3c2b8e)[_0x7ff9('0x20')](function(_0x2a16d0){_0x3711c4[_0x7ff9('0x1c')]=_0x2a16d0;if(_0x337652[_0x7ff9('0x2f')]['includeAll']){_0x18a2b9['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x18a2b9);})[_0x7ff9('0x20')](function(_0x27ee36){_0x3711c4[_0x7ff9('0x3c')]=_0x27ee36;return _0x3711c4;})[_0x7ff9('0x20')](respondWithFilteredResult(_0x3e8efb,_0x18a2b9))[_0x7ff9('0x3d')](handleError(_0x3e8efb,null));};exports['show']=function(_0x11219d,_0x31c5be){var _0x3d76ae={'raw':!![],'where':{'id':_0x11219d[_0x7ff9('0x3e')]['id']}},_0xb7218={};_0xb7218[_0x7ff9('0x2e')]=_[_0x7ff9('0x30')](db['VoiceDialReport'][_0x7ff9('0x2a')]);_0xb7218[_0x7ff9('0x2f')]=_['keys'](_0x11219d[_0x7ff9('0x2f')]);_0xb7218[_0x7ff9('0x36')]=_[_0x7ff9('0x32')](_0xb7218[_0x7ff9('0x2e')],_0xb7218[_0x7ff9('0x2f')]);_0x3d76ae[_0x7ff9('0x31')]=_['intersection'](_0xb7218[_0x7ff9('0x2e')],qs[_0x7ff9('0x33')](_0x11219d[_0x7ff9('0x2f')]['fields']));_0x3d76ae[_0x7ff9('0x31')]=_0x3d76ae[_0x7ff9('0x31')][_0x7ff9('0x3f')]?_0x3d76ae[_0x7ff9('0x31')]:_0xb7218[_0x7ff9('0x2e')];if(_0x11219d[_0x7ff9('0x2f')][_0x7ff9('0x40')]){_0x3d76ae['include']=[{'all':!![]}];}_0x3d76ae=_['merge']({},_0x3d76ae,_0x11219d[_0x7ff9('0x3b')]);return db[_0x7ff9('0x29')][_0x7ff9('0x41')](_0x3d76ae)[_0x7ff9('0x20')](handleEntityNotFound(_0x31c5be,null))[_0x7ff9('0x20')](respondWithResult(_0x31c5be,null))[_0x7ff9('0x3d')](handleError(_0x31c5be,null));};exports[_0x7ff9('0x42')]=function(_0x36c04f,_0x4c801e){return db['VoiceDialReport'][_0x7ff9('0x42')](_0x36c04f[_0x7ff9('0x43')],{})['then'](respondWithResult(_0x4c801e,0xc9))['catch'](handleError(_0x4c801e,null));};exports[_0x7ff9('0x44')]=function(_0x42d442,_0x215c4c){if(_0x42d442[_0x7ff9('0x43')]['id']){delete _0x42d442[_0x7ff9('0x43')]['id'];}return db['VoiceDialReport'][_0x7ff9('0x41')]({'where':{'id':_0x42d442[_0x7ff9('0x3e')]['id']}})[_0x7ff9('0x20')](handleEntityNotFound(_0x215c4c,null))[_0x7ff9('0x20')](saveUpdates(_0x42d442[_0x7ff9('0x43')],null))[_0x7ff9('0x20')](respondWithResult(_0x215c4c,null))[_0x7ff9('0x3d')](handleError(_0x215c4c,null));};exports[_0x7ff9('0x21')]=function(_0x4be436,_0x348f22){return db['VoiceDialReport'][_0x7ff9('0x41')]({'where':{'id':_0x4be436[_0x7ff9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x348f22,null))['then'](removeEntity(_0x348f22,null))[_0x7ff9('0x3d')](handleError(_0x348f22,null));};exports[_0x7ff9('0x45')]=function(_0x519b33,_0x361447){return db[_0x7ff9('0x29')][_0x7ff9('0x45')]()['then'](respondWithResult(_0x361447,null))['catch'](handleError(_0x361447,null));}; \ No newline at end of file +var _0x0980=['map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','filters','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model'];(function(_0xf3059b,_0x41cb48){var _0x4da30a=function(_0x4127e6){while(--_0x4127e6){_0xf3059b['push'](_0xf3059b['shift']());}};_0x4da30a(++_0x41cb48);}(_0x0980,0x1a2));var _0x0098=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x0980[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x0098('0x0'));var rimraf=require(_0x0098('0x1'));var zipdir=require(_0x0098('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0098('0x3'));var moment=require(_0x0098('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0098('0x5'));var util=require(_0x0098('0x6'));var path=require(_0x0098('0x7'));var sox=require(_0x0098('0x8'));var csv=require(_0x0098('0x9'));var ejs=require(_0x0098('0xa'));var fs=require('fs');var fs_extra=require(_0x0098('0xb'));var _=require(_0x0098('0xc'));var squel=require(_0x0098('0xd'));var crypto=require(_0x0098('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0098('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0098('0x10'));var Redis=require(_0x0098('0x11'));var authService=require(_0x0098('0x12'));var qs=require(_0x0098('0x13'));var as=require(_0x0098('0x14'));var hardwareService=require(_0x0098('0x15'));var logger=require(_0x0098('0x16'))(_0x0098('0x17'));var utils=require('../../config/utils');var config=require(_0x0098('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0098('0x19'))['db'];function respondWithStatusCode(_0x28de56,_0x481ad2){_0x481ad2=_0x481ad2||0xcc;return function(_0xc09ac0){if(_0xc09ac0){return _0x28de56[_0x0098('0x1a')](_0x481ad2);}return _0x28de56[_0x0098('0x1b')](_0x481ad2)[_0x0098('0x1c')]();};}function respondWithResult(_0x20f0df,_0x28d519){_0x28d519=_0x28d519||0xc8;return function(_0x1f8091){if(_0x1f8091){return _0x20f0df[_0x0098('0x1b')](_0x28d519)[_0x0098('0x1d')](_0x1f8091);}};}function respondWithFilteredResult(_0x4b9be8,_0x6837d){return function(_0x1f2b82){if(_0x1f2b82){var _0x55c1b5=typeof _0x6837d['offset']===_0x0098('0x1e')&&typeof _0x6837d[_0x0098('0x1f')]===_0x0098('0x1e');var _0x1e3425=_0x1f2b82[_0x0098('0x20')];var _0xa2e3b9=_0x55c1b5?0x0:_0x6837d[_0x0098('0x21')];var _0x1e67bb=_0x55c1b5?_0x1f2b82[_0x0098('0x20')]:_0x6837d[_0x0098('0x21')]+_0x6837d[_0x0098('0x1f')];var _0x22e0ce;if(_0x1e67bb>=_0x1e3425){_0x1e67bb=_0x1e3425;_0x22e0ce=0xc8;}else{_0x22e0ce=0xce;}_0x4b9be8[_0x0098('0x1b')](_0x22e0ce);return _0x4b9be8[_0x0098('0x22')](_0x0098('0x23'),_0xa2e3b9+'-'+_0x1e67bb+'/'+_0x1e3425)[_0x0098('0x1d')](_0x1f2b82);}return null;};}function patchUpdates(_0xf38080){return function(_0x1ff2dc){try{jsonpatch[_0x0098('0x24')](_0x1ff2dc,_0xf38080,!![]);}catch(_0x3e4f4d){return BPromise[_0x0098('0x25')](_0x3e4f4d);}return _0x1ff2dc[_0x0098('0x26')]();};}function saveUpdates(_0x596d90,_0x122e29){return function(_0x3cfc12){if(_0x3cfc12){return _0x3cfc12[_0x0098('0x27')](_0x596d90)[_0x0098('0x28')](function(_0x49b9ec){return _0x49b9ec;});}return null;};}function removeEntity(_0x592b2b,_0x12a8c5){return function(_0x3f8310){if(_0x3f8310){return _0x3f8310[_0x0098('0x29')]()['then'](function(){_0x592b2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2e9f,_0x2fc9ec){return function(_0x5685dc){if(!_0x5685dc){_0x5e2e9f[_0x0098('0x1a')](0x194);}return _0x5685dc;};}function handleError(_0x1c74b,_0x427a7e){_0x427a7e=_0x427a7e||0x1f4;return function(_0x43f6eb){logger[_0x0098('0x2a')](_0x43f6eb['stack']);if(_0x43f6eb[_0x0098('0x2b')]){delete _0x43f6eb[_0x0098('0x2b')];}_0x1c74b['status'](_0x427a7e)['send'](_0x43f6eb);};}exports[_0x0098('0x2c')]=function(_0x5d935f,_0x43af23){var _0x332a02={},_0x3908ce={},_0x4cc197={'count':0x0,'rows':[]};var _0x211e4b=_['map'](db['VoiceDialReport'][_0x0098('0x2d')],function(_0x321e44){return{'name':_0x321e44[_0x0098('0x2e')],'type':_0x321e44[_0x0098('0x2f')][_0x0098('0x30')]};});_0x3908ce[_0x0098('0x31')]=_[_0x0098('0x32')](_0x211e4b,_0x0098('0x2b'));_0x3908ce[_0x0098('0x33')]=_[_0x0098('0x34')](_0x5d935f[_0x0098('0x33')]);_0x3908ce['filters']=_[_0x0098('0x35')](_0x3908ce[_0x0098('0x31')],_0x3908ce['query']);_0x332a02[_0x0098('0x36')]=_[_0x0098('0x35')](_0x3908ce['model'],qs[_0x0098('0x37')](_0x5d935f[_0x0098('0x33')][_0x0098('0x37')]));_0x332a02[_0x0098('0x36')]=_0x332a02[_0x0098('0x36')]['length']?_0x332a02['attributes']:_0x3908ce['model'];if(!_0x5d935f[_0x0098('0x33')][_0x0098('0x38')](_0x0098('0x39'))){_0x332a02[_0x0098('0x1f')]=qs['limit'](_0x5d935f['query'][_0x0098('0x1f')]);_0x332a02[_0x0098('0x21')]=qs['offset'](_0x5d935f[_0x0098('0x33')][_0x0098('0x21')]);}_0x332a02['order']=qs[_0x0098('0x3a')](_0x5d935f[_0x0098('0x33')][_0x0098('0x3a')]);_0x332a02[_0x0098('0x3b')]=qs['filters'](_['pick'](_0x5d935f[_0x0098('0x33')],_0x3908ce['filters']),_0x211e4b);if(_0x5d935f[_0x0098('0x33')][_0x0098('0x3c')]){_0x332a02[_0x0098('0x3b')]=_[_0x0098('0x3d')](_0x332a02['where'],{'$or':_[_0x0098('0x32')](_0x211e4b,function(_0x419827){if(_0x419827[_0x0098('0x2f')]!==_0x0098('0x3e')){var _0x2372f5={};_0x2372f5[_0x419827[_0x0098('0x2b')]]={'$like':'%'+_0x5d935f[_0x0098('0x33')][_0x0098('0x3c')]+'%'};return _0x2372f5;}})});}_0x332a02=_[_0x0098('0x3d')]({},_0x332a02,_0x5d935f['options']);var _0x3cecde={'where':_0x332a02[_0x0098('0x3b')]};return db[_0x0098('0x3f')]['count'](_0x3cecde)[_0x0098('0x28')](function(_0x1a534f){_0x4cc197[_0x0098('0x20')]=_0x1a534f;if(_0x5d935f[_0x0098('0x33')][_0x0098('0x40')]){_0x332a02[_0x0098('0x41')]=[{'all':!![]}];}return db[_0x0098('0x3f')][_0x0098('0x42')](_0x332a02);})['then'](function(_0x28e201){_0x4cc197[_0x0098('0x43')]=_0x28e201;return _0x4cc197;})['then'](respondWithFilteredResult(_0x43af23,_0x332a02))[_0x0098('0x44')](handleError(_0x43af23,null));};exports[_0x0098('0x45')]=function(_0x1d5b86,_0x54f03f){var _0x20e11e={'raw':!![],'where':{'id':_0x1d5b86[_0x0098('0x46')]['id']}},_0x49cfa9={};_0x49cfa9['model']=_[_0x0098('0x34')](db[_0x0098('0x3f')][_0x0098('0x2d')]);_0x49cfa9[_0x0098('0x33')]=_[_0x0098('0x34')](_0x1d5b86['query']);_0x49cfa9[_0x0098('0x47')]=_['intersection'](_0x49cfa9['model'],_0x49cfa9[_0x0098('0x33')]);_0x20e11e['attributes']=_['intersection'](_0x49cfa9['model'],qs[_0x0098('0x37')](_0x1d5b86[_0x0098('0x33')]['fields']));_0x20e11e[_0x0098('0x36')]=_0x20e11e['attributes'][_0x0098('0x48')]?_0x20e11e['attributes']:_0x49cfa9['model'];if(_0x1d5b86[_0x0098('0x33')][_0x0098('0x40')]){_0x20e11e[_0x0098('0x41')]=[{'all':!![]}];}_0x20e11e=_['merge']({},_0x20e11e,_0x1d5b86[_0x0098('0x49')]);return db[_0x0098('0x3f')][_0x0098('0x4a')](_0x20e11e)[_0x0098('0x28')](handleEntityNotFound(_0x54f03f,null))[_0x0098('0x28')](respondWithResult(_0x54f03f,null))['catch'](handleError(_0x54f03f,null));};exports[_0x0098('0x4b')]=function(_0x4d2017,_0x1bff07){return db[_0x0098('0x3f')][_0x0098('0x4b')](_0x4d2017[_0x0098('0x4c')],{})[_0x0098('0x28')](respondWithResult(_0x1bff07,0xc9))['catch'](handleError(_0x1bff07,null));};exports[_0x0098('0x27')]=function(_0x3e4fdb,_0x2e6785){if(_0x3e4fdb[_0x0098('0x4c')]['id']){delete _0x3e4fdb[_0x0098('0x4c')]['id'];}return db[_0x0098('0x3f')][_0x0098('0x4a')]({'where':{'id':_0x3e4fdb['params']['id']}})[_0x0098('0x28')](handleEntityNotFound(_0x2e6785,null))[_0x0098('0x28')](saveUpdates(_0x3e4fdb[_0x0098('0x4c')],null))[_0x0098('0x28')](respondWithResult(_0x2e6785,null))[_0x0098('0x44')](handleError(_0x2e6785,null));};exports['destroy']=function(_0x1fbd01,_0x20a2c2){return db[_0x0098('0x3f')]['find']({'where':{'id':_0x1fbd01['params']['id']}})[_0x0098('0x28')](handleEntityNotFound(_0x20a2c2,null))[_0x0098('0x28')](removeEntity(_0x20a2c2,null))[_0x0098('0x44')](handleError(_0x20a2c2,null));};exports[_0x0098('0x4d')]=function(_0x4972c3,_0xb2afdf){return db[_0x0098('0x3f')][_0x0098('0x4d')]()[_0x0098('0x28')](respondWithResult(_0xb2afdf,null))['catch'](handleError(_0xb2afdf,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6857a28..4caeecc 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 _0xbd85=['util','../../config/logger','api','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','report_dial'];(function(_0xc1fcfb,_0x23ef7c){var _0x17acdb=function(_0x5ed6ed){while(--_0x5ed6ed){_0xc1fcfb['push'](_0xc1fcfb['shift']());}};_0x17acdb(++_0x23ef7c);}(_0xbd85,0x1f4));var _0x5bd8=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xbd85[_0x1b6311];return _0x25aab6;};'use strict';var _=require('lodash');var util=require(_0x5bd8('0x0'));var logger=require(_0x5bd8('0x1'))(_0x5bd8('0x2'));var moment=require('moment');var BPromise=require(_0x5bd8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bd8('0x4'));var rimraf=require(_0x5bd8('0x5'));var config=require('../../config/environment');var attributes=require(_0x5bd8('0x6'));module[_0x5bd8('0x7')]=function(_0x991c18,_0x7a809d){return _0x991c18[_0x5bd8('0x8')]('VoiceDialReport',attributes,{'tableName':_0x5bd8('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6c2=['exports','define','VoiceDialReport','report_dial','lodash','util','api','request-promise','path','rimraf','./voiceDialReport.attributes'];(function(_0x105639,_0x3e8689){var _0xf6c4c9=function(_0x27c54f){while(--_0x27c54f){_0x105639['push'](_0x105639['shift']());}};_0xf6c4c9(++_0x3e8689);}(_0xf6c2,0x1e8));var _0x2f6c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf6c2[_0x432682];return _0x463d05;};'use strict';var _=require(_0x2f6c('0x0'));var util=require(_0x2f6c('0x1'));var logger=require('../../config/logger')(_0x2f6c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f6c('0x3'));var fs=require('fs');var path=require(_0x2f6c('0x4'));var rimraf=require(_0x2f6c('0x5'));var config=require('../../config/environment');var attributes=require(_0x2f6c('0x6'));module[_0x2f6c('0x7')]=function(_0x2c5f21,_0x483bf1){return _0x2c5f21[_0x2f6c('0x8')](_0x2f6c('0x9'),attributes,{'tableName':_0x2f6c('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d927b7c..30d8c37 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 _0xb178=['raw','where','limit','UpdateVoiceDialReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','then','update'];(function(_0x1b34d1,_0x1d7bab){var _0x3a5449=function(_0x182023){while(--_0x182023){_0x1b34d1['push'](_0x1b34d1['shift']());}};_0x3a5449(++_0x1d7bab);}(_0xb178,0xd6));var _0x8b17=function(_0x35b76f,_0x324c48){_0x35b76f=_0x35b76f-0x0;var _0x582906=_0xb178[_0x35b76f];return _0x582906;};'use strict';var _=require(_0x8b17('0x0'));var util=require('util');var moment=require(_0x8b17('0x1'));var BPromise=require(_0x8b17('0x2'));var rs=require(_0x8b17('0x3'));var fs=require('fs');var Redis=require(_0x8b17('0x4'));var db=require(_0x8b17('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8b17('0x6'));var config=require('../../config/environment');var jayson=require(_0x8b17('0x7'));var client=jayson['client'][_0x8b17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x210327,_0x245e59,_0x21f69e){return new BPromise(function(_0x20381c,_0x1d5220){return client['request'](_0x210327,_0x21f69e)['then'](function(_0x35db7c){logger[_0x8b17('0x9')](_0x8b17('0xa'),_0x245e59,_0x8b17('0xb'));logger[_0x8b17('0xc')](_0x8b17('0xd'),_0x245e59,_0x8b17('0xb'),JSON[_0x8b17('0xe')](_0x35db7c));if(_0x35db7c[_0x8b17('0xf')]){if(_0x35db7c[_0x8b17('0xf')][_0x8b17('0x10')]===0x1f4){logger['error'](_0x8b17('0xa'),_0x245e59,_0x35db7c[_0x8b17('0xf')]['message']);return _0x1d5220(_0x35db7c['error'][_0x8b17('0x11')]);}logger[_0x8b17('0xf')](_0x8b17('0xa'),_0x245e59,_0x35db7c[_0x8b17('0xf')]['message']);return _0x20381c(_0x35db7c[_0x8b17('0xf')][_0x8b17('0x11')]);}else{logger[_0x8b17('0x9')](_0x8b17('0xa'),_0x245e59,_0x8b17('0xb'));_0x20381c(_0x35db7c[_0x8b17('0x12')][_0x8b17('0x11')]);}})[_0x8b17('0x13')](function(_0x35340c){logger['error'](_0x8b17('0xa'),_0x245e59,_0x35340c);_0x1d5220(_0x35340c);});});}exports[_0x8b17('0x14')]=function(_0x2f8377){var _0x100457=this;return new Promise(function(_0x2550b2,_0x28f5bf){return db[_0x8b17('0x15')]['create'](_0x2f8377[_0x8b17('0x16')],{'raw':_0x2f8377[_0x8b17('0x17')]?_0x2f8377['options']['raw']===undefined?!![]:![]:!![]})[_0x8b17('0x18')](function(_0x287a5e){logger[_0x8b17('0x9')](_0x8b17('0x14'),_0x2f8377);logger[_0x8b17('0xc')](_0x8b17('0x14'),_0x2f8377,JSON[_0x8b17('0xe')](_0x287a5e));_0x2550b2(_0x287a5e);})[_0x8b17('0x13')](function(_0x265b2b){logger[_0x8b17('0xf')](_0x8b17('0x14'),_0x265b2b['message'],_0x2f8377);_0x28f5bf(_0x100457['error'](0x1f4,_0x265b2b[_0x8b17('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x5955a5){var _0x88effe=this;return new Promise(function(_0xfc391d,_0x2d86d2){return db[_0x8b17('0x15')][_0x8b17('0x19')](_0x5955a5[_0x8b17('0x16')],{'raw':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')][_0x8b17('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')][_0x8b17('0x1b')]||null:null,'attributes':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')]['attributes']||null:null,'limit':_0x5955a5[_0x8b17('0x17')]?_0x5955a5[_0x8b17('0x17')][_0x8b17('0x1c')]||null:null})[_0x8b17('0x18')](function(_0x4b2275){logger[_0x8b17('0x9')](_0x8b17('0x1d'),_0x5955a5);logger[_0x8b17('0xc')](_0x8b17('0x1d'),_0x5955a5,JSON[_0x8b17('0xe')](_0x4b2275));_0xfc391d(_0x4b2275);})[_0x8b17('0x13')](function(_0x355fc3){logger['error']('UpdateVoiceDialReport',_0x355fc3[_0x8b17('0x11')],_0x5955a5);_0x2d86d2(_0x88effe['error'](0x1f4,_0x355fc3[_0x8b17('0x11')]));});});}; \ No newline at end of file +var _0x9771=['client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','UpdateVoiceDialReport','update','body','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise'];(function(_0x3d2e0e,_0x12dda3){var _0x1b8c72=function(_0x22f21f){while(--_0x22f21f){_0x3d2e0e['push'](_0x3d2e0e['shift']());}};_0x1b8c72(++_0x12dda3);}(_0x9771,0x11b));var _0x1977=function(_0xc74854,_0xa864dc){_0xc74854=_0xc74854-0x0;var _0xa497db=_0x9771[_0xc74854];return _0xa497db;};'use strict';var _=require(_0x1977('0x0'));var util=require('util');var moment=require(_0x1977('0x1'));var BPromise=require(_0x1977('0x2'));var rs=require(_0x1977('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1977('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1977('0x5'));var config=require('../../config/environment');var jayson=require(_0x1977('0x6'));var client=jayson[_0x1977('0x7')][_0x1977('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4aab6d,_0x29166f,_0x380ed0){return new BPromise(function(_0x1078c8,_0x5829b4){return client[_0x1977('0x9')](_0x4aab6d,_0x380ed0)[_0x1977('0xa')](function(_0x2347a1){logger[_0x1977('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x29166f,_0x1977('0xc'));logger[_0x1977('0xd')](_0x1977('0xe'),_0x29166f,'request\x20sent',JSON['stringify'](_0x2347a1));if(_0x2347a1['error']){if(_0x2347a1[_0x1977('0xf')][_0x1977('0x10')]===0x1f4){logger[_0x1977('0xf')](_0x1977('0x11'),_0x29166f,_0x2347a1[_0x1977('0xf')]['message']);return _0x5829b4(_0x2347a1[_0x1977('0xf')][_0x1977('0x12')]);}logger[_0x1977('0xf')](_0x1977('0x11'),_0x29166f,_0x2347a1[_0x1977('0xf')][_0x1977('0x12')]);return _0x1078c8(_0x2347a1[_0x1977('0xf')]['message']);}else{logger[_0x1977('0xb')](_0x1977('0x11'),_0x29166f,_0x1977('0xc'));_0x1078c8(_0x2347a1[_0x1977('0x13')][_0x1977('0x12')]);}})[_0x1977('0x14')](function(_0x100b26){logger[_0x1977('0xf')](_0x1977('0x11'),_0x29166f,_0x100b26);_0x5829b4(_0x100b26);});});}exports[_0x1977('0x15')]=function(_0x12b077){var _0x68c210=this;return new Promise(function(_0x1cfda4,_0x9ec119){return db[_0x1977('0x16')]['create'](_0x12b077['body'],{'raw':_0x12b077[_0x1977('0x17')]?_0x12b077['options'][_0x1977('0x18')]===undefined?!![]:![]:!![]})[_0x1977('0xa')](function(_0x977ebb){logger[_0x1977('0xb')](_0x1977('0x15'),_0x12b077);logger[_0x1977('0xd')]('CreateVoiceDialReport',_0x12b077,JSON['stringify'](_0x977ebb));_0x1cfda4(_0x977ebb);})['catch'](function(_0x5757f0){logger[_0x1977('0xf')]('CreateVoiceDialReport',_0x5757f0[_0x1977('0x12')],_0x12b077);_0x9ec119(_0x68c210[_0x1977('0xf')](0x1f4,_0x5757f0[_0x1977('0x12')]));});});};exports[_0x1977('0x19')]=function(_0x10a274){var _0x379b3b=this;return new Promise(function(_0x4e2cb2,_0x37e365){return db[_0x1977('0x16')][_0x1977('0x1a')](_0x10a274[_0x1977('0x1b')],{'raw':_0x10a274[_0x1977('0x17')]?_0x10a274[_0x1977('0x17')][_0x1977('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10a274[_0x1977('0x17')]?_0x10a274[_0x1977('0x17')]['where']||null:null,'attributes':_0x10a274[_0x1977('0x17')]?_0x10a274[_0x1977('0x17')]['attributes']||null:null,'limit':_0x10a274[_0x1977('0x17')]?_0x10a274[_0x1977('0x17')]['limit']||null:null})[_0x1977('0xa')](function(_0x293d0e){logger[_0x1977('0xb')](_0x1977('0x19'),_0x10a274);logger[_0x1977('0xd')](_0x1977('0x19'),_0x10a274,JSON[_0x1977('0x1c')](_0x293d0e));_0x4e2cb2(_0x293d0e);})[_0x1977('0x14')](function(_0xd589f5){logger[_0x1977('0xf')](_0x1977('0x19'),_0xd589f5[_0x1977('0x12')],_0x10a274);_0x37e365(_0x379b3b[_0x1977('0xf')](0x1f4,_0xd589f5[_0x1977('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a940898..41bf50e 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 _0x6885=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy','exports','path'];(function(_0x442037,_0x582475){var _0x38aecb=function(_0x9b75e4){while(--_0x9b75e4){_0x442037['push'](_0x442037['shift']());}};_0x38aecb(++_0x582475);}(_0x6885,0xdb));var _0x5688=function(_0x152560,_0x230d98){_0x152560=_0x152560-0x0;var _0x59126e=_0x6885[_0x152560];return _0x59126e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5688('0x0'));var timeout=require(_0x5688('0x1'));var express=require(_0x5688('0x2'));var router=express[_0x5688('0x3')]();var fs_extra=require(_0x5688('0x4'));var auth=require(_0x5688('0x5'));var interaction=require(_0x5688('0x6'));var config=require(_0x5688('0x7'));var controller=require(_0x5688('0x8'));router[_0x5688('0x9')]('/',auth[_0x5688('0xa')](),controller[_0x5688('0xb')]);router[_0x5688('0x9')](_0x5688('0xc'),auth[_0x5688('0xa')](),controller[_0x5688('0xd')]);router[_0x5688('0xe')]('/',auth[_0x5688('0xa')](),controller[_0x5688('0xf')]);router['post'](_0x5688('0x10'),auth[_0x5688('0xa')](),controller[_0x5688('0x11')]);router[_0x5688('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5688('0x13')]);router['delete']('/:id',auth[_0x5688('0xa')](),controller[_0x5688('0x14')]);module[_0x5688('0x15')]=router; \ No newline at end of file +var _0x7211=['show','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id'];(function(_0x1e6e39,_0x3c98ed){var _0x2d9029=function(_0x2de96b){while(--_0x2de96b){_0x1e6e39['push'](_0x1e6e39['shift']());}};_0x2d9029(++_0x3c98ed);}(_0x7211,0x1ad));var _0x1721=function(_0x528f64,_0x3efa21){_0x528f64=_0x528f64-0x0;var _0x4a16d1=_0x7211[_0x528f64];return _0x4a16d1;};'use strict';var multer=require(_0x1721('0x0'));var util=require(_0x1721('0x1'));var path=require(_0x1721('0x2'));var timeout=require(_0x1721('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1721('0x4'));var auth=require(_0x1721('0x5'));var interaction=require(_0x1721('0x6'));var config=require('../../config/environment');var controller=require(_0x1721('0x7'));router[_0x1721('0x8')]('/',auth[_0x1721('0x9')](),controller['index']);router[_0x1721('0x8')](_0x1721('0xa'),auth[_0x1721('0x9')](),controller[_0x1721('0xb')]);router['post']('/',auth[_0x1721('0x9')](),controller[_0x1721('0xc')]);router['post'](_0x1721('0xd'),auth[_0x1721('0x9')](),controller[_0x1721('0xe')]);router[_0x1721('0xf')]('/:id',auth[_0x1721('0x9')](),controller[_0x1721('0x10')]);router[_0x1721('0x11')]('/:id',auth[_0x1721('0x9')](),controller[_0x1721('0x12')]);module[_0x1721('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 5726dfd..982aa0b 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 _0x9167=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0x20c539,_0x3bbfc2){var _0x343ec1=function(_0x24d88f){while(--_0x24d88f){_0x20c539['push'](_0x20c539['shift']());}};_0x343ec1(++_0x3bbfc2);}(_0x9167,0xc4));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7916('0x0'));module[_0x7916('0x1')]={'context':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7916('0x3')},'priority':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'defaultValue':_0x7916('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7916('0x5')](_0x7916('0x6'),_0x7916('0x7'),_0x7916('0x8'),_0x7916('0x9'),_0x7916('0xa'),_0x7916('0xb'),_0x7916('0xc')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7916('0x2')],'allowNull':![],'defaultValue':_0x7916('0xd')},'IntervalId':{'type':Sequelize[_0x7916('0xe')]},'isApp':{'type':Sequelize[_0x7916('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7916('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7916('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x7916('0xf')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7916('0xe')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x7916('0xf')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7916('0x10')],'get':function(_0x5a037d){return this[_0x7916('0x11')](_0x7916('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x121f=['exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','BOOLEAN','INTEGER','VIRTUAL','getDataValue','sequelize'];(function(_0x3fcc29,_0x5116eb){var _0x31300a=function(_0x52663d){while(--_0x52663d){_0x3fcc29['push'](_0x3fcc29['shift']());}};_0x31300a(++_0x5116eb);}(_0x121f,0x18f));var _0xf121=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x121f[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0xf121('0x0'));module[_0xf121('0x1')]={'context':{'type':Sequelize[_0xf121('0x2')],'allowNull':![],'unique':_0xf121('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf121('0x2')],'allowNull':![],'unique':_0xf121('0x3')},'priority':{'type':Sequelize[_0xf121('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xf121('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf121('0x2')],'allowNull':![],'defaultValue':_0xf121('0x4')},'appdata':{'type':Sequelize[_0xf121('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf121('0x5')](_0xf121('0x6'),_0xf121('0x7'),_0xf121('0x8'),'inbound-fax',_0xf121('0x9'),_0xf121('0xa'),_0xf121('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xf121('0x2')]},'interval':{'type':Sequelize[_0xf121('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf121('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf121('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xf121('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf121('0xd')]},'recordingFormat':{'type':Sequelize[_0xf121('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xf121('0xe')],'get':function(_0x3446be){return this[_0xf121('0xf')]('exten');}},'alias':{'type':Sequelize[_0xf121('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 0ab2f19..6af72df 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 _0xa396=['defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','count','set','Content-Range','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','map','value','includes','find','type','name','sendStatus','error','stack','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','VIRTUAL','options','VoiceExtension','include','findAll','rows','catch','show','params','includeAll','merge','create','startsWith','body','exten','get','role','user','InternalRoutes','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','alias','addApplications','findOne','transaction','VoiceExtensionId','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','../../mysqldb','redis'];(function(_0x51897a,_0x4f77fb){var _0x236bc5=function(_0x593cc7){while(--_0x593cc7){_0x51897a['push'](_0x51897a['shift']());}};_0x236bc5(++_0x4f77fb);}(_0xa396,0xaa));var _0x6a39=function(_0x32c219,_0x3859e3){_0x32c219=_0x32c219-0x0;var _0x542d54=_0xa396[_0x32c219];return _0x542d54;};'use strict';var _=require(_0x6a39('0x0'));var Redis=require(_0x6a39('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x6a39('0x2'))(_0x6a39('0x3'));var config=require('../../config/environment');var db=require(_0x6a39('0x4'))['db'];config[_0x6a39('0x5')]=_[_0x6a39('0x6')](config[_0x6a39('0x5')],{'host':_0x6a39('0x7'),'port':0x18eb});var socket=require(_0x6a39('0x8'))(new Redis(config[_0x6a39('0x5')]));require(_0x6a39('0x9'))[_0x6a39('0xa')](socket);function respondWithStatusCode(_0x29249c,_0x4c9f8b){_0x4c9f8b=_0x4c9f8b||0xcc;return function(_0x4dad0c){if(_0x4dad0c){return _0x29249c['sendStatus'](_0x4c9f8b);}return _0x29249c[_0x6a39('0xb')](_0x4c9f8b)['end']();};}function respondWithResult(_0x38dfc3,_0x55ba02){_0x55ba02=_0x55ba02||0xc8;return function(_0x240ee1){if(_0x240ee1){return _0x38dfc3[_0x6a39('0xb')](_0x55ba02)[_0x6a39('0xc')](_0x240ee1);}};}function respondWithFilteredResult(_0x3573f4,_0x25a490){return function(_0x5b15a6){if(_0x5b15a6){var _0xa3d980=typeof _0x25a490[_0x6a39('0xd')]===_0x6a39('0xe')&&typeof _0x25a490['limit']===_0x6a39('0xe');var _0xc1a409=_0x5b15a6[_0x6a39('0xf')];var _0x5c24eb=_0xa3d980?0x0:_0x25a490[_0x6a39('0xd')];var _0xc7aabf=_0xa3d980?_0x5b15a6[_0x6a39('0xf')]:_0x25a490[_0x6a39('0xd')]+_0x25a490['limit'];var _0x5ca881;if(_0xc7aabf>=_0xc1a409){_0xc7aabf=_0xc1a409;_0x5ca881=0xc8;}else{_0x5ca881=0xce;}_0x3573f4[_0x6a39('0xb')](_0x5ca881);return _0x3573f4[_0x6a39('0x10')](_0x6a39('0x11'),_0x5c24eb+'-'+_0xc7aabf+'/'+_0xc1a409)[_0x6a39('0xc')](_0x5b15a6);}return null;};}function removeEntity(_0x7858e6){return function(_0x5679a3){if(_0x5679a3){return _0x5679a3[_0x6a39('0x12')]()[_0x6a39('0x13')](function(){var _0xfd9cfe=_0x5679a3['get']({'plain':!![]});var _0x2fd778=[{'name':_0x6a39('0x14'),'value':_0x6a39('0x15'),'ignore':![]},{'name':_0x6a39('0x16'),'value':_0x6a39('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0x6a39('0x18'),'ignore':![]}];var _0x2d9814=_(_0x2fd778)[_0x6a39('0x19')]('ignore')[_0x6a39('0x1a')](_0x6a39('0x1b'))[_0x6a39('0x1b')]();if(_[_0x6a39('0x1c')](_0x2d9814,_0xfd9cfe['type'])){return;}var _0x178ec5=_[_0x6a39('0x1d')](_0x2fd778,[_0x6a39('0x1b'),_0xfd9cfe[_0x6a39('0x1e')]])[_0x6a39('0x1f')];return db['UserProfileResource'][_0x6a39('0x12')]({'where':{'type':_0x178ec5,'resourceId':_0xfd9cfe['id']}})[_0x6a39('0x13')](function(){return _0x5679a3;});})[_0x6a39('0x13')](function(){_0x7858e6[_0x6a39('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf8e8c6){return function(_0x2bdd43){if(!_0x2bdd43){_0xf8e8c6[_0x6a39('0x20')](0x194);}return _0x2bdd43;};}function handleError(_0x547b71,_0x2ee905){_0x2ee905=_0x2ee905||0x1f4;return function(_0x54cdc5){logger[_0x6a39('0x21')](_0x54cdc5[_0x6a39('0x22')]);if(_0x54cdc5[_0x6a39('0x1f')]){delete _0x54cdc5[_0x6a39('0x1f')];}_0x547b71['status'](_0x2ee905)[_0x6a39('0x23')](_0x54cdc5);};}exports['index']=function(_0x4fa917,_0x1ed95e){var _0xb0970f={},_0x21c536={},_0x88f576={'count':0x0,'rows':[]};var _0x368c31=_['map'](db['VoiceExtension'][_0x6a39('0x24')],function(_0x42a04c){return{'name':_0x42a04c[_0x6a39('0x25')],'type':_0x42a04c[_0x6a39('0x1e')][_0x6a39('0x26')]};});_0x21c536[_0x6a39('0x27')]=_[_0x6a39('0x1a')](_0x368c31,_0x6a39('0x1f'));_0x21c536[_0x6a39('0x28')]=_[_0x6a39('0x29')](_0x4fa917[_0x6a39('0x28')]);_0x21c536[_0x6a39('0x2a')]=_[_0x6a39('0x2b')](_0x21c536['model'],_0x21c536[_0x6a39('0x28')]);_0xb0970f['attributes']=_['intersection'](_0x21c536[_0x6a39('0x27')],qs[_0x6a39('0x2c')](_0x4fa917['query'][_0x6a39('0x2c')]));_0xb0970f['attributes']=_0xb0970f[_0x6a39('0x2d')][_0x6a39('0x2e')]?_0xb0970f[_0x6a39('0x2d')]:_0x21c536['model'];if(!_0x4fa917[_0x6a39('0x28')][_0x6a39('0x2f')](_0x6a39('0x30'))){_0xb0970f[_0x6a39('0x31')]=qs[_0x6a39('0x31')](_0x4fa917[_0x6a39('0x28')][_0x6a39('0x31')]);_0xb0970f[_0x6a39('0xd')]=qs[_0x6a39('0xd')](_0x4fa917[_0x6a39('0x28')][_0x6a39('0xd')]);}_0xb0970f[_0x6a39('0x32')]=qs[_0x6a39('0x33')](_0x4fa917[_0x6a39('0x28')][_0x6a39('0x33')]);_0xb0970f['where']=qs[_0x6a39('0x2a')](_[_0x6a39('0x34')](_0x4fa917[_0x6a39('0x28')],_0x21c536[_0x6a39('0x2a')]),_0x368c31);if(_0x4fa917[_0x6a39('0x28')][_0x6a39('0x19')]){_0xb0970f['where']=_['merge'](_0xb0970f['where'],{'$or':_[_0x6a39('0x1a')](_0x368c31,function(_0x5e054f){if(_0x5e054f[_0x6a39('0x1e')]!==_0x6a39('0x35')){var _0x5a0e69={};_0x5a0e69[_0x5e054f[_0x6a39('0x1f')]]={'$like':'%'+_0x4fa917[_0x6a39('0x28')][_0x6a39('0x19')]+'%'};return _0x5a0e69;}})});}_0xb0970f=_['merge']({},_0xb0970f,_0x4fa917[_0x6a39('0x36')]);var _0x447675={'where':_0xb0970f['where']};return db[_0x6a39('0x37')]['count'](_0x447675)[_0x6a39('0x13')](function(_0x26dbf6){_0x88f576[_0x6a39('0xf')]=_0x26dbf6;if(_0x4fa917['query']['includeAll']){_0xb0970f[_0x6a39('0x38')]=[{'all':!![]}];}return db[_0x6a39('0x37')][_0x6a39('0x39')](_0xb0970f);})['then'](function(_0x31c51a){_0x88f576[_0x6a39('0x3a')]=_0x31c51a;return _0x88f576;})['then'](respondWithFilteredResult(_0x1ed95e,_0xb0970f))[_0x6a39('0x3b')](handleError(_0x1ed95e,null));};exports[_0x6a39('0x3c')]=function(_0x30bf23,_0x434ecb){var _0x405bb8={'raw':![],'where':{'id':_0x30bf23[_0x6a39('0x3d')]['id']}},_0x3c0514={};_0x3c0514[_0x6a39('0x27')]=_[_0x6a39('0x29')](db[_0x6a39('0x37')][_0x6a39('0x24')]);_0x3c0514['query']=_[_0x6a39('0x29')](_0x30bf23['query']);_0x3c0514[_0x6a39('0x2a')]=_[_0x6a39('0x2b')](_0x3c0514[_0x6a39('0x27')],_0x3c0514[_0x6a39('0x28')]);_0x405bb8['attributes']=_[_0x6a39('0x2b')](_0x3c0514[_0x6a39('0x27')],qs['fields'](_0x30bf23['query'][_0x6a39('0x2c')]));_0x405bb8[_0x6a39('0x2d')]=_0x405bb8[_0x6a39('0x2d')][_0x6a39('0x2e')]?_0x405bb8[_0x6a39('0x2d')]:_0x3c0514['model'];if(_0x30bf23['query'][_0x6a39('0x3e')]){_0x405bb8[_0x6a39('0x38')]=[{'all':!![]}];}_0x405bb8=_[_0x6a39('0x3f')]({},_0x405bb8,_0x30bf23['options']);return db['VoiceExtension'][_0x6a39('0x1d')](_0x405bb8)[_0x6a39('0x13')](handleEntityNotFound(_0x434ecb,null))['then'](respondWithResult(_0x434ecb,null))[_0x6a39('0x3b')](handleError(_0x434ecb,null));};exports[_0x6a39('0x12')]=function(_0x3be58f,_0xaaa8e5){return db[_0x6a39('0x37')][_0x6a39('0x1d')]({'where':{'id':_0x3be58f['params']['id']}})[_0x6a39('0x13')](handleEntityNotFound(_0xaaa8e5,null))[_0x6a39('0x13')](removeEntity(_0xaaa8e5,null))[_0x6a39('0x3b')](handleError(_0xaaa8e5,null));};exports[_0x6a39('0x40')]=function(_0x4e3d20,_0x289fd8){if(_0x4e3d20['body']['type']==='outbound'&&!_[_0x6a39('0x41')](_0x4e3d20[_0x6a39('0x42')][_0x6a39('0x43')],'_')){_0x4e3d20[_0x6a39('0x42')]['exten']='_'['concat'](_0x4e3d20['body'][_0x6a39('0x43')]);}return db[_0x6a39('0x37')][_0x6a39('0x40')](_0x4e3d20['body'],{'raw':![]})['then'](function(_0x41ff57){var _0x52e69c=_0x4e3d20['user'][_0x6a39('0x44')]({'plain':!![]});if(!_0x52e69c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52e69c[_0x6a39('0x45')]===_0x6a39('0x46')){var _0x5c2f11=_0x41ff57[_0x6a39('0x44')]({'plain':!![]});var _0x1c3618=[{'name':_0x6a39('0x14'),'value':_0x6a39('0x15')},{'name':'OutboundRoutes','value':_0x6a39('0x17')},{'name':_0x6a39('0x47'),'value':_0x6a39('0x18')}];var _0x5b27e0=_[_0x6a39('0x1d')](_0x1c3618,[_0x6a39('0x1b'),_0x5c2f11[_0x6a39('0x1e')]])[_0x6a39('0x1f')];return db[_0x6a39('0x48')][_0x6a39('0x1d')]({'where':{'name':_0x5b27e0,'userProfileId':_0x52e69c[_0x6a39('0x49')]},'raw':!![]})[_0x6a39('0x13')](function(_0x161dd6){if(_0x161dd6&&_0x161dd6['autoAssociation']===0x0){return db[_0x6a39('0x4a')]['create']({'name':_0x5c2f11[_0x6a39('0x1f')],'resourceId':_0x5c2f11['id'],'type':_0x161dd6['name'],'sectionId':_0x161dd6['id']},{})['then'](function(){return _0x41ff57;});}else{return _0x41ff57;}})[_0x6a39('0x3b')](function(_0x4d52e7){logger[_0x6a39('0x21')](_0x6a39('0x4b'),_0x4d52e7);throw _0x4d52e7;});}return _0x41ff57;})[_0x6a39('0x13')](respondWithResult(_0x289fd8,0xc9))[_0x6a39('0x3b')](handleError(_0x289fd8,null));};exports['update']=function(_0x5a8525,_0x428789){if(_0x5a8525[_0x6a39('0x42')]['id']){delete _0x5a8525[_0x6a39('0x42')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x5a8525['params']['id']}})[_0x6a39('0x13')](handleEntityNotFound(_0x428789,null))[_0x6a39('0x13')](function(_0x25cb2a){if(_0x25cb2a){return db['VoiceExtension'][_0x6a39('0x4c')](_[_0x6a39('0x34')](_0x5a8525[_0x6a39('0x42')],['exten',_0x6a39('0x4d'),_0x6a39('0x4e'),'recordingFormat',_0x6a39('0x4f'),'mandatoryDisposition',_0x6a39('0x50')]),{'where':{'context':_0x25cb2a[_0x6a39('0x4d')],'exten':_0x25cb2a[_0x6a39('0x43')]},'individualHooks':!![]})['then'](function(_0x52c80f){return _0x52c80f;});}return null;})['then'](respondWithStatusCode(_0x428789,null))[_0x6a39('0x3b')](handleError(_0x428789,null));};exports[_0x6a39('0x51')]=function(_0x2b265e,_0x498400){return db[_0x6a39('0x37')][_0x6a39('0x52')]({'where':{'id':_0x2b265e[_0x6a39('0x3d')]['id']}})[_0x6a39('0x13')](function(_0x539eae){if(_0x539eae){return db['sequelize'][_0x6a39('0x53')](function(_0x7411ca){return db[_0x6a39('0x37')][_0x6a39('0x12')]({'where':{'VoiceExtensionId':_0x2b265e[_0x6a39('0x3d')]['id']},'transaction':_0x7411ca})['then'](function(){var _0x242cc9=_['map'](_0x2b265e[_0x6a39('0x42')],function(_0x19bc63){_0x19bc63[_0x6a39('0x54')]=_0x2b265e[_0x6a39('0x3d')]['id'];_0x19bc63['isApp']=!![];return _0x19bc63;});return _0x539eae['createRouting'](_0x242cc9);})[_0x6a39('0x13')](function(_0x10f31e){console['log'](_0x6a39('0x55'),_0x10f31e);return db[_0x6a39('0x37')][_0x6a39('0x56')](_0x10f31e,{'transaction':_0x7411ca});});})[_0x6a39('0x13')](function(){return db[_0x6a39('0x37')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x2b265e['params']['id']},'order':_0x6a39('0x57')});});}})[_0x6a39('0x13')](respondWithResult(_0x498400,null))[_0x6a39('0x3b')](handleError(_0x498400,null));}; \ No newline at end of file +var _0x1667=['findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','destroy','get','inbound','OutboundRoutes','InternalRoutes','internal','filter','map','value','type','find','name','UserProfileResource','then','error','stack','VoiceExtension','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','VIRTUAL','merge','options','rows','catch','params','include','create','body','outbound','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate'];(function(_0x1aaa79,_0x310c50){var _0x59a250=function(_0x36e403){while(--_0x36e403){_0x1aaa79['push'](_0x1aaa79['shift']());}};_0x59a250(++_0x310c50);}(_0x1667,0xfd));var _0x7166=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x1667[_0x4bc428];return _0x3ca37f;};'use strict';var _=require(_0x7166('0x0'));var Redis=require(_0x7166('0x1'));var qs=require(_0x7166('0x2'));var logger=require('../../config/logger')('api');var config=require(_0x7166('0x3'));var db=require(_0x7166('0x4'))['db'];config[_0x7166('0x5')]=_[_0x7166('0x6')](config['redis'],{'host':_0x7166('0x7'),'port':0x18eb});var socket=require(_0x7166('0x8'))(new Redis(config[_0x7166('0x5')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x2ff9e5,_0x2cbc6c){_0x2cbc6c=_0x2cbc6c||0xcc;return function(_0x2f43be){if(_0x2f43be){return _0x2ff9e5[_0x7166('0x9')](_0x2cbc6c);}return _0x2ff9e5[_0x7166('0xa')](_0x2cbc6c)[_0x7166('0xb')]();};}function respondWithResult(_0x59ac5c,_0x1f212a){_0x1f212a=_0x1f212a||0xc8;return function(_0x1d6a70){if(_0x1d6a70){return _0x59ac5c['status'](_0x1f212a)['json'](_0x1d6a70);}};}function respondWithFilteredResult(_0x2120f6,_0x286d2c){return function(_0x22fdc9){if(_0x22fdc9){var _0x4c8868=typeof _0x286d2c[_0x7166('0xc')]===_0x7166('0xd')&&typeof _0x286d2c['limit']===_0x7166('0xd');var _0x11c2e7=_0x22fdc9[_0x7166('0xe')];var _0x4ac5b7=_0x4c8868?0x0:_0x286d2c[_0x7166('0xc')];var _0x391467=_0x4c8868?_0x22fdc9[_0x7166('0xe')]:_0x286d2c[_0x7166('0xc')]+_0x286d2c[_0x7166('0xf')];var _0x5a1d81;if(_0x391467>=_0x11c2e7){_0x391467=_0x11c2e7;_0x5a1d81=0xc8;}else{_0x5a1d81=0xce;}_0x2120f6[_0x7166('0xa')](_0x5a1d81);return _0x2120f6[_0x7166('0x10')](_0x7166('0x11'),_0x4ac5b7+'-'+_0x391467+'/'+_0x11c2e7)[_0x7166('0x12')](_0x22fdc9);}return null;};}function removeEntity(_0x34a1c5){return function(_0x5652d7){if(_0x5652d7){return _0x5652d7[_0x7166('0x13')]()['then'](function(){var _0x360512=_0x5652d7[_0x7166('0x14')]({'plain':!![]});var _0x2a2168=[{'name':'InboundRoutes','value':_0x7166('0x15'),'ignore':![]},{'name':_0x7166('0x16'),'value':'outbound','ignore':![]},{'name':_0x7166('0x17'),'value':_0x7166('0x18'),'ignore':![]}];var _0x3123db=_(_0x2a2168)[_0x7166('0x19')]('ignore')[_0x7166('0x1a')](_0x7166('0x1b'))[_0x7166('0x1b')]();if(_['includes'](_0x3123db,_0x360512[_0x7166('0x1c')])){return;}var _0x3dae20=_[_0x7166('0x1d')](_0x2a2168,[_0x7166('0x1b'),_0x360512['type']])[_0x7166('0x1e')];return db[_0x7166('0x1f')][_0x7166('0x13')]({'where':{'type':_0x3dae20,'resourceId':_0x360512['id']}})[_0x7166('0x20')](function(){return _0x5652d7;});})[_0x7166('0x20')](function(){_0x34a1c5['status'](0xcc)[_0x7166('0xb')]();});}};}function handleEntityNotFound(_0x9c1841){return function(_0x1a69b9){if(!_0x1a69b9){_0x9c1841[_0x7166('0x9')](0x194);}return _0x1a69b9;};}function handleError(_0x484382,_0x487954){_0x487954=_0x487954||0x1f4;return function(_0x4db90b){logger[_0x7166('0x21')](_0x4db90b[_0x7166('0x22')]);if(_0x4db90b['name']){delete _0x4db90b['name'];}_0x484382[_0x7166('0xa')](_0x487954)['send'](_0x4db90b);};}exports['index']=function(_0x3107b5,_0x288ed4){var _0x4a2b0e={},_0x52807b={},_0x4b7640={'count':0x0,'rows':[]};var _0x1f6194=_[_0x7166('0x1a')](db[_0x7166('0x23')]['rawAttributes'],function(_0x282664){return{'name':_0x282664[_0x7166('0x24')],'type':_0x282664['type'][_0x7166('0x25')]};});_0x52807b[_0x7166('0x26')]=_[_0x7166('0x1a')](_0x1f6194,_0x7166('0x1e'));_0x52807b['query']=_[_0x7166('0x27')](_0x3107b5[_0x7166('0x28')]);_0x52807b[_0x7166('0x29')]=_['intersection'](_0x52807b[_0x7166('0x26')],_0x52807b[_0x7166('0x28')]);_0x4a2b0e['attributes']=_[_0x7166('0x2a')](_0x52807b[_0x7166('0x26')],qs[_0x7166('0x2b')](_0x3107b5[_0x7166('0x28')]['fields']));_0x4a2b0e[_0x7166('0x2c')]=_0x4a2b0e[_0x7166('0x2c')][_0x7166('0x2d')]?_0x4a2b0e[_0x7166('0x2c')]:_0x52807b[_0x7166('0x26')];if(!_0x3107b5[_0x7166('0x28')][_0x7166('0x2e')](_0x7166('0x2f'))){_0x4a2b0e[_0x7166('0xf')]=qs[_0x7166('0xf')](_0x3107b5[_0x7166('0x28')][_0x7166('0xf')]);_0x4a2b0e[_0x7166('0xc')]=qs[_0x7166('0xc')](_0x3107b5[_0x7166('0x28')]['offset']);}_0x4a2b0e[_0x7166('0x30')]=qs['sort'](_0x3107b5['query']['sort']);_0x4a2b0e[_0x7166('0x31')]=qs[_0x7166('0x29')](_['pick'](_0x3107b5[_0x7166('0x28')],_0x52807b[_0x7166('0x29')]),_0x1f6194);if(_0x3107b5['query'][_0x7166('0x19')]){_0x4a2b0e[_0x7166('0x31')]=_['merge'](_0x4a2b0e[_0x7166('0x31')],{'$or':_[_0x7166('0x1a')](_0x1f6194,function(_0x1cc751){if(_0x1cc751['type']!==_0x7166('0x32')){var _0x49b010={};_0x49b010[_0x1cc751['name']]={'$like':'%'+_0x3107b5[_0x7166('0x28')]['filter']+'%'};return _0x49b010;}})});}_0x4a2b0e=_[_0x7166('0x33')]({},_0x4a2b0e,_0x3107b5[_0x7166('0x34')]);var _0x2a2262={'where':_0x4a2b0e[_0x7166('0x31')]};return db[_0x7166('0x23')][_0x7166('0xe')](_0x2a2262)[_0x7166('0x20')](function(_0x40a1db){_0x4b7640[_0x7166('0xe')]=_0x40a1db;if(_0x3107b5[_0x7166('0x28')]['includeAll']){_0x4a2b0e['include']=[{'all':!![]}];}return db[_0x7166('0x23')]['findAll'](_0x4a2b0e);})['then'](function(_0x1b0afb){_0x4b7640[_0x7166('0x35')]=_0x1b0afb;return _0x4b7640;})[_0x7166('0x20')](respondWithFilteredResult(_0x288ed4,_0x4a2b0e))[_0x7166('0x36')](handleError(_0x288ed4,null));};exports['show']=function(_0x195b9e,_0x12ce64){var _0x4480c9={'raw':![],'where':{'id':_0x195b9e[_0x7166('0x37')]['id']}},_0x36b32a={};_0x36b32a['model']=_[_0x7166('0x27')](db[_0x7166('0x23')]['rawAttributes']);_0x36b32a[_0x7166('0x28')]=_[_0x7166('0x27')](_0x195b9e[_0x7166('0x28')]);_0x36b32a[_0x7166('0x29')]=_[_0x7166('0x2a')](_0x36b32a[_0x7166('0x26')],_0x36b32a[_0x7166('0x28')]);_0x4480c9['attributes']=_['intersection'](_0x36b32a[_0x7166('0x26')],qs[_0x7166('0x2b')](_0x195b9e['query'][_0x7166('0x2b')]));_0x4480c9['attributes']=_0x4480c9[_0x7166('0x2c')]['length']?_0x4480c9[_0x7166('0x2c')]:_0x36b32a[_0x7166('0x26')];if(_0x195b9e[_0x7166('0x28')]['includeAll']){_0x4480c9[_0x7166('0x38')]=[{'all':!![]}];}_0x4480c9=_[_0x7166('0x33')]({},_0x4480c9,_0x195b9e[_0x7166('0x34')]);return db[_0x7166('0x23')][_0x7166('0x1d')](_0x4480c9)[_0x7166('0x20')](handleEntityNotFound(_0x12ce64,null))[_0x7166('0x20')](respondWithResult(_0x12ce64,null))[_0x7166('0x36')](handleError(_0x12ce64,null));};exports['destroy']=function(_0x29cbe9,_0x2bc9f6){return db['VoiceExtension']['find']({'where':{'id':_0x29cbe9['params']['id']}})[_0x7166('0x20')](handleEntityNotFound(_0x2bc9f6,null))[_0x7166('0x20')](removeEntity(_0x2bc9f6,null))[_0x7166('0x36')](handleError(_0x2bc9f6,null));};exports[_0x7166('0x39')]=function(_0x33b1a7,_0x1522fa){if(_0x33b1a7[_0x7166('0x3a')][_0x7166('0x1c')]===_0x7166('0x3b')&&!_[_0x7166('0x3c')](_0x33b1a7[_0x7166('0x3a')][_0x7166('0x3d')],'_')){_0x33b1a7[_0x7166('0x3a')]['exten']='_'['concat'](_0x33b1a7['body'][_0x7166('0x3d')]);}return db[_0x7166('0x23')][_0x7166('0x39')](_0x33b1a7[_0x7166('0x3a')],{'raw':![]})[_0x7166('0x20')](function(_0x480d6e){var _0x576b1d=_0x33b1a7[_0x7166('0x3e')][_0x7166('0x14')]({'plain':!![]});if(!_0x576b1d)throw new Error(_0x7166('0x3f'));if(_0x576b1d[_0x7166('0x40')]==='user'){var _0x3dc095=_0x480d6e[_0x7166('0x14')]({'plain':!![]});var _0x2e92e3=[{'name':_0x7166('0x41'),'value':_0x7166('0x15')},{'name':_0x7166('0x16'),'value':_0x7166('0x3b')},{'name':_0x7166('0x17'),'value':'internal'}];var _0xee4e5e=_[_0x7166('0x1d')](_0x2e92e3,[_0x7166('0x1b'),_0x3dc095[_0x7166('0x1c')]])[_0x7166('0x1e')];return db['UserProfileSection'][_0x7166('0x1d')]({'where':{'name':_0xee4e5e,'userProfileId':_0x576b1d[_0x7166('0x42')]},'raw':!![]})[_0x7166('0x20')](function(_0x5ad974){if(_0x5ad974&&_0x5ad974['autoAssociation']===0x0){return db[_0x7166('0x1f')]['create']({'name':_0x3dc095[_0x7166('0x1e')],'resourceId':_0x3dc095['id'],'type':_0x5ad974[_0x7166('0x1e')],'sectionId':_0x5ad974['id']},{})[_0x7166('0x20')](function(){return _0x480d6e;});}else{return _0x480d6e;}})['catch'](function(_0x59583b){logger[_0x7166('0x21')](_0x7166('0x43'),_0x59583b);throw _0x59583b;});}return _0x480d6e;})['then'](respondWithResult(_0x1522fa,0xc9))[_0x7166('0x36')](handleError(_0x1522fa,null));};exports[_0x7166('0x44')]=function(_0x4ad66a,_0xf4d51c){if(_0x4ad66a[_0x7166('0x3a')]['id']){delete _0x4ad66a[_0x7166('0x3a')]['id'];}return db[_0x7166('0x23')][_0x7166('0x1d')]({'where':{'id':_0x4ad66a[_0x7166('0x37')]['id']}})[_0x7166('0x20')](handleEntityNotFound(_0xf4d51c,null))[_0x7166('0x20')](function(_0x4417cd){if(_0x4417cd){return db[_0x7166('0x23')][_0x7166('0x44')](_[_0x7166('0x45')](_0x4ad66a[_0x7166('0x3a')],[_0x7166('0x3d'),_0x7166('0x46'),_0x7166('0x47'),_0x7166('0x48'),'cutdigits',_0x7166('0x49'),'alias']),{'where':{'context':_0x4417cd[_0x7166('0x46')],'exten':_0x4417cd[_0x7166('0x3d')]},'individualHooks':!![]})[_0x7166('0x20')](function(_0x5daab2){return _0x5daab2;});}return null;})['then'](respondWithStatusCode(_0xf4d51c,null))[_0x7166('0x36')](handleError(_0xf4d51c,null));};exports[_0x7166('0x4a')]=function(_0x1d1b3a,_0x3b699a){return db[_0x7166('0x23')][_0x7166('0x4b')]({'where':{'id':_0x1d1b3a['params']['id']}})['then'](function(_0x3758ea){if(_0x3758ea){return db[_0x7166('0x4c')][_0x7166('0x4d')](function(_0x295363){return db[_0x7166('0x23')][_0x7166('0x13')]({'where':{'VoiceExtensionId':_0x1d1b3a[_0x7166('0x37')]['id']},'transaction':_0x295363})[_0x7166('0x20')](function(){var _0x30d948=_['map'](_0x1d1b3a[_0x7166('0x3a')],function(_0x335d79){_0x335d79['VoiceExtensionId']=_0x1d1b3a[_0x7166('0x37')]['id'];_0x335d79[_0x7166('0x4e')]=!![];return _0x335d79;});return _0x3758ea[_0x7166('0x4f')](_0x30d948);})[_0x7166('0x20')](function(_0x1f8dec){console[_0x7166('0x50')](_0x7166('0x51'),_0x1f8dec);return db[_0x7166('0x23')][_0x7166('0x52')](_0x1f8dec,{'transaction':_0x295363});});})[_0x7166('0x20')](function(){return db[_0x7166('0x23')][_0x7166('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1d1b3a[_0x7166('0x37')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x7166('0x20')](respondWithResult(_0x3b699a,null))[_0x7166('0x36')](handleError(_0x3b699a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 369af7d..ae40f40 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 _0x0ee1=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x15e634,_0x28558e){var _0x4d5d95=function(_0x5c3a6f){while(--_0x5c3a6f){_0x15e634['push'](_0x15e634['shift']());}};_0x4d5d95(++_0x28558e);}(_0x0ee1,0x1da));var _0x10ee=function(_0x6fbc80,_0x355ace){_0x6fbc80=_0x6fbc80-0x0;var _0x57c2ff=_0x0ee1[_0x6fbc80];return _0x57c2ff;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x10ee('0x0'))['db'][_0x10ee('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x10ee('0x2')](0x0);var events={'afterCreate':_0x10ee('0x3'),'afterUpdate':'update','afterDestroy':_0x10ee('0x4')};function emitEvent(_0x45ea26){return function(_0x4d7d92,_0x32598d,_0x31e063){VoiceExtensionEvents[_0x10ee('0x5')](_0x45ea26+':'+_0x4d7d92['id'],_0x4d7d92);VoiceExtensionEvents[_0x10ee('0x5')](_0x45ea26,_0x4d7d92);_0x31e063(null);};}for(var e in events){if(events[_0x10ee('0x6')](e)){var event=events[e];VoiceExtension[_0x10ee('0x7')](e,emitEvent(event));}}module[_0x10ee('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xda82=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x14249c,_0x5c3c7c){var _0x25217c=function(_0x53b0ad){while(--_0x53b0ad){_0x14249c['push'](_0x14249c['shift']());}};_0x25217c(++_0x5c3c7c);}(_0xda82,0xa2));var _0x2da8=function(_0x29b24c,_0x2fb16b){_0x29b24c=_0x29b24c-0x0;var _0x26c2b1=_0xda82[_0x29b24c];return _0x26c2b1;};'use strict';var EventEmitter=require(_0x2da8('0x0'));var VoiceExtension=require(_0x2da8('0x1'))['db'][_0x2da8('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2da8('0x3')](0x0);var events={'afterCreate':_0x2da8('0x4'),'afterUpdate':'update','afterDestroy':_0x2da8('0x5')};function emitEvent(_0x3db9f7){return function(_0x57e797,_0x5a9274,_0xc9927b){VoiceExtensionEvents['emit'](_0x3db9f7+':'+_0x57e797['id'],_0x57e797);VoiceExtensionEvents[_0x2da8('0x6')](_0x3db9f7,_0x57e797);_0xc9927b(null);};}for(var e in events){if(events[_0x2da8('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x2da8('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 7749292..ab6a31f 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 _0xf006=['catch','define','VoiceExtension','voice_extensions','then','Hangup','exports','models','type','Set','CDR(type)=','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','options','url','split','length','name','param','prefix','phone','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','findAll','interval','IntervalId','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','ExecIf','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat'];(function(_0x5834d1,_0x233219){var _0x3daeab=function(_0x20512e){while(--_0x20512e){_0x5834d1['push'](_0x5834d1['shift']());}};_0x3daeab(++_0x233219);}(_0xf006,0x146));var _0x6f00=function(_0x19d50f,_0x5e0451){_0x19d50f=_0x19d50f-0x0;var _0x7decd2=_0xf006[_0x19d50f];return _0x7decd2;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x6f00('0x0')]=function(_0x281499){var _0x5914f3=_0x281499[_0x6f00('0x1')];function _0x4e9dbc(_0x1c7a9e){var _0x4f4466=0x2;var _0x5039fb=[{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x6f00('0x3'),'appdata':_0x6f00('0x4')+_0x1c7a9e['type'],'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e['exten'],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']},{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x1c7a9e[_0x6f00('0x6')]?_0x6f00('0x3'):_0x6f00('0x7'),'appdata':_0x1c7a9e[_0x6f00('0x6')]?_0x6f00('0x8')+_0x1c7a9e[_0x6f00('0x6')]:_0x6f00('0x9'),'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e[_0x6f00('0xa')],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']}];if(_0x1c7a9e[_0x6f00('0x2')]===_0x6f00('0xb')){_0x5039fb[_0x6f00('0xc')]({'type':'inbound','app':_0x6f00('0x3'),'appdata':_0x6f00('0xd')+_0x1c7a9e['id'],'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e[_0x6f00('0xa')],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']});}_0x5039fb[_0x6f00('0xc')]({'type':_0x1c7a9e['type'],'app':_0x6f00('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e['exten'],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']},{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x6f00('0x3'),'appdata':_0x6f00('0xe'),'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e[_0x6f00('0xa')],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']},{'type':_0x1c7a9e[_0x6f00('0x2')],'app':_0x6f00('0x3'),'appdata':_0x6f00('0xf'),'context':_0x1c7a9e[_0x6f00('0x5')],'exten':_0x1c7a9e['exten'],'priority':_0x4f4466++,'VoiceExtensionId':_0x1c7a9e['id']});return _0x5039fb;}function _0x14b15d(_0x5085f0){var _0x534275=0x2;var _0x7c047e=[{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x6f00('0x11'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x5085f0[_0x6f00('0x6')]?_0x6f00('0x3'):_0x6f00('0x7'),'appdata':_0x5085f0[_0x6f00('0x6')]?_0x6f00('0x8')+_0x5085f0['alias']:'No\x20alias\x20set','context':_0x5085f0['context'],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'CDR(destination)='+(_0x5085f0[_0x6f00('0x12')]?_0x6f00('0x13')+_0x5085f0[_0x6f00('0x12')]+'}':_0x6f00('0x14')),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'CDR(routeid)='+_0x5085f0['id'],'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':'ExecIf','appdata':_0x6f00('0x15')+(_0x534275+0x2)+'):Goto('+(_0x534275+0x1)+')','context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0['exten'],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x5085f0[_0x6f00('0x12')]?_0x6f00('0x16')+_0x5085f0[_0x6f00('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x6f00('0x17'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':_0x6f00('0xe'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5085f0['context'],'exten':_0x5085f0['exten'],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':'outbound','app':'Set','appdata':'outboundrouteid='+_0x5085f0['id'],'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0['exten'],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']}];if(_0x5085f0[_0x6f00('0x18')](_0x6f00('0x19'))&&_0x5085f0[_0x6f00('0x19')]!==_0x6f00('0x1a')){_0x7c047e[_0x6f00('0xc')]({'type':_0x6f00('0x10'),'app':'Set','appdata':_0x6f00('0x1b'),'context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']},{'type':_0x6f00('0x10'),'app':_0x6f00('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5085f0['recordingFormat']||'wav','context':_0x5085f0[_0x6f00('0x5')],'exten':_0x5085f0[_0x6f00('0xa')],'priority':_0x534275++,'VoiceExtensionId':_0x5085f0['id']});}return _0x7c047e;}function _0x456dab(_0x27ebb4,_0xbece){var _0x521e1e=[{'name':_0x6f00('0x1c'),'param':0x0},{'name':_0x6f00('0x1d'),'param':0x1},{'name':_0x6f00('0x1e'),'param':0x2},{'name':_0x6f00('0x1f'),'param':0x3}];var _0x3865ab={};var _0x493190=_0xbece[_0x6f00('0x20')](',');var _0x52936d=[];for(var _0x28e436=0x0;_0x28e436<_0x521e1e[_0x6f00('0x21')];_0x28e436++){switch(_0x521e1e[_0x28e436][_0x6f00('0x22')]){case'trunk':_0x3865ab[_0x6f00('0x1c')]=_0x493190[_0x521e1e[_0x28e436][_0x6f00('0x23')]][_0x6f00('0x20')]('/')[0x1];_0x3865ab['phone']=_0x493190[_0x521e1e[_0x28e436][_0x6f00('0x23')]]['split']('/')[0x2];_0x3865ab[_0x6f00('0x24')]=_0x3865ab['phone']?_0x3865ab[_0x6f00('0x25')][_0x6f00('0x20')]('$')[0x0]:undefined;_0x3865ab[_0x6f00('0x25')]=_0x27ebb4[_0x6f00('0x12')]?(_0x3865ab['prefix']||'')+_0x6f00('0x13')+_0x27ebb4['cutdigits']+'}':(_0x3865ab[_0x6f00('0x24')]||'')+'${EXTEN}';_0x52936d[_0x521e1e[_0x28e436][_0x6f00('0x23')]]=[_0x6f00('0x26'),_0x3865ab[_0x6f00('0x1c')],_0x3865ab[_0x6f00('0x25')]]['join']('/');break;case'options':_0x3865ab[_0x6f00('0x1e')]=_0x493190[_0x521e1e[_0x28e436]['param']];if(_0x27ebb4[_0x6f00('0x19')]!==_0x6f00('0x1a')){if(_0x3865ab['options'][_0x6f00('0x27')]('U(xcally-mixmonitor-context)')<0x0){_0x3865ab['options']+=_0x6f00('0x28');}}else{_0x3865ab[_0x6f00('0x1e')]=_0x3865ab[_0x6f00('0x1e')][_0x6f00('0x29')]('U(xcally-mixmonitor-context)','');}_0x52936d[_0x521e1e[_0x28e436][_0x6f00('0x23')]]=_0x3865ab[_0x6f00('0x1e')];break;default:_0x52936d[_0x521e1e[_0x28e436][_0x6f00('0x23')]]=_0x493190[_0x521e1e[_0x28e436][_0x6f00('0x23')]];}}return _0x52936d[_0x6f00('0x2a')](',');}function _0x1059e9(_0x555082,_0x752ea3,_0x17257e){return new Promise(function(_0x8d4dde,_0x1c8b81){var _0x303a32=[];if(_[_0x6f00('0x2b')](_0x752ea3))return _0x8d4dde(_0x303a32);_0x5914f3['Interval'][_0x6f00('0x2c')]({'attributes':['id',_0x6f00('0x2d'),_0x6f00('0x2e')],'raw':!![]})['then'](function(_0x2e6cc6){for(var _0x4f1be9=0x0,_0x9e3308=0x0;_0x4f1be9<_0x752ea3[_0x6f00('0x21')];_0x4f1be9++,_0x9e3308=0x0){var _0x49de34=_0x752ea3[_0x4f1be9];var _0x107158=[];var _0x4d74e5=[];delete _0x49de34['id'];if(_0x49de34[_0x6f00('0x2d')]!==_0x6f00('0x2f')){_0x49de34[_0x6f00('0x30')]=[_0x49de34[_0x6f00('0x2d')]];}else{_0x49de34['intervals']=_0x49de34[_0x6f00('0x2e')]?_['map'](_[_0x6f00('0x31')](_0x2e6cc6,{'IntervalId':_0x49de34['IntervalId']}),_0x6f00('0x2d')):[];}_0x49de34[_0x6f00('0x5')]=_0x555082[_0x6f00('0x5')];_0x49de34[_0x6f00('0xa')]=_0x555082[_0x6f00('0xa')];if(_0x49de34[_0x6f00('0x2')])_0x49de34[_0x6f00('0x2')]=_0x49de34[_0x6f00('0x2')]['toLowerCase']();if(_0x555082[_0x6f00('0x2')]==='outbound'){if(_0x49de34[_0x6f00('0x18')](_0x6f00('0x32'))&&_0x49de34[_0x6f00('0x32')]&&_0x49de34['tag']!=='--'){_0x107158['push']({'type':_0x49de34[_0x6f00('0x2')][_0x6f00('0x33')](),'app':'Set','appdata':_0x6f00('0x34')+_0x49de34['tag'],'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082['exten'],'priority':_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}_0x107158['push']({'type':_0x49de34['type'][_0x6f00('0x33')](),'app':_0x6f00('0x35'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x49de34[_0x6f00('0x36')]?'Set(CALLERID(all)='+_0x49de34[_0x6f00('0x36')]+')':_0x6f00('0x37')),'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}else{if(_0x49de34[_0x6f00('0x18')](_0x6f00('0x38'))){if([_0x6f00('0x39'),_0x6f00('0x3a')][_0x6f00('0x3b')](_0x49de34[_0x6f00('0x3c')][_0x6f00('0x33')]())&&_0x49de34[_0x6f00('0x3d')]!==_0x6f00('0x3e')){if(_0x49de34[_0x6f00('0x38')]){_0x107158[_0x6f00('0xc')]({'type':_0x49de34[_0x6f00('0x2')][_0x6f00('0x33')](),'app':_0x6f00('0x35'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x555082['context'],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34['intervals'][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});_0x107158[_0x6f00('0xc')]({'type':_0x49de34['type'][_0x6f00('0x33')](),'app':_0x6f00('0x3'),'appdata':_0x6f00('0x3f'),'context':_0x555082['context'],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34['intervals'][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}else{_0x107158[_0x6f00('0xc')]({'type':_0x49de34['type'][_0x6f00('0x33')](),'app':_0x6f00('0x35'),'appdata':_0x6f00('0x40'),'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082[_0x6f00('0xa')],'priority':_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});_0x107158['push']({'type':_0x49de34['type']['toLowerCase'](),'app':'Set','appdata':_0x6f00('0x41'),'context':_0x555082[_0x6f00('0x5')],'exten':_0x555082['exten'],'priority':_0x49de34['intervals'][_0x6f00('0x21')]+_0x17257e+_0x9e3308++,'VoiceExtensionId':_0x555082['id']});}}}}for(var _0x3e6d45=0x0;_0x3e6d45<_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')];_0x3e6d45++){var _0x53aed1=_0x17257e+_0x49de34[_0x6f00('0x30')]['length'];var _0x54530a=_0x3e6d45===_0x49de34[_0x6f00('0x30')][_0x6f00('0x21')]-0x1?_0x17257e+_0x107158[_0x6f00('0x21')]+_0x4d74e5[_0x6f00('0x21')]+0x2:_0x17257e+_0x3e6d45+0x1;_0x107158[_0x6f00('0x42')](_0x3e6d45,0x0,{'type':_0x555082['type'],'app':_0x6f00('0x43'),'appdata':_0x49de34[_0x6f00('0x30')][_0x3e6d45]+'?'+_0x555082[_0x6f00('0x5')]+_0x6f00('0x44')+_0x53aed1+':'+_0x555082['context']+',${EXTEN},'+_0x54530a,'exten':_0x555082[_0x6f00('0xa')],'context':_0x555082['context'],'priority':_0x17257e+_0x3e6d45,'VoiceExtensionId':_0x555082['id']});}if(_0x49de34[_0x6f00('0x3d')]===_0x6f00('0x45'))_0x49de34[_0x6f00('0x46')]=_0x456dab(_0x555082,_0x49de34[_0x6f00('0x46')]);_0x49de34['priority']=_0x107158['length']?_[_0x6f00('0x47')](_0x107158)[_0x6f00('0x48')]+0x1:_0x17257e;_0x303a32=_[_0x6f00('0x49')](_0x303a32,_0x107158,[_0x49de34],_0x4d74e5);_0x17257e=_[_0x6f00('0x47')](_0x303a32)['priority']+0x1;}return _0x8d4dde(_0x303a32);})[_0x6f00('0x4a')](function(_0x37af94){_0x1c8b81(_0x37af94);});});}return _0x281499[_0x6f00('0x4b')](_0x6f00('0x4c'),attributes,{'tableName':_0x6f00('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5c7a47){var _0x4ac796=this['get']({'plain':!![]});var _0x1e4ae3=_0x4ac796[_0x6f00('0x2')]==='outbound'?_0x14b15d(_0x4ac796):_0x4e9dbc(_0x4ac796);return _0x1059e9(_0x4ac796,_0x5c7a47,_['last'](_0x1e4ae3)[_0x6f00('0x48')]+0x1)[_0x6f00('0x4e')](function(_0x5a1685){var _0x4c9286=_[_0x6f00('0x49')](_0x1e4ae3,_0x5a1685);_0x4c9286[_0x6f00('0xc')]({'type':_0x4ac796[_0x6f00('0x2')],'app':_0x6f00('0x4f'),'exten':_0x4ac796[_0x6f00('0xa')],'context':_0x4ac796[_0x6f00('0x5')],'priority':_[_0x6f00('0x47')](_0x4c9286)[_0x6f00('0x48')]+0x1,'VoiceExtensionId':_0x4ac796['id']});return _0x4c9286;});}}});}; \ No newline at end of file +var _0xe7de=[',${EXTEN},','appType','outboundDial','appdata','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','timeout','url','split','length','name','trunk','param','prefix','phone','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','IntervalId','then','interval','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe7de,0x165));var _0xee7d=function(_0x3de893,_0x2c9138){_0x3de893=_0x3de893-0x0;var _0x5361b9=_0xe7de[_0x3de893];return _0x5361b9;};'use strict';var _=require(_0xee7d('0x0'));var attributes=require(_0xee7d('0x1'));module[_0xee7d('0x2')]=function(_0x58d2f9){var _0x53a8c9=_0x58d2f9[_0xee7d('0x3')];function _0x2cd219(_0x2e646b){var _0x3f1c6d=0x2;var _0x3afa35=[{'type':_0x2e646b[_0xee7d('0x4')],'app':_0xee7d('0x5'),'appdata':_0xee7d('0x6')+_0x2e646b[_0xee7d('0x4')],'context':_0x2e646b[_0xee7d('0x7')],'exten':_0x2e646b[_0xee7d('0x8')],'priority':_0x3f1c6d++,'VoiceExtensionId':_0x2e646b['id']},{'type':_0x2e646b[_0xee7d('0x4')],'app':_0x2e646b[_0xee7d('0x9')]?_0xee7d('0x5'):'NoOp','appdata':_0x2e646b[_0xee7d('0x9')]?_0xee7d('0xa')+_0x2e646b[_0xee7d('0x9')]:_0xee7d('0xb'),'context':_0x2e646b[_0xee7d('0x7')],'exten':_0x2e646b[_0xee7d('0x8')],'priority':_0x3f1c6d++,'VoiceExtensionId':_0x2e646b['id']}];if(_0x2e646b['type']===_0xee7d('0xc')){_0x3afa35['push']({'type':_0xee7d('0xc'),'app':_0xee7d('0x5'),'appdata':_0xee7d('0xd')+_0x2e646b['id'],'context':_0x2e646b[_0xee7d('0x7')],'exten':_0x2e646b[_0xee7d('0x8')],'priority':_0x3f1c6d++,'VoiceExtensionId':_0x2e646b['id']});}_0x3afa35[_0xee7d('0xe')]({'type':_0x2e646b[_0xee7d('0x4')],'app':_0xee7d('0x5'),'appdata':_0xee7d('0xf'),'context':_0x2e646b[_0xee7d('0x7')],'exten':_0x2e646b[_0xee7d('0x8')],'priority':_0x3f1c6d++,'VoiceExtensionId':_0x2e646b['id']},{'type':_0x2e646b['type'],'app':'Set','appdata':_0xee7d('0x10'),'context':_0x2e646b[_0xee7d('0x7')],'exten':_0x2e646b[_0xee7d('0x8')],'priority':_0x3f1c6d++,'VoiceExtensionId':_0x2e646b['id']},{'type':_0x2e646b[_0xee7d('0x4')],'app':_0xee7d('0x5'),'appdata':_0xee7d('0x11'),'context':_0x2e646b['context'],'exten':_0x2e646b[_0xee7d('0x8')],'priority':_0x3f1c6d++,'VoiceExtensionId':_0x2e646b['id']});return _0x3afa35;}function _0x2bcd81(_0x59a308){var _0x62d1ec=0x2;var _0x467eda=[{'type':_0xee7d('0x12'),'app':'Set','appdata':_0xee7d('0x13'),'context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':'outbound','app':_0x59a308[_0xee7d('0x9')]?'Set':_0xee7d('0x14'),'appdata':_0x59a308[_0xee7d('0x9')]?_0xee7d('0xa')+_0x59a308['alias']:_0xee7d('0xb'),'context':_0x59a308['context'],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x5'),'appdata':_0xee7d('0x15')+(_0x59a308['cutdigits']?_0xee7d('0x16')+_0x59a308[_0xee7d('0x17')]+'}':_0xee7d('0x18')),'context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x5'),'appdata':_0xee7d('0xd')+_0x59a308['id'],'context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308['exten'],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x19'),'appdata':_0xee7d('0x1a')+(_0x62d1ec+0x2)+'):Goto('+(_0x62d1ec+0x1)+')','context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x5'),'appdata':_0x59a308[_0xee7d('0x17')]?_0xee7d('0x1b')+_0x59a308[_0xee7d('0x17')]+'}':_0xee7d('0x1c'),'context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308['exten'],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308['exten'],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x5'),'appdata':_0xee7d('0x11'),'context':_0x59a308['context'],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':_0xee7d('0x5'),'appdata':_0xee7d('0x1d')+_0x59a308['id'],'context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']}];if(_0x59a308[_0xee7d('0x1e')](_0xee7d('0x1f'))&&_0x59a308['recordingFormat']!==_0xee7d('0x20')){_0x467eda[_0xee7d('0xe')]({'type':_0xee7d('0x12'),'app':'Set','appdata':_0xee7d('0x21'),'context':_0x59a308['context'],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']},{'type':_0xee7d('0x12'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x59a308[_0xee7d('0x1f')]||'wav','context':_0x59a308[_0xee7d('0x7')],'exten':_0x59a308[_0xee7d('0x8')],'priority':_0x62d1ec++,'VoiceExtensionId':_0x59a308['id']});}return _0x467eda;}function _0xd31202(_0x25f960,_0x140e4a){var _0x53de17=[{'name':'trunk','param':0x0},{'name':_0xee7d('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':_0xee7d('0x23'),'param':0x3}];var _0x158440={};var _0x29268e=_0x140e4a[_0xee7d('0x24')](',');var _0xf7ed45=[];for(var _0x36a554=0x0;_0x36a554<_0x53de17[_0xee7d('0x25')];_0x36a554++){switch(_0x53de17[_0x36a554][_0xee7d('0x26')]){case _0xee7d('0x27'):_0x158440[_0xee7d('0x27')]=_0x29268e[_0x53de17[_0x36a554][_0xee7d('0x28')]][_0xee7d('0x24')]('/')[0x1];_0x158440['phone']=_0x29268e[_0x53de17[_0x36a554][_0xee7d('0x28')]]['split']('/')[0x2];_0x158440[_0xee7d('0x29')]=_0x158440[_0xee7d('0x2a')]?_0x158440[_0xee7d('0x2a')]['split']('$')[0x0]:undefined;_0x158440[_0xee7d('0x2a')]=_0x25f960[_0xee7d('0x17')]?(_0x158440[_0xee7d('0x29')]||'')+'${EXTEN:'+_0x25f960[_0xee7d('0x17')]+'}':(_0x158440['prefix']||'')+_0xee7d('0x18');_0xf7ed45[_0x53de17[_0x36a554]['param']]=['SIP',_0x158440[_0xee7d('0x27')],_0x158440[_0xee7d('0x2a')]][_0xee7d('0x2b')]('/');break;case _0xee7d('0x2c'):_0x158440['options']=_0x29268e[_0x53de17[_0x36a554][_0xee7d('0x28')]];if(_0x25f960['recordingFormat']!=='none'){if(_0x158440[_0xee7d('0x2c')]['indexOf'](_0xee7d('0x2d'))<0x0){_0x158440['options']+=_0xee7d('0x2d');}}else{_0x158440[_0xee7d('0x2c')]=_0x158440[_0xee7d('0x2c')][_0xee7d('0x2e')]('U(xcally-mixmonitor-context)','');}_0xf7ed45[_0x53de17[_0x36a554][_0xee7d('0x28')]]=_0x158440[_0xee7d('0x2c')];break;default:_0xf7ed45[_0x53de17[_0x36a554][_0xee7d('0x28')]]=_0x29268e[_0x53de17[_0x36a554][_0xee7d('0x28')]];}}return _0xf7ed45[_0xee7d('0x2b')](',');}function _0xcb05d3(_0x4d2ad6,_0x1c14c4,_0x43367c){return new Promise(function(_0x45da24,_0x29047d){var _0x5a9954=[];if(_[_0xee7d('0x2f')](_0x1c14c4))return _0x45da24(_0x5a9954);_0x53a8c9['Interval'][_0xee7d('0x30')]({'attributes':['id','interval',_0xee7d('0x31')],'raw':!![]})[_0xee7d('0x32')](function(_0x1400eb){for(var _0x522b68=0x0,_0x39a069=0x0;_0x522b68<_0x1c14c4['length'];_0x522b68++,_0x39a069=0x0){var _0x4d5ddb=_0x1c14c4[_0x522b68];var _0x494c6a=[];var _0x1ce951=[];delete _0x4d5ddb['id'];if(_0x4d5ddb[_0xee7d('0x33')]!==_0xee7d('0x34')){_0x4d5ddb['intervals']=[_0x4d5ddb[_0xee7d('0x33')]];}else{_0x4d5ddb[_0xee7d('0x35')]=_0x4d5ddb['IntervalId']?_['map'](_[_0xee7d('0x36')](_0x1400eb,{'IntervalId':_0x4d5ddb[_0xee7d('0x31')]}),'interval'):[];}_0x4d5ddb[_0xee7d('0x7')]=_0x4d2ad6[_0xee7d('0x7')];_0x4d5ddb[_0xee7d('0x8')]=_0x4d2ad6['exten'];if(_0x4d5ddb['type'])_0x4d5ddb[_0xee7d('0x4')]=_0x4d5ddb[_0xee7d('0x4')][_0xee7d('0x37')]();if(_0x4d2ad6[_0xee7d('0x4')]===_0xee7d('0x12')){if(_0x4d5ddb[_0xee7d('0x1e')]('tag')&&_0x4d5ddb[_0xee7d('0x38')]&&_0x4d5ddb[_0xee7d('0x38')]!=='--'){_0x494c6a[_0xee7d('0xe')]({'type':_0x4d5ddb[_0xee7d('0x4')][_0xee7d('0x37')](),'app':_0xee7d('0x5'),'appdata':_0xee7d('0x39')+_0x4d5ddb[_0xee7d('0x38')],'context':_0x4d2ad6[_0xee7d('0x7')],'exten':_0x4d2ad6[_0xee7d('0x8')],'priority':_0x4d5ddb['intervals']['length']+_0x43367c+_0x39a069++,'VoiceExtensionId':_0x4d2ad6['id']});}_0x494c6a[_0xee7d('0xe')]({'type':_0x4d5ddb[_0xee7d('0x4')][_0xee7d('0x37')](),'app':_0xee7d('0x19'),'appdata':_0xee7d('0x3a')+(_0x4d5ddb[_0xee7d('0x3b')]?_0xee7d('0x3c')+_0x4d5ddb['callerID']+')':_0xee7d('0x3d')),'context':_0x4d2ad6['context'],'exten':_0x4d2ad6[_0xee7d('0x8')],'priority':_0x4d5ddb[_0xee7d('0x35')]['length']+_0x43367c+_0x39a069++,'VoiceExtensionId':_0x4d2ad6['id']});}else{if(_0x4d5ddb['hasOwnProperty']('answer')){if([_0xee7d('0x3e'),_0xee7d('0x3f')][_0xee7d('0x40')](_0x4d5ddb[_0xee7d('0x41')][_0xee7d('0x37')]())&&_0x4d5ddb['appType']!==_0xee7d('0x42')){if(_0x4d5ddb[_0xee7d('0x43')]){_0x494c6a[_0xee7d('0xe')]({'type':_0x4d5ddb[_0xee7d('0x4')][_0xee7d('0x37')](),'app':_0xee7d('0x19'),'appdata':_0xee7d('0x44'),'context':_0x4d2ad6[_0xee7d('0x7')],'exten':_0x4d2ad6['exten'],'priority':_0x4d5ddb[_0xee7d('0x35')][_0xee7d('0x25')]+_0x43367c+_0x39a069++,'VoiceExtensionId':_0x4d2ad6['id']});_0x494c6a[_0xee7d('0xe')]({'type':_0x4d5ddb[_0xee7d('0x4')][_0xee7d('0x37')](),'app':'Set','appdata':_0xee7d('0x45'),'context':_0x4d2ad6['context'],'exten':_0x4d2ad6['exten'],'priority':_0x4d5ddb[_0xee7d('0x35')]['length']+_0x43367c+_0x39a069++,'VoiceExtensionId':_0x4d2ad6['id']});}else{_0x494c6a[_0xee7d('0xe')]({'type':_0x4d5ddb[_0xee7d('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x4d2ad6[_0xee7d('0x7')],'exten':_0x4d2ad6[_0xee7d('0x8')],'priority':_0x4d5ddb[_0xee7d('0x35')][_0xee7d('0x25')]+_0x43367c+_0x39a069++,'VoiceExtensionId':_0x4d2ad6['id']});_0x494c6a[_0xee7d('0xe')]({'type':_0x4d5ddb['type'][_0xee7d('0x37')](),'app':_0xee7d('0x5'),'appdata':_0xee7d('0x46'),'context':_0x4d2ad6[_0xee7d('0x7')],'exten':_0x4d2ad6[_0xee7d('0x8')],'priority':_0x4d5ddb[_0xee7d('0x35')]['length']+_0x43367c+_0x39a069++,'VoiceExtensionId':_0x4d2ad6['id']});}}}}for(var _0x52c8f1=0x0;_0x52c8f1<_0x4d5ddb[_0xee7d('0x35')]['length'];_0x52c8f1++){var _0xe50b3=_0x43367c+_0x4d5ddb[_0xee7d('0x35')][_0xee7d('0x25')];var _0xa92874=_0x52c8f1===_0x4d5ddb['intervals']['length']-0x1?_0x43367c+_0x494c6a['length']+_0x1ce951[_0xee7d('0x25')]+0x2:_0x43367c+_0x52c8f1+0x1;_0x494c6a[_0xee7d('0x47')](_0x52c8f1,0x0,{'type':_0x4d2ad6[_0xee7d('0x4')],'app':_0xee7d('0x48'),'appdata':_0x4d5ddb['intervals'][_0x52c8f1]+'?'+_0x4d2ad6[_0xee7d('0x7')]+',${EXTEN},'+_0xe50b3+':'+_0x4d2ad6[_0xee7d('0x7')]+_0xee7d('0x49')+_0xa92874,'exten':_0x4d2ad6[_0xee7d('0x8')],'context':_0x4d2ad6[_0xee7d('0x7')],'priority':_0x43367c+_0x52c8f1,'VoiceExtensionId':_0x4d2ad6['id']});}if(_0x4d5ddb[_0xee7d('0x4a')]===_0xee7d('0x4b'))_0x4d5ddb[_0xee7d('0x4c')]=_0xd31202(_0x4d2ad6,_0x4d5ddb[_0xee7d('0x4c')]);_0x4d5ddb[_0xee7d('0x4d')]=_0x494c6a[_0xee7d('0x25')]?_[_0xee7d('0x4e')](_0x494c6a)[_0xee7d('0x4d')]+0x1:_0x43367c;_0x5a9954=_['concat'](_0x5a9954,_0x494c6a,[_0x4d5ddb],_0x1ce951);_0x43367c=_[_0xee7d('0x4e')](_0x5a9954)[_0xee7d('0x4d')]+0x1;}return _0x45da24(_0x5a9954);})[_0xee7d('0x4f')](function(_0x15c817){_0x29047d(_0x15c817);});});}return _0x58d2f9[_0xee7d('0x50')](_0xee7d('0x51'),attributes,{'tableName':_0xee7d('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5cd7ac){var _0x2a62bc=this[_0xee7d('0x53')]({'plain':!![]});var _0x493439=_0x2a62bc[_0xee7d('0x4')]===_0xee7d('0x12')?_0x2bcd81(_0x2a62bc):_0x2cd219(_0x2a62bc);return _0xcb05d3(_0x2a62bc,_0x5cd7ac,_[_0xee7d('0x4e')](_0x493439)[_0xee7d('0x4d')]+0x1)[_0xee7d('0x32')](function(_0x37197f){var _0x1bb2c0=_[_0xee7d('0x54')](_0x493439,_0x37197f);_0x1bb2c0['push']({'type':_0x2a62bc['type'],'app':_0xee7d('0x55'),'exten':_0x2a62bc[_0xee7d('0x8')],'context':_0x2a62bc[_0xee7d('0x7')],'priority':_[_0xee7d('0x4e')](_0x1bb2c0)[_0xee7d('0x4d')]+0x1,'VoiceExtensionId':_0x2a62bc['id']});return _0x1bb2c0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 459e7b3..8dc90dc 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 _0xdcf6=['request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','localhost','redis','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s'];(function(_0x36bf6b,_0x5dd433){var _0x20db61=function(_0x39267c){while(--_0x39267c){_0x36bf6b['push'](_0x36bf6b['shift']());}};_0x20db61(++_0x5dd433);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x40ff3b,_0x238af7){_0x40ff3b=_0x40ff3b-0x0;var _0x3ccf4f=_0xdcf6[_0x40ff3b];return _0x3ccf4f;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require(_0x6dcf('0x4'));var db=require(_0x6dcf('0x5'))['db'];var utils=require(_0x6dcf('0x6'));var logger=require('../../config/logger')(_0x6dcf('0x7'));var config=require(_0x6dcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6dcf('0x9')][_0x6dcf('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6dcf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dcf('0xc')]));require(_0x6dcf('0xd'))[_0x6dcf('0xe')](socket);function respondWithRpcPromise(_0x4eda69,_0x527a65,_0x5b65a7){return new BPromise(function(_0x443c93,_0x23f052){return client[_0x6dcf('0xf')](_0x4eda69,_0x5b65a7)['then'](function(_0x23fce1){logger[_0x6dcf('0x10')](_0x6dcf('0x11'),_0x527a65,_0x6dcf('0x12'));logger[_0x6dcf('0x13')](_0x6dcf('0x14'),_0x527a65,_0x6dcf('0x12'),JSON[_0x6dcf('0x15')](_0x23fce1));if(_0x23fce1[_0x6dcf('0x16')]){if(_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x17')]===0x1f4){logger[_0x6dcf('0x16')](_0x6dcf('0x11'),_0x527a65,_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);return _0x23f052(_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);}logger['error'](_0x6dcf('0x11'),_0x527a65,_0x23fce1[_0x6dcf('0x16')][_0x6dcf('0x18')]);return _0x443c93(_0x23fce1['error'][_0x6dcf('0x18')]);}else{logger[_0x6dcf('0x10')](_0x6dcf('0x11'),_0x527a65,_0x6dcf('0x12'));_0x443c93(_0x23fce1[_0x6dcf('0x19')][_0x6dcf('0x18')]);}})[_0x6dcf('0x1a')](function(_0x2b5cd4){logger['error'](_0x6dcf('0x11'),_0x527a65,_0x2b5cd4);_0x23f052(_0x2b5cd4);});});}exports[_0x6dcf('0x1b')]=function(_0x35c30b){var _0x2d2169=this;return new Promise(function(_0x3c9cbb,_0x200994){return db[_0x6dcf('0x1c')]['findAll']({'raw':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b['options'][_0x6dcf('0x1e')]===undefined?!![]:![]:!![],'where':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x1f')]||null:null,'attributes':_0x35c30b['options']?_0x35c30b['options'][_0x6dcf('0x20')]||null:null,'limit':_0x35c30b['options']?_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x21')]||null:null,'include':_0x35c30b[_0x6dcf('0x1d')]?_0x35c30b[_0x6dcf('0x1d')]['include']?_[_0x6dcf('0x22')](_0x35c30b[_0x6dcf('0x1d')][_0x6dcf('0x23')],function(_0x124853){return{'model':db[_0x124853['model']],'as':_0x124853['as'],'attributes':_0x124853[_0x6dcf('0x20')],'include':_0x124853[_0x6dcf('0x23')]?_[_0x6dcf('0x22')](_0x124853[_0x6dcf('0x23')],function(_0x16e8c4){return{'model':db[_0x16e8c4[_0x6dcf('0x24')]],'as':_0x16e8c4['as'],'attributes':_0x16e8c4[_0x6dcf('0x20')],'include':_0x16e8c4[_0x6dcf('0x23')]?_[_0x6dcf('0x22')](_0x16e8c4[_0x6dcf('0x23')],function(_0x2f9558){return{'model':db[_0x2f9558[_0x6dcf('0x24')]],'as':_0x2f9558['as'],'attributes':_0x2f9558['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dcf('0x25')](function(_0x1d3b73){logger['info']('GetVoiceExtension',_0x35c30b);logger['debug']('GetVoiceExtension',_0x35c30b,JSON[_0x6dcf('0x15')](_0x1d3b73));_0x3c9cbb(_0x1d3b73);})[_0x6dcf('0x1a')](function(_0x4c106c){logger[_0x6dcf('0x16')](_0x6dcf('0x1b'),_0x4c106c[_0x6dcf('0x18')],_0x35c30b);_0x200994(_0x2d2169[_0x6dcf('0x16')](0x1f4,_0x4c106c['message']));});});}; \ No newline at end of file +var _0x0a9f=['stringify','util','moment','ioredis','../../config/utils','client','http','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceExtension','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x13b950,_0x137cd1){var _0x5e3e80=function(_0x53bc9f){while(--_0x53bc9f){_0x13b950['push'](_0x13b950['shift']());}};_0x5e3e80(++_0x137cd1);}(_0x0a9f,0x64));var _0xf0a9=function(_0x114356,_0x561b7a){_0x114356=_0x114356-0x0;var _0xd46fa7=_0x0a9f[_0x114356];return _0xd46fa7;};'use strict';var _=require('lodash');var util=require(_0xf0a9('0x0'));var moment=require(_0xf0a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0a9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0a9('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf0a9('0x4')][_0xf0a9('0x5')]({'port':0x232a});config['redis']=_[_0xf0a9('0x6')](config['redis'],{'host':_0xf0a9('0x7'),'port':0x18eb});var socket=require(_0xf0a9('0x8'))(new Redis(config['redis']));require(_0xf0a9('0x9'))[_0xf0a9('0xa')](socket);function respondWithRpcPromise(_0x43cd20,_0x5f5128,_0x46b44b){return new BPromise(function(_0x4be957,_0x12c9ea){return client[_0xf0a9('0xb')](_0x43cd20,_0x46b44b)[_0xf0a9('0xc')](function(_0x148f81){logger['info'](_0xf0a9('0xd'),_0x5f5128,_0xf0a9('0xe'));logger[_0xf0a9('0xf')](_0xf0a9('0x10'),_0x5f5128,'request\x20sent',JSON['stringify'](_0x148f81));if(_0x148f81[_0xf0a9('0x11')]){if(_0x148f81[_0xf0a9('0x11')][_0xf0a9('0x12')]===0x1f4){logger[_0xf0a9('0x11')](_0xf0a9('0xd'),_0x5f5128,_0x148f81[_0xf0a9('0x11')][_0xf0a9('0x13')]);return _0x12c9ea(_0x148f81['error'][_0xf0a9('0x13')]);}logger[_0xf0a9('0x11')](_0xf0a9('0xd'),_0x5f5128,_0x148f81['error'][_0xf0a9('0x13')]);return _0x4be957(_0x148f81['error'][_0xf0a9('0x13')]);}else{logger[_0xf0a9('0x14')](_0xf0a9('0xd'),_0x5f5128,_0xf0a9('0xe'));_0x4be957(_0x148f81[_0xf0a9('0x15')][_0xf0a9('0x13')]);}})[_0xf0a9('0x16')](function(_0x194d5f){logger[_0xf0a9('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x5f5128,_0x194d5f);_0x12c9ea(_0x194d5f);});});}exports[_0xf0a9('0x17')]=function(_0x18ea6a){var _0x299500=this;return new Promise(function(_0x558f26,_0x42e7f3){return db['VoiceExtension'][_0xf0a9('0x18')]({'raw':_0x18ea6a[_0xf0a9('0x19')]?_0x18ea6a['options'][_0xf0a9('0x1a')]===undefined?!![]:![]:!![],'where':_0x18ea6a[_0xf0a9('0x19')]?_0x18ea6a[_0xf0a9('0x19')]['where']||null:null,'attributes':_0x18ea6a[_0xf0a9('0x19')]?_0x18ea6a[_0xf0a9('0x19')][_0xf0a9('0x1b')]||null:null,'limit':_0x18ea6a[_0xf0a9('0x19')]?_0x18ea6a[_0xf0a9('0x19')][_0xf0a9('0x1c')]||null:null,'include':_0x18ea6a[_0xf0a9('0x19')]?_0x18ea6a['options']['include']?_['map'](_0x18ea6a[_0xf0a9('0x19')][_0xf0a9('0x1d')],function(_0x1064cf){return{'model':db[_0x1064cf['model']],'as':_0x1064cf['as'],'attributes':_0x1064cf[_0xf0a9('0x1b')],'include':_0x1064cf[_0xf0a9('0x1d')]?_[_0xf0a9('0x1e')](_0x1064cf[_0xf0a9('0x1d')],function(_0x17193c){return{'model':db[_0x17193c[_0xf0a9('0x1f')]],'as':_0x17193c['as'],'attributes':_0x17193c['attributes'],'include':_0x17193c[_0xf0a9('0x1d')]?_[_0xf0a9('0x1e')](_0x17193c[_0xf0a9('0x1d')],function(_0x1f24a2){return{'model':db[_0x1f24a2[_0xf0a9('0x1f')]],'as':_0x1f24a2['as'],'attributes':_0x1f24a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0a9('0xc')](function(_0x583427){logger['info']('GetVoiceExtension',_0x18ea6a);logger['debug'](_0xf0a9('0x17'),_0x18ea6a,JSON[_0xf0a9('0x20')](_0x583427));_0x558f26(_0x583427);})[_0xf0a9('0x16')](function(_0x5d2a12){logger[_0xf0a9('0x11')]('GetVoiceExtension',_0x5d2a12[_0xf0a9('0x13')],_0x18ea6a);_0x42e7f3(_0x299500[_0xf0a9('0x11')](0x1f4,_0x5d2a12['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 76cdab6..afad596 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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x5053c6,_0x4fe813){var _0x8f3e43=function(_0x1ef077){while(--_0x1ef077){_0x5053c6['push'](_0x5053c6['shift']());}};_0x8f3e43(++_0x4fe813);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file +var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x3e377a,_0x292976){var _0x5a70a8=function(_0x5c5f1b){while(--_0x5c5f1b){_0x3e377a['push'](_0x3e377a['shift']());}};_0x5a70a8(++_0x292976);}(_0xf494,0x1c6));var _0x4f49=function(_0x428316,_0x10beac){_0x428316=_0x428316-0x0;var _0x509e87=_0xf494[_0x428316];return _0x509e87;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 8eeae9b..089713d 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 _0x2675=['post','create','update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x295ba5,_0x19f6b0){var _0x317758=function(_0x1bc144){while(--_0x1bc144){_0x295ba5['push'](_0x295ba5['shift']());}};_0x317758(++_0x19f6b0);}(_0x2675,0x75));var _0x5267=function(_0x2794a1,_0x50a460){_0x2794a1=_0x2794a1-0x0;var _0x5c4963=_0x2675[_0x2794a1];return _0x5c4963;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id/messages',auth[_0x5267('0x7')](),controller['getMessages']);router[_0x5267('0xb')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xc')]);router['put'](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xd')]);router['delete'](_0x5267('0x9'),auth[_0x5267('0x7')](),controller[_0x5267('0xe')]);module[_0x5267('0xf')]=router; \ No newline at end of file +var _0x27a0=['exports','util','path','connect-timeout','express','Router','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','put','update','delete','destroy'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x27a0,0xbf));var _0x027a=function(_0x22708b,_0x2bee57){_0x22708b=_0x22708b-0x0;var _0x3e0055=_0x27a0[_0x22708b];return _0x3e0055;};'use strict';var multer=require('multer');var util=require(_0x027a('0x0'));var path=require(_0x027a('0x1'));var timeout=require(_0x027a('0x2'));var express=require(_0x027a('0x3'));var router=express[_0x027a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x027a('0x5'));router[_0x027a('0x6')]('/',auth[_0x027a('0x7')](),controller[_0x027a('0x8')]);router[_0x027a('0x6')](_0x027a('0x9'),auth['isAuthenticated'](),controller[_0x027a('0xa')]);router[_0x027a('0x6')](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0xc')]);router[_0x027a('0xd')]('/',auth[_0x027a('0x7')](),controller['create']);router[_0x027a('0xe')](_0x027a('0x9'),auth[_0x027a('0x7')](),controller[_0x027a('0xf')]);router[_0x027a('0x10')](_0x027a('0x9'),auth[_0x027a('0x7')](),controller[_0x027a('0x11')]);module[_0x027a('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 451365c..a5363bb 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 _0x088c=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x088c,0x6e));var _0xc088=function(_0x392b80,_0xc38876){_0x392b80=_0x392b80-0x0;var _0x4aeec6=_0x088c[_0x392b80];return _0x4aeec6;};'use strict';var Sequelize=require(_0xc088('0x0'));module[_0xc088('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc088('0x2')],'defaultValue':_0xc088('0x3'),'unique':_0xc088('0x4')},'mailbox':{'type':Sequelize[_0xc088('0x2')],'defaultValue':'','allowNull':![],'unique':_0xc088('0x4')},'password':{'type':Sequelize[_0xc088('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc088('0x2')],'validate':{'isEmail':!![]},'set':function(_0x18250e){this[_0xc088('0x5')](_0xc088('0x6'),typeof _0x18250e===_0xc088('0x7')&&_0x18250e[_0xc088('0x8')]()?_0x18250e['trim']():null);}},'pager':{'type':Sequelize[_0xc088('0x2')]},'tz':{'type':Sequelize[_0xc088('0x2')],'defaultValue':_0xc088('0x9')},'attach':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc088('0x2')]},'callback':{'type':Sequelize[_0xc088('0x2')]},'review':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc088('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xc088('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc088('0xa')](_0xc088('0xb'),'no'),'defaultValue':_0xc088('0xb'),'allowNull':![]},'stamp':{'type':_0xc088('0xd')},'emailsubject':{'type':Sequelize[_0xc088('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xc088('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc088('0xf')],'get':function(){return this[_0xc088('0x10')](_0xc088('0x11'))+_0xc088('0x12')+this[_0xc088('0x10')](_0xc088('0x13'));}}}; \ No newline at end of file +var _0xd9a8=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x26f8a4,_0x545b7b){var _0x37bfb1=function(_0x2b4895){while(--_0x2b4895){_0x26f8a4['push'](_0x26f8a4['shift']());}};_0x37bfb1(++_0x545b7b);}(_0xd9a8,0x15a));var _0x8d9a=function(_0x57a97a,_0x3672e9){_0x57a97a=_0x57a97a-0x0;var _0x12a961=_0xd9a8[_0x57a97a];return _0x12a961;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x8d9a('0x0')]},'context':{'type':Sequelize[_0x8d9a('0x0')],'defaultValue':_0x8d9a('0x1'),'unique':_0x8d9a('0x2')},'mailbox':{'type':Sequelize[_0x8d9a('0x0')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8d9a('0x0')]},'email':{'type':Sequelize[_0x8d9a('0x0')],'validate':{'isEmail':!![]},'set':function(_0x47f3ba){this[_0x8d9a('0x3')](_0x8d9a('0x4'),typeof _0x47f3ba===_0x8d9a('0x5')&&_0x47f3ba['trim']()?_0x47f3ba[_0x8d9a('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x8d9a('0x0')],'defaultValue':_0x8d9a('0x7')},'attach':{'type':Sequelize[_0x8d9a('0x8')]('yes','no'),'defaultValue':_0x8d9a('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x8d9a('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8d9a('0x0')]},'callback':{'type':Sequelize[_0x8d9a('0x0')]},'review':{'type':Sequelize[_0x8d9a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8d9a('0x8')](_0x8d9a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8d9a('0x8')](_0x8d9a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8d9a('0x8')](_0x8d9a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8d9a('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8d9a('0x8')](_0x8d9a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8d9a('0x8')](_0x8d9a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x8d9a('0x9'),'no'),'defaultValue':_0x8d9a('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8d9a('0x8')](_0x8d9a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8d9a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x8d9a('0x9'),'no'),'defaultValue':_0x8d9a('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x8d9a('0x0')]},'emailbody':{'type':Sequelize[_0x8d9a('0x0')]},'maxsecs':{'type':Sequelize[_0x8d9a('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8d9a('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8d9a('0xc')],'get':function(){return this[_0x8d9a('0xd')](_0x8d9a('0xe'))+_0x8d9a('0xf')+this[_0x8d9a('0xd')](_0x8d9a('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 62105ef..3b7b042 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 _0x5ec6=['map','VoiceMail','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','hasOwnProperty','order','sort','pick','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x5ec6,0x7f));var _0x65ec=function(_0x28c512,_0x392d69){_0x28c512=_0x28c512-0x0;var _0x5d39d0=_0x5ec6[_0x28c512];return _0x5d39d0;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){var _0x13ac27=_0x58239f[_0x65ec('0x25')]({'plain':!![]});var _0x288e66=_0x65ec('0x26');return db[_0x65ec('0x27')][_0x65ec('0x24')]({'where':{'type':_0x288e66,'resourceId':_0x13ac27['id']}})[_0x65ec('0x23')](function(){return _0x58239f;});})['then'](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x251831,_0x23b1a3){return function(_0x4de451){if(!_0x4de451){_0x251831[_0x65ec('0x15')](0x194);}return _0x4de451;};}function handleError(_0x588fe4,_0x37489f){_0x37489f=_0x37489f||0x1f4;return function(_0x1ada47){logger[_0x65ec('0x28')](_0x1ada47[_0x65ec('0x29')]);if(_0x1ada47[_0x65ec('0x2a')]){delete _0x1ada47[_0x65ec('0x2a')];}_0x588fe4[_0x65ec('0x16')](_0x37489f)[_0x65ec('0x2b')](_0x1ada47);};}exports[_0x65ec('0x2c')]=function(_0xeec5d4,_0x3c97e2){var _0x4b435c={},_0x50d81f={},_0x1d2e24={'count':0x0,'rows':[]};var _0x5084af=_[_0x65ec('0x2d')](db[_0x65ec('0x2e')]['rawAttributes'],function(_0x1dd1c0){return{'name':_0x1dd1c0[_0x65ec('0x2f')],'type':_0x1dd1c0[_0x65ec('0x30')][_0x65ec('0x31')]};});_0x50d81f['model']=_[_0x65ec('0x2d')](_0x5084af,_0x65ec('0x2a'));_0x50d81f[_0x65ec('0x32')]=_[_0x65ec('0x33')](_0xeec5d4[_0x65ec('0x32')]);_0x50d81f[_0x65ec('0x34')]=_[_0x65ec('0x35')](_0x50d81f[_0x65ec('0x36')],_0x50d81f[_0x65ec('0x32')]);_0x4b435c[_0x65ec('0x37')]=_['intersection'](_0x50d81f[_0x65ec('0x36')],qs[_0x65ec('0x38')](_0xeec5d4['query'][_0x65ec('0x38')]));_0x4b435c[_0x65ec('0x37')]=_0x4b435c[_0x65ec('0x37')][_0x65ec('0x39')]?_0x4b435c[_0x65ec('0x37')]:_0x50d81f[_0x65ec('0x36')];if(!_0xeec5d4[_0x65ec('0x32')]['hasOwnProperty'](_0x65ec('0x3a'))){_0x4b435c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0xeec5d4[_0x65ec('0x32')]['limit']);_0x4b435c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0xeec5d4[_0x65ec('0x32')][_0x65ec('0x19')]);}_0x4b435c['order']=qs['sort'](_0xeec5d4[_0x65ec('0x32')]['sort']);_0x4b435c[_0x65ec('0x3b')]=qs[_0x65ec('0x34')](_['pick'](_0xeec5d4[_0x65ec('0x32')],_0x50d81f[_0x65ec('0x34')]),_0x5084af);if(_0xeec5d4[_0x65ec('0x32')][_0x65ec('0x3c')]){_0x4b435c[_0x65ec('0x3b')]=_[_0x65ec('0x3d')](_0x4b435c[_0x65ec('0x3b')],{'$or':_[_0x65ec('0x2d')](_0x5084af,function(_0x470bb3){if(_0x470bb3[_0x65ec('0x30')]!==_0x65ec('0x3e')){var _0x5cdb0f={};_0x5cdb0f[_0x470bb3[_0x65ec('0x2a')]]={'$like':'%'+_0xeec5d4['query'][_0x65ec('0x3c')]+'%'};return _0x5cdb0f;}})});}_0x4b435c=_[_0x65ec('0x3d')]({},_0x4b435c,_0xeec5d4[_0x65ec('0x3f')]);var _0x1bfc44={'where':_0x4b435c[_0x65ec('0x3b')]};return db[_0x65ec('0x2e')]['count'](_0x1bfc44)[_0x65ec('0x23')](function(_0x4ba7df){_0x1d2e24['count']=_0x4ba7df;if(_0xeec5d4[_0x65ec('0x32')][_0x65ec('0x40')]){_0x4b435c[_0x65ec('0x41')]=[{'all':!![]}];}return db[_0x65ec('0x2e')][_0x65ec('0x42')](_0x4b435c);})['then'](function(_0x4843ca){_0x1d2e24[_0x65ec('0x43')]=_0x4843ca;return _0x1d2e24;})[_0x65ec('0x23')](respondWithFilteredResult(_0x3c97e2,_0x4b435c))[_0x65ec('0x44')](handleError(_0x3c97e2,null));};exports[_0x65ec('0x45')]=function(_0x11edd1,_0x55642b){var _0x5c8bfd={'raw':!![],'where':{'id':_0x11edd1[_0x65ec('0x46')]['id']}},_0x38d1fe={};_0x38d1fe[_0x65ec('0x36')]=_[_0x65ec('0x33')](db[_0x65ec('0x2e')][_0x65ec('0x47')]);_0x38d1fe[_0x65ec('0x32')]=_['keys'](_0x11edd1[_0x65ec('0x32')]);_0x38d1fe[_0x65ec('0x34')]=_[_0x65ec('0x35')](_0x38d1fe['model'],_0x38d1fe[_0x65ec('0x32')]);_0x5c8bfd[_0x65ec('0x37')]=_['intersection'](_0x38d1fe[_0x65ec('0x36')],qs[_0x65ec('0x38')](_0x11edd1[_0x65ec('0x32')][_0x65ec('0x38')]));_0x5c8bfd[_0x65ec('0x37')]=_0x5c8bfd['attributes'][_0x65ec('0x39')]?_0x5c8bfd[_0x65ec('0x37')]:_0x38d1fe[_0x65ec('0x36')];if(_0x11edd1[_0x65ec('0x32')]['includeAll']){_0x5c8bfd[_0x65ec('0x41')]=[{'all':!![]}];}_0x5c8bfd=_['merge']({},_0x5c8bfd,_0x11edd1[_0x65ec('0x3f')]);return db[_0x65ec('0x2e')][_0x65ec('0x48')](_0x5c8bfd)['then'](handleEntityNotFound(_0x55642b,null))['then'](respondWithResult(_0x55642b,null))[_0x65ec('0x44')](handleError(_0x55642b,null));};exports[_0x65ec('0x49')]=function(_0xf5419,_0x2111af){return db[_0x65ec('0x2e')][_0x65ec('0x49')](_0xf5419[_0x65ec('0x4a')],{})[_0x65ec('0x23')](function(_0x590b5a){var _0x646e97=_0xf5419[_0x65ec('0x4b')][_0x65ec('0x25')]({'plain':!![]});if(!_0x646e97)throw new Error(_0x65ec('0x4c'));if(_0x646e97[_0x65ec('0x4d')]===_0x65ec('0x4b')){var _0x14eaef=_0x590b5a[_0x65ec('0x25')]({'plain':!![]});var _0x5eb6d3=_0x65ec('0x26');return db[_0x65ec('0x4e')]['find']({'where':{'name':_0x5eb6d3,'userProfileId':_0x646e97[_0x65ec('0x4f')]},'raw':!![]})[_0x65ec('0x23')](function(_0x3e963d){if(_0x3e963d&&_0x3e963d['autoAssociation']===0x0){return db[_0x65ec('0x27')][_0x65ec('0x49')]({'name':_0x14eaef[_0x65ec('0x2a')],'resourceId':_0x14eaef['id'],'type':_0x3e963d['name'],'sectionId':_0x3e963d['id']},{})[_0x65ec('0x23')](function(){return _0x590b5a;});}else{return _0x590b5a;}})['catch'](function(_0x4c9905){logger[_0x65ec('0x28')](_0x65ec('0x50'),_0x4c9905);throw _0x4c9905;});}return _0x590b5a;})[_0x65ec('0x23')](respondWithResult(_0x2111af,0xc9))['catch'](handleError(_0x2111af,null));};exports[_0x65ec('0x22')]=function(_0x28a686,_0x29f88){if(_0x28a686[_0x65ec('0x4a')]['id']){delete _0x28a686[_0x65ec('0x4a')]['id'];}return db[_0x65ec('0x2e')][_0x65ec('0x48')]({'where':{'id':_0x28a686[_0x65ec('0x46')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x29f88,null))['then'](saveUpdates(_0x28a686['body'],null))[_0x65ec('0x23')](respondWithResult(_0x29f88,null))['catch'](handleError(_0x29f88,null));};exports[_0x65ec('0x24')]=function(_0x592838,_0x347336){return db[_0x65ec('0x2e')][_0x65ec('0x48')]({'where':{'id':_0x592838[_0x65ec('0x46')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x347336,null))[_0x65ec('0x23')](removeEntity(_0x347336,null))[_0x65ec('0x44')](handleError(_0x347336,null));};exports['getMessages']=function(_0x2c7657,_0x474bc0,_0x1b5356){return db[_0x65ec('0x2e')][_0x65ec('0x51')]({'where':{'id':_0x2c7657['params']['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x474bc0,null))[_0x65ec('0x23')](function(_0xb85e9a){var _0x411d72;var _0x44fbba={},_0x3f2fd3={};_0x3f2fd3[_0x65ec('0x36')]=_[_0x65ec('0x33')](db['VoiceMailMessage'][_0x65ec('0x47')]);_0x3f2fd3[_0x65ec('0x32')]=_[_0x65ec('0x33')](_0x2c7657[_0x65ec('0x32')]);_0x3f2fd3[_0x65ec('0x34')]=_[_0x65ec('0x35')](_0x3f2fd3[_0x65ec('0x36')],_0x3f2fd3['query']);_0x44fbba['attributes']=_[_0x65ec('0x35')](_0x3f2fd3['model'],qs[_0x65ec('0x38')](_0x2c7657[_0x65ec('0x32')]['fields']));_0x44fbba[_0x65ec('0x37')]=_0x44fbba[_0x65ec('0x37')][_0x65ec('0x39')]?_0x44fbba[_0x65ec('0x37')]:_0x3f2fd3[_0x65ec('0x36')];if(!_0x2c7657[_0x65ec('0x32')][_0x65ec('0x52')]('nolimit')){_0x44fbba['limit']=qs[_0x65ec('0x1b')](_0x2c7657[_0x65ec('0x32')][_0x65ec('0x1b')]);_0x44fbba['offset']=qs[_0x65ec('0x19')](_0x2c7657[_0x65ec('0x32')][_0x65ec('0x19')]);}_0x44fbba[_0x65ec('0x53')]=qs[_0x65ec('0x54')](_0x2c7657[_0x65ec('0x32')][_0x65ec('0x54')]);_0x44fbba['where']=qs[_0x65ec('0x34')](_[_0x65ec('0x55')](_0x2c7657[_0x65ec('0x32')],_0x3f2fd3[_0x65ec('0x34')]));if(_0x2c7657[_0x65ec('0x32')][_0x65ec('0x3c')]){_0x44fbba[_0x65ec('0x3b')]=_[_0x65ec('0x3d')](_0x44fbba[_0x65ec('0x3b')],{'$or':_['map'](_0x44fbba['attributes'],function(_0x41d28d){var _0x484f5a={};_0x484f5a[_0x41d28d]={'$like':'%'+_0x2c7657['query'][_0x65ec('0x3c')]+'%'};return _0x484f5a;})});}_0x44fbba[_0x65ec('0x3b')]=_[_0x65ec('0x3d')](_0x44fbba['where'],{'mailboxuser':_0xb85e9a['mailbox']});_0x44fbba=_[_0x65ec('0x3d')]({},_0x44fbba,_0x2c7657['options']);return db['VoiceMailMessage']['findAndCountAll'](_0x44fbba)[_0x65ec('0x23')](respondWithFilteredResult(_0x474bc0,_0x44fbba));})['catch'](handleError(_0x474bc0,null));}; \ No newline at end of file +var _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x44c09c,_0x225ba3){var _0x4da5c8=function(_0x322e31){while(--_0x322e31){_0x44c09c['push'](_0x44c09c['shift']());}};_0x4da5c8(++_0x225ba3);}(_0x236c,0x155));var _0xc236=function(_0x59f4c7,_0x2bb9dd){_0x59f4c7=_0x59f4c7-0x0;var _0x174eab=_0x236c[_0x59f4c7];return _0x174eab;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c47d25e..4a204ff 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 _0xc882=['moment','bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','context','lodash','util','../../config/logger'];(function(_0x299e86,_0x4fef4c){var _0x75a094=function(_0x19a43a){while(--_0x19a43a){_0x299e86['push'](_0x299e86['shift']());}};_0x75a094(++_0x4fef4c);}(_0xc882,0x1d1));var _0x2c88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc882[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2c88('0x0'));var util=require(_0x2c88('0x1'));var logger=require(_0x2c88('0x2'))('api');var moment=require(_0x2c88('0x3'));var BPromise=require(_0x2c88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c88('0x5'));var config=require(_0x2c88('0x6'));var attributes=require(_0x2c88('0x7'));module[_0x2c88('0x8')]=function(_0x140688,_0x47dbfc){return _0x140688['define'](_0x2c88('0x9'),attributes,{'tableName':_0x2c88('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x2c88('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4a7=['exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x16e0eb,_0x48410a){var _0x2fd457=function(_0x551f9a){while(--_0x551f9a){_0x16e0eb['push'](_0x16e0eb['shift']());}};_0x2fd457(++_0x48410a);}(_0xc4a7,0x19e));var _0x7c4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var logger=require(_0x7c4a('0x2'))(_0x7c4a('0x3'));var moment=require(_0x7c4a('0x4'));var BPromise=require(_0x7c4a('0x5'));var rp=require(_0x7c4a('0x6'));var fs=require('fs');var path=require(_0x7c4a('0x7'));var rimraf=require(_0x7c4a('0x8'));var config=require(_0x7c4a('0x9'));var attributes=require(_0x7c4a('0xa'));module[_0x7c4a('0xb')]=function(_0x1e281d,_0x4aafe0){return _0x1e281d[_0x7c4a('0xc')]('VoiceMail',attributes,{'tableName':_0x7c4a('0xd'),'paranoid':![],'indexes':[{'name':_0x7c4a('0xe'),'fields':[_0x7c4a('0xf'),_0x7c4a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 3693633..d42fec3 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 _0x4c79=['info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x52f975,_0x305404){var _0x1b15a3=function(_0x5e9a63){while(--_0x5e9a63){_0x52f975['push'](_0x52f975['shift']());}};_0x1b15a3(++_0x305404);}(_0x4c79,0x153));var _0x94c7=function(_0x2a4f19,_0x2e4e36){_0x2a4f19=_0x2a4f19-0x0;var _0x5eeefe=_0x4c79[_0x2a4f19];return _0x5eeefe;};'use strict';var _=require(_0x94c7('0x0'));var util=require(_0x94c7('0x1'));var moment=require(_0x94c7('0x2'));var BPromise=require(_0x94c7('0x3'));var rs=require(_0x94c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94c7('0x6'))(_0x94c7('0x7'));var config=require('../../config/environment');var jayson=require(_0x94c7('0x8'));var client=jayson[_0x94c7('0x9')][_0x94c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ab503,_0x5d32a5,_0x4a549d){return new BPromise(function(_0x52ffbf,_0x3ac7dd){return client[_0x94c7('0xb')](_0x5ab503,_0x4a549d)[_0x94c7('0xc')](function(_0x5185d9){logger[_0x94c7('0xd')](_0x94c7('0xe'),_0x5d32a5,_0x94c7('0xf'));logger[_0x94c7('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5d32a5,_0x94c7('0xf'),JSON[_0x94c7('0x11')](_0x5185d9));if(_0x5185d9[_0x94c7('0x12')]){if(_0x5185d9[_0x94c7('0x12')][_0x94c7('0x13')]===0x1f4){logger['error'](_0x94c7('0xe'),_0x5d32a5,_0x5185d9[_0x94c7('0x12')]['message']);return _0x3ac7dd(_0x5185d9[_0x94c7('0x12')][_0x94c7('0x14')]);}logger[_0x94c7('0x12')](_0x94c7('0xe'),_0x5d32a5,_0x5185d9['error']['message']);return _0x52ffbf(_0x5185d9[_0x94c7('0x12')][_0x94c7('0x14')]);}else{logger['info'](_0x94c7('0xe'),_0x5d32a5,_0x94c7('0xf'));_0x52ffbf(_0x5185d9[_0x94c7('0x15')][_0x94c7('0x14')]);}})['catch'](function(_0xa13b06){logger[_0x94c7('0x12')]('VoiceMail,\x20%s,\x20%s',_0x5d32a5,_0xa13b06);_0x3ac7dd(_0xa13b06);});});} \ No newline at end of file +var _0x7d30=['request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x39f50f,_0x538733){var _0x44e365=function(_0x19eb51){while(--_0x19eb51){_0x39f50f['push'](_0x39f50f['shift']());}};_0x44e365(++_0x538733);}(_0x7d30,0x16c));var _0x07d3=function(_0x41eb25,_0x51bf40){_0x41eb25=_0x41eb25-0x0;var _0x36a332=_0x7d30[_0x41eb25];return _0x36a332;};'use strict';var _=require('lodash');var util=require(_0x07d3('0x0'));var moment=require('moment');var BPromise=require(_0x07d3('0x1'));var rs=require(_0x07d3('0x2'));var fs=require('fs');var Redis=require(_0x07d3('0x3'));var db=require(_0x07d3('0x4'))['db'];var utils=require(_0x07d3('0x5'));var logger=require(_0x07d3('0x6'))(_0x07d3('0x7'));var config=require(_0x07d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x07d3('0x9')][_0x07d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b7684,_0x581903,_0x299ef0){return new BPromise(function(_0x5e8e97,_0x4543d9){return client['request'](_0x3b7684,_0x299ef0)[_0x07d3('0xb')](function(_0x5d35fe){logger[_0x07d3('0xc')](_0x07d3('0xd'),_0x581903,_0x07d3('0xe'));logger[_0x07d3('0xf')](_0x07d3('0x10'),_0x581903,_0x07d3('0xe'),JSON['stringify'](_0x5d35fe));if(_0x5d35fe[_0x07d3('0x11')]){if(_0x5d35fe[_0x07d3('0x11')]['code']===0x1f4){logger['error'](_0x07d3('0xd'),_0x581903,_0x5d35fe[_0x07d3('0x11')][_0x07d3('0x12')]);return _0x4543d9(_0x5d35fe[_0x07d3('0x11')]['message']);}logger[_0x07d3('0x11')](_0x07d3('0xd'),_0x581903,_0x5d35fe[_0x07d3('0x11')][_0x07d3('0x12')]);return _0x5e8e97(_0x5d35fe[_0x07d3('0x11')][_0x07d3('0x12')]);}else{logger[_0x07d3('0xc')](_0x07d3('0xd'),_0x581903,_0x07d3('0xe'));_0x5e8e97(_0x5d35fe[_0x07d3('0x13')][_0x07d3('0x12')]);}})[_0x07d3('0x14')](function(_0x2c36a1){logger['error'](_0x07d3('0xd'),_0x581903,_0x2c36a1);_0x4543d9(_0x2c36a1);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f182cac..a04af48 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 _0xd4cd=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd4cd,0xa4));var _0xdd4c=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0xd4cd[_0x5400a1];return _0x4006c7;};'use strict';var multer=require(_0xdd4c('0x0'));var util=require(_0xdd4c('0x1'));var path=require(_0xdd4c('0x2'));var timeout=require(_0xdd4c('0x3'));var express=require(_0xdd4c('0x4'));var router=express[_0xdd4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdd4c('0x6'));var interaction=require(_0xdd4c('0x7'));var config=require('../../config/environment');var controller=require(_0xdd4c('0x8'));router[_0xdd4c('0x9')]('/',auth[_0xdd4c('0xa')](),controller[_0xdd4c('0xb')]);router[_0xdd4c('0x9')](_0xdd4c('0xc'),auth['isAuthenticated'](),controller[_0xdd4c('0xd')]);router[_0xdd4c('0x9')](_0xdd4c('0xe'),auth['isAuthenticated'](),controller[_0xdd4c('0xf')]);router[_0xdd4c('0x10')]('/',auth[_0xdd4c('0xa')](),controller[_0xdd4c('0x11')]);router['put'](_0xdd4c('0xc'),auth[_0xdd4c('0xa')](),controller[_0xdd4c('0x12')]);router[_0xdd4c('0x13')](_0xdd4c('0xc'),auth[_0xdd4c('0xa')](),controller['destroy']);module[_0xdd4c('0x14')]=router; \ No newline at end of file +var _0xaef1=['get','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index'];(function(_0x390cae,_0x20c9df){var _0x52e81e=function(_0x5c5d89){while(--_0x5c5d89){_0x390cae['push'](_0x390cae['shift']());}};_0x52e81e(++_0x20c9df);}(_0xaef1,0x1ee));var _0x1aef=function(_0x3cf147,_0x10c562){_0x3cf147=_0x3cf147-0x0;var _0xdbe9f1=_0xaef1[_0x3cf147];return _0xdbe9f1;};'use strict';var multer=require(_0x1aef('0x0'));var util=require('util');var path=require(_0x1aef('0x1'));var timeout=require(_0x1aef('0x2'));var express=require(_0x1aef('0x3'));var router=express['Router']();var fs_extra=require(_0x1aef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1aef('0x5'));var config=require(_0x1aef('0x6'));var controller=require(_0x1aef('0x7'));router['get']('/',auth[_0x1aef('0x8')](),controller[_0x1aef('0x9')]);router[_0x1aef('0xa')](_0x1aef('0xb'),auth[_0x1aef('0x8')](),controller[_0x1aef('0xc')]);router[_0x1aef('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x1aef('0xd')]);router[_0x1aef('0xe')]('/',auth[_0x1aef('0x8')](),controller[_0x1aef('0xf')]);router[_0x1aef('0x10')](_0x1aef('0xb'),auth[_0x1aef('0x8')](),controller[_0x1aef('0x11')]);router[_0x1aef('0x12')](_0x1aef('0xb'),auth[_0x1aef('0x8')](),controller[_0x1aef('0x13')]);module[_0x1aef('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6efc04c..9695b78 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 _0x2f06=['STRING','BLOB','TIMESTAMP','literal','sequelize','VIRTUAL','INTEGER'];(function(_0x4a7bbe,_0x28129e){var _0x29ac9a=function(_0x354f85){while(--_0x354f85){_0x4a7bbe['push'](_0x4a7bbe['shift']());}};_0x29ac9a(++_0x28129e);}(_0x2f06,0x19a));var _0x62f0=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x2f06[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x62f0('0x0'));module['exports']={'name':{'type':Sequelize[_0x62f0('0x1')],'get':function(_0x455c06){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x62f0('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x62f0('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x62f0('0x3')],'defaultValue':''},'stamp':{'type':_0x62f0('0x5'),'defaultValue':Sequelize[_0x62f0('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x6009=['INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue'];(function(_0x52ae7c,_0xaa8699){var _0x1e4f3c=function(_0xdb1a0a){while(--_0xdb1a0a){_0x52ae7c['push'](_0x52ae7c['shift']());}};_0x1e4f3c(++_0xaa8699);}(_0x6009,0x9f));var _0x9600=function(_0x3a3f6d,_0x42965a){_0x3a3f6d=_0x3a3f6d-0x0;var _0x324bbe=_0x6009[_0x3a3f6d];return _0x324bbe;};'use strict';var Sequelize=require(_0x9600('0x0'));module[_0x9600('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x27caff){return this[_0x9600('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x9600('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x9600('0x5')](_0x9600('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9600('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x9600('0x7')](_0x9600('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 66303e5..0c37cd0 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 _0x36bc=['attachment;\x20filename=\x22','.wav\x22','recording','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','download','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition'];(function(_0x18690e,_0x3d2ae2){var _0x1ab666=function(_0x553b4e){while(--_0x553b4e){_0x18690e['push'](_0x18690e['shift']());}};_0x1ab666(++_0x3d2ae2);}(_0x36bc,0x102));var _0xc36b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x36bc[_0x433a86];return _0x23000c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc36b('0x0'));var zipdir=require(_0xc36b('0x1'));var jsonpatch=require(_0xc36b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc36b('0x3'));var Mustache=require(_0xc36b('0x4'));var util=require(_0xc36b('0x5'));var path=require(_0xc36b('0x6'));var sox=require('sox');var csv=require(_0xc36b('0x7'));var ejs=require(_0xc36b('0x8'));var fs=require('fs');var fs_extra=require(_0xc36b('0x9'));var _=require('lodash');var squel=require(_0xc36b('0xa'));var crypto=require('crypto');var jsforce=require(_0xc36b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc36b('0x7'));var querystring=require(_0xc36b('0xc'));var Papa=require(_0xc36b('0xd'));var Redis=require(_0xc36b('0xe'));var authService=require(_0xc36b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc36b('0x10'));var hardwareService=require(_0xc36b('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc36b('0x12'));var config=require(_0xc36b('0x13'));var licenseUtil=require(_0xc36b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496da8,_0x2a0c60){_0x2a0c60=_0x2a0c60||0xcc;return function(_0x2118d6){if(_0x2118d6){return _0x496da8['sendStatus'](_0x2a0c60);}return _0x496da8[_0xc36b('0x15')](_0x2a0c60)[_0xc36b('0x16')]();};}function respondWithResult(_0x33385,_0xecffbe){_0xecffbe=_0xecffbe||0xc8;return function(_0x3cfd64){if(_0x3cfd64){return _0x33385['status'](_0xecffbe)[_0xc36b('0x17')](_0x3cfd64);}};}function respondWithFilteredResult(_0x40eee3,_0x548edd){return function(_0x45bee3){if(_0x45bee3){var _0x47b019=typeof _0x548edd[_0xc36b('0x18')]==='undefined'&&typeof _0x548edd[_0xc36b('0x19')]===_0xc36b('0x1a');var _0x3c7ec9=_0x45bee3[_0xc36b('0x1b')];var _0x299233=_0x47b019?0x0:_0x548edd[_0xc36b('0x18')];var _0x1a5048=_0x47b019?_0x45bee3[_0xc36b('0x1b')]:_0x548edd['offset']+_0x548edd[_0xc36b('0x19')];var _0x57cfda;if(_0x1a5048>=_0x3c7ec9){_0x1a5048=_0x3c7ec9;_0x57cfda=0xc8;}else{_0x57cfda=0xce;}_0x40eee3[_0xc36b('0x15')](_0x57cfda);return _0x40eee3[_0xc36b('0x1c')](_0xc36b('0x1d'),_0x299233+'-'+_0x1a5048+'/'+_0x3c7ec9)[_0xc36b('0x17')](_0x45bee3);}return null;};}function patchUpdates(_0x214aa4){return function(_0x5f4690){try{jsonpatch['apply'](_0x5f4690,_0x214aa4,!![]);}catch(_0x4b56c5){return BPromise['reject'](_0x4b56c5);}return _0x5f4690[_0xc36b('0x1e')]();};}function saveUpdates(_0x30337c,_0x26e93f){return function(_0x25a758){if(_0x25a758){return _0x25a758[_0xc36b('0x1f')](_0x30337c)[_0xc36b('0x20')](function(_0x226949){return _0x226949;});}return null;};}function removeEntity(_0x1f46f0,_0x430121){return function(_0x32990f){if(_0x32990f){return _0x32990f[_0xc36b('0x21')]()[_0xc36b('0x20')](function(){_0x1f46f0[_0xc36b('0x15')](0xcc)[_0xc36b('0x16')]();});}};}function handleEntityNotFound(_0x3e7197,_0x1035ba){return function(_0x198a80){if(!_0x198a80){_0x3e7197[_0xc36b('0x22')](0x194);}return _0x198a80;};}function handleError(_0x4378e3,_0x24d176){_0x24d176=_0x24d176||0x1f4;return function(_0x28a599){logger[_0xc36b('0x23')](_0x28a599['stack']);if(_0x28a599[_0xc36b('0x24')]){delete _0x28a599['name'];}_0x4378e3[_0xc36b('0x15')](_0x24d176)[_0xc36b('0x25')](_0x28a599);};}exports[_0xc36b('0x26')]=function(_0x32c2db,_0x50fa07){var _0x7fb464={},_0xa98d86={},_0x4afb7b={'count':0x0,'rows':[]};var _0x43a04d=_[_0xc36b('0x27')](db[_0xc36b('0x28')][_0xc36b('0x29')],function(_0x53e3e7){return{'name':_0x53e3e7[_0xc36b('0x2a')],'type':_0x53e3e7[_0xc36b('0x2b')][_0xc36b('0x2c')]};});_0xa98d86[_0xc36b('0x2d')]=_[_0xc36b('0x2e')](_[_0xc36b('0x27')](_0x43a04d,_0xc36b('0x24')),['name']);_0xa98d86[_0xc36b('0x2f')]=_[_0xc36b('0x30')](_0x32c2db[_0xc36b('0x2f')]);_0xa98d86[_0xc36b('0x31')]=_[_0xc36b('0x32')](_0xa98d86['model'],_0xa98d86[_0xc36b('0x2f')]);_0x7fb464[_0xc36b('0x33')]=_['intersection'](_0xa98d86['model'],qs[_0xc36b('0x34')](_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x34')]));_0x7fb464[_0xc36b('0x33')]=_0x7fb464[_0xc36b('0x33')]['length']?_0x7fb464['attributes']:_0xa98d86[_0xc36b('0x2d')];if(!_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x35')](_0xc36b('0x36'))){_0x7fb464['limit']=qs[_0xc36b('0x19')](_0x32c2db[_0xc36b('0x2f')]['limit']);_0x7fb464[_0xc36b('0x18')]=qs[_0xc36b('0x18')](_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x18')]);}_0x7fb464[_0xc36b('0x37')]=qs[_0xc36b('0x38')](_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x38')]);_0x7fb464[_0xc36b('0x39')]=qs[_0xc36b('0x31')](_[_0xc36b('0x3a')](_0x32c2db['query'],_0xa98d86[_0xc36b('0x31')]),_0x43a04d);if(_0x32c2db[_0xc36b('0x2f')][_0xc36b('0x3b')]){_0x7fb464[_0xc36b('0x39')]=_[_0xc36b('0x3c')](_0x7fb464[_0xc36b('0x39')],{'$or':_[_0xc36b('0x27')](_0x43a04d,function(_0x22ca45){if(_0x22ca45['type']!==_0xc36b('0x3d')){var _0x5cf1a6={};_0x5cf1a6[_0x22ca45['name']]={'$like':'%'+_0x32c2db['query'][_0xc36b('0x3b')]+'%'};return _0x5cf1a6;}})});}_0x7fb464=_[_0xc36b('0x3c')]({},_0x7fb464,_0x32c2db[_0xc36b('0x3e')]);var _0x43eff1={'where':_0x7fb464[_0xc36b('0x39')]};return db['VoiceMailMessage'][_0xc36b('0x1b')](_0x43eff1)[_0xc36b('0x20')](function(_0x129b98){_0x4afb7b[_0xc36b('0x1b')]=_0x129b98;if(_0x32c2db['query'][_0xc36b('0x3f')]){_0x7fb464[_0xc36b('0x40')]=[{'all':!![]}];}return db[_0xc36b('0x28')][_0xc36b('0x41')](_0x7fb464);})['then'](function(_0x12b9f5){_0x4afb7b[_0xc36b('0x42')]=_0x12b9f5;return _0x4afb7b;})[_0xc36b('0x20')](respondWithFilteredResult(_0x50fa07,_0x7fb464))[_0xc36b('0x43')](handleError(_0x50fa07,null));};exports[_0xc36b('0x44')]=function(_0xf24dd0,_0x154bc7){var _0x21fbca={'raw':!![],'where':{'id':_0xf24dd0['params']['id']}},_0x5edcc9={};_0x5edcc9[_0xc36b('0x2d')]=_['keys'](db[_0xc36b('0x28')][_0xc36b('0x29')]);_0x5edcc9[_0xc36b('0x2f')]=_[_0xc36b('0x30')](_0xf24dd0[_0xc36b('0x2f')]);_0x5edcc9[_0xc36b('0x31')]=_['intersection'](_0x5edcc9[_0xc36b('0x2d')],_0x5edcc9['query']);_0x21fbca[_0xc36b('0x33')]=_[_0xc36b('0x32')](_0x5edcc9[_0xc36b('0x2d')],qs[_0xc36b('0x34')](_0xf24dd0[_0xc36b('0x2f')]['fields']));_0x21fbca['attributes']=_0x21fbca[_0xc36b('0x33')][_0xc36b('0x45')]?_0x21fbca['attributes']:_0x5edcc9[_0xc36b('0x2d')];if(_0xf24dd0[_0xc36b('0x2f')]['includeAll']){_0x21fbca['include']=[{'all':!![]}];}_0x21fbca=_[_0xc36b('0x3c')]({},_0x21fbca,_0xf24dd0[_0xc36b('0x3e')]);return db['VoiceMailMessage']['find'](_0x21fbca)[_0xc36b('0x20')](handleEntityNotFound(_0x154bc7,null))[_0xc36b('0x20')](respondWithResult(_0x154bc7,null))['catch'](handleError(_0x154bc7,null));};exports[_0xc36b('0x46')]=function(_0x79a02b,_0x3be462){return db[_0xc36b('0x28')][_0xc36b('0x46')](_0x79a02b['body'],{})[_0xc36b('0x20')](respondWithResult(_0x3be462,0xc9))[_0xc36b('0x43')](handleError(_0x3be462,null));};exports[_0xc36b('0x1f')]=function(_0x45a115,_0x3ac047){if(_0x45a115[_0xc36b('0x47')]['id']){delete _0x45a115[_0xc36b('0x47')]['id'];}return db[_0xc36b('0x28')][_0xc36b('0x48')]({'where':{'id':_0x45a115[_0xc36b('0x49')]['id']}})[_0xc36b('0x20')](handleEntityNotFound(_0x3ac047,null))['then'](saveUpdates(_0x45a115['body'],null))[_0xc36b('0x20')](respondWithResult(_0x3ac047,null))['catch'](handleError(_0x3ac047,null));};exports[_0xc36b('0x21')]=function(_0xc83a0f,_0x2d8879){return db[_0xc36b('0x28')][_0xc36b('0x48')]({'where':{'id':_0xc83a0f[_0xc36b('0x49')]['id']}})[_0xc36b('0x20')](handleEntityNotFound(_0x2d8879,null))[_0xc36b('0x20')](removeEntity(_0x2d8879,null))[_0xc36b('0x43')](handleError(_0x2d8879,null));};exports[_0xc36b('0x4a')]=function(_0x5946ef,_0x3ca286,_0x376386){return db[_0xc36b('0x28')]['find']({'where':{'id':_0x5946ef[_0xc36b('0x49')]['id']},'attributes':['id','recording',_0xc36b('0x4b')]})[_0xc36b('0x20')](handleEntityNotFound(_0x3ca286,null))[_0xc36b('0x20')](function(_0x1dc139){if(_0x1dc139){if(!_0x1dc139['recording']){throw new db[(_0xc36b('0x4c'))][(_0xc36b('0x4d'))](_0xc36b('0x4e'));}var _0x33f507={'Content-Type':_0xc36b('0x4f'),'Content-Disposition':_0xc36b('0x50')};if(_0x1dc139[_0xc36b('0x4b')]){_0x33f507[_0xc36b('0x51')]=_0xc36b('0x52')+_0x1dc139[_0xc36b('0x4b')]+_0xc36b('0x53');}_0x3ca286[_0xc36b('0x1c')](_0x33f507);return _0x3ca286[_0xc36b('0x25')](new Buffer(_0x1dc139[_0xc36b('0x54')]));}})[_0xc36b('0x43')](handleError(_0x3ca286,null));}; \ No newline at end of file +var _0x207b=['.wav\x22','eml-format','rimraf','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','fieldName','key','differenceBy','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','include','findAll','rows','catch','show','params','keys','includeAll','create','body','update','find','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22'];(function(_0x29ede,_0x51d498){var _0x470449=function(_0x53879c){while(--_0x53879c){_0x29ede['push'](_0x29ede['shift']());}};_0x470449(++_0x51d498);}(_0x207b,0x1c8));var _0xb207=function(_0x2db6d0,_0x96072){_0x2db6d0=_0x2db6d0-0x0;var _0x500ac5=_0x207b[_0x2db6d0];return _0x500ac5;};'use strict';var emlformat=require(_0xb207('0x0'));var rimraf=require(_0xb207('0x1'));var zipdir=require(_0xb207('0x2'));var jsonpatch=require(_0xb207('0x3'));var rp=require(_0xb207('0x4'));var moment=require(_0xb207('0x5'));var BPromise=require(_0xb207('0x6'));var Mustache=require(_0xb207('0x7'));var util=require(_0xb207('0x8'));var path=require('path');var sox=require(_0xb207('0x9'));var csv=require(_0xb207('0xa'));var ejs=require(_0xb207('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb207('0xc'));var squel=require(_0xb207('0xd'));var crypto=require(_0xb207('0xe'));var jsforce=require(_0xb207('0xf'));var deskjs=require(_0xb207('0x10'));var toCsv=require(_0xb207('0xa'));var querystring=require(_0xb207('0x11'));var Papa=require(_0xb207('0x12'));var Redis=require(_0xb207('0x13'));var authService=require(_0xb207('0x14'));var qs=require(_0xb207('0x15'));var as=require(_0xb207('0x16'));var hardwareService=require(_0xb207('0x17'));var logger=require(_0xb207('0x18'))(_0xb207('0x19'));var utils=require('../../config/utils');var config=require(_0xb207('0x1a'));var licenseUtil=require(_0xb207('0x1b'));var db=require(_0xb207('0x1c'))['db'];function respondWithStatusCode(_0x313662,_0x593f6f){_0x593f6f=_0x593f6f||0xcc;return function(_0x16d829){if(_0x16d829){return _0x313662[_0xb207('0x1d')](_0x593f6f);}return _0x313662[_0xb207('0x1e')](_0x593f6f)[_0xb207('0x1f')]();};}function respondWithResult(_0x53c7a2,_0x522d8d){_0x522d8d=_0x522d8d||0xc8;return function(_0x5422cf){if(_0x5422cf){return _0x53c7a2[_0xb207('0x1e')](_0x522d8d)[_0xb207('0x20')](_0x5422cf);}};}function respondWithFilteredResult(_0x44b044,_0x4cfa84){return function(_0x4d9f84){if(_0x4d9f84){var _0x4a7e47=typeof _0x4cfa84[_0xb207('0x21')]===_0xb207('0x22')&&typeof _0x4cfa84['limit']===_0xb207('0x22');var _0x81bc9f=_0x4d9f84[_0xb207('0x23')];var _0x15e06f=_0x4a7e47?0x0:_0x4cfa84[_0xb207('0x21')];var _0x54e6cb=_0x4a7e47?_0x4d9f84['count']:_0x4cfa84[_0xb207('0x21')]+_0x4cfa84['limit'];var _0x172ddc;if(_0x54e6cb>=_0x81bc9f){_0x54e6cb=_0x81bc9f;_0x172ddc=0xc8;}else{_0x172ddc=0xce;}_0x44b044[_0xb207('0x1e')](_0x172ddc);return _0x44b044[_0xb207('0x24')](_0xb207('0x25'),_0x15e06f+'-'+_0x54e6cb+'/'+_0x81bc9f)[_0xb207('0x20')](_0x4d9f84);}return null;};}function patchUpdates(_0x1ee552){return function(_0x3adb65){try{jsonpatch[_0xb207('0x26')](_0x3adb65,_0x1ee552,!![]);}catch(_0x3c34e4){return BPromise[_0xb207('0x27')](_0x3c34e4);}return _0x3adb65[_0xb207('0x28')]();};}function saveUpdates(_0x453bd5,_0x1ffa54){return function(_0x98bb52){if(_0x98bb52){return _0x98bb52['update'](_0x453bd5)['then'](function(_0x447140){return _0x447140;});}return null;};}function removeEntity(_0x281a40,_0x103394){return function(_0x39f447){if(_0x39f447){return _0x39f447[_0xb207('0x29')]()[_0xb207('0x2a')](function(){_0x281a40['status'](0xcc)[_0xb207('0x1f')]();});}};}function handleEntityNotFound(_0xa914e4,_0x21270d){return function(_0x589a4a){if(!_0x589a4a){_0xa914e4[_0xb207('0x1d')](0x194);}return _0x589a4a;};}function handleError(_0x45f78b,_0x44307f){_0x44307f=_0x44307f||0x1f4;return function(_0x47ed2c){logger[_0xb207('0x2b')](_0x47ed2c[_0xb207('0x2c')]);if(_0x47ed2c[_0xb207('0x2d')]){delete _0x47ed2c[_0xb207('0x2d')];}_0x45f78b[_0xb207('0x1e')](_0x44307f)[_0xb207('0x2e')](_0x47ed2c);};}exports[_0xb207('0x2f')]=function(_0x37b5ba,_0x404f27){var _0x5916d3={},_0x4b5507={},_0x2cc03d={'count':0x0,'rows':[]};var _0x26be15=_['map'](db['VoiceMailMessage']['rawAttributes'],function(_0x2808f8){return{'name':_0x2808f8[_0xb207('0x30')],'type':_0x2808f8['type'][_0xb207('0x31')]};});_0x4b5507['model']=_[_0xb207('0x32')](_[_0xb207('0x33')](_0x26be15,'name'),[_0xb207('0x2d')]);_0x4b5507['query']=_['keys'](_0x37b5ba[_0xb207('0x34')]);_0x4b5507['filters']=_[_0xb207('0x35')](_0x4b5507[_0xb207('0x36')],_0x4b5507[_0xb207('0x34')]);_0x5916d3[_0xb207('0x37')]=_[_0xb207('0x35')](_0x4b5507[_0xb207('0x36')],qs[_0xb207('0x38')](_0x37b5ba[_0xb207('0x34')][_0xb207('0x38')]));_0x5916d3['attributes']=_0x5916d3[_0xb207('0x37')][_0xb207('0x39')]?_0x5916d3[_0xb207('0x37')]:_0x4b5507[_0xb207('0x36')];if(!_0x37b5ba[_0xb207('0x34')][_0xb207('0x3a')](_0xb207('0x3b'))){_0x5916d3[_0xb207('0x3c')]=qs['limit'](_0x37b5ba['query'][_0xb207('0x3c')]);_0x5916d3['offset']=qs[_0xb207('0x21')](_0x37b5ba[_0xb207('0x34')][_0xb207('0x21')]);}_0x5916d3['order']=qs['sort'](_0x37b5ba['query'][_0xb207('0x3d')]);_0x5916d3[_0xb207('0x3e')]=qs[_0xb207('0x3f')](_[_0xb207('0x40')](_0x37b5ba[_0xb207('0x34')],_0x4b5507['filters']),_0x26be15);if(_0x37b5ba['query'][_0xb207('0x41')]){_0x5916d3[_0xb207('0x3e')]=_[_0xb207('0x42')](_0x5916d3[_0xb207('0x3e')],{'$or':_[_0xb207('0x33')](_0x26be15,function(_0x17817a){if(_0x17817a['type']!==_0xb207('0x43')){var _0xecbd21={};_0xecbd21[_0x17817a['name']]={'$like':'%'+_0x37b5ba[_0xb207('0x34')][_0xb207('0x41')]+'%'};return _0xecbd21;}})});}_0x5916d3=_['merge']({},_0x5916d3,_0x37b5ba[_0xb207('0x44')]);var _0x95dea={'where':_0x5916d3[_0xb207('0x3e')]};return db[_0xb207('0x45')][_0xb207('0x23')](_0x95dea)[_0xb207('0x2a')](function(_0x1a92eb){_0x2cc03d[_0xb207('0x23')]=_0x1a92eb;if(_0x37b5ba[_0xb207('0x34')]['includeAll']){_0x5916d3[_0xb207('0x46')]=[{'all':!![]}];}return db[_0xb207('0x45')][_0xb207('0x47')](_0x5916d3);})['then'](function(_0x471326){_0x2cc03d[_0xb207('0x48')]=_0x471326;return _0x2cc03d;})['then'](respondWithFilteredResult(_0x404f27,_0x5916d3))[_0xb207('0x49')](handleError(_0x404f27,null));};exports[_0xb207('0x4a')]=function(_0x4d51b8,_0x489eeb){var _0x13031c={'raw':!![],'where':{'id':_0x4d51b8[_0xb207('0x4b')]['id']}},_0x14ad8f={};_0x14ad8f[_0xb207('0x36')]=_[_0xb207('0x4c')](db[_0xb207('0x45')]['rawAttributes']);_0x14ad8f[_0xb207('0x34')]=_[_0xb207('0x4c')](_0x4d51b8[_0xb207('0x34')]);_0x14ad8f[_0xb207('0x3f')]=_[_0xb207('0x35')](_0x14ad8f[_0xb207('0x36')],_0x14ad8f['query']);_0x13031c[_0xb207('0x37')]=_[_0xb207('0x35')](_0x14ad8f[_0xb207('0x36')],qs[_0xb207('0x38')](_0x4d51b8['query'][_0xb207('0x38')]));_0x13031c[_0xb207('0x37')]=_0x13031c['attributes']['length']?_0x13031c[_0xb207('0x37')]:_0x14ad8f[_0xb207('0x36')];if(_0x4d51b8[_0xb207('0x34')][_0xb207('0x4d')]){_0x13031c[_0xb207('0x46')]=[{'all':!![]}];}_0x13031c=_[_0xb207('0x42')]({},_0x13031c,_0x4d51b8[_0xb207('0x44')]);return db[_0xb207('0x45')]['find'](_0x13031c)['then'](handleEntityNotFound(_0x489eeb,null))[_0xb207('0x2a')](respondWithResult(_0x489eeb,null))[_0xb207('0x49')](handleError(_0x489eeb,null));};exports[_0xb207('0x4e')]=function(_0x322839,_0x55f688){return db[_0xb207('0x45')][_0xb207('0x4e')](_0x322839[_0xb207('0x4f')],{})[_0xb207('0x2a')](respondWithResult(_0x55f688,0xc9))[_0xb207('0x49')](handleError(_0x55f688,null));};exports[_0xb207('0x50')]=function(_0x28b4e8,_0x3b7a4f){if(_0x28b4e8[_0xb207('0x4f')]['id']){delete _0x28b4e8[_0xb207('0x4f')]['id'];}return db[_0xb207('0x45')]['find']({'where':{'id':_0x28b4e8[_0xb207('0x4b')]['id']}})[_0xb207('0x2a')](handleEntityNotFound(_0x3b7a4f,null))[_0xb207('0x2a')](saveUpdates(_0x28b4e8[_0xb207('0x4f')],null))[_0xb207('0x2a')](respondWithResult(_0x3b7a4f,null))[_0xb207('0x49')](handleError(_0x3b7a4f,null));};exports[_0xb207('0x29')]=function(_0x4c19a3,_0x5b04f2){return db[_0xb207('0x45')][_0xb207('0x51')]({'where':{'id':_0x4c19a3[_0xb207('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b04f2,null))[_0xb207('0x2a')](removeEntity(_0x5b04f2,null))[_0xb207('0x49')](handleError(_0x5b04f2,null));};exports[_0xb207('0x52')]=function(_0x573b9b,_0x3f4ab4,_0x1e0d13){return db[_0xb207('0x45')][_0xb207('0x51')]({'where':{'id':_0x573b9b['params']['id']},'attributes':['id',_0xb207('0x53'),_0xb207('0x54')]})[_0xb207('0x2a')](handleEntityNotFound(_0x3f4ab4,null))['then'](function(_0x38b53c){if(_0x38b53c){if(!_0x38b53c['recording']){throw new db['Sequelize'][(_0xb207('0x55'))](_0xb207('0x56'));}var _0x418873={'Content-Type':_0xb207('0x57'),'Content-Disposition':_0xb207('0x58')};if(_0x38b53c[_0xb207('0x54')]){_0x418873['Content-Disposition']=_0xb207('0x59')+_0x38b53c[_0xb207('0x54')]+_0xb207('0x5a');}_0x3f4ab4[_0xb207('0x24')](_0x418873);return _0x3f4ab4[_0xb207('0x2e')](new Buffer(_0x38b53c[_0xb207('0x53')]));}})[_0xb207('0x49')](handleError(_0x3f4ab4,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5defd37..99b9a87 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 _0x0ac1=['api','moment','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ac1,0x167));var _0x10ac=function(_0x562a05,_0x12c841){_0x562a05=_0x562a05-0x0;var _0x28ceb5=_0x0ac1[_0x562a05];return _0x28ceb5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10ac('0x0'))(_0x10ac('0x1'));var moment=require(_0x10ac('0x2'));var BPromise=require(_0x10ac('0x3'));var rp=require(_0x10ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10ac('0x5'));var attributes=require(_0x10ac('0x6'));module[_0x10ac('0x7')]=function(_0x36847b,_0x5bffb1){return _0x36847b[_0x10ac('0x8')](_0x10ac('0x9'),attributes,{'tableName':_0x10ac('0xa'),'paranoid':![],'indexes':[{'name':_0x10ac('0xb'),'fields':[_0x10ac('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x93e7=['../../config/logger','api','moment','bluebird','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x1bd8df,_0x31d5bc){var _0x461c75=function(_0x529c94){while(--_0x529c94){_0x1bd8df['push'](_0x1bd8df['shift']());}};_0x461c75(++_0x31d5bc);}(_0x93e7,0x136));var _0x793e=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x93e7[_0x368e09];return _0x14b7df;};'use strict';var _=require(_0x793e('0x0'));var util=require(_0x793e('0x1'));var logger=require(_0x793e('0x2'))(_0x793e('0x3'));var moment=require(_0x793e('0x4'));var BPromise=require(_0x793e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x793e('0x6'));module[_0x793e('0x7')]=function(_0x552b8c,_0xb19c3f){return _0x552b8c[_0x793e('0x8')](_0x793e('0x9'),attributes,{'tableName':_0x793e('0xa'),'paranoid':![],'indexes':[{'name':_0x793e('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 82a4d3d..8d9df93 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 _0x02b0=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x3db644,_0x507cf7){var _0x122443=function(_0x4423ee){while(--_0x4423ee){_0x3db644['push'](_0x3db644['shift']());}};_0x122443(++_0x507cf7);}(_0x02b0,0x78));var _0x002b=function(_0x43265b,_0x2eeb96){_0x43265b=_0x43265b-0x0;var _0xdc3c7b=_0x02b0[_0x43265b];return _0xdc3c7b;};'use strict';var _=require('lodash');var util=require(_0x002b('0x0'));var moment=require(_0x002b('0x1'));var BPromise=require('bluebird');var rs=require(_0x002b('0x2'));var fs=require('fs');var Redis=require(_0x002b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x002b('0x4'));var logger=require(_0x002b('0x5'))('rpc');var config=require(_0x002b('0x6'));var jayson=require(_0x002b('0x7'));var client=jayson[_0x002b('0x8')][_0x002b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25b39b,_0x356c29,_0x489856){return new BPromise(function(_0x2e5f09,_0x15789c){return client[_0x002b('0xa')](_0x25b39b,_0x489856)[_0x002b('0xb')](function(_0x449ac4){logger['info'](_0x002b('0xc'),_0x356c29,_0x002b('0xd'));logger[_0x002b('0xe')](_0x002b('0xf'),_0x356c29,_0x002b('0xd'),JSON['stringify'](_0x449ac4));if(_0x449ac4[_0x002b('0x10')]){if(_0x449ac4[_0x002b('0x10')][_0x002b('0x11')]===0x1f4){logger[_0x002b('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x356c29,_0x449ac4[_0x002b('0x10')]['message']);return _0x15789c(_0x449ac4[_0x002b('0x10')][_0x002b('0x12')]);}logger[_0x002b('0x10')](_0x002b('0xc'),_0x356c29,_0x449ac4[_0x002b('0x10')][_0x002b('0x12')]);return _0x2e5f09(_0x449ac4['error'][_0x002b('0x12')]);}else{logger[_0x002b('0x13')](_0x002b('0xc'),_0x356c29,_0x002b('0xd'));_0x2e5f09(_0x449ac4['result'][_0x002b('0x12')]);}})['catch'](function(_0x5e2eb9){logger[_0x002b('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x356c29,_0x5e2eb9);_0x15789c(_0x5e2eb9);});});} \ No newline at end of file +var _0xe1db=['stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x17f508,_0x4af067){var _0x341f2e=function(_0x3b6dcb){while(--_0x3b6dcb){_0x17f508['push'](_0x17f508['shift']());}};_0x341f2e(++_0x4af067);}(_0xe1db,0xac));var _0xbe1d=function(_0x2916c9,_0x1c8865){_0x2916c9=_0x2916c9-0x0;var _0x1b1c4f=_0xe1db[_0x2916c9];return _0x1b1c4f;};'use strict';var _=require(_0xbe1d('0x0'));var util=require(_0xbe1d('0x1'));var moment=require(_0xbe1d('0x2'));var BPromise=require(_0xbe1d('0x3'));var rs=require(_0xbe1d('0x4'));var fs=require('fs');var Redis=require(_0xbe1d('0x5'));var db=require(_0xbe1d('0x6'))['db'];var utils=require(_0xbe1d('0x7'));var logger=require(_0xbe1d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbe1d('0x9')][_0xbe1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41ddd8,_0x30359f,_0x4bca61){return new BPromise(function(_0x335972,_0x322e58){return client[_0xbe1d('0xb')](_0x41ddd8,_0x4bca61)['then'](function(_0x5b2d1b){logger[_0xbe1d('0xc')](_0xbe1d('0xd'),_0x30359f,_0xbe1d('0xe'));logger[_0xbe1d('0xf')](_0xbe1d('0x10'),_0x30359f,'request\x20sent',JSON[_0xbe1d('0x11')](_0x5b2d1b));if(_0x5b2d1b[_0xbe1d('0x12')]){if(_0x5b2d1b[_0xbe1d('0x12')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x30359f,_0x5b2d1b[_0xbe1d('0x12')][_0xbe1d('0x13')]);return _0x322e58(_0x5b2d1b[_0xbe1d('0x12')][_0xbe1d('0x13')]);}logger[_0xbe1d('0x12')](_0xbe1d('0xd'),_0x30359f,_0x5b2d1b[_0xbe1d('0x12')]['message']);return _0x335972(_0x5b2d1b[_0xbe1d('0x12')]['message']);}else{logger[_0xbe1d('0xc')](_0xbe1d('0xd'),_0x30359f,_0xbe1d('0xe'));_0x335972(_0x5b2d1b['result'][_0xbe1d('0x13')]);}})[_0xbe1d('0x14')](function(_0x687c3a){logger[_0xbe1d('0x12')](_0xbe1d('0xd'),_0x30359f,_0x687c3a);_0x322e58(_0x687c3a);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 4d7f4a9..5c4ba26 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 _0x77d7=['get','isAuthenticated','/:id','getSounds','post','create','/:id/sounds','addSound','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller'];(function(_0x29fd7b,_0x160cdc){var _0x1ed0c5=function(_0x311363){while(--_0x311363){_0x29fd7b['push'](_0x29fd7b['shift']());}};_0x1ed0c5(++_0x160cdc);}(_0x77d7,0x1f0));var _0x777d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x77d7[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x777d('0x0'));var util=require(_0x777d('0x1'));var path=require(_0x777d('0x2'));var timeout=require(_0x777d('0x3'));var express=require(_0x777d('0x4'));var router=express[_0x777d('0x5')]();var fs_extra=require(_0x777d('0x6'));var auth=require(_0x777d('0x7'));var interaction=require(_0x777d('0x8'));var config=require('../../config/environment');var controller=require(_0x777d('0x9'));router[_0x777d('0xa')]('/',auth[_0x777d('0xb')](),controller['index']);router[_0x777d('0xa')](_0x777d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x777d('0xa')]('/:id/sounds',auth[_0x777d('0xb')](),controller[_0x777d('0xd')]);router[_0x777d('0xe')]('/',auth['isAuthenticated'](),controller[_0x777d('0xf')]);router[_0x777d('0xe')](_0x777d('0x10'),auth[_0x777d('0xb')](),controller[_0x777d('0x11')]);router['put']('/:id',auth[_0x777d('0xb')](),controller[_0x777d('0x12')]);router[_0x777d('0x13')]('/:id',auth[_0x777d('0xb')](),controller[_0x777d('0x14')]);router[_0x777d('0x13')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x777d('0x15')]);module[_0x777d('0x16')]=router; \ No newline at end of file +var _0xb454=['/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','destroy','delete','/:id/sounds/:id2','removeSound','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index'];(function(_0x4877b5,_0x2ff4c6){var _0x278cdf=function(_0x47cdb2){while(--_0x47cdb2){_0x4877b5['push'](_0x4877b5['shift']());}};_0x278cdf(++_0x2ff4c6);}(_0xb454,0xd2));var _0x4b45=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0xb454[_0x1627ae];return _0x34b38f;};'use strict';var multer=require(_0x4b45('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b45('0x1'));var express=require(_0x4b45('0x2'));var router=express[_0x4b45('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4b45('0x4'));var interaction=require(_0x4b45('0x5'));var config=require(_0x4b45('0x6'));var controller=require(_0x4b45('0x7'));router[_0x4b45('0x8')]('/',auth['isAuthenticated'](),controller[_0x4b45('0x9')]);router['get'](_0x4b45('0xa'),auth[_0x4b45('0xb')](),controller[_0x4b45('0xc')]);router[_0x4b45('0x8')](_0x4b45('0xd'),auth['isAuthenticated'](),controller[_0x4b45('0xe')]);router[_0x4b45('0xf')]('/',auth['isAuthenticated'](),controller[_0x4b45('0x10')]);router['post'](_0x4b45('0xd'),auth['isAuthenticated'](),controller[_0x4b45('0x11')]);router['put']('/:id',auth[_0x4b45('0xb')](),controller['update']);router['delete'](_0x4b45('0xa'),auth[_0x4b45('0xb')](),controller[_0x4b45('0x12')]);router[_0x4b45('0x13')](_0x4b45('0x14'),auth[_0x4b45('0xb')](),controller[_0x4b45('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 3103037..28d5a73 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 _0xb99d=['STRING','name','ENUM','custom','files','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb99d,0xc5));var _0xdb99=function(_0x46b2bd,_0x84a2bb){_0x46b2bd=_0x46b2bd-0x0;var _0x232dab=_0xb99d[_0x46b2bd];return _0x232dab;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb99('0x1')],'allowNull':![],'unique':_0xdb99('0x2')},'mode':{'type':Sequelize[_0xdb99('0x3')](_0xdb99('0x4'),'files','mp3nb','quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':_0xdb99('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![],'defaultValue':_0xdb99('0x6')},'format':{'type':Sequelize[_0xdb99('0x1')],'allowNull':!![]},'stamp':{'type':_0xdb99('0x7')},'defaultEntry':{'type':Sequelize[_0xdb99('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdfd1=['ENUM','mp3nb','quietmp3nb','quietmp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x1a0238,_0x21538b){var _0x4e7329=function(_0x32f418){while(--_0x32f418){_0x1a0238['push'](_0x1a0238['shift']());}};_0x4e7329(++_0x21538b);}(_0xdfd1,0x15d));var _0x1dfd=function(_0x11dfa9,_0x33ad5c){_0x11dfa9=_0x11dfa9-0x0;var _0xdf9c89=_0xdfd1[_0x11dfa9];return _0xdf9c89;};'use strict';var Sequelize=require(_0x1dfd('0x0'));module[_0x1dfd('0x1')]={'name':{'type':Sequelize[_0x1dfd('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1dfd('0x3')]('custom','files',_0x1dfd('0x4'),_0x1dfd('0x5'),_0x1dfd('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x1dfd('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x1dfd('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1dfd('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1dfd('0x2')],'allowNull':!![],'defaultValue':_0x1dfd('0x8')},'format':{'type':Sequelize[_0x1dfd('0x2')],'allowNull':!![]},'stamp':{'type':_0x1dfd('0x9')},'defaultEntry':{'type':Sequelize[_0x1dfd('0xa')],'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 67c4262..e6e17ff 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 _0xaa11=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','format','symlinkSync','removeSound','findOne','id2','getSounds','order','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','then','destroy','UserProfileResource','end','error','stack','name','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','rows','show','params','find','catch','body','create','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','user'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xaa11,0x1db));var _0x1aa1=function(_0xbfc7c0,_0xdc38ce){_0xbfc7c0=_0xbfc7c0-0x0;var _0x180870=_0xaa11[_0xbfc7c0];return _0x180870;};'use strict';var emlformat=require(_0x1aa1('0x0'));var rimraf=require(_0x1aa1('0x1'));var zipdir=require(_0x1aa1('0x2'));var jsonpatch=require(_0x1aa1('0x3'));var rp=require(_0x1aa1('0x4'));var moment=require('moment');var BPromise=require(_0x1aa1('0x5'));var Mustache=require(_0x1aa1('0x6'));var util=require(_0x1aa1('0x7'));var path=require(_0x1aa1('0x8'));var sox=require(_0x1aa1('0x9'));var csv=require(_0x1aa1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1aa1('0xb'));var _=require(_0x1aa1('0xc'));var squel=require('squel');var crypto=require(_0x1aa1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1aa1('0xe'));var toCsv=require(_0x1aa1('0xa'));var querystring=require(_0x1aa1('0xf'));var Papa=require(_0x1aa1('0x10'));var Redis=require('ioredis');var authService=require(_0x1aa1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1aa1('0x12'));var logger=require(_0x1aa1('0x13'))(_0x1aa1('0x14'));var utils=require(_0x1aa1('0x15'));var config=require(_0x1aa1('0x16'));var licenseUtil=require(_0x1aa1('0x17'));var db=require(_0x1aa1('0x18'))['db'];function respondWithStatusCode(_0x3a0253,_0x4f37b5){_0x4f37b5=_0x4f37b5||0xcc;return function(_0x1945a4){if(_0x1945a4){return _0x3a0253[_0x1aa1('0x19')](_0x4f37b5);}return _0x3a0253[_0x1aa1('0x1a')](_0x4f37b5)['end']();};}function respondWithResult(_0x2e8d4e,_0x4b785d){_0x4b785d=_0x4b785d||0xc8;return function(_0x367ed1){if(_0x367ed1){return _0x2e8d4e[_0x1aa1('0x1a')](_0x4b785d)[_0x1aa1('0x1b')](_0x367ed1);}};}function respondWithFilteredResult(_0x40bdd2,_0x295873){return function(_0x5ea8be){if(_0x5ea8be){var _0x54e1a0=typeof _0x295873[_0x1aa1('0x1c')]===_0x1aa1('0x1d')&&typeof _0x295873[_0x1aa1('0x1e')]===_0x1aa1('0x1d');var _0x44c369=_0x5ea8be[_0x1aa1('0x1f')];var _0x3dfc82=_0x54e1a0?0x0:_0x295873[_0x1aa1('0x1c')];var _0x281a54=_0x54e1a0?_0x5ea8be['count']:_0x295873[_0x1aa1('0x1c')]+_0x295873[_0x1aa1('0x1e')];var _0x484cba;if(_0x281a54>=_0x44c369){_0x281a54=_0x44c369;_0x484cba=0xc8;}else{_0x484cba=0xce;}_0x40bdd2[_0x1aa1('0x1a')](_0x484cba);return _0x40bdd2['set']('Content-Range',_0x3dfc82+'-'+_0x281a54+'/'+_0x44c369)[_0x1aa1('0x1b')](_0x5ea8be);}return null;};}function patchUpdates(_0x3c9fbc){return function(_0xf01b30){try{jsonpatch['apply'](_0xf01b30,_0x3c9fbc,!![]);}catch(_0x239894){return BPromise[_0x1aa1('0x20')](_0x239894);}return _0xf01b30['save']();};}function saveUpdates(_0x55ca67,_0x426e36){return function(_0x16912f){if(_0x16912f){return _0x16912f[_0x1aa1('0x21')](_0x55ca67)[_0x1aa1('0x22')](function(_0x3c98ab){return _0x3c98ab;});}return null;};}function removeEntity(_0x1390f3,_0x4ad556){return function(_0x3e47bc){if(_0x3e47bc){return _0x3e47bc[_0x1aa1('0x23')]()[_0x1aa1('0x22')](function(){var _0x46fddb=_0x3e47bc['get']({'plain':!![]});var _0x482981='MusicOnHolds';return db[_0x1aa1('0x24')][_0x1aa1('0x23')]({'where':{'type':_0x482981,'resourceId':_0x46fddb['id']}})['then'](function(){return _0x3e47bc;});})['then'](function(){_0x1390f3[_0x1aa1('0x1a')](0xcc)[_0x1aa1('0x25')]();});}};}function handleEntityNotFound(_0x4a77c3,_0x362c7b){return function(_0x481c20){if(!_0x481c20){_0x4a77c3[_0x1aa1('0x19')](0x194);}return _0x481c20;};}function handleError(_0x30d77,_0x3570d3){_0x3570d3=_0x3570d3||0x1f4;return function(_0x563f76){logger[_0x1aa1('0x26')](_0x563f76[_0x1aa1('0x27')]);if(_0x563f76[_0x1aa1('0x28')]){delete _0x563f76[_0x1aa1('0x28')];}_0x30d77[_0x1aa1('0x1a')](_0x3570d3)['send'](_0x563f76);};}exports['index']=function(_0xbf0722,_0x3518aa){var _0x5bff11={},_0x53eb42={},_0x44a20a={'count':0x0,'rows':[]};var _0x34cb54=_['map'](db[_0x1aa1('0x29')][_0x1aa1('0x2a')],function(_0x5d9694){return{'name':_0x5d9694[_0x1aa1('0x2b')],'type':_0x5d9694[_0x1aa1('0x2c')][_0x1aa1('0x2d')]};});_0x53eb42[_0x1aa1('0x2e')]=_[_0x1aa1('0x2f')](_0x34cb54,'name');_0x53eb42[_0x1aa1('0x30')]=_[_0x1aa1('0x31')](_0xbf0722[_0x1aa1('0x30')]);_0x53eb42[_0x1aa1('0x32')]=_[_0x1aa1('0x33')](_0x53eb42[_0x1aa1('0x2e')],_0x53eb42[_0x1aa1('0x30')]);_0x5bff11['attributes']=_[_0x1aa1('0x33')](_0x53eb42[_0x1aa1('0x2e')],qs[_0x1aa1('0x34')](_0xbf0722[_0x1aa1('0x30')]['fields']));_0x5bff11['attributes']=_0x5bff11[_0x1aa1('0x35')][_0x1aa1('0x36')]?_0x5bff11[_0x1aa1('0x35')]:_0x53eb42[_0x1aa1('0x2e')];if(!_0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x37')](_0x1aa1('0x38'))){_0x5bff11[_0x1aa1('0x1e')]=qs[_0x1aa1('0x1e')](_0xbf0722['query'][_0x1aa1('0x1e')]);_0x5bff11[_0x1aa1('0x1c')]=qs['offset'](_0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x1c')]);}_0x5bff11['order']=qs[_0x1aa1('0x39')](_0xbf0722['query']['sort']);delete _0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x39')];_0x5bff11[_0x1aa1('0x3a')]=qs['filters'](_[_0x1aa1('0x3b')](_0xbf0722[_0x1aa1('0x30')],_0x53eb42['filters']),_0x34cb54);if(_0xbf0722[_0x1aa1('0x30')]['filter']){_0x5bff11[_0x1aa1('0x3a')]=_['merge'](_0x5bff11[_0x1aa1('0x3a')],{'$or':_[_0x1aa1('0x2f')](_0x34cb54,function(_0x40e997){if(_0x40e997['type']!=='VIRTUAL'){var _0x3ffaa7={};_0x3ffaa7[_0x40e997[_0x1aa1('0x28')]]={'$like':'%'+_0xbf0722[_0x1aa1('0x30')]['filter']+'%'};return _0x3ffaa7;}})});}_0x5bff11=_[_0x1aa1('0x3c')]({},_0x5bff11,_0xbf0722[_0x1aa1('0x3d')]);var _0x24dde8={'where':_0x5bff11['where']};return db[_0x1aa1('0x29')][_0x1aa1('0x1f')](_0x24dde8)[_0x1aa1('0x22')](function(_0x104170){_0x44a20a[_0x1aa1('0x1f')]=_0x104170;if(_0xbf0722[_0x1aa1('0x30')][_0x1aa1('0x3e')]){_0x5bff11[_0x1aa1('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x5bff11);})[_0x1aa1('0x22')](function(_0x15065b){_0x44a20a[_0x1aa1('0x40')]=_0x15065b;return _0x44a20a;})[_0x1aa1('0x22')](respondWithFilteredResult(_0x3518aa,_0x5bff11))['catch'](handleError(_0x3518aa,null));};exports[_0x1aa1('0x41')]=function(_0x54008d,_0x59ce68){var _0x1edc36={'raw':![],'where':{'id':_0x54008d[_0x1aa1('0x42')]['id']}},_0x3a6a9e={};_0x3a6a9e[_0x1aa1('0x2e')]=_[_0x1aa1('0x31')](db[_0x1aa1('0x29')][_0x1aa1('0x2a')]);_0x3a6a9e['query']=_['keys'](_0x54008d[_0x1aa1('0x30')]);_0x3a6a9e['filters']=_[_0x1aa1('0x33')](_0x3a6a9e[_0x1aa1('0x2e')],_0x3a6a9e['query']);_0x1edc36[_0x1aa1('0x35')]=_['intersection'](_0x3a6a9e[_0x1aa1('0x2e')],qs[_0x1aa1('0x34')](_0x54008d[_0x1aa1('0x30')][_0x1aa1('0x34')]));_0x1edc36['attributes']=_0x1edc36[_0x1aa1('0x35')][_0x1aa1('0x36')]?_0x1edc36['attributes']:_0x3a6a9e[_0x1aa1('0x2e')];if(_0x54008d[_0x1aa1('0x30')][_0x1aa1('0x3e')]){_0x1edc36[_0x1aa1('0x3f')]=[{'all':!![]}];}_0x1edc36=_[_0x1aa1('0x3c')]({},_0x1edc36,_0x54008d['options']);return db[_0x1aa1('0x29')][_0x1aa1('0x43')](_0x1edc36)[_0x1aa1('0x22')](handleEntityNotFound(_0x59ce68,null))[_0x1aa1('0x22')](respondWithResult(_0x59ce68,null))[_0x1aa1('0x44')](handleError(_0x59ce68,null));};exports[_0x1aa1('0x21')]=function(_0x35d1a1,_0x2a4a5a){if(_0x35d1a1['body']['id']){delete _0x35d1a1[_0x1aa1('0x45')]['id'];}return db['VoiceMusicOnHold'][_0x1aa1('0x43')]({'where':{'id':_0x35d1a1[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](handleEntityNotFound(_0x2a4a5a,null))[_0x1aa1('0x22')](saveUpdates(_0x35d1a1[_0x1aa1('0x45')],null))[_0x1aa1('0x22')](respondWithResult(_0x2a4a5a,null))['catch'](handleError(_0x2a4a5a,null));};exports[_0x1aa1('0x46')]=function(_0x3320a2,_0x304bf7,_0x5b2c61){return db['sequelize'][_0x1aa1('0x47')](function(_0x34a5f5){if(_0x3320a2[_0x1aa1('0x45')][_0x1aa1('0x48')]===_0x1aa1('0x49')){_0x3320a2[_0x1aa1('0x45')][_0x1aa1('0x4a')]=path['join'](config[_0x1aa1('0x4b')],_0x1aa1('0x4c'),_0x3320a2[_0x1aa1('0x45')]['name']);}return db[_0x1aa1('0x29')][_0x1aa1('0x46')](_0x3320a2['body'],{'transaction':_0x34a5f5})[_0x1aa1('0x22')](function(_0x197fbe){if(_0x3320a2[_0x1aa1('0x45')][_0x1aa1('0x48')]==='files'){fs[_0x1aa1('0x4d')](_0x197fbe['directory'],parseInt(_0x1aa1('0x4e'),0x8));}var _0x1b7721=_0x3320a2[_0x1aa1('0x4f')][_0x1aa1('0x50')]({'plain':!![]});if(!_0x1b7721)throw new Error(_0x1aa1('0x51'));if(_0x1b7721[_0x1aa1('0x52')]===_0x1aa1('0x4f')){var _0x2500ab=_0x197fbe[_0x1aa1('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x1aa1('0x43')]({'where':{'name':_0x1aa1('0x53'),'userProfileId':_0x1b7721[_0x1aa1('0x54')]},'raw':!![]})[_0x1aa1('0x22')](function(_0x1fdaa3){if(_0x1fdaa3&&_0x1fdaa3['autoAssociation']===0x0){return db[_0x1aa1('0x24')][_0x1aa1('0x46')]({'name':_0x2500ab[_0x1aa1('0x28')],'resourceId':_0x2500ab['id'],'type':_0x1fdaa3[_0x1aa1('0x28')],'sectionId':_0x1fdaa3['id']},{})['then'](function(){return _0x197fbe;});}else{return _0x197fbe;}})[_0x1aa1('0x44')](function(_0x1f8354){logger[_0x1aa1('0x26')](_0x1aa1('0x55'),_0x1f8354);});}return _0x197fbe;});})[_0x1aa1('0x22')](respondWithResult(_0x304bf7,0xc9))[_0x1aa1('0x44')](handleError(_0x304bf7,null));};exports['destroy']=function(_0x173600,_0x3f3a4c,_0xef35f3){var _0x43ce9c;return db[_0x1aa1('0x29')][_0x1aa1('0x43')]({'where':{'id':_0x173600[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](function(_0x1e4aee){if(_0x1e4aee){return db[_0x1aa1('0x56')][_0x1aa1('0x47')](function(_0x358d1a){return _0x1e4aee[_0x1aa1('0x23')]({'transaction':_0x358d1a,'raw':!![]})[_0x1aa1('0x22')](function(_0x2686af){if(_0x2686af[_0x1aa1('0x4a')]){fs[_0x1aa1('0x57')](_0x2686af[_0x1aa1('0x4a')])[_0x1aa1('0x58')](function(_0x390ecf){fs[_0x1aa1('0x59')](path[_0x1aa1('0x5a')](_0x2686af['directory'],_0x390ecf));});fs[_0x1aa1('0x5b')](_0x2686af['directory']);}return _0x2686af;});})[_0x1aa1('0x44')](function(_0x2e47a8){throw new db[(_0x1aa1('0x5c'))][(_0x1aa1('0x5d'))](_0x2e47a8[_0x1aa1('0x5e')]);});}})[_0x1aa1('0x22')](handleEntityNotFound(_0x3f3a4c,null))[_0x1aa1('0x22')](removeEntity(_0x3f3a4c,null))[_0x1aa1('0x44')](handleError(_0x3f3a4c,null));};exports[_0x1aa1('0x5f')]=function(_0x14a038,_0x4ef6b6,_0x5a3d33){return db[_0x1aa1('0x56')]['transaction'](function(_0x355f33){var _0xc397da;return db[_0x1aa1('0x29')]['find']({'where':{'id':_0x14a038[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](function(_0x1d69e5){if(_0x1d69e5){_0xc397da=_0x1d69e5;return _0x1d69e5[_0x1aa1('0x5f')](_0x14a038[_0x1aa1('0x45')]['id'],{'transaction':_0x355f33});}})[_0x1aa1('0x22')](function(_0x35f0cf){if(_0x35f0cf){return db[_0x1aa1('0x60')]['findOne']({'where':{'id':_0x14a038[_0x1aa1('0x45')]['id']},'attributes':['id',_0x1aa1('0x28'),_0x1aa1('0x61'),_0x1aa1('0x62'),_0x1aa1('0x63')],'raw':!![]});}})[_0x1aa1('0x22')](function(_0x38a161){if(_0x38a161){var _0x10310c=path[_0x1aa1('0x5a')](config[_0x1aa1('0x4b')],_0x1aa1('0x64'),util['format'](_0x1aa1('0x65'),path['basename'](_0x38a161[_0x1aa1('0x61')],path[_0x1aa1('0x66')](_0x38a161[_0x1aa1('0x61')])),_0x38a161[_0x1aa1('0x62')]));var _0x38aa7e=path[_0x1aa1('0x5a')](config['root'],_0x1aa1('0x4c'),_0xc397da[_0x1aa1('0x28')],util[_0x1aa1('0x67')](_0x1aa1('0x65'),_0x38a161[_0x1aa1('0x28')],_0x38a161[_0x1aa1('0x62')]));fs[_0x1aa1('0x68')](_0x10310c,_0x38aa7e);return _0x38a161;}})[_0x1aa1('0x44')](function(_0x2def81){throw new db[(_0x1aa1('0x5c'))][(_0x1aa1('0x5d'))](_0x2def81['message']);});})[_0x1aa1('0x22')](handleEntityNotFound(_0x4ef6b6,null))[_0x1aa1('0x22')](respondWithResult(_0x4ef6b6,0xc9))[_0x1aa1('0x44')](handleError(_0x4ef6b6,null));};exports[_0x1aa1('0x69')]=function(_0x433019,_0x358382,_0x5bae90){return db['sequelize'][_0x1aa1('0x47')](function(_0x53986b){var _0xb36b4d;return db[_0x1aa1('0x29')][_0x1aa1('0x6a')]({'where':{'id':_0x433019[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](handleEntityNotFound(_0x358382,null))['then'](function(_0x46c22a){if(_0x46c22a){_0xb36b4d=_0x46c22a;return _0x46c22a['removeSound'](_0x433019[_0x1aa1('0x42')][_0x1aa1('0x6b')]);}})[_0x1aa1('0x22')](function(_0x5c5ee3){if(_0x5c5ee3){return db['Sound'][_0x1aa1('0x6a')]({'where':{'id':_0x433019[_0x1aa1('0x42')]['id2']},'attributes':['id','name','save_name',_0x1aa1('0x62'),_0x1aa1('0x63')],'raw':!![]});}})['then'](function(_0x3a88a2){if(_0x3a88a2){fs[_0x1aa1('0x59')](path[_0x1aa1('0x5a')](_0xb36b4d[_0x1aa1('0x4a')],util['format'](_0x1aa1('0x65'),_0x3a88a2[_0x1aa1('0x28')],_0x3a88a2['converted_format'])));return _0x3a88a2;}})[_0x1aa1('0x44')](function(_0x123358){throw new db[(_0x1aa1('0x5c'))][(_0x1aa1('0x5d'))](_0x123358[_0x1aa1('0x5e')]);});})[_0x1aa1('0x22')](handleEntityNotFound(_0x358382,null))[_0x1aa1('0x22')](respondWithStatusCode(_0x358382,0xcc))[_0x1aa1('0x44')](handleError(_0x358382,null));};exports[_0x1aa1('0x6c')]=function(_0x43c58b,_0xaf1e8b,_0x1d04de){var _0x4789ba={};var _0x49303c={};var _0x4fb24d;var _0x42950c;return db[_0x1aa1('0x29')][_0x1aa1('0x6a')]({'where':{'id':_0x43c58b[_0x1aa1('0x42')]['id']}})[_0x1aa1('0x22')](handleEntityNotFound(_0xaf1e8b,null))[_0x1aa1('0x22')](function(_0x41686c){if(_0x41686c){_0x4fb24d=_0x41686c;_0x49303c['model']=_[_0x1aa1('0x31')](db[_0x1aa1('0x60')]['rawAttributes']);_0x49303c[_0x1aa1('0x30')]=_[_0x1aa1('0x31')](_0x43c58b[_0x1aa1('0x30')]);_0x49303c[_0x1aa1('0x32')]=_[_0x1aa1('0x33')](_0x49303c[_0x1aa1('0x2e')],_0x49303c[_0x1aa1('0x30')]);_0x4789ba[_0x1aa1('0x35')]=_[_0x1aa1('0x33')](_0x49303c[_0x1aa1('0x2e')],qs['fields'](_0x43c58b[_0x1aa1('0x30')]['fields']));_0x4789ba[_0x1aa1('0x35')]=_0x4789ba['attributes']['length']?_0x4789ba[_0x1aa1('0x35')]:_0x49303c[_0x1aa1('0x2e')];_0x4789ba[_0x1aa1('0x6d')]=qs['sort'](_0x43c58b['query']['sort']);_0x4789ba[_0x1aa1('0x3a')]=qs[_0x1aa1('0x32')](_[_0x1aa1('0x3b')](_0x43c58b[_0x1aa1('0x30')],_0x49303c['filters']));if(_0x43c58b[_0x1aa1('0x30')][_0x1aa1('0x6e')]){_0x4789ba['where']=_[_0x1aa1('0x3c')](_0x4789ba[_0x1aa1('0x3a')],{'$or':_[_0x1aa1('0x2f')](_0x4789ba[_0x1aa1('0x35')],function(_0x260e13){var _0x2c2ac7={};_0x2c2ac7[_0x260e13]={'$like':'%'+_0x43c58b[_0x1aa1('0x30')]['filter']+'%'};return _0x2c2ac7;})});}_0x4789ba=_[_0x1aa1('0x3c')]({},_0x4789ba,_0x43c58b[_0x1aa1('0x3d')]);return _0x4fb24d[_0x1aa1('0x6c')](_0x4789ba);}})['then'](function(_0xa90087){if(_0xa90087){_0x42950c=_0xa90087[_0x1aa1('0x36')];if(!_0x43c58b['query']['hasOwnProperty'](_0x1aa1('0x38'))){_0x4789ba[_0x1aa1('0x1e')]=qs[_0x1aa1('0x1e')](_0x43c58b[_0x1aa1('0x30')][_0x1aa1('0x1e')]);_0x4789ba['offset']=qs[_0x1aa1('0x1c')](_0x43c58b[_0x1aa1('0x30')][_0x1aa1('0x1c')]);}return _0x4fb24d[_0x1aa1('0x6c')](_0x4789ba);}})[_0x1aa1('0x22')](function(_0x373dcc){if(_0x373dcc){return _0x373dcc?{'count':_0x42950c,'rows':_0x373dcc}:null;}})['then'](respondWithResult(_0xaf1e8b,null))[_0x1aa1('0x44')](handleError(_0xaf1e8b,null));}; \ No newline at end of file +var _0x41e3=['create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','createdAt','join','%s.%s','extname','format','removeSound','id2','Sound','getSounds','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','get','MusicOnHolds','UserProfileResource','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','sequelize','transaction','mode','files','directory','root','server/files/moh'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x41e3,0x8d));var _0x341e=function(_0x570e73,_0x538538){_0x570e73=_0x570e73-0x0;var _0x13134b=_0x41e3[_0x570e73];return _0x13134b;};'use strict';var emlformat=require(_0x341e('0x0'));var rimraf=require(_0x341e('0x1'));var zipdir=require(_0x341e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x341e('0x3'));var moment=require(_0x341e('0x4'));var BPromise=require(_0x341e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x341e('0x6'));var csv=require('to-csv');var ejs=require(_0x341e('0x7'));var fs=require('fs');var fs_extra=require(_0x341e('0x8'));var _=require(_0x341e('0x9'));var squel=require(_0x341e('0xa'));var crypto=require(_0x341e('0xb'));var jsforce=require(_0x341e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x341e('0xd'));var querystring=require(_0x341e('0xe'));var Papa=require('papaparse');var Redis=require(_0x341e('0xf'));var authService=require(_0x341e('0x10'));var qs=require(_0x341e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x341e('0x12'));var logger=require(_0x341e('0x13'))(_0x341e('0x14'));var utils=require(_0x341e('0x15'));var config=require(_0x341e('0x16'));var licenseUtil=require(_0x341e('0x17'));var db=require(_0x341e('0x18'))['db'];function respondWithStatusCode(_0x267ecc,_0x384a34){_0x384a34=_0x384a34||0xcc;return function(_0x1eb46e){if(_0x1eb46e){return _0x267ecc[_0x341e('0x19')](_0x384a34);}return _0x267ecc[_0x341e('0x1a')](_0x384a34)[_0x341e('0x1b')]();};}function respondWithResult(_0x10bac0,_0xd4d64b){_0xd4d64b=_0xd4d64b||0xc8;return function(_0x5a8b97){if(_0x5a8b97){return _0x10bac0[_0x341e('0x1a')](_0xd4d64b)[_0x341e('0x1c')](_0x5a8b97);}};}function respondWithFilteredResult(_0x15190,_0x4c5ec9){return function(_0x5c00a8){if(_0x5c00a8){var _0x270664=typeof _0x4c5ec9[_0x341e('0x1d')]==='undefined'&&typeof _0x4c5ec9[_0x341e('0x1e')]==='undefined';var _0x1e086c=_0x5c00a8['count'];var _0x2d7518=_0x270664?0x0:_0x4c5ec9[_0x341e('0x1d')];var _0x114cbc=_0x270664?_0x5c00a8[_0x341e('0x1f')]:_0x4c5ec9[_0x341e('0x1d')]+_0x4c5ec9[_0x341e('0x1e')];var _0x1fcc28;if(_0x114cbc>=_0x1e086c){_0x114cbc=_0x1e086c;_0x1fcc28=0xc8;}else{_0x1fcc28=0xce;}_0x15190[_0x341e('0x1a')](_0x1fcc28);return _0x15190[_0x341e('0x20')](_0x341e('0x21'),_0x2d7518+'-'+_0x114cbc+'/'+_0x1e086c)['json'](_0x5c00a8);}return null;};}function patchUpdates(_0x419805){return function(_0xe83a8a){try{jsonpatch[_0x341e('0x22')](_0xe83a8a,_0x419805,!![]);}catch(_0x46e795){return BPromise['reject'](_0x46e795);}return _0xe83a8a[_0x341e('0x23')]();};}function saveUpdates(_0x5404c4,_0x59314f){return function(_0x4370d6){if(_0x4370d6){return _0x4370d6['update'](_0x5404c4)[_0x341e('0x24')](function(_0x383968){return _0x383968;});}return null;};}function removeEntity(_0x5b3f72,_0xed740e){return function(_0x4d9b2b){if(_0x4d9b2b){return _0x4d9b2b[_0x341e('0x25')]()[_0x341e('0x24')](function(){var _0x55322b=_0x4d9b2b[_0x341e('0x26')]({'plain':!![]});var _0x4d3169=_0x341e('0x27');return db[_0x341e('0x28')]['destroy']({'where':{'type':_0x4d3169,'resourceId':_0x55322b['id']}})['then'](function(){return _0x4d9b2b;});})[_0x341e('0x24')](function(){_0x5b3f72[_0x341e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0589,_0x9a6e6c){return function(_0x3ac47a){if(!_0x3ac47a){_0x2e0589[_0x341e('0x19')](0x194);}return _0x3ac47a;};}function handleError(_0xda27c0,_0x17daee){_0x17daee=_0x17daee||0x1f4;return function(_0x1da3ae){logger['error'](_0x1da3ae['stack']);if(_0x1da3ae[_0x341e('0x29')]){delete _0x1da3ae[_0x341e('0x29')];}_0xda27c0['status'](_0x17daee)['send'](_0x1da3ae);};}exports[_0x341e('0x2a')]=function(_0x473604,_0x43225a){var _0x290d51={},_0x57612a={},_0x179ba5={'count':0x0,'rows':[]};var _0x2d31a5=_[_0x341e('0x2b')](db[_0x341e('0x2c')][_0x341e('0x2d')],function(_0x1c5ef4){return{'name':_0x1c5ef4[_0x341e('0x2e')],'type':_0x1c5ef4[_0x341e('0x2f')][_0x341e('0x30')]};});_0x57612a[_0x341e('0x31')]=_['map'](_0x2d31a5,'name');_0x57612a['query']=_[_0x341e('0x32')](_0x473604[_0x341e('0x33')]);_0x57612a[_0x341e('0x34')]=_['intersection'](_0x57612a[_0x341e('0x31')],_0x57612a[_0x341e('0x33')]);_0x290d51[_0x341e('0x35')]=_[_0x341e('0x36')](_0x57612a['model'],qs[_0x341e('0x37')](_0x473604['query'][_0x341e('0x37')]));_0x290d51[_0x341e('0x35')]=_0x290d51[_0x341e('0x35')]['length']?_0x290d51['attributes']:_0x57612a[_0x341e('0x31')];if(!_0x473604[_0x341e('0x33')][_0x341e('0x38')](_0x341e('0x39'))){_0x290d51['limit']=qs[_0x341e('0x1e')](_0x473604[_0x341e('0x33')][_0x341e('0x1e')]);_0x290d51[_0x341e('0x1d')]=qs[_0x341e('0x1d')](_0x473604['query'][_0x341e('0x1d')]);}_0x290d51[_0x341e('0x3a')]=qs['sort'](_0x473604[_0x341e('0x33')]['sort']);delete _0x473604[_0x341e('0x33')][_0x341e('0x3b')];_0x290d51[_0x341e('0x3c')]=qs[_0x341e('0x34')](_[_0x341e('0x3d')](_0x473604[_0x341e('0x33')],_0x57612a[_0x341e('0x34')]),_0x2d31a5);if(_0x473604[_0x341e('0x33')][_0x341e('0x3e')]){_0x290d51[_0x341e('0x3c')]=_['merge'](_0x290d51['where'],{'$or':_['map'](_0x2d31a5,function(_0x598daf){if(_0x598daf[_0x341e('0x2f')]!==_0x341e('0x3f')){var _0x5957c9={};_0x5957c9[_0x598daf[_0x341e('0x29')]]={'$like':'%'+_0x473604[_0x341e('0x33')][_0x341e('0x3e')]+'%'};return _0x5957c9;}})});}_0x290d51=_[_0x341e('0x40')]({},_0x290d51,_0x473604[_0x341e('0x41')]);var _0x1da828={'where':_0x290d51[_0x341e('0x3c')]};return db['VoiceMusicOnHold'][_0x341e('0x1f')](_0x1da828)[_0x341e('0x24')](function(_0x2c635c){_0x179ba5[_0x341e('0x1f')]=_0x2c635c;if(_0x473604['query'][_0x341e('0x42')]){_0x290d51[_0x341e('0x43')]=[{'all':!![]}];}return db[_0x341e('0x2c')][_0x341e('0x44')](_0x290d51);})[_0x341e('0x24')](function(_0x333026){_0x179ba5[_0x341e('0x45')]=_0x333026;return _0x179ba5;})[_0x341e('0x24')](respondWithFilteredResult(_0x43225a,_0x290d51))[_0x341e('0x46')](handleError(_0x43225a,null));};exports[_0x341e('0x47')]=function(_0x27b6c3,_0xc3ac75){var _0x2e0100={'raw':![],'where':{'id':_0x27b6c3[_0x341e('0x48')]['id']}},_0x219b1a={};_0x219b1a['model']=_[_0x341e('0x32')](db[_0x341e('0x2c')][_0x341e('0x2d')]);_0x219b1a[_0x341e('0x33')]=_[_0x341e('0x32')](_0x27b6c3[_0x341e('0x33')]);_0x219b1a[_0x341e('0x34')]=_[_0x341e('0x36')](_0x219b1a[_0x341e('0x31')],_0x219b1a[_0x341e('0x33')]);_0x2e0100[_0x341e('0x35')]=_['intersection'](_0x219b1a['model'],qs['fields'](_0x27b6c3[_0x341e('0x33')][_0x341e('0x37')]));_0x2e0100[_0x341e('0x35')]=_0x2e0100['attributes'][_0x341e('0x49')]?_0x2e0100[_0x341e('0x35')]:_0x219b1a['model'];if(_0x27b6c3[_0x341e('0x33')]['includeAll']){_0x2e0100['include']=[{'all':!![]}];}_0x2e0100=_['merge']({},_0x2e0100,_0x27b6c3['options']);return db[_0x341e('0x2c')][_0x341e('0x4a')](_0x2e0100)[_0x341e('0x24')](handleEntityNotFound(_0xc3ac75,null))[_0x341e('0x24')](respondWithResult(_0xc3ac75,null))['catch'](handleError(_0xc3ac75,null));};exports['update']=function(_0x4f2d19,_0x4be84c){if(_0x4f2d19[_0x341e('0x4b')]['id']){delete _0x4f2d19[_0x341e('0x4b')]['id'];}return db[_0x341e('0x2c')]['find']({'where':{'id':_0x4f2d19['params']['id']}})[_0x341e('0x24')](handleEntityNotFound(_0x4be84c,null))['then'](saveUpdates(_0x4f2d19['body'],null))['then'](respondWithResult(_0x4be84c,null))[_0x341e('0x46')](handleError(_0x4be84c,null));};exports['create']=function(_0xdd5c30,_0xb6e17,_0x23b653){return db[_0x341e('0x4c')][_0x341e('0x4d')](function(_0x2dd9b4){if(_0xdd5c30[_0x341e('0x4b')][_0x341e('0x4e')]===_0x341e('0x4f')){_0xdd5c30['body'][_0x341e('0x50')]=path['join'](config[_0x341e('0x51')],_0x341e('0x52'),_0xdd5c30[_0x341e('0x4b')][_0x341e('0x29')]);}return db[_0x341e('0x2c')][_0x341e('0x53')](_0xdd5c30['body'],{'transaction':_0x2dd9b4})[_0x341e('0x24')](function(_0xcd5553){if(_0xdd5c30['body']['mode']===_0x341e('0x4f')){fs[_0x341e('0x54')](_0xcd5553[_0x341e('0x50')],parseInt(_0x341e('0x55'),0x8));}var _0x57a140=_0xdd5c30[_0x341e('0x56')][_0x341e('0x26')]({'plain':!![]});if(!_0x57a140)throw new Error(_0x341e('0x57'));if(_0x57a140[_0x341e('0x58')]===_0x341e('0x56')){var _0x1150f0=_0xcd5553[_0x341e('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x341e('0x4a')]({'where':{'name':_0x341e('0x27'),'userProfileId':_0x57a140[_0x341e('0x59')]},'raw':!![]})[_0x341e('0x24')](function(_0x2f4052){if(_0x2f4052&&_0x2f4052[_0x341e('0x5a')]===0x0){return db[_0x341e('0x28')][_0x341e('0x53')]({'name':_0x1150f0[_0x341e('0x29')],'resourceId':_0x1150f0['id'],'type':_0x2f4052[_0x341e('0x29')],'sectionId':_0x2f4052['id']},{})[_0x341e('0x24')](function(){return _0xcd5553;});}else{return _0xcd5553;}})[_0x341e('0x46')](function(_0x280b15){logger[_0x341e('0x5b')](_0x341e('0x5c'),_0x280b15);});}return _0xcd5553;});})[_0x341e('0x24')](respondWithResult(_0xb6e17,0xc9))[_0x341e('0x46')](handleError(_0xb6e17,null));};exports['destroy']=function(_0x2450a6,_0x2d6485,_0x1bcf8a){var _0x388a75;return db[_0x341e('0x2c')][_0x341e('0x4a')]({'where':{'id':_0x2450a6['params']['id']}})[_0x341e('0x24')](function(_0xfe0c10){if(_0xfe0c10){return db['sequelize'][_0x341e('0x4d')](function(_0x4960ec){return _0xfe0c10[_0x341e('0x25')]({'transaction':_0x4960ec,'raw':!![]})['then'](function(_0x5bc158){if(_0x5bc158[_0x341e('0x50')]){fs[_0x341e('0x5d')](_0x5bc158['directory'])[_0x341e('0x5e')](function(_0x3874de){fs[_0x341e('0x5f')](path['join'](_0x5bc158[_0x341e('0x50')],_0x3874de));});fs[_0x341e('0x60')](_0x5bc158[_0x341e('0x50')]);}return _0x5bc158;});})['catch'](function(_0x461876){throw new db[(_0x341e('0x61'))][(_0x341e('0x62'))](_0x461876['message']);});}})[_0x341e('0x24')](handleEntityNotFound(_0x2d6485,null))[_0x341e('0x24')](removeEntity(_0x2d6485,null))[_0x341e('0x46')](handleError(_0x2d6485,null));};exports[_0x341e('0x63')]=function(_0x25c83e,_0x1f3aad,_0x3ed730){return db['sequelize']['transaction'](function(_0x384f51){var _0x5136ef;return db[_0x341e('0x2c')]['find']({'where':{'id':_0x25c83e[_0x341e('0x48')]['id']}})[_0x341e('0x24')](function(_0x4d1ac3){if(_0x4d1ac3){_0x5136ef=_0x4d1ac3;return _0x4d1ac3[_0x341e('0x63')](_0x25c83e[_0x341e('0x4b')]['id'],{'transaction':_0x384f51});}})[_0x341e('0x24')](function(_0x3de463){if(_0x3de463){return db['Sound'][_0x341e('0x64')]({'where':{'id':_0x25c83e['body']['id']},'attributes':['id',_0x341e('0x29'),_0x341e('0x65'),_0x341e('0x66'),_0x341e('0x67')],'raw':!![]});}})[_0x341e('0x24')](function(_0x36a08a){if(_0x36a08a){var _0x3bad8b=path[_0x341e('0x68')](config[_0x341e('0x51')],'server/files/sounds/converted',util['format'](_0x341e('0x69'),path['basename'](_0x36a08a[_0x341e('0x65')],path[_0x341e('0x6a')](_0x36a08a[_0x341e('0x65')])),_0x36a08a['converted_format']));var _0x3bf600=path[_0x341e('0x68')](config[_0x341e('0x51')],_0x341e('0x52'),_0x5136ef['name'],util[_0x341e('0x6b')]('%s.%s',_0x36a08a[_0x341e('0x29')],_0x36a08a[_0x341e('0x66')]));fs['symlinkSync'](_0x3bad8b,_0x3bf600);return _0x36a08a;}})['catch'](function(_0x77f9f2){throw new db[(_0x341e('0x61'))][(_0x341e('0x62'))](_0x77f9f2['message']);});})['then'](handleEntityNotFound(_0x1f3aad,null))['then'](respondWithResult(_0x1f3aad,0xc9))[_0x341e('0x46')](handleError(_0x1f3aad,null));};exports[_0x341e('0x6c')]=function(_0x2587c2,_0x1d80c7,_0x5108a2){return db['sequelize']['transaction'](function(_0xca9ae6){var _0x35db49;return db[_0x341e('0x2c')][_0x341e('0x64')]({'where':{'id':_0x2587c2[_0x341e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d80c7,null))[_0x341e('0x24')](function(_0x54ee20){if(_0x54ee20){_0x35db49=_0x54ee20;return _0x54ee20['removeSound'](_0x2587c2[_0x341e('0x48')][_0x341e('0x6d')]);}})[_0x341e('0x24')](function(_0x50ca2a){if(_0x50ca2a){return db[_0x341e('0x6e')][_0x341e('0x64')]({'where':{'id':_0x2587c2[_0x341e('0x48')][_0x341e('0x6d')]},'attributes':['id',_0x341e('0x29'),_0x341e('0x65'),_0x341e('0x66'),_0x341e('0x67')],'raw':!![]});}})[_0x341e('0x24')](function(_0x5c27c0){if(_0x5c27c0){fs[_0x341e('0x5f')](path[_0x341e('0x68')](_0x35db49[_0x341e('0x50')],util[_0x341e('0x6b')](_0x341e('0x69'),_0x5c27c0['name'],_0x5c27c0['converted_format'])));return _0x5c27c0;}})[_0x341e('0x46')](function(_0x19ef48){throw new db['Sequelize'][(_0x341e('0x62'))](_0x19ef48['message']);});})[_0x341e('0x24')](handleEntityNotFound(_0x1d80c7,null))[_0x341e('0x24')](respondWithStatusCode(_0x1d80c7,0xcc))[_0x341e('0x46')](handleError(_0x1d80c7,null));};exports[_0x341e('0x6f')]=function(_0x1f50f3,_0x48d6b3,_0xde7476){var _0x24f890={};var _0x3c4c39={};var _0x5e3260;var _0x115392;return db[_0x341e('0x2c')][_0x341e('0x64')]({'where':{'id':_0x1f50f3[_0x341e('0x48')]['id']}})['then'](handleEntityNotFound(_0x48d6b3,null))[_0x341e('0x24')](function(_0x424620){if(_0x424620){_0x5e3260=_0x424620;_0x3c4c39[_0x341e('0x31')]=_[_0x341e('0x32')](db[_0x341e('0x6e')][_0x341e('0x2d')]);_0x3c4c39[_0x341e('0x33')]=_[_0x341e('0x32')](_0x1f50f3['query']);_0x3c4c39[_0x341e('0x34')]=_[_0x341e('0x36')](_0x3c4c39[_0x341e('0x31')],_0x3c4c39[_0x341e('0x33')]);_0x24f890[_0x341e('0x35')]=_['intersection'](_0x3c4c39[_0x341e('0x31')],qs['fields'](_0x1f50f3[_0x341e('0x33')][_0x341e('0x37')]));_0x24f890[_0x341e('0x35')]=_0x24f890['attributes']['length']?_0x24f890[_0x341e('0x35')]:_0x3c4c39[_0x341e('0x31')];_0x24f890[_0x341e('0x3a')]=qs[_0x341e('0x3b')](_0x1f50f3[_0x341e('0x33')][_0x341e('0x3b')]);_0x24f890[_0x341e('0x3c')]=qs[_0x341e('0x34')](_[_0x341e('0x3d')](_0x1f50f3[_0x341e('0x33')],_0x3c4c39[_0x341e('0x34')]));if(_0x1f50f3['query'][_0x341e('0x3e')]){_0x24f890[_0x341e('0x3c')]=_[_0x341e('0x40')](_0x24f890[_0x341e('0x3c')],{'$or':_[_0x341e('0x2b')](_0x24f890[_0x341e('0x35')],function(_0x3981d0){var _0x42a0f8={};_0x42a0f8[_0x3981d0]={'$like':'%'+_0x1f50f3['query'][_0x341e('0x3e')]+'%'};return _0x42a0f8;})});}_0x24f890=_[_0x341e('0x40')]({},_0x24f890,_0x1f50f3['options']);return _0x5e3260[_0x341e('0x6f')](_0x24f890);}})[_0x341e('0x24')](function(_0x817206){if(_0x817206){_0x115392=_0x817206[_0x341e('0x49')];if(!_0x1f50f3[_0x341e('0x33')][_0x341e('0x38')](_0x341e('0x39'))){_0x24f890[_0x341e('0x1e')]=qs[_0x341e('0x1e')](_0x1f50f3[_0x341e('0x33')][_0x341e('0x1e')]);_0x24f890[_0x341e('0x1d')]=qs[_0x341e('0x1d')](_0x1f50f3['query']['offset']);}return _0x5e3260['getSounds'](_0x24f890);}})[_0x341e('0x24')](function(_0xab674b){if(_0xab674b){return _0xab674b?{'count':_0x115392,'rows':_0xab674b}:null;}})[_0x341e('0x24')](respondWithResult(_0x48d6b3,null))['catch'](handleError(_0x48d6b3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index b245429..4185d49 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 _0x3bd1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0xa92c7c,_0xee1c51){var _0x5ba7e7=function(_0x5d7cd2){while(--_0x5d7cd2){_0xa92c7c['push'](_0xa92c7c['shift']());}};_0x5ba7e7(++_0xee1c51);}(_0x3bd1,0xc2));var _0x13bd=function(_0x34c8d0,_0x3347f3){_0x34c8d0=_0x34c8d0-0x0;var _0x1da282=_0x3bd1[_0x34c8d0];return _0x1da282;};'use strict';var _=require(_0x13bd('0x0'));var util=require(_0x13bd('0x1'));var logger=require(_0x13bd('0x2'))(_0x13bd('0x3'));var moment=require(_0x13bd('0x4'));var BPromise=require(_0x13bd('0x5'));var rp=require(_0x13bd('0x6'));var fs=require('fs');var path=require(_0x13bd('0x7'));var rimraf=require(_0x13bd('0x8'));var config=require(_0x13bd('0x9'));var attributes=require(_0x13bd('0xa'));module[_0x13bd('0xb')]=function(_0x1b09f8,_0x3ceeb6){return _0x1b09f8['define'](_0x13bd('0xc'),attributes,{'tableName':_0x13bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa95d=['./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','util','api','moment','request-promise','path','rimraf'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0xa95d,0x1b3));var _0xda95=function(_0x47ae44,_0x1ecf33){_0x47ae44=_0x47ae44-0x0;var _0x37c675=_0xa95d[_0x47ae44];return _0x37c675;};'use strict';var _=require('lodash');var util=require(_0xda95('0x0'));var logger=require('../../config/logger')(_0xda95('0x1'));var moment=require(_0xda95('0x2'));var BPromise=require('bluebird');var rp=require(_0xda95('0x3'));var fs=require('fs');var path=require(_0xda95('0x4'));var rimraf=require(_0xda95('0x5'));var config=require('../../config/environment');var attributes=require(_0xda95('0x6'));module['exports']=function(_0x3db7d5,_0x36eef8){return _0x3db7d5[_0xda95('0x7')](_0xda95('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index b9e1818..39932ba 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x294aef,_0x378f98){var _0x4d235d=function(_0x105d6c){while(--_0x105d6c){_0x294aef['push'](_0x294aef['shift']());}};_0x4d235d(++_0x378f98);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a5e3c,_0x2f7543){_0x3a5e3c=_0x3a5e3c-0x0;var _0x5cb998=_0xedd9[_0x3a5e3c];return _0x5cb998;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x318939,_0x113777){var _0x5c750b=function(_0x1936cf){while(--_0x1936cf){_0x318939['push'](_0x318939['shift']());}};_0x5c750b(++_0x113777);}(_0x70e0,0x17b));var _0x070e=function(_0x41b44a,_0x41dbec){_0x41b44a=_0x41b44a-0x0;var _0x13fc4d=_0x70e0[_0x41b44a];return _0x13fc4d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index ec25c77..cf0ae3b 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 _0xf0a2=['path','connect-timeout','express','fs-extra','../../components/auth/service','./voicePrefix.controller','isAuthenticated','get','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','multer','util'];(function(_0x2de77c,_0x570143){var _0x434551=function(_0x1e6376){while(--_0x1e6376){_0x2de77c['push'](_0x2de77c['shift']());}};_0x434551(++_0x570143);}(_0xf0a2,0x1ca));var _0x2f0a=function(_0x5273ab,_0x209b87){_0x5273ab=_0x5273ab-0x0;var _0x544dfb=_0xf0a2[_0x5273ab];return _0x544dfb;};'use strict';var multer=require(_0x2f0a('0x0'));var util=require(_0x2f0a('0x1'));var path=require(_0x2f0a('0x2'));var timeout=require(_0x2f0a('0x3'));var express=require(_0x2f0a('0x4'));var router=express['Router']();var fs_extra=require(_0x2f0a('0x5'));var auth=require(_0x2f0a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f0a('0x7'));router['get']('/',auth[_0x2f0a('0x8')](),controller['index']);router[_0x2f0a('0x9')]('/describe',auth[_0x2f0a('0x8')](),controller['describe']);router[_0x2f0a('0x9')](_0x2f0a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x2f0a('0x9')](_0x2f0a('0xb'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0xc')]);router[_0x2f0a('0x9')](_0x2f0a('0xd'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0xe')]);router['post']('/',auth[_0x2f0a('0x8')](),controller['create']);router[_0x2f0a('0xf')]('/:id/users',auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x10')]);router['post'](_0x2f0a('0xd'),auth['isAuthenticated'](),controller[_0x2f0a('0x11')]);router[_0x2f0a('0x12')](_0x2f0a('0xa'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x13')]);router[_0x2f0a('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2f0a('0x14')]('/:id/users',auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x15')]);router[_0x2f0a('0x14')](_0x2f0a('0xd'),auth[_0x2f0a('0x8')](),controller[_0x2f0a('0x16')]);module['exports']=router; \ No newline at end of file +var _0x207d=['../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','/:id/teams','getTeams','addAgents','post','addTeams','put','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x207d,0x10d));var _0xd207=function(_0xb96f3d,_0x159ac7){_0xb96f3d=_0xb96f3d-0x0;var _0x2b0827=_0x207d[_0xb96f3d];return _0x2b0827;};'use strict';var multer=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var path=require(_0xd207('0x2'));var timeout=require(_0xd207('0x3'));var express=require('express');var router=express[_0xd207('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd207('0x5'));var interaction=require(_0xd207('0x6'));var config=require('../../config/environment');var controller=require(_0xd207('0x7'));router[_0xd207('0x8')]('/',auth[_0xd207('0x9')](),controller[_0xd207('0xa')]);router[_0xd207('0x8')](_0xd207('0xb'),auth[_0xd207('0x9')](),controller[_0xd207('0xc')]);router[_0xd207('0x8')](_0xd207('0xd'),auth[_0xd207('0x9')](),controller['show']);router[_0xd207('0x8')](_0xd207('0xe'),auth[_0xd207('0x9')](),controller['getAgents']);router['get'](_0xd207('0xf'),auth[_0xd207('0x9')](),controller[_0xd207('0x10')]);router['post']('/',auth[_0xd207('0x9')](),controller['create']);router['post']('/:id/users',auth[_0xd207('0x9')](),controller[_0xd207('0x11')]);router[_0xd207('0x12')](_0xd207('0xf'),auth[_0xd207('0x9')](),controller[_0xd207('0x13')]);router[_0xd207('0x14')](_0xd207('0xd'),auth[_0xd207('0x9')](),controller[_0xd207('0x15')]);router[_0xd207('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd207('0x17')]);router[_0xd207('0x16')](_0xd207('0xe'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xd207('0x16')](_0xd207('0xf'),auth[_0xd207('0x9')](),controller[_0xd207('0x18')]);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 f06cf48..d71f32e 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 _0xad1f=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','exports'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xad1f,0x1e9));var _0xfad1=function(_0xba7416,_0x4cad85){_0xba7416=_0xba7416-0x0;var _0xaf6274=_0xad1f[_0xba7416];return _0xaf6274;};'use strict';var Sequelize=require('sequelize');module[_0xfad1('0x0')]={'name':{'type':Sequelize[_0xfad1('0x1')],'allowNull':![],'unique':_0xfad1('0x2')},'prefix':{'type':Sequelize[_0xfad1('0x3')],'get':function(_0x2f5581){return _0xfad1('0x4')+this[_0xfad1('0x5')](_0xfad1('0x2'))+'-';}},'description':{'type':Sequelize[_0xfad1('0x1')]},'callerIdAll':{'type':Sequelize[_0xfad1('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xfad1('0x6')]}}; \ No newline at end of file +var _0xc68f=['VIRTUAL','INTEGER','sequelize','exports','STRING','name'];(function(_0x118792,_0x112489){var _0x3a65fe=function(_0x383b32){while(--_0x383b32){_0x118792['push'](_0x118792['shift']());}};_0x3a65fe(++_0x112489);}(_0xc68f,0x1be));var _0xfc68=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc68f[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xfc68('0x0'));module[_0xfc68('0x1')]={'name':{'type':Sequelize[_0xfc68('0x2')],'allowNull':![],'unique':_0xfc68('0x3')},'prefix':{'type':Sequelize[_0xfc68('0x4')],'get':function(_0x1f219a){return'system-'+this['getDataValue'](_0xfc68('0x3'))+'-';}},'description':{'type':Sequelize[_0xfc68('0x2')]},'callerIdAll':{'type':Sequelize[_0xfc68('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xfc68('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 53947d4..7f3ea17 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 _0x4e2e=['from','team_has_voice_prefixes','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','findAll','rows','show','params','include','options','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','getTeams','addTeams','Team','online','interface','Agents','each','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId'];(function(_0x3fa29a,_0x218173){var _0x4486d8=function(_0x4670e2){while(--_0x4670e2){_0x3fa29a['push'](_0x3fa29a['shift']());}};_0x4486d8(++_0x218173);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3f84f4,_0x40cb2c){_0x3f84f4=_0x3f84f4-0x0;var _0x5079c7=_0x4e2e[_0x3f84f4];return _0x5079c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];config[_0xe4e2('0x1a')]=_[_0xe4e2('0x1b')](config[_0xe4e2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4e2('0x1c'))(new Redis(config[_0xe4e2('0x1a')]));require(_0xe4e2('0x1d'))[_0xe4e2('0x1e')](socket);function respondWithStatusCode(_0x202486,_0x50678d){_0x50678d=_0x50678d||0xcc;return function(_0x58e012){if(_0x58e012){return _0x202486[_0xe4e2('0x1f')](_0x50678d);}return _0x202486[_0xe4e2('0x20')](_0x50678d)[_0xe4e2('0x21')]();};}function respondWithResult(_0x28ee12,_0x217ea5){_0x217ea5=_0x217ea5||0xc8;return function(_0x54107a){if(_0x54107a){return _0x28ee12[_0xe4e2('0x20')](_0x217ea5)[_0xe4e2('0x22')](_0x54107a);}};}function respondWithFilteredResult(_0x340935,_0x4fe2f2){return function(_0x196f16){if(_0x196f16){var _0x54c80b=typeof _0x4fe2f2[_0xe4e2('0x23')]===_0xe4e2('0x24')&&typeof _0x4fe2f2[_0xe4e2('0x25')]===_0xe4e2('0x24');var _0x3dfbdf=_0x196f16[_0xe4e2('0x26')];var _0x339d00=_0x54c80b?0x0:_0x4fe2f2[_0xe4e2('0x23')];var _0x4769dd=_0x54c80b?_0x196f16[_0xe4e2('0x26')]:_0x4fe2f2['offset']+_0x4fe2f2[_0xe4e2('0x25')];var _0x2e7ecd;if(_0x4769dd>=_0x3dfbdf){_0x4769dd=_0x3dfbdf;_0x2e7ecd=0xc8;}else{_0x2e7ecd=0xce;}_0x340935[_0xe4e2('0x20')](_0x2e7ecd);return _0x340935[_0xe4e2('0x27')](_0xe4e2('0x28'),_0x339d00+'-'+_0x4769dd+'/'+_0x3dfbdf)[_0xe4e2('0x22')](_0x196f16);}return null;};}function patchUpdates(_0x16f14b){return function(_0x51c67e){try{jsonpatch[_0xe4e2('0x29')](_0x51c67e,_0x16f14b,!![]);}catch(_0x2ab435){return BPromise[_0xe4e2('0x2a')](_0x2ab435);}return _0x51c67e['save']();};}function saveUpdates(_0x353030,_0x12ad33){return function(_0x598fa3){if(_0x598fa3){return _0x598fa3[_0xe4e2('0x2b')](_0x353030)[_0xe4e2('0x2c')](function(_0x29143c){return _0x29143c;});}return null;};}function removeEntity(_0x3f5265,_0x249b7e){return function(_0x5887c9){if(_0x5887c9){return _0x5887c9[_0xe4e2('0x2d')]()[_0xe4e2('0x2c')](function(){var _0x1f6d1f=_0x5887c9['get']({'plain':!![]});var _0x3a31b8=_0xe4e2('0x2e');return db[_0xe4e2('0x2f')]['destroy']({'where':{'type':_0x3a31b8,'resourceId':_0x1f6d1f['id']}})[_0xe4e2('0x2c')](function(){return _0x5887c9;});})['then'](function(){_0x3f5265[_0xe4e2('0x20')](0xcc)[_0xe4e2('0x21')]();});}};}function handleEntityNotFound(_0x52c849,_0x46926a){return function(_0x18e2e5){if(!_0x18e2e5){_0x52c849[_0xe4e2('0x1f')](0x194);}return _0x18e2e5;};}function handleError(_0x41500b,_0x1f7bcc){_0x1f7bcc=_0x1f7bcc||0x1f4;return function(_0x4d33de){logger['error'](_0x4d33de[_0xe4e2('0x30')]);if(_0x4d33de[_0xe4e2('0x31')]){delete _0x4d33de[_0xe4e2('0x31')];}_0x41500b[_0xe4e2('0x20')](_0x1f7bcc)[_0xe4e2('0x32')](_0x4d33de);};}exports[_0xe4e2('0x33')]=function(_0x1c7f9a,_0x40569e){var _0x37dec8={},_0x59eb={},_0x1c87b0={'count':0x0,'rows':[]};var _0x3fb693=_['map'](db[_0xe4e2('0x34')][_0xe4e2('0x35')],function(_0xe0846a){return{'name':_0xe0846a[_0xe4e2('0x36')],'type':_0xe0846a[_0xe4e2('0x37')][_0xe4e2('0x38')]};});_0x59eb['model']=_[_0xe4e2('0x39')](_0x3fb693,_0xe4e2('0x31'));_0x59eb[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x1c7f9a[_0xe4e2('0x3a')]);_0x59eb[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x59eb[_0xe4e2('0x3e')],_0x59eb[_0xe4e2('0x3a')]);_0x37dec8[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x59eb['model'],qs[_0xe4e2('0x40')](_0x1c7f9a['query'][_0xe4e2('0x40')]));_0x37dec8[_0xe4e2('0x3f')]=_0x37dec8['attributes'][_0xe4e2('0x41')]?_0x37dec8[_0xe4e2('0x3f')]:_0x59eb[_0xe4e2('0x3e')];if(!_0x1c7f9a[_0xe4e2('0x3a')]['hasOwnProperty'](_0xe4e2('0x42'))){_0x37dec8['limit']=qs[_0xe4e2('0x25')](_0x1c7f9a['query'][_0xe4e2('0x25')]);_0x37dec8[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x1c7f9a['query'][_0xe4e2('0x23')]);}_0x37dec8[_0xe4e2('0x43')]=qs['sort'](_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x37dec8[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x1c7f9a[_0xe4e2('0x3a')],_0x59eb[_0xe4e2('0x3c')]),_0x3fb693);if(_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x37dec8['where']=_['merge'](_0x37dec8[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x3fb693,function(_0x5d05a4){if(_0x5d05a4[_0xe4e2('0x37')]!=='VIRTUAL'){var _0x4d8a2d={};_0x4d8a2d[_0x5d05a4[_0xe4e2('0x31')]]={'$like':'%'+_0x1c7f9a[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x4d8a2d;}})});}_0x37dec8=_[_0xe4e2('0x48')]({},_0x37dec8,_0x1c7f9a['options']);var _0x45e88c={'where':_0x37dec8[_0xe4e2('0x45')]};return db[_0xe4e2('0x34')]['count'](_0x45e88c)[_0xe4e2('0x2c')](function(_0x4789cf){_0x1c87b0[_0xe4e2('0x26')]=_0x4789cf;if(_0x1c7f9a[_0xe4e2('0x3a')]['includeAll']){_0x37dec8['include']=[{'all':!![]}];}return db[_0xe4e2('0x34')][_0xe4e2('0x49')](_0x37dec8);})[_0xe4e2('0x2c')](function(_0x5c29c3){_0x1c87b0[_0xe4e2('0x4a')]=_0x5c29c3;return _0x1c87b0;})[_0xe4e2('0x2c')](respondWithFilteredResult(_0x40569e,_0x37dec8))['catch'](handleError(_0x40569e,null));};exports[_0xe4e2('0x4b')]=function(_0x3d55f9,_0x1538bd){var _0x17f30f={'raw':![],'where':{'id':_0x3d55f9[_0xe4e2('0x4c')]['id']}},_0x4ed88f={};_0x4ed88f[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['VoicePrefix'][_0xe4e2('0x35')]);_0x4ed88f[_0xe4e2('0x3a')]=_['keys'](_0x3d55f9['query']);_0x4ed88f[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],_0x4ed88f['query']);_0x17f30f[_0xe4e2('0x3f')]=_[_0xe4e2('0x3d')](_0x4ed88f[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x3d55f9['query'][_0xe4e2('0x40')]));_0x17f30f[_0xe4e2('0x3f')]=_0x17f30f[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x17f30f['attributes']:_0x4ed88f[_0xe4e2('0x3e')];if(_0x3d55f9[_0xe4e2('0x3a')]['includeAll']){_0x17f30f[_0xe4e2('0x4d')]=[{'all':!![]}];}_0x17f30f=_[_0xe4e2('0x48')]({},_0x17f30f,_0x3d55f9[_0xe4e2('0x4e')]);return db['VoicePrefix'][_0xe4e2('0x4f')](_0x17f30f)[_0xe4e2('0x2c')](handleEntityNotFound(_0x1538bd,null))[_0xe4e2('0x2c')](respondWithResult(_0x1538bd,null))['catch'](handleError(_0x1538bd,null));};exports['destroy']=function(_0xccf95e,_0x4c6253){return db[_0xe4e2('0x34')]['find']({'where':{'id':_0xccf95e[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x4c6253,null))[_0xe4e2('0x2c')](removeEntity(_0x4c6253,null))['catch'](handleError(_0x4c6253,null));};exports[_0xe4e2('0x50')]=function(_0x504496,_0x11bd63){return db[_0xe4e2('0x34')]['describe']()[_0xe4e2('0x2c')](respondWithResult(_0x11bd63,null))['catch'](handleError(_0x11bd63,null));};exports[_0xe4e2('0x51')]=function(_0xf0885,_0x53d31d){var _0x297186;return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x3e540d){return db[_0xe4e2('0x34')][_0xe4e2('0x51')](_0xf0885[_0xe4e2('0x54')],{'transaction':_0x3e540d})[_0xe4e2('0x2c')](function(_0x382d1b){_0x297186=_0x382d1b['get']({'plain':!![]});return db[_0xe4e2('0x55')][_0xe4e2('0x4f')]({'where':{'id':_0x297186[_0xe4e2('0x56')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x2b0885){return createVoicePrefixExtensions(_0x297186,_0x2b0885,_0x3e540d);});});})[_0xe4e2('0x2c')](function(){var _0x1e2012=_0xf0885[_0xe4e2('0x57')][_0xe4e2('0x58')]({'plain':!![]});if(!_0x1e2012)throw new Error(_0xe4e2('0x59'));if(_0x1e2012[_0xe4e2('0x5a')]==='user'){var _0x17a350=_0x297186;return db[_0xe4e2('0x5b')][_0xe4e2('0x4f')]({'where':{'name':_0xe4e2('0x2e'),'userProfileId':_0x1e2012['userProfileId']},'raw':!![]})[_0xe4e2('0x2c')](function(_0x1250a2){if(_0x1250a2&&_0x1250a2['autoAssociation']===0x0){return db[_0xe4e2('0x2f')][_0xe4e2('0x51')]({'name':_0x17a350[_0xe4e2('0x31')],'resourceId':_0x17a350['id'],'type':_0x1250a2[_0xe4e2('0x31')],'sectionId':_0x1250a2['id']},{})['then'](function(){return _0x297186;});}else{return _0x297186;}})[_0xe4e2('0x5c')](function(_0x5c9d88){logger[_0xe4e2('0x5d')](_0xe4e2('0x5e'),_0x5c9d88);throw _0x5c9d88;});}return _0x297186;})[_0xe4e2('0x2c')](respondWithResult(_0x53d31d,null))[_0xe4e2('0x5c')](handleError(_0x53d31d,null));};function Extension(_0x2cc813,_0x26ab38,_0x467cec,_0x33c5f4){this[_0xe4e2('0x5f')]=_0xe4e2('0x60');this[_0xe4e2('0x61')]=_0x2cc813;this[_0xe4e2('0x62')]=_0x467cec;this['type']=_0xe4e2('0x63');this['description']='Voice\x20Prefix\x20Extension';this[_0xe4e2('0x64')]=_0x26ab38;this[_0xe4e2('0x65')]=_0x33c5f4;}function createVoicePrefixExtensions(_0xa27bd1,_0x5e4e16,_0x477acd){return new BPromise(function(_0x4b6dfc,_0xb9e975){var _0x9ba757=new Extension(formatPrefixName(_0xa27bd1['prefix']),0x1,_0xe4e2('0x66'),_0xe4e2('0x67'));_0x9ba757['VoicePrefixId']=_0xa27bd1['id'];return db[_0xe4e2('0x55')][_0xe4e2('0x51')](_0x9ba757,{'transaction':_0x477acd})['then'](function(_0x476533){var _0x2ad558=_0x476533[_0xe4e2('0x58')]({'plain':!![]});var _0x3f7be9=_['map'](addVoicePrefixExtensions(_0xa27bd1,_0x5e4e16),function(_0x22640a){_0x22640a[_0xe4e2('0x56')]=_0x2ad558['id'];_0x22640a[_0xe4e2('0x68')]=_0xa27bd1['id'];return _0x22640a;});return db[_0xe4e2('0x55')][_0xe4e2('0x69')](_0x3f7be9,{'transaction':_0x477acd})[_0xe4e2('0x2c')](function(_0x1ef7f8){if(!_0x1ef7f8){return _0xb9e975(_0xe4e2('0x6a'));}else{return _0x4b6dfc(_0x1ef7f8);}})[_0xe4e2('0x5c')](function(_0x593635){return _0xb9e975(_0x593635);});});;});};function addVoicePrefixExtensions(_0x59b1c0,_0x5cd517){var _0x39f59c=[];var _0x17d904=formatPrefixName(_0x59b1c0[_0xe4e2('0x6b')]);_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x2,_0xe4e2('0x6d'),_0xe4e2('0x6e')+_0x59b1c0[_0xe4e2('0x31')]));if(_0x59b1c0['callerIdAll']){_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x3,_0xe4e2('0x6d'),_0xe4e2('0x6f')+_0x59b1c0[_0xe4e2('0x70')]));}else{_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x3,_0xe4e2('0x66'),_0xe4e2('0x71')));}_0x39f59c[_0xe4e2('0x6c')](new Extension(_0x17d904,0x4,_0xe4e2('0x72'),_0x5cd517[_0xe4e2('0x5f')]+','+_0xe4e2('0x73')+(0x8+_0x59b1c0[_0xe4e2('0x31')][_0xe4e2('0x41')])+'}'+','+0x1));return _0x39f59c;}function formatPrefixName(_0x2ad8d1){var _0x3dde87='_';for(var _0x51d58d=0x0;_0x51d58d<_0x2ad8d1[_0xe4e2('0x41')];_0x51d58d++){if(_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d)=='-'){_0x3dde87+=_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d);}else{_0x3dde87+='['+_0x2ad8d1[_0xe4e2('0x74')](_0x51d58d)+']';}}_0x3dde87+='.';return _0x3dde87;}exports[_0xe4e2('0x2b')]=function(_0x26f90d,_0x26b31a,_0x3f40f8){var _0x134eec=_0x26f90d[_0xe4e2('0x54')];_0x134eec['prefix']=_0xe4e2('0x75')+_0x134eec[_0xe4e2('0x31')]+'-';return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x24859b){return db[_0xe4e2('0x34')][_0xe4e2('0x2b')](_0x134eec,{'where':{'id':_0x134eec['id']},'transaction':_0x24859b})[_0xe4e2('0x2c')](function(){return db['VoiceExtension'][_0xe4e2('0x2d')]({'where':{'VoicePrefixId':_0x134eec['id']},'transaction':_0x24859b})[_0xe4e2('0x2c')](function(){return db[_0xe4e2('0x55')][_0xe4e2('0x4f')]({'where':{'id':_0x134eec[_0xe4e2('0x56')]},'raw':!![]})[_0xe4e2('0x2c')](function(_0x22f79e){return createVoicePrefixExtensions(_0x134eec,_0x22f79e,_0x24859b);});});});})[_0xe4e2('0x2c')](function(){return db[_0xe4e2('0x34')][_0xe4e2('0x76')](_0x134eec['id']);})['then'](respondWithResult(_0x26b31a,null))[_0xe4e2('0x5c')](handleError(_0x26b31a,null));};exports[_0xe4e2('0x77')]=function(_0x4da351,_0x2017d,_0x2cada0){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x4da351[_0xe4e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2017d,null))[_0xe4e2('0x2c')](function(_0x1447ee){if(_0x1447ee){return _0x1447ee[_0xe4e2('0x77')](_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')],_[_0xe4e2('0x79')](_0x4da351[_0xe4e2('0x54')],[_0xe4e2('0x78'),'id'])||{})['spread'](function(_0xbdd6b4){for(var _0x386253=0x0;_0x386253<_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')][_0xe4e2('0x41')];_0x386253+=0x1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7b'),{'UserId':Number(_0x4da351[_0xe4e2('0x54')][_0xe4e2('0x78')][_0x386253]),'VoicePrefixId':Number(_0x4da351['params']['id'])});}return _0xbdd6b4;});}})[_0xe4e2('0x2c')](respondWithResult(_0x2017d,null))[_0xe4e2('0x5c')](handleError(_0x2017d,null));};exports[_0xe4e2('0x7c')]=function(_0x40fa3c,_0x420559,_0x28368a){return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x40fa3c[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x420559,null))[_0xe4e2('0x2c')](function(_0x150c1a){if(_0x150c1a){return _0x150c1a[_0xe4e2('0x7c')](_0x40fa3c['query'][_0xe4e2('0x78')])['then'](function(){if(_[_0xe4e2('0x7d')](_0x40fa3c[_0xe4e2('0x3a')]['ids'])){for(var _0x326762=0x0;_0x326762<_0x40fa3c[_0xe4e2('0x3a')][_0xe4e2('0x78')][_0xe4e2('0x41')];_0x326762+=0x1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7e'),{'UserId':Number(_0x40fa3c[_0xe4e2('0x3a')]['ids'][_0x326762]),'VoicePrefixId':Number(_0x40fa3c[_0xe4e2('0x4c')]['id'])});}}else{socket[_0xe4e2('0x7a')]('userVoicePrefix:remove',{'UserId':Number(_0x40fa3c['query'][_0xe4e2('0x78')]),'VoicePrefixId':Number(_0x40fa3c[_0xe4e2('0x4c')]['id'])});}});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x420559,null))['catch'](handleError(_0x420559,null));};exports[_0xe4e2('0x7f')]=function(_0x5b0948,_0x3b45c3,_0x406c7e){var _0x5dfe42={};var _0x2783f7={};var _0x94e5e1;var _0x45ecb8;return db[_0xe4e2('0x34')][_0xe4e2('0x80')]({'where':{'id':_0x5b0948[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x3b45c3,null))[_0xe4e2('0x2c')](function(_0x3687d5){if(_0x3687d5){_0x94e5e1=_0x3687d5;_0x2783f7[_0xe4e2('0x3e')]=_['keys'](db[_0xe4e2('0x81')][_0xe4e2('0x35')]);_0x2783f7['query']=_[_0xe4e2('0x3b')](_0x5b0948['query']);_0x2783f7[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x2783f7[_0xe4e2('0x3e')],_0x2783f7[_0xe4e2('0x3a')]);_0x5dfe42['attributes']=_[_0xe4e2('0x3d')](_0x2783f7[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x40')]));_0x5dfe42[_0xe4e2('0x3f')]=_0x5dfe42[_0xe4e2('0x3f')]['length']?_0x5dfe42['attributes']:_0x2783f7[_0xe4e2('0x3e')];_0x5dfe42[_0xe4e2('0x43')]=qs[_0xe4e2('0x44')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x5dfe42[_0xe4e2('0x45')]=qs[_0xe4e2('0x3c')](_[_0xe4e2('0x46')](_0x5b0948[_0xe4e2('0x3a')],_0x2783f7[_0xe4e2('0x3c')]));if(_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x5dfe42[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x5dfe42[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x5dfe42[_0xe4e2('0x3f')],function(_0x1b630a){var _0x1930b9={};_0x1930b9[_0x1b630a]={'$like':'%'+_0x5b0948['query'][_0xe4e2('0x47')]+'%'};return _0x1930b9;})});}_0x5dfe42=_[_0xe4e2('0x48')]({},_0x5dfe42,_0x5b0948[_0xe4e2('0x4e')]);return _0x94e5e1['getAgents'](_0x5dfe42);}})['then'](function(_0xf31c76){if(_0xf31c76){_0x45ecb8=_0xf31c76['length'];if(!_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x82')](_0xe4e2('0x42'))){_0x5dfe42[_0xe4e2('0x25')]=qs[_0xe4e2('0x25')](_0x5b0948[_0xe4e2('0x3a')][_0xe4e2('0x25')]);_0x5dfe42[_0xe4e2('0x23')]=qs[_0xe4e2('0x23')](_0x5b0948['query'][_0xe4e2('0x23')]);}return _0x94e5e1[_0xe4e2('0x7f')](_0x5dfe42);}})['then'](function(_0x4ab01e){if(_0x4ab01e){return _0x4ab01e?{'count':_0x45ecb8,'rows':_0x4ab01e}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x3b45c3,null))[_0xe4e2('0x5c')](handleError(_0x3b45c3,null));};exports[_0xe4e2('0x83')]=function(_0x10c166,_0x11707e,_0x11a6f4){var _0x38675b={};var _0x39fcac={};var _0x272ebb;var _0x2558c2;return db['VoicePrefix'][_0xe4e2('0x80')]({'where':{'id':_0x10c166[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](handleEntityNotFound(_0x11707e,null))[_0xe4e2('0x2c')](function(_0x46d566){if(_0x46d566){_0x272ebb=_0x46d566;_0x39fcac[_0xe4e2('0x3e')]=_[_0xe4e2('0x3b')](db['Team'][_0xe4e2('0x35')]);_0x39fcac[_0xe4e2('0x3a')]=_[_0xe4e2('0x3b')](_0x10c166[_0xe4e2('0x3a')]);_0x39fcac[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x39fcac[_0xe4e2('0x3e')],_0x39fcac[_0xe4e2('0x3a')]);_0x38675b[_0xe4e2('0x3f')]=_['intersection'](_0x39fcac[_0xe4e2('0x3e')],qs[_0xe4e2('0x40')](_0x10c166[_0xe4e2('0x3a')]['fields']));_0x38675b[_0xe4e2('0x3f')]=_0x38675b[_0xe4e2('0x3f')][_0xe4e2('0x41')]?_0x38675b[_0xe4e2('0x3f')]:_0x39fcac[_0xe4e2('0x3e')];_0x38675b[_0xe4e2('0x43')]=qs['sort'](_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x44')]);_0x38675b[_0xe4e2('0x45')]=qs['filters'](_[_0xe4e2('0x46')](_0x10c166[_0xe4e2('0x3a')],_0x39fcac[_0xe4e2('0x3c')]));if(_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x47')]){_0x38675b[_0xe4e2('0x45')]=_[_0xe4e2('0x48')](_0x38675b[_0xe4e2('0x45')],{'$or':_[_0xe4e2('0x39')](_0x38675b[_0xe4e2('0x3f')],function(_0x3266a4){var _0x282545={};_0x282545[_0x3266a4]={'$like':'%'+_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x47')]+'%'};return _0x282545;})});}_0x38675b=_[_0xe4e2('0x48')]({},_0x38675b,_0x10c166['options']);return _0x272ebb['getTeams'](_0x38675b);}})[_0xe4e2('0x2c')](function(_0x4d730e){if(_0x4d730e){_0x2558c2=_0x4d730e['length'];if(!_0x10c166[_0xe4e2('0x3a')][_0xe4e2('0x82')](_0xe4e2('0x42'))){_0x38675b[_0xe4e2('0x25')]=qs['limit'](_0x10c166[_0xe4e2('0x3a')]['limit']);_0x38675b['offset']=qs[_0xe4e2('0x23')](_0x10c166['query'][_0xe4e2('0x23')]);}return _0x272ebb[_0xe4e2('0x83')](_0x38675b);}})[_0xe4e2('0x2c')](function(_0x4e6552){if(_0x4e6552){return _0x4e6552?{'count':_0x2558c2,'rows':_0x4e6552}:null;}})[_0xe4e2('0x2c')](respondWithResult(_0x11707e,null))[_0xe4e2('0x5c')](handleError(_0x11707e,null));};exports[_0xe4e2('0x84')]=function(_0x5e9fc3,_0x240089,_0x1b94e9){var _0x126eeb=_0x5e9fc3[_0xe4e2('0x54')]['ids'];var _0x35c2d4;return db[_0xe4e2('0x85')][_0xe4e2('0x49')]({'where':{'id':_0x126eeb},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe4e2('0x31'),_0xe4e2('0x86'),'voicePause',_0xe4e2('0x87')],'raw':!![]}]})['then'](function(_0x47186a){if(_0x47186a){_0x35c2d4=_0x47186a;var _0x3fa1eb=_['flatMap'](_0x47186a,function(_0x3a8a2f){var _0x4e722d=_0x3a8a2f[_0xe4e2('0x58')]({'plain':!![]});return _0x4e722d[_0xe4e2('0x88')];});return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x5e9fc3[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x50b129){return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x45431c){return _0x50b129['addTeams'](_0x126eeb,{'transaction':_0x45431c})[_0xe4e2('0x2c')](function(){return BPromise[_0xe4e2('0x89')](_0x35c2d4,function(_0x19f368){return db['TeamVoicePrefix'][_0xe4e2('0x8a')]({'TeamId':_0x19f368['id'],'VoicePrefixId':_0x5e9fc3[_0xe4e2('0x4c')]['id']},{'transaction':_0x45431c});});})[_0xe4e2('0x2c')](function(){return BPromise['each'](_0x3fa1eb,function(_0x151d22){return db[_0xe4e2('0x8b')][_0xe4e2('0x8c')]({'where':{'UserId':_0x151d22['id'],'VoicePrefixId':_0x5e9fc3[_0xe4e2('0x4c')]['id']},'transaction':_0x45431c});});})[_0xe4e2('0x2c')](function(){_0x3fa1eb[_0xe4e2('0x8d')](function(_0x19405d){socket[_0xe4e2('0x7a')](_0xe4e2('0x7b'),{'UserId':_0x19405d['id'],'VoicePrefixId':_0x50b129['id']});});});});});}})[_0xe4e2('0x2c')](respondWithStatusCode(_0x240089,null))[_0xe4e2('0x5c')](handleError(_0x240089,null));};exports[_0xe4e2('0x8e')]=function(_0x515f57,_0x28b119,_0x373c88){return db[_0xe4e2('0x85')][_0xe4e2('0x49')]({'where':{'id':_0x515f57[_0xe4e2('0x3a')][_0xe4e2('0x78')]},'attributes':['id'],'include':[{'model':db[_0xe4e2('0x81')],'as':_0xe4e2('0x88'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28b119,null))[_0xe4e2('0x2c')](function(_0x21fa74){var _0x273236=_[_0xe4e2('0x39')](_0x21fa74,'id');var _0x278ad0=[];var _0x416ebe=[];var _0xfb32dd=squel[_0xe4e2('0x8f')]();_0xfb32dd[_0xe4e2('0x90')](_0xe4e2('0x91'))[_0xe4e2('0x92')](_0xe4e2('0x93'),'tq')[_0xe4e2('0x94')](_0xe4e2('0x95'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x515f57[_0xe4e2('0x4c')]['id']);for(var _0x1060d9=0x0;_0x1060d9<_0x21fa74['length'];_0x1060d9+=0x1){let _0x3ca7ef=_0x21fa74[_0x1060d9];for(var _0x49dc91=0x0;_0x49dc91<_0x3ca7ef[_0xe4e2('0x88')][_0xe4e2('0x41')];_0x49dc91+=0x1){let _0x3cea27=_0x3ca7ef[_0xe4e2('0x88')][_0x49dc91];var _0x17b696=_0xfb32dd[_0xe4e2('0x96')]();_0x17b696['where'](_0xe4e2('0x97'),_0x3cea27['id']);_0x416ebe['push'](db[_0xe4e2('0x52')][_0xe4e2('0x3a')](_0x17b696[_0xe4e2('0x98')](),{'type':db[_0xe4e2('0x52')][_0xe4e2('0x99')][_0xe4e2('0x9a')]})[_0xe4e2('0x2c')](function(_0x55182e){if(_0x55182e['length']===0x1){return _0x3cea27['id'];}else{var _0x35d3da=_['every'](_['map'](_0x55182e,_0xe4e2('0x9b')),function(_0x2ab2d8){return _[_0xe4e2('0x9c')](_0x273236,_0x2ab2d8);});if(_0x35d3da){return _0x3cea27['id'];}}}));}}return BPromise[_0xe4e2('0x9d')](_0x416ebe)[_0xe4e2('0x2c')](function(_0x10a6c5){_0x278ad0=_(_0x278ad0)[_0xe4e2('0x9e')](_0x10a6c5)[_0xe4e2('0x9f')]()['value']();return db[_0xe4e2('0x34')][_0xe4e2('0x4f')]({'where':{'id':_0x515f57[_0xe4e2('0x4c')]['id']}})[_0xe4e2('0x2c')](function(_0x45ee82){return db[_0xe4e2('0x52')][_0xe4e2('0x53')](function(_0x181f47){return _0x45ee82[_0xe4e2('0x8e')](_0x515f57[_0xe4e2('0x3a')][_0xe4e2('0x78')],{'transaction':_0x181f47})['then'](function(){if(!_[_0xe4e2('0xa0')](_0x278ad0)){return _0x45ee82[_0xe4e2('0x7c')](_0x278ad0,{'transaction':_0x181f47});}})[_0xe4e2('0x2c')](function(){_0x278ad0['forEach'](function(_0x3dabd1){socket[_0xe4e2('0x7a')](_0xe4e2('0x7e'),{'UserId':_0x3dabd1,'VoicePrefixId':_0x45ee82['id']});});});});});});})[_0xe4e2('0x2c')](respondWithStatusCode(_0x28b119,null))[_0xe4e2('0x5c')](handleError(_0x28b119,null));}; \ No newline at end of file +var _0xf7b4=['filter','nolimit','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','options','find','describe','sequelize','transaction','create','body','get','VoiceExtension','VoiceExtensionId','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','update','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','filters','getTeams','Team'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xf7b4,0x152));var _0x4f7b=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0xf7b4[_0x396466];return _0x5e9ab4;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x7'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4f7b('0x17')]=_[_0x4f7b('0x18')](config[_0x4f7b('0x17')],{'host':_0x4f7b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f7b('0x17')]));require(_0x4f7b('0x1a'))[_0x4f7b('0x1b')](socket);function respondWithStatusCode(_0x43a51a,_0x339486){_0x339486=_0x339486||0xcc;return function(_0x330de9){if(_0x330de9){return _0x43a51a[_0x4f7b('0x1c')](_0x339486);}return _0x43a51a[_0x4f7b('0x1d')](_0x339486)[_0x4f7b('0x1e')]();};}function respondWithResult(_0x29fdd5,_0x1a28b8){_0x1a28b8=_0x1a28b8||0xc8;return function(_0x1e7afc){if(_0x1e7afc){return _0x29fdd5['status'](_0x1a28b8)[_0x4f7b('0x1f')](_0x1e7afc);}};}function respondWithFilteredResult(_0x496322,_0x5b5ee3){return function(_0x24e5cf){if(_0x24e5cf){var _0x3813da=typeof _0x5b5ee3['offset']===_0x4f7b('0x20')&&typeof _0x5b5ee3[_0x4f7b('0x21')]===_0x4f7b('0x20');var _0xf2311f=_0x24e5cf['count'];var _0x1daa79=_0x3813da?0x0:_0x5b5ee3['offset'];var _0x41cf36=_0x3813da?_0x24e5cf[_0x4f7b('0x22')]:_0x5b5ee3[_0x4f7b('0x23')]+_0x5b5ee3[_0x4f7b('0x21')];var _0x27127b;if(_0x41cf36>=_0xf2311f){_0x41cf36=_0xf2311f;_0x27127b=0xc8;}else{_0x27127b=0xce;}_0x496322[_0x4f7b('0x1d')](_0x27127b);return _0x496322[_0x4f7b('0x24')](_0x4f7b('0x25'),_0x1daa79+'-'+_0x41cf36+'/'+_0xf2311f)[_0x4f7b('0x1f')](_0x24e5cf);}return null;};}function patchUpdates(_0x5508bd){return function(_0x410176){try{jsonpatch[_0x4f7b('0x26')](_0x410176,_0x5508bd,!![]);}catch(_0x2c9ea6){return BPromise['reject'](_0x2c9ea6);}return _0x410176[_0x4f7b('0x27')]();};}function saveUpdates(_0x4610a4,_0x5d22f4){return function(_0x15dbec){if(_0x15dbec){return _0x15dbec['update'](_0x4610a4)[_0x4f7b('0x28')](function(_0x2429be){return _0x2429be;});}return null;};}function removeEntity(_0x23c820,_0x278c41){return function(_0x17aa9d){if(_0x17aa9d){return _0x17aa9d[_0x4f7b('0x29')]()[_0x4f7b('0x28')](function(){var _0x3ad769=_0x17aa9d['get']({'plain':!![]});var _0x6c9626=_0x4f7b('0x2a');return db[_0x4f7b('0x2b')]['destroy']({'where':{'type':_0x6c9626,'resourceId':_0x3ad769['id']}})[_0x4f7b('0x28')](function(){return _0x17aa9d;});})[_0x4f7b('0x28')](function(){_0x23c820[_0x4f7b('0x1d')](0xcc)[_0x4f7b('0x1e')]();});}};}function handleEntityNotFound(_0x1ccce0,_0x4ebffa){return function(_0xac1f93){if(!_0xac1f93){_0x1ccce0[_0x4f7b('0x1c')](0x194);}return _0xac1f93;};}function handleError(_0x9a675c,_0x59d3ad){_0x59d3ad=_0x59d3ad||0x1f4;return function(_0x7de561){logger['error'](_0x7de561['stack']);if(_0x7de561[_0x4f7b('0x2c')]){delete _0x7de561['name'];}_0x9a675c[_0x4f7b('0x1d')](_0x59d3ad)[_0x4f7b('0x2d')](_0x7de561);};}exports[_0x4f7b('0x2e')]=function(_0x1cf980,_0x105ffb){var _0x4e5862={},_0x13a113={},_0x179372={'count':0x0,'rows':[]};var _0xba46b8=_[_0x4f7b('0x2f')](db[_0x4f7b('0x30')][_0x4f7b('0x31')],function(_0x3e7fb4){return{'name':_0x3e7fb4[_0x4f7b('0x32')],'type':_0x3e7fb4[_0x4f7b('0x33')][_0x4f7b('0x34')]};});_0x13a113[_0x4f7b('0x35')]=_[_0x4f7b('0x2f')](_0xba46b8,_0x4f7b('0x2c'));_0x13a113[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x1cf980[_0x4f7b('0x36')]);_0x13a113['filters']=_[_0x4f7b('0x38')](_0x13a113['model'],_0x13a113[_0x4f7b('0x36')]);_0x4e5862[_0x4f7b('0x39')]=_['intersection'](_0x13a113[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1cf980[_0x4f7b('0x36')]['fields']));_0x4e5862[_0x4f7b('0x39')]=_0x4e5862[_0x4f7b('0x39')][_0x4f7b('0x3b')]?_0x4e5862[_0x4f7b('0x39')]:_0x13a113[_0x4f7b('0x35')];if(!_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x3c')]('nolimit')){_0x4e5862[_0x4f7b('0x21')]=qs['limit'](_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x21')]);_0x4e5862[_0x4f7b('0x23')]=qs['offset'](_0x1cf980[_0x4f7b('0x36')]['offset']);}_0x4e5862[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1cf980['query']['sort']);_0x4e5862[_0x4f7b('0x3f')]=qs['filters'](_[_0x4f7b('0x40')](_0x1cf980[_0x4f7b('0x36')],_0x13a113['filters']),_0xba46b8);if(_0x1cf980[_0x4f7b('0x36')]['filter']){_0x4e5862['where']=_['merge'](_0x4e5862[_0x4f7b('0x3f')],{'$or':_[_0x4f7b('0x2f')](_0xba46b8,function(_0xa5532b){if(_0xa5532b[_0x4f7b('0x33')]!=='VIRTUAL'){var _0x3da93f={};_0x3da93f[_0xa5532b['name']]={'$like':'%'+_0x1cf980[_0x4f7b('0x36')]['filter']+'%'};return _0x3da93f;}})});}_0x4e5862=_[_0x4f7b('0x41')]({},_0x4e5862,_0x1cf980['options']);var _0x2c2b10={'where':_0x4e5862[_0x4f7b('0x3f')]};return db[_0x4f7b('0x30')][_0x4f7b('0x22')](_0x2c2b10)[_0x4f7b('0x28')](function(_0x325cd6){_0x179372[_0x4f7b('0x22')]=_0x325cd6;if(_0x1cf980[_0x4f7b('0x36')][_0x4f7b('0x42')]){_0x4e5862[_0x4f7b('0x43')]=[{'all':!![]}];}return db[_0x4f7b('0x30')][_0x4f7b('0x44')](_0x4e5862);})[_0x4f7b('0x28')](function(_0x508eaa){_0x179372[_0x4f7b('0x45')]=_0x508eaa;return _0x179372;})[_0x4f7b('0x28')](respondWithFilteredResult(_0x105ffb,_0x4e5862))[_0x4f7b('0x46')](handleError(_0x105ffb,null));};exports[_0x4f7b('0x47')]=function(_0x5cfca1,_0x581356){var _0x10d0ac={'raw':![],'where':{'id':_0x5cfca1[_0x4f7b('0x48')]['id']}},_0x1d1e10={};_0x1d1e10[_0x4f7b('0x35')]=_['keys'](db['VoicePrefix'][_0x4f7b('0x31')]);_0x1d1e10[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x5cfca1[_0x4f7b('0x36')]);_0x1d1e10['filters']=_['intersection'](_0x1d1e10[_0x4f7b('0x35')],_0x1d1e10[_0x4f7b('0x36')]);_0x10d0ac[_0x4f7b('0x39')]=_[_0x4f7b('0x38')](_0x1d1e10[_0x4f7b('0x35')],qs['fields'](_0x5cfca1[_0x4f7b('0x36')][_0x4f7b('0x3a')]));_0x10d0ac[_0x4f7b('0x39')]=_0x10d0ac['attributes'][_0x4f7b('0x3b')]?_0x10d0ac[_0x4f7b('0x39')]:_0x1d1e10[_0x4f7b('0x35')];if(_0x5cfca1[_0x4f7b('0x36')][_0x4f7b('0x42')]){_0x10d0ac[_0x4f7b('0x43')]=[{'all':!![]}];}_0x10d0ac=_[_0x4f7b('0x41')]({},_0x10d0ac,_0x5cfca1[_0x4f7b('0x49')]);return db[_0x4f7b('0x30')][_0x4f7b('0x4a')](_0x10d0ac)['then'](handleEntityNotFound(_0x581356,null))[_0x4f7b('0x28')](respondWithResult(_0x581356,null))[_0x4f7b('0x46')](handleError(_0x581356,null));};exports[_0x4f7b('0x29')]=function(_0x5003f1,_0x16eaef){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x5003f1[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x16eaef,null))[_0x4f7b('0x28')](removeEntity(_0x16eaef,null))[_0x4f7b('0x46')](handleError(_0x16eaef,null));};exports[_0x4f7b('0x4b')]=function(_0x776ce7,_0x23d5f3){return db['VoicePrefix'][_0x4f7b('0x4b')]()[_0x4f7b('0x28')](respondWithResult(_0x23d5f3,null))[_0x4f7b('0x46')](handleError(_0x23d5f3,null));};exports['create']=function(_0x2c9cee,_0x40c183){var _0xeeb227;return db[_0x4f7b('0x4c')][_0x4f7b('0x4d')](function(_0x819fb3){return db['VoicePrefix'][_0x4f7b('0x4e')](_0x2c9cee[_0x4f7b('0x4f')],{'transaction':_0x819fb3})[_0x4f7b('0x28')](function(_0x4c9496){_0xeeb227=_0x4c9496[_0x4f7b('0x50')]({'plain':!![]});return db[_0x4f7b('0x51')][_0x4f7b('0x4a')]({'where':{'id':_0xeeb227[_0x4f7b('0x52')]},'raw':!![]})[_0x4f7b('0x28')](function(_0x6e448f){return createVoicePrefixExtensions(_0xeeb227,_0x6e448f,_0x819fb3);});});})['then'](function(){var _0x13bb98=_0x2c9cee['user']['get']({'plain':!![]});if(!_0x13bb98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13bb98[_0x4f7b('0x53')]===_0x4f7b('0x54')){var _0x27b2e1=_0xeeb227;return db['UserProfileSection']['find']({'where':{'name':_0x4f7b('0x2a'),'userProfileId':_0x13bb98[_0x4f7b('0x55')]},'raw':!![]})['then'](function(_0xf957ca){if(_0xf957ca&&_0xf957ca[_0x4f7b('0x56')]===0x0){return db[_0x4f7b('0x2b')][_0x4f7b('0x4e')]({'name':_0x27b2e1['name'],'resourceId':_0x27b2e1['id'],'type':_0xf957ca[_0x4f7b('0x2c')],'sectionId':_0xf957ca['id']},{})[_0x4f7b('0x28')](function(){return _0xeeb227;});}else{return _0xeeb227;}})[_0x4f7b('0x46')](function(_0x42b378){logger[_0x4f7b('0x57')](_0x4f7b('0x58'),_0x42b378);throw _0x42b378;});}return _0xeeb227;})[_0x4f7b('0x28')](respondWithResult(_0x40c183,null))['catch'](handleError(_0x40c183,null));};function Extension(_0x529821,_0x507199,_0x133074,_0x5530cb){this['context']='from-sip';this['exten']=_0x529821;this[_0x4f7b('0x59')]=_0x133074;this[_0x4f7b('0x33')]=_0x4f7b('0x5a');this[_0x4f7b('0x5b')]=_0x4f7b('0x5c');this[_0x4f7b('0x5d')]=_0x507199;this[_0x4f7b('0x5e')]=_0x5530cb;}function createVoicePrefixExtensions(_0x80efcb,_0x1d500c,_0x2a80fe){return new BPromise(function(_0x31bed4,_0x12456e){var _0x1ba432=new Extension(formatPrefixName(_0x80efcb[_0x4f7b('0x5f')]),0x1,_0x4f7b('0x60'),_0x4f7b('0x61'));_0x1ba432[_0x4f7b('0x62')]=_0x80efcb['id'];return db[_0x4f7b('0x51')]['create'](_0x1ba432,{'transaction':_0x2a80fe})[_0x4f7b('0x28')](function(_0x46d15c){var _0x3c5b28=_0x46d15c[_0x4f7b('0x50')]({'plain':!![]});var _0x321f36=_['map'](addVoicePrefixExtensions(_0x80efcb,_0x1d500c),function(_0x4b9f3a){_0x4b9f3a[_0x4f7b('0x52')]=_0x3c5b28['id'];_0x4b9f3a['VoicePrefixId']=_0x80efcb['id'];return _0x4b9f3a;});return db[_0x4f7b('0x51')][_0x4f7b('0x63')](_0x321f36,{'transaction':_0x2a80fe})[_0x4f7b('0x28')](function(_0x7509ab){if(!_0x7509ab){return _0x12456e('Extensions\x20creation\x20failed');}else{return _0x31bed4(_0x7509ab);}})[_0x4f7b('0x46')](function(_0x35b569){return _0x12456e(_0x35b569);});});;});};function addVoicePrefixExtensions(_0x5a6db0,_0x58baa5){var _0x4b2089=[];var _0x5b16cb=formatPrefixName(_0x5a6db0[_0x4f7b('0x5f')]);_0x4b2089['push'](new Extension(_0x5b16cb,0x2,'Set','CDR(prefix)='+_0x5a6db0[_0x4f7b('0x2c')]));if(_0x5a6db0[_0x4f7b('0x64')]){_0x4b2089[_0x4f7b('0x65')](new Extension(_0x5b16cb,0x3,'Set',_0x4f7b('0x66')+_0x5a6db0[_0x4f7b('0x64')]));}else{_0x4b2089['push'](new Extension(_0x5b16cb,0x3,'NoOp',_0x4f7b('0x67')));}_0x4b2089[_0x4f7b('0x65')](new Extension(_0x5b16cb,0x4,_0x4f7b('0x68'),_0x58baa5[_0x4f7b('0x69')]+','+'${EXTEN:'+(0x8+_0x5a6db0[_0x4f7b('0x2c')][_0x4f7b('0x3b')])+'}'+','+0x1));return _0x4b2089;}function formatPrefixName(_0xc6b94e){var _0x2cb5f1='_';for(var _0x2ac8db=0x0;_0x2ac8db<_0xc6b94e[_0x4f7b('0x3b')];_0x2ac8db++){if(_0xc6b94e['charAt'](_0x2ac8db)=='-'){_0x2cb5f1+=_0xc6b94e[_0x4f7b('0x6a')](_0x2ac8db);}else{_0x2cb5f1+='['+_0xc6b94e[_0x4f7b('0x6a')](_0x2ac8db)+']';}}_0x2cb5f1+='.';return _0x2cb5f1;}exports[_0x4f7b('0x6b')]=function(_0x220f21,_0x1ca442,_0x509763){var _0x579363=_0x220f21['body'];_0x579363[_0x4f7b('0x5f')]=_0x4f7b('0x6c')+_0x579363[_0x4f7b('0x2c')]+'-';return db[_0x4f7b('0x4c')][_0x4f7b('0x4d')](function(_0x53034b){return db[_0x4f7b('0x30')][_0x4f7b('0x6b')](_0x579363,{'where':{'id':_0x579363['id']},'transaction':_0x53034b})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x51')][_0x4f7b('0x29')]({'where':{'VoicePrefixId':_0x579363['id']},'transaction':_0x53034b})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x51')][_0x4f7b('0x4a')]({'where':{'id':_0x579363[_0x4f7b('0x52')]},'raw':!![]})[_0x4f7b('0x28')](function(_0x36b46d){return createVoicePrefixExtensions(_0x579363,_0x36b46d,_0x53034b);});});});})[_0x4f7b('0x28')](function(){return db[_0x4f7b('0x30')][_0x4f7b('0x6d')](_0x579363['id']);})[_0x4f7b('0x28')](respondWithResult(_0x1ca442,null))[_0x4f7b('0x46')](handleError(_0x1ca442,null));};exports[_0x4f7b('0x6e')]=function(_0xf0691e,_0x531da6,_0x5bce88){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0xf0691e[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x531da6,null))['then'](function(_0x1102fe){if(_0x1102fe){return _0x1102fe[_0x4f7b('0x6e')](_0xf0691e[_0x4f7b('0x4f')][_0x4f7b('0x6f')],_[_0x4f7b('0x70')](_0xf0691e[_0x4f7b('0x4f')],[_0x4f7b('0x6f'),'id'])||{})[_0x4f7b('0x71')](function(_0x3ddd33){for(var _0x13f190=0x0;_0x13f190<_0xf0691e[_0x4f7b('0x4f')][_0x4f7b('0x6f')][_0x4f7b('0x3b')];_0x13f190+=0x1){socket[_0x4f7b('0x72')](_0x4f7b('0x73'),{'UserId':Number(_0xf0691e['body'][_0x4f7b('0x6f')][_0x13f190]),'VoicePrefixId':Number(_0xf0691e[_0x4f7b('0x48')]['id'])});}return _0x3ddd33;});}})['then'](respondWithResult(_0x531da6,null))['catch'](handleError(_0x531da6,null));};exports[_0x4f7b('0x74')]=function(_0x4beb8e,_0x3d25a6,_0x12125d){return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x4beb8e[_0x4f7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d25a6,null))['then'](function(_0x42bd6b){if(_0x42bd6b){return _0x42bd6b[_0x4f7b('0x74')](_0x4beb8e[_0x4f7b('0x36')][_0x4f7b('0x6f')])['then'](function(){if(_[_0x4f7b('0x75')](_0x4beb8e[_0x4f7b('0x36')]['ids'])){for(var _0x6aef20=0x0;_0x6aef20<_0x4beb8e[_0x4f7b('0x36')]['ids']['length'];_0x6aef20+=0x1){socket[_0x4f7b('0x72')]('userVoicePrefix:remove',{'UserId':Number(_0x4beb8e['query']['ids'][_0x6aef20]),'VoicePrefixId':Number(_0x4beb8e[_0x4f7b('0x48')]['id'])});}}else{socket['emit'](_0x4f7b('0x76'),{'UserId':Number(_0x4beb8e[_0x4f7b('0x36')][_0x4f7b('0x6f')]),'VoicePrefixId':Number(_0x4beb8e[_0x4f7b('0x48')]['id'])});}});}})[_0x4f7b('0x28')](respondWithStatusCode(_0x3d25a6,null))[_0x4f7b('0x46')](handleError(_0x3d25a6,null));};exports[_0x4f7b('0x77')]=function(_0x1f6650,_0x39799b,_0x4da13f){var _0x476637={};var _0x35c3cb={};var _0x37d151;var _0x40120d;return db[_0x4f7b('0x30')][_0x4f7b('0x78')]({'where':{'id':_0x1f6650[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0x39799b,null))['then'](function(_0x24289e){if(_0x24289e){_0x37d151=_0x24289e;_0x35c3cb[_0x4f7b('0x35')]=_[_0x4f7b('0x37')](db['User'][_0x4f7b('0x31')]);_0x35c3cb['query']=_[_0x4f7b('0x37')](_0x1f6650[_0x4f7b('0x36')]);_0x35c3cb['filters']=_['intersection'](_0x35c3cb[_0x4f7b('0x35')],_0x35c3cb['query']);_0x476637[_0x4f7b('0x39')]=_['intersection'](_0x35c3cb[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1f6650[_0x4f7b('0x36')]['fields']));_0x476637[_0x4f7b('0x39')]=_0x476637['attributes'][_0x4f7b('0x3b')]?_0x476637[_0x4f7b('0x39')]:_0x35c3cb[_0x4f7b('0x35')];_0x476637[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1f6650[_0x4f7b('0x36')][_0x4f7b('0x3e')]);_0x476637['where']=qs[_0x4f7b('0x79')](_['pick'](_0x1f6650['query'],_0x35c3cb['filters']));if(_0x1f6650[_0x4f7b('0x36')]['filter']){_0x476637[_0x4f7b('0x3f')]=_[_0x4f7b('0x41')](_0x476637[_0x4f7b('0x3f')],{'$or':_[_0x4f7b('0x2f')](_0x476637[_0x4f7b('0x39')],function(_0x3f5f81){var _0x30a003={};_0x30a003[_0x3f5f81]={'$like':'%'+_0x1f6650[_0x4f7b('0x36')]['filter']+'%'};return _0x30a003;})});}_0x476637=_['merge']({},_0x476637,_0x1f6650['options']);return _0x37d151['getAgents'](_0x476637);}})[_0x4f7b('0x28')](function(_0x34bca4){if(_0x34bca4){_0x40120d=_0x34bca4[_0x4f7b('0x3b')];if(!_0x1f6650['query'][_0x4f7b('0x3c')]('nolimit')){_0x476637[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1f6650['query'][_0x4f7b('0x21')]);_0x476637[_0x4f7b('0x23')]=qs[_0x4f7b('0x23')](_0x1f6650['query'][_0x4f7b('0x23')]);}return _0x37d151[_0x4f7b('0x77')](_0x476637);}})[_0x4f7b('0x28')](function(_0x3927b5){if(_0x3927b5){return _0x3927b5?{'count':_0x40120d,'rows':_0x3927b5}:null;}})[_0x4f7b('0x28')](respondWithResult(_0x39799b,null))[_0x4f7b('0x46')](handleError(_0x39799b,null));};exports[_0x4f7b('0x7a')]=function(_0x1a91ce,_0xd249a,_0x4f2c6e){var _0x147e14={};var _0x55922a={};var _0x5afd27;var _0x471caa;return db[_0x4f7b('0x30')]['findOne']({'where':{'id':_0x1a91ce['params']['id']}})[_0x4f7b('0x28')](handleEntityNotFound(_0xd249a,null))['then'](function(_0x13c2e4){if(_0x13c2e4){_0x5afd27=_0x13c2e4;_0x55922a[_0x4f7b('0x35')]=_[_0x4f7b('0x37')](db[_0x4f7b('0x7b')][_0x4f7b('0x31')]);_0x55922a[_0x4f7b('0x36')]=_[_0x4f7b('0x37')](_0x1a91ce[_0x4f7b('0x36')]);_0x55922a['filters']=_[_0x4f7b('0x38')](_0x55922a[_0x4f7b('0x35')],_0x55922a[_0x4f7b('0x36')]);_0x147e14[_0x4f7b('0x39')]=_[_0x4f7b('0x38')](_0x55922a[_0x4f7b('0x35')],qs[_0x4f7b('0x3a')](_0x1a91ce['query'][_0x4f7b('0x3a')]));_0x147e14[_0x4f7b('0x39')]=_0x147e14[_0x4f7b('0x39')][_0x4f7b('0x3b')]?_0x147e14[_0x4f7b('0x39')]:_0x55922a[_0x4f7b('0x35')];_0x147e14[_0x4f7b('0x3d')]=qs[_0x4f7b('0x3e')](_0x1a91ce[_0x4f7b('0x36')]['sort']);_0x147e14['where']=qs['filters'](_['pick'](_0x1a91ce[_0x4f7b('0x36')],_0x55922a[_0x4f7b('0x79')]));if(_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x7c')]){_0x147e14[_0x4f7b('0x3f')]=_[_0x4f7b('0x41')](_0x147e14[_0x4f7b('0x3f')],{'$or':_['map'](_0x147e14[_0x4f7b('0x39')],function(_0x265a8f){var _0x39ec96={};_0x39ec96[_0x265a8f]={'$like':'%'+_0x1a91ce[_0x4f7b('0x36')]['filter']+'%'};return _0x39ec96;})});}_0x147e14=_[_0x4f7b('0x41')]({},_0x147e14,_0x1a91ce[_0x4f7b('0x49')]);return _0x5afd27[_0x4f7b('0x7a')](_0x147e14);}})['then'](function(_0x3f844f){if(_0x3f844f){_0x471caa=_0x3f844f[_0x4f7b('0x3b')];if(!_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x3c')](_0x4f7b('0x7d'))){_0x147e14[_0x4f7b('0x21')]=qs[_0x4f7b('0x21')](_0x1a91ce[_0x4f7b('0x36')][_0x4f7b('0x21')]);_0x147e14[_0x4f7b('0x23')]=qs[_0x4f7b('0x23')](_0x1a91ce[_0x4f7b('0x36')]['offset']);}return _0x5afd27['getTeams'](_0x147e14);}})[_0x4f7b('0x28')](function(_0x4cd4d6){if(_0x4cd4d6){return _0x4cd4d6?{'count':_0x471caa,'rows':_0x4cd4d6}:null;}})[_0x4f7b('0x28')](respondWithResult(_0xd249a,null))[_0x4f7b('0x46')](handleError(_0xd249a,null));};exports['addTeams']=function(_0x411a94,_0x1e934e,_0x5ec78b){var _0x4e07ce=_0x411a94['body'][_0x4f7b('0x6f')];var _0x5a8bda;return db['Team'][_0x4f7b('0x44')]({'where':{'id':_0x4e07ce},'attributes':['id'],'include':[{'model':db[_0x4f7b('0x7e')],'as':_0x4f7b('0x7f'),'attributes':['id',_0x4f7b('0x2c'),_0x4f7b('0x80'),_0x4f7b('0x81'),'interface'],'raw':!![]}]})[_0x4f7b('0x28')](function(_0x1ebf36){if(_0x1ebf36){_0x5a8bda=_0x1ebf36;var _0x4daeb1=_[_0x4f7b('0x82')](_0x1ebf36,function(_0x5556b4){var _0x4d5eb3=_0x5556b4['get']({'plain':!![]});return _0x4d5eb3[_0x4f7b('0x7f')];});return db[_0x4f7b('0x30')][_0x4f7b('0x4a')]({'where':{'id':_0x411a94[_0x4f7b('0x48')]['id']}})['then'](function(_0x3e0d84){return db['sequelize']['transaction'](function(_0x5c2027){return _0x3e0d84['addTeams'](_0x4e07ce,{'transaction':_0x5c2027})[_0x4f7b('0x28')](function(){return BPromise[_0x4f7b('0x83')](_0x5a8bda,function(_0xb3a12b){return db[_0x4f7b('0x84')][_0x4f7b('0x85')]({'TeamId':_0xb3a12b['id'],'VoicePrefixId':_0x411a94['params']['id']},{'transaction':_0x5c2027});});})[_0x4f7b('0x28')](function(){return BPromise[_0x4f7b('0x83')](_0x4daeb1,function(_0x20daa0){return db[_0x4f7b('0x86')][_0x4f7b('0x87')]({'where':{'UserId':_0x20daa0['id'],'VoicePrefixId':_0x411a94[_0x4f7b('0x48')]['id']},'transaction':_0x5c2027});});})['then'](function(){_0x4daeb1[_0x4f7b('0x88')](function(_0x5f4ea9){socket[_0x4f7b('0x72')](_0x4f7b('0x73'),{'UserId':_0x5f4ea9['id'],'VoicePrefixId':_0x3e0d84['id']});});});});});}})[_0x4f7b('0x28')](respondWithStatusCode(_0x1e934e,null))[_0x4f7b('0x46')](handleError(_0x1e934e,null));};exports[_0x4f7b('0x89')]=function(_0x3aaa25,_0x344257,_0x36209e){return db[_0x4f7b('0x7b')][_0x4f7b('0x44')]({'where':{'id':_0x3aaa25[_0x4f7b('0x36')][_0x4f7b('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4f7b('0x28')](handleEntityNotFound(_0x344257,null))[_0x4f7b('0x28')](function(_0x136804){var _0x13d7cd=_[_0x4f7b('0x2f')](_0x136804,'id');var _0x1cf812=[];var _0x3434a1=[];var _0x3acd39=squel[_0x4f7b('0x8a')]();_0x3acd39['field']('tq.TeamId')[_0x4f7b('0x8b')]('team_has_voice_prefixes','tq')[_0x4f7b('0x8c')](_0x4f7b('0x8d'),'ut',_0x4f7b('0x8e'))[_0x4f7b('0x3f')](_0x4f7b('0x8f'),_0x3aaa25['params']['id']);for(var _0x324ee3=0x0;_0x324ee3<_0x136804[_0x4f7b('0x3b')];_0x324ee3+=0x1){let _0x14c427=_0x136804[_0x324ee3];for(var _0x5dd4cd=0x0;_0x5dd4cd<_0x14c427[_0x4f7b('0x7f')][_0x4f7b('0x3b')];_0x5dd4cd+=0x1){let _0x43276a=_0x14c427[_0x4f7b('0x7f')][_0x5dd4cd];var _0x58cf43=_0x3acd39[_0x4f7b('0x90')]();_0x58cf43['where'](_0x4f7b('0x91'),_0x43276a['id']);_0x3434a1[_0x4f7b('0x65')](db[_0x4f7b('0x4c')][_0x4f7b('0x36')](_0x58cf43[_0x4f7b('0x92')](),{'type':db[_0x4f7b('0x4c')][_0x4f7b('0x93')][_0x4f7b('0x94')]})[_0x4f7b('0x28')](function(_0xe6b4de){if(_0xe6b4de[_0x4f7b('0x3b')]===0x1){return _0x43276a['id'];}else{var _0x4088d7=_[_0x4f7b('0x95')](_[_0x4f7b('0x2f')](_0xe6b4de,_0x4f7b('0x96')),function(_0x8fa122){return _[_0x4f7b('0x97')](_0x13d7cd,_0x8fa122);});if(_0x4088d7){return _0x43276a['id'];}}}));}}return BPromise['all'](_0x3434a1)['then'](function(_0x50a1e5){_0x1cf812=_(_0x1cf812)[_0x4f7b('0x98')](_0x50a1e5)['compact']()[_0x4f7b('0x99')]();return db['VoicePrefix'][_0x4f7b('0x4a')]({'where':{'id':_0x3aaa25[_0x4f7b('0x48')]['id']}})[_0x4f7b('0x28')](function(_0x196911){return db['sequelize']['transaction'](function(_0x228e98){return _0x196911[_0x4f7b('0x89')](_0x3aaa25['query']['ids'],{'transaction':_0x228e98})[_0x4f7b('0x28')](function(){if(!_['isEmpty'](_0x1cf812)){return _0x196911[_0x4f7b('0x74')](_0x1cf812,{'transaction':_0x228e98});}})['then'](function(){_0x1cf812[_0x4f7b('0x88')](function(_0x3dd10a){socket[_0x4f7b('0x72')](_0x4f7b('0x76'),{'UserId':_0x3dd10a,'VoicePrefixId':_0x196911['id']});});});});});});})[_0x4f7b('0x28')](respondWithStatusCode(_0x344257,null))[_0x4f7b('0x46')](handleError(_0x344257,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3b05875..c96ed7e 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 _0x3d67=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x27e335,_0x270468){var _0x53c8b7=function(_0x35926d){while(--_0x35926d){_0x27e335['push'](_0x27e335['shift']());}};_0x53c8b7(++_0x270468);}(_0x3d67,0x71));var _0x73d6=function(_0x4cbc28,_0x5d30b4){_0x4cbc28=_0x4cbc28-0x0;var _0x7cf5ff=_0x3d67[_0x4cbc28];return _0x7cf5ff;};'use strict';var EventEmitter=require(_0x73d6('0x0'));var VoicePrefix=require(_0x73d6('0x1'))['db'][_0x73d6('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x73d6('0x3')](0x0);var events={'afterCreate':_0x73d6('0x4'),'afterUpdate':_0x73d6('0x5'),'afterDestroy':_0x73d6('0x6')};function emitEvent(_0x308ad6){return function(_0x43f1da,_0x4e9ded,_0x1dee56){VoicePrefixEvents[_0x73d6('0x7')](_0x308ad6+':'+_0x43f1da['id'],_0x43f1da);VoicePrefixEvents[_0x73d6('0x7')](_0x308ad6,_0x43f1da);_0x1dee56(null);};}for(var e in events){if(events[_0x73d6('0x8')](e)){var event=events[e];VoicePrefix[_0x73d6('0x9')](e,emitEvent(event));}}module[_0x73d6('0xa')]=VoicePrefixEvents; \ No newline at end of file +var _0x5114=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ad5a2,_0x45632b){var _0x51eba3=function(_0x38a6ce){while(--_0x38a6ce){_0x1ad5a2['push'](_0x1ad5a2['shift']());}};_0x51eba3(++_0x45632b);}(_0x5114,0xc7));var _0x4511=function(_0x27b46b,_0x3d52fa){_0x27b46b=_0x27b46b-0x0;var _0x4bc2e1=_0x5114[_0x27b46b];return _0x4bc2e1;};'use strict';var EventEmitter=require(_0x4511('0x0'));var VoicePrefix=require(_0x4511('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4511('0x2')](0x0);var events={'afterCreate':_0x4511('0x3'),'afterUpdate':_0x4511('0x4'),'afterDestroy':_0x4511('0x5')};function emitEvent(_0x215a14){return function(_0x36b52c,_0x1995f6,_0x58d9d7){VoicePrefixEvents[_0x4511('0x6')](_0x215a14+':'+_0x36b52c['id'],_0x36b52c);VoicePrefixEvents[_0x4511('0x6')](_0x215a14,_0x36b52c);_0x58d9d7(null);};}for(var e in events){if(events[_0x4511('0x7')](e)){var event=events[e];VoicePrefix[_0x4511('0x8')](e,emitEvent(event));}}module[_0x4511('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 54522e4..99cb8d6 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 _0x4847=['request-promise','path','rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird'];(function(_0x2ea0b3,_0x62dcd8){var _0x4c535d=function(_0x18c132){while(--_0x18c132){_0x2ea0b3['push'](_0x2ea0b3['shift']());}};_0x4c535d(++_0x62dcd8);}(_0x4847,0x7d));var _0x7484=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x4847[_0x3a6efd];return _0x487b9a;};'use strict';var _=require('lodash');var util=require(_0x7484('0x0'));var logger=require(_0x7484('0x1'))(_0x7484('0x2'));var moment=require(_0x7484('0x3'));var BPromise=require(_0x7484('0x4'));var rp=require(_0x7484('0x5'));var fs=require('fs');var path=require(_0x7484('0x6'));var rimraf=require(_0x7484('0x7'));var config=require(_0x7484('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x7484('0x9')]=function(_0x3aeda9,_0x48726b){return _0x3aeda9[_0x7484('0xa')](_0x7484('0xb'),attributes,{'tableName':_0x7484('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f29=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash'];(function(_0x485aa2,_0x95355f){var _0x1ce663=function(_0x4d9937){while(--_0x4d9937){_0x485aa2['push'](_0x485aa2['shift']());}};_0x1ce663(++_0x95355f);}(_0x5f29,0x1d3));var _0x95f2=function(_0x2c077b,_0x171aff){_0x2c077b=_0x2c077b-0x0;var _0x23105e=_0x5f29[_0x2c077b];return _0x23105e;};'use strict';var _=require(_0x95f2('0x0'));var util=require(_0x95f2('0x1'));var logger=require(_0x95f2('0x2'))(_0x95f2('0x3'));var moment=require('moment');var BPromise=require(_0x95f2('0x4'));var rp=require(_0x95f2('0x5'));var fs=require('fs');var path=require(_0x95f2('0x6'));var rimraf=require(_0x95f2('0x7'));var config=require(_0x95f2('0x8'));var attributes=require(_0x95f2('0x9'));module[_0x95f2('0xa')]=function(_0xb5162a,_0x1ac98b){return _0xb5162a[_0x95f2('0xb')](_0x95f2('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 1797956..f11f49a 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 _0xd2f5=['socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x3de882,_0x3c87b7){var _0x9cf690=function(_0x279639){while(--_0x279639){_0x3de882['push'](_0x3de882['shift']());}};_0x9cf690(++_0x3c87b7);}(_0xd2f5,0x144));var _0x5d2f=function(_0x48a8de,_0x1a8962){_0x48a8de=_0x48a8de-0x0;var _0x1ea331=_0xd2f5[_0x48a8de];return _0x1ea331;};'use strict';var _=require(_0x5d2f('0x0'));var util=require('util');var moment=require(_0x5d2f('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d2f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d2f('0x3'))['db'];var utils=require(_0x5d2f('0x4'));var logger=require(_0x5d2f('0x5'))(_0x5d2f('0x6'));var config=require(_0x5d2f('0x7'));var jayson=require(_0x5d2f('0x8'));var client=jayson[_0x5d2f('0x9')][_0x5d2f('0xa')]({'port':0x232a});config['redis']=_[_0x5d2f('0xb')](config[_0x5d2f('0xc')],{'host':_0x5d2f('0xd'),'port':0x18eb});var socket=require(_0x5d2f('0xe'))(new Redis(config[_0x5d2f('0xc')]));require(_0x5d2f('0xf'))['register'](socket);function respondWithRpcPromise(_0x305434,_0xcd29b4,_0x4e24af){return new BPromise(function(_0x90b987,_0xd738c6){return client[_0x5d2f('0x10')](_0x305434,_0x4e24af)['then'](function(_0x39b43b){logger[_0x5d2f('0x11')](_0x5d2f('0x12'),_0xcd29b4,'request\x20sent');logger['debug'](_0x5d2f('0x13'),_0xcd29b4,'request\x20sent',JSON[_0x5d2f('0x14')](_0x39b43b));if(_0x39b43b[_0x5d2f('0x15')]){if(_0x39b43b['error'][_0x5d2f('0x16')]===0x1f4){logger['error'](_0x5d2f('0x12'),_0xcd29b4,_0x39b43b[_0x5d2f('0x15')][_0x5d2f('0x17')]);return _0xd738c6(_0x39b43b['error'][_0x5d2f('0x17')]);}logger[_0x5d2f('0x15')](_0x5d2f('0x12'),_0xcd29b4,_0x39b43b[_0x5d2f('0x15')][_0x5d2f('0x17')]);return _0x90b987(_0x39b43b['error'][_0x5d2f('0x17')]);}else{logger[_0x5d2f('0x11')](_0x5d2f('0x12'),_0xcd29b4,_0x5d2f('0x18'));_0x90b987(_0x39b43b['result'][_0x5d2f('0x17')]);}})[_0x5d2f('0x19')](function(_0x36ddf1){logger[_0x5d2f('0x15')](_0x5d2f('0x12'),_0xcd29b4,_0x36ddf1);_0xd738c6(_0x36ddf1);});});} \ No newline at end of file +var _0xde1a=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2fd6e4,_0x94d2d8){var _0x39ff81=function(_0x1a38da){while(--_0x1a38da){_0x2fd6e4['push'](_0x2fd6e4['shift']());}};_0x39ff81(++_0x94d2d8);}(_0xde1a,0xfd));var _0xade1=function(_0x199c2d,_0x325a7f){_0x199c2d=_0x199c2d-0x0;var _0x30624b=_0xde1a[_0x199c2d];return _0x30624b;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var moment=require(_0xade1('0x1'));var BPromise=require(_0xade1('0x2'));var rs=require(_0xade1('0x3'));var fs=require('fs');var Redis=require(_0xade1('0x4'));var db=require(_0xade1('0x5'))['db'];var utils=require(_0xade1('0x6'));var logger=require(_0xade1('0x7'))('rpc');var config=require(_0xade1('0x8'));var jayson=require(_0xade1('0x9'));var client=jayson[_0xade1('0xa')][_0xade1('0xb')]({'port':0x232a});config[_0xade1('0xc')]=_[_0xade1('0xd')](config['redis'],{'host':_0xade1('0xe'),'port':0x18eb});var socket=require(_0xade1('0xf'))(new Redis(config[_0xade1('0xc')]));require(_0xade1('0x10'))[_0xade1('0x11')](socket);function respondWithRpcPromise(_0x2b3854,_0x3ebc61,_0x12eb7f){return new BPromise(function(_0x5add3c,_0x5c44fa){return client[_0xade1('0x12')](_0x2b3854,_0x12eb7f)['then'](function(_0x1d71a8){logger[_0xade1('0x13')](_0xade1('0x14'),_0x3ebc61,'request\x20sent');logger[_0xade1('0x15')](_0xade1('0x16'),_0x3ebc61,_0xade1('0x17'),JSON[_0xade1('0x18')](_0x1d71a8));if(_0x1d71a8[_0xade1('0x19')]){if(_0x1d71a8[_0xade1('0x19')]['code']===0x1f4){logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x1d71a8[_0xade1('0x19')][_0xade1('0x1a')]);return _0x5c44fa(_0x1d71a8[_0xade1('0x19')]['message']);}logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x1d71a8[_0xade1('0x19')][_0xade1('0x1a')]);return _0x5add3c(_0x1d71a8[_0xade1('0x19')]['message']);}else{logger[_0xade1('0x13')](_0xade1('0x14'),_0x3ebc61,_0xade1('0x17'));_0x5add3c(_0x1d71a8[_0xade1('0x1b')][_0xade1('0x1a')]);}})[_0xade1('0x1c')](function(_0x39a360){logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x39a360);_0x5c44fa(_0x39a360);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2a80a91..f0637d2 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 _0x6594=['register','voicePrefix:','emit'];(function(_0x4d488d,_0x4016fb){var _0x11ba44=function(_0x42f5d9){while(--_0x42f5d9){_0x4d488d['push'](_0x4d488d['shift']());}};_0x11ba44(++_0x4016fb);}(_0x6594,0xcb));var _0x4659=function(_0x3a1bcd,_0x244041){_0x3a1bcd=_0x3a1bcd-0x0;var _0x57422c=_0x6594[_0x3a1bcd];return _0x57422c;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save','remove','update'];function createListener(_0x309638,_0xda9ca2){return function(_0x365816){_0xda9ca2[_0x4659('0x0')](_0x309638,_0x365816);};}function removeListener(_0x2fa78c,_0x4eedfc){return function(){VoicePrefixEvents['removeListener'](_0x2fa78c,_0x4eedfc);};}exports[_0x4659('0x1')]=function(_0x2f59ce){for(var _0x246729=0x0,_0x45d2e8=events['length'];_0x246729<_0x45d2e8;_0x246729++){var _0x3adf40=events[_0x246729];var _0x39b740=createListener(_0x4659('0x2')+_0x3adf40,_0x2f59ce);VoicePrefixEvents['on'](_0x3adf40,_0x39b740);}}; \ No newline at end of file +var _0xbde2=['length','voicePrefix:','save','remove','update','emit','removeListener','register'];(function(_0x20a0fc,_0x517aa3){var _0x551f1d=function(_0x53112a){while(--_0x53112a){_0x20a0fc['push'](_0x20a0fc['shift']());}};_0x551f1d(++_0x517aa3);}(_0xbde2,0x7a));var _0x2bde=function(_0x418b7d,_0x3cfddc){_0x418b7d=_0x418b7d-0x0;var _0x3dc5fd=_0xbde2[_0x418b7d];return _0x3dc5fd;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2bde('0x0'),_0x2bde('0x1'),_0x2bde('0x2')];function createListener(_0x4efae2,_0x3b1018){return function(_0x1055e2){_0x3b1018[_0x2bde('0x3')](_0x4efae2,_0x1055e2);};}function removeListener(_0x530c9f,_0x3622bb){return function(){VoicePrefixEvents[_0x2bde('0x4')](_0x530c9f,_0x3622bb);};}exports[_0x2bde('0x5')]=function(_0x3b3039){for(var _0x50c1a1=0x0,_0x30d926=events[_0x2bde('0x6')];_0x50c1a1<_0x30d926;_0x50c1a1++){var _0x39522f=events[_0x50c1a1];var _0x3ddbc4=createListener(_0x2bde('0x7')+_0x39522f,_0x3b3039);VoicePrefixEvents['on'](_0x39522f,_0x3ddbc4);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 219600c..0ddeb4e 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 _0x277d=['addTeams','addAgents','addLists','addBlackLists','/:id','delete','destroy','removeTeams','removeAgents','/:id/lists','removeBlackLists','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueue.controller','index','isAuthenticated','/:id/hoppers','getHoppers','get','/:id/hopper_finals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','post','/:id/clone','clone'];(function(_0x766a14,_0x59152d){var _0x3507ab=function(_0x2ff8da){while(--_0x2ff8da){_0x766a14['push'](_0x766a14['shift']());}};_0x3507ab(++_0x59152d);}(_0x277d,0xe9));var _0xd277=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x277d[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require(_0xd277('0x0'));var path=require(_0xd277('0x1'));var timeout=require('connect-timeout');var express=require(_0xd277('0x2'));var router=express[_0xd277('0x3')]();var fs_extra=require(_0xd277('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd277('0x5'));var config=require(_0xd277('0x6'));var controller=require(_0xd277('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd277('0x8')]);router['get']('/:id',auth[_0xd277('0x9')](),controller['show']);router['get'](_0xd277('0xa'),auth[_0xd277('0x9')](),controller[_0xd277('0xb')]);router[_0xd277('0xc')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0xd277('0xd'),auth[_0xd277('0x9')](),controller['getHopperFinals']);router[_0xd277('0xc')](_0xd277('0xe'),auth[_0xd277('0x9')](),controller['getHopperBlacks']);router[_0xd277('0xc')](_0xd277('0xf'),auth['isAuthenticated'](),controller[_0xd277('0x10')]);router[_0xd277('0xc')](_0xd277('0x11'),auth[_0xd277('0x9')](),controller[_0xd277('0x12')]);router[_0xd277('0xc')](_0xd277('0x13'),auth[_0xd277('0x9')](),controller[_0xd277('0x14')]);router['get']('/:id/lists',auth[_0xd277('0x9')](),controller[_0xd277('0x15')]);router[_0xd277('0xc')](_0xd277('0x16'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xd277('0x17')]('/',auth[_0xd277('0x9')](),controller['create']);router[_0xd277('0x17')](_0xd277('0x18'),auth[_0xd277('0x9')](),controller[_0xd277('0x19')]);router[_0xd277('0x17')](_0xd277('0xf'),auth[_0xd277('0x9')](),controller[_0xd277('0x1a')]);router[_0xd277('0x17')](_0xd277('0x11'),auth[_0xd277('0x9')](),controller[_0xd277('0x1b')]);router[_0xd277('0x17')]('/:id/lists',auth[_0xd277('0x9')](),controller[_0xd277('0x1c')]);router[_0xd277('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd277('0x1d')]);router['put'](_0xd277('0x1e'),auth[_0xd277('0x9')](),controller['update']);router[_0xd277('0x1f')](_0xd277('0x1e'),auth[_0xd277('0x9')](),controller[_0xd277('0x20')]);router[_0xd277('0x1f')](_0xd277('0xf'),auth[_0xd277('0x9')](),controller[_0xd277('0x21')]);router[_0xd277('0x1f')](_0xd277('0x11'),auth['isAuthenticated'](),controller[_0xd277('0x22')]);router[_0xd277('0x1f')](_0xd277('0x23'),auth[_0xd277('0x9')](),controller['removeLists']);router[_0xd277('0x1f')](_0xd277('0x16'),auth['isAuthenticated'](),controller[_0xd277('0x24')]);module['exports']=router; \ No newline at end of file +var _0xc801=['../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','addLists','put','update','delete','destroy','removeTeams','removeLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x15f6f7,_0x305040){var _0x37c435=function(_0x51929b){while(--_0x51929b){_0x15f6f7['push'](_0x15f6f7['shift']());}};_0x37c435(++_0x305040);}(_0xc801,0x117));var _0x1c80=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xc801[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x1c80('0x0'));var util=require(_0x1c80('0x1'));var path=require(_0x1c80('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c80('0x3'));var router=express[_0x1c80('0x4')]();var fs_extra=require(_0x1c80('0x5'));var auth=require(_0x1c80('0x6'));var interaction=require(_0x1c80('0x7'));var config=require(_0x1c80('0x8'));var controller=require(_0x1c80('0x9'));router['get']('/',auth[_0x1c80('0xa')](),controller[_0x1c80('0xb')]);router[_0x1c80('0xc')](_0x1c80('0xd'),auth[_0x1c80('0xa')](),controller['show']);router['get'](_0x1c80('0xe'),auth['isAuthenticated'](),controller[_0x1c80('0xf')]);router[_0x1c80('0xc')](_0x1c80('0x10'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x11')]);router[_0x1c80('0xc')]('/:id/hopper_finals',auth[_0x1c80('0xa')](),controller[_0x1c80('0x12')]);router[_0x1c80('0xc')](_0x1c80('0x13'),auth['isAuthenticated'](),controller[_0x1c80('0x14')]);router[_0x1c80('0xc')]('/:id/teams',auth[_0x1c80('0xa')](),controller[_0x1c80('0x15')]);router[_0x1c80('0xc')](_0x1c80('0x16'),auth[_0x1c80('0xa')](),controller['getAgents']);router[_0x1c80('0xc')]('/:id/members',auth[_0x1c80('0xa')](),controller['getMembers']);router[_0x1c80('0xc')](_0x1c80('0x17'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x18')]);router[_0x1c80('0xc')](_0x1c80('0x19'),auth[_0x1c80('0xa')](),controller['getBlackLists']);router[_0x1c80('0x1a')]('/',auth[_0x1c80('0xa')](),controller[_0x1c80('0x1b')]);router[_0x1c80('0x1a')](_0x1c80('0x1c'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x1d')]);router[_0x1c80('0x1a')](_0x1c80('0x1e'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x1f')]);router[_0x1c80('0x1a')]('/:id/users',auth[_0x1c80('0xa')](),controller[_0x1c80('0x20')]);router[_0x1c80('0x1a')]('/:id/lists',auth['isAuthenticated'](),controller[_0x1c80('0x21')]);router[_0x1c80('0x1a')](_0x1c80('0x19'),auth[_0x1c80('0xa')](),controller['addBlackLists']);router[_0x1c80('0x22')]('/:id',auth[_0x1c80('0xa')](),controller[_0x1c80('0x23')]);router[_0x1c80('0x24')](_0x1c80('0xd'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x25')]);router[_0x1c80('0x24')](_0x1c80('0x1e'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x26')]);router[_0x1c80('0x24')](_0x1c80('0x16'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x1c80('0x24')](_0x1c80('0x17'),auth[_0x1c80('0xa')](),controller[_0x1c80('0x27')]);router[_0x1c80('0x24')](_0x1c80('0x19'),auth[_0x1c80('0xa')](),controller['removeBlackLists']);module[_0x1c80('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index cd8e8ea..58aacb1 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 _0x09f4=['FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','predictive','power','INTEGER','yes','once','join','periodic_announce','joinempty','split','leavewhenempty','acw','wrapuptime','preview','progressive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x09f4,0x1a5));var _0x409f=function(_0x18801d,_0x3fee8e){_0x18801d=_0x18801d-0x0;var _0x3e98e0=_0x09f4[_0x18801d];return _0x3e98e0;};'use strict';var Sequelize=require('sequelize');module[_0x409f('0x0')]={'name':{'type':Sequelize[_0x409f('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x409f('0x3')},'musiconhold':{'type':Sequelize[_0x409f('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x409f('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x409f('0x2')]('rr',_0x409f('0x4'),_0x409f('0x5'),_0x409f('0x6'),_0x409f('0x7'),_0x409f('0x8'),_0x409f('0x9'),_0x409f('0xa'),_0x409f('0xb')),'allowNull':![],'defaultValue':_0x409f('0x4'),'set':function(_0xc1b11c){this[_0x409f('0xc')](_0x409f('0xd'),_0xc1b11c?_0xc1b11c:_0x409f('0x8'));},'get':function(){var _0x18fb4f=this[_0x409f('0xe')](_0x409f('0xf'));var _0x3e8d0b=this[_0x409f('0xe')](_0x409f('0x10'));var _0x51cc41=this['getDataValue'](_0x409f('0xd'));if(_0x18fb4f===_0x409f('0x3')){return _0x51cc41;}if(_0x3e8d0b===_0x409f('0x11')&&_0x51cc41===_0x409f('0x8')||_0x3e8d0b===_0x409f('0x11')&&_0x51cc41==='roundrobin'){return _0x51cc41;}if(_0x3e8d0b==='progressive'||_0x3e8d0b===_0x409f('0x12')||_0x3e8d0b===_0x409f('0x13')){return _0x51cc41;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x409f('0x14')](0xb)},'timeout':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x409f('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x409f('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x409f('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x409f('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x409f('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no'),'defaultValue':_0x409f('0x15')},'announce_holdtime':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no',_0x409f('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x409f('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x409f('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x409f('0x1')]},'queue_youarenext':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x409f('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x409f('0x1')]},'queue_quantity1':{'type':Sequelize[_0x409f('0x1')]},'queue_quantity2':{'type':Sequelize[_0x409f('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1cb172){this[_0x409f('0xc')]('periodic_announce',_0x1cb172?_0x1cb172[_0x409f('0x17')](','):[]);},'get':function(){return this[_0x409f('0xe')]('periodic_announce')?this[_0x409f('0xe')](_0x409f('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x409f('0x1')],'defaultValue':_0x409f('0x15'),'set':function(_0x50a99d){this[_0x409f('0xc')]('joinempty',_0x50a99d?_0x50a99d[_0x409f('0x17')](','):undefined);},'get':function(){return this[_0x409f('0xe')](_0x409f('0x19'))?this[_0x409f('0xe')](_0x409f('0x19'))[_0x409f('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x409f('0x1')],'defaultValue':'no','set':function(_0x4db384){this['setDataValue'](_0x409f('0x1b'),_0x4db384?_0x4db384[_0x409f('0x17')](','):undefined);},'get':function(){return this[_0x409f('0xe')](_0x409f('0x1b'))?this[_0x409f('0xe')](_0x409f('0x1b'))[_0x409f('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x409f('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x409f('0x1')]},'description':{'type':Sequelize[_0x409f('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x40c8d3){this[_0x409f('0xc')](_0x409f('0x1c'),_0x40c8d3);if(_0x40c8d3){if(this[_0x409f('0xe')](_0x409f('0x1d'))<0x2){this[_0x409f('0xc')](_0x409f('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x409f('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x1e'),_0x409f('0x1f'),'power','predictive',_0x409f('0x11')),'defaultValue':_0x409f('0x1f'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x409f('0x14')](0x4)[_0x409f('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x409f('0x21')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x409f('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x409f('0x22')},'dialPowerLevel':{'type':Sequelize[_0x409f('0x23')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x409f('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x409f('0x2')](_0x409f('0x25'),'dropRate'),'defaultValue':'dropRate','comment':_0x409f('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x409f('0x23')](0x2)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x409f('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x409f('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x409f('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x29')},'dialQueueOptions':{'type':Sequelize[_0x409f('0x1')],'defaultValue':_0x409f('0x2a'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x409f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x409f('0x2b')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'comment':_0x409f('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x409f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x409f('0x1')],'defaultValue':_0x409f('0x30')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x409f('0x31'),_0x409f('0x32'),_0x409f('0x33')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x409f('0x34')],'defaultValue':0x0,'comment':_0x409f('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x409f('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x409f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x409f('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x409f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x409f('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x409f('0x38')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x409f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x409f('0x39')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x409f('0x14')](0x9)[_0x409f('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x409f('0x3a')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x409f('0x20')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x409f('0x3b')},'dialRecallInQueue':{'type':Sequelize[_0x409f('0x34')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x409f('0x2')]('DESC',_0x409f('0x3c')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x409f('0x1')],'comment':_0x409f('0x2b')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x409f('0x34')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x409f('0x34')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x409f('0x3d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x409f('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x40')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x41')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x409f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x44')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x409f('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)[_0x409f('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x409f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x409f('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x409f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x409f('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x409f('0x34')],'defaultValue':![],'comment':_0x409f('0x49'),'set':function(_0x3763cc){if(!_0x3763cc)this[_0x409f('0xc')](_0x409f('0x4a'),null);this[_0x409f('0xc')](_0x409f('0x4b'),_0x3763cc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x409f('0x14')](0x3)[_0x409f('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x1a61=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','inbound','outbound','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','getDataValue','dialMethod','strategy','booked','progressive','predictive','INTEGER','yes','all','TEXT','setDataValue','periodic_announce','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#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\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','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)'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x1a61,0x1e6));var _0x11a6=function(_0x3de444,_0x1de96f){_0x3de444=_0x3de444-0x0;var _0x3360df=_0x1a61[_0x3de444];return _0x3360df;};'use strict';var Sequelize=require(_0x11a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x11a6('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x3'),_0x11a6('0x4')),'allowNull':![],'defaultValue':_0x11a6('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x11a6('0x2')]('rr','ringall',_0x11a6('0x5'),_0x11a6('0x6'),_0x11a6('0x7'),_0x11a6('0x8'),_0x11a6('0x9'),_0x11a6('0xa'),_0x11a6('0xb')),'allowNull':![],'defaultValue':_0x11a6('0xc'),'set':function(_0x1a7d57){this['setDataValue']('strategy',_0x1a7d57?_0x1a7d57:'rrmemory');},'get':function(){var _0xf7f73d=this[_0x11a6('0xd')]('type');var _0x3cbb05=this[_0x11a6('0xd')](_0x11a6('0xe'));var _0x16486f=this[_0x11a6('0xd')](_0x11a6('0xf'));if(_0xf7f73d==='inbound'){return _0x16486f;}if(_0x3cbb05==='booked'&&_0x16486f===_0x11a6('0x8')||_0x3cbb05===_0x11a6('0x10')&&_0x16486f==='roundrobin'){return _0x16486f;}if(_0x3cbb05===_0x11a6('0x11')||_0x3cbb05===_0x11a6('0x12')||_0x3cbb05==='power'){return _0x16486f;}return null;}},'servicelevel':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x11a6('0x1')]},'weight':{'type':Sequelize[_0x11a6('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':_0x11a6('0x14')},'autopause':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no',_0x11a6('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x11a6('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x11a6('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x11a6('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x11a6('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x11a6('0x14'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x11a6('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x11a6('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x11a6('0x1')]},'queue_youarenext':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x11a6('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x11a6('0x1')]},'queue_quantity1':{'type':Sequelize[_0x11a6('0x1')]},'queue_quantity2':{'type':Sequelize[_0x11a6('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x11a6('0x1')]},'queue_less_than':{'type':Sequelize[_0x11a6('0x1')]},'periodic_announce':{'type':Sequelize[_0x11a6('0x16')],'set':function(_0x270533){this[_0x11a6('0x17')](_0x11a6('0x18'),_0x270533?_0x270533[_0x11a6('0x19')](','):[]);},'get':function(){return this[_0x11a6('0xd')]('periodic_announce')?this[_0x11a6('0xd')]('periodic_announce')[_0x11a6('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':_0x11a6('0x14'),'set':function(_0x210f2f){this[_0x11a6('0x17')]('joinempty',_0x210f2f?_0x210f2f[_0x11a6('0x19')](','):undefined);},'get':function(){return this[_0x11a6('0xd')]('joinempty')?this['getDataValue']('joinempty')[_0x11a6('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':'no','set':function(_0x4c5d5b){this[_0x11a6('0x17')](_0x11a6('0x1b'),_0x4c5d5b?_0x4c5d5b[_0x11a6('0x19')](','):undefined);},'get':function(){return this[_0x11a6('0xd')](_0x11a6('0x1b'))?this['getDataValue'](_0x11a6('0x1b'))[_0x11a6('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x11a6('0x2')](_0x11a6('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x11a6('0x1')]},'description':{'type':Sequelize[_0x11a6('0x1')]},'acw':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':0x0,'set':function(_0x1f3062){this['setDataValue'](_0x11a6('0x1d'),_0x1f3062);if(_0x1f3062){if(this[_0x11a6('0xd')](_0x11a6('0x1e'))<0x2){this[_0x11a6('0x17')](_0x11a6('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x11a6('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':0x0,'comment':_0x11a6('0x1f')},'dialMethod':{'type':Sequelize[_0x11a6('0x2')]('preview',_0x11a6('0x11'),_0x11a6('0x20'),'predictive',_0x11a6('0x10')),'defaultValue':_0x11a6('0x11'),'comment':_0x11a6('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x11a6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x11a6('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x11a6('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x11a6('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x11a6('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x11a6('0x26'),'dropRate'),'defaultValue':_0x11a6('0x27'),'comment':_0x11a6('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x11a6('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x11a6('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x11a6('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x11a6('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x11a6('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11a6('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x11a6('0x2c'),'comment':_0x11a6('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11a6('0x2e')},'dialQueueProject':{'type':Sequelize[_0x11a6('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x11a6('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x11a6('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11a6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x11a6('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0x11a6('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x11a6('0x32')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':_0x11a6('0x33')},'dialPrefix':{'type':Sequelize[_0x11a6('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x11a6('0x2')]('always',_0x11a6('0x34'),_0x11a6('0x35')),'defaultValue':_0x11a6('0x36')},'dialAMDActive':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':0x0,'comment':_0x11a6('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x11a6('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x11a6('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x11a6('0x13')](0x9)[_0x11a6('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x11a6('0x13')](0x9)[_0x11a6('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x11a6('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x11a6('0x13')](0x9)[_0x11a6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x11a6('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x11a6('0x13')](0x9)[_0x11a6('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x11a6('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x11a6('0x13')](0x9)[_0x11a6('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x11a6('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x11a6('0x13')](0x9)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x11a6('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x11a6('0x13')](0x5)[_0x11a6('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x11a6('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x11a6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x11a6('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x11a6('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':0x0,'comment':_0x11a6('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x11a6('0x2')]('DESC',_0x11a6('0x41')),'defaultValue':_0x11a6('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x11a6('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x11a6('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x11a6('0x13')](0x5)[_0x11a6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11a6('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x11a6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11a6('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x11a6('0x13')](0x5)[_0x11a6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x11a6('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x11a6('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x11a6('0x13')](0x5)[_0x11a6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x11a6('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11a6('0x13')],'allowNull':!![],'comment':_0x11a6('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x11a6('0x1c')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x25dd2){if(!_0x25dd2)this[_0x11a6('0x17')](_0x11a6('0x4e'),null);this['setDataValue'](_0x11a6('0x4f'),_0x25dd2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x11a6('0x13')](0x3)[_0x11a6('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index f412db8..ab48032 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 _0x708f=['rows','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','length','omit','createdAt','updatedAt','error','params','findOne','CmHopper','VoiceQueueId','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','isNil','interface','format','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','every','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','push','SIP/%s','isArray','UserVoiceQueueRt','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','stack','send','index','VoiceQueue','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x47cbcf,_0xa4013a){var _0x473d4c=function(_0x3257ef){while(--_0x3257ef){_0x47cbcf['push'](_0x47cbcf['shift']());}};_0x473d4c(++_0xa4013a);}(_0x708f,0x1d6));var _0xf708=function(_0x368ebf,_0x33111b){_0x368ebf=_0x368ebf-0x0;var _0x3cea0a=_0x708f[_0x368ebf];return _0x3cea0a;};'use strict';var emlformat=require(_0xf708('0x0'));var rimraf=require(_0xf708('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf708('0x2'));var BPromise=require(_0xf708('0x3'));var Mustache=require(_0xf708('0x4'));var util=require('util');var path=require(_0xf708('0x5'));var sox=require('sox');var csv=require(_0xf708('0x6'));var ejs=require(_0xf708('0x7'));var fs=require('fs');var fs_extra=require(_0xf708('0x8'));var _=require(_0xf708('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf708('0xa'));var deskjs=require(_0xf708('0xb'));var toCsv=require(_0xf708('0x6'));var querystring=require(_0xf708('0xc'));var Papa=require(_0xf708('0xd'));var Redis=require(_0xf708('0xe'));var authService=require(_0xf708('0xf'));var qs=require(_0xf708('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf708('0x11'));var logger=require(_0xf708('0x12'))('api');var utils=require(_0xf708('0x13'));var config=require(_0xf708('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf708('0x15'))['db'];config[_0xf708('0x16')]=_[_0xf708('0x17')](config[_0xf708('0x16')],{'host':_0xf708('0x18'),'port':0x18eb});var socket=require(_0xf708('0x19'))(new Redis(config[_0xf708('0x16')]));require(_0xf708('0x1a'))[_0xf708('0x1b')](socket);function respondWithStatusCode(_0x55f1ff,_0x2d7b0e){_0x2d7b0e=_0x2d7b0e||0xcc;return function(_0x457f7d){if(_0x457f7d){return _0x55f1ff[_0xf708('0x1c')](_0x2d7b0e);}return _0x55f1ff[_0xf708('0x1d')](_0x2d7b0e)[_0xf708('0x1e')]();};}function respondWithResult(_0xbf0431,_0x5d0949){_0x5d0949=_0x5d0949||0xc8;return function(_0x1ff261){if(_0x1ff261){return _0xbf0431[_0xf708('0x1d')](_0x5d0949)[_0xf708('0x1f')](_0x1ff261);}};}function respondWithFilteredResult(_0x3807e9,_0x13c3fc){return function(_0x69461d){if(_0x69461d){var _0x49aaa4=typeof _0x13c3fc[_0xf708('0x20')]===_0xf708('0x21')&&typeof _0x13c3fc[_0xf708('0x22')]==='undefined';var _0x2840fe=_0x69461d[_0xf708('0x23')];var _0x5d0f83=_0x49aaa4?0x0:_0x13c3fc['offset'];var _0x55089a=_0x49aaa4?_0x69461d[_0xf708('0x23')]:_0x13c3fc[_0xf708('0x20')]+_0x13c3fc['limit'];var _0x3b09a2;if(_0x55089a>=_0x2840fe){_0x55089a=_0x2840fe;_0x3b09a2=0xc8;}else{_0x3b09a2=0xce;}_0x3807e9['status'](_0x3b09a2);return _0x3807e9[_0xf708('0x24')](_0xf708('0x25'),_0x5d0f83+'-'+_0x55089a+'/'+_0x2840fe)[_0xf708('0x1f')](_0x69461d);}return null;};}function patchUpdates(_0x4b6916){return function(_0x492f9f){try{jsonpatch['apply'](_0x492f9f,_0x4b6916,!![]);}catch(_0x321c8b){return BPromise[_0xf708('0x26')](_0x321c8b);}return _0x492f9f['save']();};}function saveUpdates(_0x44f78c,_0x283216){return function(_0x16d0c8){if(_0x16d0c8){return _0x16d0c8['update'](_0x44f78c)[_0xf708('0x27')](function(_0xf160d6){return _0xf160d6;});}return null;};}function removeEntity(_0x55eed9,_0x291aee){return function(_0x3f143d){if(_0x3f143d){return _0x3f143d[_0xf708('0x28')]()[_0xf708('0x27')](function(){var _0x3b10f1=_0x3f143d[_0xf708('0x29')]({'plain':!![]});var _0x2c7349=[{'name':_0xf708('0x2a'),'value':_0xf708('0x2b'),'ignore':![]},{'name':_0xf708('0x2c'),'value':_0xf708('0x2d'),'ignore':![]}];var _0x282da2=_(_0x2c7349)[_0xf708('0x2e')](_0xf708('0x2f'))[_0xf708('0x30')](_0xf708('0x31'))['value']();if(_[_0xf708('0x32')](_0x282da2,_0x3b10f1[_0xf708('0x33')])){return;}var _0x56916c=_[_0xf708('0x34')](_0x2c7349,[_0xf708('0x31'),_0x3b10f1[_0xf708('0x33')]])[_0xf708('0x35')];return db[_0xf708('0x36')][_0xf708('0x28')]({'where':{'type':_0x56916c,'resourceId':_0x3b10f1['id']}})[_0xf708('0x27')](function(){return _0x3f143d;});})[_0xf708('0x27')](function(){_0x55eed9[_0xf708('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5419cd,_0xd55052){return function(_0x36dad7){if(!_0x36dad7){_0x5419cd[_0xf708('0x1c')](0x194);}return _0x36dad7;};}function handleError(_0x506988,_0x19e0cc){_0x19e0cc=_0x19e0cc||0x1f4;return function(_0x17be58){logger['error'](_0x17be58[_0xf708('0x37')]);if(_0x17be58['name']){delete _0x17be58[_0xf708('0x35')];}_0x506988[_0xf708('0x1d')](_0x19e0cc)[_0xf708('0x38')](_0x17be58);};}exports[_0xf708('0x39')]=function(_0x7a478c,_0x489953){var _0x3fa16d={},_0x7e8c8d={},_0x38d496={'count':0x0,'rows':[]};var _0x4efbe3=_[_0xf708('0x30')](db[_0xf708('0x3a')]['rawAttributes'],function(_0x4261c){return{'name':_0x4261c[_0xf708('0x3b')],'type':_0x4261c[_0xf708('0x33')]['key']};});_0x7e8c8d[_0xf708('0x3c')]=_[_0xf708('0x30')](_0x4efbe3,_0xf708('0x35'));_0x7e8c8d[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x7a478c[_0xf708('0x3d')]);_0x7e8c8d['filters']=_[_0xf708('0x3f')](_0x7e8c8d[_0xf708('0x3c')],_0x7e8c8d[_0xf708('0x3d')]);_0x3fa16d[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x7e8c8d[_0xf708('0x3c')],qs['fields'](_0x7a478c[_0xf708('0x3d')][_0xf708('0x41')]));_0x3fa16d[_0xf708('0x40')]=_0x3fa16d[_0xf708('0x40')]['length']?_0x3fa16d[_0xf708('0x40')]:_0x7e8c8d[_0xf708('0x3c')];if(!_0x7a478c[_0xf708('0x3d')][_0xf708('0x42')](_0xf708('0x43'))){_0x3fa16d[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x7a478c[_0xf708('0x3d')][_0xf708('0x22')]);_0x3fa16d['offset']=qs['offset'](_0x7a478c[_0xf708('0x3d')][_0xf708('0x20')]);}_0x3fa16d[_0xf708('0x44')]=qs['sort'](_0x7a478c[_0xf708('0x3d')][_0xf708('0x45')]);_0x3fa16d[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x7a478c[_0xf708('0x3d')],_0x7e8c8d[_0xf708('0x47')]),_0x4efbe3);if(_0x7a478c['query'][_0xf708('0x2e')]){_0x3fa16d[_0xf708('0x46')]=_[_0xf708('0x49')](_0x3fa16d[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x4efbe3,function(_0x2dd901){if(_0x2dd901['type']!==_0xf708('0x4a')){var _0x5ca611={};_0x5ca611[_0x2dd901[_0xf708('0x35')]]={'$like':'%'+_0x7a478c[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x5ca611;}})});}_0x3fa16d=_[_0xf708('0x49')]({},_0x3fa16d,_0x7a478c[_0xf708('0x4b')]);var _0xebd130={'where':_0x3fa16d[_0xf708('0x46')]};return db[_0xf708('0x3a')][_0xf708('0x23')](_0xebd130)[_0xf708('0x27')](function(_0x3c6372){_0x38d496[_0xf708('0x23')]=_0x3c6372;if(_0x7a478c[_0xf708('0x3d')][_0xf708('0x4c')]){_0x3fa16d[_0xf708('0x4d')]=[{'all':!![]}];}return db['VoiceQueue'][_0xf708('0x4e')](_0x3fa16d);})[_0xf708('0x27')](function(_0x1fdb2b){_0x38d496[_0xf708('0x4f')]=_0x1fdb2b;return _0x38d496;})[_0xf708('0x27')](respondWithFilteredResult(_0x489953,_0x3fa16d))['catch'](handleError(_0x489953,null));};exports['show']=function(_0x5aa69d,_0x3f1a85){var _0x13ec36={'raw':![],'where':{'id':_0x5aa69d['params']['id']}},_0x3ebcdf={};_0x3ebcdf[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x3a')][_0xf708('0x50')]);_0x3ebcdf['query']=_[_0xf708('0x3e')](_0x5aa69d[_0xf708('0x3d')]);_0x3ebcdf[_0xf708('0x47')]=_['intersection'](_0x3ebcdf['model'],_0x3ebcdf[_0xf708('0x3d')]);_0x13ec36[_0xf708('0x40')]=_['intersection'](_0x3ebcdf[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x5aa69d[_0xf708('0x3d')][_0xf708('0x41')]));_0x13ec36[_0xf708('0x40')]=_0x13ec36[_0xf708('0x40')]['length']?_0x13ec36[_0xf708('0x40')]:_0x3ebcdf[_0xf708('0x3c')];if(_0x5aa69d[_0xf708('0x3d')][_0xf708('0x4c')]){_0x13ec36[_0xf708('0x4d')]=[{'all':!![]}];}_0x13ec36=_[_0xf708('0x49')]({},_0x13ec36,_0x5aa69d[_0xf708('0x4b')]);return db[_0xf708('0x3a')]['find'](_0x13ec36)['then'](handleEntityNotFound(_0x3f1a85,null))[_0xf708('0x27')](respondWithResult(_0x3f1a85,null))[_0xf708('0x51')](handleError(_0x3f1a85,null));};exports[_0xf708('0x52')]=function(_0x43ddfc,_0x407762){return db[_0xf708('0x3a')][_0xf708('0x52')](_0x43ddfc[_0xf708('0x53')],{})[_0xf708('0x27')](function(_0x4a2500){var _0x74e3ae=_0x43ddfc[_0xf708('0x54')][_0xf708('0x29')]({'plain':!![]});if(!_0x74e3ae)throw new Error(_0xf708('0x55'));if(_0x74e3ae[_0xf708('0x56')]===_0xf708('0x54')){var _0x2cee0b=_0x4a2500[_0xf708('0x29')]({'plain':!![]});var _0x4631f5=[{'name':_0xf708('0x2a'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xf708('0x2d')}];var _0x4a7273=_[_0xf708('0x34')](_0x4631f5,[_0xf708('0x31'),_0x2cee0b[_0xf708('0x33')]])[_0xf708('0x35')];return db[_0xf708('0x57')][_0xf708('0x34')]({'where':{'name':_0x4a7273,'userProfileId':_0x74e3ae[_0xf708('0x58')]},'raw':!![]})[_0xf708('0x27')](function(_0x31de3f){if(_0x31de3f&&_0x31de3f[_0xf708('0x59')]===0x0){return db[_0xf708('0x36')][_0xf708('0x52')]({'name':_0x2cee0b['name'],'resourceId':_0x2cee0b['id'],'type':_0x31de3f[_0xf708('0x35')],'sectionId':_0x31de3f['id']},{})[_0xf708('0x27')](function(){return _0x4a2500;});}else{return _0x4a2500;}})[_0xf708('0x51')](function(_0xe9b451){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe9b451);throw _0xe9b451;});}return _0x4a2500;})[_0xf708('0x27')](respondWithResult(_0x407762,0xc9))[_0xf708('0x51')](handleError(_0x407762,null));};exports['clone']=function(_0x46daf7,_0x4d5fb3){var _0xcf6c68={'where':{'id':_0x46daf7['params']['id']}},_0x1a5950={};_0x1a5950[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x3a')][_0xf708('0x50')]);_0xcf6c68[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x1a5950[_0xf708('0x3c')],qs['fields'](_0x46daf7[_0xf708('0x3d')][_0xf708('0x41')]));_0xcf6c68[_0xf708('0x40')]=_0xcf6c68[_0xf708('0x40')][_0xf708('0x5a')]?_0xcf6c68['attributes']:_0x1a5950['model'];if(_0x46daf7[_0xf708('0x3d')][_0xf708('0x4c')]){_0xcf6c68['include']=[{'all':!![]}];}_0xcf6c68=_[_0xf708('0x49')]({},_0xcf6c68,_0x46daf7['options']);return db[_0xf708('0x3a')]['find'](_0xcf6c68)['then'](handleEntityNotFound(_0x4d5fb3,null))[_0xf708('0x27')](function(_0x237f0d){if(_0x237f0d){var _0x3ae330=_0x237f0d['get']({'plain':!![]});_0x3ae330=qs[_0xf708('0x5b')](_0x3ae330,['id','createdAt','updatedAt']);_0x46daf7[_0xf708('0x53')]=_[_0xf708('0x5b')](_0x46daf7[_0xf708('0x53')],['id',_0xf708('0x5c'),_0xf708('0x5d')]);return db['VoiceQueue'][_0xf708('0x52')](_['merge'](_0x3ae330,_0x46daf7['body']),{'include':_0x46daf7[_0xf708('0x3d')][_0xf708('0x4c')]?[{'all':!![]}]:undefined})[_0xf708('0x27')](function(_0x42d85f){var _0x52cb37=_0x46daf7[_0xf708('0x54')][_0xf708('0x29')]({'plain':!![]});if(!_0x52cb37)throw new Error(_0xf708('0x55'));if(_0x52cb37[_0xf708('0x56')]==='user'){var _0x4ec44a=_0x42d85f[_0xf708('0x29')]({'plain':!![]});var _0x4434bd=[{'name':_0xf708('0x2a'),'value':_0xf708('0x2b')},{'name':_0xf708('0x2c'),'value':_0xf708('0x2d')}];var _0xacb012=_[_0xf708('0x34')](_0x4434bd,[_0xf708('0x31'),_0x4ec44a[_0xf708('0x33')]])[_0xf708('0x35')];return db[_0xf708('0x57')][_0xf708('0x34')]({'where':{'name':_0xacb012,'userProfileId':_0x52cb37[_0xf708('0x58')]},'raw':!![]})[_0xf708('0x27')](function(_0x5c36e0){if(_0x5c36e0&&_0x5c36e0[_0xf708('0x59')]===0x0){return db[_0xf708('0x36')]['create']({'name':_0x4ec44a['name'],'resourceId':_0x4ec44a['id'],'type':_0x5c36e0[_0xf708('0x35')],'sectionId':_0x5c36e0['id']},{})[_0xf708('0x27')](function(){return _0x42d85f;});}else{return _0x42d85f;}})[_0xf708('0x51')](function(_0x173f59){logger[_0xf708('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x173f59);throw _0x173f59;});}return _0x42d85f;});}})[_0xf708('0x27')](respondWithResult(_0x4d5fb3,0xc9))[_0xf708('0x51')](handleError(_0x4d5fb3,null));};exports['update']=function(_0x1399a5,_0x65339){if(_0x1399a5[_0xf708('0x53')]['id']){delete _0x1399a5[_0xf708('0x53')]['id'];}return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x1399a5[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0x65339,null))[_0xf708('0x27')](saveUpdates(_0x1399a5[_0xf708('0x53')],null))['then'](respondWithResult(_0x65339,null))['catch'](handleError(_0x65339,null));};exports[_0xf708('0x28')]=function(_0x4a4c85,_0x26c73d){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x4a4c85['params']['id']}})['then'](handleEntityNotFound(_0x26c73d,null))['then'](removeEntity(_0x26c73d,null))['catch'](handleError(_0x26c73d,null));};exports['getHoppers']=function(_0x515801,_0x4442c9,_0x1d19af){var _0x13277d={'raw':![],'where':{}};var _0x1d9eeb={};var _0x408bda={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x515801['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x4442c9,null))[_0xf708('0x27')](function(_0x590212){if(_0x590212){_0x1d9eeb[_0xf708('0x3c')]=_['keys'](db[_0xf708('0x61')][_0xf708('0x50')]);_0x1d9eeb[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x515801[_0xf708('0x3d')]);_0x1d9eeb[_0xf708('0x47')]=_['intersection'](_0x1d9eeb['model'],_0x1d9eeb['query']);_0x13277d['attributes']=_[_0xf708('0x3f')](_0x1d9eeb[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x515801[_0xf708('0x3d')]['fields']));_0x13277d[_0xf708('0x40')]=_0x13277d[_0xf708('0x40')][_0xf708('0x5a')]?_0x13277d[_0xf708('0x40')]:_0x1d9eeb[_0xf708('0x3c')];if(!_0x515801[_0xf708('0x3d')][_0xf708('0x42')](_0xf708('0x43'))){_0x13277d[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x515801[_0xf708('0x3d')][_0xf708('0x22')]);_0x13277d[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x515801[_0xf708('0x3d')]['offset']);}_0x13277d[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x515801[_0xf708('0x3d')][_0xf708('0x45')]);_0x13277d[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x515801['query'],_0x1d9eeb[_0xf708('0x47')]));_0x13277d['where'][_0xf708('0x62')]=_0x590212['id'];if(_0x515801['query'][_0xf708('0x2e')]){_0x13277d[_0xf708('0x46')]=_[_0xf708('0x49')](_0x13277d[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x13277d[_0xf708('0x40')],function(_0x353728){var _0x28eb0f={};_0x28eb0f[_0x353728]={'$like':'%'+_0x515801[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x28eb0f;})});}_0x13277d=_[_0xf708('0x49')]({},_0x13277d,_0x515801[_0xf708('0x4b')]);return db[_0xf708('0x61')]['count']({'where':_0x13277d['where']})[_0xf708('0x27')](function(_0x25eb8d){_0x408bda[_0xf708('0x23')]=_0x25eb8d;if(_0x515801[_0xf708('0x3d')]['includeAll']){_0x13277d[_0xf708('0x4d')]=[{'all':!![]}];}return db[_0xf708('0x61')][_0xf708('0x4e')](_0x13277d);})[_0xf708('0x27')](function(_0x5c134d){_0x408bda[_0xf708('0x4f')]=_0x5c134d;return _0x408bda;});}})[_0xf708('0x27')](respondWithFilteredResult(_0x4442c9,_0x13277d))[_0xf708('0x51')](handleError(_0x4442c9,null));};exports['getHopperHistories']=function(_0x27b2e3,_0x2bd8a6,_0x57edb5){var _0x7c9df3={'raw':!![],'where':{}};var _0xe167fe={};var _0x5345b0={'count':0x0,'rows':[]};return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x27b2e3['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x2bd8a6,null))[_0xf708('0x27')](function(_0x4aee8e){if(_0x4aee8e){_0xe167fe[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x63')]['rawAttributes']);_0xe167fe[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x27b2e3[_0xf708('0x3d')]);_0xe167fe[_0xf708('0x47')]=_[_0xf708('0x3f')](_0xe167fe[_0xf708('0x3c')],_0xe167fe[_0xf708('0x3d')]);_0x7c9df3[_0xf708('0x40')]=_[_0xf708('0x3f')](_0xe167fe[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x27b2e3[_0xf708('0x3d')]['fields']));_0x7c9df3[_0xf708('0x40')]=_0x7c9df3[_0xf708('0x40')][_0xf708('0x5a')]?_0x7c9df3[_0xf708('0x40')]:_0xe167fe[_0xf708('0x3c')];if(!_0x27b2e3[_0xf708('0x3d')][_0xf708('0x42')]('nolimit')){_0x7c9df3['limit']=qs[_0xf708('0x22')](_0x27b2e3[_0xf708('0x3d')][_0xf708('0x22')]);_0x7c9df3[_0xf708('0x20')]=qs['offset'](_0x27b2e3[_0xf708('0x3d')]['offset']);}_0x7c9df3[_0xf708('0x44')]=qs['sort'](_0x27b2e3[_0xf708('0x3d')][_0xf708('0x45')]);_0x7c9df3[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x27b2e3[_0xf708('0x3d')],_0xe167fe['filters']));_0x7c9df3[_0xf708('0x46')][_0xf708('0x62')]=_0x4aee8e['id'];if(_0x27b2e3['query'][_0xf708('0x2e')]){_0x7c9df3[_0xf708('0x46')]=_['merge'](_0x7c9df3[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x7c9df3[_0xf708('0x40')],function(_0x92d961){var _0x302b9b={};_0x302b9b[_0x92d961]={'$like':'%'+_0x27b2e3['query'][_0xf708('0x2e')]+'%'};return _0x302b9b;})});}_0x7c9df3=_[_0xf708('0x49')]({},_0x7c9df3,_0x27b2e3[_0xf708('0x4b')]);return db[_0xf708('0x63')]['count']({'where':_0x7c9df3[_0xf708('0x46')]})[_0xf708('0x27')](function(_0x1dadd1){_0x5345b0[_0xf708('0x23')]=_0x1dadd1;if(_0x27b2e3[_0xf708('0x3d')]['includeAll']){_0x7c9df3['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xf708('0x4e')](_0x7c9df3);})['then'](function(_0x3f3055){_0x5345b0[_0xf708('0x4f')]=_0x3f3055;return _0x5345b0;});}})[_0xf708('0x27')](respondWithFilteredResult(_0x2bd8a6,_0x7c9df3))[_0xf708('0x51')](handleError(_0x2bd8a6,null));};exports['getHopperFinals']=function(_0xbb6045,_0x18931a,_0x13ea5a){var _0x422d95={'raw':!![],'where':{}};var _0x406602={};var _0x2f5ca5={'count':0x0,'rows':[]};return db[_0xf708('0x3a')]['findOne']({'where':{'id':_0xbb6045[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x18931a,null))['then'](function(_0x22f641){if(_0x22f641){_0x406602[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x64')][_0xf708('0x50')]);_0x406602['query']=_[_0xf708('0x3e')](_0xbb6045[_0xf708('0x3d')]);_0x406602['filters']=_['intersection'](_0x406602['model'],_0x406602[_0xf708('0x3d')]);_0x422d95[_0xf708('0x40')]=_['intersection'](_0x406602[_0xf708('0x3c')],qs[_0xf708('0x41')](_0xbb6045[_0xf708('0x3d')][_0xf708('0x41')]));_0x422d95[_0xf708('0x40')]=_0x422d95[_0xf708('0x40')][_0xf708('0x5a')]?_0x422d95['attributes']:_0x406602[_0xf708('0x3c')];if(!_0xbb6045[_0xf708('0x3d')]['hasOwnProperty'](_0xf708('0x43'))){_0x422d95[_0xf708('0x22')]=qs[_0xf708('0x22')](_0xbb6045['query']['limit']);_0x422d95[_0xf708('0x20')]=qs[_0xf708('0x20')](_0xbb6045[_0xf708('0x3d')][_0xf708('0x20')]);}_0x422d95[_0xf708('0x44')]=qs[_0xf708('0x45')](_0xbb6045[_0xf708('0x3d')][_0xf708('0x45')]);_0x422d95['where']=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0xbb6045[_0xf708('0x3d')],_0x406602[_0xf708('0x47')]));_0x422d95[_0xf708('0x46')][_0xf708('0x62')]=_0x22f641['id'];if(_0xbb6045['query'][_0xf708('0x2e')]){_0x422d95[_0xf708('0x46')]=_[_0xf708('0x49')](_0x422d95[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x422d95[_0xf708('0x40')],function(_0x2ea08d){var _0x395cb9={};_0x395cb9[_0x2ea08d]={'$like':'%'+_0xbb6045[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x395cb9;})});}_0x422d95=_['merge']({},_0x422d95,_0xbb6045[_0xf708('0x4b')]);return db[_0xf708('0x64')][_0xf708('0x23')]({'where':_0x422d95[_0xf708('0x46')]})['then'](function(_0x371c65){_0x2f5ca5[_0xf708('0x23')]=_0x371c65;if(_0xbb6045[_0xf708('0x3d')][_0xf708('0x4c')]){_0x422d95[_0xf708('0x4d')]=[{'all':!![]}];}return db[_0xf708('0x64')][_0xf708('0x4e')](_0x422d95);})[_0xf708('0x27')](function(_0x5dcd40){_0x2f5ca5['rows']=_0x5dcd40;return _0x2f5ca5;});}})['then'](respondWithFilteredResult(_0x18931a,_0x422d95))[_0xf708('0x51')](handleError(_0x18931a,null));};exports['getHopperBlacks']=function(_0x21e1a8,_0x34061c,_0x14653a){var _0x2625ee={'raw':!![],'where':{}};var _0x577539={};var _0x2432dc={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x21e1a8[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x34061c,null))['then'](function(_0xdd8b94){if(_0xdd8b94){_0x577539['model']=_[_0xf708('0x3e')](db[_0xf708('0x65')][_0xf708('0x50')]);_0x577539['query']=_['keys'](_0x21e1a8['query']);_0x577539[_0xf708('0x47')]=_[_0xf708('0x3f')](_0x577539[_0xf708('0x3c')],_0x577539[_0xf708('0x3d')]);_0x2625ee[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x577539[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x21e1a8['query'][_0xf708('0x41')]));_0x2625ee[_0xf708('0x40')]=_0x2625ee[_0xf708('0x40')][_0xf708('0x5a')]?_0x2625ee[_0xf708('0x40')]:_0x577539['model'];if(!_0x21e1a8['query']['hasOwnProperty'](_0xf708('0x43'))){_0x2625ee[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x21e1a8[_0xf708('0x3d')]['limit']);_0x2625ee[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x21e1a8[_0xf708('0x3d')][_0xf708('0x20')]);}_0x2625ee[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x21e1a8[_0xf708('0x3d')][_0xf708('0x45')]);_0x2625ee['where']=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x21e1a8[_0xf708('0x3d')],_0x577539['filters']));_0x2625ee[_0xf708('0x46')][_0xf708('0x62')]=_0xdd8b94['id'];if(_0x21e1a8['query'][_0xf708('0x2e')]){_0x2625ee[_0xf708('0x46')]=_[_0xf708('0x49')](_0x2625ee['where'],{'$or':_[_0xf708('0x30')](_0x2625ee[_0xf708('0x40')],function(_0x4bd43e){var _0x291769={};_0x291769[_0x4bd43e]={'$like':'%'+_0x21e1a8[_0xf708('0x3d')]['filter']+'%'};return _0x291769;})});}_0x2625ee=_[_0xf708('0x49')]({},_0x2625ee,_0x21e1a8[_0xf708('0x4b')]);return db['CmHopperBlack'][_0xf708('0x23')]({'where':_0x2625ee[_0xf708('0x46')]})[_0xf708('0x27')](function(_0x254a31){_0x2432dc[_0xf708('0x23')]=_0x254a31;if(_0x21e1a8[_0xf708('0x3d')][_0xf708('0x4c')]){_0x2625ee[_0xf708('0x4d')]=[{'all':!![]}];}return db[_0xf708('0x65')][_0xf708('0x4e')](_0x2625ee);})[_0xf708('0x27')](function(_0x15810b){_0x2432dc[_0xf708('0x4f')]=_0x15810b;return _0x2432dc;});}})[_0xf708('0x27')](respondWithFilteredResult(_0x34061c,_0x2625ee))[_0xf708('0x51')](handleError(_0x34061c,null));};exports[_0xf708('0x66')]=function(_0x4166a0,_0x4d4fab,_0x633606){var _0x5de34c={};var _0x52ce0a={};var _0x474b7f;var _0x16327f;return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x4166a0[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x4d4fab,null))[_0xf708('0x27')](function(_0x46088a){if(_0x46088a){_0x474b7f=_0x46088a;_0x52ce0a[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x67')][_0xf708('0x50')]);_0x52ce0a[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x4166a0[_0xf708('0x3d')]);_0x52ce0a[_0xf708('0x47')]=_[_0xf708('0x3f')](_0x52ce0a['model'],_0x52ce0a['query']);_0x5de34c['attributes']=_[_0xf708('0x3f')](_0x52ce0a[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x4166a0[_0xf708('0x3d')][_0xf708('0x41')]));_0x5de34c['attributes']=_0x5de34c[_0xf708('0x40')][_0xf708('0x5a')]?_0x5de34c[_0xf708('0x40')]:_0x52ce0a[_0xf708('0x3c')];_0x5de34c[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x4166a0[_0xf708('0x3d')][_0xf708('0x45')]);_0x5de34c[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x4166a0[_0xf708('0x3d')],_0x52ce0a['filters']));if(_0x4166a0[_0xf708('0x3d')][_0xf708('0x2e')]){_0x5de34c[_0xf708('0x46')]=_[_0xf708('0x49')](_0x5de34c['where'],{'$or':_[_0xf708('0x30')](_0x5de34c[_0xf708('0x40')],function(_0x4cd50f){var _0x28d0a3={};_0x28d0a3[_0x4cd50f]={'$like':'%'+_0x4166a0[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x28d0a3;})});}_0x5de34c=_[_0xf708('0x49')]({},_0x5de34c,_0x4166a0[_0xf708('0x4b')]);return _0x474b7f['getTeams'](_0x5de34c);}})[_0xf708('0x27')](function(_0x51d26c){if(_0x51d26c){_0x16327f=_0x51d26c['length'];if(!_0x4166a0[_0xf708('0x3d')]['hasOwnProperty'](_0xf708('0x43'))){_0x5de34c['limit']=qs[_0xf708('0x22')](_0x4166a0[_0xf708('0x3d')][_0xf708('0x22')]);_0x5de34c[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x4166a0[_0xf708('0x3d')]['offset']);}return _0x474b7f[_0xf708('0x66')](_0x5de34c);}})[_0xf708('0x27')](function(_0x492f49){if(_0x492f49){return _0x492f49?{'count':_0x16327f,'rows':_0x492f49}:null;}})[_0xf708('0x27')](respondWithResult(_0x4d4fab,null))[_0xf708('0x51')](handleError(_0x4d4fab,null));};exports[_0xf708('0x68')]=function(_0x2bf410,_0x34f306,_0x47cc73){var _0x5f4aac=_0x2bf410[_0xf708('0x53')][_0xf708('0x69')];var _0x513299=_['map'](_0x5f4aac,'id');return db[_0xf708('0x67')]['findAll']({'where':{'id':_0x513299},'attributes':['id'],'include':[{'model':db[_0xf708('0x6a')],'as':_0xf708('0x6b'),'attributes':['id','name',_0xf708('0x6c'),_0xf708('0x6d'),'interface'],'raw':!![]}]})[_0xf708('0x27')](function(_0x381118){if(_0x381118){var _0x36f1a1=_[_0xf708('0x6e')](_0x381118,function(_0x308f3e){var _0x25d432=_0x308f3e[_0xf708('0x29')]({'plain':!![]});_0x25d432[_0xf708('0x6b')][_0xf708('0x6f')](function(_0x6a6ef9){_0x6a6ef9[_0xf708('0x70')]=_[_0xf708('0x34')](_0x5f4aac,{'id':_0x25d432['id']})['penalty'];});return _0x25d432[_0xf708('0x6b')];});return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x2bf410[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](function(_0x3912f9){return db['sequelize'][_0xf708('0x71')](function(_0x5a2c3d){return _0x3912f9[_0xf708('0x68')](_0x513299,{'transaction':_0x5a2c3d})[_0xf708('0x27')](function(){return BPromise['each'](_0x5f4aac,function(_0xfac805){return db[_0xf708('0x72')][_0xf708('0x73')]({'TeamId':_0xfac805['id'],'VoiceQueueId':_0x2bf410[_0xf708('0x5f')]['id'],'penalty':_0xfac805['penalty']},{'transaction':_0x5a2c3d});});})['then'](function(){return BPromise[_0xf708('0x74')](_0x36f1a1,function(_0x5ed14b){return db[_0xf708('0x75')][_0xf708('0x76')]({'where':{'UserId':_0x5ed14b['id'],'VoiceQueueId':_0x2bf410['params']['id']},'defaults':{'penalty':_0x5ed14b[_0xf708('0x70')]},'transaction':_0x5a2c3d});});})['then'](function(){return BPromise[_0xf708('0x74')](_[_0xf708('0x2e')](_0x36f1a1,{'online':!![]}),function(_0x123842){return db['UserVoiceQueueRt'][_0xf708('0x73')]({'membername':_0x123842['name'],'UserId':_0x123842['id'],'queue_name':_0x3912f9[_0xf708('0x35')],'VoiceQueueId':_0x3912f9['id'],'interface':_[_0xf708('0x77')](_0x123842[_0xf708('0x78')])?util[_0xf708('0x79')]('SIP/%s',_0x123842[_0xf708('0x35')]):_0x123842[_0xf708('0x78')],'paused':_0x123842[_0xf708('0x6d')]||![],'penalty':_0x123842[_0xf708('0x70')]},{'transaction':_0x5a2c3d});});})[_0xf708('0x27')](function(){_0x36f1a1[_0xf708('0x6f')](function(_0x4e17c6){socket[_0xf708('0x7a')](_0xf708('0x7b'),{'UserId':_0x4e17c6['id'],'VoiceQueueId':_0x3912f9['id']});});});});});}})[_0xf708('0x27')](respondWithStatusCode(_0x34f306,null))[_0xf708('0x51')](handleError(_0x34f306,null));};exports[_0xf708('0x7c')]=function(_0x3953a4,_0x38587f,_0x543787){return db[_0xf708('0x67')]['findAll']({'where':{'id':_0x3953a4[_0xf708('0x3d')][_0xf708('0x7d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf708('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xf708('0x27')](handleEntityNotFound(_0x38587f,null))['then'](function(_0xc15d4){var _0x5cdfef=_[_0xf708('0x30')](_0xc15d4,'id');var _0x17dcbe=[];var _0x3c3531=[];var _0x339115=squel[_0xf708('0x7e')]();_0x339115[_0xf708('0x7f')](_0xf708('0x80'))[_0xf708('0x81')](_0xf708('0x82'),'tq')[_0xf708('0x83')](_0xf708('0x84'),'ut',_0xf708('0x85'))[_0xf708('0x46')](_0xf708('0x86'),_0x3953a4[_0xf708('0x5f')]['id']);for(var _0x54327a=0x0;_0x54327a<_0xc15d4[_0xf708('0x5a')];_0x54327a+=0x1){let _0x21faa4=_0xc15d4[_0x54327a];for(var _0x3c92de=0x0;_0x3c92de<_0x21faa4[_0xf708('0x6b')][_0xf708('0x5a')];_0x3c92de+=0x1){let _0x30f554=_0x21faa4['Agents'][_0x3c92de];var _0x567136=_0x339115[_0xf708('0x87')]();_0x567136['where'](_0xf708('0x88'),_0x30f554['id']);_0x3c3531['push'](db[_0xf708('0x89')][_0xf708('0x3d')](_0x567136[_0xf708('0x8a')](),{'type':db[_0xf708('0x89')]['QueryTypes']['SELECT']})[_0xf708('0x27')](function(_0x42c359){if(_0x42c359[_0xf708('0x5a')]===0x1){return _0x30f554['id'];}else{var _0x263e04=_[_0xf708('0x8b')](_['map'](_0x42c359,_0xf708('0x8c')),function(_0x41f423){return _[_0xf708('0x32')](_0x5cdfef,_0x41f423);});if(_0x263e04){return _0x30f554['id'];}}}));}}return BPromise[_0xf708('0x8d')](_0x3c3531)['then'](function(_0x4d8828){_0x17dcbe=_(_0x17dcbe)[_0xf708('0x8e')](_0x4d8828)[_0xf708('0x8f')]()[_0xf708('0x31')]();return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x3953a4['params']['id']}})[_0xf708('0x27')](function(_0x1dffea){return db['sequelize'][_0xf708('0x71')](function(_0x25d108){return _0x1dffea[_0xf708('0x7c')](_0x3953a4[_0xf708('0x3d')][_0xf708('0x7d')],{'transaction':_0x25d108})[_0xf708('0x27')](function(){if(!_[_0xf708('0x90')](_0x17dcbe)){return _0x1dffea[_0xf708('0x91')](_0x17dcbe,{'transaction':_0x25d108})['then'](function(){return db['UserVoiceQueueRt'][_0xf708('0x28')]({'where':{'VoiceQueueId':_0x3953a4[_0xf708('0x5f')]['id'],'UserId':_0x17dcbe},'transaction':_0x25d108});});}})[_0xf708('0x27')](function(){_0x17dcbe[_0xf708('0x6f')](function(_0x39d643){socket[_0xf708('0x7a')](_0xf708('0x92'),{'UserId':_0x39d643,'VoiceQueueId':_0x1dffea['id']});});});});});});})[_0xf708('0x27')](respondWithStatusCode(_0x38587f,null))[_0xf708('0x51')](handleError(_0x38587f,null));};exports[_0xf708('0x93')]=function(_0x1094eb,_0x35aee5,_0x156e27){var _0x40bfa9,_0x3606fa;return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x1094eb['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x35aee5,null))[_0xf708('0x27')](function(_0x38cf80){if(_0x38cf80){_0x3606fa=_0x38cf80;return _0x38cf80[_0xf708('0x93')](_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')],_[_0xf708('0x5b')](_0x1094eb[_0xf708('0x53')],['ids','id'])||{})['spread'](function(_0x56bb2b){for(var _0x35883b=0x0;_0x35883b<_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')]['length'];_0x35883b+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')][_0x35883b]),'VoiceQueueId':Number(_0x1094eb[_0xf708('0x5f')]['id'])});}return _0x56bb2b;});}})[_0xf708('0x27')](function(_0x505788){_0x40bfa9=_0x505788||[];if(_0x3606fa){return db['User'][_0xf708('0x4e')]({'where':{'id':_0x1094eb[_0xf708('0x53')][_0xf708('0x7d')]},'attributes':['id',_0xf708('0x35'),'online',_0xf708('0x6d'),_0xf708('0x78')],'raw':!![]});}})[_0xf708('0x27')](function(_0x1a0a7e){if(!_[_0xf708('0x90')](_0x1a0a7e)){var _0x631221=[];for(var _0x52e7c1=0x0;_0x52e7c1<_0x1a0a7e[_0xf708('0x5a')];_0x52e7c1++){if(_0x1a0a7e[_0x52e7c1][_0xf708('0x6c')]){_0x631221[_0xf708('0x94')](db['UserVoiceQueueRt'][_0xf708('0x73')]({'membername':_0x1a0a7e[_0x52e7c1]['name'],'UserId':_0x1a0a7e[_0x52e7c1]['id'],'queue_name':_0x3606fa['name'],'VoiceQueueId':_0x3606fa['id'],'interface':_[_0xf708('0x77')](_0x1a0a7e[_0x52e7c1][_0xf708('0x78')])?util['format'](_0xf708('0x95'),_0x1a0a7e[_0x52e7c1][_0xf708('0x35')]):_0x1a0a7e[_0x52e7c1]['interface'],'paused':_0x1a0a7e[_0x52e7c1]['voicePause']||![],'penalty':_0x1094eb[_0xf708('0x53')][_0xf708('0x70')]||0x0}));}}return BPromise['all'](_0x631221);}})[_0xf708('0x27')](function(){return _0x40bfa9;})[_0xf708('0x27')](respondWithResult(_0x35aee5,null))[_0xf708('0x51')](handleError(_0x35aee5,null));};exports['removeAgents']=function(_0x34ccd5,_0x1c3f7e,_0x5e9540){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x34ccd5[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x1c3f7e,null))[_0xf708('0x27')](function(_0x4e9fbb){if(_0x4e9fbb){return _0x4e9fbb[_0xf708('0x91')](_0x34ccd5['query'][_0xf708('0x7d')])['then'](function(){if(_[_0xf708('0x96')](_0x34ccd5[_0xf708('0x3d')]['ids'])){for(var _0x57d05a=0x0;_0x57d05a<_0x34ccd5['query'][_0xf708('0x7d')]['length'];_0x57d05a+=0x1){socket[_0xf708('0x7a')](_0xf708('0x92'),{'UserId':Number(_0x34ccd5['query'][_0xf708('0x7d')][_0x57d05a]),'VoiceQueueId':Number(_0x34ccd5['params']['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x34ccd5[_0xf708('0x3d')][_0xf708('0x7d')]),'VoiceQueueId':Number(_0x34ccd5[_0xf708('0x5f')]['id'])});}});}})[_0xf708('0x27')](function(_0x21738e){return db[_0xf708('0x97')]['destroy']({'where':{'VoiceQueueId':_0x34ccd5['params']['id'],'UserId':_0x34ccd5[_0xf708('0x3d')][_0xf708('0x7d')]}})[_0xf708('0x27')](function(){return _0x21738e;});})['then'](respondWithStatusCode(_0x1c3f7e,null))[_0xf708('0x51')](handleError(_0x1c3f7e,null));};exports[_0xf708('0x98')]=function(_0x2eac88,_0xd73ef,_0x490b16){var _0xa42b8e={};var _0x5e95c1={};var _0x2f4520;var _0x454ed0;return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x2eac88[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0xd73ef,null))[_0xf708('0x27')](function(_0x33ea9e){if(_0x33ea9e){_0x2f4520=_0x33ea9e;_0x5e95c1['model']=_[_0xf708('0x3e')](db['User'][_0xf708('0x50')]);_0x5e95c1[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x2eac88['query']);_0x5e95c1['filters']=_[_0xf708('0x3f')](_0x5e95c1['model'],_0x5e95c1['query']);_0xa42b8e['attributes']=_[_0xf708('0x3f')](_0x5e95c1[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x2eac88[_0xf708('0x3d')][_0xf708('0x41')]));_0xa42b8e[_0xf708('0x40')]=_0xa42b8e[_0xf708('0x40')]['length']?_0xa42b8e[_0xf708('0x40')]:_0x5e95c1['model'];_0xa42b8e[_0xf708('0x44')]=qs['sort'](_0x2eac88[_0xf708('0x3d')]['sort']);_0xa42b8e[_0xf708('0x46')]=qs['filters'](_[_0xf708('0x48')](_0x2eac88['query'],_0x5e95c1[_0xf708('0x47')]));if(_0x2eac88[_0xf708('0x3d')][_0xf708('0x2e')]){_0xa42b8e['where']=_[_0xf708('0x49')](_0xa42b8e['where'],{'$or':_[_0xf708('0x30')](_0xa42b8e[_0xf708('0x40')],function(_0x525139){var _0x3ed3d5={};_0x3ed3d5[_0x525139]={'$like':'%'+_0x2eac88['query']['filter']+'%'};return _0x3ed3d5;})});}_0xa42b8e=_[_0xf708('0x49')]({},_0xa42b8e,_0x2eac88[_0xf708('0x4b')]);return _0x2f4520['getAgents'](_0xa42b8e);}})[_0xf708('0x27')](function(_0x3cb14c){if(_0x3cb14c){_0x454ed0=_0x3cb14c['length'];if(!_0x2eac88['query'][_0xf708('0x42')](_0xf708('0x43'))){_0xa42b8e[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x2eac88[_0xf708('0x3d')][_0xf708('0x22')]);_0xa42b8e[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x2eac88[_0xf708('0x3d')][_0xf708('0x20')]);}return _0x2f4520[_0xf708('0x98')](_0xa42b8e);}})[_0xf708('0x27')](function(_0x4331a9){if(_0x4331a9){return _0x4331a9?{'count':_0x454ed0,'rows':_0x4331a9}:null;}})['then'](respondWithResult(_0xd73ef,null))[_0xf708('0x51')](handleError(_0xd73ef,null));};exports[_0xf708('0x99')]=function(_0x474d36,_0x36be75,_0x3cf4f5){var _0x4c155f={};var _0x630157={};var _0x1e7335;var _0x240ee1;return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x474d36[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0x36be75,null))[_0xf708('0x27')](function(_0x237ba2){if(_0x237ba2){_0x1e7335=_0x237ba2;_0x630157[_0xf708('0x3c')]=_['keys'](db['UserVoiceQueueRt'][_0xf708('0x50')]);_0x630157[_0xf708('0x3d')]=_[_0xf708('0x3e')](_0x474d36['query']);_0x630157[_0xf708('0x47')]=_[_0xf708('0x3f')](_0x630157[_0xf708('0x3c')],_0x630157[_0xf708('0x3d')]);_0x4c155f[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x630157[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x474d36[_0xf708('0x3d')]['fields']));_0x4c155f['attributes']=_0x4c155f[_0xf708('0x40')]['length']?_0x4c155f['attributes']:_0x630157[_0xf708('0x3c')];_0x4c155f[_0xf708('0x44')]=qs[_0xf708('0x45')](_0x474d36['query'][_0xf708('0x45')]);_0x4c155f[_0xf708('0x46')]=qs[_0xf708('0x47')](_[_0xf708('0x48')](_0x474d36[_0xf708('0x3d')],_0x630157[_0xf708('0x47')]));if(_0x474d36[_0xf708('0x3d')]['filter']){_0x4c155f['where']=_['merge'](_0x4c155f[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0x4c155f['attributes'],function(_0x594abd){var _0x464d3b={};_0x464d3b[_0x594abd]={'$like':'%'+_0x474d36[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x464d3b;})});}_0x4c155f=_[_0xf708('0x49')]({},_0x4c155f,_0x474d36[_0xf708('0x4b')]);return _0x1e7335[_0xf708('0x99')](_0x4c155f);}})['then'](function(_0x37ffe1){if(_0x37ffe1){_0x240ee1=_0x37ffe1[_0xf708('0x5a')];if(!_0x474d36[_0xf708('0x3d')]['hasOwnProperty'](_0xf708('0x43'))){_0x4c155f[_0xf708('0x22')]=qs['limit'](_0x474d36[_0xf708('0x3d')][_0xf708('0x22')]);_0x4c155f['offset']=qs[_0xf708('0x20')](_0x474d36['query'][_0xf708('0x20')]);}return _0x1e7335[_0xf708('0x99')](_0x4c155f);}})[_0xf708('0x27')](function(_0x505866){return _0x505866?{'count':_0x240ee1,'rows':_0x505866}:null;})[_0xf708('0x27')](respondWithResult(_0x36be75,null))[_0xf708('0x51')](handleError(_0x36be75,null));};exports[_0xf708('0x9a')]=function(_0x5871d3,_0x440e1b,_0x4df80e){var _0xe8da9a={};var _0x2cdba3={};var _0x15f8fe;var _0xebcc5;return db[_0xf708('0x3a')][_0xf708('0x60')]({'where':{'id':_0x5871d3[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x440e1b,null))[_0xf708('0x27')](function(_0x514b66){if(_0x514b66){_0x15f8fe=_0x514b66;_0x2cdba3[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x9b')][_0xf708('0x50')]);_0x2cdba3['query']=_['keys'](_0x5871d3[_0xf708('0x3d')]);_0x2cdba3['filters']=_['intersection'](_0x2cdba3['model'],_0x2cdba3[_0xf708('0x3d')]);_0xe8da9a[_0xf708('0x40')]=_[_0xf708('0x3f')](_0x2cdba3[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x5871d3[_0xf708('0x3d')][_0xf708('0x41')]));_0xe8da9a[_0xf708('0x40')]=_0xe8da9a[_0xf708('0x40')]['length']?_0xe8da9a[_0xf708('0x40')]:_0x2cdba3['model'];_0xe8da9a[_0xf708('0x44')]=qs['sort'](_0x5871d3['query'][_0xf708('0x45')]);_0xe8da9a[_0xf708('0x46')]=qs[_0xf708('0x47')](_['pick'](_0x5871d3[_0xf708('0x3d')],_0x2cdba3[_0xf708('0x47')]));if(_0x5871d3[_0xf708('0x3d')]['filter']){_0xe8da9a[_0xf708('0x46')]=_[_0xf708('0x49')](_0xe8da9a[_0xf708('0x46')],{'$or':_[_0xf708('0x30')](_0xe8da9a[_0xf708('0x40')],function(_0x50f7ac){var _0x36ccdc={};_0x36ccdc[_0x50f7ac]={'$like':'%'+_0x5871d3[_0xf708('0x3d')]['filter']+'%'};return _0x36ccdc;})});}_0xe8da9a=_['merge']({},_0xe8da9a,_0x5871d3[_0xf708('0x4b')]);return _0x15f8fe[_0xf708('0x9a')](_0xe8da9a);}})[_0xf708('0x27')](function(_0x33cd49){if(_0x33cd49){_0xebcc5=_0x33cd49[_0xf708('0x5a')];if(!_0x5871d3['query']['hasOwnProperty']('nolimit')){_0xe8da9a['limit']=qs[_0xf708('0x22')](_0x5871d3[_0xf708('0x3d')][_0xf708('0x22')]);_0xe8da9a[_0xf708('0x20')]=qs[_0xf708('0x20')](_0x5871d3[_0xf708('0x3d')][_0xf708('0x20')]);}return _0x15f8fe[_0xf708('0x9a')](_0xe8da9a);}})[_0xf708('0x27')](function(_0x59d4b0){if(_0x59d4b0){return _0x59d4b0?{'count':_0xebcc5,'rows':_0x59d4b0}:null;}})['then'](respondWithResult(_0x440e1b,null))[_0xf708('0x51')](handleError(_0x440e1b,null));};exports[_0xf708('0x9c')]=function(_0x4f8e79,_0x1a61cd,_0x10143c){var _0x1f3f60,_0x4dfe51;return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x4f8e79['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x1a61cd,null))[_0xf708('0x27')](function(_0x3d61a6){if(_0x3d61a6){_0x4dfe51=_0x3d61a6;return _0x3d61a6['addLists'](_0x4f8e79['body']['ids'],_[_0xf708('0x5b')](_0x4f8e79['body'],['ids','id'])||{});}return null;})[_0xf708('0x9d')](function(_0x2be40c){var _0x68f2d1;_0x1f3f60=_0x2be40c||[];var _0x20660a=[];if(_0x2be40c){for(var _0x2017b5=0x0;_0x2017b5<_0x2be40c[_0xf708('0x5a')];_0x2017b5+=0x1){var _0x44ab19=_0x2be40c[_0x2017b5][_0xf708('0x29')]({'plain':!![]});_0x4dfe51[_0xf708('0x9e')]=_0x4f8e79[_0xf708('0x53')][_0xf708('0x9e')]?_0x4f8e79[_0xf708('0x53')][_0xf708('0x9e')]:_0x4dfe51['dialCheckDuplicateType'];switch(_0x4dfe51['dialCheckDuplicateType']){case _0xf708('0x9f'):_0x68f2d1=squel[_0xf708('0xa0')]()[_0xf708('0xa1')](_0xf708('0xa2'))[_0xf708('0xa3')]([_0xf708('0xa4'),_0xf708('0xa5'),_0xf708('0xa6'),'ListId',_0xf708('0x62'),_0xf708('0x5c'),'updatedAt'],squel['select']()[_0xf708('0x7f')](_0xf708('0xa4'),_0xf708('0xa4'))[_0xf708('0x7f')]('NOW()',_0xf708('0xa5'))[_0xf708('0x7f')]('id',_0xf708('0xa6'))['field'](_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')](),_0xf708('0xa8'))[_0xf708('0x7f')](_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),'VoiceQueueId')[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5c'))[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5d'))[_0xf708('0x81')](_0xf708('0xaa'))['where'](_0xf708('0xab'))['where'](_0xf708('0xac'),_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')]())['where'](_0xf708('0xad'))[_0xf708('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf708('0x7e')]()[_0xf708('0x7f')](_0xf708('0xae'))[_0xf708('0x81')]('cm_hopper_final')[_0xf708('0x46')]('VoiceQueueId\x20=\x20?',_0x4f8e79['params']['id'][_0xf708('0x8a')]()))[_0xf708('0x46')](_0xf708('0xaf'),squel['select']()['field'](_0xf708('0xb0'))[_0xf708('0x81')](_0xf708('0xa2'))[_0xf708('0x46')](_0xf708('0x86'),_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')]())))[_0xf708('0x8a')]();break;case _0xf708('0xb1'):_0x68f2d1=squel[_0xf708('0xa0')]()[_0xf708('0xa1')]('cm_hopper')[_0xf708('0xa3')]([_0xf708('0xa4'),_0xf708('0xa5'),_0xf708('0xa6'),_0xf708('0xa8'),_0xf708('0x62'),_0xf708('0x5c'),'updatedAt'],squel['select']()[_0xf708('0x7f')](_0xf708('0xa4'),_0xf708('0xa4'))['field'](_0xf708('0xa9'),_0xf708('0xa5'))['field']('id',_0xf708('0xa6'))[_0xf708('0x7f')](_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')](),_0xf708('0xa8'))['field'](_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),_0xf708('0x62'))[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5c'))[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0x5d'))[_0xf708('0x81')](_0xf708('0xaa'))[_0xf708('0x46')](_0xf708('0xab'))[_0xf708('0x46')](_0xf708('0xac'),_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')]())[_0xf708('0x46')](_0xf708('0xad'))[_0xf708('0x46')](_0xf708('0xaf'),squel[_0xf708('0x7e')]()[_0xf708('0x7f')]('COALESCE(phone,\x27\x27)')['from'](_0xf708('0xa2'))[_0xf708('0x46')](_0xf708('0x86'),_0x4f8e79['params']['id'][_0xf708('0x8a')]())))['toString']();break;default:_0x68f2d1=squel[_0xf708('0xa0')]()[_0xf708('0xa1')]('cm_hopper')[_0xf708('0xa3')]([_0xf708('0xa4'),_0xf708('0xa5'),'ContactId',_0xf708('0xa8'),_0xf708('0x62'),'createdAt',_0xf708('0x5d')],squel[_0xf708('0x7e')]()['field'](_0xf708('0xa4'),'phone')[_0xf708('0x7f')](_0xf708('0xa9'),_0xf708('0xa5'))[_0xf708('0x7f')]('id',_0xf708('0xa6'))[_0xf708('0x7f')](_0x44ab19['CmListId'][_0xf708('0x8a')](),_0xf708('0xa8'))['field'](_0x4f8e79[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),_0xf708('0x62'))['field'](_0xf708('0xa9'),_0xf708('0x5c'))[_0xf708('0x7f')]('NOW()',_0xf708('0x5d'))[_0xf708('0x81')](_0xf708('0xaa'))[_0xf708('0x46')](_0xf708('0xab'))[_0xf708('0x46')](_0xf708('0xac'),_0x44ab19[_0xf708('0xa7')][_0xf708('0x8a')]())[_0xf708('0x46')](_0xf708('0xad')))[_0xf708('0x8a')]();}_0x20660a['push'](db['sequelize'][_0xf708('0x3d')](_0x68f2d1));}return BPromise[_0xf708('0x8d')](_0x20660a);}})[_0xf708('0x27')](function(){return _0x1f3f60;})['then'](respondWithResult(_0x1a61cd,null))[_0xf708('0x51')](handleError(_0x1a61cd,null));};exports[_0xf708('0xb2')]=function(_0x272b6d,_0x24d35c,_0x36759f){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x272b6d['params']['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x24d35c,null))[_0xf708('0x27')](function(_0x35c2ea){if(_0x35c2ea){return _0x35c2ea[_0xf708('0xb2')](_0x272b6d[_0xf708('0x3d')][_0xf708('0x7d')]);}})[_0xf708('0x27')](function(_0x497b1a){if(_0x497b1a){return db[_0xf708('0x61')][_0xf708('0x28')]({'where':{'ListId':_0x272b6d[_0xf708('0x3d')][_0xf708('0x7d')],'VoiceQueueId':_0x272b6d['params']['id']}})[_0xf708('0x27')](function(){return _0x497b1a;});}})[_0xf708('0x27')](respondWithStatusCode(_0x24d35c,null))[_0xf708('0x51')](handleError(_0x24d35c,null));};exports[_0xf708('0xb3')]=function(_0x56ee44,_0x42fcab,_0x41579e){var _0x11cde7={};var _0x42c996={};var _0x18921c;var _0x38544d;return db['VoiceQueue'][_0xf708('0x60')]({'where':{'id':_0x56ee44[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x42fcab,null))['then'](function(_0x44d3c4){if(_0x44d3c4){_0x18921c=_0x44d3c4;_0x42c996[_0xf708('0x3c')]=_[_0xf708('0x3e')](db[_0xf708('0x9b')][_0xf708('0x50')]);_0x42c996['query']=_[_0xf708('0x3e')](_0x56ee44[_0xf708('0x3d')]);_0x42c996[_0xf708('0x47')]=_['intersection'](_0x42c996[_0xf708('0x3c')],_0x42c996[_0xf708('0x3d')]);_0x11cde7['attributes']=_[_0xf708('0x3f')](_0x42c996[_0xf708('0x3c')],qs[_0xf708('0x41')](_0x56ee44[_0xf708('0x3d')][_0xf708('0x41')]));_0x11cde7[_0xf708('0x40')]=_0x11cde7['attributes'][_0xf708('0x5a')]?_0x11cde7[_0xf708('0x40')]:_0x42c996[_0xf708('0x3c')];_0x11cde7[_0xf708('0x44')]=qs['sort'](_0x56ee44[_0xf708('0x3d')][_0xf708('0x45')]);_0x11cde7[_0xf708('0x46')]=qs[_0xf708('0x47')](_['pick'](_0x56ee44[_0xf708('0x3d')],_0x42c996['filters']));if(_0x56ee44[_0xf708('0x3d')][_0xf708('0x2e')]){_0x11cde7[_0xf708('0x46')]=_[_0xf708('0x49')](_0x11cde7[_0xf708('0x46')],{'$or':_['map'](_0x11cde7['attributes'],function(_0x31793d){var _0x12a6e5={};_0x12a6e5[_0x31793d]={'$like':'%'+_0x56ee44[_0xf708('0x3d')][_0xf708('0x2e')]+'%'};return _0x12a6e5;})});}_0x11cde7=_[_0xf708('0x49')]({},_0x11cde7,_0x56ee44[_0xf708('0x4b')]);return _0x18921c[_0xf708('0xb3')](_0x11cde7);}})[_0xf708('0x27')](function(_0x18f3a4){if(_0x18f3a4){_0x38544d=_0x18f3a4[_0xf708('0x5a')];if(!_0x56ee44['query'][_0xf708('0x42')](_0xf708('0x43'))){_0x11cde7[_0xf708('0x22')]=qs[_0xf708('0x22')](_0x56ee44[_0xf708('0x3d')][_0xf708('0x22')]);_0x11cde7[_0xf708('0x20')]=qs['offset'](_0x56ee44[_0xf708('0x3d')][_0xf708('0x20')]);}return _0x18921c[_0xf708('0xb3')](_0x11cde7);}})[_0xf708('0x27')](function(_0x264e49){if(_0x264e49){return _0x264e49?{'count':_0x38544d,'rows':_0x264e49}:null;}})[_0xf708('0x27')](respondWithResult(_0x42fcab,null))[_0xf708('0x51')](handleError(_0x42fcab,null));};exports[_0xf708('0xb4')]=function(_0x138666,_0x71ce65,_0xc3861f){var _0x48f6e1,_0x19d04d;return db[_0xf708('0x3a')]['find']({'where':{'id':_0x138666[_0xf708('0x5f')]['id']}})['then'](handleEntityNotFound(_0x71ce65,null))[_0xf708('0x27')](function(_0x2c37d1){if(_0x2c37d1){_0x19d04d=_0x2c37d1;return _0x2c37d1[_0xf708('0xb4')](_0x138666[_0xf708('0x53')]['ids'],_[_0xf708('0x5b')](_0x138666['body'],['ids','id'])||{});}return null;})['spread'](function(_0x173fd7){var _0x49cb13;_0x48f6e1=_0x173fd7||[];var _0x50b73c=[];if(_0x173fd7){for(var _0x29ff22=0x0;_0x29ff22<_0x173fd7['length'];_0x29ff22+=0x1){var _0x51f48a=_0x173fd7[_0x29ff22][_0xf708('0x29')]({'plain':!![]});_0x49cb13=squel[_0xf708('0xa0')]()[_0xf708('0xa1')](_0xf708('0xb5'))['fromQuery']([_0xf708('0xa4'),'ContactId',_0xf708('0xa8'),_0xf708('0x62'),_0xf708('0x5c'),_0xf708('0x5d')],squel[_0xf708('0x7e')]()['field'](_0xf708('0xa4'),_0xf708('0xa4'))['field']('id',_0xf708('0xa6'))[_0xf708('0x7f')](_0x51f48a['CmListId'][_0xf708('0x8a')](),_0xf708('0xa8'))[_0xf708('0x7f')](_0x138666[_0xf708('0x5f')]['id'][_0xf708('0x8a')](),_0xf708('0x62'))['field'](_0xf708('0xa9'),'createdAt')['field']('NOW()',_0xf708('0x5d'))['from'](_0xf708('0xaa'))[_0xf708('0x46')]('deletedAt\x20IS\x20NULL')[_0xf708('0x46')](_0xf708('0xac'),_0x51f48a[_0xf708('0xa7')][_0xf708('0x8a')]())['where'](_0xf708('0xad')))['toString']();_0x50b73c['push'](db['sequelize'][_0xf708('0x3d')](_0x49cb13));}return BPromise[_0xf708('0x8d')](_0x50b73c);}})[_0xf708('0x27')](function(){return _0x48f6e1;})[_0xf708('0x27')](respondWithResult(_0x71ce65,null))[_0xf708('0x51')](handleError(_0x71ce65,null));};exports[_0xf708('0xb6')]=function(_0x4e9a48,_0x5afd64,_0x39ea28){return db[_0xf708('0x3a')][_0xf708('0x34')]({'where':{'id':_0x4e9a48[_0xf708('0x5f')]['id']}})[_0xf708('0x27')](handleEntityNotFound(_0x5afd64,null))[_0xf708('0x27')](function(_0x5aa934){if(_0x5aa934){return _0x5aa934[_0xf708('0xb6')](_0x4e9a48[_0xf708('0x3d')]['ids']);}})[_0xf708('0x27')](function(_0x47388b){if(_0x47388b){return db[_0xf708('0x65')][_0xf708('0x28')]({'where':{'ListId':_0x4e9a48[_0xf708('0x3d')]['ids'],'VoiceQueueId':_0x4e9a48['params']['id']}})[_0xf708('0x27')](function(){return _0x47388b;});}})['then'](respondWithStatusCode(_0x5afd64,null))[_0xf708('0x51')](handleError(_0x5afd64,null));}; \ No newline at end of file +var _0x0deb=['filter','ignore','map','value','type','find','UserProfileResource','sendStatus','error','name','send','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','user','get','role','inbound','QueueCampaigns','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','VoiceQueues','outbound','UserProfileSection','userProfileId','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','Team','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','transaction','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','User','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','into','fromQuery','ContactId','ListId','phone','scheduledAt','CmListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','cm_hopper','removeLists','getBlackLists','addBlackLists','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','apply','save','update','then','destroy'];(function(_0x1aad5f,_0x2e9bb9){var _0x38d8c3=function(_0x58982e){while(--_0x58982e){_0x1aad5f['push'](_0x1aad5f['shift']());}};_0x38d8c3(++_0x2e9bb9);}(_0x0deb,0x13e));var _0xb0de=function(_0x58108e,_0x201735){_0x58108e=_0x58108e-0x0;var _0x16cbc5=_0x0deb[_0x58108e];return _0x16cbc5;};'use strict';var emlformat=require(_0xb0de('0x0'));var rimraf=require(_0xb0de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb0de('0x2'));var rp=require('request-promise');var moment=require(_0xb0de('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb0de('0x4'));var util=require('util');var path=require(_0xb0de('0x5'));var sox=require(_0xb0de('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0de('0x7'));var _=require(_0xb0de('0x8'));var squel=require(_0xb0de('0x9'));var crypto=require(_0xb0de('0xa'));var jsforce=require(_0xb0de('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb0de('0xc'));var querystring=require(_0xb0de('0xd'));var Papa=require('papaparse');var Redis=require(_0xb0de('0xe'));var authService=require(_0xb0de('0xf'));var qs=require(_0xb0de('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0de('0x11'));var logger=require(_0xb0de('0x12'))(_0xb0de('0x13'));var utils=require(_0xb0de('0x14'));var config=require(_0xb0de('0x15'));var licenseUtil=require(_0xb0de('0x16'));var db=require(_0xb0de('0x17'))['db'];config[_0xb0de('0x18')]=_['defaults'](config[_0xb0de('0x18')],{'host':_0xb0de('0x19'),'port':0x18eb});var socket=require(_0xb0de('0x1a'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0xb0de('0x1b')](socket);function respondWithStatusCode(_0x2bb4d9,_0x203273){_0x203273=_0x203273||0xcc;return function(_0x2dae41){if(_0x2dae41){return _0x2bb4d9['sendStatus'](_0x203273);}return _0x2bb4d9[_0xb0de('0x1c')](_0x203273)['end']();};}function respondWithResult(_0x5c3bff,_0x4e7910){_0x4e7910=_0x4e7910||0xc8;return function(_0x3c4b21){if(_0x3c4b21){return _0x5c3bff[_0xb0de('0x1c')](_0x4e7910)['json'](_0x3c4b21);}};}function respondWithFilteredResult(_0x42f00f,_0xe511ef){return function(_0x448b21){if(_0x448b21){var _0x817d26=typeof _0xe511ef[_0xb0de('0x1d')]===_0xb0de('0x1e')&&typeof _0xe511ef[_0xb0de('0x1f')]===_0xb0de('0x1e');var _0x25e7ab=_0x448b21[_0xb0de('0x20')];var _0x4b5b09=_0x817d26?0x0:_0xe511ef['offset'];var _0x671b33=_0x817d26?_0x448b21[_0xb0de('0x20')]:_0xe511ef[_0xb0de('0x1d')]+_0xe511ef[_0xb0de('0x1f')];var _0x598d01;if(_0x671b33>=_0x25e7ab){_0x671b33=_0x25e7ab;_0x598d01=0xc8;}else{_0x598d01=0xce;}_0x42f00f[_0xb0de('0x1c')](_0x598d01);return _0x42f00f['set']('Content-Range',_0x4b5b09+'-'+_0x671b33+'/'+_0x25e7ab)['json'](_0x448b21);}return null;};}function patchUpdates(_0xcbdf87){return function(_0x216b64){try{jsonpatch[_0xb0de('0x21')](_0x216b64,_0xcbdf87,!![]);}catch(_0xe81db6){return BPromise['reject'](_0xe81db6);}return _0x216b64[_0xb0de('0x22')]();};}function saveUpdates(_0x2f3a00,_0x789c05){return function(_0x1bf424){if(_0x1bf424){return _0x1bf424[_0xb0de('0x23')](_0x2f3a00)[_0xb0de('0x24')](function(_0xbb40a0){return _0xbb40a0;});}return null;};}function removeEntity(_0x1b6c3f,_0x3bf9c9){return function(_0x2bf867){if(_0x2bf867){return _0x2bf867[_0xb0de('0x25')]()[_0xb0de('0x24')](function(){var _0x54fbbb=_0x2bf867['get']({'plain':!![]});var _0x21cbaf=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x30b524=_(_0x21cbaf)[_0xb0de('0x26')](_0xb0de('0x27'))[_0xb0de('0x28')](_0xb0de('0x29'))[_0xb0de('0x29')]();if(_['includes'](_0x30b524,_0x54fbbb[_0xb0de('0x2a')])){return;}var _0x46b1a1=_[_0xb0de('0x2b')](_0x21cbaf,[_0xb0de('0x29'),_0x54fbbb['type']])['name'];return db[_0xb0de('0x2c')][_0xb0de('0x25')]({'where':{'type':_0x46b1a1,'resourceId':_0x54fbbb['id']}})[_0xb0de('0x24')](function(){return _0x2bf867;});})['then'](function(){_0x1b6c3f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd84f4,_0x439837){return function(_0x349f52){if(!_0x349f52){_0xd84f4[_0xb0de('0x2d')](0x194);}return _0x349f52;};}function handleError(_0x59e8ae,_0x47b436){_0x47b436=_0x47b436||0x1f4;return function(_0x3e7b4f){logger[_0xb0de('0x2e')](_0x3e7b4f['stack']);if(_0x3e7b4f['name']){delete _0x3e7b4f[_0xb0de('0x2f')];}_0x59e8ae['status'](_0x47b436)[_0xb0de('0x30')](_0x3e7b4f);};}exports['index']=function(_0x556601,_0x4ece56){var _0x2ec2b7={},_0x808023={},_0x281405={'count':0x0,'rows':[]};var _0x2a495b=_[_0xb0de('0x28')](db[_0xb0de('0x31')][_0xb0de('0x32')],function(_0x21e3bb){return{'name':_0x21e3bb[_0xb0de('0x33')],'type':_0x21e3bb['type'][_0xb0de('0x34')]};});_0x808023[_0xb0de('0x35')]=_[_0xb0de('0x28')](_0x2a495b,_0xb0de('0x2f'));_0x808023[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0x556601[_0xb0de('0x36')]);_0x808023[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x808023['model'],_0x808023['query']);_0x2ec2b7[_0xb0de('0x3a')]=_['intersection'](_0x808023[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x556601[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x2ec2b7[_0xb0de('0x3a')]=_0x2ec2b7[_0xb0de('0x3a')][_0xb0de('0x3c')]?_0x2ec2b7['attributes']:_0x808023[_0xb0de('0x35')];if(!_0x556601['query']['hasOwnProperty'](_0xb0de('0x3d'))){_0x2ec2b7['limit']=qs['limit'](_0x556601[_0xb0de('0x36')]['limit']);_0x2ec2b7[_0xb0de('0x1d')]=qs[_0xb0de('0x1d')](_0x556601[_0xb0de('0x36')][_0xb0de('0x1d')]);}_0x2ec2b7[_0xb0de('0x3e')]=qs[_0xb0de('0x3f')](_0x556601[_0xb0de('0x36')]['sort']);_0x2ec2b7[_0xb0de('0x40')]=qs[_0xb0de('0x38')](_[_0xb0de('0x41')](_0x556601[_0xb0de('0x36')],_0x808023[_0xb0de('0x38')]),_0x2a495b);if(_0x556601[_0xb0de('0x36')][_0xb0de('0x26')]){_0x2ec2b7['where']=_['merge'](_0x2ec2b7[_0xb0de('0x40')],{'$or':_['map'](_0x2a495b,function(_0x4a7d41){if(_0x4a7d41['type']!==_0xb0de('0x42')){var _0x26a6e3={};_0x26a6e3[_0x4a7d41['name']]={'$like':'%'+_0x556601[_0xb0de('0x36')]['filter']+'%'};return _0x26a6e3;}})});}_0x2ec2b7=_[_0xb0de('0x43')]({},_0x2ec2b7,_0x556601[_0xb0de('0x44')]);var _0x513d25={'where':_0x2ec2b7[_0xb0de('0x40')]};return db['VoiceQueue']['count'](_0x513d25)[_0xb0de('0x24')](function(_0x11a495){_0x281405['count']=_0x11a495;if(_0x556601[_0xb0de('0x36')][_0xb0de('0x45')]){_0x2ec2b7[_0xb0de('0x46')]=[{'all':!![]}];}return db[_0xb0de('0x31')][_0xb0de('0x47')](_0x2ec2b7);})[_0xb0de('0x24')](function(_0xf4741b){_0x281405[_0xb0de('0x48')]=_0xf4741b;return _0x281405;})[_0xb0de('0x24')](respondWithFilteredResult(_0x4ece56,_0x2ec2b7))[_0xb0de('0x49')](handleError(_0x4ece56,null));};exports['show']=function(_0x5371c6,_0x2e4472){var _0x11dc5a={'raw':![],'where':{'id':_0x5371c6[_0xb0de('0x4a')]['id']}},_0x35fe02={};_0x35fe02['model']=_[_0xb0de('0x37')](db[_0xb0de('0x31')][_0xb0de('0x32')]);_0x35fe02['query']=_[_0xb0de('0x37')](_0x5371c6[_0xb0de('0x36')]);_0x35fe02[_0xb0de('0x38')]=_['intersection'](_0x35fe02[_0xb0de('0x35')],_0x35fe02[_0xb0de('0x36')]);_0x11dc5a[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x35fe02[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x5371c6[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x11dc5a[_0xb0de('0x3a')]=_0x11dc5a['attributes']['length']?_0x11dc5a['attributes']:_0x35fe02[_0xb0de('0x35')];if(_0x5371c6[_0xb0de('0x36')][_0xb0de('0x45')]){_0x11dc5a[_0xb0de('0x46')]=[{'all':!![]}];}_0x11dc5a=_[_0xb0de('0x43')]({},_0x11dc5a,_0x5371c6[_0xb0de('0x44')]);return db['VoiceQueue'][_0xb0de('0x2b')](_0x11dc5a)[_0xb0de('0x24')](handleEntityNotFound(_0x2e4472,null))[_0xb0de('0x24')](respondWithResult(_0x2e4472,null))['catch'](handleError(_0x2e4472,null));};exports[_0xb0de('0x4b')]=function(_0x440ec0,_0x4af282){return db['VoiceQueue'][_0xb0de('0x4b')](_0x440ec0[_0xb0de('0x4c')],{})['then'](function(_0x3a922d){var _0x354781=_0x440ec0[_0xb0de('0x4d')][_0xb0de('0x4e')]({'plain':!![]});if(!_0x354781)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x354781[_0xb0de('0x4f')]===_0xb0de('0x4d')){var _0x388241=_0x3a922d['get']({'plain':!![]});var _0x920e81=[{'name':'VoiceQueues','value':_0xb0de('0x50')},{'name':_0xb0de('0x51'),'value':'outbound'}];var _0x152ac6=_['find'](_0x920e81,[_0xb0de('0x29'),_0x388241[_0xb0de('0x2a')]])[_0xb0de('0x2f')];return db['UserProfileSection']['find']({'where':{'name':_0x152ac6,'userProfileId':_0x354781['userProfileId']},'raw':!![]})[_0xb0de('0x24')](function(_0x2e0cac){if(_0x2e0cac&&_0x2e0cac[_0xb0de('0x52')]===0x0){return db['UserProfileResource'][_0xb0de('0x4b')]({'name':_0x388241[_0xb0de('0x2f')],'resourceId':_0x388241['id'],'type':_0x2e0cac[_0xb0de('0x2f')],'sectionId':_0x2e0cac['id']},{})[_0xb0de('0x24')](function(){return _0x3a922d;});}else{return _0x3a922d;}})['catch'](function(_0x194831){logger[_0xb0de('0x2e')](_0xb0de('0x53'),_0x194831);throw _0x194831;});}return _0x3a922d;})[_0xb0de('0x24')](respondWithResult(_0x4af282,0xc9))['catch'](handleError(_0x4af282,null));};exports[_0xb0de('0x54')]=function(_0x5d8942,_0x15882d){var _0x13d2e4={'where':{'id':_0x5d8942['params']['id']}},_0x41af7e={};_0x41af7e[_0xb0de('0x35')]=_[_0xb0de('0x37')](db[_0xb0de('0x31')]['rawAttributes']);_0x13d2e4[_0xb0de('0x3a')]=_['intersection'](_0x41af7e[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x5d8942[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x13d2e4[_0xb0de('0x3a')]=_0x13d2e4[_0xb0de('0x3a')]['length']?_0x13d2e4[_0xb0de('0x3a')]:_0x41af7e[_0xb0de('0x35')];if(_0x5d8942[_0xb0de('0x36')][_0xb0de('0x45')]){_0x13d2e4[_0xb0de('0x46')]=[{'all':!![]}];}_0x13d2e4=_[_0xb0de('0x43')]({},_0x13d2e4,_0x5d8942[_0xb0de('0x44')]);return db['VoiceQueue']['find'](_0x13d2e4)[_0xb0de('0x24')](handleEntityNotFound(_0x15882d,null))['then'](function(_0x12d570){if(_0x12d570){var _0x372b4d=_0x12d570[_0xb0de('0x4e')]({'plain':!![]});_0x372b4d=qs[_0xb0de('0x55')](_0x372b4d,['id',_0xb0de('0x56'),_0xb0de('0x57')]);_0x5d8942['body']=_[_0xb0de('0x55')](_0x5d8942['body'],['id',_0xb0de('0x56'),_0xb0de('0x57')]);return db[_0xb0de('0x31')]['create'](_[_0xb0de('0x43')](_0x372b4d,_0x5d8942['body']),{'include':_0x5d8942[_0xb0de('0x36')][_0xb0de('0x45')]?[{'all':!![]}]:undefined})[_0xb0de('0x24')](function(_0x4ed341){var _0x4f5084=_0x5d8942[_0xb0de('0x4d')][_0xb0de('0x4e')]({'plain':!![]});if(!_0x4f5084)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f5084[_0xb0de('0x4f')]===_0xb0de('0x4d')){var _0x4fdfe4=_0x4ed341[_0xb0de('0x4e')]({'plain':!![]});var _0x3c697e=[{'name':_0xb0de('0x58'),'value':_0xb0de('0x50')},{'name':_0xb0de('0x51'),'value':_0xb0de('0x59')}];var _0x2ac473=_['find'](_0x3c697e,[_0xb0de('0x29'),_0x4fdfe4[_0xb0de('0x2a')]])[_0xb0de('0x2f')];return db[_0xb0de('0x5a')][_0xb0de('0x2b')]({'where':{'name':_0x2ac473,'userProfileId':_0x4f5084[_0xb0de('0x5b')]},'raw':!![]})[_0xb0de('0x24')](function(_0x150cf6){if(_0x150cf6&&_0x150cf6[_0xb0de('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x4fdfe4[_0xb0de('0x2f')],'resourceId':_0x4fdfe4['id'],'type':_0x150cf6[_0xb0de('0x2f')],'sectionId':_0x150cf6['id']},{})[_0xb0de('0x24')](function(){return _0x4ed341;});}else{return _0x4ed341;}})[_0xb0de('0x49')](function(_0x2bc8db){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bc8db);throw _0x2bc8db;});}return _0x4ed341;});}})[_0xb0de('0x24')](respondWithResult(_0x15882d,0xc9))[_0xb0de('0x49')](handleError(_0x15882d,null));};exports[_0xb0de('0x23')]=function(_0x39376e,_0x4faac5){if(_0x39376e[_0xb0de('0x4c')]['id']){delete _0x39376e[_0xb0de('0x4c')]['id'];}return db[_0xb0de('0x31')][_0xb0de('0x2b')]({'where':{'id':_0x39376e[_0xb0de('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4faac5,null))[_0xb0de('0x24')](saveUpdates(_0x39376e['body'],null))[_0xb0de('0x24')](respondWithResult(_0x4faac5,null))[_0xb0de('0x49')](handleError(_0x4faac5,null));};exports[_0xb0de('0x25')]=function(_0xbe6a1e,_0x167fd3){return db[_0xb0de('0x31')][_0xb0de('0x2b')]({'where':{'id':_0xbe6a1e[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x167fd3,null))[_0xb0de('0x24')](removeEntity(_0x167fd3,null))[_0xb0de('0x49')](handleError(_0x167fd3,null));};exports[_0xb0de('0x5c')]=function(_0x2218e5,_0x451863,_0x22ce23){var _0x34b640={'raw':![],'where':{}};var _0x3487a1={};var _0x5c1b44={'count':0x0,'rows':[]};return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x2218e5[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x451863,null))[_0xb0de('0x24')](function(_0x3b905f){if(_0x3b905f){_0x3487a1[_0xb0de('0x35')]=_['keys'](db[_0xb0de('0x5e')][_0xb0de('0x32')]);_0x3487a1[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0x2218e5[_0xb0de('0x36')]);_0x3487a1[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x3487a1[_0xb0de('0x35')],_0x3487a1[_0xb0de('0x36')]);_0x34b640[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x3487a1[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x2218e5[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x34b640['attributes']=_0x34b640[_0xb0de('0x3a')]['length']?_0x34b640[_0xb0de('0x3a')]:_0x3487a1[_0xb0de('0x35')];if(!_0x2218e5[_0xb0de('0x36')][_0xb0de('0x5f')]('nolimit')){_0x34b640[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0x2218e5[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x34b640[_0xb0de('0x1d')]=qs[_0xb0de('0x1d')](_0x2218e5[_0xb0de('0x36')]['offset']);}_0x34b640['order']=qs[_0xb0de('0x3f')](_0x2218e5[_0xb0de('0x36')][_0xb0de('0x3f')]);_0x34b640['where']=qs[_0xb0de('0x38')](_['pick'](_0x2218e5[_0xb0de('0x36')],_0x3487a1['filters']));_0x34b640[_0xb0de('0x40')][_0xb0de('0x60')]=_0x3b905f['id'];if(_0x2218e5[_0xb0de('0x36')][_0xb0de('0x26')]){_0x34b640[_0xb0de('0x40')]=_[_0xb0de('0x43')](_0x34b640[_0xb0de('0x40')],{'$or':_[_0xb0de('0x28')](_0x34b640['attributes'],function(_0x14899c){var _0x343c20={};_0x343c20[_0x14899c]={'$like':'%'+_0x2218e5[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0x343c20;})});}_0x34b640=_['merge']({},_0x34b640,_0x2218e5[_0xb0de('0x44')]);return db['CmHopper'][_0xb0de('0x20')]({'where':_0x34b640[_0xb0de('0x40')]})['then'](function(_0x5b54f3){_0x5c1b44['count']=_0x5b54f3;if(_0x2218e5[_0xb0de('0x36')]['includeAll']){_0x34b640[_0xb0de('0x46')]=[{'all':!![]}];}return db[_0xb0de('0x5e')][_0xb0de('0x47')](_0x34b640);})[_0xb0de('0x24')](function(_0xb4ea9c){_0x5c1b44[_0xb0de('0x48')]=_0xb4ea9c;return _0x5c1b44;});}})[_0xb0de('0x24')](respondWithFilteredResult(_0x451863,_0x34b640))['catch'](handleError(_0x451863,null));};exports[_0xb0de('0x61')]=function(_0xc6f9df,_0x248bf7,_0x59268e){var _0x5e9650={'raw':!![],'where':{}};var _0x493645={};var _0x38abd7={'count':0x0,'rows':[]};return db[_0xb0de('0x31')]['findOne']({'where':{'id':_0xc6f9df[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x248bf7,null))[_0xb0de('0x24')](function(_0x2a4deb){if(_0x2a4deb){_0x493645[_0xb0de('0x35')]=_[_0xb0de('0x37')](db[_0xb0de('0x62')][_0xb0de('0x32')]);_0x493645[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0xc6f9df[_0xb0de('0x36')]);_0x493645[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x493645['model'],_0x493645[_0xb0de('0x36')]);_0x5e9650[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x493645[_0xb0de('0x35')],qs['fields'](_0xc6f9df[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x5e9650[_0xb0de('0x3a')]=_0x5e9650[_0xb0de('0x3a')][_0xb0de('0x3c')]?_0x5e9650[_0xb0de('0x3a')]:_0x493645[_0xb0de('0x35')];if(!_0xc6f9df[_0xb0de('0x36')][_0xb0de('0x5f')](_0xb0de('0x3d'))){_0x5e9650[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0xc6f9df[_0xb0de('0x36')]['limit']);_0x5e9650[_0xb0de('0x1d')]=qs['offset'](_0xc6f9df[_0xb0de('0x36')][_0xb0de('0x1d')]);}_0x5e9650[_0xb0de('0x3e')]=qs[_0xb0de('0x3f')](_0xc6f9df[_0xb0de('0x36')][_0xb0de('0x3f')]);_0x5e9650[_0xb0de('0x40')]=qs[_0xb0de('0x38')](_[_0xb0de('0x41')](_0xc6f9df[_0xb0de('0x36')],_0x493645[_0xb0de('0x38')]));_0x5e9650[_0xb0de('0x40')][_0xb0de('0x60')]=_0x2a4deb['id'];if(_0xc6f9df['query']['filter']){_0x5e9650['where']=_[_0xb0de('0x43')](_0x5e9650[_0xb0de('0x40')],{'$or':_['map'](_0x5e9650[_0xb0de('0x3a')],function(_0x480b2b){var _0x1b922a={};_0x1b922a[_0x480b2b]={'$like':'%'+_0xc6f9df[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0x1b922a;})});}_0x5e9650=_[_0xb0de('0x43')]({},_0x5e9650,_0xc6f9df[_0xb0de('0x44')]);return db[_0xb0de('0x62')][_0xb0de('0x20')]({'where':_0x5e9650[_0xb0de('0x40')]})[_0xb0de('0x24')](function(_0x15505d){_0x38abd7['count']=_0x15505d;if(_0xc6f9df[_0xb0de('0x36')]['includeAll']){_0x5e9650['include']=[{'all':!![]}];}return db[_0xb0de('0x62')][_0xb0de('0x47')](_0x5e9650);})[_0xb0de('0x24')](function(_0x2aae75){_0x38abd7['rows']=_0x2aae75;return _0x38abd7;});}})[_0xb0de('0x24')](respondWithFilteredResult(_0x248bf7,_0x5e9650))[_0xb0de('0x49')](handleError(_0x248bf7,null));};exports[_0xb0de('0x63')]=function(_0x48682b,_0x4cbc61,_0x5dafa8){var _0x141560={'raw':!![],'where':{}};var _0x4346c1={};var _0x3a44b8={'count':0x0,'rows':[]};return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x48682b['params']['id']}})['then'](handleEntityNotFound(_0x4cbc61,null))[_0xb0de('0x24')](function(_0x9e0d11){if(_0x9e0d11){_0x4346c1[_0xb0de('0x35')]=_[_0xb0de('0x37')](db[_0xb0de('0x64')][_0xb0de('0x32')]);_0x4346c1[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0x48682b[_0xb0de('0x36')]);_0x4346c1[_0xb0de('0x38')]=_['intersection'](_0x4346c1['model'],_0x4346c1['query']);_0x141560[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x4346c1[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x48682b[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x141560['attributes']=_0x141560[_0xb0de('0x3a')]['length']?_0x141560[_0xb0de('0x3a')]:_0x4346c1['model'];if(!_0x48682b[_0xb0de('0x36')][_0xb0de('0x5f')](_0xb0de('0x3d'))){_0x141560[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0x48682b['query']['limit']);_0x141560[_0xb0de('0x1d')]=qs['offset'](_0x48682b[_0xb0de('0x36')][_0xb0de('0x1d')]);}_0x141560[_0xb0de('0x3e')]=qs[_0xb0de('0x3f')](_0x48682b['query'][_0xb0de('0x3f')]);_0x141560[_0xb0de('0x40')]=qs['filters'](_[_0xb0de('0x41')](_0x48682b['query'],_0x4346c1[_0xb0de('0x38')]));_0x141560[_0xb0de('0x40')][_0xb0de('0x60')]=_0x9e0d11['id'];if(_0x48682b[_0xb0de('0x36')]['filter']){_0x141560[_0xb0de('0x40')]=_[_0xb0de('0x43')](_0x141560['where'],{'$or':_[_0xb0de('0x28')](_0x141560[_0xb0de('0x3a')],function(_0x258727){var _0x26f277={};_0x26f277[_0x258727]={'$like':'%'+_0x48682b['query'][_0xb0de('0x26')]+'%'};return _0x26f277;})});}_0x141560=_[_0xb0de('0x43')]({},_0x141560,_0x48682b['options']);return db[_0xb0de('0x64')][_0xb0de('0x20')]({'where':_0x141560[_0xb0de('0x40')]})['then'](function(_0x5749e5){_0x3a44b8['count']=_0x5749e5;if(_0x48682b['query'][_0xb0de('0x45')]){_0x141560[_0xb0de('0x46')]=[{'all':!![]}];}return db[_0xb0de('0x64')][_0xb0de('0x47')](_0x141560);})['then'](function(_0x4bc30a){_0x3a44b8['rows']=_0x4bc30a;return _0x3a44b8;});}})['then'](respondWithFilteredResult(_0x4cbc61,_0x141560))['catch'](handleError(_0x4cbc61,null));};exports[_0xb0de('0x65')]=function(_0x2a6f00,_0xbf92d1,_0x554606){var _0x175105={'raw':!![],'where':{}};var _0x6363f1={};var _0x25b428={'count':0x0,'rows':[]};return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x2a6f00[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0xbf92d1,null))[_0xb0de('0x24')](function(_0x36c0ee){if(_0x36c0ee){_0x6363f1[_0xb0de('0x35')]=_['keys'](db[_0xb0de('0x66')][_0xb0de('0x32')]);_0x6363f1[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0x2a6f00[_0xb0de('0x36')]);_0x6363f1[_0xb0de('0x38')]=_['intersection'](_0x6363f1[_0xb0de('0x35')],_0x6363f1[_0xb0de('0x36')]);_0x175105[_0xb0de('0x3a')]=_['intersection'](_0x6363f1['model'],qs['fields'](_0x2a6f00['query']['fields']));_0x175105['attributes']=_0x175105['attributes'][_0xb0de('0x3c')]?_0x175105[_0xb0de('0x3a')]:_0x6363f1['model'];if(!_0x2a6f00[_0xb0de('0x36')]['hasOwnProperty'](_0xb0de('0x3d'))){_0x175105[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0x2a6f00[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x175105[_0xb0de('0x1d')]=qs[_0xb0de('0x1d')](_0x2a6f00['query']['offset']);}_0x175105[_0xb0de('0x3e')]=qs['sort'](_0x2a6f00[_0xb0de('0x36')]['sort']);_0x175105[_0xb0de('0x40')]=qs[_0xb0de('0x38')](_['pick'](_0x2a6f00[_0xb0de('0x36')],_0x6363f1[_0xb0de('0x38')]));_0x175105[_0xb0de('0x40')]['VoiceQueueId']=_0x36c0ee['id'];if(_0x2a6f00[_0xb0de('0x36')][_0xb0de('0x26')]){_0x175105[_0xb0de('0x40')]=_['merge'](_0x175105[_0xb0de('0x40')],{'$or':_[_0xb0de('0x28')](_0x175105['attributes'],function(_0x5a3585){var _0xebdea0={};_0xebdea0[_0x5a3585]={'$like':'%'+_0x2a6f00[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0xebdea0;})});}_0x175105=_[_0xb0de('0x43')]({},_0x175105,_0x2a6f00['options']);return db[_0xb0de('0x66')][_0xb0de('0x20')]({'where':_0x175105[_0xb0de('0x40')]})[_0xb0de('0x24')](function(_0x120433){_0x25b428[_0xb0de('0x20')]=_0x120433;if(_0x2a6f00[_0xb0de('0x36')]['includeAll']){_0x175105['include']=[{'all':!![]}];}return db[_0xb0de('0x66')][_0xb0de('0x47')](_0x175105);})[_0xb0de('0x24')](function(_0x1fed4d){_0x25b428[_0xb0de('0x48')]=_0x1fed4d;return _0x25b428;});}})[_0xb0de('0x24')](respondWithFilteredResult(_0xbf92d1,_0x175105))[_0xb0de('0x49')](handleError(_0xbf92d1,null));};exports[_0xb0de('0x67')]=function(_0x1d6ab4,_0x72c2a3,_0x1e8260){var _0x3f6a0d={};var _0x5ca8db={};var _0x44fc6c;var _0x915898;return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x1d6ab4[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x72c2a3,null))['then'](function(_0x5f51c3){if(_0x5f51c3){_0x44fc6c=_0x5f51c3;_0x5ca8db[_0xb0de('0x35')]=_[_0xb0de('0x37')](db['Team']['rawAttributes']);_0x5ca8db[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0x1d6ab4[_0xb0de('0x36')]);_0x5ca8db[_0xb0de('0x38')]=_['intersection'](_0x5ca8db[_0xb0de('0x35')],_0x5ca8db[_0xb0de('0x36')]);_0x3f6a0d[_0xb0de('0x3a')]=_['intersection'](_0x5ca8db[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x1d6ab4[_0xb0de('0x36')]['fields']));_0x3f6a0d[_0xb0de('0x3a')]=_0x3f6a0d[_0xb0de('0x3a')][_0xb0de('0x3c')]?_0x3f6a0d[_0xb0de('0x3a')]:_0x5ca8db['model'];_0x3f6a0d[_0xb0de('0x3e')]=qs['sort'](_0x1d6ab4[_0xb0de('0x36')][_0xb0de('0x3f')]);_0x3f6a0d[_0xb0de('0x40')]=qs[_0xb0de('0x38')](_['pick'](_0x1d6ab4['query'],_0x5ca8db['filters']));if(_0x1d6ab4[_0xb0de('0x36')][_0xb0de('0x26')]){_0x3f6a0d['where']=_[_0xb0de('0x43')](_0x3f6a0d['where'],{'$or':_[_0xb0de('0x28')](_0x3f6a0d[_0xb0de('0x3a')],function(_0x37fdef){var _0x7e60cf={};_0x7e60cf[_0x37fdef]={'$like':'%'+_0x1d6ab4[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0x7e60cf;})});}_0x3f6a0d=_[_0xb0de('0x43')]({},_0x3f6a0d,_0x1d6ab4[_0xb0de('0x44')]);return _0x44fc6c['getTeams'](_0x3f6a0d);}})[_0xb0de('0x24')](function(_0x46c9de){if(_0x46c9de){_0x915898=_0x46c9de[_0xb0de('0x3c')];if(!_0x1d6ab4[_0xb0de('0x36')]['hasOwnProperty']('nolimit')){_0x3f6a0d[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0x1d6ab4[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x3f6a0d[_0xb0de('0x1d')]=qs['offset'](_0x1d6ab4[_0xb0de('0x36')][_0xb0de('0x1d')]);}return _0x44fc6c[_0xb0de('0x67')](_0x3f6a0d);}})[_0xb0de('0x24')](function(_0x52eb40){if(_0x52eb40){return _0x52eb40?{'count':_0x915898,'rows':_0x52eb40}:null;}})[_0xb0de('0x24')](respondWithResult(_0x72c2a3,null))[_0xb0de('0x49')](handleError(_0x72c2a3,null));};exports['addTeams']=function(_0x3e38a0,_0x351fdb,_0x306a18){var _0x3016bf=_0x3e38a0[_0xb0de('0x4c')][_0xb0de('0x68')];var _0x167e77=_['map'](_0x3016bf,'id');return db['Team']['findAll']({'where':{'id':_0x167e77},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb0de('0x69'),'attributes':['id',_0xb0de('0x2f'),_0xb0de('0x6a'),_0xb0de('0x6b'),'interface'],'raw':!![]}]})[_0xb0de('0x24')](function(_0x2d94f5){if(_0x2d94f5){var _0x128945=_[_0xb0de('0x6c')](_0x2d94f5,function(_0x8e0333){var _0x14bbb5=_0x8e0333[_0xb0de('0x4e')]({'plain':!![]});_0x14bbb5['Agents'][_0xb0de('0x6d')](function(_0x2ac999){_0x2ac999[_0xb0de('0x6e')]=_[_0xb0de('0x2b')](_0x3016bf,{'id':_0x14bbb5['id']})[_0xb0de('0x6e')];});return _0x14bbb5[_0xb0de('0x69')];});return db[_0xb0de('0x31')][_0xb0de('0x2b')]({'where':{'id':_0x3e38a0[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](function(_0x55ecfa){return db[_0xb0de('0x6f')]['transaction'](function(_0x6f57f1){return _0x55ecfa[_0xb0de('0x70')](_0x167e77,{'transaction':_0x6f57f1})[_0xb0de('0x24')](function(){return BPromise[_0xb0de('0x71')](_0x3016bf,function(_0x22cae5){return db['TeamVoiceQueue'][_0xb0de('0x72')]({'TeamId':_0x22cae5['id'],'VoiceQueueId':_0x3e38a0[_0xb0de('0x4a')]['id'],'penalty':_0x22cae5[_0xb0de('0x6e')]},{'transaction':_0x6f57f1});});})[_0xb0de('0x24')](function(){return BPromise[_0xb0de('0x71')](_0x128945,function(_0x446c50){return db[_0xb0de('0x73')][_0xb0de('0x74')]({'where':{'UserId':_0x446c50['id'],'VoiceQueueId':_0x3e38a0[_0xb0de('0x4a')]['id']},'defaults':{'penalty':_0x446c50[_0xb0de('0x6e')]},'transaction':_0x6f57f1});});})['then'](function(){return BPromise[_0xb0de('0x71')](_['filter'](_0x128945,{'online':!![]}),function(_0xf48458){return db[_0xb0de('0x75')]['upsert']({'membername':_0xf48458['name'],'UserId':_0xf48458['id'],'queue_name':_0x55ecfa[_0xb0de('0x2f')],'VoiceQueueId':_0x55ecfa['id'],'interface':_[_0xb0de('0x76')](_0xf48458[_0xb0de('0x77')])?util[_0xb0de('0x78')](_0xb0de('0x79'),_0xf48458[_0xb0de('0x2f')]):_0xf48458[_0xb0de('0x77')],'paused':_0xf48458['voicePause']||![],'penalty':_0xf48458[_0xb0de('0x6e')]},{'transaction':_0x6f57f1});});})[_0xb0de('0x24')](function(){_0x128945[_0xb0de('0x6d')](function(_0x718e3b){socket[_0xb0de('0x7a')](_0xb0de('0x7b'),{'UserId':_0x718e3b['id'],'VoiceQueueId':_0x55ecfa['id']});});});});});}})[_0xb0de('0x24')](respondWithStatusCode(_0x351fdb,null))[_0xb0de('0x49')](handleError(_0x351fdb,null));};exports['removeTeams']=function(_0xe5b373,_0x1957a9,_0x5392f9){return db[_0xb0de('0x7c')][_0xb0de('0x47')]({'where':{'id':_0xe5b373['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb0de('0x69'),'attributes':['id'],'raw':!![]}]})[_0xb0de('0x24')](handleEntityNotFound(_0x1957a9,null))['then'](function(_0x2863a9){var _0xa69370=_[_0xb0de('0x28')](_0x2863a9,'id');var _0x3ab86e=[];var _0x3ff006=[];var _0xe7cab0=squel[_0xb0de('0x7d')]();_0xe7cab0[_0xb0de('0x7e')](_0xb0de('0x7f'))['from'](_0xb0de('0x80'),'tq')[_0xb0de('0x81')](_0xb0de('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb0de('0x40')](_0xb0de('0x83'),_0xe5b373[_0xb0de('0x4a')]['id']);for(var _0x51101c=0x0;_0x51101c<_0x2863a9[_0xb0de('0x3c')];_0x51101c+=0x1){let _0x35ed9e=_0x2863a9[_0x51101c];for(var _0x48ebb8=0x0;_0x48ebb8<_0x35ed9e[_0xb0de('0x69')][_0xb0de('0x3c')];_0x48ebb8+=0x1){let _0x48ef38=_0x35ed9e[_0xb0de('0x69')][_0x48ebb8];var _0x230ed8=_0xe7cab0[_0xb0de('0x54')]();_0x230ed8[_0xb0de('0x40')](_0xb0de('0x84'),_0x48ef38['id']);_0x3ff006[_0xb0de('0x85')](db[_0xb0de('0x6f')][_0xb0de('0x36')](_0x230ed8[_0xb0de('0x86')](),{'type':db[_0xb0de('0x6f')][_0xb0de('0x87')][_0xb0de('0x88')]})[_0xb0de('0x24')](function(_0x53504a){if(_0x53504a[_0xb0de('0x3c')]===0x1){return _0x48ef38['id'];}else{var _0x45a9d6=_[_0xb0de('0x89')](_[_0xb0de('0x28')](_0x53504a,_0xb0de('0x8a')),function(_0x189133){return _['includes'](_0xa69370,_0x189133);});if(_0x45a9d6){return _0x48ef38['id'];}}}));}}return BPromise[_0xb0de('0x8b')](_0x3ff006)[_0xb0de('0x24')](function(_0x223675){_0x3ab86e=_(_0x3ab86e)[_0xb0de('0x8c')](_0x223675)['compact']()[_0xb0de('0x29')]();return db[_0xb0de('0x31')][_0xb0de('0x2b')]({'where':{'id':_0xe5b373['params']['id']}})[_0xb0de('0x24')](function(_0x2f05aa){return db['sequelize'][_0xb0de('0x8d')](function(_0x356fe5){return _0x2f05aa['removeTeams'](_0xe5b373['query'][_0xb0de('0x8e')],{'transaction':_0x356fe5})[_0xb0de('0x24')](function(){if(!_[_0xb0de('0x8f')](_0x3ab86e)){return _0x2f05aa[_0xb0de('0x90')](_0x3ab86e,{'transaction':_0x356fe5})[_0xb0de('0x24')](function(){return db[_0xb0de('0x75')][_0xb0de('0x25')]({'where':{'VoiceQueueId':_0xe5b373[_0xb0de('0x4a')]['id'],'UserId':_0x3ab86e},'transaction':_0x356fe5});});}})['then'](function(){_0x3ab86e[_0xb0de('0x6d')](function(_0x468342){socket['emit'](_0xb0de('0x91'),{'UserId':_0x468342,'VoiceQueueId':_0x2f05aa['id']});});});});});});})[_0xb0de('0x24')](respondWithStatusCode(_0x1957a9,null))[_0xb0de('0x49')](handleError(_0x1957a9,null));};exports['addAgents']=function(_0x1d8c2f,_0x9a5cc7,_0x2a214f){var _0x4c9e15,_0x42b296;return db['VoiceQueue']['find']({'where':{'id':_0x1d8c2f[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x9a5cc7,null))['then'](function(_0x197530){if(_0x197530){_0x42b296=_0x197530;return _0x197530[_0xb0de('0x92')](_0x1d8c2f[_0xb0de('0x4c')][_0xb0de('0x8e')],_['omit'](_0x1d8c2f['body'],[_0xb0de('0x8e'),'id'])||{})[_0xb0de('0x93')](function(_0x41fc85){for(var _0x2d15e8=0x0;_0x2d15e8<_0x1d8c2f[_0xb0de('0x4c')][_0xb0de('0x8e')][_0xb0de('0x3c')];_0x2d15e8+=0x1){socket[_0xb0de('0x7a')]('userVoiceQueue:save',{'UserId':Number(_0x1d8c2f['body'][_0xb0de('0x8e')][_0x2d15e8]),'VoiceQueueId':Number(_0x1d8c2f[_0xb0de('0x4a')]['id'])});}return _0x41fc85;});}})[_0xb0de('0x24')](function(_0x478842){_0x4c9e15=_0x478842||[];if(_0x42b296){return db[_0xb0de('0x94')][_0xb0de('0x47')]({'where':{'id':_0x1d8c2f[_0xb0de('0x4c')][_0xb0de('0x8e')]},'attributes':['id','name',_0xb0de('0x6a'),_0xb0de('0x6b'),_0xb0de('0x77')],'raw':!![]});}})[_0xb0de('0x24')](function(_0xe4165f){if(!_[_0xb0de('0x8f')](_0xe4165f)){var _0x48deb4=[];for(var _0x28e601=0x0;_0x28e601<_0xe4165f['length'];_0x28e601++){if(_0xe4165f[_0x28e601]['online']){_0x48deb4[_0xb0de('0x85')](db[_0xb0de('0x75')][_0xb0de('0x72')]({'membername':_0xe4165f[_0x28e601]['name'],'UserId':_0xe4165f[_0x28e601]['id'],'queue_name':_0x42b296[_0xb0de('0x2f')],'VoiceQueueId':_0x42b296['id'],'interface':_[_0xb0de('0x76')](_0xe4165f[_0x28e601][_0xb0de('0x77')])?util['format']('SIP/%s',_0xe4165f[_0x28e601]['name']):_0xe4165f[_0x28e601]['interface'],'paused':_0xe4165f[_0x28e601][_0xb0de('0x6b')]||![],'penalty':_0x1d8c2f[_0xb0de('0x4c')][_0xb0de('0x6e')]||0x0}));}}return BPromise[_0xb0de('0x8b')](_0x48deb4);}})['then'](function(){return _0x4c9e15;})[_0xb0de('0x24')](respondWithResult(_0x9a5cc7,null))[_0xb0de('0x49')](handleError(_0x9a5cc7,null));};exports[_0xb0de('0x90')]=function(_0x5e7ff6,_0x3251cc,_0x2959e7){return db['VoiceQueue'][_0xb0de('0x2b')]({'where':{'id':_0x5e7ff6[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x3251cc,null))[_0xb0de('0x24')](function(_0x3ad99b){if(_0x3ad99b){return _0x3ad99b[_0xb0de('0x90')](_0x5e7ff6[_0xb0de('0x36')][_0xb0de('0x8e')])[_0xb0de('0x24')](function(){if(_[_0xb0de('0x95')](_0x5e7ff6[_0xb0de('0x36')][_0xb0de('0x8e')])){for(var _0x422447=0x0;_0x422447<_0x5e7ff6[_0xb0de('0x36')][_0xb0de('0x8e')][_0xb0de('0x3c')];_0x422447+=0x1){socket[_0xb0de('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x5e7ff6[_0xb0de('0x36')]['ids'][_0x422447]),'VoiceQueueId':Number(_0x5e7ff6[_0xb0de('0x4a')]['id'])});}}else{socket['emit'](_0xb0de('0x91'),{'UserId':Number(_0x5e7ff6[_0xb0de('0x36')][_0xb0de('0x8e')]),'VoiceQueueId':Number(_0x5e7ff6[_0xb0de('0x4a')]['id'])});}});}})[_0xb0de('0x24')](function(_0x11aaf8){return db[_0xb0de('0x75')]['destroy']({'where':{'VoiceQueueId':_0x5e7ff6[_0xb0de('0x4a')]['id'],'UserId':_0x5e7ff6['query'][_0xb0de('0x8e')]}})[_0xb0de('0x24')](function(){return _0x11aaf8;});})['then'](respondWithStatusCode(_0x3251cc,null))[_0xb0de('0x49')](handleError(_0x3251cc,null));};exports[_0xb0de('0x96')]=function(_0x126277,_0x1c29d3,_0x543b2a){var _0x1354e0={};var _0x21b13c={};var _0x201f82;var _0x24ee3f;return db['VoiceQueue'][_0xb0de('0x5d')]({'where':{'id':_0x126277['params']['id']}})['then'](handleEntityNotFound(_0x1c29d3,null))[_0xb0de('0x24')](function(_0x272f59){if(_0x272f59){_0x201f82=_0x272f59;_0x21b13c[_0xb0de('0x35')]=_[_0xb0de('0x37')](db['User'][_0xb0de('0x32')]);_0x21b13c[_0xb0de('0x36')]=_['keys'](_0x126277[_0xb0de('0x36')]);_0x21b13c[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x21b13c[_0xb0de('0x35')],_0x21b13c[_0xb0de('0x36')]);_0x1354e0[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x21b13c['model'],qs[_0xb0de('0x3b')](_0x126277[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x1354e0[_0xb0de('0x3a')]=_0x1354e0[_0xb0de('0x3a')][_0xb0de('0x3c')]?_0x1354e0[_0xb0de('0x3a')]:_0x21b13c[_0xb0de('0x35')];_0x1354e0[_0xb0de('0x3e')]=qs[_0xb0de('0x3f')](_0x126277[_0xb0de('0x36')]['sort']);_0x1354e0['where']=qs[_0xb0de('0x38')](_[_0xb0de('0x41')](_0x126277[_0xb0de('0x36')],_0x21b13c[_0xb0de('0x38')]));if(_0x126277['query'][_0xb0de('0x26')]){_0x1354e0[_0xb0de('0x40')]=_[_0xb0de('0x43')](_0x1354e0['where'],{'$or':_[_0xb0de('0x28')](_0x1354e0['attributes'],function(_0x4446f3){var _0x42df34={};_0x42df34[_0x4446f3]={'$like':'%'+_0x126277[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0x42df34;})});}_0x1354e0=_[_0xb0de('0x43')]({},_0x1354e0,_0x126277[_0xb0de('0x44')]);return _0x201f82[_0xb0de('0x96')](_0x1354e0);}})['then'](function(_0xcb2212){if(_0xcb2212){_0x24ee3f=_0xcb2212[_0xb0de('0x3c')];if(!_0x126277['query'][_0xb0de('0x5f')](_0xb0de('0x3d'))){_0x1354e0[_0xb0de('0x1f')]=qs['limit'](_0x126277[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x1354e0['offset']=qs['offset'](_0x126277[_0xb0de('0x36')]['offset']);}return _0x201f82['getAgents'](_0x1354e0);}})[_0xb0de('0x24')](function(_0x143cd6){if(_0x143cd6){return _0x143cd6?{'count':_0x24ee3f,'rows':_0x143cd6}:null;}})['then'](respondWithResult(_0x1c29d3,null))[_0xb0de('0x49')](handleError(_0x1c29d3,null));};exports[_0xb0de('0x97')]=function(_0x28a09f,_0x5b4298,_0x39473f){var _0x46130d={};var _0x1e0506={};var _0x3dfb4d;var _0x545c3f;return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x28a09f[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x5b4298,null))[_0xb0de('0x24')](function(_0x49112a){if(_0x49112a){_0x3dfb4d=_0x49112a;_0x1e0506['model']=_['keys'](db[_0xb0de('0x75')][_0xb0de('0x32')]);_0x1e0506[_0xb0de('0x36')]=_['keys'](_0x28a09f['query']);_0x1e0506[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x1e0506[_0xb0de('0x35')],_0x1e0506[_0xb0de('0x36')]);_0x46130d[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x1e0506[_0xb0de('0x35')],qs[_0xb0de('0x3b')](_0x28a09f['query'][_0xb0de('0x3b')]));_0x46130d[_0xb0de('0x3a')]=_0x46130d[_0xb0de('0x3a')][_0xb0de('0x3c')]?_0x46130d['attributes']:_0x1e0506[_0xb0de('0x35')];_0x46130d[_0xb0de('0x3e')]=qs[_0xb0de('0x3f')](_0x28a09f[_0xb0de('0x36')][_0xb0de('0x3f')]);_0x46130d[_0xb0de('0x40')]=qs[_0xb0de('0x38')](_[_0xb0de('0x41')](_0x28a09f['query'],_0x1e0506[_0xb0de('0x38')]));if(_0x28a09f['query'][_0xb0de('0x26')]){_0x46130d[_0xb0de('0x40')]=_[_0xb0de('0x43')](_0x46130d[_0xb0de('0x40')],{'$or':_[_0xb0de('0x28')](_0x46130d[_0xb0de('0x3a')],function(_0x1ac503){var _0x22b45c={};_0x22b45c[_0x1ac503]={'$like':'%'+_0x28a09f[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0x22b45c;})});}_0x46130d=_[_0xb0de('0x43')]({},_0x46130d,_0x28a09f[_0xb0de('0x44')]);return _0x3dfb4d[_0xb0de('0x97')](_0x46130d);}})[_0xb0de('0x24')](function(_0x163a27){if(_0x163a27){_0x545c3f=_0x163a27[_0xb0de('0x3c')];if(!_0x28a09f[_0xb0de('0x36')]['hasOwnProperty'](_0xb0de('0x3d'))){_0x46130d[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0x28a09f[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x46130d[_0xb0de('0x1d')]=qs[_0xb0de('0x1d')](_0x28a09f['query'][_0xb0de('0x1d')]);}return _0x3dfb4d[_0xb0de('0x97')](_0x46130d);}})[_0xb0de('0x24')](function(_0x4b2db9){return _0x4b2db9?{'count':_0x545c3f,'rows':_0x4b2db9}:null;})[_0xb0de('0x24')](respondWithResult(_0x5b4298,null))[_0xb0de('0x49')](handleError(_0x5b4298,null));};exports['getLists']=function(_0x536c1a,_0x427a84,_0x1a9652){var _0x3c34d9={};var _0x1d221b={};var _0xecc0c2;var _0x12291c;return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x536c1a[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x427a84,null))[_0xb0de('0x24')](function(_0x2d0bcb){if(_0x2d0bcb){_0xecc0c2=_0x2d0bcb;_0x1d221b[_0xb0de('0x35')]=_[_0xb0de('0x37')](db[_0xb0de('0x98')][_0xb0de('0x32')]);_0x1d221b[_0xb0de('0x36')]=_['keys'](_0x536c1a[_0xb0de('0x36')]);_0x1d221b[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x1d221b[_0xb0de('0x35')],_0x1d221b[_0xb0de('0x36')]);_0x3c34d9[_0xb0de('0x3a')]=_['intersection'](_0x1d221b['model'],qs[_0xb0de('0x3b')](_0x536c1a[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x3c34d9[_0xb0de('0x3a')]=_0x3c34d9['attributes'][_0xb0de('0x3c')]?_0x3c34d9[_0xb0de('0x3a')]:_0x1d221b[_0xb0de('0x35')];_0x3c34d9[_0xb0de('0x3e')]=qs['sort'](_0x536c1a[_0xb0de('0x36')][_0xb0de('0x3f')]);_0x3c34d9[_0xb0de('0x40')]=qs['filters'](_['pick'](_0x536c1a['query'],_0x1d221b[_0xb0de('0x38')]));if(_0x536c1a[_0xb0de('0x36')][_0xb0de('0x26')]){_0x3c34d9[_0xb0de('0x40')]=_['merge'](_0x3c34d9[_0xb0de('0x40')],{'$or':_[_0xb0de('0x28')](_0x3c34d9['attributes'],function(_0x45aabb){var _0x2bec76={};_0x2bec76[_0x45aabb]={'$like':'%'+_0x536c1a[_0xb0de('0x36')][_0xb0de('0x26')]+'%'};return _0x2bec76;})});}_0x3c34d9=_['merge']({},_0x3c34d9,_0x536c1a[_0xb0de('0x44')]);return _0xecc0c2[_0xb0de('0x99')](_0x3c34d9);}})[_0xb0de('0x24')](function(_0x481289){if(_0x481289){_0x12291c=_0x481289[_0xb0de('0x3c')];if(!_0x536c1a['query'][_0xb0de('0x5f')](_0xb0de('0x3d'))){_0x3c34d9['limit']=qs[_0xb0de('0x1f')](_0x536c1a[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x3c34d9[_0xb0de('0x1d')]=qs['offset'](_0x536c1a['query'][_0xb0de('0x1d')]);}return _0xecc0c2[_0xb0de('0x99')](_0x3c34d9);}})[_0xb0de('0x24')](function(_0x3b2008){if(_0x3b2008){return _0x3b2008?{'count':_0x12291c,'rows':_0x3b2008}:null;}})['then'](respondWithResult(_0x427a84,null))[_0xb0de('0x49')](handleError(_0x427a84,null));};exports[_0xb0de('0x9a')]=function(_0x1d4b9e,_0x442667,_0x4de437){var _0x4d7c52,_0x26debf;return db[_0xb0de('0x31')][_0xb0de('0x2b')]({'where':{'id':_0x1d4b9e[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x442667,null))[_0xb0de('0x24')](function(_0x9eb01b){if(_0x9eb01b){_0x26debf=_0x9eb01b;return _0x9eb01b['addLists'](_0x1d4b9e['body'][_0xb0de('0x8e')],_[_0xb0de('0x55')](_0x1d4b9e[_0xb0de('0x4c')],[_0xb0de('0x8e'),'id'])||{});}return null;})[_0xb0de('0x93')](function(_0x37ff68){var _0x14069d;_0x4d7c52=_0x37ff68||[];var _0x1d42af=[];if(_0x37ff68){for(var _0x216705=0x0;_0x216705<_0x37ff68[_0xb0de('0x3c')];_0x216705+=0x1){var _0x4a75e5=_0x37ff68[_0x216705][_0xb0de('0x4e')]({'plain':!![]});_0x26debf['dialCheckDuplicateType']=_0x1d4b9e[_0xb0de('0x4c')][_0xb0de('0x9b')]?_0x1d4b9e['body']['dialCheckDuplicateType']:_0x26debf[_0xb0de('0x9b')];switch(_0x26debf['dialCheckDuplicateType']){case'always':_0x14069d=squel[_0xb0de('0x9c')]()[_0xb0de('0x9d')]('cm_hopper')[_0xb0de('0x9e')](['phone','scheduledAt',_0xb0de('0x9f'),_0xb0de('0xa0'),_0xb0de('0x60'),_0xb0de('0x56'),_0xb0de('0x57')],squel['select']()[_0xb0de('0x7e')](_0xb0de('0xa1'),_0xb0de('0xa1'))[_0xb0de('0x7e')]('NOW()',_0xb0de('0xa2'))['field']('id',_0xb0de('0x9f'))['field'](_0x4a75e5[_0xb0de('0xa3')][_0xb0de('0x86')](),'ListId')[_0xb0de('0x7e')](_0x1d4b9e['params']['id']['toString'](),_0xb0de('0x60'))[_0xb0de('0x7e')](_0xb0de('0xa4'),_0xb0de('0x56'))['field'](_0xb0de('0xa4'),_0xb0de('0x57'))[_0xb0de('0xa5')](_0xb0de('0xa6'))[_0xb0de('0x40')](_0xb0de('0xa7'))[_0xb0de('0x40')](_0xb0de('0xa8'),_0x4a75e5[_0xb0de('0xa3')][_0xb0de('0x86')]())[_0xb0de('0x40')](_0xb0de('0xa9'))[_0xb0de('0x40')](_0xb0de('0xaa'),squel[_0xb0de('0x7d')]()[_0xb0de('0x7e')](_0xb0de('0xab'))['from'](_0xb0de('0xac'))[_0xb0de('0x40')](_0xb0de('0x83'),_0x1d4b9e[_0xb0de('0x4a')]['id'][_0xb0de('0x86')]()))[_0xb0de('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb0de('0x7d')]()[_0xb0de('0x7e')]('COALESCE(phone,\x27\x27)')[_0xb0de('0xa5')]('cm_hopper')[_0xb0de('0x40')](_0xb0de('0x83'),_0x1d4b9e['params']['id']['toString']())))[_0xb0de('0x86')]();break;case _0xb0de('0xad'):_0x14069d=squel[_0xb0de('0x9c')]()[_0xb0de('0x9d')](_0xb0de('0xae'))[_0xb0de('0x9e')]([_0xb0de('0xa1'),_0xb0de('0xa2'),_0xb0de('0x9f'),'ListId',_0xb0de('0x60'),_0xb0de('0x56'),_0xb0de('0x57')],squel['select']()[_0xb0de('0x7e')](_0xb0de('0xa1'),_0xb0de('0xa1'))['field'](_0xb0de('0xa4'),_0xb0de('0xa2'))[_0xb0de('0x7e')]('id',_0xb0de('0x9f'))[_0xb0de('0x7e')](_0x4a75e5[_0xb0de('0xa3')]['toString'](),_0xb0de('0xa0'))[_0xb0de('0x7e')](_0x1d4b9e[_0xb0de('0x4a')]['id'][_0xb0de('0x86')](),'VoiceQueueId')['field'](_0xb0de('0xa4'),'createdAt')['field']('NOW()',_0xb0de('0x57'))[_0xb0de('0xa5')](_0xb0de('0xa6'))[_0xb0de('0x40')](_0xb0de('0xa7'))[_0xb0de('0x40')](_0xb0de('0xa8'),_0x4a75e5[_0xb0de('0xa3')][_0xb0de('0x86')]())[_0xb0de('0x40')](_0xb0de('0xa9'))['where'](_0xb0de('0xaa'),squel[_0xb0de('0x7d')]()[_0xb0de('0x7e')]('COALESCE(phone,\x27\x27)')[_0xb0de('0xa5')]('cm_hopper')[_0xb0de('0x40')](_0xb0de('0x83'),_0x1d4b9e[_0xb0de('0x4a')]['id'][_0xb0de('0x86')]())))[_0xb0de('0x86')]();break;default:_0x14069d=squel[_0xb0de('0x9c')]()[_0xb0de('0x9d')](_0xb0de('0xae'))[_0xb0de('0x9e')]([_0xb0de('0xa1'),'scheduledAt','ContactId',_0xb0de('0xa0'),_0xb0de('0x60'),_0xb0de('0x56'),_0xb0de('0x57')],squel[_0xb0de('0x7d')]()[_0xb0de('0x7e')]('phone',_0xb0de('0xa1'))[_0xb0de('0x7e')](_0xb0de('0xa4'),_0xb0de('0xa2'))['field']('id',_0xb0de('0x9f'))['field'](_0x4a75e5[_0xb0de('0xa3')]['toString'](),'ListId')[_0xb0de('0x7e')](_0x1d4b9e[_0xb0de('0x4a')]['id'][_0xb0de('0x86')](),'VoiceQueueId')[_0xb0de('0x7e')]('NOW()',_0xb0de('0x56'))[_0xb0de('0x7e')]('NOW()','updatedAt')[_0xb0de('0xa5')]('cm_contacts')[_0xb0de('0x40')](_0xb0de('0xa7'))[_0xb0de('0x40')](_0xb0de('0xa8'),_0x4a75e5[_0xb0de('0xa3')][_0xb0de('0x86')]())[_0xb0de('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xb0de('0x86')]();}_0x1d42af[_0xb0de('0x85')](db[_0xb0de('0x6f')][_0xb0de('0x36')](_0x14069d));}return BPromise[_0xb0de('0x8b')](_0x1d42af);}})[_0xb0de('0x24')](function(){return _0x4d7c52;})[_0xb0de('0x24')](respondWithResult(_0x442667,null))['catch'](handleError(_0x442667,null));};exports[_0xb0de('0xaf')]=function(_0x31917a,_0x3c6e7c,_0x101b5c){return db[_0xb0de('0x31')]['find']({'where':{'id':_0x31917a[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x3c6e7c,null))[_0xb0de('0x24')](function(_0x3e3474){if(_0x3e3474){return _0x3e3474[_0xb0de('0xaf')](_0x31917a[_0xb0de('0x36')]['ids']);}})['then'](function(_0x4ec4ee){if(_0x4ec4ee){return db[_0xb0de('0x5e')][_0xb0de('0x25')]({'where':{'ListId':_0x31917a[_0xb0de('0x36')][_0xb0de('0x8e')],'VoiceQueueId':_0x31917a['params']['id']}})[_0xb0de('0x24')](function(){return _0x4ec4ee;});}})[_0xb0de('0x24')](respondWithStatusCode(_0x3c6e7c,null))[_0xb0de('0x49')](handleError(_0x3c6e7c,null));};exports[_0xb0de('0xb0')]=function(_0x49a302,_0x116300,_0xb64922){var _0x20b97e={};var _0x1c913f={};var _0x1ea8b5;var _0x2e25e5;return db[_0xb0de('0x31')][_0xb0de('0x5d')]({'where':{'id':_0x49a302[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x116300,null))[_0xb0de('0x24')](function(_0x194855){if(_0x194855){_0x1ea8b5=_0x194855;_0x1c913f['model']=_[_0xb0de('0x37')](db['CmList'][_0xb0de('0x32')]);_0x1c913f[_0xb0de('0x36')]=_[_0xb0de('0x37')](_0x49a302[_0xb0de('0x36')]);_0x1c913f[_0xb0de('0x38')]=_[_0xb0de('0x39')](_0x1c913f[_0xb0de('0x35')],_0x1c913f['query']);_0x20b97e[_0xb0de('0x3a')]=_[_0xb0de('0x39')](_0x1c913f[_0xb0de('0x35')],qs['fields'](_0x49a302[_0xb0de('0x36')][_0xb0de('0x3b')]));_0x20b97e['attributes']=_0x20b97e[_0xb0de('0x3a')][_0xb0de('0x3c')]?_0x20b97e[_0xb0de('0x3a')]:_0x1c913f[_0xb0de('0x35')];_0x20b97e[_0xb0de('0x3e')]=qs[_0xb0de('0x3f')](_0x49a302[_0xb0de('0x36')][_0xb0de('0x3f')]);_0x20b97e[_0xb0de('0x40')]=qs['filters'](_[_0xb0de('0x41')](_0x49a302['query'],_0x1c913f[_0xb0de('0x38')]));if(_0x49a302[_0xb0de('0x36')][_0xb0de('0x26')]){_0x20b97e[_0xb0de('0x40')]=_[_0xb0de('0x43')](_0x20b97e[_0xb0de('0x40')],{'$or':_[_0xb0de('0x28')](_0x20b97e['attributes'],function(_0x2b4bbe){var _0x3166bc={};_0x3166bc[_0x2b4bbe]={'$like':'%'+_0x49a302[_0xb0de('0x36')]['filter']+'%'};return _0x3166bc;})});}_0x20b97e=_[_0xb0de('0x43')]({},_0x20b97e,_0x49a302[_0xb0de('0x44')]);return _0x1ea8b5[_0xb0de('0xb0')](_0x20b97e);}})[_0xb0de('0x24')](function(_0x11dfc7){if(_0x11dfc7){_0x2e25e5=_0x11dfc7['length'];if(!_0x49a302[_0xb0de('0x36')]['hasOwnProperty'](_0xb0de('0x3d'))){_0x20b97e[_0xb0de('0x1f')]=qs[_0xb0de('0x1f')](_0x49a302[_0xb0de('0x36')][_0xb0de('0x1f')]);_0x20b97e[_0xb0de('0x1d')]=qs[_0xb0de('0x1d')](_0x49a302['query']['offset']);}return _0x1ea8b5[_0xb0de('0xb0')](_0x20b97e);}})[_0xb0de('0x24')](function(_0x3a0d2b){if(_0x3a0d2b){return _0x3a0d2b?{'count':_0x2e25e5,'rows':_0x3a0d2b}:null;}})[_0xb0de('0x24')](respondWithResult(_0x116300,null))[_0xb0de('0x49')](handleError(_0x116300,null));};exports[_0xb0de('0xb1')]=function(_0x2a75f5,_0x24cade,_0x4576a6){var _0x1836b8,_0x4c0521;return db[_0xb0de('0x31')][_0xb0de('0x2b')]({'where':{'id':_0x2a75f5[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x24cade,null))[_0xb0de('0x24')](function(_0x28b08e){if(_0x28b08e){_0x4c0521=_0x28b08e;return _0x28b08e['addBlackLists'](_0x2a75f5['body'][_0xb0de('0x8e')],_['omit'](_0x2a75f5[_0xb0de('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x4faca2){var _0x1bbd6e;_0x1836b8=_0x4faca2||[];var _0x184cce=[];if(_0x4faca2){for(var _0x3bfef4=0x0;_0x3bfef4<_0x4faca2[_0xb0de('0x3c')];_0x3bfef4+=0x1){var _0x5571a6=_0x4faca2[_0x3bfef4][_0xb0de('0x4e')]({'plain':!![]});_0x1bbd6e=squel[_0xb0de('0x9c')]()[_0xb0de('0x9d')]('cm_hopper_black')[_0xb0de('0x9e')]([_0xb0de('0xa1'),'ContactId',_0xb0de('0xa0'),_0xb0de('0x60'),'createdAt',_0xb0de('0x57')],squel[_0xb0de('0x7d')]()['field'](_0xb0de('0xa1'),_0xb0de('0xa1'))['field']('id','ContactId')['field'](_0x5571a6[_0xb0de('0xa3')]['toString'](),_0xb0de('0xa0'))['field'](_0x2a75f5[_0xb0de('0x4a')]['id'][_0xb0de('0x86')](),'VoiceQueueId')[_0xb0de('0x7e')](_0xb0de('0xa4'),'createdAt')[_0xb0de('0x7e')](_0xb0de('0xa4'),_0xb0de('0x57'))[_0xb0de('0xa5')](_0xb0de('0xa6'))['where'](_0xb0de('0xa7'))[_0xb0de('0x40')]('ListId\x20=\x20?',_0x5571a6[_0xb0de('0xa3')][_0xb0de('0x86')]())[_0xb0de('0x40')](_0xb0de('0xa9')))[_0xb0de('0x86')]();_0x184cce[_0xb0de('0x85')](db[_0xb0de('0x6f')][_0xb0de('0x36')](_0x1bbd6e));}return BPromise[_0xb0de('0x8b')](_0x184cce);}})[_0xb0de('0x24')](function(){return _0x1836b8;})[_0xb0de('0x24')](respondWithResult(_0x24cade,null))['catch'](handleError(_0x24cade,null));};exports['removeBlackLists']=function(_0xa18446,_0x4906f0,_0x5847b3){return db['VoiceQueue'][_0xb0de('0x2b')]({'where':{'id':_0xa18446[_0xb0de('0x4a')]['id']}})[_0xb0de('0x24')](handleEntityNotFound(_0x4906f0,null))[_0xb0de('0x24')](function(_0x5c6164){if(_0x5c6164){return _0x5c6164['removeBlackLists'](_0xa18446[_0xb0de('0x36')]['ids']);}})[_0xb0de('0x24')](function(_0x47b229){if(_0x47b229){return db[_0xb0de('0x66')][_0xb0de('0x25')]({'where':{'ListId':_0xa18446['query'][_0xb0de('0x8e')],'VoiceQueueId':_0xa18446['params']['id']}})[_0xb0de('0x24')](function(){return _0x47b229;});}})[_0xb0de('0x24')](respondWithStatusCode(_0x4906f0,null))[_0xb0de('0x49')](handleError(_0x4906f0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index a15084b..3bac93a 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 _0xbb7e=['hook','exports','events','../../mysqldb','setMaxListeners','emit','hasOwnProperty'];(function(_0xd661e4,_0x237bf5){var _0x16b961=function(_0x122132){while(--_0x122132){_0xd661e4['push'](_0xd661e4['shift']());}};_0x16b961(++_0x237bf5);}(_0xbb7e,0xc6));var _0xebb7=function(_0x4e682a,_0x53ad1a){_0x4e682a=_0x4e682a-0x0;var _0x24fbbc=_0xbb7e[_0x4e682a];return _0x24fbbc;};'use strict';var EventEmitter=require(_0xebb7('0x0'));var VoiceQueue=require(_0xebb7('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xebb7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f713a){return function(_0x6b8197,_0x87ae6,_0x277b48){VoiceQueueEvents[_0xebb7('0x3')](_0x1f713a+':'+_0x6b8197['id'],_0x6b8197);VoiceQueueEvents['emit'](_0x1f713a,_0x6b8197);_0x277b48(null);};}for(var e in events){if(events[_0xebb7('0x4')](e)){var event=events[e];VoiceQueue[_0xebb7('0x5')](e,emitEvent(event));}}module[_0xebb7('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xbed7=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x4e6615,_0x91e907){var _0x5e9fdf=function(_0x45d1fb){while(--_0x45d1fb){_0x4e6615['push'](_0x4e6615['shift']());}};_0x5e9fdf(++_0x91e907);}(_0xbed7,0x182));var _0x7bed=function(_0x27d21c,_0x55114a){_0x27d21c=_0x27d21c-0x0;var _0x4a209b=_0xbed7[_0x27d21c];return _0x4a209b;};'use strict';var EventEmitter=require(_0x7bed('0x0'));var VoiceQueue=require(_0x7bed('0x1'))['db'][_0x7bed('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7bed('0x3')](0x0);var events={'afterCreate':_0x7bed('0x4'),'afterUpdate':_0x7bed('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2babb4){return function(_0x16cd8a,_0x5be2e6,_0x2ec6ef){VoiceQueueEvents[_0x7bed('0x6')](_0x2babb4+':'+_0x16cd8a['id'],_0x16cd8a);VoiceQueueEvents[_0x7bed('0x6')](_0x2babb4,_0x16cd8a);_0x2ec6ef(null);};}for(var e in events){if(events[_0x7bed('0x7')](e)){var event=events[e];VoiceQueue[_0x7bed('0x8')](e,emitEvent(event));}}module[_0x7bed('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 ead2a2a..04cbc63 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0xa8c257,_0x10d28c){var _0xa9c0d2=function(_0x285229){while(--_0x285229){_0xa8c257['push'](_0xa8c257['shift']());}};_0xa9c0d2(++_0x10d28c);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3041a8,_0x2a13de){var _0x1c1923=function(_0xa9773c){while(--_0xa9773c){_0x3041a8['push'](_0x3041a8['shift']());}};_0x1c1923(++_0x2a13de);}(_0x34e8,0x12c));var _0x834e=function(_0x57e84e,_0x37649c){_0x57e84e=_0x57e84e-0x0;var _0x2c239c=_0x34e8[_0x57e84e];return _0x2c239c;};'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/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a114b43..314a0cf 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 _0xd7f4=['ShowVoiceQueue','where','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','register','request','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','info','result','catch','GetVoiceQueue','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x12d05f,_0x521393){var _0x5bf7a6=function(_0x526639){while(--_0x526639){_0x12d05f['push'](_0x12d05f['shift']());}};_0x5bf7a6(++_0x521393);}(_0xd7f4,0xb2));var _0x4d7f=function(_0x3ac5f1,_0x1c10e1){_0x3ac5f1=_0x3ac5f1-0x0;var _0x274b87=_0xd7f4[_0x3ac5f1];return _0x274b87;};'use strict';var _=require(_0x4d7f('0x0'));var util=require(_0x4d7f('0x1'));var moment=require(_0x4d7f('0x2'));var BPromise=require(_0x4d7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d7f('0x4'));var logger=require(_0x4d7f('0x5'))(_0x4d7f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d7f('0x7')]({'port':0x232a});config[_0x4d7f('0x8')]=_[_0x4d7f('0x9')](config[_0x4d7f('0x8')],{'host':_0x4d7f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d7f('0x8')]));require('./voiceQueue.socket')[_0x4d7f('0xb')](socket);function respondWithRpcPromise(_0x5bb01f,_0x39522b,_0x1f9eee){return new BPromise(function(_0x30e921,_0x5520ee){return client[_0x4d7f('0xc')](_0x5bb01f,_0x1f9eee)['then'](function(_0x797e50){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x39522b,_0x4d7f('0xd'));logger[_0x4d7f('0xe')](_0x4d7f('0xf'),_0x39522b,_0x4d7f('0xd'),JSON[_0x4d7f('0x10')](_0x797e50));if(_0x797e50[_0x4d7f('0x11')]){if(_0x797e50[_0x4d7f('0x11')]['code']===0x1f4){logger[_0x4d7f('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x39522b,_0x797e50[_0x4d7f('0x11')]['message']);return _0x5520ee(_0x797e50[_0x4d7f('0x11')][_0x4d7f('0x12')]);}logger[_0x4d7f('0x11')](_0x4d7f('0x13'),_0x39522b,_0x797e50[_0x4d7f('0x11')][_0x4d7f('0x12')]);return _0x30e921(_0x797e50[_0x4d7f('0x11')][_0x4d7f('0x12')]);}else{logger[_0x4d7f('0x14')](_0x4d7f('0x13'),_0x39522b,'request\x20sent');_0x30e921(_0x797e50[_0x4d7f('0x15')][_0x4d7f('0x12')]);}})[_0x4d7f('0x16')](function(_0x1aa230){logger[_0x4d7f('0x11')](_0x4d7f('0x13'),_0x39522b,_0x1aa230);_0x5520ee(_0x1aa230);});});}exports[_0x4d7f('0x17')]=function(_0x4b8ffa){var _0x44288c=this;return new Promise(function(_0x3e8591,_0x18f216){return db['VoiceQueue'][_0x4d7f('0x18')]({'raw':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')][_0x4d7f('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')]['where']||null:null,'attributes':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')][_0x4d7f('0x1b')]||null:null,'limit':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa[_0x4d7f('0x19')][_0x4d7f('0x1c')]||null:null,'include':_0x4b8ffa[_0x4d7f('0x19')]?_0x4b8ffa['options'][_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x4b8ffa[_0x4d7f('0x19')]['include'],function(_0x565908){return{'model':db[_0x565908[_0x4d7f('0x1f')]],'as':_0x565908['as'],'attributes':_0x565908[_0x4d7f('0x1b')],'include':_0x565908[_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x565908[_0x4d7f('0x1d')],function(_0x99376c){return{'model':db[_0x99376c[_0x4d7f('0x1f')]],'as':_0x99376c['as'],'attributes':_0x99376c[_0x4d7f('0x1b')],'include':_0x99376c[_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x99376c[_0x4d7f('0x1d')],function(_0x212939){return{'model':db[_0x212939[_0x4d7f('0x1f')]],'as':_0x212939['as'],'attributes':_0x212939['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x218b53){logger[_0x4d7f('0x14')]('GetVoiceQueue',_0x4b8ffa);logger[_0x4d7f('0xe')]('GetVoiceQueue',_0x4b8ffa,JSON[_0x4d7f('0x10')](_0x218b53));_0x3e8591(_0x218b53);})['catch'](function(_0x59b74c){logger['error']('GetVoiceQueue',_0x59b74c[_0x4d7f('0x12')],_0x4b8ffa);_0x18f216(_0x44288c[_0x4d7f('0x11')](0x1f4,_0x59b74c[_0x4d7f('0x12')]));});});};exports[_0x4d7f('0x20')]=function(_0x3c49da){var _0x2f605b=this;return new Promise(function(_0x1eeac2,_0x4d5c23){return db['VoiceQueue']['find']({'raw':_0x3c49da[_0x4d7f('0x19')]?_0x3c49da[_0x4d7f('0x19')][_0x4d7f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c49da[_0x4d7f('0x19')]?_0x3c49da['options'][_0x4d7f('0x21')]||null:null,'attributes':_0x3c49da['options']?_0x3c49da['options'][_0x4d7f('0x1b')]||null:null,'include':_0x3c49da[_0x4d7f('0x19')]?_0x3c49da[_0x4d7f('0x19')][_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x3c49da[_0x4d7f('0x19')][_0x4d7f('0x1d')],function(_0x3a0d53){return{'model':db[_0x3a0d53[_0x4d7f('0x1f')]],'as':_0x3a0d53['as'],'attributes':_0x3a0d53[_0x4d7f('0x1b')],'include':_0x3a0d53[_0x4d7f('0x1d')]?_['map'](_0x3a0d53[_0x4d7f('0x1d')],function(_0x565242){return{'model':db[_0x565242[_0x4d7f('0x1f')]],'as':_0x565242['as'],'attributes':_0x565242['attributes'],'include':_0x565242[_0x4d7f('0x1d')]?_[_0x4d7f('0x1e')](_0x565242[_0x4d7f('0x1d')],function(_0x376bd0){return{'model':db[_0x376bd0['model']],'as':_0x376bd0['as'],'attributes':_0x376bd0['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d7f('0x22')](function(_0x491082){logger[_0x4d7f('0x14')](_0x4d7f('0x20'),_0x3c49da);logger[_0x4d7f('0xe')]('ShowVoiceQueue',_0x3c49da,JSON[_0x4d7f('0x10')](_0x491082));_0x1eeac2(_0x491082);})[_0x4d7f('0x16')](function(_0x4ae94b){logger[_0x4d7f('0x11')]('ShowVoiceQueue',_0x4ae94b[_0x4d7f('0x12')],_0x3c49da);_0x4d5c23(_0x2f605b[_0x4d7f('0x11')](0x1f4,_0x4ae94b['message']));});});}; \ No newline at end of file +var _0xfd7e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','register','request','info','request\x20sent','debug','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','find','lodash'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xfd7e,0x109));var _0xefd7=function(_0x1770a3,_0x3fea00){_0x1770a3=_0x1770a3-0x0;var _0x5d1262=_0xfd7e[_0x1770a3];return _0x5d1262;};'use strict';var _=require(_0xefd7('0x0'));var util=require('util');var moment=require(_0xefd7('0x1'));var BPromise=require(_0xefd7('0x2'));var rs=require(_0xefd7('0x3'));var fs=require('fs');var Redis=require(_0xefd7('0x4'));var db=require(_0xefd7('0x5'))['db'];var utils=require(_0xefd7('0x6'));var logger=require(_0xefd7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xefd7('0x8'));var client=jayson[_0xefd7('0x9')]['http']({'port':0x232a});config[_0xefd7('0xa')]=_[_0xefd7('0xb')](config[_0xefd7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xefd7('0xc')](socket);function respondWithRpcPromise(_0x7212b2,_0xcb7993,_0xa8c492){return new BPromise(function(_0x3e0a6e,_0x465a7b){return client[_0xefd7('0xd')](_0x7212b2,_0xa8c492)['then'](function(_0x21c5e9){logger[_0xefd7('0xe')]('VoiceQueue,\x20%s,\x20%s',_0xcb7993,_0xefd7('0xf'));logger[_0xefd7('0x10')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xcb7993,'request\x20sent',JSON[_0xefd7('0x11')](_0x21c5e9));if(_0x21c5e9[_0xefd7('0x12')]){if(_0x21c5e9[_0xefd7('0x12')][_0xefd7('0x13')]===0x1f4){logger[_0xefd7('0x12')]('VoiceQueue,\x20%s,\x20%s',_0xcb7993,_0x21c5e9['error'][_0xefd7('0x14')]);return _0x465a7b(_0x21c5e9[_0xefd7('0x12')][_0xefd7('0x14')]);}logger['error'](_0xefd7('0x15'),_0xcb7993,_0x21c5e9[_0xefd7('0x12')][_0xefd7('0x14')]);return _0x3e0a6e(_0x21c5e9[_0xefd7('0x12')]['message']);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0xcb7993,_0xefd7('0xf'));_0x3e0a6e(_0x21c5e9[_0xefd7('0x16')][_0xefd7('0x14')]);}})[_0xefd7('0x17')](function(_0x50216d){logger[_0xefd7('0x12')]('VoiceQueue,\x20%s,\x20%s',_0xcb7993,_0x50216d);_0x465a7b(_0x50216d);});});}exports[_0xefd7('0x18')]=function(_0x2492ac){var _0xfb8628=this;return new Promise(function(_0xdfa8ad,_0x2afd63){return db[_0xefd7('0x19')][_0xefd7('0x1a')]({'raw':_0x2492ac[_0xefd7('0x1b')]?_0x2492ac[_0xefd7('0x1b')][_0xefd7('0x1c')]===undefined?!![]:![]:!![],'where':_0x2492ac['options']?_0x2492ac[_0xefd7('0x1b')][_0xefd7('0x1d')]||null:null,'attributes':_0x2492ac[_0xefd7('0x1b')]?_0x2492ac['options'][_0xefd7('0x1e')]||null:null,'limit':_0x2492ac[_0xefd7('0x1b')]?_0x2492ac[_0xefd7('0x1b')][_0xefd7('0x1f')]||null:null,'include':_0x2492ac[_0xefd7('0x1b')]?_0x2492ac[_0xefd7('0x1b')][_0xefd7('0x20')]?_[_0xefd7('0x21')](_0x2492ac[_0xefd7('0x1b')][_0xefd7('0x20')],function(_0x253fc8){return{'model':db[_0x253fc8['model']],'as':_0x253fc8['as'],'attributes':_0x253fc8[_0xefd7('0x1e')],'include':_0x253fc8['include']?_['map'](_0x253fc8[_0xefd7('0x20')],function(_0x2dfe6b){return{'model':db[_0x2dfe6b['model']],'as':_0x2dfe6b['as'],'attributes':_0x2dfe6b[_0xefd7('0x1e')],'include':_0x2dfe6b['include']?_[_0xefd7('0x21')](_0x2dfe6b[_0xefd7('0x20')],function(_0x426882){return{'model':db[_0x426882[_0xefd7('0x22')]],'as':_0x426882['as'],'attributes':_0x426882[_0xefd7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xefd7('0x23')](function(_0x3b7845){logger[_0xefd7('0xe')](_0xefd7('0x18'),_0x2492ac);logger['debug'](_0xefd7('0x18'),_0x2492ac,JSON[_0xefd7('0x11')](_0x3b7845));_0xdfa8ad(_0x3b7845);})['catch'](function(_0x5a7f38){logger['error'](_0xefd7('0x18'),_0x5a7f38[_0xefd7('0x14')],_0x2492ac);_0x2afd63(_0xfb8628[_0xefd7('0x12')](0x1f4,_0x5a7f38[_0xefd7('0x14')]));});});};exports[_0xefd7('0x24')]=function(_0x5f5ddb){var _0x1c6bf9=this;return new Promise(function(_0x22e17d,_0x4444c4){return db[_0xefd7('0x19')][_0xefd7('0x25')]({'raw':_0x5f5ddb['options']?_0x5f5ddb[_0xefd7('0x1b')][_0xefd7('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f5ddb[_0xefd7('0x1b')]?_0x5f5ddb[_0xefd7('0x1b')]['where']||null:null,'attributes':_0x5f5ddb['options']?_0x5f5ddb['options'][_0xefd7('0x1e')]||null:null,'include':_0x5f5ddb[_0xefd7('0x1b')]?_0x5f5ddb['options'][_0xefd7('0x20')]?_[_0xefd7('0x21')](_0x5f5ddb['options'][_0xefd7('0x20')],function(_0xb7440a){return{'model':db[_0xb7440a['model']],'as':_0xb7440a['as'],'attributes':_0xb7440a[_0xefd7('0x1e')],'include':_0xb7440a[_0xefd7('0x20')]?_['map'](_0xb7440a['include'],function(_0x5e689c){return{'model':db[_0x5e689c[_0xefd7('0x22')]],'as':_0x5e689c['as'],'attributes':_0x5e689c[_0xefd7('0x1e')],'include':_0x5e689c['include']?_[_0xefd7('0x21')](_0x5e689c[_0xefd7('0x20')],function(_0x1a49a0){return{'model':db[_0x1a49a0[_0xefd7('0x22')]],'as':_0x1a49a0['as'],'attributes':_0x1a49a0[_0xefd7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xefd7('0x23')](function(_0x29b458){logger[_0xefd7('0xe')]('ShowVoiceQueue',_0x5f5ddb);logger[_0xefd7('0x10')]('ShowVoiceQueue',_0x5f5ddb,JSON[_0xefd7('0x11')](_0x29b458));_0x22e17d(_0x29b458);})['catch'](function(_0x4cbee3){logger[_0xefd7('0x12')](_0xefd7('0x24'),_0x4cbee3['message'],_0x5f5ddb);_0x4444c4(_0x1c6bf9[_0xefd7('0x12')](0x1f4,_0x4cbee3[_0xefd7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 694fdef..1504bc4 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 _0xeee3=['save','remove','update','register','voiceQueue:','./voiceQueue.events'];(function(_0x472042,_0x27ac38){var _0x3c79e0=function(_0x11300b){while(--_0x11300b){_0x472042['push'](_0x472042['shift']());}};_0x3c79e0(++_0x27ac38);}(_0xeee3,0x161));var _0x3eee=function(_0x488081,_0x5659d1){_0x488081=_0x488081-0x0;var _0x3fc040=_0xeee3[_0x488081];return _0x3fc040;};'use strict';var VoiceQueueEvents=require(_0x3eee('0x0'));var events=[_0x3eee('0x1'),_0x3eee('0x2'),_0x3eee('0x3')];function createListener(_0x3d614c,_0xe73645){return function(_0x575bb9){_0xe73645['emit'](_0x3d614c,_0x575bb9);};}function removeListener(_0x6861c3,_0x180cbe){return function(){VoiceQueueEvents['removeListener'](_0x6861c3,_0x180cbe);};}exports[_0x3eee('0x4')]=function(_0x80b52f){for(var _0x34aecd=0x0,_0x2d87f9=events['length'];_0x34aecd<_0x2d87f9;_0x34aecd++){var _0x27e5d1=events[_0x34aecd];var _0x12bbda=createListener(_0x3eee('0x5')+_0x27e5d1,_0x80b52f);VoiceQueueEvents['on'](_0x27e5d1,_0x12bbda);}}; \ No newline at end of file +var _0x089f=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update'];(function(_0x1ea747,_0x1d9257){var _0x3d48dc=function(_0x550cf3){while(--_0x550cf3){_0x1ea747['push'](_0x1ea747['shift']());}};_0x3d48dc(++_0x1d9257);}(_0x089f,0x10a));var _0xf089=function(_0x46b701,_0x5ac70b){_0x46b701=_0x46b701-0x0;var _0x5b740b=_0x089f[_0x46b701];return _0x5b740b;};'use strict';var VoiceQueueEvents=require(_0xf089('0x0'));var events=[_0xf089('0x1'),_0xf089('0x2'),_0xf089('0x3')];function createListener(_0x1881ba,_0x1234ce){return function(_0x1d41be){_0x1234ce[_0xf089('0x4')](_0x1881ba,_0x1d41be);};}function removeListener(_0x2c1aaa,_0x5b446b){return function(){VoiceQueueEvents[_0xf089('0x5')](_0x2c1aaa,_0x5b446b);};}exports[_0xf089('0x6')]=function(_0x589f9b){for(var _0x28c91d=0x0,_0x3af5bc=events[_0xf089('0x7')];_0x28c91d<_0x3af5bc;_0x28c91d++){var _0x169e96=events[_0x28c91d];var _0x522c7b=createListener(_0xf089('0x8')+_0x169e96,_0x589f9b);VoiceQueueEvents['on'](_0x169e96,_0x522c7b);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8edcb14..1944899 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 _0xf255=['getVoiceQueuesReport','/:id','post','create','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index'];(function(_0x1d05a3,_0x125a86){var _0x48d934=function(_0x44f447){while(--_0x44f447){_0x1d05a3['push'](_0x1d05a3['shift']());}};_0x48d934(++_0x125a86);}(_0xf255,0xfb));var _0x5f25=function(_0x903ca9,_0x2fbc2a){_0x903ca9=_0x903ca9-0x0;var _0x370719=_0xf255[_0x903ca9];return _0x370719;};'use strict';var multer=require(_0x5f25('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f25('0x1')]();var fs_extra=require(_0x5f25('0x2'));var auth=require(_0x5f25('0x3'));var interaction=require(_0x5f25('0x4'));var config=require(_0x5f25('0x5'));var controller=require(_0x5f25('0x6'));router[_0x5f25('0x7')]('/',auth[_0x5f25('0x8')](),controller[_0x5f25('0x9')]);router['get'](_0x5f25('0xa'),auth[_0x5f25('0x8')](),controller[_0x5f25('0xb')]);router[_0x5f25('0x7')](_0x5f25('0xc'),auth['isAuthenticated'](),controller[_0x5f25('0xd')]);router[_0x5f25('0x7')](_0x5f25('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5f25('0xf')]('/',auth[_0x5f25('0x8')](),controller[_0x5f25('0x10')]);router[_0x5f25('0x11')](_0x5f25('0xe'),auth[_0x5f25('0x8')](),controller[_0x5f25('0x12')]);router[_0x5f25('0x13')](_0x5f25('0xe'),auth['isAuthenticated'](),controller[_0x5f25('0x14')]);module[_0x5f25('0x15')]=router; \ No newline at end of file +var _0x3c5f=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/index','getVoiceQueuesReport','/:id'];(function(_0x24b5ad,_0x3cab79){var _0x511e69=function(_0x5bf5e2){while(--_0x5bf5e2){_0x24b5ad['push'](_0x24b5ad['shift']());}};_0x511e69(++_0x3cab79);}(_0x3c5f,0xc4));var _0xf3c5=function(_0xc5edea,_0x25683d){_0xc5edea=_0xc5edea-0x0;var _0x855d7d=_0x3c5f[_0xc5edea];return _0x855d7d;};'use strict';var multer=require(_0xf3c5('0x0'));var util=require(_0xf3c5('0x1'));var path=require(_0xf3c5('0x2'));var timeout=require(_0xf3c5('0x3'));var express=require(_0xf3c5('0x4'));var router=express[_0xf3c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf3c5('0x6'));var interaction=require(_0xf3c5('0x7'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xf3c5('0x8')](),controller['index']);router[_0xf3c5('0x9')]('/describe',auth[_0xf3c5('0x8')](),controller['describe']);router['get'](_0xf3c5('0xa'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0xb')]);router['get'](_0xf3c5('0xc'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0xd')]);router['post']('/',auth[_0xf3c5('0x8')](),controller['create']);router[_0xf3c5('0xe')](_0xf3c5('0xc'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0xf')]);router[_0xf3c5('0x10')](_0xf3c5('0xc'),auth[_0xf3c5('0x8')](),controller[_0xf3c5('0x11')]);module[_0xf3c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index fa4c909..7e386bd 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 _0x20ed=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','holdtime','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20ed,0x161));var _0xd20e=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x20ed[_0x39e84d];return _0x1991bc;};'use strict';var Sequelize=require(_0xd20e('0x0'));var moment=require('moment');module[_0xd20e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd20e('0x2')]},'calleridnum':{'type':Sequelize[_0xd20e('0x2')]},'calleridname':{'type':Sequelize[_0xd20e('0x2')]},'queue':{'type':Sequelize[_0xd20e('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xd20e('0x3')],'set':function(_0x58a9d8){var _0x386ddc=moment(_0x58a9d8);var _0x4347ea=moment(this[_0xd20e('0x4')]('queuecallerjoinAt'))['format'](_0xd20e('0x5'));var _0x36a52c=_0x386ddc[_0xd20e('0x6')](_0x4347ea,_0xd20e('0x7'));this['setDataValue']('queuecallerleaveAt',_0x58a9d8);this['setDataValue'](_0xd20e('0x8'),_0x36a52c||null);}},'position':{'type':Sequelize[_0xd20e('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd20e('0x3')]},'queuecallerexit':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xd20e('0xb')},'originalposition':{'type':Sequelize[_0xd20e('0x9')]},'channel':{'type':Sequelize[_0xd20e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd20e('0x2')]},'accountcode':{'type':Sequelize[_0xd20e('0x2')]},'context':{'type':Sequelize[_0xd20e('0x2')]},'exten':{'type':Sequelize[_0xd20e('0x2')]},'priority':{'type':Sequelize[_0xd20e('0x2')]},'holdtime':{'type':Sequelize[_0xd20e('0x9')]},'mohtime':{'type':Sequelize[_0xd20e('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd20e('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd20e('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd20e('0x2')],'comment':_0xd20e('0xc')},'transferexten':{'type':Sequelize[_0xd20e('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd20e('0x2')]},'disposition':{'type':Sequelize[_0xd20e('0x2')]},'secondDisposition':{'type':Sequelize[_0xd20e('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd20e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xd20e('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x48c7=['exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment'];(function(_0x57119b,_0x1ff63d){var _0x15c29b=function(_0x35bb52){while(--_0x35bb52){_0x57119b['push'](_0x57119b['shift']());}};_0x15c29b(++_0x1ff63d);}(_0x48c7,0x185));var _0x748c=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x48c7[_0x1e6659];return _0x4d16e4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x748c('0x0'));module[_0x748c('0x1')]={'type':{'type':Sequelize[_0x748c('0x2')]},'uniqueid':{'type':Sequelize[_0x748c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x748c('0x2')]},'queue':{'type':Sequelize[_0x748c('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x748c('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x748c('0x3')],'set':function(_0x506fb4){var _0x248339=moment(_0x506fb4);var _0x50293b=moment(this['getDataValue'](_0x748c('0x4')))[_0x748c('0x5')](_0x748c('0x6'));var _0x33b35a=_0x248339['diff'](_0x50293b,_0x748c('0x7'));this[_0x748c('0x8')](_0x748c('0x9'),_0x506fb4);this[_0x748c('0x8')](_0x748c('0xa'),_0x33b35a||null);}},'position':{'type':Sequelize[_0x748c('0xb')]},'count':{'type':Sequelize[_0x748c('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x748c('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x748c('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x748c('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x748c('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x748c('0x2')],'comment':_0x748c('0xd')},'originalposition':{'type':Sequelize[_0x748c('0xb')]},'channel':{'type':Sequelize[_0x748c('0x2')]},'connectedlinenum':{'type':Sequelize[_0x748c('0x2')]},'connectedlinename':{'type':Sequelize[_0x748c('0x2')]},'accountcode':{'type':Sequelize[_0x748c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x748c('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x748c('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x748c('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x748c('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x748c('0xe')},'transferexten':{'type':Sequelize[_0x748c('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x748c('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x748c('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x748c('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 3973a18..2b3ab39 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 _0x9376=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','count','include','rows','catch','keys','intersection','includeAll','find','create','body','params','describe','getVoiceQueuesReport','order','merge','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0x9376,0x197));var _0x6937=function(_0x104aa7,_0x316bfa){_0x104aa7=_0x104aa7-0x0;var _0x1af707=_0x9376[_0x104aa7];return _0x1af707;};'use strict';var emlformat=require(_0x6937('0x0'));var rimraf=require(_0x6937('0x1'));var zipdir=require(_0x6937('0x2'));var jsonpatch=require(_0x6937('0x3'));var rp=require(_0x6937('0x4'));var moment=require(_0x6937('0x5'));var BPromise=require(_0x6937('0x6'));var Mustache=require(_0x6937('0x7'));var util=require(_0x6937('0x8'));var path=require('path');var sox=require(_0x6937('0x9'));var csv=require(_0x6937('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6937('0xb'));var _=require(_0x6937('0xc'));var squel=require(_0x6937('0xd'));var crypto=require(_0x6937('0xe'));var jsforce=require(_0x6937('0xf'));var deskjs=require(_0x6937('0x10'));var toCsv=require(_0x6937('0xa'));var querystring=require('querystring');var Papa=require(_0x6937('0x11'));var Redis=require(_0x6937('0x12'));var authService=require(_0x6937('0x13'));var qs=require(_0x6937('0x14'));var as=require(_0x6937('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6937('0x16'))(_0x6937('0x17'));var utils=require('../../config/utils');var config=require(_0x6937('0x18'));var licenseUtil=require(_0x6937('0x19'));var db=require('../../mysqldb')['db'];config[_0x6937('0x1a')]=_['defaults'](config[_0x6937('0x1a')],{'host':_0x6937('0x1b'),'port':0x18eb});var socket=require(_0x6937('0x1c'))(new Redis(config[_0x6937('0x1a')]));require(_0x6937('0x1d'))[_0x6937('0x1e')](socket);function respondWithStatusCode(_0x5788ca,_0x813ccc){_0x813ccc=_0x813ccc||0xcc;return function(_0x814aa7){if(_0x814aa7){return _0x5788ca[_0x6937('0x1f')](_0x813ccc);}return _0x5788ca[_0x6937('0x20')](_0x813ccc)['end']();};}function respondWithResult(_0x1201f5,_0x6d6582){_0x6d6582=_0x6d6582||0xc8;return function(_0x2debc8){if(_0x2debc8){return _0x1201f5[_0x6937('0x20')](_0x6d6582)['json'](_0x2debc8);}};}function respondWithFilteredResult(_0x232d6e,_0x46f814){return function(_0x1ce1d2){if(_0x1ce1d2){var _0x179b41=typeof _0x46f814[_0x6937('0x21')]===_0x6937('0x22')&&typeof _0x46f814['limit']===_0x6937('0x22');var _0x2eb40a=_0x1ce1d2['count'];var _0x2a2d44=_0x179b41?0x0:_0x46f814[_0x6937('0x21')];var _0x1970b2=_0x179b41?_0x1ce1d2['count']:_0x46f814[_0x6937('0x21')]+_0x46f814[_0x6937('0x23')];var _0x11a7d2;if(_0x1970b2>=_0x2eb40a){_0x1970b2=_0x2eb40a;_0x11a7d2=0xc8;}else{_0x11a7d2=0xce;}_0x232d6e[_0x6937('0x20')](_0x11a7d2);return _0x232d6e[_0x6937('0x24')](_0x6937('0x25'),_0x2a2d44+'-'+_0x1970b2+'/'+_0x2eb40a)[_0x6937('0x26')](_0x1ce1d2);}return null;};}function patchUpdates(_0x522f7d){return function(_0x4e58c4){try{jsonpatch[_0x6937('0x27')](_0x4e58c4,_0x522f7d,!![]);}catch(_0x105020){return BPromise[_0x6937('0x28')](_0x105020);}return _0x4e58c4[_0x6937('0x29')]();};}function saveUpdates(_0x170f7b,_0x1597ee){return function(_0x4dca2e){if(_0x4dca2e){return _0x4dca2e[_0x6937('0x2a')](_0x170f7b)[_0x6937('0x2b')](function(_0x2ebd4a){return _0x2ebd4a;});}return null;};}function removeEntity(_0x1d7d14,_0x55acd1){return function(_0xe8ace9){if(_0xe8ace9){return _0xe8ace9[_0x6937('0x2c')]()[_0x6937('0x2b')](function(){_0x1d7d14[_0x6937('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e912,_0x418256){return function(_0x59b88){if(!_0x59b88){_0x28e912['sendStatus'](0x194);}return _0x59b88;};}function handleError(_0x5de95e,_0x59226a){_0x59226a=_0x59226a||0x1f4;return function(_0x261f68){logger[_0x6937('0x2d')](_0x261f68['stack']);if(_0x261f68['name']){delete _0x261f68[_0x6937('0x2e')];}_0x5de95e[_0x6937('0x20')](_0x59226a)[_0x6937('0x2f')](_0x261f68);};}exports[_0x6937('0x30')]=function(_0x367557,_0x48d262){var _0x582ff3={},_0x1f8aff={},_0x694901={'count':0x0,'rows':[]};var _0x555ff4=_[_0x6937('0x31')](db[_0x6937('0x32')][_0x6937('0x33')],function(_0x33fbed){return{'name':_0x33fbed['fieldName'],'type':_0x33fbed[_0x6937('0x34')][_0x6937('0x35')]};});_0x1f8aff[_0x6937('0x36')]=_[_0x6937('0x31')](_0x555ff4,'name');_0x1f8aff[_0x6937('0x37')]=_['keys'](_0x367557[_0x6937('0x37')]);_0x1f8aff[_0x6937('0x38')]=_['intersection'](_0x1f8aff['model'],_0x1f8aff[_0x6937('0x37')]);_0x582ff3[_0x6937('0x39')]=_['intersection'](_0x1f8aff[_0x6937('0x36')],qs[_0x6937('0x3a')](_0x367557[_0x6937('0x37')][_0x6937('0x3a')]));_0x582ff3['attributes']=_0x582ff3['attributes'][_0x6937('0x3b')]?_0x582ff3[_0x6937('0x39')]:_0x1f8aff['model'];if(!_0x367557[_0x6937('0x37')][_0x6937('0x3c')](_0x6937('0x3d'))){_0x582ff3[_0x6937('0x23')]=qs['limit'](_0x367557['query'][_0x6937('0x23')]);_0x582ff3['offset']=qs[_0x6937('0x21')](_0x367557['query'][_0x6937('0x21')]);}_0x582ff3['order']=qs[_0x6937('0x3e')](_0x367557['query'][_0x6937('0x3e')]);_0x582ff3['where']=qs['filters'](_[_0x6937('0x3f')](_0x367557['query'],_0x1f8aff[_0x6937('0x38')]),_0x555ff4);if(_0x367557[_0x6937('0x37')][_0x6937('0x40')]){_0x582ff3[_0x6937('0x41')]=_['merge'](_0x582ff3[_0x6937('0x41')],{'$or':_[_0x6937('0x31')](_0x555ff4,function(_0x3f4312){if(_0x3f4312[_0x6937('0x34')]!==_0x6937('0x42')){var _0x31019d={};_0x31019d[_0x3f4312['name']]={'$like':'%'+_0x367557[_0x6937('0x37')]['filter']+'%'};return _0x31019d;}})});}_0x582ff3=_['merge']({},_0x582ff3,_0x367557[_0x6937('0x43')]);var _0x593cac={'where':_0x582ff3[_0x6937('0x41')]};return db[_0x6937('0x32')][_0x6937('0x44')](_0x593cac)[_0x6937('0x2b')](function(_0x3bfd59){_0x694901['count']=_0x3bfd59;if(_0x367557['query']['includeAll']){_0x582ff3[_0x6937('0x45')]=[{'all':!![]}];}return db[_0x6937('0x32')]['findAll'](_0x582ff3);})['then'](function(_0x46ee75){_0x694901[_0x6937('0x46')]=_0x46ee75;return _0x694901;})['then'](respondWithFilteredResult(_0x48d262,_0x582ff3))[_0x6937('0x47')](handleError(_0x48d262,null));};exports['show']=function(_0x5e40a6,_0x488b8f){var _0x34a414={'raw':![],'where':{'id':_0x5e40a6['params']['id']}},_0x44fbc9={};_0x44fbc9[_0x6937('0x36')]=_[_0x6937('0x48')](db['VoiceQueueReport'][_0x6937('0x33')]);_0x44fbc9[_0x6937('0x37')]=_[_0x6937('0x48')](_0x5e40a6[_0x6937('0x37')]);_0x44fbc9[_0x6937('0x38')]=_[_0x6937('0x49')](_0x44fbc9[_0x6937('0x36')],_0x44fbc9[_0x6937('0x37')]);_0x34a414['attributes']=_[_0x6937('0x49')](_0x44fbc9['model'],qs['fields'](_0x5e40a6['query']['fields']));_0x34a414[_0x6937('0x39')]=_0x34a414[_0x6937('0x39')]['length']?_0x34a414[_0x6937('0x39')]:_0x44fbc9[_0x6937('0x36')];if(_0x5e40a6[_0x6937('0x37')][_0x6937('0x4a')]){_0x34a414[_0x6937('0x45')]=[{'all':!![]}];}_0x34a414=_['merge']({},_0x34a414,_0x5e40a6['options']);return db['VoiceQueueReport'][_0x6937('0x4b')](_0x34a414)['then'](handleEntityNotFound(_0x488b8f,null))[_0x6937('0x2b')](respondWithResult(_0x488b8f,null))[_0x6937('0x47')](handleError(_0x488b8f,null));};exports[_0x6937('0x4c')]=function(_0x1ec857,_0x3f712d){return db[_0x6937('0x32')][_0x6937('0x4c')](_0x1ec857[_0x6937('0x4d')],{})[_0x6937('0x2b')](respondWithResult(_0x3f712d,0xc9))[_0x6937('0x47')](handleError(_0x3f712d,null));};exports[_0x6937('0x2a')]=function(_0xacdf1c,_0x19e381){if(_0xacdf1c[_0x6937('0x4d')]['id']){delete _0xacdf1c[_0x6937('0x4d')]['id'];}return db[_0x6937('0x32')][_0x6937('0x4b')]({'where':{'id':_0xacdf1c['params']['id']}})[_0x6937('0x2b')](handleEntityNotFound(_0x19e381,null))[_0x6937('0x2b')](saveUpdates(_0xacdf1c[_0x6937('0x4d')],null))['then'](respondWithResult(_0x19e381,null))[_0x6937('0x47')](handleError(_0x19e381,null));};exports[_0x6937('0x2c')]=function(_0x5533ae,_0x4bfaa0){return db[_0x6937('0x32')][_0x6937('0x4b')]({'where':{'id':_0x5533ae[_0x6937('0x4e')]['id']}})[_0x6937('0x2b')](handleEntityNotFound(_0x4bfaa0,null))[_0x6937('0x2b')](removeEntity(_0x4bfaa0,null))[_0x6937('0x47')](handleError(_0x4bfaa0,null));};exports['describe']=function(_0x375eb3,_0x342317){return db[_0x6937('0x32')][_0x6937('0x4f')]()['then'](respondWithResult(_0x342317,null))[_0x6937('0x47')](handleError(_0x342317,null));};exports[_0x6937('0x50')]=function(_0x33bb9b,_0x3ed247){var _0x2ffabb={},_0x5126ad={},_0x5462da={'count':0x0,'rows':[]};_0x5126ad[_0x6937('0x36')]=_['keys'](db['VoiceQueueReport'][_0x6937('0x33')]);_0x5126ad[_0x6937('0x37')]=_[_0x6937('0x48')](_0x33bb9b[_0x6937('0x37')]);_0x5126ad[_0x6937('0x38')]=_['intersection'](_0x5126ad[_0x6937('0x36')],_0x5126ad[_0x6937('0x37')]);_0x2ffabb['attributes']=_['intersection'](_0x5126ad['model'],qs['fields'](_0x33bb9b[_0x6937('0x37')][_0x6937('0x3a')]));_0x2ffabb['attributes']=_0x2ffabb[_0x6937('0x39')][_0x6937('0x3b')]?_0x2ffabb[_0x6937('0x39')]:_0x5126ad[_0x6937('0x36')];if(!_0x33bb9b['query'][_0x6937('0x3c')](_0x6937('0x3d'))){_0x2ffabb['limit']=qs[_0x6937('0x23')](_0x33bb9b['query'][_0x6937('0x23')]);_0x2ffabb['offset']=qs[_0x6937('0x21')](_0x33bb9b['query'][_0x6937('0x21')]);}_0x2ffabb[_0x6937('0x51')]=qs['sort'](_0x33bb9b['query']['sort']);_0x2ffabb[_0x6937('0x41')]=qs['filters'](_['pick'](_0x33bb9b['query'],_0x5126ad[_0x6937('0x38')]));if(_0x33bb9b[_0x6937('0x37')][_0x6937('0x40')]){_0x2ffabb[_0x6937('0x41')]=_[_0x6937('0x52')](_0x2ffabb[_0x6937('0x41')],{'$or':_[_0x6937('0x31')](_0x2ffabb['attributes'],function(_0x71373a){var _0x43620c={};_0x43620c[_0x71373a]={'$like':'%'+_0x33bb9b[_0x6937('0x37')][_0x6937('0x40')]+'%'};return _0x43620c;})});}_0x2ffabb=_[_0x6937('0x52')]({},_0x2ffabb,_0x33bb9b[_0x6937('0x43')]);var _0x41ad13={'where':_0x2ffabb[_0x6937('0x41')]};return db[_0x6937('0x32')][_0x6937('0x44')](_0x41ad13)[_0x6937('0x2b')](function(_0x290baf){_0x5462da[_0x6937('0x44')]=_0x290baf;if(_0x33bb9b[_0x6937('0x37')][_0x6937('0x4a')]){_0x2ffabb[_0x6937('0x45')]=[{'all':!![]}];}return db[_0x6937('0x32')][_0x6937('0x53')](_0x2ffabb);})[_0x6937('0x2b')](function(_0x167175){_0x5462da['rows']=_0x167175;return _0x5462da;})[_0x6937('0x2b')](respondWithFilteredResult(_0x3ed247,_0x2ffabb,_0x6937('0x50')))[_0x6937('0x47')](handleError(_0x3ed247,null,_0x6937('0x50')));}; \ No newline at end of file +var _0x5660=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./voiceQueueReport.socket','register','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','VoiceQueueReport','catch','show','params','fields','find','create','body','describe','getVoiceQueuesReport','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x35a46b,_0x5b66dc){var _0x126ed3=function(_0x4906d9){while(--_0x4906d9){_0x35a46b['push'](_0x35a46b['shift']());}};_0x126ed3(++_0x5b66dc);}(_0x5660,0x18e));var _0x0566=function(_0x4f7bf7,_0x55ba47){_0x4f7bf7=_0x4f7bf7-0x0;var _0x3696a9=_0x5660[_0x4f7bf7];return _0x3696a9;};'use strict';var emlformat=require(_0x0566('0x0'));var rimraf=require(_0x0566('0x1'));var zipdir=require(_0x0566('0x2'));var jsonpatch=require(_0x0566('0x3'));var rp=require('request-promise');var moment=require(_0x0566('0x4'));var BPromise=require(_0x0566('0x5'));var Mustache=require(_0x0566('0x6'));var util=require(_0x0566('0x7'));var path=require(_0x0566('0x8'));var sox=require(_0x0566('0x9'));var csv=require(_0x0566('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0566('0xb'));var squel=require('squel');var crypto=require(_0x0566('0xc'));var jsforce=require(_0x0566('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0566('0xa'));var querystring=require(_0x0566('0xe'));var Papa=require(_0x0566('0xf'));var Redis=require(_0x0566('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0566('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0566('0x12'));var logger=require(_0x0566('0x13'))(_0x0566('0x14'));var utils=require(_0x0566('0x15'));var config=require(_0x0566('0x16'));var licenseUtil=require(_0x0566('0x17'));var db=require(_0x0566('0x18'))['db'];config[_0x0566('0x19')]=_[_0x0566('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0566('0x1b'))[_0x0566('0x1c')](socket);function respondWithStatusCode(_0x19440f,_0x17cb46){_0x17cb46=_0x17cb46||0xcc;return function(_0x28dfca){if(_0x28dfca){return _0x19440f['sendStatus'](_0x17cb46);}return _0x19440f[_0x0566('0x1d')](_0x17cb46)[_0x0566('0x1e')]();};}function respondWithResult(_0x439a3c,_0x239b30){_0x239b30=_0x239b30||0xc8;return function(_0x31a03e){if(_0x31a03e){return _0x439a3c['status'](_0x239b30)[_0x0566('0x1f')](_0x31a03e);}};}function respondWithFilteredResult(_0x3fec77,_0x816062){return function(_0x45c5e6){if(_0x45c5e6){var _0x3f9d35=typeof _0x816062[_0x0566('0x20')]===_0x0566('0x21')&&typeof _0x816062['limit']==='undefined';var _0xecb0df=_0x45c5e6[_0x0566('0x22')];var _0x24b834=_0x3f9d35?0x0:_0x816062[_0x0566('0x20')];var _0x22519c=_0x3f9d35?_0x45c5e6[_0x0566('0x22')]:_0x816062[_0x0566('0x20')]+_0x816062[_0x0566('0x23')];var _0x33a614;if(_0x22519c>=_0xecb0df){_0x22519c=_0xecb0df;_0x33a614=0xc8;}else{_0x33a614=0xce;}_0x3fec77[_0x0566('0x1d')](_0x33a614);return _0x3fec77['set']('Content-Range',_0x24b834+'-'+_0x22519c+'/'+_0xecb0df)[_0x0566('0x1f')](_0x45c5e6);}return null;};}function patchUpdates(_0x21fc57){return function(_0x2eb858){try{jsonpatch[_0x0566('0x24')](_0x2eb858,_0x21fc57,!![]);}catch(_0x8a7bb0){return BPromise[_0x0566('0x25')](_0x8a7bb0);}return _0x2eb858[_0x0566('0x26')]();};}function saveUpdates(_0x59d581,_0x5a5149){return function(_0x4d208e){if(_0x4d208e){return _0x4d208e[_0x0566('0x27')](_0x59d581)[_0x0566('0x28')](function(_0x3314cb){return _0x3314cb;});}return null;};}function removeEntity(_0x145ef1,_0x4b48ed){return function(_0x5487d8){if(_0x5487d8){return _0x5487d8[_0x0566('0x29')]()[_0x0566('0x28')](function(){_0x145ef1[_0x0566('0x1d')](0xcc)[_0x0566('0x1e')]();});}};}function handleEntityNotFound(_0xaa0669,_0x15dd0c){return function(_0x250873){if(!_0x250873){_0xaa0669[_0x0566('0x2a')](0x194);}return _0x250873;};}function handleError(_0x87127d,_0x227adc){_0x227adc=_0x227adc||0x1f4;return function(_0x5a44fb){logger['error'](_0x5a44fb[_0x0566('0x2b')]);if(_0x5a44fb[_0x0566('0x2c')]){delete _0x5a44fb['name'];}_0x87127d['status'](_0x227adc)[_0x0566('0x2d')](_0x5a44fb);};}exports[_0x0566('0x2e')]=function(_0x45c127,_0x1ba258){var _0x14612d={},_0x2dc587={},_0x180d47={'count':0x0,'rows':[]};var _0x5a2417=_[_0x0566('0x2f')](db['VoiceQueueReport'][_0x0566('0x30')],function(_0x4dd296){return{'name':_0x4dd296[_0x0566('0x31')],'type':_0x4dd296[_0x0566('0x32')][_0x0566('0x33')]};});_0x2dc587[_0x0566('0x34')]=_[_0x0566('0x2f')](_0x5a2417,_0x0566('0x2c'));_0x2dc587[_0x0566('0x35')]=_[_0x0566('0x36')](_0x45c127[_0x0566('0x35')]);_0x2dc587[_0x0566('0x37')]=_[_0x0566('0x38')](_0x2dc587['model'],_0x2dc587[_0x0566('0x35')]);_0x14612d[_0x0566('0x39')]=_[_0x0566('0x38')](_0x2dc587[_0x0566('0x34')],qs['fields'](_0x45c127[_0x0566('0x35')]['fields']));_0x14612d['attributes']=_0x14612d[_0x0566('0x39')][_0x0566('0x3a')]?_0x14612d[_0x0566('0x39')]:_0x2dc587['model'];if(!_0x45c127[_0x0566('0x35')][_0x0566('0x3b')](_0x0566('0x3c'))){_0x14612d[_0x0566('0x23')]=qs[_0x0566('0x23')](_0x45c127[_0x0566('0x35')][_0x0566('0x23')]);_0x14612d['offset']=qs[_0x0566('0x20')](_0x45c127[_0x0566('0x35')][_0x0566('0x20')]);}_0x14612d[_0x0566('0x3d')]=qs['sort'](_0x45c127['query'][_0x0566('0x3e')]);_0x14612d[_0x0566('0x3f')]=qs[_0x0566('0x37')](_[_0x0566('0x40')](_0x45c127[_0x0566('0x35')],_0x2dc587['filters']),_0x5a2417);if(_0x45c127[_0x0566('0x35')][_0x0566('0x41')]){_0x14612d[_0x0566('0x3f')]=_[_0x0566('0x42')](_0x14612d[_0x0566('0x3f')],{'$or':_[_0x0566('0x2f')](_0x5a2417,function(_0x3d0387){if(_0x3d0387['type']!==_0x0566('0x43')){var _0x1dd4d7={};_0x1dd4d7[_0x3d0387[_0x0566('0x2c')]]={'$like':'%'+_0x45c127['query'][_0x0566('0x41')]+'%'};return _0x1dd4d7;}})});}_0x14612d=_[_0x0566('0x42')]({},_0x14612d,_0x45c127[_0x0566('0x44')]);var _0x37d654={'where':_0x14612d[_0x0566('0x3f')]};return db['VoiceQueueReport'][_0x0566('0x22')](_0x37d654)[_0x0566('0x28')](function(_0x547bce){_0x180d47['count']=_0x547bce;if(_0x45c127[_0x0566('0x35')][_0x0566('0x45')]){_0x14612d['include']=[{'all':!![]}];}return db[_0x0566('0x46')]['findAll'](_0x14612d);})[_0x0566('0x28')](function(_0x23ad5b){_0x180d47['rows']=_0x23ad5b;return _0x180d47;})[_0x0566('0x28')](respondWithFilteredResult(_0x1ba258,_0x14612d))[_0x0566('0x47')](handleError(_0x1ba258,null));};exports[_0x0566('0x48')]=function(_0x27b8c3,_0x52be3d){var _0x4d9703={'raw':![],'where':{'id':_0x27b8c3[_0x0566('0x49')]['id']}},_0x5c4b4b={};_0x5c4b4b[_0x0566('0x34')]=_[_0x0566('0x36')](db[_0x0566('0x46')][_0x0566('0x30')]);_0x5c4b4b[_0x0566('0x35')]=_[_0x0566('0x36')](_0x27b8c3[_0x0566('0x35')]);_0x5c4b4b[_0x0566('0x37')]=_[_0x0566('0x38')](_0x5c4b4b[_0x0566('0x34')],_0x5c4b4b[_0x0566('0x35')]);_0x4d9703[_0x0566('0x39')]=_[_0x0566('0x38')](_0x5c4b4b[_0x0566('0x34')],qs[_0x0566('0x4a')](_0x27b8c3[_0x0566('0x35')][_0x0566('0x4a')]));_0x4d9703[_0x0566('0x39')]=_0x4d9703[_0x0566('0x39')][_0x0566('0x3a')]?_0x4d9703[_0x0566('0x39')]:_0x5c4b4b['model'];if(_0x27b8c3['query']['includeAll']){_0x4d9703['include']=[{'all':!![]}];}_0x4d9703=_[_0x0566('0x42')]({},_0x4d9703,_0x27b8c3[_0x0566('0x44')]);return db[_0x0566('0x46')][_0x0566('0x4b')](_0x4d9703)['then'](handleEntityNotFound(_0x52be3d,null))[_0x0566('0x28')](respondWithResult(_0x52be3d,null))[_0x0566('0x47')](handleError(_0x52be3d,null));};exports[_0x0566('0x4c')]=function(_0x3185d7,_0x2b08d0){return db[_0x0566('0x46')][_0x0566('0x4c')](_0x3185d7[_0x0566('0x4d')],{})[_0x0566('0x28')](respondWithResult(_0x2b08d0,0xc9))[_0x0566('0x47')](handleError(_0x2b08d0,null));};exports['update']=function(_0x1c6ac5,_0x567765){if(_0x1c6ac5[_0x0566('0x4d')]['id']){delete _0x1c6ac5[_0x0566('0x4d')]['id'];}return db['VoiceQueueReport'][_0x0566('0x4b')]({'where':{'id':_0x1c6ac5['params']['id']}})['then'](handleEntityNotFound(_0x567765,null))[_0x0566('0x28')](saveUpdates(_0x1c6ac5['body'],null))[_0x0566('0x28')](respondWithResult(_0x567765,null))['catch'](handleError(_0x567765,null));};exports[_0x0566('0x29')]=function(_0x357d0b,_0x247f59){return db[_0x0566('0x46')]['find']({'where':{'id':_0x357d0b[_0x0566('0x49')]['id']}})[_0x0566('0x28')](handleEntityNotFound(_0x247f59,null))[_0x0566('0x28')](removeEntity(_0x247f59,null))['catch'](handleError(_0x247f59,null));};exports[_0x0566('0x4e')]=function(_0x38e86c,_0x42683f){return db[_0x0566('0x46')][_0x0566('0x4e')]()[_0x0566('0x28')](respondWithResult(_0x42683f,null))[_0x0566('0x47')](handleError(_0x42683f,null));};exports[_0x0566('0x4f')]=function(_0x4df41c,_0x4643f6){var _0x3b7e16={},_0x5c5649={},_0x5a9a19={'count':0x0,'rows':[]};_0x5c5649['model']=_[_0x0566('0x36')](db['VoiceQueueReport'][_0x0566('0x30')]);_0x5c5649[_0x0566('0x35')]=_[_0x0566('0x36')](_0x4df41c[_0x0566('0x35')]);_0x5c5649[_0x0566('0x37')]=_[_0x0566('0x38')](_0x5c5649['model'],_0x5c5649[_0x0566('0x35')]);_0x3b7e16[_0x0566('0x39')]=_[_0x0566('0x38')](_0x5c5649['model'],qs[_0x0566('0x4a')](_0x4df41c[_0x0566('0x35')][_0x0566('0x4a')]));_0x3b7e16['attributes']=_0x3b7e16[_0x0566('0x39')][_0x0566('0x3a')]?_0x3b7e16[_0x0566('0x39')]:_0x5c5649[_0x0566('0x34')];if(!_0x4df41c[_0x0566('0x35')]['hasOwnProperty'](_0x0566('0x3c'))){_0x3b7e16[_0x0566('0x23')]=qs[_0x0566('0x23')](_0x4df41c[_0x0566('0x35')][_0x0566('0x23')]);_0x3b7e16[_0x0566('0x20')]=qs[_0x0566('0x20')](_0x4df41c[_0x0566('0x35')][_0x0566('0x20')]);}_0x3b7e16[_0x0566('0x3d')]=qs[_0x0566('0x3e')](_0x4df41c[_0x0566('0x35')][_0x0566('0x3e')]);_0x3b7e16[_0x0566('0x3f')]=qs[_0x0566('0x37')](_[_0x0566('0x40')](_0x4df41c[_0x0566('0x35')],_0x5c5649[_0x0566('0x37')]));if(_0x4df41c['query'][_0x0566('0x41')]){_0x3b7e16[_0x0566('0x3f')]=_[_0x0566('0x42')](_0x3b7e16[_0x0566('0x3f')],{'$or':_[_0x0566('0x2f')](_0x3b7e16['attributes'],function(_0x33b751){var _0x18f057={};_0x18f057[_0x33b751]={'$like':'%'+_0x4df41c[_0x0566('0x35')][_0x0566('0x41')]+'%'};return _0x18f057;})});}_0x3b7e16=_['merge']({},_0x3b7e16,_0x4df41c[_0x0566('0x44')]);var _0x4f4711={'where':_0x3b7e16['where']};return db['VoiceQueueReport'][_0x0566('0x22')](_0x4f4711)[_0x0566('0x28')](function(_0x5495c1){_0x5a9a19[_0x0566('0x22')]=_0x5495c1;if(_0x4df41c['query'][_0x0566('0x45')]){_0x3b7e16[_0x0566('0x50')]=[{'all':!![]}];}return db[_0x0566('0x46')][_0x0566('0x51')](_0x3b7e16);})['then'](function(_0xa3e97b){_0x5a9a19[_0x0566('0x52')]=_0xa3e97b;return _0x5a9a19;})['then'](respondWithFilteredResult(_0x4643f6,_0x3b7e16,_0x0566('0x4f')))[_0x0566('0x47')](handleError(_0x4643f6,null,_0x0566('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 96f45c7..8d82f84 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 _0x33f4=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x33f4,0xf5));var _0x433f=function(_0x20b94c,_0x2f57e7){_0x20b94c=_0x20b94c-0x0;var _0x1e1265=_0x33f4[_0x20b94c];return _0x1e1265;};'use strict';var EventEmitter=require(_0x433f('0x0'));var VoiceQueueReport=require(_0x433f('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x433f('0x2')](0x0);var events={'afterCreate':_0x433f('0x3'),'afterUpdate':_0x433f('0x4'),'afterDestroy':_0x433f('0x5')};function emitEvent(_0x28a782){return function(_0x2522c3,_0x3cbb2b,_0x17c508){VoiceQueueReportEvents['emit'](_0x28a782+':'+_0x2522c3['id'],_0x2522c3);VoiceQueueReportEvents[_0x433f('0x6')](_0x28a782,_0x2522c3);_0x17c508(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x433f('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xdb45=['hasOwnProperty','exports','setMaxListeners','save','update','emit'];(function(_0x1c7f94,_0x233c83){var _0x411758=function(_0x3ac11a){while(--_0x3ac11a){_0x1c7f94['push'](_0x1c7f94['shift']());}};_0x411758(++_0x233c83);}(_0xdb45,0x74));var _0x5db4=function(_0x492623,_0x16630d){_0x492623=_0x492623-0x0;var _0x2cd230=_0xdb45[_0x492623];return _0x2cd230;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5db4('0x0')](0x0);var events={'afterCreate':_0x5db4('0x1'),'afterUpdate':_0x5db4('0x2'),'afterDestroy':'remove'};function emitEvent(_0x44a324){return function(_0x1c6b0b,_0x1a58c6,_0x12ccbd){VoiceQueueReportEvents['emit'](_0x44a324+':'+_0x1c6b0b['id'],_0x1c6b0b);VoiceQueueReportEvents[_0x5db4('0x3')](_0x44a324,_0x1c6b0b);_0x12ccbd(null);};}for(var e in events){if(events[_0x5db4('0x4')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5db4('0x5')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2096375..bc274e3 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 _0xa3a4=['../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4c79aa,_0x456fcd){var _0x28e73a=function(_0x2f9084){while(--_0x2f9084){_0x4c79aa['push'](_0x4c79aa['shift']());}};_0x28e73a(++_0x456fcd);}(_0xa3a4,0x1ca));var _0x4a3a=function(_0x307abd,_0x2f0da8){_0x307abd=_0x307abd-0x0;var _0x44ccd8=_0xa3a4[_0x307abd];return _0x44ccd8;};'use strict';var _=require(_0x4a3a('0x0'));var util=require('util');var logger=require(_0x4a3a('0x1'))(_0x4a3a('0x2'));var moment=require(_0x4a3a('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a3a('0x4'));var fs=require('fs');var path=require(_0x4a3a('0x5'));var rimraf=require(_0x4a3a('0x6'));var config=require(_0x4a3a('0x7'));var attributes=require(_0x4a3a('0x8'));module[_0x4a3a('0x9')]=function(_0x533ba4,_0x17b122){return _0x533ba4[_0x4a3a('0xa')](_0x4a3a('0xb'),attributes,{'tableName':_0x4a3a('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4a3a('0xd')]},{'fields':[_0x4a3a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb8a4=['lodash','api','bluebird','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0xb8a4,0x1a4));var _0x4b8a=function(_0x2c039a,_0x217a31){_0x2c039a=_0x2c039a-0x0;var _0x3f398f=_0xb8a4[_0x2c039a];return _0x3f398f;};'use strict';var _=require(_0x4b8a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4b8a('0x1'));var moment=require('moment');var BPromise=require(_0x4b8a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b8a('0x3'));var rimraf=require('rimraf');var config=require(_0x4b8a('0x4'));var attributes=require(_0x4b8a('0x5'));module[_0x4b8a('0x6')]=function(_0x58a8f5,_0x153bbf){return _0x58a8f5[_0x4b8a('0x7')](_0x4b8a('0x8'),attributes,{'tableName':_0x4b8a('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 292c4ba..ad6fcee 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 _0xc5e3=['attributes','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','stringify','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model'];(function(_0x502773,_0xe55d92){var _0x568f34=function(_0x44a7f9){while(--_0x44a7f9){_0x502773['push'](_0x502773['shift']());}};_0x568f34(++_0xe55d92);}(_0xc5e3,0x13d));var _0x3c5e=function(_0x3c1123,_0x3967a7){_0x3c1123=_0x3c1123-0x0;var _0x5dc1d9=_0xc5e3[_0x3c1123];return _0x5dc1d9;};'use strict';var _=require(_0x3c5e('0x0'));var util=require(_0x3c5e('0x1'));var moment=require('moment');var BPromise=require(_0x3c5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c5e('0x3'));var db=require(_0x3c5e('0x4'))['db'];var utils=require(_0x3c5e('0x5'));var logger=require(_0x3c5e('0x6'))(_0x3c5e('0x7'));var config=require(_0x3c5e('0x8'));var jayson=require(_0x3c5e('0x9'));var client=jayson[_0x3c5e('0xa')][_0x3c5e('0xb')]({'port':0x232a});config['redis']=_[_0x3c5e('0xc')](config[_0x3c5e('0xd')],{'host':_0x3c5e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c5e('0xd')]));require(_0x3c5e('0xf'))['register'](socket);function respondWithRpcPromise(_0x2da410,_0x182186,_0x3c266a){return new BPromise(function(_0x5975e2,_0x150bfd){return client[_0x3c5e('0x10')](_0x2da410,_0x3c266a)[_0x3c5e('0x11')](function(_0x4e7ce5){logger[_0x3c5e('0x12')](_0x3c5e('0x13'),_0x182186,_0x3c5e('0x14'));logger[_0x3c5e('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x182186,_0x3c5e('0x14'),JSON['stringify'](_0x4e7ce5));if(_0x4e7ce5[_0x3c5e('0x16')]){if(_0x4e7ce5[_0x3c5e('0x16')][_0x3c5e('0x17')]===0x1f4){logger['error'](_0x3c5e('0x13'),_0x182186,_0x4e7ce5[_0x3c5e('0x16')][_0x3c5e('0x18')]);return _0x150bfd(_0x4e7ce5['error'][_0x3c5e('0x18')]);}logger[_0x3c5e('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x182186,_0x4e7ce5[_0x3c5e('0x16')][_0x3c5e('0x18')]);return _0x5975e2(_0x4e7ce5[_0x3c5e('0x16')]['message']);}else{logger[_0x3c5e('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x182186,_0x3c5e('0x14'));_0x5975e2(_0x4e7ce5[_0x3c5e('0x19')][_0x3c5e('0x18')]);}})['catch'](function(_0x24f023){logger[_0x3c5e('0x16')](_0x3c5e('0x13'),_0x182186,_0x24f023);_0x150bfd(_0x24f023);});});}exports['GetVoiceQueueReport']=function(_0x3aae5d){var _0x1d4e2c=this;return new Promise(function(_0x265ab0,_0x1b0a98){return db[_0x3c5e('0x1a')][_0x3c5e('0x1b')]({'raw':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d['options'][_0x3c5e('0x1d')]===undefined?!![]:![]:!![],'where':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d['options'][_0x3c5e('0x1e')]||null:null,'attributes':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d[_0x3c5e('0x1c')]['attributes']||null:null,'limit':_0x3aae5d['options']?_0x3aae5d[_0x3c5e('0x1c')][_0x3c5e('0x1f')]||null:null,'include':_0x3aae5d[_0x3c5e('0x1c')]?_0x3aae5d[_0x3c5e('0x1c')][_0x3c5e('0x20')]?_[_0x3c5e('0x21')](_0x3aae5d[_0x3c5e('0x1c')][_0x3c5e('0x20')],function(_0x2a1e29){return{'model':db[_0x2a1e29[_0x3c5e('0x22')]],'as':_0x2a1e29['as'],'attributes':_0x2a1e29[_0x3c5e('0x23')],'include':_0x2a1e29[_0x3c5e('0x20')]?_['map'](_0x2a1e29[_0x3c5e('0x20')],function(_0x2672da){return{'model':db[_0x2672da[_0x3c5e('0x22')]],'as':_0x2672da['as'],'attributes':_0x2672da[_0x3c5e('0x23')],'include':_0x2672da[_0x3c5e('0x20')]?_[_0x3c5e('0x21')](_0x2672da['include'],function(_0x43ca1a){return{'model':db[_0x43ca1a[_0x3c5e('0x22')]],'as':_0x43ca1a['as'],'attributes':_0x43ca1a['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c5e('0x11')](function(_0x7c16de){logger[_0x3c5e('0x12')](_0x3c5e('0x24'),_0x3aae5d);logger[_0x3c5e('0x15')](_0x3c5e('0x24'),_0x3aae5d,JSON['stringify'](_0x7c16de));_0x265ab0(_0x7c16de);})[_0x3c5e('0x25')](function(_0x538c22){logger[_0x3c5e('0x16')](_0x3c5e('0x24'),_0x538c22[_0x3c5e('0x18')],_0x3aae5d);_0x1b0a98(_0x1d4e2c[_0x3c5e('0x16')](0x1f4,_0x538c22[_0x3c5e('0x18')]));});});};exports[_0x3c5e('0x26')]=function(_0xb965eb){var _0x142392=this;return new Promise(function(_0x270e78,_0x43ec31){return db[_0x3c5e('0x1a')][_0x3c5e('0x27')](_0xb965eb[_0x3c5e('0x28')],{'raw':_0xb965eb[_0x3c5e('0x1c')]?_0xb965eb['options'][_0x3c5e('0x1d')]===undefined?!![]:![]:!![]})[_0x3c5e('0x11')](function(_0x32f77a){logger[_0x3c5e('0x12')](_0x3c5e('0x26'),_0xb965eb);logger[_0x3c5e('0x15')](_0x3c5e('0x26'),_0xb965eb,JSON[_0x3c5e('0x29')](_0x32f77a));_0x270e78(_0x32f77a);})[_0x3c5e('0x25')](function(_0x2ce8eb){logger['error']('CreateVoiceQueueReport',_0x2ce8eb['message'],_0xb965eb);_0x43ec31(_0x142392[_0x3c5e('0x16')](0x1f4,_0x2ce8eb[_0x3c5e('0x18')]));});});};exports[_0x3c5e('0x2a')]=function(_0x566385){var _0xff7fff=this;return new Promise(function(_0x327b3b,_0x3d8057){return db['VoiceQueueReport'][_0x3c5e('0x2b')](_0x566385['body'],{'raw':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')][_0x3c5e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')][_0x3c5e('0x1e')]||null:null,'attributes':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')][_0x3c5e('0x23')]||null:null,'limit':_0x566385[_0x3c5e('0x1c')]?_0x566385[_0x3c5e('0x1c')]['limit']||null:null})[_0x3c5e('0x11')](function(_0x2e9d6e){logger[_0x3c5e('0x12')](_0x3c5e('0x2a'),_0x566385);logger['debug'](_0x3c5e('0x2a'),_0x566385,JSON[_0x3c5e('0x29')](_0x2e9d6e));_0x327b3b(_0x2e9d6e);})[_0x3c5e('0x25')](function(_0x527ff3){logger[_0x3c5e('0x16')]('UpdateVoiceQueueReport',_0x527ff3[_0x3c5e('0x18')],_0x566385);_0x3d8057(_0xff7fff[_0x3c5e('0x16')](0x1f4,_0x527ff3[_0x3c5e('0x18')]));});});}; \ No newline at end of file +var _0x4ddf=['client','http','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x133208,_0x40f759){var _0x4c9dcf=function(_0x2c06b9){while(--_0x2c06b9){_0x133208['push'](_0x133208['shift']());}};_0x4c9dcf(++_0x40f759);}(_0x4ddf,0x110));var _0xf4dd=function(_0x2eabf1,_0x21225d){_0x2eabf1=_0x2eabf1-0x0;var _0x3acace=_0x4ddf[_0x2eabf1];return _0x3acace;};'use strict';var _=require(_0xf4dd('0x0'));var util=require(_0xf4dd('0x1'));var moment=require(_0xf4dd('0x2'));var BPromise=require(_0xf4dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4dd('0x5'))(_0xf4dd('0x6'));var config=require(_0xf4dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf4dd('0x8')][_0xf4dd('0x9')]({'port':0x232a});config[_0xf4dd('0xa')]=_[_0xf4dd('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf4dd('0xc'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xf4dd('0xd')](socket);function respondWithRpcPromise(_0x5e8e1f,_0x1a8776,_0x42811b){return new BPromise(function(_0x48d27b,_0x43d109){return client['request'](_0x5e8e1f,_0x42811b)[_0xf4dd('0xe')](function(_0xe474e3){logger[_0xf4dd('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x1a8776,_0xf4dd('0x10'));logger['debug'](_0xf4dd('0x11'),_0x1a8776,_0xf4dd('0x10'),JSON[_0xf4dd('0x12')](_0xe474e3));if(_0xe474e3[_0xf4dd('0x13')]){if(_0xe474e3['error']['code']===0x1f4){logger[_0xf4dd('0x13')](_0xf4dd('0x14'),_0x1a8776,_0xe474e3['error'][_0xf4dd('0x15')]);return _0x43d109(_0xe474e3[_0xf4dd('0x13')][_0xf4dd('0x15')]);}logger[_0xf4dd('0x13')](_0xf4dd('0x14'),_0x1a8776,_0xe474e3[_0xf4dd('0x13')][_0xf4dd('0x15')]);return _0x48d27b(_0xe474e3[_0xf4dd('0x13')][_0xf4dd('0x15')]);}else{logger[_0xf4dd('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x1a8776,'request\x20sent');_0x48d27b(_0xe474e3[_0xf4dd('0x16')]['message']);}})[_0xf4dd('0x17')](function(_0x52acad){logger[_0xf4dd('0x13')](_0xf4dd('0x14'),_0x1a8776,_0x52acad);_0x43d109(_0x52acad);});});}exports[_0xf4dd('0x18')]=function(_0x7f0aa7){var _0x55357e=this;return new Promise(function(_0x3ebe71,_0xfc4944){return db[_0xf4dd('0x19')][_0xf4dd('0x1a')]({'raw':_0x7f0aa7[_0xf4dd('0x1b')]?_0x7f0aa7['options'][_0xf4dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x7f0aa7[_0xf4dd('0x1b')]?_0x7f0aa7['options'][_0xf4dd('0x1d')]||null:null,'attributes':_0x7f0aa7[_0xf4dd('0x1b')]?_0x7f0aa7['options'][_0xf4dd('0x1e')]||null:null,'limit':_0x7f0aa7[_0xf4dd('0x1b')]?_0x7f0aa7['options'][_0xf4dd('0x1f')]||null:null,'include':_0x7f0aa7[_0xf4dd('0x1b')]?_0x7f0aa7[_0xf4dd('0x1b')][_0xf4dd('0x20')]?_[_0xf4dd('0x21')](_0x7f0aa7[_0xf4dd('0x1b')]['include'],function(_0xbf59a0){return{'model':db[_0xbf59a0[_0xf4dd('0x22')]],'as':_0xbf59a0['as'],'attributes':_0xbf59a0[_0xf4dd('0x1e')],'include':_0xbf59a0[_0xf4dd('0x20')]?_[_0xf4dd('0x21')](_0xbf59a0[_0xf4dd('0x20')],function(_0x3859cf){return{'model':db[_0x3859cf[_0xf4dd('0x22')]],'as':_0x3859cf['as'],'attributes':_0x3859cf[_0xf4dd('0x1e')],'include':_0x3859cf[_0xf4dd('0x20')]?_[_0xf4dd('0x21')](_0x3859cf['include'],function(_0x2a360b){return{'model':db[_0x2a360b['model']],'as':_0x2a360b['as'],'attributes':_0x2a360b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37a6ad){logger[_0xf4dd('0xf')](_0xf4dd('0x18'),_0x7f0aa7);logger[_0xf4dd('0x23')](_0xf4dd('0x18'),_0x7f0aa7,JSON[_0xf4dd('0x12')](_0x37a6ad));_0x3ebe71(_0x37a6ad);})[_0xf4dd('0x17')](function(_0x56f05b){logger[_0xf4dd('0x13')](_0xf4dd('0x18'),_0x56f05b[_0xf4dd('0x15')],_0x7f0aa7);_0xfc4944(_0x55357e[_0xf4dd('0x13')](0x1f4,_0x56f05b['message']));});});};exports[_0xf4dd('0x24')]=function(_0x2e71a3){var _0x5112b3=this;return new Promise(function(_0x5b3832,_0x42eb80){return db['VoiceQueueReport'][_0xf4dd('0x25')](_0x2e71a3['body'],{'raw':_0x2e71a3[_0xf4dd('0x1b')]?_0x2e71a3['options'][_0xf4dd('0x1c')]===undefined?!![]:![]:!![]})[_0xf4dd('0xe')](function(_0x407f77){logger[_0xf4dd('0xf')](_0xf4dd('0x24'),_0x2e71a3);logger[_0xf4dd('0x23')](_0xf4dd('0x24'),_0x2e71a3,JSON[_0xf4dd('0x12')](_0x407f77));_0x5b3832(_0x407f77);})[_0xf4dd('0x17')](function(_0x51bfdf){logger[_0xf4dd('0x13')](_0xf4dd('0x24'),_0x51bfdf[_0xf4dd('0x15')],_0x2e71a3);_0x42eb80(_0x5112b3[_0xf4dd('0x13')](0x1f4,_0x51bfdf[_0xf4dd('0x15')]));});});};exports[_0xf4dd('0x26')]=function(_0x25136c){var _0x403707=this;return new Promise(function(_0x56f3d5,_0xa86804){return db[_0xf4dd('0x19')][_0xf4dd('0x27')](_0x25136c['body'],{'raw':_0x25136c[_0xf4dd('0x1b')]?_0x25136c['options'][_0xf4dd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25136c[_0xf4dd('0x1b')]?_0x25136c['options'][_0xf4dd('0x1d')]||null:null,'attributes':_0x25136c['options']?_0x25136c[_0xf4dd('0x1b')][_0xf4dd('0x1e')]||null:null,'limit':_0x25136c[_0xf4dd('0x1b')]?_0x25136c[_0xf4dd('0x1b')][_0xf4dd('0x1f')]||null:null})[_0xf4dd('0xe')](function(_0x4ab9bb){logger[_0xf4dd('0xf')]('UpdateVoiceQueueReport',_0x25136c);logger[_0xf4dd('0x23')](_0xf4dd('0x26'),_0x25136c,JSON[_0xf4dd('0x12')](_0x4ab9bb));_0x56f3d5(_0x4ab9bb);})['catch'](function(_0x3683ab){logger[_0xf4dd('0x13')]('UpdateVoiceQueueReport',_0x3683ab[_0xf4dd('0x15')],_0x25136c);_0xa86804(_0x403707[_0xf4dd('0x13')](0x1f4,_0x3683ab[_0xf4dd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b1fc7bd..c6f96be 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 _0xd07b=['emit','removeListener','register','length','./voiceQueueReport.events','save','remove','update'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xd07b,0xfc));var _0xbd07=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd07b[_0x397e5f];return _0x5302b8;};'use strict';var VoiceQueueReportEvents=require(_0xbd07('0x0'));var events=[_0xbd07('0x1'),_0xbd07('0x2'),_0xbd07('0x3')];function createListener(_0xf244b2,_0x33e157){return function(_0x57b88a){_0x33e157[_0xbd07('0x4')](_0xf244b2,_0x57b88a);};}function removeListener(_0x4976c5,_0x419f4c){return function(){VoiceQueueReportEvents[_0xbd07('0x5')](_0x4976c5,_0x419f4c);};}exports[_0xbd07('0x6')]=function(_0x3d6684){for(var _0x465b53=0x0,_0x1e8f9c=events[_0xbd07('0x7')];_0x465b53<_0x1e8f9c;_0x465b53++){var _0x1de79b=events[_0x465b53];var _0x5caa9b=createListener('voiceQueueReport:'+_0x1de79b,_0x3d6684);VoiceQueueReportEvents['on'](_0x1de79b,_0x5caa9b);}}; \ No newline at end of file +var _0x86f4=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','register'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x86f4,0x18a));var _0x486f=function(_0x2872de,_0x221d0f){_0x2872de=_0x2872de-0x0;var _0x373c10=_0x86f4[_0x2872de];return _0x373c10;};'use strict';var VoiceQueueReportEvents=require(_0x486f('0x0'));var events=[_0x486f('0x1'),_0x486f('0x2'),_0x486f('0x3')];function createListener(_0x3e0b4f,_0x10339c){return function(_0x45067a){_0x10339c['emit'](_0x3e0b4f,_0x45067a);};}function removeListener(_0xf8d50f,_0x1539b1){return function(){VoiceQueueReportEvents['removeListener'](_0xf8d50f,_0x1539b1);};}exports[_0x486f('0x4')]=function(_0x1adb27){for(var _0x39f767=0x0,_0x207201=events[_0x486f('0x5')];_0x39f767<_0x207201;_0x39f767++){var _0x3a0791=events[_0x39f767];var _0x5bfabc=createListener(_0x486f('0x6')+_0x3a0791,_0x1adb27);VoiceQueueReportEvents['on'](_0x3a0791,_0x5bfabc);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 386b2f4..4a75760 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 _0x75f0=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x75f0,0x196));var _0x075f=function(_0x2b9630,_0x394f14){_0x2b9630=_0x2b9630-0x0;var _0x5cb3ba=_0x75f0[_0x2b9630];return _0x5cb3ba;};'use strict';var multer=require(_0x075f('0x0'));var util=require(_0x075f('0x1'));var path=require(_0x075f('0x2'));var timeout=require(_0x075f('0x3'));var express=require(_0x075f('0x4'));var router=express[_0x075f('0x5')]();var fs_extra=require(_0x075f('0x6'));var auth=require(_0x075f('0x7'));var interaction=require(_0x075f('0x8'));var config=require('../../config/environment');var controller=require(_0x075f('0x9'));router[_0x075f('0xa')]('/',auth[_0x075f('0xb')](),controller['index']);router['get'](_0x075f('0xc'),auth['isAuthenticated'](),controller[_0x075f('0xd')]);router[_0x075f('0xe')]('/',auth['isAuthenticated'](),controller[_0x075f('0xf')]);router[_0x075f('0x10')](_0x075f('0xc'),auth[_0x075f('0xb')](),controller[_0x075f('0x11')]);router['delete']('/:id',auth[_0x075f('0xb')](),controller[_0x075f('0x12')]);module[_0x075f('0x13')]=router; \ No newline at end of file +var _0x649b=['create','put','/:id','update','delete','exports','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','show'];(function(_0x3ce796,_0x621939){var _0x354e12=function(_0x553aec){while(--_0x553aec){_0x3ce796['push'](_0x3ce796['shift']());}};_0x354e12(++_0x621939);}(_0x649b,0x166));var _0xb649=function(_0x4c9357,_0xd30c4d){_0x4c9357=_0x4c9357-0x0;var _0x3464ca=_0x649b[_0x4c9357];return _0x3464ca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb649('0x0'));var timeout=require(_0xb649('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb649('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb649('0x3'));var config=require(_0xb649('0x4'));var controller=require(_0xb649('0x5'));router['get']('/',auth[_0xb649('0x6')](),controller[_0xb649('0x7')]);router[_0xb649('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb649('0x9')]);router['post']('/',auth[_0xb649('0x6')](),controller[_0xb649('0xa')]);router[_0xb649('0xb')](_0xb649('0xc'),auth['isAuthenticated'](),controller[_0xb649('0xd')]);router[_0xb649('0xe')](_0xb649('0xc'),auth[_0xb649('0x6')](),controller['destroy']);module[_0xb649('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8f7808c..501ec55 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 _0x4667=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING','DATE','format'];(function(_0x1dc442,_0x2d24ff){var _0x44d13d=function(_0x524e30){while(--_0x524e30){_0x1dc442['push'](_0x1dc442['shift']());}};_0x44d13d(++_0x2d24ff);}(_0x4667,0x10f));var _0x7466=function(_0x5baadf,_0x1bb942){_0x5baadf=_0x5baadf-0x0;var _0x3cd985=_0x4667[_0x5baadf];return _0x3cd985;};'use strict';var Sequelize=require(_0x7466('0x0'));var moment=require(_0x7466('0x1'));module['exports']={'time':{'type':Sequelize[_0x7466('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7466('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7466('0x3')],'allowNull':![],'defaultValue':moment()[_0x7466('0x4')](_0x7466('0x5'))}}; \ No newline at end of file +var _0xd3a7=['exports','STRING','DATE','sequelize','moment'];(function(_0x2ce01a,_0x2d2c1e){var _0x7c85ed=function(_0x12b452){while(--_0x12b452){_0x2ce01a['push'](_0x2ce01a['shift']());}};_0x7c85ed(++_0x2d2c1e);}(_0xd3a7,0x107));var _0x7d3a=function(_0x20dd8f,_0x3e1d1c){_0x20dd8f=_0x20dd8f-0x0;var _0x243ac9=_0xd3a7[_0x20dd8f];return _0x243ac9;};'use strict';var Sequelize=require(_0x7d3a('0x0'));var moment=require(_0x7d3a('0x1'));module[_0x7d3a('0x2')]={'time':{'type':Sequelize[_0x7d3a('0x3')]},'callid':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7d3a('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7d3a('0x4')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index db54b6c..2d4ddcb 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 _0xfc59=['body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','include','find','create'];(function(_0x4636b7,_0x548559){var _0x203107=function(_0x337dfc){while(--_0x337dfc){_0x4636b7['push'](_0x4636b7['shift']());}};_0x203107(++_0x548559);}(_0xfc59,0x91));var _0x9fc5=function(_0x2d0319,_0x5892b9){_0x2d0319=_0x2d0319-0x0;var _0x6224d0=_0xfc59[_0x2d0319];return _0x6224d0;};'use strict';var emlformat=require(_0x9fc5('0x0'));var rimraf=require(_0x9fc5('0x1'));var zipdir=require(_0x9fc5('0x2'));var jsonpatch=require(_0x9fc5('0x3'));var rp=require(_0x9fc5('0x4'));var moment=require(_0x9fc5('0x5'));var BPromise=require(_0x9fc5('0x6'));var Mustache=require(_0x9fc5('0x7'));var util=require(_0x9fc5('0x8'));var path=require('path');var sox=require(_0x9fc5('0x9'));var csv=require('to-csv');var ejs=require(_0x9fc5('0xa'));var fs=require('fs');var fs_extra=require(_0x9fc5('0xb'));var _=require('lodash');var squel=require(_0x9fc5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9fc5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9fc5('0xe'));var Papa=require(_0x9fc5('0xf'));var Redis=require(_0x9fc5('0x10'));var authService=require(_0x9fc5('0x11'));var qs=require(_0x9fc5('0x12'));var as=require(_0x9fc5('0x13'));var hardwareService=require(_0x9fc5('0x14'));var logger=require(_0x9fc5('0x15'))(_0x9fc5('0x16'));var utils=require('../../config/utils');var config=require(_0x9fc5('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x552896,_0x214de2){_0x214de2=_0x214de2||0xcc;return function(_0xa79626){if(_0xa79626){return _0x552896['sendStatus'](_0x214de2);}return _0x552896['status'](_0x214de2)[_0x9fc5('0x18')]();};}function respondWithResult(_0x420f14,_0x436004){_0x436004=_0x436004||0xc8;return function(_0x11b81b){if(_0x11b81b){return _0x420f14[_0x9fc5('0x19')](_0x436004)[_0x9fc5('0x1a')](_0x11b81b);}};}function respondWithFilteredResult(_0x1f561d,_0x2f568c){return function(_0x5ec025){if(_0x5ec025){var _0x156b1e=typeof _0x2f568c[_0x9fc5('0x1b')]===_0x9fc5('0x1c')&&typeof _0x2f568c[_0x9fc5('0x1d')]===_0x9fc5('0x1c');var _0x29b0c2=_0x5ec025[_0x9fc5('0x1e')];var _0x539191=_0x156b1e?0x0:_0x2f568c['offset'];var _0x31f1d2=_0x156b1e?_0x5ec025['count']:_0x2f568c[_0x9fc5('0x1b')]+_0x2f568c['limit'];var _0x2e3c85;if(_0x31f1d2>=_0x29b0c2){_0x31f1d2=_0x29b0c2;_0x2e3c85=0xc8;}else{_0x2e3c85=0xce;}_0x1f561d['status'](_0x2e3c85);return _0x1f561d[_0x9fc5('0x1f')](_0x9fc5('0x20'),_0x539191+'-'+_0x31f1d2+'/'+_0x29b0c2)[_0x9fc5('0x1a')](_0x5ec025);}return null;};}function patchUpdates(_0x565551){return function(_0x353c02){try{jsonpatch[_0x9fc5('0x21')](_0x353c02,_0x565551,!![]);}catch(_0x402c39){return BPromise['reject'](_0x402c39);}return _0x353c02[_0x9fc5('0x22')]();};}function saveUpdates(_0x392dd1,_0x299ab1){return function(_0xd53c55){if(_0xd53c55){return _0xd53c55[_0x9fc5('0x23')](_0x392dd1)[_0x9fc5('0x24')](function(_0xe32bcf){return _0xe32bcf;});}return null;};}function removeEntity(_0x48271c,_0x5c55a8){return function(_0x36709a){if(_0x36709a){return _0x36709a[_0x9fc5('0x25')]()[_0x9fc5('0x24')](function(){_0x48271c[_0x9fc5('0x19')](0xcc)[_0x9fc5('0x18')]();});}};}function handleEntityNotFound(_0x3af850,_0x1cf9d4){return function(_0x17c157){if(!_0x17c157){_0x3af850[_0x9fc5('0x26')](0x194);}return _0x17c157;};}function handleError(_0x2c572d,_0x1ba166){_0x1ba166=_0x1ba166||0x1f4;return function(_0x73266b){logger[_0x9fc5('0x27')](_0x73266b[_0x9fc5('0x28')]);if(_0x73266b['name']){delete _0x73266b[_0x9fc5('0x29')];}_0x2c572d[_0x9fc5('0x19')](_0x1ba166)['send'](_0x73266b);};}exports[_0x9fc5('0x2a')]=function(_0x53891d,_0xa89750){var _0x41042c={},_0x46c9f5={},_0x47f0bf={'count':0x0,'rows':[]};var _0x28dd63=_[_0x9fc5('0x2b')](db[_0x9fc5('0x2c')][_0x9fc5('0x2d')],function(_0x6c46ee){return{'name':_0x6c46ee[_0x9fc5('0x2e')],'type':_0x6c46ee[_0x9fc5('0x2f')]['key']};});_0x46c9f5[_0x9fc5('0x30')]=_[_0x9fc5('0x2b')](_0x28dd63,'name');_0x46c9f5[_0x9fc5('0x31')]=_[_0x9fc5('0x32')](_0x53891d[_0x9fc5('0x31')]);_0x46c9f5[_0x9fc5('0x33')]=_[_0x9fc5('0x34')](_0x46c9f5[_0x9fc5('0x30')],_0x46c9f5[_0x9fc5('0x31')]);_0x41042c['attributes']=_[_0x9fc5('0x34')](_0x46c9f5[_0x9fc5('0x30')],qs[_0x9fc5('0x35')](_0x53891d['query'][_0x9fc5('0x35')]));_0x41042c[_0x9fc5('0x36')]=_0x41042c[_0x9fc5('0x36')]['length']?_0x41042c[_0x9fc5('0x36')]:_0x46c9f5[_0x9fc5('0x30')];if(!_0x53891d[_0x9fc5('0x31')]['hasOwnProperty']('nolimit')){_0x41042c[_0x9fc5('0x1d')]=qs['limit'](_0x53891d['query']['limit']);_0x41042c[_0x9fc5('0x1b')]=qs[_0x9fc5('0x1b')](_0x53891d['query']['offset']);}_0x41042c['order']=qs[_0x9fc5('0x37')](_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x37')]);_0x41042c[_0x9fc5('0x38')]=qs[_0x9fc5('0x33')](_[_0x9fc5('0x39')](_0x53891d[_0x9fc5('0x31')],_0x46c9f5[_0x9fc5('0x33')]),_0x28dd63);if(_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x3a')]){_0x41042c['where']=_[_0x9fc5('0x3b')](_0x41042c[_0x9fc5('0x38')],{'$or':_['map'](_0x28dd63,function(_0x2486c6){if(_0x2486c6[_0x9fc5('0x2f')]!==_0x9fc5('0x3c')){var _0x4a6361={};_0x4a6361[_0x2486c6[_0x9fc5('0x29')]]={'$like':'%'+_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x3a')]+'%'};return _0x4a6361;}})});}_0x41042c=_['merge']({},_0x41042c,_0x53891d[_0x9fc5('0x3d')]);var _0x342a88={'where':_0x41042c[_0x9fc5('0x38')]};return db[_0x9fc5('0x2c')][_0x9fc5('0x1e')](_0x342a88)[_0x9fc5('0x24')](function(_0xdf8051){_0x47f0bf[_0x9fc5('0x1e')]=_0xdf8051;if(_0x53891d[_0x9fc5('0x31')][_0x9fc5('0x3e')]){_0x41042c['include']=[{'all':!![]}];}return db[_0x9fc5('0x2c')][_0x9fc5('0x3f')](_0x41042c);})['then'](function(_0x473db5){_0x47f0bf[_0x9fc5('0x40')]=_0x473db5;return _0x47f0bf;})[_0x9fc5('0x24')](respondWithFilteredResult(_0xa89750,_0x41042c))[_0x9fc5('0x41')](handleError(_0xa89750,null));};exports['show']=function(_0x38b0b1,_0x40f621){var _0x3eaa65={'raw':!![],'where':{'id':_0x38b0b1[_0x9fc5('0x42')]['id']}},_0xad1e4a={};_0xad1e4a[_0x9fc5('0x30')]=_['keys'](db['VoiceQueuesLog'][_0x9fc5('0x2d')]);_0xad1e4a[_0x9fc5('0x31')]=_['keys'](_0x38b0b1[_0x9fc5('0x31')]);_0xad1e4a['filters']=_['intersection'](_0xad1e4a[_0x9fc5('0x30')],_0xad1e4a[_0x9fc5('0x31')]);_0x3eaa65[_0x9fc5('0x36')]=_[_0x9fc5('0x34')](_0xad1e4a['model'],qs[_0x9fc5('0x35')](_0x38b0b1['query'][_0x9fc5('0x35')]));_0x3eaa65['attributes']=_0x3eaa65['attributes'][_0x9fc5('0x43')]?_0x3eaa65[_0x9fc5('0x36')]:_0xad1e4a[_0x9fc5('0x30')];if(_0x38b0b1[_0x9fc5('0x31')][_0x9fc5('0x3e')]){_0x3eaa65[_0x9fc5('0x44')]=[{'all':!![]}];}_0x3eaa65=_['merge']({},_0x3eaa65,_0x38b0b1[_0x9fc5('0x3d')]);return db['VoiceQueuesLog'][_0x9fc5('0x45')](_0x3eaa65)[_0x9fc5('0x24')](handleEntityNotFound(_0x40f621,null))[_0x9fc5('0x24')](respondWithResult(_0x40f621,null))[_0x9fc5('0x41')](handleError(_0x40f621,null));};exports[_0x9fc5('0x46')]=function(_0x1f5956,_0x49fb2f){return db[_0x9fc5('0x2c')]['create'](_0x1f5956[_0x9fc5('0x47')],{})[_0x9fc5('0x24')](respondWithResult(_0x49fb2f,0xc9))['catch'](handleError(_0x49fb2f,null));};exports[_0x9fc5('0x23')]=function(_0x48c03f,_0x1150d2){if(_0x48c03f[_0x9fc5('0x47')]['id']){delete _0x48c03f[_0x9fc5('0x47')]['id'];}return db[_0x9fc5('0x2c')]['find']({'where':{'id':_0x48c03f[_0x9fc5('0x42')]['id']}})[_0x9fc5('0x24')](handleEntityNotFound(_0x1150d2,null))[_0x9fc5('0x24')](saveUpdates(_0x48c03f['body'],null))[_0x9fc5('0x24')](respondWithResult(_0x1150d2,null))[_0x9fc5('0x41')](handleError(_0x1150d2,null));};exports['destroy']=function(_0x2b6c2b,_0x491b3d){return db['VoiceQueuesLog']['find']({'where':{'id':_0x2b6c2b[_0x9fc5('0x42')]['id']}})[_0x9fc5('0x24')](handleEntityNotFound(_0x491b3d,null))[_0x9fc5('0x24')](removeEntity(_0x491b3d,null))[_0x9fc5('0x41')](handleError(_0x491b3d,null));}; \ No newline at end of file +var _0x82cc=['moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1fe20d,_0x31d404){var _0xc557b5=function(_0x4745aa){while(--_0x4745aa){_0x1fe20d['push'](_0x1fe20d['shift']());}};_0xc557b5(++_0x31d404);}(_0x82cc,0x1c9));var _0xc82c=function(_0x49a1bb,_0x33f196){_0x49a1bb=_0x49a1bb-0x0;var _0x4835f2=_0x82cc[_0x49a1bb];return _0x4835f2;};'use strict';var emlformat=require(_0xc82c('0x0'));var rimraf=require(_0xc82c('0x1'));var zipdir=require(_0xc82c('0x2'));var jsonpatch=require(_0xc82c('0x3'));var rp=require(_0xc82c('0x4'));var moment=require(_0xc82c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc82c('0x6'));var util=require(_0xc82c('0x7'));var path=require(_0xc82c('0x8'));var sox=require(_0xc82c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc82c('0xa'));var _=require('lodash');var squel=require(_0xc82c('0xb'));var crypto=require(_0xc82c('0xc'));var jsforce=require(_0xc82c('0xd'));var deskjs=require(_0xc82c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc82c('0xf'));var Redis=require('ioredis');var authService=require(_0xc82c('0x10'));var qs=require(_0xc82c('0x11'));var as=require(_0xc82c('0x12'));var hardwareService=require(_0xc82c('0x13'));var logger=require(_0xc82c('0x14'))(_0xc82c('0x15'));var utils=require(_0xc82c('0x16'));var config=require(_0xc82c('0x17'));var licenseUtil=require(_0xc82c('0x18'));var db=require(_0xc82c('0x19'))['db'];function respondWithStatusCode(_0x2f3734,_0x228e57){_0x228e57=_0x228e57||0xcc;return function(_0x3236bb){if(_0x3236bb){return _0x2f3734['sendStatus'](_0x228e57);}return _0x2f3734[_0xc82c('0x1a')](_0x228e57)[_0xc82c('0x1b')]();};}function respondWithResult(_0x5cb22f,_0x1b5666){_0x1b5666=_0x1b5666||0xc8;return function(_0x355d65){if(_0x355d65){return _0x5cb22f[_0xc82c('0x1a')](_0x1b5666)[_0xc82c('0x1c')](_0x355d65);}};}function respondWithFilteredResult(_0x1dc257,_0x133f6c){return function(_0x46d1bd){if(_0x46d1bd){var _0x45f283=typeof _0x133f6c[_0xc82c('0x1d')]===_0xc82c('0x1e')&&typeof _0x133f6c[_0xc82c('0x1f')]===_0xc82c('0x1e');var _0x1c9eea=_0x46d1bd['count'];var _0x339e02=_0x45f283?0x0:_0x133f6c['offset'];var _0x429508=_0x45f283?_0x46d1bd[_0xc82c('0x20')]:_0x133f6c['offset']+_0x133f6c[_0xc82c('0x1f')];var _0x338763;if(_0x429508>=_0x1c9eea){_0x429508=_0x1c9eea;_0x338763=0xc8;}else{_0x338763=0xce;}_0x1dc257[_0xc82c('0x1a')](_0x338763);return _0x1dc257[_0xc82c('0x21')](_0xc82c('0x22'),_0x339e02+'-'+_0x429508+'/'+_0x1c9eea)['json'](_0x46d1bd);}return null;};}function patchUpdates(_0x5d3b1a){return function(_0x57033c){try{jsonpatch[_0xc82c('0x23')](_0x57033c,_0x5d3b1a,!![]);}catch(_0x2cf30c){return BPromise[_0xc82c('0x24')](_0x2cf30c);}return _0x57033c[_0xc82c('0x25')]();};}function saveUpdates(_0x3d306e,_0x458938){return function(_0x18db37){if(_0x18db37){return _0x18db37[_0xc82c('0x26')](_0x3d306e)['then'](function(_0x315d8){return _0x315d8;});}return null;};}function removeEntity(_0x270101,_0x1933a7){return function(_0x10ac38){if(_0x10ac38){return _0x10ac38[_0xc82c('0x27')]()[_0xc82c('0x28')](function(){_0x270101[_0xc82c('0x1a')](0xcc)[_0xc82c('0x1b')]();});}};}function handleEntityNotFound(_0x5456a0,_0x54a321){return function(_0x33e701){if(!_0x33e701){_0x5456a0[_0xc82c('0x29')](0x194);}return _0x33e701;};}function handleError(_0x15e441,_0x4a34e3){_0x4a34e3=_0x4a34e3||0x1f4;return function(_0x5abbc3){logger[_0xc82c('0x2a')](_0x5abbc3[_0xc82c('0x2b')]);if(_0x5abbc3[_0xc82c('0x2c')]){delete _0x5abbc3['name'];}_0x15e441[_0xc82c('0x1a')](_0x4a34e3)[_0xc82c('0x2d')](_0x5abbc3);};}exports[_0xc82c('0x2e')]=function(_0x594675,_0x5aed49){var _0x321d18={},_0x24881a={},_0xb9edae={'count':0x0,'rows':[]};var _0x22dc72=_[_0xc82c('0x2f')](db[_0xc82c('0x30')][_0xc82c('0x31')],function(_0x2c5f56){return{'name':_0x2c5f56['fieldName'],'type':_0x2c5f56[_0xc82c('0x32')]['key']};});_0x24881a[_0xc82c('0x33')]=_[_0xc82c('0x2f')](_0x22dc72,_0xc82c('0x2c'));_0x24881a[_0xc82c('0x34')]=_[_0xc82c('0x35')](_0x594675[_0xc82c('0x34')]);_0x24881a[_0xc82c('0x36')]=_[_0xc82c('0x37')](_0x24881a[_0xc82c('0x33')],_0x24881a['query']);_0x321d18['attributes']=_[_0xc82c('0x37')](_0x24881a[_0xc82c('0x33')],qs[_0xc82c('0x38')](_0x594675[_0xc82c('0x34')][_0xc82c('0x38')]));_0x321d18[_0xc82c('0x39')]=_0x321d18[_0xc82c('0x39')][_0xc82c('0x3a')]?_0x321d18[_0xc82c('0x39')]:_0x24881a[_0xc82c('0x33')];if(!_0x594675[_0xc82c('0x34')][_0xc82c('0x3b')](_0xc82c('0x3c'))){_0x321d18[_0xc82c('0x1f')]=qs[_0xc82c('0x1f')](_0x594675[_0xc82c('0x34')][_0xc82c('0x1f')]);_0x321d18[_0xc82c('0x1d')]=qs['offset'](_0x594675[_0xc82c('0x34')][_0xc82c('0x1d')]);}_0x321d18['order']=qs['sort'](_0x594675[_0xc82c('0x34')][_0xc82c('0x3d')]);_0x321d18[_0xc82c('0x3e')]=qs[_0xc82c('0x36')](_[_0xc82c('0x3f')](_0x594675['query'],_0x24881a[_0xc82c('0x36')]),_0x22dc72);if(_0x594675['query']['filter']){_0x321d18['where']=_['merge'](_0x321d18['where'],{'$or':_['map'](_0x22dc72,function(_0x181a40){if(_0x181a40['type']!==_0xc82c('0x40')){var _0x39b969={};_0x39b969[_0x181a40[_0xc82c('0x2c')]]={'$like':'%'+_0x594675[_0xc82c('0x34')][_0xc82c('0x41')]+'%'};return _0x39b969;}})});}_0x321d18=_[_0xc82c('0x42')]({},_0x321d18,_0x594675[_0xc82c('0x43')]);var _0x25c892={'where':_0x321d18['where']};return db['VoiceQueuesLog'][_0xc82c('0x20')](_0x25c892)[_0xc82c('0x28')](function(_0x293265){_0xb9edae[_0xc82c('0x20')]=_0x293265;if(_0x594675[_0xc82c('0x34')][_0xc82c('0x44')]){_0x321d18[_0xc82c('0x45')]=[{'all':!![]}];}return db[_0xc82c('0x30')][_0xc82c('0x46')](_0x321d18);})[_0xc82c('0x28')](function(_0x57c887){_0xb9edae[_0xc82c('0x47')]=_0x57c887;return _0xb9edae;})[_0xc82c('0x28')](respondWithFilteredResult(_0x5aed49,_0x321d18))[_0xc82c('0x48')](handleError(_0x5aed49,null));};exports['show']=function(_0x517a10,_0x35e034){var _0x2b32ec={'raw':!![],'where':{'id':_0x517a10[_0xc82c('0x49')]['id']}},_0x4aed7a={};_0x4aed7a[_0xc82c('0x33')]=_[_0xc82c('0x35')](db[_0xc82c('0x30')][_0xc82c('0x31')]);_0x4aed7a['query']=_['keys'](_0x517a10[_0xc82c('0x34')]);_0x4aed7a[_0xc82c('0x36')]=_[_0xc82c('0x37')](_0x4aed7a['model'],_0x4aed7a[_0xc82c('0x34')]);_0x2b32ec[_0xc82c('0x39')]=_[_0xc82c('0x37')](_0x4aed7a[_0xc82c('0x33')],qs['fields'](_0x517a10[_0xc82c('0x34')]['fields']));_0x2b32ec[_0xc82c('0x39')]=_0x2b32ec[_0xc82c('0x39')][_0xc82c('0x3a')]?_0x2b32ec['attributes']:_0x4aed7a[_0xc82c('0x33')];if(_0x517a10[_0xc82c('0x34')][_0xc82c('0x44')]){_0x2b32ec[_0xc82c('0x45')]=[{'all':!![]}];}_0x2b32ec=_['merge']({},_0x2b32ec,_0x517a10[_0xc82c('0x43')]);return db[_0xc82c('0x30')]['find'](_0x2b32ec)[_0xc82c('0x28')](handleEntityNotFound(_0x35e034,null))[_0xc82c('0x28')](respondWithResult(_0x35e034,null))[_0xc82c('0x48')](handleError(_0x35e034,null));};exports[_0xc82c('0x4a')]=function(_0x20b3d4,_0x261892){return db['VoiceQueuesLog'][_0xc82c('0x4a')](_0x20b3d4[_0xc82c('0x4b')],{})[_0xc82c('0x28')](respondWithResult(_0x261892,0xc9))[_0xc82c('0x48')](handleError(_0x261892,null));};exports[_0xc82c('0x26')]=function(_0x556e72,_0xa3a9bd){if(_0x556e72[_0xc82c('0x4b')]['id']){delete _0x556e72[_0xc82c('0x4b')]['id'];}return db[_0xc82c('0x30')]['find']({'where':{'id':_0x556e72[_0xc82c('0x49')]['id']}})['then'](handleEntityNotFound(_0xa3a9bd,null))[_0xc82c('0x28')](saveUpdates(_0x556e72['body'],null))[_0xc82c('0x28')](respondWithResult(_0xa3a9bd,null))['catch'](handleError(_0xa3a9bd,null));};exports[_0xc82c('0x27')]=function(_0x3db04f,_0x42dce8){return db['VoiceQueuesLog'][_0xc82c('0x4c')]({'where':{'id':_0x3db04f['params']['id']}})[_0xc82c('0x28')](handleEntityNotFound(_0x42dce8,null))['then'](removeEntity(_0x42dce8,null))[_0xc82c('0x48')](handleError(_0x42dce8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 824edc8..eb779b9 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 _0xb268=['moment','bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','event_dtm','event','dtm','lodash','util','../../config/logger','api'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0xb268,0x114));var _0x8b26=function(_0x1f7714,_0x3f200e){_0x1f7714=_0x1f7714-0x0;var _0x2051d5=_0xb268[_0x1f7714];return _0x2051d5;};'use strict';var _=require(_0x8b26('0x0'));var util=require(_0x8b26('0x1'));var logger=require(_0x8b26('0x2'))(_0x8b26('0x3'));var moment=require(_0x8b26('0x4'));var BPromise=require(_0x8b26('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b26('0x6'));var config=require(_0x8b26('0x7'));var attributes=require(_0x8b26('0x8'));module[_0x8b26('0x9')]=function(_0x2b0249,_0x4fb7d6){return _0x2b0249[_0x8b26('0xa')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x8b26('0xb'),'fields':[_0x8b26('0xc'),_0x8b26('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xaf98=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x2121d8,_0x2b084b){var _0x516045=function(_0x49980c){while(--_0x49980c){_0x2121d8['push'](_0x2121d8['shift']());}};_0x516045(++_0x2b084b);}(_0xaf98,0x11d));var _0x8af9=function(_0x49ee39,_0x295d5c){_0x49ee39=_0x49ee39-0x0;var _0x2b645f=_0xaf98[_0x49ee39];return _0x2b645f;};'use strict';var _=require(_0x8af9('0x0'));var util=require(_0x8af9('0x1'));var logger=require(_0x8af9('0x2'))(_0x8af9('0x3'));var moment=require(_0x8af9('0x4'));var BPromise=require(_0x8af9('0x5'));var rp=require(_0x8af9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8af9('0x7'));var config=require('../../config/environment');var attributes=require(_0x8af9('0x8'));module[_0x8af9('0x9')]=function(_0x35998e,_0x3f34d9){return _0x35998e[_0x8af9('0xa')](_0x8af9('0xb'),attributes,{'tableName':_0x8af9('0xc'),'paranoid':![],'indexes':[{'name':_0x8af9('0xd'),'fields':[_0x8af9('0xe'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 5f788c2..cefc0a5 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 _0xa1e8=['http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xfa7f22,_0x251ebd){var _0x37850f=function(_0x2847bb){while(--_0x2847bb){_0xfa7f22['push'](_0xfa7f22['shift']());}};_0x37850f(++_0x251ebd);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x523a67,_0x11ea07){_0x523a67=_0x523a67-0x0;var _0x3e5b9d=_0xa1e8[_0x523a67];return _0x3e5b9d;};'use strict';var _=require(_0x8a1e('0x0'));var util=require('util');var moment=require(_0x8a1e('0x1'));var BPromise=require(_0x8a1e('0x2'));var rs=require(_0x8a1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a1e('0x5'))(_0x8a1e('0x6'));var config=require(_0x8a1e('0x7'));var jayson=require(_0x8a1e('0x8'));var client=jayson['client'][_0x8a1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1463b3,_0xeaba17,_0x238e9e){return new BPromise(function(_0x483e06,_0x14f902){return client[_0x8a1e('0xa')](_0x1463b3,_0x238e9e)[_0x8a1e('0xb')](function(_0x537de3){logger[_0x8a1e('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0xeaba17,_0x8a1e('0xd'));logger[_0x8a1e('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xeaba17,'request\x20sent',JSON[_0x8a1e('0xf')](_0x537de3));if(_0x537de3[_0x8a1e('0x10')]){if(_0x537de3[_0x8a1e('0x10')][_0x8a1e('0x11')]===0x1f4){logger[_0x8a1e('0x10')](_0x8a1e('0x12'),_0xeaba17,_0x537de3[_0x8a1e('0x10')]['message']);return _0x14f902(_0x537de3[_0x8a1e('0x10')][_0x8a1e('0x13')]);}logger[_0x8a1e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0xeaba17,_0x537de3[_0x8a1e('0x10')][_0x8a1e('0x13')]);return _0x483e06(_0x537de3[_0x8a1e('0x10')]['message']);}else{logger[_0x8a1e('0xc')](_0x8a1e('0x12'),_0xeaba17,_0x8a1e('0xd'));_0x483e06(_0x537de3['result']['message']);}})['catch'](function(_0x3d7dc0){logger[_0x8a1e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0xeaba17,_0x3d7dc0);_0x14f902(_0x3d7dc0);});});} \ No newline at end of file +var _0x8248=['../../config/environment','jayson/promise','client','http','request','then','debug','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5952dc,_0x38808a){var _0x1f03af=function(_0x23df4c){while(--_0x23df4c){_0x5952dc['push'](_0x5952dc['shift']());}};_0x1f03af(++_0x38808a);}(_0x8248,0x67));var _0x8824=function(_0x18a780,_0x341617){_0x18a780=_0x18a780-0x0;var _0x438d20=_0x8248[_0x18a780];return _0x438d20;};'use strict';var _=require(_0x8824('0x0'));var util=require(_0x8824('0x1'));var moment=require('moment');var BPromise=require(_0x8824('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8824('0x3'));var db=require(_0x8824('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8824('0x5'))(_0x8824('0x6'));var config=require(_0x8824('0x7'));var jayson=require(_0x8824('0x8'));var client=jayson[_0x8824('0x9')][_0x8824('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x118b0e,_0x23cad4,_0x1771ec){return new BPromise(function(_0x28c64f,_0x5a1d76){return client[_0x8824('0xb')](_0x118b0e,_0x1771ec)[_0x8824('0xc')](function(_0xfb2d4a){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x23cad4,'request\x20sent');logger[_0x8824('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x23cad4,'request\x20sent',JSON['stringify'](_0xfb2d4a));if(_0xfb2d4a[_0x8824('0xe')]){if(_0xfb2d4a[_0x8824('0xe')][_0x8824('0xf')]===0x1f4){logger['error'](_0x8824('0x10'),_0x23cad4,_0xfb2d4a['error'][_0x8824('0x11')]);return _0x5a1d76(_0xfb2d4a['error'][_0x8824('0x11')]);}logger[_0x8824('0xe')](_0x8824('0x10'),_0x23cad4,_0xfb2d4a[_0x8824('0xe')][_0x8824('0x11')]);return _0x28c64f(_0xfb2d4a[_0x8824('0xe')][_0x8824('0x11')]);}else{logger[_0x8824('0x12')](_0x8824('0x10'),_0x23cad4,_0x8824('0x13'));_0x28c64f(_0xfb2d4a[_0x8824('0x14')][_0x8824('0x11')]);}})[_0x8824('0x15')](function(_0x21ebd4){logger['error'](_0x8824('0x10'),_0x23cad4,_0x21ebd4);_0x5a1d76(_0x21ebd4);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 89a88f1..6a5202b 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 _0x01bc=['show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x01bc,0xc2));var _0xc01b=function(_0x23e09e,_0x259472){_0x23e09e=_0x23e09e-0x0;var _0x323e66=_0x01bc[_0x23e09e];return _0x323e66;};'use strict';var multer=require('multer');var util=require(_0xc01b('0x0'));var path=require(_0xc01b('0x1'));var timeout=require(_0xc01b('0x2'));var express=require(_0xc01b('0x3'));var router=express[_0xc01b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc01b('0x5'));var interaction=require(_0xc01b('0x6'));var config=require(_0xc01b('0x7'));var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc01b('0x8')]);router[_0xc01b('0x9')](_0xc01b('0xa'),auth[_0xc01b('0xb')](),controller[_0xc01b('0xc')]);router['get'](_0xc01b('0xd'),auth[_0xc01b('0xb')](),controller[_0xc01b('0xe')]);router[_0xc01b('0x9')]('/:id/download',auth[_0xc01b('0xb')](),controller[_0xc01b('0xf')]);router[_0xc01b('0x9')](_0xc01b('0x10'),controller['downloads']);router[_0xc01b('0x9')](_0xc01b('0x11'),auth['isAuthenticated'](),controller[_0xc01b('0x12')]);router['post']('/',auth[_0xc01b('0xb')](),controller[_0xc01b('0x13')]);router[_0xc01b('0x14')](_0xc01b('0x11'),auth[_0xc01b('0xb')](),controller[_0xc01b('0x15')]);router[_0xc01b('0x16')](_0xc01b('0xd'),auth[_0xc01b('0xb')](),controller[_0xc01b('0x17')]);router[_0xc01b('0x18')](_0xc01b('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc01b('0x19')]=router; \ No newline at end of file +var _0x58b6=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id','isAuthenticated','show','downloads','downloadTranscribe','post','create','/:id/transcribe','put','update','destroy','exports','multer'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x58b6,0x1b4));var _0x658b=function(_0x5843ba,_0x341d51){_0x5843ba=_0x5843ba-0x0;var _0x5eb21f=_0x58b6[_0x5843ba];return _0x5eb21f;};'use strict';var multer=require(_0x658b('0x0'));var util=require('util');var path=require(_0x658b('0x1'));var timeout=require(_0x658b('0x2'));var express=require(_0x658b('0x3'));var router=express[_0x658b('0x4')]();var fs_extra=require(_0x658b('0x5'));var auth=require(_0x658b('0x6'));var interaction=require(_0x658b('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x658b('0x8')](_0x658b('0x9'),auth['isAuthenticated'](),controller[_0x658b('0xa')]);router[_0x658b('0x8')](_0x658b('0xb'),auth[_0x658b('0xc')](),controller[_0x658b('0xd')]);router[_0x658b('0x8')]('/:id/download',auth[_0x658b('0xc')](),controller['download']);router[_0x658b('0x8')]('/:id/downloads',controller[_0x658b('0xe')]);router[_0x658b('0x8')]('/:id/transcribe',auth[_0x658b('0xc')](),controller[_0x658b('0xf')]);router[_0x658b('0x10')]('/',auth['isAuthenticated'](),controller[_0x658b('0x11')]);router[_0x658b('0x10')](_0x658b('0x12'),auth[_0x658b('0xc')](),controller['runTranscribe']);router[_0x658b('0x13')](_0x658b('0xb'),auth[_0x658b('0xc')](),controller[_0x658b('0x14')]);router['delete'](_0x658b('0xb'),auth[_0x658b('0xc')](),controller[_0x658b('0x15')]);module[_0x658b('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 87e903f..4d2fed9 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 127e937..300f909 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 _0x91a8=['downloadTranscribe','fileText','root','.txt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','map','format','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','downloads','sequelize','MD5','col','$and','push','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile'];(function(_0x3a67a2,_0x2d118a){var _0x140acb=function(_0x191765){while(--_0x191765){_0x3a67a2['push'](_0x3a67a2['shift']());}};_0x140acb(++_0x2d118a);}(_0x91a8,0x9f));var _0x891a=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x91a8[_0x220dbb];return _0x2b77de;};'use strict';var emlformat=require(_0x891a('0x0'));var rimraf=require(_0x891a('0x1'));var zipdir=require(_0x891a('0x2'));var jsonpatch=require(_0x891a('0x3'));var rp=require('request-promise');var moment=require(_0x891a('0x4'));var BPromise=require(_0x891a('0x5'));var Mustache=require(_0x891a('0x6'));var util=require(_0x891a('0x7'));var path=require(_0x891a('0x8'));var sox=require(_0x891a('0x9'));var csv=require(_0x891a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x891a('0xb'));var _=require(_0x891a('0xc'));var squel=require('squel');var crypto=require(_0x891a('0xd'));var jsforce=require(_0x891a('0xe'));var deskjs=require(_0x891a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x891a('0x10'));var Papa=require(_0x891a('0x11'));var AWS=require(_0x891a('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x891a('0x13'));var qs=require(_0x891a('0x14'));var as=require(_0x891a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x891a('0x16'))(_0x891a('0x17'));var utils=require(_0x891a('0x18'));var config=require(_0x891a('0x19'));var licenseUtil=require(_0x891a('0x1a'));var db=require(_0x891a('0x1b'))['db'];function respondWithStatusCode(_0x26cac6,_0x4b6457){_0x4b6457=_0x4b6457||0xcc;return function(_0x1fc4e1){if(_0x1fc4e1){return _0x26cac6['sendStatus'](_0x4b6457);}return _0x26cac6[_0x891a('0x1c')](_0x4b6457)['end']();};}function respondWithResult(_0x1b372d,_0x427db5){_0x427db5=_0x427db5||0xc8;return function(_0xaff657){if(_0xaff657){return _0x1b372d[_0x891a('0x1c')](_0x427db5)[_0x891a('0x1d')](_0xaff657);}};}function respondWithFilteredResult(_0x49abdb,_0x1eccd9){return function(_0x1b5a28){if(_0x1b5a28){var _0x4913de=typeof _0x1eccd9[_0x891a('0x1e')]==='undefined'&&typeof _0x1eccd9[_0x891a('0x1f')]===_0x891a('0x20');var _0x1e13e8=_0x1b5a28[_0x891a('0x21')];var _0x54a0f3=_0x4913de?0x0:_0x1eccd9[_0x891a('0x1e')];var _0x329a83=_0x4913de?_0x1b5a28['count']:_0x1eccd9[_0x891a('0x1e')]+_0x1eccd9['limit'];var _0x25e21c;if(_0x329a83>=_0x1e13e8){_0x329a83=_0x1e13e8;_0x25e21c=0xc8;}else{_0x25e21c=0xce;}_0x49abdb[_0x891a('0x1c')](_0x25e21c);return _0x49abdb[_0x891a('0x22')](_0x891a('0x23'),_0x54a0f3+'-'+_0x329a83+'/'+_0x1e13e8)[_0x891a('0x1d')](_0x1b5a28);}return null;};}function patchUpdates(_0x1acd88){return function(_0x20c15a){try{jsonpatch[_0x891a('0x24')](_0x20c15a,_0x1acd88,!![]);}catch(_0x59e6b2){return BPromise[_0x891a('0x25')](_0x59e6b2);}return _0x20c15a['save']();};}function saveUpdates(_0xd1302a,_0x4adad3){return function(_0x1c7188){if(_0x1c7188){return _0x1c7188[_0x891a('0x26')](_0xd1302a)[_0x891a('0x27')](function(_0x2bf6d4){return _0x2bf6d4;});}return null;};}function removeEntity(_0x15c251,_0x548315){return function(_0x2a6d6a){if(_0x2a6d6a){return _0x2a6d6a[_0x891a('0x28')]()[_0x891a('0x27')](function(){_0x15c251[_0x891a('0x1c')](0xcc)[_0x891a('0x29')]();});}};}function handleEntityNotFound(_0x51f4c6,_0x4102ab){return function(_0x2c6f24){if(!_0x2c6f24){_0x51f4c6[_0x891a('0x2a')](0x194);}return _0x2c6f24;};}function handleError(_0x33b455,_0x25c5c6){_0x25c5c6=_0x25c5c6||0x1f4;return function(_0x420d95){logger['error'](_0x420d95[_0x891a('0x2b')]);if(_0x420d95[_0x891a('0x2c')]){delete _0x420d95['name'];}_0x33b455[_0x891a('0x1c')](_0x25c5c6)[_0x891a('0x2d')](_0x420d95);};}exports['index']=function(_0x42e785,_0x2d1469){var _0x3d8738={},_0x16d957={},_0x2a3955={'count':0x0,'rows':[]};var _0x3b844a=_['map'](db[_0x891a('0x2e')][_0x891a('0x2f')],function(_0x4993a1){return{'name':_0x4993a1[_0x891a('0x30')],'type':_0x4993a1[_0x891a('0x31')][_0x891a('0x32')]};});_0x16d957[_0x891a('0x33')]=_[_0x891a('0x34')](_[_0x891a('0x35')](_0x3b844a,_0x891a('0x2c')),[_0x891a('0x36')]);_0x16d957[_0x891a('0x37')]=_[_0x891a('0x38')](_0x42e785[_0x891a('0x37')]);_0x16d957[_0x891a('0x39')]=_[_0x891a('0x3a')](_0x16d957[_0x891a('0x33')],_0x16d957[_0x891a('0x37')]);_0x3d8738['attributes']=_[_0x891a('0x3a')](_0x16d957['model'],qs[_0x891a('0x3b')](_0x42e785['query'][_0x891a('0x3b')]));_0x3d8738['attributes']=_0x3d8738['attributes'][_0x891a('0x3c')]?_0x3d8738[_0x891a('0x3d')]:_0x16d957[_0x891a('0x33')];if(!_0x42e785[_0x891a('0x37')][_0x891a('0x3e')](_0x891a('0x3f'))){_0x3d8738[_0x891a('0x1f')]=qs['limit'](_0x42e785[_0x891a('0x37')][_0x891a('0x1f')]);_0x3d8738[_0x891a('0x1e')]=qs[_0x891a('0x1e')](_0x42e785[_0x891a('0x37')][_0x891a('0x1e')]);}_0x3d8738[_0x891a('0x40')]=qs['sort'](_0x42e785[_0x891a('0x37')][_0x891a('0x41')]);_0x3d8738['where']=qs[_0x891a('0x39')](_['pick'](_0x42e785[_0x891a('0x37')],_0x16d957[_0x891a('0x39')]),_0x3b844a);if(_0x42e785[_0x891a('0x37')][_0x891a('0x42')]){_0x3d8738[_0x891a('0x43')]=_['merge'](_0x3d8738[_0x891a('0x43')],{'$or':_[_0x891a('0x35')](_0x3b844a,function(_0x2d7810){if(_0x2d7810[_0x891a('0x31')]!==_0x891a('0x44')){var _0x21b552={};_0x21b552[_0x2d7810['name']]={'$like':'%'+_0x42e785['query']['filter']+'%'};return _0x21b552;}})});}_0x3d8738=_['merge']({},_0x3d8738,_0x42e785[_0x891a('0x45')]);var _0x4cf090={'where':_0x3d8738[_0x891a('0x43')]};return db['VoiceRecording'][_0x891a('0x21')](_0x4cf090)[_0x891a('0x27')](function(_0x332799){_0x2a3955[_0x891a('0x21')]=_0x332799;if(_0x42e785[_0x891a('0x37')][_0x891a('0x46')]){_0x3d8738['include']=[{'all':!![]}];}return db[_0x891a('0x2e')][_0x891a('0x47')](_0x3d8738);})[_0x891a('0x27')](function(_0x7e96af){_0x2a3955['rows']=_0x7e96af;return _0x2a3955;})[_0x891a('0x27')](respondWithFilteredResult(_0x2d1469,_0x3d8738))[_0x891a('0x48')](handleError(_0x2d1469,null));};exports[_0x891a('0x49')]=function(_0x1fbddf,_0x5cbe2b){var _0x36ad6a={'raw':![],'where':{'id':_0x1fbddf[_0x891a('0x4a')]['id']}},_0x6a91b5={};_0x6a91b5[_0x891a('0x33')]=_[_0x891a('0x38')](db[_0x891a('0x2e')][_0x891a('0x2f')]);_0x6a91b5[_0x891a('0x37')]=_[_0x891a('0x38')](_0x1fbddf[_0x891a('0x37')]);_0x6a91b5[_0x891a('0x39')]=_[_0x891a('0x3a')](_0x6a91b5[_0x891a('0x33')],_0x6a91b5[_0x891a('0x37')]);_0x36ad6a[_0x891a('0x3d')]=_['intersection'](_0x6a91b5[_0x891a('0x33')],qs[_0x891a('0x3b')](_0x1fbddf[_0x891a('0x37')]['fields']));_0x36ad6a[_0x891a('0x3d')]=_0x36ad6a['attributes']['length']?_0x36ad6a[_0x891a('0x3d')]:_0x6a91b5[_0x891a('0x33')];if(_0x1fbddf[_0x891a('0x37')][_0x891a('0x46')]){_0x36ad6a[_0x891a('0x4b')]=[{'all':!![]}];}_0x36ad6a=_['merge']({},_0x36ad6a,_0x1fbddf[_0x891a('0x45')]);return db[_0x891a('0x2e')][_0x891a('0x4c')](_0x36ad6a)['then'](handleEntityNotFound(_0x5cbe2b,null))[_0x891a('0x27')](respondWithResult(_0x5cbe2b,null))[_0x891a('0x48')](handleError(_0x5cbe2b,null));};exports[_0x891a('0x4d')]=function(_0x4fbb31,_0xa2bce7){return db[_0x891a('0x2e')]['create'](_0x4fbb31[_0x891a('0x4e')],{})[_0x891a('0x27')](respondWithResult(_0xa2bce7,0xc9))[_0x891a('0x48')](handleError(_0xa2bce7,null));};exports[_0x891a('0x26')]=function(_0x230b1e,_0x582251){if(_0x230b1e[_0x891a('0x4e')]['id']){delete _0x230b1e[_0x891a('0x4e')]['id'];}return db[_0x891a('0x2e')][_0x891a('0x4c')]({'where':{'id':_0x230b1e[_0x891a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582251,null))[_0x891a('0x27')](saveUpdates(_0x230b1e[_0x891a('0x4e')],null))['then'](respondWithResult(_0x582251,null))[_0x891a('0x48')](handleError(_0x582251,null));};exports[_0x891a('0x4f')]=function(_0x18255e,_0x1146dd){return db['VoiceRecording']['describe']()['then'](respondWithResult(_0x1146dd,null))[_0x891a('0x48')](handleError(_0x1146dd,null));};exports['download']=function(_0x42f112,_0x5d8292,_0x2b4a96){var _0x55ee2f=require(_0x891a('0x50'));var _0x5aaeb6=![];var _0x3fe795={};if(_0x42f112[_0x891a('0x37')][_0x891a('0x31')]&&_0x42f112[_0x891a('0x37')][_0x891a('0x31')]===_0x891a('0x51')){_0x3fe795[_0x891a('0x51')]=_0x42f112[_0x891a('0x4a')]['id'];}else{_0x3fe795['id']=_0x42f112[_0x891a('0x4a')]['id'];}return db['VoiceRecording'][_0x891a('0x4c')]({'where':_0x3fe795,'attributes':['id',_0x891a('0x52')],'raw':!![]})[_0x891a('0x27')](handleEntityNotFound(_0x5d8292,null))[_0x891a('0x27')](function(_0x6c9d02){if(_0x6c9d02){var _0x548c14=_0x6c9d02['value'];var _0x5acecd=util[_0x891a('0x36')](_0x891a('0x53'),_0x548c14);if(fs[_0x891a('0x54')](_0x5acecd)){_0x5aaeb6=!![];return _0x55ee2f[_0x891a('0x55')](_0x5acecd,_0x548c14,config['secrets'][_0x891a('0x56')])['then'](function(){return _0x6c9d02;});}return _0x6c9d02;}})[_0x891a('0x27')](function(_0x49f500){if(_0x49f500){var _0x4153ad=_0x49f500[_0x891a('0x52')];if(!fs[_0x891a('0x54')](_0x4153ad)){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))](_0x891a('0x59'));}if(_0x49f500[_0x891a('0x5a')]){return _0x5d8292[_0x891a('0x5b')](_0x4153ad,_0x49f500['filename']+path[_0x891a('0x5c')](_0x4153ad),function(){if(_0x5aaeb6){fs[_0x891a('0x5d')](_0x4153ad);}});}else{return _0x5d8292['download'](_0x4153ad,function(_0x13e7e8){if(_0x5aaeb6){fs[_0x891a('0x5d')](_0x4153ad);}});}}})[_0x891a('0x48')](function(_0x3607ad){if(_0x3607ad[_0x891a('0x5e')]===_0x891a('0x59')){_0x5d8292[_0x891a('0x1c')](0x194)[_0x891a('0x2d')]('Not\x20found');}else{return handleError(_0x5d8292,null);}});};exports[_0x891a('0x5f')]=function(_0x1c83fa,_0x1ac0a2,_0x545ce9){var _0x16eb16=require(_0x891a('0x50'));var _0x49ec7e=![];var _0x5c47f7={'$and':[db[_0x891a('0x60')][_0x891a('0x43')](db[_0x891a('0x60')]['fn'](_0x891a('0x61'),db['sequelize'][_0x891a('0x62')]('uniqueid')),_0x1c83fa[_0x891a('0x37')]['token'])]};if(_0x1c83fa[_0x891a('0x37')][_0x891a('0x31')]&&_0x1c83fa[_0x891a('0x37')][_0x891a('0x31')]===_0x891a('0x51')){_0x5c47f7[_0x891a('0x63')][_0x891a('0x64')]({'uniqueid':_0x1c83fa[_0x891a('0x4a')]['id']});}else{_0x5c47f7[_0x891a('0x63')][_0x891a('0x64')]({'id':_0x1c83fa[_0x891a('0x4a')]['id']});}return db[_0x891a('0x2e')][_0x891a('0x4c')]({'where':_0x5c47f7,'attributes':['id',_0x891a('0x52')],'raw':!![]})[_0x891a('0x27')](handleEntityNotFound(_0x1ac0a2,null))[_0x891a('0x27')](function(_0x4c38f1){if(_0x4c38f1){var _0x34436a=util[_0x891a('0x36')](_0x891a('0x53'),_0x4c38f1[_0x891a('0x52')]);if(fs[_0x891a('0x54')](_0x34436a)){_0x49ec7e=!![];return _0x16eb16[_0x891a('0x55')](_0x34436a,_0x4c38f1[_0x891a('0x52')],config[_0x891a('0x65')]['recording'])['then'](function(){return _0x4c38f1;});}return _0x4c38f1;}})[_0x891a('0x27')](function(_0x110a7f){if(_0x110a7f){if(!fs[_0x891a('0x54')](_0x110a7f[_0x891a('0x52')])){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))](_0x891a('0x59'));}if(_0x110a7f[_0x891a('0x5a')]){return _0x1ac0a2[_0x891a('0x5b')](_0x110a7f[_0x891a('0x52')],_0x110a7f[_0x891a('0x5a')]+path[_0x891a('0x5c')](_0x110a7f[_0x891a('0x52')]),function(){if(_0x49ec7e){fs[_0x891a('0x5d')](_0x110a7f[_0x891a('0x52')]);}});}else{return _0x1ac0a2['download'](_0x110a7f['value'],function(_0x2aae19){if(_0x49ec7e){fs[_0x891a('0x5d')](_0x110a7f[_0x891a('0x52')]);}});}}})[_0x891a('0x48')](handleError(_0x1ac0a2,null));};exports['destroy']=function(_0x510eb,_0x1249aa){return db[_0x891a('0x2e')]['find']({'where':{'id':_0x510eb[_0x891a('0x4a')]['id']}})[_0x891a('0x27')](function(_0x356188){if(_[_0x891a('0x66')](_0x356188)){throw new ReferenceError(_0x891a('0x67'));}return _0x356188;})['then'](function(_0x44259e){var _0x2e638=_0x44259e['value'];logger[_0x891a('0x68')](_0x891a('0x69'),_0x2e638);if(!_['isNil'](_0x44259e[_0x891a('0x52')])&&fs[_0x891a('0x54')](_0x2e638)){logger['info'](_0x891a('0x6a')+_0x2e638+_0x891a('0x6b'));fs['unlinkSync'](_0x2e638);}_0x2e638=_0x2e638+_0x891a('0x6c');if(!_[_0x891a('0x66')](_0x44259e[_0x891a('0x52')])&&fs[_0x891a('0x54')](_0x2e638)){logger[_0x891a('0x68')]('File:\x20\x22'+_0x2e638+_0x891a('0x6b'));fs['unlinkSync'](_0x2e638);}return _0x44259e;})[_0x891a('0x27')](function(_0x77371c){if(!_0x77371c)throw new InternalError();return _0x77371c[_0x891a('0x28')]();})['then'](function(){_0x1249aa[_0x891a('0x1c')](0xcc)[_0x891a('0x29')]();})['catch'](handleError(_0x1249aa,null));};function getBucketslist(_0x2fbea5,_0x201a8c,_0x22e56e){return new Promise(function(_0x16417b,_0x4067b9){var _0x5ddcf8=new AWS['S3']({'accessKeyId':_0x201a8c,'secretAccessKey':_0x2fbea5,'region':_0x22e56e});_0x5ddcf8['listBuckets']({},function(_0x5bc7f1,_0x152a6c){if(_0x5bc7f1){return _0x4067b9(_0x5bc7f1);}else{return _0x16417b(_0x152a6c);}});});}function createBucket(_0x4b2b2c,_0x2db4ec,_0x1cbe3d,_0x106cdb){return new Promise(function(_0x3f5592,_0x2a8eb1){var _0x49f2d4=new AWS['S3']({'accessKeyId':_0x2db4ec,'secretAccessKey':_0x4b2b2c,'region':_0x1cbe3d});_0x49f2d4[_0x891a('0x6d')]({'Bucket':_0x106cdb},function(_0x166f95,_0x8af82c){if(_0x166f95){return _0x2a8eb1(_0x166f95);}else{return _0x3f5592(_0x8af82c);}});});}function uploadFile(_0x3f2d42,_0x51a779,_0x4b80ba,_0x455557,_0x361b76,_0xa0602a){return new Promise(function(_0xd0d312,_0xa3279f){var _0x2d02f1=new AWS['S3']({'accessKeyId':_0x51a779,'secretAccessKey':_0x3f2d42,'region':_0x4b80ba});_0x2d02f1[_0x891a('0x6e')]({'Bucket':_0x455557,'Key':_0x361b76,'Body':_0xa0602a},function(_0x77f720,_0x2cb5d7){if(_0x77f720){return _0xa3279f(_0x77f720);}else{return _0xd0d312(_0x2cb5d7);}});});}function startTranscribe(_0x133c03,_0x158697,_0x221c09,_0x2776e1,_0x40d870,_0x275a79){return new Promise(function(_0x2bcc86,_0xc9277){var _0x20926a=new AWS['TranscribeService']({'accessKeyId':_0x158697,'secretAccessKey':_0x133c03,'region':_0x221c09});_0x20926a['startTranscriptionJob']({'TranscriptionJobName':_0x2776e1,'LanguageCode':_0x40d870,'Media':{'MediaFileUri':_0x275a79}},function(_0x5631e0,_0x288e63){if(_0x5631e0){return _0xc9277(_0x5631e0);}else{return _0x2bcc86(_0x288e63);}});});}function transcribe(_0x5ec59e,_0x51e427,_0x3e4c02,_0x4b0476,_0xffd5c3,_0xedac24,_0xbcee62){return new Promise(function(_0x46e58f,_0x41d68d){var _0x20b6ab={};logger['info'](util['format'](_0x891a('0x6f'),_0x5ec59e,_0xffd5c3));return uploadFile(_0x51e427,_0x3e4c02,_0x4b0476,_0xffd5c3,path[_0x891a('0x70')](_0xedac24),fs[_0x891a('0x71')](_0xedac24))[_0x891a('0x27')](function(_0x4d738b){logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x72'),_0x5ec59e,_0xffd5c3,_0x4d738b[_0x891a('0x73')]));_0x20b6ab[_0x891a('0x74')]=_0x4d738b['Bucket'];_0x20b6ab[_0x891a('0x75')]=_0x4d738b[_0x891a('0x73')];logger[_0x891a('0x68')](util['format'](_0x891a('0x76'),_0x5ec59e));return startTranscribe(_0x51e427,_0x3e4c02,_0x4b0476,uuidv4(),_0xbcee62,_0x4d738b['Location']);})['then'](function(_0x3c85ed){logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x77'),_0x5ec59e,_0x3c85ed[_0x891a('0x78')][_0x891a('0x79')]));_0x20b6ab[_0x891a('0x7a')]=_0x3c85ed['TranscriptionJob'][_0x891a('0x79')];_0x20b6ab['transcribeStatus']=_0x3c85ed[_0x891a('0x78')][_0x891a('0x7b')];return _0x46e58f(_0x20b6ab);})['catch'](function(_0x1972ef){return _0x41d68d(_0x1972ef);});});}exports[_0x891a('0x7c')]=function(_0x13ca2c,_0x458ed1,_0x584c3b){var _0x4707b7;var _0x1e0bb4;var _0xd18397;var _0x31ccac=require(_0x891a('0x50'));return db[_0x891a('0x2e')][_0x891a('0x7d')]({'where':{'id':_0x13ca2c[_0x891a('0x4a')]['id']}})['then'](function(_0x426714){if(_0x426714){var _0x5472e0=util[_0x891a('0x36')](_0x891a('0x53'),_0x426714['value']);if(fs[_0x891a('0x54')](_0x5472e0)){cypher=!![];return _0x31ccac['decryptFile'](_0x5472e0,_0x426714[_0x891a('0x52')],config['secrets'][_0x891a('0x56')])[_0x891a('0x27')](function(){return _0x426714;});}return _0x426714;}})['then'](function(_0x49a4e5){if(!_0x49a4e5){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))]('Voice\x20Recording\x20not\x20found');}_0x1e0bb4=_0x49a4e5;return db[_0x891a('0x7e')][_0x891a('0x7d')]({'where':{'id':0x1}});})[_0x891a('0x27')](handleEntityNotFound(_0x458ed1,null))['then'](function(_0x36483c){if(_0x36483c){_0x4707b7=_0x36483c;if(!_0x4707b7[_0x891a('0x7f')]||!_0x4707b7[_0x891a('0x80')]||!_0x4707b7['transcribeRegion']||!_0x4707b7[_0x891a('0x81')]||!_0x4707b7[_0x891a('0x74')]){throw new db[(_0x891a('0x57'))][(_0x891a('0x58'))](_0x891a('0x82'));}if(_0x13ca2c[_0x891a('0x4e')][_0x891a('0x83')]&&(!_0x4707b7[_0x891a('0x84')]||!_0x4707b7[_0x891a('0x85')]||!_0x4707b7[_0x891a('0x86')]||!_0x4707b7[_0x891a('0x81')]||!_0x4707b7[_0x891a('0x74')])){throw new db[(_0x891a('0x57'))]['ValidationError'](_0x891a('0x87'));}return db[_0x891a('0x88')]['findOne']({'where':{'id':_0x4707b7[_0x891a('0x80')]}});}})[_0x891a('0x27')](function(_0x2bfdbd){if(!_0x2bfdbd){throw new db[(_0x891a('0x57'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2bfdbd[_0x891a('0x89')]||!_0x2bfdbd['data2']){throw new db[(_0x891a('0x57'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0xd18397=_0x2bfdbd;return getBucketslist(_0xd18397[_0x891a('0x89')],_0xd18397[_0x891a('0x8a')],_0x4707b7[_0x891a('0x8b')]);})['then'](function(_0x56fdfc){if(_0x56fdfc&&_0x56fdfc[_0x891a('0x8c')]){var _0x49eaac=_[_0x891a('0x4c')](_0x56fdfc[_0x891a('0x8c')],function(_0x31800c){return _0x31800c[_0x891a('0x8d')]===_0x4707b7[_0x891a('0x74')];});if(!_0x49eaac){logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x8e'),_0x13ca2c[_0x891a('0x4a')]['id'],_0x4707b7[_0x891a('0x74')]));return createBucket(_0xd18397[_0x891a('0x89')],_0xd18397[_0x891a('0x8a')],_0x4707b7[_0x891a('0x8b')],_0x4707b7[_0x891a('0x74')]);}logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x8f'),_0x13ca2c[_0x891a('0x4a')]['id'],_0x4707b7[_0x891a('0x74')]));return;}})['then'](function(_0x5c9dba){if(_0x1e0bb4[_0x891a('0x90')]===_0x891a('0x91')){return transcribe(_0x13ca2c['params']['id'],_0xd18397[_0x891a('0x89')],_0xd18397['data2'],_0x4707b7['transcribeRegion'],_0x4707b7[_0x891a('0x74')],_0x1e0bb4[_0x891a('0x52')],_0x4707b7[_0x891a('0x81')]);}else{logger[_0x891a('0x68')](util[_0x891a('0x36')](_0x891a('0x92'),_0x13ca2c[_0x891a('0x4a')]['id']));return{'transcribeStatus':_0x891a('0x93')};}})[_0x891a('0x27')](function(_0x3eaf62){if(_0x3eaf62){_0x3eaf62[_0x891a('0x94')]=_0x13ca2c[_0x891a('0x4e')][_0x891a('0x83')];return _0x1e0bb4[_0x891a('0x95')](_0x3eaf62);}})[_0x891a('0x27')](respondWithResult(_0x458ed1,null))[_0x891a('0x48')](handleError(_0x458ed1,null));};function writeFile(_0x120650,_0x13c842){return new Promise(function(_0x336520,_0x28a8bb){fs[_0x891a('0x96')](_0x13c842,_0x120650,function(_0x2bf144,_0x1860e0){if(_0x2bf144){return _0x28a8bb(_0x2bf144);}else{return _0x336520(_0x1860e0);}});});}exports[_0x891a('0x97')]=function(_0x416673,_0xbb34,_0x4ac386){return db[_0x891a('0x2e')][_0x891a('0x7d')]({'where':{'id':_0x416673[_0x891a('0x4a')]['id']}})[_0x891a('0x27')](handleEntityNotFound(_0xbb34))[_0x891a('0x27')](function(_0x1c58d3){if(_0x1c58d3&&_0x1c58d3[_0x891a('0x98')]){var _0x28852b=_0x1c58d3[_0x891a('0x98')];var _0x598ec6=config[_0x891a('0x99')]+'/server/files/transcribes/transcribe_'+_0x1c58d3['id']+_0x891a('0x9a');if(fs[_0x891a('0x54')](_0x598ec6)){return _0x598ec6;}return writeFile(_0x28852b,_0x598ec6)['then'](function(){return _0x598ec6;});}else{throw new db['Sequelize']['ValidationError']('Transcript\x20not\x20available');}})[_0x891a('0x27')](function(_0x284d9b){return _0xbb34[_0x891a('0x5b')](_0x284d9b);})[_0x891a('0x48')](handleError(_0xbb34));}; \ No newline at end of file +var _0x65cd=['ValidationError','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','MD5','sequelize','col','token','push','$and','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','listBuckets','createBucket','TranscribeService','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','findOne'];(function(_0x374dd6,_0xadc0eb){var _0x1aadd0=function(_0x3b87be){while(--_0x3b87be){_0x374dd6['push'](_0x374dd6['shift']());}};_0x1aadd0(++_0xadc0eb);}(_0x65cd,0x1dd));var _0xd65c=function(_0xa9d9c4,_0x2cfe0c){_0xa9d9c4=_0xa9d9c4-0x0;var _0x18d97e=_0x65cd[_0xa9d9c4];return _0x18d97e;};'use strict';var emlformat=require(_0xd65c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd65c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd65c('0x2'));var moment=require(_0xd65c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd65c('0x4'));var util=require(_0xd65c('0x5'));var path=require('path');var sox=require(_0xd65c('0x6'));var csv=require(_0xd65c('0x7'));var ejs=require(_0xd65c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd65c('0x9'));var crypto=require('crypto');var jsforce=require(_0xd65c('0xa'));var deskjs=require(_0xd65c('0xb'));var toCsv=require(_0xd65c('0x7'));var querystring=require(_0xd65c('0xc'));var Papa=require(_0xd65c('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0xd65c('0xe'));var Redis=require(_0xd65c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd65c('0x10'));var as=require(_0xd65c('0x11'));var hardwareService=require(_0xd65c('0x12'));var logger=require(_0xd65c('0x13'))(_0xd65c('0x14'));var utils=require('../../config/utils');var config=require(_0xd65c('0x15'));var licenseUtil=require(_0xd65c('0x16'));var db=require(_0xd65c('0x17'))['db'];function respondWithStatusCode(_0x728de3,_0x45a625){_0x45a625=_0x45a625||0xcc;return function(_0x1d35a6){if(_0x1d35a6){return _0x728de3[_0xd65c('0x18')](_0x45a625);}return _0x728de3[_0xd65c('0x19')](_0x45a625)['end']();};}function respondWithResult(_0x59cad6,_0x2f6c21){_0x2f6c21=_0x2f6c21||0xc8;return function(_0x53e70e){if(_0x53e70e){return _0x59cad6[_0xd65c('0x19')](_0x2f6c21)[_0xd65c('0x1a')](_0x53e70e);}};}function respondWithFilteredResult(_0x4cc57b,_0x7c5610){return function(_0x2e67a0){if(_0x2e67a0){var _0x22b2db=typeof _0x7c5610[_0xd65c('0x1b')]===_0xd65c('0x1c')&&typeof _0x7c5610[_0xd65c('0x1d')]===_0xd65c('0x1c');var _0x402aa9=_0x2e67a0[_0xd65c('0x1e')];var _0x272131=_0x22b2db?0x0:_0x7c5610[_0xd65c('0x1b')];var _0x2ab805=_0x22b2db?_0x2e67a0[_0xd65c('0x1e')]:_0x7c5610['offset']+_0x7c5610[_0xd65c('0x1d')];var _0x32e0ff;if(_0x2ab805>=_0x402aa9){_0x2ab805=_0x402aa9;_0x32e0ff=0xc8;}else{_0x32e0ff=0xce;}_0x4cc57b[_0xd65c('0x19')](_0x32e0ff);return _0x4cc57b['set']('Content-Range',_0x272131+'-'+_0x2ab805+'/'+_0x402aa9)['json'](_0x2e67a0);}return null;};}function patchUpdates(_0x32baea){return function(_0x39075e){try{jsonpatch[_0xd65c('0x1f')](_0x39075e,_0x32baea,!![]);}catch(_0x378128){return BPromise[_0xd65c('0x20')](_0x378128);}return _0x39075e[_0xd65c('0x21')]();};}function saveUpdates(_0x4ea2f1,_0x423021){return function(_0x83a937){if(_0x83a937){return _0x83a937[_0xd65c('0x22')](_0x4ea2f1)[_0xd65c('0x23')](function(_0x5cbb65){return _0x5cbb65;});}return null;};}function removeEntity(_0x4c70d3,_0x1e1794){return function(_0x33b8c2){if(_0x33b8c2){return _0x33b8c2[_0xd65c('0x24')]()['then'](function(){_0x4c70d3[_0xd65c('0x19')](0xcc)[_0xd65c('0x25')]();});}};}function handleEntityNotFound(_0x5908da,_0x1e309c){return function(_0x27b562){if(!_0x27b562){_0x5908da['sendStatus'](0x194);}return _0x27b562;};}function handleError(_0x4d72ec,_0x247a51){_0x247a51=_0x247a51||0x1f4;return function(_0x441646){logger['error'](_0x441646[_0xd65c('0x26')]);if(_0x441646[_0xd65c('0x27')]){delete _0x441646[_0xd65c('0x27')];}_0x4d72ec[_0xd65c('0x19')](_0x247a51)[_0xd65c('0x28')](_0x441646);};}exports[_0xd65c('0x29')]=function(_0x22c67b,_0x5533bc){var _0x439f68={},_0x19291c={},_0x12ba40={'count':0x0,'rows':[]};var _0x52ed16=_[_0xd65c('0x2a')](db[_0xd65c('0x2b')][_0xd65c('0x2c')],function(_0x3bf92d){return{'name':_0x3bf92d['fieldName'],'type':_0x3bf92d[_0xd65c('0x2d')][_0xd65c('0x2e')]};});_0x19291c[_0xd65c('0x2f')]=_[_0xd65c('0x30')](_['map'](_0x52ed16,'name'),[_0xd65c('0x31')]);_0x19291c['query']=_[_0xd65c('0x32')](_0x22c67b[_0xd65c('0x33')]);_0x19291c[_0xd65c('0x34')]=_[_0xd65c('0x35')](_0x19291c[_0xd65c('0x2f')],_0x19291c[_0xd65c('0x33')]);_0x439f68[_0xd65c('0x36')]=_[_0xd65c('0x35')](_0x19291c[_0xd65c('0x2f')],qs[_0xd65c('0x37')](_0x22c67b[_0xd65c('0x33')][_0xd65c('0x37')]));_0x439f68[_0xd65c('0x36')]=_0x439f68[_0xd65c('0x36')][_0xd65c('0x38')]?_0x439f68[_0xd65c('0x36')]:_0x19291c[_0xd65c('0x2f')];if(!_0x22c67b[_0xd65c('0x33')][_0xd65c('0x39')](_0xd65c('0x3a'))){_0x439f68[_0xd65c('0x1d')]=qs[_0xd65c('0x1d')](_0x22c67b[_0xd65c('0x33')]['limit']);_0x439f68[_0xd65c('0x1b')]=qs[_0xd65c('0x1b')](_0x22c67b[_0xd65c('0x33')][_0xd65c('0x1b')]);}_0x439f68['order']=qs['sort'](_0x22c67b[_0xd65c('0x33')][_0xd65c('0x3b')]);_0x439f68[_0xd65c('0x3c')]=qs[_0xd65c('0x34')](_['pick'](_0x22c67b['query'],_0x19291c[_0xd65c('0x34')]),_0x52ed16);if(_0x22c67b[_0xd65c('0x33')][_0xd65c('0x3d')]){_0x439f68[_0xd65c('0x3c')]=_['merge'](_0x439f68[_0xd65c('0x3c')],{'$or':_['map'](_0x52ed16,function(_0x1bc858){if(_0x1bc858[_0xd65c('0x2d')]!==_0xd65c('0x3e')){var _0xd24616={};_0xd24616[_0x1bc858['name']]={'$like':'%'+_0x22c67b[_0xd65c('0x33')]['filter']+'%'};return _0xd24616;}})});}_0x439f68=_['merge']({},_0x439f68,_0x22c67b[_0xd65c('0x3f')]);var _0x53eebf={'where':_0x439f68[_0xd65c('0x3c')]};return db[_0xd65c('0x2b')][_0xd65c('0x1e')](_0x53eebf)[_0xd65c('0x23')](function(_0x521615){_0x12ba40['count']=_0x521615;if(_0x22c67b[_0xd65c('0x33')][_0xd65c('0x40')]){_0x439f68[_0xd65c('0x41')]=[{'all':!![]}];}return db[_0xd65c('0x2b')][_0xd65c('0x42')](_0x439f68);})[_0xd65c('0x23')](function(_0x25ae1c){_0x12ba40[_0xd65c('0x43')]=_0x25ae1c;return _0x12ba40;})[_0xd65c('0x23')](respondWithFilteredResult(_0x5533bc,_0x439f68))[_0xd65c('0x44')](handleError(_0x5533bc,null));};exports[_0xd65c('0x45')]=function(_0x3fb594,_0x3b67f8){var _0x9ea891={'raw':![],'where':{'id':_0x3fb594['params']['id']}},_0x2a2c1a={};_0x2a2c1a[_0xd65c('0x2f')]=_[_0xd65c('0x32')](db[_0xd65c('0x2b')][_0xd65c('0x2c')]);_0x2a2c1a['query']=_[_0xd65c('0x32')](_0x3fb594['query']);_0x2a2c1a[_0xd65c('0x34')]=_['intersection'](_0x2a2c1a[_0xd65c('0x2f')],_0x2a2c1a[_0xd65c('0x33')]);_0x9ea891[_0xd65c('0x36')]=_[_0xd65c('0x35')](_0x2a2c1a[_0xd65c('0x2f')],qs[_0xd65c('0x37')](_0x3fb594[_0xd65c('0x33')][_0xd65c('0x37')]));_0x9ea891[_0xd65c('0x36')]=_0x9ea891[_0xd65c('0x36')]['length']?_0x9ea891[_0xd65c('0x36')]:_0x2a2c1a['model'];if(_0x3fb594['query'][_0xd65c('0x40')]){_0x9ea891[_0xd65c('0x41')]=[{'all':!![]}];}_0x9ea891=_[_0xd65c('0x46')]({},_0x9ea891,_0x3fb594[_0xd65c('0x3f')]);return db[_0xd65c('0x2b')][_0xd65c('0x47')](_0x9ea891)[_0xd65c('0x23')](handleEntityNotFound(_0x3b67f8,null))[_0xd65c('0x23')](respondWithResult(_0x3b67f8,null))[_0xd65c('0x44')](handleError(_0x3b67f8,null));};exports[_0xd65c('0x48')]=function(_0x14bf85,_0xa39a60){return db[_0xd65c('0x2b')][_0xd65c('0x48')](_0x14bf85['body'],{})['then'](respondWithResult(_0xa39a60,0xc9))[_0xd65c('0x44')](handleError(_0xa39a60,null));};exports[_0xd65c('0x22')]=function(_0x21c825,_0x545eae){if(_0x21c825[_0xd65c('0x49')]['id']){delete _0x21c825['body']['id'];}return db[_0xd65c('0x2b')]['find']({'where':{'id':_0x21c825[_0xd65c('0x4a')]['id']}})[_0xd65c('0x23')](handleEntityNotFound(_0x545eae,null))[_0xd65c('0x23')](saveUpdates(_0x21c825[_0xd65c('0x49')],null))[_0xd65c('0x23')](respondWithResult(_0x545eae,null))['catch'](handleError(_0x545eae,null));};exports[_0xd65c('0x4b')]=function(_0xf3538b,_0x30a87c){return db[_0xd65c('0x2b')][_0xd65c('0x4b')]()['then'](respondWithResult(_0x30a87c,null))[_0xd65c('0x44')](handleError(_0x30a87c,null));};exports[_0xd65c('0x4c')]=function(_0x3d9ecc,_0x21de6f,_0x2191f2){var _0x4781bf=require(_0xd65c('0x4d'));var _0x1c78ef=![];var _0xd59fcf={};if(_0x3d9ecc['query'][_0xd65c('0x2d')]&&_0x3d9ecc[_0xd65c('0x33')][_0xd65c('0x2d')]===_0xd65c('0x4e')){_0xd59fcf[_0xd65c('0x4e')]=_0x3d9ecc[_0xd65c('0x4a')]['id'];}else{_0xd59fcf['id']=_0x3d9ecc[_0xd65c('0x4a')]['id'];}return db[_0xd65c('0x2b')][_0xd65c('0x47')]({'where':_0xd59fcf,'attributes':['id','value'],'raw':!![]})[_0xd65c('0x23')](handleEntityNotFound(_0x21de6f,null))[_0xd65c('0x23')](function(_0x385496){if(_0x385496){var _0x18589d=_0x385496[_0xd65c('0x4f')];var _0x4eb63f=util[_0xd65c('0x31')](_0xd65c('0x50'),_0x18589d);if(fs[_0xd65c('0x51')](_0x4eb63f)){_0x1c78ef=!![];return _0x4781bf[_0xd65c('0x52')](_0x4eb63f,_0x18589d,config[_0xd65c('0x53')][_0xd65c('0x54')])[_0xd65c('0x23')](function(){return _0x385496;});}return _0x385496;}})['then'](function(_0x593b44){if(_0x593b44){var _0x3c6d9f=_0x593b44['value'];if(!fs[_0xd65c('0x51')](_0x3c6d9f)){throw new db[(_0xd65c('0x55'))]['ValidationError'](_0xd65c('0x56'));}if(_0x593b44['filename']){return _0x21de6f[_0xd65c('0x4c')](_0x3c6d9f,_0x593b44[_0xd65c('0x57')]+path['extname'](_0x3c6d9f),function(){if(_0x1c78ef){fs[_0xd65c('0x58')](_0x3c6d9f);}});}else{return _0x21de6f['download'](_0x3c6d9f,function(_0x466115){if(_0x1c78ef){fs[_0xd65c('0x58')](_0x3c6d9f);}});}}})[_0xd65c('0x44')](function(_0x519102){if(_0x519102[_0xd65c('0x59')]===_0xd65c('0x56')){_0x21de6f[_0xd65c('0x19')](0x194)[_0xd65c('0x28')](_0xd65c('0x5a'));}else{return handleError(_0x21de6f,null);}});};exports[_0xd65c('0x5b')]=function(_0x33243a,_0x40d0aa,_0x4b34d7){var _0x168f69=require(_0xd65c('0x4d'));var _0x3f6d31=![];var _0x524855={'$and':[db['sequelize'][_0xd65c('0x3c')](db['sequelize']['fn'](_0xd65c('0x5c'),db[_0xd65c('0x5d')][_0xd65c('0x5e')](_0xd65c('0x4e'))),_0x33243a[_0xd65c('0x33')][_0xd65c('0x5f')])]};if(_0x33243a[_0xd65c('0x33')]['type']&&_0x33243a[_0xd65c('0x33')][_0xd65c('0x2d')]===_0xd65c('0x4e')){_0x524855['$and'][_0xd65c('0x60')]({'uniqueid':_0x33243a[_0xd65c('0x4a')]['id']});}else{_0x524855[_0xd65c('0x61')]['push']({'id':_0x33243a[_0xd65c('0x4a')]['id']});}return db[_0xd65c('0x2b')][_0xd65c('0x47')]({'where':_0x524855,'attributes':['id',_0xd65c('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x40d0aa,null))[_0xd65c('0x23')](function(_0x27e69a){if(_0x27e69a){var _0x4d36fd=util['format'](_0xd65c('0x50'),_0x27e69a[_0xd65c('0x4f')]);if(fs[_0xd65c('0x51')](_0x4d36fd)){_0x3f6d31=!![];return _0x168f69['decryptFile'](_0x4d36fd,_0x27e69a['value'],config['secrets'][_0xd65c('0x54')])[_0xd65c('0x23')](function(){return _0x27e69a;});}return _0x27e69a;}})['then'](function(_0xac0864){if(_0xac0864){if(!fs[_0xd65c('0x51')](_0xac0864['value'])){throw new db['Sequelize']['ValidationError'](_0xd65c('0x56'));}if(_0xac0864[_0xd65c('0x57')]){return _0x40d0aa[_0xd65c('0x4c')](_0xac0864['value'],_0xac0864[_0xd65c('0x57')]+path[_0xd65c('0x62')](_0xac0864['value']),function(){if(_0x3f6d31){fs[_0xd65c('0x58')](_0xac0864['value']);}});}else{return _0x40d0aa[_0xd65c('0x4c')](_0xac0864['value'],function(_0x597245){if(_0x3f6d31){fs[_0xd65c('0x58')](_0xac0864['value']);}});}}})[_0xd65c('0x44')](handleError(_0x40d0aa,null));};exports[_0xd65c('0x24')]=function(_0x368b4b,_0x25b683){return db[_0xd65c('0x2b')]['find']({'where':{'id':_0x368b4b['params']['id']}})['then'](function(_0x4d1db6){if(_['isNil'](_0x4d1db6)){throw new ReferenceError(_0xd65c('0x63'));}return _0x4d1db6;})[_0xd65c('0x23')](function(_0x59a7ef){var _0x48d2ca=_0x59a7ef['value'];logger[_0xd65c('0x64')](_0xd65c('0x65'),_0x48d2ca);if(!_[_0xd65c('0x66')](_0x59a7ef['value'])&&fs[_0xd65c('0x51')](_0x48d2ca)){logger[_0xd65c('0x64')](_0xd65c('0x67')+_0x48d2ca+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd65c('0x68')](_0x48d2ca);}_0x48d2ca=_0x48d2ca+'.cypher';if(!_[_0xd65c('0x66')](_0x59a7ef[_0xd65c('0x4f')])&&fs[_0xd65c('0x51')](_0x48d2ca)){logger[_0xd65c('0x64')](_0xd65c('0x67')+_0x48d2ca+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd65c('0x68')](_0x48d2ca);}return _0x59a7ef;})[_0xd65c('0x23')](function(_0x16c1ba){if(!_0x16c1ba)throw new InternalError();return _0x16c1ba[_0xd65c('0x24')]();})[_0xd65c('0x23')](function(){_0x25b683[_0xd65c('0x19')](0xcc)['end']();})[_0xd65c('0x44')](handleError(_0x25b683,null));};function getBucketslist(_0x122a6e,_0x5b2719,_0x253f6f){return new Promise(function(_0x28ea64,_0x47cf2b){var _0x48a900=new AWS['S3']({'accessKeyId':_0x5b2719,'secretAccessKey':_0x122a6e,'region':_0x253f6f});_0x48a900[_0xd65c('0x69')]({},function(_0x5225fb,_0x1c5918){if(_0x5225fb){return _0x47cf2b(_0x5225fb);}else{return _0x28ea64(_0x1c5918);}});});}function createBucket(_0x3f6d00,_0x391fca,_0x19f2a5,_0x3b4bfa){return new Promise(function(_0x2325b1,_0x446842){var _0x2d4ffb=new AWS['S3']({'accessKeyId':_0x391fca,'secretAccessKey':_0x3f6d00,'region':_0x19f2a5});_0x2d4ffb[_0xd65c('0x6a')]({'Bucket':_0x3b4bfa},function(_0x5db4b6,_0x5b96b1){if(_0x5db4b6){return _0x446842(_0x5db4b6);}else{return _0x2325b1(_0x5b96b1);}});});}function uploadFile(_0xbf49a0,_0x3b3dca,_0x58c389,_0x2b6456,_0x31799e,_0x1f91d8){return new Promise(function(_0x3244f0,_0x38caf7){var _0x2d3326=new AWS['S3']({'accessKeyId':_0x3b3dca,'secretAccessKey':_0xbf49a0,'region':_0x58c389});_0x2d3326['upload']({'Bucket':_0x2b6456,'Key':_0x31799e,'Body':_0x1f91d8},function(_0x413ae0,_0x131dd6){if(_0x413ae0){return _0x38caf7(_0x413ae0);}else{return _0x3244f0(_0x131dd6);}});});}function startTranscribe(_0x5067b8,_0x4425b3,_0x2fc851,_0x58caf8,_0x5272ee,_0x2e6585){return new Promise(function(_0x255f97,_0x1a78d0){var _0x437395=new AWS[(_0xd65c('0x6b'))]({'accessKeyId':_0x4425b3,'secretAccessKey':_0x5067b8,'region':_0x2fc851});_0x437395['startTranscriptionJob']({'TranscriptionJobName':_0x58caf8,'LanguageCode':_0x5272ee,'Media':{'MediaFileUri':_0x2e6585}},function(_0x19d9e7,_0x248e98){if(_0x19d9e7){return _0x1a78d0(_0x19d9e7);}else{return _0x255f97(_0x248e98);}});});}function transcribe(_0x51bfe8,_0x4afb04,_0x2e58ee,_0x1078ee,_0x3ca5d9,_0x27da8d,_0x377a7d){return new Promise(function(_0x59c357,_0x2bfca9){var _0x15fbd6={};logger['info'](util[_0xd65c('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x51bfe8,_0x3ca5d9));return uploadFile(_0x4afb04,_0x2e58ee,_0x1078ee,_0x3ca5d9,path['basename'](_0x27da8d),fs[_0xd65c('0x6c')](_0x27da8d))[_0xd65c('0x23')](function(_0x386576){logger[_0xd65c('0x64')](util[_0xd65c('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x51bfe8,_0x3ca5d9,_0x386576['Location']));_0x15fbd6[_0xd65c('0x6d')]=_0x386576[_0xd65c('0x6e')];_0x15fbd6[_0xd65c('0x6f')]=_0x386576[_0xd65c('0x70')];logger['info'](util[_0xd65c('0x31')](_0xd65c('0x71'),_0x51bfe8));return startTranscribe(_0x4afb04,_0x2e58ee,_0x1078ee,uuidv4(),_0x377a7d,_0x386576[_0xd65c('0x70')]);})[_0xd65c('0x23')](function(_0x505a1d){logger['info'](util[_0xd65c('0x31')](_0xd65c('0x72'),_0x51bfe8,_0x505a1d[_0xd65c('0x73')]['TranscriptionJobName']));_0x15fbd6['transcribeName']=_0x505a1d['TranscriptionJob'][_0xd65c('0x74')];_0x15fbd6[_0xd65c('0x75')]=_0x505a1d[_0xd65c('0x73')]['TranscriptionJobStatus'];return _0x59c357(_0x15fbd6);})[_0xd65c('0x44')](function(_0x145721){return _0x2bfca9(_0x145721);});});}exports['runTranscribe']=function(_0x1496b2,_0x1f3e82,_0x214d6c){var _0x33d4f5;var _0x47f2fe;var _0x51b8d5;var _0x1012af=require('../../components/encryptor');return db[_0xd65c('0x2b')][_0xd65c('0x76')]({'where':{'id':_0x1496b2[_0xd65c('0x4a')]['id']}})[_0xd65c('0x23')](function(_0x45b8a9){if(_0x45b8a9){var _0x1f130a=util['format']('%s.cypher',_0x45b8a9[_0xd65c('0x4f')]);if(fs[_0xd65c('0x51')](_0x1f130a)){cypher=!![];return _0x1012af[_0xd65c('0x52')](_0x1f130a,_0x45b8a9[_0xd65c('0x4f')],config[_0xd65c('0x53')][_0xd65c('0x54')])[_0xd65c('0x23')](function(){return _0x45b8a9;});}return _0x45b8a9;}})[_0xd65c('0x23')](function(_0x3d1f2c){if(!_0x3d1f2c){throw new db[(_0xd65c('0x55'))][(_0xd65c('0x77'))](_0xd65c('0x78'));}_0x47f2fe=_0x3d1f2c;return db[_0xd65c('0x79')]['findOne']({'where':{'id':0x1}});})[_0xd65c('0x23')](handleEntityNotFound(_0x1f3e82,null))['then'](function(_0x15bfdf){if(_0x15bfdf){_0x33d4f5=_0x15bfdf;if(!_0x33d4f5[_0xd65c('0x7a')]||!_0x33d4f5[_0xd65c('0x7b')]||!_0x33d4f5[_0xd65c('0x7c')]||!_0x33d4f5[_0xd65c('0x7d')]||!_0x33d4f5['bucket']){throw new db[(_0xd65c('0x55'))][(_0xd65c('0x77'))](_0xd65c('0x7e'));}if(_0x1496b2[_0xd65c('0x49')][_0xd65c('0x7f')]&&(!_0x33d4f5[_0xd65c('0x80')]||!_0x33d4f5['sentimentAccountId']||!_0x33d4f5[_0xd65c('0x81')]||!_0x33d4f5[_0xd65c('0x7d')]||!_0x33d4f5[_0xd65c('0x6d')])){throw new db[(_0xd65c('0x55'))][(_0xd65c('0x77'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xd65c('0x82')][_0xd65c('0x76')]({'where':{'id':_0x33d4f5['transcribeAccountId']}});}})['then'](function(_0x52c4ed){if(!_0x52c4ed){throw new db[(_0xd65c('0x55'))]['ValidationError'](_0xd65c('0x83'));}if(!_0x52c4ed[_0xd65c('0x84')]||!_0x52c4ed[_0xd65c('0x85')]){throw new db[(_0xd65c('0x55'))][(_0xd65c('0x77'))](_0xd65c('0x86'));}_0x51b8d5=_0x52c4ed;return getBucketslist(_0x51b8d5['data1'],_0x51b8d5[_0xd65c('0x85')],_0x33d4f5[_0xd65c('0x7c')]);})['then'](function(_0x3e396b){if(_0x3e396b&&_0x3e396b[_0xd65c('0x87')]){var _0x1f08e0=_[_0xd65c('0x47')](_0x3e396b[_0xd65c('0x87')],function(_0x4e6d97){return _0x4e6d97[_0xd65c('0x88')]===_0x33d4f5[_0xd65c('0x6d')];});if(!_0x1f08e0){logger[_0xd65c('0x64')](util[_0xd65c('0x31')](_0xd65c('0x89'),_0x1496b2[_0xd65c('0x4a')]['id'],_0x33d4f5[_0xd65c('0x6d')]));return createBucket(_0x51b8d5[_0xd65c('0x84')],_0x51b8d5['data2'],_0x33d4f5[_0xd65c('0x7c')],_0x33d4f5[_0xd65c('0x6d')]);}logger[_0xd65c('0x64')](util[_0xd65c('0x31')](_0xd65c('0x8a'),_0x1496b2['params']['id'],_0x33d4f5[_0xd65c('0x6d')]));return;}})[_0xd65c('0x23')](function(_0xb1a85e){if(_0x47f2fe[_0xd65c('0x75')]===_0xd65c('0x8b')){return transcribe(_0x1496b2[_0xd65c('0x4a')]['id'],_0x51b8d5[_0xd65c('0x84')],_0x51b8d5['data2'],_0x33d4f5[_0xd65c('0x7c')],_0x33d4f5[_0xd65c('0x6d')],_0x47f2fe[_0xd65c('0x4f')],_0x33d4f5[_0xd65c('0x7d')]);}else{logger[_0xd65c('0x64')](util[_0xd65c('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x1496b2[_0xd65c('0x4a')]['id']));return{'transcribeStatus':_0xd65c('0x8c')};}})[_0xd65c('0x23')](function(_0x110d1d){if(_0x110d1d){_0x110d1d[_0xd65c('0x8d')]=_0x1496b2[_0xd65c('0x49')][_0xd65c('0x7f')];return _0x47f2fe['updateAttributes'](_0x110d1d);}})[_0xd65c('0x23')](respondWithResult(_0x1f3e82,null))[_0xd65c('0x44')](handleError(_0x1f3e82,null));};function writeFile(_0x591bee,_0x43dd74){return new Promise(function(_0xa527f1,_0x43ede8){fs[_0xd65c('0x8e')](_0x43dd74,_0x591bee,function(_0x4f65ea,_0x366b14){if(_0x4f65ea){return _0x43ede8(_0x4f65ea);}else{return _0xa527f1(_0x366b14);}});});}exports[_0xd65c('0x8f')]=function(_0x6941f8,_0x50eb66,_0x3c5db2){return db['VoiceRecording']['findOne']({'where':{'id':_0x6941f8[_0xd65c('0x4a')]['id']}})[_0xd65c('0x23')](handleEntityNotFound(_0x50eb66))[_0xd65c('0x23')](function(_0x6fc395){if(_0x6fc395&&_0x6fc395[_0xd65c('0x90')]){var _0x103cd5=_0x6fc395['fileText'];var _0x7b3b10=config[_0xd65c('0x91')]+_0xd65c('0x92')+_0x6fc395['id']+_0xd65c('0x93');if(fs['existsSync'](_0x7b3b10)){return _0x7b3b10;}return writeFile(_0x103cd5,_0x7b3b10)[_0xd65c('0x23')](function(){return _0x7b3b10;});}else{throw new db[(_0xd65c('0x55'))][(_0xd65c('0x77'))](_0xd65c('0x94'));}})[_0xd65c('0x23')](function(_0x38f474){return _0x50eb66['download'](_0x38f474);})[_0xd65c('0x44')](handleError(_0x50eb66));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2757332..52f7e55 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 _0x39cd=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util'];(function(_0x4d0416,_0x400341){var _0x5f3fa3=function(_0x53fa5c){while(--_0x53fa5c){_0x4d0416['push'](_0x4d0416['shift']());}};_0x5f3fa3(++_0x400341);}(_0x39cd,0x11c));var _0xd39c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x39cd[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd39c('0x0'));var util=require(_0xd39c('0x1'));var logger=require('../../config/logger')(_0xd39c('0x2'));var moment=require(_0xd39c('0x3'));var BPromise=require(_0xd39c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd39c('0x5'));var rimraf=require(_0xd39c('0x6'));var config=require(_0xd39c('0x7'));var attributes=require(_0xd39c('0x8'));module[_0xd39c('0x9')]=function(_0x293f9b,_0x6d6a1e){return _0x293f9b['define'](_0xd39c('0xa'),attributes,{'tableName':_0xd39c('0xb'),'paranoid':![],'indexes':[{'name':_0xd39c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe1a7=['define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x6368df,_0x1f0229){var _0x58b9ee=function(_0x1d45e0){while(--_0x1d45e0){_0x6368df['push'](_0x6368df['shift']());}};_0x58b9ee(++_0x1f0229);}(_0xe1a7,0x87));var _0x7e1a=function(_0x576c3d,_0x5921ee){_0x576c3d=_0x576c3d-0x0;var _0x4557e8=_0xe1a7[_0x576c3d];return _0x4557e8;};'use strict';var _=require(_0x7e1a('0x0'));var util=require(_0x7e1a('0x1'));var logger=require(_0x7e1a('0x2'))(_0x7e1a('0x3'));var moment=require(_0x7e1a('0x4'));var BPromise=require(_0x7e1a('0x5'));var rp=require(_0x7e1a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e1a('0x7'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0x7e1a('0x8')]=function(_0x2ed7d7,_0x11a8e4){return _0x2ed7d7[_0x7e1a('0x9')](_0x7e1a('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x7e1a('0xb'),'fields':[_0x7e1a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index c8751b7..ab99f07 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 _0xe2fe=['options','raw','where','attributes','limit','debug','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','recording','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','UpdateVoiceRecording','VoiceRecording','update','body'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}exports[_0xee2f('0x12')]=function(_0x502eb6){var _0x550da7=this;return new Promise(function(_0x40b5bc,_0x5a5078){return db[_0xee2f('0x13')][_0xee2f('0x14')](_0x502eb6[_0xee2f('0x15')],{'raw':_0x502eb6['options']?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502eb6[_0xee2f('0x16')]?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x18')]||null:null,'attributes':_0x502eb6['options']?_0x502eb6['options'][_0xee2f('0x19')]||null:null,'limit':_0x502eb6[_0xee2f('0x16')]?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x1a')]||null:null})[_0xee2f('0xa')](function(_0xf278cc){logger[_0xee2f('0xb')]('UpdateVoiceRecording',_0x502eb6);logger[_0xee2f('0x1b')](_0xee2f('0x12'),_0x502eb6,JSON[_0xee2f('0xd')](_0xf278cc));_0x40b5bc(_0xf278cc);})[_0xee2f('0x1c')](function(_0x820101){logger[_0xee2f('0xe')](_0xee2f('0x12'),_0x820101[_0xee2f('0xf')],_0x502eb6);_0x5a5078(_0x550da7[_0xee2f('0xe')](0x1f4,_0x820101[_0xee2f('0xf')]));});});};exports[_0xee2f('0x1d')]=function(_0x168adc){var _0x1c8454=this;return new Promise(function(_0x45c4a0,_0x53f6ed){var _0x4ef690=require('../../components/encryptor');var _0x18bdbb;return db[_0xee2f('0x1e')][_0xee2f('0x1f')]({'attributes':['id',_0xee2f('0x20')],'where':{'id':0x1},'raw':!![]})[_0xee2f('0xa')](function(_0x3737fd){_0x18bdbb=_0x3737fd;return db['VoiceRecording'][_0xee2f('0x21')](_0x168adc['body']);})[_0xee2f('0xa')](function(_0x180429){if(_0x18bdbb[_0xee2f('0x20')]&&fs[_0xee2f('0x22')](_0x180429[_0xee2f('0x23')])){var _0x47d5a6=util[_0xee2f('0x24')](_0xee2f('0x25'),_0x180429['value']);return _0x4ef690['encryptFile'](_0x180429[_0xee2f('0x23')],_0x47d5a6,config['secrets'][_0xee2f('0x26')])[_0xee2f('0xa')](function(){fs['unlink'](_0x180429[_0xee2f('0x23')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x180429;});}return _0x180429;})['then'](function(_0x3f1fe8){logger[_0xee2f('0xb')]('CreateVoiceRecording',_0x168adc);logger[_0xee2f('0x1b')](_0xee2f('0x1d'),_0x168adc,JSON[_0xee2f('0xd')](_0x3f1fe8));_0x45c4a0(_0x3f1fe8);})[_0xee2f('0x1c')](function(_0x1c3a01){logger['error'](_0xee2f('0x1d'),_0x1c3a01['message'],_0x168adc);_0x53f6ed(_0x1c8454[_0xee2f('0xe')](0x1f4,_0x1c3a01[_0xee2f('0xf')]));});});}; \ No newline at end of file +var _0x90b1=['request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','limit','then','../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','%s.cypher','encryptFile','value','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x90b1,0x1bb));var _0x190b=function(_0x532875,_0x1ca8c3){_0x532875=_0x532875-0x0;var _0x5a47f7=_0x90b1[_0x532875];return _0x5a47f7;};'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')]('VoiceRecording,\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')](_0x21e458[_0x190b('0x17')],{'raw':_0x21e458[_0x190b('0x18')]?_0x21e458[_0x190b('0x18')][_0x190b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21e458['options']?_0x21e458[_0x190b('0x18')][_0x190b('0x1a')]||null:null,'attributes':_0x21e458['options']?_0x21e458[_0x190b('0x18')]['attributes']||null:null,'limit':_0x21e458['options']?_0x21e458[_0x190b('0x18')][_0x190b('0x1b')]||null:null})[_0x190b('0x1c')](function(_0x4c0b6e){logger[_0x190b('0x9')](_0x190b('0x14'),_0x21e458);logger[_0x190b('0xc')](_0x190b('0x14'),_0x21e458,JSON[_0x190b('0xe')](_0x4c0b6e));_0x16c009(_0x4c0b6e);})[_0x190b('0x13')](function(_0x1bce97){logger['error']('UpdateVoiceRecording',_0x1bce97[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a[_0x190b('0xf')](0x1f4,_0x1bce97['message']));});});};exports['CreateVoiceRecording']=function(_0x3260d5){var _0x4e2a93=this;return new Promise(function(_0x328e5e,_0x3b6aaf){var _0x51f8b4=require(_0x190b('0x1d'));var _0x1deea6;return db['Setting'][_0x190b('0x1e')]({'attributes':['id',_0x190b('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x190b('0x1c')](function(_0x494f3f){_0x1deea6=_0x494f3f;return db['VoiceRecording'][_0x190b('0x20')](_0x3260d5['body']);})[_0x190b('0x1c')](function(_0x19e421){if(_0x1deea6['callRecordingEncryption']&&fs[_0x190b('0x21')](_0x19e421['value'])){var _0x40d060=util['format'](_0x190b('0x22'),_0x19e421['value']);return _0x51f8b4[_0x190b('0x23')](_0x19e421[_0x190b('0x24')],_0x40d060,config['secrets'][_0x190b('0x25')])[_0x190b('0x1c')](function(){fs[_0x190b('0x26')](_0x19e421[_0x190b('0x24')]);logger[_0x190b('0x9')](_0x190b('0x27'));return _0x19e421;});}return _0x19e421;})[_0x190b('0x1c')](function(_0x248919){logger['info']('CreateVoiceRecording',_0x3260d5);logger[_0x190b('0xc')](_0x190b('0x28'),_0x3260d5,JSON['stringify'](_0x248919));_0x328e5e(_0x248919);})[_0x190b('0x13')](function(_0x2dcd39){logger[_0x190b('0xf')](_0x190b('0x28'),_0x2dcd39[_0x190b('0x11')],_0x3260d5);_0x3b6aaf(_0x4e2a93[_0x190b('0xf')](0x1f4,_0x2dcd39[_0x190b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 519fda0..427f87b 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 _0xc86c=['isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0xc86c,0x107));var _0xcc86=function(_0x9ac37d,_0xc8697b){_0x9ac37d=_0x9ac37d-0x0;var _0x1d1834=_0xc86c[_0x9ac37d];return _0x1d1834;};'use strict';var multer=require(_0xcc86('0x0'));var util=require('util');var path=require(_0xcc86('0x1'));var timeout=require(_0xcc86('0x2'));var express=require('express');var router=express[_0xcc86('0x3')]();var fs_extra=require(_0xcc86('0x4'));var auth=require(_0xcc86('0x5'));var interaction=require(_0xcc86('0x6'));var config=require(_0xcc86('0x7'));var controller=require(_0xcc86('0x8'));router[_0xcc86('0x9')]('/',auth[_0xcc86('0xa')](),controller[_0xcc86('0xb')]);router[_0xcc86('0x9')](_0xcc86('0xc'),auth[_0xcc86('0xa')](),controller[_0xcc86('0xd')]);router['get']('/:id',auth[_0xcc86('0xa')](),controller[_0xcc86('0xe')]);router[_0xcc86('0xf')]('/',auth[_0xcc86('0xa')](),controller['create']);router[_0xcc86('0x10')](_0xcc86('0x11'),auth[_0xcc86('0xa')](),controller[_0xcc86('0x12')]);router[_0xcc86('0x13')]('/:id',auth[_0xcc86('0xa')](),controller[_0xcc86('0x14')]);module['exports']=router; \ No newline at end of file +var _0x81a7=['create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','describe','/:id','show'];(function(_0x31e0dd,_0x1bc73b){var _0x2728b7=function(_0x1efa98){while(--_0x1efa98){_0x31e0dd['push'](_0x31e0dd['shift']());}};_0x2728b7(++_0x1bc73b);}(_0x81a7,0x158));var _0x781a=function(_0x4f2d98,_0x53bd6b){_0x4f2d98=_0x4f2d98-0x0;var _0x4297ae=_0x81a7[_0x4f2d98];return _0x4297ae;};'use strict';var multer=require(_0x781a('0x0'));var util=require(_0x781a('0x1'));var path=require(_0x781a('0x2'));var timeout=require(_0x781a('0x3'));var express=require(_0x781a('0x4'));var router=express[_0x781a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x781a('0x6'));var interaction=require(_0x781a('0x7'));var config=require(_0x781a('0x8'));var controller=require(_0x781a('0x9'));router[_0x781a('0xa')]('/',auth['isAuthenticated'](),controller[_0x781a('0xb')]);router[_0x781a('0xa')]('/describe',auth[_0x781a('0xc')](),controller[_0x781a('0xd')]);router['get'](_0x781a('0xe'),auth[_0x781a('0xc')](),controller[_0x781a('0xf')]);router['post']('/',auth[_0x781a('0xc')](),controller[_0x781a('0x10')]);router[_0x781a('0x11')](_0x781a('0xe'),auth[_0x781a('0xc')](),controller[_0x781a('0x12')]);router[_0x781a('0x13')]('/:id',auth[_0x781a('0xc')](),controller['destroy']);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 904bab5..c43bd97 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 _0xd4fa=['blind','attended','STRING','sequelize','exports','ENUM'];(function(_0x2810a2,_0x56dd2b){var _0x26e1fb=function(_0x53222c){while(--_0x53222c){_0x2810a2['push'](_0x2810a2['shift']());}};_0x26e1fb(++_0x56dd2b);}(_0xd4fa,0xff));var _0xad4f=function(_0x5544e1,_0x32afaf){_0x5544e1=_0x5544e1-0x0;var _0x233c4c=_0xd4fa[_0x5544e1];return _0x233c4c;};'use strict';var Sequelize=require(_0xad4f('0x0'));var moment=require('moment');module[_0xad4f('0x1')]={'type':{'type':Sequelize[_0xad4f('0x2')](_0xad4f('0x3'),_0xad4f('0x4'))},'result':{'type':Sequelize[_0xad4f('0x5')]},'transfererchannel':{'type':Sequelize[_0xad4f('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xad4f('0x5')]},'transferercalleridname':{'type':Sequelize[_0xad4f('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xad4f('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xad4f('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xad4f('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xad4f('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xad4f('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xad4f('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xad4f('0x5')]},'transfereecontext':{'type':Sequelize[_0xad4f('0x5')]},'transfereeexten':{'type':Sequelize[_0xad4f('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xad4f('0x5')]},'extension':{'type':Sequelize[_0xad4f('0x5')]}}; \ No newline at end of file +var _0xf074=['exports','blind','attended','STRING','ENUM','Yes','sequelize','moment'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0xf074,0xf6));var _0x4f07=function(_0x376ac8,_0x4d43a0){_0x376ac8=_0x376ac8-0x0;var _0x399eae=_0xf074[_0x376ac8];return _0x399eae;};'use strict';var Sequelize=require(_0x4f07('0x0'));var moment=require(_0x4f07('0x1'));module[_0x4f07('0x2')]={'type':{'type':Sequelize['ENUM'](_0x4f07('0x3'),_0x4f07('0x4'))},'result':{'type':Sequelize[_0x4f07('0x5')]},'transfererchannel':{'type':Sequelize[_0x4f07('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x4f07('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x4f07('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x4f07('0x5')]},'transferercontext':{'type':Sequelize[_0x4f07('0x5')]},'transfererexten':{'type':Sequelize[_0x4f07('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x4f07('0x5')]},'transfereechannel':{'type':Sequelize[_0x4f07('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x4f07('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x4f07('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x4f07('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x4f07('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x4f07('0x5')]},'transfereecontext':{'type':Sequelize[_0x4f07('0x5')]},'transfereeexten':{'type':Sequelize[_0x4f07('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x4f07('0x5')]},'isexternal':{'type':Sequelize[_0x4f07('0x6')](_0x4f07('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4f07('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index bffbb9b..f7d9489 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 _0xe7da=['then','destroy','end','error','stack','name','map','VoiceTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save'];(function(_0x1e9199,_0x7f37d4){var _0x43d9f1=function(_0xded14f){while(--_0xded14f){_0x1e9199['push'](_0x1e9199['shift']());}};_0x43d9f1(++_0x7f37d4);}(_0xe7da,0x160));var _0xae7d=function(_0x4db496,_0x3d874d){_0x4db496=_0x4db496-0x0;var _0x9a21ea=_0xe7da[_0x4db496];return _0x9a21ea;};'use strict';var emlformat=require(_0xae7d('0x0'));var rimraf=require(_0xae7d('0x1'));var zipdir=require(_0xae7d('0x2'));var jsonpatch=require(_0xae7d('0x3'));var rp=require(_0xae7d('0x4'));var moment=require('moment');var BPromise=require(_0xae7d('0x5'));var Mustache=require(_0xae7d('0x6'));var util=require('util');var path=require(_0xae7d('0x7'));var sox=require('sox');var csv=require(_0xae7d('0x8'));var ejs=require(_0xae7d('0x9'));var fs=require('fs');var fs_extra=require(_0xae7d('0xa'));var _=require(_0xae7d('0xb'));var squel=require(_0xae7d('0xc'));var crypto=require(_0xae7d('0xd'));var jsforce=require(_0xae7d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xae7d('0x8'));var querystring=require(_0xae7d('0xf'));var Papa=require(_0xae7d('0x10'));var Redis=require(_0xae7d('0x11'));var authService=require(_0xae7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xae7d('0x13'));var hardwareService=require(_0xae7d('0x14'));var logger=require(_0xae7d('0x15'))(_0xae7d('0x16'));var utils=require('../../config/utils');var config=require(_0xae7d('0x17'));var licenseUtil=require(_0xae7d('0x18'));var db=require(_0xae7d('0x19'))['db'];function respondWithStatusCode(_0x49d965,_0x5b013c){_0x5b013c=_0x5b013c||0xcc;return function(_0xda58c8){if(_0xda58c8){return _0x49d965[_0xae7d('0x1a')](_0x5b013c);}return _0x49d965[_0xae7d('0x1b')](_0x5b013c)['end']();};}function respondWithResult(_0x5e9ed7,_0x134f83){_0x134f83=_0x134f83||0xc8;return function(_0x5f3fa7){if(_0x5f3fa7){return _0x5e9ed7[_0xae7d('0x1b')](_0x134f83)[_0xae7d('0x1c')](_0x5f3fa7);}};}function respondWithFilteredResult(_0x4ae32a,_0x58b43e){return function(_0x1fc011){if(_0x1fc011){var _0x5f24d1=typeof _0x58b43e['offset']==='undefined'&&typeof _0x58b43e[_0xae7d('0x1d')]===_0xae7d('0x1e');var _0x4facca=_0x1fc011[_0xae7d('0x1f')];var _0x1928dd=_0x5f24d1?0x0:_0x58b43e[_0xae7d('0x20')];var _0x1d2982=_0x5f24d1?_0x1fc011[_0xae7d('0x1f')]:_0x58b43e[_0xae7d('0x20')]+_0x58b43e['limit'];var _0x431e5d;if(_0x1d2982>=_0x4facca){_0x1d2982=_0x4facca;_0x431e5d=0xc8;}else{_0x431e5d=0xce;}_0x4ae32a[_0xae7d('0x1b')](_0x431e5d);return _0x4ae32a[_0xae7d('0x21')](_0xae7d('0x22'),_0x1928dd+'-'+_0x1d2982+'/'+_0x4facca)[_0xae7d('0x1c')](_0x1fc011);}return null;};}function patchUpdates(_0x21d0f2){return function(_0x4bf23a){try{jsonpatch[_0xae7d('0x23')](_0x4bf23a,_0x21d0f2,!![]);}catch(_0x266db7){return BPromise[_0xae7d('0x24')](_0x266db7);}return _0x4bf23a[_0xae7d('0x25')]();};}function saveUpdates(_0xeb1f3,_0x355709){return function(_0x58d787){if(_0x58d787){return _0x58d787['update'](_0xeb1f3)[_0xae7d('0x26')](function(_0x502de7){return _0x502de7;});}return null;};}function removeEntity(_0x4fd191,_0x551c0a){return function(_0x54ef73){if(_0x54ef73){return _0x54ef73[_0xae7d('0x27')]()[_0xae7d('0x26')](function(){_0x4fd191[_0xae7d('0x1b')](0xcc)[_0xae7d('0x28')]();});}};}function handleEntityNotFound(_0x45698c,_0x13c7d6){return function(_0x1ee64f){if(!_0x1ee64f){_0x45698c[_0xae7d('0x1a')](0x194);}return _0x1ee64f;};}function handleError(_0x5edecf,_0x3dc3c3){_0x3dc3c3=_0x3dc3c3||0x1f4;return function(_0x1b07ef){logger[_0xae7d('0x29')](_0x1b07ef[_0xae7d('0x2a')]);if(_0x1b07ef['name']){delete _0x1b07ef[_0xae7d('0x2b')];}_0x5edecf[_0xae7d('0x1b')](_0x3dc3c3)['send'](_0x1b07ef);};}exports['index']=function(_0x365bb5,_0x23cbc7){var _0x39b670={},_0x43c1ae={},_0x34e3e4={'count':0x0,'rows':[]};var _0x118b2a=_[_0xae7d('0x2c')](db[_0xae7d('0x2d')]['rawAttributes'],function(_0x167486){return{'name':_0x167486[_0xae7d('0x2e')],'type':_0x167486[_0xae7d('0x2f')]['key']};});_0x43c1ae[_0xae7d('0x30')]=_[_0xae7d('0x2c')](_0x118b2a,_0xae7d('0x2b'));_0x43c1ae[_0xae7d('0x31')]=_[_0xae7d('0x32')](_0x365bb5[_0xae7d('0x31')]);_0x43c1ae[_0xae7d('0x33')]=_[_0xae7d('0x34')](_0x43c1ae[_0xae7d('0x30')],_0x43c1ae[_0xae7d('0x31')]);_0x39b670[_0xae7d('0x35')]=_[_0xae7d('0x34')](_0x43c1ae[_0xae7d('0x30')],qs['fields'](_0x365bb5[_0xae7d('0x31')]['fields']));_0x39b670[_0xae7d('0x35')]=_0x39b670[_0xae7d('0x35')]['length']?_0x39b670[_0xae7d('0x35')]:_0x43c1ae[_0xae7d('0x30')];if(!_0x365bb5[_0xae7d('0x31')][_0xae7d('0x36')](_0xae7d('0x37'))){_0x39b670['limit']=qs['limit'](_0x365bb5[_0xae7d('0x31')][_0xae7d('0x1d')]);_0x39b670[_0xae7d('0x20')]=qs[_0xae7d('0x20')](_0x365bb5[_0xae7d('0x31')][_0xae7d('0x20')]);}_0x39b670[_0xae7d('0x38')]=qs[_0xae7d('0x39')](_0x365bb5['query'][_0xae7d('0x39')]);_0x39b670[_0xae7d('0x3a')]=qs['filters'](_[_0xae7d('0x3b')](_0x365bb5[_0xae7d('0x31')],_0x43c1ae[_0xae7d('0x33')]),_0x118b2a);if(_0x365bb5[_0xae7d('0x31')][_0xae7d('0x3c')]){_0x39b670['where']=_[_0xae7d('0x3d')](_0x39b670[_0xae7d('0x3a')],{'$or':_[_0xae7d('0x2c')](_0x118b2a,function(_0x469aa5){if(_0x469aa5['type']!==_0xae7d('0x3e')){var _0x4682c8={};_0x4682c8[_0x469aa5[_0xae7d('0x2b')]]={'$like':'%'+_0x365bb5[_0xae7d('0x31')][_0xae7d('0x3c')]+'%'};return _0x4682c8;}})});}_0x39b670=_[_0xae7d('0x3d')]({},_0x39b670,_0x365bb5[_0xae7d('0x3f')]);var _0x260948={'where':_0x39b670['where']};return db[_0xae7d('0x2d')][_0xae7d('0x1f')](_0x260948)[_0xae7d('0x26')](function(_0x3af09b){_0x34e3e4[_0xae7d('0x1f')]=_0x3af09b;if(_0x365bb5[_0xae7d('0x31')][_0xae7d('0x40')]){_0x39b670[_0xae7d('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xae7d('0x42')](_0x39b670);})[_0xae7d('0x26')](function(_0x4d5568){_0x34e3e4[_0xae7d('0x43')]=_0x4d5568;return _0x34e3e4;})['then'](respondWithFilteredResult(_0x23cbc7,_0x39b670))[_0xae7d('0x44')](handleError(_0x23cbc7,null));};exports[_0xae7d('0x45')]=function(_0x283b8b,_0x4ced89){var _0x47f5cd={'raw':!![],'where':{'id':_0x283b8b[_0xae7d('0x46')]['id']}},_0xe48309={};_0xe48309[_0xae7d('0x30')]=_['keys'](db[_0xae7d('0x2d')][_0xae7d('0x47')]);_0xe48309[_0xae7d('0x31')]=_[_0xae7d('0x32')](_0x283b8b['query']);_0xe48309[_0xae7d('0x33')]=_[_0xae7d('0x34')](_0xe48309[_0xae7d('0x30')],_0xe48309[_0xae7d('0x31')]);_0x47f5cd[_0xae7d('0x35')]=_['intersection'](_0xe48309[_0xae7d('0x30')],qs[_0xae7d('0x48')](_0x283b8b[_0xae7d('0x31')][_0xae7d('0x48')]));_0x47f5cd[_0xae7d('0x35')]=_0x47f5cd[_0xae7d('0x35')]['length']?_0x47f5cd['attributes']:_0xe48309['model'];if(_0x283b8b[_0xae7d('0x31')]['includeAll']){_0x47f5cd[_0xae7d('0x41')]=[{'all':!![]}];}_0x47f5cd=_['merge']({},_0x47f5cd,_0x283b8b[_0xae7d('0x3f')]);return db[_0xae7d('0x2d')][_0xae7d('0x49')](_0x47f5cd)[_0xae7d('0x26')](handleEntityNotFound(_0x4ced89,null))['then'](respondWithResult(_0x4ced89,null))[_0xae7d('0x44')](handleError(_0x4ced89,null));};exports[_0xae7d('0x4a')]=function(_0x4dc9a4,_0x2da204){return db['VoiceTransferReport'][_0xae7d('0x4a')](_0x4dc9a4[_0xae7d('0x4b')],{})[_0xae7d('0x26')](respondWithResult(_0x2da204,0xc9))[_0xae7d('0x44')](handleError(_0x2da204,null));};exports[_0xae7d('0x4c')]=function(_0xf536fb,_0x2a01bc){if(_0xf536fb[_0xae7d('0x4b')]['id']){delete _0xf536fb[_0xae7d('0x4b')]['id'];}return db[_0xae7d('0x2d')][_0xae7d('0x49')]({'where':{'id':_0xf536fb['params']['id']}})[_0xae7d('0x26')](handleEntityNotFound(_0x2a01bc,null))[_0xae7d('0x26')](saveUpdates(_0xf536fb[_0xae7d('0x4b')],null))['then'](respondWithResult(_0x2a01bc,null))[_0xae7d('0x44')](handleError(_0x2a01bc,null));};exports[_0xae7d('0x27')]=function(_0x3babe8,_0x8a55bb){return db[_0xae7d('0x2d')][_0xae7d('0x49')]({'where':{'id':_0x3babe8['params']['id']}})[_0xae7d('0x26')](handleEntityNotFound(_0x8a55bb,null))[_0xae7d('0x26')](removeEntity(_0x8a55bb,null))[_0xae7d('0x44')](handleError(_0x8a55bb,null));};exports['describe']=function(_0x5e6286,_0x1c862b){return db[_0xae7d('0x2d')][_0xae7d('0x4d')]()['then'](respondWithResult(_0x1c862b,null))[_0xae7d('0x44')](handleError(_0x1c862b,null));}; \ No newline at end of file +var _0x249c=['describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','intersection','length','catch','create','body','find','params'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0x249c,0x15f));var _0xc249=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0x249c[_0x51639a];return _0x3abae4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc249('0x0'));var zipdir=require(_0xc249('0x1'));var jsonpatch=require(_0xc249('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc249('0x3'));var Mustache=require(_0xc249('0x4'));var util=require(_0xc249('0x5'));var path=require(_0xc249('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc249('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc249('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc249('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc249('0xa'));var querystring=require(_0xc249('0xb'));var Papa=require(_0xc249('0xc'));var Redis=require(_0xc249('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc249('0xe'));var as=require(_0xc249('0xf'));var hardwareService=require(_0xc249('0x10'));var logger=require('../../config/logger')(_0xc249('0x11'));var utils=require(_0xc249('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x725f74,_0x136dbd){_0x136dbd=_0x136dbd||0xcc;return function(_0x58c1d0){if(_0x58c1d0){return _0x725f74[_0xc249('0x13')](_0x136dbd);}return _0x725f74[_0xc249('0x14')](_0x136dbd)[_0xc249('0x15')]();};}function respondWithResult(_0x403508,_0x5138cc){_0x5138cc=_0x5138cc||0xc8;return function(_0x4d6ca0){if(_0x4d6ca0){return _0x403508[_0xc249('0x14')](_0x5138cc)[_0xc249('0x16')](_0x4d6ca0);}};}function respondWithFilteredResult(_0x2bffea,_0x547a37){return function(_0x4d44fc){if(_0x4d44fc){var _0x2885ca=typeof _0x547a37[_0xc249('0x17')]==='undefined'&&typeof _0x547a37[_0xc249('0x18')]==='undefined';var _0x49172a=_0x4d44fc[_0xc249('0x19')];var _0x4169e8=_0x2885ca?0x0:_0x547a37[_0xc249('0x17')];var _0xb95e82=_0x2885ca?_0x4d44fc[_0xc249('0x19')]:_0x547a37[_0xc249('0x17')]+_0x547a37[_0xc249('0x18')];var _0x20b469;if(_0xb95e82>=_0x49172a){_0xb95e82=_0x49172a;_0x20b469=0xc8;}else{_0x20b469=0xce;}_0x2bffea['status'](_0x20b469);return _0x2bffea['set'](_0xc249('0x1a'),_0x4169e8+'-'+_0xb95e82+'/'+_0x49172a)['json'](_0x4d44fc);}return null;};}function patchUpdates(_0x100906){return function(_0x4652b1){try{jsonpatch[_0xc249('0x1b')](_0x4652b1,_0x100906,!![]);}catch(_0x2534b0){return BPromise[_0xc249('0x1c')](_0x2534b0);}return _0x4652b1[_0xc249('0x1d')]();};}function saveUpdates(_0x4caece,_0x2399b9){return function(_0x55e960){if(_0x55e960){return _0x55e960[_0xc249('0x1e')](_0x4caece)[_0xc249('0x1f')](function(_0x27f987){return _0x27f987;});}return null;};}function removeEntity(_0xe340e9,_0x2827b0){return function(_0x728875){if(_0x728875){return _0x728875[_0xc249('0x20')]()[_0xc249('0x1f')](function(){_0xe340e9[_0xc249('0x14')](0xcc)[_0xc249('0x15')]();});}};}function handleEntityNotFound(_0x1ea63d,_0x5d3de0){return function(_0xebbfa2){if(!_0xebbfa2){_0x1ea63d[_0xc249('0x13')](0x194);}return _0xebbfa2;};}function handleError(_0x9a9aa8,_0x187d2a){_0x187d2a=_0x187d2a||0x1f4;return function(_0x1aead7){logger[_0xc249('0x21')](_0x1aead7[_0xc249('0x22')]);if(_0x1aead7[_0xc249('0x23')]){delete _0x1aead7[_0xc249('0x23')];}_0x9a9aa8[_0xc249('0x14')](_0x187d2a)[_0xc249('0x24')](_0x1aead7);};}exports[_0xc249('0x25')]=function(_0x38bcbd,_0x448d31){var _0x2820e8={},_0x52b1cc={},_0x18a392={'count':0x0,'rows':[]};var _0x1afbd1=_[_0xc249('0x26')](db[_0xc249('0x27')][_0xc249('0x28')],function(_0x5193ff){return{'name':_0x5193ff[_0xc249('0x29')],'type':_0x5193ff[_0xc249('0x2a')][_0xc249('0x2b')]};});_0x52b1cc[_0xc249('0x2c')]=_[_0xc249('0x26')](_0x1afbd1,_0xc249('0x23'));_0x52b1cc['query']=_[_0xc249('0x2d')](_0x38bcbd[_0xc249('0x2e')]);_0x52b1cc[_0xc249('0x2f')]=_['intersection'](_0x52b1cc[_0xc249('0x2c')],_0x52b1cc[_0xc249('0x2e')]);_0x2820e8['attributes']=_['intersection'](_0x52b1cc[_0xc249('0x2c')],qs[_0xc249('0x30')](_0x38bcbd['query'][_0xc249('0x30')]));_0x2820e8[_0xc249('0x31')]=_0x2820e8[_0xc249('0x31')]['length']?_0x2820e8[_0xc249('0x31')]:_0x52b1cc[_0xc249('0x2c')];if(!_0x38bcbd[_0xc249('0x2e')]['hasOwnProperty']('nolimit')){_0x2820e8['limit']=qs[_0xc249('0x18')](_0x38bcbd[_0xc249('0x2e')][_0xc249('0x18')]);_0x2820e8[_0xc249('0x17')]=qs[_0xc249('0x17')](_0x38bcbd[_0xc249('0x2e')][_0xc249('0x17')]);}_0x2820e8['order']=qs[_0xc249('0x32')](_0x38bcbd['query'][_0xc249('0x32')]);_0x2820e8['where']=qs[_0xc249('0x2f')](_[_0xc249('0x33')](_0x38bcbd[_0xc249('0x2e')],_0x52b1cc['filters']),_0x1afbd1);if(_0x38bcbd[_0xc249('0x2e')][_0xc249('0x34')]){_0x2820e8['where']=_[_0xc249('0x35')](_0x2820e8[_0xc249('0x36')],{'$or':_[_0xc249('0x26')](_0x1afbd1,function(_0x32078b){if(_0x32078b['type']!==_0xc249('0x37')){var _0x5ca0dd={};_0x5ca0dd[_0x32078b['name']]={'$like':'%'+_0x38bcbd[_0xc249('0x2e')][_0xc249('0x34')]+'%'};return _0x5ca0dd;}})});}_0x2820e8=_[_0xc249('0x35')]({},_0x2820e8,_0x38bcbd[_0xc249('0x38')]);var _0xcc5c7e={'where':_0x2820e8['where']};return db[_0xc249('0x27')]['count'](_0xcc5c7e)[_0xc249('0x1f')](function(_0x29d060){_0x18a392[_0xc249('0x19')]=_0x29d060;if(_0x38bcbd['query'][_0xc249('0x39')]){_0x2820e8[_0xc249('0x3a')]=[{'all':!![]}];}return db[_0xc249('0x27')][_0xc249('0x3b')](_0x2820e8);})['then'](function(_0x237563){_0x18a392[_0xc249('0x3c')]=_0x237563;return _0x18a392;})[_0xc249('0x1f')](respondWithFilteredResult(_0x448d31,_0x2820e8))['catch'](handleError(_0x448d31,null));};exports[_0xc249('0x3d')]=function(_0x130209,_0x4bf7b8){var _0x29bfe9={'raw':!![],'where':{'id':_0x130209['params']['id']}},_0xe1b42={};_0xe1b42[_0xc249('0x2c')]=_[_0xc249('0x2d')](db[_0xc249('0x27')][_0xc249('0x28')]);_0xe1b42[_0xc249('0x2e')]=_[_0xc249('0x2d')](_0x130209[_0xc249('0x2e')]);_0xe1b42[_0xc249('0x2f')]=_[_0xc249('0x3e')](_0xe1b42[_0xc249('0x2c')],_0xe1b42[_0xc249('0x2e')]);_0x29bfe9[_0xc249('0x31')]=_[_0xc249('0x3e')](_0xe1b42[_0xc249('0x2c')],qs[_0xc249('0x30')](_0x130209[_0xc249('0x2e')][_0xc249('0x30')]));_0x29bfe9[_0xc249('0x31')]=_0x29bfe9[_0xc249('0x31')][_0xc249('0x3f')]?_0x29bfe9[_0xc249('0x31')]:_0xe1b42['model'];if(_0x130209[_0xc249('0x2e')][_0xc249('0x39')]){_0x29bfe9[_0xc249('0x3a')]=[{'all':!![]}];}_0x29bfe9=_['merge']({},_0x29bfe9,_0x130209[_0xc249('0x38')]);return db[_0xc249('0x27')]['find'](_0x29bfe9)['then'](handleEntityNotFound(_0x4bf7b8,null))[_0xc249('0x1f')](respondWithResult(_0x4bf7b8,null))[_0xc249('0x40')](handleError(_0x4bf7b8,null));};exports[_0xc249('0x41')]=function(_0x3f03a1,_0x2b3693){return db[_0xc249('0x27')][_0xc249('0x41')](_0x3f03a1['body'],{})[_0xc249('0x1f')](respondWithResult(_0x2b3693,0xc9))['catch'](handleError(_0x2b3693,null));};exports[_0xc249('0x1e')]=function(_0x369f77,_0x34a76f){if(_0x369f77[_0xc249('0x42')]['id']){delete _0x369f77[_0xc249('0x42')]['id'];}return db[_0xc249('0x27')][_0xc249('0x43')]({'where':{'id':_0x369f77[_0xc249('0x44')]['id']}})[_0xc249('0x1f')](handleEntityNotFound(_0x34a76f,null))[_0xc249('0x1f')](saveUpdates(_0x369f77[_0xc249('0x42')],null))[_0xc249('0x1f')](respondWithResult(_0x34a76f,null))[_0xc249('0x40')](handleError(_0x34a76f,null));};exports['destroy']=function(_0x3b360e,_0x3b8802){return db[_0xc249('0x27')]['find']({'where':{'id':_0x3b360e[_0xc249('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b8802,null))[_0xc249('0x1f')](removeEntity(_0x3b8802,null))[_0xc249('0x40')](handleError(_0x3b8802,null));};exports[_0xc249('0x45')]=function(_0x2dccfe,_0x1963df){return db['VoiceTransferReport'][_0xc249('0x45')]()[_0xc249('0x1f')](respondWithResult(_0x1963df,null))[_0xc249('0x40')](handleError(_0x1963df,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b910676..9ee01d1 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 _0xf4c6=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','moment','bluebird'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf4c6,0x19e));var _0x6f4c=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xf4c6[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x6f4c('0x0'));var util=require(_0x6f4c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6f4c('0x2'));var BPromise=require(_0x6f4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f4c('0x4'));var rimraf=require(_0x6f4c('0x5'));var config=require(_0x6f4c('0x6'));var attributes=require(_0x6f4c('0x7'));module[_0x6f4c('0x8')]=function(_0x9aa5a1,_0x44da47){return _0x9aa5a1['define'](_0x6f4c('0x9'),attributes,{'tableName':_0x6f4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddeb=['bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','moment'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0xddeb,0x76));var _0xbdde=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0xddeb[_0x912d27];return _0x31b918;};'use strict';var _=require(_0xbdde('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbdde('0x1'));var BPromise=require(_0xbdde('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdde('0x3'));var rimraf=require(_0xbdde('0x4'));var config=require(_0xbdde('0x5'));var attributes=require(_0xbdde('0x6'));module[_0xbdde('0x7')]=function(_0x59b08f,_0x4aa028){return _0x59b08f[_0xbdde('0x8')](_0xbdde('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 22c450d..10d1de4 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 _0x77c1=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceTransferReport','body','options','raw','CreateVoiceTransferReport','lodash','moment'];(function(_0x254733,_0x3f060d){var _0x18d025=function(_0x4409bd){while(--_0x4409bd){_0x254733['push'](_0x254733['shift']());}};_0x18d025(++_0x3f060d);}(_0x77c1,0x1c9));var _0x177c=function(_0x38b018,_0x331eb3){_0x38b018=_0x38b018-0x0;var _0x8eb524=_0x77c1[_0x38b018];return _0x8eb524;};'use strict';var _=require(_0x177c('0x0'));var util=require('util');var moment=require(_0x177c('0x1'));var BPromise=require('bluebird');var rs=require(_0x177c('0x2'));var fs=require('fs');var Redis=require(_0x177c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x177c('0x4'));var logger=require(_0x177c('0x5'))(_0x177c('0x6'));var config=require(_0x177c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x177c('0x8')][_0x177c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b578e,_0x202ef3,_0x119f3a){return new BPromise(function(_0x98cd0e,_0x305b32){return client[_0x177c('0xa')](_0x3b578e,_0x119f3a)[_0x177c('0xb')](function(_0x14a89d){logger[_0x177c('0xc')](_0x177c('0xd'),_0x202ef3,'request\x20sent');logger[_0x177c('0xe')](_0x177c('0xf'),_0x202ef3,_0x177c('0x10'),JSON[_0x177c('0x11')](_0x14a89d));if(_0x14a89d[_0x177c('0x12')]){if(_0x14a89d['error'][_0x177c('0x13')]===0x1f4){logger[_0x177c('0x12')](_0x177c('0xd'),_0x202ef3,_0x14a89d[_0x177c('0x12')][_0x177c('0x14')]);return _0x305b32(_0x14a89d[_0x177c('0x12')][_0x177c('0x14')]);}logger[_0x177c('0x12')](_0x177c('0xd'),_0x202ef3,_0x14a89d['error'][_0x177c('0x14')]);return _0x98cd0e(_0x14a89d[_0x177c('0x12')]['message']);}else{logger[_0x177c('0xc')](_0x177c('0xd'),_0x202ef3,_0x177c('0x10'));_0x98cd0e(_0x14a89d[_0x177c('0x15')][_0x177c('0x14')]);}})['catch'](function(_0x658aba){logger[_0x177c('0x12')](_0x177c('0xd'),_0x202ef3,_0x658aba);_0x305b32(_0x658aba);});});}exports['CreateVoiceTransferReport']=function(_0xac580a){var _0x363647=this;return new Promise(function(_0x42f291,_0x4120b5){return db[_0x177c('0x16')]['create'](_0xac580a[_0x177c('0x17')],{'raw':_0xac580a[_0x177c('0x18')]?_0xac580a['options'][_0x177c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x506ba4){logger['info'](_0x177c('0x1a'),_0xac580a);logger['debug']('CreateVoiceTransferReport',_0xac580a,JSON[_0x177c('0x11')](_0x506ba4));_0x42f291(_0x506ba4);})['catch'](function(_0x5e8e0a){logger[_0x177c('0x12')](_0x177c('0x1a'),_0x5e8e0a[_0x177c('0x14')],_0xac580a);_0x4120b5(_0x363647['error'](0x1f4,_0x5e8e0a[_0x177c('0x14')]));});});}; \ No newline at end of file +var _0x4980=['options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body'];(function(_0x28d038,_0x225ecf){var _0x5e46b2=function(_0x2b1a7e){while(--_0x2b1a7e){_0x28d038['push'](_0x28d038['shift']());}};_0x5e46b2(++_0x225ecf);}(_0x4980,0x99));var _0x0498=function(_0x8ce582,_0x10b0b7){_0x8ce582=_0x8ce582-0x0;var _0x14bb7b=_0x4980[_0x8ce582];return _0x14bb7b;};'use strict';var _=require(_0x0498('0x0'));var util=require(_0x0498('0x1'));var moment=require(_0x0498('0x2'));var BPromise=require(_0x0498('0x3'));var rs=require(_0x0498('0x4'));var fs=require('fs');var Redis=require(_0x0498('0x5'));var db=require(_0x0498('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0498('0x7'))(_0x0498('0x8'));var config=require(_0x0498('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0498('0xa')][_0x0498('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17aa12,_0x877457,_0x1f7909){return new BPromise(function(_0x49c679,_0x546769){return client[_0x0498('0xc')](_0x17aa12,_0x1f7909)[_0x0498('0xd')](function(_0x28e73c){logger[_0x0498('0xe')](_0x0498('0xf'),_0x877457,_0x0498('0x10'));logger[_0x0498('0x11')](_0x0498('0x12'),_0x877457,_0x0498('0x10'),JSON[_0x0498('0x13')](_0x28e73c));if(_0x28e73c[_0x0498('0x14')]){if(_0x28e73c[_0x0498('0x14')]['code']===0x1f4){logger[_0x0498('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x877457,_0x28e73c[_0x0498('0x14')][_0x0498('0x15')]);return _0x546769(_0x28e73c[_0x0498('0x14')][_0x0498('0x15')]);}logger[_0x0498('0x14')](_0x0498('0xf'),_0x877457,_0x28e73c[_0x0498('0x14')]['message']);return _0x49c679(_0x28e73c[_0x0498('0x14')][_0x0498('0x15')]);}else{logger['info'](_0x0498('0xf'),_0x877457,_0x0498('0x10'));_0x49c679(_0x28e73c[_0x0498('0x16')][_0x0498('0x15')]);}})['catch'](function(_0x551302){logger[_0x0498('0x14')](_0x0498('0xf'),_0x877457,_0x551302);_0x546769(_0x551302);});});}exports[_0x0498('0x17')]=function(_0x1a50eb){var _0x111939=this;return new Promise(function(_0x2d4171,_0xd03a2c){return db[_0x0498('0x18')][_0x0498('0x19')](_0x1a50eb[_0x0498('0x1a')],{'raw':_0x1a50eb[_0x0498('0x1b')]?_0x1a50eb[_0x0498('0x1b')][_0x0498('0x1c')]===undefined?!![]:![]:!![]})[_0x0498('0xd')](function(_0x2c4255){logger[_0x0498('0xe')](_0x0498('0x17'),_0x1a50eb);logger[_0x0498('0x11')](_0x0498('0x17'),_0x1a50eb,JSON[_0x0498('0x13')](_0x2c4255));_0x2d4171(_0x2c4255);})[_0x0498('0x1d')](function(_0xe93e2d){logger[_0x0498('0x14')](_0x0498('0x17'),_0xe93e2d['message'],_0x1a50eb);_0xd03a2c(_0x111939[_0x0498('0x14')](0x1f4,_0xe93e2d['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 33f02e8..880dfc9 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 _0x99cf=['originate','hangup','/answer','answer','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated','canUpdate'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x99cf,0x89));var _0xf99c=function(_0x51860c,_0x336545){_0x51860c=_0x51860c-0x0;var _0x575168=_0x99cf[_0x51860c];return _0x575168;};'use strict';var express=require(_0xf99c('0x0'));var router=express[_0xf99c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xf99c('0x2'));router[_0xf99c('0x3')](_0xf99c('0x4'),auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller[_0xf99c('0x7')]);router[_0xf99c('0x3')]('/hangup',auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller[_0xf99c('0x8')]);router[_0xf99c('0x3')](_0xf99c('0x9'),auth['isAuthenticated'](),auth[_0xf99c('0x6')](),controller[_0xf99c('0xa')]);router['post'](_0xf99c('0xb'),auth['isAuthenticated'](),auth[_0xf99c('0x6')](),controller['hold']);router[_0xf99c('0x3')](_0xf99c('0xc'),auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller[_0xf99c('0xd')]);router[_0xf99c('0x3')](_0xf99c('0xe'),auth[_0xf99c('0x5')](),auth[_0xf99c('0x6')](),controller['calls']);router[_0xf99c('0x3')](_0xf99c('0xf'),auth[_0xf99c('0x5')](),auth['canUpdate'](),controller[_0xf99c('0x10')]);module[_0xf99c('0x11')]=router; \ No newline at end of file +var _0xa95e=['/answer','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','isAuthenticated','canUpdate','post','/hangup','hangup'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa95e,0x123));var _0xea95=function(_0x39beb0,_0x5708ea){_0x39beb0=_0x39beb0-0x0;var _0x2b029b=_0xa95e[_0x39beb0];return _0x2b029b;};'use strict';var express=require(_0xea95('0x0'));var router=express[_0xea95('0x1')]();var auth=require(_0xea95('0x2'));var controller=require(_0xea95('0x3'));router['post']('/originate',auth[_0xea95('0x4')](),auth[_0xea95('0x5')](),controller['originate']);router[_0xea95('0x6')](_0xea95('0x7'),auth[_0xea95('0x4')](),auth[_0xea95('0x5')](),controller[_0xea95('0x8')]);router[_0xea95('0x6')](_0xea95('0x9'),auth[_0xea95('0x4')](),auth[_0xea95('0x5')](),controller[_0xea95('0xa')]);router[_0xea95('0x6')](_0xea95('0xb'),auth[_0xea95('0x4')](),auth[_0xea95('0x5')](),controller[_0xea95('0xc')]);router['post'](_0xea95('0xd'),auth[_0xea95('0x4')](),auth[_0xea95('0x5')](),controller[_0xea95('0xe')]);router[_0xea95('0x6')](_0xea95('0xf'),auth[_0xea95('0x4')](),auth[_0xea95('0x5')](),controller[_0xea95('0x10')]);router[_0xea95('0x6')](_0xea95('0x11'),auth['isAuthenticated'](),auth[_0xea95('0x5')](),controller[_0xea95('0x12')]);module[_0xea95('0x13')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 7d022ec..2860e95 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 _0x55e0=['NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup\x20fired:','userId','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send'];(function(_0x395f4a,_0x53aec1){var _0x5a3a86=function(_0x3afd21){while(--_0x3afd21){_0x395f4a['push'](_0x395f4a['shift']());}};_0x5a3a86(++_0x53aec1);}(_0x55e0,0xdc));var _0x055e=function(_0x4fa804,_0x595aec){_0x4fa804=_0x4fa804-0x0;var _0x335b27=_0x55e0[_0x4fa804];return _0x335b27;};'use strict';var path=require(_0x055e('0x0'));var fs=require('fs');var _=require(_0x055e('0x1'));var db=require(_0x055e('0x2'))['db'];var config=require(_0x055e('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x055e('0x4'));var amiClient=jayson[_0x055e('0x5')][_0x055e('0x6')]({'port':0x232a});var logger=require(_0x055e('0x7'))(_0x055e('0x8'));var Redis=require(_0x055e('0x9'));config['redis']=_['defaults'](config[_0x055e('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x055e('0xb'))(new Redis(config[_0x055e('0xa')]));var Schema=require(_0x055e('0xc'));var originateValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'callNumber':{'type':'string','required':[!![],_0x055e('0xf')]},'callerId':{'type':_0x055e('0x10')},'callbackUrl':{'type':_0x055e('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x055e('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':_0x055e('0x10'),'required':[!![],_0x055e('0x11')]},'transferNumber':{'type':_0x055e('0x10'),'required':[!![],_0x055e('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x055e('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':_0x055e('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]}});function emit(_0x111cdb,_0x599533,_0x3f2d0e){logger[_0x055e('0x13')](_0x111cdb,_0x599533,JSON[_0x055e('0x14')](_0x3f2d0e));io['to'](_0x111cdb)[_0x055e('0x15')](_0x599533,_0x3f2d0e);}function handleError(_0x2cc84e){return function(_0x4c85dd){console[_0x055e('0x16')](_0x055e('0x17'),_0x4c85dd,_0x4c85dd instanceof RangeError);logger[_0x055e('0x18')](_0x4c85dd[_0x055e('0x19')]);if(_0x4c85dd instanceof RangeError){if(_0x4c85dd['name']){delete _0x4c85dd[_0x055e('0x1a')];}_0x2cc84e[_0x055e('0x1b')](0x194)['send'](_0x4c85dd);}else{if(_0x4c85dd[_0x055e('0x1a')]){delete _0x4c85dd[_0x055e('0x1a')];}_0x2cc84e[_0x055e('0x1b')](0x1f4)[_0x055e('0x1c')](_0x4c85dd);}};}function checkError(){return function(_0x4280cf){if(!_0x4280cf){throw new RangeError(_0x055e('0x1d'));}return _0x4280cf;};}function respondWithRpcPromise(_0x53b766,_0x31c355){return new BPromise(function(_0x2f0346,_0x211594){var _0x5930ff=amiClient;return _0x5930ff[_0x055e('0x1e')](_0x53b766,_0x31c355)[_0x055e('0x1f')](function(_0x32c64e){if(_0x32c64e[_0x055e('0x18')]){if(_0x32c64e['error'][_0x055e('0x20')]===0x1f4){return _0x211594(_0x32c64e['error'][_0x055e('0x21')]);}return _0x2f0346(_0x32c64e[_0x055e('0x18')][_0x055e('0x21')]);}else{_0x2f0346(_0x32c64e[_0x055e('0x22')]);}})[_0x055e('0x23')](function(_0x4c653c){_0x211594(_0x4c653c);});});}function getAgent(_0x58caf9){return db[_0x055e('0x24')][_0x055e('0x25')]({'where':{'id':_0x58caf9,'role':_0x055e('0x26')}})['then'](checkError());}function getAgentCheckSession(_0x408e38,_0x29078a){return new BPromise(function(_0x42f2df,_0x2ef064){var _0x59539d=respondWithRpcPromise(_0x055e('0x27'));var _0x5958ef=getAgent(_0x408e38);Promise[_0x055e('0x28')]([_0x59539d,_0x5958ef])[_0x055e('0x1f')](function(_0x23a506){var _0x7822db=_0x23a506[0x0];var _0x1610f1=_0x23a506[0x1];var _0x5c0e76=_[_0x055e('0x29')](_0x7822db[_0x055e('0x2a')],function(_0x293062){return _0x293062[_0x055e('0x2b')]==_0x1610f1['id']&&_0x293062[_0x055e('0x2c')]==_0x29078a;});if(_0x5c0e76[_0x055e('0x2d')]==0x1){_0x42f2df(_0x1610f1);}else{_0x2ef064(new RangeError(_0x055e('0x2e')+_0x29078a+_0x055e('0x2f')));}});});}exports['originate']=function(_0x26d1c2,_0x43ec84){logger['info'](_0x055e('0x30'),_0x26d1c2[_0x055e('0x31')]);var _0x524344=originateValidation[_0x055e('0xc')](_0x26d1c2[_0x055e('0x31')]);if(_0x524344[_0x055e('0x2d')]>0x0){return _0x43ec84['status'](0x190)['json'](_0x524344);}var _0x25d19d=_0x26d1c2['body']['userId'];var _0x55a1ee=_0x26d1c2[_0x055e('0x31')][_0x055e('0x32')];var _0x35c6cf=_0x26d1c2[_0x055e('0x31')][_0x055e('0x33')];var _0x16a4fa=_0x26d1c2[_0x055e('0x31')][_0x055e('0x34')];return getAgent(_0x25d19d)[_0x055e('0x1f')](function(_0x2f60fa){logger[_0x055e('0x13')](_0x055e('0x35'),_0x2f60fa['name']);emit(util['format'](_0x055e('0x36'),_0x2f60fa[_0x055e('0x1a')]),_0x055e('0x37'),{'callNumber':_0x55a1ee,'callerId':_0x35c6cf,'callbackUrl':_0x16a4fa});return _0x43ec84[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x39')});})[_0x055e('0x23')](handleError(_0x43ec84));};exports['hangup']=function(_0x18b88e,_0x265fed){logger[_0x055e('0x13')](_0x055e('0x3a'),_0x18b88e[_0x055e('0x31')]);var _0x585b8a=hangupValidation[_0x055e('0xc')](_0x18b88e[_0x055e('0x31')]);if(_0x585b8a['length']>0x0){return _0x265fed[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x585b8a);}var _0x4a97ab=_0x18b88e[_0x055e('0x31')][_0x055e('0x3b')];var _0x4e424b=_0x18b88e[_0x055e('0x31')][_0x055e('0x2c')];return getAgent(_0x4a97ab)['then'](function(_0x1012a4){logger[_0x055e('0x13')](_0x055e('0x35'),_0x1012a4['name']);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x1012a4['name']),_0x055e('0x3d'),{'sessionId':_0x4e424b});return _0x265fed[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':'hangup\x20executed!'});})[_0x055e('0x23')](handleError(_0x265fed));};exports[_0x055e('0x3e')]=function(_0x176a2d,_0x4fa534){logger['info'](_0x055e('0x3f'),_0x176a2d[_0x055e('0x31')]);var _0x4ff19e=answerValidation[_0x055e('0xc')](_0x176a2d['body']);if(_0x4ff19e[_0x055e('0x2d')]>0x0){return _0x4fa534['status'](0x190)[_0x055e('0x38')](_0x4ff19e);}var _0x31c57a=_0x176a2d[_0x055e('0x31')]['userId'];var _0x57483c=_0x176a2d[_0x055e('0x31')][_0x055e('0x2c')];return getAgent(_0x31c57a)[_0x055e('0x1f')](function(_0x445d74){logger['info']('entityFound:',_0x445d74[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')]('user:%s',_0x445d74[_0x055e('0x1a')]),_0x055e('0x40'),{'sessionId':_0x57483c});return _0x4fa534[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x41')});})[_0x055e('0x23')](handleError(_0x4fa534));};exports['hold']=function(_0x297edd,_0x118a0e){logger['info'](_0x055e('0x42'),_0x297edd[_0x055e('0x31')]);var _0x341c46=holdValidation[_0x055e('0xc')](_0x297edd[_0x055e('0x31')]);if(_0x341c46[_0x055e('0x2d')]>0x0){return _0x118a0e[_0x055e('0x1b')](0x190)['json'](_0x341c46);}var _0x35b2c6=_0x297edd['body'][_0x055e('0x3b')];var _0xed7611=_0x297edd[_0x055e('0x31')]['sessionId'];return getAgent(_0x35b2c6)['then'](function(_0x45845e){logger[_0x055e('0x13')](_0x055e('0x35'),_0x45845e[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x45845e[_0x055e('0x1a')]),_0x055e('0x43'),{'sessionId':_0xed7611});return _0x118a0e[_0x055e('0x1b')](0xc8)['json']({'error':![],'message':_0x055e('0x44')});})[_0x055e('0x23')](handleError(_0x118a0e));};exports[_0x055e('0x45')]=function(_0x17695b,_0x335415){logger['info'](_0x055e('0x46'),_0x17695b[_0x055e('0x31')]);var _0x3e7fa6=unholdValidation['validate'](_0x17695b[_0x055e('0x31')]);if(_0x3e7fa6['length']>0x0){return _0x335415[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x3e7fa6);}var _0x49129a=_0x17695b[_0x055e('0x31')][_0x055e('0x3b')];var _0x3e6329=_0x17695b['body']['sessionId'];return getAgent(_0x49129a)[_0x055e('0x1f')](function(_0x413778){logger[_0x055e('0x13')](_0x055e('0x35'),_0x413778[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x413778[_0x055e('0x1a')]),_0x055e('0x47'),{'sessionId':_0x3e6329});return _0x335415[_0x055e('0x1b')](0xc8)['json']({'error':![],'message':_0x055e('0x48')});})[_0x055e('0x23')](handleError(_0x335415));};exports[_0x055e('0x49')]=function(_0x200b53,_0x57a9e4){logger[_0x055e('0x13')](_0x055e('0x4a'),_0x57a9e4[_0x055e('0x31')]);var _0x3eb1a1=callsValidation['validate'](_0x200b53['body']);if(_0x3eb1a1[_0x055e('0x2d')]>0x0){return _0x57a9e4[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x3eb1a1);}var _0x2fbb1c=_0x200b53[_0x055e('0x31')][_0x055e('0x3b')];var _0x3876d0=respondWithRpcPromise(_0x055e('0x27'));var _0x56db9c=getAgent(_0x2fbb1c);return Promise['all']([_0x3876d0,_0x56db9c])[_0x055e('0x1f')](function(_0x33592d){var _0x5240d5=_0x33592d[0x0];var _0x143e8c=_0x33592d[0x1];var _0x16dd1e=_[_0x055e('0x29')](_0x5240d5[_0x055e('0x2a')],function(_0x50aa1f){return _0x50aa1f[_0x055e('0x2b')]==_0x143e8c['id'];});return _0x57a9e4[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'count':_0x16dd1e[_0x055e('0x2d')],'rows':_0x16dd1e});})[_0x055e('0x23')](handleError(_0x57a9e4));};exports[_0x055e('0x4b')]=function(_0x2075db,_0x31935b){logger['info'](_0x055e('0x4c'),_0x2075db[_0x055e('0x31')]);var _0x5bd8f0=conferenceValidation[_0x055e('0xc')](_0x2075db[_0x055e('0x31')]);if(_0x5bd8f0[_0x055e('0x2d')]>0x0){return _0x31935b[_0x055e('0x1b')](0x190)['json'](_0x5bd8f0);}var _0x8b7e45=_0x2075db[_0x055e('0x31')][_0x055e('0x3b')];return getAgent(_0x8b7e45)['then'](function(_0x329d46){logger[_0x055e('0x13')](_0x055e('0x35'),_0x329d46[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')]('user:%s',_0x329d46[_0x055e('0x1a')]),_0x055e('0x4d'));return _0x31935b[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x4e')});})['catch'](handleError(_0x31935b));};exports[_0x055e('0x4f')]=function(_0x34c805,_0x107b88){logger['info'](_0x055e('0x50'),_0x34c805[_0x055e('0x31')]);var _0x3ecc65=transferValidation[_0x055e('0xc')](_0x34c805[_0x055e('0x31')]);if(_0x3ecc65['length']>0x0){return _0x107b88[_0x055e('0x1b')](0x190)['json'](_0x3ecc65);}var _0x24ac0c=_0x34c805[_0x055e('0x31')]['userId'];var _0x3137bb=_0x34c805[_0x055e('0x31')][_0x055e('0x2c')];var _0x2bdf06=_0x34c805['body']['transferNumber'];return getAgent(_0x24ac0c)[_0x055e('0x1f')](function(_0x5e4f42){logger[_0x055e('0x13')](_0x055e('0x35'),_0x5e4f42[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x5e4f42[_0x055e('0x1a')]),_0x055e('0x51'),{'sessionId':_0x3137bb,'transferNumber':_0x2bdf06});return _0x107b88[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x52')});})['catch'](handleError(_0x107b88));}; \ No newline at end of file +var _0x1b32=['emit','log','handleError:','error','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','validate','length','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup\x20fired:','hangup\x20executed!','catch','answer','answer\x20fired:','webbar:answer','hold','sessionId','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info'];(function(_0x42b8f5,_0x4b9730){var _0x31ca50=function(_0x2060a){while(--_0x2060a){_0x42b8f5['push'](_0x42b8f5['shift']());}};_0x31ca50(++_0x4b9730);}(_0x1b32,0x85));var _0x21b3=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x1b32[_0x3e44fa];return _0x2a0aba;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x21b3('0x0'));var db=require(_0x21b3('0x1'))['db'];var config=require(_0x21b3('0x2'));var util=require(_0x21b3('0x3'));var BPromise=require(_0x21b3('0x4'));var jayson=require(_0x21b3('0x5'));var amiClient=jayson[_0x21b3('0x6')][_0x21b3('0x7')]({'port':0x232a});var logger=require(_0x21b3('0x8'))(_0x21b3('0x9'));var Redis=require(_0x21b3('0xa'));config[_0x21b3('0xb')]=_[_0x21b3('0xc')](config[_0x21b3('0xb')],{'host':_0x21b3('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21b3('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x21b3('0xe'),'required':[!![],_0x21b3('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x21b3('0x10'),'required':[!![],_0x21b3('0x11')]},'sessionId':{'type':_0x21b3('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x21b3('0x11')]},'sessionId':{'type':_0x21b3('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x21b3('0x10'),'required':[!![],_0x21b3('0x11')]},'sessionId':{'type':_0x21b3('0xe'),'required':[!![],_0x21b3('0x12')]},'transferNumber':{'type':_0x21b3('0xe'),'required':[!![],_0x21b3('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x21b3('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x21b3('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x21b3('0x10'),'required':[!![],_0x21b3('0x11')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x21b3('0x10'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x21b3('0x10'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x15662a,_0xe6b2b7,_0x29f286){logger[_0x21b3('0x14')](_0x15662a,_0xe6b2b7,JSON['stringify'](_0x29f286));io['to'](_0x15662a)[_0x21b3('0x15')](_0xe6b2b7,_0x29f286);}function handleError(_0x47ae6c){return function(_0x408c17){console[_0x21b3('0x16')](_0x21b3('0x17'),_0x408c17,_0x408c17 instanceof RangeError);logger[_0x21b3('0x18')](_0x408c17['stack']);if(_0x408c17 instanceof RangeError){if(_0x408c17[_0x21b3('0x19')]){delete _0x408c17[_0x21b3('0x19')];}_0x47ae6c[_0x21b3('0x1a')](0x194)['send'](_0x408c17);}else{if(_0x408c17[_0x21b3('0x19')]){delete _0x408c17[_0x21b3('0x19')];}_0x47ae6c[_0x21b3('0x1a')](0x1f4)[_0x21b3('0x1b')](_0x408c17);}};}function checkError(){return function(_0x360e57){if(!_0x360e57){throw new RangeError(_0x21b3('0x1c'));}return _0x360e57;};}function respondWithRpcPromise(_0x1e5181,_0x4cc8e0){return new BPromise(function(_0xbb78f3,_0x54695b){var _0x139672=amiClient;return _0x139672[_0x21b3('0x1d')](_0x1e5181,_0x4cc8e0)[_0x21b3('0x1e')](function(_0x4fcb87){if(_0x4fcb87[_0x21b3('0x18')]){if(_0x4fcb87['error'][_0x21b3('0x1f')]===0x1f4){return _0x54695b(_0x4fcb87[_0x21b3('0x18')][_0x21b3('0x20')]);}return _0xbb78f3(_0x4fcb87[_0x21b3('0x18')][_0x21b3('0x20')]);}else{_0xbb78f3(_0x4fcb87[_0x21b3('0x21')]);}})['catch'](function(_0x5b752c){_0x54695b(_0x5b752c);});});}function getAgent(_0x49aab8){return db[_0x21b3('0x22')][_0x21b3('0x23')]({'where':{'id':_0x49aab8,'role':_0x21b3('0x24')}})[_0x21b3('0x1e')](checkError());}function getAgentCheckSession(_0x18eba4,_0x58a356){return new BPromise(function(_0x170e78,_0x564313){var _0x16d012=respondWithRpcPromise('VoiceChannels');var _0x469e42=getAgent(_0x18eba4);Promise[_0x21b3('0x25')]([_0x16d012,_0x469e42])[_0x21b3('0x1e')](function(_0x4f6432){var _0x291e52=_0x4f6432[0x0];var _0x300977=_0x4f6432[0x1];var _0x336b1e=_[_0x21b3('0x26')](_0x291e52[_0x21b3('0x27')],function(_0x210c49){return _0x210c49[_0x21b3('0x28')]==_0x300977['id']&&_0x210c49['sessionId']==_0x58a356;});if(_0x336b1e['length']==0x1){_0x170e78(_0x300977);}else{_0x564313(new RangeError(_0x21b3('0x29')+_0x58a356+_0x21b3('0x2a')));}});});}exports['originate']=function(_0x45c753,_0xa04ac7){logger[_0x21b3('0x14')](_0x21b3('0x2b'),_0x45c753[_0x21b3('0x2c')]);var _0x6c56f5=originateValidation[_0x21b3('0x2d')](_0x45c753[_0x21b3('0x2c')]);if(_0x6c56f5[_0x21b3('0x2e')]>0x0){return _0xa04ac7['status'](0x190)['json'](_0x6c56f5);}var _0x18946f=_0x45c753['body'][_0x21b3('0x2f')];var _0x2d8c12=_0x45c753['body'][_0x21b3('0x30')];var _0x403cec=_0x45c753[_0x21b3('0x2c')][_0x21b3('0x31')];var _0x4c4239=_0x45c753[_0x21b3('0x2c')][_0x21b3('0x32')];return getAgent(_0x18946f)[_0x21b3('0x1e')](function(_0x118b9b){logger['info'](_0x21b3('0x33'),_0x118b9b['name']);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0x118b9b[_0x21b3('0x19')]),_0x21b3('0x36'),{'callNumber':_0x2d8c12,'callerId':_0x403cec,'callbackUrl':_0x4c4239});return _0xa04ac7[_0x21b3('0x1a')](0xc8)[_0x21b3('0x37')]({'error':![],'message':_0x21b3('0x38')});})['catch'](handleError(_0xa04ac7));};exports['hangup']=function(_0x28641f,_0x86027e){logger[_0x21b3('0x14')](_0x21b3('0x39'),_0x28641f['body']);var _0x1c190e=hangupValidation[_0x21b3('0x2d')](_0x28641f[_0x21b3('0x2c')]);if(_0x1c190e[_0x21b3('0x2e')]>0x0){return _0x86027e[_0x21b3('0x1a')](0x190)[_0x21b3('0x37')](_0x1c190e);}var _0xbb93cd=_0x28641f[_0x21b3('0x2c')][_0x21b3('0x2f')];var _0x3145b2=_0x28641f[_0x21b3('0x2c')]['sessionId'];return getAgent(_0xbb93cd)[_0x21b3('0x1e')](function(_0x321050){logger['info'](_0x21b3('0x33'),_0x321050['name']);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0x321050['name']),'webbar:hangup',{'sessionId':_0x3145b2});return _0x86027e['status'](0xc8)[_0x21b3('0x37')]({'error':![],'message':_0x21b3('0x3a')});})[_0x21b3('0x3b')](handleError(_0x86027e));};exports[_0x21b3('0x3c')]=function(_0x548652,_0x5d310c){logger[_0x21b3('0x14')](_0x21b3('0x3d'),_0x548652[_0x21b3('0x2c')]);var _0x28adbc=answerValidation[_0x21b3('0x2d')](_0x548652[_0x21b3('0x2c')]);if(_0x28adbc[_0x21b3('0x2e')]>0x0){return _0x5d310c['status'](0x190)[_0x21b3('0x37')](_0x28adbc);}var _0x44cf7d=_0x548652[_0x21b3('0x2c')][_0x21b3('0x2f')];var _0x119b43=_0x548652[_0x21b3('0x2c')]['sessionId'];return getAgent(_0x44cf7d)['then'](function(_0x1e7e1b){logger[_0x21b3('0x14')](_0x21b3('0x33'),_0x1e7e1b['name']);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0x1e7e1b[_0x21b3('0x19')]),_0x21b3('0x3e'),{'sessionId':_0x119b43});return _0x5d310c[_0x21b3('0x1a')](0xc8)[_0x21b3('0x37')]({'error':![],'message':'answer\x20executed!'});})[_0x21b3('0x3b')](handleError(_0x5d310c));};exports[_0x21b3('0x3f')]=function(_0x3bc4ef,_0x4e3d2b){logger['info']('hold\x20fired:',_0x3bc4ef[_0x21b3('0x2c')]);var _0x17b878=holdValidation[_0x21b3('0x2d')](_0x3bc4ef[_0x21b3('0x2c')]);if(_0x17b878[_0x21b3('0x2e')]>0x0){return _0x4e3d2b[_0x21b3('0x1a')](0x190)[_0x21b3('0x37')](_0x17b878);}var _0x30d48b=_0x3bc4ef[_0x21b3('0x2c')]['userId'];var _0x542ef4=_0x3bc4ef['body'][_0x21b3('0x40')];return getAgent(_0x30d48b)[_0x21b3('0x1e')](function(_0x4046cd){logger[_0x21b3('0x14')](_0x21b3('0x33'),_0x4046cd[_0x21b3('0x19')]);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0x4046cd[_0x21b3('0x19')]),_0x21b3('0x41'),{'sessionId':_0x542ef4});return _0x4e3d2b['status'](0xc8)[_0x21b3('0x37')]({'error':![],'message':_0x21b3('0x42')});})[_0x21b3('0x3b')](handleError(_0x4e3d2b));};exports[_0x21b3('0x43')]=function(_0x34509e,_0x2c7019){logger[_0x21b3('0x14')](_0x21b3('0x44'),_0x34509e[_0x21b3('0x2c')]);var _0x58c568=unholdValidation[_0x21b3('0x2d')](_0x34509e[_0x21b3('0x2c')]);if(_0x58c568[_0x21b3('0x2e')]>0x0){return _0x2c7019[_0x21b3('0x1a')](0x190)[_0x21b3('0x37')](_0x58c568);}var _0x5d7ee7=_0x34509e['body'][_0x21b3('0x2f')];var _0x4bd19f=_0x34509e[_0x21b3('0x2c')][_0x21b3('0x40')];return getAgent(_0x5d7ee7)[_0x21b3('0x1e')](function(_0x412536){logger['info']('entityFound:',_0x412536[_0x21b3('0x19')]);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0x412536[_0x21b3('0x19')]),'webbar:unhold',{'sessionId':_0x4bd19f});return _0x2c7019[_0x21b3('0x1a')](0xc8)['json']({'error':![],'message':_0x21b3('0x45')});})[_0x21b3('0x3b')](handleError(_0x2c7019));};exports['calls']=function(_0x5f55ff,_0x3fd841){logger[_0x21b3('0x14')](_0x21b3('0x46'),_0x3fd841[_0x21b3('0x2c')]);var _0xc612b5=callsValidation[_0x21b3('0x2d')](_0x5f55ff[_0x21b3('0x2c')]);if(_0xc612b5['length']>0x0){return _0x3fd841[_0x21b3('0x1a')](0x190)[_0x21b3('0x37')](_0xc612b5);}var _0x166a31=_0x5f55ff[_0x21b3('0x2c')][_0x21b3('0x2f')];var _0x49a40e=respondWithRpcPromise('VoiceChannels');var _0x31c8f8=getAgent(_0x166a31);return Promise[_0x21b3('0x25')]([_0x49a40e,_0x31c8f8])[_0x21b3('0x1e')](function(_0x279b7d){var _0x18582e=_0x279b7d[0x0];var _0x4f728=_0x279b7d[0x1];var _0x5b1611=_[_0x21b3('0x26')](_0x18582e[_0x21b3('0x27')],function(_0x552141){return _0x552141[_0x21b3('0x28')]==_0x4f728['id'];});return _0x3fd841['status'](0xc8)[_0x21b3('0x37')]({'count':_0x5b1611[_0x21b3('0x2e')],'rows':_0x5b1611});})[_0x21b3('0x3b')](handleError(_0x3fd841));};exports[_0x21b3('0x47')]=function(_0x542c4e,_0x193317){logger['info'](_0x21b3('0x48'),_0x542c4e[_0x21b3('0x2c')]);var _0x3d285f=conferenceValidation[_0x21b3('0x2d')](_0x542c4e[_0x21b3('0x2c')]);if(_0x3d285f['length']>0x0){return _0x193317[_0x21b3('0x1a')](0x190)[_0x21b3('0x37')](_0x3d285f);}var _0x1821bf=_0x542c4e[_0x21b3('0x2c')][_0x21b3('0x2f')];return getAgent(_0x1821bf)[_0x21b3('0x1e')](function(_0xf6eb3){logger[_0x21b3('0x14')](_0x21b3('0x33'),_0xf6eb3[_0x21b3('0x19')]);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0xf6eb3[_0x21b3('0x19')]),_0x21b3('0x49'));return _0x193317[_0x21b3('0x1a')](0xc8)[_0x21b3('0x37')]({'error':![],'message':_0x21b3('0x4a')});})[_0x21b3('0x3b')](handleError(_0x193317));};exports['transfer']=function(_0x412e3b,_0xc0c8f){logger[_0x21b3('0x14')]('transfer\x20fired:',_0x412e3b[_0x21b3('0x2c')]);var _0x3572e1=transferValidation[_0x21b3('0x2d')](_0x412e3b['body']);if(_0x3572e1[_0x21b3('0x2e')]>0x0){return _0xc0c8f[_0x21b3('0x1a')](0x190)[_0x21b3('0x37')](_0x3572e1);}var _0x1655e4=_0x412e3b[_0x21b3('0x2c')][_0x21b3('0x2f')];var _0x2d33a7=_0x412e3b['body']['sessionId'];var _0x31c511=_0x412e3b['body'][_0x21b3('0x4b')];return getAgent(_0x1655e4)[_0x21b3('0x1e')](function(_0x164d9f){logger['info'](_0x21b3('0x33'),_0x164d9f[_0x21b3('0x19')]);emit(util[_0x21b3('0x34')](_0x21b3('0x35'),_0x164d9f[_0x21b3('0x19')]),_0x21b3('0x4c'),{'sessionId':_0x2d33a7,'transferNumber':_0x31c511});return _0xc0c8f[_0x21b3('0x1a')](0xc8)[_0x21b3('0x37')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0xc0c8f));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 0216448..6b3d4ec 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x47c5,0x165));var _0x547c=function(_0x14df7f,_0x12da2c){_0x14df7f=_0x14df7f-0x0;var _0x36ee87=_0x47c5[_0x14df7f];return _0x36ee87;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router; \ No newline at end of file +var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x42947b,_0x276abd){var _0x3cd605=function(_0x26c467){while(--_0x26c467){_0x42947b['push'](_0x42947b['shift']());}};_0x3cd605(++_0x276abd);}(_0x524e,0x15e));var _0xe524=function(_0x597b8a,_0x5c22cd){_0x597b8a=_0x597b8a-0x0;var _0x48d778=_0x524e[_0x597b8a];return _0x48d778;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b847b71..fb071d5 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 _0xc946=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x580d96,_0x2d9db1){var _0x4dece4=function(_0x1aea15){while(--_0x1aea15){_0x580d96['push'](_0x580d96['shift']());}};_0x4dece4(++_0x2d9db1);}(_0xc946,0x7b));var _0x6c94=function(_0x93fc54,_0xfa543f){_0x93fc54=_0x93fc54-0x0;var _0x54d6a4=_0xc946[_0x93fc54];return _0x54d6a4;};'use strict';var Sequelize=require(_0x6c94('0x0'));var rs=require(_0x6c94('0x1'));module[_0x6c94('0x2')]={'name':{'type':Sequelize[_0x6c94('0x3')],'unique':_0x6c94('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6c94('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6c94('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6c94('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6c94('0x5')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x6c94('0x3')]},'baseUrl':{'type':Sequelize[_0x6c94('0x3')]},'authToken':{'type':Sequelize[_0x6c94('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6c94('0x6');}},'notificationSound':{'type':Sequelize[_0x6c94('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6c94('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6c94('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6c94('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6c94('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6c94('0x8')],'comment':_0x6c94('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6c94('0xa'),'set':function(_0x366bfc){if(!_0x366bfc){this['setDataValue'](_0x6c94('0xb'),null);}this['setDataValue'](_0x6c94('0xc'),_0x366bfc);}},'description':{'type':Sequelize[_0x6c94('0x3')]}}; \ No newline at end of file +var _0xa554=['generate','ENUM','twilio','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x59bda6,_0x34fcff){var _0x44e505=function(_0x5f426a){while(--_0x5f426a){_0x59bda6['push'](_0x59bda6['shift']());}};_0x44e505(++_0x34fcff);}(_0xa554,0xfa));var _0x4a55=function(_0x24203d,_0x326111){_0x24203d=_0x24203d-0x0;var _0x4952f8=_0xa554[_0x24203d];return _0x4952f8;};'use strict';var Sequelize=require(_0x4a55('0x0'));var rs=require(_0x4a55('0x1'));module[_0x4a55('0x2')]={'name':{'type':Sequelize[_0x4a55('0x3')],'unique':_0x4a55('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x4a55('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x4a55('0x3')],'defaultValue':function(){return rs[_0x4a55('0x5')]();}},'phone':{'type':Sequelize[_0x4a55('0x3')]},'type':{'type':Sequelize[_0x4a55('0x6')](_0x4a55('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0x4a55('0x3')]},'baseUrl':{'type':Sequelize[_0x4a55('0x3')]},'authToken':{'type':Sequelize[_0x4a55('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4a55('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4a55('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4a55('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4a55('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4a55('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4a55('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4a55('0x9')],'defaultValue':![],'comment':_0x4a55('0xb'),'set':function(_0x937318){if(!_0x937318){this[_0x4a55('0xc')](_0x4a55('0xd'),null);}this[_0x4a55('0xc')](_0x4a55('0xe'),_0x937318);}},'description':{'type':Sequelize[_0x4a55('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index aabcbcb..687263a 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 _0x0f94=['whatsapp:','Body','MessageSid','sinch','notifications','messageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','omit','defaults','contact','WhatsappInteraction','interaction','created','push','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','json','to\x20is\x20mandatory','List','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','jayson/promise','client','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','addAgents','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','AC\x20WhatsappAccount\x20notify','Applications','applications','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','AC\x20sinch\x20attributes:%s','stringify','difference','createdAt','updatedAt','CompanyId','ListId','mobile','AC\x20sinch\x20contactKeys:%s','from','replace'];(function(_0x5eb009,_0x56d2f4){var _0x38b580=function(_0xca3fe6){while(--_0xca3fe6){_0x5eb009['push'](_0x5eb009['shift']());}};_0x38b580(++_0x56d2f4);}(_0x0f94,0x1ad));var _0x40f9=function(_0x469bbf,_0x559555){_0x469bbf=_0x469bbf-0x0;var _0x4f7b25=_0x0f94[_0x469bbf];return _0x4f7b25;};'use strict';var emlformat=require(_0x40f9('0x0'));var rimraf=require(_0x40f9('0x1'));var zipdir=require(_0x40f9('0x2'));var jsonpatch=require(_0x40f9('0x3'));var rp=require(_0x40f9('0x4'));var moment=require(_0x40f9('0x5'));var BPromise=require(_0x40f9('0x6'));var Mustache=require(_0x40f9('0x7'));var util=require(_0x40f9('0x8'));var path=require(_0x40f9('0x9'));var sox=require(_0x40f9('0xa'));var csv=require('to-csv');var ejs=require(_0x40f9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40f9('0xc'));var squel=require(_0x40f9('0xd'));var crypto=require('crypto');var jsforce=require(_0x40f9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x40f9('0xf'));var Papa=require(_0x40f9('0x10'));var Redis=require(_0x40f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x40f9('0x12'));var hardwareService=require(_0x40f9('0x13'));var logger=require('../../config/logger')(_0x40f9('0x14'));var utils=require('../../config/utils');var config=require(_0x40f9('0x15'));var licenseUtil=require(_0x40f9('0x16'));var db=require('../../mysqldb')['db'];config[_0x40f9('0x17')]=_['defaults'](config[_0x40f9('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x40f9('0x18'))(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x40f9('0x19'));var client=jayson[_0x40f9('0x1a')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5c5cfe,_0x57266a,_0x36f7b8,_0x59a941){return new BPromise(function(_0x4d93b6,_0x48e286){var _0x155867=_0x59a941||client;return _0x155867[_0x40f9('0x1b')](_0x5c5cfe,_0x36f7b8)[_0x40f9('0x1c')](function(_0x37631a){logger[_0x40f9('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x57266a,'request\x20sent');logger[_0x40f9('0x1e')](_0x40f9('0x1f'),_0x57266a,'request\x20sent',JSON['stringify'](_0x37631a));if(_0x37631a[_0x40f9('0x20')]){if(_0x37631a['error'][_0x40f9('0x21')]===0x1f4){logger[_0x40f9('0x20')](_0x40f9('0x22'),_0x57266a,_0x37631a[_0x40f9('0x20')][_0x40f9('0x23')]);return _0x48e286(_0x37631a['error']['message']);}logger['error'](_0x40f9('0x22'),_0x57266a,_0x37631a[_0x40f9('0x20')]['message']);return _0x4d93b6(_0x37631a[_0x40f9('0x20')][_0x40f9('0x23')]);}else{logger[_0x40f9('0x1d')](_0x40f9('0x22'),_0x57266a,_0x40f9('0x24'));_0x4d93b6(_0x37631a[_0x40f9('0x25')][_0x40f9('0x23')]);}})[_0x40f9('0x26')](function(_0x19cf93){logger[_0x40f9('0x20')](_0x40f9('0x22'),_0x57266a,_0x19cf93);_0x48e286(_0x19cf93);});});}function respondWithStatusCode(_0x2eb08e,_0x176899){_0x176899=_0x176899||0xcc;return function(_0x295666){if(_0x295666){return _0x2eb08e[_0x40f9('0x27')](_0x176899);}return _0x2eb08e[_0x40f9('0x28')](_0x176899)[_0x40f9('0x29')]();};}function respondWithResult(_0xd8bb1d,_0x4ec988){_0x4ec988=_0x4ec988||0xc8;return function(_0x34b6cf){if(_0x34b6cf){return _0xd8bb1d[_0x40f9('0x28')](_0x4ec988)['json'](_0x34b6cf);}};}function respondWithFilteredResult(_0x3330c2,_0x459176){return function(_0x495826){if(_0x495826){var _0x4e87b0=typeof _0x459176['offset']===_0x40f9('0x2a')&&typeof _0x459176[_0x40f9('0x2b')]===_0x40f9('0x2a');var _0x59faa0=_0x495826[_0x40f9('0x2c')];var _0x5cb4c7=_0x4e87b0?0x0:_0x459176[_0x40f9('0x2d')];var _0x56c7b8=_0x4e87b0?_0x495826[_0x40f9('0x2c')]:_0x459176[_0x40f9('0x2d')]+_0x459176[_0x40f9('0x2b')];var _0x3b2c48;if(_0x56c7b8>=_0x59faa0){_0x56c7b8=_0x59faa0;_0x3b2c48=0xc8;}else{_0x3b2c48=0xce;}_0x3330c2['status'](_0x3b2c48);return _0x3330c2[_0x40f9('0x2e')](_0x40f9('0x2f'),_0x5cb4c7+'-'+_0x56c7b8+'/'+_0x59faa0)['json'](_0x495826);}return null;};}function patchUpdates(_0x3a828e){return function(_0x5cf121){try{jsonpatch['apply'](_0x5cf121,_0x3a828e,!![]);}catch(_0x446d24){return BPromise[_0x40f9('0x30')](_0x446d24);}return _0x5cf121[_0x40f9('0x31')]();};}function saveUpdates(_0xa9b392,_0x5b5dee){return function(_0x44c3c5){if(_0x44c3c5){return _0x44c3c5['update'](_0xa9b392)[_0x40f9('0x1c')](function(_0x3912c5){return _0x3912c5;});}return null;};}function removeEntity(_0x231e31,_0x217310){return function(_0x336dc4){if(_0x336dc4){return _0x336dc4['destroy']()[_0x40f9('0x1c')](function(){var _0x3785f7=_0x336dc4['get']({'plain':!![]});var _0x30f4a8=_0x40f9('0x32');return db[_0x40f9('0x33')][_0x40f9('0x34')]({'where':{'type':_0x30f4a8,'resourceId':_0x3785f7['id']}})[_0x40f9('0x1c')](function(){return _0x336dc4;});})[_0x40f9('0x1c')](function(){_0x231e31[_0x40f9('0x28')](0xcc)[_0x40f9('0x29')]();});}};}function handleEntityNotFound(_0x535ba4,_0x3312aa){return function(_0x230022){if(!_0x230022){_0x535ba4[_0x40f9('0x27')](0x194);}return _0x230022;};}function handleError(_0x5601a3,_0x331ee7){_0x331ee7=_0x331ee7||0x1f4;return function(_0x2932ec){logger[_0x40f9('0x20')](_0x2932ec[_0x40f9('0x35')]);if(_0x2932ec[_0x40f9('0x36')]){delete _0x2932ec[_0x40f9('0x36')];}_0x5601a3[_0x40f9('0x28')](_0x331ee7)[_0x40f9('0x37')](_0x2932ec);};}exports['index']=function(_0x27ba33,_0x114bef){var _0x5fa542={'include':[{'model':db[_0x40f9('0x38')],'as':_0x40f9('0x39')}]},_0x4fad1e={},_0x1e1813={'count':0x0,'rows':[]};var _0x53cfb9=_[_0x40f9('0x3a')](db[_0x40f9('0x3b')]['rawAttributes'],function(_0x7205cb){return{'name':_0x7205cb[_0x40f9('0x3c')],'type':_0x7205cb['type'][_0x40f9('0x3d')]};});_0x4fad1e[_0x40f9('0x3e')]=_['map'](_0x53cfb9,_0x40f9('0x36'));_0x4fad1e['query']=_[_0x40f9('0x3f')](_0x27ba33[_0x40f9('0x40')]);_0x4fad1e[_0x40f9('0x41')]=_[_0x40f9('0x42')](_0x4fad1e['model'],_0x4fad1e[_0x40f9('0x40')]);_0x5fa542['attributes']=_['intersection'](_0x4fad1e[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x27ba33[_0x40f9('0x40')][_0x40f9('0x43')]));_0x5fa542[_0x40f9('0x44')]=_0x5fa542['attributes'][_0x40f9('0x45')]?_0x5fa542[_0x40f9('0x44')]:_0x4fad1e['model'];if(!_0x27ba33[_0x40f9('0x40')][_0x40f9('0x46')](_0x40f9('0x47'))){_0x5fa542[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x27ba33[_0x40f9('0x40')]['limit']);_0x5fa542[_0x40f9('0x2d')]=qs['offset'](_0x27ba33['query'][_0x40f9('0x2d')]);}_0x5fa542[_0x40f9('0x48')]=qs[_0x40f9('0x49')](_0x27ba33[_0x40f9('0x40')][_0x40f9('0x49')]);_0x5fa542[_0x40f9('0x4a')]=qs[_0x40f9('0x41')](_[_0x40f9('0x4b')](_0x27ba33['query'],_0x4fad1e[_0x40f9('0x41')]),_0x53cfb9);if(_0x27ba33[_0x40f9('0x40')][_0x40f9('0x4c')]){_0x5fa542['where']=_[_0x40f9('0x4d')](_0x5fa542[_0x40f9('0x4a')],{'$or':_['map'](_0x53cfb9,function(_0x177148){if(_0x177148[_0x40f9('0x4e')]!==_0x40f9('0x4f')){var _0x462154={};_0x462154[_0x177148[_0x40f9('0x36')]]={'$like':'%'+_0x27ba33[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x462154;}})});}_0x5fa542=_[_0x40f9('0x4d')]({},_0x5fa542,_0x27ba33[_0x40f9('0x50')]);var _0x5814e8={'where':_0x5fa542[_0x40f9('0x4a')]};return db[_0x40f9('0x3b')][_0x40f9('0x2c')](_0x5814e8)[_0x40f9('0x1c')](function(_0x2ce921){_0x1e1813[_0x40f9('0x2c')]=_0x2ce921;if(_0x27ba33[_0x40f9('0x40')][_0x40f9('0x51')]){_0x5fa542[_0x40f9('0x52')]=[{'all':!![]}];}return db[_0x40f9('0x3b')][_0x40f9('0x53')](_0x5fa542);})[_0x40f9('0x1c')](function(_0x205c08){_0x1e1813['rows']=_0x205c08;return _0x1e1813;})[_0x40f9('0x1c')](respondWithFilteredResult(_0x114bef,_0x5fa542))[_0x40f9('0x26')](handleError(_0x114bef,null));};exports[_0x40f9('0x54')]=function(_0x4fd66a,_0x1c6974){var _0x2fa649={'raw':![],'where':{'id':_0x4fd66a[_0x40f9('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x40f9('0x39')}]},_0x3a3b55={};_0x3a3b55[_0x40f9('0x3e')]=_[_0x40f9('0x3f')](db[_0x40f9('0x3b')]['rawAttributes']);_0x3a3b55[_0x40f9('0x40')]=_[_0x40f9('0x3f')](_0x4fd66a[_0x40f9('0x40')]);_0x3a3b55[_0x40f9('0x41')]=_[_0x40f9('0x42')](_0x3a3b55[_0x40f9('0x3e')],_0x3a3b55['query']);_0x2fa649[_0x40f9('0x44')]=_[_0x40f9('0x42')](_0x3a3b55[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x4fd66a[_0x40f9('0x40')]['fields']));_0x2fa649[_0x40f9('0x44')]=_0x2fa649['attributes']['length']?_0x2fa649['attributes']:_0x3a3b55['model'];if(_0x4fd66a[_0x40f9('0x40')][_0x40f9('0x51')]){_0x2fa649[_0x40f9('0x52')]=[{'all':!![]}];}_0x2fa649=_[_0x40f9('0x4d')]({},_0x2fa649,_0x4fd66a['options']);return db[_0x40f9('0x3b')][_0x40f9('0x56')](_0x2fa649)['then'](handleEntityNotFound(_0x1c6974,null))[_0x40f9('0x1c')](respondWithResult(_0x1c6974,null))[_0x40f9('0x26')](handleError(_0x1c6974,null));};exports[_0x40f9('0x57')]=function(_0x4e30cb,_0x418f93){return db[_0x40f9('0x3b')][_0x40f9('0x57')](_0x4e30cb['body'],{})[_0x40f9('0x1c')](function(_0x65a517){var _0x789eff=_0x4e30cb['user'][_0x40f9('0x58')]({'plain':!![]});if(!_0x789eff)throw new Error(_0x40f9('0x59'));if(_0x789eff[_0x40f9('0x5a')]===_0x40f9('0x5b')){var _0x2c91c1=_0x65a517[_0x40f9('0x58')]({'plain':!![]});var _0x53e388=_0x40f9('0x32');return db[_0x40f9('0x5c')][_0x40f9('0x56')]({'where':{'name':_0x53e388,'userProfileId':_0x789eff[_0x40f9('0x5d')]},'raw':!![]})[_0x40f9('0x1c')](function(_0x5d2aa7){if(_0x5d2aa7&&_0x5d2aa7[_0x40f9('0x5e')]===0x0){return db[_0x40f9('0x33')]['create']({'name':_0x2c91c1[_0x40f9('0x36')],'resourceId':_0x2c91c1['id'],'type':_0x5d2aa7[_0x40f9('0x36')],'sectionId':_0x5d2aa7['id']},{})[_0x40f9('0x1c')](function(){return _0x65a517;});}else{return _0x65a517;}})[_0x40f9('0x26')](function(_0x51b479){logger[_0x40f9('0x20')](_0x40f9('0x5f'),_0x51b479);throw _0x51b479;});}return _0x65a517;})[_0x40f9('0x1c')](respondWithResult(_0x418f93,0xc9))[_0x40f9('0x26')](handleError(_0x418f93,null));};exports[_0x40f9('0x60')]=function(_0x5bc1b8,_0x2cbdc3){if(_0x5bc1b8['body']['id']){delete _0x5bc1b8['body']['id'];}return db['WhatsappAccount'][_0x40f9('0x56')]({'where':{'id':_0x5bc1b8[_0x40f9('0x55')]['id']},'include':[{'model':db[_0x40f9('0x38')],'as':'mandatoryDispositionPause'}]})[_0x40f9('0x1c')](handleEntityNotFound(_0x2cbdc3,null))[_0x40f9('0x1c')](saveUpdates(_0x5bc1b8[_0x40f9('0x61')],null))[_0x40f9('0x1c')](respondWithResult(_0x2cbdc3,null))['catch'](handleError(_0x2cbdc3,null));};exports[_0x40f9('0x34')]=function(_0x3fde21,_0x2bff38){return db['WhatsappAccount'][_0x40f9('0x56')]({'where':{'id':_0x3fde21['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x2bff38,null))[_0x40f9('0x1c')](removeEntity(_0x2bff38,null))[_0x40f9('0x26')](handleError(_0x2bff38,null));};exports[_0x40f9('0x62')]=function(_0xa487b4,_0x3b2274){return db['WhatsappAccount'][_0x40f9('0x62')]()[_0x40f9('0x1c')](respondWithResult(_0x3b2274,null))[_0x40f9('0x26')](handleError(_0x3b2274,null));};exports[_0x40f9('0x63')]=function(_0x379dcc,_0x2864b8,_0x393ac3){if(_0x379dcc[_0x40f9('0x61')]['id']){delete _0x379dcc[_0x40f9('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x379dcc['params']['id']}})['then'](handleEntityNotFound(_0x2864b8,null))['then'](function(_0x38911e){if(_0x38911e){_0x379dcc[_0x40f9('0x61')][_0x40f9('0x64')]=_0x38911e['id'];return db['Disposition'][_0x40f9('0x57')](_0x379dcc[_0x40f9('0x61')]);}})[_0x40f9('0x1c')](respondWithResult(_0x2864b8,null))[_0x40f9('0x26')](handleError(_0x2864b8,null));};exports[_0x40f9('0x65')]=function(_0x22f91c,_0xf1de49,_0x3762d3){var _0x17acc6={'raw':![],'where':{}};var _0x3cc2f3={};var _0x45ae2c={'count':0x0,'rows':[]};return db[_0x40f9('0x3b')][_0x40f9('0x66')]({'where':{'id':_0x22f91c['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0xf1de49,null))[_0x40f9('0x1c')](function(_0x5bdfc8){if(_0x5bdfc8){_0x3cc2f3[_0x40f9('0x3e')]=_[_0x40f9('0x3f')](db[_0x40f9('0x67')]['rawAttributes']);_0x3cc2f3['query']=_[_0x40f9('0x3f')](_0x22f91c[_0x40f9('0x40')]);_0x3cc2f3[_0x40f9('0x41')]=_[_0x40f9('0x42')](_0x3cc2f3[_0x40f9('0x3e')],_0x3cc2f3[_0x40f9('0x40')]);_0x17acc6[_0x40f9('0x44')]=_[_0x40f9('0x42')](_0x3cc2f3[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x22f91c['query'][_0x40f9('0x43')]));_0x17acc6[_0x40f9('0x44')]=_0x17acc6[_0x40f9('0x44')][_0x40f9('0x45')]?_0x17acc6[_0x40f9('0x44')]:_0x3cc2f3[_0x40f9('0x3e')];if(!_0x22f91c[_0x40f9('0x40')][_0x40f9('0x46')](_0x40f9('0x47'))){_0x17acc6[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x22f91c['query'][_0x40f9('0x2b')]);_0x17acc6[_0x40f9('0x2d')]=qs['offset'](_0x22f91c[_0x40f9('0x40')][_0x40f9('0x2d')]);}_0x17acc6[_0x40f9('0x48')]=qs['sort'](_0x22f91c['query'][_0x40f9('0x49')]);_0x17acc6['where']=qs['filters'](_[_0x40f9('0x4b')](_0x22f91c[_0x40f9('0x40')],_0x3cc2f3['filters']));_0x17acc6['where'][_0x40f9('0x64')]=_0x5bdfc8['id'];if(_0x22f91c[_0x40f9('0x40')][_0x40f9('0x4c')]){_0x17acc6[_0x40f9('0x4a')]=_['merge'](_0x17acc6[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x17acc6[_0x40f9('0x44')],function(_0x2fab08){var _0x4db98d={};_0x4db98d[_0x2fab08]={'$like':'%'+_0x22f91c[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x4db98d;})});}_0x17acc6=_['merge']({},_0x17acc6,_0x22f91c['options']);return db[_0x40f9('0x67')][_0x40f9('0x2c')]({'where':_0x17acc6[_0x40f9('0x4a')]})[_0x40f9('0x1c')](function(_0x367198){_0x45ae2c['count']=_0x367198;if(_0x22f91c[_0x40f9('0x40')]['includeAll']){_0x17acc6[_0x40f9('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x40f9('0x53')](_0x17acc6);})[_0x40f9('0x1c')](function(_0x332f77){_0x45ae2c[_0x40f9('0x68')]=_0x332f77;return _0x45ae2c;});}})[_0x40f9('0x1c')](respondWithFilteredResult(_0xf1de49,_0x17acc6))['catch'](handleError(_0xf1de49,null));};exports[_0x40f9('0x69')]=function(_0x1f6ac6,_0x369757,_0xfcdf8d){return db['WhatsappAccount'][_0x40f9('0x56')]({'where':{'id':_0x1f6ac6[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x369757,null))['then'](function(_0x4ce358){if(_0x4ce358){return _0x4ce358[_0x40f9('0x69')](_0x1f6ac6[_0x40f9('0x40')][_0x40f9('0x6a')]);}})[_0x40f9('0x1c')](respondWithStatusCode(_0x369757,null))[_0x40f9('0x26')](handleError(_0x369757,null));};exports[_0x40f9('0x6b')]=function(_0x361ca3,_0x2775ff,_0x2b00a4){if(_0x361ca3['body']['id']){delete _0x361ca3[_0x40f9('0x61')]['id'];}return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x361ca3['params']['id']}})['then'](handleEntityNotFound(_0x2775ff,null))['then'](function(_0x203e64){if(_0x203e64){_0x361ca3[_0x40f9('0x61')][_0x40f9('0x64')]=_0x203e64['id'];return db[_0x40f9('0x6c')][_0x40f9('0x57')](_0x361ca3[_0x40f9('0x61')]);}})['then'](respondWithResult(_0x2775ff,null))[_0x40f9('0x26')](handleError(_0x2775ff,null));};exports[_0x40f9('0x6d')]=function(_0x4a8324,_0x4995e9,_0x70a20e){var _0x4fb70a={'raw':![],'where':{}};var _0x5d5855={};var _0x4bb47f={'count':0x0,'rows':[]};return db[_0x40f9('0x3b')]['findOne']({'where':{'id':_0x4a8324[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x4995e9,null))[_0x40f9('0x1c')](function(_0x29c173){if(_0x29c173){_0x5d5855[_0x40f9('0x3e')]=_['keys'](db[_0x40f9('0x6c')][_0x40f9('0x6e')]);_0x5d5855[_0x40f9('0x40')]=_[_0x40f9('0x3f')](_0x4a8324[_0x40f9('0x40')]);_0x5d5855['filters']=_[_0x40f9('0x42')](_0x5d5855[_0x40f9('0x3e')],_0x5d5855[_0x40f9('0x40')]);_0x4fb70a[_0x40f9('0x44')]=_['intersection'](_0x5d5855['model'],qs[_0x40f9('0x43')](_0x4a8324[_0x40f9('0x40')]['fields']));_0x4fb70a['attributes']=_0x4fb70a[_0x40f9('0x44')][_0x40f9('0x45')]?_0x4fb70a[_0x40f9('0x44')]:_0x5d5855[_0x40f9('0x3e')];if(!_0x4a8324['query'][_0x40f9('0x46')](_0x40f9('0x47'))){_0x4fb70a[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x4a8324[_0x40f9('0x40')][_0x40f9('0x2b')]);_0x4fb70a[_0x40f9('0x2d')]=qs[_0x40f9('0x2d')](_0x4a8324[_0x40f9('0x40')][_0x40f9('0x2d')]);}_0x4fb70a[_0x40f9('0x48')]=qs[_0x40f9('0x49')](_0x4a8324['query'][_0x40f9('0x49')]);_0x4fb70a[_0x40f9('0x4a')]=qs[_0x40f9('0x41')](_[_0x40f9('0x4b')](_0x4a8324[_0x40f9('0x40')],_0x5d5855[_0x40f9('0x41')]));_0x4fb70a[_0x40f9('0x4a')][_0x40f9('0x64')]=_0x29c173['id'];if(_0x4a8324[_0x40f9('0x40')][_0x40f9('0x4c')]){_0x4fb70a[_0x40f9('0x4a')]=_[_0x40f9('0x4d')](_0x4fb70a[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x4fb70a[_0x40f9('0x44')],function(_0x58614b){var _0x551440={};_0x551440[_0x58614b]={'$like':'%'+_0x4a8324['query'][_0x40f9('0x4c')]+'%'};return _0x551440;})});}_0x4fb70a=_[_0x40f9('0x4d')]({},_0x4fb70a,_0x4a8324['options']);return db[_0x40f9('0x6c')][_0x40f9('0x2c')]({'where':_0x4fb70a[_0x40f9('0x4a')]})['then'](function(_0x355eb9){_0x4bb47f['count']=_0x355eb9;if(_0x4a8324[_0x40f9('0x40')]['includeAll']){_0x4fb70a[_0x40f9('0x52')]=[{'all':!![]}];}return db[_0x40f9('0x6c')][_0x40f9('0x53')](_0x4fb70a);})[_0x40f9('0x1c')](function(_0x3fbc2a){_0x4bb47f[_0x40f9('0x68')]=_0x3fbc2a;return _0x4bb47f;});}})[_0x40f9('0x1c')](respondWithFilteredResult(_0x4995e9,_0x4fb70a))['catch'](handleError(_0x4995e9,null));};exports[_0x40f9('0x6f')]=function(_0x21ff88,_0x44df5b,_0x550900){return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x21ff88['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x44df5b,null))[_0x40f9('0x1c')](function(_0x474a45){if(_0x474a45){return _0x474a45[_0x40f9('0x6f')](_0x21ff88[_0x40f9('0x40')]['ids']);}})[_0x40f9('0x1c')](respondWithStatusCode(_0x44df5b,null))[_0x40f9('0x26')](handleError(_0x44df5b,null));};exports[_0x40f9('0x70')]=function(_0x4db736,_0x2368e1,_0x1f9ef5){return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x4db736[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x2368e1,null))[_0x40f9('0x1c')](function(_0x20ce6b){if(_0x20ce6b){return _0x20ce6b[_0x40f9('0x70')](_0x4db736[_0x40f9('0x61')][_0x40f9('0x6a')],_['omit'](_0x4db736[_0x40f9('0x61')],['ids','id'])||{})[_0x40f9('0x71')](function(_0x2442c1){for(var _0x254aca=0x0;_0x254aca<_0x4db736[_0x40f9('0x61')][_0x40f9('0x6a')][_0x40f9('0x45')];_0x254aca+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x4db736[_0x40f9('0x61')][_0x40f9('0x6a')][_0x254aca]),'WhatsappAccountId':Number(_0x4db736[_0x40f9('0x55')]['id'])});}return _0x2442c1;});}})['then'](respondWithResult(_0x2368e1,null))['catch'](handleError(_0x2368e1,null));};exports[_0x40f9('0x72')]=function(_0x4f61dd,_0x1135d1,_0x242c60){return db[_0x40f9('0x3b')]['find']({'where':{'id':_0x4f61dd['params']['id']}})['then'](handleEntityNotFound(_0x1135d1,null))[_0x40f9('0x1c')](function(_0x2800af){if(_0x2800af){return _0x2800af[_0x40f9('0x72')](_0x4f61dd[_0x40f9('0x40')]['ids'])['then'](function(){if(_[_0x40f9('0x73')](_0x4f61dd['query'][_0x40f9('0x6a')])){for(var _0x3c976b=0x0;_0x3c976b<_0x4f61dd['query'][_0x40f9('0x6a')][_0x40f9('0x45')];_0x3c976b+=0x1){socket[_0x40f9('0x74')](_0x40f9('0x75'),{'UserId':Number(_0x4f61dd[_0x40f9('0x40')][_0x40f9('0x6a')][_0x3c976b]),'WhatsappAccountId':Number(_0x4f61dd['params']['id'])});}}else{socket[_0x40f9('0x74')](_0x40f9('0x75'),{'UserId':Number(_0x4f61dd['query']['ids']),'WhatsappAccountId':Number(_0x4f61dd[_0x40f9('0x55')]['id'])});}});}})[_0x40f9('0x1c')](respondWithStatusCode(_0x1135d1,null))[_0x40f9('0x26')](handleError(_0x1135d1,null));};exports[_0x40f9('0x76')]=function(_0x51af77,_0x142dd1,_0xa20109){var _0x307a44={};var _0x4ac486={};var _0x3a71bd;var _0x492039;return db[_0x40f9('0x3b')][_0x40f9('0x66')]({'where':{'id':_0x51af77['params']['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x142dd1,null))[_0x40f9('0x1c')](function(_0x31333a){if(_0x31333a){_0x3a71bd=_0x31333a;_0x4ac486['model']=_[_0x40f9('0x3f')](db['User'][_0x40f9('0x6e')]);_0x4ac486['query']=_[_0x40f9('0x3f')](_0x51af77['query']);_0x4ac486[_0x40f9('0x41')]=_['intersection'](_0x4ac486[_0x40f9('0x3e')],_0x4ac486['query']);_0x307a44['attributes']=_[_0x40f9('0x42')](_0x4ac486[_0x40f9('0x3e')],qs[_0x40f9('0x43')](_0x51af77[_0x40f9('0x40')][_0x40f9('0x43')]));_0x307a44[_0x40f9('0x44')]=_0x307a44[_0x40f9('0x44')]['length']?_0x307a44[_0x40f9('0x44')]:_0x4ac486['model'];_0x307a44['order']=qs[_0x40f9('0x49')](_0x51af77['query'][_0x40f9('0x49')]);_0x307a44[_0x40f9('0x4a')]=qs['filters'](_['pick'](_0x51af77[_0x40f9('0x40')],_0x4ac486[_0x40f9('0x41')]));if(_0x51af77['query'][_0x40f9('0x4c')]){_0x307a44[_0x40f9('0x4a')]=_[_0x40f9('0x4d')](_0x307a44[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x307a44[_0x40f9('0x44')],function(_0x266a76){var _0x28cc51={};_0x28cc51[_0x266a76]={'$like':'%'+_0x51af77[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x28cc51;})});}_0x307a44=_[_0x40f9('0x4d')]({},_0x307a44,_0x51af77[_0x40f9('0x50')]);return _0x3a71bd[_0x40f9('0x76')](_0x307a44);}})['then'](function(_0x452c78){if(_0x452c78){_0x492039=_0x452c78[_0x40f9('0x45')];if(!_0x51af77[_0x40f9('0x40')][_0x40f9('0x46')]('nolimit')){_0x307a44[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x51af77[_0x40f9('0x40')][_0x40f9('0x2b')]);_0x307a44[_0x40f9('0x2d')]=qs[_0x40f9('0x2d')](_0x51af77[_0x40f9('0x40')]['offset']);}return _0x3a71bd['getAgents'](_0x307a44);}})[_0x40f9('0x1c')](function(_0x1f4ae6){if(_0x1f4ae6){return _0x1f4ae6?{'count':_0x492039,'rows':_0x1f4ae6}:null;}})['then'](respondWithResult(_0x142dd1,null))[_0x40f9('0x26')](handleError(_0x142dd1,null));};exports['addApplications']=function(_0x42807a,_0x418ad2,_0x3630a5){return db['WhatsappAccount'][_0x40f9('0x66')]({'where':{'id':_0x42807a[_0x40f9('0x55')]['id']}})['then'](handleEntityNotFound(_0x418ad2,null))['then'](function(_0x3a9291){if(_0x3a9291){return db[_0x40f9('0x77')][_0x40f9('0x78')](function(_0x2ea6c5){return db['WhatsappApplication'][_0x40f9('0x34')]({'where':{'WhatsappAccountId':_0x42807a[_0x40f9('0x55')]['id']},'transaction':_0x2ea6c5})[_0x40f9('0x1c')](function(_0x5274cc){var _0xe5844e=_[_0x40f9('0x3a')](_0x42807a[_0x40f9('0x61')],function(_0x4e992e){_0x4e992e[_0x40f9('0x64')]=_0x42807a['params']['id'];return _0x4e992e;});return db[_0x40f9('0x79')][_0x40f9('0x7a')](_0xe5844e,{'transaction':_0x2ea6c5});});})[_0x40f9('0x1c')](function(){return db[_0x40f9('0x79')][_0x40f9('0x7b')]({'where':{'WhatsappAccountId':_0x42807a[_0x40f9('0x55')]['id']},'order':_0x40f9('0x7c')});});}})[_0x40f9('0x1c')](respondWithResult(_0x418ad2,null))['catch'](handleError(_0x418ad2,null));};exports[_0x40f9('0x7d')]=function(_0x1c4ba6,_0x523099,_0x53293f){var _0x222703={};var _0xf34085={};var _0x5e6930;var _0x56e944;return db[_0x40f9('0x3b')][_0x40f9('0x66')]({'where':{'id':_0x1c4ba6[_0x40f9('0x55')]['id']}})[_0x40f9('0x1c')](handleEntityNotFound(_0x523099,null))[_0x40f9('0x1c')](function(_0x4f28a9){if(_0x4f28a9){_0x5e6930=_0x4f28a9;_0xf34085[_0x40f9('0x3e')]=_[_0x40f9('0x3f')](db[_0x40f9('0x79')]['rawAttributes']);_0xf34085[_0x40f9('0x40')]=_[_0x40f9('0x3f')](_0x1c4ba6[_0x40f9('0x40')]);_0xf34085[_0x40f9('0x41')]=_['intersection'](_0xf34085[_0x40f9('0x3e')],_0xf34085[_0x40f9('0x40')]);_0x222703[_0x40f9('0x44')]=_[_0x40f9('0x42')](_0xf34085['model'],qs[_0x40f9('0x43')](_0x1c4ba6['query'][_0x40f9('0x43')]));_0x222703['attributes']=_0x222703['attributes']['length']?_0x222703['attributes']:_0xf34085['model'];_0x222703[_0x40f9('0x48')]=qs[_0x40f9('0x49')](_0x1c4ba6[_0x40f9('0x40')]['sort']);_0x222703[_0x40f9('0x4a')]=qs[_0x40f9('0x41')](_['pick'](_0x1c4ba6[_0x40f9('0x40')],_0xf34085['filters']));if(_0x1c4ba6['query'][_0x40f9('0x4c')]){_0x222703[_0x40f9('0x4a')]=_[_0x40f9('0x4d')](_0x222703[_0x40f9('0x4a')],{'$or':_[_0x40f9('0x3a')](_0x222703[_0x40f9('0x44')],function(_0x7702ed){var _0x103599={};_0x103599[_0x7702ed]={'$like':'%'+_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x4c')]+'%'};return _0x103599;})});}_0x222703=_[_0x40f9('0x4d')]({},_0x222703,_0x1c4ba6[_0x40f9('0x50')]);return _0x5e6930[_0x40f9('0x7d')](_0x222703);}})[_0x40f9('0x1c')](function(_0xdff97c){if(_0xdff97c){_0x56e944=_0xdff97c[_0x40f9('0x45')];if(!_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x46')]('nolimit')){_0x222703[_0x40f9('0x2b')]=qs[_0x40f9('0x2b')](_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x2b')]);_0x222703['offset']=qs[_0x40f9('0x2d')](_0x1c4ba6[_0x40f9('0x40')][_0x40f9('0x2d')]);}return _0x5e6930[_0x40f9('0x7d')](_0x222703);}})[_0x40f9('0x1c')](function(_0x144f2f){if(_0x144f2f){return _0x144f2f?{'count':_0x56e944,'rows':_0x144f2f}:null;}})[_0x40f9('0x1c')](respondWithResult(_0x523099,null))['catch'](handleError(_0x523099,null));};exports[_0x40f9('0x7e')]=function(_0x3e07ed,_0x1dc35,_0x5f2d42){logger[_0x40f9('0x1d')](_0x40f9('0x7f'));logger[_0x40f9('0x1d')]('AC\x20WhatsappAccount\x20req.body:%s',JSON['stringify'](_0x3e07ed['body']));var _0x3c8fe8={'channel':'whatsapp'};var _0x192388=[];var _0x5a735c=[];var _0x220c85={};return db[_0x40f9('0x3b')]['find']({'where':{'id':_0x3e07ed[_0x40f9('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x40f9('0x80')}]})[_0x40f9('0x1c')](handleEntityNotFound(_0x1dc35,null))[_0x40f9('0x1c')](function(_0x532120){_0x3c8fe8['account']=_0x532120;_0x3c8fe8[_0x40f9('0x81')]=_['orderBy'](_0x532120[_0x40f9('0x80')],[_0x40f9('0x7c')],[_0x40f9('0x82')]);if(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x80')]){delete _0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x80')];}return db[_0x40f9('0x84')]['describe']();})['then'](function(_0x3b1591){if(!_0x3b1591){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x87'));}logger[_0x40f9('0x1d')](_0x40f9('0x88'),JSON['stringify'](_0x3b1591));logger['info']('AC\x20sinch\x20req.body:%s',JSON[_0x40f9('0x89')](_0x3e07ed[_0x40f9('0x61')]));_0x192388=_[_0x40f9('0x8a')](_[_0x40f9('0x3f')](_0x3b1591),[_0x40f9('0x8b'),_0x40f9('0x8c')]);_0x5a735c=_[_0x40f9('0x8a')](_[_0x40f9('0x3f')](_0x3b1591),[_0x40f9('0x8b'),_0x40f9('0x8c'),_0x40f9('0x8d'),_0x40f9('0x8e')]);_0x3c8fe8[_0x40f9('0x61')]={'mapKey':_0x40f9('0x8f')};logger[_0x40f9('0x1d')]('AC\x20sinch\x20routing.account.type:%s',JSON[_0x40f9('0x89')](_0x3c8fe8[_0x40f9('0x83')]['type']));logger[_0x40f9('0x1d')]('AC\x20sinch\x20routing.body:%s',JSON[_0x40f9('0x89')](_0x3c8fe8[_0x40f9('0x61')]));logger[_0x40f9('0x1d')]('AC\x20sinch\x20contactFields:%s',_0x192388);logger[_0x40f9('0x1d')](_0x40f9('0x90'),_0x5a735c);if(_0x3c8fe8['account'][_0x40f9('0x4e')]&&_0x3c8fe8['account'][_0x40f9('0x4e')]==='twilio'){_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')]=_0x3e07ed[_0x40f9('0x61')]['From'][_0x40f9('0x92')](_0x40f9('0x93'),'');_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')]=_0x3e07ed['body'][_0x40f9('0x94')];_0x3c8fe8[_0x40f9('0x61')]['messageId']=_0x3e07ed[_0x40f9('0x61')][_0x40f9('0x95')];}if(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x4e')]&&_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x4e')]===_0x40f9('0x96')){logger[_0x40f9('0x1d')]('AC\x20sinch\x20req.body\x202:%s',JSON[_0x40f9('0x89')](_0x3e07ed[_0x40f9('0x61')]));_0x3c8fe8['body'][_0x40f9('0x91')]=_0x3e07ed[_0x40f9('0x61')][_0x40f9('0x97')][0x0][_0x40f9('0x91')];_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')]=_0x3e07ed['body'][_0x40f9('0x97')][0x0][_0x40f9('0x23')][_0x40f9('0x61')];_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x98')]=_0x3e07ed[_0x40f9('0x61')][_0x40f9('0x97')][0x0]['message_id'];}if(_0x3c8fe8['body']['id']){delete _0x3c8fe8[_0x40f9('0x61')]['id'];}if(_[_0x40f9('0x99')](_0x3c8fe8['body'][_0x40f9('0x91')])){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9a'));}if(_[_0x40f9('0x99')](_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')])||_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x61')]===''){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9b'));}if(_['isNil'](_0x3c8fe8[_0x40f9('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x40f9('0x86'))](_0x40f9('0x9c')+_0x5a735c);}if(!_[_0x40f9('0x9d')](_0x5a735c,_0x3c8fe8[_0x40f9('0x61')]['mapKey'])){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9e')+_0x5a735c);}_0x220c85[_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x9f')]]=_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')];return db[_0x40f9('0xa0')][_0x40f9('0x56')]({'where':{'id':_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x8e')]},'include':[{'model':db[_0x40f9('0x84')],'as':_0x40f9('0xa1'),'where':_0x220c85,'limit':0x1,'order':[[_0x40f9('0x8c'),_0x40f9('0xa2')]]}]});})['then'](handleEntityNotFound(_0x1dc35,null))['then'](function(_0x47efac){if(_0x47efac){_0x3c8fe8[_0x40f9('0xa3')]=_[_0x40f9('0xa4')](_0x47efac,[_0x40f9('0xa1')]);if(_0x47efac[_0x40f9('0xa1')][_0x40f9('0x45')]){return _0x47efac[_0x40f9('0xa1')][0x0];}var _0x21031d=_[_0x40f9('0xa5')](_0x3c8fe8['body'],{'firstName':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')],'ListId':_0x47efac['id']});_0x21031d[_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x9f')]]=_0x3c8fe8[_0x40f9('0x61')]['from'];return db['CmContact'][_0x40f9('0x57')](_0x21031d,{'fields':_0x192388,'raw':!![]});}})[_0x40f9('0x1c')](handleEntityNotFound(_0x1dc35,null))[_0x40f9('0x1c')](function(_0x286cc0){if(_0x286cc0){_0x3c8fe8[_0x40f9('0xa6')]=_0x286cc0;var _0x53b293={'ContactId':_0x286cc0['id'],'phone':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')],'WhatsappAccountId':_0x3e07ed[_0x40f9('0x55')]['id']};var _0x12830c={'ContactId':_0x286cc0['id'],'WhatsappAccountId':_0x3e07ed['params']['id'],'closed':![]};return db[_0x40f9('0xa7')][_0x40f9('0x56')]({'where':_0x12830c})[_0x40f9('0x1c')](function(_0x53cddf){if(_0x53cddf){return[_0x53cddf,![]];}return db[_0x40f9('0xa7')][_0x40f9('0x57')](_0x53b293)['then'](function(_0x548cad){return[_0x548cad,!![]];});});}})['spread'](function(_0x1d9425,_0x237551){_0x3c8fe8[_0x40f9('0xa8')]=_0x1d9425['get']({'plain':!![]});_0x3c8fe8[_0x40f9('0xa8')][_0x40f9('0xa9')]=![];if(_0x237551){if(_0x3c8fe8[_0x40f9('0x83')]['autoclose']){_0x3c8fe8[_0x40f9('0x81')][_0x40f9('0xaa')]({'id':0x0,'priority':_0x3c8fe8['applications'][_0x40f9('0x45')]+0x1,'app':_0x40f9('0xab'),'appdata':'unmanaged','interval':_0x40f9('0xac')});}_0x3c8fe8[_0x40f9('0xa8')]['created']=!![];}return db[_0x40f9('0xad')][_0x40f9('0x57')]({'phone':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0x91')],'messageId':_0x3c8fe8['body']['messageId'],'body':_0x3c8fe8[_0x40f9('0x61')]['body'],'WhatsappAccountId':_0x3e07ed[_0x40f9('0x55')]['id'],'WhatsappInteractionId':_0x1d9425['id'],'direction':'in','ContactId':_0x1d9425[_0x40f9('0xae')],'AttachmentId':_0x3c8fe8[_0x40f9('0x61')][_0x40f9('0xaf')]});})['then'](function(_0x50a7a7){_0x3c8fe8[_0x40f9('0x23')]=_0x50a7a7;if(_0x3c8fe8[_0x40f9('0xa8')]['UserId']){return db[_0x40f9('0xb0')][_0x40f9('0x56')]({'attributes':['id',_0x40f9('0x36')],'where':{'id':_0x3c8fe8['interaction'][_0x40f9('0xb1')]}})[_0x40f9('0x1c')](function(_0x2a5ff9){if(_0x2a5ff9){_0x3c8fe8[_0x40f9('0x81')][_0x40f9('0xb2')]({'id':0x0,'priority':0x0,'app':_0x40f9('0xb3'),'appdata':_0x2a5ff9[_0x40f9('0x36')]+','+(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0xb4')]||0xa),'interval':_0x40f9('0xac')});}return respondWithRpcPromise(_0x40f9('0xb5'),'startRouting',_0x3c8fe8);});}return respondWithRpcPromise(_0x40f9('0xb5'),'startRouting',_0x3c8fe8);})[_0x40f9('0x1c')](function(_0x282f7a){if(_0x282f7a){var _0x3863be=0xc8;var _0x3f0bc0='receiveMessage';logger['info'](_0x40f9('0x1f'),_0x3f0bc0,_0x3863be,_0x40f9('0xb6'));logger[_0x40f9('0x1e')](_0x40f9('0xb7'),_0x3f0bc0,_0x3863be,'entity\x20found',JSON[_0x40f9('0x89')](_0x282f7a));if(_0x3c8fe8[_0x40f9('0x83')][_0x40f9('0x4e')]===_0x40f9('0xb8')){return _0x1dc35['status'](_0x3863be)[_0x40f9('0x2e')](_0x40f9('0xb9'),'text/xml')[_0x40f9('0x37')]('\x0a');}else{return _0x1dc35[_0x40f9('0x28')](_0x3863be)[_0x40f9('0xba')](_0x282f7a);}}})[_0x40f9('0x26')](handleError(_0x1dc35,null));};exports[_0x40f9('0x37')]=function(_0x410750,_0x4fc461,_0x38c9c1){var _0x553cb3,_0x52b987,_0x54d857;if(_[_0x40f9('0x99')](_0x410750['body']['body'])||_0x410750[_0x40f9('0x61')][_0x40f9('0x61')]===''){throw new db[(_0x40f9('0x85'))][(_0x40f9('0x86'))](_0x40f9('0x9b'));}if(_[_0x40f9('0x99')](_0x410750[_0x40f9('0x61')]['to'])){throw new db['Sequelize']['ValidationError'](_0x40f9('0xbb'));}_0x553cb3=_0x410750[_0x40f9('0x61')]['to'];return db[_0x40f9('0x3b')][_0x40f9('0x56')]({'where':{'id':_0x410750[_0x40f9('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x40f9('0xbc'),'include':[{'model':db[_0x40f9('0x84')],'as':_0x40f9('0xa1'),'where':{'mobile':_0x553cb3},'limit':0x1,'order':[[_0x40f9('0x8c'),_0x40f9('0xa2')]]}]}]})[_0x40f9('0x1c')](handleEntityNotFound(_0x4fc461,null))[_0x40f9('0x1c')](function(_0x4fe281){if(_0x4fe281&&_0x4fe281[_0x40f9('0xbc')]){_0x52b987=_0x4fe281[_0x40f9('0x58')]({'plain':!![]});if(_0x52b987[_0x40f9('0xbc')]&&_0x52b987['List']['Contacts'][_0x40f9('0x45')]){return _0x52b987[_0x40f9('0xbc')][_0x40f9('0xa1')][0x0];}return db[_0x40f9('0x84')][_0x40f9('0x57')](_[_0x40f9('0xa5')](_0x410750[_0x40f9('0x61')],{'firstName':_0x553cb3,'mobile':_0x553cb3,'phone':_0x553cb3,'ListId':_0x52b987['ListId']}));}})[_0x40f9('0x1c')](handleEntityNotFound(_0x4fc461,null))[_0x40f9('0x1c')](function(_0x57f443){if(_0x57f443){_0x54d857=_0x57f443;return db[_0x40f9('0xa7')][_0x40f9('0x56')]({'where':{'ContactId':_0x54d857['id'],'closed':![],'WhatsappAccountId':_0x52b987['id']}})['then'](function(_0x1a9c4a){if(_0x1a9c4a){return[_0x1a9c4a,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x410750['user']['id'],'ContactId':_0x54d857['id'],'WhatsappAccountId':_0x52b987['id'],'phone':_0x553cb3,'firstMsgDirection':_0x40f9('0xbd'),'Messages':[_[_0x40f9('0x4d')](_0x410750[_0x40f9('0x61')],{'read':![],'body':_0x410750[_0x40f9('0x61')][_0x40f9('0x61')],'phone':_0x553cb3,'WhatsappAccountId':_0x52b987['id'],'UserId':_0x410750[_0x40f9('0x5b')]['id'],'ContactId':_0x54d857['id']})]},{'include':[{'model':db[_0x40f9('0xad')],'as':'Messages'}]})[_0x40f9('0x1c')](function(_0x499ee2){return[_0x499ee2,!![]];});});}})[_0x40f9('0x71')](function(_0x27432e,_0x2f0938){if(_0x2f0938){return _0x27432e;}return db['WhatsappMessage']['create'](_[_0x40f9('0x4d')](_0x410750[_0x40f9('0x61')],{'read':![],'body':_0x410750[_0x40f9('0x61')][_0x40f9('0x61')],'phone':_0x553cb3,'WhatsappAccountId':_0x52b987['id'],'WhatsappInteractionId':_0x27432e['id'],'UserId':_0x410750['user']['id'],'ContactId':_0x54d857['id']}))[_0x40f9('0x1c')](function(_0x5a0e95){_0x27432e[_0x40f9('0xbe')][_0x40f9('0xbf')]=[];_0x27432e[_0x40f9('0xbe')]['Messages']['push'](_0x5a0e95[_0x40f9('0xbe')]);return _0x27432e;});})['then'](respondWithResult(_0x4fc461,null))[_0x40f9('0x26')](handleError(_0x4fc461,null));}; \ No newline at end of file +var _0x0693=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','params','Pause','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','findOne','hasOwnProperty','includeAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','nolimit','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','Body','MessageSid','from','notifications','messageId','isNil','Sequelize','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','Contacts','DESC','contact','WhatsappInteraction','spread','interaction','created','applications','push','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x60b203,_0x4557d2){var _0x1f44cf=function(_0x5cb240){while(--_0x5cb240){_0x60b203['push'](_0x60b203['shift']());}};_0x1f44cf(++_0x4557d2);}(_0x0693,0xb2));var _0x3069=function(_0x42c84d,_0x11b874){_0x42c84d=_0x42c84d-0x0;var _0x29e15c=_0x0693[_0x42c84d];return _0x29e15c;};'use strict';var emlformat=require(_0x3069('0x0'));var rimraf=require(_0x3069('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3069('0x2'));var rp=require('request-promise');var moment=require(_0x3069('0x3'));var BPromise=require(_0x3069('0x4'));var Mustache=require(_0x3069('0x5'));var util=require(_0x3069('0x6'));var path=require('path');var sox=require(_0x3069('0x7'));var csv=require(_0x3069('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3069('0x9'));var squel=require(_0x3069('0xa'));var crypto=require(_0x3069('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('ioredis');var authService=require(_0x3069('0xc'));var qs=require(_0x3069('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3069('0xe'));var logger=require(_0x3069('0xf'))('api');var utils=require(_0x3069('0x10'));var config=require(_0x3069('0x11'));var licenseUtil=require(_0x3069('0x12'));var db=require(_0x3069('0x13'))['db'];config['redis']=_[_0x3069('0x14')](config[_0x3069('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3069('0x16'))(new Redis(config[_0x3069('0x15')]));require(_0x3069('0x17'))[_0x3069('0x18')](socket);var jayson=require(_0x3069('0x19'));var client=jayson[_0x3069('0x1a')][_0x3069('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x388204,_0x179834,_0x4b9409,_0x39b164){return new BPromise(function(_0x33b457,_0x3ab4ff){var _0x5a0de1=_0x39b164||client;return _0x5a0de1[_0x3069('0x1c')](_0x388204,_0x4b9409)[_0x3069('0x1d')](function(_0x26e886){logger[_0x3069('0x1e')](_0x3069('0x1f'),_0x179834,_0x3069('0x20'));logger['debug'](_0x3069('0x21'),_0x179834,'request\x20sent',JSON[_0x3069('0x22')](_0x26e886));if(_0x26e886[_0x3069('0x23')]){if(_0x26e886['error'][_0x3069('0x24')]===0x1f4){logger['error'](_0x3069('0x1f'),_0x179834,_0x26e886[_0x3069('0x23')]['message']);return _0x3ab4ff(_0x26e886[_0x3069('0x23')][_0x3069('0x25')]);}logger[_0x3069('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x179834,_0x26e886['error']['message']);return _0x33b457(_0x26e886[_0x3069('0x23')]['message']);}else{logger[_0x3069('0x1e')](_0x3069('0x1f'),_0x179834,_0x3069('0x20'));_0x33b457(_0x26e886['result'][_0x3069('0x25')]);}})[_0x3069('0x26')](function(_0x12fe15){logger[_0x3069('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x179834,_0x12fe15);_0x3ab4ff(_0x12fe15);});});}function respondWithStatusCode(_0x11538e,_0x57d83e){_0x57d83e=_0x57d83e||0xcc;return function(_0x453ac5){if(_0x453ac5){return _0x11538e['sendStatus'](_0x57d83e);}return _0x11538e[_0x3069('0x27')](_0x57d83e)[_0x3069('0x28')]();};}function respondWithResult(_0x538145,_0x468d7c){_0x468d7c=_0x468d7c||0xc8;return function(_0x130776){if(_0x130776){return _0x538145['status'](_0x468d7c)[_0x3069('0x29')](_0x130776);}};}function respondWithFilteredResult(_0x37f9b2,_0x4afb2f){return function(_0x3b0c54){if(_0x3b0c54){var _0x3de8dd=typeof _0x4afb2f['offset']===_0x3069('0x2a')&&typeof _0x4afb2f[_0x3069('0x2b')]===_0x3069('0x2a');var _0x137583=_0x3b0c54[_0x3069('0x2c')];var _0x21ede7=_0x3de8dd?0x0:_0x4afb2f[_0x3069('0x2d')];var _0x2c6ce8=_0x3de8dd?_0x3b0c54[_0x3069('0x2c')]:_0x4afb2f[_0x3069('0x2d')]+_0x4afb2f['limit'];var _0x153df6;if(_0x2c6ce8>=_0x137583){_0x2c6ce8=_0x137583;_0x153df6=0xc8;}else{_0x153df6=0xce;}_0x37f9b2[_0x3069('0x27')](_0x153df6);return _0x37f9b2[_0x3069('0x2e')](_0x3069('0x2f'),_0x21ede7+'-'+_0x2c6ce8+'/'+_0x137583)[_0x3069('0x29')](_0x3b0c54);}return null;};}function patchUpdates(_0x13d94c){return function(_0x45a16a){try{jsonpatch[_0x3069('0x30')](_0x45a16a,_0x13d94c,!![]);}catch(_0x23609d){return BPromise[_0x3069('0x31')](_0x23609d);}return _0x45a16a[_0x3069('0x32')]();};}function saveUpdates(_0x1cbf8a,_0x577ea5){return function(_0x42e61b){if(_0x42e61b){return _0x42e61b[_0x3069('0x33')](_0x1cbf8a)['then'](function(_0x138a95){return _0x138a95;});}return null;};}function removeEntity(_0x523d67,_0x26259e){return function(_0x8bc875){if(_0x8bc875){return _0x8bc875[_0x3069('0x34')]()[_0x3069('0x1d')](function(){var _0x3689cf=_0x8bc875['get']({'plain':!![]});var _0x5044be=_0x3069('0x35');return db[_0x3069('0x36')][_0x3069('0x34')]({'where':{'type':_0x5044be,'resourceId':_0x3689cf['id']}})[_0x3069('0x1d')](function(){return _0x8bc875;});})[_0x3069('0x1d')](function(){_0x523d67[_0x3069('0x27')](0xcc)[_0x3069('0x28')]();});}};}function handleEntityNotFound(_0x2473cb,_0x2c2c2c){return function(_0x263b73){if(!_0x263b73){_0x2473cb[_0x3069('0x37')](0x194);}return _0x263b73;};}function handleError(_0x434a75,_0x5db0f9){_0x5db0f9=_0x5db0f9||0x1f4;return function(_0x4711ae){logger[_0x3069('0x23')](_0x4711ae[_0x3069('0x38')]);if(_0x4711ae[_0x3069('0x39')]){delete _0x4711ae[_0x3069('0x39')];}_0x434a75[_0x3069('0x27')](_0x5db0f9)[_0x3069('0x3a')](_0x4711ae);};}exports[_0x3069('0x3b')]=function(_0x5c9bdf,_0x47d3dd){var _0x43aaf8={'include':[{'model':db['Pause'],'as':_0x3069('0x3c')}]},_0x5117b7={},_0x22fd65={'count':0x0,'rows':[]};var _0x56e8d1=_['map'](db[_0x3069('0x3d')][_0x3069('0x3e')],function(_0x524a9c){return{'name':_0x524a9c[_0x3069('0x3f')],'type':_0x524a9c[_0x3069('0x40')][_0x3069('0x41')]};});_0x5117b7[_0x3069('0x42')]=_['map'](_0x56e8d1,_0x3069('0x39'));_0x5117b7[_0x3069('0x43')]=_[_0x3069('0x44')](_0x5c9bdf['query']);_0x5117b7[_0x3069('0x45')]=_['intersection'](_0x5117b7[_0x3069('0x42')],_0x5117b7[_0x3069('0x43')]);_0x43aaf8[_0x3069('0x46')]=_[_0x3069('0x47')](_0x5117b7['model'],qs[_0x3069('0x48')](_0x5c9bdf['query']['fields']));_0x43aaf8[_0x3069('0x46')]=_0x43aaf8[_0x3069('0x46')][_0x3069('0x49')]?_0x43aaf8[_0x3069('0x46')]:_0x5117b7['model'];if(!_0x5c9bdf[_0x3069('0x43')]['hasOwnProperty']('nolimit')){_0x43aaf8['limit']=qs[_0x3069('0x2b')](_0x5c9bdf['query']['limit']);_0x43aaf8[_0x3069('0x2d')]=qs[_0x3069('0x2d')](_0x5c9bdf['query'][_0x3069('0x2d')]);}_0x43aaf8[_0x3069('0x4a')]=qs[_0x3069('0x4b')](_0x5c9bdf[_0x3069('0x43')][_0x3069('0x4b')]);_0x43aaf8['where']=qs['filters'](_[_0x3069('0x4c')](_0x5c9bdf['query'],_0x5117b7[_0x3069('0x45')]),_0x56e8d1);if(_0x5c9bdf['query'][_0x3069('0x4d')]){_0x43aaf8[_0x3069('0x4e')]=_[_0x3069('0x4f')](_0x43aaf8[_0x3069('0x4e')],{'$or':_[_0x3069('0x50')](_0x56e8d1,function(_0x30ecac){if(_0x30ecac['type']!==_0x3069('0x51')){var _0x47452d={};_0x47452d[_0x30ecac[_0x3069('0x39')]]={'$like':'%'+_0x5c9bdf[_0x3069('0x43')][_0x3069('0x4d')]+'%'};return _0x47452d;}})});}_0x43aaf8=_['merge']({},_0x43aaf8,_0x5c9bdf[_0x3069('0x52')]);var _0x96bfeb={'where':_0x43aaf8[_0x3069('0x4e')]};return db['WhatsappAccount'][_0x3069('0x2c')](_0x96bfeb)[_0x3069('0x1d')](function(_0x2d9845){_0x22fd65[_0x3069('0x2c')]=_0x2d9845;if(_0x5c9bdf[_0x3069('0x43')]['includeAll']){_0x43aaf8[_0x3069('0x53')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x3069('0x54')](_0x43aaf8);})['then'](function(_0x34ad6b){_0x22fd65[_0x3069('0x55')]=_0x34ad6b;return _0x22fd65;})['then'](respondWithFilteredResult(_0x47d3dd,_0x43aaf8))[_0x3069('0x26')](handleError(_0x47d3dd,null));};exports['show']=function(_0x1b3fdc,_0x54910f){var _0x47419={'raw':![],'where':{'id':_0x1b3fdc[_0x3069('0x56')]['id']},'include':[{'model':db[_0x3069('0x57')],'as':_0x3069('0x3c')}]},_0x562356={};_0x562356[_0x3069('0x42')]=_['keys'](db['WhatsappAccount']['rawAttributes']);_0x562356[_0x3069('0x43')]=_['keys'](_0x1b3fdc[_0x3069('0x43')]);_0x562356[_0x3069('0x45')]=_[_0x3069('0x47')](_0x562356[_0x3069('0x42')],_0x562356[_0x3069('0x43')]);_0x47419[_0x3069('0x46')]=_[_0x3069('0x47')](_0x562356[_0x3069('0x42')],qs[_0x3069('0x48')](_0x1b3fdc[_0x3069('0x43')][_0x3069('0x48')]));_0x47419[_0x3069('0x46')]=_0x47419[_0x3069('0x46')][_0x3069('0x49')]?_0x47419['attributes']:_0x562356[_0x3069('0x42')];if(_0x1b3fdc[_0x3069('0x43')]['includeAll']){_0x47419[_0x3069('0x53')]=[{'all':!![]}];}_0x47419=_['merge']({},_0x47419,_0x1b3fdc[_0x3069('0x52')]);return db[_0x3069('0x3d')]['find'](_0x47419)['then'](handleEntityNotFound(_0x54910f,null))['then'](respondWithResult(_0x54910f,null))['catch'](handleError(_0x54910f,null));};exports['create']=function(_0x216d30,_0x459304){return db[_0x3069('0x3d')]['create'](_0x216d30['body'],{})['then'](function(_0x172bf5){var _0x49f3a3=_0x216d30[_0x3069('0x58')][_0x3069('0x59')]({'plain':!![]});if(!_0x49f3a3)throw new Error(_0x3069('0x5a'));if(_0x49f3a3[_0x3069('0x5b')]===_0x3069('0x58')){var _0xf20db8=_0x172bf5[_0x3069('0x59')]({'plain':!![]});var _0x5e10a3='WhatsappAccounts';return db[_0x3069('0x5c')][_0x3069('0x5d')]({'where':{'name':_0x5e10a3,'userProfileId':_0x49f3a3[_0x3069('0x5e')]},'raw':!![]})[_0x3069('0x1d')](function(_0x2039c8){if(_0x2039c8&&_0x2039c8[_0x3069('0x5f')]===0x0){return db[_0x3069('0x36')][_0x3069('0x60')]({'name':_0xf20db8[_0x3069('0x39')],'resourceId':_0xf20db8['id'],'type':_0x2039c8[_0x3069('0x39')],'sectionId':_0x2039c8['id']},{})['then'](function(){return _0x172bf5;});}else{return _0x172bf5;}})[_0x3069('0x26')](function(_0x31985a){logger[_0x3069('0x23')](_0x3069('0x61'),_0x31985a);throw _0x31985a;});}return _0x172bf5;})[_0x3069('0x1d')](respondWithResult(_0x459304,0xc9))[_0x3069('0x26')](handleError(_0x459304,null));};exports['update']=function(_0x25d09c,_0x32bf3d){if(_0x25d09c[_0x3069('0x62')]['id']){delete _0x25d09c[_0x3069('0x62')]['id'];}return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x25d09c['params']['id']},'include':[{'model':db['Pause'],'as':_0x3069('0x3c')}]})[_0x3069('0x1d')](handleEntityNotFound(_0x32bf3d,null))[_0x3069('0x1d')](saveUpdates(_0x25d09c[_0x3069('0x62')],null))[_0x3069('0x1d')](respondWithResult(_0x32bf3d,null))[_0x3069('0x26')](handleError(_0x32bf3d,null));};exports[_0x3069('0x34')]=function(_0x1e0a68,_0x3f4c1b){return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x1e0a68[_0x3069('0x56')]['id']}})['then'](handleEntityNotFound(_0x3f4c1b,null))['then'](removeEntity(_0x3f4c1b,null))[_0x3069('0x26')](handleError(_0x3f4c1b,null));};exports[_0x3069('0x63')]=function(_0x42da76,_0x769af9){return db[_0x3069('0x3d')][_0x3069('0x63')]()[_0x3069('0x1d')](respondWithResult(_0x769af9,null))[_0x3069('0x26')](handleError(_0x769af9,null));};exports[_0x3069('0x64')]=function(_0x5751aa,_0x3b7493,_0x5bc1b7){if(_0x5751aa[_0x3069('0x62')]['id']){delete _0x5751aa[_0x3069('0x62')]['id'];}return db[_0x3069('0x3d')]['find']({'where':{'id':_0x5751aa[_0x3069('0x56')]['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0x3b7493,null))[_0x3069('0x1d')](function(_0x310d04){if(_0x310d04){_0x5751aa[_0x3069('0x62')][_0x3069('0x65')]=_0x310d04['id'];return db[_0x3069('0x66')][_0x3069('0x60')](_0x5751aa['body']);}})[_0x3069('0x1d')](respondWithResult(_0x3b7493,null))['catch'](handleError(_0x3b7493,null));};exports['getDispositions']=function(_0x29475b,_0x1f48fc,_0x5246b1){var _0x464bcc={'raw':![],'where':{}};var _0x4ad318={};var _0x4498c0={'count':0x0,'rows':[]};return db[_0x3069('0x3d')][_0x3069('0x67')]({'where':{'id':_0x29475b[_0x3069('0x56')]['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0x1f48fc,null))['then'](function(_0x5e8c5e){if(_0x5e8c5e){_0x4ad318[_0x3069('0x42')]=_[_0x3069('0x44')](db[_0x3069('0x66')][_0x3069('0x3e')]);_0x4ad318[_0x3069('0x43')]=_['keys'](_0x29475b['query']);_0x4ad318[_0x3069('0x45')]=_[_0x3069('0x47')](_0x4ad318[_0x3069('0x42')],_0x4ad318[_0x3069('0x43')]);_0x464bcc[_0x3069('0x46')]=_[_0x3069('0x47')](_0x4ad318[_0x3069('0x42')],qs[_0x3069('0x48')](_0x29475b[_0x3069('0x43')][_0x3069('0x48')]));_0x464bcc[_0x3069('0x46')]=_0x464bcc[_0x3069('0x46')]['length']?_0x464bcc[_0x3069('0x46')]:_0x4ad318['model'];if(!_0x29475b[_0x3069('0x43')][_0x3069('0x68')]('nolimit')){_0x464bcc[_0x3069('0x2b')]=qs[_0x3069('0x2b')](_0x29475b['query']['limit']);_0x464bcc[_0x3069('0x2d')]=qs['offset'](_0x29475b[_0x3069('0x43')][_0x3069('0x2d')]);}_0x464bcc[_0x3069('0x4a')]=qs[_0x3069('0x4b')](_0x29475b['query'][_0x3069('0x4b')]);_0x464bcc['where']=qs['filters'](_[_0x3069('0x4c')](_0x29475b['query'],_0x4ad318[_0x3069('0x45')]));_0x464bcc[_0x3069('0x4e')][_0x3069('0x65')]=_0x5e8c5e['id'];if(_0x29475b['query'][_0x3069('0x4d')]){_0x464bcc[_0x3069('0x4e')]=_[_0x3069('0x4f')](_0x464bcc[_0x3069('0x4e')],{'$or':_[_0x3069('0x50')](_0x464bcc[_0x3069('0x46')],function(_0x3f641a){var _0xc93ba3={};_0xc93ba3[_0x3f641a]={'$like':'%'+_0x29475b[_0x3069('0x43')][_0x3069('0x4d')]+'%'};return _0xc93ba3;})});}_0x464bcc=_['merge']({},_0x464bcc,_0x29475b[_0x3069('0x52')]);return db[_0x3069('0x66')][_0x3069('0x2c')]({'where':_0x464bcc[_0x3069('0x4e')]})[_0x3069('0x1d')](function(_0x4d1ee3){_0x4498c0[_0x3069('0x2c')]=_0x4d1ee3;if(_0x29475b[_0x3069('0x43')][_0x3069('0x69')]){_0x464bcc[_0x3069('0x53')]=[{'all':!![]}];}return db[_0x3069('0x66')][_0x3069('0x54')](_0x464bcc);})[_0x3069('0x1d')](function(_0xe46b26){_0x4498c0['rows']=_0xe46b26;return _0x4498c0;});}})[_0x3069('0x1d')](respondWithFilteredResult(_0x1f48fc,_0x464bcc))[_0x3069('0x26')](handleError(_0x1f48fc,null));};exports[_0x3069('0x6a')]=function(_0x39f820,_0x25f0e0,_0x281f12){return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x39f820[_0x3069('0x56')]['id']}})['then'](handleEntityNotFound(_0x25f0e0,null))[_0x3069('0x1d')](function(_0x525ecd){if(_0x525ecd){return _0x525ecd[_0x3069('0x6a')](_0x39f820['query']['ids']);}})[_0x3069('0x1d')](respondWithStatusCode(_0x25f0e0,null))[_0x3069('0x26')](handleError(_0x25f0e0,null));};exports['addAnswer']=function(_0x351f4a,_0xb17978,_0xb5dbc4){if(_0x351f4a[_0x3069('0x62')]['id']){delete _0x351f4a[_0x3069('0x62')]['id'];}return db[_0x3069('0x3d')]['find']({'where':{'id':_0x351f4a['params']['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0xb17978,null))['then'](function(_0x12ff49){if(_0x12ff49){_0x351f4a[_0x3069('0x62')][_0x3069('0x65')]=_0x12ff49['id'];return db[_0x3069('0x6b')][_0x3069('0x60')](_0x351f4a[_0x3069('0x62')]);}})['then'](respondWithResult(_0xb17978,null))[_0x3069('0x26')](handleError(_0xb17978,null));};exports[_0x3069('0x6c')]=function(_0x3c1855,_0x6bc57b,_0x42436f){var _0x1cdfb2={'raw':![],'where':{}};var _0x207134={};var _0x414a85={'count':0x0,'rows':[]};return db[_0x3069('0x3d')]['findOne']({'where':{'id':_0x3c1855['params']['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0x6bc57b,null))[_0x3069('0x1d')](function(_0x369784){if(_0x369784){_0x207134[_0x3069('0x42')]=_[_0x3069('0x44')](db['CannedAnswer'][_0x3069('0x3e')]);_0x207134[_0x3069('0x43')]=_[_0x3069('0x44')](_0x3c1855['query']);_0x207134[_0x3069('0x45')]=_['intersection'](_0x207134[_0x3069('0x42')],_0x207134[_0x3069('0x43')]);_0x1cdfb2[_0x3069('0x46')]=_[_0x3069('0x47')](_0x207134['model'],qs['fields'](_0x3c1855[_0x3069('0x43')][_0x3069('0x48')]));_0x1cdfb2[_0x3069('0x46')]=_0x1cdfb2[_0x3069('0x46')][_0x3069('0x49')]?_0x1cdfb2['attributes']:_0x207134[_0x3069('0x42')];if(!_0x3c1855[_0x3069('0x43')][_0x3069('0x68')]('nolimit')){_0x1cdfb2[_0x3069('0x2b')]=qs['limit'](_0x3c1855[_0x3069('0x43')]['limit']);_0x1cdfb2[_0x3069('0x2d')]=qs[_0x3069('0x2d')](_0x3c1855[_0x3069('0x43')][_0x3069('0x2d')]);}_0x1cdfb2[_0x3069('0x4a')]=qs[_0x3069('0x4b')](_0x3c1855[_0x3069('0x43')]['sort']);_0x1cdfb2[_0x3069('0x4e')]=qs[_0x3069('0x45')](_[_0x3069('0x4c')](_0x3c1855[_0x3069('0x43')],_0x207134[_0x3069('0x45')]));_0x1cdfb2[_0x3069('0x4e')][_0x3069('0x65')]=_0x369784['id'];if(_0x3c1855[_0x3069('0x43')]['filter']){_0x1cdfb2[_0x3069('0x4e')]=_[_0x3069('0x4f')](_0x1cdfb2[_0x3069('0x4e')],{'$or':_[_0x3069('0x50')](_0x1cdfb2[_0x3069('0x46')],function(_0x41e815){var _0x4b4671={};_0x4b4671[_0x41e815]={'$like':'%'+_0x3c1855[_0x3069('0x43')][_0x3069('0x4d')]+'%'};return _0x4b4671;})});}_0x1cdfb2=_[_0x3069('0x4f')]({},_0x1cdfb2,_0x3c1855[_0x3069('0x52')]);return db['CannedAnswer']['count']({'where':_0x1cdfb2[_0x3069('0x4e')]})[_0x3069('0x1d')](function(_0x4159b1){_0x414a85[_0x3069('0x2c')]=_0x4159b1;if(_0x3c1855[_0x3069('0x43')][_0x3069('0x69')]){_0x1cdfb2['include']=[{'all':!![]}];}return db[_0x3069('0x6b')][_0x3069('0x54')](_0x1cdfb2);})[_0x3069('0x1d')](function(_0x2c0a7c){_0x414a85['rows']=_0x2c0a7c;return _0x414a85;});}})['then'](respondWithFilteredResult(_0x6bc57b,_0x1cdfb2))['catch'](handleError(_0x6bc57b,null));};exports[_0x3069('0x6d')]=function(_0x3d2bd1,_0xed8e5,_0x11a3a3){return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x3d2bd1[_0x3069('0x56')]['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0xed8e5,null))[_0x3069('0x1d')](function(_0x165e04){if(_0x165e04){return _0x165e04[_0x3069('0x6d')](_0x3d2bd1[_0x3069('0x43')][_0x3069('0x6e')]);}})[_0x3069('0x1d')](respondWithStatusCode(_0xed8e5,null))[_0x3069('0x26')](handleError(_0xed8e5,null));};exports[_0x3069('0x6f')]=function(_0x29c76,_0x4b1369,_0x4a56e2){return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x29c76['params']['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0x4b1369,null))[_0x3069('0x1d')](function(_0x57d273){if(_0x57d273){return _0x57d273[_0x3069('0x6f')](_0x29c76['body'][_0x3069('0x6e')],_[_0x3069('0x70')](_0x29c76['body'],['ids','id'])||{})['spread'](function(_0x3a55d0){for(var _0x1ce020=0x0;_0x1ce020<_0x29c76[_0x3069('0x62')][_0x3069('0x6e')][_0x3069('0x49')];_0x1ce020+=0x1){socket[_0x3069('0x71')]('userWhatsappAccount:save',{'UserId':Number(_0x29c76[_0x3069('0x62')][_0x3069('0x6e')][_0x1ce020]),'WhatsappAccountId':Number(_0x29c76[_0x3069('0x56')]['id'])});}return _0x3a55d0;});}})[_0x3069('0x1d')](respondWithResult(_0x4b1369,null))[_0x3069('0x26')](handleError(_0x4b1369,null));};exports[_0x3069('0x72')]=function(_0x475693,_0x215c7b,_0x371d73){return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x475693[_0x3069('0x56')]['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0x215c7b,null))[_0x3069('0x1d')](function(_0x2b68fb){if(_0x2b68fb){return _0x2b68fb[_0x3069('0x72')](_0x475693[_0x3069('0x43')]['ids'])[_0x3069('0x1d')](function(){if(_[_0x3069('0x73')](_0x475693[_0x3069('0x43')]['ids'])){for(var _0x13e35b=0x0;_0x13e35b<_0x475693[_0x3069('0x43')][_0x3069('0x6e')][_0x3069('0x49')];_0x13e35b+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x475693[_0x3069('0x43')][_0x3069('0x6e')][_0x13e35b]),'WhatsappAccountId':Number(_0x475693[_0x3069('0x56')]['id'])});}}else{socket[_0x3069('0x71')](_0x3069('0x74'),{'UserId':Number(_0x475693[_0x3069('0x43')][_0x3069('0x6e')]),'WhatsappAccountId':Number(_0x475693[_0x3069('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x215c7b,null))['catch'](handleError(_0x215c7b,null));};exports[_0x3069('0x75')]=function(_0x3223bb,_0x3a0916,_0x469779){var _0x1b4e33={};var _0x9e2a03={};var _0x306c5e;var _0xee1376;return db['WhatsappAccount'][_0x3069('0x67')]({'where':{'id':_0x3223bb['params']['id']}})[_0x3069('0x1d')](handleEntityNotFound(_0x3a0916,null))['then'](function(_0x52ad99){if(_0x52ad99){_0x306c5e=_0x52ad99;_0x9e2a03[_0x3069('0x42')]=_[_0x3069('0x44')](db[_0x3069('0x76')][_0x3069('0x3e')]);_0x9e2a03[_0x3069('0x43')]=_['keys'](_0x3223bb['query']);_0x9e2a03[_0x3069('0x45')]=_[_0x3069('0x47')](_0x9e2a03[_0x3069('0x42')],_0x9e2a03[_0x3069('0x43')]);_0x1b4e33['attributes']=_[_0x3069('0x47')](_0x9e2a03['model'],qs[_0x3069('0x48')](_0x3223bb[_0x3069('0x43')][_0x3069('0x48')]));_0x1b4e33[_0x3069('0x46')]=_0x1b4e33[_0x3069('0x46')][_0x3069('0x49')]?_0x1b4e33[_0x3069('0x46')]:_0x9e2a03[_0x3069('0x42')];_0x1b4e33['order']=qs[_0x3069('0x4b')](_0x3223bb[_0x3069('0x43')][_0x3069('0x4b')]);_0x1b4e33['where']=qs['filters'](_['pick'](_0x3223bb['query'],_0x9e2a03['filters']));if(_0x3223bb['query'][_0x3069('0x4d')]){_0x1b4e33[_0x3069('0x4e')]=_[_0x3069('0x4f')](_0x1b4e33[_0x3069('0x4e')],{'$or':_[_0x3069('0x50')](_0x1b4e33[_0x3069('0x46')],function(_0x50e9da){var _0x4ae36f={};_0x4ae36f[_0x50e9da]={'$like':'%'+_0x3223bb['query'][_0x3069('0x4d')]+'%'};return _0x4ae36f;})});}_0x1b4e33=_['merge']({},_0x1b4e33,_0x3223bb[_0x3069('0x52')]);return _0x306c5e[_0x3069('0x75')](_0x1b4e33);}})['then'](function(_0xfe4c0f){if(_0xfe4c0f){_0xee1376=_0xfe4c0f['length'];if(!_0x3223bb['query']['hasOwnProperty'](_0x3069('0x77'))){_0x1b4e33['limit']=qs[_0x3069('0x2b')](_0x3223bb['query'][_0x3069('0x2b')]);_0x1b4e33[_0x3069('0x2d')]=qs[_0x3069('0x2d')](_0x3223bb[_0x3069('0x43')][_0x3069('0x2d')]);}return _0x306c5e['getAgents'](_0x1b4e33);}})[_0x3069('0x1d')](function(_0x5c4364){if(_0x5c4364){return _0x5c4364?{'count':_0xee1376,'rows':_0x5c4364}:null;}})[_0x3069('0x1d')](respondWithResult(_0x3a0916,null))[_0x3069('0x26')](handleError(_0x3a0916,null));};exports[_0x3069('0x78')]=function(_0x3e8a73,_0x27b41f,_0x1fc2f5){return db[_0x3069('0x3d')]['findOne']({'where':{'id':_0x3e8a73[_0x3069('0x56')]['id']}})['then'](handleEntityNotFound(_0x27b41f,null))[_0x3069('0x1d')](function(_0x42425f){if(_0x42425f){return db[_0x3069('0x79')][_0x3069('0x7a')](function(_0x172b24){return db[_0x3069('0x7b')][_0x3069('0x34')]({'where':{'WhatsappAccountId':_0x3e8a73[_0x3069('0x56')]['id']},'transaction':_0x172b24})[_0x3069('0x1d')](function(_0x2c4d2a){var _0x3e0a32=_[_0x3069('0x50')](_0x3e8a73[_0x3069('0x62')],function(_0x3d4f1e){_0x3d4f1e[_0x3069('0x65')]=_0x3e8a73['params']['id'];return _0x3d4f1e;});return db[_0x3069('0x7b')][_0x3069('0x7c')](_0x3e0a32,{'transaction':_0x172b24});});})[_0x3069('0x1d')](function(){return db[_0x3069('0x7b')][_0x3069('0x7d')]({'where':{'WhatsappAccountId':_0x3e8a73[_0x3069('0x56')]['id']},'order':'priority'});});}})[_0x3069('0x1d')](respondWithResult(_0x27b41f,null))[_0x3069('0x26')](handleError(_0x27b41f,null));};exports['getApplications']=function(_0x24cb2e,_0x3ad731,_0x3e6a8b){var _0x38dd32={};var _0x174d4a={};var _0x19382e;var _0x3ae326;return db[_0x3069('0x3d')]['findOne']({'where':{'id':_0x24cb2e[_0x3069('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ad731,null))['then'](function(_0x184406){if(_0x184406){_0x19382e=_0x184406;_0x174d4a[_0x3069('0x42')]=_[_0x3069('0x44')](db[_0x3069('0x7b')][_0x3069('0x3e')]);_0x174d4a[_0x3069('0x43')]=_[_0x3069('0x44')](_0x24cb2e[_0x3069('0x43')]);_0x174d4a[_0x3069('0x45')]=_['intersection'](_0x174d4a[_0x3069('0x42')],_0x174d4a[_0x3069('0x43')]);_0x38dd32[_0x3069('0x46')]=_[_0x3069('0x47')](_0x174d4a[_0x3069('0x42')],qs[_0x3069('0x48')](_0x24cb2e[_0x3069('0x43')][_0x3069('0x48')]));_0x38dd32[_0x3069('0x46')]=_0x38dd32[_0x3069('0x46')][_0x3069('0x49')]?_0x38dd32['attributes']:_0x174d4a[_0x3069('0x42')];_0x38dd32[_0x3069('0x4a')]=qs[_0x3069('0x4b')](_0x24cb2e[_0x3069('0x43')]['sort']);_0x38dd32['where']=qs[_0x3069('0x45')](_[_0x3069('0x4c')](_0x24cb2e[_0x3069('0x43')],_0x174d4a[_0x3069('0x45')]));if(_0x24cb2e[_0x3069('0x43')][_0x3069('0x4d')]){_0x38dd32[_0x3069('0x4e')]=_[_0x3069('0x4f')](_0x38dd32[_0x3069('0x4e')],{'$or':_[_0x3069('0x50')](_0x38dd32['attributes'],function(_0x75a9b0){var _0x5c0e20={};_0x5c0e20[_0x75a9b0]={'$like':'%'+_0x24cb2e[_0x3069('0x43')][_0x3069('0x4d')]+'%'};return _0x5c0e20;})});}_0x38dd32=_[_0x3069('0x4f')]({},_0x38dd32,_0x24cb2e[_0x3069('0x52')]);return _0x19382e[_0x3069('0x7e')](_0x38dd32);}})[_0x3069('0x1d')](function(_0x13ed02){if(_0x13ed02){_0x3ae326=_0x13ed02[_0x3069('0x49')];if(!_0x24cb2e[_0x3069('0x43')][_0x3069('0x68')](_0x3069('0x77'))){_0x38dd32[_0x3069('0x2b')]=qs[_0x3069('0x2b')](_0x24cb2e['query'][_0x3069('0x2b')]);_0x38dd32['offset']=qs['offset'](_0x24cb2e[_0x3069('0x43')]['offset']);}return _0x19382e[_0x3069('0x7e')](_0x38dd32);}})[_0x3069('0x1d')](function(_0x5ea29d){if(_0x5ea29d){return _0x5ea29d?{'count':_0x3ae326,'rows':_0x5ea29d}:null;}})['then'](respondWithResult(_0x3ad731,null))[_0x3069('0x26')](handleError(_0x3ad731,null));};exports['notify']=function(_0x1e32c5,_0x3f3705,_0x3b0101){var _0x474f0a={'channel':_0x3069('0x7f')};var _0x4aa57f=[];var _0x3d58fa=[];var _0x349cd4={};return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x1e32c5[_0x3069('0x56')]['id']},'include':[{'model':db[_0x3069('0x7b')],'as':_0x3069('0x80')}]})[_0x3069('0x1d')](handleEntityNotFound(_0x3f3705,null))[_0x3069('0x1d')](function(_0x49dde7){_0x474f0a[_0x3069('0x81')]=_0x49dde7;if(_0x474f0a[_0x3069('0x81')]&&_0x474f0a['account'][_0x3069('0x40')]===_0x3069('0x82')&&_0x1e32c5[_0x3069('0x62')][_0x3069('0x83')]&&_0x1e32c5[_0x3069('0x62')][_0x3069('0x83')][0x0][_0x3069('0x84')]===_0x3069('0x85')){return db[_0x3069('0x86')][_0x3069('0x33')]({'read':_0x1e32c5[_0x3069('0x62')]['statuses'][0x0][_0x3069('0x84')]==='read'?!![]:![],'readAt':_0x1e32c5[_0x3069('0x62')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x1e32c5[_0x3069('0x62')]['statuses'][0x0][_0x3069('0x87')]}})[_0x3069('0x1d')](function(_0x473856){return _0x3f3705[_0x3069('0x27')](0xc8)['json'](_0x473856);});}_0x474f0a['applications']=_['orderBy'](_0x49dde7['Applications'],[_0x3069('0x88')],[_0x3069('0x89')]);if(_0x474f0a[_0x3069('0x81')][_0x3069('0x80')]){delete _0x474f0a[_0x3069('0x81')][_0x3069('0x80')];}return db[_0x3069('0x8a')][_0x3069('0x63')]()[_0x3069('0x1d')](function(_0x4cf46d){if(!_0x4cf46d){throw new db['Sequelize'][(_0x3069('0x8b'))](_0x3069('0x8c'));}_0x4aa57f=_[_0x3069('0x8d')](_[_0x3069('0x44')](_0x4cf46d),[_0x3069('0x8e'),_0x3069('0x8f')]);_0x3d58fa=_[_0x3069('0x8d')](_['keys'](_0x4cf46d),[_0x3069('0x8e'),'updatedAt',_0x3069('0x90'),_0x3069('0x91')]);_0x474f0a[_0x3069('0x62')]={'mapKey':_0x3069('0x92')};if(_0x474f0a['account']&&_0x474f0a[_0x3069('0x81')]['type']===_0x3069('0x93')){_0x474f0a['body']['from']=_0x1e32c5['body'][_0x3069('0x94')][_0x3069('0x95')]('whatsapp:','');_0x474f0a[_0x3069('0x62')][_0x3069('0x62')]=_0x1e32c5['body'][_0x3069('0x96')];_0x474f0a[_0x3069('0x62')]['messageId']=_0x1e32c5['body'][_0x3069('0x97')];}if(_0x474f0a[_0x3069('0x81')]&&_0x474f0a[_0x3069('0x81')][_0x3069('0x40')]===_0x3069('0x82')){_0x474f0a[_0x3069('0x62')][_0x3069('0x98')]=_0x1e32c5[_0x3069('0x62')][_0x3069('0x99')][0x0]['from'];_0x474f0a['body'][_0x3069('0x62')]=_0x1e32c5[_0x3069('0x62')][_0x3069('0x99')][0x0][_0x3069('0x25')][_0x3069('0x62')];_0x474f0a[_0x3069('0x62')][_0x3069('0x9a')]=_0x1e32c5[_0x3069('0x62')][_0x3069('0x99')][0x0]['message_id'];}if(_0x474f0a[_0x3069('0x62')]['id']){delete _0x474f0a[_0x3069('0x62')]['id'];}if(_[_0x3069('0x9b')](_0x474f0a[_0x3069('0x62')][_0x3069('0x98')])){throw new db[(_0x3069('0x9c'))]['ValidationError'](_0x3069('0x9d'));}if(_['isNil'](_0x474f0a['body'][_0x3069('0x62')])||_0x474f0a[_0x3069('0x62')]['body']===''){throw new db['Sequelize'][(_0x3069('0x8b'))](_0x3069('0x9e'));}if(_[_0x3069('0x9b')](_0x474f0a['body']['mapKey'])){throw new db[(_0x3069('0x9c'))][(_0x3069('0x8b'))](_0x3069('0x9f')+_0x3d58fa);}if(!_[_0x3069('0xa0')](_0x3d58fa,_0x474f0a['body'][_0x3069('0xa1')])){throw new db[(_0x3069('0x9c'))]['ValidationError'](_0x3069('0xa2')+_0x3d58fa);}_0x349cd4[_0x474f0a[_0x3069('0x62')][_0x3069('0xa1')]]=_0x474f0a[_0x3069('0x62')]['from'];return db['CmList'][_0x3069('0x5d')]({'where':{'id':_0x474f0a[_0x3069('0x81')][_0x3069('0x91')]},'include':[{'model':db[_0x3069('0x8a')],'as':_0x3069('0xa3'),'where':_0x349cd4,'limit':0x1,'order':[['updatedAt',_0x3069('0xa4')]]}]});})[_0x3069('0x1d')](handleEntityNotFound(_0x3f3705,null))[_0x3069('0x1d')](function(_0x513d6f){if(_0x513d6f){_0x474f0a['list']=_[_0x3069('0x70')](_0x513d6f,[_0x3069('0xa3')]);if(_0x513d6f[_0x3069('0xa3')][_0x3069('0x49')]){return _0x513d6f['Contacts'][0x0];}var _0x5772a5=_[_0x3069('0x14')](_0x474f0a['body'],{'firstName':_0x474f0a[_0x3069('0x62')][_0x3069('0x98')],'ListId':_0x513d6f['id']});_0x5772a5[_0x474f0a[_0x3069('0x62')]['mapKey']]=_0x474f0a[_0x3069('0x62')][_0x3069('0x98')];return db[_0x3069('0x8a')]['create'](_0x5772a5,{'fields':_0x4aa57f,'raw':!![]});}})[_0x3069('0x1d')](handleEntityNotFound(_0x3f3705,null))[_0x3069('0x1d')](function(_0x124a56){if(_0x124a56){_0x474f0a[_0x3069('0xa5')]=_0x124a56;var _0x577ed8={'ContactId':_0x124a56['id'],'phone':_0x474f0a['body']['from'],'WhatsappAccountId':_0x1e32c5[_0x3069('0x56')]['id']};var _0x2350af={'ContactId':_0x124a56['id'],'WhatsappAccountId':_0x1e32c5[_0x3069('0x56')]['id'],'closed':![]};return db[_0x3069('0xa6')]['find']({'where':_0x2350af})[_0x3069('0x1d')](function(_0x33f9c6){if(_0x33f9c6){return[_0x33f9c6,![]];}return db[_0x3069('0xa6')][_0x3069('0x60')](_0x577ed8)['then'](function(_0x2e60ee){return[_0x2e60ee,!![]];});});}})[_0x3069('0xa7')](function(_0x3b3cbd,_0x258f42){_0x474f0a[_0x3069('0xa8')]=_0x3b3cbd[_0x3069('0x59')]({'plain':!![]});_0x474f0a['interaction'][_0x3069('0xa9')]=![];if(_0x258f42){if(_0x474f0a['account']['autoclose']){_0x474f0a[_0x3069('0xaa')][_0x3069('0xab')]({'id':0x0,'priority':_0x474f0a['applications'][_0x3069('0x49')]+0x1,'app':_0x3069('0xac'),'appdata':_0x3069('0xad'),'interval':_0x3069('0xae')});}_0x474f0a[_0x3069('0xa8')][_0x3069('0xa9')]=!![];}return db[_0x3069('0x86')][_0x3069('0x60')]({'phone':_0x474f0a[_0x3069('0x62')]['from'],'messageId':_0x474f0a['body'][_0x3069('0x9a')],'body':_0x474f0a['body'][_0x3069('0x62')],'WhatsappAccountId':_0x1e32c5['params']['id'],'WhatsappInteractionId':_0x3b3cbd['id'],'direction':'in','ContactId':_0x3b3cbd[_0x3069('0xaf')],'AttachmentId':_0x474f0a['body']['AttachmentId']});})['then'](function(_0x477cf9){_0x474f0a[_0x3069('0x25')]=_0x477cf9;if(_0x474f0a[_0x3069('0xa8')][_0x3069('0xb0')]){return db[_0x3069('0x76')][_0x3069('0x5d')]({'attributes':['id',_0x3069('0x39')],'where':{'id':_0x474f0a[_0x3069('0xa8')][_0x3069('0xb0')]}})[_0x3069('0x1d')](function(_0x24de6a){if(_0x24de6a){_0x474f0a[_0x3069('0xaa')][_0x3069('0xb1')]({'id':0x0,'priority':0x0,'app':_0x3069('0xb2'),'appdata':_0x24de6a[_0x3069('0x39')]+','+(_0x474f0a[_0x3069('0x81')][_0x3069('0xb3')]||0xa),'interval':_0x3069('0xae')});}return respondWithRpcPromise('Start','startRouting',_0x474f0a);});}return respondWithRpcPromise(_0x3069('0xb4'),_0x3069('0xb5'),_0x474f0a);})[_0x3069('0x1d')](function(_0x41f91e){if(_0x41f91e){var _0x488068=0xc8;var _0x365061=_0x3069('0xb6');logger['info'](_0x3069('0x21'),_0x365061,_0x488068,_0x3069('0xb7'));logger[_0x3069('0xb8')](_0x3069('0xb9'),_0x365061,_0x488068,_0x3069('0xb7'),JSON[_0x3069('0x22')](_0x41f91e));if(_0x474f0a[_0x3069('0x81')][_0x3069('0x40')]===_0x3069('0x93')){return _0x3f3705[_0x3069('0x27')](_0x488068)[_0x3069('0x2e')](_0x3069('0xba'),'text/xml')[_0x3069('0x3a')](_0x3069('0xbb'));}else{return _0x3f3705[_0x3069('0x27')](_0x488068)[_0x3069('0x29')](_0x41f91e);}}});})[_0x3069('0x26')](handleError(_0x3f3705,null));};exports[_0x3069('0x3a')]=function(_0x15d54f,_0xb071b4,_0x354280){var _0x372a8c,_0x362545,_0x14ed05;if(_['isNil'](_0x15d54f[_0x3069('0x62')][_0x3069('0x62')])||_0x15d54f[_0x3069('0x62')]['body']===''){throw new db[(_0x3069('0x9c'))]['ValidationError'](_0x3069('0x9e'));}if(_[_0x3069('0x9b')](_0x15d54f['body']['to'])){throw new db['Sequelize']['ValidationError'](_0x3069('0xbc'));}_0x372a8c=_0x15d54f[_0x3069('0x62')]['to'];return db[_0x3069('0x3d')][_0x3069('0x5d')]({'where':{'id':_0x15d54f['params']['id']},'include':[{'model':db[_0x3069('0xbd')],'as':_0x3069('0xbe'),'include':[{'model':db[_0x3069('0x8a')],'as':'Contacts','where':{'mobile':_0x372a8c},'limit':0x1,'order':[[_0x3069('0x8f'),'DESC']]}]}]})[_0x3069('0x1d')](handleEntityNotFound(_0xb071b4,null))['then'](function(_0x4f6d58){if(_0x4f6d58&&_0x4f6d58[_0x3069('0xbe')]){_0x362545=_0x4f6d58[_0x3069('0x59')]({'plain':!![]});if(_0x362545[_0x3069('0xbe')]&&_0x362545[_0x3069('0xbe')][_0x3069('0xa3')][_0x3069('0x49')]){return _0x362545[_0x3069('0xbe')]['Contacts'][0x0];}return db[_0x3069('0x8a')][_0x3069('0x60')](_['defaults'](_0x15d54f[_0x3069('0x62')],{'firstName':_0x372a8c,'mobile':_0x372a8c,'phone':_0x372a8c,'ListId':_0x362545[_0x3069('0x91')]}));}})[_0x3069('0x1d')](handleEntityNotFound(_0xb071b4,null))[_0x3069('0x1d')](function(_0x595981){if(_0x595981){_0x14ed05=_0x595981;return db[_0x3069('0xa6')]['find']({'where':{'ContactId':_0x14ed05['id'],'closed':![],'WhatsappAccountId':_0x362545['id']}})[_0x3069('0x1d')](function(_0x1207b9){if(_0x1207b9){return[_0x1207b9,![]];}return db[_0x3069('0xa6')][_0x3069('0x60')]({'UserId':_0x15d54f[_0x3069('0x58')]['id'],'ContactId':_0x14ed05['id'],'WhatsappAccountId':_0x362545['id'],'phone':_0x372a8c,'firstMsgDirection':_0x3069('0xbf'),'Messages':[_[_0x3069('0x4f')](_0x15d54f['body'],{'read':![],'body':_0x15d54f[_0x3069('0x62')][_0x3069('0x62')],'phone':_0x372a8c,'WhatsappAccountId':_0x362545['id'],'UserId':_0x15d54f['user']['id'],'ContactId':_0x14ed05['id']})]},{'include':[{'model':db[_0x3069('0x86')],'as':_0x3069('0xc0')}]})['then'](function(_0x1ed2c0){return[_0x1ed2c0,!![]];});});}})[_0x3069('0xa7')](function(_0x499ace,_0xfaf6c6){if(_0xfaf6c6){return _0x499ace;}return db['WhatsappMessage'][_0x3069('0x60')](_[_0x3069('0x4f')](_0x15d54f[_0x3069('0x62')],{'read':![],'body':_0x15d54f[_0x3069('0x62')][_0x3069('0x62')],'phone':_0x372a8c,'WhatsappAccountId':_0x362545['id'],'WhatsappInteractionId':_0x499ace['id'],'UserId':_0x15d54f['user']['id'],'ContactId':_0x14ed05['id']}))[_0x3069('0x1d')](function(_0x40843c){_0x499ace['dataValues']['Messages']=[];_0x499ace['dataValues'][_0x3069('0xc0')][_0x3069('0xab')](_0x40843c[_0x3069('0xc1')]);return _0x499ace;});})[_0x3069('0x1d')](respondWithResult(_0xb071b4,null))[_0x3069('0x26')](handleError(_0xb071b4,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ee0c99b..bec887c 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 _0x0290=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hook','exports'];(function(_0x2bd517,_0x129985){var _0xd052f7=function(_0x157997){while(--_0x157997){_0x2bd517['push'](_0x2bd517['shift']());}};_0xd052f7(++_0x129985);}(_0x0290,0x1cb));var _0x0029=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0290[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x0029('0x0'));var WhatsappAccount=require(_0x0029('0x1'))['db'][_0x0029('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0029('0x3')](0x0);var events={'afterCreate':_0x0029('0x4'),'afterUpdate':_0x0029('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d589d){return function(_0x3e5123,_0x5a1444,_0x55a683){WhatsappAccountEvents[_0x0029('0x6')](_0x2d589d+':'+_0x3e5123['id'],_0x3e5123);WhatsappAccountEvents[_0x0029('0x6')](_0x2d589d,_0x3e5123);_0x55a683(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x0029('0x7')](e,emitEvent(event));}}module[_0x0029('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xedb5=['events','../../mysqldb','WhatsappAccount','save','update','emit','hasOwnProperty','hook'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xedb5,0xa0));var _0x5edb=function(_0x1c0af5,_0x2b091b){_0x1c0af5=_0x1c0af5-0x0;var _0xbaf321=_0xedb5[_0x1c0af5];return _0xbaf321;};'use strict';var EventEmitter=require(_0x5edb('0x0'));var WhatsappAccount=require(_0x5edb('0x1'))['db'][_0x5edb('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5edb('0x3'),'afterUpdate':_0x5edb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1285fe){return function(_0x5aeef6,_0x1c56b9,_0x1ec466){WhatsappAccountEvents['emit'](_0x1285fe+':'+_0x5aeef6['id'],_0x5aeef6);WhatsappAccountEvents[_0x5edb('0x5')](_0x1285fe,_0x5aeef6);_0x1ec466(null);};}for(var e in events){if(events[_0x5edb('0x6')](e)){var event=events[e];WhatsappAccount[_0x5edb('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 213d335..152d781 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 _0x5559=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','whatsapp_accounts'];(function(_0x336e33,_0x527fa3){var _0x6c333a=function(_0x48dabd){while(--_0x48dabd){_0x336e33['push'](_0x336e33['shift']());}};_0x6c333a(++_0x527fa3);}(_0x5559,0x1ce));var _0x9555=function(_0x37d189,_0x5d1385){_0x37d189=_0x37d189-0x0;var _0x1b06ca=_0x5559[_0x37d189];return _0x1b06ca;};'use strict';var _=require(_0x9555('0x0'));var util=require(_0x9555('0x1'));var logger=require(_0x9555('0x2'))(_0x9555('0x3'));var moment=require(_0x9555('0x4'));var BPromise=require(_0x9555('0x5'));var rp=require(_0x9555('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9555('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x9555('0x8')]=function(_0xe30fc6,_0x18fbe9){return _0xe30fc6[_0x9555('0x9')]('WhatsappAccount',attributes,{'tableName':_0x9555('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d2c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x320620,_0x420a7b){var _0x231182=function(_0x218d5b){while(--_0x218d5b){_0x320620['push'](_0x320620['shift']());}};_0x231182(++_0x420a7b);}(_0x2d2c,0x1ab));var _0xc2d2=function(_0x1af655,_0x28b928){_0x1af655=_0x1af655-0x0;var _0x29da01=_0x2d2c[_0x1af655];return _0x29da01;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var logger=require(_0xc2d2('0x2'))(_0xc2d2('0x3'));var moment=require(_0xc2d2('0x4'));var BPromise=require(_0xc2d2('0x5'));var rp=require(_0xc2d2('0x6'));var fs=require('fs');var path=require(_0xc2d2('0x7'));var rimraf=require(_0xc2d2('0x8'));var config=require('../../config/environment');var attributes=require(_0xc2d2('0x9'));module['exports']=function(_0x46111e,_0x49c2be){return _0x46111e[_0xc2d2('0xa')](_0xc2d2('0xb'),attributes,{'tableName':_0xc2d2('0xc'),'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 32eefa5..e09f362 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 _0x4b68=['register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','WhatsappAccount','find','options','raw','attributes','map','model','include','ShowWhatsappAccount','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappAccount.socket'];(function(_0x5b60f2,_0x487b46){var _0x2b618b=function(_0x5ebc09){while(--_0x5ebc09){_0x5b60f2['push'](_0x5b60f2['shift']());}};_0x2b618b(++_0x487b46);}(_0x4b68,0xc8));var _0x84b6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4b68[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x84b6('0x0'));var moment=require(_0x84b6('0x1'));var BPromise=require(_0x84b6('0x2'));var rs=require(_0x84b6('0x3'));var fs=require('fs');var Redis=require(_0x84b6('0x4'));var db=require(_0x84b6('0x5'))['db'];var utils=require(_0x84b6('0x6'));var logger=require(_0x84b6('0x7'))(_0x84b6('0x8'));var config=require(_0x84b6('0x9'));var jayson=require(_0x84b6('0xa'));var client=jayson['client'][_0x84b6('0xb')]({'port':0x232a});config[_0x84b6('0xc')]=_[_0x84b6('0xd')](config[_0x84b6('0xc')],{'host':_0x84b6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84b6('0xc')]));require(_0x84b6('0xf'))[_0x84b6('0x10')](socket);function respondWithRpcPromise(_0x3a29d3,_0x302588,_0x5370df){return new BPromise(function(_0x37b2e2,_0x80bb80){return client[_0x84b6('0x11')](_0x3a29d3,_0x5370df)[_0x84b6('0x12')](function(_0x4b77ac){logger[_0x84b6('0x13')](_0x84b6('0x14'),_0x302588,_0x84b6('0x15'));logger[_0x84b6('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x302588,_0x84b6('0x15'),JSON['stringify'](_0x4b77ac));if(_0x4b77ac[_0x84b6('0x17')]){if(_0x4b77ac[_0x84b6('0x17')]['code']===0x1f4){logger['error'](_0x84b6('0x14'),_0x302588,_0x4b77ac[_0x84b6('0x17')]['message']);return _0x80bb80(_0x4b77ac[_0x84b6('0x17')][_0x84b6('0x18')]);}logger[_0x84b6('0x17')](_0x84b6('0x14'),_0x302588,_0x4b77ac[_0x84b6('0x17')][_0x84b6('0x18')]);return _0x37b2e2(_0x4b77ac[_0x84b6('0x17')][_0x84b6('0x18')]);}else{logger[_0x84b6('0x13')](_0x84b6('0x14'),_0x302588,_0x84b6('0x15'));_0x37b2e2(_0x4b77ac['result']['message']);}})['catch'](function(_0x47b95f){logger[_0x84b6('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x302588,_0x47b95f);_0x80bb80(_0x47b95f);});});}exports['ShowWhatsappAccount']=function(_0x2e1a09){var _0x429615=this;return new Promise(function(_0x33c861,_0x3144e8){return db[_0x84b6('0x19')][_0x84b6('0x1a')]({'raw':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')][_0x84b6('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')]['where']||null:null,'attributes':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')][_0x84b6('0x1d')]||null:null,'include':_0x2e1a09[_0x84b6('0x1b')]?_0x2e1a09[_0x84b6('0x1b')]['include']?_[_0x84b6('0x1e')](_0x2e1a09[_0x84b6('0x1b')]['include'],function(_0x3ec572){return{'model':db[_0x3ec572[_0x84b6('0x1f')]],'as':_0x3ec572['as'],'attributes':_0x3ec572[_0x84b6('0x1d')],'include':_0x3ec572[_0x84b6('0x20')]?_['map'](_0x3ec572[_0x84b6('0x20')],function(_0x3a382b){return{'model':db[_0x3a382b[_0x84b6('0x1f')]],'as':_0x3a382b['as'],'attributes':_0x3a382b[_0x84b6('0x1d')],'include':_0x3a382b['include']?_[_0x84b6('0x1e')](_0x3a382b[_0x84b6('0x20')],function(_0x59b6d4){return{'model':db[_0x59b6d4['model']],'as':_0x59b6d4['as'],'attributes':_0x59b6d4[_0x84b6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51aede){logger[_0x84b6('0x13')](_0x84b6('0x21'),_0x2e1a09);logger[_0x84b6('0x16')](_0x84b6('0x21'),_0x2e1a09,JSON[_0x84b6('0x22')](_0x51aede));_0x33c861(_0x51aede);})[_0x84b6('0x23')](function(_0x5cadd2){logger[_0x84b6('0x17')]('ShowWhatsappAccount',_0x5cadd2[_0x84b6('0x18')],_0x2e1a09);_0x3144e8(_0x429615[_0x84b6('0x17')](0x1f4,_0x5cadd2[_0x84b6('0x18')]));});});}; \ No newline at end of file +var _0xd954=['redis','defaults','localhost','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd954,0x7c));var _0x4d95=function(_0x56ac6a,_0x35ed04){_0x56ac6a=_0x56ac6a-0x0;var _0x169575=_0xd954[_0x56ac6a];return _0x169575;};'use strict';var _=require('lodash');var util=require(_0x4d95('0x0'));var moment=require(_0x4d95('0x1'));var BPromise=require('bluebird');var rs=require(_0x4d95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4d95('0x3'))(_0x4d95('0x4'));var config=require(_0x4d95('0x5'));var jayson=require(_0x4d95('0x6'));var client=jayson[_0x4d95('0x7')]['http']({'port':0x232a});config[_0x4d95('0x8')]=_[_0x4d95('0x9')](config[_0x4d95('0x8')],{'host':_0x4d95('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d95('0x8')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0xc7f1d6,_0x5be5db,_0x14cc4e){return new BPromise(function(_0x3864e3,_0x442dfb){return client[_0x4d95('0xb')](_0xc7f1d6,_0x14cc4e)[_0x4d95('0xc')](function(_0x51bc1f){logger[_0x4d95('0xd')](_0x4d95('0xe'),_0x5be5db,'request\x20sent');logger[_0x4d95('0xf')](_0x4d95('0x10'),_0x5be5db,_0x4d95('0x11'),JSON[_0x4d95('0x12')](_0x51bc1f));if(_0x51bc1f['error']){if(_0x51bc1f[_0x4d95('0x13')][_0x4d95('0x14')]===0x1f4){logger[_0x4d95('0x13')](_0x4d95('0xe'),_0x5be5db,_0x51bc1f[_0x4d95('0x13')][_0x4d95('0x15')]);return _0x442dfb(_0x51bc1f[_0x4d95('0x13')][_0x4d95('0x15')]);}logger[_0x4d95('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x5be5db,_0x51bc1f['error']['message']);return _0x3864e3(_0x51bc1f[_0x4d95('0x13')]['message']);}else{logger[_0x4d95('0xd')](_0x4d95('0xe'),_0x5be5db,_0x4d95('0x11'));_0x3864e3(_0x51bc1f[_0x4d95('0x16')][_0x4d95('0x15')]);}})[_0x4d95('0x17')](function(_0xf6f984){logger['error'](_0x4d95('0xe'),_0x5be5db,_0xf6f984);_0x442dfb(_0xf6f984);});});}exports[_0x4d95('0x18')]=function(_0x4e3dc6){var _0x782b6b=this;return new Promise(function(_0x402474,_0x54630e){return db[_0x4d95('0x19')][_0x4d95('0x1a')]({'raw':_0x4e3dc6['options']?_0x4e3dc6[_0x4d95('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4e3dc6[_0x4d95('0x1b')]?_0x4e3dc6[_0x4d95('0x1b')][_0x4d95('0x1c')]||null:null,'attributes':_0x4e3dc6[_0x4d95('0x1b')]?_0x4e3dc6[_0x4d95('0x1b')][_0x4d95('0x1d')]||null:null,'include':_0x4e3dc6[_0x4d95('0x1b')]?_0x4e3dc6[_0x4d95('0x1b')][_0x4d95('0x1e')]?_['map'](_0x4e3dc6[_0x4d95('0x1b')][_0x4d95('0x1e')],function(_0x423d51){return{'model':db[_0x423d51[_0x4d95('0x1f')]],'as':_0x423d51['as'],'attributes':_0x423d51[_0x4d95('0x1d')],'include':_0x423d51['include']?_['map'](_0x423d51[_0x4d95('0x1e')],function(_0x4698c5){return{'model':db[_0x4698c5[_0x4d95('0x1f')]],'as':_0x4698c5['as'],'attributes':_0x4698c5[_0x4d95('0x1d')],'include':_0x4698c5[_0x4d95('0x1e')]?_[_0x4d95('0x20')](_0x4698c5[_0x4d95('0x1e')],function(_0x39bd68){return{'model':db[_0x39bd68[_0x4d95('0x1f')]],'as':_0x39bd68['as'],'attributes':_0x39bd68[_0x4d95('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4d95('0xc')](function(_0x3d8a15){logger[_0x4d95('0xd')](_0x4d95('0x18'),_0x4e3dc6);logger[_0x4d95('0xf')](_0x4d95('0x18'),_0x4e3dc6,JSON[_0x4d95('0x12')](_0x3d8a15));_0x402474(_0x3d8a15);})[_0x4d95('0x17')](function(_0x4f85c7){logger[_0x4d95('0x13')]('ShowWhatsappAccount',_0x4f85c7[_0x4d95('0x15')],_0x4e3dc6);_0x54630e(_0x782b6b[_0x4d95('0x13')](0x1f4,_0x4f85c7[_0x4d95('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index bdb1dad..f0447e8 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 _0x86c9=['./whatsappAccount.events','remove','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x86c9,0x1e8));var _0x986c=function(_0x12b0b9,_0x2e780e){_0x12b0b9=_0x12b0b9-0x0;var _0x34a5f5=_0x86c9[_0x12b0b9];return _0x34a5f5;};'use strict';var WhatsappAccountEvents=require(_0x986c('0x0'));var events=['save',_0x986c('0x1'),_0x986c('0x2')];function createListener(_0x24c350,_0x39061d){return function(_0x313d73){_0x39061d[_0x986c('0x3')](_0x24c350,_0x313d73);};}function removeListener(_0x265b55,_0x3a145d){return function(){WhatsappAccountEvents[_0x986c('0x4')](_0x265b55,_0x3a145d);};}exports[_0x986c('0x5')]=function(_0x3e086b){for(var _0x19e534=0x0,_0x115c8d=events[_0x986c('0x6')];_0x19e534<_0x115c8d;_0x19e534++){var _0x156a08=events[_0x19e534];var _0x5d7bea=createListener(_0x986c('0x7')+_0x156a08,_0x3e086b);WhatsappAccountEvents['on'](_0x156a08,_0x5d7bea);}}; \ No newline at end of file +var _0xfe77=['length','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x2bd4e3,_0x4d9b53){var _0x259f7c=function(_0x419754){while(--_0x419754){_0x2bd4e3['push'](_0x2bd4e3['shift']());}};_0x259f7c(++_0x4d9b53);}(_0xfe77,0x181));var _0x7fe7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe77[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x7fe7('0x0'));var events=[_0x7fe7('0x1'),_0x7fe7('0x2'),_0x7fe7('0x3')];function createListener(_0x18d74a,_0xc6ba38){return function(_0x545c4d){_0xc6ba38[_0x7fe7('0x4')](_0x18d74a,_0x545c4d);};}function removeListener(_0x224d96,_0x4919e7){return function(){WhatsappAccountEvents[_0x7fe7('0x5')](_0x224d96,_0x4919e7);};}exports[_0x7fe7('0x6')]=function(_0x1e0939){for(var _0x10b821=0x0,_0x59b9c9=events[_0x7fe7('0x7')];_0x10b821<_0x59b9c9;_0x10b821++){var _0x564c8c=events[_0x10b821];var _0x12b271=createListener('whatsappAccount:'+_0x564c8c,_0x1e0939);WhatsappAccountEvents['on'](_0x564c8c,_0x12b271);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 87ef091..7812f76 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 _0x4f54=['./whatsappApplication.controller','index','get','/:id','post','isAuthenticated','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1da017,_0x1600ef){var _0x13bb16=function(_0x2ab5a8){while(--_0x2ab5a8){_0x1da017['push'](_0x1da017['shift']());}};_0x13bb16(++_0x1600ef);}(_0x4f54,0x10e));var _0x44f5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4f54[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x44f5('0x0'));var util=require(_0x44f5('0x1'));var path=require(_0x44f5('0x2'));var timeout=require(_0x44f5('0x3'));var express=require(_0x44f5('0x4'));var router=express[_0x44f5('0x5')]();var fs_extra=require(_0x44f5('0x6'));var auth=require(_0x44f5('0x7'));var interaction=require(_0x44f5('0x8'));var config=require(_0x44f5('0x9'));var controller=require(_0x44f5('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x44f5('0xb')]);router[_0x44f5('0xc')](_0x44f5('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x44f5('0xe')]('/',auth[_0x44f5('0xf')](),controller['create']);router[_0x44f5('0x10')]('/:id',auth[_0x44f5('0xf')](),controller['update']);router[_0x44f5('0x11')](_0x44f5('0xd'),auth[_0x44f5('0xf')](),controller[_0x44f5('0x12')]);module[_0x44f5('0x13')]=router; \ No newline at end of file +var _0xd358=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete','destroy','multer'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd358,0xe9));var _0x8d35=function(_0x44982d,_0x270f5f){_0x44982d=_0x44982d-0x0;var _0x5ddc54=_0xd358[_0x44982d];return _0x5ddc54;};'use strict';var multer=require(_0x8d35('0x0'));var util=require('util');var path=require(_0x8d35('0x1'));var timeout=require(_0x8d35('0x2'));var express=require(_0x8d35('0x3'));var router=express['Router']();var fs_extra=require(_0x8d35('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8d35('0x5'));var config=require(_0x8d35('0x6'));var controller=require(_0x8d35('0x7'));router[_0x8d35('0x8')]('/',auth['isAuthenticated'](),controller[_0x8d35('0x9')]);router[_0x8d35('0x8')]('/:id',auth[_0x8d35('0xa')](),controller[_0x8d35('0xb')]);router[_0x8d35('0xc')]('/',auth[_0x8d35('0xa')](),controller[_0x8d35('0xd')]);router['put'](_0x8d35('0xe'),auth[_0x8d35('0xa')](),controller[_0x8d35('0xf')]);router[_0x8d35('0x10')](_0x8d35('0xe'),auth['isAuthenticated'](),controller[_0x8d35('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 7d6be85..407d814 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 _0xb82d=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x4faa06,_0x2cd369){var _0x5b808a=function(_0x244764){while(--_0x244764){_0x4faa06['push'](_0x4faa06['shift']());}};_0x5b808a(++_0x2cd369);}(_0xb82d,0xc8));var _0xdb82=function(_0x22149c,_0x13c8ab){_0x22149c=_0x22149c-0x0;var _0x15f67c=_0xb82d[_0x22149c];return _0x15f67c;};'use strict';var Sequelize=require(_0xdb82('0x0'));module['exports']={'priority':{'type':Sequelize[_0xdb82('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdb82('0x2')],'allowNull':![],'defaultValue':_0xdb82('0x3')},'appdata':{'type':Sequelize[_0xdb82('0x4')]()},'description':{'type':Sequelize[_0xdb82('0x2')]},'interval':{'type':Sequelize[_0xdb82('0x2')],'defaultValue':_0xdb82('0x5')}}; \ No newline at end of file +var _0x9f63=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9f63,0x148));var _0x39f6=function(_0x280f9d,_0x36fb8c){_0x280f9d=_0x280f9d-0x0;var _0x23dbfd=_0x9f63[_0x280f9d];return _0x23dbfd;};'use strict';var Sequelize=require(_0x39f6('0x0'));module[_0x39f6('0x1')]={'priority':{'type':Sequelize[_0x39f6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x39f6('0x3')],'allowNull':![],'defaultValue':_0x39f6('0x4')},'appdata':{'type':Sequelize[_0x39f6('0x5')]()},'description':{'type':Sequelize[_0x39f6('0x3')]},'interval':{'type':Sequelize[_0x39f6('0x3')],'defaultValue':_0x39f6('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index c05f7b6..f109c96 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 _0xe1d7=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','error','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order'];(function(_0x46116f,_0x1b23bf){var _0x52f627=function(_0x18b5ac){while(--_0x18b5ac){_0x46116f['push'](_0x46116f['shift']());}};_0x52f627(++_0x1b23bf);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x5e6116,_0x4bae08){_0x5e6116=_0x5e6116-0x0;var _0x29bf86=_0xe1d7[_0x5e6116];return _0x29bf86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e1d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e1d('0x1'));var BPromise=require(_0x7e1d('0x2'));var Mustache=require(_0x7e1d('0x3'));var util=require('util');var path=require(_0x7e1d('0x4'));var sox=require(_0x7e1d('0x5'));var csv=require(_0x7e1d('0x6'));var ejs=require(_0x7e1d('0x7'));var fs=require('fs');var fs_extra=require(_0x7e1d('0x8'));var _=require('lodash');var squel=require(_0x7e1d('0x9'));var crypto=require(_0x7e1d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7e1d('0xb'));var toCsv=require(_0x7e1d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7e1d('0xc'));var authService=require(_0x7e1d('0xd'));var qs=require(_0x7e1d('0xe'));var as=require(_0x7e1d('0xf'));var hardwareService=require(_0x7e1d('0x10'));var logger=require(_0x7e1d('0x11'))(_0x7e1d('0x12'));var utils=require('../../config/utils');var config=require(_0x7e1d('0x13'));var licenseUtil=require(_0x7e1d('0x14'));var db=require(_0x7e1d('0x15'))['db'];function respondWithStatusCode(_0x3a2fd3,_0x4af431){_0x4af431=_0x4af431||0xcc;return function(_0x4543ee){if(_0x4543ee){return _0x3a2fd3[_0x7e1d('0x16')](_0x4af431);}return _0x3a2fd3[_0x7e1d('0x17')](_0x4af431)['end']();};}function respondWithResult(_0x3c9812,_0x41746d){_0x41746d=_0x41746d||0xc8;return function(_0x5cafde){if(_0x5cafde){return _0x3c9812['status'](_0x41746d)[_0x7e1d('0x18')](_0x5cafde);}};}function respondWithFilteredResult(_0x3f4760,_0x1c8d51){return function(_0x55539a){if(_0x55539a){var _0x25f214=typeof _0x1c8d51[_0x7e1d('0x19')]==='undefined'&&typeof _0x1c8d51[_0x7e1d('0x1a')]===_0x7e1d('0x1b');var _0x3eb945=_0x55539a[_0x7e1d('0x1c')];var _0x5a9abe=_0x25f214?0x0:_0x1c8d51[_0x7e1d('0x19')];var _0x1b40ac=_0x25f214?_0x55539a[_0x7e1d('0x1c')]:_0x1c8d51[_0x7e1d('0x19')]+_0x1c8d51[_0x7e1d('0x1a')];var _0x3671d3;if(_0x1b40ac>=_0x3eb945){_0x1b40ac=_0x3eb945;_0x3671d3=0xc8;}else{_0x3671d3=0xce;}_0x3f4760[_0x7e1d('0x17')](_0x3671d3);return _0x3f4760['set'](_0x7e1d('0x1d'),_0x5a9abe+'-'+_0x1b40ac+'/'+_0x3eb945)[_0x7e1d('0x18')](_0x55539a);}return null;};}function patchUpdates(_0x1c2ab1){return function(_0x3d21ec){try{jsonpatch[_0x7e1d('0x1e')](_0x3d21ec,_0x1c2ab1,!![]);}catch(_0x5480fe){return BPromise['reject'](_0x5480fe);}return _0x3d21ec['save']();};}function saveUpdates(_0x383d28,_0x3dddc3){return function(_0x30229f){if(_0x30229f){return _0x30229f['update'](_0x383d28)[_0x7e1d('0x1f')](function(_0x56653f){return _0x56653f;});}return null;};}function removeEntity(_0xabef60,_0x1ae0b6){return function(_0xcc5980){if(_0xcc5980){return _0xcc5980[_0x7e1d('0x20')]()[_0x7e1d('0x1f')](function(){_0xabef60[_0x7e1d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fd926,_0x45473a){return function(_0x12ba7f){if(!_0x12ba7f){_0x1fd926[_0x7e1d('0x16')](0x194);}return _0x12ba7f;};}function handleError(_0x21fb23,_0x3ba80b){_0x3ba80b=_0x3ba80b||0x1f4;return function(_0x22569b){logger[_0x7e1d('0x21')](_0x22569b['stack']);if(_0x22569b[_0x7e1d('0x22')]){delete _0x22569b[_0x7e1d('0x22')];}_0x21fb23['status'](_0x3ba80b)[_0x7e1d('0x23')](_0x22569b);};}exports[_0x7e1d('0x24')]=function(_0x4ebce1,_0x1b5236){var _0x2f11f4={},_0x1b6ba2={},_0x430191={'count':0x0,'rows':[]};var _0x1a4c75=_[_0x7e1d('0x25')](db[_0x7e1d('0x26')][_0x7e1d('0x27')],function(_0x12ad82){return{'name':_0x12ad82[_0x7e1d('0x28')],'type':_0x12ad82['type'][_0x7e1d('0x29')]};});_0x1b6ba2[_0x7e1d('0x2a')]=_[_0x7e1d('0x25')](_0x1a4c75,_0x7e1d('0x22'));_0x1b6ba2[_0x7e1d('0x2b')]=_[_0x7e1d('0x2c')](_0x4ebce1[_0x7e1d('0x2b')]);_0x1b6ba2[_0x7e1d('0x2d')]=_[_0x7e1d('0x2e')](_0x1b6ba2['model'],_0x1b6ba2['query']);_0x2f11f4[_0x7e1d('0x2f')]=_[_0x7e1d('0x2e')](_0x1b6ba2[_0x7e1d('0x2a')],qs[_0x7e1d('0x30')](_0x4ebce1['query'][_0x7e1d('0x30')]));_0x2f11f4['attributes']=_0x2f11f4[_0x7e1d('0x2f')]['length']?_0x2f11f4[_0x7e1d('0x2f')]:_0x1b6ba2[_0x7e1d('0x2a')];if(!_0x4ebce1[_0x7e1d('0x2b')]['hasOwnProperty'](_0x7e1d('0x31'))){_0x2f11f4[_0x7e1d('0x1a')]=qs['limit'](_0x4ebce1['query']['limit']);_0x2f11f4[_0x7e1d('0x19')]=qs[_0x7e1d('0x19')](_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x19')]);}_0x2f11f4[_0x7e1d('0x32')]=qs['sort'](_0x4ebce1['query'][_0x7e1d('0x33')]);_0x2f11f4[_0x7e1d('0x34')]=qs['filters'](_[_0x7e1d('0x35')](_0x4ebce1[_0x7e1d('0x2b')],_0x1b6ba2[_0x7e1d('0x2d')]),_0x1a4c75);if(_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x36')]){_0x2f11f4['where']=_[_0x7e1d('0x37')](_0x2f11f4['where'],{'$or':_[_0x7e1d('0x25')](_0x1a4c75,function(_0x31f7ee){if(_0x31f7ee['type']!==_0x7e1d('0x38')){var _0x48e996={};_0x48e996[_0x31f7ee[_0x7e1d('0x22')]]={'$like':'%'+_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x36')]+'%'};return _0x48e996;}})});}_0x2f11f4=_[_0x7e1d('0x37')]({},_0x2f11f4,_0x4ebce1[_0x7e1d('0x39')]);var _0x226a10={'where':_0x2f11f4[_0x7e1d('0x34')]};return db['WhatsappApplication'][_0x7e1d('0x1c')](_0x226a10)[_0x7e1d('0x1f')](function(_0x2aeca9){_0x430191[_0x7e1d('0x1c')]=_0x2aeca9;if(_0x4ebce1[_0x7e1d('0x2b')][_0x7e1d('0x3a')]){_0x2f11f4[_0x7e1d('0x3b')]=[{'all':!![]}];}return db[_0x7e1d('0x26')][_0x7e1d('0x3c')](_0x2f11f4);})[_0x7e1d('0x1f')](function(_0x5dd3f6){_0x430191[_0x7e1d('0x3d')]=_0x5dd3f6;return _0x430191;})[_0x7e1d('0x1f')](respondWithFilteredResult(_0x1b5236,_0x2f11f4))[_0x7e1d('0x3e')](handleError(_0x1b5236,null));};exports[_0x7e1d('0x3f')]=function(_0x189302,_0x224081){var _0x27e64a={'raw':!![],'where':{'id':_0x189302['params']['id']}},_0x5959={};_0x5959[_0x7e1d('0x2a')]=_[_0x7e1d('0x2c')](db[_0x7e1d('0x26')][_0x7e1d('0x27')]);_0x5959[_0x7e1d('0x2b')]=_['keys'](_0x189302[_0x7e1d('0x2b')]);_0x5959[_0x7e1d('0x2d')]=_[_0x7e1d('0x2e')](_0x5959['model'],_0x5959['query']);_0x27e64a[_0x7e1d('0x2f')]=_['intersection'](_0x5959[_0x7e1d('0x2a')],qs[_0x7e1d('0x30')](_0x189302['query'][_0x7e1d('0x30')]));_0x27e64a[_0x7e1d('0x2f')]=_0x27e64a[_0x7e1d('0x2f')]['length']?_0x27e64a[_0x7e1d('0x2f')]:_0x5959['model'];if(_0x189302[_0x7e1d('0x2b')][_0x7e1d('0x3a')]){_0x27e64a[_0x7e1d('0x3b')]=[{'all':!![]}];}_0x27e64a=_[_0x7e1d('0x37')]({},_0x27e64a,_0x189302[_0x7e1d('0x39')]);return db['WhatsappApplication'][_0x7e1d('0x40')](_0x27e64a)[_0x7e1d('0x1f')](handleEntityNotFound(_0x224081,null))['then'](respondWithResult(_0x224081,null))[_0x7e1d('0x3e')](handleError(_0x224081,null));};exports[_0x7e1d('0x41')]=function(_0x1a68ac,_0x47d273){return db['WhatsappApplication'][_0x7e1d('0x41')](_0x1a68ac[_0x7e1d('0x42')],{})[_0x7e1d('0x1f')](respondWithResult(_0x47d273,0xc9))[_0x7e1d('0x3e')](handleError(_0x47d273,null));};exports['update']=function(_0x395b11,_0x2a107a){if(_0x395b11[_0x7e1d('0x42')]['id']){delete _0x395b11['body']['id'];}return db[_0x7e1d('0x26')][_0x7e1d('0x40')]({'where':{'id':_0x395b11['params']['id']}})[_0x7e1d('0x1f')](handleEntityNotFound(_0x2a107a,null))[_0x7e1d('0x1f')](saveUpdates(_0x395b11[_0x7e1d('0x42')],null))[_0x7e1d('0x1f')](respondWithResult(_0x2a107a,null))['catch'](handleError(_0x2a107a,null));};exports['destroy']=function(_0x4178fa,_0x1db7e8){return db[_0x7e1d('0x26')]['find']({'where':{'id':_0x4178fa[_0x7e1d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1db7e8,null))['then'](removeEntity(_0x1db7e8,null))[_0x7e1d('0x3e')](handleError(_0x1db7e8,null));}; \ No newline at end of file +var _0x72a1=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','rawAttributes','length','options','catch','create','body','update','find','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','WhatsappApplication','type','key','query','keys','filters','intersection','model'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x72a1,0x1ce));var _0x172a=function(_0x18c1a1,_0x303f45){_0x18c1a1=_0x18c1a1-0x0;var _0x483939=_0x72a1[_0x18c1a1];return _0x483939;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x172a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x172a('0x1'));var rp=require('request-promise');var moment=require(_0x172a('0x2'));var BPromise=require(_0x172a('0x3'));var Mustache=require(_0x172a('0x4'));var util=require('util');var path=require(_0x172a('0x5'));var sox=require('sox');var csv=require(_0x172a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x172a('0x7'));var _=require('lodash');var squel=require(_0x172a('0x8'));var crypto=require(_0x172a('0x9'));var jsforce=require(_0x172a('0xa'));var deskjs=require(_0x172a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x172a('0xc'));var Papa=require('papaparse');var Redis=require(_0x172a('0xd'));var authService=require(_0x172a('0xe'));var qs=require(_0x172a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x172a('0x10'));var logger=require(_0x172a('0x11'))(_0x172a('0x12'));var utils=require(_0x172a('0x13'));var config=require(_0x172a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x172a('0x15'))['db'];function respondWithStatusCode(_0x3e3a6f,_0x3936f9){_0x3936f9=_0x3936f9||0xcc;return function(_0x901ebc){if(_0x901ebc){return _0x3e3a6f['sendStatus'](_0x3936f9);}return _0x3e3a6f[_0x172a('0x16')](_0x3936f9)[_0x172a('0x17')]();};}function respondWithResult(_0xbea95b,_0x4fa511){_0x4fa511=_0x4fa511||0xc8;return function(_0x27c548){if(_0x27c548){return _0xbea95b[_0x172a('0x16')](_0x4fa511)[_0x172a('0x18')](_0x27c548);}};}function respondWithFilteredResult(_0x32f7a8,_0x5775f9){return function(_0x44661f){if(_0x44661f){var _0x100d2b=typeof _0x5775f9['offset']===_0x172a('0x19')&&typeof _0x5775f9['limit']===_0x172a('0x19');var _0x3cd44f=_0x44661f[_0x172a('0x1a')];var _0x5ad6ec=_0x100d2b?0x0:_0x5775f9[_0x172a('0x1b')];var _0x232c5b=_0x100d2b?_0x44661f[_0x172a('0x1a')]:_0x5775f9[_0x172a('0x1b')]+_0x5775f9[_0x172a('0x1c')];var _0x222584;if(_0x232c5b>=_0x3cd44f){_0x232c5b=_0x3cd44f;_0x222584=0xc8;}else{_0x222584=0xce;}_0x32f7a8[_0x172a('0x16')](_0x222584);return _0x32f7a8[_0x172a('0x1d')]('Content-Range',_0x5ad6ec+'-'+_0x232c5b+'/'+_0x3cd44f)['json'](_0x44661f);}return null;};}function patchUpdates(_0xc3cad1){return function(_0x1267d7){try{jsonpatch[_0x172a('0x1e')](_0x1267d7,_0xc3cad1,!![]);}catch(_0x406dd8){return BPromise[_0x172a('0x1f')](_0x406dd8);}return _0x1267d7[_0x172a('0x20')]();};}function saveUpdates(_0x33b9d3,_0x12fd12){return function(_0x47cbfd){if(_0x47cbfd){return _0x47cbfd['update'](_0x33b9d3)[_0x172a('0x21')](function(_0xb44494){return _0xb44494;});}return null;};}function removeEntity(_0x37e48e,_0x3fb66d){return function(_0x5a9beb){if(_0x5a9beb){return _0x5a9beb['destroy']()[_0x172a('0x21')](function(){_0x37e48e[_0x172a('0x16')](0xcc)[_0x172a('0x17')]();});}};}function handleEntityNotFound(_0x52a9df,_0x5cbc26){return function(_0x526636){if(!_0x526636){_0x52a9df[_0x172a('0x22')](0x194);}return _0x526636;};}function handleError(_0x26cfa6,_0x472903){_0x472903=_0x472903||0x1f4;return function(_0x250bad){logger[_0x172a('0x23')](_0x250bad[_0x172a('0x24')]);if(_0x250bad[_0x172a('0x25')]){delete _0x250bad[_0x172a('0x25')];}_0x26cfa6[_0x172a('0x16')](_0x472903)[_0x172a('0x26')](_0x250bad);};}exports[_0x172a('0x27')]=function(_0x3b13bf,_0x44fe40){var _0x3d5e7b={},_0x5c8699={},_0x1254d8={'count':0x0,'rows':[]};var _0x288905=_[_0x172a('0x28')](db[_0x172a('0x29')]['rawAttributes'],function(_0x5b61be){return{'name':_0x5b61be['fieldName'],'type':_0x5b61be[_0x172a('0x2a')][_0x172a('0x2b')]};});_0x5c8699['model']=_['map'](_0x288905,_0x172a('0x25'));_0x5c8699[_0x172a('0x2c')]=_[_0x172a('0x2d')](_0x3b13bf[_0x172a('0x2c')]);_0x5c8699[_0x172a('0x2e')]=_[_0x172a('0x2f')](_0x5c8699[_0x172a('0x30')],_0x5c8699[_0x172a('0x2c')]);_0x3d5e7b[_0x172a('0x31')]=_[_0x172a('0x2f')](_0x5c8699[_0x172a('0x30')],qs[_0x172a('0x32')](_0x3b13bf[_0x172a('0x2c')][_0x172a('0x32')]));_0x3d5e7b[_0x172a('0x31')]=_0x3d5e7b[_0x172a('0x31')]['length']?_0x3d5e7b['attributes']:_0x5c8699[_0x172a('0x30')];if(!_0x3b13bf[_0x172a('0x2c')][_0x172a('0x33')](_0x172a('0x34'))){_0x3d5e7b['limit']=qs[_0x172a('0x1c')](_0x3b13bf[_0x172a('0x2c')][_0x172a('0x1c')]);_0x3d5e7b['offset']=qs['offset'](_0x3b13bf['query'][_0x172a('0x1b')]);}_0x3d5e7b[_0x172a('0x35')]=qs[_0x172a('0x36')](_0x3b13bf['query'][_0x172a('0x36')]);_0x3d5e7b[_0x172a('0x37')]=qs['filters'](_[_0x172a('0x38')](_0x3b13bf[_0x172a('0x2c')],_0x5c8699[_0x172a('0x2e')]),_0x288905);if(_0x3b13bf[_0x172a('0x2c')][_0x172a('0x39')]){_0x3d5e7b['where']=_[_0x172a('0x3a')](_0x3d5e7b['where'],{'$or':_[_0x172a('0x28')](_0x288905,function(_0x1ba3a5){if(_0x1ba3a5[_0x172a('0x2a')]!==_0x172a('0x3b')){var _0x3f7548={};_0x3f7548[_0x1ba3a5[_0x172a('0x25')]]={'$like':'%'+_0x3b13bf[_0x172a('0x2c')][_0x172a('0x39')]+'%'};return _0x3f7548;}})});}_0x3d5e7b=_[_0x172a('0x3a')]({},_0x3d5e7b,_0x3b13bf['options']);var _0x299871={'where':_0x3d5e7b[_0x172a('0x37')]};return db[_0x172a('0x29')][_0x172a('0x1a')](_0x299871)[_0x172a('0x21')](function(_0x3c3463){_0x1254d8[_0x172a('0x1a')]=_0x3c3463;if(_0x3b13bf[_0x172a('0x2c')][_0x172a('0x3c')]){_0x3d5e7b['include']=[{'all':!![]}];}return db[_0x172a('0x29')][_0x172a('0x3d')](_0x3d5e7b);})['then'](function(_0x7fdf7d){_0x1254d8['rows']=_0x7fdf7d;return _0x1254d8;})['then'](respondWithFilteredResult(_0x44fe40,_0x3d5e7b))['catch'](handleError(_0x44fe40,null));};exports[_0x172a('0x3e')]=function(_0x5d6441,_0x5be8f4){var _0x5cbabd={'raw':!![],'where':{'id':_0x5d6441[_0x172a('0x3f')]['id']}},_0x14b060={};_0x14b060[_0x172a('0x30')]=_['keys'](db[_0x172a('0x29')][_0x172a('0x40')]);_0x14b060[_0x172a('0x2c')]=_[_0x172a('0x2d')](_0x5d6441['query']);_0x14b060[_0x172a('0x2e')]=_[_0x172a('0x2f')](_0x14b060[_0x172a('0x30')],_0x14b060['query']);_0x5cbabd[_0x172a('0x31')]=_[_0x172a('0x2f')](_0x14b060[_0x172a('0x30')],qs[_0x172a('0x32')](_0x5d6441[_0x172a('0x2c')][_0x172a('0x32')]));_0x5cbabd[_0x172a('0x31')]=_0x5cbabd[_0x172a('0x31')][_0x172a('0x41')]?_0x5cbabd[_0x172a('0x31')]:_0x14b060[_0x172a('0x30')];if(_0x5d6441[_0x172a('0x2c')][_0x172a('0x3c')]){_0x5cbabd['include']=[{'all':!![]}];}_0x5cbabd=_[_0x172a('0x3a')]({},_0x5cbabd,_0x5d6441[_0x172a('0x42')]);return db[_0x172a('0x29')]['find'](_0x5cbabd)[_0x172a('0x21')](handleEntityNotFound(_0x5be8f4,null))['then'](respondWithResult(_0x5be8f4,null))[_0x172a('0x43')](handleError(_0x5be8f4,null));};exports[_0x172a('0x44')]=function(_0x6b3454,_0x2ab91e){return db[_0x172a('0x29')][_0x172a('0x44')](_0x6b3454[_0x172a('0x45')],{})['then'](respondWithResult(_0x2ab91e,0xc9))[_0x172a('0x43')](handleError(_0x2ab91e,null));};exports[_0x172a('0x46')]=function(_0x3394f9,_0x52fa39){if(_0x3394f9[_0x172a('0x45')]['id']){delete _0x3394f9[_0x172a('0x45')]['id'];}return db['WhatsappApplication'][_0x172a('0x47')]({'where':{'id':_0x3394f9[_0x172a('0x3f')]['id']}})[_0x172a('0x21')](handleEntityNotFound(_0x52fa39,null))[_0x172a('0x21')](saveUpdates(_0x3394f9[_0x172a('0x45')],null))['then'](respondWithResult(_0x52fa39,null))[_0x172a('0x43')](handleError(_0x52fa39,null));};exports[_0x172a('0x48')]=function(_0x18543e,_0x173eaf){return db[_0x172a('0x29')]['find']({'where':{'id':_0x18543e[_0x172a('0x3f')]['id']}})[_0x172a('0x21')](handleEntityNotFound(_0x173eaf,null))[_0x172a('0x21')](removeEntity(_0x173eaf,null))[_0x172a('0x43')](handleError(_0x173eaf,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 04272f1..7b32d6a 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 _0xed95=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0xed95,0xb9));var _0x5ed9=function(_0x18f201,_0x553c59){_0x18f201=_0x18f201-0x0;var _0x32e61d=_0xed95[_0x18f201];return _0x32e61d;};'use strict';var _=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var logger=require(_0x5ed9('0x2'))(_0x5ed9('0x3'));var moment=require(_0x5ed9('0x4'));var BPromise=require(_0x5ed9('0x5'));var rp=require(_0x5ed9('0x6'));var fs=require('fs');var path=require(_0x5ed9('0x7'));var rimraf=require(_0x5ed9('0x8'));var config=require(_0x5ed9('0x9'));var attributes=require(_0x5ed9('0xa'));module[_0x5ed9('0xb')]=function(_0x52a57d,_0x48efa8){return _0x52a57d[_0x5ed9('0xc')](_0x5ed9('0xd'),attributes,{'tableName':_0x5ed9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ed9('0xf'),'collate':_0x5ed9('0x10')});}; \ No newline at end of file +var _0xff96=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x57671f,_0x4da2b2){var _0x1f80c4=function(_0x168cd0){while(--_0x168cd0){_0x57671f['push'](_0x57671f['shift']());}};_0x1f80c4(++_0x4da2b2);}(_0xff96,0x179));var _0x6ff9=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0xff96[_0x402c8f];return _0x11e809;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var logger=require(_0x6ff9('0x2'))(_0x6ff9('0x3'));var moment=require(_0x6ff9('0x4'));var BPromise=require(_0x6ff9('0x5'));var rp=require(_0x6ff9('0x6'));var fs=require('fs');var path=require(_0x6ff9('0x7'));var rimraf=require(_0x6ff9('0x8'));var config=require(_0x6ff9('0x9'));var attributes=require(_0x6ff9('0xa'));module[_0x6ff9('0xb')]=function(_0x4adb77,_0x3efaff){return _0x4adb77['define']('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ff9('0xc'),'collate':_0x6ff9('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 2f067d9..bc32458 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','WhatsappApplication,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x567df6,_0x2f9650){var _0x107c10=function(_0x582502){while(--_0x582502){_0x567df6['push'](_0x567df6['shift']());}};_0x107c10(++_0x2f9650);}(_0x3e74,0x175));var _0x43e7=function(_0xe54437,_0x32a556){_0xe54437=_0xe54437-0x0;var _0x4251f2=_0x3e74[_0xe54437];return _0x4251f2;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x491192,_0x43417b){var _0x24a1e1=function(_0x3a833f){while(--_0x3a833f){_0x491192['push'](_0x491192['shift']());}};_0x24a1e1(++_0x43417b);}(_0xe14d,0x1ee));var _0xde14=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xe14d[_0x411add];return _0x238242;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 20997ad..c722ab2 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 _0x0689=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags'];(function(_0x10e5b6,_0x532f06){var _0x15d153=function(_0x33a2c0){while(--_0x33a2c0){_0x10e5b6['push'](_0x10e5b6['shift']());}};_0x15d153(++_0x532f06);}(_0x0689,0x161));var _0x9068=function(_0x5103a4,_0x4b7f5c){_0x5103a4=_0x5103a4-0x0;var _0x4f99e0=_0x0689[_0x5103a4];return _0x4f99e0;};'use strict';var multer=require('multer');var util=require(_0x9068('0x0'));var path=require('path');var timeout=require(_0x9068('0x1'));var express=require(_0x9068('0x2'));var router=express[_0x9068('0x3')]();var fs_extra=require(_0x9068('0x4'));var auth=require(_0x9068('0x5'));var interaction=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var controller=require(_0x9068('0x8'));router[_0x9068('0x9')]('/',auth[_0x9068('0xa')](),controller['index']);router[_0x9068('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9068('0xb')]);router[_0x9068('0x9')](_0x9068('0xc'),auth[_0x9068('0xa')](),controller[_0x9068('0xd')]);router[_0x9068('0x9')](_0x9068('0xe'),auth[_0x9068('0xa')](),controller[_0x9068('0xf')]);router['get'](_0x9068('0x10'),auth[_0x9068('0xa')](),controller[_0x9068('0x11')]);router[_0x9068('0x12')]('/',auth['isAuthenticated'](),controller[_0x9068('0x13')]);router[_0x9068('0x12')](_0x9068('0xe'),auth['isAuthenticated'](),controller[_0x9068('0x14')]);router[_0x9068('0x12')](_0x9068('0x15'),auth['isAuthenticated'](),interaction[_0x9068('0x16')](_0x9068('0x17'),'whatsappinteraction:addtags'),controller[_0x9068('0x18')]);router[_0x9068('0x19')]('/:id',auth[_0x9068('0xa')](),interaction[_0x9068('0x16')](_0x9068('0x17'),_0x9068('0x1a')),controller['update']);router[_0x9068('0x1b')](_0x9068('0xc'),auth[_0x9068('0xa')](),interaction[_0x9068('0x16')](_0x9068('0x17'),_0x9068('0x1c')),controller[_0x9068('0x1d')]);router[_0x9068('0x1b')](_0x9068('0x15'),auth['isAuthenticated'](),controller[_0x9068('0x1e')]);module[_0x9068('0x1f')]=router; \ No newline at end of file +var _0x9f5a=['getMessages','download','post','create','addMessage','/:id/tags','addTags','tracked','whatsapp','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/messages'];(function(_0x32ec80,_0x6ac6b){var _0x3e5459=function(_0x1ec5c7){while(--_0x1ec5c7){_0x32ec80['push'](_0x32ec80['shift']());}};_0x3e5459(++_0x6ac6b);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x4d7059,_0x2975ca){_0x4d7059=_0x4d7059-0x0;var _0x580bac=_0x9f5a[_0x4d7059];return _0x580bac;};'use strict';var multer=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var path=require(_0xa9f5('0x2'));var timeout=require(_0xa9f5('0x3'));var express=require('express');var router=express[_0xa9f5('0x4')]();var fs_extra=require(_0xa9f5('0x5'));var auth=require(_0xa9f5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa9f5('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xa9f5('0x8')]('/',auth[_0xa9f5('0x9')](),controller['index']);router[_0xa9f5('0x8')](_0xa9f5('0xa'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0xb')]);router[_0xa9f5('0x8')](_0xa9f5('0xc'),auth[_0xa9f5('0x9')](),controller['show']);router[_0xa9f5('0x8')](_0xa9f5('0xd'),auth['isAuthenticated'](),controller[_0xa9f5('0xe')]);router[_0xa9f5('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xa9f5('0xf')]);router[_0xa9f5('0x10')]('/',auth[_0xa9f5('0x9')](),controller[_0xa9f5('0x11')]);router['post'](_0xa9f5('0xd'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0x12')]);router['post'](_0xa9f5('0x13'),auth[_0xa9f5('0x9')](),interaction['tracked']('whatsapp','whatsappinteraction:addtags'),controller[_0xa9f5('0x14')]);router['put']('/:id',auth[_0xa9f5('0x9')](),interaction[_0xa9f5('0x15')](_0xa9f5('0x16'),_0xa9f5('0x17')),controller['update']);router[_0xa9f5('0x18')](_0xa9f5('0xc'),auth[_0xa9f5('0x9')](),interaction[_0xa9f5('0x15')](_0xa9f5('0x16'),_0xa9f5('0x19')),controller[_0xa9f5('0x1a')]);router[_0xa9f5('0x18')](_0xa9f5('0x13'),auth[_0xa9f5('0x9')](),controller[_0xa9f5('0x1b')]);module[_0xa9f5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9425658..b8b9ac5 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 _0x806b=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x5a19b9,_0x3bc9af){var _0x56abbc=function(_0x1f6643){while(--_0x1f6643){_0x5a19b9['push'](_0x5a19b9['shift']());}};_0x56abbc(++_0x3bc9af);}(_0x806b,0x163));var _0xb806=function(_0x2ff8ee,_0x5c0f64){_0x2ff8ee=_0x2ff8ee-0x0;var _0x1fd634=_0x806b[_0x2ff8ee];return _0x1fd634;};'use strict';var Sequelize=require(_0xb806('0x0'));var moment=require(_0xb806('0x1'));module[_0xb806('0x2')]={'closed':{'type':Sequelize[_0xb806('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb806('0x4')]},'disposition':{'type':Sequelize[_0xb806('0x5')]},'secondDisposition':{'type':Sequelize[_0xb806('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb806('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb806('0x5')]},'read1stAt':{'type':Sequelize[_0xb806('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb806('0x6')]('in',_0xb806('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb806('0x6')]('in',_0xb806('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xdded=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0xe323e3,_0x110473){var _0x208a43=function(_0x18695c){while(--_0x18695c){_0xe323e3['push'](_0xe323e3['shift']());}};_0x208a43(++_0x110473);}(_0xdded,0x17a));var _0xddde=function(_0x15bb9d,_0x3f2f1e){_0x15bb9d=_0x15bb9d-0x0;var _0x458f0b=_0xdded[_0x15bb9d];return _0x458f0b;};'use strict';var Sequelize=require(_0xddde('0x0'));var moment=require(_0xddde('0x1'));module[_0xddde('0x2')]={'closed':{'type':Sequelize[_0xddde('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xddde('0x4')]},'disposition':{'type':Sequelize[_0xddde('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xddde('0x5')]},'note':{'type':Sequelize[_0xddde('0x5')]},'phone':{'type':Sequelize[_0xddde('0x5')]},'read1stAt':{'type':Sequelize[_0xddde('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xddde('0x6')]('in',_0xddde('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xddde('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xddde('0x6')]('in',_0xddde('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xddde('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 cec13f2..7e53e96 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 _0x9879=['c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','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)','getFullTextValue','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','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','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','params','includeAll','options','create','catch','update','destroy','describe','WhatsappMessage','addMessage','ids','omit','nolimit','format','findAll','rows','addTags','setTags','spread','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','lastName','Attachment','direction','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','createWriteStream','basename','out','System','secret','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','then','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','sort','where','pick','filters','select','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','u.id\x20=\x20ui.UserId','left_join'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x9879,0x98));var _0x9987=function(_0x3feb80,_0x3dea4f){_0x3feb80=_0x3feb80-0x0;var _0x3f7ec7=_0x9879[_0x3feb80];return _0x3f7ec7;};'use strict';var emlformat=require(_0x9987('0x0'));var rimraf=require(_0x9987('0x1'));var zipdir=require(_0x9987('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9987('0x3'));var moment=require('moment');var BPromise=require(_0x9987('0x4'));var Mustache=require(_0x9987('0x5'));var util=require(_0x9987('0x6'));var path=require(_0x9987('0x7'));var sox=require(_0x9987('0x8'));var csv=require(_0x9987('0x9'));var ejs=require(_0x9987('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9987('0xb'));var squel=require('squel');var crypto=require(_0x9987('0xc'));var jsforce=require(_0x9987('0xd'));var deskjs=require(_0x9987('0xe'));var toCsv=require(_0x9987('0x9'));var querystring=require(_0x9987('0xf'));var Papa=require(_0x9987('0x10'));var Redis=require(_0x9987('0x11'));var authService=require(_0x9987('0x12'));var qs=require(_0x9987('0x13'));var as=require(_0x9987('0x14'));var pdf=require(_0x9987('0x15'));var hardwareService=require(_0x9987('0x16'));var logger=require(_0x9987('0x17'))(_0x9987('0x18'));var utils=require(_0x9987('0x19'));var config=require(_0x9987('0x1a'));var licenseUtil=require(_0x9987('0x1b'));var db=require(_0x9987('0x1c'))['db'];config['redis']=_[_0x9987('0x1d')](config[_0x9987('0x1e')],{'host':_0x9987('0x1f'),'port':0x18eb});var socket=require(_0x9987('0x20'))(new Redis(config[_0x9987('0x1e')]));require('./whatsappInteraction.socket')[_0x9987('0x21')](socket);function respondWithStatusCode(_0x4a4b61,_0x29a899){_0x29a899=_0x29a899||0xcc;return function(_0x467ed2){if(_0x467ed2){return _0x4a4b61[_0x9987('0x22')](_0x29a899);}return _0x4a4b61[_0x9987('0x23')](_0x29a899)[_0x9987('0x24')]();};}function respondWithResult(_0x414375,_0x11a64f){_0x11a64f=_0x11a64f||0xc8;return function(_0x3eefd0){if(_0x3eefd0){return _0x414375[_0x9987('0x23')](_0x11a64f)[_0x9987('0x25')](_0x3eefd0);}};}function respondWithFilteredResult(_0x390ff8,_0x3dfb48){return function(_0x46a28f){if(_0x46a28f){var _0x4f7360=typeof _0x3dfb48['offset']===_0x9987('0x26')&&typeof _0x3dfb48[_0x9987('0x27')]===_0x9987('0x26');var _0x446fb2=_0x46a28f['count'];var _0x217e1e=_0x4f7360?0x0:_0x3dfb48[_0x9987('0x28')];var _0x43379d=_0x4f7360?_0x46a28f[_0x9987('0x29')]:_0x3dfb48['offset']+_0x3dfb48['limit'];var _0x4e1356;if(_0x43379d>=_0x446fb2){_0x43379d=_0x446fb2;_0x4e1356=0xc8;}else{_0x4e1356=0xce;}_0x390ff8[_0x9987('0x23')](_0x4e1356);return _0x390ff8[_0x9987('0x2a')]('Content-Range',_0x217e1e+'-'+_0x43379d+'/'+_0x446fb2)[_0x9987('0x25')](_0x46a28f);}return null;};}function patchUpdates(_0x539f27){return function(_0x3b8fc8){try{jsonpatch[_0x9987('0x2b')](_0x3b8fc8,_0x539f27,!![]);}catch(_0x194d1a){return BPromise[_0x9987('0x2c')](_0x194d1a);}return _0x3b8fc8[_0x9987('0x2d')]();};}function saveUpdates(_0x2c867c,_0x384262){return function(_0x4c8b95){if(_0x4c8b95){return _0x4c8b95['update'](_0x2c867c)[_0x9987('0x2e')](function(_0x4094f2){return _0x4094f2;});}return null;};}function removeEntity(_0x1a79ab,_0x468ae1){return function(_0x230402){if(_0x230402){return _0x230402['destroy']()[_0x9987('0x2e')](function(){_0x1a79ab[_0x9987('0x23')](0xcc)[_0x9987('0x24')]();});}};}function handleEntityNotFound(_0x384ad,_0xa77fba){return function(_0x56e0a8){if(!_0x56e0a8){_0x384ad[_0x9987('0x22')](0x194);}return _0x56e0a8;};}function handleError(_0x528276,_0x5ce1d6){_0x5ce1d6=_0x5ce1d6||0x1f4;return function(_0x2c6b11){logger['error'](_0x2c6b11[_0x9987('0x2f')]);if(_0x2c6b11[_0x9987('0x30')]){delete _0x2c6b11[_0x9987('0x30')];}_0x528276['status'](_0x5ce1d6)['send'](_0x2c6b11);};}function getInteractionUsers(_0x5165b9,_0x506ab2){return new BPromise(function(_0x164fc6,_0xf09b1a){try{if(_0x506ab2[_0x5165b9['id']]){_0x5165b9[_0x9987('0x31')]=_[_0x9987('0x32')](_0x506ab2[_0x5165b9['id']],function(_0x96ccb){return{'id':_0x96ccb['id'],'fullname':_0x96ccb[_0x9987('0x33')]};});}}catch(_0x50915e){_0xf09b1a(_0x50915e);}_0x164fc6(_0x5165b9);});}function getInteractionTags(_0x22a28e,_0x312faa){return new BPromise(function(_0x590dfc,_0xfe9795){try{if(_0x22a28e[_0x9987('0x34')]){_0x22a28e[_0x9987('0x35')]=[];_0x22a28e[_0x9987('0x34')][_0x9987('0x36')](',')[_0x9987('0x37')](function(_0x314510){_0x22a28e[_0x9987('0x35')][_0x9987('0x38')](_0x312faa[_0x314510]);});}delete _0x22a28e[_0x9987('0x34')];}catch(_0x3a044d){_0xfe9795(_0x3a044d);}_0x590dfc(_0x22a28e);});}function updateWhatsappInteraction(_0x2b854f,_0x55496f,_0x3c38c8){return new BPromise(function(_0x4e6416,_0x4948fc){return getInteractionUsers(_0x2b854f,_0x3c38c8)['then'](function(_0x4f04e0){return getInteractionTags(_0x4f04e0,_0x55496f);})[_0x9987('0x2e')](function(_0x3074af){_0x4e6416(_0x3074af);})['catch'](function(_0x4910be){_0x4948fc(_0x4910be);});});}exports['index']=function(_0x49c461,_0x4a162f){var _0x3e7476={},_0x357d6c={},_0xc35e5e={'count':0x0,'rows':[]};var _0x19aa56=_[_0x9987('0x32')](db[_0x9987('0x39')][_0x9987('0x3a')],function(_0x2bcdd0){return{'name':_0x2bcdd0[_0x9987('0x3b')],'type':_0x2bcdd0[_0x9987('0x3c')][_0x9987('0x3d')]};});_0x357d6c[_0x9987('0x3e')]=_['map'](_0x19aa56,'name');_0x357d6c['query']=_[_0x9987('0x3f')](_0x49c461[_0x9987('0x40')]);_0x357d6c['filters']=_[_0x9987('0x41')](_0x357d6c[_0x9987('0x3e')],_0x357d6c['query']);_0x3e7476[_0x9987('0x42')]=_[_0x9987('0x41')](_0x357d6c[_0x9987('0x3e')],qs['fields'](_0x49c461[_0x9987('0x40')]['fields']));_0x3e7476[_0x9987('0x42')]=_0x3e7476[_0x9987('0x42')][_0x9987('0x43')]?_0x3e7476['attributes']:_0x357d6c[_0x9987('0x3e')];if(!_0x49c461['query'][_0x9987('0x44')]('nolimit')){_0x3e7476[_0x9987('0x27')]=qs[_0x9987('0x27')](_0x49c461[_0x9987('0x40')][_0x9987('0x27')]);_0x3e7476[_0x9987('0x28')]=qs[_0x9987('0x28')](_0x49c461[_0x9987('0x40')][_0x9987('0x28')]);}_0x3e7476['order']=qs[_0x9987('0x45')](_0x49c461[_0x9987('0x40')][_0x9987('0x45')]);_0x3e7476[_0x9987('0x46')]=qs['filters'](_[_0x9987('0x47')](_0x49c461[_0x9987('0x40')],_0x357d6c[_0x9987('0x48')]),_0x19aa56);var _0x44ccfa=[];var _0x1edf6b=squel[_0x9987('0x49')]()[_0x9987('0x4a')]('id')[_0x9987('0x4a')]('name')[_0x9987('0x4a')](_0x9987('0x4b'))[_0x9987('0x4c')](_0x9987('0x4d'));var _0x109a00=squel[_0x9987('0x49')]()[_0x9987('0x4a')]('u.id')[_0x9987('0x4a')](_0x9987('0x4e'))[_0x9987('0x4a')](_0x9987('0x4f'))[_0x9987('0x4c')]('user_has_whatsapp_interactions','ui')['left_join']('users','u',_0x9987('0x50'));var _0x34b82c=squel[_0x9987('0x49')]()['from']('whatsapp_interactions','i')[_0x9987('0x51')]('cm_contacts','c',_0x9987('0x52'))['left_join'](_0x9987('0x53'),'o','o.id\x20=\x20i.UserId')[_0x9987('0x51')](_0x9987('0x54'),'a',_0x9987('0x55'))['left_join']('whatsapp_messages','me',_0x9987('0x56'))['left_join'](_0x9987('0x57'),'it',_0x9987('0x58'))[_0x9987('0x51')]('tools_tags','t',_0x9987('0x59'));var _0xd9a59c=squel['expr']();var _0x3799d5=[];var _0x38d594=squel[_0x9987('0x5a')]();var _0x2a9e64;if(_0x49c461[_0x9987('0x40')][_0x9987('0x5b')]){_0x2a9e64=as[_0x9987('0x5c')](_0x49c461['query'][_0x9987('0x5b')]);var _0x24ac6f=_0x2a9e64[_0x9987('0x5d')];for(var _0x11bd0e=0x0;_0x11bd0e<_0x2a9e64[_0x9987('0x5e')]['length'];_0x11bd0e++){var _0x4a7f1d=_0x2a9e64[_0x9987('0x5e')][_0x11bd0e];var _0x32013b='i';var _0x44344f=_[_0x9987('0x5f')](_0x19aa56,[_0x9987('0x30'),_0x4a7f1d[_0x9987('0x4a')]]);if(!_0x44344f){switch(_0x4a7f1d[_0x9987('0x4a')]){case'unreadMessages':if(_0x4a7f1d[_0x9987('0x60')]==0x1){_0x34b82c['having']('`'+_0x4a7f1d[_0x9987('0x4a')]+_0x9987('0x61'));}else{_0x34b82c[_0x9987('0x62')]('`'+_0x4a7f1d['field']+_0x9987('0x63'));}break;case _0x9987('0x64'):if(_0x4a7f1d[_0x9987('0x65')]===_0x9987('0x66')){if(_0x4a7f1d[_0x9987('0x60')][_0x9987('0x36')]('\x20')['length']>0x1){_0xd9a59c[_0x24ac6f](_0x9987('0x67'),qs[_0x9987('0x68')](_0x4a7f1d[_0x9987('0x60')]),null);}else{var _0x51ef56='%'+_0x4a7f1d[_0x9987('0x60')]+'%';_0xd9a59c[_0x24ac6f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x51ef56,_0x51ef56,_0x51ef56);}}else{_0x44344f=_[_0x9987('0x5f')](_0x19aa56,['name',_0x9987('0x69')]);_0x4a7f1d[_0x9987('0x4a')]='ContactId';_0x57acc2=as['buildExpression'](_0x32013b,_0x44344f[_0x9987('0x3c')],_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2['text'],_0x57acc2[_0x9987('0x60')][_0x9987('0x6a')],_0x57acc2['value']['end']);}break;case _0x9987('0x6b'):var _0x5d99a6=_0x4a7f1d[_0x9987('0x60')][_0x9987('0x36')](',')['map'](function(_0x187daf){return Number(_0x187daf);});_0x5d99a6[_0x9987('0x37')](function(_0x56f0fb){_0x38d594['or'](_0x9987('0x6c'),'%,'+_0x56f0fb+',%');});_0x3799d5=_['union'](_0x3799d5,_0x5d99a6);break;case'User':if(_0x4a7f1d['operator']===_0x9987('0x66')){_0xd9a59c[_0x24ac6f](_0x9987('0x6d'),'%'+_0x4a7f1d[_0x9987('0x60')]+'%',null);}else{_0x44344f=_[_0x9987('0x5f')](_0x19aa56,[_0x9987('0x30'),'UserId']);_0x4a7f1d[_0x9987('0x4a')]=_0x9987('0x6e');_0x57acc2=as[_0x9987('0x6f')](_0x32013b,_0x44344f[_0x9987('0x3c')],_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2[_0x9987('0x70')],_0x57acc2[_0x9987('0x60')][_0x9987('0x6a')],_0x57acc2[_0x9987('0x60')][_0x9987('0x24')]);}break;case _0x9987('0x71'):_0x57acc2=as[_0x9987('0x6f')]('me',null,_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2[_0x9987('0x70')],_0x57acc2['value'][_0x9987('0x6a')],_0x57acc2['value']['end']);break;}}else{var _0x57acc2=as[_0x9987('0x6f')](_0x32013b,_0x44344f[_0x9987('0x3c')],_0x4a7f1d);_0xd9a59c[_0x24ac6f](_0x57acc2['text'],_0x57acc2[_0x9987('0x60')][_0x9987('0x6a')],_0x57acc2[_0x9987('0x60')][_0x9987('0x24')]);}}}else{var _0x357f3b=_(_0x49c461[_0x9987('0x40')])[_0x9987('0x3f')]()[_0x9987('0x32')](function(_0x58dce1){return _[_0x9987('0x72')](_0x19aa56,['name',_0x58dce1])?_0x58dce1:undefined;})[_0x9987('0x73')]()[_0x9987('0x60')]();if(!_[_0x9987('0x74')](_0x357f3b)){_0x357f3b[_0x9987('0x37')](function(_0x263dd8){if(_0x263dd8===_0x9987('0x75')){_0x34b82c[_0x9987('0x46')](_0x9987('0x76'),[][_0x9987('0x77')](_0x49c461[_0x9987('0x40')][_0x263dd8]));}else if(_0x263dd8===_0x9987('0x78')){var _0x274951=JSON[_0x9987('0x79')](_0x49c461[_0x9987('0x40')][_0x263dd8])[_0x9987('0x7a')];var _0x424197=JSON[_0x9987('0x79')](_0x49c461[_0x9987('0x40')][_0x263dd8])[_0x9987('0x7b')];_0x34b82c[_0x9987('0x46')](_0x9987('0x7c'),_0x274951,_0x424197);}else{if(_0x49c461['query'][_0x263dd8]===_0x9987('0x7d')){_0x34b82c['where']('i.'+_0x263dd8+_0x9987('0x7e'));}else{_0x34b82c[_0x9987('0x46')]('i.'+_0x263dd8+_0x9987('0x7f'),_0x49c461['query'][_0x263dd8]);}}});}if(_0x49c461[_0x9987('0x40')]['read']){if(_0x49c461['query'][_0x9987('0x80')]==0x1){_0x34b82c[_0x9987('0x62')](_0x9987('0x81'));}else{_0x34b82c[_0x9987('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x49c461[_0x9987('0x40')]['tag']){_0x3799d5=_['isArray'](_0x49c461['query']['tag'])?_0x49c461[_0x9987('0x40')][_0x9987('0x82')]:new Array(_0x49c461[_0x9987('0x40')][_0x9987('0x82')]);_0x3799d5[_0x9987('0x37')](function(_0x32d29e){_0x38d594['or'](_0x9987('0x6c'),'%,'+_0x32d29e+',%');});}if(_0x49c461[_0x9987('0x40')][_0x9987('0x83')]){var _0x168c24=_0x49c461[_0x9987('0x40')]['filter'][_0x9987('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9987('0x85')](_0x168c24)){_0xd9a59c['or']('i.id\x20LIKE\x20?',_0x168c24+'%')['or'](_0x9987('0x86'),_0x168c24+'%');}else{_0xd9a59c['or'](_0x9987('0x87'),qs[_0x9987('0x68')](_0x168c24))['or'](_0x9987('0x88'),_0x168c24+'%');}}}_0x34b82c['where'](_0xd9a59c);_0x34b82c[_0x9987('0x89')]('i.id');var _0x5b021b={'type':db[_0x9987('0x8a')]['QueryTypes'][_0x9987('0x8b')],'raw':!![]};var _0xbb4839=_0x34b82c[_0x9987('0x8c')]();_0xbb4839[_0x9987('0x4a')](_0x9987('0x8d'));_0xbb4839[_0x9987('0x4a')](_0x9987('0x8e'),_0x9987('0x8f'));if(_0x3e7476[_0x9987('0x90')]){_0x3e7476[_0x9987('0x90')][_0x9987('0x37')](function(_0x7a5a45){var _0x3dd963=_0x7a5a45[0x0]===_0x9987('0x91')?_0x7a5a45[0x0]:'i.'+_0x7a5a45[0x0];_0x34b82c['order'](_0x3dd963,_0x7a5a45[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9987('0x74')](_0x3799d5)){_0x34b82c['having'](_0x38d594);_0xbb4839[_0x9987('0x46')](_0x9987('0x92'),_0x3799d5);}BPromise['resolve']()['then'](function(){if(!_0x2a9e64){if(_0x49c461[_0x9987('0x40')][_0x9987('0x75')])return;_0xbb4839['where'](_0x9987('0x93'));_0x34b82c[_0x9987('0x46')](_0x9987('0x93'));return;}if(_0x49c461['user'][_0x9987('0x94')]!==_0x9987('0x95'))return;return _0x49c461['user'][_0x9987('0x96')]({'attributes':['id'],'raw':!![]})[_0x9987('0x2e')](function(_0x104581){if(_[_0x9987('0x74')](_0x104581)){_0xbb4839['where'](_0x9987('0x97'));_0x34b82c['where'](_0x9987('0x97'));}else{_0xbb4839[_0x9987('0x46')]('i.WhatsappAccountId\x20IN\x20?',_[_0x9987('0x32')](_0x104581,'id'));_0x34b82c[_0x9987('0x46')](_0x9987('0x76'),_[_0x9987('0x32')](_0x104581,'id'));}});})[_0x9987('0x2e')](function(){if(_0x49c461[_0x9987('0x98')]['role']==='agent'&&!_0x2a9e64&&!_0x49c461[_0x9987('0x40')][_0x9987('0x75')])return[];return db[_0x9987('0x99')]['query'](_0xbb4839[_0x9987('0x9a')](),_0x5b021b);})[_0x9987('0x2e')](function(_0x2c9bc5){_0xc35e5e['count']=_0x2c9bc5[_0x9987('0x43')];if(_0xc35e5e['count']===0x0)return[];return db[_0x9987('0x99')]['query'](_0x1edf6b['toString'](),_0x5b021b)['then'](function(_0x262a4d){_0x44ccfa=_[_0x9987('0x9b')](_0x262a4d,'id');_0x5b021b=_[_0x9987('0x9c')](_0x5b021b,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49c461['query'][_0x9987('0x9d')]){_0x3e7476[_0x9987('0x42')][_0x9987('0x37')](function(_0x10978f){_0x34b82c[_0x9987('0x4a')]('i.'+_0x10978f);});}else{_0x34b82c[_0x9987('0x4a')](_0x9987('0x8e'),'unreadMessages');_0x34b82c[_0x9987('0x4a')](_0x9987('0x9e'),_0x9987('0x9f'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xa0'),_0x9987('0xa1'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xa2'),_0x9987('0x91'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xa3'));_0x34b82c['field'](_0x9987('0xa4'),_0x9987('0xa5'));_0x34b82c[_0x9987('0x4a')]('c.lastName','Contact.lastName');_0x34b82c[_0x9987('0x4a')](_0x9987('0xa6'),_0x9987('0xa7'));_0x34b82c[_0x9987('0x4a')]('c.phone',_0x9987('0xa8'));_0x34b82c['field']('c.mobile','Contact.mobile');_0x34b82c[_0x9987('0x4a')](_0x9987('0xa9'),_0x9987('0xaa'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xab'),_0x9987('0xac'));_0x34b82c['field'](_0x9987('0xad'),_0x9987('0xae'));_0x34b82c[_0x9987('0x4a')](_0x9987('0xaf'),_0x9987('0x34'));}if(_0x3e7476[_0x9987('0x27')])_0x34b82c[_0x9987('0x27')](_0x3e7476[_0x9987('0x27')]);if(_0x3e7476[_0x9987('0x28')])_0x34b82c['offset'](_0x3e7476[_0x9987('0x28')]);return db[_0x9987('0x99')][_0x9987('0x40')](_0x34b82c[_0x9987('0x9a')](),_0x5b021b);})[_0x9987('0x2e')](function(_0x8f46ce){if(_0x8f46ce['length']>0x0)_0x109a00[_0x9987('0x46')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x8f46ce,'id'));return db[_0x9987('0x99')][_0x9987('0x40')](_0x109a00[_0x9987('0x9a')](),_0x5b021b)[_0x9987('0x2e')](function(_0x186c55){var _0x47b580=_[_0x9987('0xb0')](_0x186c55,_0x9987('0xb1'));var _0x108ec3=[];_0x8f46ce[_0x9987('0x37')](function(_0x5ec2d0){_0x108ec3[_0x9987('0x38')](updateWhatsappInteraction(_0x5ec2d0,_0x44ccfa,_0x47b580));});return BPromise['all'](_0x108ec3);});});})[_0x9987('0x2e')](function(_0x3f5b13){_0xc35e5e['rows']=_0x3f5b13;return _0xc35e5e;})['then'](respondWithFilteredResult(_0x4a162f,_0x3e7476))['catch'](handleError(_0x4a162f,null));};exports['show']=function(_0x5e5bca,_0x4f9d75){var _0x21620b={'raw':![],'where':{'id':_0x5e5bca[_0x9987('0xb2')]['id']}},_0x111dfb={};_0x111dfb[_0x9987('0x3e')]=_[_0x9987('0x3f')](db['WhatsappInteraction'][_0x9987('0x3a')]);_0x111dfb['query']=_[_0x9987('0x3f')](_0x5e5bca[_0x9987('0x40')]);_0x111dfb['filters']=_[_0x9987('0x41')](_0x111dfb[_0x9987('0x3e')],_0x111dfb[_0x9987('0x40')]);_0x21620b['attributes']=_[_0x9987('0x41')](_0x111dfb[_0x9987('0x3e')],qs[_0x9987('0x9d')](_0x5e5bca[_0x9987('0x40')][_0x9987('0x9d')]));_0x21620b[_0x9987('0x42')]=_0x21620b[_0x9987('0x42')][_0x9987('0x43')]?_0x21620b[_0x9987('0x42')]:_0x111dfb['model'];if(_0x5e5bca['query'][_0x9987('0xb3')]){_0x21620b['include']=[{'all':!![]}];}_0x21620b=_['merge']({},_0x21620b,_0x5e5bca[_0x9987('0xb4')]);return db['WhatsappInteraction'][_0x9987('0x5f')](_0x21620b)[_0x9987('0x2e')](handleEntityNotFound(_0x4f9d75,null))['then'](respondWithResult(_0x4f9d75,null))['catch'](handleError(_0x4f9d75,null));};exports[_0x9987('0xb5')]=function(_0x5a270b,_0x6c40f){return db[_0x9987('0x39')][_0x9987('0xb5')](_0x5a270b[_0x9987('0x71')],{})[_0x9987('0x2e')](respondWithResult(_0x6c40f,0xc9))[_0x9987('0xb6')](handleError(_0x6c40f,null));};exports[_0x9987('0xb7')]=function(_0xfbf4e4,_0x1e2195){if(_0xfbf4e4[_0x9987('0x71')]['id']){delete _0xfbf4e4[_0x9987('0x71')]['id'];}return db[_0x9987('0x39')][_0x9987('0x5f')]({'where':{'id':_0xfbf4e4[_0x9987('0xb2')]['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x1e2195,null))[_0x9987('0x2e')](saveUpdates(_0xfbf4e4['body'],null))[_0x9987('0x2e')](respondWithResult(_0x1e2195,null))[_0x9987('0xb6')](handleError(_0x1e2195,null));};exports[_0x9987('0xb8')]=function(_0x42123e,_0x535dcf){return db[_0x9987('0x39')]['find']({'where':{'id':_0x42123e['params']['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x535dcf,null))['then'](removeEntity(_0x535dcf,null))[_0x9987('0xb6')](handleError(_0x535dcf,null));};exports[_0x9987('0xb9')]=function(_0x4885fd,_0x2a2a71){return db[_0x9987('0x39')][_0x9987('0xb9')]()['then'](respondWithResult(_0x2a2a71,null))[_0x9987('0xb6')](handleError(_0x2a2a71,null));};exports['addMessage']=function(_0x4260ba,_0x543113,_0x401094){return db[_0x9987('0xba')][_0x9987('0x5f')]({'where':{'id':_0x4260ba[_0x9987('0xb2')]['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x543113,null))['then'](function(_0x178f6a){if(_0x178f6a){return _0x178f6a[_0x9987('0xbb')](_0x4260ba['body'][_0x9987('0xbc')],_[_0x9987('0xbd')](_0x4260ba[_0x9987('0x71')],[_0x9987('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x543113,null))['catch'](handleError(_0x543113,null));};exports['getMessages']=function(_0x59ca7a,_0x23457c,_0x159438){var _0xea0df5={'raw':![],'where':{}};var _0x417580={};var _0x313415={'count':0x0,'rows':[]};return db[_0x9987('0x39')]['findOne']({'where':{'id':_0x59ca7a['params']['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x23457c,null))[_0x9987('0x2e')](function(_0x39f0ac){if(_0x39f0ac){_0x417580[_0x9987('0x3e')]=_[_0x9987('0x3f')](db[_0x9987('0xba')]['rawAttributes']);_0x417580['query']=_[_0x9987('0x3f')](_0x59ca7a['query']);_0x417580[_0x9987('0x48')]=_['intersection'](_0x417580['model'],_0x417580[_0x9987('0x40')]);_0xea0df5[_0x9987('0x42')]=_['intersection'](_0x417580['model'],qs[_0x9987('0x9d')](_0x59ca7a[_0x9987('0x40')][_0x9987('0x9d')]));_0xea0df5[_0x9987('0x42')]=_0xea0df5[_0x9987('0x42')]['length']?_0xea0df5[_0x9987('0x42')]:_0x417580[_0x9987('0x3e')];if(!_0x59ca7a[_0x9987('0x40')][_0x9987('0x44')](_0x9987('0xbe'))){_0xea0df5[_0x9987('0x27')]=qs['limit'](_0x59ca7a[_0x9987('0x40')]['limit']);_0xea0df5['offset']=qs[_0x9987('0x28')](_0x59ca7a[_0x9987('0x40')][_0x9987('0x28')]);}_0xea0df5['order']=qs[_0x9987('0x45')](_0x59ca7a[_0x9987('0x40')][_0x9987('0x45')]);_0xea0df5[_0x9987('0x46')]=qs[_0x9987('0x48')](_[_0x9987('0x47')](_0x59ca7a[_0x9987('0x40')],_0x417580[_0x9987('0x48')]));_0xea0df5[_0x9987('0x46')][_0x9987('0xb1')]=_0x39f0ac['id'];if(_0x59ca7a['query'][_0x9987('0x83')]){_0xea0df5[_0x9987('0x46')]=_['merge'](_0xea0df5['where'],{'$or':_['map'](_0xea0df5[_0x9987('0x42')],function(_0x537b59){var _0x1dd61e={};_0x1dd61e[_0x537b59]={'$like':'%'+_0x59ca7a[_0x9987('0x40')]['filter']+'%'};return _0x1dd61e;})});}if(_0x59ca7a[_0x9987('0x40')][_0x9987('0x7a')]){var _0x5a2e62=_0x59ca7a[_0x9987('0x40')]['$gte'][_0x9987('0x36')](',');var _0x4f1de0={};_0x4f1de0[_0x5a2e62[0x0]]={'$gte':moment(_0x5a2e62[0x1])[_0x9987('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')};_0xea0df5[_0x9987('0x46')]=_[_0x9987('0x9c')](_0xea0df5[_0x9987('0x46')],_0x4f1de0);}_0xea0df5=_['merge']({},_0xea0df5,_0x59ca7a[_0x9987('0xb4')]);return db[_0x9987('0xba')][_0x9987('0x29')]({'where':_0xea0df5[_0x9987('0x46')]})['then'](function(_0x2fa1f5){_0x313415[_0x9987('0x29')]=_0x2fa1f5;if(_0x59ca7a[_0x9987('0x40')][_0x9987('0xb3')]){_0xea0df5['include']=[{'all':!![]}];}return db[_0x9987('0xba')][_0x9987('0xc0')](_0xea0df5);})[_0x9987('0x2e')](function(_0x57cc84){_0x313415[_0x9987('0xc1')]=_0x57cc84;return _0x313415;});}})[_0x9987('0x2e')](respondWithFilteredResult(_0x23457c,_0xea0df5))[_0x9987('0xb6')](handleError(_0x23457c,null));};exports[_0x9987('0xc2')]=function(_0x3a3b77,_0x287f88,_0x3cd0f2){return db[_0x9987('0x39')][_0x9987('0x5f')]({'where':{'id':_0x3a3b77[_0x9987('0xb2')]['id']}})[_0x9987('0x2e')](handleEntityNotFound(_0x287f88,null))[_0x9987('0x2e')](function(_0x562126){if(_0x562126){return _0x562126[_0x9987('0xc3')](_0x3a3b77[_0x9987('0x71')]['ids'],_[_0x9987('0xbd')](_0x3a3b77[_0x9987('0x71')],[_0x9987('0xbc'),'id'])||{})[_0x9987('0xc4')](function(){return db['Tag'][_0x9987('0xc0')]({'attributes':['id','name',_0x9987('0x4b')],'where':{'id':_0x3a3b77['body']['ids']}});})[_0x9987('0x2e')](function(_0x2d7f34){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x3a3b77[_0x9987('0xb2')]['id']),'tags':_0x2d7f34||[]});return{'id':Number(_0x3a3b77[_0x9987('0xb2')]['id']),'tags':_0x2d7f34||[]};});}})[_0x9987('0x2e')](respondWithResult(_0x287f88,null))[_0x9987('0xb6')](handleError(_0x287f88,null));};exports['removeTags']=function(_0x28ce3d,_0x3b8a9e,_0x123006){return db[_0x9987('0x39')][_0x9987('0x5f')]({'where':{'id':_0x28ce3d[_0x9987('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3b8a9e,null))[_0x9987('0x2e')](function(_0x880086){if(_0x880086){return _0x880086['removeTags'](_0x28ce3d[_0x9987('0x40')]['ids']);}})[_0x9987('0x2e')](respondWithStatusCode(_0x3b8a9e,null))[_0x9987('0xb6')](handleError(_0x3b8a9e,null));};exports['download']=function(_0x58e8d2,_0x4d9b0e){var _0xc6068b=moment()[_0x9987('0xc5')]()[_0x9987('0x9a')]();var _0x4be83a=path[_0x9987('0xc6')](config[_0x9987('0xc7')],_0x9987('0xc8'),_0x9987('0xc9'),_0x9987('0xca'));var _0x4fa756=path['join'](config['root'],_0x9987('0xc8'),_0x9987('0xc9'),_0x9987('0xcb'));var _0x5d0614=path[_0x9987('0xc6')](_0x4be83a,_0xc6068b);var _0x4151de=util[_0x9987('0xbf')](_0x9987('0xcc'),_0x58e8d2['params']['id'],_0xc6068b);var _0x151afd=path['join'](_0x4be83a,_0x4151de);var _0x1eb138=[];_0x1eb138[_0x9987('0x38')]({'model':db[_0x9987('0xcd')],'as':_0x9987('0xcd'),'attributes':['id',_0x9987('0x33')],'raw':!![]});_0x1eb138[_0x9987('0x38')]({'model':db[_0x9987('0xce')],'as':_0x9987('0x64'),'attributes':['id','firstName',_0x9987('0xcf')],'raw':!![]});if(_0x58e8d2[_0x9987('0x40')][_0x9987('0xcb')]){_0x1eb138['push']({'model':db[_0x9987('0xd0')],'as':_0x9987('0xd0'),'raw':!![]});}var _0x2066e7=[{'model':db[_0x9987('0xba')],'as':'Messages','attributes':['id',_0x9987('0x71'),_0x9987('0x78'),_0x9987('0xd1'),'secret',_0x9987('0x80')],'include':_0x1eb138}];_0x2066e7[_0x9987('0x38')]({'model':db[_0x9987('0xd2')],'as':_0x9987('0xd3'),'attributes':['id','name']});_0x2066e7[_0x9987('0x38')]({'model':db[_0x9987('0xcd')],'as':_0x9987('0xd4'),'attributes':['id',_0x9987('0x33')]});return db['WhatsappInteraction'][_0x9987('0x5f')]({'where':{'id':_0x58e8d2[_0x9987('0xb2')]['id']},'include':_0x2066e7})[_0x9987('0x2e')](handleEntityNotFound(_0x4d9b0e,null))[_0x9987('0x2e')](function(_0x5147a6){if(_0x5147a6){var _0x1ff000=_0x5147a6['get']({'plain':!![]});fs[_0x9987('0xd5')](_0x5d0614);var _0x4ad868={'channel':_0x9987('0xd6'),'account':_0x1ff000['Account'][_0x9987('0x30')],'agent':_0x1ff000[_0x9987('0xd4')]?_0x1ff000[_0x9987('0xd4')]['fullname']:_0x9987('0xd7'),'createdAt':moment(_0x1ff000[_0x9987('0x78')])[_0x9987('0xbf')](_0x9987('0xd8'))['toString'](),'closedAt':_0x1ff000[_0x9987('0xd9')]?moment(_0x1ff000[_0x9987('0xda')])[_0x9987('0xbf')](_0x9987('0xd8'))[_0x9987('0x9a')]():'','disposition':_0x1ff000[_0x9987('0xdb')],'messages':_(_0x1ff000['Messages'])[_0x9987('0x83')]({'secret':![]})[_0x9987('0x32')](function(_0x10d066){if(_0x10d066[_0x9987('0xd0')]){var _0x117b1a=path[_0x9987('0xc6')](_0x4fa756,_0x10d066[_0x9987('0xd0')]['basename']);if(fs[_0x9987('0xdc')](_0x117b1a)){fs['createReadStream'](_0x117b1a)['pipe'](fs[_0x9987('0xdd')](path[_0x9987('0xc6')](_0x5d0614,_0x10d066[_0x9987('0xd0')][_0x9987('0xde')])));}}return{'date':moment(_0x10d066['createdAt'])[_0x9987('0xbf')](_0x9987('0xd8'))['toString'](),'sender':_0x10d066[_0x9987('0xd1')]===_0x9987('0xdf')?_0x10d066['User']?_0x10d066['User']['fullname']:_0x9987('0xe0'):_0x10d066[_0x9987('0x64')]['firstName']+(_0x10d066[_0x9987('0x64')][_0x9987('0xcf')]?'\x20'+_0x10d066[_0x9987('0x64')]['lastName']:''),'body':_0x10d066[_0x9987('0xd0')]?_0x10d066[_0x9987('0xd0')][_0x9987('0xde')]:_0x10d066[_0x9987('0x71')],'direction':_0x10d066[_0x9987('0xd1')]==='out'?'A':'C','secret':_0x10d066[_0x9987('0xe1')],'read':_0x10d066[_0x9987('0x80')],'attachment':_0x10d066[_0x9987('0xd0')]};})[_0x9987('0x60')]()};return ejs[_0x9987('0xe2')](path['join'](config[_0x9987('0xc7')],_0x9987('0xc8'),'views',_0x9987('0xe3')),{'interaction':_0x4ad868})[_0x9987('0x2e')](function(_0x5ba94d){var _0x311b93=path['join'](_0x5d0614,_0x9987('0xe4')+_0x1ff000['id']+'-'+_0xc6068b+'.pdf');var _0x31794c={'path':_0x311b93,'channel':_0x9987('0xd6'),'interactionId':_0x1ff000['id']};return pdf[_0x9987('0xe5')](_0x5ba94d,_0x31794c);})[_0x9987('0x2e')](function(){return new BPromise(function(_0x471a5a,_0x547a17){zipdir(_0x5d0614,{'saveTo':_0x151afd},function(_0x467911,_0x4e73ca){if(_0x467911)return _0x547a17(_0x467911);return _0x471a5a(_0x4e73ca);});})[_0x9987('0x2e')](function(){return new BPromise(function(_0x373b2c,_0x291c51){rimraf(_0x5d0614,function(_0x521804){if(_0x521804)_0x291c51(_0x521804);return _0x373b2c();});});})[_0x9987('0x2e')](function(){return _0x4d9b0e[_0x9987('0xe6')](_0x151afd,_0x4151de,function(_0x4b3cd6){if(_0x4b3cd6){console[_0x9987('0xe7')](_0x9987('0xe8'),_0x4b3cd6);}else{fs[_0x9987('0xe9')](_0x151afd);}});});});}else{return _0x4d9b0e[_0x9987('0x22')](0xc8);}})[_0x9987('0xb6')](handleError(_0x4d9b0e,null));}; \ No newline at end of file +var _0xd0ba=['find','value','having','`\x20=\x200','`\x20>\x200','$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','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','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','i.id','Sequelize','SELECT','unreadMessages','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','WhatsappMessage','addMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','findAll','emit','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','User','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','direction','secret','Account','Owner','Whatsapp','N.A.','closed','closedAt','disposition','basename','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.WhatsappInteractionId','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','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','length'];(function(_0x176c29,_0x99aa7d){var _0x113f59=function(_0x1498b0){while(--_0x1498b0){_0x176c29['push'](_0x176c29['shift']());}};_0x113f59(++_0x99aa7d);}(_0xd0ba,0x17c));var _0xad0b=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xd0ba[_0x126fb9];return _0xc8a3b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad0b('0x0'));var zipdir=require(_0xad0b('0x1'));var jsonpatch=require(_0xad0b('0x2'));var rp=require(_0xad0b('0x3'));var moment=require(_0xad0b('0x4'));var BPromise=require(_0xad0b('0x5'));var Mustache=require(_0xad0b('0x6'));var util=require(_0xad0b('0x7'));var path=require(_0xad0b('0x8'));var sox=require('sox');var csv=require(_0xad0b('0x9'));var ejs=require(_0xad0b('0xa'));var fs=require('fs');var fs_extra=require(_0xad0b('0xb'));var _=require('lodash');var squel=require(_0xad0b('0xc'));var crypto=require(_0xad0b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad0b('0xe'));var Redis=require('ioredis');var authService=require(_0xad0b('0xf'));var qs=require(_0xad0b('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xad0b('0x11'));var hardwareService=require(_0xad0b('0x12'));var logger=require(_0xad0b('0x13'))(_0xad0b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad0b('0x15'));var db=require(_0xad0b('0x16'))['db'];config[_0xad0b('0x17')]=_[_0xad0b('0x18')](config[_0xad0b('0x17')],{'host':_0xad0b('0x19'),'port':0x18eb});var socket=require(_0xad0b('0x1a'))(new Redis(config[_0xad0b('0x17')]));require(_0xad0b('0x1b'))[_0xad0b('0x1c')](socket);function respondWithStatusCode(_0x53d4a3,_0x2cb103){_0x2cb103=_0x2cb103||0xcc;return function(_0x8deb46){if(_0x8deb46){return _0x53d4a3['sendStatus'](_0x2cb103);}return _0x53d4a3[_0xad0b('0x1d')](_0x2cb103)['end']();};}function respondWithResult(_0x3d41f4,_0x43fb48){_0x43fb48=_0x43fb48||0xc8;return function(_0x4394be){if(_0x4394be){return _0x3d41f4['status'](_0x43fb48)['json'](_0x4394be);}};}function respondWithFilteredResult(_0x7da87f,_0x5d612b){return function(_0x56374b){if(_0x56374b){var _0x20ceb2=typeof _0x5d612b[_0xad0b('0x1e')]===_0xad0b('0x1f')&&typeof _0x5d612b[_0xad0b('0x20')]===_0xad0b('0x1f');var _0x5bfb7c=_0x56374b['count'];var _0x1c8a78=_0x20ceb2?0x0:_0x5d612b[_0xad0b('0x1e')];var _0x1998e1=_0x20ceb2?_0x56374b[_0xad0b('0x21')]:_0x5d612b[_0xad0b('0x1e')]+_0x5d612b[_0xad0b('0x20')];var _0x2b101d;if(_0x1998e1>=_0x5bfb7c){_0x1998e1=_0x5bfb7c;_0x2b101d=0xc8;}else{_0x2b101d=0xce;}_0x7da87f[_0xad0b('0x1d')](_0x2b101d);return _0x7da87f[_0xad0b('0x22')](_0xad0b('0x23'),_0x1c8a78+'-'+_0x1998e1+'/'+_0x5bfb7c)[_0xad0b('0x24')](_0x56374b);}return null;};}function patchUpdates(_0xada76a){return function(_0x24b3d4){try{jsonpatch[_0xad0b('0x25')](_0x24b3d4,_0xada76a,!![]);}catch(_0xcbc365){return BPromise[_0xad0b('0x26')](_0xcbc365);}return _0x24b3d4[_0xad0b('0x27')]();};}function saveUpdates(_0x19de9a,_0x14d7e7){return function(_0x1b895f){if(_0x1b895f){return _0x1b895f[_0xad0b('0x28')](_0x19de9a)[_0xad0b('0x29')](function(_0x3a20f2){return _0x3a20f2;});}return null;};}function removeEntity(_0x40425a,_0x2d6339){return function(_0x3116ac){if(_0x3116ac){return _0x3116ac[_0xad0b('0x2a')]()['then'](function(){_0x40425a['status'](0xcc)[_0xad0b('0x2b')]();});}};}function handleEntityNotFound(_0x21d104,_0x164487){return function(_0x1a3655){if(!_0x1a3655){_0x21d104[_0xad0b('0x2c')](0x194);}return _0x1a3655;};}function handleError(_0x1ea6b9,_0x126bd4){_0x126bd4=_0x126bd4||0x1f4;return function(_0x3ca1c1){logger[_0xad0b('0x2d')](_0x3ca1c1['stack']);if(_0x3ca1c1[_0xad0b('0x2e')]){delete _0x3ca1c1[_0xad0b('0x2e')];}_0x1ea6b9['status'](_0x126bd4)[_0xad0b('0x2f')](_0x3ca1c1);};}function getInteractionUsers(_0x3f048e,_0x4fda67){return new BPromise(function(_0x2fbd2c,_0x19d204){try{if(_0x4fda67[_0x3f048e['id']]){_0x3f048e[_0xad0b('0x30')]=_['map'](_0x4fda67[_0x3f048e['id']],function(_0x4a08ea){return{'id':_0x4a08ea['id'],'fullname':_0x4a08ea[_0xad0b('0x31')]};});}}catch(_0x331e98){_0x19d204(_0x331e98);}_0x2fbd2c(_0x3f048e);});}function getInteractionTags(_0x5e6caf,_0x4eed33){return new BPromise(function(_0x2255b7,_0x47a454){try{if(_0x5e6caf[_0xad0b('0x32')]){_0x5e6caf[_0xad0b('0x33')]=[];_0x5e6caf[_0xad0b('0x32')][_0xad0b('0x34')](',')[_0xad0b('0x35')](function(_0x5efbc3){_0x5e6caf[_0xad0b('0x33')][_0xad0b('0x36')](_0x4eed33[_0x5efbc3]);});}delete _0x5e6caf[_0xad0b('0x32')];}catch(_0xd7c321){_0x47a454(_0xd7c321);}_0x2255b7(_0x5e6caf);});}function updateWhatsappInteraction(_0x1c8390,_0x359566,_0x42040b){return new BPromise(function(_0x3d1bd0,_0x1f881b){return getInteractionUsers(_0x1c8390,_0x42040b)[_0xad0b('0x29')](function(_0x21879c){return getInteractionTags(_0x21879c,_0x359566);})[_0xad0b('0x29')](function(_0x49450c){_0x3d1bd0(_0x49450c);})[_0xad0b('0x37')](function(_0x106cb3){_0x1f881b(_0x106cb3);});});}exports[_0xad0b('0x38')]=function(_0x1800b0,_0x2f5b76){var _0x7afbc3={},_0x5a7996={},_0x1dcf00={'count':0x0,'rows':[]};var _0x3110e3=_['map'](db[_0xad0b('0x39')][_0xad0b('0x3a')],function(_0x9d4359){return{'name':_0x9d4359['fieldName'],'type':_0x9d4359['type'][_0xad0b('0x3b')]};});_0x5a7996[_0xad0b('0x3c')]=_[_0xad0b('0x3d')](_0x3110e3,'name');_0x5a7996[_0xad0b('0x3e')]=_['keys'](_0x1800b0[_0xad0b('0x3e')]);_0x5a7996[_0xad0b('0x3f')]=_[_0xad0b('0x40')](_0x5a7996[_0xad0b('0x3c')],_0x5a7996[_0xad0b('0x3e')]);_0x7afbc3['attributes']=_[_0xad0b('0x40')](_0x5a7996[_0xad0b('0x3c')],qs[_0xad0b('0x41')](_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x41')]));_0x7afbc3['attributes']=_0x7afbc3[_0xad0b('0x42')]['length']?_0x7afbc3['attributes']:_0x5a7996[_0xad0b('0x3c')];if(!_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x43')]('nolimit')){_0x7afbc3['limit']=qs[_0xad0b('0x20')](_0x1800b0[_0xad0b('0x3e')]['limit']);_0x7afbc3[_0xad0b('0x1e')]=qs[_0xad0b('0x1e')](_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x1e')]);}_0x7afbc3[_0xad0b('0x44')]=qs['sort'](_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x45')]);_0x7afbc3[_0xad0b('0x46')]=qs[_0xad0b('0x3f')](_[_0xad0b('0x47')](_0x1800b0[_0xad0b('0x3e')],_0x5a7996[_0xad0b('0x3f')]),_0x3110e3);var _0x582ca9=[];var _0x22f5dc=squel['select']()[_0xad0b('0x48')]('id')[_0xad0b('0x48')]('name')[_0xad0b('0x48')](_0xad0b('0x49'))[_0xad0b('0x4a')]('tools_tags');var _0x4f444b=squel[_0xad0b('0x4b')]()['field'](_0xad0b('0x4c'))[_0xad0b('0x48')](_0xad0b('0x4d'))[_0xad0b('0x48')](_0xad0b('0x4e'))['from']('user_has_whatsapp_interactions','ui')['left_join'](_0xad0b('0x4f'),'u',_0xad0b('0x50'));var _0x2bd39c=squel[_0xad0b('0x4b')]()[_0xad0b('0x4a')]('whatsapp_interactions','i')['left_join'](_0xad0b('0x51'),'c',_0xad0b('0x52'))[_0xad0b('0x53')](_0xad0b('0x4f'),'o',_0xad0b('0x54'))[_0xad0b('0x53')](_0xad0b('0x55'),'a',_0xad0b('0x56'))[_0xad0b('0x53')]('whatsapp_messages','me',_0xad0b('0x57'))[_0xad0b('0x53')](_0xad0b('0x58'),'it',_0xad0b('0x59'))[_0xad0b('0x53')](_0xad0b('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x1b3048=squel[_0xad0b('0x5b')]();var _0x2de120=[];var _0x121ec3=squel[_0xad0b('0x5b')]();var _0x418114;if(_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x5c')]){_0x418114=as['parseSearch'](_0x1800b0['query'][_0xad0b('0x5c')]);var _0x5de652=_0x418114[_0xad0b('0x5d')];for(var _0xc22614=0x0;_0xc22614<_0x418114[_0xad0b('0x5e')][_0xad0b('0x5f')];_0xc22614++){var _0x16b8d4=_0x418114[_0xad0b('0x5e')][_0xc22614];var _0x5c118a='i';var _0x5ee508=_[_0xad0b('0x60')](_0x3110e3,['name',_0x16b8d4['field']]);if(!_0x5ee508){switch(_0x16b8d4[_0xad0b('0x48')]){case'unreadMessages':if(_0x16b8d4[_0xad0b('0x61')]==0x1){_0x2bd39c[_0xad0b('0x62')]('`'+_0x16b8d4[_0xad0b('0x48')]+_0xad0b('0x63'));}else{_0x2bd39c['having']('`'+_0x16b8d4['field']+_0xad0b('0x64'));}break;case'Contact':if(_0x16b8d4['operator']===_0xad0b('0x65')){if(_0x16b8d4[_0xad0b('0x61')][_0xad0b('0x34')]('\x20')[_0xad0b('0x5f')]>0x1){_0x1b3048[_0x5de652](_0xad0b('0x66'),qs[_0xad0b('0x67')](_0x16b8d4['value']),null);}else{var _0x462e89='%'+_0x16b8d4[_0xad0b('0x61')]+'%';_0x1b3048[_0x5de652](_0xad0b('0x68'),_0x462e89,_0x462e89,_0x462e89);}}else{_0x5ee508=_[_0xad0b('0x60')](_0x3110e3,[_0xad0b('0x2e'),'ContactId']);_0x16b8d4['field']=_0xad0b('0x69');_0x4a4bda=as[_0xad0b('0x6a')](_0x5c118a,_0x5ee508[_0xad0b('0x6b')],_0x16b8d4);_0x1b3048[_0x5de652](_0x4a4bda[_0xad0b('0x6c')],_0x4a4bda[_0xad0b('0x61')][_0xad0b('0x6d')],_0x4a4bda[_0xad0b('0x61')][_0xad0b('0x2b')]);}break;case _0xad0b('0x6e'):var _0x22b092=_0x16b8d4[_0xad0b('0x61')]['split'](',')['map'](function(_0xc8548d){return Number(_0xc8548d);});_0x22b092[_0xad0b('0x35')](function(_0x50d5fd){_0x121ec3['or'](_0xad0b('0x6f'),'%,'+_0x50d5fd+',%');});_0x2de120=_[_0xad0b('0x70')](_0x2de120,_0x22b092);break;case'User':if(_0x16b8d4[_0xad0b('0x71')]==='$substring'){_0x1b3048[_0x5de652](_0xad0b('0x72'),'%'+_0x16b8d4['value']+'%',null);}else{_0x5ee508=_[_0xad0b('0x60')](_0x3110e3,[_0xad0b('0x2e'),_0xad0b('0x73')]);_0x16b8d4['field']=_0xad0b('0x73');_0x4a4bda=as['buildExpression'](_0x5c118a,_0x5ee508['type'],_0x16b8d4);_0x1b3048[_0x5de652](_0x4a4bda['text'],_0x4a4bda[_0xad0b('0x61')]['start'],_0x4a4bda[_0xad0b('0x61')][_0xad0b('0x2b')]);}break;case'body':_0x4a4bda=as[_0xad0b('0x6a')]('me',null,_0x16b8d4);_0x1b3048[_0x5de652](_0x4a4bda[_0xad0b('0x6c')],_0x4a4bda['value'][_0xad0b('0x6d')],_0x4a4bda['value'][_0xad0b('0x2b')]);break;}}else{var _0x4a4bda=as[_0xad0b('0x6a')](_0x5c118a,_0x5ee508[_0xad0b('0x6b')],_0x16b8d4);_0x1b3048[_0x5de652](_0x4a4bda[_0xad0b('0x6c')],_0x4a4bda[_0xad0b('0x61')][_0xad0b('0x6d')],_0x4a4bda[_0xad0b('0x61')]['end']);}}}else{var _0x139c88=_(_0x1800b0[_0xad0b('0x3e')])[_0xad0b('0x74')]()[_0xad0b('0x3d')](function(_0x210b51){return _[_0xad0b('0x75')](_0x3110e3,[_0xad0b('0x2e'),_0x210b51])?_0x210b51:undefined;})[_0xad0b('0x76')]()[_0xad0b('0x61')]();if(!_[_0xad0b('0x77')](_0x139c88)){_0x139c88[_0xad0b('0x35')](function(_0x4e6489){if(_0x4e6489===_0xad0b('0x78')){_0x2bd39c[_0xad0b('0x46')](_0xad0b('0x79'),[][_0xad0b('0x7a')](_0x1800b0[_0xad0b('0x3e')][_0x4e6489]));}else if(_0x4e6489===_0xad0b('0x7b')){var _0x3d2718=JSON[_0xad0b('0x7c')](_0x1800b0[_0xad0b('0x3e')][_0x4e6489])[_0xad0b('0x7d')];var _0x6213f8=JSON[_0xad0b('0x7c')](_0x1800b0[_0xad0b('0x3e')][_0x4e6489])[_0xad0b('0x7e')];_0x2bd39c[_0xad0b('0x46')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3d2718,_0x6213f8);}else{if(_0x1800b0[_0xad0b('0x3e')][_0x4e6489]===_0xad0b('0x7f')){_0x2bd39c[_0xad0b('0x46')]('i.'+_0x4e6489+_0xad0b('0x80'));}else{_0x2bd39c[_0xad0b('0x46')]('i.'+_0x4e6489+_0xad0b('0x81'),_0x1800b0['query'][_0x4e6489]);}}});}if(_0x1800b0['query'][_0xad0b('0x82')]){if(_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x82')]==0x1){_0x2bd39c[_0xad0b('0x62')]('`unreadMessages`\x20=\x200');}else{_0x2bd39c[_0xad0b('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x83')]){_0x2de120=_[_0xad0b('0x84')](_0x1800b0['query']['tag'])?_0x1800b0[_0xad0b('0x3e')]['tag']:new Array(_0x1800b0[_0xad0b('0x3e')]['tag']);_0x2de120[_0xad0b('0x35')](function(_0x2c6f06){_0x121ec3['or'](_0xad0b('0x6f'),'%,'+_0x2c6f06+',%');});}if(_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x85')]){var _0x3aa552=_0x1800b0[_0xad0b('0x3e')][_0xad0b('0x85')][_0xad0b('0x86')]('\x5c','\x5c\x5c')[_0xad0b('0x86')](/'/g,'\x27\x27');if(qs[_0xad0b('0x87')](_0x3aa552)){_0x1b3048['or'](_0xad0b('0x88'),_0x3aa552+'%')['or'](_0xad0b('0x89'),_0x3aa552+'%');}else{_0x1b3048['or'](_0xad0b('0x8a'),qs[_0xad0b('0x67')](_0x3aa552))['or'](_0xad0b('0x8b'),_0x3aa552+'%');}}}_0x2bd39c[_0xad0b('0x46')](_0x1b3048);_0x2bd39c[_0xad0b('0x8c')](_0xad0b('0x8d'));var _0x118c41={'type':db[_0xad0b('0x8e')]['QueryTypes'][_0xad0b('0x8f')],'raw':!![]};var _0x4c4900=_0x2bd39c['clone']();_0x4c4900[_0xad0b('0x48')]('i.id');_0x4c4900['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xad0b('0x90'));if(_0x7afbc3['order']){_0x7afbc3['order'][_0xad0b('0x35')](function(_0x4cd942){var _0x5c9929=_0x4cd942[0x0]===_0xad0b('0x91')?_0x4cd942[0x0]:'i.'+_0x4cd942[0x0];_0x2bd39c[_0xad0b('0x44')](_0x5c9929,_0x4cd942[0x1]===_0xad0b('0x92')?![]:!![]);});}if(!_[_0xad0b('0x77')](_0x2de120)){_0x2bd39c[_0xad0b('0x62')](_0x121ec3);_0x4c4900['where']('t.id\x20IN\x20?',_0x2de120);}BPromise[_0xad0b('0x93')]()[_0xad0b('0x29')](function(){if(!_0x418114){if(_0x1800b0['query'][_0xad0b('0x78')])return;_0x4c4900[_0xad0b('0x46')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x2bd39c[_0xad0b('0x46')](_0xad0b('0x94'));return;}if(_0x1800b0[_0xad0b('0x95')][_0xad0b('0x96')]!=='agent')return;return _0x1800b0[_0xad0b('0x95')][_0xad0b('0x97')]({'attributes':['id'],'raw':!![]})[_0xad0b('0x29')](function(_0xe8510b){if(_[_0xad0b('0x77')](_0xe8510b)){_0x4c4900[_0xad0b('0x46')](_0xad0b('0x98'));_0x2bd39c[_0xad0b('0x46')](_0xad0b('0x98'));}else{_0x4c4900[_0xad0b('0x46')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0xe8510b,'id'));_0x2bd39c[_0xad0b('0x46')](_0xad0b('0x79'),_[_0xad0b('0x3d')](_0xe8510b,'id'));}});})[_0xad0b('0x29')](function(){if(_0x1800b0[_0xad0b('0x95')][_0xad0b('0x96')]==='agent'&&!_0x418114&&!_0x1800b0['query'][_0xad0b('0x78')])return[];return db[_0xad0b('0x99')][_0xad0b('0x3e')](_0x4c4900[_0xad0b('0x9a')](),_0x118c41);})[_0xad0b('0x29')](function(_0x4a259e){_0x1dcf00[_0xad0b('0x21')]=_0x4a259e['length'];if(_0x1dcf00[_0xad0b('0x21')]===0x0)return[];return db[_0xad0b('0x99')][_0xad0b('0x3e')](_0x22f5dc[_0xad0b('0x9a')](),_0x118c41)['then'](function(_0x549072){_0x582ca9=_[_0xad0b('0x9b')](_0x549072,'id');_0x118c41=_[_0xad0b('0x9c')](_0x118c41,{'model':db[_0xad0b('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1800b0['query']['fields']){_0x7afbc3[_0xad0b('0x42')]['forEach'](function(_0x4aae30){_0x2bd39c[_0xad0b('0x48')]('i.'+_0x4aae30);});}else{_0x2bd39c[_0xad0b('0x48')](_0xad0b('0x9d'),'unreadMessages');_0x2bd39c[_0xad0b('0x48')](_0xad0b('0x9e'),_0xad0b('0x9f'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xa0'),_0xad0b('0xa1'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xa2'),_0xad0b('0x91'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xa3'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xa4'),_0xad0b('0xa5'));_0x2bd39c[_0xad0b('0x48')]('c.lastName',_0xad0b('0xa6'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xa7'),_0xad0b('0xa8'));_0x2bd39c['field']('c.phone','Contact.phone');_0x2bd39c['field']('c.mobile',_0xad0b('0xa9'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xaa'),_0xad0b('0xab'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xac'),_0xad0b('0xad'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xae'),_0xad0b('0xaf'));_0x2bd39c[_0xad0b('0x48')](_0xad0b('0xb0'),'TagIds');}if(_0x7afbc3[_0xad0b('0x20')])_0x2bd39c[_0xad0b('0x20')](_0x7afbc3[_0xad0b('0x20')]);if(_0x7afbc3['offset'])_0x2bd39c[_0xad0b('0x1e')](_0x7afbc3[_0xad0b('0x1e')]);return db[_0xad0b('0x99')][_0xad0b('0x3e')](_0x2bd39c[_0xad0b('0x9a')](),_0x118c41);})[_0xad0b('0x29')](function(_0x384dfc){if(_0x384dfc[_0xad0b('0x5f')]>0x0)_0x4f444b[_0xad0b('0x46')](_0xad0b('0xb1'),_[_0xad0b('0x3d')](_0x384dfc,'id'));return db[_0xad0b('0x99')][_0xad0b('0x3e')](_0x4f444b[_0xad0b('0x9a')](),_0x118c41)['then'](function(_0x2ce2ad){var _0x21f3a3=_[_0xad0b('0xb2')](_0x2ce2ad,_0xad0b('0xb3'));var _0x3316c4=[];_0x384dfc['forEach'](function(_0x39bf49){_0x3316c4['push'](updateWhatsappInteraction(_0x39bf49,_0x582ca9,_0x21f3a3));});return BPromise[_0xad0b('0xb4')](_0x3316c4);});});})[_0xad0b('0x29')](function(_0x21096c){_0x1dcf00[_0xad0b('0xb5')]=_0x21096c;return _0x1dcf00;})[_0xad0b('0x29')](respondWithFilteredResult(_0x2f5b76,_0x7afbc3))[_0xad0b('0x37')](handleError(_0x2f5b76,null));};exports[_0xad0b('0xb6')]=function(_0x31a57c,_0x4c7c78){var _0x359057={'raw':![],'where':{'id':_0x31a57c[_0xad0b('0xb7')]['id']}},_0x3de918={};_0x3de918[_0xad0b('0x3c')]=_[_0xad0b('0x74')](db[_0xad0b('0x39')][_0xad0b('0x3a')]);_0x3de918['query']=_['keys'](_0x31a57c[_0xad0b('0x3e')]);_0x3de918[_0xad0b('0x3f')]=_[_0xad0b('0x40')](_0x3de918[_0xad0b('0x3c')],_0x3de918[_0xad0b('0x3e')]);_0x359057[_0xad0b('0x42')]=_['intersection'](_0x3de918[_0xad0b('0x3c')],qs[_0xad0b('0x41')](_0x31a57c['query'][_0xad0b('0x41')]));_0x359057[_0xad0b('0x42')]=_0x359057[_0xad0b('0x42')][_0xad0b('0x5f')]?_0x359057[_0xad0b('0x42')]:_0x3de918[_0xad0b('0x3c')];if(_0x31a57c['query'][_0xad0b('0xb8')]){_0x359057[_0xad0b('0xb9')]=[{'all':!![]}];}_0x359057=_[_0xad0b('0x9c')]({},_0x359057,_0x31a57c[_0xad0b('0xba')]);return db[_0xad0b('0x39')]['find'](_0x359057)[_0xad0b('0x29')](handleEntityNotFound(_0x4c7c78,null))[_0xad0b('0x29')](respondWithResult(_0x4c7c78,null))[_0xad0b('0x37')](handleError(_0x4c7c78,null));};exports[_0xad0b('0xbb')]=function(_0x4f812e,_0x3148ea){return db['WhatsappInteraction']['create'](_0x4f812e['body'],{})[_0xad0b('0x29')](respondWithResult(_0x3148ea,0xc9))['catch'](handleError(_0x3148ea,null));};exports[_0xad0b('0x28')]=function(_0x4edc07,_0x5850cd){if(_0x4edc07['body']['id']){delete _0x4edc07[_0xad0b('0xbc')]['id'];}return db[_0xad0b('0x39')]['find']({'where':{'id':_0x4edc07[_0xad0b('0xb7')]['id']}})[_0xad0b('0x29')](handleEntityNotFound(_0x5850cd,null))['then'](saveUpdates(_0x4edc07[_0xad0b('0xbc')],null))[_0xad0b('0x29')](respondWithResult(_0x5850cd,null))[_0xad0b('0x37')](handleError(_0x5850cd,null));};exports[_0xad0b('0x2a')]=function(_0x438b21,_0x353507){return db[_0xad0b('0x39')][_0xad0b('0x60')]({'where':{'id':_0x438b21[_0xad0b('0xb7')]['id']}})[_0xad0b('0x29')](handleEntityNotFound(_0x353507,null))[_0xad0b('0x29')](removeEntity(_0x353507,null))[_0xad0b('0x37')](handleError(_0x353507,null));};exports[_0xad0b('0xbd')]=function(_0x1550f0,_0x21069e){return db['WhatsappInteraction'][_0xad0b('0xbd')]()[_0xad0b('0x29')](respondWithResult(_0x21069e,null))[_0xad0b('0x37')](handleError(_0x21069e,null));};exports['addMessage']=function(_0x2dff67,_0x5bc20a,_0x1f7d54){return db[_0xad0b('0xbe')][_0xad0b('0x60')]({'where':{'id':_0x2dff67[_0xad0b('0xb7')]['id']}})[_0xad0b('0x29')](handleEntityNotFound(_0x5bc20a,null))[_0xad0b('0x29')](function(_0x16913f){if(_0x16913f){return _0x16913f[_0xad0b('0xbf')](_0x2dff67[_0xad0b('0xbc')]['ids'],_[_0xad0b('0xc0')](_0x2dff67[_0xad0b('0xbc')],[_0xad0b('0xc1'),'id'])||{});}})[_0xad0b('0x29')](respondWithResult(_0x5bc20a,null))[_0xad0b('0x37')](handleError(_0x5bc20a,null));};exports[_0xad0b('0xc2')]=function(_0x551efb,_0x5e6b8e,_0x770672){var _0x32d5d0={'raw':![],'where':{}};var _0x35609f={};var _0x3c1f40={'count':0x0,'rows':[]};return db[_0xad0b('0x39')][_0xad0b('0xc3')]({'where':{'id':_0x551efb[_0xad0b('0xb7')]['id']}})[_0xad0b('0x29')](handleEntityNotFound(_0x5e6b8e,null))[_0xad0b('0x29')](function(_0x56703e){if(_0x56703e){_0x35609f['model']=_[_0xad0b('0x74')](db[_0xad0b('0xbe')][_0xad0b('0x3a')]);_0x35609f[_0xad0b('0x3e')]=_['keys'](_0x551efb['query']);_0x35609f[_0xad0b('0x3f')]=_[_0xad0b('0x40')](_0x35609f[_0xad0b('0x3c')],_0x35609f[_0xad0b('0x3e')]);_0x32d5d0[_0xad0b('0x42')]=_[_0xad0b('0x40')](_0x35609f[_0xad0b('0x3c')],qs[_0xad0b('0x41')](_0x551efb['query'][_0xad0b('0x41')]));_0x32d5d0[_0xad0b('0x42')]=_0x32d5d0[_0xad0b('0x42')][_0xad0b('0x5f')]?_0x32d5d0[_0xad0b('0x42')]:_0x35609f[_0xad0b('0x3c')];if(!_0x551efb[_0xad0b('0x3e')][_0xad0b('0x43')]('nolimit')){_0x32d5d0[_0xad0b('0x20')]=qs[_0xad0b('0x20')](_0x551efb[_0xad0b('0x3e')][_0xad0b('0x20')]);_0x32d5d0[_0xad0b('0x1e')]=qs[_0xad0b('0x1e')](_0x551efb['query'][_0xad0b('0x1e')]);}_0x32d5d0[_0xad0b('0x44')]=qs[_0xad0b('0x45')](_0x551efb[_0xad0b('0x3e')][_0xad0b('0x45')]);_0x32d5d0['where']=qs[_0xad0b('0x3f')](_['pick'](_0x551efb[_0xad0b('0x3e')],_0x35609f['filters']));_0x32d5d0[_0xad0b('0x46')][_0xad0b('0xb3')]=_0x56703e['id'];if(_0x551efb[_0xad0b('0x3e')][_0xad0b('0x85')]){_0x32d5d0[_0xad0b('0x46')]=_[_0xad0b('0x9c')](_0x32d5d0[_0xad0b('0x46')],{'$or':_[_0xad0b('0x3d')](_0x32d5d0[_0xad0b('0x42')],function(_0x511555){var _0x34693c={};_0x34693c[_0x511555]={'$like':'%'+_0x551efb[_0xad0b('0x3e')]['filter']+'%'};return _0x34693c;})});}if(_0x551efb[_0xad0b('0x3e')]['$gte']){var _0x72297f=_0x551efb[_0xad0b('0x3e')][_0xad0b('0x7d')][_0xad0b('0x34')](',');var _0x346b55={};_0x346b55[_0x72297f[0x0]]={'$gte':moment(_0x72297f[0x1])[_0xad0b('0xc4')](_0xad0b('0xc5'))};_0x32d5d0['where']=_[_0xad0b('0x9c')](_0x32d5d0[_0xad0b('0x46')],_0x346b55);}_0x32d5d0=_[_0xad0b('0x9c')]({},_0x32d5d0,_0x551efb['options']);return db[_0xad0b('0xbe')]['count']({'where':_0x32d5d0['where']})[_0xad0b('0x29')](function(_0x2ad08b){_0x3c1f40[_0xad0b('0x21')]=_0x2ad08b;if(_0x551efb['query']['includeAll']){_0x32d5d0[_0xad0b('0xb9')]=[{'all':!![]}];}return db[_0xad0b('0xbe')]['findAll'](_0x32d5d0);})[_0xad0b('0x29')](function(_0x2a8810){_0x3c1f40['rows']=_0x2a8810;return _0x3c1f40;});}})['then'](respondWithFilteredResult(_0x5e6b8e,_0x32d5d0))[_0xad0b('0x37')](handleError(_0x5e6b8e,null));};exports[_0xad0b('0xc6')]=function(_0xf79e97,_0x30029c,_0x23a44e){return db[_0xad0b('0x39')][_0xad0b('0x60')]({'where':{'id':_0xf79e97['params']['id']}})[_0xad0b('0x29')](handleEntityNotFound(_0x30029c,null))['then'](function(_0xc49cb1){if(_0xc49cb1){return _0xc49cb1[_0xad0b('0xc7')](_0xf79e97[_0xad0b('0xbc')][_0xad0b('0xc1')],_['omit'](_0xf79e97[_0xad0b('0xbc')],[_0xad0b('0xc1'),'id'])||{})['spread'](function(){return db[_0xad0b('0x6e')][_0xad0b('0xc8')]({'attributes':['id',_0xad0b('0x2e'),'color'],'where':{'id':_0xf79e97[_0xad0b('0xbc')]['ids']}});})[_0xad0b('0x29')](function(_0x3af3f8){socket[_0xad0b('0xc9')]('whatsappInteractionTags:save',{'id':Number(_0xf79e97[_0xad0b('0xb7')]['id']),'tags':_0x3af3f8||[]});return{'id':Number(_0xf79e97[_0xad0b('0xb7')]['id']),'tags':_0x3af3f8||[]};});}})[_0xad0b('0x29')](respondWithResult(_0x30029c,null))[_0xad0b('0x37')](handleError(_0x30029c,null));};exports[_0xad0b('0xca')]=function(_0x39a88f,_0x283ab6,_0x2cf1d1){return db[_0xad0b('0x39')]['find']({'where':{'id':_0x39a88f['params']['id']}})[_0xad0b('0x29')](handleEntityNotFound(_0x283ab6,null))['then'](function(_0x537111){if(_0x537111){return _0x537111[_0xad0b('0xca')](_0x39a88f[_0xad0b('0x3e')][_0xad0b('0xc1')]);}})[_0xad0b('0x29')](respondWithStatusCode(_0x283ab6,null))[_0xad0b('0x37')](handleError(_0x283ab6,null));};exports[_0xad0b('0xcb')]=function(_0x56a904,_0xfc2f26){var _0x7aeeca=moment()[_0xad0b('0xcc')]()[_0xad0b('0x9a')]();var _0x210f42=path[_0xad0b('0xcd')](config['root'],_0xad0b('0xce'),_0xad0b('0xcf'),_0xad0b('0xd0'));var _0x3847cc=path['join'](config[_0xad0b('0xd1')],_0xad0b('0xce'),_0xad0b('0xcf'),'attachments');var _0x431ad6=path[_0xad0b('0xcd')](_0x210f42,_0x7aeeca);var _0x129a3c=util[_0xad0b('0xc4')](_0xad0b('0xd2'),_0x56a904['params']['id'],_0x7aeeca);var _0x4f2b09=path[_0xad0b('0xcd')](_0x210f42,_0x129a3c);var _0xbe9a6c=[];_0xbe9a6c[_0xad0b('0x36')]({'model':db[_0xad0b('0xd3')],'as':_0xad0b('0xd3'),'attributes':['id',_0xad0b('0x31')],'raw':!![]});_0xbe9a6c['push']({'model':db[_0xad0b('0xd4')],'as':_0xad0b('0xd5'),'attributes':['id',_0xad0b('0xd6'),_0xad0b('0xd7')],'raw':!![]});if(_0x56a904['query'][_0xad0b('0xd8')]){_0xbe9a6c[_0xad0b('0x36')]({'model':db[_0xad0b('0xd9')],'as':_0xad0b('0xd9'),'raw':!![]});}var _0x23b4ed=[{'model':db[_0xad0b('0xbe')],'as':_0xad0b('0xda'),'attributes':['id',_0xad0b('0xbc'),_0xad0b('0x7b'),_0xad0b('0xdb'),_0xad0b('0xdc'),_0xad0b('0x82')],'include':_0xbe9a6c}];_0x23b4ed[_0xad0b('0x36')]({'model':db['WhatsappAccount'],'as':_0xad0b('0xdd'),'attributes':['id',_0xad0b('0x2e')]});_0x23b4ed['push']({'model':db[_0xad0b('0xd3')],'as':_0xad0b('0xde'),'attributes':['id',_0xad0b('0x31')]});return db[_0xad0b('0x39')][_0xad0b('0x60')]({'where':{'id':_0x56a904[_0xad0b('0xb7')]['id']},'include':_0x23b4ed})[_0xad0b('0x29')](handleEntityNotFound(_0xfc2f26,null))[_0xad0b('0x29')](function(_0x3f1a7d){if(_0x3f1a7d){var _0x123513=_0x3f1a7d['get']({'plain':!![]});fs['mkdirSync'](_0x431ad6);var _0x11cbd6={'channel':_0xad0b('0xdf'),'account':_0x123513[_0xad0b('0xdd')][_0xad0b('0x2e')],'agent':_0x123513['Owner']?_0x123513[_0xad0b('0xde')][_0xad0b('0x31')]:_0xad0b('0xe0'),'createdAt':moment(_0x123513['createdAt'])['format'](_0xad0b('0xc5'))[_0xad0b('0x9a')](),'closedAt':_0x123513[_0xad0b('0xe1')]?moment(_0x123513[_0xad0b('0xe2')])[_0xad0b('0xc4')](_0xad0b('0xc5'))[_0xad0b('0x9a')]():'','disposition':_0x123513[_0xad0b('0xe3')],'messages':_(_0x123513['Messages'])['filter']({'secret':![]})[_0xad0b('0x3d')](function(_0x481a30){if(_0x481a30[_0xad0b('0xd9')]){var _0x21b304=path[_0xad0b('0xcd')](_0x3847cc,_0x481a30['Attachment']['basename']);if(fs['existsSync'](_0x21b304)){fs['createReadStream'](_0x21b304)['pipe'](fs['createWriteStream'](path[_0xad0b('0xcd')](_0x431ad6,_0x481a30[_0xad0b('0xd9')][_0xad0b('0xe4')])));}}return{'date':moment(_0x481a30[_0xad0b('0x7b')])[_0xad0b('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x481a30[_0xad0b('0xdb')]===_0xad0b('0xe5')?_0x481a30[_0xad0b('0xd3')]?_0x481a30[_0xad0b('0xd3')][_0xad0b('0x31')]:_0xad0b('0xe6'):_0x481a30[_0xad0b('0xd5')][_0xad0b('0xd6')]+(_0x481a30[_0xad0b('0xd5')][_0xad0b('0xd7')]?'\x20'+_0x481a30[_0xad0b('0xd5')][_0xad0b('0xd7')]:''),'body':_0x481a30[_0xad0b('0xd9')]?_0x481a30['Attachment'][_0xad0b('0xe4')]:_0x481a30['body'],'direction':_0x481a30[_0xad0b('0xdb')]===_0xad0b('0xe5')?'A':'C','secret':_0x481a30[_0xad0b('0xdc')],'read':_0x481a30[_0xad0b('0x82')],'attachment':_0x481a30['Attachment']};})[_0xad0b('0x61')]()};return ejs[_0xad0b('0xe7')](path[_0xad0b('0xcd')](config[_0xad0b('0xd1')],_0xad0b('0xce'),_0xad0b('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x11cbd6})[_0xad0b('0x29')](function(_0xabca05){var _0xb06984=path['join'](_0x431ad6,_0xad0b('0xe9')+_0x123513['id']+'-'+_0x7aeeca+_0xad0b('0xea'));var _0x4a48fa={'path':_0xb06984,'channel':_0xad0b('0xdf'),'interactionId':_0x123513['id']};return pdf[_0xad0b('0xeb')](_0xabca05,_0x4a48fa);})[_0xad0b('0x29')](function(){return new BPromise(function(_0x43c32e,_0x5c28e8){zipdir(_0x431ad6,{'saveTo':_0x4f2b09},function(_0x5489b1,_0x3f6fed){if(_0x5489b1)return _0x5c28e8(_0x5489b1);return _0x43c32e(_0x3f6fed);});})['then'](function(){return new BPromise(function(_0x4be8db,_0x535675){rimraf(_0x431ad6,function(_0x230db1){if(_0x230db1)_0x535675(_0x230db1);return _0x4be8db();});});})[_0xad0b('0x29')](function(){return _0xfc2f26[_0xad0b('0xcb')](_0x4f2b09,_0x129a3c,function(_0x15d1ce){if(_0x15d1ce){console['log'](_0xad0b('0xec'),_0x15d1ce);}else{fs[_0xad0b('0xed')](_0x4f2b09);}});});});}else{return _0xfc2f26['sendStatus'](0xc8);}})[_0xad0b('0x37')](handleError(_0xfc2f26,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4a8d263..d1c7709 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 _0xbc4a=['exports','events','../../mysqldb','WhatsappInteraction','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x52a76c,_0x56752c){var _0x1c95d8=function(_0x301a2f){while(--_0x301a2f){_0x52a76c['push'](_0x52a76c['shift']());}};_0x1c95d8(++_0x56752c);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x3e4abc,_0x529ca4){_0x3e4abc=_0x3e4abc-0x0;var _0x1eb45b=_0xbc4a[_0x3e4abc];return _0x1eb45b;};'use strict';var EventEmitter=require(_0xabc4('0x0'));var WhatsappInteraction=require(_0xabc4('0x1'))['db'][_0xabc4('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xabc4('0x3')};function emitEvent(_0x4e84f9){return function(_0x437731,_0x430fdd,_0x282a1e){_0x437731[_0xabc4('0x4')]({'attributes':['id'],'raw':!![]})[_0xabc4('0x5')](function(_0x1a33c4){_0x437731[_0xabc4('0x6')](_0xabc4('0x7'),_0x1a33c4[_0xabc4('0x8')](function(_0xfd0e7d){return{'id':_0xfd0e7d['id']};}));return WhatsappMessage[_0xabc4('0x9')]({'where':{'WhatsappInteractionId':_0x437731['id'],'direction':'in','read':![]},'raw':!![]});})[_0xabc4('0x5')](function(_0x4067e1){_0x437731[_0xabc4('0x6')](_0xabc4('0xa'),_0x4067e1[_0xabc4('0xb')]);WhatsappInteractionEvents[_0xabc4('0xc')](_0x4e84f9+':'+_0x437731['id'],_0x437731);WhatsappInteractionEvents[_0xabc4('0xc')](_0x4e84f9,_0x437731);_0x282a1e(null);})[_0xabc4('0xd')](_0x282a1e(null));};}for(var e in events){if(events[_0xabc4('0xe')](e)){var event=events[e];WhatsappInteraction[_0xabc4('0xf')](e,emitEvent(event));}}module[_0xabc4('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x8278=['length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8827('0x0'));var WhatsappInteraction=require(_0x8827('0x1'))['db'][_0x8827('0x2')];var WhatsappMessage=require(_0x8827('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8827('0x3'),'afterUpdate':_0x8827('0x4'),'afterDestroy':_0x8827('0x5')};function emitEvent(_0xf4c10){return function(_0x5b72ad,_0x400227,_0x4342d7){_0x5b72ad[_0x8827('0x6')]({'attributes':['id'],'raw':!![]})[_0x8827('0x7')](function(_0x2b674e){_0x5b72ad[_0x8827('0x8')](_0x8827('0x9'),_0x2b674e[_0x8827('0xa')](function(_0x117d42){return{'id':_0x117d42['id']};}));return WhatsappMessage[_0x8827('0xb')]({'where':{'WhatsappInteractionId':_0x5b72ad['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8827('0x7')](function(_0x126062){_0x5b72ad[_0x8827('0x8')]('unreadMessages',_0x126062[_0x8827('0xc')]);WhatsappInteractionEvents[_0x8827('0xd')](_0xf4c10+':'+_0x5b72ad['id'],_0x5b72ad);WhatsappInteractionEvents['emit'](_0xf4c10,_0x5b72ad);_0x4342d7(null);})[_0x8827('0xe')](_0x4342d7(null));};}for(var e in events){if(events[_0x8827('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x8827('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 26d57fb..f33ec73 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 _0x0630=['changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions'];(function(_0x15caa5,_0x206c67){var _0x1200c7=function(_0x209813){while(--_0x209813){_0x15caa5['push'](_0x15caa5['shift']());}};_0x1200c7(++_0x206c67);}(_0x0630,0x9d));var _0x0063=function(_0xbbf92c,_0x2c91f9){_0xbbf92c=_0xbbf92c-0x0;var _0x42f989=_0x0630[_0xbbf92c];return _0x42f989;};'use strict';var _=require(_0x0063('0x0'));var util=require(_0x0063('0x1'));var logger=require(_0x0063('0x2'))(_0x0063('0x3'));var moment=require(_0x0063('0x4'));var BPromise=require(_0x0063('0x5'));var rp=require(_0x0063('0x6'));var fs=require('fs');var path=require(_0x0063('0x7'));var rimraf=require(_0x0063('0x8'));var config=require('../../config/environment');var attributes=require(_0x0063('0x9'));module[_0x0063('0xa')]=function(_0x1f16ba,_0x1237ed){return _0x1f16ba[_0x0063('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x0063('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x400cd1,_0x2b7c6e,_0x5e8b11){if(_0x400cd1[_0x0063('0xd')](_0x0063('0xe'))){_0x400cd1[_0x0063('0xf')]=moment()[_0x0063('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e8b11(null,_0x400cd1);}}});}; \ No newline at end of file +var _0x03bb=['util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xff9c57,_0x429ef0){var _0x4dcf4f=function(_0x3382cb){while(--_0x3382cb){_0xff9c57['push'](_0xff9c57['shift']());}};_0x4dcf4f(++_0x429ef0);}(_0x03bb,0x17a));var _0xb03b=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0x03bb[_0x361d3f];return _0x320229;};'use strict';var _=require('lodash');var util=require(_0xb03b('0x0'));var logger=require(_0xb03b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb03b('0x2'));var rp=require(_0xb03b('0x3'));var fs=require('fs');var path=require(_0xb03b('0x4'));var rimraf=require(_0xb03b('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0xb03b('0x6')]=function(_0x27aad4,_0x4353bf){return _0x27aad4[_0xb03b('0x7')](_0xb03b('0x8'),attributes,{'tableName':_0xb03b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38000d,_0x59c049,_0x4181d3){if(_0x38000d[_0xb03b('0xa')]('closed')){_0x38000d[_0xb03b('0xb')]=moment()[_0xb03b('0xc')](_0xb03b('0xd'));}_0x4181d3(null,_0x38000d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ed1209a..e052a7c 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 _0xfdee=['then','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find'];(function(_0x3f2390,_0x218e3c){var _0x5f14be=function(_0x56d907){while(--_0x56d907){_0x3f2390['push'](_0x3f2390['shift']());}};_0x5f14be(++_0x218e3c);}(_0xfdee,0xe0));var _0xefde=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0xfdee[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0xefde('0x0'));var util=require(_0xefde('0x1'));var moment=require(_0xefde('0x2'));var BPromise=require(_0xefde('0x3'));var rs=require(_0xefde('0x4'));var fs=require('fs');var Redis=require(_0xefde('0x5'));var db=require(_0xefde('0x6'))['db'];var utils=require(_0xefde('0x7'));var logger=require(_0xefde('0x8'))(_0xefde('0x9'));var config=require(_0xefde('0xa'));var jayson=require(_0xefde('0xb'));var client=jayson[_0xefde('0xc')][_0xefde('0xd')]({'port':0x232a});config[_0xefde('0xe')]=_[_0xefde('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xefde('0x10'))(new Redis(config[_0xefde('0xe')]));require(_0xefde('0x11'))[_0xefde('0x12')](socket);function respondWithRpcPromise(_0x45937a,_0x28080f,_0x219abe){return new BPromise(function(_0x316b5f,_0x43a3b4){return client['request'](_0x45937a,_0x219abe)['then'](function(_0x32df34){logger[_0xefde('0x13')](_0xefde('0x14'),_0x28080f,_0xefde('0x15'));logger[_0xefde('0x16')](_0xefde('0x17'),_0x28080f,_0xefde('0x15'),JSON[_0xefde('0x18')](_0x32df34));if(_0x32df34[_0xefde('0x19')]){if(_0x32df34['error'][_0xefde('0x1a')]===0x1f4){logger['error'](_0xefde('0x14'),_0x28080f,_0x32df34[_0xefde('0x19')][_0xefde('0x1b')]);return _0x43a3b4(_0x32df34[_0xefde('0x19')]['message']);}logger['error'](_0xefde('0x14'),_0x28080f,_0x32df34['error'][_0xefde('0x1b')]);return _0x316b5f(_0x32df34['error'][_0xefde('0x1b')]);}else{logger[_0xefde('0x13')](_0xefde('0x14'),_0x28080f,_0xefde('0x15'));_0x316b5f(_0x32df34[_0xefde('0x1c')][_0xefde('0x1b')]);}})[_0xefde('0x1d')](function(_0x1ec39e){logger[_0xefde('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x28080f,_0x1ec39e);_0x43a3b4(_0x1ec39e);});});}exports[_0xefde('0x1e')]=function(_0x5087cf){var _0x480c5a=this;return new Promise(function(_0x1a4bf6,_0x4bd375){return db[_0xefde('0x1f')]['update'](_0x5087cf[_0xefde('0x20')],{'raw':_0x5087cf[_0xefde('0x21')]?_0x5087cf[_0xefde('0x21')][_0xefde('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5087cf[_0xefde('0x21')]?_0x5087cf['options'][_0xefde('0x23')]||null:null,'attributes':_0x5087cf['options']?_0x5087cf['options'][_0xefde('0x24')]||null:null,'limit':_0x5087cf['options']?_0x5087cf[_0xefde('0x21')][_0xefde('0x25')]||null:null})['then'](function(_0x15d13f){logger[_0xefde('0x13')](_0xefde('0x1e'),_0x5087cf);logger[_0xefde('0x16')](_0xefde('0x1e'),_0x5087cf,JSON['stringify'](_0x15d13f));_0x1a4bf6(_0x15d13f);})['catch'](function(_0x4d986b){logger[_0xefde('0x19')](_0xefde('0x1e'),_0x4d986b[_0xefde('0x1b')],_0x5087cf);_0x4bd375(_0x480c5a[_0xefde('0x19')](0x1f4,_0x4d986b[_0xefde('0x1b')]));});});};exports[_0xefde('0x26')]=function(_0xad7430){return new Promise(function(_0x527861,_0x2caaec){return db[_0xefde('0x1f')][_0xefde('0x27')]({'where':_0xad7430[_0xefde('0x21')]?_0xad7430['options'][_0xefde('0x23')]||null:null})[_0xefde('0x28')](function(_0x102838){if(_0x102838){return _0x102838['addTags'](_0xad7430['body'][_0xefde('0x29')],_[_0xefde('0x2a')](_0xad7430[_0xefde('0x20')],[_0xefde('0x29'),'id'])||{});}})['spread'](function(_0x18e4d3){logger['info']('AddTags',_0xad7430);logger['debug'](_0xefde('0x2b'),_0xad7430,JSON['stringify'](_0x18e4d3));_0x527861(_0x18e4d3);})['catch'](function(_0x2a7434){logger[_0xefde('0x19')]('AddTags',_0x2a7434[_0xefde('0x1b')],_0xad7430);_0x2caaec(_this['error'](0x1f4,_0x2a7434[_0xefde('0x1b')]));});});}; \ No newline at end of file +var _0x0b4e=['options','raw','where','limit','UpdateWhatsappInteraction','find','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','WhatsappInteraction','update'];(function(_0x275ac7,_0x8aaea9){var _0x3c44ab=function(_0x3a7b6e){while(--_0x3a7b6e){_0x275ac7['push'](_0x275ac7['shift']());}};_0x3c44ab(++_0x8aaea9);}(_0x0b4e,0x1b8));var _0xe0b4=function(_0x240fa4,_0x5e728b){_0x240fa4=_0x240fa4-0x0;var _0x319cc7=_0x0b4e[_0x240fa4];return _0x319cc7;};'use strict';var _=require(_0xe0b4('0x0'));var util=require(_0xe0b4('0x1'));var moment=require(_0xe0b4('0x2'));var BPromise=require(_0xe0b4('0x3'));var rs=require(_0xe0b4('0x4'));var fs=require('fs');var Redis=require(_0xe0b4('0x5'));var db=require(_0xe0b4('0x6'))['db'];var utils=require(_0xe0b4('0x7'));var logger=require(_0xe0b4('0x8'))(_0xe0b4('0x9'));var config=require('../../config/environment');var jayson=require(_0xe0b4('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xe0b4('0xb')]=_[_0xe0b4('0xc')](config[_0xe0b4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b4('0xd'))(new Redis(config[_0xe0b4('0xb')]));require(_0xe0b4('0xe'))['register'](socket);function respondWithRpcPromise(_0x398e25,_0x5edfee,_0x4d0dcd){return new BPromise(function(_0xaa4760,_0x43130f){return client['request'](_0x398e25,_0x4d0dcd)[_0xe0b4('0xf')](function(_0x47d0f6){logger[_0xe0b4('0x10')](_0xe0b4('0x11'),_0x5edfee,'request\x20sent');logger[_0xe0b4('0x12')](_0xe0b4('0x13'),_0x5edfee,_0xe0b4('0x14'),JSON[_0xe0b4('0x15')](_0x47d0f6));if(_0x47d0f6[_0xe0b4('0x16')]){if(_0x47d0f6[_0xe0b4('0x16')]['code']===0x1f4){logger['error'](_0xe0b4('0x11'),_0x5edfee,_0x47d0f6[_0xe0b4('0x16')][_0xe0b4('0x17')]);return _0x43130f(_0x47d0f6['error'][_0xe0b4('0x17')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x5edfee,_0x47d0f6[_0xe0b4('0x16')]['message']);return _0xaa4760(_0x47d0f6['error'][_0xe0b4('0x17')]);}else{logger[_0xe0b4('0x10')](_0xe0b4('0x11'),_0x5edfee,_0xe0b4('0x14'));_0xaa4760(_0x47d0f6[_0xe0b4('0x18')]['message']);}})[_0xe0b4('0x19')](function(_0x1ff75f){logger[_0xe0b4('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x5edfee,_0x1ff75f);_0x43130f(_0x1ff75f);});});}exports['UpdateWhatsappInteraction']=function(_0x1ca5ff){var _0x38421f=this;return new Promise(function(_0x2b0beb,_0x3fe00b){return db[_0xe0b4('0x1a')][_0xe0b4('0x1b')](_0x1ca5ff['body'],{'raw':_0x1ca5ff['options']?_0x1ca5ff[_0xe0b4('0x1c')][_0xe0b4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca5ff[_0xe0b4('0x1c')]?_0x1ca5ff['options'][_0xe0b4('0x1e')]||null:null,'attributes':_0x1ca5ff[_0xe0b4('0x1c')]?_0x1ca5ff[_0xe0b4('0x1c')]['attributes']||null:null,'limit':_0x1ca5ff['options']?_0x1ca5ff[_0xe0b4('0x1c')][_0xe0b4('0x1f')]||null:null})[_0xe0b4('0xf')](function(_0x372aa9){logger['info']('UpdateWhatsappInteraction',_0x1ca5ff);logger[_0xe0b4('0x12')](_0xe0b4('0x20'),_0x1ca5ff,JSON[_0xe0b4('0x15')](_0x372aa9));_0x2b0beb(_0x372aa9);})['catch'](function(_0x2de1bf){logger[_0xe0b4('0x16')](_0xe0b4('0x20'),_0x2de1bf['message'],_0x1ca5ff);_0x3fe00b(_0x38421f['error'](0x1f4,_0x2de1bf['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x327da3){return new Promise(function(_0x51d5b3,_0x1f89c3){return db['WhatsappInteraction'][_0xe0b4('0x21')]({'where':_0x327da3[_0xe0b4('0x1c')]?_0x327da3['options'][_0xe0b4('0x1e')]||null:null})[_0xe0b4('0xf')](function(_0x89d397){if(_0x89d397){return _0x89d397['addTags'](_0x327da3[_0xe0b4('0x22')][_0xe0b4('0x23')],_[_0xe0b4('0x24')](_0x327da3[_0xe0b4('0x22')],[_0xe0b4('0x23'),'id'])||{});}})[_0xe0b4('0x25')](function(_0x4237a7){logger[_0xe0b4('0x10')]('AddTags',_0x327da3);logger['debug'](_0xe0b4('0x26'),_0x327da3,JSON['stringify'](_0x4237a7));_0x51d5b3(_0x4237a7);})[_0xe0b4('0x19')](function(_0x5592bc){logger[_0xe0b4('0x16')](_0xe0b4('0x26'),_0x5592bc[_0xe0b4('0x17')],_0x327da3);_0x1f89c3(_this[_0xe0b4('0x16')](0x1f4,_0x5592bc[_0xe0b4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 584f2f6..aa432f8 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 _0xe2b9=['removeListener','register','length','./whatsappInteraction.events','save','remove','update'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0xe2b9,0xdc));var _0x9e2b=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xe2b9[_0x36f47c];return _0x296c55;};'use strict';var WhatsappInteractionEvents=require(_0x9e2b('0x0'));var events=[_0x9e2b('0x1'),_0x9e2b('0x2'),_0x9e2b('0x3')];function createListener(_0x4a47a2,_0x19832a){return function(_0x79dc1e){_0x19832a['emit'](_0x4a47a2,_0x79dc1e);};}function removeListener(_0x3a3fe7,_0x31e6d6){return function(){WhatsappInteractionEvents[_0x9e2b('0x4')](_0x3a3fe7,_0x31e6d6);};}exports[_0x9e2b('0x5')]=function(_0x373320){for(var _0x5da6d2=0x0,_0x36d14e=events[_0x9e2b('0x6')];_0x5da6d2<_0x36d14e;_0x5da6d2++){var _0x65dca2=events[_0x5da6d2];var _0x392a98=createListener('whatsappInteraction:'+_0x65dca2,_0x373320);WhatsappInteractionEvents['on'](_0x65dca2,_0x392a98);}}; \ No newline at end of file +var _0xd61a=['emit','register','length','./whatsappInteraction.events','save'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xd61a,0x15c));var _0xad61=function(_0x2c94a5,_0x128193){_0x2c94a5=_0x2c94a5-0x0;var _0x472eac=_0xd61a[_0x2c94a5];return _0x472eac;};'use strict';var WhatsappInteractionEvents=require(_0xad61('0x0'));var events=[_0xad61('0x1'),'remove','update'];function createListener(_0xa9834,_0x37de9f){return function(_0x1f4450){_0x37de9f[_0xad61('0x2')](_0xa9834,_0x1f4450);};}function removeListener(_0x2112bf,_0xf306c6){return function(){WhatsappInteractionEvents['removeListener'](_0x2112bf,_0xf306c6);};}exports[_0xad61('0x3')]=function(_0x372a2d){for(var _0x585f73=0x0,_0x1b9d36=events[_0xad61('0x4')];_0x585f73<_0x1b9d36;_0x585f73++){var _0xc4066d=events[_0x585f73];var _0x3e828c=createListener('whatsappInteraction:'+_0xc4066d,_0x372a2d);WhatsappInteractionEvents['on'](_0xc4066d,_0x3e828c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 91e49d6..9defab7 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 _0x9533=['/describe','/:id','post','whatsappmessage:create','create','/:id/status','status','put','/:id/accept','accept','reject','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1e15ea,_0x15ff8d){var _0x277c0b=function(_0x2fbc86){while(--_0x2fbc86){_0x1e15ea['push'](_0x1e15ea['shift']());}};_0x277c0b(++_0x15ff8d);}(_0x9533,0xe8));var _0x3953=function(_0x3e76f9,_0x5711b4){_0x3e76f9=_0x3e76f9-0x0;var _0x6b51bd=_0x9533[_0x3e76f9];return _0x6b51bd;};'use strict';var multer=require(_0x3953('0x0'));var util=require(_0x3953('0x1'));var path=require(_0x3953('0x2'));var timeout=require(_0x3953('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3953('0x4'));var auth=require(_0x3953('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3953('0x6'));var controller=require('./whatsappMessage.controller');router[_0x3953('0x7')]('/',auth[_0x3953('0x8')](),controller[_0x3953('0x9')]);router[_0x3953('0x7')](_0x3953('0xa'),auth[_0x3953('0x8')](),controller['describe']);router[_0x3953('0x7')](_0x3953('0xb'),auth[_0x3953('0x8')](),controller['show']);router[_0x3953('0xc')]('/',auth[_0x3953('0x8')](),interaction['tracked']('whatsapp',_0x3953('0xd')),controller[_0x3953('0xe')]);router[_0x3953('0xc')](_0x3953('0xf'),controller[_0x3953('0x10')]);router[_0x3953('0x11')]('/:id',auth[_0x3953('0x8')](),controller['update']);router[_0x3953('0x11')](_0x3953('0x12'),auth[_0x3953('0x8')](),controller[_0x3953('0x13')]);router['put']('/:id/reject',auth[_0x3953('0x8')](),controller[_0x3953('0x14')]);router[_0x3953('0x15')](_0x3953('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x36b8=['isAuthenticated','/describe','get','/:id','show','post','tracked','whatsappmessage:create','status','put','update','/:id/accept','accept','reject','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappMessage.controller'];(function(_0x290ee1,_0x6834e5){var _0x2ef2ff=function(_0x163a89){while(--_0x163a89){_0x290ee1['push'](_0x290ee1['shift']());}};_0x2ef2ff(++_0x6834e5);}(_0x36b8,0x10c));var _0x836b=function(_0x4d7a5a,_0x563dcc){_0x4d7a5a=_0x4d7a5a-0x0;var _0x1eea32=_0x36b8[_0x4d7a5a];return _0x1eea32;};'use strict';var multer=require(_0x836b('0x0'));var util=require('util');var path=require(_0x836b('0x1'));var timeout=require(_0x836b('0x2'));var express=require(_0x836b('0x3'));var router=express[_0x836b('0x4')]();var fs_extra=require(_0x836b('0x5'));var auth=require(_0x836b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x836b('0x7'));router['get']('/',auth[_0x836b('0x8')](),controller['index']);router['get'](_0x836b('0x9'),auth[_0x836b('0x8')](),controller['describe']);router[_0x836b('0xa')](_0x836b('0xb'),auth[_0x836b('0x8')](),controller[_0x836b('0xc')]);router[_0x836b('0xd')]('/',auth[_0x836b('0x8')](),interaction[_0x836b('0xe')]('whatsapp',_0x836b('0xf')),controller['create']);router[_0x836b('0xd')]('/:id/status',controller[_0x836b('0x10')]);router[_0x836b('0x11')](_0x836b('0xb'),auth['isAuthenticated'](),controller[_0x836b('0x12')]);router[_0x836b('0x11')](_0x836b('0x13'),auth['isAuthenticated'](),controller[_0x836b('0x14')]);router['put']('/:id/reject',auth[_0x836b('0x8')](),controller[_0x836b('0x15')]);router['delete']('/:id',auth[_0x836b('0x8')](),controller['destroy']);module[_0x836b('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 881ae14..a609eda 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 _0xe68b=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x41cfc3,_0x126ba5){var _0x231fd1=function(_0x20c883){while(--_0x20c883){_0x41cfc3['push'](_0x41cfc3['shift']());}};_0x231fd1(++_0x126ba5);}(_0xe68b,0x6d));var _0xbe68=function(_0x236980,_0x1ab39f){_0x236980=_0x236980-0x0;var _0x521aab=_0xe68b[_0x236980];return _0x521aab;};'use strict';var Sequelize=require(_0xbe68('0x0'));module[_0xbe68('0x1')]={'body':{'type':Sequelize[_0xbe68('0x2')](_0xbe68('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe68('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe68('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbe68('0x6')](0xbe)},'phone':{'type':Sequelize[_0xbe68('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xbe68('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbe68('0x6')]},'providerResponse':{'type':Sequelize[_0xbe68('0x2')]}}; \ No newline at end of file +var _0x0082=['STRING','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x91ecd1,_0x1170ae){var _0x252230=function(_0x9e6a60){while(--_0x9e6a60){_0x91ecd1['push'](_0x91ecd1['shift']());}};_0x252230(++_0x1170ae);}(_0x0082,0x73));var _0x2008=function(_0x2464c7,_0xed8be){_0x2464c7=_0x2464c7-0x0;var _0x5a52a7=_0x0082[_0x2464c7];return _0x5a52a7;};'use strict';var Sequelize=require(_0x2008('0x0'));module['exports']={'body':{'type':Sequelize[_0x2008('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2008('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2008('0x3')]('in',_0x2008('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2008('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2008('0x5')]},'providerResponse':{'type':Sequelize[_0x2008('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 3d29db0..94b5cb3 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 _0xa884=['api','../../config/utils','../../config/environment','defaults','redis','localhost','./whatsappMessage.socket','register','http','client','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','name','index','WhatsappMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','fields','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','SIP/%s','channel','EventManager','WhatsappInteraction','rejectMessage','contact','User','motionChannel','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x347678,_0x9ddec4){var _0x3b08cc=function(_0x513dbe){while(--_0x513dbe){_0x347678['push'](_0x347678['shift']());}};_0x3b08cc(++_0x9ddec4);}(_0xa884,0x182));var _0x4a88=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0xa884[_0x2df1f2];return _0x38652b;};'use strict';var emlformat=require(_0x4a88('0x0'));var rimraf=require(_0x4a88('0x1'));var zipdir=require(_0x4a88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a88('0x3'));var moment=require(_0x4a88('0x4'));var BPromise=require(_0x4a88('0x5'));var Mustache=require(_0x4a88('0x6'));var util=require(_0x4a88('0x7'));var path=require(_0x4a88('0x8'));var sox=require('sox');var csv=require(_0x4a88('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a88('0xa'));var squel=require('squel');var crypto=require(_0x4a88('0xb'));var jsforce=require(_0x4a88('0xc'));var deskjs=require(_0x4a88('0xd'));var toCsv=require(_0x4a88('0x9'));var querystring=require(_0x4a88('0xe'));var Papa=require(_0x4a88('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a88('0x10'));var as=require(_0x4a88('0x11'));var hardwareService=require(_0x4a88('0x12'));var logger=require('../../config/logger')(_0x4a88('0x13'));var utils=require(_0x4a88('0x14'));var config=require(_0x4a88('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4a88('0x16')](config[_0x4a88('0x17')],{'host':_0x4a88('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a88('0x17')]));require(_0x4a88('0x19'))[_0x4a88('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4a88('0x1b')]({'port':0x232c});var client9002=jayson[_0x4a88('0x1c')][_0x4a88('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x28e54d,_0x4220f6,_0x5569b4,_0x4a8ab1){return new BPromise(function(_0x20f84a,_0x5cb531){var _0x2927da=_0x4a8ab1||client;return _0x2927da[_0x4a88('0x1d')](_0x28e54d,_0x5569b4)[_0x4a88('0x1e')](function(_0x1551e4){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4220f6,_0x4a88('0x1f'));logger[_0x4a88('0x20')](_0x4a88('0x21'),_0x4220f6,_0x4a88('0x1f'),JSON[_0x4a88('0x22')](_0x1551e4));if(_0x1551e4[_0x4a88('0x23')]){if(_0x1551e4[_0x4a88('0x23')][_0x4a88('0x24')]===0x1f4){logger['error'](_0x4a88('0x25'),_0x4220f6,_0x1551e4[_0x4a88('0x23')][_0x4a88('0x26')]);return _0x5cb531(_0x1551e4['error'][_0x4a88('0x26')]);}logger[_0x4a88('0x23')](_0x4a88('0x25'),_0x4220f6,_0x1551e4['error'][_0x4a88('0x26')]);return _0x20f84a(_0x1551e4[_0x4a88('0x23')][_0x4a88('0x26')]);}else{logger['info'](_0x4a88('0x25'),_0x4220f6,_0x4a88('0x1f'));_0x20f84a(_0x1551e4[_0x4a88('0x27')][_0x4a88('0x26')]);}})[_0x4a88('0x28')](function(_0x5b2d60){logger[_0x4a88('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x4220f6,_0x5b2d60);_0x5cb531(_0x5b2d60);});});}function respondWithStatusCode(_0x19de19,_0x39d24c){_0x39d24c=_0x39d24c||0xcc;return function(_0x16beaf){if(_0x16beaf){return _0x19de19[_0x4a88('0x29')](_0x39d24c);}return _0x19de19['status'](_0x39d24c)['end']();};}function respondWithResult(_0x4ed8b9,_0x45d550){_0x45d550=_0x45d550||0xc8;return function(_0x302f5d){if(_0x302f5d){return _0x4ed8b9[_0x4a88('0x2a')](_0x45d550)[_0x4a88('0x2b')](_0x302f5d);}};}function respondWithFilteredResult(_0x3d8d63,_0x107822){return function(_0x15a072){if(_0x15a072){var _0x1127d5=typeof _0x107822['offset']==='undefined'&&typeof _0x107822[_0x4a88('0x2c')]===_0x4a88('0x2d');var _0x1e5f12=_0x15a072[_0x4a88('0x2e')];var _0xb46a8=_0x1127d5?0x0:_0x107822[_0x4a88('0x2f')];var _0x4df88f=_0x1127d5?_0x15a072[_0x4a88('0x2e')]:_0x107822[_0x4a88('0x2f')]+_0x107822['limit'];var _0x390380;if(_0x4df88f>=_0x1e5f12){_0x4df88f=_0x1e5f12;_0x390380=0xc8;}else{_0x390380=0xce;}_0x3d8d63[_0x4a88('0x2a')](_0x390380);return _0x3d8d63[_0x4a88('0x30')](_0x4a88('0x31'),_0xb46a8+'-'+_0x4df88f+'/'+_0x1e5f12)[_0x4a88('0x2b')](_0x15a072);}return null;};}function patchUpdates(_0xf025cc){return function(_0x138ff4){try{jsonpatch[_0x4a88('0x32')](_0x138ff4,_0xf025cc,!![]);}catch(_0x44a6ee){return BPromise[_0x4a88('0x33')](_0x44a6ee);}return _0x138ff4['save']();};}function saveUpdates(_0x533a13,_0x2b26d1){return function(_0x278047){if(_0x278047){return _0x278047[_0x4a88('0x34')](_0x533a13)[_0x4a88('0x1e')](function(_0x34e820){return _0x34e820;});}return null;};}function removeEntity(_0xfe97bf,_0x2056ff){return function(_0xa70d84){if(_0xa70d84){return _0xa70d84[_0x4a88('0x35')]()[_0x4a88('0x1e')](function(){_0xfe97bf[_0x4a88('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5e65,_0x3538a9){return function(_0x4a2536){if(!_0x4a2536){_0x3c5e65[_0x4a88('0x29')](0x194);}return _0x4a2536;};}function handleError(_0x5b1eea,_0x596740){_0x596740=_0x596740||0x1f4;return function(_0x4fec81){logger[_0x4a88('0x23')](_0x4fec81['stack']);if(_0x4fec81[_0x4a88('0x36')]){delete _0x4fec81['name'];}_0x5b1eea[_0x4a88('0x2a')](_0x596740)['send'](_0x4fec81);};}exports[_0x4a88('0x37')]=function(_0x44efe5,_0x33e5bb){var _0x58ab80={},_0x5e5db9={},_0x501b19={'count':0x0,'rows':[]};var _0x5aa691=_['map'](db[_0x4a88('0x38')][_0x4a88('0x39')],function(_0x2d4d34){return{'name':_0x2d4d34['fieldName'],'type':_0x2d4d34[_0x4a88('0x3a')][_0x4a88('0x3b')]};});_0x5e5db9[_0x4a88('0x3c')]=_[_0x4a88('0x3d')](_0x5aa691,_0x4a88('0x36'));_0x5e5db9[_0x4a88('0x3e')]=_[_0x4a88('0x3f')](_0x44efe5['query']);_0x5e5db9[_0x4a88('0x40')]=_[_0x4a88('0x41')](_0x5e5db9[_0x4a88('0x3c')],_0x5e5db9['query']);_0x58ab80[_0x4a88('0x42')]=_[_0x4a88('0x41')](_0x5e5db9[_0x4a88('0x3c')],qs['fields'](_0x44efe5[_0x4a88('0x3e')]['fields']));_0x58ab80[_0x4a88('0x42')]=_0x58ab80[_0x4a88('0x42')][_0x4a88('0x43')]?_0x58ab80[_0x4a88('0x42')]:_0x5e5db9[_0x4a88('0x3c')];if(!_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x44')](_0x4a88('0x45'))){_0x58ab80[_0x4a88('0x2c')]=qs[_0x4a88('0x2c')](_0x44efe5['query'][_0x4a88('0x2c')]);_0x58ab80['offset']=qs[_0x4a88('0x2f')](_0x44efe5['query'][_0x4a88('0x2f')]);}_0x58ab80[_0x4a88('0x46')]=qs[_0x4a88('0x47')](_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x47')]);_0x58ab80[_0x4a88('0x48')]=qs[_0x4a88('0x40')](_[_0x4a88('0x49')](_0x44efe5[_0x4a88('0x3e')],_0x5e5db9[_0x4a88('0x40')]),_0x5aa691);if(_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x4a')]){_0x58ab80['where']=_[_0x4a88('0x4b')](_0x58ab80[_0x4a88('0x48')],{'$or':_[_0x4a88('0x3d')](_0x5aa691,function(_0xd4f649){if(_0xd4f649['type']!==_0x4a88('0x4c')){var _0x39ff03={};_0x39ff03[_0xd4f649[_0x4a88('0x36')]]={'$like':'%'+_0x44efe5[_0x4a88('0x3e')]['filter']+'%'};return _0x39ff03;}})});}_0x58ab80=_[_0x4a88('0x4b')]({},_0x58ab80,_0x44efe5[_0x4a88('0x4d')]);var _0xe7b2a4={'where':_0x58ab80[_0x4a88('0x48')]};return db[_0x4a88('0x38')][_0x4a88('0x2e')](_0xe7b2a4)[_0x4a88('0x1e')](function(_0x236258){_0x501b19[_0x4a88('0x2e')]=_0x236258;if(_0x44efe5[_0x4a88('0x3e')][_0x4a88('0x4e')]){_0x58ab80[_0x4a88('0x4f')]=[{'all':!![]}];}return db[_0x4a88('0x38')][_0x4a88('0x50')](_0x58ab80);})['then'](function(_0x135421){_0x501b19[_0x4a88('0x51')]=_0x135421;return _0x501b19;})[_0x4a88('0x1e')](respondWithFilteredResult(_0x33e5bb,_0x58ab80))['catch'](handleError(_0x33e5bb,null));};exports['show']=function(_0x3a894d,_0x11f45b){var _0xae7bab={'raw':!![],'where':{'id':_0x3a894d[_0x4a88('0x52')]['id']}},_0x485153={};_0x485153[_0x4a88('0x3c')]=_[_0x4a88('0x3f')](db[_0x4a88('0x38')][_0x4a88('0x39')]);_0x485153['query']=_['keys'](_0x3a894d[_0x4a88('0x3e')]);_0x485153[_0x4a88('0x40')]=_[_0x4a88('0x41')](_0x485153[_0x4a88('0x3c')],_0x485153['query']);_0xae7bab['attributes']=_[_0x4a88('0x41')](_0x485153['model'],qs[_0x4a88('0x53')](_0x3a894d[_0x4a88('0x3e')][_0x4a88('0x53')]));_0xae7bab['attributes']=_0xae7bab[_0x4a88('0x42')][_0x4a88('0x43')]?_0xae7bab['attributes']:_0x485153['model'];if(_0x3a894d[_0x4a88('0x3e')][_0x4a88('0x4e')]){_0xae7bab[_0x4a88('0x4f')]=[{'all':!![]}];}_0xae7bab=_[_0x4a88('0x4b')]({},_0xae7bab,_0x3a894d[_0x4a88('0x4d')]);return db[_0x4a88('0x38')][_0x4a88('0x54')](_0xae7bab)[_0x4a88('0x1e')](handleEntityNotFound(_0x11f45b,null))[_0x4a88('0x1e')](respondWithResult(_0x11f45b,null))['catch'](handleError(_0x11f45b,null));};exports[_0x4a88('0x55')]=function(_0x517412,_0x20ceca){return db[_0x4a88('0x38')][_0x4a88('0x55')](_0x517412[_0x4a88('0x56')],{})['then'](respondWithResult(_0x20ceca,0xc9))['catch'](handleError(_0x20ceca,null));};exports['update']=function(_0x8938d7,_0x58cd3b){if(_0x8938d7[_0x4a88('0x56')]['id']){delete _0x8938d7[_0x4a88('0x56')]['id'];}return db[_0x4a88('0x38')]['find']({'where':{'id':_0x8938d7[_0x4a88('0x52')]['id']}})['then'](handleEntityNotFound(_0x58cd3b,null))[_0x4a88('0x1e')](saveUpdates(_0x8938d7['body'],null))['then'](respondWithResult(_0x58cd3b,null))[_0x4a88('0x28')](handleError(_0x58cd3b,null));};exports[_0x4a88('0x35')]=function(_0xe01e4,_0x150c7f){return db[_0x4a88('0x38')][_0x4a88('0x54')]({'where':{'id':_0xe01e4['params']['id']}})[_0x4a88('0x1e')](handleEntityNotFound(_0x150c7f,null))['then'](removeEntity(_0x150c7f,null))[_0x4a88('0x28')](handleError(_0x150c7f,null));};exports['describe']=function(_0x1d5678,_0x5ac164){return db['WhatsappMessage'][_0x4a88('0x57')]()[_0x4a88('0x1e')](respondWithResult(_0x5ac164,null))[_0x4a88('0x28')](handleError(_0x5ac164,null));};var interaction_log=require(_0x4a88('0x58'))(_0x4a88('0x59'));exports[_0x4a88('0x5a')]=function(_0x4578ad,_0x1d7a53,_0x3da596){var _0x1073f9={'agent':{},'channel':_0x4a88('0x5b')};if(_0x4578ad[_0x4a88('0x56')]['id']){delete _0x4578ad[_0x4a88('0x56')]['id'];}_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5c')]=!![];_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5d')]=moment()[_0x4a88('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')]=_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')]||_0x4578ad[_0x4a88('0x60')]['id'];_0x1073f9[_0x4a88('0x61')]['id']=_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')];return db[_0x4a88('0x38')]['find']({'where':{'id':_0x4578ad['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d7a53,null))['then'](saveUpdates(_0x4578ad[_0x4a88('0x56')],null))[_0x4a88('0x1e')](function(_0x263764){if(_0x263764){_0x1073f9[_0x4a88('0x26')]=_0x263764[_0x4a88('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x4a88('0x54')]({'where':{'id':_0x263764[_0x4a88('0x63')]}});}return null;})[_0x4a88('0x1e')](handleEntityNotFound(_0x1d7a53,null))[_0x4a88('0x1e')](function(_0x3f4ba7){if(_0x3f4ba7){return _0x3f4ba7[_0x4a88('0x34')]({'UserId':_0x4578ad[_0x4a88('0x56')]['UserId'],'read1stAt':_[_0x4a88('0x64')](_0x3f4ba7[_0x4a88('0x65')])?moment()['format'](_0x4a88('0x66')):undefined});}return null;})[_0x4a88('0x1e')](function(_0x4f5006){if(_0x4f5006){_0x1073f9[_0x4a88('0x67')]=_0x4f5006[_0x4a88('0x62')]({'plain':!![]});interaction_log[_0x4a88('0x68')](_0x4a88('0x69'),_0x4578ad[_0x4a88('0x60')]['id'],_0x4578ad[_0x4a88('0x60')]['name'],_0x4578ad[_0x4a88('0x60')]['role'],_0x1073f9[_0x4a88('0x67')]['id'],_0x4578ad['body']?JSON['stringify'](_0x4578ad[_0x4a88('0x56')]):_0x4a88('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x4a88('0x6b'),_0x1073f9);}return null;})[_0x4a88('0x1e')](function(_0x50ea2c){var _0x40a1d5=_0x4a88('0x6c')+_0x50ea2c[_0x4a88('0x26')][_0x4a88('0x6d')];return db[_0x4a88('0x6e')][_0x4a88('0x3e')](_0x40a1d5,{'type':db['Sequelize'][_0x4a88('0x6f')][_0x4a88('0x70')],'raw':!![]})[_0x4a88('0x1e')](function(_0x67d5d8){return _0x67d5d8;});})[_0x4a88('0x1e')](function(_0x1d9777){if(_0x1d9777){_0x1073f9[_0x4a88('0x26')]['contact']=_0x1d9777[0x0];if(!_0x4578ad[_0x4a88('0x56')]['UserId'])return;return db['User'][_0x4a88('0x54')]({'where':{'id':_0x4578ad[_0x4a88('0x56')][_0x4a88('0x5f')],'role':_0x4a88('0x61')},'attributes':['id','name',_0x4a88('0x71'),_0x4a88('0x72'),_0x4a88('0x73')],'raw':!![]});}return null;})['then'](function(_0x5583d0){if(!_0x5583d0)return null;_0x1073f9[_0x4a88('0x26')][_0x4a88('0x61')]=_0x5583d0;return _0x1073f9;})['then'](function(_0x286767){if(_0x286767){if(_0x4578ad['body'][_0x4a88('0x74')]){_0x1073f9[_0x4a88('0x26')]['interface']=util[_0x4a88('0x5e')](_0x4a88('0x75'),_0x4578ad[_0x4a88('0x60')][_0x4a88('0x36')]);_0x1073f9[_0x4a88('0x26')][_0x4a88('0x76')]=_0x1073f9[_0x4a88('0x76')];_0x1073f9[_0x4a88('0x26')]['motionChannel']=_0x1073f9['channel'];_0x1073f9[_0x4a88('0x26')]['event']=_0x4a88('0x5a');return respondWithRpcPromise(_0x4a88('0x77'),_0x4a88('0x77'),{'event':'acceptmessage','message':_0x1073f9[_0x4a88('0x26')]},client9002)['then'](function(){return _0x1073f9;});}return _0x1073f9;}return null;})[_0x4a88('0x1e')](respondWithResult(_0x1d7a53,null))['catch'](handleError(_0x1d7a53,null));};var interaction_log=require(_0x4a88('0x58'))('whatsapp-interactions');exports['reject']=function(_0x1b4e91,_0x5579d0,_0x269dc4){var _0x460f5a={'agent':{},'channel':_0x4a88('0x5b')};if(_0x1b4e91[_0x4a88('0x56')]['id']){delete _0x1b4e91[_0x4a88('0x56')]['id'];}_0x1b4e91['body'][_0x4a88('0x5f')]=_0x1b4e91[_0x4a88('0x56')]['UserId']||_0x1b4e91[_0x4a88('0x60')]['id'];_0x460f5a[_0x4a88('0x61')]['id']=_0x1b4e91[_0x4a88('0x56')][_0x4a88('0x5f')];return db[_0x4a88('0x38')][_0x4a88('0x54')]({'where':{'id':_0x1b4e91[_0x4a88('0x52')]['id'],'UserId':null}})[_0x4a88('0x1e')](handleEntityNotFound(_0x5579d0,null))[_0x4a88('0x1e')](function(_0x449cbe){if(_0x449cbe){_0x460f5a[_0x4a88('0x26')]=_0x449cbe[_0x4a88('0x62')]({'plain':!![]});return db[_0x4a88('0x78')][_0x4a88('0x54')]({'where':{'id':_0x449cbe[_0x4a88('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x5579d0,null))[_0x4a88('0x1e')](function(_0x442cbc){if(_0x442cbc){_0x460f5a[_0x4a88('0x67')]=_0x442cbc[_0x4a88('0x62')]({'plain':!![]});interaction_log[_0x4a88('0x68')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b4e91[_0x4a88('0x60')]['id'],_0x1b4e91['user']['name'],_0x1b4e91[_0x4a88('0x60')]['role'],_0x460f5a[_0x4a88('0x67')]['id'],_0x1b4e91[_0x4a88('0x56')]?JSON['stringify'](_0x1b4e91['body']):_0x4a88('0x6a'));return respondWithRpcPromise('RejectMessage',_0x4a88('0x79'),_0x460f5a);}return null;})['then'](function(_0x46a2e6){var _0x44941e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46a2e6['message'][_0x4a88('0x6d')];return db[_0x4a88('0x6e')][_0x4a88('0x3e')](_0x44941e,{'type':db['Sequelize'][_0x4a88('0x6f')][_0x4a88('0x70')],'raw':!![]})[_0x4a88('0x1e')](function(_0xa65766){return _0xa65766;});})['then'](function(_0x2fff10){if(_0x2fff10){_0x460f5a[_0x4a88('0x26')][_0x4a88('0x7a')]=_0x2fff10[0x0];if(!_0x1b4e91[_0x4a88('0x56')][_0x4a88('0x5f')])return;return db[_0x4a88('0x7b')][_0x4a88('0x54')]({'where':{'id':_0x1b4e91['body'][_0x4a88('0x5f')],'role':_0x4a88('0x61')},'attributes':['id','name',_0x4a88('0x71'),_0x4a88('0x72'),_0x4a88('0x73')],'raw':!![]});}return null;})[_0x4a88('0x1e')](function(_0x2f4155){if(!_0x2f4155)return null;_0x460f5a[_0x4a88('0x26')]['agent']=_0x2f4155;return _0x460f5a;})[_0x4a88('0x1e')](function(_0x54319a){if(_0x54319a){_0x54319a[_0x4a88('0x26')]['interface']=util[_0x4a88('0x5e')]('SIP/%s',_0x1b4e91[_0x4a88('0x60')][_0x4a88('0x36')]);_0x54319a['message'][_0x4a88('0x76')]=_0x460f5a['channel'];_0x54319a['message'][_0x4a88('0x7c')]=_0x460f5a[_0x4a88('0x76')];_0x54319a[_0x4a88('0x26')]['event']=_0x4a88('0x33');respondWithRpcPromise('EventManager',_0x4a88('0x77'),{'event':'rejectmessage','message':_0x54319a[_0x4a88('0x26')]},client9002);return _0x460f5a;}return null;})['then'](respondWithResult(_0x5579d0,null))[_0x4a88('0x28')](handleError(_0x5579d0,null));};exports[_0x4a88('0x2a')]=function(_0x4198b1,_0xfe612b,_0x1ee4dc){if(_0x4198b1[_0x4a88('0x56')]['id']){delete _0x4198b1[_0x4a88('0x56')]['id'];}var _0x46fc2d;return db[_0x4a88('0x38')]['find']({'where':{'id':_0x4198b1[_0x4a88('0x52')]['id']}})[_0x4a88('0x1e')](handleEntityNotFound(_0xfe612b,null))[_0x4a88('0x1e')](function(_0x1781ae){if(_0x1781ae){_0x46fc2d=_0x1781ae;return db[_0x4a88('0x7d')][_0x4a88('0x54')]({'where':{'id':_0x1781ae[_0x4a88('0x7e')]}});}})[_0x4a88('0x1e')](handleEntityNotFound(_0xfe612b,null))['then'](function(_0x4ec0f6){if(_0x4ec0f6){logger['debug'](_0x4a88('0x7f'),_0x4a88('0x2a'),_0x4a88('0x80'),_0x4ec0f6[_0x4a88('0x3a')],util[_0x4a88('0x81')](_0x4198b1[_0x4a88('0x56')],{'showHidden':![],'depth':null}));switch(_0x4ec0f6[_0x4a88('0x3a')]){case _0x4a88('0x82'):if(_0x4198b1['body']['MessageSid']&&_0x4198b1[_0x4a88('0x56')][_0x4a88('0x83')]===_0x46fc2d[_0x4a88('0x84')]&&_0x4198b1[_0x4a88('0x56')][_0x4a88('0x85')]&&_0x4198b1['body'][_0x4a88('0x85')]==='read'){return _0x46fc2d[_0x4a88('0x34')]({'read':!![]});}else{logger[_0x4a88('0x23')](_0x4a88('0x86'),_0x4a88('0x2a'),'twilio',util[_0x4a88('0x81')](_0x4198b1[_0x4a88('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x46fc2d;}})[_0x4a88('0x1e')](respondWithResult(_0xfe612b,null))[_0x4a88('0x28')](handleError(_0xfe612b,null));}; \ No newline at end of file +var _0x2f52=['format','UserId','user','agent','get','WhatsappInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','reject','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','email','interface','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','offset','set','apply','save','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','WhatsappMessage','count','includeAll','findAll','rows','show','create','body','find','params','describe','../../config/logger','accept','read','readAt'];(function(_0x560a4b,_0x3021be){var _0x3eb8ca=function(_0x3015b2){while(--_0x3015b2){_0x560a4b['push'](_0x560a4b['shift']());}};_0x3eb8ca(++_0x3021be);}(_0x2f52,0x142));var _0x22f5=function(_0x553375,_0x3c8065){_0x553375=_0x553375-0x0;var _0x507274=_0x2f52[_0x553375];return _0x507274;};'use strict';var emlformat=require(_0x22f5('0x0'));var rimraf=require(_0x22f5('0x1'));var zipdir=require(_0x22f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x22f5('0x3'));var util=require('util');var path=require('path');var sox=require(_0x22f5('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22f5('0x5'));var _=require(_0x22f5('0x6'));var squel=require(_0x22f5('0x7'));var crypto=require(_0x22f5('0x8'));var jsforce=require(_0x22f5('0x9'));var deskjs=require(_0x22f5('0xa'));var toCsv=require('to-csv');var querystring=require(_0x22f5('0xb'));var Papa=require(_0x22f5('0xc'));var Redis=require(_0x22f5('0xd'));var authService=require(_0x22f5('0xe'));var qs=require(_0x22f5('0xf'));var as=require(_0x22f5('0x10'));var hardwareService=require(_0x22f5('0x11'));var logger=require('../../config/logger')(_0x22f5('0x12'));var utils=require(_0x22f5('0x13'));var config=require(_0x22f5('0x14'));var licenseUtil=require(_0x22f5('0x15'));var db=require('../../mysqldb')['db'];config[_0x22f5('0x16')]=_[_0x22f5('0x17')](config[_0x22f5('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x22f5('0x18'))[_0x22f5('0x19')](socket);var jayson=require(_0x22f5('0x1a'));var client=jayson['client'][_0x22f5('0x1b')]({'port':0x232c});var client9002=jayson[_0x22f5('0x1c')][_0x22f5('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x523f6f,_0x14052d,_0xc9c020,_0x2eb4ce){return new BPromise(function(_0x16b15e,_0x451df3){var _0x1e4ccf=_0x2eb4ce||client;return _0x1e4ccf[_0x22f5('0x1d')](_0x523f6f,_0xc9c020)[_0x22f5('0x1e')](function(_0x90ba24){logger[_0x22f5('0x1f')](_0x22f5('0x20'),_0x14052d,_0x22f5('0x21'));logger[_0x22f5('0x22')](_0x22f5('0x23'),_0x14052d,'request\x20sent',JSON[_0x22f5('0x24')](_0x90ba24));if(_0x90ba24[_0x22f5('0x25')]){if(_0x90ba24[_0x22f5('0x25')][_0x22f5('0x26')]===0x1f4){logger[_0x22f5('0x25')](_0x22f5('0x20'),_0x14052d,_0x90ba24[_0x22f5('0x25')][_0x22f5('0x27')]);return _0x451df3(_0x90ba24['error'][_0x22f5('0x27')]);}logger['error'](_0x22f5('0x20'),_0x14052d,_0x90ba24['error'][_0x22f5('0x27')]);return _0x16b15e(_0x90ba24['error'][_0x22f5('0x27')]);}else{logger['info'](_0x22f5('0x20'),_0x14052d,'request\x20sent');_0x16b15e(_0x90ba24[_0x22f5('0x28')][_0x22f5('0x27')]);}})[_0x22f5('0x29')](function(_0x36fd72){logger[_0x22f5('0x25')](_0x22f5('0x20'),_0x14052d,_0x36fd72);_0x451df3(_0x36fd72);});});}function respondWithStatusCode(_0x51e230,_0x5420cc){_0x5420cc=_0x5420cc||0xcc;return function(_0x445332){if(_0x445332){return _0x51e230[_0x22f5('0x2a')](_0x5420cc);}return _0x51e230['status'](_0x5420cc)['end']();};}function respondWithResult(_0x189a45,_0x29e7a6){_0x29e7a6=_0x29e7a6||0xc8;return function(_0x44d3e8){if(_0x44d3e8){return _0x189a45[_0x22f5('0x2b')](_0x29e7a6)[_0x22f5('0x2c')](_0x44d3e8);}};}function respondWithFilteredResult(_0x4ed588,_0x56bf6e){return function(_0x2383db){if(_0x2383db){var _0x39fc67=typeof _0x56bf6e['offset']===_0x22f5('0x2d')&&typeof _0x56bf6e[_0x22f5('0x2e')]===_0x22f5('0x2d');var _0x46308b=_0x2383db['count'];var _0x91835=_0x39fc67?0x0:_0x56bf6e[_0x22f5('0x2f')];var _0x17705e=_0x39fc67?_0x2383db['count']:_0x56bf6e['offset']+_0x56bf6e[_0x22f5('0x2e')];var _0x10ae4f;if(_0x17705e>=_0x46308b){_0x17705e=_0x46308b;_0x10ae4f=0xc8;}else{_0x10ae4f=0xce;}_0x4ed588[_0x22f5('0x2b')](_0x10ae4f);return _0x4ed588[_0x22f5('0x30')]('Content-Range',_0x91835+'-'+_0x17705e+'/'+_0x46308b)[_0x22f5('0x2c')](_0x2383db);}return null;};}function patchUpdates(_0x107a3b){return function(_0x5a72a6){try{jsonpatch[_0x22f5('0x31')](_0x5a72a6,_0x107a3b,!![]);}catch(_0x329daa){return BPromise['reject'](_0x329daa);}return _0x5a72a6[_0x22f5('0x32')]();};}function saveUpdates(_0x3239b7,_0x46fbf3){return function(_0x1fe893){if(_0x1fe893){return _0x1fe893[_0x22f5('0x33')](_0x3239b7)[_0x22f5('0x1e')](function(_0x21b1ef){return _0x21b1ef;});}return null;};}function removeEntity(_0x174f85,_0x376831){return function(_0x3a2bc5){if(_0x3a2bc5){return _0x3a2bc5[_0x22f5('0x34')]()['then'](function(){_0x174f85[_0x22f5('0x2b')](0xcc)[_0x22f5('0x35')]();});}};}function handleEntityNotFound(_0xad54a5,_0x473716){return function(_0x433afb){if(!_0x433afb){_0xad54a5[_0x22f5('0x2a')](0x194);}return _0x433afb;};}function handleError(_0x4fe999,_0x57b9f4){_0x57b9f4=_0x57b9f4||0x1f4;return function(_0x3dab25){logger[_0x22f5('0x25')](_0x3dab25[_0x22f5('0x36')]);if(_0x3dab25[_0x22f5('0x37')]){delete _0x3dab25[_0x22f5('0x37')];}_0x4fe999['status'](_0x57b9f4)[_0x22f5('0x38')](_0x3dab25);};}exports[_0x22f5('0x39')]=function(_0x58ce24,_0x4e8df4){var _0x5114a2={},_0x152131={},_0x1af700={'count':0x0,'rows':[]};var _0x2989f9=_[_0x22f5('0x3a')](db['WhatsappMessage'][_0x22f5('0x3b')],function(_0x45d3e4){return{'name':_0x45d3e4[_0x22f5('0x3c')],'type':_0x45d3e4[_0x22f5('0x3d')][_0x22f5('0x3e')]};});_0x152131[_0x22f5('0x3f')]=_['map'](_0x2989f9,_0x22f5('0x37'));_0x152131[_0x22f5('0x40')]=_[_0x22f5('0x41')](_0x58ce24[_0x22f5('0x40')]);_0x152131[_0x22f5('0x42')]=_[_0x22f5('0x43')](_0x152131[_0x22f5('0x3f')],_0x152131[_0x22f5('0x40')]);_0x5114a2[_0x22f5('0x44')]=_[_0x22f5('0x43')](_0x152131[_0x22f5('0x3f')],qs['fields'](_0x58ce24[_0x22f5('0x40')][_0x22f5('0x45')]));_0x5114a2[_0x22f5('0x44')]=_0x5114a2[_0x22f5('0x44')][_0x22f5('0x46')]?_0x5114a2[_0x22f5('0x44')]:_0x152131[_0x22f5('0x3f')];if(!_0x58ce24[_0x22f5('0x40')][_0x22f5('0x47')]('nolimit')){_0x5114a2[_0x22f5('0x2e')]=qs[_0x22f5('0x2e')](_0x58ce24[_0x22f5('0x40')][_0x22f5('0x2e')]);_0x5114a2[_0x22f5('0x2f')]=qs['offset'](_0x58ce24['query']['offset']);}_0x5114a2[_0x22f5('0x48')]=qs[_0x22f5('0x49')](_0x58ce24[_0x22f5('0x40')]['sort']);_0x5114a2[_0x22f5('0x4a')]=qs[_0x22f5('0x42')](_[_0x22f5('0x4b')](_0x58ce24[_0x22f5('0x40')],_0x152131[_0x22f5('0x42')]),_0x2989f9);if(_0x58ce24[_0x22f5('0x40')]['filter']){_0x5114a2[_0x22f5('0x4a')]=_[_0x22f5('0x4c')](_0x5114a2[_0x22f5('0x4a')],{'$or':_[_0x22f5('0x3a')](_0x2989f9,function(_0x2547fa){if(_0x2547fa[_0x22f5('0x3d')]!==_0x22f5('0x4d')){var _0x491cc4={};_0x491cc4[_0x2547fa[_0x22f5('0x37')]]={'$like':'%'+_0x58ce24[_0x22f5('0x40')][_0x22f5('0x4e')]+'%'};return _0x491cc4;}})});}_0x5114a2=_['merge']({},_0x5114a2,_0x58ce24[_0x22f5('0x4f')]);var _0x2c384d={'where':_0x5114a2[_0x22f5('0x4a')]};return db[_0x22f5('0x50')][_0x22f5('0x51')](_0x2c384d)[_0x22f5('0x1e')](function(_0x246e3d){_0x1af700['count']=_0x246e3d;if(_0x58ce24[_0x22f5('0x40')][_0x22f5('0x52')]){_0x5114a2['include']=[{'all':!![]}];}return db[_0x22f5('0x50')][_0x22f5('0x53')](_0x5114a2);})['then'](function(_0x4bf3f0){_0x1af700[_0x22f5('0x54')]=_0x4bf3f0;return _0x1af700;})[_0x22f5('0x1e')](respondWithFilteredResult(_0x4e8df4,_0x5114a2))[_0x22f5('0x29')](handleError(_0x4e8df4,null));};exports[_0x22f5('0x55')]=function(_0x270629,_0x884b75){var _0x5b7a80={'raw':!![],'where':{'id':_0x270629['params']['id']}},_0x153cdd={};_0x153cdd[_0x22f5('0x3f')]=_['keys'](db[_0x22f5('0x50')][_0x22f5('0x3b')]);_0x153cdd[_0x22f5('0x40')]=_[_0x22f5('0x41')](_0x270629['query']);_0x153cdd[_0x22f5('0x42')]=_[_0x22f5('0x43')](_0x153cdd[_0x22f5('0x3f')],_0x153cdd[_0x22f5('0x40')]);_0x5b7a80[_0x22f5('0x44')]=_[_0x22f5('0x43')](_0x153cdd['model'],qs[_0x22f5('0x45')](_0x270629[_0x22f5('0x40')][_0x22f5('0x45')]));_0x5b7a80[_0x22f5('0x44')]=_0x5b7a80[_0x22f5('0x44')][_0x22f5('0x46')]?_0x5b7a80['attributes']:_0x153cdd[_0x22f5('0x3f')];if(_0x270629['query'][_0x22f5('0x52')]){_0x5b7a80['include']=[{'all':!![]}];}_0x5b7a80=_[_0x22f5('0x4c')]({},_0x5b7a80,_0x270629[_0x22f5('0x4f')]);return db[_0x22f5('0x50')]['find'](_0x5b7a80)[_0x22f5('0x1e')](handleEntityNotFound(_0x884b75,null))['then'](respondWithResult(_0x884b75,null))[_0x22f5('0x29')](handleError(_0x884b75,null));};exports[_0x22f5('0x56')]=function(_0x56261f,_0x50178e){return db[_0x22f5('0x50')][_0x22f5('0x56')](_0x56261f['body'],{})[_0x22f5('0x1e')](respondWithResult(_0x50178e,0xc9))[_0x22f5('0x29')](handleError(_0x50178e,null));};exports[_0x22f5('0x33')]=function(_0x31c7bb,_0x5792ec){if(_0x31c7bb[_0x22f5('0x57')]['id']){delete _0x31c7bb[_0x22f5('0x57')]['id'];}return db[_0x22f5('0x50')][_0x22f5('0x58')]({'where':{'id':_0x31c7bb[_0x22f5('0x59')]['id']}})[_0x22f5('0x1e')](handleEntityNotFound(_0x5792ec,null))[_0x22f5('0x1e')](saveUpdates(_0x31c7bb[_0x22f5('0x57')],null))['then'](respondWithResult(_0x5792ec,null))[_0x22f5('0x29')](handleError(_0x5792ec,null));};exports[_0x22f5('0x34')]=function(_0x22ab0d,_0x4fc4d6){return db[_0x22f5('0x50')][_0x22f5('0x58')]({'where':{'id':_0x22ab0d['params']['id']}})[_0x22f5('0x1e')](handleEntityNotFound(_0x4fc4d6,null))[_0x22f5('0x1e')](removeEntity(_0x4fc4d6,null))['catch'](handleError(_0x4fc4d6,null));};exports[_0x22f5('0x5a')]=function(_0x1bc81e,_0x9b509e){return db[_0x22f5('0x50')][_0x22f5('0x5a')]()['then'](respondWithResult(_0x9b509e,null))[_0x22f5('0x29')](handleError(_0x9b509e,null));};var interaction_log=require(_0x22f5('0x5b'))('whatsapp-interactions');exports[_0x22f5('0x5c')]=function(_0x3045d0,_0x318bf7,_0x53d78d){var _0x8c26d={'agent':{},'channel':'whatsapp'};if(_0x3045d0['body']['id']){delete _0x3045d0['body']['id'];}_0x3045d0['body'][_0x22f5('0x5d')]=!![];_0x3045d0[_0x22f5('0x57')][_0x22f5('0x5e')]=moment()[_0x22f5('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3045d0['body'][_0x22f5('0x60')]=_0x3045d0['body']['UserId']||_0x3045d0[_0x22f5('0x61')]['id'];_0x8c26d[_0x22f5('0x62')]['id']=_0x3045d0[_0x22f5('0x57')][_0x22f5('0x60')];return db['WhatsappMessage'][_0x22f5('0x58')]({'where':{'id':_0x3045d0[_0x22f5('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x318bf7,null))[_0x22f5('0x1e')](saveUpdates(_0x3045d0[_0x22f5('0x57')],null))[_0x22f5('0x1e')](function(_0x332a52){if(_0x332a52){_0x8c26d['message']=_0x332a52[_0x22f5('0x63')]({'plain':!![]});return db[_0x22f5('0x64')][_0x22f5('0x58')]({'where':{'id':_0x332a52['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x318bf7,null))[_0x22f5('0x1e')](function(_0x3a5be9){if(_0x3a5be9){return _0x3a5be9[_0x22f5('0x33')]({'UserId':_0x3045d0['body'][_0x22f5('0x60')],'read1stAt':_[_0x22f5('0x65')](_0x3a5be9[_0x22f5('0x66')])?moment()[_0x22f5('0x5f')](_0x22f5('0x67')):undefined});}return null;})[_0x22f5('0x1e')](function(_0x25b173){if(_0x25b173){_0x8c26d[_0x22f5('0x68')]=_0x25b173['get']({'plain':!![]});interaction_log[_0x22f5('0x1f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3045d0[_0x22f5('0x61')]['id'],_0x3045d0[_0x22f5('0x61')][_0x22f5('0x37')],_0x3045d0['user'][_0x22f5('0x69')],_0x8c26d[_0x22f5('0x68')]['id'],_0x3045d0[_0x22f5('0x57')]?JSON[_0x22f5('0x24')](_0x3045d0[_0x22f5('0x57')]):_0x22f5('0x6a'));return respondWithRpcPromise(_0x22f5('0x6b'),_0x22f5('0x6c'),_0x8c26d);}return null;})[_0x22f5('0x1e')](function(_0x26048a){var _0x1cdf2f=_0x22f5('0x6d')+_0x26048a[_0x22f5('0x27')][_0x22f5('0x6e')];return db[_0x22f5('0x6f')][_0x22f5('0x40')](_0x1cdf2f,{'type':db[_0x22f5('0x70')][_0x22f5('0x71')][_0x22f5('0x72')],'raw':!![]})[_0x22f5('0x1e')](function(_0x3f087d){return _0x3f087d;});})[_0x22f5('0x1e')](function(_0xec1112){if(_0xec1112){_0x8c26d['message']['contact']=_0xec1112[0x0];if(!_0x3045d0[_0x22f5('0x57')][_0x22f5('0x60')])return;return db[_0x22f5('0x73')][_0x22f5('0x58')]({'where':{'id':_0x3045d0[_0x22f5('0x57')][_0x22f5('0x60')],'role':_0x22f5('0x62')},'attributes':['id',_0x22f5('0x37'),'fullname','email',_0x22f5('0x74')],'raw':!![]});}return null;})['then'](function(_0x2e9ed4){if(!_0x2e9ed4)return null;_0x8c26d['message']['agent']=_0x2e9ed4;return _0x8c26d;})[_0x22f5('0x1e')](function(_0x265549){if(_0x265549){if(_0x3045d0[_0x22f5('0x57')]['manual']){_0x8c26d['message']['interface']=util[_0x22f5('0x5f')](_0x22f5('0x75'),_0x3045d0['user'][_0x22f5('0x37')]);_0x8c26d[_0x22f5('0x27')][_0x22f5('0x76')]=_0x8c26d[_0x22f5('0x76')];_0x8c26d[_0x22f5('0x27')][_0x22f5('0x77')]=_0x8c26d[_0x22f5('0x76')];_0x8c26d['message'][_0x22f5('0x78')]=_0x22f5('0x5c');return respondWithRpcPromise(_0x22f5('0x79'),_0x22f5('0x79'),{'event':_0x22f5('0x7a'),'message':_0x8c26d['message']},client9002)[_0x22f5('0x1e')](function(){return _0x8c26d;});}return _0x8c26d;}return null;})[_0x22f5('0x1e')](respondWithResult(_0x318bf7,null))['catch'](handleError(_0x318bf7,null));};var interaction_log=require(_0x22f5('0x5b'))(_0x22f5('0x7b'));exports[_0x22f5('0x7c')]=function(_0x27752e,_0x5b9318,_0x261d2b){var _0x4c3384={'agent':{},'channel':'whatsapp'};if(_0x27752e['body']['id']){delete _0x27752e['body']['id'];}_0x27752e[_0x22f5('0x57')][_0x22f5('0x60')]=_0x27752e[_0x22f5('0x57')]['UserId']||_0x27752e[_0x22f5('0x61')]['id'];_0x4c3384[_0x22f5('0x62')]['id']=_0x27752e['body']['UserId'];return db[_0x22f5('0x50')][_0x22f5('0x58')]({'where':{'id':_0x27752e[_0x22f5('0x59')]['id'],'UserId':null}})[_0x22f5('0x1e')](handleEntityNotFound(_0x5b9318,null))['then'](function(_0x4dbb1b){if(_0x4dbb1b){_0x4c3384[_0x22f5('0x27')]=_0x4dbb1b[_0x22f5('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0x22f5('0x58')]({'where':{'id':_0x4dbb1b[_0x22f5('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x5b9318,null))['then'](function(_0x2ad790){if(_0x2ad790){_0x4c3384[_0x22f5('0x68')]=_0x2ad790[_0x22f5('0x63')]({'plain':!![]});interaction_log[_0x22f5('0x1f')](_0x22f5('0x7e'),_0x27752e['user']['id'],_0x27752e['user']['name'],_0x27752e[_0x22f5('0x61')][_0x22f5('0x69')],_0x4c3384[_0x22f5('0x68')]['id'],_0x27752e['body']?JSON['stringify'](_0x27752e[_0x22f5('0x57')]):_0x22f5('0x6a'));return respondWithRpcPromise(_0x22f5('0x7f'),'rejectMessage',_0x4c3384);}return null;})[_0x22f5('0x1e')](function(_0x2358ef){var _0xef661e=_0x22f5('0x6d')+_0x2358ef[_0x22f5('0x27')][_0x22f5('0x6e')];return db['sequelize'][_0x22f5('0x40')](_0xef661e,{'type':db[_0x22f5('0x70')][_0x22f5('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x19e0fc){return _0x19e0fc;});})[_0x22f5('0x1e')](function(_0x1e115e){if(_0x1e115e){_0x4c3384[_0x22f5('0x27')]['contact']=_0x1e115e[0x0];if(!_0x27752e[_0x22f5('0x57')][_0x22f5('0x60')])return;return db[_0x22f5('0x73')][_0x22f5('0x58')]({'where':{'id':_0x27752e[_0x22f5('0x57')]['UserId'],'role':_0x22f5('0x62')},'attributes':['id',_0x22f5('0x37'),'fullname',_0x22f5('0x80'),_0x22f5('0x74')],'raw':!![]});}return null;})[_0x22f5('0x1e')](function(_0x169095){if(!_0x169095)return null;_0x4c3384['message'][_0x22f5('0x62')]=_0x169095;return _0x4c3384;})['then'](function(_0x162b5b){if(_0x162b5b){_0x162b5b[_0x22f5('0x27')][_0x22f5('0x81')]=util[_0x22f5('0x5f')]('SIP/%s',_0x27752e[_0x22f5('0x61')][_0x22f5('0x37')]);_0x162b5b[_0x22f5('0x27')]['channel']=_0x4c3384[_0x22f5('0x76')];_0x162b5b['message']['motionChannel']=_0x4c3384[_0x22f5('0x76')];_0x162b5b[_0x22f5('0x27')][_0x22f5('0x78')]='reject';respondWithRpcPromise(_0x22f5('0x79'),'EventManager',{'event':'rejectmessage','message':_0x162b5b[_0x22f5('0x27')]},client9002);return _0x4c3384;}return null;})[_0x22f5('0x1e')](respondWithResult(_0x5b9318,null))[_0x22f5('0x29')](handleError(_0x5b9318,null));};exports['status']=function(_0x500677,_0x137048,_0x2b9d39){if(_0x500677[_0x22f5('0x57')]['id']){delete _0x500677[_0x22f5('0x57')]['id'];}var _0x55b645;return db[_0x22f5('0x50')][_0x22f5('0x58')]({'where':{'id':_0x500677[_0x22f5('0x59')]['id']}})[_0x22f5('0x1e')](handleEntityNotFound(_0x137048,null))[_0x22f5('0x1e')](function(_0x2e4919){if(_0x2e4919){_0x55b645=_0x2e4919;return db[_0x22f5('0x82')][_0x22f5('0x58')]({'where':{'id':_0x2e4919[_0x22f5('0x83')]}});}})[_0x22f5('0x1e')](handleEntityNotFound(_0x137048,null))[_0x22f5('0x1e')](function(_0x1fcbfc){if(_0x1fcbfc){logger[_0x22f5('0x22')](_0x22f5('0x84'),_0x22f5('0x2b'),_0x22f5('0x85'),_0x1fcbfc[_0x22f5('0x3d')],util['inspect'](_0x500677['body'],{'showHidden':![],'depth':null}));switch(_0x1fcbfc[_0x22f5('0x3d')]){case _0x22f5('0x86'):if(_0x500677[_0x22f5('0x57')]['MessageSid']&&_0x500677[_0x22f5('0x57')]['MessageSid']===_0x55b645[_0x22f5('0x87')]&&_0x500677[_0x22f5('0x57')]['MessageStatus']&&_0x500677[_0x22f5('0x57')][_0x22f5('0x88')]==='read'){return _0x55b645[_0x22f5('0x33')]({'read':!![]});}else{logger[_0x22f5('0x25')](_0x22f5('0x89'),_0x22f5('0x2b'),_0x22f5('0x86'),util[_0x22f5('0x8a')](_0x500677[_0x22f5('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x55b645;}})[_0x22f5('0x1e')](respondWithResult(_0x137048,null))[_0x22f5('0x29')](handleError(_0x137048,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index ae4343d..178c7f3 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 _0xa25c=['WhatsappMessage','setMaxListeners','save','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x2bfed5,_0x15657a){var _0x5e788b=function(_0x6601a8){while(--_0x6601a8){_0x2bfed5['push'](_0x2bfed5['shift']());}};_0x5e788b(++_0x15657a);}(_0xa25c,0x13f));var _0xca25=function(_0x19faae,_0x5697bc){_0x19faae=_0x19faae-0x0;var _0x363543=_0xa25c[_0x19faae];return _0x363543;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xca25('0x0'))['db'][_0xca25('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xca25('0x2')](0x0);var events={'afterCreate':_0xca25('0x3'),'afterUpdate':_0xca25('0x4'),'afterDestroy':_0xca25('0x5')};function emitEvent(_0x2cc2d6){return function(_0x336741,_0x498b8e,_0x41d208){WhatsappMessageEvents['emit'](_0x2cc2d6+':'+_0x336741['id'],_0x336741);WhatsappMessageEvents['emit'](_0x2cc2d6,_0x336741);_0x41d208(null);};}for(var e in events){if(events[_0xca25('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xca25('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage'];(function(_0x4dca38,_0x5dfae1){var _0x44656c=function(_0x538a62){while(--_0x538a62){_0x4dca38['push'](_0x4dca38['shift']());}};_0x44656c(++_0x5dfae1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){WhatsappMessageEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);WhatsappMessageEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];WhatsappMessage[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b4accb6..e57e1d4 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 _0x5b1c=['lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','models','get','toLowerCase','direction','out','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','secret','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','log','LOG\x20~\x20~\x20SEND','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x283d09,_0x5be1bd){var _0x2cb198=function(_0x28a1df){while(--_0x28a1df){_0x283d09['push'](_0x283d09['shift']());}};_0x2cb198(++_0x5be1bd);}(_0x5b1c,0x1b9));var _0xc5b1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5b1c[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xc5b1('0x0'));var util=require('util');var logger=require(_0xc5b1('0x1'))(_0xc5b1('0x2'));var moment=require(_0xc5b1('0x3'));var BPromise=require(_0xc5b1('0x4'));var rp=require(_0xc5b1('0x5'));var fetch=require(_0xc5b1('0x6'));var fs=require('fs');var path=require(_0xc5b1('0x7'));var rimraf=require(_0xc5b1('0x8'));var config=require(_0xc5b1('0x9'));var attributes=require(_0xc5b1('0xa'));module[_0xc5b1('0xb')]=function(_0x3dfe6b,_0x30d974){return _0x3dfe6b[_0xc5b1('0xc')](_0xc5b1('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xc5b1('0xe'),'fields':[_0xc5b1('0xe')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0xc5b1('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4674a8,_0x3365d5,_0x408c10){var _0x1d17da=_0x3dfe6b[_0xc5b1('0x10')];var _0x4e6b1a=_0x4674a8[_0xc5b1('0x11')]({'plain':!![]});if(_0x4e6b1a['direction'][_0xc5b1('0x12')]()==='in'||_0x4e6b1a[_0xc5b1('0x13')][_0xc5b1('0x12')]()===_0xc5b1('0x14')&&!_0x4e6b1a['secret']&&!_['isNil'](_0x4e6b1a[_0xc5b1('0x15')])){_0x1d17da[_0xc5b1('0x16')][_0xc5b1('0x17')]({'where':{'id':_0x4e6b1a[_0xc5b1('0x18')]}})[_0xc5b1('0x19')](function(_0x3ebe62){if(_0x3ebe62){_0x3ebe62[_0xc5b1('0x1a')]({'lastMsgAt':_0x4e6b1a[_0xc5b1('0x1b')],'lastMsgDirection':_0x4e6b1a[_0xc5b1('0x13')]['toLowerCase']()});}})['catch'](function(_0x14e0a9){console['error'](_0x14e0a9);});}if(_0x4e6b1a[_0xc5b1('0x13')]===_0xc5b1('0x14')&&!_0x4e6b1a[_0xc5b1('0x1c')]){var _0x16ba14;_0x1d17da['WhatsappAccount'][_0xc5b1('0x1d')]({'where':{'id':_0x4e6b1a[_0xc5b1('0x1e')]},'raw':!![]})[_0xc5b1('0x19')](function(_0xb58df6){_0x16ba14=_0xb58df6;if(_0x16ba14&&_0x16ba14[_0xc5b1('0x1f')]){switch(_0x16ba14['type']){case'twilio':var _0x426ec8=require(_0xc5b1('0x20'));if(_0x16ba14[_0xc5b1('0x21')]&&_0x16ba14['authToken']&&_0x16ba14[_0xc5b1('0x22')]){var _0x4f4c54=new _0x426ec8(_0x16ba14[_0xc5b1('0x21')],_0x16ba14[_0xc5b1('0x23')]);_0x4f4c54[_0xc5b1('0x24')][_0xc5b1('0x25')]({'body':_0x4e6b1a[_0xc5b1('0x26')],'to':_0xc5b1('0x27')+_0x4e6b1a[_0xc5b1('0x22')],'from':_0xc5b1('0x27')+_0x16ba14[_0xc5b1('0x22')],'statusCallback':_0x16ba14[_0xc5b1('0x28')]+_0xc5b1('0x29')+_0x4e6b1a['id']+_0xc5b1('0x2a')+_0x16ba14['token']})['then'](function(_0xb4bd4c){if(_0xb4bd4c[_0xc5b1('0x2b')]){return _0x4674a8['update']({'messageId':_0xb4bd4c[_0xc5b1('0x2b')]});}})[_0xc5b1('0x2c')](function(_0x29d52a){logger['error'](_0xc5b1('0x2d'),_0xc5b1('0x2e'),_0xc5b1('0x20'),util[_0xc5b1('0x2f')](_0x29d52a,{'showHidden':![],'depth':null}));});}else{logger[_0xc5b1('0x30')](_0xc5b1('0x2d'),_0xc5b1('0x2e'),_0xc5b1('0x20'),_0xc5b1('0x31'));}break;case _0xc5b1('0x32'):var _0x1fc4fa=_0x16ba14[_0xc5b1('0x21')];var _0x125b53=_0x16ba14[_0xc5b1('0x23')];var _0x10f07c=_0x16ba14[_0xc5b1('0x33')]+_0xc5b1('0x34')+_0x1fc4fa+_0xc5b1('0x35');var _0x3f4ae0={'to':[_0x4e6b1a[_0xc5b1('0x22')]],'message':{'type':_0xc5b1('0x36'),'text':_0x4e6b1a[_0xc5b1('0x26')]}};var _0x1c19d2={'method':'POST','uri':_0x10f07c,'headers':{'Authorization':_0xc5b1('0x37')+_0x125b53,'Content-Type':'application/json'},'body':_0x3f4ae0,'json':!![]};rp(_0x1c19d2)[_0xc5b1('0x19')](function(_0x30a782){console[_0xc5b1('0x38')](_0xc5b1('0x39'),_0x30a782);if(_0x30a782[_0xc5b1('0x3a')][0x0][_0xc5b1('0x3b')]){return _0x4674a8[_0xc5b1('0x1a')]({'messageId':_0x30a782[_0xc5b1('0x3a')][0x0][_0xc5b1('0x3b')]});}})[_0xc5b1('0x2c')](function(_0x40cf6b){console[_0xc5b1('0x38')](_0x40cf6b);});break;}}})[_0xc5b1('0x3c')](function(){_0x408c10();});}else{_0x408c10();}}},'charset':_0xc5b1('0x3d'),'collate':_0xc5b1('0x3e')});}; \ No newline at end of file +var _0x538f=['update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','afterCreate','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','Bearer\x20','application/json','LOG\x20~\x20~\x20SEND','message_id','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','exports','define','whatsapp_messages','messageId','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','then'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0x538f,0xca));var _0xf538=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x538f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf538('0x0'));var util=require(_0xf538('0x1'));var logger=require(_0xf538('0x2'))(_0xf538('0x3'));var moment=require(_0xf538('0x4'));var BPromise=require(_0xf538('0x5'));var rp=require(_0xf538('0x6'));var fetch=require(_0xf538('0x7'));var fs=require('fs');var path=require(_0xf538('0x8'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xf538('0x9')]=function(_0xe36b95,_0xfeb707){return _0xe36b95[_0xf538('0xa')]('WhatsappMessage',attributes,{'tableName':_0xf538('0xb'),'paranoid':![],'indexes':[{'name':_0xf538('0xc'),'fields':[_0xf538('0xc')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59ac08,_0x5416e4,_0x2dcc09){var _0x1075c9=_0xe36b95['models'];var _0x229c0f=_0x59ac08[_0xf538('0xd')]({'plain':!![]});if(_0x229c0f['direction'][_0xf538('0xe')]()==='in'||_0x229c0f[_0xf538('0xf')][_0xf538('0xe')]()===_0xf538('0x10')&&!_0x229c0f[_0xf538('0x11')]&&!_[_0xf538('0x12')](_0x229c0f[_0xf538('0x13')])){_0x1075c9['WhatsappInteraction'][_0xf538('0x14')]({'where':{'id':_0x229c0f['WhatsappInteractionId']}})[_0xf538('0x15')](function(_0x38b422){if(_0x38b422){_0x38b422[_0xf538('0x16')]({'lastMsgAt':_0x229c0f[_0xf538('0x17')],'lastMsgDirection':_0x229c0f[_0xf538('0xf')][_0xf538('0xe')]()});}})[_0xf538('0x18')](function(_0x2b6990){console[_0xf538('0x19')](_0x2b6990);});}if(_0x229c0f[_0xf538('0xf')]===_0xf538('0x10')&&!_0x229c0f[_0xf538('0x11')]){var _0x2e7885;_0x1075c9[_0xf538('0x1a')][_0xf538('0x1b')]({'where':{'id':_0x229c0f[_0xf538('0x1c')]},'raw':!![]})['then'](function(_0x554c82){_0x2e7885=_0x554c82;if(_0x2e7885&&_0x2e7885['type']){switch(_0x2e7885[_0xf538('0x1d')]){case _0xf538('0x1e'):var _0x412476=require(_0xf538('0x1e'));if(_0x2e7885[_0xf538('0x1f')]&&_0x2e7885[_0xf538('0x20')]&&_0x2e7885[_0xf538('0x21')]){var _0x2e88e5=new _0x412476(_0x2e7885[_0xf538('0x1f')],_0x2e7885[_0xf538('0x20')]);_0x2e88e5[_0xf538('0x22')][_0xf538('0x23')]({'body':_0x229c0f[_0xf538('0x24')],'to':'whatsapp:'+_0x229c0f[_0xf538('0x21')],'from':_0xf538('0x25')+_0x2e7885[_0xf538('0x21')],'statusCallback':_0x2e7885[_0xf538('0x26')]+_0xf538('0x27')+_0x229c0f['id']+_0xf538('0x28')+_0x2e7885[_0xf538('0x29')]})[_0xf538('0x15')](function(_0x6a923d){if(_0x6a923d['sid']){return _0x59ac08[_0xf538('0x16')]({'messageId':_0x6a923d['sid']});}})[_0xf538('0x18')](function(_0x447c1b){logger[_0xf538('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf538('0x2a'),'twilio',util['inspect'](_0x447c1b,{'showHidden':![],'depth':null}));});}else{logger[_0xf538('0x19')](_0xf538('0x2b'),_0xf538('0x2a'),_0xf538('0x1e'),_0xf538('0x2c'));}break;case _0xf538('0x2d'):var _0x334f8d=_0x2e7885[_0xf538('0x1f')];var _0x54b3a2=_0x2e7885[_0xf538('0x21')];var _0x2e720c=_0x2e7885['authToken'];var _0x1947f2=_0x2e7885[_0xf538('0x2e')]+'/whatsapp/v1/'+_0x334f8d+_0xf538('0x2f');var _0x4e2d47={'to':[_0x229c0f[_0xf538('0x21')]],'message':{'type':_0xf538('0x30'),'text':_0x229c0f['body']}};var _0x40e3f6={'method':'POST','uri':_0x1947f2,'headers':{'Authorization':_0xf538('0x31')+_0x2e720c,'Content-Type':_0xf538('0x32')},'body':_0x4e2d47,'json':!![]};rp(_0x40e3f6)[_0xf538('0x15')](function(_0x594d87){console['log'](_0xf538('0x33'),_0x594d87);if(_0x594d87['statuses'][0x0][_0xf538('0x34')]){return _0x59ac08[_0xf538('0x16')]({'messageId':_0x594d87['statuses'][0x0]['message_id']});}})[_0xf538('0x18')](function(_0x1fd682){console['log'](_0x1fd682);});break;}}})[_0xf538('0x35')](function(){_0x2dcc09();});}else{_0x2dcc09();}}},'charset':_0xf538('0x36'),'collate':_0xf538('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 25e11a0..e66b0a7 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 _0xaf3a=['debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x26e756,_0xfcbd56){var _0x55b6cf=function(_0x1c0a8c){while(--_0x1c0a8c){_0x26e756['push'](_0x26e756['shift']());}};_0x55b6cf(++_0xfcbd56);}(_0xaf3a,0x155));var _0xaaf3=function(_0x18fe54,_0xff789){_0x18fe54=_0x18fe54-0x0;var _0xccb1ee=_0xaf3a[_0x18fe54];return _0xccb1ee;};'use strict';var _=require(_0xaaf3('0x0'));var util=require(_0xaaf3('0x1'));var moment=require(_0xaaf3('0x2'));var BPromise=require(_0xaaf3('0x3'));var rs=require(_0xaaf3('0x4'));var fs=require('fs');var Redis=require(_0xaaf3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaaf3('0x6'));var config=require(_0xaaf3('0x7'));var jayson=require(_0xaaf3('0x8'));var client=jayson[_0xaaf3('0x9')]['http']({'port':0x232a});config['redis']=_[_0xaaf3('0xa')](config[_0xaaf3('0xb')],{'host':_0xaaf3('0xc'),'port':0x18eb});var socket=require(_0xaaf3('0xd'))(new Redis(config[_0xaaf3('0xb')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x138e90,_0x273aaf,_0x2299c6){return new BPromise(function(_0x5aec94,_0x5b00ff){return client[_0xaaf3('0xe')](_0x138e90,_0x2299c6)[_0xaaf3('0xf')](function(_0x2262d7){logger[_0xaaf3('0x10')](_0xaaf3('0x11'),_0x273aaf,_0xaaf3('0x12'));logger[_0xaaf3('0x13')](_0xaaf3('0x14'),_0x273aaf,_0xaaf3('0x12'),JSON['stringify'](_0x2262d7));if(_0x2262d7[_0xaaf3('0x15')]){if(_0x2262d7[_0xaaf3('0x15')]['code']===0x1f4){logger[_0xaaf3('0x15')](_0xaaf3('0x11'),_0x273aaf,_0x2262d7[_0xaaf3('0x15')][_0xaaf3('0x16')]);return _0x5b00ff(_0x2262d7[_0xaaf3('0x15')][_0xaaf3('0x16')]);}logger['error'](_0xaaf3('0x11'),_0x273aaf,_0x2262d7['error'][_0xaaf3('0x16')]);return _0x5aec94(_0x2262d7[_0xaaf3('0x15')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x273aaf,_0xaaf3('0x12'));_0x5aec94(_0x2262d7['result'][_0xaaf3('0x16')]);}})[_0xaaf3('0x17')](function(_0x183386){logger[_0xaaf3('0x15')](_0xaaf3('0x11'),_0x273aaf,_0x183386);_0x5b00ff(_0x183386);});});}exports[_0xaaf3('0x18')]=function(_0x13412d){var _0x1ae107=this;return new Promise(function(_0x2692fe,_0x5012fc){return db[_0xaaf3('0x19')][_0xaaf3('0x1a')](_0x13412d[_0xaaf3('0x1b')],{'raw':_0x13412d[_0xaaf3('0x1c')]?_0x13412d['options'][_0xaaf3('0x1d')]===undefined?!![]:![]:!![]})[_0xaaf3('0xf')](function(_0x53fc62){logger[_0xaaf3('0x10')](_0xaaf3('0x18'),_0x13412d);logger['debug'](_0xaaf3('0x18'),_0x13412d,JSON['stringify'](_0x53fc62));_0x2692fe(_0x53fc62);})[_0xaaf3('0x17')](function(_0x4c7b18){logger['error'](_0xaaf3('0x18'),_0x4c7b18[_0xaaf3('0x16')],_0x13412d);_0x5012fc(_0x1ae107[_0xaaf3('0x15')](0x1f4,_0x4c7b18[_0xaaf3('0x16')]));});});}; \ No newline at end of file +var _0xc974=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x592376,_0x5f2cc9){var _0x486f88=function(_0x408355){while(--_0x408355){_0x592376['push'](_0x592376['shift']());}};_0x486f88(++_0x5f2cc9);}(_0xc974,0x72));var _0x4c97=function(_0x28ba95,_0x4381eb){_0x28ba95=_0x28ba95-0x0;var _0x10194b=_0xc974[_0x28ba95];return _0x10194b;};'use strict';var _=require(_0x4c97('0x0'));var util=require('util');var moment=require(_0x4c97('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c97('0x2'));var fs=require('fs');var Redis=require(_0x4c97('0x3'));var db=require(_0x4c97('0x4'))['db'];var utils=require(_0x4c97('0x5'));var logger=require('../../config/logger')(_0x4c97('0x6'));var config=require(_0x4c97('0x7'));var jayson=require(_0x4c97('0x8'));var client=jayson['client'][_0x4c97('0x9')]({'port':0x232a});config[_0x4c97('0xa')]=_[_0x4c97('0xb')](config[_0x4c97('0xa')],{'host':_0x4c97('0xc'),'port':0x18eb});var socket=require(_0x4c97('0xd'))(new Redis(config[_0x4c97('0xa')]));require('./whatsappMessage.socket')[_0x4c97('0xe')](socket);function respondWithRpcPromise(_0x5a5693,_0x1c9f3d,_0x41f69d){return new BPromise(function(_0x474831,_0x11a83f){return client[_0x4c97('0xf')](_0x5a5693,_0x41f69d)[_0x4c97('0x10')](function(_0x584419){logger[_0x4c97('0x11')](_0x4c97('0x12'),_0x1c9f3d,'request\x20sent');logger['debug'](_0x4c97('0x13'),_0x1c9f3d,_0x4c97('0x14'),JSON[_0x4c97('0x15')](_0x584419));if(_0x584419['error']){if(_0x584419[_0x4c97('0x16')]['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1c9f3d,_0x584419[_0x4c97('0x16')][_0x4c97('0x17')]);return _0x11a83f(_0x584419['error']['message']);}logger[_0x4c97('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x1c9f3d,_0x584419[_0x4c97('0x16')][_0x4c97('0x17')]);return _0x474831(_0x584419[_0x4c97('0x16')][_0x4c97('0x17')]);}else{logger[_0x4c97('0x11')](_0x4c97('0x12'),_0x1c9f3d,_0x4c97('0x14'));_0x474831(_0x584419[_0x4c97('0x18')]['message']);}})[_0x4c97('0x19')](function(_0x37acd4){logger['error'](_0x4c97('0x12'),_0x1c9f3d,_0x37acd4);_0x11a83f(_0x37acd4);});});}exports[_0x4c97('0x1a')]=function(_0x4840b0){var _0xeca70e=this;return new Promise(function(_0x4f5251,_0x5d5652){return db[_0x4c97('0x1b')][_0x4c97('0x1c')](_0x4840b0[_0x4c97('0x1d')],{'raw':_0x4840b0[_0x4c97('0x1e')]?_0x4840b0[_0x4c97('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4c97('0x10')](function(_0x5e5436){logger[_0x4c97('0x11')](_0x4c97('0x1a'),_0x4840b0);logger[_0x4c97('0x1f')](_0x4c97('0x1a'),_0x4840b0,JSON[_0x4c97('0x15')](_0x5e5436));_0x4f5251(_0x5e5436);})['catch'](function(_0x354d68){logger[_0x4c97('0x16')]('CreateWhatsappMessage',_0x354d68[_0x4c97('0x17')],_0x4840b0);_0x5d5652(_0xeca70e['error'](0x1f4,_0x354d68['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 24668f9..2a8b1ed 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 _0x6fa1=['removeListener','register','length','./whatsappMessage.events','save','remove','update','emit'];(function(_0x442305,_0x2cf8be){var _0x189423=function(_0x35bfe2){while(--_0x35bfe2){_0x442305['push'](_0x442305['shift']());}};_0x189423(++_0x2cf8be);}(_0x6fa1,0x1bb));var _0x16fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6fa1[_0xa464c9];return _0x3d73c4;};'use strict';var WhatsappMessageEvents=require(_0x16fa('0x0'));var events=[_0x16fa('0x1'),_0x16fa('0x2'),_0x16fa('0x3')];function createListener(_0x198979,_0xcfded0){return function(_0x5bb4c6){_0xcfded0[_0x16fa('0x4')](_0x198979,_0x5bb4c6);};}function removeListener(_0x15bd93,_0x36ffcb){return function(){WhatsappMessageEvents[_0x16fa('0x5')](_0x15bd93,_0x36ffcb);};}exports[_0x16fa('0x6')]=function(_0xedceb5){for(var _0x314476=0x0,_0x120d19=events[_0x16fa('0x7')];_0x314476<_0x120d19;_0x314476++){var _0x584e4d=events[_0x314476];var _0x208757=createListener('whatsappMessage:'+_0x584e4d,_0xedceb5);WhatsappMessageEvents['on'](_0x584e4d,_0x208757);}}; \ No newline at end of file +var _0x0f40=['./whatsappMessage.events','save','remove','update','emit','register','whatsappMessage:'];(function(_0x37154b,_0x369552){var _0x59164c=function(_0x227922){while(--_0x227922){_0x37154b['push'](_0x37154b['shift']());}};_0x59164c(++_0x369552);}(_0x0f40,0x103));var _0x00f4=function(_0x1bdc52,_0x4876a9){_0x1bdc52=_0x1bdc52-0x0;var _0xdf3fa3=_0x0f40[_0x1bdc52];return _0xdf3fa3;};'use strict';var WhatsappMessageEvents=require(_0x00f4('0x0'));var events=[_0x00f4('0x1'),_0x00f4('0x2'),_0x00f4('0x3')];function createListener(_0x376e2d,_0x46f631){return function(_0x458c8f){_0x46f631[_0x00f4('0x4')](_0x376e2d,_0x458c8f);};}function removeListener(_0x181043,_0xa95993){return function(){WhatsappMessageEvents['removeListener'](_0x181043,_0xa95993);};}exports[_0x00f4('0x5')]=function(_0x44291d){for(var _0x42d9ad=0x0,_0x3709a5=events['length'];_0x42d9ad<_0x3709a5;_0x42d9ad++){var _0x24bde4=events[_0x42d9ad];var _0x3a245d=createListener(_0x00f4('0x6')+_0x24bde4,_0x44291d);WhatsappMessageEvents['on'](_0x24bde4,_0x3a245d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5aea3d4..26103c0 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 _0x1600=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','put','destroy','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1600,0x1df));var _0x0160=function(_0x25caca,_0x518cea){_0x25caca=_0x25caca-0x0;var _0xad560e=_0x1600[_0x25caca];return _0xad560e;};'use strict';var multer=require(_0x0160('0x0'));var util=require(_0x0160('0x1'));var path=require(_0x0160('0x2'));var timeout=require(_0x0160('0x3'));var express=require(_0x0160('0x4'));var router=express[_0x0160('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0160('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x0160('0x7')](),controller[_0x0160('0x8')]);router['get'](_0x0160('0x9'),auth[_0x0160('0x7')](),controller[_0x0160('0xa')]);router[_0x0160('0xb')](_0x0160('0xc'),auth[_0x0160('0x7')](),controller[_0x0160('0xd')]);router[_0x0160('0xb')](_0x0160('0xe'),auth['isAuthenticated'](),controller[_0x0160('0xf')]);router[_0x0160('0xb')](_0x0160('0x10'),auth[_0x0160('0x7')](),controller[_0x0160('0x11')]);router[_0x0160('0xb')](_0x0160('0x12'),auth[_0x0160('0x7')](),controller['getAgents']);router['post']('/',auth[_0x0160('0x7')](),controller[_0x0160('0x13')]);router[_0x0160('0x14')](_0x0160('0x10'),auth['isAuthenticated'](),controller[_0x0160('0x15')]);router['post'](_0x0160('0x12'),auth[_0x0160('0x7')](),controller['addAgents']);router[_0x0160('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0160('0xc'),auth[_0x0160('0x7')](),controller[_0x0160('0x17')]);router[_0x0160('0x18')](_0x0160('0x10'),auth['isAuthenticated'](),controller[_0x0160('0x19')]);router[_0x0160('0x18')](_0x0160('0x12'),auth['isAuthenticated'](),controller[_0x0160('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x4060=['removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','destroy','delete'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x4060,0x120));var _0x0406=function(_0x121ddf,_0x451621){_0x121ddf=_0x121ddf-0x0;var _0x1b9763=_0x4060[_0x121ddf];return _0x1b9763;};'use strict';var multer=require('multer');var util=require(_0x0406('0x0'));var path=require(_0x0406('0x1'));var timeout=require(_0x0406('0x2'));var express=require(_0x0406('0x3'));var router=express[_0x0406('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0406('0x5'));var config=require('../../config/environment');var controller=require(_0x0406('0x6'));router[_0x0406('0x7')]('/',auth[_0x0406('0x8')](),controller[_0x0406('0x9')]);router[_0x0406('0x7')](_0x0406('0xa'),auth[_0x0406('0x8')](),controller[_0x0406('0xb')]);router[_0x0406('0x7')](_0x0406('0xc'),auth['isAuthenticated'](),controller[_0x0406('0xd')]);router[_0x0406('0x7')](_0x0406('0xe'),auth['isAuthenticated'](),controller[_0x0406('0xf')]);router[_0x0406('0x7')](_0x0406('0x10'),auth[_0x0406('0x8')](),controller[_0x0406('0x11')]);router['get'](_0x0406('0x12'),auth['isAuthenticated'](),controller[_0x0406('0x13')]);router[_0x0406('0x14')]('/',auth[_0x0406('0x8')](),controller[_0x0406('0x15')]);router[_0x0406('0x14')](_0x0406('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x0406('0x14')](_0x0406('0x12'),auth[_0x0406('0x8')](),controller['addAgents']);router['put'](_0x0406('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0406('0x16')]);router[_0x0406('0x17')](_0x0406('0x10'),auth[_0x0406('0x8')](),controller['removeTeams']);router[_0x0406('0x17')](_0x0406('0x12'),auth['isAuthenticated'](),controller[_0x0406('0x18')]);module[_0x0406('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a796112..9f4a5c3 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 _0x0a9a=['roundrobin','STRING','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x44c340,_0x575719){var _0x2cd080=function(_0x1109ea){while(--_0x1109ea){_0x44c340['push'](_0x44c340['shift']());}};_0x2cd080(++_0x575719);}(_0x0a9a,0x183));var _0xa0a9=function(_0x98269e,_0x5ad539){_0x98269e=_0x98269e-0x0;var _0x1a48cc=_0x0a9a[_0x98269e];return _0x1a48cc;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa0a9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa0a9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa0a9('0x3')](_0xa0a9('0x4'),'beepall',_0xa0a9('0x5'))},'description':{'type':Sequelize[_0xa0a9('0x6')]}}; \ No newline at end of file +var _0x2dae=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x3165d0,_0x4472f1){var _0x3fdcd9=function(_0x3091dc){while(--_0x3091dc){_0x3165d0['push'](_0x3165d0['shift']());}};_0x3fdcd9(++_0x4472f1);}(_0x2dae,0xc3));var _0xe2da=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x2dae[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2da('0x1')],'unique':_0xe2da('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe2da('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe2da('0x4')](_0xe2da('0x5'),'beepall',_0xe2da('0x6'))},'description':{'type':Sequelize[_0xe2da('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 662e009..50b5dae 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 _0x033d=['flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','spread','userWhatsappQueue:remove','getAgents','findOne','nolimit','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','get','WhatsappQueues','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserWhatsappQueue','pick','WhatsappQueueId','findAndCountAll','UserId','whatsappPause','createdAt','format','updatedAt','getTeams','Team','ids','User','Agents','voicePause','interface'];(function(_0x88bc4d,_0x29aa32){var _0x1a2740=function(_0x2432a9){while(--_0x2432a9){_0x88bc4d['push'](_0x88bc4d['shift']());}};_0x1a2740(++_0x29aa32);}(_0x033d,0x1c3));var _0xd033=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x033d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd033('0x0'));var jsonpatch=require(_0xd033('0x1'));var rp=require(_0xd033('0x2'));var moment=require('moment');var BPromise=require(_0xd033('0x3'));var Mustache=require(_0xd033('0x4'));var util=require(_0xd033('0x5'));var path=require(_0xd033('0x6'));var sox=require('sox');var csv=require(_0xd033('0x7'));var ejs=require(_0xd033('0x8'));var fs=require('fs');var fs_extra=require(_0xd033('0x9'));var _=require(_0xd033('0xa'));var squel=require(_0xd033('0xb'));var crypto=require(_0xd033('0xc'));var jsforce=require(_0xd033('0xd'));var deskjs=require(_0xd033('0xe'));var toCsv=require(_0xd033('0x7'));var querystring=require(_0xd033('0xf'));var Papa=require(_0xd033('0x10'));var Redis=require('ioredis');var authService=require(_0xd033('0x11'));var qs=require(_0xd033('0x12'));var as=require(_0xd033('0x13'));var hardwareService=require(_0xd033('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd033('0x15'));var config=require(_0xd033('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd033('0x17'))['db'];config[_0xd033('0x18')]=_[_0xd033('0x19')](config['redis'],{'host':_0xd033('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xd033('0x1b')](socket);function respondWithStatusCode(_0x5cf78c,_0x4c6bed){_0x4c6bed=_0x4c6bed||0xcc;return function(_0x1ef14c){if(_0x1ef14c){return _0x5cf78c[_0xd033('0x1c')](_0x4c6bed);}return _0x5cf78c[_0xd033('0x1d')](_0x4c6bed)['end']();};}function respondWithResult(_0x449bcd,_0x1b4b48){_0x1b4b48=_0x1b4b48||0xc8;return function(_0x33435a){if(_0x33435a){return _0x449bcd[_0xd033('0x1d')](_0x1b4b48)['json'](_0x33435a);}};}function respondWithFilteredResult(_0x135c5d,_0x2b572d){return function(_0x4b52ea){if(_0x4b52ea){var _0x20e850=typeof _0x2b572d['offset']==='undefined'&&typeof _0x2b572d['limit']===_0xd033('0x1e');var _0x16f29c=_0x4b52ea[_0xd033('0x1f')];var _0x4d8d7d=_0x20e850?0x0:_0x2b572d[_0xd033('0x20')];var _0x40babe=_0x20e850?_0x4b52ea[_0xd033('0x1f')]:_0x2b572d[_0xd033('0x20')]+_0x2b572d[_0xd033('0x21')];var _0x390a67;if(_0x40babe>=_0x16f29c){_0x40babe=_0x16f29c;_0x390a67=0xc8;}else{_0x390a67=0xce;}_0x135c5d[_0xd033('0x1d')](_0x390a67);return _0x135c5d['set'](_0xd033('0x22'),_0x4d8d7d+'-'+_0x40babe+'/'+_0x16f29c)[_0xd033('0x23')](_0x4b52ea);}return null;};}function patchUpdates(_0x4bc9e7){return function(_0x426d86){try{jsonpatch[_0xd033('0x24')](_0x426d86,_0x4bc9e7,!![]);}catch(_0x27844d){return BPromise[_0xd033('0x25')](_0x27844d);}return _0x426d86[_0xd033('0x26')]();};}function saveUpdates(_0x16f5c5,_0x1cf622){return function(_0x299a30){if(_0x299a30){return _0x299a30['update'](_0x16f5c5)[_0xd033('0x27')](function(_0x3de312){return _0x3de312;});}return null;};}function removeEntity(_0x5660c3,_0x2211cb){return function(_0x56f9d8){if(_0x56f9d8){return _0x56f9d8[_0xd033('0x28')]()['then'](function(){var _0x57c1ac=_0x56f9d8[_0xd033('0x29')]({'plain':!![]});var _0x310339=_0xd033('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x310339,'resourceId':_0x57c1ac['id']}})[_0xd033('0x27')](function(){return _0x56f9d8;});})[_0xd033('0x27')](function(){_0x5660c3[_0xd033('0x1d')](0xcc)[_0xd033('0x2b')]();});}};}function handleEntityNotFound(_0x3af488,_0x19ceaf){return function(_0x67d6e2){if(!_0x67d6e2){_0x3af488[_0xd033('0x1c')](0x194);}return _0x67d6e2;};}function handleError(_0x4bdbd0,_0x3e98d9){_0x3e98d9=_0x3e98d9||0x1f4;return function(_0x37efe4){logger[_0xd033('0x2c')](_0x37efe4[_0xd033('0x2d')]);if(_0x37efe4[_0xd033('0x2e')]){delete _0x37efe4[_0xd033('0x2e')];}_0x4bdbd0[_0xd033('0x1d')](_0x3e98d9)[_0xd033('0x2f')](_0x37efe4);};}exports[_0xd033('0x30')]=function(_0x341b4a,_0x31dce4){var _0x26b944={},_0x4b6172={},_0x497a46={'count':0x0,'rows':[]};var _0x272ea4=_[_0xd033('0x31')](db[_0xd033('0x32')][_0xd033('0x33')],function(_0x291763){return{'name':_0x291763[_0xd033('0x34')],'type':_0x291763[_0xd033('0x35')][_0xd033('0x36')]};});_0x4b6172['model']=_[_0xd033('0x31')](_0x272ea4,_0xd033('0x2e'));_0x4b6172[_0xd033('0x37')]=_[_0xd033('0x38')](_0x341b4a[_0xd033('0x37')]);_0x4b6172[_0xd033('0x39')]=_[_0xd033('0x3a')](_0x4b6172[_0xd033('0x3b')],_0x4b6172[_0xd033('0x37')]);_0x26b944['attributes']=_['intersection'](_0x4b6172[_0xd033('0x3b')],qs[_0xd033('0x3c')](_0x341b4a[_0xd033('0x37')]['fields']));_0x26b944[_0xd033('0x3d')]=_0x26b944['attributes'][_0xd033('0x3e')]?_0x26b944['attributes']:_0x4b6172[_0xd033('0x3b')];if(!_0x341b4a[_0xd033('0x37')][_0xd033('0x3f')]('nolimit')){_0x26b944[_0xd033('0x21')]=qs[_0xd033('0x21')](_0x341b4a[_0xd033('0x37')][_0xd033('0x21')]);_0x26b944[_0xd033('0x20')]=qs['offset'](_0x341b4a[_0xd033('0x37')]['offset']);}_0x26b944[_0xd033('0x40')]=qs[_0xd033('0x41')](_0x341b4a[_0xd033('0x37')][_0xd033('0x41')]);_0x26b944['where']=qs[_0xd033('0x39')](_['pick'](_0x341b4a[_0xd033('0x37')],_0x4b6172['filters']),_0x272ea4);if(_0x341b4a[_0xd033('0x37')][_0xd033('0x42')]){_0x26b944[_0xd033('0x43')]=_[_0xd033('0x44')](_0x26b944[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0x272ea4,function(_0x5f58ba){if(_0x5f58ba['type']!=='VIRTUAL'){var _0x390d13={};_0x390d13[_0x5f58ba[_0xd033('0x2e')]]={'$like':'%'+_0x341b4a[_0xd033('0x37')][_0xd033('0x42')]+'%'};return _0x390d13;}})});}_0x26b944=_[_0xd033('0x44')]({},_0x26b944,_0x341b4a['options']);var _0x3aae11={'where':_0x26b944[_0xd033('0x43')]};return db['WhatsappQueue'][_0xd033('0x1f')](_0x3aae11)[_0xd033('0x27')](function(_0x7cccad){_0x497a46[_0xd033('0x1f')]=_0x7cccad;if(_0x341b4a[_0xd033('0x37')][_0xd033('0x45')]){_0x26b944[_0xd033('0x46')]=[{'all':!![]}];}return db[_0xd033('0x32')][_0xd033('0x47')](_0x26b944);})[_0xd033('0x27')](function(_0x2d236e){_0x497a46[_0xd033('0x48')]=_0x2d236e;return _0x497a46;})[_0xd033('0x27')](respondWithFilteredResult(_0x31dce4,_0x26b944))[_0xd033('0x49')](handleError(_0x31dce4,null));};exports[_0xd033('0x4a')]=function(_0x23cd29,_0x14a1ed){var _0x342564={'raw':!![],'where':{'id':_0x23cd29['params']['id']}},_0x4b0c46={};_0x4b0c46[_0xd033('0x3b')]=_[_0xd033('0x38')](db[_0xd033('0x32')][_0xd033('0x33')]);_0x4b0c46[_0xd033('0x37')]=_[_0xd033('0x38')](_0x23cd29['query']);_0x4b0c46[_0xd033('0x39')]=_[_0xd033('0x3a')](_0x4b0c46[_0xd033('0x3b')],_0x4b0c46['query']);_0x342564[_0xd033('0x3d')]=_['intersection'](_0x4b0c46['model'],qs[_0xd033('0x3c')](_0x23cd29[_0xd033('0x37')][_0xd033('0x3c')]));_0x342564[_0xd033('0x3d')]=_0x342564['attributes']['length']?_0x342564[_0xd033('0x3d')]:_0x4b0c46[_0xd033('0x3b')];if(_0x23cd29[_0xd033('0x37')][_0xd033('0x45')]){_0x342564[_0xd033('0x46')]=[{'all':!![]}];}_0x342564=_[_0xd033('0x44')]({},_0x342564,_0x23cd29[_0xd033('0x4b')]);return db[_0xd033('0x32')][_0xd033('0x4c')](_0x342564)['then'](handleEntityNotFound(_0x14a1ed,null))[_0xd033('0x27')](respondWithResult(_0x14a1ed,null))[_0xd033('0x49')](handleError(_0x14a1ed,null));};exports['create']=function(_0x40496b,_0x47265a){return db[_0xd033('0x32')][_0xd033('0x4d')](_0x40496b[_0xd033('0x4e')],{})['then'](function(_0x1fcf10){var _0x3e8bbd=_0x40496b[_0xd033('0x4f')][_0xd033('0x29')]({'plain':!![]});if(!_0x3e8bbd)throw new Error(_0xd033('0x50'));if(_0x3e8bbd[_0xd033('0x51')]===_0xd033('0x4f')){var _0x5409ff=_0x1fcf10[_0xd033('0x29')]({'plain':!![]});var _0x4a3fc6='WhatsappQueues';return db['UserProfileSection'][_0xd033('0x4c')]({'where':{'name':_0x4a3fc6,'userProfileId':_0x3e8bbd[_0xd033('0x52')]},'raw':!![]})[_0xd033('0x27')](function(_0x2d7176){if(_0x2d7176&&_0x2d7176[_0xd033('0x53')]===0x0){return db[_0xd033('0x54')][_0xd033('0x4d')]({'name':_0x5409ff[_0xd033('0x2e')],'resourceId':_0x5409ff['id'],'type':_0x2d7176[_0xd033('0x2e')],'sectionId':_0x2d7176['id']},{})[_0xd033('0x27')](function(){return _0x1fcf10;});}else{return _0x1fcf10;}})[_0xd033('0x49')](function(_0x477314){logger[_0xd033('0x2c')](_0xd033('0x55'),_0x477314);throw _0x477314;});}return _0x1fcf10;})[_0xd033('0x27')](respondWithResult(_0x47265a,0xc9))[_0xd033('0x49')](handleError(_0x47265a,null));};exports[_0xd033('0x56')]=function(_0x33e357,_0xff88a1){if(_0x33e357[_0xd033('0x4e')]['id']){delete _0x33e357[_0xd033('0x4e')]['id'];}return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x33e357[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0xff88a1,null))[_0xd033('0x27')](saveUpdates(_0x33e357[_0xd033('0x4e')],null))[_0xd033('0x27')](respondWithResult(_0xff88a1,null))[_0xd033('0x49')](handleError(_0xff88a1,null));};exports['destroy']=function(_0x3e1803,_0x179216){return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x3e1803[_0xd033('0x57')]['id']}})['then'](handleEntityNotFound(_0x179216,null))[_0xd033('0x27')](removeEntity(_0x179216,null))[_0xd033('0x49')](handleError(_0x179216,null));};exports[_0xd033('0x58')]=function(_0x1e54df,_0x3f361a){return db[_0xd033('0x32')][_0xd033('0x58')]()[_0xd033('0x27')](respondWithResult(_0x3f361a,null))[_0xd033('0x49')](handleError(_0x3f361a,null));};exports['getMembers']=function(_0x587900,_0x5baf5c,_0x513844){var _0xf97459={'raw':!![],'where':{}},_0x117893={},_0x4114bf;return db[_0xd033('0x32')]['findOne']({'where':{'id':_0x587900[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0x5baf5c,null))[_0xd033('0x27')](function(_0x30a495){if(_0x30a495){_0x4114bf=_0x30a495[_0xd033('0x29')]({'plain':!![]});_0x117893[_0xd033('0x3b')]=_[_0xd033('0x38')](db[_0xd033('0x59')]['rawAttributes']);_0x117893['query']=_[_0xd033('0x38')](_0x587900[_0xd033('0x37')]);_0x117893[_0xd033('0x39')]=_['intersection'](_0x117893['model'],_0x117893[_0xd033('0x37')]);_0xf97459[_0xd033('0x3d')]=_[_0xd033('0x3a')](_0x117893['model'],qs['fields'](_0x587900[_0xd033('0x37')][_0xd033('0x3c')]));_0xf97459['attributes']=_0xf97459[_0xd033('0x3d')][_0xd033('0x3e')]?_0xf97459[_0xd033('0x3d')]:_0x117893[_0xd033('0x3b')];if(!_0x587900[_0xd033('0x37')][_0xd033('0x3f')]('nolimit')){_0xf97459[_0xd033('0x21')]=qs[_0xd033('0x21')](_0x587900[_0xd033('0x37')][_0xd033('0x21')]);_0xf97459[_0xd033('0x20')]=qs[_0xd033('0x20')](_0x587900[_0xd033('0x37')][_0xd033('0x20')]);}_0xf97459[_0xd033('0x40')]=qs[_0xd033('0x41')](_0x587900[_0xd033('0x37')][_0xd033('0x41')]);_0xf97459['where']=qs[_0xd033('0x39')](_[_0xd033('0x5a')](_0x587900[_0xd033('0x37')],_0x117893['filters']));_0xf97459[_0xd033('0x43')][_0xd033('0x5b')]=_0x30a495['id'];if(_0x587900['query'][_0xd033('0x42')]){_0xf97459[_0xd033('0x43')]=_[_0xd033('0x44')](_0xf97459[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0xf97459[_0xd033('0x3d')],function(_0x34f1a5){var _0x3855ae={};_0x3855ae[_0x34f1a5]={'$like':'%'+_0x587900['query'][_0xd033('0x42')]+'%'};return _0x3855ae;})});}_0xf97459=_[_0xd033('0x44')]({},_0xf97459,_0x587900[_0xd033('0x4b')]);return db[_0xd033('0x59')][_0xd033('0x47')](_0xf97459);}})[_0xd033('0x27')](function(_0x2d0e36){if(_0x2d0e36){return db['User'][_0xd033('0x5c')]({'where':{'id':_[_0xd033('0x31')](_0x2d0e36,_0xd033('0x5d')),'role':'agent'},'attributes':['id',_0xd033('0x2e'),_0xd033('0x5e'),'updatedAt',_0xd033('0x5f')]});}})['then'](function(_0x257872){if(_0x257872){return{'count':_0x257872['count'],'rows':_[_0xd033('0x31')](_0x257872[_0xd033('0x48')],function(_0x1952b7){return{'membername':_0x1952b7['name'],'UserId':_0x1952b7['id'],'queue_name':_0x4114bf[_0xd033('0x2e')],'WhatsappQueueId':_0x4114bf['id'],'interface':util[_0xd033('0x60')]('%s/%s','SIP',_0x1952b7['name']),'penalty':0x0,'paused':_0x1952b7[_0xd033('0x5e')],'createdAt':_0x1952b7[_0xd033('0x5f')],'updatedAt':_0x1952b7[_0xd033('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd033('0x27')](respondWithFilteredResult(_0x5baf5c,_0xf97459))[_0xd033('0x49')](handleError(_0x5baf5c,null));};exports[_0xd033('0x62')]=function(_0x59796d,_0x11f33b,_0x47db23){var _0x210d0e={};var _0x3f6482={};var _0x2886ab;var _0x4cae2a;return db[_0xd033('0x32')]['findOne']({'where':{'id':_0x59796d['params']['id']}})['then'](handleEntityNotFound(_0x11f33b,null))['then'](function(_0x1a481f){if(_0x1a481f){_0x2886ab=_0x1a481f;_0x3f6482[_0xd033('0x3b')]=_['keys'](db[_0xd033('0x63')][_0xd033('0x33')]);_0x3f6482[_0xd033('0x37')]=_[_0xd033('0x38')](_0x59796d['query']);_0x3f6482[_0xd033('0x39')]=_['intersection'](_0x3f6482[_0xd033('0x3b')],_0x3f6482['query']);_0x210d0e[_0xd033('0x3d')]=_['intersection'](_0x3f6482[_0xd033('0x3b')],qs[_0xd033('0x3c')](_0x59796d['query'][_0xd033('0x3c')]));_0x210d0e['attributes']=_0x210d0e[_0xd033('0x3d')]['length']?_0x210d0e[_0xd033('0x3d')]:_0x3f6482[_0xd033('0x3b')];_0x210d0e['order']=qs['sort'](_0x59796d['query']['sort']);_0x210d0e['where']=qs[_0xd033('0x39')](_['pick'](_0x59796d['query'],_0x3f6482['filters']));if(_0x59796d[_0xd033('0x37')][_0xd033('0x42')]){_0x210d0e[_0xd033('0x43')]=_[_0xd033('0x44')](_0x210d0e[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0x210d0e['attributes'],function(_0x17cfc6){var _0x214917={};_0x214917[_0x17cfc6]={'$like':'%'+_0x59796d[_0xd033('0x37')][_0xd033('0x42')]+'%'};return _0x214917;})});}_0x210d0e=_[_0xd033('0x44')]({},_0x210d0e,_0x59796d[_0xd033('0x4b')]);return _0x2886ab[_0xd033('0x62')](_0x210d0e);}})['then'](function(_0x46ff2b){if(_0x46ff2b){_0x4cae2a=_0x46ff2b[_0xd033('0x3e')];if(!_0x59796d[_0xd033('0x37')]['hasOwnProperty']('nolimit')){_0x210d0e[_0xd033('0x21')]=qs['limit'](_0x59796d[_0xd033('0x37')][_0xd033('0x21')]);_0x210d0e[_0xd033('0x20')]=qs['offset'](_0x59796d[_0xd033('0x37')][_0xd033('0x20')]);}return _0x2886ab['getTeams'](_0x210d0e);}})[_0xd033('0x27')](function(_0x1042be){if(_0x1042be){return _0x1042be?{'count':_0x4cae2a,'rows':_0x1042be}:null;}})[_0xd033('0x27')](respondWithResult(_0x11f33b,null))[_0xd033('0x49')](handleError(_0x11f33b,null));};exports['addTeams']=function(_0x5dba22,_0x476c9e,_0x4cbf89){var _0x23af5f=_0x5dba22[_0xd033('0x4e')][_0xd033('0x64')];return db['Team'][_0xd033('0x47')]({'where':{'id':_0x23af5f},'attributes':['id'],'include':[{'model':db[_0xd033('0x65')],'as':_0xd033('0x66'),'attributes':['id',_0xd033('0x2e'),'online',_0xd033('0x67'),_0xd033('0x68')],'raw':!![]}]})['then'](function(_0x5045d3){if(_0x5045d3){var _0x94a76f=_[_0xd033('0x69')](_0x5045d3,function(_0x544bea){var _0x3a6c9d=_0x544bea[_0xd033('0x29')]({'plain':!![]});return _0x3a6c9d[_0xd033('0x66')];});return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x5dba22[_0xd033('0x57')]['id']}})[_0xd033('0x27')](function(_0x28f2a1){return db[_0xd033('0x6a')][_0xd033('0x6b')](function(_0x481ce7){return _0x28f2a1[_0xd033('0x6c')](_0x23af5f,{'transaction':_0x481ce7})['then'](function(){return BPromise['each'](_0x94a76f,function(_0xd2e52c){return db[_0xd033('0x59')][_0xd033('0x6d')]({'where':{'UserId':_0xd2e52c['id'],'WhatsappQueueId':_0x5dba22['params']['id']},'transaction':_0x481ce7});});})[_0xd033('0x27')](function(){_0x94a76f[_0xd033('0x6e')](function(_0x17952d){socket['emit'](_0xd033('0x6f'),{'UserId':_0x17952d['id'],'WhatsappQueueId':_0x28f2a1['id']});});});});});}})['then'](respondWithStatusCode(_0x476c9e,null))[_0xd033('0x49')](handleError(_0x476c9e,null));};exports[_0xd033('0x70')]=function(_0x3c3a56,_0x4688dc,_0x4ec8d4){return db[_0xd033('0x63')][_0xd033('0x47')]({'where':{'id':_0x3c3a56[_0xd033('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd033('0x65')],'as':_0xd033('0x66'),'attributes':['id'],'raw':!![]}]})[_0xd033('0x27')](handleEntityNotFound(_0x4688dc,null))[_0xd033('0x27')](function(_0x58de7c){var _0x2dadcf=_['map'](_0x58de7c,'id');var _0x5b06ba=[];var _0x2290ca=[];var _0x559e16=squel[_0xd033('0x71')]();_0x559e16[_0xd033('0x72')]('tq.TeamId')['from']('team_has_whatsapp_queues','tq')[_0xd033('0x73')](_0xd033('0x74'),'ut',_0xd033('0x75'))[_0xd033('0x43')](_0xd033('0x76'),_0x3c3a56[_0xd033('0x57')]['id']);for(var _0x26386f=0x0;_0x26386f<_0x58de7c['length'];_0x26386f+=0x1){let _0x1521a7=_0x58de7c[_0x26386f];for(var _0x4a0b3f=0x0;_0x4a0b3f<_0x1521a7['Agents'][_0xd033('0x3e')];_0x4a0b3f+=0x1){let _0x268e08=_0x1521a7[_0xd033('0x66')][_0x4a0b3f];var _0x10f2ca=_0x559e16[_0xd033('0x77')]();_0x10f2ca['where']('ut.UserId\x20=\x20?',_0x268e08['id']);_0x2290ca[_0xd033('0x78')](db[_0xd033('0x6a')][_0xd033('0x37')](_0x10f2ca['toString'](),{'type':db[_0xd033('0x6a')][_0xd033('0x79')][_0xd033('0x7a')]})['then'](function(_0xabd447){if(_0xabd447[_0xd033('0x3e')]===0x1){return _0x268e08['id'];}else{var _0x1155b7=_[_0xd033('0x7b')](_['map'](_0xabd447,_0xd033('0x7c')),function(_0x1c2965){return _[_0xd033('0x7d')](_0x2dadcf,_0x1c2965);});if(_0x1155b7){return _0x268e08['id'];}}}));}}return BPromise[_0xd033('0x7e')](_0x2290ca)[_0xd033('0x27')](function(_0x504fd7){_0x5b06ba=_(_0x5b06ba)[_0xd033('0x7f')](_0x504fd7)[_0xd033('0x80')]()[_0xd033('0x81')]();return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x3c3a56[_0xd033('0x57')]['id']}})['then'](function(_0x196c37){return db['sequelize'][_0xd033('0x6b')](function(_0x20175a){return _0x196c37[_0xd033('0x70')](_0x3c3a56[_0xd033('0x37')][_0xd033('0x64')],{'transaction':_0x20175a})['then'](function(){if(!_[_0xd033('0x82')](_0x5b06ba)){return _0x196c37[_0xd033('0x83')](_0x5b06ba,{'transaction':_0x20175a});}})['then'](function(){_0x5b06ba[_0xd033('0x6e')](function(_0x3cb819){socket[_0xd033('0x84')]('userWhatsappQueue:remove',{'UserId':_0x3cb819,'WhatsappQueueId':_0x196c37['id']});});});});});});})[_0xd033('0x27')](respondWithStatusCode(_0x4688dc,null))[_0xd033('0x49')](handleError(_0x4688dc,null));};exports['addAgents']=function(_0x45c661,_0xd9b066,_0x743f4a){return db[_0xd033('0x32')][_0xd033('0x4c')]({'where':{'id':_0x45c661[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0xd9b066,null))[_0xd033('0x27')](function(_0x54ff07){if(_0x54ff07){return _0x54ff07[_0xd033('0x85')](_0x45c661['body'][_0xd033('0x64')],_['omit'](_0x45c661[_0xd033('0x4e')],['ids','id'])||{})[_0xd033('0x86')](function(_0x3a67fc){for(var _0x26d7b1=0x0;_0x26d7b1<_0x45c661[_0xd033('0x4e')][_0xd033('0x64')][_0xd033('0x3e')];_0x26d7b1+=0x1){socket[_0xd033('0x84')]('userWhatsappQueue:save',{'UserId':Number(_0x45c661['body'][_0xd033('0x64')][_0x26d7b1]),'WhatsappQueueId':Number(_0x45c661[_0xd033('0x57')]['id'])});}return _0x3a67fc;});}})['then'](respondWithResult(_0xd9b066,null))[_0xd033('0x49')](handleError(_0xd9b066,null));};exports['removeAgents']=function(_0x5ac379,_0x43d4a7,_0x62b2f1){return db[_0xd033('0x32')]['find']({'where':{'id':_0x5ac379[_0xd033('0x57')]['id']}})[_0xd033('0x27')](handleEntityNotFound(_0x43d4a7,null))[_0xd033('0x27')](function(_0x2db1c9){if(_0x2db1c9){return _0x2db1c9[_0xd033('0x83')](_0x5ac379['query'][_0xd033('0x64')])[_0xd033('0x27')](function(){if(_['isArray'](_0x5ac379[_0xd033('0x37')][_0xd033('0x64')])){for(var _0x10c214=0x0;_0x10c214<_0x5ac379[_0xd033('0x37')][_0xd033('0x64')][_0xd033('0x3e')];_0x10c214+=0x1){socket[_0xd033('0x84')](_0xd033('0x87'),{'UserId':Number(_0x5ac379['query'][_0xd033('0x64')][_0x10c214]),'WhatsappQueueId':Number(_0x5ac379['params']['id'])});}}else{socket[_0xd033('0x84')]('userWhatsappQueue:remove',{'UserId':Number(_0x5ac379[_0xd033('0x37')][_0xd033('0x64')]),'WhatsappQueueId':Number(_0x5ac379['params']['id'])});}});}})[_0xd033('0x27')](respondWithStatusCode(_0x43d4a7,null))[_0xd033('0x49')](handleError(_0x43d4a7,null));};exports[_0xd033('0x88')]=function(_0x328bfd,_0x5056b4,_0x5f2f3b){var _0x504dff={};var _0xb5deb1={};var _0x4f6e10;var _0x2cfe82;return db[_0xd033('0x32')][_0xd033('0x89')]({'where':{'id':_0x328bfd[_0xd033('0x57')]['id']}})['then'](handleEntityNotFound(_0x5056b4,null))['then'](function(_0x2c6f0b){if(_0x2c6f0b){_0x4f6e10=_0x2c6f0b;_0xb5deb1['model']=_['keys'](db[_0xd033('0x65')][_0xd033('0x33')]);_0xb5deb1[_0xd033('0x37')]=_[_0xd033('0x38')](_0x328bfd[_0xd033('0x37')]);_0xb5deb1[_0xd033('0x39')]=_[_0xd033('0x3a')](_0xb5deb1[_0xd033('0x3b')],_0xb5deb1[_0xd033('0x37')]);_0x504dff[_0xd033('0x3d')]=_[_0xd033('0x3a')](_0xb5deb1['model'],qs['fields'](_0x328bfd[_0xd033('0x37')][_0xd033('0x3c')]));_0x504dff[_0xd033('0x3d')]=_0x504dff[_0xd033('0x3d')][_0xd033('0x3e')]?_0x504dff[_0xd033('0x3d')]:_0xb5deb1['model'];_0x504dff[_0xd033('0x40')]=qs[_0xd033('0x41')](_0x328bfd[_0xd033('0x37')][_0xd033('0x41')]);_0x504dff[_0xd033('0x43')]=qs[_0xd033('0x39')](_[_0xd033('0x5a')](_0x328bfd[_0xd033('0x37')],_0xb5deb1[_0xd033('0x39')]));if(_0x328bfd[_0xd033('0x37')][_0xd033('0x42')]){_0x504dff[_0xd033('0x43')]=_['merge'](_0x504dff[_0xd033('0x43')],{'$or':_[_0xd033('0x31')](_0x504dff['attributes'],function(_0x1ead0e){var _0x1121c0={};_0x1121c0[_0x1ead0e]={'$like':'%'+_0x328bfd[_0xd033('0x37')][_0xd033('0x42')]+'%'};return _0x1121c0;})});}_0x504dff=_[_0xd033('0x44')]({},_0x504dff,_0x328bfd['options']);return _0x4f6e10[_0xd033('0x88')](_0x504dff);}})[_0xd033('0x27')](function(_0x183961){if(_0x183961){_0x2cfe82=_0x183961[_0xd033('0x3e')];if(!_0x328bfd['query'][_0xd033('0x3f')](_0xd033('0x8a'))){_0x504dff[_0xd033('0x21')]=qs['limit'](_0x328bfd['query']['limit']);_0x504dff[_0xd033('0x20')]=qs[_0xd033('0x20')](_0x328bfd[_0xd033('0x37')][_0xd033('0x20')]);}return _0x4f6e10[_0xd033('0x88')](_0x504dff);}})[_0xd033('0x27')](function(_0x181d27){if(_0x181d27){return _0x181d27?{'count':_0x2cfe82,'rows':_0x181d27}:null;}})[_0xd033('0x27')](respondWithResult(_0x5056b4,null))['catch'](handleError(_0x5056b4,null));}; \ No newline at end of file +var _0xac85=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','map','WhatsappQueue','fieldName','type','key','model','keys','intersection','fields','query','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','nolimit','pick','User','findAndCountAll','UserId','whatsappPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','team_has_whatsapp_queues','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x468cab,_0x295397){var _0x408c70=function(_0x26c411){while(--_0x26c411){_0x468cab['push'](_0x468cab['shift']());}};_0x408c70(++_0x295397);}(_0xac85,0x190));var _0x5ac8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xac85[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ac8('0x0'));var jsonpatch=require(_0x5ac8('0x1'));var rp=require(_0x5ac8('0x2'));var moment=require(_0x5ac8('0x3'));var BPromise=require(_0x5ac8('0x4'));var Mustache=require(_0x5ac8('0x5'));var util=require(_0x5ac8('0x6'));var path=require(_0x5ac8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ac8('0x8'));var _=require('lodash');var squel=require(_0x5ac8('0x9'));var crypto=require(_0x5ac8('0xa'));var jsforce=require(_0x5ac8('0xb'));var deskjs=require(_0x5ac8('0xc'));var toCsv=require(_0x5ac8('0xd'));var querystring=require(_0x5ac8('0xe'));var Papa=require('papaparse');var Redis=require(_0x5ac8('0xf'));var authService=require(_0x5ac8('0x10'));var qs=require(_0x5ac8('0x11'));var as=require(_0x5ac8('0x12'));var hardwareService=require(_0x5ac8('0x13'));var logger=require(_0x5ac8('0x14'))(_0x5ac8('0x15'));var utils=require(_0x5ac8('0x16'));var config=require(_0x5ac8('0x17'));var licenseUtil=require(_0x5ac8('0x18'));var db=require(_0x5ac8('0x19'))['db'];config['redis']=_[_0x5ac8('0x1a')](config[_0x5ac8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ac8('0x1c'))(new Redis(config[_0x5ac8('0x1b')]));require('./whatsappQueue.socket')[_0x5ac8('0x1d')](socket);function respondWithStatusCode(_0x296333,_0x152cc5){_0x152cc5=_0x152cc5||0xcc;return function(_0x6bd10b){if(_0x6bd10b){return _0x296333[_0x5ac8('0x1e')](_0x152cc5);}return _0x296333[_0x5ac8('0x1f')](_0x152cc5)[_0x5ac8('0x20')]();};}function respondWithResult(_0x396786,_0x19330c){_0x19330c=_0x19330c||0xc8;return function(_0x42b6ef){if(_0x42b6ef){return _0x396786[_0x5ac8('0x1f')](_0x19330c)['json'](_0x42b6ef);}};}function respondWithFilteredResult(_0x3e5149,_0x2fb8f5){return function(_0x3a82aa){if(_0x3a82aa){var _0x391c8b=typeof _0x2fb8f5[_0x5ac8('0x21')]===_0x5ac8('0x22')&&typeof _0x2fb8f5['limit']===_0x5ac8('0x22');var _0x48cd0b=_0x3a82aa['count'];var _0x23dd94=_0x391c8b?0x0:_0x2fb8f5['offset'];var _0x1f0ca8=_0x391c8b?_0x3a82aa[_0x5ac8('0x23')]:_0x2fb8f5[_0x5ac8('0x21')]+_0x2fb8f5[_0x5ac8('0x24')];var _0x549a87;if(_0x1f0ca8>=_0x48cd0b){_0x1f0ca8=_0x48cd0b;_0x549a87=0xc8;}else{_0x549a87=0xce;}_0x3e5149[_0x5ac8('0x1f')](_0x549a87);return _0x3e5149['set'](_0x5ac8('0x25'),_0x23dd94+'-'+_0x1f0ca8+'/'+_0x48cd0b)[_0x5ac8('0x26')](_0x3a82aa);}return null;};}function patchUpdates(_0x5cccd6){return function(_0x188cf1){try{jsonpatch[_0x5ac8('0x27')](_0x188cf1,_0x5cccd6,!![]);}catch(_0x24aaf2){return BPromise['reject'](_0x24aaf2);}return _0x188cf1[_0x5ac8('0x28')]();};}function saveUpdates(_0x519721,_0x8523e8){return function(_0x516e53){if(_0x516e53){return _0x516e53[_0x5ac8('0x29')](_0x519721)[_0x5ac8('0x2a')](function(_0x2a9d92){return _0x2a9d92;});}return null;};}function removeEntity(_0x5f4d7d,_0x479756){return function(_0x1abd3b){if(_0x1abd3b){return _0x1abd3b[_0x5ac8('0x2b')]()[_0x5ac8('0x2a')](function(){var _0x364f79=_0x1abd3b[_0x5ac8('0x2c')]({'plain':!![]});var _0x42c4bb=_0x5ac8('0x2d');return db[_0x5ac8('0x2e')]['destroy']({'where':{'type':_0x42c4bb,'resourceId':_0x364f79['id']}})[_0x5ac8('0x2a')](function(){return _0x1abd3b;});})[_0x5ac8('0x2a')](function(){_0x5f4d7d[_0x5ac8('0x1f')](0xcc)[_0x5ac8('0x20')]();});}};}function handleEntityNotFound(_0x44a6bf,_0x5f3aac){return function(_0x5c5f53){if(!_0x5c5f53){_0x44a6bf['sendStatus'](0x194);}return _0x5c5f53;};}function handleError(_0x5943b2,_0x1087ba){_0x1087ba=_0x1087ba||0x1f4;return function(_0x5cb990){logger[_0x5ac8('0x2f')](_0x5cb990[_0x5ac8('0x30')]);if(_0x5cb990[_0x5ac8('0x31')]){delete _0x5cb990['name'];}_0x5943b2[_0x5ac8('0x1f')](_0x1087ba)['send'](_0x5cb990);};}exports[_0x5ac8('0x32')]=function(_0x360849,_0x2a4fb3){var _0x2c4fd2={},_0x111675={},_0x17634e={'count':0x0,'rows':[]};var _0x140c4b=_[_0x5ac8('0x33')](db[_0x5ac8('0x34')]['rawAttributes'],function(_0x3c9de7){return{'name':_0x3c9de7[_0x5ac8('0x35')],'type':_0x3c9de7[_0x5ac8('0x36')][_0x5ac8('0x37')]};});_0x111675[_0x5ac8('0x38')]=_[_0x5ac8('0x33')](_0x140c4b,_0x5ac8('0x31'));_0x111675['query']=_[_0x5ac8('0x39')](_0x360849['query']);_0x111675['filters']=_[_0x5ac8('0x3a')](_0x111675['model'],_0x111675['query']);_0x2c4fd2['attributes']=_['intersection'](_0x111675[_0x5ac8('0x38')],qs[_0x5ac8('0x3b')](_0x360849[_0x5ac8('0x3c')][_0x5ac8('0x3b')]));_0x2c4fd2[_0x5ac8('0x3d')]=_0x2c4fd2[_0x5ac8('0x3d')][_0x5ac8('0x3e')]?_0x2c4fd2['attributes']:_0x111675['model'];if(!_0x360849[_0x5ac8('0x3c')][_0x5ac8('0x3f')]('nolimit')){_0x2c4fd2[_0x5ac8('0x24')]=qs[_0x5ac8('0x24')](_0x360849[_0x5ac8('0x3c')][_0x5ac8('0x24')]);_0x2c4fd2['offset']=qs['offset'](_0x360849[_0x5ac8('0x3c')][_0x5ac8('0x21')]);}_0x2c4fd2[_0x5ac8('0x40')]=qs[_0x5ac8('0x41')](_0x360849['query']['sort']);_0x2c4fd2[_0x5ac8('0x42')]=qs['filters'](_['pick'](_0x360849[_0x5ac8('0x3c')],_0x111675[_0x5ac8('0x43')]),_0x140c4b);if(_0x360849[_0x5ac8('0x3c')]['filter']){_0x2c4fd2[_0x5ac8('0x42')]=_[_0x5ac8('0x44')](_0x2c4fd2[_0x5ac8('0x42')],{'$or':_[_0x5ac8('0x33')](_0x140c4b,function(_0x526b4b){if(_0x526b4b[_0x5ac8('0x36')]!==_0x5ac8('0x45')){var _0x1c6296={};_0x1c6296[_0x526b4b[_0x5ac8('0x31')]]={'$like':'%'+_0x360849[_0x5ac8('0x3c')][_0x5ac8('0x46')]+'%'};return _0x1c6296;}})});}_0x2c4fd2=_[_0x5ac8('0x44')]({},_0x2c4fd2,_0x360849['options']);var _0x46a5a8={'where':_0x2c4fd2[_0x5ac8('0x42')]};return db[_0x5ac8('0x34')][_0x5ac8('0x23')](_0x46a5a8)['then'](function(_0x32d98e){_0x17634e[_0x5ac8('0x23')]=_0x32d98e;if(_0x360849[_0x5ac8('0x3c')][_0x5ac8('0x47')]){_0x2c4fd2[_0x5ac8('0x48')]=[{'all':!![]}];}return db[_0x5ac8('0x34')][_0x5ac8('0x49')](_0x2c4fd2);})[_0x5ac8('0x2a')](function(_0x4d9793){_0x17634e[_0x5ac8('0x4a')]=_0x4d9793;return _0x17634e;})[_0x5ac8('0x2a')](respondWithFilteredResult(_0x2a4fb3,_0x2c4fd2))[_0x5ac8('0x4b')](handleError(_0x2a4fb3,null));};exports['show']=function(_0x2b0220,_0x2c3fbb){var _0x52b1b9={'raw':!![],'where':{'id':_0x2b0220[_0x5ac8('0x4c')]['id']}},_0x28ab76={};_0x28ab76[_0x5ac8('0x38')]=_[_0x5ac8('0x39')](db['WhatsappQueue'][_0x5ac8('0x4d')]);_0x28ab76[_0x5ac8('0x3c')]=_[_0x5ac8('0x39')](_0x2b0220[_0x5ac8('0x3c')]);_0x28ab76['filters']=_['intersection'](_0x28ab76[_0x5ac8('0x38')],_0x28ab76[_0x5ac8('0x3c')]);_0x52b1b9[_0x5ac8('0x3d')]=_['intersection'](_0x28ab76[_0x5ac8('0x38')],qs[_0x5ac8('0x3b')](_0x2b0220[_0x5ac8('0x3c')][_0x5ac8('0x3b')]));_0x52b1b9[_0x5ac8('0x3d')]=_0x52b1b9[_0x5ac8('0x3d')][_0x5ac8('0x3e')]?_0x52b1b9['attributes']:_0x28ab76['model'];if(_0x2b0220[_0x5ac8('0x3c')][_0x5ac8('0x47')]){_0x52b1b9[_0x5ac8('0x48')]=[{'all':!![]}];}_0x52b1b9=_[_0x5ac8('0x44')]({},_0x52b1b9,_0x2b0220[_0x5ac8('0x4e')]);return db[_0x5ac8('0x34')][_0x5ac8('0x4f')](_0x52b1b9)[_0x5ac8('0x2a')](handleEntityNotFound(_0x2c3fbb,null))[_0x5ac8('0x2a')](respondWithResult(_0x2c3fbb,null))[_0x5ac8('0x4b')](handleError(_0x2c3fbb,null));};exports[_0x5ac8('0x50')]=function(_0x56521a,_0x4c56f8){return db[_0x5ac8('0x34')][_0x5ac8('0x50')](_0x56521a['body'],{})[_0x5ac8('0x2a')](function(_0x30fc2c){var _0x1c03f3=_0x56521a[_0x5ac8('0x51')][_0x5ac8('0x2c')]({'plain':!![]});if(!_0x1c03f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c03f3[_0x5ac8('0x52')]===_0x5ac8('0x51')){var _0x4a261f=_0x30fc2c[_0x5ac8('0x2c')]({'plain':!![]});var _0x37c6e0=_0x5ac8('0x2d');return db[_0x5ac8('0x53')][_0x5ac8('0x4f')]({'where':{'name':_0x37c6e0,'userProfileId':_0x1c03f3[_0x5ac8('0x54')]},'raw':!![]})[_0x5ac8('0x2a')](function(_0x58f413){if(_0x58f413&&_0x58f413[_0x5ac8('0x55')]===0x0){return db[_0x5ac8('0x2e')][_0x5ac8('0x50')]({'name':_0x4a261f[_0x5ac8('0x31')],'resourceId':_0x4a261f['id'],'type':_0x58f413[_0x5ac8('0x31')],'sectionId':_0x58f413['id']},{})[_0x5ac8('0x2a')](function(){return _0x30fc2c;});}else{return _0x30fc2c;}})[_0x5ac8('0x4b')](function(_0x5bbe6b){logger[_0x5ac8('0x2f')](_0x5ac8('0x56'),_0x5bbe6b);throw _0x5bbe6b;});}return _0x30fc2c;})['then'](respondWithResult(_0x4c56f8,0xc9))[_0x5ac8('0x4b')](handleError(_0x4c56f8,null));};exports['update']=function(_0x359514,_0x41c184){if(_0x359514[_0x5ac8('0x57')]['id']){delete _0x359514[_0x5ac8('0x57')]['id'];}return db[_0x5ac8('0x34')]['find']({'where':{'id':_0x359514[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0x41c184,null))[_0x5ac8('0x2a')](saveUpdates(_0x359514[_0x5ac8('0x57')],null))[_0x5ac8('0x2a')](respondWithResult(_0x41c184,null))['catch'](handleError(_0x41c184,null));};exports[_0x5ac8('0x2b')]=function(_0x460155,_0x495bdb){return db['WhatsappQueue'][_0x5ac8('0x4f')]({'where':{'id':_0x460155[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0x495bdb,null))[_0x5ac8('0x2a')](removeEntity(_0x495bdb,null))['catch'](handleError(_0x495bdb,null));};exports[_0x5ac8('0x58')]=function(_0x232063,_0x431802){return db[_0x5ac8('0x34')]['describe']()[_0x5ac8('0x2a')](respondWithResult(_0x431802,null))[_0x5ac8('0x4b')](handleError(_0x431802,null));};exports[_0x5ac8('0x59')]=function(_0x4bc534,_0x17fe47,_0x2ef986){var _0xf92eb7={'raw':!![],'where':{}},_0x33873c={},_0x458f25;return db['WhatsappQueue'][_0x5ac8('0x5a')]({'where':{'id':_0x4bc534[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0x17fe47,null))[_0x5ac8('0x2a')](function(_0x534cc9){if(_0x534cc9){_0x458f25=_0x534cc9['get']({'plain':!![]});_0x33873c[_0x5ac8('0x38')]=_[_0x5ac8('0x39')](db[_0x5ac8('0x5b')][_0x5ac8('0x4d')]);_0x33873c[_0x5ac8('0x3c')]=_[_0x5ac8('0x39')](_0x4bc534['query']);_0x33873c['filters']=_[_0x5ac8('0x3a')](_0x33873c[_0x5ac8('0x38')],_0x33873c['query']);_0xf92eb7[_0x5ac8('0x3d')]=_['intersection'](_0x33873c[_0x5ac8('0x38')],qs[_0x5ac8('0x3b')](_0x4bc534[_0x5ac8('0x3c')][_0x5ac8('0x3b')]));_0xf92eb7[_0x5ac8('0x3d')]=_0xf92eb7['attributes'][_0x5ac8('0x3e')]?_0xf92eb7[_0x5ac8('0x3d')]:_0x33873c[_0x5ac8('0x38')];if(!_0x4bc534[_0x5ac8('0x3c')]['hasOwnProperty'](_0x5ac8('0x5c'))){_0xf92eb7[_0x5ac8('0x24')]=qs[_0x5ac8('0x24')](_0x4bc534[_0x5ac8('0x3c')][_0x5ac8('0x24')]);_0xf92eb7[_0x5ac8('0x21')]=qs[_0x5ac8('0x21')](_0x4bc534['query'][_0x5ac8('0x21')]);}_0xf92eb7[_0x5ac8('0x40')]=qs[_0x5ac8('0x41')](_0x4bc534[_0x5ac8('0x3c')][_0x5ac8('0x41')]);_0xf92eb7[_0x5ac8('0x42')]=qs[_0x5ac8('0x43')](_[_0x5ac8('0x5d')](_0x4bc534[_0x5ac8('0x3c')],_0x33873c['filters']));_0xf92eb7[_0x5ac8('0x42')]['WhatsappQueueId']=_0x534cc9['id'];if(_0x4bc534[_0x5ac8('0x3c')][_0x5ac8('0x46')]){_0xf92eb7[_0x5ac8('0x42')]=_[_0x5ac8('0x44')](_0xf92eb7[_0x5ac8('0x42')],{'$or':_['map'](_0xf92eb7[_0x5ac8('0x3d')],function(_0x32e197){var _0x1aa5aa={};_0x1aa5aa[_0x32e197]={'$like':'%'+_0x4bc534['query']['filter']+'%'};return _0x1aa5aa;})});}_0xf92eb7=_['merge']({},_0xf92eb7,_0x4bc534['options']);return db[_0x5ac8('0x5b')][_0x5ac8('0x49')](_0xf92eb7);}})[_0x5ac8('0x2a')](function(_0x1a6dd1){if(_0x1a6dd1){return db[_0x5ac8('0x5e')][_0x5ac8('0x5f')]({'where':{'id':_[_0x5ac8('0x33')](_0x1a6dd1,_0x5ac8('0x60')),'role':'agent'},'attributes':['id',_0x5ac8('0x31'),_0x5ac8('0x61'),_0x5ac8('0x62'),'createdAt']});}})[_0x5ac8('0x2a')](function(_0x428c1b){if(_0x428c1b){return{'count':_0x428c1b[_0x5ac8('0x23')],'rows':_['map'](_0x428c1b[_0x5ac8('0x4a')],function(_0x5ecafb){return{'membername':_0x5ecafb[_0x5ac8('0x31')],'UserId':_0x5ecafb['id'],'queue_name':_0x458f25['name'],'WhatsappQueueId':_0x458f25['id'],'interface':util[_0x5ac8('0x63')]('%s/%s',_0x5ac8('0x64'),_0x5ecafb[_0x5ac8('0x31')]),'penalty':0x0,'paused':_0x5ecafb[_0x5ac8('0x61')],'createdAt':_0x5ecafb[_0x5ac8('0x65')],'updatedAt':_0x5ecafb[_0x5ac8('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17fe47,_0xf92eb7))[_0x5ac8('0x4b')](handleError(_0x17fe47,null));};exports[_0x5ac8('0x66')]=function(_0x2a9f6a,_0x274e06,_0x4dd8fb){var _0x5a4446={};var _0x47f3f5={};var _0x65c39;var _0x2acea1;return db['WhatsappQueue'][_0x5ac8('0x5a')]({'where':{'id':_0x2a9f6a[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0x274e06,null))[_0x5ac8('0x2a')](function(_0x38b123){if(_0x38b123){_0x65c39=_0x38b123;_0x47f3f5[_0x5ac8('0x38')]=_[_0x5ac8('0x39')](db[_0x5ac8('0x67')][_0x5ac8('0x4d')]);_0x47f3f5['query']=_[_0x5ac8('0x39')](_0x2a9f6a['query']);_0x47f3f5[_0x5ac8('0x43')]=_[_0x5ac8('0x3a')](_0x47f3f5['model'],_0x47f3f5[_0x5ac8('0x3c')]);_0x5a4446[_0x5ac8('0x3d')]=_[_0x5ac8('0x3a')](_0x47f3f5['model'],qs[_0x5ac8('0x3b')](_0x2a9f6a[_0x5ac8('0x3c')][_0x5ac8('0x3b')]));_0x5a4446[_0x5ac8('0x3d')]=_0x5a4446['attributes'][_0x5ac8('0x3e')]?_0x5a4446[_0x5ac8('0x3d')]:_0x47f3f5['model'];_0x5a4446[_0x5ac8('0x40')]=qs[_0x5ac8('0x41')](_0x2a9f6a[_0x5ac8('0x3c')]['sort']);_0x5a4446[_0x5ac8('0x42')]=qs[_0x5ac8('0x43')](_[_0x5ac8('0x5d')](_0x2a9f6a['query'],_0x47f3f5[_0x5ac8('0x43')]));if(_0x2a9f6a[_0x5ac8('0x3c')]['filter']){_0x5a4446[_0x5ac8('0x42')]=_[_0x5ac8('0x44')](_0x5a4446[_0x5ac8('0x42')],{'$or':_['map'](_0x5a4446[_0x5ac8('0x3d')],function(_0x4f6380){var _0x437fab={};_0x437fab[_0x4f6380]={'$like':'%'+_0x2a9f6a[_0x5ac8('0x3c')][_0x5ac8('0x46')]+'%'};return _0x437fab;})});}_0x5a4446=_['merge']({},_0x5a4446,_0x2a9f6a[_0x5ac8('0x4e')]);return _0x65c39[_0x5ac8('0x66')](_0x5a4446);}})[_0x5ac8('0x2a')](function(_0x8ad136){if(_0x8ad136){_0x2acea1=_0x8ad136[_0x5ac8('0x3e')];if(!_0x2a9f6a[_0x5ac8('0x3c')]['hasOwnProperty'](_0x5ac8('0x5c'))){_0x5a4446[_0x5ac8('0x24')]=qs[_0x5ac8('0x24')](_0x2a9f6a[_0x5ac8('0x3c')]['limit']);_0x5a4446[_0x5ac8('0x21')]=qs[_0x5ac8('0x21')](_0x2a9f6a[_0x5ac8('0x3c')][_0x5ac8('0x21')]);}return _0x65c39[_0x5ac8('0x66')](_0x5a4446);}})[_0x5ac8('0x2a')](function(_0x3b1cb1){if(_0x3b1cb1){return _0x3b1cb1?{'count':_0x2acea1,'rows':_0x3b1cb1}:null;}})[_0x5ac8('0x2a')](respondWithResult(_0x274e06,null))[_0x5ac8('0x4b')](handleError(_0x274e06,null));};exports[_0x5ac8('0x68')]=function(_0x4f2f53,_0x40a3ae,_0x1923a9){var _0x440eee=_0x4f2f53[_0x5ac8('0x57')]['ids'];return db[_0x5ac8('0x67')][_0x5ac8('0x49')]({'where':{'id':_0x440eee},'attributes':['id'],'include':[{'model':db[_0x5ac8('0x5e')],'as':_0x5ac8('0x69'),'attributes':['id',_0x5ac8('0x31'),_0x5ac8('0x6a'),_0x5ac8('0x6b'),'interface'],'raw':!![]}]})[_0x5ac8('0x2a')](function(_0x126e5a){if(_0x126e5a){var _0x473333=_[_0x5ac8('0x6c')](_0x126e5a,function(_0x4e4e3c){var _0x4f8b13=_0x4e4e3c['get']({'plain':!![]});return _0x4f8b13[_0x5ac8('0x69')];});return db[_0x5ac8('0x34')][_0x5ac8('0x4f')]({'where':{'id':_0x4f2f53[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](function(_0x4ab10d){return db[_0x5ac8('0x6d')]['transaction'](function(_0x5a0c9f){return _0x4ab10d[_0x5ac8('0x68')](_0x440eee,{'transaction':_0x5a0c9f})['then'](function(){return BPromise[_0x5ac8('0x6e')](_0x473333,function(_0x147a5d){return db['UserWhatsappQueue'][_0x5ac8('0x6f')]({'where':{'UserId':_0x147a5d['id'],'WhatsappQueueId':_0x4f2f53[_0x5ac8('0x4c')]['id']},'transaction':_0x5a0c9f});});})[_0x5ac8('0x2a')](function(){_0x473333[_0x5ac8('0x70')](function(_0x313c5d){socket[_0x5ac8('0x71')]('userWhatsappQueue:save',{'UserId':_0x313c5d['id'],'WhatsappQueueId':_0x4ab10d['id']});});});});});}})[_0x5ac8('0x2a')](respondWithStatusCode(_0x40a3ae,null))['catch'](handleError(_0x40a3ae,null));};exports[_0x5ac8('0x72')]=function(_0x5a22c2,_0x20a8b0,_0x390086){return db[_0x5ac8('0x67')][_0x5ac8('0x49')]({'where':{'id':_0x5a22c2[_0x5ac8('0x3c')][_0x5ac8('0x73')]},'attributes':['id'],'include':[{'model':db[_0x5ac8('0x5e')],'as':_0x5ac8('0x69'),'attributes':['id'],'raw':!![]}]})[_0x5ac8('0x2a')](handleEntityNotFound(_0x20a8b0,null))[_0x5ac8('0x2a')](function(_0xce0fb0){var _0x4b9ac4=_[_0x5ac8('0x33')](_0xce0fb0,'id');var _0x169547=[];var _0x90d0d4=[];var _0xd54eea=squel[_0x5ac8('0x74')]();_0xd54eea[_0x5ac8('0x75')](_0x5ac8('0x76'))['from'](_0x5ac8('0x77'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('WhatsappQueueId\x20=\x20?',_0x5a22c2[_0x5ac8('0x4c')]['id']);for(var _0xd481e9=0x0;_0xd481e9<_0xce0fb0[_0x5ac8('0x3e')];_0xd481e9+=0x1){let _0x1c83a2=_0xce0fb0[_0xd481e9];for(var _0x3f6a33=0x0;_0x3f6a33<_0x1c83a2[_0x5ac8('0x69')]['length'];_0x3f6a33+=0x1){let _0x2c4c91=_0x1c83a2[_0x5ac8('0x69')][_0x3f6a33];var _0x74136=_0xd54eea[_0x5ac8('0x78')]();_0x74136[_0x5ac8('0x42')](_0x5ac8('0x79'),_0x2c4c91['id']);_0x90d0d4[_0x5ac8('0x7a')](db[_0x5ac8('0x6d')][_0x5ac8('0x3c')](_0x74136[_0x5ac8('0x7b')](),{'type':db[_0x5ac8('0x6d')][_0x5ac8('0x7c')]['SELECT']})['then'](function(_0x44d530){if(_0x44d530['length']===0x1){return _0x2c4c91['id'];}else{var _0x34d0a5=_[_0x5ac8('0x7d')](_[_0x5ac8('0x33')](_0x44d530,_0x5ac8('0x7e')),function(_0x4255ba){return _[_0x5ac8('0x7f')](_0x4b9ac4,_0x4255ba);});if(_0x34d0a5){return _0x2c4c91['id'];}}}));}}return BPromise[_0x5ac8('0x80')](_0x90d0d4)['then'](function(_0x342afd){_0x169547=_(_0x169547)[_0x5ac8('0x81')](_0x342afd)['compact']()[_0x5ac8('0x82')]();return db[_0x5ac8('0x34')][_0x5ac8('0x4f')]({'where':{'id':_0x5a22c2[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](function(_0x10a1b3){return db['sequelize']['transaction'](function(_0x49b5e5){return _0x10a1b3[_0x5ac8('0x72')](_0x5a22c2['query'][_0x5ac8('0x73')],{'transaction':_0x49b5e5})['then'](function(){if(!_[_0x5ac8('0x83')](_0x169547)){return _0x10a1b3[_0x5ac8('0x84')](_0x169547,{'transaction':_0x49b5e5});}})[_0x5ac8('0x2a')](function(){_0x169547[_0x5ac8('0x70')](function(_0x499be4){socket[_0x5ac8('0x71')](_0x5ac8('0x85'),{'UserId':_0x499be4,'WhatsappQueueId':_0x10a1b3['id']});});});});});});})[_0x5ac8('0x2a')](respondWithStatusCode(_0x20a8b0,null))['catch'](handleError(_0x20a8b0,null));};exports[_0x5ac8('0x86')]=function(_0x3ee016,_0x15b89f,_0x1ccfc0){return db['WhatsappQueue'][_0x5ac8('0x4f')]({'where':{'id':_0x3ee016[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0x15b89f,null))[_0x5ac8('0x2a')](function(_0x59db0a){if(_0x59db0a){return _0x59db0a[_0x5ac8('0x86')](_0x3ee016['body'][_0x5ac8('0x73')],_[_0x5ac8('0x87')](_0x3ee016['body'],[_0x5ac8('0x73'),'id'])||{})[_0x5ac8('0x88')](function(_0x37c589){for(var _0x3e130c=0x0;_0x3e130c<_0x3ee016[_0x5ac8('0x57')][_0x5ac8('0x73')][_0x5ac8('0x3e')];_0x3e130c+=0x1){socket[_0x5ac8('0x71')](_0x5ac8('0x89'),{'UserId':Number(_0x3ee016[_0x5ac8('0x57')][_0x5ac8('0x73')][_0x3e130c]),'WhatsappQueueId':Number(_0x3ee016[_0x5ac8('0x4c')]['id'])});}return _0x37c589;});}})[_0x5ac8('0x2a')](respondWithResult(_0x15b89f,null))['catch'](handleError(_0x15b89f,null));};exports[_0x5ac8('0x84')]=function(_0x5094a1,_0xc1b1,_0x590f33){return db[_0x5ac8('0x34')][_0x5ac8('0x4f')]({'where':{'id':_0x5094a1[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0xc1b1,null))[_0x5ac8('0x2a')](function(_0x2650ca){if(_0x2650ca){return _0x2650ca[_0x5ac8('0x84')](_0x5094a1[_0x5ac8('0x3c')]['ids'])[_0x5ac8('0x2a')](function(){if(_[_0x5ac8('0x8a')](_0x5094a1[_0x5ac8('0x3c')][_0x5ac8('0x73')])){for(var _0x3dc903=0x0;_0x3dc903<_0x5094a1[_0x5ac8('0x3c')][_0x5ac8('0x73')][_0x5ac8('0x3e')];_0x3dc903+=0x1){socket['emit'](_0x5ac8('0x85'),{'UserId':Number(_0x5094a1[_0x5ac8('0x3c')][_0x5ac8('0x73')][_0x3dc903]),'WhatsappQueueId':Number(_0x5094a1[_0x5ac8('0x4c')]['id'])});}}else{socket[_0x5ac8('0x71')](_0x5ac8('0x85'),{'UserId':Number(_0x5094a1[_0x5ac8('0x3c')][_0x5ac8('0x73')]),'WhatsappQueueId':Number(_0x5094a1[_0x5ac8('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0xc1b1,null))['catch'](handleError(_0xc1b1,null));};exports[_0x5ac8('0x8b')]=function(_0xd88095,_0x468580,_0x5b0a2a){var _0x529793={};var _0x449e33={};var _0x46d366;var _0x1be003;return db[_0x5ac8('0x34')][_0x5ac8('0x5a')]({'where':{'id':_0xd88095[_0x5ac8('0x4c')]['id']}})[_0x5ac8('0x2a')](handleEntityNotFound(_0x468580,null))[_0x5ac8('0x2a')](function(_0x109465){if(_0x109465){_0x46d366=_0x109465;_0x449e33[_0x5ac8('0x38')]=_['keys'](db[_0x5ac8('0x5e')][_0x5ac8('0x4d')]);_0x449e33['query']=_['keys'](_0xd88095['query']);_0x449e33[_0x5ac8('0x43')]=_[_0x5ac8('0x3a')](_0x449e33[_0x5ac8('0x38')],_0x449e33['query']);_0x529793[_0x5ac8('0x3d')]=_[_0x5ac8('0x3a')](_0x449e33[_0x5ac8('0x38')],qs[_0x5ac8('0x3b')](_0xd88095['query'][_0x5ac8('0x3b')]));_0x529793[_0x5ac8('0x3d')]=_0x529793[_0x5ac8('0x3d')]['length']?_0x529793[_0x5ac8('0x3d')]:_0x449e33[_0x5ac8('0x38')];_0x529793['order']=qs['sort'](_0xd88095[_0x5ac8('0x3c')]['sort']);_0x529793['where']=qs['filters'](_['pick'](_0xd88095[_0x5ac8('0x3c')],_0x449e33[_0x5ac8('0x43')]));if(_0xd88095[_0x5ac8('0x3c')][_0x5ac8('0x46')]){_0x529793['where']=_[_0x5ac8('0x44')](_0x529793[_0x5ac8('0x42')],{'$or':_[_0x5ac8('0x33')](_0x529793[_0x5ac8('0x3d')],function(_0x51036a){var _0x18f668={};_0x18f668[_0x51036a]={'$like':'%'+_0xd88095['query']['filter']+'%'};return _0x18f668;})});}_0x529793=_[_0x5ac8('0x44')]({},_0x529793,_0xd88095[_0x5ac8('0x4e')]);return _0x46d366['getAgents'](_0x529793);}})['then'](function(_0x111f29){if(_0x111f29){_0x1be003=_0x111f29[_0x5ac8('0x3e')];if(!_0xd88095['query'][_0x5ac8('0x3f')](_0x5ac8('0x5c'))){_0x529793[_0x5ac8('0x24')]=qs[_0x5ac8('0x24')](_0xd88095[_0x5ac8('0x3c')][_0x5ac8('0x24')]);_0x529793['offset']=qs['offset'](_0xd88095[_0x5ac8('0x3c')][_0x5ac8('0x21')]);}return _0x46d366[_0x5ac8('0x8b')](_0x529793);}})[_0x5ac8('0x2a')](function(_0x593e2f){if(_0x593e2f){return _0x593e2f?{'count':_0x1be003,'rows':_0x593e2f}:null;}})['then'](respondWithResult(_0x468580,null))[_0x5ac8('0x4b')](handleError(_0x468580,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 2d2f517..c0e3fa8 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 _0x2943=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x2943,0x17d));var _0x3294=function(_0x5df59f,_0xf11a72){_0x5df59f=_0x5df59f-0x0;var _0x190e3b=_0x2943[_0x5df59f];return _0x190e3b;};'use strict';var EventEmitter=require(_0x3294('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3294('0x1')](0x0);var events={'afterCreate':_0x3294('0x2'),'afterUpdate':_0x3294('0x3'),'afterDestroy':_0x3294('0x4')};function emitEvent(_0x160dab){return function(_0x2945f6,_0x4661e8,_0xb63708){WhatsappQueueEvents[_0x3294('0x5')](_0x160dab+':'+_0x2945f6['id'],_0x2945f6);WhatsappQueueEvents[_0x3294('0x5')](_0x160dab,_0x2945f6);_0xb63708(null);};}for(var e in events){if(events[_0x3294('0x6')](e)){var event=events[e];WhatsappQueue[_0x3294('0x7')](e,emitEvent(event));}}module[_0x3294('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xf6de=['../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3ef1cb,_0x4f3e08){var _0x25378c=function(_0x27e366){while(--_0x27e366){_0x3ef1cb['push'](_0x3ef1cb['shift']());}};_0x25378c(++_0x4f3e08);}(_0xf6de,0x131));var _0xef6d=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0xf6de[_0x58fc2f];return _0x3a1312;};'use strict';var EventEmitter=require(_0xef6d('0x0'));var WhatsappQueue=require(_0xef6d('0x1'))['db'][_0xef6d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef6d('0x3'),'afterUpdate':_0xef6d('0x4'),'afterDestroy':_0xef6d('0x5')};function emitEvent(_0x4e346f){return function(_0x541c63,_0x9a917e,_0x5e0635){WhatsappQueueEvents[_0xef6d('0x6')](_0x4e346f+':'+_0x541c63['id'],_0x541c63);WhatsappQueueEvents[_0xef6d('0x6')](_0x4e346f,_0x541c63);_0x5e0635(null);};}for(var e in events){if(events[_0xef6d('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xef6d('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d43ef4a..e6cc036 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 _0x2631=['whatsapp_queues','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x43bc7f,_0x541ed7){var _0x2c8c7b=function(_0x4a9704){while(--_0x4a9704){_0x43bc7f['push'](_0x43bc7f['shift']());}};_0x2c8c7b(++_0x541ed7);}(_0x2631,0x1ed));var _0x1263=function(_0x13c126,_0xe31995){_0x13c126=_0x13c126-0x0;var _0x106010=_0x2631[_0x13c126];return _0x106010;};'use strict';var _=require(_0x1263('0x0'));var util=require(_0x1263('0x1'));var logger=require('../../config/logger')(_0x1263('0x2'));var moment=require(_0x1263('0x3'));var BPromise=require('bluebird');var rp=require(_0x1263('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1263('0x5'));var config=require(_0x1263('0x6'));var attributes=require(_0x1263('0x7'));module[_0x1263('0x8')]=function(_0x1fd9d6,_0x53beae){return _0x1fd9d6[_0x1263('0x9')](_0x1263('0xa'),attributes,{'tableName':_0x1263('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dc1=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappQueue.attributes'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2dc1,0xde));var _0x12dc=function(_0x1bf9cd,_0x5c6fa7){_0x1bf9cd=_0x1bf9cd-0x0;var _0x43551a=_0x2dc1[_0x1bf9cd];return _0x43551a;};'use strict';var _=require(_0x12dc('0x0'));var util=require(_0x12dc('0x1'));var logger=require(_0x12dc('0x2'))(_0x12dc('0x3'));var moment=require(_0x12dc('0x4'));var BPromise=require(_0x12dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12dc('0x6'));var rimraf=require(_0x12dc('0x7'));var config=require('../../config/environment');var attributes=require(_0x12dc('0x8'));module['exports']=function(_0x27a920,_0x46c152){return _0x27a920['define'](_0x12dc('0x9'),attributes,{'tableName':_0x12dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 71a407f..19b8ec0 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 _0xaaed=['raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappQueue,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find'];(function(_0x5413a4,_0x53d031){var _0x547ac2=function(_0x2b48c2){while(--_0x2b48c2){_0x5413a4['push'](_0x5413a4['shift']());}};_0x547ac2(++_0x53d031);}(_0xaaed,0x19b));var _0xdaae=function(_0x294542,_0x5605a7){_0x294542=_0x294542-0x0;var _0x1af437=_0xaaed[_0x294542];return _0x1af437;};'use strict';var _=require(_0xdaae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdaae('0x1'));var rs=require(_0xdaae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaae('0x3'))['db'];var utils=require(_0xdaae('0x4'));var logger=require(_0xdaae('0x5'))(_0xdaae('0x6'));var config=require(_0xdaae('0x7'));var jayson=require(_0xdaae('0x8'));var client=jayson[_0xdaae('0x9')]['http']({'port':0x232a});config[_0xdaae('0xa')]=_[_0xdaae('0xb')](config[_0xdaae('0xa')],{'host':_0xdaae('0xc'),'port':0x18eb});var socket=require(_0xdaae('0xd'))(new Redis(config[_0xdaae('0xa')]));require(_0xdaae('0xe'))[_0xdaae('0xf')](socket);function respondWithRpcPromise(_0x51abb1,_0x5e83ba,_0x146d08){return new BPromise(function(_0xbfb421,_0x306749){return client[_0xdaae('0x10')](_0x51abb1,_0x146d08)[_0xdaae('0x11')](function(_0x38394d){logger[_0xdaae('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0xdaae('0x13'));logger[_0xdaae('0x14')](_0xdaae('0x15'),_0x5e83ba,'request\x20sent',JSON[_0xdaae('0x16')](_0x38394d));if(_0x38394d[_0xdaae('0x17')]){if(_0x38394d[_0xdaae('0x17')]['code']===0x1f4){logger[_0xdaae('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0x38394d[_0xdaae('0x17')][_0xdaae('0x18')]);return _0x306749(_0x38394d[_0xdaae('0x17')][_0xdaae('0x18')]);}logger[_0xdaae('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0x38394d[_0xdaae('0x17')][_0xdaae('0x18')]);return _0xbfb421(_0x38394d[_0xdaae('0x17')]['message']);}else{logger['info'](_0xdaae('0x19'),_0x5e83ba,_0xdaae('0x13'));_0xbfb421(_0x38394d[_0xdaae('0x1a')]['message']);}})[_0xdaae('0x1b')](function(_0x4081a8){logger[_0xdaae('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x5e83ba,_0x4081a8);_0x306749(_0x4081a8);});});}exports['GetWhatsappQueue']=function(_0x2f17c4){var _0x411753=this;return new Promise(function(_0x464d85,_0x28e066){return db['WhatsappQueue'][_0xdaae('0x1c')]({'raw':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x1e')]||null:null,'attributes':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x1f')]||null:null,'limit':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x20')]||null:null,'include':_0x2f17c4[_0xdaae('0x1d')]?_0x2f17c4[_0xdaae('0x1d')][_0xdaae('0x21')]?_[_0xdaae('0x22')](_0x2f17c4['options'][_0xdaae('0x21')],function(_0x39ed09){return{'model':db[_0x39ed09['model']],'as':_0x39ed09['as'],'attributes':_0x39ed09['attributes'],'include':_0x39ed09[_0xdaae('0x21')]?_['map'](_0x39ed09[_0xdaae('0x21')],function(_0x25cd68){return{'model':db[_0x25cd68['model']],'as':_0x25cd68['as'],'attributes':_0x25cd68[_0xdaae('0x1f')],'include':_0x25cd68[_0xdaae('0x21')]?_['map'](_0x25cd68[_0xdaae('0x21')],function(_0x5eac11){return{'model':db[_0x5eac11[_0xdaae('0x23')]],'as':_0x5eac11['as'],'attributes':_0x5eac11[_0xdaae('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdaae('0x11')](function(_0x49a7ed){logger[_0xdaae('0x12')](_0xdaae('0x24'),_0x2f17c4);logger['debug']('GetWhatsappQueue',_0x2f17c4,JSON[_0xdaae('0x16')](_0x49a7ed));_0x464d85(_0x49a7ed);})[_0xdaae('0x1b')](function(_0x5dea0f){logger[_0xdaae('0x17')](_0xdaae('0x24'),_0x5dea0f[_0xdaae('0x18')],_0x2f17c4);_0x28e066(_0x411753[_0xdaae('0x17')](0x1f4,_0x5dea0f[_0xdaae('0x18')]));});});};exports[_0xdaae('0x25')]=function(_0x46a111){var _0x523d80=this;return new Promise(function(_0x47ce7c,_0x2a4775){return db[_0xdaae('0x26')][_0xdaae('0x27')]({'raw':_0x46a111[_0xdaae('0x1d')]?_0x46a111[_0xdaae('0x1d')][_0xdaae('0x28')]===undefined?!![]:![]:!![],'where':_0x46a111[_0xdaae('0x1d')]?_0x46a111[_0xdaae('0x1d')][_0xdaae('0x1e')]||null:null,'attributes':_0x46a111[_0xdaae('0x1d')]?_0x46a111['options']['attributes']||null:null,'include':_0x46a111[_0xdaae('0x1d')]?_0x46a111[_0xdaae('0x1d')]['include']?_['map'](_0x46a111[_0xdaae('0x1d')][_0xdaae('0x21')],function(_0x407231){return{'model':db[_0x407231[_0xdaae('0x23')]],'as':_0x407231['as'],'attributes':_0x407231[_0xdaae('0x1f')],'include':_0x407231[_0xdaae('0x21')]?_[_0xdaae('0x22')](_0x407231[_0xdaae('0x21')],function(_0x4a1642){return{'model':db[_0x4a1642[_0xdaae('0x23')]],'as':_0x4a1642['as'],'attributes':_0x4a1642[_0xdaae('0x1f')],'include':_0x4a1642['include']?_[_0xdaae('0x22')](_0x4a1642['include'],function(_0x52a3b0){return{'model':db[_0x52a3b0[_0xdaae('0x23')]],'as':_0x52a3b0['as'],'attributes':_0x52a3b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xdaae('0x11')](function(_0x2b3cbe){logger['info'](_0xdaae('0x25'),_0x46a111);logger[_0xdaae('0x14')]('ShowWhatsappQueue',_0x46a111,JSON[_0xdaae('0x16')](_0x2b3cbe));_0x47ce7c(_0x2b3cbe);})[_0xdaae('0x1b')](function(_0x460434){logger[_0xdaae('0x17')](_0xdaae('0x25'),_0x460434[_0xdaae('0x18')],_0x46a111);_0x2a4775(_0x523d80[_0xdaae('0x17')](0x1f4,_0x460434[_0xdaae('0x18')]));});});}; \ No newline at end of file +var _0x495b=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','then','find','ShowWhatsappQueue'];(function(_0xebc516,_0x586c1c){var _0x44a33b=function(_0x84751){while(--_0x84751){_0xebc516['push'](_0xebc516['shift']());}};_0x44a33b(++_0x586c1c);}(_0x495b,0x1b8));var _0xb495=function(_0x42d084,_0x162da8){_0x42d084=_0x42d084-0x0;var _0x13653b=_0x495b[_0x42d084];return _0x13653b;};'use strict';var _=require(_0xb495('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb495('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb495('0x2'));var db=require(_0xb495('0x3'))['db'];var utils=require(_0xb495('0x4'));var logger=require(_0xb495('0x5'))(_0xb495('0x6'));var config=require(_0xb495('0x7'));var jayson=require(_0xb495('0x8'));var client=jayson[_0xb495('0x9')][_0xb495('0xa')]({'port':0x232a});config[_0xb495('0xb')]=_[_0xb495('0xc')](config[_0xb495('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb495('0xb')]));require(_0xb495('0xd'))[_0xb495('0xe')](socket);function respondWithRpcPromise(_0x3564b5,_0x5e79fa,_0x10b62f){return new BPromise(function(_0x56edf6,_0x46442c){return client[_0xb495('0xf')](_0x3564b5,_0x10b62f)['then'](function(_0x543e77){logger[_0xb495('0x10')](_0xb495('0x11'),_0x5e79fa,_0xb495('0x12'));logger[_0xb495('0x13')](_0xb495('0x14'),_0x5e79fa,_0xb495('0x12'),JSON[_0xb495('0x15')](_0x543e77));if(_0x543e77[_0xb495('0x16')]){if(_0x543e77[_0xb495('0x16')][_0xb495('0x17')]===0x1f4){logger[_0xb495('0x16')](_0xb495('0x11'),_0x5e79fa,_0x543e77['error']['message']);return _0x46442c(_0x543e77[_0xb495('0x16')][_0xb495('0x18')]);}logger[_0xb495('0x16')](_0xb495('0x11'),_0x5e79fa,_0x543e77[_0xb495('0x16')][_0xb495('0x18')]);return _0x56edf6(_0x543e77['error']['message']);}else{logger[_0xb495('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x5e79fa,_0xb495('0x12'));_0x56edf6(_0x543e77[_0xb495('0x19')]['message']);}})[_0xb495('0x1a')](function(_0x2b4d3e){logger[_0xb495('0x16')](_0xb495('0x11'),_0x5e79fa,_0x2b4d3e);_0x46442c(_0x2b4d3e);});});}exports[_0xb495('0x1b')]=function(_0x16b35d){var _0x32c13c=this;return new Promise(function(_0x148ea5,_0x3f7699){return db[_0xb495('0x1c')][_0xb495('0x1d')]({'raw':_0x16b35d['options']?_0x16b35d[_0xb495('0x1e')][_0xb495('0x1f')]===undefined?!![]:![]:!![],'where':_0x16b35d[_0xb495('0x1e')]?_0x16b35d['options']['where']||null:null,'attributes':_0x16b35d[_0xb495('0x1e')]?_0x16b35d['options'][_0xb495('0x20')]||null:null,'limit':_0x16b35d[_0xb495('0x1e')]?_0x16b35d['options'][_0xb495('0x21')]||null:null,'include':_0x16b35d[_0xb495('0x1e')]?_0x16b35d[_0xb495('0x1e')][_0xb495('0x22')]?_[_0xb495('0x23')](_0x16b35d[_0xb495('0x1e')][_0xb495('0x22')],function(_0x1206f5){return{'model':db[_0x1206f5[_0xb495('0x24')]],'as':_0x1206f5['as'],'attributes':_0x1206f5[_0xb495('0x20')],'include':_0x1206f5[_0xb495('0x22')]?_['map'](_0x1206f5[_0xb495('0x22')],function(_0x5b72d3){return{'model':db[_0x5b72d3[_0xb495('0x24')]],'as':_0x5b72d3['as'],'attributes':_0x5b72d3[_0xb495('0x20')],'include':_0x5b72d3[_0xb495('0x22')]?_[_0xb495('0x23')](_0x5b72d3[_0xb495('0x22')],function(_0x106888){return{'model':db[_0x106888['model']],'as':_0x106888['as'],'attributes':_0x106888['attributes']};}):[]};}):[]};}):[]:[]})[_0xb495('0x25')](function(_0x1d52d){logger[_0xb495('0x10')]('GetWhatsappQueue',_0x16b35d);logger[_0xb495('0x13')](_0xb495('0x1b'),_0x16b35d,JSON[_0xb495('0x15')](_0x1d52d));_0x148ea5(_0x1d52d);})['catch'](function(_0x38de3a){logger[_0xb495('0x16')](_0xb495('0x1b'),_0x38de3a[_0xb495('0x18')],_0x16b35d);_0x3f7699(_0x32c13c[_0xb495('0x16')](0x1f4,_0x38de3a[_0xb495('0x18')]));});});};exports['ShowWhatsappQueue']=function(_0x2038c1){var _0x173944=this;return new Promise(function(_0x69ed9a,_0x454ad5){return db[_0xb495('0x1c')][_0xb495('0x26')]({'raw':_0x2038c1[_0xb495('0x1e')]?_0x2038c1['options'][_0xb495('0x1f')]===undefined?!![]:![]:!![],'where':_0x2038c1['options']?_0x2038c1[_0xb495('0x1e')]['where']||null:null,'attributes':_0x2038c1[_0xb495('0x1e')]?_0x2038c1[_0xb495('0x1e')][_0xb495('0x20')]||null:null,'include':_0x2038c1[_0xb495('0x1e')]?_0x2038c1[_0xb495('0x1e')][_0xb495('0x22')]?_[_0xb495('0x23')](_0x2038c1[_0xb495('0x1e')][_0xb495('0x22')],function(_0x1073bc){return{'model':db[_0x1073bc['model']],'as':_0x1073bc['as'],'attributes':_0x1073bc[_0xb495('0x20')],'include':_0x1073bc[_0xb495('0x22')]?_[_0xb495('0x23')](_0x1073bc['include'],function(_0x156871){return{'model':db[_0x156871[_0xb495('0x24')]],'as':_0x156871['as'],'attributes':_0x156871['attributes'],'include':_0x156871['include']?_[_0xb495('0x23')](_0x156871['include'],function(_0xd51305){return{'model':db[_0xd51305[_0xb495('0x24')]],'as':_0xd51305['as'],'attributes':_0xd51305['attributes']};}):[]};}):[]};}):[]:[]})[_0xb495('0x25')](function(_0x336c4d){logger[_0xb495('0x10')](_0xb495('0x27'),_0x2038c1);logger[_0xb495('0x13')](_0xb495('0x27'),_0x2038c1,JSON['stringify'](_0x336c4d));_0x69ed9a(_0x336c4d);})[_0xb495('0x1a')](function(_0x213f11){logger[_0xb495('0x16')](_0xb495('0x27'),_0x213f11[_0xb495('0x18')],_0x2038c1);_0x454ad5(_0x173944[_0xb495('0x16')](0x1f4,_0x213f11[_0xb495('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 896fc86..196318f 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 _0x5f37=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register'];(function(_0x465b0c,_0x569d90){var _0x502ff0=function(_0x221757){while(--_0x221757){_0x465b0c['push'](_0x465b0c['shift']());}};_0x502ff0(++_0x569d90);}(_0x5f37,0x1cf));var _0x75f3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5f37[_0x2641f9];return _0x585741;};'use strict';var WhatsappQueueEvents=require(_0x75f3('0x0'));var events=[_0x75f3('0x1'),'remove',_0x75f3('0x2')];function createListener(_0x245534,_0x29b812){return function(_0x2fba84){_0x29b812[_0x75f3('0x3')](_0x245534,_0x2fba84);};}function removeListener(_0x1685ec,_0x2ac107){return function(){WhatsappQueueEvents[_0x75f3('0x4')](_0x1685ec,_0x2ac107);};}exports[_0x75f3('0x5')]=function(_0x102b15){for(var _0x46dcd2=0x0,_0x1eb1e7=events['length'];_0x46dcd2<_0x1eb1e7;_0x46dcd2++){var _0x34cf4a=events[_0x46dcd2];var _0x4f7233=createListener(_0x75f3('0x6')+_0x34cf4a,_0x102b15);WhatsappQueueEvents['on'](_0x34cf4a,_0x4f7233);}}; \ No newline at end of file +var _0xaf74=['whatsappQueue:','save','remove','update','emit','register'];(function(_0x16af24,_0x51c626){var _0x267c1d=function(_0x1e4fa8){while(--_0x1e4fa8){_0x16af24['push'](_0x16af24['shift']());}};_0x267c1d(++_0x51c626);}(_0xaf74,0x1c9));var _0x4af7=function(_0x93d7e0,_0x3ecdf4){_0x93d7e0=_0x93d7e0-0x0;var _0x1e93e8=_0xaf74[_0x93d7e0];return _0x1e93e8;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x4af7('0x0'),_0x4af7('0x1'),_0x4af7('0x2')];function createListener(_0x1324e0,_0x2af71d){return function(_0x2330a7){_0x2af71d[_0x4af7('0x3')](_0x1324e0,_0x2330a7);};}function removeListener(_0xed80d5,_0xddf13c){return function(){WhatsappQueueEvents['removeListener'](_0xed80d5,_0xddf13c);};}exports[_0x4af7('0x4')]=function(_0x2eba66){for(var _0x1147dc=0x0,_0x1c372c=events['length'];_0x1147dc<_0x1c372c;_0x1147dc++){var _0x56a6f1=events[_0x1147dc];var _0x2227ed=createListener(_0x4af7('0x5')+_0x56a6f1,_0x2eba66);WhatsappQueueEvents['on'](_0x56a6f1,_0x2227ed);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 453b7c9..c4728c4 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 _0x0dd9=['path','connect-timeout','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0dd9,0x14f));var _0x90dd=function(_0x424476,_0x5e2a30){_0x424476=_0x424476-0x0;var _0x1e5ab5=_0x0dd9[_0x424476];return _0x1e5ab5;};'use strict';var multer=require(_0x90dd('0x0'));var util=require('util');var path=require(_0x90dd('0x1'));var timeout=require(_0x90dd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x90dd('0x3'));var config=require('../../config/environment');var controller=require(_0x90dd('0x4'));router[_0x90dd('0x5')]('/',auth[_0x90dd('0x6')](),controller[_0x90dd('0x7')]);router[_0x90dd('0x5')]('/describe',auth[_0x90dd('0x6')](),controller[_0x90dd('0x8')]);router[_0x90dd('0x5')](_0x90dd('0x9'),auth[_0x90dd('0x6')](),controller[_0x90dd('0xa')]);router[_0x90dd('0xb')]('/',auth[_0x90dd('0x6')](),controller[_0x90dd('0xc')]);router[_0x90dd('0xd')](_0x90dd('0x9'),auth[_0x90dd('0x6')](),controller[_0x90dd('0xe')]);router['delete'](_0x90dd('0x9'),auth['isAuthenticated'](),controller[_0x90dd('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6c11=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','update','delete','multer'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x6c11,0xe3));var _0x16c1=function(_0x4b6beb,_0x211aed){_0x4b6beb=_0x4b6beb-0x0;var _0x35d772=_0x6c11[_0x4b6beb];return _0x35d772;};'use strict';var multer=require(_0x16c1('0x0'));var util=require('util');var path=require(_0x16c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x16c1('0x2'));var router=express[_0x16c1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x16c1('0x4'));var interaction=require(_0x16c1('0x5'));var config=require(_0x16c1('0x6'));var controller=require(_0x16c1('0x7'));router[_0x16c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x16c1('0x9')]);router[_0x16c1('0x8')](_0x16c1('0xa'),auth['isAuthenticated'](),controller[_0x16c1('0xb')]);router[_0x16c1('0x8')](_0x16c1('0xc'),auth[_0x16c1('0xd')](),controller[_0x16c1('0xe')]);router[_0x16c1('0xf')]('/',auth['isAuthenticated'](),controller[_0x16c1('0x10')]);router['put'](_0x16c1('0xc'),auth[_0x16c1('0xd')](),controller[_0x16c1('0x11')]);router[_0x16c1('0x12')]('/:id',auth[_0x16c1('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index f9381bd..653a965 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x149bf0,_0x50654c){var _0x5c3302=function(_0x3a270f){while(--_0x3a270f){_0x149bf0['push'](_0x149bf0['shift']());}};_0x5c3302(++_0x50654c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x2e9aca,_0x214a66){var _0x50fd89=function(_0x532445){while(--_0x532445){_0x2e9aca['push'](_0x2e9aca['shift']());}};_0x50fd89(++_0x214a66);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e3b6624..93ae713 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 _0x4024=['rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x4024,0x89));var _0x4402=function(_0x519b65,_0x54f8e3){_0x519b65=_0x519b65-0x0;var _0x131184=_0x4024[_0x519b65];return _0x131184;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){_0x258d10['status'](0xcc)[_0x4402('0x15')]();});}};}function handleEntityNotFound(_0x4e1c04,_0x3733cd){return function(_0x5ab28d){if(!_0x5ab28d){_0x4e1c04[_0x4402('0x13')](0x194);}return _0x5ab28d;};}function handleError(_0x211424,_0x5a43d0){_0x5a43d0=_0x5a43d0||0x1f4;return function(_0x15c19f){logger['error'](_0x15c19f['stack']);if(_0x15c19f[_0x4402('0x21')]){delete _0x15c19f[_0x4402('0x21')];}_0x211424[_0x4402('0x14')](_0x5a43d0)[_0x4402('0x22')](_0x15c19f);};}exports[_0x4402('0x23')]=function(_0x514e41,_0x41de44){var _0x52e625={},_0x71da2f={},_0x1e2340={'count':0x0,'rows':[]};var _0x42dd32=_['map'](db[_0x4402('0x24')][_0x4402('0x25')],function(_0x316239){return{'name':_0x316239[_0x4402('0x26')],'type':_0x316239[_0x4402('0x27')][_0x4402('0x28')]};});_0x71da2f[_0x4402('0x29')]=_[_0x4402('0x2a')](_0x42dd32,_0x4402('0x21'));_0x71da2f[_0x4402('0x2b')]=_[_0x4402('0x2c')](_0x514e41['query']);_0x71da2f[_0x4402('0x2d')]=_['intersection'](_0x71da2f[_0x4402('0x29')],_0x71da2f['query']);_0x52e625[_0x4402('0x2e')]=_[_0x4402('0x2f')](_0x71da2f[_0x4402('0x29')],qs[_0x4402('0x30')](_0x514e41[_0x4402('0x2b')]['fields']));_0x52e625[_0x4402('0x2e')]=_0x52e625[_0x4402('0x2e')][_0x4402('0x31')]?_0x52e625['attributes']:_0x71da2f[_0x4402('0x29')];if(!_0x514e41[_0x4402('0x2b')]['hasOwnProperty'](_0x4402('0x32'))){_0x52e625[_0x4402('0x19')]=qs[_0x4402('0x19')](_0x514e41[_0x4402('0x2b')][_0x4402('0x19')]);_0x52e625[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x514e41[_0x4402('0x2b')][_0x4402('0x17')]);}_0x52e625['order']=qs[_0x4402('0x33')](_0x514e41[_0x4402('0x2b')][_0x4402('0x33')]);_0x52e625['where']=qs[_0x4402('0x2d')](_[_0x4402('0x34')](_0x514e41['query'],_0x71da2f['filters']),_0x42dd32);if(_0x514e41[_0x4402('0x2b')][_0x4402('0x35')]){_0x52e625[_0x4402('0x36')]=_[_0x4402('0x37')](_0x52e625['where'],{'$or':_['map'](_0x42dd32,function(_0x4b0672){if(_0x4b0672[_0x4402('0x27')]!==_0x4402('0x38')){var _0xcbfa06={};_0xcbfa06[_0x4b0672[_0x4402('0x21')]]={'$like':'%'+_0x514e41['query'][_0x4402('0x35')]+'%'};return _0xcbfa06;}})});}_0x52e625=_[_0x4402('0x37')]({},_0x52e625,_0x514e41[_0x4402('0x39')]);var _0x57843d={'where':_0x52e625[_0x4402('0x36')]};return db['WhatsappQueueReport'][_0x4402('0x1a')](_0x57843d)[_0x4402('0x1f')](function(_0x5c74b1){_0x1e2340[_0x4402('0x1a')]=_0x5c74b1;if(_0x514e41['query'][_0x4402('0x3a')]){_0x52e625[_0x4402('0x3b')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x4402('0x3c')](_0x52e625);})[_0x4402('0x1f')](function(_0x250f09){_0x1e2340[_0x4402('0x3d')]=_0x250f09;return _0x1e2340;})['then'](respondWithFilteredResult(_0x41de44,_0x52e625))['catch'](handleError(_0x41de44,null));};exports[_0x4402('0x3e')]=function(_0x47a3a3,_0x3a589b){var _0x2a6d78={'raw':!![],'where':{'id':_0x47a3a3[_0x4402('0x3f')]['id']}},_0xb9cf85={};_0xb9cf85[_0x4402('0x29')]=_[_0x4402('0x2c')](db[_0x4402('0x24')][_0x4402('0x25')]);_0xb9cf85[_0x4402('0x2b')]=_[_0x4402('0x2c')](_0x47a3a3['query']);_0xb9cf85[_0x4402('0x2d')]=_[_0x4402('0x2f')](_0xb9cf85['model'],_0xb9cf85[_0x4402('0x2b')]);_0x2a6d78[_0x4402('0x2e')]=_['intersection'](_0xb9cf85[_0x4402('0x29')],qs[_0x4402('0x30')](_0x47a3a3[_0x4402('0x2b')][_0x4402('0x30')]));_0x2a6d78[_0x4402('0x2e')]=_0x2a6d78['attributes'][_0x4402('0x31')]?_0x2a6d78[_0x4402('0x2e')]:_0xb9cf85[_0x4402('0x29')];if(_0x47a3a3[_0x4402('0x2b')][_0x4402('0x3a')]){_0x2a6d78[_0x4402('0x3b')]=[{'all':!![]}];}_0x2a6d78=_[_0x4402('0x37')]({},_0x2a6d78,_0x47a3a3[_0x4402('0x39')]);return db[_0x4402('0x24')][_0x4402('0x40')](_0x2a6d78)[_0x4402('0x1f')](handleEntityNotFound(_0x3a589b,null))['then'](respondWithResult(_0x3a589b,null))[_0x4402('0x41')](handleError(_0x3a589b,null));};exports['create']=function(_0xc45af6,_0x34ce00){return db['WhatsappQueueReport'][_0x4402('0x42')](_0xc45af6[_0x4402('0x43')],{})[_0x4402('0x1f')](respondWithResult(_0x34ce00,0xc9))[_0x4402('0x41')](handleError(_0x34ce00,null));};exports[_0x4402('0x1e')]=function(_0x2503eb,_0x5b094b){if(_0x2503eb[_0x4402('0x43')]['id']){delete _0x2503eb[_0x4402('0x43')]['id'];}return db[_0x4402('0x24')][_0x4402('0x40')]({'where':{'id':_0x2503eb[_0x4402('0x3f')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x5b094b,null))[_0x4402('0x1f')](saveUpdates(_0x2503eb[_0x4402('0x43')],null))[_0x4402('0x1f')](respondWithResult(_0x5b094b,null))['catch'](handleError(_0x5b094b,null));};exports['destroy']=function(_0x5ab12b,_0x4c2d2e){return db[_0x4402('0x24')][_0x4402('0x40')]({'where':{'id':_0x5ab12b[_0x4402('0x3f')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x4c2d2e,null))['then'](removeEntity(_0x4c2d2e,null))[_0x4402('0x41')](handleError(_0x4c2d2e,null));};exports[_0x4402('0x44')]=function(_0x203b33,_0x2a4ea7){return db[_0x4402('0x24')][_0x4402('0x44')]()[_0x4402('0x1f')](respondWithResult(_0x2a4ea7,null))['catch'](handleError(_0x2a4ea7,null));}; \ No newline at end of file +var _0xe2cf=['body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','WhatsappQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x38b44b,_0x31ea96){var _0x3bce1a=function(_0x4f7450){while(--_0x4f7450){_0x38b44b['push'](_0x38b44b['shift']());}};_0x3bce1a(++_0x31ea96);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x552cf8,_0x493a58){_0x552cf8=_0x552cf8-0x0;var _0x5b0eca=_0xe2cf[_0x552cf8];return _0x5b0eca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe2c('0x1'));var rp=require('request-promise');var moment=require(_0xfe2c('0x2'));var BPromise=require(_0xfe2c('0x3'));var Mustache=require(_0xfe2c('0x4'));var util=require(_0xfe2c('0x5'));var path=require('path');var sox=require(_0xfe2c('0x6'));var csv=require(_0xfe2c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2c('0x8'));var squel=require(_0xfe2c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2c('0xa'));var toCsv=require(_0xfe2c('0x7'));var querystring=require(_0xfe2c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe2c('0xc'));var qs=require(_0xfe2c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2c('0xe'));var logger=require(_0xfe2c('0xf'))(_0xfe2c('0x10'));var utils=require(_0xfe2c('0x11'));var config=require(_0xfe2c('0x12'));var licenseUtil=require(_0xfe2c('0x13'));var db=require(_0xfe2c('0x14'))['db'];function respondWithStatusCode(_0x4af8b7,_0x5e7389){_0x5e7389=_0x5e7389||0xcc;return function(_0x59ecf8){if(_0x59ecf8){return _0x4af8b7['sendStatus'](_0x5e7389);}return _0x4af8b7[_0xfe2c('0x15')](_0x5e7389)['end']();};}function respondWithResult(_0x5a6ad5,_0x38ba2c){_0x38ba2c=_0x38ba2c||0xc8;return function(_0x4d0a10){if(_0x4d0a10){return _0x5a6ad5[_0xfe2c('0x15')](_0x38ba2c)[_0xfe2c('0x16')](_0x4d0a10);}};}function respondWithFilteredResult(_0x522692,_0x5039cb){return function(_0x1a4684){if(_0x1a4684){var _0x3b3ebd=typeof _0x5039cb[_0xfe2c('0x17')]===_0xfe2c('0x18')&&typeof _0x5039cb['limit']===_0xfe2c('0x18');var _0x96a3a3=_0x1a4684[_0xfe2c('0x19')];var _0x23242b=_0x3b3ebd?0x0:_0x5039cb[_0xfe2c('0x17')];var _0x13f233=_0x3b3ebd?_0x1a4684['count']:_0x5039cb[_0xfe2c('0x17')]+_0x5039cb[_0xfe2c('0x1a')];var _0x1d7852;if(_0x13f233>=_0x96a3a3){_0x13f233=_0x96a3a3;_0x1d7852=0xc8;}else{_0x1d7852=0xce;}_0x522692[_0xfe2c('0x15')](_0x1d7852);return _0x522692['set'](_0xfe2c('0x1b'),_0x23242b+'-'+_0x13f233+'/'+_0x96a3a3)['json'](_0x1a4684);}return null;};}function patchUpdates(_0x4e9137){return function(_0x408f31){try{jsonpatch[_0xfe2c('0x1c')](_0x408f31,_0x4e9137,!![]);}catch(_0x4bf7c0){return BPromise[_0xfe2c('0x1d')](_0x4bf7c0);}return _0x408f31[_0xfe2c('0x1e')]();};}function saveUpdates(_0x5e609f,_0x1bd50e){return function(_0x5dd54b){if(_0x5dd54b){return _0x5dd54b[_0xfe2c('0x1f')](_0x5e609f)[_0xfe2c('0x20')](function(_0x8b5c0d){return _0x8b5c0d;});}return null;};}function removeEntity(_0x298819,_0x360928){return function(_0x2ee3b3){if(_0x2ee3b3){return _0x2ee3b3['destroy']()[_0xfe2c('0x20')](function(){_0x298819[_0xfe2c('0x15')](0xcc)[_0xfe2c('0x21')]();});}};}function handleEntityNotFound(_0x26448c,_0x3486b5){return function(_0x10afde){if(!_0x10afde){_0x26448c['sendStatus'](0x194);}return _0x10afde;};}function handleError(_0x205da8,_0x5e8abf){_0x5e8abf=_0x5e8abf||0x1f4;return function(_0x16daf3){logger[_0xfe2c('0x22')](_0x16daf3[_0xfe2c('0x23')]);if(_0x16daf3['name']){delete _0x16daf3[_0xfe2c('0x24')];}_0x205da8[_0xfe2c('0x15')](_0x5e8abf)['send'](_0x16daf3);};}exports[_0xfe2c('0x25')]=function(_0x1b6eb7,_0x3352e8){var _0x53a8c1={},_0x170026={},_0x1b7c91={'count':0x0,'rows':[]};var _0x55aed7=_['map'](db[_0xfe2c('0x26')][_0xfe2c('0x27')],function(_0x1a5e15){return{'name':_0x1a5e15[_0xfe2c('0x28')],'type':_0x1a5e15[_0xfe2c('0x29')]['key']};});_0x170026[_0xfe2c('0x2a')]=_[_0xfe2c('0x2b')](_0x55aed7,_0xfe2c('0x24'));_0x170026[_0xfe2c('0x2c')]=_[_0xfe2c('0x2d')](_0x1b6eb7[_0xfe2c('0x2c')]);_0x170026[_0xfe2c('0x2e')]=_[_0xfe2c('0x2f')](_0x170026[_0xfe2c('0x2a')],_0x170026[_0xfe2c('0x2c')]);_0x53a8c1[_0xfe2c('0x30')]=_[_0xfe2c('0x2f')](_0x170026['model'],qs[_0xfe2c('0x31')](_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x31')]));_0x53a8c1['attributes']=_0x53a8c1[_0xfe2c('0x30')][_0xfe2c('0x32')]?_0x53a8c1['attributes']:_0x170026[_0xfe2c('0x2a')];if(!_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x33')]('nolimit')){_0x53a8c1[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x1a')]);_0x53a8c1[_0xfe2c('0x17')]=qs[_0xfe2c('0x17')](_0x1b6eb7[_0xfe2c('0x2c')]['offset']);}_0x53a8c1['order']=qs[_0xfe2c('0x34')](_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x34')]);_0x53a8c1[_0xfe2c('0x35')]=qs['filters'](_[_0xfe2c('0x36')](_0x1b6eb7['query'],_0x170026[_0xfe2c('0x2e')]),_0x55aed7);if(_0x1b6eb7[_0xfe2c('0x2c')]['filter']){_0x53a8c1[_0xfe2c('0x35')]=_['merge'](_0x53a8c1['where'],{'$or':_[_0xfe2c('0x2b')](_0x55aed7,function(_0x3d3b5e){if(_0x3d3b5e[_0xfe2c('0x29')]!==_0xfe2c('0x37')){var _0xae2808={};_0xae2808[_0x3d3b5e[_0xfe2c('0x24')]]={'$like':'%'+_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x38')]+'%'};return _0xae2808;}})});}_0x53a8c1=_[_0xfe2c('0x39')]({},_0x53a8c1,_0x1b6eb7[_0xfe2c('0x3a')]);var _0x222335={'where':_0x53a8c1['where']};return db[_0xfe2c('0x26')][_0xfe2c('0x19')](_0x222335)[_0xfe2c('0x20')](function(_0x55ea45){_0x1b7c91['count']=_0x55ea45;if(_0x1b6eb7['query'][_0xfe2c('0x3b')]){_0x53a8c1[_0xfe2c('0x3c')]=[{'all':!![]}];}return db[_0xfe2c('0x26')][_0xfe2c('0x3d')](_0x53a8c1);})['then'](function(_0x1ed30b){_0x1b7c91[_0xfe2c('0x3e')]=_0x1ed30b;return _0x1b7c91;})[_0xfe2c('0x20')](respondWithFilteredResult(_0x3352e8,_0x53a8c1))[_0xfe2c('0x3f')](handleError(_0x3352e8,null));};exports[_0xfe2c('0x40')]=function(_0x48e361,_0x5a8d4e){var _0xeb04b9={'raw':!![],'where':{'id':_0x48e361[_0xfe2c('0x41')]['id']}},_0x6055dd={};_0x6055dd['model']=_['keys'](db[_0xfe2c('0x26')][_0xfe2c('0x27')]);_0x6055dd['query']=_[_0xfe2c('0x2d')](_0x48e361[_0xfe2c('0x2c')]);_0x6055dd[_0xfe2c('0x2e')]=_[_0xfe2c('0x2f')](_0x6055dd['model'],_0x6055dd[_0xfe2c('0x2c')]);_0xeb04b9[_0xfe2c('0x30')]=_[_0xfe2c('0x2f')](_0x6055dd[_0xfe2c('0x2a')],qs[_0xfe2c('0x31')](_0x48e361[_0xfe2c('0x2c')][_0xfe2c('0x31')]));_0xeb04b9[_0xfe2c('0x30')]=_0xeb04b9['attributes'][_0xfe2c('0x32')]?_0xeb04b9['attributes']:_0x6055dd[_0xfe2c('0x2a')];if(_0x48e361[_0xfe2c('0x2c')][_0xfe2c('0x3b')]){_0xeb04b9[_0xfe2c('0x3c')]=[{'all':!![]}];}_0xeb04b9=_['merge']({},_0xeb04b9,_0x48e361['options']);return db['WhatsappQueueReport']['find'](_0xeb04b9)['then'](handleEntityNotFound(_0x5a8d4e,null))[_0xfe2c('0x20')](respondWithResult(_0x5a8d4e,null))['catch'](handleError(_0x5a8d4e,null));};exports['create']=function(_0x22adee,_0x5d76be){return db[_0xfe2c('0x26')]['create'](_0x22adee[_0xfe2c('0x42')],{})[_0xfe2c('0x20')](respondWithResult(_0x5d76be,0xc9))[_0xfe2c('0x3f')](handleError(_0x5d76be,null));};exports[_0xfe2c('0x1f')]=function(_0x3cfda2,_0x57ad76){if(_0x3cfda2[_0xfe2c('0x42')]['id']){delete _0x3cfda2[_0xfe2c('0x42')]['id'];}return db[_0xfe2c('0x26')]['find']({'where':{'id':_0x3cfda2[_0xfe2c('0x41')]['id']}})[_0xfe2c('0x20')](handleEntityNotFound(_0x57ad76,null))['then'](saveUpdates(_0x3cfda2['body'],null))['then'](respondWithResult(_0x57ad76,null))[_0xfe2c('0x3f')](handleError(_0x57ad76,null));};exports[_0xfe2c('0x43')]=function(_0x47023e,_0x2e0012){return db[_0xfe2c('0x26')]['find']({'where':{'id':_0x47023e[_0xfe2c('0x41')]['id']}})[_0xfe2c('0x20')](handleEntityNotFound(_0x2e0012,null))[_0xfe2c('0x20')](removeEntity(_0x2e0012,null))['catch'](handleError(_0x2e0012,null));};exports['describe']=function(_0x3e7c9f,_0xa711b0){return db[_0xfe2c('0x26')][_0xfe2c('0x44')]()[_0xfe2c('0x20')](respondWithResult(_0xa711b0,null))[_0xfe2c('0x3f')](handleError(_0xa711b0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a39a6cb..f832bf6 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 _0x2313=['uniqueid','lodash','util','api','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2313,0x109));var _0x3231=function(_0x335307,_0x2ed107){_0x335307=_0x335307-0x0;var _0x32394d=_0x2313[_0x335307];return _0x32394d;};'use strict';var _=require(_0x3231('0x0'));var util=require(_0x3231('0x1'));var logger=require('../../config/logger')(_0x3231('0x2'));var moment=require('moment');var BPromise=require(_0x3231('0x3'));var rp=require(_0x3231('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3231('0x5'));var attributes=require(_0x3231('0x6'));module['exports']=function(_0x184adc,_0x54c0d8){return _0x184adc[_0x3231('0x7')](_0x3231('0x8'),attributes,{'tableName':_0x3231('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3231('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd52c=['./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xc4005a,_0x2665b3){var _0x44ff4a=function(_0x8742a5){while(--_0x8742a5){_0xc4005a['push'](_0xc4005a['shift']());}};_0x44ff4a(++_0x2665b3);}(_0xd52c,0xe2));var _0xcd52=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0xd52c[_0x16e0f5];return _0x4839d5;};'use strict';var _=require(_0xcd52('0x0'));var util=require(_0xcd52('0x1'));var logger=require(_0xcd52('0x2'))('api');var moment=require(_0xcd52('0x3'));var BPromise=require(_0xcd52('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd52('0x5'));var rimraf=require(_0xcd52('0x6'));var config=require(_0xcd52('0x7'));var attributes=require(_0xcd52('0x8'));module[_0xcd52('0x9')]=function(_0x4dba89,_0x23ffb0){return _0x4dba89['define'](_0xcd52('0xa'),attributes,{'tableName':_0xcd52('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcd52('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index f61b98e..791556e 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 _0xa336=['../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','UpdateWhatsappQueueReport','update','body','where','attributes','limit','stringify','moment','bluebird','randomstring','ioredis'];(function(_0x4ac6a3,_0x59939a){var _0x317ceb=function(_0xebd516){while(--_0xebd516){_0x4ac6a3['push'](_0x4ac6a3['shift']());}};_0x317ceb(++_0x59939a);}(_0xa336,0x18f));var _0x6a33=function(_0x4cd9c6,_0x766862){_0x4cd9c6=_0x4cd9c6-0x0;var _0x53a566=_0xa336[_0x4cd9c6];return _0x53a566;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a33('0x0'));var BPromise=require(_0x6a33('0x1'));var rs=require(_0x6a33('0x2'));var fs=require('fs');var Redis=require(_0x6a33('0x3'));var db=require(_0x6a33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a33('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6a33('0x6'));var client=jayson[_0x6a33('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d0e4a,_0x3ff94a,_0x1a9cd7){return new BPromise(function(_0x412912,_0x3abb0f){return client[_0x6a33('0x8')](_0x5d0e4a,_0x1a9cd7)[_0x6a33('0x9')](function(_0x373ef6){logger[_0x6a33('0xa')](_0x6a33('0xb'),_0x3ff94a,_0x6a33('0xc'));logger['debug'](_0x6a33('0xd'),_0x3ff94a,_0x6a33('0xc'),JSON['stringify'](_0x373ef6));if(_0x373ef6[_0x6a33('0xe')]){if(_0x373ef6['error'][_0x6a33('0xf')]===0x1f4){logger['error'](_0x6a33('0xb'),_0x3ff94a,_0x373ef6[_0x6a33('0xe')]['message']);return _0x3abb0f(_0x373ef6['error'][_0x6a33('0x10')]);}logger[_0x6a33('0xe')](_0x6a33('0xb'),_0x3ff94a,_0x373ef6['error']['message']);return _0x412912(_0x373ef6['error']['message']);}else{logger[_0x6a33('0xa')](_0x6a33('0xb'),_0x3ff94a,_0x6a33('0xc'));_0x412912(_0x373ef6['result'][_0x6a33('0x10')]);}})[_0x6a33('0x11')](function(_0x10b998){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x3ff94a,_0x10b998);_0x3abb0f(_0x10b998);});});}exports[_0x6a33('0x12')]=function(_0x214e46){var _0x5917ac=this;return new Promise(function(_0x287fcb,_0x4c3afc){return db[_0x6a33('0x13')][_0x6a33('0x14')](_0x214e46['body'],{'raw':_0x214e46['options']?_0x214e46[_0x6a33('0x15')][_0x6a33('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5b8b34){logger[_0x6a33('0xa')]('CreateWhatsappQueueReport',_0x214e46);logger[_0x6a33('0x17')](_0x6a33('0x12'),_0x214e46,JSON['stringify'](_0x5b8b34));_0x287fcb(_0x5b8b34);})[_0x6a33('0x11')](function(_0x1c5af0){logger[_0x6a33('0xe')](_0x6a33('0x12'),_0x1c5af0['message'],_0x214e46);_0x4c3afc(_0x5917ac[_0x6a33('0xe')](0x1f4,_0x1c5af0[_0x6a33('0x10')]));});});};exports[_0x6a33('0x18')]=function(_0x3a6d17){var _0x504e05=this;return new Promise(function(_0x5dd5e6,_0xd637f3){return db[_0x6a33('0x13')][_0x6a33('0x19')](_0x3a6d17[_0x6a33('0x1a')],{'raw':_0x3a6d17[_0x6a33('0x15')]?_0x3a6d17[_0x6a33('0x15')][_0x6a33('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a6d17['options']?_0x3a6d17['options'][_0x6a33('0x1b')]||null:null,'attributes':_0x3a6d17[_0x6a33('0x15')]?_0x3a6d17['options'][_0x6a33('0x1c')]||null:null,'limit':_0x3a6d17[_0x6a33('0x15')]?_0x3a6d17[_0x6a33('0x15')][_0x6a33('0x1d')]||null:null})['then'](function(_0x5ceb13){logger['info']('UpdateWhatsappQueueReport',_0x3a6d17);logger[_0x6a33('0x17')](_0x6a33('0x18'),_0x3a6d17,JSON[_0x6a33('0x1e')](_0x5ceb13));_0x5dd5e6(_0x5ceb13);})['catch'](function(_0x8d3fd2){logger['error'](_0x6a33('0x18'),_0x8d3fd2['message'],_0x3a6d17);_0xd637f3(_0x504e05[_0x6a33('0xe')](0x1f4,_0x8d3fd2['message']));});});}; \ No newline at end of file +var _0xdd8b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','create','options','CreateWhatsappQueueReport','stringify','UpdateWhatsappQueueReport','WhatsappQueueReport','update','body','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3e5cd3,_0x17c4b2){var _0x1e8bd0=function(_0x3e2290){while(--_0x3e2290){_0x3e5cd3['push'](_0x3e5cd3['shift']());}};_0x1e8bd0(++_0x17c4b2);}(_0xdd8b,0x1e3));var _0xbdd8=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0xdd8b[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require(_0xbdd8('0x0'));var util=require(_0xbdd8('0x1'));var moment=require(_0xbdd8('0x2'));var BPromise=require(_0xbdd8('0x3'));var rs=require(_0xbdd8('0x4'));var fs=require('fs');var Redis=require(_0xbdd8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdd8('0x6'));var logger=require('../../config/logger')(_0xbdd8('0x7'));var config=require(_0xbdd8('0x8'));var jayson=require(_0xbdd8('0x9'));var client=jayson[_0xbdd8('0xa')][_0xbdd8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x193e50,_0x63bf45,_0xd41d2){return new BPromise(function(_0x464602,_0x4c59d0){return client[_0xbdd8('0xc')](_0x193e50,_0xd41d2)[_0xbdd8('0xd')](function(_0x34fe83){logger[_0xbdd8('0xe')](_0xbdd8('0xf'),_0x63bf45,'request\x20sent');logger[_0xbdd8('0x10')](_0xbdd8('0x11'),_0x63bf45,'request\x20sent',JSON['stringify'](_0x34fe83));if(_0x34fe83[_0xbdd8('0x12')]){if(_0x34fe83[_0xbdd8('0x12')][_0xbdd8('0x13')]===0x1f4){logger[_0xbdd8('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x63bf45,_0x34fe83[_0xbdd8('0x12')][_0xbdd8('0x14')]);return _0x4c59d0(_0x34fe83[_0xbdd8('0x12')]['message']);}logger[_0xbdd8('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x63bf45,_0x34fe83['error'][_0xbdd8('0x14')]);return _0x464602(_0x34fe83[_0xbdd8('0x12')]['message']);}else{logger[_0xbdd8('0xe')](_0xbdd8('0xf'),_0x63bf45,_0xbdd8('0x15'));_0x464602(_0x34fe83[_0xbdd8('0x16')][_0xbdd8('0x14')]);}})[_0xbdd8('0x17')](function(_0x542797){logger[_0xbdd8('0x12')](_0xbdd8('0xf'),_0x63bf45,_0x542797);_0x4c59d0(_0x542797);});});}exports['CreateWhatsappQueueReport']=function(_0x4d63bb){var _0x37c258=this;return new Promise(function(_0x3286fe,_0x53df74){return db['WhatsappQueueReport'][_0xbdd8('0x18')](_0x4d63bb['body'],{'raw':_0x4d63bb[_0xbdd8('0x19')]?_0x4d63bb[_0xbdd8('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x320140){logger['info'](_0xbdd8('0x1a'),_0x4d63bb);logger[_0xbdd8('0x10')](_0xbdd8('0x1a'),_0x4d63bb,JSON[_0xbdd8('0x1b')](_0x320140));_0x3286fe(_0x320140);})['catch'](function(_0x1eb084){logger['error']('CreateWhatsappQueueReport',_0x1eb084[_0xbdd8('0x14')],_0x4d63bb);_0x53df74(_0x37c258['error'](0x1f4,_0x1eb084[_0xbdd8('0x14')]));});});};exports[_0xbdd8('0x1c')]=function(_0x31e773){var _0x342f2b=this;return new Promise(function(_0x383367,_0x2aa6af){return db[_0xbdd8('0x1d')][_0xbdd8('0x1e')](_0x31e773[_0xbdd8('0x1f')],{'raw':_0x31e773[_0xbdd8('0x19')]?_0x31e773[_0xbdd8('0x19')][_0xbdd8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31e773['options']?_0x31e773[_0xbdd8('0x19')][_0xbdd8('0x21')]||null:null,'attributes':_0x31e773['options']?_0x31e773[_0xbdd8('0x19')]['attributes']||null:null,'limit':_0x31e773[_0xbdd8('0x19')]?_0x31e773['options'][_0xbdd8('0x22')]||null:null})['then'](function(_0x1fc22d){logger['info'](_0xbdd8('0x1c'),_0x31e773);logger[_0xbdd8('0x10')](_0xbdd8('0x1c'),_0x31e773,JSON[_0xbdd8('0x1b')](_0x1fc22d));_0x383367(_0x1fc22d);})[_0xbdd8('0x17')](function(_0x242709){logger['error'](_0xbdd8('0x1c'),_0x242709[_0xbdd8('0x14')],_0x31e773);_0x2aa6af(_0x342f2b['error'](0x1f4,_0x242709[_0xbdd8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 46e6eca..351bd7b 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 _0xf61d=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x17a13a,_0x1c34d7){var _0x47f771=function(_0x2a1900){while(--_0x2a1900){_0x17a13a['push'](_0x17a13a['shift']());}};_0x47f771(++_0x1c34d7);}(_0xf61d,0x70));var _0xdf61=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0xf61d[_0x24697b];return _0x585b99;};'use strict';var multer=require(_0xdf61('0x0'));var util=require(_0xdf61('0x1'));var path=require(_0xdf61('0x2'));var timeout=require(_0xdf61('0x3'));var express=require(_0xdf61('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdf61('0x5'));var interaction=require(_0xdf61('0x6'));var config=require(_0xdf61('0x7'));var controller=require(_0xdf61('0x8'));router[_0xdf61('0x9')]('/',auth[_0xdf61('0xa')](),controller[_0xdf61('0xb')]);router['get'](_0xdf61('0xc'),auth[_0xdf61('0xa')](),controller[_0xdf61('0xd')]);router['get'](_0xdf61('0xe'),auth[_0xdf61('0xa')](),controller[_0xdf61('0xf')]);router[_0xdf61('0x10')]('/',auth[_0xdf61('0xa')](),controller[_0xdf61('0x11')]);router[_0xdf61('0x12')](_0xdf61('0xe'),auth[_0xdf61('0xa')](),controller[_0xdf61('0x13')]);router[_0xdf61('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdf61('0x15')]);module[_0xdf61('0x16')]=router; \ No newline at end of file +var _0x5065=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','update','delete','destroy'];(function(_0x5be527,_0x47a3f2){var _0x3f0f16=function(_0x16a756){while(--_0x16a756){_0x5be527['push'](_0x5be527['shift']());}};_0x3f0f16(++_0x47a3f2);}(_0x5065,0x190));var _0x5506=function(_0x58c73d,_0xaceeec){_0x58c73d=_0x58c73d-0x0;var _0xb3a32b=_0x5065[_0x58c73d];return _0xb3a32b;};'use strict';var multer=require(_0x5506('0x0'));var util=require('util');var path=require(_0x5506('0x1'));var timeout=require(_0x5506('0x2'));var express=require(_0x5506('0x3'));var router=express[_0x5506('0x4')]();var fs_extra=require(_0x5506('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5506('0x6'));var config=require(_0x5506('0x7'));var controller=require(_0x5506('0x8'));router[_0x5506('0x9')]('/',auth[_0x5506('0xa')](),controller['index']);router[_0x5506('0x9')](_0x5506('0xb'),auth[_0x5506('0xa')](),controller[_0x5506('0xc')]);router[_0x5506('0x9')](_0x5506('0xd'),auth[_0x5506('0xa')](),controller['show']);router[_0x5506('0xe')]('/',auth[_0x5506('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5506('0xf')]);router[_0x5506('0x10')](_0x5506('0xd'),auth[_0x5506('0xa')](),controller[_0x5506('0x11')]);module[_0x5506('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 f183fda..1feb17e 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 _0x8d62=['agent','queue','DATE','exports','STRING','ENUM','account'];(function(_0x10b7d7,_0x1c17d0){var _0x504b28=function(_0x2c943a){while(--_0x2c943a){_0x10b7d7['push'](_0x10b7d7['shift']());}};_0x504b28(++_0x1c17d0);}(_0x8d62,0xf8));var _0x28d6=function(_0x5d08db,_0x2d7d3d){_0x5d08db=_0x5d08db-0x0;var _0x3d1307=_0x8d62[_0x5d08db];return _0x3d1307;};'use strict';var Sequelize=require('sequelize');module[_0x28d6('0x0')]={'uniqueid':{'type':Sequelize[_0x28d6('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x28d6('0x2')](_0x28d6('0x3'),_0x28d6('0x4'),_0x28d6('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x28d6('0x6')]}}; \ No newline at end of file +var _0xb627=['ENUM','agent','queue','DATE','sequelize'];(function(_0x1ce8f5,_0x5b1472){var _0x3347c4=function(_0x56cf37){while(--_0x56cf37){_0x1ce8f5['push'](_0x1ce8f5['shift']());}};_0x3347c4(++_0x5b1472);}(_0xb627,0x144));var _0x7b62=function(_0x482074,_0x30203e){_0x482074=_0x482074-0x0;var _0x524c64=_0xb627[_0x482074];return _0x524c64;};'use strict';var Sequelize=require(_0x7b62('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7b62('0x1')]('account',_0x7b62('0x2'),_0x7b62('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7b62('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 3fa4652..623d16d 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 _0xe2d8=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','WhatsappTransferReport','type','key','query','filters','model','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x4358cb,_0x1f1c23){var _0x59a7e4=function(_0x5a1e15){while(--_0x5a1e15){_0x4358cb['push'](_0x4358cb['shift']());}};_0x59a7e4(++_0x1f1c23);}(_0xe2d8,0x11f));var _0x8e2d=function(_0x658305,_0x53aa13){_0x658305=_0x658305-0x0;var _0x552daf=_0xe2d8[_0x658305];return _0x552daf;};'use strict';var emlformat=require(_0x8e2d('0x0'));var rimraf=require(_0x8e2d('0x1'));var zipdir=require(_0x8e2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e2d('0x3'));var moment=require(_0x8e2d('0x4'));var BPromise=require(_0x8e2d('0x5'));var Mustache=require(_0x8e2d('0x6'));var util=require(_0x8e2d('0x7'));var path=require('path');var sox=require(_0x8e2d('0x8'));var csv=require('to-csv');var ejs=require(_0x8e2d('0x9'));var fs=require('fs');var fs_extra=require(_0x8e2d('0xa'));var _=require(_0x8e2d('0xb'));var squel=require(_0x8e2d('0xc'));var crypto=require(_0x8e2d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e2d('0xe'));var toCsv=require(_0x8e2d('0xf'));var querystring=require(_0x8e2d('0x10'));var Papa=require(_0x8e2d('0x11'));var Redis=require(_0x8e2d('0x12'));var authService=require(_0x8e2d('0x13'));var qs=require(_0x8e2d('0x14'));var as=require(_0x8e2d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e2d('0x16'));var utils=require('../../config/utils');var config=require(_0x8e2d('0x17'));var licenseUtil=require(_0x8e2d('0x18'));var db=require(_0x8e2d('0x19'))['db'];function respondWithStatusCode(_0x24d95b,_0x16d0b7){_0x16d0b7=_0x16d0b7||0xcc;return function(_0x38e1c2){if(_0x38e1c2){return _0x24d95b['sendStatus'](_0x16d0b7);}return _0x24d95b[_0x8e2d('0x1a')](_0x16d0b7)['end']();};}function respondWithResult(_0xc140f7,_0x3f9195){_0x3f9195=_0x3f9195||0xc8;return function(_0x478f27){if(_0x478f27){return _0xc140f7[_0x8e2d('0x1a')](_0x3f9195)[_0x8e2d('0x1b')](_0x478f27);}};}function respondWithFilteredResult(_0x5ef57f,_0x41ec18){return function(_0x4a3d9d){if(_0x4a3d9d){var _0x2b2192=typeof _0x41ec18[_0x8e2d('0x1c')]===_0x8e2d('0x1d')&&typeof _0x41ec18[_0x8e2d('0x1e')]===_0x8e2d('0x1d');var _0x2ab9b1=_0x4a3d9d[_0x8e2d('0x1f')];var _0x5143a3=_0x2b2192?0x0:_0x41ec18[_0x8e2d('0x1c')];var _0x52174c=_0x2b2192?_0x4a3d9d[_0x8e2d('0x1f')]:_0x41ec18['offset']+_0x41ec18[_0x8e2d('0x1e')];var _0x4bd600;if(_0x52174c>=_0x2ab9b1){_0x52174c=_0x2ab9b1;_0x4bd600=0xc8;}else{_0x4bd600=0xce;}_0x5ef57f[_0x8e2d('0x1a')](_0x4bd600);return _0x5ef57f[_0x8e2d('0x20')](_0x8e2d('0x21'),_0x5143a3+'-'+_0x52174c+'/'+_0x2ab9b1)[_0x8e2d('0x1b')](_0x4a3d9d);}return null;};}function patchUpdates(_0x471fe6){return function(_0x42521c){try{jsonpatch[_0x8e2d('0x22')](_0x42521c,_0x471fe6,!![]);}catch(_0x809b6a){return BPromise[_0x8e2d('0x23')](_0x809b6a);}return _0x42521c[_0x8e2d('0x24')]();};}function saveUpdates(_0x228402,_0x5d156b){return function(_0x194fb9){if(_0x194fb9){return _0x194fb9[_0x8e2d('0x25')](_0x228402)[_0x8e2d('0x26')](function(_0x944833){return _0x944833;});}return null;};}function removeEntity(_0x2570f,_0x4553bd){return function(_0x2942c1){if(_0x2942c1){return _0x2942c1[_0x8e2d('0x27')]()[_0x8e2d('0x26')](function(){_0x2570f[_0x8e2d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2cf1,_0x3518eb){return function(_0x5f1cda){if(!_0x5f1cda){_0x3b2cf1[_0x8e2d('0x28')](0x194);}return _0x5f1cda;};}function handleError(_0x1f344e,_0x25fddc){_0x25fddc=_0x25fddc||0x1f4;return function(_0x4cebb1){logger[_0x8e2d('0x29')](_0x4cebb1[_0x8e2d('0x2a')]);if(_0x4cebb1[_0x8e2d('0x2b')]){delete _0x4cebb1[_0x8e2d('0x2b')];}_0x1f344e[_0x8e2d('0x1a')](_0x25fddc)['send'](_0x4cebb1);};}exports[_0x8e2d('0x2c')]=function(_0x1edf32,_0x3d9355){var _0x26154c={},_0x3c08f8={},_0x5bd798={'count':0x0,'rows':[]};var _0x3ff982=_[_0x8e2d('0x2d')](db[_0x8e2d('0x2e')]['rawAttributes'],function(_0x3fc3c6){return{'name':_0x3fc3c6['fieldName'],'type':_0x3fc3c6[_0x8e2d('0x2f')][_0x8e2d('0x30')]};});_0x3c08f8['model']=_[_0x8e2d('0x2d')](_0x3ff982,_0x8e2d('0x2b'));_0x3c08f8[_0x8e2d('0x31')]=_['keys'](_0x1edf32[_0x8e2d('0x31')]);_0x3c08f8[_0x8e2d('0x32')]=_['intersection'](_0x3c08f8[_0x8e2d('0x33')],_0x3c08f8[_0x8e2d('0x31')]);_0x26154c['attributes']=_[_0x8e2d('0x34')](_0x3c08f8[_0x8e2d('0x33')],qs[_0x8e2d('0x35')](_0x1edf32['query'][_0x8e2d('0x35')]));_0x26154c['attributes']=_0x26154c[_0x8e2d('0x36')][_0x8e2d('0x37')]?_0x26154c[_0x8e2d('0x36')]:_0x3c08f8['model'];if(!_0x1edf32[_0x8e2d('0x31')]['hasOwnProperty'](_0x8e2d('0x38'))){_0x26154c['limit']=qs[_0x8e2d('0x1e')](_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x1e')]);_0x26154c[_0x8e2d('0x1c')]=qs[_0x8e2d('0x1c')](_0x1edf32['query'][_0x8e2d('0x1c')]);}_0x26154c['order']=qs[_0x8e2d('0x39')](_0x1edf32['query']['sort']);_0x26154c[_0x8e2d('0x3a')]=qs[_0x8e2d('0x32')](_['pick'](_0x1edf32['query'],_0x3c08f8['filters']),_0x3ff982);if(_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x3b')]){_0x26154c['where']=_[_0x8e2d('0x3c')](_0x26154c['where'],{'$or':_['map'](_0x3ff982,function(_0x553d6a){if(_0x553d6a[_0x8e2d('0x2f')]!==_0x8e2d('0x3d')){var _0x4b337c={};_0x4b337c[_0x553d6a['name']]={'$like':'%'+_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x3b')]+'%'};return _0x4b337c;}})});}_0x26154c=_['merge']({},_0x26154c,_0x1edf32[_0x8e2d('0x3e')]);var _0x36a8da={'where':_0x26154c['where']};return db[_0x8e2d('0x2e')][_0x8e2d('0x1f')](_0x36a8da)[_0x8e2d('0x26')](function(_0x2e44c3){_0x5bd798['count']=_0x2e44c3;if(_0x1edf32[_0x8e2d('0x31')][_0x8e2d('0x3f')]){_0x26154c[_0x8e2d('0x40')]=[{'all':!![]}];}return db[_0x8e2d('0x2e')]['findAll'](_0x26154c);})['then'](function(_0x3e3b2b){_0x5bd798[_0x8e2d('0x41')]=_0x3e3b2b;return _0x5bd798;})['then'](respondWithFilteredResult(_0x3d9355,_0x26154c))[_0x8e2d('0x42')](handleError(_0x3d9355,null));};exports['show']=function(_0x2fc131,_0x29b93b){var _0x22dca9={'raw':!![],'where':{'id':_0x2fc131[_0x8e2d('0x43')]['id']}},_0x3ba559={};_0x3ba559[_0x8e2d('0x33')]=_[_0x8e2d('0x44')](db[_0x8e2d('0x2e')]['rawAttributes']);_0x3ba559[_0x8e2d('0x31')]=_['keys'](_0x2fc131[_0x8e2d('0x31')]);_0x3ba559[_0x8e2d('0x32')]=_[_0x8e2d('0x34')](_0x3ba559[_0x8e2d('0x33')],_0x3ba559[_0x8e2d('0x31')]);_0x22dca9[_0x8e2d('0x36')]=_[_0x8e2d('0x34')](_0x3ba559[_0x8e2d('0x33')],qs[_0x8e2d('0x35')](_0x2fc131[_0x8e2d('0x31')][_0x8e2d('0x35')]));_0x22dca9['attributes']=_0x22dca9['attributes'][_0x8e2d('0x37')]?_0x22dca9[_0x8e2d('0x36')]:_0x3ba559[_0x8e2d('0x33')];if(_0x2fc131[_0x8e2d('0x31')][_0x8e2d('0x3f')]){_0x22dca9['include']=[{'all':!![]}];}_0x22dca9=_[_0x8e2d('0x3c')]({},_0x22dca9,_0x2fc131[_0x8e2d('0x3e')]);return db[_0x8e2d('0x2e')][_0x8e2d('0x45')](_0x22dca9)[_0x8e2d('0x26')](handleEntityNotFound(_0x29b93b,null))[_0x8e2d('0x26')](respondWithResult(_0x29b93b,null))[_0x8e2d('0x42')](handleError(_0x29b93b,null));};exports[_0x8e2d('0x46')]=function(_0x267958,_0x390b9d){return db['WhatsappTransferReport'][_0x8e2d('0x46')](_0x267958['body'],{})[_0x8e2d('0x26')](respondWithResult(_0x390b9d,0xc9))[_0x8e2d('0x42')](handleError(_0x390b9d,null));};exports[_0x8e2d('0x25')]=function(_0x10659c,_0x54f8c6){if(_0x10659c[_0x8e2d('0x47')]['id']){delete _0x10659c['body']['id'];}return db[_0x8e2d('0x2e')]['find']({'where':{'id':_0x10659c[_0x8e2d('0x43')]['id']}})['then'](handleEntityNotFound(_0x54f8c6,null))['then'](saveUpdates(_0x10659c['body'],null))[_0x8e2d('0x26')](respondWithResult(_0x54f8c6,null))[_0x8e2d('0x42')](handleError(_0x54f8c6,null));};exports[_0x8e2d('0x27')]=function(_0x98b0d,_0x3fec7f){return db[_0x8e2d('0x2e')][_0x8e2d('0x45')]({'where':{'id':_0x98b0d[_0x8e2d('0x43')]['id']}})[_0x8e2d('0x26')](handleEntityNotFound(_0x3fec7f,null))[_0x8e2d('0x26')](removeEntity(_0x3fec7f,null))[_0x8e2d('0x42')](handleError(_0x3fec7f,null));};exports[_0x8e2d('0x48')]=function(_0x46e59e,_0x18759d){return db[_0x8e2d('0x2e')][_0x8e2d('0x48')]()[_0x8e2d('0x26')](respondWithResult(_0x18759d,null))[_0x8e2d('0x42')](handleError(_0x18759d,null));}; \ No newline at end of file +var _0x6e1c=['query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','WhatsappTransferReport','fieldName','key','model'];(function(_0x18b77c,_0x2cea7d){var _0x16e96f=function(_0x4236f1){while(--_0x4236f1){_0x18b77c['push'](_0x18b77c['shift']());}};_0x16e96f(++_0x2cea7d);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc6e1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e1('0x1'));var rp=require(_0xc6e1('0x2'));var moment=require(_0xc6e1('0x3'));var BPromise=require(_0xc6e1('0x4'));var Mustache=require(_0xc6e1('0x5'));var util=require(_0xc6e1('0x6'));var path=require(_0xc6e1('0x7'));var sox=require(_0xc6e1('0x8'));var csv=require(_0xc6e1('0x9'));var ejs=require(_0xc6e1('0xa'));var fs=require('fs');var fs_extra=require(_0xc6e1('0xb'));var _=require('lodash');var squel=require(_0xc6e1('0xc'));var crypto=require(_0xc6e1('0xd'));var jsforce=require(_0xc6e1('0xe'));var deskjs=require(_0xc6e1('0xf'));var toCsv=require(_0xc6e1('0x9'));var querystring=require('querystring');var Papa=require(_0xc6e1('0x10'));var Redis=require(_0xc6e1('0x11'));var authService=require(_0xc6e1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6e1('0x13'));var logger=require(_0xc6e1('0x14'))('api');var utils=require(_0xc6e1('0x15'));var config=require(_0xc6e1('0x16'));var licenseUtil=require(_0xc6e1('0x17'));var db=require(_0xc6e1('0x18'))['db'];function respondWithStatusCode(_0x22b511,_0x3526e7){_0x3526e7=_0x3526e7||0xcc;return function(_0x543048){if(_0x543048){return _0x22b511[_0xc6e1('0x19')](_0x3526e7);}return _0x22b511[_0xc6e1('0x1a')](_0x3526e7)[_0xc6e1('0x1b')]();};}function respondWithResult(_0x2d554f,_0x3573dd){_0x3573dd=_0x3573dd||0xc8;return function(_0x5a7e25){if(_0x5a7e25){return _0x2d554f['status'](_0x3573dd)[_0xc6e1('0x1c')](_0x5a7e25);}};}function respondWithFilteredResult(_0x30428e,_0x5da248){return function(_0x6a58af){if(_0x6a58af){var _0x580fae=typeof _0x5da248[_0xc6e1('0x1d')]==='undefined'&&typeof _0x5da248[_0xc6e1('0x1e')]===_0xc6e1('0x1f');var _0x18dad6=_0x6a58af[_0xc6e1('0x20')];var _0x527c70=_0x580fae?0x0:_0x5da248[_0xc6e1('0x1d')];var _0x2b8b22=_0x580fae?_0x6a58af[_0xc6e1('0x20')]:_0x5da248[_0xc6e1('0x1d')]+_0x5da248[_0xc6e1('0x1e')];var _0x40c19c;if(_0x2b8b22>=_0x18dad6){_0x2b8b22=_0x18dad6;_0x40c19c=0xc8;}else{_0x40c19c=0xce;}_0x30428e[_0xc6e1('0x1a')](_0x40c19c);return _0x30428e[_0xc6e1('0x21')](_0xc6e1('0x22'),_0x527c70+'-'+_0x2b8b22+'/'+_0x18dad6)[_0xc6e1('0x1c')](_0x6a58af);}return null;};}function patchUpdates(_0x23369a){return function(_0x816a){try{jsonpatch[_0xc6e1('0x23')](_0x816a,_0x23369a,!![]);}catch(_0x107ab7){return BPromise['reject'](_0x107ab7);}return _0x816a[_0xc6e1('0x24')]();};}function saveUpdates(_0x255ae1,_0x1ed09e){return function(_0x36c460){if(_0x36c460){return _0x36c460[_0xc6e1('0x25')](_0x255ae1)[_0xc6e1('0x26')](function(_0x571aa7){return _0x571aa7;});}return null;};}function removeEntity(_0x484d0c,_0x40b059){return function(_0x5597d3){if(_0x5597d3){return _0x5597d3[_0xc6e1('0x27')]()[_0xc6e1('0x26')](function(){_0x484d0c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e284e,_0x431cca){return function(_0x5b0537){if(!_0x5b0537){_0x2e284e[_0xc6e1('0x19')](0x194);}return _0x5b0537;};}function handleError(_0x17d658,_0x4de357){_0x4de357=_0x4de357||0x1f4;return function(_0x400687){logger[_0xc6e1('0x28')](_0x400687[_0xc6e1('0x29')]);if(_0x400687[_0xc6e1('0x2a')]){delete _0x400687[_0xc6e1('0x2a')];}_0x17d658[_0xc6e1('0x1a')](_0x4de357)['send'](_0x400687);};}exports[_0xc6e1('0x2b')]=function(_0x600377,_0xd71377){var _0x5cefb6={},_0xe1114b={},_0x3e67a6={'count':0x0,'rows':[]};var _0x3113c9=_[_0xc6e1('0x2c')](db[_0xc6e1('0x2d')]['rawAttributes'],function(_0x17c8f0){return{'name':_0x17c8f0[_0xc6e1('0x2e')],'type':_0x17c8f0['type'][_0xc6e1('0x2f')]};});_0xe1114b[_0xc6e1('0x30')]=_[_0xc6e1('0x2c')](_0x3113c9,_0xc6e1('0x2a'));_0xe1114b[_0xc6e1('0x31')]=_[_0xc6e1('0x32')](_0x600377[_0xc6e1('0x31')]);_0xe1114b[_0xc6e1('0x33')]=_['intersection'](_0xe1114b[_0xc6e1('0x30')],_0xe1114b[_0xc6e1('0x31')]);_0x5cefb6[_0xc6e1('0x34')]=_[_0xc6e1('0x35')](_0xe1114b[_0xc6e1('0x30')],qs[_0xc6e1('0x36')](_0x600377['query']['fields']));_0x5cefb6[_0xc6e1('0x34')]=_0x5cefb6[_0xc6e1('0x34')][_0xc6e1('0x37')]?_0x5cefb6['attributes']:_0xe1114b[_0xc6e1('0x30')];if(!_0x600377[_0xc6e1('0x31')]['hasOwnProperty'](_0xc6e1('0x38'))){_0x5cefb6[_0xc6e1('0x1e')]=qs[_0xc6e1('0x1e')](_0x600377[_0xc6e1('0x31')]['limit']);_0x5cefb6[_0xc6e1('0x1d')]=qs['offset'](_0x600377[_0xc6e1('0x31')][_0xc6e1('0x1d')]);}_0x5cefb6[_0xc6e1('0x39')]=qs[_0xc6e1('0x3a')](_0x600377[_0xc6e1('0x31')]['sort']);_0x5cefb6['where']=qs[_0xc6e1('0x33')](_[_0xc6e1('0x3b')](_0x600377[_0xc6e1('0x31')],_0xe1114b['filters']),_0x3113c9);if(_0x600377[_0xc6e1('0x31')]['filter']){_0x5cefb6[_0xc6e1('0x3c')]=_[_0xc6e1('0x3d')](_0x5cefb6[_0xc6e1('0x3c')],{'$or':_[_0xc6e1('0x2c')](_0x3113c9,function(_0x232565){if(_0x232565[_0xc6e1('0x3e')]!==_0xc6e1('0x3f')){var _0x364c70={};_0x364c70[_0x232565['name']]={'$like':'%'+_0x600377[_0xc6e1('0x31')][_0xc6e1('0x40')]+'%'};return _0x364c70;}})});}_0x5cefb6=_[_0xc6e1('0x3d')]({},_0x5cefb6,_0x600377['options']);var _0x54b42e={'where':_0x5cefb6[_0xc6e1('0x3c')]};return db[_0xc6e1('0x2d')][_0xc6e1('0x20')](_0x54b42e)['then'](function(_0x42c12d){_0x3e67a6[_0xc6e1('0x20')]=_0x42c12d;if(_0x600377[_0xc6e1('0x31')]['includeAll']){_0x5cefb6[_0xc6e1('0x41')]=[{'all':!![]}];}return db[_0xc6e1('0x2d')][_0xc6e1('0x42')](_0x5cefb6);})[_0xc6e1('0x26')](function(_0x33e085){_0x3e67a6[_0xc6e1('0x43')]=_0x33e085;return _0x3e67a6;})[_0xc6e1('0x26')](respondWithFilteredResult(_0xd71377,_0x5cefb6))[_0xc6e1('0x44')](handleError(_0xd71377,null));};exports[_0xc6e1('0x45')]=function(_0x2711bc,_0x1eadd7){var _0x3b7f71={'raw':!![],'where':{'id':_0x2711bc[_0xc6e1('0x46')]['id']}},_0xce5a71={};_0xce5a71[_0xc6e1('0x30')]=_['keys'](db[_0xc6e1('0x2d')][_0xc6e1('0x47')]);_0xce5a71['query']=_[_0xc6e1('0x32')](_0x2711bc[_0xc6e1('0x31')]);_0xce5a71[_0xc6e1('0x33')]=_[_0xc6e1('0x35')](_0xce5a71[_0xc6e1('0x30')],_0xce5a71['query']);_0x3b7f71[_0xc6e1('0x34')]=_[_0xc6e1('0x35')](_0xce5a71['model'],qs[_0xc6e1('0x36')](_0x2711bc[_0xc6e1('0x31')][_0xc6e1('0x36')]));_0x3b7f71[_0xc6e1('0x34')]=_0x3b7f71['attributes'][_0xc6e1('0x37')]?_0x3b7f71[_0xc6e1('0x34')]:_0xce5a71[_0xc6e1('0x30')];if(_0x2711bc[_0xc6e1('0x31')][_0xc6e1('0x48')]){_0x3b7f71['include']=[{'all':!![]}];}_0x3b7f71=_[_0xc6e1('0x3d')]({},_0x3b7f71,_0x2711bc['options']);return db[_0xc6e1('0x2d')][_0xc6e1('0x49')](_0x3b7f71)[_0xc6e1('0x26')](handleEntityNotFound(_0x1eadd7,null))[_0xc6e1('0x26')](respondWithResult(_0x1eadd7,null))[_0xc6e1('0x44')](handleError(_0x1eadd7,null));};exports[_0xc6e1('0x4a')]=function(_0x5e1755,_0x2ec072){return db[_0xc6e1('0x2d')][_0xc6e1('0x4a')](_0x5e1755[_0xc6e1('0x4b')],{})[_0xc6e1('0x26')](respondWithResult(_0x2ec072,0xc9))['catch'](handleError(_0x2ec072,null));};exports[_0xc6e1('0x25')]=function(_0x2cd2f9,_0x4bd706){if(_0x2cd2f9['body']['id']){delete _0x2cd2f9[_0xc6e1('0x4b')]['id'];}return db[_0xc6e1('0x2d')]['find']({'where':{'id':_0x2cd2f9['params']['id']}})[_0xc6e1('0x26')](handleEntityNotFound(_0x4bd706,null))[_0xc6e1('0x26')](saveUpdates(_0x2cd2f9[_0xc6e1('0x4b')],null))[_0xc6e1('0x26')](respondWithResult(_0x4bd706,null))[_0xc6e1('0x44')](handleError(_0x4bd706,null));};exports['destroy']=function(_0x130bc2,_0x19afd0){return db[_0xc6e1('0x2d')][_0xc6e1('0x49')]({'where':{'id':_0x130bc2[_0xc6e1('0x46')]['id']}})[_0xc6e1('0x26')](handleEntityNotFound(_0x19afd0,null))[_0xc6e1('0x26')](removeEntity(_0x19afd0,null))['catch'](handleError(_0x19afd0,null));};exports[_0xc6e1('0x4c')]=function(_0x41c99a,_0x4a87a0){return db[_0xc6e1('0x2d')][_0xc6e1('0x4c')]()[_0xc6e1('0x26')](respondWithResult(_0x4a87a0,null))[_0xc6e1('0x44')](handleError(_0x4a87a0,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 6afcf78..695cc94 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 _0x6933=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','exports','define'];(function(_0x2409d0,_0x127d21){var _0x38eb87=function(_0x48eb31){while(--_0x48eb31){_0x2409d0['push'](_0x2409d0['shift']());}};_0x38eb87(++_0x127d21);}(_0x6933,0x1d1));var _0x3693=function(_0x530a58,_0x141d0a){_0x530a58=_0x530a58-0x0;var _0x46efd4=_0x6933[_0x530a58];return _0x46efd4;};'use strict';var _=require(_0x3693('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3693('0x1'));var moment=require(_0x3693('0x2'));var BPromise=require(_0x3693('0x3'));var rp=require(_0x3693('0x4'));var fs=require('fs');var path=require(_0x3693('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x3693('0x6')]=function(_0x5c17a7,_0x499751){return _0x5c17a7[_0x3693('0x7')](_0x3693('0x8'),attributes,{'tableName':_0x3693('0x9'),'paranoid':![],'indexes':[{'name':_0x3693('0xa'),'fields':[_0x3693('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x40c7=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x1cbecb,_0x505e33){var _0x4112c4=function(_0x1d1d36){while(--_0x1d1d36){_0x1cbecb['push'](_0x1cbecb['shift']());}};_0x4112c4(++_0x505e33);}(_0x40c7,0xb5));var _0x740c=function(_0x3b395a,_0xb9a82d){_0x3b395a=_0x3b395a-0x0;var _0x4aeef2=_0x40c7[_0x3b395a];return _0x4aeef2;};'use strict';var _=require(_0x740c('0x0'));var util=require(_0x740c('0x1'));var logger=require(_0x740c('0x2'))(_0x740c('0x3'));var moment=require(_0x740c('0x4'));var BPromise=require(_0x740c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x740c('0x6'));var rimraf=require(_0x740c('0x7'));var config=require(_0x740c('0x8'));var attributes=require(_0x740c('0x9'));module[_0x740c('0xa')]=function(_0x4355cf,_0x3f911a){return _0x4355cf[_0x740c('0xb')](_0x740c('0xc'),attributes,{'tableName':_0x740c('0xd'),'paranoid':![],'indexes':[{'name':_0x740c('0xe'),'fields':[_0x740c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 383ef83..d642b66 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 _0xe7ba=['http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe7ba,0x1af));var _0xae7b=function(_0xee438c,_0x214e20){_0xee438c=_0xee438c-0x0;var _0x5805d9=_0xe7ba[_0xee438c];return _0x5805d9;};'use strict';var _=require(_0xae7b('0x0'));var util=require(_0xae7b('0x1'));var moment=require(_0xae7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae7b('0x3'));var db=require(_0xae7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xae7b('0x5'))(_0xae7b('0x6'));var config=require('../../config/environment');var jayson=require(_0xae7b('0x7'));var client=jayson[_0xae7b('0x8')][_0xae7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24cd9b,_0x566b7b,_0x5cb851){return new BPromise(function(_0x2bb30f,_0x7a9dad){return client[_0xae7b('0xa')](_0x24cd9b,_0x5cb851)[_0xae7b('0xb')](function(_0x3c3ff0){logger[_0xae7b('0xc')](_0xae7b('0xd'),_0x566b7b,_0xae7b('0xe'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x566b7b,_0xae7b('0xe'),JSON[_0xae7b('0xf')](_0x3c3ff0));if(_0x3c3ff0[_0xae7b('0x10')]){if(_0x3c3ff0[_0xae7b('0x10')][_0xae7b('0x11')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x566b7b,_0x3c3ff0[_0xae7b('0x10')][_0xae7b('0x12')]);return _0x7a9dad(_0x3c3ff0['error']['message']);}logger[_0xae7b('0x10')](_0xae7b('0xd'),_0x566b7b,_0x3c3ff0[_0xae7b('0x10')][_0xae7b('0x12')]);return _0x2bb30f(_0x3c3ff0['error'][_0xae7b('0x12')]);}else{logger[_0xae7b('0xc')](_0xae7b('0xd'),_0x566b7b,_0xae7b('0xe'));_0x2bb30f(_0x3c3ff0[_0xae7b('0x13')][_0xae7b('0x12')]);}})['catch'](function(_0x54b10d){logger[_0xae7b('0x10')](_0xae7b('0xd'),_0x566b7b,_0x54b10d);_0x7a9dad(_0x54b10d);});});} \ No newline at end of file +var _0x628b=['then','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3033de,_0x1efc5){var _0x4f7bd2=function(_0x1a97eb){while(--_0x1a97eb){_0x3033de['push'](_0x3033de['shift']());}};_0x4f7bd2(++_0x1efc5);}(_0x628b,0x84));var _0xb628=function(_0x206862,_0x42155b){_0x206862=_0x206862-0x0;var _0x4cadff=_0x628b[_0x206862];return _0x4cadff;};'use strict';var _=require(_0xb628('0x0'));var util=require('util');var moment=require(_0xb628('0x1'));var BPromise=require(_0xb628('0x2'));var rs=require(_0xb628('0x3'));var fs=require('fs');var Redis=require(_0xb628('0x4'));var db=require(_0xb628('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb628('0x6'))(_0xb628('0x7'));var config=require(_0xb628('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb628('0x9')][_0xb628('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a7bcd,_0x248137,_0x1e368a){return new BPromise(function(_0x4aa2b2,_0x396bc2){return client[_0xb628('0xb')](_0x1a7bcd,_0x1e368a)[_0xb628('0xc')](function(_0x5f0950){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x248137,_0xb628('0xd'));logger[_0xb628('0xe')](_0xb628('0xf'),_0x248137,_0xb628('0xd'),JSON[_0xb628('0x10')](_0x5f0950));if(_0x5f0950[_0xb628('0x11')]){if(_0x5f0950[_0xb628('0x11')][_0xb628('0x12')]===0x1f4){logger['error'](_0xb628('0x13'),_0x248137,_0x5f0950['error'][_0xb628('0x14')]);return _0x396bc2(_0x5f0950[_0xb628('0x11')][_0xb628('0x14')]);}logger[_0xb628('0x11')](_0xb628('0x13'),_0x248137,_0x5f0950['error'][_0xb628('0x14')]);return _0x4aa2b2(_0x5f0950[_0xb628('0x11')][_0xb628('0x14')]);}else{logger[_0xb628('0x15')]('WhatsappTransferReport,\x20%s,\x20%s',_0x248137,_0xb628('0xd'));_0x4aa2b2(_0x5f0950[_0xb628('0x16')][_0xb628('0x14')]);}})[_0xb628('0x17')](function(_0x5de96e){logger[_0xb628('0x11')](_0xb628('0x13'),_0x248137,_0x5de96e);_0x396bc2(_0x5de96e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d204572..a710ce7 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8b1=['Online\x20apps:','map','online','join','Offline\x20apps:','filter','name','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','sequelize','then','info','start'];(function(_0x4b416c,_0x53ef9e){var _0x2037fa=function(_0x5d9816){while(--_0x5d9816){_0x4b416c['push'](_0x4b416c['shift']());}};_0x2037fa(++_0x53ef9e);}(_0xf8b1,0x114));var _0x1f8b=function(_0x241b85,_0x1133a0){_0x241b85=_0x241b85-0x0;var _0x99b1ac=_0xf8b1[_0x241b85];return _0x99b1ac;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x1f8b('0x0'));var config=require(_0x1f8b('0x1'));var logger=require(_0x1f8b('0x2'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0x1f8b('0x3'));var schedule=require('./config/schedule');var chat=require(_0x1f8b('0x4'));var whatsapp=require(_0x1f8b('0x5'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x1f8b('0x6')]['sync']()['then'](function(){return rpc['listen']();})[_0x1f8b('0x7')](function(_0x2180e5){logger[_0x1f8b('0x8')](_0x2180e5);return chat['start']();})[_0x1f8b('0x7')](function(){return whatsapp[_0x1f8b('0x9')]();})[_0x1f8b('0x7')](function(){return schedule[_0x1f8b('0x9')]();})['then'](function(){return transcribe[_0x1f8b('0x9')]();})['then'](function(_0x22d4cd){logger['info'](_0x22d4cd);return pm2[_0x1f8b('0x9')](pm2Config);})[_0x1f8b('0x7')](function(_0xd655ca){logger[_0x1f8b('0x8')](_0x1f8b('0xa'),_[_0x1f8b('0xb')](_['filter'](_0xd655ca,{'status':_0x1f8b('0xc')}),'name')[_0x1f8b('0xd')]());logger[_0x1f8b('0x8')](_0x1f8b('0xe'),_[_0x1f8b('0xb')](_[_0x1f8b('0xf')](_0xd655ca,function(_0x57e56d){return _0x57e56d['status']!==_0x1f8b('0xc');}),_0x1f8b('0x10'))[_0x1f8b('0xd')]()||_0x1f8b('0x11'));config[_0x1f8b('0x12')]&&require(_0x1f8b('0x13'))[_0x1f8b('0x14')]();require(_0x1f8b('0x15'))[_0x1f8b('0x14')]();})[_0x1f8b('0x16')](function(_0x5e9608){logger[_0x1f8b('0x17')](_0x1f8b('0x18'),_0x5e9608);process[_0x1f8b('0x19')](0x1);});}main(); \ No newline at end of file +var _0x9fa3=['./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/whatsapp','sequelize','sync','listen','then','info','start','Online\x20apps:','filter','online','name','Offline\x20apps:','map','status','join','seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc'];(function(_0x130a65,_0x1c7f3e){var _0x269571=function(_0x1ce888){while(--_0x1ce888){_0x130a65['push'](_0x130a65['shift']());}};_0x269571(++_0x1c7f3e);}(_0x9fa3,0x14d));var _0x39fa=function(_0x568764,_0x1a18db){_0x568764=_0x568764-0x0;var _0xb9f116=_0x9fa3[_0x568764];return _0xb9f116;};'use strict';var _=require(_0x39fa('0x0'));var mysqldb=require(_0x39fa('0x1'));var rpc=require(_0x39fa('0x2'));var config=require(_0x39fa('0x3'));var logger=require(_0x39fa('0x4'))(_0x39fa('0x5'));var pm2=require(_0x39fa('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x39fa('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x39fa('0x8'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x39fa('0x9')][_0x39fa('0xa')]()['then'](function(){return rpc[_0x39fa('0xb')]();})[_0x39fa('0xc')](function(_0x32a2e3){logger[_0x39fa('0xd')](_0x32a2e3);return chat[_0x39fa('0xe')]();})['then'](function(){return whatsapp[_0x39fa('0xe')]();})[_0x39fa('0xc')](function(){return schedule['start']();})[_0x39fa('0xc')](function(){return transcribe['start']();})[_0x39fa('0xc')](function(_0x359364){logger[_0x39fa('0xd')](_0x359364);return pm2['start'](pm2Config);})[_0x39fa('0xc')](function(_0xa1047c){logger['info'](_0x39fa('0xf'),_['map'](_[_0x39fa('0x10')](_0xa1047c,{'status':_0x39fa('0x11')}),_0x39fa('0x12'))['join']());logger[_0x39fa('0xd')](_0x39fa('0x13'),_[_0x39fa('0x14')](_[_0x39fa('0x10')](_0xa1047c,function(_0x12af04){return _0x12af04[_0x39fa('0x15')]!==_0x39fa('0x11');}),_0x39fa('0x12'))[_0x39fa('0x16')]()||'None');config[_0x39fa('0x17')]&&require('./config/seedDB')[_0x39fa('0x18')]();require('./config/license')[_0x39fa('0x18')]();})[_0x39fa('0x19')](function(_0x3c72d9){logger['error'](_0x39fa('0x1a'),_0x3c72d9);process[_0x39fa('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 41ef376..3125646 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 _0x703c=['composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','use','user','ChatInteraction','findOne','params','disposition','closed','status','json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','then','authenticate','pass','Bearer','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','query','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','payload','options','verify','hex','floor','now','toString','HS512','../../config/environment','../encryptor','lodash','express-jwt'];(function(_0x426bae,_0x4a8647){var _0x4faa6d=function(_0x371220){while(--_0x371220){_0x426bae['push'](_0x426bae['shift']());}};_0x4faa6d(++_0x4a8647);}(_0x703c,0xee));var _0xc703=function(_0x2f4778,_0x594b55){_0x2f4778=_0x2f4778-0x0;var _0x13033b=_0x703c[_0x2f4778];return _0x13033b;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xc703('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xc703('0x1'));var _=require(_0xc703('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xc703('0x3'));var compose=require(_0xc703('0x4'));var basicAuth=require(_0xc703('0x5'));var crypto=require(_0xc703('0x6'));var BPromise=require(_0xc703('0x7'));var util=require(_0xc703('0x8'));var moment=require(_0xc703('0x9'));var validateJwt=expressJwt({'secret':config[_0xc703('0xa')][_0xc703('0xb')]});var userAttributes=['id','role','fullname','name','internal',_0xc703('0xc'),_0xc703('0xd'),_0xc703('0xe'),'md5secret','voicePause',_0xc703('0xf'),_0xc703('0x10'),_0xc703('0x11'),_0xc703('0x12'),_0xc703('0x13'),_0xc703('0x14'),_0xc703('0x15'),_0xc703('0x16'),_0xc703('0x17'),'crudPermissions',_0xc703('0x18'),_0xc703('0x19'),_0xc703('0x1a'),_0xc703('0x1b'),_0xc703('0x1c'),_0xc703('0x1d'),_0xc703('0x1e'),_0xc703('0x1f'),'phoneBarEnableSettings','phoneBarExpires',_0xc703('0x20'),'phoneBarRemoteControl',_0xc703('0x21'),_0xc703('0x22'),'interface',_0xc703('0x23'),_0xc703('0x24'),_0xc703('0x25'),_0xc703('0x26'),'downloadVoiceRecordings',_0xc703('0x27'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0xc703('0x28')](function(_0x5c0c01,_0x58148b,_0x46cb46){if(_0x5c0c01[_0xc703('0x29')]){_0x46cb46();}else{return db[_0xc703('0x2a')][_0xc703('0x2b')]({'where':{'id':_0x5c0c01[_0xc703('0x2c')]['id']},'attributes':['id','closed',_0xc703('0x2d')],'raw':!![]})['then'](function(_0x21aafe){if(_0x21aafe&&_0x21aafe[_0xc703('0x2e')]){return _0x58148b[_0xc703('0x2f')](_0x21aafe[_0xc703('0x2d')]==='unmanaged'?0x195:0x193)[_0xc703('0x30')]({'message':_0x21aafe[_0xc703('0x2d')]===_0xc703('0x31')?_0xc703('0x32'):_0xc703('0x33')});}else{_0x46cb46();}})[_0xc703('0x34')](function(_0x507326){_0x46cb46(_0x507326);});}});};exports[_0xc703('0x35')]=function isAuthenticated(_0x3500a8){return compose()['use'](function(_0xd6f25,_0x7a1bdb,_0x3ba793){var _0x5f3a5c;if(_0xd6f25[_0xc703('0x36')][_0xc703('0x37')]){if(_[_0xc703('0x38')](_0xd6f25['headers'][_0xc703('0x37')],'Basic')){var _0x4cd785=basicAuth(_0xd6f25);db[_0xc703('0x39')][_0xc703('0x3a')]({'where':{'name':_0x4cd785['name']}})[_0xc703('0x3b')](function(_0x2d0ac4){if(!_0x2d0ac4||!_0x2d0ac4[_0xc703('0x3c')](_0x4cd785[_0xc703('0x3d')])){return _0x7a1bdb['status'](0x191)[_0xc703('0x30')]({'message':'Wrong\x20credentials.'});}_0xd6f25[_0xc703('0x29')]={'id':_0x2d0ac4['id']};_0x3ba793();})['catch'](function(_0x2b0c7a){_0x3ba793(_0x2b0c7a);});}else if(_['startsWith'](_0xd6f25[_0xc703('0x36')][_0xc703('0x37')],_0xc703('0x3e'))){validateJwt(_0xd6f25,_0x7a1bdb,_0x3ba793);}else{if(_0x3500a8){_0x3ba793();}else{return _0x7a1bdb[_0xc703('0x2f')](0x193)[_0xc703('0x30')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xd6f25['query'][_0xc703('0x3f')]){try{var _0x1bb818={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xc703('0x40')]()};verifyJwt(_0xd6f25['query']['apikey'],_0x1bb818)['then'](function(_0x78bd8a){return db['User'][_0xc703('0x3a')]({'where':{'id':_0x78bd8a[_0xc703('0x41')]}})[_0xc703('0x3b')](function(_0x160ce8){_0x5f3a5c=_0x160ce8;return db[_0xc703('0x42')][_0xc703('0x2b')]({'where':{'id':0x1},'attributes':[_0xc703('0x43'),_0xc703('0x44')],'raw':!![]});})[_0xc703('0x3b')](function(_0x3706ed){if(!_0x5f3a5c||!_[_0xc703('0x45')](_0x5f3a5c[_0xc703('0x46')],_0x78bd8a[_0xc703('0x47')])){return _0x7a1bdb[_0xc703('0x2f')](0x191)[_0xc703('0x30')]({'message':_0xc703('0x48')});}if(_0x5f3a5c[_0xc703('0x49')]){return _0x7a1bdb['status'](0x191)['json']({'message':_0xc703('0x4a')});}if(_0x5f3a5c['blocked']){if(_0x3706ed['blockDuration']>0x0){if(moment(_0x5f3a5c[_0xc703('0x4b')])[_0xc703('0x4c')](_0x3706ed[_0xc703('0x44')],'minutes')>moment()){return _0x7a1bdb[_0xc703('0x2f')](0x191)[_0xc703('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x7a1bdb[_0xc703('0x2f')](0x191)[_0xc703('0x30')]({'message':_0xc703('0x4a')});}}_0xd6f25['user']={'id':_0x5f3a5c['id']};_0x3ba793();});})[_0xc703('0x34')](function(){return _0x7a1bdb['status'](0x191)['json']({'message':_0xc703('0x4a')});});}catch(_0x3d1655){_0x3ba793(_0x3d1655);}}else if(_0x3500a8){_0x3ba793();}else{return _0x7a1bdb['status'](0x193)[_0xc703('0x30')]({'message':_0xc703('0x4d')});}})['use'](function(_0x9450af,_0x231959,_0x3a25f5){if(_0x9450af['user']){db[_0xc703('0x39')][_0xc703('0x3a')]({'where':{'id':_0x9450af[_0xc703('0x29')]['id']},'attributes':userAttributes})['then'](function(_0x421158){if(!_0x421158){return _0x231959[_0xc703('0x2f')](0x194)['json']({'message':_0xc703('0x4e')});}_0x9450af[_0xc703('0x29')]=_0x421158;_0x3a25f5();})[_0xc703('0x34')](function(_0x28c658){_0x3a25f5(_0x28c658);});}else if(_0x3500a8){_0x3a25f5();}else{return _0x231959[_0xc703('0x2f')](0x194)[_0xc703('0x30')]({'message':_0xc703('0x4f')});}});};exports[_0xc703('0x50')]=function canUpdate(){return compose()[_0xc703('0x28')](function(_0x3b1191,_0x2b7387,_0x5e8755){return licenseUtil['getLicense']()[_0xc703('0x3b')](function(_0x530c29){if(_0x530c29['update']){_0x5e8755();}else{return _0x2b7387[_0xc703('0x2f')](0x193)[_0xc703('0x30')]({'message':'Forbidden'});}})['catch'](function(_0x4d8381){_0x5e8755(_0x4d8381);});});};exports[_0xc703('0x51')]=function(_0x34e38b,_0x512c18,_0x51ae2d){_0x34e38b[_0xc703('0x51')]=!![];return _0x51ae2d();};exports[_0xc703('0x52')]=function signToken(_0x5002b5){return signJwt(_0x5002b5);};exports[_0xc703('0x53')]=function(_0x3d4dce,_0x3e4c83){if(!_0x3d4dce[_0xc703('0x29')]){return _0x3e4c83['status'](0x194)[_0xc703('0x30')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x298914={'payload':{'id':_0x3d4dce[_0xc703('0x29')]['id'],'role':_0x3d4dce[_0xc703('0x29')][_0xc703('0x54')]},'options':{'expiresIn':0x15180}};return signJwt(_0x298914)['then'](function(_0x1e8818){_0x3e4c83[_0xc703('0x55')](_0xc703('0x56'),_0x1e8818);_0x3e4c83['redirect'](_0xc703('0x57'));})['catch'](function(_0x20d170){return _0x3e4c83[_0xc703('0x2f')](0x1f4)[_0xc703('0x58')](_0x20d170);});};exports[_0xc703('0x59')]=function(_0x27a4da){if(_['isNil'](_0x27a4da[_0xc703('0x46')])||_[_0xc703('0x5a')](_0x27a4da['apiKeyIat'])){return null;}else{return createJwt(_0x27a4da);}};exports[_0xc703('0x5b')]=function(_0x246d0){_0x246d0[_0xc703('0x46')]=generateNonce();_0x246d0[_0xc703('0x5c')]=generateIssuedAt();return createJwt(_0x246d0);};exports['regenerateApiKey']=function(_0x34c952,_0x98198d){var _0x236362=_0x34c952[_0xc703('0x5d')]['apikey'];if(_0x236362){var _0x3e485c={'nonce':_0x98198d[_0xc703('0x46')],'iat':_0x98198d[_0xc703('0x5c')],'audience':hardwareConf[_0xc703('0x40')](),'issuer':hardwareConf[_0xc703('0x40')]()};return verifyJwt(_0x236362,_0x3e485c)[_0xc703('0x3b')](function(){return generateApiKey(_0x98198d);});}else{throw{'message':_0xc703('0x5e')};}};exports['validatePasswordPattern']=function(_0x17d4a9){var _0x4a6db7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4a6db7['test'](_0x17d4a9))throw new db[(_0xc703('0x5f'))][(_0xc703('0x60'))](_0xc703('0x61'));return;};exports[_0xc703('0x62')]=function(_0x43f1d0,_0x106112,_0x30debe){var _0x16d49d=encryptor[_0xc703('0x63')](_0x106112)[_0xc703('0x64')](',');for(var _0xd87670=0x0;_0xd87670<_0x30debe;_0xd87670++){if(!_0x16d49d[_0xd87670])break;if(_0x43f1d0['toLowerCase']()===_0x16d49d[_0xd87670][_0xc703('0x65')]()){var _0x1229ad=util[_0xc703('0x66')](_0xc703('0x67'),_0x30debe);if(_0x30debe===0x1){_0x1229ad=_0xc703('0x68');}throw new db[(_0xc703('0x5f'))][(_0xc703('0x60'))](_0x1229ad);}}return;};exports[_0xc703('0x69')]=function(_0x3b5f66,_0x6d5196){var _0x798e6a=_0x6d5196?encryptor['decryptString'](_0x6d5196)['split'](','):[];if(_0x798e6a[_0xc703('0x6a')]===0x5){_0x798e6a[_0xc703('0x6b')](-0x1,0x1);}_0x798e6a[_0xc703('0x6c')](_0x3b5f66);return encryptor[_0xc703('0x6d')](_0x798e6a[_0xc703('0x6e')](','));};function signJwt(_0x1de9f1){var _0x164dcc=BPromise[_0xc703('0x6f')](jwt['sign'],{'context':jwt});var _0x309ff1=_0x1de9f1[_0xc703('0x70')]||config[_0xc703('0xa')][_0xc703('0xb')];return new BPromise(function(_0x626b37,_0x91d0b7){_0x164dcc(_0x1de9f1[_0xc703('0x71')],_0x309ff1,_0x1de9f1[_0xc703('0x72')])[_0xc703('0x3b')](function(_0x3ec2c2){_0x626b37(_0x3ec2c2);})[_0xc703('0x34')](function(_0x56da10){_0x91d0b7(_0x56da10);});});}function verifyJwt(_0x58fc86,_0x92120c,_0x95608d){var _0x443b46=BPromise[_0xc703('0x6f')](jwt[_0xc703('0x73')],{'context':jwt});var _0x6a9635=_0x95608d||config[_0xc703('0xa')]['session'];return new BPromise(function(_0x14d293,_0x4eb480){_0x443b46(_0x58fc86,_0x6a9635,_0x92120c)['then'](function(_0x3e4a2a){_0x14d293(_0x3e4a2a);})[_0xc703('0x34')](function(_0x1f1814){_0x4eb480(_0x1f1814);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0xc703('0x74'));}function generateIssuedAt(){return Math[_0xc703('0x75')](Date[_0xc703('0x76')]()/0x3e8)[_0xc703('0x77')]();}function createJwt(_0x35efa7){var _0x2096d5={'payload':{'iat':_0x35efa7['apiKeyIat'],'nonce':_0x35efa7['apiKeyNonce']},'options':{'algorithm':_0xc703('0x78'),'subject':_0x35efa7['id'][_0xc703('0x77')](),'issuer':hardwareConf[_0xc703('0x40')](),'audience':hardwareConf[_0xc703('0x40')]()}};return signJwt(_0x2096d5)[_0xc703('0x3b')](function(_0x415c68){return{'iat':_0x35efa7[_0xc703('0x5c')],'nonce':_0x35efa7['apiKeyNonce'],'token':_0x415c68};});} \ No newline at end of file +var _0xa23c=['../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','util','secrets','session','role','name','internal','email','permissions','md5secret','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','Basic','find','authenticate','startsWith','Unknown\x20authorization\x20format','query','getUuid','apikey','then','User','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','add','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','updatePasswordsHistory','length','splice','unshift','encryptString','sign','secret','payload','options','promisify','randomBytes','toString','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware'];(function(_0x58a4b0,_0x3809d6){var _0x2cb0c7=function(_0x3675a6){while(--_0x3675a6){_0x58a4b0['push'](_0x58a4b0['shift']());}};_0x2cb0c7(++_0x3809d6);}(_0xa23c,0x153));var _0xca23=function(_0x398f53,_0x380328){_0x398f53=_0x398f53-0x0;var _0x1577e=_0xa23c[_0x398f53];return _0x1577e;};'use strict';var db=require(_0xca23('0x0'))['db'];var config=require(_0xca23('0x1'));var hardwareConf=require(_0xca23('0x2'));var licenseUtil=require(_0xca23('0x3'));var encryptor=require(_0xca23('0x4'));var _=require(_0xca23('0x5'));var jwt=require(_0xca23('0x6'));var expressJwt=require(_0xca23('0x7'));var compose=require(_0xca23('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0xca23('0x9'));var BPromise=require('bluebird');var util=require(_0xca23('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xca23('0xb')][_0xca23('0xc')]});var userAttributes=['id',_0xca23('0xd'),'fullname',_0xca23('0xe'),_0xca23('0xf'),_0xca23('0x10'),'userpic',_0xca23('0x11'),_0xca23('0x12'),'voicePause',_0xca23('0x13'),'mailPause',_0xca23('0x14'),_0xca23('0x15'),_0xca23('0x16'),_0xca23('0x17'),'showWebBar','lastLoginAt',_0xca23('0x18'),_0xca23('0x19'),'allowmessenger',_0xca23('0x1a'),_0xca23('0x1b'),_0xca23('0x1c'),_0xca23('0x1d'),_0xca23('0x1e'),_0xca23('0x1f'),'phoneBarEnableDtmfTone','phoneBarEnableSettings',_0xca23('0x20'),_0xca23('0x21'),_0xca23('0x22'),'phoneBarRemoteControlPort',_0xca23('0x23'),_0xca23('0x24'),'userProfileId',_0xca23('0x25'),_0xca23('0x26'),'wssPort',_0xca23('0x27'),_0xca23('0x28'),'downloadAttachments'];exports[_0xca23('0x29')]=function(){return this[_0xca23('0x2a')](!![])[_0xca23('0x2b')](function(_0x7e99cf,_0x5bfe67,_0x5dcc30){if(_0x7e99cf[_0xca23('0x2c')]){_0x5dcc30();}else{return db[_0xca23('0x2d')][_0xca23('0x2e')]({'where':{'id':_0x7e99cf['params']['id']},'attributes':['id',_0xca23('0x2f'),'disposition'],'raw':!![]})['then'](function(_0x29feba){if(_0x29feba&&_0x29feba[_0xca23('0x2f')]){return _0x5bfe67[_0xca23('0x30')](_0x29feba[_0xca23('0x31')]===_0xca23('0x32')?0x195:0x193)[_0xca23('0x33')]({'message':_0x29feba[_0xca23('0x31')]===_0xca23('0x32')?_0xca23('0x34'):_0xca23('0x35')});}else{_0x5dcc30();}})[_0xca23('0x36')](function(_0x31b8f2){_0x5dcc30(_0x31b8f2);});}});};exports[_0xca23('0x2a')]=function isAuthenticated(_0x5ce913){return compose()['use'](function(_0x462109,_0x42b9f8,_0x42cb2a){var _0x1c2d96;if(_0x462109[_0xca23('0x37')]['authorization']){if(_['startsWith'](_0x462109[_0xca23('0x37')]['authorization'],_0xca23('0x38'))){var _0x5a66f7=basicAuth(_0x462109);db['User'][_0xca23('0x39')]({'where':{'name':_0x5a66f7['name']}})['then'](function(_0x1f9120){if(!_0x1f9120||!_0x1f9120[_0xca23('0x3a')](_0x5a66f7['pass'])){return _0x42b9f8[_0xca23('0x30')](0x191)[_0xca23('0x33')]({'message':'Wrong\x20credentials.'});}_0x462109[_0xca23('0x2c')]={'id':_0x1f9120['id']};_0x42cb2a();})[_0xca23('0x36')](function(_0x20c1d9){_0x42cb2a(_0x20c1d9);});}else if(_[_0xca23('0x3b')](_0x462109[_0xca23('0x37')]['authorization'],'Bearer')){validateJwt(_0x462109,_0x42b9f8,_0x42cb2a);}else{if(_0x5ce913){_0x42cb2a();}else{return _0x42b9f8[_0xca23('0x30')](0x193)['json']({'message':_0xca23('0x3c')});}}}else if(_0x462109[_0xca23('0x3d')]['apikey']){try{var _0x49d2df={'audience':hardwareConf[_0xca23('0x3e')](),'issuer':hardwareConf[_0xca23('0x3e')]()};verifyJwt(_0x462109[_0xca23('0x3d')][_0xca23('0x3f')],_0x49d2df)[_0xca23('0x40')](function(_0x428cbc){return db[_0xca23('0x41')][_0xca23('0x39')]({'where':{'id':_0x428cbc['sub']}})[_0xca23('0x40')](function(_0x258fef){_0x1c2d96=_0x258fef;return db[_0xca23('0x42')][_0xca23('0x2e')]({'where':{'id':0x1},'attributes':[_0xca23('0x43'),_0xca23('0x44')],'raw':!![]});})[_0xca23('0x40')](function(_0xfdada5){if(!_0x1c2d96||!_['isEqual'](_0x1c2d96[_0xca23('0x45')],_0x428cbc[_0xca23('0x46')])){return _0x42b9f8['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x1c2d96[_0xca23('0x47')]){return _0x42b9f8[_0xca23('0x30')](0x191)[_0xca23('0x33')]({'message':_0xca23('0x48')});}if(_0x1c2d96[_0xca23('0x49')]){if(_0xfdada5[_0xca23('0x44')]>0x0){if(moment(_0x1c2d96['blockedAt'])[_0xca23('0x4a')](_0xfdada5['blockDuration'],'minutes')>moment()){return _0x42b9f8[_0xca23('0x30')](0x191)[_0xca23('0x33')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x42b9f8[_0xca23('0x30')](0x191)[_0xca23('0x33')]({'message':_0xca23('0x48')});}}_0x462109[_0xca23('0x2c')]={'id':_0x1c2d96['id']};_0x42cb2a();});})['catch'](function(){return _0x42b9f8[_0xca23('0x30')](0x191)[_0xca23('0x33')]({'message':_0xca23('0x48')});});}catch(_0x3c648d){_0x42cb2a(_0x3c648d);}}else if(_0x5ce913){_0x42cb2a();}else{return _0x42b9f8[_0xca23('0x30')](0x193)[_0xca23('0x33')]({'message':_0xca23('0x3c')});}})[_0xca23('0x2b')](function(_0x3fc8a7,_0x5acece,_0xbd7045){if(_0x3fc8a7[_0xca23('0x2c')]){db[_0xca23('0x41')][_0xca23('0x39')]({'where':{'id':_0x3fc8a7[_0xca23('0x2c')]['id']},'attributes':userAttributes})[_0xca23('0x40')](function(_0x42f82f){if(!_0x42f82f){return _0x5acece[_0xca23('0x30')](0x194)['json']({'message':_0xca23('0x4b')});}_0x3fc8a7[_0xca23('0x2c')]=_0x42f82f;_0xbd7045();})[_0xca23('0x36')](function(_0x236f58){_0xbd7045(_0x236f58);});}else if(_0x5ce913){_0xbd7045();}else{return _0x5acece[_0xca23('0x30')](0x194)['json']({'message':_0xca23('0x4c')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xca23('0x2b')](function(_0x1c411a,_0x6177ec,_0x722f38){return licenseUtil[_0xca23('0x4d')]()['then'](function(_0x471119){if(_0x471119[_0xca23('0x4e')]){_0x722f38();}else{return _0x6177ec['status'](0x193)[_0xca23('0x33')]({'message':_0xca23('0x4f')});}})[_0xca23('0x36')](function(_0x342b85){_0x722f38(_0x342b85);});});};exports[_0xca23('0x50')]=function(_0x6b417a,_0x1d8311,_0x4d7756){_0x6b417a[_0xca23('0x50')]=!![];return _0x4d7756();};exports[_0xca23('0x51')]=function signToken(_0x5c1765){return signJwt(_0x5c1765);};exports[_0xca23('0x52')]=function(_0x591d1b,_0x3d7b4d){if(!_0x591d1b[_0xca23('0x2c')]){return _0x3d7b4d[_0xca23('0x30')](0x194)[_0xca23('0x33')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x484522={'payload':{'id':_0x591d1b[_0xca23('0x2c')]['id'],'role':_0x591d1b[_0xca23('0x2c')][_0xca23('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x484522)['then'](function(_0x2c5bfc){_0x3d7b4d[_0xca23('0x53')](_0xca23('0x54'),_0x2c5bfc);_0x3d7b4d[_0xca23('0x55')](_0xca23('0x56'));})[_0xca23('0x36')](function(_0x53ba0d){return _0x3d7b4d[_0xca23('0x30')](0x1f4)[_0xca23('0x57')](_0x53ba0d);});};exports['retrieveApiKey']=function(_0x29ce3a){if(_['isNil'](_0x29ce3a[_0xca23('0x45')])||_['isNil'](_0x29ce3a[_0xca23('0x58')])){return null;}else{return createJwt(_0x29ce3a);}};exports[_0xca23('0x59')]=function(_0x2d7d20){_0x2d7d20[_0xca23('0x45')]=generateNonce();_0x2d7d20['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d7d20);};exports[_0xca23('0x5a')]=function(_0x81f8f7,_0x4e06a5){var _0x3ea742=_0x81f8f7[_0xca23('0x3d')][_0xca23('0x3f')];if(_0x3ea742){var _0x2ffd7d={'nonce':_0x4e06a5[_0xca23('0x45')],'iat':_0x4e06a5[_0xca23('0x58')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xca23('0x3e')]()};return verifyJwt(_0x3ea742,_0x2ffd7d)['then'](function(){return generateApiKey(_0x4e06a5);});}else{throw{'message':_0xca23('0x5b')};}};exports['validatePasswordPattern']=function(_0x74dc53){var _0x538fa4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x538fa4[_0xca23('0x5c')](_0x74dc53))throw new db[(_0xca23('0x5d'))][(_0xca23('0x5e'))]('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[_0xca23('0x5f')]=function(_0x125bc6,_0x3255c2,_0x2ff56f){var _0xbaaa96=encryptor[_0xca23('0x60')](_0x3255c2)[_0xca23('0x61')](',');for(var _0x41cfa3=0x0;_0x41cfa3<_0x2ff56f;_0x41cfa3++){if(!_0xbaaa96[_0x41cfa3])break;if(_0x125bc6[_0xca23('0x62')]()===_0xbaaa96[_0x41cfa3][_0xca23('0x62')]()){var _0x2d60ec=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x2ff56f);if(_0x2ff56f===0x1){_0x2d60ec='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xca23('0x5d'))]['ValidationError'](_0x2d60ec);}}return;};exports[_0xca23('0x63')]=function(_0x11f175,_0x2e3bbb){var _0x558150=_0x2e3bbb?encryptor['decryptString'](_0x2e3bbb)[_0xca23('0x61')](','):[];if(_0x558150[_0xca23('0x64')]===0x5){_0x558150[_0xca23('0x65')](-0x1,0x1);}_0x558150[_0xca23('0x66')](_0x11f175);return encryptor[_0xca23('0x67')](_0x558150['join'](','));};function signJwt(_0x28190e){var _0x445238=BPromise['promisify'](jwt[_0xca23('0x68')],{'context':jwt});var _0x112a18=_0x28190e[_0xca23('0x69')]||config[_0xca23('0xb')]['session'];return new BPromise(function(_0x54a272,_0x7279a0){_0x445238(_0x28190e[_0xca23('0x6a')],_0x112a18,_0x28190e[_0xca23('0x6b')])[_0xca23('0x40')](function(_0x4b633d){_0x54a272(_0x4b633d);})[_0xca23('0x36')](function(_0x31000c){_0x7279a0(_0x31000c);});});}function verifyJwt(_0x3965fc,_0x4346a8,_0x282fd1){var _0x24fb8=BPromise[_0xca23('0x6c')](jwt['verify'],{'context':jwt});var _0x297a1c=_0x282fd1||config[_0xca23('0xb')]['session'];return new BPromise(function(_0x5132b5,_0x55c7e2){_0x24fb8(_0x3965fc,_0x297a1c,_0x4346a8)['then'](function(_0x3170c8){_0x5132b5(_0x3170c8);})[_0xca23('0x36')](function(_0x4b24bf){_0x55c7e2(_0x4b24bf);});});}function generateNonce(){return crypto[_0xca23('0x6d')](0x10)[_0xca23('0x6e')]('hex');}function generateIssuedAt(){return Math[_0xca23('0x6f')](Date[_0xca23('0x70')]()/0x3e8)[_0xca23('0x6e')]();}function createJwt(_0xc0002d){var _0x4ff331={'payload':{'iat':_0xc0002d[_0xca23('0x58')],'nonce':_0xc0002d[_0xca23('0x45')]},'options':{'algorithm':_0xca23('0x71'),'subject':_0xc0002d['id'][_0xca23('0x6e')](),'issuer':hardwareConf[_0xca23('0x3e')](),'audience':hardwareConf[_0xca23('0x3e')]()}};return signJwt(_0x4ff331)[_0xca23('0x40')](function(_0x4d7145){return{'iat':_0xc0002d['apiKeyIat'],'nonce':_0xc0002d[_0xca23('0x45')],'token':_0x4d7145};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 0288349..9be7da1 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 _0x4f91=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','end','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/logger','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x2b7675,_0x5969c9){var _0x4c4f97=function(_0x233188){while(--_0x233188){_0x2b7675['push'](_0x2b7675['shift']());}};_0x4c4f97(++_0x5969c9);}(_0x4f91,0x18f));var _0x14f9=function(_0x2df2cf,_0x1271c4){_0x2df2cf=_0x2df2cf-0x0;var _0x22d694=_0x4f91[_0x2df2cf];return _0x22d694;};'use strict';var crypto=require(_0x14f9('0x0'));var fs=require('fs');var BPromise=require(_0x14f9('0x1'));var _=require(_0x14f9('0x2'));var config=require('../../config/environment');var logger=require(_0x14f9('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x14f9('0x4')};const fileOptions={'algorithm':_0x14f9('0x5')};if(config['encrypt']&&config[_0x14f9('0x6')][_0x14f9('0x7')]){var isSupported=isAlgorithmSupported(config[_0x14f9('0x6')][_0x14f9('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0x14f9('0x6')][_0x14f9('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x14f9('0x8')](',\x20');logger[_0x14f9('0x9')](config[_0x14f9('0x6')][_0x14f9('0x7')],_0x14f9('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1b8beb){return AES_SUPPORTED_RX[_0x14f9('0xb')](_0x1b8beb);}function getSupportedCiphers(){return crypto[_0x14f9('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x56900d){return getSupportedCiphers()[_0x14f9('0xd')](_0x56900d)>-0x1;}function combineOptions(_0x2e25f2){var _0x348ee6={};for(var _0x250c05 in fileOptions){if(fileOptions[_0x14f9('0xe')](_0x250c05)){_0x348ee6[_0x250c05]=fileOptions[_0x250c05];}}if(_0x2e25f2){for(var _0x376e87 in _0x2e25f2){if(_0x2e25f2['hasOwnProperty'](_0x376e87)){_0x348ee6[_0x376e87]=_0x2e25f2[_0x376e87];}}}return _0x348ee6;}exports[_0x14f9('0xf')]=function(_0x47ef2e,_0x303208,_0x5cfd28,_0x3466c8){return new BPromise(function(_0x31cb68,_0x2e8eaf){_0x3466c8=combineOptions(_0x3466c8);var _0x2988ed=new Buffer(_0x5cfd28);var _0x458859=fs[_0x14f9('0x10')](_0x47ef2e);var _0x4684aa=fs[_0x14f9('0x11')](_0x303208);var _0x323b46=crypto[_0x14f9('0x12')](_0x3466c8[_0x14f9('0x7')],_0x2988ed);_0x458859['on'](_0x14f9('0x13'),function(_0x5bfe7e){var _0x4160e5=new Buffer(_0x323b46[_0x14f9('0x14')](_0x5bfe7e),_0x14f9('0x15'));_0x4684aa[_0x14f9('0x16')](_0x4160e5);});_0x458859['on']('end',function(){try{var _0x145a17=new Buffer(_0x323b46[_0x14f9('0x17')](_0x14f9('0x15')),_0x14f9('0x15'));_0x4684aa[_0x14f9('0x16')](_0x145a17);_0x4684aa[_0x14f9('0x18')]();_0x4684aa['on'](_0x14f9('0x19'),function(){return _0x31cb68(_0x303208);});}catch(_0xa5a6c0){fs[_0x14f9('0x1a')](_0x303208);return _0x2e8eaf(_0xa5a6c0);}});});};exports[_0x14f9('0x1b')]=function(_0x13d21d,_0xdf8163,_0x198807,_0x237475){return new BPromise(function(_0x3b9299,_0x1cd16e){_0x237475=combineOptions(_0x237475);var _0x49d3b3=new Buffer(_0x198807);var _0x42365b=fs[_0x14f9('0x10')](_0x13d21d);var _0x255ed7=fs[_0x14f9('0x11')](_0xdf8163);var _0x294de7=crypto[_0x14f9('0x1c')](_0x237475[_0x14f9('0x7')],_0x49d3b3);_0x42365b['on'](_0x14f9('0x13'),function(_0x4597aa){var _0x189765=new Buffer(_0x294de7[_0x14f9('0x14')](_0x4597aa),_0x14f9('0x15'));_0x255ed7['write'](_0x189765);});_0x42365b['on'](_0x14f9('0x18'),function(){try{var _0x4a1147=new Buffer(_0x294de7[_0x14f9('0x17')](_0x14f9('0x15')),_0x14f9('0x15'));_0x255ed7[_0x14f9('0x16')](_0x4a1147);_0x255ed7[_0x14f9('0x18')]();_0x255ed7['on']('close',function(){return _0x3b9299(_0xdf8163);});}catch(_0x22b57e){fs['unlink'](_0xdf8163);return _0x1cd16e(_0x22b57e);}});});};exports[_0x14f9('0x1d')]=function(_0x2bd78e,_0x11b329,_0x19e256){var _0x2c5b69=_0x19e256||stringOptions[_0x14f9('0x7')];var _0x3f99f0=_0x11b329||stringOptions[_0x14f9('0x1e')];var _0x39687c=crypto[_0x14f9('0x12')](_0x2c5b69,_0x3f99f0);var _0x4efc7d=_0x39687c['update'](_0x2bd78e,_0x14f9('0x1f'),_0x14f9('0x20'));_0x4efc7d+=_0x39687c[_0x14f9('0x17')](_0x14f9('0x20'));return _0x4efc7d;};exports[_0x14f9('0x21')]=function(_0x22a148,_0x5e7c6c,_0x5c8fd1){var _0x3ad4d6=_0x5c8fd1||stringOptions[_0x14f9('0x7')];var _0x2fe81f=_0x5e7c6c||stringOptions['secret'];var _0x25dd01=crypto['createDecipher'](_0x3ad4d6,_0x2fe81f);var _0x5e1ba3=_0x25dd01[_0x14f9('0x14')](_0x22a148,_0x14f9('0x20'),'utf8');_0x5e1ba3+=_0x25dd01[_0x14f9('0x17')](_0x14f9('0x1f'));return _0x5e1ba3;}; \ No newline at end of file +var _0x3b45=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','write','end','binary','close','unlink','decryptFile','createDecipher','data','final','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x217fca,_0x4ff456){var _0x374f0f=function(_0x5ca171){while(--_0x5ca171){_0x217fca['push'](_0x217fca['shift']());}};_0x374f0f(++_0x4ff456);}(_0x3b45,0x1a5));var _0x53b4=function(_0x4d66a3,_0x414c07){_0x4d66a3=_0x4d66a3-0x0;var _0x36b01e=_0x3b45[_0x4d66a3];return _0x36b01e;};'use strict';var crypto=require(_0x53b4('0x0'));var fs=require('fs');var BPromise=require(_0x53b4('0x1'));var _=require('lodash');var config=require(_0x53b4('0x2'));var logger=require(_0x53b4('0x3'))(_0x53b4('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x53b4('0x5')]['session'],'algorithm':_0x53b4('0x6')};const fileOptions={'algorithm':_0x53b4('0x7')};if(config[_0x53b4('0x8')]&&config[_0x53b4('0x8')][_0x53b4('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x53b4('0x9')]);if(isSupported){fileOptions[_0x53b4('0x9')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x53b4('0xa')](',\x20');logger[_0x53b4('0xb')](config['encrypt'][_0x53b4('0x9')],_0x53b4('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x177017){return AES_SUPPORTED_RX[_0x53b4('0xd')](_0x177017);}function getSupportedCiphers(){return crypto[_0x53b4('0xe')]()[_0x53b4('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x5c4a27){return getSupportedCiphers()[_0x53b4('0x10')](_0x5c4a27)>-0x1;}function combineOptions(_0x2c7a18){var _0x1926b2={};for(var _0x359266 in fileOptions){if(fileOptions[_0x53b4('0x11')](_0x359266)){_0x1926b2[_0x359266]=fileOptions[_0x359266];}}if(_0x2c7a18){for(var _0x1bd029 in _0x2c7a18){if(_0x2c7a18[_0x53b4('0x11')](_0x1bd029)){_0x1926b2[_0x1bd029]=_0x2c7a18[_0x1bd029];}}}return _0x1926b2;}exports['encryptFile']=function(_0x170471,_0x344040,_0x2ca4a0,_0x3cce20){return new BPromise(function(_0x3a1fb1,_0x1b9d86){_0x3cce20=combineOptions(_0x3cce20);var _0x2f5b80=new Buffer(_0x2ca4a0);var _0x5f1fd7=fs[_0x53b4('0x12')](_0x170471);var _0x56abc6=fs[_0x53b4('0x13')](_0x344040);var _0x17eb28=crypto[_0x53b4('0x14')](_0x3cce20[_0x53b4('0x9')],_0x2f5b80);_0x5f1fd7['on']('data',function(_0x464611){var _0x771f2e=new Buffer(_0x17eb28[_0x53b4('0x15')](_0x464611),'binary');_0x56abc6[_0x53b4('0x16')](_0x771f2e);});_0x5f1fd7['on'](_0x53b4('0x17'),function(){try{var _0x257e6e=new Buffer(_0x17eb28['final'](_0x53b4('0x18')),_0x53b4('0x18'));_0x56abc6['write'](_0x257e6e);_0x56abc6[_0x53b4('0x17')]();_0x56abc6['on'](_0x53b4('0x19'),function(){return _0x3a1fb1(_0x344040);});}catch(_0x2ab170){fs[_0x53b4('0x1a')](_0x344040);return _0x1b9d86(_0x2ab170);}});});};exports[_0x53b4('0x1b')]=function(_0x20d1f1,_0x4e1bde,_0x1a4457,_0x4ae290){return new BPromise(function(_0x3784cc,_0x163050){_0x4ae290=combineOptions(_0x4ae290);var _0x1cd6ca=new Buffer(_0x1a4457);var _0x5cc203=fs[_0x53b4('0x12')](_0x20d1f1);var _0x57e606=fs['createWriteStream'](_0x4e1bde);var _0x372366=crypto[_0x53b4('0x1c')](_0x4ae290[_0x53b4('0x9')],_0x1cd6ca);_0x5cc203['on'](_0x53b4('0x1d'),function(_0x298cfa){var _0x52bb23=new Buffer(_0x372366['update'](_0x298cfa),'binary');_0x57e606[_0x53b4('0x16')](_0x52bb23);});_0x5cc203['on'](_0x53b4('0x17'),function(){try{var _0x46fefe=new Buffer(_0x372366[_0x53b4('0x1e')](_0x53b4('0x18')),'binary');_0x57e606[_0x53b4('0x16')](_0x46fefe);_0x57e606[_0x53b4('0x17')]();_0x57e606['on'](_0x53b4('0x19'),function(){return _0x3784cc(_0x4e1bde);});}catch(_0x2f0d10){fs[_0x53b4('0x1a')](_0x4e1bde);return _0x163050(_0x2f0d10);}});});};exports[_0x53b4('0x1f')]=function(_0x6fe9ba,_0x29a8e7,_0x52429e){var _0xbe982b=_0x52429e||stringOptions[_0x53b4('0x9')];var _0x5f4bb5=_0x29a8e7||stringOptions[_0x53b4('0x20')];var _0x3752ba=crypto['createCipher'](_0xbe982b,_0x5f4bb5);var _0xf9c045=_0x3752ba[_0x53b4('0x15')](_0x6fe9ba,_0x53b4('0x21'),_0x53b4('0x22'));_0xf9c045+=_0x3752ba[_0x53b4('0x1e')](_0x53b4('0x22'));return _0xf9c045;};exports[_0x53b4('0x23')]=function(_0x499307,_0x108b7b,_0x1b4a0c){var _0x4ac1a7=_0x1b4a0c||stringOptions['algorithm'];var _0x63e179=_0x108b7b||stringOptions[_0x53b4('0x20')];var _0x3515e4=crypto['createDecipher'](_0x4ac1a7,_0x63e179);var _0x317dea=_0x3515e4[_0x53b4('0x15')](_0x499307,_0x53b4('0x22'),_0x53b4('0x21'));_0x317dea+=_0x3515e4[_0x53b4('0x1e')](_0x53b4('0x21'));return _0x317dea;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 0464cec..69a48f6 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 _0x0ab4=['split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','existsSync','join','mkdirSync','each','%s%d.%s','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','util','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x0ab4,0xaa));var _0x40ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ab4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x40ab('0x0'));var path=require(_0x40ab('0x1'));var _=require(_0x40ab('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x40ab('0x3'));var rimraf=require(_0x40ab('0x4'));var db=require(_0x40ab('0x5'))['db'];var dbH=require('../../mysqldb')[_0x40ab('0x6')];var logger=require(_0x40ab('0x7'))(_0x40ab('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x40ab('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x40ab('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x18d4f9,_0x342842){var _0x3e8c12={'status':_0x18d4f9};var _0x2dbf54={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x342842){_0x3e8c12[_0x40ab('0xa')]=_0x342842;}return db[_0x40ab('0xb')][_0x40ab('0xc')](_0x3e8c12,_0x2dbf54);}function main(){var _0xa5cfb4=0x1388;var _0x53762a;logger[_0x40ab('0xd')](util['format'](_0x40ab('0xe'),EXTRACTED_REPORT_ID,_0x40ab('0xf')));return db[_0x40ab('0x10')][_0x40ab('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x40ab('0x12'),_0x40ab('0x13')]})[_0x40ab('0x14')](function(_0x519fb0){if(_0x519fb0){_0x53762a=_0x519fb0;_0xa5cfb4=_0x53762a[_0x40ab('0x13')]||0x1388;}})[_0x40ab('0x14')](function(){return dbH[_0x40ab('0x15')][_0x40ab('0x16')](util['format'](_0x40ab('0x17'),QUERY),{'type':dbH[_0x40ab('0x15')]['QueryTypes'][_0x40ab('0x18')]});})[_0x40ab('0x14')](function(_0x38f3a4){if(!_0x38f3a4[0x0][_0x40ab('0x19')]){return analyticExtractedReport('Empty');}var _0x6fbc24=[];var _0xe231f8=0x0;if(_0x53762a[_0x40ab('0x12')]){if(_0x38f3a4&&_0x38f3a4[_0x40ab('0x1a')]){var _0x312539=_['range'](_0x38f3a4[0x0]['num']/_0xa5cfb4);var _0x4906a1=Number['isInteger'](_0x38f3a4[0x0][_0x40ab('0x19')]/_0xa5cfb4)?_0x38f3a4[0x0][_0x40ab('0x19')]%_0xa5cfb4:0x0;_0x312539['forEach'](function(_0x5ff2aa){if(_0x5ff2aa>0x0){_0xe231f8+=_0xa5cfb4;}_0x6fbc24[_0x40ab('0x1b')](dbH['sequelize'][_0x40ab('0x16')](util[_0x40ab('0x1c')](_0x40ab('0x1d'),QUERY,_0xa5cfb4,_0xe231f8),{'type':dbH[_0x40ab('0x15')][_0x40ab('0x1e')][_0x40ab('0x18')]}));});if(_0x4906a1>0x0){_0xe231f8+=_0xa5cfb4;_0x6fbc24['push'](dbH[_0x40ab('0x15')][_0x40ab('0x16')](util['format'](_0x40ab('0x1d'),QUERY,_0x4906a1,_0xe231f8),{'type':dbH['sequelize'][_0x40ab('0x1e')][_0x40ab('0x18')]}));}}}else{_0x6fbc24[_0x40ab('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x40ab('0x1e')]['SELECT']}));}var _0x5bd225=path['dirname'](PATH);var _0x3822e2=path[_0x40ab('0x1f')](PATH,'.csv');var _0x22e3e7=_0x53762a[_0x40ab('0x12')]&&_0x6fbc24['length']>0x1;var _0x590295=[];if(!fs[_0x40ab('0x20')](path[_0x40ab('0x21')](_0x5bd225,_0x3822e2))&&_0x22e3e7){fs[_0x40ab('0x22')](path[_0x40ab('0x21')](_0x5bd225,_0x3822e2));}return BPromise[_0x40ab('0x23')](_0x6fbc24,function(_0x227a38){_0x590295[_0x40ab('0x1b')](_0x227a38);})[_0x40ab('0x14')](function(){for(var _0x4e4de5=0x0;_0x4e4de5<_0x590295['length'];_0x4e4de5+=0x1){var _0x56364f;var _0x427ccd=_0x590295[_0x4e4de5];if(_0x22e3e7){_0x56364f=path[_0x40ab('0x21')](_0x5bd225,_0x3822e2,util[_0x40ab('0x1c')](_0x40ab('0x24'),_0x3822e2,_0x4e4de5,_0x40ab('0x25')));}else{_0x56364f=path[_0x40ab('0x21')](_0x5bd225,util[_0x40ab('0x1c')](_0x40ab('0x26'),_0x3822e2,_0x40ab('0x25')));}fs[_0x40ab('0x27')](_0x56364f,csv(_0x427ccd));}})['then'](function(){if(_0x22e3e7){return new Promise(function(_0x2472a9){zipdir(path['join'](_0x5bd225,_0x3822e2),{'saveTo':path[_0x40ab('0x21')](_0x5bd225,util['format']('%s.%s',_0x3822e2,_0x40ab('0x28')))},function(_0x2f99a2,_0xb85a57){rimraf(path[_0x40ab('0x21')](_0x5bd225,_0x3822e2),function(){});_0x2472a9(_0x40ab('0x29'));});});}})[_0x40ab('0x14')](function(){logger[_0x40ab('0xd')](util[_0x40ab('0x1c')](_0x40ab('0x2a'),EXTRACTED_REPORT_ID,_0x40ab('0xf')));return analyticExtractedReport(_0x40ab('0x2b'),_0x22e3e7?util[_0x40ab('0x1c')]('%s.%s',_0x3822e2,_0x22e3e7?_0x40ab('0x28'):_0x40ab('0x25')):null);});})[_0x40ab('0x2c')](function(_0x1d5cc8){logger[_0x40ab('0xd')](util[_0x40ab('0x1c')](_0x40ab('0x2d'),EXTRACTED_REPORT_ID,_0x40ab('0xf')),util['inspect'](_0x1d5cc8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x40ab('0x2e'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3358=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','split','splitSizeCsv','then','sequelize','query'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x3358,0x111));var _0x8335=function(_0x2ebffa,_0x375463){_0x2ebffa=_0x2ebffa-0x0;var _0x275a59=_0x3358[_0x2ebffa];return _0x275a59;};'use strict';var util=require(_0x8335('0x0'));var path=require(_0x8335('0x1'));var _=require('lodash');var csv=require(_0x8335('0x2'));var fs=require('fs');var BPromise=require(_0x8335('0x3'));var zipdir=require(_0x8335('0x4'));var rimraf=require(_0x8335('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8335('0x6'))[_0x8335('0x7')];var logger=require(_0x8335('0x8'))(_0x8335('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8335('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4ac9e6,_0x1773c3){var _0xa734df={'status':_0x4ac9e6};var _0x183743={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1773c3){_0xa734df[_0x8335('0xb')]=_0x1773c3;}return db['AnalyticExtractedReport'][_0x8335('0xc')](_0xa734df,_0x183743);}function main(){var _0x56e1f0=0x1388;var _0x35bdd4;logger[_0x8335('0xd')](util[_0x8335('0xe')](_0x8335('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8335('0x10'),_0x8335('0x11')]})[_0x8335('0x12')](function(_0x2aad42){if(_0x2aad42){_0x35bdd4=_0x2aad42;_0x56e1f0=_0x35bdd4[_0x8335('0x11')]||0x1388;}})[_0x8335('0x12')](function(){return dbH[_0x8335('0x13')][_0x8335('0x14')](util['format'](_0x8335('0x15'),QUERY),{'type':dbH[_0x8335('0x13')][_0x8335('0x16')][_0x8335('0x17')]});})[_0x8335('0x12')](function(_0xcc2a80){if(!_0xcc2a80[0x0][_0x8335('0x18')]){return analyticExtractedReport(_0x8335('0x19'));}var _0x528158=[];var _0x1b1b38=0x0;if(_0x35bdd4['split']){if(_0xcc2a80&&_0xcc2a80[_0x8335('0x1a')]){var _0x247d5e=_[_0x8335('0x1b')](_0xcc2a80[0x0][_0x8335('0x18')]/_0x56e1f0);var _0x51067b=Number[_0x8335('0x1c')](_0xcc2a80[0x0][_0x8335('0x18')]/_0x56e1f0)?_0xcc2a80[0x0][_0x8335('0x18')]%_0x56e1f0:0x0;_0x247d5e[_0x8335('0x1d')](function(_0x582e9b){if(_0x582e9b>0x0){_0x1b1b38+=_0x56e1f0;}_0x528158['push'](dbH[_0x8335('0x13')]['query'](util[_0x8335('0xe')](_0x8335('0x1e'),QUERY,_0x56e1f0,_0x1b1b38),{'type':dbH[_0x8335('0x13')][_0x8335('0x16')][_0x8335('0x17')]}));});if(_0x51067b>0x0){_0x1b1b38+=_0x56e1f0;_0x528158[_0x8335('0x1f')](dbH['sequelize']['query'](util[_0x8335('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x51067b,_0x1b1b38),{'type':dbH[_0x8335('0x13')][_0x8335('0x16')]['SELECT']}));}}}else{_0x528158[_0x8335('0x1f')](dbH['sequelize'][_0x8335('0x14')](QUERY,{'type':dbH[_0x8335('0x13')]['QueryTypes'][_0x8335('0x17')]}));}var _0x5a5d78=path['dirname'](PATH);var _0xe852=path['basename'](PATH,'.csv');var _0x573bb6=_0x35bdd4['split']&&_0x528158[_0x8335('0x1a')]>0x1;var _0x36815c=[];if(!fs['existsSync'](path[_0x8335('0x20')](_0x5a5d78,_0xe852))&&_0x573bb6){fs[_0x8335('0x21')](path[_0x8335('0x20')](_0x5a5d78,_0xe852));}return BPromise[_0x8335('0x22')](_0x528158,function(_0x570263){_0x36815c[_0x8335('0x1f')](_0x570263);})[_0x8335('0x12')](function(){for(var _0x405753=0x0;_0x405753<_0x36815c[_0x8335('0x1a')];_0x405753+=0x1){var _0x4c016c;var _0x423f74=_0x36815c[_0x405753];if(_0x573bb6){_0x4c016c=path[_0x8335('0x20')](_0x5a5d78,_0xe852,util['format'](_0x8335('0x23'),_0xe852,_0x405753,_0x8335('0x24')));}else{_0x4c016c=path[_0x8335('0x20')](_0x5a5d78,util[_0x8335('0xe')](_0x8335('0x25'),_0xe852,_0x8335('0x24')));}fs['writeFileSync'](_0x4c016c,csv(_0x423f74));}})[_0x8335('0x12')](function(){if(_0x573bb6){return new Promise(function(_0x557a5b){zipdir(path[_0x8335('0x20')](_0x5a5d78,_0xe852),{'saveTo':path['join'](_0x5a5d78,util['format'](_0x8335('0x25'),_0xe852,_0x8335('0x26')))},function(_0x269ac4,_0x5ede8){rimraf(path['join'](_0x5a5d78,_0xe852),function(){});_0x557a5b(_0x8335('0x27'));});});}})['then'](function(){logger[_0x8335('0xd')](util[_0x8335('0xe')](_0x8335('0x28'),EXTRACTED_REPORT_ID,_0x8335('0x29')));return analyticExtractedReport(_0x8335('0x2a'),_0x573bb6?util[_0x8335('0xe')](_0x8335('0x25'),_0xe852,_0x573bb6?_0x8335('0x26'):_0x8335('0x24')):null);});})[_0x8335('0x2b')](function(_0x49d169){logger[_0x8335('0xd')](util[_0x8335('0xe')](_0x8335('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util[_0x8335('0x2d')](_0x49d169,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8335('0x2e'));})[_0x8335('0x2f')](function(){process[_0x8335('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 9655692..13eb01e 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 _0xf0ac=['info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','moment','pdfmake/src/printer','zip-dir','rimraf','JSDOM','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','fill','length','auto','push','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','num','Empty','Setting','find','split','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','then','flatten','createPdfKitDocument','pdf','all','%s.%s','zip','zip\x20finished'];(function(_0xf3d69e,_0x258179){var _0x440672=function(_0x1c7aee){while(--_0x1c7aee){_0xf3d69e['push'](_0xf3d69e['shift']());}};_0x440672(++_0x258179);}(_0xf0ac,0x72));var _0xcf0a=function(_0x331a73,_0x190154){_0x331a73=_0x331a73-0x0;var _0x20e304=_0xf0ac[_0x331a73];return _0x20e304;};'use strict';var _=require(_0xcf0a('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xcf0a('0x1'));var moment=require(_0xcf0a('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xcf0a('0x3'));var zipdir=require(_0xcf0a('0x4'));var rimraf=require(_0xcf0a('0x5'));var JSDOM=require('jsdom')[_0xcf0a('0x6')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcf0a('0x7')];var logger=require(_0xcf0a('0x8'))(_0xcf0a('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xcf0a('0xa')][0x2]);var QUERY=process[_0xcf0a('0xa')][0x3];var PATH=process[_0xcf0a('0xa')][0x4];var NAME=process[_0xcf0a('0xa')][0x5];var FORMAT=_0xcf0a('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2ed569,_0x26552c){var _0x38c9f0={'status':_0x2ed569};var _0xd5dd76={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x26552c){_0x38c9f0[_0xcf0a('0xc')]=_0x26552c;}return db[_0xcf0a('0xd')][_0xcf0a('0xe')](_0x38c9f0,_0xd5dd76);}function getHeaders(_0x1939bf){return _[_0xcf0a('0xf')](_0x1939bf,function(_0x1e3c19){return{'text':_0x1e3c19,'style':_0xcf0a('0x10')};});}function getRows(_0x519186,_0x3999a6){return _['map'](_0x3999a6,function(_0x5046c0){return _(_0x5046c0)['pick'](_0x519186)['map'](function(_0x3032de){return _0x3032de?_[_0xcf0a('0x11')](_0x3032de):'';})['value']();});}function createTable(_0x28e842,_0x209abf){var _0x1317c6={'widths':_[_0xcf0a('0x12')](Array(_0x28e842[_0xcf0a('0x13')]),0x91),'heights':function(_0x5940fd){return _0x5940fd===0x0?_0xcf0a('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x37ab82=getHeaders(_0x28e842);_0x1317c6['body'][_0xcf0a('0x15')](_0x37ab82);var _0x5d3b2a=getRows(_0x28e842,_0x209abf);_0x1317c6['body']=_0x1317c6[_0xcf0a('0x16')][_0xcf0a('0x17')](_0x5d3b2a);return _0x1317c6;}function createTables(_0x5e4811){var _0x13bfec=[];var _0x387864=_[_0xcf0a('0x18')](Object['keys'](_0x5e4811[0x0]),0x5);_0x387864[_0xcf0a('0x19')](function(_0x39986a){_0x13bfec[_0xcf0a('0x15')](createTable(_0x39986a,_0x5e4811));});return _0x13bfec;}function getPDFDocDefinition(_0x2470c0){var _0xcd203f=util[_0xcf0a('0x1a')](_0xcf0a('0x1b'),NAME,EXTRACTED_REPORT[_0xcf0a('0x1c')],moment(EXTRACTED_REPORT[_0xcf0a('0x1d')])[_0xcf0a('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xcf0a('0x1a')](FORMAT));var _0x3b724=[];for(var _0x371d2a=0x0;_0x371d2a<_0x2470c0[_0xcf0a('0x13')];_0x371d2a++){var _0x2a7eb9=[];if(_0x371d2a===0x0){_0x2a7eb9[_0xcf0a('0x15')]({'text':_0xcd203f,'style':_0xcf0a('0x1e')});}var _0xde46a6={'table':_0x2470c0[_0x371d2a]};if(_0x371d2a>0x0){_0xde46a6[_0xcf0a('0x1f')]=_0xcf0a('0x20');_0xde46a6[_0xcf0a('0x21')]=[0x0,0x46,0x0,0x0];}_0x2a7eb9['push'](_0xde46a6);_0x3b724[_0xcf0a('0x15')](_0x2a7eb9);}return{'pageSize':'A4','pageOrientation':_0xcf0a('0x22'),'content':_0x3b724,'footer':function(_0x564003,_0x4b962b){return{'text':_0x564003[_0xcf0a('0x11')]()+_0xcf0a('0x23')+_0x4b962b,'style':'footer'};},'defaultStyle':{'font':_0xcf0a('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcf0a('0x25')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2f69cb){var _0x24c4d=0x1388;var _0x29a1d5;if(!_0x2f69cb[0x0][_0xcf0a('0x26')]){return analyticExtractedReport(_0xcf0a('0x27'));}return db[_0xcf0a('0x28')][_0xcf0a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcf0a('0x2a'),'splitSizePdf']})['then'](function(_0x4a59b2){if(_0x4a59b2){_0x29a1d5=_0x4a59b2;_0x24c4d=_0x29a1d5['splitSizePdf']||0x3e8;}})['then'](function(){var _0x390263=[];var _0xe85b1c=0x0;if(_0x29a1d5[_0xcf0a('0x2a')]){if(_0x2f69cb&&_0x2f69cb[_0xcf0a('0x13')]){var _0x2dc219=_['range'](_0x2f69cb[0x0]['num']/_0x24c4d);var _0xac4542=Number[_0xcf0a('0x2b')](_0x2f69cb[0x0]['num']/_0x24c4d)?_0x2f69cb[0x0][_0xcf0a('0x26')]%_0x24c4d:0x0;_0x2dc219[_0xcf0a('0x19')](function(_0x49b55b){if(_0x49b55b>0x0){_0xe85b1c+=_0x24c4d;}_0x390263[_0xcf0a('0x15')](dbH[_0xcf0a('0x2c')][_0xcf0a('0x2d')](util['format'](_0xcf0a('0x2e'),QUERY,_0x24c4d,_0xe85b1c),{'type':dbH[_0xcf0a('0x2c')][_0xcf0a('0x2f')][_0xcf0a('0x30')]}));});if(_0xac4542>0x0){_0xe85b1c+=_0x24c4d;_0x390263[_0xcf0a('0x15')](dbH[_0xcf0a('0x2c')][_0xcf0a('0x2d')](util[_0xcf0a('0x1a')](_0xcf0a('0x2e'),QUERY,_0xac4542,_0xe85b1c),{'type':dbH['sequelize'][_0xcf0a('0x2f')][_0xcf0a('0x30')]}));}}}else{_0x390263[_0xcf0a('0x15')](dbH['sequelize'][_0xcf0a('0x2d')](QUERY,{'type':dbH[_0xcf0a('0x2c')][_0xcf0a('0x2f')][_0xcf0a('0x30')]}));}var _0x26b467=path[_0xcf0a('0x31')](PATH);var _0x426c0d=path[_0xcf0a('0x32')](PATH,_0xcf0a('0x33'));var _0x31c058=_0x29a1d5[_0xcf0a('0x2a')]&&_0x390263[_0xcf0a('0x13')]>0x1;var _0x4e9abf=[];if(!fs[_0xcf0a('0x34')](path['join'](_0x26b467,_0x426c0d))&&_0x31c058){fs[_0xcf0a('0x35')](path[_0xcf0a('0x36')](_0x26b467,_0x426c0d));}return BPromise[_0xcf0a('0x37')](_0x390263,function(_0x44de97){_0x4e9abf['push'](_0x44de97);})[_0xcf0a('0x38')](function(){var _0x447a91=[];for(var _0x45e6b6=0x0;_0x45e6b6<_0x4e9abf['length'];_0x45e6b6+=0x1){var _0x1fe080=_0x4e9abf[_0x45e6b6];var _0x5ae4f0=createTables(_[_0xcf0a('0x39')](_0x1fe080));var _0x188b32;var _0x5713da=getPDFDocDefinition(_0x5ae4f0);var _0x13b14f=getPDFPrinter();var _0x2f5efe=_0x13b14f[_0xcf0a('0x3a')](_0x5713da);if(_0x31c058){_0x188b32=path[_0xcf0a('0x36')](_0x26b467,_0x426c0d,util[_0xcf0a('0x1a')]('%s%d.%s',_0x426c0d,_0x45e6b6,'pdf'));}else{_0x188b32=path[_0xcf0a('0x36')](_0x26b467,util[_0xcf0a('0x1a')]('%s.%s',_0x426c0d,_0xcf0a('0x3b')));}_0x447a91[_0xcf0a('0x15')](writePDFDocument(_0x2f5efe,_0x188b32));}return Promise[_0xcf0a('0x3c')](_0x447a91);})[_0xcf0a('0x38')](function(){if(_0x31c058){return new Promise(function(_0x4066ed){zipdir(path[_0xcf0a('0x36')](_0x26b467,_0x426c0d),{'saveTo':path[_0xcf0a('0x36')](_0x26b467,util['format'](_0xcf0a('0x3d'),_0x426c0d,_0xcf0a('0x3e')))},function(){rimraf(path[_0xcf0a('0x36')](_0x26b467,_0x426c0d),function(){});_0x4066ed(_0xcf0a('0x3f'));});});}})[_0xcf0a('0x38')](function(){if(!_0x31c058)return;rimraf(path[_0xcf0a('0x36')](_0x26b467,_0x426c0d),function(){});})[_0xcf0a('0x38')](function(){logger[_0xcf0a('0x40')](util[_0xcf0a('0x1a')](_0xcf0a('0x41'),EXTRACTED_REPORT_ID,_0xcf0a('0x42')));return analyticExtractedReport(_0xcf0a('0x43'),_0x31c058?util[_0xcf0a('0x1a')](_0xcf0a('0x3d'),_0x426c0d,_0x31c058?_0xcf0a('0x3e'):_0xcf0a('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xcf0a('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcf0a('0x42')));return db[_0xcf0a('0xd')][_0xcf0a('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xcf0a('0x38')](function(_0x294ae8){EXTRACTED_REPORT=_0x294ae8;return dbH[_0xcf0a('0x2c')][_0xcf0a('0x2d')](util['format'](_0xcf0a('0x45'),QUERY),{'type':dbH['sequelize'][_0xcf0a('0x2f')]['SELECT']});})[_0xcf0a('0x38')](extractReport)[_0xcf0a('0x46')](function(_0x1c86fd){logger['info'](util['format'](_0xcf0a('0x47'),EXTRACTED_REPORT_ID,_0xcf0a('0x42')),util['inspect'](_0x1c86fd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcf0a('0x48'));})[_0xcf0a('0x49')](function(){process[_0xcf0a('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x23d005=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xcf0a('0x4b'),'italics':__dirname+_0xcf0a('0x4c'),'bolditalics':__dirname+_0xcf0a('0x4d')}});return _0x23d005;}function getPDFDocDefinitionFromHTML(_0x297f7e,_0x345347){var _0x1d7a82=util[_0xcf0a('0x1a')]('%s\x20#%d',_0x345347['channel'],_0x345347[_0xcf0a('0x4e')]);var _0x133f77=moment()[_0xcf0a('0x1a')]('YYYY-MM-DD')[_0xcf0a('0x11')]();var _0x4bf00d=htmlToPdfmake(_0x297f7e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4bf00d],'defaultStyle':{'font':_0xcf0a('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcf0a('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcf0a('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcf0a('0x4f')}},'header':function(){return[{'text':_0xcf0a('0x50'),'style':_0xcf0a('0x1e')}];},'footer':function(_0x5ed854,_0x55172a){return[{'text':util[_0xcf0a('0x1a')](_0xcf0a('0x51'),_0x1d7a82,_0x5ed854,_0x55172a,_0x133f77),'style':_0xcf0a('0x52')}];}};}function writePDFDocument(_0x17c15b,_0x7b9c49){return new Promise(function(_0x5cb1d8,_0x505385){var _0x23269a=_0x17c15b[_0xcf0a('0x53')](fs[_0xcf0a('0x54')](_0x7b9c49));_0x23269a['on']('finish',function(){_0x5cb1d8(_0xcf0a('0x55'));});_0x23269a['on'](_0xcf0a('0x56'),function(_0x359340){_0x505385(_0x359340);});_0x17c15b[_0xcf0a('0x57')]();});}exports[_0xcf0a('0x58')]=function(_0x8c3ac5,_0x27986f){var _0x3cfd73=getPDFPrinter();var _0xd0c30c=getPDFDocDefinitionFromHTML(_0x8c3ac5,_0x27986f);var _0xa7358=_0x3cfd73['createPdfKitDocument'](_0xd0c30c);return writePDFDocument(_0xa7358,_0x27986f[_0xcf0a('0x1')])[_0xcf0a('0x46')](function(_0x55dd04){throw _0x55dd04;});}; \ No newline at end of file +var _0x4d48=['rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','map','tableHeader','pick','toString','value','fill','length','auto','body','push','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','header','pageBreak','before','margin','footer','Arial','right','num','Empty','Setting','splitSizePdf','split','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','each','then','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','finish','end','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir'];(function(_0x56b8eb,_0x1b90ab){var _0x31494f=function(_0x865155){while(--_0x865155){_0x56b8eb['push'](_0x56b8eb['shift']());}};_0x31494f(++_0x1b90ab);}(_0x4d48,0x141));var _0x84d4=function(_0x24e2a3,_0x534875){_0x24e2a3=_0x24e2a3-0x0;var _0x3e82f4=_0x4d48[_0x24e2a3];return _0x3e82f4;};'use strict';var _=require(_0x84d4('0x0'));var fs=require('fs');var util=require(_0x84d4('0x1'));var path=require(_0x84d4('0x2'));var moment=require(_0x84d4('0x3'));var htmlToPdfmake=require(_0x84d4('0x4'));var PdfPrinter=require(_0x84d4('0x5'));var zipdir=require(_0x84d4('0x6'));var rimraf=require(_0x84d4('0x7'));var JSDOM=require(_0x84d4('0x8'))[_0x84d4('0x9')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x84d4('0xa'))['db'];var dbH=require(_0x84d4('0xa'))[_0x84d4('0xb')];var logger=require(_0x84d4('0xc'))(_0x84d4('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x84d4('0xe')][0x2]);var QUERY=process[_0x84d4('0xe')][0x3];var PATH=process[_0x84d4('0xe')][0x4];var NAME=process[_0x84d4('0xe')][0x5];var FORMAT=_0x84d4('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1330e5,_0x5cc05e){var _0x13c6a9={'status':_0x1330e5};var _0x53a0a6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5cc05e){_0x13c6a9['savename']=_0x5cc05e;}return db['AnalyticExtractedReport']['update'](_0x13c6a9,_0x53a0a6);}function getHeaders(_0x46711d){return _[_0x84d4('0x10')](_0x46711d,function(_0x5a075e){return{'text':_0x5a075e,'style':_0x84d4('0x11')};});}function getRows(_0x3b5bfd,_0x312cb8){return _[_0x84d4('0x10')](_0x312cb8,function(_0x149c98){return _(_0x149c98)[_0x84d4('0x12')](_0x3b5bfd)['map'](function(_0x4d205a){return _0x4d205a?_[_0x84d4('0x13')](_0x4d205a):'';})[_0x84d4('0x14')]();});}function createTable(_0x5d7f05,_0xcb9bd7){var _0x5d13cd={'widths':_[_0x84d4('0x15')](Array(_0x5d7f05[_0x84d4('0x16')]),0x91),'heights':function(_0x17867c){return _0x17867c===0x0?_0x84d4('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4d8092=getHeaders(_0x5d7f05);_0x5d13cd[_0x84d4('0x18')][_0x84d4('0x19')](_0x4d8092);var _0x2c0f33=getRows(_0x5d7f05,_0xcb9bd7);_0x5d13cd[_0x84d4('0x18')]=_0x5d13cd[_0x84d4('0x18')]['concat'](_0x2c0f33);return _0x5d13cd;}function createTables(_0x5af36e){var _0x125ebe=[];var _0x4a7a23=_['chunk'](Object[_0x84d4('0x1a')](_0x5af36e[0x0]),0x5);_0x4a7a23[_0x84d4('0x1b')](function(_0x3d680f){_0x125ebe[_0x84d4('0x19')](createTable(_0x3d680f,_0x5af36e));});return _0x125ebe;}function getPDFDocDefinition(_0x2d6611){var _0x510a10=util[_0x84d4('0x1c')](_0x84d4('0x1d'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x84d4('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x84d4('0x1e')])['format'](FORMAT));var _0x5960e9=[];for(var _0xef91f2=0x0;_0xef91f2<_0x2d6611[_0x84d4('0x16')];_0xef91f2++){var _0x4c780e=[];if(_0xef91f2===0x0){_0x4c780e[_0x84d4('0x19')]({'text':_0x510a10,'style':_0x84d4('0x1f')});}var _0x1b09f5={'table':_0x2d6611[_0xef91f2]};if(_0xef91f2>0x0){_0x1b09f5[_0x84d4('0x20')]=_0x84d4('0x21');_0x1b09f5[_0x84d4('0x22')]=[0x0,0x46,0x0,0x0];}_0x4c780e['push'](_0x1b09f5);_0x5960e9[_0x84d4('0x19')](_0x4c780e);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5960e9,'footer':function(_0x4c13b8,_0x573467){return{'text':_0x4c13b8[_0x84d4('0x13')]()+'\x20/\x20'+_0x573467,'style':_0x84d4('0x23')};},'defaultStyle':{'font':_0x84d4('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x84d4('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3b5b23){var _0x474001=0x1388;var _0xe71263;if(!_0x3b5b23[0x0][_0x84d4('0x26')]){return analyticExtractedReport(_0x84d4('0x27'));}return db[_0x84d4('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x84d4('0x29')]})['then'](function(_0x30dacc){if(_0x30dacc){_0xe71263=_0x30dacc;_0x474001=_0xe71263[_0x84d4('0x29')]||0x3e8;}})['then'](function(){var _0x15836c=[];var _0x379b13=0x0;if(_0xe71263[_0x84d4('0x2a')]){if(_0x3b5b23&&_0x3b5b23[_0x84d4('0x16')]){var _0x13ccd2=_[_0x84d4('0x2b')](_0x3b5b23[0x0][_0x84d4('0x26')]/_0x474001);var _0x5582e5=Number['isInteger'](_0x3b5b23[0x0][_0x84d4('0x26')]/_0x474001)?_0x3b5b23[0x0][_0x84d4('0x26')]%_0x474001:0x0;_0x13ccd2[_0x84d4('0x1b')](function(_0x527408){if(_0x527408>0x0){_0x379b13+=_0x474001;}_0x15836c[_0x84d4('0x19')](dbH[_0x84d4('0x2c')][_0x84d4('0x2d')](util[_0x84d4('0x1c')](_0x84d4('0x2e'),QUERY,_0x474001,_0x379b13),{'type':dbH[_0x84d4('0x2c')][_0x84d4('0x2f')][_0x84d4('0x30')]}));});if(_0x5582e5>0x0){_0x379b13+=_0x474001;_0x15836c['push'](dbH[_0x84d4('0x2c')][_0x84d4('0x2d')](util[_0x84d4('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5582e5,_0x379b13),{'type':dbH[_0x84d4('0x2c')][_0x84d4('0x2f')]['SELECT']}));}}}else{_0x15836c[_0x84d4('0x19')](dbH[_0x84d4('0x2c')][_0x84d4('0x2d')](QUERY,{'type':dbH[_0x84d4('0x2c')][_0x84d4('0x2f')][_0x84d4('0x30')]}));}var _0x3724e6=path['dirname'](PATH);var _0x424711=path['basename'](PATH,'.pdf');var _0x5a2001=_0xe71263[_0x84d4('0x2a')]&&_0x15836c[_0x84d4('0x16')]>0x1;var _0x5af0d0=[];if(!fs[_0x84d4('0x31')](path[_0x84d4('0x32')](_0x3724e6,_0x424711))&&_0x5a2001){fs['mkdirSync'](path[_0x84d4('0x32')](_0x3724e6,_0x424711));}return BPromise[_0x84d4('0x33')](_0x15836c,function(_0x2e0516){_0x5af0d0[_0x84d4('0x19')](_0x2e0516);})[_0x84d4('0x34')](function(){var _0x28f28e=[];for(var _0x367b00=0x0;_0x367b00<_0x5af0d0[_0x84d4('0x16')];_0x367b00+=0x1){var _0x3c0e59=_0x5af0d0[_0x367b00];var _0x3677e5=createTables(_[_0x84d4('0x35')](_0x3c0e59));var _0x49dd6a;var _0xdaa3ec=getPDFDocDefinition(_0x3677e5);var _0x177b1d=getPDFPrinter();var _0x1e8f3b=_0x177b1d[_0x84d4('0x36')](_0xdaa3ec);if(_0x5a2001){_0x49dd6a=path['join'](_0x3724e6,_0x424711,util[_0x84d4('0x1c')](_0x84d4('0x37'),_0x424711,_0x367b00,'pdf'));}else{_0x49dd6a=path['join'](_0x3724e6,util[_0x84d4('0x1c')](_0x84d4('0x38'),_0x424711,_0x84d4('0x39')));}_0x28f28e[_0x84d4('0x19')](writePDFDocument(_0x1e8f3b,_0x49dd6a));}return Promise[_0x84d4('0x3a')](_0x28f28e);})['then'](function(){if(_0x5a2001){return new Promise(function(_0x7a202d){zipdir(path['join'](_0x3724e6,_0x424711),{'saveTo':path[_0x84d4('0x32')](_0x3724e6,util[_0x84d4('0x1c')](_0x84d4('0x38'),_0x424711,_0x84d4('0x3b')))},function(){rimraf(path['join'](_0x3724e6,_0x424711),function(){});_0x7a202d('zip\x20finished');});});}})[_0x84d4('0x34')](function(){if(!_0x5a2001)return;rimraf(path[_0x84d4('0x32')](_0x3724e6,_0x424711),function(){});})[_0x84d4('0x34')](function(){logger['info'](util[_0x84d4('0x1c')](_0x84d4('0x3c'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0x5a2001?util[_0x84d4('0x1c')](_0x84d4('0x38'),_0x424711,_0x5a2001?_0x84d4('0x3b'):_0x84d4('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x84d4('0x3d')](util[_0x84d4('0x1c')](_0x84d4('0x3e'),EXTRACTED_REPORT_ID,_0x84d4('0x3f')));return db[_0x84d4('0x40')][_0x84d4('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x84d4('0x34')](function(_0x37528e){EXTRACTED_REPORT=_0x37528e;return dbH['sequelize'][_0x84d4('0x2d')](util[_0x84d4('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x84d4('0x2c')][_0x84d4('0x2f')]['SELECT']});})[_0x84d4('0x34')](extractReport)['catch'](function(_0xd96d04){logger['info'](util[_0x84d4('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x84d4('0x3f')),util[_0x84d4('0x42')](_0xd96d04,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x84d4('0x43'));})[_0x84d4('0x44')](function(){process[_0x84d4('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5d8320=new PdfPrinter({'Arial':{'normal':__dirname+_0x84d4('0x46'),'bold':__dirname+_0x84d4('0x47'),'italics':__dirname+_0x84d4('0x48'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x5d8320;}function getPDFDocDefinitionFromHTML(_0x3a3967,_0xfd896f){var _0x2c40e3=util[_0x84d4('0x1c')](_0x84d4('0x49'),_0xfd896f[_0x84d4('0x4a')],_0xfd896f[_0x84d4('0x4b')]);var _0x5505f5=moment()['format'](_0x84d4('0x4c'))['toString']();var _0x52f641=htmlToPdfmake(_0x3a3967,{'window':window,'tableAutoSize':!![]});return{'content':[_0x52f641],'defaultStyle':{'font':_0x84d4('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x84d4('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x84d4('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x84d4('0x4d')}},'header':function(){return[{'text':_0x84d4('0x4e'),'style':'header'}];},'footer':function(_0x4cdf07,_0x463bd7){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2c40e3,_0x4cdf07,_0x463bd7,_0x5505f5),'style':_0x84d4('0x23')}];}};}function writePDFDocument(_0x261018,_0x3b881a){return new Promise(function(_0x182aca,_0x4176a4){var _0x4cdc21=_0x261018['pipe'](fs['createWriteStream'](_0x3b881a));_0x4cdc21['on'](_0x84d4('0x4f'),function(){_0x182aca(_0x84d4('0x4f'));});_0x4cdc21['on']('error',function(_0x2c307e){_0x4176a4(_0x2c307e);});_0x261018[_0x84d4('0x50')]();});}exports['createPdfFromHTML']=function(_0x27b4bd,_0x6acd3f){var _0x4b336d=getPDFPrinter();var _0xe68d1b=getPDFDocDefinitionFromHTML(_0x27b4bd,_0x6acd3f);var _0x160b0a=_0x4b336d[_0x84d4('0x36')](_0xe68d1b);return writePDFDocument(_0x160b0a,_0x6acd3f[_0x84d4('0x2')])[_0x84d4('0x51')](function(_0x25ab4d){throw _0x25ab4d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 6b83e51..ad55ea5 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 _0x4314=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','split','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','basename','existsSync','join','mkdirSync','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x4314,0xe5));var _0x4431=function(_0x1a1b24,_0x2a2514){_0x1a1b24=_0x1a1b24-0x0;var _0x3ee752=_0x4314[_0x1a1b24];return _0x3ee752;};'use strict';var util=require('util');var path=require('path');var _=require(_0x4431('0x0'));var fs=require('fs');var json2xls=require(_0x4431('0x1'));var BPromise=require(_0x4431('0x2'));var zipdir=require(_0x4431('0x3'));var rimraf=require(_0x4431('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4431('0x5'))[_0x4431('0x6')];var logger=require(_0x4431('0x7'))(_0x4431('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x4431('0x9')][0x2]);var QUERY=process[_0x4431('0x9')][0x3];var PATH=process[_0x4431('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x108d9a,_0x339f8f){var _0x182dd1={'status':_0x108d9a};var _0xa623c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x339f8f){_0x182dd1[_0x4431('0xa')]=_0x339f8f;}return db['AnalyticExtractedReport'][_0x4431('0xb')](_0x182dd1,_0xa623c);}function main(){var _0x38bd7f=0x1388;var _0x2b4c1e;logger[_0x4431('0xc')](util[_0x4431('0xd')](_0x4431('0xe'),EXTRACTED_REPORT_ID,_0x4431('0xf')));return db[_0x4431('0x10')][_0x4431('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4431('0x12')]})[_0x4431('0x13')](function(_0x47cfe3){if(_0x47cfe3){_0x2b4c1e=_0x47cfe3;_0x38bd7f=_0x2b4c1e['splitSizeXlsx']||0x1388;}})[_0x4431('0x13')](function(){return dbH[_0x4431('0x14')][_0x4431('0x15')](util[_0x4431('0xd')](_0x4431('0x16'),QUERY),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']});})['then'](function(_0x2f3aa4){if(!_0x2f3aa4[0x0]['num']){return analyticExtractedReport(_0x4431('0x18'));}var _0x24b3a5=[];var _0x2111f5=0x0;if(_0x2b4c1e[_0x4431('0x19')]){if(_0x2f3aa4&&_0x2f3aa4[_0x4431('0x1a')]){var _0x3eab43=_[_0x4431('0x1b')](_0x2f3aa4[0x0][_0x4431('0x1c')]/_0x38bd7f);var _0x478822=Number[_0x4431('0x1d')](_0x2f3aa4[0x0][_0x4431('0x1c')]/_0x38bd7f)?_0x2f3aa4[0x0][_0x4431('0x1c')]%_0x38bd7f:0x0;_0x3eab43[_0x4431('0x1e')](function(_0x3e2266){if(_0x3e2266>0x0){_0x2111f5+=_0x38bd7f;}_0x24b3a5['push'](dbH[_0x4431('0x14')]['query'](util[_0x4431('0xd')](_0x4431('0x1f'),QUERY,_0x38bd7f,_0x2111f5),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']}));});if(_0x478822>0x0){_0x2111f5+=_0x38bd7f;_0x24b3a5[_0x4431('0x20')](dbH[_0x4431('0x14')][_0x4431('0x15')](util[_0x4431('0xd')](_0x4431('0x1f'),QUERY,_0x478822,_0x2111f5),{'type':dbH[_0x4431('0x14')][_0x4431('0x17')]['SELECT']}));}}}else{_0x24b3a5[_0x4431('0x20')](dbH[_0x4431('0x14')][_0x4431('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4431('0x21')]}));}var _0x51f025=path['dirname'](PATH);var _0x230e93=path[_0x4431('0x22')](PATH,'.xlsx');var _0x40c54e=_0x2b4c1e[_0x4431('0x19')]&&_0x24b3a5[_0x4431('0x1a')]>0x1;var _0x480f71=[];if(!fs[_0x4431('0x23')](path[_0x4431('0x24')](_0x51f025,_0x230e93))&&_0x40c54e){fs[_0x4431('0x25')](path[_0x4431('0x24')](_0x51f025,_0x230e93));}return BPromise['each'](_0x24b3a5,function(_0x3aff5b){_0x480f71[_0x4431('0x20')](_0x3aff5b);})['then'](function(){for(var _0x52a566=0x0;_0x52a566<_0x480f71[_0x4431('0x1a')];_0x52a566+=0x1){var _0x4ee429;var _0x42f280=_0x480f71[_0x52a566];if(_0x40c54e){_0x4ee429=path[_0x4431('0x24')](_0x51f025,_0x230e93,util[_0x4431('0xd')](_0x4431('0x26'),_0x230e93,_0x52a566,_0x4431('0x27')));}else{_0x4ee429=path['join'](_0x51f025,util[_0x4431('0xd')]('%s.%s',_0x230e93,_0x4431('0x27')));}fs['writeFileSync'](_0x4ee429,json2xls(_0x42f280),_0x4431('0x28'));}})[_0x4431('0x13')](function(){if(_0x40c54e){return new Promise(function(_0x137352){zipdir(path[_0x4431('0x24')](_0x51f025,_0x230e93),{'saveTo':path['join'](_0x51f025,util['format'](_0x4431('0x29'),_0x230e93,_0x4431('0x2a')))},function(_0x49aa23,_0x9a5f3e){rimraf(path['join'](_0x51f025,_0x230e93),function(){});_0x137352(_0x4431('0x2b'));});});}})['then'](function(){logger[_0x4431('0xc')](util['format'](_0x4431('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x40c54e?util[_0x4431('0xd')](_0x4431('0x29'),_0x230e93,_0x40c54e?_0x4431('0x2a'):_0x4431('0x27')):null);});})[_0x4431('0x2d')](function(_0x5befad){logger[_0x4431('0xc')](util[_0x4431('0xd')](_0x4431('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x4431('0x2f')](_0x5befad,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4431('0x30')](function(){process[_0x4431('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x241c=['catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','length','%s%d.%s','xlsx','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip'];(function(_0x4b90c2,_0xaae537){var _0x59b4c0=function(_0x3c1c1e){while(--_0x3c1c1e){_0x4b90c2['push'](_0x4b90c2['shift']());}};_0x59b4c0(++_0xaae537);}(_0x241c,0xd8));var _0xc241=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x241c[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xc241('0x0'));var path=require(_0xc241('0x1'));var _=require(_0xc241('0x2'));var fs=require('fs');var json2xls=require(_0xc241('0x3'));var BPromise=require(_0xc241('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xc241('0x5'));var db=require(_0xc241('0x6'))['db'];var dbH=require(_0xc241('0x6'))[_0xc241('0x7')];var logger=require(_0xc241('0x8'))(_0xc241('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xc241('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1cdaa9,_0x5f5799){var _0x58d04f={'status':_0x1cdaa9};var _0x52949b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f5799){_0x58d04f[_0xc241('0xb')]=_0x5f5799;}return db[_0xc241('0xc')][_0xc241('0xd')](_0x58d04f,_0x52949b);}function main(){var _0x4daf8b=0x1388;var _0x3e2294;logger['info'](util[_0xc241('0xe')](_0xc241('0xf'),EXTRACTED_REPORT_ID,_0xc241('0x10')));return db[_0xc241('0x11')][_0xc241('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc241('0x13'),'splitSizeXlsx']})[_0xc241('0x14')](function(_0x5bf21e){if(_0x5bf21e){_0x3e2294=_0x5bf21e;_0x4daf8b=_0x3e2294[_0xc241('0x15')]||0x1388;}})[_0xc241('0x14')](function(){return dbH[_0xc241('0x16')]['query'](util[_0xc241('0xe')](_0xc241('0x17'),QUERY),{'type':dbH[_0xc241('0x16')][_0xc241('0x18')]['SELECT']});})[_0xc241('0x14')](function(_0x59954a){if(!_0x59954a[0x0][_0xc241('0x19')]){return analyticExtractedReport(_0xc241('0x1a'));}var _0x149cce=[];var _0x2d6e22=0x0;if(_0x3e2294['split']){if(_0x59954a&&_0x59954a['length']){var _0x37ff4a=_[_0xc241('0x1b')](_0x59954a[0x0][_0xc241('0x19')]/_0x4daf8b);var _0x214532=Number[_0xc241('0x1c')](_0x59954a[0x0][_0xc241('0x19')]/_0x4daf8b)?_0x59954a[0x0]['num']%_0x4daf8b:0x0;_0x37ff4a[_0xc241('0x1d')](function(_0x238a39){if(_0x238a39>0x0){_0x2d6e22+=_0x4daf8b;}_0x149cce['push'](dbH[_0xc241('0x16')][_0xc241('0x1e')](util[_0xc241('0xe')](_0xc241('0x1f'),QUERY,_0x4daf8b,_0x2d6e22),{'type':dbH['sequelize']['QueryTypes'][_0xc241('0x20')]}));});if(_0x214532>0x0){_0x2d6e22+=_0x4daf8b;_0x149cce['push'](dbH[_0xc241('0x16')][_0xc241('0x1e')](util[_0xc241('0xe')](_0xc241('0x1f'),QUERY,_0x214532,_0x2d6e22),{'type':dbH[_0xc241('0x16')][_0xc241('0x18')]['SELECT']}));}}}else{_0x149cce[_0xc241('0x21')](dbH['sequelize'][_0xc241('0x1e')](QUERY,{'type':dbH[_0xc241('0x16')]['QueryTypes'][_0xc241('0x20')]}));}var _0x12c017=path[_0xc241('0x22')](PATH);var _0x17ae5f=path[_0xc241('0x23')](PATH,_0xc241('0x24'));var _0x2fcb46=_0x3e2294['split']&&_0x149cce['length']>0x1;var _0x5946dc=[];if(!fs[_0xc241('0x25')](path['join'](_0x12c017,_0x17ae5f))&&_0x2fcb46){fs[_0xc241('0x26')](path[_0xc241('0x27')](_0x12c017,_0x17ae5f));}return BPromise[_0xc241('0x28')](_0x149cce,function(_0x20c9e3){_0x5946dc[_0xc241('0x21')](_0x20c9e3);})[_0xc241('0x14')](function(){for(var _0x10aca8=0x0;_0x10aca8<_0x5946dc[_0xc241('0x29')];_0x10aca8+=0x1){var _0x35cfe3;var _0x50cd23=_0x5946dc[_0x10aca8];if(_0x2fcb46){_0x35cfe3=path[_0xc241('0x27')](_0x12c017,_0x17ae5f,util[_0xc241('0xe')](_0xc241('0x2a'),_0x17ae5f,_0x10aca8,'xlsx'));}else{_0x35cfe3=path['join'](_0x12c017,util[_0xc241('0xe')]('%s.%s',_0x17ae5f,_0xc241('0x2b')));}fs['writeFileSync'](_0x35cfe3,json2xls(_0x50cd23),'binary');}})['then'](function(){if(_0x2fcb46){return new Promise(function(_0x5ac91e){zipdir(path['join'](_0x12c017,_0x17ae5f),{'saveTo':path[_0xc241('0x27')](_0x12c017,util[_0xc241('0xe')](_0xc241('0x2c'),_0x17ae5f,'zip'))},function(_0x439836,_0x17f66b){rimraf(path[_0xc241('0x27')](_0x12c017,_0x17ae5f),function(){});_0x5ac91e(_0xc241('0x2d'));});});}})['then'](function(){logger[_0xc241('0x2e')](util[_0xc241('0xe')](_0xc241('0x2f'),EXTRACTED_REPORT_ID,_0xc241('0x10')));return analyticExtractedReport('Completed',_0x2fcb46?util[_0xc241('0xe')]('%s.%s',_0x17ae5f,_0x2fcb46?_0xc241('0x30'):_0xc241('0x2b')):null);});})[_0xc241('0x31')](function(_0x4cee26){logger[_0xc241('0x2e')](util['format'](_0xc241('0x32'),EXTRACTED_REPORT_ID,_0xc241('0x10')),util['inspect'](_0x4cee26,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc241('0x33'));})[_0xc241('0x34')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8a95bd2..c917c45 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 _0x2baa=['push','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extension','type','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','extensions'];(function(_0x22261a,_0x11efcb){var _0x15cb6a=function(_0x4e6bc3){while(--_0x4e6bc3){_0x22261a['push'](_0x22261a['shift']());}};_0x15cb6a(++_0x11efcb);}(_0x2baa,0x1bb));var _0xa2ba=function(_0xd4e2b3,_0x4f7dbe){_0xd4e2b3=_0xd4e2b3-0x0;var _0x47b134=_0x2baa[_0xd4e2b3];return _0x47b134;};'use strict';var _=require(_0xa2ba('0x0'));var util=require('util');function rewrite(_0xcaff50,_0x31db6a){var _0x4a9323=this;return _0xcaff50[_0xa2ba('0x1')][_0xa2ba('0x2')][_0xa2ba('0x3')]({'raw':!![]})[_0xa2ba('0x4')](function(_0x4441b8){_0x4a9323[_0xa2ba('0x5')]=_0x4441b8;return _0xcaff50['models'][_0xa2ba('0x6')][_0xa2ba('0x3')]({'where':{'IntervalId':_0x31db6a['IntervalId']},'raw':!![]});})['then'](function(_0x4b3daa){return _0xcaff50['models']['VoiceExtension'][_0xa2ba('0x3')]({'where':{'exten':{'$in':_[_0xa2ba('0x7')](_[_0xa2ba('0x8')](_0x4b3daa,_0xa2ba('0x9')))}},'order':[{'raw':_0xa2ba('0xa')}],'raw':!![]});})['then'](function(_0x3c70fe){var _0x22f36f=_['filter'](_0x3c70fe,{'priority':'1'});var _0x30a9c7=_[_0xa2ba('0xb')](_0x3c70fe,{'isApp':0x1});var _0x416a5b=_[_0xa2ba('0xc')](_0x30a9c7,_0xa2ba('0x9'));var _0x1b4a77=[_0xa2ba('0xd'),'playback'];var _0x5ba820=[];var _0x50588d=[];for(var _0x4a988d in _0x416a5b){if(_0x416a5b[_0xa2ba('0xe')](_0x4a988d)){_0x4a9323[_0xa2ba('0xf')]=0x2;_0x4a9323['extensions']=[];_0x4a9323[_0xa2ba('0x10')]=_['find'](_0x22f36f,{'exten':_0x416a5b[_0x4a988d][0x0]['exten']});_0x4a9323['extensions']['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':'Set','appdata':util['format'](_0xa2ba('0x12'),_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')]),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0]['exten'],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});if(_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')]===_0xa2ba('0x15')){_0x4a9323['extensions']['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x17')+_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId'],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}else if(_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')]===_0xa2ba('0x18')){if(_0x4a9323[_0xa2ba('0x10')]){_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':'Set','appdata':_0xa2ba('0x1b')+(_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x1c')]?'${EXTEN:'+_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x1c')]+'}':_0xa2ba('0x1d')),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x17')+_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});var _0x1ad7e3=_0x4a9323[_0xa2ba('0xf')]++;_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1ad7e3+0x2)+_0xa2ba('0x1f')+(_0x1ad7e3+0x1)+')','context':_0x416a5b[_0x4a988d][0x0]['context'],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x1ad7e3,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});if(_0x4a9323[_0xa2ba('0x10')]){_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0]['type'],'app':_0xa2ba('0x16'),'appdata':_0x4a9323[_0xa2ba('0x10')]['cutdigits']?_0xa2ba('0x20')+_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x416a5b[_0x4a988d][0x0]['context'],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0]['type'],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x21')+_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0]['exten'],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});if(_0x4a9323['extension']&&_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0xe')](_0xa2ba('0x22'))&&_0x4a9323['extension']['recordingFormat']!=='none'){_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0]['type'],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x23')+_0x4a9323[_0xa2ba('0x10')][_0xa2ba('0x22')]||_0xa2ba('0x24'),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323['priority']++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});}}_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x25'),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});_0x4a9323[_0xa2ba('0x19')]['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x416a5b[_0x4a988d][0x0]['context'],'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});_0x4a9323['extensions']['push']({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x26'),'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'exten':_0x416a5b[_0x4a988d][0x0]['exten'],'priority':_0x4a9323[_0xa2ba('0xf')]++,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});for(var _0xa99ec8=0x0,_0x389134=0x0;_0xa99ec8<_0x416a5b[_0x4a988d][_0xa2ba('0x27')];_0xa99ec8+=0x1,_0x389134=0x0){var _0x3b52b7=_0x416a5b[_0x4a988d][_0xa99ec8];if(_0x3b52b7['type']){_0x3b52b7[_0xa2ba('0x11')]=_0x3b52b7[_0xa2ba('0x11')]['toLowerCase']();}var _0x11ea26=[];var _0x2489d8=[];delete _0x3b52b7['id'];delete _0x3b52b7['createdAt'];delete _0x3b52b7[_0xa2ba('0x28')];var _0x5b6976=_0x3b52b7[_0xa2ba('0x29')]!==_0xa2ba('0x2a')?[_0x3b52b7[_0xa2ba('0x29')]]:_0x3b52b7[_0xa2ba('0x2b')]?_[_0xa2ba('0x8')](_[_0xa2ba('0xb')](_0x4a9323['intervals'],{'IntervalId':_0x3b52b7[_0xa2ba('0x2b')]}),_0xa2ba('0x29')):[];if(_0x3b52b7[_0xa2ba('0xe')]('tag')){if(_0x3b52b7['tag']&&_0x3b52b7[_0xa2ba('0x2c')]!=='--'){_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7[_0xa2ba('0x11')],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x2d')+_0x3b52b7[_0xa2ba('0x2c')],'context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}}if(_0x3b52b7[_0xa2ba('0x11')]===_0xa2ba('0x18')&&_0x3b52b7['hasOwnProperty']('callerID')){if(_0x3b52b7[_0xa2ba('0x2e')]){_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':'ExecIf','appdata':_0xa2ba('0x2f')+_0x3b52b7[_0xa2ba('0x2e')]+')','context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7['exten'],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7['VoiceExtensionId']});}else{_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':_0xa2ba('0x1e'),'appdata':_0xa2ba('0x30'),'context':_0x3b52b7['context'],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323['priority']+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}}if(_0x3b52b7[_0xa2ba('0xe')](_0xa2ba('0x31'))){if(_0x1b4a77[_0xa2ba('0x32')](_0x3b52b7[_0xa2ba('0x33')]['toLowerCase']())>=0x0&&_0x3b52b7[_0xa2ba('0x34')]!==_0xa2ba('0x35')){if(_0x3b52b7[_0xa2ba('0x31')]){_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':_0xa2ba('0x1e'),'appdata':_0xa2ba('0x36'),'context':_0x3b52b7['context'],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':_0xa2ba('0x16'),'appdata':_0xa2ba('0x37'),'context':_0x3b52b7['context'],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}else{_0x11ea26['push']({'type':_0x3b52b7[_0xa2ba('0x11')],'app':_0xa2ba('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7['VoiceExtensionId']});_0x11ea26[_0xa2ba('0x1a')]({'type':_0x3b52b7['type'],'app':'Set','appdata':_0xa2ba('0x38'),'context':_0x3b52b7[_0xa2ba('0x13')],'exten':_0x3b52b7[_0xa2ba('0x9')],'priority':_0x5b6976[_0xa2ba('0x27')]+_0x4a9323[_0xa2ba('0xf')]+_0x389134++,'VoiceExtensionId':_0x3b52b7[_0xa2ba('0x14')]});}}}for(var _0x4f4c6f=0x0;_0x4f4c6f<_0x5b6976[_0xa2ba('0x27')];_0x4f4c6f+=0x1){var _0x3f6426=_0x4a9323[_0xa2ba('0xf')]+_0x5b6976['length'];var _0x14c4a=_0x4f4c6f===_0x5b6976[_0xa2ba('0x27')]-0x1?_0x4a9323['priority']+_0x11ea26[_0xa2ba('0x27')]+_0x2489d8[_0xa2ba('0x27')]+0x2:_0x4a9323[_0xa2ba('0xf')]+_0x4f4c6f+0x1;_0x11ea26[_0xa2ba('0x39')](_0x4f4c6f,0x0,{'type':_0x3b52b7[_0xa2ba('0x11')],'app':_0xa2ba('0x3a'),'appdata':_0x5b6976[_0x4f4c6f]+'?'+_0x3b52b7[_0xa2ba('0x13')]+_0xa2ba('0x3b')+_0x3f6426+':'+_0x3b52b7['context']+_0xa2ba('0x3b')+_0x14c4a,'exten':_0x3b52b7[_0xa2ba('0x9')],'context':_0x3b52b7[_0xa2ba('0x13')],'priority':_0x4a9323[_0xa2ba('0xf')]+_0x4f4c6f,'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']});}_0x3b52b7['priority']=_0x11ea26[_0xa2ba('0x27')]?_['last'](_0x11ea26)[_0xa2ba('0xf')]+0x1:_0x4a9323['priority'];_0x4a9323['priority']=(_0x2489d8['length']?_[_0xa2ba('0x3c')](_0x2489d8)['priority']:_0x3b52b7[_0xa2ba('0xf')])+0x1;_0x4a9323[_0xa2ba('0x19')]=_['concat'](_0x4a9323[_0xa2ba('0x19')],_0x11ea26,[_0x3b52b7],_0x2489d8);}_0x4a9323[_0xa2ba('0x19')][_0xa2ba('0x1a')]({'type':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x11')],'app':_0xa2ba('0x3d'),'exten':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x9')],'context':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x13')],'priority':_0x4a9323['priority'],'VoiceExtensionId':_0x416a5b[_0x4a988d][0x0][_0xa2ba('0x14')]});_0x5ba820[_0xa2ba('0x1a')](_0x416a5b[_0x4a988d][0x0]['VoiceExtensionId']);_0x50588d=_['concat'](_0x50588d,_0x4a9323[_0xa2ba('0x19')]);}}return _0xcaff50[_0xa2ba('0x3e')](function(_0x3dd868){return _0xcaff50[_0xa2ba('0x1')]['VoiceExtension'][_0xa2ba('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x5ba820}},'transaction':_0x3dd868})[_0xa2ba('0x4')](function(_0x35fb57){return _0xcaff50['models']['VoiceExtension'][_0xa2ba('0x40')](_[_0xa2ba('0x41')](_0x50588d,_0xa2ba('0xf')),{'transaction':_0x3dd868});});});})['catch'](function(_0x4cf0be){console['error'](_0x4cf0be);});}exports[_0xa2ba('0x42')]=rewrite; \ No newline at end of file +var _0x8922=['XCALLY-MOTION-PROGRESS=1','last','Hangup','concat','transaction','destroy','sortBy','catch','lodash','findAll','then','intervals','models','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','*,*,*,*','interval','IntervalId','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x5acc61,_0x1e30a5){var _0x3d77fb=function(_0x278e28){while(--_0x278e28){_0x5acc61['push'](_0x5acc61['shift']());}};_0x3d77fb(++_0x1e30a5);}(_0x8922,0xcb));var _0x2892=function(_0x16d017,_0x206bd4){_0x16d017=_0x16d017-0x0;var _0xb224d3=_0x8922[_0x16d017];return _0xb224d3;};'use strict';var _=require(_0x2892('0x0'));var util=require('util');function rewrite(_0x53603e,_0x44435d){var _0x2deb67=this;return _0x53603e['models']['Interval'][_0x2892('0x1')]({'raw':!![]})[_0x2892('0x2')](function(_0x56c77f){_0x2deb67[_0x2892('0x3')]=_0x56c77f;return _0x53603e[_0x2892('0x4')][_0x2892('0x5')][_0x2892('0x1')]({'where':{'IntervalId':_0x44435d['IntervalId']},'raw':!![]});})[_0x2892('0x2')](function(_0x3c3c87){return _0x53603e[_0x2892('0x4')][_0x2892('0x5')][_0x2892('0x1')]({'where':{'exten':{'$in':_['uniq'](_[_0x2892('0x6')](_0x3c3c87,_0x2892('0x7')))}},'order':[{'raw':_0x2892('0x8')}],'raw':!![]});})[_0x2892('0x2')](function(_0x5bdc6c){var _0x21e6e2=_[_0x2892('0x9')](_0x5bdc6c,{'priority':'1'});var _0x46bed1=_[_0x2892('0x9')](_0x5bdc6c,{'isApp':0x1});var _0x15d4fc=_['groupBy'](_0x46bed1,_0x2892('0x7'));var _0x9f4a2f=[_0x2892('0xa'),'playback'];var _0x397baa=[];var _0x22f1e6=[];for(var _0x5e2fb2 in _0x15d4fc){if(_0x15d4fc['hasOwnProperty'](_0x5e2fb2)){_0x2deb67[_0x2892('0xb')]=0x2;_0x2deb67[_0x2892('0xc')]=[];_0x2deb67[_0x2892('0xd')]=_[_0x2892('0xe')](_0x21e6e2,{'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')]});_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':util[_0x2892('0x12')](_0x2892('0x13'),_0x15d4fc[_0x5e2fb2][0x0]['type']),'context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});if(_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')]==='inbound'){_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':'Set','appdata':_0x2892('0x16')+_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')],'context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});}else if(_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')]===_0x2892('0x17')){if(_0x2deb67[_0x2892('0xd')]){_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':'Set','appdata':_0x2892('0x18')+(_0x2deb67[_0x2892('0xd')][_0x2892('0x19')]?_0x2892('0x1a')+_0x2deb67[_0x2892('0xd')][_0x2892('0x19')]+'}':_0x2892('0x1b')),'context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0]['exten'],'priority':_0x2deb67['priority']++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});}_0x2deb67['extensions'][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':_0x2892('0x16')+_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')],'context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0]['exten'],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});var _0x1db463=_0x2deb67['priority']++;_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0]['type'],'app':_0x2892('0x1c'),'appdata':_0x2892('0x1d')+(_0x1db463+0x2)+_0x2892('0x1e')+(_0x1db463+0x1)+')','context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x1db463,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});if(_0x2deb67[_0x2892('0xd')]){_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':_0x2deb67[_0x2892('0xd')]['cutdigits']?_0x2892('0x1f')+_0x2deb67[_0x2892('0xd')][_0x2892('0x19')]+'}':_0x2892('0x20'),'context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0]['VoiceExtensionId']});}_0x2deb67['extensions'][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':'outboundrouteid='+_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')],'context':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x14')],'exten':_0x15d4fc[_0x5e2fb2][0x0]['exten'],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0]['VoiceExtensionId']});if(_0x2deb67[_0x2892('0xd')]&&_0x2deb67['extension'][_0x2892('0x21')](_0x2892('0x22'))&&_0x2deb67[_0x2892('0xd')][_0x2892('0x22')]!==_0x2892('0x23')){_0x2deb67['extensions'][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0]['type'],'app':_0x2892('0x11'),'appdata':_0x2892('0x24'),'context':_0x15d4fc[_0x5e2fb2][0x0]['context'],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0]['VoiceExtensionId']});_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0]['type'],'app':_0x2892('0x11'),'appdata':_0x2892('0x25')+_0x2deb67[_0x2892('0xd')][_0x2892('0x22')]||_0x2892('0x26'),'context':_0x15d4fc[_0x5e2fb2][0x0]['context'],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});}}_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':_0x2892('0x27'),'context':_0x15d4fc[_0x5e2fb2][0x0]['context'],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67['priority']++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});_0x2deb67['extensions'][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0]['type'],'app':_0x2892('0x11'),'appdata':_0x2892('0x28'),'context':_0x15d4fc[_0x5e2fb2][0x0]['context'],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0]['VoiceExtensionId']});_0x2deb67[_0x2892('0xc')][_0x2892('0xf')]({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':_0x2892('0x29'),'context':_0x15d4fc[_0x5e2fb2][0x0]['context'],'exten':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x7')],'priority':_0x2deb67[_0x2892('0xb')]++,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});for(var _0x3730ed=0x0,_0x403e44=0x0;_0x3730ed<_0x15d4fc[_0x5e2fb2][_0x2892('0x2a')];_0x3730ed+=0x1,_0x403e44=0x0){var _0x36faa6=_0x15d4fc[_0x5e2fb2][_0x3730ed];if(_0x36faa6['type']){_0x36faa6[_0x2892('0x10')]=_0x36faa6['type']['toLowerCase']();}var _0x37aa3d=[];var _0x3af2ad=[];delete _0x36faa6['id'];delete _0x36faa6['createdAt'];delete _0x36faa6['updatedAt'];var _0xb0fde8=_0x36faa6['interval']!==_0x2892('0x2b')?[_0x36faa6[_0x2892('0x2c')]]:_0x36faa6[_0x2892('0x2d')]?_['map'](_[_0x2892('0x9')](_0x2deb67[_0x2892('0x3')],{'IntervalId':_0x36faa6['IntervalId']}),_0x2892('0x2c')):[];if(_0x36faa6[_0x2892('0x21')](_0x2892('0x2e'))){if(_0x36faa6[_0x2892('0x2e')]&&_0x36faa6[_0x2892('0x2e')]!=='--'){_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6[_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':'CDR(tag)='+_0x36faa6[_0x2892('0x2e')],'context':_0x36faa6[_0x2892('0x14')],'exten':_0x36faa6[_0x2892('0x7')],'priority':_0xb0fde8[_0x2892('0x2a')]+_0x2deb67[_0x2892('0xb')]+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});}}if(_0x36faa6[_0x2892('0x10')]===_0x2892('0x17')&&_0x36faa6[_0x2892('0x21')](_0x2892('0x2f'))){if(_0x36faa6[_0x2892('0x2f')]){_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6[_0x2892('0x10')],'app':_0x2892('0x1c'),'appdata':_0x2892('0x30')+_0x36faa6['callerID']+')','context':_0x36faa6[_0x2892('0x14')],'exten':_0x36faa6[_0x2892('0x7')],'priority':_0xb0fde8[_0x2892('0x2a')]+_0x2deb67[_0x2892('0xb')]+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});}else{_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6[_0x2892('0x10')],'app':'ExecIf','appdata':_0x2892('0x31'),'context':_0x36faa6[_0x2892('0x14')],'exten':_0x36faa6[_0x2892('0x7')],'priority':_0xb0fde8[_0x2892('0x2a')]+_0x2deb67[_0x2892('0xb')]+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});}}if(_0x36faa6[_0x2892('0x21')](_0x2892('0x32'))){if(_0x9f4a2f[_0x2892('0x33')](_0x36faa6[_0x2892('0x34')][_0x2892('0x35')]())>=0x0&&_0x36faa6['appType']!==_0x2892('0x36')){if(_0x36faa6[_0x2892('0x32')]){_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6[_0x2892('0x10')],'app':_0x2892('0x1c'),'appdata':_0x2892('0x37'),'context':_0x36faa6['context'],'exten':_0x36faa6['exten'],'priority':_0xb0fde8[_0x2892('0x2a')]+_0x2deb67[_0x2892('0xb')]+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6[_0x2892('0x10')],'app':_0x2892('0x11'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x36faa6['context'],'exten':_0x36faa6[_0x2892('0x7')],'priority':_0xb0fde8['length']+_0x2deb67[_0x2892('0xb')]+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});}else{_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6[_0x2892('0x10')],'app':_0x2892('0x1c'),'appdata':_0x2892('0x38'),'context':_0x36faa6[_0x2892('0x14')],'exten':_0x36faa6['exten'],'priority':_0xb0fde8[_0x2892('0x2a')]+_0x2deb67['priority']+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});_0x37aa3d[_0x2892('0xf')]({'type':_0x36faa6['type'],'app':_0x2892('0x11'),'appdata':_0x2892('0x39'),'context':_0x36faa6[_0x2892('0x14')],'exten':_0x36faa6[_0x2892('0x7')],'priority':_0xb0fde8[_0x2892('0x2a')]+_0x2deb67['priority']+_0x403e44++,'VoiceExtensionId':_0x36faa6[_0x2892('0x15')]});}}}for(var _0x1038a6=0x0;_0x1038a6<_0xb0fde8[_0x2892('0x2a')];_0x1038a6+=0x1){var _0x3b865d=_0x2deb67[_0x2892('0xb')]+_0xb0fde8[_0x2892('0x2a')];var _0x580acf=_0x1038a6===_0xb0fde8['length']-0x1?_0x2deb67[_0x2892('0xb')]+_0x37aa3d[_0x2892('0x2a')]+_0x3af2ad[_0x2892('0x2a')]+0x2:_0x2deb67[_0x2892('0xb')]+_0x1038a6+0x1;_0x37aa3d['splice'](_0x1038a6,0x0,{'type':_0x36faa6['type'],'app':'GotoIfTime','appdata':_0xb0fde8[_0x1038a6]+'?'+_0x36faa6[_0x2892('0x14')]+',${EXTEN},'+_0x3b865d+':'+_0x36faa6[_0x2892('0x14')]+',${EXTEN},'+_0x580acf,'exten':_0x36faa6[_0x2892('0x7')],'context':_0x36faa6['context'],'priority':_0x2deb67['priority']+_0x1038a6,'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});}_0x36faa6[_0x2892('0xb')]=_0x37aa3d[_0x2892('0x2a')]?_['last'](_0x37aa3d)[_0x2892('0xb')]+0x1:_0x2deb67[_0x2892('0xb')];_0x2deb67[_0x2892('0xb')]=(_0x3af2ad[_0x2892('0x2a')]?_[_0x2892('0x3a')](_0x3af2ad)[_0x2892('0xb')]:_0x36faa6[_0x2892('0xb')])+0x1;_0x2deb67[_0x2892('0xc')]=_['concat'](_0x2deb67[_0x2892('0xc')],_0x37aa3d,[_0x36faa6],_0x3af2ad);}_0x2deb67[_0x2892('0xc')]['push']({'type':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x10')],'app':_0x2892('0x3b'),'exten':_0x15d4fc[_0x5e2fb2][0x0]['exten'],'context':_0x15d4fc[_0x5e2fb2][0x0]['context'],'priority':_0x2deb67[_0x2892('0xb')],'VoiceExtensionId':_0x15d4fc[_0x5e2fb2][0x0][_0x2892('0x15')]});_0x397baa[_0x2892('0xf')](_0x15d4fc[_0x5e2fb2][0x0]['VoiceExtensionId']);_0x22f1e6=_[_0x2892('0x3c')](_0x22f1e6,_0x2deb67[_0x2892('0xc')]);}}return _0x53603e[_0x2892('0x3d')](function(_0x522868){return _0x53603e[_0x2892('0x4')][_0x2892('0x5')][_0x2892('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x397baa}},'transaction':_0x522868})['then'](function(_0xf4f624){return _0x53603e[_0x2892('0x4')][_0x2892('0x5')]['bulkCreate'](_[_0x2892('0x3f')](_0x22f1e6,_0x2892('0xb')),{'transaction':_0x522868});});});})[_0x2892('0x40')](function(_0x3e26b3){console['error'](_0x3e26b3);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 9cb90f0..2144c48 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 _0xd4f0=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','str','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','catch','all','BlackLists','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','finally','contact:csv_','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','firstName','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','message','stringify','cmContact','checkHopper','inspect','insert'];(function(_0x37ef63,_0x52d21b){var _0x410a2e=function(_0x5cc1f4){while(--_0x5cc1f4){_0x37ef63['push'](_0x37ef63['shift']());}};_0x410a2e(++_0x52d21b);}(_0xd4f0,0xa0));var _0x0d4f=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xd4f0[_0x330414];return _0x99dbff;};'use strict';var BPromise=require(_0x0d4f('0x0'));var util=require('util');var _=require(_0x0d4f('0x1'));var fs=require('fs');var squel=require(_0x0d4f('0x2'));var Papa=require('papaparse');var Redis=require(_0x0d4f('0x3'));var db=require(_0x0d4f('0x4'))['db'];var config=require(_0x0d4f('0x5'));var logger=require(_0x0d4f('0x6'))(_0x0d4f('0x7'));config[_0x0d4f('0x8')]=_[_0x0d4f('0x9')](config[_0x0d4f('0x8')],{'host':_0x0d4f('0xa'),'port':0x18eb});var socket=require(_0x0d4f('0xb'))(new Redis(config[_0x0d4f('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x0d4f('0xc')](socket);try{if(!process[_0x0d4f('0xd')][0x2]||process[_0x0d4f('0xd')][0x2]==='undefined'||process[_0x0d4f('0xd')][0x2]===_0x0d4f('0xe')){throw new Error(_0x0d4f('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0x0d4f('0xd')][0x3]||process[_0x0d4f('0xd')][0x3]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x3]===_0x0d4f('0xe')||!process[_0x0d4f('0xd')][0x4]||process[_0x0d4f('0xd')][0x4]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x4]===_0x0d4f('0xe')){throw new Error(_0x0d4f('0x11'));}var FIELDS=_['zipObject'](process[_0x0d4f('0xd')][0x3]['split'](','),process['argv'][0x4][_0x0d4f('0x12')](','));if(!process['argv'][0x5]||process[_0x0d4f('0xd')][0x5]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x5]==='null'){throw new Error(_0x0d4f('0x13'));}var LISTID=process[_0x0d4f('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x0d4f('0xd')][0x6]!==_0x0d4f('0x10')&&process['argv'][0x6]!==_0x0d4f('0xe')?process[_0x0d4f('0xd')][0x6]:null;var DUPLICATES=process[_0x0d4f('0xd')][0x7]&&process[_0x0d4f('0xd')][0x7]!=='undefined'&&process[_0x0d4f('0xd')][0x7]!==_0x0d4f('0xe')?process[_0x0d4f('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x0d4f('0xd')][0x8]===_0x0d4f('0x10')||process[_0x0d4f('0xd')][0x8]===_0x0d4f('0xe')){throw new Error(_0x0d4f('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d4f('0xd')][0x8];}catch(_0x37c7a4){logger[_0x0d4f('0x15')](_0x37c7a4);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(_0x25da9f,_0x515af5,_0x55f9b5,_0x1f5f9c){var _0x2575d2={'message':_0x515af5};_0x2575d2[_0x25da9f]=!![];if(_0x55f9b5){_0x2575d2[_0x0d4f('0x16')]=_0x55f9b5;}if(_0x1f5f9c){_0x2575d2[_0x0d4f('0x17')]=_0x1f5f9c;}return _0x2575d2;}function isEmail(_0x40aa8c){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))*$/[_0x0d4f('0x18')](_0x40aa8c);}function checkRow(_0x3b487f,_0x4e22af,_0x156e05){return new BPromise(function(_0x1d97c4,_0x15579c){if(_[_0x0d4f('0x19')](_0x3b487f)){return _0x15579c(handleCheckRowError('error',_0x0d4f('0x1a'),null,_0x156e05));}if(_0x3b487f['errors']&&_0x3b487f[_0x0d4f('0x1b')][_0x0d4f('0x1c')]){var _0x1c40d6=_['map'](_0x3b487f['errors'],'message')[_0x0d4f('0x1d')](';');return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),_0x1c40d6,null,_0x156e05));}var _0x55e4eb={};for(var _0x245bbd in FIELDS){if(FIELDS[_0x0d4f('0x1e')](_0x245bbd)&&FIELDS[_0x245bbd]){_0x55e4eb[_0x245bbd]=_0x3b487f['data'][0x0][FIELDS[_0x245bbd]]||_0x3b487f['data'][0x0]['\ufeff'+FIELDS[_0x245bbd]];}}if(!_0x55e4eb[_0x0d4f('0x1f')]){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),'firstName\x20not\x20specified!',null,_0x156e05));}if(!_0x55e4eb['phone']){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),_0x0d4f('0x20'),null,_0x156e05));}if(_0x55e4eb[_0x0d4f('0x21')]){var _0x7d4d38=moment(_0x55e4eb['birthDate'],'YYYY-MM-DD');if(!_0x7d4d38['isValid']()){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),_0x0d4f('0x22'),null,_0x156e05));}}if(_0x55e4eb[_0x0d4f('0x23')]){if(!isEmail(_0x55e4eb['email'])){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x156e05));}}_0x55e4eb['ListId']=LISTID;_0x55e4eb[_0x0d4f('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d4f('0x1c')]&&_0x4e22af){var _0x358c93={};for(var _0x51d624=0x0,_0x256b0e=DUPLICATES[_0x0d4f('0x1c')];_0x51d624<_0x256b0e;_0x51d624+=0x1){_0x358c93[DUPLICATES[_0x51d624]]=_0x55e4eb[DUPLICATES[_0x51d624]];}var _0x5d6002=_[_0x0d4f('0x25')](_0x4e22af,_0x358c93);if(_0x5d6002){return _0x15579c(handleCheckRowError(_0x0d4f('0x26'),_0x0d4f('0x27'),_0x5d6002,_0x156e05));}}return db[_0x0d4f('0x28')][_0x0d4f('0x29')](_0x55e4eb,{'raw':!![],'hooks':![],'fields':_['keys'](_0x55e4eb)})[_0x0d4f('0x2a')](function(_0x7ba4f6){if(DUPLICATES&&DUPLICATES[_0x0d4f('0x1c')]&&_0x4e22af){_0x4e22af[_0x0d4f('0x2b')](_['pick'](_0x55e4eb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x7ba4f6['id'];return _0x1d97c4();})['catch'](function(_0x3822c7){return _0x15579c(handleCheckRowError(_0x0d4f('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x3822c7[_0x0d4f('0x2c')]||JSON[_0x0d4f('0x2d')](_0x3822c7)),null,_0x156e05));});});}function checkHopper(){function _0x5582e7(){return function(_0x1e15e5){logger[_0x0d4f('0x15')](_0x0d4f('0x2e'),_0x0d4f('0x2f'),util[_0x0d4f('0x30')](_0x1e15e5,{'showHidden':![],'depth':null}));};}var _0x311cd2=function(_0xac522,_0xbdbb98){var _0x26eba8=squel[_0x0d4f('0x31')]()[_0x0d4f('0x32')](_0x0d4f('0x33'))[_0x0d4f('0x34')]([_0x0d4f('0x35'),_0x0d4f('0x36'),_0x0d4f('0x37'),_0x0d4f('0x38'),_0xbdbb98,_0x0d4f('0x39'),_0x0d4f('0x3a')],squel['select']()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')]('NOW()',_0x0d4f('0x36'))['field']('id','ContactId')[_0x0d4f('0x3b')](LISTID['toString'](),_0x0d4f('0x38'))[_0x0d4f('0x3b')](_0xac522['id']['toString'](),_0xbdbb98)[_0x0d4f('0x3b')]('NOW()','createdAt')[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')](_0x0d4f('0x3e'))[_0x0d4f('0x3f')](_0x0d4f('0x40'))[_0x0d4f('0x3f')]('ListId\x20=\x20?',LISTID[_0x0d4f('0x41')]())[_0x0d4f('0x3f')](_0x0d4f('0x42'))[_0x0d4f('0x3f')](_0x0d4f('0x43'),squel['select']()[_0x0d4f('0x3b')](_0x0d4f('0x35'))['from'](_0x0d4f('0x33'))[_0x0d4f('0x3f')](_0xbdbb98+_0x0d4f('0x44'),_0xac522['id'][_0x0d4f('0x41')]())))[_0x0d4f('0x41')]();return _0x26eba8;};var _0x153471=function(_0x71d853,_0x727311){var _0x55a300=squel[_0x0d4f('0x31')]()[_0x0d4f('0x32')]('cm_hopper')[_0x0d4f('0x34')](['phone','scheduledAt',_0x0d4f('0x37'),'ListId',_0x727311,_0x0d4f('0x39'),'updatedAt'],squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x36'))[_0x0d4f('0x3b')]('id',_0x0d4f('0x37'))[_0x0d4f('0x3b')](LISTID[_0x0d4f('0x41')](),_0x0d4f('0x38'))[_0x0d4f('0x3b')](_0x71d853['id'][_0x0d4f('0x41')](),_0x727311)[_0x0d4f('0x3b')]('NOW()',_0x0d4f('0x39'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')](_0x0d4f('0x3e'))[_0x0d4f('0x3f')](_0x0d4f('0x40'))[_0x0d4f('0x3f')](_0x0d4f('0x46'),LISTID[_0x0d4f('0x41')]())[_0x0d4f('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x0d4f('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x0d4f('0x43'),squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')]('calleridnum')['from']('cm_hopper_final')['where'](_0x727311+_0x0d4f('0x44'),_0x71d853['id']['toString']()))[_0x0d4f('0x3f')](_0x0d4f('0x43'),squel['select']()['field'](_0x0d4f('0x35'))[_0x0d4f('0x3d')](_0x0d4f('0x33'))['where'](_0x727311+_0x0d4f('0x44'),_0x71d853['id'][_0x0d4f('0x41')]())))[_0x0d4f('0x41')]();return _0x55a300;};function _0x3f75be(_0x5a0f25,_0x3ca778){var _0x5e34f6=squel[_0x0d4f('0x31')]()[_0x0d4f('0x32')](_0x0d4f('0x33'))[_0x0d4f('0x34')]([_0x0d4f('0x35'),_0x0d4f('0x36'),'ContactId','ListId',_0x3ca778,_0x0d4f('0x39'),_0x0d4f('0x3a')],squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')]('NOW()',_0x0d4f('0x36'))['field']('id','ContactId')[_0x0d4f('0x3b')](LISTID[_0x0d4f('0x41')](),'ListId')['field'](_0x5a0f25['id'][_0x0d4f('0x41')](),_0x3ca778)[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x39'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')]('cm_contacts')[_0x0d4f('0x3f')]('deletedAt\x20IS\x20NULL')[_0x0d4f('0x3f')]('ListId\x20=\x20?',LISTID[_0x0d4f('0x41')]())[_0x0d4f('0x3f')](_0x0d4f('0x47'),squel['str'](hopperContacts))[_0x0d4f('0x3f')](_0x0d4f('0x42')))[_0x0d4f('0x41')]();return _0x5e34f6;}function _0x4224dc(_0x4f2c7b,_0x255c93){var _0x2109c2=squel['insert']()[_0x0d4f('0x32')](_0x0d4f('0x48'))[_0x0d4f('0x34')]([_0x0d4f('0x35'),_0x0d4f('0x37'),_0x0d4f('0x38'),_0x255c93,_0x0d4f('0x39'),'updatedAt'],squel[_0x0d4f('0x45')]()[_0x0d4f('0x3b')](_0x0d4f('0x35'),_0x0d4f('0x35'))[_0x0d4f('0x3b')]('id',_0x0d4f('0x37'))[_0x0d4f('0x3b')](LISTID[_0x0d4f('0x41')](),_0x0d4f('0x38'))[_0x0d4f('0x3b')](_0x4f2c7b['id']['toString'](),_0x255c93)['field']('NOW()',_0x0d4f('0x39'))[_0x0d4f('0x3b')](_0x0d4f('0x3c'),_0x0d4f('0x3a'))[_0x0d4f('0x3d')](_0x0d4f('0x3e'))[_0x0d4f('0x3f')](_0x0d4f('0x40'))['where'](_0x0d4f('0x46'),LISTID['toString']())[_0x0d4f('0x3f')]('id\x20IN\x20?',squel[_0x0d4f('0x49')](hopperContacts))[_0x0d4f('0x3f')](_0x0d4f('0x42')))[_0x0d4f('0x41')]();return _0x2109c2;}return db[_0x0d4f('0x4a')][_0x0d4f('0x4b')]({'where':{'type':_0x0d4f('0x4c')},'attributes':['id',_0x0d4f('0x4d')],'include':[{'model':db[_0x0d4f('0x4e')],'as':_0x0d4f('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x2991e1){var _0x4534c0=[];if(_0x2991e1){var _0x1d77d9;for(var _0x111fbb=0x0,_0x1ccf76;_0x111fbb<_0x2991e1['length'];_0x111fbb+=0x1){_0x1ccf76=_0x2991e1[_0x111fbb][_0x0d4f('0x50')]({'plain':!![]});switch(_0x1ccf76['dialCheckDuplicateType']){case _0x0d4f('0x51'):_0x4534c0[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x153471(_0x1ccf76,_0x0d4f('0x54')))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;case'onlyIfOpen':_0x4534c0['push'](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x311cd2(_0x1ccf76,_0x0d4f('0x54')))['then'](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;default:_0x4534c0[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x3f75be(_0x1ccf76,_0x0d4f('0x54')))['then'](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}}return _0x4534c0;})[_0x0d4f('0x56')]()[_0x0d4f('0x2a')](function(){return db[_0x0d4f('0x4a')][_0x0d4f('0x4b')]({'where':{'type':_0x0d4f('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0d4f('0x57'),'where':{'id':LISTID}}]})[_0x0d4f('0x2a')](function(_0x2c4ca1){var _0xf5cbd3=[];if(_0x2c4ca1){var _0x132ef7;for(var _0x4cad6e=0x0,_0x695522;_0x4cad6e<_0x2c4ca1[_0x0d4f('0x1c')];_0x4cad6e+=0x1){_0x695522=_0x2c4ca1[_0x4cad6e]['get']({'plain':!![]});_0xf5cbd3[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x4224dc(_0x695522,_0x0d4f('0x54')))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}return _0xf5cbd3;})['all']();})['then'](function(){return db[_0x0d4f('0x58')][_0x0d4f('0x4b')]({'attributes':['id',_0x0d4f('0x4d')],'include':[{'model':db[_0x0d4f('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x0d4f('0x2a')](function(_0x194cd8){var _0x5f4ae4=[];if(_0x194cd8){for(var _0x4435bc=0x0,_0x509fbc;_0x4435bc<_0x194cd8['length'];_0x4435bc+=0x1){_0x509fbc=_0x194cd8[_0x4435bc][_0x0d4f('0x50')]({'plain':!![]});switch(_0x509fbc[_0x0d4f('0x4d')]){case _0x0d4f('0x51'):_0x5f4ae4[_0x0d4f('0x2b')](db[_0x0d4f('0x52')]['query'](_0x153471(_0x509fbc,_0x0d4f('0x59')))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;case _0x0d4f('0x5a'):_0x5f4ae4[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x311cd2(_0x509fbc,'CampaignId'))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));break;default:_0x5f4ae4['push'](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x3f75be(_0x509fbc,'CampaignId'))[_0x0d4f('0x2a')](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}}return _0x5f4ae4;})['all']();})[_0x0d4f('0x2a')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x0d4f('0x4e')],'as':_0x0d4f('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x3e122b){var _0x251f57=[];if(_0x3e122b){for(var _0x3f0c45=0x0,_0x168b94;_0x3f0c45<_0x3e122b['length'];_0x3f0c45+=0x1){_0x168b94=_0x3e122b[_0x3f0c45][_0x0d4f('0x50')]({'plain':!![]});_0x251f57[_0x0d4f('0x2b')](db[_0x0d4f('0x52')][_0x0d4f('0x53')](_0x4224dc(_0x168b94,'CampaignId'))['then'](function(){})[_0x0d4f('0x55')](_0x5582e7()));}}return _0x251f57;})[_0x0d4f('0x56')]();})[_0x0d4f('0x55')](function(_0x207014){logger[_0x0d4f('0x15')](_0x0d4f('0x5b'),'generalCheckHopper',_0x207014[_0x0d4f('0x2c')]);});}var processPromises=function(_0x26f33c){return BPromise[_0x0d4f('0x56')](promises)['then'](function(_0x15c343){})[_0x0d4f('0x55')](function(_0x2ab181){logger[_0x0d4f('0x15')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x2ab181));})[_0x0d4f('0x5c')](function(){socket['emit'](_0x0d4f('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x26f33c){return _0x26f33c['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x0d4f('0x5e')](_0x0d4f('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d4f('0x5f')](FILEPATH);}catch(_0x2c6121){logger[_0x0d4f('0x15')](_0x0d4f('0x60'),JSON[_0x0d4f('0x2d')](_0x2c6121));}finally{process[_0x0d4f('0x61')](0x0);}});};process['on'](_0x0d4f('0x62'),function(){logger[_0x0d4f('0x63')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x0d4f('0x64')]()[_0x0d4f('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d4f('0x12')](',');return db[_0x0d4f('0x28')][_0x0d4f('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x44f39a){var _0x30e893=fs[_0x0d4f('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d4f('0x66')](_0x30e893,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4b2a24,_0x2bd718){total+=0x1;var _0x2914da=total;promises[_0x0d4f('0x2b')](checkRow(_0x4b2a24,_0x44f39a,_0x2914da)[_0x0d4f('0x2a')](function(){success+=0x1;})['catch'](function(_0x21e82e){if(_0x21e82e['error']){errors+=0x1;delete _0x21e82e[_0x0d4f('0x15')];}else if(_0x21e82e[_0x0d4f('0x26')]){duplicates+=0x1;delete _0x21e82e[_0x0d4f('0x26')];}rows[_0x0d4f('0x2b')](_0x21e82e);}));if(total%0xc8===0x0){_0x2bd718['pause']();return processPromises(_0x2bd718);}},'complete':function(){return processPromises()[_0x0d4f('0x2a')](function(){logger[_0x0d4f('0x63')](_0x0d4f('0x67'));endCsv();});},'error':function(_0x2ab247,_0x2ab648){logger[_0x0d4f('0x63')](_0x0d4f('0x68'),JSON[_0x0d4f('0x2d')](_0x2ab247));endCsv();}});})[_0x0d4f('0x55')](function(_0x3adfde){logger[_0x0d4f('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0d4f('0x2d')](_0x3adfde));});}main(); \ No newline at end of file +var _0x7ba5=['insert','ContactId','select','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','\x20=\x20?','deletedAt\x20IS\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','into','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0x7ba5,0x1d1));var _0x57ba=function(_0x5b1608,_0x3018cf){_0x5b1608=_0x5b1608-0x0;var _0x4f1c84=_0x7ba5[_0x5b1608];return _0x4f1c84;};'use strict';var BPromise=require(_0x57ba('0x0'));var util=require(_0x57ba('0x1'));var _=require(_0x57ba('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x57ba('0x3'));var db=require(_0x57ba('0x4'))['db'];var config=require(_0x57ba('0x5'));var logger=require('../../../config/logger')('api');config[_0x57ba('0x6')]=_[_0x57ba('0x7')](config[_0x57ba('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x57ba('0x8'))(new Redis(config[_0x57ba('0x6')]));require(_0x57ba('0x9'))[_0x57ba('0xa')](socket);try{if(!process['argv'][0x2]||process[_0x57ba('0xb')][0x2]===_0x57ba('0xc')||process['argv'][0x2]==='null'){throw new Error(_0x57ba('0xd'));}var FILEPATH=process[_0x57ba('0xb')][0x2];if(!process['argv'][0x3]||process[_0x57ba('0xb')][0x3]===_0x57ba('0xc')||process[_0x57ba('0xb')][0x3]===_0x57ba('0xe')||!process[_0x57ba('0xb')][0x4]||process[_0x57ba('0xb')][0x4]==='undefined'||process[_0x57ba('0xb')][0x4]===_0x57ba('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x57ba('0xf')](process[_0x57ba('0xb')][0x3][_0x57ba('0x10')](','),process[_0x57ba('0xb')][0x4][_0x57ba('0x10')](','));if(!process[_0x57ba('0xb')][0x5]||process[_0x57ba('0xb')][0x5]==='undefined'||process[_0x57ba('0xb')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x57ba('0xb')][0x5];var COMPANYID=process[_0x57ba('0xb')][0x6]&&process[_0x57ba('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x57ba('0xe')?process[_0x57ba('0xb')][0x6]:null;var DUPLICATES=process[_0x57ba('0xb')][0x7]&&process[_0x57ba('0xb')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x57ba('0xe')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x57ba('0xb')][0x8]==='undefined'||process[_0x57ba('0xb')][0x8]===_0x57ba('0xe')){throw new Error(_0x57ba('0x11'));}var SOCKET_TIMESTAMP=process[_0x57ba('0xb')][0x8];}catch(_0x2e9061){logger[_0x57ba('0x12')](_0x2e9061);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(_0x60fe83,_0x371621,_0x4d0ce2,_0x4e9dc2){var _0x385a24={'message':_0x371621};_0x385a24[_0x60fe83]=!![];if(_0x4d0ce2){_0x385a24['contact']=_0x4d0ce2;}if(_0x4e9dc2){_0x385a24['index']=_0x4e9dc2;}return _0x385a24;}function isEmail(_0x471a65){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))*$/[_0x57ba('0x13')](_0x471a65);}function checkRow(_0x3027a3,_0x5c0d6f,_0x3d1938){return new BPromise(function(_0x3638c9,_0x35211a){if(_['isNil'](_0x3027a3)){return _0x35211a(handleCheckRowError('error',_0x57ba('0x14'),null,_0x3d1938));}if(_0x3027a3[_0x57ba('0x15')]&&_0x3027a3[_0x57ba('0x15')][_0x57ba('0x16')]){var _0xab7b89=_[_0x57ba('0x17')](_0x3027a3[_0x57ba('0x15')],_0x57ba('0x18'))['join'](';');return _0x35211a(handleCheckRowError(_0x57ba('0x12'),_0xab7b89,null,_0x3d1938));}var _0x1ac5f5={};for(var _0x41d442 in FIELDS){if(FIELDS[_0x57ba('0x19')](_0x41d442)&&FIELDS[_0x41d442]){_0x1ac5f5[_0x41d442]=_0x3027a3[_0x57ba('0x1a')][0x0][FIELDS[_0x41d442]]||_0x3027a3[_0x57ba('0x1a')][0x0]['\ufeff'+FIELDS[_0x41d442]];}}if(!_0x1ac5f5[_0x57ba('0x1b')]){return _0x35211a(handleCheckRowError('error',_0x57ba('0x1c'),null,_0x3d1938));}if(!_0x1ac5f5['phone']){return _0x35211a(handleCheckRowError(_0x57ba('0x12'),_0x57ba('0x1d'),null,_0x3d1938));}if(_0x1ac5f5[_0x57ba('0x1e')]){var _0x465803=moment(_0x1ac5f5[_0x57ba('0x1e')],_0x57ba('0x1f'));if(!_0x465803['isValid']()){return _0x35211a(handleCheckRowError('error',_0x57ba('0x20'),null,_0x3d1938));}}if(_0x1ac5f5[_0x57ba('0x21')]){if(!isEmail(_0x1ac5f5['email'])){return _0x35211a(handleCheckRowError(_0x57ba('0x12'),_0x57ba('0x22'),null,_0x3d1938));}}_0x1ac5f5[_0x57ba('0x23')]=LISTID;_0x1ac5f5[_0x57ba('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x57ba('0x16')]&&_0x5c0d6f){var _0x2bb6e3={};for(var _0x5db888=0x0,_0x504763=DUPLICATES[_0x57ba('0x16')];_0x5db888<_0x504763;_0x5db888+=0x1){_0x2bb6e3[DUPLICATES[_0x5db888]]=_0x1ac5f5[DUPLICATES[_0x5db888]];}var _0x5e8a38=_[_0x57ba('0x25')](_0x5c0d6f,_0x2bb6e3);if(_0x5e8a38){return _0x35211a(handleCheckRowError(_0x57ba('0x26'),_0x57ba('0x27'),_0x5e8a38,_0x3d1938));}}return db[_0x57ba('0x28')][_0x57ba('0x29')](_0x1ac5f5,{'raw':!![],'hooks':![],'fields':_[_0x57ba('0x2a')](_0x1ac5f5)})[_0x57ba('0x2b')](function(_0xa38bb6){if(DUPLICATES&&DUPLICATES['length']&&_0x5c0d6f){_0x5c0d6f['push'](_[_0x57ba('0x2c')](_0x1ac5f5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xa38bb6['id'];return _0x3638c9();})[_0x57ba('0x2d')](function(_0x180282){return _0x35211a(handleCheckRowError('error',_0x57ba('0x2e')+(_0x180282[_0x57ba('0x18')]||JSON[_0x57ba('0x2f')](_0x180282)),null,_0x3d1938));});});}function checkHopper(){function _0x32ab30(){return function(_0x435103){logger[_0x57ba('0x12')]('cmContact',_0x57ba('0x30'),util[_0x57ba('0x31')](_0x435103,{'showHidden':![],'depth':null}));};}var _0x5146c0=function(_0x500519,_0x48fec4){var _0x263fc2=squel['insert']()[_0x57ba('0x32')](_0x57ba('0x33'))[_0x57ba('0x34')]([_0x57ba('0x35'),_0x57ba('0x36'),'ContactId','ListId',_0x48fec4,_0x57ba('0x37'),_0x57ba('0x38')],squel['select']()[_0x57ba('0x39')]('phone',_0x57ba('0x35'))[_0x57ba('0x39')](_0x57ba('0x3a'),'scheduledAt')[_0x57ba('0x39')]('id','ContactId')[_0x57ba('0x39')](LISTID['toString'](),_0x57ba('0x23'))[_0x57ba('0x39')](_0x500519['id'][_0x57ba('0x3b')](),_0x48fec4)[_0x57ba('0x39')](_0x57ba('0x3a'),_0x57ba('0x37'))['field']('NOW()','updatedAt')[_0x57ba('0x3c')](_0x57ba('0x3d'))[_0x57ba('0x3e')]('deletedAt\x20IS\x20NULL')[_0x57ba('0x3e')](_0x57ba('0x3f'),LISTID[_0x57ba('0x3b')]())[_0x57ba('0x3e')](_0x57ba('0x40'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x57ba('0x39')](_0x57ba('0x35'))[_0x57ba('0x3c')](_0x57ba('0x33'))[_0x57ba('0x3e')](_0x48fec4+'\x20=\x20?',_0x500519['id'][_0x57ba('0x3b')]())))[_0x57ba('0x3b')]();return _0x263fc2;};var _0x327a0e=function(_0x152eb0,_0x291b95){var _0x17f00d=squel[_0x57ba('0x41')]()['into'](_0x57ba('0x33'))[_0x57ba('0x34')]([_0x57ba('0x35'),'scheduledAt',_0x57ba('0x42'),'ListId',_0x291b95,_0x57ba('0x37'),_0x57ba('0x38')],squel[_0x57ba('0x43')]()[_0x57ba('0x39')](_0x57ba('0x35'),_0x57ba('0x35'))['field'](_0x57ba('0x3a'),'scheduledAt')[_0x57ba('0x39')]('id',_0x57ba('0x42'))['field'](LISTID[_0x57ba('0x3b')](),_0x57ba('0x23'))[_0x57ba('0x39')](_0x152eb0['id'][_0x57ba('0x3b')](),_0x291b95)[_0x57ba('0x39')](_0x57ba('0x3a'),_0x57ba('0x37'))['field'](_0x57ba('0x3a'),_0x57ba('0x38'))[_0x57ba('0x3c')](_0x57ba('0x3d'))[_0x57ba('0x3e')]('deletedAt\x20IS\x20NULL')[_0x57ba('0x3e')](_0x57ba('0x3f'),LISTID[_0x57ba('0x3b')]())['where'](_0x57ba('0x44'),squel[_0x57ba('0x45')](hopperContacts))[_0x57ba('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x57ba('0x3e')](_0x57ba('0x46'),squel['select']()['field']('calleridnum')[_0x57ba('0x3c')](_0x57ba('0x47'))[_0x57ba('0x3e')](_0x291b95+'\x20=\x20?',_0x152eb0['id'][_0x57ba('0x3b')]()))['where'](_0x57ba('0x46'),squel['select']()['field'](_0x57ba('0x35'))[_0x57ba('0x3c')]('cm_hopper')['where'](_0x291b95+_0x57ba('0x48'),_0x152eb0['id']['toString']())))[_0x57ba('0x3b')]();return _0x17f00d;};function _0x1db097(_0x1ed86f,_0x458bce){var _0x266695=squel[_0x57ba('0x41')]()[_0x57ba('0x32')](_0x57ba('0x33'))[_0x57ba('0x34')](['phone',_0x57ba('0x36'),'ContactId',_0x57ba('0x23'),_0x458bce,_0x57ba('0x37'),_0x57ba('0x38')],squel[_0x57ba('0x43')]()['field'](_0x57ba('0x35'),_0x57ba('0x35'))[_0x57ba('0x39')](_0x57ba('0x3a'),'scheduledAt')[_0x57ba('0x39')]('id',_0x57ba('0x42'))[_0x57ba('0x39')](LISTID[_0x57ba('0x3b')](),'ListId')[_0x57ba('0x39')](_0x1ed86f['id'][_0x57ba('0x3b')](),_0x458bce)[_0x57ba('0x39')]('NOW()',_0x57ba('0x37'))[_0x57ba('0x39')](_0x57ba('0x3a'),'updatedAt')[_0x57ba('0x3c')](_0x57ba('0x3d'))[_0x57ba('0x3e')](_0x57ba('0x49'))[_0x57ba('0x3e')](_0x57ba('0x3f'),LISTID[_0x57ba('0x3b')]())['where'](_0x57ba('0x44'),squel[_0x57ba('0x45')](hopperContacts))[_0x57ba('0x3e')](_0x57ba('0x40')))['toString']();return _0x266695;}function _0x1ea7fd(_0x37e3bc,_0x4ffce9){var _0x36e441=squel['insert']()[_0x57ba('0x32')]('cm_hopper_black')['fromQuery']([_0x57ba('0x35'),_0x57ba('0x42'),'ListId',_0x4ffce9,_0x57ba('0x37'),_0x57ba('0x38')],squel[_0x57ba('0x43')]()[_0x57ba('0x39')](_0x57ba('0x35'),'phone')[_0x57ba('0x39')]('id',_0x57ba('0x42'))[_0x57ba('0x39')](LISTID[_0x57ba('0x3b')](),'ListId')[_0x57ba('0x39')](_0x37e3bc['id'][_0x57ba('0x3b')](),_0x4ffce9)['field'](_0x57ba('0x3a'),_0x57ba('0x37'))[_0x57ba('0x39')](_0x57ba('0x3a'),'updatedAt')[_0x57ba('0x3c')](_0x57ba('0x3d'))[_0x57ba('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x57ba('0x3f'),LISTID[_0x57ba('0x3b')]())[_0x57ba('0x3e')](_0x57ba('0x44'),squel['str'](hopperContacts))['where'](_0x57ba('0x40')))[_0x57ba('0x3b')]();return _0x36e441;}return db[_0x57ba('0x4a')][_0x57ba('0x4b')]({'where':{'type':_0x57ba('0x4c')},'attributes':['id',_0x57ba('0x4d')],'include':[{'model':db[_0x57ba('0x4e')],'as':_0x57ba('0x4f'),'where':{'id':LISTID}}]})[_0x57ba('0x2b')](function(_0x157a20){var _0x54ad7c=[];if(_0x157a20){var _0x22df13;for(var _0x458eff=0x0,_0x40d807;_0x458eff<_0x157a20[_0x57ba('0x16')];_0x458eff+=0x1){_0x40d807=_0x157a20[_0x458eff]['get']({'plain':!![]});switch(_0x40d807[_0x57ba('0x4d')]){case _0x57ba('0x50'):_0x54ad7c[_0x57ba('0x51')](db[_0x57ba('0x52')][_0x57ba('0x53')](_0x327a0e(_0x40d807,'VoiceQueueId'))[_0x57ba('0x2b')](function(){})['catch'](_0x32ab30()));break;case _0x57ba('0x54'):_0x54ad7c[_0x57ba('0x51')](db[_0x57ba('0x52')][_0x57ba('0x53')](_0x5146c0(_0x40d807,_0x57ba('0x55')))[_0x57ba('0x2b')](function(){})[_0x57ba('0x2d')](_0x32ab30()));break;default:_0x54ad7c['push'](db[_0x57ba('0x52')][_0x57ba('0x53')](_0x1db097(_0x40d807,'VoiceQueueId'))[_0x57ba('0x2b')](function(){})['catch'](_0x32ab30()));}}}return _0x54ad7c;})[_0x57ba('0x56')]()[_0x57ba('0x2b')](function(){return db[_0x57ba('0x4a')][_0x57ba('0x4b')]({'where':{'type':_0x57ba('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x57ba('0x57'),'where':{'id':LISTID}}]})[_0x57ba('0x2b')](function(_0x1cf64c){var _0x31f173=[];if(_0x1cf64c){var _0x2a7e53;for(var _0x685484=0x0,_0x46e23a;_0x685484<_0x1cf64c[_0x57ba('0x16')];_0x685484+=0x1){_0x46e23a=_0x1cf64c[_0x685484][_0x57ba('0x58')]({'plain':!![]});_0x31f173[_0x57ba('0x51')](db[_0x57ba('0x52')]['query'](_0x1ea7fd(_0x46e23a,_0x57ba('0x55')))['then'](function(){})['catch'](_0x32ab30()));}}return _0x31f173;})[_0x57ba('0x56')]();})[_0x57ba('0x2b')](function(){return db[_0x57ba('0x59')][_0x57ba('0x4b')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x57ba('0x4e')],'as':_0x57ba('0x4f'),'where':{'id':LISTID}}]})[_0x57ba('0x2b')](function(_0x13f465){var _0xc7813a=[];if(_0x13f465){for(var _0x492c9f=0x0,_0x220b04;_0x492c9f<_0x13f465[_0x57ba('0x16')];_0x492c9f+=0x1){_0x220b04=_0x13f465[_0x492c9f][_0x57ba('0x58')]({'plain':!![]});switch(_0x220b04['dialCheckDuplicateType']){case _0x57ba('0x50'):_0xc7813a['push'](db['sequelize'][_0x57ba('0x53')](_0x327a0e(_0x220b04,_0x57ba('0x5a')))[_0x57ba('0x2b')](function(){})[_0x57ba('0x2d')](_0x32ab30()));break;case _0x57ba('0x54'):_0xc7813a[_0x57ba('0x51')](db[_0x57ba('0x52')][_0x57ba('0x53')](_0x5146c0(_0x220b04,_0x57ba('0x5a')))[_0x57ba('0x2b')](function(){})[_0x57ba('0x2d')](_0x32ab30()));break;default:_0xc7813a[_0x57ba('0x51')](db[_0x57ba('0x52')]['query'](_0x1db097(_0x220b04,_0x57ba('0x5a')))[_0x57ba('0x2b')](function(){})[_0x57ba('0x2d')](_0x32ab30()));}}}return _0xc7813a;})[_0x57ba('0x56')]();})['then'](function(){return db[_0x57ba('0x59')][_0x57ba('0x4b')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x57ba('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x586832){var _0x31285c=[];if(_0x586832){for(var _0x40c1da=0x0,_0x194d23;_0x40c1da<_0x586832[_0x57ba('0x16')];_0x40c1da+=0x1){_0x194d23=_0x586832[_0x40c1da]['get']({'plain':!![]});_0x31285c[_0x57ba('0x51')](db[_0x57ba('0x52')][_0x57ba('0x53')](_0x1ea7fd(_0x194d23,_0x57ba('0x5a')))[_0x57ba('0x2b')](function(){})[_0x57ba('0x2d')](_0x32ab30()));}}return _0x31285c;})[_0x57ba('0x56')]();})[_0x57ba('0x2d')](function(_0x2cc8d7){logger[_0x57ba('0x12')](_0x57ba('0x5b'),'generalCheckHopper',_0x2cc8d7[_0x57ba('0x18')]);});}var processPromises=function(_0x2c40d5){return BPromise[_0x57ba('0x56')](promises)[_0x57ba('0x2b')](function(_0x8a24ee){})['catch'](function(_0x1fb593){logger[_0x57ba('0x12')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x1fb593));})['finally'](function(){socket[_0x57ba('0x5c')](_0x57ba('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2c40d5){return _0x2c40d5[_0x57ba('0x5e')]();}});};var endCsv=function(){return BPromise[_0x57ba('0x5f')]()[_0x57ba('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x57ba('0x2b')](function(){socket[_0x57ba('0x5c')](_0x57ba('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x57ba('0x60')](FILEPATH);}catch(_0x27f146){logger[_0x57ba('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x57ba('0x2f')](_0x27f146));}finally{process[_0x57ba('0x61')](0x0);}});};process['on'](_0x57ba('0x62'),function(){logger['info'](_0x57ba('0x63'));endCsv();});function main(){return BPromise['resolve']()[_0x57ba('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x57ba('0x10')](',');return db[_0x57ba('0x28')][_0x57ba('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x57ba('0x2b')](function(_0x47dc1e){var _0x143958=fs[_0x57ba('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x143958,{'header':!![],'skipEmptyLines':!![],'step':function(_0x22b53b,_0x2a7032){total+=0x1;var _0x456bd4=total;promises[_0x57ba('0x51')](checkRow(_0x22b53b,_0x47dc1e,_0x456bd4)['then'](function(){success+=0x1;})['catch'](function(_0x5343ed){if(_0x5343ed[_0x57ba('0x12')]){errors+=0x1;delete _0x5343ed[_0x57ba('0x12')];}else if(_0x5343ed[_0x57ba('0x26')]){duplicates+=0x1;delete _0x5343ed[_0x57ba('0x26')];}rows[_0x57ba('0x51')](_0x5343ed);}));if(total%0xc8===0x0){_0x2a7032[_0x57ba('0x65')]();return processPromises(_0x2a7032);}},'complete':function(){return processPromises()['then'](function(){logger[_0x57ba('0x66')](_0x57ba('0x67'));endCsv();});},'error':function(_0x26ca4a,_0x44d033){logger['info'](_0x57ba('0x68'),JSON[_0x57ba('0x2f')](_0x26ca4a));endCsv();}});})[_0x57ba('0x2d')](function(_0x4f14e9){logger[_0x57ba('0x12')](_0x57ba('0x69'),JSON['stringify'](_0x4f14e9));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 409e38b..3cf6417 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 _0x9fd4=['campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','insert','cm_hopper_black','updatedAt','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','toString','ListId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','query','spread','catch','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CompanyId',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_blacklists','VoiceQueueId'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0x9fd4,0x125));var _0x49fd=function(_0x2377e3,_0x2c0352){_0x2377e3=_0x2377e3-0x0;var _0x2a6d1b=_0x9fd4[_0x2377e3];return _0x2a6d1b;};'use strict';var fs=require('fs');var path=require(_0x49fd('0x0'));var _=require(_0x49fd('0x1'));var Papa=require(_0x49fd('0x2'));var util=require('util');var BPromise=require(_0x49fd('0x3'));var moment=require(_0x49fd('0x4'));var squel=require(_0x49fd('0x5'));var Redis=require(_0x49fd('0x6'));var db=require(_0x49fd('0x7'))['db'];var config=require(_0x49fd('0x8'));var logger=require('../../../config/logger')(_0x49fd('0x9'));config['redis']=_[_0x49fd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x49fd('0xb'))(new Redis(config[_0x49fd('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x49fd('0xd')](_0x49fd('0xe'));function isEmail(_0x59fdd2){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))*$/[_0x49fd('0xf')](_0x59fdd2);}function selectNotIn(_0x192d1e,_0x1c30ee,_0x944f6,_0x4b4b6b,_0x1c33d2){return squel[_0x49fd('0x10')]()[_0x49fd('0x11')](_0x49fd('0x12'))[_0x49fd('0x13')](_0x4b4b6b)['join'](_0x1c30ee,null,_0x1c30ee+_0x49fd('0x14')+_0x4b4b6b+'.'+_0x944f6)[_0x49fd('0x15')](_0x4b4b6b+'.'+_0x944f6+_0x49fd('0x16')+_0x192d1e+'.'+_0x944f6)[_0x49fd('0x15')](_0x1c30ee+_0x49fd('0x17')+_0x1c33d2[_0x49fd('0x18')]()+')');}function insertCmHopper(_0x24cd67,_0x363b7d,_0x2bbc9d,_0x1d232a,_0x1e107d){var _0x226be7=['cm_contacts.phone',_0x49fd('0x19'),'cm_contacts.id',_0x49fd('0x1a'),_0x363b7d+'.'+_0x1d232a,'cm_contacts.createdAt',_0x49fd('0x1b'),_0x49fd('0x1c'),_0x49fd('0x1d'),'\x22'+_0x1e107d+'\x22'];return squel['insert']()[_0x49fd('0x1e')]('cm_hopper')[_0x49fd('0x1f')]([_0x49fd('0x12'),_0x49fd('0x20'),_0x49fd('0x21'),'ListId',_0x1d232a,_0x49fd('0x22'),'updatedAt',_0x49fd('0x23'),_0x49fd('0x24'),_0x49fd('0x25')],squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x226be7)[_0x49fd('0x13')](_0x363b7d)[_0x49fd('0x18')](_0x49fd('0x27'),null,_0x49fd('0x28')+_0x363b7d+_0x49fd('0x29'))[_0x49fd('0x18')](_0x2bbc9d,null,_0x2bbc9d+_0x49fd('0x14')+_0x363b7d+'.'+_0x1d232a)['where'](_0x363b7d+_0x49fd('0x2a'),_0x24cd67)[_0x49fd('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x49fd('0x15')](_0x49fd('0x2b'),selectNotIn(_0x363b7d,_0x2bbc9d,_0x1d232a,_0x49fd('0x2c'),[_0x49fd('0x2d'),_0x49fd('0x2e')]))['where'](_0x49fd('0x2b'),selectNotIn(_0x363b7d,_0x2bbc9d,_0x1d232a,_0x49fd('0x2c'),[_0x49fd('0x2d')])))['toString']();}function insertCmHopperBlack(_0x4be0fb,_0x225ed3,_0x3fccfe,_0x2c697f){var _0x2da240=[_0x49fd('0x2f'),_0x49fd('0x30'),_0x49fd('0x1a'),_0x225ed3+'.'+_0x2c697f,_0x49fd('0x31'),_0x49fd('0x1b')];return squel[_0x49fd('0x32')]()[_0x49fd('0x1e')](_0x49fd('0x33'))[_0x49fd('0x1f')]([_0x49fd('0x12'),_0x49fd('0x21'),'ListId',_0x2c697f,'createdAt',_0x49fd('0x34')],squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x2da240)[_0x49fd('0x13')](_0x225ed3)[_0x49fd('0x18')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x225ed3+_0x49fd('0x29'))[_0x49fd('0x18')](_0x3fccfe,null,_0x3fccfe+_0x49fd('0x14')+_0x225ed3+'.'+_0x2c697f)[_0x49fd('0x15')](_0x225ed3+_0x49fd('0x2a'),_0x4be0fb)[_0x49fd('0x15')](_0x49fd('0x35'),NOW)[_0x49fd('0x15')](_0x49fd('0x2b'),squel['select']()['field'](_0x49fd('0x12'))[_0x49fd('0x13')](_0x49fd('0x33'))[_0x49fd('0x15')]('ListId\x20=\x20?',_0x4be0fb)[_0x49fd('0x15')](_0x2c697f+_0x49fd('0x36'),_0x225ed3+'.'+_0x2c697f)))[_0x49fd('0x37')]();}function insertCmContact(_0x487d1f,_0x481c91,_0x1babec,_0x1e3d4b){var _0x5a2778=_['concat'](_['keys'](_0x1e3d4b),[_0x49fd('0x38'),'CompanyId',_0x49fd('0x22'),_0x49fd('0x34')]);return squel['insert']()[_0x49fd('0x1e')](_0x49fd('0x27'))['fromQuery'](_0x5a2778,squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x5a2778)['from'](_0x481c91)[_0x49fd('0x15')]('('+_0x1babec['join'](',')+_0x49fd('0x39'),squel[_0x49fd('0x10')]()[_0x49fd('0x26')](_0x1babec)[_0x49fd('0x13')](_0x49fd('0x27'))[_0x49fd('0x15')](_0x49fd('0x3a'),_0x487d1f)[_0x49fd('0x15')](_0x49fd('0x3b')))['where'](_0x49fd('0x3c'),squel['select']()[_0x49fd('0x11')](_0x49fd('0x3d'),_0x49fd('0x3e'))[_0x49fd('0x13')](_0x481c91)[_0x49fd('0x3f')](_0x1babec['join'](','))))[_0x49fd('0x37')]();}function handleStop(){logger[_0x49fd('0x40')](_0x49fd('0x41'));stopped=!![];}function handleUncaughtException(_0x57f2d4){logger[_0x49fd('0x42')](_0x57f2d4[_0x49fd('0x43')]);process[_0x49fd('0x44')](0x1);}function handleError(_0x5434b8,_0x3fe595){stats[_0x49fd('0x45')][_0x49fd('0x46')]({'name':_0x3fe595['code'],'message':_0x3fe595[_0x49fd('0x43')],'row':_0x5434b8});}function handleQuery(_0x31cea5){logger[_0x49fd('0x40')](_0x31cea5);return db['sequelize'][_0x49fd('0x47')](_0x31cea5)[_0x49fd('0x48')](function(_0x35b0c7){results['push'](_0x35b0c7);})[_0x49fd('0x49')](function(_0x290e15){logger[_0x49fd('0x42')](_0x290e15[_0x49fd('0x43')]);});}function main(_0xb25b74,_0x22fc37,_0x18cbd8,_0x102920){logger[_0x49fd('0x40')](_0x49fd('0x4a'),_0xb25b74,JSON[_0x49fd('0x4b')](_0x22fc37));process['send'](_0x49fd('0x4c'));var _0x5b5b5f=_0x22fc37[_0x49fd('0x4d')];var _0x2c33af=_0x22fc37[_0x49fd('0x4e')];var _0x2e0da6=path[_0x49fd('0x18')](config[_0x49fd('0x4f')],_0x49fd('0x50'),_0x2c33af+'.csv');var _0x1f1f18=_['keys'](_0x5b5b5f)[_0x49fd('0x18')]();logger[_0x49fd('0x40')](_0x49fd('0x51'),_0x1f1f18);fs[_0x49fd('0x52')](_0x2e0da6,_0x1f1f18+'\x0a');Papa['parse'](fs[_0x49fd('0x53')](_0xb25b74),{'header':!![],'skipEmptyLines':!![],'step':function(_0x52b5ec,_0x583b67){try{for(var _0x345134=0x0,_0x571fcf=[];_0x345134<_0x52b5ec[_0x49fd('0x54')][_0x49fd('0x55')];_0x345134++){stats[_0x49fd('0x56')]+=0x1;if(_0x52b5ec[_0x49fd('0x45')][_0x345134]){handleError(_0x52b5ec[_0x49fd('0x54')][_0x345134],_0x52b5ec[_0x49fd('0x45')][_0x345134]);}else{var _0x16b598=[];for(var _0x13ac3f in _0x5b5b5f){if(_0x5b5b5f[_0x49fd('0x57')](_0x13ac3f)){if(_0x52b5ec[_0x49fd('0x54')][_0x345134][_0x5b5b5f[_0x13ac3f]]){var _0x2e01d4=_['trim'](_0x52b5ec[_0x49fd('0x54')][_0x345134][_0x5b5b5f[_0x13ac3f]][_0x49fd('0x58')](/"/g,'\x27'));switch(_0x13ac3f){case _0x49fd('0x20'):var _0x3bda91=moment(_0x2e01d4,_0x49fd('0xe'),!![]);if(_0x3bda91[_0x49fd('0x59')]()){_0x571fcf[_0x49fd('0x46')]('\x22'+_0x2e01d4+'\x22');}else{_0x16b598['push'](_0x49fd('0x5a'));}break;case _0x49fd('0x23'):var _0x1211fc=parseInt(_0x2e01d4);_0x2e01d4=_[_0x49fd('0x5b')](_0x1211fc)||_0x1211fc<0x0||_0x1211fc>0x4?_0x102920?0x3:0x2:_0x1211fc;_0x571fcf['push']('\x22'+_0x2e01d4+'\x22');break;case _0x49fd('0x24'):var _0x451298=parseInt(_0x2e01d4);if(_[_0x49fd('0x5c')](_0x451298)&&_['includes'](_0x18cbd8,_0x451298)){_0x571fcf[_0x49fd('0x46')]('\x22'+_0x451298+'\x22');}else{_0x16b598[_0x49fd('0x46')](_0x49fd('0x5d'));}break;case'email':if(isEmail(_0x2e01d4)){_0x571fcf[_0x49fd('0x46')]('\x22'+_0x2e01d4+'\x22');}else{_0x16b598[_0x49fd('0x46')](_0x49fd('0x5e'));}break;case _0x49fd('0x5f'):var _0x509774=moment(_0x2e01d4,_0x49fd('0x60'),!![]);if(_0x509774['isValid']()){_0x571fcf['push']('\x22'+_0x2e01d4+'\x22');}else{_0x16b598[_0x49fd('0x46')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x571fcf[_0x49fd('0x46')]('\x22'+_0x2e01d4+'\x22');}}else{switch(_0x13ac3f){case _0x49fd('0x61'):case'phone':_0x16b598[_0x49fd('0x46')](_0x13ac3f+_0x49fd('0x62'));break;default:_0x571fcf[_0x49fd('0x46')]('\x22\x22');}}}}if(_0x16b598[_0x49fd('0x55')]){handleError(_0x52b5ec['data'][_0x345134],{'code':_0x49fd('0x63'),'message':_0x16b598[_0x49fd('0x18')]()});}else{fs[_0x49fd('0x64')](_0x2e0da6,_0x571fcf[_0x49fd('0x18')]()+'\x0a');}_0x571fcf=[];}if(!(stats['rows']%0xc8)){socket[_0x49fd('0x65')]('contact:import:'+_0x2c33af,stats);stats[_0x49fd('0x45')]=[];}}if(stopped){logger[_0x49fd('0x40')]('Abort\x20parser');_0x583b67['abort']();}}catch(_0x5e8fbf){handleError(_0x52b5ec['data'][_0x345134],{'code':_0x49fd('0x66'),'message':_0x5e8fbf[_0x49fd('0x43')]});logger[_0x49fd('0x42')](_0x49fd('0x67'),_0x5e8fbf[_0x49fd('0x43')]);}},'complete':function(){try{var _0x431758=[];var _0x15ddc4=_0x49fd('0x27');if(_0x22fc37[_0x49fd('0x68')]&&_0x22fc37[_0x49fd('0x68')]['length']){_0x15ddc4=_0x49fd('0x69')+_0x2c33af;_0x431758['push'](_0x49fd('0x6a')+_0x15ddc4+_0x49fd('0x6b'));}var _0x2afbc3=util[_0x49fd('0xd')]('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',_0x2e0da6,_0x15ddc4,_0x1f1f18,_0x22fc37[_0x49fd('0x38')],_0x22fc37[_0x49fd('0x6c')]||null,NOW,NOW);if(_['isNil'](_0x5b5b5f[_0x49fd('0x20')])){_0x2afbc3+=_0x49fd('0x6d');}_0x431758['push'](_0x2afbc3);if(_0x22fc37[_0x49fd('0x68')]&&_0x22fc37['duplicates'][_0x49fd('0x55')]){_0x431758[_0x49fd('0x46')](insertCmContact(_0x22fc37['ListId'],_0x15ddc4,_0x22fc37['duplicates'],_0x5b5b5f));_0x431758['push']('DROP\x20TABLE\x20'+_0x15ddc4+';');}_0x431758[_0x49fd('0x46')](insertCmHopper(_0x22fc37['ListId'],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x102920));_0x431758['push'](insertCmHopperBlack(_0x22fc37[_0x49fd('0x38')],_0x49fd('0x6e'),'voice_queues',_0x49fd('0x6f')));_0x431758[_0x49fd('0x46')](insertCmHopper(_0x22fc37[_0x49fd('0x38')],_0x49fd('0x70'),_0x49fd('0x71'),_0x49fd('0x72'),_0x102920));_0x431758[_0x49fd('0x46')](insertCmHopperBlack(_0x22fc37['ListId'],_0x49fd('0x73'),'campaigns',_0x49fd('0x72')));BPromise[_0x49fd('0x74')](_0x431758,handleQuery)[_0x49fd('0x75')](function(_0x5d6f42){stats[_0x49fd('0x76')]=!![];stats[_0x49fd('0x77')]=_0x22fc37[_0x49fd('0x68')]&&_0x22fc37[_0x49fd('0x68')][_0x49fd('0x55')]?results[0x2][_0x49fd('0x77')]:results[0x0][_0x49fd('0x77')];socket['emit'](_0x49fd('0x78')+_0x2c33af,stats);fs[_0x49fd('0x79')](_0xb25b74);fs[_0x49fd('0x79')](_0x2e0da6);process[_0x49fd('0x44')](0x0);})[_0x49fd('0x49')](function(_0x3a4b2a){logger[_0x49fd('0x42')](_0x3a4b2a['message']);process[_0x49fd('0x44')](0x1);});}catch(_0x5cb11f){logger[_0x49fd('0x42')](_0x49fd('0x7a'),_0x5cb11f[_0x49fd('0x43')]);process[_0x49fd('0x44')](0x1);}},'error':function(_0x4d3178,_0x3341a1,_0x40380d,_0x280d25){throw new Error(_0x280d25);}});}function validate(){if(process['argv']&&process[_0x49fd('0x7b')][_0x49fd('0x55')]<0x4){throw new Error(_0x49fd('0x7c'));}var _0x4ac7dd=path[_0x49fd('0x18')](config[_0x49fd('0x4f')],'server/files/tmp',process[_0x49fd('0x7b')][0x2]);if(!fs[_0x49fd('0x7d')](_0x4ac7dd)){throw new Error(_0x49fd('0x7e'));}var _0x456c01={};try{_0x456c01=JSON['parse'](process[_0x49fd('0x7b')][0x3]);if(!_0x456c01[_0x49fd('0x4d')]){throw new Error(_0x49fd('0x7f'));}if(!_0x456c01[_0x49fd('0x4d')][_0x49fd('0x12')]){throw new Error(_0x49fd('0x80'));}if(!_0x456c01[_0x49fd('0x4d')][_0x49fd('0x61')]){throw new Error('firstName\x20is\x20mandatory');}var _0x497f9b=0x0;if(_0x456c01[_0x49fd('0x4d')]['UserId']){_0x497f9b=0x1;}if(!_0x456c01[_0x49fd('0x38')]){throw new Error(_0x49fd('0x81'));}}catch(_0x55bf78){throw new Error(_0x49fd('0x82'));}var _0x8f5a67=[];try{_0x8f5a67=_[_0x49fd('0x83')](JSON[_0x49fd('0x84')](process['argv'][0x4]),'id');}catch(_0x1d106b){logger[_0x49fd('0x40')]('No\x20agent\x20available');}main(_0x4ac7dd,_0x456c01,_0x8f5a67,_0x497f9b);}validate();process['on'](_0x49fd('0x85'),handleStop);process['on'](_0x49fd('0x86'),handleUncaughtException); \ No newline at end of file +var _0x0ed0=['.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','into','cm_hopper_black','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','message','exit','push','code','sequelize','query','spread','main','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','parse','data','length','errors','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','rows','emit','contact:import:','Abort\x20parser','SystemError','error','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','catch','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','from','cm_contacts'];(function(_0x2bc6a2,_0x44e6ea){var _0x50f1ce=function(_0x2d3e20){while(--_0x2d3e20){_0x2bc6a2['push'](_0x2bc6a2['shift']());}};_0x50f1ce(++_0x44e6ea);}(_0x0ed0,0xe3));var _0x00ed=function(_0x33d775,_0x54cde1){_0x33d775=_0x33d775-0x0;var _0x56a6e5=_0x0ed0[_0x33d775];return _0x56a6e5;};'use strict';var fs=require('fs');var path=require(_0x00ed('0x0'));var _=require(_0x00ed('0x1'));var Papa=require('papaparse');var util=require(_0x00ed('0x2'));var BPromise=require(_0x00ed('0x3'));var moment=require(_0x00ed('0x4'));var squel=require(_0x00ed('0x5'));var Redis=require(_0x00ed('0x6'));var db=require(_0x00ed('0x7'))['db'];var config=require(_0x00ed('0x8'));var logger=require('../../../config/logger')('import');config[_0x00ed('0x9')]=_[_0x00ed('0xa')](config[_0x00ed('0x9')],{'host':_0x00ed('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x00ed('0xc'));function isEmail(_0x22585b){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))*$/[_0x00ed('0xd')](_0x22585b);}function selectNotIn(_0x2c3bbd,_0x11ce43,_0x2295a9,_0x13105c,_0x493552){return squel[_0x00ed('0xe')]()[_0x00ed('0xf')](_0x00ed('0x10'))['from'](_0x13105c)['join'](_0x11ce43,null,_0x11ce43+_0x00ed('0x11')+_0x13105c+'.'+_0x2295a9)[_0x00ed('0x12')](_0x13105c+'.'+_0x2295a9+'\x20=\x20'+_0x2c3bbd+'.'+_0x2295a9)[_0x00ed('0x12')](_0x11ce43+_0x00ed('0x13')+_0x493552[_0x00ed('0x14')]()+')');}function insertCmHopper(_0x33bde7,_0x24f55a,_0xbe3e19,_0x33fce9,_0x47de23){var _0x4b855a=[_0x00ed('0x15'),_0x00ed('0x16'),'cm_contacts.id','cm_contacts.ListId',_0x24f55a+'.'+_0x33fce9,_0x00ed('0x17'),_0x00ed('0x18'),_0x00ed('0x19'),_0x00ed('0x1a'),'\x22'+_0x47de23+'\x22'];return squel[_0x00ed('0x1b')]()['into']('cm_hopper')[_0x00ed('0x1c')](['phone','scheduledat',_0x00ed('0x1d'),_0x00ed('0x1e'),_0x33fce9,_0x00ed('0x1f'),_0x00ed('0x20'),_0x00ed('0x21'),_0x00ed('0x22'),_0x00ed('0x23')],squel['select']()[_0x00ed('0x24')](_0x4b855a)[_0x00ed('0x25')](_0x24f55a)[_0x00ed('0x14')](_0x00ed('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x24f55a+_0x00ed('0x27'))[_0x00ed('0x14')](_0xbe3e19,null,_0xbe3e19+'.id\x20=\x20'+_0x24f55a+'.'+_0x33fce9)[_0x00ed('0x12')](_0x24f55a+_0x00ed('0x28'),_0x33bde7)[_0x00ed('0x12')](_0x00ed('0x29'),NOW)[_0x00ed('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x24f55a,_0xbe3e19,_0x33fce9,_0x00ed('0x2a'),[_0x00ed('0x2b'),'\x22onlyIfOpen\x22']))[_0x00ed('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x24f55a,_0xbe3e19,_0x33fce9,_0x00ed('0x2a'),[_0x00ed('0x2b')])))[_0x00ed('0x2c')]();}function insertCmHopperBlack(_0x2fad4b,_0x3beff9,_0x2fb841,_0x842cc5){var _0x101de2=[_0x00ed('0x15'),_0x00ed('0x2d'),_0x00ed('0x2e'),_0x3beff9+'.'+_0x842cc5,'cm_contacts.createdAt',_0x00ed('0x18')];return squel[_0x00ed('0x1b')]()[_0x00ed('0x2f')](_0x00ed('0x30'))[_0x00ed('0x1c')]([_0x00ed('0x10'),_0x00ed('0x1d'),_0x00ed('0x1e'),_0x842cc5,_0x00ed('0x1f'),_0x00ed('0x20')],squel['select']()[_0x00ed('0x24')](_0x101de2)[_0x00ed('0x25')](_0x3beff9)[_0x00ed('0x14')](_0x00ed('0x26'),null,_0x00ed('0x31')+_0x3beff9+_0x00ed('0x27'))[_0x00ed('0x14')](_0x2fb841,null,_0x2fb841+_0x00ed('0x11')+_0x3beff9+'.'+_0x842cc5)[_0x00ed('0x12')](_0x3beff9+_0x00ed('0x28'),_0x2fad4b)[_0x00ed('0x12')](_0x00ed('0x29'),NOW)[_0x00ed('0x12')](_0x00ed('0x32'),squel[_0x00ed('0xe')]()[_0x00ed('0xf')](_0x00ed('0x10'))['from'](_0x00ed('0x30'))[_0x00ed('0x12')]('ListId\x20=\x20?',_0x2fad4b)[_0x00ed('0x12')](_0x842cc5+'\x20=\x20?',_0x3beff9+'.'+_0x842cc5)))[_0x00ed('0x2c')]();}function insertCmContact(_0x24d58a,_0x3bea71,_0x4361d0,_0x13d803){var _0x2d9b97=_[_0x00ed('0x33')](_['keys'](_0x13d803),[_0x00ed('0x1e'),_0x00ed('0x34'),_0x00ed('0x1f'),_0x00ed('0x20')]);return squel[_0x00ed('0x1b')]()[_0x00ed('0x2f')](_0x00ed('0x26'))[_0x00ed('0x1c')](_0x2d9b97,squel['select']()[_0x00ed('0x24')](_0x2d9b97)[_0x00ed('0x25')](_0x3bea71)[_0x00ed('0x12')]('('+_0x4361d0[_0x00ed('0x14')](',')+_0x00ed('0x35'),squel[_0x00ed('0xe')]()['fields'](_0x4361d0)[_0x00ed('0x25')](_0x00ed('0x26'))[_0x00ed('0x12')](_0x00ed('0x36'),_0x24d58a)[_0x00ed('0x12')](_0x00ed('0x37')))['where']('id\x20IN\x20?',squel['select']()[_0x00ed('0xf')]('MIN(id)',_0x00ed('0x38'))[_0x00ed('0x25')](_0x3bea71)[_0x00ed('0x39')](_0x4361d0[_0x00ed('0x14')](','))))[_0x00ed('0x2c')]();}function handleStop(){logger[_0x00ed('0x3a')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xae0046){logger['error'](_0xae0046[_0x00ed('0x3b')]);process[_0x00ed('0x3c')](0x1);}function handleError(_0x326b7a,_0x1564f3){stats['errors'][_0x00ed('0x3d')]({'name':_0x1564f3[_0x00ed('0x3e')],'message':_0x1564f3[_0x00ed('0x3b')],'row':_0x326b7a});}function handleQuery(_0x2f9ddc){logger[_0x00ed('0x3a')](_0x2f9ddc);return db[_0x00ed('0x3f')][_0x00ed('0x40')](_0x2f9ddc)[_0x00ed('0x41')](function(_0x486d74){results['push'](_0x486d74);})['catch'](function(_0x4d23c7){logger['error'](_0x4d23c7['message']);});}function main(_0x332c7b,_0x40440c,_0xfadfdc,_0x312bb7){logger[_0x00ed('0x3a')](_0x00ed('0x42'),_0x332c7b,JSON[_0x00ed('0x43')](_0x40440c));process['send'](_0x00ed('0x44'));var _0x3b3461=_0x40440c[_0x00ed('0x45')];var _0x888269=_0x40440c[_0x00ed('0x46')];var _0x1df5f9=path['join'](config[_0x00ed('0x47')],_0x00ed('0x48'),_0x888269+_0x00ed('0x49'));var _0x2bbe4c=_[_0x00ed('0x4a')](_0x3b3461)[_0x00ed('0x14')]();logger['info'](_0x00ed('0x4b'),_0x2bbe4c);fs['writeFileSync'](_0x1df5f9,_0x2bbe4c+'\x0a');Papa[_0x00ed('0x4c')](fs['createReadStream'](_0x332c7b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4bb88f,_0x417b7b){try{for(var _0x36c699=0x0,_0x55b3d0=[];_0x36c699<_0x4bb88f[_0x00ed('0x4d')][_0x00ed('0x4e')];_0x36c699++){stats['rows']+=0x1;if(_0x4bb88f[_0x00ed('0x4f')][_0x36c699]){handleError(_0x4bb88f[_0x00ed('0x4d')][_0x36c699],_0x4bb88f[_0x00ed('0x4f')][_0x36c699]);}else{var _0x22b1e9=[];for(var _0x31f53f in _0x3b3461){if(_0x3b3461[_0x00ed('0x50')](_0x31f53f)){if(_0x4bb88f[_0x00ed('0x4d')][_0x36c699][_0x3b3461[_0x31f53f]]){var _0x1ca386=_[_0x00ed('0x51')](_0x4bb88f[_0x00ed('0x4d')][_0x36c699][_0x3b3461[_0x31f53f]][_0x00ed('0x52')](/"/g,'\x27'));switch(_0x31f53f){case _0x00ed('0x53'):var _0x4a5487=moment(_0x1ca386,_0x00ed('0xc'),!![]);if(_0x4a5487[_0x00ed('0x54')]()){_0x55b3d0[_0x00ed('0x3d')]('\x22'+_0x1ca386+'\x22');}else{_0x22b1e9['push'](_0x00ed('0x55'));}break;case _0x00ed('0x21'):var _0x21c30f=parseInt(_0x1ca386);_0x1ca386=_['isNaN'](_0x21c30f)||_0x21c30f<0x0||_0x21c30f>0x4?_0x312bb7?0x3:0x2:_0x21c30f;_0x55b3d0[_0x00ed('0x3d')]('\x22'+_0x1ca386+'\x22');break;case'UserId':var _0x5e3df7=parseInt(_0x1ca386);if(_[_0x00ed('0x56')](_0x5e3df7)&&_[_0x00ed('0x57')](_0xfadfdc,_0x5e3df7)){_0x55b3d0['push']('\x22'+_0x5e3df7+'\x22');}else{_0x22b1e9['push'](_0x00ed('0x58'));}break;case _0x00ed('0x59'):if(isEmail(_0x1ca386)){_0x55b3d0[_0x00ed('0x3d')]('\x22'+_0x1ca386+'\x22');}else{_0x22b1e9[_0x00ed('0x3d')](_0x00ed('0x5a'));}break;case _0x00ed('0x5b'):var _0x19a5fc=moment(_0x1ca386,_0x00ed('0x5c'),!![]);if(_0x19a5fc[_0x00ed('0x54')]()){_0x55b3d0[_0x00ed('0x3d')]('\x22'+_0x1ca386+'\x22');}else{_0x22b1e9['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x55b3d0['push']('\x22'+_0x1ca386+'\x22');}}else{switch(_0x31f53f){case _0x00ed('0x5d'):case _0x00ed('0x10'):_0x22b1e9[_0x00ed('0x3d')](_0x31f53f+_0x00ed('0x5e'));break;default:_0x55b3d0['push']('\x22\x22');}}}}if(_0x22b1e9['length']){handleError(_0x4bb88f[_0x00ed('0x4d')][_0x36c699],{'code':_0x00ed('0x5f'),'message':_0x22b1e9[_0x00ed('0x14')]()});}else{fs['appendFileSync'](_0x1df5f9,_0x55b3d0[_0x00ed('0x14')]()+'\x0a');}_0x55b3d0=[];}if(!(stats[_0x00ed('0x60')]%0xc8)){socket[_0x00ed('0x61')](_0x00ed('0x62')+_0x888269,stats);stats[_0x00ed('0x4f')]=[];}}if(stopped){logger[_0x00ed('0x3a')](_0x00ed('0x63'));_0x417b7b['abort']();}}catch(_0x2c016c){handleError(_0x4bb88f[_0x00ed('0x4d')][_0x36c699],{'code':_0x00ed('0x64'),'message':_0x2c016c['message']});logger[_0x00ed('0x65')](_0x00ed('0x66'),_0x2c016c[_0x00ed('0x3b')]);}},'complete':function(){try{var _0x350b1c=[];var _0x581e12='cm_contacts';if(_0x40440c[_0x00ed('0x67')]&&_0x40440c[_0x00ed('0x67')][_0x00ed('0x4e')]){_0x581e12=_0x00ed('0x68')+_0x888269;_0x350b1c[_0x00ed('0x3d')](_0x00ed('0x69')+_0x581e12+_0x00ed('0x6a'));}var _0xf65d37=util[_0x00ed('0x6b')](_0x00ed('0x6c'),_0x1df5f9,_0x581e12,_0x2bbe4c,_0x40440c[_0x00ed('0x1e')],_0x40440c['CompanyId']||null,NOW,NOW);if(_[_0x00ed('0x6d')](_0x3b3461[_0x00ed('0x53')])){_0xf65d37+=',\x20scheduledAt\x20=\x20NOW()';}_0x350b1c[_0x00ed('0x3d')](_0xf65d37);if(_0x40440c[_0x00ed('0x67')]&&_0x40440c[_0x00ed('0x67')][_0x00ed('0x4e')]){_0x350b1c[_0x00ed('0x3d')](insertCmContact(_0x40440c[_0x00ed('0x1e')],_0x581e12,_0x40440c[_0x00ed('0x67')],_0x3b3461));_0x350b1c[_0x00ed('0x3d')](_0x00ed('0x6e')+_0x581e12+';');}_0x350b1c['push'](insertCmHopper(_0x40440c['ListId'],_0x00ed('0x6f'),_0x00ed('0x70'),_0x00ed('0x71'),_0x312bb7));_0x350b1c[_0x00ed('0x3d')](insertCmHopperBlack(_0x40440c[_0x00ed('0x1e')],_0x00ed('0x72'),_0x00ed('0x70'),'VoiceQueueId'));_0x350b1c[_0x00ed('0x3d')](insertCmHopper(_0x40440c['ListId'],_0x00ed('0x73'),_0x00ed('0x74'),_0x00ed('0x75'),_0x312bb7));_0x350b1c[_0x00ed('0x3d')](insertCmHopperBlack(_0x40440c[_0x00ed('0x1e')],_0x00ed('0x76'),_0x00ed('0x74'),_0x00ed('0x75')));BPromise[_0x00ed('0x77')](_0x350b1c,handleQuery)[_0x00ed('0x78')](function(_0x25a2c9){stats[_0x00ed('0x79')]=!![];stats[_0x00ed('0x7a')]=_0x40440c[_0x00ed('0x67')]&&_0x40440c[_0x00ed('0x67')][_0x00ed('0x4e')]?results[0x2][_0x00ed('0x7a')]:results[0x0][_0x00ed('0x7a')];socket[_0x00ed('0x61')](_0x00ed('0x62')+_0x888269,stats);fs[_0x00ed('0x7b')](_0x332c7b);fs[_0x00ed('0x7b')](_0x1df5f9);process[_0x00ed('0x3c')](0x0);})[_0x00ed('0x7c')](function(_0x2a1434){logger[_0x00ed('0x65')](_0x2a1434[_0x00ed('0x3b')]);process[_0x00ed('0x3c')](0x1);});}catch(_0x2c0764){logger['error'](_0x00ed('0x7d'),_0x2c0764[_0x00ed('0x3b')]);process[_0x00ed('0x3c')](0x1);}},'error':function(_0x8f4ead,_0x1c46d2,_0xcd8753,_0x1d4a92){throw new Error(_0x1d4a92);}});}function validate(){if(process['argv']&&process[_0x00ed('0x7e')][_0x00ed('0x4e')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x5da8f7=path[_0x00ed('0x14')](config['root'],_0x00ed('0x48'),process[_0x00ed('0x7e')][0x2]);if(!fs[_0x00ed('0x7f')](_0x5da8f7)){throw new Error(_0x00ed('0x80'));}var _0x471691={};try{_0x471691=JSON[_0x00ed('0x4c')](process[_0x00ed('0x7e')][0x3]);if(!_0x471691[_0x00ed('0x45')]){throw new Error(_0x00ed('0x81'));}if(!_0x471691['binding'][_0x00ed('0x10')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x471691[_0x00ed('0x45')][_0x00ed('0x5d')]){throw new Error(_0x00ed('0x82'));}var _0x10f49c=0x0;if(_0x471691[_0x00ed('0x45')][_0x00ed('0x22')]){_0x10f49c=0x1;}if(!_0x471691[_0x00ed('0x1e')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2f5d91){throw new Error(_0x00ed('0x83'));}var _0x49ec1a=[];try{_0x49ec1a=_['map'](JSON['parse'](process[_0x00ed('0x7e')][0x4]),'id');}catch(_0x14563c){logger[_0x00ed('0x3a')]('No\x20agent\x20available');}main(_0x5da8f7,_0x471691,_0x49ec1a,_0x10f49c);}validate();process['on']('SIGINT',handleStop);process['on'](_0x00ed('0x84'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 254c48e..af20c42 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 _0xde41=['agentcalledAt','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring'];(function(_0x51a968,_0x49fb19){var _0x4343ba=function(_0x452d7c){while(--_0x452d7c){_0x51a968['push'](_0x51a968['shift']());}};_0x4343ba(++_0x49fb19);}(_0xde41,0xf8));var _0x1de4=function(_0x1b6a98,_0x113326){_0x1b6a98=_0x1b6a98-0x0;var _0x29986a=_0xde41[_0x1b6a98];return _0x29986a;};'use strict';exports[_0x1de4('0x0')]=function(_0x18a835,_0x7dc4b1){var _0x3f3539=[{'type':_0x1de4('0x1'),'content':_0x1de4('0x2'),'variableName':null}];switch(_0x18a835['toLowerCase']()){case _0x1de4('0x3'):switch(_0x7dc4b1['toLowerCase']()){case _0x1de4('0x4'):_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x6'),'content':'','variableName':_0x1de4('0x7')});_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x6'),'content':'','variableName':_0x1de4('0x8')});break;case _0x1de4('0x9'):_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x1'),'content':_0x1de4('0xa'),'variableName':null});_0x3f3539[_0x1de4('0x5')]({'type':_0x1de4('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x3f3539;};exports[_0x1de4('0xb')]=function(_0x28da15,_0x48cd44){var _0x4dab1e=[];switch(_0x28da15[_0x1de4('0xc')]()){case _0x1de4('0x3'):switch(_0x48cd44[_0x1de4('0xc')]()){case _0x1de4('0x4'):_0x4dab1e=[{'type':_0x1de4('0x1'),'content':_0x1de4('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0xf'),'keyType':'variable','variableName':_0x1de4('0x8')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x10'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x11')},{'type':'keyValue','content':'','key':_0x1de4('0x12'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x13')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x14'),'keyType':'variable','variableName':_0x1de4('0x7')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x15'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x16')},{'type':_0x1de4('0xe'),'content':'','key':'Date','keyType':_0x1de4('0x6'),'variableName':'agentcalledAt'},{'type':_0x1de4('0x1'),'content':_0x1de4('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x1de4('0x18'),'keyType':_0x1de4('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x1de4('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x1de4('0x1'),'content':_0x1de4('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x1b'),'keyType':'variable','variableName':_0x1de4('0x1c')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x1d'),'keyType':_0x1de4('0x6'),'variableName':'agentconnectAt'},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x1e'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x1f')},{'type':'keyValue','content':'','key':_0x1de4('0x20'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x21')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x22'),'keyType':_0x1de4('0x6'),'variableName':_0x1de4('0x23')}];break;case _0x1de4('0x9'):_0x4dab1e=[{'type':_0x1de4('0x1'),'content':_0x1de4('0xd'),'variableName':null},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x24'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0x1de4('0x25'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x26')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x15'),'keyType':'variable','keyContent':'','variableName':_0x1de4('0x16')},{'type':_0x1de4('0xe'),'content':'','key':'Date','keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x27')},{'type':_0x1de4('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x28'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x29')},{'type':_0x1de4('0xe'),'content':'','key':_0x1de4('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x1de4('0x2b')},{'type':_0x1de4('0xe'),'content':'','key':'Duration','keyType':_0x1de4('0x6'),'keyContent':'','variableName':_0x1de4('0x2c')},{'type':'keyValue','content':'','key':_0x1de4('0x2d'),'keyType':_0x1de4('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x4dab1e;}; \ No newline at end of file +var _0x2247=['answertime','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time'];(function(_0x4624e1,_0x4c803f){var _0x4b0181=function(_0x1d36b1){while(--_0x1d36b1){_0x4624e1['push'](_0x4624e1['shift']());}};_0x4b0181(++_0x4c803f);}(_0x2247,0xec));var _0x7224=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x2247[_0x88cd7b];return _0x56fcc8;};'use strict';exports[_0x7224('0x0')]=function(_0xa610a8,_0x1a56e2){var _0x155365=[{'type':_0x7224('0x1'),'content':_0x7224('0x2'),'variableName':null}];switch(_0xa610a8[_0x7224('0x3')]()){case _0x7224('0x4'):switch(_0x1a56e2['toLowerCase']()){case'inbound':_0x155365[_0x7224('0x5')]({'type':_0x7224('0x6'),'content':'','variableName':_0x7224('0x7')});_0x155365[_0x7224('0x5')]({'type':_0x7224('0x6'),'content':'','variableName':_0x7224('0x8')});break;case _0x7224('0x9'):_0x155365[_0x7224('0x5')]({'type':_0x7224('0x1'),'content':_0x7224('0xa'),'variableName':null});_0x155365[_0x7224('0x5')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x155365;};exports[_0x7224('0xb')]=function(_0x14c730,_0x2168f7){var _0x2f86bb=[];switch(_0x14c730['toLowerCase']()){case'voice':switch(_0x2168f7[_0x7224('0x3')]()){case _0x7224('0xc'):_0x2f86bb=[{'type':_0x7224('0x1'),'content':_0x7224('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x7224('0xe'),'content':'','key':'Caller\x20Number','keyType':_0x7224('0x6'),'variableName':_0x7224('0x8')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0xf'),'keyType':_0x7224('0x6'),'variableName':_0x7224('0x10')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x11'),'keyType':_0x7224('0x6'),'variableName':_0x7224('0x12')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x13'),'keyType':_0x7224('0x6'),'variableName':_0x7224('0x7')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x14'),'keyType':_0x7224('0x6'),'variableName':_0x7224('0x15')},{'type':_0x7224('0xe'),'content':'','key':'Date','keyType':_0x7224('0x6'),'variableName':_0x7224('0x16')},{'type':_0x7224('0x1'),'content':_0x7224('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x18'),'keyType':_0x7224('0x6'),'variableName':'destcalleridname'},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x19'),'keyType':'variable','variableName':_0x7224('0x1a')},{'type':_0x7224('0x1'),'content':_0x7224('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x1c'),'keyType':_0x7224('0x6'),'variableName':_0x7224('0x16')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x1d'),'keyType':_0x7224('0x6'),'variableName':_0x7224('0x1e')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x1f'),'keyType':_0x7224('0x6'),'variableName':'agentcompleteAt'},{'type':_0x7224('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x7224('0x6'),'variableName':_0x7224('0x20')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x21'),'keyType':_0x7224('0x6'),'variableName':'talktime'}];break;case'outbound':_0x2f86bb=[{'type':_0x7224('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x22'),'keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x1a')},{'type':'keyValue','content':'','key':_0x7224('0x23'),'keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x24')},{'type':'keyValue','content':'','key':_0x7224('0x14'),'keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x15')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x25'),'keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x26')},{'type':_0x7224('0x1'),'content':_0x7224('0x1b')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x27'),'keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x28')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x29')},{'type':_0x7224('0xe'),'content':'','key':_0x7224('0x2a'),'keyType':'variable','keyContent':'','variableName':_0x7224('0x2b')},{'type':'keyValue','content':'','key':_0x7224('0x2c'),'keyType':_0x7224('0x6'),'keyContent':'','variableName':_0x7224('0x2d')}];break;}}return _0x2f86bb;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 1aa90ec..6f1ccf1 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 _0xcaf3=['html','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','toLowerCase','toUpperCase','role','stringify','findOne','update','then','info','catch','error','tracked','user','query','clone','body','omit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcaf3,0xc5));var _0x3caf=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0xcaf3[_0x386b03];return _0xd3d524;};'use strict';var _=require(_0x3caf('0x0'));var db=require(_0x3caf('0x1'))['db'];var loggers={'openchannel':require(_0x3caf('0x2'))(_0x3caf('0x3')),'mail':require(_0x3caf('0x2'))(_0x3caf('0x4')),'fax':require(_0x3caf('0x2'))(_0x3caf('0x5')),'sms':require(_0x3caf('0x2'))(_0x3caf('0x6')),'chat':require(_0x3caf('0x2'))(_0x3caf('0x7')),'whatsapp':require(_0x3caf('0x2'))(_0x3caf('0x8'))};function getInteractionId(_0x1e90ba,_0x52a50b,_0x164f85){if(_0x1e90ba&&_0x1e90ba[_['upperFirst'](_0x164f85)+_0x3caf('0x9')]){return _0x1e90ba[_[_0x3caf('0xa')](_0x164f85)+_0x3caf('0x9')];}else if(_0x1e90ba&&_0x1e90ba['id']){return _0x1e90ba['id'];}else if(_0x52a50b&&_0x52a50b['id']){return _0x52a50b['id'];}else{return'unknown';}}function log(_0x1f826f,_0x3a3ec2,_0x3547d8,_0x37c69b,_0x2f6fb0,_0x5ad834){loggers[_0x2f6fb0[_0x3caf('0xb')]()][_0x1f826f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ad834[_0x3caf('0xc')](),_0x3a3ec2?_0x3a3ec2['id']:null,_0x3a3ec2?_0x3a3ec2['name']:null,_0x3a3ec2?_0x3a3ec2[_0x3caf('0xd')]:null,getInteractionId(_0x3547d8,_0x37c69b,_0x2f6fb0),_0x3547d8?JSON[_0x3caf('0xe')](_0x3547d8):'null');}function updateUser(_0x4bd4fe,_0x3e430e,_0x29ce7e,_0x11c9f4,_0x39de37){db[_[_0x3caf('0xa')](_0x11c9f4)+'Interaction'][_0x3caf('0xf')]({'where':{'id':getInteractionId(_0x3e430e,_0x29ce7e,_0x11c9f4)}})['then'](function(_0x43a6e5){if(_0x43a6e5){return _0x43a6e5[_0x3caf('0x10')]({'UserId':_0x4bd4fe?_0x4bd4fe['id']:null});}})[_0x3caf('0x11')](function(_0x4dec49){if(_0x4dec49){log(_0x3caf('0x12'),_0x4bd4fe,_0x3e430e,_0x29ce7e,_0x11c9f4,_0x39de37);}})[_0x3caf('0x13')](function(){log(_0x3caf('0x14'),_0x4bd4fe,_0x3e430e,_0x29ce7e,_0x11c9f4,_0x39de37);});}exports[_0x3caf('0x15')]=function(_0xb976c7,_0x6ae7f3){return function(_0xa1ccec,_0x292cff,_0x3f2c4e){var _0x520a44=_0xa1ccec[_0x3caf('0x16')];var _0x32b9d3={};var _0x103a70=_0xa1ccec[_0x3caf('0x17')];if(_0x32b9d3){_0x32b9d3=_[_0x3caf('0x18')](_0xa1ccec[_0x3caf('0x19')]);_0x32b9d3=_[_0x3caf('0x1a')](_0x32b9d3,[_0x3caf('0x19'),_0x3caf('0x1b'),'phone','fax','mobile']);}updateUser(_0x520a44,_0x32b9d3,_0x103a70,_0xb976c7,_0x6ae7f3);_0x3f2c4e(null);};}; \ No newline at end of file +var _0xa876=['openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','update','then','error','query','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger'];(function(_0x1f8af8,_0x8abe94){var _0x56d7d0=function(_0x453225){while(--_0x453225){_0x1f8af8['push'](_0x1f8af8['shift']());}};_0x56d7d0(++_0x8abe94);}(_0xa876,0xde));var _0x6a87=function(_0x48d22d,_0x413e56){_0x48d22d=_0x48d22d-0x0;var _0x2b14c4=_0xa876[_0x48d22d];return _0x2b14c4;};'use strict';var _=require(_0x6a87('0x0'));var db=require(_0x6a87('0x1'))['db'];var loggers={'openchannel':require(_0x6a87('0x2'))(_0x6a87('0x3')),'mail':require(_0x6a87('0x2'))(_0x6a87('0x4')),'fax':require(_0x6a87('0x2'))(_0x6a87('0x5')),'sms':require(_0x6a87('0x2'))('sms-interactions'),'chat':require(_0x6a87('0x2'))(_0x6a87('0x6')),'whatsapp':require(_0x6a87('0x2'))(_0x6a87('0x7'))};function getInteractionId(_0x23c70b,_0x2a10bd,_0x3b4305){if(_0x23c70b&&_0x23c70b[_[_0x6a87('0x8')](_0x3b4305)+_0x6a87('0x9')]){return _0x23c70b[_[_0x6a87('0x8')](_0x3b4305)+'InteractionId'];}else if(_0x23c70b&&_0x23c70b['id']){return _0x23c70b['id'];}else if(_0x2a10bd&&_0x2a10bd['id']){return _0x2a10bd['id'];}else{return _0x6a87('0xa');}}function log(_0x55602b,_0xa4b007,_0x1c64d0,_0x55ddf0,_0x404c0a,_0x5128db){loggers[_0x404c0a['toLowerCase']()][_0x55602b](_0x6a87('0xb'),_0x5128db[_0x6a87('0xc')](),_0xa4b007?_0xa4b007['id']:null,_0xa4b007?_0xa4b007['name']:null,_0xa4b007?_0xa4b007['role']:null,getInteractionId(_0x1c64d0,_0x55ddf0,_0x404c0a),_0x1c64d0?JSON[_0x6a87('0xd')](_0x1c64d0):_0x6a87('0xe'));}function updateUser(_0x28f4c6,_0x2bbb87,_0x1e89ba,_0x3f08b8,_0x2c5072){db[_[_0x6a87('0x8')](_0x3f08b8)+_0x6a87('0xf')]['findOne']({'where':{'id':getInteractionId(_0x2bbb87,_0x1e89ba,_0x3f08b8)}})['then'](function(_0x293bd8){if(_0x293bd8){return _0x293bd8[_0x6a87('0x10')]({'UserId':_0x28f4c6?_0x28f4c6['id']:null});}})[_0x6a87('0x11')](function(_0x5a287b){if(_0x5a287b){log('info',_0x28f4c6,_0x2bbb87,_0x1e89ba,_0x3f08b8,_0x2c5072);}})['catch'](function(){log(_0x6a87('0x12'),_0x28f4c6,_0x2bbb87,_0x1e89ba,_0x3f08b8,_0x2c5072);});}exports['tracked']=function(_0x3cc1d3,_0x3f443e){return function(_0x535ca3,_0x1f4361,_0x1d31b1){var _0x4a5679=_0x535ca3['user'];var _0x516614={};var _0x59ed87=_0x535ca3[_0x6a87('0x13')];if(_0x516614){_0x516614=_['clone'](_0x535ca3[_0x6a87('0x14')]);_0x516614=_[_0x6a87('0x15')](_0x516614,[_0x6a87('0x14'),_0x6a87('0x16'),_0x6a87('0x17'),_0x6a87('0x18'),'mobile']);}updateUser(_0x4a5679,_0x516614,_0x59ed87,_0x3cc1d3,_0x3f443e);_0x1d31b1(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 970c188..53a6284 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 _0xeb68=['license','split','createDecipher','aes-256-ctr','format','update','base64','final','parse','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','data1'];(function(_0x58cd59,_0x118d91){var _0x31bcfe=function(_0x2a7c1d){while(--_0x2a7c1d){_0x58cd59['push'](_0x58cd59['shift']());}};_0x31bcfe(++_0x118d91);}(_0xeb68,0x91));var _0x8eb6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xeb68[_0x2c91e9];return _0x13f0ff;};'use strict';var crypto=require(_0x8eb6('0x0'));var util=require(_0x8eb6('0x1'));var compose=require(_0x8eb6('0x2'));var db=require(_0x8eb6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1c354f,_0x1c5a3b){if(_0x1c354f&&_0x1c5a3b){if(_0x1c5a3b[_0x8eb6('0x4')]&&_0x1c5a3b[_0x8eb6('0x5')]){var _0x513dde=_0x1c5a3b[_0x8eb6('0x4')];var _0x2feea0=_0x1c5a3b['license'];var _0x436c28=_0x513dde['split']('-')[0x4];var _0x493fe2=_0x513dde[_0x8eb6('0x6')]('-')[0x0];var _0x197375=crypto[_0x8eb6('0x7')](_0x8eb6('0x8'),util[_0x8eb6('0x9')]('%s:%s:%s',_0x436c28,_0x513dde,_0x493fe2));var _0x39ba50=_0x197375[_0x8eb6('0xa')](_0x2feea0,_0x8eb6('0xb'),'utf8');_0x39ba50+=_0x197375[_0x8eb6('0xc')]('utf8');var _0x7b6640=JSON[_0x8eb6('0xd')](_0x39ba50);return _0x7b6640['hasOwnProperty'](_0x1c354f)?_0x7b6640[_0x1c354f]:null;}}return null;}function isLimit(_0x1e1c01,_0x1ac8c4,_0x5a806a,_0x367ced){var _0x477f5f=_0x1ac8c4;return compose()['use'](function(_0x59541d,_0xa3ae1f,_0x5df270){return db[_0x8eb6('0xe')][_0x8eb6('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x8eb6('0x10')](function(_0x3af5cc){var _0x20fddd=getValueFromLicense(_0x1e1c01,_0x3af5cc);return _0x20fddd?_0x20fddd:_0x477f5f;})[_0x8eb6('0x10')](function(_0x4b3df5){_0x477f5f=_0x4b3df5;return _0x5a806a[_0x8eb6('0x11')](_0x367ced);})[_0x8eb6('0x10')](function(_0x1250ec){if(_0x1250ec>=_0x477f5f){return _0xa3ae1f[_0x8eb6('0x12')](0x193)['json']({'message':util[_0x8eb6('0x9')](_0x8eb6('0x13'),_0x1e1c01)});}_0x5df270();})[_0x8eb6('0x14')](function(_0x4cf5db){_0x5df270(_0x4cf5db);});});}function isUserLimit(){return isLimit(_0x8eb6('0x15'),0x1,db[_0x8eb6('0x16')],{'where':{'$or':[{'role':_0x8eb6('0x17')},{'role':_0x8eb6('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x9bda=['composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json','catch','users','User','admin','user','crypto','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bda,0xb4));var _0xa9bd=function(_0x44fc33,_0x480283){_0x44fc33=_0x44fc33-0x0;var _0x1e64a1=_0x9bda[_0x44fc33];return _0x1e64a1;};'use strict';var crypto=require(_0xa9bd('0x0'));var util=require(_0xa9bd('0x1'));var compose=require(_0xa9bd('0x2'));var db=require(_0xa9bd('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x562996,_0x47879c){if(_0x562996&&_0x47879c){if(_0x47879c[_0xa9bd('0x4')]&&_0x47879c[_0xa9bd('0x5')]){var _0x278b2c=_0x47879c['data1'];var _0x344844=_0x47879c[_0xa9bd('0x5')];var _0x23845a=_0x278b2c[_0xa9bd('0x6')]('-')[0x4];var _0x2ce25e=_0x278b2c['split']('-')[0x0];var _0x550764=crypto[_0xa9bd('0x7')](_0xa9bd('0x8'),util[_0xa9bd('0x9')]('%s:%s:%s',_0x23845a,_0x278b2c,_0x2ce25e));var _0x1cfc96=_0x550764['update'](_0x344844,_0xa9bd('0xa'),_0xa9bd('0xb'));_0x1cfc96+=_0x550764[_0xa9bd('0xc')](_0xa9bd('0xb'));var _0x4f775d=JSON[_0xa9bd('0xd')](_0x1cfc96);return _0x4f775d[_0xa9bd('0xe')](_0x562996)?_0x4f775d[_0x562996]:null;}}return null;}function isLimit(_0x2310e8,_0x20ffa3,_0x3aaf04,_0x2e6878){var _0x424a59=_0x20ffa3;return compose()[_0xa9bd('0xf')](function(_0x585dde,_0xb48b2,_0x17c1ba){return db[_0xa9bd('0x10')][_0xa9bd('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xa9bd('0x12')](function(_0x5e6716){var _0x30e977=getValueFromLicense(_0x2310e8,_0x5e6716);return _0x30e977?_0x30e977:_0x424a59;})[_0xa9bd('0x12')](function(_0x530220){_0x424a59=_0x530220;return _0x3aaf04['count'](_0x2e6878);})[_0xa9bd('0x12')](function(_0x1e09d3){if(_0x1e09d3>=_0x424a59){return _0xb48b2[_0xa9bd('0x13')](0x193)[_0xa9bd('0x14')]({'message':util[_0xa9bd('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2310e8)});}_0x17c1ba();})[_0xa9bd('0x15')](function(_0x390818){_0x17c1ba(_0x390818);});});}function isUserLimit(){return isLimit(_0xa9bd('0x16'),0x1,db[_0xa9bd('0x17')],{'where':{'$or':[{'role':_0xa9bd('0x18')},{'role':_0xa9bd('0x19')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 717d7f5..84dd89c 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 _0x187f=['match','filter','map','conditions','push','DATE','$eq','operator','$between','value','includes','$gt','$lte','format','castTo','text','field','$ne','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','length','slice','forEach','split','shift'];(function(_0x18aa96,_0xe21f5b){var _0x4dc8a7=function(_0x2a0a29){while(--_0x2a0a29){_0x18aa96['push'](_0x18aa96['shift']());}};_0x4dc8a7(++_0xe21f5b);}(_0x187f,0xbf));var _0xf187=function(_0x4e8c70,_0x388a79){_0x4e8c70=_0x4e8c70-0x0;var _0x2ecb3f=_0x187f[_0x4e8c70];return _0x2ecb3f;};'use strict';var _=require(_0xf187('0x0'));var moment=require(_0xf187('0x1'));exports[_0xf187('0x2')]=function(_0x1977fe){var _0x2eddf2={'conditions':[]};_0x2eddf2[_0xf187('0x3')]=_[_0xf187('0x4')](_0x1977fe,_0xf187('0x5'))?'or':_0xf187('0x6');var _0x8f8c15=_0x1977fe[_0xf187('0x7')]('[$and]','')[_0xf187('0x7')](_0xf187('0x5'),'')['split']('||');for(var _0x22a47a=0x0;_0x22a47a<_0x8f8c15[_0xf187('0x8')];_0x22a47a++){var _0x5e5e1f=_0x8f8c15[_0x22a47a]['split'](':=');var _0x165881=_0x5e5e1f[0x0];var _0x5778ae=_0x5e5e1f[_0xf187('0x9')](0x1);_0x5778ae[_0xf187('0xa')](function(_0xd0238d){var _0x286728=_0xd0238d[_0xf187('0xb')]('[')[_0xf187('0xc')]();var _0x301028=_0xd0238d[_0xf187('0xd')](/\[(.*?)\]/g);_0x301028[_0xf187('0xa')](function(_0x1b08e5){var _0x11a103=_0x1b08e5[_0xf187('0xb')]('[')[_0xf187('0xe')](function(_0xd3974f){return _0xd3974f['indexOf'](']')>-0x1;})[_0xf187('0xf')](function(_0xed5518){return _0xed5518[_0xf187('0xb')](']')[0x0];})[0x0];_0x2eddf2[_0xf187('0x10')][_0xf187('0x11')]({'field':_0x165881,'operator':_0x286728,'value':_0x11a103});});});}return _0x2eddf2;};exports['buildExpression']=function(_0x5b70be,_0x2c9eda,_0x536d50){var _0x4a19a5={};if(_0x2c9eda===_0xf187('0x12')){if(_0x536d50['operator']===_0xf187('0x13')){_0x536d50[_0xf187('0x14')]=_0xf187('0x15');_0x536d50['value']+=','+_0x536d50[_0xf187('0x16')];}else if(_[_0xf187('0x17')]([_0xf187('0x18'),_0xf187('0x19')],_0x536d50[_0xf187('0x14')])){_0x536d50[_0xf187('0x16')]=moment(_0x536d50[_0xf187('0x16')])['add'](0x1,'days')[_0xf187('0x1a')]('YYYY-MM-DD');}}if(_0x536d50[_0xf187('0x1b')]){_0x2c9eda=_0x536d50[_0xf187('0x1b')];_0x4a19a5[_0xf187('0x1c')]='CAST('+_0x5b70be+'.'+_0x536d50[_0xf187('0x1d')]+'\x20AS\x20'+_0x536d50['castTo']+')\x20'+parseOperator(_0x536d50['operator']);}else{_0x4a19a5[_0xf187('0x1c')]=_0x5b70be+'.'+_0x536d50[_0xf187('0x1d')]+'\x20'+parseOperator(_0x536d50[_0xf187('0x14')]);}if(_['includes']([_0xf187('0x1e'),_0xf187('0x1f')],_0x536d50[_0xf187('0x14')]))_0x4a19a5[_0xf187('0x1c')]='('+_0x4a19a5[_0xf187('0x1c')]+_0xf187('0x20')+_0x5b70be+'.'+_0x536d50[_0xf187('0x1d')]+'\x20IS\x20NULL)';_0x4a19a5[_0xf187('0x16')]=parseValue(_0x2c9eda,_0x536d50[_0xf187('0x14')],_0x536d50[_0xf187('0x16')]);return _0x4a19a5;};function parseOperator(_0x1bb6e8){var _0x2e8124;switch(_0x1bb6e8){case _0xf187('0x21'):_0x2e8124=_0xf187('0x22');break;case _0xf187('0x1f'):_0x2e8124=_0xf187('0x23');break;case'$eq':_0x2e8124=_0xf187('0x24');break;case _0xf187('0x1e'):_0x2e8124=_0xf187('0x25');break;case'$substring':case _0xf187('0x26'):case'$endsWith':_0x2e8124=_0xf187('0x27');break;case _0xf187('0x28'):_0x2e8124='<\x20?';break;case'$gt':_0x2e8124=_0xf187('0x29');break;case'$lte':_0x2e8124='<=\x20?';break;case _0xf187('0x2a'):_0x2e8124=_0xf187('0x2b');break;case _0xf187('0x15'):_0x2e8124=_0xf187('0x2c');break;}return _0x2e8124;}function parseValue(_0x8bb9c1,_0x734494,_0x205869){var _0x4647f8={'start':undefined,'end':undefined};switch(_0x734494){case'$in':case'$notIn':_0x4647f8[_0xf187('0x2d')]=_0x205869['split'](',');break;case'$substring':_0x4647f8['start']='%'+_0x205869+'%';break;case _0xf187('0x26'):_0x4647f8[_0xf187('0x2d')]=_0x205869+'%';break;case'$endsWith':_0x4647f8[_0xf187('0x2d')]='%'+_0x205869;break;case _0xf187('0x15'):var _0x3d332b=_0x205869[_0xf187('0xb')](',');var _0x205869=_0x3d332b['shift']();var _0x246a1a=_0x3d332b['pop']();if(_0x8bb9c1==='DATE'){_0x205869=moment(_0x205869)['utcOffset'](0x0,!![])['format']();_0x246a1a=moment(_0x246a1a)[_0xf187('0x2e')](0x0,!![])[_0xf187('0x2f')](0x17,_0xf187('0x30'))[_0xf187('0x2f')](0x3b,_0xf187('0x31'))[_0xf187('0x2f')](0x3b,_0xf187('0x32'))['format']();}_0x4647f8={'start':_0x205869,'end':_0x246a1a};break;default:_0x4647f8[_0xf187('0x2d')]=_0x205869;break;}return _0x4647f8;} \ No newline at end of file +var _0x9832=['$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','$between','BETWEEN\x20?\x20AND\x20?','start','$endsWith','shift','pop','utcOffset','hours','minutes','moment','parseSearch','sqlOperator','startsWith','and','replace','[$or]','split','length','match','forEach','filter','indexOf','map','conditions','DATE','operator','$eq','includes','$gt','$lte','value','add','days','format','castTo','text','CAST(','field','\x20AS\x20'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x9832,0x17a));var _0x2983=function(_0x30cc60,_0x491476){_0x30cc60=_0x30cc60-0x0;var _0x7c4c77=_0x9832[_0x30cc60];return _0x7c4c77;};'use strict';var _=require('lodash');var moment=require(_0x2983('0x0'));exports[_0x2983('0x1')]=function(_0x4bcc5f){var _0x52dca7={'conditions':[]};_0x52dca7[_0x2983('0x2')]=_[_0x2983('0x3')](_0x4bcc5f,'[$or]')?'or':_0x2983('0x4');var _0x122ca9=_0x4bcc5f[_0x2983('0x5')]('[$and]','')[_0x2983('0x5')](_0x2983('0x6'),'')[_0x2983('0x7')]('||');for(var _0x1fb0eb=0x0;_0x1fb0eb<_0x122ca9[_0x2983('0x8')];_0x1fb0eb++){var _0x14d4b5=_0x122ca9[_0x1fb0eb][_0x2983('0x7')](':=');var _0x4097d1=_0x14d4b5[0x0];var _0x1a99a9=_0x14d4b5['slice'](0x1);_0x1a99a9['forEach'](function(_0x4688ef){var _0x4e4b85=_0x4688ef[_0x2983('0x7')]('[')['shift']();var _0x36e55c=_0x4688ef[_0x2983('0x9')](/\[(.*?)\]/g);_0x36e55c[_0x2983('0xa')](function(_0x3aa805){var _0xebd60=_0x3aa805[_0x2983('0x7')]('[')[_0x2983('0xb')](function(_0x32414a){return _0x32414a[_0x2983('0xc')](']')>-0x1;})[_0x2983('0xd')](function(_0x3f2179){return _0x3f2179[_0x2983('0x7')](']')[0x0];})[0x0];_0x52dca7[_0x2983('0xe')]['push']({'field':_0x4097d1,'operator':_0x4e4b85,'value':_0xebd60});});});}return _0x52dca7;};exports['buildExpression']=function(_0x4ed07c,_0x252e63,_0x120d1f){var _0x561114={};if(_0x252e63===_0x2983('0xf')){if(_0x120d1f[_0x2983('0x10')]===_0x2983('0x11')){_0x120d1f[_0x2983('0x10')]='$between';_0x120d1f['value']+=','+_0x120d1f['value'];}else if(_[_0x2983('0x12')]([_0x2983('0x13'),_0x2983('0x14')],_0x120d1f['operator'])){_0x120d1f[_0x2983('0x15')]=moment(_0x120d1f['value'])[_0x2983('0x16')](0x1,_0x2983('0x17'))[_0x2983('0x18')]('YYYY-MM-DD');}}if(_0x120d1f[_0x2983('0x19')]){_0x252e63=_0x120d1f[_0x2983('0x19')];_0x561114[_0x2983('0x1a')]=_0x2983('0x1b')+_0x4ed07c+'.'+_0x120d1f[_0x2983('0x1c')]+_0x2983('0x1d')+_0x120d1f[_0x2983('0x19')]+')\x20'+parseOperator(_0x120d1f[_0x2983('0x10')]);}else{_0x561114[_0x2983('0x1a')]=_0x4ed07c+'.'+_0x120d1f[_0x2983('0x1c')]+'\x20'+parseOperator(_0x120d1f[_0x2983('0x10')]);}if(_[_0x2983('0x12')]([_0x2983('0x1e'),'$notIn'],_0x120d1f['operator']))_0x561114[_0x2983('0x1a')]='('+_0x561114[_0x2983('0x1a')]+_0x2983('0x1f')+_0x4ed07c+'.'+_0x120d1f['field']+_0x2983('0x20');_0x561114['value']=parseValue(_0x252e63,_0x120d1f[_0x2983('0x10')],_0x120d1f[_0x2983('0x15')]);return _0x561114;};function parseOperator(_0x3e8cd7){var _0x322996;switch(_0x3e8cd7){case _0x2983('0x21'):_0x322996=_0x2983('0x22');break;case _0x2983('0x23'):_0x322996='NOT\x20IN\x20?';break;case _0x2983('0x11'):_0x322996=_0x2983('0x24');break;case _0x2983('0x1e'):_0x322996=_0x2983('0x25');break;case _0x2983('0x26'):case _0x2983('0x27'):case'$endsWith':_0x322996=_0x2983('0x28');break;case _0x2983('0x29'):_0x322996='<\x20?';break;case _0x2983('0x13'):_0x322996='>\x20?';break;case'$lte':_0x322996='<=\x20?';break;case'$gte':_0x322996='>=\x20?';break;case _0x2983('0x2a'):_0x322996=_0x2983('0x2b');break;}return _0x322996;}function parseValue(_0x11b0b8,_0x38cdc3,_0x58d8c7){var _0x2a74fe={'start':undefined,'end':undefined};switch(_0x38cdc3){case _0x2983('0x21'):case _0x2983('0x23'):_0x2a74fe[_0x2983('0x2c')]=_0x58d8c7['split'](',');break;case _0x2983('0x26'):_0x2a74fe['start']='%'+_0x58d8c7+'%';break;case _0x2983('0x27'):_0x2a74fe[_0x2983('0x2c')]=_0x58d8c7+'%';break;case _0x2983('0x2d'):_0x2a74fe[_0x2983('0x2c')]='%'+_0x58d8c7;break;case'$between':var _0x231608=_0x58d8c7[_0x2983('0x7')](',');var _0x58d8c7=_0x231608[_0x2983('0x2e')]();var _0x385b7b=_0x231608[_0x2983('0x2f')]();if(_0x11b0b8===_0x2983('0xf')){_0x58d8c7=moment(_0x58d8c7)[_0x2983('0x30')](0x0,!![])[_0x2983('0x18')]();_0x385b7b=moment(_0x385b7b)[_0x2983('0x30')](0x0,!![])[_0x2983('0x16')](0x17,_0x2983('0x31'))[_0x2983('0x16')](0x3b,_0x2983('0x32'))[_0x2983('0x16')](0x3b,'seconds')[_0x2983('0x18')]();}_0x2a74fe={'start':_0x58d8c7,'end':_0x385b7b};break;default:_0x2a74fe['start']=_0x58d8c7;break;}return _0x2a74fe;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 08409e6..be060c0 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 _0xd40f=['cast','col','priority','unsigned','substr','DESC','ASC','length','omit','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','includes','join','getOptions','query','$id','intersection','model','attributes','nolimit','offset','order','filter','where','VIRTUAL','lower','name','merge','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','isArray','limit','sort','map','indexOf'];(function(_0x574d9b,_0x2063da){var _0x31d2a5=function(_0x97ce4c){while(--_0x97ce4c){_0x574d9b['push'](_0x574d9b['shift']());}};_0x31d2a5(++_0x2063da);}(_0xd40f,0x111));var _0xfd40=function(_0x24bd79,_0x1752ae){_0x24bd79=_0x24bd79-0x0;var _0x137cb3=_0xd40f[_0x24bd79];return _0x137cb3;};'use strict';var _=require(_0xfd40('0x0'));var sequelize=require(_0xfd40('0x1'));var moment=require(_0xfd40('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3a0f92){var _0x2260b2=['ne'];try{var _0x5c16ff=JSON[_0xfd40('0x3')](_0x3a0f92);var _0x241117=Object['keys'](_0x5c16ff)[0x0];return _0x2260b2['includes'](_0x241117);}catch(_0x44c45a){return![];}}function getOperatorValue(_0x305763){var _0x496434=JSON[_0xfd40('0x3')](_0x305763);var _0x1cd3f7=Object[_0xfd40('0x4')](_0x496434)[0x0];var _0x31a4ca=_0x496434[_0x1cd3f7];return{['$'+_0x1cd3f7]:_0x31a4ca};}exports[_0xfd40('0x5')]=function(_0x8e0a6){var _0x2fd902=null;if(_0x8e0a6){_0x2fd902=_0x8e0a6[_0xfd40('0x6')](',');}return _0x2fd902;};exports[_0xfd40('0x7')]=function(_0x53ec1a,_0x3151a0){var _0x4018f3={};if(!_[_0xfd40('0x8')](_0x53ec1a)){_[_0xfd40('0x9')](_0x53ec1a,function(_0x162d7c,_0x46f77f){try{if(_0x3151a0){var _0x3c3d6f=_['find'](_0x3151a0,{'name':_0x46f77f})||{};if(hasSequelizeOperator(_0x162d7c)){_0x4018f3[_0x46f77f]=getOperatorValue(_0x162d7c);}else if(_0x3c3d6f[_0xfd40('0xa')]===_0xfd40('0xb')&&_[_0xfd40('0xc')](_0x162d7c)){var _0x59cbe9=JSON[_0xfd40('0x3')](_0x162d7c);var _0x128c2d={'$gte':moment(moment(_0x59cbe9[_0xfd40('0xd')])[_0xfd40('0xe')](_0xfd40('0xf')))['utc']()[_0xfd40('0xe')](),'$lte':moment(moment(_0x59cbe9['$lte'])['format'](_0xfd40('0xf')))[_0xfd40('0x10')]()['subtract'](0x1,'s')[_0xfd40('0xe')]()};_0x4018f3[_0x46f77f]=_0x128c2d;}else if(_0x3c3d6f['name']==='uniqueid'){_0x4018f3[_0x46f77f]=_0x162d7c;}else{_0x4018f3[_0x46f77f]=_['isArray'](_0x162d7c)?_0x162d7c:JSON[_0xfd40('0x3')](_0x162d7c);}}else{_0x4018f3[_0x46f77f]=_[_0xfd40('0x11')](_0x162d7c)?_0x162d7c:JSON['parse'](_0x162d7c);}}catch(_0x2836f3){_0x4018f3[_0x46f77f]=_0x162d7c['split'](',');}});}return _0x4018f3;};exports[_0xfd40('0x12')]=function(_0x55c135){_0x55c135=parseInt(_0x55c135,0xa);if(!_0x55c135||_0x55c135<0x0){_0x55c135=LIMIT_VALUE;}return _0x55c135;};exports['offset']=function(_0x3c2603){_0x3c2603=parseInt(_0x3c2603,0xa);if(!_0x3c2603||_0x3c2603<0x0){_0x3c2603=0x0;}return _0x3c2603;};exports[_0xfd40('0x13')]=function(_0x399993){var _0x5ceccd,_0x413992=null;if(_0x399993){_0x5ceccd=_0x399993[_0xfd40('0x6')](',');_0x413992=_[_0xfd40('0x14')](_0x5ceccd,function(_0x4d7a6d){if(_0x4d7a6d[_0xfd40('0x15')]('-')===0x0){return[_0x4d7a6d==='priority'?sequelize[_0xfd40('0x16')](sequelize[_0xfd40('0x17')](_0xfd40('0x18')),_0xfd40('0x19')):_0x4d7a6d[_0xfd40('0x1a')](0x1),_0xfd40('0x1b')];}else{return[_0x4d7a6d==='priority'?sequelize[_0xfd40('0x16')](sequelize[_0xfd40('0x17')](_0xfd40('0x18')),_0xfd40('0x19')):_0x4d7a6d,_0xfd40('0x1c')];}});}return _0x413992;};exports['omit']=function(_0x61c81d,_0x1fd1a9){if(_[_0xfd40('0x8')](_0x61c81d)){return _0x61c81d;}if(_[_0xfd40('0x11')](_0x61c81d)){for(var _0x51ebc6=0x0;_0x51ebc6<_0x61c81d[_0xfd40('0x1d')];_0x51ebc6+=0x1){_0x61c81d[_0x51ebc6]=this[_0xfd40('0x1e')](_0x61c81d[_0x51ebc6],_0x1fd1a9);}return _0x61c81d;}if(!_[_0xfd40('0x1f')](_0x61c81d)){return _0x61c81d;}if(_['isString'](_0x1fd1a9)){_0x1fd1a9=[_0x1fd1a9];}if(!_['isArray'](_0x1fd1a9)){return _0x61c81d;}for(var _0x3b71c1=0x0;_0x3b71c1<_0x1fd1a9[_0xfd40('0x1d')];_0x3b71c1+=0x1){_[_0xfd40('0x20')](_0x61c81d,_0x1fd1a9[_0x3b71c1]);}for(var _0x1fe8e9 in _0x61c81d){if(_0x61c81d[_0xfd40('0x21')](_0x1fe8e9)){_0x61c81d[_0x1fe8e9]=this[_0xfd40('0x1e')](_0x61c81d[_0x1fe8e9],_0x1fd1a9);}}return _0x61c81d;};exports[_0xfd40('0x22')]=function(_0x1f7001){return _0x1f7001['match'](RegExp(_0xfd40('0x23')))?!![]:![];};exports[_0xfd40('0x24')]=function(_0x35b0b4){return _0x35b0b4[_0xfd40('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xfd40('0x26')]=function(_0x2d9844){var _0x3249e8=[];_0x2d9844[_0xfd40('0x6')](/[ ,]+/)[_0xfd40('0x27')](function(_0x54db15){_0x54db15=_0x54db15[_0xfd40('0x28')](/([^:]")"+/g,'$1');_0x54db15='+'+_0x54db15+'*';if(_0x54db15[_0xfd40('0x29')]('@'))_0x54db15='\x22'+_0x54db15+'\x22';_0x3249e8['push'](_0x54db15);});return _0x3249e8[_0xfd40('0x2a')]('\x20');};exports[_0xfd40('0x2b')]=function(_0x3e3717,_0xede742,_0x5309a6){var _0x211ceb={},_0x107165={};if(_0xede742[_0xfd40('0x2c')][_0xfd40('0x2d')]){_0xede742[_0xfd40('0x2c')]['id']=_0xede742[_0xfd40('0x2c')]['$id'];delete _0xede742['query']['$id'];}_0x211ceb['model']=_[_0xfd40('0x14')](_0x3e3717,'name');_0x211ceb[_0xfd40('0x2c')]=_[_0xfd40('0x4')](_0xede742[_0xfd40('0x2c')]);_0x211ceb['filters']=_[_0xfd40('0x2e')](_0x211ceb[_0xfd40('0x2f')],_0x211ceb[_0xfd40('0x2c')]);_0x107165[_0xfd40('0x30')]=_['intersection'](_0x211ceb['model'],this['fields'](_0xede742['query'][_0xfd40('0x5')]));_0x107165['attributes']=_0x107165['attributes']['length']?_0x107165['attributes']:_0x211ceb[_0xfd40('0x2f')];if(!_0xede742['query'][_0xfd40('0x21')](_0xfd40('0x31'))){_0x107165[_0xfd40('0x12')]=this[_0xfd40('0x12')](_0xede742['query']['limit']);_0x107165[_0xfd40('0x32')]=this[_0xfd40('0x32')](_0xede742[_0xfd40('0x2c')][_0xfd40('0x32')]);}_0x107165[_0xfd40('0x33')]=this[_0xfd40('0x13')](_0xede742[_0xfd40('0x2c')]['sort']);_0x107165['where']=this['filters'](_['pick'](_0xede742[_0xfd40('0x2c')],_0x211ceb[_0xfd40('0x7')]),_0x3e3717);if(_0xede742['query'][_0xfd40('0x34')]){_0x107165[_0xfd40('0x35')]=_['merge'](_0x107165[_0xfd40('0x35')],{'$or':_[_0xfd40('0x14')](_0x3e3717,function(_0x23cbe1){if(_0x23cbe1[_0xfd40('0xa')]!==_0xfd40('0x36')){if(_0x5309a6){return sequelize['where'](sequelize['fn'](_0xfd40('0x37'),sequelize['col'](_0x23cbe1[_0xfd40('0x38')])),{'$like':sequelize['fn'](_0xfd40('0x37'),'%'+_0xede742[_0xfd40('0x2c')]['filter']+'%')});}else{var _0x1a102d={};_0x1a102d[_0x23cbe1[_0xfd40('0x38')]]={'$like':'%'+_0xede742['query'][_0xfd40('0x34')]+'%'};return _0x1a102d;}}})});}_0x107165=_[_0xfd40('0x39')]({},_0x107165,_0xede742[_0xfd40('0x3a')]);return _0x107165;}; \ No newline at end of file +var _0xa6c8=['isEmail','getFullTextValue','forEach','push','getOptions','query','$id','model','intersection','attributes','limit','order','where','filter','merge','lower','options','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','isPlainObject','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','col','priority','unsigned','DESC','cast','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0xa6c8,0x1c9));var _0x8a6c=function(_0x30a0ab,_0xc6113c){_0x30a0ab=_0x30a0ab-0x0;var _0x5c412b=_0xa6c8[_0x30a0ab];return _0x5c412b;};'use strict';var _=require('lodash');var sequelize=require(_0x8a6c('0x0'));var moment=require(_0x8a6c('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3138cd){var _0x210186=['ne'];try{var _0x1cfd2f=JSON[_0x8a6c('0x2')](_0x3138cd);var _0x41da50=Object[_0x8a6c('0x3')](_0x1cfd2f)[0x0];return _0x210186[_0x8a6c('0x4')](_0x41da50);}catch(_0x165c2e){return![];}}function getOperatorValue(_0x234a7e){var _0x1b11b8=JSON[_0x8a6c('0x2')](_0x234a7e);var _0x5a8fe2=Object[_0x8a6c('0x3')](_0x1b11b8)[0x0];var _0x372a6f=_0x1b11b8[_0x5a8fe2];return{['$'+_0x5a8fe2]:_0x372a6f};}exports[_0x8a6c('0x5')]=function(_0x7f6f79){var _0x2eff82=null;if(_0x7f6f79){_0x2eff82=_0x7f6f79[_0x8a6c('0x6')](',');}return _0x2eff82;};exports[_0x8a6c('0x7')]=function(_0x39fdec,_0xac7a15){var _0x18bbb9={};if(!_[_0x8a6c('0x8')](_0x39fdec)){_[_0x8a6c('0x9')](_0x39fdec,function(_0x13ef07,_0x55b3b6){try{if(_0xac7a15){var _0x12865a=_[_0x8a6c('0xa')](_0xac7a15,{'name':_0x55b3b6})||{};if(hasSequelizeOperator(_0x13ef07)){_0x18bbb9[_0x55b3b6]=getOperatorValue(_0x13ef07);}else if(_0x12865a[_0x8a6c('0xb')]==='DATE'&&_[_0x8a6c('0xc')](_0x13ef07)){var _0x309cd4=JSON['parse'](_0x13ef07);var _0x2aee80={'$gte':moment(moment(_0x309cd4['$gte'])[_0x8a6c('0xd')](_0x8a6c('0xe')))[_0x8a6c('0xf')]()[_0x8a6c('0xd')](),'$lte':moment(moment(_0x309cd4['$lte'])[_0x8a6c('0xd')](_0x8a6c('0xe')))['utc']()[_0x8a6c('0x10')](0x1,'s')[_0x8a6c('0xd')]()};_0x18bbb9[_0x55b3b6]=_0x2aee80;}else if(_0x12865a[_0x8a6c('0x11')]===_0x8a6c('0x12')){_0x18bbb9[_0x55b3b6]=_0x13ef07;}else{_0x18bbb9[_0x55b3b6]=_[_0x8a6c('0x13')](_0x13ef07)?_0x13ef07:JSON[_0x8a6c('0x2')](_0x13ef07);}}else{_0x18bbb9[_0x55b3b6]=_[_0x8a6c('0x13')](_0x13ef07)?_0x13ef07:JSON[_0x8a6c('0x2')](_0x13ef07);}}catch(_0x1d65db){_0x18bbb9[_0x55b3b6]=_0x13ef07[_0x8a6c('0x6')](',');}});}return _0x18bbb9;};exports['limit']=function(_0x214b38){_0x214b38=parseInt(_0x214b38,0xa);if(!_0x214b38||_0x214b38<0x0){_0x214b38=LIMIT_VALUE;}return _0x214b38;};exports[_0x8a6c('0x14')]=function(_0x15748a){_0x15748a=parseInt(_0x15748a,0xa);if(!_0x15748a||_0x15748a<0x0){_0x15748a=0x0;}return _0x15748a;};exports[_0x8a6c('0x15')]=function(_0x8f3574){var _0x579cf2,_0x140c38=null;if(_0x8f3574){_0x579cf2=_0x8f3574[_0x8a6c('0x6')](',');_0x140c38=_[_0x8a6c('0x16')](_0x579cf2,function(_0x2534fb){if(_0x2534fb[_0x8a6c('0x17')]('-')===0x0){return[_0x2534fb==='priority'?sequelize['cast'](sequelize[_0x8a6c('0x18')](_0x8a6c('0x19')),_0x8a6c('0x1a')):_0x2534fb['substr'](0x1),_0x8a6c('0x1b')];}else{return[_0x2534fb===_0x8a6c('0x19')?sequelize[_0x8a6c('0x1c')](sequelize[_0x8a6c('0x18')]('priority'),_0x8a6c('0x1a')):_0x2534fb,'ASC'];}});}return _0x140c38;};exports[_0x8a6c('0x1d')]=function(_0x2e8559,_0x157e5d){if(_[_0x8a6c('0x8')](_0x2e8559)){return _0x2e8559;}if(_['isArray'](_0x2e8559)){for(var _0x55b830=0x0;_0x55b830<_0x2e8559[_0x8a6c('0x1e')];_0x55b830+=0x1){_0x2e8559[_0x55b830]=this[_0x8a6c('0x1d')](_0x2e8559[_0x55b830],_0x157e5d);}return _0x2e8559;}if(!_[_0x8a6c('0x1f')](_0x2e8559)){return _0x2e8559;}if(_[_0x8a6c('0x20')](_0x157e5d)){_0x157e5d=[_0x157e5d];}if(!_[_0x8a6c('0x13')](_0x157e5d)){return _0x2e8559;}for(var _0x7f182b=0x0;_0x7f182b<_0x157e5d[_0x8a6c('0x1e')];_0x7f182b+=0x1){_[_0x8a6c('0x21')](_0x2e8559,_0x157e5d[_0x7f182b]);}for(var _0x3024a7 in _0x2e8559){if(_0x2e8559[_0x8a6c('0x22')](_0x3024a7)){_0x2e8559[_0x3024a7]=this['omit'](_0x2e8559[_0x3024a7],_0x157e5d);}}return _0x2e8559;};exports[_0x8a6c('0x23')]=function(_0x5699e4){return _0x5699e4[_0x8a6c('0x24')](RegExp(_0x8a6c('0x25')))?!![]:![];};exports[_0x8a6c('0x26')]=function(_0x432c0b){return _0x432c0b['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x8a6c('0x27')]=function(_0x4f0848){var _0x165726=[];_0x4f0848['split'](/[ ,]+/)[_0x8a6c('0x28')](function(_0x5bcbaf){_0x5bcbaf=_0x5bcbaf['replace'](/([^:]")"+/g,'$1');_0x5bcbaf='+'+_0x5bcbaf+'*';if(_0x5bcbaf[_0x8a6c('0x4')]('@'))_0x5bcbaf='\x22'+_0x5bcbaf+'\x22';_0x165726[_0x8a6c('0x29')](_0x5bcbaf);});return _0x165726['join']('\x20');};exports[_0x8a6c('0x2a')]=function(_0x49690e,_0x5fc7f8,_0x45b876){var _0x202e9f={},_0x23dd8c={};if(_0x5fc7f8[_0x8a6c('0x2b')][_0x8a6c('0x2c')]){_0x5fc7f8['query']['id']=_0x5fc7f8['query'][_0x8a6c('0x2c')];delete _0x5fc7f8[_0x8a6c('0x2b')][_0x8a6c('0x2c')];}_0x202e9f[_0x8a6c('0x2d')]=_[_0x8a6c('0x16')](_0x49690e,_0x8a6c('0x11'));_0x202e9f[_0x8a6c('0x2b')]=_['keys'](_0x5fc7f8[_0x8a6c('0x2b')]);_0x202e9f[_0x8a6c('0x7')]=_[_0x8a6c('0x2e')](_0x202e9f[_0x8a6c('0x2d')],_0x202e9f[_0x8a6c('0x2b')]);_0x23dd8c['attributes']=_['intersection'](_0x202e9f[_0x8a6c('0x2d')],this[_0x8a6c('0x5')](_0x5fc7f8['query'][_0x8a6c('0x5')]));_0x23dd8c[_0x8a6c('0x2f')]=_0x23dd8c[_0x8a6c('0x2f')][_0x8a6c('0x1e')]?_0x23dd8c[_0x8a6c('0x2f')]:_0x202e9f[_0x8a6c('0x2d')];if(!_0x5fc7f8[_0x8a6c('0x2b')]['hasOwnProperty']('nolimit')){_0x23dd8c[_0x8a6c('0x30')]=this['limit'](_0x5fc7f8[_0x8a6c('0x2b')][_0x8a6c('0x30')]);_0x23dd8c['offset']=this[_0x8a6c('0x14')](_0x5fc7f8['query'][_0x8a6c('0x14')]);}_0x23dd8c[_0x8a6c('0x31')]=this[_0x8a6c('0x15')](_0x5fc7f8[_0x8a6c('0x2b')][_0x8a6c('0x15')]);_0x23dd8c[_0x8a6c('0x32')]=this[_0x8a6c('0x7')](_['pick'](_0x5fc7f8[_0x8a6c('0x2b')],_0x202e9f['filters']),_0x49690e);if(_0x5fc7f8['query'][_0x8a6c('0x33')]){_0x23dd8c[_0x8a6c('0x32')]=_[_0x8a6c('0x34')](_0x23dd8c[_0x8a6c('0x32')],{'$or':_[_0x8a6c('0x16')](_0x49690e,function(_0x6d8d75){if(_0x6d8d75[_0x8a6c('0xb')]!=='VIRTUAL'){if(_0x45b876){return sequelize[_0x8a6c('0x32')](sequelize['fn'](_0x8a6c('0x35'),sequelize[_0x8a6c('0x18')](_0x6d8d75[_0x8a6c('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x5fc7f8[_0x8a6c('0x2b')]['filter']+'%')});}else{var _0x25d34e={};_0x25d34e[_0x6d8d75['name']]={'$like':'%'+_0x5fc7f8[_0x8a6c('0x2b')][_0x8a6c('0x33')]+'%'};return _0x25d34e;}}})});}_0x23dd8c=_[_0x8a6c('0x34')]({},_0x23dd8c,_0x5fc7f8[_0x8a6c('0x36')]);return _0x23dd8c;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index be311d9..12a3cc9 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7360=['json\x20replacer','split','static','views','/server/views','engine','renderFile','view\x20engine','html','urlencoded','50mb','express','serve-favicon','method-override','cookie-parser','path','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','root','public','development','use'];(function(_0x42c6f1,_0x338d7b){var _0x3c7398=function(_0x151494){while(--_0x151494){_0x42c6f1['push'](_0x42c6f1['shift']());}};_0x3c7398(++_0x338d7b);}(_0x7360,0xa1));var _0x0736=function(_0x22a176,_0x1fa892){_0x22a176=_0x22a176-0x0;var _0x539b0f=_0x7360[_0x22a176];return _0x539b0f;};'use strict';var express=require(_0x0736('0x0'));var favicon=require(_0x0736('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x0736('0x2'));var cookieParser=require(_0x0736('0x3'));var errorHandler=require('errorhandler');var path=require(_0x0736('0x4'));var passport=require('passport');var cors=require(_0x0736('0x5'));var moment=require(_0x0736('0x6'));var config=require(_0x0736('0x7'));var db=require(_0x0736('0x8'))['db'];exports[_0x0736('0x9')]=function(_0x594988){var _0x368293=_0x594988[_0x0736('0xa')](_0x0736('0xb'));if(_0x368293==='production'){_0x594988[_0x0736('0xc')](_0x0736('0xd'),path[_0x0736('0xe')](config[_0x0736('0xf')],_0x0736('0x10')));}if(_0x368293===_0x0736('0x11')||_0x368293==='test'){_0x594988[_0x0736('0xc')](_0x0736('0xd'),path[_0x0736('0xe')](config[_0x0736('0xf')],'client'));_0x594988[_0x0736('0x12')](errorHandler());}_0x594988[_0x0736('0xc')](_0x0736('0x13'),function(_0xd931e6,_0x343f31){if(this[_0xd931e6]instanceof Date){_0x343f31=this[_0xd931e6]['toISOString']()[_0x0736('0x14')]('.')[0x0]+'Z';}return _0x343f31;});_0x594988[_0x0736('0x12')](express[_0x0736('0x15')](_0x594988['get'](_0x0736('0xd'))));_0x594988[_0x0736('0xc')](_0x0736('0x16'),config[_0x0736('0xf')]+_0x0736('0x17'));_0x594988[_0x0736('0x18')]('html',require('ejs')[_0x0736('0x19')]);_0x594988[_0x0736('0xc')](_0x0736('0x1a'),_0x0736('0x1b'));_0x594988[_0x0736('0x12')](bodyParser[_0x0736('0x1c')]({'limit':_0x0736('0x1d'),'extended':!![]}));_0x594988[_0x0736('0x12')](bodyParser['json']({'limit':'50mb'}));_0x594988[_0x0736('0x12')](cors());_0x594988[_0x0736('0x12')](methodOverride());_0x594988[_0x0736('0x12')](cookieParser());_0x594988[_0x0736('0x12')](passport['initialize']());}; \ No newline at end of file +var _0xc520=['body-parser','method-override','cookie-parser','passport','cors','moment','./environment','../mysqldb','default','env','production','set','join','root','public','test','appPath','client','use','json\x20replacer','toISOString','split','static','get','views','/server/views','engine','html','ejs','view\x20engine','urlencoded','json','50mb','initialize'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0xc520,0x66));var _0x0c52=function(_0xb59482,_0x19d041){_0xb59482=_0xb59482-0x0;var _0x42559e=_0xc520[_0xb59482];return _0x42559e;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x0c52('0x0'));var methodOverride=require(_0x0c52('0x1'));var cookieParser=require(_0x0c52('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0c52('0x3'));var cors=require(_0x0c52('0x4'));var moment=require(_0x0c52('0x5'));var config=require(_0x0c52('0x6'));var db=require(_0x0c52('0x7'))['db'];exports[_0x0c52('0x8')]=function(_0x33d7bb){var _0x5c08be=_0x33d7bb['get'](_0x0c52('0x9'));if(_0x5c08be===_0x0c52('0xa')){_0x33d7bb[_0x0c52('0xb')]('appPath',path[_0x0c52('0xc')](config[_0x0c52('0xd')],_0x0c52('0xe')));}if(_0x5c08be==='development'||_0x5c08be===_0x0c52('0xf')){_0x33d7bb[_0x0c52('0xb')](_0x0c52('0x10'),path[_0x0c52('0xc')](config[_0x0c52('0xd')],_0x0c52('0x11')));_0x33d7bb[_0x0c52('0x12')](errorHandler());}_0x33d7bb[_0x0c52('0xb')](_0x0c52('0x13'),function(_0xbffbb2,_0x342ceb){if(this[_0xbffbb2]instanceof Date){_0x342ceb=this[_0xbffbb2][_0x0c52('0x14')]()[_0x0c52('0x15')]('.')[0x0]+'Z';}return _0x342ceb;});_0x33d7bb['use'](express[_0x0c52('0x16')](_0x33d7bb[_0x0c52('0x17')](_0x0c52('0x10'))));_0x33d7bb['set'](_0x0c52('0x18'),config[_0x0c52('0xd')]+_0x0c52('0x19'));_0x33d7bb[_0x0c52('0x1a')](_0x0c52('0x1b'),require(_0x0c52('0x1c'))['renderFile']);_0x33d7bb[_0x0c52('0xb')](_0x0c52('0x1d'),_0x0c52('0x1b'));_0x33d7bb[_0x0c52('0x12')](bodyParser[_0x0c52('0x1e')]({'limit':'50mb','extended':!![]}));_0x33d7bb[_0x0c52('0x12')](bodyParser[_0x0c52('0x1f')]({'limit':_0x0c52('0x20')}));_0x33d7bb['use'](cors());_0x33d7bb[_0x0c52('0x12')](methodOverride());_0x33d7bb['use'](cookieParser());_0x33d7bb['use'](passport[_0x0c52('0x21')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 8793037..5ca38f6 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 _0xb560=['../environment','keys','length','filter','internal','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','getUuid','platform','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','hex','substring','bimedia-machine-uuid','child_process','execSync'];(function(_0x4b5325,_0x5bc67f){var _0x3d8fe5=function(_0x5c0b5e){while(--_0x5c0b5e){_0x4b5325['push'](_0x4b5325['shift']());}};_0x3d8fe5(++_0x5bc67f);}(_0xb560,0x152));var _0x0b56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb560[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x0b56('0x0'));var exec=require(_0x0b56('0x1'))[_0x0b56('0x2')];var config=require(_0x0b56('0x3'));function getInterfaces(){var _0x1451c0=[];var _0x233dcd=os['networkInterfaces']();var _0x34ee88=_['orderBy'](_[_0x0b56('0x4')](_0x233dcd));for(var _0x959964=0x0;_0x959964<_0x34ee88[_0x0b56('0x5')];_0x959964++){var _0x2c5601=_0x233dcd[_0x34ee88[_0x959964]][_0x0b56('0x6')](function(_0x57fd9c){return _0x57fd9c['family']==='IPv4'&&_0x57fd9c[_0x0b56('0x7')]===![];});_0x1451c0=_0x1451c0['concat'](_0x2c5601);}return _0x1451c0;}function getFirstInterface(){var _0x3976b5=_['head'](getInterfaces());return{'macAddress':_0x3976b5&&_0x3976b5[_0x0b56('0x8')]?_0x3976b5[_0x0b56('0x8')]:_0x0b56('0x9'),'ipAddress':_0x3976b5&&_0x3976b5[_0x0b56('0xa')]?_0x3976b5[_0x0b56('0xa')]:'127.0.0.1'};}exports[_0x0b56('0xb')]=getFirstInterface;function getCPUhash(){var _0x7e1851=_['orderBy'](os[_0x0b56('0xc')]()[_0x0b56('0xd')](function(_0x10caca){return _0x10caca[_0x0b56('0xe')];}))[_0x0b56('0xf')](':');return crypto[_0x0b56('0x10')](_0x0b56('0x11'))[_0x0b56('0x12')](_0x7e1851)[_0x0b56('0x13')]('hex');}exports[_0x0b56('0x14')]=function(){var _0x87c907=os[_0x0b56('0x15')]();var _0x23edaf=/[0-9a-f-]{36}/;if(config[_0x0b56('0x16')]&&_0x23edaf[_0x0b56('0x17')](config[_0x0b56('0x16')])){return config[_0x0b56('0x16')];}else if(_0x87c907===_0x0b56('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x0b56('0x19')]('\x0d\x0a','');}else{var _0x2604f2=getFirstInterface();var _0x1a3154=getCPUhash();var _0x1733e5=_0x1a3154+'|'+os[_0x0b56('0x1a')]()+'|'+_0x2604f2[_0x0b56('0x1b')]+'|'+_0x2604f2[_0x0b56('0x1c')];var _0x43024f=crypto['createHash'](_0x0b56('0x11'))['update'](_0x1733e5)[_0x0b56('0x13')](_0x0b56('0x1d'));return _0x43024f['substring'](0x0,0x8)+'-'+_0x43024f['substring'](0x8,0xc)+'-'+_0x43024f[_0x0b56('0x1e')](0xc,0x10)+'-'+_0x43024f[_0x0b56('0x1e')](0x10,0x14)+'-'+_0x43024f[_0x0b56('0x1e')](0x14);}}; \ No newline at end of file +var _0xddcf=['platform','test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','keys','length','family','IPv4','internal','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','update','digest','hex'];(function(_0x2b5b5e,_0x269644){var _0x356a45=function(_0x1eec3c){while(--_0x1eec3c){_0x2b5b5e['push'](_0x2b5b5e['shift']());}};_0x356a45(++_0x269644);}(_0xddcf,0xa9));var _0xfddc=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xddcf[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xfddc('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xfddc('0x1'));var exec=require('child_process')[_0xfddc('0x2')];var config=require(_0xfddc('0x3'));function getInterfaces(){var _0x403a11=[];var _0x33645d=os[_0xfddc('0x4')]();var _0x5bd552=_[_0xfddc('0x5')](_[_0xfddc('0x6')](_0x33645d));for(var _0x4083ff=0x0;_0x4083ff<_0x5bd552[_0xfddc('0x7')];_0x4083ff++){var _0x300ee7=_0x33645d[_0x5bd552[_0x4083ff]]['filter'](function(_0x35caf2){return _0x35caf2[_0xfddc('0x8')]===_0xfddc('0x9')&&_0x35caf2[_0xfddc('0xa')]===![];});_0x403a11=_0x403a11['concat'](_0x300ee7);}return _0x403a11;}function getFirstInterface(){var _0x164eed=_[_0xfddc('0xb')](getInterfaces());return{'macAddress':_0x164eed&&_0x164eed[_0xfddc('0xc')]?_0x164eed[_0xfddc('0xc')]:'00:00:00:00:00:00','ipAddress':_0x164eed&&_0x164eed['address']?_0x164eed[_0xfddc('0xd')]:_0xfddc('0xe')};}exports[_0xfddc('0xf')]=getFirstInterface;function getCPUhash(){var _0x4300ee=_[_0xfddc('0x5')](os[_0xfddc('0x10')]()[_0xfddc('0x11')](function(_0x3f6d2d){return _0x3f6d2d[_0xfddc('0x12')];}))['join'](':');return crypto[_0xfddc('0x13')]('md5')[_0xfddc('0x14')](_0x4300ee)[_0xfddc('0x15')](_0xfddc('0x16'));}exports['getUuid']=function(){var _0x5d0e8b=os[_0xfddc('0x17')]();var _0x59d6fd=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x59d6fd[_0xfddc('0x18')](config['licenseToken'])){return config['licenseToken'];}else if(_0x5d0e8b===_0xfddc('0x19')){return exec(_0xfddc('0x1a'),{'encoding':'utf8'})[_0xfddc('0x1b')]('\x0d\x0a','');}else{var _0x406c80=getFirstInterface();var _0x363a9c=getCPUhash();var _0x273178=_0x363a9c+'|'+os[_0xfddc('0x1c')]()+'|'+_0x406c80[_0xfddc('0x1d')]+'|'+_0x406c80[_0xfddc('0x1e')];var _0x4954dd=crypto[_0xfddc('0x13')]('md5')[_0xfddc('0x14')](_0x273178)[_0xfddc('0x15')](_0xfddc('0x16'));return _0x4954dd['substring'](0x0,0x8)+'-'+_0x4954dd[_0xfddc('0x1f')](0x8,0xc)+'-'+_0x4954dd[_0xfddc('0x1f')](0xc,0x10)+'-'+_0x4954dd['substring'](0x10,0x14)+'-'+_0x4954dd[_0xfddc('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0fd142b..40e8260 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 _0xdd25=['../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','getUuid','License','findOrCreate','default','util','moment','bluebird','pkginfo','version','../../mysqldb'];(function(_0x21443b,_0x30392c){var _0x43b634=function(_0x4d39db){while(--_0x4d39db){_0x21443b['push'](_0x21443b['shift']());}};_0x43b634(++_0x30392c);}(_0xdd25,0xe8));var _0x5dd2=function(_0x4d74b5,_0x2b21a2){_0x4d74b5=_0x4d74b5-0x0;var _0x295d4b=_0xdd25[_0x4d74b5];return _0x295d4b;};'use strict';var util=require(_0x5dd2('0x0'));var moment=require(_0x5dd2('0x1'));var rp=require('request-promise');var BPromise=require(_0x5dd2('0x2'));var pkginfo=require(_0x5dd2('0x3'))(module,_0x5dd2('0x4'));var db=require(_0x5dd2('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x5dd2('0x6'))('license');var HOST=_0x5dd2('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x52bb0e){return new BPromise(function(_0xb75ca3,_0x3cbfbd){var _0x356168=util[_0x5dd2('0x8')](_0x5dd2('0x9'),HOST,_0x52bb0e,module[_0x5dd2('0xa')][_0x5dd2('0x4')]);if(oldToken){_0x356168=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x52bb0e,module['exports'][_0x5dd2('0x4')],oldToken);}var _0x4e7a8b={'uri':_0x356168,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4e7a8b)[_0x5dd2('0xb')](function(_0x295275){_0xb75ca3(_0x295275);})[_0x5dd2('0xc')](function(_0x9fe7e7){_0x3cbfbd(_0x9fe7e7);});});}function manageLicense(_0x42f083,_0x3611e8){var _0x20f265=_0x3611e8[_0x5dd2('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x20f265[_0x5dd2('0xe')]!==_0x42f083&&!_0x20f265[_0x5dd2('0xf')]){oldToken=_0x20f265[_0x5dd2('0xe')];}httpRequest(_0x42f083)['then'](function(_0x3fa42c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3fa42c[_0x5dd2('0x10')]){isOldTokenSent=![];if(!_0x20f265['license']&&_0x20f265[_0x5dd2('0x11')]!=_0x3fa42c['license']||_0x20f265[_0x5dd2('0x11')]&&_0x20f265[_0x5dd2('0xf')]){logger[_0x5dd2('0x12')](_0x5dd2('0x13'));}if(_0x20f265[_0x5dd2('0x11')]&&!_0x20f265['data2']&&_0x20f265[_0x5dd2('0x11')]!=_0x3fa42c['license']){logger['info'](_0x5dd2('0x14'));}if(_0x20f265[_0x5dd2('0x11')]&&!_0x20f265[_0x5dd2('0xf')]&&_0x20f265['license']==_0x3fa42c[_0x5dd2('0x11')]){return _0x3611e8;}return _0x3611e8[_0x5dd2('0x15')]({'data1':_0x42f083,'data2':null,'license':_0x3fa42c['license']});}else{if(_0x3fa42c[_0x5dd2('0x11')]||_0x20f265[_0x5dd2('0x11')]){if(!_0x20f265[_0x5dd2('0xf')]){if(_0x20f265[_0x5dd2('0xe')]==_0x42f083){GRAY_PERIOD_REASON=_0x5dd2('0x16');logger[_0x5dd2('0x12')](_0x5dd2('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x20f265[_0x5dd2('0xe')],_0x42f083);}logger[_0x5dd2('0x12')](_0x5dd2('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x5dd2('0x19')));return _0x3611e8[_0x5dd2('0x15')]({'data2':encryptor[_0x5dd2('0x1a')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x5dd2('0x1b')](encryptor[_0x5dd2('0x1c')](_0x20f265[_0x5dd2('0xf')]),_0x5dd2('0x1d'))>DAYS){logger[_0x5dd2('0x12')]('DEMO\x20START\x20AT\x20%s',moment()[_0x5dd2('0x8')](_0x5dd2('0x19')));isOldTokenSent=![];return _0x3611e8['update']({'data1':_0x42f083,'data2':null,'license':null});}}}else{if(_0x20f265['data1']!=_0x42f083){logger[_0x5dd2('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x20f265[_0x5dd2('0xe')],_0x42f083);return _0x3611e8[_0x5dd2('0x15')]({'data1':_0x42f083,'data2':null,'license':null});}}}return _0x3611e8;})[_0x5dd2('0xb')](function(_0x4e0638){_0x3611e8=_0x4e0638;})[_0x5dd2('0xc')](function(_0x289681){logger['error'](_0x289681['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x5dd2('0x1e')](),_0x3611e8);},TIME);});}function defaultLicense(){var _0x173e5d=hardware[_0x5dd2('0x1e')]();if(_0x173e5d){return db[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x173e5d}})['spread'](function(_0x551098,_0x53a3ce){logger[_0x5dd2('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x173e5d);manageLicense(_0x173e5d,_0x551098);})[_0x5dd2('0xc')](function(_0x4b2285){logger['error'](_0x4b2285['message']);});}}exports[_0x5dd2('0x21')]=defaultLicense; \ No newline at end of file +var _0x0a72=['License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid'];(function(_0x4b7976,_0x55e10b){var _0x422298=function(_0x531d4b){while(--_0x531d4b){_0x4b7976['push'](_0x4b7976['shift']());}};_0x422298(++_0x55e10b);}(_0x0a72,0x163));var _0x20a7=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x0a72[_0x5c351c];return _0x26f3b3;};'use strict';var util=require(_0x20a7('0x0'));var moment=require(_0x20a7('0x1'));var rp=require('request-promise');var BPromise=require(_0x20a7('0x2'));var pkginfo=require(_0x20a7('0x3'))(module,_0x20a7('0x4'));var db=require(_0x20a7('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x20a7('0x6'));var logger=require(_0x20a7('0x7'))(_0x20a7('0x8'));var HOST=_0x20a7('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4b13c6){return new BPromise(function(_0x1bed70,_0x346ee0){var _0x3c032b=util['format'](_0x20a7('0xa'),HOST,_0x4b13c6,module[_0x20a7('0xb')][_0x20a7('0x4')]);if(oldToken){_0x3c032b=util[_0x20a7('0xc')](_0x20a7('0xd'),HOST,_0x4b13c6,module[_0x20a7('0xb')]['version'],oldToken);}var _0x25567e={'uri':_0x3c032b,'method':_0x20a7('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x25567e)[_0x20a7('0xf')](function(_0x3f92d3){_0x1bed70(_0x3f92d3);})['catch'](function(_0xe6c37b){_0x346ee0(_0xe6c37b);});});}function manageLicense(_0x2251c5,_0x5c31c5){var _0x5a60a6=_0x5c31c5['get']({'plain':!![]});if(!isOldTokenSent&&_0x5a60a6[_0x20a7('0x10')]!==_0x2251c5&&!_0x5a60a6[_0x20a7('0x11')]){oldToken=_0x5a60a6[_0x20a7('0x10')];}httpRequest(_0x2251c5)[_0x20a7('0xf')](function(_0x32ad78){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x32ad78[_0x20a7('0x12')]){isOldTokenSent=![];if(!_0x5a60a6[_0x20a7('0x8')]&&_0x5a60a6[_0x20a7('0x8')]!=_0x32ad78['license']||_0x5a60a6[_0x20a7('0x8')]&&_0x5a60a6[_0x20a7('0x11')]){logger[_0x20a7('0x13')](_0x20a7('0x14'));}if(_0x5a60a6[_0x20a7('0x8')]&&!_0x5a60a6['data2']&&_0x5a60a6[_0x20a7('0x8')]!=_0x32ad78[_0x20a7('0x8')]){logger['info'](_0x20a7('0x15'));}if(_0x5a60a6[_0x20a7('0x8')]&&!_0x5a60a6[_0x20a7('0x11')]&&_0x5a60a6[_0x20a7('0x8')]==_0x32ad78['license']){return _0x5c31c5;}return _0x5c31c5[_0x20a7('0x16')]({'data1':_0x2251c5,'data2':null,'license':_0x32ad78[_0x20a7('0x8')]});}else{if(_0x32ad78[_0x20a7('0x8')]||_0x5a60a6[_0x20a7('0x8')]){if(!_0x5a60a6['data2']){if(_0x5a60a6[_0x20a7('0x10')]==_0x2251c5){GRAY_PERIOD_REASON='Disabled';logger[_0x20a7('0x13')](_0x20a7('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x20a7('0x13')](_0x20a7('0x18'),_0x5a60a6['data1'],_0x2251c5);}logger[_0x20a7('0x13')](_0x20a7('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x20a7('0xc')](_0x20a7('0x1a')));return _0x5c31c5[_0x20a7('0x16')]({'data2':encryptor['encryptString'](moment()[_0x20a7('0xc')](_0x20a7('0x1a')))});}else{if(moment()['diff'](encryptor[_0x20a7('0x1b')](_0x5a60a6[_0x20a7('0x11')]),_0x20a7('0x1c'))>DAYS){logger[_0x20a7('0x13')](_0x20a7('0x1d'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x5c31c5[_0x20a7('0x16')]({'data1':_0x2251c5,'data2':null,'license':null});}}}else{if(_0x5a60a6[_0x20a7('0x10')]!=_0x2251c5){logger['info'](_0x20a7('0x18'),_0x5a60a6[_0x20a7('0x10')],_0x2251c5);return _0x5c31c5['update']({'data1':_0x2251c5,'data2':null,'license':null});}}}return _0x5c31c5;})[_0x20a7('0xf')](function(_0xa5e32d){_0x5c31c5=_0xa5e32d;})[_0x20a7('0x1e')](function(_0x25011d){logger[_0x20a7('0x1f')](_0x25011d[_0x20a7('0x20')]);})[_0x20a7('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x20a7('0x22')](),_0x5c31c5);},TIME);});}function defaultLicense(){var _0x52584b=hardware[_0x20a7('0x22')]();if(_0x52584b){return db[_0x20a7('0x23')][_0x20a7('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x52584b}})[_0x20a7('0x25')](function(_0x3ddd6f,_0x5a274d){logger['info'](_0x20a7('0x26'),_0x52584b);manageLicense(_0x52584b,_0x3ddd6f);})[_0x20a7('0x1e')](function(_0x2c94a3){logger[_0x20a7('0x1f')](_0x2c94a3[_0x20a7('0x20')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c3889ce..53246a1 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 _0x0c61=['disabled','message','User','findAll','role','COUNT','sequelize','admin','user','telephone','telephones','forEach','count','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','moment','bluebird','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x0c61,0x17b));var _0x10c6=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0x0c61[_0x322bef];return _0x229e60;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x10c6('0x0'));var BPromise=require(_0x10c6('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x10c6('0x2'))['db'];const demoLicense={'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':![],'description':_0x10c6('0x3'),'machineUuid':hardware[_0x10c6('0x4')](),'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':_0x10c6('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5af73b){return new BPromise(function(_0x2d3d72,_0x32c6f0){return db[_0x10c6('0x6')][_0x10c6('0x7')](_[_0x10c6('0x8')](_0x5af73b,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5cc6e7){return checkLicense(_0x5cc6e7,null);})[_0x10c6('0x9')](function(_0x45c25f){_0x2d3d72(_0x45c25f);return;})['catch'](function(_0x3c1c9e){_0x32c6f0(_0x3c1c9e);});});}function checkLicense(_0x2c6dda,_0x5c5370){if(!_0x2c6dda){demoLicense[_0x10c6('0xa')]=_0x2c6dda[_0x10c6('0xb')];return demoLicense;}try{var _0x459c9a=_0x5c5370||_0x2c6dda[_0x10c6('0xc')];if(_[_0x10c6('0xd')](_0x459c9a)){throw new Error(_0x10c6('0xe'));}var _0x9cbc30=_0x2c6dda[_0x10c6('0xb')];var _0x339e33=_0x2c6dda['data2'];var _0x552109=_0x9cbc30[_0x10c6('0xf')]('-')[0x4];var _0x21cb1e=_0x9cbc30[_0x10c6('0xf')]('-')[0x0];var _0x5b060c=encryptor[_0x10c6('0x10')](_0x459c9a,util[_0x10c6('0x11')](_0x10c6('0x12'),_0x552109,_0x9cbc30,_0x21cb1e));var _0x5cb332=JSON[_0x10c6('0x13')](_0x5b060c);_0x5cb332[_0x10c6('0x14')]=![];_0x5cb332[_0x10c6('0xa')]=_0x9cbc30;_0x5cb332[_0x10c6('0x15')]=hardware[_0x10c6('0x4')]();if(_0x339e33){var _0x2d8551=encryptor['decryptString'](_0x339e33);_0x5cb332[_0x10c6('0x16')]=_0x2d8551;_0x5cb332[_0x10c6('0x17')]=moment(_0x2d8551)[_0x10c6('0x18')](0x7,_0x10c6('0x19'))[_0x10c6('0x11')]();_0x5cb332['grayReason']=_0x5cb332[_0x10c6('0xa')]!=_0x5cb332[_0x10c6('0x15')]?'changed':_0x10c6('0x1a');}return _0x5cb332;}catch(_0x2973ee){breakingLicense[_0x10c6('0xa')]=_0x2c6dda[_0x10c6('0xb')];breakingLicense[_0x10c6('0x1b')]=_0x2973ee[_0x10c6('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x27685c,_0x3ea328){getLicense()[_0x10c6('0x9')](function(_0x516a60){return db[_0x10c6('0x1c')][_0x10c6('0x1d')]({'attributes':[_0x10c6('0x1e'),[db['sequelize']['fn'](_0x10c6('0x1f'),db[_0x10c6('0x20')]['col']('role')),'count']],'group':_0x10c6('0x1e'),'where':{'role':{'$or':[_0x10c6('0x21'),_0x10c6('0x22'),_0x10c6('0x23')]}},'raw':!![]})[_0x10c6('0x9')](function(_0x36262d){var _0x386dc7={'user':_0x516a60['users']||0x0,'telephone':_0x516a60[_0x10c6('0x24')]||0x0};_0x36262d[_0x10c6('0x25')](function(_0x2147a4){var _0x29dc7b=_0x2147a4['role']==='admin'?'user':_0x2147a4['role'];_0x386dc7[_0x29dc7b]-=_0x2147a4[_0x10c6('0x26')];if(_0x386dc7[_0x29dc7b]<0x0)_0x386dc7[_0x29dc7b]=0x0;});_0x27685c(_0x386dc7);return;});})[_0x10c6('0x27')](function(_0x4297d4){_0x3ea328(_0x4297d4);});});}function checkUserLimits(_0x223c45){return new BPromise(function(_0x48aa09,_0x4a3265){getLimits()['then'](function(_0x5cb6cf){var _0x4eb44d=_[_0x10c6('0x28')](_[_0x10c6('0x29')](_0x223c45,_0x10c6('0x1e')),[_0x10c6('0x21'),_0x10c6('0x22'),_0x10c6('0x23')]);var _0x1cfb8e=(_0x4eb44d[_0x10c6('0x21')]||0x0)+(_0x4eb44d['user']||0x0);var _0x1c61f8=_0x4eb44d[_0x10c6('0x23')]||0x0;if(_0x1cfb8e>_0x5cb6cf['user'])return _0x4a3265(_0x10c6('0x2a'));if(_0x1c61f8>_0x5cb6cf[_0x10c6('0x23')])return _0x4a3265(_0x10c6('0x2b'));return _0x48aa09();})[_0x10c6('0x27')](function(_0x1374f5){_0x4a3265(_0x1374f5);});});}module[_0x10c6('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xe67e=['forEach','user','catch','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','defaults','then','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','days','grayReason','uuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','users','telephones'];(function(_0x21f405,_0x56482c){var _0x4de264=function(_0x4ea53a){while(--_0x4ea53a){_0x21f405['push'](_0x21f405['shift']());}};_0x4de264(++_0x56482c);}(_0xe67e,0xc7));var _0xee67=function(_0x2b4ba6,_0x2dd49e){_0x2b4ba6=_0x2b4ba6-0x0;var _0x51eb7f=_0xe67e[_0x2b4ba6];return _0x51eb7f;};'use strict';var util=require('util');var _=require(_0xee67('0x0'));var moment=require(_0xee67('0x1'));var BPromise=require(_0xee67('0x2'));var hardware=require(_0xee67('0x3'));var encryptor=require(_0xee67('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xee67('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xee67('0x6'),'machineUuid':hardware['getUuid'](),'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':'Breaking\x20license','machineUuid':hardware[_0xee67('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x54cf01){return new BPromise(function(_0x5bb99a,_0x3db475){return db[_0xee67('0x8')]['find'](_[_0xee67('0x9')](_0x54cf01,{'raw':!![],'where':{'id':0x1}}))[_0xee67('0xa')](function(_0x2e0f74){return checkLicense(_0x2e0f74,null);})['then'](function(_0x506715){_0x5bb99a(_0x506715);return;})['catch'](function(_0x85815a){_0x3db475(_0x85815a);});});}function checkLicense(_0x31cbbc,_0x4f1091){if(!_0x31cbbc){demoLicense['uuid']=_0x31cbbc[_0xee67('0xb')];return demoLicense;}try{var _0x4ab729=_0x4f1091||_0x31cbbc[_0xee67('0xc')];if(_['isEmpty'](_0x4ab729)){throw new Error(_0xee67('0xd'));}var _0x2e1d21=_0x31cbbc[_0xee67('0xb')];var _0x5b9325=_0x31cbbc[_0xee67('0xe')];var _0x57b4d6=_0x2e1d21[_0xee67('0xf')]('-')[0x4];var _0xe617f6=_0x2e1d21[_0xee67('0xf')]('-')[0x0];var _0x2f7727=encryptor[_0xee67('0x10')](_0x4ab729,util[_0xee67('0x11')](_0xee67('0x12'),_0x57b4d6,_0x2e1d21,_0xe617f6));var _0x8bbf1a=JSON[_0xee67('0x13')](_0x2f7727);_0x8bbf1a[_0xee67('0x14')]=![];_0x8bbf1a['uuid']=_0x2e1d21;_0x8bbf1a[_0xee67('0x15')]=hardware[_0xee67('0x7')]();if(_0x5b9325){var _0x496ac5=encryptor['decryptString'](_0x5b9325);_0x8bbf1a[_0xee67('0x16')]=_0x496ac5;_0x8bbf1a[_0xee67('0x17')]=moment(_0x496ac5)['add'](0x7,_0xee67('0x18'))[_0xee67('0x11')]();_0x8bbf1a[_0xee67('0x19')]=_0x8bbf1a[_0xee67('0x1a')]!=_0x8bbf1a['machineUuid']?_0xee67('0x1b'):_0xee67('0x1c');}return _0x8bbf1a;}catch(_0x134ca0){breakingLicense['uuid']=_0x31cbbc[_0xee67('0xb')];breakingLicense['message']=_0x134ca0[_0xee67('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xd916e6,_0x2cfa5a){getLicense()[_0xee67('0xa')](function(_0x1eba37){return db[_0xee67('0x1e')][_0xee67('0x1f')]({'attributes':[_0xee67('0x20'),[db[_0xee67('0x21')]['fn'](_0xee67('0x22'),db['sequelize'][_0xee67('0x23')](_0xee67('0x20'))),_0xee67('0x24')]],'group':_0xee67('0x20'),'where':{'role':{'$or':[_0xee67('0x25'),'user',_0xee67('0x26')]}},'raw':!![]})[_0xee67('0xa')](function(_0x5af479){var _0x28ab87={'user':_0x1eba37[_0xee67('0x27')]||0x0,'telephone':_0x1eba37[_0xee67('0x28')]||0x0};_0x5af479[_0xee67('0x29')](function(_0x2b373f){var _0x4ca4ef=_0x2b373f[_0xee67('0x20')]===_0xee67('0x25')?_0xee67('0x2a'):_0x2b373f[_0xee67('0x20')];_0x28ab87[_0x4ca4ef]-=_0x2b373f['count'];if(_0x28ab87[_0x4ca4ef]<0x0)_0x28ab87[_0x4ca4ef]=0x0;});_0xd916e6(_0x28ab87);return;});})[_0xee67('0x2b')](function(_0x582da0){_0x2cfa5a(_0x582da0);});});}function checkUserLimits(_0x103be0){return new BPromise(function(_0x54592b,_0x1a9135){getLimits()['then'](function(_0x19c131){var _0x400807=_['pick'](_[_0xee67('0x2c')](_0x103be0,_0xee67('0x20')),['admin',_0xee67('0x2a'),_0xee67('0x26')]);var _0x118852=(_0x400807['admin']||0x0)+(_0x400807[_0xee67('0x2a')]||0x0);var _0x1f2173=_0x400807[_0xee67('0x26')]||0x0;if(_0x118852>_0x19c131['user'])return _0x1a9135(_0xee67('0x2d'));if(_0x1f2173>_0x19c131['telephone'])return _0x1a9135(_0xee67('0x2e'));return _0x54592b();})[_0xee67('0x2b')](function(_0x3e448d){_0x1a9135(_0x3e448d);});});}module[_0xee67('0x2f')]={'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 9b552d7..0f60710 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 _0x065e=['secret','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x065e,0x1a7));var _0xe065=function(_0x481657,_0x3f66e4){_0x481657=_0x481657-0x0;var _0x2e5568=_0x065e[_0x481657];return _0x2e5568;};'use strict';module[_0xe065('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe065('0x1'),'DEBUG':''}; \ No newline at end of file +var _0x8e3f=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0xfca98b,_0x475925){var _0x350200=function(_0x451946){while(--_0x451946){_0xfca98b['push'](_0xfca98b['shift']());}};_0x350200(++_0x475925);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';module[_0xf8e3('0x0')]={'DOMAIN':_0xf8e3('0x1'),'SESSION_SECRET':_0xf8e3('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xf8e3('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 73d7d7b..0b92605 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b53=['File','error','info','debugLevel','moment','winston','util','join','/var','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','transports'];(function(_0x3675a1,_0x3f599a){var _0x29c14b=function(_0x586731){while(--_0x586731){_0x3675a1['push'](_0x3675a1['shift']());}};_0x29c14b(++_0x3f599a);}(_0x8b53,0xa4));var _0x38b5=function(_0x2fa24f,_0xdbc34d){_0x2fa24f=_0x2fa24f-0x0;var _0x37facf=_0x8b53[_0x2fa24f];return _0x37facf;};'use strict';var moment=require(_0x38b5('0x0'));var winston=require(_0x38b5('0x1'));var util=require(_0x38b5('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x13bd8a,_0x18d35c){return path[_0x38b5('0x3')](_0x38b5('0x4'),'log','xcally',util['format'](_0x38b5('0x5'),_0x13bd8a,_0x18d35c));}function formatter(_0x111ea6,_0x2b74f9){_0x2b74f9[_0x38b5('0x6')]=_0x2b74f9[_0x38b5('0x6')][_0x38b5('0x7')](/@@{/g,_0x38b5('0x8'))[_0x38b5('0x7')](/}@@/g,_0x38b5('0x9'))[_0x38b5('0x7')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x38b5('0xa')](_0x38b5('0xb'),moment()[_0x38b5('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2b74f9[_0x38b5('0xc')][_0x38b5('0xd')](),_0x111ea6,_0x2b74f9[_0x38b5('0x6')]);}module[_0x38b5('0xe')]=function(_0x44bbb6){return new winston['Logger']({'transports':[new winston[(_0x38b5('0xf'))][(_0x38b5('0x10'))]({'name':util['format']('%s-%s',_0x44bbb6,'error'),'filename':filename(_0x44bbb6,_0x38b5('0x11')),'level':_0x38b5('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb88343){return formatter(_0x44bbb6,_0xb88343);}}),new winston[(_0x38b5('0xf'))][(_0x38b5('0x10'))]({'name':util[_0x38b5('0xa')]('%s-%s',_0x44bbb6,_0x38b5('0x12')),'filename':filename(_0x44bbb6,_0x38b5('0x12')),'level':_0x38b5('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x25e8fe){return formatter(_0x44bbb6,_0x25e8fe);}}),new winston[(_0x38b5('0xf'))]['Console']({'level':process['env'][_0x38b5('0x13')]||debugLevel,'json':![],'formatter':function(_0x2ed33c){return formatter(_0x44bbb6,_0x2ed33c);}})]});}; \ No newline at end of file +var _0x59ff=['format','toUpperCase','exports','Logger','File','error','transports','%s-%s','info','env','debugLevel','moment','winston','util','path','INFO','/var','xcally','message','replace','{{{','}}}'];(function(_0x2967b4,_0x9b5a9b){var _0x483322=function(_0x4652d0){while(--_0x4652d0){_0x2967b4['push'](_0x2967b4['shift']());}};_0x483322(++_0x9b5a9b);}(_0x59ff,0x197));var _0xf59f=function(_0x22a2e8,_0x28e323){_0x22a2e8=_0x22a2e8-0x0;var _0x1ac6da=_0x59ff[_0x22a2e8];return _0x1ac6da;};'use strict';var moment=require(_0xf59f('0x0'));var winston=require(_0xf59f('0x1'));var util=require(_0xf59f('0x2'));var path=require(_0xf59f('0x3'));var debugLevel=_0xf59f('0x4');function filename(_0x310f14,_0x4e71ab){return path['join'](_0xf59f('0x5'),'log',_0xf59f('0x6'),util['format']('%s-%s.log',_0x310f14,_0x4e71ab));}function formatter(_0x288f2c,_0x400162){_0x400162['message']=_0x400162[_0xf59f('0x7')][_0xf59f('0x8')](/@@{/g,_0xf59f('0x9'))['replace'](/}@@/g,_0xf59f('0xa'))[_0xf59f('0x8')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xf59f('0xb')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xf59f('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),_0x400162['level'][_0xf59f('0xc')](),_0x288f2c,_0x400162[_0xf59f('0x7')]);}module[_0xf59f('0xd')]=function(_0x412451){return new winston[(_0xf59f('0xe'))]({'transports':[new winston['transports'][(_0xf59f('0xf'))]({'name':util[_0xf59f('0xb')]('%s-%s',_0x412451,'error'),'filename':filename(_0x412451,_0xf59f('0x10')),'level':_0xf59f('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x439dba){return formatter(_0x412451,_0x439dba);}}),new winston[(_0xf59f('0x11'))][(_0xf59f('0xf'))]({'name':util[_0xf59f('0xb')](_0xf59f('0x12'),_0x412451,_0xf59f('0x13')),'filename':filename(_0x412451,_0xf59f('0x13')),'level':_0xf59f('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8d93f0){return formatter(_0x412451,_0x8d93f0);}}),new winston[(_0xf59f('0x11'))]['Console']({'level':process[_0xf59f('0x14')][_0xf59f('0x15')]||debugLevel,'json':![],'formatter':function(_0x50a3b7){return formatter(_0x412451,_0x50a3b7);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 18e6a41..970c993 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 _0xfefc=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','../../services/ami/index.js','agi'];(function(_0x4ba437,_0x54a5a3){var _0x16993c=function(_0x3f00ae){while(--_0x3f00ae){_0x4ba437['push'](_0x4ba437['shift']());}};_0x16993c(++_0x54a5a3);}(_0xfefc,0x127));var _0xcfef=function(_0x70425c,_0x3cbc28){_0x70425c=_0x70425c-0x0;var _0x347cfa=_0xfefc[_0x70425c];return _0x347cfa;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xcfef('0x0'),'script':path[_0xcfef('0x1')](__dirname,_0xcfef('0x2'))},{'name':'ami','script':path[_0xcfef('0x1')](__dirname,_0xcfef('0x3'))},{'name':_0xcfef('0x4'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xcfef('0x5'),'script':path[_0xcfef('0x1')](__dirname,_0xcfef('0x6'))},{'name':_0xcfef('0x7'),'script':path['join'](__dirname,_0xcfef('0x8'))},{'name':_0xcfef('0x9'),'script':path[_0xcfef('0x1')](__dirname,_0xcfef('0xa'))}]};module[_0xcfef('0xb')]=config; \ No newline at end of file +var _0xbc83=['express','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x8e6bd6,_0x5c7838){var _0x5d6c95=function(_0x2a465b){while(--_0x2a465b){_0x8e6bd6['push'](_0x8e6bd6['shift']());}};_0x5d6c95(++_0x5c7838);}(_0xbc83,0x109));var _0x3bc8=function(_0xec1bf5,_0x23471d){_0xec1bf5=_0xec1bf5-0x0;var _0x413c55=_0xbc83[_0xec1bf5];return _0x413c55;};'use strict';var path=require(_0x3bc8('0x0'));var os=require('os');var config={'apps':[{'name':_0x3bc8('0x1'),'script':path[_0x3bc8('0x2')](__dirname,_0x3bc8('0x3'))},{'name':'ami','script':path[_0x3bc8('0x2')](__dirname,_0x3bc8('0x4'))},{'name':_0x3bc8('0x5'),'script':path[_0x3bc8('0x2')](__dirname,_0x3bc8('0x6'))},{'name':_0x3bc8('0x7'),'script':path[_0x3bc8('0x2')](__dirname,_0x3bc8('0x8'))},{'name':_0x3bc8('0x9'),'script':path[_0x3bc8('0x2')](__dirname,_0x3bc8('0xa'))},{'name':_0x3bc8('0xb'),'script':path[_0x3bc8('0x2')](__dirname,_0x3bc8('0xc'))}]};module[_0x3bc8('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index db47c1c..d72d795 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 _0xf5e9=['list','describe','delete','dump','saved','pm2','./config','connected','start','then','stop','disconnect','restart'];(function(_0x1cb120,_0x11c645){var _0x537575=function(_0xd1d5ee){while(--_0xd1d5ee){_0x1cb120['push'](_0x1cb120['shift']());}};_0x537575(++_0x11c645);}(_0xf5e9,0x1e6));var _0x9f5e=function(_0x5b8608,_0x527731){_0x5b8608=_0x5b8608-0x0;var _0x3f8d3d=_0xf5e9[_0x5b8608];return _0x3f8d3d;};'use strict';var pm2=require(_0x9f5e('0x0'));var BPromise=require('bluebird');var config=require(_0x9f5e('0x1'));function connect(){return new BPromise(function(_0x3b87f5,_0x351767){return pm2['connect'](function(_0x2c0627){if(_0x2c0627){return _0x351767(_0x2c0627);}return _0x3b87f5(_0x9f5e('0x2'));});});};exports[_0x9f5e('0x3')]=function(_0x566533){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x1ab4d7,_0x5c6c9e){return pm2[_0x9f5e('0x3')](_0x566533,function(_0x2bb2ff,_0x470d07){if(_0x2bb2ff){return _0x5c6c9e(_0x2bb2ff);}pm2['disconnect']();return _0x1ab4d7(_0x470d07);});});});};exports[_0x9f5e('0x5')]=function(_0x15f344){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x53dcbe,_0x1ffc84){return pm2['stop'](_0x15f344,function(_0x3c2d4f,_0xabb469){if(_0x3c2d4f){return _0x1ffc84(_0x3c2d4f);}pm2[_0x9f5e('0x6')]();return _0x53dcbe(_0xabb469);});});});};exports[_0x9f5e('0x7')]=function(_0x329d25){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x3c2b9e,_0x5c5a3e){return pm2[_0x9f5e('0x7')](_0x329d25,function(_0x55de17,_0x2e4e3f){if(_0x55de17){return _0x5c5a3e(_0x55de17);}pm2['disconnect']();return _0x3c2b9e(_0x2e4e3f);});});});};exports[_0x9f5e('0x8')]=function(){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x20c855,_0x3d7aa9){return pm2[_0x9f5e('0x8')](function(_0x5ad87b,_0x59dbbb){if(_0x5ad87b){return _0x3d7aa9(_0x5ad87b);}pm2[_0x9f5e('0x6')]();return _0x20c855(_0x59dbbb);});});});};exports[_0x9f5e('0x9')]=function(_0x14627e){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x41fff5,_0x68a6cc){return pm2[_0x9f5e('0x9')](_0x14627e,function(_0x3f1baa,_0x44225b){if(_0x3f1baa){return _0x68a6cc(_0x3f1baa);}pm2[_0x9f5e('0x6')]();return _0x41fff5(_0x44225b);});});});};exports[_0x9f5e('0xa')]=function(_0x2c6ae5){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x329413,_0x368c1e){return pm2[_0x9f5e('0xa')](_0x2c6ae5,function(_0x3c79ad,_0xf57064){if(_0x3c79ad){return _0x368c1e(_0x3c79ad);}pm2[_0x9f5e('0x6')]();return _0x329413(_0xf57064);});});});};exports[_0x9f5e('0xb')]=function(){return connect()[_0x9f5e('0x4')](function(){return new BPromise(function(_0x10eaed,_0xcd607c){return pm2[_0x9f5e('0xb')](function(_0x296d4d){if(_0x296d4d){return _0xcd607c(_0x296d4d);}return _0x10eaed(_0x9f5e('0xc'));});});});}; \ No newline at end of file +var _0x82c1=['saved','bluebird','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x82c1,0x160));var _0x182c=function(_0x4fc386,_0x384d7c){_0x4fc386=_0x4fc386-0x0;var _0x53dfd8=_0x82c1[_0x4fc386];return _0x53dfd8;};'use strict';var pm2=require('pm2');var BPromise=require(_0x182c('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0xa766bf,_0x50f225){return pm2[_0x182c('0x1')](function(_0x38572b){if(_0x38572b){return _0x50f225(_0x38572b);}return _0xa766bf(_0x182c('0x2'));});});};exports[_0x182c('0x3')]=function(_0x5981f9){return connect()[_0x182c('0x4')](function(){return new BPromise(function(_0x5c9ec9,_0x4ad522){return pm2['start'](_0x5981f9,function(_0x4453e2,_0x5332f9){if(_0x4453e2){return _0x4ad522(_0x4453e2);}pm2[_0x182c('0x5')]();return _0x5c9ec9(_0x5332f9);});});});};exports[_0x182c('0x6')]=function(_0x183b99){return connect()[_0x182c('0x4')](function(){return new BPromise(function(_0x55835a,_0x568708){return pm2[_0x182c('0x6')](_0x183b99,function(_0x422fe2,_0x31c75a){if(_0x422fe2){return _0x568708(_0x422fe2);}pm2[_0x182c('0x5')]();return _0x55835a(_0x31c75a);});});});};exports[_0x182c('0x7')]=function(_0x555095){return connect()['then'](function(){return new BPromise(function(_0x1c68f4,_0x3b648a){return pm2[_0x182c('0x7')](_0x555095,function(_0x17c554,_0xc1b416){if(_0x17c554){return _0x3b648a(_0x17c554);}pm2[_0x182c('0x5')]();return _0x1c68f4(_0xc1b416);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x463305,_0x51ee9d){return pm2[_0x182c('0x8')](function(_0x7efb24,_0x2ca604){if(_0x7efb24){return _0x51ee9d(_0x7efb24);}pm2[_0x182c('0x5')]();return _0x463305(_0x2ca604);});});});};exports[_0x182c('0x9')]=function(_0x12caf1){return connect()[_0x182c('0x4')](function(){return new BPromise(function(_0x4ac844,_0x121c34){return pm2[_0x182c('0x9')](_0x12caf1,function(_0x1f23dd,_0x32b5a0){if(_0x1f23dd){return _0x121c34(_0x1f23dd);}pm2['disconnect']();return _0x4ac844(_0x32b5a0);});});});};exports[_0x182c('0xa')]=function(_0x506b59){return connect()['then'](function(){return new BPromise(function(_0x2ca8bb,_0x38b251){return pm2[_0x182c('0xa')](_0x506b59,function(_0x15eb01,_0x44b8ae){if(_0x15eb01){return _0x38b251(_0x15eb01);}pm2[_0x182c('0x5')]();return _0x2ca8bb(_0x44b8ae);});});});};exports[_0x182c('0xb')]=function(){return connect()[_0x182c('0x4')](function(){return new BPromise(function(_0xe79178,_0x1ab5f1){return pm2[_0x182c('0xb')](function(_0x279d1c){if(_0x279d1c){return _0x1ab5f1(_0x279d1c);}return _0xe79178(_0x182c('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8715140..661ea1c 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 _0x6037=['minutes','length','map','info','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','emit','catch','error','inspect','start','lodash','ioredis','util','../../mysqldb','redis','defaults','localhost','Setting','then','chatTimeout','subtract'];(function(_0x34f3d4,_0x5ae214){var _0x17f899=function(_0x14a5a2){while(--_0x14a5a2){_0x34f3d4['push'](_0x34f3d4['shift']());}};_0x17f899(++_0x5ae214);}(_0x6037,0x91));var _0x7603=function(_0x65eee,_0x5c7e7d){_0x65eee=_0x65eee-0x0;var _0x4da679=_0x6037[_0x65eee];return _0x4da679;};'use strict';var _=require(_0x7603('0x0'));var moment=require('moment');var Redis=require(_0x7603('0x1'));var util=require(_0x7603('0x2'));var config=require('../../config/environment');var db=require(_0x7603('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x7603('0x4')]=_[_0x7603('0x5')](config['redis'],{'host':_0x7603('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7603('0x4')]));function closeInteractions(){var _0x5b87d1=0x0;var _0x3ee0e2=[];return db[_0x7603('0x7')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x7603('0x8')](function(_0x45985a){_0x5b87d1=_0x45985a[_0x7603('0x9')];if(_0x5b87d1){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7603('0xa')](_0x45985a[_0x7603('0x9')],_0x7603('0xb'))}}});}else{return[];}})[_0x7603('0x8')](function(_0x2827fe){if(_0x2827fe&&_0x2827fe[_0x7603('0xc')]){_0x3ee0e2=_[_0x7603('0xd')](_0x2827fe||[],'id');logger[_0x7603('0xe')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3ee0e2[_0x7603('0xf')]());return db[_0x7603('0x10')][_0x7603('0x11')]({'closeReason':_0x7603('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x7603('0x13')](_0x7603('0x14'))},{'where':{'id':_0x3ee0e2}});}})[_0x7603('0x8')](function(){if(_0x3ee0e2&&_0x3ee0e2[_0x7603('0xc')]){logger[_0x7603('0xe')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3ee0e2[_0x7603('0xf')]());for(var _0x4868e1=0x0;_0x4868e1<_0x3ee0e2[_0x7603('0xc')];_0x4868e1++){io[_0x7603('0x15')]('chatInteraction:update',{'id':_0x3ee0e2[_0x4868e1],'closed':!![]});}}})[_0x7603('0x16')](function(_0xceb38f){logger[_0x7603('0x17')]('[CHAT]\x20Error\x20closing\x20interactions',_0xceb38f?util[_0x7603('0x18')](_0xceb38f,{'showHidden':![],'depth':null}):'');});}exports[_0x7603('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9b14=['then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','catch','error','[CHAT]\x20Error\x20closing\x20interactions','lodash','ioredis','util','schedule','redis','defaults','localhost','Setting','find'];(function(_0x507db2,_0x3a4d21){var _0x2417e6=function(_0x1a75c8){while(--_0x1a75c8){_0x507db2['push'](_0x507db2['shift']());}};_0x2417e6(++_0x3a4d21);}(_0x9b14,0x163));var _0x49b1=function(_0x2416b9,_0x313d5d){_0x2416b9=_0x2416b9-0x0;var _0x9eefeb=_0x9b14[_0x2416b9];return _0x9eefeb;};'use strict';var _=require(_0x49b1('0x0'));var moment=require('moment');var Redis=require(_0x49b1('0x1'));var util=require(_0x49b1('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x49b1('0x3'));config[_0x49b1('0x4')]=_[_0x49b1('0x5')](config['redis'],{'host':_0x49b1('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x49b1('0x4')]));function closeInteractions(){var _0x3ee87b=0x0;var _0x54ff95=[];return db[_0x49b1('0x7')][_0x49b1('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x49b1('0x9')](function(_0x475fea){_0x3ee87b=_0x475fea[_0x49b1('0xa')];if(_0x3ee87b){return db[_0x49b1('0xb')][_0x49b1('0xc')]({'raw':!![],'attributes':['id',_0x49b1('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x49b1('0xe')](_0x475fea[_0x49b1('0xa')],_0x49b1('0xf'))}}});}else{return[];}})[_0x49b1('0x9')](function(_0x293ec1){if(_0x293ec1&&_0x293ec1['length']){_0x54ff95=_[_0x49b1('0x10')](_0x293ec1||[],'id');logger['info'](_0x49b1('0x11'),_0x54ff95[_0x49b1('0x12')]());return db['ChatInteraction'][_0x49b1('0x13')]({'closeReason':_0x49b1('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x54ff95}});}})[_0x49b1('0x9')](function(){if(_0x54ff95&&_0x54ff95['length']){logger['info'](_0x49b1('0x15'),_0x54ff95[_0x49b1('0x12')]());for(var _0x25fd0e=0x0;_0x25fd0e<_0x54ff95[_0x49b1('0x16')];_0x25fd0e++){io['emit']('chatInteraction:update',{'id':_0x54ff95[_0x25fd0e],'closed':!![]});}}})[_0x49b1('0x17')](function(_0x5c1402){logger[_0x49b1('0x18')](_0x49b1('0x19'),_0x5c1402?util['inspect'](_0x5c1402,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 53a9846..b478f13 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 _0x0d55=['active','update','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','existsSync','status','attachments','text','stringify','Sent','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','length','stop','deleteJob','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','start','exists','stop\x20cron'];(function(_0x256fa5,_0x5285e7){var _0x3bffcc=function(_0x21427d){while(--_0x21427d){_0x256fa5['push'](_0x256fa5['shift']());}};_0x3bffcc(++_0x5285e7);}(_0x0d55,0x16c));var _0x50d5=function(_0x45a263,_0x2c0be7){_0x45a263=_0x45a263-0x0;var _0x337fe2=_0x0d55[_0x45a263];return _0x337fe2;};'use strict';var fs=require('fs');var util=require(_0x50d5('0x0'));var path=require(_0x50d5('0x1'));var _=require(_0x50d5('0x2'));var moment=require('moment');var CronJobManager=require(_0x50d5('0x3'));var jayson=require(_0x50d5('0x4'));var BPromise=require(_0x50d5('0x5'));var logger=require(_0x50d5('0x6'))(_0x50d5('0x7'));var db=require(_0x50d5('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x50d5('0x9'));var client=jayson[_0x50d5('0xa')][_0x50d5('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f0bcb,_0x2a3134){return function(){logger[_0x50d5('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2f0bcb[_0x50d5('0xd')]);var _0x149852=!![];var _0x5dd79d={'tls':{'rejectUnauthorized':![]}};if(_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')][_0x50d5('0x10')]){_0x5dd79d[_0x50d5('0x10')]=_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')][_0x50d5('0x10')];}else{_0x5dd79d[_0x50d5('0x11')]=_0x2f0bcb[_0x50d5('0xe')]['Smtp']['host'];_0x5dd79d[_0x50d5('0x12')]=_0x2f0bcb['MailAccount'][_0x50d5('0xf')][_0x50d5('0x12')];_0x5dd79d[_0x50d5('0x13')]=_0x2f0bcb[_0x50d5('0xe')]['Smtp']['secure'];}if(_0x2f0bcb['MailAccount'][_0x50d5('0xf')][_0x50d5('0x14')]){_0x5dd79d[_0x50d5('0x15')]={'user':_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')]['user'],'pass':_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')]['pass']};}var _0x3e5e8d={'account':_0x5dd79d,'message':{'from':util['format'](_0x50d5('0x16'),_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0x17')],_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xd')]||_0x2f0bcb[_0x50d5('0xe')][_0x50d5('0xf')][_0x50d5('0x18')]),'to':_0x2f0bcb[_0x50d5('0xd')],'cc':_0x2f0bcb['cc'],'bcc':_0x2f0bcb[_0x50d5('0x19')],'subject':util[_0x50d5('0x1a')](_0x50d5('0x1b'),_0x2a3134[_0x50d5('0x17')],_0x2f0bcb[_0x50d5('0x1c')],_0x2f0bcb[_0x50d5('0x1d')])}};var _0x51946b=path[_0x50d5('0x1e')](__dirname,_0x50d5('0x1f'));var _0x571351=_0x2a3134['savename'];var _0x1e5abc=util['format']('%s.%s',path[_0x50d5('0x20')](_0x2a3134[_0x50d5('0x21')],path[_0x50d5('0x22')](_0x2a3134[_0x50d5('0x21')])),'zip');var _0x3accf5=path[_0x50d5('0x1e')](_0x51946b,_0x571351);var _0x5508b8=path[_0x50d5('0x1e')](_0x51946b,_0x1e5abc);if(fs[_0x50d5('0x23')](_0x3accf5)){_0x2a3134[_0x50d5('0x24')]='Sent';_0x3e5e8d['message'][_0x50d5('0x25')]=[{'filename':_0x571351,'path':_0x3accf5}];_0x3e5e8d['message'][_0x50d5('0x26')]=util[_0x50d5('0x1a')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x50d5('0x27')](_0x2a3134,null,0x2));}else if(fs['existsSync'](_0x5508b8)){_0x2a3134[_0x50d5('0x24')]=_0x50d5('0x28');_0x3e5e8d[_0x50d5('0x29')]['attachments']=[{'filename':_0x1e5abc,'path':_0x5508b8}];}else{_0x3e5e8d[_0x50d5('0x29')][_0x50d5('0x26')]=_0x50d5('0x2a');if(!_0x2f0bcb[_0x50d5('0x2b')]){_0x149852=![];logger['info'](_0x50d5('0x2c'));}}if(_0x149852){return client['request']('SendMail',_0x3e5e8d)['then'](function(_0x2b447a){if(_0x2b447a[_0x50d5('0x2d')]){return logger[_0x50d5('0x2d')](_0x50d5('0x2e'),JSON[_0x50d5('0x27')](_0x2b447a));}return logger[_0x50d5('0xc')](_0x50d5('0x2f'));})[_0x50d5('0x30')](function(_0x2be77f){return logger[_0x50d5('0x2d')](_0x50d5('0x2e'),JSON[_0x50d5('0x27')](_0x2be77f));});}};}function handleError(){return function(_0x44412c){return logger[_0x50d5('0x2d')](JSON[_0x50d5('0x27')](_0x44412c));};}function handleResult(_0x3d36cf){return function(_0x25af97){logger['info'](_0x50d5('0x31'),JSON['stringify'](_0x25af97));if(_0x3d36cf[_0x50d5('0xe')]&&_0x3d36cf[_0x50d5('0xe')][_0x50d5('0xf')]&&!_[_0x50d5('0x32')](_0x3d36cf[_0x50d5('0xd')])){setTimeout(handleSendEmail(_0x3d36cf,_0x25af97),0x3c*0x3e8);}};}function handleJob(_0xf977b1){return function(){try{if(_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x1c')])){return logger[_0x50d5('0xc')](_0x50d5('0x33'));}if(_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x1d')])){return logger[_0x50d5('0xc')](_0x50d5('0x34'));}var _0x2175ba={'startDate':moment()[_0x50d5('0x35')](_0xf977b1[_0x50d5('0x1c')],_0xf977b1[_0x50d5('0x1d')])['format'](_0x50d5('0x36')),'endDate':moment()[_0x50d5('0x1a')](_0x50d5('0x36')),'type':_0x50d5('0x37'),'output':_0xf977b1[_0x50d5('0x38')],'name':_0xf977b1[_0x50d5('0x17')]};if(!_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x39')])){logger[_0x50d5('0xc')]('exec\x20defaul\x20report\x20id:%s',_0xf977b1[_0x50d5('0x39')]);return analyticDefaultReportController[_0x50d5('0x3a')]({'id':_0xf977b1[_0x50d5('0x39')]},_0x2175ba)[_0x50d5('0x3b')](handleResult(_0xf977b1))['catch'](handleError());}if(!_[_0x50d5('0x32')](_0xf977b1[_0x50d5('0x3c')])){logger['info'](_0x50d5('0x3d'),_0xf977b1[_0x50d5('0x3c')]);return analyticCustomReportController['runReport']({'id':_0xf977b1[_0x50d5('0x3c')]},_0x2175ba)[_0x50d5('0x3b')](handleResult(_0xf977b1))[_0x50d5('0x30')](handleError());}}catch(_0x13c942){logger[_0x50d5('0x2d')](JSON['stringify'](_0x13c942));}return logger['info'](_0x50d5('0x3e'));};}function getJobs(_0x4fd9ee){var _0x265451={};if(_0x4fd9ee){_0x265451['id']=_0x4fd9ee;}return db['Schedule'][_0x50d5('0x3f')]({'where':_0x265451,'include':[{'model':db[_0x50d5('0xe')],'attributes':['id',_0x50d5('0x17'),_0x50d5('0xd')],'include':[{'model':db[_0x50d5('0x40')],'as':_0x50d5('0xf')}]}]})['then'](function(_0x1bf381){var _0x37b547=_[_0x50d5('0x41')](manager[_0x50d5('0x42')]);var _0x34a1f4=_[_0x50d5('0x43')](_0x1bf381,function(_0xfa57ed){return _0xfa57ed['id']['toString']();});var _0x158831=_[_0x50d5('0x44')](_0x1bf381,function(_0x3f0cfd){return _0x3f0cfd['id'][_0x50d5('0x45')]();});var _0xf79291=_0x4fd9ee?_0x34a1f4:_[_0x50d5('0x46')](_0x34a1f4,_0x37b547);var _0x1e0c61=_[_0x50d5('0x47')](_0x34a1f4,_0x37b547);var _0x2868f2=_[_0x50d5('0x46')](_0x37b547,_0x34a1f4);var _0x5d6c11;var _0x4219ed;for(_0x5d6c11=0x0;_0x5d6c11<_0x2868f2[_0x50d5('0x48')]&&!_0x4fd9ee;_0x5d6c11+=0x1){_0x4219ed=_0x2868f2[_0x5d6c11][_0x50d5('0x45')]();if(manager['exists'](_0x4219ed)){manager[_0x50d5('0x49')](_0x4219ed);manager[_0x50d5('0x4a')](_0x4219ed);logger[_0x50d5('0xc')]('delete\x20cron',_0x4219ed);}}logger[_0x50d5('0xc')]('toRun',JSON['stringify'](_0xf79291));for(_0x5d6c11=0x0;_0x5d6c11<_0xf79291['length'];_0x5d6c11+=0x1){_0x4219ed=_0xf79291[_0x5d6c11]['toString']();logger[_0x50d5('0xc')](_0x50d5('0x4b'),_0x4219ed);if(_0x4fd9ee){logger[_0x50d5('0xc')](_0x50d5('0x4c'),_0x4fd9ee);logger[_0x50d5('0xc')](JSON['stringify'](_0x158831[_0x4219ed]));BPromise[_0x50d5('0x4d')]()[_0x50d5('0x3b')](handleJob(_0x158831[_0x4219ed]));logger[_0x50d5('0xc')](_0x50d5('0x4e'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed][_0x50d5('0x4f')]);}else if(_0x158831[_0x4219ed]['cron']&&_0x158831[_0x4219ed]['active']&&moment()[_0x50d5('0x50')](_0x158831[_0x4219ed][_0x50d5('0x51')],_0x158831[_0x4219ed][_0x50d5('0x52')])){manager['add'](_0x4219ed,_0x158831[_0x4219ed]['cron'],handleJob(_0x158831[_0x4219ed]));manager[_0x50d5('0x53')](_0x4219ed);logger[_0x50d5('0xc')]('add\x20cron',_0x158831[_0x4219ed]['name'],_0x158831[_0x4219ed][_0x50d5('0x4f')]);}else if(manager[_0x50d5('0x54')](_0x4219ed)){manager[_0x50d5('0x49')](_0x4219ed);manager[_0x50d5('0x4a')](_0x4219ed);logger['info'](_0x50d5('0x55'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed]['cron']);}}for(_0x5d6c11=0x0,_0x4219ed;_0x5d6c11<_0x1e0c61[_0x50d5('0x48')]&&!_0x4fd9ee;_0x5d6c11+=0x1){_0x4219ed=_0x1e0c61[_0x5d6c11][_0x50d5('0x45')]();if(manager[_0x50d5('0x54')](_0x4219ed)){if(_0x158831[_0x4219ed][_0x50d5('0x4f')]&&_0x158831[_0x4219ed][_0x50d5('0x56')]&&moment()[_0x50d5('0x50')](_0x158831[_0x4219ed]['startAt'],_0x158831[_0x4219ed]['endAt'])){manager[_0x50d5('0x57')](_0x4219ed,_0x158831[_0x4219ed][_0x50d5('0x4f')],handleJob(_0x158831[_0x4219ed]));logger[_0x50d5('0xc')](_0x50d5('0x58'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed]['cron']);}else{manager[_0x50d5('0x49')](_0x4219ed);manager[_0x50d5('0x4a')](_0x4219ed);logger['info'](_0x50d5('0x55'),_0x158831[_0x4219ed][_0x50d5('0x17')],_0x158831[_0x4219ed][_0x50d5('0x4f')]);}}}})['catch'](function(_0x25f47b){logger[_0x50d5('0x2d')](JSON[_0x50d5('0x27')](_0x25f47b));});}exports[_0x50d5('0x59')]=function(_0x53e18a){return getJobs(_0x53e18a);};exports[_0x50d5('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xea42=['subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','jobs','map','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','toString','index','my\x20id','resolve','cron','isBetween','startAt','endAt','add','start','add\x20cron','exists','active','update','update\x20cron','stop\x20cron','run','util','path','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined'];(function(_0x3f817a,_0x1d3d04){var _0x167d01=function(_0x30943f){while(--_0x30943f){_0x3f817a['push'](_0x3f817a['shift']());}};_0x167d01(++_0x1d3d04);}(_0xea42,0x83));var _0x2ea4=function(_0x5ba0d1,_0x39fc9b){_0x5ba0d1=_0x5ba0d1-0x0;var _0x3405de=_0xea42[_0x5ba0d1];return _0x3405de;};'use strict';var fs=require('fs');var util=require(_0x2ea4('0x0'));var path=require(_0x2ea4('0x1'));var _=require('lodash');var moment=require(_0x2ea4('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x2ea4('0x3'));var BPromise=require(_0x2ea4('0x4'));var logger=require(_0x2ea4('0x5'))(_0x2ea4('0x6'));var db=require(_0x2ea4('0x7'))['db'];var analyticCustomReportController=require(_0x2ea4('0x8'));var analyticDefaultReportController=require(_0x2ea4('0x9'));var client=jayson['client'][_0x2ea4('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5c6483,_0x117c4b){return function(){logger[_0x2ea4('0xb')](_0x2ea4('0xc'),_0x5c6483[_0x2ea4('0xd')]);var _0x123395=!![];var _0x536059={'tls':{'rejectUnauthorized':![]}};if(_0x5c6483[_0x2ea4('0xe')][_0x2ea4('0xf')]['service']){_0x536059[_0x2ea4('0x10')]=_0x5c6483['MailAccount'][_0x2ea4('0xf')][_0x2ea4('0x10')];}else{_0x536059[_0x2ea4('0x11')]=_0x5c6483[_0x2ea4('0xe')][_0x2ea4('0xf')][_0x2ea4('0x11')];_0x536059[_0x2ea4('0x12')]=_0x5c6483['MailAccount'][_0x2ea4('0xf')][_0x2ea4('0x12')];_0x536059[_0x2ea4('0x13')]=_0x5c6483[_0x2ea4('0xe')][_0x2ea4('0xf')][_0x2ea4('0x13')];}if(_0x5c6483[_0x2ea4('0xe')][_0x2ea4('0xf')]['authentication']){_0x536059[_0x2ea4('0x14')]={'user':_0x5c6483[_0x2ea4('0xe')][_0x2ea4('0xf')][_0x2ea4('0x15')],'pass':_0x5c6483[_0x2ea4('0xe')][_0x2ea4('0xf')][_0x2ea4('0x16')]};}var _0x45a1e0={'account':_0x536059,'message':{'from':util[_0x2ea4('0x17')](_0x2ea4('0x18'),_0x5c6483['MailAccount'][_0x2ea4('0x19')],_0x5c6483[_0x2ea4('0xe')]['email']||_0x5c6483[_0x2ea4('0xe')]['Smtp']['user']),'to':_0x5c6483[_0x2ea4('0xd')],'cc':_0x5c6483['cc'],'bcc':_0x5c6483[_0x2ea4('0x1a')],'subject':util[_0x2ea4('0x17')](_0x2ea4('0x1b'),_0x117c4b[_0x2ea4('0x19')],_0x5c6483[_0x2ea4('0x1c')],_0x5c6483[_0x2ea4('0x1d')])}};var _0x292baf=path[_0x2ea4('0x1e')](__dirname,_0x2ea4('0x1f'));var _0x25e58a=_0x117c4b['savename'];var _0x3ac269=util['format'](_0x2ea4('0x20'),path[_0x2ea4('0x21')](_0x117c4b[_0x2ea4('0x22')],path[_0x2ea4('0x23')](_0x117c4b[_0x2ea4('0x22')])),_0x2ea4('0x24'));var _0x4503a6=path[_0x2ea4('0x1e')](_0x292baf,_0x25e58a);var _0x11d4b4=path[_0x2ea4('0x1e')](_0x292baf,_0x3ac269);if(fs[_0x2ea4('0x25')](_0x4503a6)){_0x117c4b['status']=_0x2ea4('0x26');_0x45a1e0[_0x2ea4('0x27')][_0x2ea4('0x28')]=[{'filename':_0x25e58a,'path':_0x4503a6}];_0x45a1e0[_0x2ea4('0x27')]['text']=util[_0x2ea4('0x17')](_0x2ea4('0x29'),JSON[_0x2ea4('0x2a')](_0x117c4b,null,0x2));}else if(fs[_0x2ea4('0x25')](_0x11d4b4)){_0x117c4b[_0x2ea4('0x2b')]=_0x2ea4('0x26');_0x45a1e0[_0x2ea4('0x27')]['attachments']=[{'filename':_0x3ac269,'path':_0x11d4b4}];}else{_0x45a1e0[_0x2ea4('0x27')][_0x2ea4('0x2c')]=_0x2ea4('0x2d');if(!_0x5c6483[_0x2ea4('0x2e')]){_0x123395=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x123395){return client[_0x2ea4('0x2f')](_0x2ea4('0x30'),_0x45a1e0)[_0x2ea4('0x31')](function(_0x4a3206){if(_0x4a3206[_0x2ea4('0x32')]){return logger[_0x2ea4('0x32')](_0x2ea4('0x33'),JSON[_0x2ea4('0x2a')](_0x4a3206));}return logger[_0x2ea4('0xb')](_0x2ea4('0x34'));})[_0x2ea4('0x35')](function(_0x2e2b5d){return logger[_0x2ea4('0x32')]('error\x20mail',JSON[_0x2ea4('0x2a')](_0x2e2b5d));});}};}function handleError(){return function(_0x3541f4){return logger[_0x2ea4('0x32')](JSON[_0x2ea4('0x2a')](_0x3541f4));};}function handleResult(_0x1d6f1e){return function(_0x18b00e){logger[_0x2ea4('0xb')]('data',JSON[_0x2ea4('0x2a')](_0x18b00e));if(_0x1d6f1e[_0x2ea4('0xe')]&&_0x1d6f1e['MailAccount'][_0x2ea4('0xf')]&&!_[_0x2ea4('0x36')](_0x1d6f1e['email'])){setTimeout(handleSendEmail(_0x1d6f1e,_0x18b00e),0x3c*0x3e8);}};}function handleJob(_0x24d050){return function(){try{if(_[_0x2ea4('0x36')](_0x24d050['subtractNumber'])){return logger['info'](_0x2ea4('0x37'));}if(_[_0x2ea4('0x36')](_0x24d050['subtractUnit'])){return logger['info'](_0x2ea4('0x38'));}var _0x5c8631={'startDate':moment()[_0x2ea4('0x39')](_0x24d050[_0x2ea4('0x1c')],_0x24d050[_0x2ea4('0x1d')])['format'](_0x2ea4('0x3a')),'endDate':moment()[_0x2ea4('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x2ea4('0x3b'),'output':_0x24d050['output'],'name':_0x24d050[_0x2ea4('0x19')]};if(!_['isNil'](_0x24d050[_0x2ea4('0x3c')])){logger[_0x2ea4('0xb')](_0x2ea4('0x3d'),_0x24d050['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x24d050[_0x2ea4('0x3c')]},_0x5c8631)[_0x2ea4('0x31')](handleResult(_0x24d050))['catch'](handleError());}if(!_[_0x2ea4('0x36')](_0x24d050[_0x2ea4('0x3e')])){logger[_0x2ea4('0xb')](_0x2ea4('0x3f'),_0x24d050[_0x2ea4('0x3e')]);return analyticCustomReportController['runReport']({'id':_0x24d050[_0x2ea4('0x3e')]},_0x5c8631)[_0x2ea4('0x31')](handleResult(_0x24d050))[_0x2ea4('0x35')](handleError());}}catch(_0x1cbaf1){logger[_0x2ea4('0x32')](JSON['stringify'](_0x1cbaf1));}return logger[_0x2ea4('0xb')](_0x2ea4('0x40'));};}function getJobs(_0x5d3705){var _0x34fbce={};if(_0x5d3705){_0x34fbce['id']=_0x5d3705;}return db['Schedule'][_0x2ea4('0x41')]({'where':_0x34fbce,'include':[{'model':db['MailAccount'],'attributes':['id',_0x2ea4('0x19'),_0x2ea4('0xd')],'include':[{'model':db[_0x2ea4('0x42')],'as':_0x2ea4('0xf')}]}]})[_0x2ea4('0x31')](function(_0x23a058){var _0x3296c9=_['keys'](manager[_0x2ea4('0x43')]);var _0x1d303c=_[_0x2ea4('0x44')](_0x23a058,function(_0x157dc5){return _0x157dc5['id']['toString']();});var _0x2ba792=_[_0x2ea4('0x45')](_0x23a058,function(_0xd55a6b){return _0xd55a6b['id']['toString']();});var _0x6bf12d=_0x5d3705?_0x1d303c:_[_0x2ea4('0x46')](_0x1d303c,_0x3296c9);var _0x5edbe5=_[_0x2ea4('0x47')](_0x1d303c,_0x3296c9);var _0x49fdf5=_[_0x2ea4('0x46')](_0x3296c9,_0x1d303c);var _0x408851;var _0xd130c3;for(_0x408851=0x0;_0x408851<_0x49fdf5[_0x2ea4('0x48')]&&!_0x5d3705;_0x408851+=0x1){_0xd130c3=_0x49fdf5[_0x408851]['toString']();if(manager['exists'](_0xd130c3)){manager[_0x2ea4('0x49')](_0xd130c3);manager[_0x2ea4('0x4a')](_0xd130c3);logger[_0x2ea4('0xb')](_0x2ea4('0x4b'),_0xd130c3);}}logger[_0x2ea4('0xb')](_0x2ea4('0x4c'),JSON[_0x2ea4('0x2a')](_0x6bf12d));for(_0x408851=0x0;_0x408851<_0x6bf12d[_0x2ea4('0x48')];_0x408851+=0x1){_0xd130c3=_0x6bf12d[_0x408851][_0x2ea4('0x4d')]();logger['info'](_0x2ea4('0x4e'),_0xd130c3);if(_0x5d3705){logger[_0x2ea4('0xb')](_0x2ea4('0x4f'),_0x5d3705);logger[_0x2ea4('0xb')](JSON['stringify'](_0x2ba792[_0xd130c3]));BPromise[_0x2ea4('0x50')]()[_0x2ea4('0x31')](handleJob(_0x2ba792[_0xd130c3]));logger[_0x2ea4('0xb')]('run\x20job',_0x2ba792[_0xd130c3]['name'],_0x2ba792[_0xd130c3]['cron']);}else if(_0x2ba792[_0xd130c3][_0x2ea4('0x51')]&&_0x2ba792[_0xd130c3]['active']&&moment()[_0x2ea4('0x52')](_0x2ba792[_0xd130c3][_0x2ea4('0x53')],_0x2ba792[_0xd130c3][_0x2ea4('0x54')])){manager[_0x2ea4('0x55')](_0xd130c3,_0x2ba792[_0xd130c3][_0x2ea4('0x51')],handleJob(_0x2ba792[_0xd130c3]));manager[_0x2ea4('0x56')](_0xd130c3);logger[_0x2ea4('0xb')](_0x2ea4('0x57'),_0x2ba792[_0xd130c3][_0x2ea4('0x19')],_0x2ba792[_0xd130c3]['cron']);}else if(manager[_0x2ea4('0x58')](_0xd130c3)){manager[_0x2ea4('0x49')](_0xd130c3);manager[_0x2ea4('0x4a')](_0xd130c3);logger[_0x2ea4('0xb')]('stop\x20cron',_0x2ba792[_0xd130c3]['name'],_0x2ba792[_0xd130c3][_0x2ea4('0x51')]);}}for(_0x408851=0x0,_0xd130c3;_0x408851<_0x5edbe5['length']&&!_0x5d3705;_0x408851+=0x1){_0xd130c3=_0x5edbe5[_0x408851][_0x2ea4('0x4d')]();if(manager[_0x2ea4('0x58')](_0xd130c3)){if(_0x2ba792[_0xd130c3]['cron']&&_0x2ba792[_0xd130c3][_0x2ea4('0x59')]&&moment()[_0x2ea4('0x52')](_0x2ba792[_0xd130c3][_0x2ea4('0x53')],_0x2ba792[_0xd130c3]['endAt'])){manager[_0x2ea4('0x5a')](_0xd130c3,_0x2ba792[_0xd130c3][_0x2ea4('0x51')],handleJob(_0x2ba792[_0xd130c3]));logger[_0x2ea4('0xb')](_0x2ea4('0x5b'),_0x2ba792[_0xd130c3]['name'],_0x2ba792[_0xd130c3]['cron']);}else{manager['stop'](_0xd130c3);manager['deleteJob'](_0xd130c3);logger[_0x2ea4('0xb')](_0x2ea4('0x5c'),_0x2ba792[_0xd130c3][_0x2ea4('0x19')],_0x2ba792[_0xd130c3][_0x2ea4('0x51')]);}}}})[_0x2ea4('0x35')](function(_0x87937b){logger[_0x2ea4('0x32')](JSON[_0x2ea4('0x2a')](_0x87937b));});}exports[_0x2ea4('0x5d')]=function(_0x124cbf){return getJobs(_0x124cbf);};exports[_0x2ea4('0x56')]=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 f3e9537..6a428f0 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 _0xf3aa=['sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','language','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','SequelizeValidationError','lodash','aws-sdk','request-promise','util','../../mysqldb','TranscribeService','Comprehend','substring','format','data1','data2','transcribeName','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis'];(function(_0x2379c5,_0x605fe6){var _0x2c6e87=function(_0x200fef){while(--_0x200fef){_0x2379c5['push'](_0x2379c5['shift']());}};_0x2c6e87(++_0x605fe6);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x59cf41,_0x292757){_0x59cf41=_0x59cf41-0x0;var _0x3d7568=_0xf3aa[_0x59cf41];return _0x3d7568;};var _=require(_0xaf3a('0x0'));var AWS=require(_0xaf3a('0x1'));var rp=require(_0xaf3a('0x2'));var util=require(_0xaf3a('0x3'));var BPromise=require('bluebird');var db=require(_0xaf3a('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x33b1f6,_0x1e1199,_0x2f62d2,_0x41395c){return new Promise(function(_0x3050e3,_0x141196){var _0xb009f0=new AWS[(_0xaf3a('0x5'))]({'accessKeyId':_0x1e1199,'secretAccessKey':_0x33b1f6,'region':_0x2f62d2});_0xb009f0['getTranscriptionJob']({'TranscriptionJobName':_0x41395c},function(_0x4e5041,_0x3c304e){if(_0x4e5041){return _0x141196(_0x4e5041);}else{return _0x3050e3(_0x3c304e);}});});}function sentiment(_0x3d4bd8,_0x2bfc6f,_0x499643,_0x4a490f,_0x2aeea3){return new Promise(function(_0x1eadef,_0x7ba7b0){var _0x1fe67f=new AWS[(_0xaf3a('0x6'))]({'accessKeyId':_0x2bfc6f,'secretAccessKey':_0x3d4bd8,'region':_0x499643});_0x1fe67f['detectSentiment']({'Text':_0x4a490f,'LanguageCode':_0x2aeea3[_0xaf3a('0x7')](0x0,0x2)},function(_0x3550ed,_0x4bd80c){if(_0x3550ed){return _0x7ba7b0(_0x3550ed);}else{return _0x1eadef(_0x4bd80c);}});});}function checkTranscribeJob(_0x3f5a7f,_0xc980d1,_0x1948c2){var _0x5cd95e;return new BPromise(function(_0x1111f8,_0x4439f6){logger['info'](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3f5a7f['id'],_0x3f5a7f['transcribeName']));return getTranscriptionJob(_0x1948c2[_0xaf3a('0x9')],_0x1948c2[_0xaf3a('0xa')],_0xc980d1['transcribeRegion'],_0x3f5a7f[_0xaf3a('0xb')])[_0xaf3a('0xc')](function(_0x48bc54){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0xe'),_0x3f5a7f['id'],_0x3f5a7f[_0xaf3a('0xb')],_0x48bc54['TranscriptionJob'][_0xaf3a('0xf')]));if(!_0x3f5a7f[_0xaf3a('0x10')]){switch(_0x48bc54['TranscriptionJob']['TranscriptionJobStatus']){case _0xaf3a('0x11'):var _0x4858df={'transcribeStatus':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0xf')],'fileUri':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0x13')][_0xaf3a('0x14')]};logger['info'](util[_0xaf3a('0x8')](_0xaf3a('0x15'),_0x3f5a7f['id']));return rp({'uri':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0x13')][_0xaf3a('0x14')],'json':!![]})[_0xaf3a('0xc')](function(_0x8878e3){logger[_0xaf3a('0xd')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x3f5a7f['id']));if(_0x8878e3&&_0x8878e3[_0xaf3a('0x16')]&&_0x8878e3[_0xaf3a('0x16')][_0xaf3a('0x17')]&&_0x8878e3['results'][_0xaf3a('0x17')][_0xaf3a('0x18')]){_0x4858df['fileText']='';for(var _0x2d3972=0x0;_0x2d3972<_0x8878e3[_0xaf3a('0x16')][_0xaf3a('0x17')][_0xaf3a('0x18')];_0x2d3972++){_0x4858df[_0xaf3a('0x10')]+=_0x8878e3[_0xaf3a('0x16')][_0xaf3a('0x17')][_0x2d3972][_0xaf3a('0x19')]+'';}}return _0x3f5a7f['update'](_0x4858df);})['then'](function(){logger['info'](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3f5a7f['id']));if(!_0x3f5a7f[_0xaf3a('0x1a')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x1d'));}if(!_0xc980d1['sentiment']||!_0xc980d1[_0xaf3a('0x1e')]||!_0xc980d1['sentimentRegion']||!_0xc980d1['language']||!_0xc980d1[_0xaf3a('0x1f')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x20'));}if(!_0x4858df[_0xaf3a('0x10')]){throw new Error(_0xaf3a('0x21'));}if(_0xc980d1[_0xaf3a('0x1e')]===_0x1948c2['id']){return _0x1948c2;}else{return db[_0xaf3a('0x22')][_0xaf3a('0x23')]({'where':{'id':_settings[_0xaf3a('0x1e')]}});}})[_0xaf3a('0xc')](function(_0x151d98){if(!_0x151d98){throw new db[(_0xaf3a('0x1b'))]['ValidationError'](_0xaf3a('0x24'));}if(!_0x151d98[_0xaf3a('0x9')]||!_0x151d98['data2']){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x25'));}_0x5cd95e=_0x151d98;logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x26'),_0x3f5a7f['id']));return sentiment(_0x5cd95e[_0xaf3a('0x9')],_0x5cd95e[_0xaf3a('0xa')],_0xc980d1[_0xaf3a('0x27')],_0x4858df[_0xaf3a('0x10')],_0xc980d1['language']);})[_0xaf3a('0xc')](function(_0x124e72){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x28'),_0x3f5a7f['id']));return _0x3f5a7f[_0xaf3a('0x29')]({'sentiment':_0x124e72[_0xaf3a('0x2a')],'sPositive':_0x124e72[_0xaf3a('0x2b')][_0xaf3a('0x2c')],'sNegative':_0x124e72[_0xaf3a('0x2b')][_0xaf3a('0x2d')],'sMixed':_0x124e72[_0xaf3a('0x2b')]['Mixed'],'sNeutral':_0x124e72[_0xaf3a('0x2b')]['Neutral']});})[_0xaf3a('0xc')](function(){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x2e'),_0x3f5a7f['id']));_0x1111f8();});case _0xaf3a('0x2f'):return _0x3f5a7f[_0xaf3a('0x29')]({'transcribeStatus':_0xaf3a('0x2f'),'failureReason':_0x48bc54[_0xaf3a('0x12')][_0xaf3a('0x30')]})['then'](function(){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x2e'),_0x3f5a7f['id']));_0x1111f8();});default:logger[_0xaf3a('0xd')](util['format'](_0xaf3a('0x31'),_0x3f5a7f['id']));break;}}else{return BPromise[_0xaf3a('0x32')]()[_0xaf3a('0xc')](function(){if(!_0x3f5a7f[_0xaf3a('0x1a')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x1d'));}if(!_0xc980d1[_0xaf3a('0x33')]||!_0xc980d1['sentimentAccountId']||!_0xc980d1['sentimentRegion']||!_0xc980d1[_0xaf3a('0x34')]||!_0xc980d1['bucket']){throw new db['Sequelize'][(_0xaf3a('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3f5a7f[_0xaf3a('0x10')]){throw new Error(_0xaf3a('0x21'));}if(_0xc980d1[_0xaf3a('0x1e')]===_0x1948c2['id']){return _0x1948c2;}else{return db[_0xaf3a('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xaf3a('0xc')](function(_0x505333){if(!_0x505333){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x505333[_0xaf3a('0x9')]||!_0x505333[_0xaf3a('0xa')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x25'));}_0x5cd95e=_0x505333;logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')](_0xaf3a('0x26'),_0x3f5a7f['id']));return sentiment(_0x5cd95e['data1'],_0x5cd95e[_0xaf3a('0xa')],_0xc980d1[_0xaf3a('0x27')],_0x3f5a7f['fileText'],_0xc980d1[_0xaf3a('0x34')]);})['then'](function(_0x2f4b33){logger['info'](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3f5a7f['id']));return _0x3f5a7f[_0xaf3a('0x29')]({'sentiment':_0x2f4b33[_0xaf3a('0x2a')],'sPositive':_0x2f4b33[_0xaf3a('0x2b')][_0xaf3a('0x2c')],'sNegative':_0x2f4b33[_0xaf3a('0x2b')][_0xaf3a('0x2d')],'sMixed':_0x2f4b33[_0xaf3a('0x2b')]['Mixed'],'sNeutral':_0x2f4b33['SentimentScore']['Neutral'],'transcribeStatus':_0xaf3a('0x11')});})['then'](function(){logger[_0xaf3a('0xd')](util[_0xaf3a('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3f5a7f['id']));_0x1111f8();});}})[_0xaf3a('0x35')](function(_0x2fa8c8){if(_0x2fa8c8){if(!_0x2fa8c8[_0xaf3a('0x36')]||_0x2fa8c8[_0xaf3a('0x36')]!=='SequelizeValidationError'){logger[_0xaf3a('0x37')](util[_0xaf3a('0x8')](_0xaf3a('0x38'),_0x3f5a7f['id']),util[_0xaf3a('0x39')](_0x2fa8c8,{'showHidden':![],'depth':null}));}}_0x1111f8();});});}function checkTranscribe(){var _0xc3551d;var _0x466d41;var _0x3616bf;return db[_0xaf3a('0x3a')][_0xaf3a('0x3b')]({'where':{'transcribeStatus':_0xaf3a('0x3c')}})[_0xaf3a('0xc')](function(_0x4705e3){if(!_0x4705e3||!_0x4705e3[_0xaf3a('0x18')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x3d'));}_0xc3551d=_0x4705e3;return db[_0xaf3a('0x3e')][_0xaf3a('0x23')]({'where':{'id':0x1}});})['then'](function(_0x10cb74){if(!_0x10cb74){throw new db[(_0xaf3a('0x1b'))]['ValidationError'](_0xaf3a('0x3f'));}_0x466d41=_0x10cb74;if(!_0x466d41['transcribe']||!_0x466d41[_0xaf3a('0x40')]||!_0x466d41[_0xaf3a('0x41')]||!_0x466d41[_0xaf3a('0x34')]||!_0x466d41[_0xaf3a('0x1f')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x42'));}return db[_0xaf3a('0x22')][_0xaf3a('0x23')]({'where':{'id':_0x466d41['transcribeAccountId']}});})[_0xaf3a('0xc')](function(_0x549502){if(!_0x549502){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x549502[_0xaf3a('0x9')]||!_0x549502[_0xaf3a('0xa')]){throw new db[(_0xaf3a('0x1b'))][(_0xaf3a('0x1c'))](_0xaf3a('0x25'));}_0x3616bf=_0x549502;var _0x3351c3=[];_0xc3551d[_0xaf3a('0x43')](function(_0x3cb7e1){_0x3351c3[_0xaf3a('0x44')](checkTranscribeJob(_0x3cb7e1,_0x466d41,_0x3616bf));});return BPromise['all'](_0x3351c3);})['catch'](function(_0x48f63e){if(_0x48f63e){if(!_0x48f63e[_0xaf3a('0x36')]||_0x48f63e['name']!==_0xaf3a('0x45')){logger[_0xaf3a('0x37')](util[_0xaf3a('0x39')](_0x48f63e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xdc25=['Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','data1','Cloud\x20Provider\x20not\x20configured','Sentiment','SentimentScore','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','Negative','Mixed','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xdc25,0x128));var _0x5dc2=function(_0x156685,_0x1ad473){_0x156685=_0x156685-0x0;var _0x3093b4=_0xdc25[_0x156685];return _0x3093b4;};var _=require(_0x5dc2('0x0'));var AWS=require(_0x5dc2('0x1'));var rp=require(_0x5dc2('0x2'));var util=require(_0x5dc2('0x3'));var BPromise=require('bluebird');var db=require(_0x5dc2('0x4'))['db'];var logger=require(_0x5dc2('0x5'))(_0x5dc2('0x6'));function getTranscriptionJob(_0x1f1402,_0x9275a7,_0x735566,_0x95e410){return new Promise(function(_0x31da5f,_0x13c1fd){var _0x37ae21=new AWS[(_0x5dc2('0x7'))]({'accessKeyId':_0x9275a7,'secretAccessKey':_0x1f1402,'region':_0x735566});_0x37ae21[_0x5dc2('0x8')]({'TranscriptionJobName':_0x95e410},function(_0x11c861,_0x3d111f){if(_0x11c861){return _0x13c1fd(_0x11c861);}else{return _0x31da5f(_0x3d111f);}});});}function sentiment(_0x53a82b,_0x89bb1c,_0x4c9f63,_0x10133e,_0x3ef210){return new Promise(function(_0x280171,_0x513d9d){var _0x3724fd=new AWS[(_0x5dc2('0x9'))]({'accessKeyId':_0x89bb1c,'secretAccessKey':_0x53a82b,'region':_0x4c9f63});_0x3724fd['detectSentiment']({'Text':_0x10133e,'LanguageCode':_0x3ef210[_0x5dc2('0xa')](0x0,0x2)},function(_0x22ff8f,_0x5e58ab){if(_0x22ff8f){return _0x513d9d(_0x22ff8f);}else{return _0x280171(_0x5e58ab);}});});}function checkTranscribeJob(_0x53e9e4,_0x52c170,_0x55a0b2){var _0x293707;return new BPromise(function(_0xf3c8c6,_0x108e6d){logger[_0x5dc2('0xb')](util[_0x5dc2('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x53e9e4['id'],_0x53e9e4[_0x5dc2('0xd')]));return getTranscriptionJob(_0x55a0b2['data1'],_0x55a0b2[_0x5dc2('0xe')],_0x52c170[_0x5dc2('0xf')],_0x53e9e4[_0x5dc2('0xd')])[_0x5dc2('0x10')](function(_0x1365db){logger[_0x5dc2('0xb')](util[_0x5dc2('0xc')](_0x5dc2('0x11'),_0x53e9e4['id'],_0x53e9e4['transcribeName'],_0x1365db[_0x5dc2('0x12')][_0x5dc2('0x13')]));if(!_0x53e9e4[_0x5dc2('0x14')]){switch(_0x1365db['TranscriptionJob'][_0x5dc2('0x13')]){case _0x5dc2('0x15'):var _0x42d9ae={'transcribeStatus':_0x1365db['TranscriptionJob'][_0x5dc2('0x13')],'fileUri':_0x1365db[_0x5dc2('0x12')][_0x5dc2('0x16')][_0x5dc2('0x17')]};logger['info'](util[_0x5dc2('0xc')](_0x5dc2('0x18'),_0x53e9e4['id']));return rp({'uri':_0x1365db[_0x5dc2('0x12')][_0x5dc2('0x16')][_0x5dc2('0x17')],'json':!![]})['then'](function(_0x2d1fc7){logger[_0x5dc2('0xb')](util[_0x5dc2('0xc')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x53e9e4['id']));if(_0x2d1fc7&&_0x2d1fc7[_0x5dc2('0x19')]&&_0x2d1fc7['results'][_0x5dc2('0x1a')]&&_0x2d1fc7[_0x5dc2('0x19')]['transcripts']['length']){_0x42d9ae['fileText']='';for(var _0x316a65=0x0;_0x316a65<_0x2d1fc7[_0x5dc2('0x19')][_0x5dc2('0x1a')]['length'];_0x316a65++){_0x42d9ae[_0x5dc2('0x14')]+=_0x2d1fc7[_0x5dc2('0x19')]['transcripts'][_0x316a65][_0x5dc2('0x1b')]+'';}}return _0x53e9e4[_0x5dc2('0x1c')](_0x42d9ae);})['then'](function(){logger[_0x5dc2('0xb')](util[_0x5dc2('0xc')](_0x5dc2('0x1d'),_0x53e9e4['id']));if(!_0x53e9e4['tempSentiment']){throw new db[(_0x5dc2('0x1e'))][(_0x5dc2('0x1f'))](_0x5dc2('0x20'));}if(!_0x52c170[_0x5dc2('0x21')]||!_0x52c170[_0x5dc2('0x22')]||!_0x52c170[_0x5dc2('0x23')]||!_0x52c170[_0x5dc2('0x24')]||!_0x52c170[_0x5dc2('0x25')]){throw new db['Sequelize'][(_0x5dc2('0x1f'))](_0x5dc2('0x26'));}if(!_0x42d9ae[_0x5dc2('0x14')]){throw new Error(_0x5dc2('0x27'));}if(_0x52c170[_0x5dc2('0x22')]===_0x55a0b2['id']){return _0x55a0b2;}else{return db[_0x5dc2('0x28')][_0x5dc2('0x29')]({'where':{'id':_settings[_0x5dc2('0x22')]}});}})[_0x5dc2('0x10')](function(_0x5b0729){if(!_0x5b0729){throw new db['Sequelize'][(_0x5dc2('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5b0729[_0x5dc2('0x2a')]||!_0x5b0729[_0x5dc2('0xe')]){throw new db[(_0x5dc2('0x1e'))]['ValidationError'](_0x5dc2('0x2b'));}_0x293707=_0x5b0729;logger[_0x5dc2('0xb')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x53e9e4['id']));return sentiment(_0x293707[_0x5dc2('0x2a')],_0x293707['data2'],_0x52c170['sentimentRegion'],_0x42d9ae['fileText'],_0x52c170['language']);})[_0x5dc2('0x10')](function(_0x4fca4e){logger['info'](util[_0x5dc2('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x53e9e4['id']));return _0x53e9e4[_0x5dc2('0x1c')]({'sentiment':_0x4fca4e[_0x5dc2('0x2c')],'sPositive':_0x4fca4e[_0x5dc2('0x2d')]['Positive'],'sNegative':_0x4fca4e['SentimentScore']['Negative'],'sMixed':_0x4fca4e[_0x5dc2('0x2d')]['Mixed'],'sNeutral':_0x4fca4e[_0x5dc2('0x2d')]['Neutral']});})['then'](function(){logger[_0x5dc2('0xb')](util['format'](_0x5dc2('0x1d'),_0x53e9e4['id']));_0xf3c8c6();});case _0x5dc2('0x2e'):return _0x53e9e4['update']({'transcribeStatus':'FAILED','failureReason':_0x1365db['TranscriptionJob'][_0x5dc2('0x2f')]})[_0x5dc2('0x10')](function(){logger[_0x5dc2('0xb')](util['format'](_0x5dc2('0x1d'),_0x53e9e4['id']));_0xf3c8c6();});default:logger['info'](util[_0x5dc2('0xc')](_0x5dc2('0x30'),_0x53e9e4['id']));break;}}else{return BPromise[_0x5dc2('0x31')]()[_0x5dc2('0x10')](function(){if(!_0x53e9e4['tempSentiment']){throw new db[(_0x5dc2('0x1e'))][(_0x5dc2('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x52c170[_0x5dc2('0x21')]||!_0x52c170[_0x5dc2('0x22')]||!_0x52c170[_0x5dc2('0x23')]||!_0x52c170['language']||!_0x52c170[_0x5dc2('0x25')]){throw new db[(_0x5dc2('0x1e'))][(_0x5dc2('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x53e9e4[_0x5dc2('0x14')]){throw new Error(_0x5dc2('0x27'));}if(_0x52c170[_0x5dc2('0x22')]===_0x55a0b2['id']){return _0x55a0b2;}else{return db[_0x5dc2('0x28')][_0x5dc2('0x29')]({'where':{'id':_settings[_0x5dc2('0x22')]}});}})['then'](function(_0x41de26){if(!_0x41de26){throw new db['Sequelize'][(_0x5dc2('0x1f'))](_0x5dc2('0x32'));}if(!_0x41de26[_0x5dc2('0x2a')]||!_0x41de26[_0x5dc2('0xe')]){throw new db[(_0x5dc2('0x1e'))]['ValidationError'](_0x5dc2('0x2b'));}_0x293707=_0x41de26;logger['info'](util[_0x5dc2('0xc')](_0x5dc2('0x33'),_0x53e9e4['id']));return sentiment(_0x293707['data1'],_0x293707['data2'],_0x52c170[_0x5dc2('0x23')],_0x53e9e4[_0x5dc2('0x14')],_0x52c170[_0x5dc2('0x24')]);})['then'](function(_0x483b20){logger[_0x5dc2('0xb')](util[_0x5dc2('0xc')](_0x5dc2('0x34'),_0x53e9e4['id']));return _0x53e9e4[_0x5dc2('0x1c')]({'sentiment':_0x483b20['Sentiment'],'sPositive':_0x483b20[_0x5dc2('0x2d')][_0x5dc2('0x35')],'sNegative':_0x483b20['SentimentScore'][_0x5dc2('0x36')],'sMixed':_0x483b20['SentimentScore'][_0x5dc2('0x37')],'sNeutral':_0x483b20['SentimentScore']['Neutral'],'transcribeStatus':'COMPLETED'});})['then'](function(){logger['info'](util['format'](_0x5dc2('0x1d'),_0x53e9e4['id']));_0xf3c8c6();});}})[_0x5dc2('0x38')](function(_0x13b325){if(_0x13b325){if(!_0x13b325[_0x5dc2('0x39')]||_0x13b325[_0x5dc2('0x39')]!=='SequelizeValidationError'){logger[_0x5dc2('0x3a')](util['format'](_0x5dc2('0x3b'),_0x53e9e4['id']),util[_0x5dc2('0x3c')](_0x13b325,{'showHidden':![],'depth':null}));}}_0xf3c8c6();});});}function checkTranscribe(){var _0x3a4d54;var _0x5bd882;var _0x457a92;return db[_0x5dc2('0x3d')][_0x5dc2('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x5dc2('0x10')](function(_0x52cfa5){if(!_0x52cfa5||!_0x52cfa5['length']){throw new db[(_0x5dc2('0x1e'))][(_0x5dc2('0x1f'))](_0x5dc2('0x3f'));}_0x3a4d54=_0x52cfa5;return db[_0x5dc2('0x40')][_0x5dc2('0x29')]({'where':{'id':0x1}});})[_0x5dc2('0x10')](function(_0x1c166c){if(!_0x1c166c){throw new db['Sequelize'][(_0x5dc2('0x1f'))](_0x5dc2('0x41'));}_0x5bd882=_0x1c166c;if(!_0x5bd882['transcribe']||!_0x5bd882[_0x5dc2('0x42')]||!_0x5bd882['transcribeRegion']||!_0x5bd882[_0x5dc2('0x24')]||!_0x5bd882[_0x5dc2('0x25')]){throw new db[(_0x5dc2('0x1e'))][(_0x5dc2('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0x5dc2('0x28')][_0x5dc2('0x29')]({'where':{'id':_0x5bd882[_0x5dc2('0x42')]}});})[_0x5dc2('0x10')](function(_0x358a76){if(!_0x358a76){throw new db['Sequelize'][(_0x5dc2('0x1f'))](_0x5dc2('0x32'));}if(!_0x358a76[_0x5dc2('0x2a')]||!_0x358a76['data2']){throw new db['Sequelize'][(_0x5dc2('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x457a92=_0x358a76;var _0x562420=[];_0x3a4d54[_0x5dc2('0x43')](function(_0x36bf30){_0x562420[_0x5dc2('0x44')](checkTranscribeJob(_0x36bf30,_0x5bd882,_0x457a92));});return BPromise[_0x5dc2('0x45')](_0x562420);})['catch'](function(_0x2e108f){if(_0x2e108f){if(!_0x2e108f[_0x5dc2('0x39')]||_0x2e108f[_0x5dc2('0x39')]!==_0x5dc2('0x46')){logger['error'](util[_0x5dc2('0x3c')](_0x2e108f,{'showHidden':![],'depth':null}));}}});}exports[_0x5dc2('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index faa6342..feccc2b 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 _0x8c00=['whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c00,0x185));var _0x08c0=function(_0x2508fd,_0xa8375b){_0x2508fd=_0x2508fd-0x0;var _0x3ce952=_0x8c00[_0x2508fd];return _0x3ce952;};'use strict';var _=require(_0x08c0('0x0'));var moment=require(_0x08c0('0x1'));var Redis=require(_0x08c0('0x2'));var util=require(_0x08c0('0x3'));var config=require(_0x08c0('0x4'));var db=require(_0x08c0('0x5'))['db'];var logger=require(_0x08c0('0x6'))(_0x08c0('0x7'));config[_0x08c0('0x8')]=_[_0x08c0('0x9')](config['redis'],{'host':_0x08c0('0xa'),'port':0x18eb});var io=require(_0x08c0('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x1f29e3=[];return db[_0x08c0('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x08c0('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x08c0('0xe')](0x18,_0x08c0('0xf'))}}})[_0x08c0('0x10')](function(_0x185379){if(_0x185379&&_0x185379['length']){_0x1f29e3=_[_0x08c0('0x11')](_0x185379||[],'id');logger[_0x08c0('0x12')](_0x08c0('0x13'),_0x1f29e3[_0x08c0('0x14')]());return db[_0x08c0('0xc')][_0x08c0('0x15')]({'closeReason':_0x08c0('0x16'),'disposition':_0x08c0('0x17'),'closed':!![],'closedAt':moment()['format'](_0x08c0('0x18'))},{'where':{'id':_0x1f29e3}});}})[_0x08c0('0x10')](function(){if(_0x1f29e3&&_0x1f29e3[_0x08c0('0x19')]){logger['info'](_0x08c0('0x1a'),_0x1f29e3[_0x08c0('0x14')]());for(var _0x194c0f=0x0;_0x194c0f<_0x1f29e3['length'];_0x194c0f++){io['emit'](_0x08c0('0x1b'),{'id':_0x1f29e3[_0x194c0f],'closed':!![]});}}})[_0x08c0('0x1c')](function(_0x11177e){logger['error'](_0x08c0('0x1d'),_0x11177e?util[_0x08c0('0x1e')](_0x11177e,{'showHidden':![],'depth':null}):'');});}exports[_0x08c0('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb658=['schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis','../../config/environment','../../mysqldb','../logger'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xb658,0x15a));var _0x8b65=function(_0x332d57,_0x5ef51f){_0x332d57=_0x332d57-0x0;var _0x7df8a7=_0xb658[_0x332d57];return _0x7df8a7;};'use strict';var _=require(_0x8b65('0x0'));var moment=require('moment');var Redis=require(_0x8b65('0x1'));var util=require('util');var config=require(_0x8b65('0x2'));var db=require(_0x8b65('0x3'))['db'];var logger=require(_0x8b65('0x4'))(_0x8b65('0x5'));config[_0x8b65('0x6')]=_[_0x8b65('0x7')](config['redis'],{'host':_0x8b65('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b65('0x6')]));function closeInteractions(){var _0x5dccd1=[];return db[_0x8b65('0x9')][_0x8b65('0xa')]({'raw':!![],'attributes':['id',_0x8b65('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8b65('0xc')](0x18,_0x8b65('0xd'))}}})[_0x8b65('0xe')](function(_0xc2192f){if(_0xc2192f&&_0xc2192f[_0x8b65('0xf')]){_0x5dccd1=_['map'](_0xc2192f||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x5dccd1[_0x8b65('0x10')]());return db['WhatsappInteraction'][_0x8b65('0x11')]({'closeReason':_0x8b65('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x8b65('0x13')](_0x8b65('0x14'))},{'where':{'id':_0x5dccd1}});}})[_0x8b65('0xe')](function(){if(_0x5dccd1&&_0x5dccd1['length']){logger[_0x8b65('0x15')](_0x8b65('0x16'),_0x5dccd1['join']());for(var _0x9bb46e=0x0;_0x9bb46e<_0x5dccd1[_0x8b65('0xf')];_0x9bb46e++){io['emit'](_0x8b65('0x17'),{'id':_0x5dccd1[_0x9bb46e],'closed':!![]});}}})[_0x8b65('0x18')](function(_0x59e32c){logger['error'](_0x8b65('0x19'),_0x59e32c?util[_0x8b65('0x1a')](_0x59e32c,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index aef3fc3..148143e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeee7=['log','hopper1','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','finished\x20populating','contacts1','CmHopper'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeee7,0x136));var _0x7eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7eee('0x0'));var db=require(_0x7eee('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7eee('0x2')]({'id':i,'firstName':_0x7eee('0x3')+i,'lastName':_0x7eee('0x4')+i,'phone':0xf879fb460+i,'email':_0x7eee('0x5')+i+_0x7eee('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7eee('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7eee('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7eee('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7eee('0x2')]({'id':i,'firstName':_0x7eee('0x3')+i,'lastName':_0x7eee('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7eee('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7eee('0x7')](),'updatedAt':Date[_0x7eee('0x7')]()});}db[_0x7eee('0x8')]['destroy']({'where':{}})['then'](function(){return db[_0x7eee('0x8')][_0x7eee('0x9')](contacts);})[_0x7eee('0xa')](function(){console['log'](_0x7eee('0xb'),_0x7eee('0xc'));return db[_0x7eee('0xd')]['destroy']({'where':{}});})[_0x7eee('0xa')](function(){return db['CmHopper'][_0x7eee('0x9')](hopper);})[_0x7eee('0xa')](function(){console[_0x7eee('0xe')](_0x7eee('0xb'),_0x7eee('0xf'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0x7eee('0xe')](_0x7eee('0xb'),_0x7eee('0x10'));return db[_0x7eee('0xd')][_0x7eee('0x9')](hopper2);})['then'](function(){console[_0x7eee('0xe')]('finished\x20populating','hopper2');})[_0x7eee('0x11')](function(_0x325067){console['log'](_0x325067);}); \ No newline at end of file +var _0xcdfa=['../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','log','finished\x20populating','CmHopper','destroy','contacts2','hopper2','catch','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcdfa,0x120));var _0xacdf=function(_0x580851,_0x2970ee){_0x580851=_0x580851-0x0;var _0x5df6c0=_0xcdfa[_0x580851];return _0x5df6c0;};'use strict';var util=require(_0xacdf('0x0'));var db=require(_0xacdf('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xacdf('0x2')]({'id':i,'firstName':_0xacdf('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xacdf('0x4')+i+_0xacdf('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xacdf('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xacdf('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xacdf('0x6')](),'updatedAt':Date[_0xacdf('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xacdf('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xacdf('0x4')+i+_0xacdf('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xacdf('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xacdf('0x6')](),'updatedAt':Date[_0xacdf('0x6')]()});}db['CmContact']['destroy']({'where':{}})['then'](function(){return db[_0xacdf('0x7')][_0xacdf('0x8')](contacts);})[_0xacdf('0x9')](function(){console[_0xacdf('0xa')](_0xacdf('0xb'),'contacts1');return db[_0xacdf('0xc')][_0xacdf('0xd')]({'where':{}});})['then'](function(){return db[_0xacdf('0xc')]['bulkCreate'](hopper);})['then'](function(){console[_0xacdf('0xa')]('finished\x20populating','hopper1');return db[_0xacdf('0x7')][_0xacdf('0x8')](contacts2);})['then'](function(){console[_0xacdf('0xa')](_0xacdf('0xb'),_0xacdf('0xe'));return db['CmHopper'][_0xacdf('0x8')](hopper2);})['then'](function(){console[_0xacdf('0xa')](_0xacdf('0xb'),_0xacdf('0xf'));})[_0xacdf('0x10')](function(_0x6a7f63){console[_0xacdf('0xa')](_0x6a7f63);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 803853b..dd5671c 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x819d=['yes','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','add\x20user','catch','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','ulaw'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x819d,0x94));var _0xd819=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x819d[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xd819('0x0'));var db=require(_0xd819('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd819('0x2')]({'name':util[_0xd819('0x3')](_0xd819('0x4'),_0xd819('0x5'),i),'fullname':util[_0xd819('0x3')]('%s%s',_0xd819('0x5'),i),'email':util[_0xd819('0x3')](_0xd819('0x6'),_0xd819('0x5'),i),'role':_0xd819('0x5'),'password':_0xd819('0x7'),'internal':0xfa0+i,'type':_0xd819('0x8'),'transport':[_0xd819('0x9'),'ws',_0xd819('0xa')],'disallow':['all'],'allow':[_0xd819('0xb')],'defaultuser':util['format'](_0xd819('0x4'),_0xd819('0x5'),i),'encryption':_0xd819('0xc'),'avpf':'yes','force_avp':_0xd819('0xc'),'icesupport':_0xd819('0xc'),'dtlsenable':_0xd819('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd819('0xd'),'dtlssetup':_0xd819('0xe'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0xd819('0x3')](_0xd819('0x4'),_0xd819('0x5'),i),0xfa0+i)});}db['User'][_0xd819('0xf')](users)[_0xd819('0x10')](function(){console['log'](_0xd819('0x11'));})[_0xd819('0x12')](function(_0x1c1bc9){console[_0xd819('0x13')](_0x1c1bc9);}); \ No newline at end of file +var _0xf046=['User','bulkCreate','log','catch','util','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0xec9d45,_0x13b351){var _0xcfc7a0=function(_0x2d9a79){while(--_0x2d9a79){_0xec9d45['push'](_0xec9d45['shift']());}};_0xcfc7a0(++_0x13b351);}(_0xf046,0xe0));var _0x6f04=function(_0xf0339b,_0x21a8ca){_0xf0339b=_0xf0339b-0x0;var _0x14d27f=_0xf046[_0xf0339b];return _0x14d27f;};'use strict';var util=require(_0x6f04('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x6f04('0x1')](_0x6f04('0x2'),_0x6f04('0x3'),i),'fullname':util[_0x6f04('0x1')](_0x6f04('0x2'),'agent',i),'email':util[_0x6f04('0x1')](_0x6f04('0x4'),_0x6f04('0x3'),i),'role':_0x6f04('0x3'),'password':_0x6f04('0x5'),'internal':0xfa0+i,'type':_0x6f04('0x6'),'transport':[_0x6f04('0x7'),'ws',_0x6f04('0x8')],'disallow':[_0x6f04('0x9')],'allow':[_0x6f04('0xa')],'defaultuser':util[_0x6f04('0x1')]('%s%s','agent',i),'encryption':_0x6f04('0xb'),'avpf':_0x6f04('0xb'),'force_avp':_0x6f04('0xb'),'icesupport':_0x6f04('0xb'),'dtlsenable':_0x6f04('0xb'),'dtlsverify':'no','dtlscertfile':_0x6f04('0xc'),'dtlsprivatekey':_0x6f04('0xd'),'dtlssetup':_0x6f04('0xe'),'callerid':util['format'](_0x6f04('0xf'),util[_0x6f04('0x1')]('%s%s',_0x6f04('0x3'),i),0xfa0+i)});}db[_0x6f04('0x10')][_0x6f04('0x11')](users)['then'](function(){console[_0x6f04('0x12')]('add\x20user');})[_0x6f04('0x13')](function(_0x70d282){console[_0x6f04('0x12')](_0x70d282);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 9f370b4..8f66616 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f00=['Agents','User','agent','telephone','name','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','Campaign','where','type','format','%s:queue:%s','length','handshake','query','find','role','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','userProfileId','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','emit','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment'];(function(_0x1aae1b,_0xc8943f){var _0x15e8e0=function(_0x887dfa){while(--_0x887dfa){_0x1aae1b['push'](_0x1aae1b['shift']());}};_0x15e8e0(++_0xc8943f);}(_0x4f00,0x1ea));var _0x04f0=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x4f00[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x04f0('0x0'));var util=require(_0x04f0('0x1'));var BPromise=require(_0x04f0('0x2'));var db=require(_0x04f0('0x3'))['db'];var config=require(_0x04f0('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x04f0('0x5'),'model':db[_0x04f0('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x04f0('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04f0('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x04f0('0x9')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04f0('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x04f0('0x9'),'type'],'where':{'type':_0x04f0('0xa')}};function getAssociatedResources(_0x5d4335,_0x15de72,_0x1db999){return db[_0x04f0('0xb')][_0x04f0('0xc')]({'where':{'name':_0x5d4335,'userProfileId':_0x15de72},'raw':!![]})[_0x04f0('0xd')](function(_0x139b3d){if(_0x139b3d){if(_0x139b3d[_0x04f0('0xe')]){switch(_0x5d4335){case'VoiceQueues':case _0x04f0('0xf'):case _0x04f0('0x10'):case _0x04f0('0x11'):case _0x04f0('0x12'):case _0x04f0('0x13'):case _0x04f0('0x14'):return db[_0x1db999][_0x04f0('0x15')](queryQueues);case _0x04f0('0x16'):return db[_0x1db999]['findAll'](queryTelephones);case _0x04f0('0x17'):return db[_0x1db999][_0x04f0('0x15')](queryTrunks);case _0x04f0('0x18'):return db[_0x1db999][_0x04f0('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0x04f0('0x15')]({'attributes':[_0x04f0('0x19')],'where':{'sectionId':_0x139b3d['id']},'raw':!![]})[_0x04f0('0xd')](function(_0x1b7f23){if(_0x1b7f23){var _0xb69d29={'where':{'id':_[_0x04f0('0x1a')](_0x1b7f23,_0x04f0('0x19'))},'raw':!![]};switch(_0x1db999){case _0x04f0('0x6'):_0xb69d29['where']['role']=_0x04f0('0x8');break;case _0x04f0('0x1b'):_0xb69d29[_0x04f0('0x1c')][_0x04f0('0x1d')]=_0x04f0('0xa');break;}return db[_0x1db999][_0x04f0('0x15')](_0xb69d29);}else{return[];}});}}else{return[];}})[_0x04f0('0xd')](function(_0x43cd57){return _0x43cd57;});}function joinOrLeaveQueues(_0x507899,_0x43e831,_0x5c6ce6,_0x12f2a7){_0x507899[_0x43e831](util[_0x04f0('0x1e')](_0x04f0('0x1f'),_0x5c6ce6,_0x12f2a7['name']));if(_0x12f2a7[_0x04f0('0x5')]){for(var _0x4cb7fb=0x0;_0x4cb7fb<_0x12f2a7[_0x04f0('0x5')][_0x04f0('0x20')];_0x4cb7fb+=0x1){_0x507899[_0x43e831](util[_0x04f0('0x1e')]('user:%s',_0x12f2a7[_0x04f0('0x5')][_0x4cb7fb][_0x04f0('0x9')]));}}}function joinOrLeave(_0x2a398c,_0x3e054e,_0x1a6232){var _0x49d265;if(_0x2a398c[_0x04f0('0x21')][_0x04f0('0x22')]['id']){db[_0x04f0('0x6')][_0x04f0('0x23')]({'attributes':['id',_0x04f0('0x9'),_0x04f0('0x24'),'userProfileId'],'where':{'id':_0x2a398c['handshake'][_0x04f0('0x22')]['id']},'include':[{'model':db[_0x04f0('0x25')],'as':_0x04f0('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x04f0('0x27')],'as':_0x04f0('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x04f0('0x29')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x04f0('0x2a')],'as':_0x04f0('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x04f0('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x04f0('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x04f0('0xd')](function(_0x27a618){if(_0x27a618){_0x49d265=_0x27a618;_0x2a398c[_0x3e054e](util[_0x04f0('0x1e')](_0x04f0('0x2e'),_0x27a618['name']));var _0x571978=[];switch(_0x27a618[_0x04f0('0x24')]){case _0x04f0('0x2f'):_0x2a398c[_0x3e054e](_0x04f0('0x30'));_0x2a398c[_0x3e054e](_0x04f0('0x31'));if(queryQueues['hasOwnProperty'](_0x04f0('0x32'))){delete queryQueues[_0x04f0('0x32')];}_0x571978[_0x04f0('0x33')](db[_0x04f0('0x34')][_0x04f0('0x15')](queryQueues));_0x571978['push'](db['ChatQueue']['findAll'](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x35')][_0x04f0('0x15')](queryQueues));_0x571978['push'](db[_0x04f0('0x36')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x37')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x38')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x39')][_0x04f0('0x15')](queryQueues));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x6')][_0x04f0('0x15')](queryTelephones));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x3a')][_0x04f0('0x15')](queryTrunks));_0x571978[_0x04f0('0x33')](db['Campaign'][_0x04f0('0x15')](queryCampaigns));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x6')][_0x04f0('0x15')](queryAgents));break;case _0x04f0('0x3b'):_0x2a398c[_0x3e054e]('voice:inbound');_0x2a398c[_0x3e054e](_0x04f0('0x31'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x3c'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x34')));_0x571978['push'](getAssociatedResources(_0x04f0('0xf'),_0x27a618[_0x04f0('0x3d')],'ChatQueue'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x10'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x35')));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x11'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x36')));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x12'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x37')));_0x571978['push'](getAssociatedResources(_0x04f0('0x13'),_0x27a618[_0x04f0('0x3d')],'OpenchannelQueue'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x14'),_0x27a618[_0x04f0('0x3d')],_0x04f0('0x39')));_0x571978['push'](getAssociatedResources(_0x04f0('0x16'),_0x27a618[_0x04f0('0x3d')],'User'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x17'),_0x27a618['userProfileId'],'Trunk'));_0x571978[_0x04f0('0x33')](getAssociatedResources(_0x04f0('0x18'),_0x27a618[_0x04f0('0x3d')],'Campaign'));_0x571978[_0x04f0('0x33')](db[_0x04f0('0x6')][_0x04f0('0x15')](queryAgents));break;case _0x04f0('0x7'):_0x2a398c[_0x3e054e](_0x04f0('0x30'));_0x2a398c[_0x3e054e](_0x04f0('0x31'));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x3e')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978['push'](_0x27a618['getChatQueues']({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x3f')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x40')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618['getMailQueues']({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618[_0x04f0('0x41')]({'attributes':['id',_0x04f0('0x9')]}));_0x571978[_0x04f0('0x33')](_0x27a618['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x04f0('0x42')](_0x571978);}})[_0x04f0('0xd')](function(_0x404b1a){if(_0x404b1a&&_0x404b1a[_0x04f0('0x20')]){for(var _0x349921=0x0;_0x349921<_0x404b1a[_0x04f0('0x20')];_0x349921+=0x1){for(var _0x570638=0x0;_0x570638<_0x404b1a[_0x349921]['length'];_0x570638+=0x1){switch(_0x349921){case 0x0:joinOrLeaveQueues(_0x2a398c,_0x3e054e,'voice',_0x404b1a[_0x349921][_0x570638]);break;case 0x1:joinOrLeaveQueues(_0x2a398c,_0x3e054e,'chat',_0x404b1a[_0x349921][_0x570638]);break;case 0x2:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x43'),_0x404b1a[_0x349921][_0x570638]);break;case 0x3:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x44'),_0x404b1a[_0x349921][_0x570638]);break;case 0x4:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x45'),_0x404b1a[_0x349921][_0x570638]);break;case 0x5:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x46'),_0x404b1a[_0x349921][_0x570638]);break;case 0x6:joinOrLeaveQueues(_0x2a398c,_0x3e054e,_0x04f0('0x47'),_0x404b1a[_0x349921][_0x570638]);break;case 0x7:if(_0x49d265[_0x04f0('0x24')]!=='agent')_0x2a398c[_0x3e054e](util[_0x04f0('0x1e')](_0x04f0('0x48'),_0x404b1a[_0x349921][_0x570638]['name']));break;case 0x8:if(_0x49d265[_0x04f0('0x24')]!==_0x04f0('0x7'))_0x2a398c[_0x3e054e](util['format'](_0x04f0('0x49'),_0x404b1a[_0x349921][_0x570638][_0x04f0('0x9')]));break;case 0x9:if(_0x49d265['role']!==_0x04f0('0x7'))_0x2a398c[_0x3e054e](util['format'](_0x04f0('0x4a'),_0x404b1a[_0x349921][_0x570638][_0x04f0('0x1d')],_0x404b1a[_0x349921][_0x570638][_0x04f0('0x9')]));break;case 0xa:_0x2a398c[_0x3e054e](util[_0x04f0('0x1e')](_0x04f0('0x2e'),_0x404b1a[_0x349921][_0x570638][_0x04f0('0x9')]));break;}}}}})['then'](function(){if(_0x3e054e==='leave'){var _0x9062dd=_['map'](_0x49d265[_0x04f0('0x26')],'id');return _0x49d265['removeChatInteractions'](_0x9062dd)[_0x04f0('0xd')](function(){for(var _0x5bfd13=0x0;_0x5bfd13<_0x9062dd['length'];_0x5bfd13+=0x1){_0x1a6232['emit'](_0x04f0('0x4b'),{'ChatInteractionId':Number(_0x9062dd[_0x5bfd13]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0xd')](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x1b5123=_['map'](_0x49d265[_0x04f0('0x28')],'id');return _0x49d265[_0x04f0('0x4d')](_0x1b5123)[_0x04f0('0xd')](function(){for(var _0x3f2f46=0x0;_0x3f2f46<_0x1b5123[_0x04f0('0x20')];_0x3f2f46+=0x1){_0x1a6232['emit'](_0x04f0('0x4e'),{'MailInteractionId':Number(_0x1b5123[_0x3f2f46]),'UserId':Number(_0x49d265['id'])});}});}})['then'](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x158bd3=_['map'](_0x49d265[_0x04f0('0x4f')],'id');return _0x49d265['removeFaxInteractions'](_0x158bd3)[_0x04f0('0xd')](function(){for(var _0x3d97e4=0x0;_0x3d97e4<_0x158bd3[_0x04f0('0x20')];_0x3d97e4+=0x1){_0x1a6232[_0x04f0('0x50')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x158bd3[_0x3d97e4]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0xd')](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x162c9e=_[_0x04f0('0x1a')](_0x49d265[_0x04f0('0x2b')],'id');return _0x49d265['removeSmsInteractions'](_0x162c9e)[_0x04f0('0xd')](function(){for(var _0x17c259=0x0;_0x17c259<_0x162c9e['length'];_0x17c259+=0x1){_0x1a6232[_0x04f0('0x50')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x162c9e[_0x17c259]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0xd')](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x35864d=_[_0x04f0('0x1a')](_0x49d265[_0x04f0('0x2c')],'id');return _0x49d265[_0x04f0('0x51')](_0x35864d)[_0x04f0('0xd')](function(){for(var _0x872c54=0x0;_0x872c54<_0x35864d[_0x04f0('0x20')];_0x872c54+=0x1){_0x1a6232['emit'](_0x04f0('0x52'),{'OpenchannelInteractionId':Number(_0x35864d[_0x872c54]),'UserId':Number(_0x49d265['id'])});}});}})['then'](function(){if(_0x3e054e===_0x04f0('0x4c')){var _0x59b203=_[_0x04f0('0x1a')](_0x49d265['WhatsappInteractions'],'id');return _0x49d265[_0x04f0('0x53')](_0x59b203)['then'](function(){for(var _0x18ded1=0x0;_0x18ded1<_0x59b203[_0x04f0('0x20')];_0x18ded1+=0x1){_0x1a6232['emit'](_0x04f0('0x54'),{'WhatsappInteractionId':Number(_0x59b203[_0x18ded1]),'UserId':Number(_0x49d265['id'])});}});}})[_0x04f0('0x55')](function(_0x4c7ffa){_0x2a398c[_0x04f0('0x56')](_0x4c7ffa);});}}function onDisconnect(_0x37bff0,_0x2e9d7e){joinOrLeave(_0x37bff0,_0x04f0('0x4c'),_0x2e9d7e);}function onConnect(_0x3ce4c6){joinOrLeave(_0x3ce4c6,_0x04f0('0x57'));}exports[_0x04f0('0x58')]=function(_0x1792fd){_0x1792fd['on'](_0x04f0('0x59'),function(_0xb2781){_0xb2781[_0x04f0('0x5a')](0x0);_0xb2781[_0x04f0('0x5b')]=_0xb2781[_0x04f0('0x5c')][_0x04f0('0x59')][_0x04f0('0x5d')]+':'+_0xb2781[_0x04f0('0x5c')][_0x04f0('0x59')][_0x04f0('0x5e')];_0xb2781[_0x04f0('0x5f')]=new Date();_0xb2781[_0x04f0('0x56')]=function(_0x3b90fd){console[_0x04f0('0x56')]('SocketIO\x20'+_0xb2781[_0x04f0('0x60')][_0x04f0('0x9')]+'['+_0xb2781[_0x04f0('0x5b')]+']',_0x3b90fd);};_0xb2781['on']('disconnect',function(){onDisconnect(_0xb2781,_0x1792fd);_0xb2781['log'](_0x04f0('0x61'));});onConnect(_0xb2781);_0xb2781['log'](_0x04f0('0x62'));});}; \ No newline at end of file +var _0x1cbc=['sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','format','%s:queue:%s','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','voice:outbound','userProfileId','ChatQueues','SmsQueues','SmsQueue','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','voice','chat'];(function(_0x5e76ee,_0x5adea7){var _0x4777e8=function(_0x16b436){while(--_0x16b436){_0x5e76ee['push'](_0x5e76ee['shift']());}};_0x4777e8(++_0x5adea7);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0x1cbc[_0x561771];return _0x54d16e;};'use strict';var _=require(_0xc1cb('0x0'));var util=require('util');var BPromise=require(_0xc1cb('0x1'));var db=require(_0xc1cb('0x2'))['db'];var config=require(_0xc1cb('0x3'));var queryQueues={'attributes':['id',_0xc1cb('0x4')],'include':[{'as':_0xc1cb('0x5'),'model':db[_0xc1cb('0x6')],'attributes':['id',_0xc1cb('0x4'),_0xc1cb('0x7')],'raw':!![],'where':{'role':_0xc1cb('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc1cb('0x4')],'where':{'role':_0xc1cb('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc1cb('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xc1cb('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xc1cb('0xa')],'where':{'type':_0xc1cb('0xb')}};function getAssociatedResources(_0x483839,_0x24e028,_0xb3fff7){return db[_0xc1cb('0xc')][_0xc1cb('0xd')]({'where':{'name':_0x483839,'userProfileId':_0x24e028},'raw':!![]})[_0xc1cb('0xe')](function(_0x2e641d){if(_0x2e641d){if(_0x2e641d[_0xc1cb('0xf')]){switch(_0x483839){case _0xc1cb('0x10'):case'ChatQueues':case _0xc1cb('0x11'):case'SmsQueues':case _0xc1cb('0x12'):case _0xc1cb('0x13'):case _0xc1cb('0x14'):return db[_0xb3fff7][_0xc1cb('0x15')](queryQueues);case _0xc1cb('0x16'):return db[_0xb3fff7][_0xc1cb('0x15')](queryTelephones);case _0xc1cb('0x17'):return db[_0xb3fff7]['findAll'](queryTrunks);case _0xc1cb('0x18'):return db[_0xb3fff7][_0xc1cb('0x15')](queryCampaigns);}}else{return db[_0xc1cb('0x19')][_0xc1cb('0x15')]({'attributes':['resourceId'],'where':{'sectionId':_0x2e641d['id']},'raw':!![]})[_0xc1cb('0xe')](function(_0x899226){if(_0x899226){var _0x4fd5ea={'where':{'id':_['map'](_0x899226,_0xc1cb('0x1a'))},'raw':!![]};switch(_0xb3fff7){case _0xc1cb('0x6'):_0x4fd5ea[_0xc1cb('0x1b')]['role']='telephone';break;case'Campaign':_0x4fd5ea['where'][_0xc1cb('0xa')]=_0xc1cb('0xb');break;}return db[_0xb3fff7][_0xc1cb('0x15')](_0x4fd5ea);}else{return[];}});}}else{return[];}})[_0xc1cb('0xe')](function(_0x2b9e84){return _0x2b9e84;});}function joinOrLeaveQueues(_0x339b16,_0x596f58,_0x27a3db,_0x11bdb0){_0x339b16[_0x596f58](util[_0xc1cb('0x1c')](_0xc1cb('0x1d'),_0x27a3db,_0x11bdb0['name']));if(_0x11bdb0[_0xc1cb('0x5')]){for(var _0x2f44e8=0x0;_0x2f44e8<_0x11bdb0[_0xc1cb('0x5')]['length'];_0x2f44e8+=0x1){_0x339b16[_0x596f58](util['format'](_0xc1cb('0x1e'),_0x11bdb0[_0xc1cb('0x5')][_0x2f44e8]['name']));}}}function joinOrLeave(_0x5e4e33,_0x5259f9,_0x1bc2fa){var _0x127712;if(_0x5e4e33[_0xc1cb('0x1f')][_0xc1cb('0x20')]['id']){db[_0xc1cb('0x6')][_0xc1cb('0x21')]({'attributes':['id','name',_0xc1cb('0x7'),'userProfileId'],'where':{'id':_0x5e4e33[_0xc1cb('0x1f')][_0xc1cb('0x20')]['id']},'include':[{'model':db[_0xc1cb('0x22')],'as':_0xc1cb('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xc1cb('0x24')],'as':_0xc1cb('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xc1cb('0x26')],'as':_0xc1cb('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xc1cb('0x28')],'as':_0xc1cb('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xc1cb('0x2a')],'as':_0xc1cb('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0xf68d03){if(_0xf68d03){_0x127712=_0xf68d03;_0x5e4e33[_0x5259f9](util[_0xc1cb('0x1c')](_0xc1cb('0x1e'),_0xf68d03['name']));var _0x9fdcb9=[];switch(_0xf68d03[_0xc1cb('0x7')]){case _0xc1cb('0x2c'):_0x5e4e33[_0x5259f9]('voice:inbound');_0x5e4e33[_0x5259f9]('voice:outbound');if(queryQueues[_0xc1cb('0x2d')](_0xc1cb('0x2e'))){delete queryQueues[_0xc1cb('0x2e')];}_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x30')][_0xc1cb('0x15')](queryQueues));_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x31')]['findAll'](queryQueues));_0x9fdcb9['push'](db[_0xc1cb('0x32')]['findAll'](queryQueues));_0x9fdcb9[_0xc1cb('0x2f')](db['SmsQueue'][_0xc1cb('0x15')](queryQueues));_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x33')][_0xc1cb('0x15')](queryQueues));_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x34')][_0xc1cb('0x15')](queryQueues));_0x9fdcb9['push'](db[_0xc1cb('0x35')]['findAll'](queryQueues));_0x9fdcb9['push'](db['User'][_0xc1cb('0x15')](queryTelephones));_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x36')][_0xc1cb('0x15')](queryTrunks));_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x37')][_0xc1cb('0x15')](queryCampaigns));_0x9fdcb9[_0xc1cb('0x2f')](db[_0xc1cb('0x6')]['findAll'](queryAgents));break;case _0xc1cb('0x38'):_0x5e4e33[_0x5259f9](_0xc1cb('0x39'));_0x5e4e33[_0x5259f9](_0xc1cb('0x3a'));_0x9fdcb9['push'](getAssociatedResources('VoiceQueues',_0xf68d03[_0xc1cb('0x3b')],_0xc1cb('0x30')));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x3c'),_0xf68d03[_0xc1cb('0x3b')],'ChatQueue'));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x11'),_0xf68d03[_0xc1cb('0x3b')],_0xc1cb('0x32')));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x3d'),_0xf68d03[_0xc1cb('0x3b')],_0xc1cb('0x3e')));_0x9fdcb9['push'](getAssociatedResources(_0xc1cb('0x12'),_0xf68d03['userProfileId'],_0xc1cb('0x33')));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x13'),_0xf68d03[_0xc1cb('0x3b')],_0xc1cb('0x34')));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x14'),_0xf68d03['userProfileId'],_0xc1cb('0x35')));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x16'),_0xf68d03[_0xc1cb('0x3b')],_0xc1cb('0x6')));_0x9fdcb9['push'](getAssociatedResources(_0xc1cb('0x17'),_0xf68d03[_0xc1cb('0x3b')],'Trunk'));_0x9fdcb9[_0xc1cb('0x2f')](getAssociatedResources(_0xc1cb('0x18'),_0xf68d03[_0xc1cb('0x3b')],_0xc1cb('0x37')));_0x9fdcb9['push'](db['User'][_0xc1cb('0x15')](queryAgents));break;case _0xc1cb('0x8'):_0x5e4e33[_0x5259f9](_0xc1cb('0x39'));_0x5e4e33[_0x5259f9]('voice:outbound');_0x9fdcb9[_0xc1cb('0x2f')](_0xf68d03[_0xc1cb('0x3f')]({'attributes':['id',_0xc1cb('0x4')]}));_0x9fdcb9[_0xc1cb('0x2f')](_0xf68d03[_0xc1cb('0x40')]({'attributes':['id',_0xc1cb('0x4')]}));_0x9fdcb9['push'](_0xf68d03['getFaxQueues']({'attributes':['id','name']}));_0x9fdcb9['push'](_0xf68d03[_0xc1cb('0x41')]({'attributes':['id',_0xc1cb('0x4')]}));_0x9fdcb9[_0xc1cb('0x2f')](_0xf68d03[_0xc1cb('0x42')]({'attributes':['id',_0xc1cb('0x4')]}));_0x9fdcb9[_0xc1cb('0x2f')](_0xf68d03[_0xc1cb('0x43')]({'attributes':['id',_0xc1cb('0x4')]}));_0x9fdcb9[_0xc1cb('0x2f')](_0xf68d03['getWhatsappQueues']({'attributes':['id',_0xc1cb('0x4')]}));break;}return BPromise['all'](_0x9fdcb9);}})[_0xc1cb('0xe')](function(_0x98aad3){if(_0x98aad3&&_0x98aad3[_0xc1cb('0x44')]){for(var _0x534e39=0x0;_0x534e39<_0x98aad3[_0xc1cb('0x44')];_0x534e39+=0x1){for(var _0x45eabb=0x0;_0x45eabb<_0x98aad3[_0x534e39][_0xc1cb('0x44')];_0x45eabb+=0x1){switch(_0x534e39){case 0x0:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,_0xc1cb('0x45'),_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x1:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,_0xc1cb('0x46'),_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x2:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,'fax',_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x3:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,_0xc1cb('0x47'),_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x4:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,_0xc1cb('0x48'),_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x5:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,'openchannel',_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x6:joinOrLeaveQueues(_0x5e4e33,_0x5259f9,_0xc1cb('0x49'),_0x98aad3[_0x534e39][_0x45eabb]);break;case 0x7:if(_0x127712[_0xc1cb('0x7')]!==_0xc1cb('0x8'))_0x5e4e33[_0x5259f9](util[_0xc1cb('0x1c')](_0xc1cb('0x4a'),_0x98aad3[_0x534e39][_0x45eabb][_0xc1cb('0x4')]));break;case 0x8:if(_0x127712[_0xc1cb('0x7')]!==_0xc1cb('0x8'))_0x5e4e33[_0x5259f9](util['format'](_0xc1cb('0x4b'),_0x98aad3[_0x534e39][_0x45eabb][_0xc1cb('0x4')]));break;case 0x9:if(_0x127712[_0xc1cb('0x7')]!==_0xc1cb('0x8'))_0x5e4e33[_0x5259f9](util[_0xc1cb('0x1c')](_0xc1cb('0x4c'),_0x98aad3[_0x534e39][_0x45eabb][_0xc1cb('0xa')],_0x98aad3[_0x534e39][_0x45eabb][_0xc1cb('0x4')]));break;case 0xa:_0x5e4e33[_0x5259f9](util[_0xc1cb('0x1c')]('user:%s',_0x98aad3[_0x534e39][_0x45eabb][_0xc1cb('0x4')]));break;}}}}})[_0xc1cb('0xe')](function(){if(_0x5259f9===_0xc1cb('0x4d')){var _0x256c2d=_[_0xc1cb('0x4e')](_0x127712[_0xc1cb('0x23')],'id');return _0x127712[_0xc1cb('0x4f')](_0x256c2d)[_0xc1cb('0xe')](function(){for(var _0xad0d91=0x0;_0xad0d91<_0x256c2d[_0xc1cb('0x44')];_0xad0d91+=0x1){_0x1bc2fa[_0xc1cb('0x50')](_0xc1cb('0x51'),{'ChatInteractionId':Number(_0x256c2d[_0xad0d91]),'UserId':Number(_0x127712['id'])});}});}})[_0xc1cb('0xe')](function(){if(_0x5259f9===_0xc1cb('0x4d')){var _0x3a6506=_['map'](_0x127712[_0xc1cb('0x25')],'id');return _0x127712[_0xc1cb('0x52')](_0x3a6506)['then'](function(){for(var _0x170b49=0x0;_0x170b49<_0x3a6506['length'];_0x170b49+=0x1){_0x1bc2fa[_0xc1cb('0x50')](_0xc1cb('0x53'),{'MailInteractionId':Number(_0x3a6506[_0x170b49]),'UserId':Number(_0x127712['id'])});}});}})[_0xc1cb('0xe')](function(){if(_0x5259f9===_0xc1cb('0x4d')){var _0x2ff07a=_[_0xc1cb('0x4e')](_0x127712[_0xc1cb('0x27')],'id');return _0x127712[_0xc1cb('0x54')](_0x2ff07a)[_0xc1cb('0xe')](function(){for(var _0x306cc5=0x0;_0x306cc5<_0x2ff07a[_0xc1cb('0x44')];_0x306cc5+=0x1){_0x1bc2fa['emit'](_0xc1cb('0x55'),{'FaxInteractionId':Number(_0x2ff07a[_0x306cc5]),'UserId':Number(_0x127712['id'])});}});}})[_0xc1cb('0xe')](function(){if(_0x5259f9===_0xc1cb('0x4d')){var _0x55064c=_[_0xc1cb('0x4e')](_0x127712['SmsInteractions'],'id');return _0x127712['removeSmsInteractions'](_0x55064c)[_0xc1cb('0xe')](function(){for(var _0x3810f4=0x0;_0x3810f4<_0x55064c[_0xc1cb('0x44')];_0x3810f4+=0x1){_0x1bc2fa[_0xc1cb('0x50')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x55064c[_0x3810f4]),'UserId':Number(_0x127712['id'])});}});}})[_0xc1cb('0xe')](function(){if(_0x5259f9===_0xc1cb('0x4d')){var _0x494033=_[_0xc1cb('0x4e')](_0x127712[_0xc1cb('0x2b')],'id');return _0x127712[_0xc1cb('0x56')](_0x494033)[_0xc1cb('0xe')](function(){for(var _0x15dc14=0x0;_0x15dc14<_0x494033[_0xc1cb('0x44')];_0x15dc14+=0x1){_0x1bc2fa['emit'](_0xc1cb('0x57'),{'OpenchannelInteractionId':Number(_0x494033[_0x15dc14]),'UserId':Number(_0x127712['id'])});}});}})['then'](function(){if(_0x5259f9==='leave'){var _0x549405=_['map'](_0x127712[_0xc1cb('0x58')],'id');return _0x127712[_0xc1cb('0x59')](_0x549405)[_0xc1cb('0xe')](function(){for(var _0x17e809=0x0;_0x17e809<_0x549405[_0xc1cb('0x44')];_0x17e809+=0x1){_0x1bc2fa['emit'](_0xc1cb('0x5a'),{'WhatsappInteractionId':Number(_0x549405[_0x17e809]),'UserId':Number(_0x127712['id'])});}});}})[_0xc1cb('0x5b')](function(_0x2088c2){_0x5e4e33[_0xc1cb('0x5c')](_0x2088c2);});}}function onDisconnect(_0x1ade42,_0x43bb73){joinOrLeave(_0x1ade42,_0xc1cb('0x4d'),_0x43bb73);}function onConnect(_0x166f98){joinOrLeave(_0x166f98,_0xc1cb('0x5d'));}exports[_0xc1cb('0x5e')]=function(_0x15e7ca){_0x15e7ca['on'](_0xc1cb('0x5f'),function(_0x5b145f){_0x5b145f[_0xc1cb('0x60')](0x0);_0x5b145f[_0xc1cb('0x61')]=_0x5b145f[_0xc1cb('0x62')][_0xc1cb('0x5f')]['remoteAddress']+':'+_0x5b145f[_0xc1cb('0x62')][_0xc1cb('0x5f')][_0xc1cb('0x63')];_0x5b145f[_0xc1cb('0x64')]=new Date();_0x5b145f['log']=function(_0x5b3e8f){console[_0xc1cb('0x5c')](_0xc1cb('0x65')+_0x5b145f[_0xc1cb('0x66')][_0xc1cb('0x4')]+'['+_0x5b145f[_0xc1cb('0x61')]+']',_0x5b3e8f);};_0x5b145f['on'](_0xc1cb('0x67'),function(){onDisconnect(_0x5b145f,_0x15e7ca);_0x5b145f['log']('DISCONNECTED');});onConnect(_0x5b145f);_0x5b145f[_0xc1cb('0x5c')](_0xc1cb('0x68'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index e4c5a90..b23032b 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 _0xfa40=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','UserId','User','find','name','email','internal','format','SIP/%s','agent','incomingmessage','outgoingmessage','motionChannel','opened','Sequelize','QueryTypes','SELECT','changed','closed','substatus','ContactId','contact','interface','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','../logger','lodash','client','http','Chat','afterCreate','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','newinteraction'];(function(_0x360beb,_0x5bd3bd){var _0xcb4721=function(_0x3af94d){while(--_0x3af94d){_0x360beb['push'](_0x360beb['shift']());}};_0xcb4721(++_0x5bd3bd);}(_0xfa40,0x81));var _0x0fa4=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xfa40[_0x152121];return _0x592a85;};'use strict';var util=require('util');var db=require(_0x0fa4('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x0fa4('0x1'))('triggers');var _=require(_0x0fa4('0x2'));var client=jayson[_0x0fa4('0x3')][_0x0fa4('0x4')]({'port':0x232a});var triggers=[{'channel':_0x0fa4('0x5'),'model':'ChatInteraction','event':_0x0fa4('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0fa4('0x5'),'model':_0x0fa4('0x7'),'event':_0x0fa4('0x8'),'condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x5'),'model':_0x0fa4('0xa'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x0fa4('0x6'),'condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0xd'),'model':_0x0fa4('0xe'),'event':_0x0fa4('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0fa4('0xd'),'model':_0x0fa4('0xf'),'event':_0x0fa4('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0fa4('0x10'),'model':_0x0fa4('0x11'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0x10'),'model':_0x0fa4('0x11'),'event':_0x0fa4('0x8'),'condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x10'),'model':_0x0fa4('0x12'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x0fa4('0x6'),'condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0x13'),'model':_0x0fa4('0x14'),'event':_0x0fa4('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x0fa4('0x15'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x0fa4('0x16'),'event':'afterCreate','condition':_0x0fa4('0xc'),'callback':afterCreate},{'channel':_0x0fa4('0x17'),'model':_0x0fa4('0x16'),'event':_0x0fa4('0x8'),'condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x17'),'model':_0x0fa4('0x18'),'event':_0x0fa4('0x6'),'condition':_0x0fa4('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x0fa4('0x19'),'event':_0x0fa4('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0fa4('0x1a'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x0fa4('0x9'),'callback':afterUpdate},{'channel':_0x0fa4('0x1a'),'model':_0x0fa4('0x1b'),'event':_0x0fa4('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x8afc3c){return client['request'](_0x0fa4('0x1c'),_0x8afc3c)[_0x0fa4('0x1d')](function(_0x5cb34b){logger[_0x0fa4('0x1e')](_0x0fa4('0x1f'),'EventManager',_0x5cb34b);if(_0x5cb34b[_0x0fa4('0x20')]){if(_0x5cb34b[_0x0fa4('0x20')][_0x0fa4('0x21')]===0x1f4){logger[_0x0fa4('0x20')](_0x0fa4('0x1f'),_0x0fa4('0x1c'),_0x5cb34b[_0x0fa4('0x20')]);}}})[_0x0fa4('0x22')](function(_0x4ca932){logger[_0x0fa4('0x20')](_0x0fa4('0x1f'),_0x0fa4('0x1c'),_0x4ca932);});}function afterCreateMessage(_0xf54e19,_0x1e49eb){return function(_0x2f14f5,_0x2da82c){_0x2f14f5=_0x2f14f5[_0x0fa4('0x23')]({'plain':!![]});_0x2f14f5[_0x0fa4('0x24')]=_0xf54e19;_0x2f14f5['motionChannel']=_0xf54e19;_0x2f14f5[_0x0fa4('0x25')]=_0x2f14f5[_0x0fa4('0x26')];var _0x3ab480=_0x0fa4('0x27')+_0x2f14f5['ContactId'];return db[_0x0fa4('0x28')][_0x0fa4('0x29')](_0x3ab480,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0fa4('0x1d')](function(_0x204925){return _0x204925;})[_0x0fa4('0x1d')](function(_0x4461cc){if(_0x4461cc){_0x2f14f5['contact']=_0x4461cc[0x0];}if(_0x2f14f5[_0x0fa4('0x2a')]){return db[_0x0fa4('0x2b')][_0x0fa4('0x2c')]({'where':{'id':_0x2f14f5[_0x0fa4('0x2a')]},'attributes':['id',_0x0fa4('0x2d'),'fullname',_0x0fa4('0x2e'),_0x0fa4('0x2f')],'raw':!![]})[_0x0fa4('0x1d')](function(_0x61b47f){_0x2f14f5['interface']=util[_0x0fa4('0x30')](_0x0fa4('0x31'),_0x61b47f['name']);_0x2f14f5[_0x0fa4('0x24')]=_0xf54e19;_0x2f14f5[_0x0fa4('0x32')]=_0x61b47f;return request({'event':_0x0fa4('0x33'),'message':_0x2f14f5});})['catch'](function(_0xe6af4b){console['error'](_0xe6af4b);});}else{return request({'event':_0x0fa4('0x34'),'message':_0x2f14f5});}});};}function afterCreate(_0x1c0c8d,_0x562ad1){return function(_0x390702,_0x5ef0f4){_0x390702=_0x390702['get']({'plain':!![]});_0x390702[_0x0fa4('0x24')]=_0x1c0c8d;_0x390702[_0x0fa4('0x35')]=_0x1c0c8d;_0x390702['event']=_0x0fa4('0x36');var _0x5a604f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x390702['ContactId'];return db['sequelize'][_0x0fa4('0x29')](_0x5a604f,{'type':db[_0x0fa4('0x37')][_0x0fa4('0x38')][_0x0fa4('0x39')],'raw':!![]})[_0x0fa4('0x1d')](function(_0x1b3a2a){return _0x1b3a2a;})['then'](function(_0x31a7bf){if(_0x31a7bf){_0x390702['contact']=_0x31a7bf[0x0];}return request({'event':_0x562ad1,'message':_0x390702});});};}function afterUpdate(_0x574795){return function(_0x1ab504){var _0x42a738=_0x1ab504[_0x0fa4('0x3a')](_0x0fa4('0x3b'))&&_0x1ab504[_0x0fa4('0x3b')];var _0x135251=_0x1ab504['changed'](_0x0fa4('0x3c'));if(_0x42a738||_0x135251){var _0xd99135=_0x42a738?_0x0fa4('0x9'):_0x0fa4('0x3c');var _0x4d10e1=_0x1ab504[_0x0fa4('0x23')]({'plain':!![]});_0x4d10e1[_0x0fa4('0x24')]=_0x574795;_0x4d10e1[_0x0fa4('0x35')]=_0x574795;_0x4d10e1[_0x0fa4('0x25')]=_0x42a738?_0x0fa4('0x3b'):_0x0fa4('0x3c');var _0x3982a2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d10e1[_0x0fa4('0x3d')];return db[_0x0fa4('0x28')][_0x0fa4('0x29')](_0x3982a2,{'type':db[_0x0fa4('0x37')][_0x0fa4('0x38')]['SELECT'],'raw':!![]})['then'](function(_0x183241){if(_0x183241){_0x4d10e1[_0x0fa4('0x3e')]=_0x183241[0x0];}if(_0x4d10e1[_0x0fa4('0x2a')]){return db[_0x0fa4('0x2b')][_0x0fa4('0x2c')]({'where':{'id':_0x4d10e1[_0x0fa4('0x2a')]},'attributes':['id',_0x0fa4('0x2d'),'fullname',_0x0fa4('0x2e'),_0x0fa4('0x2f')],'raw':!![]})[_0x0fa4('0x1d')](function(_0x1a8f6c){_0x4d10e1[_0x0fa4('0x3f')]=util['format'](_0x0fa4('0x31'),_0x1a8f6c[_0x0fa4('0x2d')]);_0x4d10e1[_0x0fa4('0x32')]=_0x1a8f6c;return request({'event':_0xd99135,'message':_0x4d10e1});})[_0x0fa4('0x22')](function(_0x3f238f){console[_0x0fa4('0x20')](_0x3f238f);});}else{return request({'event':_0xd99135,'message':_0x4d10e1});}});}};}exports[_0x0fa4('0x40')]=function(){for(var _0x426dbe=0x0;_0x426dbe=_0x3407e4[_0x4bbf('0x16')]){throw Error(_0x4bbf('0x17'));}_0x254dd8(_0xad97f3);})[_0x4bbf('0x18')](function(_0x365a9c){_0x2204c6(_0x365a9c);});});}; \ No newline at end of file +var _0x31a6=['mail','fax','sms','openchannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb','./license/util','voice'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x31a6,0x122));var _0x631a=function(_0xd69a0f,_0x5e3ae0){_0xd69a0f=_0xd69a0f-0x0;var _0x23ab99=_0x31a6[_0xd69a0f];return _0x23ab99;};'use strict';var _=require('lodash');var BPromise=require(_0x631a('0x0'));var db=require(_0x631a('0x1'))['db'];var util=require(_0x631a('0x2'));var channels=[_0x631a('0x3'),_0x631a('0x4'),'chat',_0x631a('0x5'),_0x631a('0x6'),'whatsapp',_0x631a('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x55fe7b){_0x55fe7b=_0x55fe7b[_0x631a('0x8')]();return _[_0x631a('0x9')](channels,_0x55fe7b);};exports[_0x631a('0xa')]=function(_0x429c12,_0x26c1c6,_0x2f5bad,_0x635692){var _0x33f6d3={'loginAttempts':_0x26c1c6,'blocked':_0x2f5bad};if(!_['isUndefined'](_0x635692)){_0x33f6d3[_0x631a('0xb')]=_0x635692;}return _0x429c12[_0x631a('0xc')](_0x33f6d3);};exports[_0x631a('0xd')]=function(_0x223cd9){return new BPromise(function(_0x2f8a28,_0x1b7e5e){var _0x20c312=0x0;if(_0x223cd9[_0x631a('0xe')]!==_0x631a('0xf')){_0x2f8a28(_0x223cd9);}db[_0x631a('0x10')][_0x631a('0x11')]({'where':{'role':_0x631a('0xf'),'online':!![],'id':{'$ne':_0x223cd9['id']}}})[_0x631a('0x12')](function(_0x27150a){_0x20c312=_0x27150a;return util['getLicense']();})['then'](function(_0x32a495){if(_0x32a495&&_0x32a495[_0x631a('0x13')]&&_0x20c312>=_0x32a495[_0x631a('0x13')]){throw Error(_0x631a('0x14'));}_0x2f8a28(_0x223cd9);})['catch'](function(_0xb98e34){_0x1b7e5e(_0xb98e34);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 419f456..9572f92 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf33=['exports','status','render','json'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xaf33,0x12c));var _0x3af3=function(_0x185fae,_0x32ba5a){_0x185fae=_0x185fae-0x0;var _0x1e0c34=_0xaf33[_0x185fae];return _0x1e0c34;};'use strict';module[_0x3af3('0x0')][0x194]=function pageNotFound(_0x31ed94,_0x31d117){var _0x15220c='404';var _0xf4097c=0x194;var _0x1d8c1b={'status':_0xf4097c};_0x31d117[_0x3af3('0x1')](_0x1d8c1b[_0x3af3('0x1')]);_0x31d117[_0x3af3('0x2')](_0x15220c,{},function(_0x285f25,_0xdb6f00){if(_0x285f25){return _0x31d117[_0x3af3('0x1')](_0x1d8c1b[_0x3af3('0x1')])[_0x3af3('0x3')](_0x1d8c1b);}_0x31d117['send'](_0xdb6f00);});}; \ No newline at end of file +var _0x91c5=['404','render','status','send'];(function(_0x192f4a,_0x5779e3){var _0x29cb25=function(_0x205574){while(--_0x205574){_0x192f4a['push'](_0x192f4a['shift']());}};_0x29cb25(++_0x5779e3);}(_0x91c5,0x124));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';module['exports'][0x194]=function pageNotFound(_0xbcc792,_0x57a35b){var _0x54023a=_0x591c('0x0');var _0x52719f=0x194;var _0x4d92b8={'status':_0x52719f};_0x57a35b['status'](_0x4d92b8['status']);_0x57a35b[_0x591c('0x1')](_0x54023a,{},function(_0x16f04b,_0x4d68df){if(_0x16f04b){return _0x57a35b[_0x591c('0x2')](_0x4d92b8[_0x591c('0x2')])['json'](_0x4d92b8);}_0x57a35b[_0x591c('0x3')](_0x4d68df);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 1e787b7..d9b25ab 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa75b=['../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','Contacts','Lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','mandatoryDispositionPauseId','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Agents','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','JscriptySessionReport','Company','cm_user_has_contacts','cm_contact_has_tags','Condition','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','CustomReportId','Fields','DefaultReportId','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','SugarcrmAccount','Configurations','DescriptionId','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','SquareProject','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','sequelizeHistory','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition'];(function(_0x4f027d,_0x3f9587){var _0xc46890=function(_0x27d06c){while(--_0x27d06c){_0x4f027d['push'](_0x4f027d['shift']());}};_0xc46890(++_0x3f9587);}(_0xa75b,0x170));var _0xba75=function(_0x54d4e5,_0x3bde35){_0x54d4e5=_0x54d4e5-0x0;var _0x17ac55=_0xa75b[_0x54d4e5];return _0x17ac55;};'use strict';var config=require(_0xba75('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xba75('0x1'));var timezone=jstz[_0xba75('0x2')]();config[_0xba75('0x3')]=_[_0xba75('0x4')](config[_0xba75('0x3')],{'database':_0xba75('0x5'),'username':_0xba75('0x6'),'password':_0xba75('0x7'),'options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xba75('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xba75('0x6'),'password':'xC@LL1234','options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':_0xba75('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x3')][_0xba75('0xe')],config[_0xba75('0x3')][_0xba75('0xf')],config[_0xba75('0x3')][_0xba75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x11')]['database'],config[_0xba75('0x11')][_0xba75('0xf')],config[_0xba75('0x11')][_0xba75('0x10')],config['sequelizeHistory'][_0xba75('0x12')])};db[_0xba75('0x13')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x15'));db['VoiceChanSpy']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x16'));db['VoiceContext']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x17'));db[_0xba75('0x18')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xba75('0x19')]=db[_0xba75('0x3')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xba75('0x1a')]=db[_0xba75('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xba75('0x1b')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1c'));db[_0xba75('0x1d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1e'));db[_0xba75('0x1f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x20'));db['VoiceMailMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x21'));db[_0xba75('0x22')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x23'));db[_0xba75('0x24')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0xba75('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xba75('0x25')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x26'));db[_0xba75('0x27')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x28'));db[_0xba75('0x29')]=db[_0xba75('0x3')]['import']('../api/trunk/trunk.model');db[_0xba75('0x2a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2b'));db[_0xba75('0x2c')]=db[_0xba75('0x3')]['import'](_0xba75('0x2d'));db[_0xba75('0x2e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2f'));db[_0xba75('0x30')]=db[_0xba75('0x3')]['import'](_0xba75('0x31'));db[_0xba75('0x32')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x33'));db[_0xba75('0x34')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x35'));db[_0xba75('0x36')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x37'));db[_0xba75('0x38')]=db['sequelize']['import'](_0xba75('0x39'));db[_0xba75('0x3a')]=db[_0xba75('0x3')]['import'](_0xba75('0x3b'));db[_0xba75('0x3c')]=db['sequelize']['import'](_0xba75('0x3d'));db[_0xba75('0x3e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x3f'));db['MailAccount']=db['sequelize'][_0xba75('0x14')](_0xba75('0x40'));db[_0xba75('0x41')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x42'));db[_0xba75('0x43')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x44'));db['MailInteraction']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x45'));db[_0xba75('0x46')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x47'));db['MailApplication']=db[_0xba75('0x3')]['import'](_0xba75('0x48'));db['MailQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x49'));db[_0xba75('0x4a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x4b'));db[_0xba75('0x4c')]=db[_0xba75('0x3')]['import'](_0xba75('0x4d'));db[_0xba75('0x4e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x4f'));db[_0xba75('0x50')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xba75('0x3')]['import'](_0xba75('0x51'));db[_0xba75('0x52')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x53'));db['FaxQueue']=db['sequelize'][_0xba75('0x14')]('../api/faxQueue/faxQueue.model');db[_0xba75('0x54')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x55'));db[_0xba75('0x56')]=db[_0xba75('0x3')]['import'](_0xba75('0x57'));db[_0xba75('0x58')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x59'));db[_0xba75('0x5a')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xba75('0x5b')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x5c'));db[_0xba75('0x5d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x5e'));db[_0xba75('0x5f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x60'));db[_0xba75('0x61')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x62'));db[_0xba75('0x63')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x64'));db['OpenchannelMessage']=db['sequelize'][_0xba75('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xba75('0x3')]['import'](_0xba75('0x65'));db[_0xba75('0x66')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x67'));db['OpenchannelQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xba75('0x68')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x69'));db[_0xba75('0x6a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x6b'));db['ChatMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6c'));db[_0xba75('0x6d')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xba75('0x6e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6f'));db[_0xba75('0x70')]=db[_0xba75('0x3')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xba75('0x14')](_0xba75('0x71'));db[_0xba75('0x72')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x73'));db[_0xba75('0x74')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x75'));db[_0xba75('0x76')]=db[_0xba75('0x3')]['import'](_0xba75('0x77'));db[_0xba75('0x78')]=db['sequelize'][_0xba75('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xba75('0x79')]=db[_0xba75('0x3')]['import'](_0xba75('0x7a'));db[_0xba75('0x7b')]=db['sequelize']['import'](_0xba75('0x7c'));db['ReportAgentPreview']=db[_0xba75('0x3')]['import'](_0xba75('0x7d'));db[_0xba75('0x7e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x7f'));db['Action']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/action/action.model');db[_0xba75('0x80')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x81'));db[_0xba75('0x82')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x83'));db[_0xba75('0x84')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x85'));db['Condition']=db['sequelize'][_0xba75('0x14')](_0xba75('0x86'));db[_0xba75('0x87')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x88'));db[_0xba75('0x89')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8a'));db[_0xba75('0x8b')]=db['sequelize'][_0xba75('0x14')]('../api/cdr/cdr.model');db[_0xba75('0x8c')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8d'));db[_0xba75('0x8e')]=db[_0xba75('0x3')]['import'](_0xba75('0x8f'));db['Sound']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/sound/sound.model');db['Tag']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x90'));db[_0xba75('0x91')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/template/template.model');db[_0xba75('0x92')]=db[_0xba75('0x3')]['import'](_0xba75('0x93'));db[_0xba75('0x94')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x95'));db['Integration']=db[_0xba75('0x3')]['import'](_0xba75('0x96'));db[_0xba75('0x97')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x98'));db[_0xba75('0x99')]=db['sequelize']['import'](_0xba75('0x9a'));db['AnalyticDefaultReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xba75('0x9b')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0xba75('0x9c')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x9d'));db[_0xba75('0x9e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x9f'));db[_0xba75('0xa0')]=db['sequelize']['import'](_0xba75('0xa1'));db[_0xba75('0xa2')]=db['sequelize'][_0xba75('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xba75('0xa3')]=db[_0xba75('0x3')]['import'](_0xba75('0xa4'));db['SugarcrmAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xba75('0xa5')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa6'));db[_0xba75('0xa7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa8'));db['DeskAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xba75('0xa9')]=db['sequelize'][_0xba75('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xba75('0x3')]['import'](_0xba75('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xba75('0xab')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xac'));db[_0xba75('0xad')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xae'));db['ZendeskConfiguration']=db[_0xba75('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xba75('0xaf')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xb0'));db[_0xba75('0xb1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb2'));db[_0xba75('0xb3')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb4'));db[_0xba75('0xb5')]=db['sequelize']['import'](_0xba75('0xb6'));db['VtigerAccount']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb7'));db[_0xba75('0xb8')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xba75('0x3')]['import'](_0xba75('0xb9'));db[_0xba75('0xba')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbb'));db['ServicenowConfiguration']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbc'));db[_0xba75('0xbd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbe'));db[_0xba75('0xbf')]=db[_0xba75('0x3')]['import'](_0xba75('0xc0'));db[_0xba75('0xc1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc2'));db[_0xba75('0xc3')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xba75('0xc4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc5'));db[_0xba75('0xc6')]=db[_0xba75('0x3')]['import'](_0xba75('0xc7'));db['FreshsalesField']=db[_0xba75('0x3')]['import'](_0xba75('0xc8'));db[_0xba75('0xc9')]=db[_0xba75('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xca'));db[_0xba75('0xcb')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xcc'));db[_0xba75('0xcd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xce'));db[_0xba75('0xcf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd0'));db['JscriptyQuestionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd1'));db['JscriptySessionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd2'));db[_0xba75('0xd3')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd4'));db['SquareReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd5'));db[_0xba75('0xd6')]=db[_0xba75('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xba75('0xd7')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd8'));db[_0xba75('0xd9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xda'));db[_0xba75('0xdb')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xba75('0x14')]('../api/squareProject/squareProject.model');db[_0xba75('0xdc')]=db['sequelize'][_0xba75('0x14')]('../api/squareRecording/squareRecording.model');db[_0xba75('0xdd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xde'));db[_0xba75('0xdf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe0'));db['License']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe1'));db[_0xba75('0xe2')]=db[_0xba75('0x3')]['import'](_0xba75('0xe3'));db[_0xba75('0xe4')]=db[_0xba75('0x3')]['import'](_0xba75('0xe5'));db['Attachment']=db['sequelize'][_0xba75('0x14')](_0xba75('0xe6'));db[_0xba75('0xe7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe8'));db[_0xba75('0xe9')]=db['sequelize'][_0xba75('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xba75('0xea')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xeb'));db[_0xba75('0xec')]=db[_0xba75('0x3')]['import'](_0xba75('0xed'));db[_0xba75('0xee')]=db[_0xba75('0x3')]['import'](_0xba75('0xef'));db[_0xba75('0xf0')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf1'));db[_0xba75('0xf2')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf3'));db[_0xba75('0xf4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf5'));db['UserProfile']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/userProfile/userProfile.model');db[_0xba75('0xf6')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xf7'));db['UserProfileResource']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf8'));db[_0xba75('0xf9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfa'));db['WhatsappAccount']=db['sequelize']['import'](_0xba75('0xfb'));db[_0xba75('0xfc')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfd'));db[_0xba75('0xfe')]=db[_0xba75('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xba75('0xff')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x100'));db[_0xba75('0x101')]=db['sequelize'][_0xba75('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xba75('0x102')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x103'));db[_0xba75('0x104')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x105'));db[_0xba75('0x106')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x107'));db[_0xba75('0x108')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x109'));db[_0xba75('0x10a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10b'));db['UserVoicePrefix']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10c'));db[_0xba75('0x13')][_0xba75('0x10d')](db[_0xba75('0x1f')],{'as':'VoiceMail','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x2c')],{'as':_0xba75('0x111'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x112'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x13')][_0xba75('0x110')](db['CmHopperFinal'],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x114'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['OpenchannelInteraction'],{'as':_0xba75('0x116'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xba75('0x13')]['hasMany'](db[_0xba75('0xf9')],{'as':_0xba75('0x11b'),'foreignKey':_0xba75('0x11c')});db[_0xba75('0x13')]['belongsTo'](db[_0xba75('0x11d')],{'as':_0xba75('0x11d'),'foreignKey':'userProfileId'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x70')],{'as':_0xba75('0x11f'),'through':'chat_group_has_users'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':_0xba75('0x121'),'through':'cm_user_has_lists'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x122')});db['User']['belongsToMany'](db[_0xba75('0x123')],{'as':'MailInteractions','through':_0xba75('0x124')});db['User'][_0xba75('0x11e')](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'through':_0xba75('0x126')});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'through':_0xba75('0x127')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'through':_0xba75('0x128')});db['User'][_0xba75('0x11e')](db[_0xba75('0x63')],{'as':_0xba75('0x116'),'through':'user_has_openchannel_interactions'});db[_0xba75('0x13')][_0xba75('0x11e')](db['WhatsappInteraction'],{'as':_0xba75('0x129'),'through':_0xba75('0x12a')});db['User']['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db['VoicePrefix'],{'as':_0xba75('0x12c'),'through':_0xba75('0x12d'),'required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x41')],{'as':_0xba75('0x12e'),'through':_0xba75('0x32'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x6e')],{'as':_0xba75('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xba75('0x11e')](db['FaxQueue'],{'as':_0xba75('0x130'),'through':'UserFaxQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'as':_0xba75('0x131'),'through':_0xba75('0x36'),'required':![]});db['User'][_0xba75('0x11e')](db[_0xba75('0x132')],{'as':_0xba75('0x133'),'through':_0xba75('0x38'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x104')],{'as':_0xba75('0x134'),'through':_0xba75('0x3a'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xba75('0x11e')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xba75('0x135')});db[_0xba75('0x13')][_0xba75('0x11e')](db['FaxAccount'],{'as':_0xba75('0x136'),'through':'user_has_fax_accounts'});db[_0xba75('0x13')][_0xba75('0x11e')](db['MailAccount'],{'as':'MailAccounts','through':_0xba75('0x137')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5f')],{'as':_0xba75('0x138'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x56')],{'as':'SmsAccounts','through':_0xba75('0x139')});db['User'][_0xba75('0x11e')](db[_0xba75('0x13a')],{'as':_0xba75('0x13b'),'through':_0xba75('0x13c')});db[_0xba75('0x13')][_0xba75('0x11e')](db['SquareProject'],{'as':'SquareProjects','through':_0xba75('0x13d')});db[_0xba75('0x13e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x13f'),'onDelete':'cascade','foreignKey':_0xba75('0x140')});db[_0xba75('0x141')][_0xba75('0x110')](db[_0xba75('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x142'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x19')][_0xba75('0x11e')](db[_0xba75('0x143')],{'as':_0xba75('0x144'),'through':_0xba75('0x145')});db['VoiceQueue'][_0xba75('0x110')](db['UserVoiceQueueRt'],{'as':_0xba75('0x146'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['CmHopper'],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')]['hasMany'](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x147')});db['VoiceQueue'][_0xba75('0x110')](db['JscriptySessionReport'],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x14b')](db[_0xba75('0x29')],{'as':'Trunk','foreignKey':_0xba75('0x14c')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x14d'),'foreignKey':_0xba75('0x14e')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Interval'],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db['VoiceQueue'][_0xba75('0x14b')](db['Pause'],{'as':_0xba75('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'Lists','through':_0xba75('0x151')});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'as':'Teams','through':_0xba75('0x108')});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x152')});db['VoiceRecording'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1d')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1f')]['hasMany'](db[_0xba75('0x153')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x155'),'sourceKey':_0xba75('0x156')});db['VoiceMailMessage'][_0xba75('0x14b')](db[_0xba75('0x1f')],{'foreignKey':_0xba75('0x155'),'targetKey':_0xba75('0x156')});db[_0xba75('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xba75('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0xba75('0x22')][_0xba75('0x110')](db[_0xba75('0x158')],{'as':_0xba75('0x159'),'foreignKey':_0xba75('0x15a'),'constraints':![]});db[_0xba75('0x22')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':'UserId'});db[_0xba75('0x22')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x3c')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x15d'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x3e')]['belongsTo'](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasOne'](db[_0xba75('0x3c')],{'as':_0xba75('0x15f'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x10d')](db['MailServerOut'],{'as':_0xba75('0x160'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x15e'),'onDelete':_0xba75('0x10e')});db['MailAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'foreignKey':'MailAccountId'});db[_0xba75('0x15d')][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x164')],{'as':'Applications'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db['MailAccount'][_0xba75('0x14b')](db[_0xba75('0x91')],{'as':_0xba75('0x91'),'foreignKey':'TemplateId'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db[_0xba75('0x15d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x137')});db['MailQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x32')});db[_0xba75('0x41')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_mail_queues','as':_0xba75('0x167')});db[_0xba75('0x123')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'onDelete':'cascade','foreignKey':_0xba75('0x168')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x123')]['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16d')});db['MailInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16e')});db[_0xba75('0x123')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':_0xba75('0x171'),'onDelete':'cascade'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db[_0xba75('0x46')]['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x46')]['belongsTo'](db['MailInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'ChatWebsite','foreignKey':_0xba75('0x173')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db['MailApplication'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')][_0xba75('0x14b')](db['MailQueue'],{'onDelete':_0xba75('0x175')});db['MailApplication']['belongsTo'](db[_0xba75('0x15d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')]['belongsTo'](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x164')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db['MailQueueReport'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xba75('0x13')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x41')],{});db[_0xba75('0x4a')][_0xba75('0x110')](db[_0xba75('0x4c')],{'as':_0xba75('0x179'),'onDelete':'cascade'});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xba75('0x10e')});db['FaxAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x17a')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x163')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x50')],{'as':_0xba75('0x142')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x17b'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x52')],{'as':_0xba75('0x154')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x29')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x4e')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x4e')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x17d')});db[_0xba75('0x50')][_0xba75('0x14b')](db['User'],{'onDelete':'restrict'});db[_0xba75('0x50')][_0xba75('0x14b')](db[_0xba75('0x17e')],{'onDelete':_0xba75('0x175')});db['FaxApplication'][_0xba75('0x14b')](db[_0xba75('0x4e')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x50')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':_0xba75('0x169'),'foreignKey':'FaxAccountId'});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x118')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16d')});db['FaxInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16e')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x127'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x52')][_0xba75('0x14b')](db['FaxInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x17f')});db['FaxMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':'AttachmentId'});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':'Account','foreignKey':_0xba75('0x17a')});db['FaxQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x34')});db['FaxQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxAccount'],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0x52')],{});db['FaxQueueReport'][_0xba75('0x14b')](db['User'],{});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxQueue'],{});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x181'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')]['hasMany'](db['SmsInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x56')]['hasMany'](db[_0xba75('0x58')],{'as':_0xba75('0x142')});db['SmsAccount'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x56')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db['SmsAccount']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x139')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x5d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x56')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x87')],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0x58')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db[_0xba75('0x5a')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5a')][_0xba75('0x14b')](db['SmsAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x5a')]['belongsTo'](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['SmsInteraction'][_0xba75('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x183'),'as':'ThroughTags'});db[_0xba75('0x5a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x128'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':'User'});db['SmsMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x5a')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':'SmsInteractionId'});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x56')],{'as':_0xba75('0x169'),'foreignKey':'SmsAccountId'});db[_0xba75('0x5d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x36'),'foreignKey':_0xba75('0x184')});db['SmsQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0xba75('0x10e')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x185')});db['OpenchannelAccount'][_0xba75('0x110')](db[_0xba75('0x63')],{'as':_0xba75('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xba75('0x5f')][_0xba75('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x61')],{'as':_0xba75('0x142'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x5f')]['belongsTo'](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x5f')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x61')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x61')][_0xba75('0x14b')](db['OpenchannelQueue'],{'onDelete':_0xba75('0x175'),'foreignKey':'OpenchannelQueueId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x5f')],{'onDelete':'restrict','foreignKey':_0xba75('0x185')});db['OpenchannelApplication'][_0xba75('0x14b')](db[_0xba75('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x63')][_0xba75('0x110')](db[_0xba75('0x186')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x187')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x63')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':_0xba75('0x16e')});db[_0xba75('0x63')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x189'),'foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':'cascade','as':'User'});db[_0xba75('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x63')],{'onDelete':_0xba75('0x10e'),'as':'Interaction','foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db['Attachment'],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':'Account','foreignKey':_0xba75('0x185')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x38'),'foreignKey':_0xba75('0x18b')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x18c'),'as':_0xba75('0x167')});db['ChatWebsite'][_0xba75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xba75('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xba75('0x110')](db['CannedAnswer'],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x18d')],{'as':'ProactiveActions'});db[_0xba75('0x66')][_0xba75('0x110')](db['ChatInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x142')});db[_0xba75('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xba75('0x154')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':'Interval','foreignKey':_0xba75('0x14f')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x66')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x135')});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x5f')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x18e')][_0xba75('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x63')],{});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x186')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x132')],{});db[_0xba75('0x68')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x18f'),'foreignKey':_0xba75('0x10f'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xba75('0x6e')],{'as':_0xba75('0x190'),'foreignKey':_0xba75('0x191'),'onDelete':'restrict'});db['ChatApplication'][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173'),'onDelete':'restrict'});db[_0xba75('0x68')]['belongsTo'](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['ChatInteraction'][_0xba75('0x110')](db[_0xba75('0x192')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x193')});db[_0xba75('0x6a')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6a')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db['ChatInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xba75('0x6a')][_0xba75('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xba75('0x16e')});db[_0xba75('0x6a')]['belongsToMany'](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x126'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x192')][_0xba75('0x14b')](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db[_0xba75('0x192')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x172'),'foreignKey':_0xba75('0x193')});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db[_0xba75('0x192')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6d')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':'Attachments','foreignKey':_0xba75('0x174'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x6d')][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6d')][_0xba75('0x14b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xba75('0x173')});db[_0xba75('0x6e')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x30'),'hooks':!![]});db['ChatQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xba75('0x70')][_0xba75('0x110')](db[_0xba75('0xcd')],{'as':'Messages','foreignKey':_0xba75('0x194'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x70')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x146'),'through':_0xba75('0x195')});db[_0xba75('0x18d')]['belongsTo'](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173')});db['CmCompany'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xba75('0x74')][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x197')],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'ContactId','onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':'FaxInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db['CmContact'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x14b')](db[_0xba75('0x72')],{'as':_0xba75('0x198'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x199')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'as':'Tags','through':_0xba75('0x19a')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x19a'),'as':_0xba75('0x16e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xba75('0x10f')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0xe2')],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':'OwnerId'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db['CmHopperBlack'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':'cascade'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db[_0xba75('0x78')]['belongsTo'](db['Campaign'],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db['Automation'][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19c'),'singular':_0xba75('0x19d')},'foreignKey':_0xba75('0x19e'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19f'),'singular':_0xba75('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x1a1')],{'as':_0xba75('0x1a2'),'foreignKey':_0xba75('0x1a3'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x84')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xba75('0x110')](db[_0xba75('0x87')],{'as':'Intervals','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x10e'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xba75('0x18')],{'as':'Extensions','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x175')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x164')],{'as':_0xba75('0x1a4'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x1a5'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db['FaxApplication'],{'as':_0xba75('0x1a6'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x58')],{'as':'SmsApplications','foreignKey':_0xba75('0x14f')});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0xba75('0x8e')]['belongsTo'](db[_0xba75('0x99')],{'foreignKey':'CustomReportId'});db[_0xba75('0x143')]['belongsToMany'](db[_0xba75('0x19')],{'as':_0xba75('0x1a8'),'through':_0xba75('0x145'),'onDelete':_0xba75('0x175')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x74')],{'through':_0xba75('0x19a')});db[_0xba75('0x16b')]['belongsToMany'](db['ChatInteraction'],{'through':_0xba75('0x1a9')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x123')],{'through':_0xba75('0x16c')});db['Tag'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'through':_0xba75('0x183')});db['Tag']['belongsToMany'](db[_0xba75('0x118')],{'through':_0xba75('0x180')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x63')],{'through':'openchannel_interaction_has_tags'});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0xfe')],{'through':_0xba75('0x1aa')});db['Trigger']['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ab'),'singular':_0xba75('0x1ac')},'foreignKey':_0xba75('0x1ad'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x92')][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xba75('0x1af'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x99')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xba75('0x1b0'),'hooks':!![]});db[_0xba75('0x1a7')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b2')});db[_0xba75('0x1b3')][_0xba75('0x110')](db['AnalyticFieldReport'],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b4')});db[_0xba75('0x9c')]['belongsTo'](db[_0xba75('0x1b3')],{'foreignKey':_0xba75('0x1b4')});db[_0xba75('0xa0')][_0xba75('0x110')](db[_0xba75('0xa2')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa2')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xba75('0xa3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa2')]['belongsTo'](db[_0xba75('0xa0')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['SalesforceField'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa3')][_0xba75('0x110')](db['SalesforceField'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xa3')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa3')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':'VariableId'});db[_0xba75('0x1bd')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa5')]['hasMany'](db[_0xba75('0xa7')],{'as':_0xba75('0x1b6'),'onDelete':'cascade','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa5')][_0xba75('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa5')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xba75('0x14b')](db[_0xba75('0x1bd')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['SugarcrmField'][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa7')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa7')][_0xba75('0x14b')](db['Variable'],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c1')]['hasMany'](db[_0xba75('0x1c2')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1c2')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['DeskConfiguration'][_0xba75('0x14b')](db['DeskAccount'],{'as':_0xba75('0x169'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c3')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xba75('0x1c4')]['hasMany'](db[_0xba75('0x1c5')],{'as':_0xba75('0x1be'),'onDelete':'cascade','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c5')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db['ZohoConfiguration'][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c5')]['belongsTo'](db[_0xba75('0x1c4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xab')]['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZohoField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xad')][_0xba75('0x110')](db[_0xba75('0x1c6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1b6'),'foreignKey':'SubjectId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c6')][_0xba75('0x14b')](db[_0xba75('0xad')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c6')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c7')});db[_0xba75('0xaf')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['ZendeskField'][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xaf')]['hasMany'](db[_0xba75('0xaf')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZendeskField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0xb1')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')]['hasMany'](db[_0xba75('0xb5')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb3')][_0xba75('0x110')](db['FreshdeskField'],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb3')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xba75('0xb3')][_0xba75('0x14b')](db['FreshdeskAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xba75('0xb5')]['hasMany'](db[_0xba75('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb5')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0xb5')]['belongsTo'](db['Variable'],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c8')][_0xba75('0x110')](db[_0xba75('0xb8')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb8')][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb8')]['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db['VtigerConfiguration'][_0xba75('0x14b')](db['VtigerAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['VtigerField']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['VtigerField'][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0x1c9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ServicenowAccount'][_0xba75('0x110')](db[_0xba75('0x1ca')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':_0xba75('0x1b6'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1ca')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1ca')][_0xba75('0x14b')](db[_0xba75('0xba')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xbd')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xbd')][_0xba75('0x110')](db['ServicenowField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['ServicenowField'][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xbd')]['belongsTo'](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db['Dynamics365Account'][_0xba75('0x110')](db[_0xba75('0xc1')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0xc1')][_0xba75('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['Dynamics365Configuration'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc1')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['Dynamics365Configuration'][_0xba75('0x14b')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xba75('0x1b5')});db['Dynamics365Field'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db[_0xba75('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xc3')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xc4')][_0xba75('0x110')](db[_0xba75('0xc6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesConfiguration'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Descriptions','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xc6')][_0xba75('0x14b')](db[_0xba75('0xc4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subject','foreignKey':_0xba75('0x1b7')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1cb')][_0xba75('0x110')](db['FreshsalesField'],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1cb')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ChatQueueReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0x6a')],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xcb')]['belongsTo'](db['User'],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x6e')],{});db['ChatInternalMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cc')});db[_0xba75('0xcd')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cd')});db[_0xba75('0x197')][_0xba75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xba75('0x197')][_0xba75('0x110')](db[_0xba75('0xcf')],{'foreignKey':_0xba75('0x1ce'),'onDelete':'cascade'});db[_0xba75('0xd3')]['belongsTo'](db[_0xba75('0x56')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xba75('0x5d')],{});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptySessionReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db[_0xba75('0x1d0')],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0x1d1')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x13d')});db['Team'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x122')});db[_0xba75('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':_0xba75('0x108'),'as':_0xba75('0x12b')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x41')],{'through':_0xba75('0x1d2'),'as':'MailQueues'});db[_0xba75('0xdf')][_0xba75('0x11e')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xba75('0x12f')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x17e')],{'through':'team_has_fax_queues','as':_0xba75('0x130')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'through':_0xba75('0x1d3'),'as':_0xba75('0x131')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x132')],{'through':_0xba75('0x18c'),'as':_0xba75('0x133')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x104')],{'through':_0xba75('0x1d4'),'as':_0xba75('0x134')});db['Team']['belongsToMany'](db[_0xba75('0xf4')],{'through':_0xba75('0x10a'),'as':_0xba75('0x12c')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xba75('0xe2')]['hasMany'](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x1d5')});db['Campaign']['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x29'),'foreignKey':_0xba75('0x14c')});db[_0xba75('0xe2')]['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x14d'),'foreignKey':'TrunkBackupId'});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x1d1')],{'as':_0xba75('0x1d1'),'foreignKey':_0xba75('0x1d6')});db[_0xba75('0xe2')]['belongsToMany'](db[_0xba75('0xf2')],{'as':_0xba75('0x121'),'through':_0xba75('0x1d7')});db[_0xba75('0xe2')][_0xba75('0x11e')](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x1d8')});db[_0xba75('0x170')]['belongsTo'](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db['MailTransferReport'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':_0xba75('0x1d9'),'as':'FromAccount'});db[_0xba75('0xe9')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x41')],{'foreignKey':'ToMailQueueId','as':_0xba75('0x1de')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':'ToMailAccountId','as':_0xba75('0x1df')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xea')]['belongsTo'](db[_0xba75('0x6a')],{});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e0'),'as':'FromAccount'});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':'FromAgent'});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x6e')],{'foreignKey':'ToChatQueueId','as':_0xba75('0x1de')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x52')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'foreignKey':_0xba75('0x1e2'),'as':_0xba75('0x1e3')});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':_0xba75('0x1db')});db[_0xba75('0xec')][_0xba75('0x14b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x17e')],{'foreignKey':_0xba75('0x1e4'),'as':_0xba75('0x1de')});db[_0xba75('0xec')][_0xba75('0x14b')](db['FaxAccount'],{'foreignKey':_0xba75('0x1e5'),'as':'ToAccount'});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelMessage'],{});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelInteraction'],{});db[_0xba75('0xee')]['belongsTo'](db[_0xba75('0x5f')],{'foreignKey':_0xba75('0x1e6'),'as':_0xba75('0x1e3')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xee')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db[_0xba75('0x132')],{'foreignKey':_0xba75('0x1e7'),'as':_0xba75('0x1de')});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db['SmsTransferReport'][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':_0xba75('0x1e8'),'as':_0xba75('0x1e3')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['SmsQueue'],{'foreignKey':_0xba75('0x1e9'),'as':_0xba75('0x1de')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':'ToSmsAccountId','as':_0xba75('0x1df')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0xf2')][_0xba75('0x110')](db['CmCustomField'],{'as':_0xba75('0x1ea'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':'Contacts','onDelete':_0xba75('0x10e'),'foreignKey':'ListId'});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistory','foreignKey':_0xba75('0x178')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':'ListId'});db[_0xba75('0xf2')]['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x1eb'),'through':_0xba75('0x151')});db[_0xba75('0xf2')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x1ec')});db[_0xba75('0xf4')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':'Extensions','onDelete':_0xba75('0x10e')});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x10a'),'as':'Teams'});db[_0xba75('0x11d')]['hasMany'](db['User'],{'as':_0xba75('0x16f'),'foreignKey':_0xba75('0x1ed')});db[_0xba75('0x11d')][_0xba75('0x110')](db[_0xba75('0xf6')],{'as':_0xba75('0x1ee'),'foreignKey':_0xba75('0x1ed'),'onDelete':_0xba75('0x10e')});db[_0xba75('0xf6')][_0xba75('0x110')](db[_0xba75('0x1ef')],{'as':_0xba75('0x1f0'),'foreignKey':'sectionId','onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':'Dispositions','foreignKey':_0xba75('0x1f1'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')]['hasMany'](db[_0xba75('0x82')],{'as':'Answers','foreignKey':_0xba75('0x1f1')});db['WhatsappAccount'][_0xba75('0x110')](db[_0xba75('0xff')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappApplication'],{'as':'Applications'});db[_0xba75('0x13a')]['belongsTo'](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x13a')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x13a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x13c')});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['WhatsappQueue'],{'onDelete':_0xba75('0x175')});db['WhatsappApplication'][_0xba75('0x14b')](db[_0xba75('0x13a')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['WhatsappInteraction'][_0xba75('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xfe')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':'Account','foreignKey':_0xba75('0x1f1')});db['WhatsappInteraction'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xba75('0x14b')](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'whatsapp_interaction_has_tags','as':_0xba75('0x16d')});db[_0xba75('0xfe')][_0xba75('0x11e')](db['Tag'],{'through':_0xba75('0x1aa'),'as':_0xba75('0x16e')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x12a'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0xfe')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x13a')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x101')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0xfe')],{});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x104')],{});db[_0xba75('0x101')]['belongsTo'](db[_0xba75('0xff')],{});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0xff')],{});db[_0xba75('0x102')]['belongsTo'](db[_0xba75('0xfe')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':_0xba75('0x1f3'),'as':_0xba75('0x1df')});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x104')],{'foreignKey':'ToQueueId','as':_0xba75('0x1de')});db['WhatsappTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['WhatsappQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xba75('0x104')][_0xba75('0x11e')](db['Team'],{'through':_0xba75('0x1d4'),'as':_0xba75('0x167')});module[_0xba75('0x1f4')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x087b=['../api/smsQueueReport/smsQueueReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','belongsToMany','Contacts','cm_user_has_contacts','CmList','cm_user_has_lists','user_has_mail_interactions','FaxInteraction','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','HopperHistories','ReportAgentPreview','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','Interval','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','Imap','Smtp','Answers','Messages','Interactions','List','ListId','TemplateId','team_has_mail_queues','MailInteraction','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','MailInteractionId','Interaction','ChatWebsiteId','restrict','TagId','Dispositions','FaxAccountId','CannedAnswer','FaxInteractionId','fax_interaction_has_tags','Users','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','ChatQueue','Queue','ChatQueueId','Website','user_has_chat_interactions','ChatInteractionId','Attachments','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Company','cm_contact_has_tags','CampaignId','Condition','OneAll','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','CustomReportId','MetricId','Configurations','AccountId','SalesforceField','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','VariableId','Descriptions','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','FreshsalesConfiguration','ChatQueueReport','FromId','SessionId','ProjectId','user_has_teams','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','Lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','UserVoicePrefix','UserProfileSection','UserProfileSections','userProfileId','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','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/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','Disposition','../api/disposition/disposition.model','../api/interval/interval.model','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','SmsQueueReport'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x087b,0x11a));var _0xb087=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x087b[_0x4dc7b9];return _0x3ab114;};'use strict';var config=require(_0xb087('0x0'));var Sequelize=require(_0xb087('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0xb087('0x2')]();config['sequelize']=_[_0xb087('0x3')](config[_0xb087('0x1')],{'database':_0xb087('0x4'),'username':_0xb087('0x5'),'password':_0xb087('0x6'),'options':{'host':_0xb087('0x7'),'port':0xcea,'dialect':_0xb087('0x8'),'dialectOptions':{'charset':_0xb087('0x9')},'logging':![],'timezone':timezone[_0xb087('0xa')](),'define':{'charset':_0xb087('0xb'),'collate':_0xb087('0xc')}}});config[_0xb087('0xd')]=_[_0xb087('0x3')](config[_0xb087('0xd')],{'database':_0xb087('0x4'),'username':_0xb087('0x5'),'password':_0xb087('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xb087('0x8'),'dialectOptions':{'charset':_0xb087('0x9')},'logging':![],'timezone':timezone[_0xb087('0xa')](),'define':{'charset':_0xb087('0xb'),'collate':_0xb087('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb087('0x1')][_0xb087('0xe')],config['sequelize'][_0xb087('0xf')],config[_0xb087('0x1')][_0xb087('0x10')],config['sequelize'][_0xb087('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb087('0xd')][_0xb087('0xe')],config[_0xb087('0xd')][_0xb087('0xf')],config[_0xb087('0xd')][_0xb087('0x10')],config[_0xb087('0xd')][_0xb087('0x11')])};db[_0xb087('0x12')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x14'));db['VoiceChanSpy']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x15'));db['VoiceContext']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x16'));db[_0xb087('0x17')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x18'));db[_0xb087('0x19')]=db[_0xb087('0x1')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0xb087('0x13')](_0xb087('0x1a'));db[_0xb087('0x1b')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x1c'));db[_0xb087('0x1d')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x1e'));db[_0xb087('0x1f')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/voiceMail/voiceMail.model');db[_0xb087('0x20')]=db[_0xb087('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db['sequelize']['import'](_0xb087('0x21'));db[_0xb087('0x22')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x23'));db[_0xb087('0x24')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x25'));db[_0xb087('0x26')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x27'));db[_0xb087('0x28')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x29'));db[_0xb087('0x2a')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x2b'));db[_0xb087('0x2c')]=db[_0xb087('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xb087('0x2d')]=db[_0xb087('0x1')]['import'](_0xb087('0x2e'));db[_0xb087('0x2f')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x30'));db[_0xb087('0x31')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x32'));db[_0xb087('0x33')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0xb087('0x34')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x35'));db[_0xb087('0x36')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x37'));db[_0xb087('0x38')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x39'));db[_0xb087('0x3a')]=db[_0xb087('0x1')]['import'](_0xb087('0x3b'));db[_0xb087('0x3c')]=db['sequelize']['import'](_0xb087('0x3d'));db[_0xb087('0x3e')]=db[_0xb087('0x1')]['import'](_0xb087('0x3f'));db[_0xb087('0x40')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x41'));db['MailSubstatus']=db[_0xb087('0x1')]['import'](_0xb087('0x42'));db['MailInteraction']=db[_0xb087('0x1')][_0xb087('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xb087('0x43')]=db['sequelize'][_0xb087('0x13')]('../api/mailMessage/mailMessage.model');db[_0xb087('0x44')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x45'));db[_0xb087('0x46')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0xb087('0x47')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x48'));db['DashboardItem']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x49'));db['FaxAccount']=db[_0xb087('0x1')]['import'](_0xb087('0x4a'));db[_0xb087('0x4b')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x4c'));db['FaxInteraction']=db[_0xb087('0x1')][_0xb087('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xb087('0x4d')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x4e'));db['FaxQueue']=db['sequelize'][_0xb087('0x13')](_0xb087('0x4f'));db[_0xb087('0x50')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x51'));db['SmsAccount']=db['sequelize'][_0xb087('0x13')]('../api/smsAccount/smsAccount.model');db[_0xb087('0x52')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x53'));db['SmsInteraction']=db[_0xb087('0x1')]['import'](_0xb087('0x54'));db[_0xb087('0x55')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x56'));db['SmsQueue']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x57'));db['OpenchannelAccount']=db[_0xb087('0x1')]['import']('../api/openchannelAccount/openchannelAccount.model');db[_0xb087('0x58')]=db[_0xb087('0x1')]['import'](_0xb087('0x59'));db[_0xb087('0x5a')]=db[_0xb087('0x1')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xb087('0x5b')]=db['sequelize']['import'](_0xb087('0x5c'));db[_0xb087('0x5d')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x5e'));db[_0xb087('0x5f')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x60'));db[_0xb087('0x61')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xb087('0x62')]=db[_0xb087('0x1')]['import'](_0xb087('0x63'));db[_0xb087('0x64')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x65'));db[_0xb087('0x66')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x67'));db[_0xb087('0x68')]=db[_0xb087('0x1')]['import'](_0xb087('0x69'));db['ChatQueue']=db[_0xb087('0x1')]['import'](_0xb087('0x6a'));db[_0xb087('0x6b')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x6c'));db[_0xb087('0x6d')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x6e'));db[_0xb087('0x6f')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x70'));db[_0xb087('0x71')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x72'));db[_0xb087('0x73')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x74'));db[_0xb087('0x75')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x76'));db[_0xb087('0x77')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x78'));db['CmHopperHistory']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x79'));db['ReportAgentPreview']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x7a'));db[_0xb087('0x7b')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x7c'));db[_0xb087('0x7d')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x7e'));db[_0xb087('0x7f')]=db['sequelize'][_0xb087('0x13')]('../api/automation/automation.model');db['CannedAnswer']=db[_0xb087('0x1')][_0xb087('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0xb087('0x80')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x81'));db['Condition']=db['sequelize'][_0xb087('0x13')]('../api/condition/condition.model');db['Interval']=db[_0xb087('0x1')]['import'](_0xb087('0x82'));db['Pause']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x83'));db[_0xb087('0x84')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/cdr/cdr.model');db[_0xb087('0x85')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x86'));db[_0xb087('0x87')]=db['sequelize'][_0xb087('0x13')]('../api/schedule/schedule.model');db[_0xb087('0x88')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x89'));db[_0xb087('0x8a')]=db[_0xb087('0x1')]['import'](_0xb087('0x8b'));db[_0xb087('0x8c')]=db['sequelize'][_0xb087('0x13')]('../api/template/template.model');db[_0xb087('0x8d')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x8e'));db[_0xb087('0x8f')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x90'));db['Integration']=db['sequelize']['import'](_0xb087('0x91'));db['IntegrationReport']=db[_0xb087('0x1')]['import'](_0xb087('0x92'));db[_0xb087('0x93')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xb087('0x94')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x95'));db[_0xb087('0x96')]=db[_0xb087('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xb087('0x97')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x98'));db[_0xb087('0x99')]=db[_0xb087('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xb087('0x9a')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x9b'));db[_0xb087('0x9c')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xb087('0x9d')]=db[_0xb087('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x9e'));db[_0xb087('0x9f')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xb087('0xa0')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xa1'));db[_0xb087('0xa2')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xb087('0xa3')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0xb087('0xa4')]=db['sequelize'][_0xb087('0x13')](_0xb087('0xa5'));db[_0xb087('0xa6')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xa7'));db['ZohoAccount']=db['sequelize'][_0xb087('0x13')](_0xb087('0xa8'));db['ZohoConfiguration']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xa9'));db[_0xb087('0xaa')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intZohoField/intZohoField.model');db[_0xb087('0xab')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xac'));db[_0xb087('0xad')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xae'));db[_0xb087('0xaf')]=db['sequelize'][_0xb087('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0xb087('0xb0')]=db[_0xb087('0x1')]['import'](_0xb087('0xb1'));db[_0xb087('0xb2')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xb3'));db[_0xb087('0xb4')]=db['sequelize'][_0xb087('0x13')](_0xb087('0xb5'));db[_0xb087('0xb6')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xb087('0xb7')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xb8'));db[_0xb087('0xb9')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xba'));db[_0xb087('0xbb')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xbc'));db[_0xb087('0xbd')]=db[_0xb087('0x1')]['import'](_0xb087('0xbe'));db[_0xb087('0xbf')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xc0'));db[_0xb087('0xc1')]=db['sequelize'][_0xb087('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xc2'));db[_0xb087('0xc3')]=db['sequelize'][_0xb087('0x13')](_0xb087('0xc4'));db['FreshsalesConfiguration']=db[_0xb087('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xb087('0xc5')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xc6'));db[_0xb087('0xc7')]=db['sequelize'][_0xb087('0x13')](_0xb087('0x91'));db[_0xb087('0xc8')]=db[_0xb087('0x1')]['import']('../api/network/network.model');db['ChatQueueReport']=db['sequelize'][_0xb087('0x13')](_0xb087('0xc9'));db[_0xb087('0xca')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xcb'));db[_0xb087('0xcc')]=db['sequelize']['import'](_0xb087('0xcd'));db[_0xb087('0xce')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xb087('0xcf')]=db['sequelize'][_0xb087('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xb087('0xd0')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xd1'));db['SquareReport']=db[_0xb087('0x1')]['import']('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0xb087('0x1')]['import'](_0xb087('0xd2'));db[_0xb087('0xd3')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xd4'));db[_0xb087('0xd5')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xd6'));db[_0xb087('0xd7')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xd8'));db[_0xb087('0xd9')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xda'));db[_0xb087('0xdb')]=db['sequelize'][_0xb087('0x13')]('../api/squareRecording/squareRecording.model');db[_0xb087('0xdc')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xdd'));db[_0xb087('0xde')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/team/team.model');db['License']=db['sequelize'][_0xb087('0x13')](_0xb087('0xdf'));db[_0xb087('0xe0')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xe1'));db[_0xb087('0xe2')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/migration/migration.model');db[_0xb087('0xe3')]=db['sequelize'][_0xb087('0x13')](_0xb087('0xe4'));db['Plugin']=db['sequelize'][_0xb087('0x13')](_0xb087('0xe5'));db[_0xb087('0xe6')]=db[_0xb087('0x1')]['import'](_0xb087('0xe7'));db[_0xb087('0xe8')]=db['sequelize']['import'](_0xb087('0xe9'));db['FaxTransferReport']=db['sequelize'][_0xb087('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xb087('0xea')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xeb'));db[_0xb087('0xec')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xed'));db['CmList']=db[_0xb087('0x1')]['import']('../api/cmList/cmList.model');db[_0xb087('0xee')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0xb087('0xef')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xf0'));db['UserProfileSection']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xf1'));db[_0xb087('0xf2')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xf3'));db['UserNotification']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xf4'));db[_0xb087('0xf5')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0xb087('0xf6')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xf7'));db[_0xb087('0xf8')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xf9'));db[_0xb087('0xfa')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xb087('0xfb')]=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0xfc'));db[_0xb087('0xfd')]=db['sequelize'][_0xb087('0x13')](_0xb087('0xfe'));db[_0xb087('0xff')]=db[_0xb087('0x1')]['import'](_0xb087('0x100'));db['TeamVoiceQueue']=db[_0xb087('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xb087('0x101')]=db[_0xb087('0x1')][_0xb087('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0xb087('0x1')][_0xb087('0x13')](_0xb087('0x102'));db[_0xb087('0x12')][_0xb087('0x103')](db['VoiceMail'],{'as':_0xb087('0x1f'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x105')});db[_0xb087('0x12')][_0xb087('0x106')](db[_0xb087('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xb087('0x12')][_0xb087('0x106')](db['UserVoiceQueueRt'],{'as':_0xb087('0x107'),'foreignKey':'UserId'});db['User'][_0xb087('0x106')](db[_0xb087('0x17')],{'as':_0xb087('0x108'),'onDelete':_0xb087('0x104'),'hooks':!![]});db[_0xb087('0x12')][_0xb087('0x106')](db[_0xb087('0x77')],{'as':_0xb087('0x109'),'foreignKey':_0xb087('0x105')});db[_0xb087('0x12')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xb087('0x105')});db['User'][_0xb087('0x106')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xb087('0x105')});db[_0xb087('0x12')][_0xb087('0x106')](db[_0xb087('0x5a')],{'as':_0xb087('0x10a'),'foreignKey':_0xb087('0x105')});db[_0xb087('0x12')][_0xb087('0x106')](db[_0xb087('0x64')],{'as':_0xb087('0x10b'),'foreignKey':'UserId'});db[_0xb087('0x12')]['hasMany'](db[_0xb087('0x10c')],{'as':_0xb087('0x10d'),'foreignKey':'UserId'});db[_0xb087('0x12')][_0xb087('0x106')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xb087('0x105')});db['User'][_0xb087('0x106')](db['MailInteraction'],{'as':_0xb087('0x10e'),'foreignKey':_0xb087('0x105')});db[_0xb087('0x12')]['hasMany'](db[_0xb087('0x10f')],{'as':_0xb087('0x110'),'foreignKey':_0xb087('0x105')});db[_0xb087('0x12')][_0xb087('0x106')](db[_0xb087('0x111')],{'as':_0xb087('0x112'),'foreignKey':_0xb087('0x113')});db[_0xb087('0x12')][_0xb087('0x114')](db['UserProfile'],{'as':_0xb087('0xef'),'foreignKey':'userProfileId'});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x6b')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xb087('0x115')](db[_0xb087('0x71')],{'as':_0xb087('0x116'),'through':_0xb087('0x117')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x118')],{'as':'Lists','through':_0xb087('0x119')});db['User']['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0xb087('0x12')][_0xb087('0x115')](db['MailInteraction'],{'as':_0xb087('0x10e'),'through':_0xb087('0x11a')});db[_0xb087('0x12')]['belongsToMany'](db[_0xb087('0x64')],{'as':_0xb087('0x10b'),'through':'user_has_chat_interactions'});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x11b')],{'as':_0xb087('0x11c'),'through':'user_has_fax_interactions'});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x10c')],{'as':_0xb087('0x10d'),'through':_0xb087('0x11d')});db[_0xb087('0x12')]['belongsToMany'](db[_0xb087('0x5a')],{'as':'OpenchannelInteractions','through':_0xb087('0x11e')});db[_0xb087('0x12')]['belongsToMany'](db[_0xb087('0x10f')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db['User'][_0xb087('0x115')](db[_0xb087('0x11f')],{'as':_0xb087('0x120'),'through':_0xb087('0x2f'),'required':![]});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0xee')],{'as':_0xb087('0x121'),'through':'UserVoicePrefix','required':![]});db[_0xb087('0x12')]['belongsToMany'](db['MailQueue'],{'as':_0xb087('0x122'),'through':_0xb087('0x33'),'required':![]});db[_0xb087('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0xb087('0x123'),'through':_0xb087('0x31'),'required':![],'hooks':!![]});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x124')],{'as':_0xb087('0x125'),'through':'UserFaxQueue','required':![]});db['User']['belongsToMany'](db[_0xb087('0x126')],{'as':_0xb087('0x127'),'through':_0xb087('0x36'),'required':![]});db[_0xb087('0x12')]['belongsToMany'](db[_0xb087('0x5d')],{'as':_0xb087('0x128'),'through':_0xb087('0x38'),'required':![]});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0xfd')],{'as':_0xb087('0x129'),'through':_0xb087('0x12a'),'required':![]});db[_0xb087('0x12')][_0xb087('0x115')](db['CmList'],{'through':'cm_user_has_lists'});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x5f')],{'as':_0xb087('0x12b'),'through':_0xb087('0x12c')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x12d')],{'as':_0xb087('0x12e'),'through':_0xb087('0x12f')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x3e')],{'as':_0xb087('0x130'),'through':_0xb087('0x131')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x132')],{'as':_0xb087('0x133'),'through':_0xb087('0x134')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0x135')],{'as':_0xb087('0x136'),'through':_0xb087('0x137')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0xf5')],{'as':_0xb087('0x138'),'through':_0xb087('0x139')});db[_0xb087('0x12')][_0xb087('0x115')](db[_0xb087('0xd9')],{'as':_0xb087('0x13a'),'through':_0xb087('0x13b')});db[_0xb087('0x13c')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x13d')});db['VoiceContext'][_0xb087('0x106')](db['VoiceExtension'],{'onDelete':_0xb087('0x104')});db[_0xb087('0x17')][_0xb087('0x106')](db[_0xb087('0x17')],{'as':_0xb087('0x13e'),'onDelete':_0xb087('0x104')});db[_0xb087('0x19')][_0xb087('0x115')](db[_0xb087('0x88')],{'as':_0xb087('0x13f'),'through':_0xb087('0x140')});db['VoiceQueue'][_0xb087('0x106')](db[_0xb087('0x2d')],{'as':_0xb087('0x141'),'foreignKey':_0xb087('0x142')});db['VoiceQueue'][_0xb087('0x106')](db[_0xb087('0x73')],{'as':_0xb087('0x143'),'foreignKey':_0xb087('0x142')});db[_0xb087('0x11f')][_0xb087('0x106')](db[_0xb087('0x77')],{'as':_0xb087('0x109'),'foreignKey':_0xb087('0x142')});db[_0xb087('0x11f')][_0xb087('0x106')](db[_0xb087('0x144')],{'as':_0xb087('0x145'),'foreignKey':_0xb087('0x142')});db[_0xb087('0x11f')][_0xb087('0x106')](db[_0xb087('0x146')],{'as':_0xb087('0x146'),'foreignKey':'VoiceQueueId'});db[_0xb087('0x11f')][_0xb087('0x106')](db[_0xb087('0x75')],{'as':_0xb087('0x147'),'foreignKey':'VoiceQueueId'});db[_0xb087('0x11f')][_0xb087('0x106')](db[_0xb087('0xcf')],{'as':_0xb087('0x148'),'foreignKey':_0xb087('0x142')});db['VoiceQueue'][_0xb087('0x114')](db[_0xb087('0x2a')],{'as':_0xb087('0x2a'),'foreignKey':_0xb087('0x149')});db[_0xb087('0x11f')][_0xb087('0x114')](db[_0xb087('0x2a')],{'as':_0xb087('0x14a'),'foreignKey':'TrunkBackupId'});db[_0xb087('0x11f')][_0xb087('0x114')](db['Interval'],{'as':_0xb087('0x14b'),'foreignKey':_0xb087('0x14c')});db['VoiceQueue'][_0xb087('0x114')](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':_0xb087('0x14f')});db[_0xb087('0x11f')][_0xb087('0x115')](db[_0xb087('0x118')],{'as':'Lists','through':_0xb087('0x150')});db[_0xb087('0x11f')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x2f')});db['VoiceQueue'][_0xb087('0x115')](db[_0xb087('0xde')],{'as':_0xb087('0x152'),'through':_0xb087('0x153')});db[_0xb087('0x11f')]['belongsToMany'](db[_0xb087('0x118')],{'as':_0xb087('0x154'),'through':_0xb087('0x155')});db['VoiceRecording'][_0xb087('0x114')](db['User'],{'as':_0xb087('0x12'),'foreignKey':'UserId'});db[_0xb087('0x1d')]['belongsTo'](db[_0xb087('0x12')],{'as':_0xb087('0x12'),'foreignKey':'UserId'});db[_0xb087('0x1f')]['hasMany'](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0xb087('0x104'),'foreignKey':'mailboxuser','sourceKey':_0xb087('0x156')});db['VoiceMailMessage']['belongsTo'](db[_0xb087('0x1f')],{'foreignKey':_0xb087('0x157'),'targetKey':_0xb087('0x156')});db[_0xb087('0x158')][_0xb087('0x106')](db['VoiceQueueReport'],{'as':_0xb087('0x159'),'foreignKey':_0xb087('0x15a'),'constraints':![]});db[_0xb087('0x158')][_0xb087('0x106')](db[_0xb087('0x24')],{'as':_0xb087('0x15b'),'foreignKey':_0xb087('0x15a'),'constraints':![]});db[_0xb087('0x158')]['belongsTo'](db[_0xb087('0x12')],{'as':_0xb087('0x12'),'foreignKey':_0xb087('0x105')});db['VoiceCallReport'][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':'ContactId'});db['MailServerIn'][_0xb087('0x114')](db[_0xb087('0x3e')],{'as':_0xb087('0x3e'),'foreignKey':_0xb087('0x15d')});db['MailServerOut'][_0xb087('0x114')](db[_0xb087('0x3e')],{'as':_0xb087('0x3e'),'foreignKey':_0xb087('0x15d')});db[_0xb087('0x3e')]['hasOne'](db['MailServerIn'],{'as':_0xb087('0x15e'),'onDelete':_0xb087('0x104')});db['MailAccount'][_0xb087('0x103')](db[_0xb087('0x3c')],{'as':_0xb087('0x15f'),'onDelete':_0xb087('0x104')});db[_0xb087('0x3e')][_0xb087('0x106')](db[_0xb087('0x80')],{'as':'Dispositions','foreignKey':_0xb087('0x15d'),'onDelete':_0xb087('0x104')});db[_0xb087('0x3e')]['hasMany'](db['CannedAnswer'],{'as':_0xb087('0x160'),'foreignKey':_0xb087('0x15d')});db[_0xb087('0x3e')][_0xb087('0x106')](db['MailMessage'],{'as':_0xb087('0x161'),'foreignKey':_0xb087('0x15d')});db[_0xb087('0x3e')]['hasMany'](db['MailInteraction'],{'as':_0xb087('0x162')});db['MailAccount'][_0xb087('0x106')](db[_0xb087('0x44')],{'as':'Applications'});db['MailAccount'][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db['MailAccount'][_0xb087('0x114')](db['Template'],{'as':'Template','foreignKey':_0xb087('0x165')});db[_0xb087('0x3e')][_0xb087('0x114')](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xb087('0x3e')]['belongsToMany'](db['User'],{'as':_0xb087('0x151'),'through':_0xb087('0x131')});db['MailQueue'][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x33')});db['MailQueue'][_0xb087('0x115')](db[_0xb087('0xde')],{'through':_0xb087('0x166'),'as':_0xb087('0x152')});db[_0xb087('0x167')]['hasMany'](db['MailMessage'],{'as':'Messages','onDelete':_0xb087('0x104'),'foreignKey':'MailInteractionId'});db[_0xb087('0x167')][_0xb087('0x114')](db['MailAccount'],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x15d')});db[_0xb087('0x167')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x167')]['belongsTo'](db[_0xb087('0x12')],{'as':_0xb087('0x16a'),'foreignKey':_0xb087('0x105')});db['MailInteraction'][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x16b'),'as':_0xb087('0x16c')});db['MailInteraction']['belongsToMany'](db[_0xb087('0x8a')],{'through':_0xb087('0x16b'),'as':_0xb087('0x16d')});db[_0xb087('0x167')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xb087('0x16e')});db[_0xb087('0x43')][_0xb087('0x106')](db[_0xb087('0xe3')],{'as':'Attachments','onDelete':_0xb087('0x104')});db[_0xb087('0x43')][_0xb087('0x114')](db[_0xb087('0x12')],{'as':_0xb087('0x12')});db[_0xb087('0x43')][_0xb087('0x114')](db[_0xb087('0x71')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x15c')});db[_0xb087('0x43')][_0xb087('0x114')](db[_0xb087('0x167')],{'as':_0xb087('0x16f'),'foreignKey':_0xb087('0x16e')});db[_0xb087('0x43')][_0xb087('0x114')](db[_0xb087('0x3e')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x15d')});db['MailMessage'][_0xb087('0x114')](db[_0xb087('0x5f')],{'as':'ChatWebsite','foreignKey':_0xb087('0x170')});db[_0xb087('0x43')][_0xb087('0x114')](db['ChatOfflineMessage'],{'as':_0xb087('0x68'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0xb087('0x114')](db[_0xb087('0x12')],{'onDelete':_0xb087('0x171')});db[_0xb087('0x44')]['belongsTo'](db[_0xb087('0x40')],{'onDelete':'restrict'});db[_0xb087('0x44')][_0xb087('0x114')](db[_0xb087('0x3e')],{'onDelete':'restrict'});db['MailApplication'][_0xb087('0x114')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xb087('0x14c')});db[_0xb087('0x44')]['belongsTo'](db[_0xb087('0x8a')],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x172')});db[_0xb087('0x46')]['belongsTo'](db['MailAccount'],{});db[_0xb087('0x46')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':'ListId'});db[_0xb087('0x46')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x46')][_0xb087('0x114')](db[_0xb087('0x167')],{});db['MailQueueReport'][_0xb087('0x114')](db[_0xb087('0x43')],{});db[_0xb087('0x46')]['belongsTo'](db[_0xb087('0x12')],{});db[_0xb087('0x46')][_0xb087('0x114')](db[_0xb087('0x40')],{});db[_0xb087('0x47')][_0xb087('0x106')](db['DashboardItem'],{'as':'Items','onDelete':_0xb087('0x104')});db[_0xb087('0x12d')][_0xb087('0x106')](db[_0xb087('0x80')],{'as':_0xb087('0x173'),'foreignKey':_0xb087('0x174'),'onDelete':'cascade'});db['FaxAccount'][_0xb087('0x106')](db[_0xb087('0x175')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xb087('0x12d')][_0xb087('0x106')](db[_0xb087('0x11b')],{'as':'Interactions'});db[_0xb087('0x12d')][_0xb087('0x106')](db['FaxApplication'],{'as':_0xb087('0x13e')});db['FaxAccount']['hasMany'](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db[_0xb087('0x12d')]['hasMany'](db[_0xb087('0x4d')],{'as':_0xb087('0x161')});db['FaxAccount'][_0xb087('0x114')](db[_0xb087('0x2a')],{'as':_0xb087('0x2a')});db[_0xb087('0x12d')]['belongsTo'](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db['FaxAccount']['belongsTo'](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':_0xb087('0x14f')});db[_0xb087('0x12d')][_0xb087('0x115')](db['User'],{'as':_0xb087('0x151'),'through':'user_has_fax_accounts'});db[_0xb087('0x4b')][_0xb087('0x114')](db['User'],{'onDelete':_0xb087('0x171')});db['FaxApplication'][_0xb087('0x114')](db[_0xb087('0x124')],{'onDelete':_0xb087('0x171')});db[_0xb087('0x4b')][_0xb087('0x114')](db[_0xb087('0x12d')],{'onDelete':_0xb087('0x171')});db[_0xb087('0x4b')]['belongsTo'](db[_0xb087('0x8a')],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x172')});db[_0xb087('0x11b')][_0xb087('0x106')](db[_0xb087('0x4d')],{'as':_0xb087('0x161'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x176')});db['FaxInteraction'][_0xb087('0x114')](db[_0xb087('0x12d')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x174')});db[_0xb087('0x11b')][_0xb087('0x114')](db['CmContact'],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x11b')]['belongsTo'](db[_0xb087('0x12')],{'as':_0xb087('0x16a'),'foreignKey':_0xb087('0x105')});db['FaxInteraction'][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':'fax_interaction_has_tags','as':_0xb087('0x16c')});db[_0xb087('0x11b')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x177'),'as':'ThroughTags'});db[_0xb087('0x11b')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x178'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xb087('0x4d')]['belongsTo'](db[_0xb087('0x12')],{'onDelete':_0xb087('0x104'),'as':'User'});db[_0xb087('0x4d')][_0xb087('0x114')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xb087('0x176')});db[_0xb087('0x4d')][_0xb087('0x114')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0xb087('0x4d')][_0xb087('0x114')](db[_0xb087('0xe3')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xb087('0x4d')][_0xb087('0x114')](db[_0xb087('0x12d')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x174')});db[_0xb087('0x124')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x34')});db[_0xb087('0x124')][_0xb087('0x115')](db[_0xb087('0xde')],{'through':_0xb087('0x179'),'as':_0xb087('0x152')});db[_0xb087('0x50')]['belongsTo'](db[_0xb087('0x12d')],{});db[_0xb087('0x50')]['belongsTo'](db['CmList'],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db[_0xb087('0x50')][_0xb087('0x114')](db['CmContact'],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db['FaxQueueReport']['belongsTo'](db[_0xb087('0x11b')],{});db[_0xb087('0x50')][_0xb087('0x114')](db['FaxMessage'],{});db[_0xb087('0x50')][_0xb087('0x114')](db[_0xb087('0x12')],{});db[_0xb087('0x50')][_0xb087('0x114')](db[_0xb087('0x124')],{});db[_0xb087('0x135')]['hasMany'](db[_0xb087('0x80')],{'as':_0xb087('0x173'),'foreignKey':_0xb087('0x17a'),'onDelete':_0xb087('0x104')});db[_0xb087('0x135')]['hasMany'](db['CannedAnswer'],{'as':_0xb087('0x160'),'foreignKey':_0xb087('0x17a')});db[_0xb087('0x135')]['hasMany'](db[_0xb087('0x55')],{'as':_0xb087('0x161'),'foreignKey':_0xb087('0x17a')});db['SmsAccount'][_0xb087('0x106')](db[_0xb087('0x10c')],{'as':_0xb087('0x162')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':_0xb087('0x13e')});db[_0xb087('0x135')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db[_0xb087('0x135')][_0xb087('0x114')](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':_0xb087('0x14f')});db[_0xb087('0x135')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x137')});db[_0xb087('0x52')][_0xb087('0x114')](db[_0xb087('0x12')],{'onDelete':_0xb087('0x171')});db[_0xb087('0x52')][_0xb087('0x114')](db[_0xb087('0x126')],{'onDelete':_0xb087('0x171')});db[_0xb087('0x52')]['belongsTo'](db[_0xb087('0x135')],{'onDelete':_0xb087('0x171')});db['SmsApplication']['belongsTo'](db[_0xb087('0x14b')],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x14c')});db['SmsApplication']['belongsTo'](db[_0xb087('0x8a')],{'onDelete':_0xb087('0x171'),'foreignKey':'TagId'});db[_0xb087('0x10c')][_0xb087('0x106')](db[_0xb087('0x55')],{'as':_0xb087('0x161'),'onDelete':'cascade','foreignKey':_0xb087('0x17b')});db[_0xb087('0x10c')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0xb087('0x17a')});db[_0xb087('0x10c')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db['SmsInteraction'][_0xb087('0x114')](db[_0xb087('0x12')],{'as':_0xb087('0x16a'),'foreignKey':_0xb087('0x105')});db[_0xb087('0x10c')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x17c'),'as':_0xb087('0x16c')});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':_0xb087('0x17c'),'as':_0xb087('0x16d')});db[_0xb087('0x10c')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x178'),'through':_0xb087('0x11d'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xb087('0x114')](db[_0xb087('0x12')],{'as':'User'});db[_0xb087('0x55')]['belongsTo'](db[_0xb087('0x71')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x15c')});db[_0xb087('0x55')][_0xb087('0x114')](db[_0xb087('0x10c')],{'onDelete':'cascade','as':_0xb087('0x16f'),'foreignKey':_0xb087('0x17b')});db[_0xb087('0x55')]['belongsTo'](db[_0xb087('0x135')],{'as':'Account','foreignKey':_0xb087('0x17a')});db[_0xb087('0x126')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0xb087('0x17d')});db['SmsQueue']['belongsToMany'](db['Team'],{'through':_0xb087('0x17e'),'as':_0xb087('0x152')});db[_0xb087('0x132')][_0xb087('0x106')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xb087('0x17f'),'onDelete':'cascade'});db[_0xb087('0x132')][_0xb087('0x106')](db['CannedAnswer'],{'as':_0xb087('0x160'),'foreignKey':_0xb087('0x17f')});db[_0xb087('0x132')][_0xb087('0x106')](db['OpenchannelInteraction'],{'as':_0xb087('0x162'),'foreignKey':_0xb087('0x17f')});db[_0xb087('0x132')][_0xb087('0x106')](db[_0xb087('0x5b')],{'as':_0xb087('0x161'),'foreignKey':_0xb087('0x17f')});db[_0xb087('0x132')][_0xb087('0x106')](db[_0xb087('0x58')],{'as':_0xb087('0x13e'),'foreignKey':_0xb087('0x17f')});db['OpenchannelAccount']['belongsTo'](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db[_0xb087('0x132')][_0xb087('0x114')](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xb087('0x132')][_0xb087('0x115')](db['User'],{'as':_0xb087('0x151'),'through':'user_has_openchannel_accounts'});db[_0xb087('0x58')][_0xb087('0x114')](db[_0xb087('0x12')],{'onDelete':_0xb087('0x171')});db[_0xb087('0x58')][_0xb087('0x114')](db['OpenchannelQueue'],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x180')});db[_0xb087('0x58')][_0xb087('0x114')](db[_0xb087('0x132')],{'onDelete':'restrict','foreignKey':_0xb087('0x17f')});db['OpenchannelApplication'][_0xb087('0x114')](db[_0xb087('0x14b')],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x14c')});db['OpenchannelApplication'][_0xb087('0x114')](db['Tag'],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x172')});db[_0xb087('0x5a')][_0xb087('0x106')](db[_0xb087('0x5b')],{'as':_0xb087('0x161'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x181')});db[_0xb087('0x5a')][_0xb087('0x114')](db[_0xb087('0x132')],{'as':'Account','foreignKey':_0xb087('0x17f')});db[_0xb087('0x5a')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x5a')]['belongsTo'](db[_0xb087('0x12')],{'as':_0xb087('0x16a'),'foreignKey':'UserId'});db[_0xb087('0x5a')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x182'),'as':'Tags'});db[_0xb087('0x5a')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x182'),'as':_0xb087('0x16d')});db[_0xb087('0x5a')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':'Users','through':_0xb087('0x11e'),'foreignKey':'OpenchannelInteractionId'});db[_0xb087('0x5b')]['belongsTo'](db[_0xb087('0x12')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x12')});db[_0xb087('0x5b')][_0xb087('0x114')](db[_0xb087('0x71')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x15c')});db[_0xb087('0x5b')][_0xb087('0x114')](db[_0xb087('0x5a')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x16f'),'foreignKey':_0xb087('0x181')});db[_0xb087('0x5b')][_0xb087('0x114')](db['Attachment'],{'as':_0xb087('0xe3'),'foreignKey':_0xb087('0x183')});db[_0xb087('0x5b')][_0xb087('0x114')](db[_0xb087('0x132')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x17f')});db[_0xb087('0x5d')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':'Agents','through':_0xb087('0x38'),'foreignKey':_0xb087('0x180')});db[_0xb087('0x5d')][_0xb087('0x115')](db['Team'],{'through':_0xb087('0x184'),'as':_0xb087('0x152')});db[_0xb087('0x5f')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xb087('0x104')});db[_0xb087('0x5f')][_0xb087('0x106')](db['CannedAnswer'],{'as':_0xb087('0x160'),'foreignKey':_0xb087('0x170')});db[_0xb087('0x5f')][_0xb087('0x106')](db[_0xb087('0x6d')],{'as':_0xb087('0x185')});db['ChatWebsite']['hasMany'](db[_0xb087('0x64')],{'as':_0xb087('0x162')});db[_0xb087('0x5f')][_0xb087('0x106')](db['ChatApplication'],{'as':'Applications'});db[_0xb087('0x5f')]['hasMany'](db['ChatMessage'],{'as':_0xb087('0x161')});db['ChatWebsite'][_0xb087('0x114')](db['CmList'],{'as':'List','foreignKey':_0xb087('0x164')});db[_0xb087('0x5f')]['belongsTo'](db['Interval'],{'as':_0xb087('0x14b'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0xb087('0x114')](db[_0xb087('0x3e')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xb087('0x5f')]['belongsTo'](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':_0xb087('0x14f')});db['ChatWebsite'][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':'user_has_chat_websites'});db[_0xb087('0x61')]['belongsTo'](db['OpenchannelAccount'],{});db[_0xb087('0x61')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db[_0xb087('0x61')]['belongsTo'](db[_0xb087('0x71')],{'as':'Contact','foreignKey':_0xb087('0x169')});db[_0xb087('0x61')][_0xb087('0x114')](db['OpenchannelInteraction'],{});db[_0xb087('0x61')][_0xb087('0x114')](db[_0xb087('0x5b')],{});db[_0xb087('0x61')]['belongsTo'](db['User'],{});db[_0xb087('0x61')][_0xb087('0x114')](db[_0xb087('0x5d')],{});db[_0xb087('0x62')][_0xb087('0x114')](db['User'],{'as':'Agent','foreignKey':_0xb087('0x105'),'onDelete':_0xb087('0x171')});db[_0xb087('0x62')][_0xb087('0x114')](db[_0xb087('0x186')],{'as':_0xb087('0x187'),'foreignKey':_0xb087('0x188'),'onDelete':_0xb087('0x171')});db[_0xb087('0x62')][_0xb087('0x114')](db[_0xb087('0x5f')],{'as':_0xb087('0x189'),'foreignKey':_0xb087('0x170'),'onDelete':_0xb087('0x171')});db[_0xb087('0x62')][_0xb087('0x114')](db[_0xb087('0x8a')],{'onDelete':_0xb087('0x171'),'foreignKey':'TagId'});db[_0xb087('0x64')][_0xb087('0x106')](db[_0xb087('0x66')],{'as':'Messages','onDelete':_0xb087('0x104'),'foreignKey':'ChatInteractionId'});db[_0xb087('0x64')][_0xb087('0x114')](db[_0xb087('0x5f')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x170')});db[_0xb087('0x64')]['belongsTo'](db['CmContact'],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x64')][_0xb087('0x114')](db[_0xb087('0x12')],{'as':_0xb087('0x16a'),'foreignKey':_0xb087('0x105')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xb087('0x16c')});db['ChatInteraction'][_0xb087('0x115')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xb087('0x16d')});db[_0xb087('0x64')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':'Users','through':_0xb087('0x18a'),'foreignKey':_0xb087('0x18b')});db['ChatMessage'][_0xb087('0x114')](db[_0xb087('0x12')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x12')});db[_0xb087('0x66')][_0xb087('0x114')](db[_0xb087('0x71')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xb087('0x169')});db[_0xb087('0x66')][_0xb087('0x114')](db[_0xb087('0x64')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x16f'),'foreignKey':_0xb087('0x18b')});db[_0xb087('0x66')][_0xb087('0x114')](db[_0xb087('0xe3')],{'as':_0xb087('0xe3'),'foreignKey':_0xb087('0x183')});db[_0xb087('0x66')][_0xb087('0x114')](db[_0xb087('0x5f')],{'as':'Account','foreignKey':_0xb087('0x170')});db['ChatOfflineMessage']['hasMany'](db[_0xb087('0xe3')],{'as':_0xb087('0x18c'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xb087('0x104'),'hooks':!![]});db[_0xb087('0x68')]['belongsTo'](db['CmContact'],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x68')]['belongsTo'](db[_0xb087('0x5f')],{'as':_0xb087('0x168'),'foreignKey':'ChatWebsiteId'});db[_0xb087('0x186')]['belongsToMany'](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x31'),'hooks':!![]});db[_0xb087('0x186')][_0xb087('0x115')](db[_0xb087('0xde')],{'through':_0xb087('0x18d'),'as':_0xb087('0x152')});db['ChatGroup'][_0xb087('0x106')](db[_0xb087('0xca')],{'as':_0xb087('0x161'),'foreignKey':_0xb087('0x18e'),'onDelete':'cascade'});db[_0xb087('0x6b')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x141'),'through':_0xb087('0x18f')});db['ChatProactiveAction'][_0xb087('0x114')](db[_0xb087('0x5f')],{'as':_0xb087('0x189'),'foreignKey':_0xb087('0x170')});db[_0xb087('0x6f')][_0xb087('0x106')](db[_0xb087('0x71')],{'as':_0xb087('0x116'),'foreignKey':_0xb087('0x190')});db['CmContact']['hasMany'](db['CmHopper'],{'as':_0xb087('0x143'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x71')][_0xb087('0x106')](db[_0xb087('0x77')],{'as':_0xb087('0x109'),'foreignKey':_0xb087('0x169')});db['CmContact'][_0xb087('0x106')](db[_0xb087('0x144')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xb087('0x71')][_0xb087('0x106')](db[_0xb087('0x146')],{'as':_0xb087('0x146'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x71')][_0xb087('0x106')](db[_0xb087('0xcf')],{'as':_0xb087('0x148'),'foreignKey':_0xb087('0x169')});db[_0xb087('0x71')][_0xb087('0x106')](db['OpenchannelInteraction'],{'as':_0xb087('0x10a'),'foreignKey':_0xb087('0x169'),'onDelete':_0xb087('0x171')});db['CmContact'][_0xb087('0x106')](db[_0xb087('0x64')],{'as':_0xb087('0x10b'),'foreignKey':_0xb087('0x169'),'onDelete':_0xb087('0x171')});db[_0xb087('0x71')]['hasMany'](db['SmsInteraction'],{'as':_0xb087('0x10d'),'foreignKey':_0xb087('0x169'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0xb087('0x11b')],{'as':_0xb087('0x11c'),'foreignKey':_0xb087('0x169'),'onDelete':_0xb087('0x171')});db[_0xb087('0x71')][_0xb087('0x106')](db[_0xb087('0x167')],{'as':_0xb087('0x10e'),'foreignKey':_0xb087('0x169'),'onDelete':'restrict'});db[_0xb087('0x71')][_0xb087('0x114')](db[_0xb087('0x6f')],{'as':_0xb087('0x191'),'foreignKey':'CompanyId'});db[_0xb087('0x71')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':'List','foreignKey':_0xb087('0x164'),'onDelete':_0xb087('0x104')});db['CmContact'][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x178'),'through':_0xb087('0x117')});db[_0xb087('0x71')]['belongsToMany'](db[_0xb087('0x8a')],{'as':_0xb087('0x16c'),'through':_0xb087('0x192')});db[_0xb087('0x71')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':'cm_contact_has_tags','as':_0xb087('0x16d')});db[_0xb087('0x73')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':'ContactId','onDelete':_0xb087('0x104')});db[_0xb087('0x73')]['belongsTo'](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':'ListId','onDelete':_0xb087('0x104')});db[_0xb087('0x73')]['belongsTo'](db[_0xb087('0x12')],{'as':'Agent','foreignKey':_0xb087('0x105')});db[_0xb087('0x73')][_0xb087('0x114')](db['VoiceQueue'],{'as':_0xb087('0x187'),'foreignKey':_0xb087('0x142'),'onDelete':_0xb087('0x104')});db[_0xb087('0x73')][_0xb087('0x114')](db['Campaign'],{'as':_0xb087('0xe0'),'foreignKey':_0xb087('0x193'),'onDelete':'cascade'});db[_0xb087('0x73')][_0xb087('0x114')](db['User'],{'as':_0xb087('0x16a'),'foreignKey':'OwnerId'});db[_0xb087('0x75')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':'ContactId','onDelete':_0xb087('0x104')});db[_0xb087('0x75')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164'),'onDelete':'cascade'});db[_0xb087('0x75')]['belongsTo'](db[_0xb087('0x11f')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xb087('0x104')});db['CmHopperBlack'][_0xb087('0x114')](db[_0xb087('0xe0')],{'as':'Campaign','foreignKey':_0xb087('0x193'),'onDelete':_0xb087('0x104')});db[_0xb087('0x7f')]['hasMany'](db[_0xb087('0x194')],{'as':{'plural':'All','singular':_0xb087('0x195')},'foreignKey':'AutomationAllId','onDelete':_0xb087('0x104'),'hooks':!![]});db['Automation'][_0xb087('0x106')](db[_0xb087('0x194')],{'as':{'plural':'Any','singular':_0xb087('0x196')},'foreignKey':_0xb087('0x197'),'onDelete':'cascade','hooks':!![]});db[_0xb087('0x7f')][_0xb087('0x106')](db['Action'],{'as':_0xb087('0x198'),'foreignKey':_0xb087('0x199'),'onDelete':_0xb087('0x104'),'hooks':!![]});db[_0xb087('0x80')]['hasMany'](db['Disposition'],{'as':_0xb087('0x173'),'foreignKey':'ParentId','onDelete':_0xb087('0x104')});db[_0xb087('0x14b')]['hasMany'](db[_0xb087('0x14b')],{'as':_0xb087('0x19a'),'foreignKey':_0xb087('0x14c'),'onDelete':_0xb087('0x104'),'hooks':!![],'required':![]});db[_0xb087('0x14b')][_0xb087('0x106')](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0xb087('0x14c'),'onDelete':_0xb087('0x171')});db[_0xb087('0x14b')][_0xb087('0x106')](db[_0xb087('0x44')],{'as':_0xb087('0x19b'),'foreignKey':'IntervalId'});db[_0xb087('0x14b')][_0xb087('0x106')](db[_0xb087('0x62')],{'as':_0xb087('0x19c'),'foreignKey':'IntervalId'});db['Interval'][_0xb087('0x106')](db[_0xb087('0x4b')],{'as':_0xb087('0x19d'),'foreignKey':_0xb087('0x14c')});db[_0xb087('0x14b')]['hasMany'](db[_0xb087('0x52')],{'as':_0xb087('0x19e'),'foreignKey':_0xb087('0x14c')});db[_0xb087('0x87')][_0xb087('0x114')](db[_0xb087('0x3e')],{});db[_0xb087('0x87')]['belongsTo'](db[_0xb087('0x94')],{'foreignKey':_0xb087('0x19f')});db[_0xb087('0x87')][_0xb087('0x114')](db[_0xb087('0x93')],{'foreignKey':'CustomReportId'});db[_0xb087('0x88')][_0xb087('0x115')](db[_0xb087('0x19')],{'as':_0xb087('0x1a0'),'through':_0xb087('0x140'),'onDelete':'restrict'});db[_0xb087('0x8a')][_0xb087('0x115')](db['CmContact'],{'through':_0xb087('0x192')});db[_0xb087('0x8a')]['belongsToMany'](db[_0xb087('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xb087('0x115')](db[_0xb087('0x167')],{'through':_0xb087('0x16b')});db['Tag'][_0xb087('0x115')](db[_0xb087('0x10c')],{'through':_0xb087('0x17c')});db[_0xb087('0x8a')][_0xb087('0x115')](db[_0xb087('0x11b')],{'through':_0xb087('0x177')});db[_0xb087('0x8a')][_0xb087('0x115')](db[_0xb087('0x5a')],{'through':_0xb087('0x182')});db[_0xb087('0x8a')][_0xb087('0x115')](db[_0xb087('0x10f')],{'through':'whatsapp_interaction_has_tags'});db[_0xb087('0x8d')][_0xb087('0x106')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xb087('0x1a1')},'foreignKey':_0xb087('0x1a2'),'onDelete':_0xb087('0x104'),'hooks':!![]});db[_0xb087('0x8d')][_0xb087('0x106')](db['Condition'],{'as':{'plural':_0xb087('0x1a3'),'singular':_0xb087('0x1a4')},'foreignKey':_0xb087('0x1a5'),'onDelete':_0xb087('0x104'),'hooks':!![]});db[_0xb087('0x8d')][_0xb087('0x106')](db['Action'],{'as':_0xb087('0x198'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0xb087('0x93')][_0xb087('0x106')](db[_0xb087('0x99')],{'as':_0xb087('0x1a6'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1a7'),'hooks':!![]});db[_0xb087('0x94')][_0xb087('0x106')](db['AnalyticFieldReport'],{'as':_0xb087('0x1a6'),'onDelete':_0xb087('0x104'),'foreignKey':'DefaultReportId'});db[_0xb087('0x97')][_0xb087('0x106')](db[_0xb087('0x99')],{'as':_0xb087('0x1a6'),'onDelete':'cascade','foreignKey':_0xb087('0x1a8')});db['AnalyticFieldReport'][_0xb087('0x114')](db[_0xb087('0x97')],{'foreignKey':_0xb087('0x1a8')});db[_0xb087('0x9c')][_0xb087('0x106')](db['SalesforceConfiguration'],{'as':_0xb087('0x1a9'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0x9d')][_0xb087('0x106')](db[_0xb087('0x1ab')],{'as':_0xb087('0x1ac'),'onDelete':'cascade','foreignKey':_0xb087('0x1ad')});db[_0xb087('0x9d')][_0xb087('0x106')](db[_0xb087('0x1ab')],{'as':'Descriptions','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0x9d')]['hasMany'](db[_0xb087('0x1ab')],{'as':_0xb087('0x1a6'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0x9d')][_0xb087('0x114')](db[_0xb087('0x9c')],{'as':'Account','foreignKey':_0xb087('0x1aa')});db[_0xb087('0x1ab')][_0xb087('0x106')](db['SalesforceField'],{'as':_0xb087('0x1b0'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0x1ab')]['hasMany'](db['SalesforceField'],{'as':_0xb087('0x1b1'),'foreignKey':_0xb087('0x1ae')});db['SalesforceField']['hasMany'](db[_0xb087('0x1ab')],{'as':_0xb087('0x1b2'),'foreignKey':'FieldId'});db['SalesforceField'][_0xb087('0x114')](db[_0xb087('0x8f')],{'as':_0xb087('0x8f'),'foreignKey':_0xb087('0x1b3')});db[_0xb087('0x9f')][_0xb087('0x106')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xa0')]['hasMany'](db['SugarcrmField'],{'as':_0xb087('0x1ac'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0xa0')][_0xb087('0x106')](db[_0xb087('0xa2')],{'as':_0xb087('0x1b4'),'onDelete':'cascade','foreignKey':_0xb087('0x1ae')});db[_0xb087('0xa0')][_0xb087('0x106')](db[_0xb087('0xa2')],{'as':_0xb087('0x1a6'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1af')});db['SugarcrmConfiguration'][_0xb087('0x114')](db[_0xb087('0x9f')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xa2')][_0xb087('0x106')](db[_0xb087('0xa2')],{'as':_0xb087('0x1b0'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0xa2')][_0xb087('0x106')](db['SugarcrmField'],{'as':_0xb087('0x1b1'),'foreignKey':'DescriptionId'});db[_0xb087('0xa2')]['hasMany'](db[_0xb087('0xa2')],{'as':'Field','foreignKey':_0xb087('0x1af')});db[_0xb087('0xa2')]['belongsTo'](db[_0xb087('0x8f')],{'as':_0xb087('0x8f'),'foreignKey':_0xb087('0x1b3')});db[_0xb087('0xa3')][_0xb087('0x106')](db['DeskConfiguration'],{'as':_0xb087('0x1a9'),'onDelete':_0xb087('0x104'),'foreignKey':'AccountId'});db[_0xb087('0xa4')]['hasMany'](db[_0xb087('0xa6')],{'as':_0xb087('0x1ac'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0xa4')][_0xb087('0x106')](db[_0xb087('0xa6')],{'as':'Descriptions','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xa4')][_0xb087('0x106')](db['DeskField'],{'as':_0xb087('0x1a6'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0xa4')][_0xb087('0x114')](db['DeskAccount'],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db['DeskConfiguration'][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x1b5')});db[_0xb087('0xa6')][_0xb087('0x106')](db[_0xb087('0xa6')],{'as':_0xb087('0x1b0'),'foreignKey':'SubjectId'});db['DeskField'][_0xb087('0x106')](db[_0xb087('0xa6')],{'as':_0xb087('0x1b1'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xa6')][_0xb087('0x106')](db['DeskField'],{'as':_0xb087('0x1b2'),'foreignKey':_0xb087('0x1af')});db['DeskField'][_0xb087('0x114')](db[_0xb087('0x8f')],{'as':_0xb087('0x8f'),'foreignKey':'VariableId'});db[_0xb087('0x1b6')][_0xb087('0x106')](db[_0xb087('0x1b7')],{'as':_0xb087('0x1a9'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1aa')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0xb087('0x1ac'),'onDelete':'cascade','foreignKey':_0xb087('0x1ad')});db[_0xb087('0x1b7')]['hasMany'](db[_0xb087('0xaa')],{'as':_0xb087('0x1b4'),'onDelete':'cascade','foreignKey':_0xb087('0x1ae')});db[_0xb087('0x1b7')][_0xb087('0x106')](db['ZohoField'],{'as':'Fields','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0x1b7')]['belongsTo'](db[_0xb087('0x1b6')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db['ZohoField'][_0xb087('0x106')](db['ZohoField'],{'as':'Subject','foreignKey':_0xb087('0x1ad')});db[_0xb087('0xaa')][_0xb087('0x106')](db['ZohoField'],{'as':_0xb087('0x1b1'),'foreignKey':'DescriptionId'});db[_0xb087('0xaa')][_0xb087('0x106')](db[_0xb087('0xaa')],{'as':_0xb087('0x1b2'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0xaa')][_0xb087('0x114')](db['Variable'],{'as':_0xb087('0x8f'),'foreignKey':'VariableId'});db[_0xb087('0xab')][_0xb087('0x106')](db[_0xb087('0xad')],{'as':_0xb087('0x1a9'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xad')][_0xb087('0x106')](db[_0xb087('0xaf')],{'as':_0xb087('0x1ac'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0xad')][_0xb087('0x106')](db[_0xb087('0xaf')],{'as':_0xb087('0x1b4'),'foreignKey':'DescriptionId'});db[_0xb087('0xad')][_0xb087('0x106')](db[_0xb087('0xaf')],{'as':_0xb087('0x1a6'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0xad')][_0xb087('0x114')](db[_0xb087('0xab')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xad')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x1b8')});db[_0xb087('0xaf')][_0xb087('0x106')](db[_0xb087('0xaf')],{'as':_0xb087('0x1b0'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0xaf')][_0xb087('0x106')](db[_0xb087('0xaf')],{'as':'Description','foreignKey':_0xb087('0x1ae')});db[_0xb087('0xaf')][_0xb087('0x106')](db[_0xb087('0xaf')],{'as':'Field','foreignKey':'FieldId'});db[_0xb087('0xaf')][_0xb087('0x114')](db['Variable'],{'as':_0xb087('0x8f'),'foreignKey':_0xb087('0x1b3')});db[_0xb087('0xb0')]['hasMany'](db[_0xb087('0xb2')],{'as':'Configurations','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1aa')});db['FreshdeskConfiguration'][_0xb087('0x106')](db[_0xb087('0xb4')],{'as':_0xb087('0x1ac'),'onDelete':_0xb087('0x104'),'foreignKey':'SubjectId'});db[_0xb087('0xb2')][_0xb087('0x106')](db[_0xb087('0xb4')],{'as':_0xb087('0x1b4'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xb2')][_0xb087('0x106')](db[_0xb087('0xb4')],{'as':'Fields','onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0xb2')]['belongsTo'](db['FreshdeskAccount'],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xb2')][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x1b9')});db[_0xb087('0xb4')]['hasMany'](db[_0xb087('0xb4')],{'as':_0xb087('0x1b0'),'foreignKey':_0xb087('0x1ad')});db['FreshdeskField'][_0xb087('0x106')](db[_0xb087('0xb4')],{'as':'Description','foreignKey':_0xb087('0x1ae')});db[_0xb087('0xb4')]['hasMany'](db[_0xb087('0xb4')],{'as':'Field','foreignKey':_0xb087('0x1af')});db['FreshdeskField'][_0xb087('0x114')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xb087('0xb6')][_0xb087('0x106')](db[_0xb087('0xb7')],{'as':_0xb087('0x1a9'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xb7')][_0xb087('0x106')](db['VtigerField'],{'as':_0xb087('0x1ac'),'foreignKey':_0xb087('0x1ad')});db['VtigerConfiguration'][_0xb087('0x106')](db[_0xb087('0xb9')],{'as':_0xb087('0x1b4'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xb7')][_0xb087('0x106')](db[_0xb087('0xb9')],{'as':'Fields','foreignKey':_0xb087('0x1af')});db[_0xb087('0xb7')][_0xb087('0x114')](db['VtigerAccount'],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xb9')][_0xb087('0x106')](db[_0xb087('0xb9')],{'as':_0xb087('0x1b0'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0xb9')][_0xb087('0x106')](db[_0xb087('0xb9')],{'as':_0xb087('0x1b1'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xb9')]['hasMany'](db['VtigerField'],{'as':_0xb087('0x1b2'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0xb9')][_0xb087('0x114')](db[_0xb087('0x8f')],{'as':'Variable','foreignKey':_0xb087('0x1b3')});db[_0xb087('0xbb')]['hasMany'](db[_0xb087('0x1ba')],{'as':_0xb087('0x1a9'),'onDelete':'cascade','foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xb087('0x106')](db[_0xb087('0xbd')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xb087('0x1ba')][_0xb087('0x106')](db[_0xb087('0xbd')],{'as':_0xb087('0x1b4'),'foreignKey':_0xb087('0x1ae')});db['ServicenowConfiguration'][_0xb087('0x106')](db[_0xb087('0xbd')],{'as':_0xb087('0x1a6'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0x1ba')][_0xb087('0x114')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xb087('0x1aa')});db[_0xb087('0xbd')][_0xb087('0x106')](db[_0xb087('0xbd')],{'as':_0xb087('0x1b0'),'foreignKey':'SubjectId'});db['ServicenowField'][_0xb087('0x106')](db[_0xb087('0xbd')],{'as':_0xb087('0x1b1'),'foreignKey':'DescriptionId'});db['ServicenowField']['hasMany'](db[_0xb087('0xbd')],{'as':'Field','foreignKey':_0xb087('0x1af')});db[_0xb087('0xbd')][_0xb087('0x114')](db[_0xb087('0x8f')],{'as':_0xb087('0x8f'),'foreignKey':_0xb087('0x1b3')});db[_0xb087('0xbf')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xb087('0x104'),'foreignKey':'AccountId'});db[_0xb087('0xc1')][_0xb087('0x106')](db['Dynamics365Field'],{'as':_0xb087('0x1ac'),'onDelete':_0xb087('0x104'),'foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xb087('0x106')](db[_0xb087('0x1bb')],{'as':_0xb087('0x1b4'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xc1')][_0xb087('0x106')](db[_0xb087('0x1bb')],{'as':_0xb087('0x1a6'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1af')});db[_0xb087('0xc1')]['belongsTo'](db[_0xb087('0xbf')],{'as':_0xb087('0x168'),'foreignKey':'AccountId'});db[_0xb087('0x1bb')][_0xb087('0x106')](db[_0xb087('0x1bb')],{'as':_0xb087('0x1b0'),'foreignKey':_0xb087('0x1ad')});db[_0xb087('0x1bb')][_0xb087('0x106')](db[_0xb087('0x1bb')],{'as':_0xb087('0x1b1'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0x1bb')]['hasMany'](db[_0xb087('0x1bb')],{'as':_0xb087('0x1b2'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xb087('0x114')](db[_0xb087('0x8f')],{'as':_0xb087('0x8f'),'foreignKey':_0xb087('0x1b3')});db['FreshsalesAccount'][_0xb087('0x106')](db[_0xb087('0x1bc')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xb087('0x1bc')][_0xb087('0x106')](db['FreshsalesField'],{'as':_0xb087('0x1ac'),'foreignKey':_0xb087('0x1ad')});db['FreshsalesConfiguration'][_0xb087('0x106')](db[_0xb087('0xc5')],{'as':_0xb087('0x1b4'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0x1bc')][_0xb087('0x106')](db[_0xb087('0xc5')],{'as':_0xb087('0x1a6'),'foreignKey':'FieldId'});db[_0xb087('0x1bc')][_0xb087('0x114')](db[_0xb087('0xc3')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1aa')});db[_0xb087('0xc5')][_0xb087('0x106')](db[_0xb087('0xc5')],{'as':'Subject','foreignKey':_0xb087('0x1ad')});db[_0xb087('0xc5')][_0xb087('0x106')](db[_0xb087('0xc5')],{'as':_0xb087('0x1b1'),'foreignKey':_0xb087('0x1ae')});db[_0xb087('0xc5')]['hasMany'](db[_0xb087('0xc5')],{'as':'Field','foreignKey':_0xb087('0x1af')});db[_0xb087('0xc5')][_0xb087('0x114')](db['Variable'],{'as':_0xb087('0x8f'),'foreignKey':_0xb087('0x1b3')});db[_0xb087('0x1bd')][_0xb087('0x114')](db[_0xb087('0x5f')],{});db['ChatQueueReport'][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db[_0xb087('0x1bd')][_0xb087('0x114')](db['CmContact'],{'as':_0xb087('0x15c'),'foreignKey':'ContactId'});db[_0xb087('0x1bd')][_0xb087('0x114')](db['ChatInteraction'],{});db[_0xb087('0x1bd')][_0xb087('0x114')](db[_0xb087('0x66')],{});db[_0xb087('0x1bd')]['belongsTo'](db['User'],{});db[_0xb087('0x1bd')][_0xb087('0x114')](db[_0xb087('0x186')],{});db[_0xb087('0xca')]['belongsTo'](db['User'],{'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1be')});db['ChatInternalMessage'][_0xb087('0x114')](db['User'],{'onDelete':_0xb087('0x104'),'foreignKey':'ToId'});db[_0xb087('0xcf')]['hasMany'](db[_0xb087('0xce')],{'foreignKey':_0xb087('0x1bf'),'onDelete':'cascade'});db[_0xb087('0xcf')][_0xb087('0x106')](db[_0xb087('0xcc')],{'foreignKey':_0xb087('0x1bf'),'onDelete':_0xb087('0x104')});db['SmsQueueReport'][_0xb087('0x114')](db[_0xb087('0x135')],{});db[_0xb087('0xd0')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':'ListId'});db[_0xb087('0xd0')][_0xb087('0x114')](db[_0xb087('0x71')],{'as':'Contact','foreignKey':_0xb087('0x169')});db[_0xb087('0xd0')][_0xb087('0x114')](db['SmsInteraction'],{});db[_0xb087('0xd0')][_0xb087('0x114')](db[_0xb087('0x55')],{});db[_0xb087('0xd0')][_0xb087('0x114')](db['User'],{});db[_0xb087('0xd0')][_0xb087('0x114')](db[_0xb087('0x126')],{});db[_0xb087('0xd3')][_0xb087('0x106')](db[_0xb087('0xcf')],{'foreignKey':_0xb087('0x1c0')});db['JscriptyProject'][_0xb087('0x106')](db[_0xb087('0xce')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xb087('0x106')](db[_0xb087('0xcc')],{'foreignKey':_0xb087('0x1c0')});db[_0xb087('0xd9')][_0xb087('0x115')](db['User'],{'as':_0xb087('0x178'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x1c1')});db[_0xb087('0xde')][_0xb087('0x115')](db[_0xb087('0x11f')],{'through':_0xb087('0x153'),'as':_0xb087('0x120')});db[_0xb087('0xde')][_0xb087('0x115')](db[_0xb087('0x40')],{'through':'team_has_mail_queues','as':_0xb087('0x122')});db[_0xb087('0xde')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xb087('0x123')});db[_0xb087('0xde')][_0xb087('0x115')](db[_0xb087('0x124')],{'through':_0xb087('0x179'),'as':_0xb087('0x125')});db['Team'][_0xb087('0x115')](db['SmsQueue'],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0xb087('0x115')](db[_0xb087('0x5d')],{'through':_0xb087('0x184'),'as':_0xb087('0x128')});db[_0xb087('0xde')][_0xb087('0x115')](db[_0xb087('0xfd')],{'through':_0xb087('0x1c2'),'as':_0xb087('0x129')});db[_0xb087('0xde')][_0xb087('0x115')](db[_0xb087('0xee')],{'through':'TeamVoicePrefix','as':_0xb087('0x121')});db['Campaign'][_0xb087('0x106')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xb087('0x193')});db['Campaign']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xb087('0xe0')]['hasMany'](db['CmHopperHistory'],{'as':_0xb087('0x145'),'foreignKey':_0xb087('0x193')});db[_0xb087('0xe0')][_0xb087('0x106')](db[_0xb087('0x75')],{'as':_0xb087('0x147'),'foreignKey':_0xb087('0x193')});db[_0xb087('0xe0')][_0xb087('0x114')](db[_0xb087('0x2a')],{'as':'Trunk','foreignKey':_0xb087('0x149')});db[_0xb087('0xe0')][_0xb087('0x114')](db[_0xb087('0x2a')],{'as':_0xb087('0x14a'),'foreignKey':_0xb087('0x1c3')});db['Campaign']['belongsTo'](db[_0xb087('0x14b')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xb087('0xe0')]['belongsTo'](db['SquareProject'],{'as':_0xb087('0xd9'),'foreignKey':_0xb087('0x1c4')});db[_0xb087('0xe0')][_0xb087('0x115')](db[_0xb087('0x118')],{'as':_0xb087('0x1c5'),'through':'campaigns_has_cm_lists'});db[_0xb087('0xe0')][_0xb087('0x115')](db[_0xb087('0x118')],{'as':_0xb087('0x154'),'through':_0xb087('0x1c6')});db['Attachment'][_0xb087('0x114')](db[_0xb087('0x68')],{'as':_0xb087('0x68'),'foreignKey':_0xb087('0x1c7')});db[_0xb087('0xe6')][_0xb087('0x114')](db[_0xb087('0x43')],{});db[_0xb087('0xe6')][_0xb087('0x114')](db[_0xb087('0x167')],{});db[_0xb087('0xe6')][_0xb087('0x114')](db[_0xb087('0x3e')],{'foreignKey':_0xb087('0x1c8'),'as':_0xb087('0x1c9')});db[_0xb087('0xe6')]['belongsTo'](db['User'],{'foreignKey':_0xb087('0x1ca'),'as':_0xb087('0x1cb')});db['MailTransferReport'][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1cc'),'as':'ToAgent'});db[_0xb087('0xe6')][_0xb087('0x114')](db['MailQueue'],{'foreignKey':_0xb087('0x1cd'),'as':_0xb087('0x1ce')});db[_0xb087('0xe6')][_0xb087('0x114')](db[_0xb087('0x3e')],{'foreignKey':'ToMailAccountId','as':_0xb087('0x1cf')});db[_0xb087('0xe8')][_0xb087('0x114')](db[_0xb087('0x66')],{});db[_0xb087('0xe8')][_0xb087('0x114')](db[_0xb087('0x64')],{});db[_0xb087('0xe8')][_0xb087('0x114')](db[_0xb087('0x5f')],{'foreignKey':_0xb087('0x1d0'),'as':'FromAccount'});db[_0xb087('0xe8')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1ca'),'as':_0xb087('0x1cb')});db[_0xb087('0xe8')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0xb087('0x1d1')});db[_0xb087('0xe8')]['belongsTo'](db[_0xb087('0x186')],{'foreignKey':_0xb087('0x1d2'),'as':_0xb087('0x1ce')});db[_0xb087('0xe8')][_0xb087('0x114')](db[_0xb087('0x5f')],{'foreignKey':_0xb087('0x1d3'),'as':'ToAccount'});db[_0xb087('0x1d4')]['belongsTo'](db[_0xb087('0x4d')],{});db[_0xb087('0x1d4')][_0xb087('0x114')](db['FaxInteraction'],{});db['FaxTransferReport'][_0xb087('0x114')](db['FaxAccount'],{'foreignKey':_0xb087('0x1d5'),'as':_0xb087('0x1c9')});db['FaxTransferReport'][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1ca'),'as':'FromAgent'});db[_0xb087('0x1d4')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1cc'),'as':'ToAgent'});db[_0xb087('0x1d4')][_0xb087('0x114')](db[_0xb087('0x124')],{'foreignKey':'ToFaxQueueId','as':_0xb087('0x1ce')});db[_0xb087('0x1d4')][_0xb087('0x114')](db[_0xb087('0x12d')],{'foreignKey':_0xb087('0x1d6'),'as':'ToAccount'});db[_0xb087('0xea')][_0xb087('0x114')](db['OpenchannelMessage'],{});db[_0xb087('0xea')]['belongsTo'](db[_0xb087('0x5a')],{});db[_0xb087('0xea')][_0xb087('0x114')](db[_0xb087('0x132')],{'foreignKey':_0xb087('0x1d7'),'as':_0xb087('0x1c9')});db[_0xb087('0xea')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1ca'),'as':_0xb087('0x1cb')});db[_0xb087('0xea')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':'ToUserId','as':_0xb087('0x1d1')});db[_0xb087('0xea')][_0xb087('0x114')](db[_0xb087('0x5d')],{'foreignKey':_0xb087('0x1d8'),'as':'ToQueue'});db[_0xb087('0xea')][_0xb087('0x114')](db[_0xb087('0x132')],{'foreignKey':_0xb087('0x1d9'),'as':_0xb087('0x1cf')});db[_0xb087('0xec')]['belongsTo'](db[_0xb087('0x55')],{});db['SmsTransferReport'][_0xb087('0x114')](db[_0xb087('0x10c')],{});db[_0xb087('0xec')][_0xb087('0x114')](db[_0xb087('0x135')],{'foreignKey':_0xb087('0x1da'),'as':_0xb087('0x1c9')});db[_0xb087('0xec')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1ca'),'as':'FromAgent'});db[_0xb087('0xec')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1cc'),'as':_0xb087('0x1d1')});db[_0xb087('0xec')][_0xb087('0x114')](db[_0xb087('0x126')],{'foreignKey':_0xb087('0x1db'),'as':_0xb087('0x1ce')});db[_0xb087('0xec')]['belongsTo'](db[_0xb087('0x135')],{'foreignKey':_0xb087('0x1dc'),'as':'ToAccount'});db['CmList'][_0xb087('0x106')](db[_0xb087('0x80')],{'as':_0xb087('0x173'),'foreignKey':_0xb087('0x164'),'onDelete':_0xb087('0x104')});db[_0xb087('0x118')][_0xb087('0x106')](db[_0xb087('0x7b')],{'as':_0xb087('0x1dd'),'foreignKey':'ListId'});db['CmList'][_0xb087('0x106')](db[_0xb087('0x71')],{'as':_0xb087('0x116'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList'][_0xb087('0x106')](db['CmHopperFinal'],{'as':_0xb087('0x109'),'foreignKey':'ListId'});db['CmList'][_0xb087('0x106')](db[_0xb087('0x144')],{'as':_0xb087('0x1de'),'foreignKey':'ListId'});db[_0xb087('0x118')][_0xb087('0x106')](db[_0xb087('0x146')],{'as':'ReportAgentPreview','foreignKey':_0xb087('0x164')});db[_0xb087('0x118')]['belongsToMany'](db[_0xb087('0x11f')],{'as':'Queues','through':_0xb087('0x150')});db[_0xb087('0x118')][_0xb087('0x115')](db['User'],{'as':_0xb087('0x151'),'through':_0xb087('0x119')});db['VoicePrefix'][_0xb087('0x106')](db[_0xb087('0x17')],{'as':_0xb087('0x108'),'onDelete':_0xb087('0x104')});db[_0xb087('0xee')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':'Agents','through':_0xb087('0x1df')});db[_0xb087('0xee')][_0xb087('0x115')](db['Team'],{'through':'TeamVoicePrefix','as':_0xb087('0x152')});db[_0xb087('0xef')]['hasMany'](db[_0xb087('0x12')],{'as':_0xb087('0x178'),'foreignKey':'userProfileId'});db[_0xb087('0xef')][_0xb087('0x106')](db[_0xb087('0x1e0')],{'as':_0xb087('0x1e1'),'foreignKey':_0xb087('0x1e2'),'onDelete':'cascade'});db[_0xb087('0x1e0')][_0xb087('0x106')](db[_0xb087('0xf2')],{'as':'Resources','foreignKey':_0xb087('0x1e3'),'onDelete':_0xb087('0x104')});db[_0xb087('0xf5')][_0xb087('0x106')](db[_0xb087('0x80')],{'as':_0xb087('0x173'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xb087('0xf5')][_0xb087('0x106')](db['CannedAnswer'],{'as':_0xb087('0x160'),'foreignKey':_0xb087('0x1e4')});db['WhatsappAccount'][_0xb087('0x106')](db[_0xb087('0xf8')],{'as':_0xb087('0x161'),'foreignKey':'WhatsappAccountId'});db[_0xb087('0xf5')][_0xb087('0x106')](db[_0xb087('0x10f')],{'as':_0xb087('0x162')});db['WhatsappAccount']['hasMany'](db[_0xb087('0xf6')],{'as':_0xb087('0x13e')});db[_0xb087('0xf5')]['belongsTo'](db['CmList'],{'as':_0xb087('0x163'),'foreignKey':'ListId'});db[_0xb087('0xf5')][_0xb087('0x114')](db[_0xb087('0x14d')],{'as':_0xb087('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xb087('0xf5')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x139')});db[_0xb087('0xf6')]['belongsTo'](db[_0xb087('0x12')],{'onDelete':_0xb087('0x171')});db[_0xb087('0xf6')][_0xb087('0x114')](db[_0xb087('0xfd')],{'onDelete':_0xb087('0x171')});db[_0xb087('0xf6')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xb087('0x114')](db[_0xb087('0x14b')],{'onDelete':_0xb087('0x171'),'foreignKey':'IntervalId'});db[_0xb087('0xf6')]['belongsTo'](db[_0xb087('0x8a')],{'onDelete':_0xb087('0x171'),'foreignKey':_0xb087('0x172')});db[_0xb087('0x10f')][_0xb087('0x106')](db[_0xb087('0xf8')],{'as':_0xb087('0x161'),'onDelete':_0xb087('0x104'),'foreignKey':_0xb087('0x1e5')});db[_0xb087('0x10f')]['belongsTo'](db['WhatsappAccount'],{'as':_0xb087('0x168'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0xb087('0x114')](db['CmContact'],{'as':_0xb087('0x15c'),'foreignKey':'ContactId'});db[_0xb087('0x10f')][_0xb087('0x114')](db[_0xb087('0x12')],{'as':_0xb087('0x16a'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0xb087('0x115')](db['Tag'],{'through':_0xb087('0x1e6'),'as':_0xb087('0x16c')});db['WhatsappInteraction'][_0xb087('0x115')](db[_0xb087('0x8a')],{'through':_0xb087('0x1e6'),'as':'ThroughTags'});db['WhatsappInteraction'][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x178'),'through':_0xb087('0x1e7'),'foreignKey':_0xb087('0x1e5')});db['WhatsappMessage'][_0xb087('0x114')](db[_0xb087('0x12')],{'as':_0xb087('0x12')});db['WhatsappMessage'][_0xb087('0x114')](db[_0xb087('0x71')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x15c')});db[_0xb087('0xf8')][_0xb087('0x114')](db[_0xb087('0x10f')],{'onDelete':_0xb087('0x104'),'as':_0xb087('0x16f'),'foreignKey':_0xb087('0x1e5')});db[_0xb087('0xf8')][_0xb087('0x114')](db[_0xb087('0xf5')],{'as':_0xb087('0x168'),'foreignKey':_0xb087('0x1e4')});db[_0xb087('0xfa')]['belongsTo'](db[_0xb087('0xf5')],{});db[_0xb087('0xfa')][_0xb087('0x114')](db[_0xb087('0x118')],{'as':_0xb087('0x163'),'foreignKey':_0xb087('0x164')});db['WhatsappQueueReport'][_0xb087('0x114')](db[_0xb087('0x71')],{'as':_0xb087('0x15c'),'foreignKey':_0xb087('0x169')});db[_0xb087('0xfa')][_0xb087('0x114')](db[_0xb087('0x10f')],{});db[_0xb087('0xfa')][_0xb087('0x114')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0xb087('0x114')](db[_0xb087('0xf8')],{});db[_0xb087('0xfa')]['belongsTo'](db[_0xb087('0x12')],{});db[_0xb087('0xfb')][_0xb087('0x114')](db[_0xb087('0xf8')],{});db[_0xb087('0xfb')][_0xb087('0x114')](db['WhatsappInteraction'],{});db[_0xb087('0xfb')][_0xb087('0x114')](db[_0xb087('0xf5')],{'foreignKey':'FromWhatsappAccountId','as':_0xb087('0x1c9')});db[_0xb087('0xfb')][_0xb087('0x114')](db[_0xb087('0xf5')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0xb087('0xfb')][_0xb087('0x114')](db[_0xb087('0xfd')],{'foreignKey':_0xb087('0x1e8'),'as':_0xb087('0x1ce')});db[_0xb087('0xfb')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1ca'),'as':_0xb087('0x1cb')});db[_0xb087('0xfb')][_0xb087('0x114')](db[_0xb087('0x12')],{'foreignKey':_0xb087('0x1cc'),'as':'ToAgent'});db[_0xb087('0xfd')][_0xb087('0x115')](db[_0xb087('0x12')],{'as':_0xb087('0x151'),'through':_0xb087('0x12a'),'foreignKey':_0xb087('0x1e9')});db[_0xb087('0xfd')][_0xb087('0x115')](db[_0xb087('0xde')],{'through':_0xb087('0x1c2'),'as':'Teams'});module[_0xb087('0x1ea')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ced3198..cff4738 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5ad=['./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','./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/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','/api/rpc','./api/rpc','/api/version','./api/version','./api/webbar','/apidoc','static','root','/www','join','/demo','snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','pass','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/logger','api','auth','./safe-template','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','connection','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','other','agent_name','test','use','/api/users','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc5ad,0xea));var _0xdc5a=function(_0x70852c,_0x4bc136){_0x70852c=_0x70852c-0x0;var _0x50cbf2=_0xc5ad[_0x70852c];return _0x50cbf2;};'use strict';var _=require(_0xdc5a('0x0'));var path=require(_0xdc5a('0x1'));var express=require(_0xdc5a('0x2'));var ewinston=require(_0xdc5a('0x3'));var util=require(_0xdc5a('0x4'));var errors=require(_0xdc5a('0x5'));var config=require('./config/environment');var logger=require(_0xdc5a('0x6'))(_0xdc5a('0x7'));var authLogger=require(_0xdc5a('0x6'))(_0xdc5a('0x8'));var safeTemplate=require(_0xdc5a('0x9'))['safeTemplate'];exports['default']=function(_0x3d25b4){_0x3d25b4['use'](ewinston[_0xdc5a('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2d5c13,_0x569891){var _0x384bee=_0xdc5a('0xb');if(!_['isEmpty'](_0x2d5c13[_0xdc5a('0xc')])){_0x384bee+='\x20body=%s';var _0x39e209=_0x2d5c13['body'];maskSensitiveData(_0x39e209);}return safeTemplate(util[_0xdc5a('0xd')](_0x384bee,_0x2d5c13[_0xdc5a('0xe')],_0x2d5c13['headers']['x-forwarded-for']?_0x2d5c13[_0xdc5a('0xf')][_0xdc5a('0x10')]:_0x2d5c13[_0xdc5a('0x11')]['remoteAddress']||_0x2d5c13['ip'],_0x2d5c13['url'],_0x569891['statusCode'],_0x569891[_0xdc5a('0x12')],_0x2d5c13['user']?_0x2d5c13[_0xdc5a('0x13')]['id']:null,_0x2d5c13['user']?_0x2d5c13[_0xdc5a('0x13')][_0xdc5a('0x14')]:null,_0x2d5c13[_0xdc5a('0x13')]?_0x2d5c13[_0xdc5a('0x13')][_0xdc5a('0x15')]:null,_0x39e209?util[_0xdc5a('0x16')](_0x39e209,![],null):''));}}));_0x3d25b4['use'](ewinston[_0xdc5a('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3fb244,_0x88321b){var _0x1017b9=_0xdc5a('0x17');if(_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x18')]&&_0x3fb244['body'][_0xdc5a('0x19')]){_0x1017b9=_0xdc5a('0x1a');}return util[_0xdc5a('0xd')](_0x1017b9,_0x3fb244[_0xdc5a('0xe')],_0x3fb244['headers']['x-forwarded-for']?_0x3fb244['headers'][_0xdc5a('0x10')]:_0x3fb244[_0xdc5a('0x11')][_0xdc5a('0x1b')]||_0x3fb244['ip'],_0x3fb244[_0xdc5a('0x1c')],_0x88321b['statusCode'],_0x88321b[_0xdc5a('0x12')],_0x3fb244[_0xdc5a('0x13')]?_0x3fb244[_0xdc5a('0x13')]['id']:null,_0x3fb244['user']?_0x3fb244[_0xdc5a('0x13')]['name']:null,_0x3fb244[_0xdc5a('0x13')]?_0x3fb244[_0xdc5a('0x13')][_0xdc5a('0x15')]:null,_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x18')]?_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x18')]:_0xdc5a('0x1d'),_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x19')]?_0x3fb244['body'][_0xdc5a('0x19')]:'',_0x3fb244[_0xdc5a('0xc')]&&_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x1e')]?_0x3fb244[_0xdc5a('0xc')][_0xdc5a('0x1e')]:'');},'ignoreRoute':function(_0xbc0715){var _0x5b01fd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5b01fd[_0xdc5a('0x1f')](_0xbc0715[_0xdc5a('0x1c')]);}}));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x21'),require('./api/user'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x22'),require('./api/voiceChanSpy'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x23'),require(_0xdc5a('0x24')));_0x3d25b4['use']('/api/voice/extensions',require(_0xdc5a('0x25')));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x26'),require('./api/voiceQueue'));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/recordings',require(_0xdc5a('0x27')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x28'),require(_0xdc5a('0x29')));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/mails',require(_0xdc5a('0x2a')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2b'),require('./api/voiceMailMessage'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2c'),require(_0xdc5a('0x2d')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2e'),require('./api/voiceDialReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x2f'),require('./api/voiceAgentReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x30'),require(_0xdc5a('0x31')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x32'),require(_0xdc5a('0x33')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x34'),require('./api/trunk'));_0x3d25b4['use']('/api/voice/transfers/reports',require(_0xdc5a('0x35')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x36'),require(_0xdc5a('0x37')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x38'),require(_0xdc5a('0x39')));_0x3d25b4['use'](_0xdc5a('0x3a'),require(_0xdc5a('0x3b')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x3c'),require(_0xdc5a('0x3d')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x3e'),require(_0xdc5a('0x3f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x40'),require(_0xdc5a('0x41')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x42'),require('./api/mailApplication'));_0x3d25b4[_0xdc5a('0x20')]('/api/mail/reports/queue',require(_0xdc5a('0x43')));_0x3d25b4[_0xdc5a('0x20')]('/api/dashboards',require(_0xdc5a('0x44')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x45'),require(_0xdc5a('0x46')));_0x3d25b4[_0xdc5a('0x20')]('/api/fax/accounts',require(_0xdc5a('0x47')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x48'),require(_0xdc5a('0x49')));_0x3d25b4['use'](_0xdc5a('0x4a'),require('./api/faxInteraction'));_0x3d25b4['use']('/api/fax/messages',require(_0xdc5a('0x4b')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x4c'),require('./api/faxQueue'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x4d'),require(_0xdc5a('0x4e')));_0x3d25b4['use']('/api/sms/accounts',require('./api/smsAccount'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x4f'),require(_0xdc5a('0x50')));_0x3d25b4['use'](_0xdc5a('0x51'),require('./api/smsInteraction'));_0x3d25b4['use'](_0xdc5a('0x52'),require(_0xdc5a('0x53')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x54'),require(_0xdc5a('0x55')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x56'),require(_0xdc5a('0x57')));_0x3d25b4[_0xdc5a('0x20')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x58'),require(_0xdc5a('0x59')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x5a'),require(_0xdc5a('0x5b')));_0x3d25b4[_0xdc5a('0x20')]('/api/openchannel/queues',require(_0xdc5a('0x5c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x5d'),require('./api/chatWebsite'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x5e'),require(_0xdc5a('0x5f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x60'),require(_0xdc5a('0x61')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x62'),require(_0xdc5a('0x63')));_0x3d25b4['use'](_0xdc5a('0x64'),require(_0xdc5a('0x65')));_0x3d25b4['use'](_0xdc5a('0x66'),require('./api/chatOfflineMessage'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x67'),require(_0xdc5a('0x68')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x69'),require(_0xdc5a('0x6a')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x6b'),require(_0xdc5a('0x6c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x6d'),require(_0xdc5a('0x6e')));_0x3d25b4['use']('/api/cm/contacts',require(_0xdc5a('0x6f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x70'),require(_0xdc5a('0x71')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x72'),require(_0xdc5a('0x73')));_0x3d25b4[_0xdc5a('0x20')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x3d25b4[_0xdc5a('0x20')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x3d25b4[_0xdc5a('0x20')]('/api/cm/custom_fields',require(_0xdc5a('0x74')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x75'),require(_0xdc5a('0x76')));_0x3d25b4['use'](_0xdc5a('0x77'),require('./api/automation'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x78'),require(_0xdc5a('0x79')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x7a'),require('./api/disposition'));_0x3d25b4[_0xdc5a('0x20')]('/api/conditions',require(_0xdc5a('0x7b')));_0x3d25b4[_0xdc5a('0x20')]('/api/intervals',require(_0xdc5a('0x7c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x7d'),require(_0xdc5a('0x7e')));_0x3d25b4[_0xdc5a('0x20')]('/api/cdr',require(_0xdc5a('0x7f')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x80'),require(_0xdc5a('0x81')));_0x3d25b4[_0xdc5a('0x20')]('/api/schedules',require('./api/schedule'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x82'),require(_0xdc5a('0x83')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x84'),require('./api/tag'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x85'),require(_0xdc5a('0x86')));_0x3d25b4[_0xdc5a('0x20')]('/api/triggers',require(_0xdc5a('0x87')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x88'),require(_0xdc5a('0x89')));_0x3d25b4['use']('/api/integrations',require(_0xdc5a('0x8a')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x8b'),require('./api/integrationReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x8c'),require(_0xdc5a('0x8d')));_0x3d25b4['use'](_0xdc5a('0x8e'),require(_0xdc5a('0x8f')));_0x3d25b4['use'](_0xdc5a('0x90'),require(_0xdc5a('0x91')));_0x3d25b4[_0xdc5a('0x20')]('/api/analytics/metrics',require(_0xdc5a('0x92')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x93'),require('./api/analyticFieldReport'));_0x3d25b4['use'](_0xdc5a('0x94'),require(_0xdc5a('0x95')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x96'),require(_0xdc5a('0x97')));_0x3d25b4['use']('/api/integrations/salesforce/configurations',require(_0xdc5a('0x98')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x99'),require('./api/intSalesforceField'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x9a'),require(_0xdc5a('0x9b')));_0x3d25b4[_0xdc5a('0x20')]('/api/integrations/sugarcrm/configurations',require(_0xdc5a('0x9c')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x9d'),require(_0xdc5a('0x9e')));_0x3d25b4['use'](_0xdc5a('0x9f'),require(_0xdc5a('0xa0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa1'),require(_0xdc5a('0xa2')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa3'),require(_0xdc5a('0xa4')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa5'),require(_0xdc5a('0xa6')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa7'),require(_0xdc5a('0xa8')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xa9'),require(_0xdc5a('0xaa')));_0x3d25b4['use'](_0xdc5a('0xab'),require(_0xdc5a('0xac')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xad'),require('./api/intZendeskConfiguration'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xae'),require('./api/intZendeskField'));_0x3d25b4['use'](_0xdc5a('0xaf'),require(_0xdc5a('0xb0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb1'),require(_0xdc5a('0xb2')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb3'),require('./api/intFreshdeskField'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb4'),require('./api/intVtigerAccount'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb5'),require('./api/intVtigerConfiguration'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb6'),require(_0xdc5a('0xb7')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xb8'),require(_0xdc5a('0xb9')));_0x3d25b4['use'](_0xdc5a('0xba'),require(_0xdc5a('0xbb')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xbc'),require('./api/intServicenowField'));_0x3d25b4['use'](_0xdc5a('0xbd'),require(_0xdc5a('0xbe')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xbf'),require(_0xdc5a('0xc0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc1'),require(_0xdc5a('0xc2')));_0x3d25b4['use'](_0xdc5a('0xc3'),require(_0xdc5a('0xc4')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc5'),require('./api/intFreshsalesConfiguration'));_0x3d25b4[_0xdc5a('0x20')]('/api/integrations/freshsales/fields',require(_0xdc5a('0xc6')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc7'),require(_0xdc5a('0xc8')));_0x3d25b4[_0xdc5a('0x20')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xc9'),require(_0xdc5a('0xca')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xcb'),require('./api/jscriptyAnswerReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xcc'),require(_0xdc5a('0xcd')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xce'),require('./api/jscriptySessionReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xcf'),require(_0xdc5a('0xd0')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xd1'),require('./api/squareReport'));_0x3d25b4[_0xdc5a('0x20')]('/api/square/details/reports',require(_0xdc5a('0xd2')));_0x3d25b4[_0xdc5a('0x20')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xd3'),require(_0xdc5a('0xd4')));_0x3d25b4[_0xdc5a('0x20')]('/api/square/odbc',require(_0xdc5a('0xd5')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xd6'),require(_0xdc5a('0xd7')));_0x3d25b4['use']('/api/square/recordings',require('./api/squareRecording'));_0x3d25b4[_0xdc5a('0x20')]('/api/square/messages',require('./api/squareMessage'));_0x3d25b4['use'](_0xdc5a('0xd8'),require('./api/team'));_0x3d25b4['use'](_0xdc5a('0xd9'),require(_0xdc5a('0xda')));_0x3d25b4['use'](_0xdc5a('0xdb'),require('./api/campaign'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xdc'),require(_0xdc5a('0xdd')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xde'),require(_0xdc5a('0xdf')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xe0'),require(_0xdc5a('0xe1')));_0x3d25b4['use'](_0xdc5a('0xe2'),require(_0xdc5a('0xe3')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xe4'),require('./api/chatTransferReport'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xe5'),require(_0xdc5a('0xe6')));_0x3d25b4['use'](_0xdc5a('0xe7'),require(_0xdc5a('0xe8')));_0x3d25b4['use']('/api/sms/reports/transfer',require(_0xdc5a('0xe9')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xea'),require(_0xdc5a('0xeb')));_0x3d25b4[_0xdc5a('0x20')]('/api/voice/prefixes',require(_0xdc5a('0xec')));_0x3d25b4[_0xdc5a('0x20')]('/api/userProfiles',require(_0xdc5a('0xed')));_0x3d25b4[_0xdc5a('0x20')]('/api/userProfile/sections',require(_0xdc5a('0xee')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xef'),require('./api/userProfileResource'));_0x3d25b4['use'](_0xdc5a('0xf0'),require(_0xdc5a('0xf1')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xf2'),require('./api/whatsappAccount'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xf3'),require(_0xdc5a('0xf4')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xf5'),require(_0xdc5a('0xf6')));_0x3d25b4['use'](_0xdc5a('0xf7'),require(_0xdc5a('0xf8')));_0x3d25b4['use'](_0xdc5a('0xf9'),require(_0xdc5a('0xfa')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xfb'),require(_0xdc5a('0xfc')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xfd'),require('./api/whatsappQueue'));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0xfe'),require(_0xdc5a('0xff')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x100'),require(_0xdc5a('0x101')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x102'),require('./api/authLocal'));_0x3d25b4[_0xdc5a('0x20')]('/api/auth/google',require('./api/authGoogle'));_0x3d25b4['use']('/api/jira',require('./api/jira'));_0x3d25b4['use'](_0xdc5a('0x103'),require(_0xdc5a('0x104')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x105'),require(_0xdc5a('0x106')));_0x3d25b4[_0xdc5a('0x20')]('/api/system',require('./api/system'));_0x3d25b4['use']('/api/pm2',require('./api/pm2'));_0x3d25b4[_0xdc5a('0x20')]('/api/webbar',require(_0xdc5a('0x107')));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x108'),express[_0xdc5a('0x109')](path['join'](config[_0xdc5a('0x10a')],_0xdc5a('0x108'))));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x10b'),express[_0xdc5a('0x109')](path[_0xdc5a('0x10c')](config[_0xdc5a('0x10a')],_0xdc5a('0x10b'))));_0x3d25b4[_0xdc5a('0x20')](_0xdc5a('0x10d'),express[_0xdc5a('0x109')](path['join'](config[_0xdc5a('0x10a')],_0xdc5a('0x10d'))));_0x3d25b4[_0xdc5a('0x20')]('/snippet',express[_0xdc5a('0x109')](path[_0xdc5a('0x10c')](config['root'],_0xdc5a('0x10e'),'3.0.0')));_0x3d25b4['use'](_0xdc5a('0x10f'),express[_0xdc5a('0x109')](path['join'](config[_0xdc5a('0x10a')],_0xdc5a('0x110'))));_0x3d25b4['route'](_0xdc5a('0x111'))[_0xdc5a('0x112')](errors[0x194]);_0x3d25b4[_0xdc5a('0x113')]('/*')['get'](function(_0x45d5c8,_0x8ea18b){_0x8ea18b[_0xdc5a('0x114')](path[_0xdc5a('0x115')](_0x3d25b4[_0xdc5a('0x112')](_0xdc5a('0x116'))+_0xdc5a('0x117')));});};var sensitiveFields=[_0xdc5a('0x118'),_0xdc5a('0x119'),_0xdc5a('0x11a'),_0xdc5a('0x11b'),_0xdc5a('0x11c'),_0xdc5a('0x11d'),'street',_0xdc5a('0x11e'),_0xdc5a('0x11f'),_0xdc5a('0x120'),_0xdc5a('0x121'),_0xdc5a('0x122'),_0xdc5a('0x123'),_0xdc5a('0x124'),_0xdc5a('0x125'),_0xdc5a('0x126'),_0xdc5a('0x127'),_0xdc5a('0x128'),_0xdc5a('0x129'),_0xdc5a('0x12a'),_0xdc5a('0x12b'),_0xdc5a('0x12c'),_0xdc5a('0x12d'),'consumerSecret','membername',_0xdc5a('0x12e'),_0xdc5a('0x12f'),'exten',_0xdc5a('0x130'),_0xdc5a('0x131'),_0xdc5a('0x132'),_0xdc5a('0x133'),_0xdc5a('0x134'),'key',_0xdc5a('0x13'),_0xdc5a('0x135'),'accountSid',_0xdc5a('0x136'),'dsn',_0xdc5a('0x137'),_0xdc5a('0x138'),_0xdc5a('0x139')];function maskSensitiveData(_0x5d558a){var _0x45681a=/(?!^)[\s\S](?!$)/g;if(!_[_0xdc5a('0x13a')](_0x5d558a))return;for(var _0x377056 in _0x5d558a){if(_[_0xdc5a('0x13b')](_0x5d558a[_0x377056])){for(var _0x3222fd=0x0;_0x3222fd<_0x5d558a[_0x377056][_0xdc5a('0x13c')];_0x3222fd++){maskSensitiveData(_0x5d558a[_0x377056][_0x3222fd]);}}else if(_[_0xdc5a('0x13a')](_0x5d558a[_0x377056])){maskSensitiveData(_0x5d558a[_0x377056]);}else if(_[_0xdc5a('0x13d')](_0x5d558a[_0x377056])){_0x5d558a[_0x377056]=_0x5d558a[_0x377056][_0xdc5a('0x13e')](/{{{/g,'@@{')['replace'](/}}}/g,_0xdc5a('0x13f'))[_0xdc5a('0x13e')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0xdc5a('0x140')](sensitiveFields,_0x377056)){_0x5d558a[_0x377056]=_0x5d558a[_0x377056][_0xdc5a('0x13e')](_0x45681a,'*');}}}} \ No newline at end of file +var _0x9ea8=['/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','apiKey','firstName','lastName','street','mobile','fax','clientId','clientSecret','securityToken','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret','registry','oldPassword','isArray','length','replace','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','auth','safeTemplate','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','inspect','device','statusCode','other','agent_id','agent_name','use','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/actions','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/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/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','./api/setting','./api/squareRecording','/api/square/messages','/api/teams','./api/team','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue'];(function(_0x5936ad,_0x199c60){var _0x26bed2=function(_0x1035c4){while(--_0x1035c4){_0x5936ad['push'](_0x5936ad['shift']());}};_0x26bed2(++_0x199c60);}(_0x9ea8,0x186));var _0x89ea=function(_0x65b059,_0xcb5a8a){_0x65b059=_0x65b059-0x0;var _0x25bd8c=_0x9ea8[_0x65b059];return _0x25bd8c;};'use strict';var _=require(_0x89ea('0x0'));var path=require(_0x89ea('0x1'));var express=require(_0x89ea('0x2'));var ewinston=require(_0x89ea('0x3'));var util=require(_0x89ea('0x4'));var errors=require(_0x89ea('0x5'));var config=require(_0x89ea('0x6'));var logger=require('./config/logger')('api');var authLogger=require(_0x89ea('0x7'))(_0x89ea('0x8'));var safeTemplate=require('./safe-template')[_0x89ea('0x9')];exports[_0x89ea('0xa')]=function(_0x7f6f7){_0x7f6f7['use'](ewinston[_0x89ea('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5d6669,_0x4d0cb4){var _0x2d27f1=_0x89ea('0xc');if(!_[_0x89ea('0xd')](_0x5d6669['body'])){_0x2d27f1+=_0x89ea('0xe');var _0x1f399f=_0x5d6669[_0x89ea('0xf')];maskSensitiveData(_0x1f399f);}return safeTemplate(util[_0x89ea('0x10')](_0x2d27f1,_0x5d6669[_0x89ea('0x11')],_0x5d6669[_0x89ea('0x12')][_0x89ea('0x13')]?_0x5d6669[_0x89ea('0x12')][_0x89ea('0x13')]:_0x5d6669[_0x89ea('0x14')][_0x89ea('0x15')]||_0x5d6669['ip'],_0x5d6669[_0x89ea('0x16')],_0x4d0cb4['statusCode'],_0x4d0cb4[_0x89ea('0x17')],_0x5d6669['user']?_0x5d6669[_0x89ea('0x18')]['id']:null,_0x5d6669['user']?_0x5d6669[_0x89ea('0x18')]['name']:null,_0x5d6669[_0x89ea('0x18')]?_0x5d6669[_0x89ea('0x18')]['role']:null,_0x1f399f?util[_0x89ea('0x19')](_0x1f399f,![],null):''));}}));_0x7f6f7['use'](ewinston[_0x89ea('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5cbf30,_0x2f6cab){var _0x34a714='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5cbf30['body']&&_0x5cbf30[_0x89ea('0xf')][_0x89ea('0x1a')]&&_0x5cbf30[_0x89ea('0xf')]['agent_id']){_0x34a714='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x89ea('0x10')](_0x34a714,_0x5cbf30[_0x89ea('0x11')],_0x5cbf30[_0x89ea('0x12')][_0x89ea('0x13')]?_0x5cbf30[_0x89ea('0x12')]['x-forwarded-for']:_0x5cbf30[_0x89ea('0x14')]['remoteAddress']||_0x5cbf30['ip'],_0x5cbf30[_0x89ea('0x16')],_0x2f6cab[_0x89ea('0x1b')],_0x2f6cab[_0x89ea('0x17')],_0x5cbf30['user']?_0x5cbf30[_0x89ea('0x18')]['id']:null,_0x5cbf30[_0x89ea('0x18')]?_0x5cbf30[_0x89ea('0x18')]['name']:null,_0x5cbf30[_0x89ea('0x18')]?_0x5cbf30['user']['role']:null,_0x5cbf30['body']&&_0x5cbf30['body']['device']?_0x5cbf30['body'][_0x89ea('0x1a')]:_0x89ea('0x1c'),_0x5cbf30[_0x89ea('0xf')]&&_0x5cbf30[_0x89ea('0xf')][_0x89ea('0x1d')]?_0x5cbf30[_0x89ea('0xf')]['agent_id']:'',_0x5cbf30[_0x89ea('0xf')]&&_0x5cbf30[_0x89ea('0xf')][_0x89ea('0x1e')]?_0x5cbf30['body'][_0x89ea('0x1e')]:'');},'ignoreRoute':function(_0x2ae7c0){var _0x363045=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x363045['test'](_0x2ae7c0[_0x89ea('0x16')]);}}));_0x7f6f7[_0x89ea('0x1f')]('/api/users',require(_0x89ea('0x20')));_0x7f6f7['use']('/api/voice/chanspy',require(_0x89ea('0x21')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x22'),require('./api/voiceContext'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x23'),require(_0x89ea('0x24')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x25'),require(_0x89ea('0x26')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x27'),require(_0x89ea('0x28')));_0x7f6f7['use'](_0x89ea('0x29'),require(_0x89ea('0x2a')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x2b'),require(_0x89ea('0x2c')));_0x7f6f7[_0x89ea('0x1f')]('/api/voice/mails',require(_0x89ea('0x2d')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x2e'),require(_0x89ea('0x2f')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x30'),require(_0x89ea('0x31')));_0x7f6f7['use'](_0x89ea('0x32'),require(_0x89ea('0x33')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x34'),require(_0x89ea('0x35')));_0x7f6f7['use'](_0x89ea('0x36'),require(_0x89ea('0x37')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x38'),require(_0x89ea('0x39')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x3a'),require(_0x89ea('0x3b')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x3c'),require(_0x89ea('0x3d')));_0x7f6f7['use'](_0x89ea('0x3e'),require(_0x89ea('0x3f')));_0x7f6f7['use'](_0x89ea('0x40'),require(_0x89ea('0x41')));_0x7f6f7['use'](_0x89ea('0x42'),require(_0x89ea('0x43')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x44'),require('./api/mailSubstatus'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x45'),require(_0x89ea('0x46')));_0x7f6f7['use'](_0x89ea('0x47'),require(_0x89ea('0x48')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x49'),require(_0x89ea('0x4a')));_0x7f6f7['use']('/api/mail/reports/queue',require(_0x89ea('0x4b')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x4c'),require(_0x89ea('0x4d')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x4e'),require(_0x89ea('0x4f')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x50'),require('./api/faxAccount'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x51'),require(_0x89ea('0x52')));_0x7f6f7['use'](_0x89ea('0x53'),require(_0x89ea('0x54')));_0x7f6f7['use'](_0x89ea('0x55'),require(_0x89ea('0x56')));_0x7f6f7['use'](_0x89ea('0x57'),require('./api/faxQueue'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x58'),require(_0x89ea('0x59')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x5a'),require(_0x89ea('0x5b')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x5c'),require(_0x89ea('0x5d')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x5e'),require(_0x89ea('0x5f')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x60'),require('./api/smsMessage'));_0x7f6f7[_0x89ea('0x1f')]('/api/sms/queues',require(_0x89ea('0x61')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x62'),require(_0x89ea('0x63')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x64'),require(_0x89ea('0x65')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x66'),require('./api/openchannelInteraction'));_0x7f6f7['use'](_0x89ea('0x67'),require(_0x89ea('0x68')));_0x7f6f7['use'](_0x89ea('0x69'),require('./api/openchannelQueue'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x6a'),require(_0x89ea('0x6b')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x6c'),require(_0x89ea('0x6d')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x6e'),require('./api/chatApplication'));_0x7f6f7[_0x89ea('0x1f')]('/api/chat/interactions',require(_0x89ea('0x6f')));_0x7f6f7['use'](_0x89ea('0x70'),require('./api/chatMessage'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x71'),require(_0x89ea('0x72')));_0x7f6f7[_0x89ea('0x1f')]('/api/chat/queues',require('./api/chatQueue'));_0x7f6f7['use'](_0x89ea('0x73'),require(_0x89ea('0x74')));_0x7f6f7[_0x89ea('0x1f')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x75'),require(_0x89ea('0x76')));_0x7f6f7['use'](_0x89ea('0x77'),require(_0x89ea('0x78')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x79'),require('./api/cmHopper'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x7a'),require(_0x89ea('0x7b')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x7c'),require(_0x89ea('0x7d')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x7e'),require('./api/cmHopperHistory'));_0x7f6f7[_0x89ea('0x1f')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x7f'),require('./api/action'));_0x7f6f7[_0x89ea('0x1f')]('/api/automations',require(_0x89ea('0x80')));_0x7f6f7[_0x89ea('0x1f')]('/api/canned_answers',require(_0x89ea('0x81')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x82'),require('./api/disposition'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x83'),require(_0x89ea('0x84')));_0x7f6f7[_0x89ea('0x1f')]('/api/intervals',require(_0x89ea('0x85')));_0x7f6f7[_0x89ea('0x1f')]('/api/pauses',require(_0x89ea('0x86')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x87'),require(_0x89ea('0x88')));_0x7f6f7['use']('/api/voiceQueuesLog',require(_0x89ea('0x89')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x8a'),require('./api/schedule'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x8b'),require(_0x89ea('0x8c')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x8d'),require(_0x89ea('0x8e')));_0x7f6f7[_0x89ea('0x1f')]('/api/templates',require('./api/template'));_0x7f6f7[_0x89ea('0x1f')]('/api/triggers',require(_0x89ea('0x8f')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x90'),require(_0x89ea('0x91')));_0x7f6f7['use'](_0x89ea('0x92'),require('./api/integration'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x93'),require(_0x89ea('0x94')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x95'),require('./api/analyticCustomReport'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x96'),require('./api/analyticDefaultReport'));_0x7f6f7['use'](_0x89ea('0x97'),require(_0x89ea('0x98')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x99'),require('./api/analyticMetric'));_0x7f6f7['use'](_0x89ea('0x9a'),require(_0x89ea('0x9b')));_0x7f6f7[_0x89ea('0x1f')]('/api/analytics/tree_reports',require(_0x89ea('0x9c')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x9d'),require(_0x89ea('0x9e')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x9f'),require(_0x89ea('0xa0')));_0x7f6f7[_0x89ea('0x1f')]('/api/integrations/salesforce/fields',require(_0x89ea('0xa1')));_0x7f6f7['use']('/api/integrations/sugarcrm/accounts',require(_0x89ea('0xa2')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xa3'),require('./api/intSugarcrmConfiguration'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xa4'),require('./api/intSugarcrmField'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xa5'),require(_0x89ea('0xa6')));_0x7f6f7['use'](_0x89ea('0xa7'),require(_0x89ea('0xa8')));_0x7f6f7['use'](_0x89ea('0xa9'),require(_0x89ea('0xaa')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xab'),require(_0x89ea('0xac')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xad'),require(_0x89ea('0xae')));_0x7f6f7['use'](_0x89ea('0xaf'),require(_0x89ea('0xb0')));_0x7f6f7[_0x89ea('0x1f')]('/api/integrations/zendesk/accounts',require(_0x89ea('0xb1')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xb2'),require(_0x89ea('0xb3')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xb4'),require(_0x89ea('0xb5')));_0x7f6f7[_0x89ea('0x1f')]('/api/integrations/freshdesk/accounts',require(_0x89ea('0xb6')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xb7'),require(_0x89ea('0xb8')));_0x7f6f7['use'](_0x89ea('0xb9'),require(_0x89ea('0xba')));_0x7f6f7[_0x89ea('0x1f')]('/api/integrations/vtiger/accounts',require(_0x89ea('0xbb')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xbc'),require(_0x89ea('0xbd')));_0x7f6f7[_0x89ea('0x1f')]('/api/integrations/vtiger/fields',require(_0x89ea('0xbe')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xbf'),require(_0x89ea('0xc0')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xc1'),require('./api/intServicenowConfiguration'));_0x7f6f7['use']('/api/integrations/servicenow/fields',require(_0x89ea('0xc2')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xc3'),require(_0x89ea('0xc4')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xc5'),require(_0x89ea('0xc6')));_0x7f6f7['use'](_0x89ea('0xc7'),require('./api/intDynamics365Field'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xc8'),require(_0x89ea('0xc9')));_0x7f6f7['use'](_0x89ea('0xca'),require(_0x89ea('0xcb')));_0x7f6f7['use']('/api/integrations/freshsales/fields',require(_0x89ea('0xcc')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xcd'),require(_0x89ea('0xce')));_0x7f6f7[_0x89ea('0x1f')]('/api/chat/reports/queue',require(_0x89ea('0xcf')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xd0'),require(_0x89ea('0xd1')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xd2'),require(_0x89ea('0xd3')));_0x7f6f7['use']('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x7f6f7['use'](_0x89ea('0xd4'),require(_0x89ea('0xd5')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xd6'),require(_0x89ea('0xd7')));_0x7f6f7['use']('/api/square/reports',require(_0x89ea('0xd8')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xd9'),require(_0x89ea('0xda')));_0x7f6f7[_0x89ea('0x1f')]('/api/jscripty/projects',require(_0x89ea('0xdb')));_0x7f6f7['use']('/api/settings',require(_0x89ea('0xdc')));_0x7f6f7[_0x89ea('0x1f')]('/api/square/odbc',require('./api/squareOdbc'));_0x7f6f7[_0x89ea('0x1f')]('/api/square/projects',require('./api/squareProject'));_0x7f6f7['use']('/api/square/recordings',require(_0x89ea('0xdd')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xde'),require('./api/squareMessage'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xdf'),require(_0x89ea('0xe0')));_0x7f6f7[_0x89ea('0x1f')]('/api/license',require(_0x89ea('0xe1')));_0x7f6f7['use']('/api/campaigns',require(_0x89ea('0xe2')));_0x7f6f7[_0x89ea('0x1f')]('/api/migrations',require(_0x89ea('0xe3')));_0x7f6f7['use'](_0x89ea('0xe4'),require(_0x89ea('0xe5')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xe6'),require(_0x89ea('0xe7')));_0x7f6f7['use'](_0x89ea('0xe8'),require('./api/mailTransferReport'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xe9'),require(_0x89ea('0xea')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xeb'),require('./api/faxTransferReport'));_0x7f6f7[_0x89ea('0x1f')]('/api/openchannel/reports/transfer',require(_0x89ea('0xec')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xed'),require(_0x89ea('0xee')));_0x7f6f7['use'](_0x89ea('0xef'),require('./api/cmList'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xf0'),require(_0x89ea('0xf1')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xf2'),require(_0x89ea('0xf3')));_0x7f6f7['use'](_0x89ea('0xf4'),require(_0x89ea('0xf5')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xf6'),require(_0x89ea('0xf7')));_0x7f6f7[_0x89ea('0x1f')]('/api/userNotifications',require(_0x89ea('0xf8')));_0x7f6f7[_0x89ea('0x1f')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x7f6f7['use'](_0x89ea('0xf9'),require(_0x89ea('0xfa')));_0x7f6f7[_0x89ea('0x1f')]('/api/whatsapp/interactions',require(_0x89ea('0xfb')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0xfc'),require(_0x89ea('0xfd')));_0x7f6f7[_0x89ea('0x1f')]('/api/whatsapp/reports/queue',require(_0x89ea('0xfe')));_0x7f6f7[_0x89ea('0x1f')]('/api/whatsapp/reports/transfer',require(_0x89ea('0xff')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x100'),require(_0x89ea('0x101')));_0x7f6f7['use'](_0x89ea('0x102'),require('./api/cloudProvider'));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x103'),require(_0x89ea('0x104')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x105'),require(_0x89ea('0x106')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x107'),require(_0x89ea('0x108')));_0x7f6f7[_0x89ea('0x1f')]('/api/jira',require(_0x89ea('0x109')));_0x7f6f7['use'](_0x89ea('0x10a'),require(_0x89ea('0x10b')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x10c'),require(_0x89ea('0x10d')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x10e'),require(_0x89ea('0x10f')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x110'),require(_0x89ea('0x111')));_0x7f6f7['use'](_0x89ea('0x112'),require(_0x89ea('0x113')));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x114'),express[_0x89ea('0x115')](path[_0x89ea('0x116')](config[_0x89ea('0x117')],'/apidoc')));_0x7f6f7['use'](_0x89ea('0x118'),express['static'](path[_0x89ea('0x116')](config['root'],_0x89ea('0x118'))));_0x7f6f7[_0x89ea('0x1f')]('/demo',express[_0x89ea('0x115')](path[_0x89ea('0x116')](config[_0x89ea('0x117')],_0x89ea('0x119'))));_0x7f6f7['use'](_0x89ea('0x11a'),express['static'](path[_0x89ea('0x116')](config['root'],'snippet',_0x89ea('0x11b'))));_0x7f6f7[_0x89ea('0x1f')](_0x89ea('0x11c'),express[_0x89ea('0x115')](path[_0x89ea('0x116')](config[_0x89ea('0x117')],_0x89ea('0x11d'))));_0x7f6f7[_0x89ea('0x11e')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x89ea('0x11f')](errors[0x194]);_0x7f6f7[_0x89ea('0x11e')]('/*')[_0x89ea('0x11f')](function(_0xc0c61e,_0x31ea3e){_0x31ea3e[_0x89ea('0x120')](path[_0x89ea('0x121')](_0x7f6f7['get'](_0x89ea('0x122'))+_0x89ea('0x123')));});};var sensitiveFields=[_0x89ea('0x124'),'password','newPassword',_0x89ea('0x125'),_0x89ea('0x126'),_0x89ea('0x127'),_0x89ea('0x128'),'phone',_0x89ea('0x129'),_0x89ea('0x12a'),'email',_0x89ea('0x12b'),_0x89ea('0x12c'),_0x89ea('0x12d'),'code','accessKey','tenantId','token',_0x89ea('0x12e'),'accessToken',_0x89ea('0x12f'),_0x89ea('0x130'),_0x89ea('0x131'),_0x89ea('0x132'),'membername',_0x89ea('0x133'),_0x89ea('0x134'),_0x89ea('0x135'),'vidaooApiKey',_0x89ea('0x136'),_0x89ea('0x137'),_0x89ea('0x138'),_0x89ea('0x139'),_0x89ea('0x13a'),_0x89ea('0x18'),'pass',_0x89ea('0x13b'),_0x89ea('0x13c'),_0x89ea('0x13d'),_0x89ea('0x13e'),_0x89ea('0x13f'),_0x89ea('0x140')];function maskSensitiveData(_0x57aa0f){var _0xf4f4d9=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x57aa0f))return;for(var _0x3f59da in _0x57aa0f){if(_[_0x89ea('0x141')](_0x57aa0f[_0x3f59da])){for(var _0x9afba=0x0;_0x9afba<_0x57aa0f[_0x3f59da][_0x89ea('0x142')];_0x9afba++){maskSensitiveData(_0x57aa0f[_0x3f59da][_0x9afba]);}}else if(_['isPlainObject'](_0x57aa0f[_0x3f59da])){maskSensitiveData(_0x57aa0f[_0x3f59da]);}else if(_['isString'](_0x57aa0f[_0x3f59da])){_0x57aa0f[_0x3f59da]=_0x57aa0f[_0x3f59da][_0x89ea('0x143')](/{{{/g,'@@{')[_0x89ea('0x143')](/}}}/g,'}@@')[_0x89ea('0x143')](/{{/g,'@{')[_0x89ea('0x143')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x3f59da)){_0x57aa0f[_0x3f59da]=_0x57aa0f[_0x3f59da][_0x89ea('0x143')](_0xf4f4d9,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0bfafb5..ed5dc62 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5cf7=['merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/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/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','../config/environment','../api/user/user.rpc'];(function(_0xe33eca,_0x332ee5){var _0x2184d6=function(_0x49d39a){while(--_0x49d39a){_0xe33eca['push'](_0xe33eca['shift']());}};_0x2184d6(++_0x332ee5);}(_0x5cf7,0x160));var _0x75cf=function(_0x501305,_0x55b0a0){_0x501305=_0x501305-0x0;var _0x2709ca=_0x5cf7[_0x501305];return _0x2709ca;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x75cf('0x0'));var _=require('lodash');var config=require(_0x75cf('0x1'));exports['listen']=function(){return new BPromise(function(_0x11eafd,_0x107191){var _0x48d7b7={};_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x2')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x4')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x5')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/voiceRecording/voiceRecording.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x6')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x7')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x8')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x9')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/trunk/trunk.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xa')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xb')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xc')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xd')));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/mailQueue/mailQueue.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xe')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/mailMessage/mailMessage.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0xf')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/faxAccount/faxAccount.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x10')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x11')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x12')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x13')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x14')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/smsAccount/smsAccount.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x15')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x16')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x17')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x18')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x19')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/chatInteraction/chatInteraction.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1a')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/chatQueue/chatQueue.rpc'));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1b')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1c')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1d')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1e')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x1f')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x20')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x21')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x22')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x23')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x24')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x25')));_0x48d7b7=_['merge'](_0x48d7b7,require('../api/variable/variable.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x26')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x27')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x28')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x29')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2a')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2b')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2c')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x2d')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x2e')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x2f')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x30')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x31')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x32')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x33')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x34')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x35')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x36')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x37')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x38')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x39')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3a')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3b')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x3c')));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3d')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require(_0x75cf('0x3e')));_0x48d7b7=_[_0x75cf('0x3')](_0x48d7b7,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x48d7b7=_['merge'](_0x48d7b7,require(_0x75cf('0x3f')));var _0x3f593d=jayson[_0x75cf('0x40')](_0x48d7b7)[_0x75cf('0x41')]();var _0x3bdcbf=config[_0x75cf('0x42')][_0x75cf('0x43')]||config[_0x75cf('0x43')]+0x1;var _0x5ba2aa=config['rpc']['ip']||'localhost';_0x3f593d['on']('error',function(_0x49a29b){return _0x107191(_0x49a29b);});_0x3f593d['listen'](_0x3bdcbf,_0x5ba2aa,function(){console['log'](_0x75cf('0x44'),_0x5ba2aa,_0x3bdcbf);require(_0x75cf('0x45'))['default']();return _0x11eafd(_0x75cf('0x46')+_0x5ba2aa+':'+_0x3bdcbf);});});}; \ No newline at end of file +var _0x35fa=['listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.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/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.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','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment'];(function(_0x4ce885,_0x4a64c6){var _0x189899=function(_0x12ebb2){while(--_0x12ebb2){_0x4ce885['push'](_0x4ce885['shift']());}};_0x189899(++_0x4a64c6);}(_0x35fa,0x128));var _0xa35f=function(_0x55fcfe,_0x55fc30){_0x55fcfe=_0x55fcfe-0x0;var _0x170825=_0x35fa[_0x55fcfe];return _0x170825;};'use strict';var jayson=require(_0xa35f('0x0'));var BPromise=require(_0xa35f('0x1'));var _=require(_0xa35f('0x2'));var config=require(_0xa35f('0x3'));exports[_0xa35f('0x4')]=function(){return new BPromise(function(_0x12eef1,_0x405624){var _0x1a4de9={};_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/user/user.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x6')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x7')));_0x1a4de9=_['merge'](_0x1a4de9,require('../api/voiceRecording/voiceRecording.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x8')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x9')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0xa')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0xb')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0xc')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0xd')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0xe')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0xf')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x10')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x11')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x12')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x13')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x14')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x15')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x16')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x17')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x18')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x19')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x1a')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x1b')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x1c')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x1d')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/smsMessage/smsMessage.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/smsQueue/smsQueue.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x1e')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x1f')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x20')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x21')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/chatInteraction/chatInteraction.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/chatMessage/chatMessage.rpc'));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x22')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x23')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x24')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x25')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x26')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x27')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x28')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x29')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x2a')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x2b')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x2c')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/variable/variable.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1a4de9=_['merge'](_0x1a4de9,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x2d')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x2e')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x2f')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x30')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x31')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x32')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x33')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x34')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x35')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x36')));_0x1a4de9=_['merge'](_0x1a4de9,require('../api/squareOdbc/squareOdbc.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x37')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x38')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x39')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x3a')));_0x1a4de9=_['merge'](_0x1a4de9,require('../api/attachment/attachment.rpc'));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x3b')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x3c')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x3d')));_0x1a4de9=_['merge'](_0x1a4de9,require(_0xa35f('0x3e')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x3f')));_0x1a4de9=_[_0xa35f('0x5')](_0x1a4de9,require(_0xa35f('0x40')));var _0x1c509e=jayson[_0xa35f('0x41')](_0x1a4de9)[_0xa35f('0x42')]();var _0x13d04c=config[_0xa35f('0x43')][_0xa35f('0x44')]||config[_0xa35f('0x44')]+0x1;var _0x123b28=config['rpc']['ip']||_0xa35f('0x45');_0x1c509e['on']('error',function(_0x1c36b5){return _0x405624(_0x1c36b5);});_0x1c509e[_0xa35f('0x4')](_0x13d04c,_0x123b28,function(){console[_0xa35f('0x46')](_0xa35f('0x47'),_0x123b28,_0x13d04c);require(_0xa35f('0x48'))[_0xa35f('0x49')]();return _0x12eef1(_0xa35f('0x4a')+_0x123b28+':'+_0x13d04c);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 111eb74..e207cf0 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x4b964f,_0x688bee){var _0x4a8f98=function(_0x911a0d){while(--_0x911a0d){_0x4b964f['push'](_0x4b964f['shift']());}};_0x4a8f98(++_0x688bee);}(_0xb62e,0x1de));var _0xeb62=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb62e[_0x2d7f0e];return _0x110b07;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate; \ No newline at end of file +var _0xd4a2=['exports','safeTemplate','lodash','\x20}\x20}','replace','map','isPlainObject','keys','reduce'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x511536,_0x237704){_0x511536=_0x511536-0x0;var _0x2af84a=_0xd4a2[_0x511536];return _0x2af84a;};var _=require(_0x2d4a('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5d70e1){return _0x5d70e1==='{{'?'{\x20{\x20':_0x2d4a('0x1');}function safeTemplate(_0x576ffe){var _0x2a8a71=_0x576ffe;if(typeof _0x576ffe==='string'){_0x2a8a71=_0x576ffe[_0x2d4a('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x576ffe)){_0x2a8a71=_0x576ffe[_0x2d4a('0x3')](function(_0x40d744){return safeTemplate(_0x40d744);});}else if(_[_0x2d4a('0x4')](_0x576ffe)){_0x2a8a71=Object[_0x2d4a('0x5')](_0x576ffe)[_0x2d4a('0x6')](function(_0x57058f,_0x45fefb){_0x57058f[_0x45fefb]=safeTemplate(_0x576ffe[_0x45fefb]);return _0x57058f;},{});}return _0x2a8a71;}module[_0x2d4a('0x7')][_0x2d4a('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0a025a4..122ec9c 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 _0x20de=['GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','emit','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','function','destroy','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','exec','EXEC\x20%s\x20%s','join','setContext','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x20de,0x134));var _0xe20d=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x20de[_0x2b9b7f];return _0x4ed19a;};'use strict';var util=require(_0xe20d('0x0'));var _=require('lodash');var EventEmitter=require(_0xe20d('0x1'))[_0xe20d('0x2')];var AGIReply=require(_0xe20d('0x3'));var AGIError=require(_0xe20d('0x4'));function AGIChannel(_0x9a0b77){var _0x39a7f3=this,_0x31c533=new AGIReply(),_0x174186=![],_0x7b02d6={};EventEmitter[_0xe20d('0x5')](_0x39a7f3);_0x9a0b77[_0xe20d('0x6')]('utf8');_0x9a0b77[_0xe20d('0x7')](0x8*0x3c*0x3c*0x3e8);_0x31c533['setEncoding']('utf8');_0x31c533['on']('headers',function(_0x110ff5){for(var _0x164d5e in _0x110ff5){_0x39a7f3[_0x164d5e]=_0x110ff5[_0x164d5e];}_0x39a7f3[_0xe20d('0x8')]('ready');});_0x31c533['on'](_0xe20d('0x9'),function(_0x2df52b){if(_0x2df52b['toLowerCase']()==_0xe20d('0xa')){_0x39a7f3[_0xe20d('0x8')]('hangup');return;}if(_0x2df52b[_0xe20d('0xb')](0x0,0xb)==_0xe20d('0xc')){_0x174186=!![];}if(_0x174186){_0x7b02d6['rx']+=_0x2df52b+'\x0a';if(_0x2df52b[_0xe20d('0xd')](_0xe20d('0xe'))!=-0x1){_0x174186=![];}}else{_0x7b02d6['rx']=_0x2df52b;}if(_0x174186){return;}if(typeof _0x7b02d6['cb']=='function'){var _0x59a581=_0x7b02d6['rx'][_0xe20d('0xb')](0x0,0x3),_0x28d9c5=null,_0xdc395e=null;_0x59a581=parseInt(_0x59a581);if(isNaN(_0x59a581)){_0x7b02d6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe20d('0xf')});return;}if(_0x59a581!=0xc8){_0x7b02d6['cb'](null,{'code':_0x59a581,'result':-0x1,'extra':'KO'});return;}_0x28d9c5=_0x7b02d6['rx'][_0xe20d('0xb')](0x4)[_0xe20d('0x10')](_0xe20d('0x11'),'');if(_0x28d9c5[_0xe20d('0x12')]('\x20')!=-0x1){_0x28d9c5=_0x28d9c5[_0xe20d('0x13')](0x0,_0x28d9c5['indexOf']('\x20'));}if(_[_0xe20d('0x14')](_0x28d9c5,'-1')){_0x28d9c5=parseInt(_0x28d9c5);}_0xdc395e=_0x7b02d6['rx']['split']('\x20');if(_0xdc395e[_0xe20d('0x15')]==0x3){_0xdc395e=_0xdc395e[0x2][_0xe20d('0xb')](0x1,_0xdc395e[0x2][_0xe20d('0x15')]-0x1);}else if(_0xdc395e['length']>0x3){var _0x1d6179=/\((.+)\)/;var _0x47fdd9=_0x7b02d6['rx'][_0xe20d('0x16')](_0x1d6179);if(_0x47fdd9){_0xdc395e=_0x47fdd9[0x1];}else{_0xdc395e=null;}}else{_0xdc395e=null;}_0x7b02d6['cb'](null,{'code':_0x59a581,'result':_0x28d9c5,'extra':_0xdc395e});}});_0x9a0b77['on'](_0xe20d('0x17'),function(_0x285916){_0x39a7f3['emit'](_0xe20d('0x17'),new AGIError(_0xe20d('0x18'),_0x285916[_0xe20d('0x19')]));});_0x9a0b77['on'](_0xe20d('0x1a'),function(){_0x39a7f3['emit'](_0xe20d('0x1a'),new AGIError(_0xe20d('0x1b')));});_0x9a0b77['on'](_0xe20d('0x1c'),function(){_0x39a7f3[_0xe20d('0x8')]('timeout',new AGIError(_0xe20d('0x1d')));_0x9a0b77['destroy']();});_0x9a0b77['pipe'](_0x31c533);this[_0xe20d('0x1e')]=function(_0x4045b3,_0x4baa28){var _0x4045b3=_0x4045b3||'',_0x4baa28=typeof _0x4baa28==_0xe20d('0x1f')?_0x4baa28:new Function();_0x7b02d6={'tx':_0x4045b3,'rx':'','cb':_0x4baa28};_0x9a0b77['write'](_0x4045b3+'\x0a');},this[_0xe20d('0x1a')]=function(){_0x9a0b77[_0xe20d('0x20')]();};}util[_0xe20d('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xe20d('0x22')][_0xe20d('0x23')]=function(_0x5de788){return this[_0xe20d('0x1e')][_0xe20d('0x24')](this,_0x5de788);};AGIChannel[_0xe20d('0x22')][_0xe20d('0x25')]=function(){return this[_0xe20d('0x23')]('ANSWER');};AGIChannel['prototype'][_0xe20d('0x26')]=function(_0x497726,_0x25772d,_0x20845d){_0x497726=_0x497726===undefined?_0xe20d('0x27'):_0x497726;_0x25772d=_0x25772d===undefined?'5':_0x25772d;_0x20845d=_0x20845d===undefined?'1':_0x20845d;return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x29'),_0x497726,_0x25772d*0x3e8,_0x20845d));};AGIChannel[_0xe20d('0x22')]['noop']=function(_0x8b7386){_0x8b7386=_0x8b7386||'NO\x20MESSAGE';return this['sendRequest'](util['format']('VERBOSE\x20\x22%s\x22',_0x8b7386));};AGIChannel['prototype'][_0xe20d('0x2a')]=function(_0x1387dd,_0x41e140){if(_['isArray'](_0x41e140)){return this['sendRequest'](util[_0xe20d('0x28')](_0xe20d('0x2b'),_0x1387dd,_0x41e140[_0xe20d('0x2c')](',')));}return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x2b'),_0x1387dd,_0x41e140));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x2d')]=function(_0x494df3){return this[_0xe20d('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0x494df3));};AGIChannel[_0xe20d('0x22')]['setExtension']=function(_0x1da98b){return this[_0xe20d('0x23')](util['format']('SET\x20EXTENSION\x20%s',_0x1da98b));};AGIChannel['prototype'][_0xe20d('0x2e')]=function(_0x163704){return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x2f'),_0x163704));};AGIChannel[_0xe20d('0x22')]['hangup']=function(){return this[_0xe20d('0x23')](_0xe20d('0x30'));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x31')]=function(_0x5ef97c,_0x1da5bf){var _0x19b190=_[_0xe20d('0x32')](_0x1da5bf)||_[_0xe20d('0x33')](_0x1da5bf)?_0x1da5bf['toString']():_0x1da5bf;return this['sendRequest'](util[_0xe20d('0x28')](_0xe20d('0x34'),_0x5ef97c,_0x19b190?_0x19b190['toString']()[_0xe20d('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x35')]=function(_0x325827,_0x118f05){return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x36'),_0x325827,_0x118f05));};AGIChannel['prototype']['sayDigits']=function(_0x5f53dd,_0x1733e3){return this[_0xe20d('0x23')](util['format'](_0xe20d('0x37'),_0x5f53dd,_0x1733e3));};AGIChannel[_0xe20d('0x22')]['sayPhonetic']=function(_0x589980,_0x19db52){return this['sendRequest'](util[_0xe20d('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x589980,_0x19db52));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x38')]=function(_0x4d0716,_0x22a41d,_0x1b36ed){_0x22a41d=_0x22a41d||this[_0xe20d('0x39')];_0x1b36ed=_0x1b36ed||0x1;this['setContext'](_0x4d0716);this[_0xe20d('0x3a')](_0x22a41d);this[_0xe20d('0x2e')](_0x1b36ed);return this[_0xe20d('0x3b')](util[_0xe20d('0x28')](_0xe20d('0x3c'),_0x4d0716,_0x22a41d,_0x1b36ed));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x3d')]=function(_0x340c88){return this[_0xe20d('0x23')](util['format'](_0xe20d('0x3e'),_0x340c88));};AGIChannel['prototype'][_0xe20d('0x3f')]=function(_0x33896e,_0x1a01cc,_0x2f2253,_0x169cc4,_0x5d47c7,_0xfc9228){_0x1a01cc=_0x1a01cc||_0xe20d('0x40');_0x2f2253=_0x2f2253||'';_0x169cc4=_0x169cc4===undefined?-0x1:_0x169cc4==='-1'?-0x1:_0x169cc4*0x3e8;_0x5d47c7=_0x5d47c7===undefined?'':'s='+_0x5d47c7;_0xfc9228=_0xfc9228?_0xe20d('0x41'):'';return this[_0xe20d('0x23')](util[_0xe20d('0x28')](_0xe20d('0x42'),_0x33896e,_0x1a01cc,_0x2f2253,_0x169cc4,_0xfc9228,_0x5d47c7));};AGIChannel['prototype'][_0xe20d('0x43')]=function(_0x366a74,_0x2cbaf8){_0x2cbaf8=_0x2cbaf8||'';return this[_0xe20d('0x23')](util[_0xe20d('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x366a74,_0x2cbaf8));};AGIChannel[_0xe20d('0x22')][_0xe20d('0x44')]=function(_0x137dc0){return this['exec']('AGI',_0x137dc0);};AGIChannel[_0xe20d('0x22')][_0xe20d('0x45')]=function(_0x355dd8){return this[_0xe20d('0x2a')](_0xe20d('0x46'),_0x355dd8);};AGIChannel[_0xe20d('0x22')][_0xe20d('0x17')]=function(_0x4aa0b5,_0x1f37c1){this['noop'](util[_0xe20d('0x28')](_0xe20d('0x47'),_0x4aa0b5['id'],_0x4aa0b5[_0xe20d('0x48')],_0x1f37c1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xe20d('0x49')]=AGIChannel; \ No newline at end of file +var _0x3d3d=['answer','beep','format','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','lodash','events','./reply','./error','call','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','function','replace','result=','substr','split','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','destroy','write','inherits','prototype','sendRequest','command','sync'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0xd3d3('0x0'));var EventEmitter=require(_0xd3d3('0x1'))['EventEmitter'];var AGIReply=require(_0xd3d3('0x2'));var AGIError=require(_0xd3d3('0x3'));function AGIChannel(_0x3ada8f){var _0x427bd5=this,_0x1f03e9=new AGIReply(),_0x46aa0c=![],_0x3b43f2={};EventEmitter[_0xd3d3('0x4')](_0x427bd5);_0x3ada8f[_0xd3d3('0x5')](_0xd3d3('0x6'));_0x3ada8f['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1f03e9[_0xd3d3('0x5')](_0xd3d3('0x6'));_0x1f03e9['on'](_0xd3d3('0x7'),function(_0x2ed96f){for(var _0x578050 in _0x2ed96f){_0x427bd5[_0x578050]=_0x2ed96f[_0x578050];}_0x427bd5[_0xd3d3('0x8')](_0xd3d3('0x9'));});_0x1f03e9['on'](_0xd3d3('0xa'),function(_0x300cba){if(_0x300cba['toLowerCase']()==_0xd3d3('0xb')){_0x427bd5[_0xd3d3('0x8')](_0xd3d3('0xb'));return;}if(_0x300cba[_0xd3d3('0xc')](0x0,0xb)==_0xd3d3('0xd')){_0x46aa0c=!![];}if(_0x46aa0c){_0x3b43f2['rx']+=_0x300cba+'\x0a';if(_0x300cba[_0xd3d3('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x46aa0c=![];}}else{_0x3b43f2['rx']=_0x300cba;}if(_0x46aa0c){return;}if(typeof _0x3b43f2['cb']==_0xd3d3('0xf')){var _0x517d31=_0x3b43f2['rx'][_0xd3d3('0xc')](0x0,0x3),_0x4c4876=null,_0x4b197f=null;_0x517d31=parseInt(_0x517d31);if(isNaN(_0x517d31)){_0x3b43f2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x517d31!=0xc8){_0x3b43f2['cb'](null,{'code':_0x517d31,'result':-0x1,'extra':'KO'});return;}_0x4c4876=_0x3b43f2['rx']['substring'](0x4)[_0xd3d3('0x10')](_0xd3d3('0x11'),'');if(_0x4c4876['indexOf']('\x20')!=-0x1){_0x4c4876=_0x4c4876[_0xd3d3('0x12')](0x0,_0x4c4876['indexOf']('\x20'));}if(_['startsWith'](_0x4c4876,'-1')){_0x4c4876=parseInt(_0x4c4876);}_0x4b197f=_0x3b43f2['rx'][_0xd3d3('0x13')]('\x20');if(_0x4b197f[_0xd3d3('0x14')]==0x3){_0x4b197f=_0x4b197f[0x2][_0xd3d3('0xc')](0x1,_0x4b197f[0x2][_0xd3d3('0x14')]-0x1);}else if(_0x4b197f[_0xd3d3('0x14')]>0x3){var _0x5c3462=/\((.+)\)/;var _0x214520=_0x3b43f2['rx'][_0xd3d3('0x15')](_0x5c3462);if(_0x214520){_0x4b197f=_0x214520[0x1];}else{_0x4b197f=null;}}else{_0x4b197f=null;}_0x3b43f2['cb'](null,{'code':_0x517d31,'result':_0x4c4876,'extra':_0x4b197f});}});_0x3ada8f['on']('error',function(_0x4c18e3){_0x427bd5[_0xd3d3('0x8')](_0xd3d3('0x16'),new AGIError(_0xd3d3('0x17'),_0x4c18e3['code']));});_0x3ada8f['on'](_0xd3d3('0x18'),function(){_0x427bd5[_0xd3d3('0x8')](_0xd3d3('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3ada8f['on'](_0xd3d3('0x19'),function(){_0x427bd5[_0xd3d3('0x8')](_0xd3d3('0x19'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3ada8f[_0xd3d3('0x1a')]();});_0x3ada8f['pipe'](_0x1f03e9);this['command']=function(_0x3b758c,_0x45e696){var _0x3b758c=_0x3b758c||'',_0x45e696=typeof _0x45e696=='function'?_0x45e696:new Function();_0x3b43f2={'tx':_0x3b758c,'rx':'','cb':_0x45e696};_0x3ada8f[_0xd3d3('0x1b')](_0x3b758c+'\x0a');},this[_0xd3d3('0x18')]=function(){_0x3ada8f[_0xd3d3('0x1a')]();};}util[_0xd3d3('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x1e')]=function(_0x94bc1e){return this[_0xd3d3('0x1f')][_0xd3d3('0x20')](this,_0x94bc1e);};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x21')]=function(){return this[_0xd3d3('0x1e')]('ANSWER');};AGIChannel[_0xd3d3('0x1d')]['getData']=function(_0x400a14,_0x729f67,_0x499da7){_0x400a14=_0x400a14===undefined?_0xd3d3('0x22'):_0x400a14;_0x729f67=_0x729f67===undefined?'5':_0x729f67;_0x499da7=_0x499da7===undefined?'1':_0x499da7;return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x400a14,_0x729f67*0x3e8,_0x499da7));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x24')]=function(_0xcf96d3){_0xcf96d3=_0xcf96d3||'NO\x20MESSAGE';return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')](_0xd3d3('0x25'),_0xcf96d3));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x26')]=function(_0x230be5,_0x325185){if(_[_0xd3d3('0x27')](_0x325185)){return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')](_0xd3d3('0x28'),_0x230be5,_0x325185[_0xd3d3('0x29')](',')));}return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')]('EXEC\x20%s\x20%s',_0x230be5,_0x325185));};AGIChannel['prototype'][_0xd3d3('0x2a')]=function(_0x4007de){return this['sendRequest'](util[_0xd3d3('0x23')](_0xd3d3('0x2b'),_0x4007de));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x2c')]=function(_0x427e32){return this['sendRequest'](util[_0xd3d3('0x23')]('SET\x20EXTENSION\x20%s',_0x427e32));};AGIChannel['prototype'][_0xd3d3('0x2d')]=function(_0x48e246){return this[_0xd3d3('0x1e')](util['format'](_0xd3d3('0x2e'),_0x48e246));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0xb')]=function(){return this[_0xd3d3('0x1e')](_0xd3d3('0x2f'));};AGIChannel['prototype'][_0xd3d3('0x30')]=function(_0xd7568c,_0x2d4942){var _0x19679f=_[_0xd3d3('0x31')](_0x2d4942)||_[_0xd3d3('0x32')](_0x2d4942)?_0x2d4942[_0xd3d3('0x33')]():_0x2d4942;return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xd7568c,_0x19679f?_0x19679f[_0xd3d3('0x33')]()[_0xd3d3('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x34')]=function(_0xd6acaf,_0x5779ec){return this['sendRequest'](util[_0xd3d3('0x23')](_0xd3d3('0x35'),_0xd6acaf,_0x5779ec));};AGIChannel['prototype'][_0xd3d3('0x36')]=function(_0x32afe9,_0x1bf017){return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')](_0xd3d3('0x37'),_0x32afe9,_0x1bf017));};AGIChannel[_0xd3d3('0x1d')]['sayPhonetic']=function(_0x5f3513,_0x23c5c5){return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')](_0xd3d3('0x38'),_0x5f3513,_0x23c5c5));};AGIChannel['prototype']['continueAt']=function(_0x5b2d86,_0x4d047b,_0x5e591d){_0x4d047b=_0x4d047b||this['extension'];_0x5e591d=_0x5e591d||0x1;this['setContext'](_0x5b2d86);this['setExtension'](_0x4d047b);this[_0xd3d3('0x2d')](_0x5e591d);return this[_0xd3d3('0x24')](util[_0xd3d3('0x23')](_0xd3d3('0x39'),_0x5b2d86,_0x4d047b,_0x5e591d));};AGIChannel['prototype']['getVariable']=function(_0x50cb32){return this[_0xd3d3('0x1e')](util['format'](_0xd3d3('0x3a'),_0x50cb32));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x3b')]=function(_0x1f07af,_0x1b5095,_0x5e1121,_0x3c5f39,_0x534a5e,_0x261654){_0x1b5095=_0x1b5095||'wav';_0x5e1121=_0x5e1121||'';_0x3c5f39=_0x3c5f39===undefined?-0x1:_0x3c5f39==='-1'?-0x1:_0x3c5f39*0x3e8;_0x534a5e=_0x534a5e===undefined?'':'s='+_0x534a5e;_0x261654=_0x261654?_0xd3d3('0x3c'):'';return this['sendRequest'](util[_0xd3d3('0x23')](_0xd3d3('0x3d'),_0x1f07af,_0x1b5095,_0x5e1121,_0x3c5f39,_0x261654,_0x534a5e));};AGIChannel['prototype']['streamFile']=function(_0x3cac3a,_0x4cf2d6){_0x4cf2d6=_0x4cf2d6||'';return this[_0xd3d3('0x1e')](util[_0xd3d3('0x23')](_0xd3d3('0x3e'),_0x3cac3a,_0x4cf2d6));};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x3f')]=function(_0x5bbd35){return this[_0xd3d3('0x26')](_0xd3d3('0x40'),_0x5bbd35);};AGIChannel['prototype']['wait']=function(_0x3c54f4){return this[_0xd3d3('0x26')](_0xd3d3('0x41'),_0x3c54f4);};AGIChannel[_0xd3d3('0x1d')][_0xd3d3('0x16')]=function(_0x3938e3,_0x5b410a){this[_0xd3d3('0x24')](util[_0xd3d3('0x23')](_0xd3d3('0x42'),_0x3938e3['id'],_0x3938e3[_0xd3d3('0x43')],_0x5b410a));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ff7cbbd..c419f62 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 _0xdd75=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x41e6c0,_0x4a56d4){var _0xc1411e=function(_0x10f797){while(--_0x10f797){_0x41e6c0['push'](_0x41e6c0['shift']());}};_0xc1411e(++_0x4a56d4);}(_0xdd75,0x1bd));var _0x5dd7=function(_0xc3f0cd,_0x3886a2){_0xc3f0cd=_0xc3f0cd-0x0;var _0x14a8c4=_0xdd75[_0xc3f0cd];return _0x14a8c4;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5dd7('0x0'),'E_AGI_ARGUMENT_PORT':_0x5dd7('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x5dd7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x5dd7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x5dd7('0x4'),'E_AGI_SOCKET_ERROR':_0x5dd7('0x5'),'E_AGI_SOCKET_CLOSE':_0x5dd7('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x5dd7('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5dd7('0x8')};function AGIError(_0x28c7a6){var _0x28c7a6=_0x28c7a6||null,_0x245f04=_0x245f04||[],_0x574969=0x1,_0x3197df='';if(!error[_0x28c7a6]){_0x28c7a6=_0x5dd7('0x9');}_0x245f04[_0x5dd7('0xa')](error[_0x28c7a6]);while(arguments[_0x574969]){_0x245f04['push'](arguments[_0x574969]);_0x574969++;}_0x3197df=util[_0x5dd7('0xb')]['apply'](util,_0x245f04);this[_0x5dd7('0xc')]=_0x3197df;this[_0x5dd7('0xd')]=_0x28c7a6;}module[_0x5dd7('0xe')]=AGIError; \ No newline at end of file +var _0x1d1b=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x1d1b,0xf0));var _0xb1d1=function(_0x30d410,_0x11a48c){_0x30d410=_0x30d410-0x0;var _0x151ec8=_0x1d1b[_0x30d410];return _0x151ec8;};'use strict';var util=require(_0xb1d1('0x0'));var error={'E_AGI_UNDEFINED':_0xb1d1('0x1'),'E_AGI_ARGUMENT_PORT':_0xb1d1('0x2'),'E_AGI_SERVER_ERROR':_0xb1d1('0x3'),'E_AGI_SERVER_CLOSE':_0xb1d1('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xb1d1('0x5'),'E_AGI_SOCKET_ERROR':_0xb1d1('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xb1d1('0x7'),'E_AGI_COMMAND_EMPTY':_0xb1d1('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb1d1('0x9'),'E_AGI_IVR_ENTRY':_0xb1d1('0xa')};function AGIError(_0xe87519){var _0xe87519=_0xe87519||null,_0x8c5d60=_0x8c5d60||[],_0x4e59dd=0x1,_0x338357='';if(!error[_0xe87519]){_0xe87519=_0xb1d1('0xb');}_0x8c5d60[_0xb1d1('0xc')](error[_0xe87519]);while(arguments[_0x4e59dd]){_0x8c5d60[_0xb1d1('0xc')](arguments[_0x4e59dd]);_0x4e59dd++;}_0x338357=util[_0xb1d1('0xd')]['apply'](util,_0x8c5d60);this[_0xb1d1('0xe')]=_0x338357;this[_0xb1d1('0xf')]=_0xe87519;}module[_0xb1d1('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 1927193..89f24ec 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 _0x1d2b=['relations','traverseBFS','no\x20vertex\x20found','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size'];(function(_0x17045c,_0x470ebe){var _0x844ac5=function(_0x1ce250){while(--_0x1ce250){_0x17045c['push'](_0x17045c['shift']());}};_0x844ac5(++_0x470ebe);}(_0x1d2b,0x15f));var _0xb1d2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1d2b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb1d2('0x0'));var logger=require(_0xb1d2('0x1'))(_0xb1d2('0x2'));var verticesWithRetry=[_0xb1d2('0x3'),_0xb1d2('0x4'),_0xb1d2('0x5')];var Graph=function(){this[_0xb1d2('0x6')]={};this[_0xb1d2('0x7')]={};this[_0xb1d2('0x8')]=0x0;};Graph[_0xb1d2('0x9')][_0xb1d2('0xa')]=function(_0x27f9cf){this[_0xb1d2('0x6')][_0x27f9cf['id']]=_0x27f9cf;this[_0xb1d2('0x7')][_0x27f9cf['id']]=[];};Graph[_0xb1d2('0x9')][_0xb1d2('0xb')]=function(_0xc5adb9,_0x5e1c70,_0x370da3){this[_0xb1d2('0x7')][_0xc5adb9]['push']({'target':_0x5e1c70,'condition':_0x370da3});this['numberOfEdges']+=0x1;};Graph[_0xb1d2('0x9')][_0xb1d2('0xc')]=function(){return _['size'](this[_0xb1d2('0x6')]);};Graph[_0xb1d2('0x9')][_0xb1d2('0xd')]=function(){return this['numberOfEdges'];};Graph[_0xb1d2('0x9')]['getVertex']=function(_0x428bf9){return this['vertices'][_0x428bf9];};Graph['prototype'][_0xb1d2('0xe')]=function(_0x1d06b7,_0x30f58e){if(!this[_0xb1d2('0x6')][_0x1d06b7]){return logger['info'](_0xb1d2('0xf'));}var _0x147329=_0x30f58e(this[_0xb1d2('0x6')][_0x1d06b7]);if(!_0x147329){return logger[_0xb1d2('0x10')]('stop\x20traverse');}if(this[_0xb1d2('0x7')][_0x1d06b7][_0xb1d2('0x11')]===0x0){return logger[_0xb1d2('0x10')](_0xb1d2('0x12'));}for(var _0xd2fa60=0x0,_0x48a2e4=[],_0xca21c7=![];_0xd2fa60\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','error','message','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson'];(function(_0x2c760e,_0x3ec654){var _0x167283=function(_0x2e3cb7){while(--_0x2e3cb7){_0x2c760e['push'](_0x2c760e['shift']());}};_0x167283(++_0x3ec654);}(_0xacba,0x1ab));var _0xaacb=function(_0x3160af,_0x484932){_0x3160af=_0x3160af-0x0;var _0x407748=_0xacba[_0x3160af];return _0x407748;};'use strict';var parser=require(_0xaacb('0x0'));var _=require(_0xaacb('0x1'));var syncho=require(_0xaacb('0x2'));var util=require(_0xaacb('0x3'));var moment=require('moment');var config=require(_0xaacb('0x4'));var logger=require(_0xaacb('0x5'))(_0xaacb('0x6'));var utilLicense=require(_0xaacb('0x7'));var rpc=require(_0xaacb('0x8'));var mailRpc=require(_0xaacb('0x9'));var Graph=require(_0xaacb('0xa'));var Vertices=require(_0xaacb('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xaacb('0x6')]=_[_0xaacb('0xc')](config[_0xaacb('0x6')],{'ip':_0xaacb('0xd'),'port':0x11dd});function connectionHandler(_0x3881fa){process[_0xaacb('0xe')](function(){syncho(function(){try{setChannelVariables(_0x3881fa);agiHandler(_0x3881fa);}catch(_0xc28160){logger['error'](_0xc28160[_0xaacb('0xf')]);}});});}function listeningHandler(){console['log'](_0xaacb('0x10'),config[_0xaacb('0x6')]['port']);logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x13'),config[_0xaacb('0x6')]['ip'],config['agi']['port']));}function errorHandler(_0x3418df){if(_0x3418df&&_0x3418df[_0xaacb('0x14')]&&_0x3418df['message']){logger[_0xaacb('0x15')](util[_0xaacb('0x12')]('[%s]\x20%s',_0x3418df[_0xaacb('0x14')],_0x3418df[_0xaacb('0x16')]));}else{logger[_0xaacb('0x15')](util[_0xaacb('0x12')](_0xaacb('0x17'),_0x3418df[_0xaacb('0xf')]));}}function closeHandler(){logger[_0xaacb('0x11')](util[_0xaacb('0x12')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xaacb('0x18')],this['calleridname'],this[_0xaacb('0x19')],this[_0xaacb('0x1a')],this[_0xaacb('0x1b')]));try{createSquareReport(this);}catch(_0x157b07){logger[_0xaacb('0x15')](_0x157b07[_0xaacb('0xf')]);}}function timeoutHandler(){logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x1c'),this[_0xaacb('0x18')],this[_0xaacb('0x1d')],this[_0xaacb('0x19')],this[_0xaacb('0x1a')],this[_0xaacb('0x1b')]));}function hangupHandler(){logger['info'](util[_0xaacb('0x12')](_0xaacb('0x1e'),this[_0xaacb('0x18')],this[_0xaacb('0x1d')],this[_0xaacb('0x19')],this[_0xaacb('0x1a')],this[_0xaacb('0x1b')]));this[_0xaacb('0x1f')]=!![];}function getRoot(_0x1cc673){return parser[_0xaacb('0x20')](_0x1cc673,{'object':!![]})[_0xaacb('0x21')][_0xaacb('0x22')];}function addVertex(_0x10742b,_0x4e085e,_0xf6b42c){_0x4e085e[_0xaacb('0x23')]=_0xf6b42c;if(_0x4e085e[_0xaacb('0x24')](_0xaacb('0x25'))){_0x4e085e[_0xaacb('0x26')]=parseInt(_0x4e085e['retry'],0xa);}_0x10742b[_0xaacb('0x27')](_[_0xaacb('0x28')](_0x4e085e,_0xaacb('0x29')));}function initGraph(_0xdf1c21,_0x484463){var _0x3bcace=new Graph();for(var _0x597c54 in _0xdf1c21){if(_0xdf1c21['hasOwnProperty'](_0x597c54)){if(_[_0xaacb('0x2a')](_0xdf1c21[_0x597c54])){for(var _0x1df8d7=0x0;_0x1df8d7<_0xdf1c21[_0x597c54][_0xaacb('0x2b')];_0x1df8d7+=0x1){addVertex(_0x3bcace,_0xdf1c21[_0x597c54][_0x1df8d7],_0x597c54);}}else{addVertex(_0x3bcace,_0xdf1c21[_0x597c54],_0x597c54);}}}for(var _0x3250ab=0x0;_0x3250ab<_0x484463[_0xaacb('0x2b')];_0x3250ab+=0x1){if(_0x484463[_0x3250ab]['source']&&_0x484463[_0x3250ab][_0xaacb('0x2c')]){_0x3bcace[_0xaacb('0x2d')](_0x484463[_0x3250ab][_0xaacb('0x2e')],_0x484463[_0x3250ab]['target'],_0x484463[_0x3250ab][_0xaacb('0x2f')]);}}return _0x3bcace;}function getSquareProject(_0x71626b,_0x3e614f){rpc[_0xaacb('0x30')](_0x71626b)['then'](function(_0x5c85dc){_0x3e614f(null,_0x5c85dc);})[_0xaacb('0x31')](function(_0x25caa9){_0x3e614f(null,_0x25caa9);});}function createSquareReport(_0x238d38,_0x2fec10){rpc[_0xaacb('0x32')](_0x238d38)[_0xaacb('0x33')](function(_0x11a960){if(_0x2fec10){_0x2fec10(null,_0x11a960);}})['catch'](function(_0x4b57a1){if(_0x2fec10){_0x2fec10(null,_0x4b57a1);}});}function setChannelVariables(_0x3fc514){for(var _0x2df2ce in _0x3fc514){if(_0x3fc514[_0xaacb('0x24')](_0x2df2ce)){if(_0x2df2ce['indexOf']('agi_')===0x0){_0x3fc514[_0x2df2ce['substring'](0x4)]=_0x3fc514[_0x2df2ce];delete _0x3fc514[_0x2df2ce];}}}}function getLogFromObject(_0x5b4e59){return util['inspect'](_0x5b4e59,{'showHidden':![],'depth':null});}function agiHandler(_0x3c22a4){var _0x54dd03,_0x5dbd68,_0x204b0e,_0x3688ac,_0x41fa10;logger[_0xaacb('0x34')](_0xaacb('0x35'),JSON[_0xaacb('0x36')](_0x3c22a4,null,0x2));logger['info'](util[_0xaacb('0x12')](_0xaacb('0x37'),_0x3c22a4['arg_1'],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4['callerid'],_0x3c22a4[_0xaacb('0x1a')],_0x3c22a4['uniqueid']));_0x3c22a4['on']('error',errorHandler);_0x3c22a4['on'](_0xaacb('0x38'),closeHandler);_0x3c22a4['on'](_0xaacb('0x39'),timeoutHandler);_0x3c22a4['evtHangup']=![];_0x3c22a4['on'](_0xaacb('0x3a'),hangupHandler);var _0x2c6f76=getSquareProject[_0xaacb('0x3b')](null,_0x3c22a4[_0xaacb('0x18')]);if(_0x2c6f76){if(_0x2c6f76['production']){_0x54dd03=getRoot(_0x2c6f76[_0xaacb('0x3c')]);if(_0x54dd03&&_0x54dd03['start']){logger[_0xaacb('0x34')]('root',JSON[_0xaacb('0x36')](_0x54dd03,null,0x2));_0x3c22a4[_0xaacb('0x3d')]=moment()[_0xaacb('0x12')](_0xaacb('0x3e'));_0x5dbd68=initGraph(_['omit'](_0x54dd03,'mxCell'),_0x54dd03[_0xaacb('0x29')]);_0x204b0e=new Vertices(_0x3c22a4,rpc,mailRpc);logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x3f'),_0x3c22a4[_0xaacb('0x18')],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4['callerid'],_0x3c22a4['dnid'],_0x3c22a4[_0xaacb('0x1b')]));_0x5dbd68[_0xaacb('0x40')](_0x54dd03[_0xaacb('0x41')]['id'],function(_0x389baf){try{_0x389baf=_0x204b0e['clear'](_0x389baf);logger[_0xaacb('0x34')](_0xaacb('0x42'),JSON[_0xaacb('0x36')](_0x389baf,null,0x2));if(_0x389baf[_0xaacb('0x23')]==='gotoc'){logger[_0xaacb('0x11')](_0xaacb('0x43'));_0x3c22a4['context']=_0x389baf[_0xaacb('0x44')]||_0x3c22a4[_0xaacb('0x44')];_0x3c22a4[_0xaacb('0x45')]=_0x389baf[_0xaacb('0x45')];_0x3c22a4[_0xaacb('0x46')]=_0x389baf['priority']?_0x389baf[_0xaacb('0x46')]-0x1:0x1;return null;}else if(_0x389baf&&_0x204b0e[_0x389baf[_0xaacb('0x23')]]){_0x41fa10=_0x204b0e[_0x389baf[_0xaacb('0x23')]](_0x389baf);logger[_0xaacb('0x11')](_0xaacb('0x47'),JSON[_0xaacb('0x36')](_0x41fa10,null,0x2));if(_0x41fa10&&_0x41fa10['code']===AGI_CODE_SUCCESS&&_0x41fa10['result']!==AGI_RESULT_ERROR&&!_0x3c22a4[_0xaacb('0x1f')]){logger[_0xaacb('0x34')](_0xaacb('0x47'),getLogFromObject(_0x41fa10));return _[_0xaacb('0x48')](_0x41fa10['result'])?null:_0x41fa10[_0xaacb('0x49')][_0xaacb('0x4a')]();}else{logger[_0xaacb('0x15')]('response',getLogFromObject(_0x41fa10));return null;}}else{logger[_0xaacb('0x15')](_0xaacb('0x4b'));return null;}}catch(_0x5375f6){logger[_0xaacb('0x15')](_0x5375f6[_0xaacb('0xf')]);return null;}});if(_0x54dd03[_0xaacb('0x4c')]){logger[_0xaacb('0x11')](util[_0xaacb('0x12')](_0xaacb('0x4d'),_0x3c22a4[_0xaacb('0x18')],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4[_0xaacb('0x19')],_0x3c22a4[_0xaacb('0x1a')],_0x3c22a4[_0xaacb('0x1b')]));_0x5dbd68['traverseBFS'](_0x54dd03[_0xaacb('0x4c')]['id'],function(_0x336fd3){try{_0x336fd3=_0x204b0e[_0xaacb('0x4e')](_0x336fd3);logger['debug'](_0xaacb('0x42'),JSON[_0xaacb('0x36')](_0x336fd3,null,0x2));if(_0x336fd3&&_0x204b0e[_0x336fd3[_0xaacb('0x23')]]){_0x41fa10=_0x204b0e[_0x336fd3['agicommand']](_0x336fd3);if(_0x41fa10){logger[_0xaacb('0x34')](_0xaacb('0x47'),getLogFromObject(_0x41fa10));return _[_0xaacb('0x48')](_0x41fa10['result'])?null:_0x41fa10[_0xaacb('0x49')]['toString']();}else{logger[_0xaacb('0x15')](_0xaacb('0x47'),getLogFromObject(_0x41fa10));return null;}}else{logger[_0xaacb('0x15')](_0xaacb('0x4b'));return null;}}catch(_0x206fa1){logger[_0xaacb('0x15')](_0x206fa1[_0xaacb('0xf')]);return null;}});}logger[_0xaacb('0x11')](util[_0xaacb('0x12')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3c22a4[_0xaacb('0x18')],_0x3c22a4[_0xaacb('0x1d')],_0x3c22a4[_0xaacb('0x19')],_0x3c22a4[_0xaacb('0x1a')],_0x3c22a4[_0xaacb('0x1b')]));logger[_0xaacb('0x11')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4[_0xaacb('0x46')],0xa)+0x1));_0x3c22a4[_0xaacb('0x4f')](_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4['priority'],0xa)+0x1);_0x3c22a4[_0xaacb('0x38')]();}}else{logger['error'](util[_0xaacb('0x12')](_0xaacb('0x50'),_0x3c22a4[_0xaacb('0x18')]));_0x3c22a4[_0xaacb('0x4f')](_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4[_0xaacb('0x46')],0xa)+0x1);_0x3c22a4['close']();}}else{logger[_0xaacb('0x15')](util[_0xaacb('0x12')]('Project\x20%s\x20not\x20found',_0x3c22a4[_0xaacb('0x18')]));_0x3c22a4[_0xaacb('0x4f')](_0x3c22a4[_0xaacb('0x44')],_0x3c22a4[_0xaacb('0x45')],parseInt(_0x3c22a4[_0xaacb('0x46')],0xa)+0x1);_0x3c22a4[_0xaacb('0x38')]();}}function main(){var _0x133ac5;return utilLicense[_0xaacb('0x51')]()['then'](function(_0xb3edbd){if(_0xb3edbd){if(_0xb3edbd[_0xaacb('0x52')]){if(_0xb3edbd['callysquare']&&_0xb3edbd['callysquare']>0x0){logger[_0xaacb('0x11')](util['format'](_0xaacb('0x53'),_0xb3edbd[_0xaacb('0x54')]));_0x133ac5=_0xb3edbd['callysquare'];}else{logger['info'](_0xaacb('0x55'));}}else{logger[_0xaacb('0x11')](_0xaacb('0x56'));_0x133ac5=-0x1;}}})[_0xaacb('0x31')](function(_0x2ad7e5){logger['error'](_0xaacb('0x57'),_0x2ad7e5[_0xaacb('0xf')]);})[_0xaacb('0x4c')](function(){var _0x481590=require(_0xaacb('0x58'))(config[_0xaacb('0x6')][_0xaacb('0x59')],config['agi']['ip'],_0x133ac5);_0x481590['on'](_0xaacb('0x15'),errorHandler);_0x481590['on'](_0xaacb('0x5a'),listeningHandler);_0x481590['on'](_0xaacb('0x5b'),connectionHandler);_0x481590['on'](_0xaacb('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0xab56=['substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','[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','code','result','isUndefined','toString','response','finally','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','listening','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','[%s]\x20%s','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','evtHangup','toJson','mxGraphModel','agicommand','maxRetry','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf'];(function(_0x1e72e2,_0x1e6511){var _0xbaf698=function(_0x2216c9){while(--_0x2216c9){_0x1e72e2['push'](_0x1e72e2['shift']());}};_0xbaf698(++_0x1e6511);}(_0xab56,0x78));var _0x6ab5=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xab56[_0x2555d0];return _0x3bb486;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x6ab5('0x0'));var util=require(_0x6ab5('0x1'));var moment=require(_0x6ab5('0x2'));var config=require(_0x6ab5('0x3'));var logger=require(_0x6ab5('0x4'))(_0x6ab5('0x5'));var utilLicense=require(_0x6ab5('0x6'));var rpc=require(_0x6ab5('0x7'));var mailRpc=require(_0x6ab5('0x8'));var Graph=require(_0x6ab5('0x9'));var Vertices=require(_0x6ab5('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x6ab5('0x5')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x1e7382){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1e7382);agiHandler(_0x1e7382);}catch(_0x37f7d1){logger[_0x6ab5('0xb')](_0x37f7d1[_0x6ab5('0xc')]);}});});}function listeningHandler(){console[_0x6ab5('0xd')](_0x6ab5('0xe'),config[_0x6ab5('0x5')][_0x6ab5('0xf')]);logger[_0x6ab5('0x10')](util[_0x6ab5('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x6ab5('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x32b83b){if(_0x32b83b&&_0x32b83b['name']&&_0x32b83b[_0x6ab5('0x12')]){logger[_0x6ab5('0xb')](util[_0x6ab5('0x11')](_0x6ab5('0x13'),_0x32b83b[_0x6ab5('0x14')],_0x32b83b[_0x6ab5('0x12')]));}else{logger['error'](util[_0x6ab5('0x11')]('[ERROR]\x20%s',_0x32b83b[_0x6ab5('0xc')]));}}function closeHandler(){logger[_0x6ab5('0x10')](util['format'](_0x6ab5('0x15'),this[_0x6ab5('0x16')],this['calleridname'],this[_0x6ab5('0x17')],this[_0x6ab5('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x270cfe){logger['error'](_0x270cfe[_0x6ab5('0xc')]);}}function timeoutHandler(){logger[_0x6ab5('0x10')](util['format'](_0x6ab5('0x19'),this[_0x6ab5('0x16')],this[_0x6ab5('0x1a')],this[_0x6ab5('0x17')],this[_0x6ab5('0x18')],this[_0x6ab5('0x1b')]));}function hangupHandler(){logger['info'](util[_0x6ab5('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x6ab5('0x16')],this[_0x6ab5('0x1a')],this[_0x6ab5('0x17')],this[_0x6ab5('0x18')],this[_0x6ab5('0x1b')]));this[_0x6ab5('0x1c')]=!![];}function getRoot(_0x435693){return parser[_0x6ab5('0x1d')](_0x435693,{'object':!![]})[_0x6ab5('0x1e')]['root'];}function addVertex(_0x2e32c2,_0x55dd6b,_0x86544d){_0x55dd6b[_0x6ab5('0x1f')]=_0x86544d;if(_0x55dd6b['hasOwnProperty']('retry')){_0x55dd6b[_0x6ab5('0x20')]=parseInt(_0x55dd6b[_0x6ab5('0x21')],0xa);}_0x2e32c2[_0x6ab5('0x22')](_[_0x6ab5('0x23')](_0x55dd6b,_0x6ab5('0x24')));}function initGraph(_0x233623,_0x3b8d70){var _0x144298=new Graph();for(var _0x27f05f in _0x233623){if(_0x233623[_0x6ab5('0x25')](_0x27f05f)){if(_[_0x6ab5('0x26')](_0x233623[_0x27f05f])){for(var _0x2dc708=0x0;_0x2dc708<_0x233623[_0x27f05f]['length'];_0x2dc708+=0x1){addVertex(_0x144298,_0x233623[_0x27f05f][_0x2dc708],_0x27f05f);}}else{addVertex(_0x144298,_0x233623[_0x27f05f],_0x27f05f);}}}for(var _0x5ea015=0x0;_0x5ea015<_0x3b8d70[_0x6ab5('0x27')];_0x5ea015+=0x1){if(_0x3b8d70[_0x5ea015][_0x6ab5('0x28')]&&_0x3b8d70[_0x5ea015][_0x6ab5('0x29')]){_0x144298[_0x6ab5('0x2a')](_0x3b8d70[_0x5ea015][_0x6ab5('0x28')],_0x3b8d70[_0x5ea015]['target'],_0x3b8d70[_0x5ea015]['value']);}}return _0x144298;}function getSquareProject(_0x447381,_0x1bdb08){rpc[_0x6ab5('0x2b')](_0x447381)[_0x6ab5('0x2c')](function(_0x421ce4){_0x1bdb08(null,_0x421ce4);})[_0x6ab5('0x2d')](function(_0x2798bf){_0x1bdb08(null,_0x2798bf);});}function createSquareReport(_0x4ef95d,_0x712d72){rpc[_0x6ab5('0x2e')](_0x4ef95d)['then'](function(_0x247f0d){if(_0x712d72){_0x712d72(null,_0x247f0d);}})[_0x6ab5('0x2d')](function(_0x252cb3){if(_0x712d72){_0x712d72(null,_0x252cb3);}});}function setChannelVariables(_0xca0a8c){for(var _0x587fb4 in _0xca0a8c){if(_0xca0a8c[_0x6ab5('0x25')](_0x587fb4)){if(_0x587fb4[_0x6ab5('0x2f')]('agi_')===0x0){_0xca0a8c[_0x587fb4[_0x6ab5('0x30')](0x4)]=_0xca0a8c[_0x587fb4];delete _0xca0a8c[_0x587fb4];}}}}function getLogFromObject(_0x9897ac){return util[_0x6ab5('0x31')](_0x9897ac,{'showHidden':![],'depth':null});}function agiHandler(_0x230519){var _0x5daff8,_0x58483f,_0x457f74,_0x449f46,_0x413588;logger[_0x6ab5('0x32')](_0x6ab5('0x33'),JSON[_0x6ab5('0x34')](_0x230519,null,0x2));logger[_0x6ab5('0x10')](util['format'](_0x6ab5('0x35'),_0x230519[_0x6ab5('0x16')],_0x230519[_0x6ab5('0x1a')],_0x230519[_0x6ab5('0x17')],_0x230519[_0x6ab5('0x18')],_0x230519[_0x6ab5('0x1b')]));_0x230519['on'](_0x6ab5('0xb'),errorHandler);_0x230519['on'](_0x6ab5('0x36'),closeHandler);_0x230519['on'](_0x6ab5('0x37'),timeoutHandler);_0x230519['evtHangup']=![];_0x230519['on'](_0x6ab5('0x38'),hangupHandler);var _0x364895=getSquareProject['sync'](null,_0x230519[_0x6ab5('0x16')]);if(_0x364895){if(_0x364895['production']){_0x5daff8=getRoot(_0x364895[_0x6ab5('0x39')]);if(_0x5daff8&&_0x5daff8[_0x6ab5('0x3a')]){logger['debug']('root',JSON[_0x6ab5('0x34')](_0x5daff8,null,0x2));_0x230519['joinAt']=moment()[_0x6ab5('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x58483f=initGraph(_[_0x6ab5('0x23')](_0x5daff8,_0x6ab5('0x24')),_0x5daff8['mxCell']);_0x457f74=new Vertices(_0x230519,rpc,mailRpc);logger[_0x6ab5('0x10')](util[_0x6ab5('0x11')](_0x6ab5('0x3b'),_0x230519['arg_1'],_0x230519[_0x6ab5('0x1a')],_0x230519['callerid'],_0x230519[_0x6ab5('0x18')],_0x230519[_0x6ab5('0x1b')]));_0x58483f[_0x6ab5('0x3c')](_0x5daff8[_0x6ab5('0x3a')]['id'],function(_0xfbf677){try{_0xfbf677=_0x457f74['clear'](_0xfbf677);logger[_0x6ab5('0x32')](_0x6ab5('0x3d'),JSON[_0x6ab5('0x34')](_0xfbf677,null,0x2));if(_0xfbf677['agicommand']===_0x6ab5('0x3e')){logger[_0x6ab5('0x10')](_0x6ab5('0x3f'));_0x230519[_0x6ab5('0x40')]=_0xfbf677[_0x6ab5('0x40')]||_0x230519[_0x6ab5('0x40')];_0x230519[_0x6ab5('0x41')]=_0xfbf677[_0x6ab5('0x41')];_0x230519['priority']=_0xfbf677[_0x6ab5('0x42')]?_0xfbf677[_0x6ab5('0x42')]-0x1:0x1;return null;}else if(_0xfbf677&&_0x457f74[_0xfbf677[_0x6ab5('0x1f')]]){_0x413588=_0x457f74[_0xfbf677[_0x6ab5('0x1f')]](_0xfbf677);logger['info']('response',JSON[_0x6ab5('0x34')](_0x413588,null,0x2));if(_0x413588&&_0x413588[_0x6ab5('0x43')]===AGI_CODE_SUCCESS&&_0x413588[_0x6ab5('0x44')]!==AGI_RESULT_ERROR&&!_0x230519[_0x6ab5('0x1c')]){logger['debug']('response',getLogFromObject(_0x413588));return _[_0x6ab5('0x45')](_0x413588[_0x6ab5('0x44')])?null:_0x413588[_0x6ab5('0x44')][_0x6ab5('0x46')]();}else{logger[_0x6ab5('0xb')](_0x6ab5('0x47'),getLogFromObject(_0x413588));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3885f3){logger[_0x6ab5('0xb')](_0x3885f3['stack']);return null;}});if(_0x5daff8['finally']){logger['info'](util[_0x6ab5('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x230519[_0x6ab5('0x16')],_0x230519['calleridname'],_0x230519[_0x6ab5('0x17')],_0x230519['dnid'],_0x230519[_0x6ab5('0x1b')]));_0x58483f['traverseBFS'](_0x5daff8[_0x6ab5('0x48')]['id'],function(_0x2ca189){try{_0x2ca189=_0x457f74[_0x6ab5('0x49')](_0x2ca189);logger[_0x6ab5('0x32')](_0x6ab5('0x3d'),JSON[_0x6ab5('0x34')](_0x2ca189,null,0x2));if(_0x2ca189&&_0x457f74[_0x2ca189[_0x6ab5('0x1f')]]){_0x413588=_0x457f74[_0x2ca189[_0x6ab5('0x1f')]](_0x2ca189);if(_0x413588){logger['debug'](_0x6ab5('0x47'),getLogFromObject(_0x413588));return _[_0x6ab5('0x45')](_0x413588['result'])?null:_0x413588[_0x6ab5('0x44')][_0x6ab5('0x46')]();}else{logger[_0x6ab5('0xb')](_0x6ab5('0x47'),getLogFromObject(_0x413588));return null;}}else{logger[_0x6ab5('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x3b8f17){logger[_0x6ab5('0xb')](_0x3b8f17['stack']);return null;}});}logger[_0x6ab5('0x10')](util['format'](_0x6ab5('0x4a'),_0x230519[_0x6ab5('0x16')],_0x230519['calleridname'],_0x230519[_0x6ab5('0x17')],_0x230519[_0x6ab5('0x18')],_0x230519[_0x6ab5('0x1b')]));logger['info'](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x230519[_0x6ab5('0x40')],_0x230519[_0x6ab5('0x41')],parseInt(_0x230519['priority'],0xa)+0x1));_0x230519[_0x6ab5('0x4b')](_0x230519[_0x6ab5('0x40')],_0x230519[_0x6ab5('0x41')],parseInt(_0x230519[_0x6ab5('0x42')],0xa)+0x1);_0x230519[_0x6ab5('0x36')]();}}else{logger[_0x6ab5('0xb')](util[_0x6ab5('0x11')](_0x6ab5('0x4c'),_0x230519[_0x6ab5('0x16')]));_0x230519['continueAt'](_0x230519[_0x6ab5('0x40')],_0x230519['extension'],parseInt(_0x230519[_0x6ab5('0x42')],0xa)+0x1);_0x230519[_0x6ab5('0x36')]();}}else{logger['error'](util[_0x6ab5('0x11')](_0x6ab5('0x4d'),_0x230519[_0x6ab5('0x16')]));_0x230519[_0x6ab5('0x4b')](_0x230519[_0x6ab5('0x40')],_0x230519[_0x6ab5('0x41')],parseInt(_0x230519[_0x6ab5('0x42')],0xa)+0x1);_0x230519['close']();}}function main(){var _0x572468;return utilLicense[_0x6ab5('0x4e')]()['then'](function(_0x594a9e){if(_0x594a9e){if(_0x594a9e['voice']){if(_0x594a9e[_0x6ab5('0x4f')]&&_0x594a9e[_0x6ab5('0x4f')]>0x0){logger[_0x6ab5('0x10')](util[_0x6ab5('0x11')](_0x6ab5('0x50'),_0x594a9e[_0x6ab5('0x4f')]));_0x572468=_0x594a9e[_0x6ab5('0x4f')];}else{logger[_0x6ab5('0x10')](_0x6ab5('0x51'));}}else{logger['info'](_0x6ab5('0x52'));_0x572468=-0x1;}}})[_0x6ab5('0x2d')](function(_0x1408d7){logger[_0x6ab5('0xb')]('[LICENSE]',_0x1408d7['stack']);})[_0x6ab5('0x48')](function(){var _0xcbc3ff=require('./server')(config[_0x6ab5('0x5')][_0x6ab5('0xf')],config['agi']['ip'],_0x572468);_0xcbc3ff['on'](_0x6ab5('0xb'),errorHandler);_0xcbc3ff['on'](_0x6ab5('0x53'),listeningHandler);_0xcbc3ff['on']('connection',connectionHandler);_0xcbc3ff['on'](_0x6ab5('0x36'),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 83f0909..b25ad19 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 _0x4f05=['message','catch','SendMail','jayson/promise','client','http','error'];(function(_0x2fc6cf,_0x2bb133){var _0xf2ade3=function(_0x522b04){while(--_0x522b04){_0x2fc6cf['push'](_0x2fc6cf['shift']());}};_0xf2ade3(++_0x2bb133);}(_0x4f05,0x1b5));var _0x54f0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4f05[_0x465a0c];return _0x1e202e;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x54f0('0x0'));var client=jayson[_0x54f0('0x1')][_0x54f0('0x2')]({'port':0x232b});function request(_0x343c29,_0xb5ef6){return new BPromise(function(_0x1942be,_0x38129d){return client['request'](_0x343c29,_0xb5ef6)['then'](function(_0x4f8e09){if(_0x4f8e09[_0x54f0('0x3')]){return _0x38129d(_0x4f8e09[_0x54f0('0x3')][_0x54f0('0x4')]);}else{return _0x1942be(_0x4f8e09['result']);}})[_0x54f0('0x5')](function(_0x1828c7){return _0x38129d(_0x1828c7);});});}exports['sendMailMessage']=function(_0x2460f7,_0x325b3b){return request(_0x54f0('0x6'),{'account':_0x2460f7,'message':_0x325b3b});}; \ No newline at end of file +var _0x3c90=['result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','then','message'];(function(_0x353c98,_0x386bc9){var _0xdb2a92=function(_0xe9bc7f){while(--_0xe9bc7f){_0x353c98['push'](_0x353c98['shift']());}};_0xdb2a92(++_0x386bc9);}(_0x3c90,0x174));var _0x03c9=function(_0x5e9378,_0x3e6534){_0x5e9378=_0x5e9378-0x0;var _0x351ac0=_0x3c90[_0x5e9378];return _0x351ac0;};'use strict';var BPromise=require(_0x03c9('0x0'));var jayson=require(_0x03c9('0x1'));var client=jayson[_0x03c9('0x2')][_0x03c9('0x3')]({'port':0x232b});function request(_0x3f294b,_0x52496e){return new BPromise(function(_0x539536,_0xb58a92){return client['request'](_0x3f294b,_0x52496e)[_0x03c9('0x4')](function(_0x4884a7){if(_0x4884a7['error']){return _0xb58a92(_0x4884a7['error'][_0x03c9('0x5')]);}else{return _0x539536(_0x4884a7[_0x03c9('0x6')]);}})['catch'](function(_0x3293f7){return _0xb58a92(_0x3293f7);});});}exports[_0x03c9('0x7')]=function(_0x11aa00,_0x3f2fe8){return request(_0x03c9('0x8'),{'account':_0x11aa00,'message':_0x3f2fe8});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 9842161..20232fa 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 _0x6de8=['length','split','slice','trim','emit','line','exports','util','Transform','call','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','_inBody','indexOf','substring'];(function(_0x2383c3,_0x4fd9de){var _0x2cadbc=function(_0x2d0810){while(--_0x2d0810){_0x2383c3['push'](_0x2383c3['shift']());}};_0x2cadbc(++_0x4fd9de);}(_0x6de8,0x183));var _0x86de=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x6de8[_0x1d50f2];return _0x3769b8;};'use strict';var util=require(_0x86de('0x0'));var Transform=require('stream')[_0x86de('0x1')];function AGIReply(_0xdc5a38){Transform[_0x86de('0x2')](this,_0xdc5a38);this['_localBuffer']='';this['_inBody']=![];}util[_0x86de('0x3')](AGIReply,Transform);AGIReply[_0x86de('0x4')][_0x86de('0x5')]=function(_0x382ede,_0x13d0dd,_0x3ee3c3){var _0x409bb5='\x0a',_0x1c0b62=['\x0a\x0a',_0x86de('0x6')],_0x4b3fca=-0x1,_0x49abd4=-0x1,_0x2613fd='',_0x6d2331=0x0,_0x15142a='',_0x4e14d6='';this['_localBuffer']+=_0x382ede[_0x86de('0x7')]();_0x15142a=this[_0x86de('0x8')];if(!this[_0x86de('0x9')]){_0x6d2331=0x0;while(_0x1c0b62[_0x6d2331]){while((_0x49abd4=_0x15142a[_0x86de('0xa')](_0x1c0b62[_0x6d2331]))!=-0x1){_0x2613fd=_0x1c0b62[_0x6d2331];_0x4e14d6=_0x15142a[_0x86de('0xb')](0x0,_0x49abd4);_0x15142a=_0x15142a[_0x86de('0xb')](_0x49abd4+_0x2613fd[_0x86de('0xc')]);var _0x3e8d18=_0x4e14d6[_0x86de('0xd')](_0x409bb5),_0x50cbbc=0x0,_0x2d4f57={},_0x17519c='',_0x2cc31a='',_0x5e99ba=-0x1;while(_0x3e8d18[_0x50cbbc]){_0x5e99ba=_0x3e8d18[_0x50cbbc]['indexOf'](':');if(_0x5e99ba!=-0x1){_0x17519c=_0x3e8d18[_0x50cbbc][_0x86de('0xe')](0x0,_0x5e99ba)['trim']();_0x2cc31a=_0x3e8d18[_0x50cbbc]['slice'](_0x5e99ba+0x1)[_0x86de('0xf')]();if(_0x17519c['length']>0x0){_0x2d4f57[_0x17519c]=_0x2cc31a;}}else{}_0x50cbbc++;}this[_0x86de('0x10')]('headers',_0x2d4f57);this['_inBody']=!![];}_0x6d2331++;}this[_0x86de('0x8')]=_0x15142a;}else{while((_0x4b3fca=_0x15142a['indexOf'](_0x409bb5))!=-0x1){_0x4e14d6=_0x15142a['substring'](0x0,_0x4b3fca);this[_0x86de('0x10')](_0x86de('0x11'),_0x4e14d6);_0x15142a=_0x15142a[_0x86de('0xb')](_0x4b3fca+_0x409bb5[_0x86de('0xc')]);}this[_0x86de('0x8')]=_0x15142a;}_0x3ee3c3();};module[_0x86de('0x12')]=AGIReply; \ No newline at end of file +var _0x76cc=['_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','trim','slice','emit','headers','exports','util','stream','call','_localBuffer','inherits','prototype'];(function(_0x1cbce1,_0x3745d5){var _0xe172ce=function(_0x134f5a){while(--_0x134f5a){_0x1cbce1['push'](_0x1cbce1['shift']());}};_0xe172ce(++_0x3745d5);}(_0x76cc,0x117));var _0xc76c=function(_0x41388c,_0x5f7b7d){_0x41388c=_0x41388c-0x0;var _0x49b676=_0x76cc[_0x41388c];return _0x49b676;};'use strict';var util=require(_0xc76c('0x0'));var Transform=require(_0xc76c('0x1'))['Transform'];function AGIReply(_0x3f92fb){Transform[_0xc76c('0x2')](this,_0x3f92fb);this[_0xc76c('0x3')]='';this['_inBody']=![];}util[_0xc76c('0x4')](AGIReply,Transform);AGIReply[_0xc76c('0x5')][_0xc76c('0x6')]=function(_0x2a2824,_0x4e7583,_0x2a08f6){var _0x25e3c1='\x0a',_0x417a99=['\x0a\x0a',_0xc76c('0x7')],_0x4e9607=-0x1,_0x5476c4=-0x1,_0x925174='',_0x16d4f9=0x0,_0x307570='',_0x1e7e17='';this['_localBuffer']+=_0x2a2824[_0xc76c('0x8')]();_0x307570=this[_0xc76c('0x3')];if(!this[_0xc76c('0x9')]){_0x16d4f9=0x0;while(_0x417a99[_0x16d4f9]){while((_0x5476c4=_0x307570[_0xc76c('0xa')](_0x417a99[_0x16d4f9]))!=-0x1){_0x925174=_0x417a99[_0x16d4f9];_0x1e7e17=_0x307570[_0xc76c('0xb')](0x0,_0x5476c4);_0x307570=_0x307570[_0xc76c('0xb')](_0x5476c4+_0x925174[_0xc76c('0xc')]);var _0x58d169=_0x1e7e17[_0xc76c('0xd')](_0x25e3c1),_0x19d407=0x0,_0x44affe={},_0x591d8a='',_0x4a4780='',_0x196d9c=-0x1;while(_0x58d169[_0x19d407]){_0x196d9c=_0x58d169[_0x19d407][_0xc76c('0xa')](':');if(_0x196d9c!=-0x1){_0x591d8a=_0x58d169[_0x19d407]['slice'](0x0,_0x196d9c)[_0xc76c('0xe')]();_0x4a4780=_0x58d169[_0x19d407][_0xc76c('0xf')](_0x196d9c+0x1)['trim']();if(_0x591d8a['length']>0x0){_0x44affe[_0x591d8a]=_0x4a4780;}}else{}_0x19d407++;}this[_0xc76c('0x10')](_0xc76c('0x11'),_0x44affe);this['_inBody']=!![];}_0x16d4f9++;}this[_0xc76c('0x3')]=_0x307570;}else{while((_0x4e9607=_0x307570[_0xc76c('0xa')](_0x25e3c1))!=-0x1){_0x1e7e17=_0x307570['substring'](0x0,_0x4e9607);this['emit']('line',_0x1e7e17);_0x307570=_0x307570[_0xc76c('0xb')](_0x4e9607+_0x25e3c1[_0xc76c('0xc')]);}this['_localBuffer']=_0x307570;}_0x2a08f6();};module[_0xc76c('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ac8aee4..ea54f04 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 _0x9a86=['getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById'];(function(_0x55d01b,_0x369f1b){var _0x366b99=function(_0x5cd2cb){while(--_0x5cd2cb){_0x55d01b['push'](_0x55d01b['shift']());}};_0x366b99(++_0x369f1b);}(_0x9a86,0x13b));var _0x69a8=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x9a86[_0x3e7e96];return _0x13f6f0;};'use strict';var BPromise=require(_0x69a8('0x0'));var moment=require(_0x69a8('0x1'));var _=require(_0x69a8('0x2'));var util=require(_0x69a8('0x3'));var jayson=require(_0x69a8('0x4'));var client=jayson[_0x69a8('0x5')][_0x69a8('0x6')]({'port':0x2329});function request(_0x37299c,_0x3b43c8){return new BPromise(function(_0x1dd679,_0x2e8f1c){return client[_0x69a8('0x7')](_0x37299c,_0x3b43c8)[_0x69a8('0x8')](function(_0x86a41d){if(_0x86a41d[_0x69a8('0x9')]){return _0x2e8f1c(_0x86a41d[_0x69a8('0x9')][_0x69a8('0xa')]);}else{return _0x1dd679(_0x86a41d[_0x69a8('0xb')]);}})[_0x69a8('0xc')](function(_0x261070){return _0x2e8f1c(_0x261070);});});}exports[_0x69a8('0xd')]=function(_0x2c126b){return request(_0x69a8('0xe'),{'options':{'raw':![],'where':{'name':_0x2c126b},'attributes':['production']}});};exports[_0x69a8('0xf')]=function(_0x5ae902){return request(_0x69a8('0x10'),{'options':{'raw':![],'where':{'id':_0x5ae902},'include':[{'model':_0x69a8('0x11'),'as':_0x69a8('0x12')}],'attributes':['id',_0x69a8('0x13'),'email']}});};exports[_0x69a8('0x14')]=function(_0x36f417){return request(_0x69a8('0xe'),{'options':{'where':{'id':_0x36f417},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x15')]=function(_0x1d8f27){return request(_0x69a8('0x16'),{'options':{'where':{'id':_0x1d8f27},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x17')]=function(_0xf4f1e9){return request(_0x69a8('0x18'),{'options':{'where':{'id':_0xf4f1e9},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x19')]=function(_0x17dd62){return request(_0x69a8('0x1a'),{'options':{'where':{'id':_0x17dd62},'attributes':[_0x69a8('0x1b')]}});};exports['getUserById']=function(_0x2445d2){return request(_0x69a8('0x1c'),{'options':{'where':{'id':_0x2445d2},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x1d')]=function(_0x48a03c){return request(_0x69a8('0x1e'),{'options':{'where':{'id':_0x48a03c},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x1f')]=function(_0x3578ba){return request('ShowSound',{'options':{'where':{'id':_0x3578ba},'attributes':['save_name']}});};exports[_0x69a8('0x20')]=function(_0x1a374d){return request(_0x69a8('0x21'),{'options':{'raw':![],'where':{'id':_0x1a374d},'include':[{'model':_0x69a8('0x22'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x5108e9){return request(_0x69a8('0x23'),{'options':{'where':{'id':_0x5108e9},'attributes':['id',_0x69a8('0x13')]}});};exports[_0x69a8('0x24')]=function(_0x49c834){return request('CreateSmsMessage',{'body':_0x49c834});};exports['createSquareDetailsReport']=function(_0x49c022){return request(_0x69a8('0x25'),{'body':_0x49c022});};exports[_0x69a8('0x26')]=function(_0x171253){return request(_0x69a8('0x27'),{'body':_[_0x69a8('0x28')](_0x171253,{'project_name':_0x171253[_0x69a8('0x29')],'prev_project_name':_0x171253[_0x69a8('0x2a')]||'','is_subproject':_0x171253[_0x69a8('0x2a')]?!![]:![],'leaveAt':moment()[_0x69a8('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x19afcc){return request('CreateSquareRecording',{'body':_0x19afcc});};exports['createSquareMessage']=function(_0x287024){return request(_0x69a8('0x2c'),{'body':_0x287024});};exports[_0x69a8('0x2d')]=function(_0x73f9b2){return request(_0x69a8('0x2e'),{'options':{'raw':![],'where':{'phone':_0x73f9b2['phone'],'ListId':_0x73f9b2[_0x69a8('0x2f')]}}})['then'](function(_0x1eabef){if(_0x1eabef){return _0x1eabef;}return request('CreateCmContact',{'body':_0x73f9b2});});};exports[_0x69a8('0x30')]=function(_0x1e70eb){return request(_0x69a8('0x31'),{'options':{'where':{'id':_0x1e70eb},'attributes':[_0x69a8('0x13')]}});};exports[_0x69a8('0x32')]=function(_0x1f9995,_0x5478f3){return request(_0x69a8('0x33'),{'body':{'interface':_0x5478f3},'options':{'where':_0x1f9995}});};exports[_0x69a8('0x34')]=function(_0x25db84,_0x545f59,_0x366bea){return request(_0x69a8('0x35'),{'body':{'type':_0x545f59,'uniqueid':_0x366bea},'options':{'where':_0x25db84}});};exports['agentUnpause']=function(_0x2e3acb){return request(_0x69a8('0x36'),{'body':{},'options':{'where':_0x2e3acb}});};exports[_0x69a8('0x37')]=function(_0x3ed8dd){return request('LogoutUser',{'body':{},'options':{'where':_0x3ed8dd}});}; \ No newline at end of file +var _0x45d3=['result','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','then','error'];(function(_0x1ba963,_0x9cf7bc){var _0x5a2b88=function(_0x506212){while(--_0x506212){_0x1ba963['push'](_0x1ba963['shift']());}};_0x5a2b88(++_0x9cf7bc);}(_0x45d3,0xec));var _0x345d=function(_0x2003d0,_0x27a2b1){_0x2003d0=_0x2003d0-0x0;var _0xa12f02=_0x45d3[_0x2003d0];return _0xa12f02;};'use strict';var BPromise=require(_0x345d('0x0'));var moment=require(_0x345d('0x1'));var _=require(_0x345d('0x2'));var util=require('util');var jayson=require(_0x345d('0x3'));var client=jayson[_0x345d('0x4')][_0x345d('0x5')]({'port':0x2329});function request(_0xbaa60c,_0x4186ad){return new BPromise(function(_0x2e52b9,_0x5ac414){return client['request'](_0xbaa60c,_0x4186ad)[_0x345d('0x6')](function(_0x12f81e){if(_0x12f81e[_0x345d('0x7')]){return _0x5ac414(_0x12f81e[_0x345d('0x7')]['message']);}else{return _0x2e52b9(_0x12f81e[_0x345d('0x8')]);}})[_0x345d('0x9')](function(_0x1c3010){return _0x5ac414(_0x1c3010);});});}exports[_0x345d('0xa')]=function(_0x6dd5d7){return request(_0x345d('0xb'),{'options':{'raw':![],'where':{'name':_0x6dd5d7},'attributes':['production']}});};exports[_0x345d('0xc')]=function(_0x5b1a92){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x5b1a92},'include':[{'model':_0x345d('0xd'),'as':_0x345d('0xe')}],'attributes':['id',_0x345d('0xf'),_0x345d('0x10')]}});};exports[_0x345d('0x11')]=function(_0x36bdc7){return request(_0x345d('0xb'),{'options':{'where':{'id':_0x36bdc7},'attributes':[_0x345d('0xf')]}});};exports[_0x345d('0x12')]=function(_0x2f2a2b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2f2a2b},'attributes':['name']}});};exports[_0x345d('0x13')]=function(_0x42283c){return request(_0x345d('0x14'),{'options':{'where':{'id':_0x42283c},'attributes':[_0x345d('0xf')]}});};exports[_0x345d('0x15')]=function(_0xd506ee){return request(_0x345d('0x16'),{'options':{'where':{'id':_0xd506ee},'attributes':[_0x345d('0x17')]}});};exports[_0x345d('0x18')]=function(_0x21158f){return request(_0x345d('0x19'),{'options':{'where':{'id':_0x21158f},'attributes':[_0x345d('0xf')]}});};exports['getTrunkById']=function(_0x206707){return request(_0x345d('0x1a'),{'options':{'where':{'id':_0x206707},'attributes':['name']}});};exports[_0x345d('0x1b')]=function(_0x3f1fe3){return request(_0x345d('0x1c'),{'options':{'where':{'id':_0x3f1fe3},'attributes':[_0x345d('0x1d')]}});};exports['getIntervalById']=function(_0x597e22){return request(_0x345d('0x1e'),{'options':{'raw':![],'where':{'id':_0x597e22},'include':[{'model':_0x345d('0x1f'),'as':_0x345d('0x20')}]}});};exports[_0x345d('0x21')]=function(_0x3530ed){return request(_0x345d('0x22'),{'options':{'where':{'id':_0x3530ed},'attributes':['id',_0x345d('0xf')]}});};exports[_0x345d('0x23')]=function(_0x48469e){return request(_0x345d('0x24'),{'body':_0x48469e});};exports[_0x345d('0x25')]=function(_0x74306e){return request(_0x345d('0x26'),{'body':_0x74306e});};exports['createSquareReport']=function(_0x23d8f4){return request(_0x345d('0x27'),{'body':_[_0x345d('0x28')](_0x23d8f4,{'project_name':_0x23d8f4[_0x345d('0x29')],'prev_project_name':_0x23d8f4[_0x345d('0x2a')]||'','is_subproject':_0x23d8f4[_0x345d('0x2a')]?!![]:![],'leaveAt':moment()[_0x345d('0x2b')](_0x345d('0x2c'))})});};exports[_0x345d('0x2d')]=function(_0x1b943f){return request('CreateSquareRecording',{'body':_0x1b943f});};exports[_0x345d('0x2e')]=function(_0x3e0962){return request('CreateSquareMessage',{'body':_0x3e0962});};exports[_0x345d('0x2f')]=function(_0x5aa679){return request(_0x345d('0x30'),{'options':{'raw':![],'where':{'phone':_0x5aa679[_0x345d('0x31')],'ListId':_0x5aa679[_0x345d('0x32')]}}})['then'](function(_0x2bb3ed){if(_0x2bb3ed){return _0x2bb3ed;}return request(_0x345d('0x33'),{'body':_0x5aa679});});};exports[_0x345d('0x34')]=function(_0xeb4da3){return request(_0x345d('0x35'),{'options':{'where':{'id':_0xeb4da3},'attributes':[_0x345d('0xf')]}});};exports[_0x345d('0x36')]=function(_0x4f889f,_0x188890){return request(_0x345d('0x37'),{'body':{'interface':_0x188890},'options':{'where':_0x4f889f}});};exports[_0x345d('0x38')]=function(_0x2ff029,_0x593635,_0x9e549c){return request(_0x345d('0x39'),{'body':{'type':_0x593635,'uniqueid':_0x9e549c},'options':{'where':_0x2ff029}});};exports[_0x345d('0x3a')]=function(_0x5b01f6){return request(_0x345d('0x3b'),{'body':{},'options':{'where':_0x5b01f6}});};exports['agentLogout']=function(_0x5291af){return request(_0x345d('0x3c'),{'body':{},'options':{'where':_0x5291af}});}; \ 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 00eda53..d17beb9 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 _0x6657=['exports','./polly'];(function(_0x4e2430,_0x205543){var _0x53cce8=function(_0x5d9c7c){while(--_0x5d9c7c){_0x4e2430['push'](_0x4e2430['shift']());}};_0x53cce8(++_0x205543);}(_0x6657,0x17f));var _0x7665=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x6657[_0x513047];return _0x15b779;};var polly=require(_0x7665('0x0'));var lex=require('./lex');module[_0x7665('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x4cfd=['./polly','./lex'];(function(_0x43ad46,_0x461e3d){var _0x3759cd=function(_0x540840){while(--_0x540840){_0x43ad46['push'](_0x43ad46['shift']());}};_0x3759cd(++_0x461e3d);}(_0x4cfd,0x170));var _0xd4cf=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x4cfd[_0x55d8c5];return _0x225ae5;};var polly=require(_0xd4cf('0x0'));var lex=require(_0xd4cf('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 5ea547c..55862d6 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 _0xaa88=['exports','./lib/api'];(function(_0x475463,_0x1e1b77){var _0x490e41=function(_0x1a42bf){while(--_0x1a42bf){_0x475463['push'](_0x475463['shift']());}};_0x490e41(++_0x1e1b77);}(_0xaa88,0x137));var _0x8aa8=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xaa88[_0x43a37c];return _0x5d1d40;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x1f51cd,_0x5c1143){var _0x2fbbd1=function(_0x911bc5){while(--_0x911bc5){_0x1f51cd['push'](_0x1f51cd['shift']());}};_0x2fbbd1(++_0x5c1143);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ 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 bb35219..f13b13a 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(_0x1c2b4a,_0x596e55){var _0x519533=function(_0x33c054){while(--_0x33c054){_0x1c2b4a['push'](_0x1c2b4a['shift']());}};_0x519533(++_0x596e55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x292a21,_0x3df55b){var _0x3ab1b1=function(_0x2d0b7e){while(--_0x2d0b7e){_0x292a21['push'](_0x292a21['shift']());}};_0x3ab1b1(++_0x3df55b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 de86fcd..78dc402 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 _0x5572=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5572,0x7a));var _0x2557=function(_0x203fcb,_0x551c14){_0x203fcb=_0x203fcb-0x0;var _0x5c2be7=_0x5572[_0x203fcb];return _0x5c2be7;};'use strict';var polly=require('./lib/api');module[_0x2557('0x0')]=function(_0x19fd01,_0x532769,_0x585f16,_0x21675,_0x223575,_0x165fbe,_0x5a8f04){return polly(_0x19fd01,_0x532769,_0x585f16,_0x21675,_0x223575,_0x165fbe,_0x5a8f04);}; \ No newline at end of file +var _0xbce5=['./lib/api'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xbce5,0xcf));var _0x5bce=function(_0x122cc1,_0x5c956e){_0x122cc1=_0x122cc1-0x0;var _0x1e33af=_0xbce5[_0x122cc1];return _0x1e33af;};'use strict';var polly=require(_0x5bce('0x0'));module['exports']=function(_0x289f58,_0xbc0995,_0x450203,_0x5be1f2,_0xdf0478,_0x1f25d0,_0xfa1604){return polly(_0x289f58,_0xbc0995,_0x450203,_0x5be1f2,_0xdf0478,_0x1f25d0,_0xfa1604);}; \ 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 90a8291..c54a000 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 _0x1bb2=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','randomstring'];(function(_0x15add5,_0x3b5673){var _0x551a4c=function(_0x1d748f){while(--_0x1d748f){_0x15add5['push'](_0x15add5['shift']());}};_0x551a4c(++_0x3b5673);}(_0x1bb2,0x177));var _0x21bb=function(_0x5e1593,_0x3c40ed){_0x5e1593=_0x5e1593-0x0;var _0x1b953f=_0x1bb2[_0x5e1593];return _0x1b953f;};'use strict';var fs=require('fs');var path=require(_0x21bb('0x0'));var BPromise=require(_0x21bb('0x1'));var rs=require(_0x21bb('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x337fb3,_0x15f90f,_0x4741e4){return new BPromise(function(_0x4d14c6,_0x49e335){_0x337fb3['synthesizeSpeech'](_0x15f90f,function(_0x515bb5,_0xf16e3e){if(_0x515bb5){_0x49e335(_0x515bb5);}else if(_0xf16e3e){if(_0xf16e3e['AudioStream']instanceof Buffer){fs['writeFile'](_0x4741e4,_0xf16e3e['AudioStream'],function(_0x3482c3){if(_0x3482c3){_0x49e335(_0x3482c3);}else{_0x4d14c6();}});}else{_0x49e335(new Error(_0x21bb('0x3')));}}else{_0x49e335(new Error(_0x21bb('0x4')));}});});}module[_0x21bb('0x5')]=function(_0x11aa3b,_0x541900,_0x5a13c1,_0xf7e50,_0x571a98,_0x18b472,_0x5a756f){var _0x74b365=new AWS['Polly']({'accessKeyId':_0x11aa3b,'secretAccessKey':_0x541900,'region':_0x5a13c1});var _0x2b3e29={'Text':_0x571a98,'TextType':_0x18b472||_0x21bb('0x6'),'OutputFormat':'mp3','VoiceId':_0xf7e50};return pollyResult(_0x74b365,_0x2b3e29,_0x5a756f);}; \ No newline at end of file +var _0xa901=['exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa901,0x10c));var _0x1a90=function(_0x2e245e,_0x192f1c){_0x2e245e=_0x2e245e-0x0;var _0x3282ee=_0xa901[_0x2e245e];return _0x3282ee;};'use strict';var fs=require('fs');var path=require(_0x1a90('0x0'));var BPromise=require(_0x1a90('0x1'));var rs=require(_0x1a90('0x2'));var AWS=require(_0x1a90('0x3'));function pollyResult(_0xaed116,_0x41aa39,_0x8238a5){return new BPromise(function(_0x7b6e84,_0x5576a4){_0xaed116[_0x1a90('0x4')](_0x41aa39,function(_0x22b22a,_0x5d117d){if(_0x22b22a){_0x5576a4(_0x22b22a);}else if(_0x5d117d){if(_0x5d117d['AudioStream']instanceof Buffer){fs[_0x1a90('0x5')](_0x8238a5,_0x5d117d['AudioStream'],function(_0x52ba35){if(_0x52ba35){_0x5576a4(_0x52ba35);}else{_0x7b6e84();}});}else{_0x5576a4(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x5576a4(new Error(_0x1a90('0x6')));}});});}module[_0x1a90('0x7')]=function(_0x12ec2a,_0x56b10d,_0x281339,_0x191401,_0x4172d0,_0x1b5aa,_0x164bb0){var _0x52cfbb=new AWS[(_0x1a90('0x8'))]({'accessKeyId':_0x12ec2a,'secretAccessKey':_0x56b10d,'region':_0x281339});var _0x11b6cc={'Text':_0x4172d0,'TextType':_0x1b5aa||_0x1a90('0x9'),'OutputFormat':_0x1a90('0xa'),'VoiceId':_0x191401};return pollyResult(_0x52cfbb,_0x11b6cc,_0x164bb0);}; \ 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 51449d2..da13339 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 _0x59d4=['exports','./lib/api'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x59d4,0x89));var _0x459d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x59d4[_0x122ef9];return _0x42fba0;};'use strict';var asr=require(_0x459d('0x0'));module[_0x459d('0x1')]=function(_0x44b935,_0x179b1e,_0x95a8bb,_0x413410){return asr(_0x44b935,_0x179b1e,_0x95a8bb);}; \ No newline at end of file +var _0x6221=['exports','./lib/api'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x6221,0x1f3));var _0x1622=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x6221[_0x220dbb];return _0x2b77de;};'use strict';var asr=require(_0x1622('0x0'));module[_0x1622('0x1')]=function(_0x569fee,_0xbb5d21,_0x4669bf,_0x51965f){return asr(_0x569fee,_0xbb5d21,_0x4669bf);}; \ 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 2c776b8..cc313ed 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 _0x22fb=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','https://speech.googleapis.com'];(function(_0x218819,_0x4b151a){var _0x5d3a33=function(_0x4cd6af){while(--_0x4cd6af){_0x218819['push'](_0x218819['shift']());}};_0x5d3a33(++_0x4b151a);}(_0x22fb,0x192));var _0xb22f=function(_0x54b8ea,_0x1a4c77){_0x54b8ea=_0x54b8ea-0x0;var _0x6b73e7=_0x22fb[_0x54b8ea];return _0x6b73e7;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xb22f('0x0');module['exports']=function(_0x3f643d,_0x306b6e,_0x2221f1){return new BPromise(function(_0x10d2c4,_0x201512){var _0x50cdab;if(typeof _0x3f643d!==_0xb22f('0x1')||_0x3f643d[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x3'));}if(typeof _0x306b6e!==_0xb22f('0x1')||_0x306b6e[_0xb22f('0x2')]===0x0){return _0x201512(_0xb22f('0x4'));}if(typeof _0x2221f1!=='undefined'&&(typeof _0x2221f1!==_0xb22f('0x1')||_0x2221f1[_0xb22f('0x2')]===0x0)){return _0x201512(_0xb22f('0x5'));}try{_0x50cdab=fs[_0xb22f('0x6')](_0x3f643d)[_0xb22f('0x7')](_0xb22f('0x8'));}catch(_0x188cea){return _0x201512(_0x188cea);}return _0x10d2c4({'method':_0xb22f('0x9'),'uri':host+_0xb22f('0xa')+_0x306b6e,'body':{'config':{'encoding':_0xb22f('0xb'),'sampleRateHertz':_0xb22f('0xc'),'languageCode':_0x2221f1},'audio':{'content':_0x50cdab}},'json':!![]});});}; \ No newline at end of file +var _0x1d5b=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','string','length'];(function(_0x173336,_0x3f98c4){var _0x12dc79=function(_0xae7bf5){while(--_0xae7bf5){_0x173336['push'](_0x173336['shift']());}};_0x12dc79(++_0x3f98c4);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x5d4c17,_0xe44f75){_0x5d4c17=_0x5d4c17-0x0;var _0x143b5b=_0x1d5b[_0x5d4c17];return _0x143b5b;};'use strict';var url=require(_0xb1d5('0x0'));var BPromise=require(_0xb1d5('0x1'));var fs=require('fs');var host=_0xb1d5('0x2');module['exports']=function(_0x2739cc,_0x594c25,_0x2f9c5a){return new BPromise(function(_0x1a673c,_0xa12a1e){var _0x3ee65c;if(typeof _0x2739cc!=='string'||_0x2739cc['length']===0x0){return _0xa12a1e(_0xb1d5('0x3'));}if(typeof _0x594c25!==_0xb1d5('0x4')||_0x594c25[_0xb1d5('0x5')]===0x0){return _0xa12a1e(_0xb1d5('0x6'));}if(typeof _0x2f9c5a!==_0xb1d5('0x7')&&(typeof _0x2f9c5a!==_0xb1d5('0x4')||_0x2f9c5a[_0xb1d5('0x5')]===0x0)){return _0xa12a1e(_0xb1d5('0x8'));}try{_0x3ee65c=fs['readFileSync'](_0x2739cc)[_0xb1d5('0x9')](_0xb1d5('0xa'));}catch(_0x56fc2d){return _0xa12a1e(_0x56fc2d);}return _0x1a673c({'method':'POST','uri':host+_0xb1d5('0xb')+_0x594c25,'body':{'config':{'encoding':_0xb1d5('0xc'),'sampleRateHertz':_0xb1d5('0xd'),'languageCode':_0x2f9c5a},'audio':{'content':_0x3ee65c}},'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 4485d85..fc1fa97 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 _0x1e68=['./asr'];(function(_0x5f5704,_0x4746bc){var _0x345bfe=function(_0x59d3c2){while(--_0x59d3c2){_0x5f5704['push'](_0x5f5704['shift']());}};_0x345bfe(++_0x4746bc);}(_0x1e68,0x1da));var _0x81e6=function(_0x474b2e,_0x2b19db){_0x474b2e=_0x474b2e-0x0;var _0x549ed5=_0x1e68[_0x474b2e];return _0x549ed5;};var asr=require(_0x81e6('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xbe1c=['exports'];(function(_0xd5bafe,_0x3c72a5){var _0x262979=function(_0x4659a6){while(--_0x4659a6){_0xd5bafe['push'](_0xd5bafe['shift']());}};_0x262979(++_0x3c72a5);}(_0xbe1c,0xf0));var _0xcbe1=function(_0x7f1086,_0x434356){_0x7f1086=_0x7f1086-0x0;var _0x358a47=_0xbe1c[_0x7f1086];return _0x358a47;};var asr=require('./asr');module[_0xcbe1('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index b55f916..a32ac0f 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 _0xe7f1=['./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','path','WHAT_EVER','get','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','statusCode','createWriteStream','finish','info','finish\x20download\x20file','error','unlink','pipe','end','protocol','data','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','intent','isFallback','languageCode','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','apiai-promise','bluebird','dialogflow','http','https','md5','querystring','randomstring','parse','util'];(function(_0x2030f0,_0x17465a){var _0x5d6873=function(_0x4fffb6){while(--_0x4fffb6){_0x2030f0['push'](_0x2030f0['shift']());}};_0x5d6873(++_0x17465a);}(_0xe7f1,0xfa));var _0x1e7f=function(_0x5524e9,_0x19b5fd){_0x5524e9=_0x5524e9-0x0;var _0x4f6a46=_0xe7f1[_0x5524e9];return _0x4f6a46;};'use strict';var apiai=require(_0x1e7f('0x0'));var BPromise=require(_0x1e7f('0x1'));var dialogflow=require(_0x1e7f('0x2'));var fs=require('fs');var http=require(_0x1e7f('0x3'));var https=require(_0x1e7f('0x4'));var md5=require(_0x1e7f('0x5'));var path=require('path');var querystring=require(_0x1e7f('0x6'));var rp=require('request-promise');var rs=require(_0x1e7f('0x7'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require('url')[_0x1e7f('0x8')];var util=require(_0x1e7f('0x9'));var aws=require(_0x1e7f('0xa'));var google=require(_0x1e7f('0xb'));var sestek=require(_0x1e7f('0xc'));var tilde=require('./tilde');var logger=require(_0x1e7f('0xd'))(_0x1e7f('0xe'));var ISPEECH_API=_0x1e7f('0xf');function downloadFile(_0x554c96,_0x2c0418){return new BPromise(function(_0x723762,_0x20e451){var _0x1bd763=urlParse(_0x554c96);var _0x33613b=_0x1bd763['protocol']===_0x1e7f('0x10')?https:http;var _0x1fa276={'host':_0x1bd763[_0x1e7f('0x11')],'path':_0x1bd763[_0x1e7f('0x12')],'headers':{'user-agent':_0x1e7f('0x13')}};_0x33613b[_0x1e7f('0x14')](_0x1fa276,function(_0x20394f){if(_0x20394f['statusCode']!==0xc8){logger['error'](_0x1e7f('0x15')+_0x554c96+'\x20failed,\x20status\x20code\x20=\x20'+_0x20394f['statusCode']+'\x20('+_0x20394f[_0x1e7f('0x16')]+')');_0x20e451(new Error(_0x1e7f('0x15')+_0x554c96+_0x1e7f('0x17')+_0x20394f[_0x1e7f('0x18')]+'\x20('+_0x20394f['statusMessage']+')'));return;}var _0x55d2da=fs[_0x1e7f('0x19')](_0x2c0418);_0x55d2da['on'](_0x1e7f('0x1a'),function(){logger[_0x1e7f('0x1b')](_0x1e7f('0x1c'));_0x55d2da['close'](_0x723762);});_0x55d2da['on'](_0x1e7f('0x1d'),function(_0x72167){fs[_0x1e7f('0x1e')](_0x2c0418);logger[_0x1e7f('0x1d')]('download\x20error',_0x72167);_0x20e451(_0x72167);});_0x20394f[_0x1e7f('0x1f')](_0x55d2da);})['on'](_0x1e7f('0x1d'),function(_0x438a99){logger[_0x1e7f('0x1d')](_0x438a99);_0x20e451(_0x438a99);})[_0x1e7f('0x20')]();});}function uploadFile(_0x2acf98){return new BPromise(function(_0x5b2d2a,_0x453a36){var _0x3ac77b=urlParse(_0x2acf98);var _0x312f35=_0x3ac77b[_0x1e7f('0x21')]==='https:'?https:http;var _0x43d69a={'host':_0x3ac77b[_0x1e7f('0x11')],'path':_0x3ac77b[_0x1e7f('0x12')],'headers':{'user-agent':_0x1e7f('0x13')}};_0x312f35[_0x1e7f('0x14')](_0x43d69a,function(_0x158137){if(_0x158137['statusCode']!==0xc8){_0x453a36(new Error(_0x1e7f('0x15')+_0x2acf98+_0x1e7f('0x17')+_0x158137['statusCode']+'\x20('+_0x158137[_0x1e7f('0x16')]+')'));return;}var _0x283dd1='';_0x158137['on'](_0x1e7f('0x22'),function(_0x59d778){_0x283dd1+=_0x59d778;});_0x158137['on'](_0x1e7f('0x20'),function(){_0x5b2d2a(_0x283dd1);});})['on']('error',function(_0x444ae3){_0x453a36(_0x444ae3);})[_0x1e7f('0x20')]();});}function convertFile(_0x38d2e7,_0x128c2a){return new BPromise(function(_0x40e0f2,_0x1b2014){var _0x116f04=sox['transcode'](_0x38d2e7,_0x128c2a,{'sampleRate':0x1f40,'format':_0x1e7f('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x116f04['on']('error',function(_0x5a20d7){logger[_0x1e7f('0x1d')](_0x1e7f('0x24'),_0x5a20d7);_0x1b2014(_0x5a20d7);});_0x116f04['on'](_0x1e7f('0x20'),function(){logger[_0x1e7f('0x1b')](_0x1e7f('0x25'));_0x40e0f2();});_0x116f04['start']();});}function base64Decode(_0x51f8de,_0x331c2d){var _0x352853=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+_0x1e7f('0x29'));fs[_0x1e7f('0x2a')](_0x352853,_0x51f8de,_0x1e7f('0x2b'));return convertFile(_0x352853,_0x331c2d)['then'](function(){try{fs[_0x1e7f('0x1e')](_0x352853);fs['chmodSync'](_0x331c2d,_0x1e7f('0x2c'));}catch(_0x1cb58a){logger['error'](_0x1cb58a);}return _0x331c2d[_0x1e7f('0x2d')]('.')[0x0];});}function base64Encode(_0x14a162){var _0xfc0ab=fs['readFileSync'](_0x14a162);return new Buffer(_0xfc0ab)[_0x1e7f('0x2e')](_0x1e7f('0x2b'));}exports[_0x1e7f('0x2f')]=function(_0x228a33,_0x262b53,_0x34a972,_0xb070ae,_0x163961,_0x4a84ba){var _0xbb41fb,_0x26d8a8;var _0x531418=_0x1e7f('0x30');var _0x67f481='?key='+_0x228a33;var _0x1bc7a0={};if(_0x262b53===_0x1e7f('0x31')){_0x1bc7a0[_0x1e7f('0x32')]={'ssml':_0x34a972};}else{_0x1bc7a0[_0x1e7f('0x32')]={'text':_0x34a972};};_0x1bc7a0[_0x1e7f('0x33')]={'languageCode':_0xb070ae,'ssmlGender':_0x163961};_0x1bc7a0[_0x1e7f('0x34')]={'audioEncoding':_0x1e7f('0x35'),'sampleRateHertz':0x1f40};var _0x3b4e8b={'url':_0x531418+_0x1e7f('0x36')+_0x67f481,'method':_0x1e7f('0x37'),'json':!![],'body':_0x1bc7a0};return rp(_0x3b4e8b)[_0x1e7f('0x38')](function(_0x418c5e){return new BPromise(function(_0x1691bb,_0x1733f2){_0xbb41fb=path['resolve'](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+'.mp3');var _0x80efd6=Buffer[_0x1e7f('0x39')](_0x418c5e[_0x1e7f('0x3a')],'base64');return fs[_0x1e7f('0x3b')](_0xbb41fb,_0x80efd6,function(_0x21d38b){_0x1733f2(_0x21d38b);},function(_0x3d0c12){fs[_0x1e7f('0x3c')](_0xbb41fb,'777');_0x1691bb(_0x3d0c12);});});})['then'](function(_0x1db924){_0x26d8a8=path['resolve'](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+'.wav');return convertFile(_0xbb41fb,_0x26d8a8);})[_0x1e7f('0x38')](function(){try{fs['unlink'](_0xbb41fb);fs[_0x1e7f('0x3c')](_0x26d8a8,_0x1e7f('0x2c'));}catch(_0x451ded){logger[_0x1e7f('0x1d')](_0x451ded);}logger['info'](_0x1e7f('0x3d'),_0x26d8a8[_0x1e7f('0x2d')]('.')[0x0]);return _0x26d8a8[_0x1e7f('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x170c5f,_0x366d9d){var _0x1468c5=_0x1e7f('0x3e');var _0x1dc3ab,_0x8d3a3b;var _0x182902;var _0x2af2ab={'encoding':_0x1e7f('0x3f'),'method':_0x1e7f('0x37'),'timeout':0x2710,'url':_0x1468c5,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x1e7f('0x40')]([_0x170c5f,_0x366d9d||'en',![],_0x1e7f('0x41')]),null,'generic']]]))};return rp(_0x2af2ab)[_0x1e7f('0x38')](function(_0x142efa){try{_0x182902=eval(_0x142efa[_0x1e7f('0x42')](0x5))[0x0][0x2];}catch(_0x449d5b){throw new Error(_0x1e7f('0x43')+_0x142efa[_0x1e7f('0x22')]);}if(!_0x182902){if(_0x170c5f[_0x1e7f('0x44')]>0xc8){throw new Error(_0x1e7f('0x45'));}else{throw new Error(_0x1e7f('0x46')+_0x366d9d+_0x1e7f('0x47'));}}try{_0x182902=eval(_0x182902)[0x0];}catch(_0x18fc34){throw new Error(_0x1e7f('0x43')+res[_0x1e7f('0x22')]);}const _0x413ee5=_0x182902;_0x1dc3ab=path['resolve'](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+'.mp3');fs['writeFileSync'](_0x1dc3ab,_0x182902,{'encoding':'base64'});_0x8d3a3b=path['resolve'](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+_0x1e7f('0x29'));return convertFile(_0x1dc3ab,_0x8d3a3b);})[_0x1e7f('0x38')](function(){try{fs[_0x1e7f('0x1e')](_0x1dc3ab);fs[_0x1e7f('0x3c')](_0x8d3a3b,_0x1e7f('0x2c'));}catch(_0x27f802){logger[_0x1e7f('0x1d')](_0x27f802);}logger[_0x1e7f('0x1b')](_0x1e7f('0x48'),_0x8d3a3b['split']('.')[0x0]);return _0x8d3a3b[_0x1e7f('0x2d')]('.')[0x0];});};exports[_0x1e7f('0x49')]=function(_0x2790fd,_0x502ec9,_0x5ef6b2){return google[_0x1e7f('0x4a')](_0x2790fd,_0x502ec9,_0x5ef6b2)[_0x1e7f('0x38')](function(_0x148929){logger[_0x1e7f('0x1b')](_0x148929[_0x1e7f('0x4b')]);return rp(_0x148929);})[_0x1e7f('0x38')](function(_0x58716f){var _0x25e5fb='';var _0x2f8f7c=0x0;try{fs[_0x1e7f('0x1e')](_0x2790fd);}catch(_0x5eda34){logger[_0x1e7f('0x1d')](_0x5eda34);}if(_0x58716f&&_0x58716f[_0x1e7f('0x4c')]){_0x25e5fb=_0x58716f[_0x1e7f('0x4c')][_0x1e7f('0x4d')](function(_0x1335dd){return _0x1335dd&&_0x1335dd['alternatives'][0x0]&&_0x1335dd[_0x1e7f('0x4e')][0x0][_0x1e7f('0x4f')]?_0x1335dd[_0x1e7f('0x4e')][0x0][_0x1e7f('0x4f')]:'';})[_0x1e7f('0x50')]('\x0a');_0x2f8f7c=_0x58716f['results']['map'](function(_0x48465e){return _0x48465e&&_0x48465e['alternatives'][0x0]&&_0x48465e['alternatives'][0x0][_0x1e7f('0x51')]?_0x48465e[_0x1e7f('0x4e')][0x0][_0x1e7f('0x51')]:0x0;})[_0x1e7f('0x50')]('\x0a');}logger[_0x1e7f('0x1b')](_0x1e7f('0x52'),_0x25e5fb);logger['info'](_0x1e7f('0x53'),_0x2f8f7c);return{'transcript':_0x25e5fb,'confidence':_0x2f8f7c};})[_0x1e7f('0x54')](function(_0x4e8287){logger[_0x1e7f('0x1d')](_0x1e7f('0x55'),_0x4e8287[_0x1e7f('0x18')],_0x4e8287[_0x1e7f('0x56')],_0x4e8287[_0x1e7f('0x57')]);});};exports[_0x1e7f('0x58')]=function(_0x33576d,_0x169813,_0xa17522,_0x409e66){var _0x4bf4b7=apiai(_0x169813,{'language':_0x409e66||'en'});return _0x4bf4b7[_0x1e7f('0x59')](_0xa17522,{'sessionId':md5(_0x33576d)})[_0x1e7f('0x38')](function(_0xd21202){logger[_0x1e7f('0x1b')](JSON[_0x1e7f('0x40')](_0xd21202));return{'source':_0xd21202[_0x1e7f('0x5a')]['source'],'resolvedQuery':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x5b')],'action':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x5c')],'actionIncomplete':_0xd21202['result'][_0x1e7f('0x5d')],'speech':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x5e')][_0x1e7f('0x5f')],'score':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x60')],'statusCode':_0xd21202[_0x1e7f('0x61')][_0x1e7f('0x62')],'endConversation':_0xd21202[_0x1e7f('0x5a')][_0x1e7f('0x63')][_0x1e7f('0x64')]||![],'isFallbackIntent':_0xd21202[_0x1e7f('0x5a')]['metadata']['isFallbackIntent']};});};exports[_0x1e7f('0x65')]=function(_0x53d591,_0x1c9063,_0x24588b,_0x2624b6,_0x3b3a45,_0x554d6e){var _0x386807=_0x2624b6[_0x1e7f('0x66')](/\\n/g,'\x0a');var _0x1ed35b={'credentials':{'private_key':_0x386807,'client_email':_0x24588b}};var _0x5b752a=new dialogflow[(_0x1e7f('0x67'))](_0x1ed35b);var _0x3010a7=_0x5b752a['sessionPath'](_0x1c9063,md5(_0x53d591));var _0x56ab78={'session':_0x3010a7,'queryInput':{'text':{'text':_0x3b3a45,'languageCode':_0x554d6e}}};return _0x5b752a[_0x1e7f('0x68')](_0x56ab78)[_0x1e7f('0x38')](function(_0x1ee344){if(_0x1ee344&&_0x1ee344[_0x1e7f('0x44')]){logger[_0x1e7f('0x1b')](_0x1e7f('0x69'),JSON[_0x1e7f('0x40')](_0x1ee344));var _0x20ef3a=_0x1ee344[0x0];if(_0x20ef3a){var _0xf4d9be={'action':_0x20ef3a['queryResult'][_0x1e7f('0x5c')],'allRequiredParamsPresent':_0x20ef3a[_0x1e7f('0x6a')]['allRequiredParamsPresent'],'endConversation':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6b')]&&_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6b')][_0x1e7f('0x6c')]?_0x20ef3a['queryResult'][_0x1e7f('0x6b')][_0x1e7f('0x6c')][_0x1e7f('0x6d')]['boolValue']:![],'fulfillmentText':_0x20ef3a[_0x1e7f('0x6a')]['fulfillmentText'],'intentName':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6e')][_0x1e7f('0x56')],'intentDisplayName':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6e')]['displayName'],'isFallbackIntent':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x6e')][_0x1e7f('0x6f')],'languageCode':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x70')],'queryText':_0x20ef3a[_0x1e7f('0x6a')]['queryText'],'responseId':_0x20ef3a['responseId'],'score':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x71')],'speech':_0x20ef3a[_0x1e7f('0x6a')][_0x1e7f('0x72')],'providerResponse':JSON[_0x1e7f('0x40')](_0x1ee344)};return _0xf4d9be;}}});};exports[_0x1e7f('0x73')]=function(_0xac1db7,_0x4a3f01,_0x279327,_0x51c0fd){return tilde[_0x1e7f('0x4a')](_0xac1db7,_0x4a3f01,_0x279327,_0x51c0fd)[_0x1e7f('0x38')](function(_0x19377d){try{fs['unlink'](_0xac1db7);}catch(_0x49f68e){logger[_0x1e7f('0x1d')](_0x49f68e);}logger['info'](_0x1e7f('0x74'),_0x19377d[_0x1e7f('0x4f')]);logger[_0x1e7f('0x1b')](_0x1e7f('0x75'),_0x19377d[_0x1e7f('0x51')]);return _0x19377d;});};exports[_0x1e7f('0x76')]=function(_0x585e45,_0x2df3a4,_0x581e2d,_0x142234,_0x52956a,_0x397999){var _0x1a8df0=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+_0x1e7f('0x77'));var _0x5f1153;return aws[_0x1e7f('0x78')](_0x585e45,_0x2df3a4,_0x581e2d,_0x142234,_0x52956a,_0x397999,_0x1a8df0)[_0x1e7f('0x38')](function(){_0x5f1153=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+_0x1e7f('0x29'));return convertFile(_0x1a8df0,_0x5f1153);})['then'](function(){try{fs[_0x1e7f('0x1e')](_0x1a8df0);fs['chmodSync'](_0x5f1153,_0x1e7f('0x2c'));}catch(_0x2508d0){logger['error'](_0x2508d0);}return _0x5f1153[_0x1e7f('0x2d')]('.')[0x0];});};exports['awsLex']=function(_0x4af280,_0x471a1c,_0x43efe0,_0x20cef6,_0x36d4be,_0x1d4848){return aws['lex'](_0x4af280,_0x471a1c,_0x43efe0,_0x20cef6,_0x36d4be,_0x1d4848)[_0x1e7f('0x38')](function(_0x3ab4b7){logger[_0x1e7f('0x1b')](JSON[_0x1e7f('0x40')](_0x3ab4b7));return _0x3ab4b7;});};exports[_0x1e7f('0x79')]=function(_0x203ab4,_0x4dc01b,_0x115353,_0x2fd39d){var _0x5ea76d=util['format'](_0x1e7f('0x7a'),ISPEECH_API,_0x203ab4,encodeURIComponent(_0x4dc01b),_0x115353,_0x2fd39d);var _0x487c5c=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs[_0x1e7f('0x28')](0x4)+'.mp3');var _0x4669a9;return downloadFile(_0x5ea76d,_0x487c5c)['then'](function(){_0x4669a9=path[_0x1e7f('0x26')](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+_0x1e7f('0x29'));return convertFile(_0x487c5c,_0x4669a9);})[_0x1e7f('0x38')](function(){try{fs[_0x1e7f('0x1e')](_0x487c5c);fs[_0x1e7f('0x3c')](_0x4669a9,'777');}catch(_0x268ad4){logger[_0x1e7f('0x1d')](_0x268ad4);}return _0x4669a9[_0x1e7f('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x392b48,_0x4c7990,_0x4e5dbc,_0x54a77d){var _0x1e0c33=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4c7990,_0x4e5dbc,base64Encode(_0x392b48),_0x54a77d?util['format']('model=%s',encodeURIComponent(_0x54a77d)):'freeform=3');return uploadFile(_0x1e0c33)[_0x1e7f('0x38')](function(_0x1716a0){return querystring[_0x1e7f('0x8')](_0x1716a0);});};exports[_0x1e7f('0x7b')]=function(_0x1b0063,_0x592d34){return sestek[_0x1e7f('0x7c')](_0x1b0063,_0x592d34)['then'](function(_0x3ea76e){logger[_0x1e7f('0x1b')](JSON['stringify'](_0x3ea76e));var _0x4b4b56={'speech':_0x3ea76e['text'],'action':_0x3ea76e[_0x1e7f('0x7d')]?_0x3ea76e['channelData'][_0x1e7f('0x7e')]:undefined,'actiondata':_0x3ea76e[_0x1e7f('0x7d')]?_0x3ea76e[_0x1e7f('0x7d')][_0x1e7f('0x7f')]:undefined};if(_0x3ea76e['channelData']&&_0x3ea76e['channelData'][_0x1e7f('0x80')]){return base64Decode(_0x3ea76e['channelData'][_0x1e7f('0x80')][_0x1e7f('0x81')],path['resolve'](__dirname,_0x1e7f('0x27'),rs['generate'](0x4)+_0x1e7f('0x29')))[_0x1e7f('0x38')](function(_0x4a8685){_0x4b4b56['audiofile']=_0x4a8685;return _0x4b4b56;});}return _0x4b4b56;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xbf5b=['ssml','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','tmp','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','resolvedQuery','result','fulfillment','speech','score','status','code','metadata','googleDialogflowV2','replace','SessionsClient','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','transcode','wav','error\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','toString','googleCloudTTS','?key='];(function(_0xa6d770,_0x36f19f){var _0x5e5f22=function(_0x151265){while(--_0x151265){_0xa6d770['push'](_0xa6d770['shift']());}};_0x5e5f22(++_0x36f19f);}(_0xbf5b,0x17a));var _0xbbf5=function(_0x58952f,_0xeed25f){_0x58952f=_0x58952f-0x0;var _0x3217ca=_0xbf5b[_0x58952f];return _0x3217ca;};'use strict';var apiai=require(_0xbbf5('0x0'));var BPromise=require(_0xbbf5('0x1'));var dialogflow=require(_0xbbf5('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xbbf5('0x3'));var md5=require(_0xbbf5('0x4'));var path=require(_0xbbf5('0x5'));var querystring=require(_0xbbf5('0x6'));var rp=require(_0xbbf5('0x7'));var rs=require(_0xbbf5('0x8'));var sox=require(_0xbbf5('0x9'));var tts=require('google-tts-api');var urlParse=require(_0xbbf5('0xa'))[_0xbbf5('0xb')];var util=require(_0xbbf5('0xc'));var aws=require(_0xbbf5('0xd'));var google=require(_0xbbf5('0xe'));var sestek=require(_0xbbf5('0xf'));var tilde=require(_0xbbf5('0x10'));var logger=require(_0xbbf5('0x11'))('agi');var ISPEECH_API=_0xbbf5('0x12');function downloadFile(_0x2f79c8,_0x904a5e){return new BPromise(function(_0x1927ad,_0x1ac394){var _0xe9f4ee=urlParse(_0x2f79c8);var _0x2c46f8=_0xe9f4ee[_0xbbf5('0x13')]===_0xbbf5('0x14')?https:http;var _0x2266fb={'host':_0xe9f4ee[_0xbbf5('0x15')],'path':_0xe9f4ee['path'],'headers':{'user-agent':_0xbbf5('0x16')}};_0x2c46f8[_0xbbf5('0x17')](_0x2266fb,function(_0x268456){if(_0x268456[_0xbbf5('0x18')]!==0xc8){logger[_0xbbf5('0x19')](_0xbbf5('0x1a')+_0x2f79c8+_0xbbf5('0x1b')+_0x268456[_0xbbf5('0x18')]+'\x20('+_0x268456[_0xbbf5('0x1c')]+')');_0x1ac394(new Error(_0xbbf5('0x1a')+_0x2f79c8+_0xbbf5('0x1b')+_0x268456['statusCode']+'\x20('+_0x268456[_0xbbf5('0x1c')]+')'));return;}var _0x468da3=fs[_0xbbf5('0x1d')](_0x904a5e);_0x468da3['on'](_0xbbf5('0x1e'),function(){logger[_0xbbf5('0x1f')](_0xbbf5('0x20'));_0x468da3[_0xbbf5('0x21')](_0x1927ad);});_0x468da3['on'](_0xbbf5('0x19'),function(_0x367f9d){fs[_0xbbf5('0x22')](_0x904a5e);logger['error'](_0xbbf5('0x23'),_0x367f9d);_0x1ac394(_0x367f9d);});_0x268456[_0xbbf5('0x24')](_0x468da3);})['on'](_0xbbf5('0x19'),function(_0x2856ed){logger[_0xbbf5('0x19')](_0x2856ed);_0x1ac394(_0x2856ed);})[_0xbbf5('0x25')]();});}function uploadFile(_0x41e999){return new BPromise(function(_0x40a73a,_0x14d832){var _0x52947e=urlParse(_0x41e999);var _0x13fe8d=_0x52947e[_0xbbf5('0x13')]==='https:'?https:http;var _0x32eb05={'host':_0x52947e[_0xbbf5('0x15')],'path':_0x52947e[_0xbbf5('0x5')],'headers':{'user-agent':_0xbbf5('0x16')}};_0x13fe8d['get'](_0x32eb05,function(_0x2c1247){if(_0x2c1247[_0xbbf5('0x18')]!==0xc8){_0x14d832(new Error(_0xbbf5('0x1a')+_0x41e999+_0xbbf5('0x1b')+_0x2c1247['statusCode']+'\x20('+_0x2c1247[_0xbbf5('0x1c')]+')'));return;}var _0x3b7c97='';_0x2c1247['on']('data',function(_0x325e14){_0x3b7c97+=_0x325e14;});_0x2c1247['on'](_0xbbf5('0x25'),function(){_0x40a73a(_0x3b7c97);});})['on'](_0xbbf5('0x19'),function(_0x5338fb){_0x14d832(_0x5338fb);})[_0xbbf5('0x25')]();});}function convertFile(_0x4c7363,_0x5a1f50){return new BPromise(function(_0x57dbe0,_0x3ba771){var _0x180843=sox[_0xbbf5('0x26')](_0x4c7363,_0x5a1f50,{'sampleRate':0x1f40,'format':_0xbbf5('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x180843['on'](_0xbbf5('0x19'),function(_0x2f0af3){logger['error'](_0xbbf5('0x28'),_0x2f0af3);_0x3ba771(_0x2f0af3);});_0x180843['on'](_0xbbf5('0x25'),function(){logger['info']('finish\x20to\x20convert');_0x57dbe0();});_0x180843[_0xbbf5('0x29')]();});}function base64Decode(_0x5b1cd5,_0x363913){var _0x4d5048=path[_0xbbf5('0x2a')](__dirname,'tmp',rs[_0xbbf5('0x2b')](0x4)+_0xbbf5('0x2c'));fs[_0xbbf5('0x2d')](_0x4d5048,_0x5b1cd5,_0xbbf5('0x2e'));return convertFile(_0x4d5048,_0x363913)[_0xbbf5('0x2f')](function(){try{fs[_0xbbf5('0x22')](_0x4d5048);fs[_0xbbf5('0x30')](_0x363913,_0xbbf5('0x31'));}catch(_0x4343dc){logger[_0xbbf5('0x19')](_0x4343dc);}return _0x363913[_0xbbf5('0x32')]('.')[0x0];});}function base64Encode(_0x1196b9){var _0x21d7ee=fs['readFileSync'](_0x1196b9);return new Buffer(_0x21d7ee)[_0xbbf5('0x33')]('base64');}exports[_0xbbf5('0x34')]=function(_0x5981b8,_0x390260,_0x24562a,_0x33243c,_0x54ed90,_0x267ca9){var _0x5e2dfd,_0x504e75;var _0x3523ec='https://texttospeech.googleapis.com/v1/';var _0xa7071a=_0xbbf5('0x35')+_0x5981b8;var _0x5ab905={};if(_0x390260===_0xbbf5('0x36')){_0x5ab905['input']={'ssml':_0x24562a};}else{_0x5ab905['input']={'text':_0x24562a};};_0x5ab905[_0xbbf5('0x37')]={'languageCode':_0x33243c,'ssmlGender':_0x54ed90};_0x5ab905[_0xbbf5('0x38')]={'audioEncoding':_0xbbf5('0x39'),'sampleRateHertz':0x1f40};var _0xcc5b94={'url':_0x3523ec+_0xbbf5('0x3a')+_0xa7071a,'method':_0xbbf5('0x3b'),'json':!![],'body':_0x5ab905};return rp(_0xcc5b94)['then'](function(_0x1dcfd5){return new BPromise(function(_0x55f98e,_0x9e27ee){_0x5e2dfd=path[_0xbbf5('0x2a')](__dirname,'tmp',rs[_0xbbf5('0x2b')](0x4)+_0xbbf5('0x3c'));var _0x3d3195=Buffer['from'](_0x1dcfd5[_0xbbf5('0x3d')],_0xbbf5('0x2e'));return fs[_0xbbf5('0x3e')](_0x5e2dfd,_0x3d3195,function(_0x10b160){_0x9e27ee(_0x10b160);},function(_0x3664cd){fs['chmodSync'](_0x5e2dfd,_0xbbf5('0x31'));_0x55f98e(_0x3664cd);});});})[_0xbbf5('0x2f')](function(_0xcc8142){_0x504e75=path[_0xbbf5('0x2a')](__dirname,_0xbbf5('0x3f'),rs[_0xbbf5('0x2b')](0x4)+_0xbbf5('0x2c'));return convertFile(_0x5e2dfd,_0x504e75);})[_0xbbf5('0x2f')](function(){try{fs['unlink'](_0x5e2dfd);fs['chmodSync'](_0x504e75,_0xbbf5('0x31'));}catch(_0x69672e){logger[_0xbbf5('0x19')](_0x69672e);}logger[_0xbbf5('0x1f')](_0xbbf5('0x40'),_0x504e75[_0xbbf5('0x32')]('.')[0x0]);return _0x504e75[_0xbbf5('0x32')]('.')[0x0];});};exports[_0xbbf5('0x41')]=function(_0x4f437f,_0x380ea6){var _0x48b23e=_0xbbf5('0x42');var _0x589488,_0x5df0c7;var _0x1df3fb;var _0x1008d7={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x48b23e,'headers':{'Content-Type':_0xbbf5('0x43')},'body':_0xbbf5('0x44')+encodeURIComponent(JSON[_0xbbf5('0x45')]([[[_0xbbf5('0x46'),JSON[_0xbbf5('0x45')]([_0x4f437f,_0x380ea6||'en',![],_0xbbf5('0x47')]),null,_0xbbf5('0x48')]]]))};return rp(_0x1008d7)[_0xbbf5('0x2f')](function(_0x5a4a36){try{_0x1df3fb=eval(_0x5a4a36[_0xbbf5('0x49')](0x5))[0x0][0x2];}catch(_0x52e385){throw new Error(_0xbbf5('0x4a')+_0x5a4a36[_0xbbf5('0x4b')]);}if(!_0x1df3fb){if(_0x4f437f[_0xbbf5('0x4c')]>0xc8){throw new Error(_0xbbf5('0x4d'));}else{throw new Error(_0xbbf5('0x4e')+_0x380ea6+_0xbbf5('0x4f'));}}try{_0x1df3fb=eval(_0x1df3fb)[0x0];}catch(_0xcbf110){throw new Error(_0xbbf5('0x4a')+res[_0xbbf5('0x4b')]);}const _0x533090=_0x1df3fb;_0x589488=path['resolve'](__dirname,_0xbbf5('0x3f'),rs[_0xbbf5('0x2b')](0x4)+'.mp3');fs[_0xbbf5('0x2d')](_0x589488,_0x1df3fb,{'encoding':_0xbbf5('0x2e')});_0x5df0c7=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xbbf5('0x2c'));return convertFile(_0x589488,_0x5df0c7);})[_0xbbf5('0x2f')](function(){try{fs[_0xbbf5('0x22')](_0x589488);fs['chmodSync'](_0x5df0c7,_0xbbf5('0x31'));}catch(_0xa1937){logger[_0xbbf5('0x19')](_0xa1937);}logger['info'](_0xbbf5('0x50'),_0x5df0c7[_0xbbf5('0x32')]('.')[0x0]);return _0x5df0c7[_0xbbf5('0x32')]('.')[0x0];});};exports[_0xbbf5('0x51')]=function(_0x185117,_0x32db5e,_0x543053){return google[_0xbbf5('0x52')](_0x185117,_0x32db5e,_0x543053)[_0xbbf5('0x2f')](function(_0x3e6caa){logger[_0xbbf5('0x1f')](_0x3e6caa[_0xbbf5('0x53')]);return rp(_0x3e6caa);})[_0xbbf5('0x2f')](function(_0x16cb08){var _0xca9c8c='';var _0x363301=0x0;try{fs[_0xbbf5('0x22')](_0x185117);}catch(_0x430783){logger['error'](_0x430783);}if(_0x16cb08&&_0x16cb08[_0xbbf5('0x54')]){_0xca9c8c=_0x16cb08[_0xbbf5('0x54')][_0xbbf5('0x55')](function(_0x469faa){return _0x469faa&&_0x469faa[_0xbbf5('0x56')][0x0]&&_0x469faa[_0xbbf5('0x56')][0x0]['transcript']?_0x469faa[_0xbbf5('0x56')][0x0][_0xbbf5('0x57')]:'';})[_0xbbf5('0x58')]('\x0a');_0x363301=_0x16cb08['results'][_0xbbf5('0x55')](function(_0x2a4145){return _0x2a4145&&_0x2a4145[_0xbbf5('0x56')][0x0]&&_0x2a4145['alternatives'][0x0]['confidence']?_0x2a4145[_0xbbf5('0x56')][0x0]['confidence']:0x0;})[_0xbbf5('0x58')]('\x0a');}logger['info'](_0xbbf5('0x59'),_0xca9c8c);logger[_0xbbf5('0x1f')](_0xbbf5('0x5a'),_0x363301);return{'transcript':_0xca9c8c,'confidence':_0x363301};})[_0xbbf5('0x5b')](function(_0x4f673f){logger[_0xbbf5('0x19')](_0xbbf5('0x5c'),_0x4f673f[_0xbbf5('0x18')],_0x4f673f[_0xbbf5('0x5d')],_0x4f673f[_0xbbf5('0x5e')]);});};exports[_0xbbf5('0x5f')]=function(_0x5e7ce8,_0x33ec24,_0x39e910,_0x4f660e){var _0x4c5af0=apiai(_0x33ec24,{'language':_0x4f660e||'en'});return _0x4c5af0[_0xbbf5('0x60')](_0x39e910,{'sessionId':md5(_0x5e7ce8)})['then'](function(_0x261c85){logger['info'](JSON[_0xbbf5('0x45')](_0x261c85));return{'source':_0x261c85['result'][_0xbbf5('0x61')],'resolvedQuery':_0x261c85['result'][_0xbbf5('0x62')],'action':_0x261c85[_0xbbf5('0x63')]['action'],'actionIncomplete':_0x261c85[_0xbbf5('0x63')]['actionIncomplete'],'speech':_0x261c85[_0xbbf5('0x63')][_0xbbf5('0x64')][_0xbbf5('0x65')],'score':_0x261c85[_0xbbf5('0x63')][_0xbbf5('0x66')],'statusCode':_0x261c85[_0xbbf5('0x67')][_0xbbf5('0x68')],'endConversation':_0x261c85['result'][_0xbbf5('0x69')]['endConversation']||![],'isFallbackIntent':_0x261c85[_0xbbf5('0x63')][_0xbbf5('0x69')]['isFallbackIntent']};});};exports[_0xbbf5('0x6a')]=function(_0x2c5fbe,_0x542da2,_0xe80a38,_0x21d7d9,_0x129932,_0x88e59d){var _0x54bcfb=_0x21d7d9[_0xbbf5('0x6b')](/\\n/g,'\x0a');var _0x374f87={'credentials':{'private_key':_0x54bcfb,'client_email':_0xe80a38}};var _0x34879b=new dialogflow[(_0xbbf5('0x6c'))](_0x374f87);var _0x20c990=_0x34879b['sessionPath'](_0x542da2,md5(_0x2c5fbe));var _0x16ff1c={'session':_0x20c990,'queryInput':{'text':{'text':_0x129932,'languageCode':_0x88e59d}}};return _0x34879b['detectIntent'](_0x16ff1c)[_0xbbf5('0x2f')](function(_0x10764d){if(_0x10764d&&_0x10764d['length']){logger['info'](_0xbbf5('0x6d'),JSON[_0xbbf5('0x45')](_0x10764d));var _0x281eba=_0x10764d[0x0];if(_0x281eba){var _0x587d33={'action':_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x6f')],'allRequiredParamsPresent':_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x70')],'endConversation':_0x281eba[_0xbbf5('0x6e')]['diagnosticInfo']&&_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x71')]['fields']?_0x281eba['queryResult'][_0xbbf5('0x71')][_0xbbf5('0x72')][_0xbbf5('0x73')]['boolValue']:![],'fulfillmentText':_0x281eba['queryResult'][_0xbbf5('0x74')],'intentName':_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x75')]['name'],'intentDisplayName':_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x75')][_0xbbf5('0x76')],'isFallbackIntent':_0x281eba[_0xbbf5('0x6e')]['intent'][_0xbbf5('0x77')],'languageCode':_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x78')],'queryText':_0x281eba[_0xbbf5('0x6e')]['queryText'],'responseId':_0x281eba['responseId'],'score':_0x281eba[_0xbbf5('0x6e')]['intentDetectionConfidence'],'speech':_0x281eba[_0xbbf5('0x6e')][_0xbbf5('0x74')],'providerResponse':JSON[_0xbbf5('0x45')](_0x10764d)};return _0x587d33;}}});};exports[_0xbbf5('0x79')]=function(_0x430bee,_0x1ee68c,_0x19578e,_0x44a31d){return tilde[_0xbbf5('0x52')](_0x430bee,_0x1ee68c,_0x19578e,_0x44a31d)[_0xbbf5('0x2f')](function(_0x4362ed){try{fs[_0xbbf5('0x22')](_0x430bee);}catch(_0x1b7d01){logger[_0xbbf5('0x19')](_0x1b7d01);}logger['info'](_0xbbf5('0x7a'),_0x4362ed[_0xbbf5('0x57')]);logger['info'](_0xbbf5('0x7b'),_0x4362ed[_0xbbf5('0x7c')]);return _0x4362ed;});};exports[_0xbbf5('0x7d')]=function(_0x11de6e,_0xd51d39,_0x1b5a4c,_0x30b432,_0x59ecf2,_0x41d8bc){var _0x21e37e=path[_0xbbf5('0x2a')](__dirname,'tmp',rs[_0xbbf5('0x2b')](0x4)+_0xbbf5('0x3c'));var _0x174afe;return aws['polly'](_0x11de6e,_0xd51d39,_0x1b5a4c,_0x30b432,_0x59ecf2,_0x41d8bc,_0x21e37e)[_0xbbf5('0x2f')](function(){_0x174afe=path[_0xbbf5('0x2a')](__dirname,'tmp',rs['generate'](0x4)+_0xbbf5('0x2c'));return convertFile(_0x21e37e,_0x174afe);})[_0xbbf5('0x2f')](function(){try{fs[_0xbbf5('0x22')](_0x21e37e);fs[_0xbbf5('0x30')](_0x174afe,_0xbbf5('0x31'));}catch(_0xb4dd65){logger[_0xbbf5('0x19')](_0xb4dd65);}return _0x174afe[_0xbbf5('0x32')]('.')[0x0];});};exports[_0xbbf5('0x7e')]=function(_0x21cf93,_0x22a2a0,_0x4ad1aa,_0x4b8f2f,_0x59496a,_0x466210){return aws[_0xbbf5('0x7f')](_0x21cf93,_0x22a2a0,_0x4ad1aa,_0x4b8f2f,_0x59496a,_0x466210)[_0xbbf5('0x2f')](function(_0x330253){logger[_0xbbf5('0x1f')](JSON['stringify'](_0x330253));return _0x330253;});};exports[_0xbbf5('0x80')]=function(_0x156214,_0x5886d1,_0x19df63,_0x2357ca){var _0x10cd71=util[_0xbbf5('0x81')](_0xbbf5('0x82'),ISPEECH_API,_0x156214,encodeURIComponent(_0x5886d1),_0x19df63,_0x2357ca);var _0x3ef623=path[_0xbbf5('0x2a')](__dirname,'tmp',rs[_0xbbf5('0x2b')](0x4)+_0xbbf5('0x3c'));var _0x5e65ad;return downloadFile(_0x10cd71,_0x3ef623)['then'](function(){_0x5e65ad=path[_0xbbf5('0x2a')](__dirname,_0xbbf5('0x3f'),rs['generate'](0x4)+_0xbbf5('0x2c'));return convertFile(_0x3ef623,_0x5e65ad);})[_0xbbf5('0x2f')](function(){try{fs[_0xbbf5('0x22')](_0x3ef623);fs[_0xbbf5('0x30')](_0x5e65ad,_0xbbf5('0x31'));}catch(_0x3155ac){logger[_0xbbf5('0x19')](_0x3155ac);}return _0x5e65ad[_0xbbf5('0x32')]('.')[0x0];});};exports[_0xbbf5('0x83')]=function(_0x370662,_0x27ab8d,_0x5301ba,_0xee43b0){var _0xfe5424=util[_0xbbf5('0x81')](_0xbbf5('0x84'),ISPEECH_API,_0x27ab8d,_0x5301ba,base64Encode(_0x370662),_0xee43b0?util[_0xbbf5('0x81')](_0xbbf5('0x85'),encodeURIComponent(_0xee43b0)):_0xbbf5('0x86'));return uploadFile(_0xfe5424)[_0xbbf5('0x2f')](function(_0x2769b9){return querystring[_0xbbf5('0xb')](_0x2769b9);});};exports[_0xbbf5('0x87')]=function(_0x50a999,_0x38cee4){return sestek[_0xbbf5('0x88')](_0x50a999,_0x38cee4)['then'](function(_0xfbbc33){logger[_0xbbf5('0x1f')](JSON[_0xbbf5('0x45')](_0xfbbc33));var _0x44f862={'speech':_0xfbbc33[_0xbbf5('0x89')],'action':_0xfbbc33[_0xbbf5('0x8a')]?_0xfbbc33[_0xbbf5('0x8a')]['CustomAction']:undefined,'actiondata':_0xfbbc33['channelData']?_0xfbbc33[_0xbbf5('0x8a')][_0xbbf5('0x8b')]:undefined};if(_0xfbbc33[_0xbbf5('0x8a')]&&_0xfbbc33[_0xbbf5('0x8a')][_0xbbf5('0x8c')]){return base64Decode(_0xfbbc33['channelData']['AudioFromTts'][_0xbbf5('0x8d')],path[_0xbbf5('0x2a')](__dirname,_0xbbf5('0x3f'),rs[_0xbbf5('0x2b')](0x4)+'.wav'))[_0xbbf5('0x2f')](function(_0x46f9da){_0x44f862[_0xbbf5('0x8e')]=_0x46f9da;return _0x44f862;});}return _0x44f862;});};exports[_0xbbf5('0x8f')]=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..0a1bfb2 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 _0x5b22=['./nda','exports'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x5b22,0x1e8));var _0x25b2=function(_0x17ad1d,_0x3517f4){_0x17ad1d=_0x17ad1d-0x0;var _0xf05d06=_0x5b22[_0x17ad1d];return _0xf05d06;};var nda=require(_0x25b2('0x0'));module[_0x25b2('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 03acfd4..e626e22 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 _0x90db=['agi','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','access_token','body','channelData','ProjectName','project','ndagenerate_audio','audio/wav','custom_action','CustomActionData','custom_action_data','info','url','../../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90db,0x1c0));var _0xb90d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x90db[_0x220dbb];return _0x2b77de;};'use strict';var rp=require('request-promise');var url=require(_0xb90d('0x0'));var logger=require(_0xb90d('0x1'))(_0xb90d('0x2'));module['exports']=function(_0x4fc4c2,_0x4faf3d){var _0x50a80e={'method':'POST','uri':url[_0xb90d('0x3')](_0x4faf3d[_0xb90d('0x4')],_0xb90d('0x5')),'form':{'grant_type':_0xb90d('0x6'),'username':_0x4faf3d[_0xb90d('0x7')],'password':_0x4faf3d[_0xb90d('0x6')]},'json':!![]};return rp(_0x50a80e)[_0xb90d('0x8')](function(_0x126e17){var _0x2ef5e6={'method':_0xb90d('0x9'),'uri':url[_0xb90d('0x3')](_0x4faf3d[_0xb90d('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4faf3d[_0xb90d('0xb')]||_0xb90d('0xc'),'channelId':_0xb90d('0xd'),'conversation':{'id':_0x4fc4c2['uniqueid']},'from':{'id':_0x4fc4c2[_0xb90d('0xe')],'name':_0x4fc4c2[_0xb90d('0xf')]},'recipient':{'id':_0x4fc4c2[_0xb90d('0x10')],'name':_0x4fc4c2[_0xb90d('0x11')]},'text':_0x4faf3d[_0xb90d('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x126e17[_0xb90d('0x13')]},'json':!![]};if(_0x4faf3d['project']){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')][_0xb90d('0x16')]=_0x4faf3d[_0xb90d('0x17')];}if(_0x4faf3d[_0xb90d('0x18')]=='1'){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb90d('0x19')};}if(_0x4faf3d['custom_action']){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')]['CustomAction']=_0x4faf3d[_0xb90d('0x1a')];if(_0x4faf3d['custom_action_data']){_0x2ef5e6[_0xb90d('0x14')][_0xb90d('0x15')][_0xb90d('0x1b')]=_0x4faf3d[_0xb90d('0x1c')];}}logger[_0xb90d('0x1d')](JSON['stringify'](_0x2ef5e6));return rp(_0x2ef5e6);});}; \ No newline at end of file +var _0x6ce9=['../../../../../config/logger','POST','resolve','ndauth_url','password','username','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x6ce9,0x76));var _0x96ce=function(_0x44d250,_0x22c66e){_0x44d250=_0x44d250-0x0;var _0x2d93b6=_0x6ce9[_0x44d250];return _0x2d93b6;};'use strict';var rp=require(_0x96ce('0x0'));var url=require(_0x96ce('0x1'));var logger=require(_0x96ce('0x2'))('agi');module['exports']=function(_0x18bbb2,_0x5bf6d5){var _0x28a6a3={'method':_0x96ce('0x3'),'uri':url[_0x96ce('0x4')](_0x5bf6d5[_0x96ce('0x5')],'/token'),'form':{'grant_type':_0x96ce('0x6'),'username':_0x5bf6d5[_0x96ce('0x7')],'password':_0x5bf6d5[_0x96ce('0x6')]},'json':!![]};return rp(_0x28a6a3)['then'](function(_0x1abd8c){var _0x16a140={'method':_0x96ce('0x3'),'uri':url['resolve'](_0x5bf6d5['ndassistant_url'],_0x96ce('0x8')),'body':{'type':_0x5bf6d5[_0x96ce('0x9')]||_0x96ce('0xa'),'channelId':_0x96ce('0xb'),'conversation':{'id':_0x18bbb2[_0x96ce('0xc')]},'from':{'id':_0x18bbb2[_0x96ce('0xd')],'name':_0x18bbb2[_0x96ce('0xe')]},'recipient':{'id':_0x18bbb2[_0x96ce('0xf')],'name':_0x18bbb2[_0x96ce('0x10')]},'text':_0x5bf6d5[_0x96ce('0x11')],'channelData':{}},'headers':{'Authorization':_0x96ce('0x12')+_0x1abd8c['access_token']},'json':!![]};if(_0x5bf6d5[_0x96ce('0x13')]){_0x16a140[_0x96ce('0x14')][_0x96ce('0x15')]['ProjectName']=_0x5bf6d5[_0x96ce('0x13')];}if(_0x5bf6d5[_0x96ce('0x16')]=='1'){_0x16a140[_0x96ce('0x14')][_0x96ce('0x15')][_0x96ce('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x96ce('0x18')};}if(_0x5bf6d5[_0x96ce('0x19')]){_0x16a140[_0x96ce('0x14')][_0x96ce('0x15')][_0x96ce('0x1a')]=_0x5bf6d5[_0x96ce('0x19')];if(_0x5bf6d5[_0x96ce('0x1b')]){_0x16a140[_0x96ce('0x14')][_0x96ce('0x15')][_0x96ce('0x1c')]=_0x5bf6d5['custom_action_data'];}}logger['info'](JSON[_0x96ce('0x1d')](_0x16a140));return rp(_0x16a140);});}; \ 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 2b9d296..7af9483 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 _0xc8b1=['./lib/api'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0xc8b1,0x1d0));var _0x1c8b=function(_0x581973,_0x42751e){_0x581973=_0x581973-0x0;var _0x5444b5=_0xc8b1[_0x581973];return _0x5444b5;};'use strict';var asr=require(_0x1c8b('0x0'));module['exports']=function(_0xb404d5,_0x7af16d,_0x1ee898,_0x212c08){return asr(_0xb404d5,_0x7af16d,_0x1ee898,_0x212c08);}; \ No newline at end of file +var _0xcf1d=['./lib/api'];(function(_0x322f9a,_0x4bb852){var _0x330cad=function(_0x3a557d){while(--_0x3a557d){_0x322f9a['push'](_0x322f9a['shift']());}};_0x330cad(++_0x4bb852);}(_0xcf1d,0x115));var _0xdcf1=function(_0x476bef,_0x1b8d0d){_0x476bef=_0x476bef-0x0;var _0x2f2712=_0xcf1d[_0x476bef];return _0x2f2712;};'use strict';var asr=require(_0xdcf1('0x0'));module['exports']=function(_0x31c4e1,_0x6b7cb3,_0x44ba2c,_0x103f82){return asr(_0x31c4e1,_0x6b7cb3,_0x44ba2c,_0x103f82);}; \ 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 984f393..1a1a4cd 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 _0x4a79=['open','message','bluebird','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject'];(function(_0x2efbc8,_0x15bb5e){var _0x5f1621=function(_0x8117b8){while(--_0x8117b8){_0x2efbc8['push'](_0x2efbc8['shift']());}};_0x5f1621(++_0x15bb5e);}(_0x4a79,0x10c));var _0x94a7=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x4a79[_0x212b03];return _0x423115;};'use strict';var BPromise=require(_0x94a7('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x94a7('0x1'));var crypto=require(_0x94a7('0x2'));var logger=require(_0x94a7('0x3'))('agi');module[_0x94a7('0x4')]=function(_0xa1636c,_0x2ea01f,_0x25a834,_0x57114f){return new BPromise(function(_0x4a9340,_0x4333a9){logger[_0x94a7('0x5')]('Tilde\x20URI',_0x57114f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1e96cb=new WebSocket(_0x57114f||_0x94a7('0x6'),{'perMessageDeflate':![]});var _0x4e1ca5='';var _0x5280e4='0';var _0x398ddf='1';var _0x2b29c3='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4d6171(_0x2a80dd){var _0x429ae4=crypto[_0x94a7('0x7')]('sha1');_0x429ae4['update'](_0x2a80dd);return _0x429ae4['digest'](_0x94a7('0x8'));}function _0x2f4a86(){try{logger[_0x94a7('0x5')](_0x94a7('0x9'));var _0x3a6f23=moment()[_0x94a7('0xa')]();var _0x181dcf=_0x4d6171(_0x3a6f23+_0x2ea01f+_0x25a834);_0x1e96cb['send'](JSON[_0x94a7('0xb')]({'appID':_0x2ea01f,'timestamp':_0x3a6f23,'appKey':_0x181dcf}));var _0x12982d=fs[_0x94a7('0xc')](_0xa1636c);_0x12982d['on'](_0x94a7('0xd'),function(_0x2e58a1){_0x1e96cb[_0x94a7('0xe')](_0x2e58a1);});_0x12982d['on'](_0x94a7('0xf'),function(){_0x1e96cb[_0x94a7('0xe')](_0x94a7('0x10'));});}catch(_0x541c93){logger[_0x94a7('0x11')](_0x94a7('0x12'),JSON['stringify'](_0x541c93));_0x1e96cb[_0x94a7('0x13')]();}}function _0x54056e(_0x727ea){try{if(_0x727ea){var _0x301b4c=JSON[_0x94a7('0x14')](_0x727ea);switch(_0x301b4c[_0x94a7('0x15')]){case 0x0:if(_0x301b4c[_0x94a7('0x16')]){if(_0x301b4c[_0x94a7('0x16')]['final']){logger[_0x94a7('0x5')](_0x94a7('0x17'),JSON['stringify'](_0x301b4c['result']['hypotheses']));_0x4e1ca5=_0x301b4c[_0x94a7('0x16')][_0x94a7('0x18')][0x0]['transcript'];_0x5280e4=_0x301b4c[_0x94a7('0x16')][_0x94a7('0x18')][0x0][_0x94a7('0x19')];_0x398ddf='0';_0x2b29c3=_0x94a7('0x1a');_0x1e96cb[_0x94a7('0x13')]();}}break;case 0x1:logger[_0x94a7('0x5')](_0x94a7('0x1b'));_0x398ddf='1';_0x2b29c3=_0x94a7('0x1b');break;case 0x2:logger['info'](_0x94a7('0x1c'));_0x398ddf='2';_0x2b29c3='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x94a7('0x5')](_0x94a7('0x1d'));_0x398ddf='9';_0x2b29c3='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x94a7('0x5')](_0x94a7('0x1e'));_0x398ddf='10';_0x2b29c3=_0x94a7('0x1e');break;case 0xb:logger[_0x94a7('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x398ddf='11';_0x2b29c3=_0x94a7('0x1f');}}}catch(_0x6424bf){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x6424bf));_0x1e96cb[_0x94a7('0x13')]();}}function _0x100bd7(){logger[_0x94a7('0x5')](_0x94a7('0x20'));_0x4a9340({'transcript':_0x4e1ca5,'confidence':_0x5280e4,'status':_0x398ddf,'status_message':_0x2b29c3});}function _0x47f34f(_0x456aa8){logger[_0x94a7('0x11')](_0x94a7('0x21'));if(!_[_0x94a7('0x22')](_0x456aa8)){logger['error'](_[_0x94a7('0x23')](_0x456aa8)?JSON[_0x94a7('0xb')](_0x456aa8):_0x456aa8);}}_0x1e96cb['on'](_0x94a7('0x24'),_0x2f4a86);_0x1e96cb['on'](_0x94a7('0x25'),_0x54056e);_0x1e96cb['on'](_0x94a7('0xf'),_0x100bd7);_0x1e96cb['on'](_0x94a7('0x11'),_0x47f34f);});}; \ No newline at end of file +var _0xb9c9=['Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','Success.','terminate','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','message','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest'];(function(_0x253735,_0x38aa84){var _0x1b3d99=function(_0x4b9e32){while(--_0x4b9e32){_0x253735['push'](_0x253735['shift']());}};_0x1b3d99(++_0x38aa84);}(_0xb9c9,0x15e));var _0x9b9c=function(_0x476440,_0x44fa85){_0x476440=_0x476440-0x0;var _0x4008fa=_0xb9c9[_0x476440];return _0x4008fa;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9b9c('0x0'));var crypto=require(_0x9b9c('0x1'));var logger=require(_0x9b9c('0x2'))(_0x9b9c('0x3'));module[_0x9b9c('0x4')]=function(_0x495deb,_0x4d233b,_0x4da400,_0x417462){return new BPromise(function(_0x5dfe3b,_0x4f28f2){logger[_0x9b9c('0x5')]('Tilde\x20URI',_0x417462||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x96edb3=new WebSocket(_0x417462||_0x9b9c('0x6'),{'perMessageDeflate':![]});var _0x1b0e16='';var _0x2f72db='0';var _0x112af3='1';var _0x579e47=_0x9b9c('0x7');function _0x27e929(_0x4aa14f){var _0x62a9a8=crypto['createHash']('sha1');_0x62a9a8[_0x9b9c('0x8')](_0x4aa14f);return _0x62a9a8[_0x9b9c('0x9')]('hex');}function _0x106b6e(){try{logger[_0x9b9c('0x5')](_0x9b9c('0xa'));var _0x30b2e9=moment()['unix']();var _0x2f70c2=_0x27e929(_0x30b2e9+_0x4d233b+_0x4da400);_0x96edb3[_0x9b9c('0xb')](JSON[_0x9b9c('0xc')]({'appID':_0x4d233b,'timestamp':_0x30b2e9,'appKey':_0x2f70c2}));var _0x48d3bd=fs['createReadStream'](_0x495deb);_0x48d3bd['on'](_0x9b9c('0xd'),function(_0x4d0e9c){_0x96edb3[_0x9b9c('0xb')](_0x4d0e9c);});_0x48d3bd['on'](_0x9b9c('0xe'),function(){_0x96edb3[_0x9b9c('0xb')](_0x9b9c('0xf'));});}catch(_0xe957de){logger['error'](_0x9b9c('0x10'),JSON['stringify'](_0xe957de));_0x96edb3['terminate']();}}function _0x43e2fa(_0x2f1895){try{if(_0x2f1895){var _0x201c0d=JSON['parse'](_0x2f1895);switch(_0x201c0d[_0x9b9c('0x11')]){case 0x0:if(_0x201c0d[_0x9b9c('0x12')]){if(_0x201c0d['result'][_0x9b9c('0x13')]){logger[_0x9b9c('0x5')](_0x9b9c('0x14'),JSON['stringify'](_0x201c0d['result']['hypotheses']));_0x1b0e16=_0x201c0d[_0x9b9c('0x12')]['hypotheses'][0x0][_0x9b9c('0x15')];_0x2f72db=_0x201c0d[_0x9b9c('0x12')][_0x9b9c('0x16')][0x0]['likelihood'];_0x112af3='0';_0x579e47=_0x9b9c('0x17');_0x96edb3[_0x9b9c('0x18')]();}}break;case 0x1:logger[_0x9b9c('0x5')](_0x9b9c('0x7'));_0x112af3='1';_0x579e47='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x9b9c('0x5')](_0x9b9c('0x19'));_0x112af3='2';_0x579e47=_0x9b9c('0x19');break;case 0x9:logger[_0x9b9c('0x5')](_0x9b9c('0x1a'));_0x112af3='9';_0x579e47=_0x9b9c('0x1a');break;case 0xa:logger[_0x9b9c('0x5')](_0x9b9c('0x1b'));_0x112af3='10';_0x579e47=_0x9b9c('0x1b');break;case 0xb:logger[_0x9b9c('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x112af3='11';_0x579e47=_0x9b9c('0x1c');}}}catch(_0x48e118){logger[_0x9b9c('0x1d')](_0x9b9c('0x1e'),JSON[_0x9b9c('0xc')](_0x48e118));_0x96edb3[_0x9b9c('0x18')]();}}function _0x2c7ba8(){logger['info'](_0x9b9c('0x1f'));_0x5dfe3b({'transcript':_0x1b0e16,'confidence':_0x2f72db,'status':_0x112af3,'status_message':_0x579e47});}function _0x416d22(_0x3a2d95){logger['error'](_0x9b9c('0x20'));if(!_[_0x9b9c('0x21')](_0x3a2d95)){logger[_0x9b9c('0x1d')](_[_0x9b9c('0x22')](_0x3a2d95)?JSON[_0x9b9c('0xc')](_0x3a2d95):_0x3a2d95);}}_0x96edb3['on']('open',_0x106b6e);_0x96edb3['on'](_0x9b9c('0x23'),_0x43e2fa);_0x96edb3['on']('close',_0x2c7ba8);_0x96edb3['on'](_0x9b9c('0x1d'),_0x416d22);});}; \ 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 ae27eff..c039c06 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 _0xfc79=['exports','./asr'];(function(_0xebf36a,_0x409910){var _0x2bdc5c=function(_0x38ea90){while(--_0x38ea90){_0xebf36a['push'](_0xebf36a['shift']());}};_0x2bdc5c(++_0x409910);}(_0xfc79,0x1e1));var _0x9fc7=function(_0x117113,_0x1a4d9d){_0x117113=_0x117113-0x0;var _0x32264d=_0xfc79[_0x117113];return _0x32264d;};var asr=require(_0x9fc7('0x0'));module[_0x9fc7('0x1')]={'asr':asr}; \ No newline at end of file +var _0x199e=['exports','./asr'];(function(_0x134102,_0x44ea59){var _0x5de121=function(_0x546dce){while(--_0x546dce){_0x134102['push'](_0x134102['shift']());}};_0x5de121(++_0x44ea59);}(_0x199e,0x69));var _0xe199=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x199e[_0x3afe18];return _0x19ed1f;};var asr=require(_0xe199('0x0'));module[_0xe199('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 394b03b..27b55c6 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 _0x927e=['./error','127.0.0.1','emit','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x927e,0xcb));var _0xe927=function(_0x27d020,_0x3e50af){_0x27d020=_0x27d020-0x0;var _0x14a24b=_0x927e[_0x27d020];return _0x14a24b;};'use strict';var util=require(_0xe927('0x0'));var net=require(_0xe927('0x1'));var EventEmitter=require(_0xe927('0x2'))[_0xe927('0x3')];var AGIError=require(_0xe927('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x3264b2,_0x187d56,_0x1e8581){var _0x432e04=this,_0x3264b2=_0x3264b2||0x11dd,_0x187d56=_0x187d56||_0xe927('0x5'),_0x40796f=null,_0x57ffba=0x0;EventEmitter['call'](_0x432e04);function _0x445312(){if(!_0x3264b2){_0x432e04[_0xe927('0x6')]('error',new AGIError(_0xe927('0x7')));return![];}_0x40796f=net[_0xe927('0x8')]();_0x40796f['listen'](_0x3264b2,_0x187d56);_0x40796f['on']('listening',function(){_0x432e04[_0xe927('0x6')](_0xe927('0x9'));});_0x40796f['on']('connection',function(_0x23dd5c){_0x40796f[_0xe927('0xa')](function(_0x15f339,_0x390fe3){if(_0x15f339){_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError(_0xe927('0xc'),_0x15f339));}else if(_0x1e8581&&_0x1e8581<0x0){_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError(_0xe927('0xd')));_0x23dd5c[_0xe927('0xe')]();}else if(_0x1e8581&&_0x1e8581>0x0&&_0x1e8581<_0x390fe3){_0x57ffba+=0x1;_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError(_0xe927('0xf'),_0x57ffba));_0x23dd5c['destroy']();}else{var _0x4d394d=new AGIChannel(_0x23dd5c);_0x4d394d['on'](_0xe927('0x10'),function(){_0x432e04[_0xe927('0x6')](_0xe927('0x11'),_0x4d394d);});}});});_0x40796f['on'](_0xe927('0xb'),function(_0x533d80){_0x432e04[_0xe927('0x6')](_0xe927('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x533d80[_0xe927('0x12')]));});_0x40796f['on'](_0xe927('0x13'),function(){_0x432e04[_0xe927('0x6')](_0xe927('0x13'),new AGIError(_0xe927('0x14')));});}process[_0xe927('0x15')](function(){_0x445312();});};util['inherits'](AGIServer,EventEmitter);module[_0xe927('0x16')]=function(_0x2022da,_0x551d58,_0x37ddc7){return new AGIServer(_0x2022da,_0x551d58,_0x37ddc7);}; \ No newline at end of file +var _0xd0b8=['error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','EventEmitter','./error','127.0.0.1','call','emit'];(function(_0x279666,_0x2c8f02){var _0x16e807=function(_0x147117){while(--_0x147117){_0x279666['push'](_0x279666['shift']());}};_0x16e807(++_0x2c8f02);}(_0xd0b8,0xc1));var _0x8d0b=function(_0x190001,_0x24f401){_0x190001=_0x190001-0x0;var _0x1e6909=_0xd0b8[_0x190001];return _0x1e6909;};'use strict';var util=require(_0x8d0b('0x0'));var net=require(_0x8d0b('0x1'));var EventEmitter=require('events')[_0x8d0b('0x2')];var AGIError=require(_0x8d0b('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x5a1c02,_0x211ee4,_0x4d967a){var _0x5be2bd=this,_0x5a1c02=_0x5a1c02||0x11dd,_0x211ee4=_0x211ee4||_0x8d0b('0x4'),_0x3443c1=null,_0x2fffc8=0x0;EventEmitter[_0x8d0b('0x5')](_0x5be2bd);function _0x8522c8(){if(!_0x5a1c02){_0x5be2bd[_0x8d0b('0x6')](_0x8d0b('0x7'),new AGIError(_0x8d0b('0x8')));return![];}_0x3443c1=net[_0x8d0b('0x9')]();_0x3443c1[_0x8d0b('0xa')](_0x5a1c02,_0x211ee4);_0x3443c1['on'](_0x8d0b('0xb'),function(){_0x5be2bd[_0x8d0b('0x6')](_0x8d0b('0xb'));});_0x3443c1['on'](_0x8d0b('0xc'),function(_0x4f6bcb){_0x3443c1[_0x8d0b('0xd')](function(_0x1bffd4,_0x3be978){if(_0x1bffd4){_0x5be2bd[_0x8d0b('0x6')](_0x8d0b('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x1bffd4));}else if(_0x4d967a&&_0x4d967a<0x0){_0x5be2bd[_0x8d0b('0x6')]('error',new AGIError(_0x8d0b('0xe')));_0x4f6bcb[_0x8d0b('0xf')]();}else if(_0x4d967a&&_0x4d967a>0x0&&_0x4d967a<_0x3be978){_0x2fffc8+=0x1;_0x5be2bd['emit'](_0x8d0b('0x7'),new AGIError(_0x8d0b('0x10'),_0x2fffc8));_0x4f6bcb[_0x8d0b('0xf')]();}else{var _0x2da1d4=new AGIChannel(_0x4f6bcb);_0x2da1d4['on'](_0x8d0b('0x11'),function(){_0x5be2bd['emit'](_0x8d0b('0xc'),_0x2da1d4);});}});});_0x3443c1['on'](_0x8d0b('0x7'),function(_0x4e98d2){_0x5be2bd['emit'](_0x8d0b('0x7'),new AGIError(_0x8d0b('0x12'),_0x4e98d2[_0x8d0b('0x13')]));});_0x3443c1['on'](_0x8d0b('0x14'),function(){_0x5be2bd[_0x8d0b('0x6')](_0x8d0b('0x14'),new AGIError(_0x8d0b('0x15')));});}process[_0x8d0b('0x16')](function(){_0x8522c8();});};util[_0x8d0b('0x17')](AGIServer,EventEmitter);module[_0x8d0b('0x18')]=function(_0x3ed1dd,_0x3e01be,_0x331ad3){return new AGIServer(_0x3ed1dd,_0x3e01be,_0x331ad3);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index cbe6d08..876cef8 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 _0xf571=['%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','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','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','delay','add','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','speech','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','position','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:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','Smtp','user','subject','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','project_id','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','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','.wav','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','join','exports','path','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProjectById','dsn','getUserById','getTrunk','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format'];(function(_0x31bc19,_0x35b132){var _0xacc68=function(_0x450924){while(--_0x450924){_0x31bc19['push'](_0x31bc19['shift']());}};_0xacc68(++_0x35b132);}(_0xf571,0x1a2));var _0x1f57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf571[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x1f57('0x0'));var util=require('util');var _=require(_0x1f57('0x1'));var sh=require('shelljs');var odbc=require(_0x1f57('0x2'))();var rs=require(_0x1f57('0x3'));var moment=require(_0x1f57('0x4'));var Mustache=require(_0x1f57('0x5'));var rp=require(_0x1f57('0x6'));var logger=require(_0x1f57('0x7'))(_0x1f57('0x8'));var config=require(_0x1f57('0x9'));var scripts=require(_0x1f57('0xa'));var FILES_PATH=_0x1f57('0xb');var recursiveMapAttributes=[_0x1f57('0xc'),_0x1f57('0xd')];var verticesWithRetry=[_0x1f57('0xe'),_0x1f57('0xf'),'getsecretdigits'];var AGIVertices=function(_0xff4b93,_0x11e693,_0x4724ab){this[_0x1f57('0x10')]=_0xff4b93;this[_0x1f57('0x11')]=_0x11e693;this[_0x1f57('0x12')]=_0x4724ab;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x14')]=function(_0x31c5af,_0x48ec80){this['rpc'][_0x1f57('0x15')](_0x31c5af)[_0x1f57('0x16')](function(_0x354cbc){_0x48ec80(null,_0x354cbc?_0x354cbc[_0x1f57('0x17')]:![]);})[_0x1f57('0x18')](function(_0x2fded4){_0x48ec80(_0x2fded4);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x19')]=function(_0x5f5705,_0x111481){this[_0x1f57('0x11')]['getVoiceQueueById'](_0x5f5705)['then'](function(_0x216a48){_0x111481(null,_0x216a48?_0x216a48['name']:![]);})[_0x1f57('0x18')](function(_0x30f6dd){_0x111481(_0x30f6dd);});};AGIVertices[_0x1f57('0x13')]['getSquareProject']=function(_0xb2b61f,_0x4cb8f2){this[_0x1f57('0x11')][_0x1f57('0x1a')](_0xb2b61f)[_0x1f57('0x16')](function(_0x3613cb){_0x4cb8f2(null,_0x3613cb?_0x3613cb[_0x1f57('0x17')]:![]);})[_0x1f57('0x18')](function(_0x16fbb5){_0x4cb8f2(_0x16fbb5);});};AGIVertices[_0x1f57('0x13')]['getSquareOdbc']=function(_0x56865a,_0x348d20){this[_0x1f57('0x11')]['getSquareOdbcById'](_0x56865a)[_0x1f57('0x16')](function(_0x313d48){_0x348d20(null,_0x313d48?_0x313d48[_0x1f57('0x1b')]:![]);})[_0x1f57('0x18')](function(_0x233db6){_0x348d20(_0x233db6);});};AGIVertices[_0x1f57('0x13')]['getUser']=function(_0x2a8c2c,_0x1f539e){this[_0x1f57('0x11')][_0x1f57('0x1c')](_0x2a8c2c)[_0x1f57('0x16')](function(_0x42c926){_0x1f539e(null,_0x42c926?_0x42c926[_0x1f57('0x17')]:![]);})['catch'](function(_0x1b26fc){_0x1f539e(_0x1b26fc);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1d')]=function(_0xc57542,_0x1c0b0f){this[_0x1f57('0x11')]['getTrunkById'](_0xc57542)[_0x1f57('0x16')](function(_0xa5127b){_0x1c0b0f(null,_0xa5127b?_0xa5127b[_0x1f57('0x17')]:![]);})['catch'](function(_0x58c93d){_0x1c0b0f(_0x58c93d);});};AGIVertices[_0x1f57('0x13')]['getSound']=function(_0x4e5600,_0x5d0e45){var _0x46b70f=this;this[_0x1f57('0x11')]['getSoundById'](_0x4e5600)[_0x1f57('0x16')](function(_0x156296){_0x5d0e45(null,_0x156296?_0x46b70f[_0x1f57('0x1e')](_0x156296[_0x1f57('0x1f')]):![]);})['catch'](function(_0x51fadb){_0x5d0e45(_0x51fadb);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x20')]=function(_0x11af48,_0x364bb7){this[_0x1f57('0x11')][_0x1f57('0x21')](_0x11af48)[_0x1f57('0x16')](function(_0x366e9a){_0x364bb7(null,_0x366e9a?_0x366e9a:![]);})['catch'](function(_0x41d02d){_0x364bb7(_0x41d02d);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x22')]=function(_0x947b4f,_0x2d7528,_0x259bd4){this[_0x1f57('0x12')][_0x1f57('0x22')](_0x947b4f,_0x2d7528)[_0x1f57('0x16')](function(){_0x259bd4(null);})['catch'](function(_0x42a802){_0x259bd4(_0x42a802);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x23')]=function(_0xdc1625,_0x23640c){this[_0x1f57('0x11')][_0x1f57('0x24')](_0xdc1625)[_0x1f57('0x16')](function(_0x5b1850){if(_0x5b1850){if(_0x5b1850[_0x1f57('0x25')]){_0x23640c(null,[_0x5b1850[_0x1f57('0x26')]]);}else{_0x23640c(null,_[_0x1f57('0x27')](_0x5b1850[_0x1f57('0x28')],'interval'));}}else{_0x23640c(null,![]);}})[_0x1f57('0x18')](function(_0x330d5a){_0x23640c(_0x330d5a);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1e')]=function(_0x5ef737){return util[_0x1f57('0x29')](_0x1f57('0x2a'),FILES_PATH,_0x5ef737);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x2b')]=function(_0x2d0153,_0x5d0755,_0x2aa1f6){odbc[_0x1f57('0x2c')](_0x2d0153,function(_0x444665){if(_0x444665){logger[_0x1f57('0x2d')](_0x1f57('0x2e'),_0x444665);_0x2aa1f6(_0x444665);}else{logger[_0x1f57('0x2f')](_0x1f57('0x30'));odbc['query'](_0x5d0755,function(_0x20768e,_0x2fce1e){if(_0x20768e){logger[_0x1f57('0x2f')](_0x1f57('0x31'),_0x5d0755);_0x2aa1f6(_0x20768e);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x5d0755);odbc[_0x1f57('0x32')](function(_0x546a8c){if(_0x546a8c){logger['error'](_0x1f57('0x33'),_0x546a8c);}_0x2aa1f6(null,_0x2fce1e);});}});}});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x34')]=function(_0xa534f3,_0x1ff531){this[_0x1f57('0x11')][_0x1f57('0x35')](_0xa534f3)[_0x1f57('0x16')](function(_0x4993a9){_0x1ff531(null,_0x4993a9?_0x4993a9:![]);})[_0x1f57('0x18')](function(_0x148c7a){_0x1ff531(_0x148c7a);});};AGIVertices[_0x1f57('0x13')]['createSmsMessage']=function(_0xbedeb0,_0x533529){this['rpc'][_0x1f57('0x36')](_0xbedeb0)[_0x1f57('0x16')](function(_0x35e3c7){_0x533529(null,_0x35e3c7);})[_0x1f57('0x18')](function(_0x348788){_0x533529(_0x348788);});};AGIVertices[_0x1f57('0x13')]['createSquareDetailsReport']=function(_0x405411,_0x13b525,_0x204090){this['rpc'][_0x1f57('0x37')]({'uniqueid':this[_0x1f57('0x10')][_0x1f57('0x38')],'node':_0x405411[_0x1f57('0x39')],'application':_0x405411[_0x1f57('0x3a')],'data':_0x13b525||null,'project_name':this['channel'][_0x1f57('0x3b')],'callerid':this[_0x1f57('0x10')][_0x1f57('0x3c')]})[_0x1f57('0x16')](function(_0x3d6863){if(_0x204090){_0x204090(null,_0x3d6863);}})[_0x1f57('0x18')](function(_0x1b8f44){if(_0x204090){_0x204090(_0x1b8f44);}});};AGIVertices['prototype'][_0x1f57('0x3d')]=function(_0x4ad4c8,_0x35ee93,_0x2a5707,_0x56746b){this[_0x1f57('0x11')]['createSquareRecording']({'uniqueid':this[_0x1f57('0x10')][_0x1f57('0x38')],'callerid':this[_0x1f57('0x10')][_0x1f57('0x3c')],'calleridname':this[_0x1f57('0x10')][_0x1f57('0x3e')],'context':this[_0x1f57('0x10')][_0x1f57('0x3f')],'extension':this['channel']['extension'],'priority':this[_0x1f57('0x10')][_0x1f57('0x40')],'accountcode':this[_0x1f57('0x10')][_0x1f57('0x41')],'dnid':this[_0x1f57('0x10')][_0x1f57('0x42')],'projectName':this['channel'][_0x1f57('0x3b')],'saveName':_0x35ee93,'filename':_0x4ad4c8['file']||_0x35ee93,'savePath':_0x2a5707})['then'](function(_0x184187){_0x56746b(null,_0x184187);})[_0x1f57('0x18')](function(_0x22b173){_0x56746b(_0x22b173);});};AGIVertices[_0x1f57('0x13')]['createSquareMessage']=function(_0x16a29c,_0x59f6ed,_0x2c23d5,_0x5b6bb7,_0x51ee49){this['rpc'][_0x1f57('0x43')]({'uniqueid':this[_0x1f57('0x10')]['uniqueid'],'body':_0x16a29c,'direction':_0x59f6ed,'providerName':_0x2c23d5,'providerResponse':_0x5b6bb7})[_0x1f57('0x16')](function(_0x4dffb4){if(_0x51ee49){_0x51ee49(null,_0x4dffb4);}})[_0x1f57('0x18')](function(_0x3dd80b){if(_0x51ee49){_0x51ee49(_0x3dd80b);}});};AGIVertices[_0x1f57('0x13')]['createCmContact']=function(_0x33dbab,_0x3ccc36){this['rpc'][_0x1f57('0x44')]({'firstName':_[_0x1f57('0x45')](_0x33dbab[_0x1f57('0x17')])||_[_0x1f57('0x46')](_0x33dbab[_0x1f57('0x17')])?'callback_'+Math['random']():_0x33dbab['name'],'lastName':_[_0x1f57('0x45')](_0x33dbab[_0x1f57('0x47')])||_[_0x1f57('0x46')](_0x33dbab['lastName'])?null:_0x33dbab[_0x1f57('0x47')],'phone':_0x33dbab[_0x1f57('0x48')],'ListId':_0x33dbab[_0x1f57('0x49')],'scheduledat':_0x33dbab['scheduledAt'],'callbackUniqueid':this[_0x1f57('0x10')][_0x1f57('0x38')],'tags':_0x1f57('0x4a'),'description':_0x1f57('0x4b')+_0x33dbab[_0x1f57('0x4c')][_0x1f57('0x4d')](),'priority':_0x33dbab[_0x1f57('0x4e')]})['then'](function(_0x3358c4){_0x3ccc36(null,_0x3358c4);})[_0x1f57('0x18')](function(_0x5dd0dc){_0x3ccc36(_0x5dd0dc);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x4f')]=function(_0x1e35f2,_0x5ddf45){this['rpc'][_0x1f57('0x50')](_0x1e35f2)[_0x1f57('0x16')](function(_0x170a9d){_0x5ddf45(null,_0x170a9d?_0x170a9d[_0x1f57('0x17')]:![]);})[_0x1f57('0x18')](function(_0x32c892){_0x5ddf45(_0x32c892);});};AGIVertices['prototype'][_0x1f57('0x51')]=function(_0x4e435d,_0x5c56db,_0x17142b){var _0x535035={'role':'agent'};_0x535035[_0x4e435d]=this[_0x1f57('0x10')][_0x1f57('0x3c')];this['rpc'][_0x1f57('0x51')](_0x535035,_0x5c56db,this[_0x1f57('0x10')][_0x1f57('0x38')])[_0x1f57('0x16')](function(_0x82cd95){_0x17142b(null,_[_0x1f57('0x46')](_0x82cd95)?![]:!![]);})[_0x1f57('0x18')](function(_0x3bc59a){logger[_0x1f57('0x2d')](_0x3bc59a);_0x17142b(null,![]);});};AGIVertices[_0x1f57('0x13')]['agentUnpause']=function(_0x19c8d7,_0x4b1c6b){var _0x36f217={'role':_0x1f57('0x52')};_0x36f217[_0x19c8d7]=this[_0x1f57('0x10')][_0x1f57('0x3c')];this[_0x1f57('0x11')][_0x1f57('0x53')](_0x36f217)[_0x1f57('0x16')](function(_0x146490){_0x4b1c6b(null,_[_0x1f57('0x46')](_0x146490)?![]:!![]);})['catch'](function(_0x476206){logger[_0x1f57('0x2d')](_0x476206);_0x4b1c6b(null,![]);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x54')]=function(_0x36a50d,_0x94eba8){var _0x265a9b={'role':'agent'};_0x265a9b[_0x36a50d]=this[_0x1f57('0x10')]['callerid'];this[_0x1f57('0x11')]['agentLogout'](_0x265a9b)[_0x1f57('0x16')](function(_0x329f75){_0x94eba8(null,_['isNil'](_0x329f75)?![]:!![]);})['catch'](function(_0x35388c){logger['error'](_0x35388c);_0x94eba8(null,![]);});};AGIVertices['prototype'][_0x1f57('0x55')]=function(_0x28e06f,_0x4b267d){var _0x38e69e={'role':_0x1f57('0x52')};_0x38e69e[_0x28e06f]=this[_0x1f57('0x10')][_0x1f57('0x3c')];var _0x1b39b1=_0x28e06f!=_0x1f57('0x56')?util[_0x1f57('0x29')](_0x1f57('0x57'),_0x1f57('0x58'),this[_0x1f57('0x10')][_0x1f57('0x3c')]):undefined;this[_0x1f57('0x11')][_0x1f57('0x55')](_0x38e69e,_0x1b39b1)[_0x1f57('0x16')](function(_0x540b62){_0x4b267d(null,_[_0x1f57('0x46')](_0x540b62)?![]:!![]);})[_0x1f57('0x18')](function(_0x4a6c79){logger[_0x1f57('0x2d')](_0x4a6c79);_0x4b267d(null,![]);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x59')]=function(_0x5aa576,_0x4c97e5){sh[_0x1f57('0x5a')](_['trim'](_0x5aa576),function(_0x53519c,_0xe7fb3e){var _0x2acc99=_0xe7fb3e[_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'');_0x4c97e5(null,_0x2acc99);});};AGIVertices[_0x1f57('0x13')]['googleCloudTTS']=function(_0x42d978,_0xfa6b2e){scripts[_0x1f57('0x5c')](_0x42d978[_0x1f57('0x5d')],_0x42d978['google_cloud_tts_text_type']||_0x1f57('0x5e'),_0x42d978['text'],_0x42d978[_0x1f57('0x5f')]||_0x1f57('0x60'),_0x42d978[_0x1f57('0x61')]||_0x1f57('0x62'),_0x42d978[_0x1f57('0x63')]||_0x1f57('0x64'))[_0x1f57('0x16')](function(_0x27dede){_0xfa6b2e(null,_0x27dede);})[_0x1f57('0x18')](function(_0x22a1a8){_0xfa6b2e(_0x22a1a8);});};AGIVertices['prototype']['googleTTS']=function(_0x176a3d,_0x1a97fa){scripts[_0x1f57('0x65')](_0x176a3d[_0x1f57('0x5e')],_0x176a3d['google_tts_language']||'en',0x1)[_0x1f57('0x16')](function(_0x2af1a9){_0x1a97fa(null,_0x2af1a9);})[_0x1f57('0x18')](function(_0x304a8d){_0x1a97fa(_0x304a8d);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x66')]=function(_0x4ec814,_0x56f8bf){var _0x308834={'uri':_0x4ec814[_0x1f57('0x67')],'method':_0x4ec814[_0x1f57('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4ec814[_0x1f57('0x69')])===_0x1f57('0x6a')&&parseInt(_0x4ec814['timeout'])>=0x1?parseInt(_0x4ec814[_0x1f57('0x69')])*0x3e8:0x5*0x3e8};if(_[_0x1f57('0x6b')]([_0x1f57('0x6c'),_0x1f57('0x6d')],_0x308834[_0x1f57('0x68')][_0x1f57('0x6e')]())){try{_0x308834[_0x1f57('0x6f')]=_0x4ec814[_0x1f57('0xd')]?JSON[_0x1f57('0x70')](_0x4ec814['rawBody']):{};}catch(_0x245a99){logger['error'](_0x1f57('0x71'),_0x245a99);}}try{_0x308834[_0x1f57('0x72')]=_0x4ec814[_0x1f57('0xc')]?JSON[_0x1f57('0x70')](_0x4ec814[_0x1f57('0xc')]):{};}catch(_0x22f7a7){logger['error'](_0x1f57('0x73'),_0x22f7a7);}if(_0x4ec814['computedVariables']){try{var _0x4e8aa9=require(_0x4ec814['computedVariables'])['sync'](this,_0x308834);_0x308834['uri']=Mustache[_0x1f57('0x74')](_0x4ec814[_0x1f57('0x67')],_0x4e8aa9,{},['$$','$$']);if(_0x308834[_0x1f57('0x72')]){_0x308834[_0x1f57('0x72')]=JSON[_0x1f57('0x70')](Mustache['render'](JSON['stringify'](_0x308834['headers']),_0x4e8aa9,{},['$$','$$']));}if(_0x308834[_0x1f57('0x6f')]){_0x308834[_0x1f57('0x6f')]=JSON[_0x1f57('0x70')](Mustache[_0x1f57('0x74')](JSON[_0x1f57('0x75')](_0x308834[_0x1f57('0x6f')]),_0x4e8aa9,{},['$$','$$']));}}catch(_0x1bb928){logger[_0x1f57('0x2d')](_0x1f57('0x76'),_0x1bb928);}}rp(_0x308834)[_0x1f57('0x16')](function(_0x319880){var _0x157770={'statusCode':_0x319880['statusCode']||0xc8,'statusMessage':_0x319880[_0x1f57('0x77')]||'OK','headers':_0x319880[_0x1f57('0x72')]||{},'body':_0x319880[_0x1f57('0x6f')]||{}};_0x56f8bf(null,_0x157770);})[_0x1f57('0x18')](function(_0x13c2e4){var _0x1b74dd={'statusCode':_0x13c2e4[_0x1f57('0x78')]||0x1f4,'statusMessage':_0x13c2e4[_0x1f57('0x79')]||_0x1f57('0x7a'),'headers':_0x13c2e4['options'][_0x1f57('0x72')]||{},'body':_0x13c2e4[_0x1f57('0x7b')][_0x1f57('0x6f')]||{}};_0x56f8bf(null,_0x1b74dd);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x7c')]=function(_0x1e0581,_0x6806e6){scripts[_0x1f57('0x7c')](this[_0x1f57('0x10')][_0x1f57('0x38')],_0x1e0581[_0x1f57('0x7d')],_0x1e0581[_0x1f57('0x5e')],_0x1e0581[_0x1f57('0x7e')]||'en')[_0x1f57('0x16')](function(_0x25ae0f){_0x6806e6(null,_0x25ae0f);})[_0x1f57('0x18')](function(_0x454165){_0x6806e6(_0x454165);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x7f')]=function(_0x289a94,_0x1cc23d){scripts['googleDialogflowV2'](this[_0x1f57('0x10')][_0x1f57('0x38')],_0x289a94[_0x1f57('0x80')],_0x289a94[_0x1f57('0x81')],_0x289a94[_0x1f57('0x82')],_0x289a94['text'],_0x289a94['dialogflowV2_language']||'en')[_0x1f57('0x16')](function(_0x55b780){_0x1cc23d(null,_0x55b780);})['catch'](function(_0x5b1467){_0x1cc23d(_0x5b1467);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x83')]=function(_0x2fb87f,_0x6eea1b){scripts[_0x1f57('0x83')](this[_0x1f57('0x10')],_0x2fb87f)[_0x1f57('0x16')](function(_0x16e887){_0x6eea1b(null,_0x16e887);})[_0x1f57('0x18')](function(_0xb482a4){_0x6eea1b(_0xb482a4);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x84')]=function(_0x3bd29a,_0x27cbb4){scripts[_0x1f57('0x84')](_0x3bd29a[_0x1f57('0x7d')],_0x3bd29a['text'],_0x3bd29a[_0x1f57('0x85')]||_0x1f57('0x60'),_0x3bd29a[_0x1f57('0x86')])[_0x1f57('0x16')](function(_0x3068da){_0x27cbb4(null,_0x3068da);})[_0x1f57('0x18')](function(_0x479349){_0x27cbb4(_0x479349);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x87')]=function(_0x12894a,_0x21ccf5,_0x5603f9){scripts['ispeechASR'](_0x21ccf5,_0x12894a[_0x1f57('0x7d')],_0x12894a[_0x1f57('0x88')]||_0x1f57('0x60'),this[_0x1f57('0x89')](_0x12894a[_0x1f57('0x8a')])?_0x12894a[_0x1f57('0x8a')]:undefined)['then'](function(_0x15a41f){_0x5603f9(null,_0x15a41f);})[_0x1f57('0x18')](function(_0x2a2850){_0x5603f9(_0x2a2850);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x8b')]=function(_0x372f73,_0x875940){scripts[_0x1f57('0x8b')](_0x372f73['aws_access_key_id'],_0x372f73[_0x1f57('0x8c')],_0x372f73['aws_polly_region'],_0x372f73['aws_polly_voice']||_0x1f57('0x8d'),_0x372f73['text'],_0x372f73[_0x1f57('0x8e')]||_0x1f57('0x5e'))[_0x1f57('0x16')](function(_0x169af4){_0x875940(null,_0x169af4);})[_0x1f57('0x18')](function(_0x4385ca){_0x875940(_0x4385ca);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x8f')]=function(_0x25c355,_0x388ced){scripts[_0x1f57('0x8f')](this[_0x1f57('0x10')][_0x1f57('0x38')],_0x25c355['aws_access_key_id'],_0x25c355[_0x1f57('0x8c')],_0x25c355[_0x1f57('0x90')],_0x25c355[_0x1f57('0x5e')],_0x25c355[_0x1f57('0x91')])[_0x1f57('0x16')](function(_0x1c62c1){_0x388ced(null,_0x1c62c1);})[_0x1f57('0x18')](function(_0x4d3c3a){_0x388ced(_0x4d3c3a);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x92')]=function(_0x519748,_0xae1186,_0x3c9dff){scripts[_0x1f57('0x92')](_0xae1186,_0x519748['key'],_0x519748[_0x1f57('0x93')]||_0x1f57('0x60'))['then'](function(_0x4de9c8){_0x3c9dff(null,_0x4de9c8);})[_0x1f57('0x18')](function(_0x214bea){_0x3c9dff(_0x214bea);});};AGIVertices['prototype'][_0x1f57('0x94')]=function(_0x407668,_0x95b9cc,_0x340e8e){scripts[_0x1f57('0x94')](_0x95b9cc,_0x407668['appid'],_0x407668[_0x1f57('0x95')],_0x407668[_0x1f57('0x96')])['then'](function(_0x2d3775){_0x340e8e(null,_0x2d3775);})[_0x1f57('0x18')](function(_0x3955f6){_0x340e8e(_0x3955f6);});};AGIVertices[_0x1f57('0x13')][_0x1f57('0x97')]=function(_0x12e7c5){var _0x2571af=_[_0x1f57('0x6b')](verticesWithRetry,_0x12e7c5['agicommand'])?_0x12e7c5:_[_0x1f57('0x98')](_0x12e7c5);for(var _0x4a44b9 in _0x2571af){if(_0x2571af[_0x1f57('0x99')](_0x4a44b9)){if(_0x2571af[_0x4a44b9]&&_['isString'](_0x2571af[_0x4a44b9])){if(_['includes'](recursiveMapAttributes,_0x4a44b9)){_0x2571af[_0x4a44b9]=this['replaceObjectAllVariables'](_0x2571af[_0x4a44b9]);}else{_0x2571af[_0x4a44b9]=this[_0x1f57('0x9a')](_0x2571af[_0x4a44b9]);}}}}return _0x2571af;};AGIVertices[_0x1f57('0x13')]['recursiveNodeIndex']=function(_0x50f1aa){for(var _0x37b4d3 in _0x50f1aa){if(_0x50f1aa['hasOwnProperty'](_0x37b4d3)){if(_[_0x1f57('0x9b')](_0x50f1aa[_0x37b4d3])){this[_0x1f57('0x9c')](_0x50f1aa[_0x37b4d3]);}else if(_[_0x1f57('0x9d')](_0x50f1aa[_0x37b4d3])){for(var _0x1eab06=0x0;_0x1eab06<_0x50f1aa[_0x37b4d3][_0x1f57('0x9e')];_0x1eab06++){this[_0x1f57('0x9c')](_0x50f1aa[_0x37b4d3][_0x1eab06]);}}else if(_[_0x1f57('0x9f')](_0x50f1aa[_0x37b4d3])){_0x50f1aa[_0x37b4d3]=this[_0x1f57('0x9a')](_0x50f1aa[_0x37b4d3]);}}}};AGIVertices['prototype'][_0x1f57('0xa0')]=function(_0x271e6a,_0x3542e8){for(var _0x25e890 in _0x271e6a){if(_0x271e6a[_0x1f57('0x99')](_0x25e890)){if(_[_0x1f57('0x9b')](_0x271e6a[_0x25e890])){if(!_[_0x1f57('0x45')](_0x271e6a[_0x25e890])){this[_0x1f57('0xa0')](_0x271e6a[_0x25e890],util[_0x1f57('0x29')](_0x1f57('0xa1'),_0x3542e8,_0x25e890));}}else if(_[_0x1f57('0x9d')](_0x271e6a[_0x25e890])){for(var _0xfa3ce6=0x0;_0xfa3ce6<_0x271e6a[_0x25e890][_0x1f57('0x9e')];_0xfa3ce6++){this[_0x1f57('0xa0')](_0x271e6a[_0x25e890][_0xfa3ce6],util[_0x1f57('0x29')](_0x1f57('0xa1'),_0x3542e8,_0x25e890+'['+_0xfa3ce6+']'));}}else{if(!_[_0x1f57('0x46')](_0x271e6a[_0x25e890])){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0xa1'),_0x3542e8,_0x25e890),_0x271e6a[_0x25e890]);}}}}};AGIVertices['prototype'][_0x1f57('0xa3')]=function(_0x1487a9){try{var _0x1938fc=JSON['parse'](_0x1487a9);this[_0x1f57('0x9c')](_0x1938fc);return JSON[_0x1f57('0x75')](_0x1938fc);}catch(_0x161640){return this[_0x1f57('0x9a')](_0x1487a9);}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x9a')]=function(_0x456040){var _0x1aa6a4=_0x456040['split']('{');for(var _0x4ed068=0x1;_0x4ed068<_0x1aa6a4['length'];_0x4ed068+=0x1){var _0x57e8c7=_0x1aa6a4[_0x4ed068][_0x1f57('0xa4')]('}');if(_0x57e8c7['length']>0x1){_0x456040=_0x456040['replaceAll']('{'+_0x57e8c7[0x0]+'}',this['channel'][_0x1f57('0x14')](_0x57e8c7[0x0])['extra']||_0x57e8c7[0x0]);}}if(_0x1aa6a4['length']===0x1){return _0x456040['toString']();}return this[_0x1f57('0x9a')](_0x456040);};AGIVertices[_0x1f57('0x13')]['getAndSetVariable']=function(_0x1c1201,_0x353ef5){var _0x1c2612=this[_0x1f57('0x10')]['getVariable'](_0x1c1201);if(_0x1c2612[_0x1f57('0xa5')]===-0x1){return _0x1c2612;}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xa6'),_0x353ef5,_0x1c2612[_0x1f57('0xa7')]));return this[_0x1f57('0x10')][_0x1f57('0xa2')](_0x353ef5,_0x1c2612[_0x1f57('0xa7')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x89')]=function(_0x40c1ec){return _0x40c1ec&&_0x40c1ec!=='0'&&_0x40c1ec!=='-1'&&_0x40c1ec!=='';};AGIVertices[_0x1f57('0x13')][_0x1f57('0xa8')]=function(_0x29a123){this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x29a123,'-');_0x29a123[_0x1f57('0xaa')]=_0x29a123[_0x1f57('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1f57('0x13')]['mrcpsynth']=function(_0x59be09){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xab'),_0x59be09[_0x1f57('0x39')]));if(!this['isConfigured'](_0x59be09[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xad'));}var _0x5ec10b='\x22'+_0x59be09['text']+'\x22';if(this[_0x1f57('0x89')](_0x59be09['options'])){_0x5ec10b+=','+_0x59be09[_0x1f57('0x7b')];}var _0x2a4567=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xae'),_0x5ec10b);if(_0x2a4567['result']===-0x1){return _0x2a4567;}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5ec10b));};AGIVertices[_0x1f57('0x13')][_0x1f57('0xaf')]=function(_0x1a21fe){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1a21fe[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x1a21fe[_0x1f57('0xb0')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xb1'));}var _0xa2bd7b=_0x1a21fe['grammar'];if(this[_0x1f57('0x89')](_0x1a21fe[_0x1f57('0x7b')])){_0xa2bd7b+=','+_0x1a21fe[_0x1f57('0x7b')];}var _0x5e2668=this['channel'][_0x1f57('0x5a')](_0x1f57('0xb2'),_0xa2bd7b);if(_0x5e2668[_0x1f57('0xa5')]===-0x1){return _0x5e2668;}var _0x996a28=this[_0x1f57('0xb3')](_0x1f57('0xb4'),_0x1f57('0xb5'));if(_0x996a28['result']===-0x1){return _0x996a28;}var _0x51fd2f=this[_0x1f57('0xb3')](_0x1f57('0xb6'),_0x1f57('0xb7'));if(_0x51fd2f[_0x1f57('0xa5')]===-0x1){return _0x51fd2f;}var _0x1e374c=this[_0x1f57('0xb3')]('RECOG_INSTANCE()',_0x1f57('0xb8'));if(_0x1e374c[_0x1f57('0xa5')]===-0x1){return _0x1e374c;}return this[_0x1f57('0x10')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0xa2bd7b));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x8')]=function(_0x3baab7){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xb9'),_0x3baab7[_0x1f57('0x39')]));return this[_0x1f57('0x10')]['agi']([_0x3baab7['command'],_0x3baab7[_0x1f57('0xba')]]);};AGIVertices['prototype']['answer']=function(_0x599d9c){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xbb'),_0x599d9c[_0x1f57('0x39')]));if(this[_0x1f57('0x89')](_0x599d9c[_0x1f57('0x69')])){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xbc'),_0x599d9c[_0x1f57('0x69')]));var _0x4de554=this[_0x1f57('0x10')][_0x1f57('0xbd')](_0x599d9c[_0x1f57('0x69')]);if(_0x4de554['result']===-0x1){return _0x4de554;}}return this[_0x1f57('0x10')]['answer']();};AGIVertices['prototype'][_0x1f57('0x4a')]=function(_0x3d53af){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3d53af[_0x1f57('0x39')]));if(!this['isConfigured'](_0x3d53af[_0x1f57('0x49')])){return this['channel'][_0x1f57('0x2d')](_0x3d53af,'no\x20list\x20selected');}_0x3d53af[_0x1f57('0x4c')]=moment();if(this[_0x1f57('0x89')](_0x3d53af[_0x1f57('0xbe')])){_0x3d53af[_0x1f57('0x4c')]=moment()[_0x1f57('0xbf')](_0x3d53af[_0x1f57('0xbe')],'minutes');}if(!this['isConfigured'](_0x3d53af[_0x1f57('0x4e')])){_0x3d53af[_0x1f57('0x4e')]=0x2;}this[_0x1f57('0x44')][_0x1f57('0xa9')](this,_0x3d53af);return this['channel'][_0x1f57('0xac')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3d53af[_0x1f57('0x48')],_0x3d53af[_0x1f57('0x49')],_0x3d53af[_0x1f57('0x4c')]));};AGIVertices[_0x1f57('0x13')][_0x1f57('0xc0')]=function(_0x464376){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xc1'),_0x464376['label']));var _0xd5c5ef=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x464376['application'],_0x464376[_0x1f57('0x7b')]);if(_0xd5c5ef['result']===-0x1){return _0xd5c5ef;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0xc2'),_0x464376['application'],_0x464376[_0x1f57('0x7b')]));};AGIVertices[_0x1f57('0x13')]['lumenvoxtts']=function(_0x191091){logger['info'](util[_0x1f57('0x29')](_0x1f57('0xc3'),_0x191091[_0x1f57('0x39')]));if(!this['isConfigured'](_0x191091[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}var _0x156321='\x22'+_0x191091[_0x1f57('0x5e')]+'\x22';if(this[_0x1f57('0x89')](_0x191091[_0x1f57('0x7b')])){_0x156321+=','+_0x191091[_0x1f57('0x7b')];}var _0x3ab72f=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xae'),_0x156321);if(_0x3ab72f['result']===-0x1){return _0x3ab72f;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x156321));};AGIVertices[_0x1f57('0x13')]['sestektts']=function(_0x3bbfc0){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xc4'),_0x3bbfc0[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x3bbfc0[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}var _0x33bdd8='\x22'+_0x3bbfc0[_0x1f57('0x5e')]+'\x22';if(this[_0x1f57('0x89')](_0x3bbfc0[_0x1f57('0x7b')])){_0x33bdd8+=','+_0x3bbfc0[_0x1f57('0x7b')];}var _0x25222a=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xae'),_0x33bdd8);if(_0x25222a['result']===-0x1){return _0x25222a;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xc5'),_0x33bdd8));};AGIVertices[_0x1f57('0x13')]['lumenvoxasr']=function(_0x2fde22){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xc6'),_0x2fde22['label']));if(!this[_0x1f57('0x89')](_0x2fde22[_0x1f57('0xb0')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xb1'));}var _0x5cde4d=_0x2fde22[_0x1f57('0xb0')];if(this[_0x1f57('0x89')](_0x2fde22[_0x1f57('0x7b')])){_0x5cde4d+=','+_0x2fde22['options'];}var _0x50d83d=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xb2'),_0x5cde4d);if(_0x50d83d['result']===-0x1){return _0x50d83d;}var _0x532af4=this[_0x1f57('0xb3')]('RECOG_CONFIDENCE()',_0x1f57('0xc7'));if(_0x532af4[_0x1f57('0xa5')]===-0x1){return _0x532af4;}var _0x320790=this['getAndSetVariable'](_0x1f57('0xb6'),_0x1f57('0xc8'));if(_0x320790['result']===-0x1){return _0x320790;}var _0x247b63=this['getAndSetVariable'](_0x1f57('0xc9'),_0x1f57('0xca'));if(_0x247b63[_0x1f57('0xa5')]===-0x1){return _0x247b63;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5cde4d));};AGIVertices['prototype']['sestekasr']=function(_0x1255fd){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xcb'),_0x1255fd['label']));if(!this[_0x1f57('0x89')](_0x1255fd[_0x1f57('0xb0')])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20grammar\x20configured');}var _0x3bdaec=_0x1255fd['grammar'];if(this['isConfigured'](_0x1255fd['options'])){_0x3bdaec+=','+_0x1255fd[_0x1f57('0x7b')];}var _0x232e42=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xb2'),_0x3bdaec);if(_0x232e42['result']===-0x1){return _0x232e42;}var _0x5d0357=this[_0x1f57('0xb3')](_0x1f57('0xb4'),_0x1f57('0xcc'));if(_0x5d0357[_0x1f57('0xa5')]===-0x1){return _0x5d0357;}var _0xc816ec=this['getAndSetVariable'](_0x1f57('0xb6'),_0x1f57('0xcd'));if(_0xc816ec['result']===-0x1){return _0xc816ec;}var _0x483977=this[_0x1f57('0xb3')](_0x1f57('0xc9'),_0x1f57('0xce'));if(_0x483977['result']===-0x1){return _0x483977;}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0xcf'),_0x3bdaec));};AGIVertices[_0x1f57('0x13')]['database']=function(_0x457ae0){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0xd0'),_0x457ae0['label']));if(!this[_0x1f57('0x89')](_0x457ae0[_0x1f57('0xd1')])){return this[_0x1f57('0x10')]['error'](_0x457ae0,_0x1f57('0xd2'));}var _0x45124d=this[_0x1f57('0xd3')][_0x1f57('0xa9')](this,_0x457ae0[_0x1f57('0xd1')]);if(!_0x45124d){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x457ae0,_0x1f57('0xd4'));}if(!this[_0x1f57('0x89')](_0x457ae0[_0x1f57('0xd5')])){return this[_0x1f57('0x10')]['error'](_0x457ae0,_0x1f57('0xd6'));}var _0x5512cc=_0x457ae0[_0x1f57('0xd5')][_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xd7'),_0x5512cc));var _0x18d9f7=this['getQueryOdbc'][_0x1f57('0xa9')](this,_0x45124d,_0x5512cc);this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x457ae0,_0x5512cc);if(!this[_0x1f57('0x89')](_0x457ae0[_0x1f57('0xd8')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xd9'));}var _0x41be39=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x457ae0[_0x1f57('0xd8')]);if(!_0x41be39){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x457ae0,_0x1f57('0xda'));}var _0x41f9f4=this;_0x18d9f7['forEach'](function(_0x13ed5a,_0x557931){Object['keys'](_0x13ed5a)['forEach'](function(_0xd3398c){_0x41f9f4[_0x1f57('0x10')]['setVariable'](util['format'](_0x1f57('0xdb'),_0x41be39,_0x557931,_0xd3398c),_0x13ed5a[_0xd3398c]);});});this['channel'][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0xdc'),_0x41be39),_0x18d9f7[_0x1f57('0x9e')]);return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xdd'),_0x41be39));};AGIVertices[_0x1f57('0x13')]['dial']=function(_0x57022e){logger[_0x1f57('0xde')](util[_0x1f57('0x29')](_0x1f57('0xdf'),_0x57022e['label']));if(!this[_0x1f57('0x89')](_0x57022e[_0x1f57('0xe0')])){return this[_0x1f57('0x10')]['error'](_0x57022e,_0x1f57('0xe1'));}var _0x512a94=this[_0x1f57('0xe2')][_0x1f57('0xa9')](this,_0x57022e[_0x1f57('0xe0')]);if(!_0x512a94){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x57022e,_0x1f57('0xe3'));}var _0x32d5fc=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0xe4'),[util[_0x1f57('0x29')](_0x1f57('0xe5'),_0x512a94),_0x57022e[_0x1f57('0x69')],_0x57022e[_0x1f57('0xe6')],_0x57022e['url']]);if(_0x32d5fc[_0x1f57('0xa5')]===-0x1){return _0x32d5fc;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0xe7'),_0x1f57('0xe4')));};AGIVertices[_0x1f57('0x13')]['dialogflow']=function(_0x38798b){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xe8'),_0x38798b[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x38798b['key'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x38798b[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')][_0x1f57('0xe9')]=!![];this['createSquareDetailsReport'](_0x38798b);this['createSquareMessage'](_0x38798b[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0xea'),_0x38798b['text']));var _0x5ad99c=this['googleDialogflow'][_0x1f57('0xa9')](this,_0x38798b);if(_0x5ad99c){for(var _0x595f29 in _0x5ad99c){if(_0x5ad99c[_0x1f57('0x99')](_0x595f29)){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0xeb'),_0x595f29[_0x1f57('0x6e')]()),_0x5ad99c[_0x595f29]);}}this[_0x1f57('0x43')](_0x5ad99c['speech'],_0x1f57('0xec'),'dialogflow','');return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0xed'),_0x5ad99c['speech']));}return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x38798b,_0x1f57('0xee'));};AGIVertices['prototype'][_0x1f57('0xef')]=function(_0x4d12ea){logger['info'](util[_0x1f57('0x29')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4d12ea[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0x80')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xf0'));}if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0x81')])){return this['channel'][_0x1f57('0xac')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x4d12ea[_0x1f57('0x82')])){return this[_0x1f57('0x10')]['noop']('no\x20private_key\x20configured');}if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0xf1')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xf2'));}if(!this[_0x1f57('0x89')](_0x4d12ea[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')][_0x1f57('0xe9')]=!![];this['createSquareDetailsReport'](_0x4d12ea);this['createSquareMessage'](_0x4d12ea[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x4d12ea[_0x1f57('0x5e')]));var _0xbbef26=this[_0x1f57('0x7f')]['sync'](this,_0x4d12ea);if(_0xbbef26){for(var _0x2753ce in _0xbbef26){if(_0xbbef26[_0x1f57('0x99')](_0x2753ce)){if(_0x2753ce!==_0x1f57('0xf3')){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')]('DIALOGFLOW_%s',_0x2753ce[_0x1f57('0x6e')]()),_0xbbef26[_0x2753ce]);}}}this[_0x1f57('0x43')](_0xbbef26[_0x1f57('0xf4')],'out',_0x1f57('0xef'),_0xbbef26[_0x1f57('0xf3')]);return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xf5'),_0xbbef26[_0x1f57('0xf4')]));}return this['channel']['error'](_0x4d12ea,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x1f57('0x13')]['sesteknda']=function(_0x315e89){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0xf6'),_0x315e89['label']));if(!this[_0x1f57('0x89')](_0x315e89[_0x1f57('0xf7')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0xf8'));}if(!this[_0x1f57('0x89')](_0x315e89['username'])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xf9'));}if(!this[_0x1f57('0x89')](_0x315e89[_0x1f57('0xfa')])){return this[_0x1f57('0x10')]['noop']('no\x20password\x20configured');}if(!this[_0x1f57('0x89')](_0x315e89[_0x1f57('0xfb')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}this['channel']['bot']=!![];this[_0x1f57('0x37')](_0x315e89);this['createSquareMessage'](_0x315e89[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Trying\x20SestekNDA:\x20%s',_0x315e89[_0x1f57('0x5e')]));var _0x1d5c95=this[_0x1f57('0x83')][_0x1f57('0xa9')](this,_0x315e89);if(_0x1d5c95){for(var _0x3ac505 in _0x1d5c95){if(_0x1d5c95[_0x1f57('0x99')](_0x3ac505)){this['channel']['setVariable'](util[_0x1f57('0x29')](_0x1f57('0xfc'),_0x3ac505[_0x1f57('0x6e')]()),_0x1d5c95[_0x3ac505]);}}this['createSquareMessage'](_0x1d5c95[_0x1f57('0xf4')],_0x1f57('0xec'),'sesteknda','');if(_0x1d5c95[_0x1f57('0xfd')]){this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1d5c95[_0x1f57('0xfd')]));var _0x51d2e3=this['channel']['streamFile'](_0x1d5c95['audiofile']);try{fs[_0x1f57('0xfe')](_0x1d5c95['audiofile']+'.wav');}catch(_0x12a76d){logger[_0x1f57('0x2d')](_0x12a76d);}return _0x51d2e3;}else{return this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')]('SestekNDA\x20Result\x20%s',_0x1d5c95[_0x1f57('0xf4')]));}}return this['channel'][_0x1f57('0x2d')](_0x315e89,_0x1f57('0xff'));};AGIVertices[_0x1f57('0x13')]['end']=function(_0x1486b){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x100'),_0x1486b[_0x1f57('0x39')]));return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x101'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x102')]=function(_0x16544f){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x16544f[_0x1f57('0x39')]));var _0x10505d='';if(_0x16544f[_0x1f57('0x103')]){if(!this[_0x1f57('0x89')](_0x16544f[_0x1f57('0x103')])){return this[_0x1f57('0x10')]['error'](_0x16544f,_0x1f57('0x104'));}else{var _0x2b12e0=parseInt(_0x16544f[_0x1f57('0x103')],0xa);if(isNaN(_0x2b12e0)){_0x10505d=_0x16544f[_0x1f57('0x103')];}else{_0x10505d=this[_0x1f57('0x1d')][_0x1f57('0xa9')](this,_0x16544f['trunk_id']);if(!_0x10505d){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x16544f,'no\x20trunk\x20found');}}}}else if(_0x16544f[_0x1f57('0x105')]){_0x10505d=_0x16544f[_0x1f57('0x105')];}else{return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x16544f,_0x1f57('0x104'));}var _0x2122a2=this[_0x1f57('0x10')]['exec'](_0x1f57('0xe4'),[util[_0x1f57('0x29')](_0x1f57('0x106'),_0x10505d,_0x16544f['phone']),_0x16544f[_0x1f57('0x69')],_0x16544f[_0x1f57('0xe6')],_0x16544f[_0x1f57('0x67')]]);if(_0x2122a2[_0x1f57('0xa5')]===-0x1){return _0x2122a2;}return this['channel']['noop'](util[_0x1f57('0x29')](_0x1f57('0xe7'),_0x1f57('0xe4')));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x107')]=function(_0x568678){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x108'),_0x568678['label']));return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x107'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0xf')]=function(_0xf477e7){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0xf477e7['label']));if(_0xf477e7[_0x1f57('0xaa')]===0x0){return this[_0x1f57('0xa8')](_0xf477e7);}_0xf477e7[_0x1f57('0xaa')]-=0x1;if(!this[_0x1f57('0x89')](_0xf477e7[_0x1f57('0x109')])){return this[_0x1f57('0x10')]['error'](_0xf477e7,_0x1f57('0x10a'));}var _0x5d5de2=this[_0x1f57('0x10b')][_0x1f57('0xa9')](this,_0xf477e7[_0x1f57('0x109')]);if(!_0x5d5de2){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0xf477e7,_0x1f57('0x10c'));}if(!this[_0x1f57('0x89')](_0xf477e7[_0x1f57('0xd8')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x1f57('0xd9'));}var _0x5ed332=this[_0x1f57('0x10')][_0x1f57('0x10d')](_0x5d5de2,_0xf477e7[_0x1f57('0x10e')],_0xf477e7[_0x1f57('0x10f')]);var _0x323625=_0x5ed332[_0x1f57('0xa5')]?_0x5ed332['result']['toString']():'';logger[_0x1f57('0x2f')](_0x1f57('0x110'),JSON[_0x1f57('0x75')](_0x5ed332));if(_0x5ed332[_0x1f57('0xa5')]===-0x1){this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,_0x323625);return _0x5ed332;}else if(_0x5ed332[_0x1f57('0xa7')]===_0x1f57('0x69')){_0x5ed332['result']=_0x323625['length']>=parseInt(_0xf477e7['mindigit'])?'x':'i';}else{_0x5ed332['result']=_0x323625[_0x1f57('0x9e')]>=parseInt(_0xf477e7['mindigit'])&&_0x323625[_0x1f57('0x9e')]<=parseInt(_0xf477e7['maxdigit'])?'x':'i';}var _0x5a122f=this[_0x1f57('0x14')]['sync'](this,_0xf477e7[_0x1f57('0xd8')]);if(!_0x5a122f){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0xf477e7,_0x1f57('0xda'));}this[_0x1f57('0x10')]['setVariable'](_0x5a122f,_0x323625);if(this['isConfigured'](_0xf477e7[_0x1f57('0x111')])){var _0x474c12=parseInt(_0xf477e7[_0x1f57('0x111')],0xa);var _0x4039e0=rs[_0x1f57('0x112')]({'charset':'*','length':_0x474c12});var _0x1a09ce=_0x323625[_0x1f57('0x9e')];if(_0x1a09ce>0x0){if(_0x1a09ce>_0x474c12){this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,_0xf477e7[_0x1f57('0x113')]===_0x1f57('0x114')?_0x4039e0+_0x323625[_0x1f57('0x115')](_0x474c12):_0x323625['substr'](0x0,_0x1a09ce-_0x474c12)+_0x4039e0);}else{this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,rs[_0x1f57('0x112')]({'charset':'*','length':_0x1a09ce}));}}else{this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,'');}}else{this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0xf477e7,_0x323625);}return _0x5ed332;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x116')]=function(_0x42d624){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x117'),_0x42d624[_0x1f57('0x39')]));return this[_0x1f57('0xf')](_0x42d624);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x118')]=function(_0x51d159){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x119'),_0x51d159['label']));this['createSquareDetailsReport'][_0x1f57('0xa9')](this,_0x51d159,_0x51d159[_0x1f57('0x11a')]);return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')]('GOAL\x20%s',_0x51d159[_0x1f57('0x11a')]));};AGIVertices['prototype'][_0x1f57('0x11b')]=function(_0x1ac737){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1ac737[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x1ac737[_0x1f57('0x11c')])||!this[_0x1f57('0x89')](_0x1ac737['aws_secret_access_key'])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x11d'));}if(!this['isConfigured'](_0x1ac737['text'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20text\x20configured');}this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x11e'),_0x1ac737[_0x1f57('0x5e')]));var _0x482e5f=this[_0x1f57('0x8b')]['sync'](this,_0x1ac737);if(_0x482e5f){this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x482e5f));var _0xd56aa2=this['channel'][_0x1f57('0x11f')](_0x482e5f);try{fs[_0x1f57('0xfe')](_0x482e5f+'.wav');}catch(_0x45ab97){logger['error'](_0x45ab97);}return _0xd56aa2;}return this[_0x1f57('0x10')]['error'](_0x1ac737,_0x1f57('0x120'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x121')]=function(_0x1d1837){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x122'),_0x1d1837[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x1d1837[_0x1f57('0x11c')])||!this[_0x1f57('0x89')](_0x1d1837[_0x1f57('0x8c')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x11d'));}if(!this['isConfigured'](_0x1d1837['aws_bot_name'])){return this['channel'][_0x1f57('0xac')]('no\x20bot\x20name\x20configured');}if(!this[_0x1f57('0x89')](_0x1d1837[_0x1f57('0x5e')])){return this['channel'][_0x1f57('0xac')]('no\x20text\x20configured');}this[_0x1f57('0x10')][_0x1f57('0xe9')]=!![];this[_0x1f57('0x37')](_0x1d1837);this['createSquareMessage'](_0x1d1837[_0x1f57('0x5e')],'in','','');this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x123'),_0x1d1837['text']));var _0x602d62=this[_0x1f57('0x8f')]['sync'](this,_0x1d1837);if(_0x602d62){for(var _0x19e13d in _0x602d62){if(_0x602d62[_0x1f57('0x99')](_0x19e13d)&&_[_0x1f57('0x9f')](_0x602d62[_0x19e13d])){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x124'),_0x19e13d['toUpperCase']()),_0x602d62[_0x19e13d]);}}if(_[_0x1f57('0x46')](_0x602d62[_0x1f57('0x79')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0x125'));}else{this['createSquareMessage'](_0x602d62[_0x1f57('0x79')],_0x1f57('0xec'),_0x1f57('0x126'),'');return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x127'),_0x602d62['message']));}}return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x1d1837,_0x1f57('0x128'));};AGIVertices['prototype'][_0x1f57('0x129')]=function(_0x1864a4){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x12a'),_0x1864a4[_0x1f57('0x39')],_0x1864a4[_0x1f57('0x69')]));if(!this[_0x1f57('0x89')](_0x1864a4[_0x1f57('0x7d')])){return this['channel'][_0x1f57('0xac')]('no\x20key\x20configured');}var _0x1d11cf=_0x1f57('0x12b');var _0x486d17=util['format'](_0x1f57('0x12c'),FILES_PATH,rs[_0x1f57('0x112')](0x4));var _0x34ca3b=util[_0x1f57('0x29')]('%s.%s',_0x486d17,_0x1d11cf);var _0x2be412=!![];if(_0x1864a4[_0x1f57('0x12d')]===_0x1f57('0x12e')){_0x2be412=![];}var _0x569162=this[_0x1f57('0x10')]['recordFile'](_0x486d17,_0x1d11cf,_0x1864a4[_0x1f57('0x12f')],_0x1864a4[_0x1f57('0x69')],undefined,_0x2be412);if(_0x569162[_0x1f57('0xa5')]!==-0x1){this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x130'),_0x34ca3b));var _0x12e251=this['googleASR'][_0x1f57('0xa9')](this,_0x1864a4,_0x34ca3b);if(_0x12e251){for(var _0x56c490 in _0x12e251){if(_0x12e251[_0x1f57('0x99')](_0x56c490)){this['channel'][_0x1f57('0xa2')](util[_0x1f57('0x29')]('GOOGLE_ASR_%s',_0x56c490['toUpperCase']()),_0x12e251[_0x56c490]);}}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('GoogleASR\x20Result\x20%s',JSON[_0x1f57('0x75')](_0x12e251)));}}return _0x569162;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x131')]=function(_0x3990a5){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x132'),_0x3990a5[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x3990a5[_0x1f57('0x133')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x134'));}if(!this[_0x1f57('0x89')](_0x3990a5[_0x1f57('0x95')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0x135'));}var _0x581025=_0x1f57('0x12b');var _0xe0a71c=util['format'](_0x1f57('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x1db0a1=util[_0x1f57('0x29')](_0x1f57('0xa1'),_0xe0a71c,_0x581025);var _0x1612d4=!![];if(_0x3990a5[_0x1f57('0x12d')]===_0x1f57('0x12e')){_0x1612d4=![];}var _0x48de01=this['channel'][_0x1f57('0x136')](_0xe0a71c,_0x581025,_0x3990a5['intKey'],_0x3990a5[_0x1f57('0x69')],undefined,_0x1612d4);if(_0x48de01[_0x1f57('0xa5')]!==-0x1){this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x137'),_0x1db0a1));var _0x31f002=this[_0x1f57('0x94')][_0x1f57('0xa9')](this,_0x3990a5,_0x1db0a1);if(_0x31f002){for(var _0x134dc7 in _0x31f002){if(_0x31f002[_0x1f57('0x99')](_0x134dc7)){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x138'),_0x134dc7[_0x1f57('0x6e')]()),_0x31f002[_0x134dc7]);}}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x139'),JSON[_0x1f57('0x75')](_0x31f002)));}}return _0x48de01;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x13a')]=function(_0x37fdf3){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x13b'),_0x37fdf3['label']));return this[_0x1f57('0x10')]['continueAt'](_0x37fdf3[_0x1f57('0x3f')],_0x37fdf3[_0x1f57('0x13c')],_0x37fdf3[_0x1f57('0x40')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x13d')]=function(_0x14ba56){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x13e'),_0x14ba56[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x14ba56['condition'])){return this[_0x1f57('0x10')]['error'](_0x14ba56,'no\x20condition\x20configured');}try{var _0x19ef2b=eval(_0x14ba56[_0x1f57('0x13f')])?_0x1f57('0x140'):_0x1f57('0x141');this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x142'),_0x14ba56['condition'],_0x19ef2b));return{'code':0xc8,'result':_0x19ef2b};}catch(_0x2138c0){return{'code':0xc8,'result':_0x1f57('0x141')};}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x143')]=function(_0x2eb1e0){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x144'),_0x2eb1e0[_0x1f57('0x39')]));if(!this['isConfigured'](_0x2eb1e0['interval_id'])){return this[_0x1f57('0x10')]['error'](_0x2eb1e0,'no\x20interval\x20configured');}var _0x51d753=this['getIntervals'][_0x1f57('0xa9')](this,_0x2eb1e0[_0x1f57('0x145')]);if(!_0x51d753){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x2eb1e0,_0x1f57('0x146'));}for(var _0x39f9bd=0x0;_0x39f9bd<_0x51d753[_0x1f57('0x9e')];_0x39f9bd+=0x1){var _0x54ad31=this[_0x1f57('0x10')][_0x1f57('0x14')](util[_0x1f57('0x29')](_0x1f57('0x147'),_0x51d753[_0x39f9bd]));if(_0x54ad31[_0x1f57('0xa5')]===-0x1){return _0x54ad31;}logger['info'](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],_0x54ad31[_0x1f57('0xa7')]));if(_0x54ad31[_0x1f57('0xa7')]==='true'){logger['info'](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],'true'));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],'true'));return{'code':0xc8,'result':_0x1f57('0x140')};}else{logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('IFTIME\x20%s\x20%s',_0x51d753[_0x39f9bd],_0x1f57('0x141')));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x148'),_0x51d753[_0x39f9bd],'false'));}}return{'code':0xc8,'result':_0x1f57('0x141')};};AGIVertices['prototype'][_0x1f57('0x149')]=function(_0x5f4920){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x14a'),_0x5f4920[_0x1f57('0x39')]));return this['channel']['hangup']();};AGIVertices[_0x1f57('0x13')][_0x1f57('0x14b')]=function(_0x346c2f){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x346c2f[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x346c2f[_0x1f57('0x7d')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x14c'));}var _0x4bcecc='wav';var _0x448438=util[_0x1f57('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0x1f57('0x112')](0x4));var _0x22bbea=util['format']('%s.%s',_0x448438,_0x4bcecc);var _0x4bdf56=!![];if(_0x346c2f[_0x1f57('0x12d')]===_0x1f57('0x12e')){_0x4bdf56=![];}var _0x152ae0=this[_0x1f57('0x10')][_0x1f57('0x136')](_0x448438,_0x4bcecc,_0x346c2f[_0x1f57('0x12f')],_0x346c2f[_0x1f57('0x69')],undefined,_0x4bdf56);if(_0x152ae0[_0x1f57('0xa5')]!==-0x1){this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x14d'),_0x22bbea));var _0x490f94=this[_0x1f57('0x87')]['sync'](this,_0x346c2f,_0x22bbea);if(_0x490f94){for(var _0x25fa6f in _0x490f94){if(_0x490f94['hasOwnProperty'](_0x25fa6f)){this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x14e'),_0x25fa6f[_0x1f57('0x6e')]()),_0x490f94[_0x25fa6f]);}}return this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x14f'),JSON['stringify'](_0x490f94)));}}return _0x152ae0;};AGIVertices[_0x1f57('0x13')][_0x1f57('0x150')]=function(_0x431457){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x151'),_0x431457[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x431457[_0x1f57('0x7d')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x14c'));}if(!this[_0x1f57('0x89')](_0x431457['text'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20text\x20configured');}this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x152'),_0x431457['text']));var _0x13af24=this[_0x1f57('0x84')]['sync'](this,_0x431457);if(_0x13af24){this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('ispeech\x20%s\x20file\x20created',_0x13af24));var _0x25c980=this[_0x1f57('0x10')]['streamFile'](_0x13af24,_0x431457[_0x1f57('0x12f')]);try{fs['unlink'](_0x13af24+'.wav');}catch(_0x1ee827){logger[_0x1f57('0x2d')](_0x1ee827);}return _0x25c980;}return this['channel'][_0x1f57('0x2d')](_0x431457,_0x1f57('0x153'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x154')]=function(_0x5cc1a3){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5cc1a3[_0x1f57('0x39')]));if(!this['isConfigured'](_0x5cc1a3['findBy'])){return this['channel'][_0x1f57('0x2d')](_0x5cc1a3,_0x1f57('0x155'));}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x156'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x5cc1a3['findBy']));var _0x5bd8c5=this[_0x1f57('0x55')][_0x1f57('0xa9')](this,_0x5cc1a3[_0x1f57('0x157')]);if(_0x5bd8c5){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x158'),this['channel'][_0x1f57('0x3c')],_0x5cc1a3['findBy']));this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x158'),this['channel'][_0x1f57('0x3c')],_0x5cc1a3[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger['info'](util['format'](_0x1f57('0x15a'),this['channel']['callerid'],_0x5cc1a3[_0x1f57('0x157')]));this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x15a'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x5cc1a3[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x15b')};}};AGIVertices[_0x1f57('0x13')]['logout']=function(_0x2858cc){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2858cc[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x2858cc[_0x1f57('0x157')])){return this['channel']['error'](_0x2858cc,'no\x20find\x20by\x20configured');}logger[_0x1f57('0x2f')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x2858cc['findBy']));var _0x5d4c3c=this['agentLogout'][_0x1f57('0xa9')](this,_0x2858cc['findBy']);if(_0x5d4c3c){logger['info'](util['format'](_0x1f57('0x158'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x2858cc[_0x1f57('0x157')]));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x2858cc['findBy']));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger['info'](util['format'](_0x1f57('0x15a'),this['channel']['callerid'],_0x2858cc[_0x1f57('0x157')]));this['channel'][_0x1f57('0xac')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1f57('0x10')]['callerid'],_0x2858cc['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x15c')]=function(_0x1d4fb9){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x15d'),_0x1d4fb9['label']));if(!this[_0x1f57('0x89')](_0x1d4fb9[_0x1f57('0x15e')])){return this['channel'][_0x1f57('0x2d')](_0x1d4fb9,_0x1f57('0x15f'));}this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x160'),_0x1d4fb9[_0x1f57('0x15e')]));var _0x1f69fa=eval(_0x1d4fb9['operation']);if(!this[_0x1f57('0x89')](_0x1d4fb9['variable_id'])){return this[_0x1f57('0x10')][_0x1f57('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5f1142=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x1d4fb9[_0x1f57('0xd8')]);if(!_0x5f1142){return this['channel'][_0x1f57('0x2d')](_0x1d4fb9,'no\x20variable\x20found');}if(_[_0x1f57('0x9d')](_0x1f69fa)){var _0xd4a894=this;_0x1f69fa[_0x1f57('0x161')](function(_0x2910e8,_0x506701){_0xd4a894[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x162'),_0x5f1142,_0x506701),_0x2910e8);});return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x163'),_0x5f1142));}else{return this[_0x1f57('0x10')][_0x1f57('0xa2')](_0x5f1142,_0x1f69fa);}};AGIVertices[_0x1f57('0x13')][_0x1f57('0xe')]=function(_0x294500){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x164'),_0x294500[_0x1f57('0x39')]));if(_0x294500[_0x1f57('0xaa')]===0x0){return this[_0x1f57('0xa8')](_0x294500);}_0x294500[_0x1f57('0xaa')]-=0x1;if(!this[_0x1f57('0x89')](_0x294500[_0x1f57('0x109')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x294500,'no\x20file\x20audio\x20selected');}var _0x527483=this[_0x1f57('0x10b')]['sync'](this,_0x294500[_0x1f57('0x109')]);if(!_0x527483){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x294500,_0x1f57('0x10c'));}var _0x49b8d8=this[_0x1f57('0x10')]['getData'](_0x527483,_0x294500[_0x1f57('0x10e')],_0x294500[_0x1f57('0x165')]);var _0x5ecb03=_0x49b8d8['result'];if(_0x49b8d8[_0x1f57('0xa5')]===-0x1){this[_0x1f57('0x37')]['sync'](this,_0x294500,'-1');return _0x49b8d8;}else if(_0x49b8d8[_0x1f57('0xa7')]===_0x1f57('0x69')){_0x49b8d8[_0x1f57('0xa5')]=_0x49b8d8['result'][_0x1f57('0x9e')]>0x0?_0x49b8d8[_0x1f57('0xa5')]:'t';}else if(_[_0x1f57('0x45')](_0x49b8d8[_0x1f57('0xa5')])){_0x49b8d8[_0x1f57('0xa5')]='#';_0x5ecb03='#';}if(!this[_0x1f57('0x89')](_0x294500[_0x1f57('0xd8')])){this[_0x1f57('0x10')]['noop'](_0x1f57('0xd9'));}else{var _0x203a59=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x294500[_0x1f57('0xd8')]);if(!_0x203a59){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x294500,_0x1f57('0xda'));}this[_0x1f57('0x10')]['setVariable'](_0x203a59,_0x5ecb03);}this['createSquareDetailsReport'][_0x1f57('0xa9')](this,_0x294500,_0x5ecb03);return _0x49b8d8;};AGIVertices['prototype'][_0x1f57('0xac')]=function(_0x389992){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x166'),_0x389992[_0x1f57('0x39')]));return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x389992['output']||_0x389992[_0x1f57('0x39')]);};AGIVertices[_0x1f57('0x13')]['pause']=function(_0x29df7b){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x167'),_0x29df7b[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x29df7b[_0x1f57('0x157')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x29df7b,'no\x20find\x20by\x20configured');}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x156'),this['channel'][_0x1f57('0x3c')],_0x29df7b[_0x1f57('0x157')]));var _0x3682d6=this[_0x1f57('0x4f')]['sync'](this,_0x29df7b['pause_id']);var _0x216e1d=this['agentPause']['sync'](this,_0x29df7b['findBy'],_0x3682d6);if(_0x216e1d){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x158'),this[_0x1f57('0x10')]['callerid'],_0x29df7b['findBy']));this['channel'][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x158'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x29df7b[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x15a'),this[_0x1f57('0x10')]['callerid'],_0x29df7b[_0x1f57('0x157')]));this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x158'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x29df7b[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x15b')};}};AGIVertices[_0x1f57('0x13')][_0x1f57('0x168')]=function(_0x11f5f2){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x169'),_0x11f5f2['label']));if(!this[_0x1f57('0x89')](_0x11f5f2[_0x1f57('0x109')])){return this['channel'][_0x1f57('0x2d')](_0x11f5f2,_0x1f57('0x10a'));}var _0x5c87b4=this[_0x1f57('0x10b')]['sync'](this,_0x11f5f2[_0x1f57('0x109')]);if(!_0x5c87b4){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x11f5f2,_0x1f57('0x10c'));}var _0x50a3da=this['channel']['exec'](_0x1f57('0x16a'),[_0x5c87b4,_0x11f5f2[_0x1f57('0xe6')]]);if(_0x50a3da['result']===-0x1){return _0x50a3da;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xc2'),_0x1f57('0x16a'),_0x5c87b4));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x16b')]=function(_0x39d1ba){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x16c'),_0x39d1ba[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x39d1ba[_0x1f57('0x16d')])){return this['channel'][_0x1f57('0x2d')](_0x39d1ba,'no\x20queue\x20selected');}var _0x4891c2='';var _0x21c555=parseInt(_0x39d1ba['queue_id'],0xa);if(isNaN(_0x21c555)){_0x4891c2=_0x39d1ba[_0x1f57('0x16d')];}else{_0x4891c2=this[_0x1f57('0x19')]['sync'](this,_0x39d1ba[_0x1f57('0x16d')]);if(!_0x4891c2){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x39d1ba,_0x1f57('0x16e'));}}var _0x3455c6='';if(this[_0x1f57('0x89')](_0x39d1ba['file_id'])){var _0x790dc7=this['getSound'][_0x1f57('0xa9')](this,_0x39d1ba[_0x1f57('0x109')]);if(_0x790dc7){_0x3455c6=_0x790dc7;}}this[_0x1f57('0x37')]['sync'](this,_0x39d1ba,_0x4891c2);if(_0x39d1ba[_0x1f57('0xe6')][_0x1f57('0x16f')]('x')<0x0){_0x39d1ba[_0x1f57('0xe6')]+='x';}if(_0x39d1ba[_0x1f57('0xe6')]['indexOf']('X')<0x0){_0x39d1ba[_0x1f57('0xe6')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x4891c2?_0x4891c2[_0x1f57('0x170')]():'');var _0xe63ef=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0x171'),[_0x4891c2,_0x39d1ba['opts'],_0x39d1ba[_0x1f57('0x67')],_0x3455c6,_0x39d1ba['timeout'],_0x39d1ba[_0x1f57('0x8')],_0x39d1ba[_0x1f57('0x172')],_0x39d1ba['gosub'],'',_0x39d1ba[_0x1f57('0x173')]]);if(_0xe63ef[_0x1f57('0xa5')]===-0x1){return _0xe63ef;}return this[_0x1f57('0x10')]['noop'](util['format'](_0x1f57('0xc2'),_0x1f57('0x171'),_0x4891c2));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x174')]=function(_0x4a8258){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x175'),_0x4a8258[_0x1f57('0x39')]));var _0x43dd93=_0x4a8258[_0x1f57('0x176')]||_0x1f57('0x12b');var _0x3e8e21=util[_0x1f57('0x29')](_0x1f57('0x177'),this[_0x1f57('0x10')][_0x1f57('0x38')],rs[_0x1f57('0x112')](0x5));var _0x68caec=util['format'](_0x1f57('0x178'),FILES_PATH,_0x3e8e21,_0x43dd93);var _0x3f35b3=util[_0x1f57('0x29')](_0x1f57('0x12c'),FILES_PATH,_0x3e8e21);this[_0x1f57('0x3d')][_0x1f57('0xa9')](this,_0x4a8258,_0x3e8e21,_0x68caec);this[_0x1f57('0x10')][_0x1f57('0xa2')]('RECORDING_SAVENAME',_0x3e8e21);logger[_0x1f57('0x2f')](_0x1f57('0x179'),_0x3f35b3,_0x43dd93,_0x4a8258[_0x1f57('0x17a')],_0x4a8258[_0x1f57('0x69')]);return this[_0x1f57('0x10')][_0x1f57('0x136')](_0x3f35b3,_0x43dd93,_0x4a8258[_0x1f57('0x17a')],_0x4a8258[_0x1f57('0x69')],undefined,!![]);};AGIVertices[_0x1f57('0x13')]['restapi']=function(_0x217744){logger['info'](util['format'](_0x1f57('0x17b'),_0x217744['label']));if(!this['isConfigured'](_0x217744[_0x1f57('0x67')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x17c'));}var _0x598677=this[_0x1f57('0x66')]['sync'](this,_0x217744);logger['info'](util['format'](_0x1f57('0x17d'),util['inspect'](_0x598677,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x217744['variable_id'])){return this['channel']['noop'](_0x1f57('0x17e'));}var _0x2ba90e=this['getVariable'][_0x1f57('0xa9')](this,_0x217744[_0x1f57('0xd8')]);if(!_0x2ba90e){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x217744,_0x1f57('0xda'));}this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x17f'),_0x2ba90e),_0x598677['statusCode']?_0x598677[_0x1f57('0x78')]:_0x1f57('0x180'));this[_0x1f57('0x10')][_0x1f57('0xa2')](util[_0x1f57('0x29')](_0x1f57('0x181'),_0x2ba90e),_0x598677[_0x1f57('0x77')]?_0x598677[_0x1f57('0x77')]:'OK');if(_0x598677[_0x1f57('0x6f')]){try{this[_0x1f57('0xa0')](_0x598677[_0x1f57('0x6f')],_0x2ba90e);}catch(_0x55009a){logger[_0x1f57('0x2d')](util[_0x1f57('0x29')](_0x1f57('0x182'),_0x2ba90e));}}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xdd'),_0x2ba90e));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x183')]=function(_0x1603ae){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x184'),_0x1603ae[_0x1f57('0x39')]));return this[_0x1f57('0x10')]['sayDigits'](_0x1603ae['digits'][_0x1f57('0x5b')](/\s+/g,''),_0x1603ae[_0x1f57('0x17a')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x185')]=function(_0xf25533){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x186'),_0xf25533[_0x1f57('0x39')]));return this['channel'][_0x1f57('0x187')](_0xf25533[_0x1f57('0x6a')][_0x1f57('0x5b')](/\s+/g,''),_0xf25533['escape_digits']);};AGIVertices['prototype'][_0x1f57('0x188')]=function(_0x42eb42){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x189'),_0x42eb42[_0x1f57('0x39')]));return this['channel'][_0x1f57('0x18a')](_0x42eb42[_0x1f57('0x5e')],_0x42eb42[_0x1f57('0x17a')]);};AGIVertices[_0x1f57('0x13')][_0x1f57('0x18b')]=function(_0x30e41d){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x18c'),_0x30e41d[_0x1f57('0x39')]));if(!this['isConfigured'](_0x30e41d[_0x1f57('0x18d')])){return this['channel']['noop']('no\x20mail\x20account\x20configured');}var _0x4b7b63=this[_0x1f57('0x20')][_0x1f57('0xa9')](this,_0x30e41d['account_id']);if(!_0x4b7b63||!_0x4b7b63['Smtp']){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x30e41d,_0x1f57('0x18e'));}var _0x4bda85={'from':util[_0x1f57('0x29')]('\x22%s\x22\x20<%s>',_0x4b7b63[_0x1f57('0x17')],_0x4b7b63['email']||_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x190')]),'to':_0x30e41d['to']||'','cc':_0x30e41d['cc']||'','bcc':_0x30e41d['bcc']||'','subject':_0x30e41d[_0x1f57('0x191')],'html':_0x30e41d['text'],'text':_0x30e41d['text']};var _0x24d7b2={'tls':{'rejectUnauthorized':![]}};if(_0x4b7b63['Smtp'][_0x1f57('0x192')]){_0x24d7b2['service']=_0x4b7b63['Smtp'][_0x1f57('0x192')];}else{_0x24d7b2[_0x1f57('0x193')]=_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x193')];_0x24d7b2['port']=_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x194')];_0x24d7b2[_0x1f57('0x195')]=_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x195')];}if(_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x196')]){_0x24d7b2[_0x1f57('0x197')]={'user':_0x4b7b63[_0x1f57('0x18f')][_0x1f57('0x190')],'pass':_0x4b7b63[_0x1f57('0x18f')]['pass']};}if(this[_0x1f57('0x89')](_0x30e41d[_0x1f57('0x198')])){}logger[_0x1f57('0xde')]('sendMail\x20message',JSON['stringify'](_0x4bda85));this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x30e41d,_0x30e41d[_0x1f57('0x18d')]);this['channel']['noop'](util[_0x1f57('0x29')](_0x1f57('0x199'),_0x4b7b63['name']));this['sendMailMessage'][_0x1f57('0xa9')](this,_0x24d7b2,_0x4bda85);return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x19a'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x19b')]=function(_0xef0a77){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x19c'),_0xef0a77[_0x1f57('0x39')]));return this[_0x1f57('0x10')][_0x1f57('0xac')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x131ab5){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x19d'),_0x131ab5[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x131ab5[_0x1f57('0x19e')])){return this['channel'][_0x1f57('0xac')]('no\x20sms\x20account\x20configured');}var _0x2d72f7=this['getSmsAccount'][_0x1f57('0xa9')](this,_0x131ab5[_0x1f57('0x19e')]);if(!_0x2d72f7){return this[_0x1f57('0x10')]['error'](_0x131ab5,_0x1f57('0x19f'));}var _0x42e6f4={'body':_0x131ab5[_0x1f57('0x1a0')],'phone':_0x131ab5['to']||'','SmsAccountId':_0x2d72f7['id']};logger[_0x1f57('0xde')](_0x1f57('0x1a1'),JSON[_0x1f57('0x75')](_0x42e6f4));this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x131ab5,_0x131ab5['sms_account_id']);this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x2d72f7[_0x1f57('0x17')]));this['createSmsMessage'][_0x1f57('0xa9')](this,_0x42e6f4);return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x1a2'));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1a3')]=function(_0x38ea6b){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x1a4'),_0x38ea6b[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x38ea6b[_0x1f57('0xd8')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x38ea6b,_0x1f57('0x1a5'));}var _0x500310=this[_0x1f57('0x14')]['sync'](this,_0x38ea6b['variable_id']);if(!_0x500310){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x38ea6b,_0x1f57('0xda'));}return this[_0x1f57('0x10')]['setVariable'](_0x500310,_0x38ea6b[_0x1f57('0x1a6')]);};AGIVertices['prototype'][_0x1f57('0x1a7')]=function(_0x1759a7){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1a8'),_0x1759a7[_0x1f57('0x39')]));this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x1a9'));if(_0x1759a7[_0x1f57('0x1aa')]==='yes'){this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0x1ab'));return this[_0x1f57('0x10')][_0x1f57('0x1aa')]();}return this[_0x1f57('0x10')][_0x1f57('0xac')]('Skipped\x20Answer');};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1ac')]=function(_0x332208){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1ad'),_0x332208['label']));if(!this[_0x1f57('0x89')](_0x332208['project_id'])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x332208,'no\x20subproject\x20selected');}var _0x486fd1=this[_0x1f57('0x1ae')]['sync'](this,_0x332208[_0x1f57('0x1af')]);if(!this[_0x1f57('0x89')](_0x486fd1)){return this[_0x1f57('0x10')]['error'](_0x332208,util['format'](_0x1f57('0x1b0'),_0x332208[_0x1f57('0x1af')]));}if(_0x486fd1===this[_0x1f57('0x10')][_0x1f57('0x3b')]){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x332208,_0x1f57('0x1b1'));}this[_0x1f57('0x37')][_0x1f57('0xa9')](this,_0x332208,_0x486fd1);var _0x42e88e=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0x1b2'),util[_0x1f57('0x29')](_0x1f57('0x1b3'),config[_0x1f57('0x8')][_0x1f57('0x193')]||_0x1f57('0x1b4'),_0x486fd1,this[_0x1f57('0x10')][_0x1f57('0x3b')]));if(_0x42e88e['result']===-0x1){return _0x42e88e;}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0xc2'),'AGI',_0x486fd1));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1b5')]=function(_0x43f421){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1b6'),_0x43f421[_0x1f57('0x39')]));var _0x391e5e=this[_0x1f57('0x59')]['sync'](this,_0x43f421[_0x1f57('0x1b7')]);this[_0x1f57('0x37')]['sync'](this,_0x43f421,_0x43f421[_0x1f57('0x1b7')]);if(this[_0x1f57('0x89')](_0x43f421[_0x1f57('0xd8')])){var _0x73337f=this[_0x1f57('0x14')]['sync'](this,_0x43f421[_0x1f57('0xd8')]);if(_0x73337f){this['channel'][_0x1f57('0xa2')](_0x73337f,_0x391e5e);return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')](_0x1f57('0x1b8'),_0x43f421[_0x1f57('0x1b7')],_0x73337f));}}return this[_0x1f57('0x10')][_0x1f57('0xac')](util[_0x1f57('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x43f421[_0x1f57('0x1b7')]));};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1b9')]=function(_0x157010){logger['info'](util[_0x1f57('0x29')](_0x1f57('0x1ba'),_0x157010['label']));_0x157010[_0x1f57('0x5e')]=_0x157010[_0x1f57('0x5e')][_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x157010[_0x1f57('0x5d')])){return this['channel'][_0x1f57('0xac')](_0x1f57('0x1bb'));}if(!this[_0x1f57('0x89')](_0x157010[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')][_0x1f57('0xac')](util['format'](_0x1f57('0x1bc'),_0x157010[_0x1f57('0x5e')]));var _0xd1e36b=this[_0x1f57('0x5c')]['sync'](this,_0x157010);if(_0xd1e36b){this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x1bd'),_0xd1e36b));var _0x554dc2=this['channel'][_0x1f57('0x11f')](_0xd1e36b);try{fs[_0x1f57('0xfe')](_0xd1e36b+_0x1f57('0x1be'));}catch(_0x1d3453){logger[_0x1f57('0x2d')](_0x1d3453);}return _0x554dc2;}return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x157010,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1f57('0x13')][_0x1f57('0x1bf')]=function(_0x161ba4){logger[_0x1f57('0x2f')](util['format'](_0x1f57('0x1c0'),_0x161ba4['label']));_0x161ba4['text']=_0x161ba4[_0x1f57('0x5e')][_0x1f57('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1f57('0x89')](_0x161ba4[_0x1f57('0x5e')])){return this[_0x1f57('0x10')][_0x1f57('0xac')](_0x1f57('0xad'));}this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x1c1'),_0x161ba4[_0x1f57('0x5e')]));var _0x374395=this[_0x1f57('0x65')][_0x1f57('0xa9')](this,_0x161ba4);if(_0x374395){this[_0x1f57('0x10')]['noop'](util['format'](_0x1f57('0x1c2'),_0x374395));var _0x3d89d7=this[_0x1f57('0x10')]['streamFile'](_0x374395);try{fs['unlink'](_0x374395+'.wav');}catch(_0x2a8769){logger['error'](_0x2a8769);}return _0x3d89d7;}return this[_0x1f57('0x10')]['error'](_0x161ba4,_0x1f57('0x1c3'));};AGIVertices[_0x1f57('0x13')]['unpause']=function(_0x225466){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x225466['label']));if(!this['isConfigured'](_0x225466[_0x1f57('0x157')])){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x225466,'no\x20find\x20by\x20configured');}logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x156'),this['channel'][_0x1f57('0x3c')],_0x225466[_0x1f57('0x157')]));var _0x39b78b=this[_0x1f57('0x53')][_0x1f57('0xa9')](this,_0x225466['findBy']);if(_0x39b78b){logger['info'](util['format'](_0x1f57('0x158'),this[_0x1f57('0x10')]['callerid'],_0x225466['findBy']));this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0x158'),this['channel'][_0x1f57('0x3c')],_0x225466['findBy']));return{'code':0xc8,'result':_0x1f57('0x159')};}else{logger[_0x1f57('0x2f')](util[_0x1f57('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1f57('0x10')]['callerid'],_0x225466[_0x1f57('0x157')]));this[_0x1f57('0x10')]['noop'](util['format'](_0x1f57('0x15a'),this[_0x1f57('0x10')][_0x1f57('0x3c')],_0x225466[_0x1f57('0x157')]));return{'code':0xc8,'result':_0x1f57('0x15b')};}};AGIVertices['prototype'][_0x1f57('0x1c4')]=function(_0x25ab93){logger[_0x1f57('0x2f')](util[_0x1f57('0x29')](_0x1f57('0x1c5'),_0x25ab93[_0x1f57('0x39')]));var _0x922318=this[_0x1f57('0x10')][_0x1f57('0x5a')](_0x1f57('0x1c6'),[_0x25ab93[_0x1f57('0x1c7')],_0x25ab93[_0x1f57('0x7b')]]);if(_0x922318[_0x1f57('0xa5')]===-0x1){return _0x922318;}return this[_0x1f57('0x10')]['noop'](util[_0x1f57('0x29')](_0x1f57('0xc2'),_0x1f57('0x1c6'),_0x25ab93['mailbox']));};AGIVertices['prototype'][_0x1f57('0x1c8')]=function(_0x2eabad){logger['info'](util[_0x1f57('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2eabad[_0x1f57('0x39')]));if(!this[_0x1f57('0x89')](_0x2eabad[_0x1f57('0xd8')])){return this[_0x1f57('0x10')]['error'](_0x2eabad,_0x1f57('0x1a5'));}var _0x5b11bc=this[_0x1f57('0x14')][_0x1f57('0xa9')](this,_0x2eabad[_0x1f57('0xd8')]);if(!_0x5b11bc){return this[_0x1f57('0x10')][_0x1f57('0x2d')](_0x2eabad,_0x1f57('0xda'));}var _0x58ba54=this[_0x1f57('0x10')]['getVariable'](_0x5b11bc);return{'code':0xc8,'result':_0x58ba54[_0x1f57('0xa7')]?_0x58ba54[_0x1f57('0xa7')]:'-'};};String['prototype'][_0x1f57('0x1c9')]=function(_0x311d57,_0x3ef717){return this[_0x1f57('0xa4')](_0x311d57)[_0x1f57('0x1ca')](_0x3ef717);};module[_0x1f57('0x1cb')]=AGIVertices; \ No newline at end of file +var _0x1fbb=['GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','no\x20find\x20by\x20configured','math','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','restapi','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','auth','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','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','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','rawHeaders','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getUser','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','interval','getSoundPath','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','toString','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created'];(function(_0x2135e6,_0x462678){var _0x4a6399=function(_0x5f3fbb){while(--_0x5f3fbb){_0x2135e6['push'](_0x2135e6['shift']());}};_0x4a6399(++_0x462678);}(_0x1fbb,0x99));var _0xb1fb=function(_0xc8c77a,_0x570fc1){_0xc8c77a=_0xc8c77a-0x0;var _0x17a0ca=_0x1fbb[_0xc8c77a];return _0x17a0ca;};'use strict';var fs=require('fs');var path=require(_0xb1fb('0x0'));var util=require(_0xb1fb('0x1'));var _=require(_0xb1fb('0x2'));var sh=require(_0xb1fb('0x3'));var odbc=require('odbc')();var rs=require(_0xb1fb('0x4'));var moment=require(_0xb1fb('0x5'));var Mustache=require(_0xb1fb('0x6'));var rp=require(_0xb1fb('0x7'));var logger=require(_0xb1fb('0x8'))('agi');var config=require(_0xb1fb('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xb1fb('0xa'),'rawBody'];var verticesWithRetry=['menu',_0xb1fb('0xb'),_0xb1fb('0xc')];var AGIVertices=function(_0xe0a232,_0xf68d38,_0xb4ca8b){this[_0xb1fb('0xd')]=_0xe0a232;this[_0xb1fb('0xe')]=_0xf68d38;this[_0xb1fb('0xf')]=_0xb4ca8b;};AGIVertices['prototype'][_0xb1fb('0x10')]=function(_0x56a9ef,_0x3fcf7d){this[_0xb1fb('0xe')][_0xb1fb('0x11')](_0x56a9ef)['then'](function(_0x138f63){_0x3fcf7d(null,_0x138f63?_0x138f63[_0xb1fb('0x12')]:![]);})[_0xb1fb('0x13')](function(_0x459732){_0x3fcf7d(_0x459732);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x15')]=function(_0x2c1747,_0x5e3663){this[_0xb1fb('0xe')][_0xb1fb('0x16')](_0x2c1747)['then'](function(_0x3c0422){_0x5e3663(null,_0x3c0422?_0x3c0422[_0xb1fb('0x12')]:![]);})[_0xb1fb('0x13')](function(_0x219346){_0x5e3663(_0x219346);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x17')]=function(_0x264118,_0x2cf5cd){this[_0xb1fb('0xe')][_0xb1fb('0x18')](_0x264118)[_0xb1fb('0x19')](function(_0x162d4c){_0x2cf5cd(null,_0x162d4c?_0x162d4c[_0xb1fb('0x12')]:![]);})['catch'](function(_0x1c8d10){_0x2cf5cd(_0x1c8d10);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x1a')]=function(_0x81bbb2,_0x2da032){this[_0xb1fb('0xe')][_0xb1fb('0x1b')](_0x81bbb2)['then'](function(_0x568523){_0x2da032(null,_0x568523?_0x568523[_0xb1fb('0x1c')]:![]);})['catch'](function(_0x601426){_0x2da032(_0x601426);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x1d')]=function(_0x4eb667,_0xadfa10){this[_0xb1fb('0xe')]['getUserById'](_0x4eb667)['then'](function(_0x2757e4){_0xadfa10(null,_0x2757e4?_0x2757e4['name']:![]);})[_0xb1fb('0x13')](function(_0x2b6f5d){_0xadfa10(_0x2b6f5d);});};AGIVertices[_0xb1fb('0x14')]['getTrunk']=function(_0x27a088,_0x3aabdb){this[_0xb1fb('0xe')]['getTrunkById'](_0x27a088)[_0xb1fb('0x19')](function(_0x4739cc){_0x3aabdb(null,_0x4739cc?_0x4739cc[_0xb1fb('0x12')]:![]);})[_0xb1fb('0x13')](function(_0x5e1da5){_0x3aabdb(_0x5e1da5);});};AGIVertices[_0xb1fb('0x14')]['getSound']=function(_0x58e444,_0x2f7fd2){var _0x1ada03=this;this[_0xb1fb('0xe')][_0xb1fb('0x1e')](_0x58e444)[_0xb1fb('0x19')](function(_0x1382e5){_0x2f7fd2(null,_0x1382e5?_0x1ada03['getSoundPath'](_0x1382e5[_0xb1fb('0x1f')]):![]);})[_0xb1fb('0x13')](function(_0x1a6695){_0x2f7fd2(_0x1a6695);});};AGIVertices[_0xb1fb('0x14')]['getMailAccount']=function(_0x579081,_0x1cc821){this['rpc'][_0xb1fb('0x20')](_0x579081)['then'](function(_0x3e01ba){_0x1cc821(null,_0x3e01ba?_0x3e01ba:![]);})[_0xb1fb('0x13')](function(_0x5ed73d){_0x1cc821(_0x5ed73d);});};AGIVertices['prototype']['sendMailMessage']=function(_0x218f80,_0x568ce7,_0x200376){this[_0xb1fb('0xf')][_0xb1fb('0x21')](_0x218f80,_0x568ce7)[_0xb1fb('0x19')](function(){_0x200376(null);})[_0xb1fb('0x13')](function(_0x59c5dc){_0x200376(_0x59c5dc);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x22')]=function(_0x505bc9,_0x4bc0bb){this[_0xb1fb('0xe')][_0xb1fb('0x23')](_0x505bc9)[_0xb1fb('0x19')](function(_0x2a47be){if(_0x2a47be){if(_0x2a47be['IntervalId']){_0x4bc0bb(null,[_0x2a47be['interval']]);}else{_0x4bc0bb(null,_[_0xb1fb('0x24')](_0x2a47be[_0xb1fb('0x25')],_0xb1fb('0x26')));}}else{_0x4bc0bb(null,![]);}})[_0xb1fb('0x13')](function(_0xcc8476){_0x4bc0bb(_0xcc8476);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x27')]=function(_0x7edd83){return util[_0xb1fb('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x7edd83);};AGIVertices[_0xb1fb('0x14')]['getQueryOdbc']=function(_0x20982f,_0x26ca8f,_0x178a73){odbc[_0xb1fb('0x29')](_0x20982f,function(_0xc157d2){if(_0xc157d2){logger[_0xb1fb('0x2a')](_0xb1fb('0x2b'),_0xc157d2);_0x178a73(_0xc157d2);}else{logger[_0xb1fb('0x2c')](_0xb1fb('0x2d'));odbc[_0xb1fb('0x2e')](_0x26ca8f,function(_0x3ebaa3,_0x295198){if(_0x3ebaa3){logger[_0xb1fb('0x2c')](_0xb1fb('0x2f'),_0x26ca8f);_0x178a73(_0x3ebaa3);}else{logger[_0xb1fb('0x2c')](_0xb1fb('0x30'),_0x26ca8f);odbc[_0xb1fb('0x31')](function(_0x2bf115){if(_0x2bf115){logger[_0xb1fb('0x2a')](_0xb1fb('0x32'),_0x2bf115);}_0x178a73(null,_0x295198);});}});}});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x33')]=function(_0x3c0a82,_0x479c90){this[_0xb1fb('0xe')][_0xb1fb('0x34')](_0x3c0a82)[_0xb1fb('0x19')](function(_0xfcfd56){_0x479c90(null,_0xfcfd56?_0xfcfd56:![]);})[_0xb1fb('0x13')](function(_0x50089b){_0x479c90(_0x50089b);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x35')]=function(_0x5ab451,_0x3e8898){this[_0xb1fb('0xe')][_0xb1fb('0x35')](_0x5ab451)[_0xb1fb('0x19')](function(_0x505d91){_0x3e8898(null,_0x505d91);})[_0xb1fb('0x13')](function(_0x387ac0){_0x3e8898(_0x387ac0);});};AGIVertices[_0xb1fb('0x14')]['createSquareDetailsReport']=function(_0x4e8fee,_0x1d43f0,_0x57de36){this[_0xb1fb('0xe')][_0xb1fb('0x36')]({'uniqueid':this[_0xb1fb('0xd')][_0xb1fb('0x37')],'node':_0x4e8fee[_0xb1fb('0x38')],'application':_0x4e8fee[_0xb1fb('0x39')],'data':_0x1d43f0||null,'project_name':this['channel'][_0xb1fb('0x3a')],'callerid':this['channel'][_0xb1fb('0x3b')]})['then'](function(_0x1d3a4b){if(_0x57de36){_0x57de36(null,_0x1d3a4b);}})[_0xb1fb('0x13')](function(_0x22a82c){if(_0x57de36){_0x57de36(_0x22a82c);}});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x3c')]=function(_0x5d3a14,_0xacfa98,_0x1b355f,_0x5ba18d){this[_0xb1fb('0xe')][_0xb1fb('0x3c')]({'uniqueid':this[_0xb1fb('0xd')][_0xb1fb('0x37')],'callerid':this[_0xb1fb('0xd')]['callerid'],'calleridname':this['channel'][_0xb1fb('0x3d')],'context':this[_0xb1fb('0xd')][_0xb1fb('0x3e')],'extension':this[_0xb1fb('0xd')][_0xb1fb('0x3f')],'priority':this['channel'][_0xb1fb('0x40')],'accountcode':this[_0xb1fb('0xd')]['accountcode'],'dnid':this[_0xb1fb('0xd')][_0xb1fb('0x41')],'projectName':this[_0xb1fb('0xd')][_0xb1fb('0x3a')],'saveName':_0xacfa98,'filename':_0x5d3a14[_0xb1fb('0x42')]||_0xacfa98,'savePath':_0x1b355f})[_0xb1fb('0x19')](function(_0x44b97c){_0x5ba18d(null,_0x44b97c);})[_0xb1fb('0x13')](function(_0x318d29){_0x5ba18d(_0x318d29);});};AGIVertices[_0xb1fb('0x14')]['createSquareMessage']=function(_0x230fea,_0x27bcd6,_0x1f758e,_0x351678,_0x362e4e){this[_0xb1fb('0xe')][_0xb1fb('0x43')]({'uniqueid':this[_0xb1fb('0xd')]['uniqueid'],'body':_0x230fea,'direction':_0x27bcd6,'providerName':_0x1f758e,'providerResponse':_0x351678})[_0xb1fb('0x19')](function(_0x28535e){if(_0x362e4e){_0x362e4e(null,_0x28535e);}})[_0xb1fb('0x13')](function(_0xa68489){if(_0x362e4e){_0x362e4e(_0xa68489);}});};AGIVertices['prototype']['createCmContact']=function(_0x4587fa,_0x5d36b8){this['rpc'][_0xb1fb('0x44')]({'firstName':_[_0xb1fb('0x45')](_0x4587fa[_0xb1fb('0x12')])||_[_0xb1fb('0x46')](_0x4587fa[_0xb1fb('0x12')])?'callback_'+Math[_0xb1fb('0x47')]():_0x4587fa['name'],'lastName':_['isEmpty'](_0x4587fa['lastName'])||_['isNil'](_0x4587fa[_0xb1fb('0x48')])?null:_0x4587fa[_0xb1fb('0x48')],'phone':_0x4587fa[_0xb1fb('0x49')],'ListId':_0x4587fa[_0xb1fb('0x4a')],'scheduledat':_0x4587fa[_0xb1fb('0x4b')],'callbackUniqueid':this[_0xb1fb('0xd')][_0xb1fb('0x37')],'tags':_0xb1fb('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x4587fa[_0xb1fb('0x4b')]['toString'](),'priority':_0x4587fa[_0xb1fb('0x4d')]})[_0xb1fb('0x19')](function(_0xf55dfc){_0x5d36b8(null,_0xf55dfc);})['catch'](function(_0x4b6c7f){_0x5d36b8(_0x4b6c7f);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x4e')]=function(_0x50e5c7,_0x554c6c){this[_0xb1fb('0xe')][_0xb1fb('0x4f')](_0x50e5c7)[_0xb1fb('0x19')](function(_0x22a96c){_0x554c6c(null,_0x22a96c?_0x22a96c[_0xb1fb('0x12')]:![]);})[_0xb1fb('0x13')](function(_0x52a4a6){_0x554c6c(_0x52a4a6);});};AGIVertices[_0xb1fb('0x14')]['agentPause']=function(_0x22df1e,_0x3cd38c,_0x53ecae){var _0x4effb7={'role':_0xb1fb('0x50')};_0x4effb7[_0x22df1e]=this['channel'][_0xb1fb('0x3b')];this[_0xb1fb('0xe')]['agentPause'](_0x4effb7,_0x3cd38c,this[_0xb1fb('0xd')][_0xb1fb('0x37')])[_0xb1fb('0x19')](function(_0x22d7c6){_0x53ecae(null,_[_0xb1fb('0x46')](_0x22d7c6)?![]:!![]);})[_0xb1fb('0x13')](function(_0x1706a2){logger[_0xb1fb('0x2a')](_0x1706a2);_0x53ecae(null,![]);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x51')]=function(_0x4618df,_0x487f12){var _0x2a3006={'role':_0xb1fb('0x50')};_0x2a3006[_0x4618df]=this[_0xb1fb('0xd')][_0xb1fb('0x3b')];this[_0xb1fb('0xe')][_0xb1fb('0x51')](_0x2a3006)[_0xb1fb('0x19')](function(_0x6eaca){_0x487f12(null,_[_0xb1fb('0x46')](_0x6eaca)?![]:!![]);})[_0xb1fb('0x13')](function(_0x3ac202){logger['error'](_0x3ac202);_0x487f12(null,![]);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x52')]=function(_0x36ab85,_0x5c84a5){var _0xd78ee6={'role':_0xb1fb('0x50')};_0xd78ee6[_0x36ab85]=this[_0xb1fb('0xd')][_0xb1fb('0x3b')];this[_0xb1fb('0xe')]['agentLogout'](_0xd78ee6)['then'](function(_0x2edfe3){_0x5c84a5(null,_[_0xb1fb('0x46')](_0x2edfe3)?![]:!![]);})[_0xb1fb('0x13')](function(_0x7760fd){logger[_0xb1fb('0x2a')](_0x7760fd);_0x5c84a5(null,![]);});};AGIVertices['prototype'][_0xb1fb('0x53')]=function(_0x2d82f2,_0x3fe14e){var _0x52874d={'role':_0xb1fb('0x50')};_0x52874d[_0x2d82f2]=this[_0xb1fb('0xd')][_0xb1fb('0x3b')];var _0x1b8ec0=_0x2d82f2!=_0xb1fb('0x54')?util[_0xb1fb('0x28')](_0xb1fb('0x55'),_0xb1fb('0x56'),this['channel'][_0xb1fb('0x3b')]):undefined;this['rpc'][_0xb1fb('0x53')](_0x52874d,_0x1b8ec0)['then'](function(_0x4f3eb8){_0x3fe14e(null,_['isNil'](_0x4f3eb8)?![]:!![]);})[_0xb1fb('0x13')](function(_0x1ff833){logger['error'](_0x1ff833);_0x3fe14e(null,![]);});};AGIVertices['prototype'][_0xb1fb('0x57')]=function(_0x3bd0bb,_0x4af8df){sh[_0xb1fb('0x58')](_['trim'](_0x3bd0bb),function(_0x3ea693,_0x318642){var _0x26e6c0=_0x318642['replace'](/(\r\n|\n|\r)/gm,'');_0x4af8df(null,_0x26e6c0);});};AGIVertices['prototype'][_0xb1fb('0x59')]=function(_0x5bc1a9,_0x562a30){scripts[_0xb1fb('0x59')](_0x5bc1a9[_0xb1fb('0x5a')],_0x5bc1a9['google_cloud_tts_text_type']||_0xb1fb('0x5b'),_0x5bc1a9[_0xb1fb('0x5b')],_0x5bc1a9[_0xb1fb('0x5c')]||'en-US',_0x5bc1a9[_0xb1fb('0x5d')]||_0xb1fb('0x5e'),_0x5bc1a9[_0xb1fb('0x5f')]||_0xb1fb('0x60'))[_0xb1fb('0x19')](function(_0x384d60){_0x562a30(null,_0x384d60);})[_0xb1fb('0x13')](function(_0x5d4d50){_0x562a30(_0x5d4d50);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x61')]=function(_0x338530,_0x24aa7d){scripts[_0xb1fb('0x61')](_0x338530[_0xb1fb('0x5b')],_0x338530[_0xb1fb('0x62')]||'en',0x1)[_0xb1fb('0x19')](function(_0x895c5e){_0x24aa7d(null,_0x895c5e);})[_0xb1fb('0x13')](function(_0x271c6e){_0x24aa7d(_0x271c6e);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x63')]=function(_0x1464c5,_0x5e5f15){var _0x3ff704={'uri':_0x1464c5[_0xb1fb('0x64')],'method':_0x1464c5[_0xb1fb('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1464c5[_0xb1fb('0x66')])==='number'&&parseInt(_0x1464c5[_0xb1fb('0x66')])>=0x1?parseInt(_0x1464c5[_0xb1fb('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xb1fb('0x67')]([_0xb1fb('0x68'),_0xb1fb('0x69')],_0x3ff704[_0xb1fb('0x65')]['toUpperCase']())){try{_0x3ff704[_0xb1fb('0x6a')]=_0x1464c5[_0xb1fb('0x6b')]?JSON[_0xb1fb('0x6c')](_0x1464c5['rawBody']):{};}catch(_0xf7d1a5){logger[_0xb1fb('0x2a')](_0xb1fb('0x6d'),_0xf7d1a5);}}try{_0x3ff704[_0xb1fb('0x6e')]=_0x1464c5[_0xb1fb('0xa')]?JSON[_0xb1fb('0x6c')](_0x1464c5['rawHeaders']):{};}catch(_0xdee62b){logger['error'](_0xb1fb('0x6f'),_0xdee62b);}if(_0x1464c5['computedVariables']){try{var _0x228f6d=require(_0x1464c5[_0xb1fb('0x70')])[_0xb1fb('0x71')](this,_0x3ff704);_0x3ff704[_0xb1fb('0x72')]=Mustache[_0xb1fb('0x73')](_0x1464c5[_0xb1fb('0x64')],_0x228f6d,{},['$$','$$']);if(_0x3ff704[_0xb1fb('0x6e')]){_0x3ff704['headers']=JSON[_0xb1fb('0x6c')](Mustache[_0xb1fb('0x73')](JSON[_0xb1fb('0x74')](_0x3ff704[_0xb1fb('0x6e')]),_0x228f6d,{},['$$','$$']));}if(_0x3ff704[_0xb1fb('0x6a')]){_0x3ff704['body']=JSON[_0xb1fb('0x6c')](Mustache[_0xb1fb('0x73')](JSON[_0xb1fb('0x74')](_0x3ff704[_0xb1fb('0x6a')]),_0x228f6d,{},['$$','$$']));}}catch(_0x325061){logger[_0xb1fb('0x2a')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x325061);}}rp(_0x3ff704)[_0xb1fb('0x19')](function(_0x50845c){var _0x5e7e76={'statusCode':_0x50845c[_0xb1fb('0x75')]||0xc8,'statusMessage':_0x50845c['statusMessage']||'OK','headers':_0x50845c[_0xb1fb('0x6e')]||{},'body':_0x50845c['body']||{}};_0x5e5f15(null,_0x5e7e76);})['catch'](function(_0x59d51e){var _0x17e46f={'statusCode':_0x59d51e['statusCode']||0x1f4,'statusMessage':_0x59d51e[_0xb1fb('0x76')]||_0xb1fb('0x77'),'headers':_0x59d51e[_0xb1fb('0x78')]['headers']||{},'body':_0x59d51e['options']['body']||{}};_0x5e5f15(null,_0x17e46f);});};AGIVertices[_0xb1fb('0x14')]['googleDialogflow']=function(_0x157a8d,_0x14abd6){scripts[_0xb1fb('0x79')](this[_0xb1fb('0xd')]['uniqueid'],_0x157a8d['key'],_0x157a8d[_0xb1fb('0x5b')],_0x157a8d[_0xb1fb('0x7a')]||'en')['then'](function(_0x4027aa){_0x14abd6(null,_0x4027aa);})[_0xb1fb('0x13')](function(_0x2f2ccf){_0x14abd6(_0x2f2ccf);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x7b')]=function(_0x172df6,_0x1fd614){scripts[_0xb1fb('0x7b')](this[_0xb1fb('0xd')][_0xb1fb('0x37')],_0x172df6[_0xb1fb('0x7c')],_0x172df6['client_email'],_0x172df6['private_key'],_0x172df6['text'],_0x172df6[_0xb1fb('0x7d')]||'en')[_0xb1fb('0x19')](function(_0x5c469b){_0x1fd614(null,_0x5c469b);})[_0xb1fb('0x13')](function(_0x9a2429){_0x1fd614(_0x9a2429);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x7e')]=function(_0x2b58ad,_0x41dd54){scripts[_0xb1fb('0x7e')](this['channel'],_0x2b58ad)['then'](function(_0x2a0f0f){_0x41dd54(null,_0x2a0f0f);})[_0xb1fb('0x13')](function(_0x56cbbc){_0x41dd54(_0x56cbbc);});};AGIVertices['prototype'][_0xb1fb('0x7f')]=function(_0x1f7aad,_0x35bf50){scripts[_0xb1fb('0x7f')](_0x1f7aad[_0xb1fb('0x80')],_0x1f7aad[_0xb1fb('0x5b')],_0x1f7aad[_0xb1fb('0x81')]||_0xb1fb('0x82'),_0x1f7aad[_0xb1fb('0x83')])[_0xb1fb('0x19')](function(_0x5d3e6e){_0x35bf50(null,_0x5d3e6e);})[_0xb1fb('0x13')](function(_0x509bfe){_0x35bf50(_0x509bfe);});};AGIVertices['prototype'][_0xb1fb('0x84')]=function(_0xd6387e,_0x47c167,_0x3a3bef){scripts[_0xb1fb('0x84')](_0x47c167,_0xd6387e['key'],_0xd6387e[_0xb1fb('0x85')]||_0xb1fb('0x82'),this[_0xb1fb('0x86')](_0xd6387e['model'])?_0xd6387e[_0xb1fb('0x87')]:undefined)[_0xb1fb('0x19')](function(_0x548ad2){_0x3a3bef(null,_0x548ad2);})[_0xb1fb('0x13')](function(_0x4d9980){_0x3a3bef(_0x4d9980);});};AGIVertices[_0xb1fb('0x14')]['awsPolly']=function(_0x5ab1c9,_0x30143a){scripts[_0xb1fb('0x88')](_0x5ab1c9[_0xb1fb('0x89')],_0x5ab1c9[_0xb1fb('0x8a')],_0x5ab1c9[_0xb1fb('0x8b')],_0x5ab1c9[_0xb1fb('0x8c')]||_0xb1fb('0x8d'),_0x5ab1c9[_0xb1fb('0x5b')],_0x5ab1c9[_0xb1fb('0x8e')]||'text')[_0xb1fb('0x19')](function(_0x19655a){_0x30143a(null,_0x19655a);})['catch'](function(_0x2e6135){_0x30143a(_0x2e6135);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x8f')]=function(_0x12fdc9,_0x18c548){scripts['awsLex'](this['channel'][_0xb1fb('0x37')],_0x12fdc9['aws_access_key_id'],_0x12fdc9[_0xb1fb('0x8a')],_0x12fdc9[_0xb1fb('0x90')],_0x12fdc9[_0xb1fb('0x5b')],_0x12fdc9[_0xb1fb('0x91')])[_0xb1fb('0x19')](function(_0x2bbe64){_0x18c548(null,_0x2bbe64);})['catch'](function(_0x58ee29){_0x18c548(_0x58ee29);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x92')]=function(_0x369a86,_0x1e117b,_0x502b96){scripts[_0xb1fb('0x92')](_0x1e117b,_0x369a86['key'],_0x369a86[_0xb1fb('0x93')]||_0xb1fb('0x82'))[_0xb1fb('0x19')](function(_0x149e25){_0x502b96(null,_0x149e25);})[_0xb1fb('0x13')](function(_0x3bc004){_0x502b96(_0x3bc004);});};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x94')]=function(_0x10135d,_0x5c5ce4,_0x2c7a1b){scripts['tildeASR'](_0x5c5ce4,_0x10135d[_0xb1fb('0x95')],_0x10135d['appsecret'],_0x10135d[_0xb1fb('0x72')])[_0xb1fb('0x19')](function(_0xc563a1){_0x2c7a1b(null,_0xc563a1);})[_0xb1fb('0x13')](function(_0x5367c5){_0x2c7a1b(_0x5367c5);});};AGIVertices[_0xb1fb('0x14')]['clear']=function(_0x4f3368){var _0x15db87=_[_0xb1fb('0x67')](verticesWithRetry,_0x4f3368[_0xb1fb('0x39')])?_0x4f3368:_[_0xb1fb('0x96')](_0x4f3368);for(var _0x24835a in _0x15db87){if(_0x15db87[_0xb1fb('0x97')](_0x24835a)){if(_0x15db87[_0x24835a]&&_[_0xb1fb('0x98')](_0x15db87[_0x24835a])){if(_['includes'](recursiveMapAttributes,_0x24835a)){_0x15db87[_0x24835a]=this[_0xb1fb('0x99')](_0x15db87[_0x24835a]);}else{_0x15db87[_0x24835a]=this['replaceAllVariables'](_0x15db87[_0x24835a]);}}}}return _0x15db87;};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x9a')]=function(_0x59bbcc){for(var _0xfd9ad9 in _0x59bbcc){if(_0x59bbcc[_0xb1fb('0x97')](_0xfd9ad9)){if(_[_0xb1fb('0x9b')](_0x59bbcc[_0xfd9ad9])){this[_0xb1fb('0x9a')](_0x59bbcc[_0xfd9ad9]);}else if(_[_0xb1fb('0x9c')](_0x59bbcc[_0xfd9ad9])){for(var _0x39be64=0x0;_0x39be64<_0x59bbcc[_0xfd9ad9][_0xb1fb('0x9d')];_0x39be64++){this[_0xb1fb('0x9a')](_0x59bbcc[_0xfd9ad9][_0x39be64]);}}else if(_['isString'](_0x59bbcc[_0xfd9ad9])){_0x59bbcc[_0xfd9ad9]=this[_0xb1fb('0x9e')](_0x59bbcc[_0xfd9ad9]);}}}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x9f')]=function(_0x191b23,_0x34d42d){for(var _0x589c02 in _0x191b23){if(_0x191b23['hasOwnProperty'](_0x589c02)){if(_[_0xb1fb('0x9b')](_0x191b23[_0x589c02])){if(!_['isEmpty'](_0x191b23[_0x589c02])){this[_0xb1fb('0x9f')](_0x191b23[_0x589c02],util['format'](_0xb1fb('0xa0'),_0x34d42d,_0x589c02));}}else if(_[_0xb1fb('0x9c')](_0x191b23[_0x589c02])){for(var _0x46de07=0x0;_0x46de07<_0x191b23[_0x589c02][_0xb1fb('0x9d')];_0x46de07++){this['saveRestApiResult'](_0x191b23[_0x589c02][_0x46de07],util['format'](_0xb1fb('0xa0'),_0x34d42d,_0x589c02+'['+_0x46de07+']'));}}else{if(!_[_0xb1fb('0x46')](_0x191b23[_0x589c02])){this['channel'][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0xa0'),_0x34d42d,_0x589c02),_0x191b23[_0x589c02]);}}}}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x99')]=function(_0x41f0ac){try{var _0x5c0243=JSON[_0xb1fb('0x6c')](_0x41f0ac);this[_0xb1fb('0x9a')](_0x5c0243);return JSON['stringify'](_0x5c0243);}catch(_0x57be87){return this['replaceAllVariables'](_0x41f0ac);}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x9e')]=function(_0x995a85){var _0xa8fddb=_0x995a85[_0xb1fb('0xa2')]('{');for(var _0x101d62=0x1;_0x101d62<_0xa8fddb[_0xb1fb('0x9d')];_0x101d62+=0x1){var _0x7a0a13=_0xa8fddb[_0x101d62][_0xb1fb('0xa2')]('}');if(_0x7a0a13['length']>0x1){_0x995a85=_0x995a85[_0xb1fb('0xa3')]('{'+_0x7a0a13[0x0]+'}',this[_0xb1fb('0xd')][_0xb1fb('0x10')](_0x7a0a13[0x0])[_0xb1fb('0xa4')]||_0x7a0a13[0x0]);}}if(_0xa8fddb['length']===0x1){return _0x995a85['toString']();}return this[_0xb1fb('0x9e')](_0x995a85);};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xa5')]=function(_0x4dbb69,_0x5ca2a1){var _0x41a41f=this[_0xb1fb('0xd')][_0xb1fb('0x10')](_0x4dbb69);if(_0x41a41f[_0xb1fb('0xa6')]===-0x1){return _0x41a41f;}logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0xa7'),_0x5ca2a1,_0x41a41f[_0xb1fb('0xa4')]));return this['channel'][_0xb1fb('0xa1')](_0x5ca2a1,_0x41a41f['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x158992){return _0x158992&&_0x158992!=='0'&&_0x158992!=='-1'&&_0x158992!=='';};AGIVertices['prototype'][_0xb1fb('0xa8')]=function(_0x2e836a){this['createSquareDetailsReport'][_0xb1fb('0x71')](this,_0x2e836a,'-');_0x2e836a[_0xb1fb('0xa9')]=_0x2e836a[_0xb1fb('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xaa')]=function(_0x3c792b){logger['info'](util[_0xb1fb('0x28')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x3c792b['label']));if(!this[_0xb1fb('0x86')](_0x3c792b[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('no\x20text\x20configured');}var _0x1a7521='\x22'+_0x3c792b[_0xb1fb('0x5b')]+'\x22';if(this[_0xb1fb('0x86')](_0x3c792b[_0xb1fb('0x78')])){_0x1a7521+=','+_0x3c792b[_0xb1fb('0x78')];}var _0x559148=this[_0xb1fb('0xd')]['exec'](_0xb1fb('0xac'),_0x1a7521);if(_0x559148[_0xb1fb('0xa6')]===-0x1){return _0x559148;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xad'),_0x1a7521));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xae')]=function(_0x383590){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0xaf'),_0x383590['label']));if(!this[_0xb1fb('0x86')](_0x383590[_0xb1fb('0xb0')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xb1'));}var _0x27a714=_0x383590[_0xb1fb('0xb0')];if(this[_0xb1fb('0x86')](_0x383590[_0xb1fb('0x78')])){_0x27a714+=','+_0x383590[_0xb1fb('0x78')];}var _0x382c64=this[_0xb1fb('0xd')][_0xb1fb('0x58')](_0xb1fb('0xb2'),_0x27a714);if(_0x382c64[_0xb1fb('0xa6')]===-0x1){return _0x382c64;}var _0x3b7a08=this[_0xb1fb('0xa5')](_0xb1fb('0xb3'),_0xb1fb('0xb4'));if(_0x3b7a08[_0xb1fb('0xa6')]===-0x1){return _0x3b7a08;}var _0x14520d=this['getAndSetVariable']('RECOG_INPUT()',_0xb1fb('0xb5'));if(_0x14520d['result']===-0x1){return _0x14520d;}var _0x13fe17=this[_0xb1fb('0xa5')](_0xb1fb('0xb6'),_0xb1fb('0xb7'));if(_0x13fe17[_0xb1fb('0xa6')]===-0x1){return _0x13fe17;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xb8'),_0x27a714));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xb9')]=function(_0x5aa15e){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x5aa15e[_0xb1fb('0x38')]));return this['channel'][_0xb1fb('0xb9')]([_0x5aa15e[_0xb1fb('0xba')],_0x5aa15e[_0xb1fb('0xbb')]]);};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xbc')]=function(_0x38ece7){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0xbd'),_0x38ece7[_0xb1fb('0x38')]));if(this[_0xb1fb('0x86')](_0x38ece7[_0xb1fb('0x66')])){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0xbe'),_0x38ece7[_0xb1fb('0x66')]));var _0x21e118=this[_0xb1fb('0xd')][_0xb1fb('0xbf')](_0x38ece7[_0xb1fb('0x66')]);if(_0x21e118[_0xb1fb('0xa6')]===-0x1){return _0x21e118;}}return this['channel'][_0xb1fb('0xbc')]();};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x4c')]=function(_0x550cad){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0xc0'),_0x550cad['label']));if(!this[_0xb1fb('0x86')](_0x550cad[_0xb1fb('0x4a')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x550cad,'no\x20list\x20selected');}_0x550cad[_0xb1fb('0x4b')]=moment();if(this[_0xb1fb('0x86')](_0x550cad['delay'])){_0x550cad['scheduledAt']=moment()['add'](_0x550cad[_0xb1fb('0xc1')],_0xb1fb('0xc2'));}if(!this[_0xb1fb('0x86')](_0x550cad[_0xb1fb('0x4d')])){_0x550cad[_0xb1fb('0x4d')]=0x2;}this['createCmContact']['sync'](this,_0x550cad);return this['channel'][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xc3'),_0x550cad[_0xb1fb('0x49')],_0x550cad[_0xb1fb('0x4a')],_0x550cad[_0xb1fb('0x4b')]));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xc4')]=function(_0x281633){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x281633[_0xb1fb('0x38')]));var _0x200508=this[_0xb1fb('0xd')][_0xb1fb('0x58')](_0x281633[_0xb1fb('0xc5')],_0x281633[_0xb1fb('0x78')]);if(_0x200508[_0xb1fb('0xa6')]===-0x1){return _0x200508;}return this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0xc6'),_0x281633[_0xb1fb('0xc5')],_0x281633[_0xb1fb('0x78')]));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xc7')]=function(_0x5ad8cf){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0xc8'),_0x5ad8cf['label']));if(!this[_0xb1fb('0x86')](_0x5ad8cf[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xc9'));}var _0x4303b9='\x22'+_0x5ad8cf[_0xb1fb('0x5b')]+'\x22';if(this[_0xb1fb('0x86')](_0x5ad8cf[_0xb1fb('0x78')])){_0x4303b9+=','+_0x5ad8cf['options'];}var _0x185919=this['channel'][_0xb1fb('0x58')](_0xb1fb('0xac'),_0x4303b9);if(_0x185919[_0xb1fb('0xa6')]===-0x1){return _0x185919;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xad'),_0x4303b9));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xca')]=function(_0x341aa7){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0xcb'),_0x341aa7['label']));if(!this[_0xb1fb('0x86')](_0x341aa7[_0xb1fb('0x5b')])){return this['channel'][_0xb1fb('0xab')](_0xb1fb('0xc9'));}var _0x305d87='\x22'+_0x341aa7[_0xb1fb('0x5b')]+'\x22';if(this['isConfigured'](_0x341aa7['options'])){_0x305d87+=','+_0x341aa7[_0xb1fb('0x78')];}var _0x1baf10=this[_0xb1fb('0xd')][_0xb1fb('0x58')](_0xb1fb('0xac'),_0x305d87);if(_0x1baf10['result']===-0x1){return _0x1baf10;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xad'),_0x305d87));};AGIVertices['prototype'][_0xb1fb('0xcc')]=function(_0x431616){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0xcd'),_0x431616[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x431616[_0xb1fb('0xb0')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xb1'));}var _0x4ca221=_0x431616[_0xb1fb('0xb0')];if(this[_0xb1fb('0x86')](_0x431616[_0xb1fb('0x78')])){_0x4ca221+=','+_0x431616[_0xb1fb('0x78')];}var _0x50dfa8=this[_0xb1fb('0xd')][_0xb1fb('0x58')](_0xb1fb('0xb2'),_0x4ca221);if(_0x50dfa8[_0xb1fb('0xa6')]===-0x1){return _0x50dfa8;}var _0x5255fc=this['getAndSetVariable'](_0xb1fb('0xb3'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5255fc[_0xb1fb('0xa6')]===-0x1){return _0x5255fc;}var _0x37f353=this[_0xb1fb('0xa5')](_0xb1fb('0xce'),_0xb1fb('0xcf'));if(_0x37f353[_0xb1fb('0xa6')]===-0x1){return _0x37f353;}var _0x47a333=this[_0xb1fb('0xa5')](_0xb1fb('0xb6'),_0xb1fb('0xd0'));if(_0x47a333['result']===-0x1){return _0x47a333;}return this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4ca221));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xd1')]=function(_0x930893){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0xd2'),_0x930893['label']));if(!this['isConfigured'](_0x930893[_0xb1fb('0xb0')])){return this[_0xb1fb('0xd')]['noop'](_0xb1fb('0xb1'));}var _0x13be18=_0x930893[_0xb1fb('0xb0')];if(this['isConfigured'](_0x930893['options'])){_0x13be18+=','+_0x930893['options'];}var _0x54aa9a=this[_0xb1fb('0xd')]['exec'](_0xb1fb('0xb2'),_0x13be18);if(_0x54aa9a[_0xb1fb('0xa6')]===-0x1){return _0x54aa9a;}var _0x5662d6=this[_0xb1fb('0xa5')](_0xb1fb('0xb3'),_0xb1fb('0xd3'));if(_0x5662d6[_0xb1fb('0xa6')]===-0x1){return _0x5662d6;}var _0x224fa6=this[_0xb1fb('0xa5')]('RECOG_INPUT()',_0xb1fb('0xd4'));if(_0x224fa6[_0xb1fb('0xa6')]===-0x1){return _0x224fa6;}var _0x4e10af=this[_0xb1fb('0xa5')](_0xb1fb('0xb6'),_0xb1fb('0xd5'));if(_0x4e10af[_0xb1fb('0xa6')]===-0x1){return _0x4e10af;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0xb8'),_0x13be18));};AGIVertices['prototype']['database']=function(_0x46055d){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0xd6'),_0x46055d[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x46055d[_0xb1fb('0xd7')])){return this['channel'][_0xb1fb('0x2a')](_0x46055d,_0xb1fb('0xd8'));}var _0x313386=this['getSquareOdbc'][_0xb1fb('0x71')](this,_0x46055d['odbc_id']);if(!_0x313386){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x46055d,'no\x20odbc\x20database\x20found');}if(!this[_0xb1fb('0x86')](_0x46055d[_0xb1fb('0x2e')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x46055d,_0xb1fb('0xd9'));}var _0x5af119=_0x46055d[_0xb1fb('0x2e')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xda'),_0x5af119));var _0x401069=this[_0xb1fb('0xdb')][_0xb1fb('0x71')](this,_0x313386,_0x5af119);this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x46055d,_0x5af119);if(!this[_0xb1fb('0x86')](_0x46055d[_0xb1fb('0xdc')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4321cc=this[_0xb1fb('0x10')][_0xb1fb('0x71')](this,_0x46055d[_0xb1fb('0xdc')]);if(!_0x4321cc){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x46055d,_0xb1fb('0xdd'));}var _0x5c909a=this;_0x401069[_0xb1fb('0xde')](function(_0xd93b56,_0x56c1e8){Object[_0xb1fb('0xdf')](_0xd93b56)['forEach'](function(_0x46589f){_0x5c909a[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0xe0'),_0x4321cc,_0x56c1e8,_0x46589f),_0xd93b56[_0x46589f]);});});this['channel'][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0xe1'),_0x4321cc),_0x401069[_0xb1fb('0x9d')]);return this['channel']['noop'](util[_0xb1fb('0x28')](_0xb1fb('0xe2'),_0x4321cc));};AGIVertices['prototype'][_0xb1fb('0xe3')]=function(_0x341fee){logger['debug'](util[_0xb1fb('0x28')](_0xb1fb('0xe4'),_0x341fee[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x341fee['sip_id'])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x341fee,'no\x20user\x20selected');}var _0xc77f74=this['getUser']['sync'](this,_0x341fee[_0xb1fb('0xe5')]);if(!_0xc77f74){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x341fee,_0xb1fb('0xe6'));}var _0x49e1de=this[_0xb1fb('0xd')]['exec'](_0xb1fb('0xe7'),[util['format']('SIP/%s',_0xc77f74),_0x341fee['timeout'],_0x341fee[_0xb1fb('0xe8')],_0x341fee[_0xb1fb('0x64')]]);if(_0x49e1de['result']===-0x1){return _0x49e1de;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xe9'),'DIAL'));};AGIVertices['prototype'][_0xb1fb('0xea')]=function(_0x481a8e){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0xeb'),_0x481a8e[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x481a8e[_0xb1fb('0x80')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xec'));}if(!this[_0xb1fb('0x86')](_0x481a8e[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0xb1fb('0x36')](_0x481a8e);this[_0xb1fb('0x43')](_0x481a8e[_0xb1fb('0x5b')],'in','','');this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0xed'),_0x481a8e[_0xb1fb('0x5b')]));var _0x3d9438=this['googleDialogflow'][_0xb1fb('0x71')](this,_0x481a8e);if(_0x3d9438){for(var _0x4b6853 in _0x3d9438){if(_0x3d9438[_0xb1fb('0x97')](_0x4b6853)){this[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0xee'),_0x4b6853[_0xb1fb('0xef')]()),_0x3d9438[_0x4b6853]);}}this[_0xb1fb('0x43')](_0x3d9438['speech'],_0xb1fb('0xf0'),_0xb1fb('0xea'),'');return this['channel'][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xf1'),_0x3d9438[_0xb1fb('0xf2')]));}return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x481a8e,_0xb1fb('0xf3'));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xf4')]=function(_0x4c72b0){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0xf5'),_0x4c72b0['label']));if(!this['isConfigured'](_0x4c72b0[_0xb1fb('0x7c')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xf6'));}if(!this['isConfigured'](_0x4c72b0[_0xb1fb('0xf7')])){return this['channel'][_0xb1fb('0xab')](_0xb1fb('0xf8'));}if(!this[_0xb1fb('0x86')](_0x4c72b0['private_key'])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('no\x20private_key\x20configured');}if(!this[_0xb1fb('0x86')](_0x4c72b0[_0xb1fb('0x7d')])){return this['channel'][_0xb1fb('0xab')](_0xb1fb('0xf9'));}if(!this['isConfigured'](_0x4c72b0[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xc9'));}this[_0xb1fb('0xd')][_0xb1fb('0xfa')]=!![];this['createSquareDetailsReport'](_0x4c72b0);this['createSquareMessage'](_0x4c72b0[_0xb1fb('0x5b')],'in','','');this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xfb'),_0x4c72b0['text']));var _0x13a222=this['googleDialogflowV2']['sync'](this,_0x4c72b0);if(_0x13a222){for(var _0x23dc27 in _0x13a222){if(_0x13a222[_0xb1fb('0x97')](_0x23dc27)){if(_0x23dc27!==_0xb1fb('0xfc')){this['channel']['setVariable'](util['format'](_0xb1fb('0xee'),_0x23dc27[_0xb1fb('0xef')]()),_0x13a222[_0x23dc27]);}}}this[_0xb1fb('0x43')](_0x13a222[_0xb1fb('0xf2')],'out',_0xb1fb('0xf4'),_0x13a222['providerResponse']);return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xfd'),_0x13a222[_0xb1fb('0xf2')]));}return this[_0xb1fb('0xd')]['error'](_0x4c72b0,_0xb1fb('0xfe'));};AGIVertices['prototype'][_0xb1fb('0xff')]=function(_0x336cab){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x100'),_0x336cab[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x336cab['ndauth_url'])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xb1fb('0x86')](_0x336cab['username'])){return this['channel']['noop'](_0xb1fb('0x101'));}if(!this[_0xb1fb('0x86')](_0x336cab[_0xb1fb('0x102')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x103'));}if(!this[_0xb1fb('0x86')](_0x336cab[_0xb1fb('0x104')])){return this['channel'][_0xb1fb('0xab')](_0xb1fb('0xc9'));}this[_0xb1fb('0xd')][_0xb1fb('0xfa')]=!![];this[_0xb1fb('0x36')](_0x336cab);this['createSquareMessage'](_0x336cab[_0xb1fb('0x5b')],'in','','');this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x105'),_0x336cab['text']));var _0x596215=this[_0xb1fb('0x7e')][_0xb1fb('0x71')](this,_0x336cab);if(_0x596215){for(var _0x4c65be in _0x596215){if(_0x596215[_0xb1fb('0x97')](_0x4c65be)){this[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0x106'),_0x4c65be[_0xb1fb('0xef')]()),_0x596215[_0x4c65be]);}}this[_0xb1fb('0x43')](_0x596215[_0xb1fb('0xf2')],_0xb1fb('0xf0'),'sesteknda','');if(_0x596215[_0xb1fb('0x107')]){this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x596215[_0xb1fb('0x107')]));var _0x43bdf5=this[_0xb1fb('0xd')][_0xb1fb('0x108')](_0x596215[_0xb1fb('0x107')]);try{fs['unlink'](_0x596215[_0xb1fb('0x107')]+_0xb1fb('0x109'));}catch(_0x4bc549){logger['error'](_0x4bc549);}return _0x43bdf5;}else{return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x10a'),_0x596215['speech']));}}return this[_0xb1fb('0xd')]['error'](_0x336cab,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x10b')]=function(_0x310b85){logger['info'](util['format'](_0xb1fb('0x10c'),_0x310b85[_0xb1fb('0x38')]));return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x10b'));};AGIVertices['prototype'][_0xb1fb('0x10d')]=function(_0x217bd3){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0x10e'),_0x217bd3[_0xb1fb('0x38')]));var _0x29cc3f='';if(_0x217bd3[_0xb1fb('0x10f')]){if(!this[_0xb1fb('0x86')](_0x217bd3[_0xb1fb('0x10f')])){return this['channel'][_0xb1fb('0x2a')](_0x217bd3,_0xb1fb('0x110'));}else{var _0x2e2c84=parseInt(_0x217bd3[_0xb1fb('0x10f')],0xa);if(isNaN(_0x2e2c84)){_0x29cc3f=_0x217bd3[_0xb1fb('0x10f')];}else{_0x29cc3f=this['getTrunk'][_0xb1fb('0x71')](this,_0x217bd3[_0xb1fb('0x10f')]);if(!_0x29cc3f){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x217bd3,'no\x20trunk\x20found');}}}}else if(_0x217bd3[_0xb1fb('0x111')]){_0x29cc3f=_0x217bd3[_0xb1fb('0x111')];}else{return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x217bd3,_0xb1fb('0x110'));}var _0x155388=this[_0xb1fb('0xd')][_0xb1fb('0x58')](_0xb1fb('0xe7'),[util['format'](_0xb1fb('0x112'),_0x29cc3f,_0x217bd3['phone']),_0x217bd3['timeout'],_0x217bd3[_0xb1fb('0xe8')],_0x217bd3['url']]);if(_0x155388['result']===-0x1){return _0x155388;}return this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')]('Executed\x20command\x20%s',_0xb1fb('0xe7')));};AGIVertices[_0xb1fb('0x14')]['finally']=function(_0x186e48){logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x113'),_0x186e48[_0xb1fb('0x38')]));return this['channel']['noop'](_0xb1fb('0x114'));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xb')]=function(_0x50a218){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x115'),_0x50a218[_0xb1fb('0x38')]));if(_0x50a218[_0xb1fb('0xa9')]===0x0){return this[_0xb1fb('0xa8')](_0x50a218);}_0x50a218['retry']-=0x1;if(!this['isConfigured'](_0x50a218['file_id'])){return this['channel'][_0xb1fb('0x2a')](_0x50a218,_0xb1fb('0x116'));}var _0x43ca4c=this[_0xb1fb('0x117')][_0xb1fb('0x71')](this,_0x50a218['file_id']);if(!_0x43ca4c){return this['channel']['error'](_0x50a218,_0xb1fb('0x118'));}if(!this['isConfigured'](_0x50a218[_0xb1fb('0xdc')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0xb1fb('0x119'));}var _0x52ca18=this['channel'][_0xb1fb('0x11a')](_0x43ca4c,_0x50a218['response'],_0x50a218['maxdigit']);var _0x3407e1=_0x52ca18[_0xb1fb('0xa6')]?_0x52ca18[_0xb1fb('0xa6')][_0xb1fb('0x11b')]():'';logger['info'](_0xb1fb('0x11c'),JSON['stringify'](_0x52ca18));if(_0x52ca18['result']===-0x1){this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x50a218,_0x3407e1);return _0x52ca18;}else if(_0x52ca18[_0xb1fb('0xa4')]===_0xb1fb('0x66')){_0x52ca18['result']=_0x3407e1[_0xb1fb('0x9d')]>=parseInt(_0x50a218[_0xb1fb('0x11d')])?'x':'i';}else{_0x52ca18[_0xb1fb('0xa6')]=_0x3407e1[_0xb1fb('0x9d')]>=parseInt(_0x50a218[_0xb1fb('0x11d')])&&_0x3407e1['length']<=parseInt(_0x50a218[_0xb1fb('0x11e')])?'x':'i';}var _0x30c186=this[_0xb1fb('0x10')]['sync'](this,_0x50a218[_0xb1fb('0xdc')]);if(!_0x30c186){return this[_0xb1fb('0xd')]['error'](_0x50a218,_0xb1fb('0xdd'));}this[_0xb1fb('0xd')][_0xb1fb('0xa1')](_0x30c186,_0x3407e1);if(this['isConfigured'](_0x50a218[_0xb1fb('0x11f')])){var _0x2a1001=parseInt(_0x50a218[_0xb1fb('0x11f')],0xa);var _0x145e3f=rs[_0xb1fb('0x120')]({'charset':'*','length':_0x2a1001});var _0x344a6c=_0x3407e1[_0xb1fb('0x9d')];if(_0x344a6c>0x0){if(_0x344a6c>_0x2a1001){this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x50a218,_0x50a218[_0xb1fb('0x121')]==='first'?_0x145e3f+_0x3407e1[_0xb1fb('0x122')](_0x2a1001):_0x3407e1[_0xb1fb('0x122')](0x0,_0x344a6c-_0x2a1001)+_0x145e3f);}else{this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x50a218,rs[_0xb1fb('0x120')]({'charset':'*','length':_0x344a6c}));}}else{this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x50a218,'');}}else{this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x50a218,_0x3407e1);}return _0x52ca18;};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0xc')]=function(_0x3e35ea){logger['info'](util[_0xb1fb('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x3e35ea['label']));return this[_0xb1fb('0xb')](_0x3e35ea);};AGIVertices['prototype'][_0xb1fb('0x123')]=function(_0x14a6e1){logger['info'](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x14a6e1['label']));this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x14a6e1,_0x14a6e1[_0xb1fb('0x124')]);return this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')]('GOAL\x20%s',_0x14a6e1[_0xb1fb('0x124')]));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x125')]=function(_0x3e0624){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0x126'),_0x3e0624['label']));if(!this[_0xb1fb('0x86')](_0x3e0624['aws_access_key_id'])||!this['isConfigured'](_0x3e0624[_0xb1fb('0x8a')])){return this[_0xb1fb('0xd')]['noop'](_0xb1fb('0x127'));}if(!this[_0xb1fb('0x86')](_0x3e0624[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xc9'));}this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x128'),_0x3e0624['text']));var _0xa1a4cc=this['awsPolly'][_0xb1fb('0x71')](this,_0x3e0624);if(_0xa1a4cc){this['channel'][_0xb1fb('0xab')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0xa1a4cc));var _0x2533ae=this[_0xb1fb('0xd')][_0xb1fb('0x108')](_0xa1a4cc);try{fs[_0xb1fb('0x129')](_0xa1a4cc+'.wav');}catch(_0x10360f){logger[_0xb1fb('0x2a')](_0x10360f);}return _0x2533ae;}return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x3e0624,_0xb1fb('0x12a'));};AGIVertices[_0xb1fb('0x14')]['awslex']=function(_0x23d918){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x12b'),_0x23d918['label']));if(!this['isConfigured'](_0x23d918['aws_access_key_id'])||!this['isConfigured'](_0x23d918[_0xb1fb('0x8a')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x127'));}if(!this['isConfigured'](_0x23d918[_0xb1fb('0x91')])){return this[_0xb1fb('0xd')]['noop'](_0xb1fb('0x12c'));}if(!this['isConfigured'](_0x23d918['text'])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xc9'));}this[_0xb1fb('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x23d918);this[_0xb1fb('0x43')](_0x23d918[_0xb1fb('0x5b')],'in','','');this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x12d'),_0x23d918[_0xb1fb('0x5b')]));var _0x4da945=this['awsLex'][_0xb1fb('0x71')](this,_0x23d918);if(_0x4da945){for(var _0xaa69a9 in _0x4da945){if(_0x4da945['hasOwnProperty'](_0xaa69a9)&&_['isString'](_0x4da945[_0xaa69a9])){this[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')]('AWS_LEX_%s',_0xaa69a9[_0xb1fb('0xef')]()),_0x4da945[_0xaa69a9]);}}if(_['isNil'](_0x4da945[_0xb1fb('0x76')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xb1fb('0x43')](_0x4da945[_0xb1fb('0x76')],_0xb1fb('0xf0'),_0xb1fb('0x12e'),'');return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x12f'),_0x4da945['message']));}}return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x23d918,_0xb1fb('0x130'));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x131')]=function(_0x465e3b){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x465e3b[_0xb1fb('0x38')],_0x465e3b[_0xb1fb('0x66')]));if(!this[_0xb1fb('0x86')](_0x465e3b[_0xb1fb('0x80')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xec'));}var _0x26d9d1=_0xb1fb('0x132');var _0xfd4da1=util['format'](_0xb1fb('0x133'),FILES_PATH,rs['generate'](0x4));var _0x1ef9b4=util[_0xb1fb('0x28')](_0xb1fb('0xa0'),_0xfd4da1,_0x26d9d1);var _0x3535e2=!![];if(_0x465e3b['beep']===_0xb1fb('0x134')){_0x3535e2=![];}var _0x5a77f9=this['channel'][_0xb1fb('0x135')](_0xfd4da1,_0x26d9d1,_0x465e3b[_0xb1fb('0x136')],_0x465e3b[_0xb1fb('0x66')],undefined,_0x3535e2);if(_0x5a77f9[_0xb1fb('0xa6')]!==-0x1){this['channel']['noop'](util['format'](_0xb1fb('0x137'),_0x1ef9b4));var _0x43c568=this[_0xb1fb('0x92')][_0xb1fb('0x71')](this,_0x465e3b,_0x1ef9b4);if(_0x43c568){for(var _0x10a7a6 in _0x43c568){if(_0x43c568[_0xb1fb('0x97')](_0x10a7a6)){this[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0x138'),_0x10a7a6['toUpperCase']()),_0x43c568[_0x10a7a6]);}}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0xb1fb('0x74')](_0x43c568)));}}return _0x5a77f9;};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x139')]=function(_0x3564d2){logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x13a'),_0x3564d2['label']));if(!this['isConfigured'](_0x3564d2[_0xb1fb('0x95')])){return this['channel'][_0xb1fb('0xab')](_0xb1fb('0x13b'));}if(!this['isConfigured'](_0x3564d2[_0xb1fb('0x13c')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x13d'));}var _0x35ae88='wav';var _0x511038=util[_0xb1fb('0x28')](_0xb1fb('0x133'),FILES_PATH,rs['generate'](0x4));var _0x4910a7=util['format'](_0xb1fb('0xa0'),_0x511038,_0x35ae88);var _0x3f22ba=!![];if(_0x3564d2[_0xb1fb('0x13e')]===_0xb1fb('0x134')){_0x3f22ba=![];}var _0x5895c5=this[_0xb1fb('0xd')][_0xb1fb('0x135')](_0x511038,_0x35ae88,_0x3564d2[_0xb1fb('0x136')],_0x3564d2['timeout'],undefined,_0x3f22ba);if(_0x5895c5['result']!==-0x1){this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0x13f'),_0x4910a7));var _0x523fb6=this[_0xb1fb('0x94')][_0xb1fb('0x71')](this,_0x3564d2,_0x4910a7);if(_0x523fb6){for(var _0x4c3486 in _0x523fb6){if(_0x523fb6[_0xb1fb('0x97')](_0x4c3486)){this[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0x140'),_0x4c3486['toUpperCase']()),_0x523fb6[_0x4c3486]);}}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x141'),JSON[_0xb1fb('0x74')](_0x523fb6)));}}return _0x5895c5;};AGIVertices[_0xb1fb('0x14')]['gotoc']=function(_0x4c9194){logger['info'](util['format'](_0xb1fb('0x142'),_0x4c9194[_0xb1fb('0x38')]));return this[_0xb1fb('0xd')]['continueAt'](_0x4c9194['context'],_0x4c9194[_0xb1fb('0x3f')],_0x4c9194[_0xb1fb('0x40')]);};AGIVertices[_0xb1fb('0x14')]['gotoif']=function(_0x398fcf){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x143'),_0x398fcf['label']));if(!this[_0xb1fb('0x86')](_0x398fcf[_0xb1fb('0x144')])){return this['channel'][_0xb1fb('0x2a')](_0x398fcf,'no\x20condition\x20configured');}try{var _0x5813b9=eval(_0x398fcf[_0xb1fb('0x144')])?_0xb1fb('0x145'):_0xb1fb('0x146');this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x147'),_0x398fcf['condition'],_0x5813b9));return{'code':0xc8,'result':_0x5813b9};}catch(_0x15dd80){return{'code':0xc8,'result':_0xb1fb('0x146')};}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x148')]=function(_0x3a6570){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x149'),_0x3a6570[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x3a6570['interval_id'])){return this[_0xb1fb('0xd')]['error'](_0x3a6570,'no\x20interval\x20configured');}var _0x4ab7ba=this[_0xb1fb('0x22')][_0xb1fb('0x71')](this,_0x3a6570[_0xb1fb('0x14a')]);if(!_0x4ab7ba){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x3a6570,_0xb1fb('0x14b'));}for(var _0x36cb1f=0x0;_0x36cb1f<_0x4ab7ba[_0xb1fb('0x9d')];_0x36cb1f+=0x1){var _0x13b44b=this[_0xb1fb('0xd')][_0xb1fb('0x10')](util[_0xb1fb('0x28')](_0xb1fb('0x14c'),_0x4ab7ba[_0x36cb1f]));if(_0x13b44b[_0xb1fb('0xa6')]===-0x1){return _0x13b44b;}logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x14d'),_0x4ab7ba[_0x36cb1f],_0x13b44b[_0xb1fb('0xa4')]));if(_0x13b44b[_0xb1fb('0xa4')]===_0xb1fb('0x145')){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x14d'),_0x4ab7ba[_0x36cb1f],'true'));this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0x14d'),_0x4ab7ba[_0x36cb1f],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x14d'),_0x4ab7ba[_0x36cb1f],'false'));this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0x14d'),_0x4ab7ba[_0x36cb1f],_0xb1fb('0x146')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x14e')]=function(_0x2ff194){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0x14f'),_0x2ff194['label']));return this[_0xb1fb('0xd')][_0xb1fb('0x14e')]();};AGIVertices['prototype'][_0xb1fb('0x150')]=function(_0x4682f4){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x151'),_0x4682f4[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x4682f4[_0xb1fb('0x80')])){return this['channel'][_0xb1fb('0xab')]('no\x20key\x20configured');}var _0x4dd84c=_0xb1fb('0x132');var _0x50b49b=util[_0xb1fb('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x5403ae=util['format'](_0xb1fb('0xa0'),_0x50b49b,_0x4dd84c);var _0x55c473=!![];if(_0x4682f4[_0xb1fb('0x13e')]==='NOBEEP'){_0x55c473=![];}var _0x37fc6f=this[_0xb1fb('0xd')][_0xb1fb('0x135')](_0x50b49b,_0x4dd84c,_0x4682f4[_0xb1fb('0x136')],_0x4682f4['timeout'],undefined,_0x55c473);if(_0x37fc6f[_0xb1fb('0xa6')]!==-0x1){this['channel'][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x152'),_0x5403ae));var _0x39f9e2=this[_0xb1fb('0x84')][_0xb1fb('0x71')](this,_0x4682f4,_0x5403ae);if(_0x39f9e2){for(var _0x20a8df in _0x39f9e2){if(_0x39f9e2[_0xb1fb('0x97')](_0x20a8df)){this['channel']['setVariable'](util[_0xb1fb('0x28')](_0xb1fb('0x153'),_0x20a8df[_0xb1fb('0xef')]()),_0x39f9e2[_0x20a8df]);}}return this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0x154'),JSON[_0xb1fb('0x74')](_0x39f9e2)));}}return _0x37fc6f;};AGIVertices[_0xb1fb('0x14')]['ispeechtts']=function(_0x2225e9){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x155'),_0x2225e9[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x2225e9['key'])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x2225e9[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')]['noop'](_0xb1fb('0xc9'));}this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x2225e9[_0xb1fb('0x5b')]));var _0x3714c1=this['ispeechTTS'][_0xb1fb('0x71')](this,_0x2225e9);if(_0x3714c1){this['channel']['noop'](util[_0xb1fb('0x28')](_0xb1fb('0x152'),_0x3714c1));var _0x118aa2=this['channel']['streamFile'](_0x3714c1,_0x2225e9[_0xb1fb('0x136')]);try{fs[_0xb1fb('0x129')](_0x3714c1+_0xb1fb('0x109'));}catch(_0x1bf85d){logger['error'](_0x1bf85d);}return _0x118aa2;}return this[_0xb1fb('0xd')]['error'](_0x2225e9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xb1fb('0x14')]['login']=function(_0x3e3ff8){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x3e3ff8[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x3e3ff8[_0xb1fb('0x156')])){return this['channel'][_0xb1fb('0x2a')](_0x3e3ff8,'no\x20find\x20by\x20configured');}logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x157'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x3e3ff8['findBy']));var _0x344a1f=this[_0xb1fb('0x53')]['sync'](this,_0x3e3ff8[_0xb1fb('0x156')]);if(_0x344a1f){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x158'),this['channel'][_0xb1fb('0x3b')],_0x3e3ff8[_0xb1fb('0x156')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x158'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x3e3ff8['findBy']));return{'code':0xc8,'result':_0xb1fb('0x159')};}else{logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x15a'),this[_0xb1fb('0xd')]['callerid'],_0x3e3ff8['findBy']));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x15a'),this['channel']['callerid'],_0x3e3ff8[_0xb1fb('0x156')]));return{'code':0xc8,'result':_0xb1fb('0x15b')};}};AGIVertices[_0xb1fb('0x14')]['logout']=function(_0x726fd5){logger['info'](util[_0xb1fb('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x726fd5[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x726fd5['findBy'])){return this['channel'][_0xb1fb('0x2a')](_0x726fd5,_0xb1fb('0x15c'));}logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb1fb('0xd')]['callerid'],_0x726fd5[_0xb1fb('0x156')]));var _0x20d627=this[_0xb1fb('0x52')]['sync'](this,_0x726fd5['findBy']);if(_0x20d627){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0x158'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x726fd5[_0xb1fb('0x156')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x158'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x726fd5[_0xb1fb('0x156')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0x15a'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x726fd5[_0xb1fb('0x156')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x15a'),this['channel'][_0xb1fb('0x3b')],_0x726fd5['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x15d')]=function(_0x3a26fe){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3a26fe['label']));if(!this[_0xb1fb('0x86')](_0x3a26fe[_0xb1fb('0x15e')])){return this['channel'][_0xb1fb('0x2a')](_0x3a26fe,_0xb1fb('0x15f'));}this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format']('math\x20%s',_0x3a26fe[_0xb1fb('0x15e')]));var _0x3bf9fc=eval(_0x3a26fe[_0xb1fb('0x15e')]);if(!this[_0xb1fb('0x86')](_0x3a26fe['variable_id'])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x119'));}var _0x27b50a=this['getVariable'][_0xb1fb('0x71')](this,_0x3a26fe[_0xb1fb('0xdc')]);if(!_0x27b50a){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x3a26fe,_0xb1fb('0xdd'));}if(_[_0xb1fb('0x9c')](_0x3bf9fc)){var _0xab256=this;_0x3bf9fc[_0xb1fb('0xde')](function(_0x4f986a,_0x1b824f){_0xab256[_0xb1fb('0xd')][_0xb1fb('0xa1')](util['format']('%s[%s]',_0x27b50a,_0x1b824f),_0x4f986a);});return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x160'),_0x27b50a));}else{return this[_0xb1fb('0xd')]['setVariable'](_0x27b50a,_0x3bf9fc);}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x161')]=function(_0x37bd88){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x162'),_0x37bd88[_0xb1fb('0x38')]));if(_0x37bd88[_0xb1fb('0xa9')]===0x0){return this[_0xb1fb('0xa8')](_0x37bd88);}_0x37bd88['retry']-=0x1;if(!this[_0xb1fb('0x86')](_0x37bd88['file_id'])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x37bd88,_0xb1fb('0x116'));}var _0x474551=this['getSound'][_0xb1fb('0x71')](this,_0x37bd88[_0xb1fb('0x163')]);if(!_0x474551){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x37bd88,_0xb1fb('0x118'));}var _0x3d7639=this[_0xb1fb('0xd')][_0xb1fb('0x11a')](_0x474551,_0x37bd88[_0xb1fb('0x164')],_0x37bd88[_0xb1fb('0x165')]);var _0x30e4b5=_0x3d7639['result'];if(_0x3d7639['result']===-0x1){this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x37bd88,'-1');return _0x3d7639;}else if(_0x3d7639[_0xb1fb('0xa4')]===_0xb1fb('0x66')){_0x3d7639['result']=_0x3d7639[_0xb1fb('0xa6')][_0xb1fb('0x9d')]>0x0?_0x3d7639['result']:'t';}else if(_[_0xb1fb('0x45')](_0x3d7639['result'])){_0x3d7639['result']='#';_0x30e4b5='#';}if(!this[_0xb1fb('0x86')](_0x37bd88['variable_id'])){this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x119'));}else{var _0x2edc81=this['getVariable'][_0xb1fb('0x71')](this,_0x37bd88[_0xb1fb('0xdc')]);if(!_0x2edc81){return this[_0xb1fb('0xd')]['error'](_0x37bd88,_0xb1fb('0xdd'));}this[_0xb1fb('0xd')]['setVariable'](_0x2edc81,_0x30e4b5);}this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x37bd88,_0x30e4b5);return _0x3d7639;};AGIVertices['prototype'][_0xb1fb('0xab')]=function(_0x233f84){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x166'),_0x233f84[_0xb1fb('0x38')]));return this[_0xb1fb('0xd')]['noop'](_0x233f84['output']||_0x233f84[_0xb1fb('0x38')]);};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x167')]=function(_0x4ded25){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x168'),_0x4ded25[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x4ded25[_0xb1fb('0x156')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x4ded25,'no\x20find\x20by\x20configured');}logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x157'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x4ded25[_0xb1fb('0x156')]));var _0x32dcb7=this[_0xb1fb('0x4e')][_0xb1fb('0x71')](this,_0x4ded25[_0xb1fb('0x169')]);var _0x32aa9b=this[_0xb1fb('0x16a')][_0xb1fb('0x71')](this,_0x4ded25[_0xb1fb('0x156')],_0x32dcb7);if(_0x32aa9b){logger['info'](util[_0xb1fb('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x4ded25[_0xb1fb('0x156')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x158'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x4ded25[_0xb1fb('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x15a'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x4ded25[_0xb1fb('0x156')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x4ded25[_0xb1fb('0x156')]));return{'code':0xc8,'result':_0xb1fb('0x15b')};}};AGIVertices[_0xb1fb('0x14')]['playback']=function(_0x26d828){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x16b'),_0x26d828[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x26d828[_0xb1fb('0x163')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x26d828,_0xb1fb('0x116'));}var _0xdb3ccb=this['getSound'][_0xb1fb('0x71')](this,_0x26d828[_0xb1fb('0x163')]);if(!_0xdb3ccb){return this['channel']['error'](_0x26d828,'no\x20file\x20audio\x20found');}var _0x1034fe=this['channel'][_0xb1fb('0x58')](_0xb1fb('0x16c'),[_0xdb3ccb,_0x26d828[_0xb1fb('0xe8')]]);if(_0x1034fe[_0xb1fb('0xa6')]===-0x1){return _0x1034fe;}return this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0xdb3ccb));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x16d')]=function(_0x4bee57){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4bee57['label']));if(!this[_0xb1fb('0x86')](_0x4bee57[_0xb1fb('0x16e')])){return this[_0xb1fb('0xd')]['error'](_0x4bee57,_0xb1fb('0x16f'));}var _0x1f4190='';var _0x12db79=parseInt(_0x4bee57[_0xb1fb('0x16e')],0xa);if(isNaN(_0x12db79)){_0x1f4190=_0x4bee57[_0xb1fb('0x16e')];}else{_0x1f4190=this[_0xb1fb('0x15')][_0xb1fb('0x71')](this,_0x4bee57[_0xb1fb('0x16e')]);if(!_0x1f4190){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x4bee57,_0xb1fb('0x170'));}}var _0x445e8b='';if(this[_0xb1fb('0x86')](_0x4bee57[_0xb1fb('0x163')])){var _0x5aedd2=this[_0xb1fb('0x117')]['sync'](this,_0x4bee57[_0xb1fb('0x163')]);if(_0x5aedd2){_0x445e8b=_0x5aedd2;}}this['createSquareDetailsReport'][_0xb1fb('0x71')](this,_0x4bee57,_0x1f4190);if(_0x4bee57[_0xb1fb('0xe8')][_0xb1fb('0x171')]('x')<0x0){_0x4bee57[_0xb1fb('0xe8')]+='x';}if(_0x4bee57[_0xb1fb('0xe8')][_0xb1fb('0x171')]('X')<0x0){_0x4bee57[_0xb1fb('0xe8')]+='X';}this[_0xb1fb('0xd')][_0xb1fb('0xa1')]('XMCS-QUEUE',_0x1f4190?_0x1f4190[_0xb1fb('0x172')]():'');var _0x5e4047=this[_0xb1fb('0xd')]['exec']('QUEUE',[_0x1f4190,_0x4bee57[_0xb1fb('0xe8')],_0x4bee57[_0xb1fb('0x64')],_0x445e8b,_0x4bee57[_0xb1fb('0x66')],_0x4bee57[_0xb1fb('0xb9')],_0x4bee57['macro'],_0x4bee57[_0xb1fb('0x173')],'',_0x4bee57[_0xb1fb('0x174')]]);if(_0x5e4047[_0xb1fb('0xa6')]===-0x1){return _0x5e4047;}return this['channel']['noop'](util[_0xb1fb('0x28')](_0xb1fb('0xc6'),_0xb1fb('0x175'),_0x1f4190));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x176')]=function(_0x4ccfe6){logger['info'](util['format'](_0xb1fb('0x177'),_0x4ccfe6[_0xb1fb('0x38')]));var _0x346b5d=_0x4ccfe6[_0xb1fb('0x178')]||'wav';var _0x27b494=util[_0xb1fb('0x28')](_0xb1fb('0x179'),this[_0xb1fb('0xd')][_0xb1fb('0x37')],rs[_0xb1fb('0x120')](0x5));var _0x2e5613=util[_0xb1fb('0x28')](_0xb1fb('0x17a'),FILES_PATH,_0x27b494,_0x346b5d);var _0x10e388=util[_0xb1fb('0x28')]('%s/recordings/%s',FILES_PATH,_0x27b494);this[_0xb1fb('0x3c')]['sync'](this,_0x4ccfe6,_0x27b494,_0x2e5613);this[_0xb1fb('0xd')][_0xb1fb('0xa1')]('RECORDING_SAVENAME',_0x27b494);logger[_0xb1fb('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x10e388,_0x346b5d,_0x4ccfe6[_0xb1fb('0x17b')],_0x4ccfe6[_0xb1fb('0x66')]);return this[_0xb1fb('0xd')]['recordFile'](_0x10e388,_0x346b5d,_0x4ccfe6[_0xb1fb('0x17b')],_0x4ccfe6[_0xb1fb('0x66')],undefined,!![]);};AGIVertices['prototype'][_0xb1fb('0x17c')]=function(_0x591157){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x591157[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x591157[_0xb1fb('0x64')])){return this['channel'][_0xb1fb('0xab')]('no\x20url\x20configured');}var _0x250490=this[_0xb1fb('0x63')][_0xb1fb('0x71')](this,_0x591157);logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Response:',util[_0xb1fb('0x17d')](_0x250490,{'showHidden':![],'depth':null})));if(!this[_0xb1fb('0x86')](_0x591157[_0xb1fb('0xdc')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x17e'));}var _0x2e5572=this[_0xb1fb('0x10')][_0xb1fb('0x71')](this,_0x591157[_0xb1fb('0xdc')]);if(!_0x2e5572){return this[_0xb1fb('0xd')]['error'](_0x591157,_0xb1fb('0xdd'));}this[_0xb1fb('0xd')][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0x17f'),_0x2e5572),_0x250490[_0xb1fb('0x75')]?_0x250490[_0xb1fb('0x75')]:_0xb1fb('0x180'));this['channel'][_0xb1fb('0xa1')](util[_0xb1fb('0x28')](_0xb1fb('0x181'),_0x2e5572),_0x250490[_0xb1fb('0x182')]?_0x250490['statusMessage']:'OK');if(_0x250490[_0xb1fb('0x6a')]){try{this[_0xb1fb('0x9f')](_0x250490[_0xb1fb('0x6a')],_0x2e5572);}catch(_0x26c1e9){logger[_0xb1fb('0x2a')](util[_0xb1fb('0x28')](_0xb1fb('0x183'),_0x2e5572));}}return this['channel']['noop'](util['format'](_0xb1fb('0xe2'),_0x2e5572));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x184')]=function(_0x416fd2){logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x185'),_0x416fd2['label']));return this[_0xb1fb('0xd')]['sayDigits'](_0x416fd2[_0xb1fb('0x186')][_0xb1fb('0x187')](/\s+/g,''),_0x416fd2[_0xb1fb('0x17b')]);};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x188')]=function(_0x2b9b13){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x189'),_0x2b9b13[_0xb1fb('0x38')]));return this[_0xb1fb('0xd')][_0xb1fb('0x18a')](_0x2b9b13[_0xb1fb('0x18b')][_0xb1fb('0x187')](/\s+/g,''),_0x2b9b13['escape_digits']);};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x18c')]=function(_0x520c32){logger['info'](util['format'](_0xb1fb('0x18d'),_0x520c32[_0xb1fb('0x38')]));return this['channel'][_0xb1fb('0x18e')](_0x520c32[_0xb1fb('0x5b')],_0x520c32[_0xb1fb('0x17b')]);};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x18f')]=function(_0x4e3f44){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x190'),_0x4e3f44[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x4e3f44[_0xb1fb('0x191')])){return this['channel']['noop'](_0xb1fb('0x192'));}var _0x500f11=this[_0xb1fb('0x193')][_0xb1fb('0x71')](this,_0x4e3f44['account_id']);if(!_0x500f11||!_0x500f11[_0xb1fb('0x194')]){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x4e3f44,_0xb1fb('0x195'));}var _0x40b980={'from':util[_0xb1fb('0x28')](_0xb1fb('0x196'),_0x500f11[_0xb1fb('0x12')],_0x500f11[_0xb1fb('0x197')]||_0x500f11[_0xb1fb('0x194')][_0xb1fb('0x198')]),'to':_0x4e3f44['to']||'','cc':_0x4e3f44['cc']||'','bcc':_0x4e3f44['bcc']||'','subject':_0x4e3f44[_0xb1fb('0x199')],'html':_0x4e3f44[_0xb1fb('0x5b')],'text':_0x4e3f44[_0xb1fb('0x5b')]};var _0x1878b7={'tls':{'rejectUnauthorized':![]}};if(_0x500f11[_0xb1fb('0x194')][_0xb1fb('0x19a')]){_0x1878b7[_0xb1fb('0x19a')]=_0x500f11['Smtp'][_0xb1fb('0x19a')];}else{_0x1878b7[_0xb1fb('0x19b')]=_0x500f11['Smtp'][_0xb1fb('0x19b')];_0x1878b7[_0xb1fb('0x19c')]=_0x500f11[_0xb1fb('0x194')][_0xb1fb('0x19c')];_0x1878b7['secure']=_0x500f11[_0xb1fb('0x194')][_0xb1fb('0x19d')];}if(_0x500f11[_0xb1fb('0x194')][_0xb1fb('0x19e')]){_0x1878b7[_0xb1fb('0x19f')]={'user':_0x500f11[_0xb1fb('0x194')]['user'],'pass':_0x500f11[_0xb1fb('0x194')][_0xb1fb('0x1a0')]};}if(this[_0xb1fb('0x86')](_0x4e3f44[_0xb1fb('0x1a1')])){}logger[_0xb1fb('0x1a2')](_0xb1fb('0x1a3'),JSON['stringify'](_0x40b980));this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x4e3f44,_0x4e3f44[_0xb1fb('0x191')]);this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x1a4'),_0x500f11[_0xb1fb('0x12')]));this[_0xb1fb('0x21')]['sync'](this,_0x1878b7,_0x40b980);return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x1a5'));};AGIVertices[_0xb1fb('0x14')]['sendFax']=function(_0x3619cf){logger['info'](util[_0xb1fb('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x3619cf[_0xb1fb('0x38')]));return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x1a6'));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x1a7')]=function(_0x56b349){logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x1a8'),_0x56b349['label']));if(!this[_0xb1fb('0x86')](_0x56b349[_0xb1fb('0x1a9')])){return this['channel'][_0xb1fb('0xab')](_0xb1fb('0x1aa'));}var _0x3e55f5=this[_0xb1fb('0x33')][_0xb1fb('0x71')](this,_0x56b349['sms_account_id']);if(!_0x3e55f5){return this['channel']['error'](_0x56b349,_0xb1fb('0x1ab'));}var _0x5162da={'body':_0x56b349[_0xb1fb('0x1ac')],'phone':_0x56b349['to']||'','SmsAccountId':_0x3e55f5['id']};logger[_0xb1fb('0x1a2')]('sendSMS\x20message',JSON['stringify'](_0x5162da));this[_0xb1fb('0x36')]['sync'](this,_0x56b349,_0x56b349[_0xb1fb('0x1a9')]);this['channel'][_0xb1fb('0xab')](util[_0xb1fb('0x28')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3e55f5[_0xb1fb('0x12')]));this[_0xb1fb('0x35')]['sync'](this,_0x5162da);return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x1ad'));};AGIVertices['prototype'][_0xb1fb('0x1ae')]=function(_0x8554df){logger['info'](util['format'](_0xb1fb('0x1af'),_0x8554df['label']));if(!this[_0xb1fb('0x86')](_0x8554df[_0xb1fb('0xdc')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x8554df,_0xb1fb('0x1b0'));}var _0x544cf3=this['getVariable'][_0xb1fb('0x71')](this,_0x8554df['variable_id']);if(!_0x544cf3){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x8554df,'no\x20variable\x20found');}return this['channel'][_0xb1fb('0xa1')](_0x544cf3,_0x8554df[_0xb1fb('0x1b1')]);};AGIVertices['prototype']['start']=function(_0x5ce467){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20START\x20(%s)\x20block',_0x5ce467[_0xb1fb('0x38')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0x1b2'));if(_0x5ce467[_0xb1fb('0xbc')]===_0xb1fb('0x1b3')){this[_0xb1fb('0xd')][_0xb1fb('0xab')]('Answer');return this['channel'][_0xb1fb('0xbc')]();}return this['channel'][_0xb1fb('0xab')](_0xb1fb('0x1b4'));};AGIVertices['prototype'][_0xb1fb('0x1b5')]=function(_0x46cd6b){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x1b6'),_0x46cd6b[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x46cd6b[_0xb1fb('0x1b7')])){return this[_0xb1fb('0xd')]['error'](_0x46cd6b,_0xb1fb('0x1b8'));}var _0x505749=this[_0xb1fb('0x17')][_0xb1fb('0x71')](this,_0x46cd6b['project_id']);if(!this['isConfigured'](_0x505749)){return this['channel'][_0xb1fb('0x2a')](_0x46cd6b,util[_0xb1fb('0x28')](_0xb1fb('0x1b9'),_0x46cd6b[_0xb1fb('0x1b7')]));}if(_0x505749===this[_0xb1fb('0xd')][_0xb1fb('0x3a')]){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x46cd6b,_0xb1fb('0x1ba'));}this['createSquareDetailsReport'][_0xb1fb('0x71')](this,_0x46cd6b,_0x505749);var _0x422658=this[_0xb1fb('0xd')]['exec'](_0xb1fb('0x1bb'),util[_0xb1fb('0x28')](_0xb1fb('0x1bc'),config[_0xb1fb('0xb9')][_0xb1fb('0x19b')]||_0xb1fb('0x1bd'),_0x505749,this[_0xb1fb('0xd')][_0xb1fb('0x3a')]));if(_0x422658[_0xb1fb('0xa6')]===-0x1){return _0x422658;}return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xc6'),_0xb1fb('0x1bb'),_0x505749));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x1be')]=function(_0x15f0d1){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x15f0d1[_0xb1fb('0x38')]));var _0x2246f7=this[_0xb1fb('0x57')][_0xb1fb('0x71')](this,_0x15f0d1[_0xb1fb('0xba')]);this[_0xb1fb('0x36')][_0xb1fb('0x71')](this,_0x15f0d1,_0x15f0d1['command']);if(this[_0xb1fb('0x86')](_0x15f0d1[_0xb1fb('0xdc')])){var _0xb4744c=this[_0xb1fb('0x10')][_0xb1fb('0x71')](this,_0x15f0d1[_0xb1fb('0xdc')]);if(_0xb4744c){this[_0xb1fb('0xd')]['setVariable'](_0xb4744c,_0x2246f7);return this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x1bf'),_0x15f0d1[_0xb1fb('0xba')],_0xb4744c));}}return this['channel'][_0xb1fb('0xab')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x15f0d1[_0xb1fb('0xba')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x448b91){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x1c0'),_0x448b91[_0xb1fb('0x38')]));_0x448b91[_0xb1fb('0x5b')]=_0x448b91[_0xb1fb('0x5b')][_0xb1fb('0x187')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x448b91['apiKey'])){return this['channel']['noop'](_0xb1fb('0x1c1'));}if(!this[_0xb1fb('0x86')](_0x448b91[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xc9'));}this['channel'][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x1c2'),_0x448b91['text']));var _0x10a7ca=this['googleCloudTTS'][_0xb1fb('0x71')](this,_0x448b91);if(_0x10a7ca){this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format'](_0xb1fb('0x1c3'),_0x10a7ca));var _0x536695=this[_0xb1fb('0xd')][_0xb1fb('0x108')](_0x10a7ca);try{fs[_0xb1fb('0x129')](_0x10a7ca+_0xb1fb('0x109'));}catch(_0x3e60dc){logger[_0xb1fb('0x2a')](_0x3e60dc);}return _0x536695;}return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x448b91,_0xb1fb('0x1c4'));};AGIVertices['prototype'][_0xb1fb('0x1c5')]=function(_0x2f5911){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2f5911[_0xb1fb('0x38')]));_0x2f5911[_0xb1fb('0x5b')]=_0x2f5911[_0xb1fb('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2f5911[_0xb1fb('0x5b')])){return this[_0xb1fb('0xd')][_0xb1fb('0xab')](_0xb1fb('0xc9'));}this[_0xb1fb('0xd')]['noop'](util[_0xb1fb('0x28')](_0xb1fb('0x1c6'),_0x2f5911[_0xb1fb('0x5b')]));var _0x177818=this[_0xb1fb('0x61')][_0xb1fb('0x71')](this,_0x2f5911);if(_0x177818){this['channel'][_0xb1fb('0xab')](util['format'](_0xb1fb('0x1c7'),_0x177818));var _0x3a18e8=this[_0xb1fb('0xd')][_0xb1fb('0x108')](_0x177818);try{fs[_0xb1fb('0x129')](_0x177818+_0xb1fb('0x109'));}catch(_0x80faa6){logger[_0xb1fb('0x2a')](_0x80faa6);}return _0x3a18e8;}return this['channel']['error'](_0x2f5911,_0xb1fb('0x1c8'));};AGIVertices['prototype'][_0xb1fb('0x1c9')]=function(_0x5be3f5){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x1ca'),_0x5be3f5[_0xb1fb('0x38')]));if(!this[_0xb1fb('0x86')](_0x5be3f5[_0xb1fb('0x156')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x5be3f5,_0xb1fb('0x15c'));}logger[_0xb1fb('0x2c')](util['format'](_0xb1fb('0x157'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x5be3f5[_0xb1fb('0x156')]));var _0x1b474c=this[_0xb1fb('0x51')][_0xb1fb('0x71')](this,_0x5be3f5[_0xb1fb('0x156')]);if(_0x1b474c){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb1fb('0x3b')],_0x5be3f5[_0xb1fb('0x156')]));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x5be3f5[_0xb1fb('0x156')]));return{'code':0xc8,'result':_0xb1fb('0x159')};}else{logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x15a'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x5be3f5['findBy']));this[_0xb1fb('0xd')][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0x15a'),this[_0xb1fb('0xd')][_0xb1fb('0x3b')],_0x5be3f5[_0xb1fb('0x156')]));return{'code':0xc8,'result':_0xb1fb('0x15b')};}};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x1cb')]=function(_0x564051){logger[_0xb1fb('0x2c')](util[_0xb1fb('0x28')](_0xb1fb('0x1cc'),_0x564051[_0xb1fb('0x38')]));var _0x40b3a2=this[_0xb1fb('0xd')][_0xb1fb('0x58')]('VOICEMAIL',[_0x564051[_0xb1fb('0x1cd')],_0x564051['options']]);if(_0x40b3a2[_0xb1fb('0xa6')]===-0x1){return _0x40b3a2;}return this['channel'][_0xb1fb('0xab')](util[_0xb1fb('0x28')](_0xb1fb('0xc6'),'VOICEMAIL',_0x564051[_0xb1fb('0x1cd')]));};AGIVertices[_0xb1fb('0x14')][_0xb1fb('0x1ce')]=function(_0x14de6a){logger['info'](util[_0xb1fb('0x28')](_0xb1fb('0x1cf'),_0x14de6a[_0xb1fb('0x38')]));if(!this['isConfigured'](_0x14de6a[_0xb1fb('0xdc')])){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x14de6a,_0xb1fb('0x1b0'));}var _0x35e939=this[_0xb1fb('0x10')][_0xb1fb('0x71')](this,_0x14de6a[_0xb1fb('0xdc')]);if(!_0x35e939){return this[_0xb1fb('0xd')][_0xb1fb('0x2a')](_0x14de6a,_0xb1fb('0xdd'));}var _0xaca93a=this[_0xb1fb('0xd')]['getVariable'](_0x35e939);return{'code':0xc8,'result':_0xaca93a['extra']?_0xaca93a[_0xb1fb('0xa4')]:'-'};};String[_0xb1fb('0x14')]['replaceAll']=function(_0xfc0a69,_0x127d74){return this[_0xb1fb('0xa2')](_0xfc0a69)[_0xb1fb('0x1d0')](_0x127d74);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b0ff92a..a5533bb 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 _0x5e1d=['[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','channels','bind','hanguprequest','syncHangup','agentringnoanswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDispositionPause','name','QueuePause','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid'];(function(_0x2724d5,_0x3a55cf){var _0x544dc6=function(_0x4a48ee){while(--_0x4a48ee){_0x2724d5['push'](_0x2724d5['shift']());}};_0x544dc6(++_0x3a55cf);}(_0x5e1d,0x1ab));var _0xd5e1=function(_0x431bd7,_0x47fdf6){_0x431bd7=_0x431bd7-0x0;var _0x356280=_0x5e1d[_0x431bd7];return _0x356280;};'use strict';var util=require('util');var _=require(_0xd5e1('0x0'));var moment=require('moment');var ami=require(_0xd5e1('0x1'));var logger=require(_0xd5e1('0x2'))(_0xd5e1('0x3'));var RpcUser=require(_0xd5e1('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5e0d7a){this['voiceQueues']=_0x5e0d7a[_0xd5e1('0x5')];this['agents']=_0x5e0d7a[_0xd5e1('0x6')];this['timers']=_0x5e0d7a['timers'];this[_0xd5e1('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xd5e1('0x8')](this));ami['on'](_0xd5e1('0x9'),this['syncHangupRequest'][_0xd5e1('0x8')](this));ami['on']('hangup',this[_0xd5e1('0xa')][_0xd5e1('0x8')](this));ami['on'](_0xd5e1('0xb'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xd5e1('0xc'),this['syncAttendedTransfer'][_0xd5e1('0x8')](this));ami['on']('blindtransfer',this[_0xd5e1('0xd')][_0xd5e1('0x8')](this));ami['on'](_0xd5e1('0xe'),this[_0xd5e1('0xf')][_0xd5e1('0x8')](this));}function getDiff(_0x1a188f){var _0x4461bd=moment()[_0xd5e1('0x10')](0x0);var _0x6dfdec=moment(_0x1a188f)[_0xd5e1('0x10')](0x0);return _0x4461bd['diff'](_0x6dfdec,_0xd5e1('0x11'));}Acw[_0xd5e1('0x12')][_0xd5e1('0x13')]=function(_0x13d353){try{var _0x15da12=this;var _0x49fe64=this[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x14')];var _0x1cd7b4=this[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x15')];var _0x4e9c0d=this['voiceQueues'][_0x1cd7b4];var _0x307d35=![];var _0x34ae29=_0xd5e1('0x16');if(_0x4e9c0d['mandatoryDisposition']){if(_0x4e9c0d[_0xd5e1('0x17')][_0xd5e1('0x18')]){_0x307d35=!![];_0x34ae29=_0x4e9c0d['mandatoryDispositionPause']['name'];}}ami['Action']({'action':_0xd5e1('0x19'),'interface':_0x49fe64,'paused':!![],'reason':_0x34ae29})[_0xd5e1('0x1a')](function(_0x36cd9c){if(_0x15da12['agents'][_0x49fe64]){return RpcUser['getAgent'](_0x15da12[_0xd5e1('0x6')][_0x49fe64]['id'])[_0xd5e1('0x1a')](function(_0x37bb54){if(_0x37bb54&&!_0x37bb54[_0xd5e1('0x1b')]){logger['info'](_0xd5e1('0x1c'),_0x13d353,_0x49fe64,_0x1cd7b4);var _0x2aaf4=_0x15da12[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x1d')]&&_0x15da12[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x1e')]?_0x15da12[_0xd5e1('0x7')][_0x13d353][_0xd5e1('0x1e')]:_0x13d353;return RpcUser['savePause'](_0x15da12['agents'][_0x49fe64],_0x34ae29,_0x2aaf4)['then'](function(_0x32db6f){if(!_0x307d35){_0x15da12[_0xd5e1('0x1f')][_0x49fe64]={};logger['info'](_0xd5e1('0x20'),_0x13d353,_0x15da12[_0xd5e1('0x5')][_0x1cd7b4][_0xd5e1('0x21')],_0x49fe64,_0x1cd7b4);_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x22')]=setTimeout(_0x15da12[_0xd5e1('0x23')][_0xd5e1('0x8')](_0x15da12,_0x49fe64),_0x15da12[_0xd5e1('0x5')][_0x1cd7b4][_0xd5e1('0x21')]*0x3e8);_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x24')]=moment()[_0xd5e1('0x25')](_0xd5e1('0x26'));_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x27')]=_0x13d353;_0x15da12[_0xd5e1('0x1f')][_0x49fe64]['queue']=_0x1cd7b4;_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x28')]=function(){var _0x2d4a92=getDiff(_0x15da12['timers'][_0x49fe64][_0xd5e1('0x24')]);clearTimeout(_0x15da12[_0xd5e1('0x1f')][_0x49fe64]['timer']);_0x15da12[_0xd5e1('0x1f')][_0x49fe64][_0xd5e1('0x22')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2d4a92},_0x15da12['timers'][_0x49fe64][_0xd5e1('0x27')],_0x49fe64)[_0xd5e1('0x1a')](function(_0x51bb0f){logger['info'](_0xd5e1('0x29'),_0x13d353,_0x2d4a92,_0x51bb0f);})[_0xd5e1('0x2a')](function(_0x320385){logger['error'](_0xd5e1('0x2b'),_0x13d353,_0x320385);});delete _0x15da12[_0xd5e1('0x1f')][_0x49fe64];};}});}else{logger[_0xd5e1('0x2c')](_0xd5e1('0x2d'),_0x13d353,_0x49fe64,_0x1cd7b4);}});}})[_0xd5e1('0x2a')](function(_0x11f1f1){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x13d353,_0x15da12[_0xd5e1('0x5')][_0x1cd7b4][_0xd5e1('0x21')],_0x49fe64,_0x1cd7b4);})[_0xd5e1('0x2e')](function(){delete _0x15da12['channels'][_0x13d353];});}catch(_0x32984e){logger[_0xd5e1('0x2f')](_0xd5e1('0x30'),_0x32984e['message']);}};Acw[_0xd5e1('0x12')][_0xd5e1('0x23')]=function(_0x599e82){try{var _0x52feae=this;if(_0x52feae[_0xd5e1('0x1f')][_0x599e82]){_0x52feae[_0xd5e1('0x1f')][_0x599e82]['timer']=![];var _0x1e07be=_0x52feae[_0xd5e1('0x1f')][_0x599e82][_0xd5e1('0x27')];var _0x23b789=_0x52feae['timers'][_0x599e82]['queue'];var _0x544c00=_0x52feae[_0xd5e1('0x5')][_0x23b789][_0xd5e1('0x21')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x1e07be,_0x599e82);RpcUser[_0xd5e1('0x31')](this[_0xd5e1('0x6')][_0x599e82]);RpcVoiceAgentReport['update']({'acwtime':_0x544c00,'agentacw':!![]},_0x1e07be,_0x599e82)[_0xd5e1('0x1a')](function(_0x3e6fe8){logger[_0xd5e1('0x2c')](_0xd5e1('0x29'),_0x1e07be,_0x544c00,_0x3e6fe8);})[_0xd5e1('0x2a')](function(_0x1d469d){logger[_0xd5e1('0x2f')](_0xd5e1('0x2b'),_0x1e07be,_0x1d469d);});}else{logger[_0xd5e1('0x2f')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x599e82);if(_0x52feae['timers']){logger['info'](_0xd5e1('0x32'),JSON[_0xd5e1('0x33')](_0x52feae[_0xd5e1('0x1f')]));}}}catch(_0x3a590e){logger[_0xd5e1('0x2f')](_0xd5e1('0x34'),_0x3a590e[_0xd5e1('0x35')]);}};Acw[_0xd5e1('0x12')][_0xd5e1('0x36')]=function(_0x27bd64){try{if(this[_0xd5e1('0x5')][_0x27bd64[_0xd5e1('0x15')]]&&(this[_0xd5e1('0x5')][_0x27bd64[_0xd5e1('0x15')]][_0xd5e1('0x3')]||this[_0xd5e1('0x5')][_0x27bd64[_0xd5e1('0x15')]]['mandatoryDisposition'])){if(this[_0xd5e1('0x6')][_0x27bd64[_0xd5e1('0x14')]]){this[_0xd5e1('0x7')][_0x27bd64[_0xd5e1('0x27')]]={'queue':_0x27bd64[_0xd5e1('0x15')],'interface':_0x27bd64['interface'],'destlinkedid':_0x27bd64[_0xd5e1('0x1e')]};}}}catch(_0x308ae1){logger['error'](_0xd5e1('0x37'),_0x308ae1[_0xd5e1('0x35')]);}};Acw[_0xd5e1('0x12')][_0xd5e1('0xf')]=function(_0x1f54f1){try{if(this['voiceQueues'][_0x1f54f1[_0xd5e1('0x15')]]&&(this[_0xd5e1('0x5')][_0x1f54f1[_0xd5e1('0x15')]]['acw']||this[_0xd5e1('0x5')][_0x1f54f1[_0xd5e1('0x15')]][_0xd5e1('0x38')])){if(this[_0xd5e1('0x6')][_0x1f54f1[_0xd5e1('0x14')]]){this[_0xd5e1('0x7')][_0x1f54f1['uniqueid']]={'queue':_0x1f54f1['queue'],'interface':_0x1f54f1['interface']};}}}catch(_0x552c48){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x552c48[_0xd5e1('0x35')]);}};Acw['prototype'][_0xd5e1('0x39')]=function(_0x109bd9){try{if(this[_0xd5e1('0x7')][_0x109bd9['uniqueid']]&&_[_0xd5e1('0x3a')](this['channels'][_0x109bd9['uniqueid']][_0xd5e1('0x1d')])){logger[_0xd5e1('0x2c')](_0xd5e1('0x3b'),_0x109bd9[_0xd5e1('0x27')]);this[_0xd5e1('0x13')](_0x109bd9[_0xd5e1('0x27')]);}else if(this[_0xd5e1('0x7')][_0x109bd9['linkedid']]&&_[_0xd5e1('0x3a')](this[_0xd5e1('0x7')][_0x109bd9[_0xd5e1('0x3c')]][_0xd5e1('0x1d')])){logger[_0xd5e1('0x2c')](_0xd5e1('0x3d'),_0x109bd9[_0xd5e1('0x3c')]);this[_0xd5e1('0x13')](_0x109bd9[_0xd5e1('0x3c')]);}}catch(_0x426a94){logger['error'](_0xd5e1('0x3e'),_0x426a94[_0xd5e1('0x35')]);}};Acw[_0xd5e1('0x12')]['syncHangup']=function(_0x556ff8){try{if(this['channels'][_0x556ff8[_0xd5e1('0x27')]]&&this[_0xd5e1('0x7')][_0x556ff8[_0xd5e1('0x27')]][_0xd5e1('0x1d')]){logger[_0xd5e1('0x2c')](_0xd5e1('0x3f'),_0x556ff8[_0xd5e1('0x27')]);this['startAcw'](_0x556ff8[_0xd5e1('0x27')]);}else if(this[_0xd5e1('0x7')][_0x556ff8['linkedid']]&&this[_0xd5e1('0x7')][_0x556ff8[_0xd5e1('0x3c')]][_0xd5e1('0x1d')]){logger[_0xd5e1('0x2c')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x556ff8['linkedid']);this[_0xd5e1('0x13')](_0x556ff8[_0xd5e1('0x3c')]);}}catch(_0xa09b76){logger[_0xd5e1('0x2f')](_0xd5e1('0x40'),_0xa09b76['message']);}};Acw['prototype'][_0xd5e1('0x41')]=function(_0xea756c){try{if(!_['isNil'](this['channels'][_0xea756c[_0xd5e1('0x42')]])){this['startAcw'](_0xea756c[_0xd5e1('0x42')]);if(this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x43')]]){this[_0xd5e1('0x7')][_0xea756c['secondtransfereruniqueid']]['attended']=!![];this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x44')]]=this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x43')]];delete this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x43')]];}}else if(!_[_0xd5e1('0x45')](this['channels'][_0xea756c[_0xd5e1('0x44')]])){this[_0xd5e1('0x13')](_0xea756c[_0xd5e1('0x44')]);if(this['channels'][_0xea756c[_0xd5e1('0x46')]]){this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x46')]][_0xd5e1('0x1d')]=!![];this['channels'][_0xea756c[_0xd5e1('0x42')]]=this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x46')]];delete this[_0xd5e1('0x7')][_0xea756c[_0xd5e1('0x46')]];}}}catch(_0x1a92b5){logger['error'](_0xd5e1('0x47'),_0x1a92b5['message']);}};Acw[_0xd5e1('0x12')][_0xd5e1('0xd')]=function(_0x1ce65f){try{if(this[_0xd5e1('0x7')][_0x1ce65f[_0xd5e1('0x48')]]){logger[_0xd5e1('0x2c')](_0xd5e1('0x49'),JSON['stringify'](_0x1ce65f[_0xd5e1('0x48')]));this['startAcw'](_0x1ce65f[_0xd5e1('0x48')]);}else if(this[_0xd5e1('0x7')][_0x1ce65f[_0xd5e1('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xd5e1('0x33')](_0x1ce65f['transfererlinkedid']));this['startAcw'](_0x1ce65f[_0xd5e1('0x4a')]);}}catch(_0x169220){logger['error'](_0xd5e1('0x4b'),_0x169220['message']);}};Acw[_0xd5e1('0x12')][_0xd5e1('0x4c')]=function(_0x30cbc2){try{if(this['voiceQueues'][_0x30cbc2[_0xd5e1('0x15')]]&&this[_0xd5e1('0x5')][_0x30cbc2[_0xd5e1('0x15')]][_0xd5e1('0x4d')]===_0xd5e1('0x4e')){if(this[_0xd5e1('0x6')][_0x30cbc2['interface']]){logger[_0xd5e1('0x2c')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x30cbc2['uniqueid'],_0x30cbc2[_0xd5e1('0x14')],_0x30cbc2[_0xd5e1('0x15')]);return RpcUser[_0xd5e1('0x4f')](this['agents'][_0x30cbc2[_0xd5e1('0x14')]],_0xd5e1('0x50'),_0x30cbc2[_0xd5e1('0x27')]);}}}catch(_0x34bf62){logger['error'](_0xd5e1('0x51'),_0x34bf62[_0xd5e1('0x35')]);}};module[_0xd5e1('0x52')]=Acw; \ No newline at end of file +var _0x4485=['syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','startAcw','interface','queue','voiceQueues','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','timers','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','agents','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x56ac86,_0x333ce3){var _0x214990=function(_0x2125b2){while(--_0x2125b2){_0x56ac86['push'](_0x56ac86['shift']());}};_0x214990(++_0x333ce3);}(_0x4485,0x15d));var _0x5448=function(_0x2d9da8,_0x5d5072){_0x2d9da8=_0x2d9da8-0x0;var _0x57a29c=_0x4485[_0x2d9da8];return _0x57a29c;};'use strict';var util=require('util');var _=require(_0x5448('0x0'));var moment=require(_0x5448('0x1'));var ami=require(_0x5448('0x2'));var logger=require(_0x5448('0x3'))(_0x5448('0x4'));var RpcUser=require(_0x5448('0x5'));var RpcVoiceAgentReport=require(_0x5448('0x6'));function Acw(_0x4f966e){this['voiceQueues']=_0x4f966e['voiceQueues'];this[_0x5448('0x7')]=_0x4f966e[_0x5448('0x7')];this['timers']=_0x4f966e['timers'];this[_0x5448('0x8')]={};ami['on'](_0x5448('0x9'),this[_0x5448('0xa')][_0x5448('0xb')](this));ami['on'](_0x5448('0xc'),this[_0x5448('0xd')][_0x5448('0xb')](this));ami['on'](_0x5448('0xe'),this[_0x5448('0xf')][_0x5448('0xb')](this));ami['on'](_0x5448('0x10'),this[_0x5448('0x11')][_0x5448('0xb')](this));ami['on'](_0x5448('0x12'),this[_0x5448('0x13')][_0x5448('0xb')](this));ami['on'](_0x5448('0x14'),this[_0x5448('0x15')]['bind'](this));ami['on'](_0x5448('0x16'),this[_0x5448('0x17')][_0x5448('0xb')](this));}function getDiff(_0x1a33fb){var _0x27e6c8=moment()['milliseconds'](0x0);var _0x3ee5a8=moment(_0x1a33fb)[_0x5448('0x18')](0x0);return _0x27e6c8['diff'](_0x3ee5a8,_0x5448('0x19'));}Acw['prototype'][_0x5448('0x1a')]=function(_0x130463){try{var _0x49ee8d=this;var _0x29339e=this[_0x5448('0x8')][_0x130463][_0x5448('0x1b')];var _0x11dbdc=this[_0x5448('0x8')][_0x130463][_0x5448('0x1c')];var _0x1dc4ec=this[_0x5448('0x1d')][_0x11dbdc];var _0x210764=![];var _0x272f7b='ACW';if(_0x1dc4ec[_0x5448('0x1e')]){if(_0x1dc4ec[_0x5448('0x1f')][_0x5448('0x20')]){_0x210764=!![];_0x272f7b=_0x1dc4ec[_0x5448('0x1f')][_0x5448('0x20')];}}ami[_0x5448('0x21')]({'action':_0x5448('0x22'),'interface':_0x29339e,'paused':!![],'reason':_0x272f7b})[_0x5448('0x23')](function(_0x4fdf19){if(_0x49ee8d[_0x5448('0x7')][_0x29339e]){return RpcUser[_0x5448('0x24')](_0x49ee8d[_0x5448('0x7')][_0x29339e]['id'])[_0x5448('0x23')](function(_0x92968e){if(_0x92968e&&!_0x92968e[_0x5448('0x25')]){logger['info'](_0x5448('0x26'),_0x130463,_0x29339e,_0x11dbdc);var _0x9cd8ef=_0x49ee8d['channels'][_0x130463][_0x5448('0x27')]&&_0x49ee8d[_0x5448('0x8')][_0x130463][_0x5448('0x28')]?_0x49ee8d[_0x5448('0x8')][_0x130463][_0x5448('0x28')]:_0x130463;return RpcUser['savePause'](_0x49ee8d[_0x5448('0x7')][_0x29339e],_0x272f7b,_0x9cd8ef)[_0x5448('0x23')](function(_0x25c603){if(!_0x210764){_0x49ee8d[_0x5448('0x29')][_0x29339e]={};logger[_0x5448('0x2a')](_0x5448('0x2b'),_0x130463,_0x49ee8d[_0x5448('0x1d')][_0x11dbdc][_0x5448('0x2c')],_0x29339e,_0x11dbdc);_0x49ee8d[_0x5448('0x29')][_0x29339e][_0x5448('0x2d')]=setTimeout(_0x49ee8d['stopAcw'][_0x5448('0xb')](_0x49ee8d,_0x29339e),_0x49ee8d[_0x5448('0x1d')][_0x11dbdc]['acwTimeout']*0x3e8);_0x49ee8d[_0x5448('0x29')][_0x29339e]['lastPauseAt']=moment()[_0x5448('0x2e')](_0x5448('0x2f'));_0x49ee8d[_0x5448('0x29')][_0x29339e][_0x5448('0x30')]=_0x130463;_0x49ee8d[_0x5448('0x29')][_0x29339e]['queue']=_0x11dbdc;_0x49ee8d['timers'][_0x29339e][_0x5448('0x31')]=function(){var _0x3e6c36=getDiff(_0x49ee8d['timers'][_0x29339e][_0x5448('0x32')]);clearTimeout(_0x49ee8d[_0x5448('0x29')][_0x29339e][_0x5448('0x2d')]);_0x49ee8d[_0x5448('0x29')][_0x29339e][_0x5448('0x2d')]=![];RpcVoiceAgentReport[_0x5448('0x33')]({'acwtime':_0x3e6c36},_0x49ee8d['timers'][_0x29339e][_0x5448('0x30')],_0x29339e)[_0x5448('0x23')](function(_0x15fe42){logger[_0x5448('0x2a')](_0x5448('0x34'),_0x130463,_0x3e6c36,_0x15fe42);})[_0x5448('0x35')](function(_0xc68ff4){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x130463,_0xc68ff4);});delete _0x49ee8d[_0x5448('0x29')][_0x29339e];};}});}else{logger[_0x5448('0x2a')](_0x5448('0x36'),_0x130463,_0x29339e,_0x11dbdc);}});}})[_0x5448('0x35')](function(_0x1f73c7){logger[_0x5448('0x37')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x130463,_0x49ee8d[_0x5448('0x1d')][_0x11dbdc]['acwTimeout'],_0x29339e,_0x11dbdc);})[_0x5448('0x38')](function(){delete _0x49ee8d[_0x5448('0x8')][_0x130463];});}catch(_0x31a0ee){logger['error'](_0x5448('0x39'),_0x31a0ee[_0x5448('0x3a')]);}};Acw['prototype']['stopAcw']=function(_0x66e978){try{var _0x12ca35=this;if(_0x12ca35[_0x5448('0x29')][_0x66e978]){_0x12ca35[_0x5448('0x29')][_0x66e978][_0x5448('0x2d')]=![];var _0x250129=_0x12ca35[_0x5448('0x29')][_0x66e978][_0x5448('0x30')];var _0xb15c67=_0x12ca35[_0x5448('0x29')][_0x66e978][_0x5448('0x1c')];var _0x490010=_0x12ca35[_0x5448('0x1d')][_0xb15c67][_0x5448('0x2c')];logger[_0x5448('0x2a')](_0x5448('0x3b'),_0x250129,_0x66e978);RpcUser[_0x5448('0x3c')](this[_0x5448('0x7')][_0x66e978]);RpcVoiceAgentReport[_0x5448('0x33')]({'acwtime':_0x490010,'agentacw':!![]},_0x250129,_0x66e978)['then'](function(_0x405389){logger[_0x5448('0x2a')](_0x5448('0x34'),_0x250129,_0x490010,_0x405389);})[_0x5448('0x35')](function(_0x2ace53){logger[_0x5448('0x37')](_0x5448('0x3d'),_0x250129,_0x2ace53);});}else{logger['error'](_0x5448('0x3e'),_0x66e978);if(_0x12ca35[_0x5448('0x29')]){logger[_0x5448('0x2a')](_0x5448('0x3f'),JSON['stringify'](_0x12ca35[_0x5448('0x29')]));}}}catch(_0x54e6c7){logger[_0x5448('0x37')](_0x5448('0x40'),_0x54e6c7[_0x5448('0x3a')]);}};Acw[_0x5448('0x41')]['syncAgentConnect']=function(_0x3c703a){try{if(this[_0x5448('0x1d')][_0x3c703a[_0x5448('0x1c')]]&&(this['voiceQueues'][_0x3c703a[_0x5448('0x1c')]][_0x5448('0x4')]||this[_0x5448('0x1d')][_0x3c703a[_0x5448('0x1c')]][_0x5448('0x1e')])){if(this[_0x5448('0x7')][_0x3c703a[_0x5448('0x1b')]]){this[_0x5448('0x8')][_0x3c703a[_0x5448('0x30')]]={'queue':_0x3c703a[_0x5448('0x1c')],'interface':_0x3c703a[_0x5448('0x1b')],'destlinkedid':_0x3c703a[_0x5448('0x28')]};}}}catch(_0x36b9ef){logger['error'](_0x5448('0x42'),_0x36b9ef[_0x5448('0x3a')]);}};Acw[_0x5448('0x41')][_0x5448('0x17')]=function(_0x55f020){try{if(this[_0x5448('0x1d')][_0x55f020[_0x5448('0x1c')]]&&(this[_0x5448('0x1d')][_0x55f020[_0x5448('0x1c')]]['acw']||this[_0x5448('0x1d')][_0x55f020['queue']][_0x5448('0x1e')])){if(this['agents'][_0x55f020[_0x5448('0x1b')]]){this[_0x5448('0x8')][_0x55f020[_0x5448('0x30')]]={'queue':_0x55f020['queue'],'interface':_0x55f020[_0x5448('0x1b')]};}}}catch(_0x1ac3d0){logger['error'](_0x5448('0x43'),_0x1ac3d0['message']);}};Acw[_0x5448('0x41')][_0x5448('0xd')]=function(_0x3e3e50){try{if(this[_0x5448('0x8')][_0x3e3e50[_0x5448('0x30')]]&&_['isUndefined'](this[_0x5448('0x8')][_0x3e3e50['uniqueid']][_0x5448('0x27')])){logger[_0x5448('0x2a')]('[%s][HANGUP:UNIQUEID]',_0x3e3e50[_0x5448('0x30')]);this[_0x5448('0x1a')](_0x3e3e50[_0x5448('0x30')]);}else if(this[_0x5448('0x8')][_0x3e3e50['linkedid']]&&_[_0x5448('0x44')](this[_0x5448('0x8')][_0x3e3e50['linkedid']][_0x5448('0x27')])){logger[_0x5448('0x2a')](_0x5448('0x45'),_0x3e3e50[_0x5448('0x46')]);this[_0x5448('0x1a')](_0x3e3e50[_0x5448('0x46')]);}}catch(_0x33f778){logger[_0x5448('0x37')](_0x5448('0x47'),_0x33f778[_0x5448('0x3a')]);}};Acw[_0x5448('0x41')]['syncHangup']=function(_0x4a3670){try{if(this[_0x5448('0x8')][_0x4a3670[_0x5448('0x30')]]&&this['channels'][_0x4a3670[_0x5448('0x30')]][_0x5448('0x27')]){logger['info'](_0x5448('0x48'),_0x4a3670['uniqueid']);this[_0x5448('0x1a')](_0x4a3670[_0x5448('0x30')]);}else if(this['channels'][_0x4a3670[_0x5448('0x46')]]&&this['channels'][_0x4a3670[_0x5448('0x46')]][_0x5448('0x27')]){logger[_0x5448('0x2a')](_0x5448('0x49'),_0x4a3670[_0x5448('0x46')]);this[_0x5448('0x1a')](_0x4a3670[_0x5448('0x46')]);}}catch(_0x352d0e){logger[_0x5448('0x37')]('[ACW][syncHangup]\x20%s',_0x352d0e[_0x5448('0x3a')]);}};Acw['prototype'][_0x5448('0x13')]=function(_0x29b6cb){try{if(!_[_0x5448('0x4a')](this[_0x5448('0x8')][_0x29b6cb['transfereeuniqueid']])){this[_0x5448('0x1a')](_0x29b6cb[_0x5448('0x4b')]);if(this['channels'][_0x29b6cb[_0x5448('0x4c')]]){this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4c')]]['attended']=!![];this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4d')]]=this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4c')]];delete this[_0x5448('0x8')][_0x29b6cb['secondtransfereruniqueid']];}}else if(!_[_0x5448('0x4a')](this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4d')]])){this['startAcw'](_0x29b6cb['transfertargetuniqueid']);if(this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4e')]]){this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4e')]][_0x5448('0x27')]=!![];this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4b')]]=this[_0x5448('0x8')][_0x29b6cb[_0x5448('0x4e')]];delete this[_0x5448('0x8')][_0x29b6cb['origtransfereruniqueid']];}}}catch(_0x4fd86c){logger['error'](_0x5448('0x4f'),_0x4fd86c[_0x5448('0x3a')]);}};Acw['prototype'][_0x5448('0x15')]=function(_0x274056){try{if(this[_0x5448('0x8')][_0x274056[_0x5448('0x50')]]){logger[_0x5448('0x2a')](_0x5448('0x51'),JSON[_0x5448('0x52')](_0x274056[_0x5448('0x50')]));this[_0x5448('0x1a')](_0x274056[_0x5448('0x50')]);}else if(this['channels'][_0x274056[_0x5448('0x53')]]){logger[_0x5448('0x2a')](_0x5448('0x54'),JSON[_0x5448('0x52')](_0x274056[_0x5448('0x53')]));this['startAcw'](_0x274056['transfererlinkedid']);}}catch(_0x31fc06){logger[_0x5448('0x37')](_0x5448('0x55'),_0x31fc06[_0x5448('0x3a')]);}};Acw[_0x5448('0x41')][_0x5448('0x11')]=function(_0x31be13){try{if(this['voiceQueues'][_0x31be13[_0x5448('0x1c')]]&&this[_0x5448('0x1d')][_0x31be13[_0x5448('0x1c')]][_0x5448('0x56')]===_0x5448('0x57')){if(this['agents'][_0x31be13[_0x5448('0x1b')]]){logger['info'](_0x5448('0x58'),_0x31be13[_0x5448('0x30')],_0x31be13[_0x5448('0x1b')],_0x31be13[_0x5448('0x1c')]);return RpcUser[_0x5448('0x59')](this['agents'][_0x31be13[_0x5448('0x1b')]],_0x5448('0x5a'),_0x31be13[_0x5448('0x30')]);}}}catch(_0x553a4d){logger[_0x5448('0x37')](_0x5448('0x5b'),_0x553a4d[_0x5448('0x3a')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 80b341e..bf478ad 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 _0xa37e=['error','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionSipShowRegistry','actionDeviceStateList','log','exports','bluebird','moment','../../config/logger','ami','asterisk','port','username','password','keepConnected','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect'];(function(_0x14d25e,_0x3fe395){var _0x364596=function(_0x11d247){while(--_0x11d247){_0x14d25e['push'](_0x14d25e['shift']());}};_0x364596(++_0x3fe395);}(_0xa37e,0x147));var _0xea37=function(_0x477f74,_0x218721){_0x477f74=_0x477f74-0x0;var _0x42995f=_0xa37e[_0x477f74];return _0x42995f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xea37('0x0'));var moment=require(_0xea37('0x1'));var util=require('util');var _=require('lodash');var logger=require(_0xea37('0x2'))(_0xea37('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0xea37('0x4')][_0xea37('0x5')],config[_0xea37('0x4')]['ip'],config[_0xea37('0x4')][_0xea37('0x6')],config[_0xea37('0x4')][_0xea37('0x7')],!![]);ami[_0xea37('0x8')]();ami['Action']=BPromise[_0xea37('0x9')](ami['action']);function error(_0x1cb11e){logger['error'](util[_0xea37('0xa')](_0xea37('0xb'),config[_0xea37('0x4')][_0xea37('0x6')],config[_0xea37('0x4')]['ip'],config['asterisk'][_0xea37('0x5')],util[_0xea37('0xc')](_0x1cb11e,![],null)));}function close(){logger[_0xea37('0xd')](util[_0xea37('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xea37('0x4')]['username'],config['asterisk']['ip'],config[_0xea37('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xea37('0xe')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xea37('0xf')});};};ami[_0xea37('0x10')]=function(){return function(){return ami['Action']({'action':_0xea37('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xea37('0xe')]({'action':_0xea37('0x12')});};};ami[_0xea37('0x13')]=function(){return function(){return ami[_0xea37('0xe')]({'action':_0xea37('0x14')});};};function connect(_0x42422e){logger[_0xea37('0x15')](util[_0xea37('0xa')](_0xea37('0x16'),config[_0xea37('0x4')][_0xea37('0x6')],config['asterisk']['ip'],config[_0xea37('0x4')]['port']));ami['once'](_0xea37('0xd'),error);ami[_0xea37('0x17')](_0xea37('0x18'),close);}ami['on'](_0xea37('0x19'),connect);ami['on']('shutdown',function(_0xf3aa10){logger['info'](util['format'](_0xea37('0x1a'),config[_0xea37('0x4')][_0xea37('0x6')],config[_0xea37('0x4')]['ip'],config[_0xea37('0x4')][_0xea37('0x5')],util[_0xea37('0xc')](_0xf3aa10,![],null)));});ami['on'](_0xea37('0x1b'),function(_0x37e58a){logger[_0xea37('0x15')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xea37('0x4')]['username'],config[_0xea37('0x4')]['ip'],config[_0xea37('0x4')][_0xea37('0x5')]));return BPromise[_0xea37('0x1c')]()[_0xea37('0x1d')](ami[_0xea37('0x1e')]())[_0xea37('0x1d')](ami[_0xea37('0x1f')]())[_0xea37('0x1d')](ami[_0xea37('0x10')]())[_0xea37('0x1d')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0x21290d){console[_0xea37('0x20')](_0x21290d);});});ami[_0xea37('0x17')]('error',error);ami[_0xea37('0x17')](_0xea37('0x18'),close);module[_0xea37('0x21')]=ami; \ No newline at end of file +var _0xe55d=['resolve','then','actionDeviceStateList','catch','log','exports','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','../../config/environment','port','asterisk','username','password','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','sipshowregistry','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xe55d,0x14a));var _0xde55=function(_0x1edd26,_0x361e51){_0x1edd26=_0x1edd26-0x0;var _0x273ed8=_0xe55d[_0x1edd26];return _0x273ed8;};'use strict';var Manager=require(_0xde55('0x0'));var BPromise=require(_0xde55('0x1'));var moment=require('moment');var util=require(_0xde55('0x2'));var _=require(_0xde55('0x3'));var logger=require(_0xde55('0x4'))(_0xde55('0x5'));var config=require(_0xde55('0x6'));var ami=new Manager(config['asterisk'][_0xde55('0x7')],config['asterisk']['ip'],config[_0xde55('0x8')][_0xde55('0x9')],config[_0xde55('0x8')][_0xde55('0xa')],!![]);ami['keepConnected']();ami[_0xde55('0xb')]=BPromise['promisify'](ami[_0xde55('0xc')]);function error(_0x3d737d){logger[_0xde55('0xd')](util[_0xde55('0xe')](_0xde55('0xf'),config[_0xde55('0x8')][_0xde55('0x9')],config['asterisk']['ip'],config[_0xde55('0x8')][_0xde55('0x7')],util[_0xde55('0x10')](_0x3d737d,![],null)));}function close(){logger['error'](util[_0xde55('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xde55('0x8')][_0xde55('0x9')],config[_0xde55('0x8')]['ip'],config[_0xde55('0x8')][_0xde55('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xde55('0xb')]({'action':_0xde55('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xde55('0x12')]=function(){return function(){return ami[_0xde55('0xb')]({'action':_0xde55('0x13')});};};ami[_0xde55('0x14')]=function(){return function(){return ami[_0xde55('0xb')]({'action':_0xde55('0x15')});};};function connect(_0xe915d1){logger[_0xde55('0x16')](util[_0xde55('0xe')](_0xde55('0x17'),config[_0xde55('0x8')][_0xde55('0x9')],config['asterisk']['ip'],config[_0xde55('0x8')]['port']));ami[_0xde55('0x18')](_0xde55('0xd'),error);ami[_0xde55('0x18')](_0xde55('0x19'),close);}ami['on'](_0xde55('0x1a'),connect);ami['on'](_0xde55('0x1b'),function(_0x56e5ed){logger['info'](util[_0xde55('0xe')](_0xde55('0x1c'),config[_0xde55('0x8')]['username'],config[_0xde55('0x8')]['ip'],config[_0xde55('0x8')][_0xde55('0x7')],util['inspect'](_0x56e5ed,![],null)));});ami['on']('fullybooted',function(_0x289ba7){logger['info'](util[_0xde55('0xe')](_0xde55('0x1d'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xde55('0x8')][_0xde55('0x7')]));return BPromise[_0xde55('0x1e')]()['then'](ami['actionSipShowRegistry']())[_0xde55('0x1f')](ami[_0xde55('0x20')]())['then'](ami['actionSipPeerStatus']())[_0xde55('0x1f')](ami[_0xde55('0x12')]())[_0xde55('0x1f')](ami[_0xde55('0x14')]())[_0xde55('0x21')](function(_0x6b4049){console[_0xde55('0x22')](_0x6b4049);});});ami[_0xde55('0x18')](_0xde55('0xd'),error);ami['once'](_0xde55('0x19'),close);module[_0xde55('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index bda100d..a91bbab 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xe706,0xa3));var _0x6e70=function(_0x2ce715,_0x22e80c){_0x2ce715=_0x2ce715-0x0;var _0x41c7bb=_0xe706[_0x2ce715];return _0x41c7bb;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2893b9,_0x1792a4){_0x2893b9=_0x2893b9-0x0;var _0x23fb0f=_0x9bde[_0x2893b9];return _0x23fb0f;};'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 diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 659465d..923ccf1 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 _0xa41a=['name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','exports','util','lodash','moment','string','voiceQueue','uniqueid'];(function(_0x3f4a28,_0x35156f){var _0x16532b=function(_0x3f787b){while(--_0x3f787b){_0x3f4a28['push'](_0x3f4a28['shift']());}};_0x16532b(++_0x35156f);}(_0xa41a,0x108));var _0xaa41=function(_0x321a0f,_0x216df5){_0x321a0f=_0x321a0f-0x0;var _0x225b0c=_0xa41a[_0x321a0f];return _0x225b0c;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var moment=require(_0xaa41('0x2'));function checkNameSurname(_0x11a6e5,_0xd23b79,_0x3757a0){var _0xa950c0='';if(!_['isNil'](_0xd23b79)&&_0xaa41('0x3')===typeof _0xd23b79){_0xa950c0+=_0xd23b79;}if(!_['isNil'](_0x3757a0)&&_0xaa41('0x3')===typeof _0x3757a0){_0xa950c0+='\x20'+_0x3757a0;}if(_0xa950c0!==''){return _0xa950c0;}return _0x11a6e5;}function Action(_0x1b262e,_0x266aab,_0x6c6cc0){this[_0xaa41('0x4')]=_0x1b262e;this[_0xaa41('0x5')]=_0x6c6cc0||undefined;this[_0xaa41('0x6')]=checkNameSurname(_0x266aab[_0xaa41('0x7')][_0xaa41('0x8')],_0x266aab[_0xaa41('0x7')][_0xaa41('0x9')],_0x266aab['Contact'][_0xaa41('0xa')]);this[_0xaa41('0xb')]=_0x266aab[_0xaa41('0x7')][_0xaa41('0x8')];this[_0xaa41('0xc')]=_0x1b262e[_0xaa41('0x6')];this[_0xaa41('0xd')]=_0x266aab[_0xaa41('0xd')]||![];this[_0xaa41('0xe')]=_0x1b262e['type'];this[_0xaa41('0xf')]=_0x1b262e[_0xaa41('0xf')]||0x3;this[_0xaa41('0x10')]=_0x266aab[_0xaa41('0x10')];this[_0xaa41('0x11')]=_0x266aab[_0xaa41('0x11')];this[_0xaa41('0x12')]=_0x266aab[_0xaa41('0x12')];this[_0xaa41('0x13')]=_0x266aab[_0xaa41('0x13')];this['countnosuchnumberretry']=_0x266aab[_0xaa41('0x14')];this[_0xaa41('0x15')]=_0x266aab['countdropretry'];this[_0xaa41('0x16')]=_0x266aab['countabandonedretry'];this[_0xaa41('0x17')]=_0x266aab[_0xaa41('0x17')];this[_0xaa41('0x18')]=_0x266aab[_0xaa41('0x18')];this[_0xaa41('0x19')]=_0x266aab['ContactId'];this[_0xaa41('0x1a')]=_0x266aab[_0xaa41('0x1a')];this[_0xaa41('0x1b')]=_0x266aab[_0xaa41('0x1b')];this[_0xaa41('0x1c')]=_0x266aab[_0xaa41('0x1c')];this[_0xaa41('0x1d')]=_0x266aab[_0xaa41('0x1d')];this[_0xaa41('0x1e')]=_0x266aab['id'];this[_0xaa41('0x1f')]=_0x266aab[_0xaa41('0x7')][_0xaa41('0x9')]||'';this['starttime']=moment()['format'](_0xaa41('0x20'));this[_0xaa41('0x21')]=_0x266aab[_0xaa41('0x21')];this[_0xaa41('0x22')]=_0x266aab[_0xaa41('0x22')];this[_0xaa41('0x23')]=_0x266aab[_0xaa41('0x23')];this['recallme']=_0x266aab[_0xaa41('0x24')];this[_0xaa41('0x25')]='';this[_0xaa41('0x26')]='';}Action[_0xaa41('0x27')]['getCaller']=function(){return util[_0xaa41('0x28')](_0xaa41('0x29'),this['name'],this[_0xaa41('0x4')]['dialCutDigit']>0x0?this[_0xaa41('0xb')][_0xaa41('0x2a')](this[_0xaa41('0x4')][_0xaa41('0x2b')]):this[_0xaa41('0xb')]);};Action[_0xaa41('0x27')]['getQueue']=function(){return this[_0xaa41('0xc')];};module[_0xaa41('0x2c')]=Action; \ No newline at end of file +var _0x4351=['type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','getQueue','exports','util','isNil','string','voiceQueue','name','Contact','firstName','lastName','phone','active'];(function(_0x4a183b,_0x4a0bd4){var _0x2e6212=function(_0x792527){while(--_0x792527){_0x4a183b['push'](_0x4a183b['shift']());}};_0x2e6212(++_0x4a0bd4);}(_0x4351,0x17c));var _0x1435=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4351[_0x2b10c6];return _0x3789d2;};'use strict';var util=require(_0x1435('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x200670,_0x2b921d,_0x1457ac){var _0x1ace19='';if(!_[_0x1435('0x1')](_0x2b921d)&&_0x1435('0x2')===typeof _0x2b921d){_0x1ace19+=_0x2b921d;}if(!_[_0x1435('0x1')](_0x1457ac)&&_0x1435('0x2')===typeof _0x1457ac){_0x1ace19+='\x20'+_0x1457ac;}if(_0x1ace19!==''){return _0x1ace19;}return _0x200670;}function Action(_0x9e7e35,_0x13664c,_0x577779){this[_0x1435('0x3')]=_0x9e7e35;this['uniqueid']=_0x577779||undefined;this[_0x1435('0x4')]=checkNameSurname(_0x13664c[_0x1435('0x5')]['phone'],_0x13664c[_0x1435('0x5')][_0x1435('0x6')],_0x13664c[_0x1435('0x5')][_0x1435('0x7')]);this['number']=_0x13664c[_0x1435('0x5')][_0x1435('0x8')];this['queue']=_0x9e7e35['name'];this[_0x1435('0x9')]=_0x13664c[_0x1435('0x9')]||![];this[_0x1435('0xa')]=_0x9e7e35[_0x1435('0xa')];this['dialQueueTimeout']=_0x9e7e35['dialQueueTimeout']||0x3;this[_0x1435('0xb')]=_0x13664c['scheduledat'];this[_0x1435('0xc')]=_0x13664c[_0x1435('0xc')];this[_0x1435('0xd')]=_0x13664c['countcongestionretry'];this[_0x1435('0xe')]=_0x13664c[_0x1435('0xe')];this[_0x1435('0xf')]=_0x13664c[_0x1435('0xf')];this['countdropretry']=_0x13664c[_0x1435('0x10')];this[_0x1435('0x11')]=_0x13664c['countabandonedretry'];this[_0x1435('0x12')]=_0x13664c[_0x1435('0x12')];this[_0x1435('0x13')]=_0x13664c[_0x1435('0x13')];this[_0x1435('0x14')]=_0x13664c['ContactId'];this[_0x1435('0x15')]=_0x13664c[_0x1435('0x15')];this[_0x1435('0x16')]=_0x13664c['UserId'];this[_0x1435('0x17')]=_0x13664c['VoiceQueueId'];this['CampaignId']=_0x13664c['CampaignId'];this['idHopper']=_0x13664c['id'];this[_0x1435('0x18')]=_0x13664c[_0x1435('0x5')]['firstName']||'';this[_0x1435('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1435('0x1a')]=_0x13664c[_0x1435('0x1a')];this[_0x1435('0x1b')]=_0x13664c[_0x1435('0x1b')];this[_0x1435('0x1c')]=_0x13664c['callbackat'];this[_0x1435('0x1d')]=_0x13664c[_0x1435('0x1d')];this['originatecalleridnum']='';this[_0x1435('0x1e')]='';}Action[_0x1435('0x1f')][_0x1435('0x20')]=function(){return util[_0x1435('0x21')](_0x1435('0x22'),this[_0x1435('0x4')],this['voiceQueue'][_0x1435('0x23')]>0x0?this[_0x1435('0x24')]['substring'](this['voiceQueue'][_0x1435('0x23')]):this[_0x1435('0x24')]);};Action[_0x1435('0x1f')][_0x1435('0x25')]=function(){return this['queue'];};module[_0x1435('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 82c5f88..9723be1 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 _0x4217=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x4217,0x18a));var _0x7421=function(_0x444f09,_0x932626){_0x444f09=_0x444f09-0x0;var _0x423deb=_0x4217[_0x444f09];return _0x423deb;};'use strict';var util=require(_0x7421('0x0'));var _=require(_0x7421('0x1'));var moment=require(_0x7421('0x2'));function getSeconds(_0x499130,_0x3516af){var _0x526463=moment(_0x499130)['milliseconds'](0x0);var _0x42817e=moment(_0x3516af)[_0x7421('0x3')](0x0);return _0x526463[_0x7421('0x4')](_0x42817e,_0x7421('0x5'));}function AgentComplete(_0x378403,_0x2ab2b0){this[_0x7421('0x6')]=0x4;this['statedesc']='Answer';this[_0x7421('0x7')]=_0x378403[_0x7421('0x7')];this['type']=_0x378403[_0x7421('0x8')];this['campaigntype']=_0x378403[_0x7421('0x8')]===_0x7421('0x9')?_0x7421('0xa'):_0x378403[_0x7421('0x8')];this[_0x7421('0xb')]=_0x378403[_0x7421('0xb')];this['countcongestionretry']=_0x378403['countcongestionretry'];this[_0x7421('0xc')]=_0x378403['countnoanswerretry'];this[_0x7421('0xd')]=_0x378403['countbusyretry']+_0x378403[_0x7421('0xe')]+_0x378403[_0x7421('0xc')]+_0x378403[_0x7421('0xf')]+_0x378403[_0x7421('0x10')]+_0x378403[_0x7421('0x11')]+_0x378403[_0x7421('0x12')]+_0x378403[_0x7421('0x13')];this[_0x7421('0xf')]=_0x378403[_0x7421('0xf')];this['countdropretry']=_0x378403['countdropretry'];this[_0x7421('0x11')]=_0x378403[_0x7421('0x11')];this['countmachineretry']=_0x378403['countmachineretry'];this[_0x7421('0x13')]=_0x378403['countagentrejectretry'];this[_0x7421('0x14')]=_0x2ab2b0['uniqueid'];this[_0x7421('0x15')]=_0x378403[_0x7421('0x16')];this[_0x7421('0x17')]=_0x378403[_0x7421('0x18')];this['starttime']=_0x378403[_0x7421('0x19')];this[_0x7421('0x1a')]=_0x378403[_0x7421('0x1a')];this[_0x7421('0x1b')]=_0x378403[_0x7421('0x1b')];this[_0x7421('0x1c')]=moment()[_0x7421('0x1d')](_0x7421('0x1e'));this[_0x7421('0x1f')]=getSeconds(_0x378403[_0x7421('0x1a')],_0x378403[_0x7421('0x19')]);this[_0x7421('0x20')]=getSeconds(_0x378403[_0x7421('0x1b')],_0x378403[_0x7421('0x1a')]);this[_0x7421('0x21')]=getSeconds(this[_0x7421('0x1c')],_0x378403[_0x7421('0x1b')]);this[_0x7421('0xa')]=_0x2ab2b0[_0x7421('0xa')];this['membername']=_0x2ab2b0[_0x7421('0x22')];this[_0x7421('0x23')]=_0x2ab2b0[_0x7421('0x23')];this[_0x7421('0x24')]=_0x378403[_0x7421('0x24')];this[_0x7421('0x25')]=_0x378403[_0x7421('0x25')];this[_0x7421('0x26')]=_0x378403[_0x7421('0x26')];this['recallme']=_0x378403[_0x7421('0x27')];this['ContactId']=_0x378403[_0x7421('0x28')];this[_0x7421('0x29')]=_0x378403[_0x7421('0x29')];this[_0x7421('0x2a')]=_0x378403[_0x7421('0x2a')];this[_0x7421('0x2b')]=_0x378403[_0x7421('0x2b')];this[_0x7421('0x2c')]=_0x378403[_0x7421('0x2c')];this[_0x7421('0x2d')]=_0x378403[_0x7421('0x2d')]||'';this[_0x7421('0x2e')]=_0x378403['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xec8a=['statedesc','Answer','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','state'];(function(_0x42c4c4,_0x1867ad){var _0x35a614=function(_0x466d33){while(--_0x466d33){_0x42c4c4['push'](_0x42c4c4['shift']());}};_0x35a614(++_0x1867ad);}(_0xec8a,0x7c));var _0xaec8=function(_0x4b56c1,_0x4ffe65){_0x4b56c1=_0x4b56c1-0x0;var _0x509e04=_0xec8a[_0x4b56c1];return _0x509e04;};'use strict';var util=require('util');var _=require(_0xaec8('0x0'));var moment=require(_0xaec8('0x1'));function getSeconds(_0x4de367,_0x1ae52b){var _0x499f51=moment(_0x4de367)[_0xaec8('0x2')](0x0);var _0x459ca2=moment(_0x1ae52b)[_0xaec8('0x2')](0x0);return _0x499f51[_0xaec8('0x3')](_0x459ca2,'seconds');}function AgentComplete(_0x473f25,_0x364dde){this[_0xaec8('0x4')]=0x4;this[_0xaec8('0x5')]=_0xaec8('0x6');this['scheduledat']=_0x473f25['scheduledat'];this['type']=_0x473f25[_0xaec8('0x7')];this[_0xaec8('0x8')]=_0x473f25[_0xaec8('0x7')]==='outbound'?'queue':_0x473f25['type'];this[_0xaec8('0x9')]=_0x473f25[_0xaec8('0x9')];this['countcongestionretry']=_0x473f25[_0xaec8('0xa')];this[_0xaec8('0xb')]=_0x473f25['countnoanswerretry'];this['countglobal']=_0x473f25[_0xaec8('0x9')]+_0x473f25['countcongestionretry']+_0x473f25[_0xaec8('0xb')]+_0x473f25[_0xaec8('0xc')]+_0x473f25[_0xaec8('0xd')]+_0x473f25[_0xaec8('0xe')]+_0x473f25[_0xaec8('0xf')]+_0x473f25[_0xaec8('0x10')];this[_0xaec8('0xc')]=_0x473f25[_0xaec8('0xc')];this[_0xaec8('0xd')]=_0x473f25[_0xaec8('0xd')];this[_0xaec8('0xe')]=_0x473f25[_0xaec8('0xe')];this[_0xaec8('0xf')]=_0x473f25[_0xaec8('0xf')];this[_0xaec8('0x10')]=_0x473f25['countagentrejectretry'];this['uniqueid']=_0x364dde[_0xaec8('0x11')];this['calleridname']=_0x473f25[_0xaec8('0x12')];this[_0xaec8('0x13')]=_0x473f25['number'];this[_0xaec8('0x14')]=_0x473f25[_0xaec8('0x14')];this['responsetime']=_0x473f25[_0xaec8('0x15')];this[_0xaec8('0x16')]=_0x473f25[_0xaec8('0x16')];this[_0xaec8('0x17')]=moment()[_0xaec8('0x18')](_0xaec8('0x19'));this[_0xaec8('0x1a')]=getSeconds(_0x473f25[_0xaec8('0x15')],_0x473f25[_0xaec8('0x14')]);this[_0xaec8('0x1b')]=getSeconds(_0x473f25[_0xaec8('0x16')],_0x473f25['responsetime']);this[_0xaec8('0x1c')]=getSeconds(this[_0xaec8('0x17')],_0x473f25['answertime']);this['queue']=_0x364dde[_0xaec8('0x1d')];this[_0xaec8('0x1e')]=_0x364dde[_0xaec8('0x1e')];this[_0xaec8('0x1f')]=_0x364dde[_0xaec8('0x1f')];this['callback']=_0x473f25[_0xaec8('0x20')];this[_0xaec8('0x21')]=_0x473f25[_0xaec8('0x21')];this[_0xaec8('0x22')]=_0x473f25[_0xaec8('0x22')];this['recallme']=_0x473f25[_0xaec8('0x23')];this[_0xaec8('0x24')]=_0x473f25[_0xaec8('0x24')];this[_0xaec8('0x25')]=_0x473f25['ListId'];this[_0xaec8('0x26')]=_0x473f25[_0xaec8('0x26')];this[_0xaec8('0x27')]=_0x473f25['VoiceQueueId'];this[_0xaec8('0x28')]=_0x473f25[_0xaec8('0x28')];this[_0xaec8('0x29')]=_0x473f25['originatecalleridnum']||'';this['originatecalleridname']=_0x473f25[_0xaec8('0x2a')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index d4d3f6a..bf578ed 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 _0x24ca=['countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x24ca,0x8c));var _0xa24c=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x24ca[_0x2f3794];return _0x1c9fbe;};'use strict';var util=require(_0xa24c('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1f4ee1,_0x4e90b0){var _0x155c49=moment(_0x1f4ee1)[_0xa24c('0x1')](0x0);var _0xe69cdd=moment(_0x4e90b0)['milliseconds'](0x0);return _0x155c49[_0xa24c('0x2')](_0xe69cdd,_0xa24c('0x3'));}function Final(_0x4707f9){this['uniqueid']=_0x4707f9['uniqueid'];this['scheduledat']=_0x4707f9[_0xa24c('0x4')];this[_0xa24c('0x5')]=_0x4707f9[_0xa24c('0x5')];this[_0xa24c('0x6')]=_0x4707f9[_0xa24c('0x5')]===_0xa24c('0x7')?'queue':_0x4707f9[_0xa24c('0x5')];this[_0xa24c('0x8')]=_0x4707f9[_0xa24c('0x8')];this['countcongestionretry']=_0x4707f9['countcongestionretry'];this[_0xa24c('0x9')]=_0x4707f9[_0xa24c('0x9')];this[_0xa24c('0xa')]=_0x4707f9[_0xa24c('0x8')]+_0x4707f9[_0xa24c('0xb')]+_0x4707f9[_0xa24c('0x9')]+_0x4707f9['countnosuchnumberretry']+_0x4707f9['countdropretry']+_0x4707f9['countabandonedretry']+_0x4707f9[_0xa24c('0xc')]+_0x4707f9[_0xa24c('0xd')];this[_0xa24c('0xe')]=_0x4707f9[_0xa24c('0xe')];this[_0xa24c('0xf')]=_0x4707f9['countdropretry'];this[_0xa24c('0x10')]=_0x4707f9['countabandonedretry'];this['countmachineretry']=_0x4707f9['countmachineretry'];this[_0xa24c('0xd')]=_0x4707f9[_0xa24c('0xd')];this[_0xa24c('0x11')]=_0x4707f9[_0xa24c('0x11')];this[_0xa24c('0x12')]=_0x4707f9[_0xa24c('0x12')];this[_0xa24c('0x13')]=_0x4707f9[_0xa24c('0x13')];this[_0xa24c('0x14')]=_0x4707f9[_0xa24c('0x14')];this[_0xa24c('0x15')]=_0x4707f9[_0xa24c('0x15')];this[_0xa24c('0x16')]=_0x4707f9[_0xa24c('0x15')];this['ringtime']=_0x4707f9[_0xa24c('0x17')]||0x0;this['holdtime']=_0x4707f9[_0xa24c('0x18')]||0x0;this[_0xa24c('0x19')]=_0x4707f9[_0xa24c('0x19')]||0x0;this[_0xa24c('0x1a')]=_0x4707f9[_0xa24c('0x1a')];this[_0xa24c('0x1b')]=_0x4707f9[_0xa24c('0x1b')];this[_0xa24c('0x1c')]=_0x4707f9[_0xa24c('0x1c')];this[_0xa24c('0x1d')]=_0x4707f9[_0xa24c('0x1d')];this['ContactId']=_0x4707f9['ContactId'];this[_0xa24c('0x1e')]=_0x4707f9[_0xa24c('0x1e')];this[_0xa24c('0x1f')]=_0x4707f9[_0xa24c('0x1f')];this[_0xa24c('0x20')]=_0x4707f9[_0xa24c('0x20')];this[_0xa24c('0x21')]=_0x4707f9[_0xa24c('0x21')];this[_0xa24c('0x22')]=_0x4707f9['originatecalleridnum']||'';this[_0xa24c('0x23')]=_0x4707f9['originatecalleridname']||'';}module[_0xa24c('0x24')]=Final; \ No newline at end of file +var _0x84ab=['countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x4715ed,_0x4ef904){var _0x360c25=function(_0x51bd2e){while(--_0x51bd2e){_0x4715ed['push'](_0x4715ed['shift']());}};_0x360c25(++_0x4ef904);}(_0x84ab,0x12f));var _0xb84a=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x84ab[_0x38ff1e];return _0x3755d4;};'use strict';var util=require(_0xb84a('0x0'));var _=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));function getSeconds(_0x1ea089,_0x473c3){var _0x512f13=moment(_0x1ea089)[_0xb84a('0x3')](0x0);var _0x18a4a5=moment(_0x473c3)['milliseconds'](0x0);return _0x512f13[_0xb84a('0x4')](_0x18a4a5,_0xb84a('0x5'));}function Final(_0x28c83b){this['uniqueid']=_0x28c83b['uniqueid'];this['scheduledat']=_0x28c83b[_0xb84a('0x6')];this['type']=_0x28c83b[_0xb84a('0x7')];this[_0xb84a('0x8')]=_0x28c83b['type']===_0xb84a('0x9')?'queue':_0x28c83b[_0xb84a('0x7')];this[_0xb84a('0xa')]=_0x28c83b[_0xb84a('0xa')];this['countcongestionretry']=_0x28c83b['countcongestionretry'];this['countnoanswerretry']=_0x28c83b[_0xb84a('0xb')];this[_0xb84a('0xc')]=_0x28c83b[_0xb84a('0xa')]+_0x28c83b[_0xb84a('0xd')]+_0x28c83b[_0xb84a('0xb')]+_0x28c83b['countnosuchnumberretry']+_0x28c83b[_0xb84a('0xe')]+_0x28c83b[_0xb84a('0xf')]+_0x28c83b[_0xb84a('0x10')]+_0x28c83b[_0xb84a('0x11')];this[_0xb84a('0x12')]=_0x28c83b[_0xb84a('0x12')];this[_0xb84a('0xe')]=_0x28c83b[_0xb84a('0xe')];this[_0xb84a('0xf')]=_0x28c83b[_0xb84a('0xf')];this[_0xb84a('0x10')]=_0x28c83b[_0xb84a('0x10')];this['countagentrejectretry']=_0x28c83b[_0xb84a('0x11')];this[_0xb84a('0x13')]=_0x28c83b[_0xb84a('0x13')];this[_0xb84a('0x14')]=_0x28c83b[_0xb84a('0x14')];this[_0xb84a('0x15')]=_0x28c83b[_0xb84a('0x15')];this[_0xb84a('0x16')]=_0x28c83b[_0xb84a('0x16')];this[_0xb84a('0x17')]=_0x28c83b[_0xb84a('0x17')];this[_0xb84a('0x18')]=_0x28c83b[_0xb84a('0x17')];this[_0xb84a('0x19')]=_0x28c83b['ringtime']||0x0;this[_0xb84a('0x1a')]=_0x28c83b[_0xb84a('0x1a')]||0x0;this['talktime']=_0x28c83b[_0xb84a('0x1b')]||0x0;this[_0xb84a('0x1c')]=_0x28c83b[_0xb84a('0x1c')];this[_0xb84a('0x1d')]=_0x28c83b['callbackuniqueid'];this['callbackat']=_0x28c83b[_0xb84a('0x1e')];this[_0xb84a('0x1f')]=_0x28c83b[_0xb84a('0x1f')];this[_0xb84a('0x20')]=_0x28c83b[_0xb84a('0x20')];this[_0xb84a('0x21')]=_0x28c83b[_0xb84a('0x21')];this[_0xb84a('0x22')]=_0x28c83b[_0xb84a('0x22')];this[_0xb84a('0x23')]=_0x28c83b[_0xb84a('0x23')];this[_0xb84a('0x24')]=_0x28c83b[_0xb84a('0x24')];this[_0xb84a('0x25')]=_0x28c83b[_0xb84a('0x25')]||'';this[_0xb84a('0x26')]=_0x28c83b[_0xb84a('0x26')]||'';}module[_0xb84a('0x27')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8e5d7d0..ea8256c 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 _0x2f8c=['reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername'];(function(_0x4d1ba0,_0x35c4f8){var _0x241320=function(_0x5eb059){while(--_0x5eb059){_0x4d1ba0['push'](_0x4d1ba0['shift']());}};_0x241320(++_0x35c4f8);}(_0x2f8c,0xc0));var _0xc2f8=function(_0x45864f,_0x5292c5){_0x45864f=_0x45864f-0x0;var _0x290e82=_0x2f8c[_0x45864f];return _0x290e82;};'use strict';var util=require(_0xc2f8('0x0'));var _=require(_0xc2f8('0x1'));var moment=require(_0xc2f8('0x2'));function getSeconds(_0x57cfbe,_0xb88522){var _0x520500=moment(_0x57cfbe)['milliseconds'](0x0);var _0x30b74a=moment(_0xb88522)[_0xc2f8('0x3')](0x0);return _0x520500[_0xc2f8('0x4')](_0x30b74a,_0xc2f8('0x5'));}function Hangup(_0x51e5d1,_0x38ec9c){this[_0xc2f8('0x6')]=0x4;this['statedesc']=_0xc2f8('0x7');this[_0xc2f8('0x8')]=_0x51e5d1['scheduledat'];this[_0xc2f8('0x9')]=_0x51e5d1[_0xc2f8('0x9')];this['campaigntype']=_0x51e5d1['type']===_0xc2f8('0xa')?_0xc2f8('0xb'):_0x51e5d1['type'];this[_0xc2f8('0xc')]=_0x51e5d1[_0xc2f8('0xc')];this[_0xc2f8('0xd')]=_0x51e5d1[_0xc2f8('0xd')];this[_0xc2f8('0xe')]=_0x51e5d1[_0xc2f8('0xe')];this[_0xc2f8('0xf')]=_0x51e5d1[_0xc2f8('0xc')]+_0x51e5d1['countcongestionretry']+_0x51e5d1['countnoanswerretry']+_0x51e5d1[_0xc2f8('0x10')]+_0x51e5d1[_0xc2f8('0x11')]+_0x51e5d1[_0xc2f8('0x12')]+_0x51e5d1[_0xc2f8('0x13')]+_0x51e5d1[_0xc2f8('0x14')];this['countnosuchnumberretry']=_0x51e5d1['countnosuchnumberretry'];this['countdropretry']=_0x51e5d1['countdropretry'];this[_0xc2f8('0x12')]=_0x51e5d1[_0xc2f8('0x12')];this['countmachineretry']=_0x51e5d1[_0xc2f8('0x13')];this[_0xc2f8('0x14')]=_0x51e5d1[_0xc2f8('0x14')];this[_0xc2f8('0x15')]=_0x38ec9c[_0xc2f8('0x15')];this[_0xc2f8('0x16')]=_0x51e5d1[_0xc2f8('0x17')];this[_0xc2f8('0x18')]=_0x51e5d1['number'];this[_0xc2f8('0x19')]=_0x51e5d1['starttime'];this[_0xc2f8('0x1a')]=_0x51e5d1[_0xc2f8('0x1a')];this[_0xc2f8('0x1b')]=moment()[_0xc2f8('0x1c')](_0xc2f8('0x1d'));this['ringtime']=getSeconds(_0x51e5d1[_0xc2f8('0x1a')],_0x51e5d1[_0xc2f8('0x19')]);this[_0xc2f8('0x1e')]=0x0;this[_0xc2f8('0x1f')]=getSeconds(this[_0xc2f8('0x1b')],_0x51e5d1['responsetime']);this['queue']=_0x51e5d1['queue'];this[_0xc2f8('0x20')]='IVR';this[_0xc2f8('0x21')]=_0x38ec9c[_0xc2f8('0x22')];this[_0xc2f8('0x23')]=_0x51e5d1['callback'];this[_0xc2f8('0x24')]=_0x51e5d1[_0xc2f8('0x24')];this[_0xc2f8('0x25')]=_0x51e5d1[_0xc2f8('0x25')];this[_0xc2f8('0x26')]=_0x51e5d1[_0xc2f8('0x26')];this[_0xc2f8('0x27')]=_0x51e5d1[_0xc2f8('0x27')];this[_0xc2f8('0x28')]=_0x51e5d1[_0xc2f8('0x28')];this['UserId']=_0x51e5d1[_0xc2f8('0x29')];this[_0xc2f8('0x2a')]=_0x51e5d1[_0xc2f8('0x2a')];this[_0xc2f8('0x2b')]=_0x51e5d1[_0xc2f8('0x2b')];}module[_0xc2f8('0x2c')]=Hangup; \ No newline at end of file +var _0x76d0=['reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','Answer','type','campaigntype','queue','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','membername','IVR'];(function(_0x28c129,_0x46edb4){var _0x56992e=function(_0xdf0ac1){while(--_0xdf0ac1){_0x28c129['push'](_0x28c129['shift']());}};_0x56992e(++_0x46edb4);}(_0x76d0,0x1a1));var _0x076d=function(_0x4b3be8,_0x1c1509){_0x4b3be8=_0x4b3be8-0x0;var _0x2c8f83=_0x76d0[_0x4b3be8];return _0x2c8f83;};'use strict';var util=require(_0x076d('0x0'));var _=require(_0x076d('0x1'));var moment=require(_0x076d('0x2'));function getSeconds(_0x1ac24d,_0x319ccb){var _0x483165=moment(_0x1ac24d)[_0x076d('0x3')](0x0);var _0x413e91=moment(_0x319ccb)[_0x076d('0x3')](0x0);return _0x483165[_0x076d('0x4')](_0x413e91,'seconds');}function Hangup(_0x2af9d4,_0x4ba0cf){this[_0x076d('0x5')]=0x4;this['statedesc']=_0x076d('0x6');this['scheduledat']=_0x2af9d4['scheduledat'];this[_0x076d('0x7')]=_0x2af9d4['type'];this[_0x076d('0x8')]=_0x2af9d4[_0x076d('0x7')]==='outbound'?_0x076d('0x9'):_0x2af9d4['type'];this[_0x076d('0xa')]=_0x2af9d4[_0x076d('0xa')];this[_0x076d('0xb')]=_0x2af9d4['countcongestionretry'];this['countnoanswerretry']=_0x2af9d4[_0x076d('0xc')];this[_0x076d('0xd')]=_0x2af9d4[_0x076d('0xa')]+_0x2af9d4[_0x076d('0xb')]+_0x2af9d4['countnoanswerretry']+_0x2af9d4[_0x076d('0xe')]+_0x2af9d4[_0x076d('0xf')]+_0x2af9d4[_0x076d('0x10')]+_0x2af9d4[_0x076d('0x11')]+_0x2af9d4[_0x076d('0x12')];this[_0x076d('0xe')]=_0x2af9d4['countnosuchnumberretry'];this['countdropretry']=_0x2af9d4[_0x076d('0xf')];this[_0x076d('0x10')]=_0x2af9d4[_0x076d('0x10')];this['countmachineretry']=_0x2af9d4['countmachineretry'];this[_0x076d('0x12')]=_0x2af9d4[_0x076d('0x12')];this['uniqueid']=_0x4ba0cf[_0x076d('0x13')];this[_0x076d('0x14')]=_0x2af9d4[_0x076d('0x15')];this[_0x076d('0x16')]=_0x2af9d4[_0x076d('0x17')];this[_0x076d('0x18')]=_0x2af9d4[_0x076d('0x18')];this[_0x076d('0x19')]=_0x2af9d4[_0x076d('0x19')];this[_0x076d('0x1a')]=moment()[_0x076d('0x1b')](_0x076d('0x1c'));this[_0x076d('0x1d')]=getSeconds(_0x2af9d4[_0x076d('0x19')],_0x2af9d4['starttime']);this[_0x076d('0x1e')]=0x0;this['talktime']=getSeconds(this[_0x076d('0x1a')],_0x2af9d4['responsetime']);this['queue']=_0x2af9d4[_0x076d('0x9')];this[_0x076d('0x1f')]=_0x076d('0x20');this[_0x076d('0x21')]=_0x4ba0cf[_0x076d('0x22')];this['callback']=_0x2af9d4[_0x076d('0x23')];this[_0x076d('0x24')]=_0x2af9d4['callbackuniqueid'];this[_0x076d('0x25')]=_0x2af9d4['callbackat'];this[_0x076d('0x26')]=_0x2af9d4[_0x076d('0x26')];this[_0x076d('0x27')]=_0x2af9d4[_0x076d('0x27')];this['ListId']=_0x2af9d4[_0x076d('0x28')];this[_0x076d('0x29')]=_0x2af9d4[_0x076d('0x29')];this[_0x076d('0x2a')]=_0x2af9d4[_0x076d('0x2a')];this[_0x076d('0x2b')]=_0x2af9d4[_0x076d('0x2b')];}module[_0x076d('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 054776a..fcbcf14 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 _0xc2e8=['calleridnum','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','uniqueid','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc2e8,0x70));var _0x8c2e=function(_0x5655ab,_0x4c3c6a){_0x5655ab=_0x5655ab-0x0;var _0x169dc7=_0xc2e8[_0x5655ab];return _0x169dc7;};'use strict';var util=require(_0x8c2e('0x0'));var _=require(_0x8c2e('0x1'));var moment=require('moment');function getSeconds(_0x539b74,_0xc6e001){var _0x4df201=moment(_0x539b74)[_0x8c2e('0x2')](0x0);var _0x3c074b=moment(_0xc6e001)[_0x8c2e('0x2')](0x0);return _0x4df201['diff'](_0x3c074b,_0x8c2e('0x3'));}function History(_0x24aa7b){this[_0x8c2e('0x4')]=_0x24aa7b['uniqueid'];this['scheduledat']=_0x24aa7b['scheduledat']||undefined;this['type']=_0x24aa7b['type'];this[_0x8c2e('0x5')]=_0x24aa7b[_0x8c2e('0x6')]===_0x8c2e('0x7')?_0x8c2e('0x8'):_0x24aa7b[_0x8c2e('0x6')];this[_0x8c2e('0x9')]=_0x24aa7b[_0x8c2e('0x9')];this[_0x8c2e('0xa')]=_0x24aa7b['countcongestionretry'];this[_0x8c2e('0xb')]=_0x24aa7b[_0x8c2e('0xb')];this[_0x8c2e('0xc')]=_0x24aa7b['countbusyretry']+_0x24aa7b['countcongestionretry']+_0x24aa7b['countnoanswerretry']+_0x24aa7b[_0x8c2e('0xd')]+_0x24aa7b[_0x8c2e('0xe')]+_0x24aa7b[_0x8c2e('0xf')]+_0x24aa7b[_0x8c2e('0x10')]+_0x24aa7b[_0x8c2e('0x11')];this[_0x8c2e('0xd')]=_0x24aa7b[_0x8c2e('0xd')];this['countdropretry']=_0x24aa7b['countdropretry'];this[_0x8c2e('0xf')]=_0x24aa7b[_0x8c2e('0xf')];this[_0x8c2e('0x10')]=_0x24aa7b[_0x8c2e('0x10')];this[_0x8c2e('0x11')]=_0x24aa7b[_0x8c2e('0x11')];this['queue']=_0x24aa7b[_0x8c2e('0x8')];this[_0x8c2e('0x12')]=_0x24aa7b[_0x8c2e('0x13')];this[_0x8c2e('0x14')]=_0x24aa7b['number'];this[_0x8c2e('0x15')]=_0x24aa7b[_0x8c2e('0x15')];this[_0x8c2e('0x16')]=_0x24aa7b['responsetime'];this['endtime']=_0x24aa7b[_0x8c2e('0x16')];this['ringtime']=getSeconds(_0x24aa7b[_0x8c2e('0x16')],_0x24aa7b[_0x8c2e('0x15')]);this['holdtime']=0x0;this[_0x8c2e('0x17')]=0x0;this[_0x8c2e('0x18')]=_0x24aa7b[_0x8c2e('0x18')];this[_0x8c2e('0x19')]=_0x24aa7b[_0x8c2e('0x19')];this['callbackat']=_0x24aa7b[_0x8c2e('0x1a')];this['recallme']=_0x24aa7b['recallme'];this[_0x8c2e('0x1b')]=_0x24aa7b[_0x8c2e('0x1b')];this['ListId']=_0x24aa7b['ListId'];this[_0x8c2e('0x1c')]=_0x24aa7b['UserId'];this[_0x8c2e('0x1d')]=_0x24aa7b[_0x8c2e('0x1d')];this[_0x8c2e('0x1e')]=_0x24aa7b['CampaignId'];this[_0x8c2e('0x1f')]=_0x24aa7b[_0x8c2e('0x1f')]||'';this[_0x8c2e('0x20')]=_0x24aa7b[_0x8c2e('0x20')]||'';}module['exports']=History; \ No newline at end of file +var _0x1a1a=['countnosuchnumberretry','countdropretry','countagentrejectretry','countmachineretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x18ff75,_0x343494){var _0x4239e2=function(_0x3ab11b){while(--_0x3ab11b){_0x18ff75['push'](_0x18ff75['shift']());}};_0x4239e2(++_0x343494);}(_0x1a1a,0xb6));var _0xa1a1=function(_0x5956f1,_0x1d334c){_0x5956f1=_0x5956f1-0x0;var _0x49087f=_0x1a1a[_0x5956f1];return _0x49087f;};'use strict';var util=require(_0xa1a1('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x5d0549,_0x3de780){var _0x41653c=moment(_0x5d0549)[_0xa1a1('0x1')](0x0);var _0x2b1c0b=moment(_0x3de780)[_0xa1a1('0x1')](0x0);return _0x41653c[_0xa1a1('0x2')](_0x2b1c0b,_0xa1a1('0x3'));}function History(_0x32552d){this[_0xa1a1('0x4')]=_0x32552d[_0xa1a1('0x4')];this['scheduledat']=_0x32552d[_0xa1a1('0x5')]||undefined;this[_0xa1a1('0x6')]=_0x32552d[_0xa1a1('0x6')];this[_0xa1a1('0x7')]=_0x32552d['type']===_0xa1a1('0x8')?'queue':_0x32552d[_0xa1a1('0x6')];this[_0xa1a1('0x9')]=_0x32552d[_0xa1a1('0x9')];this['countcongestionretry']=_0x32552d[_0xa1a1('0xa')];this[_0xa1a1('0xb')]=_0x32552d['countnoanswerretry'];this[_0xa1a1('0xc')]=_0x32552d['countbusyretry']+_0x32552d[_0xa1a1('0xa')]+_0x32552d[_0xa1a1('0xb')]+_0x32552d[_0xa1a1('0xd')]+_0x32552d[_0xa1a1('0xe')]+_0x32552d['countabandonedretry']+_0x32552d['countmachineretry']+_0x32552d[_0xa1a1('0xf')];this[_0xa1a1('0xd')]=_0x32552d[_0xa1a1('0xd')];this[_0xa1a1('0xe')]=_0x32552d['countdropretry'];this['countabandonedretry']=_0x32552d['countabandonedretry'];this[_0xa1a1('0x10')]=_0x32552d['countmachineretry'];this['countagentrejectretry']=_0x32552d['countagentrejectretry'];this['queue']=_0x32552d[_0xa1a1('0x11')];this[_0xa1a1('0x12')]=_0x32552d[_0xa1a1('0x13')];this[_0xa1a1('0x14')]=_0x32552d[_0xa1a1('0x15')];this[_0xa1a1('0x16')]=_0x32552d[_0xa1a1('0x16')];this['responsetime']=_0x32552d[_0xa1a1('0x17')];this[_0xa1a1('0x18')]=_0x32552d['responsetime'];this[_0xa1a1('0x19')]=getSeconds(_0x32552d[_0xa1a1('0x17')],_0x32552d['starttime']);this[_0xa1a1('0x1a')]=0x0;this[_0xa1a1('0x1b')]=0x0;this[_0xa1a1('0x1c')]=_0x32552d[_0xa1a1('0x1c')];this[_0xa1a1('0x1d')]=_0x32552d['callbackuniqueid'];this[_0xa1a1('0x1e')]=_0x32552d['callbackat'];this[_0xa1a1('0x1f')]=_0x32552d[_0xa1a1('0x1f')];this['ContactId']=_0x32552d[_0xa1a1('0x20')];this['ListId']=_0x32552d['ListId'];this[_0xa1a1('0x21')]=_0x32552d[_0xa1a1('0x21')];this[_0xa1a1('0x22')]=_0x32552d[_0xa1a1('0x22')];this[_0xa1a1('0x23')]=_0x32552d[_0xa1a1('0x23')];this[_0xa1a1('0x24')]=_0x32552d[_0xa1a1('0x24')]||'';this[_0xa1a1('0x25')]=_0x32552d[_0xa1a1('0x25')]||'';}module[_0xa1a1('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 603767b..416c125 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 _0xd73a=['actions','[actions]','enqueue','isNil','status','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','syncVarSet','variable','exten','dialAMDActive','uniqueid','HangupInAMD','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','value','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countbusyretry','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','cause-txt','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','VoiceQueueId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','strategy','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','Action','all','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','phone','substring','SIP/%s/%s%s','dialCutDigit','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','predictiveIntervalDroppedCallsCallersExit','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','busyFactor','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','defaults','redis','localhost','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','queuemember','loopCampaigns','loopClearZombieChannels','message','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','available','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','pTalking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','clearZombieChannels','[uniqueid]'];(function(_0x3f4c7c,_0x1459be){var _0x4f7dfb=function(_0x2db7cc){while(--_0x2db7cc){_0x3f4c7c['push'](_0x3f4c7c['shift']());}};_0x4f7dfb(++_0x1459be);}(_0xd73a,0x171));var _0xad73=function(_0x364a3f,_0x47aee8){_0x364a3f=_0x364a3f-0x0;var _0x2271dd=_0xd73a[_0x364a3f];return _0x2271dd;};'use strict';var util=require(_0xad73('0x0'));var _=require(_0xad73('0x1'));var BPromise=require(_0xad73('0x2'));var uuid=require(_0xad73('0x3'));var moment=require(_0xad73('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0xad73('0x5'));var config=require(_0xad73('0x6'));var logger=require(_0xad73('0x7'))(_0xad73('0x8'));var loggerBooked=require(_0xad73('0x7'))(_0xad73('0x9'));var loggerPredictive=require(_0xad73('0x7'))(_0xad73('0xa'));var loggerPredictiveCalls=require(_0xad73('0x7'))(_0xad73('0xb'));var loggerSyncQueueSummary=require(_0xad73('0x7'))('syncQueueSummary');var ami=require(_0xad73('0xc'));config['redis']=_[_0xad73('0xd')](config[_0xad73('0xe')],{'host':_0xad73('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad73('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xad73('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xad73('0x11'));var Action=require(_0xad73('0x12'));var History=require(_0xad73('0x13'));var Final=require('./final');var AgentComplete=require(_0xad73('0x14'));var QueueCallerAbandon=require(_0xad73('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xad73('0x16')][_0xad73('0x17')]||_0xad73('0x18');var strategy={'rrmemory':_0xad73('0x19'),'roundrobin':_0xad73('0x1a')};var Sequence=function(){};Sequence[_0xad73('0x1b')]['enqueue']=function(_0x3b5e73){this[_0xad73('0x1c')]=this[_0xad73('0x1c')]?this[_0xad73('0x1c')][_0xad73('0x1d')](_0x3b5e73):_0x3b5e73();};function Dialer(_0x9de467,_0x3fa4dc){this[_0xad73('0x1e')]=new Sequence();this[_0xad73('0x1f')]=_0x3fa4dc;this[_0xad73('0x20')]=_0x9de467['voiceQueues'];this[_0xad73('0x21')]=_0x9de467['campaigns'];this['agents']=_0x9de467[_0xad73('0x22')];this[_0xad73('0x23')]=_0x9de467[_0xad73('0x23')];this['maxNumberOriginate']=config[_0xad73('0x24')]||0x2;this[_0xad73('0x25')]={};this['actions']={};this[_0xad73('0x26')]={};this[_0xad73('0x27')]={};this[_0xad73('0x28')]={};this[_0xad73('0x29')]={};this[_0xad73('0x2a')]={};this[_0xad73('0x2b')]={};this[_0xad73('0x2c')]={};this['queueBookedRR']={};ami['on'](_0xad73('0x2d'),this[_0xad73('0x2e')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x30'),this[_0xad73('0x31')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x32'),this[_0xad73('0x33')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x34'),this[_0xad73('0x35')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x36'),this[_0xad73('0x37')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x38'),this[_0xad73('0x39')][_0xad73('0x2f')](this));ami['on'](_0xad73('0x3a'),this[_0xad73('0x3b')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xad73('0x2f')](this));ami['on'](_0xad73('0x3c'),this['syncQueueMember'][_0xad73('0x2f')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xad73('0x2f')](this));this[_0xad73('0x3d')]();this[_0xad73('0x3e')]();}function isNotNull(_0x428dec){return _0x428dec!==null&&!_['isUndefined'](_0x428dec);}function checkIsLoggedIn(_0xdf45e8,_0x3fab83){return function(){if(_0x3fab83<=0x0){_0xdf45e8[_0xad73('0x3f')]='AGENTS_NOT_LOGGED';throw _0xdf45e8[_0xad73('0x40')]+_0xad73('0x41');}};}function isActive(_0xe63ff8){return _0xe63ff8;}function checkIsActive(_0x1ddeec,_0x6cc7dc){return function(){if(!isActive(_0x6cc7dc)){_0x1ddeec['message']='NOT_ACTIVE';throw _0x1ddeec['name']+_0xad73('0x42');}};}function checkInterval(_0x54d8fe){return function(){if(!isNotNull(_0x54d8fe[_0xad73('0x43')])){_0x54d8fe['message']=_0xad73('0x44');throw _0x54d8fe[_0xad73('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x54d8fe['Interval'][_0xad73('0x45')])){_0x54d8fe[_0xad73('0x3f')]='INTERVAL_IS_NULL';throw _0x54d8fe['name']+_0xad73('0x46');}if(!isNotNull(_['isEmpty'](_0x54d8fe[_0xad73('0x43')][_0xad73('0x45')]))){_0x54d8fe['message']=_0xad73('0x44');throw _0x54d8fe['name']+_0xad73('0x46');}};}function msgResponse(_0x4c0f8b,_0x41f470,_0x430578){return{'action':_0x4c0f8b,'response':_0x41f470,'message':_0x430578,'stack':_0x430578};}function myreject(_0x2e7cf6){return function(_0xb96ed5){return _0x2e7cf6(msgResponse(_0xad73('0x47'),_0xad73('0x48'),JSON[_0xad73('0x49')](_0xb96ed5)));};}function getSeconds(_0x4cb85b,_0x37e863){var _0x3db333=moment(_0x4cb85b)['milliseconds'](0x0);var _0x221d3d=moment(_0x37e863)[_0xad73('0x4a')](0x0);return _0x3db333[_0xad73('0x4b')](_0x221d3d,_0xad73('0x4c'));}function emit(_0x45210f,_0x21fa48,_0x2b2f7d){io['to'](_0x45210f)[_0xad73('0x4d')](_0x21fa48,_0x2b2f7d);}function emitVoiceQueueSummary(_0x18e9ec){if(_0x18e9ec['type']===_0xad73('0x4e')){var _0x390c2a={'id':_0x18e9ec['id'],'name':_0x18e9ec[_0xad73('0x40')],'strategy':_0x18e9ec['strategy'],'answered':_0x18e9ec['answered'],'available':_0x18e9ec[_0xad73('0x4f')],'loggedIn':_0x18e9ec['loggedIn'],'pTalking':_0x18e9ec['pTalking'],'sumBillable':_0x18e9ec[_0xad73('0x50')],'sumDuration':_0x18e9ec[_0xad73('0x51')],'sumHoldTime':_0x18e9ec[_0xad73('0x52')]||0x0,'talking':_0x18e9ec[_0xad73('0x53')],'total':_0x18e9ec['total'],'type':_0x18e9ec[_0xad73('0x54')],'unmanaged':_0x18e9ec[_0xad73('0x55')],'abandoned':_0x18e9ec['abandoned'],'waiting':_0x18e9ec[_0xad73('0x56')],'loggedInDb':_0x18e9ec[_0xad73('0x57')],'dialActive':_0x18e9ec['dialActive'],'dialMethod':_0x18e9ec[_0xad73('0x58')],'dialOriginateCallerIdName':_0x18e9ec[_0xad73('0x59')],'dialOriginateCallerIdNumber':_0x18e9ec[_0xad73('0x5a')],'dialOriginateTimeout':_0x18e9ec['dialOriginateTimeout'],'dialPrefix':_0x18e9ec[_0xad73('0x5b')],'outboundAnswerAgiCallsDay':_0x18e9ec[_0xad73('0x5c')],'outboundAnswerCallsDay':_0x18e9ec[_0xad73('0x5d')],'outboundBlacklistCallsDay':_0x18e9ec[_0xad73('0x5e')],'outboundBusyCallsDay':_0x18e9ec[_0xad73('0x5f')],'outboundCongestionCallsDay':_0x18e9ec['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x18e9ec['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x18e9ec['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x18e9ec[_0xad73('0x60')],'outboundNoAnswerCallsDay':_0x18e9ec[_0xad73('0x61')],'outboundNoSuchCallsDay':_0x18e9ec[_0xad73('0x62')],'outboundOriginateFailureCallsDay':_0x18e9ec[_0xad73('0x63')],'outboundReCallsDay':_0x18e9ec[_0xad73('0x64')],'outboundRejectCallsDay':_0x18e9ec[_0xad73('0x65')],'outboundUnknownCallsDay':_0x18e9ec[_0xad73('0x66')],'predictiveIntervalAnsweredCalls':_0x18e9ec['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x18e9ec[_0xad73('0x67')],'predictiveIntervalAvgTalktime':_0x18e9ec[_0xad73('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x18e9ec['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x18e9ec['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x18e9ec[_0xad73('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x18e9ec[_0xad73('0x6a')],'predictiveIntervalHitRate':_0x18e9ec[_0xad73('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x18e9ec[_0xad73('0x6c')],'predictiveIntervalPauses':_0x18e9ec['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x18e9ec[_0xad73('0x6d')],'predictiveIntervalTotalCalls':_0x18e9ec[_0xad73('0x6e')],'message':_0x18e9ec[_0xad73('0x3f')],'originated':_0x18e9ec['originated'],'erlangCalls':_0x18e9ec[_0xad73('0x6f')],'erlangCallToSecond':_0x18e9ec[_0xad73('0x70')],'erlangAbandonmentRate':_0x18e9ec[_0xad73('0x71')],'erlangBusyFactor':_0x18e9ec[_0xad73('0x72')],'startPredictive':_0x18e9ec['startPredictive'],'startProgressive':_0x18e9ec['startProgressive']};if(_0x18e9ec[_0xad73('0x73')]){_0x390c2a[_0xad73('0x73')]={'id':_0x18e9ec[_0xad73('0x73')]['id'],'name':_0x18e9ec[_0xad73('0x73')][_0xad73('0x40')],'active':_0x18e9ec[_0xad73('0x73')][_0xad73('0x74')],'callerid':_0x18e9ec[_0xad73('0x73')][_0xad73('0x75')]};}if(_0x18e9ec['Interval']){_0x390c2a['Interval']={'id':_0x18e9ec[_0xad73('0x43')]['id'],'name':_0x18e9ec[_0xad73('0x43')][_0xad73('0x40')]};}var _0x5b6e41=md5(JSON[_0xad73('0x49')](_0x390c2a));if(_0x18e9ec[_0xad73('0x76')]!==_0x5b6e41){_0x18e9ec[_0xad73('0x76')]=_0x5b6e41;emit(util[_0xad73('0x77')]('voice:queue:%s',_0x390c2a[_0xad73('0x40')]),_0xad73('0x78'),_0x390c2a);}}}function emitCampaignSummary(_0x2d3c38){if(_0x2d3c38['type']===_0xad73('0x79')){emit(util[_0xad73('0x77')](_0xad73('0x7a'),_0x2d3c38[_0xad73('0x40')]),'campaign:save',_0x2d3c38);}}function checkGetDataPredictive(_0x49d91d){if(isNotNull(_0x49d91d)&&!_[_0xad73('0x7b')](_0x49d91d)){loggerPredictive[_0xad73('0x7c')](_0xad73('0x7d'));loggerPredictive['info'](_0xad73('0x7e'),_0x49d91d[_0xad73('0x6e')]);loggerPredictive[_0xad73('0x7c')](_0xad73('0x7f'),_0x49d91d[_0xad73('0x80')]);loggerPredictive[_0xad73('0x7c')](_0xad73('0x81'),_0x49d91d[_0xad73('0x82')]);loggerPredictive['info'](_0xad73('0x83'),_0x49d91d['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xad73('0x7c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49d91d['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xad73('0x7c')](_0xad73('0x84'),_0x49d91d['predictiveIntervalAvgTalktime']);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));if(_0x49d91d[_0xad73('0x6e')]>0x0){if(!_[_0xad73('0x86')](_0x49d91d[_0xad73('0x68')])&&_0x49d91d[_0xad73('0x68')]>0x0){return!![];}loggerPredictive[_0xad73('0x7c')](_0xad73('0x87'));if(!_[_0xad73('0x86')](_0x49d91d[_0xad73('0x67')])&&_0x49d91d['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xad73('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xad73('0x7c')](_0xad73('0x88'));}}else{loggerPredictive[_0xad73('0x7c')](_0xad73('0x89'));}return![];}function mergeDataErlangB(_0x4a73d1){return function(_0x404a21){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xad73('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404a21[_0xad73('0x6f')]);loggerPredictive['info'](_0xad73('0x8a'),_0x404a21[_0xad73('0x70')]);loggerPredictive[_0xad73('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404a21[_0xad73('0x71')]);loggerPredictive[_0xad73('0x7c')](_0xad73('0x8b'),_0x404a21['erlangBusyFactor']);loggerPredictive[_0xad73('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x404a21['erlangAbandonmentRate']);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));_['merge'](_0x4a73d1,_0x404a21);};}function getDiff(_0x581a82){var _0x2fc49a=moment()[_0xad73('0x4a')](0x0);var _0x5adba1=moment(_0x581a82)['milliseconds'](0x0);return _0x2fc49a[_0xad73('0x4b')](_0x5adba1,_0xad73('0x4c'));}function ifInterval(_0x3c90e0,_0x1177d6){if(_[_0xad73('0x86')](_0x1177d6)){return![];}return getDiff(_0x1177d6)<_0x3c90e0*0x3c;}function freeVariablesPredictive(_0x58899e){if(isNotNull(_0x58899e)){if(!_['isUndefined'](_0x58899e[_0xad73('0x2a')])){_0x58899e[_0xad73('0x2a')]=undefined;loggerPredictive[_0xad73('0x7c')](_0x58899e[_0xad73('0x40')],_0xad73('0x8c'));}if(!_[_0xad73('0x86')](_0x58899e[_0xad73('0x29')])){_0x58899e[_0xad73('0x29')]=undefined;loggerPredictive[_0xad73('0x7c')](_0x58899e[_0xad73('0x40')],_0xad73('0x8d'));}if(!_['isUndefined'](_0x58899e[_0xad73('0x8e')])){clearInterval(_0x58899e[_0xad73('0x8e')]);_0x58899e[_0xad73('0x8e')]=undefined;loggerPredictive[_0xad73('0x7c')](_0x58899e[_0xad73('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4e10d5,_0x441f49){if(_0x441f49===0x0){return 0x0;}var _0x30f659=0x1;for(var _0x29662f=0x1;_0x29662f<=_0x441f49;_0x29662f+=0x1){_0x30f659=0x1+_0x30f659*_0x29662f/_0x4e10d5;}return 0x1/_0x30f659;}function isVoiceQueueOutbound(_0x394978){return _0x394978===_0xad73('0x4e');}function isNotPreview(_0x1fa90f){return _0x1fa90f!==_0xad73('0x1f');}function isCampaignIvr(_0x3d8ae2){return _0x3d8ae2===_0xad73('0x79');}function getCallerId(_0xcf6163,_0x130544,_0x4e543f){if(!_[_0xad73('0x86')](_0x4e543f)&&typeof _0x4e543f===_0xad73('0x8f')&&!_[_0xad73('0x7b')](_0x4e543f)){if(!_[_0xad73('0x86')](_0x130544)&&typeof _0x130544===_0xad73('0x8f')&&!_[_0xad73('0x7b')](_0x130544)){return util[_0xad73('0x77')]('\x22%s\x22\x20<%s>',_0x130544,_0x4e543f);}return util[_0xad73('0x77')](_0xad73('0x90'),_0x4e543f,_0x4e543f);}if(!_[_0xad73('0x86')](_0xcf6163)&&typeof _0xcf6163===_0xad73('0x8f')&&!_[_0xad73('0x7b')](_0xcf6163)){return _0xcf6163;}return _0xad73('0x91');}function loggerCatchQueueSummary(_0x50002b,_0x356100){return function(_0x2444ad){freeVariablesPredictive(_0x356100);emitVoiceQueueSummary(_0x356100);emitCampaignSummary(_0x356100);loggerSyncQueueSummary[_0xad73('0x92')](_0x50002b,util[_0xad73('0x93')](_0x2444ad,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x255011,_0x585c76){return function(_0x3741cb){loggerPredictive[_0xad73('0x92')](_0x585c76[_0xad73('0x40')],_0x255011);loggerPredictive[_0xad73('0x92')](_0x3741cb[_0xad73('0x94')]);freeVariablesPredictive(_0x585c76);};}function loggerCatch(_0x6c438){return function(_0x58c8ad){logger[_0xad73('0x92')](_0x6c438,util[_0xad73('0x93')](_0x58c8ad,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x362401){return _0x362401&&!_[_0xad73('0x86')](_0x362401)&&_0x362401[_0xad73('0x95')]>0x0;}function decremetOriginate(_0xec1025){if(!_[_0xad73('0x86')](_0xec1025)&&_0xec1025!==null){if(typeof _0xec1025[_0xad73('0x96')]!=='undefined'){if(_0xec1025[_0xad73('0x96')]>0x0){_0xec1025['originated']-=0x1;}else{logger[_0xad73('0x92')](_0xad73('0x97'));}}}else{logger[_0xad73('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2f9958,_0x2f33f9,_0x28259f){if(_0x2f33f9>_0x28259f){for(var _0x4f650f=0x0;_0x4f650f<_0x2f33f9-_0x28259f;_0x4f650f+=0x1){decremetOriginate(_0x2f9958);}}}function loggerGetContactDialer(_0xc7b161,_0xe1f948,_0x2fb2fc){return function(_0x340fce){checkContactLowerLimitOriginate(_0xe1f948,_0x2fb2fc,0x0);logger[_0xad73('0x92')](_0xc7b161,util['inspect'](_0x340fce,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x6131d){return function(_0x3341ea){if(isNotNull(_0x3341ea)&&isNotNull(_0x3341ea[0x0])){if(_0x3341ea[0x0][_0xad73('0x98')]>0x0){_0x6131d['message']=_0xad73('0x99');logger[_0xad73('0x7c')](_0xad73('0x9a')+_0x6131d[_0xad73('0x40')],_0x3341ea[0x0][_0xad73('0x98')],_0xad73('0x9b'));}else{_0x6131d[_0xad73('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xad73('0x7c')]('[getContactDialer2][Empty]'+_0x6131d[_0xad73('0x40')]);}}};}function notSendMessagesQueue(_0x2d823a){if(_0x2d823a[_0xad73('0x9c')]){freeVariablesPredictive(_0x2d823a);if(_0x2d823a[_0xad73('0x96')]===0x0&&_0x2d823a[_0xad73('0x53')]===0x0&&_0x2d823a[_0xad73('0x56')]===0x0&&(_0x2d823a[_0xad73('0x9d')]||0x0)===0x0){_0x2d823a['sendMessageOneNotActive']=![];_0x2d823a[_0xad73('0x4f')]=0x0;_0x2d823a[_0xad73('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xad73('0x92')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2d823a[_0xad73('0x40')],_0xad73('0x9e'));}else{_0x2d823a[_0xad73('0x3f')]=_0xad73('0x9f');loggerSyncQueueSummary[_0xad73('0x92')](_0xad73('0xa0'),_0x2d823a[_0xad73('0x40')],_0xad73('0xa1'));}emitVoiceQueueSummary(_0x2d823a);}}function notSendMessagesCampaign(_0x2d5321){if(_0x2d5321[_0xad73('0x9c')]){if(_0x2d5321[_0xad73('0x96')]===0x0){_0x2d5321['sendMessageOneNotActive']=![];_0x2d5321['message']=_0xad73('0xa2');loggerSyncQueueSummary[_0xad73('0x92')](_0xad73('0xa3'),_0x2d5321[_0xad73('0x40')],_0xad73('0x9e'));}else{_0x2d5321[_0xad73('0x3f')]=_0xad73('0x9f');loggerSyncQueueSummary[_0xad73('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2d5321['name'],_0xad73('0xa1'));}emitCampaignSummary(_0x2d5321);}}function createObjHistory(_0x570eda,_0x488b1d,_0x5833fd,_0x6ec611,_0x13b1e4){_0x570eda[_0xad73('0x3f')]=_0x5833fd;var _0x339b1e=new Action(_0x570eda,_0x488b1d);var _0x329d83=new History(_0x339b1e);_0x329d83[_0xad73('0xa4')]=_0x6ec611;_0x329d83[_0xad73('0xa5')]=_0x13b1e4;_0x329d83['endtime']=_0x339b1e[_0xad73('0xa6')];return _0x329d83;}Dialer[_0xad73('0x1b')][_0xad73('0x3e')]=function(){var _0x243db2=this;setInterval(function(){_0x243db2[_0xad73('0xa7')](_0x243db2['uniqueId'],_0xad73('0xa8'));_0x243db2[_0xad73('0xa7')](_0x243db2[_0xad73('0xa9')],_0xad73('0xaa'));},0x32c8);};Dialer['prototype'][_0xad73('0xa7')]=function(_0x56f3ea,_0x2389d4){var _0x239c62=this;for(var _0x4e1a69 in _0x56f3ea){if(typeof _0x56f3ea[_0x4e1a69]!=='undefined'){this[_0xad73('0x1e')][_0xad73('0xab')](function(){if(!_[_0xad73('0xac')](_0x56f3ea[_0x4e1a69])){return ami['Action']({'action':_0xad73('0xad'),'channel':_0x56f3ea[_0x4e1a69]['channel']})[_0xad73('0xae')](function(_0x1a0ebd){if(_0x1a0ebd[_0xad73('0x3f')]===_0xad73('0xaf')){setTimeout(function(){if(_0x56f3ea[_0x4e1a69]&&_0x56f3ea[_0x4e1a69]['type']!==_0xad73('0x79')){_0x239c62[_0xad73('0xb0')](_0x239c62[_0xad73('0x20')][_0x56f3ea[_0x4e1a69]['queue']]);logger[_0xad73('0x92')](_0xad73('0xb1'),_0x2389d4,_0x4e1a69,_0x56f3ea[_0x4e1a69]['queue']);delete _0x56f3ea[_0x4e1a69];}if(_0x56f3ea[_0x4e1a69]&&_0x56f3ea[_0x4e1a69]['type']==='ivr'){_0x239c62[_0xad73('0xb0')](_0x239c62[_0xad73('0x21')][_0x56f3ea[_0x4e1a69][_0xad73('0xb2')]]);logger[_0xad73('0x92')](_0xad73('0xb3'),_0x2389d4,_0x4e1a69,_0x56f3ea[_0x4e1a69]['queue']);delete _0x56f3ea[_0x4e1a69];}},0x2328);}});}});}}};Dialer[_0xad73('0x1b')][_0xad73('0xb4')]=function(_0x4ae716){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xb4')](_0x4ae716))['catch'](loggerCatch(_0xad73('0xb7')));};Dialer[_0xad73('0x1b')]['checkIsBlackList']=function(_0x4375dd){return BPromise[_0xad73('0xb5')]()['then'](cmHopperBlack['checkIsBlackList'](_0x4375dd))['catch'](loggerCatch(_0xad73('0xb8')));};Dialer[_0xad73('0x1b')][_0xad73('0xb9')]=function(_0x424682){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopperBlack['checkIsBlackListIvr'](_0x424682))[_0xad73('0xae')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x294c5e){return BPromise[_0xad73('0xb5')]()['then'](cmHopperHistory[_0xad73('0xba')](_0x294c5e))[_0xad73('0xae')](loggerCatch(_0xad73('0xbb')));};Dialer[_0xad73('0x1b')][_0xad73('0xbc')]=function(_0x1f3113){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xbc')](_0x1f3113))[_0xad73('0xae')](loggerCatch(_0xad73('0xbd')));};Dialer['prototype'][_0xad73('0xbe')]=function(_0x1cb68e,_0x5c0fa6,_0x5db32d){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xbe')](_0x1cb68e,_0x5c0fa6,_0x5db32d))[_0xad73('0xae')](loggerCatch(_0xad73('0xbf')));};Dialer['prototype']['getContactDialer']=function(_0x311bf9,_0x193f73,_0x5c0ddc,_0x1715d3,_0x570e02){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper['getContactDialer'](_0x311bf9,_0x193f73,_0x5c0ddc,_0x1715d3))['catch'](function(_0x1930f1){_0x570e02[_0xad73('0xc0')]-=_0x5c0ddc;_0x570e02[_0xad73('0xc0')]=_0x570e02['temp']>0x0?_0x570e02[_0xad73('0xc0')]:0x0;loggerCatch(_0xad73('0xc1'))(_0x1930f1);});};Dialer[_0xad73('0x1b')]['getContactDialerIvr']=function(_0x49f647,_0x32df0f,_0x29fbad,_0x3ea944){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xc2')](_0x49f647,_0x32df0f,_0x29fbad))[_0xad73('0xae')](function(_0xa2f743){_0x3ea944['temp']-=_0x32df0f;_0x3ea944['temp']=_0x3ea944[_0xad73('0xc0')]>0x0?_0x3ea944[_0xad73('0xc0')]:0x0;loggerCatch(_0xad73('0xc3'))(_0xa2f743);});};Dialer[_0xad73('0x1b')][_0xad73('0xc4')]=function(_0x451146){return BPromise['resolve']()[_0xad73('0xb6')](voiceQueueRt[_0xad73('0xc4')](_0x451146))['catch'](loggerCatch(_0xad73('0xc5')));};Dialer[_0xad73('0x1b')][_0xad73('0xc6')]=function(_0x17b487){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopper[_0xad73('0xc6')](_0x17b487))[_0xad73('0xae')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xad73('0x1b')][_0xad73('0xc7')]=function(_0x518dca){return BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](cmHopperHistory[_0xad73('0xc7')](_0x518dca))[_0xad73('0xae')](loggerCatch(_0xad73('0xc8')));};Dialer['prototype'][_0xad73('0xb0')]=function(_0x1a9ad0){if(!_['isUndefined'](_0x1a9ad0)&&_0x1a9ad0!==null){if(typeof _0x1a9ad0[_0xad73('0x96')]!==_0xad73('0xc9')){if(_0x1a9ad0['originated']>0x0){_0x1a9ad0[_0xad73('0x96')]-=0x1;}else{logger['error'](_0xad73('0xca'));}}}else{logger[_0xad73('0x92')](_0xad73('0xcb'));}};Dialer['prototype'][_0xad73('0xcc')]=function(_0x1b87ef,_0x59bac4){var _0x222498=this;return function(_0x1befe0){_0x222498[_0xad73('0xb0')](_0x59bac4);logger[_0xad73('0x92')](_0x1b87ef,util['inspect'](_0x1befe0,{'showHidden':![],'depth':null}));};};Dialer[_0xad73('0x1b')][_0xad73('0xcd')]=function(_0x3930e1,_0x3ef100,_0x3a058f){var _0x195f6a={'state':0x19,'statedesc':'notFound'};this[_0xad73('0xb0')](_0x3ef100);this[_0xad73('0xce')](_[_0xad73('0xcf')](_0x195f6a,_[_0xad73('0xd0')](_0x3a058f,[_0xad73('0xd1'),_0xad73('0xd2'),_0xad73('0xd3'),'VoiceQueueId',_0xad73('0xd4')])),_0xad73('0xd5'),'[emptyContact]');logger[_0xad73('0x92')](_0x3930e1);};Dialer['prototype'][_0xad73('0xd6')]=function(_0x434250){return _0x434250==='Success';};Dialer[_0xad73('0x1b')][_0xad73('0xd7')]=function(_0x34db8b){return!_[_0xad73('0x86')](_0x34db8b)&&_0x34db8b&&!_[_0xad73('0x86')](_0x34db8b[_0xad73('0x40')])&&!_[_0xad73('0x86')](_0x34db8b['active'])&&_0x34db8b[_0xad73('0x74')]&&(this[_0xad73('0x23')][util[_0xad73('0x77')](_0xad73('0xd8'),_0x34db8b['name'])][_0xad73('0xad')]===_0xad73('0xd9')||this['trunks'][util[_0xad73('0x77')](_0xad73('0xd8'),_0x34db8b[_0xad73('0x40')])][_0xad73('0xad')]===_0xad73('0xda'));};Dialer[_0xad73('0x1b')][_0xad73('0xce')]=function(_0x29e4f1,_0x309f9d,_0x26eac9){this[_0xad73('0xc7')](_0x29e4f1)['catch'](loggerCatch(_0x309f9d));this[_0xad73('0xc6')](_0x29e4f1)[_0xad73('0xae')](loggerCatch(_0x26eac9));};Dialer[_0xad73('0x1b')][_0xad73('0xdb')]=function(_0x15ca6b){var _0x5a5310=this[_0xad73('0x27')][_0x15ca6b['uniqueid']];var _0x4691bd;if(!_['isNil'](_0x15ca6b)&&!_['isNil'](_0x15ca6b[_0xad73('0xdc')])&&!_[_0xad73('0xac')](_0x15ca6b[_0xad73('0xdc')]['amdstatus'])&&_0x15ca6b[_0xad73('0xdd')]==='xcally-motion-dialer'&&_0x5a5310){if(_0x5a5310['type']!=='ivr'&&this['voiceQueues'][_0x5a5310['queue']][_0xad73('0xde')]&&_0x15ca6b['value']==='HANGUP'){delete this[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];this['updateOriginated'](this[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]]);this['voiceQueues'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;this[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5c')]+=0x1;_0x4691bd=new Hangup(_0x5a5310,_0x15ca6b);_0x4691bd['state']=0x12;_0x4691bd[_0xad73('0xa5')]=_0xad73('0xe0');_0x4691bd['membername']=_0xad73('0xe1');ami['emit'](_0xad73('0xe2'),ut['buildObj'](_0x4691bd,_0xad73('0xe3')));this[_0xad73('0xce')](_0x4691bd,_0xad73('0xe4'),'[syncHangupInAMD]');}if(_0x5a5310[_0xad73('0x54')]!==_0xad73('0x79')&&this['voiceQueues'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0xde')]&&_0x15ca6b[_0xad73('0xe5')]==='MACHINE'){var _0x5ed223=this;return new BPromise(function(_0x2cbdbf,_0x404a2a){delete _0x5ed223[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];_0x5ed223['updateOriginated'](_0x5ed223[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]]);_0x5ed223[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;_0x5ed223['voiceQueues'][_0x5a5310[_0xad73('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x516e14=_0x5ed223[_0xad73('0x20')][_0x5a5310[_0xad73('0xb2')]];var _0x1afb8c=new Hangup(_0x5a5310,_0x15ca6b);_0x1afb8c[_0xad73('0xa4')]=0x13;_0x1afb8c[_0xad73('0xa5')]='Machine';_0x1afb8c['membername']=_0xad73('0xe1');_0x1afb8c[_0xad73('0xe6')]+=0x1;_0x1afb8c[_0xad73('0xe7')]+=0x1;_0x1afb8c[_0xad73('0xe3')]=!![];ami[_0xad73('0x4d')]('custom:amd',ut[_0xad73('0xe8')](_0x1afb8c,_0xad73('0xe3')));_0x5ed223[_0xad73('0xc7')](_0x1afb8c)[_0xad73('0xae')](loggerCatch(_0xad73('0xe9')));if(_0x1afb8c['countbusyretry']+_0x1afb8c[_0xad73('0xea')]+_0x1afb8c[_0xad73('0xeb')]+_0x1afb8c[_0xad73('0xec')]+_0x1afb8c[_0xad73('0xed')]+_0x1afb8c[_0xad73('0xee')]+_0x1afb8c[_0xad73('0xe6')]+_0x1afb8c[_0xad73('0xef')]>=_0x516e14[_0xad73('0xf0')]){_0x5ed223[_0xad73('0xf1')](_0x1afb8c,_0x2cbdbf,_0x404a2a,_0xad73('0xf2'));}else{if(_0x1afb8c['countmachineretry']>=_0x516e14[_0xad73('0xf3')]){_0x5ed223[_0xad73('0xf4')](_0x1afb8c,_0x2cbdbf,_0x404a2a,'reason\x2019\x20machine....');}else{_0x5ed223[_0xad73('0xbc')]({'active':![],'countmachineretry':_0x1afb8c[_0xad73('0xe6')],'scheduledat':moment()[_0xad73('0xf5')](_0x516e14[_0xad73('0xf6')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x1afb8c[_0xad73('0xd1')],'ListId':_0x1afb8c[_0xad73('0xd2')],'VoiceQueueId':_0x1afb8c['VoiceQueueId']||undefined,'CampaignId':_0x1afb8c[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0xf9')));_0x2cbdbf({'reschedule':0x1});}}});}if(_0x5a5310[_0xad73('0x54')]===_0xad73('0x79')&&this['campaigns'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0xde')]&&_0x15ca6b[_0xad73('0xe5')]==='HANGUP'){delete this[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];this[_0xad73('0xb0')](this['campaigns'][_0x5a5310['queue']]);_0x4691bd=new Hangup(_0x5a5310,_0x15ca6b);_0x4691bd['state']=0x12;_0x4691bd[_0xad73('0xa5')]=_0xad73('0xe0');_0x4691bd[_0xad73('0xfa')]=_0xad73('0xe1');ami[_0xad73('0x4d')]('custom:amd',ut['buildObj'](_0x4691bd,_0xad73('0xe3')));this['saveInDb'](_0x4691bd,_0xad73('0xfb'),_0xad73('0xfc'));}if(_0x5a5310[_0xad73('0x54')]==='ivr'&&this['campaigns'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0xde')]&&_0x15ca6b['value']===_0xad73('0xfd')){var _0x5ed223=this;return new BPromise(function(_0x10f3ac,_0x17b014){delete _0x5ed223[_0xad73('0x27')][_0x15ca6b[_0xad73('0xdf')]];_0x5ed223[_0xad73('0xb0')](_0x5ed223[_0xad73('0x21')][_0x5a5310[_0xad73('0xb2')]]);_0x5ed223['campaigns'][_0x5a5310[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;_0x5ed223[_0xad73('0x21')][_0x5a5310['queue']][_0xad73('0x5c')]+=0x1;var _0x27c18c=_0x5ed223[_0xad73('0x21')][_0x5a5310[_0xad73('0xb2')]];var _0x74a682=new Hangup(_0x5a5310,_0x15ca6b);_0x74a682[_0xad73('0xa4')]=0x13;_0x74a682['statedesc']=_0xad73('0xfe');_0x74a682[_0xad73('0xfa')]='AMD';_0x74a682[_0xad73('0xe6')]+=0x1;_0x74a682[_0xad73('0xe7')]+=0x1;_0x74a682[_0xad73('0xe3')]=!![];ami[_0xad73('0x4d')](_0xad73('0xe2'),ut[_0xad73('0xe8')](_0x74a682,_0xad73('0xe3')));_0x5ed223[_0xad73('0xc7')](_0x74a682)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x74a682[_0xad73('0xff')]+_0x74a682[_0xad73('0xea')]+_0x74a682['countnoanswerretry']+_0x74a682[_0xad73('0xec')]+_0x74a682[_0xad73('0xed')]+_0x74a682[_0xad73('0xee')]+_0x74a682[_0xad73('0xe6')]+_0x74a682[_0xad73('0xef')]>=_0x27c18c['dialGlobalMaxRetry']){_0x5ed223[_0xad73('0xf1')](_0x74a682,_0x10f3ac,_0x17b014,_0xad73('0xf2'));}else{if(_0x74a682[_0xad73('0xe6')]>=_0x27c18c['dialMachineMaxRetry']){_0x5ed223[_0xad73('0xf4')](_0x74a682,_0x10f3ac,_0x17b014,'reason\x2019\x20machine....');}else{_0x5ed223[_0xad73('0xbc')]({'active':![],'countmachineretry':_0x74a682[_0xad73('0xe6')],'scheduledat':moment()[_0xad73('0xf5')](_0x27c18c['dialMachineRetryFrequency'],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x74a682['ContactId'],'ListId':_0x74a682[_0xad73('0xd2')],'VoiceQueueId':_0x74a682['VoiceQueueId']||undefined,'CampaignId':_0x74a682[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0xf9')));_0x10f3ac({'reschedule':0x1});}}});}}};Dialer[_0xad73('0x1b')][_0xad73('0x39')]=function(_0x4aabc2){var _0x4e3dc4=this[_0xad73('0x27')][_0x4aabc2[_0xad73('0xdf')]];var _0x62c5e1=this;var _0xaeeeb6;if(_0x4e3dc4&&_0x4e3dc4['type']==='ivr'){delete this['uniqueId'][_0x4aabc2['uniqueid']];this[_0xad73('0xb0')](this[_0xad73('0x21')][_0x4e3dc4['queue']]);this[_0xad73('0x21')][_0x4e3dc4['queue']][_0xad73('0x100')]+=0x1;_0xaeeeb6=new Hangup(_0x4e3dc4,_0x4aabc2);this[_0xad73('0xc7')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xad73('0xc6')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch(_0xad73('0x101')));}if(_0x4e3dc4&&_0x4e3dc4[_0xad73('0x54')]!==_0xad73('0x79')&&isNotNull(this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]]['dialQueueProject'])){delete this[_0xad73('0x27')][_0x4aabc2[_0xad73('0xdf')]];this[_0xad73('0xb0')](this[_0xad73('0x20')][_0x4e3dc4['queue']]);this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;this['voiceQueues'][_0x4e3dc4[_0xad73('0xb2')]][_0xad73('0x5c')]+=0x1;_0xaeeeb6=new Hangup(_0x4e3dc4,_0x4aabc2);_0xaeeeb6[_0xad73('0xa4')]=0x10;_0xaeeeb6[_0xad73('0xa5')]=_0xad73('0x102');_0xaeeeb6[_0xad73('0xfa')]=_0xad73('0x103');this[_0xad73('0xc7')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xad73('0xc6')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch(_0xad73('0x101')));}if(_0x4e3dc4&&_0x4e3dc4[_0xad73('0x54')]!==_0xad73('0x79')&&!isNotNull(this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]]['dialQueueProject'])){delete this[_0xad73('0x27')][_0x4aabc2[_0xad73('0xdf')]];this[_0xad73('0xb0')](this[_0xad73('0x20')][_0x4e3dc4[_0xad73('0xb2')]]);this[_0xad73('0x20')][_0x4e3dc4['queue']][_0xad73('0x66')]+=0x1;_0xaeeeb6=new Hangup(_0x4e3dc4,_0x4aabc2);_0xaeeeb6[_0xad73('0xa4')]=0xc;_0xaeeeb6['statedesc']=_0x4aabc2[_0xad73('0x104')];_0xaeeeb6['membername']='Unknow';this['createHistory'](_0xaeeeb6)['catch'](loggerCatch(_0xad73('0x105')));this[_0xad73('0xc6')](_0xaeeeb6)[_0xad73('0xae')](loggerCatch(_0xad73('0x101')));}};Dialer[_0xad73('0x1b')][_0xad73('0x35')]=function(_0x149485){var _0x552802=this[_0xad73('0x27')][_0x149485['uniqueid']];var _0x2b6370=this;if(this['voiceQueues'][_0x149485[_0xad73('0xb2')]]){if(_0x552802&&_0x552802[_0xad73('0x54')]!==_0xad73('0x79')){delete this[_0xad73('0x27')][_0x149485[_0xad73('0xdf')]];this[_0xad73('0x20')][_0x149485[_0xad73('0xb2')]][_0xad73('0x5d')]+=0x1;var _0x4aa571=new AgentComplete(_0x552802,_0x149485);if(_0x149485[_0xad73('0x106')]===_0xad73('0x107')){_0x4aa571[_0xad73('0x108')]=this[_0xad73('0x20')][_0x149485[_0xad73('0xb2')]][_0xad73('0x109')]&&this[_0xad73('0x20')][_0x149485[_0xad73('0xb2')]][_0xad73('0x10a')]?moment()['format'](_0xad73('0xf8')):undefined;}this['createHistory'](_0x4aa571)[_0xad73('0xae')](loggerCatch(_0xad73('0x10b')));this[_0xad73('0xc6')](_0x4aa571)['catch'](loggerCatch(_0xad73('0x10c')));}}};Dialer[_0xad73('0x1b')][_0xad73('0x2e')]=function(_0x5147ca){if(this[_0xad73('0x20')][_0x5147ca[_0xad73('0xb2')]]){if(this[_0xad73('0x27')][_0x5147ca[_0xad73('0xdf')]]&&this[_0xad73('0x27')][_0x5147ca[_0xad73('0xdf')]][_0xad73('0x54')]!=='ivr'){this['updateOriginated'](this[_0xad73('0x20')][_0x5147ca[_0xad73('0xb2')]]);this[_0xad73('0x27')][_0x5147ca[_0xad73('0xdf')]][_0xad73('0x10d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xad73('0x10e')]=function(_0x39a49c){this[_0xad73('0xc7')](_0x39a49c)[_0xad73('0xae')](loggerCatch(_0xad73('0x10b')));this['moveContactManagedDialer'](_0x39a49c)[_0xad73('0xae')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xad73('0x1b')][_0xad73('0x31')]=function(_0x35324f){var _0x1875bb=this[_0xad73('0x27')][_0x35324f[_0xad73('0xdf')]];var _0x59327f=this;if(this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]){if(_0x1875bb&&_0x1875bb[_0xad73('0x54')]!=='ivr'){delete this[_0xad73('0x27')][_0x35324f[_0xad73('0xdf')]];this[_0xad73('0xb0')](this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]);_0x1875bb[_0xad73('0x10f')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));var _0x259842=new QueueCallerAbandon(_0x1875bb,_0x35324f);if(getSeconds(_0x1875bb[_0xad73('0x10f')],_0x1875bb[_0xad73('0x110')])>=_0x1875bb['dialQueueTimeout']){this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xad73('0x20')][_0x35324f['queue']][_0xad73('0x6a')]+=0x1;_0x259842[_0xad73('0xa4')]=0xa;_0x259842[_0xad73('0xa5')]='Drop';_0x259842[_0xad73('0x111')]=_0xad73('0x112');_0x259842[_0xad73('0x108')]=this['voiceQueues'][_0x35324f[_0xad73('0xb2')]][_0xad73('0x109')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x259842['countdropretry']+=0x1;_0x259842[_0xad73('0xe7')]+=0x1;if(_0x259842[_0xad73('0xed')]>=this[_0xad73('0x20')][_0x35324f['queue']][_0xad73('0x113')]){this[_0xad73('0x10e')](_0x259842);}else{this[_0xad73('0xbc')]({'active':![],'countdropretry':_0x259842[_0xad73('0xed')],'scheduledat':moment()['add'](this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]][_0xad73('0x114')],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x1875bb[_0xad73('0xd1')],'ListId':_0x1875bb[_0xad73('0xd2')],'VoiceQueueId':_0x1875bb[_0xad73('0x115')]||undefined,'CampaignId':_0x1875bb['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x116')));var _0x5c22cc=new History(_0x259842);_0x5c22cc[_0xad73('0xa4')]=0xa;_0x5c22cc[_0xad73('0xa5')]=_0xad73('0x117');_0x5c22cc[_0xad73('0xa6')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));_0x5c22cc['endtime']=_0x5c22cc['starttime'];_0x5c22cc[_0xad73('0x118')]=_0x259842[_0xad73('0x118')];_0x5c22cc[_0xad73('0x119')]=_0x259842[_0xad73('0x119')];this['createHistory'](_0x5c22cc)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x35324f['queue']][_0xad73('0x11a')]+=0x1;_0x259842['state']=0xb;_0x259842[_0xad73('0xa5')]=_0xad73('0x11b');_0x259842[_0xad73('0x111')]=_0xad73('0x11c');_0x259842[_0xad73('0xee')]+=0x1;_0x259842['countglobal']+=0x1;if(_0x259842['countabandonedretry']>=this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]][_0xad73('0x11d')]){this[_0xad73('0x10e')](_0x259842);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x259842['countabandonedretry'],'scheduledat':moment()[_0xad73('0xf5')](this[_0xad73('0x20')][_0x35324f[_0xad73('0xb2')]][_0xad73('0x11e')],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x1875bb[_0xad73('0xd1')],'ListId':_0x1875bb[_0xad73('0xd2')],'VoiceQueueId':_0x1875bb['VoiceQueueId']||undefined,'CampaignId':_0x1875bb['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x11f')));var _0x5c22cc=new History(_0x259842);_0x5c22cc[_0xad73('0xa4')]=0xb;_0x5c22cc[_0xad73('0xa5')]=_0xad73('0x11b');_0x5c22cc[_0xad73('0xa6')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));_0x5c22cc['endtime']=_0x5c22cc[_0xad73('0xa6')];_0x5c22cc[_0xad73('0x118')]=_0x259842[_0xad73('0x118')];_0x5c22cc[_0xad73('0x119')]=_0x259842[_0xad73('0x119')];this['createHistory'](_0x5c22cc)[_0xad73('0xae')](loggerCatch(_0xad73('0x120')));}}}}};Dialer[_0xad73('0x1b')][_0xad73('0x3b')]=function(_0x367c89){if(this[_0xad73('0xa9')][_0x367c89['uniqueid']]){this[_0xad73('0xa9')][_0x367c89[_0xad73('0xdf')]][_0xad73('0x121')]=_0x367c89['channel'];}if(this[_0xad73('0x27')][_0x367c89[_0xad73('0xdf')]]){this['uniqueId'][_0x367c89['uniqueid']][_0xad73('0x121')]=_0x367c89[_0xad73('0x121')];}};Dialer[_0xad73('0x1b')][_0xad73('0x122')]=function(_0x272ab7){if(strategy[this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]]['queue']][_0xad73('0x124')]]===_0xad73('0x1a')){if(this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]]&&_[_0xad73('0xac')](this[_0xad73('0xa9')][_0x272ab7['actionid']][_0xad73('0x125')])&&_0x272ab7[_0xad73('0xad')]==='1'&&_0x272ab7[_0xad73('0x126')]==='0'){if(this[_0xad73('0x22')][_0x272ab7[_0xad73('0x127')]]){if(!this[_0xad73('0x22')][_0x272ab7[_0xad73('0x127')]][_0xad73('0x125')]){this[_0xad73('0x22')][_0x272ab7['stateinterface']][_0xad73('0x125')]=!![];this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0x125')]=!![];this[_0xad73('0xa9')][_0x272ab7['actionid']][_0xad73('0x127')]=_0x272ab7[_0xad73('0x127')];}}}}else if((strategy[this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0xb2')]][_0xad73('0x124')]]||_0xad73('0x19'))===_0xad73('0x19')){if(this['actions'][_0x272ab7[_0xad73('0x123')]]){if(this[_0xad73('0x22')][_0x272ab7['stateinterface']]){this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0x127')]=_0x272ab7[_0xad73('0x127')];if(_[_0xad73('0xac')](this['queueBooked'][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]][_0xad73('0xb2')]])){this['queueBooked'][this['actions'][_0x272ab7[_0xad73('0x123')]][_0xad73('0xb2')]]=[];}this[_0xad73('0x2c')][this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]]['queue']][_0xad73('0x128')](_['merge'](_[_0xad73('0xd0')](this[_0xad73('0xa9')][_0x272ab7[_0xad73('0x123')]],[_0xad73('0x129'),_0xad73('0x127')]),{'status':_0x272ab7[_0xad73('0xad')],'paused':_0x272ab7[_0xad73('0x126')]}));}}}};function unlockQueueStatus(_0x226ebe,_0xb440ae){setTimeout(function(){if(_[_0xad73('0x86')](_0x226ebe[_0xad73('0x12a')])){loggerBooked['error'](_0xad73('0x12b'),_0xb440ae);}_0x226ebe[_0xad73('0x12a')]=!![];loggerBooked[_0xad73('0x7c')](_0xad73('0x12c'),_0xb440ae,JSON['stringify'](_[_0xad73('0xd0')](_0x226ebe,[_0xad73('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x42fe47){var _0x5e20b1=this;var _0x4a2b54=_0x5e20b1[_0xad73('0x20')][_0x5e20b1[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]];if(strategy[this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]][_0xad73('0x124')]]===_0xad73('0x1a')){if(this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]&&this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0x127')]){this[_0xad73('0x1f')][_0xad73('0x12d')](this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0x129')],this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0x127')])[_0xad73('0xae')](function(_0x1b5cd4){logger[_0xad73('0x92')](_0xad73('0x12e'),util['inspect'](_0x1b5cd4,{'showHidden':![],'depth':null}));})[_0xad73('0x1d')](function(){_0x5e20b1[_0xad73('0xb0')](_0x5e20b1['voiceQueues'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]]);_0x5e20b1['agents'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['stateinterface']][_0xad73('0x125')]=![];delete _0x5e20b1[_0xad73('0xa9')][_0x42fe47['actionid']];unlockQueueStatus(_0x4a2b54);});}else{this['updateOriginated'](this[_0xad73('0x20')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]]);this[_0xad73('0xbc')]({'active':![],'ContactId':this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xd1')],'ListId':this['actions'][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd2')],'VoiceQueueId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0x115')]||undefined,'CampaignId':this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x12f')));delete this[_0xad73('0xa9')][_0x42fe47['actionid']];unlockQueueStatus(_0x4a2b54);}}else if((strategy[this['voiceQueues'][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']][_0xad73('0x124')]]||_0xad73('0x19'))===_0xad73('0x19')){var _0x5560a3;if(this['actions'][_0x42fe47[_0xad73('0x123')]]&&!_[_0xad73('0x7b')](this[_0xad73('0x2c')][this['actions'][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]])){if(this['queueBookedRR'][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]]){this[_0xad73('0x130')][_0x5e20b1[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]=this['queueBookedRR'][this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]]?this[_0xad73('0x130')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]]['queue']]:this[_0xad73('0x2c')][this['actions'][_0x42fe47[_0xad73('0x123')]]['queue']]?this['queueBooked'][this[_0xad73('0xa9')][_0x42fe47['actionid']][_0xad73('0xb2')]][_0xad73('0x131')]||0x0:0x0;}this[_0xad73('0x2c')][this['actions'][_0x42fe47['actionid']][_0xad73('0xb2')]]['_rr']=this[_0xad73('0x130')][this[_0xad73('0xa9')][_0x42fe47[_0xad73('0x123')]][_0xad73('0xb2')]];for(var _0x5cdeb8=0x0;_0x5cdeb8=0x0;})[_0xad73('0xae')](myreject(_0x560e91)));}}else{_0x307b4d[_0xad73('0x128')](ami[_0xad73('0x14d')]({'action':'command','command':util['format'](_0xad73('0x148'),_0x313962,!_[_0xad73('0x86')](config[_0xad73('0x145')][_0x4da109])?_0x4da109:'')})[_0xad73('0xb6')](function(_0x40f699){return _0x40f699['content'][_0xad73('0x14b')](_0xad73('0x14c'))>=0x0;})['catch'](myreject(_0x560e91)));}BPromise[_0xad73('0x14e')](_0x307b4d)[_0xad73('0xb6')](function(_0x4532fd){var _0x1e7f0e=_[_0xad73('0x14f')](_0x4532fd);if(_0x1e7f0e){return _0x36fa7b(_0x1e7f0e);}else{_0x20e7f8[_0xad73('0x3f')]=_0xfc14e1?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x560e91(msgResponse(_0xad73('0x150'),_0xad73('0x141'),_0xad73('0x151')+_0xfc14e1+'\x20'+_0x18fed5+_0xad73('0x152')+util['inspect'](_0x313962,{'showHidden':![],'depth':null})+_0xad73('0x153')+_0x4da109));}})[_0xad73('0xae')](function(_0x56457c){return _0x560e91(msgResponse('ifTime',_0xad73('0x141'),JSON[_0xad73('0x49')](_0x56457c)));});});};Dialer[_0xad73('0x1b')]['checkDialMethod']=function(_0x5d8d72){var _0x2207d0=this;return function(){switch(_0x5d8d72[_0xad73('0x58')]){case'progressive':freeVariablesPredictive(_0x5d8d72);_0x2207d0['handlePower'](_0x5d8d72,0x1);break;case _0xad73('0x154'):freeVariablesPredictive(_0x5d8d72);_0x2207d0[_0xad73('0x155')](_0x5d8d72,_0x5d8d72[_0xad73('0x156')]);break;case'predictive':_0x2207d0[_0xad73('0xa')](_0x5d8d72);break;case _0xad73('0x9'):freeVariablesPredictive(_0x5d8d72);_0x2207d0[_0xad73('0x155')](_0x5d8d72,0x1);break;default:freeVariablesPredictive(_0x5d8d72);logger['error'](_0xad73('0x157'),_0x5d8d72['name'],_0xad73('0x158'));}};};Dialer[_0xad73('0x1b')][_0xad73('0x159')]=function(_0x2f206e){var _0x4903b9=this;return function(){_0x4903b9[_0xad73('0x15a')](_0x2f206e);};};Dialer['prototype']['syncQueueSummary']=function(_0x26675f){var _0x13e23e=this;if(isNotPreview(_0x26675f[_0xad73('0x58')])){if(isVoiceQueueOutbound(_0x26675f[_0xad73('0x54')])&&isActive(_0x26675f[_0xad73('0x15b')])){_0x26675f[_0xad73('0x9c')]=!![];BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](checkIsLoggedIn(_0x26675f,_0x26675f[_0xad73('0x15c')]))['then'](checkIsActive(_0x26675f,_0x26675f[_0xad73('0x15b')]))[_0xad73('0xb6')](checkInterval(_0x26675f))['then'](_0x13e23e[_0xad73('0x13b')](_0x26675f))[_0xad73('0xb6')](_0x13e23e[_0xad73('0x15d')](_0x26675f[_0xad73('0x15e')],_0x26675f['dialTimezone'],_0x26675f[_0xad73('0x40')],_0x26675f))[_0xad73('0xb6')](_0x13e23e[_0xad73('0x140')](_0x26675f['Interval'],_0x26675f[_0xad73('0x15f')],_0x26675f[_0xad73('0x40')],_0x26675f))['then'](_0x13e23e[_0xad73('0x160')](_0x26675f))[_0xad73('0xae')](loggerCatchQueueSummary(_0xad73('0x161'),_0x26675f));}else{notSendMessagesQueue(_0x26675f);}}else{freeVariablesPredictive(_0x26675f);}};Dialer[_0xad73('0x1b')][_0xad73('0x13a')]=function(){var _0x31e06b=this;var _0x413423;for(var _0x243bf8 in this['campaigns']){if(typeof this[_0xad73('0x21')][_0x243bf8]!==_0xad73('0xc9')){_0x413423=this[_0xad73('0x21')][_0x243bf8];if(isCampaignIvr(_0x413423[_0xad73('0x54')])&&isActive(_0x413423[_0xad73('0x74')])){_0x413423[_0xad73('0x9c')]=!![];BPromise[_0xad73('0xb5')]()[_0xad73('0xb6')](checkIsActive(_0x413423,_0x413423['active']))[_0xad73('0xb6')](checkInterval(_0x413423))[_0xad73('0xb6')](_0x31e06b[_0xad73('0x13b')](_0x413423))[_0xad73('0xb6')](_0x31e06b[_0xad73('0x15d')](_0x413423[_0xad73('0x15e')],_0x413423[_0xad73('0x15f')],_0x413423['name'],_0x413423))[_0xad73('0xb6')](_0x31e06b['checkIfTimeIntervals'](_0x413423[_0xad73('0x43')],_0x413423['dialTimezone'],_0x413423[_0xad73('0x40')],_0x413423))[_0xad73('0xb6')](_0x31e06b[_0xad73('0x159')](_0x413423))[_0xad73('0xae')](loggerCatchQueueSummary(_0xad73('0x162'),_0x413423));}else{notSendMessagesCampaign(_0x413423);}}}};function getCallerIdRandom(_0x762349,_0x244be1){var _0x4e997e;var _0x3cc7e7;var _0x529761;if(_0x244be1<=0x0){_0x244be1=0x1;}_0x4e997e=new RegExp(_0xad73('0x163')+_0x244be1+'}$');_0x3cc7e7=Math['pow'](0xa,_0x244be1-0x1);_0x529761=Math[_0xad73('0x164')](0xa,_0x244be1)-0x1;return util[_0xad73('0x77')]('%s',_[_0xad73('0x165')](_0x762349,_0x4e997e,_[_0xad73('0x166')](_0x3cc7e7,_0x529761)));}function extractCalleridName(_0x294247){var _0x138247=_0x294247[_0xad73('0x167')](/"(.*?)"/);return _0x138247?_0x138247[0x1]:_0x294247;}function extractCalleridNumber(_0x59758c){var _0x34a491=_0x59758c[_0xad73('0x167')](/<(.*?)>/);return _0x34a491?_0x34a491[0x1]:_0x59758c;}Dialer['prototype'][_0xad73('0x168')]=function(_0x46b900,_0x8a0338){var _0xdc7c29=this;var _0x3af27d=uuid['v4']();this[_0xad73('0xa9')][_0x3af27d]=new Action(_0x46b900,_0x8a0338,_0x3af27d);return new BPromise(function(_0x1ae46a,_0x57cf87){if(_[_0xad73('0x86')](_0x46b900)&&typeof _0x46b900!==_0xad73('0x169')){return _0x57cf87(msgResponse(_0xad73('0x16a'),_0xad73('0x141'),_0xad73('0x16b')));}if(_[_0xad73('0x86')](_0x8a0338[_0xad73('0x16c')]['phone'])||_0x8a0338[_0xad73('0x16c')]['phone']===null){return _0x57cf87(msgResponse('originate','Failure','contact\x20is\x20undefine'));}var _0xcdca47={'XMD-CALLERID':_0xdc7c29['actions'][_0x3af27d][_0xad73('0x16d')](),'XMD-AGI':_0x46b900[_0xad73('0x16e')]?util[_0xad73('0x77')](_0xad73('0x16f'),ipAgi,_0x46b900[_0xad73('0x16e')]):_0xad73('0x170'),'XMD-AGIAFTER':_0x46b900[_0xad73('0x109')]?util[_0xad73('0x77')](_0xad73('0x16f'),ipAgi,_0x46b900['dialQueueProject2']):_0xad73('0x170'),'XMD-QUEUE':_0x46b900[_0xad73('0x54')]===_0xad73('0x4e')?util['format'](_0xad73('0x171'),_0x46b900['name'],_0x46b900['dialQueueOptions']||'',_0x46b900[_0xad73('0x10a')]?'c':'',_0x46b900[_0xad73('0x172')]||0x3):_0xad73('0x170'),'XMD-CONTACTID':_0x8a0338[_0xad73('0xd1')],'XMD-CDRTYPE':_0xad73('0x8'),'CALLERID(all)':_0xdc7c29[_0xad73('0xa9')][_0x3af27d][_0xad73('0x16d')](),'XMD-AMD':_0x46b900[_0xad73('0xde')]?_0xad73('0x173'):_0xad73('0x170'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x46b900[_0xad73('0xde')]){_0xcdca47['XMD-AMDINITIALSILENCE']=_0x46b900['dialAMDInitialSilence']||0x9c4;_0xcdca47['XMD-AMDGREETING']=_0x46b900[_0xad73('0x174')]||0x5dc;_0xcdca47[_0xad73('0x175')]=_0x46b900[_0xad73('0x176')]||0x320;_0xcdca47[_0xad73('0x177')]=_0x46b900[_0xad73('0x178')]||0x1388;_0xcdca47[_0xad73('0x179')]=_0x46b900[_0xad73('0x17a')]||0x64;_0xcdca47[_0xad73('0x17b')]=_0x46b900[_0xad73('0x17c')]||0x32;_0xcdca47['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x46b900['dialAMDMaximumNumberOfWords']||0x3;_0xcdca47[_0xad73('0x17d')]=_0x46b900[_0xad73('0x17e')]||0x100;_0xcdca47['XMD-AMDMAXIMUMWORDLENGTH']=_0x46b900[_0xad73('0x17f')]||0x1388;}if(_0x46b900[_0xad73('0x54')]===_0xad73('0x4e')){_0xcdca47[_0xad73('0x180')]=_0x8a0338['VoiceQueueId'];}else{_0xcdca47[_0xad73('0x181')]=_0x8a0338['CampaignId'];}for(var _0x357715 in _0x8a0338['Contact']){if(typeof _0x8a0338[_0xad73('0x16c')][_0x357715]!==_0xad73('0xc9')){if(isNotNull(_0x8a0338[_0xad73('0x16c')][_0x357715])&&_0x357715!=='id'&&_0x357715!==_0xad73('0x182')&&_0x357715!==_0xad73('0x183')&&_0x357715!==_0xad73('0x184')){_0xcdca47[util['format'](_0xad73('0x185'),_0xad73('0x186'),_['toUpper'](_0x357715))]=_0x8a0338['Contact'][_0x357715];}}}var _0x51f652=_0xdc7c29[_0xad73('0xd7')](_0x46b900[_0xad73('0x73')])?getCallerId(_0x46b900[_0xad73('0x73')]['callerid'],_0x46b900[_0xad73('0x59')],_0x46b900[_0xad73('0x187')]>0x0?getCallerIdRandom(_0x46b900[_0xad73('0x5a')],_0x46b900[_0xad73('0x187')]):_0x46b900[_0xad73('0x5a')]):getCallerId(_[_0xad73('0xac')](_0x46b900['TrunkBackup'])?_0x46b900[_0xad73('0x73')][_0xad73('0x75')]:_0x46b900[_0xad73('0x13c')][_0xad73('0x75')],_0x46b900['dialOriginateCallerIdName'],_0x46b900['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x46b900[_0xad73('0x5a')],_0x46b900[_0xad73('0x187')]):_0x46b900['dialOriginateCallerIdNumber']);if(_0x51f652){_0xcdca47[_0xad73('0x188')]=_0xdc7c29[_0xad73('0xa9')][_0x3af27d]['originatecalleridname']=extractCalleridName(_0x51f652);_0xcdca47[_0xad73('0x189')]=_0xdc7c29[_0xad73('0xa9')][_0x3af27d][_0xad73('0x18a')]=extractCalleridNumber(_0x51f652);}return ami['Action']({'actionid':_0x3af27d,'action':_0xad73('0x16a'),'channel':_0xdc7c29[_0xad73('0xd7')](_0x46b900[_0xad73('0x73')])?util[_0xad73('0x77')]('SIP/%s/%s%s',_0x46b900['Trunk'][_0xad73('0x40')],isNotNull(_0x46b900['dialPrefix'])?_0x46b900[_0xad73('0x5b')][_0xad73('0x18b')]()||'':'',_0x46b900['dialCutDigit']>0x0?_0x8a0338[_0xad73('0x16c')][_0xad73('0x18c')][_0xad73('0x18d')](_0x46b900['dialCutDigit']):_0x8a0338['Contact'][_0xad73('0x18c')]):util[_0xad73('0x77')](_0xad73('0x18e'),_['isNil'](_0x46b900[_0xad73('0x13c')])?_0x46b900[_0xad73('0x73')][_0xad73('0x40')]:_0x46b900[_0xad73('0x13c')][_0xad73('0x40')],isNotNull(_0x46b900[_0xad73('0x5b')])?_0x46b900[_0xad73('0x5b')]['trim']()||'':'',_0x46b900[_0xad73('0x18f')]>0x0?_0x8a0338[_0xad73('0x16c')]['phone'][_0xad73('0x18d')](_0x46b900['dialCutDigit']):_0x8a0338[_0xad73('0x16c')][_0xad73('0x18c')]),'callerid':_0x51f652,'Exten':'xcally-motion-dialer','Context':_0xad73('0x190'),'Priority':'1','variable':_0xcdca47,'timeout':(_0x46b900[_0xad73('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3af27d})[_0xad73('0xb6')](function(_0x5d8aae){return _0x1ae46a(_0x5d8aae);})['catch'](function(_0xd4221b){_0x46b900[_0xad73('0x63')]+=0x1;var _0x3fcb6f=new History(_0xdc7c29[_0xad73('0xa9')][_0x3af27d]);logger[_0xad73('0x92')](util[_0xad73('0x77')](_0xad73('0x192'),JSON['stringify'](_0xd4221b)));_0x3fcb6f[_0xad73('0xa4')]=0xe;_0x3fcb6f[_0xad73('0xa5')]=_0xad73('0x193');_0x3fcb6f[_0xad73('0xa6')]=moment()['format'](_0xad73('0xf8'));_0x3fcb6f['endtime']=_0x3fcb6f[_0xad73('0xa6')];_0xdc7c29[_0xad73('0xc7')](_0x3fcb6f)[_0xad73('0xae')](loggerCatch('[originate][error]'));_0xdc7c29['moveContactManagedDialer'](_0x3fcb6f)[_0xad73('0xae')](loggerCatch(_0xad73('0x194')))['finally'](function(){delete _0xdc7c29[_0xad73('0xa9')][_0x3af27d];return _0x57cf87(msgResponse('originate',_0xad73('0x48'),_0xad73('0x195')));});});});};Dialer[_0xad73('0x1b')][_0xad73('0x33')]=function(_0x303627){var _0x22bf7a=this[_0xad73('0xa9')][_0x303627['actionid']];if(_0x22bf7a){delete this[_0xad73('0xa9')][_0x303627[_0xad73('0x123')]];_0x22bf7a[_0xad73('0x110')]=moment()[_0xad73('0x77')](_0xad73('0xf8'));var _0x564a9d=_0x22bf7a[_0xad73('0x54')]===_0xad73('0x79')?this[_0xad73('0x21')][_0x22bf7a[_0xad73('0xb2')]]:this['voiceQueues'][_0x22bf7a[_0xad73('0x196')]()];if(!this[_0xad73('0xd6')](_0x303627[_0xad73('0x197')])){this[_0xad73('0xb0')](_0x564a9d);return this[_0xad73('0x198')](_0x22bf7a,_0x564a9d,_0x303627)['catch'](loggerCatch(_0xad73('0x199')));}this[_0xad73('0x27')][_0x303627[_0xad73('0xdf')]]=_0x22bf7a;}};Dialer[_0xad73('0x1b')][_0xad73('0x19a')]=function(_0x459ed8,_0x350c80,_0x5c585d){var _0x595421=new History(_0x350c80);if(_0x595421[_0xad73('0xff')]+_0x595421[_0xad73('0xea')]+_0x595421[_0xad73('0xeb')]+_0x595421['countnosuchnumberretry']+_0x595421[_0xad73('0xed')]+_0x595421[_0xad73('0xee')]+_0x595421[_0xad73('0xe6')]+_0x595421[_0xad73('0xef')]>=_0x5c585d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x459ed8){case 0x3:if(_0x595421[_0xad73('0xeb')]>=_0x5c585d[_0xad73('0x19b')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countnoanswerretry':_0x595421[_0xad73('0xeb')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x19c')],_0xad73('0xf7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421['ContactId'],'ListId':_0x595421['ListId'],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x19d')));break;case 0x5:if(_0x595421[_0xad73('0xff')]>=_0x5c585d[_0xad73('0x19e')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countbusyretry':_0x595421['countbusyretry']+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d['dialBusyRetryFrequency'],_0xad73('0xf7'))[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})['catch'](loggerCatch(_0xad73('0x19f')));break;case 0x8:if(_0x595421[_0xad73('0xea')]>=_0x5c585d['dialCongestionMaxRetry']-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countcongestionretry':_0x595421[_0xad73('0xea')]+=0x1,'scheduledat':moment()['add'](_0x5c585d[_0xad73('0x1a0')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x595421[_0xad73('0xec')]>=_0x5c585d[_0xad73('0x1a1')]-0x1){return!![];}else{this[_0xad73('0xbc')]({'active':![],'countnosuchnumberretry':_0x595421[_0xad73('0xec')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x1a2')],_0xad73('0xf7'))['format'](_0xad73('0xf8')),'ContactId':_0x595421['ContactId'],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})['catch'](loggerCatch(_0xad73('0x1a3')));}break;case 0xa:if(_0x595421[_0xad73('0xed')]>=_0x5c585d['dialDropMaxRetry']-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countdropretry':_0x595421[_0xad73('0xed')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x114')],'minutes')[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421['VoiceQueueId']||undefined,'CampaignId':_0x595421['CampaignId']||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x116')));break;case 0xb:if(_0x595421['countabandonedretry']>=_0x5c585d[_0xad73('0x11d')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countabandonedretry':_0x595421[_0xad73('0xee')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0x11e')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x595421[_0xad73('0xd1')],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x11f')));break;case 0x13:if(_0x595421[_0xad73('0xe6')]>=_0x5c585d[_0xad73('0xf3')]-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countmachineretry':_0x595421['countmachineretry']+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d[_0xad73('0xf6')],_0xad73('0xf7'))[_0xad73('0x77')](_0xad73('0xf8')),'ContactId':_0x595421['ContactId'],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0xf9')));break;case 0x14:if(_0x595421[_0xad73('0xef')]>=_0x5c585d['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xad73('0xbc')]({'active':![],'countagentrejectretry':_0x595421[_0xad73('0xef')]+=0x1,'scheduledat':moment()[_0xad73('0xf5')](_0x5c585d['dialAgentRejectRetryFrequency'],'minutes')[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x595421['ContactId'],'ListId':_0x595421[_0xad73('0xd2')],'VoiceQueueId':_0x595421[_0xad73('0x115')]||undefined,'CampaignId':_0x595421[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x1a4')));break;default:return!![];}};Dialer[_0xad73('0x1b')][_0xad73('0x198')]=function(_0x29995c,_0x43c8af,_0x45fb4e){var _0x3e661d=this;var _0x2741e6=new History(_0x29995c);return new BPromise(function(_0x18f53c,_0x33778d){if(_[_0xad73('0x86')](_0x43c8af)&&typeof _0x43c8af!==_0xad73('0x169')){return _0x33778d(msgResponse(_0xad73('0x1a5'),_0xad73('0x141'),_0xad73('0x1a6')));}if(_['isUndefined'](_0x45fb4e)&&typeof _0x45fb4e!==_0xad73('0x169')){return _0x33778d(msgResponse(_0xad73('0x1a5'),_0xad73('0x141'),_0xad73('0x1a7')));}switch(_0x45fb4e[_0xad73('0x106')]){case'0':_0x43c8af['outboundNoSuchCallsDay']+=0x1;_0x2741e6[_0xad73('0xa4')]=0x0;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x1a8');_0x2741e6[_0xad73('0xec')]+=0x1;_0x2741e6['countglobal']+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1a9'),ut[_0xad73('0xe8')](_0x29995c,_0xad73('0x1aa')));_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0xe9')));if(_0x3e661d[_0xad73('0x19a')](0x0,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xec')]>=_0x43c8af['dialNoSuchNumberMaxRetry']){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ab'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ab'));}}break;case'3':_0x43c8af['outboundNoAnswerCallsDay']+=0x1;_0x2741e6[_0xad73('0xa4')]=0x3;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x1ac');_0x2741e6[_0xad73('0xeb')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;ami['emit'](_0xad73('0x1ad'),ut[_0xad73('0xe8')](_0x29995c,_0xad73('0x1ae')));_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3e661d[_0xad73('0x19a')](0x3,_0x29995c,_0x43c8af)){if(_0x2741e6['countnoanswerretry']>=_0x43c8af[_0xad73('0x19b')]){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1af'));}else{_0x3e661d['stateGlobal'](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1af'));}}break;case'5':_0x43c8af[_0xad73('0x5f')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0x5;_0x2741e6['statedesc']=_0xad73('0x1b0');_0x2741e6[_0xad73('0xff')]+=0x1;_0x2741e6['countglobal']+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1b1'),ut['buildObj'](_0x29995c,_0xad73('0x1b2')));_0x3e661d[_0xad73('0xc7')](_0x2741e6)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3e661d[_0xad73('0x19a')](0x5,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xff')]>=_0x43c8af[_0xad73('0x19e')]){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,'reason\x205\x20busy');}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,'reason\x205\x20busy');}}break;case'8':_0x43c8af[_0xad73('0x1b3')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0x8;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x1b4');_0x2741e6[_0xad73('0xea')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1b5'),ut['buildObj'](_0x29995c,_0xad73('0x1b6')));_0x3e661d[_0xad73('0xc7')](_0x2741e6)[_0xad73('0xae')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x3e661d['checkRetriveMax'](0x8,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xea')]>=_0x43c8af[_0xad73('0x1b7')]){_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1b8'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1b8'));}}break;case'11':_0x43c8af[_0xad73('0x1b9')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0xb;_0x2741e6[_0xad73('0xa5')]=_0xad73('0x11b');_0x2741e6[_0xad73('0xee')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0x120')));if(_0x3e661d[_0xad73('0x19a')](0xb,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xee')]>=_0x43c8af[_0xad73('0x11d')]){_0x3e661d['createStateFinal'](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ba'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1ba'));}}break;case'20':_0x43c8af[_0xad73('0x65')]+=0x1;_0x2741e6['state']=0x14;_0x2741e6[_0xad73('0xa5')]='AgentReject';_0x2741e6[_0xad73('0xef')]+=0x1;_0x2741e6[_0xad73('0xe7')]+=0x1;ami[_0xad73('0x4d')](_0xad73('0x1bb'),ut[_0xad73('0xe8')](_0x29995c,'agentreject'));_0x3e661d[_0xad73('0xc7')](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0x1bc')));if(_0x3e661d[_0xad73('0x19a')](0x14,_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xef')]>=_0x43c8af['dialAgentRejectMaxRetry']){_0x3e661d['createStateFinal'](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1bd'));}else{_0x3e661d[_0xad73('0xf1')](_0x2741e6,_0x18f53c,_0x33778d,_0xad73('0x1bd'));}}break;default:_0x43c8af[_0xad73('0x66')]+=0x1;_0x2741e6[_0xad73('0xa4')]=0xc;_0x2741e6[_0xad73('0xa5')]=_0x45fb4e[_0xad73('0x106')];_0x3e661d['createHistory'](_0x2741e6)[_0xad73('0xae')](loggerCatch(_0xad73('0x1be')));if(_0x3e661d[_0xad73('0x19a')](_0x45fb4e[_0xad73('0x106')],_0x29995c,_0x43c8af)){if(_0x2741e6[_0xad73('0xff')]+_0x2741e6[_0xad73('0xea')]+_0x2741e6[_0xad73('0xeb')]+_0x2741e6[_0xad73('0xec')]+_0x2741e6[_0xad73('0xed')]+_0x2741e6[_0xad73('0xee')]+_0x2741e6[_0xad73('0xe6')]+_0x2741e6[_0xad73('0xef')]>=_0x43c8af[_0xad73('0xf0')]){_0x3e661d['stateGlobal'](_0x2741e6,_0x18f53c,_0x33778d,_0x45fb4e[_0xad73('0x106')]);}else{_0x3e661d[_0xad73('0xf4')](_0x2741e6,_0x18f53c,_0x33778d,_0x45fb4e['reason']);}}}});};Dialer['prototype']['stateGlobal']=function(_0x3105e2,_0x1562eb,_0x2f4784,_0x2d2dad){var _0x36f1fb=new Final(_0x3105e2);_0x36f1fb[_0xad73('0xa4')]=0xf;_0x36f1fb[_0xad73('0xa5')]=_0xad73('0x1bf');this[_0xad73('0xf4')](_0x36f1fb,_0x1562eb,_0x2f4784,_0x2d2dad);};Dialer[_0xad73('0x1b')][_0xad73('0xf4')]=function(_0x3823ac,_0x513d5f,_0x1b9ce0,_0x331ce8){this['moveContactManagedDialer'](_0x3823ac)['then'](function(){return _0x513d5f(msgResponse(_0xad73('0x1a5'),_0xad73('0x1c0'),_0x331ce8));})[_0xad73('0xae')](function(){return _0x1b9ce0(msgResponse('[moveContactManagedDialer][0]',_0xad73('0x141'),_0xad73('0x1c1')));});};Dialer['prototype'][_0xad73('0xa')]=function(_0x2c4af1){var _0x94cdc8=_0x2c4af1[_0xad73('0x1c2')]/0x64;var _0x23815c=_0x2c4af1[_0xad73('0x60')]/(_0x2c4af1[_0xad73('0x60')]+_0x2c4af1[_0xad73('0x5d')]);var _0x57555a=Math[_0xad73('0x1c3')](_0x2c4af1[_0xad73('0x6d')]*(_0x2c4af1[_0xad73('0x1c4')]/0x64));var _0x1819d5=Math[_0xad73('0x1c3')](_0x2c4af1['predictiveIntervalAvailable']*(_0x2c4af1[_0xad73('0x1c5')]/0x64));var _0x4ecd4d=_0x2c4af1['available']+_0x2c4af1['talking'];var _0x5a5312=Math[_0xad73('0x1c6')](_0x2c4af1[_0xad73('0x6f')]*_0x2c4af1[_0xad73('0x71')]*_0x2c4af1[_0xad73('0x6b')]*_0x2c4af1[_0xad73('0x6c')]);if(_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x2a')])){if(!_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x29')])){_0x2c4af1[_0xad73('0x29')]=undefined;loggerPredictive[_0xad73('0x92')](_0xad73('0x1c7'),_0xad73('0x1c8'));}if(!_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x8e')])){loggerPredictive[_0xad73('0x92')]('[startMethodPredictive][StartProgressive]',_0xad73('0x1c9'));clearInterval(_0x2c4af1['handlePredictive']);_0x2c4af1[_0xad73('0x8e')]=undefined;}_0x2c4af1[_0xad73('0x2a')]=moment()[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xad73('0x7c')](_0x2c4af1[_0xad73('0x40')],_0xad73('0x1ca'),_0x2c4af1[_0xad73('0x2a')]);this[_0xad73('0x155')](_0x2c4af1,0x1);}else if(ifInterval(_0x2c4af1[_0xad73('0x1cb')],_0x2c4af1[_0xad73('0x2a')])){this[_0xad73('0x155')](_0x2c4af1,0x1);loggerPredictiveCalls[_0xad73('0x7c')](_0xad73('0x1cc'),_0x2c4af1[_0xad73('0x2a')],_0x2c4af1[_0xad73('0x40')]);_0x2c4af1['erlangCalls']=0x0;_0x2c4af1[_0xad73('0x6a')]=0x0;}else if(_0x94cdc8<_0x23815c&&_0x2c4af1[_0xad73('0x1cd')]===_0xad73('0x1ce')){freeVariablesPredictive(_0x2c4af1);loggerPredictive[_0xad73('0x7c')](_0xad73('0x1cf'),'Dropped\x20calls\x20day',_0x23815c,_0xad73('0x2a'),_0x2c4af1[_0xad73('0x40')]);}else if(_0x5a5312<_0x2c4af1[_0xad73('0x6a')]&&_0x2c4af1[_0xad73('0x1cd')]==='dropRate'){freeVariablesPredictive(_0x2c4af1);loggerPredictive[_0xad73('0x7c')](_0xad73('0x1d0'),_0xad73('0x1d1'),_0x5a5312,_0xad73('0x1d2'),_0x2c4af1[_0xad73('0x6a')],_0xad73('0x2a'),_0x2c4af1[_0xad73('0x40')]);}else if(!ifInterval(_0x2c4af1['dialPredictiveInterval'],_0x2c4af1[_0xad73('0x2a')])&&_[_0xad73('0x86')](_0x2c4af1[_0xad73('0x29')])&&!_[_0xad73('0x86')](_0x2c4af1['startProgressive'])){_0x2c4af1[_0xad73('0x29')]=moment()['format'](_0xad73('0xf8'));loggerPredictive[_0xad73('0x7c')](_0x2c4af1['name'],'started\x20in\x20predictive\x20at',_0x2c4af1[_0xad73('0x29')]);this[_0xad73('0x1d3')](_0x2c4af1[_0xad73('0x1cb')])['then'](this[_0xad73('0x1d4')](_0x2c4af1))[_0xad73('0xb6')](mergeDataErlangB(_0x2c4af1))[_0xad73('0xb6')](this[_0xad73('0x1d5')](_0x2c4af1))[_0xad73('0xae')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2c4af1));}else if(!ifInterval(_0x2c4af1[_0xad73('0x1cb')],_0x2c4af1['startPredictive'])){_0x2c4af1['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2c4af1[_0xad73('0x29')]=moment()[_0xad73('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xad73('0x7c')](_0x2c4af1[_0xad73('0x40')],'recalculate\x20predictive\x20at',_0x2c4af1['startPredictive']);clearInterval(_0x2c4af1[_0xad73('0x8e')]);_0x2c4af1['handlePredictive']=undefined;this[_0xad73('0x1d3')](_0x2c4af1[_0xad73('0x1cb')])[_0xad73('0xb6')](this[_0xad73('0x1d4')](_0x2c4af1))[_0xad73('0xb6')](mergeDataErlangB(_0x2c4af1))['then'](this[_0xad73('0x1d5')](_0x2c4af1))[_0xad73('0xae')](loggerCatchPredictive(_0xad73('0x1d6'),_0x2c4af1));}else if(_0x2c4af1['predictiveIntervalAvailable']&&_0x4ecd4d<_0x2c4af1[_0xad73('0x6d')]-_0x1819d5){freeVariablesPredictive(_0x2c4af1);loggerPredictive['info'](_0x2c4af1[_0xad73('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4ecd4d,_0xad73('0x1d7'),_0x2c4af1[_0xad73('0x6d')],'-',_0x1819d5,'=',_0x2c4af1[_0xad73('0x6d')]-_0x1819d5,')');}else if(_0x2c4af1['predictiveIntervalAvailable']&&_0x4ecd4d>_0x2c4af1['predictiveIntervalAvailable']+_0x57555a){freeVariablesPredictive(_0x2c4af1);loggerPredictive[_0xad73('0x7c')](_0x2c4af1[_0xad73('0x40')],_0xad73('0x1d8'),_0x4ecd4d,')\x20are\x20more\x20than\x20threshold\x20(',_0x2c4af1[_0xad73('0x6d')],'+',_0x57555a,'=',_0x2c4af1['predictiveIntervalAvailable']+_0x57555a,')');}};Dialer['prototype'][_0xad73('0x1d4')]=function(_0x46b324){var _0x156250=this;return function(_0x13de36){return new BPromise(function(_0x530ecb,_0x4fa2da){_[_0xad73('0xcf')](_0x46b324,_0x13de36[0x0]);if(checkGetDataPredictive(_0x13de36[0x0])){var _0x1654a8=_0x46b324[_0xad73('0x6d')]=_0x46b324[_0xad73('0x53')]+_0x46b324[_0xad73('0x4f')];var _0xbc469c=_0x46b324['dialPredictiveInterval']*0x3c;var _0x176f09=_0x13de36[0x0][_0xad73('0x68')]+_0x13de36[0x0]['predictiveIntervalAvgHoldtime'];var _0x3b22d5=(_0x13de36[0x0]['predictiveIntervalAnsweredCalls']+_0x13de36[0x0][_0xad73('0x82')]+_0x13de36[0x0][_0xad73('0x1d9')])/_0x13de36[0x0]['predictiveIntervalTotalCalls'];_0x46b324['predictiveIntervalHitRate']=_0x3b22d5>0x0?_0x3b22d5:0x1;switch(_0x46b324['dialPredictiveOptimization']){case _0xad73('0x1ce'):var _0x1c35ef=_0x46b324[_0xad73('0x1c2')]/0x64;return _0x156250['abandonmentRate'](_0x1654a8,_0xbc469c,_0x176f09,_0x3b22d5,_0x1c35ef)['then'](function(_0x4b5b4e){return _0x530ecb(_0x4b5b4e);});case'agentBusyFactor':var _0x13049b=_0x46b324[_0xad73('0x1c2')]/0x64;return _0x156250['busyFactor'](_0x1654a8,_0xbc469c,_0x176f09,_0x3b22d5,_0x13049b)[_0xad73('0xb6')](function(_0x505c93){return _0x530ecb(_0x505c93);});default:return _0x4fa2da(msgResponse('[getDataPredictive]',_0xad73('0x141'),_0xad73('0x1da')));}}else{return _0x4fa2da(msgResponse(_0xad73('0x1db'),'Failure',_0xad73('0x1dc')));}});};};Dialer[_0xad73('0x1b')][_0xad73('0x1dd')]=function(_0x2bea18){var _0xfaee6c=this;return function(_0x3cd54b){return new BPromise(function(_0x1d580f,_0xaab6d){_['merge'](_0x2bea18,_0x3cd54b[0x0]);if(checkGetDataPredictive(_0x3cd54b[0x0])){loggerPredictive['info'](JSON[_0xad73('0x49')](_0x3cd54b[0x0]));if(_0x2bea18[_0xad73('0x1cd')]===_0xad73('0x1ce')){return _0xfaee6c[_0xad73('0xc4')](_0x2bea18['id'])[_0xad73('0xb6')](function(_0x2212bf){var _0x42e3dd=_0x2bea18['loggedIn']-_0x2212bf[0x0][_0xad73('0x1de')];var _0x98a15e=_0x2bea18[_0xad73('0x1cb')]*0x3c;var _0x23e812=_0x3cd54b[0x0][_0xad73('0x68')]+_0x3cd54b[0x0]['predictiveIntervalAvgHoldtime'];var _0xe5c291=(_0x3cd54b[0x0][_0xad73('0x80')]+_0x3cd54b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3cd54b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3cd54b[0x0]['predictiveIntervalTotalCalls'];var _0x14c30b=_0x2bea18[_0xad73('0x1c2')]/0x64;_0x2bea18[_0xad73('0x1df')]=_0x2212bf[0x0][_0xad73('0x1de')]||0x0;_0x2bea18[_0xad73('0x6b')]=_0xe5c291>0x0?_0xe5c291:0x1;return _0xfaee6c['abandonmentRate'](_0x42e3dd,_0x98a15e,_0x23e812,_0xe5c291,_0x14c30b);})['then'](function(_0x153c9b){return _0x1d580f(_0x153c9b);})[_0xad73('0xae')](function(_0x27e6d5){return _0xaab6d(msgResponse(_0xad73('0x1e0'),_0xad73('0x141'),JSON[_0xad73('0x49')](_0x27e6d5)));});}if(_0x2bea18[_0xad73('0x1cd')]===_0xad73('0x1e1')){return _0xfaee6c['getVoiceQueueRtPauses'](_0x2bea18['id'])[_0xad73('0xb6')](function(_0x337f12){var _0x2085a1=_0x2bea18[_0xad73('0x15c')]-_0x337f12[0x0]['outboundQueuePauses'];var _0x226199=_0x2bea18[_0xad73('0x1cb')]*0x3c;var _0x3cc43f=_0x3cd54b[0x0]['predictiveIntervalAvgTalktime']+_0x3cd54b[0x0][_0xad73('0x67')];var _0x4d6d5d=(_0x3cd54b[0x0][_0xad73('0x80')]+_0x3cd54b[0x0][_0xad73('0x82')]+_0x3cd54b[0x0][_0xad73('0x1d9')])/_0x3cd54b[0x0][_0xad73('0x6e')];var _0x4e5ea2=_0x2bea18[_0xad73('0x1c2')]/0x64;_0x2bea18[_0xad73('0x1df')]=_0x337f12[0x0][_0xad73('0x1de')]||0x0;_0x2bea18[_0xad73('0x6b')]=_0x4d6d5d>0x0?_0x4d6d5d:0x1;return _0xfaee6c[_0xad73('0x1e2')](_0x2085a1,_0x226199,_0x3cc43f,_0x4d6d5d,_0x4e5ea2);})['then'](function(_0x1c2540){return _0x1d580f(_0x1c2540);})[_0xad73('0xae')](function(_0x1f397e){return _0xaab6d(msgResponse(_0xad73('0x1e0'),_0xad73('0x141'),JSON[_0xad73('0x49')](_0x1f397e)));});}}else{return _0xaab6d(msgResponse(_0xad73('0x1db'),_0xad73('0x141'),_0xad73('0x1dc')));}});};};Dialer[_0xad73('0x1b')][_0xad73('0x1d5')]=function(_0x44af94){var _0x25877b=this;return function(){var _0x16c937=0x0;var _0x45bfb2=Math[_0xad73('0x1c6')](_0x44af94[_0xad73('0x70')]*0x3e8);if(_0x45bfb2>0x0){_0x45bfb2=_0x45bfb2<0x64?0x64:_0x45bfb2;loggerPredictive[_0xad73('0x7c')](_0x44af94[_0xad73('0x40')],'one\x20call\x20every:',_0x45bfb2,_0xad73('0x4a'));_0x44af94[_0xad73('0x8e')]=setInterval(function(){_0x25877b[_0xad73('0x8e')](_0x44af94);loggerPredictiveCalls[_0xad73('0x7c')](_0xad73('0x1e3'),_0x16c937+=0x1);},_0x45bfb2);}else{loggerPredictive['info'](_0x44af94[_0xad73('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xad73('0x1e4')]=function(_0x102107,_0x1459a2){var _0x110479=this;return function(_0x360ea6){if(_[_0xad73('0x7b')](_0x360ea6)){if(_[_0xad73('0xac')](_0x1459a2['UserId'])||!_0x1459a2[_0xad73('0x1e5')]){if(_0x102107[_0xad73('0x58')]===_0xad73('0x9')){_0x102107[_0xad73('0x12a')]=_[_0xad73('0x86')](_0x102107['queueStatusComplete'])?!![]:_0x102107[_0xad73('0x12a')];var _0xcd3bfe=uuid['v4']();_0x110479['actions'][_0xcd3bfe]=new Action(_0x102107,_0x1459a2,_0xcd3bfe);loggerBooked[_0xad73('0x7c')](_0xad73('0x1e6'),_0xcd3bfe,_0xad73('0x1e7'),JSON[_0xad73('0x49')](_0x102107['queueStatusComplete']),'Queue:\x20',_0x102107[_0xad73('0x40')]);if(_0x102107[_0xad73('0x12a')]){_0x102107['queueStatusComplete']=![];_0x110479[_0xad73('0x2c')][_0x110479[_0xad73('0xa9')][_0xcd3bfe]['queue']]=[];ami['Action']({'actionid':_0xcd3bfe,'action':'queuestatus','queue':_0x102107[_0xad73('0x40')]})['catch'](function(){_0x110479[_0xad73('0xb0')](_0x102107);_0x110479[_0xad73('0xbc')]({'active':![],'ContactId':_0x110479[_0xad73('0xa9')][_0xcd3bfe]['ContactId'],'ListId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd2')],'VoiceQueueId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0x115')]||undefined,'CampaignId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd4')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x110479[_0xad73('0xa9')][_0xcd3bfe];});}else{loggerBooked[_0xad73('0x7c')](_0xad73('0x1e8'),JSON[_0xad73('0x49')](_0x102107[_0xad73('0x12a')]),_0xad73('0x1e9'),_0x102107[_0xad73('0x40')]);_0x110479[_0xad73('0xb0')](_0x102107);_0x110479[_0xad73('0xbc')]({'active':![],'ContactId':_0x110479[_0xad73('0xa9')][_0xcd3bfe]['ContactId'],'ListId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd2')],'VoiceQueueId':_0x110479[_0xad73('0xa9')][_0xcd3bfe]['VoiceQueueId']||undefined,'CampaignId':_0x110479[_0xad73('0xa9')][_0xcd3bfe][_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x110479[_0xad73('0xa9')][_0xcd3bfe];}}else{return _0x110479['actionOriginate'](_0x102107,_0x1459a2);}}else{if(getDiff(_0x1459a2[_0xad73('0x1ea')])<_0x102107[_0xad73('0x1eb')]*0x3c){if(_0x1459a2[_0xad73('0x1ec')]&&!_0x1459a2['Agent']['voicePause']){_0x110479[_0xad73('0x1f')][_0xad73('0x12d')](_0x1459a2['id'])[_0xad73('0x1d')](function(){_0x110479[_0xad73('0xb0')](_0x102107);});}else{_0x110479[_0xad73('0xbe')]({'active':![]},_0x1459a2['id'],0x1)[_0xad73('0x1d')](function(){_0x110479[_0xad73('0xb0')](_0x102107);});}}else{_0x102107[_0xad73('0x64')]+=0x1;_0x110479[_0xad73('0xb0')](_0x102107);if(_0x102107[_0xad73('0x1ed')]){_0x110479[_0xad73('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1459a2['ContactId'],'ListId':_0x1459a2[_0xad73('0xd2')],'VoiceQueueId':_0x1459a2[_0xad73('0x115')]||undefined,'CampaignId':_0x1459a2[_0xad73('0xd4')]||undefined})[_0xad73('0xae')](loggerCatch(_0xad73('0x1ee')));_0x110479['createHistory'](createObjHistory(_0x102107,_0x1459a2,_0xad73('0x1ef'),0x17,_0xad73('0x1f0')))['catch'](loggerCatch(_0xad73('0x1f1')));}else{_0x110479['saveInDb'](createObjHistory(_0x102107,_0x1459a2,_0xad73('0x1f2'),0x16,_0xad73('0x1f3')),_0xad73('0x1f4'),_0xad73('0x1f5'));}}}}else{_0x102107[_0xad73('0x5e')]+=0x1;_0x110479[_0xad73('0xce')](createObjHistory(_0x102107,_0x1459a2,_0xad73('0x1f6'),0xd,_0xad73('0x1f7')),'[Originate][historyBlacklist]',_0xad73('0x1f8'));throw _0xad73('0x1f9');}};};Dialer[_0xad73('0x1b')][_0xad73('0x15a')]=function(_0xa3102f){var _0x43c234=this;var _0x520681=_0xa3102f['limitCalls']-_0xa3102f['originated']-_0xa3102f[_0xad73('0xc0')];emitCampaignSummary(_0xa3102f);if(_0x520681>0x0){if(_0x520681>this[_0xad73('0x24')]){_0x520681=this['maxNumberOriginate'];}_0xa3102f[_0xad73('0xc0')]+=_0x520681;this[_0xad73('0xc2')](_0xa3102f['id'],_0x520681,_0xa3102f[_0xad73('0x1fa')],_0xa3102f)[_0xad73('0xb6')](function(_0x5d9cd6){_0xa3102f[_0xad73('0xc0')]-=_0x520681;_0xa3102f[_0xad73('0xc0')]=_0xa3102f[_0xad73('0xc0')]>0x0?_0xa3102f[_0xad73('0xc0')]:0x0;if(!checkContactEmpty(_0x5d9cd6)){_0xa3102f[_0xad73('0x3f')]=_0xad73('0x1fb');logger['info'](_0xad73('0x1fc')+_0xa3102f[_0xad73('0x40')]);}else{_0xa3102f[_0xad73('0x96')]+=_0x5d9cd6[_0xad73('0x95')];_0xa3102f[_0xad73('0x3f')]=_0xad73('0x1fd');for(var _0x1de075=0x0;_0x1de075<_0x5d9cd6[_0xad73('0x95')];_0x1de075+=0x1){_0xa3102f[_0xad73('0x1fe')]+=0x1;if(_[_0xad73('0xac')](_0x5d9cd6[_0x1de075])||_[_0xad73('0xac')](_0x5d9cd6[_0x1de075][_0xad73('0x16c')])||_[_0xad73('0xac')](_0x5d9cd6[_0x1de075][_0xad73('0x16c')]['phone'])){_0x43c234['emptyContact']('[actionOriginate]\x20',_0xa3102f,_0x5d9cd6[_0x1de075]);}else{_0x43c234['checkIsBlackListIvr'](_[_0xad73('0xd0')](_0x5d9cd6[_0x1de075],[_0xad73('0xd4'),_0xad73('0x1ff')]))[_0xad73('0xb6')](_0x43c234[_0xad73('0x1e4')](_0xa3102f,_0x5d9cd6[_0x1de075]))['catch'](_0x43c234[_0xad73('0xcc')](_0xad73('0x200'),_0xa3102f));}}}})[_0xad73('0xae')](loggerGetContactDialer(_0xad73('0x201'),_0xa3102f,_0x520681));}};Dialer[_0xad73('0x1b')][_0xad73('0x155')]=function(_0x5e03b7,_0x4b3c68){var _0x5ca48f=this;var _0x233ab4=[];var _0x56cbf5=_0x4b3c68>=0x1?_0x4b3c68:0x1;if(_0x5e03b7[_0xad73('0x58')]===_0xad73('0x9')){_0x56cbf5=0x1;}var _0x397109=Math[_0xad73('0x1c6')](_0x5e03b7[_0xad73('0x4f')]*_0x56cbf5)-_0x5e03b7['originated']-_0x5e03b7[_0xad73('0xc0')];emitVoiceQueueSummary(_0x5e03b7);if(_0x5e03b7[_0xad73('0x202')]>0x0){var _0x5e5823=_0x5e03b7[_0xad73('0x202')]-_0x5e03b7['originated']-_0x5e03b7[_0xad73('0x53')]-_0x5e03b7[_0xad73('0xc0')]-_0x5e03b7[_0xad73('0x9d')];if(_0x397109>_0x5e5823){_0x397109=_0x5e5823;}}if(_0x397109>0x0){if(_0x5e03b7[_0xad73('0x58')]===_0xad73('0x9')){_0x397109=0x1;}if(_0x397109>this[_0xad73('0x24')]){_0x397109=this[_0xad73('0x24')];}_0x5e03b7[_0xad73('0xc0')]+=_0x397109;for(var _0x30557b in this[_0xad73('0x22')]){if(typeof this[_0xad73('0x22')][_0x30557b]!=='undefined'){if(this['agents'][_0x30557b][_0xad73('0xa4')]==='not_inuse'&&this[_0xad73('0x22')][_0x30557b][_0xad73('0xad')]===_0xad73('0xd9')){_0x233ab4[_0xad73('0x128')](this['agents'][_0x30557b]['id']);}}}this['getContactDialer'](_0x5e03b7['id'],_0x233ab4,_0x397109,_0x5e03b7['dialOrderByScheduledAt'],_0x5e03b7)[_0xad73('0xb6')](function(_0x4cd973){_0x5e03b7[_0xad73('0xc0')]-=_0x397109;_0x5e03b7[_0xad73('0xc0')]=_0x5e03b7[_0xad73('0xc0')]>0x0?_0x5e03b7[_0xad73('0xc0')]:0x0;if(!checkContactEmpty(_0x4cd973)){_0x5ca48f[_0xad73('0xb4')](_0x5e03b7)['then'](sendMessageReschedule(_0x5e03b7))[_0xad73('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x5e03b7[_0xad73('0x96')]+=_0x4cd973[_0xad73('0x95')];_0x5e03b7[_0xad73('0x3f')]=_0x5e03b7[_0xad73('0x58')]===_0xad73('0x9')?_0xad73('0x173'):_0xad73('0x1fd');for(var _0x3006ba=0x0;_0x3006ba<_0x4cd973['length'];_0x3006ba+=0x1){if(_[_0xad73('0xac')](_0x4cd973[_0x3006ba])||_['isNil'](_0x4cd973[_0x3006ba][_0xad73('0x16c')])||_[_0xad73('0xac')](_0x4cd973[_0x3006ba][_0xad73('0x16c')][_0xad73('0x18c')])){_0x5ca48f[_0xad73('0xcd')](_0xad73('0x203'),_0x5e03b7,_0x4cd973[_0x3006ba]);}else{_0x5ca48f[_0xad73('0x204')](_[_0xad73('0xd0')](_0x4cd973[_0x3006ba],['VoiceQueueId','Contact.phone']))[_0xad73('0xb6')](_0x5ca48f[_0xad73('0x1e4')](_0x5e03b7,_0x4cd973[_0x3006ba]))[_0xad73('0xae')](_0x5ca48f[_0xad73('0xcc')](_0xad73('0x203'),_0x5e03b7));}}}})[_0xad73('0xae')](loggerGetContactDialer(_0xad73('0x205'),_0x5e03b7,_0x397109));}};Dialer['prototype'][_0xad73('0x8e')]=function(_0x586ddb){if(_0x586ddb[_0xad73('0x202')]>0x0){var _0x246eb0=_0x586ddb[_0xad73('0x202')]-_0x586ddb[_0xad73('0x96')]-_0x586ddb['talking'];if(_0x246eb0>0x0){this[_0xad73('0x206')](_0x586ddb);}else{loggerPredictiveCalls[_0xad73('0x7c')]('[handlePredictive][limitChannel]');}}else{this[_0xad73('0x206')](_0x586ddb);}};Dialer[_0xad73('0x1b')][_0xad73('0x206')]=function(_0x10869b){var _0x301343=this;var _0x7da01f=[];_0x10869b[_0xad73('0x96')]+=0x1;for(var _0x23ca8f in this[_0xad73('0x22')]){if(typeof this[_0xad73('0x22')][_0x23ca8f]!=='undefined'){if(this[_0xad73('0x22')][_0x23ca8f][_0xad73('0xa4')]===_0xad73('0x207')&&this['agents'][_0x23ca8f][_0xad73('0xad')]===_0xad73('0xd9')){_0x7da01f['push'](this['agents'][_0x23ca8f]['id']);}}}this['getContactDialer'](_0x10869b['id'],_0x7da01f,0x1,_0x10869b[_0xad73('0x1fa')],_0x10869b)[_0xad73('0xb6')](function(_0x164fb7){if(!checkContactEmpty(_0x164fb7)){checkContactLowerLimitOriginate(_0x10869b,0x1,0x0);_0x301343[_0xad73('0xb4')](_0x10869b)[_0xad73('0xb6')](sendMessageReschedule(_0x10869b))[_0xad73('0xae')](loggerCatch(_0xad73('0xb7')));}else{_0x10869b[_0xad73('0x3f')]=_0xad73('0x1fd');if(_[_0xad73('0xac')](_0x164fb7[0x0])||_[_0xad73('0xac')](_0x164fb7[0x0][_0xad73('0x16c')])||_['isNil'](_0x164fb7[0x0]['Contact'][_0xad73('0x18c')])){_0x301343['emptyContact'](_0xad73('0x203'),_0x10869b,_0x164fb7[0x0]);}else{_0x301343[_0xad73('0x204')](_[_0xad73('0xd0')](_0x164fb7[0x0],[_0xad73('0x115'),'Contact.phone']))[_0xad73('0xb6')](_0x301343[_0xad73('0x1e4')](_0x10869b,_0x164fb7[0x0]))[_0xad73('0xae')](_0x301343[_0xad73('0xcc')](_0xad73('0x208'),_0x10869b));}}})[_0xad73('0xae')](loggerGetContactDialer(_0xad73('0x209'),_0x10869b,0x1));emitVoiceQueueSummary(_0x10869b);};Dialer['prototype'][_0xad73('0x20a')]=function(_0x4a16ac,_0x240f60,_0x13949e,_0x1c16ea,_0x54bb57,_0x3bbf3e){loggerPredictive[_0xad73('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xad73('0x7c')]('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',_0x4a16ac);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20b'),_0x240f60);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20c'),_0x13949e);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20d'),_0x1c16ea);loggerPredictive['info'](_0xad73('0x20e'),_0x54bb57);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));return new BPromise(function(_0x3ebf1c,_0x41a64f){if(_0x4a16ac<=0x0||isNaN(_0x4a16ac)){return _0x41a64f(msgResponse(_0xad73('0x20f'),_0xad73('0x48'),_0xad73('0x210')+_0x4a16ac));}if(_0x13949e<=0x0||isNaN(_0x13949e)){return _0x41a64f(msgResponse(_0xad73('0x20f'),'Error',_0xad73('0x211')+_0x13949e));}if(_0x1c16ea<=0x0||isNaN(_0x1c16ea)){return _0x41a64f(msgResponse('[abandonmentRate]',_0xad73('0x48'),_0xad73('0x212')+_0x1c16ea));}if(_0x240f60<=0x0||isNaN(_0x240f60)){return _0x41a64f(msgResponse(_0xad73('0x20f'),_0xad73('0x48'),'interval\x20=\x20'+_0x240f60));}if(_0x54bb57<=0x0||isNaN(_0x54bb57)){return _0x41a64f(msgResponse(_0xad73('0x20f'),_0xad73('0x48'),_0xad73('0x213')+_0x54bb57));}_0x3bbf3e=_0x3bbf3e||0x0;var _0x39ef57=0x1/_0x13949e;var _0x8a8a15=0x0;var _0x35d1e2=0x0;var _0x541cff=0x0;var _0x570145=0x0;for(var _0x22d761=0x0;_0x541cff<_0x54bb57;_0x22d761+=0x1){_0x35d1e2=_0x22d761/_0x240f60;_0x8a8a15=(_0x1c16ea*_0x35d1e2+_0x3bbf3e)/_0x39ef57;_0x541cff=erlangb(_0x8a8a15,_0x4a16ac);_0x570145=_0x8a8a15/_0x4a16ac*(0x1-erlangb(_0x8a8a15,_0x4a16ac));}return _0x3ebf1c({'erlangCalls':_0x22d761,'erlangCallToSecond':_0x240f60/_0x22d761,'erlangAbandonmentRate':_0x541cff,'erlangBusyFactor':_0x570145});});};Dialer[_0xad73('0x1b')][_0xad73('0x1e2')]=function(_0x282cb7,_0x57fb3b,_0x23db2d,_0x52f404,_0x4b6f80,_0x59b00f){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xad73('0x7c')](_0xad73('0x214'),_0x282cb7);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20b'),_0x57fb3b);loggerPredictive[_0xad73('0x7c')]('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',_0x23db2d);loggerPredictive[_0xad73('0x7c')](_0xad73('0x20d'),_0x52f404);loggerPredictive[_0xad73('0x7c')](_0xad73('0x215'),_0x4b6f80);loggerPredictive[_0xad73('0x7c')](_0xad73('0x85'));return new BPromise(function(_0x7cc7dc,_0xa965be){if(_0x282cb7<=0x0||isNaN(_0x282cb7)){return _0xa965be(msgResponse('[busyFactor]',_0xad73('0x48'),_0xad73('0x210')+_0x282cb7));}if(_0x23db2d<=0x0||isNaN(_0x23db2d)){return _0xa965be(msgResponse(_0xad73('0x216'),'Error',_0xad73('0x211')+_0x23db2d));}if(_0x52f404<=0x0||isNaN(_0x52f404)){return _0xa965be(msgResponse(_0xad73('0x216'),_0xad73('0x48'),_0xad73('0x212')+_0x52f404));}if(_0x57fb3b<=0x0||isNaN(_0x57fb3b)){return _0xa965be(msgResponse(_0xad73('0x216'),'Error',_0xad73('0x217')+_0x57fb3b));}if(_0x4b6f80<=0x0||isNaN(_0x4b6f80)){return _0xa965be(msgResponse('[busyFactor]',_0xad73('0x48'),_0xad73('0x218')+_0x4b6f80));}_0x59b00f=_0x59b00f||0x0;var _0x21c3d8=0x1/_0x23db2d;var _0x45912b=0x0;var _0x357d8d=0x0;var _0x655dba=0x0;var _0x3a339c=0x0;for(var _0x4d67fc=0x0;_0x3a339c<_0x4b6f80;_0x4d67fc+=0x1){_0x357d8d=_0x4d67fc/_0x57fb3b;_0x45912b=(_0x52f404*_0x357d8d+_0x59b00f)/_0x21c3d8;_0x655dba=erlangb(_0x45912b,_0x282cb7);_0x3a339c=_0x45912b/_0x282cb7*(0x1-erlangb(_0x45912b,_0x282cb7));}return _0x7cc7dc({'erlangCalls':_0x4d67fc,'erlangCallToSecond':_0x57fb3b/_0x4d67fc,'erlangAbandonmentRate':_0x655dba,'erlangBusyFactor':_0x3a339c});});};module[_0xad73('0x219')]=Dialer; \ No newline at end of file +var _0x8b1a=['moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','updateOriginated','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','trunks','reachable','SIP/%s','unmonitored','uniqueid','variable','exten','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','statedesc','HangupInAMD','membername','AMD','amd','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr][createHistory]','countcongestionretry','countdropretry','dialGlobalMaxRetry','syncHangup','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','paused','agents','stateinterface','locked','rrmemory','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','loopCampaigns','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\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','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','predictive','launchHandleIvr','dialActive','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','countReScheduled','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','maxNumberOriginate','channels','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','Interval','INTERVAL_IS_NULL','Intervals','isEmpty','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','outbound','strategy','answered','pTalking','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','ivr','campaign:ivr:%s','info','Answered\x20Calls:\x20\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','predictiveIntervalAvgHoldtime','---------------------------','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','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','state','starttime','[uniqueid]','clearZombieChannels','actions','prototype','isNil','Action','status','No\x20such\x20channel','queue','[Dialer][checkChannel]','then','catch','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses'];(function(_0x1195c5,_0x27f52b){var _0x117074=function(_0xbc45cf){while(--_0xbc45cf){_0x1195c5['push'](_0x1195c5['shift']());}};_0x117074(++_0x27f52b);}(_0x8b1a,0x152));var _0xa8b1=function(_0x43acfd,_0x223114){_0x43acfd=_0x43acfd-0x0;var _0x162863=_0x8b1a[_0x43acfd];return _0x162863;};'use strict';var util=require(_0xa8b1('0x0'));var _=require(_0xa8b1('0x1'));var BPromise=require(_0xa8b1('0x2'));var uuid=require('uuid');var moment=require(_0xa8b1('0x3'));var rr=require('rr');var md5=require(_0xa8b1('0x4'));var Redis=require(_0xa8b1('0x5'));var ut=require('../preview/util/util');var config=require(_0xa8b1('0x6'));var logger=require(_0xa8b1('0x7'))(_0xa8b1('0x8'));var loggerBooked=require(_0xa8b1('0x7'))(_0xa8b1('0x9'));var loggerPredictive=require(_0xa8b1('0x7'))('predictive');var loggerPredictiveCalls=require(_0xa8b1('0x7'))(_0xa8b1('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xa8b1('0xb'));var ami=require(_0xa8b1('0xc'));config['redis']=_[_0xa8b1('0xd')](config[_0xa8b1('0xe')],{'host':_0xa8b1('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xa8b1('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xa8b1('0x11'));var voiceQueueRt=require(_0xa8b1('0x12'));var Action=require(_0xa8b1('0x13'));var History=require(_0xa8b1('0x14'));var Final=require(_0xa8b1('0x15'));var AgentComplete=require(_0xa8b1('0x16'));var QueueCallerAbandon=require(_0xa8b1('0x17'));var Hangup=require(_0xa8b1('0x18'));var ipAgi=process['env'][_0xa8b1('0x19')]||_0xa8b1('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0xa8b1('0x1b')};var Sequence=function(){};Sequence['prototype'][_0xa8b1('0x1c')]=function(_0x49a54c){this[_0xa8b1('0x1d')]=this[_0xa8b1('0x1d')]?this[_0xa8b1('0x1d')][_0xa8b1('0x1e')](_0x49a54c):_0x49a54c();};function Dialer(_0x42fd26,_0x11f719){this[_0xa8b1('0x1f')]=new Sequence();this[_0xa8b1('0x20')]=_0x11f719;this['voiceQueues']=_0x42fd26[_0xa8b1('0x21')];this[_0xa8b1('0x22')]=_0x42fd26[_0xa8b1('0x22')];this['agents']=_0x42fd26['agents'];this['trunks']=_0x42fd26['trunks'];this[_0xa8b1('0x23')]=config[_0xa8b1('0x23')]||0x2;this[_0xa8b1('0x24')]={};this['actions']={};this['contactsId']={};this[_0xa8b1('0x25')]={};this['optionPredictive']={};this[_0xa8b1('0x26')]={};this[_0xa8b1('0x27')]={};this[_0xa8b1('0x28')]={};this[_0xa8b1('0x29')]={};this[_0xa8b1('0x2a')]={};ami['on']('agentconnect',this[_0xa8b1('0x2b')]['bind'](this));ami['on']('queuecallerabandon',this[_0xa8b1('0x2c')][_0xa8b1('0x2d')](this));ami['on'](_0xa8b1('0x2e'),this[_0xa8b1('0x2f')][_0xa8b1('0x2d')](this));ami['on'](_0xa8b1('0x30'),this[_0xa8b1('0x31')][_0xa8b1('0x2d')](this));ami['on']('custom:queuesummary',this[_0xa8b1('0xb')]['bind'](this));ami['on'](_0xa8b1('0x32'),this['syncHangup']['bind'](this));ami['on'](_0xa8b1('0x33'),this[_0xa8b1('0x34')][_0xa8b1('0x2d')](this));ami['on'](_0xa8b1('0x35'),this[_0xa8b1('0x36')][_0xa8b1('0x2d')](this));ami['on'](_0xa8b1('0x37'),this[_0xa8b1('0x38')][_0xa8b1('0x2d')](this));ami['on'](_0xa8b1('0x39'),this[_0xa8b1('0x3a')][_0xa8b1('0x2d')](this));this['loopCampaigns']();this[_0xa8b1('0x3b')]();}function isNotNull(_0x22b98c){return _0x22b98c!==null&&!_[_0xa8b1('0x3c')](_0x22b98c);}function checkIsLoggedIn(_0x5da543,_0x2224f0){return function(){if(_0x2224f0<=0x0){_0x5da543[_0xa8b1('0x3d')]=_0xa8b1('0x3e');throw _0x5da543[_0xa8b1('0x3f')]+_0xa8b1('0x40');}};}function isActive(_0x163e3b){return _0x163e3b;}function checkIsActive(_0x5cbbac,_0x4c4c46){return function(){if(!isActive(_0x4c4c46)){_0x5cbbac['message']='NOT_ACTIVE';throw _0x5cbbac['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x51f204){return function(){if(!isNotNull(_0x51f204[_0xa8b1('0x41')])){_0x51f204[_0xa8b1('0x3d')]=_0xa8b1('0x42');throw _0x51f204[_0xa8b1('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x51f204[_0xa8b1('0x41')][_0xa8b1('0x43')])){_0x51f204['message']=_0xa8b1('0x42');throw _0x51f204[_0xa8b1('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xa8b1('0x44')](_0x51f204[_0xa8b1('0x41')]['Intervals']))){_0x51f204[_0xa8b1('0x3d')]=_0xa8b1('0x42');throw _0x51f204[_0xa8b1('0x3f')]+_0xa8b1('0x45');}};}function msgResponse(_0x494865,_0x25e41e,_0x4499fe){return{'action':_0x494865,'response':_0x25e41e,'message':_0x4499fe,'stack':_0x4499fe};}function myreject(_0x1ccf71){return function(_0xe6fb78){return _0x1ccf71(msgResponse(_0xa8b1('0x46'),_0xa8b1('0x47'),JSON[_0xa8b1('0x48')](_0xe6fb78)));};}function getSeconds(_0x5080c3,_0x479002){var _0x2c6794=moment(_0x5080c3)['milliseconds'](0x0);var _0x4fe7b1=moment(_0x479002)[_0xa8b1('0x49')](0x0);return _0x2c6794['diff'](_0x4fe7b1,_0xa8b1('0x4a'));}function emit(_0x953233,_0x4f8fc2,_0x428107){io['to'](_0x953233)[_0xa8b1('0x4b')](_0x4f8fc2,_0x428107);}function emitVoiceQueueSummary(_0x222325){if(_0x222325['type']===_0xa8b1('0x4c')){var _0x43d0fe={'id':_0x222325['id'],'name':_0x222325[_0xa8b1('0x3f')],'strategy':_0x222325[_0xa8b1('0x4d')],'answered':_0x222325[_0xa8b1('0x4e')],'available':_0x222325['available'],'loggedIn':_0x222325['loggedIn'],'pTalking':_0x222325[_0xa8b1('0x4f')],'sumBillable':_0x222325['sumBillable'],'sumDuration':_0x222325['sumDuration'],'sumHoldTime':_0x222325[_0xa8b1('0x50')]||0x0,'talking':_0x222325['talking'],'total':_0x222325[_0xa8b1('0x51')],'type':_0x222325[_0xa8b1('0x52')],'unmanaged':_0x222325[_0xa8b1('0x53')],'abandoned':_0x222325['abandoned'],'waiting':_0x222325[_0xa8b1('0x54')],'loggedInDb':_0x222325[_0xa8b1('0x55')],'dialActive':_0x222325['dialActive'],'dialMethod':_0x222325['dialMethod'],'dialOriginateCallerIdName':_0x222325[_0xa8b1('0x56')],'dialOriginateCallerIdNumber':_0x222325['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x222325[_0xa8b1('0x57')],'dialPrefix':_0x222325[_0xa8b1('0x58')],'outboundAnswerAgiCallsDay':_0x222325['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x222325['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x222325[_0xa8b1('0x59')],'outboundBusyCallsDay':_0x222325['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x222325[_0xa8b1('0x5a')],'outboundDropCallsDayACS':_0x222325[_0xa8b1('0x5b')],'outboundDropCallsDayCallersExit':_0x222325[_0xa8b1('0x5c')],'outboundDropCallsDayTimeout':_0x222325[_0xa8b1('0x5d')],'outboundNoAnswerCallsDay':_0x222325['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x222325[_0xa8b1('0x5e')],'outboundOriginateFailureCallsDay':_0x222325[_0xa8b1('0x5f')],'outboundReCallsDay':_0x222325[_0xa8b1('0x60')],'outboundRejectCallsDay':_0x222325['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x222325['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x222325[_0xa8b1('0x61')],'predictiveIntervalAvgHoldtime':_0x222325['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x222325[_0xa8b1('0x62')],'predictiveIntervalDroppedCallsCallersExit':_0x222325[_0xa8b1('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x222325[_0xa8b1('0x64')],'predictiveIntervalErlangCalls':_0x222325[_0xa8b1('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x222325[_0xa8b1('0x66')],'predictiveIntervalHitRate':_0x222325['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x222325[_0xa8b1('0x67')],'predictiveIntervalPauses':_0x222325[_0xa8b1('0x68')],'predictiveIntervalAvailable':_0x222325[_0xa8b1('0x69')],'predictiveIntervalTotalCalls':_0x222325[_0xa8b1('0x6a')],'message':_0x222325[_0xa8b1('0x3d')],'originated':_0x222325[_0xa8b1('0x6b')],'erlangCalls':_0x222325[_0xa8b1('0x6c')],'erlangCallToSecond':_0x222325[_0xa8b1('0x6d')],'erlangAbandonmentRate':_0x222325[_0xa8b1('0x6e')],'erlangBusyFactor':_0x222325[_0xa8b1('0x6f')],'startPredictive':_0x222325['startPredictive'],'startProgressive':_0x222325[_0xa8b1('0x27')]};if(_0x222325[_0xa8b1('0x70')]){_0x43d0fe['Trunk']={'id':_0x222325[_0xa8b1('0x70')]['id'],'name':_0x222325[_0xa8b1('0x70')][_0xa8b1('0x3f')],'active':_0x222325[_0xa8b1('0x70')][_0xa8b1('0x71')],'callerid':_0x222325[_0xa8b1('0x70')]['callerid']};}if(_0x222325[_0xa8b1('0x41')]){_0x43d0fe[_0xa8b1('0x41')]={'id':_0x222325[_0xa8b1('0x41')]['id'],'name':_0x222325[_0xa8b1('0x41')][_0xa8b1('0x3f')]};}var _0x11e0ce=md5(JSON[_0xa8b1('0x48')](_0x43d0fe));if(_0x222325[_0xa8b1('0x4')]!==_0x11e0ce){_0x222325[_0xa8b1('0x4')]=_0x11e0ce;emit(util[_0xa8b1('0x72')]('voice:queue:%s',_0x43d0fe['name']),'voice_queue:save',_0x43d0fe);}}}function emitCampaignSummary(_0x53fb60){if(_0x53fb60[_0xa8b1('0x52')]===_0xa8b1('0x73')){emit(util[_0xa8b1('0x72')](_0xa8b1('0x74'),_0x53fb60[_0xa8b1('0x3f')]),'campaign:save',_0x53fb60);}}function checkGetDataPredictive(_0x1fece8){if(isNotNull(_0x1fece8)&&!_['isEmpty'](_0x1fece8)){loggerPredictive[_0xa8b1('0x75')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xa8b1('0x75')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1fece8['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0xa8b1('0x76'),_0x1fece8['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa8b1('0x75')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1fece8[_0xa8b1('0x64')]);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x77'),_0x1fece8[_0xa8b1('0x63')]);loggerPredictive[_0xa8b1('0x75')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1fece8[_0xa8b1('0x78')]);loggerPredictive[_0xa8b1('0x75')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1fece8[_0xa8b1('0x62')]);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x79'));if(_0x1fece8[_0xa8b1('0x6a')]>0x0){if(!_[_0xa8b1('0x3c')](_0x1fece8[_0xa8b1('0x62')])&&_0x1fece8[_0xa8b1('0x62')]>0x0){return!![];}loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x7a'));if(!_[_0xa8b1('0x3c')](_0x1fece8[_0xa8b1('0x78')])&&_0x1fece8[_0xa8b1('0x78')]>0x0){return!![];}loggerPredictive['info'](_0xa8b1('0x7b'));}else{loggerPredictive['info'](_0xa8b1('0x7c'));}}else{loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x7d'));}return![];}function mergeDataErlangB(_0x3d7e9e){return function(_0x58290a){loggerPredictive[_0xa8b1('0x75')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0xa8b1('0x7e'),_0x58290a[_0xa8b1('0x6c')]);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x7f'),_0x58290a['erlangCallToSecond']);loggerPredictive[_0xa8b1('0x75')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58290a[_0xa8b1('0x6e')]);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x80'),_0x58290a[_0xa8b1('0x6f')]);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x81'),_0x58290a[_0xa8b1('0x6e')]);loggerPredictive[_0xa8b1('0x75')]('---------------------------');_[_0xa8b1('0x82')](_0x3d7e9e,_0x58290a);};}function getDiff(_0x17ef9b){var _0x407582=moment()[_0xa8b1('0x49')](0x0);var _0x34202e=moment(_0x17ef9b)[_0xa8b1('0x49')](0x0);return _0x407582[_0xa8b1('0x83')](_0x34202e,_0xa8b1('0x4a'));}function ifInterval(_0x18a98f,_0x312e84){if(_['isUndefined'](_0x312e84)){return![];}return getDiff(_0x312e84)<_0x18a98f*0x3c;}function freeVariablesPredictive(_0xfca14){if(isNotNull(_0xfca14)){if(!_['isUndefined'](_0xfca14[_0xa8b1('0x27')])){_0xfca14['startProgressive']=undefined;loggerPredictive[_0xa8b1('0x75')](_0xfca14['name'],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0xfca14[_0xa8b1('0x26')])){_0xfca14['startPredictive']=undefined;loggerPredictive[_0xa8b1('0x75')](_0xfca14[_0xa8b1('0x3f')],_0xa8b1('0x84'));}if(!_[_0xa8b1('0x3c')](_0xfca14['handlePredictive'])){clearInterval(_0xfca14[_0xa8b1('0x85')]);_0xfca14[_0xa8b1('0x85')]=undefined;loggerPredictive[_0xa8b1('0x75')](_0xfca14[_0xa8b1('0x3f')],_0xa8b1('0x86'));}}}function erlangb(_0x379e33,_0x110364){if(_0x110364===0x0){return 0x0;}var _0x41caad=0x1;for(var _0x388604=0x1;_0x388604<=_0x110364;_0x388604+=0x1){_0x41caad=0x1+_0x41caad*_0x388604/_0x379e33;}return 0x1/_0x41caad;}function isVoiceQueueOutbound(_0x4d0654){return _0x4d0654==='outbound';}function isNotPreview(_0x492fde){return _0x492fde!==_0xa8b1('0x20');}function isCampaignIvr(_0x37cd49){return _0x37cd49===_0xa8b1('0x73');}function getCallerId(_0x3351b7,_0x272434,_0x1f09f9){if(!_['isUndefined'](_0x1f09f9)&&typeof _0x1f09f9===_0xa8b1('0x87')&&!_[_0xa8b1('0x44')](_0x1f09f9)){if(!_['isUndefined'](_0x272434)&&typeof _0x272434===_0xa8b1('0x87')&&!_['isEmpty'](_0x272434)){return util[_0xa8b1('0x72')](_0xa8b1('0x88'),_0x272434,_0x1f09f9);}return util['format'](_0xa8b1('0x88'),_0x1f09f9,_0x1f09f9);}if(!_[_0xa8b1('0x3c')](_0x3351b7)&&typeof _0x3351b7===_0xa8b1('0x87')&&!_[_0xa8b1('0x44')](_0x3351b7)){return _0x3351b7;}return _0xa8b1('0x89');}function loggerCatchQueueSummary(_0x27d62e,_0x49cc31){return function(_0x185e9a){freeVariablesPredictive(_0x49cc31);emitVoiceQueueSummary(_0x49cc31);emitCampaignSummary(_0x49cc31);loggerSyncQueueSummary[_0xa8b1('0x8a')](_0x27d62e,util[_0xa8b1('0x8b')](_0x185e9a,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x58e1ae,_0x124004){return function(_0x2e9774){loggerPredictive[_0xa8b1('0x8a')](_0x124004[_0xa8b1('0x3f')],_0x58e1ae);loggerPredictive[_0xa8b1('0x8a')](_0x2e9774[_0xa8b1('0x8c')]);freeVariablesPredictive(_0x124004);};}function loggerCatch(_0x27d876){return function(_0x44e635){logger[_0xa8b1('0x8a')](_0x27d876,util[_0xa8b1('0x8b')](_0x44e635,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x547b25){return _0x547b25&&!_[_0xa8b1('0x3c')](_0x547b25)&&_0x547b25['length']>0x0;}function decremetOriginate(_0x4b6b7c){if(!_['isUndefined'](_0x4b6b7c)&&_0x4b6b7c!==null){if(typeof _0x4b6b7c[_0xa8b1('0x6b')]!==_0xa8b1('0x8d')){if(_0x4b6b7c[_0xa8b1('0x6b')]>0x0){_0x4b6b7c[_0xa8b1('0x6b')]-=0x1;}else{logger[_0xa8b1('0x8a')](_0xa8b1('0x8e'));}}}else{logger[_0xa8b1('0x8a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x158be3,_0x2a293b,_0x357c35){if(_0x2a293b>_0x357c35){for(var _0x4bde36=0x0;_0x4bde36<_0x2a293b-_0x357c35;_0x4bde36+=0x1){decremetOriginate(_0x158be3);}}}function loggerGetContactDialer(_0x286420,_0x3027af,_0x305972){return function(_0x5d8376){checkContactLowerLimitOriginate(_0x3027af,_0x305972,0x0);logger[_0xa8b1('0x8a')](_0x286420,util[_0xa8b1('0x8b')](_0x5d8376,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3f4ab5){return function(_0x7e69b){if(isNotNull(_0x7e69b)&&isNotNull(_0x7e69b[0x0])){if(_0x7e69b[0x0][_0xa8b1('0x8f')]>0x0){_0x3f4ab5[_0xa8b1('0x3d')]='RESCHEDULED_CONTACTS';logger[_0xa8b1('0x75')](_0xa8b1('0x90')+_0x3f4ab5[_0xa8b1('0x3f')],_0x7e69b[0x0][_0xa8b1('0x8f')],'contacts');}else{_0x3f4ab5['message']=_0xa8b1('0x91');logger[_0xa8b1('0x75')](_0xa8b1('0x92')+_0x3f4ab5['name']);}}};}function notSendMessagesQueue(_0x321f86){if(_0x321f86[_0xa8b1('0x93')]){freeVariablesPredictive(_0x321f86);if(_0x321f86[_0xa8b1('0x6b')]===0x0&&_0x321f86[_0xa8b1('0x94')]===0x0&&_0x321f86[_0xa8b1('0x54')]===0x0&&(_0x321f86['pTalking']||0x0)===0x0){_0x321f86[_0xa8b1('0x93')]=![];_0x321f86[_0xa8b1('0x95')]=0x0;_0x321f86[_0xa8b1('0x3d')]=_0xa8b1('0x96');loggerSyncQueueSummary[_0xa8b1('0x8a')](_0xa8b1('0x97'),_0x321f86[_0xa8b1('0x3f')],'is\x20not\x20active');}else{_0x321f86[_0xa8b1('0x3d')]=_0xa8b1('0x98');loggerSyncQueueSummary[_0xa8b1('0x8a')](_0xa8b1('0x97'),_0x321f86['name'],_0xa8b1('0x99'));}emitVoiceQueueSummary(_0x321f86);}}function notSendMessagesCampaign(_0xc6b2f5){if(_0xc6b2f5['sendMessageOneNotActive']){if(_0xc6b2f5[_0xa8b1('0x6b')]===0x0){_0xc6b2f5[_0xa8b1('0x93')]=![];_0xc6b2f5[_0xa8b1('0x3d')]=_0xa8b1('0x96');loggerSyncQueueSummary[_0xa8b1('0x8a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xc6b2f5[_0xa8b1('0x3f')],_0xa8b1('0x9a'));}else{_0xc6b2f5[_0xa8b1('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xa8b1('0x8a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xc6b2f5[_0xa8b1('0x3f')],'is\x20disactive');}emitCampaignSummary(_0xc6b2f5);}}function createObjHistory(_0x484482,_0x44329e,_0x31e7cf,_0x239c5a,_0x1e6d22){_0x484482[_0xa8b1('0x3d')]=_0x31e7cf;var _0x13a4e9=new Action(_0x484482,_0x44329e);var _0x39710b=new History(_0x13a4e9);_0x39710b[_0xa8b1('0x9b')]=_0x239c5a;_0x39710b['statedesc']=_0x1e6d22;_0x39710b['endtime']=_0x13a4e9[_0xa8b1('0x9c')];return _0x39710b;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x1e2677=this;setInterval(function(){_0x1e2677['clearZombieChannels'](_0x1e2677[_0xa8b1('0x25')],_0xa8b1('0x9d'));_0x1e2677[_0xa8b1('0x9e')](_0x1e2677[_0xa8b1('0x9f')],'[actions]');},0x32c8);};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x9e')]=function(_0x5ce8f,_0x597cb2){var _0x38237a=this;for(var _0x1cfcf8 in _0x5ce8f){if(typeof _0x5ce8f[_0x1cfcf8]!==_0xa8b1('0x8d')){this['sequence'][_0xa8b1('0x1c')](function(){if(!_[_0xa8b1('0xa1')](_0x5ce8f[_0x1cfcf8])){return ami[_0xa8b1('0xa2')]({'action':_0xa8b1('0xa3'),'channel':_0x5ce8f[_0x1cfcf8]['channel']})['catch'](function(_0x28ab42){if(_0x28ab42['message']===_0xa8b1('0xa4')){setTimeout(function(){if(_0x5ce8f[_0x1cfcf8]&&_0x5ce8f[_0x1cfcf8][_0xa8b1('0x52')]!=='ivr'){_0x38237a['updateOriginated'](_0x38237a[_0xa8b1('0x21')][_0x5ce8f[_0x1cfcf8][_0xa8b1('0xa5')]]);logger[_0xa8b1('0x8a')](_0xa8b1('0xa6'),_0x597cb2,_0x1cfcf8,_0x5ce8f[_0x1cfcf8][_0xa8b1('0xa5')]);delete _0x5ce8f[_0x1cfcf8];}if(_0x5ce8f[_0x1cfcf8]&&_0x5ce8f[_0x1cfcf8]['type']===_0xa8b1('0x73')){_0x38237a['updateOriginated'](_0x38237a[_0xa8b1('0x22')][_0x5ce8f[_0x1cfcf8][_0xa8b1('0xa5')]]);logger[_0xa8b1('0x8a')]('[Dialer][checkChannel][ivr]',_0x597cb2,_0x1cfcf8,_0x5ce8f[_0x1cfcf8]['queue']);delete _0x5ce8f[_0x1cfcf8];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x5899d2){return BPromise['resolve']()[_0xa8b1('0xa7')](cmHopper['countReScheduled'](_0x5899d2))[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xa9')));};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xaa')]=function(_0x5f4fb4){return BPromise[_0xa8b1('0xab')]()['then'](cmHopperBlack[_0xa8b1('0xaa')](_0x5f4fb4))['catch'](loggerCatch(_0xa8b1('0xac')));};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xad')]=function(_0x265b47){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](cmHopperBlack['checkIsBlackListIvr'](_0x265b47))[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xae')));};Dialer['prototype'][_0xa8b1('0xaf')]=function(_0x4d73e0){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](cmHopperHistory[_0xa8b1('0xb0')](_0x4d73e0))[_0xa8b1('0xa8')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xa8b1('0xb1')]=function(_0x125217){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](cmHopper[_0xa8b1('0xb1')](_0x125217))[_0xa8b1('0xa8')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0xa8b1('0xb2')]=function(_0x25d6c3,_0x3200c4,_0x23197b){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](cmHopper['unlockContact'](_0x25d6c3,_0x3200c4,_0x23197b))['catch'](loggerCatch(_0xa8b1('0xb3')));};Dialer['prototype'][_0xa8b1('0xb4')]=function(_0xb9ea6e,_0x1eaee7,_0x43f154,_0x580190,_0x4b5a0){return BPromise['resolve']()[_0xa8b1('0xa7')](cmHopper[_0xa8b1('0xb4')](_0xb9ea6e,_0x1eaee7,_0x43f154,_0x580190))['catch'](function(_0x329136){_0x4b5a0[_0xa8b1('0xb5')]-=_0x43f154;_0x4b5a0[_0xa8b1('0xb5')]=_0x4b5a0[_0xa8b1('0xb5')]>0x0?_0x4b5a0[_0xa8b1('0xb5')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x329136);});};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xb6')]=function(_0x3373bf,_0x24a15f,_0x14e062,_0x5a270e){return BPromise['resolve']()[_0xa8b1('0xa7')](cmHopper[_0xa8b1('0xb6')](_0x3373bf,_0x24a15f,_0x14e062))[_0xa8b1('0xa8')](function(_0x18d043){_0x5a270e[_0xa8b1('0xb5')]-=_0x24a15f;_0x5a270e[_0xa8b1('0xb5')]=_0x5a270e[_0xa8b1('0xb5')]>0x0?_0x5a270e['temp']:0x0;loggerCatch(_0xa8b1('0xb7'))(_0x18d043);});};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xb8')]=function(_0x4862d4){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](voiceQueueRt['getVoiceQueueRtPauses'](_0x4862d4))[_0xa8b1('0xa8')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xb9')]=function(_0x579d43){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](cmHopper[_0xa8b1('0xb9')](_0x579d43))[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xba')));};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xbb')]=function(_0x3545fa){return BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](cmHopperHistory[_0xa8b1('0xbb')](_0x3545fa))[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xbc')));};Dialer[_0xa8b1('0xa0')]['updateOriginated']=function(_0x4190b7){if(!_[_0xa8b1('0x3c')](_0x4190b7)&&_0x4190b7!==null){if(typeof _0x4190b7[_0xa8b1('0x6b')]!==_0xa8b1('0x8d')){if(_0x4190b7[_0xa8b1('0x6b')]>0x0){_0x4190b7[_0xa8b1('0x6b')]-=0x1;}else{logger['error'](_0xa8b1('0xbd'));}}}else{logger[_0xa8b1('0x8a')](_0xa8b1('0xbe'));}};Dialer['prototype'][_0xa8b1('0xbf')]=function(_0x5871f4,_0x35f843){var _0x2da966=this;return function(_0x36cbe9){_0x2da966[_0xa8b1('0xc0')](_0x35f843);logger[_0xa8b1('0x8a')](_0x5871f4,util[_0xa8b1('0x8b')](_0x36cbe9,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xa8b1('0xc1')]=function(_0x4c9ccf,_0x2b37d8,_0x783be){var _0x4977b8={'state':0x19,'statedesc':_0xa8b1('0xc2')};this[_0xa8b1('0xc0')](_0x2b37d8);this[_0xa8b1('0xc3')](_[_0xa8b1('0x82')](_0x4977b8,_[_0xa8b1('0xc4')](_0x783be,[_0xa8b1('0xc5'),_0xa8b1('0xc6'),_0xa8b1('0xc7'),_0xa8b1('0xc8'),_0xa8b1('0xc9')])),_0xa8b1('0xca'),_0xa8b1('0xcb'));logger['error'](_0x4c9ccf);};Dialer['prototype'][_0xa8b1('0xcc')]=function(_0x4c052a){return _0x4c052a===_0xa8b1('0xcd');};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xce')]=function(_0x572534){return!_[_0xa8b1('0x3c')](_0x572534)&&_0x572534&&!_[_0xa8b1('0x3c')](_0x572534['name'])&&!_[_0xa8b1('0x3c')](_0x572534[_0xa8b1('0x71')])&&_0x572534[_0xa8b1('0x71')]&&(this[_0xa8b1('0xcf')][util[_0xa8b1('0x72')]('SIP/%s',_0x572534[_0xa8b1('0x3f')])][_0xa8b1('0xa3')]===_0xa8b1('0xd0')||this[_0xa8b1('0xcf')][util[_0xa8b1('0x72')](_0xa8b1('0xd1'),_0x572534[_0xa8b1('0x3f')])]['status']===_0xa8b1('0xd2'));};Dialer['prototype'][_0xa8b1('0xc3')]=function(_0x5ccc75,_0x387f20,_0x56fd0f){this[_0xa8b1('0xbb')](_0x5ccc75)['catch'](loggerCatch(_0x387f20));this['moveContactManagedDialer'](_0x5ccc75)['catch'](loggerCatch(_0x56fd0f));};Dialer['prototype']['syncVarSet']=function(_0x1de5ae){var _0x1a8889=this[_0xa8b1('0x25')][_0x1de5ae[_0xa8b1('0xd3')]];var _0x32f8b3;if(!_[_0xa8b1('0xa1')](_0x1de5ae)&&!_['isNil'](_0x1de5ae[_0xa8b1('0xd4')])&&!_['isNil'](_0x1de5ae['variable']['amdstatus'])&&_0x1de5ae[_0xa8b1('0xd5')]==='xcally-motion-dialer'&&_0x1a8889){if(_0x1a8889[_0xa8b1('0x52')]!=='ivr'&&this[_0xa8b1('0x21')][_0x1a8889['queue']]['dialAMDActive']&&_0x1de5ae[_0xa8b1('0xd6')]===_0xa8b1('0xd7')){delete this[_0xa8b1('0x25')][_0x1de5ae[_0xa8b1('0xd3')]];this[_0xa8b1('0xc0')](this[_0xa8b1('0x21')][_0x1a8889[_0xa8b1('0xa5')]]);this[_0xa8b1('0x21')][_0x1a8889[_0xa8b1('0xa5')]][_0xa8b1('0xd8')]+=0x1;this[_0xa8b1('0x21')][_0x1a8889['queue']][_0xa8b1('0xd9')]+=0x1;_0x32f8b3=new Hangup(_0x1a8889,_0x1de5ae);_0x32f8b3[_0xa8b1('0x9b')]=0x12;_0x32f8b3[_0xa8b1('0xda')]=_0xa8b1('0xdb');_0x32f8b3[_0xa8b1('0xdc')]=_0xa8b1('0xdd');ami[_0xa8b1('0x4b')]('custom:amd',ut['buildObj'](_0x32f8b3,_0xa8b1('0xde')));this[_0xa8b1('0xc3')](_0x32f8b3,'[syncHangupInAMD][createHistory]',_0xa8b1('0xdf'));}if(_0x1a8889[_0xa8b1('0x52')]!==_0xa8b1('0x73')&&this['voiceQueues'][_0x1a8889[_0xa8b1('0xa5')]][_0xa8b1('0xe0')]&&_0x1de5ae[_0xa8b1('0xd6')]===_0xa8b1('0xe1')){var _0x5eda69=this;return new BPromise(function(_0x416f73,_0x4e8195){delete _0x5eda69[_0xa8b1('0x25')][_0x1de5ae['uniqueid']];_0x5eda69[_0xa8b1('0xc0')](_0x5eda69['voiceQueues'][_0x1a8889[_0xa8b1('0xa5')]]);_0x5eda69['voiceQueues'][_0x1a8889[_0xa8b1('0xa5')]]['outboundAnswerCallsDay']+=0x1;_0x5eda69[_0xa8b1('0x21')][_0x1a8889['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x416135=_0x5eda69['voiceQueues'][_0x1a8889[_0xa8b1('0xa5')]];var _0x3400b4=new Hangup(_0x1a8889,_0x1de5ae);_0x3400b4[_0xa8b1('0x9b')]=0x13;_0x3400b4[_0xa8b1('0xda')]=_0xa8b1('0xe2');_0x3400b4[_0xa8b1('0xdc')]='AMD';_0x3400b4[_0xa8b1('0xe3')]+=0x1;_0x3400b4[_0xa8b1('0xe4')]+=0x1;_0x3400b4[_0xa8b1('0xde')]=!![];ami['emit'](_0xa8b1('0xe5'),ut['buildObj'](_0x3400b4,_0xa8b1('0xde')));_0x5eda69[_0xa8b1('0xbb')](_0x3400b4)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xe6')));if(_0x3400b4[_0xa8b1('0xe7')]+_0x3400b4['countcongestionretry']+_0x3400b4['countnoanswerretry']+_0x3400b4[_0xa8b1('0xe8')]+_0x3400b4['countdropretry']+_0x3400b4[_0xa8b1('0xe9')]+_0x3400b4['countmachineretry']+_0x3400b4[_0xa8b1('0xea')]>=_0x416135['dialGlobalMaxRetry']){_0x5eda69[_0xa8b1('0xeb')](_0x3400b4,_0x416f73,_0x4e8195,'reason19\x20machine....');}else{if(_0x3400b4['countmachineretry']>=_0x416135[_0xa8b1('0xec')]){_0x5eda69[_0xa8b1('0xed')](_0x3400b4,_0x416f73,_0x4e8195,_0xa8b1('0xee'));}else{_0x5eda69[_0xa8b1('0xb1')]({'active':![],'countmachineretry':_0x3400b4[_0xa8b1('0xe3')],'scheduledat':moment()[_0xa8b1('0xef')](_0x416135[_0xa8b1('0xf0')],'minutes')[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x3400b4[_0xa8b1('0xc5')],'ListId':_0x3400b4[_0xa8b1('0xc6')],'VoiceQueueId':_0x3400b4['VoiceQueueId']||undefined,'CampaignId':_0x3400b4[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xf2')));_0x416f73({'reschedule':0x1});}}});}if(_0x1a8889[_0xa8b1('0x52')]==='ivr'&&this[_0xa8b1('0x22')][_0x1a8889[_0xa8b1('0xa5')]][_0xa8b1('0xe0')]&&_0x1de5ae[_0xa8b1('0xd6')]===_0xa8b1('0xd7')){delete this[_0xa8b1('0x25')][_0x1de5ae[_0xa8b1('0xd3')]];this[_0xa8b1('0xc0')](this['campaigns'][_0x1a8889[_0xa8b1('0xa5')]]);_0x32f8b3=new Hangup(_0x1a8889,_0x1de5ae);_0x32f8b3[_0xa8b1('0x9b')]=0x12;_0x32f8b3[_0xa8b1('0xda')]=_0xa8b1('0xdb');_0x32f8b3[_0xa8b1('0xdc')]=_0xa8b1('0xdd');ami[_0xa8b1('0x4b')]('custom:amd',ut[_0xa8b1('0xf3')](_0x32f8b3,'amd'));this[_0xa8b1('0xc3')](_0x32f8b3,_0xa8b1('0xf4'),'[syncHangupInAMDIvr]');}if(_0x1a8889[_0xa8b1('0x52')]===_0xa8b1('0x73')&&this[_0xa8b1('0x22')][_0x1a8889['queue']][_0xa8b1('0xe0')]&&_0x1de5ae[_0xa8b1('0xd6')]==='MACHINE'){var _0x5eda69=this;return new BPromise(function(_0x17d29e,_0xe5bc57){delete _0x5eda69['uniqueId'][_0x1de5ae[_0xa8b1('0xd3')]];_0x5eda69[_0xa8b1('0xc0')](_0x5eda69[_0xa8b1('0x22')][_0x1a8889['queue']]);_0x5eda69['campaigns'][_0x1a8889[_0xa8b1('0xa5')]]['outboundAnswerCallsDay']+=0x1;_0x5eda69[_0xa8b1('0x22')][_0x1a8889[_0xa8b1('0xa5')]][_0xa8b1('0xd9')]+=0x1;var _0x2cff8e=_0x5eda69[_0xa8b1('0x22')][_0x1a8889[_0xa8b1('0xa5')]];var _0x2060e3=new Hangup(_0x1a8889,_0x1de5ae);_0x2060e3['state']=0x13;_0x2060e3[_0xa8b1('0xda')]='Machine';_0x2060e3[_0xa8b1('0xdc')]=_0xa8b1('0xdd');_0x2060e3[_0xa8b1('0xe3')]+=0x1;_0x2060e3[_0xa8b1('0xe4')]+=0x1;_0x2060e3[_0xa8b1('0xde')]=!![];ami[_0xa8b1('0x4b')]('custom:amd',ut[_0xa8b1('0xf3')](_0x2060e3,_0xa8b1('0xde')));_0x5eda69['createHistory'](_0x2060e3)[_0xa8b1('0xa8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2060e3[_0xa8b1('0xe7')]+_0x2060e3[_0xa8b1('0xf5')]+_0x2060e3['countnoanswerretry']+_0x2060e3['countnosuchnumberretry']+_0x2060e3[_0xa8b1('0xf6')]+_0x2060e3[_0xa8b1('0xe9')]+_0x2060e3['countmachineretry']+_0x2060e3[_0xa8b1('0xea')]>=_0x2cff8e[_0xa8b1('0xf7')]){_0x5eda69[_0xa8b1('0xeb')](_0x2060e3,_0x17d29e,_0xe5bc57,'reason19\x20machine....');}else{if(_0x2060e3[_0xa8b1('0xe3')]>=_0x2cff8e['dialMachineMaxRetry']){_0x5eda69['createStateFinal'](_0x2060e3,_0x17d29e,_0xe5bc57,_0xa8b1('0xee'));}else{_0x5eda69[_0xa8b1('0xb1')]({'active':![],'countmachineretry':_0x2060e3[_0xa8b1('0xe3')],'scheduledat':moment()[_0xa8b1('0xef')](_0x2cff8e[_0xa8b1('0xf0')],'minutes')['format'](_0xa8b1('0xf1')),'ContactId':_0x2060e3['ContactId'],'ListId':_0x2060e3[_0xa8b1('0xc6')],'VoiceQueueId':_0x2060e3[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x2060e3[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xf2')));_0x17d29e({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xa8b1('0xf8')]=function(_0x4e1156){var _0x3148be=this[_0xa8b1('0x25')][_0x4e1156[_0xa8b1('0xd3')]];var _0x49d165=this;var _0x548aa2;if(_0x3148be&&_0x3148be['type']===_0xa8b1('0x73')){delete this[_0xa8b1('0x25')][_0x4e1156[_0xa8b1('0xd3')]];this[_0xa8b1('0xc0')](this[_0xa8b1('0x22')][_0x3148be['queue']]);this[_0xa8b1('0x22')][_0x3148be[_0xa8b1('0xa5')]]['ivrAnswerCallsDay']+=0x1;_0x548aa2=new Hangup(_0x3148be,_0x4e1156);this[_0xa8b1('0xbb')](_0x548aa2)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xf9')));this[_0xa8b1('0xb9')](_0x548aa2)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xfa')));}if(_0x3148be&&_0x3148be[_0xa8b1('0x52')]!==_0xa8b1('0x73')&&isNotNull(this[_0xa8b1('0x21')][_0x3148be[_0xa8b1('0xa5')]][_0xa8b1('0xfb')])){delete this[_0xa8b1('0x25')][_0x4e1156[_0xa8b1('0xd3')]];this[_0xa8b1('0xc0')](this['voiceQueues'][_0x3148be[_0xa8b1('0xa5')]]);this[_0xa8b1('0x21')][_0x3148be[_0xa8b1('0xa5')]]['outboundAnswerCallsDay']+=0x1;this[_0xa8b1('0x21')][_0x3148be['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x548aa2=new Hangup(_0x3148be,_0x4e1156);_0x548aa2['state']=0x10;_0x548aa2[_0xa8b1('0xda')]=_0xa8b1('0xfc');_0x548aa2[_0xa8b1('0xdc')]=_0xa8b1('0xfd');this[_0xa8b1('0xbb')](_0x548aa2)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xf9')));this[_0xa8b1('0xb9')](_0x548aa2)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xfa')));}if(_0x3148be&&_0x3148be[_0xa8b1('0x52')]!==_0xa8b1('0x73')&&!isNotNull(this['voiceQueues'][_0x3148be[_0xa8b1('0xa5')]][_0xa8b1('0xfb')])){delete this[_0xa8b1('0x25')][_0x4e1156[_0xa8b1('0xd3')]];this[_0xa8b1('0xc0')](this[_0xa8b1('0x21')][_0x3148be[_0xa8b1('0xa5')]]);this[_0xa8b1('0x21')][_0x3148be['queue']]['outboundUnknownCallsDay']+=0x1;_0x548aa2=new Hangup(_0x3148be,_0x4e1156);_0x548aa2['state']=0xc;_0x548aa2[_0xa8b1('0xda')]=_0x4e1156['cause-txt'];_0x548aa2['membername']='Unknow';this['createHistory'](_0x548aa2)['catch'](loggerCatch(_0xa8b1('0xf9')));this[_0xa8b1('0xb9')](_0x548aa2)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xfa')));}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x31')]=function(_0x37b7c8){var _0x5c7ad0=this[_0xa8b1('0x25')][_0x37b7c8[_0xa8b1('0xd3')]];var _0x257b08=this;if(this[_0xa8b1('0x21')][_0x37b7c8[_0xa8b1('0xa5')]]){if(_0x5c7ad0&&_0x5c7ad0[_0xa8b1('0x52')]!==_0xa8b1('0x73')){delete this['uniqueId'][_0x37b7c8['uniqueid']];this[_0xa8b1('0x21')][_0x37b7c8['queue']][_0xa8b1('0xd8')]+=0x1;var _0x94feac=new AgentComplete(_0x5c7ad0,_0x37b7c8);if(_0x37b7c8[_0xa8b1('0xfe')]==='agent'){_0x94feac[_0xa8b1('0xff')]=this[_0xa8b1('0x21')][_0x37b7c8['queue']]['dialQueueProject2']&&this[_0xa8b1('0x21')][_0x37b7c8[_0xa8b1('0xa5')]][_0xa8b1('0x100')]?moment()[_0xa8b1('0x72')](_0xa8b1('0xf1')):undefined;}this[_0xa8b1('0xbb')](_0x94feac)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xa8b1('0xb9')](_0x94feac)['catch'](loggerCatch(_0xa8b1('0x101')));}}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x2b')]=function(_0x5824b3){if(this['voiceQueues'][_0x5824b3[_0xa8b1('0xa5')]]){if(this[_0xa8b1('0x25')][_0x5824b3[_0xa8b1('0xd3')]]&&this[_0xa8b1('0x25')][_0x5824b3[_0xa8b1('0xd3')]][_0xa8b1('0x52')]!==_0xa8b1('0x73')){this[_0xa8b1('0xc0')](this['voiceQueues'][_0x5824b3[_0xa8b1('0xa5')]]);this[_0xa8b1('0x25')][_0x5824b3['uniqueid']][_0xa8b1('0x102')]=moment()['format'](_0xa8b1('0xf1'));}}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x103')]=function(_0x1cdda5){this[_0xa8b1('0xbb')](_0x1cdda5)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x1cdda5)['catch'](loggerCatch(_0xa8b1('0x104')));};Dialer[_0xa8b1('0xa0')]['syncQueueCallerAbandon']=function(_0x952f02){var _0x413f34=this[_0xa8b1('0x25')][_0x952f02[_0xa8b1('0xd3')]];var _0x4b0ee8=this;if(this[_0xa8b1('0x21')][_0x952f02['queue']]){if(_0x413f34&&_0x413f34['type']!==_0xa8b1('0x73')){delete this[_0xa8b1('0x25')][_0x952f02[_0xa8b1('0xd3')]];this[_0xa8b1('0xc0')](this[_0xa8b1('0x21')][_0x952f02[_0xa8b1('0xa5')]]);_0x413f34[_0xa8b1('0x105')]=moment()[_0xa8b1('0x72')](_0xa8b1('0xf1'));var _0x1c5ff=new QueueCallerAbandon(_0x413f34,_0x952f02);if(getSeconds(_0x413f34[_0xa8b1('0x105')],_0x413f34[_0xa8b1('0x106')])>=_0x413f34[_0xa8b1('0x107')]){this['voiceQueues'][_0x952f02[_0xa8b1('0xa5')]][_0xa8b1('0x64')]+=0x1;this['voiceQueues'][_0x952f02[_0xa8b1('0xa5')]][_0xa8b1('0x5d')]+=0x1;this[_0xa8b1('0x21')][_0x952f02[_0xa8b1('0xa5')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1c5ff[_0xa8b1('0x9b')]=0xa;_0x1c5ff[_0xa8b1('0xda')]=_0xa8b1('0x108');_0x1c5ff[_0xa8b1('0x109')]=_0xa8b1('0x10a');_0x1c5ff[_0xa8b1('0xff')]=this[_0xa8b1('0x21')][_0x952f02[_0xa8b1('0xa5')]][_0xa8b1('0x10b')]?moment()['format'](_0xa8b1('0xf1')):undefined;_0x1c5ff[_0xa8b1('0xf6')]+=0x1;_0x1c5ff[_0xa8b1('0xe4')]+=0x1;if(_0x1c5ff['countdropretry']>=this[_0xa8b1('0x21')][_0x952f02[_0xa8b1('0xa5')]]['dialDropMaxRetry']){this[_0xa8b1('0x103')](_0x1c5ff);}else{this[_0xa8b1('0xb1')]({'active':![],'countdropretry':_0x1c5ff[_0xa8b1('0xf6')],'scheduledat':moment()[_0xa8b1('0xef')](this['voiceQueues'][_0x952f02[_0xa8b1('0xa5')]][_0xa8b1('0x10c')],_0xa8b1('0x10d'))[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x413f34[_0xa8b1('0xc5')],'ListId':_0x413f34['ListId'],'VoiceQueueId':_0x413f34[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x413f34[_0xa8b1('0xc9')]||undefined})['catch'](loggerCatch(_0xa8b1('0x10e')));var _0x45c491=new History(_0x1c5ff);_0x45c491[_0xa8b1('0x9b')]=0xa;_0x45c491['statedesc']=_0xa8b1('0x108');_0x45c491[_0xa8b1('0x9c')]=moment()[_0xa8b1('0x72')](_0xa8b1('0xf1'));_0x45c491[_0xa8b1('0x10f')]=_0x45c491[_0xa8b1('0x9c')];_0x45c491[_0xa8b1('0x110')]=_0x1c5ff[_0xa8b1('0x110')];_0x45c491[_0xa8b1('0x111')]=_0x1c5ff[_0xa8b1('0x111')];this[_0xa8b1('0xbb')](_0x45c491)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x112')));}}else{this['voiceQueues'][_0x952f02[_0xa8b1('0xa5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xa8b1('0x21')][_0x952f02[_0xa8b1('0xa5')]][_0xa8b1('0x5c')]+=0x1;_0x1c5ff[_0xa8b1('0x9b')]=0xb;_0x1c5ff['statedesc']=_0xa8b1('0x113');_0x1c5ff[_0xa8b1('0x109')]='CALLEREXIT';_0x1c5ff[_0xa8b1('0xe9')]+=0x1;_0x1c5ff['countglobal']+=0x1;if(_0x1c5ff[_0xa8b1('0xe9')]>=this[_0xa8b1('0x21')][_0x952f02['queue']][_0xa8b1('0x114')]){this[_0xa8b1('0x103')](_0x1c5ff);}else{this[_0xa8b1('0xb1')]({'active':![],'countabandonedretry':_0x1c5ff[_0xa8b1('0xe9')],'scheduledat':moment()[_0xa8b1('0xef')](this['voiceQueues'][_0x952f02[_0xa8b1('0xa5')]][_0xa8b1('0x115')],_0xa8b1('0x10d'))[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x413f34['ContactId'],'ListId':_0x413f34[_0xa8b1('0xc6')],'VoiceQueueId':_0x413f34['VoiceQueueId']||undefined,'CampaignId':_0x413f34['CampaignId']||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x116')));var _0x45c491=new History(_0x1c5ff);_0x45c491[_0xa8b1('0x9b')]=0xb;_0x45c491['statedesc']=_0xa8b1('0x113');_0x45c491[_0xa8b1('0x9c')]=moment()['format'](_0xa8b1('0xf1'));_0x45c491[_0xa8b1('0x10f')]=_0x45c491['starttime'];_0x45c491[_0xa8b1('0x110')]=_0x1c5ff[_0xa8b1('0x110')];_0x45c491[_0xa8b1('0x111')]=_0x1c5ff['calleridnum'];this['createHistory'](_0x45c491)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x117')));}}}}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x34')]=function(_0x5b18b2){if(this[_0xa8b1('0x9f')][_0x5b18b2[_0xa8b1('0xd3')]]){this[_0xa8b1('0x9f')][_0x5b18b2['uniqueid']]['channel']=_0x5b18b2[_0xa8b1('0x118')];}if(this[_0xa8b1('0x25')][_0x5b18b2[_0xa8b1('0xd3')]]){this[_0xa8b1('0x25')][_0x5b18b2[_0xa8b1('0xd3')]][_0xa8b1('0x118')]=_0x5b18b2[_0xa8b1('0x118')];}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x38')]=function(_0x36a25e){if(strategy[this[_0xa8b1('0x21')][this[_0xa8b1('0x9f')][_0x36a25e[_0xa8b1('0x119')]][_0xa8b1('0xa5')]]['strategy']]===_0xa8b1('0x1b')){if(this[_0xa8b1('0x9f')][_0x36a25e[_0xa8b1('0x119')]]&&_[_0xa8b1('0xa1')](this[_0xa8b1('0x9f')][_0x36a25e['actionid']]['locked'])&&_0x36a25e['status']==='1'&&_0x36a25e[_0xa8b1('0x11a')]==='0'){if(this[_0xa8b1('0x11b')][_0x36a25e[_0xa8b1('0x11c')]]){if(!this[_0xa8b1('0x11b')][_0x36a25e[_0xa8b1('0x11c')]]['locked']){this[_0xa8b1('0x11b')][_0x36a25e['stateinterface']][_0xa8b1('0x11d')]=!![];this[_0xa8b1('0x9f')][_0x36a25e[_0xa8b1('0x119')]][_0xa8b1('0x11d')]=!![];this[_0xa8b1('0x9f')][_0x36a25e['actionid']][_0xa8b1('0x11c')]=_0x36a25e[_0xa8b1('0x11c')];}}}}else if((strategy[this[_0xa8b1('0x21')][this['actions'][_0x36a25e[_0xa8b1('0x119')]][_0xa8b1('0xa5')]]['strategy']]||_0xa8b1('0x11e'))===_0xa8b1('0x11e')){if(this[_0xa8b1('0x9f')][_0x36a25e[_0xa8b1('0x119')]]){if(this[_0xa8b1('0x11b')][_0x36a25e[_0xa8b1('0x11c')]]){this['actions'][_0x36a25e[_0xa8b1('0x119')]][_0xa8b1('0x11c')]=_0x36a25e[_0xa8b1('0x11c')];if(_['isNil'](this['queueBooked'][this[_0xa8b1('0x9f')][_0x36a25e[_0xa8b1('0x119')]][_0xa8b1('0xa5')]])){this['queueBooked'][this[_0xa8b1('0x9f')][_0x36a25e['actionid']][_0xa8b1('0xa5')]]=[];}this[_0xa8b1('0x29')][this[_0xa8b1('0x9f')][_0x36a25e[_0xa8b1('0x119')]][_0xa8b1('0xa5')]][_0xa8b1('0x11f')](_['merge'](_[_0xa8b1('0xc4')](this['actions'][_0x36a25e[_0xa8b1('0x119')]],[_0xa8b1('0x120'),_0xa8b1('0x11c')]),{'status':_0x36a25e[_0xa8b1('0xa3')],'paused':_0x36a25e[_0xa8b1('0x11a')]}));}}}};function unlockQueueStatus(_0x13419f,_0x2363ec){setTimeout(function(){if(_[_0xa8b1('0x3c')](_0x13419f['queueStatusComplete'])){loggerBooked[_0xa8b1('0x8a')]('[unlockQueueStatus][undefined]',_0x2363ec);}_0x13419f[_0xa8b1('0x121')]=!![];loggerBooked[_0xa8b1('0x75')](_0xa8b1('0x122'),_0x2363ec,JSON[_0xa8b1('0x48')](_[_0xa8b1('0xc4')](_0x13419f,[_0xa8b1('0x3f'),_0xa8b1('0x121')])));},0x1f3);}Dialer[_0xa8b1('0xa0')][_0xa8b1('0x3a')]=function(_0x256157){var _0x21b96f=this;var _0x3f8bee=_0x21b96f['voiceQueues'][_0x21b96f[_0xa8b1('0x9f')][_0x256157['actionid']][_0xa8b1('0xa5')]];if(strategy[this[_0xa8b1('0x21')][this['actions'][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]][_0xa8b1('0x4d')]]===_0xa8b1('0x1b')){if(this[_0xa8b1('0x9f')][_0x256157['actionid']]&&this['actions'][_0x256157[_0xa8b1('0x119')]]['stateinterface']){this['preview'][_0xa8b1('0x123')](this[_0xa8b1('0x9f')][_0x256157['actionid']][_0xa8b1('0x120')],this['actions'][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0x11c')])['catch'](function(_0x4af393){logger[_0xa8b1('0x8a')](_0xa8b1('0x124'),util[_0xa8b1('0x8b')](_0x4af393,{'showHidden':![],'depth':null}));})[_0xa8b1('0x1e')](function(){_0x21b96f[_0xa8b1('0xc0')](_0x21b96f[_0xa8b1('0x21')][_0x21b96f[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]]);_0x21b96f[_0xa8b1('0x11b')][_0x21b96f[_0xa8b1('0x9f')][_0x256157['actionid']][_0xa8b1('0x11c')]]['locked']=![];delete _0x21b96f[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]];unlockQueueStatus(_0x3f8bee);});}else{this[_0xa8b1('0xc0')](this['voiceQueues'][this[_0xa8b1('0x9f')][_0x256157['actionid']][_0xa8b1('0xa5')]]);this[_0xa8b1('0xb1')]({'active':![],'ContactId':this[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]]['ContactId'],'ListId':this['actions'][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xc6')],'VoiceQueueId':this[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xc8')]||undefined,'CampaignId':this['actions'][_0x256157['actionid']][_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x125')));delete this[_0xa8b1('0x9f')][_0x256157['actionid']];unlockQueueStatus(_0x3f8bee);}}else if((strategy[this[_0xa8b1('0x21')][this['actions'][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]][_0xa8b1('0x4d')]]||'rrmemory')===_0xa8b1('0x11e')){var _0x5d3065;if(this[_0xa8b1('0x9f')][_0x256157['actionid']]&&!_['isEmpty'](this['queueBooked'][this[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]])){if(this[_0xa8b1('0x2a')][_0x21b96f[_0xa8b1('0x9f')][_0x256157['actionid']][_0xa8b1('0xa5')]]){this[_0xa8b1('0x2a')][_0x21b96f['actions'][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]]=this[_0xa8b1('0x2a')][this[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]]['queue']]?this[_0xa8b1('0x2a')][this[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]]['queue']]:this[_0xa8b1('0x29')][this[_0xa8b1('0x9f')][_0x256157['actionid']][_0xa8b1('0xa5')]]?this[_0xa8b1('0x29')][this['actions'][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]][_0xa8b1('0x126')]||0x0:0x0;}this[_0xa8b1('0x29')][this[_0xa8b1('0x9f')][_0x256157[_0xa8b1('0x119')]][_0xa8b1('0xa5')]]['_rr']=this['queueBookedRR'][this['actions'][_0x256157[_0xa8b1('0x119')]]['queue']];for(var _0x213536=0x0;_0x213536=0x0;})[_0xa8b1('0xa8')](myreject(_0x1312e6)));}}else{_0x4a398d[_0xa8b1('0x11f')](ami[_0xa8b1('0xa2')]({'action':'command','command':util[_0xa8b1('0x72')]('iftime\x20%s,%s',_0x2dbfb3,!_[_0xa8b1('0x3c')](config[_0xa8b1('0x13f')][_0x191769])?_0x191769:'')})[_0xa8b1('0xa7')](function(_0x53cad5){return _0x53cad5['content'][_0xa8b1('0x141')](_0xa8b1('0x142'))>=0x0;})[_0xa8b1('0xa8')](myreject(_0x1312e6)));}BPromise[_0xa8b1('0x143')](_0x4a398d)[_0xa8b1('0xa7')](function(_0x22f77b){var _0xd296e5=_[_0xa8b1('0x144')](_0x22f77b);if(_0xd296e5){return _0x58efac(_0xd296e5);}else{_0xfaa265[_0xa8b1('0x3d')]=_0x3bc049?_0xa8b1('0x145'):_0xa8b1('0x146');return _0x1312e6(msgResponse(_0xa8b1('0x147'),_0xa8b1('0x137'),_0xa8b1('0x148')+_0x3bc049+'\x20'+_0xf52af8+_0xa8b1('0x149')+util[_0xa8b1('0x8b')](_0x2dbfb3,{'showHidden':![],'depth':null})+_0xa8b1('0x14a')+_0x191769));}})[_0xa8b1('0xa8')](function(_0x5a099b){return _0x1312e6(msgResponse(_0xa8b1('0x135'),_0xa8b1('0x137'),JSON[_0xa8b1('0x48')](_0x5a099b)));});});};Dialer['prototype'][_0xa8b1('0x14b')]=function(_0x3f381f){var _0x355139=this;return function(){switch(_0x3f381f[_0xa8b1('0x14c')]){case'progressive':freeVariablesPredictive(_0x3f381f);_0x355139[_0xa8b1('0x14d')](_0x3f381f,0x1);break;case _0xa8b1('0x14e'):freeVariablesPredictive(_0x3f381f);_0x355139[_0xa8b1('0x14d')](_0x3f381f,_0x3f381f[_0xa8b1('0x14f')]);break;case _0xa8b1('0x150'):_0x355139[_0xa8b1('0x150')](_0x3f381f);break;case _0xa8b1('0x9'):freeVariablesPredictive(_0x3f381f);_0x355139['handlePower'](_0x3f381f,0x1);break;default:freeVariablesPredictive(_0x3f381f);logger[_0xa8b1('0x8a')]('Queue',_0x3f381f[_0xa8b1('0x3f')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0xa8b1('0x151')]=function(_0x5be514){var _0x2e7a5f=this;return function(){_0x2e7a5f['handleIvr'](_0x5be514);};};Dialer[_0xa8b1('0xa0')]['syncQueueSummary']=function(_0x17e2b9){var _0x1a4926=this;if(isNotPreview(_0x17e2b9[_0xa8b1('0x14c')])){if(isVoiceQueueOutbound(_0x17e2b9['type'])&&isActive(_0x17e2b9[_0xa8b1('0x152')])){_0x17e2b9[_0xa8b1('0x93')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x17e2b9,_0x17e2b9[_0xa8b1('0x153')]))[_0xa8b1('0xa7')](checkIsActive(_0x17e2b9,_0x17e2b9['dialActive']))[_0xa8b1('0xa7')](checkInterval(_0x17e2b9))[_0xa8b1('0xa7')](_0x1a4926[_0xa8b1('0x154')](_0x17e2b9))[_0xa8b1('0xa7')](_0x1a4926['checkIfTime'](_0x17e2b9[_0xa8b1('0x155')],_0x17e2b9['dialTimezone'],_0x17e2b9[_0xa8b1('0x3f')],_0x17e2b9))['then'](_0x1a4926[_0xa8b1('0x136')](_0x17e2b9['Interval'],_0x17e2b9[_0xa8b1('0x156')],_0x17e2b9[_0xa8b1('0x3f')],_0x17e2b9))['then'](_0x1a4926[_0xa8b1('0x14b')](_0x17e2b9))[_0xa8b1('0xa8')](loggerCatchQueueSummary(_0xa8b1('0x157'),_0x17e2b9));}else{notSendMessagesQueue(_0x17e2b9);}}else{freeVariablesPredictive(_0x17e2b9);}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x132')]=function(){var _0x21b516=this;var _0x23fca1;for(var _0x7ee542 in this[_0xa8b1('0x22')]){if(typeof this[_0xa8b1('0x22')][_0x7ee542]!==_0xa8b1('0x8d')){_0x23fca1=this['campaigns'][_0x7ee542];if(isCampaignIvr(_0x23fca1[_0xa8b1('0x52')])&&isActive(_0x23fca1[_0xa8b1('0x71')])){_0x23fca1[_0xa8b1('0x93')]=!![];BPromise[_0xa8b1('0xab')]()[_0xa8b1('0xa7')](checkIsActive(_0x23fca1,_0x23fca1['active']))['then'](checkInterval(_0x23fca1))[_0xa8b1('0xa7')](_0x21b516[_0xa8b1('0x154')](_0x23fca1))[_0xa8b1('0xa7')](_0x21b516['checkIfTime'](_0x23fca1[_0xa8b1('0x155')],_0x23fca1['dialTimezone'],_0x23fca1[_0xa8b1('0x3f')],_0x23fca1))[_0xa8b1('0xa7')](_0x21b516[_0xa8b1('0x136')](_0x23fca1['Interval'],_0x23fca1[_0xa8b1('0x156')],_0x23fca1['name'],_0x23fca1))[_0xa8b1('0xa7')](_0x21b516[_0xa8b1('0x151')](_0x23fca1))['catch'](loggerCatchQueueSummary(_0xa8b1('0x158'),_0x23fca1));}else{notSendMessagesCampaign(_0x23fca1);}}}};function getCallerIdRandom(_0x36e6bf,_0x4ba971){var _0x4572e0;var _0xf68411;var _0x42dc31;if(_0x4ba971<=0x0){_0x4ba971=0x1;}_0x4572e0=new RegExp(_0xa8b1('0x159')+_0x4ba971+'}$');_0xf68411=Math[_0xa8b1('0x15a')](0xa,_0x4ba971-0x1);_0x42dc31=Math['pow'](0xa,_0x4ba971)-0x1;return util[_0xa8b1('0x72')]('%s',_[_0xa8b1('0x15b')](_0x36e6bf,_0x4572e0,_[_0xa8b1('0x15c')](_0xf68411,_0x42dc31)));}function extractCalleridName(_0x4159d3){var _0x10b265=_0x4159d3['match'](/"(.*?)"/);return _0x10b265?_0x10b265[0x1]:_0x4159d3;}function extractCalleridNumber(_0x14ee33){var _0x4d8151=_0x14ee33['match'](/<(.*?)>/);return _0x4d8151?_0x4d8151[0x1]:_0x14ee33;}Dialer[_0xa8b1('0xa0')][_0xa8b1('0x15d')]=function(_0x4907f5,_0x159b35){var _0x1146f7=this;var _0x1d9fc8=uuid['v4']();this['actions'][_0x1d9fc8]=new Action(_0x4907f5,_0x159b35,_0x1d9fc8);return new BPromise(function(_0x50e81b,_0x2b33cc){if(_['isUndefined'](_0x4907f5)&&typeof _0x4907f5!==_0xa8b1('0x15e')){return _0x2b33cc(msgResponse(_0xa8b1('0x15f'),_0xa8b1('0x137'),_0xa8b1('0x160')));}if(_['isUndefined'](_0x159b35[_0xa8b1('0x161')][_0xa8b1('0x162')])||_0x159b35[_0xa8b1('0x161')]['phone']===null){return _0x2b33cc(msgResponse('originate',_0xa8b1('0x137'),'contact\x20is\x20undefine'));}var _0x1b6e8e={'XMD-CALLERID':_0x1146f7['actions'][_0x1d9fc8][_0xa8b1('0x163')](),'XMD-AGI':_0x4907f5[_0xa8b1('0xfb')]?util[_0xa8b1('0x72')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4907f5[_0xa8b1('0xfb')]):'NONE','XMD-AGIAFTER':_0x4907f5[_0xa8b1('0x10b')]?util[_0xa8b1('0x72')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4907f5['dialQueueProject2']):_0xa8b1('0x164'),'XMD-QUEUE':_0x4907f5[_0xa8b1('0x52')]===_0xa8b1('0x4c')?util[_0xa8b1('0x72')]('\x22%s,%s%s,,,%s\x22',_0x4907f5[_0xa8b1('0x3f')],_0x4907f5[_0xa8b1('0x165')]||'',_0x4907f5[_0xa8b1('0x100')]?'c':'',_0x4907f5[_0xa8b1('0x107')]||0x3):_0xa8b1('0x164'),'XMD-CONTACTID':_0x159b35[_0xa8b1('0xc5')],'XMD-CDRTYPE':_0xa8b1('0x8'),'CALLERID(all)':_0x1146f7[_0xa8b1('0x9f')][_0x1d9fc8][_0xa8b1('0x163')](),'XMD-AMD':_0x4907f5[_0xa8b1('0xe0')]?_0xa8b1('0x166'):_0xa8b1('0x164'),'XMD-DESTINATION':_0xa8b1('0x167')};if(_0x4907f5[_0xa8b1('0xe0')]){_0x1b6e8e[_0xa8b1('0x168')]=_0x4907f5[_0xa8b1('0x169')]||0x9c4;_0x1b6e8e[_0xa8b1('0x16a')]=_0x4907f5[_0xa8b1('0x16b')]||0x5dc;_0x1b6e8e[_0xa8b1('0x16c')]=_0x4907f5['dialAMDAfterGreetingSilence']||0x320;_0x1b6e8e[_0xa8b1('0x16d')]=_0x4907f5['dialAMDTotalAnalysisTime']||0x1388;_0x1b6e8e['XMD-AMDMINWORDLENGTH']=_0x4907f5[_0xa8b1('0x16e')]||0x64;_0x1b6e8e[_0xa8b1('0x16f')]=_0x4907f5['dialAMDBetweenWordsSilence']||0x32;_0x1b6e8e[_0xa8b1('0x170')]=_0x4907f5[_0xa8b1('0x171')]||0x3;_0x1b6e8e[_0xa8b1('0x172')]=_0x4907f5['dialAMDSilenceThreshold']||0x100;_0x1b6e8e[_0xa8b1('0x173')]=_0x4907f5['dialAMDMaximumWordLength']||0x1388;}if(_0x4907f5[_0xa8b1('0x52')]===_0xa8b1('0x4c')){_0x1b6e8e[_0xa8b1('0x174')]=_0x159b35[_0xa8b1('0xc8')];}else{_0x1b6e8e['XMD-CAMPAIGNID']=_0x159b35[_0xa8b1('0xc9')];}for(var _0x36edce in _0x159b35[_0xa8b1('0x161')]){if(typeof _0x159b35[_0xa8b1('0x161')][_0x36edce]!==_0xa8b1('0x8d')){if(isNotNull(_0x159b35[_0xa8b1('0x161')][_0x36edce])&&_0x36edce!=='id'&&_0x36edce!==_0xa8b1('0x175')&&_0x36edce!==_0xa8b1('0x176')&&_0x36edce!==_0xa8b1('0x177')){_0x1b6e8e[util['format'](_0xa8b1('0x178'),'XMD-',_[_0xa8b1('0x179')](_0x36edce))]=_0x159b35['Contact'][_0x36edce];}}}var _0x2b1f6a=_0x1146f7[_0xa8b1('0xce')](_0x4907f5[_0xa8b1('0x70')])?getCallerId(_0x4907f5[_0xa8b1('0x70')][_0xa8b1('0x17a')],_0x4907f5[_0xa8b1('0x56')],_0x4907f5[_0xa8b1('0x17b')]>0x0?getCallerIdRandom(_0x4907f5[_0xa8b1('0x17c')],_0x4907f5[_0xa8b1('0x17b')]):_0x4907f5[_0xa8b1('0x17c')]):getCallerId(_[_0xa8b1('0xa1')](_0x4907f5[_0xa8b1('0x17d')])?_0x4907f5[_0xa8b1('0x70')][_0xa8b1('0x17a')]:_0x4907f5[_0xa8b1('0x17d')]['callerid'],_0x4907f5['dialOriginateCallerIdName'],_0x4907f5['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4907f5[_0xa8b1('0x17c')],_0x4907f5[_0xa8b1('0x17b')]):_0x4907f5['dialOriginateCallerIdNumber']);if(_0x2b1f6a){_0x1b6e8e[_0xa8b1('0x17e')]=_0x1146f7[_0xa8b1('0x9f')][_0x1d9fc8][_0xa8b1('0x17f')]=extractCalleridName(_0x2b1f6a);_0x1b6e8e[_0xa8b1('0x180')]=_0x1146f7[_0xa8b1('0x9f')][_0x1d9fc8]['originatecalleridnum']=extractCalleridNumber(_0x2b1f6a);}return ami[_0xa8b1('0xa2')]({'actionid':_0x1d9fc8,'action':'originate','channel':_0x1146f7[_0xa8b1('0xce')](_0x4907f5[_0xa8b1('0x70')])?util[_0xa8b1('0x72')](_0xa8b1('0x181'),_0x4907f5[_0xa8b1('0x70')][_0xa8b1('0x3f')],isNotNull(_0x4907f5['dialPrefix'])?_0x4907f5[_0xa8b1('0x58')][_0xa8b1('0x182')]()||'':'',_0x4907f5[_0xa8b1('0x183')]>0x0?_0x159b35['Contact'][_0xa8b1('0x162')][_0xa8b1('0x184')](_0x4907f5[_0xa8b1('0x183')]):_0x159b35[_0xa8b1('0x161')][_0xa8b1('0x162')]):util[_0xa8b1('0x72')](_0xa8b1('0x181'),_[_0xa8b1('0xa1')](_0x4907f5[_0xa8b1('0x17d')])?_0x4907f5[_0xa8b1('0x70')][_0xa8b1('0x3f')]:_0x4907f5[_0xa8b1('0x17d')][_0xa8b1('0x3f')],isNotNull(_0x4907f5[_0xa8b1('0x58')])?_0x4907f5[_0xa8b1('0x58')][_0xa8b1('0x182')]()||'':'',_0x4907f5['dialCutDigit']>0x0?_0x159b35['Contact'][_0xa8b1('0x162')]['substring'](_0x4907f5[_0xa8b1('0x183')]):_0x159b35[_0xa8b1('0x161')]['phone']),'callerid':_0x2b1f6a,'Exten':_0xa8b1('0x167'),'Context':_0xa8b1('0x185'),'Priority':'1','variable':_0x1b6e8e,'timeout':(_0x4907f5[_0xa8b1('0x57')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1d9fc8})[_0xa8b1('0xa7')](function(_0xa1768d){return _0x50e81b(_0xa1768d);})[_0xa8b1('0xa8')](function(_0xb6c55f){_0x4907f5[_0xa8b1('0x5f')]+=0x1;var _0x3bed88=new History(_0x1146f7[_0xa8b1('0x9f')][_0x1d9fc8]);logger[_0xa8b1('0x8a')](util['format']('[originateError]:\x20%s',JSON[_0xa8b1('0x48')](_0xb6c55f)));_0x3bed88[_0xa8b1('0x9b')]=0xe;_0x3bed88[_0xa8b1('0xda')]='OriginateError';_0x3bed88[_0xa8b1('0x9c')]=moment()[_0xa8b1('0x72')](_0xa8b1('0xf1'));_0x3bed88[_0xa8b1('0x10f')]=_0x3bed88['starttime'];_0x1146f7[_0xa8b1('0xbb')](_0x3bed88)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x186')));_0x1146f7[_0xa8b1('0xb9')](_0x3bed88)[_0xa8b1('0xa8')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x1146f7[_0xa8b1('0x9f')][_0x1d9fc8];return _0x2b33cc(msgResponse(_0xa8b1('0x15f'),_0xa8b1('0x47'),_0xa8b1('0x187')));});});});};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x2f')]=function(_0x10cd96){var _0xe23532=this['actions'][_0x10cd96[_0xa8b1('0x119')]];if(_0xe23532){delete this[_0xa8b1('0x9f')][_0x10cd96[_0xa8b1('0x119')]];_0xe23532[_0xa8b1('0x106')]=moment()['format'](_0xa8b1('0xf1'));var _0x279440=_0xe23532[_0xa8b1('0x52')]==='ivr'?this[_0xa8b1('0x22')][_0xe23532[_0xa8b1('0xa5')]]:this[_0xa8b1('0x21')][_0xe23532[_0xa8b1('0x188')]()];if(!this[_0xa8b1('0xcc')](_0x10cd96[_0xa8b1('0x189')])){this[_0xa8b1('0xc0')](_0x279440);return this[_0xa8b1('0x18a')](_0xe23532,_0x279440,_0x10cd96)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x18b')));}this[_0xa8b1('0x25')][_0x10cd96[_0xa8b1('0xd3')]]=_0xe23532;}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x18c')]=function(_0x5bcb16,_0x359dbc,_0x10f504){var _0x589438=new History(_0x359dbc);if(_0x589438[_0xa8b1('0xe7')]+_0x589438[_0xa8b1('0xf5')]+_0x589438[_0xa8b1('0x18d')]+_0x589438[_0xa8b1('0xe8')]+_0x589438['countdropretry']+_0x589438[_0xa8b1('0xe9')]+_0x589438[_0xa8b1('0xe3')]+_0x589438['countagentrejectretry']>=_0x10f504[_0xa8b1('0xf7')]-0x1){return!![];}switch(_0x5bcb16){case 0x3:if(_0x589438[_0xa8b1('0x18d')]>=_0x10f504[_0xa8b1('0x18e')]-0x1){return!![];}this[_0xa8b1('0xb1')]({'active':![],'countnoanswerretry':_0x589438['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x10f504['dialNoAnswerRetryFrequency'],_0xa8b1('0x10d'))[_0xa8b1('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x589438['ContactId'],'ListId':_0x589438['ListId'],'VoiceQueueId':_0x589438[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x589438['CampaignId']||undefined})['catch'](loggerCatch(_0xa8b1('0x18f')));break;case 0x5:if(_0x589438[_0xa8b1('0xe7')]>=_0x10f504[_0xa8b1('0x190')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x589438[_0xa8b1('0xe7')]+=0x1,'scheduledat':moment()['add'](_0x10f504[_0xa8b1('0x191')],_0xa8b1('0x10d'))['format'](_0xa8b1('0xf1')),'ContactId':_0x589438[_0xa8b1('0xc5')],'ListId':_0x589438[_0xa8b1('0xc6')],'VoiceQueueId':_0x589438['VoiceQueueId']||undefined,'CampaignId':_0x589438[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x192')));break;case 0x8:if(_0x589438[_0xa8b1('0xf5')]>=_0x10f504[_0xa8b1('0x193')]-0x1){return!![];}this[_0xa8b1('0xb1')]({'active':![],'countcongestionretry':_0x589438[_0xa8b1('0xf5')]+=0x1,'scheduledat':moment()[_0xa8b1('0xef')](_0x10f504[_0xa8b1('0x194')],'minutes')[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x589438[_0xa8b1('0xc5')],'ListId':_0x589438['ListId'],'VoiceQueueId':_0x589438[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x589438[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x589438[_0xa8b1('0xe8')]>=_0x10f504[_0xa8b1('0x195')]-0x1){return!![];}else{this[_0xa8b1('0xb1')]({'active':![],'countnosuchnumberretry':_0x589438[_0xa8b1('0xe8')]+=0x1,'scheduledat':moment()[_0xa8b1('0xef')](_0x10f504[_0xa8b1('0x196')],_0xa8b1('0x10d'))[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x589438['ContactId'],'ListId':_0x589438[_0xa8b1('0xc6')],'VoiceQueueId':_0x589438[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x589438[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x197')));}break;case 0xa:if(_0x589438['countdropretry']>=_0x10f504[_0xa8b1('0x198')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x589438[_0xa8b1('0xf6')]+=0x1,'scheduledat':moment()[_0xa8b1('0xef')](_0x10f504[_0xa8b1('0x10c')],_0xa8b1('0x10d'))[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x589438[_0xa8b1('0xc5')],'ListId':_0x589438[_0xa8b1('0xc6')],'VoiceQueueId':_0x589438[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x589438['CampaignId']||undefined})[_0xa8b1('0xa8')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x589438[_0xa8b1('0xe9')]>=_0x10f504[_0xa8b1('0x114')]-0x1){return!![];}this[_0xa8b1('0xb1')]({'active':![],'countabandonedretry':_0x589438[_0xa8b1('0xe9')]+=0x1,'scheduledat':moment()[_0xa8b1('0xef')](_0x10f504[_0xa8b1('0x115')],_0xa8b1('0x10d'))[_0xa8b1('0x72')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x589438[_0xa8b1('0xc5')],'ListId':_0x589438[_0xa8b1('0xc6')],'VoiceQueueId':_0x589438[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x589438[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x116')));break;case 0x13:if(_0x589438['countmachineretry']>=_0x10f504[_0xa8b1('0xec')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x589438[_0xa8b1('0xe3')]+=0x1,'scheduledat':moment()[_0xa8b1('0xef')](_0x10f504[_0xa8b1('0xf0')],'minutes')[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x589438['ContactId'],'ListId':_0x589438[_0xa8b1('0xc6')],'VoiceQueueId':_0x589438[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x589438['CampaignId']||undefined})['catch'](loggerCatch(_0xa8b1('0xf2')));break;case 0x14:if(_0x589438['countagentrejectretry']>=_0x10f504[_0xa8b1('0x199')]-0x1){return!![];}this[_0xa8b1('0xb1')]({'active':![],'countagentrejectretry':_0x589438['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xa8b1('0xef')](_0x10f504[_0xa8b1('0x19a')],_0xa8b1('0x10d'))[_0xa8b1('0x72')](_0xa8b1('0xf1')),'ContactId':_0x589438['ContactId'],'ListId':_0x589438[_0xa8b1('0xc6')],'VoiceQueueId':_0x589438['VoiceQueueId']||undefined,'CampaignId':_0x589438['CampaignId']||undefined})['catch'](loggerCatch(_0xa8b1('0x19b')));break;default:return!![];}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x18a')]=function(_0x4ae80b,_0x41420c,_0x32ac93){var _0x44de50=this;var _0x446a60=new History(_0x4ae80b);return new BPromise(function(_0xdb04b,_0x3a57bc){if(_['isUndefined'](_0x41420c)&&typeof _0x41420c!==_0xa8b1('0x15e')){return _0x3a57bc(msgResponse(_0xa8b1('0x19c'),'Failure',_0xa8b1('0x19d')));}if(_[_0xa8b1('0x3c')](_0x32ac93)&&typeof _0x32ac93!==_0xa8b1('0x15e')){return _0x3a57bc(msgResponse(_0xa8b1('0x19c'),'Failure',_0xa8b1('0x19e')));}switch(_0x32ac93[_0xa8b1('0xfe')]){case'0':_0x41420c['outboundNoSuchCallsDay']+=0x1;_0x446a60[_0xa8b1('0x9b')]=0x0;_0x446a60[_0xa8b1('0xda')]=_0xa8b1('0x19f');_0x446a60[_0xa8b1('0xe8')]+=0x1;_0x446a60[_0xa8b1('0xe4')]+=0x1;ami[_0xa8b1('0x4b')]('custom:agentnosuchnumber',ut['buildObj'](_0x4ae80b,'nosuchnumber'));_0x44de50[_0xa8b1('0xbb')](_0x446a60)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xe6')));if(_0x44de50[_0xa8b1('0x18c')](0x0,_0x4ae80b,_0x41420c)){if(_0x446a60['countnosuchnumberretry']>=_0x41420c['dialNoSuchNumberMaxRetry']){_0x44de50['createStateFinal'](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1a0'));}else{_0x44de50['stateGlobal'](_0x446a60,_0xdb04b,_0x3a57bc,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x41420c[_0xa8b1('0x1a1')]+=0x1;_0x446a60['state']=0x3;_0x446a60[_0xa8b1('0xda')]=_0xa8b1('0x1a2');_0x446a60[_0xa8b1('0x18d')]+=0x1;_0x446a60['countglobal']+=0x1;ami[_0xa8b1('0x4b')](_0xa8b1('0x1a3'),ut[_0xa8b1('0xf3')](_0x4ae80b,'noanswer'));_0x44de50['createHistory'](_0x446a60)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x1a4')));if(_0x44de50['checkRetriveMax'](0x3,_0x4ae80b,_0x41420c)){if(_0x446a60[_0xa8b1('0x18d')]>=_0x41420c[_0xa8b1('0x18e')]){_0x44de50[_0xa8b1('0xed')](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1a5'));}else{_0x44de50[_0xa8b1('0xeb')](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1a5'));}}break;case'5':_0x41420c['outboundBusyCallsDay']+=0x1;_0x446a60[_0xa8b1('0x9b')]=0x5;_0x446a60[_0xa8b1('0xda')]=_0xa8b1('0x1a6');_0x446a60[_0xa8b1('0xe7')]+=0x1;_0x446a60['countglobal']+=0x1;ami[_0xa8b1('0x4b')](_0xa8b1('0x1a7'),ut[_0xa8b1('0xf3')](_0x4ae80b,_0xa8b1('0x1a8')));_0x44de50['createHistory'](_0x446a60)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x1a9')));if(_0x44de50[_0xa8b1('0x18c')](0x5,_0x4ae80b,_0x41420c)){if(_0x446a60[_0xa8b1('0xe7')]>=_0x41420c[_0xa8b1('0x190')]){_0x44de50['createStateFinal'](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1aa'));}else{_0x44de50[_0xa8b1('0xeb')](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1aa'));}}break;case'8':_0x41420c['outboundCongestionCallsDay']+=0x1;_0x446a60[_0xa8b1('0x9b')]=0x8;_0x446a60['statedesc']=_0xa8b1('0x1ab');_0x446a60[_0xa8b1('0xf5')]+=0x1;_0x446a60['countglobal']+=0x1;ami[_0xa8b1('0x4b')](_0xa8b1('0x1ac'),ut[_0xa8b1('0xf3')](_0x4ae80b,'congestion'));_0x44de50['createHistory'](_0x446a60)[_0xa8b1('0xa8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x44de50[_0xa8b1('0x18c')](0x8,_0x4ae80b,_0x41420c)){if(_0x446a60[_0xa8b1('0xf5')]>=_0x41420c[_0xa8b1('0x193')]){_0x44de50[_0xa8b1('0xed')](_0x446a60,_0xdb04b,_0x3a57bc,'reason\x208\x20congestion');}else{_0x44de50[_0xa8b1('0xeb')](_0x446a60,_0xdb04b,_0x3a57bc,'reason\x208\x20congestion');}}break;case'11':_0x41420c[_0xa8b1('0x1ad')]+=0x1;_0x446a60[_0xa8b1('0x9b')]=0xb;_0x446a60['statedesc']=_0xa8b1('0x113');_0x446a60['countabandonedretry']+=0x1;_0x446a60['countglobal']+=0x1;_0x44de50[_0xa8b1('0xbb')](_0x446a60)[_0xa8b1('0xa8')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x44de50[_0xa8b1('0x18c')](0xb,_0x4ae80b,_0x41420c)){if(_0x446a60[_0xa8b1('0xe9')]>=_0x41420c[_0xa8b1('0x114')]){_0x44de50[_0xa8b1('0xed')](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1ae'));}else{_0x44de50['stateGlobal'](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1ae'));}}break;case'20':_0x41420c['outboundRejectCallsDay']+=0x1;_0x446a60[_0xa8b1('0x9b')]=0x14;_0x446a60[_0xa8b1('0xda')]=_0xa8b1('0x1af');_0x446a60[_0xa8b1('0xea')]+=0x1;_0x446a60[_0xa8b1('0xe4')]+=0x1;ami[_0xa8b1('0x4b')](_0xa8b1('0x1b0'),ut[_0xa8b1('0xf3')](_0x4ae80b,_0xa8b1('0x1b1')));_0x44de50[_0xa8b1('0xbb')](_0x446a60)[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x1b2')));if(_0x44de50[_0xa8b1('0x18c')](0x14,_0x4ae80b,_0x41420c)){if(_0x446a60['countagentrejectretry']>=_0x41420c[_0xa8b1('0x199')]){_0x44de50[_0xa8b1('0xed')](_0x446a60,_0xdb04b,_0x3a57bc,'reason\x2020\x20agentreject');}else{_0x44de50[_0xa8b1('0xeb')](_0x446a60,_0xdb04b,_0x3a57bc,_0xa8b1('0x1b3'));}}break;default:_0x41420c['outboundUnknownCallsDay']+=0x1;_0x446a60['state']=0xc;_0x446a60[_0xa8b1('0xda')]=_0x32ac93[_0xa8b1('0xfe')];_0x44de50[_0xa8b1('0xbb')](_0x446a60)[_0xa8b1('0xa8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x44de50[_0xa8b1('0x18c')](_0x32ac93['reason'],_0x4ae80b,_0x41420c)){if(_0x446a60[_0xa8b1('0xe7')]+_0x446a60[_0xa8b1('0xf5')]+_0x446a60[_0xa8b1('0x18d')]+_0x446a60[_0xa8b1('0xe8')]+_0x446a60[_0xa8b1('0xf6')]+_0x446a60[_0xa8b1('0xe9')]+_0x446a60[_0xa8b1('0xe3')]+_0x446a60[_0xa8b1('0xea')]>=_0x41420c['dialGlobalMaxRetry']){_0x44de50[_0xa8b1('0xeb')](_0x446a60,_0xdb04b,_0x3a57bc,_0x32ac93[_0xa8b1('0xfe')]);}else{_0x44de50['createStateFinal'](_0x446a60,_0xdb04b,_0x3a57bc,_0x32ac93[_0xa8b1('0xfe')]);}}}});};Dialer[_0xa8b1('0xa0')][_0xa8b1('0xeb')]=function(_0x551dcb,_0x37aca2,_0x75a1fc,_0x41743b){var _0x171e1f=new Final(_0x551dcb);_0x171e1f[_0xa8b1('0x9b')]=0xf;_0x171e1f[_0xa8b1('0xda')]=_0xa8b1('0x1b4');this['createStateFinal'](_0x171e1f,_0x37aca2,_0x75a1fc,_0x41743b);};Dialer['prototype'][_0xa8b1('0xed')]=function(_0x7f596f,_0x5a5e51,_0x1f0cba,_0x2d913c){this[_0xa8b1('0xb9')](_0x7f596f)[_0xa8b1('0xa7')](function(){return _0x5a5e51(msgResponse(_0xa8b1('0x19c'),_0xa8b1('0xcd'),_0x2d913c));})[_0xa8b1('0xa8')](function(){return _0x1f0cba(msgResponse(_0xa8b1('0x1b5'),_0xa8b1('0x137'),_0xa8b1('0x1b6')));});};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x150')]=function(_0x178515){var _0x45548d=_0x178515['dialPredictiveOptimizationPercentage']/0x64;var _0x221a24=_0x178515[_0xa8b1('0x5d')]/(_0x178515[_0xa8b1('0x5d')]+_0x178515[_0xa8b1('0xd8')]);var _0x165d1c=Math[_0xa8b1('0x1b7')](_0x178515[_0xa8b1('0x69')]*(_0x178515['predictiveIntervalMaxThreshold']/0x64));var _0x20a39b=Math[_0xa8b1('0x1b7')](_0x178515[_0xa8b1('0x69')]*(_0x178515[_0xa8b1('0x1b8')]/0x64));var _0x5c6295=_0x178515[_0xa8b1('0x95')]+_0x178515[_0xa8b1('0x94')];var _0x2cc23b=Math[_0xa8b1('0x1b9')](_0x178515[_0xa8b1('0x6c')]*_0x178515['erlangAbandonmentRate']*_0x178515[_0xa8b1('0x1ba')]*_0x178515['predictiveIntervalMultiplicativeFactor']);if(_[_0xa8b1('0x3c')](_0x178515[_0xa8b1('0x27')])){if(!_['isUndefined'](_0x178515[_0xa8b1('0x26')])){_0x178515[_0xa8b1('0x26')]=undefined;loggerPredictive[_0xa8b1('0x8a')](_0xa8b1('0x1bb'),_0xa8b1('0x1bc'));}if(!_[_0xa8b1('0x3c')](_0x178515['handlePredictive'])){loggerPredictive['error'](_0xa8b1('0x1bb'),_0xa8b1('0x1bd'));clearInterval(_0x178515[_0xa8b1('0x85')]);_0x178515[_0xa8b1('0x85')]=undefined;}_0x178515[_0xa8b1('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa8b1('0x75')](_0x178515['name'],_0xa8b1('0x1be'),_0x178515['startProgressive']);this[_0xa8b1('0x14d')](_0x178515,0x1);}else if(ifInterval(_0x178515[_0xa8b1('0x1bf')],_0x178515[_0xa8b1('0x27')])){this[_0xa8b1('0x14d')](_0x178515,0x1);loggerPredictiveCalls[_0xa8b1('0x75')](_0xa8b1('0x1c0'),_0x178515['startProgressive'],_0x178515['name']);_0x178515['erlangCalls']=0x0;_0x178515['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x45548d<_0x221a24&&_0x178515[_0xa8b1('0x1c1')]===_0xa8b1('0x1c2')){freeVariablesPredictive(_0x178515);loggerPredictive[_0xa8b1('0x75')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xa8b1('0x1c3'),_0x221a24,'startProgressive',_0x178515[_0xa8b1('0x3f')]);}else if(_0x2cc23b<_0x178515['predictiveIntervalErlangCallsDroppedCalls']&&_0x178515[_0xa8b1('0x1c1')]==='dropRate'){freeVariablesPredictive(_0x178515);loggerPredictive['info'](_0xa8b1('0x1c4'),_0xa8b1('0x1c5'),_0x2cc23b,_0xa8b1('0x1c6'),_0x178515[_0xa8b1('0x66')],'startProgressive',_0x178515['name']);}else if(!ifInterval(_0x178515[_0xa8b1('0x1bf')],_0x178515[_0xa8b1('0x27')])&&_[_0xa8b1('0x3c')](_0x178515[_0xa8b1('0x26')])&&!_['isUndefined'](_0x178515[_0xa8b1('0x27')])){_0x178515['startPredictive']=moment()[_0xa8b1('0x72')](_0xa8b1('0xf1'));loggerPredictive['info'](_0x178515[_0xa8b1('0x3f')],_0xa8b1('0x1c7'),_0x178515[_0xa8b1('0x26')]);this[_0xa8b1('0xaf')](_0x178515[_0xa8b1('0x1bf')])[_0xa8b1('0xa7')](this['getDataPredictive'](_0x178515))['then'](mergeDataErlangB(_0x178515))[_0xa8b1('0xa7')](this['startMethodPredictive'](_0x178515))[_0xa8b1('0xa8')](loggerCatchPredictive(_0xa8b1('0x1c8'),_0x178515));}else if(!ifInterval(_0x178515[_0xa8b1('0x1bf')],_0x178515[_0xa8b1('0x26')])){_0x178515[_0xa8b1('0x66')]=0x0;_0x178515[_0xa8b1('0x26')]=moment()[_0xa8b1('0x72')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa8b1('0x75')](_0x178515[_0xa8b1('0x3f')],_0xa8b1('0x1c9'),_0x178515[_0xa8b1('0x26')]);clearInterval(_0x178515[_0xa8b1('0x85')]);_0x178515[_0xa8b1('0x85')]=undefined;this[_0xa8b1('0xaf')](_0x178515[_0xa8b1('0x1bf')])[_0xa8b1('0xa7')](this[_0xa8b1('0x1ca')](_0x178515))[_0xa8b1('0xa7')](mergeDataErlangB(_0x178515))[_0xa8b1('0xa7')](this[_0xa8b1('0x1cb')](_0x178515))[_0xa8b1('0xa8')](loggerCatchPredictive(_0xa8b1('0x1cc'),_0x178515));}else if(_0x178515[_0xa8b1('0x69')]&&_0x5c6295<_0x178515[_0xa8b1('0x69')]-_0x20a39b){freeVariablesPredictive(_0x178515);loggerPredictive[_0xa8b1('0x75')](_0x178515[_0xa8b1('0x3f')],_0xa8b1('0x1cd'),_0x5c6295,')\x20are\x20less\x20than\x20threshold\x20(',_0x178515['predictiveIntervalAvailable'],'-',_0x20a39b,'=',_0x178515['predictiveIntervalAvailable']-_0x20a39b,')');}else if(_0x178515[_0xa8b1('0x69')]&&_0x5c6295>_0x178515['predictiveIntervalAvailable']+_0x165d1c){freeVariablesPredictive(_0x178515);loggerPredictive[_0xa8b1('0x75')](_0x178515['name'],_0xa8b1('0x1cd'),_0x5c6295,_0xa8b1('0x1ce'),_0x178515[_0xa8b1('0x69')],'+',_0x165d1c,'=',_0x178515[_0xa8b1('0x69')]+_0x165d1c,')');}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x1ca')]=function(_0x3ac7c5){var _0x373343=this;return function(_0x1b12f6){return new BPromise(function(_0x480c52,_0x3579ef){_[_0xa8b1('0x82')](_0x3ac7c5,_0x1b12f6[0x0]);if(checkGetDataPredictive(_0x1b12f6[0x0])){var _0x1b4e76=_0x3ac7c5[_0xa8b1('0x69')]=_0x3ac7c5[_0xa8b1('0x94')]+_0x3ac7c5[_0xa8b1('0x95')];var _0x240250=_0x3ac7c5[_0xa8b1('0x1bf')]*0x3c;var _0x1dc9ad=_0x1b12f6[0x0][_0xa8b1('0x62')]+_0x1b12f6[0x0][_0xa8b1('0x78')];var _0x358600=(_0x1b12f6[0x0]['predictiveIntervalAnsweredCalls']+_0x1b12f6[0x0][_0xa8b1('0x64')]+_0x1b12f6[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1b12f6[0x0]['predictiveIntervalTotalCalls'];_0x3ac7c5[_0xa8b1('0x1ba')]=_0x358600>0x0?_0x358600:0x1;switch(_0x3ac7c5[_0xa8b1('0x1c1')]){case _0xa8b1('0x1c2'):var _0x49570f=_0x3ac7c5[_0xa8b1('0x1cf')]/0x64;return _0x373343[_0xa8b1('0x1d0')](_0x1b4e76,_0x240250,_0x1dc9ad,_0x358600,_0x49570f)[_0xa8b1('0xa7')](function(_0x55290b){return _0x480c52(_0x55290b);});case _0xa8b1('0x1d1'):var _0x571a04=_0x3ac7c5['dialPredictiveOptimizationPercentage']/0x64;return _0x373343[_0xa8b1('0x1d2')](_0x1b4e76,_0x240250,_0x1dc9ad,_0x358600,_0x571a04)[_0xa8b1('0xa7')](function(_0x149cd7){return _0x480c52(_0x149cd7);});default:return _0x3579ef(msgResponse(_0xa8b1('0x1d3'),_0xa8b1('0x137'),_0xa8b1('0x1d4')));}}else{return _0x3579ef(msgResponse(_0xa8b1('0x1d3'),_0xa8b1('0x137'),_0xa8b1('0x1d5')));}});};};Dialer['prototype'][_0xa8b1('0x1d6')]=function(_0x213d27){var _0x3a3224=this;return function(_0x5d1192){return new BPromise(function(_0x4105a8,_0x3991ab){_[_0xa8b1('0x82')](_0x213d27,_0x5d1192[0x0]);if(checkGetDataPredictive(_0x5d1192[0x0])){loggerPredictive['info'](JSON[_0xa8b1('0x48')](_0x5d1192[0x0]));if(_0x213d27['dialPredictiveOptimization']===_0xa8b1('0x1c2')){return _0x3a3224[_0xa8b1('0xb8')](_0x213d27['id'])[_0xa8b1('0xa7')](function(_0x2deedb){var _0x17a18f=_0x213d27['loggedIn']-_0x2deedb[0x0]['outboundQueuePauses'];var _0x284d2a=_0x213d27[_0xa8b1('0x1bf')]*0x3c;var _0x3bfb0c=_0x5d1192[0x0]['predictiveIntervalAvgTalktime']+_0x5d1192[0x0][_0xa8b1('0x78')];var _0x23f788=(_0x5d1192[0x0][_0xa8b1('0x61')]+_0x5d1192[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5d1192[0x0][_0xa8b1('0x63')])/_0x5d1192[0x0][_0xa8b1('0x6a')];var _0x522845=_0x213d27[_0xa8b1('0x1cf')]/0x64;_0x213d27['predictiveIntervalPauses']=_0x2deedb[0x0][_0xa8b1('0x1d7')]||0x0;_0x213d27['predictiveIntervalHitRate']=_0x23f788>0x0?_0x23f788:0x1;return _0x3a3224[_0xa8b1('0x1d0')](_0x17a18f,_0x284d2a,_0x3bfb0c,_0x23f788,_0x522845);})['then'](function(_0x4948ef){return _0x4105a8(_0x4948ef);})[_0xa8b1('0xa8')](function(_0x2c671e){return _0x3991ab(msgResponse(_0xa8b1('0x1d8'),'Failure',JSON[_0xa8b1('0x48')](_0x2c671e)));});}if(_0x213d27[_0xa8b1('0x1c1')]==='agentBusyFactor'){return _0x3a3224[_0xa8b1('0xb8')](_0x213d27['id'])[_0xa8b1('0xa7')](function(_0xc73092){var _0x57c725=_0x213d27[_0xa8b1('0x153')]-_0xc73092[0x0][_0xa8b1('0x1d7')];var _0x39da6c=_0x213d27[_0xa8b1('0x1bf')]*0x3c;var _0x33f72c=_0x5d1192[0x0][_0xa8b1('0x62')]+_0x5d1192[0x0][_0xa8b1('0x78')];var _0xd18bd=(_0x5d1192[0x0]['predictiveIntervalAnsweredCalls']+_0x5d1192[0x0][_0xa8b1('0x64')]+_0x5d1192[0x0][_0xa8b1('0x63')])/_0x5d1192[0x0][_0xa8b1('0x6a')];var _0x4d636e=_0x213d27['dialPredictiveOptimizationPercentage']/0x64;_0x213d27[_0xa8b1('0x68')]=_0xc73092[0x0]['outboundQueuePauses']||0x0;_0x213d27[_0xa8b1('0x1ba')]=_0xd18bd>0x0?_0xd18bd:0x1;return _0x3a3224[_0xa8b1('0x1d2')](_0x57c725,_0x39da6c,_0x33f72c,_0xd18bd,_0x4d636e);})['then'](function(_0x28a716){return _0x4105a8(_0x28a716);})[_0xa8b1('0xa8')](function(_0x700f93){return _0x3991ab(msgResponse(_0xa8b1('0x1d8'),'Failure',JSON[_0xa8b1('0x48')](_0x700f93)));});}}else{return _0x3991ab(msgResponse('[getDataPredictive]',_0xa8b1('0x137'),_0xa8b1('0x1d5')));}});};};Dialer[_0xa8b1('0xa0')]['startMethodPredictive']=function(_0x1d74a8){var _0x500593=this;return function(){var _0xf36520=0x0;var _0x41e026=Math[_0xa8b1('0x1b9')](_0x1d74a8['erlangCallToSecond']*0x3e8);if(_0x41e026>0x0){_0x41e026=_0x41e026<0x64?0x64:_0x41e026;loggerPredictive[_0xa8b1('0x75')](_0x1d74a8['name'],'one\x20call\x20every:',_0x41e026,_0xa8b1('0x49'));_0x1d74a8[_0xa8b1('0x85')]=setInterval(function(){_0x500593[_0xa8b1('0x85')](_0x1d74a8);loggerPredictiveCalls['info']('[handlePredictive]',_0xf36520+=0x1);},_0x41e026);}else{loggerPredictive[_0xa8b1('0x75')](_0x1d74a8['name'],_0xa8b1('0x1d9'));}};};Dialer['prototype'][_0xa8b1('0x1da')]=function(_0x935de9,_0x409a11){var _0x5abeeb=this;return function(_0x4f8d50){if(_[_0xa8b1('0x44')](_0x4f8d50)){if(_[_0xa8b1('0xa1')](_0x409a11[_0xa8b1('0xc7')])||!_0x409a11[_0xa8b1('0x1db')]){if(_0x935de9[_0xa8b1('0x14c')]===_0xa8b1('0x9')){_0x935de9[_0xa8b1('0x121')]=_[_0xa8b1('0x3c')](_0x935de9['queueStatusComplete'])?!![]:_0x935de9[_0xa8b1('0x121')];var _0x5e3238=uuid['v4']();_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238]=new Action(_0x935de9,_0x409a11,_0x5e3238);loggerBooked[_0xa8b1('0x75')]('[booked][checkContactBlack]',_0x5e3238,_0xa8b1('0x1dc'),JSON[_0xa8b1('0x48')](_0x935de9[_0xa8b1('0x121')]),_0xa8b1('0x1dd'),_0x935de9[_0xa8b1('0x3f')]);if(_0x935de9[_0xa8b1('0x121')]){_0x935de9[_0xa8b1('0x121')]=![];_0x5abeeb[_0xa8b1('0x29')][_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xa5')]]=[];ami['Action']({'actionid':_0x5e3238,'action':'queuestatus','queue':_0x935de9[_0xa8b1('0x3f')]})[_0xa8b1('0xa8')](function(){_0x5abeeb[_0xa8b1('0xc0')](_0x935de9);_0x5abeeb[_0xa8b1('0xb1')]({'active':![],'ContactId':_0x5abeeb['actions'][_0x5e3238]['ContactId'],'ListId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238]['ListId'],'VoiceQueueId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xc8')]||undefined,'CampaignId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0x1de')));delete _0x5abeeb[_0xa8b1('0x9f')][_0x5e3238];});}else{loggerBooked[_0xa8b1('0x75')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x935de9[_0xa8b1('0x121')]),_0xa8b1('0x1dd'),_0x935de9[_0xa8b1('0x3f')]);_0x5abeeb[_0xa8b1('0xc0')](_0x935de9);_0x5abeeb[_0xa8b1('0xb1')]({'active':![],'ContactId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xc5')],'ListId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xc6')],'VoiceQueueId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xc8')]||undefined,'CampaignId':_0x5abeeb[_0xa8b1('0x9f')][_0x5e3238][_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5abeeb['actions'][_0x5e3238];}}else{return _0x5abeeb['actionOriginate'](_0x935de9,_0x409a11);}}else{if(getDiff(_0x409a11[_0xa8b1('0x1df')])<_0x935de9['dialRecallMeTimeout']*0x3c){if(_0x409a11[_0xa8b1('0x1e0')]&&!_0x409a11[_0xa8b1('0x1e0')]['voicePause']){_0x5abeeb[_0xa8b1('0x20')][_0xa8b1('0x123')](_0x409a11['id'])['finally'](function(){_0x5abeeb[_0xa8b1('0xc0')](_0x935de9);});}else{_0x5abeeb['unlockContact']({'active':![]},_0x409a11['id'],0x1)[_0xa8b1('0x1e')](function(){_0x5abeeb[_0xa8b1('0xc0')](_0x935de9);});}}else{_0x935de9[_0xa8b1('0x60')]+=0x1;_0x5abeeb[_0xa8b1('0xc0')](_0x935de9);if(_0x935de9[_0xa8b1('0x1e1')]){_0x5abeeb[_0xa8b1('0xb1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x409a11[_0xa8b1('0xc5')],'ListId':_0x409a11[_0xa8b1('0xc6')],'VoiceQueueId':_0x409a11[_0xa8b1('0xc8')]||undefined,'CampaignId':_0x409a11[_0xa8b1('0xc9')]||undefined})[_0xa8b1('0xa8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5abeeb[_0xa8b1('0xbb')](createObjHistory(_0x935de9,_0x409a11,_0xa8b1('0x1e2'),0x17,_0xa8b1('0x1e3')))[_0xa8b1('0xa8')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5abeeb[_0xa8b1('0xc3')](createObjHistory(_0x935de9,_0x409a11,_0xa8b1('0x1e4'),0x16,_0xa8b1('0x1e5')),_0xa8b1('0x1e6'),_0xa8b1('0x1e7'));}}}}else{_0x935de9[_0xa8b1('0x59')]+=0x1;_0x5abeeb[_0xa8b1('0xc3')](createObjHistory(_0x935de9,_0x409a11,'BLACKLIST',0xd,_0xa8b1('0x1e8')),_0xa8b1('0x1e9'),'[Originate][MoveBlacklist]');throw _0xa8b1('0x1ea');}};};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x1eb')]=function(_0x90aa02){var _0x3d832b=this;var _0xebd0ac=_0x90aa02[_0xa8b1('0x1ec')]-_0x90aa02[_0xa8b1('0x6b')]-_0x90aa02[_0xa8b1('0xb5')];emitCampaignSummary(_0x90aa02);if(_0xebd0ac>0x0){if(_0xebd0ac>this[_0xa8b1('0x23')]){_0xebd0ac=this['maxNumberOriginate'];}_0x90aa02['temp']+=_0xebd0ac;this[_0xa8b1('0xb6')](_0x90aa02['id'],_0xebd0ac,_0x90aa02[_0xa8b1('0x1ed')],_0x90aa02)['then'](function(_0x3b591e){_0x90aa02[_0xa8b1('0xb5')]-=_0xebd0ac;_0x90aa02[_0xa8b1('0xb5')]=_0x90aa02[_0xa8b1('0xb5')]>0x0?_0x90aa02[_0xa8b1('0xb5')]:0x0;if(!checkContactEmpty(_0x3b591e)){_0x90aa02[_0xa8b1('0x3d')]=_0xa8b1('0x91');logger[_0xa8b1('0x75')](_0xa8b1('0x1ee')+_0x90aa02[_0xa8b1('0x3f')]);}else{_0x90aa02[_0xa8b1('0x6b')]+=_0x3b591e[_0xa8b1('0x127')];_0x90aa02['message']=_0xa8b1('0x1ef');for(var _0x5c67a2=0x0;_0x5c67a2<_0x3b591e['length'];_0x5c67a2+=0x1){_0x90aa02['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x3b591e[_0x5c67a2])||_['isNil'](_0x3b591e[_0x5c67a2][_0xa8b1('0x161')])||_[_0xa8b1('0xa1')](_0x3b591e[_0x5c67a2][_0xa8b1('0x161')][_0xa8b1('0x162')])){_0x3d832b[_0xa8b1('0xc1')](_0xa8b1('0x1f0'),_0x90aa02,_0x3b591e[_0x5c67a2]);}else{_0x3d832b['checkIsBlackListIvr'](_[_0xa8b1('0xc4')](_0x3b591e[_0x5c67a2],[_0xa8b1('0xc9'),'Contact.phone']))['then'](_0x3d832b['checkContactBlack'](_0x90aa02,_0x3b591e[_0x5c67a2]))[_0xa8b1('0xa8')](_0x3d832b[_0xa8b1('0xbf')]('[actionOriginateIvr]\x20',_0x90aa02));}}}})[_0xa8b1('0xa8')](loggerGetContactDialer(_0xa8b1('0x1f1'),_0x90aa02,_0xebd0ac));}};Dialer['prototype'][_0xa8b1('0x14d')]=function(_0x290540,_0x214c79){var _0x18c0e7=this;var _0x38aa2b=[];var _0x2b6c88=_0x214c79>=0x1?_0x214c79:0x1;if(_0x290540[_0xa8b1('0x14c')]===_0xa8b1('0x9')){_0x2b6c88=0x1;}var _0x69334d=Math['floor'](_0x290540[_0xa8b1('0x95')]*_0x2b6c88)-_0x290540[_0xa8b1('0x6b')]-_0x290540['temp'];emitVoiceQueueSummary(_0x290540);if(_0x290540[_0xa8b1('0x1f2')]>0x0){var _0x931563=_0x290540[_0xa8b1('0x1f2')]-_0x290540[_0xa8b1('0x6b')]-_0x290540['talking']-_0x290540['temp']-_0x290540['pTalking'];if(_0x69334d>_0x931563){_0x69334d=_0x931563;}}if(_0x69334d>0x0){if(_0x290540[_0xa8b1('0x14c')]===_0xa8b1('0x9')){_0x69334d=0x1;}if(_0x69334d>this['maxNumberOriginate']){_0x69334d=this[_0xa8b1('0x23')];}_0x290540[_0xa8b1('0xb5')]+=_0x69334d;for(var _0x10a782 in this[_0xa8b1('0x11b')]){if(typeof this['agents'][_0x10a782]!=='undefined'){if(this[_0xa8b1('0x11b')][_0x10a782]['state']==='not_inuse'&&this[_0xa8b1('0x11b')][_0x10a782]['status']===_0xa8b1('0xd0')){_0x38aa2b['push'](this[_0xa8b1('0x11b')][_0x10a782]['id']);}}}this[_0xa8b1('0xb4')](_0x290540['id'],_0x38aa2b,_0x69334d,_0x290540['dialOrderByScheduledAt'],_0x290540)['then'](function(_0x4d26f2){_0x290540['temp']-=_0x69334d;_0x290540[_0xa8b1('0xb5')]=_0x290540['temp']>0x0?_0x290540[_0xa8b1('0xb5')]:0x0;if(!checkContactEmpty(_0x4d26f2)){_0x18c0e7[_0xa8b1('0x1f3')](_0x290540)[_0xa8b1('0xa7')](sendMessageReschedule(_0x290540))['catch'](loggerCatch(_0xa8b1('0xa9')));}else{_0x290540[_0xa8b1('0x6b')]+=_0x4d26f2[_0xa8b1('0x127')];_0x290540[_0xa8b1('0x3d')]=_0x290540[_0xa8b1('0x14c')]==='booked'?_0xa8b1('0x166'):_0xa8b1('0x1ef');for(var _0xa116d=0x0;_0xa116d<_0x4d26f2[_0xa8b1('0x127')];_0xa116d+=0x1){if(_[_0xa8b1('0xa1')](_0x4d26f2[_0xa116d])||_[_0xa8b1('0xa1')](_0x4d26f2[_0xa116d][_0xa8b1('0x161')])||_[_0xa8b1('0xa1')](_0x4d26f2[_0xa116d][_0xa8b1('0x161')]['phone'])){_0x18c0e7[_0xa8b1('0xc1')](_0xa8b1('0x1f0'),_0x290540,_0x4d26f2[_0xa116d]);}else{_0x18c0e7[_0xa8b1('0xaa')](_[_0xa8b1('0xc4')](_0x4d26f2[_0xa116d],['VoiceQueueId',_0xa8b1('0x1f4')]))[_0xa8b1('0xa7')](_0x18c0e7[_0xa8b1('0x1da')](_0x290540,_0x4d26f2[_0xa116d]))['catch'](_0x18c0e7[_0xa8b1('0xbf')](_0xa8b1('0x1f0'),_0x290540));}}}})[_0xa8b1('0xa8')](loggerGetContactDialer(_0xa8b1('0x1f5'),_0x290540,_0x69334d));}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x85')]=function(_0x11eda6){if(_0x11eda6[_0xa8b1('0x1f2')]>0x0){var _0x19569e=_0x11eda6[_0xa8b1('0x1f2')]-_0x11eda6[_0xa8b1('0x6b')]-_0x11eda6[_0xa8b1('0x94')];if(_0x19569e>0x0){this[_0xa8b1('0x1f6')](_0x11eda6);}else{loggerPredictiveCalls[_0xa8b1('0x75')](_0xa8b1('0x1f7'));}}else{this[_0xa8b1('0x1f6')](_0x11eda6);}};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x1f6')]=function(_0x4f3632){var _0x1f1025=this;var _0x51a272=[];_0x4f3632['originated']+=0x1;for(var _0x4447cd in this[_0xa8b1('0x11b')]){if(typeof this[_0xa8b1('0x11b')][_0x4447cd]!==_0xa8b1('0x8d')){if(this[_0xa8b1('0x11b')][_0x4447cd][_0xa8b1('0x9b')]==='not_inuse'&&this[_0xa8b1('0x11b')][_0x4447cd][_0xa8b1('0xa3')]===_0xa8b1('0xd0')){_0x51a272[_0xa8b1('0x11f')](this['agents'][_0x4447cd]['id']);}}}this['getContactDialer'](_0x4f3632['id'],_0x51a272,0x1,_0x4f3632[_0xa8b1('0x1ed')],_0x4f3632)[_0xa8b1('0xa7')](function(_0x1521d0){if(!checkContactEmpty(_0x1521d0)){checkContactLowerLimitOriginate(_0x4f3632,0x1,0x0);_0x1f1025[_0xa8b1('0x1f3')](_0x4f3632)[_0xa8b1('0xa7')](sendMessageReschedule(_0x4f3632))[_0xa8b1('0xa8')](loggerCatch(_0xa8b1('0xa9')));}else{_0x4f3632[_0xa8b1('0x3d')]='RUNNING';if(_['isNil'](_0x1521d0[0x0])||_[_0xa8b1('0xa1')](_0x1521d0[0x0][_0xa8b1('0x161')])||_['isNil'](_0x1521d0[0x0][_0xa8b1('0x161')][_0xa8b1('0x162')])){_0x1f1025[_0xa8b1('0xc1')](_0xa8b1('0x1f0'),_0x4f3632,_0x1521d0[0x0]);}else{_0x1f1025[_0xa8b1('0xaa')](_[_0xa8b1('0xc4')](_0x1521d0[0x0],['VoiceQueueId','Contact.phone']))[_0xa8b1('0xa7')](_0x1f1025[_0xa8b1('0x1da')](_0x4f3632,_0x1521d0[0x0]))[_0xa8b1('0xa8')](_0x1f1025['loggerHandler'](_0xa8b1('0x1f8'),_0x4f3632));}}})['catch'](loggerGetContactDialer(_0xa8b1('0x1f9'),_0x4f3632,0x1));emitVoiceQueueSummary(_0x4f3632);};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x1d0')]=function(_0x3aae83,_0x3e2338,_0x7da78e,_0x50df8e,_0x553765,_0x3e66c3){loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x1fa'));loggerPredictive[_0xa8b1('0x75')]('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',_0x3aae83);loggerPredictive['info'](_0xa8b1('0x1fb'),_0x3e2338);loggerPredictive['info'](_0xa8b1('0x1fc'),_0x7da78e);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x1fd'),_0x50df8e);loggerPredictive['info'](_0xa8b1('0x1fe'),_0x553765);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x79'));return new BPromise(function(_0x355bcb,_0x55940a){if(_0x3aae83<=0x0||isNaN(_0x3aae83)){return _0x55940a(msgResponse(_0xa8b1('0x1ff'),'Error',_0xa8b1('0x200')+_0x3aae83));}if(_0x7da78e<=0x0||isNaN(_0x7da78e)){return _0x55940a(msgResponse(_0xa8b1('0x1ff'),_0xa8b1('0x47'),_0xa8b1('0x201')+_0x7da78e));}if(_0x50df8e<=0x0||isNaN(_0x50df8e)){return _0x55940a(msgResponse(_0xa8b1('0x1ff'),_0xa8b1('0x47'),_0xa8b1('0x202')+_0x50df8e));}if(_0x3e2338<=0x0||isNaN(_0x3e2338)){return _0x55940a(msgResponse('[abandonmentRate]',_0xa8b1('0x47'),'interval\x20=\x20'+_0x3e2338));}if(_0x553765<=0x0||isNaN(_0x553765)){return _0x55940a(msgResponse(_0xa8b1('0x1ff'),_0xa8b1('0x47'),_0xa8b1('0x203')+_0x553765));}_0x3e66c3=_0x3e66c3||0x0;var _0x4228a2=0x1/_0x7da78e;var _0x2f0a9a=0x0;var _0x5936ab=0x0;var _0x449987=0x0;var _0x492862=0x0;for(var _0x10f1bc=0x0;_0x449987<_0x553765;_0x10f1bc+=0x1){_0x5936ab=_0x10f1bc/_0x3e2338;_0x2f0a9a=(_0x50df8e*_0x5936ab+_0x3e66c3)/_0x4228a2;_0x449987=erlangb(_0x2f0a9a,_0x3aae83);_0x492862=_0x2f0a9a/_0x3aae83*(0x1-erlangb(_0x2f0a9a,_0x3aae83));}return _0x355bcb({'erlangCalls':_0x10f1bc,'erlangCallToSecond':_0x3e2338/_0x10f1bc,'erlangAbandonmentRate':_0x449987,'erlangBusyFactor':_0x492862});});};Dialer[_0xa8b1('0xa0')][_0xa8b1('0x1d2')]=function(_0x4ce4fe,_0x59effe,_0x2cbbe1,_0x203b5b,_0x52d13d,_0x340226){loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x204'));loggerPredictive['info'](_0xa8b1('0x205'),_0x4ce4fe);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x1fb'),_0x59effe);loggerPredictive[_0xa8b1('0x75')]('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',_0x2cbbe1);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x1fd'),_0x203b5b);loggerPredictive['info'](_0xa8b1('0x206'),_0x52d13d);loggerPredictive[_0xa8b1('0x75')](_0xa8b1('0x79'));return new BPromise(function(_0x41defe,_0x305302){if(_0x4ce4fe<=0x0||isNaN(_0x4ce4fe)){return _0x305302(msgResponse(_0xa8b1('0x207'),_0xa8b1('0x47'),'m\x20=\x20'+_0x4ce4fe));}if(_0x2cbbe1<=0x0||isNaN(_0x2cbbe1)){return _0x305302(msgResponse(_0xa8b1('0x207'),'Error',_0xa8b1('0x201')+_0x2cbbe1));}if(_0x203b5b<=0x0||isNaN(_0x203b5b)){return _0x305302(msgResponse(_0xa8b1('0x207'),_0xa8b1('0x47'),'p\x20=\x20'+_0x203b5b));}if(_0x59effe<=0x0||isNaN(_0x59effe)){return _0x305302(msgResponse(_0xa8b1('0x207'),_0xa8b1('0x47'),_0xa8b1('0x208')+_0x59effe));}if(_0x52d13d<=0x0||isNaN(_0x52d13d)){return _0x305302(msgResponse(_0xa8b1('0x207'),'Error',_0xa8b1('0x209')+_0x52d13d));}_0x340226=_0x340226||0x0;var _0x133497=0x1/_0x2cbbe1;var _0x58f9ec=0x0;var _0x37c853=0x0;var _0x5796a0=0x0;var _0x49e2d8=0x0;for(var _0x208f84=0x0;_0x49e2d8<_0x52d13d;_0x208f84+=0x1){_0x37c853=_0x208f84/_0x59effe;_0x58f9ec=(_0x203b5b*_0x37c853+_0x340226)/_0x133497;_0x5796a0=erlangb(_0x58f9ec,_0x4ce4fe);_0x49e2d8=_0x58f9ec/_0x4ce4fe*(0x1-erlangb(_0x58f9ec,_0x4ce4fe));}return _0x41defe({'erlangCalls':_0x208f84,'erlangCallToSecond':_0x59effe/_0x208f84,'erlangAbandonmentRate':_0x5796a0,'erlangBusyFactor':_0x49e2d8});});};module[_0xa8b1('0x20a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index bc26a41..f3dea4a 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 _0x1bc2=['CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId'];(function(_0x2fccdd,_0x3ad67a){var _0x4085f0=function(_0x358ad4){while(--_0x358ad4){_0x2fccdd['push'](_0x2fccdd['shift']());}};_0x4085f0(++_0x3ad67a);}(_0x1bc2,0x1e8));var _0x21bc=function(_0x37f781,_0x36e364){_0x37f781=_0x37f781-0x0;var _0x1bdcf8=_0x1bc2[_0x37f781];return _0x1bdcf8;};'use strict';var util=require('util');var _=require(_0x21bc('0x0'));var moment=require(_0x21bc('0x1'));function getSeconds(_0x1c845b,_0x128d77){var _0xd106c3=moment(_0x1c845b)['milliseconds'](0x0);var _0x3474e4=moment(_0x128d77)[_0x21bc('0x2')](0x0);return _0xd106c3[_0x21bc('0x3')](_0x3474e4,_0x21bc('0x4'));}function QueueCallerAbandon(_0x211b67,_0x13566c){this[_0x21bc('0x5')]=_0x211b67[_0x21bc('0x5')];this[_0x21bc('0x6')]=_0x211b67[_0x21bc('0x6')];this[_0x21bc('0x7')]=_0x211b67[_0x21bc('0x6')]===_0x21bc('0x8')?'queue':_0x211b67[_0x21bc('0x6')];this[_0x21bc('0x9')]=_0x211b67[_0x21bc('0x9')];this['countcongestionretry']=_0x211b67[_0x21bc('0xa')];this[_0x21bc('0xb')]=_0x211b67[_0x21bc('0xb')];this[_0x21bc('0xc')]=_0x211b67[_0x21bc('0x9')]+_0x211b67[_0x21bc('0xa')]+_0x211b67[_0x21bc('0xb')]+_0x211b67[_0x21bc('0xd')]+_0x211b67[_0x21bc('0xe')]+_0x211b67[_0x21bc('0xf')]+_0x211b67[_0x21bc('0x10')]+_0x211b67[_0x21bc('0x11')];this[_0x21bc('0xd')]=_0x211b67[_0x21bc('0xd')];this[_0x21bc('0xe')]=_0x211b67[_0x21bc('0xe')];this[_0x21bc('0xf')]=_0x211b67[_0x21bc('0xf')];this['countmachineretry']=_0x211b67[_0x21bc('0x10')];this[_0x21bc('0x11')]=_0x211b67[_0x21bc('0x11')];this[_0x21bc('0x12')]=_0x13566c['uniqueid'];this[_0x21bc('0x13')]=_0x211b67[_0x21bc('0x14')];this[_0x21bc('0x15')]=_0x211b67[_0x21bc('0x16')];this[_0x21bc('0x17')]=_0x211b67[_0x21bc('0x17')];this[_0x21bc('0x18')]=_0x211b67[_0x21bc('0x18')];this[_0x21bc('0x19')]=_0x211b67[_0x21bc('0x19')];this[_0x21bc('0x1a')]=this[_0x21bc('0x19')];this[_0x21bc('0x1b')]=getSeconds(_0x211b67[_0x21bc('0x18')],_0x211b67['starttime']);this[_0x21bc('0x1c')]=getSeconds(this[_0x21bc('0x19')],_0x211b67['responsetime']);this['talktime']=0x0;this[_0x21bc('0x1d')]=_0x13566c[_0x21bc('0x1d')];this[_0x21bc('0x1e')]=_0x13566c[_0x21bc('0x1f')];this[_0x21bc('0x20')]=_0x13566c['reason'];this['callback']=_0x211b67[_0x21bc('0x21')];this[_0x21bc('0x22')]=_0x211b67[_0x21bc('0x22')];this[_0x21bc('0x23')]=_0x211b67[_0x21bc('0x23')];this[_0x21bc('0x24')]=_0x211b67[_0x21bc('0x24')];this[_0x21bc('0x25')]=_0x211b67[_0x21bc('0x25')];this[_0x21bc('0x26')]=_0x211b67[_0x21bc('0x26')];this['UserId']=_0x211b67['UserId'];this[_0x21bc('0x27')]=_0x211b67[_0x21bc('0x27')];this[_0x21bc('0x28')]=_0x211b67[_0x21bc('0x28')];this[_0x21bc('0x29')]=_0x211b67['originatecalleridnum']||'';this['originatecalleridname']=_0x211b67[_0x21bc('0x2a')]||'';}module[_0x21bc('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x0946=['countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','droptime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0946,0xf5));var _0x6094=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x0946[_0x58a4ac];return _0x545810;};'use strict';var util=require(_0x6094('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x3a7c01,_0x14ffc5){var _0x244989=moment(_0x3a7c01)[_0x6094('0x1')](0x0);var _0x3e5aff=moment(_0x14ffc5)[_0x6094('0x1')](0x0);return _0x244989['diff'](_0x3e5aff,'seconds');}function QueueCallerAbandon(_0x4c1a71,_0x16486c){this['scheduledat']=_0x4c1a71[_0x6094('0x2')];this['type']=_0x4c1a71[_0x6094('0x3')];this[_0x6094('0x4')]=_0x4c1a71[_0x6094('0x3')]==='outbound'?_0x6094('0x5'):_0x4c1a71[_0x6094('0x3')];this[_0x6094('0x6')]=_0x4c1a71['countbusyretry'];this[_0x6094('0x7')]=_0x4c1a71[_0x6094('0x7')];this[_0x6094('0x8')]=_0x4c1a71[_0x6094('0x8')];this[_0x6094('0x9')]=_0x4c1a71['countbusyretry']+_0x4c1a71[_0x6094('0x7')]+_0x4c1a71[_0x6094('0x8')]+_0x4c1a71[_0x6094('0xa')]+_0x4c1a71[_0x6094('0xb')]+_0x4c1a71[_0x6094('0xc')]+_0x4c1a71[_0x6094('0xd')]+_0x4c1a71[_0x6094('0xe')];this[_0x6094('0xa')]=_0x4c1a71[_0x6094('0xa')];this[_0x6094('0xb')]=_0x4c1a71[_0x6094('0xb')];this['countabandonedretry']=_0x4c1a71['countabandonedretry'];this[_0x6094('0xd')]=_0x4c1a71['countmachineretry'];this[_0x6094('0xe')]=_0x4c1a71[_0x6094('0xe')];this[_0x6094('0xf')]=_0x16486c[_0x6094('0xf')];this['calleridname']=_0x4c1a71['name'];this[_0x6094('0x10')]=_0x4c1a71[_0x6094('0x11')];this[_0x6094('0x12')]=_0x4c1a71[_0x6094('0x12')];this[_0x6094('0x13')]=_0x4c1a71[_0x6094('0x13')];this[_0x6094('0x14')]=_0x4c1a71['droptime'];this['endtime']=this[_0x6094('0x14')];this[_0x6094('0x15')]=getSeconds(_0x4c1a71[_0x6094('0x13')],_0x4c1a71[_0x6094('0x12')]);this['holdtime']=getSeconds(this[_0x6094('0x14')],_0x4c1a71[_0x6094('0x13')]);this[_0x6094('0x16')]=0x0;this['queue']=_0x16486c['queue'];this[_0x6094('0x17')]=_0x16486c[_0x6094('0x18')];this[_0x6094('0x19')]=_0x16486c['reason'];this['callback']=_0x4c1a71[_0x6094('0x1a')];this['callbackuniqueid']=_0x4c1a71[_0x6094('0x1b')];this[_0x6094('0x1c')]=_0x4c1a71['callbackat'];this[_0x6094('0x1d')]=_0x4c1a71['recallme'];this['ContactId']=_0x4c1a71[_0x6094('0x1e')];this[_0x6094('0x1f')]=_0x4c1a71[_0x6094('0x1f')];this[_0x6094('0x20')]=_0x4c1a71[_0x6094('0x20')];this['VoiceQueueId']=_0x4c1a71['VoiceQueueId'];this[_0x6094('0x21')]=_0x4c1a71['CampaignId'];this[_0x6094('0x22')]=_0x4c1a71[_0x6094('0x22')]||'';this[_0x6094('0x23')]=_0x4c1a71[_0x6094('0x23')]||'';}module[_0x6094('0x24')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 380997e..15ecf09 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(_0x4deedb,_0x46b5e0){var _0x495ad8=function(_0x23b8f5){while(--_0x23b8f5){_0x4deedb['push'](_0x4deedb['shift']());}};_0x495ad8(++_0x46b5e0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0xa64b28,_0x2b1ee3){var _0xa4575d=function(_0x4003cb){while(--_0x4003cb){_0xa64b28['push'](_0xa64b28['shift']());}};_0xa4575d(++_0x2b1ee3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 56c1e1b..3ded2a1 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 _0xc7a2=['AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','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','execute','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','reason'];(function(_0x16e2da,_0xc1bba9){var _0x2d9246=function(_0xf9a0d4){while(--_0xf9a0d4){_0x16e2da['push'](_0x16e2da['shift']());}};_0x2d9246(++_0xc1bba9);}(_0xc7a2,0xa4));var _0x2c7a=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0xc7a2[_0x4f7b43];return _0x2fcdf3;};'use strict';var util=require(_0x2c7a('0x0'));var _=require(_0x2c7a('0x1'));var BPromise=require(_0x2c7a('0x2'));var uuid=require(_0x2c7a('0x3'));var moment=require(_0x2c7a('0x4'));var path=require('path');var tiff2pdf=require(_0x2c7a('0x5'));var gs=require(_0x2c7a('0x6'));var logger=require(_0x2c7a('0x7'))(_0x2c7a('0x8'));var ami=require('../ami');var rpcDb=require(_0x2c7a('0x9'));var Channel=require('./channel');var ut=require(_0x2c7a('0xa'));var Action=require(_0x2c7a('0xb'));var faxAccount=require(_0x2c7a('0xc'));var attachment=require(_0x2c7a('0xd'));var faxMessage=require(_0x2c7a('0xe'));function Fax(_0x120010){this[_0x2c7a('0xf')]={};this['faxAccounts']=_0x120010[_0x2c7a('0x10')];this[_0x2c7a('0x11')]=_0x120010['trunks'];this[_0x2c7a('0x12')]={};ami['on'](_0x2c7a('0x13'),this[_0x2c7a('0x14')]['bind'](this));ami['on'](_0x2c7a('0x15'),this[_0x2c7a('0x16')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x18'),this[_0x2c7a('0x19')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x1a'),this[_0x2c7a('0x1b')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x1c'),this[_0x2c7a('0x1d')][_0x2c7a('0x17')](this));ami['on']('receivefax',this[_0x2c7a('0x1e')]['bind'](this));ami['on'](_0x2c7a('0x1f'),this[_0x2c7a('0x20')][_0x2c7a('0x17')](this));ami['on'](_0x2c7a('0x21'),this[_0x2c7a('0x22')][_0x2c7a('0x17')](this));}Fax[_0x2c7a('0x23')][_0x2c7a('0x14')]=function(_0x25435c){if(_0x25435c[_0x2c7a('0x24')]===_0x2c7a('0x25')){for(var _0x185141 in this[_0x2c7a('0x10')]){if(this['faxAccounts'][_0x2c7a('0x26')](_0x185141)){if(_0x25435c[_0x2c7a('0x27')]===this[_0x2c7a('0x10')][_0x185141][_0x2c7a('0x28')]){this['channels'][_0x25435c[_0x2c7a('0x29')]]={};this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]]['channel']=_0x25435c[_0x2c7a('0x2a')];this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]]['id']=this[_0x2c7a('0x10')][_0x185141]['id'];this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]]['name']=this['faxAccounts'][_0x185141][_0x2c7a('0x2b')];logger[_0x2c7a('0x2c')](_0x25435c[_0x2c7a('0x29')],_0x2c7a('0x2d'));}}}}if(this[_0x2c7a('0x12')][_0x25435c[_0x2c7a('0x29')]]){this['channels'][_0x25435c[_0x2c7a('0x29')]]={};this[_0x2c7a('0xf')][_0x25435c[_0x2c7a('0x29')]][_0x2c7a('0x2a')]=_0x25435c[_0x2c7a('0x2a')];logger[_0x2c7a('0x2c')](_0x25435c['uniqueid'],_0x2c7a('0x2d'));}};Fax[_0x2c7a('0x23')]['syncVarSet']=function(_0xc46c2b){if(this[_0x2c7a('0xf')][_0xc46c2b[_0x2c7a('0x29')]]){for(var _0x206161 in _0xc46c2b[_0x2c7a('0x2e')]){if(_0xc46c2b['variable'][_0x2c7a('0x26')](_0x206161)){this[_0x2c7a('0xf')][_0xc46c2b[_0x2c7a('0x29')]][_0x206161]=_0xc46c2b['value'];}}}};Fax[_0x2c7a('0x23')][_0x2c7a('0x19')]=function(_0x1f2635){if(this[_0x2c7a('0xf')][_0x1f2635[_0x2c7a('0x29')]]){this[_0x2c7a('0xf')][_0x1f2635[_0x2c7a('0x29')]][_0x2c7a('0x2f')]=_0x1f2635[_0x2c7a('0x2f')];this[_0x2c7a('0xf')][_0x1f2635[_0x2c7a('0x29')]]['channelstatedesc']=_0x1f2635['channelstatedesc'];}};Fax['prototype']['syncNewExten']=function(_0xbc04a2){if(this['channels'][_0xbc04a2['uniqueid']]){for(var _0x2a7b57 in _0xbc04a2[_0x2c7a('0x2e')]){if(_0xbc04a2['variable'][_0x2c7a('0x26')](_0x2a7b57)){this[_0x2c7a('0xf')][_0xbc04a2[_0x2c7a('0x29')]][_0x2a7b57]=_0xbc04a2['value'];}}}};Fax[_0x2c7a('0x23')][_0x2c7a('0x1d')]=function(_0x29b320){if(this[_0x2c7a('0xf')][_0x29b320[_0x2c7a('0x29')]]){this['channels'][_0x29b320[_0x2c7a('0x29')]][_0x2c7a('0x30')]=_0x29b320['operation'];this[_0x2c7a('0xf')][_0x29b320['uniqueid']][_0x2c7a('0x31')]=_0x29b320[_0x2c7a('0x31')];this[_0x2c7a('0xf')][_0x29b320[_0x2c7a('0x29')]][_0x2c7a('0x28')]=_0x29b320[_0x2c7a('0x28')];this[_0x2c7a('0xf')][_0x29b320[_0x2c7a('0x29')]][_0x2c7a('0x32')]=_0x29b320[_0x2c7a('0x32')];logger['info'](_0x29b320[_0x2c7a('0x29')],'\x20syncFaxStatus\x20');}};Fax[_0x2c7a('0x23')][_0x2c7a('0x1e')]=function(_0x39c211){var _0x271570=this;if(this[_0x2c7a('0xf')][_0x39c211['uniqueid']]){var _0x48c027=this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]]['id'];this[_0x2c7a('0xf')][_0x39c211['uniqueid']]['remotestationid']=_0x39c211[_0x2c7a('0x33')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x34')]=_0x39c211[_0x2c7a('0x34')];this[_0x2c7a('0xf')][_0x39c211['uniqueid']][_0x2c7a('0x28')]=_0x39c211['localstationid'];this['channels'][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x35')]=_0x39c211[_0x2c7a('0x35')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x36')]=_0x39c211[_0x2c7a('0x36')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x32')]=_0x39c211[_0x2c7a('0x32')];this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]]['calleridnum']=_0x39c211[_0x2c7a('0x37')];if(this[_0x2c7a('0xf')][_0x39c211[_0x2c7a('0x29')]][_0x2c7a('0x34')]>0x0){tiff2pdf(_0x39c211[_0x2c7a('0x32')],_0x2c7a('0x38'),function(_0xfb486d){logger[_0x2c7a('0x2c')](_0x39c211[_0x2c7a('0x29')],'\x20result\x20conversion\x20file\x20',_0xfb486d[_0x2c7a('0x39')]);attachment[_0x2c7a('0x3a')]({'name':path[_0x2c7a('0x3b')](_0x39c211[_0x2c7a('0x32')])['name'],'basename':path[_0x2c7a('0x3b')](_0x39c211[_0x2c7a('0x32')])['name']+_0x2c7a('0x3c'),'type':_0x2c7a('0x3d')})[_0x2c7a('0x3e')](function(_0x2876e0){faxAccount['notify'](_0x48c027,{'from':_0x39c211[_0x2c7a('0x37')],'mapKey':'fax','body':path[_0x2c7a('0x3b')](_0x39c211[_0x2c7a('0x32')])['name']+_0x2c7a('0x3c'),'AttachmentId':_0x2876e0['id']})[_0x2c7a('0x3f')](function(_0x25d21c){logger[_0x2c7a('0x40')](_0x39c211[_0x2c7a('0x29')],_0x2c7a('0x41'),JSON[_0x2c7a('0x42')](_0x25d21c));});})[_0x2c7a('0x3f')](function(_0x180ea1){logger['error'](_0x39c211[_0x2c7a('0x29')],_0x2c7a('0x43'),JSON['stringify'](_0x180ea1));});});}logger[_0x2c7a('0x2c')](_0x39c211['uniqueid'],'\x20receiveFax\x20');}};Fax[_0x2c7a('0x23')]['syncOriginateResponse']=function(_0x827378){if(this[_0x2c7a('0x12')][_0x827378[_0x2c7a('0x29')]]){_[_0x2c7a('0x44')](this[_0x2c7a('0xf')][_0x827378[_0x2c7a('0x29')]],_['pick'](_0x827378,['response',_0x2c7a('0x45')]));}};function updateStatus(_0x5db1cf){if(_0x5db1cf[_0x2c7a('0x46')]){faxMessage[_0x2c7a('0x47')](_0x5db1cf[_0x2c7a('0x46')],{'failMessage':_0x2c7a('0x48')})[_0x2c7a('0x3e')](function(_0x5242a6){ut[_0x2c7a('0x49')]('[Fax][Message][Error][Updated]',_0x5242a6);})['catch'](function(_0x23d0a0){ut[_0x2c7a('0x49')](_0x2c7a('0x4a'),_0x23d0a0);});}else{ut['logger'](_0x2c7a('0x4b'));}}Fax[_0x2c7a('0x23')][_0x2c7a('0x4c')]=function(_0x47f52f,_0x5889f8,_0x3b9a72){var _0x1cd6f8=this;var _0x522351={};if(_0x5889f8){_0x522351={'read':_0x5889f8};}else{_0x522351={'failMessage':_0x3b9a72};}if(this[_0x2c7a('0x12')][_0x47f52f]['AttachmentId']){faxMessage[_0x2c7a('0x47')](this[_0x2c7a('0x12')][_0x47f52f][_0x2c7a('0x46')],_0x522351)[_0x2c7a('0x3e')](function(_0x35b0c0){ut[_0x2c7a('0x49')](_0x2c7a('0x4d'),_0x35b0c0);})[_0x2c7a('0x3f')](function(_0x403b98){ut['logger'](_0x2c7a('0x4e'),_0x403b98);})[_0x2c7a('0x4f')](function(){delete _0x1cd6f8[_0x2c7a('0xf')][_0x47f52f];delete _0x1cd6f8[_0x2c7a('0x12')][_0x47f52f];});}else{ut['logger'](_0x2c7a('0x50'));delete this[_0x2c7a('0xf')][_0x47f52f];delete this[_0x2c7a('0x12')][_0x47f52f];}};Fax[_0x2c7a('0x23')][_0x2c7a('0x20')]=function(_0x1a53ca){var _0x14d697=this;if(this[_0x2c7a('0xf')][_0x1a53ca['uniqueid']]){if(this['actions'][_0x1a53ca[_0x2c7a('0x29')]]){this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]]['id']=this[_0x2c7a('0x12')][_0x1a53ca[_0x2c7a('0x29')]]['id'];this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x2b')]=this[_0x2c7a('0x12')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x2b')];}logger[_0x2c7a('0x2c')](_0x1a53ca[_0x2c7a('0x29')],this['actions'][_0x1a53ca['uniqueid']]?_0x2c7a('0x51'):_0x2c7a('0x52'),JSON[_0x2c7a('0x42')](this['channels'][_0x1a53ca['uniqueid']]));if(this[_0x2c7a('0x12')][_0x1a53ca['uniqueid']]){if(this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x53')]>0x0&&this['channels'][_0x1a53ca['uniqueid']][_0x2c7a('0x1c')]==='SUCCESS'){this[_0x2c7a('0x4c')](_0x1a53ca[_0x2c7a('0x29')],!![]);}else{this[_0x2c7a('0x4c')](_0x1a53ca[_0x2c7a('0x29')],![],this[_0x2c7a('0xf')][_0x1a53ca['uniqueid']][_0x2c7a('0x54')]?_0x2c7a('0x55')+this[_0x2c7a('0xf')][_0x1a53ca[_0x2c7a('0x29')]][_0x2c7a('0x54')]:_0x2c7a('0x56'));}}}};Fax['prototype'][_0x2c7a('0x57')]=function(_0x4d5498){var _0x3da5a9=this;return new BPromise(function(_0x335d82,_0x475fe8){_0x3da5a9[_0x2c7a('0x58')](_0x4d5498,_0x3da5a9[_0x2c7a('0x10')][_0x4d5498[_0x2c7a('0x59')]])[_0x2c7a('0x3e')](function(_0x57c053){ut[_0x2c7a('0x49')](_0x2c7a('0x5a'),_0x57c053);_0x335d82(ut[_0x2c7a('0x39')](_0x2c7a('0x5b')));})[_0x2c7a('0x3f')](function(_0x399de7){ut['logger']('[Fax][execOriginate][failure]',_0x399de7);updateStatus(_0x4d5498);_0x475fe8(ut[_0x2c7a('0x39')](_0x2c7a('0x5c')));});});};Fax[_0x2c7a('0x23')][_0x2c7a('0x5d')]=function(_0xf12463){var _0x24f2e4=this;return new BPromise(function(_0x22894f,_0x62a313){var _0x1b678f=_0x24f2e4[_0x2c7a('0x5e')](_0x24f2e4[_0x2c7a('0x10')][_0xf12463['FaxAccountId']][_0x2c7a('0x5f')],_0xf12463);if(_0x1b678f[_0x2c7a('0x60')]){_0x22894f(ut[_0x2c7a('0x39')](_0x2c7a('0x61')));}else{_0x62a313(ut[_0x2c7a('0x39')](_0x1b678f[_0x2c7a('0x39')]));}});};function originate(_0x4a08d6,_0x2090cd,_0x27e5eb){return new BPromise(function(_0x19b86b,_0x105358){if(_0x27e5eb){var _0x3f1d1d=util[_0x2c7a('0x62')](_0x2c7a('0x63'),path['parse'](_0x4a08d6[_0x2c7a('0x64')])[_0x2c7a('0x2b')],_0x4a08d6[_0x2c7a('0x64')]);gs[_0x2c7a('0x65')](_0x3f1d1d)[_0x2c7a('0x3e')](function(){_0x4a08d6[_0x2c7a('0x64')]=util[_0x2c7a('0x62')]('%s/%s.tif',path['parse'](_0x4a08d6['path'])['dir'],path[_0x2c7a('0x3b')](_0x4a08d6[_0x2c7a('0x64')])[_0x2c7a('0x2b')]);_0x2090cd[_0x2c7a('0x66')]=_0x4a08d6[_0x2c7a('0x64')];ut[_0x2c7a('0x49')](_0x2c7a('0x67'),'');ami[_0x2c7a('0x68')](ut[_0x2c7a('0x69')](_0x4a08d6,_0x2090cd))['then'](function(_0x52de0e){_0x19b86b(_0x52de0e);})[_0x2c7a('0x3f')](function(_0x5dbbe0){_0x105358(_0x5dbbe0);});})[_0x2c7a('0x3f')](function(_0x53fc5c){_0x105358(_0x53fc5c);});}else{ami[_0x2c7a('0x68')](ut['variablesAction'](_0x4a08d6,_0x2090cd))['then'](function(_0x25a9df){_0x19b86b(_0x25a9df);})[_0x2c7a('0x3f')](function(_0x4ceee4){_0x105358(_0x4ceee4);});}});}Fax[_0x2c7a('0x23')][_0x2c7a('0x58')]=function(_0x9e3368,_0x286bf1){var _0x3d1f87=this;return new BPromise(function(_0x3c81c8,_0x241d19){var _0x5f3ad3=uuid['v4']();var _0x185a29=ut['addVariables'](_0x9e3368,_0x286bf1);_0x3d1f87[_0x2c7a('0x12')][_0x5f3ad3]=new Action(_0x5f3ad3,_0x286bf1,_0x9e3368);var _0x50ada8=_0x3d1f87[_0x2c7a('0x12')][_0x5f3ad3];if(path[_0x2c7a('0x3b')](_0x9e3368[_0x2c7a('0x64')])[_0x2c7a('0x6a')]===_0x2c7a('0x3c')){originate(_0x50ada8,_0x185a29,!![])[_0x2c7a('0x3e')](function(_0x1f690f){_0x3c81c8(_0x1f690f);})[_0x2c7a('0x3f')](function(_0x33621e){_0x241d19(_0x33621e);});}else{originate(_0x50ada8,_0x185a29,![])[_0x2c7a('0x3e')](function(_0x1dc96d){_0x3c81c8(_0x1dc96d);})[_0x2c7a('0x3f')](function(_0x575bc2){_0x241d19(_0x575bc2);});}});};Fax[_0x2c7a('0x23')][_0x2c7a('0x6b')]=function(_0x381748){return!_[_0x2c7a('0x6c')](_0x381748)&&!_[_0x2c7a('0x6c')](_0x381748['name'])&&!_[_0x2c7a('0x6c')](_0x381748[_0x2c7a('0x6d')])&&_0x381748[_0x2c7a('0x6d')]&&!_[_0x2c7a('0x6c')](this[_0x2c7a('0x11')][util[_0x2c7a('0x62')](_0x2c7a('0x6e'),_0x381748[_0x2c7a('0x2b')])])&&!_[_0x2c7a('0x6c')](this['trunks'][util[_0x2c7a('0x62')](_0x2c7a('0x6e'),_0x381748['name'])][_0x2c7a('0x31')])&&(this[_0x2c7a('0x11')][util[_0x2c7a('0x62')]('SIP/%s',_0x381748[_0x2c7a('0x2b')])][_0x2c7a('0x31')]===_0x2c7a('0x6f')||this[_0x2c7a('0x11')][util[_0x2c7a('0x62')]('SIP/%s',_0x381748[_0x2c7a('0x2b')])][_0x2c7a('0x31')]==='unmonitored');};Fax[_0x2c7a('0x23')]['checkTrunk']=function(_0xf00a9c,_0x11bdd2){if(!this[_0x2c7a('0x6b')](_0xf00a9c)){ut['logger'](_0x2c7a('0x70'),_[_0x2c7a('0x6c')](_0xf00a9c)?'':_0xf00a9c[_0x2c7a('0x2b')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x2c7a('0x71')};}if(_['isNil'](_0x11bdd2[_0x2c7a('0x8')])){ut[_0x2c7a('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x11bdd2));return{'isValid':![],'message':_0x2c7a('0x72')};}if(_[_0x2c7a('0x6c')](_0x11bdd2[_0x2c7a('0x64')])){ut[_0x2c7a('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x11bdd2));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x2c7a('0x73')};};module[_0x2c7a('0x74')]=Fax; \ No newline at end of file +var _0xd8e7=['syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','syncOriginateResponse','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','then','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','isNil','active','format','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup'];(function(_0x3ae96c,_0x5f1e7e){var _0x1b0c90=function(_0x1ecc83){while(--_0x1ecc83){_0x3ae96c['push'](_0x3ae96c['shift']());}};_0x1b0c90(++_0x5f1e7e);}(_0xd8e7,0x1ce));var _0x7d8e=function(_0xda5808,_0xc18436){_0xda5808=_0xda5808-0x0;var _0x4c7c71=_0xd8e7[_0xda5808];return _0x4c7c71;};'use strict';var util=require(_0x7d8e('0x0'));var _=require(_0x7d8e('0x1'));var BPromise=require(_0x7d8e('0x2'));var uuid=require(_0x7d8e('0x3'));var moment=require(_0x7d8e('0x4'));var path=require(_0x7d8e('0x5'));var tiff2pdf=require(_0x7d8e('0x6'));var gs=require(_0x7d8e('0x7'));var logger=require(_0x7d8e('0x8'))('fax');var ami=require(_0x7d8e('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x7d8e('0xa'));var ut=require(_0x7d8e('0xb'));var Action=require(_0x7d8e('0xc'));var faxAccount=require(_0x7d8e('0xd'));var attachment=require(_0x7d8e('0xe'));var faxMessage=require(_0x7d8e('0xf'));function Fax(_0x172eba){this['channels']={};this[_0x7d8e('0x10')]=_0x172eba['faxAccounts'];this[_0x7d8e('0x11')]=_0x172eba[_0x7d8e('0x11')];this[_0x7d8e('0x12')]={};ami['on']('newchannel',this[_0x7d8e('0x13')][_0x7d8e('0x14')](this));ami['on']('varset',this[_0x7d8e('0x15')]['bind'](this));ami['on'](_0x7d8e('0x16'),this[_0x7d8e('0x17')]['bind'](this));ami['on'](_0x7d8e('0x18'),this[_0x7d8e('0x19')][_0x7d8e('0x14')](this));ami['on'](_0x7d8e('0x1a'),this[_0x7d8e('0x1b')]['bind'](this));ami['on'](_0x7d8e('0x1c'),this['syncReceiveFax']['bind'](this));ami['on'](_0x7d8e('0x1d'),this[_0x7d8e('0x1e')][_0x7d8e('0x14')](this));ami['on'](_0x7d8e('0x1f'),this['syncOriginateResponse'][_0x7d8e('0x14')](this));}Fax[_0x7d8e('0x20')]['syncNewchannel']=function(_0x55280f){if(_0x55280f[_0x7d8e('0x21')]===_0x7d8e('0x22')){for(var _0x289e04 in this[_0x7d8e('0x10')]){if(this[_0x7d8e('0x10')][_0x7d8e('0x23')](_0x289e04)){if(_0x55280f[_0x7d8e('0x24')]===this[_0x7d8e('0x10')][_0x289e04][_0x7d8e('0x25')]){this[_0x7d8e('0x26')][_0x55280f[_0x7d8e('0x27')]]={};this[_0x7d8e('0x26')][_0x55280f[_0x7d8e('0x27')]][_0x7d8e('0x28')]=_0x55280f[_0x7d8e('0x28')];this['channels'][_0x55280f[_0x7d8e('0x27')]]['id']=this[_0x7d8e('0x10')][_0x289e04]['id'];this[_0x7d8e('0x26')][_0x55280f['uniqueid']][_0x7d8e('0x29')]=this[_0x7d8e('0x10')][_0x289e04][_0x7d8e('0x29')];logger[_0x7d8e('0x2a')](_0x55280f[_0x7d8e('0x27')],'\x20syncNewchannel\x20');}}}}if(this[_0x7d8e('0x12')][_0x55280f[_0x7d8e('0x27')]]){this[_0x7d8e('0x26')][_0x55280f[_0x7d8e('0x27')]]={};this[_0x7d8e('0x26')][_0x55280f[_0x7d8e('0x27')]]['channel']=_0x55280f[_0x7d8e('0x28')];logger[_0x7d8e('0x2a')](_0x55280f['uniqueid'],_0x7d8e('0x2b'));}};Fax[_0x7d8e('0x20')][_0x7d8e('0x15')]=function(_0x3782f8){if(this[_0x7d8e('0x26')][_0x3782f8[_0x7d8e('0x27')]]){for(var _0x3413e5 in _0x3782f8[_0x7d8e('0x2c')]){if(_0x3782f8['variable'][_0x7d8e('0x23')](_0x3413e5)){this[_0x7d8e('0x26')][_0x3782f8[_0x7d8e('0x27')]][_0x3413e5]=_0x3782f8[_0x7d8e('0x2d')];}}}};Fax[_0x7d8e('0x20')][_0x7d8e('0x17')]=function(_0xd50064){if(this['channels'][_0xd50064[_0x7d8e('0x27')]]){this[_0x7d8e('0x26')][_0xd50064[_0x7d8e('0x27')]][_0x7d8e('0x2e')]=_0xd50064[_0x7d8e('0x2e')];this[_0x7d8e('0x26')][_0xd50064[_0x7d8e('0x27')]][_0x7d8e('0x2f')]=_0xd50064['channelstatedesc'];}};Fax[_0x7d8e('0x20')]['syncNewExten']=function(_0x11e90d){if(this[_0x7d8e('0x26')][_0x11e90d[_0x7d8e('0x27')]]){for(var _0x1a6610 in _0x11e90d[_0x7d8e('0x2c')]){if(_0x11e90d['variable'][_0x7d8e('0x23')](_0x1a6610)){this[_0x7d8e('0x26')][_0x11e90d[_0x7d8e('0x27')]][_0x1a6610]=_0x11e90d[_0x7d8e('0x2d')];}}}};Fax[_0x7d8e('0x20')][_0x7d8e('0x1b')]=function(_0x473895){if(this[_0x7d8e('0x26')][_0x473895[_0x7d8e('0x27')]]){this[_0x7d8e('0x26')][_0x473895['uniqueid']][_0x7d8e('0x30')]=_0x473895[_0x7d8e('0x30')];this[_0x7d8e('0x26')][_0x473895['uniqueid']]['status']=_0x473895[_0x7d8e('0x31')];this[_0x7d8e('0x26')][_0x473895[_0x7d8e('0x27')]][_0x7d8e('0x25')]=_0x473895['localstationid'];this['channels'][_0x473895['uniqueid']][_0x7d8e('0x32')]=_0x473895['filename'];logger[_0x7d8e('0x2a')](_0x473895[_0x7d8e('0x27')],_0x7d8e('0x33'));}};Fax[_0x7d8e('0x20')][_0x7d8e('0x34')]=function(_0xcff004){var _0x508c0c=this;if(this['channels'][_0xcff004['uniqueid']]){var _0x1e5c55=this[_0x7d8e('0x26')][_0xcff004[_0x7d8e('0x27')]]['id'];this['channels'][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x35')]=_0xcff004[_0x7d8e('0x35')];this['channels'][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x36')]=_0xcff004[_0x7d8e('0x36')];this[_0x7d8e('0x26')][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x25')]=_0xcff004[_0x7d8e('0x25')];this[_0x7d8e('0x26')][_0xcff004['uniqueid']][_0x7d8e('0x37')]=_0xcff004[_0x7d8e('0x37')];this[_0x7d8e('0x26')][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x38')]=_0xcff004['transferrate'];this['channels'][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x32')]=_0xcff004['filename'];this[_0x7d8e('0x26')][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x39')]=_0xcff004['calleridnum'];if(this[_0x7d8e('0x26')][_0xcff004[_0x7d8e('0x27')]][_0x7d8e('0x36')]>0x0){tiff2pdf(_0xcff004[_0x7d8e('0x32')],_0x7d8e('0x3a'),function(_0x58fc72){logger[_0x7d8e('0x2a')](_0xcff004['uniqueid'],_0x7d8e('0x3b'),_0x58fc72[_0x7d8e('0x3c')]);attachment[_0x7d8e('0x3d')]({'name':path[_0x7d8e('0x3e')](_0xcff004[_0x7d8e('0x32')])[_0x7d8e('0x29')],'basename':path[_0x7d8e('0x3e')](_0xcff004[_0x7d8e('0x32')])['name']+_0x7d8e('0x3f'),'type':_0x7d8e('0x40')})['then'](function(_0x22feba){faxAccount[_0x7d8e('0x41')](_0x1e5c55,{'from':_0xcff004[_0x7d8e('0x39')],'mapKey':_0x7d8e('0x42'),'body':path[_0x7d8e('0x3e')](_0xcff004[_0x7d8e('0x32')])[_0x7d8e('0x29')]+_0x7d8e('0x3f'),'AttachmentId':_0x22feba['id']})[_0x7d8e('0x43')](function(_0xc10d24){logger['error'](_0xcff004['uniqueid'],_0x7d8e('0x44'),JSON[_0x7d8e('0x45')](_0xc10d24));});})[_0x7d8e('0x43')](function(_0x51c639){logger[_0x7d8e('0x46')](_0xcff004[_0x7d8e('0x27')],_0x7d8e('0x47'),JSON[_0x7d8e('0x45')](_0x51c639));});});}logger[_0x7d8e('0x2a')](_0xcff004[_0x7d8e('0x27')],_0x7d8e('0x47'));}};Fax[_0x7d8e('0x20')][_0x7d8e('0x48')]=function(_0x60697a){if(this[_0x7d8e('0x12')][_0x60697a[_0x7d8e('0x27')]]){_['merge'](this['channels'][_0x60697a[_0x7d8e('0x27')]],_[_0x7d8e('0x49')](_0x60697a,[_0x7d8e('0x4a'),'reason']));}};function updateStatus(_0x5e0a8e){if(_0x5e0a8e[_0x7d8e('0x4b')]){faxMessage['update'](_0x5e0a8e['AttachmentId'],{'failMessage':_0x7d8e('0x4c')})['then'](function(_0x141bd4){ut[_0x7d8e('0x4d')](_0x7d8e('0x4e'),_0x141bd4);})[_0x7d8e('0x43')](function(_0x5c4dcb){ut[_0x7d8e('0x4d')](_0x7d8e('0x4f'),_0x5c4dcb);});}else{ut[_0x7d8e('0x4d')](_0x7d8e('0x50'));}}Fax[_0x7d8e('0x20')][_0x7d8e('0x51')]=function(_0x53379a,_0x345586,_0xa7dd9d){var _0x3672ea=this;var _0x2efcfa={};if(_0x345586){_0x2efcfa={'read':_0x345586};}else{_0x2efcfa={'failMessage':_0xa7dd9d};}if(this[_0x7d8e('0x12')][_0x53379a][_0x7d8e('0x4b')]){faxMessage[_0x7d8e('0x52')](this[_0x7d8e('0x12')][_0x53379a][_0x7d8e('0x4b')],_0x2efcfa)['then'](function(_0xd534a0){ut[_0x7d8e('0x4d')](_0x7d8e('0x53'),_0xd534a0);})['catch'](function(_0x261f84){ut[_0x7d8e('0x4d')](_0x7d8e('0x54'),_0x261f84);})[_0x7d8e('0x55')](function(){delete _0x3672ea[_0x7d8e('0x26')][_0x53379a];delete _0x3672ea[_0x7d8e('0x12')][_0x53379a];});}else{ut[_0x7d8e('0x4d')]('[Fax][Message][NoUpdate2]');delete this[_0x7d8e('0x26')][_0x53379a];delete this[_0x7d8e('0x12')][_0x53379a];}};Fax[_0x7d8e('0x20')][_0x7d8e('0x1e')]=function(_0x31359d){var _0xaae69f=this;if(this[_0x7d8e('0x26')][_0x31359d['uniqueid']]){if(this[_0x7d8e('0x12')][_0x31359d[_0x7d8e('0x27')]]){this['channels'][_0x31359d[_0x7d8e('0x27')]]['id']=this[_0x7d8e('0x12')][_0x31359d[_0x7d8e('0x27')]]['id'];this[_0x7d8e('0x26')][_0x31359d['uniqueid']][_0x7d8e('0x29')]=this[_0x7d8e('0x12')][_0x31359d['uniqueid']][_0x7d8e('0x29')];}logger[_0x7d8e('0x2a')](_0x31359d[_0x7d8e('0x27')],this[_0x7d8e('0x12')][_0x31359d['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x7d8e('0x56'),JSON[_0x7d8e('0x45')](this[_0x7d8e('0x26')][_0x31359d[_0x7d8e('0x27')]]));if(this[_0x7d8e('0x12')][_0x31359d[_0x7d8e('0x27')]]){if(this[_0x7d8e('0x26')][_0x31359d['uniqueid']][_0x7d8e('0x57')]>0x0&&this[_0x7d8e('0x26')][_0x31359d['uniqueid']]['faxstatus']==='SUCCESS'){this['updateStatus'](_0x31359d['uniqueid'],!![]);}else{this['updateStatus'](_0x31359d[_0x7d8e('0x27')],![],this[_0x7d8e('0x26')][_0x31359d[_0x7d8e('0x27')]][_0x7d8e('0x58')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x31359d[_0x7d8e('0x27')]][_0x7d8e('0x58')]:_0x7d8e('0x59'));}}}};Fax[_0x7d8e('0x20')][_0x7d8e('0x5a')]=function(_0x5427d9){var _0x169ba1=this;return new BPromise(function(_0x2de1cd,_0x4c190e){_0x169ba1['execOriginate'](_0x5427d9,_0x169ba1[_0x7d8e('0x10')][_0x5427d9[_0x7d8e('0x5b')]])[_0x7d8e('0x5c')](function(_0x16d45c){ut['logger'](_0x7d8e('0x5d'),_0x16d45c);_0x2de1cd(ut[_0x7d8e('0x3c')](_0x7d8e('0x5e')));})[_0x7d8e('0x43')](function(_0x14697e){ut[_0x7d8e('0x4d')](_0x7d8e('0x5f'),_0x14697e);updateStatus(_0x5427d9);_0x4c190e(ut['message'](_0x7d8e('0x60')));});});};Fax[_0x7d8e('0x20')][_0x7d8e('0x61')]=function(_0xc5caae){var _0x5ba112=this;return new BPromise(function(_0x5599f0,_0x4553ab){var _0x43da89=_0x5ba112[_0x7d8e('0x62')](_0x5ba112[_0x7d8e('0x10')][_0xc5caae[_0x7d8e('0x5b')]][_0x7d8e('0x63')],_0xc5caae);if(_0x43da89[_0x7d8e('0x64')]){_0x5599f0(ut['message']('Trunk\x20Reachable'));}else{_0x4553ab(ut[_0x7d8e('0x3c')](_0x43da89[_0x7d8e('0x3c')]));}});};function originate(_0x364605,_0x163fcc,_0x4931e7){return new BPromise(function(_0xa7143d,_0x201505){if(_0x4931e7){var _0x68d4c8=util['format'](_0x7d8e('0x65'),path[_0x7d8e('0x3e')](_0x364605['path'])[_0x7d8e('0x29')],_0x364605[_0x7d8e('0x5')]);gs['execute'](_0x68d4c8)[_0x7d8e('0x5c')](function(){_0x364605[_0x7d8e('0x5')]=util['format'](_0x7d8e('0x66'),path[_0x7d8e('0x3e')](_0x364605[_0x7d8e('0x5')])[_0x7d8e('0x67')],path[_0x7d8e('0x3e')](_0x364605[_0x7d8e('0x5')])[_0x7d8e('0x29')]);_0x163fcc['XMF-PATH']=_0x364605[_0x7d8e('0x5')];ut[_0x7d8e('0x4d')](_0x7d8e('0x68'),'');ami['Action'](ut[_0x7d8e('0x69')](_0x364605,_0x163fcc))[_0x7d8e('0x5c')](function(_0x56088f){_0xa7143d(_0x56088f);})[_0x7d8e('0x43')](function(_0x26df1a){_0x201505(_0x26df1a);});})['catch'](function(_0x585113){_0x201505(_0x585113);});}else{ami[_0x7d8e('0x6a')](ut[_0x7d8e('0x69')](_0x364605,_0x163fcc))[_0x7d8e('0x5c')](function(_0xa9f97c){_0xa7143d(_0xa9f97c);})[_0x7d8e('0x43')](function(_0x366c29){_0x201505(_0x366c29);});}});}Fax[_0x7d8e('0x20')][_0x7d8e('0x6b')]=function(_0x3851f5,_0x55f1a7){var _0x2d8db1=this;return new BPromise(function(_0x137df1,_0x53e771){var _0x2f3e88=uuid['v4']();var _0x121ace=ut[_0x7d8e('0x6c')](_0x3851f5,_0x55f1a7);_0x2d8db1[_0x7d8e('0x12')][_0x2f3e88]=new Action(_0x2f3e88,_0x55f1a7,_0x3851f5);var _0x44a99d=_0x2d8db1[_0x7d8e('0x12')][_0x2f3e88];if(path['parse'](_0x3851f5[_0x7d8e('0x5')])[_0x7d8e('0x6d')]===_0x7d8e('0x3f')){originate(_0x44a99d,_0x121ace,!![])['then'](function(_0xaf69ce){_0x137df1(_0xaf69ce);})[_0x7d8e('0x43')](function(_0x105f71){_0x53e771(_0x105f71);});}else{originate(_0x44a99d,_0x121ace,![])['then'](function(_0x4bada1){_0x137df1(_0x4bada1);})[_0x7d8e('0x43')](function(_0x2d98e9){_0x53e771(_0x2d98e9);});}});};Fax[_0x7d8e('0x20')]['isTrunkReachable']=function(_0x4732d2){return!_['isNil'](_0x4732d2)&&!_['isNil'](_0x4732d2[_0x7d8e('0x29')])&&!_[_0x7d8e('0x6e')](_0x4732d2[_0x7d8e('0x6f')])&&_0x4732d2[_0x7d8e('0x6f')]&&!_['isNil'](this[_0x7d8e('0x11')][util[_0x7d8e('0x70')](_0x7d8e('0x71'),_0x4732d2[_0x7d8e('0x29')])])&&!_[_0x7d8e('0x6e')](this['trunks'][util[_0x7d8e('0x70')](_0x7d8e('0x71'),_0x4732d2[_0x7d8e('0x29')])][_0x7d8e('0x31')])&&(this[_0x7d8e('0x11')][util[_0x7d8e('0x70')](_0x7d8e('0x71'),_0x4732d2[_0x7d8e('0x29')])][_0x7d8e('0x31')]==='reachable'||this[_0x7d8e('0x11')][util[_0x7d8e('0x70')](_0x7d8e('0x71'),_0x4732d2[_0x7d8e('0x29')])][_0x7d8e('0x31')]===_0x7d8e('0x72'));};Fax[_0x7d8e('0x20')][_0x7d8e('0x62')]=function(_0x2703a1,_0x2a94aa){if(!this['isTrunkReachable'](_0x2703a1)){ut[_0x7d8e('0x4d')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x7d8e('0x6e')](_0x2703a1)?'':_0x2703a1['name']+_0x7d8e('0x73'));return{'isValid':![],'message':_0x7d8e('0x74')};}if(_[_0x7d8e('0x6e')](_0x2a94aa[_0x7d8e('0x42')])){ut[_0x7d8e('0x4d')](_0x7d8e('0x75'),JSON[_0x7d8e('0x45')](_0x2a94aa));return{'isValid':![],'message':_0x7d8e('0x76')};}if(_[_0x7d8e('0x6e')](_0x2a94aa[_0x7d8e('0x5')])){ut['logger'](_0x7d8e('0x77'),JSON[_0x7d8e('0x45')](_0x2a94aa));return{'isValid':![],'message':_0x7d8e('0x78')};}return{'isValid':!![],'message':_0x7d8e('0x79')};};module[_0x7d8e('0x7a')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 33fdbad..344cdd8 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 _0x2f9c=['../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x429ecf,_0x1f5871){var _0x5920fb=function(_0xefffce){while(--_0xefffce){_0x429ecf['push'](_0x429ecf['shift']());}};_0x5920fb(++_0x1f5871);}(_0x2f9c,0x11a));var _0xc2f9=function(_0x4c535c,_0x24320e){_0x4c535c=_0x4c535c-0x0;var _0x19985c=_0x2f9c[_0x4c535c];return _0x19985c;};'use strict';var util=require(_0xc2f9('0x0'));var BPromise=require(_0xc2f9('0x1'));var logger=require(_0xc2f9('0x2'))(_0xc2f9('0x3'));var _=require('lodash');var faxAccount=require(_0xc2f9('0x4'));function loggerCatch(_0x16aa25){return function(_0x207bd1){logger[_0xc2f9('0x5')](_0x16aa25,util[_0xc2f9('0x6')](_0x207bd1,{'showHidden':![],'depth':null}));};}exports[_0xc2f9('0x7')]=function(_0x3a5b2e,_0x5323d3){return BPromise[_0xc2f9('0x8')]()[_0xc2f9('0x9')](faxAccount[_0xc2f9('0x7')](_0x3a5b2e,_0x5323d3))['catch'](loggerCatch(_0xc2f9('0xa')));}; \ No newline at end of file +var _0xfe89=['lodash','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20','util','../../../config/logger','preview'];(function(_0x1a5aaa,_0x37aff3){var _0x2c8aec=function(_0x165c1d){while(--_0x165c1d){_0x1a5aaa['push'](_0x1a5aaa['shift']());}};_0x2c8aec(++_0x37aff3);}(_0xfe89,0xd9));var _0x9fe8=function(_0x2929c6,_0x2ebccb){_0x2929c6=_0x2929c6-0x0;var _0xbc2b6=_0xfe89[_0x2929c6];return _0xbc2b6;};'use strict';var util=require(_0x9fe8('0x0'));var BPromise=require('bluebird');var logger=require(_0x9fe8('0x1'))(_0x9fe8('0x2'));var _=require(_0x9fe8('0x3'));var faxAccount=require(_0x9fe8('0x4'));function loggerCatch(_0x43aa59){return function(_0x4e975c){logger[_0x9fe8('0x5')](_0x43aa59,util['inspect'](_0x4e975c,{'showHidden':![],'depth':null}));};}exports[_0x9fe8('0x6')]=function(_0x4482ae,_0x41be6e){return BPromise[_0x9fe8('0x7')]()[_0x9fe8('0x8')](faxAccount['notify'](_0x4482ae,_0x41be6e))[_0x9fe8('0x9')](loggerCatch(_0x9fe8('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index e68dcd9..0ef5c8c 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 _0xa62d=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','exec','execute','info','Exec\x20gs'];(function(_0x1a19e7,_0x2a1baf){var _0x9c31ee=function(_0x4f40f9){while(--_0x4f40f9){_0x1a19e7['push'](_0x1a19e7['shift']());}};_0x9c31ee(++_0x2a1baf);}(_0xa62d,0x134));var _0xda62=function(_0x2bac4c,_0x31126d){_0x2bac4c=_0x2bac4c-0x0;var _0x3852bd=_0xa62d[_0x2bac4c];return _0x3852bd;};'use strict';var util=require(_0xda62('0x0'));var logger=require(_0xda62('0x1'))(_0xda62('0x2'));var BPromise=require('bluebird');var exec=require('child_process')[_0xda62('0x3')];exports[_0xda62('0x4')]=function(_0x2c6cc1){return new BPromise(function(_0xe2be98,_0x5553f1){exec(_0x2c6cc1,function(_0xd9a2a6,_0x1777f1,_0x5cc818){logger[_0xda62('0x5')](_0xda62('0x6'),_0x1777f1);if(_0xd9a2a6){logger[_0xda62('0x5')](_0xda62('0x6'),_0xda62('0x7'),util[_0xda62('0x8')](_0xd9a2a6,{'showHidden':![],'depth':null}),_0x1777f1,_0x5cc818);_0x5553f1(_0xd9a2a6);}_0xe2be98(_0x1777f1);});});}; \ No newline at end of file +var _0xd041=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x455721,_0x5aafab){var _0x2ddbb2=function(_0x54e583){while(--_0x54e583){_0x455721['push'](_0x455721['shift']());}};_0x2ddbb2(++_0x5aafab);}(_0xd041,0x1f2));var _0x1d04=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0xd041[_0x139b85];return _0x1e833f;};'use strict';var util=require(_0x1d04('0x0'));var logger=require(_0x1d04('0x1'))('fax');var BPromise=require(_0x1d04('0x2'));var exec=require(_0x1d04('0x3'))[_0x1d04('0x4')];exports[_0x1d04('0x5')]=function(_0x4b3330){return new BPromise(function(_0x1be8ab,_0xcf6147){exec(_0x4b3330,function(_0x2a10b3,_0x31606b,_0x25d9a3){logger[_0x1d04('0x6')](_0x1d04('0x7'),_0x31606b);if(_0x2a10b3){logger[_0x1d04('0x6')](_0x1d04('0x7'),_0x1d04('0x8'),util[_0x1d04('0x9')](_0x2a10b3,{'showHidden':![],'depth':null}),_0x31606b,_0x25d9a3);_0xcf6147(_0x2a10b3);}_0x1be8ab(_0x31606b);});});}; \ 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 67af6a9..74dc37e 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 _0x4571=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','../../../../config/logger','logger','info','inspect','addVariables','maxrate','format','modem','faxdetect','t38timeout','localstationid','path','variablesAction'];(function(_0x1dd4de,_0x189290){var _0xf23408=function(_0x1b47e2){while(--_0x1b47e2){_0x1dd4de['push'](_0x1dd4de['shift']());}};_0xf23408(++_0x189290);}(_0x4571,0xe1));var _0x1457=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x4571[_0x26b8b5];return _0x2150a9;};'use strict';var util=require('util');var _=require(_0x1457('0x0'));var moment=require(_0x1457('0x1'));var logger=require(_0x1457('0x2'))('fax');exports['message']=function(_0x5237d8){return{'message':_0x5237d8};};exports[_0x1457('0x3')]=function(_0x4d7bed,_0x3eb20e){logger[_0x1457('0x4')](_0x4d7bed,util[_0x1457('0x5')](_0x3eb20e,{'showHidden':![],'depth':null}));};exports[_0x1457('0x6')]=function(_0x2d7311,_0x5126a6){var _0x3928d1={'XMF-ECM':_0x5126a6['ecm'],'XMF-HEADERINFO':_0x5126a6['headerinfo'],'XMF-MINRATE':_0x5126a6['minrate'],'XMF-MAXRATE':_0x5126a6[_0x1457('0x7')],'XMF-MODEM':util[_0x1457('0x8')]('\x22%s\x22',_0x5126a6[_0x1457('0x9')]),'XMF-GATEWAY':_0x5126a6['gateway'],'XMF-FAXDETECT':_0x5126a6[_0x1457('0xa')],'XMF-T38TIMEOUT':_0x5126a6[_0x1457('0xb')],'XMF-LOCALSTATIONID':_0x5126a6[_0x1457('0xc')],'XMF-PATH':_0x2d7311[_0x1457('0xd')]};return _0x3928d1;};exports[_0x1457('0xe')]=function(_0x493788,_0x28fd27){return{'actionid':_0x493788['uniqueid'],'action':'originate','channel':_0x493788[_0x1457('0xf')],'Exten':_0x1457('0x10'),'Context':_0x1457('0x11'),'Priority':'1','callerid':util[_0x1457('0x8')](_0x1457('0x12'),_0x493788[_0x1457('0x13')]?_0x493788[_0x1457('0x13')]:'',_0x493788[_0x1457('0xc')]),'variable':_0x28fd27,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x493788['uniqueid']};}; \ No newline at end of file +var _0x6a50=['t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','moment','fax','message','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6a50,0x1d8));var _0x06a5=function(_0x4610b1,_0x1d49c2){_0x4610b1=_0x4610b1-0x0;var _0x2ac81b=_0x6a50[_0x4610b1];return _0x2ac81b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x06a5('0x0'));var logger=require('../../../../config/logger')(_0x06a5('0x1'));exports[_0x06a5('0x2')]=function(_0x344247){return{'message':_0x344247};};exports['logger']=function(_0x27635e,_0x516704){logger['info'](_0x27635e,util['inspect'](_0x516704,{'showHidden':![],'depth':null}));};exports[_0x06a5('0x3')]=function(_0x14115c,_0x4d4010){var _0x224b49={'XMF-ECM':_0x4d4010[_0x06a5('0x4')],'XMF-HEADERINFO':_0x4d4010[_0x06a5('0x5')],'XMF-MINRATE':_0x4d4010['minrate'],'XMF-MAXRATE':_0x4d4010[_0x06a5('0x6')],'XMF-MODEM':util[_0x06a5('0x7')](_0x06a5('0x8'),_0x4d4010[_0x06a5('0x9')]),'XMF-GATEWAY':_0x4d4010[_0x06a5('0xa')],'XMF-FAXDETECT':_0x4d4010['faxdetect'],'XMF-T38TIMEOUT':_0x4d4010[_0x06a5('0xb')],'XMF-LOCALSTATIONID':_0x4d4010[_0x06a5('0xc')],'XMF-PATH':_0x14115c[_0x06a5('0xd')]};return _0x224b49;};exports[_0x06a5('0xe')]=function(_0x49c8ca,_0x2c885f){return{'actionid':_0x49c8ca[_0x06a5('0xf')],'action':_0x06a5('0x10'),'channel':_0x49c8ca[_0x06a5('0x11')],'Exten':_0x06a5('0x12'),'Context':_0x06a5('0x13'),'Priority':'1','callerid':util[_0x06a5('0x7')](_0x06a5('0x14'),_0x49c8ca['headerinfo']?_0x49c8ca[_0x06a5('0x5')]:'',_0x49c8ca[_0x06a5('0xc')]),'variable':_0x2c885f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x49c8ca[_0x06a5('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6b4585f..4014a3f 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 _0x817e=['./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','resolve','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger'];(function(_0x2811e2,_0x582de7){var _0x53dcd7=function(_0x5485ce){while(--_0x5485ce){_0x2811e2['push'](_0x2811e2['shift']());}};_0x53dcd7(++_0x582de7);}(_0x817e,0x16e));var _0xe817=function(_0xc982fa,_0x4bd27c){_0xc982fa=_0xc982fa-0x0;var _0x46d26b=_0x817e[_0xc982fa];return _0x46d26b;};'use strict';var BPromise=require(_0xe817('0x0'));var util=require(_0xe817('0x1'));var moment=require(_0xe817('0x2'));var server=require(_0xe817('0x3'));var Realtime=require(_0xe817('0x4'));var Report=require(_0xe817('0x5'));var Acw=require(_0xe817('0x6'));var Trigger=require(_0xe817('0x7'));var Dialer=require(_0xe817('0x8'));var Preview=require(_0xe817('0x9'));var Fax=require(_0xe817('0xa'));var user=require(_0xe817('0xb'));var voiceQueue=require(_0xe817('0xc'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe817('0xd'));var trunk=require('./rpc/trunk');var trigger=require(_0xe817('0xe'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xe817('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xe817('0x10'));var zendesk=require(_0xe817('0x11'));var salesforce=require(_0xe817('0x12'));var sugarcrm=require(_0xe817('0x13'));var freshdesk=require(_0xe817('0x14'));var desk=require(_0xe817('0x15'));var zoho=require(_0xe817('0x16'));var vtiger=require(_0xe817('0x17'));var freshsales=require(_0xe817('0x18'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xe817('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe817('0x1a')](_0xe817('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe817('0x1a')](_0xe817('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xe817('0x1c')](user[_0xe817('0x1d')]())[_0xe817('0x1c')](realtime[_0xe817('0x1e')]())[_0xe817('0x1c')](user['getTelephones']())['then'](realtime['initTelephones']())['then'](trunk['getTrunks']())['then'](realtime[_0xe817('0x1f')]())[_0xe817('0x1c')](voiceQueue[_0xe817('0x20')]())['then'](realtime[_0xe817('0x21')]())['then'](trigger[_0xe817('0x22')]())[_0xe817('0x1c')](realtime[_0xe817('0x23')]())[_0xe817('0x1c')](template[_0xe817('0x24')]())[_0xe817('0x1c')](realtime[_0xe817('0x25')]())[_0xe817('0x1c')](zendesk[_0xe817('0x26')]())[_0xe817('0x1c')](realtime[_0xe817('0x27')]())[_0xe817('0x1c')](salesforce['getSalesforceAccounts']())[_0xe817('0x1c')](realtime[_0xe817('0x28')]())[_0xe817('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0xe817('0x1c')](realtime[_0xe817('0x29')]())[_0xe817('0x1c')](freshdesk[_0xe817('0x2a')]())[_0xe817('0x1c')](realtime[_0xe817('0x2b')]())[_0xe817('0x1c')](desk['getDeskAccounts']())['then'](realtime[_0xe817('0x2c')]())[_0xe817('0x1c')](zoho[_0xe817('0x2d')]())['then'](realtime[_0xe817('0x2e')]())[_0xe817('0x1c')](vtiger[_0xe817('0x2f')]())[_0xe817('0x1c')](realtime[_0xe817('0x30')]())[_0xe817('0x1c')](freshsales[_0xe817('0x31')]())[_0xe817('0x1c')](realtime[_0xe817('0x32')]())[_0xe817('0x1c')](servicenow['getServicenowAccounts']())[_0xe817('0x1c')](realtime[_0xe817('0x33')]())['then'](dynamics365[_0xe817('0x34')]())['then'](realtime['initDynamics365Accounts']())[_0xe817('0x1c')](campaign[_0xe817('0x35')]())[_0xe817('0x1c')](realtime['initCampaigns']())[_0xe817('0x1c')](voiceExtension[_0xe817('0x36')]())[_0xe817('0x1c')](realtime['initVoiceExtensions']())[_0xe817('0x1c')](faxAccount['getFaxAccounts']())[_0xe817('0x1c')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xe817('0x37')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0xe817('0x1c')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xe817('0x38')]())['then'](realtime[_0xe817('0x39')]())[_0xe817('0x1c')](cmHopperHistory[_0xe817('0x3a')]())[_0xe817('0x1c')](realtime[_0xe817('0x3b')]())[_0xe817('0x1c')](voiceCallReport[_0xe817('0x3c')]())[_0xe817('0x1c')](realtime[_0xe817('0x3d')]())[_0xe817('0x1c')](function(_0x3a1f26){})[_0xe817('0x3e')](function(_0x5108ff){console['log'](_0x5108ff);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x506f12){return initRealtime();})[_0xe817('0x1c')](function(){return initParams();})[_0xe817('0x1c')](function(){report[_0xe817('0x3f')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x535e23){console[_0xe817('0x40')](_0x535e23);});}main(); \ No newline at end of file +var _0x2a00=['getTelephones','initTelephones','getTrunks','getVoiceQueues','getTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','util','moment','./server','./realtime','./report','./trigger','./dialer','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents'];(function(_0x551521,_0x559169){var _0x3981ce=function(_0xa7a757){while(--_0xa7a757){_0x551521['push'](_0x551521['shift']());}};_0x3981ce(++_0x559169);}(_0x2a00,0x120));var _0x02a0=function(_0x3cc363,_0x49c1c0){_0x3cc363=_0x3cc363-0x0;var _0x38f4f0=_0x2a00[_0x3cc363];return _0x38f4f0;};'use strict';var BPromise=require(_0x02a0('0x0'));var util=require(_0x02a0('0x1'));var moment=require(_0x02a0('0x2'));var server=require(_0x02a0('0x3'));var Realtime=require(_0x02a0('0x4'));var Report=require(_0x02a0('0x5'));var Acw=require('./acw');var Trigger=require(_0x02a0('0x6'));var Dialer=require(_0x02a0('0x7'));var Preview=require('./preview');var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0x02a0('0x8'));var voiceQueueReport=require(_0x02a0('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x02a0('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x02a0('0xb'));var cmHopperHistory=require(_0x02a0('0xc'));var campaign=require(_0x02a0('0xd'));var voiceExtension=require(_0x02a0('0xe'));var faxAccount=require(_0x02a0('0xf'));var zendesk=require(_0x02a0('0x10'));var salesforce=require(_0x02a0('0x11'));var sugarcrm=require(_0x02a0('0x12'));var freshdesk=require(_0x02a0('0x13'));var desk=require(_0x02a0('0x14'));var zoho=require(_0x02a0('0x15'));var vtiger=require(_0x02a0('0x16'));var freshsales=require(_0x02a0('0x17'));var servicenow=require(_0x02a0('0x18'));var dynamics365=require(_0x02a0('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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x02a0('0x1a')](_0x02a0('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x02a0('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x02a0('0x1c')]()[_0x02a0('0x1d')](user[_0x02a0('0x1e')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x1f')]())[_0x02a0('0x1d')](user[_0x02a0('0x20')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x21')]())[_0x02a0('0x1d')](trunk[_0x02a0('0x22')]())['then'](realtime['initTrunks']())[_0x02a0('0x1d')](voiceQueue[_0x02a0('0x23')]())['then'](realtime['initVoiceQueues']())[_0x02a0('0x1d')](trigger[_0x02a0('0x24')]())[_0x02a0('0x1d')](realtime['initTriggers']())[_0x02a0('0x1d')](template['getTemplates']())[_0x02a0('0x1d')](realtime[_0x02a0('0x25')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x02a0('0x26')]())['then'](salesforce[_0x02a0('0x27')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x28')]())['then'](sugarcrm[_0x02a0('0x29')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x2a')]())['then'](freshdesk[_0x02a0('0x2b')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x2c')]())['then'](desk[_0x02a0('0x2d')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x2e')]())['then'](zoho['getZohoAccounts']())[_0x02a0('0x1d')](realtime['initZohoAccounts']())['then'](vtiger[_0x02a0('0x2f')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x30')]())[_0x02a0('0x1d')](freshsales['getFreshsalesAccounts']())[_0x02a0('0x1d')](realtime['initFreshsalesAccounts']())[_0x02a0('0x1d')](servicenow[_0x02a0('0x31')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x32')]())[_0x02a0('0x1d')](dynamics365[_0x02a0('0x33')]())[_0x02a0('0x1d')](realtime['initDynamics365Accounts']())[_0x02a0('0x1d')](campaign[_0x02a0('0x34')]())[_0x02a0('0x1d')](realtime['initCampaigns']())[_0x02a0('0x1d')](voiceExtension['getVoiceExtensions']())[_0x02a0('0x1d')](realtime[_0x02a0('0x35')]())[_0x02a0('0x1d')](faxAccount[_0x02a0('0x36')]())['then'](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x02a0('0x37')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x38')]())[_0x02a0('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x02a0('0x1d')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x02a0('0x39')]())[_0x02a0('0x1d')](realtime[_0x02a0('0x3a')]())[_0x02a0('0x1d')](voiceCallReport[_0x02a0('0x3b')]())['then'](realtime[_0x02a0('0x3c')]())[_0x02a0('0x1d')](function(_0x117e1e){})[_0x02a0('0x3d')](function(_0x4effde){console[_0x02a0('0x3e')](_0x4effde);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x18ee8b){return initRealtime();})[_0x02a0('0x1d')](function(){return initParams();})[_0x02a0('0x1d')](function(){report[_0x02a0('0x3f')]();setInterval(initRealtime,0x1388);})[_0x02a0('0x3d')](function(_0x295b1b){console[_0x02a0('0x3e')](_0x295b1b);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index f4900f0..2c4c728 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x390621,_0x19a53b){var _0xf8b114=function(_0x152282){while(--_0x152282){_0x390621['push'](_0x390621['shift']());}};_0xf8b114(++_0x19a53b);}(_0x70e0,0x17b));var _0x070e=function(_0x285a56,_0x5f2c8f){_0x285a56=_0x285a56-0x0;var _0x2c925f=_0x70e0[_0x285a56];return _0x2c925f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x55bf96,_0x7267a7){var _0x5092ef=function(_0x3ed3f1){while(--_0x3ed3f1){_0x55bf96['push'](_0x55bf96['shift']());}};_0x5092ef(++_0x7267a7);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ee4395e..3102135 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 _0x5b3d=['name','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x109c37,_0x5afc46){var _0x99f16d=function(_0x1ab179){while(--_0x1ab179){_0x109c37['push'](_0x109c37['shift']());}};_0x99f16d(++_0x5afc46);}(_0x5b3d,0xf5));var _0xd5b3=function(_0x101383,_0x5bd543){_0x101383=_0x101383-0x0;var _0x46cfe9=_0x5b3d[_0x101383];return _0x46cfe9;};'use strict';function Campaign(_0x3a075b){this['id']=_0x3a075b['id']||0x0;this[_0xd5b3('0x0')]=_0x3a075b[_0xd5b3('0x0')]||'';this['type']=_0x3a075b['type']||_0xd5b3('0x1');this['originated']=0x0;this[_0xd5b3('0x2')]=0x0;this[_0xd5b3('0x3')]=0x0;this[_0xd5b3('0x4')]=0x0;this[_0xd5b3('0x5')]='';this[_0xd5b3('0x6')]=!![];this['active']=_0x3a075b[_0xd5b3('0x7')];this[_0xd5b3('0x8')]=_0x3a075b['limitCalls'];this[_0xd5b3('0x9')]=_0x3a075b[_0xd5b3('0x9')]||null;this['dialGlobalInterval']=_0x3a075b[_0xd5b3('0xa')]?_0x3a075b['dialGlobalInterval']:null;this[_0xd5b3('0xb')]=_0x3a075b[_0xd5b3('0xb')];this[_0xd5b3('0xc')]=_0x3a075b['dialOriginateCallerIdNumber'];this[_0xd5b3('0xd')]=_0x3a075b[_0xd5b3('0xd')]||0x1e;this[_0xd5b3('0xe')]=_0x3a075b[_0xd5b3('0xe')];this[_0xd5b3('0xf')]=_0x3a075b[_0xd5b3('0xf')];this[_0xd5b3('0x10')]=_0x3a075b[_0xd5b3('0x10')];this[_0xd5b3('0x11')]=_0x3a075b[_0xd5b3('0x11')];this[_0xd5b3('0x12')]=_0x3a075b[_0xd5b3('0x12')];this[_0xd5b3('0x13')]=_0x3a075b['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x3a075b['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x3a075b[_0xd5b3('0x14')]||0x3;this[_0xd5b3('0x15')]=_0x3a075b[_0xd5b3('0x15')]||0x96;this[_0xd5b3('0x16')]=_0x3a075b['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3a075b[_0xd5b3('0x17')]||0x96;this[_0xd5b3('0x18')]=_0x3a075b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x3a075b[_0xd5b3('0x19')]||0x96;this[_0xd5b3('0x1a')]=_0x3a075b[_0xd5b3('0x1a')]||0x3;this[_0xd5b3('0x1b')]=_0x3a075b[_0xd5b3('0x1b')]||0x96;this[_0xd5b3('0x1c')]=_0x3a075b[_0xd5b3('0x1c')]||0x3;this[_0xd5b3('0x1d')]=_0x3a075b['dialAgentRejectRetryFrequency']||0x96;this[_0xd5b3('0x1e')]=_0x3a075b['dialOrderByScheduledAt']||'DESC';this[_0xd5b3('0x1f')]=_0x3a075b[_0xd5b3('0x1f')]||undefined;this[_0xd5b3('0x20')]=_0x3a075b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xd5b3('0x21')]=_0x3a075b['dialCutDigit']||undefined;this[_0xd5b3('0x22')]=_0x3a075b[_0xd5b3('0x22')]?_0x3a075b[_0xd5b3('0x22')]:undefined;this[_0xd5b3('0x23')]=_0x3a075b['Trunk']?_0x3a075b['Trunk']:undefined;this[_0xd5b3('0x24')]=_0x3a075b['Interval']?_0x3a075b[_0xd5b3('0x24')]:undefined;this['SquareProject']=_0x3a075b[_0xd5b3('0x25')]?_0x3a075b['SquareProject']:undefined;this[_0xd5b3('0x26')]=_0x3a075b[_0xd5b3('0x25')]?_0x3a075b['SquareProject'][_0xd5b3('0x0')]:undefined;this['dialAMDActive']=_0x3a075b[_0xd5b3('0x27')]||![];this[_0xd5b3('0x28')]=_0x3a075b[_0xd5b3('0x28')];this[_0xd5b3('0x29')]=_0x3a075b[_0xd5b3('0x29')];this[_0xd5b3('0x2a')]=_0x3a075b['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x3a075b[_0xd5b3('0x2b')];this[_0xd5b3('0x2c')]=_0x3a075b[_0xd5b3('0x2c')];this['dialAMDBetweenWordsSilence']=_0x3a075b[_0xd5b3('0x2d')];this[_0xd5b3('0x2e')]=_0x3a075b['dialAMDMaximumNumberOfWords'];this[_0xd5b3('0x2f')]=_0x3a075b[_0xd5b3('0x2f')];this[_0xd5b3('0x30')]=_0x3a075b[_0xd5b3('0x30')];}module['exports']=Campaign; \ No newline at end of file +var _0x78e8=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x78e8,0xb4));var _0x878e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x78e8[_0x2dafbe];return _0x58a45a;};'use strict';function Campaign(_0x248125){this['id']=_0x248125['id']||0x0;this[_0x878e('0x0')]=_0x248125[_0x878e('0x0')]||'';this[_0x878e('0x1')]=_0x248125['type']||'campaign';this[_0x878e('0x2')]=0x0;this['temp']=0x0;this[_0x878e('0x3')]=0x0;this[_0x878e('0x4')]=0x0;this[_0x878e('0x5')]='';this[_0x878e('0x6')]=!![];this['active']=_0x248125[_0x878e('0x7')];this[_0x878e('0x8')]=_0x248125['limitCalls'];this[_0x878e('0x9')]=_0x248125[_0x878e('0x9')]||null;this['dialGlobalInterval']=_0x248125[_0x878e('0xa')]?_0x248125[_0x878e('0xa')]:null;this[_0x878e('0xb')]=_0x248125['dialOriginateCallerIdName'];this[_0x878e('0xc')]=_0x248125[_0x878e('0xc')];this[_0x878e('0xd')]=_0x248125[_0x878e('0xd')]||0x1e;this[_0x878e('0xe')]=_0x248125[_0x878e('0xe')];this[_0x878e('0xf')]=_0x248125['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x248125['dialBusyMaxRetry'];this[_0x878e('0x10')]=_0x248125[_0x878e('0x10')];this[_0x878e('0x11')]=_0x248125[_0x878e('0x11')];this[_0x878e('0x12')]=_0x248125['dialNoAnswerRetryFrequency'];this[_0x878e('0x13')]=_0x248125[_0x878e('0x13')];this[_0x878e('0x14')]=_0x248125['dialNoSuchNumberMaxRetry']||0x3;this[_0x878e('0x15')]=_0x248125[_0x878e('0x15')]||0x96;this[_0x878e('0x16')]=_0x248125[_0x878e('0x16')]||0x3;this['dialDropRetryFrequency']=_0x248125[_0x878e('0x17')]||0x96;this[_0x878e('0x18')]=_0x248125[_0x878e('0x18')]||0x3;this[_0x878e('0x19')]=_0x248125['dialAbandonedRetryFrequency']||0x96;this[_0x878e('0x1a')]=_0x248125[_0x878e('0x1a')]||0x3;this[_0x878e('0x1b')]=_0x248125[_0x878e('0x1b')]||0x96;this[_0x878e('0x1c')]=_0x248125['dialAgentRejectMaxRetry']||0x3;this[_0x878e('0x1d')]=_0x248125['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x248125['dialOrderByScheduledAt']||_0x878e('0x1e');this[_0x878e('0x1f')]=_0x248125[_0x878e('0x1f')]||undefined;this[_0x878e('0x20')]=_0x248125[_0x878e('0x20')]||undefined;this[_0x878e('0x21')]=_0x248125[_0x878e('0x21')]||undefined;this[_0x878e('0x22')]=_0x248125[_0x878e('0x22')]?_0x248125['TrunkBackup']:undefined;this['Trunk']=_0x248125[_0x878e('0x23')]?_0x248125[_0x878e('0x23')]:undefined;this[_0x878e('0x24')]=_0x248125[_0x878e('0x24')]?_0x248125[_0x878e('0x24')]:undefined;this[_0x878e('0x25')]=_0x248125['SquareProject']?_0x248125[_0x878e('0x25')]:undefined;this[_0x878e('0x26')]=_0x248125['SquareProject']?_0x248125[_0x878e('0x25')][_0x878e('0x0')]:undefined;this[_0x878e('0x27')]=_0x248125[_0x878e('0x27')]||![];this[_0x878e('0x28')]=_0x248125[_0x878e('0x28')];this[_0x878e('0x29')]=_0x248125['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x248125[_0x878e('0x2a')];this[_0x878e('0x2b')]=_0x248125['dialAMDTotalAnalysisTime'];this[_0x878e('0x2c')]=_0x248125[_0x878e('0x2c')];this[_0x878e('0x2d')]=_0x248125[_0x878e('0x2d')];this[_0x878e('0x2e')]=_0x248125['dialAMDMaximumNumberOfWords'];this[_0x878e('0x2f')]=_0x248125[_0x878e('0x2f')];this[_0x878e('0x30')]=_0x248125[_0x878e('0x30')];}module[_0x878e('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 1519f82..5650448 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 _0x4813=['transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','destinationchannel','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitors'];(function(_0x5d95b9,_0x353b84){var _0x3cd101=function(_0x334f76){while(--_0x334f76){_0x5d95b9['push'](_0x5d95b9['shift']());}};_0x3cd101(++_0x353b84);}(_0x4813,0xdc));var _0x3481=function(_0x5634a8,_0x3c2e56){_0x5634a8=_0x5634a8-0x0;var _0x3b6aa8=_0x4813[_0x5634a8];return _0x3b6aa8;};'use strict';function Channel(){this[_0x3481('0x0')]=null;this['channel']='';this[_0x3481('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x3481('0x2')]=undefined;this[_0x3481('0x3')]=undefined;this['accountcode']=0x0;this[_0x3481('0x4')]='';this[_0x3481('0x5')]=0x0;this[_0x3481('0x6')]=0x0;this[_0x3481('0x7')]=0x0;this[_0x3481('0x8')]=![];this[_0x3481('0x9')]=null;this[_0x3481('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x3481('0xb')]='';this['lastdata']='';this[_0x3481('0xc')]=0x0;this[_0x3481('0xd')]=0x0;this[_0x3481('0xe')]=0x0;this[_0x3481('0xf')]=null;this[_0x3481('0x10')]=null;this[_0x3481('0x11')]=null;this[_0x3481('0x12')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x3481('0x13')]=[];this[_0x3481('0x14')]=undefined;this[_0x3481('0x15')]=undefined;this[_0x3481('0x16')]=undefined;this[_0x3481('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x3145=['tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','answered','answertime','endtime','abandoned','lastapplication','lastdata','billableseconds','type'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x3145,0xc7));var _0x5314=function(_0x1432f8,_0x5a2595){_0x1432f8=_0x1432f8-0x0;var _0x2aa22c=_0x3145[_0x1432f8];return _0x2aa22c;};'use strict';function Channel(){this['starttime']=null;this[_0x5314('0x0')]='';this[_0x5314('0x1')]='';this[_0x5314('0x2')]=0x0;this[_0x5314('0x3')]='';this[_0x5314('0x4')]=undefined;this[_0x5314('0x5')]=undefined;this[_0x5314('0x6')]=0x0;this[_0x5314('0x7')]='';this['uniqueid']=0x0;this[_0x5314('0x8')]=0x0;this['exten']=0x0;this[_0x5314('0x9')]=![];this[_0x5314('0xa')]=null;this[_0x5314('0xb')]=null;this['unmanaged']=![];this[_0x5314('0xc')]=![];this[_0x5314('0xd')]='';this[_0x5314('0xe')]='';this['duration']=0x0;this[_0x5314('0xf')]=0x0;this['holdtime']=0x0;this[_0x5314('0x10')]=null;this[_0x5314('0x11')]=null;this[_0x5314('0x12')]=null;this[_0x5314('0x13')]=![];this[_0x5314('0x14')]=null;this[_0x5314('0x15')]=null;this[_0x5314('0x16')]=[];this[_0x5314('0x17')]=undefined;this[_0x5314('0x18')]=undefined;this[_0x5314('0x19')]=undefined;this[_0x5314('0x1a')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index aa7c068..9e82076 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 _0x2091=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2091,0x120));var _0x1209=function(_0x45d850,_0x1f8c16){_0x45d850=_0x45d850-0x0;var _0x372ba0=_0x2091[_0x45d850];return _0x372ba0;};'use strict';function DeskAccount(_0x15fd03){this['id']=_0x15fd03['id']||0x0;this[_0x1209('0x0')]=_0x15fd03[_0x1209('0x0')]||'';this[_0x1209('0x1')]=_0x15fd03[_0x1209('0x1')]||'';this[_0x1209('0x2')]=_0x15fd03[_0x1209('0x2')]||'';this['authType']=_0x15fd03[_0x1209('0x3')]||'';this['password']=_0x15fd03[_0x1209('0x4')]||'';this['consumerKey']=_0x15fd03[_0x1209('0x5')]||'';this[_0x1209('0x6')]=_0x15fd03[_0x1209('0x6')]||'';this['token']=_0x15fd03['token']||'';this[_0x1209('0x7')]=_0x15fd03[_0x1209('0x7')]||'';this[_0x1209('0x8')]=_0x15fd03[_0x1209('0x8')]||'';this['serverUrl']=_0x15fd03['serverUrl']||'';this[_0x1209('0x9')]=_0x15fd03[_0x1209('0x9')]||{};}module[_0x1209('0xa')]=DeskAccount; \ No newline at end of file +var _0xa473=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','type','Configurations','exports'];(function(_0x26c9be,_0x4a9055){var _0x1a4343=function(_0x278579){while(--_0x278579){_0x26c9be['push'](_0x26c9be['shift']());}};_0x1a4343(++_0x4a9055);}(_0xa473,0x155));var _0x3a47=function(_0x4c9590,_0xce18b5){_0x4c9590=_0x4c9590-0x0;var _0x1d2059=_0xa473[_0x4c9590];return _0x1d2059;};'use strict';function DeskAccount(_0x2161c0){this['id']=_0x2161c0['id']||0x0;this[_0x3a47('0x0')]=_0x2161c0[_0x3a47('0x0')]||'';this[_0x3a47('0x1')]=_0x2161c0[_0x3a47('0x1')]||'';this[_0x3a47('0x2')]=_0x2161c0[_0x3a47('0x2')]||'';this[_0x3a47('0x3')]=_0x2161c0[_0x3a47('0x3')]||'';this[_0x3a47('0x4')]=_0x2161c0[_0x3a47('0x4')]||'';this['consumerKey']=_0x2161c0[_0x3a47('0x5')]||'';this[_0x3a47('0x6')]=_0x2161c0[_0x3a47('0x6')]||'';this['token']=_0x2161c0['token']||'';this[_0x3a47('0x7')]=_0x2161c0[_0x3a47('0x7')]||'';this['type']=_0x2161c0[_0x3a47('0x8')]||'';this['serverUrl']=_0x2161c0['serverUrl']||'';this[_0x3a47('0x9')]=_0x2161c0['Configurations']||{};}module[_0x3a47('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 7f13441..7ec84ac 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 _0xe5b5=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xe5b5[_0x4ed1d4];return _0x28e363;};'use strict';function Dynamics365Account(_0x16118d){this['id']=_0x16118d['id']||0x0;this[_0x5e5b('0x0')]=_0x16118d[_0x5e5b('0x0')]||'';this[_0x5e5b('0x1')]=_0x16118d[_0x5e5b('0x1')]||'';this[_0x5e5b('0x2')]=_0x16118d[_0x5e5b('0x2')]||'';this[_0x5e5b('0x3')]=_0x16118d[_0x5e5b('0x3')]||'';this[_0x5e5b('0x4')]=_0x16118d[_0x5e5b('0x4')]||'';this[_0x5e5b('0x5')]=_0x16118d[_0x5e5b('0x5')]||'';this[_0x5e5b('0x6')]=_0x16118d[_0x5e5b('0x6')]||{};this[_0x5e5b('0x7')]=_0x16118d[_0x5e5b('0x7')]||'';this[_0x5e5b('0x8')]=_0x16118d[_0x5e5b('0x8')]||{};}module[_0x5e5b('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xf109=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name'];(function(_0x273ded,_0x465628){var _0x33ae1f=function(_0x3668be){while(--_0x3668be){_0x273ded['push'](_0x273ded['shift']());}};_0x33ae1f(++_0x465628);}(_0xf109,0xce));var _0x9f10=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xf109[_0x342baa];return _0x1208f3;};'use strict';function Dynamics365Account(_0x4debcd){this['id']=_0x4debcd['id']||0x0;this[_0x9f10('0x0')]=_0x4debcd[_0x9f10('0x0')]||'';this['username']=_0x4debcd['username']||'';this['password']=_0x4debcd[_0x9f10('0x1')]||'';this[_0x9f10('0x2')]=_0x4debcd[_0x9f10('0x2')]||'';this[_0x9f10('0x3')]=_0x4debcd[_0x9f10('0x3')]||'';this[_0x9f10('0x4')]=_0x4debcd[_0x9f10('0x4')]||'';this[_0x9f10('0x5')]=_0x4debcd[_0x9f10('0x5')]||{};this[_0x9f10('0x6')]=_0x4debcd[_0x9f10('0x6')]||'';this['Configurations']=_0x4debcd[_0x9f10('0x7')]||{};}module[_0x9f10('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index b141487..7caf2ae 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 _0xd64b=['faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29','gateway'];(function(_0x2fc6cf,_0x2bb133){var _0xf2ade3=function(_0x522b04){while(--_0x522b04){_0x2fc6cf['push'](_0x2fc6cf['shift']());}};_0xf2ade3(++_0x2bb133);}(_0xd64b,0x18f));var _0xbd64=function(_0x3f5880,_0x2beec0){_0x3f5880=_0x3f5880-0x0;var _0x1cc879=_0xd64b[_0x3f5880];return _0x1cc879;};'use strict';function FaxAccount(_0x12a918){this['id']=_0x12a918['id']||0x0;this[_0xbd64('0x0')]=_0x12a918[_0xbd64('0x0')]||'';this[_0xbd64('0x1')]=_0x12a918[_0xbd64('0x1')];this[_0xbd64('0x2')]=_0x12a918['ecm'];this['headerinfo']=_0x12a918[_0xbd64('0x3')];this[_0xbd64('0x4')]=_0x12a918[_0xbd64('0x4')];this['minrate']=_0x12a918['minrate']||0x960;this[_0xbd64('0x5')]=_0x12a918[_0xbd64('0x5')]||0x3840;this[_0xbd64('0x6')]=_0x12a918['modem']||_0xbd64('0x7');this[_0xbd64('0x8')]=_0x12a918[_0xbd64('0x8')]||'no';this[_0xbd64('0x9')]=_0x12a918[_0xbd64('0x9')]||'no';this[_0xbd64('0xa')]=_0x12a918[_0xbd64('0xa')]||0x1388;this[_0xbd64('0xb')]=_0x12a918[_0xbd64('0xb')]||_0xbd64('0xc');this[_0xbd64('0xd')]=_0x12a918[_0xbd64('0xd')]?_0x12a918['Trunk']:undefined;this[_0xbd64('0xe')]=_0x12a918[_0xbd64('0xe')];this[_0xbd64('0xf')]=_0x12a918[_0xbd64('0xf')];}module[_0xbd64('0x10')]=FaxAccount; \ No newline at end of file +var _0x2c9f=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','faxdetect','t38timeout','tech','Trunk','ListId'];(function(_0x466673,_0x4fdbe3){var _0xc74bb4=function(_0x325758){while(--_0x325758){_0x466673['push'](_0x466673['shift']());}};_0xc74bb4(++_0x4fdbe3);}(_0x2c9f,0x110));var _0xf2c9=function(_0x21452b,_0x3c8d02){_0x21452b=_0x21452b-0x0;var _0x53d372=_0x2c9f[_0x21452b];return _0x53d372;};'use strict';function FaxAccount(_0x5e150b){this['id']=_0x5e150b['id']||0x0;this['name']=_0x5e150b[_0xf2c9('0x0')]||'';this[_0xf2c9('0x1')]=_0x5e150b[_0xf2c9('0x1')];this[_0xf2c9('0x2')]=_0x5e150b['ecm'];this[_0xf2c9('0x3')]=_0x5e150b[_0xf2c9('0x3')];this['localstationid']=_0x5e150b[_0xf2c9('0x4')];this[_0xf2c9('0x5')]=_0x5e150b[_0xf2c9('0x5')]||0x960;this[_0xf2c9('0x6')]=_0x5e150b[_0xf2c9('0x6')]||0x3840;this[_0xf2c9('0x7')]=_0x5e150b[_0xf2c9('0x7')]||'v17,v27,v29';this['gateway']=_0x5e150b['gateway']||'no';this['faxdetect']=_0x5e150b[_0xf2c9('0x8')]||'no';this[_0xf2c9('0x9')]=_0x5e150b[_0xf2c9('0x9')]||0x1388;this[_0xf2c9('0xa')]=_0x5e150b[_0xf2c9('0xa')]||'SIP';this['Trunk']=_0x5e150b[_0xf2c9('0xb')]?_0x5e150b[_0xf2c9('0xb')]:undefined;this[_0xf2c9('0xc')]=_0x5e150b[_0xf2c9('0xc')];this['key']=_0x5e150b[_0xf2c9('0xd')];}module[_0xf2c9('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 9614dbd..027ea68 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 _0x1caa=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1caa,0x75));var _0xa1ca=function(_0x1ac209,_0x5c9477){_0x1ac209=_0x1ac209-0x0;var _0x5d21a5=_0x1caa[_0x1ac209];return _0x5d21a5;};'use strict';function FreshdeskAccount(_0x1910f7){this['id']=_0x1910f7['id']||0x0;this[_0xa1ca('0x0')]=_0x1910f7[_0xa1ca('0x0')]||'';this[_0xa1ca('0x1')]=_0x1910f7[_0xa1ca('0x1')]||'';this[_0xa1ca('0x2')]=_0x1910f7[_0xa1ca('0x3')]||'';this[_0xa1ca('0x4')]=_0x1910f7['remoteUri']||'';this[_0xa1ca('0x5')]=_0x1910f7[_0xa1ca('0x5')]||'';this[_0xa1ca('0x6')]=_0x1910f7['Configurations']||{};}module[_0xa1ca('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x71e6=['Configurations','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x52fc26,_0x1406cd){var _0x525e6e=function(_0x2deec2){while(--_0x2deec2){_0x52fc26['push'](_0x52fc26['shift']());}};_0x525e6e(++_0x1406cd);}(_0x71e6,0x9b));var _0x671e=function(_0x4efe2c,_0x4e01b0){_0x4efe2c=_0x4efe2c-0x0;var _0x146de7=_0x71e6[_0x4efe2c];return _0x146de7;};'use strict';function FreshdeskAccount(_0x3b2d79){this['id']=_0x3b2d79['id']||0x0;this[_0x671e('0x0')]=_0x3b2d79[_0x671e('0x0')]||'';this[_0x671e('0x1')]=_0x3b2d79['username']||'';this[_0x671e('0x2')]=_0x3b2d79[_0x671e('0x3')]||'';this['remoteUri']=_0x3b2d79[_0x671e('0x4')]||'';this[_0x671e('0x5')]=_0x3b2d79[_0x671e('0x5')]||'';this[_0x671e('0x6')]=_0x3b2d79[_0x671e('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 2944a79..f718a01 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 _0xff3c=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x1221fc,_0x26199a){var _0x5b3aa0=function(_0x30acc6){while(--_0x30acc6){_0x1221fc['push'](_0x1221fc['shift']());}};_0x5b3aa0(++_0x26199a);}(_0xff3c,0x179));var _0xcff3=function(_0x43bc9,_0x232809){_0x43bc9=_0x43bc9-0x0;var _0x8a7a29=_0xff3c[_0x43bc9];return _0x8a7a29;};'use strict';function FreshsalesAccount(_0x316a7c){this['id']=_0x316a7c['id']||0x0;this[_0xcff3('0x0')]=_0x316a7c['name']||'';this[_0xcff3('0x1')]=_0x316a7c[_0xcff3('0x1')]||'';this['apiKey']=_0x316a7c['token']||'';this[_0xcff3('0x2')]=_0x316a7c[_0xcff3('0x2')]||'';this[_0xcff3('0x3')]=_0x316a7c[_0xcff3('0x3')]||'';this[_0xcff3('0x4')]=_0x316a7c[_0xcff3('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xc21e=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x5561ac,_0x4abb5e){var _0x1a0672=function(_0x2e78c9){while(--_0x2e78c9){_0x5561ac['push'](_0x5561ac['shift']());}};_0x1a0672(++_0x4abb5e);}(_0xc21e,0x1ca));var _0xec21=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc21e[_0x2c91e9];return _0x13f0ff;};'use strict';function FreshsalesAccount(_0x5ce4a6){this['id']=_0x5ce4a6['id']||0x0;this[_0xec21('0x0')]=_0x5ce4a6[_0xec21('0x0')]||'';this[_0xec21('0x1')]=_0x5ce4a6[_0xec21('0x1')]||'';this[_0xec21('0x2')]=_0x5ce4a6[_0xec21('0x3')]||'';this['remoteUri']=_0x5ce4a6[_0xec21('0x4')]||'';this[_0xec21('0x5')]=_0x5ce4a6[_0xec21('0x5')]||'';this[_0xec21('0x6')]=_0x5ce4a6[_0xec21('0x6')]||{};}module[_0xec21('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 3bd3446..a6e0360 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 _0xb4dd=['calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','motionChannel','voice','mohtime','variables','exports','inbound','uniqueid'];(function(_0x5842ed,_0x3d858c){var _0x5312c7=function(_0x294df3){while(--_0x294df3){_0x5842ed['push'](_0x5842ed['shift']());}};_0x5312c7(++_0x3d858c);}(_0xb4dd,0xce));var _0xdb4d=function(_0x132d34,_0x1370d1){_0x132d34=_0x132d34-0x0;var _0x39ea7f=_0xb4dd[_0x132d34];return _0x39ea7f;};'use strict';function QueueReport(){this['type']=_0xdb4d('0x0');this[_0xdb4d('0x1')]='';this[_0xdb4d('0x2')]='';this[_0xdb4d('0x3')]='';this['queue']='';this[_0xdb4d('0x4')]=null;this[_0xdb4d('0x5')]=null;this[_0xdb4d('0x6')]=0x1;this[_0xdb4d('0x7')]=0x1;this[_0xdb4d('0x8')]=![];this[_0xdb4d('0x9')]=null;this[_0xdb4d('0xa')]=![];this[_0xdb4d('0xb')]=null;this[_0xdb4d('0xc')]=![];this[_0xdb4d('0xd')]=null;this['originalposition']=0x1;this['channel']='';this[_0xdb4d('0xe')]='';this[_0xdb4d('0xf')]='';this[_0xdb4d('0x10')]='';this[_0xdb4d('0x11')]='';this[_0xdb4d('0x12')]='';this[_0xdb4d('0x13')]='';this[_0xdb4d('0x14')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xdb4d('0x15')]=_0xdb4d('0x16');this[_0xdb4d('0x17')]=0x0;this[_0xdb4d('0x18')]={};}module[_0xdb4d('0x19')]=QueueReport; \ No newline at end of file +var _0x1856=['voice','mohtime','exports','type','calleridname','queue','queuecallerleaveAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1856,0x173));var _0x6185=function(_0x389530,_0x239f0a){_0x389530=_0x389530-0x0;var _0x1202d5=_0x1856[_0x389530];return _0x1202d5;};'use strict';function QueueReport(){this[_0x6185('0x0')]='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x6185('0x1')]='';this[_0x6185('0x2')]='';this['queuecallerjoinAt']=null;this[_0x6185('0x3')]=null;this[_0x6185('0x4')]=0x1;this[_0x6185('0x5')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x6185('0x6')]=![];this[_0x6185('0x7')]=null;this[_0x6185('0x8')]=![];this[_0x6185('0x9')]=null;this['originalposition']=0x1;this[_0x6185('0xa')]='';this[_0x6185('0xb')]='';this[_0x6185('0xc')]='';this[_0x6185('0xd')]='';this[_0x6185('0xe')]='';this[_0x6185('0xf')]='';this[_0x6185('0x10')]='';this[_0x6185('0x11')]=0x0;this['assigned']=![];this[_0x6185('0x12')]='';this[_0x6185('0x13')]=_0x6185('0x14');this[_0x6185('0x15')]=0x0;this['variables']={};}module[_0x6185('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 2300472..50647b3 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 _0xfbff=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','remoteUri'];(function(_0x1eb40e,_0x262694){var _0x9ea754=function(_0x45f493){while(--_0x45f493){_0x1eb40e['push'](_0x1eb40e['shift']());}};_0x9ea754(++_0x262694);}(_0xfbff,0x18e));var _0xffbf=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xfbff[_0xfedc72];return _0x2c7c78;};'use strict';function SalesforceAccount(_0x3c7ef8){this['id']=_0x3c7ef8['id']||0x0;this[_0xffbf('0x0')]=_0x3c7ef8[_0xffbf('0x0')]||'';this['username']=_0x3c7ef8['username']||'';this[_0xffbf('0x1')]=_0x3c7ef8[_0xffbf('0x1')]||'';this[_0xffbf('0x2')]=_0x3c7ef8[_0xffbf('0x2')]||'';this[_0xffbf('0x3')]=_0x3c7ef8['clientId']||'';this[_0xffbf('0x4')]=_0x3c7ef8['clientSecret']||'';this[_0xffbf('0x5')]=_0x3c7ef8[_0xffbf('0x5')]||'';this[_0xffbf('0x6')]=_0x3c7ef8['type']||_0xffbf('0x7');this[_0xffbf('0x8')]=_0x3c7ef8[_0xffbf('0x8')]||'';this['Configurations']=_0x3c7ef8[_0xffbf('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x9831=['clientSecret','securityToken','type','Configurations','exports','remoteUri','password','clientId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9831,0x13d));var _0x1983=function(_0x2088a6,_0x4faa61){_0x2088a6=_0x2088a6-0x0;var _0x35305c=_0x9831[_0x2088a6];return _0x35305c;};'use strict';function SalesforceAccount(_0x338468){this['id']=_0x338468['id']||0x0;this['name']=_0x338468['name']||'';this['username']=_0x338468['username']||'';this[_0x1983('0x0')]=_0x338468['remoteUri']||'';this['password']=_0x338468[_0x1983('0x1')]||'';this['clientId']=_0x338468[_0x1983('0x2')]||'';this[_0x1983('0x3')]=_0x338468[_0x1983('0x3')]||'';this[_0x1983('0x4')]=_0x338468[_0x1983('0x4')]||'';this['type']=_0x338468[_0x1983('0x5')]||'integrationTab';this['serverUrl']=_0x338468['serverUrl']||'';this[_0x1983('0x6')]=_0x338468[_0x1983('0x6')]||{};}module[_0x1983('0x7')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index a5dcf4d..2780340 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 _0xa99b=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x56622d,_0x229a5a){var _0x26d1da=function(_0x20f2af){while(--_0x20f2af){_0x56622d['push'](_0x56622d['shift']());}};_0x26d1da(++_0x229a5a);}(_0xa99b,0x17b));var _0xba99=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa99b[_0x1b828b];return _0x98da1a;};'use strict';function ServicenowAccount(_0x273f7a){this['id']=_0x273f7a['id']||0x0;this[_0xba99('0x0')]=_0x273f7a['name']||'';this[_0xba99('0x1')]=_0x273f7a['username']||'';this[_0xba99('0x2')]=_0x273f7a[_0xba99('0x2')]||'';this[_0xba99('0x3')]=_0x273f7a[_0xba99('0x3')]||'';this[_0xba99('0x4')]=_0x273f7a['serverUrl']||'';this[_0xba99('0x5')]=_0x273f7a[_0xba99('0x5')]||{};}module[_0xba99('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xe4ed=['serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0x145436,_0x1c194a){var _0x5c2fe4=function(_0x347213){while(--_0x347213){_0x145436['push'](_0x145436['shift']());}};_0x5c2fe4(++_0x1c194a);}(_0xe4ed,0x14d));var _0xde4e=function(_0x2788b7,_0xa8b607){_0x2788b7=_0x2788b7-0x0;var _0x464f6b=_0xe4ed[_0x2788b7];return _0x464f6b;};'use strict';function ServicenowAccount(_0x5afa57){this['id']=_0x5afa57['id']||0x0;this['name']=_0x5afa57['name']||'';this[_0xde4e('0x0')]=_0x5afa57[_0xde4e('0x0')]||'';this[_0xde4e('0x1')]=_0x5afa57[_0xde4e('0x1')]||'';this['remoteUri']=_0x5afa57[_0xde4e('0x2')]||'';this[_0xde4e('0x3')]=_0x5afa57[_0xde4e('0x3')]||'';this[_0xde4e('0x4')]=_0x5afa57[_0xde4e('0x4')]||{};}module[_0xde4e('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 4fa4aa9..11b6453 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 _0x48e3=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x48e3,0xe9));var _0x348e=function(_0x2b1137,_0x155b22){_0x2b1137=_0x2b1137-0x0;var _0x3e0119=_0x48e3[_0x2b1137];return _0x3e0119;};'use strict';function SugarcrmAccount(_0x52f8e9){this['id']=_0x52f8e9['id']||0x0;this[_0x348e('0x0')]=_0x52f8e9['name']||'';this[_0x348e('0x1')]=_0x52f8e9['username']||'';this['password']=_0x52f8e9[_0x348e('0x2')]||'';this[_0x348e('0x3')]=_0x52f8e9[_0x348e('0x3')]||'';this[_0x348e('0x4')]=_0x52f8e9['serverUrl']||'';this[_0x348e('0x5')]=_0x52f8e9['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x7289=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4a5f5d,_0xaffb6d){var _0x2e8201=function(_0x57ca3c){while(--_0x57ca3c){_0x4a5f5d['push'](_0x4a5f5d['shift']());}};_0x2e8201(++_0xaffb6d);}(_0x7289,0x1ca));var _0x9728=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7289[_0x6c993a];return _0x27f547;};'use strict';function SugarcrmAccount(_0x16238b){this['id']=_0x16238b['id']||0x0;this[_0x9728('0x0')]=_0x16238b[_0x9728('0x0')]||'';this[_0x9728('0x1')]=_0x16238b[_0x9728('0x1')]||'';this['password']=_0x16238b[_0x9728('0x2')]||'';this[_0x9728('0x3')]=_0x16238b[_0x9728('0x3')]||'';this[_0x9728('0x4')]=_0x16238b[_0x9728('0x4')]||'';this[_0x9728('0x5')]=_0x16238b[_0x9728('0x5')]||{};}module[_0x9728('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d3cf85d..f399602 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 _0x7d98=['stateTime','status','address','name','accountcode','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d98,0xe7));var _0x87d9=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x7d98[_0x550d12];return _0x12103d;};'use strict';function Telephone(_0x20137c){this['id']=_0x20137c['id']||0x0;this['name']=_0x20137c[_0x87d9('0x0')]||'';this[_0x87d9('0x1')]=_0x20137c[_0x87d9('0x1')]||'';this[_0x87d9('0x2')]='unknown';this[_0x87d9('0x3')]=0x0;this[_0x87d9('0x4')]='unknown';this[_0x87d9('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x9660=['accountcode','unknown','stateTime','status','address','name'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x9660,0x1f1));var _0x0966=function(_0x19719d,_0x2306e0){_0x19719d=_0x19719d-0x0;var _0x799191=_0x9660[_0x19719d];return _0x799191;};'use strict';function Telephone(_0xaac33){this['id']=_0xaac33['id']||0x0;this['name']=_0xaac33[_0x0966('0x0')]||'';this[_0x0966('0x1')]=_0xaac33[_0x0966('0x1')]||'';this['state']=_0x0966('0x2');this[_0x0966('0x3')]=0x0;this[_0x0966('0x4')]=_0x0966('0x2');this[_0x0966('0x5')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index e2b70fb..670ab1c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x4e15c7,_0x2fa1a3){var _0x205589=function(_0x4fb604){while(--_0x4fb604){_0x4e15c7['push'](_0x4e15c7['shift']());}};_0x205589(++_0x2fa1a3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0xb10b[_0x1865d4];return _0x1f0e1c;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2ee12a,_0x3b8851){var _0x5745e9=function(_0x103eae){while(--_0x103eae){_0x2ee12a['push'](_0x2ee12a['shift']());}};_0x5745e9(++_0x3b8851);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 164a852..aa62e38 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 _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x1db225,_0x4c1d7e){var _0xfc29ba=function(_0x2a3694){while(--_0x2a3694){_0x1db225['push'](_0x1db225['shift']());}};_0xfc29ba(++_0x4c1d7e);}(_0x8603,0x190));var _0x3860=function(_0x3c9ae6,_0x33582a){_0x3c9ae6=_0x3c9ae6-0x0;var _0x2d0e6c=_0x8603[_0x3c9ae6];return _0x2d0e6c;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 329f05d..c8b03aa 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 _0x0060=['unknown','registry','split','host','port','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','stateTime','status'];(function(_0x4f33ff,_0x4cc52d){var _0x40e19c=function(_0x4cf92e){while(--_0x4cf92e){_0x4f33ff['push'](_0x4f33ff['shift']());}};_0x40e19c(++_0x4cc52d);}(_0x0060,0xfa));var _0x0006=function(_0x1a78f0,_0x398b53){_0x1a78f0=_0x1a78f0-0x0;var _0x3704e5=_0x0060[_0x1a78f0];return _0x3704e5;};'use strict';function Trunk(_0x168f74){this['id']=_0x168f74['id']||0x0;this[_0x0006('0x0')]=_0x168f74['active']||![];this[_0x0006('0x1')]=_0x168f74[_0x0006('0x1')]||'';this[_0x0006('0x2')]='unknown';this[_0x0006('0x3')]=0x0;this[_0x0006('0x4')]=_0x0006('0x5');this[_0x0006('0x6')]=_0x168f74[_0x0006('0x6')]&&_0x168f74[_0x0006('0x6')]['indexOf'](':')?_0x168f74[_0x0006('0x6')][_0x0006('0x7')](':')[0x0]:'';this[_0x0006('0x8')]='';this[_0x0006('0x9')]='';this['domain']='';this[_0x0006('0xa')]='';this[_0x0006('0xb')]='';this[_0x0006('0xc')]=_0x0006('0x5');this[_0x0006('0xd')]='';this[_0x0006('0xe')]='';this[_0x0006('0xf')]=_0x168f74['defaultuser']||'';}module[_0x0006('0x10')]=Trunk; \ No newline at end of file +var _0x1dc7=['refresh','registrationtime','address','defaultuser','active','name','state','stateTime','unknown','registry','indexOf','split','host','port','domain','domainport'];(function(_0x48ea05,_0x1bb77c){var _0x1caa82=function(_0x4a90c3){while(--_0x4a90c3){_0x48ea05['push'](_0x48ea05['shift']());}};_0x1caa82(++_0x1bb77c);}(_0x1dc7,0x1e4));var _0x71dc=function(_0x2c3afe,_0x411ba4){_0x2c3afe=_0x2c3afe-0x0;var _0x2b3ef0=_0x1dc7[_0x2c3afe];return _0x2b3ef0;};'use strict';function Trunk(_0x2896a5){this['id']=_0x2896a5['id']||0x0;this[_0x71dc('0x0')]=_0x2896a5[_0x71dc('0x0')]||![];this[_0x71dc('0x1')]=_0x2896a5[_0x71dc('0x1')]||'';this[_0x71dc('0x2')]='unknown';this[_0x71dc('0x3')]=0x0;this['status']=_0x71dc('0x4');this['registry']=_0x2896a5[_0x71dc('0x5')]&&_0x2896a5['registry'][_0x71dc('0x6')](':')?_0x2896a5[_0x71dc('0x5')][_0x71dc('0x7')](':')[0x0]:'';this[_0x71dc('0x8')]='';this[_0x71dc('0x9')]='';this[_0x71dc('0xa')]='';this[_0x71dc('0xb')]='';this[_0x71dc('0xc')]='';this['stateRegistry']=_0x71dc('0x4');this[_0x71dc('0xd')]='';this[_0x71dc('0xe')]='';this[_0x71dc('0xf')]=_0x2896a5[_0x71dc('0xf')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 5967554..0838eac 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 _0xdba5=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0xdba5,0x165));var _0x5dba=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xdba5[_0x28f1de];return _0x5b5dad;};'use strict';function voiceExtension(_0x52fc0a){this['id']=_0x52fc0a['id']||0x0;this['exten']=_0x52fc0a[_0x5dba('0x0')]||'';this['recordingFormat']=_0x52fc0a[_0x5dba('0x1')]||_0x5dba('0x2');this['mandatoryDisposition']=_0x52fc0a[_0x5dba('0x3')]||![];}module[_0x5dba('0x4')]=voiceExtension; \ No newline at end of file +var _0x00fd=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x4eef80,_0x23c41b){var _0x5cd36e=function(_0x16f453){while(--_0x16f453){_0x4eef80['push'](_0x4eef80['shift']());}};_0x5cd36e(++_0x23c41b);}(_0x00fd,0x1a1));var _0xd00f=function(_0x3a8434,_0x1b63dc){_0x3a8434=_0x3a8434-0x0;var _0x49a612=_0x00fd[_0x3a8434];return _0x49a612;};'use strict';function voiceExtension(_0xb73b68){this['id']=_0xb73b68['id']||0x0;this[_0xd00f('0x0')]=_0xb73b68[_0xd00f('0x0')]||'';this[_0xd00f('0x1')]=_0xb73b68[_0xd00f('0x1')]||_0xd00f('0x2');this[_0xd00f('0x3')]=_0xb73b68[_0xd00f('0x3')]||![];}module[_0xd00f('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 d4dbbd2..2774b90 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 _0x4f11=['dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x2611dd,_0x1ab093){var _0x288bb4=function(_0x1553ac){while(--_0x1553ac){_0x2611dd['push'](_0x2611dd['shift']());}};_0x288bb4(++_0x1ab093);}(_0x4f11,0xcd));var _0x14f1=function(_0x3d6f94,_0x49d87f){_0x3d6f94=_0x3d6f94-0x0;var _0x2c1119=_0x4f11[_0x3d6f94];return _0x2c1119;};'use strict';var statusDesc=[_0x14f1('0x0'),_0x14f1('0x1'),_0x14f1('0x2'),_0x14f1('0x3'),_0x14f1('0x4'),'unavailable',_0x14f1('0x5'),_0x14f1('0x6'),_0x14f1('0x7')];var monitorFormat={'wav':_0x14f1('0x8'),'wav49':_0x14f1('0x9'),'gsm':_0x14f1('0xa')};var strategy={'rrmemory':_0x14f1('0xb'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2dd330){this['id']=_0x2dd330['id']||0x0;this['name']=_0x2dd330[_0x14f1('0xc')]||'';this[_0x14f1('0xd')]=_0x2dd330[_0x14f1('0xd')]||'';this[_0x14f1('0xe')]=_0x2dd330[_0x14f1('0xe')]||_0x14f1('0xf');this[_0x14f1('0x10')]=0x0;this['talking']=0x0;this[_0x14f1('0x11')]=0x0;this[_0x14f1('0x12')]=0x0;this[_0x14f1('0x13')]=0x0;this[_0x14f1('0x14')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x14f1('0x15')]=0x0;this[_0x14f1('0x16')]=0x0;this['acw']=_0x2dd330[_0x14f1('0x17')]||![];this[_0x14f1('0x18')]=_0x2dd330[_0x14f1('0x18')]||0xa;this[_0x14f1('0x19')]=_0x2dd330[_0x14f1('0x19')]||'no';this[_0x14f1('0x1a')]=!![];this[_0x14f1('0x1b')]='';this[_0x14f1('0x1c')]=0x0;this[_0x14f1('0x1d')]=0x0;this[_0x14f1('0x1e')]=_0x2dd330[_0x14f1('0x1e')]||null;this[_0x14f1('0x1f')]=_0x2dd330[_0x14f1('0x1f')]?_0x2dd330[_0x14f1('0x1f')]:null;this[_0x14f1('0x20')]=_0x2dd330[_0x14f1('0x20')];this[_0x14f1('0x21')]=_0x2dd330['dialMethod']||_0x14f1('0x22');this[_0x14f1('0x23')]=_0x2dd330[_0x14f1('0x23')]||0x0;this[_0x14f1('0x24')]=_0x2dd330[_0x14f1('0x24')]||0x0;this[_0x14f1('0x25')]=_0x2dd330[_0x14f1('0x25')]||0x1;this[_0x14f1('0x26')]=_0x2dd330['dialPredictiveOptimization']||_0x14f1('0x27');this[_0x14f1('0x28')]=_0x2dd330[_0x14f1('0x28')]||0.03;this[_0x14f1('0x29')]=_0x2dd330[_0x14f1('0x29')]||0x258;this[_0x14f1('0x2a')]=_0x2dd330[_0x14f1('0x2a')]||_0x14f1('0x2b');this[_0x14f1('0x2c')]=_0x2dd330['dialOriginateCallerIdNumber']||_0x14f1('0x2b');this['dialOriginateTimeout']=_0x2dd330[_0x14f1('0x2d')]||0x1e;this['dialQueueOptions']=_0x2dd330[_0x14f1('0x2e')]||'tTxX';this['dialQueueTimeout']=_0x2dd330[_0x14f1('0x2f')]||0x3;this[_0x14f1('0x30')]=_0x2dd330[_0x14f1('0x30')]||undefined;this[_0x14f1('0x31')]=_0x2dd330['dialCongestionMaxRetry']||0x3;this[_0x14f1('0x32')]=_0x2dd330[_0x14f1('0x32')]||0x96;this['dialBusyMaxRetry']=_0x2dd330[_0x14f1('0x33')]||0x3;this[_0x14f1('0x34')]=_0x2dd330['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x2dd330['dialNoAnswerMaxRetry']||0x3;this[_0x14f1('0x35')]=_0x2dd330[_0x14f1('0x35')]||0x96;this[_0x14f1('0x36')]=_0x2dd330[_0x14f1('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2dd330[_0x14f1('0x37')]||0x96;this[_0x14f1('0x38')]=_0x2dd330['dialDropMaxRetry']||0x3;this[_0x14f1('0x39')]=_0x2dd330[_0x14f1('0x39')]||0x96;this[_0x14f1('0x3a')]=_0x2dd330['dialAbandonedMaxRetry']||0x3;this[_0x14f1('0x3b')]=_0x2dd330[_0x14f1('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x2dd330[_0x14f1('0x3c')]||0x3;this[_0x14f1('0x3d')]=_0x2dd330[_0x14f1('0x3d')]||0x96;this[_0x14f1('0x3e')]=_0x2dd330[_0x14f1('0x3e')]||0x3;this[_0x14f1('0x3f')]=_0x2dd330[_0x14f1('0x3f')]||0x96;this[_0x14f1('0x40')]=_0x2dd330[_0x14f1('0x40')]||0x4;this['Trunk']=_0x2dd330[_0x14f1('0x41')]?_0x2dd330[_0x14f1('0x41')]:undefined;this['TrunkBackup']=_0x2dd330[_0x14f1('0x42')]?_0x2dd330[_0x14f1('0x42')]:undefined;this['dialPrefix']=_0x2dd330[_0x14f1('0x43')]||undefined;this[_0x14f1('0x44')]=_0x2dd330['Interval']?_0x2dd330[_0x14f1('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x2dd330[_0x14f1('0x45')]||_0x14f1('0x46');this['dialRandomLastDigitCallerIdNumber']=_0x2dd330['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x14f1('0x47')]=_0x2dd330['dialCutDigit']||undefined;this['strategy']=strategy[_0x2dd330[_0x14f1('0x48')]]||_0x14f1('0xb');this[_0x14f1('0x49')]=!![];this[_0x14f1('0x4a')]=_0x2dd330[_0x14f1('0x4a')]||![];this[_0x14f1('0x4b')]=_0x2dd330[_0x14f1('0x4b')];this['dialAMDGreeting']=_0x2dd330[_0x14f1('0x4c')];this[_0x14f1('0x4d')]=_0x2dd330[_0x14f1('0x4d')];this[_0x14f1('0x4e')]=_0x2dd330[_0x14f1('0x4e')];this[_0x14f1('0x4f')]=_0x2dd330['dialAMDMinWordLength'];this[_0x14f1('0x50')]=_0x2dd330['dialAMDBetweenWordsSilence'];this[_0x14f1('0x51')]=_0x2dd330[_0x14f1('0x51')];this['dialAMDSilenceThreshold']=_0x2dd330['dialAMDSilenceThreshold'];this[_0x14f1('0x52')]=_0x2dd330[_0x14f1('0x52')];this[_0x14f1('0x53')]=0x0;this[_0x14f1('0x54')]=0x0;this[_0x14f1('0x55')]=_0x2dd330[_0x14f1('0x55')];this['outboundAnswerCallsDay']=0x0;this[_0x14f1('0x56')]=0x0;this[_0x14f1('0x57')]=0x0;this[_0x14f1('0x58')]=0x0;this[_0x14f1('0x59')]=0x0;this[_0x14f1('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x14f1('0x5b')]=0x0;this[_0x14f1('0x5c')]=0x0;this[_0x14f1('0x5d')]=0x0;this[_0x14f1('0x5e')]=0x0;this[_0x14f1('0x5f')]=0x0;this[_0x14f1('0x60')]=0x0;this[_0x14f1('0x61')]=0x0;this[_0x14f1('0x62')]=undefined;this['startPredictive']=undefined;this[_0x14f1('0x63')]=undefined;this[_0x14f1('0x64')]=1.05;this[_0x14f1('0x65')]=0x0;this[_0x14f1('0x66')]=0x0;this[_0x14f1('0x67')]=0x0;this[_0x14f1('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x14f1('0x69')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x14f1('0x6a')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2dd330[_0x14f1('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x2dd330['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x14f1('0x6c')]=0x0;this[_0x14f1('0x6d')]=0x0;this[_0x14f1('0x6e')]=0x1;this[_0x14f1('0x6f')]=0x0;this[_0x14f1('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x14f1('0x71')]=0x0;this[_0x14f1('0x72')]=_0x2dd330[_0x14f1('0x72')]||0x1e;this[_0x14f1('0x73')]=_0x2dd330['dialRecallInQueue']||![];this['dialQueueProject2']=_0x2dd330[_0x14f1('0x74')]||undefined;this[_0x14f1('0x75')]=_0x2dd330[_0x14f1('0x75')]||![];this['dialAgiAfterHangupAgent']=_0x2dd330[_0x14f1('0x76')]||![];this[_0x14f1('0xd')]=monitorFormat[_0x2dd330[_0x14f1('0xd')]]?monitorFormat[_0x2dd330[_0x14f1('0xd')]]:undefined;this['mandatoryDisposition']=_0x2dd330[_0x14f1('0x77')]||![];this['mandatoryDispositionPause']=_0x2dd330[_0x14f1('0x78')]?_0x2dd330[_0x14f1('0x78')]:undefined;}module[_0x14f1('0x79')]=VoiceQueue; \ No newline at end of file +var _0x14a0=['startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav49','gsm','rrmemory','name','monitor_format','type','answered','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay'];(function(_0x564622,_0x27e399){var _0x5c407e=function(_0x1f4009){while(--_0x1f4009){_0x564622['push'](_0x564622['shift']());}};_0x5c407e(++_0x27e399);}(_0x14a0,0x8e));var _0x014a=function(_0x1ae071,_0x2f8e01){_0x1ae071=_0x1ae071-0x0;var _0x517835=_0x14a0[_0x1ae071];return _0x517835;};'use strict';var statusDesc=['unknown',_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0x014a('0x7'),'gsm':_0x014a('0x8')};var strategy={'rrmemory':_0x014a('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5a61ac){this['id']=_0x5a61ac['id']||0x0;this[_0x014a('0xa')]=_0x5a61ac[_0x014a('0xa')]||'';this[_0x014a('0xb')]=_0x5a61ac['monitor_format']||'';this['type']=_0x5a61ac[_0x014a('0xc')]||'inbound';this['waiting']=0x0;this['talking']=0x0;this['total']=0x0;this[_0x014a('0xd')]=0x0;this['sumDuration']=0x0;this[_0x014a('0xe')]=0x0;this[_0x014a('0xf')]=0x0;this['unmanaged']=0x0;this[_0x014a('0x10')]=0x0;this[_0x014a('0x11')]=0x0;this[_0x014a('0x12')]=0x0;this[_0x014a('0x13')]=_0x5a61ac[_0x014a('0x13')]||![];this[_0x014a('0x14')]=_0x5a61ac[_0x014a('0x14')]||0xa;this[_0x014a('0x15')]=_0x5a61ac[_0x014a('0x15')]||'no';this[_0x014a('0x16')]=!![];this[_0x014a('0x17')]='';this[_0x014a('0x18')]=0x0;this['temp']=0x0;this[_0x014a('0x19')]=_0x5a61ac[_0x014a('0x19')]||null;this['dialGlobalInterval']=_0x5a61ac[_0x014a('0x1a')]?_0x5a61ac[_0x014a('0x1a')]:null;this['dialActive']=_0x5a61ac[_0x014a('0x1b')];this[_0x014a('0x1c')]=_0x5a61ac[_0x014a('0x1c')]||_0x014a('0x1d');this[_0x014a('0x1e')]=_0x5a61ac[_0x014a('0x1e')]||0x0;this[_0x014a('0x1f')]=_0x5a61ac[_0x014a('0x1f')]||0x0;this[_0x014a('0x20')]=_0x5a61ac[_0x014a('0x20')]||0x1;this[_0x014a('0x21')]=_0x5a61ac[_0x014a('0x21')]||_0x014a('0x22');this[_0x014a('0x23')]=_0x5a61ac['dialPredictiveOptimizationPercentage']||0.03;this[_0x014a('0x24')]=_0x5a61ac[_0x014a('0x24')]||0x258;this[_0x014a('0x25')]=_0x5a61ac[_0x014a('0x25')]||_0x014a('0x26');this[_0x014a('0x27')]=_0x5a61ac[_0x014a('0x27')]||_0x014a('0x26');this[_0x014a('0x28')]=_0x5a61ac['dialOriginateTimeout']||0x1e;this[_0x014a('0x29')]=_0x5a61ac['dialQueueOptions']||_0x014a('0x2a');this[_0x014a('0x2b')]=_0x5a61ac[_0x014a('0x2b')]||0x3;this[_0x014a('0x2c')]=_0x5a61ac[_0x014a('0x2c')]||undefined;this[_0x014a('0x2d')]=_0x5a61ac[_0x014a('0x2d')]||0x3;this[_0x014a('0x2e')]=_0x5a61ac[_0x014a('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x5a61ac[_0x014a('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x5a61ac[_0x014a('0x30')]||0x96;this[_0x014a('0x31')]=_0x5a61ac['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x5a61ac[_0x014a('0x32')]||0x96;this[_0x014a('0x33')]=_0x5a61ac[_0x014a('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5a61ac[_0x014a('0x34')]||0x96;this[_0x014a('0x35')]=_0x5a61ac['dialDropMaxRetry']||0x3;this[_0x014a('0x36')]=_0x5a61ac[_0x014a('0x36')]||0x96;this['dialAbandonedMaxRetry']=_0x5a61ac['dialAbandonedMaxRetry']||0x3;this[_0x014a('0x37')]=_0x5a61ac[_0x014a('0x37')]||0x96;this[_0x014a('0x38')]=_0x5a61ac[_0x014a('0x38')]||0x3;this['dialMachineRetryFrequency']=_0x5a61ac[_0x014a('0x39')]||0x96;this[_0x014a('0x3a')]=_0x5a61ac[_0x014a('0x3a')]||0x3;this[_0x014a('0x3b')]=_0x5a61ac[_0x014a('0x3b')]||0x96;this[_0x014a('0x3c')]=_0x5a61ac[_0x014a('0x3c')]||0x4;this[_0x014a('0x3d')]=_0x5a61ac[_0x014a('0x3d')]?_0x5a61ac[_0x014a('0x3d')]:undefined;this[_0x014a('0x3e')]=_0x5a61ac['TrunkBackup']?_0x5a61ac[_0x014a('0x3e')]:undefined;this[_0x014a('0x3f')]=_0x5a61ac[_0x014a('0x3f')]||undefined;this[_0x014a('0x40')]=_0x5a61ac[_0x014a('0x40')]?_0x5a61ac[_0x014a('0x40')]:undefined;this[_0x014a('0x41')]=_0x5a61ac['dialOrderByScheduledAt']||_0x014a('0x42');this[_0x014a('0x43')]=_0x5a61ac['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x014a('0x44')]=_0x5a61ac[_0x014a('0x44')]||undefined;this[_0x014a('0x45')]=strategy[_0x5a61ac[_0x014a('0x45')]]||_0x014a('0x9');this[_0x014a('0x46')]=!![];this[_0x014a('0x47')]=_0x5a61ac[_0x014a('0x47')]||![];this['dialAMDInitialSilence']=_0x5a61ac[_0x014a('0x48')];this[_0x014a('0x49')]=_0x5a61ac[_0x014a('0x49')];this[_0x014a('0x4a')]=_0x5a61ac['dialAMDAfterGreetingSilence'];this[_0x014a('0x4b')]=_0x5a61ac[_0x014a('0x4b')];this[_0x014a('0x4c')]=_0x5a61ac[_0x014a('0x4c')];this[_0x014a('0x4d')]=_0x5a61ac[_0x014a('0x4d')];this[_0x014a('0x4e')]=_0x5a61ac[_0x014a('0x4e')];this[_0x014a('0x4f')]=_0x5a61ac['dialAMDSilenceThreshold'];this[_0x014a('0x50')]=_0x5a61ac['dialAMDMaximumWordLength'];this[_0x014a('0x51')]=0x0;this[_0x014a('0x52')]=0x0;this[_0x014a('0x53')]=_0x5a61ac[_0x014a('0x53')];this[_0x014a('0x54')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x014a('0x55')]=0x0;this[_0x014a('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x014a('0x57')]=0x0;this[_0x014a('0x58')]=0x0;this[_0x014a('0x59')]=0x0;this[_0x014a('0x5a')]=0x0;this[_0x014a('0x5b')]=0x0;this[_0x014a('0x5c')]=0x0;this[_0x014a('0x5d')]=0x0;this[_0x014a('0x5e')]=0x0;this[_0x014a('0x5f')]=0x0;this['startProgressive']=undefined;this[_0x014a('0x60')]=undefined;this[_0x014a('0x61')]=undefined;this[_0x014a('0x62')]=1.05;this[_0x014a('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x014a('0x64')]=0x0;this[_0x014a('0x65')]=0x0;this[_0x014a('0x66')]=0x0;this[_0x014a('0x67')]=0x0;this[_0x014a('0x68')]=0x0;this[_0x014a('0x69')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5a61ac[_0x014a('0x6a')]||0x14;this[_0x014a('0x6b')]=_0x5a61ac['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x014a('0x6c')]=0x0;this[_0x014a('0x6d')]=0x0;this[_0x014a('0x6e')]=0x1;this['erlangCalls']=0x0;this[_0x014a('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x014a('0x70')]=_0x5a61ac[_0x014a('0x70')]||0x1e;this['dialRecallInQueue']=_0x5a61ac[_0x014a('0x71')]||![];this[_0x014a('0x72')]=_0x5a61ac[_0x014a('0x72')]||undefined;this[_0x014a('0x73')]=_0x5a61ac[_0x014a('0x73')]||![];this[_0x014a('0x74')]=_0x5a61ac['dialAgiAfterHangupAgent']||![];this[_0x014a('0xb')]=monitorFormat[_0x5a61ac[_0x014a('0xb')]]?monitorFormat[_0x5a61ac[_0x014a('0xb')]]:undefined;this['mandatoryDisposition']=_0x5a61ac['mandatoryDisposition']||![];this[_0x014a('0x75')]=_0x5a61ac['mandatoryDispositionPause']?_0x5a61ac['mandatoryDispositionPause']:undefined;}module[_0x014a('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index a9d7f28..422b624 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 _0xb028=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x56d49d,_0x114e94){var _0x5a70fa=function(_0x318a06){while(--_0x318a06){_0x56d49d['push'](_0x56d49d['shift']());}};_0x5a70fa(++_0x114e94);}(_0xb028,0xfb));var _0x8b02=function(_0x3452ce,_0x124927){_0x3452ce=_0x3452ce-0x0;var _0xee20c5=_0xb028[_0x3452ce];return _0xee20c5;};'use strict';function VtigerAccount(_0x514163){this['id']=_0x514163['id']||0x0;this[_0x8b02('0x0')]=_0x514163['name']||'';this[_0x8b02('0x1')]=_0x514163[_0x8b02('0x1')]||'';this[_0x8b02('0x2')]=_0x514163[_0x8b02('0x2')]||'';this['remoteUri']=_0x514163[_0x8b02('0x3')]||'';this[_0x8b02('0x4')]=_0x514163[_0x8b02('0x4')]||'';this[_0x8b02('0x5')]=_0x514163[_0x8b02('0x5')]||{};}module[_0x8b02('0x6')]=VtigerAccount; \ No newline at end of file +var _0xed1c=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0xf80687,_0x586ed5){var _0x53a644=function(_0x1ae3d9){while(--_0x1ae3d9){_0xf80687['push'](_0xf80687['shift']());}};_0x53a644(++_0x586ed5);}(_0xed1c,0x131));var _0xced1=function(_0x5a44b7,_0x95bb17){_0x5a44b7=_0x5a44b7-0x0;var _0x2d96e5=_0xed1c[_0x5a44b7];return _0x2d96e5;};'use strict';function VtigerAccount(_0x4e612f){this['id']=_0x4e612f['id']||0x0;this[_0xced1('0x0')]=_0x4e612f['name']||'';this[_0xced1('0x1')]=_0x4e612f[_0xced1('0x1')]||'';this[_0xced1('0x2')]=_0x4e612f['accessKey']||'';this[_0xced1('0x3')]=_0x4e612f[_0xced1('0x3')]||'';this['serverUrl']=_0x4e612f[_0xced1('0x4')]||'';this[_0xced1('0x5')]=_0x4e612f[_0xced1('0x5')]||{};}module[_0xced1('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 6d7efe6..2aaca89 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 _0xe795=['Configurations','exports','name','password','token','remoteUri','authType','type','integrationTab'];(function(_0x18914c,_0x29e77a){var _0x3616d8=function(_0x44dd39){while(--_0x44dd39){_0x18914c['push'](_0x18914c['shift']());}};_0x3616d8(++_0x29e77a);}(_0xe795,0x14f));var _0x5e79=function(_0x1d4700,_0x1caa10){_0x1d4700=_0x1d4700-0x0;var _0x43ea9d=_0xe795[_0x1d4700];return _0x43ea9d;};'use strict';function ZendeskAccount(_0x3d5ca5){this['id']=_0x3d5ca5['id']||0x0;this[_0x5e79('0x0')]=_0x3d5ca5['name']||'';this['username']=_0x3d5ca5['username']||'';this[_0x5e79('0x1')]=_0x3d5ca5['password']||'';this[_0x5e79('0x2')]=_0x3d5ca5[_0x5e79('0x2')]||'';this[_0x5e79('0x3')]=_0x3d5ca5[_0x5e79('0x3')]||'';this[_0x5e79('0x4')]=_0x3d5ca5['authType']||'';this[_0x5e79('0x5')]=_0x3d5ca5[_0x5e79('0x5')]||_0x5e79('0x6');this['serverUrl']=_0x3d5ca5['serverUrl']||'';this[_0x5e79('0x7')]=_0x3d5ca5['Configurations']||{};}module[_0x5e79('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x7366=['integrationTab','serverUrl','Configurations','exports','name','password','token','remoteUri','authType','type'];(function(_0xaa0117,_0x29adbf){var _0x1304db=function(_0x399875){while(--_0x399875){_0xaa0117['push'](_0xaa0117['shift']());}};_0x1304db(++_0x29adbf);}(_0x7366,0x1d0));var _0x6736=function(_0x4102a1,_0x2baefd){_0x4102a1=_0x4102a1-0x0;var _0x443434=_0x7366[_0x4102a1];return _0x443434;};'use strict';function ZendeskAccount(_0x35e643){this['id']=_0x35e643['id']||0x0;this[_0x6736('0x0')]=_0x35e643[_0x6736('0x0')]||'';this['username']=_0x35e643['username']||'';this[_0x6736('0x1')]=_0x35e643['password']||'';this[_0x6736('0x2')]=_0x35e643[_0x6736('0x2')]||'';this[_0x6736('0x3')]=_0x35e643[_0x6736('0x3')]||'';this[_0x6736('0x4')]=_0x35e643['authType']||'';this[_0x6736('0x5')]=_0x35e643[_0x6736('0x5')]||_0x6736('0x6');this[_0x6736('0x7')]=_0x35e643[_0x6736('0x7')]||'';this['Configurations']=_0x35e643[_0x6736('0x8')]||{};}module[_0x6736('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 af22141..615b1c8 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 _0xfbc3=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0xfef430,_0x1b5e4f){var _0x42455b=function(_0xfef59b){while(--_0xfef59b){_0xfef430['push'](_0xfef430['shift']());}};_0x42455b(++_0x1b5e4f);}(_0xfbc3,0xe0));var _0x3fbc=function(_0x4dc13a,_0x493f4e){_0x4dc13a=_0x4dc13a-0x0;var _0x5b2b77=_0xfbc3[_0x4dc13a];return _0x5b2b77;};'use strict';function ZohoAccount(_0x52d607){this['id']=_0x52d607['id']||0x0;this[_0x3fbc('0x0')]=_0x52d607[_0x3fbc('0x0')]||'';this[_0x3fbc('0x1')]=_0x52d607['description']||'';this[_0x3fbc('0x2')]=_0x52d607[_0x3fbc('0x2')]||'';this[_0x3fbc('0x3')]=_0x52d607[_0x3fbc('0x3')]||'';this[_0x3fbc('0x4')]=_0x52d607[_0x3fbc('0x4')]||'';this[_0x3fbc('0x5')]=_0x52d607[_0x3fbc('0x5')]||'';this[_0x3fbc('0x6')]=_0x52d607[_0x3fbc('0x6')]||'';this['code']=_0x52d607[_0x3fbc('0x7')]||'';this['refreshToken']=_0x52d607[_0x3fbc('0x8')]||'';this[_0x3fbc('0x9')]=_0x52d607['Configurations']||{};}module[_0x3fbc('0xa')]=ZohoAccount; \ No newline at end of file +var _0xe66d=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','serverUrl'];(function(_0xa8ce02,_0x417254){var _0x532d1b=function(_0x1b1a6b){while(--_0x1b1a6b){_0xa8ce02['push'](_0xa8ce02['shift']());}};_0x532d1b(++_0x417254);}(_0xe66d,0x1a8));var _0xde66=function(_0x52469e,_0x3579c2){_0x52469e=_0x52469e-0x0;var _0x2e6692=_0xe66d[_0x52469e];return _0x2e6692;};'use strict';function ZohoAccount(_0x499ca0){this['id']=_0x499ca0['id']||0x0;this[_0xde66('0x0')]=_0x499ca0[_0xde66('0x0')]||'';this[_0xde66('0x1')]=_0x499ca0[_0xde66('0x1')]||'';this[_0xde66('0x2')]=_0x499ca0['host']||'';this[_0xde66('0x3')]=_0x499ca0[_0xde66('0x3')]||'';this[_0xde66('0x4')]=_0x499ca0[_0xde66('0x4')]||'';this['clientSecret']=_0x499ca0['clientSecret']||'';this[_0xde66('0x5')]=_0x499ca0['serverUrl']||'';this[_0xde66('0x6')]=_0x499ca0['code']||'';this[_0xde66('0x7')]=_0x499ca0[_0xde66('0x7')]||'';this['Configurations']=_0x499ca0[_0xde66('0x8')]||{};}module[_0xde66('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 1eff01f..b75a51b 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 _0x6c22=['calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','isNil','string','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x6c22,0x100));var _0x26c2=function(_0x2401d2,_0x57caea){_0x2401d2=_0x2401d2-0x0;var _0x17c81f=_0x6c22[_0x2401d2];return _0x17c81f;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3e2019,_0x5b2d54,_0x32c84c){var _0x50cd9a='';if(!_['isNil'](_0x5b2d54)&&'string'===typeof _0x5b2d54){_0x50cd9a+=_0x5b2d54;}if(!_[_0x26c2('0x0')](_0x32c84c)&&_0x26c2('0x1')===typeof _0x32c84c){_0x50cd9a+='\x20'+_0x32c84c;}if(_0x50cd9a!==''){return _0x50cd9a;}return _0x3e2019;}function Action(_0x16dd7e,_0x34942c,_0x48181b,_0x1f50b2,_0x547f3d){this['uniqueid']=_0x48181b||undefined;this['idContact']=_0x16dd7e['id'];this[_0x26c2('0x2')]=_0x34942c[_0x26c2('0x3')];this['type']=_0x34942c['type'];this[_0x26c2('0x4')]='queue';this[_0x26c2('0x5')]=![];this[_0x26c2('0x6')]=_['isNil'](_0x16dd7e['Agent'])?undefined:_0x16dd7e[_0x26c2('0x7')][_0x26c2('0x3')];this[_0x26c2('0x8')]=this[_0x26c2('0x6')]?util[_0x26c2('0x9')]('SIP/%s',this[_0x26c2('0x6')]):_0x1f50b2||undefined;this[_0x26c2('0xa')]=checkNameSurname(_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xc')],_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xd')],_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xe')]);this['active']=_0x16dd7e[_0x26c2('0xf')]||![];this['calleridnum']=_0x16dd7e[_0x26c2('0xb')][_0x26c2('0xc')];this[_0x26c2('0x10')]=_0x16dd7e['scheduledat'];this[_0x26c2('0x11')]=_0x16dd7e[_0x26c2('0x11')]||0x0;this[_0x26c2('0x12')]=_0x16dd7e[_0x26c2('0x12')]||0x0;this['countnoanswerretry']=_0x16dd7e[_0x26c2('0x13')]||0x0;this[_0x26c2('0x14')]=(_0x16dd7e[_0x26c2('0x11')]||0x0)+(_0x16dd7e[_0x26c2('0x12')]||0x0)+(_0x16dd7e[_0x26c2('0x13')]||0x0)+(_0x16dd7e[_0x26c2('0x15')]||0x0)+(_0x16dd7e['countdropretry']||0x0)+(_0x16dd7e[_0x26c2('0x16')]||0x0)+(_0x16dd7e[_0x26c2('0x17')]||0x0)+(_0x16dd7e['countagentrejectretry']||0x0);this[_0x26c2('0x15')]=_0x16dd7e[_0x26c2('0x15')]||0x0;this['countdropretry']=_0x16dd7e['countdropretry']||0x0;this[_0x26c2('0x16')]=_0x16dd7e['countabandonedretry']||0x0;this[_0x26c2('0x17')]=_0x16dd7e[_0x26c2('0x17')]||0x0;this['countagentrejectretry']=_0x16dd7e[_0x26c2('0x18')]||0x0;this[_0x26c2('0x19')]=_0x16dd7e[_0x26c2('0x19')];this[_0x26c2('0x1a')]=_0x16dd7e[_0x26c2('0x1a')];this[_0x26c2('0x1b')]=_0x16dd7e[_0x26c2('0x1b')];this[_0x26c2('0x1c')]=_0x16dd7e[_0x26c2('0x1c')];this[_0x26c2('0x1d')]=_0x16dd7e[_0x26c2('0x1d')];this[_0x26c2('0x1e')]=_0x16dd7e[_0x26c2('0x1e')];this['UserId']=_[_0x26c2('0x0')](_0x16dd7e[_0x26c2('0x7')])?_0x16dd7e[_0x26c2('0x1f')]:_0x16dd7e[_0x26c2('0x7')]['id'];this['VoiceQueueId']=_0x16dd7e[_0x26c2('0x20')];this[_0x26c2('0x21')]='';this[_0x26c2('0x22')]='';}Action['prototype'][_0x26c2('0x23')]=function(){return util['format'](_0x26c2('0x24'),this['calleridname'],this[_0x26c2('0x25')]);};module['exports']=Action; \ No newline at end of file +var _0xe42b=['name','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue'];(function(_0x47d6a9,_0x42ab92){var _0x31b8fe=function(_0x14cb74){while(--_0x14cb74){_0x47d6a9['push'](_0x47d6a9['shift']());}};_0x31b8fe(++_0x42ab92);}(_0xe42b,0x17b));var _0xbe42=function(_0x799277,_0x574d5f){_0x799277=_0x799277-0x0;var _0x56d41f=_0xe42b[_0x799277];return _0x56d41f;};'use strict';var util=require(_0xbe42('0x0'));var _=require(_0xbe42('0x1'));var moment=require(_0xbe42('0x2'));function checkNameSurname(_0x82207,_0x43dacb,_0x58e069){var _0x59eeeb='';if(!_[_0xbe42('0x3')](_0x43dacb)&&_0xbe42('0x4')===typeof _0x43dacb){_0x59eeeb+=_0x43dacb;}if(!_[_0xbe42('0x3')](_0x58e069)&&'string'===typeof _0x58e069){_0x59eeeb+='\x20'+_0x58e069;}if(_0x59eeeb!==''){return _0x59eeeb;}return _0x82207;}function Action(_0x19ee8c,_0x2218c2,_0x5ad154,_0xf0620c,_0x2981b5){this[_0xbe42('0x5')]=_0x5ad154||undefined;this[_0xbe42('0x6')]=_0x19ee8c['id'];this[_0xbe42('0x7')]=_0x2218c2[_0xbe42('0x8')];this['type']=_0x2218c2['type'];this[_0xbe42('0x9')]=_0xbe42('0x7');this[_0xbe42('0xa')]=![];this[_0xbe42('0xb')]=_['isNil'](_0x19ee8c['Agent'])?undefined:_0x19ee8c[_0xbe42('0xc')][_0xbe42('0x8')];this[_0xbe42('0xd')]=this[_0xbe42('0xb')]?util['format'](_0xbe42('0xe'),this[_0xbe42('0xb')]):_0xf0620c||undefined;this[_0xbe42('0xf')]=checkNameSurname(_0x19ee8c[_0xbe42('0x10')][_0xbe42('0x11')],_0x19ee8c['Contact'][_0xbe42('0x12')],_0x19ee8c[_0xbe42('0x10')][_0xbe42('0x13')]);this['active']=_0x19ee8c['active']||![];this['calleridnum']=_0x19ee8c[_0xbe42('0x10')]['phone'];this['scheduledat']=_0x19ee8c[_0xbe42('0x14')];this['countbusyretry']=_0x19ee8c[_0xbe42('0x15')]||0x0;this[_0xbe42('0x16')]=_0x19ee8c[_0xbe42('0x16')]||0x0;this[_0xbe42('0x17')]=_0x19ee8c[_0xbe42('0x17')]||0x0;this[_0xbe42('0x18')]=(_0x19ee8c['countbusyretry']||0x0)+(_0x19ee8c['countcongestionretry']||0x0)+(_0x19ee8c['countnoanswerretry']||0x0)+(_0x19ee8c[_0xbe42('0x19')]||0x0)+(_0x19ee8c['countdropretry']||0x0)+(_0x19ee8c[_0xbe42('0x1a')]||0x0)+(_0x19ee8c[_0xbe42('0x1b')]||0x0)+(_0x19ee8c['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x19ee8c[_0xbe42('0x19')]||0x0;this[_0xbe42('0x1c')]=_0x19ee8c[_0xbe42('0x1c')]||0x0;this[_0xbe42('0x1a')]=_0x19ee8c[_0xbe42('0x1a')]||0x0;this[_0xbe42('0x1b')]=_0x19ee8c[_0xbe42('0x1b')]||0x0;this['countagentrejectretry']=_0x19ee8c[_0xbe42('0x1d')]||0x0;this['callback']=_0x19ee8c['callback'];this[_0xbe42('0x1e')]=_0x19ee8c[_0xbe42('0x1e')];this[_0xbe42('0x1f')]=_0x19ee8c[_0xbe42('0x1f')];this[_0xbe42('0x20')]=_0x19ee8c[_0xbe42('0x20')];this[_0xbe42('0x21')]=_0x19ee8c[_0xbe42('0x21')];this[_0xbe42('0x22')]=_0x19ee8c[_0xbe42('0x22')];this['UserId']=_['isNil'](_0x19ee8c[_0xbe42('0xc')])?_0x19ee8c[_0xbe42('0x23')]:_0x19ee8c[_0xbe42('0xc')]['id'];this[_0xbe42('0x24')]=_0x19ee8c['VoiceQueueId'];this['originatecalleridnum']='';this[_0xbe42('0x25')]='';}Action[_0xbe42('0x26')][_0xbe42('0x27')]=function(){return util[_0xbe42('0x28')]('\x22%s\x22\x20<%s>',this[_0xbe42('0xf')],this[_0xbe42('0x29')]);};module[_0xbe42('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 330dc78..821cb6e 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 _0x818e=['[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','[Blacklist][error]','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','phone','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','user:%s','accountcode','calleridnum','[originated][increment]','actionid','logLookAgent','clone','isFailure','unlockContact','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','../ami','./rpcDb','./action','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangupRequest','dialend','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','outbound','name','strategy','answered','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','type','clearZombieChannels','hasOwnProperty','dialActive','setMessage','recallMe','actions','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','contactId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','isNil','length','getDiff','Agent','voicePause','run','then','[RecallMe]','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject'];(function(_0x5df05c,_0x56e167){var _0x4d3f47=function(_0x2c2ee7){while(--_0x2c2ee7){_0x5df05c['push'](_0x5df05c['shift']());}};_0x4d3f47(++_0x56e167);}(_0x818e,0x79));var _0xe818=function(_0x385944,_0xfef129){_0x385944=_0x385944-0x0;var _0x55bd81=_0x818e[_0x385944];return _0x55bd81;};'use strict';var util=require(_0xe818('0x0'));var _=require('lodash');var BPromise=require(_0xe818('0x1'));var uuid=require(_0xe818('0x2'));var moment=require(_0xe818('0x3'));var md5=require(_0xe818('0x4'));var Redis=require(_0xe818('0x5'));var config=require(_0xe818('0x6'));var logger=require('../../../config/logger')(_0xe818('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0xe818('0x8'));var rpcDb=require(_0xe818('0x9'));var Action=require(_0xe818('0xa'));var ut=require('./util/util');config[_0xe818('0xb')]=_['defaults'](config[_0xe818('0xb')],{'host':_0xe818('0xc'),'port':0x18eb});var io=require(_0xe818('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xe818('0xe')][_0xe818('0xf')]=function(_0x39c5cd){this[_0xe818('0x10')]=this[_0xe818('0x10')]?this['tail'][_0xe818('0x11')](_0x39c5cd):_0x39c5cd();};function Preview(_0x1e2f42){this[_0xe818('0x12')]=new Sequence();this[_0xe818('0x13')]=_0x1e2f42[_0xe818('0x14')];this[_0xe818('0x15')]=_0x1e2f42['trunks'];this['actions']={};this[_0xe818('0x16')]=_0x1e2f42[_0xe818('0x16')];this[_0xe818('0x17')]=0x0;ami['on'](_0xe818('0x18'),this[_0xe818('0x19')][_0xe818('0x1a')](this));ami['on']('hangup',this['syncHangup'][_0xe818('0x1a')](this));ami['on']('hanguprequest',this[_0xe818('0x1b')][_0xe818('0x1a')](this));ami['on'](_0xe818('0x1c'),this['syncDialEnd']['bind'](this));ami['on'](_0xe818('0x1d'),this[_0xe818('0x1e')]['bind'](this));ami['on']('varset',this[_0xe818('0x1f')][_0xe818('0x1a')](this));ami['on']('attendedtransfer',this[_0xe818('0x20')][_0xe818('0x1a')](this));ami['on'](_0xe818('0x21'),this[_0xe818('0x22')][_0xe818('0x1a')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0xd5a353,_0x2f3037,_0x60664b){io['to'](_0xd5a353)[_0xe818('0x23')](_0x2f3037,_0x60664b);}function emitCampaignPreview(_0x534c87){if(_0x534c87['type']===_0xe818('0x24')){var _0x534a70={'id':_0x534c87['id'],'name':_0x534c87[_0xe818('0x25')],'strategy':_0x534c87[_0xe818('0x26')],'answered':_0x534c87[_0xe818('0x27')],'available':_0x534c87['available'],'loggedIn':_0x534c87['loggedIn'],'pTalking':_0x534c87['pTalking'],'sumBillable':_0x534c87[_0xe818('0x28')],'sumDuration':_0x534c87[_0xe818('0x29')],'sumHoldTime':_0x534c87[_0xe818('0x2a')]||0x0,'talking':_0x534c87[_0xe818('0x2b')],'total':_0x534c87['total'],'type':_0x534c87['type'],'unmanaged':_0x534c87[_0xe818('0x2c')],'abandoned':_0x534c87['abandoned'],'waiting':_0x534c87[_0xe818('0x2d')],'loggedInDb':_0x534c87[_0xe818('0x2e')],'dialActive':_0x534c87['dialActive'],'dialMethod':_0x534c87[_0xe818('0x2f')],'dialOriginateCallerIdName':_0x534c87[_0xe818('0x30')],'dialOriginateCallerIdNumber':_0x534c87['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x534c87[_0xe818('0x31')],'dialPrefix':_0x534c87[_0xe818('0x32')],'outboundAnswerAgiCallsDay':_0x534c87[_0xe818('0x33')],'outboundAnswerCallsDay':_0x534c87[_0xe818('0x34')],'outboundBlacklistCallsDay':_0x534c87['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x534c87['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x534c87['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x534c87[_0xe818('0x35')],'outboundDropCallsDayCallersExit':_0x534c87[_0xe818('0x36')],'outboundDropCallsDayTimeout':_0x534c87[_0xe818('0x37')],'outboundNoAnswerCallsDay':_0x534c87[_0xe818('0x38')],'outboundNoSuchCallsDay':_0x534c87[_0xe818('0x39')],'outboundOriginateFailureCallsDay':_0x534c87[_0xe818('0x3a')],'outboundReCallsDay':_0x534c87[_0xe818('0x3b')],'outboundRejectCallsDay':_0x534c87['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x534c87[_0xe818('0x3c')],'outboundAbandonedCallsDay':_0x534c87[_0xe818('0x3d')],'predictiveIntervalAnsweredCalls':_0x534c87[_0xe818('0x3e')],'predictiveIntervalAvgHoldtime':_0x534c87['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x534c87[_0xe818('0x3f')],'predictiveIntervalDroppedCallsCallersExit':_0x534c87[_0xe818('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x534c87[_0xe818('0x41')],'predictiveIntervalErlangCalls':_0x534c87[_0xe818('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x534c87['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x534c87[_0xe818('0x43')],'predictiveIntervalMultiplicativeFactor':_0x534c87['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x534c87[_0xe818('0x44')],'predictiveIntervalAvailable':_0x534c87[_0xe818('0x45')],'predictiveIntervalTotalCalls':_0x534c87['predictiveIntervalTotalCalls'],'message':_0x534c87[_0xe818('0x46')],'originated':_0x534c87[_0xe818('0x47')],'erlangCalls':_0x534c87[_0xe818('0x48')],'erlangCallToSecond':_0x534c87[_0xe818('0x49')],'erlangAbandonmentRate':_0x534c87[_0xe818('0x4a')],'erlangBusyFactor':_0x534c87[_0xe818('0x4b')],'startPredictive':_0x534c87['startPredictive'],'startProgressive':_0x534c87[_0xe818('0x4c')]};if(_0x534c87[_0xe818('0x4d')]){_0x534a70[_0xe818('0x4d')]={'id':_0x534c87[_0xe818('0x4d')]['id'],'name':_0x534c87[_0xe818('0x4d')]['name'],'active':_0x534c87[_0xe818('0x4d')][_0xe818('0x4e')],'callerid':_0x534c87[_0xe818('0x4d')][_0xe818('0x4f')]};}if(_0x534c87[_0xe818('0x50')]){_0x534a70['Interval']={'id':_0x534c87[_0xe818('0x50')]['id'],'name':_0x534c87[_0xe818('0x50')]['name']};}var _0x5d4206=md5(JSON['stringify'](_0x534a70));if(_0x534c87[_0xe818('0x4')]!==_0x5d4206){_0x534c87[_0xe818('0x4')]=_0x5d4206;emit(util[_0xe818('0x51')]('voice:queue:%s',_0x534a70[_0xe818('0x25')]),'voice_queue:save',_0x534a70);}}}function emitVoiceQueueChannelRemove(_0x352eba){logger[_0xe818('0x52')](_0xe818('0x53'),JSON[_0xe818('0x54')](_0x352eba));emit(util[_0xe818('0x51')](_0xe818('0x55'),_0x352eba[_0xe818('0x25')]),_0xe818('0x56'),_0x352eba);io[_0xe818('0x23')]('voice_queue_presence:remove',_0x352eba);}function notSendMessagesQueue(_0x344fd3){if(_0x344fd3[_0xe818('0x57')]){if(_0x344fd3[_0xe818('0x47')]===0x0&&_0x344fd3[_0xe818('0x58')]===0x0){_0x344fd3[_0xe818('0x57')]=![];_0x344fd3['available']=0x0;_0x344fd3[_0xe818('0x59')]=0x0;_0x344fd3[_0xe818('0x46')]=_0xe818('0x5a');ut[_0xe818('0x5b')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x344fd3[_0xe818('0x25')]+_0xe818('0x5c'));}else{_0x344fd3[_0xe818('0x46')]=_0xe818('0x5d');ut['logger'](_0xe818('0x5e'),_0x344fd3[_0xe818('0x25')]+_0xe818('0x5f'));}emitCampaignPreview(_0x344fd3);}}Preview[_0xe818('0xe')][_0xe818('0x60')]=function(){var _0x4d7f49=this;setInterval(function(){_0x4d7f49[_0xe818('0x61')]();},0x7cf);};Preview[_0xe818('0xe')][_0xe818('0x61')]=function(){var _0x832d1f=this[_0xe818('0x13')];this[_0xe818('0x17')]+=0x1;for(var _0x5ce950 in _0x832d1f){if(_0x832d1f['hasOwnProperty'](_0x5ce950)&&(_0x832d1f[_0x5ce950][_0xe818('0x2f')]===_0xe818('0x7')||_0x832d1f[_0x5ce950]['dialMethod']===_0xe818('0x62'))&&_0x832d1f[_0x5ce950][_0xe818('0x63')]==='outbound'){if(this[_0xe818('0x17')]>0x7){this[_0xe818('0x17')]=0x0;this[_0xe818('0x64')]();}}if(_0x832d1f[_0xe818('0x65')](_0x5ce950)&&_0x832d1f[_0x5ce950][_0xe818('0x2f')]===_0xe818('0x7')&&_0x832d1f[_0x5ce950][_0xe818('0x63')]==='outbound'){if(_0x832d1f[_0x5ce950][_0xe818('0x66')]){this[_0xe818('0x67')](_0x832d1f[_0x5ce950]);this[_0xe818('0x68')](_0x832d1f[_0x5ce950]);}else{notSendMessagesQueue(_0x832d1f[_0x5ce950]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x518a3a){var _0x20e3ec=this;this['sequence']['enqueue'](function(){if(!_['isNil'](_0x20e3ec[_0xe818('0x69')][_0x518a3a])){loggerAction['info'](_0xe818('0x6a'),_0x518a3a,_0xe818('0x6b'),_0x20e3ec[_0xe818('0x69')][_0x518a3a][_0xe818('0x6c')],'originated:\x20',JSON[_0xe818('0x54')](_0x20e3ec['campaignsPreview'][_0x20e3ec[_0xe818('0x69')][_0x518a3a][_0xe818('0x6c')]][_0xe818('0x47')]),_0xe818('0x6d'),JSON[_0xe818('0x54')](_0x20e3ec[_0xe818('0x13')][_0x20e3ec[_0xe818('0x69')][_0x518a3a][_0xe818('0x6c')]][_0xe818('0x58')]),JSON[_0xe818('0x54')](_0x20e3ec[_0xe818('0x69')][_0x518a3a]['dialAnswer']),JSON[_0xe818('0x54')](_[_0xe818('0x6e')](_0x20e3ec['actions'][_0x518a3a],[_0xe818('0x6f'),'UserId',_0xe818('0x70'),'ListId'])));return ami[_0xe818('0x71')]({'action':_0xe818('0x72'),'channel':_0x20e3ec['actions'][_0x518a3a][_0xe818('0x73')]})[_0xe818('0x74')](function(_0x7f1b03){if(_0x7f1b03['message']===_0xe818('0x75')){setTimeout(function(){if(_0x20e3ec[_0xe818('0x69')][_0x518a3a]){ut[_0xe818('0x76')](_0x20e3ec[_0xe818('0x13')][_0x20e3ec['actions'][_0x518a3a][_0xe818('0x6c')]],_0xe818('0x77'));if(_0x20e3ec['actions'][_0x518a3a][_0xe818('0x78')]===!![]){ut[_0xe818('0x79')](_0x20e3ec[_0xe818('0x13')][_0x20e3ec['actions'][_0x518a3a][_0xe818('0x6c')]],'[clearZombieChannel]');ut[_0xe818('0x7a')](_0xe818('0x7b')+_0x518a3a,_0x20e3ec[_0xe818('0x69')][_0x518a3a]['queue']);}ut[_0xe818('0x7a')](_0xe818('0x7c')+_0x518a3a,_0x20e3ec[_0xe818('0x69')][_0x518a3a]['queue']);delete _0x20e3ec['actions'][_0x518a3a];}},0x2328);}});}});};Preview[_0xe818('0xe')][_0xe818('0x64')]=function(){var _0x46b9ee=this;loggerAction['info'](_0xe818('0x7d'),_[_0xe818('0x7e')](this[_0xe818('0x69')]));for(var _0x47057b in this[_0xe818('0x69')]){if(_0x46b9ee['actions'][_0xe818('0x65')](_0x47057b)){_0x46b9ee['clearZombieChannel'](_0x47057b);}}};Preview[_0xe818('0xe')][_0xe818('0x68')]=function(_0x2a3f46){var _0x16caa9=this;rpcDb[_0xe818('0x7f')](_0x2a3f46['id'],ut[_0xe818('0x80')](this[_0xe818('0x16')]))['then'](function(_0x432754){if(!_[_0xe818('0x81')](_0x432754)){for(var _0x28d1b1=0x0;_0x28d1b1<_0x432754[_0xe818('0x82')];_0x28d1b1+=0x1){if(ut[_0xe818('0x83')](_0x432754[_0x28d1b1]['scheduledat'])<_0x2a3f46['dialRecallMeTimeout']*0x3c){if(_0x432754[_0x28d1b1][_0xe818('0x84')]&&!_0x432754[_0x28d1b1][_0xe818('0x84')][_0xe818('0x85')]){_0x16caa9[_0xe818('0x86')](_0x432754[_0x28d1b1]['id'])[_0xe818('0x87')](ut['logger2'](_0xe818('0x88')))[_0xe818('0x74')](ut[_0xe818('0x89')]('[RecallMe]'));}else{rpcDb[_0xe818('0x8a')](_0x432754[_0x28d1b1]['id']);}}else{var _0x3d5147=new Action(_0x432754[_0x28d1b1],_0x2a3f46);_0x3d5147['starttime']=moment()['format'](_0xe818('0x8b'));_0x2a3f46[_0xe818('0x3b')]+=0x1;ut[_0xe818('0x8c')](_0x3d5147,0x17,_0xe818('0x8d'));if(_0x2a3f46[_0xe818('0x8e')]){rpcDb[_0xe818('0x8f')](ut['createBody'](_0x432754[_0x28d1b1]));rpcDb['createCustomerHistory'](_0x3d5147,_0xe818('0x90'));}else{ut[_0xe818('0x8c')](_0x3d5147,0x16,_0xe818('0x91'));rpcDb[_0xe818('0x92')](_0x3d5147,_0xe818('0x93'));rpcDb[_0xe818('0x94')](_0x3d5147,_0xe818('0x93'));}}}}})[_0xe818('0x74')](ut[_0xe818('0x89')](_0xe818('0x95')));};Preview['prototype'][_0xe818('0x67')]=function(_0xaebb4c){_0xaebb4c['sendMessageOneNotActive']=!![];if(ut[_0xe818('0x96')](_0xaebb4c['loggedIn'])){_0xaebb4c[_0xe818('0x46')]=_0xe818('0x97');}else if(!ut[_0xe818('0x98')](_0xaebb4c[_0xe818('0x66')])){_0xaebb4c[_0xe818('0x46')]=_0xe818('0x5a');}else if(!this['isTrunkReachable'](_0xaebb4c[_0xe818('0x4d')])){if(!this[_0xe818('0x99')](_0xaebb4c[_0xe818('0x9a')])){_0xaebb4c[_0xe818('0x46')]=_0xe818('0x9b');}else{_0xaebb4c[_0xe818('0x46')]=_0xe818('0x9c');}}else{_0xaebb4c[_0xe818('0x46')]='ACTIVE';}emitCampaignPreview(_0xaebb4c);};Preview[_0xe818('0xe')][_0xe818('0x9d')]=function(_0x247a8f,_0xee87c5,_0x12d380){var _0x4cdf4f=this;var _0xbf139d=this[_0xe818('0x69')][_0xee87c5];var _0x1df7d3=this[_0xe818('0x13')][_0xbf139d['queue']];var _0x35161d;if(_0x1df7d3){switch(_0x12d380){case'1':_0x1df7d3[_0xe818('0x39')]+=0x1;_0xbf139d['countnosuchnumberretry']+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x0,_0xe818('0xa0'));ami[_0xe818('0x23')](_0xe818('0xa1'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xa3')));rpcDb[_0xe818('0x92')](_0xbf139d,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xa6'));}else{if(_0xbf139d[_0xe818('0xa7')]>=_0x1df7d3['dialNoSuchNumberMaxRetry']){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xa6'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xa7'),_0x1df7d3[_0xe818('0xaa')]),_0xbf139d['unlockAgent'],_0xbf139d[_0xe818('0xab')]);}}delete this[_0xe818('0x69')][_0x247a8f['linkedid']];break;case _0xe818('0xac'):var _0x3dd89d=moment()[_0xe818('0x51')](_0xe818('0x8b'));_0xbf139d[_0xe818('0xad')]=_0x3dd89d;_0xbf139d[_0xe818('0xae')]=_0x3dd89d;_0xbf139d[_0xe818('0x78')]=!![];_0x1df7d3[_0xe818('0x58')]+=0x1;logger['info'](_0xe818('0xaf'),_0xbf139d[_0xe818('0xb0')],_0xe818('0xb1'),_0x1df7d3[_0xe818('0x25')],_0xe818('0x6d'),_0x1df7d3[_0xe818('0x58')]);ami[_0xe818('0x23')](_0xe818('0xb2'),ut[_0xe818('0xa2')](_0xbf139d,'connect',this['campaignsPreview'][_0xbf139d['queue']]));if(_0x1df7d3[_0xe818('0xb3')]){ami[_0xe818('0x23')]('custom:agentConnectPreview',ut['buildAcw'](_0xbf139d));}break;case'16':ami[_0xe818('0x23')](_0xe818('0xb4'),ut['buildObj'](_0xbf139d,_0xe818('0xb5'),this[_0xe818('0x13')][_0xbf139d[_0xe818('0x6c')]]));emitVoiceQueueChannelRemove(ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xb5')));_0x1df7d3['outboundAnswerCallsDay']+=0x1;_0x1df7d3['total']+=0x1;_0x1df7d3['answered']+=0x1;ut['decrementTalkink'](_0x1df7d3,_0xe818('0xb6'));_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x4,_0xe818('0xb7'));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xb8'));rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xb9'));rpcDb[_0xe818('0xba')](_0xbf139d);_0x1df7d3['sumDuration']+=_0xbf139d[_0xe818('0xbb')];_0x1df7d3['sumBillable']+=_0xbf139d[_0xe818('0xbb')];logger[_0xe818('0x52')](_0xe818('0xbc'),_0xbf139d['uniqueid'],_0xe818('0xb1'),_0x1df7d3['name'],'pTalking:\x20',_0x1df7d3[_0xe818('0x58')]);delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];break;case'BUSY':_0x1df7d3[_0xe818('0xbe')]+=0x1;_0xbf139d[_0xe818('0xbf')]+=0x1;_0xbf139d['countglobal']=ut['totalGlobal'](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x5,_0xe818('0xc0'));ami[_0xe818('0x23')]('custom:agentbusy',ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xc1')));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xc2'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xc4'));}else{if(_0xbf139d[_0xe818('0xbf')]>=_0x1df7d3[_0xe818('0xc5')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xc2'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xbf'),_0x1df7d3[_0xe818('0xc6')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case'NOANSWER':_0x1df7d3[_0xe818('0x38')]+=0x1;_0xbf139d[_0xe818('0xc8')]+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut['logCustomer'](_0xbf139d,0x3,_0xe818('0xc9'));ami['emit'](_0xe818('0xca'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xcb')));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xcc'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut['cloneAction'](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xbf139d['countnoanswerretry']>=_0x1df7d3[_0xe818('0xcd')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xcc'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xc8'),_0x1df7d3[_0xe818('0xce')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case'CONGESTION':_0x1df7d3[_0xe818('0xcf')]+=0x1;_0xbf139d[_0xe818('0xd0')]+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x8,_0xe818('0xd1'));ami[_0xe818('0x23')](_0xe818('0xd2'),ut[_0xe818('0xa2')](_0xbf139d,'congestion'));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xd3'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb['createCustomerFinal'](_0x35161d,_0xe818('0xd4'));}else{if(_0xbf139d['countcongestionretry']>=_0x1df7d3[_0xe818('0xd5')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xd3'));}else{rpcDb['rescheduleContact'](ut[_0xe818('0xa9')](_0xbf139d,'countcongestionretry',_0x1df7d3[_0xe818('0xc6')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d['activeContact']);}}break;case'CANCEL':_0x1df7d3[_0xe818('0xd6')]+=0x1;_0xbf139d['countagentrejectretry']+=0x1;_0xbf139d['countglobal']=ut[_0xe818('0x9f')](_0xbf139d);ut['logCustomer'](_0xbf139d,0x14,_0xe818('0xd7'));ami['emit'](_0xe818('0xd8'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xd9')));rpcDb['createCustomerHistory'](_0xbf139d,_0xe818('0xda'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut['cloneAction'](_0xbf139d,0x14,'AgentReject');rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xdb'));}else{if(_0xbf139d['countagentrejectretry']>=_0x1df7d3[_0xe818('0xdc')]){rpcDb[_0xe818('0x94')](_0xbf139d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xdd'),_0x1df7d3[_0xe818('0xde')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case _0xe818('0xdf'):_0x1df7d3[_0xe818('0x3d')]+=0x1;_0xbf139d['countabandonedretry']+=0x1;_0xbf139d[_0xe818('0x9e')]=ut['totalGlobal'](_0xbf139d);ut['logCustomer'](_0xbf139d,0xb,_0xe818('0xe0'));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xe1'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,'Global');rpcDb['createCustomerFinal'](_0x35161d,_0xe818('0xe1'));}else{if(_0xbf139d[_0xe818('0xe2')]>=_0x1df7d3[_0xe818('0xe3')]){rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xe1'));}else{rpcDb[_0xe818('0xa8')](ut[_0xe818('0xa9')](_0xbf139d,_0xe818('0xe4'),_0x1df7d3[_0xe818('0xe5')]),_0xbf139d[_0xe818('0xc7')],_0xbf139d[_0xe818('0xab')]);}}break;case'18':_0x1df7d3['outboundUnknownCallsDay']+=0x1;_0xbf139d[_0xe818('0xe6')]+=0x1;_0xbf139d[_0xe818('0x9e')]=ut[_0xe818('0x9f')](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x12,_0x247a8f['cause-txt']||_0x247a8f[_0xe818('0xe7')]);ami['emit']('custom:amd',ut['buildObj'](_0xbf139d,_0xe818('0xe8')));rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xe9'));if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut['cloneAction'](_0xbf139d,0xf,'Global');rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xe9'));}else{rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xe9'));}delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];break;case'19':_0x1df7d3[_0xe818('0x3c')]+=0x1;_0xbf139d['countglobal']=ut['totalGlobal'](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0x13,_0x247a8f[_0xe818('0xea')]||_0x247a8f[_0xe818('0xe7')]);ami[_0xe818('0x23')](_0xe818('0xeb'),ut[_0xe818('0xa2')](_0xbf139d,_0xe818('0xe8')));rpcDb[_0xe818('0x92')](_0xbf139d,'[callProgressDetectingCustomer][machine]');if(ut[_0xe818('0x9f')](_0xbf139d)>=_0x1df7d3[_0xe818('0xc3')]){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,_0xe818('0xa5'));rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xec'));}else{rpcDb[_0xe818('0x94')](_0xbf139d,_0xe818('0xec'));}delete this[_0xe818('0x69')][_0x247a8f['linkedid']];break;default:if(_0xbf139d['dialAnswer']){ut[_0xe818('0x79')](_0x1df7d3,_0xe818('0xed'));ut[_0xe818('0x7a')](_0xe818('0xee')+_0x1df7d3[_0xe818('0x25')],_0x247a8f);}_0x1df7d3['outboundUnknownCallsDay']+=0x1;_0xbf139d[_0xe818('0x9e')]=ut['totalGlobal'](_0xbf139d);ut[_0xe818('0x8c')](_0xbf139d,0xc,_0x247a8f[_0xe818('0xea')]||_0x247a8f[_0xe818('0xe7')]);rpcDb[_0xe818('0x92')](_0xbf139d,_0xe818('0xef'));if(ut['totalGlobal'](_0xbf139d)>=_0x1df7d3['dialGlobalMaxRetry']){_0x35161d=ut[_0xe818('0xa4')](_0xbf139d,0xf,'Global');rpcDb[_0xe818('0x94')](_0x35161d,_0xe818('0xf0'));}else{rpcDb[_0xe818('0x94')](_0xbf139d,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];}if(!(_0xbf139d[_0xe818('0x78')]&&_0x12d380==='16')){ut[_0xe818('0x76')](_0x1df7d3,_0xe818('0xf1'));logger[_0xe818('0x52')]('[originated][decrement][callProgressDetectingCustomer]',_0xbf139d['uniqueid'],_0xe818('0xb1'),_0x1df7d3[_0xe818('0x25')],_0xe818('0xf2'),_0x1df7d3['originated']);}if(_0x12d380!==_0xe818('0xac')){delete this[_0xe818('0x69')][_0x247a8f[_0xe818('0xbd')]];delete this[_0xe818('0x69')][_0x247a8f['destlinkedid']];}}};Preview[_0xe818('0xe')]['callProgressDetectingAgent']=function(_0x2370f8,_0x3dc9f4,_0x57b47d){if(_['isUndefined'](_0x3dc9f4)&&_0xe818('0xf3')!==typeof _0x3dc9f4){return;}if(_[_0xe818('0xf4')](_0x57b47d)&&_0xe818('0xf3')!==typeof _0x57b47d){return;}switch(_0x57b47d[_0xe818('0xf5')]){case'0':ut[_0xe818('0xf6')](_0x2370f8,0x0,'NoSuchNumber');rpcDb[_0xe818('0xf7')](_0x2370f8,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x2370f8,0x3,'NoAnswer');rpcDb[_0xe818('0xf7')](_0x2370f8,_0xe818('0xf8'));break;case'5':ut[_0xe818('0xf6')](_0x2370f8,0x5,'Busy');rpcDb[_0xe818('0xf7')](_0x2370f8,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xe818('0xf6')](_0x2370f8,0x8,_0xe818('0xd1'));rpcDb['createAgentHistory'](_0x2370f8,_0xe818('0xf9'));break;case'22':ut[_0xe818('0xf6')](_0x2370f8,0x16,'AnswerAGI');rpcDb[_0xe818('0xf7')](_0x2370f8,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x2370f8,0xc,_0x57b47d[_0xe818('0xf5')]);rpcDb[_0xe818('0xf7')](_0x2370f8,_0xe818('0xf9'));}ut[_0xe818('0x76')](_0x3dc9f4,_0xe818('0xfa'));logger[_0xe818('0x52')](_0xe818('0xfb'),_0x2370f8['uniqueid'],_0xe818('0xb1'),_0x3dc9f4['name'],'originated:\x20',_0x3dc9f4[_0xe818('0x47')]);delete this[_0xe818('0x69')][_0x2370f8['uniqueid']];};Preview[_0xe818('0xe')][_0xe818('0xfc')]=function(_0x27bb09,_0x489ebe,_0x5ea488,_0x5801c5,_0x57960f){var _0x1f302c=this;return new BPromise(function(_0x263d35,_0x27cb8a){if(_[_0xe818('0x81')](_0x489ebe)||_[_0xe818('0x81')](_0x489ebe[_0xe818('0xfd')])||_[_0xe818('0x81')](_0x489ebe[_0xe818('0xfd')]['phone'])||_['isNil'](_0x489ebe[_0xe818('0x70')])){_0x27cb8a(ut[_0xe818('0x46')]('Contact\x20is\x20undefined',_0x5801c5,_0x57960f));return;}var _0xb2baca=uuid['v4']();var _0x432f9e=_0x1f302c['campaignsPreview'][_0x489ebe[_0xe818('0x6b')][_0xe818('0x25')]];var _0x1e3ca9=_0x5ea488?_0x1f302c[_0xe818('0x16')][_0x5ea488]['id']:undefined;_0x1f302c[_0xe818('0x69')][_0xb2baca]=new Action(_0x489ebe,_0x432f9e,_0xb2baca,_0x5ea488,_0x1e3ca9);var _0x51877f=_0x1f302c[_0xe818('0x69')][_0xb2baca];_0x51877f[_0xe818('0xc7')]=_0x5801c5;_0x51877f[_0xe818('0xab')]=_0x57960f;_0x51877f[_0xe818('0xfe')]=_0x5ea488;if(_[_0xe818('0xff')](_0x27bb09)){_0x1f302c['execCall'](_0x51877f,_0x432f9e,_0x489ebe,_0x5ea488)[_0xe818('0x87')](function(_0x40ccd8){logger[_0xe818('0x52')](_0xe818('0x100'),_0xe818('0x101')+_0x51877f['queue']+_0xe818('0x102')+_0x51877f[_0xe818('0x103')],JSON['stringify'](_0x40ccd8));ami['emit'](_0xe818('0x104'),ut[_0xe818('0xa2')](_0x51877f,_0xe818('0x105'),_0x1f302c[_0xe818('0x13')][_0x51877f['queue']]));_0x263d35(ut[_0xe818('0x46')](_0xe818('0x106')));})[_0xe818('0x74')](function(_0x5445d7){ut[_0xe818('0x5b')](_0xe818('0x107'),_0x5445d7);_0x27cb8a(ut[_0xe818('0x46')]('Call\x20failed',_0x5801c5,_0x57960f));});}else{_0x432f9e[_0xe818('0x108')]+=0x1;ut['logBlacklist'](_0x51877f);rpcDb['createHistory'](_0x51877f,_0xe818('0x109'));delete _0x1f302c['actions'][_0xb2baca];_0x27cb8a(ut[_0xe818('0x46')]('Contact\x20in\x20black\x20List',_0x5801c5,_0x57960f));}});};Preview['prototype']['isTrunkReachable']=function(_0x1aa48e){return!_[_0xe818('0x81')](_0x1aa48e)&&!_[_0xe818('0x81')](_0x1aa48e[_0xe818('0x25')])&&!_[_0xe818('0x81')](_0x1aa48e[_0xe818('0x4e')])&&_0x1aa48e[_0xe818('0x4e')]&&!_[_0xe818('0x81')](this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e['name'])])&&!_[_0xe818('0x81')](this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e[_0xe818('0x25')])][_0xe818('0x72')])&&(this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e[_0xe818('0x25')])]['status']==='reachable'||this[_0xe818('0x15')][util[_0xe818('0x51')](_0xe818('0x10a'),_0x1aa48e[_0xe818('0x25')])][_0xe818('0x72')]===_0xe818('0x10b'));};Preview[_0xe818('0xe')][_0xe818('0x86')]=function(_0xf9e6c4,_0x10fbf5){var _0x4aa632=this;return new BPromise(function(_0xb5b85b,_0x50fe6a){_0x4aa632[_0xe818('0x10c')](_0xf9e6c4,_0x10fbf5)[_0xe818('0x87')](function(_0x3220fe){_0xb5b85b(_['pick'](_0x3220fe,[_0xe818('0x46')]));})['catch'](function(_0xd64c13){if(_0xd64c13[_0xe818('0x10d')]){rpcDb['unlockContact'](_0xf9e6c4);}if(_0xd64c13['active']){rpcDb[_0xe818('0x8a')](_0xf9e6c4);}_0x50fe6a(_['pick'](_0xd64c13,[_0xe818('0x46')]));});});};Preview[_0xe818('0xe')][_0xe818('0x10c')]=function(_0x17e80d,_0x21d970){var _0x48126b=this;return new BPromise(function(_0x28749b,_0x515f80){var _0x2db5d1,_0x27dec7;rpcDb[_0xe818('0x10e')](_0x17e80d)[_0xe818('0x87')](function(_0x12cc76){if(!_[_0xe818('0x81')](_0x12cc76[0x0])){_0x27dec7=_0x12cc76[0x0][_0xe818('0x10f')]?![]:!![];_0x2db5d1=_0x12cc76[0x0][_0xe818('0x10f')]?!![]:![];_0x2db5d1=_0x21d970?!![]:_0x2db5d1;}var _0x436961=_0x48126b[_0xe818('0x110')](_0x12cc76);if(_0x436961[_0xe818('0x111')]){rpcDb[_0xe818('0x112')](_[_0xe818('0x6e')](_0x12cc76[0x0],[_0xe818('0x70'),'Contact.phone']))[_0xe818('0x87')](function(_0x3d0753){_0x48126b[_0xe818('0xfc')](_0x3d0753,_0x12cc76[0x0],_0x21d970,_0x27dec7,_0x2db5d1)[_0xe818('0x87')](function(_0x186caf){_0x28749b(_0x186caf);})[_0xe818('0x74')](function(_0x11d851){_0x515f80(_0x11d851);});})[_0xe818('0x74')](function(_0x1b0bbc){ut[_0xe818('0x5b')](_0xe818('0x113'),_0x1b0bbc);_0x515f80(ut[_0xe818('0x46')]('Call\x20unsuccessful',_0x27dec7,_0x2db5d1));});}else{_0x515f80(ut[_0xe818('0x46')](_0x436961[_0xe818('0x46')],_0x27dec7,_0x2db5d1));}})[_0xe818('0x74')](function(_0x388fdc){ut['logger'](_0xe818('0x114'),_0x388fdc);_0x515f80(ut[_0xe818('0x46')](_0xe818('0x115'),![],!![]));});});};Preview['prototype'][_0xe818('0x110')]=function(_0x2d9b7f){if(_['isNil'](_0x2d9b7f)||_[_0xe818('0xff')](_0x2d9b7f)||!_[_0xe818('0x81')](_0x2d9b7f[0x0][_0xe818('0x84')])&&_[_0xe818('0x81')](_0x2d9b7f[0x0][_0xe818('0x84')][_0xe818('0x25')])){ut['logger'](_0xe818('0x116'),_0x2d9b7f);return{'isValid':![],'message':_0xe818('0x117')};}var _0x3374e4=this[_0xe818('0x13')][_0x2d9b7f[0x0]['Queue']['name']];_0x3374e4['message']=_0xe818('0x9c');if(_[_0xe818('0x81')](_0x3374e4)){ut[_0xe818('0x5b')](_0xe818('0x118'),_0x3374e4);return{'isValid':![],'message':_0xe818('0x119')};}if(!this['isTrunkReachable'](_0x3374e4[_0xe818('0x4d')])){ut[_0xe818('0x5b')](_0xe818('0x11a'),_0xe818('0x11b')+_0x3374e4[_0xe818('0x25')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xe818('0x99')](_0x3374e4[_0xe818('0x9a')])){ut['logger'](_0xe818('0x11a'),_0x3374e4['name']+_0xe818('0x11c'));return{'isValid':![],'message':_0xe818('0x11d')};}}if(!ut[_0xe818('0x98')](_0x3374e4[_0xe818('0x66')])){ut[_0xe818('0x5b')](_0xe818('0x11e'),_0x3374e4['name']+_0xe818('0x11f'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3374e4[_0xe818('0x25')]+_0xe818('0x11f')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0x4ff31e,_0x398b8a,_0x1666f3,_0x2ba955){var _0x3cb1db=this;return new BPromise(function(_0x3cc12a,_0x7a7374){var _0x5b43c6=_0x4ff31e[_0xe818('0xb0')];var _0x35641e=_0x3cb1db['isTrunkReachable'](_0x398b8a[_0xe818('0x4d')])?util[_0xe818('0x51')](_0xe818('0x120'),_0x398b8a['Trunk']['name'],_[_0xe818('0x81')](_0x398b8a['dialPrefix'])?'':_0x398b8a[_0xe818('0x32')]['trim']()||'',_0x398b8a[_0xe818('0x121')]>0x0?_0x1666f3['Contact'][_0xe818('0x122')]['substring'](_0x398b8a[_0xe818('0x121')]):_0x1666f3[_0xe818('0xfd')]['phone']):util[_0xe818('0x51')](_0xe818('0x120'),_[_0xe818('0x81')](_0x398b8a['TrunkBackup'])?_0x398b8a[_0xe818('0x4d')][_0xe818('0x25')]:_0x398b8a[_0xe818('0x9a')][_0xe818('0x25')],_['isNil'](_0x398b8a[_0xe818('0x32')])?'':_0x398b8a[_0xe818('0x32')][_0xe818('0x123')]()||'',_0x398b8a[_0xe818('0x121')]>0x0?_0x1666f3[_0xe818('0xfd')][_0xe818('0x122')][_0xe818('0x124')](_0x398b8a[_0xe818('0x121')]):_0x1666f3[_0xe818('0xfd')]['phone']);var _0x5def9d=_0x3cb1db[_0xe818('0x99')](_0x398b8a['Trunk'])?ut[_0xe818('0x125')](_0x398b8a['Trunk'][_0xe818('0x4f')],_0x398b8a['dialOriginateCallerIdName'],_0x398b8a[_0xe818('0x126')]>0x0?ut[_0xe818('0x127')](_0x398b8a[_0xe818('0x128')],_0x398b8a[_0xe818('0x126')]):_0x398b8a['dialOriginateCallerIdNumber']):ut[_0xe818('0x125')](_[_0xe818('0x81')](_0x398b8a[_0xe818('0x9a')])?_0x398b8a[_0xe818('0x4d')][_0xe818('0x4f')]:_0x398b8a[_0xe818('0x9a')][_0xe818('0x4f')],_0x398b8a[_0xe818('0x30')],_0x398b8a[_0xe818('0x126')]>0x0?ut[_0xe818('0x127')](_0x398b8a['dialOriginateCallerIdNumber'],_0x398b8a[_0xe818('0x126')]):_0x398b8a[_0xe818('0x128')]);if(_0x5def9d){_0x4ff31e[_0xe818('0x129')]=ut['extractCalleridName'](_0x5def9d);_0x4ff31e[_0xe818('0x12a')]=ut[_0xe818('0x12b')](_0x5def9d);}var _0x263cb9=ut[_0xe818('0x12c')](_0x398b8a,_0x1666f3,_0x35641e,_0x5def9d,_0x5b43c6,_0x4ff31e);_[_0xe818('0x12d')](_0x4ff31e,ut[_0xe818('0x12e')](_0x263cb9));_0x4ff31e['starttime']=moment()[_0xe818('0x51')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0xe818('0x12f')](_0x4ff31e,_0x398b8a,_0x263cb9,_0x4ff31e[_0xe818('0xab')],_0x2ba955))[_0xe818('0x87')](function(_0x4d68c9){var _0x576444=_0x4ff31e['channelAgent'];if(!_[_0xe818('0x81')](_0x576444)){if(!_[_0xe818('0x81')](_0x3cb1db[_0xe818('0x16')][_0x576444])){_0x3cb1db[_0xe818('0x16')][_0x576444]['destconnectedlinenum']=_0x4ff31e['calleridnum'];emit(util[_0xe818('0x51')](_0xe818('0x130'),_0x3cb1db[_0xe818('0x16')][_0x576444]['name']),'user:agentconnect',{'destaccountcode':_0x3cb1db[_0xe818('0x16')][_0x576444][_0xe818('0x131')],'destconnectedlinenum':_0x4ff31e[_0xe818('0x132')]});}}_0x398b8a[_0xe818('0x47')]+=0x1;logger[_0xe818('0x52')](_0xe818('0x133'),_0x5b43c6,'\x20Queue',_0x398b8a[_0xe818('0x25')],_0xe818('0xf2'),_0x398b8a[_0xe818('0x47')]);_0x3cc12a(_0x4d68c9);})[_0xe818('0x74')](function(_0x1d4c82){ut['logAgent'](_0x4ff31e,0xe,'OriginateError');rpcDb[_0xe818('0xf7')](_0x4ff31e,'[originateFailure][logOriginateFailure]');_0x7a7374(_0x1d4c82);});});};Preview[_0xe818('0xe')]['syncNewExten']=function(_0x5ce4ff){if(this[_0xe818('0x69')][_0x5ce4ff[_0xe818('0xbd')]]){this[_0xe818('0x69')][_0x5ce4ff['linkedid']][_0xe818('0x73')]=_0x5ce4ff[_0xe818('0x73')];}};Preview[_0xe818('0xe')][_0xe818('0x19')]=function(_0x15c24b){var _0x15cc06=this;var _0x33a368=this[_0xe818('0x69')][_0x15c24b[_0xe818('0x134')]];if(_0x33a368){if(_0x33a368[_0xe818('0xfe')]&&this[_0xe818('0x16')][_0x33a368[_0xe818('0xfe')]]){ut[_0xe818('0x135')](_0x33a368,this[_0xe818('0x16')][_0x33a368['lookAgent']][_0xe818('0x25')],this[_0xe818('0x16')][_0x33a368['lookAgent']]['id']);}var _0x2e9a3c=_[_0xe818('0x136')](_0x33a368);_0x2e9a3c['responsetime']=moment()[_0xe818('0x51')](_0xe818('0x8b'));var _0x3a67f0=_0x15cc06[_0xe818('0x13')][_0x33a368[_0xe818('0x6c')]];if(ut[_0xe818('0x137')](_0x15c24b['response'])){if(_0x33a368[_0xe818('0xc7')]){rpcDb[_0xe818('0x138')](_0x33a368['idContact']);}if(_0x33a368['activeContact']){rpcDb['disableContact'](_0x33a368[_0xe818('0x103')]);}ami[_0xe818('0x23')]('custom:agentringnoanswer',ut['buildObj'](_0x33a368,'rejected',this[_0xe818('0x13')][_0x33a368['queue']]));this[_0xe818('0x139')](_0x2e9a3c,_0x3a67f0,_0x15c24b);}else{_0x33a368[_0xe818('0x13a')]=moment()[_0xe818('0x51')](_0xe818('0x8b'));ut['logAgent'](_0x2e9a3c,0x4,_0xe818('0xb7'));rpcDb[_0xe818('0xf7')](_0x2e9a3c,_0xe818('0x13b'));}}};Preview['prototype'][_0xe818('0x13c')]=function(_0x2854a3){var _0x233cf2=this;var _0x2efba2=this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]];var _0x15a5b7;if(_0x2efba2){_0x15a5b7=this[_0xe818('0x13')][_0x2efba2[_0xe818('0x6c')]];logger['info'](_0xe818('0x13d'),_0x2854a3['linkedid'],_0xe818('0xb1'),_0x15a5b7[_0xe818('0x25')],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);}if(this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]]&&_0x2854a3[_0xe818('0xbd')]!==_0x2854a3[_0xe818('0xb0')]){if(_0x2854a3[_0xe818('0x13e')]==='16'&&this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){this[_0xe818('0x9d')](_0x2854a3,_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')]);}else if(this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){logger[_0xe818('0x52')](_0xe818('0x13f'),_0x2854a3['linkedid'],_0x2854a3[_0xe818('0x13e')],_0xe818('0xb1'),_0x15a5b7[_0xe818('0x25')],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);this[_0xe818('0x9d')](_0x2854a3,_0x2854a3['linkedid'],_0x2854a3['cause']);}}else if(_0x2efba2&&_[_0xe818('0x81')](_0x2efba2[_0xe818('0x140')])&&_0x15a5b7[_0xe818('0x141')]&&_0x2854a3[_0xe818('0xbd')]===_0x2854a3[_0xe818('0xb0')]&&_[_0xe818('0x81')](_0x2854a3[_0xe818('0xf5')])&&_0x2854a3[_0xe818('0x13e')]==='16'&&_0x2854a3['channelstate']==='6'&&_[_0xe818('0xf4')](_0x2efba2[_0xe818('0x142')])){if(_0x2efba2[_0xe818('0xc7')]){rpcDb['unlockContact'](_0x2efba2[_0xe818('0x103')]);}if(_0x2efba2[_0xe818('0xab')]){rpcDb['disableContact'](_0x2efba2[_0xe818('0x103')]);}_0x2854a3[_0xe818('0xf5')]='22';this[_0xe818('0x139')](_0x2efba2,_0x15a5b7,_0x2854a3);}else if(_0x2efba2&&_0x2efba2[_0xe818('0x142')]){if(_0x2854a3[_0xe818('0x13e')]==='16'&&this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){logger[_0xe818('0x52')](_0xe818('0x143'),_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')],_0xe818('0xb1'),_0x15a5b7[_0xe818('0x25')],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);this['callProgressDetectingCustomer'](_0x2854a3,_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')]);}else if(this[_0xe818('0x69')][_0x2854a3[_0xe818('0xbd')]][_0xe818('0x78')]){logger[_0xe818('0x52')](_0xe818('0x13f'),_0x2854a3[_0xe818('0xbd')],_0x2854a3[_0xe818('0x13e')],_0xe818('0xb1'),_0x15a5b7['name'],_0xe818('0x6d'),_0x15a5b7[_0xe818('0x58')]);this[_0xe818('0x9d')](_0x2854a3,_0x2854a3['linkedid'],_0x2854a3[_0xe818('0x13e')]);}}};Preview[_0xe818('0xe')][_0xe818('0x144')]=function(_0xdad8d4){if(this['actions'][_0xdad8d4[_0xe818('0x145')]]&&_0xdad8d4[_0xe818('0x145')]!==_0xdad8d4[_0xe818('0x146')]){this[_0xe818('0x9d')](_0xdad8d4,_0xdad8d4['destlinkedid'],_0xdad8d4[_0xe818('0xe7')]);}};Preview[_0xe818('0xe')]['syncHangupRequest']=function(_0x55d9ac){if(this['actions'][_0x55d9ac[_0xe818('0xbd')]]&&_0x55d9ac[_0xe818('0xbd')]!==_0x55d9ac[_0xe818('0xb0')]&&!this[_0xe818('0x69')][_0x55d9ac[_0xe818('0xbd')]][_0xe818('0x78')]){if(_0x55d9ac['cause']==='1'){this[_0xe818('0x9d')](_0x55d9ac,_0x55d9ac[_0xe818('0xbd')],_0x55d9ac[_0xe818('0x13e')]);}}};Preview['prototype'][_0xe818('0x147')]=function(_0x171c5d,_0xf855ea,_0x49f619){if(this[_0xe818('0x69')][_0x171c5d]){if(_[_0xe818('0x81')](this[_0xe818('0x69')][_0x171c5d][_0xe818('0x148')])){this[_0xe818('0x69')][_0x171c5d]['variables']={};}this[_0xe818('0x69')][_0x171c5d][_0xe818('0x148')][_0xf855ea]=_0x49f619;}};Preview['prototype']['syncVarSet']=function(_0x4849ac){try{if(!_[_0xe818('0x81')](_0x4849ac)){if(ut[_0xe818('0x149')](_[_0xe818('0x14a')](_0x4849ac[_0xe818('0x14b')])[0x0])){this[_0xe818('0x147')](_0x4849ac[_0xe818('0xb0')],_[_0xe818('0x14a')](_0x4849ac[_0xe818('0x14b')])[0x0],_0x4849ac[_0xe818('0x14c')]);}}}catch(_0x232aee){logger[_0xe818('0x14d')](_0xe818('0x14e'),util[_0xe818('0x14f')](_0x232aee,{'showHidden':![],'depth':null}));}};Preview[_0xe818('0xe')][_0xe818('0x20')]=function(_0x53028f){if(_0x53028f){if(this[_0xe818('0x69')][_0x53028f[_0xe818('0x150')]]){this[_0xe818('0x69')][_0x53028f['transfertargetlinkedid']][_0xe818('0x142')]=!![];}}};Preview[_0xe818('0xe')][_0xe818('0x22')]=function(_0x42eb5b){if(_0x42eb5b){if(this[_0xe818('0x69')][_0x42eb5b[_0xe818('0x151')]]){this[_0xe818('0x69')][_0x42eb5b[_0xe818('0x151')]][_0xe818('0x142')]=!![];}}};module[_0xe818('0x152')]=Preview; \ No newline at end of file +var _0xbaf8=['buildAcw','custom:agentcomplete','complete','[16]','totalGlobal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','uniqueid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','activeContact','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','trunks','status','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','variables','syncVarSet','filterKey','keys','addVariable','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','uuid','moment','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','redis','localhost','socket.io-emitter','finally','sequence','campaignsPreview','voiceQueues','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','loopCampaigns','emit','type','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','waiting','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','preview','dialMethod','booked','outbound','clockClearZombieChannels','clearZombieChannels','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','isNil','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','acw','custom:agentConnectPreview'];(function(_0x12261a,_0x5d2f10){var _0x30aad1=function(_0x390ffb){while(--_0x390ffb){_0x12261a['push'](_0x12261a['shift']());}};_0x30aad1(++_0x5d2f10);}(_0xbaf8,0xac));var _0x8baf=function(_0x8b3778,_0x4453db){_0x8b3778=_0x8b3778-0x0;var _0x53bdc8=_0xbaf8[_0x8b3778];return _0x53bdc8;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x8baf('0x0'));var moment=require(_0x8baf('0x1'));var md5=require('md5');var Redis=require(_0x8baf('0x2'));var config=require(_0x8baf('0x3'));var logger=require(_0x8baf('0x4'))('preview');var loggerAction=require('../../../config/logger')(_0x8baf('0x5'));var ami=require(_0x8baf('0x6'));var rpcDb=require(_0x8baf('0x7'));var Action=require(_0x8baf('0x8'));var ut=require('./util/util');config['redis']=_['defaults'](config[_0x8baf('0x9')],{'host':_0x8baf('0xa'),'port':0x18eb});var io=require(_0x8baf('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x486b58){this['tail']=this['tail']?this['tail'][_0x8baf('0xc')](_0x486b58):_0x486b58();};function Preview(_0x736947){this[_0x8baf('0xd')]=new Sequence();this[_0x8baf('0xe')]=_0x736947[_0x8baf('0xf')];this['trunks']=_0x736947['trunks'];this[_0x8baf('0x10')]={};this[_0x8baf('0x11')]=_0x736947['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x8baf('0x12'),this[_0x8baf('0x13')][_0x8baf('0x14')](this));ami['on'](_0x8baf('0x15'),this[_0x8baf('0x16')][_0x8baf('0x14')](this));ami['on'](_0x8baf('0x17'),this[_0x8baf('0x18')]['bind'](this));ami['on']('dialend',this['syncDialEnd']['bind'](this));ami['on'](_0x8baf('0x19'),this[_0x8baf('0x1a')]['bind'](this));ami['on'](_0x8baf('0x1b'),this['syncVarSet'][_0x8baf('0x14')](this));ami['on'](_0x8baf('0x1c'),this['syncAttendedTransfer'][_0x8baf('0x14')](this));ami['on'](_0x8baf('0x1d'),this['syncBlindTransfer'][_0x8baf('0x14')](this));this[_0x8baf('0x1e')](this[_0x8baf('0xe')]);}function emit(_0x18bba3,_0x2d35f1,_0x878d5b){io['to'](_0x18bba3)[_0x8baf('0x1f')](_0x2d35f1,_0x878d5b);}function emitCampaignPreview(_0x54b3a1){if(_0x54b3a1[_0x8baf('0x20')]==='outbound'){var _0x3761cb={'id':_0x54b3a1['id'],'name':_0x54b3a1[_0x8baf('0x21')],'strategy':_0x54b3a1[_0x8baf('0x22')],'answered':_0x54b3a1[_0x8baf('0x23')],'available':_0x54b3a1[_0x8baf('0x24')],'loggedIn':_0x54b3a1[_0x8baf('0x25')],'pTalking':_0x54b3a1[_0x8baf('0x26')],'sumBillable':_0x54b3a1[_0x8baf('0x27')],'sumDuration':_0x54b3a1['sumDuration'],'sumHoldTime':_0x54b3a1[_0x8baf('0x28')]||0x0,'talking':_0x54b3a1[_0x8baf('0x29')],'total':_0x54b3a1['total'],'type':_0x54b3a1[_0x8baf('0x20')],'unmanaged':_0x54b3a1[_0x8baf('0x2a')],'abandoned':_0x54b3a1[_0x8baf('0x2b')],'waiting':_0x54b3a1[_0x8baf('0x2c')],'loggedInDb':_0x54b3a1['loggedInDb'],'dialActive':_0x54b3a1['dialActive'],'dialMethod':_0x54b3a1['dialMethod'],'dialOriginateCallerIdName':_0x54b3a1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x54b3a1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x54b3a1[_0x8baf('0x2d')],'dialPrefix':_0x54b3a1[_0x8baf('0x2e')],'outboundAnswerAgiCallsDay':_0x54b3a1['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x54b3a1[_0x8baf('0x2f')],'outboundBlacklistCallsDay':_0x54b3a1[_0x8baf('0x30')],'outboundBusyCallsDay':_0x54b3a1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x54b3a1['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x54b3a1[_0x8baf('0x31')],'outboundDropCallsDayCallersExit':_0x54b3a1[_0x8baf('0x32')],'outboundDropCallsDayTimeout':_0x54b3a1[_0x8baf('0x33')],'outboundNoAnswerCallsDay':_0x54b3a1[_0x8baf('0x34')],'outboundNoSuchCallsDay':_0x54b3a1[_0x8baf('0x35')],'outboundOriginateFailureCallsDay':_0x54b3a1[_0x8baf('0x36')],'outboundReCallsDay':_0x54b3a1[_0x8baf('0x37')],'outboundRejectCallsDay':_0x54b3a1[_0x8baf('0x38')],'outboundUnknownCallsDay':_0x54b3a1[_0x8baf('0x39')],'outboundAbandonedCallsDay':_0x54b3a1[_0x8baf('0x3a')],'predictiveIntervalAnsweredCalls':_0x54b3a1[_0x8baf('0x3b')],'predictiveIntervalAvgHoldtime':_0x54b3a1[_0x8baf('0x3c')],'predictiveIntervalAvgTalktime':_0x54b3a1['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x54b3a1[_0x8baf('0x3d')],'predictiveIntervalDroppedCallsTimeout':_0x54b3a1[_0x8baf('0x3e')],'predictiveIntervalErlangCalls':_0x54b3a1[_0x8baf('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x54b3a1['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x54b3a1[_0x8baf('0x40')],'predictiveIntervalMultiplicativeFactor':_0x54b3a1[_0x8baf('0x41')],'predictiveIntervalPauses':_0x54b3a1['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x54b3a1[_0x8baf('0x42')],'predictiveIntervalTotalCalls':_0x54b3a1['predictiveIntervalTotalCalls'],'message':_0x54b3a1[_0x8baf('0x43')],'originated':_0x54b3a1[_0x8baf('0x44')],'erlangCalls':_0x54b3a1[_0x8baf('0x45')],'erlangCallToSecond':_0x54b3a1[_0x8baf('0x46')],'erlangAbandonmentRate':_0x54b3a1[_0x8baf('0x47')],'erlangBusyFactor':_0x54b3a1[_0x8baf('0x48')],'startPredictive':_0x54b3a1['startPredictive'],'startProgressive':_0x54b3a1[_0x8baf('0x49')]};if(_0x54b3a1[_0x8baf('0x4a')]){_0x3761cb[_0x8baf('0x4a')]={'id':_0x54b3a1[_0x8baf('0x4a')]['id'],'name':_0x54b3a1[_0x8baf('0x4a')][_0x8baf('0x21')],'active':_0x54b3a1[_0x8baf('0x4a')][_0x8baf('0x4b')],'callerid':_0x54b3a1[_0x8baf('0x4a')][_0x8baf('0x4c')]};}if(_0x54b3a1[_0x8baf('0x4d')]){_0x3761cb[_0x8baf('0x4d')]={'id':_0x54b3a1['Interval']['id'],'name':_0x54b3a1['Interval']['name']};}var _0xa2d4a8=md5(JSON[_0x8baf('0x4e')](_0x3761cb));if(_0x54b3a1['md5']!==_0xa2d4a8){_0x54b3a1['md5']=_0xa2d4a8;emit(util[_0x8baf('0x4f')](_0x8baf('0x50'),_0x3761cb['name']),_0x8baf('0x51'),_0x3761cb);}}}function emitVoiceQueueChannelRemove(_0x4b6fbf){logger[_0x8baf('0x52')](_0x8baf('0x53'),JSON['stringify'](_0x4b6fbf));emit(util[_0x8baf('0x4f')]('voice:queue:%s',_0x4b6fbf['name']),_0x8baf('0x54'),_0x4b6fbf);io[_0x8baf('0x1f')](_0x8baf('0x55'),_0x4b6fbf);}function notSendMessagesQueue(_0x244328){if(_0x244328[_0x8baf('0x56')]){if(_0x244328[_0x8baf('0x44')]===0x0&&_0x244328[_0x8baf('0x26')]===0x0){_0x244328[_0x8baf('0x56')]=![];_0x244328[_0x8baf('0x24')]=0x0;_0x244328['paused']=0x0;_0x244328[_0x8baf('0x43')]='NOT_ACTIVE';ut[_0x8baf('0x57')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x244328[_0x8baf('0x21')]+'\x20is\x20not\x20active');}else{_0x244328[_0x8baf('0x43')]=_0x8baf('0x58');ut[_0x8baf('0x57')](_0x8baf('0x59'),_0x244328[_0x8baf('0x21')]+_0x8baf('0x5a'));}emitCampaignPreview(_0x244328);}}Preview['prototype']['loopCampaigns']=function(){var _0x456303=this;setInterval(function(){_0x456303['syncCampaigns']();},0x7cf);};Preview[_0x8baf('0x5b')][_0x8baf('0x5c')]=function(){var _0x49cc40=this[_0x8baf('0xe')];this['clockClearZombieChannels']+=0x1;for(var _0x24ff55 in _0x49cc40){if(_0x49cc40[_0x8baf('0x5d')](_0x24ff55)&&(_0x49cc40[_0x24ff55]['dialMethod']===_0x8baf('0x5e')||_0x49cc40[_0x24ff55][_0x8baf('0x5f')]===_0x8baf('0x60'))&&_0x49cc40[_0x24ff55]['type']===_0x8baf('0x61')){if(this[_0x8baf('0x62')]>0x7){this[_0x8baf('0x62')]=0x0;this[_0x8baf('0x63')]();}}if(_0x49cc40[_0x8baf('0x5d')](_0x24ff55)&&_0x49cc40[_0x24ff55][_0x8baf('0x5f')]===_0x8baf('0x5e')&&_0x49cc40[_0x24ff55]['type']===_0x8baf('0x61')){if(_0x49cc40[_0x24ff55][_0x8baf('0x64')]){this[_0x8baf('0x65')](_0x49cc40[_0x24ff55]);this[_0x8baf('0x66')](_0x49cc40[_0x24ff55]);}else{notSendMessagesQueue(_0x49cc40[_0x24ff55]);}}}};Preview[_0x8baf('0x5b')][_0x8baf('0x67')]=function(_0x3823d5){var _0x2ff615=this;this[_0x8baf('0xd')][_0x8baf('0x68')](function(){if(!_[_0x8baf('0x69')](_0x2ff615[_0x8baf('0x10')][_0x3823d5])){loggerAction['info']('[clearZombieChannels][talking]',_0x3823d5,_0x8baf('0x6a'),_0x2ff615[_0x8baf('0x10')][_0x3823d5]['queue'],_0x8baf('0x6b'),JSON['stringify'](_0x2ff615[_0x8baf('0xe')][_0x2ff615[_0x8baf('0x10')][_0x3823d5][_0x8baf('0x6c')]][_0x8baf('0x44')]),_0x8baf('0x6d'),JSON[_0x8baf('0x4e')](_0x2ff615['campaignsPreview'][_0x2ff615[_0x8baf('0x10')][_0x3823d5][_0x8baf('0x6c')]][_0x8baf('0x26')]),JSON[_0x8baf('0x4e')](_0x2ff615['actions'][_0x3823d5][_0x8baf('0x6e')]),JSON[_0x8baf('0x4e')](_[_0x8baf('0x6f')](_0x2ff615['actions'][_0x3823d5],[_0x8baf('0x70'),_0x8baf('0x71'),'VoiceQueueId',_0x8baf('0x72')])));return ami[_0x8baf('0x73')]({'action':'status','channel':_0x2ff615[_0x8baf('0x10')][_0x3823d5][_0x8baf('0x74')]})[_0x8baf('0x75')](function(_0x5a6a8b){if(_0x5a6a8b[_0x8baf('0x43')]===_0x8baf('0x76')){setTimeout(function(){if(_0x2ff615[_0x8baf('0x10')][_0x3823d5]){ut[_0x8baf('0x77')](_0x2ff615[_0x8baf('0xe')][_0x2ff615[_0x8baf('0x10')][_0x3823d5]['queue']],_0x8baf('0x78'));if(_0x2ff615['actions'][_0x3823d5][_0x8baf('0x6e')]===!![]){ut[_0x8baf('0x79')](_0x2ff615[_0x8baf('0xe')][_0x2ff615[_0x8baf('0x10')][_0x3823d5][_0x8baf('0x6c')]],'[clearZombieChannel]');ut[_0x8baf('0x7a')](_0x8baf('0x7b')+_0x3823d5,_0x2ff615[_0x8baf('0x10')][_0x3823d5][_0x8baf('0x6c')]);}ut['loggerError'](_0x8baf('0x7c')+_0x3823d5,_0x2ff615[_0x8baf('0x10')][_0x3823d5]['queue']);delete _0x2ff615[_0x8baf('0x10')][_0x3823d5];}},0x2328);}});}});};Preview['prototype'][_0x8baf('0x63')]=function(){var _0x15bdcc=this;loggerAction['info'](_0x8baf('0x7d'),_['size'](this[_0x8baf('0x10')]));for(var _0x2c8a8a in this['actions']){if(_0x15bdcc[_0x8baf('0x10')][_0x8baf('0x5d')](_0x2c8a8a)){_0x15bdcc['clearZombieChannel'](_0x2c8a8a);}}};Preview[_0x8baf('0x5b')][_0x8baf('0x66')]=function(_0x4b63c7){var _0x3d5fc3=this;rpcDb[_0x8baf('0x7e')](_0x4b63c7['id'],ut[_0x8baf('0x7f')](this[_0x8baf('0x11')]))['then'](function(_0x52939d){if(!_[_0x8baf('0x69')](_0x52939d)){for(var _0x4dd1d9=0x0;_0x4dd1d9<_0x52939d[_0x8baf('0x80')];_0x4dd1d9+=0x1){if(ut['getDiff'](_0x52939d[_0x4dd1d9][_0x8baf('0x81')])<_0x4b63c7[_0x8baf('0x82')]*0x3c){if(_0x52939d[_0x4dd1d9]['Agent']&&!_0x52939d[_0x4dd1d9][_0x8baf('0x83')]['voicePause']){_0x3d5fc3[_0x8baf('0x84')](_0x52939d[_0x4dd1d9]['id'])[_0x8baf('0x85')](ut['logger2']('[RecallMe]'))[_0x8baf('0x75')](ut[_0x8baf('0x86')]('[RecallMe]'));}else{rpcDb[_0x8baf('0x87')](_0x52939d[_0x4dd1d9]['id']);}}else{var _0x28f675=new Action(_0x52939d[_0x4dd1d9],_0x4b63c7);_0x28f675[_0x8baf('0x88')]=moment()['format'](_0x8baf('0x89'));_0x4b63c7[_0x8baf('0x37')]+=0x1;ut[_0x8baf('0x8a')](_0x28f675,0x17,'RecallInQueue');if(_0x4b63c7[_0x8baf('0x8b')]){rpcDb[_0x8baf('0x8c')](ut[_0x8baf('0x8d')](_0x52939d[_0x4dd1d9]));rpcDb[_0x8baf('0x8e')](_0x28f675,_0x8baf('0x8f'));}else{ut[_0x8baf('0x8a')](_0x28f675,0x16,_0x8baf('0x90'));rpcDb[_0x8baf('0x8e')](_0x28f675,_0x8baf('0x91'));rpcDb[_0x8baf('0x92')](_0x28f675,_0x8baf('0x91'));}}}}})[_0x8baf('0x75')](ut[_0x8baf('0x86')]('[getContactRecallMe]'));};Preview[_0x8baf('0x5b')][_0x8baf('0x65')]=function(_0x209157){_0x209157[_0x8baf('0x56')]=!![];if(ut[_0x8baf('0x93')](_0x209157[_0x8baf('0x25')])){_0x209157[_0x8baf('0x43')]=_0x8baf('0x94');}else if(!ut[_0x8baf('0x95')](_0x209157[_0x8baf('0x64')])){_0x209157[_0x8baf('0x43')]='NOT_ACTIVE';}else if(!this[_0x8baf('0x96')](_0x209157[_0x8baf('0x4a')])){if(!this[_0x8baf('0x96')](_0x209157['TrunkBackup'])){_0x209157['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x209157[_0x8baf('0x43')]=_0x8baf('0x97');}}else{_0x209157['message']='ACTIVE';}emitCampaignPreview(_0x209157);};Preview['prototype'][_0x8baf('0x98')]=function(_0x4487bc,_0x1ab031,_0x10f6ad){var _0xdf0497=this;var _0x5ad8ce=this['actions'][_0x1ab031];var _0x2200e7=this[_0x8baf('0xe')][_0x5ad8ce[_0x8baf('0x6c')]];var _0x156329;if(_0x2200e7){switch(_0x10f6ad){case'1':_0x2200e7[_0x8baf('0x35')]+=0x1;_0x5ad8ce[_0x8baf('0x99')]+=0x1;_0x5ad8ce[_0x8baf('0x9a')]=ut['totalGlobal'](_0x5ad8ce);ut['logCustomer'](_0x5ad8ce,0x0,_0x8baf('0x9b'));ami['emit']('custom:agentnosuchnumber',ut[_0x8baf('0x9c')](_0x5ad8ce,'nosuchnumber'));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,_0x8baf('0x9d'));if(ut['totalGlobal'](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0xf,'Global');rpcDb['createCustomerFinal'](_0x156329,_0x8baf('0xa0'));}else{if(_0x5ad8ce['countnosuchnumberretry']>=_0x2200e7[_0x8baf('0xa1')]){rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xa0'));}else{rpcDb[_0x8baf('0xa2')](ut[_0x8baf('0xa3')](_0x5ad8ce,_0x8baf('0x99'),_0x2200e7[_0x8baf('0xa4')]),_0x5ad8ce[_0x8baf('0xa5')],_0x5ad8ce['activeContact']);}}delete this[_0x8baf('0x10')][_0x4487bc[_0x8baf('0xa6')]];break;case _0x8baf('0xa7'):var _0x5b7fcd=moment()[_0x8baf('0x4f')](_0x8baf('0x89'));_0x5ad8ce[_0x8baf('0xa8')]=_0x5b7fcd;_0x5ad8ce[_0x8baf('0xa9')]=_0x5b7fcd;_0x5ad8ce['dialAnswer']=!![];_0x2200e7['pTalking']+=0x1;logger[_0x8baf('0x52')](_0x8baf('0xaa'),_0x5ad8ce['uniqueid'],_0x8baf('0xab'),_0x2200e7[_0x8baf('0x21')],_0x8baf('0x6d'),_0x2200e7['pTalking']);ami['emit']('custom:agentconnect',ut[_0x8baf('0x9c')](_0x5ad8ce,'connect',this['campaignsPreview'][_0x5ad8ce[_0x8baf('0x6c')]]));if(_0x2200e7[_0x8baf('0xac')]){ami[_0x8baf('0x1f')](_0x8baf('0xad'),ut[_0x8baf('0xae')](_0x5ad8ce));}break;case'16':ami[_0x8baf('0x1f')](_0x8baf('0xaf'),ut[_0x8baf('0x9c')](_0x5ad8ce,'complete',this[_0x8baf('0xe')][_0x5ad8ce['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5ad8ce,_0x8baf('0xb0')));_0x2200e7[_0x8baf('0x2f')]+=0x1;_0x2200e7['total']+=0x1;_0x2200e7['answered']+=0x1;ut[_0x8baf('0x79')](_0x2200e7,_0x8baf('0xb1'));_0x5ad8ce['countglobal']=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0x4,'Answer');rpcDb[_0x8baf('0x8e')](_0x5ad8ce,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xb3'));rpcDb[_0x8baf('0xb4')](_0x5ad8ce);_0x2200e7[_0x8baf('0xb5')]+=_0x5ad8ce['talktime'];_0x2200e7[_0x8baf('0x27')]+=_0x5ad8ce[_0x8baf('0xb6')];logger['info']('[syncHangup][talking][decrement]',_0x5ad8ce[_0x8baf('0xb7')],_0x8baf('0xab'),_0x2200e7[_0x8baf('0x21')],_0x8baf('0x6d'),_0x2200e7[_0x8baf('0x26')]);delete this[_0x8baf('0x10')][_0x4487bc[_0x8baf('0xa6')]];break;case _0x8baf('0xb8'):_0x2200e7[_0x8baf('0xb9')]+=0x1;_0x5ad8ce[_0x8baf('0xba')]+=0x1;_0x5ad8ce['countglobal']=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0x5,_0x8baf('0xbb'));ami[_0x8baf('0x1f')]('custom:agentbusy',ut[_0x8baf('0x9c')](_0x5ad8ce,_0x8baf('0xbc')));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,_0x8baf('0xbd'));if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7['dialGlobalMaxRetry']){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0xf,_0x8baf('0xbe'));rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xbf'));}else{if(_0x5ad8ce['countbusyretry']>=_0x2200e7['dialBusyMaxRetry']){rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xbd'));}else{rpcDb[_0x8baf('0xa2')](ut[_0x8baf('0xa3')](_0x5ad8ce,_0x8baf('0xba'),_0x2200e7[_0x8baf('0xc0')]),_0x5ad8ce[_0x8baf('0xa5')],_0x5ad8ce[_0x8baf('0xc1')]);}}break;case'NOANSWER':_0x2200e7['outboundNoAnswerCallsDay']+=0x1;_0x5ad8ce[_0x8baf('0xc2')]+=0x1;_0x5ad8ce[_0x8baf('0x9a')]=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0x3,_0x8baf('0xc3'));ami['emit'](_0x8baf('0xc4'),ut[_0x8baf('0x9c')](_0x5ad8ce,_0x8baf('0xc5')));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7['dialGlobalMaxRetry']){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0xf,'Global');rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xc6'));}else{if(_0x5ad8ce[_0x8baf('0xc2')]>=_0x2200e7[_0x8baf('0xc7')]){rpcDb['createCustomerFinal'](_0x5ad8ce,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x8baf('0xa2')](ut[_0x8baf('0xa3')](_0x5ad8ce,_0x8baf('0xc2'),_0x2200e7[_0x8baf('0xc8')]),_0x5ad8ce[_0x8baf('0xa5')],_0x5ad8ce[_0x8baf('0xc1')]);}}break;case _0x8baf('0xc9'):_0x2200e7[_0x8baf('0xca')]+=0x1;_0x5ad8ce[_0x8baf('0xcb')]+=0x1;_0x5ad8ce['countglobal']=ut[_0x8baf('0xb2')](_0x5ad8ce);ut['logCustomer'](_0x5ad8ce,0x8,'Congestion');ami[_0x8baf('0x1f')](_0x8baf('0xcc'),ut['buildObj'](_0x5ad8ce,_0x8baf('0xcd')));rpcDb['createCustomerHistory'](_0x5ad8ce,_0x8baf('0xce'));if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut['cloneAction'](_0x5ad8ce,0xf,_0x8baf('0xbe'));rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xcf'));}else{if(_0x5ad8ce[_0x8baf('0xcb')]>=_0x2200e7[_0x8baf('0xd0')]){rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xce'));}else{rpcDb[_0x8baf('0xa2')](ut[_0x8baf('0xa3')](_0x5ad8ce,'countcongestionretry',_0x2200e7['dialBusyRetryFrequency']),_0x5ad8ce['unlockAgent'],_0x5ad8ce['activeContact']);}}break;case'CANCEL':_0x2200e7[_0x8baf('0x38')]+=0x1;_0x5ad8ce['countagentrejectretry']+=0x1;_0x5ad8ce[_0x8baf('0x9a')]=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0x14,'AgentReject');ami[_0x8baf('0x1f')](_0x8baf('0xd1'),ut[_0x8baf('0x9c')](_0x5ad8ce,_0x8baf('0xd2')));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,_0x8baf('0xd3'));if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0x14,_0x8baf('0xd4'));rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xd5'));}else{if(_0x5ad8ce[_0x8baf('0xd6')]>=_0x2200e7[_0x8baf('0xd7')]){rpcDb['createCustomerFinal'](_0x5ad8ce,_0x8baf('0xd5'));}else{rpcDb['rescheduleContact'](ut[_0x8baf('0xa3')](_0x5ad8ce,'countagentrejectretry',_0x2200e7[_0x8baf('0xd8')]),_0x5ad8ce[_0x8baf('0xa5')],_0x5ad8ce[_0x8baf('0xc1')]);}}break;case'ABANDONED':_0x2200e7[_0x8baf('0x3a')]+=0x1;_0x5ad8ce[_0x8baf('0xd9')]+=0x1;_0x5ad8ce[_0x8baf('0x9a')]=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0xb,_0x8baf('0xda'));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut['cloneAction'](_0x5ad8ce,0xf,'Global');rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xdb'));}else{if(_0x5ad8ce['countabandonedetry']>=_0x2200e7[_0x8baf('0xdc')]){rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xdb'));}else{rpcDb[_0x8baf('0xa2')](ut['scheduledAt'](_0x5ad8ce,_0x8baf('0xd9'),_0x2200e7[_0x8baf('0xdd')]),_0x5ad8ce['unlockAgent'],_0x5ad8ce[_0x8baf('0xc1')]);}}break;case'18':_0x2200e7[_0x8baf('0x39')]+=0x1;_0x5ad8ce['countmachineretry']+=0x1;_0x5ad8ce[_0x8baf('0x9a')]=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0x12,_0x4487bc['cause-txt']||_0x4487bc[_0x8baf('0xde')]);ami[_0x8baf('0x1f')](_0x8baf('0xdf'),ut['buildObj'](_0x5ad8ce,_0x8baf('0xe0')));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0xf,_0x8baf('0xbe'));rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xe1'));}else{rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xe1'));}delete this[_0x8baf('0x10')][_0x4487bc[_0x8baf('0xa6')]];break;case'19':_0x2200e7[_0x8baf('0x39')]+=0x1;_0x5ad8ce['countglobal']=ut[_0x8baf('0xb2')](_0x5ad8ce);ut[_0x8baf('0x8a')](_0x5ad8ce,0x13,_0x4487bc['cause-txt']||_0x4487bc[_0x8baf('0xde')]);ami[_0x8baf('0x1f')]('custom:amd',ut[_0x8baf('0x9c')](_0x5ad8ce,_0x8baf('0xe0')));rpcDb[_0x8baf('0x8e')](_0x5ad8ce,'[callProgressDetectingCustomer][machine]');if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0xf,_0x8baf('0xbe'));rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xe2'));}else{rpcDb['createCustomerFinal'](_0x5ad8ce,'[callProgressDetectingCustomer][machine]');}delete this[_0x8baf('0x10')][_0x4487bc['linkedid']];break;default:if(_0x5ad8ce[_0x8baf('0x6e')]){ut['decrementTalkink'](_0x2200e7,_0x8baf('0xe3'));ut[_0x8baf('0x7a')](_0x8baf('0xe4')+_0x2200e7[_0x8baf('0x21')],_0x4487bc);}_0x2200e7[_0x8baf('0x39')]+=0x1;_0x5ad8ce[_0x8baf('0x9a')]=ut[_0x8baf('0xb2')](_0x5ad8ce);ut['logCustomer'](_0x5ad8ce,0xc,_0x4487bc['cause-txt']||_0x4487bc[_0x8baf('0xde')]);rpcDb[_0x8baf('0x8e')](_0x5ad8ce,_0x8baf('0xe5'));if(ut[_0x8baf('0xb2')](_0x5ad8ce)>=_0x2200e7[_0x8baf('0x9e')]){_0x156329=ut[_0x8baf('0x9f')](_0x5ad8ce,0xf,_0x8baf('0xbe'));rpcDb[_0x8baf('0x92')](_0x156329,_0x8baf('0xe6'));}else{rpcDb[_0x8baf('0x92')](_0x5ad8ce,_0x8baf('0xe6'));}delete this['actions'][_0x4487bc[_0x8baf('0xa6')]];}if(!(_0x5ad8ce[_0x8baf('0x6e')]&&_0x10f6ad==='16')){ut[_0x8baf('0x77')](_0x2200e7,_0x8baf('0xe7'));logger['info'](_0x8baf('0xe8'),_0x5ad8ce[_0x8baf('0xb7')],'\x20Queue',_0x2200e7[_0x8baf('0x21')],_0x8baf('0x6b'),_0x2200e7['originated']);}if(_0x10f6ad!==_0x8baf('0xa7')){delete this[_0x8baf('0x10')][_0x4487bc[_0x8baf('0xa6')]];delete this[_0x8baf('0x10')][_0x4487bc[_0x8baf('0xe9')]];}}};Preview[_0x8baf('0x5b')][_0x8baf('0xea')]=function(_0x4021e1,_0x2f8f5e,_0x502dd9){if(_[_0x8baf('0xeb')](_0x2f8f5e)&&_0x8baf('0xec')!==typeof _0x2f8f5e){return;}if(_[_0x8baf('0xeb')](_0x502dd9)&&'object'!==typeof _0x502dd9){return;}switch(_0x502dd9['reason']){case'0':ut[_0x8baf('0xed')](_0x4021e1,0x0,_0x8baf('0x9b'));rpcDb['createAgentHistory'](_0x4021e1,_0x8baf('0xee'));break;case'3':ut[_0x8baf('0xed')](_0x4021e1,0x3,_0x8baf('0xc3'));rpcDb[_0x8baf('0xef')](_0x4021e1,_0x8baf('0xf0'));break;case'5':ut[_0x8baf('0xed')](_0x4021e1,0x5,_0x8baf('0xbb'));rpcDb['createAgentHistory'](_0x4021e1,_0x8baf('0xf1'));break;case'8':ut[_0x8baf('0xed')](_0x4021e1,0x8,_0x8baf('0xf2'));rpcDb[_0x8baf('0xef')](_0x4021e1,_0x8baf('0xf3'));break;case'22':ut[_0x8baf('0xed')](_0x4021e1,0x16,_0x8baf('0xf4'));rpcDb[_0x8baf('0xef')](_0x4021e1,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x8baf('0xed')](_0x4021e1,0xc,_0x502dd9[_0x8baf('0xf5')]);rpcDb[_0x8baf('0xef')](_0x4021e1,_0x8baf('0xf3'));}ut['updateOriginated'](_0x2f8f5e,_0x8baf('0xf6'));logger[_0x8baf('0x52')](_0x8baf('0xf7'),_0x4021e1['uniqueid'],_0x8baf('0xab'),_0x2f8f5e[_0x8baf('0x21')],_0x8baf('0x6b'),_0x2f8f5e[_0x8baf('0x44')]);delete this[_0x8baf('0x10')][_0x4021e1[_0x8baf('0xb7')]];};Preview[_0x8baf('0x5b')]['checkInBlack']=function(_0x5c51ed,_0x928778,_0x2122db,_0x58394c,_0x26fc62){var _0xe7c410=this;return new BPromise(function(_0x597350,_0x25ba63){if(_[_0x8baf('0x69')](_0x928778)||_[_0x8baf('0x69')](_0x928778[_0x8baf('0xf8')])||_['isNil'](_0x928778[_0x8baf('0xf8')][_0x8baf('0xf9')])||_[_0x8baf('0x69')](_0x928778[_0x8baf('0xfa')])){_0x25ba63(ut['message'](_0x8baf('0xfb'),_0x58394c,_0x26fc62));return;}var _0x9662a=uuid['v4']();var _0x23e443=_0xe7c410[_0x8baf('0xe')][_0x928778['Queue'][_0x8baf('0x21')]];var _0x3e1570=_0x2122db?_0xe7c410[_0x8baf('0x11')][_0x2122db]['id']:undefined;_0xe7c410[_0x8baf('0x10')][_0x9662a]=new Action(_0x928778,_0x23e443,_0x9662a,_0x2122db,_0x3e1570);var _0x94e663=_0xe7c410[_0x8baf('0x10')][_0x9662a];_0x94e663['unlockAgent']=_0x58394c;_0x94e663[_0x8baf('0xc1')]=_0x26fc62;_0x94e663['lookAgent']=_0x2122db;if(_[_0x8baf('0xfc')](_0x5c51ed)){_0xe7c410[_0x8baf('0xfd')](_0x94e663,_0x23e443,_0x928778,_0x2122db)[_0x8baf('0x85')](function(_0x2af15f){logger[_0x8baf('0x52')](_0x8baf('0xfe'),_0x8baf('0xff')+_0x94e663[_0x8baf('0x6c')]+_0x8baf('0x100')+_0x94e663[_0x8baf('0x101')],JSON[_0x8baf('0x4e')](_0x2af15f));ami[_0x8baf('0x1f')](_0x8baf('0x102'),ut['buildObj'](_0x94e663,_0x8baf('0x103'),_0xe7c410[_0x8baf('0xe')][_0x94e663[_0x8baf('0x6c')]]));_0x597350(ut[_0x8baf('0x43')](_0x8baf('0x104')));})['catch'](function(_0x243440){ut[_0x8baf('0x57')](_0x8baf('0x105'),_0x243440);_0x25ba63(ut[_0x8baf('0x43')](_0x8baf('0x106'),_0x58394c,_0x26fc62));});}else{_0x23e443[_0x8baf('0x30')]+=0x1;ut[_0x8baf('0x107')](_0x94e663);rpcDb[_0x8baf('0x108')](_0x94e663,'[Blacklist][error]');delete _0xe7c410[_0x8baf('0x10')][_0x9662a];_0x25ba63(ut[_0x8baf('0x43')](_0x8baf('0x109'),_0x58394c,_0x26fc62));}});};Preview[_0x8baf('0x5b')][_0x8baf('0x96')]=function(_0x335108){return!_['isNil'](_0x335108)&&!_[_0x8baf('0x69')](_0x335108[_0x8baf('0x21')])&&!_[_0x8baf('0x69')](_0x335108['active'])&&_0x335108[_0x8baf('0x4b')]&&!_[_0x8baf('0x69')](this['trunks'][util[_0x8baf('0x4f')](_0x8baf('0x10a'),_0x335108[_0x8baf('0x21')])])&&!_[_0x8baf('0x69')](this[_0x8baf('0x10b')][util[_0x8baf('0x4f')](_0x8baf('0x10a'),_0x335108['name'])][_0x8baf('0x10c')])&&(this[_0x8baf('0x10b')][util[_0x8baf('0x4f')](_0x8baf('0x10a'),_0x335108[_0x8baf('0x21')])][_0x8baf('0x10c')]==='reachable'||this[_0x8baf('0x10b')][util[_0x8baf('0x4f')](_0x8baf('0x10a'),_0x335108[_0x8baf('0x21')])]['status']===_0x8baf('0x10d'));};Preview['prototype']['run']=function(_0x279b89,_0x304dde){var _0x5b38e0=this;return new BPromise(function(_0x334e5c,_0x165d82){_0x5b38e0[_0x8baf('0x10e')](_0x279b89,_0x304dde)[_0x8baf('0x85')](function(_0x497e2c){_0x334e5c(_[_0x8baf('0x6f')](_0x497e2c,[_0x8baf('0x43')]));})[_0x8baf('0x75')](function(_0x458357){if(_0x458357[_0x8baf('0x10f')]){rpcDb[_0x8baf('0x110')](_0x279b89);}if(_0x458357['active']){rpcDb[_0x8baf('0x87')](_0x279b89);}_0x165d82(_[_0x8baf('0x6f')](_0x458357,[_0x8baf('0x43')]));});});};Preview[_0x8baf('0x5b')][_0x8baf('0x10e')]=function(_0x18d635,_0x16ec4a){var _0x534dfb=this;return new BPromise(function(_0x5e462c,_0x471d25){var _0x47750a,_0x5e1ad0;rpcDb[_0x8baf('0x111')](_0x18d635)[_0x8baf('0x85')](function(_0x50fc27){if(!_['isNil'](_0x50fc27[0x0])){_0x5e1ad0=_0x50fc27[0x0][_0x8baf('0x112')]?![]:!![];_0x47750a=_0x50fc27[0x0]['recallme']?!![]:![];_0x47750a=_0x16ec4a?!![]:_0x47750a;}var _0x45db28=_0x534dfb[_0x8baf('0x113')](_0x50fc27);if(_0x45db28[_0x8baf('0x114')]){rpcDb[_0x8baf('0x115')](_[_0x8baf('0x6f')](_0x50fc27[0x0],[_0x8baf('0xfa'),_0x8baf('0x116')]))[_0x8baf('0x85')](function(_0x27c759){_0x534dfb[_0x8baf('0x117')](_0x27c759,_0x50fc27[0x0],_0x16ec4a,_0x5e1ad0,_0x47750a)[_0x8baf('0x85')](function(_0x9650e){_0x5e462c(_0x9650e);})['catch'](function(_0x1b951a){_0x471d25(_0x1b951a);});})[_0x8baf('0x75')](function(_0x3df41c){ut[_0x8baf('0x57')](_0x8baf('0x118'),_0x3df41c);_0x471d25(ut[_0x8baf('0x43')](_0x8baf('0x119'),_0x5e1ad0,_0x47750a));});}else{_0x471d25(ut[_0x8baf('0x43')](_0x45db28[_0x8baf('0x43')],_0x5e1ad0,_0x47750a));}})['catch'](function(_0x5c971b){ut['logger'](_0x8baf('0x11a'),_0x5c971b);_0x471d25(ut[_0x8baf('0x43')](_0x8baf('0x119'),![],!![]));});});};Preview[_0x8baf('0x5b')][_0x8baf('0x113')]=function(_0x332595){if(_[_0x8baf('0x69')](_0x332595)||_[_0x8baf('0xfc')](_0x332595)||!_[_0x8baf('0x69')](_0x332595[0x0]['Agent'])&&_[_0x8baf('0x69')](_0x332595[0x0][_0x8baf('0x83')][_0x8baf('0x21')])){ut[_0x8baf('0x57')]('[Preview][validateContact][Empty\x20Contact]',_0x332595);return{'isValid':![],'message':_0x8baf('0x11b')};}var _0x3d8e45=this[_0x8baf('0xe')][_0x332595[0x0]['Queue']['name']];_0x3d8e45[_0x8baf('0x43')]='ACTIVE';if(_[_0x8baf('0x69')](_0x3d8e45)){ut[_0x8baf('0x57')](_0x8baf('0x11c'),_0x3d8e45);return{'isValid':![],'message':_0x8baf('0x11d')};}if(!this[_0x8baf('0x96')](_0x3d8e45[_0x8baf('0x4a')])){ut[_0x8baf('0x57')](_0x8baf('0x11e'),_0x8baf('0x11f')+_0x3d8e45[_0x8baf('0x21')]+_0x8baf('0x120'));if(!this['isTrunkReachable'](_0x3d8e45['TrunkBackup'])){ut[_0x8baf('0x57')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x3d8e45['name']+_0x8baf('0x121'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x8baf('0x95')](_0x3d8e45[_0x8baf('0x64')])){ut[_0x8baf('0x57')](_0x8baf('0x122'),_0x3d8e45[_0x8baf('0x21')]+_0x8baf('0x123'));return{'isValid':![],'message':_0x8baf('0x11f')+_0x3d8e45[_0x8baf('0x21')]+_0x8baf('0x123')};}return{'isValid':!![],'message':_0x8baf('0x124')};};Preview['prototype'][_0x8baf('0xfd')]=function(_0x563669,_0x396759,_0x4e07eb,_0x40a637){var _0x4b5cdb=this;return new BPromise(function(_0x4820b4,_0x526dfe){var _0x1da79d=_0x563669[_0x8baf('0xb7')];var _0x3d3d94=_0x4b5cdb[_0x8baf('0x96')](_0x396759[_0x8baf('0x4a')])?util[_0x8baf('0x4f')](_0x8baf('0x125'),_0x396759[_0x8baf('0x4a')][_0x8baf('0x21')],_['isNil'](_0x396759[_0x8baf('0x2e')])?'':_0x396759[_0x8baf('0x2e')][_0x8baf('0x126')]()||'',_0x396759[_0x8baf('0x127')]>0x0?_0x4e07eb['Contact']['phone'][_0x8baf('0x128')](_0x396759[_0x8baf('0x127')]):_0x4e07eb[_0x8baf('0xf8')][_0x8baf('0xf9')]):util['format']('SIP/%s/%s%s',_[_0x8baf('0x69')](_0x396759['TrunkBackup'])?_0x396759[_0x8baf('0x4a')]['name']:_0x396759[_0x8baf('0x129')]['name'],_['isNil'](_0x396759['dialPrefix'])?'':_0x396759[_0x8baf('0x2e')][_0x8baf('0x126')]()||'',_0x396759['dialCutDigit']>0x0?_0x4e07eb['Contact']['phone'][_0x8baf('0x128')](_0x396759[_0x8baf('0x127')]):_0x4e07eb[_0x8baf('0xf8')]['phone']);var _0x3df924=_0x4b5cdb['isTrunkReachable'](_0x396759[_0x8baf('0x4a')])?ut['getCallerId'](_0x396759['Trunk'][_0x8baf('0x4c')],_0x396759[_0x8baf('0x12a')],_0x396759[_0x8baf('0x12b')]>0x0?ut[_0x8baf('0x12c')](_0x396759['dialOriginateCallerIdNumber'],_0x396759[_0x8baf('0x12b')]):_0x396759[_0x8baf('0x12d')]):ut[_0x8baf('0x12e')](_[_0x8baf('0x69')](_0x396759[_0x8baf('0x129')])?_0x396759[_0x8baf('0x4a')][_0x8baf('0x4c')]:_0x396759[_0x8baf('0x129')][_0x8baf('0x4c')],_0x396759[_0x8baf('0x12a')],_0x396759['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8baf('0x12c')](_0x396759[_0x8baf('0x12d')],_0x396759[_0x8baf('0x12b')]):_0x396759[_0x8baf('0x12d')]);if(_0x3df924){_0x563669[_0x8baf('0x12f')]=ut['extractCalleridName'](_0x3df924);_0x563669[_0x8baf('0x130')]=ut[_0x8baf('0x131')](_0x3df924);}var _0x49ba49=ut[_0x8baf('0x132')](_0x396759,_0x4e07eb,_0x3d3d94,_0x3df924,_0x1da79d,_0x563669);_[_0x8baf('0x133')](_0x563669,ut[_0x8baf('0x134')](_0x49ba49));_0x563669['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut['variablesAction'](_0x563669,_0x396759,_0x49ba49,_0x563669[_0x8baf('0xc1')],_0x40a637))[_0x8baf('0x85')](function(_0x54505b){var _0xbe9e2a=_0x563669['channelAgent'];if(!_[_0x8baf('0x69')](_0xbe9e2a)){if(!_['isNil'](_0x4b5cdb[_0x8baf('0x11')][_0xbe9e2a])){_0x4b5cdb[_0x8baf('0x11')][_0xbe9e2a]['destconnectedlinenum']=_0x563669[_0x8baf('0x135')];emit(util[_0x8baf('0x4f')](_0x8baf('0x136'),_0x4b5cdb[_0x8baf('0x11')][_0xbe9e2a][_0x8baf('0x21')]),_0x8baf('0x137'),{'destaccountcode':_0x4b5cdb[_0x8baf('0x11')][_0xbe9e2a][_0x8baf('0x138')],'destconnectedlinenum':_0x563669['calleridnum']});}}_0x396759['originated']+=0x1;logger[_0x8baf('0x52')](_0x8baf('0x139'),_0x1da79d,_0x8baf('0xab'),_0x396759['name'],_0x8baf('0x6b'),_0x396759[_0x8baf('0x44')]);_0x4820b4(_0x54505b);})['catch'](function(_0x47e30c){ut[_0x8baf('0xed')](_0x563669,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x563669,'[originateFailure][logOriginateFailure]');_0x526dfe(_0x47e30c);});});};Preview[_0x8baf('0x5b')][_0x8baf('0x1a')]=function(_0x2a2247){if(this[_0x8baf('0x10')][_0x2a2247[_0x8baf('0xa6')]]){this[_0x8baf('0x10')][_0x2a2247[_0x8baf('0xa6')]][_0x8baf('0x74')]=_0x2a2247['channel'];}};Preview[_0x8baf('0x5b')][_0x8baf('0x13')]=function(_0x1b4378){var _0x364dea=this;var _0x548043=this[_0x8baf('0x10')][_0x1b4378[_0x8baf('0x13a')]];if(_0x548043){if(_0x548043[_0x8baf('0x13b')]&&this['agents'][_0x548043[_0x8baf('0x13b')]]){ut[_0x8baf('0x13c')](_0x548043,this[_0x8baf('0x11')][_0x548043[_0x8baf('0x13b')]][_0x8baf('0x21')],this[_0x8baf('0x11')][_0x548043[_0x8baf('0x13b')]]['id']);}var _0x484baa=_[_0x8baf('0x13d')](_0x548043);_0x484baa[_0x8baf('0xa8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x39ecc7=_0x364dea['campaignsPreview'][_0x548043[_0x8baf('0x6c')]];if(ut[_0x8baf('0x13e')](_0x1b4378[_0x8baf('0x13f')])){if(_0x548043['unlockAgent']){rpcDb[_0x8baf('0x110')](_0x548043[_0x8baf('0x101')]);}if(_0x548043['activeContact']){rpcDb['disableContact'](_0x548043[_0x8baf('0x101')]);}ami[_0x8baf('0x1f')](_0x8baf('0x140'),ut[_0x8baf('0x9c')](_0x548043,_0x8baf('0x141'),this[_0x8baf('0xe')][_0x548043[_0x8baf('0x6c')]]));this[_0x8baf('0xea')](_0x484baa,_0x39ecc7,_0x1b4378);}else{_0x548043[_0x8baf('0x88')]=moment()[_0x8baf('0x4f')](_0x8baf('0x89'));ut['logAgent'](_0x484baa,0x4,_0x8baf('0x142'));rpcDb['createAgentHistory'](_0x484baa,_0x8baf('0x143'));}}};Preview[_0x8baf('0x5b')][_0x8baf('0x16')]=function(_0x46c18a){var _0x315ee7=this;var _0x5e42b5=this[_0x8baf('0x10')][_0x46c18a[_0x8baf('0xa6')]];var _0x2496f6;if(_0x5e42b5){_0x2496f6=this[_0x8baf('0xe')][_0x5e42b5[_0x8baf('0x6c')]];logger[_0x8baf('0x52')](_0x8baf('0x144'),_0x46c18a['linkedid'],_0x8baf('0xab'),_0x2496f6[_0x8baf('0x21')],_0x8baf('0x6d'),_0x2496f6[_0x8baf('0x26')]);}if(this[_0x8baf('0x10')][_0x46c18a[_0x8baf('0xa6')]]&&_0x46c18a['linkedid']!==_0x46c18a[_0x8baf('0xb7')]){if(_0x46c18a[_0x8baf('0x145')]==='16'&&this[_0x8baf('0x10')][_0x46c18a['linkedid']][_0x8baf('0x6e')]){this[_0x8baf('0x98')](_0x46c18a,_0x46c18a[_0x8baf('0xa6')],_0x46c18a['cause']);}else if(this[_0x8baf('0x10')][_0x46c18a[_0x8baf('0xa6')]][_0x8baf('0x6e')]){logger[_0x8baf('0x52')]('[syncHangup][talking][cause]',_0x46c18a[_0x8baf('0xa6')],_0x46c18a[_0x8baf('0x145')],_0x8baf('0xab'),_0x2496f6[_0x8baf('0x21')],_0x8baf('0x6d'),_0x2496f6['pTalking']);this[_0x8baf('0x98')](_0x46c18a,_0x46c18a['linkedid'],_0x46c18a['cause']);}}else if(_0x5e42b5&&_[_0x8baf('0x69')](_0x5e42b5[_0x8baf('0x146')])&&_0x2496f6[_0x8baf('0x147')]&&_0x46c18a[_0x8baf('0xa6')]===_0x46c18a['uniqueid']&&_[_0x8baf('0x69')](_0x46c18a['reason'])&&_0x46c18a[_0x8baf('0x145')]==='16'&&_0x46c18a[_0x8baf('0x148')]==='6'&&_[_0x8baf('0xeb')](_0x5e42b5[_0x8baf('0x149')])){if(_0x5e42b5[_0x8baf('0xa5')]){rpcDb[_0x8baf('0x110')](_0x5e42b5[_0x8baf('0x101')]);}if(_0x5e42b5[_0x8baf('0xc1')]){rpcDb[_0x8baf('0x87')](_0x5e42b5[_0x8baf('0x101')]);}_0x46c18a['reason']='22';this[_0x8baf('0xea')](_0x5e42b5,_0x2496f6,_0x46c18a);}else if(_0x5e42b5&&_0x5e42b5['transfer']){if(_0x46c18a['cause']==='16'&&this[_0x8baf('0x10')][_0x46c18a[_0x8baf('0xa6')]]['dialAnswer']){logger[_0x8baf('0x52')]('[syncHangup][talking][transfer]',_0x46c18a['linkedid'],_0x46c18a[_0x8baf('0x145')],'\x20Queue',_0x2496f6[_0x8baf('0x21')],_0x8baf('0x6d'),_0x2496f6[_0x8baf('0x26')]);this[_0x8baf('0x98')](_0x46c18a,_0x46c18a[_0x8baf('0xa6')],_0x46c18a[_0x8baf('0x145')]);}else if(this[_0x8baf('0x10')][_0x46c18a[_0x8baf('0xa6')]]['dialAnswer']){logger[_0x8baf('0x52')](_0x8baf('0x14a'),_0x46c18a['linkedid'],_0x46c18a[_0x8baf('0x145')],_0x8baf('0xab'),_0x2496f6['name'],_0x8baf('0x6d'),_0x2496f6[_0x8baf('0x26')]);this[_0x8baf('0x98')](_0x46c18a,_0x46c18a[_0x8baf('0xa6')],_0x46c18a[_0x8baf('0x145')]);}}};Preview['prototype'][_0x8baf('0x14b')]=function(_0x125b4b){if(this[_0x8baf('0x10')][_0x125b4b[_0x8baf('0xe9')]]&&_0x125b4b[_0x8baf('0xe9')]!==_0x125b4b[_0x8baf('0x14c')]){this['callProgressDetectingCustomer'](_0x125b4b,_0x125b4b['destlinkedid'],_0x125b4b[_0x8baf('0xde')]);}};Preview[_0x8baf('0x5b')][_0x8baf('0x18')]=function(_0x400a9c){if(this[_0x8baf('0x10')][_0x400a9c[_0x8baf('0xa6')]]&&_0x400a9c[_0x8baf('0xa6')]!==_0x400a9c['uniqueid']&&!this[_0x8baf('0x10')][_0x400a9c[_0x8baf('0xa6')]][_0x8baf('0x6e')]){if(_0x400a9c[_0x8baf('0x145')]==='1'){this[_0x8baf('0x98')](_0x400a9c,_0x400a9c[_0x8baf('0xa6')],_0x400a9c['cause']);}}};Preview['prototype']['addVariable']=function(_0x5710aa,_0x1af90b,_0x2070c8){if(this['actions'][_0x5710aa]){if(_['isNil'](this[_0x8baf('0x10')][_0x5710aa]['variables'])){this[_0x8baf('0x10')][_0x5710aa][_0x8baf('0x14d')]={};}this[_0x8baf('0x10')][_0x5710aa][_0x8baf('0x14d')][_0x1af90b]=_0x2070c8;}};Preview[_0x8baf('0x5b')][_0x8baf('0x14e')]=function(_0x1ed570){try{if(!_['isNil'](_0x1ed570)){if(ut[_0x8baf('0x14f')](_[_0x8baf('0x150')](_0x1ed570['variable'])[0x0])){this[_0x8baf('0x151')](_0x1ed570[_0x8baf('0xb7')],_[_0x8baf('0x150')](_0x1ed570[_0x8baf('0x152')])[0x0],_0x1ed570[_0x8baf('0x153')]);}}}catch(_0x4109db){logger[_0x8baf('0x154')](_0x8baf('0x155'),util[_0x8baf('0x156')](_0x4109db,{'showHidden':![],'depth':null}));}};Preview[_0x8baf('0x5b')][_0x8baf('0x157')]=function(_0x8fb9e6){if(_0x8fb9e6){if(this[_0x8baf('0x10')][_0x8fb9e6[_0x8baf('0x158')]]){this[_0x8baf('0x10')][_0x8fb9e6[_0x8baf('0x158')]][_0x8baf('0x149')]=!![];}}};Preview[_0x8baf('0x5b')]['syncBlindTransfer']=function(_0x2284eb){if(_0x2284eb){if(this[_0x8baf('0x10')][_0x2284eb[_0x8baf('0x159')]]){this[_0x8baf('0x10')][_0x2284eb[_0x8baf('0x159')]][_0x8baf('0x149')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index f83d29f..d1ed2aa 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 _0xa631=['active','countReScheduled','unlockContact','disableContact','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId'];(function(_0x457f4e,_0x2d1d0a){var _0x241e9a=function(_0x5d81e8){while(--_0x5d81e8){_0x457f4e['push'](_0x457f4e['shift']());}};_0x241e9a(++_0x2d1d0a);}(_0xa631,0x1ef));var _0x1a63=function(_0x5db7f6,_0xc69015){_0x5db7f6=_0x5db7f6-0x0;var _0x36cbd6=_0xa631[_0x5db7f6];return _0x36cbd6;};'use strict';var util=require(_0x1a63('0x0'));var BPromise=require(_0x1a63('0x1'));var logger=require(_0x1a63('0x2'))(_0x1a63('0x3'));var _=require('lodash');var cmHopper=require(_0x1a63('0x4'));var cmHopperFinal=require(_0x1a63('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x1a63('0x6'));var agentReportPreview=require(_0x1a63('0x7'));var voiceQueueReport=require(_0x1a63('0x8'));function loggerCatch(_0xd9b6eb){return function(_0x279bc8){logger[_0x1a63('0x9')](_0xd9b6eb,util[_0x1a63('0xa')](_0x279bc8,{'showHidden':![],'depth':null}));};}function create(_0x48bdb4){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopperHistory[_0x1a63('0xd')](_0x48bdb4))[_0x1a63('0xe')](loggerCatch(_0x1a63('0xf')));}function createAgent(_0xaa7510){return BPromise[_0x1a63('0xb')]()['then'](agentReportPreview['createHistory'](_0xaa7510))[_0x1a63('0xe')](loggerCatch(_0x1a63('0xf')));}function moveContact(_0x39e315){return BPromise['resolve']()[_0x1a63('0xc')](cmHopper['moveContactManagedDialer'](_0x39e315,!![]))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x10')));}exports[_0x1a63('0x11')]=function(_0x4d28bf){return BPromise[_0x1a63('0xb')]()['then'](cmHopperBlack[_0x1a63('0x11')](_0x4d28bf))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x12')));};exports['getContactPreview']=function(_0x3d6c3a){return BPromise['resolve']()[_0x1a63('0xc')](cmHopper[_0x1a63('0x13')](_0x3d6c3a))['catch'](loggerCatch(_0x1a63('0x14')));};exports[_0x1a63('0xd')]=function(_0x4b7ee9,_0x1cf3cd){create(_0x4b7ee9)[_0x1a63('0xe')](loggerCatch(_0x1cf3cd));moveContact(_0x4b7ee9)[_0x1a63('0xe')](loggerCatch(_0x1cf3cd));};exports['createAgentHistory']=function(_0x1e6428,_0x3c9bd4){createAgent(_0x1e6428)[_0x1a63('0xe')](loggerCatch(_0x3c9bd4));};exports[_0x1a63('0x15')]=function(_0x1eb95d,_0x20bc38){create(_0x1eb95d)['catch'](loggerCatch(_0x20bc38));};exports[_0x1a63('0x16')]=function(_0x5363db,_0x4918ea){moveContact(_0x5363db)[_0x1a63('0xe')](loggerCatch(_0x4918ea));};exports[_0x1a63('0x17')]=function(_0x22038c,_0x45839d,_0x13cf68){if(_0x45839d){_0x22038c[_0x1a63('0x18')]=null;}if(_0x13cf68){_0x22038c[_0x1a63('0x19')]=![];}return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x17')](_0x22038c))[_0x1a63('0xe')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x1a63('0x1a')]=function(_0x12c394){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x1a')](_0x12c394))[_0x1a63('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x1a63('0x1b')]=function(_0x22f243){return BPromise[_0x1a63('0xb')]()['then'](cmHopper[_0x1a63('0x1b')]({'UserId':null},_0x22f243,0x1))[_0x1a63('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x1a63('0x1c')]=function(_0x3a5972){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x1b')]({'active':![]},_0x3a5972,0x1))[_0x1a63('0xe')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x3ed830){var _0xa41330={};_0xa41330[_0x1a63('0x1d')]=_0x3ed830['type'];_0xa41330[_0x1a63('0x1e')]=_0x3ed830[_0x1a63('0x1e')];_0xa41330[_0x1a63('0x1f')]=_0x3ed830[_0x1a63('0x1f')];_0xa41330[_0x1a63('0x20')]=_0x3ed830[_0x1a63('0x20')];_0xa41330[_0x1a63('0x21')]=_0x3ed830[_0x1a63('0x21')];_0xa41330['queuecallerjoinAt']=_0x3ed830[_0x1a63('0x22')];_0xa41330[_0x1a63('0x23')]=_0x3ed830['answertime'];_0xa41330[_0x1a63('0x24')]=0x1;_0xa41330['queuecallercompleteAt']=_0x3ed830[_0x1a63('0x25')];_0xa41330[_0x1a63('0x26')]=_0x3ed830[_0x1a63('0x27')];_0xa41330[_0x1a63('0x28')]=_0x1a63('0x29');_0xa41330['exten']='xcally-motion-preview';_0xa41330[_0x1a63('0x2a')]=0x0;_0xa41330[_0x1a63('0x2b')]=0x1;_0xa41330['lastAssignedTo']=_0x3ed830['membername'];_0xa41330[_0x1a63('0x2c')]=_0x1a63('0x2d');return BPromise[_0x1a63('0xb')]()['then'](voiceQueueReport[_0x1a63('0x2e')](_0xa41330))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x2f')));};exports[_0x1a63('0x30')]=function(_0x51970a,_0xd8115b){return BPromise[_0x1a63('0xb')]()[_0x1a63('0xc')](cmHopper[_0x1a63('0x30')](_0x51970a,_0xd8115b))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x31')));};exports[_0x1a63('0x32')]=function(_0x22fb3a){return BPromise[_0x1a63('0xb')]()['then'](cmHopper['rescheduleContact'](_0x22fb3a,!![],!![]))[_0x1a63('0xe')](loggerCatch(_0x1a63('0x33')));}; \ No newline at end of file +var _0x243a=['../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','[createHistory]\x20','createHistory','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt'];(function(_0x3c0e33,_0x4e9903){var _0x48d10c=function(_0x227823){while(--_0x227823){_0x3c0e33['push'](_0x3c0e33['shift']());}};_0x48d10c(++_0x4e9903);}(_0x243a,0x1c9));var _0xa243=function(_0x5316fd,_0xb96a37){_0x5316fd=_0x5316fd-0x0;var _0x176eee=_0x243a[_0x5316fd];return _0x176eee;};'use strict';var util=require('util');var BPromise=require(_0xa243('0x0'));var logger=require(_0xa243('0x1'))(_0xa243('0x2'));var _=require('lodash');var cmHopper=require(_0xa243('0x3'));var cmHopperFinal=require(_0xa243('0x4'));var cmHopperHistory=require(_0xa243('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xa243('0x6'));var agentReportPreview=require(_0xa243('0x7'));var voiceQueueReport=require(_0xa243('0x8'));function loggerCatch(_0x5dd820){return function(_0x51f1e6){logger[_0xa243('0x9')](_0x5dd820,util[_0xa243('0xa')](_0x51f1e6,{'showHidden':![],'depth':null}));};}function create(_0x29c0ec){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopperHistory['createHistory'](_0x29c0ec))['catch'](loggerCatch(_0xa243('0xd')));}function createAgent(_0xec332f){return BPromise['resolve']()['then'](agentReportPreview[_0xa243('0xe')](_0xec332f))[_0xa243('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x471215){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopper[_0xa243('0x10')](_0x471215,!![]))[_0xa243('0xf')](loggerCatch(_0xa243('0x11')));}exports[_0xa243('0x12')]=function(_0x390265){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopperBlack['checkIsBlackList'](_0x390265))[_0xa243('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xa243('0x13')]=function(_0x1d1850){return BPromise['resolve']()[_0xa243('0xc')](cmHopper[_0xa243('0x13')](_0x1d1850))[_0xa243('0xf')](loggerCatch(_0xa243('0x14')));};exports[_0xa243('0xe')]=function(_0xede512,_0x3842e5){create(_0xede512)[_0xa243('0xf')](loggerCatch(_0x3842e5));moveContact(_0xede512)['catch'](loggerCatch(_0x3842e5));};exports[_0xa243('0x15')]=function(_0x44d994,_0xbfa2da){createAgent(_0x44d994)[_0xa243('0xf')](loggerCatch(_0xbfa2da));};exports[_0xa243('0x16')]=function(_0x16fc37,_0x55c019){create(_0x16fc37)['catch'](loggerCatch(_0x55c019));};exports[_0xa243('0x17')]=function(_0x314d9a,_0x526418){moveContact(_0x314d9a)['catch'](loggerCatch(_0x526418));};exports[_0xa243('0x18')]=function(_0x2f5861,_0x5e24ed,_0x305b85){if(_0x5e24ed){_0x2f5861['UserId']=null;}if(_0x305b85){_0x2f5861[_0xa243('0x19')]=![];}return BPromise[_0xa243('0xb')]()['then'](cmHopper['rescheduleContact'](_0x2f5861))[_0xa243('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xa243('0x1a')]=function(_0x251ab2){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopper[_0xa243('0x1a')](_0x251ab2))['catch'](loggerCatch(_0xa243('0x1b')));};exports[_0xa243('0x1c')]=function(_0x19d132){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopper['unlockContact']({'UserId':null},_0x19d132,0x1))['catch'](loggerCatch(_0xa243('0x1d')));};exports[_0xa243('0x1e')]=function(_0x2c3189){return BPromise['resolve']()[_0xa243('0xc')](cmHopper[_0xa243('0x1c')]({'active':![]},_0x2c3189,0x1))[_0xa243('0xf')](loggerCatch(_0xa243('0x1f')));};exports[_0xa243('0x20')]=function(_0x58866b){var _0x3611e5={};_0x3611e5['type']=_0x58866b[_0xa243('0x21')];_0x3611e5[_0xa243('0x22')]=_0x58866b[_0xa243('0x22')];_0x3611e5[_0xa243('0x23')]=_0x58866b[_0xa243('0x23')];_0x3611e5[_0xa243('0x24')]=_0x58866b[_0xa243('0x24')];_0x3611e5[_0xa243('0x25')]=_0x58866b[_0xa243('0x25')];_0x3611e5['queuecallerjoinAt']=_0x58866b[_0xa243('0x26')];_0x3611e5[_0xa243('0x27')]=_0x58866b[_0xa243('0x26')];_0x3611e5[_0xa243('0x28')]=0x1;_0x3611e5[_0xa243('0x29')]=_0x58866b[_0xa243('0x2a')];_0x3611e5[_0xa243('0x2b')]=_0x58866b['membername'];_0x3611e5[_0xa243('0x2c')]='from-sip';_0x3611e5[_0xa243('0x2d')]=_0xa243('0x2e');_0x3611e5[_0xa243('0x2f')]=0x0;_0x3611e5[_0xa243('0x30')]=0x1;_0x3611e5[_0xa243('0x31')]=_0x58866b[_0xa243('0x32')];_0x3611e5[_0xa243('0x33')]=_0xa243('0x34');return BPromise['resolve']()[_0xa243('0xc')](voiceQueueReport['create'](_0x3611e5))[_0xa243('0xf')](loggerCatch(_0xa243('0x35')));};exports[_0xa243('0x36')]=function(_0x5ea1dd,_0x504b7f){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopper[_0xa243('0x36')](_0x5ea1dd,_0x504b7f))[_0xa243('0xf')](loggerCatch(_0xa243('0x37')));};exports[_0xa243('0x38')]=function(_0x2375b1){return BPromise[_0xa243('0xb')]()[_0xa243('0xc')](cmHopper[_0xa243('0x18')](_0x2375b1,!![],!![]))[_0xa243('0xf')](loggerCatch(_0xa243('0x39')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 7e81cfa..17d6d18 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 _0xb253=['xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','pow','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','UserId','state','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','getDiff','createBody','CampaignId','type','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone'];(function(_0x1dbc19,_0x2f9325){var _0x27a824=function(_0x470249){while(--_0x470249){_0x1dbc19['push'](_0x1dbc19['shift']());}};_0x27a824(++_0x2f9325);}(_0xb253,0xa1));var _0x3b25=function(_0x1ccf4f,_0x18ce33){_0x1ccf4f=_0x1ccf4f-0x0;var _0x3f747c=_0xb253[_0x1ccf4f];return _0x3f747c;};'use strict';var util=require(_0x3b25('0x0'));var _=require(_0x3b25('0x1'));var moment=require(_0x3b25('0x2'));var logger=require(_0x3b25('0x3'))('preview');var ipAgi=process[_0x3b25('0x4')][_0x3b25('0x5')]||_0x3b25('0x6');function getSeconds(_0x36c78f,_0x5cde59){var _0x230f03=moment(_0x36c78f)[_0x3b25('0x7')](0x0);var _0x3afa5e=moment(_0x5cde59)['milliseconds'](0x0);return _0x230f03[_0x3b25('0x8')](_0x3afa5e,_0x3b25('0x9'));}exports[_0x3b25('0xa')]=function(_0x27001f){return function(_0x583aee){logger[_0x3b25('0xb')](_0x27001f,util[_0x3b25('0xc')](_0x583aee,{'showHidden':![],'depth':null}));};};exports[_0x3b25('0xd')]=function(_0x2c3ef9,_0x17a96f){logger[_0x3b25('0xe')](_0x2c3ef9,util['inspect'](_0x17a96f,{'showHidden':![],'depth':null}));};exports[_0x3b25('0xf')]=function(_0x28cac5,_0x46341d){logger[_0x3b25('0xb')](_0x28cac5,util['inspect'](_0x46341d,{'showHidden':![],'depth':null}));};exports[_0x3b25('0x10')]=function(_0x242a9b){return function(_0x4cafe9){logger[_0x3b25('0xe')](_0x242a9b,util[_0x3b25('0xc')](_0x4cafe9,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x54f3e5,_0x353b7a,_0x2be187){return{'message':_0x54f3e5,'unlock':_0x353b7a,'active':_0x2be187};};exports[_0x3b25('0x11')]=function(_0xf79525,_0x160b39,_0xd5c5bd){if(!_[_0x3b25('0x12')](_0xd5c5bd)&&_0x3b25('0x13')===typeof _0xd5c5bd&&!_['isEmpty'](_0xd5c5bd)){if(!_['isUndefined'](_0x160b39)&&_0x3b25('0x13')===typeof _0x160b39&&!_[_0x3b25('0x14')](_0x160b39)){return util['format'](_0x3b25('0x15'),_0x160b39,_0xd5c5bd);}return util[_0x3b25('0x16')](_0x3b25('0x15'),_0xd5c5bd,_0xd5c5bd);}if(!_['isUndefined'](_0xf79525)&&'string'===typeof _0xf79525&&!_[_0x3b25('0x14')](_0xf79525)){return _0xf79525;}return _0x3b25('0x17');};exports[_0x3b25('0x18')]=function(_0x42c475){if(_[_0x3b25('0x19')](_0x42c475)){return![];}return _0x42c475;};exports[_0x3b25('0x1a')]=function(_0x222c16,_0x2940fc,_0x17337e,_0x32bf0b,_0x374445,_0x2cd207){var _0x5bf272={'XMD-QUEUE':_0x2940fc[_0x3b25('0x1b')]?_0x2940fc['Queue'][_0x3b25('0x1c')]:'','XMD-CALLERID':_0x32bf0b,'XMD-CALLERID-PREVIEW':_0x2cd207?util[_0x3b25('0x16')]('\x22%s\x22\x20<%s>',_0x2cd207[_0x3b25('0x1d')],_0x2cd207[_0x3b25('0x1e')]):_0x32bf0b,'XMD-DIALID':_0x374445,'XMD-CONTACTID':_0x2940fc[_0x3b25('0x1f')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x32bf0b,'XMD-VOICEQUEUEID':_0x2940fc[_0x3b25('0x20')],'XMD-DIALCHANNEL':_0x17337e,'XMD-DIALTIMEOUT':_0x222c16[_0x3b25('0x21')]||0x1e,'XMD-DIALOPTIONS':util[_0x3b25('0x16')](_0x3b25('0x22'),_0x222c16[_0x3b25('0x23')]?'g':'',_[_0x3b25('0x14')](_0x222c16[_0x3b25('0x24')])?'':_0x3b25('0x25')),'XMD-DIALURL':_0x222c16['dialPreviewUrl']||'','XMD-AGI':_0x222c16[_0x3b25('0x26')]?util[_0x3b25('0x16')](_0x3b25('0x27'),ipAgi,_0x222c16[_0x3b25('0x26')]):_0x3b25('0x28'),'XMD-AGIAFTER':_0x222c16['dialQueueProject2']?util[_0x3b25('0x16')](_0x3b25('0x27'),ipAgi,_0x222c16[_0x3b25('0x23')]):_0x3b25('0x28'),'XMD-ORIGINATECALLERIDNUM':_0x2cd207?_0x2cd207[_0x3b25('0x29')]:'','XMD-ORIGINATECALLERIDNAME':_0x2cd207?_0x2cd207[_0x3b25('0x2a')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x3b25('0x14')](_0x222c16[_0x3b25('0x24')])){_0x5bf272[util[_0x3b25('0x16')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x222c16[_0x3b25('0x24')];_0x5bf272[util[_0x3b25('0x16')]('%s',_0x3b25('0x2b'))]=_0x374445;}if(_0x2940fc&&_0x2940fc[_0x3b25('0x2c')]){for(var _0x4c9f9c in _0x2940fc[_0x3b25('0x2c')]){if(_0x2940fc[_0x3b25('0x2c')]['hasOwnProperty'](_0x4c9f9c)){if(!_[_0x3b25('0x19')](_0x2940fc[_0x3b25('0x2c')][_0x4c9f9c])&&_0x4c9f9c!=='id'&&_0x4c9f9c!==_0x3b25('0x2d')&&_0x4c9f9c!==_0x3b25('0x2e')&&_0x4c9f9c!==_0x3b25('0x2f')){_0x5bf272[util[_0x3b25('0x16')](_0x3b25('0x30'),_0x3b25('0x31'),_['toUpper'](_0x4c9f9c))]=_0x2940fc[_0x3b25('0x2c')][_0x4c9f9c];}}}}return _0x5bf272;};exports['toLowerVariables']=function(_0x4d180a){var _0x26429d={};for(var _0x3d2cd3 in _0x4d180a){if(_0x4d180a[_0x3b25('0x32')](_0x3d2cd3)){_0x26429d[util[_0x3b25('0x16')]('%s',_[_0x3b25('0x33')](_0x3d2cd3))]=_0x4d180a[_0x3d2cd3];}}return{'variables':_0x26429d};};exports[_0x3b25('0x34')]=function(_0x53b4d4,_0x307245){if(!_[_0x3b25('0x19')](_0x53b4d4)){if(_0x53b4d4[_0x3b25('0x32')](_0x3b25('0x35'))){if(_0x53b4d4['originated']>0x0){_0x53b4d4['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x307245);}}}else{logger[_0x3b25('0xb')](_0x3b25('0x36'),_0x307245);}};exports[_0x3b25('0x37')]=function(_0x471f2c){var _0x3590a4=moment()[_0x3b25('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x471f2c['state']=0xd;_0x471f2c[_0x3b25('0x38')]='Blacklist';_0x471f2c[_0x3b25('0x39')]=_0x3590a4;_0x471f2c[_0x3b25('0x3a')]=_0x3590a4;_0x471f2c[_0x3b25('0x3b')]=_0x3590a4;};exports[_0x3b25('0x3c')]=function(_0x213b41,_0x35ce06,_0x269a80){var _0x3d88d0=moment()[_0x3b25('0x16')](_0x3b25('0x3d'));_0x213b41['state']=_0x35ce06;_0x213b41['statedesc']=_0x269a80;_0x213b41[_0x3b25('0x3a')]=_0x3d88d0;_0x213b41[_0x3b25('0x3e')]=getSeconds(_0x213b41[_0x3b25('0x3a')],_0x213b41[_0x3b25('0x39')]);};exports['logLookAgent']=function(_0x12fa64,_0x12812b,_0x492902){_0x12fa64[_0x3b25('0x3f')]=_0x12812b;_0x12fa64[_0x3b25('0x40')]=_0x492902;};exports['logCustomer']=function(_0x165c90,_0x5e6164,_0xb1b5be){var _0x529f89=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x165c90[_0x3b25('0x41')]=_0x5e6164;_0x165c90[_0x3b25('0x38')]=_0xb1b5be;_0x165c90[_0x3b25('0x3a')]=_0x165c90[_0x3b25('0x3a')]?_0x165c90[_0x3b25('0x3a')]:_0x529f89;_0x165c90[_0x3b25('0x3b')]=_0x165c90[_0x3b25('0x3b')]?_0x165c90[_0x3b25('0x3b')]:_0x529f89;_0x165c90[_0x3b25('0x3e')]=getSeconds(_0x165c90[_0x3b25('0x3a')]||0x0,_0x165c90['starttime']||0x0);_0x165c90[_0x3b25('0x42')]=_0x165c90['answertime']?getSeconds(_0x165c90[_0x3b25('0x3b')],_0x165c90[_0x3b25('0x43')]):0x0;};exports[_0x3b25('0x44')]=function(_0x2fba11){return _0x2fba11===_0x3b25('0x45');};exports[_0x3b25('0x46')]=function(_0x157976,_0x4a53d9,_0x48167d,_0x17f10b,_0x3e4ab2){var _0x264d28=_0x17f10b?'RECALL':_0x157976[_0x3b25('0x1d')];_0x264d28=_0x3e4ab2?'BOOKED':_0x264d28;return{'actionid':_0x157976[_0x3b25('0x47')],'action':_0x3b25('0x48'),'channel':_0x157976[_0x3b25('0x49')],'callerid':util[_0x3b25('0x16')](_0x3b25('0x15'),_0x264d28,_0x157976[_0x3b25('0x1e')]),'Exten':'xcally-motion-preview','Context':_0x3b25('0x4a'),'Priority':'1','variable':_0x48167d,'timeout':(_0x4a53d9['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x157976[_0x3b25('0x47')]};};exports[_0x3b25('0x4b')]=function(_0x311c49){return _0x311c49[_0x3b25('0x4c')]+_0x311c49['countcongestionretry']+_0x311c49['countnoanswerretry']+_0x311c49[_0x3b25('0x4d')]+_0x311c49[_0x3b25('0x4e')];};exports[_0x3b25('0x4f')]=function(_0x1d6b08){var _0x23951b=_[_0x3b25('0x50')](_0x1d6b08);_0x23951b[_0x3b25('0x41')]=0xf;_0x23951b[_0x3b25('0x38')]=_0x3b25('0x51');return _0x23951b;};exports[_0x3b25('0x52')]=function(_0x4a2cc2,_0xd0f4b7,_0x4949b3){var _0x4e973f={};_0x4e973f[_0xd0f4b7]=_0x4a2cc2[_0xd0f4b7];_0x4e973f['active']=![];_0x4e973f[_0x3b25('0x53')]=moment()[_0x3b25('0x54')](_0x4949b3,'minutes')[_0x3b25('0x16')](_0x3b25('0x3d'));_0x4e973f[_0x3b25('0x1f')]=_0x4a2cc2[_0x3b25('0x1f')];_0x4e973f[_0x3b25('0x55')]=_0x4a2cc2[_0x3b25('0x55')];_0x4e973f['VoiceQueueId']=_0x4a2cc2['VoiceQueueId']||undefined;return _0x4e973f;};exports[_0x3b25('0x56')]=function(_0x18858c,_0x1853e4){if(!_[_0x3b25('0x19')](_0x18858c)){if(_0x18858c[_0x3b25('0x57')]>0x0){_0x18858c['pTalking']-=0x1;}else{logger[_0x3b25('0xb')](_0x1853e4,_0x3b25('0x58'));}}else{logger['error'](_0x1853e4,_0x3b25('0x59'));}};exports[_0x3b25('0x5a')]=function(_0x2cc33d){if(_0x2cc33d<=0x0){return!![];}return![];};exports[_0x3b25('0x5b')]=function(_0x380fb8,_0xf96456,_0x5dfd24){_0x380fb8[_0x3b25('0x5c')]=_0xf96456;_0x380fb8['name']=_0x380fb8[_0x3b25('0x5d')];_0x380fb8['interface']=_0x380fb8[_0x3b25('0x49')];_0x380fb8[_0x3b25('0x5e')]=_0x3b25('0x5f');if(_0x5dfd24){_0x380fb8[_0x3b25('0x60')]=_0x5dfd24[_0x3b25('0x60')];}return _0x380fb8;};exports[_0x3b25('0x61')]=function(_0x179fc1){var _0x502f81={};_0x502f81[_0x3b25('0x5d')]=_0x179fc1[_0x3b25('0x5d')];_0x502f81[_0x3b25('0x62')]=_0x179fc1[_0x3b25('0x49')];_0x502f81[_0x3b25('0x47')]=_0x179fc1['uniqueid'];return _0x502f81;};exports[_0x3b25('0x63')]=function(_0x19f52f){var _0x77e97e=[];for(var _0x30948a in _0x19f52f){if(_0x19f52f[_0x3b25('0x32')](_0x30948a)){if(!_[_0x3b25('0x19')](_0x19f52f[_0x30948a])&&_0x19f52f[_0x30948a][_0x3b25('0x41')]===_0x3b25('0x64')&&_0x19f52f[_0x30948a][_0x3b25('0x65')]==='reachable'){_0x77e97e['push'](_0x19f52f[_0x30948a]['id']);}}}return _0x77e97e;};exports[_0x3b25('0x66')]=function(_0x366278){var _0x4c2a84=moment()[_0x3b25('0x7')](0x0);var _0x586e3f=moment(_0x366278)[_0x3b25('0x7')](0x0);return _0x4c2a84[_0x3b25('0x8')](_0x586e3f,'seconds');};exports[_0x3b25('0x67')]=function(_0x293626){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x293626[_0x3b25('0x1f')],'ListId':_0x293626[_0x3b25('0x55')],'VoiceQueueId':_0x293626[_0x3b25('0x20')]||undefined,'CampaignId':_0x293626[_0x3b25('0x68')]||undefined};};exports['filterKey']=function(_0x389681){if(_0x389681===_0x3b25('0x47')||_0x389681==='idContact'||_0x389681===_0x3b25('0x5d')||_0x389681===_0x3b25('0x69')||_0x389681==='campaigntype'||_0x389681==='dialAnswer'||_0x389681===_0x3b25('0x3f')||_0x389681===_0x3b25('0x49')||_0x389681===_0x3b25('0x1d')||_0x389681==='active'||_0x389681==='calleridnum'||_0x389681===_0x3b25('0x53')||_0x389681===_0x3b25('0x4c')||_0x389681===_0x3b25('0x6a')||_0x389681===_0x3b25('0x6b')||_0x389681===_0x3b25('0x6c')||_0x389681===_0x3b25('0x6d')||_0x389681===_0x3b25('0x6e')||_0x389681===_0x3b25('0x6f')||_0x389681==='recallme'||_0x389681===_0x3b25('0x1f')||_0x389681===_0x3b25('0x55')||_0x389681==='UserId'||_0x389681==='VoiceQueueId'||_0x389681===_0x3b25('0x70')||_0x389681==='xmd-voicequeueid'||_0x389681===_0x3b25('0x71')||_0x389681===_0x3b25('0x72')||_0x389681==='xmd-listid'||_0x389681===_0x3b25('0x73')||_0x389681===_0x3b25('0x74')||_0x389681===_0x3b25('0x75')||_0x389681===_0x3b25('0x76')||_0x389681===_0x3b25('0x77')||_0x389681===_0x3b25('0x78')||_0x389681===_0x3b25('0x79')||_0x389681==='xmd-callerid'||_0x389681===_0x3b25('0x7a')||_0x389681===_0x3b25('0x7b')||_0x389681===_0x3b25('0x7c')||_0x389681===_0x3b25('0x7d')||_0x389681===_0x3b25('0x7e')||_0x389681===_0x3b25('0x7f')||_0x389681===_0x3b25('0x80')||_0x389681===_0x3b25('0x81')||_0x389681===_0x3b25('0x82')||_0x389681===_0x3b25('0x83')||_0x389681===_0x3b25('0x7c')||_0x389681===_0x3b25('0x7d')||_0x389681===_0x3b25('0x7e')||_0x389681===_0x3b25('0x7f')||_0x389681===_0x3b25('0x80')||_0x389681===_0x3b25('0x81')||_0x389681===_0x3b25('0x82')||_0x389681===_0x3b25('0x83')||_0x389681===_0x3b25('0x84')||_0x389681===_0x3b25('0x85')||_0x389681===_0x3b25('0x41')||_0x389681===_0x3b25('0x38')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x55b3d1,_0x257695){var _0x16b558,_0x5cac28,_0x5b5c54;if(_0x257695<=0x0){_0x257695=0x1;}_0x16b558=new RegExp('\x5cw{0,'+_0x257695+'}$');_0x5cac28=Math[_0x3b25('0x86')](0xa,_0x257695-0x1);_0x5b5c54=Math[_0x3b25('0x86')](0xa,_0x257695)-0x1;return util[_0x3b25('0x16')]('%s',_['replace'](_0x55b3d1,_0x16b558,_[_0x3b25('0x87')](_0x5cac28,_0x5b5c54)));};exports[_0x3b25('0x88')]=function(_0x37038f){var _0x39e1bf=_0x37038f[_0x3b25('0x89')](/"(.*?)"/);return _0x39e1bf?_0x39e1bf[0x1]:_0x37038f;};exports['extractCalleridNumber']=function(_0x131e8b){var _0x25980a=_0x131e8b[_0x3b25('0x89')](/<(.*?)>/);return _0x25980a?_0x25980a[0x1]:_0x131e8b;}; \ No newline at end of file +var _0xa11a=['logCustomer','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','clone','Global','scheduledAt','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','active','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','%s%s','toUpper','toLower','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId'];(function(_0x52f0a6,_0xa3c19f){var _0x2dcee6=function(_0x5ad678){while(--_0x5ad678){_0x52f0a6['push'](_0x52f0a6['shift']());}};_0x2dcee6(++_0xa3c19f);}(_0xa11a,0x166));var _0xaa11=function(_0x3aada5,_0x3422de){_0x3aada5=_0x3aada5-0x0;var _0x5b0751=_0xa11a[_0x3aada5];return _0x5b0751;};'use strict';var util=require(_0xaa11('0x0'));var _=require(_0xaa11('0x1'));var moment=require(_0xaa11('0x2'));var logger=require(_0xaa11('0x3'))(_0xaa11('0x4'));var ipAgi=process[_0xaa11('0x5')][_0xaa11('0x6')]||_0xaa11('0x7');function getSeconds(_0x3eca0f,_0x1018e0){var _0x6538a0=moment(_0x3eca0f)[_0xaa11('0x8')](0x0);var _0x330ff9=moment(_0x1018e0)['milliseconds'](0x0);return _0x6538a0[_0xaa11('0x9')](_0x330ff9,_0xaa11('0xa'));}exports['loggerCatch']=function(_0x485ba6){return function(_0x5d9db7){logger[_0xaa11('0xb')](_0x485ba6,util[_0xaa11('0xc')](_0x5d9db7,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5d4e18,_0x4052d4){logger[_0xaa11('0xd')](_0x5d4e18,util['inspect'](_0x4052d4,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x23c6a0,_0x1cb58c){logger[_0xaa11('0xb')](_0x23c6a0,util[_0xaa11('0xc')](_0x1cb58c,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4a4324){return function(_0x970400){logger[_0xaa11('0xd')](_0x4a4324,util[_0xaa11('0xc')](_0x970400,{'showHidden':![],'depth':null}));};};exports[_0xaa11('0xe')]=function(_0xd32899,_0x85661a,_0x5a5b5f){return{'message':_0xd32899,'unlock':_0x85661a,'active':_0x5a5b5f};};exports[_0xaa11('0xf')]=function(_0x25bdcf,_0x55ace9,_0x5380b9){if(!_[_0xaa11('0x10')](_0x5380b9)&&_0xaa11('0x11')===typeof _0x5380b9&&!_[_0xaa11('0x12')](_0x5380b9)){if(!_[_0xaa11('0x10')](_0x55ace9)&&'string'===typeof _0x55ace9&&!_[_0xaa11('0x12')](_0x55ace9)){return util[_0xaa11('0x13')]('\x22%s\x22\x20<%s>',_0x55ace9,_0x5380b9);}return util[_0xaa11('0x13')](_0xaa11('0x14'),_0x5380b9,_0x5380b9);}if(!_[_0xaa11('0x10')](_0x25bdcf)&&_0xaa11('0x11')===typeof _0x25bdcf&&!_['isEmpty'](_0x25bdcf)){return _0x25bdcf;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x2bffe5){if(_[_0xaa11('0x15')](_0x2bffe5)){return![];}return _0x2bffe5;};exports[_0xaa11('0x16')]=function(_0xee9394,_0x153607,_0x1bf8ad,_0x7373fa,_0x3f3840,_0xef0150){var _0x1cb8a6={'XMD-QUEUE':_0x153607['Queue']?_0x153607[_0xaa11('0x17')][_0xaa11('0x18')]:'','XMD-CALLERID':_0x7373fa,'XMD-CALLERID-PREVIEW':_0xef0150?util[_0xaa11('0x13')](_0xaa11('0x14'),_0xef0150[_0xaa11('0x19')],_0xef0150[_0xaa11('0x1a')]):_0x7373fa,'XMD-DIALID':_0x3f3840,'XMD-CONTACTID':_0x153607[_0xaa11('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x7373fa,'XMD-VOICEQUEUEID':_0x153607[_0xaa11('0x1c')],'XMD-DIALCHANNEL':_0x1bf8ad,'XMD-DIALTIMEOUT':_0xee9394[_0xaa11('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xaa11('0x13')](_0xaa11('0x1e'),_0xee9394['dialQueueProject2']?'g':'',_[_0xaa11('0x12')](_0xee9394[_0xaa11('0x1f')])?'':_0xaa11('0x20')),'XMD-DIALURL':_0xee9394['dialPreviewUrl']||'','XMD-AGI':_0xee9394[_0xaa11('0x21')]?util[_0xaa11('0x13')](_0xaa11('0x22'),ipAgi,_0xee9394['dialQueueProject']):_0xaa11('0x23'),'XMD-AGIAFTER':_0xee9394[_0xaa11('0x24')]?util[_0xaa11('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0xee9394[_0xaa11('0x24')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xef0150?_0xef0150[_0xaa11('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0xef0150?_0xef0150[_0xaa11('0x26')]:'','XMD-DESTINATION':_0xaa11('0x27')};if(!_[_0xaa11('0x12')](_0xee9394[_0xaa11('0x1f')])){_0x1cb8a6[util[_0xaa11('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xee9394['monitor_format'];_0x1cb8a6[util[_0xaa11('0x13')]('%s',_0xaa11('0x28'))]=_0x3f3840;}if(_0x153607&&_0x153607[_0xaa11('0x29')]){for(var _0x6ff8c in _0x153607[_0xaa11('0x29')]){if(_0x153607[_0xaa11('0x29')]['hasOwnProperty'](_0x6ff8c)){if(!_['isNil'](_0x153607[_0xaa11('0x29')][_0x6ff8c])&&_0x6ff8c!=='id'&&_0x6ff8c!==_0xaa11('0x2a')&&_0x6ff8c!==_0xaa11('0x2b')&&_0x6ff8c!=='updatedAt'){_0x1cb8a6[util[_0xaa11('0x13')](_0xaa11('0x2c'),'XMD-',_[_0xaa11('0x2d')](_0x6ff8c))]=_0x153607[_0xaa11('0x29')][_0x6ff8c];}}}}return _0x1cb8a6;};exports['toLowerVariables']=function(_0x5f3eb5){var _0x542b90={};for(var _0xa64b34 in _0x5f3eb5){if(_0x5f3eb5['hasOwnProperty'](_0xa64b34)){_0x542b90[util['format']('%s',_[_0xaa11('0x2e')](_0xa64b34))]=_0x5f3eb5[_0xa64b34];}}return{'variables':_0x542b90};};exports[_0xaa11('0x2f')]=function(_0x1fd9e5,_0x13c315){if(!_[_0xaa11('0x15')](_0x1fd9e5)){if(_0x1fd9e5[_0xaa11('0x30')]('originated')){if(_0x1fd9e5[_0xaa11('0x31')]>0x0){_0x1fd9e5[_0xaa11('0x31')]-=0x1;}else{logger[_0xaa11('0xb')](_0xaa11('0x32'),_0x13c315);}}}else{logger['error'](_0xaa11('0x33'),_0x13c315);}};exports[_0xaa11('0x34')]=function(_0x249566){var _0x581e29=moment()[_0xaa11('0x13')](_0xaa11('0x35'));_0x249566[_0xaa11('0x36')]=0xd;_0x249566[_0xaa11('0x37')]=_0xaa11('0x38');_0x249566['starttime']=_0x581e29;_0x249566[_0xaa11('0x39')]=_0x581e29;_0x249566[_0xaa11('0x3a')]=_0x581e29;};exports[_0xaa11('0x3b')]=function(_0x56e282,_0x36b9e9,_0x274652){var _0x1ec66a=moment()[_0xaa11('0x13')](_0xaa11('0x35'));_0x56e282['state']=_0x36b9e9;_0x56e282[_0xaa11('0x37')]=_0x274652;_0x56e282['responsetime']=_0x1ec66a;_0x56e282[_0xaa11('0x3c')]=getSeconds(_0x56e282[_0xaa11('0x39')],_0x56e282[_0xaa11('0x3d')]);};exports[_0xaa11('0x3e')]=function(_0x948711,_0x499a54,_0x4b7918){_0x948711[_0xaa11('0x3f')]=_0x499a54;_0x948711[_0xaa11('0x40')]=_0x4b7918;};exports[_0xaa11('0x41')]=function(_0x328428,_0x102fb5,_0x1c57aa){var _0x23da85=moment()['format'](_0xaa11('0x35'));_0x328428[_0xaa11('0x36')]=_0x102fb5;_0x328428[_0xaa11('0x37')]=_0x1c57aa;_0x328428[_0xaa11('0x39')]=_0x328428[_0xaa11('0x39')]?_0x328428[_0xaa11('0x39')]:_0x23da85;_0x328428[_0xaa11('0x3a')]=_0x328428[_0xaa11('0x3a')]?_0x328428[_0xaa11('0x3a')]:_0x23da85;_0x328428['ringtime']=getSeconds(_0x328428['responsetime']||0x0,_0x328428[_0xaa11('0x3d')]||0x0);_0x328428[_0xaa11('0x42')]=_0x328428[_0xaa11('0x43')]?getSeconds(_0x328428['endtime'],_0x328428[_0xaa11('0x43')]):0x0;};exports[_0xaa11('0x44')]=function(_0x58daf3){return _0x58daf3===_0xaa11('0x45');};exports[_0xaa11('0x46')]=function(_0x460a79,_0x524d2d,_0x5ca36d,_0x11d4a1,_0xc82516){var _0x14dba0=_0x11d4a1?'RECALL':_0x460a79[_0xaa11('0x19')];_0x14dba0=_0xc82516?'BOOKED':_0x14dba0;return{'actionid':_0x460a79[_0xaa11('0x47')],'action':_0xaa11('0x48'),'channel':_0x460a79[_0xaa11('0x49')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x14dba0,_0x460a79['calleridnum']),'Exten':_0xaa11('0x27'),'Context':_0xaa11('0x4a'),'Priority':'1','variable':_0x5ca36d,'timeout':(_0x524d2d[_0xaa11('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x460a79['uniqueid']};};exports[_0xaa11('0x4c')]=function(_0x4189b1){return _0x4189b1[_0xaa11('0x4d')]+_0x4189b1['countcongestionretry']+_0x4189b1[_0xaa11('0x4e')]+_0x4189b1[_0xaa11('0x4f')]+_0x4189b1['countnosuchnumberretry'];};exports['cloneAction']=function(_0x1d6f78){var _0x301b68=_[_0xaa11('0x50')](_0x1d6f78);_0x301b68[_0xaa11('0x36')]=0xf;_0x301b68[_0xaa11('0x37')]=_0xaa11('0x51');return _0x301b68;};exports[_0xaa11('0x52')]=function(_0x5c880a,_0x1d8471,_0x565404){var _0x42bc68={};_0x42bc68[_0x1d8471]=_0x5c880a[_0x1d8471];_0x42bc68['active']=![];_0x42bc68[_0xaa11('0x53')]=moment()['add'](_0x565404,_0xaa11('0x54'))[_0xaa11('0x13')](_0xaa11('0x35'));_0x42bc68[_0xaa11('0x1b')]=_0x5c880a[_0xaa11('0x1b')];_0x42bc68[_0xaa11('0x55')]=_0x5c880a[_0xaa11('0x55')];_0x42bc68[_0xaa11('0x1c')]=_0x5c880a[_0xaa11('0x1c')]||undefined;return _0x42bc68;};exports[_0xaa11('0x56')]=function(_0x3b37e3,_0x4b9e59){if(!_[_0xaa11('0x15')](_0x3b37e3)){if(_0x3b37e3[_0xaa11('0x57')]>0x0){_0x3b37e3[_0xaa11('0x57')]-=0x1;}else{logger[_0xaa11('0xb')](_0x4b9e59,_0xaa11('0x58'));}}else{logger['error'](_0x4b9e59,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x5b7260){if(_0x5b7260<=0x0){return!![];}return![];};exports[_0xaa11('0x59')]=function(_0x3d98d1,_0x3cac6e,_0x3af326){_0x3d98d1[_0xaa11('0x5a')]=_0x3cac6e;_0x3d98d1[_0xaa11('0x18')]=_0x3d98d1[_0xaa11('0x5b')];_0x3d98d1[_0xaa11('0x5c')]=_0x3d98d1['channelAgent'];_0x3d98d1[_0xaa11('0x5d')]=_0xaa11('0x5e');if(_0x3af326){_0x3d98d1[_0xaa11('0x5f')]=_0x3af326['mandatoryDisposition'];}return _0x3d98d1;};exports[_0xaa11('0x60')]=function(_0x242386){var _0x447cbb={};_0x447cbb[_0xaa11('0x5b')]=_0x242386[_0xaa11('0x5b')];_0x447cbb[_0xaa11('0x5c')]=_0x242386[_0xaa11('0x49')];_0x447cbb[_0xaa11('0x47')]=_0x242386[_0xaa11('0x47')];return _0x447cbb;};exports[_0xaa11('0x61')]=function(_0xc6854b){var _0x3f05cd=[];for(var _0x42fb10 in _0xc6854b){if(_0xc6854b[_0xaa11('0x30')](_0x42fb10)){if(!_[_0xaa11('0x15')](_0xc6854b[_0x42fb10])&&_0xc6854b[_0x42fb10][_0xaa11('0x36')]===_0xaa11('0x62')&&_0xc6854b[_0x42fb10]['status']===_0xaa11('0x63')){_0x3f05cd[_0xaa11('0x64')](_0xc6854b[_0x42fb10]['id']);}}}return _0x3f05cd;};exports[_0xaa11('0x65')]=function(_0x3e1c97){var _0x9b85d4=moment()[_0xaa11('0x8')](0x0);var _0x37984a=moment(_0x3e1c97)[_0xaa11('0x8')](0x0);return _0x9b85d4[_0xaa11('0x9')](_0x37984a,_0xaa11('0xa'));};exports[_0xaa11('0x66')]=function(_0x5b3e93){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5b3e93[_0xaa11('0x1b')],'ListId':_0x5b3e93[_0xaa11('0x55')],'VoiceQueueId':_0x5b3e93[_0xaa11('0x1c')]||undefined,'CampaignId':_0x5b3e93[_0xaa11('0x67')]||undefined};};exports[_0xaa11('0x68')]=function(_0x19f49b){if(_0x19f49b===_0xaa11('0x47')||_0x19f49b===_0xaa11('0x69')||_0x19f49b==='queue'||_0x19f49b===_0xaa11('0x6a')||_0x19f49b===_0xaa11('0x6b')||_0x19f49b==='dialAnswer'||_0x19f49b===_0xaa11('0x3f')||_0x19f49b===_0xaa11('0x49')||_0x19f49b===_0xaa11('0x19')||_0x19f49b===_0xaa11('0x6c')||_0x19f49b==='calleridnum'||_0x19f49b==='scheduledat'||_0x19f49b===_0xaa11('0x4d')||_0x19f49b==='countcongestionretry'||_0x19f49b==='countnoanswerretry'||_0x19f49b===_0xaa11('0x6d')||_0x19f49b===_0xaa11('0x6e')||_0x19f49b===_0xaa11('0x6f')||_0x19f49b===_0xaa11('0x70')||_0x19f49b===_0xaa11('0x71')||_0x19f49b==='ContactId'||_0x19f49b===_0xaa11('0x55')||_0x19f49b===_0xaa11('0x40')||_0x19f49b===_0xaa11('0x1c')||_0x19f49b===_0xaa11('0x72')||_0x19f49b===_0xaa11('0x73')||_0x19f49b==='xmd-queue'||_0x19f49b===_0xaa11('0x74')||_0x19f49b===_0xaa11('0x75')||_0x19f49b===_0xaa11('0x76')||_0x19f49b===_0xaa11('0x77')||_0x19f49b===_0xaa11('0x78')||_0x19f49b===_0xaa11('0x79')||_0x19f49b===_0xaa11('0x7a')||_0x19f49b===_0xaa11('0x7b')||_0x19f49b===_0xaa11('0x7c')||_0x19f49b===_0xaa11('0x7d')||_0x19f49b===_0xaa11('0x7e')||_0x19f49b==='xmd-agi'||_0x19f49b==='rtpaudioqos'||_0x19f49b===_0xaa11('0x7f')||_0x19f49b===_0xaa11('0x80')||_0x19f49b==='rtpaudioqosjitterbridged'||_0x19f49b==='rtpaudioqosloss'||_0x19f49b===_0xaa11('0x81')||_0x19f49b===_0xaa11('0x82')||_0x19f49b===_0xaa11('0x83')||_0x19f49b===_0xaa11('0x84')||_0x19f49b===_0xaa11('0x7f')||_0x19f49b===_0xaa11('0x80')||_0x19f49b===_0xaa11('0x85')||_0x19f49b==='rtpaudioqosloss'||_0x19f49b===_0xaa11('0x81')||_0x19f49b===_0xaa11('0x82')||_0x19f49b==='rtpaudioqosrttbridged'||_0x19f49b===_0xaa11('0x86')||_0x19f49b===_0xaa11('0x87')||_0x19f49b===_0xaa11('0x36')||_0x19f49b==='statedesc'){return![];}return!![];};exports[_0xaa11('0x88')]=function(_0x2bc63c,_0x3aa081){var _0x4444ac,_0x36b86a,_0x3fbf8d;if(_0x3aa081<=0x0){_0x3aa081=0x1;}_0x4444ac=new RegExp(_0xaa11('0x89')+_0x3aa081+'}$');_0x36b86a=Math['pow'](0xa,_0x3aa081-0x1);_0x3fbf8d=Math['pow'](0xa,_0x3aa081)-0x1;return util[_0xaa11('0x13')]('%s',_['replace'](_0x2bc63c,_0x4444ac,_['random'](_0x36b86a,_0x3fbf8d)));};exports[_0xaa11('0x8a')]=function(_0x5b6d52){var _0xe7daa8=_0x5b6d52[_0xaa11('0x8b')](/"(.*?)"/);return _0xe7daa8?_0xe7daa8[0x1]:_0x5b6d52;};exports[_0xaa11('0x8c')]=function(_0x339793){var _0x19992c=_0x339793['match'](/<(.*?)>/);return _0x19992c?_0x19992c[0x1]:_0x339793;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index bac47d9..246a4df 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 _0x175e=['queuepause','boolean','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x421b7b,_0x566ee9){var _0x2c472c=function(_0x4649b0){while(--_0x4649b0){_0x421b7b['push'](_0x421b7b['shift']());}};_0x2c472c(++_0x566ee9);}(_0x175e,0xd5));var _0xe175=function(_0x4d60a3,_0x466dcd){_0x4d60a3=_0x4d60a3-0x0;var _0xeb2bc8=_0x175e[_0x4d60a3];return _0xeb2bc8;};'use strict';exports[_0xe175('0x0')]={'queue':{'type':_0xe175('0x1'),'required':!![]},'interface':{'type':_0xe175('0x1'),'required':!![]},'membername':{'type':_0xe175('0x1'),'required':!![]},'penalty':{'type':_0xe175('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xe175('0x1'),'required':!![]}};exports[_0xe175('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xe175('0x4')},'reason':{'type':_0xe175('0x1'),'required':![]}};exports[_0xe175('0x5')]={'module':{'type':_0xe175('0x1'),'required':![]}};exports[_0xe175('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xe175('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xe175('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xe175('0x7')]={'uniqueid':{'type':_0xe175('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xe175('0x1'),'required':!![]},'exten':{'type':_0xe175('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x292a=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x12ecb3,_0x3ba8f0){var _0x5a9ce3=function(_0x53493d){while(--_0x53493d){_0x12ecb3['push'](_0x12ecb3['shift']());}};_0x5a9ce3(++_0x3ba8f0);}(_0x292a,0x84));var _0xa292=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x292a[_0x5b3b9b];return _0x47c1d7;};'use strict';exports['queueadd']={'queue':{'type':_0xa292('0x0'),'required':!![]},'interface':{'type':_0xa292('0x0'),'required':!![]},'membername':{'type':_0xa292('0x0'),'required':!![]},'penalty':{'type':_0xa292('0x1'),'required':![]},'paused':{'type':_0xa292('0x2'),'required':![]}};exports[_0xa292('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xa292('0x0'),'required':!![]}};exports[_0xa292('0x4')]={'interface':{'type':_0xa292('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xa292('0x0'),'required':![]}};exports[_0xa292('0x5')]={'module':{'type':_0xa292('0x0'),'required':![]}};exports[_0xa292('0x6')]={'uniqueid':{'type':_0xa292('0x0'),'required':!![]}};exports[_0xa292('0x7')]={'uniqueid':{'type':_0xa292('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xa292('0x0')},'mixmonitorid':{'type':_0xa292('0x0')}};exports[_0xa292('0x8')]={'uniqueid':{'type':_0xa292('0x0'),'required':!![]}};exports[_0xa292('0x9')]={'uniqueid':{'type':_0xa292('0x0'),'required':!![]},'exten':{'type':_0xa292('0x0'),'required':!![]},'context':{'type':_0xa292('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index d352ad6..1e8f4ce 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 _0xd103=['outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','initAgents','length','SIP/%s','agents','mergeFromDatabase','telephones','isUndefined','initTrunks','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','templates','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','isNil','interface','format','name','answered','sumHoldTime','sumDuration','isEmpty','ivrAnswerCallsDay','total','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay'];(function(_0x1988f1,_0x290a23){var _0x3c848e=function(_0x3600e7){while(--_0x3600e7){_0x1988f1['push'](_0x1988f1['shift']());}};_0x3c848e(++_0x290a23);}(_0xd103,0x1ee));var _0x3d10=function(_0x194ba5,_0x24a39a){_0x194ba5=_0x194ba5-0x0;var _0x468d21=_0xd103[_0x194ba5];return _0x468d21;};'use strict';var BPromise=require(_0x3d10('0x0'));var util=require(_0x3d10('0x1'));var _=require(_0x3d10('0x2'));var moment=require(_0x3d10('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x3d10('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x3d10('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x3d10('0x6'));var Campaign=require(_0x3d10('0x7'));var VoiceExtension=require(_0x3d10('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x3d10('0x9'));var FreshdeskAccount=require(_0x3d10('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x3d10('0xb'));var VtigerAccount=require(_0x3d10('0xc'));var ServicenowAccount=require(_0x3d10('0xd'));var Dynamics365Account=require(_0x3d10('0xe'));var FreshsalesAccount=require(_0x3d10('0xf'));var FaxAccount=require(_0x3d10('0x10'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x3d10('0x11')]={};this[_0x3d10('0x12')]={};this[_0x3d10('0x13')]={};this[_0x3d10('0x14')]={};this[_0x3d10('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0x3d10('0x16')]={};this[_0x3d10('0x17')]={};this[_0x3d10('0x18')]={};this[_0x3d10('0x19')]={};this['sugarcrmAccounts']={};this[_0x3d10('0x1a')]={};this[_0x3d10('0x1b')]={};this['deskAccounts']={};this[_0x3d10('0x1c')]={};this[_0x3d10('0x1d')]={};this[_0x3d10('0x1e')]={};this[_0x3d10('0x1f')]={};this[_0x3d10('0x20')]={};};function freeIsNotKey(_0xadc567,_0x4ee845,_0xb1bca1){var _0x471ab7=_['mapKeys'](_0xadc567,function(_0x32bac8,_0x4791ce){return _0x32bac8[_0xb1bca1];});for(var _0x359615 in _0x4ee845){if(_0x4ee845['hasOwnProperty'](_0x359615)){if(!_0x471ab7[_0x359615]){delete _0x4ee845[_0x359615];}}}}function freeIsNotKeySip(_0x2c8ffb,_0x5bdd43){var _0x306b9b=_[_0x3d10('0x21')](_0x2c8ffb,function(_0x4da797,_0x5df740){return util['format']('SIP/%s',_0x4da797['name']);});for(var _0x484953 in _0x5bdd43){if(_0x5bdd43[_0x3d10('0x22')](_0x484953)){if(!_0x306b9b[_0x484953]){delete _0x5bdd43[_0x484953];}}}}function freeIsNotKeyAgent(_0x3d148d,_0x278bda){var _0x5424b6=_['mapKeys'](_0x3d148d,function(_0x415c39,_0x427665){var _0x469f0c=_[_0x3d10('0x23')](_0x415c39[_0x3d10('0x24')])?util[_0x3d10('0x25')]('SIP/%s',_0x415c39[_0x3d10('0x26')]):_0x415c39[_0x3d10('0x24')];return _0x469f0c;});for(var _0x5dd4cc in _0x278bda){if(_0x278bda[_0x3d10('0x22')](_0x5dd4cc)){if(!_0x5424b6[_0x5dd4cc]){delete _0x278bda[_0x5dd4cc];}}}}function clearVoiceCallReports(_0x52d783){_0x52d783['total']=0x0;_0x52d783[_0x3d10('0x27')]=0x0;_0x52d783[_0x3d10('0x28')]=0x0;_0x52d783[_0x3d10('0x29')]=0x0;_0x52d783['sumBillable']=0x0;}function clearCampaigns(_0x26ad06){if(!_[_0x3d10('0x2a')](_0x26ad06)){for(var _0x4b6e8f in _0x26ad06){if(_0x26ad06[_0x3d10('0x22')](_0x4b6e8f)){_0x26ad06[_0x4b6e8f]['ivrTotalCallsDays']=0x0;_0x26ad06[_0x4b6e8f][_0x3d10('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x9605f4){if(!_[_0x3d10('0x2a')](_0x9605f4)){for(var _0x2d90e0 in _0x9605f4){if(_0x9605f4[_0x3d10('0x22')](_0x2d90e0)){_0x9605f4[_0x2d90e0][_0x3d10('0x2c')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x27')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x2d')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x2e')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x28')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x29')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x2f')]=0x0;_0x9605f4[_0x2d90e0]['outboundAnswerAgiCallsDay']=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x30')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x31')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x32')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x33')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x34')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x35')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x36')]=0x0;_0x9605f4[_0x2d90e0]['outboundBlacklistCallsDay']=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x37')]=0x0;_0x9605f4[_0x2d90e0]['outboundRejectCallsDay']=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x38')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x39')]=0x0;_0x9605f4[_0x2d90e0][_0x3d10('0x3a')]=0x0;_0x9605f4[_0x2d90e0]['queueStatusComplete']=!![];}}}}Realtime[_0x3d10('0x3b')]['mergeFromDatabase']=function(_0x4a963e,_0x661d95){for(var _0x25345d in _0x661d95){if(_0x4a963e[_0x3d10('0x22')](_0x25345d)){_0x4a963e[_0x25345d]=_0x661d95[_0x25345d];}}};Realtime[_0x3d10('0x3b')][_0x3d10('0x3c')]=function(){var _0x38aaa4=this;return function(_0x102a96){if(_0x102a96){freeIsNotKeyAgent(_0x102a96,_0x38aaa4['agents']);for(var _0x59f701=0x0,_0x34ae62={},_0x865245={};_0x59f701<_0x102a96[_0x3d10('0x3d')];_0x59f701+=0x1){_0x34ae62=_0x102a96[_0x59f701];var _0x49c7ba=_['isNil'](_0x34ae62[_0x3d10('0x24')])?util['format'](_0x3d10('0x3e'),_0x34ae62[_0x3d10('0x26')]):_0x34ae62[_0x3d10('0x24')];if(_['isUndefined'](_0x38aaa4[_0x3d10('0x3f')][_0x49c7ba])){_0x38aaa4[_0x3d10('0x3f')][_0x49c7ba]=new Agent(_0x34ae62);}else{_0x38aaa4[_0x3d10('0x40')](_0x38aaa4[_0x3d10('0x3f')][_0x49c7ba],_0x34ae62);}}}return _0x38aaa4[_0x3d10('0x3f')];};};Realtime[_0x3d10('0x3b')]['initTelephones']=function(){var _0x2d76b1=this;return function(_0x5a7219){if(_0x5a7219){freeIsNotKeySip(_0x5a7219,_0x2d76b1[_0x3d10('0x41')]);for(var _0x4cb04f=0x0,_0x184224={},_0x373fa6={};_0x4cb04f<_0x5a7219[_0x3d10('0x3d')];_0x4cb04f+=0x1){_0x184224=_0x5a7219[_0x4cb04f];if(_[_0x3d10('0x42')](_0x2d76b1['telephones'][util[_0x3d10('0x25')](_0x3d10('0x3e'),_0x184224[_0x3d10('0x26')])])){_0x2d76b1['telephones'][util[_0x3d10('0x25')](_0x3d10('0x3e'),_0x184224[_0x3d10('0x26')])]=new Telephone(_0x184224);}else{_0x2d76b1['mergeFromDatabase'](_0x2d76b1['telephones'][util['format'](_0x3d10('0x3e'),_0x184224[_0x3d10('0x26')])],_0x184224);}}}return _0x2d76b1['telephones'];};};Realtime['prototype'][_0x3d10('0x43')]=function(){var _0x490741=this;return function(_0x362d84){if(_0x362d84){freeIsNotKeySip(_0x362d84,_0x490741['trunks']);for(var _0x1ac861=0x0,_0x229811={},_0x1b3211={};_0x1ac861<_0x362d84['length'];_0x1ac861+=0x1){_0x229811=_0x362d84[_0x1ac861];if(_[_0x3d10('0x42')](_0x490741[_0x3d10('0x11')][util[_0x3d10('0x25')](_0x3d10('0x3e'),_0x229811[_0x3d10('0x26')])])){_0x490741[_0x3d10('0x11')][util[_0x3d10('0x25')]('SIP/%s',_0x229811['name'])]=new Trunk(_0x229811);}else{_0x490741[_0x3d10('0x40')](_0x490741[_0x3d10('0x11')][util[_0x3d10('0x25')]('SIP/%s',_0x229811[_0x3d10('0x26')])],_0x229811);}}}return _0x490741[_0x3d10('0x11')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x44')]=function(){var _0x4b54cf=this;return function(_0x133106){if(_0x133106){freeIsNotKey(_0x133106,_0x4b54cf[_0x3d10('0x12')],_0x3d10('0x26'));for(var _0x20f6b9=0x0,_0x560d5a={},_0x29225a={};_0x20f6b9<_0x133106[_0x3d10('0x3d')];_0x20f6b9+=0x1){_0x560d5a=_0x133106[_0x20f6b9];if(_[_0x3d10('0x42')](_0x4b54cf[_0x3d10('0x12')][_0x560d5a[_0x3d10('0x26')]])){_0x4b54cf['voiceQueues'][_0x560d5a[_0x3d10('0x26')]]=new VoiceQueue(_0x560d5a);}else{_0x4b54cf['mergeFromDatabase'](_0x4b54cf[_0x3d10('0x12')][_0x560d5a[_0x3d10('0x26')]],_0x560d5a);}}}return _0x4b54cf[_0x3d10('0x12')];};};Realtime[_0x3d10('0x3b')]['initTriggers']=function(){var _0x29ca82=this;return function(_0x244758){if(_0x244758){freeIsNotKey(_0x244758,_0x29ca82[_0x3d10('0x13')],'id');for(var _0xd9edd5=0x0,_0x5639f6={},_0x2939d2={};_0xd9edd5<_0x244758['length'];_0xd9edd5+=0x1){_0x5639f6=_0x244758[_0xd9edd5];if(_[_0x3d10('0x42')](_0x29ca82[_0x3d10('0x13')][_0x5639f6['id']])){_0x29ca82[_0x3d10('0x13')][_0x5639f6['id']]=new Trigger(_0x5639f6);}else{_0x29ca82[_0x3d10('0x40')](_0x29ca82[_0x3d10('0x13')][_0x5639f6['id']],_0x5639f6);}}}return _0x29ca82[_0x3d10('0x13')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x45')]=function(){var _0x56f06f=this;return function(_0x2a438f){if(_0x2a438f){freeIsNotKey(_0x2a438f,_0x56f06f[_0x3d10('0x15')],'id');for(var _0xbc2541=0x0,_0x499ba4={},_0x2f3cf5={};_0xbc2541<_0x2a438f[_0x3d10('0x3d')];_0xbc2541+=0x1){_0x499ba4=_0x2a438f[_0xbc2541];if(_['isUndefined'](_0x56f06f[_0x3d10('0x15')][_0x499ba4['id']])){_0x56f06f['templates'][_0x499ba4['id']]=new Template(_0x499ba4);}else{_0x56f06f[_0x3d10('0x40')](_0x56f06f[_0x3d10('0x15')][_0x499ba4['id']],_0x499ba4);}}}return _0x56f06f[_0x3d10('0x15')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x46')]=function(){var _0x41f41a=this;return function(_0x3f6eb5){if(_0x3f6eb5){freeIsNotKey(_0x3f6eb5,_0x41f41a[_0x3d10('0x18')],'id');for(var _0x5e63d5=0x0,_0xfa3f01={},_0x4d4e37={};_0x5e63d5<_0x3f6eb5[_0x3d10('0x3d')];_0x5e63d5+=0x1){_0xfa3f01=_0x3f6eb5[_0x5e63d5];if(_[_0x3d10('0x42')](_0x41f41a[_0x3d10('0x18')][_0xfa3f01['id']])){_0x41f41a[_0x3d10('0x18')][_0xfa3f01['id']]=new ZendeskAccount(_0xfa3f01);}else{_0x41f41a[_0x3d10('0x40')](_0x41f41a['zendeskAccounts'][_0xfa3f01['id']],_0xfa3f01);}}}return _0x41f41a[_0x3d10('0x18')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x47')]=function(){var _0x3c906e=this;return function(_0x13611a){if(_0x13611a){freeIsNotKey(_0x13611a,_0x3c906e[_0x3d10('0x19')],'id');for(var _0x5089a4=0x0,_0xccaede={},_0x9ec26b={};_0x5089a4<_0x13611a['length'];_0x5089a4+=0x1){_0xccaede=_0x13611a[_0x5089a4];if(_[_0x3d10('0x42')](_0x3c906e[_0x3d10('0x19')][_0xccaede['id']])){_0x3c906e[_0x3d10('0x19')][_0xccaede['id']]=new SalesforceAccount(_0xccaede);}else{_0x3c906e[_0x3d10('0x40')](_0x3c906e[_0x3d10('0x19')][_0xccaede['id']],_0xccaede);}}}return _0x3c906e[_0x3d10('0x19')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x48')]=function(){var _0x109e57=this;return function(_0x39062b){if(_0x39062b){freeIsNotKey(_0x39062b,_0x109e57[_0x3d10('0x1a')],'id');for(var _0x1b6bf5=0x0,_0x441414={},_0x5d53ed={};_0x1b6bf5<_0x39062b['length'];_0x1b6bf5+=0x1){_0x441414=_0x39062b[_0x1b6bf5];if(_[_0x3d10('0x42')](_0x109e57[_0x3d10('0x1a')][_0x441414['id']])){_0x109e57[_0x3d10('0x1a')][_0x441414['id']]=new FreshdeskAccount(_0x441414);}else{_0x109e57[_0x3d10('0x40')](_0x109e57[_0x3d10('0x1a')][_0x441414['id']],_0x441414);}}}return _0x109e57[_0x3d10('0x1a')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x49')]=function(){var _0x2a49d1=this;return function(_0x2a062e){if(_0x2a062e){freeIsNotKey(_0x2a062e,_0x2a49d1[_0x3d10('0x1b')],'id');for(var _0x413330=0x0,_0x4d58f1={},_0xc0933a={};_0x413330<_0x2a062e[_0x3d10('0x3d')];_0x413330+=0x1){_0x4d58f1=_0x2a062e[_0x413330];if(_['isUndefined'](_0x2a49d1[_0x3d10('0x1b')][_0x4d58f1['id']])){_0x2a49d1['zohoAccounts'][_0x4d58f1['id']]=new ZohoAccount(_0x4d58f1);}else{_0x2a49d1[_0x3d10('0x40')](_0x2a49d1[_0x3d10('0x1b')][_0x4d58f1['id']],_0x4d58f1);}}}return _0x2a49d1[_0x3d10('0x1b')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x4a')]=function(){var _0x2d0a40=this;return function(_0x311e21){if(_0x311e21){freeIsNotKey(_0x311e21,_0x2d0a40[_0x3d10('0x4b')],'id');for(var _0x2c798b=0x0,_0x63f6f5={},_0x47d561={};_0x2c798b<_0x311e21[_0x3d10('0x3d')];_0x2c798b+=0x1){_0x63f6f5=_0x311e21[_0x2c798b];if(_[_0x3d10('0x42')](_0x2d0a40['deskAccounts'][_0x63f6f5['id']])){_0x2d0a40[_0x3d10('0x4b')][_0x63f6f5['id']]=new DeskAccount(_0x63f6f5);}else{_0x2d0a40['mergeFromDatabase'](_0x2d0a40[_0x3d10('0x4b')][_0x63f6f5['id']],_0x63f6f5);}}}return _0x2d0a40['deskAccounts'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x4c')]=function(){var _0x5b4d9c=this;return function(_0x454857){if(_0x454857){freeIsNotKey(_0x454857,_0x5b4d9c['sugarcrmAccounts'],'id');for(var _0x5af0c7=0x0,_0x2feb13={},_0x27f33b={};_0x5af0c7<_0x454857[_0x3d10('0x3d')];_0x5af0c7+=0x1){_0x2feb13=_0x454857[_0x5af0c7];if(_['isUndefined'](_0x5b4d9c['sugarcrmAccounts'][_0x2feb13['id']])){_0x5b4d9c[_0x3d10('0x4d')][_0x2feb13['id']]=new SugarcrmAccount(_0x2feb13);}else{_0x5b4d9c[_0x3d10('0x40')](_0x5b4d9c[_0x3d10('0x4d')][_0x2feb13['id']],_0x2feb13);}}}return _0x5b4d9c[_0x3d10('0x4d')];};};Realtime['prototype'][_0x3d10('0x4e')]=function(){var _0x1fc72b=this;return function(_0x586cb6){if(_0x586cb6){freeIsNotKey(_0x586cb6,_0x1fc72b[_0x3d10('0x1c')],'id');for(var _0x42d7d0=0x0,_0x3735ea={},_0x335b4c={};_0x42d7d0<_0x586cb6[_0x3d10('0x3d')];_0x42d7d0+=0x1){_0x3735ea=_0x586cb6[_0x42d7d0];if(_[_0x3d10('0x42')](_0x1fc72b[_0x3d10('0x1c')][_0x3735ea['id']])){_0x1fc72b[_0x3d10('0x1c')][_0x3735ea['id']]=new VtigerAccount(_0x3735ea);}else{_0x1fc72b['mergeFromDatabase'](_0x1fc72b[_0x3d10('0x1c')][_0x3735ea['id']],_0x3735ea);}}}return _0x1fc72b[_0x3d10('0x1c')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x4f')]=function(){var _0x130f57=this;return function(_0x191960){if(_0x191960){freeIsNotKey(_0x191960,_0x130f57[_0x3d10('0x1d')],'id');for(var _0x47e550=0x0,_0x28a1d6={},_0x17b83f={};_0x47e550<_0x191960[_0x3d10('0x3d')];_0x47e550+=0x1){_0x28a1d6=_0x191960[_0x47e550];if(_[_0x3d10('0x42')](_0x130f57[_0x3d10('0x1d')][_0x28a1d6['id']])){_0x130f57['servicenowAccounts'][_0x28a1d6['id']]=new ServicenowAccount(_0x28a1d6);}else{_0x130f57['mergeFromDatabase'](_0x130f57['servicenowAccounts'][_0x28a1d6['id']],_0x28a1d6);}}}return _0x130f57[_0x3d10('0x1d')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x50')]=function(){var _0x276f8a=this;return function(_0x3d1cc4){if(_0x3d1cc4){freeIsNotKey(_0x3d1cc4,_0x276f8a['dynamics365Accounts'],'id');for(var _0x9c13c0=0x0,_0x2f4a33={},_0x5dd519={};_0x9c13c0<_0x3d1cc4['length'];_0x9c13c0+=0x1){_0x2f4a33=_0x3d1cc4[_0x9c13c0];if(_['isUndefined'](_0x276f8a[_0x3d10('0x1e')][_0x2f4a33['id']])){_0x276f8a[_0x3d10('0x1e')][_0x2f4a33['id']]=new Dynamics365Account(_0x2f4a33);}else{_0x276f8a[_0x3d10('0x40')](_0x276f8a[_0x3d10('0x1e')][_0x2f4a33['id']],_0x2f4a33);}}}return _0x276f8a['dynamics365Accounts'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x51')]=function(){var _0x431797=this;return function(_0x2461fa){if(_0x2461fa){freeIsNotKey(_0x2461fa,_0x431797[_0x3d10('0x1f')],'id');for(var _0x5d22f9=0x0,_0xf8b22a={},_0x46691d={};_0x5d22f9<_0x2461fa['length'];_0x5d22f9+=0x1){_0xf8b22a=_0x2461fa[_0x5d22f9];if(_[_0x3d10('0x42')](_0x431797[_0x3d10('0x1f')][_0xf8b22a['id']])){_0x431797[_0x3d10('0x1f')][_0xf8b22a['id']]=new FreshsalesAccount(_0xf8b22a);}else{_0x431797['mergeFromDatabase'](_0x431797[_0x3d10('0x1f')][_0xf8b22a['id']],_0xf8b22a);}}}return _0x431797[_0x3d10('0x1f')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x52')]=function(){var _0x160f32=this;return function(_0x173759){for(var _0x51d476=0x0;_0x51d476<_0x173759['length'];_0x51d476+=0x1){_[_0x3d10('0x53')](_0x160f32['voiceQueues'][_0x173759[_0x51d476]['name']],_0x173759[_0x51d476]);}return _0x160f32['voiceQueues'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x54')]=function(){var _0x3a33c7=this;return function(_0x2b2d59){clearVoiceQueues(_0x3a33c7[_0x3d10('0x12')]);if(_0x2b2d59){_0x2b2d59=_[_0x3d10('0x55')](_0x2b2d59,_0x3d10('0x56'));for(var _0x7c3a64 in _0x2b2d59){if(_0x2b2d59[_0x3d10('0x22')](_0x7c3a64)){var _0x174285={};for(var _0x1251c6=0x0;_0x1251c6<_0x2b2d59[_0x7c3a64][_0x3d10('0x3d')];_0x1251c6+=0x1){var _0x2a78ac=_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x57')];if(_0x3a33c7[_0x3d10('0x12')][_0x2a78ac]){if(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x58')]){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2d')]+=0x1;}if(_0x2b2d59[_0x7c3a64][_0x1251c6]['queuecallerabandon']){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2e')]+=0x1;}_0x3a33c7['voiceQueues'][_0x2a78ac]['sumHoldTime']+=moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x59')])['diff'](moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5a')]),_0x3d10('0x5b'))||0x0;if(_0x1251c6===_0x2b2d59[_0x7c3a64][_0x3d10('0x3d')]-0x1){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x29')]+=moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5c')]||_0x2b2d59[_0x7c3a64][_0x1251c6]['queuecallerabandonAt']||_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5d')])[_0x3d10('0x5e')](moment(_0x2b2d59[_0x7c3a64][_0x1251c6]['queuecallerjoinAt']),_0x3d10('0x5b'))||0x0;_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2c')]+=0x1;if(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5f')]){_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x27')]+=0x1;_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x2f')]+=moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x5c')])['diff'](moment(_0x2b2d59[_0x7c3a64][_0x1251c6][_0x3d10('0x59')]),'seconds')||0x0;}}else{_0x3a33c7[_0x3d10('0x12')][_0x2a78ac][_0x3d10('0x29')]+=_0x3a33c7[_0x3d10('0x12')][_0x2a78ac]['sumHoldTime']||0x0;}}}}}}return _0x3a33c7[_0x3d10('0x12')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x60')]=function(){var _0x26b187=this;return function(_0x2a35f8){clearVoiceCallReports(_0x26b187[_0x3d10('0x61')]);if(_0x2a35f8){for(var _0x10b70b=0x0;_0x10b70b<_0x2a35f8[_0x3d10('0x3d')];_0x10b70b+=0x1){_0x26b187[_0x3d10('0x61')][_0x3d10('0x2c')]+=0x1;_0x26b187[_0x3d10('0x61')][_0x3d10('0x29')]+=_0x2a35f8[_0x10b70b][_0x3d10('0x62')];if(_0x2a35f8[_0x10b70b][_0x3d10('0x63')]===_0x3d10('0x64')){_0x26b187['outbound']['answered']+=0x1;_0x26b187[_0x3d10('0x61')][_0x3d10('0x28')]+=_0x2a35f8[_0x10b70b][_0x3d10('0x62')]-_0x2a35f8[_0x10b70b][_0x3d10('0x65')]||0x0;_0x26b187[_0x3d10('0x61')]['sumBillable']+=_0x2a35f8[_0x10b70b][_0x3d10('0x65')];}}}return _0x26b187[_0x3d10('0x61')];};};Realtime['prototype'][_0x3d10('0x66')]=function(){var _0x35dc44=this;return function(_0x1ac1e5){if(_0x1ac1e5){freeIsNotKey(_0x1ac1e5,_0x35dc44[_0x3d10('0x14')],'name');for(var _0x5ac851=0x0,_0x1d05dc={};_0x5ac851<_0x1ac1e5[_0x3d10('0x3d')];_0x5ac851+=0x1){_0x1d05dc=_0x1ac1e5[_0x5ac851];if(_[_0x3d10('0x42')](_0x35dc44['campaigns'][_0x1d05dc[_0x3d10('0x26')]])){_0x35dc44[_0x3d10('0x14')][_0x1d05dc[_0x3d10('0x26')]]=new Campaign(_0x1d05dc);}else{_0x35dc44[_0x3d10('0x40')](_0x35dc44['campaigns'][_0x1d05dc[_0x3d10('0x26')]],_0x1d05dc);_0x35dc44['campaigns'][_0x1d05dc[_0x3d10('0x26')]][_0x3d10('0x67')]=_0x1d05dc[_0x3d10('0x68')]?_0x1d05dc[_0x3d10('0x68')][_0x3d10('0x26')]:undefined;}}}return _0x35dc44['campaigns'];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x69')]=function(){var _0x4ccf2f=this;return function(_0x3a39d3){if(_0x3a39d3){freeIsNotKey(_0x3a39d3,_0x4ccf2f[_0x3d10('0x6a')],'id');for(var _0x70c0c8=0x0,_0x3e311b={};_0x70c0c8<_0x3a39d3[_0x3d10('0x3d')];_0x70c0c8+=0x1){_0x3e311b=_0x3a39d3[_0x70c0c8];if(_[_0x3d10('0x42')](_0x4ccf2f[_0x3d10('0x6a')][_0x3e311b['id']])){_0x4ccf2f[_0x3d10('0x6a')][_0x3e311b['id']]=new VoiceExtension(_0x3e311b);}else{_0x4ccf2f[_0x3d10('0x40')](_0x4ccf2f[_0x3d10('0x6a')][_0x3e311b['id']],_0x3e311b);}}}return _0x4ccf2f[_0x3d10('0x6a')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x6b')]=function(){var _0x21bd51=this;return function(_0x30dd91){clearCampaigns(_0x21bd51['campaigns']);for(var _0x547dc4=0x0;_0x547dc4<_0x30dd91[_0x3d10('0x3d')];_0x547dc4+=0x1){_[_0x3d10('0x53')](_0x21bd51[_0x3d10('0x14')][_0x30dd91[_0x547dc4][_0x3d10('0x26')]],_0x30dd91[_0x547dc4]);}return _0x21bd51[_0x3d10('0x14')];};};Realtime[_0x3d10('0x3b')][_0x3d10('0x6c')]=function(){var _0x2ccd0b=this;return function(_0x430e1d){if(_0x430e1d){freeIsNotKey(_0x430e1d,_0x2ccd0b[_0x3d10('0x20')],'id');for(var _0x29828b=0x0,_0x2776e4={},_0x388b23={};_0x29828b<_0x430e1d[_0x3d10('0x3d')];_0x29828b+=0x1){_0x2776e4=_0x430e1d[_0x29828b];if(_[_0x3d10('0x42')](_0x2ccd0b[_0x3d10('0x20')][_0x2776e4['id']])){_0x2ccd0b['faxAccounts'][_0x2776e4['id']]=new FaxAccount(_0x2776e4);}else{_0x2ccd0b['mergeFromDatabase'](_0x2ccd0b[_0x3d10('0x20')][_0x2776e4['id']],_0x2776e4);}}}return _0x2ccd0b[_0x3d10('0x20')];};};module[_0x3d10('0x6d')]=Realtime; \ No newline at end of file +var _0x5549=['sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','interface','sumBillable','isEmpty','ivrAnswerCallsDay','total','unmanaged','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','format','isUndefined','initTelephones','telephones','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','sumHoldTime','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','merge','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts'];(function(_0x1a3a9c,_0x4d1ad7){var _0xe1dd66=function(_0x1f1940){while(--_0x1f1940){_0x1a3a9c['push'](_0x1a3a9c['shift']());}};_0xe1dd66(++_0x4d1ad7);}(_0x5549,0x189));var _0x9554=function(_0x4b87ac,_0x444329){_0x4b87ac=_0x4b87ac-0x0;var _0x58d529=_0x5549[_0x4b87ac];return _0x58d529;};'use strict';var BPromise=require(_0x9554('0x0'));var util=require(_0x9554('0x1'));var _=require(_0x9554('0x2'));var moment=require('moment');var Agent=require(_0x9554('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x9554('0x4'));var VoiceQueue=require(_0x9554('0x5'));var Trigger=require(_0x9554('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x9554('0x7'));var ZendeskAccount=require(_0x9554('0x8'));var SalesforceAccount=require(_0x9554('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x9554('0xa'));var ZohoAccount=require(_0x9554('0xb'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x9554('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x9554('0xd'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x9554('0xe'));var Realtime=function(){this[_0x9554('0xf')]={};this['telephones']={};this[_0x9554('0x10')]={};this[_0x9554('0x11')]={};this['triggers']={};this[_0x9554('0x12')]={};this[_0x9554('0x13')]={};this[_0x9554('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9554('0x15')]={};this[_0x9554('0x16')]={};this['queueChannels']={};this[_0x9554('0x17')]={};this['timers']={};this[_0x9554('0x18')]={};this[_0x9554('0x19')]={};this[_0x9554('0x1a')]={};this[_0x9554('0x1b')]={};this['freshdeskAccounts']={};this[_0x9554('0x1c')]={};this['deskAccounts']={};this[_0x9554('0x1d')]={};this[_0x9554('0x1e')]={};this['dynamics365Accounts']={};this[_0x9554('0x1f')]={};this[_0x9554('0x20')]={};};function freeIsNotKey(_0x413064,_0x36886d,_0x2c3341){var _0x1fa3b6=_['mapKeys'](_0x413064,function(_0x305b2e,_0x4296fa){return _0x305b2e[_0x2c3341];});for(var _0x77a3d5 in _0x36886d){if(_0x36886d['hasOwnProperty'](_0x77a3d5)){if(!_0x1fa3b6[_0x77a3d5]){delete _0x36886d[_0x77a3d5];}}}}function freeIsNotKeySip(_0x3313fb,_0x5d3b64){var _0x2c8842=_[_0x9554('0x21')](_0x3313fb,function(_0x940dec,_0x2382c5){return util['format'](_0x9554('0x22'),_0x940dec[_0x9554('0x23')]);});for(var _0x33c32d in _0x5d3b64){if(_0x5d3b64[_0x9554('0x24')](_0x33c32d)){if(!_0x2c8842[_0x33c32d]){delete _0x5d3b64[_0x33c32d];}}}}function freeIsNotKeyAgent(_0x2feaf8,_0x508696){var _0x3fa888=_['mapKeys'](_0x2feaf8,function(_0x5e15be,_0xa9a4a5){var _0x37eb90=_[_0x9554('0x25')](_0x5e15be[_0x9554('0x26')])?util['format']('SIP/%s',_0x5e15be[_0x9554('0x23')]):_0x5e15be[_0x9554('0x26')];return _0x37eb90;});for(var _0x49a4f2 in _0x508696){if(_0x508696[_0x9554('0x24')](_0x49a4f2)){if(!_0x3fa888[_0x49a4f2]){delete _0x508696[_0x49a4f2];}}}}function clearVoiceCallReports(_0x1a7c89){_0x1a7c89['total']=0x0;_0x1a7c89['answered']=0x0;_0x1a7c89['sumHoldTime']=0x0;_0x1a7c89['sumDuration']=0x0;_0x1a7c89[_0x9554('0x27')]=0x0;}function clearCampaigns(_0x4c80a2){if(!_[_0x9554('0x28')](_0x4c80a2)){for(var _0x38dd74 in _0x4c80a2){if(_0x4c80a2[_0x9554('0x24')](_0x38dd74)){_0x4c80a2[_0x38dd74]['ivrTotalCallsDays']=0x0;_0x4c80a2[_0x38dd74][_0x9554('0x29')]=0x0;}}}}function clearVoiceQueues(_0x2765ef){if(!_['isEmpty'](_0x2765ef)){for(var _0x216926 in _0x2765ef){if(_0x2765ef['hasOwnProperty'](_0x216926)){_0x2765ef[_0x216926][_0x9554('0x2a')]=0x0;_0x2765ef[_0x216926]['answered']=0x0;_0x2765ef[_0x216926][_0x9554('0x2b')]=0x0;_0x2765ef[_0x216926]['abandoned']=0x0;_0x2765ef[_0x216926]['sumHoldTime']=0x0;_0x2765ef[_0x216926][_0x9554('0x2c')]=0x0;_0x2765ef[_0x216926]['sumBillable']=0x0;_0x2765ef[_0x216926][_0x9554('0x2d')]=0x0;_0x2765ef[_0x216926][_0x9554('0x2e')]=0x0;_0x2765ef[_0x216926][_0x9554('0x2f')]=0x0;_0x2765ef[_0x216926][_0x9554('0x30')]=0x0;_0x2765ef[_0x216926]['outboundNoSuchCallsDay']=0x0;_0x2765ef[_0x216926][_0x9554('0x31')]=0x0;_0x2765ef[_0x216926][_0x9554('0x32')]=0x0;_0x2765ef[_0x216926]['outboundDropCallsDayCallersExit']=0x0;_0x2765ef[_0x216926][_0x9554('0x33')]=0x0;_0x2765ef[_0x216926][_0x9554('0x34')]=0x0;_0x2765ef[_0x216926][_0x9554('0x35')]=0x0;_0x2765ef[_0x216926][_0x9554('0x36')]=0x0;_0x2765ef[_0x216926][_0x9554('0x2d')]=0x0;_0x2765ef[_0x216926]['outboundAnswerCallsDay']=0x0;_0x2765ef[_0x216926][_0x9554('0x37')]=!![];}}}}Realtime[_0x9554('0x38')][_0x9554('0x39')]=function(_0x383fd8,_0x48c69a){for(var _0x4b14f3 in _0x48c69a){if(_0x383fd8[_0x9554('0x24')](_0x4b14f3)){_0x383fd8[_0x4b14f3]=_0x48c69a[_0x4b14f3];}}};Realtime[_0x9554('0x38')][_0x9554('0x3a')]=function(){var _0x8b7977=this;return function(_0x5d4e70){if(_0x5d4e70){freeIsNotKeyAgent(_0x5d4e70,_0x8b7977[_0x9554('0xf')]);for(var _0x239185=0x0,_0x58c69e={},_0x417ca3={};_0x239185<_0x5d4e70[_0x9554('0x3b')];_0x239185+=0x1){_0x58c69e=_0x5d4e70[_0x239185];var _0xace21d=_[_0x9554('0x25')](_0x58c69e[_0x9554('0x26')])?util[_0x9554('0x3c')](_0x9554('0x22'),_0x58c69e[_0x9554('0x23')]):_0x58c69e['interface'];if(_[_0x9554('0x3d')](_0x8b7977['agents'][_0xace21d])){_0x8b7977[_0x9554('0xf')][_0xace21d]=new Agent(_0x58c69e);}else{_0x8b7977['mergeFromDatabase'](_0x8b7977['agents'][_0xace21d],_0x58c69e);}}}return _0x8b7977[_0x9554('0xf')];};};Realtime['prototype'][_0x9554('0x3e')]=function(){var _0x38f1c0=this;return function(_0x325b1e){if(_0x325b1e){freeIsNotKeySip(_0x325b1e,_0x38f1c0['telephones']);for(var _0x48a27f=0x0,_0x4576c3={},_0x3b604c={};_0x48a27f<_0x325b1e[_0x9554('0x3b')];_0x48a27f+=0x1){_0x4576c3=_0x325b1e[_0x48a27f];if(_[_0x9554('0x3d')](_0x38f1c0[_0x9554('0x3f')][util[_0x9554('0x3c')](_0x9554('0x22'),_0x4576c3[_0x9554('0x23')])])){_0x38f1c0['telephones'][util[_0x9554('0x3c')]('SIP/%s',_0x4576c3['name'])]=new Telephone(_0x4576c3);}else{_0x38f1c0['mergeFromDatabase'](_0x38f1c0[_0x9554('0x3f')][util[_0x9554('0x3c')](_0x9554('0x22'),_0x4576c3['name'])],_0x4576c3);}}}return _0x38f1c0[_0x9554('0x3f')];};};Realtime['prototype']['initTrunks']=function(){var _0xb6e0cb=this;return function(_0x284c14){if(_0x284c14){freeIsNotKeySip(_0x284c14,_0xb6e0cb[_0x9554('0x10')]);for(var _0x33271e=0x0,_0x14f137={},_0x39ee08={};_0x33271e<_0x284c14[_0x9554('0x3b')];_0x33271e+=0x1){_0x14f137=_0x284c14[_0x33271e];if(_[_0x9554('0x3d')](_0xb6e0cb[_0x9554('0x10')][util[_0x9554('0x3c')](_0x9554('0x22'),_0x14f137['name'])])){_0xb6e0cb[_0x9554('0x10')][util[_0x9554('0x3c')](_0x9554('0x22'),_0x14f137[_0x9554('0x23')])]=new Trunk(_0x14f137);}else{_0xb6e0cb[_0x9554('0x39')](_0xb6e0cb[_0x9554('0x10')][util[_0x9554('0x3c')](_0x9554('0x22'),_0x14f137[_0x9554('0x23')])],_0x14f137);}}}return _0xb6e0cb[_0x9554('0x10')];};};Realtime[_0x9554('0x38')][_0x9554('0x40')]=function(){var _0x5a6012=this;return function(_0x425824){if(_0x425824){freeIsNotKey(_0x425824,_0x5a6012[_0x9554('0x11')],_0x9554('0x23'));for(var _0x315287=0x0,_0x514311={},_0x2efdb9={};_0x315287<_0x425824[_0x9554('0x3b')];_0x315287+=0x1){_0x514311=_0x425824[_0x315287];if(_[_0x9554('0x3d')](_0x5a6012[_0x9554('0x11')][_0x514311[_0x9554('0x23')]])){_0x5a6012[_0x9554('0x11')][_0x514311[_0x9554('0x23')]]=new VoiceQueue(_0x514311);}else{_0x5a6012[_0x9554('0x39')](_0x5a6012[_0x9554('0x11')][_0x514311[_0x9554('0x23')]],_0x514311);}}}return _0x5a6012[_0x9554('0x11')];};};Realtime[_0x9554('0x38')][_0x9554('0x41')]=function(){var _0x481a2d=this;return function(_0x3e6de1){if(_0x3e6de1){freeIsNotKey(_0x3e6de1,_0x481a2d[_0x9554('0x42')],'id');for(var _0xcb06e7=0x0,_0x2b9215={},_0x20bb6f={};_0xcb06e7<_0x3e6de1['length'];_0xcb06e7+=0x1){_0x2b9215=_0x3e6de1[_0xcb06e7];if(_[_0x9554('0x3d')](_0x481a2d[_0x9554('0x42')][_0x2b9215['id']])){_0x481a2d[_0x9554('0x42')][_0x2b9215['id']]=new Trigger(_0x2b9215);}else{_0x481a2d['mergeFromDatabase'](_0x481a2d[_0x9554('0x42')][_0x2b9215['id']],_0x2b9215);}}}return _0x481a2d[_0x9554('0x42')];};};Realtime['prototype'][_0x9554('0x43')]=function(){var _0x34789e=this;return function(_0x5ef888){if(_0x5ef888){freeIsNotKey(_0x5ef888,_0x34789e[_0x9554('0x13')],'id');for(var _0xa45b67=0x0,_0x3ac1cd={},_0x336f3a={};_0xa45b67<_0x5ef888[_0x9554('0x3b')];_0xa45b67+=0x1){_0x3ac1cd=_0x5ef888[_0xa45b67];if(_[_0x9554('0x3d')](_0x34789e[_0x9554('0x13')][_0x3ac1cd['id']])){_0x34789e['templates'][_0x3ac1cd['id']]=new Template(_0x3ac1cd);}else{_0x34789e[_0x9554('0x39')](_0x34789e[_0x9554('0x13')][_0x3ac1cd['id']],_0x3ac1cd);}}}return _0x34789e[_0x9554('0x13')];};};Realtime[_0x9554('0x38')][_0x9554('0x44')]=function(){var _0x604227=this;return function(_0x4601c5){if(_0x4601c5){freeIsNotKey(_0x4601c5,_0x604227[_0x9554('0x19')],'id');for(var _0x5d56d5=0x0,_0x27abad={},_0x4664d7={};_0x5d56d5<_0x4601c5[_0x9554('0x3b')];_0x5d56d5+=0x1){_0x27abad=_0x4601c5[_0x5d56d5];if(_[_0x9554('0x3d')](_0x604227[_0x9554('0x19')][_0x27abad['id']])){_0x604227['zendeskAccounts'][_0x27abad['id']]=new ZendeskAccount(_0x27abad);}else{_0x604227[_0x9554('0x39')](_0x604227[_0x9554('0x19')][_0x27abad['id']],_0x27abad);}}}return _0x604227[_0x9554('0x19')];};};Realtime[_0x9554('0x38')]['initSalesforceAccounts']=function(){var _0x107d7e=this;return function(_0x4effc3){if(_0x4effc3){freeIsNotKey(_0x4effc3,_0x107d7e[_0x9554('0x1a')],'id');for(var _0x1c6021=0x0,_0x582fe0={},_0x53cea8={};_0x1c6021<_0x4effc3[_0x9554('0x3b')];_0x1c6021+=0x1){_0x582fe0=_0x4effc3[_0x1c6021];if(_['isUndefined'](_0x107d7e[_0x9554('0x1a')][_0x582fe0['id']])){_0x107d7e[_0x9554('0x1a')][_0x582fe0['id']]=new SalesforceAccount(_0x582fe0);}else{_0x107d7e['mergeFromDatabase'](_0x107d7e[_0x9554('0x1a')][_0x582fe0['id']],_0x582fe0);}}}return _0x107d7e[_0x9554('0x1a')];};};Realtime['prototype'][_0x9554('0x45')]=function(){var _0x44e584=this;return function(_0xe57b2a){if(_0xe57b2a){freeIsNotKey(_0xe57b2a,_0x44e584[_0x9554('0x46')],'id');for(var _0x523a1e=0x0,_0x9e933b={},_0x3424ac={};_0x523a1e<_0xe57b2a[_0x9554('0x3b')];_0x523a1e+=0x1){_0x9e933b=_0xe57b2a[_0x523a1e];if(_['isUndefined'](_0x44e584[_0x9554('0x46')][_0x9e933b['id']])){_0x44e584[_0x9554('0x46')][_0x9e933b['id']]=new FreshdeskAccount(_0x9e933b);}else{_0x44e584['mergeFromDatabase'](_0x44e584[_0x9554('0x46')][_0x9e933b['id']],_0x9e933b);}}}return _0x44e584[_0x9554('0x46')];};};Realtime[_0x9554('0x38')][_0x9554('0x47')]=function(){var _0x5a455c=this;return function(_0xdad72d){if(_0xdad72d){freeIsNotKey(_0xdad72d,_0x5a455c['zohoAccounts'],'id');for(var _0x3f0e09=0x0,_0x271535={},_0x3685b1={};_0x3f0e09<_0xdad72d[_0x9554('0x3b')];_0x3f0e09+=0x1){_0x271535=_0xdad72d[_0x3f0e09];if(_[_0x9554('0x3d')](_0x5a455c[_0x9554('0x1c')][_0x271535['id']])){_0x5a455c[_0x9554('0x1c')][_0x271535['id']]=new ZohoAccount(_0x271535);}else{_0x5a455c[_0x9554('0x39')](_0x5a455c[_0x9554('0x1c')][_0x271535['id']],_0x271535);}}}return _0x5a455c['zohoAccounts'];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x483fc1=this;return function(_0x13cbae){if(_0x13cbae){freeIsNotKey(_0x13cbae,_0x483fc1['deskAccounts'],'id');for(var _0x2fcc09=0x0,_0x3db450={},_0x55b514={};_0x2fcc09<_0x13cbae['length'];_0x2fcc09+=0x1){_0x3db450=_0x13cbae[_0x2fcc09];if(_[_0x9554('0x3d')](_0x483fc1[_0x9554('0x48')][_0x3db450['id']])){_0x483fc1[_0x9554('0x48')][_0x3db450['id']]=new DeskAccount(_0x3db450);}else{_0x483fc1[_0x9554('0x39')](_0x483fc1[_0x9554('0x48')][_0x3db450['id']],_0x3db450);}}}return _0x483fc1[_0x9554('0x48')];};};Realtime[_0x9554('0x38')]['initSugarcrmAccounts']=function(){var _0x3e5ae3=this;return function(_0xcb99af){if(_0xcb99af){freeIsNotKey(_0xcb99af,_0x3e5ae3[_0x9554('0x1b')],'id');for(var _0x42daf8=0x0,_0x10a0e8={},_0x5b7b95={};_0x42daf8<_0xcb99af[_0x9554('0x3b')];_0x42daf8+=0x1){_0x10a0e8=_0xcb99af[_0x42daf8];if(_[_0x9554('0x3d')](_0x3e5ae3[_0x9554('0x1b')][_0x10a0e8['id']])){_0x3e5ae3[_0x9554('0x1b')][_0x10a0e8['id']]=new SugarcrmAccount(_0x10a0e8);}else{_0x3e5ae3['mergeFromDatabase'](_0x3e5ae3[_0x9554('0x1b')][_0x10a0e8['id']],_0x10a0e8);}}}return _0x3e5ae3[_0x9554('0x1b')];};};Realtime[_0x9554('0x38')][_0x9554('0x49')]=function(){var _0xe7c8d=this;return function(_0x8bb856){if(_0x8bb856){freeIsNotKey(_0x8bb856,_0xe7c8d['vtigerAccounts'],'id');for(var _0x219b7f=0x0,_0x1d40c2={},_0x2bba5f={};_0x219b7f<_0x8bb856['length'];_0x219b7f+=0x1){_0x1d40c2=_0x8bb856[_0x219b7f];if(_[_0x9554('0x3d')](_0xe7c8d[_0x9554('0x1d')][_0x1d40c2['id']])){_0xe7c8d['vtigerAccounts'][_0x1d40c2['id']]=new VtigerAccount(_0x1d40c2);}else{_0xe7c8d[_0x9554('0x39')](_0xe7c8d[_0x9554('0x1d')][_0x1d40c2['id']],_0x1d40c2);}}}return _0xe7c8d[_0x9554('0x1d')];};};Realtime[_0x9554('0x38')][_0x9554('0x4a')]=function(){var _0x2fd4c1=this;return function(_0x2f557e){if(_0x2f557e){freeIsNotKey(_0x2f557e,_0x2fd4c1[_0x9554('0x1e')],'id');for(var _0x2c8334=0x0,_0x23daf9={},_0x144aee={};_0x2c8334<_0x2f557e[_0x9554('0x3b')];_0x2c8334+=0x1){_0x23daf9=_0x2f557e[_0x2c8334];if(_[_0x9554('0x3d')](_0x2fd4c1[_0x9554('0x1e')][_0x23daf9['id']])){_0x2fd4c1[_0x9554('0x1e')][_0x23daf9['id']]=new ServicenowAccount(_0x23daf9);}else{_0x2fd4c1[_0x9554('0x39')](_0x2fd4c1[_0x9554('0x1e')][_0x23daf9['id']],_0x23daf9);}}}return _0x2fd4c1[_0x9554('0x1e')];};};Realtime[_0x9554('0x38')][_0x9554('0x4b')]=function(){var _0x4aa769=this;return function(_0x497f6a){if(_0x497f6a){freeIsNotKey(_0x497f6a,_0x4aa769['dynamics365Accounts'],'id');for(var _0x177c2f=0x0,_0x5da89f={},_0x3bff25={};_0x177c2f<_0x497f6a[_0x9554('0x3b')];_0x177c2f+=0x1){_0x5da89f=_0x497f6a[_0x177c2f];if(_[_0x9554('0x3d')](_0x4aa769[_0x9554('0x4c')][_0x5da89f['id']])){_0x4aa769[_0x9554('0x4c')][_0x5da89f['id']]=new Dynamics365Account(_0x5da89f);}else{_0x4aa769[_0x9554('0x39')](_0x4aa769['dynamics365Accounts'][_0x5da89f['id']],_0x5da89f);}}}return _0x4aa769[_0x9554('0x4c')];};};Realtime[_0x9554('0x38')][_0x9554('0x4d')]=function(){var _0x27d9cd=this;return function(_0x27d237){if(_0x27d237){freeIsNotKey(_0x27d237,_0x27d9cd[_0x9554('0x1f')],'id');for(var _0x405d1b=0x0,_0x318c88={},_0x661432={};_0x405d1b<_0x27d237[_0x9554('0x3b')];_0x405d1b+=0x1){_0x318c88=_0x27d237[_0x405d1b];if(_[_0x9554('0x3d')](_0x27d9cd[_0x9554('0x1f')][_0x318c88['id']])){_0x27d9cd['freshsalesAccounts'][_0x318c88['id']]=new FreshsalesAccount(_0x318c88);}else{_0x27d9cd['mergeFromDatabase'](_0x27d9cd[_0x9554('0x1f')][_0x318c88['id']],_0x318c88);}}}return _0x27d9cd[_0x9554('0x1f')];};};Realtime[_0x9554('0x38')][_0x9554('0x4e')]=function(){var _0x4b2e77=this;return function(_0x536f6f){for(var _0x30207f=0x0;_0x30207f<_0x536f6f['length'];_0x30207f+=0x1){_['merge'](_0x4b2e77['voiceQueues'][_0x536f6f[_0x30207f][_0x9554('0x23')]],_0x536f6f[_0x30207f]);}return _0x4b2e77[_0x9554('0x11')];};};Realtime[_0x9554('0x38')][_0x9554('0x4f')]=function(){var _0x5691a2=this;return function(_0x48d672){clearVoiceQueues(_0x5691a2[_0x9554('0x11')]);if(_0x48d672){_0x48d672=_[_0x9554('0x50')](_0x48d672,_0x9554('0x51'));for(var _0x11aa9a in _0x48d672){if(_0x48d672[_0x9554('0x24')](_0x11aa9a)){var _0x50b78b={};for(var _0x5a60ed=0x0;_0x5a60ed<_0x48d672[_0x11aa9a][_0x9554('0x3b')];_0x5a60ed+=0x1){var _0x357f19=_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x52')];if(_0x5691a2[_0x9554('0x11')][_0x357f19]){if(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x53')]){_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x2b')]+=0x1;}if(_0x48d672[_0x11aa9a][_0x5a60ed]['queuecallerabandon']){_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x54')]+=0x1;}_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x55')]+=moment(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x56')])[_0x9554('0x57')](moment(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x58')]),_0x9554('0x59'))||0x0;if(_0x5a60ed===_0x48d672[_0x11aa9a][_0x9554('0x3b')]-0x1){_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x2c')]+=moment(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x5a')]||_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x5b')]||_0x48d672[_0x11aa9a][_0x5a60ed]['queuecallerexitAt'])['diff'](moment(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x58')]),'seconds')||0x0;_0x5691a2['voiceQueues'][_0x357f19][_0x9554('0x2a')]+=0x1;if(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x5c')]){_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x5d')]+=0x1;_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x27')]+=moment(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x5a')])[_0x9554('0x57')](moment(_0x48d672[_0x11aa9a][_0x5a60ed][_0x9554('0x56')]),'seconds')||0x0;}}else{_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x2c')]+=_0x5691a2[_0x9554('0x11')][_0x357f19][_0x9554('0x55')]||0x0;}}}}}}return _0x5691a2[_0x9554('0x11')];};};Realtime[_0x9554('0x38')][_0x9554('0x5e')]=function(){var _0x1d2e7e=this;return function(_0x7c8099){clearVoiceCallReports(_0x1d2e7e[_0x9554('0x14')]);if(_0x7c8099){for(var _0x348367=0x0;_0x348367<_0x7c8099[_0x9554('0x3b')];_0x348367+=0x1){_0x1d2e7e[_0x9554('0x14')]['total']+=0x1;_0x1d2e7e[_0x9554('0x14')][_0x9554('0x2c')]+=_0x7c8099[_0x348367][_0x9554('0x5f')];if(_0x7c8099[_0x348367][_0x9554('0x60')]===_0x9554('0x61')){_0x1d2e7e[_0x9554('0x14')][_0x9554('0x5d')]+=0x1;_0x1d2e7e[_0x9554('0x14')][_0x9554('0x55')]+=_0x7c8099[_0x348367][_0x9554('0x5f')]-_0x7c8099[_0x348367][_0x9554('0x62')]||0x0;_0x1d2e7e['outbound'][_0x9554('0x27')]+=_0x7c8099[_0x348367][_0x9554('0x62')];}}}return _0x1d2e7e[_0x9554('0x14')];};};Realtime[_0x9554('0x38')][_0x9554('0x63')]=function(){var _0x2e72bb=this;return function(_0x345b5e){if(_0x345b5e){freeIsNotKey(_0x345b5e,_0x2e72bb[_0x9554('0x12')],_0x9554('0x23'));for(var _0x1d0871=0x0,_0x4ffb33={};_0x1d0871<_0x345b5e[_0x9554('0x3b')];_0x1d0871+=0x1){_0x4ffb33=_0x345b5e[_0x1d0871];if(_[_0x9554('0x3d')](_0x2e72bb[_0x9554('0x12')][_0x4ffb33[_0x9554('0x23')]])){_0x2e72bb[_0x9554('0x12')][_0x4ffb33[_0x9554('0x23')]]=new Campaign(_0x4ffb33);}else{_0x2e72bb[_0x9554('0x39')](_0x2e72bb[_0x9554('0x12')][_0x4ffb33['name']],_0x4ffb33);_0x2e72bb[_0x9554('0x12')][_0x4ffb33[_0x9554('0x23')]]['dialQueueProject']=_0x4ffb33[_0x9554('0x64')]?_0x4ffb33['SquareProject'][_0x9554('0x23')]:undefined;}}}return _0x2e72bb[_0x9554('0x12')];};};Realtime[_0x9554('0x38')][_0x9554('0x65')]=function(){var _0x5425cf=this;return function(_0x313e27){if(_0x313e27){freeIsNotKey(_0x313e27,_0x5425cf[_0x9554('0x15')],'id');for(var _0x56fc3f=0x0,_0x14e0b3={};_0x56fc3f<_0x313e27[_0x9554('0x3b')];_0x56fc3f+=0x1){_0x14e0b3=_0x313e27[_0x56fc3f];if(_[_0x9554('0x3d')](_0x5425cf[_0x9554('0x15')][_0x14e0b3['id']])){_0x5425cf[_0x9554('0x15')][_0x14e0b3['id']]=new VoiceExtension(_0x14e0b3);}else{_0x5425cf[_0x9554('0x39')](_0x5425cf[_0x9554('0x15')][_0x14e0b3['id']],_0x14e0b3);}}}return _0x5425cf[_0x9554('0x15')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x9f2da7=this;return function(_0x1f1b6e){clearCampaigns(_0x9f2da7[_0x9554('0x12')]);for(var _0x3af505=0x0;_0x3af505<_0x1f1b6e[_0x9554('0x3b')];_0x3af505+=0x1){_[_0x9554('0x66')](_0x9f2da7[_0x9554('0x12')][_0x1f1b6e[_0x3af505][_0x9554('0x23')]],_0x1f1b6e[_0x3af505]);}return _0x9f2da7[_0x9554('0x12')];};};Realtime['prototype'][_0x9554('0x67')]=function(){var _0x461ff4=this;return function(_0x574858){if(_0x574858){freeIsNotKey(_0x574858,_0x461ff4['faxAccounts'],'id');for(var _0x27aad8=0x0,_0x54ad91={},_0x5e9fbb={};_0x27aad8<_0x574858[_0x9554('0x3b')];_0x27aad8+=0x1){_0x54ad91=_0x574858[_0x27aad8];if(_[_0x9554('0x3d')](_0x461ff4[_0x9554('0x20')][_0x54ad91['id']])){_0x461ff4[_0x9554('0x20')][_0x54ad91['id']]=new FaxAccount(_0x54ad91);}else{_0x461ff4[_0x9554('0x39')](_0x461ff4[_0x9554('0x20')][_0x54ad91['id']],_0x54ad91);}}}return _0x461ff4[_0x9554('0x20')];};};module[_0x9554('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 221dce2..8effc1a 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 _0x48b9=['xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','accountcode','name','isNil','find','format','SIP/%s','length','connectedlinenum','interface','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitor','monitors','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime'];(function(_0x4b12ae,_0xf2b3b){var _0x16957b=function(_0x51932c){while(--_0x51932c){_0x4b12ae['push'](_0x4b12ae['shift']());}};_0x16957b(++_0xf2b3b);}(_0x48b9,0x1a7));var _0x948b=function(_0x211448,_0x333996){_0x211448=_0x211448-0x0;var _0x162266=_0x48b9[_0x211448];return _0x162266;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x948b('0x0'));var config=require(_0x948b('0x1'));var ami=require(_0x948b('0x2'));var RpcVoiceAgentReport=require(_0x948b('0x3'));var RpcVoiceCallReport=require(_0x948b('0x4'));var RpcVoiceDialReport=require(_0x948b('0x5'));var RpcMemberReport=require(_0x948b('0x6'));var RpcVoiceQueueReport=require(_0x948b('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x948b('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x948b('0x9'));var VoiceAgentReport=require(_0x948b('0xa'));var VoiceDialReport=require(_0x948b('0xb'));var UserReport=require(_0x948b('0xc'));function Report(_0x3bfce6){this['realtime']=_0x3bfce6;this['agents']=_0x3bfce6[_0x948b('0xd')];this['telephones']=_0x3bfce6[_0x948b('0xe')];}Report['prototype'][_0x948b('0xf')]=function(_0x4df830){var _0x43a797=new VoiceQueueReport(this[_0x948b('0x10')]);var _0x25ac45=new VoiceAgentReport(this[_0x948b('0x10')]);var _0x3fd5ab=new VoiceDialReport(this[_0x948b('0x10')]);var _0x1ca671=new VoiceCallReport(this[_0x948b('0x10')]);var _0x586f19=new UserReport(this['realtime']);if(config[_0x948b('0x11')]&&config[_0x948b('0x11')]['disabled']){ami['on'](_0x948b('0x12'),this[_0x948b('0x13')][_0x948b('0x14')](this));ami['on'](_0x948b('0x15'),this[_0x948b('0x16')][_0x948b('0x14')](this));ami['on'](_0x948b('0x17'),this['voiceAgentReport'][_0x948b('0x14')](this));ami['on'](_0x948b('0x18'),this[_0x948b('0x19')]['bind'](this));ami['on'](_0x948b('0x1a'),this['blindTransfer'][_0x948b('0x14')](this));ami['on'](_0x948b('0x1b'),this[_0x948b('0x1c')]['bind'](this));}};Report[_0x948b('0x1d')][_0x948b('0x1e')]=function(_0x1d2508){var _0x2d9e54;_0x2d9e54=_['find'](this['agents'],function(_0x25d90e){return _0x25d90e[_0x948b('0x1f')]==_0x1d2508||_0x25d90e[_0x948b('0x20')]==_0x1d2508;});if(_[_0x948b('0x21')](_0x2d9e54)){var _0x43b0d8=_[_0x948b('0x22')](this[_0x948b('0xe')],function(_0x10ab6f){return _0x10ab6f[_0x948b('0x1f')]==_0x1d2508||_0x10ab6f['name']==_0x1d2508;});if(_0x43b0d8){_0x2d9e54=_['find'](this[_0x948b('0xd')],function(_0x68a133){return _0x68a133['interface']==util[_0x948b('0x23')](_0x948b('0x24'),_0x43b0d8[_0x948b('0x20')]);});}}return _0x2d9e54;};Report['prototype'][_0x948b('0x13')]=function(_0x5b5997){for(var _0x34b737=0x0;_0x34b737<_0x5b5997[_0x948b('0x25')];_0x34b737+=0x1){var _0xd04c52=this[_0x948b('0x1e')](_0x5b5997[_0x34b737][_0x948b('0x26')]);if(_0xd04c52){_0x5b5997[_0x34b737][_0x948b('0x1f')]=_0xd04c52[_0x948b('0x1f')];_0x5b5997[_0x34b737]['assigned']=!![];_0x5b5997[_0x34b737]['lastAssignedTo']=_0xd04c52[_0x948b('0x20')];_0x5b5997[_0x34b737][_0x948b('0x27')]=_[_0x948b('0x21')](_0xd04c52['interface'])?util['format'](_0x948b('0x24'),_0xd04c52[_0x948b('0x20')]):_0xd04c52[_0x948b('0x27')];if(_0x5b5997[_0x34b737][_0x948b('0x28')]){_0x5b5997[_0x34b737]['queuecallercompleteAt']=moment()[_0x948b('0x23')](_0x948b('0x29'));}if(_0x5b5997[_0x34b737][_0x948b('0x2a')]){_0x5b5997[_0x34b737][_0x948b('0x2b')]=moment()[_0x948b('0x23')](_0x948b('0x29'));}RpcMemberReport['voiceQueueReport'](_0x5b5997[_0x34b737]);}RpcVoiceQueueReport[_0x948b('0x2c')](_0x5b5997[_0x34b737]);}};function extractCalleridNumber(_0x1bf13f){var _0x169939=_0x1bf13f[_0x948b('0x2d')](/<(.*?)>/);return _0x169939?_0x169939[0x1]:_0x1bf13f;}Report['prototype'][_0x948b('0x16')]=function(_0x4be730){_0x4be730[_0x948b('0x2e')]=_0x4be730[_0x948b('0x2e')]||_0x4be730[_0x948b('0x2f')];if(_0x4be730[_0x948b('0x30')]=='dialer'){_0x4be730[_0x948b('0x31')]='queue';_0x4be730[_0x948b('0x32')]=_0x4be730['queue'];if(_0x4be730[_0x948b('0x33')]==_0x948b('0x34')){_0x4be730[_0x948b('0x1f')]='';_0x4be730['destination']=extractCalleridNumber(_0x4be730[_0x948b('0x35')]);}else if(_0x4be730['context']==_0x948b('0x36')){if(_0x4be730[_0x948b('0x2e')]=='xcally-motion-preview'){_0x4be730['destination']=extractCalleridNumber(_0x4be730[_0x948b('0x37')]);_0x4be730[_0x948b('0x38')]=_0x4be730[_0x948b('0x39')];_0x4be730[_0x948b('0x3a')]=[_0x4be730[_0x948b('0x3b')],_0x4be730[_0x948b('0x3b')]=_0x4be730[_0x948b('0x3a')]][0x0];_0x4be730['callerid']=_0x4be730[_0x948b('0x37')];}else{_0x4be730['destination']=_0x4be730['calleridnum'];_0x4be730['calleridnum']=_0x4be730[_0x948b('0x39')];if(_0x4be730[_0x948b('0x3c')]==_0x948b('0x3d')){_0x4be730[_0x948b('0x1f')]=_0x4be730[_0x948b('0x26')];}else{_0x4be730[_0x948b('0x1f')]='';}}}}else{_0x4be730['callerid']=util['format'](_0x948b('0x3e'),_0x4be730['calleridname'],_0x4be730[_0x948b('0x38')]);}if(RpcVoiceTransferReport[_0x948b('0x3f')][_0x4be730[_0x948b('0x40')]]){var _0x2041f0=RpcVoiceTransferReport[_0x948b('0x3f')][_0x4be730['linkedid']];_0x2041f0[_0x948b('0x41')]=_0x4be730[_0x948b('0x42')];RpcVoiceTransferReport[_0x948b('0x43')](_0x2041f0);delete RpcVoiceTransferReport[_0x948b('0x3f')][_0x4be730[_0x948b('0x40')]];}RpcVoiceCallReport[_0x948b('0x2c')](_0x4be730);if(_0x4be730[_0x948b('0x44')]){for(var _0x1134b0=0x0;_0x1134b0<_0x4be730['monitors']['length'];_0x1134b0+=0x1){_0x4be730['monitorFilename']=_0x4be730[_0x948b('0x45')][_0x1134b0][_0x948b('0x46')];_0x4be730[_0x948b('0x47')]=_0x4be730[_0x948b('0x45')][_0x1134b0][_0x948b('0x47')];if(_0x4be730[_0x948b('0x2f')]==_0x948b('0x48')){_0x4be730[_0x948b('0x38')]=_0x4be730[_0x948b('0x26')];_0x4be730[_0x948b('0x49')]=_0x4be730['connectedlinename'];_0x4be730[_0x948b('0x26')]=_0x4be730['accountcode'];_0x4be730[_0x948b('0x4a')]=_0x4be730[_0x948b('0x4b')];_0x4be730[_0x948b('0x2f')]=_0x4be730[_0x948b('0x39')];}else if(_0x4be730[_0x948b('0x2f')]==_0x948b('0x4c')){_0x4be730['calleridnum']=_0x4be730[_0x948b('0x2e')];_0x4be730[_0x948b('0x2f')]=_0x4be730[_0x948b('0x39')];}RpcVoiceRecording['create'](_0x4be730);}}};Report[_0x948b('0x1d')][_0x948b('0x4d')]=function(_0x38cd22){if(_[_0x948b('0x4e')](_0x38cd22)){_0x38cd22['forEach'](function(_0x3d4e4d){RpcVoiceAgentReport[_0x948b('0x2c')](_0x3d4e4d);});}else{RpcVoiceAgentReport[_0x948b('0x2c')](_0x38cd22);}};Report[_0x948b('0x1d')][_0x948b('0x19')]=function(_0xe4067b){RpcVoiceDialReport[_0x948b('0x2c')](_0xe4067b);var _0x57a25b;var _0x2cb105;var _0xc5f758=_0xe4067b[_0x948b('0x3b')];if(_[_0x948b('0x4f')](_0xc5f758,_0x948b('0x50'))){_0x2cb105=_0xc5f758[_0x948b('0x51')](_0xc5f758[_0x948b('0x52')]('/')+0x1,_0xc5f758[_0x948b('0x52')]('@'));_0x57a25b=_[_0x948b('0x22')](this[_0x948b('0xd')],function(_0x2b19d0){return _0x2b19d0[_0x948b('0x53')]==_0x2cb105||_0x2b19d0[_0x948b('0x54')]==_0x2cb105||_0x2b19d0[_0x948b('0x1f')]==_0x2cb105;});}else{_0x2cb105=_0xc5f758[_0x948b('0x51')](_0xc5f758[_0x948b('0x52')]('/')+0x1,_0xc5f758[_0x948b('0x55')]('-'));_0x57a25b=this['findAgent'](_0x2cb105);}if(_0x57a25b){_0xe4067b[_0x948b('0x27')]=_['isNil'](_0x57a25b['interface'])?util[_0x948b('0x23')](_0x948b('0x24'),_0x57a25b['name']):_0x57a25b[_0x948b('0x27')];_0xe4067b[_0x948b('0x4b')]=_0x57a25b[_0x948b('0x20')];_0xe4067b[_0x948b('0x1f')]=_0x57a25b['accountcode'];RpcMemberReport['voiceDialReport'](_0xe4067b);}};Report[_0x948b('0x1d')][_0x948b('0x43')]=function(_0x2ea2e2){RpcVoiceTransferReport[_0x948b('0x3f')][_0x2ea2e2[_0x948b('0x56')]]=_0x2ea2e2;};Report[_0x948b('0x1d')][_0x948b('0x1c')]=function(_0x17fcfd){RpcVoiceTransferReport[_0x948b('0x1c')](_0x17fcfd);};module[_0x948b('0x57')]=Report; \ No newline at end of file +var _0x2a0a=['createdAt','connectedlinename','xcally-motion-dialer','voiceDialReport','startsWith','Local','substring','indexOf','phone','lastIndexOf','membername','transfererlinkedid','attendedTransfer','lodash','util','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','prototype','length','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten','type','dialer','queue','callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors'];(function(_0xa64f6,_0xe5781d){var _0x16300f=function(_0x507c0d){while(--_0x507c0d){_0xa64f6['push'](_0xa64f6['shift']());}};_0x16300f(++_0xe5781d);}(_0x2a0a,0x1a2));var _0xa2a0=function(_0x1430df,_0x1308ab){_0x1430df=_0x1430df-0x0;var _0x362d2b=_0x2a0a[_0x1430df];return _0x362d2b;};'use strict';var _=require(_0xa2a0('0x0'));var moment=require('moment');var util=require(_0xa2a0('0x1'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xa2a0('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xa2a0('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xa2a0('0x4'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xa2a0('0x5'));var VoiceQueueReport=require(_0xa2a0('0x6'));var VoiceCallReport=require(_0xa2a0('0x7'));var VoiceAgentReport=require(_0xa2a0('0x8'));var VoiceDialReport=require(_0xa2a0('0x9'));var UserReport=require(_0xa2a0('0xa'));function Report(_0x20dd93){this[_0xa2a0('0xb')]=_0x20dd93;this[_0xa2a0('0xc')]=_0x20dd93['agents'];this[_0xa2a0('0xd')]=_0x20dd93['telephones'];}Report['prototype'][_0xa2a0('0xe')]=function(_0x1a9dae){var _0x1e6d41=new VoiceQueueReport(this[_0xa2a0('0xb')]);var _0x1ff59b=new VoiceAgentReport(this[_0xa2a0('0xb')]);var _0x403dc0=new VoiceDialReport(this[_0xa2a0('0xb')]);var _0x581a97=new VoiceCallReport(this[_0xa2a0('0xb')]);var _0x3d383b=new UserReport(this[_0xa2a0('0xb')]);if(config[_0xa2a0('0xf')]&&config[_0xa2a0('0xf')]['disabled']){ami['on'](_0xa2a0('0x10'),this[_0xa2a0('0x11')][_0xa2a0('0x12')](this));ami['on'](_0xa2a0('0x13'),this['voiceCallReport'][_0xa2a0('0x12')](this));ami['on'](_0xa2a0('0x14'),this['voiceAgentReport'][_0xa2a0('0x12')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0xa2a0('0x12')](this));ami['on'](_0xa2a0('0x15'),this[_0xa2a0('0x16')]['bind'](this));ami['on'](_0xa2a0('0x17'),this['attendedTransfer'][_0xa2a0('0x12')](this));}};Report['prototype'][_0xa2a0('0x18')]=function(_0x16464e){var _0x200593;_0x200593=_[_0xa2a0('0x19')](this['agents'],function(_0x32a339){return _0x32a339[_0xa2a0('0x1a')]==_0x16464e||_0x32a339[_0xa2a0('0x1b')]==_0x16464e;});if(_[_0xa2a0('0x1c')](_0x200593)){var _0x1cb59f=_['find'](this['telephones'],function(_0x391ac1){return _0x391ac1['accountcode']==_0x16464e||_0x391ac1[_0xa2a0('0x1b')]==_0x16464e;});if(_0x1cb59f){_0x200593=_[_0xa2a0('0x19')](this[_0xa2a0('0xc')],function(_0x19c404){return _0x19c404[_0xa2a0('0x1d')]==util[_0xa2a0('0x1e')]('SIP/%s',_0x1cb59f['name']);});}}return _0x200593;};Report[_0xa2a0('0x1f')][_0xa2a0('0x11')]=function(_0x39cc70){for(var _0x1bf558=0x0;_0x1bf558<_0x39cc70[_0xa2a0('0x20')];_0x1bf558+=0x1){var _0x2f5db6=this[_0xa2a0('0x18')](_0x39cc70[_0x1bf558]['connectedlinenum']);if(_0x2f5db6){_0x39cc70[_0x1bf558][_0xa2a0('0x1a')]=_0x2f5db6[_0xa2a0('0x1a')];_0x39cc70[_0x1bf558]['assigned']=!![];_0x39cc70[_0x1bf558][_0xa2a0('0x21')]=_0x2f5db6[_0xa2a0('0x1b')];_0x39cc70[_0x1bf558][_0xa2a0('0x1d')]=_[_0xa2a0('0x1c')](_0x2f5db6['interface'])?util[_0xa2a0('0x1e')](_0xa2a0('0x22'),_0x2f5db6[_0xa2a0('0x1b')]):_0x2f5db6[_0xa2a0('0x1d')];if(_0x39cc70[_0x1bf558][_0xa2a0('0x23')]){_0x39cc70[_0x1bf558][_0xa2a0('0x24')]=moment()['format'](_0xa2a0('0x25'));}if(_0x39cc70[_0x1bf558][_0xa2a0('0x26')]){_0x39cc70[_0x1bf558][_0xa2a0('0x27')]=moment()[_0xa2a0('0x1e')](_0xa2a0('0x25'));}RpcMemberReport[_0xa2a0('0x11')](_0x39cc70[_0x1bf558]);}RpcVoiceQueueReport[_0xa2a0('0x28')](_0x39cc70[_0x1bf558]);}};function extractCalleridNumber(_0x4489f6){var _0x145584=_0x4489f6[_0xa2a0('0x29')](/<(.*?)>/);return _0x145584?_0x145584[0x1]:_0x4489f6;}Report['prototype'][_0xa2a0('0x2a')]=function(_0x31341c){_0x31341c[_0xa2a0('0x2b')]=_0x31341c['destination']||_0x31341c[_0xa2a0('0x2c')];if(_0x31341c[_0xa2a0('0x2d')]==_0xa2a0('0x2e')){_0x31341c['lastapplication']=_0xa2a0('0x2f');_0x31341c['lastdata']=_0x31341c[_0xa2a0('0x2f')];if(_0x31341c['context']=='from-voip-provider'){_0x31341c['accountcode']='';_0x31341c[_0xa2a0('0x2b')]=extractCalleridNumber(_0x31341c[_0xa2a0('0x30')]);}else if(_0x31341c[_0xa2a0('0x31')]==_0xa2a0('0x32')){if(_0x31341c[_0xa2a0('0x2b')]==_0xa2a0('0x33')){_0x31341c[_0xa2a0('0x2b')]=extractCalleridNumber(_0x31341c[_0xa2a0('0x34')]);_0x31341c[_0xa2a0('0x35')]=_0x31341c['originatecalleridnum'];_0x31341c[_0xa2a0('0x36')]=[_0x31341c['channel'],_0x31341c[_0xa2a0('0x37')]=_0x31341c[_0xa2a0('0x36')]][0x0];_0x31341c['callerid']=_0x31341c[_0xa2a0('0x34')];}else{_0x31341c['destination']=_0x31341c[_0xa2a0('0x35')];_0x31341c[_0xa2a0('0x35')]=_0x31341c[_0xa2a0('0x38')];if(_0x31341c[_0xa2a0('0x39')]==_0xa2a0('0x3a')){_0x31341c[_0xa2a0('0x1a')]=_0x31341c[_0xa2a0('0x3b')];}else{_0x31341c[_0xa2a0('0x1a')]='';}}}}else{_0x31341c[_0xa2a0('0x30')]=util[_0xa2a0('0x1e')](_0xa2a0('0x3c'),_0x31341c[_0xa2a0('0x3d')],_0x31341c[_0xa2a0('0x35')]);}if(RpcVoiceTransferReport[_0xa2a0('0x3e')][_0x31341c[_0xa2a0('0x3f')]]){var _0xdef196=RpcVoiceTransferReport[_0xa2a0('0x3e')][_0x31341c[_0xa2a0('0x3f')]];_0xdef196[_0xa2a0('0x40')]=_0x31341c[_0xa2a0('0x41')];RpcVoiceTransferReport[_0xa2a0('0x16')](_0xdef196);delete RpcVoiceTransferReport[_0xa2a0('0x3e')][_0x31341c[_0xa2a0('0x3f')]];}RpcVoiceCallReport['create'](_0x31341c);if(_0x31341c[_0xa2a0('0x42')]){for(var _0x56ee32=0x0;_0x56ee32<_0x31341c[_0xa2a0('0x43')][_0xa2a0('0x20')];_0x56ee32+=0x1){_0x31341c['monitorFilename']=_0x31341c['monitors'][_0x56ee32]['filename'];_0x31341c[_0xa2a0('0x44')]=_0x31341c[_0xa2a0('0x43')][_0x56ee32][_0xa2a0('0x44')];if(_0x31341c['exten']==_0xa2a0('0x33')){_0x31341c[_0xa2a0('0x35')]=_0x31341c[_0xa2a0('0x3b')];_0x31341c[_0xa2a0('0x3d')]=_0x31341c['connectedlinename'];_0x31341c[_0xa2a0('0x3b')]=_0x31341c[_0xa2a0('0x1a')];_0x31341c[_0xa2a0('0x45')]=_0x31341c['membername'];_0x31341c[_0xa2a0('0x2c')]=_0x31341c[_0xa2a0('0x38')];}else if(_0x31341c[_0xa2a0('0x2c')]==_0xa2a0('0x46')){_0x31341c[_0xa2a0('0x35')]=_0x31341c[_0xa2a0('0x2b')];_0x31341c[_0xa2a0('0x2c')]=_0x31341c[_0xa2a0('0x38')];}RpcVoiceRecording['create'](_0x31341c);}}};Report[_0xa2a0('0x1f')]['voiceAgentReport']=function(_0x53cf6a){if(_['isArray'](_0x53cf6a)){_0x53cf6a['forEach'](function(_0x3673d3){RpcVoiceAgentReport['create'](_0x3673d3);});}else{RpcVoiceAgentReport[_0xa2a0('0x28')](_0x53cf6a);}};Report[_0xa2a0('0x1f')][_0xa2a0('0x47')]=function(_0x34d7b3){RpcVoiceDialReport[_0xa2a0('0x28')](_0x34d7b3);var _0x4fbb14;var _0x1c4928;var _0x2732d2=_0x34d7b3['channel'];if(_[_0xa2a0('0x48')](_0x2732d2,_0xa2a0('0x49'))){_0x1c4928=_0x2732d2[_0xa2a0('0x4a')](_0x2732d2[_0xa2a0('0x4b')]('/')+0x1,_0x2732d2[_0xa2a0('0x4b')]('@'));_0x4fbb14=_['find'](this[_0xa2a0('0xc')],function(_0x40c9e2){return _0x40c9e2['mobile']==_0x1c4928||_0x40c9e2[_0xa2a0('0x4c')]==_0x1c4928||_0x40c9e2[_0xa2a0('0x1a')]==_0x1c4928;});}else{_0x1c4928=_0x2732d2['substring'](_0x2732d2[_0xa2a0('0x4b')]('/')+0x1,_0x2732d2[_0xa2a0('0x4d')]('-'));_0x4fbb14=this[_0xa2a0('0x18')](_0x1c4928);}if(_0x4fbb14){_0x34d7b3[_0xa2a0('0x1d')]=_[_0xa2a0('0x1c')](_0x4fbb14[_0xa2a0('0x1d')])?util[_0xa2a0('0x1e')](_0xa2a0('0x22'),_0x4fbb14[_0xa2a0('0x1b')]):_0x4fbb14[_0xa2a0('0x1d')];_0x34d7b3[_0xa2a0('0x4e')]=_0x4fbb14[_0xa2a0('0x1b')];_0x34d7b3[_0xa2a0('0x1a')]=_0x4fbb14[_0xa2a0('0x1a')];RpcMemberReport[_0xa2a0('0x47')](_0x34d7b3);}};Report[_0xa2a0('0x1f')]['blindTransfer']=function(_0x4d0c00){RpcVoiceTransferReport[_0xa2a0('0x3e')][_0x4d0c00[_0xa2a0('0x4f')]]=_0x4d0c00;};Report[_0xa2a0('0x1f')][_0xa2a0('0x50')]=function(_0x319750){RpcVoiceTransferReport[_0xa2a0('0x50')](_0x319750);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 5c2584f..357925e 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc54=['syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','util','bluebird','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','trunk:save','startsWith','substring','phone','accountcode','updateStatusRealtime','[userReport][devicestatechange]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc54,0xda));var _0x4dc5=function(_0x5881c4,_0x2294c0){_0x5881c4=_0x5881c4-0x0;var _0xb759b6=_0xdc54[_0x5881c4];return _0xb759b6;};'use strict';var _=require(_0x4dc5('0x0'));var moment=require('moment');var util=require(_0x4dc5('0x1'));var Redis=require('ioredis');var BPromise=require(_0x4dc5('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x4dc5('0x3'));config[_0x4dc5('0x4')]=_[_0x4dc5('0x5')](config[_0x4dc5('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4dc5('0x6'))(new Redis(config[_0x4dc5('0x4')]));function UserReport(_0x59bccf){this[_0x4dc5('0x7')]=_0x59bccf[_0x4dc5('0x7')];this[_0x4dc5('0x8')]=_0x59bccf['agents'];this[_0x4dc5('0x9')]=_0x59bccf['telephones'];ami['on'](_0x4dc5('0xa'),this[_0x4dc5('0xb')][_0x4dc5('0xc')](this));ami['on'](_0x4dc5('0xd'),this['syncRegistry']['bind'](this));ami['on']('devicestatechange',this[_0x4dc5('0xe')][_0x4dc5('0xc')](this));ami['on'](_0x4dc5('0xf'),this['syncPeerStatus'][_0x4dc5('0xc')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x4dc5('0x10')]()[_0x4dc5('0x11')](ami[_0x4dc5('0x12')]())[_0x4dc5('0x13')](function(_0x113cd1){logger[_0x4dc5('0x14')]('[userReport][sipshowregistry]',util[_0x4dc5('0x15')](_0x113cd1,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x4dc5('0x11')](ami[_0x4dc5('0x16')]())['catch'](function(_0x21004b){logger[_0x4dc5('0x14')](_0x4dc5('0x17'),util[_0x4dc5('0x15')](_0x21004b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x4dc5('0x11')](ami[_0x4dc5('0x18')]())[_0x4dc5('0x13')](function(_0xd5ec72){logger['error'](_0x4dc5('0x19'),util['inspect'](_0xd5ec72,{'showHidden':![],'depth':null}));});}UserReport[_0x4dc5('0x1a')][_0x4dc5('0x1b')]=function(){setInterval(function(){BPromise[_0x4dc5('0x10')]()[_0x4dc5('0x11')](showSipRegistrations())[_0x4dc5('0x11')](listDeviceStates())[_0x4dc5('0x11')](showPeersStatus());},0x32c8);};UserReport[_0x4dc5('0x1a')][_0x4dc5('0x1c')]=function(_0x5ab238){return _0x5ab238!==null&&!_[_0x4dc5('0x1d')](_0x5ab238);};UserReport[_0x4dc5('0x1a')][_0x4dc5('0x1e')]=function(_0x45b0a3,_0xd6f4cf,_0x4bfd7a){io['to'](_0x45b0a3)[_0x4dc5('0x1e')](_0xd6f4cf,_0x4bfd7a);};UserReport[_0x4dc5('0x1a')]['syncRegistry']=function(_0x392732){try{if(this['isNotNull'](_0x392732)){logger[_0x4dc5('0x1f')](_0x4dc5('0x20'),_0x392732[_0x4dc5('0x21')],_0x392732[_0x4dc5('0x22')]);logger[_0x4dc5('0x23')](_0x4dc5('0x24'),util[_0x4dc5('0x15')](_0x392732,{'showHidden':![],'depth':null}));var _0x1b24f8=_[_0x4dc5('0x25')](this[_0x4dc5('0x7')],{'defaultuser':_0x392732['username']});if(_0x1b24f8){_0x392732[_0x4dc5('0x26')]=_0x392732[_0x4dc5('0x22')];_[_0x4dc5('0x27')](_0x1b24f8,_['omit'](_0x392732,[_0x4dc5('0x28'),'actionid',_0x4dc5('0x21'),_0x4dc5('0x22')]));logger['debug'](_0x4dc5('0x29'),util[_0x4dc5('0x15')](_0x1b24f8,{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util[_0x4dc5('0x2a')](_0x4dc5('0x2b'),_0x1b24f8['name']),'trunk:save',_0x1b24f8);}}}catch(_0x16c76a){logger['error'](_0x4dc5('0x24'),util[_0x4dc5('0x15')](_0x16c76a,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x4d81c3){try{if(this['isNotNull'](_0x4d81c3)){logger[_0x4dc5('0x1f')](_0x4dc5('0x2c'),_0x4d81c3['device'],_0x4d81c3[_0x4dc5('0x22')]);logger['debug']('[userReport][devicestatechange]',util[_0x4dc5('0x15')](_0x4d81c3,{'showHidden':![],'depth':null}));if(this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]]){if(!this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x2e')]||_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]()==_0x4dc5('0x30')){this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]]['local']=![];if(this['agents'][_0x4d81c3[_0x4dc5('0x2d')]]['state']!==_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]()){this[_0x4dc5('0x8')][_0x4d81c3['device']][_0x4dc5('0x31')]=_[_0x4dc5('0x32')](moment()['format']('x'));}this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x22')]=_0x4d81c3['state']['toLowerCase']();this[_0x4dc5('0x8')][_0x4d81c3[_0x4dc5('0x2d')]]['updateStatusRealtime'](_0x4d81c3);}}else if(this[_0x4dc5('0x9')][_0x4d81c3['device']]){if(this['telephones'][_0x4d81c3[_0x4dc5('0x2d')]]['state']!==_0x4d81c3[_0x4dc5('0x22')]['toLowerCase']()){this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x31')]=_[_0x4dc5('0x32')](moment()[_0x4dc5('0x2a')]('x'));}this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x22')]=_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]();logger[_0x4dc5('0x23')](_0x4dc5('0x33'),util['inspect'](this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x4dc5('0x2a')](_0x4dc5('0x34'),this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x35')]),_0x4dc5('0x36'),this[_0x4dc5('0x9')][_0x4d81c3[_0x4dc5('0x2d')]]);}else if(this['trunks'][_0x4d81c3[_0x4dc5('0x2d')]]){if(this[_0x4dc5('0x7')][_0x4d81c3['device']][_0x4dc5('0x22')]!==_0x4d81c3[_0x4dc5('0x22')][_0x4dc5('0x2f')]()){this[_0x4dc5('0x7')][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x31')]=_[_0x4dc5('0x32')](moment()[_0x4dc5('0x2a')]('x'));}this['trunks'][_0x4d81c3[_0x4dc5('0x2d')]][_0x4dc5('0x22')]=_0x4d81c3['state'][_0x4dc5('0x2f')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x4dc5('0x7')][_0x4d81c3[_0x4dc5('0x2d')]],{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util['format'](_0x4dc5('0x2b'),this[_0x4dc5('0x7')][_0x4d81c3['device']]['name']),_0x4dc5('0x37'),this['trunks'][_0x4d81c3[_0x4dc5('0x2d')]]);}else if(_[_0x4dc5('0x38')](_0x4d81c3[_0x4dc5('0x2d')],'Local')){var _0x421406=_0x4d81c3['device'];var _0x464d77=_0x421406[_0x4dc5('0x39')](_0x421406['indexOf']('/')+0x1,_0x421406['indexOf']('@'));var _0x2252d7=_[_0x4dc5('0x25')](this['agents'],function(_0x46f389){return _0x46f389['mobile']==_0x464d77||_0x46f389[_0x4dc5('0x3a')]==_0x464d77||_0x46f389[_0x4dc5('0x3b')]==_0x464d77;});if(_0x2252d7){if(_0x2252d7[_0x4dc5('0x22')]!==_0x4d81c3['state'][_0x4dc5('0x2f')]()){_0x2252d7[_0x4dc5('0x31')]=_['toNumber'](moment()[_0x4dc5('0x2a')]('x'));}_0x2252d7['state']=_0x4d81c3[_0x4dc5('0x22')]['toLowerCase']();_0x2252d7['local']=!![];_0x2252d7[_0x4dc5('0x3c')](_0x4d81c3);}}}}catch(_0x444223){logger[_0x4dc5('0x14')](_0x4dc5('0x3d'),util[_0x4dc5('0x15')](_0x444223,{'showHidden':![],'depth':null}));}};UserReport[_0x4dc5('0x1a')][_0x4dc5('0x3e')]=function(_0x10849a){try{if(this['isNotNull'](_0x10849a)&&this[_0x4dc5('0x1c')](_0x10849a['peerstatus'])){logger[_0x4dc5('0x1f')](_0x4dc5('0x3f'),_0x10849a[_0x4dc5('0x40')],_0x10849a[_0x4dc5('0x41')],_0x10849a[_0x4dc5('0xf')]);logger[_0x4dc5('0x23')]('[userReport][peerstatus]',util[_0x4dc5('0x15')](_0x10849a,{'showHidden':![],'depth':null}));if(this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]]){if(!this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x2e')]||_0x10849a['peerstatus']['toLowerCase']()==_0x4dc5('0x42')){this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x2e')]=![];this[_0x4dc5('0x8')][_0x10849a['peer']][_0x4dc5('0x43')]=_0x10849a[_0x4dc5('0xf')]['toLowerCase']();this[_0x4dc5('0x8')][_0x10849a[_0x4dc5('0x40')]]['address']=_0x10849a[_0x4dc5('0x41')];this[_0x4dc5('0x8')][_0x10849a['peer']][_0x4dc5('0x3c')](_0x10849a);}}else if(this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]]){this['telephones'][_0x10849a['peer']][_0x4dc5('0x43')]=_0x10849a[_0x4dc5('0xf')][_0x4dc5('0x2f')]();this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x41')]=_0x10849a['address'];logger[_0x4dc5('0x23')](_0x4dc5('0x44'),util[_0x4dc5('0x15')](this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]],{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util[_0x4dc5('0x2a')](_0x4dc5('0x34'),this[_0x4dc5('0x9')][_0x10849a['peer']]['name']),'telephone:save',this[_0x4dc5('0x9')][_0x10849a[_0x4dc5('0x40')]]);}else if(this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]]){this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x43')]=_0x10849a[_0x4dc5('0xf')]['toLowerCase']();this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x41')]=_0x10849a[_0x4dc5('0x41')];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x4dc5('0x7')][_0x10849a['peer']],{'showHidden':![],'depth':null}));this[_0x4dc5('0x1e')](util[_0x4dc5('0x2a')](_0x4dc5('0x2b'),this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]][_0x4dc5('0x35')]),_0x4dc5('0x37'),this[_0x4dc5('0x7')][_0x10849a[_0x4dc5('0x40')]]);}}}catch(_0x16a507){logger[_0x4dc5('0x14')]('[userReport][peerstatus]',util[_0x4dc5('0x15')](_0x16a507,{'showHidden':![],'depth':null}));}};module[_0x4dc5('0x45')]=UserReport; \ No newline at end of file +var _0xaee0=['substring','indexOf','mobile','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','then','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','format','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local'];(function(_0x36d35a,_0x398b92){var _0x575eb1=function(_0x3d6521){while(--_0x3d6521){_0x36d35a['push'](_0x36d35a['shift']());}};_0x575eb1(++_0x398b92);}(_0xaee0,0x18d));var _0x0aee=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xaee0[_0xcfeff4];return _0xb2fadc;};'use strict';var _=require(_0x0aee('0x0'));var moment=require(_0x0aee('0x1'));var util=require(_0x0aee('0x2'));var Redis=require(_0x0aee('0x3'));var BPromise=require(_0x0aee('0x4'));var config=require(_0x0aee('0x5'));var logger=require(_0x0aee('0x6'))(_0x0aee('0x7'));var ami=require(_0x0aee('0x8'));config[_0x0aee('0x9')]=_[_0x0aee('0xa')](config[_0x0aee('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x0aee('0xb'))(new Redis(config[_0x0aee('0x9')]));function UserReport(_0x43ccad){this[_0x0aee('0xc')]=_0x43ccad[_0x0aee('0xc')];this[_0x0aee('0xd')]=_0x43ccad[_0x0aee('0xd')];this[_0x0aee('0xe')]=_0x43ccad[_0x0aee('0xe')];ami['on'](_0x0aee('0xf'),this[_0x0aee('0x10')][_0x0aee('0x11')](this));ami['on']('registry',this['syncRegistry'][_0x0aee('0x11')](this));ami['on'](_0x0aee('0x12'),this[_0x0aee('0x13')][_0x0aee('0x11')](this));ami['on']('peerstatus',this[_0x0aee('0x14')]['bind'](this));return this[_0x0aee('0x15')]();}function showSipRegistrations(){Promise[_0x0aee('0x16')]()['then'](ami[_0x0aee('0x17')]())[_0x0aee('0x18')](function(_0x27817f){logger[_0x0aee('0x19')](_0x0aee('0x1a'),util[_0x0aee('0x1b')](_0x27817f,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0aee('0x16')]()['then'](ami[_0x0aee('0x1c')]())[_0x0aee('0x18')](function(_0x395e3d){logger[_0x0aee('0x19')]('[userReport][devicestatelist]',util[_0x0aee('0x1b')](_0x395e3d,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0aee('0x16')]()[_0x0aee('0x1d')](ami['actionSipPeerStatus']())[_0x0aee('0x18')](function(_0x415372){logger[_0x0aee('0x19')](_0x0aee('0x1e'),util['inspect'](_0x415372,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x0aee('0x15')]=function(){setInterval(function(){BPromise[_0x0aee('0x16')]()[_0x0aee('0x1d')](showSipRegistrations())[_0x0aee('0x1d')](listDeviceStates())[_0x0aee('0x1d')](showPeersStatus());},0x32c8);};UserReport[_0x0aee('0x1f')][_0x0aee('0x20')]=function(_0x5a8d90){return _0x5a8d90!==null&&!_[_0x0aee('0x21')](_0x5a8d90);};UserReport[_0x0aee('0x1f')][_0x0aee('0x22')]=function(_0x29a16e,_0x4731b4,_0x505c78){io['to'](_0x29a16e)[_0x0aee('0x22')](_0x4731b4,_0x505c78);};UserReport[_0x0aee('0x1f')][_0x0aee('0x10')]=function(_0x1d584c){try{if(this['isNotNull'](_0x1d584c)){logger[_0x0aee('0x23')](_0x0aee('0x24'),_0x1d584c[_0x0aee('0x25')],_0x1d584c[_0x0aee('0x26')]);logger['debug'](_0x0aee('0x27'),util[_0x0aee('0x1b')](_0x1d584c,{'showHidden':![],'depth':null}));var _0x459e2c=_[_0x0aee('0x28')](this[_0x0aee('0xc')],{'defaultuser':_0x1d584c[_0x0aee('0x25')]});if(_0x459e2c){_0x1d584c['stateRegistry']=_0x1d584c['state'];_[_0x0aee('0x29')](_0x459e2c,_[_0x0aee('0x2a')](_0x1d584c,[_0x0aee('0x2b'),_0x0aee('0x2c'),_0x0aee('0x25'),'state']));logger[_0x0aee('0x2d')](_0x0aee('0x2e'),util[_0x0aee('0x1b')](_0x459e2c,{'showHidden':![],'depth':null}));this[_0x0aee('0x22')](util['format'](_0x0aee('0x2f'),_0x459e2c[_0x0aee('0x30')]),_0x0aee('0x31'),_0x459e2c);}}}catch(_0x4ba724){logger[_0x0aee('0x19')](_0x0aee('0x27'),util[_0x0aee('0x1b')](_0x4ba724,{'showHidden':![],'depth':null}));}};UserReport[_0x0aee('0x1f')][_0x0aee('0x13')]=function(_0x79c5f7){try{if(this[_0x0aee('0x20')](_0x79c5f7)){logger[_0x0aee('0x23')](_0x0aee('0x32'),_0x79c5f7[_0x0aee('0x33')],_0x79c5f7[_0x0aee('0x26')]);logger[_0x0aee('0x2d')](_0x0aee('0x34'),util['inspect'](_0x79c5f7,{'showHidden':![],'depth':null}));if(this[_0x0aee('0xd')][_0x79c5f7['device']]){if(!this[_0x0aee('0xd')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x35')]||_0x79c5f7[_0x0aee('0x26')][_0x0aee('0x36')]()==_0x0aee('0x37')){this['agents'][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x35')]=![];if(this[_0x0aee('0xd')][_0x79c5f7[_0x0aee('0x33')]]['state']!==_0x79c5f7['state'][_0x0aee('0x36')]()){this[_0x0aee('0xd')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x38')]=_[_0x0aee('0x39')](moment()[_0x0aee('0x3a')]('x'));}this['agents'][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x26')]=_0x79c5f7[_0x0aee('0x26')][_0x0aee('0x36')]();this[_0x0aee('0xd')][_0x79c5f7['device']][_0x0aee('0x3b')](_0x79c5f7);}}else if(this[_0x0aee('0xe')][_0x79c5f7['device']]){if(this[_0x0aee('0xe')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x26')]!==_0x79c5f7[_0x0aee('0x26')]['toLowerCase']()){this[_0x0aee('0xe')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x38')]=_['toNumber'](moment()[_0x0aee('0x3a')]('x'));}this[_0x0aee('0xe')][_0x79c5f7[_0x0aee('0x33')]]['state']=_0x79c5f7[_0x0aee('0x26')][_0x0aee('0x36')]();logger[_0x0aee('0x2d')](_0x0aee('0x3c'),util['inspect'](this['telephones'][_0x79c5f7[_0x0aee('0x33')]],{'showHidden':![],'depth':null}));this[_0x0aee('0x22')](util[_0x0aee('0x3a')](_0x0aee('0x3d'),this[_0x0aee('0xe')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x30')]),'telephone:save',this['telephones'][_0x79c5f7['device']]);}else if(this[_0x0aee('0xc')][_0x79c5f7[_0x0aee('0x33')]]){if(this[_0x0aee('0xc')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x26')]!==_0x79c5f7[_0x0aee('0x26')][_0x0aee('0x36')]()){this['trunks'][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x38')]=_[_0x0aee('0x39')](moment()[_0x0aee('0x3a')]('x'));}this[_0x0aee('0xc')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x26')]=_0x79c5f7[_0x0aee('0x26')][_0x0aee('0x36')]();logger[_0x0aee('0x2d')](_0x0aee('0x3e'),util['inspect'](this['trunks'][_0x79c5f7[_0x0aee('0x33')]],{'showHidden':![],'depth':null}));this[_0x0aee('0x22')](util[_0x0aee('0x3a')](_0x0aee('0x2f'),this[_0x0aee('0xc')][_0x79c5f7[_0x0aee('0x33')]][_0x0aee('0x30')]),_0x0aee('0x31'),this['trunks'][_0x79c5f7['device']]);}else if(_[_0x0aee('0x3f')](_0x79c5f7[_0x0aee('0x33')],_0x0aee('0x40'))){var _0x511890=_0x79c5f7[_0x0aee('0x33')];var _0xe2e4db=_0x511890[_0x0aee('0x41')](_0x511890['indexOf']('/')+0x1,_0x511890[_0x0aee('0x42')]('@'));var _0x5224d0=_['find'](this['agents'],function(_0x33abce){return _0x33abce[_0x0aee('0x43')]==_0xe2e4db||_0x33abce['phone']==_0xe2e4db||_0x33abce['accountcode']==_0xe2e4db;});if(_0x5224d0){if(_0x5224d0[_0x0aee('0x26')]!==_0x79c5f7[_0x0aee('0x26')][_0x0aee('0x36')]()){_0x5224d0[_0x0aee('0x38')]=_['toNumber'](moment()[_0x0aee('0x3a')]('x'));}_0x5224d0[_0x0aee('0x26')]=_0x79c5f7[_0x0aee('0x26')]['toLowerCase']();_0x5224d0[_0x0aee('0x35')]=!![];_0x5224d0[_0x0aee('0x3b')](_0x79c5f7);}}}}catch(_0x254279){logger[_0x0aee('0x19')](_0x0aee('0x34'),util[_0x0aee('0x1b')](_0x254279,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x0aee('0x14')]=function(_0xda6eb5){try{if(this[_0x0aee('0x20')](_0xda6eb5)&&this[_0x0aee('0x20')](_0xda6eb5[_0x0aee('0x44')])){logger[_0x0aee('0x23')](_0x0aee('0x45'),_0xda6eb5[_0x0aee('0x46')],_0xda6eb5[_0x0aee('0x47')],_0xda6eb5[_0x0aee('0x44')]);logger[_0x0aee('0x2d')]('[userReport][peerstatus]',util[_0x0aee('0x1b')](_0xda6eb5,{'showHidden':![],'depth':null}));if(this[_0x0aee('0xd')][_0xda6eb5[_0x0aee('0x46')]]){if(!this['agents'][_0xda6eb5[_0x0aee('0x46')]][_0x0aee('0x35')]||_0xda6eb5[_0x0aee('0x44')][_0x0aee('0x36')]()=='registered'){this[_0x0aee('0xd')][_0xda6eb5[_0x0aee('0x46')]][_0x0aee('0x35')]=![];this[_0x0aee('0xd')][_0xda6eb5[_0x0aee('0x46')]][_0x0aee('0x48')]=_0xda6eb5['peerstatus'][_0x0aee('0x36')]();this[_0x0aee('0xd')][_0xda6eb5['peer']][_0x0aee('0x47')]=_0xda6eb5[_0x0aee('0x47')];this[_0x0aee('0xd')][_0xda6eb5[_0x0aee('0x46')]][_0x0aee('0x3b')](_0xda6eb5);}}else if(this[_0x0aee('0xe')][_0xda6eb5[_0x0aee('0x46')]]){this[_0x0aee('0xe')][_0xda6eb5[_0x0aee('0x46')]]['status']=_0xda6eb5['peerstatus'][_0x0aee('0x36')]();this[_0x0aee('0xe')][_0xda6eb5['peer']]['address']=_0xda6eb5['address'];logger[_0x0aee('0x2d')](_0x0aee('0x49'),util[_0x0aee('0x1b')](this[_0x0aee('0xe')][_0xda6eb5['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x0aee('0x3a')](_0x0aee('0x3d'),this[_0x0aee('0xe')][_0xda6eb5['peer']]['name']),_0x0aee('0x4a'),this[_0x0aee('0xe')][_0xda6eb5['peer']]);}else if(this[_0x0aee('0xc')][_0xda6eb5['peer']]){this[_0x0aee('0xc')][_0xda6eb5[_0x0aee('0x46')]]['status']=_0xda6eb5[_0x0aee('0x44')][_0x0aee('0x36')]();this[_0x0aee('0xc')][_0xda6eb5[_0x0aee('0x46')]]['address']=_0xda6eb5[_0x0aee('0x47')];logger[_0x0aee('0x2d')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x0aee('0xc')][_0xda6eb5[_0x0aee('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0aee('0x3a')](_0x0aee('0x2f'),this[_0x0aee('0xc')][_0xda6eb5[_0x0aee('0x46')]][_0x0aee('0x30')]),_0x0aee('0x31'),this[_0x0aee('0xc')][_0xda6eb5[_0x0aee('0x46')]]);}}}catch(_0x266096){logger[_0x0aee('0x19')](_0x0aee('0x4b'),util[_0x0aee('0x1b')](_0x266096,{'showHidden':![],'depth':null}));}};module[_0x0aee('0x4c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 8b3224f..433672d 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x4e1e5f,_0x106ce7){var _0x502c52=function(_0x3e722d){while(--_0x3e722d){_0x4e1e5f['push'](_0x4e1e5f['shift']());}};_0x502c52(++_0x106ce7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x3e6e6e,_0x6dd88){var _0x2ffc3c=function(_0x21da62){while(--_0x21da62){_0x3e6e6e['push'](_0x3e6e6e['shift']());}};_0x2ffc3c(++_0x6dd88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index ec1599b..6c0490d 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a14=['UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','.WAV','monitorFilename','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','answertime','user:agentcomplete','length','then','transferType','undefined','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','lodash','moment','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','from-sip','channel','split','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','accountcode','error','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','seconds','xcally-motion-preview','connectedlinename'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a14,0x123));var _0x42a1=function(_0xf405ad,_0x1afcdf){_0xf405ad=_0xf405ad-0x0;var _0x45c5a7=_0x2a14[_0xf405ad];return _0x45c5a7;};'use strict';var _=require(_0x42a1('0x0'));var moment=require(_0x42a1('0x1'));var util=require('util');var path=require(_0x42a1('0x2'));var Redis=require(_0x42a1('0x3'));var config=require(_0x42a1('0x4'));var logger=require(_0x42a1('0x5'))(_0x42a1('0x6'));var ami=require(_0x42a1('0x7'));var Channel=require(_0x42a1('0x8'));var RpcSetting=require(_0x42a1('0x9'));var applications=[_0x42a1('0xa'),_0x42a1('0xb'),_0x42a1('0xc'),_0x42a1('0xd'),'playback',_0x42a1('0xe')];var dispositions=[_0x42a1('0xf'),'FAILED',_0x42a1('0x10'),_0x42a1('0xf'),_0x42a1('0xf'),'NO\x20ANSWER',_0x42a1('0x11'),_0x42a1('0x12'),'FAILED','FAILED',_0x42a1('0x10')];config[_0x42a1('0x13')]=_[_0x42a1('0x14')](config[_0x42a1('0x13')],{'host':_0x42a1('0x15'),'port':0x18eb});var io=require(_0x42a1('0x16'))(new Redis(config[_0x42a1('0x13')]));function VoiceCallReport(_0x170f8e){this[_0x42a1('0x17')]=_0x170f8e[_0x42a1('0x17')];this[_0x42a1('0x18')]=_0x170f8e['agents'];this[_0x42a1('0x19')]={};ami['on'](_0x42a1('0x1a'),this[_0x42a1('0x1b')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x1d'),this[_0x42a1('0x1b')]['bind'](this));ami['on']('newchannel',this['syncNewChannel'][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x1e'),this[_0x42a1('0x1f')]['bind'](this));ami['on']('varset',this[_0x42a1('0x20')]['bind'](this));ami['on'](_0x42a1('0x21'),this[_0x42a1('0x22')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x23'),this['syncNewCallerId'][_0x42a1('0x1c')](this));ami['on']('attendedtransfer',this[_0x42a1('0x24')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x25'),this[_0x42a1('0x26')]['bind'](this));ami['on'](_0x42a1('0x27'),this[_0x42a1('0x28')][_0x42a1('0x1c')](this));ami['on'](_0x42a1('0x29'),this['syncMusicOnHoldStop'][_0x42a1('0x1c')](this));try{logger[_0x42a1('0x2a')](_0x42a1('0x2b'));ami['actionCoreShowChannels']();}catch(_0xd044d4){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x42a1('0x2c')](_0xd044d4,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x2e')]=function(_0x4b87df){return _0x4b87df!==null&&!_['isUndefined'](_0x4b87df);};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x2f')]=function(_0x404e21,_0x5c6116,_0x16ca6f){io['to'](_0x404e21)[_0x42a1('0x2f')](_0x5c6116,_0x16ca6f);};VoiceCallReport[_0x42a1('0x2d')]['syncNewCallerId']=function(_0x449b99){try{if(this[_0x42a1('0x2e')](_0x449b99)){logger[_0x42a1('0x2a')](_0x42a1('0x30'),_0x449b99[_0x42a1('0x31')],_0x449b99['calleridname'],_0x449b99['calleridnum']);logger['debug'](_0x42a1('0x32'),_0x449b99[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x449b99,{'showHidden':![],'depth':null}));if(_0x449b99[_0x42a1('0x31')]===_0x449b99[_0x42a1('0x33')]){if(!_[_0x42a1('0x34')](this[_0x42a1('0x17')][_0x449b99['uniqueid']])){_[_0x42a1('0x35')](this[_0x42a1('0x17')][_0x449b99[_0x42a1('0x31')]],_[_0x42a1('0x36')](_0x449b99,_[_0x42a1('0x37')](this[_0x42a1('0x17')][_0x449b99[_0x42a1('0x31')]])));}}if(_0x449b99[_0x42a1('0x38')]===_0x42a1('0x39')){if(this['agents'][_0x449b99[_0x42a1('0x3a')]['split']('-')[0x0]]){if(_0x449b99['exten']=='xcally-motion-preview'){this[_0x42a1('0x18')][_0x449b99[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x3c')]=_0x449b99[_0x42a1('0x3d')];this[_0x42a1('0x2f')](util[_0x42a1('0x3e')](_0x42a1('0x3f'),this['agents'][_0x449b99[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['name']),_0x42a1('0x40'),{'destaccountcode':this[_0x42a1('0x18')][_0x449b99['channel']['split']('-')[0x0]][_0x42a1('0x41')],'destconnectedlinenum':_0x449b99['connectedlinenum']});}}}}}catch(_0x58c60d){logger[_0x42a1('0x42')]('[%s][voiceCallReport][newcallerid]',_0x449b99[_0x42a1('0x31')],util['inspect'](_0x58c60d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x43')]=function(_0x4f5542){try{if(this[_0x42a1('0x2e')](_0x4f5542)){logger[_0x42a1('0x44')](_0x42a1('0x45'),_0x4f5542[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x4f5542,{'showHidden':![],'depth':null}));if(_0x4f5542[_0x42a1('0x31')]===_0x4f5542[_0x42a1('0x33')]&&_0x4f5542[_0x42a1('0x3a')]!=_0x42a1('0x46')){if(_[_0x42a1('0x34')](this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]])){logger[_0x42a1('0x2a')](_0x42a1('0x47'),_0x4f5542[_0x42a1('0x31')],_0x4f5542[_0x42a1('0x38')],_0x4f5542[_0x42a1('0x48')]);this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]]=new Channel();this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]]['starttime']=moment()[_0x42a1('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4f5542[_0x42a1('0x31')]][_0x42a1('0x49')]=dispositions[_[_0x42a1('0x4a')](_0x4f5542[_0x42a1('0x4b')])];_[_0x42a1('0x35')](this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]],_[_0x42a1('0x36')](_0x4f5542,_[_0x42a1('0x37')](this[_0x42a1('0x17')][_0x4f5542[_0x42a1('0x31')]])));if(_0x4f5542[_0x42a1('0x38')]===_0x42a1('0x39')){if(this['agents'][_0x4f5542['channel']['split']('-')[0x0]]){if(_[_0x42a1('0x34')](this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x3c')])){this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x3c')]=_0x4f5542['exten'];logger[_0x42a1('0x44')](_0x42a1('0x4c'),_0x4f5542[_0x42a1('0x31')],util[_0x42a1('0x2c')]({'id':this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4f5542[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x41')],'destconnectedlinenum':_0x4f5542[_0x42a1('0x48')]},{'showHidden':![],'depth':null}));this[_0x42a1('0x2f')](util['format']('user:%s',this[_0x42a1('0x18')][_0x4f5542['channel'][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')]),_0x42a1('0x40'),{'id':this['agents'][_0x4f5542[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x4f5542[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x41')],'destconnectedlinenum':_0x4f5542[_0x42a1('0x48')]});}}}}}}}catch(_0x212f01){logger[_0x42a1('0x42')](_0x42a1('0x4e'),_0x4f5542['uniqueid'],util[_0x42a1('0x2c')](_0x212f01,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')]['syncNewExten']=function(_0x1eea9b){try{if(this[_0x42a1('0x2e')](_0x1eea9b)){logger['debug'](_0x42a1('0x4f'),_0x1eea9b[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x1eea9b,{'showHidden':![],'depth':null}));if(_0x1eea9b['uniqueid']===_0x1eea9b[_0x42a1('0x33')]&&_0x1eea9b[_0x42a1('0x48')]!='h'&&_0x1eea9b['channel']!=_0x42a1('0x46')){_0x1eea9b[_0x42a1('0x50')]=_0x1eea9b[_0x42a1('0x50')][_0x42a1('0x51')]();_0x1eea9b[_0x42a1('0x52')]=_0x1eea9b[_0x42a1('0x53')]&&_0x1eea9b[_0x42a1('0x53')][_0x42a1('0x54')](_0x42a1('0x55'))?_0x1eea9b[_0x42a1('0x53')]:(_0x1eea9b[_0x42a1('0x53')]||_0x1eea9b[_0x42a1('0x52')])[_0x42a1('0x51')]();logger['info'](_0x42a1('0x56'),_0x1eea9b['uniqueid'],_0x1eea9b['application'],_0x1eea9b[_0x42a1('0x52')]);if(_[_0x42a1('0x34')](this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]])){this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]]=new Channel();this[_0x42a1('0x17')][_0x1eea9b['uniqueid']][_0x42a1('0x57')]=_0x1eea9b[_0x42a1('0x58')]?moment()[_0x42a1('0x59')](moment[_0x42a1('0x58')](_0x1eea9b[_0x42a1('0x58')])['seconds'](),'seconds')[_0x42a1('0x3e')](_0x42a1('0x5a')):moment()['format'](_0x42a1('0x5a'));this['channels'][_0x1eea9b['uniqueid']][_0x42a1('0x49')]=_0x42a1('0xf');}_[_0x42a1('0x35')](this[_0x42a1('0x17')][_0x1eea9b['uniqueid']],_[_0x42a1('0x36')](_0x1eea9b,_[_0x42a1('0x37')](this['channels'][_0x1eea9b['uniqueid']])));if(_[_0x42a1('0x5b')](applications,_0x1eea9b['application'])){this[_0x42a1('0x17')][_0x1eea9b['uniqueid']][_0x42a1('0x5c')]=_0x1eea9b[_0x42a1('0x50')];this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]][_0x42a1('0x5d')]=_0x1eea9b['applicationdata'];if(_0x1eea9b['application']===_0x42a1('0xa')&&_[_0x42a1('0x54')](_0x1eea9b[_0x42a1('0x52')][_0x42a1('0x51')](),'cdr(')){var _0x2870cf=_0x1eea9b[_0x42a1('0x52')][_0x42a1('0x3b')]('=');var _0x4ba624=_0x2870cf[0x0][_0x42a1('0x51')]()[_0x42a1('0x5e')](/cdr\((.*)\)/);if(_0x4ba624){this[_0x42a1('0x17')][_0x1eea9b[_0x42a1('0x31')]][_0x4ba624[0x1]]=_0x2870cf[0x1];}}else if(_0x1eea9b[_0x42a1('0x50')]===_0x42a1('0xb')){this['channels'][_0x1eea9b[_0x42a1('0x31')]][_0x42a1('0xb')]=_0x1eea9b['applicationdata'][_0x42a1('0x3b')](',')[0x0];}}}}}catch(_0x273e49){logger[_0x42a1('0x42')]('[%s][voiceCallReport][newexten]',_0x1eea9b['uniqueid'],util[_0x42a1('0x2c')](_0x273e49,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x42a1('0x1f')]=function(_0x3b55b5){try{if(this['isNotNull'](_0x3b55b5)){logger['info'](_0x42a1('0x5f'),_0x3b55b5[_0x42a1('0x31')],_0x3b55b5['linkedid'],_0x3b55b5[_0x42a1('0x60')],_0x3b55b5[_0x42a1('0x61')]);logger[_0x42a1('0x44')](_0x42a1('0x62'),_0x3b55b5['uniqueid'],util['inspect'](_0x3b55b5,{'showHidden':![],'depth':null}));if(_0x3b55b5[_0x42a1('0x31')]!==_0x3b55b5['linkedid']){if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]]){if(_0x3b55b5[_0x42a1('0x4b')]==='6'){if(!this['channels'][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x63')]){var _0x12303c=moment();this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x63')]=!![];this[_0x42a1('0x17')][_0x3b55b5['linkedid']]['answertime']=_0x12303c[_0x42a1('0x3e')](_0x42a1('0x5a'));if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x57')]){this['channels'][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x64')]=_0x12303c[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x3b55b5['linkedid']][_0x42a1('0x57')],_0x42a1('0x66'));}}this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x33')]=_0x3b55b5[_0x42a1('0x31')];if(_0x3b55b5['calleridnum']!==_0x42a1('0x67')){this['channels'][_0x3b55b5[_0x42a1('0x33')]]['connectedlinenum']=_0x3b55b5[_0x42a1('0x61')];}this['channels'][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x68')]=_0x3b55b5[_0x42a1('0x60')];this['channels'][_0x3b55b5[_0x42a1('0x33')]]['destinationchannel']=_0x3b55b5[_0x42a1('0x3a')];this[_0x42a1('0x17')][_0x3b55b5['linkedid']][_0x42a1('0x49')]=dispositions[_[_0x42a1('0x4a')](_0x3b55b5[_0x42a1('0x4b')])];if(this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]){this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x69')]=this['agents'][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'];this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]][_0x42a1('0x6a')]=this['agents'][_0x3b55b5['channel'][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')];}}}}else{if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x31')]]){if(_0x3b55b5[_0x42a1('0x4b')]==='6'){if(this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]){this[_0x42a1('0x17')][_0x3b55b5['uniqueid']][_0x42a1('0x69')]=this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'];this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x31')]][_0x42a1('0x6a')]=this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')];}}}}if(_0x3b55b5[_0x42a1('0x4b')]==='6'&&_0x3b55b5[_0x42a1('0x38')]===_0x42a1('0x39')){if(this[_0x42a1('0x18')][_0x3b55b5['channel']['split']('-')[0x0]]){this['agents'][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x3c')]=_0x3b55b5[_0x42a1('0x48')];var _0x14c29f,_0x4bcbb7;if(this['channels'][_0x3b55b5[_0x42a1('0x31')]]){_0x14c29f=this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x31')]][_0x42a1('0x6b')];_0x4bcbb7=this[_0x42a1('0x17')][_0x3b55b5['uniqueid']][_0x42a1('0xb')];}else if(this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]]){_0x14c29f=this[_0x42a1('0x17')][_0x3b55b5['linkedid']]['routealias'];_0x4bcbb7=this[_0x42a1('0x17')][_0x3b55b5[_0x42a1('0x33')]]['queue'];}logger['debug'](_0x42a1('0x6c'),_0x3b55b5[_0x42a1('0x31')],util[_0x42a1('0x2c')]({'id':this['agents'][_0x3b55b5[_0x42a1('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3b55b5[_0x42a1('0x48')],'routealias':_0x14c29f,'queue':_0x4bcbb7||undefined},{'showHidden':![],'depth':null}));this[_0x42a1('0x2f')](util[_0x42a1('0x3e')](_0x42a1('0x3f'),this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]][_0x42a1('0x4d')]),_0x42a1('0x40'),{'id':this[_0x42a1('0x18')][_0x3b55b5[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x3b55b5['channel'][_0x42a1('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3b55b5[_0x42a1('0x48')],'routealias':_0x14c29f,'queue':_0x4bcbb7||undefined});}}}}catch(_0x4ada9f){logger[_0x42a1('0x42')](_0x42a1('0x6d'),_0x3b55b5['uniqueid'],util[_0x42a1('0x2c')](_0x4ada9f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x6e')]=function(_0x342dc1,_0x76824e){try{if(this[_0x42a1('0x17')][_0x342dc1]){logger['info'](_0x42a1('0x6f'),_0x342dc1,_0x76824e);this[_0x42a1('0x17')][_0x342dc1]['monitor']=!![];if(_[_0x42a1('0x70')](_0x76824e,_0x42a1('0x71'))){_0x76824e=_0x76824e['replace'](_0x42a1('0x71'),_0x42a1('0x72'));}this[_0x42a1('0x17')][_0x342dc1][_0x42a1('0x73')]=_0x76824e;var _0x5f097a=_['find'](this[_0x42a1('0x17')][_0x342dc1]['monitors'],{'filename':_0x76824e});if(_['isNil'](_0x5f097a)){this[_0x42a1('0x17')][_0x342dc1][_0x42a1('0x74')][_0x42a1('0x75')]({'filename':_0x76824e,'createdAt':moment()[_0x42a1('0x3e')](_0x42a1('0x5a')),'mixmonitorid':'','status':_0x42a1('0x76')});}}}catch(_0x3505cb){logger['error'](_0x42a1('0x77'),_0x342dc1,util[_0x42a1('0x2c')](_0x3505cb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x42a1('0x20')]=function(_0x27059a){try{if(this[_0x42a1('0x2e')](_0x27059a)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x27059a['uniqueid'],util['inspect'](_0x27059a,{'showHidden':![],'depth':null}));if(this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]]&&_0x27059a[_0x42a1('0x3a')]!='OutgoingSpoolFailed'){if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')])){if(this['isNotNull'](_0x27059a['variable'][_0x42a1('0x79')])){logger[_0x42a1('0x2a')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x6e')](_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);}else if(this[_0x42a1('0x2e')](_0x27059a['variable'][_0x42a1('0x7b')])){logger[_0x42a1('0x2a')](_0x42a1('0x7c'),_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x61')]=_0x27059a['value'];}else if(this['isNotNull'](_0x27059a[_0x42a1('0x78')][_0x42a1('0x7d')])){logger[_0x42a1('0x2a')](_0x42a1('0x7e'),_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a['uniqueid']][_0x42a1('0x7f')]=_0x27059a['value'];}else if(this[_0x42a1('0x2e')](_0x27059a['variable']['xmd-cdrtype'])){logger['info'](_0x42a1('0x80'),_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this['channels'][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x81')]=_0x27059a[_0x42a1('0x7a')];}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x82')])){logger[_0x42a1('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x27059a[_0x42a1('0x31')],_0x27059a['value'][_0x42a1('0x3b')](',')[0x0]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0xb')]=_0x27059a[_0x42a1('0x7a')][_0x42a1('0x3b')](',')[0x0];}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x83')])){logger[_0x42a1('0x2a')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x27059a[_0x42a1('0x31')],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x84')]=_0x27059a[_0x42a1('0x7a')];}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x85')])){logger[_0x42a1('0x2a')](_0x42a1('0x86'),_0x27059a['uniqueid'],_0x27059a[_0x42a1('0x7a')]);this['channels'][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x87')]=_0x27059a[_0x42a1('0x7a')];}else if(this['isNotNull'](_0x27059a[_0x42a1('0x78')][_0x42a1('0x88')])){logger[_0x42a1('0x2a')](_0x42a1('0x89'),_0x27059a['uniqueid'],_0x27059a['value']);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]]['calleridpreview']=_0x27059a[_0x42a1('0x7a')];}else if(this[_0x42a1('0x2e')](_0x27059a['variable']['xmcs-queue'])){logger[_0x42a1('0x2a')](_0x42a1('0x8a'),_0x27059a['uniqueid'],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0xb')]=_0x27059a['value'];}else if(this[_0x42a1('0x2e')](_0x27059a['variable'][_0x42a1('0x8b')])){logger[_0x42a1('0x2a')](_0x42a1('0x8c'),_0x27059a['uniqueid'],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x31')]][_0x42a1('0x8d')]=_0x27059a[_0x42a1('0x7a')];}}}else if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')][_0x42a1('0x79')])){if(_0x27059a[_0x42a1('0x7a')]){var _0x524b88=path[_0x42a1('0x8e')](_0x27059a[_0x42a1('0x7a')])[_0x42a1('0x4d')];logger[_0x42a1('0x2a')](_0x42a1('0x8f'),_0x524b88,_0x27059a['value']);this[_0x42a1('0x6e')](_0x524b88,_0x27059a[_0x42a1('0x7a')]);}}else if(this['channels'][_0x27059a['linkedid']]){if(this[_0x42a1('0x2e')](_0x27059a[_0x42a1('0x78')])){if(this['isNotNull'](_0x27059a[_0x42a1('0x78')][_0x42a1('0x8b')])){logger[_0x42a1('0x2a')](_0x42a1('0x8c'),_0x27059a['linkedid'],_0x27059a[_0x42a1('0x7a')]);this[_0x42a1('0x17')][_0x27059a[_0x42a1('0x33')]][_0x42a1('0x90')]=_0x27059a['value'];}}}}}catch(_0x508a32){logger[_0x42a1('0x42')](_0x42a1('0x91'),_0x27059a[_0x42a1('0x31')],util['inspect'](_0x508a32,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x42a1('0x2d')][_0x42a1('0x22')]=function(_0x1c41e2){try{if(this[_0x42a1('0x2e')](_0x1c41e2)){logger[_0x42a1('0x44')](_0x42a1('0x92'),_0x1c41e2[_0x42a1('0x31')],util[_0x42a1('0x2c')](_0x1c41e2,{'showHidden':![],'depth':null}));if(this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]]){logger[_0x42a1('0x2a')](_0x42a1('0x93'),_0x1c41e2[_0x42a1('0x31')],_0x1c41e2[_0x42a1('0x94')]);var _0xf29828=moment();this[_0x42a1('0x17')][_0x1c41e2['uniqueid']]['endtime']=_0xf29828[_0x42a1('0x3e')](_0x42a1('0x5a'));this[_0x42a1('0x17')][_0x1c41e2['uniqueid']]['duration']=_0xf29828[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x57')],'seconds');if(this['channels'][_0x1c41e2['uniqueid']][_0x42a1('0x63')]){this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x95')]=_0xf29828[_0x42a1('0x65')](this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x96')],_0x42a1('0x66'));this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x64')]=this[_0x42a1('0x17')][_0x1c41e2[_0x42a1('0x31')]][_0x42a1('0x58')]-this['channels'][_0x1c41e2[_0x42a1('0x31')]]['billableseconds'];}if(_0x1c41e2[_0x42a1('0x38')]===_0x42a1('0x39')){if(this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]]){this[_0x42a1('0x18')][_0x1c41e2['channel'][_0x42a1('0x3b')]('-')[0x0]]=_['omit'](this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')][_0x42a1('0x3b')]('-')[0x0]],[_0x42a1('0x3c')]);logger[_0x42a1('0x44')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x1c41e2[_0x42a1('0x31')],util[_0x42a1('0x2c')]({'id':this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x1c41e2['channel'][_0x42a1('0x3b')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x42a1('0x3e')](_0x42a1('0x3f'),this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x4d')]),_0x42a1('0x97'),{'id':this[_0x42a1('0x18')][_0x1c41e2['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x42a1('0x18')][_0x1c41e2[_0x42a1('0x3a')]['split']('-')[0x0]][_0x42a1('0x41')]});for(var _0x50746b=0x0;_0x50746b0x0?_0x3d2076:0x0;this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x58')]=this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x58')]>_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x6e')])?_[_0x8aa8('0x6d')](_0x33e9ae[_0x8aa8('0x6e')]):this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]][_0x8aa8('0x58')];this[_0x8aa8('0x50')](this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]],_0x8aa8('0x16'));}logger[_0x8aa8('0x45')](_0x8aa8('0x6f'),util['inspect'](this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]],{'showHidden':![],'depth':null}));ami[_0x8aa8('0x43')](_0x8aa8('0x70'),this[_0x8aa8('0x13')][_0x33e9ae[_0x8aa8('0x69')]]);}}}catch(_0x127c03){logger[_0x8aa8('0x3b')](_0x8aa8('0x68'),util['inspect'](_0x127c03,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x19')]=function(_0x4f29ca){logger[_0x8aa8('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x8aa8('0x3d')](_0x4f29ca,{'showHidden':![],'depth':null}));this[_0x8aa8('0x14')]=!![];};VoiceQueueReport['prototype'][_0x8aa8('0x1a')]=function(_0x16036a){try{if(this[_0x8aa8('0x63')](_0x16036a)){logger[_0x8aa8('0x45')](_0x8aa8('0x71'),_0x16036a[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x16036a,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x8aa8('0x10')][_0x16036a[_0x8aa8('0x48')]]))this[_0x8aa8('0x10')][_0x16036a[_0x8aa8('0x48')]]=[];if(_['isUndefined'](this['channels'][_0x16036a[_0x8aa8('0x48')]]))this[_0x8aa8('0x34')][_0x16036a[_0x8aa8('0x48')]]={};var _0x39505e=new QueueReport();_0x39505e['name']=_0x16036a['queue'];_0x39505e['type']=this[_0x8aa8('0x13')][_0x39505e[_0x8aa8('0x4b')]]&&this[_0x8aa8('0x13')][_0x39505e[_0x8aa8('0x4b')]][_0x8aa8('0x51')]?this[_0x8aa8('0x13')][_0x39505e[_0x8aa8('0x4b')]][_0x8aa8('0x51')]||_0x8aa8('0x72'):'inbound';_0x39505e[_0x8aa8('0x69')]=_0x16036a['queue'];_0x39505e['queuecallerjoinAt']=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x39505e[_0x8aa8('0x74')]=_0x16036a['position'];_0x39505e[_0x8aa8('0x75')]=_0x16036a['count'];_0x39505e[_0x8aa8('0x48')]=_0x16036a[_0x8aa8('0x48')];_0x39505e[_0x8aa8('0x76')]=this[_0x8aa8('0x34')][_0x16036a[_0x8aa8('0x48')]]['routealias'];logger['info'](_0x8aa8('0x77'),_0x39505e[_0x8aa8('0x4b')],_0x39505e[_0x8aa8('0x51')]);_[_0x8aa8('0x78')](_0x39505e,_[_0x8aa8('0x79')](_0x16036a,_[_0x8aa8('0x7a')](_0x39505e)));this[_0x8aa8('0x10')][_0x16036a[_0x8aa8('0x48')]]['push'](_0x39505e);this[_0x8aa8('0x34')][_0x16036a[_0x8aa8('0x48')]]=_0x39505e;this['emitVoiceQueueChannelSave'](_0x39505e,'queuecallerjoin');}}catch(_0x202b9c){logger[_0x8aa8('0x3b')]('[%s][voiceQueueReport][queuecallerjoin]',_0x16036a[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x202b9c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['syncQueueCallerAbandon']=function(_0x4d213b){try{if(this['isNotNull'](_0x4d213b)){logger[_0x8aa8('0x45')](_0x8aa8('0x7b'),_0x4d213b[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x4d213b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4d213b[_0x8aa8('0x48')]]){var _0x5ed97b=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x4d213b['uniqueid']]);_0x5ed97b[_0x8aa8('0x7d')]=![];_0x5ed97b['queuecallercompleteAt']=null;_0x5ed97b['holdtime']=_0x4d213b[_0x8aa8('0x7e')];_0x5ed97b['originalposition']=_0x4d213b[_0x8aa8('0x7f')];_0x5ed97b[_0x8aa8('0x1b')]=!![];_0x5ed97b[_0x8aa8('0x80')]=moment()['format'](_0x8aa8('0x73'));_0x5ed97b[_0x8aa8('0x81')]=_0x8aa8('0x82');_0x5ed97b[_0x8aa8('0x83')]=null;logger[_0x8aa8('0x6a')](_0x8aa8('0x84'),_0x5ed97b['name'],_0x5ed97b['type']);this[_0x8aa8('0x34')][_0x4d213b['uniqueid']]=_0x5ed97b;this['emitVoiceQueueChannelRemove'](_0x5ed97b,'queuecallerabandon');}}}catch(_0x4bf532){logger['error'](_0x8aa8('0x7b'),_0x4d213b[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x4bf532,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x1e')]=function(_0xb9fb0){try{if(this[_0x8aa8('0x63')](_0xb9fb0)){logger[_0x8aa8('0x45')](_0x8aa8('0x85'),_0xb9fb0[_0x8aa8('0x48')],util['inspect'](_0xb9fb0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xb9fb0[_0x8aa8('0x48')]]){var _0x3f72cb=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0xb9fb0[_0x8aa8('0x48')]]);_0x3f72cb[_0x8aa8('0x86')]=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x3f72cb['connectedlinenum']=_0xb9fb0[_0x8aa8('0x87')];_0x3f72cb[_0x8aa8('0x88')]=_0xb9fb0[_0x8aa8('0x88')];logger['info'](_0x8aa8('0x89'),_0x3f72cb[_0x8aa8('0x4b')],_0x3f72cb['type'],_0xb9fb0[_0x8aa8('0x87')],_0xb9fb0[_0x8aa8('0x88')]);this[_0x8aa8('0x34')][_0xb9fb0[_0x8aa8('0x48')]]=_0x3f72cb;this[_0x8aa8('0x44')](_0x3f72cb,'queuecallerleave');}}}catch(_0x1e23fe){logger[_0x8aa8('0x3b')](_0x8aa8('0x85'),_0xb9fb0['uniqueid'],util[_0x8aa8('0x3d')](_0x1e23fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x8a')]=function(_0x1710b4){try{if(this[_0x8aa8('0x63')](_0x1710b4)){logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x1710b4[_0x8aa8('0x48')],util['inspect'](_0x1710b4,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x10')][_0x1710b4[_0x8aa8('0x48')]]){var _0x18f62c=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x1710b4['uniqueid']]);_0x18f62c[_0x8aa8('0x7d')]=!![];_0x18f62c[_0x8aa8('0x81')]=_0x8aa8('0x8b');logger[_0x8aa8('0x6a')](_0x8aa8('0x8c'),_0x18f62c[_0x8aa8('0x4b')],_0x18f62c[_0x8aa8('0x51')]);}}}catch(_0x54361a){logger['error'](_0x8aa8('0x8d'),_0x1710b4[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x54361a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')][_0x8aa8('0x8e')]=function(_0x270120){try{if(this[_0x8aa8('0x63')](_0x270120)){logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x270120[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x270120,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x270120[_0x8aa8('0x48')]]){var _0x5edf3e=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x48')]]);_0x5edf3e[_0x8aa8('0x1b')]=![];_0x5edf3e[_0x8aa8('0x80')]=null;_0x5edf3e[_0x8aa8('0x8f')]=!![];_0x5edf3e['lastAssignedTo']=_0x270120[_0x8aa8('0x90')];_0x5edf3e[_0x8aa8('0x7e')]=_0x270120[_0x8aa8('0x7e')];_0x5edf3e[_0x8aa8('0x7d')]=!![];_0x5edf3e[_0x8aa8('0x91')]=![];_0x5edf3e['queuecallerexitAt']=null;if(!_0x5edf3e[_0x8aa8('0x92')]){if(_0x270120[_0x8aa8('0x93')]==_0x8aa8('0x92')){_0x5edf3e[_0x8aa8('0x81')]=_0x8aa8('0x94');logger[_0x8aa8('0x6a')](_0x8aa8('0x95'),_0x5edf3e[_0x8aa8('0x4b')],_0x5edf3e[_0x8aa8('0x51')]);}else{if(_[_0x8aa8('0x96')](_0x270120['channel']['toLowerCase'](),_0x8aa8('0x97'))){if(this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x98')]]){var _0x31a1de=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x270120['linkedid']]);_0x31a1de[_0x8aa8('0x7d')]=![];_0x31a1de['queuecallerexit']=!![];_0x31a1de[_0x8aa8('0x99')]=moment(_0x5edf3e[_0x8aa8('0x9a')])[_0x8aa8('0x9b')](_0x270120[_0x8aa8('0x7e')],'seconds')[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x31a1de['queuecallerexitreason']='FORWARDTRANSFER';_0x31a1de[_0x8aa8('0x92')]=!![];_0x31a1de['transfertype']='FORWARD';_0x31a1de[_0x8aa8('0x9c')]=_0x270120[_0x8aa8('0x9d')];_0x31a1de['transferuniqueid']=_0x270120[_0x8aa8('0x48')];logger[_0x8aa8('0x6a')](_0x8aa8('0x9e'),_0x31a1de[_0x8aa8('0x4b')],_0x31a1de['type']);var _0x124887=this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x98')]];this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x98')]]=this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x48')]];this[_0x8aa8('0x10')][_0x270120[_0x8aa8('0x48')]]=_0x124887;}}else{_0x5edf3e[_0x8aa8('0x81')]='COMPLETEDBY'+_0x270120[_0x8aa8('0x93')][_0x8aa8('0x9f')]();logger[_0x8aa8('0x6a')](_0x8aa8('0xa0'),_0x5edf3e['name'],_0x5edf3e[_0x8aa8('0x51')],_0x5edf3e[_0x8aa8('0x81')]);}}}this[_0x8aa8('0x34')][_0x270120[_0x8aa8('0x48')]]=_0x5edf3e;this['emitVoiceQueueChannelRemove'](_0x5edf3e,_0x8aa8('0x1f'));}}}catch(_0xb8456e){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x270120[_0x8aa8('0x48')],util['inspect'](_0xb8456e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['syncVarSet']=function(_0x5802ec){try{if(this[_0x8aa8('0x63')](_0x5802ec)){logger[_0x8aa8('0x45')](_0x8aa8('0xa1'),_0x5802ec[_0x8aa8('0x48')],util['inspect'](_0x5802ec,{'showHidden':![],'depth':null}));this[_0x8aa8('0xa2')](_0x5802ec[_0x8aa8('0x48')],_[_0x8aa8('0x7a')](_0x5802ec[_0x8aa8('0xa3')])[0x0],_0x5802ec[_0x8aa8('0xa4')]);if(this[_0x8aa8('0x10')][_0x5802ec['uniqueid']]){var _0x52095b=_[_0x8aa8('0x7c')](this[_0x8aa8('0x10')][_0x5802ec[_0x8aa8('0x48')]]);if(_0x52095b){if(this[_0x8aa8('0x63')](_0x5802ec[_0x8aa8('0xa3')])&&this['isNotNull'](_0x5802ec['variable']['queuestatus'])){switch(_0x5802ec['value']){case _0x8aa8('0xa5'):_0x52095b[_0x8aa8('0x91')]=![];_0x52095b['queuecallerexitAt']=null;break;case _0x8aa8('0xa6'):_0x52095b[_0x8aa8('0xa7')]=_0x8aa8('0xa8');_0x52095b['queuecallerexit']=!![];_0x52095b['queuecallerexitAt']=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x52095b[_0x8aa8('0x86')]=moment()['format'](_0x8aa8('0x73'));logger['debug'](_0x8aa8('0xa9'),_0x5802ec[_0x8aa8('0x48')],util['inspect'](_0x52095b,{'showHidden':![],'depth':null}));ami[_0x8aa8('0x43')](_0x8aa8('0xaa'),_0x52095b);break;default:_0x52095b[_0x8aa8('0x91')]=!![];_0x52095b[_0x8aa8('0x99')]=moment()['format'](_0x8aa8('0x73'));_0x52095b['queuecallerleaveAt']=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));}_0x52095b[_0x8aa8('0x1b')]=![];_0x52095b['queuecallerabandonAt']=null;_0x52095b['queuecallerexitreason']=_0x5802ec[_0x8aa8('0xa4')];this[_0x8aa8('0x34')][_0x5802ec[_0x8aa8('0x48')]]=_0x52095b;this[_0x8aa8('0x41')](_0x52095b,_0x8aa8('0x21'));}else if(this['isNotNull'](_0x5802ec[_0x8aa8('0xa3')])&&this[_0x8aa8('0x63')](_0x5802ec[_0x8aa8('0xa3')][_0x8aa8('0xab')])){if(!_0x52095b[_0x8aa8('0x1b')]){_0x52095b[_0x8aa8('0x91')]=!![];_0x52095b[_0x8aa8('0x99')]=moment()[_0x8aa8('0x49')](_0x8aa8('0x73'));_0x52095b[_0x8aa8('0x81')]=_0x8aa8('0xac');_0x52095b['queuecallerleaveAt']=moment()[_0x8aa8('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8aa8('0x34')][_0x5802ec[_0x8aa8('0x48')]]=_0x52095b;}}logger[_0x8aa8('0x6a')](_0x8aa8('0xad'),_0x5802ec[_0x8aa8('0x48')],_0x52095b[_0x8aa8('0x4b')],_0x52095b['type'],_['keys'](_0x5802ec['variable'])[0x0],_0x5802ec[_0x8aa8('0xa4')]);_0x52095b[_0x8aa8('0x3f')]=this[_0x8aa8('0x3f')][_0x5802ec[_0x8aa8('0x48')]];}}}}catch(_0x5b4a32){logger[_0x8aa8('0x3b')](_0x8aa8('0xa1'),_0x5802ec[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x5b4a32,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8aa8('0xb')]['addVariable']=function(_0x281d46,_0x1e1e11,_0x40584a){var _0x235ed0=[_0x8aa8('0xae'),_0x8aa8('0xaf'),'rtpaudioqosjitter',_0x8aa8('0xb0'),_0x8aa8('0xb1'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x8aa8('0xb2'),'sipcallid','sipuri','bridgepeer',_0x8aa8('0xb3'),'membercalls','memberdynamic',_0x8aa8('0xb4'),_0x8aa8('0xb5'),_0x8aa8('0x90'),_0x8aa8('0xb6'),_0x8aa8('0xb7')];if(!_[_0x8aa8('0x36')](_0x1e1e11)&&!_[_0x8aa8('0xb8')](_0x235ed0,_0x1e1e11)){if(_[_0x8aa8('0x64')](this['variables'][_0x281d46])){this[_0x8aa8('0x3f')][_0x281d46]={};}this[_0x8aa8('0x3f')][_0x281d46][_0x1e1e11]=_0x40584a;}};VoiceQueueReport[_0x8aa8('0xb')]['syncHangup']=function(_0x272872){try{if(this[_0x8aa8('0x63')](_0x272872)){logger[_0x8aa8('0x45')]('[%s][voiceQueueReport][hangup]',_0x272872[_0x8aa8('0x48')],util[_0x8aa8('0x3d')](_0x272872,{'showHidden':![],'depth':null}));if(this[_0x8aa8('0x10')][_0x272872[_0x8aa8('0x48')]]){for(var _0x1d072e=0x0,_0x5d7b0d={};_0x1d072e0x0?_0x264513:0x0;this[_0x6d81('0x42')][_0x5096d1[_0x6d81('0x6b')]]['talking']=this[_0x6d81('0x42')][_0x5096d1[_0x6d81('0x6b')]][_0x6d81('0x2e')]>_[_0x6d81('0x70')](_0x5096d1[_0x6d81('0x73')])?_[_0x6d81('0x70')](_0x5096d1[_0x6d81('0x73')]):this[_0x6d81('0x42')][_0x5096d1[_0x6d81('0x6b')]][_0x6d81('0x2e')];this['emitVoiceQueueSummary'](this[_0x6d81('0x42')][_0x5096d1[_0x6d81('0x6b')]],_0x6d81('0x11'));}logger['debug'](_0x6d81('0x74'),util[_0x6d81('0x3e')](this[_0x6d81('0x42')][_0x5096d1[_0x6d81('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x6d81('0x45')](_0x6d81('0x75'),this[_0x6d81('0x42')][_0x5096d1[_0x6d81('0x6b')]]);}}}catch(_0x5368b1){logger[_0x6d81('0x3a')](_0x6d81('0x69'),util[_0x6d81('0x3e')](_0x5368b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d81('0x8')][_0x6d81('0x14')]=function(_0x4c4522){logger[_0x6d81('0x47')](_0x6d81('0x76'),util[_0x6d81('0x3e')](_0x4c4522,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x6d81('0x15')]=function(_0xb37103){try{if(this[_0x6d81('0x63')](_0xb37103)){logger[_0x6d81('0x47')](_0x6d81('0x77'),_0xb37103[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0xb37103,{'showHidden':![],'depth':null}));if(_[_0x6d81('0x64')](this[_0x6d81('0x3c')][_0xb37103[_0x6d81('0x49')]]))this['queueReports'][_0xb37103['uniqueid']]=[];if(_[_0x6d81('0x64')](this[_0x6d81('0xe')][_0xb37103[_0x6d81('0x49')]]))this['channels'][_0xb37103[_0x6d81('0x49')]]={};var _0x3b05ae=new QueueReport();_0x3b05ae[_0x6d81('0x4b')]=_0xb37103[_0x6d81('0x6b')];_0x3b05ae[_0x6d81('0x53')]=this[_0x6d81('0x42')][_0x3b05ae[_0x6d81('0x4b')]]&&this[_0x6d81('0x42')][_0x3b05ae[_0x6d81('0x4b')]][_0x6d81('0x53')]?this[_0x6d81('0x42')][_0x3b05ae[_0x6d81('0x4b')]]['type']||_0x6d81('0x54'):_0x6d81('0x54');_0x3b05ae[_0x6d81('0x6b')]=_0xb37103[_0x6d81('0x6b')];_0x3b05ae[_0x6d81('0x78')]=moment()[_0x6d81('0x50')](_0x6d81('0x79'));_0x3b05ae['position']=_0xb37103[_0x6d81('0x7a')];_0x3b05ae['count']=_0xb37103[_0x6d81('0x7b')];_0x3b05ae[_0x6d81('0x49')]=_0xb37103[_0x6d81('0x49')];_0x3b05ae['routealias']=this[_0x6d81('0xe')][_0xb37103['uniqueid']][_0x6d81('0x7c')];logger[_0x6d81('0x6d')](_0x6d81('0x7d'),_0x3b05ae[_0x6d81('0x4b')],_0x3b05ae[_0x6d81('0x53')]);_['merge'](_0x3b05ae,_[_0x6d81('0x7e')](_0xb37103,_[_0x6d81('0x7f')](_0x3b05ae)));this[_0x6d81('0x3c')][_0xb37103[_0x6d81('0x49')]][_0x6d81('0x80')](_0x3b05ae);this[_0x6d81('0xe')][_0xb37103[_0x6d81('0x49')]]=_0x3b05ae;this[_0x6d81('0x46')](_0x3b05ae,_0x6d81('0x81'));}}catch(_0x4e2fc7){logger['error'](_0x6d81('0x77'),_0xb37103[_0x6d81('0x49')],util['inspect'](_0x4e2fc7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d81('0x8')]['syncQueueCallerAbandon']=function(_0x37595b){try{if(this[_0x6d81('0x63')](_0x37595b)){logger[_0x6d81('0x47')](_0x6d81('0x82'),_0x37595b[_0x6d81('0x49')],util['inspect'](_0x37595b,{'showHidden':![],'depth':null}));if(this[_0x6d81('0x3c')][_0x37595b[_0x6d81('0x49')]]){var _0x2bef75=_[_0x6d81('0x83')](this[_0x6d81('0x3c')][_0x37595b['uniqueid']]);_0x2bef75['queuecallercomplete']=![];_0x2bef75[_0x6d81('0x84')]=null;_0x2bef75['holdtime']=_0x37595b['holdtime'];_0x2bef75[_0x6d81('0x85')]=_0x37595b[_0x6d81('0x85')];_0x2bef75[_0x6d81('0x86')]=!![];_0x2bef75[_0x6d81('0x87')]=moment()['format'](_0x6d81('0x79'));_0x2bef75['queuecallerexitreason']='ABANDONED';_0x2bef75['lastAssignedTo']=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x2bef75['name'],_0x2bef75[_0x6d81('0x53')]);this[_0x6d81('0xe')][_0x37595b['uniqueid']]=_0x2bef75;this['emitVoiceQueueChannelRemove'](_0x2bef75,_0x6d81('0x86'));}}}catch(_0x1914d6){logger['error'](_0x6d81('0x82'),_0x37595b['uniqueid'],util[_0x6d81('0x3e')](_0x1914d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d81('0x8')][_0x6d81('0x18')]=function(_0x33f31e){try{if(this[_0x6d81('0x63')](_0x33f31e)){logger[_0x6d81('0x47')](_0x6d81('0x88'),_0x33f31e[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x33f31e,{'showHidden':![],'depth':null}));if(this[_0x6d81('0x3c')][_0x33f31e[_0x6d81('0x49')]]){var _0x443de7=_[_0x6d81('0x83')](this[_0x6d81('0x3c')][_0x33f31e[_0x6d81('0x49')]]);_0x443de7[_0x6d81('0x89')]=moment()[_0x6d81('0x50')](_0x6d81('0x79'));_0x443de7[_0x6d81('0x8a')]=_0x33f31e[_0x6d81('0x8a')];_0x443de7[_0x6d81('0x8b')]=_0x33f31e[_0x6d81('0x8b')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x443de7[_0x6d81('0x4b')],_0x443de7['type'],_0x33f31e['connectedlinenum'],_0x33f31e[_0x6d81('0x8b')]);this[_0x6d81('0xe')][_0x33f31e[_0x6d81('0x49')]]=_0x443de7;this['emitVoiceQueueChannelSave'](_0x443de7,'queuecallerleave');}}}catch(_0x5efca5){logger[_0x6d81('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x33f31e['uniqueid'],util[_0x6d81('0x3e')](_0x5efca5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6d81('0x1c')]=function(_0x28f0e5){try{if(this[_0x6d81('0x63')](_0x28f0e5)){logger[_0x6d81('0x47')](_0x6d81('0x8c'),_0x28f0e5[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x28f0e5,{'showHidden':![],'depth':null}));if(this[_0x6d81('0x3c')][_0x28f0e5[_0x6d81('0x49')]]){var _0xcf08c7=_[_0x6d81('0x83')](this[_0x6d81('0x3c')][_0x28f0e5[_0x6d81('0x49')]]);_0xcf08c7[_0x6d81('0x8d')]=!![];_0xcf08c7[_0x6d81('0x8e')]=_0x6d81('0x8f');logger[_0x6d81('0x6d')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0xcf08c7['name'],_0xcf08c7[_0x6d81('0x53')]);}}}catch(_0x53dac8){logger['error'](_0x6d81('0x8c'),_0x28f0e5[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x53dac8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6d81('0x8')][_0x6d81('0x1a')]=function(_0x880e40){try{if(this[_0x6d81('0x63')](_0x880e40)){logger[_0x6d81('0x47')](_0x6d81('0x90'),_0x880e40[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x880e40,{'showHidden':![],'depth':null}));if(this[_0x6d81('0x3c')][_0x880e40['uniqueid']]){var _0x11a414=_['last'](this[_0x6d81('0x3c')][_0x880e40[_0x6d81('0x49')]]);_0x11a414['queuecallerabandon']=![];_0x11a414[_0x6d81('0x87')]=null;_0x11a414[_0x6d81('0x91')]=!![];_0x11a414[_0x6d81('0x92')]=_0x880e40[_0x6d81('0x93')];_0x11a414[_0x6d81('0x94')]=_0x880e40[_0x6d81('0x94')];_0x11a414['queuecallercomplete']=!![];_0x11a414[_0x6d81('0x95')]=![];_0x11a414[_0x6d81('0x96')]=null;if(!_0x11a414[_0x6d81('0x97')]){if(_0x880e40[_0x6d81('0x98')]=='transfer'){_0x11a414[_0x6d81('0x8e')]=_0x6d81('0x99');logger[_0x6d81('0x6d')](_0x6d81('0x9a'),_0x11a414[_0x6d81('0x4b')],_0x11a414[_0x6d81('0x53')]);}else{if(_['startsWith'](_0x880e40[_0x6d81('0x36')][_0x6d81('0x9b')](),_0x6d81('0x9c'))){if(this['queueReports'][_0x880e40[_0x6d81('0x9d')]]){var _0x1cc85e=_[_0x6d81('0x83')](this[_0x6d81('0x3c')][_0x880e40[_0x6d81('0x9d')]]);_0x1cc85e['queuecallercomplete']=![];_0x1cc85e[_0x6d81('0x95')]=!![];_0x1cc85e['queuecallerexitAt']=moment(_0x11a414[_0x6d81('0x78')])[_0x6d81('0x9e')](_0x880e40['holdtime'],'seconds')[_0x6d81('0x50')](_0x6d81('0x79'));_0x1cc85e[_0x6d81('0x8e')]='FORWARDTRANSFER';_0x1cc85e[_0x6d81('0x97')]=!![];_0x1cc85e['transfertype']='FORWARD';_0x1cc85e[_0x6d81('0x9f')]=_0x880e40['destexten'];_0x1cc85e['transferuniqueid']=_0x880e40['uniqueid'];logger['info'](_0x6d81('0xa0'),_0x1cc85e[_0x6d81('0x4b')],_0x1cc85e['type']);var _0x5841a3=this['queueReports'][_0x880e40['linkedid']];this['queueReports'][_0x880e40[_0x6d81('0x9d')]]=this[_0x6d81('0x3c')][_0x880e40[_0x6d81('0x49')]];this[_0x6d81('0x3c')][_0x880e40[_0x6d81('0x49')]]=_0x5841a3;}}else{_0x11a414['queuecallerexitreason']=_0x6d81('0xa1')+_0x880e40[_0x6d81('0x98')][_0x6d81('0xa2')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x11a414[_0x6d81('0x4b')],_0x11a414['type'],_0x11a414['queuecallerexitreason']);}}}this[_0x6d81('0xe')][_0x880e40['uniqueid']]=_0x11a414;this['emitVoiceQueueChannelRemove'](_0x11a414,'agentcomplete');}}}catch(_0x170b5f){logger[_0x6d81('0x3a')](_0x6d81('0x90'),_0x880e40[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x170b5f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x496cf9){try{if(this[_0x6d81('0x63')](_0x496cf9)){logger[_0x6d81('0x47')]('[%s][voiceQueueReport][varset]',_0x496cf9[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x496cf9,{'showHidden':![],'depth':null}));this[_0x6d81('0xa3')](_0x496cf9[_0x6d81('0x49')],_[_0x6d81('0x7f')](_0x496cf9[_0x6d81('0xa4')])[0x0],_0x496cf9[_0x6d81('0xa5')]);if(this[_0x6d81('0x3c')][_0x496cf9[_0x6d81('0x49')]]){var _0x2c28a0=_[_0x6d81('0x83')](this[_0x6d81('0x3c')][_0x496cf9['uniqueid']]);if(_0x2c28a0){if(this[_0x6d81('0x63')](_0x496cf9['variable'])&&this['isNotNull'](_0x496cf9[_0x6d81('0xa4')]['queuestatus'])){switch(_0x496cf9[_0x6d81('0xa5')]){case _0x6d81('0xa6'):_0x2c28a0['queuecallerexit']=![];_0x2c28a0[_0x6d81('0x96')]=null;break;case _0x6d81('0xa7'):_0x2c28a0[_0x6d81('0xa8')]='timeout';_0x2c28a0[_0x6d81('0x95')]=!![];_0x2c28a0[_0x6d81('0x96')]=moment()[_0x6d81('0x50')](_0x6d81('0x79'));_0x2c28a0[_0x6d81('0x89')]=moment()['format'](_0x6d81('0x79'));logger[_0x6d81('0x47')](_0x6d81('0xa9'),_0x496cf9['uniqueid'],util['inspect'](_0x2c28a0,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x2c28a0);break;default:_0x2c28a0[_0x6d81('0x95')]=!![];_0x2c28a0[_0x6d81('0x96')]=moment()[_0x6d81('0x50')](_0x6d81('0x79'));_0x2c28a0[_0x6d81('0x89')]=moment()['format'](_0x6d81('0x79'));}_0x2c28a0['queuecallerabandon']=![];_0x2c28a0[_0x6d81('0x87')]=null;_0x2c28a0[_0x6d81('0x8e')]=_0x496cf9['value'];this[_0x6d81('0xe')][_0x496cf9[_0x6d81('0x49')]]=_0x2c28a0;this['emitVoiceQueueChannelRemove'](_0x2c28a0,_0x6d81('0x1d'));}else if(this[_0x6d81('0x63')](_0x496cf9[_0x6d81('0xa4')])&&this[_0x6d81('0x63')](_0x496cf9[_0x6d81('0xa4')]['queueposition'])){if(!_0x2c28a0['queuecallerabandon']){_0x2c28a0[_0x6d81('0x95')]=!![];_0x2c28a0[_0x6d81('0x96')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2c28a0[_0x6d81('0x8e')]=_0x6d81('0xaa');_0x2c28a0[_0x6d81('0x89')]=moment()[_0x6d81('0x50')](_0x6d81('0x79'));this[_0x6d81('0xe')][_0x496cf9[_0x6d81('0x49')]]=_0x2c28a0;}}logger[_0x6d81('0x6d')](_0x6d81('0xab'),_0x496cf9[_0x6d81('0x49')],_0x2c28a0[_0x6d81('0x4b')],_0x2c28a0[_0x6d81('0x53')],_['keys'](_0x496cf9[_0x6d81('0xa4')])[0x0],_0x496cf9[_0x6d81('0xa5')]);_0x2c28a0['variables']=this[_0x6d81('0x10')][_0x496cf9[_0x6d81('0x49')]];}}}}catch(_0x459f7a){logger[_0x6d81('0x3a')](_0x6d81('0xac'),_0x496cf9[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x459f7a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6d81('0xa3')]=function(_0xbf30cc,_0x181be8,_0x542635){var _0x27f6fe=[_0x6d81('0xad'),_0x6d81('0xae'),_0x6d81('0xaf'),_0x6d81('0xb0'),_0x6d81('0xb1'),_0x6d81('0xb2'),_0x6d81('0xb3'),_0x6d81('0xb4'),_0x6d81('0xb5'),_0x6d81('0xb6'),_0x6d81('0xb7'),'bridgepvtcallid',_0x6d81('0xb8'),_0x6d81('0xb9'),_0x6d81('0xba'),_0x6d81('0xbb'),_0x6d81('0x93'),_0x6d81('0xbc'),_0x6d81('0xbd')];if(!_[_0x6d81('0x35')](_0x181be8)&&!_[_0x6d81('0xbe')](_0x27f6fe,_0x181be8)){if(_[_0x6d81('0x64')](this[_0x6d81('0x10')][_0xbf30cc])){this[_0x6d81('0x10')][_0xbf30cc]={};}this[_0x6d81('0x10')][_0xbf30cc][_0x181be8]=_0x542635;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x252411){try{if(this[_0x6d81('0x63')](_0x252411)){logger[_0x6d81('0x47')](_0x6d81('0xbf'),_0x252411[_0x6d81('0x49')],util[_0x6d81('0x3e')](_0x252411,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x252411['uniqueid']]){for(var _0x287bd7=0x0,_0x43700d={};_0x287bd7=0x0?moment(_0x3bc576[_0x8baf('0x1a')])[_0x8baf('0x10')](_0x3bc576['starttime'],_0x8baf('0x1b')):null,'data1':_0x8baf('0x1c'),'data2':_0x3bc576[_0x8baf('0x16')],'data3':_0x3bc576[_0x8baf('0x13')],'data4':_0x3bc576['dialstring']||null,'role':_0x8baf('0x15'),'internal':_0x3bc576[_0x8baf('0x16')]?_[_0x8baf('0x1d')](_0x3bc576[_0x8baf('0x16')]):undefined,'uniqueid':_0x3bc576['uniqueid']},'log':_0x8baf('0x17')});}; \ No newline at end of file +var _0xc3de=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','seconds','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','starttime','endtime','moment','lodash','util','../client'];(function(_0xfd4492,_0x182c25){var _0x587319=function(_0x352494){while(--_0x352494){_0xfd4492['push'](_0xfd4492['shift']());}};_0x587319(++_0x182c25);}(_0xc3de,0x130));var _0xec3d=function(_0x534a7c,_0x2d94da){_0x534a7c=_0x534a7c-0x0;var _0x2ab58f=_0xc3de[_0x534a7c];return _0x2ab58f;};'use strict';var moment=require(_0xec3d('0x0'));var _=require(_0xec3d('0x1'));var util=require(_0xec3d('0x2'));var client=require(_0xec3d('0x3'));exports[_0xec3d('0x4')]=function(_0x36f0c9){var _0x35c7f5=_0x36f0c9[_0xec3d('0x5')]||_0x36f0c9[_0xec3d('0x6')];return client[_0xec3d('0x7')]('CreateMemberReport',{'body':{'channel':_0xec3d('0x8'),'membername':_0x36f0c9['lastAssignedTo'],'interface':_[_0xec3d('0x9')](_0x36f0c9[_0xec3d('0xa')])?util[_0xec3d('0xb')](_0xec3d('0xc'),_0x36f0c9[_0xec3d('0xd')]):_0x36f0c9[_0xec3d('0xa')],'type':_0xec3d('0xe'),'enterAt':_0x36f0c9['queuecallerleaveAt'],'exitAt':_0x35c7f5,'duration':moment(_0x35c7f5)[_0xec3d('0xf')](_0x36f0c9[_0xec3d('0x10')],_0xec3d('0x11')),'data1':'inbound','data2':_0x36f0c9['calleridnum'],'data3':_0x36f0c9[_0xec3d('0x12')],'data4':null,'data5':_0x36f0c9[_0xec3d('0x13')],'role':_0xec3d('0x14'),'internal':_0x36f0c9[_0xec3d('0x15')]?_[_0xec3d('0x16')](_0x36f0c9[_0xec3d('0x15')]):undefined,'uniqueid':_0x36f0c9[_0xec3d('0x17')]},'log':_0xec3d('0x18')});};exports[_0xec3d('0x19')]=function(_0x475b57){return client[_0xec3d('0x7')](_0xec3d('0x18'),{'body':{'channel':_0xec3d('0x8'),'membername':_0x475b57['membername'],'interface':_0x475b57[_0xec3d('0xa')],'type':'TALKING','enterAt':_0x475b57[_0xec3d('0x1a')],'exitAt':_0x475b57[_0xec3d('0x1b')],'duration':moment(_0x475b57['endtime'])[_0xec3d('0xf')](_0x475b57[_0xec3d('0x1a')],_0xec3d('0x11'))>=0x0?moment(_0x475b57[_0xec3d('0x1b')])[_0xec3d('0xf')](_0x475b57['starttime'],'seconds'):null,'data1':'outbound','data2':_0x475b57['accountcode'],'data3':_0x475b57[_0xec3d('0x12')],'data4':_0x475b57['dialstring']||null,'role':'agent','internal':_0x475b57['accountcode']?_[_0xec3d('0x16')](_0x475b57['accountcode']):undefined,'uniqueid':_0x475b57['uniqueid']},'log':_0xec3d('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index da9e142..982b083 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 _0xceb0=['stopRecordingOnTransfer'];(function(_0x54bcd0,_0x511a7e){var _0x25729f=function(_0xb28f7b){while(--_0xb28f7b){_0x54bcd0['push'](_0x54bcd0['shift']());}};_0x25729f(++_0x511a7e);}(_0xceb0,0x173));var _0x0ceb=function(_0x496727,_0x4faac1){_0x496727=_0x496727-0x0;var _0x2d922f=_0xceb0[_0x496727];return _0x2d922f;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0ceb('0x0')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x9219=['../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x472f69,_0xdf7dd1){var _0x579677=function(_0x19d124){while(--_0x19d124){_0x472f69['push'](_0x472f69['shift']());}};_0x579677(++_0xdf7dd1);}(_0x9219,0xc0));var _0x9921=function(_0xea3ac,_0x19ba61){_0xea3ac=_0xea3ac-0x0;var _0x451b16=_0x9219[_0xea3ac];return _0x451b16;};'use strict';var client=require(_0x9921('0x0'));exports[_0x9921('0x1')]=function(){return client[_0x9921('0x2')](_0x9921('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9921('0x4')]},'log':_0x9921('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 9008159..49114f9 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 _0xb286=['GetTemplate','../client','getTemplates'];(function(_0x4b7db1,_0x2ebc27){var _0x107be0=function(_0x4f23c4){while(--_0x4f23c4){_0x4b7db1['push'](_0x4b7db1['shift']());}};_0x107be0(++_0x2ebc27);}(_0xb286,0x151));var _0x6b28=function(_0x419e35,_0x4ccde1){_0x419e35=_0x419e35-0x0;var _0x28b158=_0xb286[_0x419e35];return _0x28b158;};'use strict';var client=require(_0x6b28('0x0'));exports[_0x6b28('0x1')]=function(_0x561c87){return function(_0x503c1c){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x6b28('0x2')});};}; \ No newline at end of file +var _0x09ac=['name','html','getTemplates','GetTemplate'];(function(_0x229652,_0x2dfdfb){var _0x100867=function(_0x3a6132){while(--_0x3a6132){_0x229652['push'](_0x229652['shift']());}};_0x100867(++_0x2dfdfb);}(_0x09ac,0x14e));var _0xc09a=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x09ac[_0x45fc6a];return _0x14bcfd;};'use strict';var client=require('../client');exports[_0xc09a('0x0')]=function(_0x112c42){return function(_0x1d7340){return client['Request'](_0xc09a('0x1'),{'options':{'raw':!![],'attributes':['id',_0xc09a('0x2'),_0xc09a('0x3')]},'log':_0xc09a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 68db8c3..3451b31 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 _0x43ce=['action','data1','data2','data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers','Request','Condition','AllConditions','field','operator','AnyConditions','value','Action'];(function(_0x27889f,_0x4809b9){var _0x201713=function(_0x5e5c1e){while(--_0x5e5c1e){_0x27889f['push'](_0x27889f['shift']());}};_0x201713(++_0x4809b9);}(_0x43ce,0x113));var _0xe43c=function(_0x3c8619,_0x331ad2){_0x3c8619=_0x3c8619-0x0;var _0x528d18=_0x43ce[_0x3c8619];return _0x528d18;};'use strict';var client=require(_0xe43c('0x0'));exports[_0xe43c('0x1')]=function(_0x2c1623){return function(_0x56a7d4){return client[_0xe43c('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel','status'],'include':[{'model':_0xe43c('0x3'),'as':_0xe43c('0x4'),'attributes':['id',_0xe43c('0x5'),_0xe43c('0x6'),'value']},{'model':_0xe43c('0x3'),'as':_0xe43c('0x7'),'attributes':['id',_0xe43c('0x5'),'operator',_0xe43c('0x8')]},{'model':_0xe43c('0x9'),'as':'Actions','attributes':['id',_0xe43c('0xa'),_0xe43c('0xb'),_0xe43c('0xc'),_0xe43c('0xd'),_0xe43c('0xe'),_0xe43c('0xf'),_0xe43c('0x10'),_0xe43c('0x11')]}]},'log':_0xe43c('0x12')});};}; \ No newline at end of file +var _0xa4a6=['data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','field','operator','value','Action','action','data1','data2','data3','data4'];(function(_0x397a0e,_0x35ad4b){var _0x4155aa=function(_0x161e4e){while(--_0x161e4e){_0x397a0e['push'](_0x397a0e['shift']());}};_0x4155aa(++_0x35ad4b);}(_0xa4a6,0x74));var _0x6a4a=function(_0x385f7e,_0x44bd77){_0x385f7e=_0x385f7e-0x0;var _0x4f0df4=_0xa4a6[_0x385f7e];return _0x4f0df4;};'use strict';var client=require(_0x6a4a('0x0'));exports[_0x6a4a('0x1')]=function(_0x411466){return function(_0x37abde){return client[_0x6a4a('0x2')](_0x6a4a('0x3'),{'options':{'raw':![],'attributes':['id',_0x6a4a('0x4'),_0x6a4a('0x5'),'status'],'include':[{'model':_0x6a4a('0x6'),'as':_0x6a4a('0x7'),'attributes':['id',_0x6a4a('0x8'),_0x6a4a('0x9'),_0x6a4a('0xa')]},{'model':_0x6a4a('0x6'),'as':'AnyConditions','attributes':['id','field',_0x6a4a('0x9'),_0x6a4a('0xa')]},{'model':_0x6a4a('0xb'),'as':'Actions','attributes':['id',_0x6a4a('0xc'),_0x6a4a('0xd'),_0x6a4a('0xe'),_0x6a4a('0xf'),_0x6a4a('0x10'),'data5',_0x6a4a('0x11'),_0x6a4a('0x12')]}]},'log':_0x6a4a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e5ce418..0d8c227 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 _0x5b26=['../client','Request','GetTrunk','name','registry'];(function(_0x46d6c4,_0x4158fa){var _0x245800=function(_0x4bca44){while(--_0x4bca44){_0x46d6c4['push'](_0x46d6c4['shift']());}};_0x245800(++_0x4158fa);}(_0x5b26,0x172));var _0x65b2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5b26[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x65b2('0x0'));exports['getTrunks']=function(_0x595460){return function(_0x223b70){return client[_0x65b2('0x1')](_0x65b2('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x65b2('0x3'),_0x65b2('0x4'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x5a80=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x2a02a3,_0x71715f){var _0x125129=function(_0x562ec6){while(--_0x562ec6){_0x2a02a3['push'](_0x2a02a3['shift']());}};_0x125129(++_0x71715f);}(_0x5a80,0x15b));var _0x05a8=function(_0x13530e,_0x1456d5){_0x13530e=_0x13530e-0x0;var _0x112810=_0x5a80[_0x13530e];return _0x112810;};'use strict';var client=require(_0x05a8('0x0'));exports[_0x05a8('0x1')]=function(_0x51bdb3){return function(_0x457c20){return client[_0x05a8('0x2')](_0x05a8('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x05a8('0x4'),_0x05a8('0x5'),'defaultuser']},'log':_0x05a8('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 9f96fee..e51652e 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x2a7acf,_0x2dfca1){var _0x520072=function(_0x5f499f){while(--_0x5f499f){_0x2a7acf['push'](_0x2a7acf['shift']());}};_0x520072(++_0x2dfca1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xcb91[_0x3f6b1b];return _0x4a3d2b;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x4649ea,_0x2ca092){var _0x2f3c41=function(_0x4dde46){while(--_0x4dde46){_0x4649ea['push'](_0x4649ea['shift']());}};_0x2f3c41(++_0x2ca092);}(_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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 899119b..93fe82b 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 _0xae1c=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xae1c,0x18c));var _0xcae1=function(_0x1bbd0a,_0x238ae1){_0x1bbd0a=_0x1bbd0a-0x0;var _0x454b2d=_0xae1c[_0x1bbd0a];return _0x454b2d;};'use strict';var client=require('../client');exports['create']=function(_0x115445){return client[_0xcae1('0x0')](_0xcae1('0x1'),{'body':_0x115445,'log':'CreateVoiceAgentReport'});};exports[_0xcae1('0x2')]=function(_0x5dafd5,_0x5505fa,_0x1243ab){return client[_0xcae1('0x0')](_0xcae1('0x3'),{'body':_0x5dafd5,'options':{'where':{'uniqueid':_0x5505fa,'interface':_0x1243ab,'agentcomplete':!![]}},'log':_0xcae1('0x3')});}; \ No newline at end of file +var _0xee1b=['../client','create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x452a91,_0x317e30){var _0x3dd2e3=function(_0x112e37){while(--_0x112e37){_0x452a91['push'](_0x452a91['shift']());}};_0x3dd2e3(++_0x317e30);}(_0xee1b,0x1ec));var _0xbee1=function(_0x414fb3,_0x5f4dbb){_0x414fb3=_0x414fb3-0x0;var _0x5ad7ad=_0xee1b[_0x414fb3];return _0x5ad7ad;};'use strict';var client=require(_0xbee1('0x0'));exports[_0xbee1('0x1')]=function(_0x4f2ece){return client['Request'](_0xbee1('0x2'),{'body':_0x4f2ece,'log':_0xbee1('0x2')});};exports[_0xbee1('0x3')]=function(_0x485900,_0x2612f2,_0x40bcf9){return client[_0xbee1('0x4')](_0xbee1('0x5'),{'body':_0x485900,'options':{'where':{'uniqueid':_0x2612f2,'interface':_0x40bcf9,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d67a030..d5d8a1f 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 _0x83f0=['type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','Request','outbound','day','YYYY-MM-DD\x20HH:mm:ss','format'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x83f0,0xa5));var _0x083f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x83f0[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var _=require(_0x083f('0x2'));var client=require(_0x083f('0x3'));exports['create']=function(_0x269eb5){return client['Request'](_0x083f('0x4'),{'body':_[_0x083f('0x5')](_0x269eb5,{'source':_0x269eb5[_0x083f('0x6')],'destinationcontext':_0x269eb5[_0x083f('0x7')],'callerid':_0x269eb5[_0x083f('0x8')],'amaflags':_0x083f('0x9')}),'log':_0x083f('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x083f('0xa')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x083f('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x083f('0xc'))['format'](_0x083f('0xd')),moment()['endOf']('day')[_0x083f('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x083f('0xf'),_0x083f('0x10'),_0x083f('0x11'),_0x083f('0x12')]},'log':_0x083f('0x13')});};}; \ No newline at end of file +var _0x4152=['billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition'];(function(_0x47f719,_0x2e559d){var _0x407f4e=function(_0x2be03a){while(--_0x2be03a){_0x47f719['push'](_0x47f719['shift']());}};_0x407f4e(++_0x2e559d);}(_0x4152,0x132));var _0x2415=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x4152[_0x54eab6];return _0x1e7435;};'use strict';var moment=require(_0x2415('0x0'));var util=require(_0x2415('0x1'));var _=require('lodash');var client=require(_0x2415('0x2'));exports[_0x2415('0x3')]=function(_0x2d4a91){return client[_0x2415('0x4')](_0x2415('0x5'),{'body':_[_0x2415('0x6')](_0x2d4a91,{'source':_0x2d4a91['calleridnum'],'destinationcontext':_0x2d4a91[_0x2415('0x7')],'callerid':_0x2d4a91[_0x2415('0x8')],'amaflags':_0x2415('0x9')}),'log':_0x2415('0x5')});};exports[_0x2415('0xa')]=function(){return function(){return client[_0x2415('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x2415('0xb')],'createdAt':{'$between':[moment()[_0x2415('0xc')](_0x2415('0xd'))[_0x2415('0xe')](_0x2415('0xf')),moment()['endOf']('day')[_0x2415('0xe')](_0x2415('0xf'))]}},'attributes':['type',_0x2415('0x10'),'duration',_0x2415('0x11')]},'log':_0x2415('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f73400a..19f0397 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 _0xaae4=['create','Request','CreateVoiceDialReport'];(function(_0x3bba37,_0x37f7f6){var _0x506a7f=function(_0x29e598){while(--_0x29e598){_0x3bba37['push'](_0x3bba37['shift']());}};_0x506a7f(++_0x37f7f6);}(_0xaae4,0xf0));var _0x4aae=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xaae4[_0x4b369d];return _0x571a98;};'use strict';var client=require('../client');exports[_0x4aae('0x0')]=function(_0x28cb32){return client[_0x4aae('0x1')](_0x4aae('0x2'),{'body':_0x28cb32,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x9747=['../client','create','Request'];(function(_0x4c50b8,_0x58da2d){var _0x264e6b=function(_0x55b760){while(--_0x55b760){_0x4c50b8['push'](_0x4c50b8['shift']());}};_0x264e6b(++_0x58da2d);}(_0x9747,0xba));var _0x7974=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9747[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7974('0x0'));exports[_0x7974('0x1')]=function(_0x327485){return client[_0x7974('0x2')]('CreateVoiceDialReport',{'body':_0x327485,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2bcbcbe..311cc83 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 _0x222f=['../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x48a5f0,_0x3a7cdf){var _0x3bae07=function(_0x5249c8){while(--_0x5249c8){_0x48a5f0['push'](_0x48a5f0['shift']());}};_0x3bae07(++_0x3a7cdf);}(_0x222f,0x1a4));var _0xf222=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x222f[_0x36bff5];return _0x80ade5;};'use strict';var client=require(_0xf222('0x0'));exports[_0xf222('0x1')]=function(){return function(){return client[_0xf222('0x2')](_0xf222('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xf222('0x1')});};}; \ No newline at end of file +var _0x2750=['exten','recordingFormat','getVoiceExtensions','../client','Request','GetVoiceExtension'];(function(_0x39190b,_0x4cc689){var _0x4dcd8a=function(_0x5c39f6){while(--_0x5c39f6){_0x39190b['push'](_0x39190b['shift']());}};_0x4dcd8a(++_0x4cc689);}(_0x2750,0x13b));var _0x0275=function(_0x5edd3b,_0x325716){_0x5edd3b=_0x5edd3b-0x0;var _0x2f4e26=_0x2750[_0x5edd3b];return _0x2f4e26;};'use strict';var client=require(_0x0275('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x0275('0x1')](_0x0275('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0275('0x3'),_0x0275('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x0275('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 153b910..2010ddf 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 _0xca7b=['dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','active','Pause','mandatoryDispositionPause','name','Trunk','callerid','Interval','interval','getVoiceQueues','../client','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel'];(function(_0x13ed6b,_0x1ea5e3){var _0x820c26=function(_0x2cad7c){while(--_0x2cad7c){_0x13ed6b['push'](_0x13ed6b['shift']());}};_0x820c26(++_0x1ea5e3);}(_0xca7b,0xb0));var _0xbca7=function(_0xb56805,_0xbda62e){_0xb56805=_0xb56805-0x0;var _0xdf28da=_0xca7b[_0xb56805];return _0xdf28da;};'use strict';var client=require(_0xbca7('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xbca7('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xbca7('0x2'),_0xbca7('0x3'),_0xbca7('0x4'),_0xbca7('0x5'),'type',_0xbca7('0x6'),_0xbca7('0x7'),_0xbca7('0x8'),'dialLimitQueue',_0xbca7('0x9'),_0xbca7('0xa'),_0xbca7('0xb'),'dialPredictiveInterval','dialOriginateCallerIdName',_0xbca7('0xc'),'dialOriginateTimeout',_0xbca7('0xd'),_0xbca7('0xe'),_0xbca7('0xf'),_0xbca7('0x10'),'dialCongestionRetryFrequency',_0xbca7('0x11'),_0xbca7('0x12'),_0xbca7('0x13'),_0xbca7('0x14'),_0xbca7('0x15'),_0xbca7('0x16'),_0xbca7('0x17'),_0xbca7('0x18'),_0xbca7('0x19'),'dialAMDActive',_0xbca7('0x1a'),_0xbca7('0x1b'),_0xbca7('0x1c'),_0xbca7('0x1d'),_0xbca7('0x1e'),_0xbca7('0x1f'),'dialAMDMaximumNumberOfWords',_0xbca7('0x20'),_0xbca7('0x21'),_0xbca7('0x22'),'dialRecallMeTimeout',_0xbca7('0x23'),_0xbca7('0x24'),_0xbca7('0x25'),_0xbca7('0x26'),_0xbca7('0x27'),'monitor_format',_0xbca7('0x28'),_0xbca7('0x29'),_0xbca7('0x2a'),_0xbca7('0x2b'),_0xbca7('0x2c'),'dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry',_0xbca7('0x2d'),_0xbca7('0x2e'),_0xbca7('0x2f'),_0xbca7('0x30'),_0xbca7('0x31'),_0xbca7('0x32'),_0xbca7('0x33'),_0xbca7('0x34')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id','name','callerid',_0xbca7('0x35')]},{'model':_0xbca7('0x36'),'as':_0xbca7('0x37'),'attributes':['id',_0xbca7('0x38')]},{'model':_0xbca7('0x39'),'as':'TrunkBackup','attributes':['id',_0xbca7('0x38'),_0xbca7('0x3a'),'active']},{'model':'Interval','as':_0xbca7('0x3b'),'attributes':['id',_0xbca7('0x38')],'include':[{'model':_0xbca7('0x3b'),'as':'Intervals','attributes':['id','name',_0xbca7('0x3c')]}]}]},'log':_0xbca7('0x3d')});};}; \ No newline at end of file +var _0x46d5=['dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','name','callerid','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','monitor_format','type'];(function(_0x928b23,_0x4e9f6f){var _0x3fad44=function(_0x436b9b){while(--_0x436b9b){_0x928b23['push'](_0x928b23['shift']());}};_0x3fad44(++_0x4e9f6f);}(_0x46d5,0x115));var _0x546d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x46d5[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x546d('0x0'));exports[_0x546d('0x1')]=function(){return function(){return client[_0x546d('0x2')](_0x546d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x546d('0x4'),_0x546d('0x5'),'autopause',_0x546d('0x6'),_0x546d('0x7'),_0x546d('0x8'),_0x546d('0x9'),_0x546d('0xa'),_0x546d('0xb'),_0x546d('0xc'),_0x546d('0xd'),_0x546d('0xe'),_0x546d('0xf'),_0x546d('0x10'),_0x546d('0x11'),'dialOriginateTimeout','dialQueueOptions',_0x546d('0x12'),'dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x546d('0x13'),_0x546d('0x14'),_0x546d('0x15'),'dialNoAnswerRetryFrequency',_0x546d('0x16'),_0x546d('0x17'),_0x546d('0x18'),'dialPrefix','dialCheckDuplicateType',_0x546d('0x19'),'dialAMDInitialSilence',_0x546d('0x1a'),'dialAMDAfterGreetingSilence',_0x546d('0x1b'),_0x546d('0x1c'),_0x546d('0x1d'),'dialAMDMaximumNumberOfWords',_0x546d('0x1e'),_0x546d('0x1f'),'timeout',_0x546d('0x20'),_0x546d('0x21'),'dialOrderByScheduledAt',_0x546d('0x22'),'dialAgiAfterHangupClient','dialQueueProject2',_0x546d('0x6'),_0x546d('0x23'),_0x546d('0x24'),'dialCutDigit',_0x546d('0x25'),_0x546d('0x26'),_0x546d('0x27'),_0x546d('0x28'),'dialAbandonedMaxRetry',_0x546d('0x29'),_0x546d('0x2a'),_0x546d('0x2b'),_0x546d('0x2c'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x546d('0x2d'),_0x546d('0x2e')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x546d('0x2f'),_0x546d('0x30'),_0x546d('0x31')]},{'model':_0x546d('0x32'),'as':_0x546d('0x33'),'attributes':['id',_0x546d('0x2f')]},{'model':_0x546d('0x34'),'as':_0x546d('0x35'),'attributes':['id','name',_0x546d('0x30'),_0x546d('0x31')]},{'model':_0x546d('0x36'),'as':_0x546d('0x36'),'attributes':['id',_0x546d('0x2f')],'include':[{'model':_0x546d('0x36'),'as':_0x546d('0x37'),'attributes':['id',_0x546d('0x2f'),_0x546d('0x38')]}]}]},'log':_0x546d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5bb601e..519cfed 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(_0x3ec66f,_0x2653d0){var _0x4671e5=function(_0x338e03){while(--_0x338e03){_0x3ec66f['push'](_0x3ec66f['shift']());}};_0x4671e5(++_0x2653d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x112f6d,_0x48486d){var _0x3fbed0=function(_0x1f6fdd){while(--_0x1f6fdd){_0x112f6d['push'](_0x112f6d['shift']());}};_0x3fbed0(++_0x48486d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index a973266..4f51a38 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 _0x292d=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x1511e7,_0x2be8e2){var _0x1eab02=function(_0x5aafd8){while(--_0x5aafd8){_0x1511e7['push'](_0x1511e7['shift']());}};_0x1eab02(++_0x2be8e2);}(_0x292d,0x140));var _0xd292=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x292d[_0x390a19];return _0x5d8230;};'use strict';var client=require(_0xd292('0x0'));exports[_0xd292('0x1')]=function(_0xfacca0){return function(){return client[_0xd292('0x2')](_0xd292('0x3'),{'options':{'where':{'VoiceQueueId':_0xfacca0,'paused':!![]},'raw':!![]},'log':_0xd292('0x1')});};}; \ No newline at end of file +var _0xb0a9=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client','Request'];(function(_0x38a439,_0x39fc87){var _0x3ff462=function(_0x2279a1){while(--_0x2279a1){_0x38a439['push'](_0x38a439['shift']());}};_0x3ff462(++_0x39fc87);}(_0xb0a9,0xc6));var _0x9b0a=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xb0a9[_0x450bf9];return _0x268350;};'use strict';var client=require(_0x9b0a('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4abea4){return function(){return client[_0x9b0a('0x1')](_0x9b0a('0x2'),{'options':{'where':{'VoiceQueueId':_0x4abea4,'paused':!![]},'raw':!![]},'log':_0x9b0a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0356b00..5993ee3 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x47ce15,_0x5adc97){var _0x3ab001=function(_0x432588){while(--_0x432588){_0x47ce15['push'](_0x47ce15['shift']());}};_0x3ab001(++_0x5adc97);}(_0x7a54,0x106));var _0x47a5=function(_0x4f4526,_0x75d2b4){_0x4f4526=_0x4f4526-0x0;var _0x3962d1=_0x7a54[_0x4f4526];return _0x3962d1;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x56be17,_0x5886c0){var _0x33c274=function(_0x2e7fcc){while(--_0x2e7fcc){_0x56be17['push'](_0x56be17['shift']());}};_0x33c274(++_0x5886c0);}(_0x7a54,0x106));var _0x47a5=function(_0x5a5cd8,_0xf13edc){_0x5a5cd8=_0x5a5cd8-0x0;var _0x5b09f0=_0x7a54[_0x5a5cd8];return _0x5b09f0;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 014f26d..5991fec 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 _0x8598=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x8598,0x118));var _0x8859=function(_0x2e81f4,_0x44f46a){_0x2e81f4=_0x2e81f4-0x0;var _0x198f70=_0x8598[_0x2e81f4];return _0x198f70;};'use strict';var client=require(_0x8859('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x14183b){return client['Request'](_0x8859('0x1'),{'body':{'result':_0x14183b[_0x8859('0x2')],'transfererchannel':_0x14183b[_0x8859('0x3')],'transferercalleridnum':_0x14183b[_0x8859('0x4')],'transferercalleridname':_0x14183b[_0x8859('0x5')],'transfererconnectedlinenum':_0x14183b[_0x8859('0x6')],'transfererconnectedlinename':_0x14183b['transfererconnectedlinename'],'transfereraccountcode':_0x14183b[_0x8859('0x7')],'transferercontext':_0x14183b['transferercontext'],'transfererexten':_0x14183b['transfererexten'],'transfererlinkedid':_0x14183b[_0x8859('0x8')],'transfereechannel':_0x14183b[_0x8859('0x9')],'transfereecalleridnum':_0x14183b[_0x8859('0xa')],'transfereecalleridname':_0x14183b[_0x8859('0xb')],'transfereeconnectedlinenum':_0x14183b[_0x8859('0xc')],'transfereeconnectedlinename':_0x14183b[_0x8859('0xd')],'transfereeaccountcode':_0x14183b[_0x8859('0xe')],'transfereecontext':_0x14183b[_0x8859('0xf')],'transfereeexten':_0x14183b[_0x8859('0x10')],'transfereelinkedid':_0x14183b[_0x8859('0x11')],'isexternal':_0x14183b[_0x8859('0x12')],'context':_0x14183b[_0x8859('0x13')],'extension':_0x14183b['extension'],'type':_0x8859('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0x8859('0x15')]=function(_0x48ebeb){return client[_0x8859('0x16')]('CreateVoiceTransferReport',{'body':{'result':_0x48ebeb['result'],'transfererchannel':_0x48ebeb[_0x8859('0x17')],'transferercalleridnum':_0x48ebeb[_0x8859('0x18')],'transferercalleridname':_0x48ebeb[_0x8859('0x19')],'transfererconnectedlinenum':_0x48ebeb[_0x8859('0x1a')],'transfererconnectedlinename':_0x48ebeb[_0x8859('0x1b')],'transfereraccountcode':_0x48ebeb['origtransfereraccountcode'],'transferercontext':_0x48ebeb[_0x8859('0x1c')],'transfererexten':_0x48ebeb['secondtransfererexten'],'transfererlinkedid':_0x48ebeb[_0x8859('0x1d')],'transfereechannel':_0x48ebeb['transfertargetchannel'],'transfereecalleridnum':_0x48ebeb['transfertargetcalleridnum'],'transfereecalleridname':_0x48ebeb[_0x8859('0x1e')],'transfereeconnectedlinenum':_0x48ebeb[_0x8859('0x1f')],'transfereeconnectedlinename':_0x48ebeb[_0x8859('0x20')],'transfereeaccountcode':_0x48ebeb[_0x8859('0x21')],'transfereecontext':_0x48ebeb['transfertargetcontext'],'transfereeexten':_0x48ebeb[_0x8859('0x22')],'transfereelinkedid':_0x48ebeb[_0x8859('0x23')],'isexternal':_0x48ebeb[_0x8859('0x12')],'context':_0x48ebeb[_0x8859('0x24')],'extension':_0x48ebeb[_0x8859('0x25')],'type':_0x8859('0x26')},'log':_0x8859('0x1')});}; \ No newline at end of file +var _0x6a54=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel'];(function(_0x25be8a,_0xcd47a6){var _0x320e25=function(_0x3d7dfa){while(--_0x3d7dfa){_0x25be8a['push'](_0x25be8a['shift']());}};_0x320e25(++_0xcd47a6);}(_0x6a54,0xcc));var _0x46a5=function(_0x5ae726,_0x573eff){_0x5ae726=_0x5ae726-0x0;var _0x496000=_0x6a54[_0x5ae726];return _0x496000;};'use strict';var client=require('../client');exports[_0x46a5('0x0')]={};exports[_0x46a5('0x1')]=function(_0x4c89c6){return client[_0x46a5('0x2')](_0x46a5('0x3'),{'body':{'result':_0x4c89c6[_0x46a5('0x4')],'transfererchannel':_0x4c89c6['transfererchannel'],'transferercalleridnum':_0x4c89c6[_0x46a5('0x5')],'transferercalleridname':_0x4c89c6['transferercalleridname'],'transfererconnectedlinenum':_0x4c89c6[_0x46a5('0x6')],'transfererconnectedlinename':_0x4c89c6['transfererconnectedlinename'],'transfereraccountcode':_0x4c89c6[_0x46a5('0x7')],'transferercontext':_0x4c89c6[_0x46a5('0x8')],'transfererexten':_0x4c89c6[_0x46a5('0x9')],'transfererlinkedid':_0x4c89c6[_0x46a5('0xa')],'transfereechannel':_0x4c89c6[_0x46a5('0xb')],'transfereecalleridnum':_0x4c89c6[_0x46a5('0xc')],'transfereecalleridname':_0x4c89c6[_0x46a5('0xd')],'transfereeconnectedlinenum':_0x4c89c6[_0x46a5('0xe')],'transfereeconnectedlinename':_0x4c89c6[_0x46a5('0xf')],'transfereeaccountcode':_0x4c89c6['transfereeaccountcode'],'transfereecontext':_0x4c89c6[_0x46a5('0x10')],'transfereeexten':_0x4c89c6[_0x46a5('0x11')],'transfereelinkedid':_0x4c89c6['transfereelinkedid'],'isexternal':_0x4c89c6['isexternal'],'context':_0x4c89c6['context'],'extension':_0x4c89c6[_0x46a5('0x12')],'type':_0x46a5('0x13')},'log':_0x46a5('0x3')});};exports[_0x46a5('0x14')]=function(_0x23c518){return client[_0x46a5('0x2')](_0x46a5('0x3'),{'body':{'result':_0x23c518[_0x46a5('0x4')],'transfererchannel':_0x23c518[_0x46a5('0x15')],'transferercalleridnum':_0x23c518[_0x46a5('0x16')],'transferercalleridname':_0x23c518[_0x46a5('0x17')],'transfererconnectedlinenum':_0x23c518[_0x46a5('0x18')],'transfererconnectedlinename':_0x23c518[_0x46a5('0x19')],'transfereraccountcode':_0x23c518[_0x46a5('0x1a')],'transferercontext':_0x23c518[_0x46a5('0x1b')],'transfererexten':_0x23c518['secondtransfererexten'],'transfererlinkedid':_0x23c518[_0x46a5('0x1c')],'transfereechannel':_0x23c518[_0x46a5('0x1d')],'transfereecalleridnum':_0x23c518[_0x46a5('0x1e')],'transfereecalleridname':_0x23c518[_0x46a5('0x1f')],'transfereeconnectedlinenum':_0x23c518[_0x46a5('0x20')],'transfereeconnectedlinename':_0x23c518['transfertargetconnectedlinename'],'transfereeaccountcode':_0x23c518[_0x46a5('0x21')],'transfereecontext':_0x23c518[_0x46a5('0x22')],'transfereeexten':_0x23c518['transfertargetexten'],'transfereelinkedid':_0x23c518[_0x46a5('0x23')],'isexternal':_0x23c518[_0x46a5('0x24')],'context':_0x23c518['origtransferercontext'],'extension':_0x23c518[_0x46a5('0x25')],'type':_0x46a5('0x26')},'log':_0x46a5('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 89d050e..f1533b1 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 _0x1967=['outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','push','length','find','omit','undefined','ami\x20disconnected','map','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','channels','resolve','destinationchannel','stop','wav','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','hasOwnProperty','voiceQueues','strategy','answered','available','pTalking','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay'];(function(_0x5755bf,_0x5a50ba){var _0x156408=function(_0x432024){while(--_0x432024){_0x5755bf['push'](_0x5755bf['shift']());}};_0x156408(++_0x5a50ba);}(_0x1967,0x173));var _0x7196=function(_0xf92bc4,_0xc7ac43){_0xf92bc4=_0xf92bc4-0x0;var _0x41b75e=_0x1967[_0xf92bc4];return _0x41b75e;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var jayson=require(_0x7196('0x1'));var schema=require(_0x7196('0x2'));var BPromise=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var config=require(_0x7196('0x5'));var properties=require(_0x7196('0x6'));var ami=require(_0x7196('0x7'));exports[_0x7196('0x8')]=function(_0x3ae43f,_0x5c128f,_0x36b01e){return new BPromise(function(_0x186175,_0x194746){var _0x40e0af={'QueuePause':function(_0x266a6e){return new Promise(function(_0xad78a,_0x510c72){var _0x218520=util[_0x7196('0x9')](_0x7196('0xa'),_0x7196('0xb'),_0x266a6e[_0x7196('0xc')]);if(_0x3ae43f['timers']&&_0x3ae43f['timers'][_0x218520]&&_0x3ae43f[_0x7196('0xd')][_0x218520][_0x7196('0xe')]){_0x3ae43f[_0x7196('0xd')][_0x218520][_0x7196('0xf')]();}if(_0x3ae43f[_0x7196('0x10')][_0x218520]){_0x3ae43f[_0x7196('0x10')][_0x218520][_0x7196('0x11')]({'statePause':_0x266a6e[_0x7196('0x12')]?!![]:![]});}_0xad78a({'code':0xc8,'message':_0x7196('0x13')});});},'Reload':function(_0xba707b){var _0x154101=this;return new Promise(function(_0x4e8c4c,_0x26a1ef){if(ami[_0x7196('0x14')]()==![]){return _0x26a1ef(_0x154101[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config['asterisk'][_0x7196('0x17')],'ami\x20disconnected'][_0x7196('0x18')]('\x20')));}_0xba707b=_[_0x7196('0x19')](_0xba707b,_[_0x7196('0x1a')](properties[_0x7196('0x1b')]));_0xba707b[_0x7196('0x1c')]=_0x7196('0x1d');return ami[_0x7196('0x1e')](_0xba707b)[_0x7196('0x1f')](function(_0x3e4e69){_0x4e8c4c({'code':0xc8,'message':_0x3e4e69[_0x7196('0x20')]});})[_0x7196('0x21')](function(_0x5b716a){_0x26a1ef(_0x154101['error'](0x1f5,_0x5b716a[_0x7196('0x20')]));});});},'Command':function(_0x26b447){var _0x40418d=this;return new Promise(function(_0x517a3e,_0x39b944){if(ami['isConnected']()==![]){return _0x39b944(_0x40418d['error'](0x1f4,[config[_0x7196('0x16')]['ip'],config[_0x7196('0x16')][_0x7196('0x17')],'ami\x20disconnected']['join']('\x20')));}_0x26b447=_[_0x7196('0x19')](_0x26b447,_0x7196('0x22'));_0x26b447['action']=_0x7196('0x23');return ami[_0x7196('0x1e')](_0x26b447)[_0x7196('0x1f')](function(_0x18d389){_0x517a3e({'code':0xc8,'message':_0x18d389[_0x7196('0x24')]});})['catch'](function(_0x3f8178){_0x39b944(_0x40418d['error'](0x1f5,_0x3f8178[_0x7196('0x20')]));});});},'VoiceQueues':function(_0x1b1f4b){return new Promise(function(_0x2e15c7,_0xa69810){var _0x70aa65=[];for(var _0x43f6a2 in _0x3ae43f['voiceQueues']){if(_0x3ae43f['voiceQueues'][_0x7196('0x25')](_0x43f6a2)){var _0x2d284f=_0x3ae43f[_0x7196('0x26')][_0x43f6a2];var _0x4e878f={'id':_0x2d284f['id'],'name':_0x2d284f['name'],'strategy':_0x2d284f[_0x7196('0x27')],'answered':_0x2d284f[_0x7196('0x28')],'available':_0x2d284f[_0x7196('0x29')],'loggedIn':_0x2d284f['loggedIn'],'pTalking':_0x2d284f[_0x7196('0x2a')],'sumBillable':_0x2d284f['sumBillable'],'sumDuration':_0x2d284f[_0x7196('0x2b')],'sumHoldTime':_0x2d284f['sumHoldTime']||0x0,'talking':_0x2d284f[_0x7196('0x2c')],'total':_0x2d284f[_0x7196('0x2d')],'type':_0x2d284f[_0x7196('0x2e')],'unmanaged':_0x2d284f['unmanaged'],'abandoned':_0x2d284f[_0x7196('0x2f')],'waiting':_0x2d284f[_0x7196('0x30')],'loggedInDb':_0x2d284f[_0x7196('0x31')]};if(_0x2d284f[_0x7196('0x2e')]==='outbound'){_0x4e878f[_0x7196('0x32')]=_0x2d284f[_0x7196('0x32')];_0x4e878f[_0x7196('0x33')]=_0x2d284f[_0x7196('0x33')];_0x4e878f[_0x7196('0x34')]=_0x2d284f[_0x7196('0x34')];_0x4e878f[_0x7196('0x35')]=_0x2d284f[_0x7196('0x35')];_0x4e878f[_0x7196('0x36')]=_0x2d284f[_0x7196('0x36')];_0x4e878f[_0x7196('0x37')]=_0x2d284f['dialPrefix'];_0x4e878f[_0x7196('0x38')]=_0x2d284f['temp'];_0x4e878f[_0x7196('0x39')]=_0x2d284f['outboundAnswerAgiCallsDay'];_0x4e878f[_0x7196('0x3a')]=_0x2d284f[_0x7196('0x3a')];_0x4e878f['outboundBlacklistCallsDay']=_0x2d284f[_0x7196('0x3b')];_0x4e878f[_0x7196('0x3c')]=_0x2d284f[_0x7196('0x3c')];_0x4e878f[_0x7196('0x3d')]=_0x2d284f[_0x7196('0x3d')];_0x4e878f['outboundDropCallsDayACS']=_0x2d284f[_0x7196('0x3e')];_0x4e878f[_0x7196('0x3f')]=_0x2d284f[_0x7196('0x3f')];_0x4e878f[_0x7196('0x40')]=_0x2d284f[_0x7196('0x40')];_0x4e878f[_0x7196('0x41')]=_0x2d284f['outboundNoAnswerCallsDay'];_0x4e878f[_0x7196('0x42')]=_0x2d284f[_0x7196('0x42')];_0x4e878f[_0x7196('0x43')]=_0x2d284f['outboundOriginateFailureCallsDay'];_0x4e878f[_0x7196('0x44')]=_0x2d284f[_0x7196('0x44')];_0x4e878f[_0x7196('0x45')]=_0x2d284f[_0x7196('0x45')];_0x4e878f[_0x7196('0x46')]=_0x2d284f[_0x7196('0x46')];_0x4e878f[_0x7196('0x47')]=_0x2d284f[_0x7196('0x47')];_0x4e878f[_0x7196('0x48')]=_0x2d284f[_0x7196('0x48')];_0x4e878f['predictiveIntervalAvgTalktime']=_0x2d284f[_0x7196('0x49')];_0x4e878f[_0x7196('0x4a')]=_0x2d284f['predictiveIntervalDroppedCallsCallersExit'];_0x4e878f[_0x7196('0x4b')]=_0x2d284f['predictiveIntervalDroppedCallsTimeout'];_0x4e878f['predictiveIntervalErlangCalls']=_0x2d284f[_0x7196('0x4c')];_0x4e878f[_0x7196('0x4d')]=_0x2d284f['predictiveIntervalErlangCallsDroppedCalls'];_0x4e878f['predictiveIntervalHitRate']=_0x2d284f[_0x7196('0x4e')];_0x4e878f[_0x7196('0x4f')]=_0x2d284f[_0x7196('0x4f')];_0x4e878f['predictiveIntervalPauses']=_0x2d284f[_0x7196('0x50')];_0x4e878f[_0x7196('0x51')]=_0x2d284f[_0x7196('0x51')];_0x4e878f[_0x7196('0x52')]=_0x2d284f[_0x7196('0x52')];_0x4e878f[_0x7196('0x20')]=_0x2d284f[_0x7196('0x20')];_0x4e878f[_0x7196('0x53')]=_0x2d284f['originated'];_0x4e878f[_0x7196('0x54')]=_0x2d284f[_0x7196('0x54')];_0x4e878f['erlangCallToSecond']=_0x2d284f[_0x7196('0x55')];_0x4e878f[_0x7196('0x56')]=_0x2d284f['erlangAbandonmentRate'];_0x4e878f[_0x7196('0x57')]=_0x2d284f[_0x7196('0x57')];_0x4e878f[_0x7196('0x58')]=_0x2d284f['startPredictive'];_0x4e878f[_0x7196('0x59')]=_0x2d284f[_0x7196('0x59')];}if(_0x2d284f['Trunk']){_0x4e878f[_0x7196('0x5a')]={'id':_0x2d284f[_0x7196('0x5a')]['id'],'name':_0x2d284f['Trunk'][_0x7196('0xc')],'active':_0x2d284f['Trunk']['active'],'callerid':_0x2d284f['Trunk']['callerid']};}if(_0x2d284f['Interval']){_0x4e878f[_0x7196('0x5b')]={'id':_0x2d284f['Interval']['id'],'name':_0x2d284f[_0x7196('0x5b')][_0x7196('0xc')]};}_0x70aa65[_0x7196('0x5c')](_0x4e878f);}}_0x2e15c7({'count':_0x70aa65[_0x7196('0x5d')],'rows':_0x70aa65});});},'UpdateVoiceQueue':function(_0x522fbd){return new Promise(function(_0x3f3171,_0x56ffdd){var _0x12ee76=_[_0x7196('0x5e')](_0x3ae43f[_0x7196('0x26')],{'id':parseInt(_0x522fbd['id'])});var _0x5e34e8=_[_0x7196('0x5f')](_0x522fbd,['id']);if(_0x12ee76){for(var _0x44d8e5 in _0x5e34e8){if(typeof _0x5e34e8[_0x44d8e5]!==_0x7196('0x60')&&typeof _0x12ee76[_0x44d8e5]!=='undefined'){_0x12ee76[_0x44d8e5]=_0x5e34e8[_0x44d8e5];}}_0x3f3171(_0x12ee76);}else{_0x56ffdd();}});},'VoiceChannels':function(_0x4e2aad){return new Promise(function(_0x1faa7b,_0x5a7896){var _0x29c7e8=_['values'](_0x3ae43f['channels']);_0x1faa7b({'count':_0x29c7e8[_0x7196('0x5d')],'rows':_0x29c7e8});});},'VoiceChannelMixMonitor':function(_0x5de6f2){var _0x48f5e7=this;return new Promise(function(_0x516825,_0x2299e2){if(ami['isConnected']()==![]){return _0x2299e2(_0x48f5e7['error'](0x1f4,[config[_0x7196('0x16')]['ip'],config[_0x7196('0x16')][_0x7196('0x17')],_0x7196('0x61')]['join']('\x20')));}var _0x50cc66=schema(properties['voicechannel'])[_0x7196('0x2')](_0x5de6f2);if(_0x50cc66[_0x7196('0x5d')]>0x0){return _0x2299e2(_0x48f5e7['error'](0x1f4,_[_0x7196('0x62')](_0x50cc66,_0x7196('0x20'))[_0x7196('0x18')](',\x20')));}var _0x4fa18f=_[_0x7196('0x5e')](_0x3ae43f['channels'],{'uniqueid':_0x5de6f2[_0x7196('0x63')]});if(_0x4fa18f&&_0x4fa18f[_0x7196('0x64')]){var _0x179815=util[_0x7196('0x9')](_0x7196('0x65'),_0x5de6f2[_0x7196('0x66')]||_0x5de6f2[_0x7196('0x63')],_0x5de6f2[_0x7196('0x9')]||'wav');return ami['Action']({'action':_0x7196('0x67'),'channel':_0x4fa18f[_0x7196('0x64')],'file':_0x179815,'options':_0x7196('0x68')})[_0x7196('0x1f')](function(_0x4ebcd7){var _0x76b189=_[_0x7196('0x5e')](_0x4fa18f[_0x7196('0x69')],{'filename':_0x7196('0x6a')+_0x179815[_0x7196('0x6b')]()});if(_[_0x7196('0x6c')](_0x76b189)){_0x4fa18f[_0x7196('0x69')][_0x7196('0x5c')]({'filename':_0x7196('0x6a')+_0x179815[_0x7196('0x6b')](),'createdAt':moment()[_0x7196('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x4ebcd7[_0x7196('0x6d')],'status':_0x7196('0x6e')});}else{_0x76b189[_0x7196('0x6d')]=_0x4ebcd7['mixmonitorid'];_0x76b189[_0x7196('0x6f')]='rec';}_0x516825({'code':0xc8,'message':[_0x5de6f2[_0x7196('0x63')],_0x7196('0x70'),_0x4ebcd7[_0x7196('0x6d')]][_0x7196('0x18')]('\x20'),'mixmonitorid':_0x4ebcd7[_0x7196('0x6d')]});})['catch'](function(_0x3ece9f){_0x2299e2(_0x48f5e7['error'](0x1f5,[_0x5de6f2['uniqueid'],_0x3ece9f['message'][_0x7196('0x6b')]()][_0x7196('0x18')]('\x20')));});}else{return _0x2299e2(_0x48f5e7[_0x7196('0x15')](0x1f5,_0x7196('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x105a3f){var _0x41fa94=this;return new Promise(function(_0x2d8b3d,_0x560ddb){if(ami[_0x7196('0x14')]()==![]){return _0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config[_0x7196('0x16')][_0x7196('0x17')],'ami\x20disconnected']['join']('\x20')));}var _0xa7ecfb=schema(properties[_0x7196('0x72')])[_0x7196('0x2')](_0x105a3f);if(_0xa7ecfb[_0x7196('0x5d')]>0x0){return _0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f4,_[_0x7196('0x62')](_0xa7ecfb,_0x7196('0x20'))[_0x7196('0x18')](',\x20')));}var _0x13e9d0=_[_0x7196('0x5e')](_0x3ae43f[_0x7196('0x73')],{'uniqueid':_0x105a3f['uniqueid']});if(_0x13e9d0){return BPromise[_0x7196('0x74')]()[_0x7196('0x1f')](function(){if(_0x13e9d0[_0x7196('0x64')]){return ami[_0x7196('0x1e')]({'action':'StopMixMonitor','channel':_0x13e9d0[_0x7196('0x64')],'mixmonitorid':_0x105a3f[_0x7196('0x6d')]})[_0x7196('0x21')](function(_0x38d0a0){});}})[_0x7196('0x1f')](function(){if(_0x13e9d0[_0x7196('0x75')]){return ami[_0x7196('0x1e')]({'action':'StopMixMonitor','channel':_0x13e9d0[_0x7196('0x75')],'mixmonitorid':_0x105a3f[_0x7196('0x6d')]})[_0x7196('0x21')](function(_0x3fb671){});}})['then'](function(_0x418a7a){var _0x3809c4=_[_0x7196('0x5e')](_0x13e9d0[_0x7196('0x69')],{'mixmonitorid':_0x105a3f[_0x7196('0x6d')]});if(_0x3809c4){_0x3809c4[_0x7196('0x6f')]=_0x7196('0x76');}})['then'](function(){var _0x56b2eb=util['format'](_0x7196('0x65'),_0x105a3f['filename']||_0x105a3f[_0x7196('0x63')],_0x105a3f[_0x7196('0x9')]||_0x7196('0x77'));var _0x37c7d4=_[_0x7196('0x5e')](_0x13e9d0[_0x7196('0x69')],{'filename':_0x7196('0x6a')+_0x56b2eb[_0x7196('0x6b')]()});if(_0x37c7d4){_0x37c7d4[_0x7196('0x6f')]='stop';}})['then'](function(){_0x2d8b3d({'code':0xc8,'message':[_0x105a3f[_0x7196('0x63')],_0x7196('0x78')][_0x7196('0x18')]('\x20')});})[_0x7196('0x21')](function(_0x30ddb6){_0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f5,[_0x105a3f[_0x7196('0x63')],_0x30ddb6[_0x7196('0x20')]['toLowerCase']()]['join']('\x20')));});}else{return _0x560ddb(_0x41fa94[_0x7196('0x15')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x30d114){return new Promise(function(_0x52f532,_0x18efc7){var _0x2ffe1f=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x7a')]);_0x52f532({'count':_0x2ffe1f['length'],'rows':_0x2ffe1f});});},'VoiceQueuesChannel':function(_0x5a786a){var _0x33d301=this;return new Promise(function(_0x5328c5,_0x3d2bee){var _0x326f61=schema(properties[_0x7196('0x7b')])[_0x7196('0x2')](_0x5a786a);if(_0x326f61[_0x7196('0x5d')]>0x0){return _0x3d2bee(_0x33d301[_0x7196('0x15')](0x1f4,_['map'](_0x326f61,_0x7196('0x20'))[_0x7196('0x18')](',\x20')));}var _0x41208b=_[_0x7196('0x5e')](_0x3ae43f[_0x7196('0x7a')],{'uniqueid':_0x5a786a[_0x7196('0x63')]});if(_0x41208b){_0x5328c5(_0x41208b);}else{return _0x3d2bee(_0x33d301[_0x7196('0x15')](0x1f5,_0x7196('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x13cbe2){var _0xa20de8=this;return new Promise(function(_0x3d3768,_0x2181f5){if(ami['isConnected']()==![]){return _0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config['asterisk']['username'],_0x7196('0x61')][_0x7196('0x18')]('\x20')));}var _0x71c062=schema(properties['voicequeuechannelhangup'])[_0x7196('0x2')](_0x13cbe2);if(_0x71c062['length']>0x0){return _0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f4,_[_0x7196('0x62')](_0x71c062,'message')[_0x7196('0x18')](',\x20')));}var _0x59f5ac=_['find'](_0x3ae43f[_0x7196('0x7a')],{'uniqueid':_0x13cbe2[_0x7196('0x63')]});if(_0x59f5ac&&_0x59f5ac[_0x7196('0x64')]){return ami['Action']({'action':_0x7196('0x7c'),'channel':_0x59f5ac['channel']})[_0x7196('0x1f')](function(_0x36b828){_0x3d3768({'code':0xc8,'message':[_0x13cbe2[_0x7196('0x63')],_0x36b828[_0x7196('0x20')][_0x7196('0x6b')]()]['join']('\x20')});})[_0x7196('0x21')](function(_0x13c8c0){_0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f5,[_0x13cbe2[_0x7196('0x63')],_0x13c8c0[_0x7196('0x20')][_0x7196('0x6b')]()][_0x7196('0x18')]('\x20')));});}else{return _0x2181f5(_0xa20de8[_0x7196('0x15')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2be199){var _0x1919d8=this;return new Promise(function(_0x28a29d,_0x2b899d){if(ami['isConnected']()==![]){return _0x2b899d(_0x1919d8[_0x7196('0x15')](0x1f4,[config[_0x7196('0x16')]['ip'],config['asterisk'][_0x7196('0x17')],'ami\x20disconnected'][_0x7196('0x18')]('\x20')));}var _0x5318c1=schema(properties[_0x7196('0x7d')])[_0x7196('0x2')](_0x2be199);if(_0x5318c1['length']>0x0){return _0x2b899d(_0x1919d8[_0x7196('0x15')](0x1f4,_[_0x7196('0x62')](_0x5318c1,_0x7196('0x20'))['join'](',\x20')));}var _0x548ac9=_[_0x7196('0x5e')](_0x3ae43f['queueChannels'],{'uniqueid':_0x2be199['uniqueid']});if(_0x548ac9&&_0x548ac9[_0x7196('0x64')]){return ami[_0x7196('0x1e')]({'action':_0x7196('0x7e'),'channel':_0x548ac9['channel'],'exten':_0x2be199[_0x7196('0x7f')],'context':_0x2be199[_0x7196('0x80')]||_0x548ac9[_0x7196('0x80')],'priority':0x1})[_0x7196('0x1f')](function(_0x3392d1){_0x28a29d({'code':0xc8,'message':[_0x2be199[_0x7196('0x63')],_0x3392d1[_0x7196('0x20')][_0x7196('0x6b')]()][_0x7196('0x18')]('\x20')});})[_0x7196('0x21')](function(_0x173fe5){_0x2b899d(_0x1919d8['error'](0x1f5,[_0x2be199['uniqueid'],_0x173fe5[_0x7196('0x20')]['toLowerCase']()]['join']('\x20')));});}else{return _0x2b899d(_0x1919d8[_0x7196('0x15')](0x1f5,_0x7196('0x71')));}});},'Agents':function(_0x2f686c){return new Promise(function(_0x3fe7fd,_0x4c9a66){var _0x50f2c4=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x10')]);_0x3fe7fd({'count':_0x50f2c4[_0x7196('0x5d')],'rows':_0x50f2c4});});},'Telephones':function(_0x247b15){return new Promise(function(_0x4bcaa3,_0x4d8b8e){var _0x4afbee=_['values'](_0x3ae43f[_0x7196('0x81')]);_0x4bcaa3({'count':_0x4afbee[_0x7196('0x5d')],'rows':_0x4afbee});});},'Trunks':function(_0x1e14da){return new Promise(function(_0x494418,_0x400aa5){var _0x40d4c3=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x82')]);_0x494418({'count':_0x40d4c3[_0x7196('0x5d')],'rows':_0x40d4c3});});},'OutboundChannels':function(_0x3e06c4){return new Promise(function(_0x214ec2,_0x3e729a){var _0x5de550=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x83')]);_0x214ec2({'count':_0x5de550[_0x7196('0x5d')],'rows':_0x5de550});});},'Outbound':function(_0x408760){return new Promise(function(_0x1a1c82,_0x4faf7b){_0x1a1c82(_0x3ae43f[_0x7196('0x84')]);});},'Campaigns':function(_0x11d823){return new Promise(function(_0x446eb8,_0x5a8c14){var _0x123e8c=_['values'](_0x3ae43f['campaigns']);_0x446eb8({'count':_0x123e8c[_0x7196('0x5d')],'rows':_0x123e8c});});},'VoiceQueuesPreview':function(_0x25d323){var _0x5b85f7=this;return new Promise(function(_0x200721,_0x40eb16){_0x5c128f['run'](_0x25d323['id'])[_0x7196('0x1f')](function(_0xdd5f69){_0x200721({'code':0xc8,'message':_0xdd5f69[_0x7196('0x20')]});})[_0x7196('0x21')](function(_0x441ca1){_0x40eb16(_0x5b85f7[_0x7196('0x15')](0x1f4,_0x441ca1['message']));});});},'EventManager':function(_0x3639be){var _0x460e51=this;return new Promise(function(_0x1ee49a,_0x5b09a1){if(!_0x3639be['event']){return _0x5b09a1(_0x460e51['error'](0x1f4,_0x7196('0x85')));}ami[_0x7196('0x86')](_0x7196('0x87')+_0x3639be['event'],_0x3639be[_0x7196('0x20')]);_0x1ee49a({'code':0xc8,'message':_0x3639be});});},'FaxAccounts':function(_0x503d1f){return new Promise(function(_0x15395f,_0x4e22df){var _0x389b5b=_[_0x7196('0x79')](_0x3ae43f[_0x7196('0x88')]);_0x15395f({'count':_0x389b5b[_0x7196('0x5d')],'rows':_0x389b5b});});},'SendFax':function(_0x37290e){var _0x10b628=this;return new Promise(function(_0x43e7d5,_0x48608b){_0x36b01e[_0x7196('0x89')](_0x37290e)['then'](function(_0x58fd39){_0x43e7d5({'code':0xc8,'message':_0x58fd39['message']});})['catch'](function(_0x4cf635){_0x48608b(_0x10b628[_0x7196('0x15')](0x1f4,_0x4cf635[_0x7196('0x20')]));});});},'CheckAfterSend':function(_0x3fe3f5){var _0x5bab25=this;return new Promise(function(_0x3e7195,_0x49bf7e){_0x36b01e['checkAfterSend'](_0x3fe3f5)['then'](function(_0x42b45d){_0x3e7195({'code':0xc8,'message':_0x42b45d['message']});})[_0x7196('0x21')](function(_0x2fe382){_0x49bf7e(_0x5bab25[_0x7196('0x15')](0x1f4,_0x2fe382[_0x7196('0x20')]));});});}};var _0x1cdb13=jayson[_0x7196('0x8a')](_0x40e0af)[_0x7196('0x8b')]();_0x1cdb13['on'](_0x7196('0x15'),function(_0x49d494){return _0x194746(_0x49d494);});_0x1cdb13[_0x7196('0x8')](0x232a,_0x7196('0x8c'),function(){console[_0x7196('0x8d')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x186175(_0x7196('0x8e')+0x232a);});});}; \ No newline at end of file +var _0xa0a1=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','values','channels','length','voicechannel','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','map','find','resolve','StopMixMonitor','destinationchannel','status','stop','monitors','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','outboundChannels','campaigns','run','event','emit','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','../properties','../ami','format','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','action','Action','message','catch','ami\x20disconnected','command','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x47b112,_0x55e216){var _0x8e4e43=function(_0x10d684){while(--_0x10d684){_0x47b112['push'](_0x47b112['shift']());}};_0x8e4e43(++_0x55e216);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x5c1dca,_0x132a71){_0x5c1dca=_0x5c1dca-0x0;var _0x2a1204=_0xa0a1[_0x5c1dca];return _0x2a1204;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var jayson=require(_0x1a0a('0x1'));var schema=require(_0x1a0a('0x2'));var BPromise=require(_0x1a0a('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x1a0a('0x4'));var ami=require(_0x1a0a('0x5'));exports['listen']=function(_0x27077a,_0x31e85b,_0x4b5573){return new BPromise(function(_0x2d4b04,_0xe59f97){var _0x3fe29f={'QueuePause':function(_0x245f3d){return new Promise(function(_0x9da67c,_0x48d604){var _0x2e5bec=util[_0x1a0a('0x6')](_0x1a0a('0x7'),'SIP',_0x245f3d['name']);if(_0x27077a['timers']&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec]&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec][_0x1a0a('0x9')]){_0x27077a['timers'][_0x2e5bec][_0x1a0a('0xa')]();}if(_0x27077a['agents'][_0x2e5bec]){_0x27077a[_0x1a0a('0xb')][_0x2e5bec][_0x1a0a('0xc')]({'statePause':_0x245f3d[_0x1a0a('0xd')]?!![]:![]});}_0x9da67c({'code':0xc8,'message':_0x1a0a('0xe')});});},'Reload':function(_0x289046){var _0x2dee74=this;return new Promise(function(_0x3f34d2,_0x4f2b35){if(ami[_0x1a0a('0xf')]()==![]){return _0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected'][_0x1a0a('0x13')]('\x20')));}_0x289046=_[_0x1a0a('0x14')](_0x289046,_[_0x1a0a('0x15')](properties['module']));_0x289046[_0x1a0a('0x16')]='Reload';return ami[_0x1a0a('0x17')](_0x289046)['then'](function(_0x54bfbe){_0x3f34d2({'code':0xc8,'message':_0x54bfbe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x307fdc){_0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f5,_0x307fdc['message']));});});},'Command':function(_0x56b8a5){var _0x239065=this;return new Promise(function(_0x40903a,_0xfa74ce){if(ami['isConnected']()==![]){return _0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config['asterisk'][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}_0x56b8a5=_['pick'](_0x56b8a5,_0x1a0a('0x1b'));_0x56b8a5[_0x1a0a('0x16')]=_0x1a0a('0x1c');return ami['Action'](_0x56b8a5)[_0x1a0a('0x1d')](function(_0x47ef88){_0x40903a({'code':0xc8,'message':_0x47ef88[_0x1a0a('0x1e')]});})[_0x1a0a('0x19')](function(_0x2d7967){_0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f5,_0x2d7967[_0x1a0a('0x18')]));});});},'VoiceQueues':function(_0x578995){return new Promise(function(_0x1e2b28,_0x8e4151){var _0x561407=[];for(var _0x4cf939 in _0x27077a[_0x1a0a('0x1f')]){if(_0x27077a[_0x1a0a('0x1f')][_0x1a0a('0x20')](_0x4cf939)){var _0x365ab5=_0x27077a[_0x1a0a('0x1f')][_0x4cf939];var _0x244bbf={'id':_0x365ab5['id'],'name':_0x365ab5[_0x1a0a('0x21')],'strategy':_0x365ab5[_0x1a0a('0x22')],'answered':_0x365ab5[_0x1a0a('0x23')],'available':_0x365ab5[_0x1a0a('0x24')],'loggedIn':_0x365ab5[_0x1a0a('0x25')],'pTalking':_0x365ab5[_0x1a0a('0x26')],'sumBillable':_0x365ab5[_0x1a0a('0x27')],'sumDuration':_0x365ab5[_0x1a0a('0x28')],'sumHoldTime':_0x365ab5[_0x1a0a('0x29')]||0x0,'talking':_0x365ab5[_0x1a0a('0x2a')],'total':_0x365ab5[_0x1a0a('0x2b')],'type':_0x365ab5['type'],'unmanaged':_0x365ab5[_0x1a0a('0x2c')],'abandoned':_0x365ab5[_0x1a0a('0x2d')],'waiting':_0x365ab5[_0x1a0a('0x2e')],'loggedInDb':_0x365ab5[_0x1a0a('0x2f')]};if(_0x365ab5[_0x1a0a('0x30')]===_0x1a0a('0x31')){_0x244bbf[_0x1a0a('0x32')]=_0x365ab5[_0x1a0a('0x32')];_0x244bbf[_0x1a0a('0x33')]=_0x365ab5[_0x1a0a('0x33')];_0x244bbf['dialOriginateCallerIdName']=_0x365ab5[_0x1a0a('0x34')];_0x244bbf[_0x1a0a('0x35')]=_0x365ab5['dialOriginateCallerIdNumber'];_0x244bbf[_0x1a0a('0x36')]=_0x365ab5['dialOriginateTimeout'];_0x244bbf['dialPrefix']=_0x365ab5[_0x1a0a('0x37')];_0x244bbf[_0x1a0a('0x38')]=_0x365ab5['temp'];_0x244bbf[_0x1a0a('0x39')]=_0x365ab5[_0x1a0a('0x39')];_0x244bbf[_0x1a0a('0x3a')]=_0x365ab5['outboundAnswerCallsDay'];_0x244bbf[_0x1a0a('0x3b')]=_0x365ab5[_0x1a0a('0x3b')];_0x244bbf['outboundBusyCallsDay']=_0x365ab5[_0x1a0a('0x3c')];_0x244bbf[_0x1a0a('0x3d')]=_0x365ab5['outboundCongestionCallsDay'];_0x244bbf[_0x1a0a('0x3e')]=_0x365ab5[_0x1a0a('0x3e')];_0x244bbf[_0x1a0a('0x3f')]=_0x365ab5[_0x1a0a('0x3f')];_0x244bbf['outboundDropCallsDayTimeout']=_0x365ab5[_0x1a0a('0x40')];_0x244bbf[_0x1a0a('0x41')]=_0x365ab5[_0x1a0a('0x41')];_0x244bbf[_0x1a0a('0x42')]=_0x365ab5[_0x1a0a('0x42')];_0x244bbf[_0x1a0a('0x43')]=_0x365ab5[_0x1a0a('0x43')];_0x244bbf[_0x1a0a('0x44')]=_0x365ab5[_0x1a0a('0x44')];_0x244bbf['outboundRejectCallsDay']=_0x365ab5['outboundRejectCallsDay'];_0x244bbf['outboundUnknownCallsDay']=_0x365ab5['outboundUnknownCallsDay'];_0x244bbf[_0x1a0a('0x45')]=_0x365ab5['predictiveIntervalAnsweredCalls'];_0x244bbf[_0x1a0a('0x46')]=_0x365ab5[_0x1a0a('0x46')];_0x244bbf['predictiveIntervalAvgTalktime']=_0x365ab5['predictiveIntervalAvgTalktime'];_0x244bbf[_0x1a0a('0x47')]=_0x365ab5[_0x1a0a('0x47')];_0x244bbf[_0x1a0a('0x48')]=_0x365ab5[_0x1a0a('0x48')];_0x244bbf['predictiveIntervalErlangCalls']=_0x365ab5[_0x1a0a('0x49')];_0x244bbf['predictiveIntervalErlangCallsDroppedCalls']=_0x365ab5['predictiveIntervalErlangCallsDroppedCalls'];_0x244bbf['predictiveIntervalHitRate']=_0x365ab5[_0x1a0a('0x4a')];_0x244bbf[_0x1a0a('0x4b')]=_0x365ab5['predictiveIntervalMultiplicativeFactor'];_0x244bbf[_0x1a0a('0x4c')]=_0x365ab5[_0x1a0a('0x4c')];_0x244bbf['predictiveIntervalAvailable']=_0x365ab5['predictiveIntervalAvailable'];_0x244bbf[_0x1a0a('0x4d')]=_0x365ab5[_0x1a0a('0x4d')];_0x244bbf['message']=_0x365ab5[_0x1a0a('0x18')];_0x244bbf[_0x1a0a('0x4e')]=_0x365ab5['originated'];_0x244bbf[_0x1a0a('0x4f')]=_0x365ab5['erlangCalls'];_0x244bbf[_0x1a0a('0x50')]=_0x365ab5['erlangCallToSecond'];_0x244bbf[_0x1a0a('0x51')]=_0x365ab5[_0x1a0a('0x51')];_0x244bbf[_0x1a0a('0x52')]=_0x365ab5[_0x1a0a('0x52')];_0x244bbf['startPredictive']=_0x365ab5[_0x1a0a('0x53')];_0x244bbf[_0x1a0a('0x54')]=_0x365ab5[_0x1a0a('0x54')];}if(_0x365ab5[_0x1a0a('0x55')]){_0x244bbf['Trunk']={'id':_0x365ab5[_0x1a0a('0x55')]['id'],'name':_0x365ab5[_0x1a0a('0x55')]['name'],'active':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x56')],'callerid':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x57')]};}if(_0x365ab5[_0x1a0a('0x58')]){_0x244bbf[_0x1a0a('0x58')]={'id':_0x365ab5[_0x1a0a('0x58')]['id'],'name':_0x365ab5[_0x1a0a('0x58')][_0x1a0a('0x21')]};}_0x561407[_0x1a0a('0x59')](_0x244bbf);}}_0x1e2b28({'count':_0x561407['length'],'rows':_0x561407});});},'UpdateVoiceQueue':function(_0x35c133){return new Promise(function(_0x2a5a04,_0x4ba9ca){var _0x493083=_['find'](_0x27077a['voiceQueues'],{'id':parseInt(_0x35c133['id'])});var _0x455f57=_[_0x1a0a('0x5a')](_0x35c133,['id']);if(_0x493083){for(var _0x48711d in _0x455f57){if(typeof _0x455f57[_0x48711d]!=='undefined'&&typeof _0x493083[_0x48711d]!=='undefined'){_0x493083[_0x48711d]=_0x455f57[_0x48711d];}}_0x2a5a04(_0x493083);}else{_0x4ba9ca();}});},'VoiceChannels':function(_0x423f52){return new Promise(function(_0x1185e9,_0x144360){var _0x2c58a9=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x5c')]);_0x1185e9({'count':_0x2c58a9[_0x1a0a('0x5d')],'rows':_0x2c58a9});});},'VoiceChannelMixMonitor':function(_0x683bdc){var _0x9a2756=this;return new Promise(function(_0xf729c7,_0x1ed012){if(ami[_0x1a0a('0xf')]()==![]){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x14b07a=schema(properties[_0x1a0a('0x5e')])['validate'](_0x683bdc);if(_0x14b07a[_0x1a0a('0x5d')]>0x0){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,_['map'](_0x14b07a,'message')[_0x1a0a('0x13')](',\x20')));}var _0x498118=_['find'](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x683bdc['uniqueid']});if(_0x498118&&_0x498118[_0x1a0a('0x5f')]){var _0x217073=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x683bdc[_0x1a0a('0x61')]||_0x683bdc[_0x1a0a('0x62')],_0x683bdc[_0x1a0a('0x6')]||_0x1a0a('0x63'));return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x64'),'channel':_0x498118['channel'],'file':_0x217073,'options':_0x1a0a('0x65')})['then'](function(_0x9e897f){var _0x1e97d2=_['find'](_0x498118['monitors'],{'filename':_0x1a0a('0x66')+_0x217073[_0x1a0a('0x67')]()});if(_['isNil'](_0x1e97d2)){_0x498118['monitors'][_0x1a0a('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x217073[_0x1a0a('0x67')](),'createdAt':moment()[_0x1a0a('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')],'status':'rec'});}else{_0x1e97d2[_0x1a0a('0x68')]=_0x9e897f[_0x1a0a('0x68')];_0x1e97d2['status']=_0x1a0a('0x69');}_0xf729c7({'code':0xc8,'message':[_0x683bdc[_0x1a0a('0x62')],_0x1a0a('0x6a'),_0x9e897f['mixmonitorid']][_0x1a0a('0x13')]('\x20'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')]});})['catch'](function(_0x5dac09){_0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f5,[_0x683bdc[_0x1a0a('0x62')],_0x5dac09[_0x1a0a('0x18')][_0x1a0a('0x67')]()]['join']('\x20')));});}else{return _0x1ed012(_0x9a2756['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2fef04){var _0x5e1eaa=this;return new Promise(function(_0x10fd71,_0x2953c1){if(ami[_0x1a0a('0xf')]()==![]){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}var _0x34dd54=schema(properties[_0x1a0a('0x5e')])[_0x1a0a('0x2')](_0x2fef04);if(_0x34dd54[_0x1a0a('0x5d')]>0x0){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x34dd54,'message')[_0x1a0a('0x13')](',\x20')));}var _0x26cb74=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x2fef04['uniqueid']});if(_0x26cb74){return BPromise[_0x1a0a('0x6d')]()[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x6e'),'channel':_0x26cb74[_0x1a0a('0x5f')],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})[_0x1a0a('0x19')](function(_0x224eac){});}})[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x6f')]){return ami['Action']({'action':_0x1a0a('0x6e'),'channel':_0x26cb74['destinationchannel'],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})['catch'](function(_0x1c2b41){});}})[_0x1a0a('0x1d')](function(_0x3ccce6){var _0x1aadbd=_[_0x1a0a('0x6c')](_0x26cb74['monitors'],{'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]});if(_0x1aadbd){_0x1aadbd[_0x1a0a('0x70')]=_0x1a0a('0x71');}})[_0x1a0a('0x1d')](function(){var _0x36c617=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x2fef04['filename']||_0x2fef04[_0x1a0a('0x62')],_0x2fef04[_0x1a0a('0x6')]||_0x1a0a('0x63'));var _0x5e2d94=_['find'](_0x26cb74[_0x1a0a('0x72')],{'filename':_0x1a0a('0x66')+_0x36c617[_0x1a0a('0x67')]()});if(_0x5e2d94){_0x5e2d94[_0x1a0a('0x70')]=_0x1a0a('0x71');}})['then'](function(){_0x10fd71({'code':0xc8,'message':[_0x2fef04[_0x1a0a('0x62')],_0x1a0a('0x73')][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x4629b7){_0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,[_0x2fef04[_0x1a0a('0x62')],_0x4629b7[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')));});}else{return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x33a0eb){return new Promise(function(_0x239262,_0x1a903c){var _0x569ecb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x74')]);_0x239262({'count':_0x569ecb[_0x1a0a('0x5d')],'rows':_0x569ecb});});},'VoiceQueuesChannel':function(_0x2c757f){var _0xec020d=this;return new Promise(function(_0x471c4e,_0x3ef0cc){var _0x488f43=schema(properties[_0x1a0a('0x75')])[_0x1a0a('0x2')](_0x2c757f);if(_0x488f43[_0x1a0a('0x5d')]>0x0){return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x488f43,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x56756e=_[_0x1a0a('0x6c')](_0x27077a['queueChannels'],{'uniqueid':_0x2c757f[_0x1a0a('0x62')]});if(_0x56756e){_0x471c4e(_0x56756e);}else{return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelHangup':function(_0x221201){var _0x24cca3=this;return new Promise(function(_0x55ce61,_0x21baea){if(ami[_0x1a0a('0xf')]()==![]){return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x4f5e24=schema(properties[_0x1a0a('0x77')])[_0x1a0a('0x2')](_0x221201);if(_0x4f5e24[_0x1a0a('0x5d')]>0x0){return _0x21baea(_0x24cca3['error'](0x1f4,_[_0x1a0a('0x6b')](_0x4f5e24,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x4ef8e7=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x221201['uniqueid']});if(_0x4ef8e7&&_0x4ef8e7[_0x1a0a('0x5f')]){return ami['Action']({'action':'Hangup','channel':_0x4ef8e7[_0x1a0a('0x5f')]})[_0x1a0a('0x1d')](function(_0xeb1468){_0x55ce61({'code':0xc8,'message':[_0x221201[_0x1a0a('0x62')],_0xeb1468[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')});})[_0x1a0a('0x19')](function(_0x51d91f){_0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,[_0x221201[_0x1a0a('0x62')],_0x51d91f[_0x1a0a('0x18')]['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelRedirect':function(_0x3e5323){var _0x59e463=this;return new Promise(function(_0x348d33,_0x5b35a8){if(ami[_0x1a0a('0xf')]()==![]){return _0x5b35a8(_0x59e463['error'](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x190000=schema(properties[_0x1a0a('0x78')])[_0x1a0a('0x2')](_0x3e5323);if(_0x190000[_0x1a0a('0x5d')]>0x0){return _0x5b35a8(_0x59e463['error'](0x1f4,_[_0x1a0a('0x6b')](_0x190000,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x5c73ad=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x3e5323[_0x1a0a('0x62')]});if(_0x5c73ad&&_0x5c73ad[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x79'),'channel':_0x5c73ad[_0x1a0a('0x5f')],'exten':_0x3e5323['exten'],'context':_0x3e5323[_0x1a0a('0x7a')]||_0x5c73ad['context'],'priority':0x1})[_0x1a0a('0x1d')](function(_0x367830){_0x348d33({'code':0xc8,'message':[_0x3e5323['uniqueid'],_0x367830['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x21146e){_0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,[_0x3e5323[_0x1a0a('0x62')],_0x21146e['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x47fb42){return new Promise(function(_0x32fbc5,_0x32bab1){var _0xe85959=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0xb')]);_0x32fbc5({'count':_0xe85959[_0x1a0a('0x5d')],'rows':_0xe85959});});},'Telephones':function(_0x577e25){return new Promise(function(_0x116934,_0xf2bdec){var _0x50f111=_[_0x1a0a('0x5b')](_0x27077a['telephones']);_0x116934({'count':_0x50f111[_0x1a0a('0x5d')],'rows':_0x50f111});});},'Trunks':function(_0x48c39f){return new Promise(function(_0x5187b7,_0x534aeb){var _0x3767ef=_['values'](_0x27077a['trunks']);_0x5187b7({'count':_0x3767ef[_0x1a0a('0x5d')],'rows':_0x3767ef});});},'OutboundChannels':function(_0x45d13a){return new Promise(function(_0x5f3fe6,_0x1a8641){var _0x2400a6=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7b')]);_0x5f3fe6({'count':_0x2400a6['length'],'rows':_0x2400a6});});},'Outbound':function(_0x2d1482){return new Promise(function(_0x552617,_0x2b6e84){_0x552617(_0x27077a[_0x1a0a('0x31')]);});},'Campaigns':function(_0x420de6){return new Promise(function(_0x4ca92c,_0x5b87dd){var _0x18e50a=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7c')]);_0x4ca92c({'count':_0x18e50a[_0x1a0a('0x5d')],'rows':_0x18e50a});});},'VoiceQueuesPreview':function(_0x3f0ec9){var _0x260122=this;return new Promise(function(_0x106b45,_0x92a816){_0x31e85b[_0x1a0a('0x7d')](_0x3f0ec9['id'])[_0x1a0a('0x1d')](function(_0x1431af){_0x106b45({'code':0xc8,'message':_0x1431af[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x20cebc){_0x92a816(_0x260122[_0x1a0a('0x10')](0x1f4,_0x20cebc[_0x1a0a('0x18')]));});});},'EventManager':function(_0x3b8bb7){var _0x575bd=this;return new Promise(function(_0x2bf3a,_0x22ad6d){if(!_0x3b8bb7[_0x1a0a('0x7e')]){return _0x22ad6d(_0x575bd[_0x1a0a('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x1a0a('0x7f')]('custom:'+_0x3b8bb7[_0x1a0a('0x7e')],_0x3b8bb7['message']);_0x2bf3a({'code':0xc8,'message':_0x3b8bb7});});},'FaxAccounts':function(_0x2c632f){return new Promise(function(_0x36eb72,_0x4cdbf1){var _0x59c6fb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x80')]);_0x36eb72({'count':_0x59c6fb[_0x1a0a('0x5d')],'rows':_0x59c6fb});});},'SendFax':function(_0x5d46b3){var _0x4a18dc=this;return new Promise(function(_0x94f975,_0x1c5f0c){_0x4b5573[_0x1a0a('0x81')](_0x5d46b3)[_0x1a0a('0x1d')](function(_0x59eafe){_0x94f975({'code':0xc8,'message':_0x59eafe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x12e46f){_0x1c5f0c(_0x4a18dc[_0x1a0a('0x10')](0x1f4,_0x12e46f[_0x1a0a('0x18')]));});});},'CheckAfterSend':function(_0x159137){var _0x20d586=this;return new Promise(function(_0xe3e686,_0x2c8065){_0x4b5573[_0x1a0a('0x82')](_0x159137)[_0x1a0a('0x1d')](function(_0x269a94){_0xe3e686({'code':0xc8,'message':_0x269a94[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x3754a7){_0x2c8065(_0x20d586[_0x1a0a('0x10')](0x1f4,_0x3754a7['message']));});});}};var _0x57ef20=jayson[_0x1a0a('0x83')](_0x3fe29f)[_0x1a0a('0x84')]();_0x57ef20['on']('error',function(_0x1ac840){return _0xe59f97(_0x1ac840);});_0x57ef20[_0x1a0a('0x85')](0x232a,_0x1a0a('0x86'),function(){console[_0x1a0a('0x87')](_0x1a0a('0x88'),0x232a);return _0x2d4b04('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index bb42149..8a376cb 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 _0xb458=['redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb458,0x103));var _0x8b45=function(_0x535ad6,_0x22b56c){_0x535ad6=_0x535ad6-0x0;var _0x12d4f6=_0xb458[_0x535ad6];return _0x12d4f6;};'use strict';var _=require(_0x8b45('0x0'));var BPromise=require(_0x8b45('0x1'));var Redis=require(_0x8b45('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var cmContactRpc=require(_0x8b45('0x5'));config[_0x8b45('0x6')]=_['defaults'](config[_0x8b45('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b45('0x6')]));function emit(_0x12bd05,_0x2daa9a,_0x3a8ccb,_0x32342f,_0x4d1718){logger[_0x8b45('0x7')](_0x8b45('0x8'),_0x12bd05,_0x2daa9a['id'],_0x3a8ccb,_0x32342f,JSON[_0x8b45('0x9')](_0x4d1718));io['to'](_0x3a8ccb)[_0x8b45('0xa')](_0x32342f,_0x4d1718);}exports[_0x8b45('0xb')]=function(_0x499899,_0x2a4c83,_0x7cc49b,_0x57faf9){var _0x5316af,_0x5bb708;var _0x4e28bb={};var _0x43a4c3=Number(_0x7cc49b[_0x8b45('0xc')]);var _0x37c220=_0x7cc49b['data2']?Boolean(Number(_0x7cc49b[_0x8b45('0xd')])):![];var _0x455ecf;var _0x42bb72=![];if(!_[_0x8b45('0xe')](_0x7cc49b[_0x8b45('0xf')])){if(_0x7cc49b[_0x8b45('0xf')]=='1')_0x42bb72=!![];}if(!_0x42bb72){if(_0x57faf9['xmd-contactid']){_0x4e28bb['id']=_0x57faf9['xmd-contactid'];}}if(!_0x4e28bb['id']){_0x4e28bb[_0x8b45('0x10')]=_0x43a4c3;_0x455ecf=_0x7cc49b[_0x8b45('0x11')]&&_0x7cc49b[_0x8b45('0x11')]!=='0'?_0x7cc49b[_0x8b45('0x11')][_0x8b45('0x12')](','):[_0x8b45('0x13')];_0x4e28bb[_0x8b45('0x14')]=_[_0x8b45('0x15')](_0x455ecf,function(_0x33102e){var _0x391d1e={};_0x391d1e[_0x33102e]=_0x57faf9[_0x8b45('0x16')]?_0x57faf9[_0x8b45('0x17')]:_0x57faf9[_0x8b45('0x18')];return _0x391d1e;});}var _0x43ffb7=['id',_0x8b45('0x19'),_0x8b45('0x1a'),_0x8b45('0x13'),_0x8b45('0x1b'),'fax',_0x8b45('0x10'),_0x8b45('0x1c'),_0x8b45('0x1d'),_0x8b45('0x1e')];var _0x3e1438=_[_0x8b45('0x1f')](_0x43ffb7,_0x455ecf);BPromise[_0x8b45('0x20')]()[_0x8b45('0x21')](cmContactRpc['getContacts']({'attributes':_0x3e1438,'where':_0x4e28bb}))['then'](function(_0x41154a){_0x5bb708=_0x41154a;if(!_['isEmpty'](_0x5bb708)){if(_0x5bb708[_0x8b45('0x22')]===0x1){_0x5316af=_0x5bb708[0x0];logger[_0x8b45('0x7')](_0x8b45('0x23'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}else{logger[_0x8b45('0x7')](_0x8b45('0x25'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_['map'](_0x5bb708,'id')['join'](','));}return;}else{logger[_0x8b45('0x7')](_0x8b45('0x26'),_0x57faf9['uniqueid'],_0x2a4c83['id']);var _0x5723a2={'ListId':_0x43a4c3};var _0x129c35=_0x7cc49b[_0x8b45('0x27')]&&_0x7cc49b[_0x8b45('0x27')]!=='0'?_0x7cc49b[_0x8b45('0x27')]:'phone';if(_0x37c220){logger[_0x8b45('0x7')](_0x8b45('0x28'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9[_0x8b45('0x2c')]!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}return BPromise[_0x8b45('0x20')]()['then'](cmContactRpc[_0x8b45('0x2d')](_0x5723a2))[_0x8b45('0x21')](function(_0x50302){_0x5316af=_0x50302;_0x5bb708[_0x8b45('0x2e')](_0x50302);if(_0x5316af){logger[_0x8b45('0x7')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9['routeId'])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9['destcalleridname']!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}_0x5316af=_0x5723a2;_0x5bb708['push'](_0x5723a2);return;}}})[_0x8b45('0x21')](function(){if(_0x499899){emit(_0x57faf9[_0x8b45('0x24')],_0x2a4c83,util[_0x8b45('0x2f')](_0x8b45('0x30'),_0x499899['name']),util[_0x8b45('0x2f')](_0x8b45('0x31'),_0x7cc49b[_0x8b45('0x32')][_0x8b45('0x33')]()),{'evt':_[_0x8b45('0x34')](_0x57faf9,{'autoCreate':_0x37c220}),'contact':_0x5316af===undefined?{}:_0x5316af,'contacts':_0x5bb708[_0x8b45('0x22')]===0x0?undefined:_0x5bb708});}});}; \ No newline at end of file +var _0xac31=['mobile','fax','ListId','createdAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','info','[CM][%s][%s]\x20Contact\x20not\x20found','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','data3','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName'];(function(_0x4999c3,_0x54660b){var _0x55863a=function(_0x148393){while(--_0x148393){_0x4999c3['push'](_0x4999c3['shift']());}};_0x55863a(++_0x54660b);}(_0xac31,0xca));var _0x1ac3=function(_0x52f414,_0x78e80b){_0x52f414=_0x52f414-0x0;var _0x4da458=_0xac31[_0x52f414];return _0x4da458;};'use strict';var _=require(_0x1ac3('0x0'));var BPromise=require(_0x1ac3('0x1'));var Redis=require(_0x1ac3('0x2'));var util=require(_0x1ac3('0x3'));var config=require(_0x1ac3('0x4'));var logger=require(_0x1ac3('0x5'))(_0x1ac3('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x1ac3('0x7')]=_[_0x1ac3('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1ac3('0x9'))(new Redis(config[_0x1ac3('0x7')]));function emit(_0x2bf9b1,_0x1be223,_0x157604,_0x57893c,_0x2d17de){logger['info'](_0x1ac3('0xa'),_0x2bf9b1,_0x1be223['id'],_0x157604,_0x57893c,JSON[_0x1ac3('0xb')](_0x2d17de));io['to'](_0x157604)[_0x1ac3('0xc')](_0x57893c,_0x2d17de);}exports['exec']=function(_0xa26c88,_0x1e2642,_0x3e835b,_0x24f0d2){var _0x2a8dc7,_0x422d19;var _0x4b5c92={};var _0x3b38fc=Number(_0x3e835b[_0x1ac3('0xd')]);var _0x2eeabf=_0x3e835b[_0x1ac3('0xe')]?Boolean(Number(_0x3e835b['data2'])):![];var _0x88ed7c;var _0x37d426=![];if(!_[_0x1ac3('0xf')](_0x3e835b[_0x1ac3('0x10')])){if(_0x3e835b['data5']=='1')_0x37d426=!![];}if(!_0x37d426){if(_0x24f0d2[_0x1ac3('0x11')]){_0x4b5c92['id']=_0x24f0d2[_0x1ac3('0x11')];}}if(!_0x4b5c92['id']){_0x4b5c92['ListId']=_0x3b38fc;_0x88ed7c=_0x3e835b[_0x1ac3('0x12')]&&_0x3e835b[_0x1ac3('0x12')]!=='0'?_0x3e835b[_0x1ac3('0x12')]['split'](','):[_0x1ac3('0x13')];_0x4b5c92[_0x1ac3('0x14')]=_[_0x1ac3('0x15')](_0x88ed7c,function(_0x541744){var _0x195683={};_0x195683[_0x541744]=_0x24f0d2['routeId']?_0x24f0d2[_0x1ac3('0x16')]:_0x24f0d2[_0x1ac3('0x17')];return _0x195683;});}var _0x20091d=['id',_0x1ac3('0x18'),_0x1ac3('0x19'),'phone',_0x1ac3('0x1a'),_0x1ac3('0x1b'),_0x1ac3('0x1c'),_0x1ac3('0x1d'),'scheduledAt','updatedAt'];var _0x2879d8=_[_0x1ac3('0x1e')](_0x20091d,_0x88ed7c);BPromise[_0x1ac3('0x1f')]()[_0x1ac3('0x20')](cmContactRpc[_0x1ac3('0x21')]({'attributes':_0x2879d8,'where':_0x4b5c92}))[_0x1ac3('0x20')](function(_0x23b767){_0x422d19=_0x23b767;if(!_[_0x1ac3('0x22')](_0x422d19)){if(_0x422d19[_0x1ac3('0x23')]===0x1){_0x2a8dc7=_0x422d19[0x0];logger['info'](_0x1ac3('0x24'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_0x2a8dc7['id']);}else{logger['info'](_0x1ac3('0x26'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_['map'](_0x422d19,'id')[_0x1ac3('0x27')](','));}return;}else{logger[_0x1ac3('0x28')](_0x1ac3('0x29'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);var _0x10db3d={'ListId':_0x3b38fc};var _0x565a0f=_0x3e835b['data4']&&_0x3e835b['data4']!=='0'?_0x3e835b['data4']:'phone';if(_0x2eeabf){logger[_0x1ac3('0x28')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);_0x10db3d[_0x565a0f]=_[_0x1ac3('0xf')](_0x24f0d2[_0x1ac3('0x2a')])?_0x24f0d2[_0x1ac3('0x17')]:_0x24f0d2['destcalleridnum'];if(_[_0x1ac3('0xf')](_0x24f0d2['routeId'])){_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2[_0x1ac3('0x2b')]&&_0x24f0d2[_0x1ac3('0x2b')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2b')]:_0x1ac3('0x2d');}else{_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2['destcalleridname']&&_0x24f0d2[_0x1ac3('0x2e')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2e')]:_0x1ac3('0x2d');}return BPromise['resolve']()[_0x1ac3('0x20')](cmContactRpc[_0x1ac3('0x2f')](_0x10db3d))[_0x1ac3('0x20')](function(_0x294513){_0x2a8dc7=_0x294513;_0x422d19[_0x1ac3('0x30')](_0x294513);if(_0x2a8dc7){logger['info'](_0x1ac3('0x31'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id'],_0x2a8dc7['id']);}return;});}else{logger[_0x1ac3('0x28')](_0x1ac3('0x32'),_0x24f0d2[_0x1ac3('0x25')],_0x1e2642['id']);_0x10db3d[_0x565a0f]=_[_0x1ac3('0xf')](_0x24f0d2['routeId'])?_0x24f0d2[_0x1ac3('0x17')]:_0x24f0d2[_0x1ac3('0x16')];if(_[_0x1ac3('0xf')](_0x24f0d2[_0x1ac3('0x2a')])){_0x10db3d['firstName']=_0x24f0d2[_0x1ac3('0x2b')]&&_0x24f0d2[_0x1ac3('0x2b')]!==_0x1ac3('0x2c')?_0x24f0d2[_0x1ac3('0x2b')]:_0x1ac3('0x2d');}else{_0x10db3d[_0x1ac3('0x18')]=_0x24f0d2[_0x1ac3('0x2e')]&&_0x24f0d2[_0x1ac3('0x2e')]!==_0x1ac3('0x2c')?_0x24f0d2['destcalleridname']:_0x1ac3('0x2d');}_0x2a8dc7=_0x10db3d;_0x422d19[_0x1ac3('0x30')](_0x10db3d);return;}}})['then'](function(){if(_0xa26c88){emit(_0x24f0d2[_0x1ac3('0x25')],_0x1e2642,util[_0x1ac3('0x33')](_0x1ac3('0x34'),_0xa26c88[_0x1ac3('0x35')]),util[_0x1ac3('0x33')](_0x1ac3('0x36'),_0x3e835b[_0x1ac3('0x37')][_0x1ac3('0x38')]()),{'evt':_['merge'](_0x24f0d2,{'autoCreate':_0x2eeabf}),'contact':_0x2a8dc7===undefined?{}:_0x2a8dc7,'contacts':_0x422d19[_0x1ac3('0x23')]===0x0?undefined:_0x422d19});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index d4ef5d1..13615fa 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 _0x6718=['../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','accounts','servicenowAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','motionChannel','voice','checkTriggers','hasOwnProperty','status','checkTrigger','Actions','length','interface','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','600','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','action','exec','integration','queue','routeId','script','query','search','channel','AllConditions','every','AnyConditions','some','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','membername','lastevent','util','lodash','url','mustache','./urlforward','./cmContact','./script','../../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6718,0xde));var _0x8671=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0x6718[_0x49c653];return _0x31e169;};'use strict';var util=require(_0x8671('0x0'));var _=require(_0x8671('0x1'));var url=require(_0x8671('0x2'));var Mustache=require(_0x8671('0x3'));var Redis=require('ioredis');var urlforward=require(_0x8671('0x4'));var integration=require('./integration');var cmContact=require(_0x8671('0x5'));var script=require(_0x8671('0x6'));var config=require(_0x8671('0x7'));var logger=require(_0x8671('0x8'))(_0x8671('0x9'));var ami=require(_0x8671('0xa'));config[_0x8671('0xb')]=_[_0x8671('0xc')](config[_0x8671('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x8671('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x5f5b5d,_0x44d410){return _0x5f5b5d==_0x44d410;},'not_equals':function(_0x33bb97,_0x23ecd6){return _0x33bb97!=_0x23ecd6;}};var barAndWebActions=[_0x8671('0xe'),_0x8671('0x2'),_0x8671('0xf')];function Trigger(_0x11f6ac){this[_0x8671('0x10')]=_0x11f6ac[_0x8671('0x10')];this[_0x8671('0x11')]=_0x11f6ac[_0x8671('0x11')];this['voiceQueues']=_0x11f6ac[_0x8671('0x12')];this['templates']=_0x11f6ac[_0x8671('0x13')];this[_0x8671('0x14')]=_0x11f6ac['voiceExtensions'];this[_0x8671('0x15')]=_0x11f6ac[_0x8671('0x15')];this[_0x8671('0x16')]=_0x11f6ac[_0x8671('0x16')];this[_0x8671('0x17')]=_0x11f6ac['salesforceAccounts'];this[_0x8671('0x18')]=_0x11f6ac[_0x8671('0x18')];this[_0x8671('0x19')]=_0x11f6ac[_0x8671('0x19')];this[_0x8671('0x1a')]=_0x11f6ac[_0x8671('0x1a')];this['vtigerAccounts']=_0x11f6ac[_0x8671('0x1b')];this['servicenowAccounts']=_0x11f6ac['servicenowAccounts'];this['dynamics365Accounts']=_0x11f6ac['dynamics365Accounts'];this[_0x8671('0x1c')]=_0x11f6ac['freshsalesAccounts'];this[_0x8671('0x1d')]={'zendesk':this[_0x8671('0x15')],'salesforce':this[_0x8671('0x17')],'freshdesk':this[_0x8671('0x16')],'sugarcrm':this[_0x8671('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0x8671('0x1a')],'vtiger':this[_0x8671('0x1b')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x8671('0x1c')],'servicenow':this[_0x8671('0x1e')]};ami['on']('custom:agentcalled',this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x21'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x22'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x23'),this[_0x8671('0x1f')]['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x24'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x25'),this[_0x8671('0x1f')]['bind'](this));ami['on'](_0x8671('0x26'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x27'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x28'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x29'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x2a'),this['syncCustomEvent'][_0x8671('0x20')](this));ami['on'](_0x8671('0x2b'),this[_0x8671('0x2c')]['bind'](this));ami['on'](_0x8671('0x2d'),this['syncAgentDial'][_0x8671('0x20')](this));ami['on'](_0x8671('0x2e'),this[_0x8671('0x2c')]['bind'](this));ami['on'](_0x8671('0x2f'),this[_0x8671('0x1f')]['bind'](this));ami['on'](_0x8671('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8671('0x31'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x32'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x33'),this[_0x8671('0x1f')][_0x8671('0x20')](this));ami['on'](_0x8671('0x34'),this[_0x8671('0x1f')][_0x8671('0x20')](this));}Trigger[_0x8671('0x35')][_0x8671('0x36')]=function(_0x1f7d8d,_0x164170,_0x1cb139){logger['info'](_0x1f7d8d,_0x164170,JSON['stringify'](_0x1cb139));io['to'](_0x1f7d8d)[_0x8671('0x36')](_0x164170,_0x1cb139);};Trigger[_0x8671('0x35')]['syncCustomEvent']=function(_0xad76c2){var _0x1395f1=_['clone'](_0xad76c2);if(typeof _0x1395f1[_0x8671('0x37')]==='undefined'){_0x1395f1[_0x8671('0x37')]=_0x8671('0x38');}this[_0x8671('0x39')](_0x1395f1);};Trigger[_0x8671('0x35')]['syncAgentDial']=function(_0x33ab9a){if(this[_0x8671('0x11')][_0x33ab9a['interface']]){this[_0x8671('0x1f')](_0x33ab9a);}};Trigger[_0x8671('0x35')][_0x8671('0x39')]=function(_0x838ed7){var _0x38b453;for(var _0x329719 in this[_0x8671('0x10')]){if(this[_0x8671('0x10')][_0x8671('0x3a')](_0x329719)){if(this['triggers'][_0x329719][_0x8671('0x3b')]){_0x38b453=this[_0x8671('0x3c')](this[_0x8671('0x10')][_0x329719],_0x838ed7);if(_0x38b453){_['merge'](_0x838ed7,_0x838ed7['variables']);for(var _0x2147ef=0x0,_0x5c3589,_0x44f0ac,_0x36fb32;_0x2147ef0x0){_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 _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x2d3907,_0x21a83f){_0x2d3907=_0x2d3907-0x0;var _0x2846b4=_0xe14b[_0x2d3907];return _0x2846b4;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ 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 131fc19..ef0edbe 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 _0xa80f=['ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Recording\x20is\x20enabled!','recordingFormat','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','name','inspect','lodash','bluebird','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','catch','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','enduserId','contactid',']\x20Enduser\x20Created!','forEach','includes','string','type','customField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','calleridnum','queue','callDirection'];(function(_0x251995,_0x3ea489){var _0x22cb8d=function(_0x406b9b){while(--_0x406b9b){_0x251995['push'](_0x251995['shift']());}};_0x22cb8d(++_0x3ea489);}(_0xa80f,0x193));var _0xfa80=function(_0x57fda8,_0x5e80a0){_0x57fda8=_0x57fda8-0x0;var _0x11c895=_0xa80f[_0x57fda8];return _0x11c895;};'use strict';var _=require(_0xfa80('0x0'));var BPromise=require(_0xfa80('0x1'));var rp=require(_0xfa80('0x2'));var util=require('util');var intUtil=require(_0xfa80('0x3'));var md5=require(_0xfa80('0x4'));var Redis=require(_0xfa80('0x5'));var logger=require(_0xfa80('0x6'))(_0xfa80('0x7'));var config=require('../../../../config/environment');config[_0xfa80('0x8')]=_['defaults'](config[_0xfa80('0x8')],{'host':_0xfa80('0x9'),'port':0x18eb});var io=require(_0xfa80('0xa'))(new Redis(config[_0xfa80('0x8')]));function getAuthToken(_0x4e4df9,_0x237094,_0x15a44a){var _0x58e59b={'method':_0xfa80('0xb'),'uri':_0x237094,'form':{'client_id':_0x4e4df9[_0xfa80('0xc')],'resource':_0x4e4df9['remoteUri'],'username':_0x4e4df9[_0xfa80('0xd')],'password':_0x4e4df9[_0xfa80('0xe')],'grant_type':_0xfa80('0xe'),'client_secret':_0x4e4df9[_0xfa80('0xf')]},'json':!![]};return rp(_0x58e59b)[_0xfa80('0x10')](function(_0x3c06b8){return _0x3c06b8['access_token'];})['catch'](function(_0x260274){logger[_0xfa80('0x11')]('['+[_0x15a44a[_0xfa80('0x12')]()]+']\x20Wrong\x20credentials!');return _0x260274[_0xfa80('0x13')];});}function getUser(_0x36fc8a,_0x405fc1,_0x41df4c,_0x67478d,_0x4986e4,_0x4dd3b6){return new BPromise(function(_0x270249,_0x274273){return getAuthToken(_0x405fc1,_0x67478d,_0x4dd3b6)[_0xfa80('0x10')](function(_0x8a0d99){var _0x38a408={'method':_0xfa80('0x14'),'uri':_0x4986e4+_0xfa80('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x8a0d99,'OData-Version':_0xfa80('0x16')},'json':!![]};return rp(_0x38a408);})[_0xfa80('0x10')](function(_0x67832f){var _0x2fe466=_0x67832f[_0xfa80('0x17')];var _0x17ac8b=![];var _0x174b9a=null;if(!_[_0xfa80('0x18')](_0x41df4c)){if(intUtil[_0xfa80('0x19')](_0x41df4c[_0xfa80('0x1a')])){_0x36fc8a[_0xfa80('0x1b')]=_0x41df4c[_0xfa80('0x1a')];for(_0x174b9a=0x0;_0x174b9a<_0x2fe466[_0xfa80('0x1c')];_0x174b9a++){if(_0x2fe466[_0x174b9a][_0xfa80('0x1d')]===_0x41df4c['email']&&!_0x2fe466[_0x174b9a][_0xfa80('0x1e')]){_0x17ac8b=!![];logger[_0xfa80('0x1f')]('['+[_0x4dd3b6[_0xfa80('0x12')]()]+']\x20Agent\x20found\x20'+_0x2fe466[_0x174b9a][_0xfa80('0x20')]+'!');_0x36fc8a[_0xfa80('0x21')]=_0x2fe466[_0x174b9a]['systemuserid'];}}}}if(!_0x17ac8b){logger[_0xfa80('0x1f')]('['+[_0x4dd3b6['toUpperCase']()]+_0xfa80('0x22'));_0x36fc8a[_0xfa80('0x1b')]=_0x405fc1[_0xfa80('0xd')];for(_0x174b9a=0x0;_0x174b9a<_0x2fe466[_0xfa80('0x1c')];_0x174b9a++){if(_0x2fe466[_0x174b9a][_0xfa80('0x1d')]===_0x405fc1[_0xfa80('0xd')]){_0x36fc8a[_0xfa80('0x21')]=_0x2fe466[_0x174b9a][_0xfa80('0x20')];}}}_0x270249(_0x36fc8a);})['catch'](function(_0x2919d3){_0x274273(_0x2919d3[_0xfa80('0x13')]);});});}function createEndUser(_0x3d6e86,_0x1205f2,_0x292d0b,_0x57e5ce,_0x3a588a,_0x398817){return new BPromise(function(_0x3984e8,_0x53dfa6){return getAuthToken(_0x1205f2,_0x292d0b,_0x398817)[_0xfa80('0x10')](function(_0x2664af){var _0x215968=_0x398817[_0xfa80('0x23')]()===_0xfa80('0x24')?_0x3a588a[_0xfa80('0x25')]:_0x3a588a['calleridnum'];var _0x25de0e={'method':_0xfa80('0xb'),'uri':_0x57e5ce+'contacts','body':{'telephone1':_0x215968,'fullname':_0x215968,'firstname':_0x215968,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfa80('0x26')+_0x3d6e86[_0xfa80('0x21')]+')'},'headers':{'Authorization':_0xfa80('0x27')+_0x2664af,'OData-Version':_0xfa80('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x25de0e);})[_0xfa80('0x10')](function(_0x18f784){var _0x171676=_0x18f784[_0xfa80('0x28')][_0xfa80('0x29')];var _0x3eb530=_0x171676[_0xfa80('0x2a')](_0x171676[_0xfa80('0x2b')]('(')+0x1,_0x171676['lastIndexOf'](')'));_0x3d6e86['enduserId']=_0x3eb530;_0x3984e8(_0x3d6e86);})[_0xfa80('0x2c')](function(_0xd7a353){_0x53dfa6(_0xd7a353[_0xfa80('0x13')]);});});}function getEndUser(_0x3b5e0f,_0x4b3627,_0x54e5b7,_0x1f050e,_0x317507,_0x31121d){return new BPromise(function(_0x514284,_0x4d88fa){var _0x19d2fb=_0x31121d[_0xfa80('0x23')]()===_0xfa80('0x24')?_0x317507[_0xfa80('0x25')]:_0x317507['calleridnum'];return getAuthToken(_0x4b3627,_0x54e5b7,_0x31121d)[_0xfa80('0x10')](function(_0x1447b0){var _0x1f891d={'method':_0xfa80('0x14'),'uri':_0x1f050e+_0xfa80('0x2d')+_0x19d2fb[_0xfa80('0x2e')]('+',_0xfa80('0x2f'))+'\x27','headers':{'Authorization':_0xfa80('0x27')+_0x1447b0,'If-None-Match':null,'OData-Version':_0xfa80('0x16')},'json':!![]};return rp(_0x1f891d);})[_0xfa80('0x10')](function(_0x1c1497){var _0x140328=null;if(_0x1c1497){var _0x441439=_0x1c1497['value'];var _0x4475f6=![];for(_0x140328=0x0;_0x140328<_0x441439[_0xfa80('0x1c')];_0x140328++){if(_0x441439[_0x140328]['telephone1']===_0x19d2fb){_0x4475f6=!![];_0x3b5e0f[_0xfa80('0x30')]=_0x441439[_0x140328][_0xfa80('0x31')];}}if(_0x4475f6){_0x514284(_0x3b5e0f);}else{return createEndUser(_0x3b5e0f,_0x4b3627,_0x54e5b7,_0x1f050e,_0x317507,_0x31121d)[_0xfa80('0x10')](function(_0x3b7cc6){logger[_0xfa80('0x1f')]('['+[_0x31121d[_0xfa80('0x12')]()]+']\x20Enduser\x20created!',_0x3b7cc6[_0xfa80('0x30')]);_0x514284(_0x3b7cc6);});}}else{return createEndUser(_0x3b5e0f,_0x4b3627,_0x54e5b7,_0x1f050e,_0x317507,_0x31121d)[_0xfa80('0x10')](function(_0x9ea717){logger['info']('['+[_0x31121d['toUpperCase']()]+_0xfa80('0x32'),_0x9ea717['enduserId']);_0x514284(_0x9ea717);});}});});}function getCustomFields(_0x1a174c,_0x39cff6,_0x3c10c6){var _0x5b9618={};if(_0x1a174c[_0xfa80('0x1c')]>0x0){_[_0xfa80('0x33')](_0x1a174c,function(_0xc7dff4){if(_[_0xfa80('0x34')]([_0xfa80('0x35'),'picklist'],_0xc7dff4[_0xfa80('0x36')])&&_0xc7dff4['nameField']&&!_0xc7dff4[_0xfa80('0x37')]){var _0x18de09=_0xc7dff4['idField']['toLowerCase']();var _0x5a1b02=_0x18de09[_0xfa80('0x2a')](0x0,_0x18de09[_0xfa80('0x38')]('_'));var _0x58397f=_0x18de09[_0xfa80('0x2a')](_0x18de09['indexOf']('_')+0x1);if(_0x5a1b02===_0x3c10c6){_0x5b9618[_0x58397f]=_0xc7dff4[_0xfa80('0x39')];}}});}return _0x5b9618;}function getTicket(_0x297947,_0x4e1cf9,_0x22762e,_0x2b1e20,_0x5dd793,_0x39a3da,_0x231473){return new BPromise(function(_0x3fee60,_0x19d139){var _0x18dd1c;return getAuthToken(_0x4e1cf9,_0x22762e,_0x231473)[_0xfa80('0x10')](function(_0x32e413){if(_0x39a3da['ticketType']===_0xfa80('0x3a')){_0x18dd1c={'method':_0xfa80('0xb'),'uri':_0x2b1e20+_0xfa80('0x3b'),'body':Object[_0xfa80('0x3c')]({},{'title':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3e')],_0x5dd793,'\x20'),'description':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3f')],_0x5dd793,'\x0a'),'customerid_contact@odata.bind':_0xfa80('0x40')+_0x297947['enduserId']+')','ownerid@odata.bind':_0xfa80('0x26')+_0x297947[_0xfa80('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x39a3da[_0xfa80('0x41')],_0x5dd793,_0x39a3da['ticketType'])),'headers':{'Authorization':_0xfa80('0x27')+_0x32e413,'OData-Version':_0xfa80('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x39a3da[_0xfa80('0x42')]===_0xfa80('0x43')){_0x18dd1c={'method':'POST','uri':_0x2b1e20+_0xfa80('0x44'),'body':Object['assign']({},{'subject':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3e')],_0x5dd793,'\x20'),'phonenumber':String(_0x5dd793[_0xfa80('0x45')]),'description':intUtil[_0xfa80('0x3d')](_0x39a3da[_0xfa80('0x3f')],_0x5dd793,'\x0a'),'regardingobjectid_contact@odata.bind':_0xfa80('0x40')+_0x297947['enduserId']+')','ownerid@odata.bind':_0xfa80('0x26')+_0x297947[_0xfa80('0x21')]+')','directioncode':_0x297947['callDirection']===_0xfa80('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xfa80('0x26')+_0x297947[_0xfa80('0x21')]+')','participationtypemask':_0x297947[_0xfa80('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x297947[_0xfa80('0x30')]+')','participationtypemask':_0x297947[_0xfa80('0x47')]===_0xfa80('0x46')?0x1:0x2}]},getCustomFields(_0x39a3da[_0xfa80('0x41')],_0x5dd793,_0x39a3da[_0xfa80('0x42')])),'headers':{'Authorization':_0xfa80('0x27')+_0x32e413,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x18dd1c);})[_0xfa80('0x10')](function(_0x54cbf3){var _0x1a1635=_0x54cbf3[_0xfa80('0x28')][_0xfa80('0x29')];var _0x3970a6=_0x1a1635['substring'](_0x1a1635[_0xfa80('0x2b')]('(')+0x1,_0x1a1635[_0xfa80('0x2b')](')'));_0x297947[_0xfa80('0x48')]=_0x3970a6;_0x3fee60(_0x297947);})[_0xfa80('0x2c')](function(_0x67616e){_0x19d139(_0x67616e[_0xfa80('0x13')]);});});}function emit(_0x2dca40,_0x50ab14,_0x376fa1,_0x207e1a){var _0x3f22e0={'uri':util[_0xfa80('0x49')](_0xfa80('0x4a'),_0x2dca40,_0x376fa1,_0x207e1a)};io['to'](util[_0xfa80('0x49')](_0xfa80('0x4b'),_0x50ab14))[_0xfa80('0x4c')](_0xfa80('0x4d'),_0x3f22e0);}exports['cs']=function(_0x2d188e,_0x16fa44,_0x180548,_0x4fe10c,_0x5a93b7,_0x5c2d98,_0xf13c4d,_0x5169f1){var _0x5877ec={};_0x5c2d98[_0xfa80('0x4e')]=intUtil[_0xfa80('0x4f')](_0x5c2d98[_0xfa80('0x4e')]);_0x5c2d98['serverUrl']=intUtil['stripTrailingSlash'](_0x5c2d98['serverUrl']);_0x5877ec[_0xfa80('0x47')]=_0x5169f1===_0xfa80('0x46')||_0x5169f1==='unmanaged'?_0xfa80('0x46'):_0xfa80('0x24');var _0x11978e=util['format']('%s/api/data/v9.0/',_0x5c2d98[_0xfa80('0x4e')]);var _0x1469a4=util[_0xfa80('0x49')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5c2d98[_0xfa80('0x50')]);var _0x51ddc4=util[_0xfa80('0x49')](_0xfa80('0x51'),_0x5c2d98[_0xfa80('0x52')],_0x16fa44[_0xfa80('0x53')],md5(_0x16fa44[_0xfa80('0x53')]));if(_0x5a93b7&&_0x5a93b7['monitor_format']){logger[_0xfa80('0x1f')]('[QUEUE]',_0xfa80('0x54'));_0x16fa44['recordingURL']=_0x51ddc4;}else if(_0xf13c4d&&_0xf13c4d[_0xfa80('0x55')]&&_0xf13c4d[_0xfa80('0x55')]!=='none'){logger[_0xfa80('0x1f')]('[OUTBOUND]',_0xfa80('0x54'));_0x16fa44['recordingURL']=_0x51ddc4;}else{_0x16fa44[_0xfa80('0x56')]='';}return getUser(_0x5877ec,_0x5c2d98,_0x4fe10c,_0x1469a4,_0x11978e,_0x5169f1)[_0xfa80('0x10')](function(_0x203cd9){logger[_0xfa80('0x1f')]('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x57'),_0x203cd9[_0xfa80('0x21')]);logger['info']('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x58'),_0x203cd9[_0xfa80('0x1b')]);return getEndUser(_0x203cd9,_0x5c2d98,_0x1469a4,_0x11978e,_0x16fa44,_0x5169f1);})[_0xfa80('0x10')](function(_0x26ebcb){logger['info']('['+_0x5169f1['toUpperCase']()+_0xfa80('0x59'),_0x26ebcb[_0xfa80('0x30')]);logger['info']('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x5a'),_0x16fa44[_0xfa80('0x45')]);return getTicket(_0x26ebcb,_0x5c2d98,_0x1469a4,_0x11978e,_0x16fa44,_0x180548,_0x5169f1);})[_0xfa80('0x10')](function(_0x40dd76){logger[_0xfa80('0x1f')](util[_0xfa80('0x49')]('['+_0x5169f1[_0xfa80('0x12')]()+_0xfa80('0x5b'),_0x180548[_0xfa80('0x42')],_0x40dd76['ticketId']));logger[_0xfa80('0x1f')](util[_0xfa80('0x49')]('['+_0x5169f1[_0xfa80('0x12')]()+']\x20Call\x20direction:\x20%s',_0x5169f1));if(_0x5169f1!==_0xfa80('0x5c')){logger['info']('['+_0x5169f1[_0xfa80('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5c2d98['remoteUri'],_0x4fe10c[_0xfa80('0x5d')],_0x180548[_0xfa80('0x42')],_0x40dd76[_0xfa80('0x48')]);}})[_0xfa80('0x2c')](function(_0x1643ed){logger[_0xfa80('0x11')]('['+_0x5169f1[_0xfa80('0x12')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xfa80('0x5e')](_0x1643ed,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc1c0=['phonecall','phonecalls','queue','callDirection','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/logger','../../../../config/environment','defaults','redis','localhost','clientId','username','password','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20created!','includes','string','nameField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields'];(function(_0x200d02,_0x599f3f){var _0x5d8a04=function(_0xd027af){while(--_0xd027af){_0x200d02['push'](_0x200d02['shift']());}};_0x5d8a04(++_0x599f3f);}(_0xc1c0,0x149));var _0x0c1c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1c0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0c1c('0x0'));var BPromise=require(_0x0c1c('0x1'));var rp=require(_0x0c1c('0x2'));var util=require(_0x0c1c('0x3'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x0c1c('0x4'));var logger=require(_0x0c1c('0x5'))('dynamics365');var config=require(_0x0c1c('0x6'));config['redis']=_[_0x0c1c('0x7')](config[_0x0c1c('0x8')],{'host':_0x0c1c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0c1c('0x8')]));function getAuthToken(_0x3caebc,_0x974f1b,_0x236783){var _0x499d50={'method':'POST','uri':_0x974f1b,'form':{'client_id':_0x3caebc[_0x0c1c('0xa')],'resource':_0x3caebc['remoteUri'],'username':_0x3caebc[_0x0c1c('0xb')],'password':_0x3caebc[_0x0c1c('0xc')],'grant_type':'password','client_secret':_0x3caebc['clientSecret']},'json':!![]};return rp(_0x499d50)[_0x0c1c('0xd')](function(_0x2be61a){return _0x2be61a[_0x0c1c('0xe')];})[_0x0c1c('0xf')](function(_0x1fcf15){logger['error']('['+[_0x236783[_0x0c1c('0x10')]()]+_0x0c1c('0x11'));return _0x1fcf15[_0x0c1c('0x12')];});}function getUser(_0x34b55a,_0x4188b8,_0x2849d4,_0x1eace4,_0x58443b,_0x3292d4){return new BPromise(function(_0x2f5bb6,_0x24a5e6){return getAuthToken(_0x4188b8,_0x1eace4,_0x3292d4)['then'](function(_0x58b0ca){var _0x1dcd80={'method':_0x0c1c('0x13'),'uri':_0x58443b+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x0c1c('0x14')+_0x58b0ca,'OData-Version':_0x0c1c('0x15')},'json':!![]};return rp(_0x1dcd80);})[_0x0c1c('0xd')](function(_0x16fb3e){var _0x2f733b=_0x16fb3e[_0x0c1c('0x16')];var _0x1e4548=![];var _0x4d9888=null;if(!_[_0x0c1c('0x17')](_0x2849d4)){if(intUtil[_0x0c1c('0x18')](_0x2849d4[_0x0c1c('0x19')])){_0x34b55a[_0x0c1c('0x1a')]=_0x2849d4[_0x0c1c('0x19')];for(_0x4d9888=0x0;_0x4d9888<_0x2f733b[_0x0c1c('0x1b')];_0x4d9888++){if(_0x2f733b[_0x4d9888][_0x0c1c('0x1c')]===_0x2849d4['email']&&!_0x2f733b[_0x4d9888][_0x0c1c('0x1d')]){_0x1e4548=!![];logger[_0x0c1c('0x1e')]('['+[_0x3292d4[_0x0c1c('0x10')]()]+_0x0c1c('0x1f')+_0x2f733b[_0x4d9888][_0x0c1c('0x20')]+'!');_0x34b55a[_0x0c1c('0x21')]=_0x2f733b[_0x4d9888]['systemuserid'];}}}}if(!_0x1e4548){logger[_0x0c1c('0x1e')]('['+[_0x3292d4[_0x0c1c('0x10')]()]+_0x0c1c('0x22'));_0x34b55a[_0x0c1c('0x1a')]=_0x4188b8['username'];for(_0x4d9888=0x0;_0x4d9888<_0x2f733b['length'];_0x4d9888++){if(_0x2f733b[_0x4d9888][_0x0c1c('0x1c')]===_0x4188b8[_0x0c1c('0xb')]){_0x34b55a[_0x0c1c('0x21')]=_0x2f733b[_0x4d9888][_0x0c1c('0x20')];}}}_0x2f5bb6(_0x34b55a);})['catch'](function(_0x88a362){_0x24a5e6(_0x88a362[_0x0c1c('0x12')]);});});}function createEndUser(_0x19648b,_0x3089d1,_0x561912,_0x41996f,_0x1253a0,_0x58af8f){return new BPromise(function(_0x23648f,_0x4a0754){return getAuthToken(_0x3089d1,_0x561912,_0x58af8f)[_0x0c1c('0xd')](function(_0x477ba1){var _0x2b86c8=_0x58af8f[_0x0c1c('0x23')]()===_0x0c1c('0x24')?_0x1253a0[_0x0c1c('0x25')]:_0x1253a0[_0x0c1c('0x26')];var _0x188d09={'method':_0x0c1c('0x27'),'uri':_0x41996f+_0x0c1c('0x28'),'body':{'telephone1':_0x2b86c8,'fullname':_0x2b86c8,'firstname':_0x2b86c8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x19648b['userId']+')'},'headers':{'Authorization':_0x0c1c('0x14')+_0x477ba1,'OData-Version':_0x0c1c('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x188d09);})[_0x0c1c('0xd')](function(_0x6e370f){var _0x176ac5=_0x6e370f[_0x0c1c('0x29')][_0x0c1c('0x2a')];var _0x53ce75=_0x176ac5[_0x0c1c('0x2b')](_0x176ac5[_0x0c1c('0x2c')]('(')+0x1,_0x176ac5[_0x0c1c('0x2c')](')'));_0x19648b[_0x0c1c('0x2d')]=_0x53ce75;_0x23648f(_0x19648b);})['catch'](function(_0x2b27f1){_0x4a0754(_0x2b27f1[_0x0c1c('0x12')]);});});}function getEndUser(_0xb191c,_0xbb1b7,_0x25350e,_0x38cf8a,_0x222d50,_0x4e9a2e){return new BPromise(function(_0x31bddd,_0x38b2df){var _0x417e5a=_0x4e9a2e['toLowerCase']()===_0x0c1c('0x24')?_0x222d50['destcalleridnum']:_0x222d50[_0x0c1c('0x26')];return getAuthToken(_0xbb1b7,_0x25350e,_0x4e9a2e)[_0x0c1c('0xd')](function(_0x251275){var _0x3a665e={'method':_0x0c1c('0x13'),'uri':_0x38cf8a+_0x0c1c('0x2e')+_0x417e5a[_0x0c1c('0x2f')]('+',_0x0c1c('0x30'))+'\x27','headers':{'Authorization':_0x0c1c('0x14')+_0x251275,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3a665e);})[_0x0c1c('0xd')](function(_0x226166){var _0x38f154=null;if(_0x226166){var _0x534b91=_0x226166[_0x0c1c('0x16')];var _0x4d0ce0=![];for(_0x38f154=0x0;_0x38f154<_0x534b91[_0x0c1c('0x1b')];_0x38f154++){if(_0x534b91[_0x38f154]['telephone1']===_0x417e5a){_0x4d0ce0=!![];_0xb191c[_0x0c1c('0x2d')]=_0x534b91[_0x38f154][_0x0c1c('0x31')];}}if(_0x4d0ce0){_0x31bddd(_0xb191c);}else{return createEndUser(_0xb191c,_0xbb1b7,_0x25350e,_0x38cf8a,_0x222d50,_0x4e9a2e)[_0x0c1c('0xd')](function(_0x1d416b){logger[_0x0c1c('0x1e')]('['+[_0x4e9a2e[_0x0c1c('0x10')]()]+_0x0c1c('0x32'),_0x1d416b['enduserId']);_0x31bddd(_0x1d416b);});}}else{return createEndUser(_0xb191c,_0xbb1b7,_0x25350e,_0x38cf8a,_0x222d50,_0x4e9a2e)[_0x0c1c('0xd')](function(_0x51bf59){logger[_0x0c1c('0x1e')]('['+[_0x4e9a2e[_0x0c1c('0x10')]()]+']\x20Enduser\x20Created!',_0x51bf59[_0x0c1c('0x2d')]);_0x31bddd(_0x51bf59);});}});});}function getCustomFields(_0x96d548,_0x264abc,_0x58c3ec){var _0x3002f4={};if(_0x96d548[_0x0c1c('0x1b')]>0x0){_['forEach'](_0x96d548,function(_0x157aef){if(_[_0x0c1c('0x33')]([_0x0c1c('0x34'),'picklist'],_0x157aef['type'])&&_0x157aef[_0x0c1c('0x35')]&&!_0x157aef['customField']){var _0x4ec69f=_0x157aef[_0x0c1c('0x36')]['toLowerCase']();var _0x5b6865=_0x4ec69f[_0x0c1c('0x2b')](0x0,_0x4ec69f[_0x0c1c('0x37')]('_'));var _0x203b0b=_0x4ec69f[_0x0c1c('0x2b')](_0x4ec69f[_0x0c1c('0x37')]('_')+0x1);if(_0x5b6865===_0x58c3ec){_0x3002f4[_0x203b0b]=_0x157aef[_0x0c1c('0x38')];}}});}return _0x3002f4;}function getTicket(_0x195a2a,_0x4cd7bb,_0x468634,_0x574db2,_0x556047,_0x2c9186,_0x2be8a5){return new BPromise(function(_0x5ec811,_0x3c4223){var _0x4f8395;return getAuthToken(_0x4cd7bb,_0x468634,_0x2be8a5)['then'](function(_0x2df199){if(_0x2c9186[_0x0c1c('0x39')]===_0x0c1c('0x3a')){_0x4f8395={'method':'POST','uri':_0x574db2+_0x0c1c('0x3b'),'body':Object[_0x0c1c('0x3c')]({},{'title':intUtil[_0x0c1c('0x3d')](_0x2c9186[_0x0c1c('0x3e')],_0x556047,'\x20'),'description':intUtil[_0x0c1c('0x3d')](_0x2c9186[_0x0c1c('0x3f')],_0x556047,'\x0a'),'customerid_contact@odata.bind':_0x0c1c('0x40')+_0x195a2a[_0x0c1c('0x2d')]+')','ownerid@odata.bind':_0x0c1c('0x41')+_0x195a2a[_0x0c1c('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x2c9186[_0x0c1c('0x42')],_0x556047,_0x2c9186['ticketType'])),'headers':{'Authorization':_0x0c1c('0x14')+_0x2df199,'OData-Version':_0x0c1c('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2c9186[_0x0c1c('0x39')]===_0x0c1c('0x43')){_0x4f8395={'method':_0x0c1c('0x27'),'uri':_0x574db2+_0x0c1c('0x44'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x2c9186[_0x0c1c('0x3e')],_0x556047,'\x20'),'phonenumber':String(_0x556047[_0x0c1c('0x26')]),'description':intUtil[_0x0c1c('0x3d')](_0x2c9186['Descriptions'],_0x556047,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x195a2a['enduserId']+')','ownerid@odata.bind':_0x0c1c('0x41')+_0x195a2a[_0x0c1c('0x21')]+')','directioncode':_0x195a2a['callDirection']===_0x0c1c('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0c1c('0x41')+_0x195a2a[_0x0c1c('0x21')]+')','participationtypemask':_0x195a2a['callDirection']===_0x0c1c('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x0c1c('0x40')+_0x195a2a[_0x0c1c('0x2d')]+')','participationtypemask':_0x195a2a[_0x0c1c('0x46')]==='queue'?0x1:0x2}]},getCustomFields(_0x2c9186['Fields'],_0x556047,_0x2c9186[_0x0c1c('0x39')])),'headers':{'Authorization':_0x0c1c('0x14')+_0x2df199,'OData-Version':_0x0c1c('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4f8395);})[_0x0c1c('0xd')](function(_0x296dd5){var _0xe49911=_0x296dd5[_0x0c1c('0x29')]['odata-entityid'];var _0x2db38f=_0xe49911['substring'](_0xe49911[_0x0c1c('0x2c')]('(')+0x1,_0xe49911['lastIndexOf'](')'));_0x195a2a[_0x0c1c('0x47')]=_0x2db38f;_0x5ec811(_0x195a2a);})[_0x0c1c('0xf')](function(_0x435652){_0x3c4223(_0x435652[_0x0c1c('0x12')]);});});}function emit(_0xbff418,_0x1dde9c,_0xd4d1f2,_0xaf5a25){var _0x2d1b20={'uri':util[_0x0c1c('0x48')](_0x0c1c('0x49'),_0xbff418,_0xd4d1f2,_0xaf5a25)};io['to'](util[_0x0c1c('0x48')](_0x0c1c('0x4a'),_0x1dde9c))['emit']('trigger:browser:url',_0x2d1b20);}exports['cs']=function(_0x3124cc,_0x2d0eb2,_0x1e74fa,_0x40929f,_0x612e6e,_0x2ff456,_0x44ebaa,_0x384873){var _0x2fe8c7={};_0x2ff456[_0x0c1c('0x4b')]=intUtil[_0x0c1c('0x4c')](_0x2ff456[_0x0c1c('0x4b')]);_0x2ff456[_0x0c1c('0x4d')]=intUtil[_0x0c1c('0x4c')](_0x2ff456[_0x0c1c('0x4d')]);_0x2fe8c7[_0x0c1c('0x46')]=_0x384873===_0x0c1c('0x45')||_0x384873===_0x0c1c('0x4e')?_0x0c1c('0x45'):_0x0c1c('0x24');var _0x1e784e=util[_0x0c1c('0x48')](_0x0c1c('0x4f'),_0x2ff456[_0x0c1c('0x4b')]);var _0x2296ad=util[_0x0c1c('0x48')](_0x0c1c('0x50'),_0x2ff456[_0x0c1c('0x51')]);var _0x566a53=util[_0x0c1c('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ff456['serverUrl'],_0x2d0eb2[_0x0c1c('0x52')],md5(_0x2d0eb2[_0x0c1c('0x52')]));if(_0x612e6e&&_0x612e6e[_0x0c1c('0x53')]){logger[_0x0c1c('0x1e')](_0x0c1c('0x54'),'Recording\x20is\x20enabled!');_0x2d0eb2['recordingURL']=_0x566a53;}else if(_0x44ebaa&&_0x44ebaa[_0x0c1c('0x55')]&&_0x44ebaa[_0x0c1c('0x55')]!==_0x0c1c('0x56')){logger[_0x0c1c('0x1e')]('[OUTBOUND]',_0x0c1c('0x57'));_0x2d0eb2[_0x0c1c('0x58')]=_0x566a53;}else{_0x2d0eb2[_0x0c1c('0x58')]='';}return getUser(_0x2fe8c7,_0x2ff456,_0x40929f,_0x2296ad,_0x1e784e,_0x384873)[_0x0c1c('0xd')](function(_0xd1dc3b){logger[_0x0c1c('0x1e')]('['+_0x384873[_0x0c1c('0x10')]()+_0x0c1c('0x59'),_0xd1dc3b['userId']);logger[_0x0c1c('0x1e')]('['+_0x384873[_0x0c1c('0x10')]()+_0x0c1c('0x5a'),_0xd1dc3b['userEmail']);return getEndUser(_0xd1dc3b,_0x2ff456,_0x2296ad,_0x1e784e,_0x2d0eb2,_0x384873);})['then'](function(_0x113eb2){logger['info']('['+_0x384873[_0x0c1c('0x10')]()+_0x0c1c('0x5b'),_0x113eb2[_0x0c1c('0x2d')]);logger['info']('['+_0x384873[_0x0c1c('0x10')]()+_0x0c1c('0x5c'),_0x2d0eb2['calleridnum']);return getTicket(_0x113eb2,_0x2ff456,_0x2296ad,_0x1e784e,_0x2d0eb2,_0x1e74fa,_0x384873);})[_0x0c1c('0xd')](function(_0x1a9e91){logger[_0x0c1c('0x1e')](util[_0x0c1c('0x48')]('['+_0x384873[_0x0c1c('0x10')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x1e74fa[_0x0c1c('0x39')],_0x1a9e91[_0x0c1c('0x47')]));logger['info'](util['format']('['+_0x384873['toUpperCase']()+_0x0c1c('0x5d'),_0x384873));if(_0x384873!==_0x0c1c('0x4e')){logger[_0x0c1c('0x1e')]('['+_0x384873[_0x0c1c('0x10')]()+']',_0x0c1c('0x5e'));emit(_0x2ff456['remoteUri'],_0x40929f[_0x0c1c('0x5f')],_0x1e74fa[_0x0c1c('0x39')],_0x1a9e91[_0x0c1c('0x47')]);}})[_0x0c1c('0xf')](function(_0x2148aa){logger[_0x0c1c('0x60')]('['+_0x384873[_0x0c1c('0x10')]()+_0x0c1c('0x61'),util[_0x0c1c('0x62')](_0x2148aa,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 2802017..7f9b94b 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 _0x355a=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','idField','customField','content','variable','variableName','push','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Authorization','lastevent','toUpperCase','util','ioredis'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x355a,0xbe));var _0xa355=function(_0x167100,_0x1405ee){_0x167100=_0x167100-0x0;var _0x2114c0=_0x355a[_0x167100];return _0x2114c0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xa355('0x0'));var Redis=require(_0xa355('0x1'));var intUtil=require(_0xa355('0x2'));var config=require(_0xa355('0x3'));var logger=require(_0xa355('0x4'))(_0xa355('0x5'));config[_0xa355('0x6')]=_[_0xa355('0x7')](config[_0xa355('0x6')],{'host':_0xa355('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa355('0x6')]));var headers={'Content-Type':_0xa355('0x9'),'Accept':_0xa355('0x9')};function emit(_0xffb5c,_0x59a79a,_0x3cde45){io['to'](_0xffb5c)[_0xa355('0xa')](_0x59a79a,_0x3cde45);}function getTicket(_0x36b5d3,_0x5817d3,_0x3d27d9,_0x473933,_0x234df8){logger[_0xa355('0xb')]('Creating\x20new\x20ticket...');var _0x510cd5=_[_0xa355('0xc')]({'responder_id':_0x5817d3['id'],'requester_id':_0x3d27d9['id'],'name':util['format'](_0xa355('0xd'),_0x234df8[_0xa355('0xe')]),'phone':_0x234df8[_0xa355('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa355('0x10')](_0x473933[_0xa355('0x11')],_0x234df8,'\x20'),'description':intUtil['getString'](_0x473933[_0xa355('0x12')],_0x234df8,_0xa355('0x13')),'tags':getTags(_0x473933[_0xa355('0x14')],'name')},getCustomFields(_0x473933[_0xa355('0x15')],_0x234df8));_0x510cd5[_0xa355('0x16')]=_[_0xa355('0x17')](_[_0xa355('0x18')](_0x510cd5[_0xa355('0x16')],'id'),'value');return request({'uri':util[_0xa355('0x19')](_0xa355('0x1a'),_0x36b5d3['remoteUri']),'method':_0xa355('0x1b'),'body':_0x510cd5})[_0xa355('0x1c')](function(_0x49851a){logger[_0xa355('0xb')](_0xa355('0x1d'));return _0x49851a;});}function getUser(_0x5460dd,_0x441630){if(intUtil[_0xa355('0x1e')](_0x441630)){return request({'uri':util['format'](_0xa355('0x1f'),_0x5460dd[_0xa355('0x20')]),'qs':{'email':_0x441630}})[_0xa355('0x1c')](function(_0x1cc6c6){if(_0x1cc6c6[_0xa355('0x21')]){logger[_0xa355('0xb')](_0xa355('0x22'));return _[_0xa355('0x23')](_0x1cc6c6,function(_0x5e58fd){return _0x5e58fd[_0xa355('0x24')][_0xa355('0x25')]===_0x441630;});}else{logger['info'](_0xa355('0x26'));return request({'uri':util['format'](_0xa355('0x27'),_0x5460dd[_0xa355('0x20')])})[_0xa355('0x1c')](function(_0x1f37c4){logger['info'](_0xa355('0x28'));return _0x1f37c4;});}});}else{logger[_0xa355('0xb')](_0xa355('0x29'));return request({'uri':util['format'](_0xa355('0x27'),_0x5460dd[_0xa355('0x20')])})[_0xa355('0x1c')](function(_0x3d51d7){logger[_0xa355('0xb')](_0xa355('0x28'));return _0x3d51d7;});}}function getEndUser(_0x43bec8,_0x171338,_0xfc90cd){logger['info'](_0xa355('0x2a'),_0xfc90cd);return request({'uri':util[_0xa355('0x19')](_0xa355('0x2b'),_0x43bec8['remoteUri']),'qs':{'phone':_0xfc90cd}})['then'](function(_0x172256){if(_0x172256[_0xa355('0x21')]){logger[_0xa355('0xb')](_0xa355('0x2c'));return _[_0xa355('0x23')](_0x172256,{'phone':_0xfc90cd});}else{logger[_0xa355('0xb')](_0xa355('0x2d'));return request({'uri':util[_0xa355('0x19')]('%s/api/v2/contacts',_0x43bec8[_0xa355('0x20')]),'method':_0xa355('0x1b'),'body':{'name':_0x171338,'phone':_0xfc90cd}})[_0xa355('0x1c')](function(_0xf505b8){logger['info']('Enduser\x20created.');return _0xf505b8;});}});}function getAuth(_0x3fb641){return util[_0xa355('0x19')]('Basic\x20%s',new Buffer(_0x3fb641[_0xa355('0x2e')]+':X')[_0xa355('0x2f')](_0xa355('0x30')));}function request(_0x48a4a8){logger[_0xa355('0x31')](_0xa355('0x32'),JSON[_0xa355('0x33')](_0x48a4a8));return rp(_['defaults'](_0x48a4a8,{'method':_0xa355('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x5f4008,_0x167a24){var _0xe48647=[];if(_0x5f4008&&_0x5f4008['length']>0x0){_0xe48647=_[_0xa355('0x35')](_0x5f4008,_0x167a24);}return _0xe48647;}function getCustomFields(_0x56dfe6,_0x208dc6){var _0x4b2034=[];var _0x89e6b5={'custom_fields':[]};if(_0x56dfe6[_0xa355('0x21')]>0x0){_[_0xa355('0x36')](_0x56dfe6,function(_0x4844cf){if(_[_0xa355('0x37')]([_0xa355('0x38'),_0xa355('0x39')],_0x4844cf[_0xa355('0x3a')])&&_0x4844cf[_0xa355('0x3b')]&&!_0x4844cf['customField']){_0x89e6b5[_0x4844cf[_0xa355('0x3b')]['toLowerCase']()]=_0x4844cf['content'][_0xa355('0x2f')]();}else if(_[_0xa355('0x37')](['string',_0xa355('0x39')],_0x4844cf[_0xa355('0x3a')])&&_0x4844cf[_0xa355('0x3c')]&&_0x4844cf[_0xa355('0x3d')]){_0x89e6b5['custom_fields']['push']({'id':_0x4844cf[_0xa355('0x3c')],'value':_0x4844cf[_0xa355('0x3e')][_0xa355('0x2f')]()});}else if(_0x4844cf[_0xa355('0x3a')]===_0xa355('0x3f')&&_0x4844cf[_0xa355('0x40')]&&_0x4844cf[_0xa355('0x3c')]&&_0x4844cf[_0xa355('0x3d')]){_0x208dc6[_0x4844cf['variableName']]&&_0x89e6b5[_0xa355('0x16')][_0xa355('0x41')]({'id':_0x4844cf['idField'],'value':_0x208dc6[_0x4844cf[_0xa355('0x40')]][_0xa355('0x2f')]()});}else if(_0x4844cf[_0xa355('0x3a')]===_0xa355('0x42')&&_0x4844cf[_0xa355('0x43')]&&_0x4844cf[_0xa355('0x43')][_0xa355('0x44')]&&_0x4844cf[_0xa355('0x3c')]&&_0x4844cf[_0xa355('0x3d')]){_0x208dc6[_0x4844cf[_0xa355('0x43')][_0xa355('0x44')][_0xa355('0x45')]()]&&_0x89e6b5[_0xa355('0x16')]['push']({'id':_0x4844cf[_0xa355('0x3c')],'value':_0x208dc6[_0x4844cf['Variable'][_0xa355('0x44')]['toLowerCase']()]['toString']()});}});}return _0x89e6b5;}exports[_0xa355('0x46')]=function(_0x274f69,_0x4ca395,_0x224d5c,_0x1abab3,_0x516807,_0x4cfba1){var _0x14a0d9,_0xe83353;_0x4cfba1[_0xa355('0x20')]=intUtil[_0xa355('0x47')](_0x4cfba1['remoteUri']);_0x4cfba1[_0xa355('0x48')]=intUtil[_0xa355('0x47')](_0x4cfba1[_0xa355('0x48')]);if(_0x516807&&_0x516807[_0xa355('0x49')]){logger[_0xa355('0xb')]('[QUEUE]',_0xa355('0x4a'));_0x4ca395['recordingURL']=util['format'](_0xa355('0x4b'),_0x4cfba1['serverUrl'],_0x4ca395['uniqueid'],md5(_0x4ca395[_0xa355('0x4c')]));}else{_0x4ca395['recordingURL']='';}headers['Authorization']=getAuth(_0x4cfba1);return getUser(_0x4cfba1,_0x1abab3[_0xa355('0x25')])['then'](function(_0x174bf4){_0x14a0d9=_0x174bf4;logger['info'](_0xa355('0x4d'),_0x14a0d9['id']);return getEndUser(_0x4cfba1,_0x4ca395[_0xa355('0xe')],_0x4ca395[_0xa355('0xf')]);})[_0xa355('0x1c')](function(_0x11d409){_0xe83353=_0x11d409;logger[_0xa355('0xb')](_0xa355('0x4e'),_0xe83353['id']);return getTicket(_0x4cfba1,_0x14a0d9,_0xe83353,_0x224d5c,_0x4ca395);})[_0xa355('0x1c')](function(_0x55ab92){if(_0x55ab92&&_0x55ab92['id']){logger['info'](_0xa355('0x1d'));logger[_0xa355('0xb')](_0xa355('0x4f'),_0x55ab92['id']);logger[_0xa355('0xb')](_0xa355('0x50'),_0xa355('0x51'));emit(util['format'](_0xa355('0x52'),_0x1abab3[_0xa355('0x44')]),_0xa355('0x53'),{'uri':util[_0xa355('0x19')](_0xa355('0x54'),_0x4cfba1[_0xa355('0x20')],_0x55ab92['id'])});}})[_0xa355('0x55')](function(_0x1bd8bb){logger[_0xa355('0x56')](_0xa355('0x50'),JSON[_0xa355('0x33')](_0x1bd8bb));});};exports['outbound']=function(_0x275aa8,_0x20eebc,_0x2bb774,_0x35b4f9,_0x52792a,_0x24dfb4,_0x17baa6){var _0xce4b6c,_0xc15c66;_0x24dfb4[_0xa355('0x20')]=intUtil[_0xa355('0x47')](_0x24dfb4['remoteUri']);_0x24dfb4[_0xa355('0x48')]=intUtil[_0xa355('0x47')](_0x24dfb4['serverUrl']);if(_0x17baa6&&_0x17baa6[_0xa355('0x57')]&&_0x17baa6[_0xa355('0x57')]!==_0xa355('0x58')){logger[_0xa355('0xb')](_0xa355('0x59'),_0xa355('0x4a'));_0x20eebc[_0xa355('0x5a')]=util[_0xa355('0x19')](_0xa355('0x4b'),_0x24dfb4[_0xa355('0x48')],_0x20eebc[_0xa355('0x4c')],md5(_0x20eebc['uniqueid']));}headers['Authorization']=getAuth(_0x24dfb4);return getUser(_0x24dfb4,_0x35b4f9[_0xa355('0x25')])['then'](function(_0x47303a){_0xce4b6c=_0x47303a;logger[_0xa355('0xb')](_0xa355('0x4d'),_0xce4b6c['id']);return getEndUser(_0x24dfb4,_0x20eebc[_0xa355('0x5b')],_0x20eebc[_0xa355('0x5c')]);})[_0xa355('0x1c')](function(_0x1510d0){_0xc15c66=_0x1510d0;logger[_0xa355('0xb')](_0xa355('0x4e'),_0xc15c66['id']);return getTicket(_0x24dfb4,_0xce4b6c,_0xc15c66,_0x2bb774,_0x20eebc);})[_0xa355('0x1c')](function(_0x573eaf){if(_0x573eaf&&_0x573eaf['id']){logger[_0xa355('0xb')](_0xa355('0x1d'));logger['info'](_0xa355('0x4f'),_0x573eaf['id']);logger[_0xa355('0xb')](_0xa355('0x59'),_0xa355('0x51'));emit(util['format']('user:%s',_0x35b4f9[_0xa355('0x44')]),'trigger:browser:url',{'uri':util[_0xa355('0x19')](_0xa355('0x54'),_0x24dfb4[_0xa355('0x20')],_0x573eaf['id'])});}})[_0xa355('0x55')](function(_0x25c0b6){logger[_0xa355('0x56')](_0xa355('0x59'),JSON[_0xa355('0x33')](_0x25c0b6));});};exports['unmanaged']=function(_0x495738,_0x442b56,_0x541c42,_0x2f07bc,_0x3e29c6,_0x42326c){var _0x2e56e3,_0x22b403;_0x42326c['remoteUri']=intUtil[_0xa355('0x47')](_0x42326c['remoteUri']);_0x42326c[_0xa355('0x48')]=intUtil['stripTrailingSlash'](_0x42326c[_0xa355('0x48')]);if(_0x3e29c6&&_0x3e29c6[_0xa355('0x49')]){logger[_0xa355('0xb')]('['+_0x442b56['lastevent']['toUpperCase']()+']',_0xa355('0x4a'));_0x442b56[_0xa355('0x5a')]=util[_0xa355('0x19')](_0xa355('0x4b'),_0x42326c[_0xa355('0x48')],_0x442b56[_0xa355('0x4c')],md5(_0x442b56[_0xa355('0x4c')]));}else{_0x442b56['recordingURL']='';}headers[_0xa355('0x5d')]=getAuth(_0x42326c);return getUser(_0x42326c,'')['then'](function(_0x5d4da8){_0x2e56e3=_0x5d4da8;logger[_0xa355('0xb')](_0xa355('0x4d'),_0x2e56e3['id']);return getEndUser(_0x42326c,_0x442b56[_0xa355('0xe')],_0x442b56[_0xa355('0xf')]);})[_0xa355('0x1c')](function(_0x5b7c6e){_0x22b403=_0x5b7c6e;logger[_0xa355('0xb')](_0xa355('0x4e'),_0x22b403['id']);return getTicket(_0x42326c,_0x2e56e3,_0x22b403,_0x541c42,_0x442b56);})['then'](function(_0xea6c95){if(_0xea6c95){logger[_0xa355('0xb')]('Ticket\x20created!');logger[_0xa355('0xb')]('The\x20Ticket\x20ID\x20is:',_0xea6c95['id']);}})[_0xa355('0x55')](function(_0x3785e4){logger[_0xa355('0x56')]('['+_0x442b56[_0xa355('0x5e')][_0xa355('0x5f')]()+']',JSON['stringify'](_0x3785e4));});}; \ No newline at end of file +var _0xaa8f=['%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','type','customField','nameField','toLowerCase','content','idField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','unmanaged','monitor_format','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','validateEmail','%s/api/v2/agents','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0xe14a9a,_0x234408){var _0x42f012=function(_0x1f96fb){while(--_0x1f96fb){_0xe14a9a['push'](_0xe14a9a['shift']());}};_0x42f012(++_0x234408);}(_0xaa8f,0x98));var _0xfaa8=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xaa8f[_0x152fe3];return _0xc5bb39;};'use strict';var _=require(_0xfaa8('0x0'));var rp=require('request-promise');var md5=require(_0xfaa8('0x1'));var util=require('util');var Redis=require(_0xfaa8('0x2'));var intUtil=require(_0xfaa8('0x3'));var config=require(_0xfaa8('0x4'));var logger=require(_0xfaa8('0x5'))(_0xfaa8('0x6'));config[_0xfaa8('0x7')]=_[_0xfaa8('0x8')](config['redis'],{'host':_0xfaa8('0x9'),'port':0x18eb});var io=require(_0xfaa8('0xa'))(new Redis(config[_0xfaa8('0x7')]));var headers={'Content-Type':_0xfaa8('0xb'),'Accept':_0xfaa8('0xb')};function emit(_0x4f95b3,_0x10b872,_0x250f6d){io['to'](_0x4f95b3)[_0xfaa8('0xc')](_0x10b872,_0x250f6d);}function getTicket(_0x5b0c98,_0x30cc98,_0xa76ba6,_0x5a566c,_0xbb9497){logger[_0xfaa8('0xd')](_0xfaa8('0xe'));var _0x236091=_[_0xfaa8('0xf')]({'responder_id':_0x30cc98['id'],'requester_id':_0xa76ba6['id'],'name':util[_0xfaa8('0x10')](_0xfaa8('0x11'),_0xbb9497[_0xfaa8('0x12')]),'phone':_0xbb9497[_0xfaa8('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5a566c[_0xfaa8('0x14')],_0xbb9497,'\x20'),'description':intUtil[_0xfaa8('0x15')](_0x5a566c[_0xfaa8('0x16')],_0xbb9497,_0xfaa8('0x17')),'tags':getTags(_0x5a566c[_0xfaa8('0x18')],_0xfaa8('0x19'))},getCustomFields(_0x5a566c[_0xfaa8('0x1a')],_0xbb9497));_0x236091[_0xfaa8('0x1b')]=_[_0xfaa8('0x1c')](_[_0xfaa8('0x1d')](_0x236091[_0xfaa8('0x1b')],'id'),_0xfaa8('0x1e'));return request({'uri':util[_0xfaa8('0x10')](_0xfaa8('0x1f'),_0x5b0c98[_0xfaa8('0x20')]),'method':'POST','body':_0x236091})[_0xfaa8('0x21')](function(_0x56831e){logger[_0xfaa8('0xd')]('Ticket\x20created!');return _0x56831e;});}function getUser(_0x573dd7,_0xc6c715){if(intUtil[_0xfaa8('0x22')](_0xc6c715)){return request({'uri':util[_0xfaa8('0x10')](_0xfaa8('0x23'),_0x573dd7['remoteUri']),'qs':{'email':_0xc6c715}})['then'](function(_0x300c24){if(_0x300c24['length']){logger['info'](_0xfaa8('0x24'));return _[_0xfaa8('0x25')](_0x300c24,function(_0x54bc90){return _0x54bc90['contact'][_0xfaa8('0x26')]===_0xc6c715;});}else{logger[_0xfaa8('0xd')](_0xfaa8('0x27'));return request({'uri':util[_0xfaa8('0x10')](_0xfaa8('0x28'),_0x573dd7[_0xfaa8('0x20')])})['then'](function(_0x1f0412){logger[_0xfaa8('0xd')]('Admin\x20account\x20selected.');return _0x1f0412;});}});}else{logger[_0xfaa8('0xd')](_0xfaa8('0x29'));return request({'uri':util[_0xfaa8('0x10')](_0xfaa8('0x28'),_0x573dd7[_0xfaa8('0x20')])})[_0xfaa8('0x21')](function(_0x373247){logger[_0xfaa8('0xd')](_0xfaa8('0x2a'));return _0x373247;});}}function getEndUser(_0x52e63d,_0x8a0e97,_0x2bf064){logger['info'](_0xfaa8('0x2b'),_0x2bf064);return request({'uri':util['format'](_0xfaa8('0x2c'),_0x52e63d[_0xfaa8('0x20')]),'qs':{'phone':_0x2bf064}})[_0xfaa8('0x21')](function(_0x4fb239){if(_0x4fb239[_0xfaa8('0x2d')]){logger['info']('Enduser\x20found!');return _[_0xfaa8('0x25')](_0x4fb239,{'phone':_0x2bf064});}else{logger[_0xfaa8('0xd')](_0xfaa8('0x2e'));return request({'uri':util[_0xfaa8('0x10')]('%s/api/v2/contacts',_0x52e63d[_0xfaa8('0x20')]),'method':'POST','body':{'name':_0x8a0e97,'phone':_0x2bf064}})['then'](function(_0x46dd9a){logger['info']('Enduser\x20created.');return _0x46dd9a;});}});}function getAuth(_0x255d32){return util[_0xfaa8('0x10')](_0xfaa8('0x2f'),new Buffer(_0x255d32[_0xfaa8('0x30')]+':X')[_0xfaa8('0x31')](_0xfaa8('0x32')));}function request(_0x12478e){logger[_0xfaa8('0x33')](_0xfaa8('0x34'),JSON[_0xfaa8('0x35')](_0x12478e));return rp(_['defaults'](_0x12478e,{'method':_0xfaa8('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x221ed6,_0x3d9029){var _0x3f6161=[];if(_0x221ed6&&_0x221ed6[_0xfaa8('0x2d')]>0x0){_0x3f6161=_[_0xfaa8('0x37')](_0x221ed6,_0x3d9029);}return _0x3f6161;}function getCustomFields(_0x2e51a5,_0x451df7){var _0xab1935=[];var _0xd82893={'custom_fields':[]};if(_0x2e51a5[_0xfaa8('0x2d')]>0x0){_['forEach'](_0x2e51a5,function(_0xee7a55){if(_[_0xfaa8('0x38')]([_0xfaa8('0x39'),'picklist'],_0xee7a55[_0xfaa8('0x3a')])&&_0xee7a55['nameField']&&!_0xee7a55[_0xfaa8('0x3b')]){_0xd82893[_0xee7a55[_0xfaa8('0x3c')][_0xfaa8('0x3d')]()]=_0xee7a55[_0xfaa8('0x3e')][_0xfaa8('0x31')]();}else if(_[_0xfaa8('0x38')]([_0xfaa8('0x39'),'picklist'],_0xee7a55['type'])&&_0xee7a55[_0xfaa8('0x3f')]&&_0xee7a55[_0xfaa8('0x3b')]){_0xd82893[_0xfaa8('0x1b')][_0xfaa8('0x40')]({'id':_0xee7a55[_0xfaa8('0x3f')],'value':_0xee7a55['content'][_0xfaa8('0x31')]()});}else if(_0xee7a55[_0xfaa8('0x3a')]==='variable'&&_0xee7a55['variableName']&&_0xee7a55[_0xfaa8('0x3f')]&&_0xee7a55[_0xfaa8('0x3b')]){_0x451df7[_0xee7a55[_0xfaa8('0x41')]]&&_0xd82893[_0xfaa8('0x1b')][_0xfaa8('0x40')]({'id':_0xee7a55[_0xfaa8('0x3f')],'value':_0x451df7[_0xee7a55['variableName']][_0xfaa8('0x31')]()});}else if(_0xee7a55[_0xfaa8('0x3a')]===_0xfaa8('0x42')&&_0xee7a55['Variable']&&_0xee7a55[_0xfaa8('0x43')][_0xfaa8('0x19')]&&_0xee7a55[_0xfaa8('0x3f')]&&_0xee7a55[_0xfaa8('0x3b')]){_0x451df7[_0xee7a55[_0xfaa8('0x43')][_0xfaa8('0x19')][_0xfaa8('0x3d')]()]&&_0xd82893['custom_fields'][_0xfaa8('0x40')]({'id':_0xee7a55[_0xfaa8('0x3f')],'value':_0x451df7[_0xee7a55['Variable'][_0xfaa8('0x19')]['toLowerCase']()]['toString']()});}});}return _0xd82893;}exports[_0xfaa8('0x44')]=function(_0x4fb6f3,_0x1ad5da,_0x5551e3,_0x2549c0,_0x4bef16,_0x11d240){var _0x37e416,_0x5449d7;_0x11d240[_0xfaa8('0x20')]=intUtil[_0xfaa8('0x45')](_0x11d240[_0xfaa8('0x20')]);_0x11d240[_0xfaa8('0x46')]=intUtil[_0xfaa8('0x45')](_0x11d240[_0xfaa8('0x46')]);if(_0x4bef16&&_0x4bef16['monitor_format']){logger[_0xfaa8('0xd')](_0xfaa8('0x47'),_0xfaa8('0x48'));_0x1ad5da['recordingURL']=util['format'](_0xfaa8('0x49'),_0x11d240['serverUrl'],_0x1ad5da['uniqueid'],md5(_0x1ad5da[_0xfaa8('0x4a')]));}else{_0x1ad5da[_0xfaa8('0x4b')]='';}headers[_0xfaa8('0x4c')]=getAuth(_0x11d240);return getUser(_0x11d240,_0x2549c0[_0xfaa8('0x26')])['then'](function(_0x6dfed2){_0x37e416=_0x6dfed2;logger[_0xfaa8('0xd')](_0xfaa8('0x4d'),_0x37e416['id']);return getEndUser(_0x11d240,_0x1ad5da['calleridname'],_0x1ad5da[_0xfaa8('0x13')]);})['then'](function(_0x3df45e){_0x5449d7=_0x3df45e;logger[_0xfaa8('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5449d7['id']);return getTicket(_0x11d240,_0x37e416,_0x5449d7,_0x5551e3,_0x1ad5da);})['then'](function(_0x1f7b5e){if(_0x1f7b5e&&_0x1f7b5e['id']){logger[_0xfaa8('0xd')](_0xfaa8('0x4e'));logger[_0xfaa8('0xd')](_0xfaa8('0x4f'),_0x1f7b5e['id']);logger[_0xfaa8('0xd')](_0xfaa8('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfaa8('0x10')](_0xfaa8('0x50'),_0x2549c0[_0xfaa8('0x19')]),'trigger:browser:url',{'uri':util[_0xfaa8('0x10')](_0xfaa8('0x51'),_0x11d240[_0xfaa8('0x20')],_0x1f7b5e['id'])});}})['catch'](function(_0x30d050){logger[_0xfaa8('0x52')](_0xfaa8('0x47'),JSON[_0xfaa8('0x35')](_0x30d050));});};exports[_0xfaa8('0x53')]=function(_0x365890,_0x57873d,_0x347a2d,_0x4d4450,_0x167447,_0x92424,_0x2f10a4){var _0x49cc11,_0x5d5d34;_0x92424[_0xfaa8('0x20')]=intUtil[_0xfaa8('0x45')](_0x92424[_0xfaa8('0x20')]);_0x92424[_0xfaa8('0x46')]=intUtil[_0xfaa8('0x45')](_0x92424['serverUrl']);if(_0x2f10a4&&_0x2f10a4['recordingFormat']&&_0x2f10a4[_0xfaa8('0x54')]!==_0xfaa8('0x55')){logger['info'](_0xfaa8('0x56'),_0xfaa8('0x48'));_0x57873d[_0xfaa8('0x4b')]=util['format'](_0xfaa8('0x49'),_0x92424[_0xfaa8('0x46')],_0x57873d[_0xfaa8('0x4a')],md5(_0x57873d[_0xfaa8('0x4a')]));}headers[_0xfaa8('0x4c')]=getAuth(_0x92424);return getUser(_0x92424,_0x4d4450[_0xfaa8('0x26')])[_0xfaa8('0x21')](function(_0x54b7d3){_0x49cc11=_0x54b7d3;logger[_0xfaa8('0xd')](_0xfaa8('0x4d'),_0x49cc11['id']);return getEndUser(_0x92424,_0x57873d[_0xfaa8('0x57')],_0x57873d['destcalleridnum']);})[_0xfaa8('0x21')](function(_0x4971ee){_0x5d5d34=_0x4971ee;logger[_0xfaa8('0xd')](_0xfaa8('0x58'),_0x5d5d34['id']);return getTicket(_0x92424,_0x49cc11,_0x5d5d34,_0x347a2d,_0x57873d);})[_0xfaa8('0x21')](function(_0x50ab15){if(_0x50ab15&&_0x50ab15['id']){logger['info'](_0xfaa8('0x4e'));logger[_0xfaa8('0xd')]('The\x20Ticket\x20ID\x20is:',_0x50ab15['id']);logger[_0xfaa8('0xd')](_0xfaa8('0x56'),_0xfaa8('0x59'));emit(util[_0xfaa8('0x10')](_0xfaa8('0x50'),_0x4d4450['name']),_0xfaa8('0x5a'),{'uri':util[_0xfaa8('0x10')](_0xfaa8('0x51'),_0x92424[_0xfaa8('0x20')],_0x50ab15['id'])});}})[_0xfaa8('0x5b')](function(_0x3461df){logger['error'](_0xfaa8('0x56'),JSON[_0xfaa8('0x35')](_0x3461df));});};exports[_0xfaa8('0x5c')]=function(_0x19dca0,_0x10d5fc,_0x5aa0fa,_0x1a60f8,_0x39f6e4,_0x39ad05){var _0x285a9f,_0x3492f7;_0x39ad05[_0xfaa8('0x20')]=intUtil['stripTrailingSlash'](_0x39ad05['remoteUri']);_0x39ad05[_0xfaa8('0x46')]=intUtil[_0xfaa8('0x45')](_0x39ad05['serverUrl']);if(_0x39f6e4&&_0x39f6e4[_0xfaa8('0x5d')]){logger[_0xfaa8('0xd')]('['+_0x10d5fc[_0xfaa8('0x5e')][_0xfaa8('0x5f')]()+']','Recording\x20is\x20enabled!');_0x10d5fc['recordingURL']=util[_0xfaa8('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39ad05[_0xfaa8('0x46')],_0x10d5fc[_0xfaa8('0x4a')],md5(_0x10d5fc[_0xfaa8('0x4a')]));}else{_0x10d5fc[_0xfaa8('0x4b')]='';}headers[_0xfaa8('0x4c')]=getAuth(_0x39ad05);return getUser(_0x39ad05,'')['then'](function(_0x7bba42){_0x285a9f=_0x7bba42;logger['info']('The\x20User\x20ID\x20is:',_0x285a9f['id']);return getEndUser(_0x39ad05,_0x10d5fc[_0xfaa8('0x12')],_0x10d5fc['calleridnum']);})[_0xfaa8('0x21')](function(_0x2400c7){_0x3492f7=_0x2400c7;logger['info'](_0xfaa8('0x58'),_0x3492f7['id']);return getTicket(_0x39ad05,_0x285a9f,_0x3492f7,_0x5aa0fa,_0x10d5fc);})['then'](function(_0x2cadeb){if(_0x2cadeb){logger[_0xfaa8('0xd')](_0xfaa8('0x4e'));logger[_0xfaa8('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2cadeb['id']);}})[_0xfaa8('0x5b')](function(_0x5d8fe2){logger[_0xfaa8('0x52')]('['+_0x10d5fc[_0xfaa8('0x5e')][_0xfaa8('0x5f')]()+']',JSON[_0xfaa8('0x35')](_0x5d8fe2));});}; \ 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 f73ae27..29f336f 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 _0xc8d1=['Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','/api/tasks','getString','Subjects','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','then','Getting\x20user\x20with\x20email','agentEmail','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&entities=contact','find','contacts','format'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xc8d1,0x11f));var _0x1c8d=function(_0x11ee99,_0xa743ed){_0x11ee99=_0x11ee99-0x0;var _0x469072=_0xc8d1[_0x11ee99];return _0x469072;};'use strict';var _=require(_0x1c8d('0x0'));var rp=require('request-promise');var md5=require(_0x1c8d('0x1'));var util=require(_0x1c8d('0x2'));var moment=require(_0x1c8d('0x3'));var Promise=require(_0x1c8d('0x4'));var Redis=require('ioredis');var intUtil=require(_0x1c8d('0x5'));var config=require(_0x1c8d('0x6'));var logger=require(_0x1c8d('0x7'))('freshsales');config[_0x1c8d('0x8')]=_[_0x1c8d('0x9')](config[_0x1c8d('0x8')],{'host':_0x1c8d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1c8d('0x8')]));function getAdminId(_0x58db67,_0x2004ed,_0x6933c4,_0x4d0308){return new Promise(function(_0xffd704,_0x60ec0a){var _0x541962=![];var _0x57cb67={'method':_0x1c8d('0xb'),'uri':_0x4d0308+_0x1c8d('0xc'),'json':!![]};_0x57cb67[_0x1c8d('0xd')]=_0x6933c4;logger[_0x1c8d('0xe')](_0x1c8d('0xf'));return rp(_0x57cb67)['then'](function(_0x42d3b9){if(_0x42d3b9){var _0x32da8b=_0x42d3b9['users'];var _0xe7aaf6=null;for(_0xe7aaf6=0x0;_0xe7aaf6<_0x32da8b[_0x1c8d('0x10')];_0xe7aaf6++){if(_0x32da8b[_0xe7aaf6]['email']===_0x58db67[_0x1c8d('0x11')]){_0x58db67[_0x1c8d('0x12')]=_0x32da8b[_0xe7aaf6]['id'];_0x541962=!![];}}if(_0x541962){logger[_0x1c8d('0xe')](_0x1c8d('0x13'),_0x58db67[_0x1c8d('0x12')]);_0xffd704(_0x58db67);}else{_0x60ec0a({'statusCode':0x194,'message':_0x1c8d('0x14')});}}else{_0x60ec0a({'statusCode':0x194,'message':_0x1c8d('0x14')});}})[_0x1c8d('0x15')](function(_0x79e42){logger[_0x1c8d('0x16')]('['+[_0x2004ed[_0x1c8d('0x17')]()]+']',_0x79e42[_0x1c8d('0x18')]);_0x60ec0a(_0x79e42);});});}function getUser(_0x3ac010,_0x48a0f9,_0x1ed524){return function(_0x2dceb1){return new Promise(function(_0xb3ffe0,_0x61bab){var _0x13c1d8={'method':_0x1c8d('0xb'),'uri':_0x1ed524+_0x1c8d('0xc'),'json':!![]};_0x13c1d8[_0x1c8d('0xd')]=_0x48a0f9;logger[_0x1c8d('0xe')]('Getting\x20user\x20list');return rp(_0x13c1d8)[_0x1c8d('0x19')](function(_0x41d005){if(_0x41d005){var _0x400bdd=_0x41d005['users'];var _0x35b228=![];var _0x480d68=null;if(_0x2dceb1['agentEmail']!==null){logger['info'](_0x1c8d('0x1a'),_0x2dceb1[_0x1c8d('0x1b')]);_0x2dceb1['userEmail']=_0x2dceb1['agentEmail'];for(_0x480d68=0x0;_0x480d68<_0x400bdd[_0x1c8d('0x10')];_0x480d68++){if(_0x400bdd[_0x480d68][_0x1c8d('0x1c')]===_0x2dceb1[_0x1c8d('0x1b')]){_0x35b228=!![];_0x2dceb1[_0x1c8d('0x1d')]=_0x400bdd[_0x480d68]['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x1e'),_0x2dceb1[_0x1c8d('0x1d')]);}}}if(!_0x35b228){logger['info'](_0x1c8d('0x1f'));_0x2dceb1['userEmail']=_0x2dceb1['adminEmail'];_0x2dceb1[_0x1c8d('0x1d')]=_0x2dceb1[_0x1c8d('0x12')];_0x35b228=!![];}if(_0x35b228){_0xb3ffe0(_0x2dceb1);}else{_0x61bab({'statusCode':0x194,'message':_0x1c8d('0x14')});}}else{_0x61bab({'statusCode':0x194,'message':_0x1c8d('0x14')});}})[_0x1c8d('0x15')](function(_0x2185e8){logger[_0x1c8d('0x16')]('['+[_0x3ac010[_0x1c8d('0x17')]()]+']',_0x2185e8[_0x1c8d('0x18')]);_0x61bab(_0x2185e8);});});};}function searchContact(_0x543b3a,_0x1804e4,_0xa5ba76,_0xcafe13){return new Promise(function(_0x127e14,_0x652e3f){var _0x1d44a0={'method':_0x1c8d('0xb'),'headers':_0x1804e4,'uri':_0x543b3a+_0x1c8d('0x20')+_0xcafe13+'&f='+_0xa5ba76+_0x1c8d('0x21'),'json':!![]};rp(_0x1d44a0)['then'](function(_0x13c933){var _0x98dd99=_[_0x1c8d('0x22')](_0x13c933[_0x1c8d('0x23')]['contacts'],[_0xa5ba76,_0xcafe13]);_0x127e14(_0x98dd99);})[_0x1c8d('0x15')](function(_0x47045b){_0x652e3f(_0x47045b);});});}function getEndUser(_0x3c97d3,_0x2b45a0,_0x42e830){return function(_0x83e3d7){return new Promise(function(_0x579a50,_0x5e446a){logger[_0x1c8d('0xe')](util[_0x1c8d('0x24')](_0x1c8d('0x25'),_0x83e3d7['contactNumber']));searchContact(_0x42e830,_0x2b45a0,_0x1c8d('0x26'),_0x83e3d7['contactNumber'])[_0x1c8d('0x19')](function(_0x92e3b3){if(_0x92e3b3){_0x83e3d7[_0x1c8d('0x27')]=_0x92e3b3['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x28'),_0x83e3d7[_0x1c8d('0x27')]);return _0x579a50(_0x83e3d7);}searchContact(_0x42e830,_0x2b45a0,_0x1c8d('0x29'),_0x83e3d7[_0x1c8d('0x2a')])[_0x1c8d('0x19')](function(_0xb137ed){if(_0xb137ed){_0x83e3d7[_0x1c8d('0x27')]=_0xb137ed['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x2b'),_0x83e3d7[_0x1c8d('0x27')]);return _0x579a50(_0x83e3d7);}createEndUser(_0x83e3d7,_0x3c97d3,_0x2b45a0,_0x42e830)['then'](function(_0xc6690a){logger[_0x1c8d('0xe')](_0x1c8d('0x2c'),_0xc6690a[_0x1c8d('0x27')]);return _0x579a50(_0xc6690a);});});})['catch'](function(_0x81b0c5){_0x5e446a(_0x81b0c5);});});};}function createEndUser(_0x4954c1,_0x203c3a,_0xb1c0c4,_0x433409){return new Promise(function(_0x32dd93,_0x3fd130){var _0x5906b2=moment();var _0x3b7f18={'method':_0x1c8d('0x2d'),'uri':_0x433409+_0x1c8d('0x2e'),'body':{'contact':{'last_name':_0x4954c1[_0x1c8d('0x2a')],'work_number':_0x4954c1[_0x1c8d('0x2a')],'mobile_number':_0x4954c1[_0x1c8d('0x2a')],'owner_id':_0x4954c1[_0x1c8d('0x1d')],'created_at':_0x5906b2['format'](_0x1c8d('0x2f'))}},'json':!![]};_0x3b7f18[_0x1c8d('0xd')]=_0xb1c0c4;logger[_0x1c8d('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3b7f18)[_0x1c8d('0x19')](function(_0x23dc58){_0x4954c1['endUserId']=_0x23dc58['contact']['id'];_0x32dd93(_0x4954c1);})['catch'](function(_0x30536e){logger[_0x1c8d('0x16')]('['+[_0x203c3a[_0x1c8d('0x17')]()]+']',_0x30536e[_0x1c8d('0x18')]);_0x3fd130(_0x30536e[_0x1c8d('0x18')]);});});}function getTicket(_0x4cd0d2,_0x38c652,_0x333f4f,_0x434caf,_0x1c79b4){return function(_0x1216e9){logger[_0x1c8d('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x5e0d53,_0x23e2cf){var _0x5ecc85=moment();var _0x4381ab={'method':_0x1c8d('0x2d'),'uri':_0x333f4f+_0x1c8d('0x30'),'body':{'title':intUtil[_0x1c8d('0x31')](_0x434caf[_0x1c8d('0x32')],_0x1c79b4,'\x20'),'description':intUtil[_0x1c8d('0x31')](_0x434caf['Descriptions'],_0x1c79b4,'\x0a'),'owner_id':_0x1216e9[_0x1c8d('0x1d')],'creater_id':_0x1216e9[_0x1c8d('0x12')],'targetable_id':_0x1216e9['endUserId'],'targetable_type':'Contact','created_at':_0x5ecc85[_0x1c8d('0x24')](_0x1c8d('0x2f')),'due_date':_0x5ecc85[_0x1c8d('0x33')](0x1e,'m')[_0x1c8d('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x4381ab[_0x1c8d('0xd')]=_0x38c652;return rp(_0x4381ab)['then'](function(_0x2bcbdc){_0x1216e9[_0x1c8d('0x34')]=_0x2bcbdc[_0x1c8d('0x35')]['id'];logger[_0x1c8d('0xe')](_0x1c8d('0x36'),_0x1216e9[_0x1c8d('0x34')]);_0x5e0d53(_0x1216e9);})[_0x1c8d('0x15')](function(_0x10cc58){logger[_0x1c8d('0x16')]('['+[_0x4cd0d2['toUpperCase']()]+']',_0x10cc58[_0x1c8d('0x18')]);_0x23e2cf(_0x10cc58[_0x1c8d('0x18')]);});});};}function emit(_0x39c66a,_0x361c1c,_0x36daa3){var _0xa23d6e={'uri':_0x39c66a+_0x1c8d('0x37')+_0x36daa3};io['to'](util[_0x1c8d('0x24')](_0x1c8d('0x38'),_0x361c1c))['emit'](_0x1c8d('0x39'),_0xa23d6e);}exports['cs']=function(_0x167283,_0x39b89,_0x1d954c,_0xcea3d4,_0x5e7147,_0x3a2ccd,_0x181e4a,_0x428ff2){var _0x5487ea={};var _0x5afc24={'Authorization':_0x1c8d('0x3a')+_0x3a2ccd[_0x1c8d('0x3b')]};_0x3a2ccd[_0x1c8d('0x3c')]=intUtil[_0x1c8d('0x3d')](_0x3a2ccd[_0x1c8d('0x3c')]);_0x3a2ccd['serverUrl']=intUtil[_0x1c8d('0x3d')](_0x3a2ccd[_0x1c8d('0x3e')]);var _0x27e1ce=_0x3a2ccd[_0x1c8d('0x3c')];_0x5487ea['adminEmail']=_0x3a2ccd[_0x1c8d('0x3f')];_0x5487ea[_0x1c8d('0x2a')]=_0x428ff2['toLowerCase']()===_0x1c8d('0x40')?_0x39b89[_0x1c8d('0x41')]:_0x39b89[_0x1c8d('0x42')];_0x5487ea[_0x1c8d('0x43')]=_0x428ff2==='queue'||_0x428ff2==='unmanaged'?'queue':'outbound';if(_0xcea3d4){_0x5487ea[_0x1c8d('0x1b')]=_0xcea3d4[_0x1c8d('0x1c')];}var _0x34e406=util['format'](_0x1c8d('0x44'),_0x3a2ccd['serverUrl'],_0x39b89[_0x1c8d('0x45')],md5(_0x39b89[_0x1c8d('0x45')]));if(_0x5e7147&&_0x5e7147[_0x1c8d('0x46')]){logger['info'](_0x1c8d('0x47'),'Recording\x20is\x20enabled!');_0x39b89['recordingURL']=_0x34e406;}else if(_0x181e4a&&_0x181e4a['recordingFormat']&&_0x181e4a['recordingFormat']!==_0x1c8d('0x48')){logger['info'](_0x1c8d('0x49'),_0x1c8d('0x4a'));_0x39b89['recordingURL']=_0x34e406;}else{_0x39b89['recordingURL']='';}return getAdminId(_0x5487ea,_0x428ff2,_0x5afc24,_0x27e1ce)[_0x1c8d('0x19')](getUser(_0x428ff2,_0x5afc24,_0x27e1ce))['then'](getEndUser(_0x428ff2,_0x5afc24,_0x27e1ce))[_0x1c8d('0x19')](getTicket(_0x428ff2,_0x5afc24,_0x27e1ce,_0x1d954c,_0x39b89))[_0x1c8d('0x19')](function(_0x363c64){logger[_0x1c8d('0xe')](util['format'](_0x1c8d('0x4b'),_0x363c64[_0x1c8d('0x34')]));if(_0x428ff2!==_0x1c8d('0x4c')){logger['info']('['+[_0x428ff2[_0x1c8d('0x17')]()]+']',_0x1c8d('0x4d'));emit(_0x27e1ce,_0xcea3d4[_0x1c8d('0x4e')],_0x363c64['endUserId']);}})[_0x1c8d('0x15')](function(_0x5b2bfe){logger[_0x1c8d('0x16')]('['+[_0x428ff2[_0x1c8d('0x17')]()]+_0x1c8d('0x4f'),util[_0x1c8d('0x50')](_0x5b2bfe,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa4b1=['calleridnum','callDirection','queue','unmanaged','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','defaults','redis','socket.io-emitter','/api/selector/owners','headers','info','then','users','length','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','agentEmail','userEmail','Admin\x20selected','adminEmail','userId','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','ticketId','task','/contacts/','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum'];(function(_0x51f1b0,_0x24caae){var _0x1f6f65=function(_0x34e672){while(--_0x34e672){_0x51f1b0['push'](_0x51f1b0['shift']());}};_0x1f6f65(++_0x24caae);}(_0xa4b1,0x151));var _0x1a4b=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xa4b1[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x1a4b('0x0'));var rp=require(_0x1a4b('0x1'));var md5=require('md5');var util=require(_0x1a4b('0x2'));var moment=require(_0x1a4b('0x3'));var Promise=require(_0x1a4b('0x4'));var Redis=require(_0x1a4b('0x5'));var intUtil=require('./util');var config=require(_0x1a4b('0x6'));var logger=require('../../../../config/logger')(_0x1a4b('0x7'));config['redis']=_[_0x1a4b('0x8')](config[_0x1a4b('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1a4b('0xa'))(new Redis(config[_0x1a4b('0x9')]));function getAdminId(_0x136310,_0x59dcce,_0x21962f,_0x2c69a4){return new Promise(function(_0x5aa38e,_0x416700){var _0x11864b=![];var _0x4bb7d4={'method':'GET','uri':_0x2c69a4+_0x1a4b('0xb'),'json':!![]};_0x4bb7d4[_0x1a4b('0xc')]=_0x21962f;logger[_0x1a4b('0xd')]('Getting\x20admin\x20information');return rp(_0x4bb7d4)[_0x1a4b('0xe')](function(_0xb916e9){if(_0xb916e9){var _0x1b9a4a=_0xb916e9[_0x1a4b('0xf')];var _0x9a5325=null;for(_0x9a5325=0x0;_0x9a5325<_0x1b9a4a[_0x1a4b('0x10')];_0x9a5325++){if(_0x1b9a4a[_0x9a5325]['email']===_0x136310['adminEmail']){_0x136310[_0x1a4b('0x11')]=_0x1b9a4a[_0x9a5325]['id'];_0x11864b=!![];}}if(_0x11864b){logger[_0x1a4b('0xd')]('Admin\x20found:',_0x136310[_0x1a4b('0x11')]);_0x5aa38e(_0x136310);}else{_0x416700({'statusCode':0x194,'message':_0x1a4b('0x12')});}}else{_0x416700({'statusCode':0x194,'message':_0x1a4b('0x12')});}})[_0x1a4b('0x13')](function(_0x4e08a5){logger['error']('['+[_0x59dcce[_0x1a4b('0x14')]()]+']',_0x4e08a5[_0x1a4b('0x15')]);_0x416700(_0x4e08a5);});});}function getUser(_0x578f6d,_0x28060a,_0x6122d9){return function(_0x20bce7){return new Promise(function(_0x2c3dfa,_0x200de7){var _0x4ecf55={'method':_0x1a4b('0x16'),'uri':_0x6122d9+_0x1a4b('0xb'),'json':!![]};_0x4ecf55[_0x1a4b('0xc')]=_0x28060a;logger[_0x1a4b('0xd')]('Getting\x20user\x20list');return rp(_0x4ecf55)[_0x1a4b('0xe')](function(_0x4659c7){if(_0x4659c7){var _0xe51698=_0x4659c7['users'];var _0x948ea4=![];var _0x295c0a=null;if(_0x20bce7[_0x1a4b('0x17')]!==null){logger[_0x1a4b('0xd')]('Getting\x20user\x20with\x20email',_0x20bce7[_0x1a4b('0x17')]);_0x20bce7[_0x1a4b('0x18')]=_0x20bce7[_0x1a4b('0x17')];for(_0x295c0a=0x0;_0x295c0a<_0xe51698[_0x1a4b('0x10')];_0x295c0a++){if(_0xe51698[_0x295c0a]['email']===_0x20bce7[_0x1a4b('0x17')]){_0x948ea4=!![];_0x20bce7['userId']=_0xe51698[_0x295c0a]['id'];logger[_0x1a4b('0xd')]('User\x20found:',_0x20bce7['userId']);}}}if(!_0x948ea4){logger['info'](_0x1a4b('0x19'));_0x20bce7[_0x1a4b('0x18')]=_0x20bce7[_0x1a4b('0x1a')];_0x20bce7[_0x1a4b('0x1b')]=_0x20bce7[_0x1a4b('0x11')];_0x948ea4=!![];}if(_0x948ea4){_0x2c3dfa(_0x20bce7);}else{_0x200de7({'statusCode':0x194,'message':_0x1a4b('0x12')});}}else{_0x200de7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1a4b('0x13')](function(_0x34aa4a){logger[_0x1a4b('0x1c')]('['+[_0x578f6d[_0x1a4b('0x14')]()]+']',_0x34aa4a[_0x1a4b('0x15')]);_0x200de7(_0x34aa4a);});});};}function searchContact(_0x18f192,_0x4bb4d0,_0x9db01a,_0x1ebef5){return new Promise(function(_0x5356e5,_0x1ec247){var _0x5ceb93={'method':_0x1a4b('0x16'),'headers':_0x4bb4d0,'uri':_0x18f192+_0x1a4b('0x1d')+_0x1ebef5+_0x1a4b('0x1e')+_0x9db01a+_0x1a4b('0x1f'),'json':!![]};rp(_0x5ceb93)[_0x1a4b('0xe')](function(_0x223313){var _0x5aae12=_[_0x1a4b('0x20')](_0x223313[_0x1a4b('0x21')]['contacts'],[_0x9db01a,_0x1ebef5]);_0x5356e5(_0x5aae12);})['catch'](function(_0x530934){_0x1ec247(_0x530934);});});}function getEndUser(_0x27117f,_0x4ab2af,_0x2703c6){return function(_0x477d82){return new Promise(function(_0x5a7f96,_0x33e902){logger[_0x1a4b('0xd')](util[_0x1a4b('0x22')](_0x1a4b('0x23'),_0x477d82[_0x1a4b('0x24')]));searchContact(_0x2703c6,_0x4ab2af,'mobile_number',_0x477d82[_0x1a4b('0x24')])[_0x1a4b('0xe')](function(_0x10b65b){if(_0x10b65b){_0x477d82[_0x1a4b('0x25')]=_0x10b65b['id'];logger[_0x1a4b('0xd')](_0x1a4b('0x26'),_0x477d82[_0x1a4b('0x25')]);return _0x5a7f96(_0x477d82);}searchContact(_0x2703c6,_0x4ab2af,_0x1a4b('0x27'),_0x477d82[_0x1a4b('0x24')])['then'](function(_0x428e8c){if(_0x428e8c){_0x477d82[_0x1a4b('0x25')]=_0x428e8c['id'];logger['info'](_0x1a4b('0x28'),_0x477d82[_0x1a4b('0x25')]);return _0x5a7f96(_0x477d82);}createEndUser(_0x477d82,_0x27117f,_0x4ab2af,_0x2703c6)[_0x1a4b('0xe')](function(_0x254cec){logger['info'](_0x1a4b('0x29'),_0x254cec[_0x1a4b('0x25')]);return _0x5a7f96(_0x254cec);});});})[_0x1a4b('0x13')](function(_0x1df2c5){_0x33e902(_0x1df2c5);});});};}function createEndUser(_0x59db4e,_0x281a98,_0xd4166b,_0x23133a){return new Promise(function(_0x55328f,_0x518895){var _0x111d39=moment();var _0x589a71={'method':_0x1a4b('0x2a'),'uri':_0x23133a+_0x1a4b('0x2b'),'body':{'contact':{'last_name':_0x59db4e['contactNumber'],'work_number':_0x59db4e[_0x1a4b('0x24')],'mobile_number':_0x59db4e['contactNumber'],'owner_id':_0x59db4e['userId'],'created_at':_0x111d39['format'](_0x1a4b('0x2c'))}},'json':!![]};_0x589a71['headers']=_0xd4166b;logger['info'](_0x1a4b('0x2d'));return rp(_0x589a71)['then'](function(_0x26b6cf){_0x59db4e[_0x1a4b('0x25')]=_0x26b6cf['contact']['id'];_0x55328f(_0x59db4e);})[_0x1a4b('0x13')](function(_0x9c2238){logger[_0x1a4b('0x1c')]('['+[_0x281a98[_0x1a4b('0x14')]()]+']',_0x9c2238['message']);_0x518895(_0x9c2238[_0x1a4b('0x15')]);});});}function getTicket(_0x35eb70,_0x2f20bd,_0x1142f5,_0x5e631a,_0x41e9c0){return function(_0x4591f3){logger[_0x1a4b('0xd')](_0x1a4b('0x2e'));return new Promise(function(_0x830ace,_0x276065){var _0x24371c=moment();var _0x3a0138={'method':_0x1a4b('0x2a'),'uri':_0x1142f5+_0x1a4b('0x2f'),'body':{'title':intUtil[_0x1a4b('0x30')](_0x5e631a[_0x1a4b('0x31')],_0x41e9c0,'\x20'),'description':intUtil['getString'](_0x5e631a['Descriptions'],_0x41e9c0,'\x0a'),'owner_id':_0x4591f3[_0x1a4b('0x1b')],'creater_id':_0x4591f3[_0x1a4b('0x11')],'targetable_id':_0x4591f3['endUserId'],'targetable_type':_0x1a4b('0x32'),'created_at':_0x24371c[_0x1a4b('0x22')](_0x1a4b('0x2c')),'due_date':_0x24371c['add'](0x1e,'m')[_0x1a4b('0x22')](_0x1a4b('0x2c'))},'json':!![]};_0x3a0138[_0x1a4b('0xc')]=_0x2f20bd;return rp(_0x3a0138)[_0x1a4b('0xe')](function(_0x538c56){_0x4591f3[_0x1a4b('0x33')]=_0x538c56[_0x1a4b('0x34')]['id'];logger[_0x1a4b('0xd')]('Task\x20created:',_0x4591f3[_0x1a4b('0x33')]);_0x830ace(_0x4591f3);})[_0x1a4b('0x13')](function(_0x4e47ec){logger[_0x1a4b('0x1c')]('['+[_0x35eb70['toUpperCase']()]+']',_0x4e47ec[_0x1a4b('0x15')]);_0x276065(_0x4e47ec[_0x1a4b('0x15')]);});});};}function emit(_0x42df9,_0x273152,_0x100ca4){var _0xb9e400={'uri':_0x42df9+_0x1a4b('0x35')+_0x100ca4};io['to'](util['format']('user:%s',_0x273152))[_0x1a4b('0x36')](_0x1a4b('0x37'),_0xb9e400);}exports['cs']=function(_0x256f6b,_0x53fc62,_0x5aa8b5,_0x183eb4,_0x5e3ad9,_0x37f8cc,_0x57c09f,_0x2623cd){var _0x810f82={};var _0x348378={'Authorization':'Token\x20token='+_0x37f8cc['apiKey']};_0x37f8cc[_0x1a4b('0x38')]=intUtil['stripTrailingSlash'](_0x37f8cc[_0x1a4b('0x38')]);_0x37f8cc['serverUrl']=intUtil[_0x1a4b('0x39')](_0x37f8cc[_0x1a4b('0x3a')]);var _0x3f3ea4=_0x37f8cc['remoteUri'];_0x810f82[_0x1a4b('0x1a')]=_0x37f8cc[_0x1a4b('0x3b')];_0x810f82['contactNumber']=_0x2623cd[_0x1a4b('0x3c')]()===_0x1a4b('0x3d')?_0x53fc62[_0x1a4b('0x3e')]:_0x53fc62[_0x1a4b('0x3f')];_0x810f82[_0x1a4b('0x40')]=_0x2623cd===_0x1a4b('0x41')||_0x2623cd===_0x1a4b('0x42')?_0x1a4b('0x41'):_0x1a4b('0x3d');if(_0x183eb4){_0x810f82[_0x1a4b('0x17')]=_0x183eb4[_0x1a4b('0x43')];}var _0xd6d1ed=util[_0x1a4b('0x22')](_0x1a4b('0x44'),_0x37f8cc['serverUrl'],_0x53fc62['uniqueid'],md5(_0x53fc62['uniqueid']));if(_0x5e3ad9&&_0x5e3ad9[_0x1a4b('0x45')]){logger[_0x1a4b('0xd')](_0x1a4b('0x46'),_0x1a4b('0x47'));_0x53fc62[_0x1a4b('0x48')]=_0xd6d1ed;}else if(_0x57c09f&&_0x57c09f[_0x1a4b('0x49')]&&_0x57c09f[_0x1a4b('0x49')]!==_0x1a4b('0x4a')){logger['info'](_0x1a4b('0x4b'),'Recording\x20is\x20enabled!');_0x53fc62['recordingURL']=_0xd6d1ed;}else{_0x53fc62['recordingURL']='';}return getAdminId(_0x810f82,_0x2623cd,_0x348378,_0x3f3ea4)[_0x1a4b('0xe')](getUser(_0x2623cd,_0x348378,_0x3f3ea4))[_0x1a4b('0xe')](getEndUser(_0x2623cd,_0x348378,_0x3f3ea4))[_0x1a4b('0xe')](getTicket(_0x2623cd,_0x348378,_0x3f3ea4,_0x5aa8b5,_0x53fc62))['then'](function(_0x1c28fd){logger['info'](util[_0x1a4b('0x22')](_0x1a4b('0x4c'),_0x1c28fd['ticketId']));if(_0x2623cd!==_0x1a4b('0x42')){logger[_0x1a4b('0xd')]('['+[_0x2623cd[_0x1a4b('0x14')]()]+']',_0x1a4b('0x4d'));emit(_0x3f3ea4,_0x183eb4['name'],_0x1c28fd[_0x1a4b('0x25')]);}})[_0x1a4b('0x13')](function(_0x360d2c){logger[_0x1a4b('0x1c')]('['+[_0x2623cd['toUpperCase']()]+_0x1a4b('0x4e'),util[_0x1a4b('0x4f')](_0x360d2c,{'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 eebabb4..cedf4c3 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 _0x90e6=['./zoho','./desk','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zoho','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x90e6,0xe3));var _0x690e=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x90e6[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x690e('0x0'));var util=require(_0x690e('0x1'));var zendesk=require(_0x690e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x690e('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x690e('0x4'));var desk=require(_0x690e('0x5'));var vtiger=require(_0x690e('0x6'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x690e('0x7'));var integrations=[_0x690e('0x8'),_0x690e('0x9'),_0x690e('0xa'),_0x690e('0xb'),'zoho',_0x690e('0xc'),_0x690e('0xd'),_0x690e('0xe'),_0x690e('0xf'),_0x690e('0x10')];exports[_0x690e('0x11')]=function(_0x4c7da0,_0x12af70,_0x5416a5,_0x35e5f9,_0x3a06a1,_0x55a39a){if(_0x5416a5){if(_['includes'](integrations,_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')]())){try{var _0x19ff34=null;var _0xc37e0='';var _0x1e9f75=_0x5416a5[_0x4c7da0[_0x690e('0x12')]['toLowerCase']()];if(_0x1e9f75){var _0x4978db=_0x1e9f75[_0x4c7da0[_0x690e('0x14')]];if(_0x4978db){var _0x54f238=_[_0x690e('0x15')](_0x4978db['Configurations'],{'id':parseInt(_0x4c7da0['data3'],0xa)});if(_0x54f238){if(_0x35e5f9){if(_0x3a06a1&&_0x12af70[_0x690e('0x16')]){_0xc37e0='queue';}else if(_0x12af70['routeId']){_0xc37e0=_0x690e('0x17');}else{console[_0x690e('0x18')](_0x690e('0x19'),_0x12af70);}}else{_0xc37e0=_0x690e('0x1a');}switch(_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')]()){case _0x690e('0x8'):zendesk[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0x9'):salesforce[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xa'):sugarcrm[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xb'):freshdesk[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0x1b'):zoho[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xc'):desk[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xd'):vtiger[_0xc37e0](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a);break;case _0x690e('0xf'):freshsales['cs'](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a,_0xc37e0);break;case _0x690e('0x10'):servicenow['cs'](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a,_0xc37e0);break;case _0x690e('0xe'):dynamics365['cs'](_0x4c7da0,_0x12af70,_0x54f238,_0x35e5f9,_0x3a06a1,_0x4978db,_0x55a39a,_0xc37e0);break;default:console[_0x690e('0x18')](_0x690e('0x1c'));}}else{_0x19ff34=require('../../../../config/logger')(_0x4c7da0['data1']['toLowerCase']());_0x19ff34[_0x690e('0x1d')]('[EXEC]',util[_0x690e('0x1e')](_0x690e('0x1f'),_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')](),_0x4c7da0['data3']));}}else{_0x19ff34=require('../../../../config/logger')(_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')]());_0x19ff34[_0x690e('0x1d')]('[EXEC]',util[_0x690e('0x1e')](_0x690e('0x20'),_0x4c7da0[_0x690e('0x12')][_0x690e('0x13')](),_0x4c7da0[_0x690e('0x14')]));}}else{}}catch(_0x187047){console['error'](_0x187047);}}}}; \ No newline at end of file +var _0xc0cf=['Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','freshdesk','desk','vtiger','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find'];(function(_0x1109a0,_0x1cb4a6){var _0x5f41e1=function(_0x11b01c){while(--_0x11b01c){_0x1109a0['push'](_0x1109a0['shift']());}};_0x5f41e1(++_0x1cb4a6);}(_0xc0cf,0x152));var _0xfc0c=function(_0x23bad1,_0x207d90){_0x23bad1=_0x23bad1-0x0;var _0x34a55c=_0xc0cf[_0x23bad1];return _0x34a55c;};'use strict';var _=require('lodash');var util=require(_0xfc0c('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xfc0c('0x1'));var sugarcrm=require(_0xfc0c('0x2'));var freshdesk=require(_0xfc0c('0x3'));var zoho=require(_0xfc0c('0x4'));var desk=require(_0xfc0c('0x5'));var vtiger=require(_0xfc0c('0x6'));var servicenow=require(_0xfc0c('0x7'));var dynamics365=require(_0xfc0c('0x8'));var freshsales=require(_0xfc0c('0x9'));var integrations=['zendesk',_0xfc0c('0xa'),_0xfc0c('0xb'),'freshdesk',_0xfc0c('0xc'),'desk','vtiger',_0xfc0c('0xd'),_0xfc0c('0xe'),_0xfc0c('0xf')];exports[_0xfc0c('0x10')]=function(_0x3d094a,_0x282fe6,_0x3aaa11,_0x7f697b,_0x291e90,_0x1f13f8){if(_0x3aaa11){if(_[_0xfc0c('0x11')](integrations,_0x3d094a[_0xfc0c('0x12')][_0xfc0c('0x13')]())){try{var _0x45fa19=null;var _0x279c47='';var _0x1d935d=_0x3aaa11[_0x3d094a[_0xfc0c('0x12')][_0xfc0c('0x13')]()];if(_0x1d935d){var _0x2f1d05=_0x1d935d[_0x3d094a[_0xfc0c('0x14')]];if(_0x2f1d05){var _0xd5c059=_[_0xfc0c('0x15')](_0x2f1d05[_0xfc0c('0x16')],{'id':parseInt(_0x3d094a[_0xfc0c('0x17')],0xa)});if(_0xd5c059){if(_0x7f697b){if(_0x291e90&&_0x282fe6[_0xfc0c('0x18')]){_0x279c47='queue';}else if(_0x282fe6['routeId']){_0x279c47=_0xfc0c('0x19');}else{console[_0xfc0c('0x1a')](_0xfc0c('0x1b'),_0x282fe6);}}else{_0x279c47=_0xfc0c('0x1c');}switch(_0x3d094a[_0xfc0c('0x12')][_0xfc0c('0x13')]()){case _0xfc0c('0x1d'):zendesk[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case _0xfc0c('0xa'):salesforce[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case'sugarcrm':sugarcrm[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case _0xfc0c('0x1e'):freshdesk[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case _0xfc0c('0xc'):zoho[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case _0xfc0c('0x1f'):desk[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case _0xfc0c('0x20'):vtiger[_0x279c47](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8);break;case _0xfc0c('0xe'):freshsales['cs'](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8,_0x279c47);break;case _0xfc0c('0xf'):servicenow['cs'](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8,_0x279c47);break;case _0xfc0c('0xd'):dynamics365['cs'](_0x3d094a,_0x282fe6,_0xd5c059,_0x7f697b,_0x291e90,_0x2f1d05,_0x1f13f8,_0x279c47);break;default:console[_0xfc0c('0x1a')](_0xfc0c('0x21'));}}else{_0x45fa19=require('../../../../config/logger')(_0x3d094a['data1'][_0xfc0c('0x13')]());_0x45fa19[_0xfc0c('0x22')](_0xfc0c('0x23'),util[_0xfc0c('0x24')](_0xfc0c('0x25'),_0x3d094a['data1'][_0xfc0c('0x13')](),_0x3d094a[_0xfc0c('0x17')]));}}else{_0x45fa19=require(_0xfc0c('0x26'))(_0x3d094a['data1'][_0xfc0c('0x13')]());_0x45fa19[_0xfc0c('0x22')](_0xfc0c('0x23'),util[_0xfc0c('0x24')](_0xfc0c('0x27'),_0x3d094a[_0xfc0c('0x12')]['toLowerCase'](),_0x3d094a[_0xfc0c('0x14')]));}}else{}}catch(_0x1427c8){console[_0xfc0c('0x22')](_0x1427c8);}}}}; \ 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 e4546d5..dd5cdf2 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 _0xcd0b=[']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','WhatId','ticketType','Case','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','execute','length','find','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','Contact','additionalSearchLead','merge','$or','Lead','additionalSearchAccount','additionalSearchContact','account','Account','first','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','toString','variableName','Variable','name','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','lastevent','toUpperCase'];(function(_0xfa97d0,_0x181f38){var _0x4f7149=function(_0x4fc731){while(--_0x4fc731){_0xfa97d0['push'](_0xfa97d0['shift']());}};_0x4f7149(++_0x181f38);}(_0xcd0b,0xfa));var _0xbcd0=function(_0x16fbe9,_0x4feb10){_0x16fbe9=_0x16fbe9-0x0;var _0x12fcb2=_0xcd0b[_0x16fbe9];return _0x12fcb2;};'use strict';var _=require(_0xbcd0('0x0'));var rp=require(_0xbcd0('0x1'));var moment=require(_0xbcd0('0x2'));var BPromise=require(_0xbcd0('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xbcd0('0x4'));var Redis=require(_0xbcd0('0x5'));var intUtil=require(_0xbcd0('0x6'));var config=require(_0xbcd0('0x7'));var logger=require(_0xbcd0('0x8'))(_0xbcd0('0x9'));config[_0xbcd0('0xa')]=_[_0xbcd0('0xb')](config[_0xbcd0('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xbcd0('0xc'))(new Redis(config['redis']));function emit(_0x34abea,_0x2e3562,_0x396e17){io['to'](_0x34abea)[_0xbcd0('0xd')](_0x2e3562,_0x396e17);}function getTicket(_0x27165e,_0x421015,_0x2d92ee,_0x2c18dd,_0x5a9ea4,_0x16d2b2,_0x5dc4a6,_0x340ec8){var _0x278e91=Object[_0xbcd0('0xe')]({},{'OwnerId':_0x421015['id'],'Subject':intUtil[_0xbcd0('0xf')](_0x2c18dd['Subjects'],_0x5a9ea4,'\x20'),'Description':intUtil[_0xbcd0('0xf')](_0x2c18dd['Descriptions'],_0x5a9ea4,'\x0a')},getCustomFields(_0x16d2b2,_0x5a9ea4));if(_0x2d92ee){if(_0x2c18dd['ticketType']===_0xbcd0('0x10')){_0x278e91[_0xbcd0('0x11')]=moment[_0xbcd0('0x12')]();_0x278e91[_0xbcd0('0x13')]=![];_0x278e91['IsRecurrence']=![];if(_0x2d92ee[_0xbcd0('0x14')]===_0xbcd0('0x15')||_0x2d92ee['endUserType']===_0xbcd0('0x16')){_0x278e91[_0xbcd0('0x17')]=_0x2d92ee['id'];}else if(_0x2d92ee['endUserType']==='account'){_0x278e91[_0xbcd0('0x18')]=_0x2d92ee['id'];}}else if(_0x2c18dd[_0xbcd0('0x19')]===_0xbcd0('0x1a')){if(_0x2d92ee[_0xbcd0('0x14')]==='contact'){_0x278e91['ContactId']=_0x2d92ee['id'];}else if(_0x2d92ee[_0xbcd0('0x14')]==='account'){_0x278e91[_0xbcd0('0x1b')]=_0x2d92ee['id'];}else if(_0x2d92ee[_0xbcd0('0x14')]===_0xbcd0('0x16')&&_0x2c18dd[_0xbcd0('0x1c')]){_0x278e91[_0x2c18dd['leadId']]=_0x2d92ee['id'];}else{logger['info'](_0xbcd0('0x1d'));}}}return _0x5dc4a6[_0xbcd0('0x1e')](_0x2c18dd[_0xbcd0('0x19')])[_0xbcd0('0x1f')](_0x278e91);}function getUser(_0x52a603,_0x331e32,_0x4bb299){if(!_[_0xbcd0('0x20')](_0x331e32)&&intUtil[_0xbcd0('0x21')](_0x331e32)){var _0x1cf409={'Email':_0x331e32};var _0x2cb1a6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4bb299[_0xbcd0('0x1e')]('User')['find'](_0x1cf409,_0x2cb1a6)[_0xbcd0('0x22')]()['then'](function(_0x30cb2b){if(_0x30cb2b[_0xbcd0('0x23')]){var _0x545160=_[_0xbcd0('0x24')](_0x30cb2b,function(_0x22e084){return _0x22e084[_0xbcd0('0x25')]===_0x331e32;});if(_0x545160){logger[_0xbcd0('0x26')](_0xbcd0('0x27'),_0x331e32);return BPromise[_0xbcd0('0x28')]({'id':_0x545160['Id'],'name':_0x545160[_0xbcd0('0x29')]});}}else{logger[_0xbcd0('0x26')](_0xbcd0('0x2a'),_0x331e32);return _0x4bb299[_0xbcd0('0x2b')]()[_0xbcd0('0x2c')](function(_0x4e7309){return BPromise[_0xbcd0('0x28')]({'id':_0x4e7309[_0xbcd0('0x2d')],'name':_0x4e7309[_0xbcd0('0x2e')]});});}});}else{logger[_0xbcd0('0x26')](_0xbcd0('0x2a'),_0x331e32);return _0x4bb299[_0xbcd0('0x2b')]()[_0xbcd0('0x2c')](function(_0x5ebd44){return BPromise[_0xbcd0('0x28')]({'id':_0x5ebd44['user_id'],'name':_0x5ebd44[_0xbcd0('0x2e')]});});}}function getEndUser(_0x1bfd60,_0x13abd2,_0x1a427f,_0x443b77,_0x4f4b8a){var _0x1ec98f={'$or':{'Phone':_0x443b77}};var _0x3f5c1a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbcd0('0x28')]()[_0xbcd0('0x2c')](function(){logger[_0xbcd0('0x26')](_0xbcd0('0x2f'),_0x443b77,_0x13abd2[_0xbcd0('0x30')]);switch(_0x13abd2['moduleSearch']){case _0xbcd0('0x31'):var _0x43544b=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2['additionalSearchContact']){var _0x28e61e={};_0x28e61e[_0x13abd2['additionalSearchContact']]=_0x443b77;_['merge'](_0x43544b['$or'],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x33'))[_0xbcd0('0x24')](_0x43544b,_0x3f5c1a)[_0xbcd0('0x22')]()[_0xbcd0('0x2c')](function(_0x1ea90b){if(_0x1ea90b&&_0x1ea90b[_0xbcd0('0x23')]){return _0x1ea90b;}else{var _0x3820a4=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x34')]){var _0x326a34={};_0x326a34[_0x13abd2[_0xbcd0('0x34')]]=_0x443b77;_[_0xbcd0('0x35')](_0x3820a4[_0xbcd0('0x36')],_0x326a34);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x37'))[_0xbcd0('0x24')](_0x3820a4,_0x3f5c1a);}});case'account_contact_lead':var _0x40fc0a=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x38')]){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x38')]]=_0x443b77;_[_0xbcd0('0x35')](_0x40fc0a[_0xbcd0('0x36')],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')]('Account')[_0xbcd0('0x24')](_0x40fc0a,_0x3f5c1a)[_0xbcd0('0x22')]()[_0xbcd0('0x2c')](function(_0x25cad0){if(_0x25cad0&&_0x25cad0[_0xbcd0('0x23')]){return _0x25cad0;}else{var _0x522eab=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x39')]){var _0x2d6aed={};_0x2d6aed[_0x13abd2[_0xbcd0('0x39')]]=_0x443b77;_[_0xbcd0('0x35')](_0x522eab[_0xbcd0('0x36')],_0x2d6aed);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x33'))[_0xbcd0('0x24')](_0x522eab,_0x3f5c1a)[_0xbcd0('0x2c')](function(_0x4cebf7){if(_0x4cebf7&&_0x4cebf7['length']){return _0x4cebf7;}else{var _0x2e6271=_['cloneDeep'](_0x1ec98f);if(_0x13abd2['additionalSearchLead']){var _0x301b55={};_0x301b55[_0x13abd2[_0xbcd0('0x34')]]=_0x443b77;_[_0xbcd0('0x35')](_0x2e6271[_0xbcd0('0x36')],_0x301b55);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x37'))[_0xbcd0('0x24')](_0x2e6271,_0x3f5c1a);}});}});case'contact':var _0x43544b=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2['additionalSearchContact']){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x39')]]=_0x443b77;_[_0xbcd0('0x35')](_0x43544b[_0xbcd0('0x36')],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x33'))['find'](_0x43544b,_0x3f5c1a)[_0xbcd0('0x22')]();case'lead':var _0x44cb35=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2['additionalSearchLead']){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x34')]]=_0x443b77;_[_0xbcd0('0x35')](_0x44cb35['$or'],_0x28e61e);}return _0x4f4b8a['sobject'](_0xbcd0('0x37'))[_0xbcd0('0x24')](_0x44cb35,_0x3f5c1a);case _0xbcd0('0x3a'):var _0x40fc0a=_[_0xbcd0('0x32')](_0x1ec98f);if(_0x13abd2[_0xbcd0('0x38')]){var _0x28e61e={};_0x28e61e[_0x13abd2[_0xbcd0('0x38')]]=_0x443b77;_['merge'](_0x40fc0a[_0xbcd0('0x36')],_0x28e61e);}return _0x4f4b8a[_0xbcd0('0x1e')](_0xbcd0('0x3b'))[_0xbcd0('0x24')](_0x40fc0a,_0x3f5c1a);default:return null;}})['then'](function(_0x3e889f){if(_0x3e889f&&_0x3e889f[_0xbcd0('0x23')]){var _0x52842a=_[_0xbcd0('0x3c')](_0x3e889f);if(_0x52842a){return BPromise[_0xbcd0('0x28')]({'id':_0x52842a['Id'],'name':_0x52842a[_0xbcd0('0x29')],'phone':_0x52842a['Phone'],'endUserType':_0x52842a['attributes'][_0xbcd0('0x3d')][_0xbcd0('0x3e')]()});}}})['then'](function(_0x5b669a){if(_0x5b669a){logger[_0xbcd0('0x26')](_0xbcd0('0x3f'),_0x5b669a[_0xbcd0('0x14')],_0x443b77);return BPromise[_0xbcd0('0x28')](_0x5b669a);}else{logger['info'](_0xbcd0('0x40'),_0x443b77);var _0x557f58={'Phone':_0x443b77};if(_0x13abd2[_0xbcd0('0x41')]){if(_0x13abd2['moduleCreate']===_0xbcd0('0x15')){logger[_0xbcd0('0x26')](_0xbcd0('0x42'),_0x443b77,_0x13abd2[_0xbcd0('0x41')]);_0x557f58[_0xbcd0('0x43')]=_0x1a427f!==_0xbcd0('0x44')?_0x1a427f:util[_0xbcd0('0x45')](_0xbcd0('0x46'),_0x443b77);}else if(_0x13abd2[_0xbcd0('0x41')]===_0xbcd0('0x16')){logger[_0xbcd0('0x26')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x443b77,_0x13abd2[_0xbcd0('0x41')]);_0x557f58[_0xbcd0('0x43')]=_0x1a427f!==_0xbcd0('0x44')?_0x1a427f:util['format'](_0xbcd0('0x46'),_0x443b77);_0x557f58[_0xbcd0('0x47')]=_0xbcd0('0x48');}else if(_0x13abd2[_0xbcd0('0x41')]===_0xbcd0('0x3a')){logger[_0xbcd0('0x26')](_0xbcd0('0x42'),_0x443b77,_0x13abd2[_0xbcd0('0x41')]);_0x557f58[_0xbcd0('0x29')]=_0x1a427f!==_0xbcd0('0x44')?_0x1a427f:util[_0xbcd0('0x45')](_0xbcd0('0x46'),_0x443b77);}else{return null;}}return _0x4f4b8a['sobject'](_[_0xbcd0('0x49')](_0x13abd2[_0xbcd0('0x41')]))[_0xbcd0('0x1f')](_0x557f58)['then'](function(_0x4b7a18){return BPromise['resolve']({'id':_0x4b7a18['id'],'endUserType':_0x13abd2[_0xbcd0('0x41')]});});}});}function getCustomFields(_0x39f769,_0x315571){var _0x1b901c={};if(_0x39f769[_0xbcd0('0x23')]>0x0){_[_0xbcd0('0x4a')](_0x39f769,function(_0x3a36ec){if(_[_0xbcd0('0x4b')](['string',_0xbcd0('0x4c')],_0x3a36ec['type'])&&_0x3a36ec[_0xbcd0('0x4d')]){_0x1b901c[_0x3a36ec[_0xbcd0('0x4d')]]=_0x3a36ec['content'][_0xbcd0('0x4e')]();}else if(_0x3a36ec[_0xbcd0('0x3d')]==='variable'&&_0x3a36ec[_0xbcd0('0x4f')]&&_0x3a36ec[_0xbcd0('0x4d')]){_0x315571[_0x3a36ec[_0xbcd0('0x4f')]]&&(_0x1b901c[_0x3a36ec[_0xbcd0('0x4d')]]=_0x315571[_0x3a36ec[_0xbcd0('0x4f')]][_0xbcd0('0x4e')]());}else if(_0x3a36ec[_0xbcd0('0x3d')]==='customVariable'&&_0x3a36ec[_0xbcd0('0x50')]&&_0x3a36ec[_0xbcd0('0x50')][_0xbcd0('0x51')]&&_0x3a36ec[_0xbcd0('0x4d')]){_0x315571[_0x3a36ec['Variable'][_0xbcd0('0x51')][_0xbcd0('0x3e')]()]&&(_0x1b901c[_0x3a36ec[_0xbcd0('0x4d')]]=_0x315571[_0x3a36ec[_0xbcd0('0x50')][_0xbcd0('0x51')][_0xbcd0('0x3e')]()]['toString']());}});}return _0x1b901c;}function getConnection(_0x441f88){var _0x3db35d=_0x441f88['password']['concat'](_0x441f88[_0xbcd0('0x52')]);var _0x3c3198=new jsforce['Connection']({'oauth2':{'loginUrl':_0x441f88[_0xbcd0('0x53')]||_0xbcd0('0x54'),'clientId':_0x441f88[_0xbcd0('0x55')],'clientSecret':_0x441f88[_0xbcd0('0x56')]}});return _0x3c3198[_0xbcd0('0x57')](_0x441f88[_0xbcd0('0x58')],_0x3db35d)[_0xbcd0('0x2c')](function(){logger[_0xbcd0('0x26')](_0xbcd0('0x59'));return _0x3c3198;});}exports[_0xbcd0('0x5a')]=function(_0x49dd6e,_0x1329aa,_0x5c8c3c,_0x3bd442,_0xc18f29,_0x4ef3bb){var _0x56a263,_0x160873,_0x35be48,_0x10be98;_0x4ef3bb['serverUrl']=intUtil[_0xbcd0('0x5b')](_0x4ef3bb[_0xbcd0('0x5c')]);_0x4ef3bb[_0xbcd0('0x53')]=intUtil['stripTrailingSlash'](_0x4ef3bb[_0xbcd0('0x53')]);if(_0xc18f29&&_0xc18f29[_0xbcd0('0x5d')]){logger[_0xbcd0('0x26')](_0xbcd0('0x5e'),_0xbcd0('0x5f'));_0x1329aa[_0xbcd0('0x60')]=util[_0xbcd0('0x45')](_0xbcd0('0x61'),_0x4ef3bb[_0xbcd0('0x5c')],_0x1329aa[_0xbcd0('0x62')],md5(_0x1329aa['uniqueid']));}else{_0x1329aa['recordingURL']='';}return getConnection(_0x4ef3bb)['then'](function(_0x5a29f2){_0x10be98=_0x5a29f2;return getUser(_0x4ef3bb,_0x3bd442['email'],_0x10be98);})[_0xbcd0('0x2c')](function(_0x2e04d0){_0x56a263=_0x2e04d0;return getEndUser(_0x4ef3bb,_0x5c8c3c,_0x1329aa[_0xbcd0('0x63')],_0x1329aa[_0xbcd0('0x64')],_0x10be98);})[_0xbcd0('0x2c')](function(_0x3376a7){_0x160873=_0x3376a7;return getTicket(_0x4ef3bb,_0x56a263,_0x160873,_0x5c8c3c,_0x1329aa,_0x5c8c3c[_0xbcd0('0x65')],_0x10be98,_0xbcd0('0x5a'));})[_0xbcd0('0x2c')](function(_0x384372){_0x35be48=_0x384372;logger[_0xbcd0('0x26')](_0xbcd0('0x66'),_0x35be48['id']);logger['info'](_0xbcd0('0x67'),_0x35be48['id'],_0x3bd442['name'],_0x4ef3bb[_0xbcd0('0x3d')]);switch(_0x4ef3bb['type']){case _0xbcd0('0x68'):emit(util[_0xbcd0('0x45')](_0xbcd0('0x69'),_0x3bd442[_0xbcd0('0x51')]),'trigger:salesforce:display',{'recordId':_0x35be48['id']});break;case _0xbcd0('0x6a'):emit(util[_0xbcd0('0x45')](_0xbcd0('0x69'),_0x3bd442['name']),'trigger:browser:url',{'uri':util['format'](_0xbcd0('0x6b'),_0x10be98[_0xbcd0('0x6c')],_0x35be48['id'])});break;default:logger[_0xbcd0('0x6d')](_0xbcd0('0x6e'));}})[_0xbcd0('0x6f')](function(_0x746580){logger[_0xbcd0('0x6d')]('[QUEUE]',_0x746580);});};exports['outbound']=function(_0x59353c,_0x30ff92,_0x7d87eb,_0x563a27,_0x92f30b,_0x113505,_0x6543f3){var _0x61bd5b,_0x2c691,_0x3b4901,_0x483c51;_0x113505[_0xbcd0('0x5c')]=intUtil[_0xbcd0('0x5b')](_0x113505['serverUrl']);_0x113505[_0xbcd0('0x53')]=intUtil['stripTrailingSlash'](_0x113505[_0xbcd0('0x53')]);if(_0x6543f3&&_0x6543f3[_0xbcd0('0x70')]&&_0x6543f3['recordingFormat']!==_0xbcd0('0x71')){logger[_0xbcd0('0x26')](_0xbcd0('0x72'),_0xbcd0('0x5f'));_0x30ff92['recordingURL']=util[_0xbcd0('0x45')](_0xbcd0('0x61'),_0x113505['serverUrl'],_0x30ff92[_0xbcd0('0x62')],md5(_0x30ff92[_0xbcd0('0x62')]));}return getConnection(_0x113505)['then'](function(_0x44713d){_0x483c51=_0x44713d;return getUser(_0x113505,_0x563a27['email'],_0x483c51);})[_0xbcd0('0x2c')](function(_0x2011f3){_0x61bd5b=_0x2011f3;return getEndUser(_0x113505,_0x7d87eb,_0x30ff92[_0xbcd0('0x73')],_0x30ff92[_0xbcd0('0x74')],_0x483c51);})['then'](function(_0x3e4287){_0x2c691=_0x3e4287;return getTicket(_0x113505,_0x61bd5b,_0x2c691,_0x7d87eb,_0x30ff92,_0x7d87eb[_0xbcd0('0x65')],_0x483c51,'outbound');})['then'](function(_0x3fc089){_0x3b4901=_0x3fc089;logger[_0xbcd0('0x26')](_0xbcd0('0x75'),_0x3b4901['id']);logger['info'](_0xbcd0('0x76'),_0x3b4901['id'],_0x563a27[_0xbcd0('0x51')],_0x113505[_0xbcd0('0x3d')]);switch(_0x113505[_0xbcd0('0x3d')]){case _0xbcd0('0x68'):emit(util[_0xbcd0('0x45')](_0xbcd0('0x69'),_0x563a27[_0xbcd0('0x51')]),'trigger:salesforce:display',{'recordId':_0x3b4901['id']});break;case'newTab':emit(util['format'](_0xbcd0('0x69'),_0x563a27['name']),_0xbcd0('0x77'),{'uri':util[_0xbcd0('0x45')](_0xbcd0('0x6b'),_0x483c51['instanceUrl'],_0x3b4901['id'])});break;default:logger[_0xbcd0('0x6d')](_0xbcd0('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbcd0('0x6f')](function(_0x2cce2f){logger[_0xbcd0('0x6d')](_0xbcd0('0x72'),_0x2cce2f);});};exports['unmanaged']=function(_0x3ff9cc,_0x149ec4,_0x158549,_0x276f9d,_0x42949b,_0xce4457){var _0x5f0983,_0x263561,_0x5c45a5,_0x5642fa;_0xce4457[_0xbcd0('0x5c')]=intUtil[_0xbcd0('0x5b')](_0xce4457[_0xbcd0('0x5c')]);_0xce4457[_0xbcd0('0x53')]=intUtil['stripTrailingSlash'](_0xce4457['remoteUri']);if(_0x42949b&&_0x42949b[_0xbcd0('0x5d')]){logger[_0xbcd0('0x26')]('['+_0x149ec4[_0xbcd0('0x78')]['toUpperCase']()+']',_0xbcd0('0x5f'));_0x149ec4[_0xbcd0('0x60')]=util['format'](_0xbcd0('0x61'),_0xce4457[_0xbcd0('0x5c')],_0x149ec4['uniqueid'],md5(_0x149ec4[_0xbcd0('0x62')]));}else{_0x149ec4[_0xbcd0('0x60')]='';}return getConnection(_0xce4457)[_0xbcd0('0x2c')](function(_0x42efa6){_0x5642fa=_0x42efa6;if(!_['isNil'](_0x276f9d)){return getUser(_0xce4457,_0x276f9d[_0xbcd0('0x51')],_0x5642fa);}else{return getUser(_0xce4457,null,_0x5642fa);}})[_0xbcd0('0x2c')](function(_0x2f1315){_0x5f0983=_0x2f1315;return getEndUser(_0xce4457,_0x158549,_0x149ec4['calleridname'],_0x149ec4[_0xbcd0('0x64')],_0x5642fa);})[_0xbcd0('0x2c')](function(_0x46fe17){_0x263561=_0x46fe17;return getTicket(_0xce4457,_0x5f0983,_0x263561,_0x158549,_0x149ec4,_0x158549['Fields'],_0x5642fa);})[_0xbcd0('0x2c')](function(_0x1ccf3e){_0x5c45a5=_0x1ccf3e;logger[_0xbcd0('0x26')]('['+_0x149ec4['lastevent'][_0xbcd0('0x79')]()+_0xbcd0('0x7a'),_0x5c45a5['id']);logger[_0xbcd0('0x26')]('['+_0x149ec4[_0xbcd0('0x78')][_0xbcd0('0x79')]()+_0xbcd0('0x7b'),_0xce4457['type']);})[_0xbcd0('0x6f')](function(_0x51a22d){logger['error']('['+_0x149ec4[_0xbcd0('0x78')][_0xbcd0('0x79')]()+']',_0x51a22d);});}; \ No newline at end of file +var _0x881c=['info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','find','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Name','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','LastName','','Caller\x20-\x20%s','moduleCreate','format','No\x20Company','upperFirst','create','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','name','Variable','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','md5','util','ioredis','./util','defaults','redis','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','IsRecurrence','endUserType','contact','lead','WhoId','account','ticketType','ContactId','AccountId','leadId'];(function(_0x157bc5,_0xa1f0d8){var _0x21fb80=function(_0x1e6f4f){while(--_0x1e6f4f){_0x157bc5['push'](_0x157bc5['shift']());}};_0x21fb80(++_0xa1f0d8);}(_0x881c,0x1d6));var _0xc881=function(_0x25be6d,_0x175182){_0x25be6d=_0x25be6d-0x0;var _0x45f842=_0x881c[_0x25be6d];return _0x45f842;};'use strict';var _=require(_0xc881('0x0'));var rp=require(_0xc881('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xc881('0x2'));var jsforce=require('jsforce');var util=require(_0xc881('0x3'));var Redis=require(_0xc881('0x4'));var intUtil=require(_0xc881('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('salesforce');config['redis']=_[_0xc881('0x6')](config[_0xc881('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xc881('0x8'))(new Redis(config[_0xc881('0x7')]));function emit(_0x509f9b,_0x161b32,_0x2bbb31){io['to'](_0x509f9b)[_0xc881('0x9')](_0x161b32,_0x2bbb31);}function getTicket(_0x340106,_0x2c7d64,_0x2e3cb3,_0x3da3b8,_0x335546,_0x387a3f,_0x243ff3,_0x2c784d){var _0x21869d=Object[_0xc881('0xa')]({},{'OwnerId':_0x2c7d64['id'],'Subject':intUtil[_0xc881('0xb')](_0x3da3b8[_0xc881('0xc')],_0x335546,'\x20'),'Description':intUtil[_0xc881('0xb')](_0x3da3b8[_0xc881('0xd')],_0x335546,'\x0a')},getCustomFields(_0x387a3f,_0x335546));if(_0x2e3cb3){if(_0x3da3b8['ticketType']===_0xc881('0xe')){_0x21869d[_0xc881('0xf')]=moment['utc']();_0x21869d['IsReminderSet']=![];_0x21869d[_0xc881('0x10')]=![];if(_0x2e3cb3[_0xc881('0x11')]===_0xc881('0x12')||_0x2e3cb3[_0xc881('0x11')]===_0xc881('0x13')){_0x21869d[_0xc881('0x14')]=_0x2e3cb3['id'];}else if(_0x2e3cb3[_0xc881('0x11')]===_0xc881('0x15')){_0x21869d['WhatId']=_0x2e3cb3['id'];}}else if(_0x3da3b8[_0xc881('0x16')]==='Case'){if(_0x2e3cb3[_0xc881('0x11')]===_0xc881('0x12')){_0x21869d[_0xc881('0x17')]=_0x2e3cb3['id'];}else if(_0x2e3cb3['endUserType']===_0xc881('0x15')){_0x21869d[_0xc881('0x18')]=_0x2e3cb3['id'];}else if(_0x2e3cb3[_0xc881('0x11')]==='lead'&&_0x3da3b8[_0xc881('0x19')]){_0x21869d[_0x3da3b8['leadId']]=_0x2e3cb3['id'];}else{logger[_0xc881('0x1a')](_0xc881('0x1b'));}}}return _0x243ff3[_0xc881('0x1c')](_0x3da3b8[_0xc881('0x16')])['create'](_0x21869d);}function getUser(_0x423482,_0x261094,_0x64e34a){if(!_[_0xc881('0x1d')](_0x261094)&&intUtil['validateEmail'](_0x261094)){var _0x21d33d={'Email':_0x261094};var _0x17b985={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x64e34a[_0xc881('0x1c')](_0xc881('0x1e'))['find'](_0x21d33d,_0x17b985)[_0xc881('0x1f')]()[_0xc881('0x20')](function(_0x3a7d6a){if(_0x3a7d6a[_0xc881('0x21')]){var _0x4f61a5=_['find'](_0x3a7d6a,function(_0x114752){return _0x114752[_0xc881('0x22')]===_0x261094;});if(_0x4f61a5){logger[_0xc881('0x1a')](_0xc881('0x23'),_0x261094);return BPromise[_0xc881('0x24')]({'id':_0x4f61a5['Id'],'name':_0x4f61a5['Name']});}}else{logger[_0xc881('0x1a')](_0xc881('0x25'),_0x261094);return _0x64e34a[_0xc881('0x26')]()[_0xc881('0x20')](function(_0x4f39f3){return BPromise[_0xc881('0x24')]({'id':_0x4f39f3['user_id'],'name':_0x4f39f3[_0xc881('0x27')]});});}});}else{logger[_0xc881('0x1a')](_0xc881('0x25'),_0x261094);return _0x64e34a[_0xc881('0x26')]()[_0xc881('0x20')](function(_0xd11ec6){return BPromise[_0xc881('0x24')]({'id':_0xd11ec6['user_id'],'name':_0xd11ec6[_0xc881('0x27')]});});}}function getEndUser(_0x27db4d,_0x2c8a50,_0x3c6c73,_0x2e2adc,_0x36bce9){var _0x408e24={'$or':{'Phone':_0x2e2adc}};var _0x366a1b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc881('0x24')]()[_0xc881('0x20')](function(){logger['info'](_0xc881('0x28'),_0x2e2adc,_0x2c8a50[_0xc881('0x29')]);switch(_0x2c8a50[_0xc881('0x29')]){case _0xc881('0x2a'):var _0x3d075a=_[_0xc881('0x2b')](_0x408e24);if(_0x2c8a50[_0xc881('0x2c')]){var _0x5f4bff={};_0x5f4bff[_0x2c8a50['additionalSearchContact']]=_0x2e2adc;_[_0xc881('0x2d')](_0x3d075a[_0xc881('0x2e')],_0x5f4bff);}return _0x36bce9['sobject']('Contact')[_0xc881('0x2f')](_0x3d075a,_0x366a1b)[_0xc881('0x1f')]()[_0xc881('0x20')](function(_0x1389f6){if(_0x1389f6&&_0x1389f6['length']){return _0x1389f6;}else{var _0x4ce9db=_['cloneDeep'](_0x408e24);if(_0x2c8a50[_0xc881('0x30')]){var _0x51e88f={};_0x51e88f[_0x2c8a50[_0xc881('0x30')]]=_0x2e2adc;_[_0xc881('0x2d')](_0x4ce9db[_0xc881('0x2e')],_0x51e88f);}return _0x36bce9[_0xc881('0x1c')](_0xc881('0x31'))['find'](_0x4ce9db,_0x366a1b);}});case _0xc881('0x32'):var _0x40dcfd=_[_0xc881('0x2b')](_0x408e24);if(_0x2c8a50[_0xc881('0x33')]){var _0x5f4bff={};_0x5f4bff[_0x2c8a50[_0xc881('0x33')]]=_0x2e2adc;_['merge'](_0x40dcfd['$or'],_0x5f4bff);}return _0x36bce9['sobject'](_0xc881('0x34'))[_0xc881('0x2f')](_0x40dcfd,_0x366a1b)['execute']()['then'](function(_0x224a4e){if(_0x224a4e&&_0x224a4e['length']){return _0x224a4e;}else{var _0x52fff7=_[_0xc881('0x2b')](_0x408e24);if(_0x2c8a50[_0xc881('0x2c')]){var _0x347741={};_0x347741[_0x2c8a50['additionalSearchContact']]=_0x2e2adc;_[_0xc881('0x2d')](_0x52fff7['$or'],_0x347741);}return _0x36bce9[_0xc881('0x1c')]('Contact')[_0xc881('0x2f')](_0x52fff7,_0x366a1b)['then'](function(_0x36cd3c){if(_0x36cd3c&&_0x36cd3c[_0xc881('0x21')]){return _0x36cd3c;}else{var _0x36e0db=_['cloneDeep'](_0x408e24);if(_0x2c8a50[_0xc881('0x30')]){var _0x3a5b70={};_0x3a5b70[_0x2c8a50['additionalSearchLead']]=_0x2e2adc;_[_0xc881('0x2d')](_0x36e0db[_0xc881('0x2e')],_0x3a5b70);}return _0x36bce9[_0xc881('0x1c')](_0xc881('0x31'))[_0xc881('0x2f')](_0x36e0db,_0x366a1b);}});}});case _0xc881('0x12'):var _0x3d075a=_['cloneDeep'](_0x408e24);if(_0x2c8a50[_0xc881('0x2c')]){var _0x5f4bff={};_0x5f4bff[_0x2c8a50['additionalSearchContact']]=_0x2e2adc;_[_0xc881('0x2d')](_0x3d075a[_0xc881('0x2e')],_0x5f4bff);}return _0x36bce9[_0xc881('0x1c')](_0xc881('0x35'))[_0xc881('0x2f')](_0x3d075a,_0x366a1b)[_0xc881('0x1f')]();case _0xc881('0x13'):var _0x3af8c8=_[_0xc881('0x2b')](_0x408e24);if(_0x2c8a50['additionalSearchLead']){var _0x5f4bff={};_0x5f4bff[_0x2c8a50[_0xc881('0x30')]]=_0x2e2adc;_[_0xc881('0x2d')](_0x3af8c8['$or'],_0x5f4bff);}return _0x36bce9[_0xc881('0x1c')](_0xc881('0x31'))[_0xc881('0x2f')](_0x3af8c8,_0x366a1b);case _0xc881('0x15'):var _0x40dcfd=_[_0xc881('0x2b')](_0x408e24);if(_0x2c8a50[_0xc881('0x33')]){var _0x5f4bff={};_0x5f4bff[_0x2c8a50[_0xc881('0x33')]]=_0x2e2adc;_[_0xc881('0x2d')](_0x40dcfd[_0xc881('0x2e')],_0x5f4bff);}return _0x36bce9['sobject'](_0xc881('0x34'))[_0xc881('0x2f')](_0x40dcfd,_0x366a1b);default:return null;}})[_0xc881('0x20')](function(_0x15a586){if(_0x15a586&&_0x15a586[_0xc881('0x21')]){var _0x34b33c=_[_0xc881('0x36')](_0x15a586);if(_0x34b33c){return BPromise[_0xc881('0x24')]({'id':_0x34b33c['Id'],'name':_0x34b33c[_0xc881('0x37')],'phone':_0x34b33c['Phone'],'endUserType':_0x34b33c[_0xc881('0x38')]['type'][_0xc881('0x39')]()});}}})[_0xc881('0x20')](function(_0x42aada){if(_0x42aada){logger[_0xc881('0x1a')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x42aada[_0xc881('0x11')],_0x2e2adc);return BPromise[_0xc881('0x24')](_0x42aada);}else{logger[_0xc881('0x1a')](_0xc881('0x3a'),_0x2e2adc);var _0x2d737c={'Phone':_0x2e2adc};if(_0x2c8a50['moduleCreate']){if(_0x2c8a50['moduleCreate']==='contact'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2e2adc,_0x2c8a50['moduleCreate']);_0x2d737c[_0xc881('0x3b')]=_0x3c6c73!==_0xc881('0x3c')?_0x3c6c73:util['format'](_0xc881('0x3d'),_0x2e2adc);}else if(_0x2c8a50['moduleCreate']===_0xc881('0x13')){logger[_0xc881('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2e2adc,_0x2c8a50[_0xc881('0x3e')]);_0x2d737c[_0xc881('0x3b')]=_0x3c6c73!==_0xc881('0x3c')?_0x3c6c73:util[_0xc881('0x3f')]('Caller\x20-\x20%s',_0x2e2adc);_0x2d737c['Company']=_0xc881('0x40');}else if(_0x2c8a50['moduleCreate']===_0xc881('0x15')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x2e2adc,_0x2c8a50[_0xc881('0x3e')]);_0x2d737c[_0xc881('0x37')]=_0x3c6c73!==''?_0x3c6c73:util[_0xc881('0x3f')](_0xc881('0x3d'),_0x2e2adc);}else{return null;}}return _0x36bce9['sobject'](_[_0xc881('0x41')](_0x2c8a50[_0xc881('0x3e')]))[_0xc881('0x42')](_0x2d737c)[_0xc881('0x20')](function(_0x5d4a16){return BPromise['resolve']({'id':_0x5d4a16['id'],'endUserType':_0x2c8a50[_0xc881('0x3e')]});});}});}function getCustomFields(_0x1d9758,_0x3bd932){var _0x444eff={};if(_0x1d9758[_0xc881('0x21')]>0x0){_[_0xc881('0x43')](_0x1d9758,function(_0x4337b7){if(_[_0xc881('0x44')]([_0xc881('0x45'),'picklist'],_0x4337b7[_0xc881('0x46')])&&_0x4337b7[_0xc881('0x47')]){_0x444eff[_0x4337b7[_0xc881('0x47')]]=_0x4337b7[_0xc881('0x48')][_0xc881('0x49')]();}else if(_0x4337b7['type']===_0xc881('0x4a')&&_0x4337b7[_0xc881('0x4b')]&&_0x4337b7[_0xc881('0x47')]){_0x3bd932[_0x4337b7[_0xc881('0x4b')]]&&(_0x444eff[_0x4337b7[_0xc881('0x47')]]=_0x3bd932[_0x4337b7[_0xc881('0x4b')]][_0xc881('0x49')]());}else if(_0x4337b7[_0xc881('0x46')]===_0xc881('0x4c')&&_0x4337b7['Variable']&&_0x4337b7['Variable'][_0xc881('0x4d')]&&_0x4337b7[_0xc881('0x47')]){_0x3bd932[_0x4337b7[_0xc881('0x4e')][_0xc881('0x4d')][_0xc881('0x39')]()]&&(_0x444eff[_0x4337b7[_0xc881('0x47')]]=_0x3bd932[_0x4337b7['Variable']['name']['toLowerCase']()][_0xc881('0x49')]());}});}return _0x444eff;}function getConnection(_0x4ebc29){var _0x202927=_0x4ebc29[_0xc881('0x4f')][_0xc881('0x50')](_0x4ebc29['securityToken']);var _0xbabe8=new jsforce[(_0xc881('0x51'))]({'oauth2':{'loginUrl':_0x4ebc29[_0xc881('0x52')]||_0xc881('0x53'),'clientId':_0x4ebc29[_0xc881('0x54')],'clientSecret':_0x4ebc29[_0xc881('0x55')]}});return _0xbabe8['login'](_0x4ebc29[_0xc881('0x56')],_0x202927)['then'](function(){logger['info'](_0xc881('0x57'));return _0xbabe8;});}exports['queue']=function(_0x3ef256,_0x2a693b,_0x3cb035,_0x518184,_0x2c3cce,_0xd01ddf){var _0x5053e2,_0x29c18f,_0x330a4d,_0x322e38;_0xd01ddf[_0xc881('0x58')]=intUtil['stripTrailingSlash'](_0xd01ddf[_0xc881('0x58')]);_0xd01ddf[_0xc881('0x52')]=intUtil[_0xc881('0x59')](_0xd01ddf[_0xc881('0x52')]);if(_0x2c3cce&&_0x2c3cce[_0xc881('0x5a')]){logger['info']('[QUEUE]',_0xc881('0x5b'));_0x2a693b['recordingURL']=util[_0xc881('0x3f')](_0xc881('0x5c'),_0xd01ddf[_0xc881('0x58')],_0x2a693b[_0xc881('0x5d')],md5(_0x2a693b[_0xc881('0x5d')]));}else{_0x2a693b[_0xc881('0x5e')]='';}return getConnection(_0xd01ddf)[_0xc881('0x20')](function(_0x310e58){_0x322e38=_0x310e58;return getUser(_0xd01ddf,_0x518184[_0xc881('0x5f')],_0x322e38);})[_0xc881('0x20')](function(_0x47725f){_0x5053e2=_0x47725f;return getEndUser(_0xd01ddf,_0x3cb035,_0x2a693b[_0xc881('0x60')],_0x2a693b[_0xc881('0x61')],_0x322e38);})['then'](function(_0x27eecc){_0x29c18f=_0x27eecc;return getTicket(_0xd01ddf,_0x5053e2,_0x29c18f,_0x3cb035,_0x2a693b,_0x3cb035[_0xc881('0x62')],_0x322e38,_0xc881('0x63'));})[_0xc881('0x20')](function(_0x28b843){_0x330a4d=_0x28b843;logger[_0xc881('0x1a')](_0xc881('0x64'),_0x330a4d['id']);logger[_0xc881('0x1a')](_0xc881('0x65'),_0x330a4d['id'],_0x518184['name'],_0xd01ddf['type']);switch(_0xd01ddf[_0xc881('0x46')]){case _0xc881('0x66'):emit(util['format'](_0xc881('0x67'),_0x518184['name']),_0xc881('0x68'),{'recordId':_0x330a4d['id']});break;case _0xc881('0x69'):emit(util[_0xc881('0x3f')](_0xc881('0x67'),_0x518184[_0xc881('0x4d')]),'trigger:browser:url',{'uri':util[_0xc881('0x3f')](_0xc881('0x6a'),_0x322e38[_0xc881('0x6b')],_0x330a4d['id'])});break;default:logger[_0xc881('0x6c')](_0xc881('0x6d'));}})[_0xc881('0x6e')](function(_0x3a2187){logger[_0xc881('0x6c')](_0xc881('0x6f'),_0x3a2187);});};exports[_0xc881('0x70')]=function(_0x593ee6,_0x3d1134,_0x58db57,_0x629bf9,_0x25e7f2,_0x2160df,_0x2598d3){var _0x1d7c6e,_0x41de6f,_0x1826b9,_0x4b32cf;_0x2160df[_0xc881('0x58')]=intUtil[_0xc881('0x59')](_0x2160df[_0xc881('0x58')]);_0x2160df[_0xc881('0x52')]=intUtil[_0xc881('0x59')](_0x2160df[_0xc881('0x52')]);if(_0x2598d3&&_0x2598d3[_0xc881('0x71')]&&_0x2598d3[_0xc881('0x71')]!=='none'){logger[_0xc881('0x1a')](_0xc881('0x72'),'Recording\x20is\x20enabled!');_0x3d1134[_0xc881('0x5e')]=util[_0xc881('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2160df['serverUrl'],_0x3d1134[_0xc881('0x5d')],md5(_0x3d1134[_0xc881('0x5d')]));}return getConnection(_0x2160df)[_0xc881('0x20')](function(_0x234baa){_0x4b32cf=_0x234baa;return getUser(_0x2160df,_0x629bf9[_0xc881('0x5f')],_0x4b32cf);})[_0xc881('0x20')](function(_0x3c910e){_0x1d7c6e=_0x3c910e;return getEndUser(_0x2160df,_0x58db57,_0x3d1134[_0xc881('0x73')],_0x3d1134['destcalleridnum'],_0x4b32cf);})[_0xc881('0x20')](function(_0xc52701){_0x41de6f=_0xc52701;return getTicket(_0x2160df,_0x1d7c6e,_0x41de6f,_0x58db57,_0x3d1134,_0x58db57[_0xc881('0x62')],_0x4b32cf,_0xc881('0x70'));})[_0xc881('0x20')](function(_0x22b954){_0x1826b9=_0x22b954;logger['info'](_0xc881('0x74'),_0x1826b9['id']);logger['info'](_0xc881('0x75'),_0x1826b9['id'],_0x629bf9['name'],_0x2160df[_0xc881('0x46')]);switch(_0x2160df['type']){case'integrationTab':emit(util[_0xc881('0x3f')]('user:%s',_0x629bf9[_0xc881('0x4d')]),'trigger:salesforce:display',{'recordId':_0x1826b9['id']});break;case'newTab':emit(util['format'](_0xc881('0x67'),_0x629bf9[_0xc881('0x4d')]),'trigger:browser:url',{'uri':util['format'](_0xc881('0x6a'),_0x4b32cf[_0xc881('0x6b')],_0x1826b9['id'])});break;default:logger[_0xc881('0x6c')](_0xc881('0x72'),_0xc881('0x76'));}})[_0xc881('0x6e')](function(_0x1a6d13){logger[_0xc881('0x6c')](_0xc881('0x72'),_0x1a6d13);});};exports[_0xc881('0x77')]=function(_0x3fb96f,_0x139050,_0x154469,_0x3fbdaf,_0x2ca8bf,_0x174f50){var _0x58b44b,_0x4303c2,_0x3bc992,_0x4f5287;_0x174f50[_0xc881('0x58')]=intUtil[_0xc881('0x59')](_0x174f50['serverUrl']);_0x174f50['remoteUri']=intUtil[_0xc881('0x59')](_0x174f50[_0xc881('0x52')]);if(_0x2ca8bf&&_0x2ca8bf[_0xc881('0x5a')]){logger[_0xc881('0x1a')]('['+_0x139050[_0xc881('0x78')][_0xc881('0x79')]()+']','Recording\x20is\x20enabled!');_0x139050['recordingURL']=util['format'](_0xc881('0x5c'),_0x174f50[_0xc881('0x58')],_0x139050[_0xc881('0x5d')],md5(_0x139050[_0xc881('0x5d')]));}else{_0x139050['recordingURL']='';}return getConnection(_0x174f50)['then'](function(_0x37e872){_0x4f5287=_0x37e872;if(!_['isNil'](_0x3fbdaf)){return getUser(_0x174f50,_0x3fbdaf[_0xc881('0x4d')],_0x4f5287);}else{return getUser(_0x174f50,null,_0x4f5287);}})[_0xc881('0x20')](function(_0x1e9436){_0x58b44b=_0x1e9436;return getEndUser(_0x174f50,_0x154469,_0x139050['calleridname'],_0x139050['calleridnum'],_0x4f5287);})[_0xc881('0x20')](function(_0x51d89e){_0x4303c2=_0x51d89e;return getTicket(_0x174f50,_0x58b44b,_0x4303c2,_0x154469,_0x139050,_0x154469[_0xc881('0x62')],_0x4f5287);})['then'](function(_0x1f2ef6){_0x3bc992=_0x1f2ef6;logger['info']('['+_0x139050['lastevent'][_0xc881('0x79')]()+_0xc881('0x7a'),_0x3bc992['id']);logger[_0xc881('0x1a')]('['+_0x139050[_0xc881('0x78')][_0xc881('0x79')]()+_0xc881('0x7b'),_0x174f50[_0xc881('0x46')]);})[_0xc881('0x6e')](function(_0x11345f){logger['error']('['+_0x139050[_0xc881('0x78')]['toUpperCase']()+']',_0x11345f);});}; \ 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 bb49bd9..b49e2ef 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 _0xa1a7=['label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm'];(function(_0x237278,_0x39feaa){var _0x5ab67b=function(_0x58a76e){while(--_0x58a76e){_0x237278['push'](_0x237278['shift']());}};_0x5ab67b(++_0x39feaa);}(_0xa1a7,0x1ce));var _0x7a1a=function(_0x168478,_0x323a27){_0x168478=_0x168478-0x0;var _0x29c2f8=_0xa1a7[_0x168478];return _0x29c2f8;};'use strict';var _=require(_0x7a1a('0x0'));var Promise=require('bluebird');var rp=require(_0x7a1a('0x1'));var util=require('util');var md5=require(_0x7a1a('0x2'));var Redis=require(_0x7a1a('0x3'));var intUtil=require(_0x7a1a('0x4'));var config=require(_0x7a1a('0x5'));var logger=require(_0x7a1a('0x6'))(_0x7a1a('0x7'));config[_0x7a1a('0x8')]=_[_0x7a1a('0x9')](config[_0x7a1a('0x8')],{'host':_0x7a1a('0xa'),'port':0x18eb});var io=require(_0x7a1a('0xb'))(new Redis(config[_0x7a1a('0x8')]));function getAdminUser(_0x5d41f0,_0x3580ac,_0x39ac92,_0x534a94,_0x3924fc,_0x232f4a){return new Promise(function(_0x5c024d,_0x1b0286){var _0x1f8c03={'method':_0x7a1a('0xc'),'uri':_0x534a94+_0x7a1a('0xd')+'&'+_0x3924fc+'&'+_0x232f4a,'auth':_0x3580ac,'json':!![]};return rp(_0x1f8c03)['then'](function(_0x4d3e3f){if(_0x4d3e3f[_0x7a1a('0xe')][_0x7a1a('0xf')]>0x0){_0x39ac92[_0x7a1a('0x10')]=_0x4d3e3f[_0x7a1a('0xe')][0x0][_0x7a1a('0x11')];}logger[_0x7a1a('0x12')]('['+[_0x5d41f0[_0x7a1a('0x13')]()]+_0x7a1a('0x14'),_0x39ac92);_0x5c024d(_0x39ac92);})[_0x7a1a('0x15')](function(_0x5cbe07){logger['error']('['+[_0x5d41f0[_0x7a1a('0x13')]()]+']',_0x5cbe07[_0x7a1a('0x16')]);_0x1b0286(_0x5cbe07[_0x7a1a('0x16')]);});});}function getUser(_0x18b527,_0x3c8501,_0x341fb8,_0x11b585,_0x4ce405){return function(_0x4c11c1){logger[_0x7a1a('0x12')]('['+[_0x18b527[_0x7a1a('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x4c11c1);return new Promise(function(_0xcbcf02,_0x1e648d){if(intUtil[_0x7a1a('0x17')](_0x4c11c1[_0x7a1a('0x18')])){var _0x10cd19={'method':'GET','uri':_0x341fb8+_0x7a1a('0x19')+_0x4c11c1[_0x7a1a('0x18')]+'&'+_0x11b585+'&'+_0x4ce405,'auth':_0x3c8501,'json':!![]};logger['info']('['+[_0x18b527[_0x7a1a('0x13')]()]+_0x7a1a('0x1a'),_0x10cd19);return rp(_0x10cd19)[_0x7a1a('0x1b')](function(_0x41efc6){logger[_0x7a1a('0x12')]('['+[_0x18b527[_0x7a1a('0x13')]()]+'],\x20getUser\x20entity',_0x41efc6);if(_0x41efc6[_0x7a1a('0xe')]['length']>0x0&&String(_0x41efc6[_0x7a1a('0xe')][0x0]['active'])===_0x7a1a('0x1c')){_0x4c11c1[_0x7a1a('0x1d')]=_0x41efc6[_0x7a1a('0xe')][0x0][_0x7a1a('0x11')];}else{_0x4c11c1[_0x7a1a('0x1d')]=_0x4c11c1[_0x7a1a('0x10')];_0x4c11c1[_0x7a1a('0x18')]=_0x4c11c1[_0x7a1a('0x1e')];}logger['info']('['+[_0x18b527[_0x7a1a('0x13')]()]+_0x7a1a('0x1f'),_0x4c11c1);_0xcbcf02(_0x4c11c1);})[_0x7a1a('0x15')](function(_0x100143){logger[_0x7a1a('0x20')]('['+[_0x18b527[_0x7a1a('0x13')]()]+']',_0x100143['message']);_0x1e648d(_0x100143[_0x7a1a('0x16')]);});}else{logger['info']('['+[_0x18b527[_0x7a1a('0x13')]()]+_0x7a1a('0x21'));_0x4c11c1[_0x7a1a('0x1d')]=_0x4c11c1[_0x7a1a('0x10')];_0x4c11c1[_0x7a1a('0x18')]=_0x4c11c1[_0x7a1a('0x1e')];_0xcbcf02(_0x4c11c1);}});};}function createEndUser(_0x5c2024,_0x44bd8e,_0x30dd41,_0x199643,_0x15207d){logger['info']('['+[_0x5c2024[_0x7a1a('0x13')]()]+_0x7a1a('0x22'),_0x30dd41);return new Promise(function(_0x518827,_0xea4fda){var _0x4ba726={'method':_0x7a1a('0x23'),'uri':_0x199643+_0x7a1a('0x24')+_0x15207d,'body':{'user_name':_0x30dd41[_0x7a1a('0x25')],'roles':_0x7a1a('0x26'),'first_name':_0x30dd41['endUserNumber'],'active':_0x7a1a('0x1c'),'date_format':_0x7a1a('0x27'),'phone':_0x30dd41[_0x7a1a('0x25')]},'auth':_0x44bd8e,'json':!![]};return rp(_0x4ba726)[_0x7a1a('0x1b')](function(_0x4b94f9){logger['info']('['+[_0x5c2024[_0x7a1a('0x13')]()]+_0x7a1a('0x28'),_0x4b94f9[_0x7a1a('0xe')]);_0x30dd41[_0x7a1a('0x29')]=_0x4b94f9[_0x7a1a('0xe')]['sys_id'];_0x518827(_0x30dd41);})['catch'](function(_0x44fa5a){logger[_0x7a1a('0x20')]('['+[_0x5c2024[_0x7a1a('0x13')]()]+']',_0x44fa5a[_0x7a1a('0x16')]);_0xea4fda(_0x44fa5a[_0x7a1a('0x16')]);});});}function getEndUser(_0x461011,_0x183ecb,_0xa08e2e,_0xaeb217,_0x4f42c8){return function(_0x274521){logger['info']('['+[_0x461011[_0x7a1a('0x13')]()]+_0x7a1a('0x2a'),_0x274521);return new Promise(function(_0x1cb9ed,_0x1d66dd){var _0x465306={'method':_0x7a1a('0xc'),'uri':_0xa08e2e+_0x7a1a('0x2b')+_0x274521['endUserNumber']+'&'+_0xaeb217+'&'+_0x4f42c8,'auth':_0x183ecb,'json':!![]};return rp(_0x465306)[_0x7a1a('0x1b')](function(_0x285575){if(_0x285575['result'][_0x7a1a('0xf')]>0x0){_0x274521[_0x7a1a('0x29')]=_0x285575[_0x7a1a('0xe')][0x0]['sys_id'];logger[_0x7a1a('0x12')]('['+[_0x461011[_0x7a1a('0x13')]()]+_0x7a1a('0x2c'),_0x274521);_0x1cb9ed(_0x274521);}else{return createEndUser(_0x461011,_0x183ecb,_0x274521,_0xa08e2e,_0xaeb217)[_0x7a1a('0x1b')](function(_0x37d2be){logger[_0x7a1a('0x12')]('['+[_0x461011['toUpperCase']()]+_0x7a1a('0x2d'),_0x37d2be);_0x1cb9ed(_0x37d2be);});}})[_0x7a1a('0x15')](function(_0x1bb417){logger[_0x7a1a('0x20')]('['+[_0x461011['toUpperCase']()]+']',_0x1bb417[_0x7a1a('0x16')]);_0x1d66dd(_0x1bb417[_0x7a1a('0x16')]);});});};}function getCustomFields(_0x1681c0,_0x431faf){var _0xb40740={};if(_0x1681c0['length']>0x0){_[_0x7a1a('0x2e')](_0x1681c0,function(_0x142caf){if(_[_0x7a1a('0x2f')]([_0x7a1a('0x30'),'picklist'],_0x142caf[_0x7a1a('0x31')])&&_0x142caf[_0x7a1a('0x32')]&&!_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf[_0x7a1a('0x32')][_0x7a1a('0x34')]()]=_0x142caf[_0x7a1a('0x35')][_0x7a1a('0x36')]();}else if(_[_0x7a1a('0x2f')]([_0x7a1a('0x30'),_0x7a1a('0x37')],_0x142caf['type'])&&_0x142caf[_0x7a1a('0x38')]&&_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf['idField'][_0x7a1a('0x34')]()]=_0x142caf['content'][_0x7a1a('0x36')]();}else if(_0x142caf['type']===_0x7a1a('0x39')&&_0x142caf['variableName']&&_0x142caf[_0x7a1a('0x38')]&&_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf[_0x7a1a('0x38')][_0x7a1a('0x34')]()]=_0x431faf[_0x142caf[_0x7a1a('0x3a')]]['toString']();}else if(_0x142caf[_0x7a1a('0x31')]==='customVariable'&&_0x142caf[_0x7a1a('0x3b')]&&_0x142caf[_0x7a1a('0x3b')]['name']&&_0x142caf[_0x7a1a('0x38')]&&_0x142caf[_0x7a1a('0x33')]){_0xb40740[_0x142caf[_0x7a1a('0x38')][_0x7a1a('0x34')]()]=_0x431faf[_0x142caf[_0x7a1a('0x3b')][_0x7a1a('0x3c')]['toLowerCase']()][_0x7a1a('0x36')]();}});}return _0xb40740;}function getTicket(_0x3bf0a1,_0x3dae8c,_0xf2b9bf,_0x33eb5d,_0x4d18d3,_0x27ab01){return function(_0x4dc902){logger[_0x7a1a('0x12')]('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+_0x7a1a('0x3d'),_0x4dc902);return new Promise(function(_0x80a1c,_0x55958c){var _0x5ee789=_0x3bf0a1[_0x7a1a('0x34')]()===_0x7a1a('0x3e')?_0x4dc902[_0x7a1a('0x1d')]:_0x4dc902[_0x7a1a('0x29')];var _0x1123fc={'method':'POST','uri':_0xf2b9bf+_0x7a1a('0x3f')+'?'+_0x27ab01,'body':Object[_0x7a1a('0x40')]({},{'active':_0x7a1a('0x1c'),'caller_id':_0x5ee789,'assigned_to':_0x4dc902[_0x7a1a('0x1d')],'short_description':intUtil[_0x7a1a('0x41')](_0x33eb5d[_0x7a1a('0x42')],_0x4d18d3,'\x20'),'description':intUtil[_0x7a1a('0x41')](_0x33eb5d[_0x7a1a('0x43')],_0x4d18d3,'\x0a')},getCustomFields(_0x33eb5d[_0x7a1a('0x44')],_0x4d18d3)),'auth':_0x3dae8c,'json':!![]};return rp(_0x1123fc)['then'](function(_0x208129){logger['info']('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+_0x7a1a('0x45'),_0x208129[_0x7a1a('0xe')]);_0x4dc902[_0x7a1a('0x46')]=_0x208129[_0x7a1a('0xe')][_0x7a1a('0x11')];_0x4dc902[_0x7a1a('0x47')]=_0x208129[_0x7a1a('0xe')]['number'];logger[_0x7a1a('0x12')]('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+_0x7a1a('0x48'),_0x4dc902);_0x80a1c(_0x4dc902);})['catch'](function(_0x1cc620){logger[_0x7a1a('0x20')]('['+[_0x3bf0a1[_0x7a1a('0x13')]()]+']',_0x1cc620['message']);_0x55958c(_0x1cc620['message']);});});};}function createRemoteTag(_0x5118bf,_0x34626c,_0x10bd43,_0x18e9fd){return new Promise(function(_0x445c4f,_0x2b463a){var _0x11bedb={'method':_0x7a1a('0x23'),'uri':_0x10bd43+_0x7a1a('0x49')+'?'+_0x18e9fd,'body':{'short_description':_0x5118bf,'global':!![],'active':!![],'name':_0x5118bf},'auth':_0x34626c,'json':!![]};return rp(_0x11bedb)[_0x7a1a('0x1b')](function(_0x5e0959){var _0x285ed7=_0x5e0959[_0x7a1a('0xe')][_0x7a1a('0x11')];_0x445c4f(_0x285ed7);});});}function getRemoteTag(_0x214135,_0x15864a,_0x31559e,_0x5decc2,_0x262748){return new Promise(function(_0x2f5ff2,_0x546333){var _0x33757a={'method':_0x7a1a('0xc'),'uri':_0x31559e+_0x7a1a('0x49')+_0x7a1a('0x4a')+_0x214135+'&'+_0x5decc2,'auth':_0x15864a,'json':!![]};return rp(_0x33757a)['then'](function(_0x3b6fec){if(_0x3b6fec[_0x7a1a('0xe')][_0x7a1a('0xf')]>0x0){var _0x894373=_0x3b6fec['result'][0x0][_0x7a1a('0x11')];_0x2f5ff2(_0x894373);}else{return createRemoteTag(_0x214135,_0x15864a,_0x31559e,_0x5decc2)['then'](function(_0x531bec){_0x2f5ff2(_0x531bec);});}});});}function assignTagToIncident(_0x35c5ea,_0x3d17f4,_0x113451,_0x3d594d,_0x4a846d){return new Promise(function(_0x3a80eb,_0x39b416){var _0x355886={'method':_0x7a1a('0x23'),'uri':_0x113451+_0x7a1a('0x4b')+'?'+_0x4a846d,'body':{'label':_0x35c5ea,'table':_0x7a1a('0x3f'),'id_type':_0x7a1a('0x4c'),'table_key':_0x3d594d[_0x7a1a('0x46')],'title':_0x7a1a('0x4d')+_0x3d594d[_0x7a1a('0x47')],'id_display':_0x3d594d[_0x7a1a('0x47')]},'auth':_0x3d17f4,'json':!![]};return rp(_0x355886)[_0x7a1a('0x1b')](function(_0x4d5238){_0x3a80eb();})[_0x7a1a('0x15')](function(){_0x3a80eb();});});}function manageTags(_0x1205f8,_0x5e5bb3,_0x1c783a,_0x1531e8,_0x5e5b6e,_0x4b0044,_0x498e28){return new Promise(function(_0x18c82c,_0x15b9cd){var _0x38a59a=[];_0x5e5bb3[_0x7a1a('0x2e')](function(_0x300be9){_0x38a59a[_0x7a1a('0x4e')](getRemoteTag(_0x300be9,_0x1c783a,_0x1531e8,_0x4b0044,_0x498e28));});return Promise[_0x7a1a('0x4f')](_0x38a59a)[_0x7a1a('0x1b')](function(_0x26cf4c){if(_0x26cf4c[_0x7a1a('0xf')]){logger[_0x7a1a('0x12')]('['+[_0x1205f8[_0x7a1a('0x13')]()]+_0x7a1a('0x50'),_0x26cf4c);var _0x102d12=[];_0x26cf4c[_0x7a1a('0x2e')](function(_0x1b6cb9){_0x102d12[_0x7a1a('0x4e')](assignTagToIncident(_0x1b6cb9,_0x1c783a,_0x1531e8,_0x5e5b6e,_0x4b0044));});return Promise['all'](_0x102d12)[_0x7a1a('0x1b')](function(){_0x18c82c();})[_0x7a1a('0x15')](function(){_0x18c82c();});}else{_0x18c82c();}});});}function getTags(_0x4d84cc,_0x57e6a1,_0x5a9428,_0x15ff8b,_0x242787,_0x52455e){return function(_0xac81f){return new Promise(function(_0x5bbcb4,_0x46bedc){var _0x4facc3=[];var _0x347f9a=_0x15ff8b[_0x7a1a('0x51')];if(_0x347f9a&&_0x347f9a[_0x7a1a('0xf')]>0x0){_0x4facc3=_['map'](_0x347f9a,_0x7a1a('0x3c'));}if(_0x4facc3[_0x7a1a('0xf')]>0x0){return manageTags(_0x4d84cc,_0x4facc3,_0x57e6a1,_0x5a9428,_0xac81f,_0x242787,_0x52455e)['then'](function(){_0x5bbcb4(_0xac81f);});}else{_0x5bbcb4(_0xac81f);}});};}function emit(_0x5cd527,_0x1d04f1,_0x481e2d){var _0x522610='%26sysparm_record_target%3Dincident'+_0x7a1a('0x52')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x236987={'uri':_0x5cd527+_0x7a1a('0x53')+_0x481e2d+_0x522610};io['to'](util[_0x7a1a('0x54')](_0x7a1a('0x55'),_0x1d04f1))[_0x7a1a('0x56')](_0x7a1a('0x57'),_0x236987);}exports['cs']=function(_0x41fa89,_0x183585,_0x326e26,_0x336e6e,_0x96006f,_0x2be9a9,_0x168c3a,_0x268eae){var _0x38225e={};var _0x3d1ec7={'user':_0x2be9a9['username'],'pass':_0x2be9a9['password']};var _0x905ba7='sysparm_limit=1';var _0x532473=_0x7a1a('0x58');_0x2be9a9[_0x7a1a('0x59')]=intUtil[_0x7a1a('0x5a')](_0x2be9a9['remoteUri']);_0x2be9a9['serverUrl']=intUtil[_0x7a1a('0x5a')](_0x2be9a9[_0x7a1a('0x5b')]);var _0x34b0ea=util[_0x7a1a('0x54')]('%s/api/now/table/',_0x2be9a9[_0x7a1a('0x59')]);_0x38225e[_0x7a1a('0x18')]=!_['isNil'](_0x336e6e)?_0x336e6e['email']:null;_0x38225e['adminEmail']=_0x2be9a9['email'];_0x38225e[_0x7a1a('0x25')]=_0x268eae[_0x7a1a('0x34')]()===_0x7a1a('0x3e')?_0x183585[_0x7a1a('0x5c')]:_0x183585[_0x7a1a('0x5d')];_0x38225e[_0x7a1a('0x5e')]=_0x268eae==='queue'||_0x268eae===_0x7a1a('0x5f')?_0x7a1a('0x60'):_0x7a1a('0x3e');var _0x3557e5=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2be9a9['serverUrl'],_0x183585[_0x7a1a('0x61')],md5(_0x183585[_0x7a1a('0x61')]));if(_0x96006f&&_0x96006f['monitor_format']){logger[_0x7a1a('0x12')](_0x7a1a('0x62'),'Recording\x20is\x20enabled!');_0x183585[_0x7a1a('0x63')]=_0x3557e5;}else if(_0x168c3a&&_0x168c3a[_0x7a1a('0x64')]&&_0x168c3a['recordingFormat']!=='none'){logger[_0x7a1a('0x12')](_0x7a1a('0x65'),_0x7a1a('0x66'));_0x183585[_0x7a1a('0x63')]=_0x3557e5;}else{_0x183585[_0x7a1a('0x63')]='';}return getAdminUser(_0x268eae,_0x3d1ec7,_0x38225e,_0x34b0ea,_0x532473,_0x905ba7)[_0x7a1a('0x1b')](getUser(_0x268eae,_0x3d1ec7,_0x34b0ea,_0x532473,_0x905ba7))[_0x7a1a('0x1b')](getEndUser(_0x268eae,_0x3d1ec7,_0x34b0ea,_0x532473,_0x905ba7))[_0x7a1a('0x1b')](getTicket(_0x268eae,_0x3d1ec7,_0x34b0ea,_0x326e26,_0x183585,_0x532473))[_0x7a1a('0x1b')](function(_0x5549f7){logger[_0x7a1a('0x12')](util[_0x7a1a('0x54')](_0x7a1a('0x67'),_0x5549f7['ticketId']));logger['info'](util[_0x7a1a('0x54')](_0x7a1a('0x68'),_0x268eae));if(_0x268eae!==_0x7a1a('0x5f')){logger[_0x7a1a('0x12')]('['+[_0x268eae['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2be9a9[_0x7a1a('0x59')],_0x336e6e[_0x7a1a('0x3c')],_0x5549f7['ticketId']);}})['catch'](function(_0x23b944){logger[_0x7a1a('0x20')]('['+[_0x268eae[_0x7a1a('0x13')]()]+_0x7a1a('0x69'),util[_0x7a1a('0x6a')](_0x23b944,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3818=['toUpperCase','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','message','],\x20createEndUser\x20input\x20crm','user','true','System','endUserNumber','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','length','includes','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','Variable','name','outbound','POST','incident','assign','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','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','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x3818,0x133));var _0x8381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3818[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8381('0x0'));var Promise=require(_0x8381('0x1'));var rp=require(_0x8381('0x2'));var util=require(_0x8381('0x3'));var md5=require(_0x8381('0x4'));var Redis=require(_0x8381('0x5'));var intUtil=require(_0x8381('0x6'));var config=require(_0x8381('0x7'));var logger=require(_0x8381('0x8'))('servicenow');config[_0x8381('0x9')]=_['defaults'](config[_0x8381('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x3d6b41,_0x3e0ab5,_0x5151d0,_0x2bd748,_0x209fd2,_0x54f49e){return new Promise(function(_0x4ad04f,_0xb16dc3){var _0x2a1c23={'method':_0x8381('0xa'),'uri':_0x2bd748+_0x8381('0xb')+'&'+_0x209fd2+'&'+_0x54f49e,'auth':_0x3e0ab5,'json':!![]};return rp(_0x2a1c23)[_0x8381('0xc')](function(_0x5f195a){if(_0x5f195a[_0x8381('0xd')]['length']>0x0){_0x5151d0[_0x8381('0xe')]=_0x5f195a[_0x8381('0xd')][0x0][_0x8381('0xf')];}logger[_0x8381('0x10')]('['+[_0x3d6b41[_0x8381('0x11')]()]+'],\x20getAdminUser\x20crm',_0x5151d0);_0x4ad04f(_0x5151d0);})[_0x8381('0x12')](function(_0x12bfc1){logger[_0x8381('0x13')]('['+[_0x3d6b41[_0x8381('0x11')]()]+']',_0x12bfc1['message']);_0xb16dc3(_0x12bfc1['message']);});});}function getUser(_0x442aca,_0x5381ff,_0x115bbd,_0x4ca407,_0x3ca70a){return function(_0x5f3893){logger[_0x8381('0x10')]('['+[_0x442aca[_0x8381('0x11')]()]+_0x8381('0x14'),_0x5f3893);return new Promise(function(_0x1d79a1,_0x5a0e43){if(intUtil[_0x8381('0x15')](_0x5f3893[_0x8381('0x16')])){var _0x167192={'method':_0x8381('0xa'),'uri':_0x115bbd+_0x8381('0x17')+_0x5f3893['userEmail']+'&'+_0x4ca407+'&'+_0x3ca70a,'auth':_0x5381ff,'json':!![]};logger[_0x8381('0x10')]('['+[_0x442aca[_0x8381('0x11')]()]+_0x8381('0x18'),_0x167192);return rp(_0x167192)['then'](function(_0x557ba6){logger['info']('['+[_0x442aca['toUpperCase']()]+_0x8381('0x19'),_0x557ba6);if(_0x557ba6[_0x8381('0xd')]['length']>0x0&&String(_0x557ba6[_0x8381('0xd')][0x0]['active'])==='true'){_0x5f3893[_0x8381('0x1a')]=_0x557ba6[_0x8381('0xd')][0x0][_0x8381('0xf')];}else{_0x5f3893['userId']=_0x5f3893[_0x8381('0xe')];_0x5f3893[_0x8381('0x16')]=_0x5f3893[_0x8381('0x1b')];}logger[_0x8381('0x10')]('['+[_0x442aca[_0x8381('0x11')]()]+_0x8381('0x1c'),_0x5f3893);_0x1d79a1(_0x5f3893);})[_0x8381('0x12')](function(_0x53f656){logger['error']('['+[_0x442aca['toUpperCase']()]+']',_0x53f656[_0x8381('0x1d')]);_0x5a0e43(_0x53f656['message']);});}else{logger['info']('['+[_0x442aca[_0x8381('0x11')]()]+']\x20using\x20admin\x20profile');_0x5f3893['userId']=_0x5f3893[_0x8381('0xe')];_0x5f3893[_0x8381('0x16')]=_0x5f3893['adminEmail'];_0x1d79a1(_0x5f3893);}});};}function createEndUser(_0x41df53,_0x4f33e2,_0x54ed3c,_0x47601d,_0x3fc113){logger[_0x8381('0x10')]('['+[_0x41df53['toUpperCase']()]+_0x8381('0x1e'),_0x54ed3c);return new Promise(function(_0x3eed11,_0x32d03a){var _0x4851de={'method':'POST','uri':_0x47601d+'sys_user?'+_0x3fc113,'body':{'user_name':_0x54ed3c['endUserNumber'],'roles':_0x8381('0x1f'),'first_name':_0x54ed3c['endUserNumber'],'active':_0x8381('0x20'),'date_format':_0x8381('0x21'),'phone':_0x54ed3c[_0x8381('0x22')]},'auth':_0x4f33e2,'json':!![]};return rp(_0x4851de)[_0x8381('0xc')](function(_0x274361){logger['info']('['+[_0x41df53[_0x8381('0x11')]()]+_0x8381('0x23'),_0x274361['result']);_0x54ed3c['endUserId']=_0x274361[_0x8381('0xd')][_0x8381('0xf')];_0x3eed11(_0x54ed3c);})[_0x8381('0x12')](function(_0xaa586e){logger[_0x8381('0x13')]('['+[_0x41df53['toUpperCase']()]+']',_0xaa586e[_0x8381('0x1d')]);_0x32d03a(_0xaa586e[_0x8381('0x1d')]);});});}function getEndUser(_0x36b449,_0x5e9b15,_0x21b42c,_0x2be35b,_0x46532d){return function(_0x49e7df){logger['info']('['+[_0x36b449[_0x8381('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x49e7df);return new Promise(function(_0x3ac13f,_0xe93fe3){var _0x27877d={'method':'GET','uri':_0x21b42c+_0x8381('0x24')+_0x49e7df[_0x8381('0x22')]+'&'+_0x2be35b+'&'+_0x46532d,'auth':_0x5e9b15,'json':!![]};return rp(_0x27877d)[_0x8381('0xc')](function(_0x161464){if(_0x161464[_0x8381('0xd')]['length']>0x0){_0x49e7df[_0x8381('0x25')]=_0x161464[_0x8381('0xd')][0x0]['sys_id'];logger[_0x8381('0x10')]('['+[_0x36b449['toUpperCase']()]+_0x8381('0x26'),_0x49e7df);_0x3ac13f(_0x49e7df);}else{return createEndUser(_0x36b449,_0x5e9b15,_0x49e7df,_0x21b42c,_0x2be35b)['then'](function(_0x4dd337){logger[_0x8381('0x10')]('['+[_0x36b449[_0x8381('0x11')]()]+'],\x20createEndUser\x20crm',_0x4dd337);_0x3ac13f(_0x4dd337);});}})[_0x8381('0x12')](function(_0x318190){logger[_0x8381('0x13')]('['+[_0x36b449[_0x8381('0x11')]()]+']',_0x318190[_0x8381('0x1d')]);_0xe93fe3(_0x318190[_0x8381('0x1d')]);});});};}function getCustomFields(_0x137f3a,_0x20418d){var _0x5e54ec={};if(_0x137f3a[_0x8381('0x27')]>0x0){_['forEach'](_0x137f3a,function(_0x189e8f){if(_[_0x8381('0x28')](['string','picklist'],_0x189e8f[_0x8381('0x29')])&&_0x189e8f[_0x8381('0x2a')]&&!_0x189e8f[_0x8381('0x2b')]){_0x5e54ec[_0x189e8f[_0x8381('0x2a')][_0x8381('0x2c')]()]=_0x189e8f[_0x8381('0x2d')][_0x8381('0x2e')]();}else if(_[_0x8381('0x28')]([_0x8381('0x2f'),'picklist'],_0x189e8f[_0x8381('0x29')])&&_0x189e8f[_0x8381('0x30')]&&_0x189e8f['customField']){_0x5e54ec[_0x189e8f[_0x8381('0x30')]['toLowerCase']()]=_0x189e8f['content'][_0x8381('0x2e')]();}else if(_0x189e8f[_0x8381('0x29')]===_0x8381('0x31')&&_0x189e8f[_0x8381('0x32')]&&_0x189e8f[_0x8381('0x30')]&&_0x189e8f[_0x8381('0x2b')]){_0x5e54ec[_0x189e8f['idField'][_0x8381('0x2c')]()]=_0x20418d[_0x189e8f[_0x8381('0x32')]][_0x8381('0x2e')]();}else if(_0x189e8f[_0x8381('0x29')]==='customVariable'&&_0x189e8f[_0x8381('0x33')]&&_0x189e8f[_0x8381('0x33')][_0x8381('0x34')]&&_0x189e8f[_0x8381('0x30')]&&_0x189e8f[_0x8381('0x2b')]){_0x5e54ec[_0x189e8f[_0x8381('0x30')][_0x8381('0x2c')]()]=_0x20418d[_0x189e8f['Variable']['name'][_0x8381('0x2c')]()][_0x8381('0x2e')]();}});}return _0x5e54ec;}function getTicket(_0x40f609,_0x309f22,_0x13e8a3,_0x5cbe82,_0x3baee0,_0x4d51d5){return function(_0x5db8d9){logger[_0x8381('0x10')]('['+[_0x40f609[_0x8381('0x11')]()]+']\x20getTicket\x20input\x20crm',_0x5db8d9);return new Promise(function(_0x371a1d,_0xd302e5){var _0x417c31=_0x40f609[_0x8381('0x2c')]()===_0x8381('0x35')?_0x5db8d9[_0x8381('0x1a')]:_0x5db8d9[_0x8381('0x25')];var _0x24255b={'method':_0x8381('0x36'),'uri':_0x13e8a3+_0x8381('0x37')+'?'+_0x4d51d5,'body':Object[_0x8381('0x38')]({},{'active':'true','caller_id':_0x417c31,'assigned_to':_0x5db8d9[_0x8381('0x1a')],'short_description':intUtil[_0x8381('0x39')](_0x5cbe82[_0x8381('0x3a')],_0x3baee0,'\x20'),'description':intUtil[_0x8381('0x39')](_0x5cbe82['Descriptions'],_0x3baee0,'\x0a')},getCustomFields(_0x5cbe82['Fields'],_0x3baee0)),'auth':_0x309f22,'json':!![]};return rp(_0x24255b)[_0x8381('0xc')](function(_0x5ecf8f){logger['info']('['+[_0x40f609[_0x8381('0x11')]()]+_0x8381('0x3b'),_0x5ecf8f[_0x8381('0xd')]);_0x5db8d9[_0x8381('0x3c')]=_0x5ecf8f[_0x8381('0xd')]['sys_id'];_0x5db8d9[_0x8381('0x3d')]=_0x5ecf8f[_0x8381('0xd')][_0x8381('0x3e')];logger['info']('['+[_0x40f609[_0x8381('0x11')]()]+_0x8381('0x3f'),_0x5db8d9);_0x371a1d(_0x5db8d9);})[_0x8381('0x12')](function(_0x2874b1){logger[_0x8381('0x13')]('['+[_0x40f609['toUpperCase']()]+']',_0x2874b1[_0x8381('0x1d')]);_0xd302e5(_0x2874b1[_0x8381('0x1d')]);});});};}function createRemoteTag(_0x320bba,_0x134fcd,_0x3a4426,_0x9d605d){return new Promise(function(_0x39d155,_0x4c614c){var _0x47ea8d={'method':_0x8381('0x36'),'uri':_0x3a4426+_0x8381('0x40')+'?'+_0x9d605d,'body':{'short_description':_0x320bba,'global':!![],'active':!![],'name':_0x320bba},'auth':_0x134fcd,'json':!![]};return rp(_0x47ea8d)[_0x8381('0xc')](function(_0x5d303c){var _0x223ee1=_0x5d303c[_0x8381('0xd')][_0x8381('0xf')];_0x39d155(_0x223ee1);});});}function getRemoteTag(_0x3c928f,_0x58350f,_0x2e92fe,_0x5b3061,_0x373d3e){return new Promise(function(_0x5ec2a1,_0xd4c06b){var _0x294b3b={'method':_0x8381('0xa'),'uri':_0x2e92fe+_0x8381('0x40')+_0x8381('0x41')+_0x3c928f+'&'+_0x5b3061,'auth':_0x58350f,'json':!![]};return rp(_0x294b3b)[_0x8381('0xc')](function(_0xbc4182){if(_0xbc4182[_0x8381('0xd')][_0x8381('0x27')]>0x0){var _0xf04657=_0xbc4182[_0x8381('0xd')][0x0]['sys_id'];_0x5ec2a1(_0xf04657);}else{return createRemoteTag(_0x3c928f,_0x58350f,_0x2e92fe,_0x5b3061)[_0x8381('0xc')](function(_0x2ccb2e){_0x5ec2a1(_0x2ccb2e);});}});});}function assignTagToIncident(_0x1ae026,_0x43773b,_0x4fa198,_0xd99c93,_0x410856){return new Promise(function(_0x242a25,_0x374981){var _0x28f9c4={'method':_0x8381('0x36'),'uri':_0x4fa198+_0x8381('0x42')+'?'+_0x410856,'body':{'label':_0x1ae026,'table':_0x8381('0x37'),'id_type':_0x8381('0x43'),'table_key':_0xd99c93[_0x8381('0x3c')],'title':_0x8381('0x44')+_0xd99c93[_0x8381('0x3d')],'id_display':_0xd99c93[_0x8381('0x3d')]},'auth':_0x43773b,'json':!![]};return rp(_0x28f9c4)[_0x8381('0xc')](function(_0x9afb2e){_0x242a25();})['catch'](function(){_0x242a25();});});}function manageTags(_0x3efdb8,_0x1f341f,_0x3a3877,_0x798b5d,_0xaacb2a,_0x4b96c4,_0x3dee17){return new Promise(function(_0x1e68b4,_0x2851e3){var _0x3013f1=[];_0x1f341f[_0x8381('0x45')](function(_0x1e73fd){_0x3013f1[_0x8381('0x46')](getRemoteTag(_0x1e73fd,_0x3a3877,_0x798b5d,_0x4b96c4,_0x3dee17));});return Promise[_0x8381('0x47')](_0x3013f1)[_0x8381('0xc')](function(_0x30a22a){if(_0x30a22a['length']){logger['info']('['+[_0x3efdb8['toUpperCase']()]+_0x8381('0x48'),_0x30a22a);var _0xa9d945=[];_0x30a22a[_0x8381('0x45')](function(_0x50e88d){_0xa9d945['push'](assignTagToIncident(_0x50e88d,_0x3a3877,_0x798b5d,_0xaacb2a,_0x4b96c4));});return Promise[_0x8381('0x47')](_0xa9d945)[_0x8381('0xc')](function(){_0x1e68b4();})[_0x8381('0x12')](function(){_0x1e68b4();});}else{_0x1e68b4();}});});}function getTags(_0x4fa19b,_0x489792,_0x287bcb,_0x889b3a,_0x452932,_0x301cc5){return function(_0x25d492){return new Promise(function(_0x462afd,_0x24f332){var _0x11f099=[];var _0x1a4fb4=_0x889b3a[_0x8381('0x49')];if(_0x1a4fb4&&_0x1a4fb4[_0x8381('0x27')]>0x0){_0x11f099=_[_0x8381('0x4a')](_0x1a4fb4,_0x8381('0x34'));}if(_0x11f099[_0x8381('0x27')]>0x0){return manageTags(_0x4fa19b,_0x11f099,_0x489792,_0x287bcb,_0x25d492,_0x452932,_0x301cc5)[_0x8381('0xc')](function(){_0x462afd(_0x25d492);});}else{_0x462afd(_0x25d492);}});};}function emit(_0x4d698c,_0x46bf1c,_0xfc1afa){var _0x2d192d=_0x8381('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x8381('0x4c')+'%255EORDERBYDESCnumber';var _0x3c45c2={'uri':_0x4d698c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0xfc1afa+_0x2d192d};io['to'](util['format'](_0x8381('0x4d'),_0x46bf1c))[_0x8381('0x4e')](_0x8381('0x4f'),_0x3c45c2);}exports['cs']=function(_0x34116f,_0x5c5ea4,_0x3d2918,_0x397c63,_0x153f33,_0x5c4f8e,_0x12608e,_0xefe227){var _0x422a24={};var _0x56be03={'user':_0x5c4f8e[_0x8381('0x50')],'pass':_0x5c4f8e[_0x8381('0x51')]};var _0x45979c=_0x8381('0x52');var _0x21bb59='sysparm_display_value=true';_0x5c4f8e[_0x8381('0x53')]=intUtil[_0x8381('0x54')](_0x5c4f8e['remoteUri']);_0x5c4f8e['serverUrl']=intUtil['stripTrailingSlash'](_0x5c4f8e[_0x8381('0x55')]);var _0x39516f=util[_0x8381('0x56')](_0x8381('0x57'),_0x5c4f8e[_0x8381('0x53')]);_0x422a24[_0x8381('0x16')]=!_[_0x8381('0x58')](_0x397c63)?_0x397c63[_0x8381('0x59')]:null;_0x422a24['adminEmail']=_0x5c4f8e['email'];_0x422a24['endUserNumber']=_0xefe227[_0x8381('0x2c')]()==='outbound'?_0x5c5ea4[_0x8381('0x5a')]:_0x5c5ea4['calleridnum'];_0x422a24[_0x8381('0x5b')]=_0xefe227===_0x8381('0x5c')||_0xefe227===_0x8381('0x5d')?'queue':_0x8381('0x35');var _0x2c3448=util[_0x8381('0x56')](_0x8381('0x5e'),_0x5c4f8e['serverUrl'],_0x5c5ea4['uniqueid'],md5(_0x5c5ea4[_0x8381('0x5f')]));if(_0x153f33&&_0x153f33[_0x8381('0x60')]){logger[_0x8381('0x10')](_0x8381('0x61'),_0x8381('0x62'));_0x5c5ea4[_0x8381('0x63')]=_0x2c3448;}else if(_0x12608e&&_0x12608e[_0x8381('0x64')]&&_0x12608e[_0x8381('0x64')]!==_0x8381('0x65')){logger['info'](_0x8381('0x66'),'Recording\x20is\x20enabled!');_0x5c5ea4[_0x8381('0x63')]=_0x2c3448;}else{_0x5c5ea4[_0x8381('0x63')]='';}return getAdminUser(_0xefe227,_0x56be03,_0x422a24,_0x39516f,_0x21bb59,_0x45979c)[_0x8381('0xc')](getUser(_0xefe227,_0x56be03,_0x39516f,_0x21bb59,_0x45979c))[_0x8381('0xc')](getEndUser(_0xefe227,_0x56be03,_0x39516f,_0x21bb59,_0x45979c))['then'](getTicket(_0xefe227,_0x56be03,_0x39516f,_0x3d2918,_0x5c5ea4,_0x21bb59))[_0x8381('0xc')](function(_0x22a0f9){logger[_0x8381('0x10')](util[_0x8381('0x56')](_0x8381('0x67'),_0x22a0f9[_0x8381('0x3c')]));logger[_0x8381('0x10')](util['format'](_0x8381('0x68'),_0xefe227));if(_0xefe227!=='unmanaged'){logger['info']('['+[_0xefe227[_0x8381('0x11')]()]+']',_0x8381('0x69'));emit(_0x5c4f8e[_0x8381('0x53')],_0x397c63[_0x8381('0x34')],_0x22a0f9[_0x8381('0x3c')]);}})[_0x8381('0x12')](function(_0x3d3d17){logger[_0x8381('0x13')]('['+[_0xefe227[_0x8381('0x11')]()]+_0x8381('0x6a'),util[_0x8381('0x6b')](_0x3d3d17,{'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 3fa21d3..df086dd 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 _0xbe22=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','error','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','lastevent','isNil','The\x20User\x20ID\x20is:','calleridname','Fields','toUpperCase','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','merge','map','type','string','customField','nameField','toLowerCase','custom_fields','content','variable','customVariable','Variable','POST','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0xe809fd,_0x1a654b){var _0x5a24bd=function(_0xf08894){while(--_0xf08894){_0xe809fd['push'](_0xe809fd['shift']());}};_0x5a24bd(++_0x1a654b);}(_0xbe22,0x189));var _0x2be2=function(_0x2036a3,_0x10ce5a){_0x2036a3=_0x2036a3-0x0;var _0xf7f65e=_0xbe22[_0x2036a3];return _0xf7f65e;};'use strict';var _=require('lodash');var rp=require(_0x2be2('0x0'));var BPromise=require(_0x2be2('0x1'));var md5=require('md5');var util=require(_0x2be2('0x2'));var Redis=require(_0x2be2('0x3'));var intUtil=require(_0x2be2('0x4'));var config=require(_0x2be2('0x5'));var logger=require(_0x2be2('0x6'))('sugarcrm');config[_0x2be2('0x7')]=_[_0x2be2('0x8')](config[_0x2be2('0x7')],{'host':_0x2be2('0x9'),'port':0x18eb});var io=require(_0x2be2('0xa'))(new Redis(config[_0x2be2('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x3bb958,_0x15730f,_0x5bddf0){io['to'](_0x3bb958)[_0x2be2('0xb')](_0x15730f,_0x5bddf0);}function getTicket(_0x1904e1,_0x3f6435,_0x5b92e8,_0x5e65e7,_0x33b46e,_0x87495b,_0x9888e1,_0xbc70ec){logger[_0x2be2('0xc')](_0x2be2('0xd'));var _0x37ad71=new Date();var _0x454b88=[{'name':_0x2be2('0xe'),'value':intUtil[_0x2be2('0xf')](_0x5e65e7['Subjects'],_0x33b46e,'\x20')},{'name':_0x2be2('0x10'),'value':_0x3f6435['id']},{'name':_0x2be2('0x11'),'value':_0x3f6435['id']},{'name':_0x2be2('0x12'),'value':intUtil[_0x2be2('0xf')](_0x5e65e7[_0x2be2('0x13')],_0x33b46e,'\x0a')},{'name':_0x2be2('0x14'),'value':_0x37ad71[_0x2be2('0x15')]()['slice'](0x0,0x13)[_0x2be2('0x16')]('T','\x20')},{'name':_0x2be2('0x17'),'value':'0'},{'name':_0x2be2('0x18'),'value':'15'},{'name':_0x2be2('0x19'),'value':_0x5b92e8['id']},{'name':_0x2be2('0x1a'),'value':'Contacts'},{'name':_0x2be2('0x1b'),'value':_0x5b92e8[_0x2be2('0xe')]},{'name':_0x2be2('0x1c'),'value':_0xbc70ec}];if(_0x87495b[_0x2be2('0x1d')]){_[_0x2be2('0x1e')](_0x87495b,function(_0x558dd4){if(_0x33b46e[_0x558dd4[_0x2be2('0x1f')]]){_0x454b88[_0x2be2('0x20')]({'name':_0x558dd4[_0x2be2('0x21')],'value':_0x33b46e[_0x558dd4[_0x2be2('0x1f')]]});}});}return request({'form':{'method':_0x2be2('0x22'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0x9888e1['id'],'module_name':_0x2be2('0x25'),'name_value_list':_0x454b88})}});}function getAuth(_0x50c464){return util['format'](_0x2be2('0x26'),new Buffer(_0x50c464[_0x2be2('0x27')]+':X')[_0x2be2('0x28')](_0x2be2('0x29')));}function getServerInfo(_0x502d21){return request({'form':{'method':_0x2be2('0x2a'),'input_type':_0x2be2('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x502d21['id']})}});}function getUser(_0x20023a,_0xeb6d8f,_0x31d924){if(!_['isNil'](_0xeb6d8f)){logger[_0x2be2('0xc')](_0x2be2('0x2b'),_0xeb6d8f);return request({'form':{'method':_0x2be2('0x2c'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0x31d924['id'],'module_name':_0x2be2('0x2d'),'query':util[_0x2be2('0x2e')](_0x2be2('0x2f'),_0xeb6d8f),'order_by':'','offset':'0','select_fields':['id','name',_0x2be2('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2be2('0x31')](function(_0x4147c2){if(_0x4147c2[_0x2be2('0x32')][_0x2be2('0x1d')]){var _0x2d395f=_[_0x2be2('0x33')](_0x4147c2[_0x2be2('0x32')],function(_0x492247){return _0x492247[_0x2be2('0x34')][_0x2be2('0x30')][_0x2be2('0x35')]===_0xeb6d8f;});if(_0x2d395f){logger['info'](_0x2be2('0x36'));return BPromise[_0x2be2('0x37')]({'id':_0x2d395f['name_value_list']['id'][_0x2be2('0x35')],'name':_0x2d395f[_0x2be2('0x34')]['name'][_0x2be2('0x35')]});}}logger[_0x2be2('0xc')](_0x2be2('0x38'));return BPromise[_0x2be2('0x37')]({'id':_0x31d924[_0x2be2('0x34')]['user_id'][_0x2be2('0x35')],'name':_0x31d924[_0x2be2('0x34')][_0x2be2('0x30')][_0x2be2('0x35')]});});}else{logger[_0x2be2('0xc')](_0x2be2('0x39'));return BPromise[_0x2be2('0x37')]({'id':_0x31d924[_0x2be2('0x34')]['user_id'][_0x2be2('0x35')],'name':_0x31d924[_0x2be2('0x34')][_0x2be2('0x30')][_0x2be2('0x35')]});}}function getEndUser(_0x3fc591,_0x4db8ae,_0x4888b4,_0x30c4e7){logger['info'](_0x2be2('0x3a'),_0x4888b4);return request({'form':{'method':_0x2be2('0x2c'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0x30c4e7['id'],'module_name':_0x2be2('0x3b'),'query':util[_0x2be2('0x2e')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x4888b4),'order_by':'','offset':'0','select_fields':['id','name',_0x2be2('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2be2('0x31')](function(_0x5ec5b3){if(_0x5ec5b3[_0x2be2('0x32')]['length']){var _0x27d771=_['find'](_0x5ec5b3[_0x2be2('0x32')],function(_0x514e30){return _0x514e30[_0x2be2('0x34')]['phone_home'][_0x2be2('0x35')]===_0x4888b4;});if(_0x27d771){logger[_0x2be2('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x27d771[_0x2be2('0x34')]['id'][_0x2be2('0x35')],'name':_0x27d771[_0x2be2('0x34')][_0x2be2('0xe')][_0x2be2('0x35')],'phone':_0x27d771['name_value_list'][_0x2be2('0x3c')]['value']});}}else{logger[_0x2be2('0xc')](_0x2be2('0x3d'));return request({'form':{'method':_0x2be2('0x22'),'input_type':_0x2be2('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x30c4e7['id'],'module_name':_0x2be2('0x3b'),'name_value_list':[{'name':_0x2be2('0x3e'),'value':_0x4db8ae!==_0x2be2('0x3f')?_0x4db8ae:util[_0x2be2('0x2e')](_0x2be2('0x40'),_0x4888b4)},{'name':_0x2be2('0x3c'),'value':_0x4888b4}]})}})[_0x2be2('0x31')](function(_0x633ea1){logger[_0x2be2('0xc')]('Enduser\x20created.');return BPromise[_0x2be2('0x37')]({'id':_0x633ea1['id'],'name':_0x633ea1['entry_list']['first_name'][_0x2be2('0x35')],'phone':_0x633ea1[_0x2be2('0x32')][_0x2be2('0x3c')][_0x2be2('0x35')]});});}});}function request(_0x17ca9f){logger[_0x2be2('0x41')]('[HTTP]',JSON[_0x2be2('0x24')](_0x17ca9f));return rp(_[_0x2be2('0x42')](def,_0x17ca9f));}function getTags(_0x5316e7,_0x1b99a0){var _0x141f5f=[];if(_0x5316e7&&_0x5316e7[_0x2be2('0x1d')]>0x0){_0x141f5f=_[_0x2be2('0x43')](_0x5316e7,_0x1b99a0);}return _0x141f5f;}function getCustomFields(_0x424107,_0x849d7f){var _0x500d04=[];var _0x605490={'custom_fields':[]};if(_0x424107[_0x2be2('0x1d')]>0x0){_[_0x2be2('0x1e')](_0x424107,function(_0x12e212){if(_0x12e212[_0x2be2('0x44')]===_0x2be2('0x45')&&_0x12e212['nameField']&&!_0x12e212[_0x2be2('0x46')]){_0x605490[_0x12e212[_0x2be2('0x47')][_0x2be2('0x48')]()]=_0x12e212['content'][_0x2be2('0x28')]();}else if(_0x12e212[_0x2be2('0x44')]===_0x2be2('0x45')&&_0x12e212['idField']&&_0x12e212[_0x2be2('0x46')]){_0x605490[_0x2be2('0x49')][_0x2be2('0x20')]({'id':_0x12e212['idField'],'value':_0x12e212[_0x2be2('0x4a')][_0x2be2('0x28')]()});}else if(_0x12e212[_0x2be2('0x44')]===_0x2be2('0x4b')&&_0x12e212[_0x2be2('0x1f')]&&_0x12e212['idField']&&_0x12e212[_0x2be2('0x46')]){_0x849d7f[_0x12e212[_0x2be2('0x1f')]]&&_0x605490['custom_fields']['push']({'id':_0x12e212[_0x2be2('0x21')],'value':_0x849d7f[_0x12e212[_0x2be2('0x1f')]][_0x2be2('0x28')]()});}else if(_0x12e212['type']===_0x2be2('0x4c')&&_0x12e212[_0x2be2('0x4d')]&&_0x12e212[_0x2be2('0x4d')][_0x2be2('0xe')]&&_0x12e212[_0x2be2('0x21')]&&_0x12e212[_0x2be2('0x46')]){_0x849d7f[_0x12e212[_0x2be2('0x4d')]['name'][_0x2be2('0x48')]()]&&_0x605490[_0x2be2('0x49')][_0x2be2('0x20')]({'id':_0x12e212['idField'],'value':_0x849d7f[_0x12e212[_0x2be2('0x4d')][_0x2be2('0xe')][_0x2be2('0x48')]()][_0x2be2('0x28')]()});}});}return _0x605490;}function getConnection(_0x2518ce){return request({'method':_0x2be2('0x4e'),'form':{'method':_0x2be2('0x4f'),'input_type':_0x2be2('0x23'),'response_type':_0x2be2('0x23'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2518ce[_0x2be2('0x50')],'password':_0x2518ce['password'],'encryption':_0x2be2('0x51')},'application':_0x2be2('0x52')})}})[_0x2be2('0x31')](function(_0x5a0422){var _0x3947c9=_0x5a0422;if(_0x3947c9['id']){def[_0x2be2('0x53')]=_0x3947c9['id'];return BPromise['resolve'](_0x3947c9);}else{throw new Error(util[_0x2be2('0x2e')]('Account\x20%d\x20is\x20not\x20valid',_0x2518ce['id']));}});}function setRelationship(_0xad5e58,_0x251f93,_0x2c63af,_0x16f18d){return request({'form':{'method':_0x2be2('0x54'),'input_type':'JSON','response_type':_0x2be2('0x23'),'rest_data':JSON[_0x2be2('0x24')]({'session':_0xad5e58['id'],'module_name':_0x2be2('0x25'),'module_id':_0x2c63af['id'],'link_field_name':_0x16f18d,'related_ids':[_0x251f93['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2be2('0x55')]=function(_0x2428d8,_0x180d0b,_0x55b2d7,_0x5e3aca,_0x10c658,_0x38d773){var _0x5c0bac,_0x594fb9,_0x392fe2,_0x28a9ad;_0x38d773['remoteUri']=intUtil[_0x2be2('0x56')](_0x38d773[_0x2be2('0x57')]);_0x38d773['serverUrl']=intUtil[_0x2be2('0x56')](_0x38d773[_0x2be2('0x58')]);def['uri']=util['format'](_0x2be2('0x59'),_0x38d773[_0x2be2('0x57')]);if(_0x10c658&&_0x10c658[_0x2be2('0x5a')]){logger[_0x2be2('0xc')]('[QUEUE]',_0x2be2('0x5b'));_0x180d0b[_0x2be2('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38d773['serverUrl'],_0x180d0b['uniqueid'],md5(_0x180d0b[_0x2be2('0x5d')]));}else{_0x180d0b[_0x2be2('0x5c')]='';}return getConnection(_0x38d773)['then'](function(_0x48b16e){_0x28a9ad=_0x48b16e;return getUser(_0x38d773,_0x5e3aca[_0x2be2('0xe')],_0x28a9ad);})[_0x2be2('0x31')](function(_0x51e69a){_0x5c0bac=_0x51e69a;logger['info']('The\x20User\x20ID\x20is:',_0x5c0bac['id']);return getEndUser(_0x38d773,_0x180d0b['calleridname'],_0x180d0b[_0x2be2('0x5e')],_0x28a9ad);})[_0x2be2('0x31')](function(_0x52ef07){_0x594fb9=_0x52ef07;logger[_0x2be2('0xc')](_0x2be2('0x5f'),_0x594fb9['id']);return getTicket(_0x38d773,_0x5c0bac,_0x594fb9,_0x55b2d7,_0x180d0b,_0x55b2d7['Fields'],_0x28a9ad,_0x2be2('0x60'));})['then'](function(_0x260aad){_0x392fe2=_0x260aad;logger[_0x2be2('0xc')]('Ticket\x20created!');logger[_0x2be2('0xc')](_0x2be2('0x61'),_0x392fe2['id']);return setRelationship(_0x28a9ad,_0x5c0bac,_0x392fe2,_0x2be2('0x62'));})[_0x2be2('0x31')](function(){return setRelationship(_0x28a9ad,_0x594fb9,_0x392fe2,_0x2be2('0x63'));})[_0x2be2('0x31')](function(){return getServerInfo(_0x28a9ad);})[_0x2be2('0x31')](function(_0x5169d8){var _0x1837c9=parseInt(_0x5169d8[_0x2be2('0x64')][_0x2be2('0x65')](0x0));var _0x577842=util[_0x2be2('0x2e')](_0x2be2('0x66'),_0x38d773['remoteUri'],_0x392fe2['id']);if(_0x1837c9>0x6){_0x577842=util[_0x2be2('0x2e')](_0x2be2('0x67'),_0x38d773['remoteUri'],_0x392fe2['id']);}logger[_0x2be2('0xc')](_0x2be2('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2be2('0x2e')](_0x2be2('0x69'),_0x5e3aca[_0x2be2('0xe')]),_0x2be2('0x6a'),{'uri':_0x577842});})['catch'](function(_0x1a4623){logger[_0x2be2('0x6b')](_0x2be2('0x68'),JSON['stringify'](_0x1a4623));});};exports[_0x2be2('0x6c')]=function(_0x2a0775,_0xd69259,_0x2cffcb,_0x423b8d,_0x476d8f,_0x186777,_0x3378a0){var _0x31ecd7,_0x659870,_0x57ff25,_0x289959;_0x186777['remoteUri']=intUtil[_0x2be2('0x56')](_0x186777[_0x2be2('0x57')]);_0x186777[_0x2be2('0x58')]=intUtil[_0x2be2('0x56')](_0x186777[_0x2be2('0x58')]);def[_0x2be2('0x6d')]=util['format']('%s/service/v4_1/rest.php',_0x186777[_0x2be2('0x57')]);if(_0x3378a0&&_0x3378a0[_0x2be2('0x6e')]&&_0x3378a0[_0x2be2('0x6e')]!==_0x2be2('0x6f')){logger['info'](_0x2be2('0x70'),'Recording\x20is\x20enabled!');_0xd69259[_0x2be2('0x5c')]=util[_0x2be2('0x2e')](_0x2be2('0x71'),_0x186777[_0x2be2('0x58')],_0xd69259['uniqueid'],md5(_0xd69259[_0x2be2('0x5d')]));}return getConnection(_0x186777)[_0x2be2('0x31')](function(_0x423ef2){_0x289959=_0x423ef2;return getUser(_0x186777,_0x423b8d['name'],_0x289959);})['then'](function(_0x4812bd){_0x31ecd7=_0x4812bd;logger['info']('The\x20User\x20ID\x20is:',_0x31ecd7['id']);return getEndUser(_0x186777,_0xd69259[_0x2be2('0x72')],_0xd69259['destcalleridnum'],_0x289959);})[_0x2be2('0x31')](function(_0x546968){_0x659870=_0x546968;logger[_0x2be2('0xc')](_0x2be2('0x5f'),_0x659870['id']);return getTicket(_0x186777,_0x31ecd7,_0x659870,_0x2cffcb,_0xd69259,_0x2cffcb['Fields'],_0x289959,_0x2be2('0x73'));})['then'](function(_0x22fad2){_0x57ff25=_0x22fad2;logger[_0x2be2('0xc')]('Ticket\x20created!');logger[_0x2be2('0xc')](_0x2be2('0x61'),_0x57ff25['id']);return setRelationship(_0x289959,_0x31ecd7,_0x57ff25,_0x2be2('0x62'));})['then'](function(){return setRelationship(_0x289959,_0x659870,_0x57ff25,'contacts');})[_0x2be2('0x31')](function(){return getServerInfo(_0x289959);})[_0x2be2('0x31')](function(_0x2cef5d){var _0x4310ba=parseInt(_0x2cef5d[_0x2be2('0x64')]['charAt'](0x0));var _0x41ad04=util[_0x2be2('0x2e')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x186777[_0x2be2('0x57')],_0x57ff25['id']);if(_0x4310ba>0x6){_0x41ad04=util[_0x2be2('0x2e')](_0x2be2('0x67'),_0x186777[_0x2be2('0x57')],_0x57ff25['id']);}logger[_0x2be2('0xc')](_0x2be2('0x70'),_0x2be2('0x74'));emit(util[_0x2be2('0x2e')]('user:%s',_0x423b8d[_0x2be2('0xe')]),_0x2be2('0x6a'),{'uri':_0x41ad04});})[_0x2be2('0x75')](function(_0x2550d1){logger[_0x2be2('0x6b')](_0x2be2('0x70'),JSON['stringify'](_0x2550d1));});};exports['unmanaged']=function(_0x28aeaa,_0x5c01cb,_0x45975a,_0xb7f80a,_0x33bd9b,_0xa5aae6){var _0x1d626f,_0xde7f79,_0x1d5363,_0x2f1f5e;_0xa5aae6[_0x2be2('0x57')]=intUtil[_0x2be2('0x56')](_0xa5aae6[_0x2be2('0x57')]);_0xa5aae6[_0x2be2('0x58')]=intUtil['stripTrailingSlash'](_0xa5aae6[_0x2be2('0x58')]);def[_0x2be2('0x6d')]=util['format'](_0x2be2('0x59'),_0xa5aae6['remoteUri']);if(_0x33bd9b&&_0x33bd9b[_0x2be2('0x5a')]){logger[_0x2be2('0xc')]('['+_0x5c01cb[_0x2be2('0x76')]['toUpperCase']()+']',_0x2be2('0x5b'));_0x5c01cb[_0x2be2('0x5c')]=util[_0x2be2('0x2e')](_0x2be2('0x71'),_0xa5aae6['serverUrl'],_0x5c01cb[_0x2be2('0x5d')],md5(_0x5c01cb[_0x2be2('0x5d')]));}else{_0x5c01cb[_0x2be2('0x5c')]='';}return getConnection(_0xa5aae6)[_0x2be2('0x31')](function(_0x164892){_0x2f1f5e=_0x164892;if(!_[_0x2be2('0x77')](_0xb7f80a)){return getUser(_0xa5aae6,_0xb7f80a[_0x2be2('0xe')],_0x2f1f5e);}else{return getUser(_0xa5aae6,null,_0x2f1f5e);}})[_0x2be2('0x31')](function(_0x220565){_0x1d626f=_0x220565;logger[_0x2be2('0xc')](_0x2be2('0x78'),_0x1d626f['id']);return getEndUser(_0xa5aae6,_0x5c01cb[_0x2be2('0x79')],_0x5c01cb[_0x2be2('0x5e')],_0x2f1f5e);})['then'](function(_0x5a3e54){_0xde7f79=_0x5a3e54;logger[_0x2be2('0xc')](_0x2be2('0x5f'),_0xde7f79['id']);return getTicket(_0xa5aae6,_0x1d626f,_0xde7f79,_0x45975a,_0x5c01cb,_0x45975a[_0x2be2('0x7a')],_0x2f1f5e,_0x2be2('0x60'));})[_0x2be2('0x31')](function(_0x315b91){_0x1d5363=_0x315b91;logger[_0x2be2('0xc')]('Ticket\x20created!');logger[_0x2be2('0xc')](_0x2be2('0x61'),_0x1d5363['id']);return setRelationship(_0x2f1f5e,_0x1d626f,_0x1d5363,'users');})[_0x2be2('0x31')](function(){return setRelationship(_0x2f1f5e,_0xde7f79,_0x1d5363,_0x2be2('0x63'));})['then'](function(){return getServerInfo(_0x2f1f5e);})['catch'](function(_0x296ef8){logger[_0x2be2('0x6b')]('['+_0x5c01cb[_0x2be2('0x76')][_0x2be2('0x7b')]()+']',JSON[_0x2be2('0x24')](_0x296ef8));});}; \ No newline at end of file +var _0xca45=['../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','slice','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','idField','set_entry','JSON','Calls','format','apiKey','toString','base64','get_server_info','stringify','info','get_entry_list','Employees','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','customField','push','variable','variableName','custom_fields','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','catch','unmanaged','toUpperCase','isNil','lodash','bluebird','md5','util','ioredis'];(function(_0x1c3281,_0x5c69a0){var _0x27588d=function(_0x47114c){while(--_0x47114c){_0x1c3281['push'](_0x1c3281['shift']());}};_0x27588d(++_0x5c69a0);}(_0xca45,0x169));var _0x5ca4=function(_0x50c4eb,_0x5a3123){_0x50c4eb=_0x50c4eb-0x0;var _0x1bfa43=_0xca45[_0x50c4eb];return _0x1bfa43;};'use strict';var _=require(_0x5ca4('0x0'));var rp=require('request-promise');var BPromise=require(_0x5ca4('0x1'));var md5=require(_0x5ca4('0x2'));var util=require(_0x5ca4('0x3'));var Redis=require(_0x5ca4('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x5ca4('0x5'))(_0x5ca4('0x6'));config[_0x5ca4('0x7')]=_[_0x5ca4('0x8')](config[_0x5ca4('0x7')],{'host':_0x5ca4('0x9'),'port':0x18eb});var io=require(_0x5ca4('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x2dc34d,_0x3162de,_0x4aec97){io['to'](_0x2dc34d)['emit'](_0x3162de,_0x4aec97);}function getTicket(_0x365dcd,_0x54c8d4,_0x2bf736,_0x117801,_0x5c129b,_0x380d94,_0x13ed81,_0x242aed){logger['info'](_0x5ca4('0xb'));var _0x38de2a=new Date();var _0x411eda=[{'name':_0x5ca4('0xc'),'value':intUtil[_0x5ca4('0xd')](_0x117801[_0x5ca4('0xe')],_0x5c129b,'\x20')},{'name':'assigned_user_id','value':_0x54c8d4['id']},{'name':_0x5ca4('0xf'),'value':_0x54c8d4['id']},{'name':_0x5ca4('0x10'),'value':intUtil[_0x5ca4('0xd')](_0x117801[_0x5ca4('0x11')],_0x5c129b,'\x0a')},{'name':'date_start','value':_0x38de2a['toISOString']()[_0x5ca4('0x12')](0x0,0x13)['replace']('T','\x20')},{'name':_0x5ca4('0x13'),'value':'0'},{'name':_0x5ca4('0x14'),'value':'15'},{'name':'parent_id','value':_0x2bf736['id']},{'name':_0x5ca4('0x15'),'value':_0x5ca4('0x16')},{'name':_0x5ca4('0x17'),'value':_0x2bf736[_0x5ca4('0xc')]},{'name':_0x5ca4('0x18'),'value':_0x242aed}];if(_0x380d94[_0x5ca4('0x19')]){_[_0x5ca4('0x1a')](_0x380d94,function(_0x5249c4){if(_0x5c129b[_0x5249c4['variableName']]){_0x411eda['push']({'name':_0x5249c4[_0x5ca4('0x1b')],'value':_0x5c129b[_0x5249c4['variableName']]});}});}return request({'form':{'method':_0x5ca4('0x1c'),'input_type':_0x5ca4('0x1d'),'response_type':_0x5ca4('0x1d'),'rest_data':JSON['stringify']({'session':_0x13ed81['id'],'module_name':_0x5ca4('0x1e'),'name_value_list':_0x411eda})}});}function getAuth(_0x47425b){return util[_0x5ca4('0x1f')]('Basic\x20%s',new Buffer(_0x47425b[_0x5ca4('0x20')]+':X')[_0x5ca4('0x21')](_0x5ca4('0x22')));}function getServerInfo(_0x1516d3){return request({'form':{'method':_0x5ca4('0x23'),'input_type':_0x5ca4('0x1d'),'response_type':_0x5ca4('0x1d'),'rest_data':JSON[_0x5ca4('0x24')]({'session':_0x1516d3['id']})}});}function getUser(_0x518c90,_0x558a74,_0x1517b3){if(!_['isNil'](_0x558a74)){logger[_0x5ca4('0x25')]('Getting\x20agent\x20with\x20name',_0x558a74);return request({'form':{'method':_0x5ca4('0x26'),'input_type':_0x5ca4('0x1d'),'response_type':_0x5ca4('0x1d'),'rest_data':JSON[_0x5ca4('0x24')]({'session':_0x1517b3['id'],'module_name':_0x5ca4('0x27'),'query':util[_0x5ca4('0x1f')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x558a74),'order_by':'','offset':'0','select_fields':['id',_0x5ca4('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3da4e2){if(_0x3da4e2['entry_list'][_0x5ca4('0x19')]){var _0x96e060=_[_0x5ca4('0x28')](_0x3da4e2[_0x5ca4('0x29')],function(_0x4df63e){return _0x4df63e[_0x5ca4('0x2a')][_0x5ca4('0x2b')][_0x5ca4('0x2c')]===_0x558a74;});if(_0x96e060){logger[_0x5ca4('0x25')](_0x5ca4('0x2d'));return BPromise[_0x5ca4('0x2e')]({'id':_0x96e060[_0x5ca4('0x2a')]['id']['value'],'name':_0x96e060[_0x5ca4('0x2a')][_0x5ca4('0xc')][_0x5ca4('0x2c')]});}}logger['info'](_0x5ca4('0x2f'));return BPromise[_0x5ca4('0x2e')]({'id':_0x1517b3[_0x5ca4('0x2a')]['user_id'][_0x5ca4('0x2c')],'name':_0x1517b3[_0x5ca4('0x2a')][_0x5ca4('0x2b')][_0x5ca4('0x2c')]});});}else{logger[_0x5ca4('0x25')](_0x5ca4('0x30'));return BPromise[_0x5ca4('0x2e')]({'id':_0x1517b3[_0x5ca4('0x2a')][_0x5ca4('0x31')][_0x5ca4('0x2c')],'name':_0x1517b3[_0x5ca4('0x2a')][_0x5ca4('0x2b')]['value']});}}function getEndUser(_0x328c0e,_0x547b60,_0x126c6e,_0x1e83a5){logger[_0x5ca4('0x25')]('Searching\x20enduser\x20with\x20phone',_0x126c6e);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x5ca4('0x1d'),'rest_data':JSON[_0x5ca4('0x24')]({'session':_0x1e83a5['id'],'module_name':_0x5ca4('0x16'),'query':util[_0x5ca4('0x1f')](_0x5ca4('0x32'),_0x126c6e),'order_by':'','offset':'0','select_fields':['id','name',_0x5ca4('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5ca4('0x34')](function(_0xbe7b2f){if(_0xbe7b2f[_0x5ca4('0x29')][_0x5ca4('0x19')]){var _0x6b9e8a=_[_0x5ca4('0x28')](_0xbe7b2f[_0x5ca4('0x29')],function(_0x23d05a){return _0x23d05a[_0x5ca4('0x2a')][_0x5ca4('0x33')][_0x5ca4('0x2c')]===_0x126c6e;});if(_0x6b9e8a){logger[_0x5ca4('0x25')](_0x5ca4('0x35'));return BPromise[_0x5ca4('0x2e')]({'id':_0x6b9e8a[_0x5ca4('0x2a')]['id'][_0x5ca4('0x2c')],'name':_0x6b9e8a[_0x5ca4('0x2a')][_0x5ca4('0xc')][_0x5ca4('0x2c')],'phone':_0x6b9e8a[_0x5ca4('0x2a')]['phone_home'][_0x5ca4('0x2c')]});}}else{logger[_0x5ca4('0x25')](_0x5ca4('0x36'));return request({'form':{'method':_0x5ca4('0x1c'),'input_type':_0x5ca4('0x1d'),'response_type':_0x5ca4('0x1d'),'rest_data':JSON[_0x5ca4('0x24')]({'session':_0x1e83a5['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x547b60!==_0x5ca4('0x37')?_0x547b60:util[_0x5ca4('0x1f')]('Caller\x20-\x20%s',_0x126c6e)},{'name':_0x5ca4('0x33'),'value':_0x126c6e}]})}})[_0x5ca4('0x34')](function(_0x287929){logger[_0x5ca4('0x25')](_0x5ca4('0x38'));return BPromise['resolve']({'id':_0x287929['id'],'name':_0x287929[_0x5ca4('0x29')][_0x5ca4('0x39')][_0x5ca4('0x2c')],'phone':_0x287929[_0x5ca4('0x29')][_0x5ca4('0x33')][_0x5ca4('0x2c')]});});}});}function request(_0x463553){logger[_0x5ca4('0x3a')](_0x5ca4('0x3b'),JSON['stringify'](_0x463553));return rp(_[_0x5ca4('0x3c')](def,_0x463553));}function getTags(_0x18d238,_0xcd45be){var _0x5c3eee=[];if(_0x18d238&&_0x18d238[_0x5ca4('0x19')]>0x0){_0x5c3eee=_[_0x5ca4('0x3d')](_0x18d238,_0xcd45be);}return _0x5c3eee;}function getCustomFields(_0xf8004,_0x11daf2){var _0x363dd6=[];var _0x28de0e={'custom_fields':[]};if(_0xf8004['length']>0x0){_[_0x5ca4('0x1a')](_0xf8004,function(_0x5c0768){if(_0x5c0768[_0x5ca4('0x3e')]===_0x5ca4('0x3f')&&_0x5c0768[_0x5ca4('0x40')]&&!_0x5c0768['customField']){_0x28de0e[_0x5c0768['nameField'][_0x5ca4('0x41')]()]=_0x5c0768[_0x5ca4('0x42')]['toString']();}else if(_0x5c0768[_0x5ca4('0x3e')]==='string'&&_0x5c0768[_0x5ca4('0x1b')]&&_0x5c0768[_0x5ca4('0x43')]){_0x28de0e['custom_fields'][_0x5ca4('0x44')]({'id':_0x5c0768[_0x5ca4('0x1b')],'value':_0x5c0768['content'][_0x5ca4('0x21')]()});}else if(_0x5c0768[_0x5ca4('0x3e')]===_0x5ca4('0x45')&&_0x5c0768[_0x5ca4('0x46')]&&_0x5c0768[_0x5ca4('0x1b')]&&_0x5c0768[_0x5ca4('0x43')]){_0x11daf2[_0x5c0768[_0x5ca4('0x46')]]&&_0x28de0e[_0x5ca4('0x47')]['push']({'id':_0x5c0768[_0x5ca4('0x1b')],'value':_0x11daf2[_0x5c0768[_0x5ca4('0x46')]]['toString']()});}else if(_0x5c0768[_0x5ca4('0x3e')]===_0x5ca4('0x48')&&_0x5c0768[_0x5ca4('0x49')]&&_0x5c0768[_0x5ca4('0x49')]['name']&&_0x5c0768['idField']&&_0x5c0768['customField']){_0x11daf2[_0x5c0768[_0x5ca4('0x49')][_0x5ca4('0xc')]['toLowerCase']()]&&_0x28de0e[_0x5ca4('0x47')][_0x5ca4('0x44')]({'id':_0x5c0768[_0x5ca4('0x1b')],'value':_0x11daf2[_0x5c0768['Variable'][_0x5ca4('0xc')][_0x5ca4('0x41')]()][_0x5ca4('0x21')]()});}});}return _0x28de0e;}function getConnection(_0x4e3e40){return request({'method':_0x5ca4('0x4a'),'form':{'method':_0x5ca4('0x4b'),'input_type':_0x5ca4('0x1d'),'response_type':_0x5ca4('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4e3e40[_0x5ca4('0x4c')],'password':_0x4e3e40[_0x5ca4('0x4d')],'encryption':_0x5ca4('0x4e')},'application':_0x5ca4('0x4f')})}})[_0x5ca4('0x34')](function(_0x11f086){var _0x5941a4=_0x11f086;if(_0x5941a4['id']){def[_0x5ca4('0x50')]=_0x5941a4['id'];return BPromise[_0x5ca4('0x2e')](_0x5941a4);}else{throw new Error(util[_0x5ca4('0x1f')]('Account\x20%d\x20is\x20not\x20valid',_0x4e3e40['id']));}});}function setRelationship(_0x13fe67,_0x2b3765,_0x2e2b31,_0x9b09e7){return request({'form':{'method':_0x5ca4('0x51'),'input_type':'JSON','response_type':_0x5ca4('0x1d'),'rest_data':JSON['stringify']({'session':_0x13fe67['id'],'module_name':_0x5ca4('0x1e'),'module_id':_0x2e2b31['id'],'link_field_name':_0x9b09e7,'related_ids':[_0x2b3765['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5ca4('0x52')]=function(_0x1d830b,_0x4183a5,_0xf5d5c4,_0x44cb67,_0x1f709e,_0x544452){var _0x18e672,_0x5c50f6,_0x3f1f69,_0x492b34;_0x544452[_0x5ca4('0x53')]=intUtil[_0x5ca4('0x54')](_0x544452[_0x5ca4('0x53')]);_0x544452[_0x5ca4('0x55')]=intUtil[_0x5ca4('0x54')](_0x544452[_0x5ca4('0x55')]);def[_0x5ca4('0x56')]=util['format'](_0x5ca4('0x57'),_0x544452[_0x5ca4('0x53')]);if(_0x1f709e&&_0x1f709e[_0x5ca4('0x58')]){logger[_0x5ca4('0x25')](_0x5ca4('0x59'),_0x5ca4('0x5a'));_0x4183a5[_0x5ca4('0x5b')]=util[_0x5ca4('0x1f')](_0x5ca4('0x5c'),_0x544452['serverUrl'],_0x4183a5[_0x5ca4('0x5d')],md5(_0x4183a5['uniqueid']));}else{_0x4183a5['recordingURL']='';}return getConnection(_0x544452)[_0x5ca4('0x34')](function(_0x18a4b7){_0x492b34=_0x18a4b7;return getUser(_0x544452,_0x44cb67[_0x5ca4('0xc')],_0x492b34);})[_0x5ca4('0x34')](function(_0x354415){_0x18e672=_0x354415;logger[_0x5ca4('0x25')](_0x5ca4('0x5e'),_0x18e672['id']);return getEndUser(_0x544452,_0x4183a5[_0x5ca4('0x5f')],_0x4183a5[_0x5ca4('0x60')],_0x492b34);})[_0x5ca4('0x34')](function(_0x235be6){_0x5c50f6=_0x235be6;logger['info'](_0x5ca4('0x61'),_0x5c50f6['id']);return getTicket(_0x544452,_0x18e672,_0x5c50f6,_0xf5d5c4,_0x4183a5,_0xf5d5c4[_0x5ca4('0x62')],_0x492b34,_0x5ca4('0x63'));})[_0x5ca4('0x34')](function(_0x425911){_0x3f1f69=_0x425911;logger[_0x5ca4('0x25')]('Ticket\x20created!');logger[_0x5ca4('0x25')](_0x5ca4('0x64'),_0x3f1f69['id']);return setRelationship(_0x492b34,_0x18e672,_0x3f1f69,_0x5ca4('0x65'));})[_0x5ca4('0x34')](function(){return setRelationship(_0x492b34,_0x5c50f6,_0x3f1f69,_0x5ca4('0x66'));})[_0x5ca4('0x34')](function(){return getServerInfo(_0x492b34);})['then'](function(_0x541ff0){var _0x1ff33a=parseInt(_0x541ff0[_0x5ca4('0x67')]['charAt'](0x0));var _0x98adea=util[_0x5ca4('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x544452[_0x5ca4('0x53')],_0x3f1f69['id']);if(_0x1ff33a>0x6){_0x98adea=util[_0x5ca4('0x1f')](_0x5ca4('0x68'),_0x544452[_0x5ca4('0x53')],_0x3f1f69['id']);}logger[_0x5ca4('0x25')]('[QUEUE]',_0x5ca4('0x69'));emit(util[_0x5ca4('0x1f')]('user:%s',_0x44cb67[_0x5ca4('0xc')]),_0x5ca4('0x6a'),{'uri':_0x98adea});})['catch'](function(_0x41ad42){logger[_0x5ca4('0x6b')]('[QUEUE]',JSON[_0x5ca4('0x24')](_0x41ad42));});};exports[_0x5ca4('0x6c')]=function(_0x2c7ab2,_0x38612a,_0x38fb4a,_0x2682c,_0x5d16de,_0x363a45,_0x3f24ba){var _0x2666fa,_0x397d57,_0x4db5a1,_0xf5efd3;_0x363a45[_0x5ca4('0x53')]=intUtil[_0x5ca4('0x54')](_0x363a45[_0x5ca4('0x53')]);_0x363a45['serverUrl']=intUtil[_0x5ca4('0x54')](_0x363a45[_0x5ca4('0x55')]);def[_0x5ca4('0x56')]=util[_0x5ca4('0x1f')](_0x5ca4('0x57'),_0x363a45[_0x5ca4('0x53')]);if(_0x3f24ba&&_0x3f24ba['recordingFormat']&&_0x3f24ba[_0x5ca4('0x6d')]!==_0x5ca4('0x6e')){logger[_0x5ca4('0x25')](_0x5ca4('0x6f'),_0x5ca4('0x5a'));_0x38612a[_0x5ca4('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x363a45[_0x5ca4('0x55')],_0x38612a[_0x5ca4('0x5d')],md5(_0x38612a[_0x5ca4('0x5d')]));}return getConnection(_0x363a45)[_0x5ca4('0x34')](function(_0x55e36e){_0xf5efd3=_0x55e36e;return getUser(_0x363a45,_0x2682c[_0x5ca4('0xc')],_0xf5efd3);})['then'](function(_0x45f674){_0x2666fa=_0x45f674;logger['info'](_0x5ca4('0x5e'),_0x2666fa['id']);return getEndUser(_0x363a45,_0x38612a[_0x5ca4('0x70')],_0x38612a[_0x5ca4('0x71')],_0xf5efd3);})['then'](function(_0x27027e){_0x397d57=_0x27027e;logger[_0x5ca4('0x25')](_0x5ca4('0x61'),_0x397d57['id']);return getTicket(_0x363a45,_0x2666fa,_0x397d57,_0x38fb4a,_0x38612a,_0x38fb4a[_0x5ca4('0x62')],_0xf5efd3,'Outbound');})[_0x5ca4('0x34')](function(_0x3ec022){_0x4db5a1=_0x3ec022;logger[_0x5ca4('0x25')](_0x5ca4('0x72'));logger[_0x5ca4('0x25')](_0x5ca4('0x64'),_0x4db5a1['id']);return setRelationship(_0xf5efd3,_0x2666fa,_0x4db5a1,_0x5ca4('0x65'));})['then'](function(){return setRelationship(_0xf5efd3,_0x397d57,_0x4db5a1,_0x5ca4('0x66'));})[_0x5ca4('0x34')](function(){return getServerInfo(_0xf5efd3);})[_0x5ca4('0x34')](function(_0x263325){var _0xb5d3c6=parseInt(_0x263325[_0x5ca4('0x67')][_0x5ca4('0x73')](0x0));var _0x30abaf=util['format'](_0x5ca4('0x74'),_0x363a45[_0x5ca4('0x53')],_0x4db5a1['id']);if(_0xb5d3c6>0x6){_0x30abaf=util[_0x5ca4('0x1f')](_0x5ca4('0x68'),_0x363a45['remoteUri'],_0x4db5a1['id']);}logger[_0x5ca4('0x25')](_0x5ca4('0x6f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5ca4('0x1f')](_0x5ca4('0x75'),_0x2682c['name']),_0x5ca4('0x6a'),{'uri':_0x30abaf});})[_0x5ca4('0x76')](function(_0x1d864){logger[_0x5ca4('0x6b')](_0x5ca4('0x6f'),JSON[_0x5ca4('0x24')](_0x1d864));});};exports[_0x5ca4('0x77')]=function(_0x26810a,_0x282037,_0x427c4d,_0x176a23,_0x549b58,_0x408541){var _0x105d9c,_0x5f37ed,_0x482ccb,_0x60d049;_0x408541[_0x5ca4('0x53')]=intUtil[_0x5ca4('0x54')](_0x408541[_0x5ca4('0x53')]);_0x408541[_0x5ca4('0x55')]=intUtil[_0x5ca4('0x54')](_0x408541[_0x5ca4('0x55')]);def[_0x5ca4('0x56')]=util[_0x5ca4('0x1f')](_0x5ca4('0x57'),_0x408541['remoteUri']);if(_0x549b58&&_0x549b58[_0x5ca4('0x58')]){logger[_0x5ca4('0x25')]('['+_0x282037['lastevent'][_0x5ca4('0x78')]()+']',_0x5ca4('0x5a'));_0x282037[_0x5ca4('0x5b')]=util['format'](_0x5ca4('0x5c'),_0x408541['serverUrl'],_0x282037[_0x5ca4('0x5d')],md5(_0x282037[_0x5ca4('0x5d')]));}else{_0x282037[_0x5ca4('0x5b')]='';}return getConnection(_0x408541)[_0x5ca4('0x34')](function(_0x35f7b4){_0x60d049=_0x35f7b4;if(!_[_0x5ca4('0x79')](_0x176a23)){return getUser(_0x408541,_0x176a23[_0x5ca4('0xc')],_0x60d049);}else{return getUser(_0x408541,null,_0x60d049);}})[_0x5ca4('0x34')](function(_0x437888){_0x105d9c=_0x437888;logger[_0x5ca4('0x25')](_0x5ca4('0x5e'),_0x105d9c['id']);return getEndUser(_0x408541,_0x282037['calleridname'],_0x282037[_0x5ca4('0x60')],_0x60d049);})[_0x5ca4('0x34')](function(_0xb8181c){_0x5f37ed=_0xb8181c;logger[_0x5ca4('0x25')](_0x5ca4('0x61'),_0x5f37ed['id']);return getTicket(_0x408541,_0x105d9c,_0x5f37ed,_0x427c4d,_0x282037,_0x427c4d[_0x5ca4('0x62')],_0x60d049,'Inbound');})[_0x5ca4('0x34')](function(_0x4e1f4b){_0x482ccb=_0x4e1f4b;logger[_0x5ca4('0x25')](_0x5ca4('0x72'));logger['info'](_0x5ca4('0x64'),_0x482ccb['id']);return setRelationship(_0x60d049,_0x105d9c,_0x482ccb,_0x5ca4('0x65'));})[_0x5ca4('0x34')](function(){return setRelationship(_0x60d049,_0x5f37ed,_0x482ccb,_0x5ca4('0x66'));})[_0x5ca4('0x34')](function(){return getServerInfo(_0x60d049);})[_0x5ca4('0x76')](function(_0x4dce00){logger['error']('['+_0x282037['lastevent'][_0x5ca4('0x78')]()+']',JSON[_0x5ca4('0x24')](_0x4dce00));});}; \ 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 5939141..43c8afc 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 _0x0172=['length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','name','toLowerCase','Variable','keyType','key','format','%s:\x20%s','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString'];(function(_0x5bb549,_0x4d0e9a){var _0x62015=function(_0x3c1d44){while(--_0x3c1d44){_0x5bb549['push'](_0x5bb549['shift']());}};_0x62015(++_0x4d0e9a);}(_0x0172,0x15c));var _0x2017=function(_0xc438cf,_0x4d8eb9){_0xc438cf=_0xc438cf-0x0;var _0x354569=_0x0172[_0xc438cf];return _0x354569;};'use strict';var _=require(_0x2017('0x0'));var util=require(_0x2017('0x1'));exports[_0x2017('0x2')]=function(_0x2c6c6e,_0x928a52,_0xf14210){var _0x324681=[];if(_0x2c6c6e[_0x2017('0x3')]>0x0){var _0x353db0=_[_0x2017('0x4')](_0x2c6c6e,['id']);for(var _0x47a732=0x0;_0x47a732<_0x353db0[_0x2017('0x3')];_0x47a732++){var _0x52c2de=_0x353db0[_0x47a732];if(_0x52c2de[_0x2017('0x5')]===_0x2017('0x6')){_0x324681[_0x2017('0x7')](_0x52c2de[_0x2017('0x8')]);}else if(_0x52c2de[_0x2017('0x5')]===_0x2017('0x9')&&_0x52c2de[_0x2017('0xa')]){_0x928a52[_0x52c2de[_0x2017('0xa')]]&&_0x324681[_0x2017('0x7')](_0x928a52[_0x52c2de[_0x2017('0xa')]][_0x2017('0xb')]());}else if(_0x52c2de[_0x2017('0x5')]===_0x2017('0xc')&&_0x52c2de['Variable']&&_0x52c2de['Variable'][_0x2017('0xd')]){_0x928a52[_0x52c2de['Variable'][_0x2017('0xd')][_0x2017('0xe')]()]&&_0x324681[_0x2017('0x7')](_0x928a52[_0x52c2de[_0x2017('0xf')][_0x2017('0xd')][_0x2017('0xe')]()][_0x2017('0xb')]());}else if(_0x52c2de[_0x2017('0x5')]==='keyValue'){if(_0x52c2de[_0x2017('0x10')]===_0x2017('0x6')&&_0x52c2de[_0x2017('0x11')]){_0x324681['push'](util[_0x2017('0x12')](_0x2017('0x13'),_0x52c2de[_0x2017('0x11')],_0x52c2de['keyContent']));}else if(_0x52c2de[_0x2017('0x10')]===_0x2017('0x9')&&_0x52c2de[_0x2017('0xa')]&&_0x52c2de[_0x2017('0x11')]){_0x928a52[_0x52c2de[_0x2017('0xa')]]&&_0x324681[_0x2017('0x7')](util[_0x2017('0x12')](_0x2017('0x13'),_0x52c2de[_0x2017('0x11')],_0x928a52[_0x52c2de['variableName']]));}else if(_0x52c2de['keyType']===_0x2017('0xc')&&_0x52c2de[_0x2017('0xf')]&&_0x52c2de['Variable'][_0x2017('0xd')]&&_0x52c2de['key']){_0x928a52[_0x52c2de[_0x2017('0xf')]['name'][_0x2017('0xe')]()]&&_0x324681[_0x2017('0x7')](util['format'](_0x2017('0x13'),_0x52c2de[_0x2017('0x11')],_0x928a52[_0x52c2de[_0x2017('0xf')][_0x2017('0xd')][_0x2017('0xe')]()]));}}}}return _0x324681[_0x2017('0x14')](_0xf14210);};exports['stripTrailingSlash']=function(_0x3fee3f){var _0x1634ee=_0x3fee3f[_0x2017('0x15')](-0x1);if(_0x1634ee==='/'){_0x3fee3f=_0x3fee3f[_0x2017('0x16')](0x0,_0x3fee3f[_0x2017('0x17')](_0x1634ee));}return _0x3fee3f;};exports[_0x2017('0x18')]=function(_0x14cedb){if(!_[_0x2017('0x19')](_0x14cedb)&&_0x14cedb!==''){var _0x377b9f=/^(([^<>()\[\]\\.,;:\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 _0x377b9f[_0x2017('0x1a')](String(_0x14cedb)[_0x2017('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xcc38=['string','push','content','variable','variableName','toString','customVariable','Variable','name','keyValue','keyType','key','%s:\x20%s','keyContent','format','toLowerCase','substring','lastIndexOf','validateEmail','test','lodash','util','getString','length','sortBy','type'];(function(_0x45698a,_0x59748b){var _0x25bf6b=function(_0x28a6b3){while(--_0x28a6b3){_0x45698a['push'](_0x45698a['shift']());}};_0x25bf6b(++_0x59748b);}(_0xcc38,0x166));var _0x8cc3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcc38[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8cc3('0x0'));var util=require(_0x8cc3('0x1'));exports[_0x8cc3('0x2')]=function(_0x1f72bc,_0x397664,_0x3999dc){var _0x4ec51d=[];if(_0x1f72bc[_0x8cc3('0x3')]>0x0){var _0x2bfc56=_[_0x8cc3('0x4')](_0x1f72bc,['id']);for(var _0x2d0442=0x0;_0x2d0442<_0x2bfc56[_0x8cc3('0x3')];_0x2d0442++){var _0x404b40=_0x2bfc56[_0x2d0442];if(_0x404b40[_0x8cc3('0x5')]===_0x8cc3('0x6')){_0x4ec51d[_0x8cc3('0x7')](_0x404b40[_0x8cc3('0x8')]);}else if(_0x404b40['type']===_0x8cc3('0x9')&&_0x404b40['variableName']){_0x397664[_0x404b40['variableName']]&&_0x4ec51d[_0x8cc3('0x7')](_0x397664[_0x404b40[_0x8cc3('0xa')]][_0x8cc3('0xb')]());}else if(_0x404b40[_0x8cc3('0x5')]===_0x8cc3('0xc')&&_0x404b40[_0x8cc3('0xd')]&&_0x404b40[_0x8cc3('0xd')]['name']){_0x397664[_0x404b40[_0x8cc3('0xd')][_0x8cc3('0xe')]['toLowerCase']()]&&_0x4ec51d[_0x8cc3('0x7')](_0x397664[_0x404b40[_0x8cc3('0xd')]['name']['toLowerCase']()][_0x8cc3('0xb')]());}else if(_0x404b40[_0x8cc3('0x5')]===_0x8cc3('0xf')){if(_0x404b40[_0x8cc3('0x10')]===_0x8cc3('0x6')&&_0x404b40[_0x8cc3('0x11')]){_0x4ec51d[_0x8cc3('0x7')](util['format'](_0x8cc3('0x12'),_0x404b40[_0x8cc3('0x11')],_0x404b40[_0x8cc3('0x13')]));}else if(_0x404b40[_0x8cc3('0x10')]==='variable'&&_0x404b40['variableName']&&_0x404b40[_0x8cc3('0x11')]){_0x397664[_0x404b40['variableName']]&&_0x4ec51d[_0x8cc3('0x7')](util[_0x8cc3('0x14')]('%s:\x20%s',_0x404b40[_0x8cc3('0x11')],_0x397664[_0x404b40['variableName']]));}else if(_0x404b40[_0x8cc3('0x10')]===_0x8cc3('0xc')&&_0x404b40[_0x8cc3('0xd')]&&_0x404b40[_0x8cc3('0xd')][_0x8cc3('0xe')]&&_0x404b40[_0x8cc3('0x11')]){_0x397664[_0x404b40[_0x8cc3('0xd')][_0x8cc3('0xe')][_0x8cc3('0x15')]()]&&_0x4ec51d[_0x8cc3('0x7')](util[_0x8cc3('0x14')](_0x8cc3('0x12'),_0x404b40[_0x8cc3('0x11')],_0x397664[_0x404b40[_0x8cc3('0xd')][_0x8cc3('0xe')][_0x8cc3('0x15')]()]));}}}}return _0x4ec51d['join'](_0x3999dc);};exports['stripTrailingSlash']=function(_0xf1bfb1){var _0x2c5321=_0xf1bfb1['slice'](-0x1);if(_0x2c5321==='/'){_0xf1bfb1=_0xf1bfb1[_0x8cc3('0x16')](0x0,_0xf1bfb1[_0x8cc3('0x17')](_0x2c5321));}return _0xf1bfb1;};exports[_0x8cc3('0x18')]=function(_0x1b3ea9){if(!_['isNil'](_0x1b3ea9)&&_0x1b3ea9!==''){var _0x1bad15=/^(([^<>()\[\]\\.,;:\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 _0x1bad15[_0x8cc3('0x19')](String(_0x1b3ea9)[_0x8cc3('0x15')]());}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 18874ac..92741eb 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x3e3f0a,_0x13dd45){var _0x470ae4=function(_0x441c47){while(--_0x441c47){_0x3e3f0a['push'](_0x3e3f0a['shift']());}};_0x470ae4(++_0x13dd45);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x969dc7,_0x749243){var _0x56dfdb=function(_0x4b35cc){while(--_0x4b35cc){_0x969dc7['push'](_0x969dc7['shift']());}};_0x56dfdb(++_0x749243);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index fefcf94..85457d1 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 _0x2baf=['content','toString','picklist','idField','customField','push','variable','variableName','Variable','toLowerCase','custom_fields','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','recordingURL','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','name','Subjects','getString','Fields','Ticket\x20created!','format','type:user\x20role:agent\x20email:%s','then','count','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','%s/search.json','length','results','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','username','Basic\x20%s','base64','[HTTP]','stringify','map','forEach','includes','string','type','nameField'];(function(_0x5bf4b,_0x11bdfa){var _0x17868d=function(_0x18f857){while(--_0x18f857){_0x5bf4b['push'](_0x5bf4b['shift']());}};_0x17868d(++_0x11bdfa);}(_0x2baf,0xfd));var _0xf2ba=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x2baf[_0x218972];return _0x1bb1a8;};'use strict';var _=require(_0xf2ba('0x0'));var rp=require('request-promise');var md5=require(_0xf2ba('0x1'));var util=require(_0xf2ba('0x2'));var Redis=require(_0xf2ba('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf2ba('0x4'))('zendesk');config[_0xf2ba('0x5')]=_[_0xf2ba('0x6')](config[_0xf2ba('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf2ba('0x7'))(new Redis(config[_0xf2ba('0x5')]));function emit(_0x404223,_0x86a77b,_0xa4c258){io['to'](_0x404223)[_0xf2ba('0x8')](_0x86a77b,_0xa4c258);}var headers={'Content-Type':_0xf2ba('0x9'),'Accept':_0xf2ba('0x9')};function getTicket(_0x499566,_0x3ce8ae,_0x12d992,_0x5c70fa,_0x3b9093){logger[_0xf2ba('0xa')](_0xf2ba('0xb'));return request({'uri':util['format']('%s/tickets.json',_0x499566[_0xf2ba('0xc')]),'method':_0xf2ba('0xd'),'body':{'ticket':_[_0xf2ba('0xe')]({'requester_id':_0x12d992['id'],'submitter_id':_0x3ce8ae?_0x3ce8ae['id']:undefined,'assignee_id':_0x3ce8ae?_0x3ce8ae['id']:undefined,'tags':getTags(_0x5c70fa['Tags'],_0xf2ba('0xf')),'subject':intUtil['getString'](_0x5c70fa[_0xf2ba('0x10')],_0x3b9093,'\x20'),'description':intUtil['getString'](_0x5c70fa['Descriptions'],_0x3b9093,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf2ba('0x11')](_0x5c70fa['Descriptions'],_0x3b9093,'\x0a')}},getCustomFields(_0x5c70fa[_0xf2ba('0x12')],_0x3b9093))}})['then'](function(_0x98cae6){logger[_0xf2ba('0xa')](_0xf2ba('0x13'));return _0x98cae6['ticket'];});}function getUser(_0x5d32ba,_0x4631ce){if(intUtil['validateEmail'](_0x4631ce)){logger[_0xf2ba('0xa')]('Getting\x20agent\x20with\x20email',_0x4631ce);return request({'uri':util[_0xf2ba('0x14')]('%s/search.json',_0x5d32ba[_0xf2ba('0xc')]),'qs':{'query':util[_0xf2ba('0x14')](_0xf2ba('0x15'),_0x4631ce)}})[_0xf2ba('0x16')](function(_0x546369){if(_0x546369[_0xf2ba('0x17')]){logger[_0xf2ba('0xa')]('Agent\x20found!');return _['find'](_0x546369['results'],{'email':_0x4631ce,'role':_0xf2ba('0x18')});}else{logger['info'](_0xf2ba('0x19'));return request({'uri':util[_0xf2ba('0x14')](_0xf2ba('0x1a'),_0x5d32ba[_0xf2ba('0xc')])})['then'](function(_0x391d0d){logger[_0xf2ba('0xa')]('Admin\x20account\x20selected.');return _0x391d0d[_0xf2ba('0x1b')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x5d32ba['remoteUri'])})[_0xf2ba('0x16')](function(_0x2031e2){logger[_0xf2ba('0xa')](_0xf2ba('0x1c'));return _0x2031e2[_0xf2ba('0x1b')];});}}function getEndUser(_0x49f74b,_0x4e1ab1,_0x48efc1){logger['info']('Searching\x20enduser\x20with\x20phone',_0x48efc1);return request({'uri':util[_0xf2ba('0x14')](_0xf2ba('0x1d'),_0x49f74b[_0xf2ba('0xc')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x48efc1)}})[_0xf2ba('0x16')](function(_0x34e96c){var _0xa90963;if(_0x34e96c['results'][_0xf2ba('0x1e')]){_0x34e96c[_0xf2ba('0x1f')]=_[_0xf2ba('0x20')](_0x34e96c[_0xf2ba('0x1f')],{'suspended':![],'role':'end-user'});if(_0x34e96c['results'][_0xf2ba('0x1e')]){_0xa90963=_[_0xf2ba('0x21')](_0x34e96c[_0xf2ba('0x1f')]);}}if(_0xa90963){logger[_0xf2ba('0xa')](_0xf2ba('0x22'));return _0xa90963;}else{logger[_0xf2ba('0xa')](_0xf2ba('0x23'));return request({'uri':util[_0xf2ba('0x14')]('%s/users.json',_0x49f74b['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0xf2ba('0x24'),_0x4e1ab1||_0x48efc1),'phone':_0x48efc1}}})[_0xf2ba('0x16')](function(_0xa74b56){logger[_0xf2ba('0xa')](_0xf2ba('0x25'));return _0xa74b56[_0xf2ba('0x1b')];});}});}function getAuth(_0x46e56f){var _0x465bda;if(_0x46e56f[_0xf2ba('0x26')]===_0xf2ba('0x27')){_0x465bda=util[_0xf2ba('0x14')](_0xf2ba('0x28'),_0x46e56f['username'],_0x46e56f['password']);}else if(_0x46e56f[_0xf2ba('0x26')]===_0xf2ba('0x29')){_0x465bda=util[_0xf2ba('0x14')]('%s/token:%s',_0x46e56f[_0xf2ba('0x2a')],_0x46e56f[_0xf2ba('0x29')]);}return util['format'](_0xf2ba('0x2b'),new Buffer(_0x465bda)['toString'](_0xf2ba('0x2c')));}function request(_0x5b8b72){logger['debug'](_0xf2ba('0x2d'),JSON[_0xf2ba('0x2e')](_0x5b8b72));return rp(_['defaults'](_0x5b8b72,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x461984,_0x23c0dc){var _0x4d7034=[];if(_0x461984&&_0x461984['length']>0x0){_0x4d7034=_[_0xf2ba('0x2f')](_0x461984,_0x23c0dc);}return _0x4d7034;}function getCustomFields(_0x2d7bd9,_0xe0a695){var _0x3db9ce=[];var _0x5f043c={'custom_fields':[]};if(_0x2d7bd9[_0xf2ba('0x1e')]>0x0){_[_0xf2ba('0x30')](_0x2d7bd9,function(_0x58d52b){if(_[_0xf2ba('0x31')]([_0xf2ba('0x32'),'picklist'],_0x58d52b[_0xf2ba('0x33')])&&_0x58d52b['nameField']&&!_0x58d52b['customField']){_0x5f043c[_0x58d52b[_0xf2ba('0x34')]['toLowerCase']()]=_0x58d52b[_0xf2ba('0x35')][_0xf2ba('0x36')]();}else if(_[_0xf2ba('0x31')](['string',_0xf2ba('0x37')],_0x58d52b[_0xf2ba('0x33')])&&_0x58d52b[_0xf2ba('0x38')]&&_0x58d52b[_0xf2ba('0x39')]){_0x5f043c['custom_fields'][_0xf2ba('0x3a')]({'id':_0x58d52b[_0xf2ba('0x38')],'value':_0x58d52b[_0xf2ba('0x35')][_0xf2ba('0x36')]()});}else if(_0x58d52b[_0xf2ba('0x33')]===_0xf2ba('0x3b')&&_0x58d52b[_0xf2ba('0x3c')]&&_0x58d52b[_0xf2ba('0x38')]&&_0x58d52b[_0xf2ba('0x39')]){_0xe0a695[_0x58d52b[_0xf2ba('0x3c')]]&&_0x5f043c['custom_fields']['push']({'id':_0x58d52b['idField'],'value':_0xe0a695[_0x58d52b[_0xf2ba('0x3c')]][_0xf2ba('0x36')]()});}else if(_0x58d52b[_0xf2ba('0x33')]==='customVariable'&&_0x58d52b[_0xf2ba('0x3d')]&&_0x58d52b[_0xf2ba('0x3d')][_0xf2ba('0xf')]&&_0x58d52b['idField']&&_0x58d52b[_0xf2ba('0x39')]){_0xe0a695[_0x58d52b[_0xf2ba('0x3d')][_0xf2ba('0xf')][_0xf2ba('0x3e')]()]&&_0x5f043c[_0xf2ba('0x3f')][_0xf2ba('0x3a')]({'id':_0x58d52b[_0xf2ba('0x38')],'value':_0xe0a695[_0x58d52b[_0xf2ba('0x3d')][_0xf2ba('0xf')][_0xf2ba('0x3e')]()]['toString']()});}});}return _0x5f043c;}exports['queue']=function(_0x4e14b5,_0x166c73,_0x3b5e7a,_0x491058,_0x315b1a,_0x51580b){var _0x33d83e,_0x3a2ce0;_0x51580b['remoteUri']=intUtil[_0xf2ba('0x40')](_0x51580b[_0xf2ba('0xc')]);_0x51580b[_0xf2ba('0x41')]=intUtil['stripTrailingSlash'](_0x51580b[_0xf2ba('0x41')]);if(_0x315b1a&&_0x315b1a[_0xf2ba('0x42')]){logger['info'](_0xf2ba('0x43'),'Recording\x20is\x20enabled!');_0x166c73['recordingURL']=util[_0xf2ba('0x14')](_0xf2ba('0x44'),_0x51580b[_0xf2ba('0x41')],_0x166c73['uniqueid'],md5(_0x166c73[_0xf2ba('0x45')]));}else{_0x166c73['recordingURL']='';}headers['Authorization']=getAuth(_0x51580b);return getUser(_0x51580b,_0x491058[_0xf2ba('0x46')])[_0xf2ba('0x16')](function(_0x1ee78e){_0x33d83e=_0x1ee78e;logger['info'](_0xf2ba('0x47'),_0x33d83e['id']);return getEndUser(_0x51580b,_0x166c73['calleridname'],_0x166c73['calleridnum']);})['then'](function(_0x2e8dfa){_0x3a2ce0=_0x2e8dfa;logger['info'](_0xf2ba('0x48'),_0x3a2ce0['id']);return getTicket(_0x51580b,_0x33d83e,_0x3a2ce0,_0x3b5e7a,_0x166c73);})[_0xf2ba('0x16')](function(_0x5c3104){if(_0x5c3104){logger[_0xf2ba('0xa')](_0xf2ba('0x49'),_0x5c3104['id']);switch(_0x51580b[_0xf2ba('0x33')]){case _0xf2ba('0x4a'):logger[_0xf2ba('0xa')](_0xf2ba('0x43'),_0xf2ba('0x4b'));return request({'uri':util['format'](_0xf2ba('0x4c'),_0x51580b[_0xf2ba('0xc')],_0x33d83e['id'],_0x5c3104['id']),'method':_0xf2ba('0xd')});case _0xf2ba('0x4d'):logger[_0xf2ba('0xa')](_0xf2ba('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf2ba('0x14')](_0xf2ba('0x4e'),_0x491058[_0xf2ba('0xf')]),_0xf2ba('0x4f'),{'uri':util[_0xf2ba('0x14')](_0xf2ba('0x50'),_0x51580b[_0xf2ba('0xc')][_0xf2ba('0x51')](_0xf2ba('0x52'),''),_0x5c3104['id'])});break;default:logger[_0xf2ba('0x53')]('[QUEUE]',_0xf2ba('0x54'));}}})[_0xf2ba('0x55')](function(_0x5c0f22){logger['error'](_0xf2ba('0x56'),util[_0xf2ba('0x57')](_0x5c0f22,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x44ad99,_0x4336e7,_0x2a7973,_0x27b1f7,_0x3bb58d,_0x273939,_0x42e6bf){var _0x10b788,_0x4137a0;_0x273939[_0xf2ba('0xc')]=intUtil['stripTrailingSlash'](_0x273939[_0xf2ba('0xc')]);_0x273939[_0xf2ba('0x41')]=intUtil[_0xf2ba('0x40')](_0x273939[_0xf2ba('0x41')]);if(_0x42e6bf&&_0x42e6bf[_0xf2ba('0x58')]&&_0x42e6bf[_0xf2ba('0x58')]!==_0xf2ba('0x59')){logger[_0xf2ba('0xa')](_0xf2ba('0x5a'),_0xf2ba('0x5b'));_0x4336e7['recordingURL']=util[_0xf2ba('0x14')](_0xf2ba('0x44'),_0x273939[_0xf2ba('0x41')],_0x4336e7['uniqueid'],md5(_0x4336e7[_0xf2ba('0x45')]));}headers[_0xf2ba('0x5c')]=getAuth(_0x273939);return getUser(_0x273939,_0x27b1f7[_0xf2ba('0x46')])['then'](function(_0x54a0f8){_0x10b788=_0x54a0f8;logger[_0xf2ba('0xa')](_0xf2ba('0x47'),_0x10b788['id']);return getEndUser(_0x273939,_0x4336e7['destcalleridname'],_0x4336e7[_0xf2ba('0x5d')]);})[_0xf2ba('0x16')](function(_0x165c62){_0x4137a0=_0x165c62;logger[_0xf2ba('0xa')](_0xf2ba('0x48'),_0x4137a0['id']);return getTicket(_0x273939,_0x10b788,_0x4137a0,_0x2a7973,_0x4336e7);})['then'](function(_0x19d9e9){if(_0x19d9e9){logger[_0xf2ba('0xa')](_0xf2ba('0x49'),_0x19d9e9['id']);switch(_0x273939['type']){case _0xf2ba('0x4a'):logger[_0xf2ba('0xa')](_0xf2ba('0x5a'),_0xf2ba('0x4b'));return request({'uri':util[_0xf2ba('0x14')](_0xf2ba('0x4c'),_0x273939[_0xf2ba('0xc')],_0x10b788['id'],_0x19d9e9['id']),'method':_0xf2ba('0xd')});case _0xf2ba('0x4d'):logger[_0xf2ba('0xa')](_0xf2ba('0x5a'),_0xf2ba('0x5e'));emit(util['format']('user:%s',_0x27b1f7['name']),_0xf2ba('0x4f'),{'uri':util[_0xf2ba('0x14')]('%s/agent/tickets/%s',_0x273939['remoteUri'][_0xf2ba('0x51')](_0xf2ba('0x52'),''),_0x19d9e9['id'])});break;default:logger['error'](_0xf2ba('0x5a'),_0xf2ba('0x54'));}}})['catch'](function(_0x2776c4){logger[_0xf2ba('0x53')](_0xf2ba('0x5f'),util['inspect'](_0x2776c4,{'showHidden':!![],'depth':null}));});};exports[_0xf2ba('0x60')]=function(_0x33267c,_0x4507ed,_0x13df88,_0x1b740b,_0x478679,_0x28d8a9){var _0x4350ba,_0x26b256;_0x28d8a9[_0xf2ba('0xc')]=intUtil[_0xf2ba('0x40')](_0x28d8a9[_0xf2ba('0xc')]);_0x28d8a9[_0xf2ba('0x41')]=intUtil[_0xf2ba('0x40')](_0x28d8a9['serverUrl']);if(_0x478679&&_0x478679['monitor_format']){logger[_0xf2ba('0xa')]('['+_0x4507ed[_0xf2ba('0x61')][_0xf2ba('0x62')]()+']',_0xf2ba('0x5b'));_0x4507ed['recordingURL']=util[_0xf2ba('0x14')](_0xf2ba('0x44'),_0x28d8a9['serverUrl'],_0x4507ed['uniqueid'],md5(_0x4507ed[_0xf2ba('0x45')]));}else{_0x4507ed[_0xf2ba('0x63')]='';}headers[_0xf2ba('0x5c')]=getAuth(_0x28d8a9);return getUser(_0x28d8a9)[_0xf2ba('0x16')](function(_0xf018a1){_0x4350ba=_0xf018a1;logger[_0xf2ba('0xa')]('The\x20User\x20ID\x20is:',_0x4350ba['id']);return getEndUser(_0x28d8a9,_0x4507ed['calleridname'],_0x4507ed[_0xf2ba('0x64')]);})['then'](function(_0x1c45d9){_0x26b256=_0x1c45d9;logger['info'](_0xf2ba('0x48'),_0x26b256['id']);return getTicket(_0x28d8a9,_0x4350ba,_0x26b256,_0x13df88,_0x4507ed);})[_0xf2ba('0x16')](function(_0x268cf2){if(_0x268cf2){logger[_0xf2ba('0xa')](_0xf2ba('0x49'),_0x268cf2['id']);}})[_0xf2ba('0x55')](function(_0x32ea08){logger[_0xf2ba('0x53')]('['+_0x4507ed[_0xf2ba('0x61')][_0xf2ba('0x62')]()+']'+_0xf2ba('0x65'),util[_0xf2ba('0x57')](_0x32ea08,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf20e=['POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','results','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','debug','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','type','push','idField','variable','customField','custom_fields','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridname','request-promise','util','ioredis','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri'];(function(_0x5b0476,_0x279a92){var _0x497d47=function(_0x4d9bbd){while(--_0x4d9bbd){_0x5b0476['push'](_0x5b0476['shift']());}};_0x497d47(++_0x279a92);}(_0xf20e,0xd0));var _0xef20=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xf20e[_0x2459fd];return _0x364cd2;};'use strict';var _=require('lodash');var rp=require(_0xef20('0x0'));var md5=require('md5');var util=require(_0xef20('0x1'));var Redis=require(_0xef20('0x2'));var intUtil=require(_0xef20('0x3'));var config=require(_0xef20('0x4'));var logger=require('../../../../config/logger')('zendesk');config['redis']=_[_0xef20('0x5')](config[_0xef20('0x6')],{'host':_0xef20('0x7'),'port':0x18eb});var io=require(_0xef20('0x8'))(new Redis(config[_0xef20('0x6')]));function emit(_0x4cc484,_0x1c88cf,_0x2ac70d){io['to'](_0x4cc484)[_0xef20('0x9')](_0x1c88cf,_0x2ac70d);}var headers={'Content-Type':'application/json','Accept':_0xef20('0xa')};function getTicket(_0x469cd3,_0x569120,_0xa9e167,_0x140424,_0x267be5){logger[_0xef20('0xb')](_0xef20('0xc'));return request({'uri':util[_0xef20('0xd')](_0xef20('0xe'),_0x469cd3[_0xef20('0xf')]),'method':_0xef20('0x10'),'body':{'ticket':_[_0xef20('0x11')]({'requester_id':_0xa9e167['id'],'submitter_id':_0x569120?_0x569120['id']:undefined,'assignee_id':_0x569120?_0x569120['id']:undefined,'tags':getTags(_0x140424[_0xef20('0x12')],_0xef20('0x13')),'subject':intUtil[_0xef20('0x14')](_0x140424[_0xef20('0x15')],_0x267be5,'\x20'),'description':intUtil[_0xef20('0x14')](_0x140424['Descriptions'],_0x267be5,'\x0a'),'comment':{'public':![],'body':intUtil[_0xef20('0x14')](_0x140424[_0xef20('0x16')],_0x267be5,'\x0a')}},getCustomFields(_0x140424[_0xef20('0x17')],_0x267be5))}})[_0xef20('0x18')](function(_0x375976){logger[_0xef20('0xb')](_0xef20('0x19'));return _0x375976[_0xef20('0x1a')];});}function getUser(_0x29ed4a,_0x2eca80){if(intUtil[_0xef20('0x1b')](_0x2eca80)){logger['info']('Getting\x20agent\x20with\x20email',_0x2eca80);return request({'uri':util[_0xef20('0xd')]('%s/search.json',_0x29ed4a[_0xef20('0xf')]),'qs':{'query':util['format'](_0xef20('0x1c'),_0x2eca80)}})[_0xef20('0x18')](function(_0x5c4d31){if(_0x5c4d31[_0xef20('0x1d')]){logger[_0xef20('0xb')](_0xef20('0x1e'));return _[_0xef20('0x1f')](_0x5c4d31['results'],{'email':_0x2eca80,'role':_0xef20('0x20')});}else{logger[_0xef20('0xb')](_0xef20('0x21'));return request({'uri':util[_0xef20('0xd')](_0xef20('0x22'),_0x29ed4a['remoteUri'])})[_0xef20('0x18')](function(_0x2e6c20){logger[_0xef20('0xb')]('Admin\x20account\x20selected.');return _0x2e6c20[_0xef20('0x23')];});}});}else{logger[_0xef20('0xb')](_0xef20('0x21'));return request({'uri':util[_0xef20('0xd')]('%s/users/me.json',_0x29ed4a[_0xef20('0xf')])})[_0xef20('0x18')](function(_0x46389d){logger['info'](_0xef20('0x24'));return _0x46389d[_0xef20('0x23')];});}}function getEndUser(_0x4c7d95,_0x39d84e,_0x5f1b79){logger['info']('Searching\x20enduser\x20with\x20phone',_0x5f1b79);return request({'uri':util[_0xef20('0xd')](_0xef20('0x25'),_0x4c7d95[_0xef20('0xf')]),'qs':{'query':util['format'](_0xef20('0x26'),_0x5f1b79)}})[_0xef20('0x18')](function(_0x19e066){var _0xca8ff1;if(_0x19e066['results'][_0xef20('0x27')]){_0x19e066[_0xef20('0x28')]=_['filter'](_0x19e066[_0xef20('0x28')],{'suspended':![],'role':'end-user'});if(_0x19e066['results'][_0xef20('0x27')]){_0xca8ff1=_[_0xef20('0x29')](_0x19e066[_0xef20('0x28')]);}}if(_0xca8ff1){logger[_0xef20('0xb')]('Enduser\x20found!');return _0xca8ff1;}else{logger[_0xef20('0xb')](_0xef20('0x2a'));return request({'uri':util[_0xef20('0xd')]('%s/users.json',_0x4c7d95['remoteUri']),'method':'POST','body':{'user':{'role':_0xef20('0x2b'),'name':util[_0xef20('0xd')](_0xef20('0x2c'),_0x39d84e||_0x5f1b79),'phone':_0x5f1b79}}})[_0xef20('0x18')](function(_0x3e7de9){logger[_0xef20('0xb')](_0xef20('0x2d'));return _0x3e7de9[_0xef20('0x23')];});}});}function getAuth(_0x3fd798){var _0x5e8f68;if(_0x3fd798[_0xef20('0x2e')]===_0xef20('0x2f')){_0x5e8f68=util[_0xef20('0xd')](_0xef20('0x30'),_0x3fd798['username'],_0x3fd798[_0xef20('0x2f')]);}else if(_0x3fd798[_0xef20('0x2e')]===_0xef20('0x31')){_0x5e8f68=util[_0xef20('0xd')](_0xef20('0x32'),_0x3fd798[_0xef20('0x33')],_0x3fd798[_0xef20('0x31')]);}return util[_0xef20('0xd')](_0xef20('0x34'),new Buffer(_0x5e8f68)[_0xef20('0x35')]('base64'));}function request(_0x12bfd6){logger[_0xef20('0x36')]('[HTTP]',JSON[_0xef20('0x37')](_0x12bfd6));return rp(_['defaults'](_0x12bfd6,{'method':_0xef20('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x24d7d8,_0x35c678){var _0x19d68a=[];if(_0x24d7d8&&_0x24d7d8[_0xef20('0x27')]>0x0){_0x19d68a=_[_0xef20('0x39')](_0x24d7d8,_0x35c678);}return _0x19d68a;}function getCustomFields(_0x459655,_0x4cc19a){var _0x195525=[];var _0x379da5={'custom_fields':[]};if(_0x459655[_0xef20('0x27')]>0x0){_[_0xef20('0x3a')](_0x459655,function(_0xceb722){if(_[_0xef20('0x3b')]([_0xef20('0x3c'),_0xef20('0x3d')],_0xceb722['type'])&&_0xceb722[_0xef20('0x3e')]&&!_0xceb722['customField']){_0x379da5[_0xceb722[_0xef20('0x3e')][_0xef20('0x3f')]()]=_0xceb722[_0xef20('0x40')][_0xef20('0x35')]();}else if(_[_0xef20('0x3b')]([_0xef20('0x3c'),_0xef20('0x3d')],_0xceb722[_0xef20('0x41')])&&_0xceb722['idField']&&_0xceb722['customField']){_0x379da5['custom_fields'][_0xef20('0x42')]({'id':_0xceb722[_0xef20('0x43')],'value':_0xceb722['content'][_0xef20('0x35')]()});}else if(_0xceb722['type']===_0xef20('0x44')&&_0xceb722['variableName']&&_0xceb722['idField']&&_0xceb722[_0xef20('0x45')]){_0x4cc19a[_0xceb722['variableName']]&&_0x379da5[_0xef20('0x46')]['push']({'id':_0xceb722['idField'],'value':_0x4cc19a[_0xceb722[_0xef20('0x47')]][_0xef20('0x35')]()});}else if(_0xceb722[_0xef20('0x41')]===_0xef20('0x48')&&_0xceb722[_0xef20('0x49')]&&_0xceb722[_0xef20('0x49')][_0xef20('0x13')]&&_0xceb722[_0xef20('0x43')]&&_0xceb722[_0xef20('0x45')]){_0x4cc19a[_0xceb722[_0xef20('0x49')][_0xef20('0x13')][_0xef20('0x3f')]()]&&_0x379da5['custom_fields'][_0xef20('0x42')]({'id':_0xceb722[_0xef20('0x43')],'value':_0x4cc19a[_0xceb722[_0xef20('0x49')]['name'][_0xef20('0x3f')]()]['toString']()});}});}return _0x379da5;}exports[_0xef20('0x4a')]=function(_0x1fdd84,_0x1f324a,_0x5ca931,_0x96c23c,_0x216747,_0x49100b){var _0x5da0e5,_0x4115b0;_0x49100b[_0xef20('0xf')]=intUtil[_0xef20('0x4b')](_0x49100b[_0xef20('0xf')]);_0x49100b['serverUrl']=intUtil[_0xef20('0x4b')](_0x49100b[_0xef20('0x4c')]);if(_0x216747&&_0x216747[_0xef20('0x4d')]){logger['info']('[QUEUE]',_0xef20('0x4e'));_0x1f324a['recordingURL']=util[_0xef20('0xd')](_0xef20('0x4f'),_0x49100b[_0xef20('0x4c')],_0x1f324a['uniqueid'],md5(_0x1f324a[_0xef20('0x50')]));}else{_0x1f324a[_0xef20('0x51')]='';}headers[_0xef20('0x52')]=getAuth(_0x49100b);return getUser(_0x49100b,_0x96c23c['email'])[_0xef20('0x18')](function(_0x540a41){_0x5da0e5=_0x540a41;logger[_0xef20('0xb')](_0xef20('0x53'),_0x5da0e5['id']);return getEndUser(_0x49100b,_0x1f324a['calleridname'],_0x1f324a[_0xef20('0x54')]);})[_0xef20('0x18')](function(_0x1d06c6){_0x4115b0=_0x1d06c6;logger['info'](_0xef20('0x55'),_0x4115b0['id']);return getTicket(_0x49100b,_0x5da0e5,_0x4115b0,_0x5ca931,_0x1f324a);})['then'](function(_0x13c14d){if(_0x13c14d){logger['info'](_0xef20('0x56'),_0x13c14d['id']);switch(_0x49100b[_0xef20('0x41')]){case _0xef20('0x57'):logger[_0xef20('0xb')]('[QUEUE]',_0xef20('0x58'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x49100b[_0xef20('0xf')],_0x5da0e5['id'],_0x13c14d['id']),'method':'POST'});case _0xef20('0x59'):logger[_0xef20('0xb')](_0xef20('0x5a'),_0xef20('0x5b'));emit(util[_0xef20('0xd')]('user:%s',_0x96c23c[_0xef20('0x13')]),_0xef20('0x5c'),{'uri':util['format']('%s/agent/tickets/%s',_0x49100b[_0xef20('0xf')]['replace'](_0xef20('0x5d'),''),_0x13c14d['id'])});break;default:logger[_0xef20('0x5e')](_0xef20('0x5a'),_0xef20('0x5f'));}}})[_0xef20('0x60')](function(_0x10b8a4){logger[_0xef20('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xef20('0x61')](_0x10b8a4,{'showHidden':!![],'depth':null}));});};exports[_0xef20('0x62')]=function(_0x630469,_0x54fcb6,_0x3a1a17,_0x55afff,_0x3f4d8f,_0x35d09f,_0x5ddfd9){var _0x11fb39,_0x425c07;_0x35d09f[_0xef20('0xf')]=intUtil[_0xef20('0x4b')](_0x35d09f[_0xef20('0xf')]);_0x35d09f['serverUrl']=intUtil[_0xef20('0x4b')](_0x35d09f['serverUrl']);if(_0x5ddfd9&&_0x5ddfd9[_0xef20('0x63')]&&_0x5ddfd9[_0xef20('0x63')]!==_0xef20('0x64')){logger[_0xef20('0xb')](_0xef20('0x65'),_0xef20('0x4e'));_0x54fcb6['recordingURL']=util[_0xef20('0xd')](_0xef20('0x4f'),_0x35d09f['serverUrl'],_0x54fcb6[_0xef20('0x50')],md5(_0x54fcb6['uniqueid']));}headers[_0xef20('0x52')]=getAuth(_0x35d09f);return getUser(_0x35d09f,_0x55afff[_0xef20('0x66')])[_0xef20('0x18')](function(_0x770e2c){_0x11fb39=_0x770e2c;logger['info'](_0xef20('0x53'),_0x11fb39['id']);return getEndUser(_0x35d09f,_0x54fcb6[_0xef20('0x67')],_0x54fcb6[_0xef20('0x68')]);})[_0xef20('0x18')](function(_0x4cfe3b){_0x425c07=_0x4cfe3b;logger[_0xef20('0xb')](_0xef20('0x55'),_0x425c07['id']);return getTicket(_0x35d09f,_0x11fb39,_0x425c07,_0x3a1a17,_0x54fcb6);})[_0xef20('0x18')](function(_0x17efe3){if(_0x17efe3){logger[_0xef20('0xb')]('The\x20Ticket\x20ID\x20is:',_0x17efe3['id']);switch(_0x35d09f[_0xef20('0x41')]){case _0xef20('0x57'):logger[_0xef20('0xb')](_0xef20('0x65'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xef20('0xd')](_0xef20('0x69'),_0x35d09f['remoteUri'],_0x11fb39['id'],_0x17efe3['id']),'method':_0xef20('0x10')});case _0xef20('0x59'):logger[_0xef20('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xef20('0xd')]('user:%s',_0x55afff[_0xef20('0x13')]),_0xef20('0x5c'),{'uri':util[_0xef20('0xd')](_0xef20('0x6a'),_0x35d09f['remoteUri'][_0xef20('0x6b')](_0xef20('0x5d'),''),_0x17efe3['id'])});break;default:logger[_0xef20('0x5e')](_0xef20('0x65'),_0xef20('0x5f'));}}})[_0xef20('0x60')](function(_0x5bdabe){logger[_0xef20('0x5e')](_0xef20('0x6c'),util[_0xef20('0x61')](_0x5bdabe,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x179789,_0x253cf6,_0x3bbe5d,_0x58d6aa,_0x56403b,_0x4f41be){var _0x50c84d,_0x3ee120;_0x4f41be[_0xef20('0xf')]=intUtil[_0xef20('0x4b')](_0x4f41be[_0xef20('0xf')]);_0x4f41be[_0xef20('0x4c')]=intUtil[_0xef20('0x4b')](_0x4f41be[_0xef20('0x4c')]);if(_0x56403b&&_0x56403b[_0xef20('0x4d')]){logger[_0xef20('0xb')]('['+_0x253cf6[_0xef20('0x6d')][_0xef20('0x6e')]()+']',_0xef20('0x4e'));_0x253cf6['recordingURL']=util['format'](_0xef20('0x4f'),_0x4f41be[_0xef20('0x4c')],_0x253cf6['uniqueid'],md5(_0x253cf6[_0xef20('0x50')]));}else{_0x253cf6['recordingURL']='';}headers['Authorization']=getAuth(_0x4f41be);return getUser(_0x4f41be)[_0xef20('0x18')](function(_0xef7c0a){_0x50c84d=_0xef7c0a;logger[_0xef20('0xb')](_0xef20('0x53'),_0x50c84d['id']);return getEndUser(_0x4f41be,_0x253cf6[_0xef20('0x6f')],_0x253cf6[_0xef20('0x54')]);})['then'](function(_0x200939){_0x3ee120=_0x200939;logger[_0xef20('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3ee120['id']);return getTicket(_0x4f41be,_0x50c84d,_0x3ee120,_0x3bbe5d,_0x253cf6);})[_0xef20('0x18')](function(_0xbca6fa){if(_0xbca6fa){logger['info']('The\x20Ticket\x20ID\x20is:',_0xbca6fa['id']);}})[_0xef20('0x60')](function(_0x105162){logger[_0xef20('0x5e')]('['+_0x253cf6[_0xef20('0x6d')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x105162,{'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 321190e..889fc92 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 _0x950a=['Contacts','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','format','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','Call_Result','Called','connect','Answered','Rejected','abandoned','Abandoned','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','zoho.eu','destcalleridname','destcalleridnum','Outbound','lastevent','toUpperCase','lodash','request-promise','md5','./util','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','[HTTP]','stringify','length','forEach','includes','string','idField','content','toString','variable','variableName','type','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description'];(function(_0x89183e,_0x42fc4c){var _0x2a5f6b=function(_0x312487){while(--_0x312487){_0x89183e['push'](_0x89183e['shift']());}};_0x2a5f6b(++_0x42fc4c);}(_0x950a,0x174));var _0xa950=function(_0x5c6598,_0x48eec0){_0x5c6598=_0x5c6598-0x0;var _0x44a531=_0x950a[_0x5c6598];return _0x44a531;};'use strict';var _=require(_0xa950('0x0'));var rp=require(_0xa950('0x1'));var md5=require(_0xa950('0x2'));var util=require('util');var intUtil=require(_0xa950('0x3'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0xa950('0x4'));var config=require(_0xa950('0x5'));var logger=require(_0xa950('0x6'))(_0xa950('0x7'));config[_0xa950('0x8')]=_[_0xa950('0x9')](config[_0xa950('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa950('0xa'))(new Redis(config[_0xa950('0x8')]));function emit(_0x13f2de,_0x713f2b,_0x11cf7a){io['to'](_0x13f2de)['emit'](_0x713f2b,_0x11cf7a);}function request(_0x595a04){logger['debug'](_0xa950('0xb'),JSON[_0xa950('0xc')](_0x595a04));return rp(_0x595a04);}function getCustomFields(_0x7b8429,_0xf1ac95){var _0x389a82={};if(_0x7b8429[_0xa950('0xd')]>0x0){_[_0xa950('0xe')](_0x7b8429,function(_0x2cccf8){if(_[_0xa950('0xf')]([_0xa950('0x10'),'picklist'],_0x2cccf8['type'])&&_0x2cccf8['idField']){_0x389a82[_0x2cccf8[_0xa950('0x11')]]=_0x2cccf8[_0xa950('0x12')][_0xa950('0x13')]();}else if(_0x2cccf8['type']===_0xa950('0x14')&&_0x2cccf8['variableName']&&_0x2cccf8[_0xa950('0x11')]&&_0xf1ac95[_0x2cccf8['variableName']]){_0x389a82[_0x2cccf8[_0xa950('0x11')]]=_0xf1ac95[_0x2cccf8[_0xa950('0x15')]][_0xa950('0x13')]();}else if(_0x2cccf8[_0xa950('0x16')]==='customVariable'&&_0x2cccf8[_0xa950('0x17')]&&_0x2cccf8['Variable'][_0xa950('0x18')]&&_0x2cccf8['idField']&&_0xf1ac95[_0x2cccf8[_0xa950('0x17')][_0xa950('0x18')][_0xa950('0x19')]()]){_0x389a82[_0x2cccf8['idField']]=_0xf1ac95[_0x2cccf8[_0xa950('0x17')][_0xa950('0x18')][_0xa950('0x19')]()][_0xa950('0x13')]();}});}return _0x389a82;}function getName(_0x4dc704){if(_0x4dc704['indexOf']('\x20')>0x0){var _0x137f27=_0x4dc704[_0xa950('0x1a')](/ (.+)/);if(_0x137f27[0x1]){return _0x137f27;}}return[_0x4dc704,_0x4dc704];}var accountsTokens={};function getAccessToken(_0x255dfc){return new Promise(function(_0x36291c,_0x5ec0cd){if(!_[_0xa950('0x1b')](accountsTokens[_0x255dfc['id']])&&!_[_0xa950('0x1b')](accountsTokens[_0x255dfc['id']][_0xa950('0x1c')])){if(moment()[_0xa950('0x1d')](accountsTokens[_0x255dfc['id']][_0xa950('0x1e')])){_0x36291c(accountsTokens[_0x255dfc['id']][_0xa950('0x1c')]);}}var _0x34eb49;switch(_0x255dfc['zone']){case'US':_0x34eb49=_0xa950('0x1f');break;case'AU':_0x34eb49='https://accounts.zoho.com.au';break;case'EU':_0x34eb49=_0xa950('0x20');break;case'IN':_0x34eb49=_0xa950('0x21');break;case'CN':_0x34eb49=_0xa950('0x22');break;default:_0x34eb49='https://accounts.zoho.eu';break;}var _0x5a21fb={'method':_0xa950('0x23'),'uri':_0x34eb49+_0xa950('0x24'),'qs':{'refresh_token':_0x255dfc[_0xa950('0x25')],'client_id':_0x255dfc[_0xa950('0x26')],'client_secret':_0x255dfc[_0xa950('0x27')],'grant_type':_0xa950('0x28')},'json':!![]};return rp(_0x5a21fb)['then'](function(_0x48e7bc){accountsTokens[_0x255dfc['id']]={'access_token':_0x48e7bc['access_token'],'expires_in':moment()[_0xa950('0x29')](_0x48e7bc[_0xa950('0x1e')],'seconds')};_0x36291c(_0x48e7bc[_0xa950('0x1c')]);})[_0xa950('0x2a')](function(_0xe06d3a){logger[_0xa950('0x2b')](_0xa950('0x2c'),_0xe06d3a[_0xa950('0x2d')]);_0x5ec0cd(_0xe06d3a);});});}function getUser(_0x48a711,_0x1f332c,_0x6d5632,_0x25f351){logger['info']('Search\x20user');return request({'method':_0xa950('0x2e'),'uri':util['format'](_0xa950('0x2f'),_0x1f332c),'qs':{'type':_0xa950('0x30')},'headers':{'Authorization':_0xa950('0x31')+_0x48a711},'json':!![]})[_0xa950('0x32')](function(_0x21e674){if(_0x21e674['users']){var _0x46f615=-0x1;if(_['isArrayLikeObject'](_0x21e674[_0xa950('0x33')])){if(!_[_0xa950('0x1b')](_0x25f351)){_0x46f615=_[_0xa950('0x34')](_0x21e674['users'],function(_0xd254e0){return _0xd254e0['email']===_0x25f351;});}if(_0x46f615>=0x0){logger['info'](_0xa950('0x35'));}else{logger[_0xa950('0x36')](_0xa950('0x37'));_0x46f615=_[_0xa950('0x34')](_0x21e674[_0xa950('0x33')],function(_0x30e1ff){return _0x30e1ff[_0xa950('0x38')][_0xa950('0x18')]===_0xa950('0x39');});}return _0x21e674[_0xa950('0x33')][_0x46f615];}else{if(_0x21e674[_0xa950('0x3a')]['profile'][_0xa950('0x18')]===_0xa950('0x39')){logger[_0xa950('0x36')]('Using\x20the\x20admin\x20account!');user=_0x21e674[_0xa950('0x3a')];return user;}else{logger[_0xa950('0x2b')](_0xa950('0x3b'),JSON[_0xa950('0xc')](_0x21e674));throw new Error(_0xa950('0x3c')+JSON[_0xa950('0xc')](_0x21e674));}}}else{logger[_0xa950('0x2b')](_0xa950('0x3b'),JSON[_0xa950('0xc')](_0x21e674));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x21e674));}})[_0xa950('0x2a')](function(_0x32541a){console[_0xa950('0x2b')](_0x32541a);});}function getZohoUser(_0x47b7bd,_0x5ed179){return new BPromise(function(_0x5252d1,_0x4ae8cb){request(_0x47b7bd)[_0xa950('0x32')](function(_0x29a59f){var _0x4a539f=null;if(_0x29a59f){_0x4a539f=_0x29a59f[_0xa950('0x3d')][0x0];_0x4a539f[_0xa950('0x3e')]=_0x5ed179;}_0x5252d1(_0x4a539f);})[_0xa950('0x2a')](function(_0x3c32e6){_0x4ae8cb(_0x3c32e6);});});}function createEndUser(_0x524d01,_0x2e5e41,_0x2ef4c8,_0x53c0a9,_0x5d625c,_0x2f634e){var _0x2ef4c8=getName(_0x2ef4c8);return request({'method':_0xa950('0x23'),'uri':_0xa950('0x3f')+_0x2e5e41+'/crm/v2/'+_['startCase'](_0x2f634e[_0xa950('0x40')])+'s','body':{'data':[{'Last_Name':_0x2ef4c8[0x1],'First_Name':_0x2ef4c8[0x0],'Phone':_0x53c0a9,'Owner':{'name':!_[_0xa950('0x1b')](_0x5d625c[_0xa950('0x41')][_0xa950('0x18')])?_0x5d625c['role'][_0xa950('0x18')]:!_['isNil'](_0x5d625c[_0xa950('0x42')])?_0x5d625c['first_name']+'\x20'+_0x5d625c['last_name']:_0x5d625c[_0xa950('0x43')],'id':_0x5d625c['id']}}]},'headers':{'Authorization':_0xa950('0x31')+_0x524d01},'json':!![]})[_0xa950('0x32')](function(_0x481b9e){if(_0x481b9e&&_0x481b9e[_0xa950('0x3d')][0x0][_0xa950('0x44')]===_0xa950('0x45')){var _0x221eab=_0x481b9e[_0xa950('0x3d')][0x0][_0xa950('0x46')];_0x221eab[_0xa950('0x3e')]=_[_0xa950('0x47')](_0x2f634e[_0xa950('0x40')])+'s';return _0x221eab;}logger[_0xa950('0x2b')](_0xa950('0x3b'),JSON['stringify'](data));throw new Error(_0xa950('0x48')+JSON[_0xa950('0xc')](data));})[_0xa950('0x2a')](function(_0x609ea){console['log'](_0xa950('0x49'),_0x609ea);});}function getEndUser(_0x45d79e,_0x4112c5,_0x1c864c,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742){var _0x5522b8={'method':_0xa950('0x2e'),'uri':'','headers':{'Authorization':_0xa950('0x31')+_0x45d79e},'json':!![]};switch(_0x5ec742[_0xa950('0x4a')]){case _0xa950('0x4b'):_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+_0xa950('0x4d')+_0x5ed791+'))';return getZohoUser(_0x5522b8,'Contacts')[_0xa950('0x32')](function(_0x4d0829){if(_0x4d0829)return _0x4d0829;_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+_0xa950('0x4e')+_0x5ed791+'))';return getZohoUser(_0x5522b8,'Leads')[_0xa950('0x32')](function(_0x44fc78){if(_0x44fc78)return _0x44fc78;if(_0x5ec742[_0xa950('0x40')]!='nothing'){return createEndUser(_0x45d79e,_0x4112c5,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742);}else{return{};}});});break;case _0xa950('0x4f'):_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+_0xa950('0x4d')+_0x5ed791+'))';return getZohoUser(_0x5522b8,'Contacts')['then'](function(_0xd35fc0){if(_0xd35fc0)return _0xd35fc0;if(_0x5ec742[_0xa950('0x40')]!=_0xa950('0x50')){return createEndUser(_0x45d79e,_0x4112c5,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742);}else{return{};}});break;case _0xa950('0x51'):_0x5522b8[_0xa950('0x4c')]=_0xa950('0x3f')+_0x4112c5+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5ed791+'))';return getZohoUser(_0x5522b8,_0xa950('0x52'))[_0xa950('0x32')](function(_0x3573f3){if(_0x3573f3)return _0x3573f3;if(_0x5ec742['moduleCreate']!=_0xa950('0x50')){return createEndUser(_0x45d79e,_0x4112c5,_0x142413,_0x5ed791,_0x29e1e0,_0x5ec742);}else{return{};}});break;}}function getCall(_0x5f42ed,_0x114f0d,_0x54da3a,_0xa5f66e,_0x59cb18,_0x25628f,_0x1cfdbf,_0x5b6f1b){logger[_0xa950('0x36')](_0xa950('0x53'));var _0x3a4f73={};_0x3a4f73[_0xa950('0x54')]={'name':!_['isNil'](_0xa5f66e['role']['name'])&&!_[_0xa950('0x1b')](_0xa5f66e[_0xa950('0x38')][_0xa950('0x18')])&&_0xa5f66e[_0xa950('0x38')][_0xa950('0x18')]===_0xa950('0x55')?_0xa5f66e[_0xa950('0x41')][_0xa950('0x18')]:!_['isNil'](_0xa5f66e['first_name'])?_0xa5f66e['first_name']+'\x20'+_0xa5f66e[_0xa950('0x43')]:_0xa5f66e[_0xa950('0x43')],'id':_0xa5f66e['id']};_0x3a4f73[_0xa950('0x56')]=intUtil[_0xa950('0x57')](_0x25628f[_0xa950('0x58')],_0x1cfdbf,'\x20');_0x3a4f73[_0xa950('0x59')]=intUtil[_0xa950('0x57')](_0x25628f['Descriptions'],_0x1cfdbf,'\x0a');if(_0x59cb18[_0xa950('0x3e')]===_0xa950('0x5a')){_0x3a4f73[_0xa950('0x5b')]={'name':!_[_0xa950('0x1b')](_0x59cb18[_0xa950('0x5c')])?_0x59cb18['Full_Name']:!_[_0xa950('0x1b')](_0x59cb18[_0xa950('0x5d')])?_0x59cb18['First_Name']+'\x20'+_0x59cb18[_0xa950('0x5e')]:_0x59cb18[_0xa950('0x5e')],'id':_0x59cb18['id']};}if(_0x59cb18[_0xa950('0x3e')]==='Leads'){_0x3a4f73['What_Id']={'name':!_['isNil'](_0x59cb18[_0xa950('0x5c')])?_0x59cb18['Full_Name']:!_[_0xa950('0x1b')](_0x59cb18[_0xa950('0x5d')])?_0x59cb18[_0xa950('0x5d')]+'\x20'+_0x59cb18[_0xa950('0x5e')]:_0x59cb18[_0xa950('0x5e')],'id':_0x59cb18['id']};_0x3a4f73[_0xa950('0x5f')]=_[_0xa950('0x47')](_0x59cb18[_0xa950('0x3e')]);}if(_0x1cfdbf['talktime']){_0x3a4f73[_0xa950('0x60')]=moment[_0xa950('0x61')](parseInt(_0x1cfdbf[_0xa950('0x62')])*0x3e8)[_0xa950('0x63')]('mm:ss');}else if(_0x1cfdbf[_0xa950('0x64')]&&_0x1cfdbf[_0xa950('0x65')]){_0x3a4f73[_0xa950('0x60')]=moment[_0xa950('0x61')](moment(_0x1cfdbf[_0xa950('0x65')],_0xa950('0x66'))['diff'](moment(_0x1cfdbf[_0xa950('0x67')],_0xa950('0x66'))))['format'](_0xa950('0x68'));}switch(_0x1cfdbf['lastevent']){case'called':_0x3a4f73[_0xa950('0x69')]=_0xa950('0x6a');break;case'complete':case _0xa950('0x6b'):_0x3a4f73[_0xa950('0x69')]=_0xa950('0x6c');break;case'rejected':_0x3a4f73['Call_Result']=_0xa950('0x6d');break;case _0xa950('0x6e'):_0x3a4f73[_0xa950('0x69')]=_0xa950('0x6f');break;case'timeout':_0x3a4f73[_0xa950('0x69')]=_0xa950('0x70');default:}_0x3a4f73['Call_Start_Time']=(_0x5b6f1b===_0xa950('0x71')?moment(_0x1cfdbf['starttime'])[_0xa950('0x63')](_0xa950('0x66')):moment(_0x1cfdbf[_0xa950('0x72')])[_0xa950('0x63')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xa950('0x63')]('YYYY-MM-DDTHH:mm:ss');_0x3a4f73[_0xa950('0x73')]=_0x5b6f1b||_0xa950('0x74');_0x3a4f73=_[_0xa950('0x75')](_0x3a4f73,getCustomFields(_0x25628f[_0xa950('0x76')],_0x1cfdbf));return request({'method':'POST','uri':_0xa950('0x3f')+_0x114f0d+_0xa950('0x77'),'headers':{'Authorization':_0xa950('0x31')+_0x5f42ed},'body':{'data':[_0x3a4f73]},'json':!![]})[_0xa950('0x32')](function(_0x30ba01){if(_0x30ba01&&_0x30ba01[_0xa950('0x3d')][0x0][_0xa950('0x44')]==='SUCCESS'){logger['info'](_0xa950('0x78'));return{'id':_0x30ba01[_0xa950('0x3d')][0x0]['details']['id']};}})['catch'](function(_0x538f01){logger[_0xa950('0x36')]('err',_0x538f01['stack']);console[_0xa950('0x79')](_0xa950('0x7a'),_0x538f01);});}exports[_0xa950('0x7b')]=function(_0x41e012,_0x3a783b,_0x2f60ec,_0x57e9e9,_0x225aed,_0x5a3a6e){var _0x1eb8b7,_0x235e30,_0xd416c7;_0x5a3a6e[_0xa950('0x7c')]=intUtil[_0xa950('0x7d')](_0x5a3a6e['host']);_0x5a3a6e[_0xa950('0x7e')]=intUtil[_0xa950('0x7d')](_0x5a3a6e[_0xa950('0x7e')]);if(_0x225aed&&_0x225aed[_0xa950('0x7f')]){logger[_0xa950('0x36')](_0xa950('0x80'),'Recording\x20is\x20enabled!');_0x3a783b[_0xa950('0x81')]=_0x5a3a6e[_0xa950('0x7e')]+_0xa950('0x82')+_0x3a783b[_0xa950('0x83')]+_0xa950('0x84')+md5(_0x3a783b['uniqueid']);}else{_0x3a783b['recordingURL']='';}var _0x5dccd8=_0x5a3a6e[_0xa950('0x7c')]==='zoho.eu'?'eu':_0xa950('0x85');return getAccessToken(_0x5a3a6e)[_0xa950('0x32')](function(_0x2c6baa){_0xd416c7=_0x2c6baa;return getUser(_0xd416c7,_0x5dccd8,_0x5a3a6e,_0x57e9e9[_0xa950('0x86')]);})[_0xa950('0x32')](function(_0x57c792){_0x1eb8b7=_0x57c792;logger['info'](_0xa950('0x87'),_0x1eb8b7['id']);return getEndUser(_0xd416c7,_0x5dccd8,_0x5a3a6e,_0x3a783b[_0xa950('0x88')],_0x3a783b[_0xa950('0x89')],_0x1eb8b7,_0x2f60ec);})[_0xa950('0x32')](function(_0x4018cd){_0x235e30=_0x4018cd;return getCall(_0xd416c7,_0x5dccd8,_0x5a3a6e,_0x1eb8b7,_0x235e30,_0x2f60ec,_0x3a783b,'Inbound');})[_0xa950('0x32')](function(_0x23e2fd){if(_0x23e2fd){logger['info'](_0xa950('0x8a'),_0x23e2fd['id']);logger[_0xa950('0x36')](_0xa950('0x80'),_0xa950('0x8b'));emit(util['format'](_0xa950('0x8c'),_0x57e9e9['name']),_0xa950('0x8d'),{'uri':_0xa950('0x8e')+_0x5a3a6e[_0xa950('0x7c')]+_0xa950('0x8f')+_0x23e2fd['id']});}})['catch'](function(_0x356e16){logger[_0xa950('0x2b')](_0xa950('0x80'),JSON['stringify'](_0x356e16));});};exports[_0xa950('0x71')]=function(_0x50cfca,_0x5c4ed2,_0x4c011f,_0x4b066e,_0x3dba70,_0x3b26d5,_0x431118){var _0x18d886,_0x567d1b,_0x2e4ff6;_0x3b26d5[_0xa950('0x7c')]=intUtil[_0xa950('0x7d')](_0x3b26d5[_0xa950('0x7c')]);_0x3b26d5[_0xa950('0x7e')]=intUtil['stripTrailingSlash'](_0x3b26d5[_0xa950('0x7e')]);if(_0x431118&&_0x431118[_0xa950('0x90')]&&_0x431118[_0xa950('0x90')]!==_0xa950('0x91')){logger[_0xa950('0x36')](_0xa950('0x92'),_0xa950('0x93'));_0x5c4ed2[_0xa950('0x81')]=_0x3b26d5[_0xa950('0x7e')]+'/api/voice/recordings/'+_0x5c4ed2[_0xa950('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x5c4ed2[_0xa950('0x83')]);}var _0x582c1c=_0x3b26d5[_0xa950('0x7c')]===_0xa950('0x94')?'eu':'com';return getAccessToken(_0x3b26d5)[_0xa950('0x32')](function(_0x1c24c6){_0x2e4ff6=_0x1c24c6;return getUser(_0x2e4ff6,_0x582c1c,_0x3b26d5,_0x4b066e['email']);})[_0xa950('0x32')](function(_0x26b8c8){_0x18d886=_0x26b8c8;logger[_0xa950('0x36')](_0xa950('0x87'),_0x18d886['id']);return getEndUser(_0x2e4ff6,_0x582c1c,_0x3b26d5,_0x5c4ed2[_0xa950('0x95')],_0x5c4ed2[_0xa950('0x96')],_0x18d886,_0x4c011f);})['then'](function(_0x4a0071){_0x567d1b=_0x4a0071;return getCall(_0x2e4ff6,_0x582c1c,_0x3b26d5,_0x18d886,_0x567d1b,_0x4c011f,_0x5c4ed2,_0xa950('0x97'));})[_0xa950('0x32')](function(_0x32e0d8){if(_0x32e0d8){logger[_0xa950('0x36')](_0xa950('0x8a'),_0x32e0d8['id']);logger[_0xa950('0x36')](_0xa950('0x92'),_0xa950('0x8b'));emit(util[_0xa950('0x63')](_0xa950('0x8c'),_0x4b066e[_0xa950('0x18')]),_0xa950('0x8d'),{'uri':'https://crm.'+_0x3b26d5[_0xa950('0x7c')]+_0xa950('0x8f')+_0x32e0d8['id']});}})[_0xa950('0x2a')](function(_0x55bff8){logger['error']('[OUTBOUND]',JSON[_0xa950('0xc')](_0x55bff8));});};exports['unmanaged']=function(_0x8231ed,_0xa85073,_0xd38c71,_0x3ec4fe,_0x313212,_0x1c1329){var _0x4bea36,_0x17af6b,_0x41c585;_0x1c1329['host']=intUtil[_0xa950('0x7d')](_0x1c1329[_0xa950('0x7c')]);_0x1c1329['serverUrl']=intUtil[_0xa950('0x7d')](_0x1c1329['serverUrl']);if(_0x313212&&_0x313212[_0xa950('0x7f')]){logger[_0xa950('0x36')]('['+_0xa85073[_0xa950('0x98')][_0xa950('0x99')]()+']',_0xa950('0x93'));_0xa85073[_0xa950('0x81')]=_0x1c1329[_0xa950('0x7e')]+_0xa950('0x82')+_0xa85073[_0xa950('0x83')]+'/downloads?type=uniqueid&token='+md5(_0xa85073['uniqueid']);}else{_0xa85073[_0xa950('0x81')]='';}var _0x4adc2d=_0x1c1329[_0xa950('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x1c1329)[_0xa950('0x32')](function(_0x2dedeb){_0x41c585=_0x2dedeb;return getUser(_0x41c585,_0x4adc2d,_0x1c1329);})['then'](function(_0x262954){_0x4bea36=_0x262954;logger[_0xa950('0x36')](_0xa950('0x87'),_0x4bea36['id']);return getEndUser(_0x41c585,_0x4adc2d,_0x1c1329,_0xa85073[_0xa950('0x88')],_0xa85073[_0xa950('0x89')],_0x4bea36,_0xd38c71);})['then'](function(_0x27c6a4){_0x17af6b=_0x27c6a4;return getCall(_0x41c585,_0x4adc2d,_0x1c1329,_0x4bea36,_0x17af6b,_0xd38c71,_0xa85073,_0xa950('0x74'));})[_0xa950('0x32')](function(_0x46a02f){if(_0x46a02f){logger[_0xa950('0x36')]('The\x20Call\x20ID\x20is:',_0x46a02f['id']);}})['catch'](function(_0x35f73b){logger['error']('['+_0xa85073['lastevent'][_0xa950('0x99')]()+']',JSON[_0xa950('0xc')](_0x35f73b));});}; \ No newline at end of file +var _0x6a27=['zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','Abandoned','timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','details','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a27,0x152));var _0x76a2=function(_0x4d7db7,_0x4f017e){_0x4d7db7=_0x4d7db7-0x0;var _0x136a30=_0x6a27[_0x4d7db7];return _0x136a30;};'use strict';var _=require(_0x76a2('0x0'));var rp=require(_0x76a2('0x1'));var md5=require(_0x76a2('0x2'));var util=require(_0x76a2('0x3'));var intUtil=require(_0x76a2('0x4'));var moment=require(_0x76a2('0x5'));var Redis=require('ioredis');var BPromise=require(_0x76a2('0x6'));var config=require(_0x76a2('0x7'));var logger=require(_0x76a2('0x8'))('zoho');config[_0x76a2('0x9')]=_[_0x76a2('0xa')](config['redis'],{'host':_0x76a2('0xb'),'port':0x18eb});var io=require(_0x76a2('0xc'))(new Redis(config[_0x76a2('0x9')]));function emit(_0x126ba9,_0x3c1dcc,_0x2557c8){io['to'](_0x126ba9)['emit'](_0x3c1dcc,_0x2557c8);}function request(_0xef6c6a){logger[_0x76a2('0xd')](_0x76a2('0xe'),JSON[_0x76a2('0xf')](_0xef6c6a));return rp(_0xef6c6a);}function getCustomFields(_0x302a07,_0x4377f8){var _0x157786={};if(_0x302a07[_0x76a2('0x10')]>0x0){_[_0x76a2('0x11')](_0x302a07,function(_0x3d33bf){if(_[_0x76a2('0x12')]([_0x76a2('0x13'),_0x76a2('0x14')],_0x3d33bf['type'])&&_0x3d33bf[_0x76a2('0x15')]){_0x157786[_0x3d33bf['idField']]=_0x3d33bf[_0x76a2('0x16')][_0x76a2('0x17')]();}else if(_0x3d33bf[_0x76a2('0x18')]===_0x76a2('0x19')&&_0x3d33bf['variableName']&&_0x3d33bf['idField']&&_0x4377f8[_0x3d33bf[_0x76a2('0x1a')]]){_0x157786[_0x3d33bf['idField']]=_0x4377f8[_0x3d33bf[_0x76a2('0x1a')]][_0x76a2('0x17')]();}else if(_0x3d33bf[_0x76a2('0x18')]===_0x76a2('0x1b')&&_0x3d33bf[_0x76a2('0x1c')]&&_0x3d33bf['Variable'][_0x76a2('0x1d')]&&_0x3d33bf[_0x76a2('0x15')]&&_0x4377f8[_0x3d33bf[_0x76a2('0x1c')][_0x76a2('0x1d')][_0x76a2('0x1e')]()]){_0x157786[_0x3d33bf[_0x76a2('0x15')]]=_0x4377f8[_0x3d33bf['Variable'][_0x76a2('0x1d')][_0x76a2('0x1e')]()][_0x76a2('0x17')]();}});}return _0x157786;}function getName(_0x5ac7cf){if(_0x5ac7cf['indexOf']('\x20')>0x0){var _0x112fe0=_0x5ac7cf[_0x76a2('0x1f')](/ (.+)/);if(_0x112fe0[0x1]){return _0x112fe0;}}return[_0x5ac7cf,_0x5ac7cf];}var accountsTokens={};function getAccessToken(_0x51e73d){return new Promise(function(_0x114f74,_0x5dba10){if(!_[_0x76a2('0x20')](accountsTokens[_0x51e73d['id']])&&!_[_0x76a2('0x20')](accountsTokens[_0x51e73d['id']][_0x76a2('0x21')])){if(moment()[_0x76a2('0x22')](accountsTokens[_0x51e73d['id']][_0x76a2('0x23')])){_0x114f74(accountsTokens[_0x51e73d['id']][_0x76a2('0x21')]);}}var _0x51fc65;switch(_0x51e73d[_0x76a2('0x24')]){case'US':_0x51fc65=_0x76a2('0x25');break;case'AU':_0x51fc65=_0x76a2('0x26');break;case'EU':_0x51fc65=_0x76a2('0x27');break;case'IN':_0x51fc65=_0x76a2('0x28');break;case'CN':_0x51fc65=_0x76a2('0x29');break;default:_0x51fc65=_0x76a2('0x27');break;}var _0x2e9512={'method':_0x76a2('0x2a'),'uri':_0x51fc65+'/oauth/v2/token','qs':{'refresh_token':_0x51e73d[_0x76a2('0x2b')],'client_id':_0x51e73d[_0x76a2('0x2c')],'client_secret':_0x51e73d['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x2e9512)[_0x76a2('0x2d')](function(_0x3bf795){accountsTokens[_0x51e73d['id']]={'access_token':_0x3bf795[_0x76a2('0x21')],'expires_in':moment()[_0x76a2('0x2e')](_0x3bf795[_0x76a2('0x23')],_0x76a2('0x2f'))};_0x114f74(_0x3bf795[_0x76a2('0x21')]);})['catch'](function(_0x5497e2){logger[_0x76a2('0x30')](_0x76a2('0x31'),_0x5497e2['stack']);_0x5dba10(_0x5497e2);});});}function getUser(_0x1a0c76,_0x27d287,_0x2c669b,_0x2d5238){logger[_0x76a2('0x32')](_0x76a2('0x33'));return request({'method':_0x76a2('0x34'),'uri':util[_0x76a2('0x35')](_0x76a2('0x36'),_0x27d287),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x76a2('0x37')+_0x1a0c76},'json':!![]})[_0x76a2('0x2d')](function(_0x5eba35){if(_0x5eba35[_0x76a2('0x38')]){var _0x115ff8=-0x1;if(_[_0x76a2('0x39')](_0x5eba35[_0x76a2('0x38')])){if(!_['isNil'](_0x2d5238)){_0x115ff8=_[_0x76a2('0x3a')](_0x5eba35[_0x76a2('0x38')],function(_0x3e3f6a){return _0x3e3f6a[_0x76a2('0x3b')]===_0x2d5238;});}if(_0x115ff8>=0x0){logger['info'](_0x76a2('0x3c'));}else{logger['info'](_0x76a2('0x3d'));_0x115ff8=_[_0x76a2('0x3a')](_0x5eba35[_0x76a2('0x38')],function(_0x2746b4){return _0x2746b4['profile'][_0x76a2('0x1d')]===_0x76a2('0x3e');});}return _0x5eba35[_0x76a2('0x38')][_0x115ff8];}else{if(_0x5eba35['user'][_0x76a2('0x3f')][_0x76a2('0x1d')]==='Administrator'){logger['info'](_0x76a2('0x3d'));user=_0x5eba35[_0x76a2('0x40')];return user;}else{logger[_0x76a2('0x30')](_0x76a2('0x41'),JSON[_0x76a2('0xf')](_0x5eba35));throw new Error(_0x76a2('0x42')+JSON['stringify'](_0x5eba35));}}}else{logger[_0x76a2('0x30')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x5eba35));throw new Error(_0x76a2('0x42')+JSON['stringify'](_0x5eba35));}})[_0x76a2('0x43')](function(_0x140b1b){console[_0x76a2('0x30')](_0x140b1b);});}function getZohoUser(_0x3dfb05,_0x3d83fb){return new BPromise(function(_0x32358e,_0x1fd88b){request(_0x3dfb05)[_0x76a2('0x2d')](function(_0x4dcbe6){var _0x26c1d3=null;if(_0x4dcbe6){_0x26c1d3=_0x4dcbe6[_0x76a2('0x44')][0x0];_0x26c1d3[_0x76a2('0x45')]=_0x3d83fb;}_0x32358e(_0x26c1d3);})[_0x76a2('0x43')](function(_0x2c2d37){_0x1fd88b(_0x2c2d37);});});}function createEndUser(_0x3de01a,_0x1d2190,_0x219af3,_0x6c9457,_0x43751f,_0x5543b2){var _0x219af3=getName(_0x219af3);return request({'method':'POST','uri':_0x76a2('0x46')+_0x1d2190+'/crm/v2/'+_[_0x76a2('0x47')](_0x5543b2[_0x76a2('0x48')])+'s','body':{'data':[{'Last_Name':_0x219af3[0x1],'First_Name':_0x219af3[0x0],'Phone':_0x6c9457,'Owner':{'name':!_[_0x76a2('0x20')](_0x43751f[_0x76a2('0x49')]['name'])?_0x43751f[_0x76a2('0x49')][_0x76a2('0x1d')]:!_[_0x76a2('0x20')](_0x43751f[_0x76a2('0x4a')])?_0x43751f[_0x76a2('0x4a')]+'\x20'+_0x43751f[_0x76a2('0x4b')]:_0x43751f[_0x76a2('0x4b')],'id':_0x43751f['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3de01a},'json':!![]})['then'](function(_0x31c3e6){if(_0x31c3e6&&_0x31c3e6['data'][0x0][_0x76a2('0x4c')]===_0x76a2('0x4d')){var _0x20016c=_0x31c3e6[_0x76a2('0x44')][0x0]['details'];_0x20016c[_0x76a2('0x45')]=_['startCase'](_0x5543b2[_0x76a2('0x48')])+'s';return _0x20016c;}logger[_0x76a2('0x30')](_0x76a2('0x41'),JSON[_0x76a2('0xf')](data));throw new Error(_0x76a2('0x4e')+JSON[_0x76a2('0xf')](data));})[_0x76a2('0x43')](function(_0x1a2bd3){console[_0x76a2('0x4f')](_0x76a2('0x50'),_0x1a2bd3);});}function getEndUser(_0x5d1e18,_0x563428,_0x223ca2,_0x24af56,_0x1ee271,_0x8c6b34,_0xffafb5){var _0x2b0ae3={'method':_0x76a2('0x34'),'uri':'','headers':{'Authorization':_0x76a2('0x37')+_0x5d1e18},'json':!![]};switch(_0xffafb5[_0x76a2('0x51')]){case _0x76a2('0x52'):_0x2b0ae3[_0x76a2('0x53')]=_0x76a2('0x46')+_0x563428+_0x76a2('0x54')+_0x1ee271+'))';return getZohoUser(_0x2b0ae3,_0x76a2('0x55'))['then'](function(_0x1cb650){if(_0x1cb650)return _0x1cb650;_0x2b0ae3[_0x76a2('0x53')]=_0x76a2('0x46')+_0x563428+_0x76a2('0x56')+_0x1ee271+'))';return getZohoUser(_0x2b0ae3,_0x76a2('0x57'))[_0x76a2('0x2d')](function(_0x15d137){if(_0x15d137)return _0x15d137;if(_0xffafb5['moduleCreate']!=_0x76a2('0x58')){return createEndUser(_0x5d1e18,_0x563428,_0x24af56,_0x1ee271,_0x8c6b34,_0xffafb5);}else{return{};}});});break;case _0x76a2('0x59'):_0x2b0ae3[_0x76a2('0x53')]=_0x76a2('0x46')+_0x563428+_0x76a2('0x54')+_0x1ee271+'))';return getZohoUser(_0x2b0ae3,_0x76a2('0x55'))[_0x76a2('0x2d')](function(_0x55fff0){if(_0x55fff0)return _0x55fff0;if(_0xffafb5[_0x76a2('0x48')]!=_0x76a2('0x58')){return createEndUser(_0x5d1e18,_0x563428,_0x24af56,_0x1ee271,_0x8c6b34,_0xffafb5);}else{return{};}});break;case _0x76a2('0x5a'):_0x2b0ae3[_0x76a2('0x53')]='https://www.zohoapis.'+_0x563428+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1ee271+'))';return getZohoUser(_0x2b0ae3,'Leads')[_0x76a2('0x2d')](function(_0x48b086){if(_0x48b086)return _0x48b086;if(_0xffafb5[_0x76a2('0x48')]!=_0x76a2('0x58')){return createEndUser(_0x5d1e18,_0x563428,_0x24af56,_0x1ee271,_0x8c6b34,_0xffafb5);}else{return{};}});break;}}function getCall(_0xe05b53,_0x173fb5,_0x2e4a91,_0x66ef6e,_0x521cb1,_0x2498e4,_0x11d4ae,_0x2e2856){logger[_0x76a2('0x32')](_0x76a2('0x5b'));var _0x4b93e8={};_0x4b93e8[_0x76a2('0x5c')]={'name':!_[_0x76a2('0x20')](_0x66ef6e['role'][_0x76a2('0x1d')])&&!_['isNil'](_0x66ef6e[_0x76a2('0x3f')][_0x76a2('0x1d')])&&_0x66ef6e[_0x76a2('0x3f')]['name']===_0x76a2('0x5d')?_0x66ef6e[_0x76a2('0x49')]['name']:!_[_0x76a2('0x20')](_0x66ef6e[_0x76a2('0x4a')])?_0x66ef6e[_0x76a2('0x4a')]+'\x20'+_0x66ef6e[_0x76a2('0x4b')]:_0x66ef6e[_0x76a2('0x4b')],'id':_0x66ef6e['id']};_0x4b93e8[_0x76a2('0x5e')]=intUtil[_0x76a2('0x5f')](_0x2498e4['Subjects'],_0x11d4ae,'\x20');_0x4b93e8[_0x76a2('0x60')]=intUtil[_0x76a2('0x5f')](_0x2498e4[_0x76a2('0x61')],_0x11d4ae,'\x0a');if(_0x521cb1[_0x76a2('0x45')]===_0x76a2('0x55')){_0x4b93e8[_0x76a2('0x62')]={'name':!_[_0x76a2('0x20')](_0x521cb1['Full_Name'])?_0x521cb1[_0x76a2('0x63')]:!_[_0x76a2('0x20')](_0x521cb1[_0x76a2('0x64')])?_0x521cb1['First_Name']+'\x20'+_0x521cb1[_0x76a2('0x65')]:_0x521cb1['Last_Name'],'id':_0x521cb1['id']};}if(_0x521cb1[_0x76a2('0x45')]===_0x76a2('0x57')){_0x4b93e8[_0x76a2('0x66')]={'name':!_['isNil'](_0x521cb1[_0x76a2('0x63')])?_0x521cb1[_0x76a2('0x63')]:!_['isNil'](_0x521cb1[_0x76a2('0x64')])?_0x521cb1[_0x76a2('0x64')]+'\x20'+_0x521cb1['Last_Name']:_0x521cb1[_0x76a2('0x65')],'id':_0x521cb1['id']};_0x4b93e8[_0x76a2('0x67')]=_['startCase'](_0x521cb1['enduserType']);}if(_0x11d4ae['talktime']){_0x4b93e8[_0x76a2('0x68')]=moment[_0x76a2('0x69')](parseInt(_0x11d4ae[_0x76a2('0x6a')])*0x3e8)[_0x76a2('0x35')](_0x76a2('0x6b'));}else if(_0x11d4ae[_0x76a2('0x6c')]&&_0x11d4ae['endtime']){_0x4b93e8[_0x76a2('0x68')]=moment[_0x76a2('0x69')](moment(_0x11d4ae['endtime'],_0x76a2('0x6d'))[_0x76a2('0x6e')](moment(_0x11d4ae[_0x76a2('0x6f')],_0x76a2('0x6d'))))['format'](_0x76a2('0x6b'));}switch(_0x11d4ae[_0x76a2('0x70')]){case _0x76a2('0x71'):_0x4b93e8[_0x76a2('0x72')]=_0x76a2('0x73');break;case _0x76a2('0x74'):case _0x76a2('0x75'):_0x4b93e8[_0x76a2('0x72')]='Answered';break;case _0x76a2('0x76'):_0x4b93e8[_0x76a2('0x72')]=_0x76a2('0x77');break;case'abandoned':_0x4b93e8[_0x76a2('0x72')]=_0x76a2('0x78');break;case _0x76a2('0x79'):_0x4b93e8[_0x76a2('0x72')]='Timeout';default:}_0x4b93e8['Call_Start_Time']=(_0x2e2856===_0x76a2('0x7a')?moment(_0x11d4ae[_0x76a2('0x6f')])['format'](_0x76a2('0x6d')):moment(_0x11d4ae[_0x76a2('0x7b')])[_0x76a2('0x35')](_0x76a2('0x6d')))||moment()[_0x76a2('0x35')](_0x76a2('0x6d'));_0x4b93e8[_0x76a2('0x7c')]=_0x2e2856||_0x76a2('0x7d');_0x4b93e8=_[_0x76a2('0x7e')](_0x4b93e8,getCustomFields(_0x2498e4['Fields'],_0x11d4ae));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x173fb5+_0x76a2('0x7f'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xe05b53},'body':{'data':[_0x4b93e8]},'json':!![]})[_0x76a2('0x2d')](function(_0x4bba1f){if(_0x4bba1f&&_0x4bba1f[_0x76a2('0x44')][0x0]['code']==='SUCCESS'){logger[_0x76a2('0x32')](_0x76a2('0x80'));return{'id':_0x4bba1f[_0x76a2('0x44')][0x0][_0x76a2('0x81')]['id']};}})[_0x76a2('0x43')](function(_0xde87da){logger['info'](_0x76a2('0x82'),_0xde87da[_0x76a2('0x83')]);console['log']('err',_0xde87da);});}exports[_0x76a2('0x84')]=function(_0x4418cb,_0x505ec2,_0x493987,_0x968f03,_0x71dba4,_0x5cdf6c){var _0x6b8f0c,_0xf62524,_0x1d74f6;_0x5cdf6c[_0x76a2('0x85')]=intUtil[_0x76a2('0x86')](_0x5cdf6c[_0x76a2('0x85')]);_0x5cdf6c[_0x76a2('0x87')]=intUtil[_0x76a2('0x86')](_0x5cdf6c[_0x76a2('0x87')]);if(_0x71dba4&&_0x71dba4[_0x76a2('0x88')]){logger[_0x76a2('0x32')]('[QUEUE]',_0x76a2('0x89'));_0x505ec2[_0x76a2('0x8a')]=_0x5cdf6c[_0x76a2('0x87')]+_0x76a2('0x8b')+_0x505ec2['uniqueid']+_0x76a2('0x8c')+md5(_0x505ec2[_0x76a2('0x8d')]);}else{_0x505ec2[_0x76a2('0x8a')]='';}var _0x16e8c8=_0x5cdf6c[_0x76a2('0x85')]===_0x76a2('0x8e')?'eu':_0x76a2('0x8f');return getAccessToken(_0x5cdf6c)['then'](function(_0x3d3bb5){_0x1d74f6=_0x3d3bb5;return getUser(_0x1d74f6,_0x16e8c8,_0x5cdf6c,_0x968f03[_0x76a2('0x3b')]);})[_0x76a2('0x2d')](function(_0x4a753a){_0x6b8f0c=_0x4a753a;logger[_0x76a2('0x32')](_0x76a2('0x90'),_0x6b8f0c['id']);return getEndUser(_0x1d74f6,_0x16e8c8,_0x5cdf6c,_0x505ec2[_0x76a2('0x91')],_0x505ec2['calleridnum'],_0x6b8f0c,_0x493987);})['then'](function(_0x2c2886){_0xf62524=_0x2c2886;return getCall(_0x1d74f6,_0x16e8c8,_0x5cdf6c,_0x6b8f0c,_0xf62524,_0x493987,_0x505ec2,_0x76a2('0x7d'));})[_0x76a2('0x2d')](function(_0x325624){if(_0x325624){logger[_0x76a2('0x32')]('The\x20Call\x20ID\x20is:',_0x325624['id']);logger[_0x76a2('0x32')](_0x76a2('0x92'),_0x76a2('0x93'));emit(util[_0x76a2('0x35')](_0x76a2('0x94'),_0x968f03[_0x76a2('0x1d')]),_0x76a2('0x95'),{'uri':_0x76a2('0x96')+_0x5cdf6c['host']+_0x76a2('0x97')+_0x325624['id']});}})[_0x76a2('0x43')](function(_0x13a41c){logger[_0x76a2('0x30')](_0x76a2('0x92'),JSON[_0x76a2('0xf')](_0x13a41c));});};exports[_0x76a2('0x7a')]=function(_0x183de0,_0x33828e,_0x3d4260,_0xfd6f63,_0x22fd6b,_0x49514c,_0x18a032){var _0x25e340,_0x338d96,_0x2a9bf2;_0x49514c[_0x76a2('0x85')]=intUtil[_0x76a2('0x86')](_0x49514c[_0x76a2('0x85')]);_0x49514c['serverUrl']=intUtil[_0x76a2('0x86')](_0x49514c[_0x76a2('0x87')]);if(_0x18a032&&_0x18a032['recordingFormat']&&_0x18a032['recordingFormat']!==_0x76a2('0x98')){logger[_0x76a2('0x32')](_0x76a2('0x99'),_0x76a2('0x89'));_0x33828e[_0x76a2('0x8a')]=_0x49514c[_0x76a2('0x87')]+'/api/voice/recordings/'+_0x33828e[_0x76a2('0x8d')]+_0x76a2('0x8c')+md5(_0x33828e[_0x76a2('0x8d')]);}var _0x2c1f16=_0x49514c[_0x76a2('0x85')]===_0x76a2('0x8e')?'eu':'com';return getAccessToken(_0x49514c)['then'](function(_0xe5cb20){_0x2a9bf2=_0xe5cb20;return getUser(_0x2a9bf2,_0x2c1f16,_0x49514c,_0xfd6f63['email']);})['then'](function(_0xb79572){_0x25e340=_0xb79572;logger[_0x76a2('0x32')](_0x76a2('0x90'),_0x25e340['id']);return getEndUser(_0x2a9bf2,_0x2c1f16,_0x49514c,_0x33828e[_0x76a2('0x9a')],_0x33828e[_0x76a2('0x9b')],_0x25e340,_0x3d4260);})[_0x76a2('0x2d')](function(_0x297a64){_0x338d96=_0x297a64;return getCall(_0x2a9bf2,_0x2c1f16,_0x49514c,_0x25e340,_0x338d96,_0x3d4260,_0x33828e,_0x76a2('0x9c'));})[_0x76a2('0x2d')](function(_0x21b3c8){if(_0x21b3c8){logger[_0x76a2('0x32')](_0x76a2('0x9d'),_0x21b3c8['id']);logger[_0x76a2('0x32')](_0x76a2('0x99'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x76a2('0x94'),_0xfd6f63[_0x76a2('0x1d')]),_0x76a2('0x95'),{'uri':_0x76a2('0x96')+_0x49514c[_0x76a2('0x85')]+_0x76a2('0x97')+_0x21b3c8['id']});}})[_0x76a2('0x43')](function(_0x196e37){logger['error'](_0x76a2('0x99'),JSON[_0x76a2('0xf')](_0x196e37));});};exports[_0x76a2('0x9e')]=function(_0x5da7c8,_0xc817ff,_0xe73001,_0x592710,_0x5b5c89,_0x9c90e4){var _0x284e35,_0x5e3670,_0x26a7e7;_0x9c90e4[_0x76a2('0x85')]=intUtil['stripTrailingSlash'](_0x9c90e4[_0x76a2('0x85')]);_0x9c90e4[_0x76a2('0x87')]=intUtil['stripTrailingSlash'](_0x9c90e4[_0x76a2('0x87')]);if(_0x5b5c89&&_0x5b5c89['monitor_format']){logger[_0x76a2('0x32')]('['+_0xc817ff[_0x76a2('0x70')][_0x76a2('0x9f')]()+']','Recording\x20is\x20enabled!');_0xc817ff[_0x76a2('0x8a')]=_0x9c90e4[_0x76a2('0x87')]+_0x76a2('0x8b')+_0xc817ff['uniqueid']+_0x76a2('0x8c')+md5(_0xc817ff[_0x76a2('0x8d')]);}else{_0xc817ff[_0x76a2('0x8a')]='';}var _0x20b3ae=_0x9c90e4[_0x76a2('0x85')]===_0x76a2('0x8e')?'eu':_0x76a2('0x8f');return getAccessToken(_0x9c90e4)[_0x76a2('0x2d')](function(_0x2877df){_0x26a7e7=_0x2877df;return getUser(_0x26a7e7,_0x20b3ae,_0x9c90e4);})[_0x76a2('0x2d')](function(_0xf8d368){_0x284e35=_0xf8d368;logger[_0x76a2('0x32')]('The\x20User\x20ID\x20is:',_0x284e35['id']);return getEndUser(_0x26a7e7,_0x20b3ae,_0x9c90e4,_0xc817ff[_0x76a2('0x91')],_0xc817ff['calleridnum'],_0x284e35,_0xe73001);})[_0x76a2('0x2d')](function(_0x1f49d2){_0x5e3670=_0x1f49d2;return getCall(_0x26a7e7,_0x20b3ae,_0x9c90e4,_0x284e35,_0x5e3670,_0xe73001,_0xc817ff,_0x76a2('0x7d'));})['then'](function(_0x1105e9){if(_0x1105e9){logger['info'](_0x76a2('0x9d'),_0x1105e9['id']);}})['catch'](function(_0x5ea5e3){logger['error']('['+_0xc817ff['lastevent'][_0x76a2('0x9f')]()+']',JSON[_0x76a2('0xf')](_0x5ea5e3));});}; \ 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 83b3e85..347586a 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 _0x3468=['trigger','exec','data2','Script','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger'];(function(_0x5a0070,_0x60e798){var _0xb3205a=function(_0x34409d){while(--_0x34409d){_0x5a0070['push'](_0x5a0070['shift']());}};_0xb3205a(++_0x60e798);}(_0x3468,0x13d));var _0x8346=function(_0x1afa40,_0x9d7427){_0x1afa40=_0x1afa40-0x0;var _0x26d8e9=_0x3468[_0x1afa40];return _0x26d8e9;};'use strict';var util=require('util');var sh=require(_0x8346('0x0'));var Mustache=require('mustache');var logger=require(_0x8346('0x1'))(_0x8346('0x2'));exports[_0x8346('0x3')]=function(_0x263f5d,_0x12a00f){var _0x527b80=_0x263f5d[_0x8346('0x4')]?_0x263f5d['data2']:_0x8346('0x5');var _0x1453bf=_0x263f5d['data3']?Mustache['render'](_0x263f5d['data3'],_0x12a00f):_0x12a00f;sh[_0x8346('0x3')](_0x1453bf,function(_0x396894,_0x2a2ea7,_0x9baf67){if(_0x396894!==0x0){logger[_0x8346('0x6')](util[_0x8346('0x7')](_0x8346('0x8'),_0x527b80,_0x1453bf,_0x396894,_0x9baf67));}else{logger[_0x8346('0x9')](util[_0x8346('0x7')](_0x8346('0xa'),_0x527b80,_0x1453bf,_0x2a2ea7));}});}; \ No newline at end of file +var _0xd6e3=['../../../../config/logger','trigger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x22dd2e,_0x4f5e61){var _0xe75a69=function(_0x3aabb6){while(--_0x3aabb6){_0x22dd2e['push'](_0x22dd2e['shift']());}};_0xe75a69(++_0x4f5e61);}(_0xd6e3,0x129));var _0x3d6e=function(_0x16c540,_0x2ecdc4){_0x16c540=_0x16c540-0x0;var _0x4a50e6=_0xd6e3[_0x16c540];return _0x4a50e6;};'use strict';var util=require(_0x3d6e('0x0'));var sh=require(_0x3d6e('0x1'));var Mustache=require(_0x3d6e('0x2'));var logger=require(_0x3d6e('0x3'))(_0x3d6e('0x4'));exports[_0x3d6e('0x5')]=function(_0x28d0b8,_0x5c8cc6){var _0x4ad539=_0x28d0b8[_0x3d6e('0x6')]?_0x28d0b8[_0x3d6e('0x6')]:_0x3d6e('0x7');var _0x5eaa02=_0x28d0b8['data3']?Mustache[_0x3d6e('0x8')](_0x28d0b8[_0x3d6e('0x9')],_0x5c8cc6):_0x5c8cc6;sh[_0x3d6e('0x5')](_0x5eaa02,function(_0x12ba07,_0x48005f,_0xcd893d){if(_0x12ba07!==0x0){logger[_0x3d6e('0xa')](util[_0x3d6e('0xb')](_0x3d6e('0xc'),_0x4ad539,_0x5eaa02,_0x12ba07,_0xcd893d));}else{logger[_0x3d6e('0xd')](util['format'](_0x3d6e('0xe'),_0x4ad539,_0x5eaa02,_0x48005f));}});}; \ 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 ab97a34..a08e6ff 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 _0xc0c3=['parse','error','GET','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xc0c3,0x12c));var _0x3c0c=function(_0xb6d7b9,_0x2ad427){_0xb6d7b9=_0xb6d7b9-0x0;var _0xdbfd51=_0xc0c3[_0xb6d7b9];return _0xdbfd51;};'use strict';var rp=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var _=require(_0x3c0c('0x2'));var Mustache=require(_0x3c0c('0x3'));var logger=require(_0x3c0c('0x4'))(_0x3c0c('0x5'));exports[_0x3c0c('0x6')]=function(_0x4391cd,_0x20de14){var _0x1dee70,_0x343081;var _0x4d7345={'method':_0x4391cd[_0x3c0c('0x7')][_0x3c0c('0x8')](),'uri':Mustache[_0x3c0c('0x9')](_0x4391cd[_0x3c0c('0xa')],_0x20de14),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4391cd[_0x3c0c('0xb')])===_0x3c0c('0xc')&&parseInt(_0x4391cd[_0x3c0c('0xb')])>=0x1&&parseInt(_0x4391cd[_0x3c0c('0xb')])<=0xa?parseInt(_0x4391cd[_0x3c0c('0xb')])*0x3e8:0x5*0x3e8};try{_0x4d7345[_0x3c0c('0xd')]=_0x4391cd[_0x3c0c('0xe')]?JSON[_0x3c0c('0xf')](Mustache[_0x3c0c('0x9')](_0x4391cd[_0x3c0c('0xe')],_0x20de14)):{};}catch(_0x5cfccd){logger[_0x3c0c('0x10')](_0x5cfccd['stack']);}switch(_0x4391cd[_0x3c0c('0x7')][_0x3c0c('0x8')]()){case _0x3c0c('0x11'):case'DELETE':_0x1dee70=null;_0x4d7345['qs']=_0x20de14;break;case'POST':case _0x3c0c('0x12'):if(_0x4391cd[_0x3c0c('0x13')]){try{_0x1dee70=JSON['parse'](Mustache[_0x3c0c('0x9')](_0x4391cd['data7'],_0x20de14));_0x4d7345[_0x3c0c('0x14')]=_0x1dee70;}catch(_0x25e8a9){logger[_0x3c0c('0x10')](_0x25e8a9[_0x3c0c('0x15')]);logger[_0x3c0c('0x10')](_0x3c0c('0x16'));}}else{_0x1dee70=_0x20de14;_0x4d7345[_0x3c0c('0x14')]=_0x1dee70;}break;}logger[_0x3c0c('0x17')](util[_0x3c0c('0x18')](_0x3c0c('0x19'),_0x4391cd[_0x3c0c('0x7')],_0x4391cd[_0x3c0c('0xa')],JSON[_0x3c0c('0x1a')](_0x4d7345)));rp(_0x4d7345)['then'](function(_0xd258a0){_0x1dee70=!_[_0x3c0c('0x1b')](_0x1dee70)?',\x20request\x20body:\x20'+_0x1dee70:'';_0x343081=typeof _0xd258a0['body']===_0x3c0c('0x1c')?JSON['stringify'](_0xd258a0[_0x3c0c('0x14')]):_0xd258a0[_0x3c0c('0x14')];logger[_0x3c0c('0x17')](util[_0x3c0c('0x18')](_0x3c0c('0x1d'),_0x4391cd[_0x3c0c('0x7')],_0x4391cd['data2'],_0xd258a0[_0x3c0c('0x1e')],_0x343081));})[_0x3c0c('0x1f')](function(_0x32fea1){logger[_0x3c0c('0x10')](util['format'](_0x3c0c('0x20'),_0x4391cd[_0x3c0c('0x7')],_0x4391cd['data2'],_0x32fea1['statusCode'],_0x32fea1[_0x3c0c('0x21')],_0x32fea1[_0x3c0c('0x22')]));});}; \ No newline at end of file +var _0x5515=['request-promise','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','data6','render','stack','GET','DELETE','POST','PUT','parse','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%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'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5515,0x1c7));var _0x5551=function(_0x5bb7ba,_0x910758){_0x5bb7ba=_0x5bb7ba-0x0;var _0x5b5ed0=_0x5515[_0x5bb7ba];return _0x5b5ed0;};'use strict';var rp=require(_0x5551('0x0'));var util=require(_0x5551('0x1'));var _=require(_0x5551('0x2'));var Mustache=require('mustache');var logger=require(_0x5551('0x3'))(_0x5551('0x4'));exports[_0x5551('0x5')]=function(_0xafc85,_0x1d3922){var _0x3e6036,_0xc6a247;var _0x27bde2={'method':_0xafc85[_0x5551('0x6')][_0x5551('0x7')](),'uri':Mustache['render'](_0xafc85[_0x5551('0x8')],_0x1d3922),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xafc85['data5'])==='number'&&parseInt(_0xafc85['data5'])>=0x1&&parseInt(_0xafc85[_0x5551('0x9')])<=0xa?parseInt(_0xafc85[_0x5551('0x9')])*0x3e8:0x5*0x3e8};try{_0x27bde2['headers']=_0xafc85[_0x5551('0xa')]?JSON['parse'](Mustache[_0x5551('0xb')](_0xafc85['data6'],_0x1d3922)):{};}catch(_0xadcc){logger['error'](_0xadcc[_0x5551('0xc')]);}switch(_0xafc85[_0x5551('0x6')][_0x5551('0x7')]()){case _0x5551('0xd'):case _0x5551('0xe'):_0x3e6036=null;_0x27bde2['qs']=_0x1d3922;break;case _0x5551('0xf'):case _0x5551('0x10'):if(_0xafc85['data7']){try{_0x3e6036=JSON[_0x5551('0x11')](Mustache[_0x5551('0xb')](_0xafc85[_0x5551('0x12')],_0x1d3922));_0x27bde2[_0x5551('0x13')]=_0x3e6036;}catch(_0x3ee4fd){logger[_0x5551('0x14')](_0x3ee4fd[_0x5551('0xc')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x3e6036=_0x1d3922;_0x27bde2['body']=_0x3e6036;}break;}logger[_0x5551('0x15')](util[_0x5551('0x16')](_0x5551('0x17'),_0xafc85['data1'],_0xafc85['data2'],JSON['stringify'](_0x27bde2)));rp(_0x27bde2)[_0x5551('0x18')](function(_0x29116e){_0x3e6036=!_[_0x5551('0x19')](_0x3e6036)?_0x5551('0x1a')+_0x3e6036:'';_0xc6a247=typeof _0x29116e[_0x5551('0x13')]===_0x5551('0x1b')?JSON[_0x5551('0x1c')](_0x29116e['body']):_0x29116e[_0x5551('0x13')];logger[_0x5551('0x15')](util[_0x5551('0x16')](_0x5551('0x1d'),_0xafc85['data1'],_0xafc85[_0x5551('0x8')],_0x29116e[_0x5551('0x1e')],_0xc6a247));})[_0x5551('0x1f')](function(_0x5e6a1d){logger['error'](util[_0x5551('0x16')](_0x5551('0x20'),_0xafc85['data1'],_0xafc85[_0x5551('0x8')],_0x5e6a1d['statusCode'],_0x5e6a1d[_0x5551('0x21')],_0x5e6a1d[_0x5551('0x22')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index e807709..c246e57 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 _0x4b25=['catch','rpc','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','message'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x4b25,0x1d4));var _0x54b2=function(_0x29bbef,_0xd6db96){_0x29bbef=_0x29bbef-0x0;var _0x2845b4=_0x4b25[_0x29bbef];return _0x2845b4;};'use strict';var jayson=require(_0x54b2('0x0'));var BPromise=require(_0x54b2('0x1'));var logger=require(_0x54b2('0x2'))(_0x54b2('0x3'));var client=jayson[_0x54b2('0x4')][_0x54b2('0x5')]({'port':0x2329});client[_0x54b2('0x6')]=function(_0x391e70,_0x268b6a){return new BPromise(function(_0x4b66e6,_0x392813){return client[_0x54b2('0x7')](_0x391e70,_0x268b6a)[_0x54b2('0x8')](function(_0x57f6d0){logger[_0x54b2('0x9')]('rpc',_0x54b2('0x3'),_0x391e70,_0x268b6a,_0x57f6d0);if(_0x57f6d0[_0x54b2('0xa')]){logger[_0x54b2('0xa')]('rpc',_0x54b2('0x3'),_0x391e70,_0x57f6d0[_0x54b2('0xa')][_0x54b2('0xb')],_0x268b6a);return _0x392813(_0x57f6d0[_0x54b2('0xa')][_0x54b2('0xb')]);}else{return _0x4b66e6(_0x57f6d0['result']);}})[_0x54b2('0xc')](function(_0x2e5834){logger[_0x54b2('0xa')](_0x54b2('0xd'),_0x54b2('0x3'),_0x391e70,_0x2e5834,_0x268b6a);return _0x392813(_0x2e5834);});});};module[_0x54b2('0xe')]=client; \ No newline at end of file +var _0xf3f1=['client','http','Request','request','then','debug','error','message','result','bluebird','../../config/logger','routing'];(function(_0xed6e0,_0x2900ff){var _0x5be8e5=function(_0x525143){while(--_0x525143){_0xed6e0['push'](_0xed6e0['shift']());}};_0x5be8e5(++_0x2900ff);}(_0xf3f1,0x195));var _0x1f3f=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xf3f1[_0x4b73a2];return _0x383c66;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1f3f('0x0'));var logger=require(_0x1f3f('0x1'))(_0x1f3f('0x2'));var client=jayson[_0x1f3f('0x3')][_0x1f3f('0x4')]({'port':0x2329});client[_0x1f3f('0x5')]=function(_0x19a9f0,_0x1564c1){return new BPromise(function(_0x5c6890,_0x230b90){return client[_0x1f3f('0x6')](_0x19a9f0,_0x1564c1)[_0x1f3f('0x7')](function(_0x4cf1f8){logger[_0x1f3f('0x8')]('rpc',_0x1f3f('0x2'),_0x19a9f0,_0x1564c1,_0x4cf1f8);if(_0x4cf1f8[_0x1f3f('0x9')]){logger[_0x1f3f('0x9')]('rpc','routing',_0x19a9f0,_0x4cf1f8[_0x1f3f('0x9')]['message'],_0x1564c1);return _0x230b90(_0x4cf1f8[_0x1f3f('0x9')][_0x1f3f('0xa')]);}else{return _0x5c6890(_0x4cf1f8[_0x1f3f('0xb')]);}})['catch'](function(_0x4e73e7){logger['error']('rpc',_0x1f3f('0x2'),_0x19a9f0,_0x4e73e7,_0x1564c1);return _0x230b90(_0x4e73e7);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 79153f2..ea7acfe 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 _0xfdb5=['listen','loginMailFrequency','catch','bluebird','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','mailAccounts'];(function(_0x31bd8b,_0x56fa02){var _0x1506e4=function(_0x51e54d){while(--_0x51e54d){_0x31bd8b['push'](_0x31bd8b['shift']());}};_0x1506e4(++_0x56fa02);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xfdb5[_0x59d89e];return _0x554e93;};'use strict';var BPromise=require(_0x5fdb('0x0'));var server=require('./server');var Realtime=require(_0x5fdb('0x1'));var EmailChannel=require(_0x5fdb('0x2'));var mailAccount=require(_0x5fdb('0x3'));var setting=require(_0x5fdb('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5fdb('0x5')]()[_0x5fdb('0x6')](mailAccount[_0x5fdb('0x7')]())[_0x5fdb('0x6')](realtime['initMailAccounts']())[_0x5fdb('0x6')](function(){email['refresh'](realtime[_0x5fdb('0x8')]);return realtime;});}function main(){return server[_0x5fdb('0x9')](realtime,email)[_0x5fdb('0x6')](function(){return initRealtime();})[_0x5fdb('0x6')](function(){return setting['getSettings']();})[_0x5fdb('0x6')](function(_0x53cef8){return setInterval(initRealtime,_0x53cef8[_0x5fdb('0xa')]*0x3e8);})[_0x5fdb('0xb')](function(_0xf41999){console['log'](_0xf41999);});}main(); \ No newline at end of file +var _0x332c=['then','getMailAccounts','refresh','listen','getSettings','catch','log','bluebird','./server','./realtime','./rpc/setting','resolve'];(function(_0x22cf2b,_0x53273a){var _0x3c3a8f=function(_0x56f28f){while(--_0x56f28f){_0x22cf2b['push'](_0x22cf2b['shift']());}};_0x3c3a8f(++_0x53273a);}(_0x332c,0x11b));var _0xc332=function(_0x28be38,_0x3e738d){_0x28be38=_0x28be38-0x0;var _0x5e086e=_0x332c[_0x28be38];return _0x5e086e;};'use strict';var BPromise=require(_0xc332('0x0'));var server=require(_0xc332('0x1'));var Realtime=require(_0xc332('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xc332('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xc332('0x4')]()[_0xc332('0x5')](mailAccount[_0xc332('0x6')]())['then'](realtime['initMailAccounts']())[_0xc332('0x5')](function(){email[_0xc332('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xc332('0x8')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xc332('0x9')]();})[_0xc332('0x5')](function(_0x15a894){return setInterval(initRealtime,_0x15a894['loginMailFrequency']*0x3e8);})[_0xc332('0xa')](function(_0x1d5041){console[_0xc332('0xb')](_0x1d5041);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 5953784..c50564c 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 _0x3b17=['localhost','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','status','disabled','name','messages','info','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','lastSync','sendMail','send','Smtp','verify','verified','catch','exports','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults'];(function(_0x148bf4,_0x31b21e){var _0x1a98f4=function(_0x142935){while(--_0x142935){_0x148bf4['push'](_0x148bf4['shift']());}};_0x1a98f4(++_0x31b21e);}(_0x3b17,0x198));var _0x73b1=function(_0x2729b2,_0x5bd950){_0x2729b2=_0x2729b2-0x0;var _0x59d65f=_0x3b17[_0x2729b2];return _0x59d65f;};'use strict';var _=require('lodash');var moment=require(_0x73b1('0x0'));var BPromise=require(_0x73b1('0x1'));var md5=require(_0x73b1('0x2'));var Redis=require(_0x73b1('0x3'));var config=require('../../../config/environment');var logger=require(_0x73b1('0x4'))(_0x73b1('0x5'));config[_0x73b1('0x6')]=_[_0x73b1('0x7')](config['redis'],{'host':_0x73b1('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x73b1('0x6')]));var EmailImap=require(_0x73b1('0x9'));var EmailSmtp=require(_0x73b1('0xa'));var mailAccount=require(_0x73b1('0xb'));var md5Accounts={};function EmailChannel(_0x4ce5d3){logger['info'](_0x73b1('0xc'));this[_0x73b1('0xd')]=_0x4ce5d3['mailAccounts'];this[_0x73b1('0xe')]={};this[_0x73b1('0xf')]=new EmailSmtp();}EmailChannel[_0x73b1('0x10')][_0x73b1('0x11')]=function(_0x307b86){var _0x3551fe=this['mailAccounts'][_0x307b86];var _0xf0b4ac={'id':_0x3551fe['id'],'name':_0x3551fe['name'],'key':_0x3551fe['key'],'active':_0x3551fe[_0x73b1('0x12')],'Imap':{'status':_0x3551fe['Imap']['status'],'messageStatus':_0x3551fe[_0x73b1('0x13')][_0x73b1('0x14')],'total':_0x3551fe[_0x73b1('0x13')][_0x73b1('0x15')]}};if(_[_0x73b1('0x16')](md5Accounts[_0x307b86])){md5Accounts[_0x307b86]={};}var _0x36da2d=md5(JSON[_0x73b1('0x17')](_0xf0b4ac));if(md5Accounts[_0x307b86][_0x73b1('0x2')]!==_0x36da2d){md5Accounts[_0x307b86][_0x73b1('0x2')]=_0x36da2d;io[_0x73b1('0x11')](_0x73b1('0x18'),_0xf0b4ac);}};EmailChannel[_0x73b1('0x10')][_0x73b1('0x19')]=function(_0x38841d){for(var _0x5c3775 in _0x38841d){if(_0x38841d[_0x73b1('0x1a')](_0x5c3775)){if(_0x38841d[_0x5c3775][_0x73b1('0x13')]&&_0x38841d[_0x5c3775]['active']){var _0x581ea5=_0x38841d[_0x5c3775][_0x73b1('0x13')];if(!this[_0x73b1('0xe')][_0x73b1('0x1a')](_0x581ea5['id'])){this[_0x73b1('0xe')][_0x581ea5['id']]=new EmailImap(_0x581ea5,_0x38841d[_0x5c3775][_0x73b1('0x5')]);this[_0x73b1('0xe')][_0x581ea5['id']]['on']('box',this[_0x73b1('0x1b')]['bind'](this,_0x5c3775));this[_0x73b1('0xe')][_0x581ea5['id']]['on'](_0x73b1('0x5'),this[_0x73b1('0x1c')][_0x73b1('0x1d')](this,_0x5c3775));this[_0x73b1('0xe')][_0x581ea5['id']]['on'](_0x73b1('0x1e'),this[_0x73b1('0x1f')][_0x73b1('0x1d')](this,_0x5c3775));this[_0x73b1('0xe')][_0x581ea5['id']]['on'](_0x73b1('0x20'),this[_0x73b1('0x21')][_0x73b1('0x1d')](this,_0x5c3775));}}else{if(_[_0x73b1('0x16')](this['mailAccounts'][_0x5c3775]['Imap'])){this['mailAccounts'][_0x5c3775][_0x73b1('0x13')]={};}this[_0x73b1('0xd')][_0x5c3775][_0x73b1('0x13')][_0x73b1('0x22')]=_0x73b1('0x23');this[_0x73b1('0xd')][_0x5c3775][_0x73b1('0x13')][_0x73b1('0x14')]='';this[_0x73b1('0x11')](_0x5c3775);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x354c17,_0x20c712){if(this['mailAccounts'][_0x354c17]){this[_0x73b1('0xd')][_0x354c17]['Imap'][_0x73b1('0x22')]='connected';this[_0x73b1('0xd')][_0x354c17][_0x73b1('0x13')][_0x73b1('0x14')]=_0x20c712[_0x73b1('0x24')];if(_0x20c712[_0x73b1('0x25')]){this[_0x73b1('0xd')][_0x354c17][_0x73b1('0x13')]['total']=_0x20c712[_0x73b1('0x25')]['total'];}return this[_0x73b1('0x11')](_0x354c17);}};EmailChannel['prototype'][_0x73b1('0x1c')]=function(_0x318c2e,_0x2fcfa8){logger[_0x73b1('0x26')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2fcfa8[_0x73b1('0x27')],_0x2fcfa8[_0x73b1('0x28')],_0x2fcfa8[_0x73b1('0x29')],_0x318c2e);if(this[_0x73b1('0xd')][_0x318c2e]){return mailAccount['notify'](_0x318c2e,_0x2fcfa8)[_0x73b1('0x2a')](function(_0x3be1de){if(_0x3be1de){logger['info'](_0x73b1('0x2b'));}})['catch'](function(_0x410e3d){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x73b1('0x17')](_0x410e3d));});}};EmailChannel['prototype'][_0x73b1('0x1f')]=function(_0x493a28){if(this[_0x73b1('0xd')][_0x493a28]&&this[_0x73b1('0xd')][_0x493a28][_0x73b1('0x13')]){if(this[_0x73b1('0xe')][this[_0x73b1('0xd')][_0x493a28]['Imap']['id']]){delete this[_0x73b1('0xe')][this[_0x73b1('0xd')][_0x493a28][_0x73b1('0x13')]['id']];}this[_0x73b1('0xd')][_0x493a28][_0x73b1('0x13')][_0x73b1('0x2c')]=moment();this['emit'](_0x493a28);}};EmailChannel['prototype'][_0x73b1('0x21')]=function(_0x1d2473,_0x5efc0b){if(this[_0x73b1('0xd')][_0x1d2473]){this[_0x73b1('0xd')][_0x1d2473][_0x73b1('0x13')]['status']=_0x73b1('0x20');this[_0x73b1('0xd')][_0x1d2473][_0x73b1('0x13')]['messageStatus']=_0x5efc0b;return this[_0x73b1('0x11')](_0x1d2473);}};EmailChannel[_0x73b1('0x10')][_0x73b1('0x2d')]=function(_0x835f54,_0x2439b6){return this[_0x73b1('0xf')][_0x73b1('0x2e')](_0x835f54,_0x2439b6);};EmailChannel['prototype']['verifySmtp']=function(_0x690bc1){var _0x1fe108=this;if(this[_0x73b1('0xd')][_0x690bc1['id']]){if(_[_0x73b1('0x16')](this[_0x73b1('0xd')][_0x690bc1['id']]['Smtp'])){this['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')]={};}this['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')][_0x73b1('0x2c')]=moment();return new BPromise(function(_0x32d98a,_0x59a159){return _0x1fe108[_0x73b1('0xf')][_0x73b1('0x30')](_0x690bc1)['then'](function(_0x4d19df){_0x1fe108[_0x73b1('0xd')][_0x690bc1['id']][_0x73b1('0x2f')][_0x73b1('0x22')]=_0x73b1('0x31');_0x1fe108['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')]['messageStatus']='';_0x1fe108[_0x73b1('0x11')](_0x690bc1['id']);_0x32d98a(_0x4d19df);})[_0x73b1('0x32')](function(_0x2379aa){_0x1fe108['mailAccounts'][_0x690bc1['id']][_0x73b1('0x2f')][_0x73b1('0x22')]=_0x73b1('0x20');_0x1fe108[_0x73b1('0xd')][_0x690bc1['id']]['Smtp'][_0x73b1('0x14')]=_0x2379aa;_0x1fe108[_0x73b1('0x11')](_0x690bc1['id']);_0x59a159(_0x2379aa);});});}return this[_0x73b1('0xf')][_0x73b1('0x30')](_0x690bc1);};module[_0x73b1('0x33')]=EmailChannel; \ No newline at end of file +var _0x08da=['defaults','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','active','Imap','messageStatus','total','isNil','emit','mailAccount:update','prototype','refresh','hasOwnProperty','handleImapBox','bind','end','error','handleImapError','status','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','sendMail','verifySmtp','Smtp','verify','verified','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x08da,0x1de));var _0xa08d=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x08da[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xa08d('0x0'));var moment=require(_0xa08d('0x1'));var BPromise=require(_0xa08d('0x2'));var md5=require('md5');var Redis=require(_0xa08d('0x3'));var config=require(_0xa08d('0x4'));var logger=require(_0xa08d('0x5'))(_0xa08d('0x6'));config[_0xa08d('0x7')]=_[_0xa08d('0x8')](config[_0xa08d('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa08d('0x7')]));var EmailImap=require(_0xa08d('0x9'));var EmailSmtp=require(_0xa08d('0xa'));var mailAccount=require(_0xa08d('0xb'));var md5Accounts={};function EmailChannel(_0x58fc4a){logger[_0xa08d('0xc')](_0xa08d('0xd'));this[_0xa08d('0xe')]=_0x58fc4a[_0xa08d('0xe')];this[_0xa08d('0xf')]={};this[_0xa08d('0x10')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x4be416){var _0x48227f=this[_0xa08d('0xe')][_0x4be416];var _0x518e5f={'id':_0x48227f['id'],'name':_0x48227f[_0xa08d('0x11')],'key':_0x48227f[_0xa08d('0x12')],'active':_0x48227f[_0xa08d('0x13')],'Imap':{'status':_0x48227f[_0xa08d('0x14')]['status'],'messageStatus':_0x48227f['Imap'][_0xa08d('0x15')],'total':_0x48227f[_0xa08d('0x14')][_0xa08d('0x16')]}};if(_[_0xa08d('0x17')](md5Accounts[_0x4be416])){md5Accounts[_0x4be416]={};}var _0x48732d=md5(JSON['stringify'](_0x518e5f));if(md5Accounts[_0x4be416]['md5']!==_0x48732d){md5Accounts[_0x4be416]['md5']=_0x48732d;io[_0xa08d('0x18')](_0xa08d('0x19'),_0x518e5f);}};EmailChannel[_0xa08d('0x1a')][_0xa08d('0x1b')]=function(_0x252a4f){for(var _0x552468 in _0x252a4f){if(_0x252a4f[_0xa08d('0x1c')](_0x552468)){if(_0x252a4f[_0x552468]['Imap']&&_0x252a4f[_0x552468][_0xa08d('0x13')]){var _0x3ae14b=_0x252a4f[_0x552468][_0xa08d('0x14')];if(!this['imapAccounts']['hasOwnProperty'](_0x3ae14b['id'])){this[_0xa08d('0xf')][_0x3ae14b['id']]=new EmailImap(_0x3ae14b,_0x252a4f[_0x552468]['email']);this['imapAccounts'][_0x3ae14b['id']]['on']('box',this[_0xa08d('0x1d')]['bind'](this,_0x552468));this[_0xa08d('0xf')][_0x3ae14b['id']]['on'](_0xa08d('0x6'),this['handleImapEmail'][_0xa08d('0x1e')](this,_0x552468));this[_0xa08d('0xf')][_0x3ae14b['id']]['on'](_0xa08d('0x1f'),this['handleImapEnd'][_0xa08d('0x1e')](this,_0x552468));this[_0xa08d('0xf')][_0x3ae14b['id']]['on'](_0xa08d('0x20'),this[_0xa08d('0x21')][_0xa08d('0x1e')](this,_0x552468));}}else{if(_['isNil'](this[_0xa08d('0xe')][_0x552468]['Imap'])){this['mailAccounts'][_0x552468][_0xa08d('0x14')]={};}this[_0xa08d('0xe')][_0x552468][_0xa08d('0x14')][_0xa08d('0x22')]='disabled';this[_0xa08d('0xe')][_0x552468][_0xa08d('0x14')][_0xa08d('0x15')]='';this['emit'](_0x552468);}}}};EmailChannel[_0xa08d('0x1a')][_0xa08d('0x1d')]=function(_0x343e3c,_0xe9a14c){if(this[_0xa08d('0xe')][_0x343e3c]){this['mailAccounts'][_0x343e3c][_0xa08d('0x14')][_0xa08d('0x22')]=_0xa08d('0x23');this[_0xa08d('0xe')][_0x343e3c][_0xa08d('0x14')][_0xa08d('0x15')]=_0xe9a14c['name'];if(_0xe9a14c[_0xa08d('0x24')]){this[_0xa08d('0xe')][_0x343e3c][_0xa08d('0x14')][_0xa08d('0x16')]=_0xe9a14c[_0xa08d('0x24')][_0xa08d('0x16')];}return this['emit'](_0x343e3c);}};EmailChannel['prototype'][_0xa08d('0x25')]=function(_0x47aae3,_0x1366fd){logger[_0xa08d('0xc')](_0xa08d('0x26'),_0x1366fd[_0xa08d('0x27')],_0x1366fd[_0xa08d('0x28')],_0x1366fd[_0xa08d('0x29')],_0x47aae3);if(this[_0xa08d('0xe')][_0x47aae3]){return mailAccount[_0xa08d('0x2a')](_0x47aae3,_0x1366fd)['then'](function(_0x47e423){if(_0x47e423){logger[_0xa08d('0xc')](_0xa08d('0x2b'));}})[_0xa08d('0x2c')](function(_0x4b69ba){logger[_0xa08d('0x20')](_0xa08d('0x2d'),JSON[_0xa08d('0x2e')](_0x4b69ba));});}};EmailChannel[_0xa08d('0x1a')][_0xa08d('0x2f')]=function(_0x1f4982){if(this['mailAccounts'][_0x1f4982]&&this[_0xa08d('0xe')][_0x1f4982][_0xa08d('0x14')]){if(this['imapAccounts'][this[_0xa08d('0xe')][_0x1f4982][_0xa08d('0x14')]['id']]){delete this[_0xa08d('0xf')][this[_0xa08d('0xe')][_0x1f4982]['Imap']['id']];}this[_0xa08d('0xe')][_0x1f4982][_0xa08d('0x14')][_0xa08d('0x30')]=moment();this[_0xa08d('0x18')](_0x1f4982);}};EmailChannel['prototype'][_0xa08d('0x21')]=function(_0x4f824f,_0x2f4f80){if(this[_0xa08d('0xe')][_0x4f824f]){this['mailAccounts'][_0x4f824f][_0xa08d('0x14')]['status']=_0xa08d('0x20');this['mailAccounts'][_0x4f824f][_0xa08d('0x14')][_0xa08d('0x15')]=_0x2f4f80;return this['emit'](_0x4f824f);}};EmailChannel['prototype'][_0xa08d('0x31')]=function(_0x44f092,_0x30451b){return this[_0xa08d('0x10')]['send'](_0x44f092,_0x30451b);};EmailChannel['prototype'][_0xa08d('0x32')]=function(_0x1281be){var _0x367224=this;if(this[_0xa08d('0xe')][_0x1281be['id']]){if(_[_0xa08d('0x17')](this[_0xa08d('0xe')][_0x1281be['id']][_0xa08d('0x33')])){this[_0xa08d('0xe')][_0x1281be['id']][_0xa08d('0x33')]={};}this[_0xa08d('0xe')][_0x1281be['id']][_0xa08d('0x33')][_0xa08d('0x30')]=moment();return new BPromise(function(_0x48a3fe,_0x25686a){return _0x367224[_0xa08d('0x10')][_0xa08d('0x34')](_0x1281be)['then'](function(_0x5be5c4){_0x367224[_0xa08d('0xe')][_0x1281be['id']]['Smtp'][_0xa08d('0x22')]=_0xa08d('0x35');_0x367224[_0xa08d('0xe')][_0x1281be['id']][_0xa08d('0x33')][_0xa08d('0x15')]='';_0x367224['emit'](_0x1281be['id']);_0x48a3fe(_0x5be5c4);})[_0xa08d('0x2c')](function(_0x5971dd){_0x367224[_0xa08d('0xe')][_0x1281be['id']][_0xa08d('0x33')][_0xa08d('0x22')]=_0xa08d('0x20');_0x367224[_0xa08d('0xe')][_0x1281be['id']]['Smtp'][_0xa08d('0x15')]=_0x5971dd;_0x367224['emit'](_0x1281be['id']);_0x25686a(_0x5971dd);});});}return this[_0xa08d('0x10')][_0xa08d('0x34')](_0x1281be);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 9ad3bae..539ebdb 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 _0x16d2=['handleCloseBox','search','UNSEEN','handleReadUnseen','handleError','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','emit','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','bind','end','handleEnd','error','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','box','readUnseen'];(function(_0x16aa70,_0x5b1f73){var _0x11875f=function(_0x18c7be){while(--_0x18c7be){_0x16aa70['push'](_0x16aa70['shift']());}};_0x11875f(++_0x5b1f73);}(_0x16d2,0x123));var _0x216d=function(_0x520d3b,_0x1ed797){_0x520d3b=_0x520d3b-0x0;var _0x32fb1f=_0x16d2[_0x520d3b];return _0x32fb1f;};'use strict';var fs=require('fs');var path=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var Imap=require(_0x216d('0x2'));var _=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var simpleParser=require(_0x216d('0x5'))[_0x216d('0x6')];var Iconv=require(_0x216d('0x7'))[_0x216d('0x8')];var EventEmitter=require('events')[_0x216d('0x9')];var utils=require(_0x216d('0xa'));var logger=require(_0x216d('0xb'))(_0x216d('0xc'));function EmailImap(_0x1dd8e2,_0x24c831){this[_0x216d('0xd')]=_0x216d('0xe');this['account']=this[_0x216d('0xf')](_0x1dd8e2,_0x24c831);this[_0x216d('0x2')]=new Imap(this[_0x216d('0x10')]);this[_0x216d('0x2')][_0x216d('0x11')](_0x216d('0x12'),this['handleReady'][_0x216d('0x13')](this));this['imap'][_0x216d('0x11')](_0x216d('0x14'),this[_0x216d('0x15')][_0x216d('0x13')](this));this[_0x216d('0x2')]['on'](_0x216d('0x16'),this['handleError'][_0x216d('0x13')](this));this['imap'][_0x216d('0x17')]();}util[_0x216d('0x18')](EmailImap,EventEmitter);EmailImap['prototype'][_0x216d('0xf')]=function(_0x322e4b,_0x54a816){var _0x1b3215={'connTimeout':_0x322e4b['connTimeout']?_0x322e4b[_0x216d('0x19')]*0x3e8:0x2710,'authTimeout':_0x322e4b[_0x216d('0x1a')]?_0x322e4b[_0x216d('0x1a')]*0x3e8:0x1388};if(_[_0x216d('0x1b')](_0x322e4b[_0x216d('0x1c')])){if(_0x322e4b[_0x216d('0x1d')]){_0x1b3215[_0x216d('0x1e')]=_0x322e4b[_0x216d('0x1e')];_0x1b3215[_0x216d('0x1f')]=_0x322e4b['password'];}_0x1b3215[_0x216d('0x20')]=_0x322e4b['host'];_0x1b3215['port']=_0x322e4b[_0x216d('0x21')]||0x3e1;if(_0x322e4b[_0x216d('0x22')]){_0x1b3215['tls']=!![];}else{_0x1b3215[_0x216d('0x22')]=![];_0x1b3215[_0x216d('0x23')]='required';}}else{_0x1b3215[_0x216d('0x1e')]=_0x322e4b[_0x216d('0x1e')];_0x1b3215[_0x216d('0x1f')]=_0x322e4b[_0x216d('0x1f')];_0x1b3215['host']=utils[_0x216d('0x24')](_0x322e4b[_0x216d('0x1c')]);_0x1b3215[_0x216d('0x21')]=0x3e1;_0x1b3215[_0x216d('0x22')]=!![];}_0x1b3215[_0x216d('0xc')]=_0x54a816||_0x322e4b['user']||_0x216d('0x25');return _0x1b3215;};EmailImap[_0x216d('0x26')][_0x216d('0x27')]=function(){this[_0x216d('0x2')][_0x216d('0x28')](this['mailbox'],![],this[_0x216d('0x29')][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')]['handleOpenBox']=function(_0x4ec8a7,_0x56460f){if(_0x4ec8a7){this['handleError'](_0x4ec8a7,!![]);}else{this['emit'](_0x216d('0x2a'),_0x56460f);this[_0x216d('0x2b')]();}};EmailImap[_0x216d('0x26')][_0x216d('0x2c')]=function(_0x46d0ef){if(_0x46d0ef){this['handleError'](_0x46d0ef,!![]);}else{this['imap'][_0x216d('0x14')]();}};EmailImap['prototype'][_0x216d('0x2b')]=function(){this[_0x216d('0x2')][_0x216d('0x2d')]([_0x216d('0x2e')],this[_0x216d('0x2f')][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')][_0x216d('0x2f')]=function(_0x169cfa,_0x28f56a){if(_0x169cfa){this[_0x216d('0x30')](_0x169cfa,!![]);}else{if(_0x28f56a[_0x216d('0x31')]){try{var _0x4537fd=this['imap'][_0x216d('0x32')](_0x28f56a,{'bodies':'','markSeen':!![]});_0x4537fd['on'](_0x216d('0x33'),this[_0x216d('0x34')]['bind'](this));_0x4537fd[_0x216d('0x11')](_0x216d('0x16'),this[_0x216d('0x35')][_0x216d('0x13')](this));_0x4537fd['once'](_0x216d('0x14'),this[_0x216d('0x36')][_0x216d('0x13')](this));}catch(_0x18ffec){logger[_0x216d('0x16')](_0x18ffec);}}else{this[_0x216d('0x2')][_0x216d('0x37')](!![],this[_0x216d('0x2c')][_0x216d('0x13')](this));}}};EmailImap[_0x216d('0x26')][_0x216d('0x34')]=function(_0x4a2caa,_0xcb9f8a){_0x4a2caa['on'](_0x216d('0x38'),this[_0x216d('0x39')]['bind'](this));_0x4a2caa[_0x216d('0x11')](_0x216d('0x3a'),this['handleMessageAttributes'][_0x216d('0x13')](this));_0x4a2caa['once']('end',this[_0x216d('0x3b')][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')][_0x216d('0x39')]=function(_0x5c3f7c,_0x4fd477){simpleParser(_0x5c3f7c,{'Iconv':Iconv},this['handleSimpleParser'][_0x216d('0x13')](this));};EmailImap[_0x216d('0x26')]['handleMessageAttributes']=function(_0x3ff9a0){};EmailImap[_0x216d('0x26')]['handleMessageEnd']=function(){};EmailImap[_0x216d('0x26')][_0x216d('0x3c')]=function(_0x2476a0,_0x474fab){if(_0x2476a0){logger[_0x216d('0x16')](_0x2476a0);}else{var _0x2e857e=this;utils[_0x216d('0x3d')](this[_0x216d('0x10')],_0x474fab,function(_0x54937b){_0x2e857e['emit'](_0x216d('0xc'),_0x54937b);});}};EmailImap[_0x216d('0x26')]['handleFetchEnd']=function(){this[_0x216d('0x2')][_0x216d('0x37')](!![],this[_0x216d('0x2c')]['bind'](this));};EmailImap[_0x216d('0x26')][_0x216d('0x35')]=function(_0x13d787){this[_0x216d('0x30')](_0x13d787);this['imap'][_0x216d('0x37')](!![],this[_0x216d('0x2c')]['bind'](this));};EmailImap[_0x216d('0x26')][_0x216d('0x15')]=function(){this['emit']('end');};EmailImap[_0x216d('0x26')][_0x216d('0x30')]=function(_0x3c491e,_0x498efe){logger[_0x216d('0x16')]('handleError',this['account'][_0x216d('0xc')],JSON[_0x216d('0x3e')](_0x3c491e));var _0xac81f='';if(_0x3c491e){if(_0x3c491e['textCode']){_0xac81f=_0x3c491e[_0x216d('0x3f')];}else{for(var _0x488de3 in _0x3c491e){if(_0x3c491e[_0x216d('0x40')](_0x488de3)){_0xac81f+=_[_0x216d('0x41')](_0x488de3)+':\x20'+_0x3c491e[_0x488de3]+'\x0a';}}}}if(_0x498efe){this[_0x216d('0x2')]['end']();}else{this[_0x216d('0x42')](_0x216d('0x16'),_0xac81f);this[_0x216d('0x42')](_0x216d('0x14'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x1149=['anonymous@xcally.com','prototype','openBox','handleOpenBox','handleCloseBox','readUnseen','handleReadUnseen','message','handleFetchMessage','error','end','closeBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','emit','handleFetchEnd','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','handleReady','bind','handleError','inherits','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','service'];(function(_0x451402,_0x561cb8){var _0x4ffb7f=function(_0x1c263a){while(--_0x1c263a){_0x451402['push'](_0x451402['shift']());}};_0x4ffb7f(++_0x561cb8);}(_0x1149,0x1be));var _0x9114=function(_0x10a4d6,_0x4801f2){_0x10a4d6=_0x10a4d6-0x0;var _0x43d790=_0x1149[_0x10a4d6];return _0x43d790;};'use strict';var fs=require('fs');var path=require(_0x9114('0x0'));var util=require(_0x9114('0x1'));var Imap=require(_0x9114('0x2'));var _=require(_0x9114('0x3'));var rs=require(_0x9114('0x4'));var simpleParser=require(_0x9114('0x5'))[_0x9114('0x6')];var Iconv=require(_0x9114('0x7'))['Iconv'];var EventEmitter=require(_0x9114('0x8'))[_0x9114('0x9')];var utils=require('./utils');var logger=require(_0x9114('0xa'))(_0x9114('0xb'));function EmailImap(_0x24e3b9,_0x1cd285){this[_0x9114('0xc')]=_0x9114('0xd');this[_0x9114('0xe')]=this[_0x9114('0xf')](_0x24e3b9,_0x1cd285);this[_0x9114('0x2')]=new Imap(this[_0x9114('0xe')]);this[_0x9114('0x2')][_0x9114('0x10')]('ready',this[_0x9114('0x11')][_0x9114('0x12')](this));this['imap'][_0x9114('0x10')]('end',this['handleEnd'][_0x9114('0x12')](this));this[_0x9114('0x2')]['on']('error',this[_0x9114('0x13')]['bind'](this));this['imap']['connect']();}util[_0x9114('0x14')](EmailImap,EventEmitter);EmailImap['prototype'][_0x9114('0xf')]=function(_0x2f2cfe,_0x3d3dd3){var _0x533c8a={'connTimeout':_0x2f2cfe[_0x9114('0x15')]?_0x2f2cfe[_0x9114('0x15')]*0x3e8:0x2710,'authTimeout':_0x2f2cfe['authTimeout']?_0x2f2cfe[_0x9114('0x16')]*0x3e8:0x1388};if(_[_0x9114('0x17')](_0x2f2cfe['service'])){if(_0x2f2cfe[_0x9114('0x18')]){_0x533c8a[_0x9114('0x19')]=_0x2f2cfe['user'];_0x533c8a[_0x9114('0x1a')]=_0x2f2cfe[_0x9114('0x1a')];}_0x533c8a['host']=_0x2f2cfe[_0x9114('0x1b')];_0x533c8a[_0x9114('0x1c')]=_0x2f2cfe['port']||0x3e1;if(_0x2f2cfe[_0x9114('0x1d')]){_0x533c8a[_0x9114('0x1d')]=!![];}else{_0x533c8a['tls']=![];_0x533c8a[_0x9114('0x1e')]=_0x9114('0x1f');}}else{_0x533c8a[_0x9114('0x19')]=_0x2f2cfe[_0x9114('0x19')];_0x533c8a[_0x9114('0x1a')]=_0x2f2cfe['password'];_0x533c8a[_0x9114('0x1b')]=utils[_0x9114('0x20')](_0x2f2cfe[_0x9114('0x21')]);_0x533c8a[_0x9114('0x1c')]=0x3e1;_0x533c8a[_0x9114('0x1d')]=!![];}_0x533c8a['email']=_0x3d3dd3||_0x2f2cfe[_0x9114('0x19')]||_0x9114('0x22');return _0x533c8a;};EmailImap[_0x9114('0x23')][_0x9114('0x11')]=function(){this['imap'][_0x9114('0x24')](this[_0x9114('0xc')],![],this[_0x9114('0x25')]['bind'](this));};EmailImap[_0x9114('0x23')][_0x9114('0x25')]=function(_0x50a9c5,_0x12d2bc){if(_0x50a9c5){this[_0x9114('0x13')](_0x50a9c5,!![]);}else{this['emit']('box',_0x12d2bc);this['readUnseen']();}};EmailImap[_0x9114('0x23')][_0x9114('0x26')]=function(_0x113839){if(_0x113839){this[_0x9114('0x13')](_0x113839,!![]);}else{this[_0x9114('0x2')]['end']();}};EmailImap[_0x9114('0x23')][_0x9114('0x27')]=function(){this[_0x9114('0x2')]['search'](['UNSEEN'],this[_0x9114('0x28')]['bind'](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x4f9fe3,_0x163a05){if(_0x4f9fe3){this[_0x9114('0x13')](_0x4f9fe3,!![]);}else{if(_0x163a05['length']){try{var _0x1f194a=this['imap']['fetch'](_0x163a05,{'bodies':'','markSeen':!![]});_0x1f194a['on'](_0x9114('0x29'),this[_0x9114('0x2a')][_0x9114('0x12')](this));_0x1f194a['once'](_0x9114('0x2b'),this['handleFetchError'][_0x9114('0x12')](this));_0x1f194a[_0x9114('0x10')](_0x9114('0x2c'),this['handleFetchEnd'][_0x9114('0x12')](this));}catch(_0x50c7b8){logger[_0x9114('0x2b')](_0x50c7b8);}}else{this[_0x9114('0x2')][_0x9114('0x2d')](!![],this[_0x9114('0x26')][_0x9114('0x12')](this));}}};EmailImap[_0x9114('0x23')][_0x9114('0x2a')]=function(_0x1e1ac1,_0x347550){_0x1e1ac1['on'](_0x9114('0x2e'),this[_0x9114('0x2f')][_0x9114('0x12')](this));_0x1e1ac1[_0x9114('0x10')]('attributes',this[_0x9114('0x30')][_0x9114('0x12')](this));_0x1e1ac1[_0x9114('0x10')](_0x9114('0x2c'),this['handleMessageEnd'][_0x9114('0x12')](this));};EmailImap[_0x9114('0x23')]['handleMessageBody']=function(_0x2c577f,_0x450741){simpleParser(_0x2c577f,{'Iconv':Iconv},this[_0x9114('0x31')][_0x9114('0x12')](this));};EmailImap[_0x9114('0x23')][_0x9114('0x30')]=function(_0x52ee3d){};EmailImap[_0x9114('0x23')][_0x9114('0x32')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x35a771,_0x398663){if(_0x35a771){logger[_0x9114('0x2b')](_0x35a771);}else{var _0x25cef5=this;utils[_0x9114('0x33')](this[_0x9114('0xe')],_0x398663,function(_0x31c1ca){_0x25cef5[_0x9114('0x34')](_0x9114('0xb'),_0x31c1ca);});}};EmailImap['prototype'][_0x9114('0x35')]=function(){this['imap']['closeBox'](!![],this[_0x9114('0x26')][_0x9114('0x12')](this));};EmailImap['prototype'][_0x9114('0x36')]=function(_0x454a37){this[_0x9114('0x13')](_0x454a37);this[_0x9114('0x2')][_0x9114('0x2d')](!![],this[_0x9114('0x26')][_0x9114('0x12')](this));};EmailImap[_0x9114('0x23')]['handleEnd']=function(){this[_0x9114('0x34')](_0x9114('0x2c'));};EmailImap[_0x9114('0x23')][_0x9114('0x13')]=function(_0x36963f,_0x1c5887){logger['error'](_0x9114('0x13'),this['account']['email'],JSON[_0x9114('0x37')](_0x36963f));var _0x5a4a19='';if(_0x36963f){if(_0x36963f[_0x9114('0x38')]){_0x5a4a19=_0x36963f[_0x9114('0x38')];}else{for(var _0x5ba53d in _0x36963f){if(_0x36963f[_0x9114('0x39')](_0x5ba53d)){_0x5a4a19+=_[_0x9114('0x3a')](_0x5ba53d)+':\x20'+_0x36963f[_0x5ba53d]+'\x0a';}}}}if(_0x1c5887){this[_0x9114('0x2')][_0x9114('0x2c')]();}else{this[_0x9114('0x34')](_0x9114('0x2b'),_0x5a4a19);this[_0x9114('0x34')]('end');}};module[_0x9114('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 839fcaf..ba1d419 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 _0x9195=['nodemailer','bluebird','nodemailer-plugin-inline-base64','compile','sendMail','toString','prototype','verify','createTransport','Not\x20verifired','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9195,0x129));var _0x5919=function(_0x617ec7,_0x2297cf){_0x617ec7=_0x617ec7-0x0;var _0x1b6f02=_0x9195[_0x617ec7];return _0x1b6f02;};'use strict';var nodemailer=require(_0x5919('0x0'));var BPromise=require(_0x5919('0x1'));var inlineBase64=require(_0x5919('0x2'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x1dbaa9,_0x1ddef4){return new BPromise(function(_0x3e09f6,_0x10906b){var _0x2b1ab6=nodemailer['createTransport'](_0x1dbaa9);_0x2b1ab6['use'](_0x5919('0x3'),inlineBase64());_0x2b1ab6[_0x5919('0x4')](_0x1ddef4,function(_0x2bba36,_0x855e31){if(_0x2bba36){_0x10906b(_0x2bba36[_0x5919('0x5')]());}else{_0x3e09f6(_0x855e31);}});});};EmailSmtp[_0x5919('0x6')][_0x5919('0x7')]=function(_0x21661f){return new BPromise(function(_0x122a24,_0xed3f58){var _0x33d3b4=nodemailer[_0x5919('0x8')](_0x21661f);_0x33d3b4[_0x5919('0x7')](function(_0xafc5a3,_0xcb25a5){if(_0xafc5a3){_0xed3f58(_0xafc5a3[_0x5919('0x5')]());}else{if(_0xcb25a5){_0x122a24(_0xcb25a5);}else{_0xed3f58(_0x5919('0x9'));}}});});};module[_0x5919('0xa')]=EmailSmtp; \ No newline at end of file +var _0x0bae=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x5e0e4c,_0x152934){var _0x45a3a1=function(_0x2bf758){while(--_0x2bf758){_0x5e0e4c['push'](_0x5e0e4c['shift']());}};_0x45a3a1(++_0x152934);}(_0x0bae,0x146));var _0xe0ba=function(_0x104949,_0x5e2541){_0x104949=_0x104949-0x0;var _0x21dc3f=_0x0bae[_0x104949];return _0x21dc3f;};'use strict';var nodemailer=require(_0xe0ba('0x0'));var BPromise=require(_0xe0ba('0x1'));var inlineBase64=require(_0xe0ba('0x2'));function EmailSmtp(){}EmailSmtp[_0xe0ba('0x3')][_0xe0ba('0x4')]=function(_0x54fc6e,_0x483c9b){return new BPromise(function(_0x5d9174,_0x5d3705){var _0x1931d=nodemailer[_0xe0ba('0x5')](_0x54fc6e);_0x1931d[_0xe0ba('0x6')](_0xe0ba('0x7'),inlineBase64());_0x1931d[_0xe0ba('0x8')](_0x483c9b,function(_0x27e0d8,_0x5def6c){if(_0x27e0d8){_0x5d3705(_0x27e0d8[_0xe0ba('0x9')]());}else{_0x5d9174(_0x5def6c);}});});};EmailSmtp[_0xe0ba('0x3')][_0xe0ba('0xa')]=function(_0x31e5e4){return new BPromise(function(_0x12c309,_0x4b08a0){var _0x429b98=nodemailer[_0xe0ba('0x5')](_0x31e5e4);_0x429b98['verify'](function(_0x4538fd,_0x8b5354){if(_0x4538fd){_0x4b08a0(_0x4538fd[_0xe0ba('0x9')]());}else{if(_0x8b5354){_0x12c309(_0x8b5354);}else{_0x4b08a0(_0xe0ba('0xb'));}}});});};module[_0xe0ba('0xc')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 28dcf50..e3ad205 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 _0x5430=['originTo','originCc','email','includes','bcc','attach','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','generate','html','test','','body','textAsHtml','0x1?_0x2bb810[_0x0543('0x10')](0x0,-0x1)[_0x0543('0x11')]('\x20'):_0x2955ea[_0x0543('0xc')];}return _0x0543('0x12');}function getLastName(_0x4204db){var _0x509afa=_['head'](_0x4204db[_0x0543('0x8')]);if(_0x509afa&&_0x509afa[_0x0543('0xc')]){var _0x4d2a27=_0x509afa['name'][_0x0543('0xe')](/\s+/);return _0x4d2a27[_0x0543('0xf')]>0x1?_0x4d2a27[_0x0543('0x13')]():'';}return'';}function getMails(_0x1cfadf,_0x38a32e){var _0x50d504='';for(var _0xe69a3d=0x0;_0xe69a3d<_0x38a32e[_0x0543('0x8')][_0x0543('0xf')];_0xe69a3d+=0x1){if(_0x38a32e[_0x0543('0x8')][_0xe69a3d][_0x0543('0x9')]!==_0x1cfadf){if(!_[_0x0543('0x14')](_0x50d504)){_0x50d504+=',';}_0x50d504+=_0x38a32e[_0x0543('0x8')][_0xe69a3d]['name']||_0x38a32e[_0x0543('0x8')][_0xe69a3d]['address']||'';_0x50d504+='\x20<';_0x50d504+=_0x38a32e['value'][_0xe69a3d][_0x0543('0x9')]?_0x38a32e[_0x0543('0x8')][_0xe69a3d][_0x0543('0x9')]:'anonymous'+random[_0x0543('0x15')](0x6)+'@xcally.com';_0x50d504+='>';}}return _0x50d504;}function parseEmail(_0x401da5,_0x411ec2,_0x543677){if(_0x411ec2[_0x0543('0x16')]){var _0x333c72=/)<[^<]*)*<\/script>/gi;while(_0x333c72[_0x0543('0x17')](_0x411ec2[_0x0543('0x16')])){_0x411ec2[_0x0543('0x16')]=_0x411ec2[_0x0543('0x16')]['replace'](_0x333c72,'');}if(_0x411ec2['html']['includes'](_0x0543('0x18'))){var _0x25b3a1=[];_0x411ec2[_0x0543('0x19')][_0x0543('0x1a')](_0x2b1425=>{_0x25b3a1[_0x0543('0x1b')](_0x2b1425[_0x0543('0x1c')]);});var _0x17a3de=/]+>/g;var _0x1fca8a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xf1eccf=_0x411ec2[_0x0543('0x16')][_0x0543('0x1d')](_0x1fca8a,'_SRC');var _0x25e6f1=_0xf1eccf[_0x0543('0x1d')](_0x17a3de,_0x0543('0x1e'));for(let _0x4f2592=0x0;_0x4f2592<_0x25b3a1[_0x0543('0xf')];_0x4f2592++){var _0x27031f=_0x25e6f1[_0x0543('0x1d')](_0x0543('0x1e'),'\x20[Attachment:\x20'+_0x25b3a1[_0x4f2592]+_0x0543('0x1f'));_0x25e6f1=_0x27031f;}_0x411ec2[_0x0543('0x16')]=_0x25e6f1;}_0x543677['body']=_0x411ec2['html'];}else{_0x543677[_0x0543('0x20')]=_0x411ec2[_0x0543('0x21')];}if(_0x543677['body']){_0x543677[_0x0543('0x20')]=_0x543677[_0x0543('0x20')][_0x0543('0x1d')](/0x0){var _0xe3936f=[_0x0543('0x33'),_0x0543('0x34'),_0x0543('0x35')];for(var _0x40f941=0x0;_0x40f941<_0x411ec2['headerLines'][_0x0543('0xf')];_0x40f941++){var _0x32d031=_[_0x0543('0xd')](_0xe3936f,_0x411ec2[_0x0543('0x32')][_0x40f941][_0x0543('0x36')]);if(_0x32d031>=0x0){_0x543677[_0x0543('0x37')]=!![];}}}return _0x543677;}exports['parser']=function(_0x53dfb8,_0x44116a,_0x30556f){var _0x1e4818={'from':getAddress(_0x44116a[_0x0543('0x38')]),'firstName':getFirstName(_0x44116a[_0x0543('0x38')]),'lastName':getLastName(_0x44116a[_0x0543('0x38')]),'mapKey':_0x0543('0x26'),'message':{'from':getMails(_0x53dfb8[_0x0543('0x26')],_0x44116a[_0x0543('0x38')]),'to':_0x53dfb8['email'],'cc':'','subject':_0x44116a['subject']||'','messageId':_0x44116a[_0x0543('0x39')],'inReplyTo':_0x44116a[_0x0543('0x3a')],'sentAt':moment(_0x44116a['date'])['format'](_0x0543('0x3b')),'attach':![],'attachments':[]}};if(!_0x44116a[_0x0543('0x16')]&&!_0x44116a['textAsHtml']){var _0x350ca8=_['filter'](_0x44116a[_0x0543('0x19')],{'contentType':_0x0543('0x3c')});if(_0x350ca8['length']){logger['info'](util[_0x0543('0x2c')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x44116a[_0x0543('0x39')]));tnef[_0x0543('0x3d')](_[_0x0543('0x3e')](_0x350ca8)[_0x0543('0x3f')],function(_0x158536,_0x310da4){if(_0x310da4){_0x44116a['html']=_0x310da4[_0x0543('0x40')]||_0x0543('0x41');if(_0x310da4[_0x0543('0x42')]){for(var _0xf0a28f=0x0;_0xf0a28f<_0x310da4[_0x0543('0x42')]['length'];_0xf0a28f++){var _0x29840e=_0x310da4['Attachments'][_0xf0a28f];_0x1e4818[_0x0543('0x23')][_0x0543('0x19')][_0x0543('0x1b')]({'filename':_0x29840e[_0x0543('0x43')],'content':Buffer[_0x0543('0x38')](_0x29840e[_0x0543('0x44')])});}}}_0x30556f(parseEmail(_0x53dfb8,_0x44116a,_0x1e4818));});}else{_0x44116a['html']='

Empty\x20message

';_0x30556f(parseEmail(_0x53dfb8,_0x44116a,_0x1e4818));}}else{_0x30556f(parseEmail(_0x53dfb8,_0x44116a,_0x1e4818));}};exports['getHost']=function(_0xc832e2){switch(_0xc832e2){case _0x0543('0x45'):return'imap.gmail.com';case _0x0543('0x46'):return _0x0543('0x47');case _0x0543('0x48'):return _0x0543('0x49');case _0x0543('0x4a'):return _0x0543('0x4b');}return'127.0.0.1';}; \ No newline at end of file +var _0xe1c4=['name','substring','split','length','join','Anonymous','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','getHost','gmail','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','lodash','moment','randomstring','node-tnef','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head'];(function(_0x3cc528,_0x3a49b8){var _0x12587f=function(_0x2a1d5f){while(--_0x2a1d5f){_0x3cc528['push'](_0x3cc528['shift']());}};_0x12587f(++_0x3a49b8);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x35173b,_0x16711b){_0x35173b=_0x35173b-0x0;var _0x51cdf4=_0xe1c4[_0x35173b];return _0x51cdf4;};'use strict';var _=require(_0x4e1c('0x0'));var moment=require(_0x4e1c('0x1'));var random=require(_0x4e1c('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x4e1c('0x3'));var logger=require('../../../config/logger')(_0x4e1c('0x4'));var config=require(_0x4e1c('0x5'));function getAddress(_0x438c83){var _0x51d90d=_['head'](_0x438c83[_0x4e1c('0x6')]);return _0x51d90d&&_0x51d90d[_0x4e1c('0x7')]?_0x51d90d[_0x4e1c('0x7')]:_0x4e1c('0x8')+random[_0x4e1c('0x9')](0x6)+_0x4e1c('0xa');}function getFirstName(_0x2622b4){var _0x443447=_[_0x4e1c('0xb')](_0x2622b4[_0x4e1c('0x6')]);if(_0x443447&&_0x443447[_0x4e1c('0xc')]){if(_0x443447[_0x4e1c('0xc')]==_0x443447[_0x4e1c('0x7')]){return _0x443447['name'][_0x4e1c('0xd')](0x0,_0x443447[_0x4e1c('0xc')]['indexOf']('@'));}var _0x2fbf2d=_0x443447[_0x4e1c('0xc')][_0x4e1c('0xe')](/\s+/);return _0x2fbf2d[_0x4e1c('0xf')]>0x1?_0x2fbf2d['slice'](0x0,-0x1)[_0x4e1c('0x10')]('\x20'):_0x443447[_0x4e1c('0xc')];}return _0x4e1c('0x11');}function getLastName(_0x2651a5){var _0x4a2093=_['head'](_0x2651a5['value']);if(_0x4a2093&&_0x4a2093[_0x4e1c('0xc')]){var _0x130d8d=_0x4a2093[_0x4e1c('0xc')][_0x4e1c('0xe')](/\s+/);return _0x130d8d['length']>0x1?_0x130d8d[_0x4e1c('0x12')]():'';}return'';}function getMails(_0x374c78,_0x12811c){var _0xdb080a='';for(var _0x44a842=0x0;_0x44a842<_0x12811c[_0x4e1c('0x6')]['length'];_0x44a842+=0x1){if(_0x12811c[_0x4e1c('0x6')][_0x44a842][_0x4e1c('0x7')]!==_0x374c78){if(!_[_0x4e1c('0x13')](_0xdb080a)){_0xdb080a+=',';}_0xdb080a+=_0x12811c[_0x4e1c('0x6')][_0x44a842][_0x4e1c('0xc')]||_0x12811c[_0x4e1c('0x6')][_0x44a842][_0x4e1c('0x7')]||'';_0xdb080a+='\x20<';_0xdb080a+=_0x12811c['value'][_0x44a842][_0x4e1c('0x7')]?_0x12811c[_0x4e1c('0x6')][_0x44a842][_0x4e1c('0x7')]:_0x4e1c('0x8')+random[_0x4e1c('0x9')](0x6)+_0x4e1c('0xa');_0xdb080a+='>';}}return _0xdb080a;}function parseEmail(_0x32c9de,_0x53a020,_0x25a753){if(_0x53a020[_0x4e1c('0x14')]){var _0xc57bcc=/)<[^<]*)*<\/script>/gi;while(_0xc57bcc[_0x4e1c('0x15')](_0x53a020[_0x4e1c('0x14')])){_0x53a020[_0x4e1c('0x14')]=_0x53a020[_0x4e1c('0x14')][_0x4e1c('0x16')](_0xc57bcc,'');}if(_0x53a020[_0x4e1c('0x14')]['includes'](_0x4e1c('0x17'))){var _0x7e08f5=[];_0x53a020[_0x4e1c('0x18')]['forEach'](_0x5c0f83=>{_0x7e08f5[_0x4e1c('0x19')](_0x5c0f83['filename']);});var _0x25cc93=/]+>/g;var _0xd9c771=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2a2ccb=_0x53a020[_0x4e1c('0x14')][_0x4e1c('0x16')](_0xd9c771,_0x4e1c('0x1a'));var _0x48f794=_0x2a2ccb[_0x4e1c('0x16')](_0x25cc93,_0x4e1c('0x1b'));for(let _0x264c48=0x0;_0x264c48<_0x7e08f5[_0x4e1c('0xf')];_0x264c48++){var _0x145c29=_0x48f794['replace'](_0x4e1c('0x1b'),_0x4e1c('0x1c')+_0x7e08f5[_0x264c48]+_0x4e1c('0x1d'));_0x48f794=_0x145c29;}_0x53a020[_0x4e1c('0x14')]=_0x48f794;}_0x25a753['body']=_0x53a020[_0x4e1c('0x14')];}else{_0x25a753[_0x4e1c('0x1e')]=_0x53a020['textAsHtml'];}if(_0x25a753[_0x4e1c('0x1e')]){_0x25a753['body']=_0x25a753[_0x4e1c('0x1e')][_0x4e1c('0x16')](/0x0){var _0x115dc2=[_0x4e1c('0x30'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x21f504=0x0;_0x21f504<_0x53a020[_0x4e1c('0x2f')][_0x4e1c('0xf')];_0x21f504++){var _0x1abe84=_[_0x4e1c('0x31')](_0x115dc2,_0x53a020[_0x4e1c('0x2f')][_0x21f504]['line']);if(_0x1abe84>=0x0){_0x25a753[_0x4e1c('0x32')]=!![];}}}return _0x25a753;}exports[_0x4e1c('0x33')]=function(_0x827f0a,_0xdfb6d7,_0x7d3a7b){var _0xd09c4f={'from':getAddress(_0xdfb6d7[_0x4e1c('0x34')]),'firstName':getFirstName(_0xdfb6d7[_0x4e1c('0x34')]),'lastName':getLastName(_0xdfb6d7[_0x4e1c('0x34')]),'mapKey':_0x4e1c('0x4'),'message':{'from':getMails(_0x827f0a[_0x4e1c('0x4')],_0xdfb6d7['from']),'to':_0x827f0a[_0x4e1c('0x4')],'cc':'','subject':_0xdfb6d7[_0x4e1c('0x35')]||'','messageId':_0xdfb6d7[_0x4e1c('0x36')],'inReplyTo':_0xdfb6d7[_0x4e1c('0x37')],'sentAt':moment(_0xdfb6d7[_0x4e1c('0x38')])[_0x4e1c('0x28')](_0x4e1c('0x39')),'attach':![],'attachments':[]}};if(!_0xdfb6d7[_0x4e1c('0x14')]&&!_0xdfb6d7['textAsHtml']){var _0x3f63b1=_['filter'](_0xdfb6d7[_0x4e1c('0x18')],{'contentType':_0x4e1c('0x3a')});if(_0x3f63b1['length']){logger[_0x4e1c('0x3b')](util[_0x4e1c('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0xdfb6d7['messageId']));tnef[_0x4e1c('0x3c')](_[_0x4e1c('0x3d')](_0x3f63b1)[_0x4e1c('0x2d')],function(_0x7b26dc,_0x5b009d){if(_0x5b009d){_0xdfb6d7[_0x4e1c('0x14')]=_0x5b009d[_0x4e1c('0x3e')]||_0x4e1c('0x3f');if(_0x5b009d[_0x4e1c('0x40')]){for(var _0x488fe4=0x0;_0x488fe4<_0x5b009d[_0x4e1c('0x40')][_0x4e1c('0xf')];_0x488fe4++){var _0x2a9a6b=_0x5b009d[_0x4e1c('0x40')][_0x488fe4];_0xd09c4f[_0x4e1c('0x20')][_0x4e1c('0x18')][_0x4e1c('0x19')]({'filename':_0x2a9a6b[_0x4e1c('0x41')],'content':Buffer[_0x4e1c('0x34')](_0x2a9a6b['Data'])});}}}_0x7d3a7b(parseEmail(_0x827f0a,_0xdfb6d7,_0xd09c4f));});}else{_0xdfb6d7[_0x4e1c('0x14')]='

Empty\x20message

';_0x7d3a7b(parseEmail(_0x827f0a,_0xdfb6d7,_0xd09c4f));}}else{_0x7d3a7b(parseEmail(_0x827f0a,_0xdfb6d7,_0xd09c4f));}};exports[_0x4e1c('0x42')]=function(_0x425605){switch(_0x425605){case _0x4e1c('0x43'):return'imap.gmail.com';case'yahoo':return _0x4e1c('0x44');case _0x4e1c('0x45'):return'imap-mail.outlook.com';case _0x4e1c('0x46'):return _0x4e1c('0x47');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 4955fed..179509a 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 _0xa65b=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa65b,0x188));var _0xba65=function(_0x145f8d,_0xe79610){_0x145f8d=_0x145f8d-0x0;var _0x16d2f2=_0xa65b[_0x145f8d];return _0x16d2f2;};'use strict';var _=require('lodash');function MailAccount(_0x3a448b){this['id']=_0x3a448b['id']||0x0;this[_0xba65('0x0')]=_0x3a448b[_0xba65('0x0')]||_0xba65('0x1');this['key']=_0x3a448b[_0xba65('0x2')]||_0xba65('0x3');this['active']=_0x3a448b[_0xba65('0x4')]||![];this[_0xba65('0x5')]=_0x3a448b[_0xba65('0x5')]||[];this[_0xba65('0x6')]=_0x3a448b[_0xba65('0x6')]||[];}module[_0xba65('0x7')]=MailAccount; \ No newline at end of file +var _0xdfea=['Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0xdfea,0x199));var _0xadfe=function(_0xb1bec5,_0x2726f6){_0xb1bec5=_0xb1bec5-0x0;var _0x590f16=_0xdfea[_0xb1bec5];return _0x590f16;};'use strict';var _=require(_0xadfe('0x0'));function MailAccount(_0x284e99){this['id']=_0x284e99['id']||0x0;this[_0xadfe('0x1')]=_0x284e99[_0xadfe('0x1')]||_0xadfe('0x2');this[_0xadfe('0x3')]=_0x284e99[_0xadfe('0x3')]||'SERV';this['active']=_0x284e99['active']||![];this[_0xadfe('0x4')]=_0x284e99[_0xadfe('0x4')]||[];this[_0xadfe('0x5')]=_0x284e99[_0xadfe('0x5')]||[];}module[_0xadfe('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 33aad63..8cac4cd 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 _0x0a6a=['mergeFromDatabase','initMailAccounts','merge','lodash','../model/mailAccount','mailAccounts','prototype'];(function(_0x44cf49,_0x372e1d){var _0x2eec97=function(_0x5782c5){while(--_0x5782c5){_0x44cf49['push'](_0x44cf49['shift']());}};_0x2eec97(++_0x372e1d);}(_0x0a6a,0x14c));var _0xa0a6=function(_0x5bf35e,_0x24dd1b){_0x5bf35e=_0x5bf35e-0x0;var _0x533fa1=_0x0a6a[_0x5bf35e];return _0x533fa1;};'use strict';var _=require(_0xa0a6('0x0'));var MailAccount=require(_0xa0a6('0x1'));var Realtime=function(){this[_0xa0a6('0x2')]={};};function freeIsNotKey(_0x376c39,_0x393786,_0x735834){var _0x3c42b5=_['mapKeys'](_0x376c39,function(_0x4c33a5,_0x2e1a96){return _0x4c33a5[_0x735834];});for(var _0x12b680 in _0x393786){if(_0x393786['hasOwnProperty'](_0x12b680)){if(!_0x3c42b5[_0x12b680]){delete _0x393786[_0x12b680];}}}}Realtime[_0xa0a6('0x3')][_0xa0a6('0x4')]=function(_0x5b0d94,_0xaa2b2d){for(var _0x1ae009 in _0xaa2b2d){if(_0x5b0d94['hasOwnProperty'](_0x1ae009)){_0x5b0d94[_0x1ae009]=_0xaa2b2d[_0x1ae009];}}};Realtime[_0xa0a6('0x3')][_0xa0a6('0x5')]=function(){var _0x31f382=this;return function(_0x59a2b0){if(_0x59a2b0){freeIsNotKey(_0x59a2b0,_0x31f382[_0xa0a6('0x2')],'id');for(var _0x59ccf5=0x0,_0x5db2dd={},_0x48a8c4={};_0x59ccf5<_0x59a2b0['length'];_0x59ccf5+=0x1){_0x5db2dd=_0x59a2b0[_0x59ccf5];if(_['isUndefined'](_0x31f382[_0xa0a6('0x2')][_0x5db2dd['id']])){_0x31f382[_0xa0a6('0x2')][_0x5db2dd['id']]=new MailAccount(_0x5db2dd);}else{_[_0xa0a6('0x6')](_0x31f382[_0xa0a6('0x2')][_0x5db2dd['id']],_0x5db2dd);}}}return _0x31f382[_0xa0a6('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0xf7e3=['merge','exports','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined'];(function(_0x139745,_0x503124){var _0x2cd695=function(_0x2ab1ba){while(--_0x2ab1ba){_0x139745['push'](_0x139745['shift']());}};_0x2cd695(++_0x503124);}(_0xf7e3,0x1ba));var _0x3f7e=function(_0x8b057f,_0x54df19){_0x8b057f=_0x8b057f-0x0;var _0x5c4942=_0xf7e3[_0x8b057f];return _0x5c4942;};'use strict';var _=require(_0x3f7e('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x3f7e('0x1')]={};};function freeIsNotKey(_0x39d6d0,_0x406534,_0x1dc476){var _0x2a5ba0=_[_0x3f7e('0x2')](_0x39d6d0,function(_0x42c8f5,_0x3dd89b){return _0x42c8f5[_0x1dc476];});for(var _0x2c5642 in _0x406534){if(_0x406534[_0x3f7e('0x3')](_0x2c5642)){if(!_0x2a5ba0[_0x2c5642]){delete _0x406534[_0x2c5642];}}}}Realtime[_0x3f7e('0x4')][_0x3f7e('0x5')]=function(_0x2fe7f5,_0x52518e){for(var _0x3e314e in _0x52518e){if(_0x2fe7f5[_0x3f7e('0x3')](_0x3e314e)){_0x2fe7f5[_0x3e314e]=_0x52518e[_0x3e314e];}}};Realtime[_0x3f7e('0x4')]['initMailAccounts']=function(){var _0x1f8f51=this;return function(_0x2d21b1){if(_0x2d21b1){freeIsNotKey(_0x2d21b1,_0x1f8f51[_0x3f7e('0x1')],'id');for(var _0x53bac3=0x0,_0x39fb85={},_0x3ae2d3={};_0x53bac3<_0x2d21b1[_0x3f7e('0x6')];_0x53bac3+=0x1){_0x39fb85=_0x2d21b1[_0x53bac3];if(_[_0x3f7e('0x7')](_0x1f8f51['mailAccounts'][_0x39fb85['id']])){_0x1f8f51[_0x3f7e('0x1')][_0x39fb85['id']]=new MailAccount(_0x39fb85);}else{_[_0x3f7e('0x8')](_0x1f8f51[_0x3f7e('0x1')][_0x39fb85['id']],_0x39fb85);}}}return _0x1f8f51[_0x3f7e('0x1')];};};module[_0x3f7e('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 0af8575..5b0517e 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 _0x23c7=['Imap','MailServerOut','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','service','active','key','ListId','MailServerIn'];(function(_0x96690f,_0x2e3b8a){var _0x411260=function(_0x19bd3a){while(--_0x19bd3a){_0x96690f['push'](_0x96690f['shift']());}};_0x411260(++_0x2e3b8a);}(_0x23c7,0x86));var _0x723c=function(_0x10e84d,_0x27dd02){_0x10e84d=_0x10e84d-0x0;var _0x30cc2b=_0x23c7[_0x10e84d];return _0x30cc2b;};'use strict';var client=require(_0x723c('0x0'));exports[_0x723c('0x1')]=function(){return function(){return client[_0x723c('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x723c('0x3'),_0x723c('0x4'),'email',_0x723c('0x5'),_0x723c('0x6'),_0x723c('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x723c('0x8'),'as':_0x723c('0x9')},{'model':_0x723c('0xa'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x723c('0xb')]=function(_0x5efad1,_0x5e9f8f){return client[_0x723c('0x2')](_0x723c('0xc'),{'account':{'id':_0x5efad1},'body':_0x5e9f8f,'log':_0x723c('0xc')});}; \ No newline at end of file +var _0x0b36=['Imap','MailServerOut','notify','NotifyMailAccount','../client','getMailAccounts','Request','email','key','ListId','TemplateId','MailServerIn'];(function(_0x4668de,_0x2f55ab){var _0x2c0c7c=function(_0x48e52c){while(--_0x48e52c){_0x4668de['push'](_0x4668de['shift']());}};_0x2c0c7c(++_0x2f55ab);}(_0x0b36,0x10c));var _0x60b3=function(_0x386306,_0x1363c9){_0x386306=_0x386306-0x0;var _0xcb23d=_0x0b36[_0x386306];return _0xcb23d;};'use strict';var client=require(_0x60b3('0x0'));exports[_0x60b3('0x1')]=function(){return function(){return client[_0x60b3('0x2')]('GetMailAccount',{'options':{'attributes':['id','name','service',_0x60b3('0x3'),'active',_0x60b3('0x4'),_0x60b3('0x5'),_0x60b3('0x6')],'raw':![],'include':[{'model':_0x60b3('0x7'),'as':_0x60b3('0x8')},{'model':_0x60b3('0x9'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x60b3('0xa')]=function(_0x2adbdc,_0x337f03){return client[_0x60b3('0x2')](_0x60b3('0xb'),{'account':{'id':_0x2adbdc},'body':_0x337f03,'log':_0x60b3('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4710074..510a0d1 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 _0x3d0c=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x59edc0,_0x19ebb0){var _0x2bfadd=function(_0x3fb386){while(--_0x3fb386){_0x59edc0['push'](_0x59edc0['shift']());}};_0x2bfadd(++_0x19ebb0);}(_0x3d0c,0x11a));var _0xc3d0=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x3d0c[_0x96f74c];return _0x379222;};'use strict';var client=require(_0xc3d0('0x0'));exports[_0xc3d0('0x1')]=function(){return client[_0xc3d0('0x2')](_0xc3d0('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc3d0('0x4')]},'log':_0xc3d0('0x5')});}; \ No newline at end of file +var _0x40d7=['loginMailFrequency','../client','getSettings','Request'];(function(_0x33a0ab,_0x4ed80a){var _0x8d4a96=function(_0x21a9b5){while(--_0x21a9b5){_0x33a0ab['push'](_0x33a0ab['shift']());}};_0x8d4a96(++_0x4ed80a);}(_0x40d7,0x91));var _0x740d=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0x40d7[_0x5a187b];return _0x14d601;};'use strict';var client=require(_0x740d('0x0'));exports[_0x740d('0x1')]=function(){return client[_0x740d('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x740d('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 487a38f..d4b6012 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 5f92a50..5bc0b26 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 _0xcd7b=['express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','socket.io-redis','../../config/triggers','../../config/socketio','default','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http'];(function(_0x144725,_0x2ad835){var _0x516c96=function(_0x16d03c){while(--_0x16d03c){_0x144725['push'](_0x144725['shift']());}};_0x516c96(++_0x2ad835);}(_0xcd7b,0x12a));var _0xbcd7=function(_0xe5bad9,_0x50ef4d){_0xe5bad9=_0xe5bad9-0x0;var _0xcac47a=_0xcd7b[_0xe5bad9];return _0xcac47a;};'use strict';var _=require('lodash');var http=require(_0xbcd7('0x0'));var express=require(_0xbcd7('0x1'));var sticky=require(_0xbcd7('0x2'));var Redis=require(_0xbcd7('0x3'));var config=require(_0xbcd7('0x4'));var app=express();var server=http[_0xbcd7('0x5')](app);server[_0xbcd7('0x6')]=0xdbba0;if(sticky[_0xbcd7('0x7')](server,config[_0xbcd7('0x8')])){var socketio=require(_0xbcd7('0x9'))(server,{'transports':[_0xbcd7('0xa'),_0xbcd7('0xb')]});config[_0xbcd7('0xc')]=_[_0xbcd7('0xd')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0xbcd7('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xbcd7('0xc')])}));require(_0xbcd7('0xf'))['default']();require(_0xbcd7('0x10'))['default'](socketio);require('../../config/express')[_0xbcd7('0x11')](app);require(_0xbcd7('0x12'))[_0xbcd7('0x11')](app);}else{server[_0xbcd7('0x13')]('listening',function(){console[_0xbcd7('0x14')](_0xbcd7('0x15'),config[_0xbcd7('0x8')]);});}exports=module[_0xbcd7('0x16')]=app; \ No newline at end of file +var _0xd931=['localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','redis','defaults'];(function(_0x2c2241,_0x1e53d5){var _0x5cb4e2=function(_0x5dc31c){while(--_0x5dc31c){_0x2c2241['push'](_0x2c2241['shift']());}};_0x5cb4e2(++_0x1e53d5);}(_0xd931,0xd0));var _0x1d93=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xd931[_0x595013];return _0x2a29e3;};'use strict';var _=require('lodash');var http=require(_0x1d93('0x0'));var express=require(_0x1d93('0x1'));var sticky=require(_0x1d93('0x2'));var Redis=require(_0x1d93('0x3'));var config=require(_0x1d93('0x4'));var app=express();var server=http[_0x1d93('0x5')](app);server[_0x1d93('0x6')]=0xdbba0;if(sticky[_0x1d93('0x7')](server,config[_0x1d93('0x8')])){var socketio=require(_0x1d93('0x9'))(server,{'transports':['websocket','polling']});config[_0x1d93('0xa')]=_[_0x1d93('0xb')](config[_0x1d93('0xa')],{'host':_0x1d93('0xc'),'port':0x18eb});socketio[_0x1d93('0xd')](require(_0x1d93('0xe'))({'pubClient':new Redis(config[_0x1d93('0xa')]),'subClient':new Redis(config['redis'])}));require(_0x1d93('0xf'))[_0x1d93('0x10')]();require('../../config/socketio')[_0x1d93('0x10')](socketio);require(_0x1d93('0x11'))['default'](app);require('../../routes')[_0x1d93('0x10')](app);}else{server[_0x1d93('0x12')]('listening',function(){console[_0x1d93('0x13')](_0x1d93('0x14'),config[_0x1d93('0x8')]);});}exports=module[_0x1d93('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 1d882e7..b7bc4f6 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 _0x7994=['debug','rpc','error','message','routing','exports','jayson/promise','../../config/logger','client','http','Request','request','then'];(function(_0x27ec50,_0x1d8698){var _0x2da0f5=function(_0x206a3e){while(--_0x206a3e){_0x27ec50['push'](_0x27ec50['shift']());}};_0x2da0f5(++_0x1d8698);}(_0x7994,0x1da));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x4799('0x0'));var BPromise=require('bluebird');var logger=require(_0x4799('0x1'))('routing');var client=jayson[_0x4799('0x2')][_0x4799('0x3')]({'port':0x2329});client[_0x4799('0x4')]=function(_0xf67dfc,_0x58ee89){return new BPromise(function(_0x50898e,_0x316212){return client[_0x4799('0x5')](_0xf67dfc,_0x58ee89)[_0x4799('0x6')](function(_0x5bf717){logger[_0x4799('0x7')](_0x4799('0x8'),'routing',_0xf67dfc,_0x58ee89,_0x5bf717);if(_0x5bf717['error']){logger[_0x4799('0x9')](_0x4799('0x8'),'routing',_0xf67dfc,_0x5bf717[_0x4799('0x9')][_0x4799('0xa')],_0x58ee89);return _0x316212(_0x5bf717[_0x4799('0x9')][_0x4799('0xa')]);}else{return _0x50898e(_0x5bf717['result']);}})['catch'](function(_0x5aac83){logger[_0x4799('0x9')](_0x4799('0x8'),_0x4799('0xb'),_0xf67dfc,_0x5aac83,_0x58ee89);return _0x316212(_0x5aac83);});});};module[_0x4799('0xc')]=client; \ No newline at end of file +var _0xd989=['rpc','error','message','catch','bluebird','../../config/logger','routing','client','request','then','debug'];(function(_0x112d2e,_0x34d10d){var _0xe21b9e=function(_0x3e8295){while(--_0x3e8295){_0x112d2e['push'](_0x112d2e['shift']());}};_0xe21b9e(++_0x34d10d);}(_0xd989,0x1bc));var _0x9d98=function(_0x56c313,_0x4acb15){_0x56c313=_0x56c313-0x0;var _0x12987d=_0xd989[_0x56c313];return _0x12987d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x9d98('0x0'));var logger=require(_0x9d98('0x1'))(_0x9d98('0x2'));var client=jayson[_0x9d98('0x3')]['http']({'port':0x2329});client['Request']=function(_0x50d5fe,_0x292339){return new BPromise(function(_0x1fc3a2,_0x5b7cb2){return client[_0x9d98('0x4')](_0x50d5fe,_0x292339)[_0x9d98('0x5')](function(_0x12512c){logger[_0x9d98('0x6')](_0x9d98('0x7'),_0x9d98('0x2'),_0x50d5fe,_0x292339,_0x12512c);if(_0x12512c[_0x9d98('0x8')]){logger[_0x9d98('0x8')]('rpc','routing',_0x50d5fe,_0x12512c[_0x9d98('0x8')][_0x9d98('0x9')],_0x292339);return _0x5b7cb2(_0x12512c[_0x9d98('0x8')][_0x9d98('0x9')]);}else{return _0x1fc3a2(_0x12512c['result']);}})[_0x9d98('0xa')](function(_0x5203d7){logger[_0x9d98('0x8')](_0x9d98('0x7'),_0x9d98('0x2'),_0x50d5fe,_0x5203d7,_0x292339);return _0x5b7cb2(_0x5203d7);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 0265c1e..706274c 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 _0x6d96=['./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','getWhatsappQueues','listen','./server'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x6d96,0x71));var _0x66d9=function(_0x51eb77,_0x436673){_0x51eb77=_0x51eb77-0x0;var _0x4b26fe=_0x6d96[_0x51eb77];return _0x4b26fe;};'use strict';var BPromise=require('bluebird');var server=require(_0x66d9('0x0'));var Realtime=require(_0x66d9('0x1'));var user=require(_0x66d9('0x2'));var interval=require(_0x66d9('0x3'));var openchannelQueue=require(_0x66d9('0x4'));var chatQueue=require(_0x66d9('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x66d9('0x6'));var faxQueue=require(_0x66d9('0x7'));var whatsappQueue=require(_0x66d9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x66d9('0x9')]()[_0x66d9('0xa')](user['getAgents']())[_0x66d9('0xa')](realtime[_0x66d9('0xb')]())[_0x66d9('0xa')](interval['getIntervals']())[_0x66d9('0xa')](realtime['initIntervals']())[_0x66d9('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x66d9('0xa')](realtime['initOpenchannelQueues']())[_0x66d9('0xa')](chatQueue[_0x66d9('0xc')]())[_0x66d9('0xa')](realtime['initChatQueues']())['then'](smsQueue[_0x66d9('0xd')]())[_0x66d9('0xa')](realtime[_0x66d9('0xe')]())[_0x66d9('0xa')](mailQueue[_0x66d9('0xf')]())[_0x66d9('0xa')](realtime['initMailQueues']())[_0x66d9('0xa')](faxQueue[_0x66d9('0x10')]())[_0x66d9('0xa')](realtime['initFaxQueues']())[_0x66d9('0xa')](whatsappQueue[_0x66d9('0x11')]())[_0x66d9('0xa')](realtime['initWhatsappQueues']())[_0x66d9('0xa')](function(){return realtime;});}function main(){return server[_0x66d9('0x12')](realtime)[_0x66d9('0xa')](function(_0x457ee3){return initRealtime();})[_0x66d9('0xa')](function(_0x5aa6f0){return setInterval(initRealtime,0x1388);})['catch'](function(_0x46e514){console['log'](_0x46e514);});}main(); \ No newline at end of file +var _0xaac5=['then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaac5,0xad));var _0x5aac=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xaac5[_0x50007c];return _0x5c1ec7;};'use strict';var BPromise=require(_0x5aac('0x0'));var server=require(_0x5aac('0x1'));var Realtime=require('./realtime');var user=require(_0x5aac('0x2'));var interval=require(_0x5aac('0x3'));var openchannelQueue=require(_0x5aac('0x4'));var chatQueue=require(_0x5aac('0x5'));var smsQueue=require(_0x5aac('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x5aac('0x7'));var whatsappQueue=require(_0x5aac('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x5aac('0x9')]()['then'](user[_0x5aac('0xa')]())[_0x5aac('0xb')](realtime[_0x5aac('0xc')]())[_0x5aac('0xb')](interval[_0x5aac('0xd')]())[_0x5aac('0xb')](realtime[_0x5aac('0xe')]())[_0x5aac('0xb')](openchannelQueue[_0x5aac('0xf')]())[_0x5aac('0xb')](realtime['initOpenchannelQueues']())[_0x5aac('0xb')](chatQueue[_0x5aac('0x10')]())[_0x5aac('0xb')](realtime['initChatQueues']())['then'](smsQueue[_0x5aac('0x11')]())['then'](realtime['initSmsQueues']())[_0x5aac('0xb')](mailQueue['getMailQueues']())[_0x5aac('0xb')](realtime['initMailQueues']())[_0x5aac('0xb')](faxQueue[_0x5aac('0x12')]())[_0x5aac('0xb')](realtime[_0x5aac('0x13')]())[_0x5aac('0xb')](whatsappQueue[_0x5aac('0x14')]())[_0x5aac('0xb')](realtime[_0x5aac('0x15')]())[_0x5aac('0xb')](function(){return realtime;});}function main(){return server[_0x5aac('0x16')](realtime)[_0x5aac('0xb')](function(_0x38c045){return initRealtime();})['then'](function(_0x3d9798){return setInterval(initRealtime,0x1388);})['catch'](function(_0x39abd4){console['log'](_0x39abd4);});}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 6b767a1..1aece1b 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 _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(_0x1cb2c5,_0x2589dc){var _0x1e373c=function(_0x55121a){while(--_0x55121a){_0x1cb2c5['push'](_0x1cb2c5['shift']());}};_0x1e373c(++_0x2589dc);}(_0x326f,0xd1));var _0xf326=function(_0x2a090b,_0x393a7d){_0x2a090b=_0x2a090b-0x0;var _0x27807f=_0x326f[_0x2a090b];return _0x27807f;};'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 +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x2edd80,_0x3ced21){var _0xe2053b=function(_0x3e5d68){while(--_0x3e5d68){_0x2edd80['push'](_0x2edd80['shift']());}};_0xe2053b(++_0x3ced21);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6dd0,_0x2c9b57){_0x5e6dd0=_0x5e6dd0-0x0;var _0x5f53aa=_0x7a54[_0x5e6dd0];return _0x5f53aa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1f957cb..97f2ec2 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 _0xddf9=['sendMailMessage','bluebird','jayson/promise','client','request','then','error','result'];(function(_0x527a92,_0x25805d){var _0x5611f9=function(_0x4fcbd4){while(--_0x4fcbd4){_0x527a92['push'](_0x527a92['shift']());}};_0x5611f9(++_0x25805d);}(_0xddf9,0x1a1));var _0x9ddf=function(_0x4c2b80,_0x2d9078){_0x4c2b80=_0x4c2b80-0x0;var _0x21ecf9=_0xddf9[_0x4c2b80];return _0x21ecf9;};'use strict';var BPromise=require(_0x9ddf('0x0'));var jayson=require(_0x9ddf('0x1'));var client=jayson[_0x9ddf('0x2')]['http']({'port':0x232b});function request(_0x217b2b,_0x2218db){return new BPromise(function(_0x254f32,_0x15bcd2){return client[_0x9ddf('0x3')](_0x217b2b,_0x2218db)[_0x9ddf('0x4')](function(_0x1959df){if(_0x1959df[_0x9ddf('0x5')]){return _0x15bcd2(_0x1959df[_0x9ddf('0x5')]['message']);}else{return _0x254f32(_0x1959df[_0x9ddf('0x6')]);}})['catch'](function(_0x302123){return _0x15bcd2(_0x302123);});});}exports[_0x9ddf('0x7')]=function(_0x28f3c0,_0x337249){return request('SendMail',{'account':_0x28f3c0,'message':_0x337249});}; \ No newline at end of file +var _0x3e72=['sendMailMessage','SendMail','bluebird','client','http','request','then','error','message','result','catch'];(function(_0x1cf914,_0x4f2288){var _0x297b3f=function(_0xbe33a5){while(--_0xbe33a5){_0x1cf914['push'](_0x1cf914['shift']());}};_0x297b3f(++_0x4f2288);}(_0x3e72,0xe9));var _0x23e7=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x3e72[_0xe8129c];return _0x709fc5;};'use strict';var BPromise=require(_0x23e7('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x23e7('0x1')][_0x23e7('0x2')]({'port':0x232b});function request(_0x5d9e69,_0x46861d){return new BPromise(function(_0x313e2d,_0x86f642){return client[_0x23e7('0x3')](_0x5d9e69,_0x46861d)[_0x23e7('0x4')](function(_0x53f421){if(_0x53f421[_0x23e7('0x5')]){return _0x86f642(_0x53f421[_0x23e7('0x5')][_0x23e7('0x6')]);}else{return _0x313e2d(_0x53f421[_0x23e7('0x7')]);}})[_0x23e7('0x8')](function(_0x152296){return _0x86f642(_0x152296);});});}exports[_0x23e7('0x9')]=function(_0x1426ac,_0x535120){return request(_0x23e7('0xa'),{'account':_0x1426ac,'message':_0x535120});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 75df551..0e880e8 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 _0x4a55=['openchannel','whatsapp','length','Status','StatusTime','toNumber','online','mailCurrentCapacity','whatsappCurrentCapacity','stringify','emit','user:save','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','updateRealtime'];(function(_0x1fbebb,_0x328bda){var _0x2543f1=function(_0x2e07f7){while(--_0x2e07f7){_0x1fbebb['push'](_0x1fbebb['shift']());}};_0x2543f1(++_0x328bda);}(_0x4a55,0x124));var _0x54a5=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x4a55[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x54a5('0x0'));var moment=require('moment');var md5=require(_0x54a5('0x1'));var Redis=require(_0x54a5('0x2'));var config=require(_0x54a5('0x3'));config['redis']=_[_0x54a5('0x4')](config[_0x54a5('0x5')],{'host':_0x54a5('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x2a6a73){this['id']=_0x2a6a73['id']||0x0;this[_0x54a5('0x7')]=_0x2a6a73['name']||'';this['online']=_0x2a6a73['online']||!![];this[_0x54a5('0x8')]=_0x2a6a73[_0x54a5('0x8')]||![];this[_0x54a5('0x9')]=_0x2a6a73[_0x54a5('0x9')]||![];this[_0x54a5('0xa')]=_0x2a6a73[_0x54a5('0xa')]||![];this['faxPause']=_0x2a6a73[_0x54a5('0xb')]||![];this['smsPause']=_0x2a6a73[_0x54a5('0xc')]||![];this[_0x54a5('0xd')]=_0x2a6a73[_0x54a5('0xd')]||![];this[_0x54a5('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x54a5('0xf')]=_0x2a6a73[_0x54a5('0xf')]||0x0;this[_0x54a5('0x10')]=0x0;this[_0x54a5('0x11')]=_0x54a5('0x12');this[_0x54a5('0x13')]=0x0;this[_0x54a5('0x14')]=_0x2a6a73[_0x54a5('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x54a5('0x15')]='unknown';this[_0x54a5('0x16')]=0x0;this[_0x54a5('0x17')]=_0x2a6a73[_0x54a5('0x17')]||0x0;this[_0x54a5('0x18')]=0x0;this['smsStatus']='unknown';this[_0x54a5('0x19')]=0x0;this[_0x54a5('0x1a')]=_0x2a6a73[_0x54a5('0x1a')]||0x0;this[_0x54a5('0x1b')]=0x0;this[_0x54a5('0x1c')]='unknown';this[_0x54a5('0x1d')]=0x0;this['whatsappCapacity']=_0x2a6a73[_0x54a5('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x54a5('0x1f')]=_0x54a5('0x12');this[_0x54a5('0x20')]=0x0;this[_0x54a5('0x21')]=_0x2a6a73['openchannelCapacity']||0x0;this[_0x54a5('0x22')]=0x0;this[_0x54a5('0x23')]=![];this[_0x54a5('0x24')]=undefined;this[_0x54a5('0x1')]='';this['updateRealtime']();}Agent[_0x54a5('0x25')][_0x54a5('0x26')]=function(_0x5c5ecd){if(this[_0x5c5ecd+'CurrentCapacity']>0x0){if(this[_0x5c5ecd+'Capacity']>0x0&&this[_0x5c5ecd+_0x54a5('0x27')]>=this[_0x5c5ecd+_0x54a5('0x28')]){return'maxcapacity';}else{return _0x54a5('0x29');}}else{return _0x54a5('0x2a');}};Agent[_0x54a5('0x25')][_0x54a5('0x2b')]=function(){var _0x114e71=['mail','chat',_0x54a5('0x2c'),'fax','sms',_0x54a5('0x2d')];for(var _0x5344f2=0x0;_0x5344f2<_0x114e71[_0x54a5('0x2e')];_0x5344f2+=0x1){var _0x447a69=this[_0x54a5('0x26')](_0x114e71[_0x5344f2]);if(this[_0x114e71[_0x5344f2]+_0x54a5('0x2f')]!==_0x447a69){this[_0x114e71[_0x5344f2]+_0x54a5('0x30')]=_[_0x54a5('0x31')](moment()['format']('x'));}this[_0x114e71[_0x5344f2]+_0x54a5('0x2f')]=_0x447a69;}var _0xc12073={'id':this['id'],'name':this[_0x54a5('0x7')],'online':this[_0x54a5('0x32')],'voicePause':this[_0x54a5('0x8')],'chatPause':this[_0x54a5('0x9')],'mailPause':this[_0x54a5('0xa')],'smsPause':this[_0x54a5('0xc')],'faxPause':this[_0x54a5('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x54a5('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x54a5('0xf')],'chatCurrentCapacity':this[_0x54a5('0x10')],'mailStatus':this[_0x54a5('0x11')],'mailStatusTime':this[_0x54a5('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x54a5('0x33')],'faxStatus':this[_0x54a5('0x15')],'faxStatusTime':this[_0x54a5('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x54a5('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x54a5('0x19')],'smsCapacity':this[_0x54a5('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x54a5('0x1c')],'whatsappStatusTime':this[_0x54a5('0x1d')],'whatsappCapacity':this[_0x54a5('0x1e')],'whatsappCurrentCapacity':this[_0x54a5('0x34')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x54a5('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x54a5('0x22')],'busy':this['busy'],'busyQueue':this[_0x54a5('0x24')]};var _0x1561d6=md5(JSON[_0x54a5('0x35')](_0xc12073));if(this['md5']!==_0x1561d6){this['md5']=_0x1561d6;io[_0x54a5('0x36')](_0x54a5('0x37'),_0xc12073);}};module['exports']=Agent; \ No newline at end of file +var _0x934b=['mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','Status','StatusTime','format','mailStatusTime','whatsappStatus','openchannelStatus','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause'];(function(_0x340c13,_0x595d66){var _0x5a7d96=function(_0x250118){while(--_0x250118){_0x340c13['push'](_0x340c13['shift']());}};_0x5a7d96(++_0x595d66);}(_0x934b,0xe4));var _0xb934=function(_0x208705,_0x1ee99d){_0x208705=_0x208705-0x0;var _0x101594=_0x934b[_0x208705];return _0x101594;};'use strict';var _=require(_0xb934('0x0'));var moment=require(_0xb934('0x1'));var md5=require(_0xb934('0x2'));var Redis=require(_0xb934('0x3'));var config=require('../../../config/environment');config[_0xb934('0x4')]=_[_0xb934('0x5')](config[_0xb934('0x4')],{'host':_0xb934('0x6'),'port':0x18eb});var io=require(_0xb934('0x7'))(new Redis(config[_0xb934('0x4')]));function Agent(_0x31e1f6){this['id']=_0x31e1f6['id']||0x0;this[_0xb934('0x8')]=_0x31e1f6['name']||'';this[_0xb934('0x9')]=_0x31e1f6['online']||!![];this[_0xb934('0xa')]=_0x31e1f6['voicePause']||![];this[_0xb934('0xb')]=_0x31e1f6[_0xb934('0xb')]||![];this[_0xb934('0xc')]=_0x31e1f6[_0xb934('0xc')]||![];this[_0xb934('0xd')]=_0x31e1f6[_0xb934('0xd')]||![];this[_0xb934('0xe')]=_0x31e1f6[_0xb934('0xe')]||![];this['openchannelPause']=_0x31e1f6[_0xb934('0xf')]||![];this[_0xb934('0x10')]=_0xb934('0x11');this[_0xb934('0x12')]=0x0;this['chatCapacity']=_0x31e1f6[_0xb934('0x13')]||0x0;this[_0xb934('0x14')]=0x0;this[_0xb934('0x15')]=_0xb934('0x11');this['mailStatusTime']=0x0;this[_0xb934('0x16')]=_0x31e1f6[_0xb934('0x16')]||0x0;this[_0xb934('0x17')]=0x0;this[_0xb934('0x18')]=_0xb934('0x11');this[_0xb934('0x19')]=0x0;this['faxCapacity']=_0x31e1f6[_0xb934('0x1a')]||0x0;this[_0xb934('0x1b')]=0x0;this[_0xb934('0x1c')]=_0xb934('0x11');this[_0xb934('0x1d')]=0x0;this[_0xb934('0x1e')]=_0x31e1f6[_0xb934('0x1e')]||0x0;this[_0xb934('0x1f')]=0x0;this['whatsappStatus']=_0xb934('0x11');this[_0xb934('0x20')]=0x0;this[_0xb934('0x21')]=_0x31e1f6['whatsappCapacity']||0x0;this[_0xb934('0x22')]=0x0;this['openchannelStatus']='unknown';this[_0xb934('0x23')]=0x0;this[_0xb934('0x24')]=_0x31e1f6[_0xb934('0x24')]||0x0;this[_0xb934('0x25')]=0x0;this[_0xb934('0x26')]=![];this[_0xb934('0x27')]=undefined;this[_0xb934('0x2')]='';this[_0xb934('0x28')]();}Agent[_0xb934('0x29')][_0xb934('0x2a')]=function(_0x8b21f6){if(this[_0x8b21f6+_0xb934('0x2b')]>0x0){if(this[_0x8b21f6+_0xb934('0x2c')]>0x0&&this[_0x8b21f6+_0xb934('0x2b')]>=this[_0x8b21f6+_0xb934('0x2c')]){return _0xb934('0x2d');}else{return'working';}}else{return _0xb934('0x2e');}};Agent[_0xb934('0x29')][_0xb934('0x28')]=function(){var _0x3a8ed3=[_0xb934('0x2f'),_0xb934('0x30'),_0xb934('0x31'),'fax','sms','whatsapp'];for(var _0x214c23=0x0;_0x214c23<_0x3a8ed3['length'];_0x214c23+=0x1){var _0x2fbabd=this[_0xb934('0x2a')](_0x3a8ed3[_0x214c23]);if(this[_0x3a8ed3[_0x214c23]+_0xb934('0x32')]!==_0x2fbabd){this[_0x3a8ed3[_0x214c23]+_0xb934('0x33')]=_['toNumber'](moment()[_0xb934('0x34')]('x'));}this[_0x3a8ed3[_0x214c23]+_0xb934('0x32')]=_0x2fbabd;}var _0x3f23a6={'id':this['id'],'name':this[_0xb934('0x8')],'online':this[_0xb934('0x9')],'voicePause':this[_0xb934('0xa')],'chatPause':this[_0xb934('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xb934('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0xb934('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xb934('0x12')],'chatCapacity':this[_0xb934('0x13')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xb934('0x15')],'mailStatusTime':this[_0xb934('0x35')],'mailCapacity':this[_0xb934('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xb934('0x18')],'faxStatusTime':this[_0xb934('0x19')],'faxCapacity':this[_0xb934('0x1a')],'faxCurrentCapacity':this[_0xb934('0x1b')],'smsStatus':this[_0xb934('0x1c')],'smsStatusTime':this[_0xb934('0x1d')],'smsCapacity':this[_0xb934('0x1e')],'smsCurrentCapacity':this[_0xb934('0x1f')],'whatsappStatus':this[_0xb934('0x36')],'whatsappStatusTime':this[_0xb934('0x20')],'whatsappCapacity':this[_0xb934('0x21')],'whatsappCurrentCapacity':this[_0xb934('0x22')],'openchannelStatus':this[_0xb934('0x37')],'openchannelStatusTime':this[_0xb934('0x23')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xb934('0x25')],'busy':this[_0xb934('0x26')],'busyQueue':this[_0xb934('0x27')]};var _0x56953c=md5(JSON[_0xb934('0x38')](_0x3f23a6));if(this[_0xb934('0x2')]!==_0x56953c){this[_0xb934('0x2')]=_0x56953c;io[_0xb934('0x39')](_0xb934('0x3a'),_0x3f23a6);}};module[_0xb934('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 56a1502..e509bcb 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 _0xc1c0=['paused','online','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0x5c3514,_0x18e281){var _0x56e259=function(_0x4914e3){while(--_0x4914e3){_0x5c3514['push'](_0x5c3514['shift']());}};_0x56e259(++_0x18e281);}(_0xc1c0,0x167));var _0x0c1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c1c('0x0'));var md5=require(_0x0c1c('0x1'));var util=require(_0x0c1c('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x0c1c('0x3')],{'host':_0x0c1c('0x4'),'port':0x18eb});var io=require(_0x0c1c('0x5'))(new Redis(config[_0x0c1c('0x3')]));function ChatQueue(_0x4d6fd3){this['id']=_0x4d6fd3['id']||0x0;this['name']=_0x4d6fd3[_0x0c1c('0x6')]||'';this[_0x0c1c('0x7')]=_0x4d6fd3['timeout']||0xa;this[_0x0c1c('0x8')]=_0x4d6fd3[_0x0c1c('0x8')]||_0x0c1c('0x9');this['Agents']=_0x4d6fd3[_0x0c1c('0xa')];this[_0x0c1c('0xb')]={};this['waiting']=0x0;this[_0x0c1c('0x1')]='';this[_0x0c1c('0xc')]();this[_0x0c1c('0xd')]();}ChatQueue['prototype'][_0x0c1c('0xc')]=function(){var _0x2e1022=this[_0x0c1c('0xb')][_0x0c1c('0xe')];this['mapAgentsId']=_[_0x0c1c('0xf')](this[_0x0c1c('0xa')],'id');this[_0x0c1c('0xb')][_0x0c1c('0xe')]=_0x2e1022;};ChatQueue[_0x0c1c('0x10')][_0x0c1c('0xd')]=function(){this[_0x0c1c('0x11')]=0x0;this[_0x0c1c('0x12')]=0x0;for(var _0x288f19=0x0;_0x288f19=0x0?this[_0x0c1c('0x15')]:0x0;var _0x5ceb7f={'id':this['id'],'available':this[_0x0c1c('0x15')],'loggedIn':this[_0x0c1c('0x11')],'name':this[_0x0c1c('0x6')],'paused':this[_0x0c1c('0x12')],'waiting':this[_0x0c1c('0x16')]};var _0xc21a48=md5(JSON[_0x0c1c('0x17')](_0x5ceb7f));if(this[_0x0c1c('0x1')]!==_0xc21a48){this[_0x0c1c('0x1')]=_0xc21a48;io['to'](util[_0x0c1c('0x18')](_0x0c1c('0x19'),_0x5ceb7f['name']))[_0x0c1c('0x1a')](_0x0c1c('0x1b'),_0x5ceb7f);}};module[_0x0c1c('0x1c')]=ChatQueue; \ No newline at end of file +var _0x6cda=['chatPause','paused','available','format','chat:queue:%s','chat_queue:save','exports','md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','length'];(function(_0x1435a1,_0xdfbd07){var _0x8699b1=function(_0x16e367){while(--_0x16e367){_0x1435a1['push'](_0x1435a1['shift']());}};_0x8699b1(++_0xdfbd07);}(_0x6cda,0x1b7));var _0xa6cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6cda[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0xa6cd('0x0'));var util=require(_0xa6cd('0x1'));var Redis=require('ioredis');var config=require(_0xa6cd('0x2'));config['redis']=_[_0xa6cd('0x3')](config[_0xa6cd('0x4')],{'host':_0xa6cd('0x5'),'port':0x18eb});var io=require(_0xa6cd('0x6'))(new Redis(config[_0xa6cd('0x4')]));function ChatQueue(_0x42b0ac){this['id']=_0x42b0ac['id']||0x0;this['name']=_0x42b0ac[_0xa6cd('0x7')]||'';this[_0xa6cd('0x8')]=_0x42b0ac[_0xa6cd('0x8')]||0xa;this[_0xa6cd('0x9')]=_0x42b0ac['strategy']||_0xa6cd('0xa');this[_0xa6cd('0xb')]=_0x42b0ac['Agents'];this[_0xa6cd('0xc')]={};this[_0xa6cd('0xd')]=0x0;this[_0xa6cd('0x0')]='';this['updateRouting']();this[_0xa6cd('0xe')]();}ChatQueue[_0xa6cd('0xf')][_0xa6cd('0x10')]=function(){var _0x34a3fd=this[_0xa6cd('0xc')][_0xa6cd('0x11')];this['mapAgentsId']=_['map'](this[_0xa6cd('0xb')],'id');this[_0xa6cd('0xc')][_0xa6cd('0x11')]=_0x34a3fd;};ChatQueue[_0xa6cd('0xf')]['updateRealtime']=function(){this[_0xa6cd('0x12')]=0x0;this['paused']=0x0;for(var _0x312e68=0x0;_0x312e68=0x0?this['available']:0x0;var _0x140449={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa6cd('0x12')],'name':this[_0xa6cd('0x7')],'paused':this[_0xa6cd('0x15')],'waiting':this[_0xa6cd('0xd')]};var _0x56e4d3=md5(JSON['stringify'](_0x140449));if(this[_0xa6cd('0x0')]!==_0x56e4d3){this[_0xa6cd('0x0')]=_0x56e4d3;io['to'](util[_0xa6cd('0x17')](_0xa6cd('0x18'),_0x140449[_0xa6cd('0x7')]))['emit'](_0xa6cd('0x19'),_0x140449);}};module[_0xa6cd('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 0ef8f73..8ccd172 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 _0xd154=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','faxPause','available','waiting','stringify','format','fax:queue:%s','emit','exports','lodash','md5','util','ioredis'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xd154,0x10a));var _0x4d15=function(_0x1a5f3c,_0x3c699f){_0x1a5f3c=_0x1a5f3c-0x0;var _0x27dbaa=_0xd154[_0x1a5f3c];return _0x27dbaa;};'use strict';var _=require(_0x4d15('0x0'));var md5=require(_0x4d15('0x1'));var util=require(_0x4d15('0x2'));var Redis=require(_0x4d15('0x3'));var config=require('../../../config/environment');config[_0x4d15('0x4')]=_['defaults'](config[_0x4d15('0x4')],{'host':_0x4d15('0x5'),'port':0x18eb});var io=require(_0x4d15('0x6'))(new Redis(config[_0x4d15('0x4')]));function FaxQueue(_0x3d009c){this['id']=_0x3d009c['id']||0x0;this[_0x4d15('0x7')]=_0x3d009c[_0x4d15('0x7')]||'';this[_0x4d15('0x8')]=_0x3d009c['timeout']||0xa;this[_0x4d15('0x9')]=_0x3d009c[_0x4d15('0x9')]||_0x4d15('0xa');this[_0x4d15('0xb')]=_0x3d009c[_0x4d15('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x4d15('0x1')]='';this[_0x4d15('0xc')]();this[_0x4d15('0xd')]();}FaxQueue[_0x4d15('0xe')][_0x4d15('0xc')]=function(){var _0x19b407=this[_0x4d15('0xf')][_0x4d15('0x10')];this[_0x4d15('0xf')]=_[_0x4d15('0x11')](this[_0x4d15('0xb')],'id');this[_0x4d15('0xf')][_0x4d15('0x10')]=_0x19b407;};FaxQueue['prototype'][_0x4d15('0xd')]=function(){this['loggedIn']=0x0;this[_0x4d15('0x12')]=0x0;for(var _0x32ada9=0x0;_0x32ada9=0x0?this[_0x4d15('0x17')]:0x0;var _0x23a428={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4d15('0x15')],'name':this[_0x4d15('0x7')],'paused':this[_0x4d15('0x12')],'waiting':this[_0x4d15('0x18')]};var _0x1789fc=md5(JSON[_0x4d15('0x19')](_0x23a428));if(this[_0x4d15('0x1')]!==_0x1789fc){this[_0x4d15('0x1')]=_0x1789fc;io['to'](util[_0x4d15('0x1a')](_0x4d15('0x1b'),_0x23a428['name']))[_0x4d15('0x1c')]('fax_queue:save',_0x23a428);}};module[_0x4d15('0x1d')]=FaxQueue; \ No newline at end of file +var _0x5e71=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','available','stringify','format','emit','fax_queue:save','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter'];(function(_0x317f85,_0x267263){var _0x594b2c=function(_0x1bfe12){while(--_0x1bfe12){_0x317f85['push'](_0x317f85['shift']());}};_0x594b2c(++_0x267263);}(_0x5e71,0x1c5));var _0x15e7=function(_0x460b5c,_0x4eb7e8){_0x460b5c=_0x460b5c-0x0;var _0x6fe598=_0x5e71[_0x460b5c];return _0x6fe598;};'use strict';var _=require(_0x15e7('0x0'));var md5=require(_0x15e7('0x1'));var util=require('util');var Redis=require(_0x15e7('0x2'));var config=require('../../../config/environment');config[_0x15e7('0x3')]=_['defaults'](config['redis'],{'host':_0x15e7('0x4'),'port':0x18eb});var io=require(_0x15e7('0x5'))(new Redis(config[_0x15e7('0x3')]));function FaxQueue(_0x28658a){this['id']=_0x28658a['id']||0x0;this[_0x15e7('0x6')]=_0x28658a[_0x15e7('0x6')]||'';this[_0x15e7('0x7')]=_0x28658a[_0x15e7('0x7')]||0xa;this[_0x15e7('0x8')]=_0x28658a[_0x15e7('0x8')]||_0x15e7('0x9');this[_0x15e7('0xa')]=_0x28658a[_0x15e7('0xa')];this[_0x15e7('0xb')]={};this[_0x15e7('0xc')]=0x0;this[_0x15e7('0x1')]='';this[_0x15e7('0xd')]();this[_0x15e7('0xe')]();}FaxQueue[_0x15e7('0xf')][_0x15e7('0xd')]=function(){var _0x307769=this[_0x15e7('0xb')][_0x15e7('0x10')];this[_0x15e7('0xb')]=_[_0x15e7('0x11')](this[_0x15e7('0xa')],'id');this['mapAgentsId'][_0x15e7('0x10')]=_0x307769;};FaxQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x15e7('0x12')]=0x0;for(var _0x335265=0x0;_0x335265=0x0?this[_0x15e7('0x15')]:0x0;var _0x33d340={'id':this['id'],'available':this[_0x15e7('0x15')],'loggedIn':this[_0x15e7('0x14')],'name':this['name'],'paused':this[_0x15e7('0x12')],'waiting':this[_0x15e7('0xc')]};var _0x12eb60=md5(JSON[_0x15e7('0x16')](_0x33d340));if(this['md5']!==_0x12eb60){this[_0x15e7('0x1')]=_0x12eb60;io['to'](util[_0x15e7('0x17')]('fax:queue:%s',_0x33d340['name']))[_0x15e7('0x18')](_0x15e7('0x19'),_0x33d340);}};module[_0x15e7('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 75f0e23..127ffbc 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 _0x8fb4=['Intervals','exports','name'];(function(_0x3064a3,_0x20e71a){var _0x4319b6=function(_0x2e5240){while(--_0x2e5240){_0x3064a3['push'](_0x3064a3['shift']());}};_0x4319b6(++_0x20e71a);}(_0x8fb4,0x128));var _0x48fb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fb4[_0x19e35c];return _0x3e1fe8;};'use strict';function Interval(_0x2b2924){this['id']=_0x2b2924['id']||0x0;this['name']=_0x2b2924[_0x48fb('0x0')]||'';this[_0x48fb('0x1')]=_0x2b2924['Intervals']||{};}module[_0x48fb('0x2')]=Interval; \ No newline at end of file +var _0xa53d=['name','Intervals','exports'];(function(_0x7d53b0,_0x48ada){var _0x2d3c5d=function(_0x53e4fa){while(--_0x53e4fa){_0x7d53b0['push'](_0x7d53b0['shift']());}};_0x2d3c5d(++_0x48ada);}(_0xa53d,0x165));var _0xda53=function(_0x34f7e3,_0x44e8b1){_0x34f7e3=_0x34f7e3-0x0;var _0x132cd0=_0xa53d[_0x34f7e3];return _0x132cd0;};'use strict';function Interval(_0x5ae28b){this['id']=_0x5ae28b['id']||0x0;this['name']=_0x5ae28b[_0xda53('0x0')]||'';this[_0xda53('0x1')]=_0x5ae28b['Intervals']||{};}module[_0xda53('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 eb82102..931ec70 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 _0xa8cb=['updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','length','online','loggedIn','mailPause','paused','available','waiting','md5','format','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x4a8a49,_0x5b6583){var _0x2a4955=function(_0x3c0b1b){while(--_0x3c0b1b){_0x4a8a49['push'](_0x4a8a49['shift']());}};_0x2a4955(++_0x5b6583);}(_0xa8cb,0x17b));var _0xba8c=function(_0x5c5f2f,_0x4325f3){_0x5c5f2f=_0x5c5f2f-0x0;var _0x4ecef=_0xa8cb[_0x5c5f2f];return _0x4ecef;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xba8c('0x0'));var Redis=require(_0xba8c('0x1'));var config=require(_0xba8c('0x2'));config['redis']=_[_0xba8c('0x3')](config[_0xba8c('0x4')],{'host':_0xba8c('0x5'),'port':0x18eb});var io=require(_0xba8c('0x6'))(new Redis(config[_0xba8c('0x4')]));function MailQueue(_0x39848a){this['id']=_0x39848a['id']||0x0;this[_0xba8c('0x7')]=_0x39848a['name']||'';this['timeout']=_0x39848a[_0xba8c('0x8')]||0xa;this['strategy']=_0x39848a[_0xba8c('0x9')]||'beepall';this['Agents']=_0x39848a[_0xba8c('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0xba8c('0xb')]();this[_0xba8c('0xc')]();}MailQueue[_0xba8c('0xd')][_0xba8c('0xb')]=function(){var _0x3332a0=this['mapAgentsId'][_0xba8c('0xe')];this[_0xba8c('0xf')]=_[_0xba8c('0x10')](this[_0xba8c('0xa')],'id');this[_0xba8c('0xf')]['_rr']=_0x3332a0;};MailQueue['prototype'][_0xba8c('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x267773=0x0;_0x267773=0x0?this['available']:0x0;var _0x22b0e2={'id':this['id'],'available':this['available'],'loggedIn':this[_0xba8c('0x13')],'name':this[_0xba8c('0x7')],'paused':this['paused'],'waiting':this[_0xba8c('0x17')]};var _0x20faeb=md5(JSON['stringify'](_0x22b0e2));if(this[_0xba8c('0x18')]!==_0x20faeb){this[_0xba8c('0x18')]=_0x20faeb;io['to'](util[_0xba8c('0x19')](_0xba8c('0x1a'),_0x22b0e2['name']))[_0xba8c('0x1b')](_0xba8c('0x1c'),_0x22b0e2);}};module[_0xba8c('0x1d')]=MailQueue; \ No newline at end of file +var _0xe584=['mailPause','available','mail:queue:%s','emit','exports','lodash','md5','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xe584,0x19d));var _0x4e58=function(_0x1ac002,_0x1f8b3d){_0x1ac002=_0x1ac002-0x0;var _0x5118d5=_0xe584[_0x1ac002];return _0x5118d5;};'use strict';var _=require(_0x4e58('0x0'));var md5=require(_0x4e58('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x4e58('0x2'),'port':0x18eb});var io=require(_0x4e58('0x3'))(new Redis(config[_0x4e58('0x4')]));function MailQueue(_0x4cf2be){this['id']=_0x4cf2be['id']||0x0;this[_0x4e58('0x5')]=_0x4cf2be['name']||'';this[_0x4e58('0x6')]=_0x4cf2be['timeout']||0xa;this[_0x4e58('0x7')]=_0x4cf2be['strategy']||_0x4e58('0x8');this[_0x4e58('0x9')]=_0x4cf2be[_0x4e58('0x9')];this[_0x4e58('0xa')]={};this[_0x4e58('0xb')]=0x0;this[_0x4e58('0x1')]='';this[_0x4e58('0xc')]();this[_0x4e58('0xd')]();}MailQueue[_0x4e58('0xe')][_0x4e58('0xc')]=function(){var _0x558c06=this[_0x4e58('0xa')][_0x4e58('0xf')];this['mapAgentsId']=_['map'](this[_0x4e58('0x9')],'id');this['mapAgentsId'][_0x4e58('0xf')]=_0x558c06;};MailQueue[_0x4e58('0xe')]['updateRealtime']=function(){this[_0x4e58('0x10')]=0x0;this[_0x4e58('0x11')]=0x0;for(var _0x3872e6=0x0;_0x3872e6=0x0?this[_0x4e58('0x14')]:0x0;var _0x1606a3={'id':this['id'],'available':this[_0x4e58('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x4e58('0x5')],'paused':this[_0x4e58('0x11')],'waiting':this[_0x4e58('0xb')]};var _0xa55ac7=md5(JSON['stringify'](_0x1606a3));if(this[_0x4e58('0x1')]!==_0xa55ac7){this[_0x4e58('0x1')]=_0xa55ac7;io['to'](util['format'](_0x4e58('0x15'),_0x1606a3[_0x4e58('0x5')]))[_0x4e58('0x16')]('mail_queue:save',_0x1606a3);}};module[_0x4e58('0x17')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e56b09b..638a588 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x36bab3,_0x19ce33){var _0x2d3989=function(_0x2a4f60){while(--_0x2a4f60){_0x36bab3['push'](_0x36bab3['shift']());}};_0x2d3989(++_0x19ce33);}(_0xadb5,0xad));var _0x5adb=function(_0x5920ee,_0x1af0fb){_0x5920ee=_0x5920ee-0x0;var _0x40ec96=_0xadb5[_0x5920ee];return _0x40ec96;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x22dd2b,_0x3b116a){var _0x2c816c=function(_0x4f2765){while(--_0x4f2765){_0x22dd2b['push'](_0x22dd2b['shift']());}};_0x2c816c(++_0x3b116a);}(_0xadb5,0xad));var _0x5adb=function(_0x16372c,_0x2cb15b){_0x16372c=_0x16372c-0x0;var _0x5a7217=_0xadb5[_0x16372c];return _0x5a7217;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e54fd70..3a90125 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 _0x073e=['map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr'];(function(_0x427e9b,_0x71ca84){var _0x36af37=function(_0x5aadd4){while(--_0x5aadd4){_0x427e9b['push'](_0x427e9b['shift']());}};_0x36af37(++_0x71ca84);}(_0x073e,0x181));var _0xe073=function(_0x2134e8,_0x2b3c8d){_0x2134e8=_0x2134e8-0x0;var _0x42451d=_0x073e[_0x2134e8];return _0x42451d;};'use strict';var _=require(_0xe073('0x0'));var md5=require(_0xe073('0x1'));var util=require(_0xe073('0x2'));var Redis=require(_0xe073('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xe073('0x4')],{'host':_0xe073('0x5'),'port':0x18eb});var io=require(_0xe073('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5b9324){this['id']=_0x5b9324['id']||0x0;this['name']=_0x5b9324[_0xe073('0x7')]||'';this[_0xe073('0x8')]=_0x5b9324[_0xe073('0x8')]||0xa;this[_0xe073('0x9')]=_0x5b9324[_0xe073('0x9')]||_0xe073('0xa');this['Agents']=_0x5b9324[_0xe073('0xb')];this[_0xe073('0xc')]={};this[_0xe073('0xd')]=0x0;this[_0xe073('0x1')]='';this['updateRouting']();this[_0xe073('0xe')]();}SmsQueue[_0xe073('0xf')][_0xe073('0x10')]=function(){var _0x1f5a22=this[_0xe073('0xc')][_0xe073('0x11')];this['mapAgentsId']=_[_0xe073('0x12')](this['Agents'],'id');this[_0xe073('0xc')]['_rr']=_0x1f5a22;};SmsQueue[_0xe073('0xf')]['updateRealtime']=function(){this[_0xe073('0x13')]=0x0;this[_0xe073('0x14')]=0x0;for(var _0x47828d=0x0;_0x47828d=0x0?this[_0xe073('0x18')]:0x0;var _0x16eaa6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe073('0x13')],'name':this[_0xe073('0x7')],'paused':this[_0xe073('0x14')],'waiting':this['waiting']};var _0x21c02e=md5(JSON[_0xe073('0x19')](_0x16eaa6));if(this[_0xe073('0x1')]!==_0x21c02e){this[_0xe073('0x1')]=_0x21c02e;io['to'](util[_0xe073('0x1a')](_0xe073('0x1b'),_0x16eaa6[_0xe073('0x7')]))[_0xe073('0x1c')](_0xe073('0x1d'),_0x16eaa6);}};module[_0xe073('0x1e')]=SmsQueue; \ No newline at end of file +var _0x702d=['name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','smsPause','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x702d,0x147));var _0xd702=function(_0xea2367,_0x54a413){_0xea2367=_0xea2367-0x0;var _0x4b397c=_0x702d[_0xea2367];return _0x4b397c;};'use strict';var _=require(_0xd702('0x0'));var md5=require(_0xd702('0x1'));var util=require(_0xd702('0x2'));var Redis=require(_0xd702('0x3'));var config=require(_0xd702('0x4'));config['redis']=_[_0xd702('0x5')](config[_0xd702('0x6')],{'host':_0xd702('0x7'),'port':0x18eb});var io=require(_0xd702('0x8'))(new Redis(config['redis']));function SmsQueue(_0x432e01){this['id']=_0x432e01['id']||0x0;this['name']=_0x432e01[_0xd702('0x9')]||'';this[_0xd702('0xa')]=_0x432e01[_0xd702('0xa')]||0xa;this['strategy']=_0x432e01[_0xd702('0xb')]||'beepall';this[_0xd702('0xc')]=_0x432e01[_0xd702('0xc')];this[_0xd702('0xd')]={};this[_0xd702('0xe')]=0x0;this[_0xd702('0x1')]='';this[_0xd702('0xf')]();this[_0xd702('0x10')]();}SmsQueue[_0xd702('0x11')][_0xd702('0xf')]=function(){var _0x15a632=this['mapAgentsId']['_rr'];this[_0xd702('0xd')]=_[_0xd702('0x12')](this[_0xd702('0xc')],'id');this['mapAgentsId'][_0xd702('0x13')]=_0x15a632;};SmsQueue[_0xd702('0x11')][_0xd702('0x10')]=function(){this[_0xd702('0x14')]=0x0;this[_0xd702('0x15')]=0x0;for(var _0x181ff2=0x0;_0x181ff2=0x0?this['available']:0x0;var _0x2205de={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd702('0x14')],'name':this[_0xd702('0x9')],'paused':this[_0xd702('0x15')],'waiting':this[_0xd702('0xe')]};var _0x4cf326=md5(JSON[_0xd702('0x19')](_0x2205de));if(this[_0xd702('0x1')]!==_0x4cf326){this['md5']=_0x4cf326;io['to'](util['format']('sms:queue:%s',_0x2205de[_0xd702('0x9')]))[_0xd702('0x1a')]('sms_queue:save',_0x2205de);}};module[_0xd702('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 51cee2e..b7c1e28 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 _0x2cf3=['md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','length','loggedIn','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','exports'];(function(_0x5e6b1a,_0x5a65bf){var _0x5e90bb=function(_0x235626){while(--_0x235626){_0x5e6b1a['push'](_0x5e6b1a['shift']());}};_0x5e90bb(++_0x5a65bf);}(_0x2cf3,0x138));var _0x32cf=function(_0x2dcc2d,_0xbec8e7){_0x2dcc2d=_0x2dcc2d-0x0;var _0x225297=_0x2cf3[_0x2dcc2d];return _0x225297;};'use strict';var _=require('lodash');var md5=require(_0x32cf('0x0'));var util=require(_0x32cf('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x32cf('0x2')]=_['defaults'](config[_0x32cf('0x2')],{'host':_0x32cf('0x3'),'port':0x18eb});var io=require(_0x32cf('0x4'))(new Redis(config[_0x32cf('0x2')]));function WhatsappQueue(_0x3fc484){this['id']=_0x3fc484['id']||0x0;this[_0x32cf('0x5')]=_0x3fc484['name']||'';this[_0x32cf('0x6')]=_0x3fc484[_0x32cf('0x6')]||0xa;this[_0x32cf('0x7')]=_0x3fc484['strategy']||_0x32cf('0x8');this[_0x32cf('0x9')]=_0x3fc484['Agents'];this['mapAgentsId']={};this[_0x32cf('0xa')]=0x0;this[_0x32cf('0x0')]='';this[_0x32cf('0xb')]();this[_0x32cf('0xc')]();}WhatsappQueue[_0x32cf('0xd')][_0x32cf('0xb')]=function(){var _0x27a6a8=this[_0x32cf('0xe')][_0x32cf('0xf')];this[_0x32cf('0xe')]=_[_0x32cf('0x10')](this[_0x32cf('0x9')],'id');this[_0x32cf('0xe')][_0x32cf('0xf')]=_0x27a6a8;};WhatsappQueue[_0x32cf('0xd')][_0x32cf('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5ac664=0x0;_0x5ac664=0x0?this[_0x32cf('0x15')]:0x0;var _0x213739={'id':this['id'],'available':this[_0x32cf('0x15')],'loggedIn':this[_0x32cf('0x12')],'name':this['name'],'paused':this[_0x32cf('0x14')],'waiting':this['waiting']};var _0x4798f7=md5(JSON[_0x32cf('0x16')](_0x213739));if(this[_0x32cf('0x0')]!==_0x4798f7){this[_0x32cf('0x0')]=_0x4798f7;io['to'](util[_0x32cf('0x17')](_0x32cf('0x18'),_0x213739[_0x32cf('0x5')]))['emit']('whatsapp_queue:save',_0x213739);}};module[_0x32cf('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x5ae6=['online','whatsappPause','available','paused','stringify','format','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length'];(function(_0x9aba7f,_0x4cc873){var _0x5d2ae1=function(_0x4f69a0){while(--_0x4f69a0){_0x9aba7f['push'](_0x9aba7f['shift']());}};_0x5d2ae1(++_0x4cc873);}(_0x5ae6,0x1d9));var _0x65ae=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x5ae6[_0x2e914];return _0x936e45;};'use strict';var _=require(_0x65ae('0x0'));var md5=require(_0x65ae('0x1'));var util=require(_0x65ae('0x2'));var Redis=require(_0x65ae('0x3'));var config=require(_0x65ae('0x4'));config[_0x65ae('0x5')]=_[_0x65ae('0x6')](config['redis'],{'host':_0x65ae('0x7'),'port':0x18eb});var io=require(_0x65ae('0x8'))(new Redis(config[_0x65ae('0x5')]));function WhatsappQueue(_0x521a01){this['id']=_0x521a01['id']||0x0;this[_0x65ae('0x9')]=_0x521a01[_0x65ae('0x9')]||'';this['timeout']=_0x521a01[_0x65ae('0xa')]||0xa;this[_0x65ae('0xb')]=_0x521a01[_0x65ae('0xb')]||_0x65ae('0xc');this[_0x65ae('0xd')]=_0x521a01[_0x65ae('0xd')];this[_0x65ae('0xe')]={};this[_0x65ae('0xf')]=0x0;this[_0x65ae('0x1')]='';this[_0x65ae('0x10')]();this['updateRealtime']();}WhatsappQueue[_0x65ae('0x11')]['updateRouting']=function(){var _0x1e9c0a=this[_0x65ae('0xe')][_0x65ae('0x12')];this['mapAgentsId']=_[_0x65ae('0x13')](this[_0x65ae('0xd')],'id');this[_0x65ae('0xe')][_0x65ae('0x12')]=_0x1e9c0a;};WhatsappQueue['prototype'][_0x65ae('0x14')]=function(){this[_0x65ae('0x15')]=0x0;this['paused']=0x0;for(var _0x20972b=0x0;_0x20972b=0x0?this[_0x65ae('0x19')]:0x0;var _0x1f7990={'id':this['id'],'available':this['available'],'loggedIn':this[_0x65ae('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x65ae('0xf')]};var _0xb8421f=md5(JSON[_0x65ae('0x1b')](_0x1f7990));if(this[_0x65ae('0x1')]!==_0xb8421f){this[_0x65ae('0x1')]=_0xb8421f;io['to'](util[_0x65ae('0x1c')]('whatsapp:queue:%s',_0x1f7990['name']))['emit'](_0x65ae('0x1d'),_0x1f7990);}};module[_0x65ae('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 30973e6..b84a123 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3664ce,_0x4b9abe){var _0x5383c0=function(_0x5d539a){while(--_0x5d539a){_0x3664ce['push'](_0x3664ce['shift']());}};_0x5383c0(++_0x4b9abe);}(_0xb10b,0x12a));var _0xbb10=function(_0x37b1d8,_0x614312){_0x37b1d8=_0x37b1d8-0x0;var _0x3739e7=_0xb10b[_0x37b1d8];return _0x3739e7;};'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 2506ee6..e5dd20d 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 _0x4b45=['addTagsToChatInteraction','../client','update','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x34226f,_0x1cd113){var _0x1bf7dc=function(_0x145ecd){while(--_0x145ecd){_0x34226f['push'](_0x34226f['shift']());}};_0x1bf7dc(++_0x1cd113);}(_0x4b45,0x190));var _0x54b4=function(_0x593e5f,_0x5a769e){_0x593e5f=_0x593e5f-0x0;var _0x2674e1=_0x4b45[_0x593e5f];return _0x2674e1;};'use strict';var client=require(_0x54b4('0x0'));exports[_0x54b4('0x1')]=function(_0x38b9c6,_0x49ca10){return client['Request']('UpdateChatInteraction',{'body':_0x49ca10,'options':{'where':{'id':_0x38b9c6}},'log':_0x54b4('0x2')});};exports[_0x54b4('0x3')]=function(_0x2720c5,_0x340ab2){return client[_0x54b4('0x4')](_0x54b4('0x5'),{'body':_0x340ab2,'options':{'where':{'id':_0x2720c5}},'log':_0x54b4('0x6')});}; \ No newline at end of file +var _0x7b42=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0xd04a57,_0x58e16a){var _0x479d6c=function(_0x413183){while(--_0x413183){_0xd04a57['push'](_0xd04a57['shift']());}};_0x479d6c(++_0x58e16a);}(_0x7b42,0xf6));var _0x27b4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7b42[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x27b4('0x0'));exports['update']=function(_0x4a4ef5,_0x232997){return client[_0x27b4('0x1')](_0x27b4('0x2'),{'body':_0x232997,'options':{'where':{'id':_0x4a4ef5}},'log':_0x27b4('0x3')});};exports[_0x27b4('0x4')]=function(_0x25d2b6,_0x57af70){return client[_0x27b4('0x1')](_0x27b4('0x5'),{'body':_0x57af70,'options':{'where':{'id':_0x25d2b6}},'log':_0x27b4('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index f078cab..86b5114 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 _0x2863=['createChatMessage','../client'];(function(_0xe25de7,_0x42e03f){var _0x19e45b=function(_0x43769b){while(--_0x43769b){_0xe25de7['push'](_0xe25de7['shift']());}};_0x19e45b(++_0x42e03f);}(_0x2863,0x1df));var _0x3286=function(_0x4bf4cf,_0x3ff119){_0x4bf4cf=_0x4bf4cf-0x0;var _0x278726=_0x2863[_0x4bf4cf];return _0x278726;};'use strict';var client=require(_0x3286('0x0'));exports['create']=function(_0x529a25){return client['Request']('CreateChatMessage',{'body':_0x529a25,'log':_0x3286('0x1')});}; \ No newline at end of file +var _0xe5c5=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x1a766a,_0x5d9894){var _0x2b54a9=function(_0x4ed1b2){while(--_0x4ed1b2){_0x1a766a['push'](_0x1a766a['shift']());}};_0x2b54a9(++_0x5d9894);}(_0xe5c5,0x1c6));var _0x5e5c=function(_0x3e309c,_0xe9212e){_0x3e309c=_0x3e309c-0x0;var _0x264991=_0xe5c5[_0x3e309c];return _0x264991;};'use strict';var client=require(_0x5e5c('0x0'));exports[_0x5e5c('0x1')]=function(_0x3ebb65){return client[_0x5e5c('0x2')](_0x5e5c('0x3'),{'body':_0x3ebb65,'log':_0x5e5c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 7e0d16d..c1c066a 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 _0x078c=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','timeout','strategy'];(function(_0x2875ee,_0x241b96){var _0x91c01e=function(_0x8b46ad){while(--_0x8b46ad){_0x2875ee['push'](_0x2875ee['shift']());}};_0x91c01e(++_0x241b96);}(_0x078c,0x19f));var _0xc078=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x078c[_0x2a6d45];return _0x295253;};'use strict';var client=require(_0xc078('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xc078('0x1')](_0xc078('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc078('0x3'),_0xc078('0x4')],'include':[{'model':_0xc078('0x5'),'as':_0xc078('0x6'),'attributes':['id','name',_0xc078('0x7'),_0xc078('0x8')]}]},'log':_0xc078('0x9')});};}; \ No newline at end of file +var _0x0bde=['GetChatQueue','name','timeout','strategy','User','online','chatPause','getChatQueues'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports[_0xe0bd('0x0')]=function(){return function(){return client['Request'](_0xe0bd('0x1'),{'options':{'raw':![],'attributes':['id',_0xe0bd('0x2'),_0xe0bd('0x3'),_0xe0bd('0x4')],'include':[{'model':_0xe0bd('0x5'),'as':'Agents','attributes':['id',_0xe0bd('0x2'),_0xe0bd('0x6'),_0xe0bd('0x7')]}]},'log':_0xe0bd('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 0cd6f1a..078d49f 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 _0xe13e=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport','update'];(function(_0x3de30d,_0x48bc95){var _0xd020d3=function(_0x1c3dff){while(--_0x1c3dff){_0x3de30d['push'](_0x3de30d['shift']());}};_0xd020d3(++_0x48bc95);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports['create']=function(_0x4df8d5){return client[_0xee13('0x0')](_0xee13('0x1'),{'body':_0x4df8d5,'log':_0xee13('0x1')});};exports[_0xee13('0x2')]=function(_0x2513f3,_0x7a275f){return client[_0xee13('0x0')](_0xee13('0x3'),{'body':_0x7a275f,'options':{'where':{'uniqueid':_0x2513f3},'order':[['id',_0xee13('0x4')]],'limit':0x1},'log':_0xee13('0x3')});}; \ No newline at end of file +var _0x847d=['create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0x847d,0x14a));var _0xd847=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x847d[_0x383356];return _0x32ee5a;};'use strict';var client=require('../client');exports[_0xd847('0x0')]=function(_0x3465bf){return client[_0xd847('0x1')]('CreateChatQueueReport',{'body':_0x3465bf,'log':_0xd847('0x2')});};exports['update']=function(_0x116caa,_0x18051f){return client['Request'](_0xd847('0x3'),{'body':_0x18051f,'options':{'where':{'uniqueid':_0x116caa},'order':[['id',_0xd847('0x4')]],'limit':0x1},'log':_0xd847('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index aef1549..c5ad51e 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(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x7a54,0x106));var _0x47a5=function(_0x4498fc,_0xc16c0){_0x4498fc=_0x4498fc-0x0;var _0x1a5d10=_0x7a54[_0x4498fc];return _0x1a5d10;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3b2d9b,_0x374369){var _0x4bf259=function(_0x46a6a4){while(--_0x46a6a4){_0x3b2d9b['push'](_0x3b2d9b['shift']());}};_0x4bf259(++_0x374369);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f072c72..4bf1d3c 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 _0x03c0=['Request','createFaxMessage','../client','create'];(function(_0x53a911,_0x14b553){var _0x1e7bd7=function(_0x183dde){while(--_0x183dde){_0x53a911['push'](_0x53a911['shift']());}};_0x1e7bd7(++_0x14b553);}(_0x03c0,0xb6));var _0x003c=function(_0x171b64,_0x1dc8e2){_0x171b64=_0x171b64-0x0;var _0x359757=_0x03c0[_0x171b64];return _0x359757;};'use strict';var client=require(_0x003c('0x0'));exports[_0x003c('0x1')]=function(_0x26e216){return client[_0x003c('0x2')]('CreateFaxMessage',{'body':_0x26e216,'log':_0x003c('0x3')});}; \ No newline at end of file +var _0x4b74=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x368493,_0x44b08d){var _0x62871a=function(_0x5d29c3){while(--_0x5d29c3){_0x368493['push'](_0x368493['shift']());}};_0x62871a(++_0x44b08d);}(_0x4b74,0x1b9));var _0x44b7=function(_0x484fc8,_0x3bcc09){_0x484fc8=_0x484fc8-0x0;var _0x2b0cbc=_0x4b74[_0x484fc8];return _0x2b0cbc;};'use strict';var client=require(_0x44b7('0x0'));exports['create']=function(_0x1bf8f7){return client[_0x44b7('0x1')](_0x44b7('0x2'),{'body':_0x1bf8f7,'log':_0x44b7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 3a83abf..c439892 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 _0xe6b3=['online','faxPause','../client','GetFaxQueue','timeout','strategy','Agents','name'];(function(_0x2e890b,_0x153090){var _0x17f0b9=function(_0x35c6e5){while(--_0x35c6e5){_0x2e890b['push'](_0x2e890b['shift']());}};_0x17f0b9(++_0x153090);}(_0xe6b3,0x14a));var _0x3e6b=function(_0x3dbb47,_0x464018){_0x3dbb47=_0x3dbb47-0x0;var _0x9d7882=_0xe6b3[_0x3dbb47];return _0x9d7882;};'use strict';var client=require(_0x3e6b('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x3e6b('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x3e6b('0x2'),_0x3e6b('0x3')],'include':[{'model':'User','as':_0x3e6b('0x4'),'attributes':['id',_0x3e6b('0x5'),_0x3e6b('0x6'),_0x3e6b('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xd8d1=['Request','GetFaxQueue','name','strategy','User','Agents','getFaxQueues'];(function(_0x477ce9,_0x11e497){var _0x505b02=function(_0x3443cd){while(--_0x3443cd){_0x477ce9['push'](_0x477ce9['shift']());}};_0x505b02(++_0x11e497);}(_0xd8d1,0x110));var _0x1d8d=function(_0x2c9277,_0x292885){_0x2c9277=_0x2c9277-0x0;var _0x16f4a7=_0xd8d1[_0x2c9277];return _0x16f4a7;};'use strict';var client=require('../client');exports[_0x1d8d('0x0')]=function(){return function(){return client[_0x1d8d('0x1')](_0x1d8d('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d8d('0x3'),'timeout',_0x1d8d('0x4')],'include':[{'model':_0x1d8d('0x5'),'as':_0x1d8d('0x6'),'attributes':['id',_0x1d8d('0x3'),'online','faxPause']}]},'log':_0x1d8d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 892e278..14d25dd 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 _0x8750=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x419859,_0x5771e8){var _0x18c6c2=function(_0x53dcf7){while(--_0x53dcf7){_0x419859['push'](_0x419859['shift']());}};_0x18c6c2(++_0x5771e8);}(_0x8750,0x110));var _0x0875=function(_0x3a2d9c,_0x255b45){_0x3a2d9c=_0x3a2d9c-0x0;var _0x2d81af=_0x8750[_0x3a2d9c];return _0x2d81af;};'use strict';var client=require(_0x0875('0x0'));exports[_0x0875('0x1')]=function(_0x55d41d){return client[_0x0875('0x2')](_0x0875('0x3'),{'body':_0x55d41d,'log':_0x0875('0x3')});};exports[_0x0875('0x4')]=function(_0x3e2e7b,_0x1febfe){return client[_0x0875('0x2')](_0x0875('0x5'),{'body':_0x1febfe,'options':{'where':{'uniqueid':_0x3e2e7b},'order':[['id',_0x0875('0x6')]],'limit':0x1},'log':_0x0875('0x5')});}; \ No newline at end of file +var _0x967e=['DESC','../client','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x967e,0x137));var _0xe967=function(_0x169063,_0x4eb09a){_0x169063=_0x169063-0x0;var _0x11207f=_0x967e[_0x169063];return _0x11207f;};'use strict';var client=require(_0xe967('0x0'));exports['create']=function(_0x3d7543){return client[_0xe967('0x1')]('CreateFaxQueueReport',{'body':_0x3d7543,'log':_0xe967('0x2')});};exports['update']=function(_0x44944a,_0x33c45b){return client['Request'](_0xe967('0x3'),{'body':_0x33c45b,'options':{'where':{'uniqueid':_0x44944a},'order':[['id',_0xe967('0x4')]],'limit':0x1},'log':_0xe967('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e920383..8b454b0 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 _0x94f7=['name','Interval','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0xa464fd,_0x100df5){var _0x2003df=function(_0x3dba9f){while(--_0x3dba9f){_0xa464fd['push'](_0xa464fd['shift']());}};_0x2003df(++_0x100df5);}(_0x94f7,0x19c));var _0x794f=function(_0x1b0509,_0x42d979){_0x1b0509=_0x1b0509-0x0;var _0x1c1eda=_0x94f7[_0x1b0509];return _0x1c1eda;};'use strict';var client=require(_0x794f('0x0'));exports[_0x794f('0x1')]=function(){return function(){return client[_0x794f('0x2')](_0x794f('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x794f('0x4')],'include':[{'model':_0x794f('0x5'),'as':_0x794f('0x6'),'attributes':['id',_0x794f('0x4'),_0x794f('0x7')]}]},'log':_0x794f('0x1')});};}; \ No newline at end of file +var _0x1871=['name','interval','../client','getIntervals','Request','GetInterval','Interval','Intervals'];(function(_0x56640a,_0x4aebb7){var _0x489560=function(_0x58c7a7){while(--_0x58c7a7){_0x56640a['push'](_0x56640a['shift']());}};_0x489560(++_0x4aebb7);}(_0x1871,0x122));var _0x1187=function(_0x2664d7,_0x574aa6){_0x2664d7=_0x2664d7-0x0;var _0x2c21c4=_0x1871[_0x2664d7];return _0x2c21c4;};'use strict';var client=require(_0x1187('0x0'));exports[_0x1187('0x1')]=function(){return function(){return client[_0x1187('0x2')](_0x1187('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x1187('0x4'),'as':_0x1187('0x5'),'attributes':['id',_0x1187('0x6'),_0x1187('0x7')]}]},'log':_0x1187('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index aa5f237..2293027 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 _0x0120=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x5429d6,_0x47122d){var _0x266b0c=function(_0x399f3a){while(--_0x399f3a){_0x5429d6['push'](_0x5429d6['shift']());}};_0x266b0c(++_0x47122d);}(_0x0120,0x6f));var _0x0012=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0120[_0x46aff0];return _0x9d78cf;};'use strict';var client=require(_0x0012('0x0'));exports[_0x0012('0x1')]=function(_0x3d23e7,_0xb8d57c){return client[_0x0012('0x2')](_0x0012('0x3'),{'body':_0xb8d57c,'options':{'where':{'id':_0x3d23e7}},'log':_0x0012('0x4')});};exports[_0x0012('0x5')]=function(_0x357f77,_0x302029){return client[_0x0012('0x2')](_0x0012('0x6'),{'body':_0x302029,'options':{'where':{'id':_0x357f77}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x8952=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request'];(function(_0x18ee22,_0x48f292){var _0x588db6=function(_0x133a58){while(--_0x133a58){_0x18ee22['push'](_0x18ee22['shift']());}};_0x588db6(++_0x48f292);}(_0x8952,0x17e));var _0x2895=function(_0x2b8fa7,_0x1fe56a){_0x2b8fa7=_0x2b8fa7-0x0;var _0x276b17=_0x8952[_0x2b8fa7];return _0x276b17;};'use strict';var client=require('../client');exports[_0x2895('0x0')]=function(_0x2c099b,_0x43e8d9){return client[_0x2895('0x1')](_0x2895('0x2'),{'body':_0x43e8d9,'options':{'where':{'id':_0x2c099b}},'log':'updateMailInteraction'});};exports[_0x2895('0x3')]=function(_0xb5afd9,_0x1f69f6){return client['Request'](_0x2895('0x4'),{'body':_0x1f69f6,'options':{'where':{'id':_0xb5afd9}},'log':_0x2895('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f2e6675..229add7 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 _0xe0af=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x1d9293,_0x553af4){var _0x43dbf9=function(_0x5ebdb7){while(--_0x5ebdb7){_0x1d9293['push'](_0x1d9293['shift']());}};_0x43dbf9(++_0x553af4);}(_0xe0af,0x1ce));var _0xfe0a=function(_0x1865d4,_0x569a81){_0x1865d4=_0x1865d4-0x0;var _0x1f0e1c=_0xe0af[_0x1865d4];return _0x1f0e1c;};'use strict';var client=require(_0xfe0a('0x0'));exports[_0xfe0a('0x1')]=function(_0x3dd2ba){return client[_0xfe0a('0x2')](_0xfe0a('0x3'),{'body':_0x3dd2ba,'log':_0xfe0a('0x4')});}; \ No newline at end of file +var _0xc5bc=['../client','create','Request','CreateMailMessage'];(function(_0x463bdd,_0x636250){var _0x24227b=function(_0xaf2b60){while(--_0xaf2b60){_0x463bdd['push'](_0x463bdd['shift']());}};_0x24227b(++_0x636250);}(_0xc5bc,0x17c));var _0xcc5b=function(_0x3aef70,_0x162a7a){_0x3aef70=_0x3aef70-0x0;var _0x24f558=_0xc5bc[_0x3aef70];return _0x24f558;};'use strict';var client=require(_0xcc5b('0x0'));exports[_0xcc5b('0x1')]=function(_0x4ef74b){return client[_0xcc5b('0x2')](_0xcc5b('0x3'),{'body':_0x4ef74b,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c89844a..4843b3a 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 _0x7eb7=['User','online','mailPause','../client','getMailQueues','GetMailQueue','name','strategy'];(function(_0x1d638a,_0x2c4d2b){var _0x59a099=function(_0x33aa18){while(--_0x33aa18){_0x1d638a['push'](_0x1d638a['shift']());}};_0x59a099(++_0x2c4d2b);}(_0x7eb7,0x1cb));var _0x77eb=function(_0x435eef,_0x6a0078){_0x435eef=_0x435eef-0x0;var _0x527f4b=_0x7eb7[_0x435eef];return _0x527f4b;};'use strict';var client=require(_0x77eb('0x0'));exports[_0x77eb('0x1')]=function(){return function(){return client['Request'](_0x77eb('0x2'),{'options':{'raw':![],'attributes':['id',_0x77eb('0x3'),'timeout',_0x77eb('0x4')],'include':[{'model':_0x77eb('0x5'),'as':'Agents','attributes':['id',_0x77eb('0x3'),_0x77eb('0x6'),_0x77eb('0x7')]}]},'log':_0x77eb('0x1')});};}; \ No newline at end of file +var _0xf790=['mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','User','name'];(function(_0x3cf7bc,_0x51aa64){var _0x18e5ae=function(_0x557bf4){while(--_0x557bf4){_0x3cf7bc['push'](_0x3cf7bc['shift']());}};_0x18e5ae(++_0x51aa64);}(_0xf790,0x81));var _0x0f79=function(_0x25ae8c,_0x37cb35){_0x25ae8c=_0x25ae8c-0x0;var _0x1cd3e1=_0xf790[_0x25ae8c];return _0x1cd3e1;};'use strict';var client=require(_0x0f79('0x0'));exports[_0x0f79('0x1')]=function(){return function(){return client[_0x0f79('0x2')](_0x0f79('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0f79('0x4'),'strategy'],'include':[{'model':_0x0f79('0x5'),'as':'Agents','attributes':['id',_0x0f79('0x6'),'online',_0x0f79('0x7')]}]},'log':_0x0f79('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index dc119d7..a044e05 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 _0xaf70=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0xc82d1a,_0x145c50){var _0x32fad2=function(_0x232731){while(--_0x232731){_0xc82d1a['push'](_0xc82d1a['shift']());}};_0x32fad2(++_0x145c50);}(_0xaf70,0x16d));var _0x0af7=function(_0x534138,_0x2c7c0a){_0x534138=_0x534138-0x0;var _0x29b2c1=_0xaf70[_0x534138];return _0x29b2c1;};'use strict';var client=require(_0x0af7('0x0'));exports[_0x0af7('0x1')]=function(_0x2e7679){return client[_0x0af7('0x2')](_0x0af7('0x3'),{'body':_0x2e7679,'log':_0x0af7('0x3')});};exports[_0x0af7('0x4')]=function(_0xe9f65c,_0x3ab8c7){return client[_0x0af7('0x2')](_0x0af7('0x5'),{'body':_0x3ab8c7,'options':{'where':{'uniqueid':_0xe9f65c},'order':[['id',_0x0af7('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x2f2a=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x37d9b1,_0x358b0d){var _0x580044=function(_0x23530f){while(--_0x23530f){_0x37d9b1['push'](_0x37d9b1['shift']());}};_0x580044(++_0x358b0d);}(_0x2f2a,0x1a0));var _0xa2f2=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x2f2a[_0x5a79e2];return _0x266c45;};'use strict';var client=require(_0xa2f2('0x0'));exports[_0xa2f2('0x1')]=function(_0x2e9eac){return client[_0xa2f2('0x2')](_0xa2f2('0x3'),{'body':_0x2e9eac,'log':'CreateMailQueueReport'});};exports[_0xa2f2('0x4')]=function(_0x57b8e2,_0x2f0da5){return client[_0xa2f2('0x2')](_0xa2f2('0x5'),{'body':_0x2f0da5,'options':{'where':{'uniqueid':_0x57b8e2},'order':[['id',_0xa2f2('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ac33a2b..e62b854 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 _0xafb7=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','update'];(function(_0x527733,_0x16051c){var _0x5400ba=function(_0x265d39){while(--_0x265d39){_0x527733['push'](_0x527733['shift']());}};_0x5400ba(++_0x16051c);}(_0xafb7,0xad));var _0x7afb=function(_0x3b0bd6,_0x519077){_0x3b0bd6=_0x3b0bd6-0x0;var _0x3cba32=_0xafb7[_0x3b0bd6];return _0x3cba32;};'use strict';var client=require('../client');exports[_0x7afb('0x0')]=function(_0x365d51,_0x36f001){return client[_0x7afb('0x1')](_0x7afb('0x2'),{'body':_0x36f001,'options':{'where':{'id':_0x365d51}},'log':_0x7afb('0x3')});};exports[_0x7afb('0x4')]=function(_0x4ea5ca,_0xb9ab18){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0xb9ab18,'options':{'where':{'id':_0x4ea5ca}},'log':_0x7afb('0x5')});}; \ No newline at end of file +var _0xfb84=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x470212,_0x1387de){var _0x5083cb=function(_0x3bec27){while(--_0x3bec27){_0x470212['push'](_0x470212['shift']());}};_0x5083cb(++_0x1387de);}(_0xfb84,0xda));var _0x4fb8=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xfb84[_0x4d7f3f];return _0x5d67cc;};'use strict';var client=require(_0x4fb8('0x0'));exports[_0x4fb8('0x1')]=function(_0x1ccd77,_0x404754){return client[_0x4fb8('0x2')]('UpdateOpenchannelInteraction',{'body':_0x404754,'options':{'where':{'id':_0x1ccd77}},'log':_0x4fb8('0x3')});};exports[_0x4fb8('0x4')]=function(_0x5a381e,_0x425d30){return client[_0x4fb8('0x2')](_0x4fb8('0x5'),{'body':_0x425d30,'options':{'where':{'id':_0x5a381e}},'log':_0x4fb8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 88ba346..2dde1a8 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 _0x1fc6=['CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x47244e,_0x2e3f80){var _0x588f97=function(_0x51a993){while(--_0x51a993){_0x47244e['push'](_0x47244e['shift']());}};_0x588f97(++_0x2e3f80);}(_0x1fc6,0x101));var _0x61fc=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x1fc6[_0x39fd11];return _0x302799;};'use strict';var client=require('../client');exports[_0x61fc('0x0')]=function(_0x5b9d99){return client['Request'](_0x61fc('0x1'),{'body':_0x5b9d99,'log':_0x61fc('0x2')});}; \ No newline at end of file +var _0xbfad=['Request','createOpenchannelMessage'];(function(_0x58adc0,_0x2de21a){var _0x13fcee=function(_0x426896){while(--_0x426896){_0x58adc0['push'](_0x58adc0['shift']());}};_0x13fcee(++_0x2de21a);}(_0xbfad,0x188));var _0xdbfa=function(_0x40d16f,_0x2b3cb5){_0x40d16f=_0x40d16f-0x0;var _0x3328b0=_0xbfad[_0x40d16f];return _0x3328b0;};'use strict';var client=require('../client');exports['create']=function(_0x23cbbf){return client[_0xdbfa('0x0')]('CreateOpenchannelMessage',{'body':_0x23cbbf,'log':_0xdbfa('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1566f99..c28761f 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 _0x1a1f=['getOpenchannelQueues','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause'];(function(_0x1dc462,_0xddde2){var _0x57feb2=function(_0x1440c8){while(--_0x1440c8){_0x1dc462['push'](_0x1dc462['shift']());}};_0x57feb2(++_0xddde2);}(_0x1a1f,0x180));var _0xf1a1=function(_0x947156,_0x38c8bb){_0x947156=_0x947156-0x0;var _0x594b25=_0x1a1f[_0x947156];return _0x594b25;};'use strict';var client=require('../client');exports[_0xf1a1('0x0')]=function(){return function(){return client['Request'](_0xf1a1('0x1'),{'options':{'raw':![],'attributes':['id',_0xf1a1('0x2'),_0xf1a1('0x3'),'strategy'],'include':[{'model':_0xf1a1('0x4'),'as':_0xf1a1('0x5'),'attributes':['id',_0xf1a1('0x2'),_0xf1a1('0x6'),_0xf1a1('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x755c=['openchannelPause','getOpenchannelQueues','GetOpenchannelQueue','name','User','Agents'];(function(_0x3eab90,_0x4e7489){var _0xb98a8b=function(_0x337647){while(--_0x337647){_0x3eab90['push'](_0x3eab90['shift']());}};_0xb98a8b(++_0x4e7489);}(_0x755c,0x13f));var _0xc755=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x755c[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xc755('0x0')]=function(){return function(){return client['Request'](_0xc755('0x1'),{'options':{'raw':![],'attributes':['id',_0xc755('0x2'),'timeout','strategy'],'include':[{'model':_0xc755('0x3'),'as':_0xc755('0x4'),'attributes':['id',_0xc755('0x2'),'online',_0xc755('0x5')]}]},'log':_0xc755('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 9ffe8a6..18bc87d 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 _0x8856=['UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport','update','Request'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x8856,0xe2));var _0x6885=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8856[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x6885('0x0'));exports[_0x6885('0x1')]=function(_0x4ebc1a){return client['Request'](_0x6885('0x2'),{'body':_0x4ebc1a,'log':_0x6885('0x2')});};exports[_0x6885('0x3')]=function(_0x492311,_0x58d1de){return client[_0x6885('0x4')](_0x6885('0x5'),{'body':_0x58d1de,'options':{'where':{'uniqueid':_0x492311},'order':[['id',_0x6885('0x6')]],'limit':0x1},'log':_0x6885('0x5')});}; \ No newline at end of file +var _0x8922=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','create'];(function(_0x3def68,_0x168173){var _0x1f6f22=function(_0x5652b2){while(--_0x5652b2){_0x3def68['push'](_0x3def68['shift']());}};_0x1f6f22(++_0x168173);}(_0x8922,0xe2));var _0x2892=function(_0x10d402,_0x55f26a){_0x10d402=_0x10d402-0x0;var _0x2d6305=_0x8922[_0x10d402];return _0x2d6305;};'use strict';var client=require(_0x2892('0x0'));exports[_0x2892('0x1')]=function(_0x2f5ba1){return client[_0x2892('0x2')](_0x2892('0x3'),{'body':_0x2f5ba1,'log':_0x2892('0x3')});};exports[_0x2892('0x4')]=function(_0x4ec8be,_0x5d2039){return client[_0x2892('0x2')](_0x2892('0x5'),{'body':_0x5d2039,'options':{'where':{'uniqueid':_0x4ec8be},'order':[['id','DESC']],'limit':0x1},'log':_0x2892('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 2fbfd4c..4c1e903 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 _0x7b83=['addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x3033a,_0x481c8e){var _0x10c4a7=function(_0x485c0b){while(--_0x485c0b){_0x3033a['push'](_0x3033a['shift']());}};_0x10c4a7(++_0x481c8e);}(_0x7b83,0xa1));var _0x37b8=function(_0x20db31,_0x1937a4){_0x20db31=_0x20db31-0x0;var _0x1faf7e=_0x7b83[_0x20db31];return _0x1faf7e;};'use strict';var client=require(_0x37b8('0x0'));exports[_0x37b8('0x1')]=function(_0xf4ecfb,_0x56c392){return client['Request'](_0x37b8('0x2'),{'body':_0x56c392,'options':{'where':{'id':_0xf4ecfb}},'log':_0x37b8('0x3')});};exports[_0x37b8('0x4')]=function(_0x48aaa1,_0x420271){return client[_0x37b8('0x5')](_0x37b8('0x6'),{'body':_0x420271,'options':{'where':{'id':_0x48aaa1}},'log':_0x37b8('0x7')});}; \ No newline at end of file +var _0xeb5d=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x1bb017,_0x2dc007){var _0x3d5c58=function(_0xef6817){while(--_0xef6817){_0x1bb017['push'](_0x1bb017['shift']());}};_0x3d5c58(++_0x2dc007);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb5d[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0xdeb5('0x0')]=function(_0x1ede03,_0x42c87c){return client[_0xdeb5('0x1')]('UpdateSmsInteraction',{'body':_0x42c87c,'options':{'where':{'id':_0x1ede03}},'log':'updateSmsInteraction'});};exports[_0xdeb5('0x2')]=function(_0x16c31b,_0x546313){return client[_0xdeb5('0x1')](_0xdeb5('0x3'),{'body':_0x546313,'options':{'where':{'id':_0x16c31b}},'log':_0xdeb5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9989916..541778d 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 _0xa92e=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x4e431b,_0x1db856){var _0x2e1e59=function(_0x56767a){while(--_0x56767a){_0x4e431b['push'](_0x4e431b['shift']());}};_0x2e1e59(++_0x1db856);}(_0xa92e,0x12b));var _0xea92=function(_0x314db6,_0x5bad04){_0x314db6=_0x314db6-0x0;var _0x144b8e=_0xa92e[_0x314db6];return _0x144b8e;};'use strict';var client=require(_0xea92('0x0'));exports[_0xea92('0x1')]=function(_0xb30efb){return client[_0xea92('0x2')](_0xea92('0x3'),{'body':_0xb30efb,'log':_0xea92('0x4')});}; \ No newline at end of file +var _0x09b4=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x09b4,0x1ba));var _0x409b=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x09b4[_0x39c734];return _0xb2a2f9;};'use strict';var client=require(_0x409b('0x0'));exports[_0x409b('0x1')]=function(_0x295c2e){return client[_0x409b('0x2')](_0x409b('0x3'),{'body':_0x295c2e,'log':_0x409b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d8f3437..6f4f2f3 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x6a1bc7,_0x10c2bb){var _0x584e6a=function(_0x18d808){while(--_0x18d808){_0x6a1bc7['push'](_0x6a1bc7['shift']());}};_0x584e6a(++_0x10c2bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0xb81851,_0x2168ec){var _0xe82df2=function(_0x24c7c9){while(--_0x24c7c9){_0xb81851['push'](_0xb81851['shift']());}};_0xe82df2(++_0x2168ec);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 4f541cb..bcc2f63 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0xedd9,0xfc));var _0x9edd=function(_0x26d0e8,_0x42951c){_0x26d0e8=_0x26d0e8-0x0;var _0x3ebfa0=_0xedd9[_0x26d0e8];return _0x3ebfa0;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x3bb3d2,_0x54f812){var _0x45c29a=function(_0x1df3a4){while(--_0x1df3a4){_0x3bb3d2['push'](_0x3bb3d2['shift']());}};_0x45c29a(++_0x54f812);}(_0x55ca,0x126));var _0xa55c=function(_0x5bd103,_0x3b8037){_0x5bd103=_0x5bd103-0x0;var _0xc33b64=_0x55ca[_0x5bd103];return _0xc33b64;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8d715d1..0d0ff3c 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(_0x328021,_0x498364){var _0x5c0f74=function(_0x52d3ea){while(--_0x52d3ea){_0x328021['push'](_0x328021['shift']());}};_0x5c0f74(++_0x498364);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x2ddcae,_0x466570){var _0x35762a=function(_0x941dfc){while(--_0x941dfc){_0x2ddcae['push'](_0x2ddcae['shift']());}};_0x35762a(++_0x466570);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 b10e44c..f580afe 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 _0xa23f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x120e86,_0x1876ae){var _0x361cb2=function(_0x217269){while(--_0x217269){_0x120e86['push'](_0x120e86['shift']());}};_0x361cb2(++_0x1876ae);}(_0xa23f,0x7c));var _0xfa23=function(_0x36a288,_0x3a385d){_0x36a288=_0x36a288-0x0;var _0x2bb4bb=_0xa23f[_0x36a288];return _0x2bb4bb;};'use strict';var client=require(_0xfa23('0x0'));exports[_0xfa23('0x1')]=function(_0x56a4e3,_0x48fd46){return client[_0xfa23('0x2')](_0xfa23('0x3'),{'body':_0x48fd46,'options':{'where':{'id':_0x56a4e3}},'log':_0xfa23('0x4')});};exports[_0xfa23('0x5')]=function(_0x5643b1,_0x86778e){return client['Request'](_0xfa23('0x6'),{'body':_0x86778e,'options':{'where':{'id':_0x5643b1}},'log':_0xfa23('0x7')});}; \ No newline at end of file +var _0x7919=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x3863f0,_0x44f069){var _0x4ca102=function(_0x4d8165){while(--_0x4d8165){_0x3863f0['push'](_0x3863f0['shift']());}};_0x4ca102(++_0x44f069);}(_0x7919,0xeb));var _0x9791=function(_0xf38130,_0xe0691b){_0xf38130=_0xf38130-0x0;var _0x4f53c8=_0x7919[_0xf38130];return _0x4f53c8;};'use strict';var client=require(_0x9791('0x0'));exports[_0x9791('0x1')]=function(_0x466be6,_0x1c714b){return client[_0x9791('0x2')](_0x9791('0x3'),{'body':_0x1c714b,'options':{'where':{'id':_0x466be6}},'log':_0x9791('0x4')});};exports['addTags']=function(_0x13a1a5,_0x193919){return client['Request'](_0x9791('0x5'),{'body':_0x193919,'options':{'where':{'id':_0x13a1a5}},'log':_0x9791('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 3d75695..3494f58 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 _0x6080=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x290a32,_0xcf7aa5){var _0x284249=function(_0x665fd1){while(--_0x665fd1){_0x290a32['push'](_0x290a32['shift']());}};_0x284249(++_0xcf7aa5);}(_0x6080,0xbb));var _0x0608=function(_0x268fa6,_0x5c9a1a){_0x268fa6=_0x268fa6-0x0;var _0x33bb6e=_0x6080[_0x268fa6];return _0x33bb6e;};'use strict';var client=require(_0x0608('0x0'));exports[_0x0608('0x1')]=function(_0x588477){return client[_0x0608('0x2')](_0x0608('0x3'),{'body':_0x588477,'log':_0x0608('0x4')});}; \ No newline at end of file +var _0xaf7e=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x11065a,_0x8022d5){var _0xbf4add=function(_0x8f05){while(--_0x8f05){_0x11065a['push'](_0x11065a['shift']());}};_0xbf4add(++_0x8022d5);}(_0xaf7e,0xb5));var _0xeaf7=function(_0x5ab5eb,_0x3644a7){_0x5ab5eb=_0x5ab5eb-0x0;var _0x5f5688=_0xaf7e[_0x5ab5eb];return _0x5f5688;};'use strict';var client=require(_0xeaf7('0x0'));exports[_0xeaf7('0x1')]=function(_0x44fee8){return client[_0xeaf7('0x2')](_0xeaf7('0x3'),{'body':_0x44fee8,'log':_0xeaf7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 2926d85..75dd890 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 _0xa0d6=['name','timeout','strategy','User','Agents','online','whatsappPause'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa0d6,0x9a));var _0x6a0d=function(_0xe5feb8,_0x2a95a6){_0xe5feb8=_0xe5feb8-0x0;var _0x31c304=_0xa0d6[_0xe5feb8];return _0x31c304;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x6a0d('0x0'),_0x6a0d('0x1'),_0x6a0d('0x2')],'include':[{'model':_0x6a0d('0x3'),'as':_0x6a0d('0x4'),'attributes':['id',_0x6a0d('0x0'),_0x6a0d('0x5'),_0x6a0d('0x6')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x5bc8=['User','name','online','whatsappPause','getWhatsappQueues','timeout'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x5bc8,0xb8));var _0x85bc=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x5bc8[_0x4480b9];return _0x3f0f02;};'use strict';var client=require('../client');exports[_0x85bc('0x0')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x85bc('0x1'),'strategy'],'include':[{'model':_0x85bc('0x2'),'as':'Agents','attributes':['id',_0x85bc('0x3'),_0x85bc('0x4'),_0x85bc('0x5')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7294497..de98152 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 _0xb96a=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create','Request'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb96a,0x136));var _0xab96=function(_0x29b9ad,_0x243a93){_0x29b9ad=_0x29b9ad-0x0;var _0x52ecd6=_0xb96a[_0x29b9ad];return _0x52ecd6;};'use strict';var client=require('../client');exports[_0xab96('0x0')]=function(_0x467212){return client[_0xab96('0x1')](_0xab96('0x2'),{'body':_0x467212,'log':_0xab96('0x2')});};exports[_0xab96('0x3')]=function(_0x24fe4d,_0x24c1ff){return client[_0xab96('0x1')](_0xab96('0x4'),{'body':_0x24c1ff,'options':{'where':{'uniqueid':_0x24fe4d},'order':[['id',_0xab96('0x5')]],'limit':0x1},'log':_0xab96('0x4')});}; \ No newline at end of file +var _0xf5e9=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e9,0x1c6));var _0x9f5e=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xf5e9[_0x2d91c6];return _0x3a8d19;};'use strict';var client=require(_0x9f5e('0x0'));exports['create']=function(_0x486afb){return client[_0x9f5e('0x1')](_0x9f5e('0x2'),{'body':_0x486afb,'log':_0x9f5e('0x2')});};exports[_0x9f5e('0x3')]=function(_0x49f0eb,_0x567d69){return client[_0x9f5e('0x1')](_0x9f5e('0x4'),{'body':_0x567d69,'options':{'where':{'uniqueid':_0x49f0eb},'order':[['id',_0x9f5e('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 804394d..31b7c88 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 _0xdb8f=['stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','info','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0xdb8f,0xfd));var _0xfdb8=function(_0x1ad68e,_0x16562f){_0x1ad68e=_0x1ad68e-0x0;var _0x82d21e=_0xdb8f[_0x1ad68e];return _0x82d21e;};'use strict';var schema=require(_0xfdb8('0x0'));var _=require(_0xfdb8('0x1'));var util=require(_0xfdb8('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xfdb8('0x3'))(_0xfdb8('0x4'));var strategy=require(_0xfdb8('0x5'));var queue=schema({'name':{'type':_0xfdb8('0x6'),'required':!![],'message':_0xfdb8('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4eb422,_0x3930ec,_0xddb3d5){return logger['info'](util[_0xfdb8('0x8')](_0xfdb8('0x9'),_0x4eb422,_0x3930ec[_0xfdb8('0xa')],_0xddb3d5));}function handleFindAgent(_0x21cfc0){return function(_0x4d3143){return _0x4d3143[_0xfdb8('0xa')][_0xfdb8('0xb')]()===_0x21cfc0[_0xfdb8('0xb')]();};}exports['consequence']=function(_0x1c5178,_0x4aeec9,_0x1f70e8,_0x3469da){return function(_0x2459ac){try{var _0x3ee4e7={'name':_0x4aeec9[0x0],'timeout':_0x4aeec9[0x1]};var _0xb905c5=queue[_0xfdb8('0x0')](_0x3ee4e7,{'typecast':!![]});if(_0xb905c5['length']){logger[_0xfdb8('0xc')](_0xfdb8('0xd'),_0x1c5178,_[_0xfdb8('0xe')](_0xb905c5,_0xfdb8('0xf'))[_0xfdb8('0x10')](',\x20'));_0x2459ac[_0xfdb8('0x11')]();}else{var _0xdbd323=_[_0xfdb8('0x12')](_0x1f70e8[_0xfdb8('0x13')],handleFindAgent(_0x3ee4e7['name']));if(_0xdbd323){var _0x1214eb=(_0x3ee4e7[_0xfdb8('0x14')]||0xa)*0x3e8;var _0x290cc6,_0x377022;var _0x3156a2=seqqueue[_0xfdb8('0x15')](_0x1214eb);_0x3156a2['id']=_0x1c5178;_0x3156a2[_0xfdb8('0x16')]=_0x1214eb;_0x3156a2['channel']=_0x3469da[_0xfdb8('0x17')];writeLog(_0x1c5178,_0xdbd323,util[_0xfdb8('0x8')]('START:%s',_0x1214eb));_0x1f70e8['rules'][_0x1c5178]['on'](_0xfdb8('0x18'),function(){logger['info'](_0xfdb8('0x19'),_0x1c5178);clearTimeout(_0x377022);_0x377022=undefined;_0x3156a2[_0xfdb8('0x1a')]();if(_0x1f70e8[_0xfdb8('0x1b')][_0x1c5178]){delete _0x1f70e8[_0xfdb8('0x1b')][_0x1c5178];}_0x2459ac[_0xfdb8('0x11')]();});_0x1f70e8[_0xfdb8('0x1b')][_0x1c5178]['on'](_0xfdb8('0x1c'),function(){if(_0x1f70e8[_0xfdb8('0x1b')][_0x1c5178]){delete _0x1f70e8[_0xfdb8('0x1b')][_0x1c5178];}});_0x377022=setTimeout(function(){logger[_0xfdb8('0x1d')](_0xfdb8('0x1e'),_0x1c5178);clearTimeout(_0x377022);_0x3156a2[_0xfdb8('0x1a')]();_0x2459ac['next']();},_0x1214eb);strategy[_0xfdb8('0x1f')](_0x3156a2,_0xdbd323,_0x1f70e8,_0x3469da);}else{logger[_0xfdb8('0xc')](_0xfdb8('0x20'),_0x1c5178,_0x3ee4e7[_0xfdb8('0xa')]);_0x2459ac[_0xfdb8('0x11')]();}}}catch(_0xa2bd1d){console[_0xfdb8('0x21')](_0xa2bd1d);logger[_0xfdb8('0xc')](_0xfdb8('0x22'),_0x1c5178,_0xa2bd1d[_0xfdb8('0x23')]);_0x2459ac[_0xfdb8('0x11')]();}};}; \ No newline at end of file +var _0x1aaa=['agent','error','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','join','stop','find','timeout','atimeout','channel','end','close','rules','complete','next'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x1aaa,0x1a4));var _0xa1aa=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x1aaa[_0x381589];return _0x2a075d;};'use strict';var schema=require(_0xa1aa('0x0'));var _=require(_0xa1aa('0x1'));var util=require(_0xa1aa('0x2'));var seqqueue=require(_0xa1aa('0x3'));var logger=require(_0xa1aa('0x4'))(_0xa1aa('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xa1aa('0x6'),'required':!![],'message':_0xa1aa('0x7')},'timeout':{'type':'number','message':_0xa1aa('0x8')}});function writeLog(_0x1c8454,_0x69d585,_0xa6c203){return logger[_0xa1aa('0x9')](util[_0xa1aa('0xa')](_0xa1aa('0xb'),_0x1c8454,_0x69d585[_0xa1aa('0xc')],_0xa6c203));}function handleFindAgent(_0x2e6344){return function(_0x1b0d27){return _0x1b0d27[_0xa1aa('0xc')][_0xa1aa('0xd')]()===_0x2e6344[_0xa1aa('0xd')]();};}exports[_0xa1aa('0xe')]=function(_0x2f8f83,_0x4de266,_0x35e8e3,_0xb79fb2){return function(_0x2cb69d){try{var _0x2f8d88={'name':_0x4de266[0x0],'timeout':_0x4de266[0x1]};var _0x5b7a68=queue[_0xa1aa('0x0')](_0x2f8d88,{'typecast':!![]});if(_0x5b7a68['length']){logger['error'](_0xa1aa('0xf'),_0x2f8f83,_[_0xa1aa('0x10')](_0x5b7a68,'message')[_0xa1aa('0x11')](',\x20'));_0x2cb69d[_0xa1aa('0x12')]();}else{var _0x5b731b=_[_0xa1aa('0x13')](_0x35e8e3['agents'],handleFindAgent(_0x2f8d88[_0xa1aa('0xc')]));if(_0x5b731b){var _0x37ab31=(_0x2f8d88[_0xa1aa('0x14')]||0xa)*0x3e8;var _0x42eff9,_0x347abf;var _0x27378d=seqqueue['createQueue'](_0x37ab31);_0x27378d['id']=_0x2f8f83;_0x27378d[_0xa1aa('0x15')]=_0x37ab31;_0x27378d['channel']=_0xb79fb2[_0xa1aa('0x16')];writeLog(_0x2f8f83,_0x5b731b,util[_0xa1aa('0xa')]('START:%s',_0x37ab31));_0x35e8e3['rules'][_0x2f8f83]['on'](_0xa1aa('0x17'),function(){logger[_0xa1aa('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2f8f83);clearTimeout(_0x347abf);_0x347abf=undefined;_0x27378d[_0xa1aa('0x18')]();if(_0x35e8e3['rules'][_0x2f8f83]){delete _0x35e8e3[_0xa1aa('0x19')][_0x2f8f83];}_0x2cb69d['stop']();});_0x35e8e3[_0xa1aa('0x19')][_0x2f8f83]['on'](_0xa1aa('0x1a'),function(){if(_0x35e8e3['rules'][_0x2f8f83]){delete _0x35e8e3[_0xa1aa('0x19')][_0x2f8f83];}});_0x347abf=setTimeout(function(){logger[_0xa1aa('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x2f8f83);clearTimeout(_0x347abf);_0x27378d['close']();_0x2cb69d[_0xa1aa('0x1b')]();},_0x37ab31);strategy[_0xa1aa('0x1c')](_0x27378d,_0x5b731b,_0x35e8e3,_0xb79fb2);}else{logger[_0xa1aa('0x1d')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2f8f83,_0x2f8d88[_0xa1aa('0xc')]);_0x2cb69d[_0xa1aa('0x12')]();}}}catch(_0x1767fb){console[_0xa1aa('0x1e')](_0x1767fb);logger['error']('[%s][QUEUE]\x20%s',_0x2f8f83,_0x1767fb[_0xa1aa('0x1f')]);_0x2cb69d[_0xa1aa('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 4e1d422..2281348 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 _0x445d=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','then','Failed','catch','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','info','error'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x445d,0xa1));var _0xd445=function(_0x21dd3d,_0x26b32e){_0x21dd3d=_0x21dd3d-0x0;var _0x364ed0=_0x445d[_0x21dd3d];return _0x364ed0;};'use strict';var _=require('lodash');var moment=require(_0xd445('0x0'));var AWS=require('aws-sdk');var utils=require(_0xd445('0x1'));var logger=require(_0xd445('0x2'))(_0xd445('0x3'));var rpc={'chatMessage':require(_0xd445('0x4')),'openchannelMessage':require(_0xd445('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd445('0x6')),'whatsappMessage':require(_0xd445('0x7'))};exports[_0xd445('0x8')]=function(_0x2a52fd,_0x4705f9){return function(_0x4b6102){try{if(!_[_0xd445('0x9')](this[_0xd445('0xa')][_0xd445('0xb')])){logger['info'](_0xd445('0xc'),_0x2a52fd,_0xd445('0xd'));return _0x4b6102[_0xd445('0xe')]();}var _0x23de8b={'ContactId':this[_0xd445('0xf')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd445('0x10')};if(this[_0xd445('0x11')]==='sms'||this[_0xd445('0x11')]===_0xd445('0x12')){_0x23de8b['phone']=this[_0xd445('0xa')][_0xd445('0x13')];}var _0x1be41c=this[_0xd445('0x11')];if(_0x1be41c===_0xd445('0x14')){_0x23de8b[_0xd445('0x15')]=this[_0xd445('0x16')]['id'];}else{_0x23de8b[_['upperFirst'](_0x1be41c)+'AccountId']=this[_0xd445('0x16')]['id'];}_0x23de8b[_[_0xd445('0x17')](_0x1be41c)+'InteractionId']=this[_0xd445('0xa')]['id'];if(this['interaction'][_0xd445('0x18')]){var _0x4ec4ff=_0x4705f9[0x4];if(!_[_0xd445('0x19')](_0x4ec4ff)){_0x23de8b[_0xd445('0x1a')]=utils[_0xd445('0x1b')](_0x4ec4ff,this);return rpc[_0x1be41c+_0xd445('0x1c')]['create'](_0x23de8b)['then'](function(_0x3f2d7f){logger[_0xd445('0x1d')](_0xd445('0xc'),_0x2a52fd,_0x23de8b[_0xd445('0x1a')]);})['catch'](function(_0x1a29d1){logger[_0xd445('0x1e')](_0xd445('0xc'),_0x2a52fd,JSON[_0xd445('0x1f')](_0x1a29d1));})[_0xd445('0x20')](function(){logger['info'](_0xd445('0x21'),_0x2a52fd);_0x4b6102[_0xd445('0x22')]();});}else{logger[_0xd445('0x1d')](_0xd445('0x23'),_0x2a52fd);_0x4b6102[_0xd445('0x22')]();}}else{var _0x268a7a=this;var _0x16bb0b=new AWS[(_0xd445('0x24'))]({'accessKeyId':_0x4705f9[0x0],'secretAccessKey':_0x4705f9[0x1],'region':_0x4705f9[0x2]});var _0x12c421={'botAlias':_0xd445('0x25'),'botName':_0x4705f9[0x3],'inputText':this[_0xd445('0x26')][_0xd445('0x1a')],'userId':this[_0xd445('0x11')]+':'+this[_0xd445('0xa')]['id'][_0xd445('0x27')]()};_0x16bb0b[_0xd445('0x28')](_0x12c421,function(_0x58af2a,_0x976faf){if(_0x58af2a){logger['error'](_0xd445('0xc'),_0x2a52fd,_0x58af2a[_0xd445('0x26')]);_0x4b6102[_0xd445('0xe')]();}else if(_0x976faf&&_0x976faf['message']){_0x268a7a[_0xd445('0x1a')][_0xd445('0x29')]=_0x976faf;_0x23de8b['body']=_0x976faf[_0xd445('0x26')];_0x23de8b[_0xd445('0x2a')]=_0xd445('0x29');_0x23de8b[_0xd445('0x2b')]=JSON[_0xd445('0x1f')](_0x976faf);return rpc[_0x1be41c+_0xd445('0x1c')][_0xd445('0x2c')](_0x23de8b)[_0xd445('0x2d')](function(_0x5b3025){logger[_0xd445('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x2a52fd,_0x23de8b[_0xd445('0x1a')]);if(_0x976faf['dialogState']==_0xd445('0x2e')){_0x4b6102['next']();}else{_0x4b6102['stop']();}})[_0xd445('0x2f')](function(_0x43ebff){logger[_0xd445('0x1e')](_0xd445('0xc'),_0x2a52fd,JSON['stringify'](_0x43ebff));_0x4b6102[_0xd445('0xe')]();});}else{_0x4b6102['next']();}});}}catch(_0x51e4ba){logger[_0xd445('0x1e')](_0xd445('0xc'),_0x2a52fd,JSON[_0xd445('0x1f')](_0x51e4ba));_0x4b6102[_0xd445('0x22')]();}};}; \ No newline at end of file +var _0x7eaf=['catch','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','create','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','providerName','Failed'];(function(_0x427e51,_0x3d2c88){var _0x341e36=function(_0x33eabc){while(--_0x33eabc){_0x427e51['push'](_0x427e51['shift']());}};_0x341e36(++_0x3d2c88);}(_0x7eaf,0x11b));var _0xf7ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eaf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf7ea('0x0'));var moment=require(_0xf7ea('0x1'));var AWS=require(_0xf7ea('0x2'));var utils=require('./utils');var logger=require(_0xf7ea('0x3'))('routing');var rpc={'chatMessage':require(_0xf7ea('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf7ea('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf7ea('0x6'))};exports[_0xf7ea('0x7')]=function(_0x1095ba,_0x208d8b){return function(_0x2b8c28){try{if(!_[_0xf7ea('0x8')](this[_0xf7ea('0x9')][_0xf7ea('0xa')])){logger[_0xf7ea('0xb')](_0xf7ea('0xc'),_0x1095ba,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2b8c28[_0xf7ea('0xd')]();}var _0x4308d7={'ContactId':this[_0xf7ea('0xe')]['id'],'sentAt':moment()[_0xf7ea('0xf')](_0xf7ea('0x10')),'direction':_0xf7ea('0x11')};if(this[_0xf7ea('0x12')]===_0xf7ea('0x13')||this[_0xf7ea('0x12')]===_0xf7ea('0x14')){_0x4308d7[_0xf7ea('0x15')]=this[_0xf7ea('0x9')][_0xf7ea('0x15')];}var _0x744cf4=this['channel'];if(_0x744cf4===_0xf7ea('0x16')){_0x4308d7[_0xf7ea('0x17')]=this[_0xf7ea('0x18')]['id'];}else{_0x4308d7[_[_0xf7ea('0x19')](_0x744cf4)+_0xf7ea('0x1a')]=this['account']['id'];}_0x4308d7[_[_0xf7ea('0x19')](_0x744cf4)+_0xf7ea('0x1b')]=this[_0xf7ea('0x9')]['id'];if(this['interaction'][_0xf7ea('0x1c')]){var _0x2227ec=_0x208d8b[0x4];if(!_[_0xf7ea('0x1d')](_0x2227ec)){_0x4308d7['body']=utils['getMustacheRender'](_0x2227ec,this);return rpc[_0x744cf4+_0xf7ea('0x1e')][_0xf7ea('0x1f')](_0x4308d7)[_0xf7ea('0x20')](function(_0x56f3a1){logger[_0xf7ea('0xb')]('[%s][AMAZONLEX]\x20%s',_0x1095ba,_0x4308d7[_0xf7ea('0x21')]);})['catch'](function(_0x48b6e5){logger[_0xf7ea('0x22')]('[%s][AMAZONLEX]\x20%s',_0x1095ba,JSON[_0xf7ea('0x23')](_0x48b6e5));})[_0xf7ea('0x24')](function(){logger['info'](_0xf7ea('0x25'),_0x1095ba);_0x2b8c28[_0xf7ea('0x26')]();});}else{logger[_0xf7ea('0xb')](_0xf7ea('0x27'),_0x1095ba);_0x2b8c28[_0xf7ea('0x26')]();}}else{var _0x1763ae=this;var _0x32847b=new AWS[(_0xf7ea('0x28'))]({'accessKeyId':_0x208d8b[0x0],'secretAccessKey':_0x208d8b[0x1],'region':_0x208d8b[0x2]});var _0x3bf311={'botAlias':'$LATEST','botName':_0x208d8b[0x3],'inputText':this[_0xf7ea('0x29')][_0xf7ea('0x21')],'userId':this['channel']+':'+this[_0xf7ea('0x9')]['id'][_0xf7ea('0x2a')]()};_0x32847b[_0xf7ea('0x2b')](_0x3bf311,function(_0x5e4d06,_0x5d109f){if(_0x5e4d06){logger[_0xf7ea('0x22')]('[%s][AMAZONLEX]\x20%s',_0x1095ba,_0x5e4d06[_0xf7ea('0x29')]);_0x2b8c28[_0xf7ea('0xd')]();}else if(_0x5d109f&&_0x5d109f[_0xf7ea('0x29')]){_0x1763ae['body']['amazonlex']=_0x5d109f;_0x4308d7[_0xf7ea('0x21')]=_0x5d109f[_0xf7ea('0x29')];_0x4308d7[_0xf7ea('0x2c')]='amazonlex';_0x4308d7['providerResponse']=JSON['stringify'](_0x5d109f);return rpc[_0x744cf4+_0xf7ea('0x1e')][_0xf7ea('0x1f')](_0x4308d7)['then'](function(_0x10dbbc){logger[_0xf7ea('0xb')](_0xf7ea('0xc'),_0x1095ba,_0x4308d7[_0xf7ea('0x21')]);if(_0x5d109f['dialogState']==_0xf7ea('0x2d')){_0x2b8c28[_0xf7ea('0xd')]();}else{_0x2b8c28[_0xf7ea('0x26')]();}})[_0xf7ea('0x2e')](function(_0x39b698){logger[_0xf7ea('0x22')](_0xf7ea('0xc'),_0x1095ba,JSON[_0xf7ea('0x23')](_0x39b698));_0x2b8c28[_0xf7ea('0xd')]();});}else{_0x2b8c28[_0xf7ea('0xd')]();}});}}catch(_0x397488){logger['error'](_0xf7ea('0xc'),_0x1095ba,JSON[_0xf7ea('0x23')](_0x397488));_0x2b8c28['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 14fbd28..0e98e41 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 _0x1503=['messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','channel','read','subject','startsWith','Re:','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','pass','inReplyTo'];(function(_0x381ed8,_0x1a1279){var _0x10415c=function(_0x31ec1f){while(--_0x31ec1f){_0x381ed8['push'](_0x381ed8['shift']());}};_0x10415c(++_0x1a1279);}(_0x1503,0x19a));var _0x3150=function(_0x2a5637,_0x2589c2){_0x2a5637=_0x2a5637-0x0;var _0x6e5a23=_0x1503[_0x2a5637];return _0x6e5a23;};'use strict';var _=require(_0x3150('0x0'));var moment=require(_0x3150('0x1'));var utils=require(_0x3150('0x2'));var logger=require(_0x3150('0x3'))(_0x3150('0x4'));var rpc={'chatMessage':require(_0x3150('0x5')),'openchannelMessage':require(_0x3150('0x6')),'mailMessage':require(_0x3150('0x7')),'smsMessage':require(_0x3150('0x8')),'faxMessage':require(_0x3150('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x3150('0xa')),'openchannelInteraction':require(_0x3150('0xb')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x3150('0xc')),'faxInteraction':require(_0x3150('0xd')),'whatsappInteraction':require(_0x3150('0xe'))};var mailRpc=require(_0x3150('0xf'));exports['consequence']=function(_0x54dd24,_0x979d67,_0x50c61f,_0x445ef1){return function(_0x493572){try{var _0x318082=this['channel'];if(_0x318082===_0x3150('0x10')&&_0x445ef1[_0x3150('0x11')][_0x3150('0x12')]){logger[_0x3150('0x13')](_0x3150('0x14'),_0x54dd24,_0x3150('0x15'));return _0x493572['next']();}if(_0x979d67[0x0]==='1'&&(_[_0x3150('0x16')](this[_0x3150('0x17')][_0x3150('0x18')])||!this['interaction'][_0x3150('0x18')])){logger[_0x3150('0x13')](_0x3150('0x14'),_0x54dd24,_0x3150('0x19'));return _0x493572[_0x3150('0x1a')]();}if(_0x979d67[0x0]==='2'&&this['interaction'][_0x3150('0x1b')]){logger[_0x3150('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x54dd24,_0x3150('0x1c'));return _0x493572[_0x3150('0x1a')]();}var _0x11b8fb={'ContactId':this[_0x3150('0x1d')]['id'],'sentAt':moment()['format'](_0x3150('0x1e')),'direction':'out'};if(this['channel']===_0x3150('0x10')){_0x11b8fb['body']=utils[_0x3150('0x1f')](_0x979d67[0x2],this);}else{_0x11b8fb[_0x3150('0x11')]=utils[_0x3150('0x1f')](_0x979d67[0x1],this);}if(this[_0x3150('0x20')]){_0x11b8fb['to']=this[_0x3150('0x20')][_0x3150('0x21')]||'';if(this[_0x3150('0x22')]==='mail'&&_0x979d67[0x1]==='1'){_0x11b8fb['cc']=this[_0x3150('0x20')]['cc']||'';}_0x11b8fb[_0x3150('0x21')]=this[_0x3150('0x20')]['to']||'';_0x11b8fb['phone']=this[_0x3150('0x20')]['phone']||'';_0x11b8fb[_0x3150('0x23')]=!![];if(this[_0x3150('0x20')]['subject']){_0x11b8fb[_0x3150('0x24')]='';_0x11b8fb[_0x3150('0x24')]+=_[_0x3150('0x25')](this[_0x3150('0x20')]['subject'],_0x3150('0x26'))?'':'Re:\x20';_0x11b8fb[_0x3150('0x24')]+=this[_0x3150('0x20')]['subject'];}}if(this[_0x3150('0x22')]==='chat'){_0x11b8fb['ChatWebsiteId']=this[_0x3150('0x27')]['id'];}else{_0x11b8fb[_[_0x3150('0x28')](this[_0x3150('0x22')])+_0x3150('0x29')]=this[_0x3150('0x27')]['id'];}_0x11b8fb[_[_0x3150('0x28')](this[_0x3150('0x22')])+_0x3150('0x2a')]=this[_0x3150('0x17')]['id'];var _0x74f289=this[_0x3150('0x17')];if(rpc[this[_0x3150('0x22')]+_0x3150('0x2b')]){if(this[_0x3150('0x22')]===_0x3150('0x10')){var _0x40117e={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x3150('0x2c')][_0x3150('0x2d')]){_0x40117e[_0x3150('0x2d')]=this['account'][_0x3150('0x2c')]['service'];}else{_0x40117e[_0x3150('0x2e')]=this[_0x3150('0x27')][_0x3150('0x2c')]['host'];_0x40117e[_0x3150('0x2f')]=this['account'][_0x3150('0x2c')][_0x3150('0x2f')];_0x40117e[_0x3150('0x30')]=this[_0x3150('0x27')][_0x3150('0x2c')][_0x3150('0x30')];}if(this['account'][_0x3150('0x2c')]['authentication']){_0x40117e[_0x3150('0x31')]={'user':this[_0x3150('0x27')][_0x3150('0x2c')]['user'],'pass':this[_0x3150('0x27')][_0x3150('0x2c')][_0x3150('0x32')]};}_0x11b8fb[_0x3150('0x33')]=this[_0x3150('0x20')][_0x3150('0x34')];_0x11b8fb[_0x3150('0x35')]=_0x3150('0x36')+_[_0x3150('0x37')](_0x11b8fb[_0x3150('0x11')],_0x3150('0x38'),'','replace','','auto-replied','All','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','then','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create'];(function(_0xb8b4d1,_0x5b464e){var _0x1668dd=function(_0x457d8f){while(--_0x457d8f){_0xb8b4d1['push'](_0xb8b4d1['shift']());}};_0x1668dd(++_0x5b464e);}(_0xe76b,0x1db));var _0xbe76=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xe76b[_0x179c4a];return _0x5d1879;};'use strict';var _=require(_0xbe76('0x0'));var moment=require(_0xbe76('0x1'));var utils=require(_0xbe76('0x2'));var logger=require(_0xbe76('0x3'))(_0xbe76('0x4'));var rpc={'chatMessage':require(_0xbe76('0x5')),'openchannelMessage':require(_0xbe76('0x6')),'mailMessage':require(_0xbe76('0x7')),'smsMessage':require(_0xbe76('0x8')),'faxMessage':require(_0xbe76('0x9')),'whatsappMessage':require(_0xbe76('0xa')),'chatInteraction':require(_0xbe76('0xb')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xbe76('0xc')),'smsInteraction':require(_0xbe76('0xd')),'faxInteraction':require(_0xbe76('0xe')),'whatsappInteraction':require(_0xbe76('0xf'))};var mailRpc=require(_0xbe76('0x10'));exports[_0xbe76('0x11')]=function(_0x15fc7e,_0x37cb0f,_0x981e24,_0x4c82d7){return function(_0x5c1376){try{var _0x254400=this['channel'];if(_0x254400===_0xbe76('0x12')&&_0x4c82d7[_0xbe76('0x13')]['isAutoreply']){logger[_0xbe76('0x14')](_0xbe76('0x15'),_0x15fc7e,_0xbe76('0x16'));return _0x5c1376['next']();}if(_0x37cb0f[0x0]==='1'&&(_[_0xbe76('0x17')](this[_0xbe76('0x18')][_0xbe76('0x19')])||!this['interaction'][_0xbe76('0x19')])){logger[_0xbe76('0x14')](_0xbe76('0x15'),_0x15fc7e,'Autoreply\x20already\x20sent');return _0x5c1376[_0xbe76('0x1a')]();}if(_0x37cb0f[0x0]==='2'&&this[_0xbe76('0x18')][_0xbe76('0x1b')]){logger[_0xbe76('0x14')](_0xbe76('0x1c'),_0x15fc7e,_0xbe76('0x1d'));return _0x5c1376[_0xbe76('0x1a')]();}var _0x2374e2={'ContactId':this[_0xbe76('0x1e')]['id'],'sentAt':moment()[_0xbe76('0x1f')](_0xbe76('0x20')),'direction':_0xbe76('0x21')};if(this[_0xbe76('0x22')]==='mail'){_0x2374e2[_0xbe76('0x13')]=utils['getMustacheRender'](_0x37cb0f[0x2],this);}else{_0x2374e2[_0xbe76('0x13')]=utils[_0xbe76('0x23')](_0x37cb0f[0x1],this);}if(this[_0xbe76('0x24')]){_0x2374e2['to']=this['message']['from']||'';if(this[_0xbe76('0x22')]===_0xbe76('0x12')&&_0x37cb0f[0x1]==='1'){_0x2374e2['cc']=this[_0xbe76('0x24')]['cc']||'';}_0x2374e2[_0xbe76('0x25')]=this[_0xbe76('0x24')]['to']||'';_0x2374e2[_0xbe76('0x26')]=this[_0xbe76('0x24')][_0xbe76('0x26')]||'';_0x2374e2['read']=!![];if(this['message'][_0xbe76('0x27')]){_0x2374e2['subject']='';_0x2374e2[_0xbe76('0x27')]+=_[_0xbe76('0x28')](this[_0xbe76('0x24')][_0xbe76('0x27')],_0xbe76('0x29'))?'':_0xbe76('0x2a');_0x2374e2[_0xbe76('0x27')]+=this['message']['subject'];}}if(this[_0xbe76('0x22')]==='chat'){_0x2374e2[_0xbe76('0x2b')]=this[_0xbe76('0x2c')]['id'];}else{_0x2374e2[_[_0xbe76('0x2d')](this[_0xbe76('0x22')])+'AccountId']=this['account']['id'];}_0x2374e2[_[_0xbe76('0x2d')](this[_0xbe76('0x22')])+_0xbe76('0x2e')]=this[_0xbe76('0x18')]['id'];var _0x10fcb6=this['interaction'];if(rpc[this[_0xbe76('0x22')]+_0xbe76('0x2f')]){if(this['channel']===_0xbe76('0x12')){var _0x16e253={'tls':{'rejectUnauthorized':![]}};if(this[_0xbe76('0x2c')][_0xbe76('0x30')][_0xbe76('0x31')]){_0x16e253[_0xbe76('0x31')]=this[_0xbe76('0x2c')]['Smtp']['service'];}else{_0x16e253[_0xbe76('0x32')]=this[_0xbe76('0x2c')]['Smtp']['host'];_0x16e253['port']=this[_0xbe76('0x2c')][_0xbe76('0x30')][_0xbe76('0x33')];_0x16e253[_0xbe76('0x34')]=this[_0xbe76('0x2c')][_0xbe76('0x30')][_0xbe76('0x34')];}if(this[_0xbe76('0x2c')][_0xbe76('0x30')][_0xbe76('0x35')]){_0x16e253[_0xbe76('0x36')]={'user':this['account'][_0xbe76('0x30')][_0xbe76('0x37')],'pass':this[_0xbe76('0x2c')][_0xbe76('0x30')][_0xbe76('0x38')]};}_0x2374e2[_0xbe76('0x39')]=this['message'][_0xbe76('0x3a')];_0x2374e2[_0xbe76('0x3b')]=_0xbe76('0x3c')+_[_0xbe76('0x3d')](_0x2374e2[_0xbe76('0x13')],']+(>|$)/g,''),'priorityTrue':_0x1c11e0[0x1],'priorityFalse':_0x1c11e0[0x2]};var _0x55cc3f=gotoif[_0xb9c3('0x0')](_0x410317,{'typecast':!![]});if(_0x55cc3f[_0xb9c3('0xc')]){logger[_0xb9c3('0xd')]('[%s][GOTOIF]\x20%s',_0x3ab676,_[_0xb9c3('0xe')](_0x55cc3f,'message')[_0xb9c3('0xf')](',\x20'));_0x485001['stop']();}else{try{var _0x2f6a20=eval('('+_0x410317['condition']+')');var _0x27c268=_0x2f6a20?_0x410317['priorityTrue']:_0x410317[_0xb9c3('0x10')];logger[_0xb9c3('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x3ab676,_0x410317[_0xb9c3('0x12')],_0x2f6a20,_0x27c268||'next');if(_0x27c268){var _0x13bbe7=_[_0xb9c3('0x13')](_0x485001[_0xb9c3('0x14')](),{'p':_0x27c268});if(_0x13bbe7>=0x0){logger[_0xb9c3('0x11')](_0xb9c3('0x15'),_0x3ab676,_0x27c268||'next',_0x13bbe7);_0x485001[_0xb9c3('0x16')](_0x13bbe7);}else{logger[_0xb9c3('0x11')](_0xb9c3('0x17'),_0x3ab676,_0x27c268||_0xb9c3('0x16'));_0x485001[_0xb9c3('0x18')]();}}else{_0x485001['next']();}}catch(_0x385e53){logger[_0xb9c3('0xd')](_0xb9c3('0x19'),_0x3ab676,_0x385e53['message']);_0x485001['stop']();}}}catch(_0x30f452){logger[_0xb9c3('0xd')](_0xb9c3('0x1a'),_0x3ab676,JSON[_0xb9c3('0x1b')](_0x30f452));_0x485001[_0xb9c3('0x18')]();}};}; \ No newline at end of file +var _0x1a62=['../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils'];(function(_0x29896d,_0x192ddd){var _0x5de0d0=function(_0x1a485b){while(--_0x1a485b){_0x29896d['push'](_0x29896d['shift']());}};_0x5de0d0(++_0x192ddd);}(_0x1a62,0x1af));var _0x21a6=function(_0x2d2ded,_0x5744dc){_0x2d2ded=_0x2d2ded-0x0;var _0x1dd004=_0x1a62[_0x2d2ded];return _0x1dd004;};'use strict';var schema=require(_0x21a6('0x0'));var _=require(_0x21a6('0x1'));var htmlToText=require(_0x21a6('0x2'));var utils=require(_0x21a6('0x3'));var logger=require(_0x21a6('0x4'))(_0x21a6('0x5'));var gotoif=schema({'condition':{'type':_0x21a6('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x21a6('0x7'),'message':_0x21a6('0x8')},'priorityFalse':{'type':'number','message':_0x21a6('0x9')}});exports[_0x21a6('0xa')]=function(_0x12ed2c,_0x2caeaa){return function(_0x4e89dd){try{var _0x25ca31={'condition':htmlToText[_0x21a6('0xb')](utils[_0x21a6('0xc')](_0x2caeaa[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2caeaa[0x1],'priorityFalse':_0x2caeaa[0x2]};var _0x54d04=gotoif[_0x21a6('0x0')](_0x25ca31,{'typecast':!![]});if(_0x54d04['length']){logger['error'](_0x21a6('0xd'),_0x12ed2c,_[_0x21a6('0xe')](_0x54d04,_0x21a6('0xf'))[_0x21a6('0x10')](',\x20'));_0x4e89dd[_0x21a6('0x11')]();}else{try{var _0x4b2673=eval('('+_0x25ca31[_0x21a6('0x12')]+')');var _0x3877b2=_0x4b2673?_0x25ca31[_0x21a6('0x13')]:_0x25ca31[_0x21a6('0x14')];logger['info'](_0x21a6('0x15'),_0x12ed2c,_0x25ca31[_0x21a6('0x12')],_0x4b2673,_0x3877b2||_0x21a6('0x16'));if(_0x3877b2){var _0x46da58=_[_0x21a6('0x17')](_0x4e89dd['rules'](),{'p':_0x3877b2});if(_0x46da58>=0x0){logger[_0x21a6('0x18')](_0x21a6('0x19'),_0x12ed2c,_0x3877b2||_0x21a6('0x16'),_0x46da58);_0x4e89dd[_0x21a6('0x16')](_0x46da58);}else{logger[_0x21a6('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x12ed2c,_0x3877b2||_0x21a6('0x16'));_0x4e89dd[_0x21a6('0x11')]();}}else{_0x4e89dd['next']();}}catch(_0x44dd5c){logger[_0x21a6('0x1a')](_0x21a6('0x1b'),_0x12ed2c,_0x44dd5c[_0x21a6('0xf')]);_0x4e89dd[_0x21a6('0x11')]();}}}catch(_0x53c05d){logger[_0x21a6('0x1a')](_0x21a6('0xd'),_0x12ed2c,JSON[_0x21a6('0x1c')](_0x53c05d));_0x4e89dd[_0x21a6('0x11')]();}};}; \ 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 4093cf8..3001821 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 _0xa2e9=['length','error','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','number'];(function(_0x2cbff5,_0x4a9277){var _0x5a0e5d=function(_0xea3337){while(--_0xea3337){_0x2cbff5['push'](_0x2cbff5['shift']());}};_0x5a0e5d(++_0x4a9277);}(_0xa2e9,0x1b0));var _0x9a2e=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xa2e9[_0x56e4e7];return _0x383618;};'use strict';var schema=require(_0x9a2e('0x0'));var _=require(_0x9a2e('0x1'));var logger=require(_0x9a2e('0x2'))(_0x9a2e('0x3'));var gotop=schema({'priority':{'type':_0x9a2e('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x4d4a8f,_0x53b083){return function(_0x4760eb){try{var _0x53898a={'priority':_0x53b083[0x0]};var _0x2ca23d=gotop[_0x9a2e('0x0')](_0x53898a,{'typecast':!![]});if(_0x2ca23d[_0x9a2e('0x5')]){logger[_0x9a2e('0x6')](_0x9a2e('0x7'),_0x4d4a8f,_[_0x9a2e('0x8')](_0x2ca23d,'message')[_0x9a2e('0x9')](',\x20'));_0x4760eb['stop']();}else{logger[_0x9a2e('0xa')](_0x9a2e('0xb'),_0x4d4a8f,_0x53898a[_0x9a2e('0xc')]);if(_0x53898a[_0x9a2e('0xc')]){var _0x12b197=_[_0x9a2e('0xd')](_0x4760eb[_0x9a2e('0xe')](),{'p':_0x53898a['priority']});if(_0x12b197>=0x0){logger[_0x9a2e('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4d4a8f,_0x53898a[_0x9a2e('0xc')]||'next',_0x12b197);_0x4760eb[_0x9a2e('0xf')](_0x12b197);}else{logger[_0x9a2e('0xa')](_0x9a2e('0x10'),_0x4d4a8f,_0x53898a['priority']||_0x9a2e('0xf'));_0x4760eb[_0x9a2e('0x11')]();}}else{_0x4760eb[_0x9a2e('0xf')]();}}}catch(_0x136537){logger[_0x9a2e('0x6')](_0x9a2e('0x7'),_0x4d4a8f,JSON[_0x9a2e('0x12')](_0x136537));_0x4760eb[_0x9a2e('0x11')]();}};}; \ No newline at end of file +var _0xbfc6=['next','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x186232,_0x569b3f){var _0x1c7c15=function(_0x5eaa12){while(--_0x5eaa12){_0x186232['push'](_0x186232['shift']());}};_0x1c7c15(++_0x569b3f);}(_0xbfc6,0x11e));var _0x6bfc=function(_0x5af44b,_0x520c57){_0x5af44b=_0x5af44b-0x0;var _0x3d7524=_0xbfc6[_0x5af44b];return _0x3d7524;};'use strict';var schema=require(_0x6bfc('0x0'));var _=require(_0x6bfc('0x1'));var logger=require(_0x6bfc('0x2'))(_0x6bfc('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6bfc('0x4')}});exports['consequence']=function(_0x2c1732,_0x4bfc23){return function(_0x430970){try{var _0x521873={'priority':_0x4bfc23[0x0]};var _0x39c0ea=gotop[_0x6bfc('0x0')](_0x521873,{'typecast':!![]});if(_0x39c0ea[_0x6bfc('0x5')]){logger[_0x6bfc('0x6')](_0x6bfc('0x7'),_0x2c1732,_[_0x6bfc('0x8')](_0x39c0ea,_0x6bfc('0x9'))[_0x6bfc('0xa')](',\x20'));_0x430970[_0x6bfc('0xb')]();}else{logger[_0x6bfc('0xc')](_0x6bfc('0xd'),_0x2c1732,_0x521873[_0x6bfc('0xe')]);if(_0x521873[_0x6bfc('0xe')]){var _0x22a208=_['findIndex'](_0x430970[_0x6bfc('0xf')](),{'p':_0x521873[_0x6bfc('0xe')]});if(_0x22a208>=0x0){logger[_0x6bfc('0xc')](_0x6bfc('0x10'),_0x2c1732,_0x521873['priority']||'next',_0x22a208);_0x430970['next'](_0x22a208);}else{logger['info'](_0x6bfc('0x11'),_0x2c1732,_0x521873[_0x6bfc('0xe')]||'next');_0x430970[_0x6bfc('0xb')]();}}else{_0x430970[_0x6bfc('0x12')]();}}}catch(_0x25f551){logger[_0x6bfc('0x6')](_0x6bfc('0x7'),_0x2c1732,JSON['stringify'](_0x25f551));_0x430970['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 8399494..2f6a605 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 _0xe7e8=['[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','account','AccountId','interaction','Message','create'];(function(_0x5a2601,_0x3fd7d1){var _0x27ab50=function(_0x53f6ca){while(--_0x53f6ca){_0x5a2601['push'](_0x5a2601['shift']());}};_0x27ab50(++_0x3fd7d1);}(_0xe7e8,0xe3));var _0x8e7e=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xe7e8[_0x277721];return _0x286051;};'use strict';var _=require('lodash');var utils=require(_0x8e7e('0x0'));var logger=require(_0x8e7e('0x1'))(_0x8e7e('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8e7e('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8e7e('0x4')),'whatsappMessage':require(_0x8e7e('0x5'))};exports[_0x8e7e('0x6')]=function(_0x6227b9,_0x2ff8db){return function(_0x11183f){try{var _0x11cdd0={'body':utils[_0x8e7e('0x7')](_0x2ff8db[0x0],this),'ContactId':this['contact']['id']};if(this[_0x8e7e('0x8')]==='chat'){_0x11cdd0[_0x8e7e('0x9')]=this[_0x8e7e('0xa')]['id'];}else{_0x11cdd0[_['upperFirst'](this[_0x8e7e('0x8')])+_0x8e7e('0xb')]=this[_0x8e7e('0xa')]['id'];}_0x11cdd0[_['upperFirst'](this[_0x8e7e('0x8')])+'InteractionId']=this[_0x8e7e('0xc')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x8e7e('0x8')]+_0x8e7e('0xd')][_0x8e7e('0xe')](_0x11cdd0)['then'](function(_0x31aec8){logger['info'](_0x8e7e('0xf'),_0x6227b9,_0x11cdd0[_0x8e7e('0x10')]);_0x11183f[_0x8e7e('0x11')]();})[_0x8e7e('0x12')](function(_0x56c596){logger[_0x8e7e('0x13')]('[%s][MESSAGE]\x20%s',_0x6227b9,JSON[_0x8e7e('0x14')](_0x56c596));_0x11183f[_0x8e7e('0x15')]();});}}catch(_0x377c83){logger[_0x8e7e('0x13')](_0x8e7e('0xf'),_0x6227b9,JSON[_0x8e7e('0x14')](_0x377c83));_0x11183f['stop']();}};}; \ No newline at end of file +var _0x3176=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x473e28,_0x2dde26){var _0x5ba94d=function(_0x3ed404){while(--_0x3ed404){_0x473e28['push'](_0x473e28['shift']());}};_0x5ba94d(++_0x2dde26);}(_0x3176,0x1d8));var _0x6317=function(_0x2358e3,_0x2a412e){_0x2358e3=_0x2358e3-0x0;var _0x7bbdaa=_0x3176[_0x2358e3];return _0x7bbdaa;};'use strict';var _=require(_0x6317('0x0'));var utils=require(_0x6317('0x1'));var logger=require(_0x6317('0x2'))(_0x6317('0x3'));var rpc={'chatMessage':require(_0x6317('0x4')),'openchannelMessage':require(_0x6317('0x5')),'mailMessage':require(_0x6317('0x6')),'smsMessage':require(_0x6317('0x7')),'faxMessage':require(_0x6317('0x8')),'whatsappMessage':require(_0x6317('0x9'))};exports[_0x6317('0xa')]=function(_0x3540e8,_0x46f4c9){return function(_0x354521){try{var _0x1c95dc={'body':utils[_0x6317('0xb')](_0x46f4c9[0x0],this),'ContactId':this['contact']['id']};if(this[_0x6317('0xc')]===_0x6317('0xd')){_0x1c95dc[_0x6317('0xe')]=this['account']['id'];}else{_0x1c95dc[_[_0x6317('0xf')](this['channel'])+'AccountId']=this[_0x6317('0x10')]['id'];}_0x1c95dc[_[_0x6317('0xf')](this[_0x6317('0xc')])+_0x6317('0x11')]=this[_0x6317('0x12')]['id'];if(rpc[this['channel']+_0x6317('0x13')]){return rpc[this[_0x6317('0xc')]+'Message'][_0x6317('0x14')](_0x1c95dc)[_0x6317('0x15')](function(_0x4aa69f){logger[_0x6317('0x16')](_0x6317('0x17'),_0x3540e8,_0x1c95dc['body']);_0x354521[_0x6317('0x18')]();})[_0x6317('0x19')](function(_0x32ad4a){logger[_0x6317('0x1a')](_0x6317('0x17'),_0x3540e8,JSON['stringify'](_0x32ad4a));_0x354521['stop']();});}}catch(_0x560b77){logger[_0x6317('0x1a')]('[%s][MESSAGE]\x20%s',_0x3540e8,JSON['stringify'](_0x560b77));_0x354521[_0x6317('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index a518aff..aed68fa 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 _0xd61b=['./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop'];(function(_0xe03ab4,_0x4e2a7c){var _0x1a0b54=function(_0x4e27ed){while(--_0x4e27ed){_0xe03ab4['push'](_0xe03ab4['shift']());}};_0x1a0b54(++_0x4e2a7c);}(_0xd61b,0xbd));var _0xbd61=function(_0x1d6dfb,_0x2d08e5){_0x1d6dfb=_0x1d6dfb-0x0;var _0x1a8fbb=_0xd61b[_0x1d6dfb];return _0x1a8fbb;};'use strict';var utils=require(_0xbd61('0x0'));var logger=require(_0xbd61('0x1'))('routing');exports[_0xbd61('0x2')]=function(_0xd76d63,_0x2e8a77){return function(_0x9a0d71){try{logger[_0xbd61('0x3')](_0xbd61('0x4'),_0xd76d63,utils[_0xbd61('0x5')](_0x2e8a77[0x0],this));_0x9a0d71[_0xbd61('0x6')]();}catch(_0x2c7dd6){logger[_0xbd61('0x7')](_0xbd61('0x4'),_0xd76d63,JSON['stringify'](_0x2c7dd6));_0x9a0d71[_0xbd61('0x8')]();}};}; \ No newline at end of file +var _0xc3fa=['[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','info','next','error'];(function(_0xd9bf7b,_0x111f89){var _0xc1ecb=function(_0x4dc5b1){while(--_0x4dc5b1){_0xd9bf7b['push'](_0xd9bf7b['shift']());}};_0xc1ecb(++_0x111f89);}(_0xc3fa,0xc9));var _0xac3f=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0xc3fa[_0x2637ac];return _0x4a5758;};'use strict';var utils=require(_0xac3f('0x0'));var logger=require(_0xac3f('0x1'))(_0xac3f('0x2'));exports['consequence']=function(_0x1c14cd,_0xce9bef){return function(_0xdf0e27){try{logger[_0xac3f('0x3')]('[%s][NOOP]\x20%s',_0x1c14cd,utils['getMustacheRender'](_0xce9bef[0x0],this));_0xdf0e27[_0xac3f('0x4')]();}catch(_0x1a0c67){logger[_0xac3f('0x5')](_0xac3f('0x6'),_0x1c14cd,JSON[_0xac3f('0x7')](_0x1a0c67));_0xdf0e27[_0xac3f('0x8')]();}};}; \ 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 351c967..2ae0bd4 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 _0xe66d=['number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','MessageId','message','channel','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','consequence','[%s][QUEUE]\x20%s','map','stop','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','defaults','localhost','socket.io-emitter','redis','account','from','emit','clone','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string'];(function(_0x5650cf,_0x2b8f11){var _0x460b10=function(_0x1091bc){while(--_0x1091bc){_0x5650cf['push'](_0x5650cf['shift']());}};_0x460b10(++_0x2b8f11);}(_0xe66d,0x14b));var _0xde66=function(_0x203387,_0x25ee77){_0x203387=_0x203387-0x0;var _0x358e6b=_0xe66d[_0x203387];return _0x358e6b;};'use strict';var schema=require(_0xde66('0x0'));var _=require(_0xde66('0x1'));var util=require('util');var seqqueue=require(_0xde66('0x2'));var moment=require(_0xde66('0x3'));var Redis=require(_0xde66('0x4'));var config=require(_0xde66('0x5'));var logger=require(_0xde66('0x6'))(_0xde66('0x7'));var strategy=require('./strategy');config['redis']=_[_0xde66('0x8')](config['redis'],{'host':_0xde66('0x9'),'port':0x18eb});var io=require(_0xde66('0xa'))(new Redis(config[_0xde66('0xb')]));var attributes=['id','queue_id',_0xde66('0xc'),'queue',_0xde66('0xd'),'joinAt'];function emit(_0x5d59ae,_0x478f30,_0x24996c){io['to'](_0x5d59ae)[_0xde66('0xe')](_0x478f30,_0x24996c);}function emitChannelQueueInteraction(_0x451f31,_0x36fbdf,_0x4359c6,_0x2abb32,_0xda12fd,_0x495777,_0x42bb45,_0x16befc){var _0x29db54=_[_0xde66('0xf')](_0x4359c6);_0x29db54['queue_id']=_0x16befc;_0x29db54['queue']=_0x36fbdf;_0x29db54[_0xde66('0xc')]=_0x2abb32;_0x29db54['id']=_0xda12fd;if(_0x495777){_0x42bb45[util['format']('%sQueuesWaitingInteractions',_0x451f31)][_0xda12fd]=_[_0xde66('0x10')](_0x29db54,attributes);}else{delete _0x42bb45[util[_0xde66('0x11')](_0xde66('0x12'),_0x451f31)][_0xda12fd];}emit(util[_0xde66('0x11')](_0xde66('0x13'),_0x451f31,_0x36fbdf),util['format'](_0xde66('0x14'),_0x451f31,_0x495777?_0xde66('0x15'):_0xde66('0x16')),_[_0xde66('0x10')](_0x29db54,attributes));}var rpc={'openchannelQueueReport':require(_0xde66('0x17')),'mailQueueReport':require(_0xde66('0x18')),'chatQueueReport':require(_0xde66('0x19')),'smsQueueReport':require(_0xde66('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xde66('0x1b'))};var queue=schema({'name':{'type':_0xde66('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xde66('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x23b55e,_0xf41bb4,_0x511eb8,_0x1358b9){if(_0x23b55e&&_0xf41bb4&&_0x511eb8){_0xf41bb4[_0xde66('0x1e')]+=0x1;var _0x2d7c52={'uniqueid':_0x23b55e,'from':_0x511eb8[_0xde66('0x1f')]?_0x511eb8[_0xde66('0x1f')][_0xde66('0xd')]:'','joinAt':moment()[_0xde66('0x11')](_0xde66('0x20')),'ContactId':_0x511eb8['contact']?_0x511eb8[_0xde66('0x21')]['id']:null,'ListId':_0x511eb8['list']?_0x511eb8[_0xde66('0x22')]['id']:null};_0x2d7c52[_[_0xde66('0x23')](_0x511eb8['channel'])+_0xde66('0x24')]=_0xf41bb4['id']||null;_0x2d7c52[_[_0xde66('0x23')](_0x511eb8['channel'])+'InteractionId']=_0x511eb8[_0xde66('0x25')]?_0x511eb8[_0xde66('0x25')]['id']:null;_0x2d7c52[_[_0xde66('0x23')](_0x511eb8['channel'])+_0xde66('0x26')]=_0x511eb8[_0xde66('0x27')]?_0x511eb8['message']['id']:null;_0x2d7c52[_[_0xde66('0x23')](_0x511eb8[_0xde66('0x28')])+(_0x511eb8[_0xde66('0x28')]!=='chat'?_0xde66('0x29'):_0xde66('0x2a'))]=_0x511eb8[_0xde66('0xc')]?_0x511eb8[_0xde66('0xc')]['id']:null;logger[_0xde66('0x2b')](util[_0xde66('0x11')](_0xde66('0x2c'),_0x23b55e,_0xf41bb4[_0xde66('0x2d')]));emitChannelQueueInteraction(_0x511eb8[_0xde66('0x28')],_0xf41bb4[_0xde66('0x2d')],_0x2d7c52,_0x511eb8[_0xde66('0xc')][_0xde66('0x2d')],_0x511eb8[_0xde66('0x27')]['id'],!![],_0x1358b9,_0xf41bb4['id']);if(rpc[_0x511eb8[_0xde66('0x28')]+_0xde66('0x2e')]){return rpc[_0x511eb8[_0xde66('0x28')]+'QueueReport']['create'](_0x2d7c52)[_0xde66('0x2f')](function(_0x466a65){logger[_0xde66('0x30')](_0xde66('0x31'));});}}}function stopRouting(_0x2834c6,_0x1e8b3c,_0x15b1c0,_0x136745){if(_0x2834c6&&_0x1e8b3c){_0x1e8b3c[_0xde66('0x1e')]-=0x1;var _0x58d030={'leaveAt':moment()['format'](_0xde66('0x20')),'acceptAt':moment()[_0xde66('0x11')](_0xde66('0x20')),'reason':_0xde66('0x32')};logger[_0xde66('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x2834c6,_0x1e8b3c[_0xde66('0x2d')]));emitChannelQueueInteraction(_0x15b1c0[_0xde66('0x28')],_0x1e8b3c[_0xde66('0x2d')],_0x15b1c0[_0xde66('0x1f')],_0x15b1c0[_0xde66('0xc')][_0xde66('0x2d')],_0x15b1c0[_0xde66('0x27')]['id'],![],_0x136745,_0x1e8b3c['id']);if(rpc[_0x15b1c0['channel']+_0xde66('0x2e')]){return rpc[_0x15b1c0[_0xde66('0x28')]+_0xde66('0x2e')][_0xde66('0x33')](_0x2834c6,_0x58d030)[_0xde66('0x2f')](function(_0x5f201a){logger[_0xde66('0x30')](_0xde66('0x34'));});}}}function endRouting(_0x23b25b,_0x166ffb,_0xafea4,_0x41527e){if(_0x23b25b&&_0x166ffb){_0x166ffb[_0xde66('0x1e')]-=0x1;var _0x51afa3={'leaveAt':moment()[_0xde66('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xde66('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xde66('0x35')};logger[_0xde66('0x2b')](util[_0xde66('0x11')](_0xde66('0x36'),_0x23b25b,_0x166ffb[_0xde66('0x2d')]));emitChannelQueueInteraction(_0xafea4['channel'],_0x166ffb[_0xde66('0x2d')],_0xafea4[_0xde66('0x1f')],_0xafea4[_0xde66('0xc')][_0xde66('0x2d')],_0xafea4[_0xde66('0x27')]['id'],![],_0x41527e);if(rpc[_0xafea4[_0xde66('0x28')]+'QueueReport']){return rpc[_0xafea4[_0xde66('0x28')]+_0xde66('0x2e')][_0xde66('0x33')](_0x23b25b,_0x51afa3)[_0xde66('0x2f')](function(_0x5016c8){logger[_0xde66('0x30')](_0xde66('0x34'));});}}}function handleFindQueue(_0x4f71ae){return function(_0x144845){return _0x144845[_0xde66('0x2d')]['toLowerCase']()===_0x4f71ae['toLowerCase']();};}exports[_0xde66('0x37')]=function(_0x2c9483,_0x4c797e,_0x10390d,_0x44c99a){return function(_0x1c537b){try{var _0x2d9ee3={'name':_0x4c797e[0x0],'timeout':_0x4c797e[0x1]};var _0x395b6d=queue[_0xde66('0x0')](_0x2d9ee3,{'typecast':!![]});if(_0x395b6d['length']){logger[_0xde66('0x30')](_0xde66('0x38'),_0x2c9483,_[_0xde66('0x39')](_0x395b6d,_0xde66('0x27'))['join'](',\x20'));_0x1c537b[_0xde66('0x3a')]();}else{var _0x4c54c8=_['find'](_0x10390d[_0x44c99a[_0xde66('0x28')]+_0xde66('0x3b')],handleFindQueue(_0x2d9ee3[_0xde66('0x2d')]));if(_0x4c54c8){startRouting(_0x2c9483,_0x4c54c8,_0x44c99a,_0x10390d);var _0x47a9dc=(_0x4c54c8['timeout']||0xa)*0x3e8;var _0x28338c=(_0x2d9ee3[_0xde66('0x35')]||0x14)*0x3e8;var _0x6c39fb,_0x4bd4ac;if(_0x47a9dc>_0x28338c){_0x28338c=_0x47a9dc;}var _0x3e3726=seqqueue[_0xde66('0x3c')](_0x47a9dc);_0x3e3726['id']=_0x2c9483;_0x3e3726[_0xde66('0x3d')]=_0x47a9dc;_0x3e3726[_0xde66('0x3e')]=_0x28338c;_0x3e3726[_0xde66('0x28')]=_0x44c99a['channel'];_0x10390d[_0xde66('0x3f')][_0x2c9483]['on'](_0xde66('0x40'),function(){logger[_0xde66('0x2b')](_0xde66('0x41'),_0x2c9483);stopRouting(_0x2c9483,_0x4c54c8,_0x44c99a,_0x10390d);clearTimeout(_0x6c39fb);_0x6c39fb=undefined;_0x3e3726[_0xde66('0x42')](!![]);if(_0x10390d['rules'][_0x2c9483]){delete _0x10390d[_0xde66('0x3f')][_0x2c9483];}_0x1c537b[_0xde66('0x3a')]();});_0x10390d['rules'][_0x2c9483]['on'](_0xde66('0x43'),function(){if(_0x10390d[_0xde66('0x3f')][_0x2c9483]){delete _0x10390d[_0xde66('0x3f')][_0x2c9483];}});_0x6c39fb=setTimeout(function(){logger[_0xde66('0x2b')](_0xde66('0x44'),_0x2c9483);endRouting(_0x2c9483,_0x4c54c8,_0x44c99a,_0x10390d);clearTimeout(_0x6c39fb);_0x3e3726['close'](!![]);_0x1c537b['next']();},_0x28338c);switch(_0x4c54c8['strategy']){case _0xde66('0x45'):strategy['rrmemory'](_0x3e3726,_0x4c54c8,_0x10390d,_0x44c99a);break;default:strategy['beepall'](_0x3e3726,_0x4c54c8,_0x10390d,_0x44c99a);}}else{logger[_0xde66('0x30')](_0xde66('0x46'),_0x2c9483,_0x2d9ee3[_0xde66('0x2d')]);_0x1c537b['stop']();}}}catch(_0x45c8d5){console[_0xde66('0x47')](_0x45c8d5);logger[_0xde66('0x30')](_0xde66('0x38'),_0x2c9483,_0x45c8d5['stack']);_0x1c537b['stop']();}};}; \ No newline at end of file +var _0xa057=['beepall','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue','from','emit','clone','queue_id','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory'];(function(_0x1c80e9,_0x3b7f77){var _0x509563=function(_0x33112d){while(--_0x33112d){_0x1c80e9['push'](_0x1c80e9['shift']());}};_0x509563(++_0x3b7f77);}(_0xa057,0x175));var _0x7a05=function(_0x1ba90e,_0x261c1b){_0x1ba90e=_0x1ba90e-0x0;var _0x250cc9=_0xa057[_0x1ba90e];return _0x250cc9;};'use strict';var schema=require(_0x7a05('0x0'));var _=require(_0x7a05('0x1'));var util=require(_0x7a05('0x2'));var seqqueue=require(_0x7a05('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x7a05('0x4'))(_0x7a05('0x5'));var strategy=require('./strategy');config[_0x7a05('0x6')]=_[_0x7a05('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7a05('0x8'))(new Redis(config[_0x7a05('0x6')]));var attributes=['id','queue_id','account',_0x7a05('0x9'),_0x7a05('0xa'),'joinAt'];function emit(_0x4ef1de,_0x59811a,_0x159cbb){io['to'](_0x4ef1de)[_0x7a05('0xb')](_0x59811a,_0x159cbb);}function emitChannelQueueInteraction(_0x141061,_0x200edf,_0x47bdda,_0x4ea3b7,_0x227390,_0x18decc,_0x2bcd59,_0x31a29b){var _0x1b55fb=_[_0x7a05('0xc')](_0x47bdda);_0x1b55fb[_0x7a05('0xd')]=_0x31a29b;_0x1b55fb['queue']=_0x200edf;_0x1b55fb['account']=_0x4ea3b7;_0x1b55fb['id']=_0x227390;if(_0x18decc){_0x2bcd59[util['format'](_0x7a05('0xe'),_0x141061)][_0x227390]=_[_0x7a05('0xf')](_0x1b55fb,attributes);}else{delete _0x2bcd59[util[_0x7a05('0x10')](_0x7a05('0xe'),_0x141061)][_0x227390];}emit(util[_0x7a05('0x10')](_0x7a05('0x11'),_0x141061,_0x200edf),util[_0x7a05('0x10')](_0x7a05('0x12'),_0x141061,_0x18decc?'save':_0x7a05('0x13')),_[_0x7a05('0xf')](_0x1b55fb,attributes));}var rpc={'openchannelQueueReport':require(_0x7a05('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x7a05('0x15')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x7a05('0x16'),'required':!![],'message':_0x7a05('0x17')},'timeout':{'type':_0x7a05('0x18'),'message':_0x7a05('0x19')}});function startRouting(_0x435dd5,_0x1c1d5,_0xd8ca3,_0x167134){if(_0x435dd5&&_0x1c1d5&&_0xd8ca3){_0x1c1d5[_0x7a05('0x1a')]+=0x1;var _0x3ec7f8={'uniqueid':_0x435dd5,'from':_0xd8ca3[_0x7a05('0x1b')]?_0xd8ca3['body'][_0x7a05('0xa')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xd8ca3[_0x7a05('0x1c')]?_0xd8ca3[_0x7a05('0x1c')]['id']:null,'ListId':_0xd8ca3['list']?_0xd8ca3[_0x7a05('0x1d')]['id']:null};_0x3ec7f8[_['upperFirst'](_0xd8ca3[_0x7a05('0x1e')])+_0x7a05('0x1f')]=_0x1c1d5['id']||null;_0x3ec7f8[_[_0x7a05('0x20')](_0xd8ca3[_0x7a05('0x1e')])+_0x7a05('0x21')]=_0xd8ca3[_0x7a05('0x22')]?_0xd8ca3[_0x7a05('0x22')]['id']:null;_0x3ec7f8[_[_0x7a05('0x20')](_0xd8ca3[_0x7a05('0x1e')])+_0x7a05('0x23')]=_0xd8ca3[_0x7a05('0x24')]?_0xd8ca3[_0x7a05('0x24')]['id']:null;_0x3ec7f8[_[_0x7a05('0x20')](_0xd8ca3[_0x7a05('0x1e')])+(_0xd8ca3[_0x7a05('0x1e')]!==_0x7a05('0x25')?_0x7a05('0x26'):_0x7a05('0x27'))]=_0xd8ca3['account']?_0xd8ca3[_0x7a05('0x28')]['id']:null;logger[_0x7a05('0x29')](util['format'](_0x7a05('0x2a'),_0x435dd5,_0x1c1d5['name']));emitChannelQueueInteraction(_0xd8ca3[_0x7a05('0x1e')],_0x1c1d5['name'],_0x3ec7f8,_0xd8ca3['account'][_0x7a05('0x2b')],_0xd8ca3[_0x7a05('0x24')]['id'],!![],_0x167134,_0x1c1d5['id']);if(rpc[_0xd8ca3[_0x7a05('0x1e')]+_0x7a05('0x2c')]){return rpc[_0xd8ca3['channel']+'QueueReport'][_0x7a05('0x2d')](_0x3ec7f8)[_0x7a05('0x2e')](function(_0x245a95){logger[_0x7a05('0x2f')]('create\x20queue\x20report');});}}}function stopRouting(_0x2d1b86,_0x3d1c1f,_0x3c8940,_0x16e8d8){if(_0x2d1b86&&_0x3d1c1f){_0x3d1c1f[_0x7a05('0x1a')]-=0x1;var _0x136caa={'leaveAt':moment()[_0x7a05('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x7a05('0x10')](_0x7a05('0x30')),'reason':'accepted'};logger[_0x7a05('0x29')](util[_0x7a05('0x10')](_0x7a05('0x31'),_0x2d1b86,_0x3d1c1f['name']));emitChannelQueueInteraction(_0x3c8940['channel'],_0x3d1c1f[_0x7a05('0x2b')],_0x3c8940[_0x7a05('0x1b')],_0x3c8940[_0x7a05('0x28')]['name'],_0x3c8940[_0x7a05('0x24')]['id'],![],_0x16e8d8,_0x3d1c1f['id']);if(rpc[_0x3c8940[_0x7a05('0x1e')]+_0x7a05('0x2c')]){return rpc[_0x3c8940[_0x7a05('0x1e')]+_0x7a05('0x2c')][_0x7a05('0x32')](_0x2d1b86,_0x136caa)[_0x7a05('0x2e')](function(_0x5f1157){logger[_0x7a05('0x2f')](_0x7a05('0x33'));});}}}function endRouting(_0x1fc33f,_0x2bca69,_0x2e6a3f,_0x4ef742){if(_0x1fc33f&&_0x2bca69){_0x2bca69['waiting']-=0x1;var _0x350a65={'leaveAt':moment()[_0x7a05('0x10')](_0x7a05('0x30')),'exitAt':moment()[_0x7a05('0x10')](_0x7a05('0x30')),'reason':_0x7a05('0x34')};logger[_0x7a05('0x29')](util['format'](_0x7a05('0x35'),_0x1fc33f,_0x2bca69[_0x7a05('0x2b')]));emitChannelQueueInteraction(_0x2e6a3f[_0x7a05('0x1e')],_0x2bca69[_0x7a05('0x2b')],_0x2e6a3f['body'],_0x2e6a3f[_0x7a05('0x28')]['name'],_0x2e6a3f[_0x7a05('0x24')]['id'],![],_0x4ef742);if(rpc[_0x2e6a3f[_0x7a05('0x1e')]+_0x7a05('0x2c')]){return rpc[_0x2e6a3f[_0x7a05('0x1e')]+'QueueReport']['update'](_0x1fc33f,_0x350a65)[_0x7a05('0x2e')](function(_0x13d656){logger[_0x7a05('0x2f')](_0x7a05('0x33'));});}}}function handleFindQueue(_0xf6088b){return function(_0x4367d9){return _0x4367d9['name'][_0x7a05('0x36')]()===_0xf6088b['toLowerCase']();};}exports[_0x7a05('0x37')]=function(_0x1e4c1a,_0x4c1184,_0x5187cb,_0x5214b4){return function(_0xcbba16){try{var _0x5519e0={'name':_0x4c1184[0x0],'timeout':_0x4c1184[0x1]};var _0xcb7ad1=queue['validate'](_0x5519e0,{'typecast':!![]});if(_0xcb7ad1[_0x7a05('0x38')]){logger[_0x7a05('0x2f')](_0x7a05('0x39'),_0x1e4c1a,_[_0x7a05('0x3a')](_0xcb7ad1,_0x7a05('0x24'))['join'](',\x20'));_0xcbba16[_0x7a05('0x3b')]();}else{var _0x218101=_[_0x7a05('0x3c')](_0x5187cb[_0x5214b4[_0x7a05('0x1e')]+_0x7a05('0x3d')],handleFindQueue(_0x5519e0[_0x7a05('0x2b')]));if(_0x218101){startRouting(_0x1e4c1a,_0x218101,_0x5214b4,_0x5187cb);var _0x4bc445=(_0x218101[_0x7a05('0x34')]||0xa)*0x3e8;var _0xc06dab=(_0x5519e0[_0x7a05('0x34')]||0x14)*0x3e8;var _0x21e2b2,_0x3c9d0a;if(_0x4bc445>_0xc06dab){_0xc06dab=_0x4bc445;}var _0x28c6a8=seqqueue['createQueue'](_0x4bc445);_0x28c6a8['id']=_0x1e4c1a;_0x28c6a8['atimeout']=_0x4bc445;_0x28c6a8[_0x7a05('0x3e')]=_0xc06dab;_0x28c6a8[_0x7a05('0x1e')]=_0x5214b4[_0x7a05('0x1e')];_0x5187cb[_0x7a05('0x3f')][_0x1e4c1a]['on']('end',function(){logger['info'](_0x7a05('0x40'),_0x1e4c1a);stopRouting(_0x1e4c1a,_0x218101,_0x5214b4,_0x5187cb);clearTimeout(_0x21e2b2);_0x21e2b2=undefined;_0x28c6a8[_0x7a05('0x41')](!![]);if(_0x5187cb[_0x7a05('0x3f')][_0x1e4c1a]){delete _0x5187cb[_0x7a05('0x3f')][_0x1e4c1a];}_0xcbba16[_0x7a05('0x3b')]();});_0x5187cb[_0x7a05('0x3f')][_0x1e4c1a]['on'](_0x7a05('0x42'),function(){if(_0x5187cb[_0x7a05('0x3f')][_0x1e4c1a]){delete _0x5187cb[_0x7a05('0x3f')][_0x1e4c1a];}});_0x21e2b2=setTimeout(function(){logger[_0x7a05('0x29')](_0x7a05('0x43'),_0x1e4c1a);endRouting(_0x1e4c1a,_0x218101,_0x5214b4,_0x5187cb);clearTimeout(_0x21e2b2);_0x28c6a8['close'](!![]);_0xcbba16[_0x7a05('0x44')]();},_0xc06dab);switch(_0x218101[_0x7a05('0x45')]){case'rrmemory':strategy[_0x7a05('0x46')](_0x28c6a8,_0x218101,_0x5187cb,_0x5214b4);break;default:strategy[_0x7a05('0x47')](_0x28c6a8,_0x218101,_0x5187cb,_0x5214b4);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1e4c1a,_0x5519e0[_0x7a05('0x2b')]);_0xcbba16['stop']();}}}catch(_0x37085a){console[_0x7a05('0x48')](_0x37085a);logger[_0x7a05('0x2f')](_0x7a05('0x39'),_0x1e4c1a,_0x37085a[_0x7a05('0x49')]);_0xcbba16[_0x7a05('0x3b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 0dcda22..d9c594d 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 _0xc6cf=['showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','busy','busyQueue'];(function(_0x4b3bda,_0x537a06){var _0x2fa4aa=function(_0x39836c){while(--_0x39836c){_0x4b3bda['push'](_0x4b3bda['shift']());}};_0x2fa4aa(++_0x537a06);}(_0xc6cf,0xaa));var _0xfc6c=function(_0x123822,_0x3132bc){_0x123822=_0x123822-0x0;var _0x308cb3=_0xc6cf[_0x123822];return _0x308cb3;};'use strict';var _=require(_0xfc6c('0x0'));var uuid=require(_0xfc6c('0x1'));var util=require(_0xfc6c('0x2'));var logger=require('../../../../../config/logger')(_0xfc6c('0x3'));var Agent=function(_0x2130ad,_0x351dc3,_0x32a7d1,_0x385725){this[_0xfc6c('0x4')]=uuid['v4']();this[_0xfc6c('0x5')]=_0x2130ad;this['agent']=_0x351dc3;this[_0xfc6c('0x6')]=_0x32a7d1;this[_0xfc6c('0x3')]=_0x385725;this[_0xfc6c('0x5')][_0xfc6c('0x7')](this[_0xfc6c('0x8')][_0xfc6c('0x9')](this),this[_0xfc6c('0xa')][_0xfc6c('0x9')](this));this['squeue']['on'](_0xfc6c('0xb'),this[_0xfc6c('0xa')][_0xfc6c('0x9')](this));this[_0xfc6c('0x5')]['on'](_0xfc6c('0xc'),this[_0xfc6c('0xd')][_0xfc6c('0x9')](this));};Agent['prototype'][_0xfc6c('0x7')]=function(){this[_0xfc6c('0x5')][_0xfc6c('0x7')](this['handleRun']['bind'](this),this[_0xfc6c('0xa')][_0xfc6c('0x9')](this));};Agent[_0xfc6c('0xe')][_0xfc6c('0xd')]=function(){this[_0xfc6c('0xa')](!![]);};Agent['prototype'][_0xfc6c('0x8')]=function(_0x162b21){logger[_0xfc6c('0xf')](_0xfc6c('0x10'),this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);if(_[_0xfc6c('0x12')](this[_0xfc6c('0x6')]['agents'][this['agent']['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);setTimeout(this[_0xfc6c('0x7')][_0xfc6c('0x9')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x6')][_0xfc6c('0x13')][this['agent']['id']],this[_0xfc6c('0x5')]['channel'],![])){this[_0xfc6c('0x6')][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']][_0xfc6c('0x14')]=!![];this[_0xfc6c('0x6')][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']][_0xfc6c('0x15')]=undefined;util[_0xfc6c('0x16')](this[_0xfc6c('0x4')],this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x6')]['agents'][this['agent']['id']],null,this[_0xfc6c('0x3')]);util[_0xfc6c('0x17')](this['squeue']['id'],this[_0xfc6c('0x6')][_0xfc6c('0x13')][this['agent']['id']],_0xfc6c('0x18')+(this[_0xfc6c('0x3')][_0xfc6c('0x19')]?_0xfc6c('0x1a'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);setTimeout(this[_0xfc6c('0x7')][_0xfc6c('0x9')](this),0x3e8);}}};Agent[_0xfc6c('0xe')][_0xfc6c('0xa')]=function(_0x39fcfc){if(_[_0xfc6c('0x12')](this['realtime'][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']])){return logger[_0xfc6c('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);}else{logger[_0xfc6c('0xf')](_0xfc6c('0x1b'),this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x11')]['id']);util[_0xfc6c('0x1c')](this[_0xfc6c('0x4')],this[_0xfc6c('0x5')]['id'],this[_0xfc6c('0x6')]['agents'][this[_0xfc6c('0x11')]['id']],null,this[_0xfc6c('0x3')]);this['realtime'][_0xfc6c('0x13')][this['agent']['id']][_0xfc6c('0x14')]=![];this[_0xfc6c('0x6')][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']][_0xfc6c('0x15')]=undefined;util['writeLog'](this['squeue']['id'],this['realtime'][_0xfc6c('0x13')][this[_0xfc6c('0x11')]['id']],_0x39fcfc?_0xfc6c('0x1d'):_0xfc6c('0x1e'));}if(!_0x39fcfc){setTimeout(this[_0xfc6c('0x7')][_0xfc6c('0x9')](this),0x3e8);}};function agent(_0x543e3e,_0x531f96,_0x5a6c74,_0x433db0){return new Agent(_0x543e3e,_0x531f96,_0x5a6c74,_0x433db0);}module[_0xfc6c('0x1f')]=agent; \ No newline at end of file +var _0x6c16=['routing','squeue','realtime','handleRun','handleTimeout','bind','timeout','drained','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agent','forcedOwnership','isAgentAvailable','channel','agents','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busy','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger'];(function(_0x482bd0,_0x113880){var _0x18e82c=function(_0x13479f){while(--_0x13479f){_0x482bd0['push'](_0x482bd0['shift']());}};_0x18e82c(++_0x113880);}(_0x6c16,0x125));var _0x66c1=function(_0x16d3c5,_0xfd30c9){_0x16d3c5=_0x16d3c5-0x0;var _0x369ea7=_0x6c16[_0x16d3c5];return _0x369ea7;};'use strict';var _=require(_0x66c1('0x0'));var uuid=require(_0x66c1('0x1'));var util=require(_0x66c1('0x2'));var logger=require(_0x66c1('0x3'))(_0x66c1('0x4'));var Agent=function(_0x3c4f06,_0x6b1b50,_0x165798,_0x42bbab){this['notificationId']=uuid['v4']();this[_0x66c1('0x5')]=_0x3c4f06;this['agent']=_0x6b1b50;this[_0x66c1('0x6')]=_0x165798;this[_0x66c1('0x4')]=_0x42bbab;this['squeue']['push'](this[_0x66c1('0x7')]['bind'](this),this[_0x66c1('0x8')][_0x66c1('0x9')](this));this[_0x66c1('0x5')]['on'](_0x66c1('0xa'),this[_0x66c1('0x8')][_0x66c1('0x9')](this));this[_0x66c1('0x5')]['on'](_0x66c1('0xb'),this['handleDrained'][_0x66c1('0x9')](this));};Agent[_0x66c1('0xc')][_0x66c1('0xd')]=function(){this['squeue']['push'](this['handleRun']['bind'](this),this[_0x66c1('0x8')][_0x66c1('0x9')](this));};Agent[_0x66c1('0xc')][_0x66c1('0xe')]=function(){this[_0x66c1('0x8')](!![]);};Agent[_0x66c1('0xc')][_0x66c1('0x7')]=function(_0x19f7fc){logger[_0x66c1('0xf')](_0x66c1('0x10'),this[_0x66c1('0x5')]['id'],this['agent']['id']);if(_[_0x66c1('0x11')](this[_0x66c1('0x6')]['agents'][this['agent']['id']])){logger[_0x66c1('0xf')](_0x66c1('0x12'),this[_0x66c1('0x5')]['id'],this[_0x66c1('0x13')]['id']);setTimeout(this[_0x66c1('0xd')][_0x66c1('0x9')](this),0x3e8);}else{if(this[_0x66c1('0x4')][_0x66c1('0x14')]||util[_0x66c1('0x15')](this[_0x66c1('0x5')]['id'],this[_0x66c1('0x6')]['agents'][this[_0x66c1('0x13')]['id']],this[_0x66c1('0x5')][_0x66c1('0x16')],![])){this['realtime'][_0x66c1('0x17')][this['agent']['id']]['busy']=!![];this[_0x66c1('0x6')][_0x66c1('0x17')][this[_0x66c1('0x13')]['id']][_0x66c1('0x18')]=undefined;util['showNotification'](this['notificationId'],this[_0x66c1('0x5')]['id'],this[_0x66c1('0x6')][_0x66c1('0x17')][this[_0x66c1('0x13')]['id']],null,this[_0x66c1('0x4')]);util[_0x66c1('0x19')](this[_0x66c1('0x5')]['id'],this[_0x66c1('0x6')]['agents'][this['agent']['id']],_0x66c1('0x1a')+(this['routing'][_0x66c1('0x14')]?_0x66c1('0x1b'):''));}else{logger[_0x66c1('0xf')](_0x66c1('0x1c'),this[_0x66c1('0x5')]['id'],this['agent']['id']);setTimeout(this['push'][_0x66c1('0x9')](this),0x3e8);}}};Agent['prototype'][_0x66c1('0x8')]=function(_0x2e0f05){if(_[_0x66c1('0x11')](this[_0x66c1('0x6')][_0x66c1('0x17')][this[_0x66c1('0x13')]['id']])){return logger['info'](_0x66c1('0x12'),this[_0x66c1('0x5')]['id'],this[_0x66c1('0x13')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x66c1('0x13')]['id']);util['hideNotification'](this['notificationId'],this[_0x66c1('0x5')]['id'],this[_0x66c1('0x6')][_0x66c1('0x17')][this[_0x66c1('0x13')]['id']],null,this['routing']);this[_0x66c1('0x6')]['agents'][this[_0x66c1('0x13')]['id']][_0x66c1('0x1d')]=![];this['realtime']['agents'][this[_0x66c1('0x13')]['id']][_0x66c1('0x18')]=undefined;util[_0x66c1('0x19')](this['squeue']['id'],this[_0x66c1('0x6')][_0x66c1('0x17')][this['agent']['id']],_0x2e0f05?_0x66c1('0x1e'):_0x66c1('0x1f'));}if(!_0x2e0f05){setTimeout(this[_0x66c1('0xd')][_0x66c1('0x9')](this),0x3e8);}};function agent(_0x499ab9,_0x45cdf3,_0x2d56ea,_0x23e5a0){return new Agent(_0x499ab9,_0x45cdf3,_0x2d56ea,_0x23e5a0);}module[_0x66c1('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index caf5e38..eeea725 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 _0x70e9=['showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','squeue','queue','realtime','push','handleTimeout','bind','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busy','busyQueue','name'];(function(_0x38530b,_0x5c9245){var _0x163dd3=function(_0x536b84){while(--_0x536b84){_0x38530b['push'](_0x38530b['shift']());}};_0x163dd3(++_0x5c9245);}(_0x70e9,0x193));var _0x970e=function(_0x3128a8,_0x12de68){_0x3128a8=_0x3128a8-0x0;var _0x3e8ce3=_0x70e9[_0x3128a8];return _0x3e8ce3;};'use strict';var _=require('lodash');var uuid=require(_0x970e('0x0'));var util=require(_0x970e('0x1'));var logger=require('../../../../../config/logger')(_0x970e('0x2'));var Beepall=function(_0x39c55a,_0x50eebd,_0x7d5b70,_0x50df5a){this[_0x970e('0x3')]=uuid['v4']();this[_0x970e('0x4')]=_0x39c55a;this[_0x970e('0x5')]=_0x50eebd;this[_0x970e('0x6')]=_0x7d5b70;this[_0x970e('0x2')]=_0x50df5a;this[_0x970e('0x4')][_0x970e('0x7')](this['handleRun']['bind'](this),this[_0x970e('0x8')][_0x970e('0x9')](this));this['squeue']['on'](_0x970e('0xa'),this[_0x970e('0x8')][_0x970e('0x9')](this));this['squeue']['on'](_0x970e('0xb'),this[_0x970e('0xc')][_0x970e('0x9')](this));};Beepall[_0x970e('0xd')][_0x970e('0x7')]=function(){this[_0x970e('0x4')]['push'](this[_0x970e('0xe')][_0x970e('0x9')](this),this[_0x970e('0x8')][_0x970e('0x9')](this));};Beepall[_0x970e('0xd')][_0x970e('0xc')]=function(_0x308191){this[_0x970e('0x8')](!![]);};Beepall['prototype'][_0x970e('0xe')]=function(_0x389a08){var _0x580dc0=!![];if(!_[_0x970e('0xf')](this[_0x970e('0x5')])&&!_[_0x970e('0xf')](this[_0x970e('0x5')]['Agents'])&&this[_0x970e('0x5')][_0x970e('0x10')][_0x970e('0x11')]>0x0){for(var _0x4244a2=0x0,_0x47885b;_0x4244a20x0){for(var _0x26ba54=0x0,_0x45c8b7;_0x26ba540x0&&_0x5f21a2[_0x337ed5+_0xf326('0x25')]>=_0x5f21a2[_0x337ed5+_0xf326('0x23')]){writeLog(_0xb1efcf,_0x5f21a2,_0x337ed5['toUpperCase']()+_0xf326('0x26'));return![];}}return!![];};exports[_0xf326('0x27')]=function(_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf){return sendNotification(!![],_0x212d5d,_0x581531,_0x1617d2,_0x55ad0f,_0x4a9abf);};exports[_0xf326('0x28')]=function(_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500){return sendNotification(![],_0x1ae23a,_0x2fa28e,_0x5dbe63,_0xc115d9,_0x292500);};exports['writeLog']=writeLog; \ No newline at end of file +var _0xfb11=['PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','mustache','../../../../../config/environment','routing','defaults','redis','socket.io-emitter','emit','format','name','user:save','split','\x20interaction','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','remove','info','isAgentAvailable','BUSY','online','OFFLINE','Pause'];(function(_0x4af373,_0x155403){var _0x5606f9=function(_0x2b0808){while(--_0x2b0808){_0x4af373['push'](_0x4af373['shift']());}};_0x5606f9(++_0x155403);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xfb11[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var utils=require(_0x1fb1('0x1'));var Mustache=require(_0x1fb1('0x2'));var Redis=require('ioredis');var config=require(_0x1fb1('0x3'));var logger=require('../../../../../config/logger')(_0x1fb1('0x4'));config['redis']=_[_0x1fb1('0x5')](config[_0x1fb1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1fb1('0x7'))(new Redis(config[_0x1fb1('0x6')]));function emit(_0x4c098d,_0x1859da,_0x2596c2){io['to'](_0x4c098d)[_0x1fb1('0x8')](_0x1859da,_0x2596c2);}function sendNotification(_0x236b20,_0x161e1b,_0x2d6be9,_0x438d15,_0x416625,_0x377aae){io['to'](util[_0x1fb1('0x9')]('user:%s',_0x438d15[_0x1fb1('0xa')]))['emit'](_0x1fb1('0xb'),_0x438d15);var _0x58b66e=_0x377aae||{};var _0xa977b1=_0x2d6be9[_0x1fb1('0xc')]('.');var _0xd39b52={'uniqueid':_0x161e1b,'channel':_0xa977b1[0x0],'id':_0xa977b1[0x1],'title':_0xa977b1[0x0]+_0x1fb1('0xd'),'interactionId':_0xa977b1[0x2],'queue':_0x416625?_0x416625[_0x1fb1('0xa')]:null,'sound':_0x58b66e[_0x1fb1('0xe')]['notificationSound'],'shake':_0x58b66e[_0x1fb1('0xe')][_0x1fb1('0xf')]};try{if(!_0x58b66e[_0x1fb1('0x10')]){_0x58b66e[_0x1fb1('0x10')]={};}if(_0x416625){_0x58b66e[_0x1fb1('0x10')][_0x1fb1('0x11')]=_0x416625;}else if(_0x58b66e[_0x1fb1('0x10')][_0x1fb1('0x11')]){delete _0x58b66e[_0x1fb1('0x10')]['queue'];}_0xd39b52['msg']=utils[_0x1fb1('0x12')](_0x58b66e[_0x1fb1('0xe')][_0x1fb1('0x13')],_0x58b66e);}catch(_0x5e0f16){_0xd39b52[_0x1fb1('0x14')]=_0x1fb1('0x15');logger[_0x1fb1('0x16')](util[_0x1fb1('0x9')](_0x1fb1('0x17'),_0x161e1b,_0x5e0f16[_0x1fb1('0x18')]));}io['to'](util[_0x1fb1('0x9')](_0x1fb1('0x19'),_0x438d15[_0x1fb1('0xa')]))['emit'](util[_0x1fb1('0x9')]('notification:%s',_0x236b20?'save':_0x1fb1('0x1a')),_0xd39b52);}function writeLog(_0x313d9a,_0x1eaf9e,_0x54ad97){return logger[_0x1fb1('0x1b')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x313d9a,_0x1eaf9e['name'],_0x54ad97));}exports[_0x1fb1('0x1c')]=function(_0x1f8e5a,_0x12c1d0,_0x10924f,_0x303a06){if(_0x12c1d0['busy']){writeLog(_0x1f8e5a,_0x12c1d0,_0x1fb1('0x1d'));return![];}if(!_0x12c1d0[_0x1fb1('0x1e')]){writeLog(_0x1f8e5a,_0x12c1d0,_0x1fb1('0x1f'));return![];}if(_0x12c1d0[_0x10924f+_0x1fb1('0x20')]){writeLog(_0x1f8e5a,_0x12c1d0,_0x1fb1('0x21'));return![];}if(_0x303a06&&_0x12c1d0[_0x1fb1('0x22')](_0x10924f+_0x1fb1('0x23'))&&_0x12c1d0[_0x1fb1('0x22')](_0x10924f+'CurrentCapacity')){if(_0x12c1d0[_0x10924f+_0x1fb1('0x23')]>0x0&&_0x12c1d0[_0x10924f+_0x1fb1('0x24')]>=_0x12c1d0[_0x10924f+_0x1fb1('0x23')]){writeLog(_0x1f8e5a,_0x12c1d0,_0x10924f[_0x1fb1('0x25')]()+_0x1fb1('0x26'));return![];}}return!![];};exports[_0x1fb1('0x27')]=function(_0x1a74c4,_0x15992c,_0xa7bba,_0x33a3b7,_0x5e99e7){return sendNotification(!![],_0x1a74c4,_0x15992c,_0xa7bba,_0x33a3b7,_0x5e99e7);};exports[_0x1fb1('0x28')]=function(_0x39fc43,_0xe8ec0a,_0x2f6c88,_0x520ee2,_0x106134){return sendNotification(![],_0x39fc43,_0xe8ec0a,_0x2f6c88,_0x520ee2,_0x106134);};exports[_0x1fb1('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 5087d42..176b7af 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 _0xdb76=['../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x5d5f46,_0x38974b){var _0x43203c=function(_0x5479ae){while(--_0x5479ae){_0x5d5f46['push'](_0x5d5f46['shift']());}};_0x43203c(++_0x38974b);}(_0xdb76,0x1be));var _0x6db7=function(_0xd9f60b,_0x1c73eb){_0xd9f60b=_0xd9f60b-0x0;var _0x3bdb98=_0xdb76[_0xd9f60b];return _0x3bdb98;};'use strict';var schema=require(_0x6db7('0x0'));var sh=require(_0x6db7('0x1'));var _=require(_0x6db7('0x2'));var utils=require(_0x6db7('0x3'));var logger=require(_0x6db7('0x4'))('routing');var system=schema({'command':{'type':_0x6db7('0x5'),'required':!![],'message':_0x6db7('0x6')}});exports[_0x6db7('0x7')]=function(_0x40f6ce,_0x57a095){return function(_0x117f1c){try{var _0x7bba2d={'command':_0x57a095[0x0]};var _0x8a8fe2=system[_0x6db7('0x0')](_0x7bba2d,{'typecast':!![]});if(_0x8a8fe2[_0x6db7('0x8')]){logger['error'](_0x6db7('0x9'),_0x40f6ce,_[_0x6db7('0xa')](_0x8a8fe2,'message')[_0x6db7('0xb')](',\x20'));logger[_0x6db7('0xc')](_0x6db7('0xd'),_0x40f6ce);_0x117f1c[_0x6db7('0xe')]();}else{var _0x1d2841=this;var _0x1abae4=utils['getMustacheRender'](_0x57a095[0x0],this);logger['info'](_0x6db7('0xf'),_0x40f6ce,_0x1abae4);sh[_0x6db7('0x10')](_['trim'](_0x1abae4),function(_0x3573ae,_0x129708){logger[_0x6db7('0xc')](_0x6db7('0x11'),_0x40f6ce,_0x3573ae);if(_0x3573ae==0x0){var _0x375f4a=_0x129708[_0x6db7('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x57a095[0x1])||_['isEmpty'](_0x57a095[0x1])){logger[_0x6db7('0xc')](_0x6db7('0x13'),_0x40f6ce);_0x1d2841[_0x6db7('0x14')][_0x57a095[0x1]]=_0x375f4a;}else{logger[_0x6db7('0xc')](_0x6db7('0x15'),_0x40f6ce,_0x57a095[0x1],_0x375f4a);_0x1d2841[_0x6db7('0x14')][_0x57a095[0x1]]=_0x375f4a;}}_0x117f1c[_0x6db7('0xe')]();});}}catch(_0x43f66c){logger[_0x6db7('0x16')](_0x6db7('0x9'),_0x40f6ce,_[_0x6db7('0x17')](_0x43f66c)?JSON[_0x6db7('0x18')](_0x43f66c):_0x43f66c);logger['info'](_0x6db7('0xd'),_0x40f6ce);_0x117f1c[_0x6db7('0xe')]();}};}; \ No newline at end of file +var _0xcf84=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender'];(function(_0x5a8b67,_0x1c1b1b){var _0xf0369c=function(_0x414505){while(--_0x414505){_0x5a8b67['push'](_0x5a8b67['shift']());}};_0xf0369c(++_0x1c1b1b);}(_0xcf84,0x175));var _0x4cf8=function(_0x73a0ff,_0x3a0d2a){_0x73a0ff=_0x73a0ff-0x0;var _0x1705aa=_0xcf84[_0x73a0ff];return _0x1705aa;};'use strict';var schema=require(_0x4cf8('0x0'));var sh=require(_0x4cf8('0x1'));var _=require(_0x4cf8('0x2'));var utils=require(_0x4cf8('0x3'));var logger=require(_0x4cf8('0x4'))(_0x4cf8('0x5'));var system=schema({'command':{'type':_0x4cf8('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x4cf8('0x7')]=function(_0x5d4967,_0x455916){return function(_0x202b11){try{var _0x2d6d19={'command':_0x455916[0x0]};var _0x55031c=system['validate'](_0x2d6d19,{'typecast':!![]});if(_0x55031c[_0x4cf8('0x8')]){logger[_0x4cf8('0x9')]('[%s][SYSTEM]\x20%s',_0x5d4967,_[_0x4cf8('0xa')](_0x55031c,_0x4cf8('0xb'))[_0x4cf8('0xc')](',\x20'));logger[_0x4cf8('0xd')](_0x4cf8('0xe'),_0x5d4967);_0x202b11[_0x4cf8('0xf')]();}else{var _0xf99ed8=this;var _0x37dc9a=utils[_0x4cf8('0x10')](_0x455916[0x0],this);logger['info'](_0x4cf8('0x11'),_0x5d4967,_0x37dc9a);sh[_0x4cf8('0x12')](_[_0x4cf8('0x13')](_0x37dc9a),function(_0x15650a,_0xd15e6b){logger[_0x4cf8('0xd')](_0x4cf8('0x14'),_0x5d4967,_0x15650a);if(_0x15650a==0x0){var _0x17290c=_0xd15e6b[_0x4cf8('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0x4cf8('0x16')](_0x455916[0x1])||_[_0x4cf8('0x17')](_0x455916[0x1])){logger['info'](_0x4cf8('0x18'),_0x5d4967);_0xf99ed8[_0x4cf8('0x19')][_0x455916[0x1]]=_0x17290c;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5d4967,_0x455916[0x1],_0x17290c);_0xf99ed8[_0x4cf8('0x19')][_0x455916[0x1]]=_0x17290c;}}_0x202b11['next']();});}}catch(_0x13d6aa){logger[_0x4cf8('0x9')]('[%s][SYSTEM]\x20%s',_0x5d4967,_['isObject'](_0x13d6aa)?JSON['stringify'](_0x13d6aa):_0x13d6aa);logger[_0x4cf8('0xd')](_0x4cf8('0xe'),_0x5d4967);_0x202b11['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index a46da72..76e08cd 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 _0x52e1=['next','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','error','isObject','validate','lodash','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x3a2764,_0x16654){var _0x39071e=function(_0x53f638){while(--_0x53f638){_0x3a2764['push'](_0x3a2764['shift']());}};_0x39071e(++_0x16654);}(_0x52e1,0x189));var _0x152e=function(_0x420781,_0x99f6db){_0x420781=_0x420781-0x0;var _0xa1e054=_0x52e1[_0x420781];return _0xa1e054;};'use strict';var schema=require(_0x152e('0x0'));var _=require(_0x152e('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x152e('0x2')),'faxInteraction':require(_0x152e('0x3')),'whatsappInteraction':require(_0x152e('0x4'))};var logger=require(_0x152e('0x5'))(_0x152e('0x6'));var tag=schema({'tag':{'type':_0x152e('0x7'),'required':!![],'message':_0x152e('0x8')}});exports['consequence']=function(_0x3b4b88,_0xd36228,_0x5a2102,_0x30c0ae){return function(_0x5f3bc6){try{var _0x337d73={'tag':_0xd36228[0x0]};var _0x2512a4=tag[_0x152e('0x0')](_0x337d73,{'typecast':!![]});if(_0x2512a4[_0x152e('0x9')]){logger['error'](_0x152e('0xa'),_0x3b4b88,_['map'](_0x2512a4,_0x152e('0xb'))[_0x152e('0xc')](',\x20'));logger[_0x152e('0xd')](_0x152e('0xe'),_0x3b4b88);_0x5f3bc6[_0x152e('0xf')]();}else{var _0x18a715={'ids':[_0xd36228[0x0]]};if(rpc[_0x30c0ae[_0x152e('0x10')]+'Interaction']){rpc[_0x30c0ae['channel']+'Interaction'][_0x152e('0x11')](_0x30c0ae[_0x152e('0x12')]['id'],_0x18a715)['then'](function(_0x386244){logger[_0x152e('0xd')](_0x152e('0x13'),_0x3b4b88,_0xd36228[0x1],_0x30c0ae[_0x152e('0x10')],_0x30c0ae[_0x152e('0x12')]['id']);})['catch'](function(_0x118f2d){logger['error']('[%s][TAG]\x20%s',_0x3b4b88,JSON[_0x152e('0x14')](_0x118f2d));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3b4b88);})[_0x152e('0x15')](function(){_0x5f3bc6[_0x152e('0xf')]();});}}}catch(_0x33657e){logger[_0x152e('0x16')](_0x152e('0xa'),_0x3b4b88,_[_0x152e('0x17')](_0x33657e)?JSON[_0x152e('0x14')](_0x33657e):_0x33657e);logger[_0x152e('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3b4b88);_0x5f3bc6['next']();}};}; \ No newline at end of file +var _0x406f=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','stringify','finally','[%s][TAG]\x20%s','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x3abde8,_0x58ee31){var _0x575bc0=function(_0x4a83c7){while(--_0x4a83c7){_0x3abde8['push'](_0x3abde8['shift']());}};_0x575bc0(++_0x58ee31);}(_0x406f,0x175));var _0xf406=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x406f[_0x49b207];return _0x2dc8fa;};'use strict';var schema=require(_0xf406('0x0'));var _=require(_0xf406('0x1'));var rpc={'chatInteraction':require(_0xf406('0x2')),'openchannelInteraction':require(_0xf406('0x3')),'smsInteraction':require(_0xf406('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xf406('0x5')),'whatsappInteraction':require(_0xf406('0x6'))};var logger=require(_0xf406('0x7'))(_0xf406('0x8'));var tag=schema({'tag':{'type':_0xf406('0x9'),'required':!![],'message':_0xf406('0xa')}});exports[_0xf406('0xb')]=function(_0x21e8ef,_0x5632dd,_0x548696,_0x4164c0){return function(_0x2437db){try{var _0x2898dd={'tag':_0x5632dd[0x0]};var _0x29415=tag['validate'](_0x2898dd,{'typecast':!![]});if(_0x29415[_0xf406('0xc')]){logger['error']('[%s][TAG]\x20%s',_0x21e8ef,_[_0xf406('0xd')](_0x29415,'message')[_0xf406('0xe')](',\x20'));logger['info'](_0xf406('0xf'),_0x21e8ef);_0x2437db[_0xf406('0x10')]();}else{var _0x23af64={'ids':[_0x5632dd[0x0]]};if(rpc[_0x4164c0[_0xf406('0x11')]+'Interaction']){rpc[_0x4164c0[_0xf406('0x11')]+_0xf406('0x12')][_0xf406('0x13')](_0x4164c0[_0xf406('0x14')]['id'],_0x23af64)['then'](function(_0xf17fc0){logger[_0xf406('0x15')](_0xf406('0x16'),_0x21e8ef,_0x5632dd[0x1],_0x4164c0[_0xf406('0x11')],_0x4164c0[_0xf406('0x14')]['id']);})['catch'](function(_0x5029f7){logger[_0xf406('0x17')]('[%s][TAG]\x20%s',_0x21e8ef,JSON[_0xf406('0x18')](_0x5029f7));logger[_0xf406('0x15')](_0xf406('0xf'),_0x21e8ef);})[_0xf406('0x19')](function(){_0x2437db[_0xf406('0x10')]();});}}}catch(_0x36cbe4){logger[_0xf406('0x17')](_0xf406('0x1a'),_0x21e8ef,_['isObject'](_0x36cbe4)?JSON[_0xf406('0x18')](_0x36cbe4):_0x36cbe4);logger[_0xf406('0x15')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x21e8ef);_0x2437db[_0xf406('0x10')]();}};}; \ 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 9b0ef75..219c052 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0xdced13,_0x3de9ad){var _0x3170f4=function(_0xe51054){while(--_0xe51054){_0xdced13['push'](_0xdced13['shift']());}};_0x3170f4(++_0x3de9ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x5119bf,_0x250357){var _0x546286=function(_0x10d223){while(--_0x10d223){_0x5119bf['push'](_0x5119bf['shift']());}};_0x546286(++_0x250357);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 8f33662..c759089 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 _0x5af8=['http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','tag','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','stringify','complete','No\x20applications\x20to\x20execute','stack','error','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','emit','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions'];(function(_0x2f2ed0,_0x1c6435){var _0x250b0d=function(_0x1909c1){while(--_0x1909c1){_0x2f2ed0['push'](_0x2f2ed0['shift']());}};_0x250b0d(++_0x1c6435);}(_0x5af8,0x119));var _0x85af=function(_0x5926fd,_0x2a52a6){_0x5926fd=_0x5926fd-0x0;var _0x697f6d=_0x5af8[_0x5926fd];return _0x697f6d;};'use strict';var _=require(_0x85af('0x0'));var util=require('util');var path=require(_0x85af('0x1'));var fs=require('fs');var jayson=require(_0x85af('0x2'));var BPromise=require(_0x85af('0x3'));var uuid=require(_0x85af('0x4'));var config=require(_0x85af('0x5'));var logger=require(_0x85af('0x6'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x85af('0x7')),'chatQueueReport':require(_0x85af('0x8')),'smsQueueReport':require(_0x85af('0x9')),'faxQueueReport':require(_0x85af('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x85af('0xb'));function getId(_0x2a4396,_0x38d60e,_0x579af8){return util[_0x85af('0xc')](_0x85af('0xd'),_0x2a4396,_0x38d60e||0x0,_0x579af8||0x0);}function getIntervals(_0x38e15d,_0x4282e1){var _0x52455a=[];if(!_[_0x85af('0xe')](_0x4282e1[_0x85af('0xf')])&&!_[_0x85af('0xe')](_0x38e15d[_0x4282e1['IntervalId']])&&!_[_0x85af('0xe')](_0x38e15d[_0x4282e1[_0x85af('0xf')]][_0x85af('0x10')])){_0x52455a=_[_0x85af('0x11')](_0x38e15d[_0x4282e1['IntervalId']][_0x85af('0x10')],_0x85af('0x12'));}else if(!_[_0x85af('0xe')](_0x4282e1[_0x85af('0x12')])){_0x52455a=[_0x4282e1['interval']];}return _0x52455a;}exports['listen']=function(_0x3373ea){_0x3373ea[_0x85af('0x13')]={};return new BPromise(function(_0x550bb7,_0x21b6dd){var _0x30a041={'Start':function(_0x43e6b8){var _0x4df341=this;return new Promise(function(_0x3ee108,_0x2a7cfd){if(_0x43e6b8){try{var _0x1f6e75=[];var _0x24d561=getId(_0x43e6b8[_0x85af('0x14')],_0x43e6b8[_0x85af('0x15')]?_0x43e6b8[_0x85af('0x15')]['id']:0x0,_0x43e6b8[_0x85af('0x16')]?_0x43e6b8[_0x85af('0x16')]['id']:0x0);if(_0x43e6b8[_0x85af('0x17')]&&_[_0x85af('0x18')](_0x43e6b8[_0x85af('0x17')])&&_0x43e6b8[_0x85af('0x17')][_0x85af('0x19')]){for(var _0x2624f1=0x0;_0x2624f1<_0x43e6b8['applications'][_0x85af('0x19')];_0x2624f1+=0x1){var _0x36d38f=_0x43e6b8[_0x85af('0x17')][_0x2624f1];if(fs[_0x85af('0x1a')](path[_0x85af('0x1b')](__dirname,_0x85af('0x17'),_0x36d38f[_0x85af('0x1c')]+'.js'))){var _0x2ca1fa=[];switch(_0x36d38f['app'][_0x85af('0x1d')]()){case _0x85af('0x1e'):var _0x1e9ebe=_0x36d38f[_0x85af('0x1f')][_0x85af('0x20')](',');if(_0x43e6b8[_0x85af('0x14')]===_0x85af('0x21')){_0x2ca1fa['push'](_0x1e9ebe[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe[0x1]);_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe['slice'](0x2,_0x1e9ebe[_0x85af('0x19')])['join'](','));}else{_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x1e9ebe[_0x85af('0x23')](0x1,_0x1e9ebe[_0x85af('0x19')])[_0x85af('0x1b')](','));}break;case'dialogflow':var _0x13addd=_0x36d38f[_0x85af('0x1f')]['split'](',');_0x2ca1fa['push'](_0x13addd[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x13addd[0x1]);_0x2ca1fa['push'](_0x13addd[_0x85af('0x23')](0x2,_0x13addd[_0x85af('0x19')])[_0x85af('0x1b')](','));break;case _0x85af('0x24'):var _0x73bdcd=_0x36d38f[_0x85af('0x1f')]['split'](',');_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x1]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x2]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[0x3]);_0x2ca1fa[_0x85af('0x22')](_0x73bdcd[_0x85af('0x23')](0x4,_0x73bdcd['length'])[_0x85af('0x1b')](','));break;case'amazonlex':var _0x3ccbb6=_0x36d38f[_0x85af('0x1f')][_0x85af('0x20')](',');_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[0x0]);_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[0x1]);_0x2ca1fa['push'](_0x3ccbb6[0x2]);_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[0x3]);_0x2ca1fa[_0x85af('0x22')](_0x3ccbb6[_0x85af('0x23')](0x4,_0x3ccbb6['length'])['join'](','));break;case _0x85af('0x15'):_0x2ca1fa[_0x85af('0x22')](_0x36d38f[_0x85af('0x1f')]);break;case _0x85af('0x25'):_0x2ca1fa[_0x85af('0x22')](_0x36d38f['TagId']);_0x2ca1fa[_0x85af('0x22')](_0x36d38f[_0x85af('0x1f')]);break;default:_0x2ca1fa=_[_0x85af('0xe')](_0x36d38f[_0x85af('0x1f')])?[]:_0x36d38f[_0x85af('0x1f')][_0x85af('0x20')](',');}var _0x2d290b={'id':util[_0x85af('0xc')](_0x85af('0x26'),_0x24d561,_0x36d38f['id'],_0x36d38f['app']),'condition':require(_0x85af('0x27'))[_0x85af('0x28')](_0x24d561,getIntervals(_0x3373ea[_0x85af('0x29')],_0x36d38f),_0x3373ea),'consequence':require(_0x85af('0x2a')+_0x36d38f[_0x85af('0x1c')])[_0x85af('0x2b')](_0x24d561,_0x2ca1fa,_0x3373ea,_0x43e6b8),'p':_0x36d38f['priority']||0x0};logger['info'](_0x85af('0x2c'),_0x2d290b['id'],'on\x20interval',getIntervals(_0x3373ea[_0x85af('0x29')],_0x36d38f)['join'](_0x85af('0x2d')));_0x1f6e75[_0x85af('0x22')](_0x2d290b);}else{logger['error'](_0x85af('0x2e'),path[_0x85af('0x1b')](__dirname,_0x85af('0x17'),_0x36d38f['app']+'.js'));}}_0x3373ea[_0x85af('0x13')][_0x24d561]=new RuleEngine(_0x1f6e75);_0x3373ea[_0x85af('0x13')][_0x24d561]['execute'](_0x43e6b8,function(_0x1deef6){logger[_0x85af('0x2f')](_0x85af('0x30'),JSON[_0x85af('0x31')](_0x1deef6['matchPath']));if(_0x3373ea[_0x85af('0x13')][_0x24d561]){_0x3373ea[_0x85af('0x13')][_0x24d561]['emit'](_0x85af('0x32'));}});return _0x3ee108({'code':0xc8,'message':_0x43e6b8});}else{logger['info'](_0x85af('0x33'));return _0x3ee108({'code':0xc8,'message':_0x43e6b8});}}catch(_0x380700){logger['error'](_0x380700[_0x85af('0x34')]);return _0x2a7cfd(_0x4df341[_0x85af('0x35')](0x1f4,_0x380700));}}return _0x2a7cfd('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2bc682){var _0x3554c4=this;return new Promise(function(_0x420090,_0x4c499f){if(_0x2bc682['agent']&&_0x2bc682[_0x85af('0x36')]['id']){if(_0x3373ea[_0x85af('0x37')][_0x2bc682[_0x85af('0x36')]['id']]){_0x3373ea[_0x85af('0x37')][_0x2bc682['agent']['id']][_0x85af('0x38')]=![];_0x3373ea[_0x85af('0x37')][_0x2bc682[_0x85af('0x36')]['id']][_0x85af('0x39')]=undefined;}}if(_0x2bc682[_0x85af('0x15')]&&_0x2bc682['message']['id']){try{var _0x23e580=getId(_0x2bc682[_0x85af('0x14')],_0x2bc682[_0x85af('0x15')]?_0x2bc682[_0x85af('0x15')]['id']:0x0,_0x2bc682[_0x85af('0x16')]?_0x2bc682[_0x85af('0x16')]['id']:0x0);if(_0x3373ea['rules'][_0x23e580]){_0x3373ea['rules'][_0x23e580]['emit']('end');if(rpc[_0x2bc682[_0x85af('0x14')]+_0x85af('0x3a')]){rpc[_0x2bc682[_0x85af('0x14')]+_0x85af('0x3a')][_0x85af('0x3b')](_0x23e580,{'UserId':_0x2bc682[_0x85af('0x15')][_0x85af('0x3c')]})[_0x85af('0x3d')](function(_0x59866d){logger[_0x85af('0x35')](_0x85af('0x3e'));});}}return _0x420090({'code':0xc8,'message':_0x2bc682});}catch(_0x7143ee){logger[_0x85af('0x35')](_0x7143ee[_0x85af('0x34')]);return _0x4c499f(_0x3554c4['error'](0x1f4,_0x7143ee));}}logger['error'](_0x85af('0x3f'));return _0x4c499f(_0x3554c4[_0x85af('0x35')](0x1f4,_0x85af('0x3f')));});},'RejectMessage':function(_0x379739){var _0x2b1a2b=this;return new Promise(function(_0x153023,_0x32316f){if(_0x379739[_0x85af('0x36')]&&_0x379739[_0x85af('0x36')]['id']){try{if(_0x3373ea[_0x85af('0x37')][_0x379739[_0x85af('0x36')]['id']]){_0x3373ea['agents'][_0x379739[_0x85af('0x36')]['id']][_0x85af('0x38')]=![];_0x3373ea['agents'][_0x379739[_0x85af('0x36')]['id']][_0x85af('0x39')]=undefined;}return _0x153023({'code':0xc8,'message':_0x379739});}catch(_0x15b67b){logger[_0x85af('0x35')](_0x15b67b[_0x85af('0x34')]);return _0x32316f(_0x2b1a2b[_0x85af('0x35')](0x1f4,_0x15b67b));}}logger[_0x85af('0x35')](_0x85af('0x3f'));return _0x32316f(_0x2b1a2b[_0x85af('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x454964){var _0x416039=this;return new Promise(function(_0x284074,_0x476161){if(_0x454964['channel']&&_0x454964['interaction']&&_0x454964[_0x85af('0x16')]['id']){try{var _0x217ee3=getId(_0x454964[_0x85af('0x14')],_0x454964[_0x85af('0x15')]?_0x454964['message']['id']:0x0,_0x454964['interaction']?_0x454964[_0x85af('0x16')]['id']:0x0);if(_0x3373ea[_0x85af('0x13')][_0x217ee3]){_0x3373ea['rules'][_0x217ee3][_0x85af('0x40')](_0x85af('0x41'));}return _0x284074({'code':0xc8,'message':_0x454964});}catch(_0x440430){logger[_0x85af('0x35')](_0x440430[_0x85af('0x34')]);return _0x476161(_0x416039['error'](0x1f4,_0x440430));}}logger[_0x85af('0x35')](_0x85af('0x3f'));return _0x476161(_0x416039[_0x85af('0x35')](0x1f4,_0x85af('0x3f')));});},'AgentCapacity':function(_0x2be6ca){var _0xd31c23=this;return new Promise(function(_0x27e045,_0x120872){if(_0x3373ea['agents'][_0x85af('0x42')](_0x2be6ca['id'])){for(var _0x3f1007 in _0x2be6ca[_0x85af('0x43')]){if(_0x2be6ca[_0x85af('0x43')][_0x85af('0x42')](_0x3f1007)){if(_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']][_0x85af('0x42')](_0x3f1007+'CurrentCapacity')){_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']][_0x3f1007+_0x85af('0x44')]=parseInt(_0x2be6ca[_0x85af('0x43')][_0x3f1007],0xa);}}}_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']][_0x85af('0x45')]();return _0x27e045({'code':0xc8,'message':_0x3373ea[_0x85af('0x37')][_0x2be6ca['id']]});}else{return _0x120872(_0xd31c23[_0x85af('0x35')](0x1f4,_0x85af('0x46')));}});},'Agents':function(_0x1ced41){return new Promise(function(_0x1f6a6d,_0x4b12ed){var _0x13a81c=_[_0x85af('0x47')](_0x3373ea['agents']);_0x1f6a6d({'count':_0x13a81c[_0x85af('0x19')],'rows':_0x13a81c});});},'ChatQueues':function(_0x5b83cc){return new Promise(function(_0x5ab712,_0x4f97f9){var _0x1e8e95=[];for(var _0x25c6ad in _0x3373ea[_0x85af('0x48')]){if(_0x3373ea['chatQueues']['hasOwnProperty'](_0x25c6ad)){var _0x1a727d=_0x3373ea[_0x85af('0x48')][_0x25c6ad];var _0x41d014={'id':_0x1a727d['id'],'available':_0x1a727d[_0x85af('0x49')],'loggedIn':_0x1a727d[_0x85af('0x4a')],'name':_0x1a727d[_0x85af('0x4b')],'paused':_0x1a727d['paused'],'waiting':_0x1a727d[_0x85af('0x4c')]};_0x1e8e95[_0x85af('0x22')](_0x41d014);}}_0x5ab712({'count':_0x1e8e95[_0x85af('0x19')],'rows':_0x1e8e95});});},'MailQueues':function(_0x414d3b){return new Promise(function(_0x3e2e5c,_0x39c97c){var _0x28f50d=[];for(var _0x502620 in _0x3373ea[_0x85af('0x4d')]){if(_0x3373ea['mailQueues'][_0x85af('0x42')](_0x502620)){var _0x2fcee1=_0x3373ea[_0x85af('0x4d')][_0x502620];var _0x3a8c0f={'id':_0x2fcee1['id'],'available':_0x2fcee1[_0x85af('0x49')],'loggedIn':_0x2fcee1['loggedIn'],'name':_0x2fcee1[_0x85af('0x4b')],'paused':_0x2fcee1[_0x85af('0x4e')],'waiting':_0x2fcee1[_0x85af('0x4c')]};_0x28f50d['push'](_0x3a8c0f);}}_0x3e2e5c({'count':_0x28f50d[_0x85af('0x19')],'rows':_0x28f50d});});},'OpenchannelQueues':function(_0x2b9e38){return new Promise(function(_0x3b31f5,_0x33cc14){var _0xb0e152=[];for(var _0x718f22 in _0x3373ea[_0x85af('0x4f')]){if(_0x3373ea['openchannelQueues'][_0x85af('0x42')](_0x718f22)){var _0x52d9d0=_0x3373ea[_0x85af('0x4f')][_0x718f22];var _0x2a7ac8={'id':_0x52d9d0['id'],'available':_0x52d9d0['available'],'loggedIn':_0x52d9d0[_0x85af('0x4a')],'name':_0x52d9d0[_0x85af('0x4b')],'paused':_0x52d9d0[_0x85af('0x4e')],'waiting':_0x52d9d0[_0x85af('0x4c')]};_0xb0e152[_0x85af('0x22')](_0x2a7ac8);}}_0x3b31f5({'count':_0xb0e152[_0x85af('0x19')],'rows':_0xb0e152});});},'SmsQueues':function(_0xee54ce){return new Promise(function(_0x18770e,_0x5b3086){var _0xd5576a=[];for(var _0xdee267 in _0x3373ea[_0x85af('0x50')]){if(_0x3373ea['smsQueues'][_0x85af('0x42')](_0xdee267)){var _0xe1db96=_0x3373ea['smsQueues'][_0xdee267];var _0x8744aa={'id':_0xe1db96['id'],'available':_0xe1db96[_0x85af('0x49')],'loggedIn':_0xe1db96[_0x85af('0x4a')],'name':_0xe1db96[_0x85af('0x4b')],'paused':_0xe1db96[_0x85af('0x4e')],'waiting':_0xe1db96[_0x85af('0x4c')]};_0xd5576a['push'](_0x8744aa);}}_0x18770e({'count':_0xd5576a[_0x85af('0x19')],'rows':_0xd5576a});});},'FaxQueues':function(_0x4a5868){return new Promise(function(_0x1f343d,_0x4a7b61){var _0x13adde=[];for(var _0x43bd43 in _0x3373ea[_0x85af('0x51')]){if(_0x3373ea[_0x85af('0x51')][_0x85af('0x42')](_0x43bd43)){var _0x4a87e6=_0x3373ea[_0x85af('0x51')][_0x43bd43];var _0x57dc74={'id':_0x4a87e6['id'],'available':_0x4a87e6['available'],'loggedIn':_0x4a87e6[_0x85af('0x4a')],'name':_0x4a87e6[_0x85af('0x4b')],'paused':_0x4a87e6[_0x85af('0x4e')],'waiting':_0x4a87e6['waiting']};_0x13adde[_0x85af('0x22')](_0x57dc74);}}_0x1f343d({'count':_0x13adde[_0x85af('0x19')],'rows':_0x13adde});});},'WhatsappQueues':function(_0x54d7fe){return new Promise(function(_0x38a2a7,_0x437982){var _0x58feab=[];for(var _0x549c44 in _0x3373ea[_0x85af('0x52')]){if(_0x3373ea[_0x85af('0x52')][_0x85af('0x42')](_0x549c44)){var _0x23e8c9=_0x3373ea['whatsappQueues'][_0x549c44];var _0x116703={'id':_0x23e8c9['id'],'available':_0x23e8c9[_0x85af('0x49')],'loggedIn':_0x23e8c9[_0x85af('0x4a')],'name':_0x23e8c9['name'],'paused':_0x23e8c9['paused'],'waiting':_0x23e8c9['waiting']};_0x58feab[_0x85af('0x22')](_0x116703);}}_0x38a2a7({'count':_0x58feab['length'],'rows':_0x58feab});});},'ChatQueuesWaitingInteractions':function(_0x46e83c){return new Promise(function(_0x4a5c85,_0xebea8d){var _0x358b3d=_[_0x85af('0x47')](_0x3373ea[_0x85af('0x53')]);_0x4a5c85({'count':_0x358b3d['length'],'rows':_0x358b3d});});},'MailQueuesWaitingInteractions':function(_0x55ab02){return new Promise(function(_0x1aa1e2,_0x168d83){var _0x4c46bb=_['values'](_0x3373ea[_0x85af('0x54')]);_0x1aa1e2({'count':_0x4c46bb[_0x85af('0x19')],'rows':_0x4c46bb});});},'OpenchannelQueuesWaitingInteractions':function(_0x491285){return new Promise(function(_0x3166e3,_0x26815f){var _0x460e7f=_[_0x85af('0x47')](_0x3373ea[_0x85af('0x55')]);_0x3166e3({'count':_0x460e7f[_0x85af('0x19')],'rows':_0x460e7f});});},'SmsQueuesWaitingInteractions':function(_0x22f168){return new Promise(function(_0x4154c6,_0xd6e592){var _0x560669=_[_0x85af('0x47')](_0x3373ea['smsQueuesWaitingInteractions']);_0x4154c6({'count':_0x560669[_0x85af('0x19')],'rows':_0x560669});});},'FaxQueuesWaitingInteractions':function(_0x43f8eb){return new Promise(function(_0x3f9940,_0x37227c){var _0x250e83=_['values'](_0x3373ea['faxQueuesWaitingInteractions']);_0x3f9940({'count':_0x250e83['length'],'rows':_0x250e83});});},'WhatsappQueuesWaitingInteractions':function(_0x4efd83){return new Promise(function(_0x413c18,_0x361c9f){var _0x47f6bd=_['values'](_0x3373ea[_0x85af('0x56')]);_0x413c18({'count':_0x47f6bd[_0x85af('0x19')],'rows':_0x47f6bd});});}};var _0x2e79ba=jayson['server'](_0x30a041)[_0x85af('0x57')]();_0x2e79ba['on'](_0x85af('0x35'),function(_0x4f9e3a){logger[_0x85af('0x35')](JSON[_0x85af('0x31')](_0x4f9e3a));return _0x21b6dd(_0x4f9e3a);});_0x2e79ba['listen'](0x232c,_0x85af('0x58'),function(){console[_0x85af('0x59')](_0x85af('0x5a'),0x232c);return _0x550bb7(_0x85af('0x5b')+0x232c);});});}; \ No newline at end of file +var _0xcbc4=['whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','condition','intervals','./applications/','Push\x20new\x20rule','on\x20interval','error','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','waiting','mailQueues','available','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions'];(function(_0xe39260,_0x32c511){var _0xf3b0d7=function(_0x58253a){while(--_0x58253a){_0xe39260['push'](_0xe39260['shift']());}};_0xf3b0d7(++_0x32c511);}(_0xcbc4,0x12d));var _0x4cbc=function(_0x361083,_0x4f23fb){_0x361083=_0x361083-0x0;var _0x265d54=_0xcbc4[_0x361083];return _0x265d54;};'use strict';var _=require('lodash');var util=require(_0x4cbc('0x0'));var path=require(_0x4cbc('0x1'));var fs=require('fs');var jayson=require(_0x4cbc('0x2'));var BPromise=require(_0x4cbc('0x3'));var uuid=require(_0x4cbc('0x4'));var config=require(_0x4cbc('0x5'));var logger=require(_0x4cbc('0x6'))(_0x4cbc('0x7'));var rpc={'openchannelQueueReport':require(_0x4cbc('0x8')),'mailQueueReport':require(_0x4cbc('0x9')),'chatQueueReport':require(_0x4cbc('0xa')),'smsQueueReport':require(_0x4cbc('0xb')),'faxQueueReport':require(_0x4cbc('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x4cbc('0xd'));function getId(_0x411455,_0x2be505,_0x12cd80){return util[_0x4cbc('0xe')](_0x4cbc('0xf'),_0x411455,_0x2be505||0x0,_0x12cd80||0x0);}function getIntervals(_0x1c002d,_0xc51464){var _0x5f0c96=[];if(!_['isNil'](_0xc51464[_0x4cbc('0x10')])&&!_[_0x4cbc('0x11')](_0x1c002d[_0xc51464[_0x4cbc('0x10')]])&&!_[_0x4cbc('0x11')](_0x1c002d[_0xc51464[_0x4cbc('0x10')]][_0x4cbc('0x12')])){_0x5f0c96=_['map'](_0x1c002d[_0xc51464[_0x4cbc('0x10')]][_0x4cbc('0x12')],_0x4cbc('0x13'));}else if(!_[_0x4cbc('0x11')](_0xc51464[_0x4cbc('0x13')])){_0x5f0c96=[_0xc51464[_0x4cbc('0x13')]];}return _0x5f0c96;}exports[_0x4cbc('0x14')]=function(_0x382a41){_0x382a41[_0x4cbc('0x15')]={};return new BPromise(function(_0x356afd,_0x152b94){var _0x4e1916={'Start':function(_0x32c468){var _0x5ba309=this;return new Promise(function(_0x17dad0,_0x115284){if(_0x32c468){try{var _0x3475e4=[];var _0x25af20=getId(_0x32c468[_0x4cbc('0x16')],_0x32c468[_0x4cbc('0x17')]?_0x32c468['message']['id']:0x0,_0x32c468[_0x4cbc('0x18')]?_0x32c468[_0x4cbc('0x18')]['id']:0x0);if(_0x32c468[_0x4cbc('0x19')]&&_[_0x4cbc('0x1a')](_0x32c468['applications'])&&_0x32c468[_0x4cbc('0x19')][_0x4cbc('0x1b')]){for(var _0x2503f7=0x0;_0x2503f7<_0x32c468[_0x4cbc('0x19')][_0x4cbc('0x1b')];_0x2503f7+=0x1){var _0x1998ee=_0x32c468[_0x4cbc('0x19')][_0x2503f7];if(fs[_0x4cbc('0x1c')](path[_0x4cbc('0x1d')](__dirname,_0x4cbc('0x19'),_0x1998ee[_0x4cbc('0x1e')]+_0x4cbc('0x1f')))){var _0x1def44=[];switch(_0x1998ee[_0x4cbc('0x1e')]['toLowerCase']()){case _0x4cbc('0x20'):var _0x19303f=_0x1998ee[_0x4cbc('0x21')][_0x4cbc('0x22')](',');if(_0x32c468[_0x4cbc('0x16')]===_0x4cbc('0x23')){_0x1def44['push'](_0x19303f[0x0]);_0x1def44[_0x4cbc('0x24')](_0x19303f[0x1]);_0x1def44[_0x4cbc('0x24')](_0x19303f[_0x4cbc('0x25')](0x2,_0x19303f[_0x4cbc('0x1b')])[_0x4cbc('0x1d')](','));}else{_0x1def44['push'](_0x19303f[0x0]);_0x1def44['push'](_0x19303f[_0x4cbc('0x25')](0x1,_0x19303f[_0x4cbc('0x1b')])[_0x4cbc('0x1d')](','));}break;case _0x4cbc('0x26'):var _0x5bb961=_0x1998ee[_0x4cbc('0x21')][_0x4cbc('0x22')](',');_0x1def44[_0x4cbc('0x24')](_0x5bb961[0x0]);_0x1def44[_0x4cbc('0x24')](_0x5bb961[0x1]);_0x1def44['push'](_0x5bb961[_0x4cbc('0x25')](0x2,_0x5bb961[_0x4cbc('0x1b')])[_0x4cbc('0x1d')](','));break;case _0x4cbc('0x27'):var _0x379366=_0x1998ee[_0x4cbc('0x21')][_0x4cbc('0x22')](',');_0x1def44[_0x4cbc('0x24')](_0x379366[0x0]);_0x1def44[_0x4cbc('0x24')](_0x379366[0x1]);_0x1def44['push'](_0x379366[0x2]);_0x1def44[_0x4cbc('0x24')](_0x379366[0x3]);_0x1def44[_0x4cbc('0x24')](_0x379366[_0x4cbc('0x25')](0x4,_0x379366['length'])['join'](','));break;case _0x4cbc('0x28'):var _0x3d7c2f=_0x1998ee[_0x4cbc('0x21')]['split'](',');_0x1def44[_0x4cbc('0x24')](_0x3d7c2f[0x0]);_0x1def44[_0x4cbc('0x24')](_0x3d7c2f[0x1]);_0x1def44[_0x4cbc('0x24')](_0x3d7c2f[0x2]);_0x1def44[_0x4cbc('0x24')](_0x3d7c2f[0x3]);_0x1def44[_0x4cbc('0x24')](_0x3d7c2f['slice'](0x4,_0x3d7c2f[_0x4cbc('0x1b')])[_0x4cbc('0x1d')](','));break;case _0x4cbc('0x17'):_0x1def44[_0x4cbc('0x24')](_0x1998ee[_0x4cbc('0x21')]);break;case _0x4cbc('0x29'):_0x1def44[_0x4cbc('0x24')](_0x1998ee[_0x4cbc('0x2a')]);_0x1def44[_0x4cbc('0x24')](_0x1998ee[_0x4cbc('0x21')]);break;default:_0x1def44=_[_0x4cbc('0x11')](_0x1998ee[_0x4cbc('0x21')])?[]:_0x1998ee[_0x4cbc('0x21')][_0x4cbc('0x22')](',');}var _0x274e08={'id':util[_0x4cbc('0xe')](_0x4cbc('0x2b'),_0x25af20,_0x1998ee['id'],_0x1998ee[_0x4cbc('0x1e')]),'condition':require('./interval')[_0x4cbc('0x2c')](_0x25af20,getIntervals(_0x382a41[_0x4cbc('0x2d')],_0x1998ee),_0x382a41),'consequence':require(_0x4cbc('0x2e')+_0x1998ee[_0x4cbc('0x1e')])['consequence'](_0x25af20,_0x1def44,_0x382a41,_0x32c468),'p':_0x1998ee['priority']||0x0};logger['info'](_0x4cbc('0x2f'),_0x274e08['id'],_0x4cbc('0x30'),getIntervals(_0x382a41[_0x4cbc('0x2d')],_0x1998ee)[_0x4cbc('0x1d')]('\x20|\x20'));_0x3475e4[_0x4cbc('0x24')](_0x274e08);}else{logger[_0x4cbc('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x4cbc('0x1d')](__dirname,_0x4cbc('0x19'),_0x1998ee[_0x4cbc('0x1e')]+'.js'));}}_0x382a41[_0x4cbc('0x15')][_0x25af20]=new RuleEngine(_0x3475e4);_0x382a41[_0x4cbc('0x15')][_0x25af20][_0x4cbc('0x32')](_0x32c468,function(_0x30b4b9){logger[_0x4cbc('0x33')](_0x4cbc('0x34'),JSON[_0x4cbc('0x35')](_0x30b4b9[_0x4cbc('0x36')]));if(_0x382a41[_0x4cbc('0x15')][_0x25af20]){_0x382a41[_0x4cbc('0x15')][_0x25af20][_0x4cbc('0x37')](_0x4cbc('0x38'));}});return _0x17dad0({'code':0xc8,'message':_0x32c468});}else{logger[_0x4cbc('0x33')](_0x4cbc('0x39'));return _0x17dad0({'code':0xc8,'message':_0x32c468});}}catch(_0xbb1153){logger[_0x4cbc('0x31')](_0xbb1153[_0x4cbc('0x3a')]);return _0x115284(_0x5ba309['error'](0x1f4,_0xbb1153));}}return _0x115284(_0x4cbc('0x3b'));});},'AcceptMessage':function(_0x45c17a){var _0xbf126e=this;return new Promise(function(_0x24ba15,_0x4f7851){if(_0x45c17a[_0x4cbc('0x3c')]&&_0x45c17a[_0x4cbc('0x3c')]['id']){if(_0x382a41[_0x4cbc('0x3d')][_0x45c17a[_0x4cbc('0x3c')]['id']]){_0x382a41['agents'][_0x45c17a[_0x4cbc('0x3c')]['id']][_0x4cbc('0x3e')]=![];_0x382a41['agents'][_0x45c17a['agent']['id']][_0x4cbc('0x3f')]=undefined;}}if(_0x45c17a[_0x4cbc('0x17')]&&_0x45c17a[_0x4cbc('0x17')]['id']){try{var _0x290038=getId(_0x45c17a[_0x4cbc('0x16')],_0x45c17a[_0x4cbc('0x17')]?_0x45c17a['message']['id']:0x0,_0x45c17a[_0x4cbc('0x18')]?_0x45c17a[_0x4cbc('0x18')]['id']:0x0);if(_0x382a41[_0x4cbc('0x15')][_0x290038]){_0x382a41[_0x4cbc('0x15')][_0x290038][_0x4cbc('0x37')](_0x4cbc('0x40'));if(rpc[_0x45c17a['channel']+_0x4cbc('0x41')]){rpc[_0x45c17a[_0x4cbc('0x16')]+_0x4cbc('0x41')][_0x4cbc('0x42')](_0x290038,{'UserId':_0x45c17a[_0x4cbc('0x17')][_0x4cbc('0x43')]})[_0x4cbc('0x44')](function(_0x19b59c){logger[_0x4cbc('0x31')](_0x4cbc('0x45'));});}}return _0x24ba15({'code':0xc8,'message':_0x45c17a});}catch(_0x3149b7){logger[_0x4cbc('0x31')](_0x3149b7[_0x4cbc('0x3a')]);return _0x4f7851(_0xbf126e[_0x4cbc('0x31')](0x1f4,_0x3149b7));}}logger['error'](_0x4cbc('0x46'));return _0x4f7851(_0xbf126e[_0x4cbc('0x31')](0x1f4,_0x4cbc('0x46')));});},'RejectMessage':function(_0x20f8b4){var _0x5cd781=this;return new Promise(function(_0x2f8903,_0x1e96f6){if(_0x20f8b4[_0x4cbc('0x3c')]&&_0x20f8b4[_0x4cbc('0x3c')]['id']){try{if(_0x382a41[_0x4cbc('0x3d')][_0x20f8b4[_0x4cbc('0x3c')]['id']]){_0x382a41[_0x4cbc('0x3d')][_0x20f8b4[_0x4cbc('0x3c')]['id']][_0x4cbc('0x3e')]=![];_0x382a41['agents'][_0x20f8b4[_0x4cbc('0x3c')]['id']]['busyQueue']=undefined;}return _0x2f8903({'code':0xc8,'message':_0x20f8b4});}catch(_0x1ab952){logger[_0x4cbc('0x31')](_0x1ab952['stack']);return _0x1e96f6(_0x5cd781[_0x4cbc('0x31')](0x1f4,_0x1ab952));}}logger[_0x4cbc('0x31')](_0x4cbc('0x46'));return _0x1e96f6(_0x5cd781[_0x4cbc('0x31')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x6d1786){var _0x235f05=this;return new Promise(function(_0x312ef7,_0x1a7d9f){if(_0x6d1786[_0x4cbc('0x16')]&&_0x6d1786[_0x4cbc('0x18')]&&_0x6d1786[_0x4cbc('0x18')]['id']){try{var _0x54c490=getId(_0x6d1786[_0x4cbc('0x16')],_0x6d1786['message']?_0x6d1786[_0x4cbc('0x17')]['id']:0x0,_0x6d1786[_0x4cbc('0x18')]?_0x6d1786[_0x4cbc('0x18')]['id']:0x0);if(_0x382a41[_0x4cbc('0x15')][_0x54c490]){_0x382a41[_0x4cbc('0x15')][_0x54c490]['emit'](_0x4cbc('0x40'));}return _0x312ef7({'code':0xc8,'message':_0x6d1786});}catch(_0x315164){logger[_0x4cbc('0x31')](_0x315164[_0x4cbc('0x3a')]);return _0x1a7d9f(_0x235f05[_0x4cbc('0x31')](0x1f4,_0x315164));}}logger['error'](_0x4cbc('0x46'));return _0x1a7d9f(_0x235f05[_0x4cbc('0x31')](0x1f4,_0x4cbc('0x46')));});},'AgentCapacity':function(_0x320dc6){var _0x5ad0e3=this;return new Promise(function(_0x14d79f,_0x1e4bd3){if(_0x382a41[_0x4cbc('0x3d')]['hasOwnProperty'](_0x320dc6['id'])){for(var _0x3bdadc in _0x320dc6['capacity']){if(_0x320dc6[_0x4cbc('0x47')][_0x4cbc('0x48')](_0x3bdadc)){if(_0x382a41['agents'][_0x320dc6['id']][_0x4cbc('0x48')](_0x3bdadc+_0x4cbc('0x49'))){_0x382a41['agents'][_0x320dc6['id']][_0x3bdadc+_0x4cbc('0x49')]=parseInt(_0x320dc6['capacity'][_0x3bdadc],0xa);}}}_0x382a41['agents'][_0x320dc6['id']][_0x4cbc('0x4a')]();return _0x14d79f({'code':0xc8,'message':_0x382a41[_0x4cbc('0x3d')][_0x320dc6['id']]});}else{return _0x1e4bd3(_0x5ad0e3[_0x4cbc('0x31')](0x1f4,_0x4cbc('0x4b')));}});},'Agents':function(_0x40e4f0){return new Promise(function(_0x2148a4,_0x4a3fc9){var _0x510065=_[_0x4cbc('0x4c')](_0x382a41[_0x4cbc('0x3d')]);_0x2148a4({'count':_0x510065[_0x4cbc('0x1b')],'rows':_0x510065});});},'ChatQueues':function(_0x54b13d){return new Promise(function(_0x522bb0,_0x160e1c){var _0x1c62e9=[];for(var _0x305033 in _0x382a41[_0x4cbc('0x4d')]){if(_0x382a41['chatQueues']['hasOwnProperty'](_0x305033)){var _0x5e9af1=_0x382a41['chatQueues'][_0x305033];var _0x45656e={'id':_0x5e9af1['id'],'available':_0x5e9af1['available'],'loggedIn':_0x5e9af1[_0x4cbc('0x4e')],'name':_0x5e9af1[_0x4cbc('0x4f')],'paused':_0x5e9af1['paused'],'waiting':_0x5e9af1[_0x4cbc('0x50')]};_0x1c62e9[_0x4cbc('0x24')](_0x45656e);}}_0x522bb0({'count':_0x1c62e9[_0x4cbc('0x1b')],'rows':_0x1c62e9});});},'MailQueues':function(_0x5adca1){return new Promise(function(_0x2e96ae,_0x53cec6){var _0x391a9a=[];for(var _0x18b2f9 in _0x382a41[_0x4cbc('0x51')]){if(_0x382a41[_0x4cbc('0x51')][_0x4cbc('0x48')](_0x18b2f9)){var _0x35b375=_0x382a41['mailQueues'][_0x18b2f9];var _0x53f381={'id':_0x35b375['id'],'available':_0x35b375[_0x4cbc('0x52')],'loggedIn':_0x35b375[_0x4cbc('0x4e')],'name':_0x35b375[_0x4cbc('0x4f')],'paused':_0x35b375[_0x4cbc('0x53')],'waiting':_0x35b375[_0x4cbc('0x50')]};_0x391a9a[_0x4cbc('0x24')](_0x53f381);}}_0x2e96ae({'count':_0x391a9a[_0x4cbc('0x1b')],'rows':_0x391a9a});});},'OpenchannelQueues':function(_0x40de74){return new Promise(function(_0x1e6b2d,_0x354622){var _0x30b6ac=[];for(var _0x50e53c in _0x382a41[_0x4cbc('0x54')]){if(_0x382a41[_0x4cbc('0x54')][_0x4cbc('0x48')](_0x50e53c)){var _0x51b535=_0x382a41[_0x4cbc('0x54')][_0x50e53c];var _0xd4a8ff={'id':_0x51b535['id'],'available':_0x51b535['available'],'loggedIn':_0x51b535[_0x4cbc('0x4e')],'name':_0x51b535[_0x4cbc('0x4f')],'paused':_0x51b535[_0x4cbc('0x53')],'waiting':_0x51b535['waiting']};_0x30b6ac[_0x4cbc('0x24')](_0xd4a8ff);}}_0x1e6b2d({'count':_0x30b6ac[_0x4cbc('0x1b')],'rows':_0x30b6ac});});},'SmsQueues':function(_0x2b6688){return new Promise(function(_0x476226,_0x134f06){var _0x2ffc1c=[];for(var _0x263d8d in _0x382a41[_0x4cbc('0x55')]){if(_0x382a41[_0x4cbc('0x55')][_0x4cbc('0x48')](_0x263d8d)){var _0x4773ac=_0x382a41['smsQueues'][_0x263d8d];var _0x41868f={'id':_0x4773ac['id'],'available':_0x4773ac[_0x4cbc('0x52')],'loggedIn':_0x4773ac[_0x4cbc('0x4e')],'name':_0x4773ac[_0x4cbc('0x4f')],'paused':_0x4773ac['paused'],'waiting':_0x4773ac[_0x4cbc('0x50')]};_0x2ffc1c[_0x4cbc('0x24')](_0x41868f);}}_0x476226({'count':_0x2ffc1c[_0x4cbc('0x1b')],'rows':_0x2ffc1c});});},'FaxQueues':function(_0x2ba493){return new Promise(function(_0x3a6b70,_0xac25b1){var _0x44b54e=[];for(var _0x47aa94 in _0x382a41['faxQueues']){if(_0x382a41['faxQueues'][_0x4cbc('0x48')](_0x47aa94)){var _0x3604dd=_0x382a41[_0x4cbc('0x56')][_0x47aa94];var _0x2e012d={'id':_0x3604dd['id'],'available':_0x3604dd[_0x4cbc('0x52')],'loggedIn':_0x3604dd[_0x4cbc('0x4e')],'name':_0x3604dd['name'],'paused':_0x3604dd['paused'],'waiting':_0x3604dd[_0x4cbc('0x50')]};_0x44b54e[_0x4cbc('0x24')](_0x2e012d);}}_0x3a6b70({'count':_0x44b54e[_0x4cbc('0x1b')],'rows':_0x44b54e});});},'WhatsappQueues':function(_0x2f412d){return new Promise(function(_0x17ece6,_0x2a31e8){var _0xfb59a7=[];for(var _0xf85182 in _0x382a41[_0x4cbc('0x57')]){if(_0x382a41['whatsappQueues'][_0x4cbc('0x48')](_0xf85182)){var _0x105c0a=_0x382a41[_0x4cbc('0x57')][_0xf85182];var _0xed0e79={'id':_0x105c0a['id'],'available':_0x105c0a[_0x4cbc('0x52')],'loggedIn':_0x105c0a['loggedIn'],'name':_0x105c0a['name'],'paused':_0x105c0a['paused'],'waiting':_0x105c0a[_0x4cbc('0x50')]};_0xfb59a7[_0x4cbc('0x24')](_0xed0e79);}}_0x17ece6({'count':_0xfb59a7[_0x4cbc('0x1b')],'rows':_0xfb59a7});});},'ChatQueuesWaitingInteractions':function(_0x4714ba){return new Promise(function(_0x120cc6,_0x439f5e){var _0x276f11=_['values'](_0x382a41[_0x4cbc('0x58')]);_0x120cc6({'count':_0x276f11[_0x4cbc('0x1b')],'rows':_0x276f11});});},'MailQueuesWaitingInteractions':function(_0x2d5b1b){return new Promise(function(_0x76174,_0x534863){var _0x197960=_[_0x4cbc('0x4c')](_0x382a41['mailQueuesWaitingInteractions']);_0x76174({'count':_0x197960['length'],'rows':_0x197960});});},'OpenchannelQueuesWaitingInteractions':function(_0x3a55ef){return new Promise(function(_0x4a0946,_0x51bacf){var _0x487c91=_[_0x4cbc('0x4c')](_0x382a41[_0x4cbc('0x59')]);_0x4a0946({'count':_0x487c91[_0x4cbc('0x1b')],'rows':_0x487c91});});},'SmsQueuesWaitingInteractions':function(_0x338678){return new Promise(function(_0x27b0c0,_0xf09118){var _0x1b0d3a=_[_0x4cbc('0x4c')](_0x382a41[_0x4cbc('0x5a')]);_0x27b0c0({'count':_0x1b0d3a[_0x4cbc('0x1b')],'rows':_0x1b0d3a});});},'FaxQueuesWaitingInteractions':function(_0x1df3f1){return new Promise(function(_0x4bf5ff,_0xa6c5dd){var _0x1f9fed=_[_0x4cbc('0x4c')](_0x382a41['faxQueuesWaitingInteractions']);_0x4bf5ff({'count':_0x1f9fed[_0x4cbc('0x1b')],'rows':_0x1f9fed});});},'WhatsappQueuesWaitingInteractions':function(_0x329ddb){return new Promise(function(_0x4bd59a,_0x2dc1b5){var _0x5bad6c=_['values'](_0x382a41[_0x4cbc('0x5b')]);_0x4bd59a({'count':_0x5bad6c[_0x4cbc('0x1b')],'rows':_0x5bad6c});});}};var _0x587b14=jayson[_0x4cbc('0x5c')](_0x4e1916)[_0x4cbc('0x5d')]();_0x587b14['on'](_0x4cbc('0x31'),function(_0x873474){logger['error'](JSON[_0x4cbc('0x35')](_0x873474));return _0x152b94(_0x873474);});_0x587b14[_0x4cbc('0x14')](0x232c,_0x4cbc('0x5e'),function(){console[_0x4cbc('0x5f')](_0x4cbc('0x60'),0x232c);return _0x356afd(_0x4cbc('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c465c94..cbc7d2a 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 _0xcf3a=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','join','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','util','bluebird','jayson/promise','lodash','routing','http','request','then','error','message','result','catch','rules'];(function(_0x366762,_0x124a0b){var _0x1e11d8=function(_0x4a6812){while(--_0x4a6812){_0x366762['push'](_0x366762['shift']());}};_0x1e11d8(++_0x124a0b);}(_0xcf3a,0xb7));var _0xacf3=function(_0x2ebb2e,_0x48fa55){_0x2ebb2e=_0x2ebb2e-0x0;var _0x11c5b3=_0xcf3a[_0x2ebb2e];return _0x11c5b3;};'use strict';var util=require(_0xacf3('0x0'));var BPromise=require(_0xacf3('0x1'));var jayson=require(_0xacf3('0x2'));var _=require(_0xacf3('0x3'));var logger=require('../../../config/logger')(_0xacf3('0x4'));var client=jayson['client'][_0xacf3('0x5')]({'port':0x232a});function request(_0x3175dd,_0x140579){return new BPromise(function(_0x224c09,_0x503d2d){return client[_0xacf3('0x6')](_0x3175dd,_0x140579)[_0xacf3('0x7')](function(_0x1218a1){if(_0x1218a1[_0xacf3('0x8')]){return _0x503d2d(_0x1218a1[_0xacf3('0x8')][_0xacf3('0x9')]);}else{return _0x224c09(_0x1218a1[_0xacf3('0xa')]);}})[_0xacf3('0xb')](function(_0x457219){return _0x503d2d(_0x457219);});});}exports['condition']=function(_0xf58112,_0x168e19,_0x2c30e1){return function(_0x226964){if(_0x2c30e1['rules']&&!_0x2c30e1[_0xacf3('0xc')][_0xf58112]){logger['info'](_0xacf3('0xd'),_0xf58112);return _0x226964[_0xacf3('0xe')]();}var _0x444d15=[];for(var _0x347f00=0x0;_0x347f00<_0x168e19[_0xacf3('0xf')];_0x347f00+=0x1){_0x444d15[_0xacf3('0x10')](request('Command',{'command':util[_0xacf3('0x11')](_0xacf3('0x12'),_0x168e19[_0x347f00])})[_0xacf3('0x7')](function(_0x2f474f){return _0x2f474f&&_0x2f474f['message']&&_0x2f474f['message'][_0xacf3('0x13')](_0xacf3('0x14'))>=0x0?!![]:![];})[_0xacf3('0xb')](function(_0x5c76ef){logger[_0xacf3('0x8')](_0xacf3('0x15'),_0xf58112,_0x168e19[_0x347f00]);}));}BPromise[_0xacf3('0x16')](_0x444d15)['then'](function(_0xaa6b7a){var _0x39d696=_[_0xacf3('0x17')](_0xaa6b7a);logger[_0xacf3('0x18')]('[%s][INTERVAL]\x20%s\x20%s',_0xf58112,_0x168e19[_0xacf3('0x19')]('\x20|\x20'),_0x39d696);_0x226964['when'](_0x39d696);})['catch'](function(_0x4966ed){console['log'](_0x4966ed);logger[_0xacf3('0x8')](_0xacf3('0x1a'),_0xf58112,_0x168e19[_0xacf3('0x19')](_0xacf3('0x1b')),_0x4966ed['stack']);_0x226964[_0xacf3('0xe')]();});};}; \ No newline at end of file +var _0xd8c1=['bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','message','indexOf','true','[%s][INTERVAL]\x20%s','all','join','\x20|\x20','when','catch','log','[%s][INTERVAL]\x20%s\x20%s','stack','util'];(function(_0x5d26ec,_0x13e7d2){var _0x328e67=function(_0x61abf5){while(--_0x61abf5){_0x5d26ec['push'](_0x5d26ec['shift']());}};_0x328e67(++_0x13e7d2);}(_0xd8c1,0x1b1));var _0x1d8c=function(_0x338600,_0x171e12){_0x338600=_0x338600-0x0;var _0x61f1f7=_0xd8c1[_0x338600];return _0x61f1f7;};'use strict';var util=require(_0x1d8c('0x0'));var BPromise=require(_0x1d8c('0x1'));var jayson=require('jayson/promise');var _=require(_0x1d8c('0x2'));var logger=require(_0x1d8c('0x3'))(_0x1d8c('0x4'));var client=jayson[_0x1d8c('0x5')][_0x1d8c('0x6')]({'port':0x232a});function request(_0x4bba4b,_0xf7d5ec){return new BPromise(function(_0xef4026,_0xb6f8eb){return client[_0x1d8c('0x7')](_0x4bba4b,_0xf7d5ec)[_0x1d8c('0x8')](function(_0x52d090){if(_0x52d090['error']){return _0xb6f8eb(_0x52d090[_0x1d8c('0x9')]['message']);}else{return _0xef4026(_0x52d090[_0x1d8c('0xa')]);}})['catch'](function(_0x21e8b9){return _0xb6f8eb(_0x21e8b9);});});}exports['condition']=function(_0x1b65c3,_0x33cb44,_0x56c63d){return function(_0x1285f0){if(_0x56c63d[_0x1d8c('0xb')]&&!_0x56c63d['rules'][_0x1b65c3]){logger[_0x1d8c('0xc')](_0x1d8c('0xd'),_0x1b65c3);return _0x1285f0[_0x1d8c('0xe')]();}var _0x5f446f=[];for(var _0x1ded6b=0x0;_0x1ded6b<_0x33cb44[_0x1d8c('0xf')];_0x1ded6b+=0x1){_0x5f446f[_0x1d8c('0x10')](request(_0x1d8c('0x11'),{'command':util[_0x1d8c('0x12')]('iftime\x20%s',_0x33cb44[_0x1ded6b])})[_0x1d8c('0x8')](function(_0x1dba9f){return _0x1dba9f&&_0x1dba9f['message']&&_0x1dba9f[_0x1d8c('0x13')][_0x1d8c('0x14')](_0x1d8c('0x15'))>=0x0?!![]:![];})['catch'](function(_0x3ab2e9){logger['error'](_0x1d8c('0x16'),_0x1b65c3,_0x33cb44[_0x1ded6b]);}));}BPromise[_0x1d8c('0x17')](_0x5f446f)[_0x1d8c('0x8')](function(_0x122f1f){var _0x20645a=_['some'](_0x122f1f);logger[_0x1d8c('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x1b65c3,_0x33cb44[_0x1d8c('0x18')](_0x1d8c('0x19')),_0x20645a);_0x1285f0[_0x1d8c('0x1a')](_0x20645a);})[_0x1d8c('0x1b')](function(_0x21a00d){console[_0x1d8c('0x1c')](_0x21a00d);logger[_0x1d8c('0x9')](_0x1d8c('0x1d'),_0x1b65c3,_0x33cb44[_0x1d8c('0x18')]('\x20|\x20'),_0x21a00d[_0x1d8c('0x1e')]);_0x1285f0['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 6049bdc..8e9caab 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 _0x4483=['agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','[%s][agents][hangup]','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','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw'];(function(_0x33ca78,_0x5442d7){var _0x5debda=function(_0x1f9bb9){while(--_0x1f9bb9){_0x33ca78['push'](_0x33ca78['shift']());}};_0x5debda(++_0x5442d7);}(_0x4483,0x1a3));var _0x3448=function(_0xb8f0a9,_0x313293){_0xb8f0a9=_0xb8f0a9-0x0;var _0x4ab1f8=_0x4483[_0xb8f0a9];return _0x4ab1f8;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var utils=require(_0x3448('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x481d0c,_0x202d3d){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x5'),_0x481d0c[_0x3448('0x6')],_0x481d0c['channel'],_0x481d0c[_0x3448('0x7')],_0x481d0c[_0x3448('0x8')],_0x481d0c[_0x3448('0x9')],_0x481d0c[_0x3448('0xa')],_0x481d0c[_0x3448('0xb')],_0x481d0c[_0x3448('0xc')]));if(_0x481d0c[_0x3448('0x7')]){utils[_0x3448('0xd')](_0x481d0c['queue'])['then'](function(_0x46b1ee){if(_0x46b1ee){_0x481d0c[_0x3448('0xe')]=_0x46b1ee[_0x3448('0xe')];_0x481d0c[_0x3448('0xf')]=_0x481d0c[_0x3448('0x10')]?_0x46b1ee[_0x3448('0x11')]:![];_0x481d0c[_0x3448('0x12')]=_0x481d0c[_0x3448('0xf')]?_0x46b1ee[_0x3448('0x13')]:0x0;}utils[_0x3448('0x14')](_0x3448('0x15'),_0x481d0c);});}else{utils['request']('CreateVoiceAgentReport',_0x481d0c);}if(_0x202d3d){delete transfers[_0x481d0c[_0x3448('0x6')]];}else{delete agents[_0x481d0c[_0x3448('0x16')]];}}exports['agentcalled']=function(_0x2661e1){try{utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentcalled]',_0x2661e1[_0x3448('0x6')]),_0x2661e1);agents[_0x2661e1[_0x3448('0x16')]]=_0x2661e1;agents[_0x2661e1['destuniqueid']][_0x3448('0x18')]=utils[_0x3448('0x19')]();agents[_0x2661e1[_0x3448('0x16')]]['lastevent']=_0x3448('0x1a');agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0xb')]=null;agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0x1b')]=null;utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x1c'),_0x2661e1['uniqueid'],agents[_0x2661e1[_0x3448('0x16')]]['membername'],_0x2661e1['destuniqueid']));}catch(_0x53f8e7){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x1e'),_0x2661e1['uniqueid']),_0x53f8e7);}};exports[_0x3448('0x1f')]=function(_0x392c8d){try{if(!_[_0x3448('0x20')](agents[_0x392c8d[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentringnoanswer]',_0x392c8d['uniqueid']),_0x392c8d);utils['info'](util[_0x3448('0x4')](_0x3448('0x21'),_0x392c8d['uniqueid'],agents[_0x392c8d['destuniqueid']][_0x3448('0x8')],_0x392c8d[_0x3448('0x16')]));agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x1f')]=!![];agents[_0x392c8d[_0x3448('0x16')]]['agentringnoanswerAt']=utils[_0x3448('0x19')]();agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['reason']=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['holdtime']=_0x392c8d[_0x3448('0x23')]?parseInt(_0x392c8d[_0x3448('0x23')])/0x3e8:0x0;agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x24')]=0x0;unanswered[_0x3448('0x25')](_0x392c8d[_0x3448('0x16')]);}}catch(_0x31be64){utils[_0x3448('0x1d')](util['format'](_0x3448('0x26'),_0x392c8d[_0x3448('0x6')]),_0x31be64);}};exports[_0x3448('0x27')]=function(_0x52c09d){try{_[_0x3448('0x28')](agents,function(_0x5dfdf7,_0x486f2c){if(_0x5dfdf7['uniqueid']==_0x52c09d[_0x3448('0x6')]&&!_[_0x3448('0x29')](unanswered,_0x5dfdf7['destuniqueid'])){utils['debug'](util[_0x3448('0x4')](_0x3448('0x2a'),_0x52c09d[_0x3448('0x6')]),_0x52c09d);utils[_0x3448('0x3')](util['format'](_0x3448('0x2b'),_0x52c09d[_0x3448('0x6')],_0x5dfdf7[_0x3448('0x8')],_0x5dfdf7['destuniqueid']));_0x5dfdf7[_0x3448('0x1f')]=!![];_0x5dfdf7[_0x3448('0x2c')]=utils['now']();_0x5dfdf7['lastevent']=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2e')]=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2f')]=_0x52c09d['holdtime'];_0x5dfdf7[_0x3448('0x24')]=0x0;writeDB(_0x5dfdf7);}});}catch(_0x36291e){utils[_0x3448('0x1d')](util[_0x3448('0x4')]('[%s][agents][queuecallerabandon]',_0x52c09d[_0x3448('0x6')]),_0x36291e);}};exports[_0x3448('0x30')]=function(_0x5ea47c){try{if(agents[_0x5ea47c[_0x3448('0x16')]]){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x5ea47c);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x32'),_0x5ea47c[_0x3448('0x6')],agents[_0x5ea47c['destuniqueid']]['membername'],_0x5ea47c[_0x3448('0x16')]));agents[_0x5ea47c['destuniqueid']][_0x3448('0x33')]=utils[_0x3448('0x19')]();agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xb')]=_0x5ea47c['connectedlinenum'];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x1b')]=_0x5ea47c[_0x3448('0x1b')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x34');_['forIn'](agents,function(_0x39b22e,_0x3c92e2){if(_0x39b22e[_0x3448('0x16')]!=_0x5ea47c[_0x3448('0x16')]&&_0x39b22e[_0x3448('0x6')]==_0x5ea47c['uniqueid']){_0x39b22e[_0x3448('0x24')]=0x0;_0x39b22e[_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];_0x39b22e[_0x3448('0x1f')]=!![];_0x39b22e[_0x3448('0x2c')]=utils[_0x3448('0x19')]();_0x39b22e[_0x3448('0xc')]=_0x3448('0x35');_0x39b22e['reason']=_0x3448('0x35');_0x39b22e[_0x3448('0x36')]=_0x5ea47c[_0x3448('0x16')];_0x39b22e['answeredelsewheremembername']=_0x5ea47c[_0x3448('0x8')];writeDB(_0x39b22e);}});}}catch(_0x1d2a7c){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x1d2a7c);}};exports[_0x3448('0x10')]=function(_0x4f54e7){try{if(!_[_0x3448('0x20')](agents[_0x4f54e7[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x4f54e7);utils['info'](util[_0x3448('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f54e7['uniqueid'],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x8')],_0x4f54e7['destuniqueid']));agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x10')]=!![];agents[_0x4f54e7['destuniqueid']][_0x3448('0x38')]=utils[_0x3448('0x19')]();agents[_0x4f54e7['destuniqueid']][_0x3448('0x24')]=utils[_0x3448('0x39')](agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x38')],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x33')]);agents[_0x4f54e7[_0x3448('0x16')]]['reason']=_0x4f54e7['reason'];agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x3a');writeDB(agents[_0x4f54e7[_0x3448('0x16')]]);}}catch(_0x527259){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x527259);}};exports[_0x3448('0x3b')]=function(_0x5d942b){try{if(!_[_0x3448('0x20')](agents[_0x5d942b['transfereruniqueid']])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][blindtransfer]',_0x5d942b[_0x3448('0x6')]),_0x5d942b);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x3c'),_0x5d942b[_0x3448('0x6')],agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x8')],agents[_0x5d942b['transfereruniqueid']][_0x3448('0x6')]));agents[_0x5d942b[_0x3448('0x3d')]]['transfer']=!![];agents[_0x5d942b['transfereruniqueid']][_0x3448('0x3e')]=_0x3448('0x3f');agents[_0x5d942b['transfereruniqueid']]['transferexten']=_0x5d942b[_0x3448('0x40')];agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x41')]=agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x6')];}}catch(_0x39db50){utils[_0x3448('0x1d')](util['format']('[%s][agents][blindtransfer]',_0x5d942b['uniqueid']),_0x39db50);}};exports[_0x3448('0x42')]=function(_0x3c734a){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x3c734a);if(_0x3c734a[_0x3448('0x44')]==_0x3c734a[_0x3448('0x45')]){if(!_['isNil'](agents[_0x3c734a[_0x3448('0x46')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a[_0x3448('0x44')],agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x8')]));agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x48')]=!![];agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x49')]=_0x3c734a[_0x3448('0x4a')];agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x41')]=_0x3c734a[_0x3448('0x44')];}if(_0x3c734a['transfereeuniqueid']&&agents[_0x3c734a[_0x3448('0x4b')]]){agents[_0x3c734a['transfereeuniqueid']][_0x3448('0x4c')]=0x1;transfers[_0x3c734a[_0x3448('0x4b')]]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x4b')]]);transfers[_0x3c734a[_0x3448('0x4b')]]['calleridnum']=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4e')]=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x33')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x2f')]=0x0;transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4c')]=0x2;}}else if(_0x3c734a[_0x3448('0x46')]==_0x3c734a[_0x3448('0x4f')]){if(!_[_0x3448('0x20')](agents[_0x3c734a[_0x3448('0x44')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a['origtransfereruniqueid'],agents[_0x3c734a[_0x3448('0x44')]]['membername']));agents[_0x3c734a[_0x3448('0x44')]]['transfer']=!![];agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x49')]=_0x3c734a['secondtransfererexten'];agents[_0x3c734a['origtransfereruniqueid']][_0x3448('0x41')]=_0x3c734a['secondtransfereruniqueid'];}if(_0x3c734a['transfertargetuniqueid']&&agents[_0x3c734a[_0x3448('0x50')]]){agents[_0x3c734a[_0x3448('0x50')]]['agententerreason']=0x1;transfers[_0x3c734a['transfertargetuniqueid']]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x50')]]);transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0xa')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4e')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['agentconnectAt']=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['holdtime']=0x0;transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4c')]=0x2;}}}catch(_0x543959){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x543959);}};exports['hangup']=function(_0x41d459){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x51'),_0x41d459[_0x3448('0x6')]),_0x41d459);if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x2e')]===_0x3448('0x22')){if(_0x41d459['cause']==='21'){agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=_0x3448('0x52');agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]=_0x3448('0x52');}utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459['uniqueid'],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]]['lastevent']));writeDB(agents[_0x41d459['uniqueid']]);var _0x188f98=unanswered[_0x3448('0x54')](_0x41d459[_0x3448('0x6')]);if(_0x188f98>-0x1){unanswered[_0x3448('0x55')](_0x188f98,0x1);}}if(transfers[_0x41d459[_0x3448('0x6')]]){transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x10')]=!![];transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')]=utils[_0x3448('0x19')]();transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x24')]=utils[_0x3448('0x39')](transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')],transfers[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);transfers[_0x41d459['uniqueid']][_0x3448('0x2e')]='agent';transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]='complete';utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459[_0x3448('0x6')],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],transfers[_0x41d459[_0x3448('0x6')]]['reason'],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(transfers[_0x41d459[_0x3448('0x6')]],!![]);}if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x33')]){agents[_0x41d459[_0x3448('0x6')]]['agentcomplete']=!![];agents[_0x41d459[_0x3448('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x41d459[_0x3448('0x6')]]['talktime']=utils[_0x3448('0x39')](agents[_0x41d459['uniqueid']][_0x3448('0x38')],agents[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=agents[_0x41d459[_0x3448('0x6')]]['transfer']?_0x3448('0x48'):_0x3448('0x56');agents[_0x41d459['uniqueid']][_0x3448('0xc')]=_0x3448('0x3a');utils[_0x3448('0x3')](util[_0x3448('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x41d459[_0x3448('0x6')],agents[_0x41d459['uniqueid']][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(agents[_0x41d459['uniqueid']]);}}catch(_0x17ebc9){utils[_0x3448('0x1d')](util['format'](_0x3448('0x51'),_0x41d459['uniqueid']),_0x17ebc9);}}; \ No newline at end of file +var _0xbc9d=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','lodash','util','./utils','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','debug','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','timeout','reason','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','talktime','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected'];(function(_0x26f3e5,_0x3dadc5){var _0x5daaff=function(_0x5c1666){while(--_0x5c1666){_0x26f3e5['push'](_0x26f3e5['shift']());}};_0x5daaff(++_0x3dadc5);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x1ffabf,_0x24b017){_0x1ffabf=_0x1ffabf-0x0;var _0x1c940c=_0xbc9d[_0x1ffabf];return _0x1c940c;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var utils=require(_0xdbc9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x434f6e,_0x35f89c){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x434f6e[_0xdbc9('0x3')],_0x434f6e[_0xdbc9('0x4')],_0x434f6e[_0xdbc9('0x5')],_0x434f6e[_0xdbc9('0x6')],_0x434f6e[_0xdbc9('0x7')],_0x434f6e[_0xdbc9('0x8')],_0x434f6e[_0xdbc9('0x9')],_0x434f6e['lastevent']));if(_0x434f6e[_0xdbc9('0x5')]){utils[_0xdbc9('0xa')](_0x434f6e[_0xdbc9('0x5')])['then'](function(_0x2c7ba5){if(_0x2c7ba5){_0x434f6e['type']=_0x2c7ba5['type'];_0x434f6e[_0xdbc9('0xb')]=_0x434f6e[_0xdbc9('0xc')]?_0x2c7ba5[_0xdbc9('0xd')]:![];_0x434f6e[_0xdbc9('0xe')]=_0x434f6e['agentacw']?_0x2c7ba5[_0xdbc9('0xf')]:0x0;}utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);});}else{utils[_0xdbc9('0x10')](_0xdbc9('0x11'),_0x434f6e);}if(_0x35f89c){delete transfers[_0x434f6e[_0xdbc9('0x3')]];}else{delete agents[_0x434f6e['destuniqueid']];}}exports['agentcalled']=function(_0x3d0fdd){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x3d0fdd);agents[_0x3d0fdd['destuniqueid']]=_0x3d0fdd;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x16')]=utils[_0xdbc9('0x17')]();agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x19');agents[_0x3d0fdd['destuniqueid']][_0xdbc9('0x9')]=null;agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=null;utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x1c'),_0x3d0fdd[_0xdbc9('0x3')],agents[_0x3d0fdd[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x3d0fdd[_0xdbc9('0x15')]));}catch(_0x57a546){utils[_0xdbc9('0x1d')](util['format'](_0xdbc9('0x14'),_0x3d0fdd[_0xdbc9('0x3')]),_0x57a546);}};exports['agentringnoanswer']=function(_0x4408e9){try{if(!_['isNil'](agents[_0x4408e9['destuniqueid']])){utils['debug'](util['format'](_0xdbc9('0x1e'),_0x4408e9[_0xdbc9('0x3')]),_0x4408e9);utils['info'](util[_0xdbc9('0x13')](_0xdbc9('0x1f'),_0x4408e9['uniqueid'],agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x6')],_0x4408e9[_0xdbc9('0x15')]));agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x20')]=!![];agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();agents[_0x4408e9[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0xdbc9('0x22');agents[_0x4408e9[_0xdbc9('0x15')]]['holdtime']=_0x4408e9[_0xdbc9('0x24')]?parseInt(_0x4408e9[_0xdbc9('0x24')])/0x3e8:0x0;agents[_0x4408e9['destuniqueid']]['talktime']=0x0;unanswered[_0xdbc9('0x25')](_0x4408e9[_0xdbc9('0x15')]);}}catch(_0x473430){utils['error'](util[_0xdbc9('0x13')]('[%s][agents][agentringnoanswer]',_0x4408e9['uniqueid']),_0x473430);}};exports[_0xdbc9('0x26')]=function(_0x49da36){try{_['forIn'](agents,function(_0x417b17,_0x20eb4f){if(_0x417b17[_0xdbc9('0x3')]==_0x49da36['uniqueid']&&!_[_0xdbc9('0x27')](unanswered,_0x417b17[_0xdbc9('0x15')])){utils['debug'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x49da36);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x29'),_0x49da36[_0xdbc9('0x3')],_0x417b17[_0xdbc9('0x6')],_0x417b17['destuniqueid']));_0x417b17[_0xdbc9('0x20')]=!![];_0x417b17[_0xdbc9('0x21')]=utils[_0xdbc9('0x17')]();_0x417b17[_0xdbc9('0x18')]=_0xdbc9('0x2a');_0x417b17[_0xdbc9('0x23')]='abandoned';_0x417b17[_0xdbc9('0x2b')]=_0x49da36['holdtime'];_0x417b17['talktime']=0x0;writeDB(_0x417b17);}});}catch(_0x495c0e){utils['error'](util['format'](_0xdbc9('0x28'),_0x49da36[_0xdbc9('0x3')]),_0x495c0e);}};exports[_0xdbc9('0x2c')]=function(_0x5527fc){try{if(agents[_0x5527fc[_0xdbc9('0x15')]]){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc[_0xdbc9('0x3')]),_0x5527fc);utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x2e'),_0x5527fc[_0xdbc9('0x3')],agents[_0x5527fc[_0xdbc9('0x15')]]['membername'],_0x5527fc[_0xdbc9('0x15')]));agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();agents[_0x5527fc['destuniqueid']]['connectedlinenum']=_0x5527fc[_0xdbc9('0x9')];agents[_0x5527fc[_0xdbc9('0x15')]][_0xdbc9('0x1a')]=_0x5527fc[_0xdbc9('0x1a')];agents[_0x5527fc['destuniqueid']][_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];agents[_0x5527fc[_0xdbc9('0x15')]]['lastevent']=_0xdbc9('0x30');_[_0xdbc9('0x31')](agents,function(_0x444219,_0x523c79){if(_0x444219[_0xdbc9('0x15')]!=_0x5527fc[_0xdbc9('0x15')]&&_0x444219['uniqueid']==_0x5527fc['uniqueid']){_0x444219[_0xdbc9('0x32')]=0x0;_0x444219[_0xdbc9('0x2b')]=_0x5527fc[_0xdbc9('0x24')];_0x444219[_0xdbc9('0x20')]=!![];_0x444219['agentringnoanswerAt']=utils[_0xdbc9('0x17')]();_0x444219[_0xdbc9('0x18')]='answered_elsewhere';_0x444219[_0xdbc9('0x23')]=_0xdbc9('0x33');_0x444219['answeredelsewheredestinationuniqueid']=_0x5527fc[_0xdbc9('0x15')];_0x444219[_0xdbc9('0x34')]=_0x5527fc[_0xdbc9('0x6')];writeDB(_0x444219);}});}}catch(_0x3415c3){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x2d'),_0x5527fc['uniqueid']),_0x3415c3);}};exports['agentcomplete']=function(_0x768856){try{if(!_[_0xdbc9('0x35')](agents[_0x768856[_0xdbc9('0x15')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x36'),_0x768856[_0xdbc9('0x3')]),_0x768856);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x37'),_0x768856[_0xdbc9('0x3')],agents[_0x768856['destuniqueid']]['membername'],_0x768856[_0xdbc9('0x15')]));agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0xc')]=!![];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x32')]=utils['diffTime'](agents[_0x768856['destuniqueid']][_0xdbc9('0x38')],agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x2f')]);agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x23')]=_0x768856[_0xdbc9('0x23')];agents[_0x768856[_0xdbc9('0x15')]][_0xdbc9('0x18')]=_0xdbc9('0x39');writeDB(agents[_0x768856['destuniqueid']]);}}catch(_0x2c24a9){utils[_0xdbc9('0x1d')](util['format']('[%s][agents][agentcomplete]',_0x768856[_0xdbc9('0x3')]),_0x2c24a9);}};exports[_0xdbc9('0x3a')]=function(_0x133a13){try{if(!_['isNil'](agents[_0x133a13[_0xdbc9('0x3b')]])){utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13['uniqueid']),_0x133a13);utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')](_0xdbc9('0x3d'),_0x133a13[_0xdbc9('0x3')],agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x6')],agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3')]));agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3e')]=!![];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x3f')]=_0xdbc9('0x40');agents[_0x133a13['transfereruniqueid']][_0xdbc9('0x41')]=_0x133a13['extension'];agents[_0x133a13[_0xdbc9('0x3b')]][_0xdbc9('0x42')]=agents[_0x133a13['transfereruniqueid']]['uniqueid'];}}catch(_0xc7335d){utils['error'](util[_0xdbc9('0x13')](_0xdbc9('0x3c'),_0x133a13[_0xdbc9('0x3')]),_0xc7335d);}};exports['attendedtransfer']=function(_0x32b38d){try{utils[_0xdbc9('0x12')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x32b38d);if(_0x32b38d[_0xdbc9('0x44')]==_0x32b38d[_0xdbc9('0x45')]){if(!_[_0xdbc9('0x35')](agents[_0x32b38d['secondtransfereruniqueid']])){utils['info'](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d[_0xdbc9('0x47')]]['membername']));agents[_0x32b38d['secondtransfereruniqueid']][_0xdbc9('0x3e')]=!![];agents[_0x32b38d[_0xdbc9('0x47')]]['transfertype']='ATTENDED';agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x48')];agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x44')];}if(_0x32b38d['transfereeuniqueid']&&agents[_0x32b38d[_0xdbc9('0x49')]]){agents[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d['transfereeuniqueid']]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x49')]]);transfers[_0x32b38d[_0xdbc9('0x49')]]['calleridnum']=agents[_0x32b38d[_0xdbc9('0x47')]]['calleridnum'];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4c')]=agents[_0x32b38d[_0xdbc9('0x47')]][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x16')]=utils['now']();transfers[_0x32b38d[_0xdbc9('0x49')]]['agentconnectAt']=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x49')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x49')]][_0xdbc9('0x4a')]=0x2;}}else if(_0x32b38d['secondtransfereruniqueid']==_0x32b38d['secondtransfererlinkedid']){if(!_[_0xdbc9('0x35')](agents[_0x32b38d[_0xdbc9('0x44')]])){utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x46'),_0x32b38d[_0xdbc9('0x44')],agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x6')]));agents[_0x32b38d[_0xdbc9('0x44')]]['transfer']=!![];agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x3f')]=_0xdbc9('0x4d');agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x41')]=_0x32b38d[_0xdbc9('0x4e')];agents[_0x32b38d[_0xdbc9('0x44')]][_0xdbc9('0x42')]=_0x32b38d[_0xdbc9('0x47')];}if(_0x32b38d['transfertargetuniqueid']&&agents[_0x32b38d[_0xdbc9('0x4f')]]){agents[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x1;transfers[_0x32b38d[_0xdbc9('0x4f')]]=_[_0xdbc9('0x4b')](agents[_0x32b38d[_0xdbc9('0x4f')]]);transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x8')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x8')];transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x4c')]=agents[_0x32b38d['origtransfereruniqueid']][_0xdbc9('0x4c')];transfers[_0x32b38d[_0xdbc9('0x4f')]]['agentcalledAt']=utils['now']();transfers[_0x32b38d['transfertargetuniqueid']][_0xdbc9('0x2f')]=utils[_0xdbc9('0x17')]();transfers[_0x32b38d[_0xdbc9('0x4f')]]['holdtime']=0x0;transfers[_0x32b38d[_0xdbc9('0x4f')]][_0xdbc9('0x4a')]=0x2;}}}catch(_0x53843c){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x43'),_0x32b38d[_0xdbc9('0x44')]),_0x53843c);}};exports[_0xdbc9('0x50')]=function(_0xfdfb20){try{utils['debug'](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20['uniqueid']),_0xfdfb20);if(agents[_0xfdfb20['uniqueid']]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]===_0xdbc9('0x22')){if(_0xfdfb20[_0xdbc9('0x52')]==='21'){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')]=_0xdbc9('0x53');agents[_0xfdfb20['uniqueid']][_0xdbc9('0x18')]=_0xdbc9('0x53');}utils[_0xdbc9('0x1b')](util['format'](_0xdbc9('0x54'),_0xfdfb20[_0xdbc9('0x3')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);var _0x1afbcd=unanswered[_0xdbc9('0x55')](_0xfdfb20[_0xdbc9('0x3')]);if(_0x1afbcd>-0x1){unanswered['splice'](_0x1afbcd,0x1);}}if(transfers[_0xfdfb20['uniqueid']]){transfers[_0xfdfb20[_0xdbc9('0x3')]]['agentcomplete']=!![];transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x38')]=utils[_0xdbc9('0x17')]();transfers[_0xfdfb20[_0xdbc9('0x3')]]['talktime']=utils[_0xdbc9('0x56')](transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')],transfers[_0xfdfb20['uniqueid']][_0xdbc9('0x2f')]);transfers[_0xfdfb20[_0xdbc9('0x3')]]['reason']=_0xdbc9('0x57');transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20[_0xdbc9('0x3')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['membername'],transfers[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x23')],transfers[_0xfdfb20[_0xdbc9('0x3')]]['lastevent']));writeDB(transfers[_0xfdfb20[_0xdbc9('0x3')]],!![]);}if(agents[_0xfdfb20[_0xdbc9('0x3')]]&&agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x2f')]){agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0xc')]=!![];agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x38')]=utils['now']();agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x32')]=utils[_0xdbc9('0x56')](agents[_0xfdfb20[_0xdbc9('0x3')]]['agentcompleteAt'],agents[_0xfdfb20[_0xdbc9('0x3')]]['agentconnectAt']);agents[_0xfdfb20['uniqueid']][_0xdbc9('0x23')]=agents[_0xfdfb20[_0xdbc9('0x3')]]['transfer']?_0xdbc9('0x3e'):_0xdbc9('0x57');agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]=_0xdbc9('0x39');utils[_0xdbc9('0x1b')](util[_0xdbc9('0x13')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xfdfb20['uniqueid'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x6')],agents[_0xfdfb20[_0xdbc9('0x3')]]['reason'],agents[_0xfdfb20[_0xdbc9('0x3')]][_0xdbc9('0x18')]));writeDB(agents[_0xfdfb20[_0xdbc9('0x3')]]);}}catch(_0x1839e4){utils[_0xdbc9('0x1d')](util[_0xdbc9('0x13')](_0xdbc9('0x51'),_0xfdfb20[_0xdbc9('0x3')]),_0x1839e4);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index afa847e..244a2e5 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 _0x68aa=['value','xmd-phone','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','substring','lastIndexOf','noop','execif','set','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','ANSWERED','hangup','callerid','calleridname','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][hangup]','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]','mohtime','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x68aa,0x8b));var _0xa68a=function(_0x34cff0,_0x4c659e){_0x34cff0=_0x34cff0-0x0;var _0x4a8dc4=_0x68aa[_0x34cff0];return _0x4a8dc4;};'use strict';var _=require(_0xa68a('0x0'));var util=require(_0xa68a('0x1'));var utils=require(_0xa68a('0x2'));var transfers=require(_0xa68a('0x3'));var dispositions=[_0xa68a('0x4'),_0xa68a('0x5'),'FAILED',_0xa68a('0x4'),_0xa68a('0x4'),_0xa68a('0x4'),'ANSWERED',_0xa68a('0x6'),'FAILED','FAILED',_0xa68a('0x5')];var channels={};function writeDB(_0x5e54b8){var _0xe349a4;if(transfers[_0xa68a('0x7')][_0x5e54b8[_0xa68a('0x8')]]){_0xe349a4=_0x5e54b8[_0xa68a('0x8')];_0x5e54b8[_0xa68a('0x8')]=transfers[_0xa68a('0x7')][_0x5e54b8[_0xa68a('0x8')]][_0xa68a('0x9')];}utils['info'](util[_0xa68a('0xa')](_0xa68a('0xb'),_0x5e54b8['uniqueid'],_0x5e54b8[_0xa68a('0xc')],_0x5e54b8['queue'],_0x5e54b8[_0xa68a('0xd')],_0x5e54b8[_0xa68a('0xe')],_0x5e54b8[_0xa68a('0xf')],_0x5e54b8['connectedlinenum'],_0x5e54b8[_0xa68a('0x10')]));if(_0x5e54b8['accountcode']){utils[_0xa68a('0x11')](_0x5e54b8[_0xa68a('0x12')])[_0xa68a('0x13')](function(_0x43beca){if(_0x43beca){_0x5e54b8[_0xa68a('0x14')]=_0x43beca['id'];}utils[_0xa68a('0x15')](_0xa68a('0x16'),_0x5e54b8);});}else{utils[_0xa68a('0x15')]('CreateVoiceCallReport',_0x5e54b8);}if(channels[_0x5e54b8[_0xa68a('0x8')]]){delete channels[_0x5e54b8[_0xa68a('0x8')]];}else if(_0xe349a4&&channels[_0xe349a4]){delete transfers['blinds'][_0xe349a4];delete channels[_0xe349a4];}}exports[_0xa68a('0x17')]=function(_0x30c79d){try{utils[_0xa68a('0x18')](util[_0xa68a('0xa')]('[%s][calls][newchannel]',_0x30c79d[_0xa68a('0x8')]),_0x30c79d);if(_0x30c79d[_0xa68a('0x8')]==_0x30c79d[_0xa68a('0x19')]&&_0x30c79d[_0xa68a('0xc')]!=_0xa68a('0x1a')){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x1c'),_0x30c79d[_0xa68a('0x8')],_0x30c79d[_0xa68a('0x1d')],_0x30c79d['exten']));channels[_0x30c79d['uniqueid']]={'uniqueid':_0x30c79d[_0xa68a('0x8')],'accountcode':_0x30c79d[_0xa68a('0x12')],'source':_0x30c79d['calleridnum'],'destination':_0x30c79d[_0xa68a('0x1e')],'destinationcontext':_0x30c79d[_0xa68a('0x1d')],'channel':_0x30c79d[_0xa68a('0xc')],'starttime':utils[_0xa68a('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa68a('0x4'),'amaflags':_0xa68a('0x20')};}}catch(_0x436123){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x22'),_0x30c79d[_0xa68a('0x8')]),_0x436123);}};exports['newstate']=function(_0x29cc2f){try{utils[_0xa68a('0x18')](util[_0xa68a('0xa')](_0xa68a('0x23'),_0x29cc2f['uniqueid']),_0x29cc2f);if(!_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x8')]])&&_0x29cc2f[_0xa68a('0x25')]==0x6){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x26'),_0x29cc2f[_0xa68a('0x8')],_0x29cc2f[_0xa68a('0x1d')],_0x29cc2f[_0xa68a('0xc')]));if(_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x8')]]['systemanswertime'])){channels[_0x29cc2f[_0xa68a('0x8')]][_0xa68a('0x27')]=utils[_0xa68a('0x1f')]();}}else if(!_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x19')]])&&_0x29cc2f[_0xa68a('0x25')]==0x6&&_0x29cc2f['context']!='transfer'){utils[_0xa68a('0x1b')](util['format'](_0xa68a('0x28'),_0x29cc2f['uniqueid'],_0x29cc2f[_0xa68a('0x19')],_0x29cc2f['context'],_0x29cc2f['channel']));channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x12')]=_0x29cc2f[_0xa68a('0x12')];channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x29')]=_0x29cc2f[_0xa68a('0xc')];if(_[_0xa68a('0x24')](channels[_0x29cc2f[_0xa68a('0x19')]]['answertime'])){channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x2a')]=utils[_0xa68a('0x1f')]();}channels[_0x29cc2f[_0xa68a('0x19')]][_0xa68a('0x2b')]=dispositions[_[_0xa68a('0x2c')](_0x29cc2f[_0xa68a('0x25')])]||_0xa68a('0x2d');}}catch(_0x37912c){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x23'),_0x29cc2f['uniqueid']),_0x37912c);}};exports[_0xa68a('0x2e')]=function(_0x231747){try{if(!_[_0xa68a('0x24')](channels[_0x231747[_0xa68a('0x8')]])){utils['debug'](util[_0xa68a('0xa')]('[%s][calls][hangup]',_0x231747[_0xa68a('0x8')]),_0x231747);if(_[_0xa68a('0x24')](channels[_0x231747['uniqueid']][_0xa68a('0x2f')])){channels[_0x231747['uniqueid']][_0xa68a('0x2f')]=_0x231747[_0xa68a('0x30')]+'\x20<'+_0x231747[_0xa68a('0xf')]+'>';}utils[_0xa68a('0x1b')](util[_0xa68a('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x231747[_0xa68a('0x8')],channels[_0x231747['uniqueid']]['callerid'],_0x231747['cause-txt']));channels[_0x231747['uniqueid']][_0xa68a('0x31')]=utils[_0xa68a('0x1f')]();channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x32')]=utils['diffTime'](channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x31')],channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x33')]);channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x34')]=channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x2a')]?utils[_0xa68a('0x35')](channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x31')],channels[_0x231747[_0xa68a('0x8')]][_0xa68a('0x2a')]):0x0;writeDB(channels[_0x231747[_0xa68a('0x8')]]);}}catch(_0x547514){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x36'),_0x231747[_0xa68a('0x8')]),_0x547514);}};exports[_0xa68a('0x37')]=function(_0x53ee79){try{if(!_[_0xa68a('0x24')](channels[_0x53ee79[_0xa68a('0x38')]])){utils['debug'](util['format'](_0xa68a('0x39'),_0x53ee79[_0xa68a('0x3a')]),_0x53ee79);if(channels[_0x53ee79['localtwolinkedid']][_0xa68a('0xc')]==_0x53ee79[_0xa68a('0x3b')]){utils[_0xa68a('0x1b')](util['format'](_0xa68a('0x3c'),_0x53ee79[_0xa68a('0x3a')],_0x53ee79[_0xa68a('0x38')],_0x53ee79['secondtransfererchannel']));channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x29')]=_0x53ee79[_0xa68a('0x3d')];channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x3e')]=_0xa68a('0x3f');}else if(channels[_0x53ee79[_0xa68a('0x38')]]['channel']=_0x53ee79[_0xa68a('0x40')]){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x3c'),_0x53ee79[_0xa68a('0x3a')],_0x53ee79[_0xa68a('0x38')],_0x53ee79[_0xa68a('0x41')]));channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x29')]=_0x53ee79[_0xa68a('0x41')];channels[_0x53ee79[_0xa68a('0x38')]][_0xa68a('0x3e')]='_attended';}}}catch(_0x5c40ea){utils[_0xa68a('0x21')](util[_0xa68a('0xa')]('[%s][calls][attendedtransfer]',_0x53ee79[_0xa68a('0x3a')]),_0x5c40ea);}};exports['musiconholdstart']=function(_0x1ff16b){try{if(!_[_0xa68a('0x24')](channels[_0x1ff16b[_0xa68a('0x8')]])){utils['debug'](util[_0xa68a('0xa')](_0xa68a('0x42'),_0x1ff16b[_0xa68a('0x8')]),_0x1ff16b);channels[_0x1ff16b['uniqueid']][_0xa68a('0x43')]=utils[_0xa68a('0x1f')]();utils[_0xa68a('0x1b')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1ff16b[_0xa68a('0x8')],channels[_0x1ff16b['uniqueid']][_0xa68a('0x43')]));}}catch(_0x57e51a){utils[_0xa68a('0x21')](util['format'](_0xa68a('0x42'),_0x1ff16b[_0xa68a('0x8')]),_0x57e51a);}};exports[_0xa68a('0x44')]=function(_0x40001d){try{if(!_['isNil'](channels[_0x40001d['uniqueid']])){utils[_0xa68a('0x18')](util['format'](_0xa68a('0x45'),_0x40001d[_0xa68a('0x8')]),_0x40001d);if(!_[_0xa68a('0x24')](channels[_0x40001d[_0xa68a('0x8')]][_0xa68a('0x43')])){channels[_0x40001d[_0xa68a('0x8')]][_0xa68a('0x46')]+=utils[_0xa68a('0x35')](utils[_0xa68a('0x1f')](),channels[_0x40001d[_0xa68a('0x8')]][_0xa68a('0x43')]);utils[_0xa68a('0x1b')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x40001d[_0xa68a('0x8')],channels[_0x40001d['uniqueid']][_0xa68a('0x46')]));delete channels[_0x40001d['uniqueid']][_0xa68a('0x43')];}}}catch(_0x4a76e3){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x45'),_0x40001d[_0xa68a('0x8')]),_0x4a76e3);}};exports[_0xa68a('0x47')]=function(_0x38dccb){try{if(!_['isNil'](channels[_0x38dccb[_0xa68a('0x8')]])){utils['debug'](util[_0xa68a('0xa')](_0xa68a('0x48'),_0x38dccb[_0xa68a('0x8')]),_0x38dccb);if(!_[_0xa68a('0x24')](_0x38dccb['variable'][_0xa68a('0x49')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x4a'),_0x38dccb[_0xa68a('0x8')],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb['uniqueid']]['source']=_0x38dccb[_0xa68a('0x4b')];}if(!_['isNil'](_0x38dccb['variable'][_0xa68a('0x4c')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x38dccb['uniqueid'],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x4d')]=_0x38dccb[_0xa68a('0x4b')];channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x2f')]='\x22'+_0x38dccb[_0xa68a('0x4b')]+_0xa68a('0x4e')+_0x38dccb['value']+'>';}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x50')])||!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x51')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x52'),_0x38dccb[_0xa68a('0x8')],!_['isNil'](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x50')])?_0xa68a('0x50'):_0xa68a('0x51'),_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]]['callerid']=_0x38dccb['value'];}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x53')])||!_['isNil'](_0x38dccb[_0xa68a('0x4f')]['xmcs-queue'])){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x52'),_0x38dccb['uniqueid'],!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x53')])?_0xa68a('0x53'):_0xa68a('0x54'),_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb['uniqueid']][_0xa68a('0x55')]=_0xa68a('0x56');channels[_0x38dccb[_0xa68a('0x8')]]['lastdata']=_0x38dccb[_0xa68a('0x4b')];channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x57')]=!![];}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x58')])){utils['info'](util[_0xa68a('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x38dccb['uniqueid'],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x59')]=_0x38dccb[_0xa68a('0x4b')];}if(!_['isNil'](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x5a')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')](_0xa68a('0x5b'),_0x38dccb[_0xa68a('0x8')],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x5c')]=_0x38dccb[_0xa68a('0x4b')];}if(!_['isNil'](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x5d')])){utils[_0xa68a('0x1b')](util[_0xa68a('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x38dccb[_0xa68a('0x8')],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]]['routeid']=_0x38dccb['value'];}if(!_[_0xa68a('0x24')](_0x38dccb[_0xa68a('0x4f')][_0xa68a('0x5e')])){utils['info'](util[_0xa68a('0xa')](_0xa68a('0x5f'),_0x38dccb['uniqueid'],_0x38dccb[_0xa68a('0x4b')]));channels[_0x38dccb[_0xa68a('0x8')]][_0xa68a('0x5e')]=_0x38dccb['value'];}}}catch(_0x2aacf0){utils[_0xa68a('0x21')](util['format'](_0xa68a('0x48'),_0x38dccb['uniqueid']),_0x2aacf0);}};exports[_0xa68a('0x60')]=function(_0x211797){try{if(!_[_0xa68a('0x24')](channels[_0x211797['uniqueid']])){utils['debug'](util[_0xa68a('0xa')](_0xa68a('0x61'),_0x211797[_0xa68a('0x8')]),_0x211797);utils[_0xa68a('0x1b')](util[_0xa68a('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x211797[_0xa68a('0x8')],_0x211797[_0xa68a('0x62')],_0x211797[_0xa68a('0x63')]));if(_0x211797['application']['toLowerCase']()=='set'&&_['startsWith'](_0x211797[_0xa68a('0x63')][_0xa68a('0x64')](),'cdr')){var _0x350d09=_0x211797[_0xa68a('0x63')]['split']('=');var _0x21e9c4=_0x350d09[0x0][_0xa68a('0x65')](_0x350d09[0x0][_0xa68a('0x66')]('(')+0x1,_0x350d09[0x0]['lastIndexOf'](')'));var _0x1e73b6=_0x350d09[0x1];channels[_0x211797[_0xa68a('0x8')]][_0x21e9c4]=_0x1e73b6;}if(!_['includes'](['hangup',_0xa68a('0x67'),_0xa68a('0x68'),_0xa68a('0x69'),'gotoif'],_0x211797[_0xa68a('0x62')][_0xa68a('0x64')]())){channels[_0x211797[_0xa68a('0x8')]][_0xa68a('0x55')]=_0x211797[_0xa68a('0x62')];channels[_0x211797['uniqueid']][_0xa68a('0x6a')]=_0x211797[_0xa68a('0x63')];}}}catch(_0x5ec98f){utils[_0xa68a('0x21')](util[_0xa68a('0xa')](_0xa68a('0x61'),_0x211797[_0xa68a('0x8')]),_0x5ec98f);}}; \ No newline at end of file +var _0x73e2=['split','substring','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','debug','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','toNumber','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','now','duration','diffTime','starttime','billableseconds','endtime','answertime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','value','source','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','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','application','toLowerCase','set','startsWith','appdata','cdr'];(function(_0x34b0d3,_0x55b139){var _0x37c298=function(_0x1678cc){while(--_0x1678cc){_0x34b0d3['push'](_0x34b0d3['shift']());}};_0x37c298(++_0x55b139);}(_0x73e2,0x1d8));var _0x273e=function(_0x1a1802,_0x2c3ccd){_0x1a1802=_0x1a1802-0x0;var _0x4235a9=_0x73e2[_0x1a1802];return _0x4235a9;};'use strict';var _=require(_0x273e('0x0'));var util=require(_0x273e('0x1'));var utils=require(_0x273e('0x2'));var transfers=require(_0x273e('0x3'));var dispositions=[_0x273e('0x4'),_0x273e('0x5'),_0x273e('0x5'),_0x273e('0x4'),_0x273e('0x4'),_0x273e('0x4'),_0x273e('0x6'),_0x273e('0x7'),_0x273e('0x5'),'FAILED',_0x273e('0x5')];var channels={};function writeDB(_0x1f9d13){var _0x2c8bff;if(transfers['blinds'][_0x1f9d13[_0x273e('0x8')]]){_0x2c8bff=_0x1f9d13['uniqueid'];_0x1f9d13[_0x273e('0x8')]=transfers[_0x273e('0x9')][_0x1f9d13['uniqueid']][_0x273e('0xa')];}utils['info'](util[_0x273e('0xb')](_0x273e('0xc'),_0x1f9d13['uniqueid'],_0x1f9d13[_0x273e('0xd')],_0x1f9d13[_0x273e('0xe')],_0x1f9d13[_0x273e('0xf')],_0x1f9d13['interface'],_0x1f9d13[_0x273e('0x10')],_0x1f9d13[_0x273e('0x11')],_0x1f9d13[_0x273e('0x12')]));if(_0x1f9d13[_0x273e('0x13')]){utils['getUserByInternal'](_0x1f9d13[_0x273e('0x13')])['then'](function(_0x169017){if(_0x169017){_0x1f9d13[_0x273e('0x14')]=_0x169017['id'];}utils[_0x273e('0x15')]('CreateVoiceCallReport',_0x1f9d13);});}else{utils['request'](_0x273e('0x16'),_0x1f9d13);}if(channels[_0x1f9d13[_0x273e('0x8')]]){delete channels[_0x1f9d13[_0x273e('0x8')]];}else if(_0x2c8bff&&channels[_0x2c8bff]){delete transfers[_0x273e('0x9')][_0x2c8bff];delete channels[_0x2c8bff];}}exports['newchannel']=function(_0x3137f7){try{utils[_0x273e('0x17')](util[_0x273e('0xb')]('[%s][calls][newchannel]',_0x3137f7['uniqueid']),_0x3137f7);if(_0x3137f7['uniqueid']==_0x3137f7['linkedid']&&_0x3137f7[_0x273e('0xd')]!=_0x273e('0x18')){utils[_0x273e('0x19')](util['format'](_0x273e('0x1a'),_0x3137f7[_0x273e('0x8')],_0x3137f7[_0x273e('0x1b')],_0x3137f7[_0x273e('0x1c')]));channels[_0x3137f7['uniqueid']]={'uniqueid':_0x3137f7[_0x273e('0x8')],'accountcode':_0x3137f7[_0x273e('0x13')],'source':_0x3137f7[_0x273e('0x10')],'destination':_0x3137f7[_0x273e('0x1c')],'destinationcontext':_0x3137f7[_0x273e('0x1b')],'channel':_0x3137f7[_0x273e('0xd')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x273e('0x4'),'amaflags':_0x273e('0x1d')};}}catch(_0x2e2136){utils[_0x273e('0x1e')](util[_0x273e('0xb')](_0x273e('0x1f'),_0x3137f7[_0x273e('0x8')]),_0x2e2136);}};exports[_0x273e('0x20')]=function(_0x570681){try{utils[_0x273e('0x17')](util[_0x273e('0xb')](_0x273e('0x21'),_0x570681[_0x273e('0x8')]),_0x570681);if(!_['isNil'](channels[_0x570681['uniqueid']])&&_0x570681[_0x273e('0x22')]==0x6){utils[_0x273e('0x19')](util[_0x273e('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x570681['uniqueid'],_0x570681[_0x273e('0x1b')],_0x570681[_0x273e('0xd')]));if(_[_0x273e('0x23')](channels[_0x570681[_0x273e('0x8')]][_0x273e('0x24')])){channels[_0x570681[_0x273e('0x8')]][_0x273e('0x24')]=utils['now']();}}else if(!_[_0x273e('0x23')](channels[_0x570681[_0x273e('0x25')]])&&_0x570681['channelstate']==0x6&&_0x570681[_0x273e('0x1b')]!=_0x273e('0x26')){utils[_0x273e('0x19')](util[_0x273e('0xb')](_0x273e('0x27'),_0x570681[_0x273e('0x8')],_0x570681[_0x273e('0x25')],_0x570681[_0x273e('0x1b')],_0x570681[_0x273e('0xd')]));channels[_0x570681[_0x273e('0x25')]]['accountcode']=_0x570681['accountcode'];channels[_0x570681[_0x273e('0x25')]][_0x273e('0x28')]=_0x570681['channel'];if(_[_0x273e('0x23')](channels[_0x570681['linkedid']]['answertime'])){channels[_0x570681[_0x273e('0x25')]]['answertime']=utils['now']();}channels[_0x570681['linkedid']][_0x273e('0x29')]=dispositions[_[_0x273e('0x2a')](_0x570681['channelstate'])]||_0x273e('0x6');}}catch(_0x3ecf73){utils[_0x273e('0x1e')](util[_0x273e('0xb')](_0x273e('0x21'),_0x570681[_0x273e('0x8')]),_0x3ecf73);}};exports[_0x273e('0x2b')]=function(_0x454c2a){try{if(!_['isNil'](channels[_0x454c2a[_0x273e('0x8')]])){utils[_0x273e('0x17')](util[_0x273e('0xb')]('[%s][calls][hangup]',_0x454c2a[_0x273e('0x8')]),_0x454c2a);if(_['isNil'](channels[_0x454c2a[_0x273e('0x8')]][_0x273e('0x2c')])){channels[_0x454c2a[_0x273e('0x8')]][_0x273e('0x2c')]=_0x454c2a['calleridname']+'\x20<'+_0x454c2a['calleridnum']+'>';}utils[_0x273e('0x19')](util[_0x273e('0xb')](_0x273e('0x2d'),_0x454c2a['uniqueid'],channels[_0x454c2a['uniqueid']][_0x273e('0x2c')],_0x454c2a[_0x273e('0x2e')]));channels[_0x454c2a[_0x273e('0x8')]]['endtime']=utils[_0x273e('0x2f')]();channels[_0x454c2a['uniqueid']][_0x273e('0x30')]=utils[_0x273e('0x31')](channels[_0x454c2a[_0x273e('0x8')]]['endtime'],channels[_0x454c2a['uniqueid']][_0x273e('0x32')]);channels[_0x454c2a['uniqueid']][_0x273e('0x33')]=channels[_0x454c2a['uniqueid']]['answertime']?utils['diffTime'](channels[_0x454c2a[_0x273e('0x8')]][_0x273e('0x34')],channels[_0x454c2a['uniqueid']][_0x273e('0x35')]):0x0;writeDB(channels[_0x454c2a[_0x273e('0x8')]]);}}catch(_0x414ed0){utils['error'](util['format'](_0x273e('0x36'),_0x454c2a['uniqueid']),_0x414ed0);}};exports[_0x273e('0x37')]=function(_0x18b53f){try{if(!_[_0x273e('0x23')](channels[_0x18b53f[_0x273e('0x38')]])){utils['debug'](util[_0x273e('0xb')]('[%s][calls][attendedtransfer]',_0x18b53f[_0x273e('0x39')]),_0x18b53f);if(channels[_0x18b53f[_0x273e('0x38')]]['channel']==_0x18b53f[_0x273e('0x3a')]){utils[_0x273e('0x19')](util[_0x273e('0xb')](_0x273e('0x3b'),_0x18b53f['origtransfereruniqueid'],_0x18b53f[_0x273e('0x38')],_0x18b53f[_0x273e('0x3c')]));channels[_0x18b53f[_0x273e('0x38')]][_0x273e('0x28')]=_0x18b53f[_0x273e('0x3c')];channels[_0x18b53f[_0x273e('0x38')]][_0x273e('0x3d')]='_attended';}else if(channels[_0x18b53f[_0x273e('0x38')]]['channel']=_0x18b53f[_0x273e('0x3e')]){utils[_0x273e('0x19')](util['format'](_0x273e('0x3b'),_0x18b53f[_0x273e('0x39')],_0x18b53f['localtwolinkedid'],_0x18b53f[_0x273e('0x3f')]));channels[_0x18b53f['localtwolinkedid']][_0x273e('0x28')]=_0x18b53f['origtransfererchannel'];channels[_0x18b53f[_0x273e('0x38')]][_0x273e('0x3d')]=_0x273e('0x40');}}}catch(_0x11dd4f){utils[_0x273e('0x1e')](util[_0x273e('0xb')](_0x273e('0x41'),_0x18b53f[_0x273e('0x39')]),_0x11dd4f);}};exports['musiconholdstart']=function(_0x4ae488){try{if(!_[_0x273e('0x23')](channels[_0x4ae488[_0x273e('0x8')]])){utils[_0x273e('0x17')](util[_0x273e('0xb')](_0x273e('0x42'),_0x4ae488['uniqueid']),_0x4ae488);channels[_0x4ae488[_0x273e('0x8')]][_0x273e('0x43')]=utils[_0x273e('0x2f')]();utils[_0x273e('0x19')](util['format'](_0x273e('0x44'),_0x4ae488['uniqueid'],channels[_0x4ae488[_0x273e('0x8')]]['musiconholdstartAt']));}}catch(_0x202663){utils[_0x273e('0x1e')](util[_0x273e('0xb')](_0x273e('0x42'),_0x4ae488[_0x273e('0x8')]),_0x202663);}};exports[_0x273e('0x45')]=function(_0x399440){try{if(!_['isNil'](channels[_0x399440[_0x273e('0x8')]])){utils[_0x273e('0x17')](util[_0x273e('0xb')](_0x273e('0x46'),_0x399440[_0x273e('0x8')]),_0x399440);if(!_['isNil'](channels[_0x399440[_0x273e('0x8')]][_0x273e('0x43')])){channels[_0x399440[_0x273e('0x8')]][_0x273e('0x47')]+=utils[_0x273e('0x31')](utils[_0x273e('0x2f')](),channels[_0x399440[_0x273e('0x8')]][_0x273e('0x43')]);utils[_0x273e('0x19')](util['format'](_0x273e('0x48'),_0x399440[_0x273e('0x8')],channels[_0x399440[_0x273e('0x8')]][_0x273e('0x47')]));delete channels[_0x399440[_0x273e('0x8')]][_0x273e('0x43')];}}}catch(_0x23db8d){utils['error'](util[_0x273e('0xb')](_0x273e('0x46'),_0x399440['uniqueid']),_0x23db8d);}};exports[_0x273e('0x49')]=function(_0x30da6b){try{if(!_[_0x273e('0x23')](channels[_0x30da6b[_0x273e('0x8')]])){utils[_0x273e('0x17')](util[_0x273e('0xb')](_0x273e('0x4a'),_0x30da6b[_0x273e('0x8')]),_0x30da6b);if(!_['isNil'](_0x30da6b['variable']['xmd-originatecalleridnum'])){utils[_0x273e('0x19')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x30da6b[_0x273e('0x8')],_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b['uniqueid']][_0x273e('0x4c')]=_0x30da6b[_0x273e('0x4b')];}if(!_[_0x273e('0x23')](_0x30da6b[_0x273e('0x4d')]['xmd-phone'])){utils[_0x273e('0x19')](util[_0x273e('0xb')](_0x273e('0x4e'),_0x30da6b['uniqueid'],_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b['uniqueid']][_0x273e('0x4f')]=_0x30da6b[_0x273e('0x4b')];channels[_0x30da6b[_0x273e('0x8')]][_0x273e('0x2c')]='\x22'+_0x30da6b['value']+_0x273e('0x50')+_0x30da6b[_0x273e('0x4b')]+'>';}if(!_['isNil'](_0x30da6b[_0x273e('0x4d')][_0x273e('0x51')])||!_[_0x273e('0x23')](_0x30da6b['variable'][_0x273e('0x52')])){utils['info'](util[_0x273e('0xb')](_0x273e('0x53'),_0x30da6b[_0x273e('0x8')],!_[_0x273e('0x23')](_0x30da6b['variable'][_0x273e('0x51')])?_0x273e('0x51'):_0x273e('0x52'),_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b['uniqueid']][_0x273e('0x2c')]=_0x30da6b[_0x273e('0x4b')];}if(!_[_0x273e('0x23')](_0x30da6b[_0x273e('0x4d')][_0x273e('0x54')])||!_[_0x273e('0x23')](_0x30da6b[_0x273e('0x4d')][_0x273e('0x55')])){utils[_0x273e('0x19')](util[_0x273e('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x30da6b[_0x273e('0x8')],!_[_0x273e('0x23')](_0x30da6b[_0x273e('0x4d')][_0x273e('0x54')])?_0x273e('0x54'):_0x273e('0x55'),_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b[_0x273e('0x8')]][_0x273e('0x56')]=_0x273e('0x57');channels[_0x30da6b[_0x273e('0x8')]]['lastdata']=_0x30da6b['value'];channels[_0x30da6b[_0x273e('0x8')]]['queue']=!![];}if(!_[_0x273e('0x23')](_0x30da6b['variable'][_0x273e('0x58')])){utils['info'](util[_0x273e('0xb')](_0x273e('0x59'),_0x30da6b['uniqueid'],_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b['uniqueid']][_0x273e('0x5a')]=_0x30da6b['value'];}if(!_['isNil'](_0x30da6b[_0x273e('0x4d')][_0x273e('0x5b')])){utils[_0x273e('0x19')](util['format'](_0x273e('0x5c'),_0x30da6b[_0x273e('0x8')],_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b[_0x273e('0x8')]][_0x273e('0x5d')]=_0x30da6b[_0x273e('0x4b')];}if(!_[_0x273e('0x23')](_0x30da6b[_0x273e('0x4d')][_0x273e('0x5e')])){utils[_0x273e('0x19')](util['format'](_0x273e('0x5f'),_0x30da6b['uniqueid'],_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b[_0x273e('0x8')]][_0x273e('0x60')]=_0x30da6b[_0x273e('0x4b')];}if(!_['isNil'](_0x30da6b[_0x273e('0x4d')][_0x273e('0x61')])){utils['info'](util[_0x273e('0xb')](_0x273e('0x62'),_0x30da6b[_0x273e('0x8')],_0x30da6b[_0x273e('0x4b')]));channels[_0x30da6b[_0x273e('0x8')]][_0x273e('0x61')]=_0x30da6b[_0x273e('0x4b')];}}}catch(_0x785f58){utils[_0x273e('0x1e')](util[_0x273e('0xb')](_0x273e('0x4a'),_0x30da6b[_0x273e('0x8')]),_0x785f58);}};exports[_0x273e('0x63')]=function(_0x3ec3b1){try{if(!_[_0x273e('0x23')](channels[_0x3ec3b1['uniqueid']])){utils[_0x273e('0x17')](util[_0x273e('0xb')](_0x273e('0x64'),_0x3ec3b1['uniqueid']),_0x3ec3b1);utils['info'](util[_0x273e('0xb')](_0x273e('0x65'),_0x3ec3b1['uniqueid'],_0x3ec3b1[_0x273e('0x66')],_0x3ec3b1['appdata']));if(_0x3ec3b1[_0x273e('0x66')][_0x273e('0x67')]()==_0x273e('0x68')&&_[_0x273e('0x69')](_0x3ec3b1[_0x273e('0x6a')][_0x273e('0x67')](),_0x273e('0x6b'))){var _0x509d9b=_0x3ec3b1[_0x273e('0x6a')][_0x273e('0x6c')]('=');var _0x4a5ac=_0x509d9b[0x0][_0x273e('0x6d')](_0x509d9b[0x0]['lastIndexOf']('(')+0x1,_0x509d9b[0x0][_0x273e('0x6e')](')'));var _0x104ec6=_0x509d9b[0x1];channels[_0x3ec3b1[_0x273e('0x8')]][_0x4a5ac]=_0x104ec6;}if(!_[_0x273e('0x6f')]([_0x273e('0x2b'),_0x273e('0x70'),_0x273e('0x71'),_0x273e('0x68'),_0x273e('0x72')],_0x3ec3b1[_0x273e('0x66')][_0x273e('0x67')]())){channels[_0x3ec3b1['uniqueid']]['lastapplication']=_0x3ec3b1['application'];channels[_0x3ec3b1[_0x273e('0x8')]][_0x273e('0x73')]=_0x3ec3b1[_0x273e('0x6a')];}}}catch(_0x5dacce){utils[_0x273e('0x1e')](util[_0x273e('0xb')]('[%s][calls][newexten]',_0x3ec3b1[_0x273e('0x8')]),_0x5dacce);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 063a8e5..0438c4c 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 _0x8653=['./utils','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x440988,_0x377d5a){var _0x5500a1=function(_0x1d537d){while(--_0x1d537d){_0x440988['push'](_0x440988['shift']());}};_0x5500a1(++_0x377d5a);}(_0x8653,0x117));var _0x3865=function(_0x47cb73,_0xf4e045){_0x47cb73=_0x47cb73-0x0;var _0x459cec=_0x8653[_0x47cb73];return _0x459cec;};'use strict';var utils=require(_0x3865('0x0'));exports['connect']=function(){utils[_0x3865('0x1')]('[core]\x20connected');};exports[_0x3865('0x2')]=function(){utils['info'](_0x3865('0x3'));};exports['fullybooted']=function(){utils[_0x3865('0x1')](_0x3865('0x4'));};exports['error']=function(_0x59caba){utils['error'](_0x3865('0x5'),_0x59caba);};exports[_0x3865('0x6')]=function(){utils['info'](_0x3865('0x7'));};exports[_0x3865('0x8')]=function(_0x41db7d){}; \ No newline at end of file +var _0xabf8=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xabf8,0x197));var _0x8abf=function(_0x283b2e,_0x18ad62){_0x283b2e=_0x283b2e-0x0;var _0x471fc2=_0xabf8[_0x283b2e];return _0x471fc2;};'use strict';var utils=require('./utils');exports[_0x8abf('0x0')]=function(){utils[_0x8abf('0x1')](_0x8abf('0x2'));};exports[_0x8abf('0x3')]=function(){utils[_0x8abf('0x1')](_0x8abf('0x4'));};exports[_0x8abf('0x5')]=function(){utils['info'](_0x8abf('0x6'));};exports[_0x8abf('0x7')]=function(_0x3c8a65){utils[_0x8abf('0x7')](_0x8abf('0x8'),_0x3c8a65);};exports['close']=function(){utils[_0x8abf('0x1')](_0x8abf('0x9'));};exports[_0x8abf('0xa')]=function(_0x3595f4){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 45ea1cd..1a2d72a 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 _0x7085=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','appdata','application','toLowerCase','startsWith','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','lastevent'];(function(_0x5a630b,_0x1add18){var _0x3ba7cb=function(_0x3d9105){while(--_0x3d9105){_0x5a630b['push'](_0x5a630b['shift']());}};_0x3ba7cb(++_0x1add18);}(_0x7085,0x146));var _0x5708=function(_0x2958f8,_0x1b8fda){_0x2958f8=_0x2958f8-0x0;var _0x1a02c0=_0x7085[_0x2958f8];return _0x1a02c0;};'use strict';var _=require('lodash');var util=require(_0x5708('0x0'));var utils=require(_0x5708('0x1'));var dials={};function writeDB(_0x563618){utils[_0x5708('0x2')](util[_0x5708('0x3')](_0x5708('0x4'),_0x563618['uniqueid'],_0x563618[_0x5708('0x5')],_0x563618[_0x5708('0x6')],_0x563618[_0x5708('0x7')],_0x563618[_0x5708('0x8')],_0x563618[_0x5708('0x9')]));utils[_0x5708('0xa')](_0x5708('0xb'),_0x563618);delete dials[_0x563618[_0x5708('0xc')]];}exports[_0x5708('0xd')]=function(_0x3cfa4d){try{utils[_0x5708('0xe')](util['format'](_0x5708('0xf'),_0x3cfa4d[_0x5708('0xc')]),_0x3cfa4d);utils[_0x5708('0x2')](util[_0x5708('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3cfa4d[_0x5708('0xc')],_0x3cfa4d['application'],_0x3cfa4d[_0x5708('0x10')]));if(_0x3cfa4d[_0x5708('0x11')][_0x5708('0x12')]()=='set'&&_[_0x5708('0x13')](_0x3cfa4d[_0x5708('0x10')]['toLowerCase'](),'cdr(routeid)')){var _0x2031a4=_0x3cfa4d[_0x5708('0x10')]['split']('=');dials[_0x3cfa4d[_0x5708('0xc')]]={'routeId':_0x2031a4[0x1]};}}catch(_0x4b8ca9){utils['error'](util[_0x5708('0x3')](_0x5708('0xf'),_0x3cfa4d[_0x5708('0xc')]),_0x4b8ca9);}};exports[_0x5708('0x14')]=function(_0x321102){try{utils[_0x5708('0xe')](util['format'](_0x5708('0x15'),_0x321102[_0x5708('0xc')]),_0x321102);if(!_[_0x5708('0x16')](_0x321102[_0x5708('0x17')][_0x5708('0x18')])){utils[_0x5708('0x2')](util['format'](_0x5708('0x19'),_0x321102[_0x5708('0xc')],_0x321102['value']));dials[_0x321102[_0x5708('0xc')]]={'routeId':_0x321102['value']};}}catch(_0x33a138){utils[_0x5708('0x1a')](util['format']('[%s][dials][varset]',_0x321102['uniqueid']),_0x33a138);}};exports[_0x5708('0x1b')]=function(_0x415f52){try{if(!_[_0x5708('0x16')](dials[_0x415f52[_0x5708('0xc')]])){utils[_0x5708('0xe')](util[_0x5708('0x3')](_0x5708('0x1c'),_0x415f52['uniqueid']),_0x415f52);dials[_0x415f52['uniqueid']]=_[_0x5708('0x1d')](dials[_0x415f52['uniqueid']],_0x415f52);dials[_0x415f52[_0x5708('0xc')]][_0x5708('0x1e')]=utils[_0x5708('0x1f')]();dials[_0x415f52[_0x5708('0xc')]]['lastevent']=_0x5708('0x20');utils['info'](util[_0x5708('0x3')](_0x5708('0x21'),_0x415f52[_0x5708('0xc')],dials[_0x415f52[_0x5708('0xc')]][_0x5708('0x1e')]));}}catch(_0xeb5412){utils['error'](util[_0x5708('0x3')](_0x5708('0x1c'),_0x415f52['uniqueid']),_0xeb5412);}};exports[_0x5708('0x22')]=function(_0x37c495){try{if(!_['isNil'](dials[_0x37c495[_0x5708('0xc')]])){utils[_0x5708('0xe')](util[_0x5708('0x3')]('[%s][dials][dialend]',_0x37c495['uniqueid']),_0x37c495);dials[_0x37c495[_0x5708('0xc')]][_0x5708('0x9')]=_0x37c495[_0x5708('0x9')];if(_0x37c495['dialstatus']==_0x5708('0x23')){dials[_0x37c495[_0x5708('0xc')]]=_[_0x5708('0x1d')](dials[_0x37c495[_0x5708('0xc')]],_0x37c495);dials[_0x37c495['uniqueid']][_0x5708('0x24')]=utils['now']();dials[_0x37c495[_0x5708('0xc')]][_0x5708('0x25')]=_0x5708('0x26');utils[_0x5708('0x2')](util[_0x5708('0x3')](_0x5708('0x27'),_0x37c495['uniqueid'],_0x37c495['dialstatus'],dials[_0x37c495[_0x5708('0xc')]][_0x5708('0x24')]));}else{utils['info'](util['format'](_0x5708('0x28'),_0x37c495['uniqueid'],_0x37c495[_0x5708('0x9')]));}}}catch(_0xd6ccad){utils[_0x5708('0x1a')](util[_0x5708('0x3')](_0x5708('0x29'),_0x37c495['uniqueid']),_0xd6ccad);}};exports['hangup']=function(_0xc1d866){try{if(!_[_0x5708('0x16')](dials[_0xc1d866[_0x5708('0xc')]])){utils[_0x5708('0xe')](util[_0x5708('0x3')](_0x5708('0x2a'),_0xc1d866[_0x5708('0xc')]),_0xc1d866);utils[_0x5708('0x2')](util['format'](_0x5708('0x2b'),_0xc1d866[_0x5708('0xc')],_0xc1d866[_0x5708('0x7')],_0xc1d866[_0x5708('0x2c')],_0xc1d866[_0x5708('0x2d')]));dials[_0xc1d866['uniqueid']]=_[_0x5708('0x1d')](dials[_0xc1d866[_0x5708('0xc')]],{'endtime':utils[_0x5708('0x1f')](),'lastevent':_0x5708('0x2e')});dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x2f')]=utils[_0x5708('0x30')](dials[_0xc1d866['uniqueid']][_0x5708('0x31')],dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x1e')]);dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x32')]=utils['diffTime'](dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x24')]||dials[_0xc1d866['uniqueid']]['endtime'],dials[_0xc1d866['uniqueid']][_0x5708('0x1e')]);dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x33')]=dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x24')]?utils[_0x5708('0x30')](dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x31')],dials[_0xc1d866[_0x5708('0xc')]][_0x5708('0x24')]):0x0;writeDB(dials[_0xc1d866[_0x5708('0xc')]]);}}catch(_0x163a1b){utils[_0x5708('0x1a')](util[_0x5708('0x3')](_0x5708('0x2a'),_0xc1d866[_0x5708('0xc')]),_0x163a1b);}}; \ No newline at end of file +var _0x0892=['debug','[%s][dials][newexten]','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','assign','lastevent','called','starttime','[%s][dials][dialbegin]','dialend','ANSWER','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','diffTime','endtime','holdtime','answertime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten'];(function(_0x2010e1,_0xf4a6c0){var _0x46d94c=function(_0x132c09){while(--_0x132c09){_0x2010e1['push'](_0x2010e1['shift']());}};_0x46d94c(++_0xf4a6c0);}(_0x0892,0x1e6));var _0x2089=function(_0x16f4dd,_0x5af46d){_0x16f4dd=_0x16f4dd-0x0;var _0x51b532=_0x0892[_0x16f4dd];return _0x51b532;};'use strict';var _=require(_0x2089('0x0'));var util=require(_0x2089('0x1'));var utils=require(_0x2089('0x2'));var dials={};function writeDB(_0x4f8253){utils[_0x2089('0x3')](util[_0x2089('0x4')](_0x2089('0x5'),_0x4f8253[_0x2089('0x6')],_0x4f8253[_0x2089('0x7')],_0x4f8253[_0x2089('0x8')],_0x4f8253['calleridnum'],_0x4f8253[_0x2089('0x9')],_0x4f8253[_0x2089('0xa')]));utils[_0x2089('0xb')](_0x2089('0xc'),_0x4f8253);delete dials[_0x4f8253[_0x2089('0x6')]];}exports[_0x2089('0xd')]=function(_0x435f1b){try{utils[_0x2089('0xe')](util[_0x2089('0x4')](_0x2089('0xf'),_0x435f1b[_0x2089('0x6')]),_0x435f1b);utils[_0x2089('0x3')](util[_0x2089('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x435f1b['uniqueid'],_0x435f1b[_0x2089('0x10')],_0x435f1b[_0x2089('0x11')]));if(_0x435f1b['application']['toLowerCase']()==_0x2089('0x12')&&_[_0x2089('0x13')](_0x435f1b[_0x2089('0x11')][_0x2089('0x14')](),_0x2089('0x15'))){var _0x1bd148=_0x435f1b[_0x2089('0x11')][_0x2089('0x16')]('=');dials[_0x435f1b[_0x2089('0x6')]]={'routeId':_0x1bd148[0x1]};}}catch(_0x53bafd){utils[_0x2089('0x17')](util[_0x2089('0x4')](_0x2089('0xf'),_0x435f1b[_0x2089('0x6')]),_0x53bafd);}};exports['varset']=function(_0x52a306){try{utils['debug'](util['format'](_0x2089('0x18'),_0x52a306[_0x2089('0x6')]),_0x52a306);if(!_[_0x2089('0x19')](_0x52a306[_0x2089('0x1a')][_0x2089('0x1b')])){utils[_0x2089('0x3')](util[_0x2089('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x52a306[_0x2089('0x6')],_0x52a306[_0x2089('0x1c')]));dials[_0x52a306[_0x2089('0x6')]]={'routeId':_0x52a306[_0x2089('0x1c')]};}}catch(_0x48e5ad){utils['error'](util[_0x2089('0x4')]('[%s][dials][varset]',_0x52a306['uniqueid']),_0x48e5ad);}};exports[_0x2089('0x1d')]=function(_0x34c95e){try{if(!_[_0x2089('0x19')](dials[_0x34c95e[_0x2089('0x6')]])){utils[_0x2089('0xe')](util[_0x2089('0x4')]('[%s][dials][dialbegin]',_0x34c95e[_0x2089('0x6')]),_0x34c95e);dials[_0x34c95e['uniqueid']]=_[_0x2089('0x1e')](dials[_0x34c95e['uniqueid']],_0x34c95e);dials[_0x34c95e[_0x2089('0x6')]]['starttime']=utils['now']();dials[_0x34c95e['uniqueid']][_0x2089('0x1f')]=_0x2089('0x20');utils[_0x2089('0x3')](util[_0x2089('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x34c95e['uniqueid'],dials[_0x34c95e[_0x2089('0x6')]][_0x2089('0x21')]));}}catch(_0x5b0f6e){utils[_0x2089('0x17')](util[_0x2089('0x4')](_0x2089('0x22'),_0x34c95e[_0x2089('0x6')]),_0x5b0f6e);}};exports[_0x2089('0x23')]=function(_0x133b96){try{if(!_['isNil'](dials[_0x133b96[_0x2089('0x6')]])){utils[_0x2089('0xe')](util[_0x2089('0x4')]('[%s][dials][dialend]',_0x133b96[_0x2089('0x6')]),_0x133b96);dials[_0x133b96[_0x2089('0x6')]][_0x2089('0xa')]=_0x133b96[_0x2089('0xa')];if(_0x133b96[_0x2089('0xa')]==_0x2089('0x24')){dials[_0x133b96[_0x2089('0x6')]]=_['assign'](dials[_0x133b96[_0x2089('0x6')]],_0x133b96);dials[_0x133b96['uniqueid']]['answertime']=utils[_0x2089('0x25')]();dials[_0x133b96[_0x2089('0x6')]]['lastevent']=_0x2089('0x26');utils[_0x2089('0x3')](util[_0x2089('0x4')](_0x2089('0x27'),_0x133b96[_0x2089('0x6')],_0x133b96[_0x2089('0xa')],dials[_0x133b96[_0x2089('0x6')]]['answertime']));}else{utils[_0x2089('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x133b96[_0x2089('0x6')],_0x133b96['dialstatus']));}}}catch(_0x1dfbb9){utils[_0x2089('0x17')](util[_0x2089('0x4')](_0x2089('0x28'),_0x133b96[_0x2089('0x6')]),_0x1dfbb9);}};exports[_0x2089('0x29')]=function(_0x49ba0f){try{if(!_[_0x2089('0x19')](dials[_0x49ba0f[_0x2089('0x6')]])){utils['debug'](util['format'](_0x2089('0x2a'),_0x49ba0f['uniqueid']),_0x49ba0f);utils['info'](util['format'](_0x2089('0x2b'),_0x49ba0f[_0x2089('0x6')],_0x49ba0f[_0x2089('0x2c')],_0x49ba0f['calleridname'],_0x49ba0f['cause-txt']));dials[_0x49ba0f[_0x2089('0x6')]]=_[_0x2089('0x1e')](dials[_0x49ba0f[_0x2089('0x6')]],{'endtime':utils[_0x2089('0x25')](),'lastevent':'complete'});dials[_0x49ba0f[_0x2089('0x6')]]['duration']=utils[_0x2089('0x2d')](dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x2e')],dials[_0x49ba0f['uniqueid']]['starttime']);dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x2f')]=utils['diffTime'](dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x30')]||dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x2e')],dials[_0x49ba0f['uniqueid']][_0x2089('0x21')]);dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x31')]=dials[_0x49ba0f[_0x2089('0x6')]]['answertime']?utils[_0x2089('0x2d')](dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x2e')],dials[_0x49ba0f[_0x2089('0x6')]][_0x2089('0x30')]):0x0;writeDB(dials[_0x49ba0f['uniqueid']]);}}catch(_0x5d8bbf){utils[_0x2089('0x17')](util[_0x2089('0x4')](_0x2089('0x2a'),_0x49ba0f['uniqueid']),_0x5d8bbf);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index ab069d2..96c5cd0 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 _0x2280=['[%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','[%s][index][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]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','username','keepConnected','xdr','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','[%s][index][devicestatechange]','device','devicestatechange','format','agentcalled','debug'];(function(_0x58a474,_0x43e84d){var _0x76da16=function(_0x309faa){while(--_0x309faa){_0x58a474['push'](_0x58a474['shift']());}};_0x76da16(++_0x43e84d);}(_0x2280,0x1e6));var _0x0228=function(_0x833f58,_0x480fa6){_0x833f58=_0x833f58-0x0;var _0x36a3a6=_0x2280[_0x833f58];return _0x36a3a6;};var AsteriskManager=require(_0x0228('0x0'));var config=require(_0x0228('0x1'));var utils=require('./utils');var util=require(_0x0228('0x2'));var ami=new AsteriskManager(config[_0x0228('0x3')]['port'],config['asterisk']['ip'],config[_0x0228('0x3')][_0x0228('0x4')],config['asterisk']['password'],!![]);ami[_0x0228('0x5')]();if(config['xdr']&&config[_0x0228('0x6')]['disabled']){utils['info'](_0x0228('0x7'));}else{var agents=require('./agents.controller');var calls=require(_0x0228('0x8'));var queues=require(_0x0228('0x9'));var recordings=require(_0x0228('0xa'));var members=require(_0x0228('0xb'));var dials=require(_0x0228('0xc'));var transfers=require(_0x0228('0xd'));var core=require('./core.controller');ami['on'](_0x0228('0xe'),core[_0x0228('0xe')]);ami['on'](_0x0228('0xf'),core[_0x0228('0xf')]);ami['on'](_0x0228('0x10'),core[_0x0228('0x10')]);ami['on'](_0x0228('0x11'),core['error']);ami['on'](_0x0228('0x12'),core[_0x0228('0x12')]);ami['on'](_0x0228('0x13'),core[_0x0228('0x13')]);ami['on']('devicestatechange',function(_0x44506f){try{utils['debug'](util['format'](_0x0228('0x14'),_0x44506f[_0x0228('0x15')]),_0x44506f);members[_0x0228('0x16')](_0x44506f);}catch(_0x5e27a7){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x14'),_0x44506f[_0x0228('0x15')]),_0x5e27a7);}});ami['on'](_0x0228('0x18'),function(_0x224162){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x1a'),_0x224162['uniqueid']),_0x224162);agents[_0x0228('0x18')](_0x224162);}catch(_0x5443f1){utils['error'](util[_0x0228('0x17')](_0x0228('0x1a'),_0x224162[_0x0228('0x1b')]),_0x5443f1);}});ami['on'](_0x0228('0x1c'),function(_0x585139){try{utils['debug'](util[_0x0228('0x17')](_0x0228('0x1d'),_0x585139[_0x0228('0x1b')]),_0x585139);agents[_0x0228('0x1c')](_0x585139);}catch(_0x51053e){utils['error'](util[_0x0228('0x17')]('[%s][index][agentringnoanswer]',_0x585139['uniqueid']),_0x51053e);}});ami['on'](_0x0228('0x1e'),function(_0x2bdfb4){try{utils[_0x0228('0x19')](util['format'](_0x0228('0x1f'),_0x2bdfb4['uniqueid']),_0x2bdfb4);agents['agentconnect'](_0x2bdfb4);queues[_0x0228('0x1e')](_0x2bdfb4);}catch(_0x2e61c8){utils['error'](util['format'](_0x0228('0x1f'),_0x2bdfb4[_0x0228('0x1b')]),_0x2e61c8);}});ami['on'](_0x0228('0x20'),function(_0x1df31c){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x21'),_0x1df31c[_0x0228('0x1b')]),_0x1df31c);agents[_0x0228('0x20')](_0x1df31c);queues['agentcomplete'](_0x1df31c);members[_0x0228('0x20')](_0x1df31c);}catch(_0x44dc17){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x21'),_0x1df31c[_0x0228('0x1b')]),_0x44dc17);}});ami['on']('queuecallerabandon',function(_0x1dc0e7){try{utils['debug'](util[_0x0228('0x17')](_0x0228('0x22'),_0x1dc0e7['uniqueid']),_0x1dc0e7);agents[_0x0228('0x23')](_0x1dc0e7);queues[_0x0228('0x23')](_0x1dc0e7);}catch(_0x39be9e){utils['error'](util[_0x0228('0x17')](_0x0228('0x22'),_0x1dc0e7[_0x0228('0x1b')]),_0x39be9e);}});ami['on'](_0x0228('0x24'),function(_0x30898d){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x25'),_0x30898d[_0x0228('0x1b')]),_0x30898d);queues[_0x0228('0x24')](_0x30898d);recordings[_0x0228('0x24')](_0x30898d);}catch(_0x4ef317){utils['error'](util[_0x0228('0x17')](_0x0228('0x25'),_0x30898d[_0x0228('0x1b')]),_0x4ef317);}});ami['on'](_0x0228('0x26'),function(_0x100249){try{utils[_0x0228('0x19')](util['format'](_0x0228('0x27'),_0x100249[_0x0228('0x1b')]),_0x100249);queues[_0x0228('0x26')](_0x100249);}catch(_0x4967b7){utils[_0x0228('0x11')](util['format']('[%s][index][queuecallerleave]',_0x100249[_0x0228('0x1b')]),_0x4967b7);}});ami['on'](_0x0228('0x28'),function(_0x5744f7){try{utils['debug'](util[_0x0228('0x17')](_0x0228('0x29'),_0x5744f7['uniqueid']),_0x5744f7);queues['musiconholdstart'](_0x5744f7);calls[_0x0228('0x28')](_0x5744f7);}catch(_0x48770a){utils[_0x0228('0x11')](util['format']('[%s][index][musiconholdstart]',_0x5744f7[_0x0228('0x1b')]),_0x48770a);}});ami['on'](_0x0228('0x2a'),function(_0x452e0c){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x2b'),_0x452e0c['uniqueid']),_0x452e0c);queues[_0x0228('0x2a')](_0x452e0c);calls[_0x0228('0x2a')](_0x452e0c);}catch(_0x4b5374){utils['error'](util['format'](_0x0228('0x2b'),_0x452e0c[_0x0228('0x1b')]),_0x4b5374);}});ami['on'](_0x0228('0x2c'),function(_0x2da60d){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x2d'),_0x2da60d[_0x0228('0x1b')]),_0x2da60d);calls['newstate'](_0x2da60d);recordings[_0x0228('0x2c')](_0x2da60d);}catch(_0x4d581c){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x2d'),_0x2da60d[_0x0228('0x1b')]),_0x4d581c);}});ami['on'](_0x0228('0x2e'),function(_0x57322f){try{utils[_0x0228('0x19')](util[_0x0228('0x17')]('[%s][index][hangup]',_0x57322f[_0x0228('0x1b')]),_0x57322f);calls[_0x0228('0x2e')](_0x57322f);recordings['hangup'](_0x57322f);dials[_0x0228('0x2e')](_0x57322f);agents[_0x0228('0x2e')](_0x57322f);queues['hangup'](_0x57322f);}catch(_0x27cce7){utils['error'](util[_0x0228('0x17')](_0x0228('0x2f'),_0x57322f['uniqueid']),_0x27cce7);}});ami['on'](_0x0228('0x30'),function(_0x411d59){try{utils[_0x0228('0x19')](util['format'](_0x0228('0x31'),_0x411d59[_0x0228('0x1b')]),_0x411d59);members[_0x0228('0x30')](_0x411d59);}catch(_0x1dccd4){utils[_0x0228('0x11')](util[_0x0228('0x17')]('[%s][index][cdr]',_0x411d59['uniqueid']),_0x1dccd4);}});ami['on'](_0x0228('0x32'),function(_0x4925f3){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x33'),_0x4925f3[_0x0228('0x1b')]),_0x4925f3);queues[_0x0228('0x32')](_0x4925f3);agents[_0x0228('0x32')](_0x4925f3);transfers[_0x0228('0x32')](_0x4925f3);}catch(_0x4c3532){utils['error'](util['format'](_0x0228('0x33'),_0x4925f3[_0x0228('0x1b')]),_0x4c3532);}});ami['on']('attendedtransfer',function(_0x57f3b1){try{utils[_0x0228('0x19')](util[_0x0228('0x17')]('[%s][index][attendedtransfer]',_0x57f3b1[_0x0228('0x34')]),_0x57f3b1);queues[_0x0228('0x35')](_0x57f3b1);transfers[_0x0228('0x35')](_0x57f3b1);agents[_0x0228('0x35')](_0x57f3b1);calls[_0x0228('0x35')](_0x57f3b1);}catch(_0x287b6b){utils['error'](util[_0x0228('0x17')]('[%s][index][attendedtransfer]',_0x57f3b1[_0x0228('0x34')]),_0x287b6b);}});ami['on'](_0x0228('0x36'),function(_0x38dc08){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x37'),_0x38dc08[_0x0228('0x1b')]),_0x38dc08);queues[_0x0228('0x36')](_0x38dc08);recordings[_0x0228('0x36')](_0x38dc08);calls[_0x0228('0x36')](_0x38dc08);dials[_0x0228('0x36')](_0x38dc08);}catch(_0x1ff3f9){utils[_0x0228('0x11')](util['format'](_0x0228('0x37'),_0x38dc08[_0x0228('0x1b')]),_0x1ff3f9);}});ami['on'](_0x0228('0x38'),function(_0x2d637a){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x39'),_0x2d637a[_0x0228('0x1b')]),_0x2d637a);calls[_0x0228('0x38')](_0x2d637a);recordings[_0x0228('0x38')](_0x2d637a);dials[_0x0228('0x38')](_0x2d637a);}catch(_0x2adec8){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x39'),_0x2d637a['uniqueid']),_0x2adec8);}});ami['on'](_0x0228('0x3a'),function(_0x5e9268){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x3b'),_0x5e9268[_0x0228('0x1b')]),_0x5e9268);calls[_0x0228('0x3a')](_0x5e9268);recordings[_0x0228('0x3a')](_0x5e9268);}catch(_0x5bf8cb){utils[_0x0228('0x11')](util[_0x0228('0x17')](_0x0228('0x3b'),_0x5e9268[_0x0228('0x1b')]),_0x5bf8cb);}});ami['on']('dialbegin',function(_0x3047e7){try{utils[_0x0228('0x19')](util[_0x0228('0x17')](_0x0228('0x3c'),_0x3047e7[_0x0228('0x1b')]),_0x3047e7);dials[_0x0228('0x3d')](_0x3047e7);}catch(_0x385bc3){utils['error'](util[_0x0228('0x17')](_0x0228('0x3e'),_0x3047e7[_0x0228('0x1b')]),_0x385bc3);}});ami['on']('dialend',function(_0x57c3ab){try{utils['debug'](util['format'](_0x0228('0x3f'),_0x57c3ab[_0x0228('0x1b')]),_0x57c3ab);dials['dialend'](_0x57c3ab);}catch(_0x583961){utils[_0x0228('0x11')](util['format']('[%s][index][dialend]',_0x57c3ab[_0x0228('0x1b')]),_0x583961);}});} \ No newline at end of file +var _0x4f73=['dialbegin','[%s]dialbegin','dialend','asterisk-manager','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','device','[%s][index][devicestatechange]','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][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]','[%s][index][dialbegin]'];(function(_0x2762f5,_0x444659){var _0x5cd03b=function(_0x5237b3){while(--_0x5237b3){_0x2762f5['push'](_0x2762f5['shift']());}};_0x5cd03b(++_0x444659);}(_0x4f73,0x152));var _0x34f7=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x4f73[_0x3f0b30];return _0x2748a5;};var AsteriskManager=require(_0x34f7('0x0'));var config=require('../../config/environment');var utils=require(_0x34f7('0x1'));var util=require(_0x34f7('0x2'));var ami=new AsteriskManager(config[_0x34f7('0x3')][_0x34f7('0x4')],config[_0x34f7('0x3')]['ip'],config[_0x34f7('0x3')][_0x34f7('0x5')],config[_0x34f7('0x3')][_0x34f7('0x6')],!![]);ami[_0x34f7('0x7')]();if(config[_0x34f7('0x8')]&&config[_0x34f7('0x8')][_0x34f7('0x9')]){utils['info'](_0x34f7('0xa'));}else{var agents=require(_0x34f7('0xb'));var calls=require(_0x34f7('0xc'));var queues=require(_0x34f7('0xd'));var recordings=require(_0x34f7('0xe'));var members=require(_0x34f7('0xf'));var dials=require(_0x34f7('0x10'));var transfers=require(_0x34f7('0x11'));var core=require(_0x34f7('0x12'));ami['on'](_0x34f7('0x13'),core[_0x34f7('0x13')]);ami['on'](_0x34f7('0x14'),core[_0x34f7('0x14')]);ami['on']('fullybooted',core[_0x34f7('0x15')]);ami['on'](_0x34f7('0x16'),core[_0x34f7('0x16')]);ami['on'](_0x34f7('0x17'),core[_0x34f7('0x17')]);ami['on'](_0x34f7('0x18'),core[_0x34f7('0x18')]);ami['on']('devicestatechange',function(_0x4b52e8){try{utils[_0x34f7('0x19')](util['format']('[%s][index][devicestatechange]',_0x4b52e8[_0x34f7('0x1a')]),_0x4b52e8);members['devicestatechange'](_0x4b52e8);}catch(_0x4d56d0){utils[_0x34f7('0x16')](util['format'](_0x34f7('0x1b'),_0x4b52e8['device']),_0x4d56d0);}});ami['on']('agentcalled',function(_0x1e3397){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')](_0x34f7('0x1d'),_0x1e3397[_0x34f7('0x1e')]),_0x1e3397);agents['agentcalled'](_0x1e3397);}catch(_0x3605ea){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x1d'),_0x1e3397[_0x34f7('0x1e')]),_0x3605ea);}});ami['on'](_0x34f7('0x1f'),function(_0x35a464){try{utils['debug'](util[_0x34f7('0x1c')]('[%s][index][agentringnoanswer]',_0x35a464[_0x34f7('0x1e')]),_0x35a464);agents[_0x34f7('0x1f')](_0x35a464);}catch(_0xd409a7){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x20'),_0x35a464[_0x34f7('0x1e')]),_0xd409a7);}});ami['on'](_0x34f7('0x21'),function(_0x4b001f){try{utils[_0x34f7('0x19')](util['format'](_0x34f7('0x22'),_0x4b001f[_0x34f7('0x1e')]),_0x4b001f);agents[_0x34f7('0x21')](_0x4b001f);queues['agentconnect'](_0x4b001f);}catch(_0x2e49da){utils[_0x34f7('0x16')](util['format'](_0x34f7('0x22'),_0x4b001f[_0x34f7('0x1e')]),_0x2e49da);}});ami['on'](_0x34f7('0x23'),function(_0x342d73){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')](_0x34f7('0x24'),_0x342d73[_0x34f7('0x1e')]),_0x342d73);agents[_0x34f7('0x23')](_0x342d73);queues[_0x34f7('0x23')](_0x342d73);members[_0x34f7('0x23')](_0x342d73);}catch(_0x54a27b){utils[_0x34f7('0x16')](util['format'](_0x34f7('0x24'),_0x342d73[_0x34f7('0x1e')]),_0x54a27b);}});ami['on']('queuecallerabandon',function(_0x4474f2){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')]('[%s][index][queuecallerabandon]',_0x4474f2[_0x34f7('0x1e')]),_0x4474f2);agents[_0x34f7('0x25')](_0x4474f2);queues['queuecallerabandon'](_0x4474f2);}catch(_0x59c6eb){utils[_0x34f7('0x16')](util['format']('[%s][index][queuecallerabandon]',_0x4474f2[_0x34f7('0x1e')]),_0x59c6eb);}});ami['on'](_0x34f7('0x26'),function(_0x365496){try{utils['debug'](util[_0x34f7('0x1c')](_0x34f7('0x27'),_0x365496[_0x34f7('0x1e')]),_0x365496);queues[_0x34f7('0x26')](_0x365496);recordings['queuecallerjoin'](_0x365496);}catch(_0xb0f8f7){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x27'),_0x365496['uniqueid']),_0xb0f8f7);}});ami['on'](_0x34f7('0x28'),function(_0x471e2c){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')](_0x34f7('0x29'),_0x471e2c[_0x34f7('0x1e')]),_0x471e2c);queues[_0x34f7('0x28')](_0x471e2c);}catch(_0x12fc67){utils[_0x34f7('0x16')](util['format'](_0x34f7('0x29'),_0x471e2c[_0x34f7('0x1e')]),_0x12fc67);}});ami['on'](_0x34f7('0x2a'),function(_0x123803){try{utils['debug'](util[_0x34f7('0x1c')](_0x34f7('0x2b'),_0x123803[_0x34f7('0x1e')]),_0x123803);queues[_0x34f7('0x2a')](_0x123803);calls['musiconholdstart'](_0x123803);}catch(_0x24f437){utils['error'](util[_0x34f7('0x1c')](_0x34f7('0x2b'),_0x123803[_0x34f7('0x1e')]),_0x24f437);}});ami['on'](_0x34f7('0x2c'),function(_0x9b7bdc){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')](_0x34f7('0x2d'),_0x9b7bdc['uniqueid']),_0x9b7bdc);queues['musiconholdstop'](_0x9b7bdc);calls['musiconholdstop'](_0x9b7bdc);}catch(_0x5dc876){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x2d'),_0x9b7bdc[_0x34f7('0x1e')]),_0x5dc876);}});ami['on'](_0x34f7('0x2e'),function(_0x69345a){try{utils['debug'](util[_0x34f7('0x1c')](_0x34f7('0x2f'),_0x69345a['uniqueid']),_0x69345a);calls['newstate'](_0x69345a);recordings[_0x34f7('0x2e')](_0x69345a);}catch(_0x5800fd){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x2f'),_0x69345a[_0x34f7('0x1e')]),_0x5800fd);}});ami['on'](_0x34f7('0x30'),function(_0x3f601c){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')]('[%s][index][hangup]',_0x3f601c[_0x34f7('0x1e')]),_0x3f601c);calls['hangup'](_0x3f601c);recordings[_0x34f7('0x30')](_0x3f601c);dials[_0x34f7('0x30')](_0x3f601c);agents[_0x34f7('0x30')](_0x3f601c);queues[_0x34f7('0x30')](_0x3f601c);}catch(_0x2df103){utils['error'](util['format'](_0x34f7('0x31'),_0x3f601c[_0x34f7('0x1e')]),_0x2df103);}});ami['on'](_0x34f7('0x32'),function(_0x12bc40){try{utils[_0x34f7('0x19')](util['format'](_0x34f7('0x33'),_0x12bc40['uniqueid']),_0x12bc40);members['cdr'](_0x12bc40);}catch(_0x9cb6fa){utils[_0x34f7('0x16')](util['format'](_0x34f7('0x33'),_0x12bc40['uniqueid']),_0x9cb6fa);}});ami['on'](_0x34f7('0x34'),function(_0xf84d2a){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')]('[%s][index][blindtransfer]',_0xf84d2a[_0x34f7('0x1e')]),_0xf84d2a);queues[_0x34f7('0x34')](_0xf84d2a);agents[_0x34f7('0x34')](_0xf84d2a);transfers[_0x34f7('0x34')](_0xf84d2a);}catch(_0x3e8b95){utils[_0x34f7('0x16')](util['format'](_0x34f7('0x35'),_0xf84d2a[_0x34f7('0x1e')]),_0x3e8b95);}});ami['on'](_0x34f7('0x36'),function(_0x550251){try{utils[_0x34f7('0x19')](util['format'](_0x34f7('0x37'),_0x550251[_0x34f7('0x38')]),_0x550251);queues[_0x34f7('0x36')](_0x550251);transfers['attendedtransfer'](_0x550251);agents[_0x34f7('0x36')](_0x550251);calls[_0x34f7('0x36')](_0x550251);}catch(_0x3c012a){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x37'),_0x550251['origtransfereruniqueid']),_0x3c012a);}});ami['on'](_0x34f7('0x39'),function(_0x367a47){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')](_0x34f7('0x3a'),_0x367a47[_0x34f7('0x1e')]),_0x367a47);queues[_0x34f7('0x39')](_0x367a47);recordings[_0x34f7('0x39')](_0x367a47);calls['varset'](_0x367a47);dials['varset'](_0x367a47);}catch(_0x1b967b){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x3a'),_0x367a47[_0x34f7('0x1e')]),_0x1b967b);}});ami['on'](_0x34f7('0x3b'),function(_0x1a0679){try{utils[_0x34f7('0x19')](util[_0x34f7('0x1c')]('[%s][index][newexten]',_0x1a0679[_0x34f7('0x1e')]),_0x1a0679);calls['newexten'](_0x1a0679);recordings[_0x34f7('0x3b')](_0x1a0679);dials['newexten'](_0x1a0679);}catch(_0x3ab7e7){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x3c'),_0x1a0679['uniqueid']),_0x3ab7e7);}});ami['on'](_0x34f7('0x3d'),function(_0x283b8b){try{utils[_0x34f7('0x19')](util['format'](_0x34f7('0x3e'),_0x283b8b[_0x34f7('0x1e')]),_0x283b8b);calls[_0x34f7('0x3d')](_0x283b8b);recordings[_0x34f7('0x3d')](_0x283b8b);}catch(_0x403d20){utils['error'](util['format'](_0x34f7('0x3e'),_0x283b8b['uniqueid']),_0x403d20);}});ami['on']('dialbegin',function(_0x34ffed){try{utils['debug'](util[_0x34f7('0x1c')](_0x34f7('0x3f'),_0x34ffed[_0x34f7('0x1e')]),_0x34ffed);dials[_0x34f7('0x40')](_0x34ffed);}catch(_0x15838c){utils[_0x34f7('0x16')](util[_0x34f7('0x1c')](_0x34f7('0x41'),_0x34ffed['uniqueid']),_0x15838c);}});ami['on'](_0x34f7('0x42'),function(_0x39d6e1){try{utils[_0x34f7('0x19')](util['format']('[%s][index][dialend]',_0x39d6e1[_0x34f7('0x1e')]),_0x39d6e1);dials[_0x34f7('0x42')](_0x39d6e1);}catch(_0x4736bd){utils['error'](util[_0x34f7('0x1c')]('[%s][index][dialend]',_0x39d6e1[_0x34f7('0x1e')]),_0x4736bd);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4f833cb..c08b24b 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 _0x1acc=['assign','data1','type','source','data3','destination','data2','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','membername','getUserByInterface','then','internal','request','getUserByName','split','name','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','[%s][members][devicestatechange]','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','device','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','agentcomplete','debug','queue','cdr','[%s][members][cdr]','channel'];(function(_0x535f00,_0x4a958f){var _0x1f0026=function(_0x3bc568){while(--_0x3bc568){_0x535f00['push'](_0x535f00['shift']());}};_0x1f0026(++_0x4a958f);}(_0x1acc,0x15f));var _0xc1ac=function(_0xc35c14,_0x4663cd){_0xc35c14=_0xc35c14-0x0;var _0x3a853e=_0x1acc[_0xc35c14];return _0x3a853e;};'use strict';var _=require('lodash');var util=require(_0xc1ac('0x0'));var utils=require('./utils');var members={};var exclude=[_0xc1ac('0x1'),_0xc1ac('0x2')];function writeDB(_0x4d1eb5){utils[_0xc1ac('0x3')](util[_0xc1ac('0x4')](_0xc1ac('0x5'),_0x4d1eb5['uniqueid'],_0x4d1eb5[_0xc1ac('0x6')],_0x4d1eb5['channel'],_0x4d1eb5['data2'],_0x4d1eb5[_0xc1ac('0x7')],_0x4d1eb5['type']));if(_0x4d1eb5[_0xc1ac('0x6')]){utils[_0xc1ac('0x8')](_0x4d1eb5[_0xc1ac('0x6')])[_0xc1ac('0x9')](function(_0x336d32){if(_0x336d32){_0x4d1eb5['membername']=_0x336d32['name'];_0x4d1eb5[_0xc1ac('0xa')]=_0x336d32[_0xc1ac('0xa')];utils[_0xc1ac('0xb')]('CreateMemberReport',_0x4d1eb5);}else{utils[_0xc1ac('0xc')](_0x4d1eb5[_0xc1ac('0x6')][_0xc1ac('0xd')]('/')[0x1])[_0xc1ac('0x9')](function(_0x14167c){if(_0x14167c){_0x4d1eb5[_0xc1ac('0x7')]=_0x14167c[_0xc1ac('0xe')];_0x4d1eb5[_0xc1ac('0xa')]=_0x14167c[_0xc1ac('0xa')];utils[_0xc1ac('0xb')](_0xc1ac('0xf'),_0x4d1eb5);}});}})[_0xc1ac('0x10')](function(_0x501a08){utils[_0xc1ac('0x11')](util[_0xc1ac('0x4')](_0xc1ac('0x12'),_0x4d1eb5[_0xc1ac('0x13')]),_0x501a08);});}delete members[_0x4d1eb5['interface']];}function startsWith(_0x27f2c7,_0x138019){return _[_0xc1ac('0x14')](_0x27f2c7,function(_0x2b51c6){return _[_0xc1ac('0x15')](_0x138019,_0x2b51c6);});}exports['devicestatechange']=function(_0x34f75a){try{utils['debug'](util[_0xc1ac('0x4')](_0xc1ac('0x16'),members[_0x34f75a['device']]?members[_0x34f75a['device']][_0xc1ac('0x13')]:_0x34f75a['device']),_0x34f75a);utils[_0xc1ac('0x3')](util[_0xc1ac('0x4')](_0xc1ac('0x17'),members[_0x34f75a[_0xc1ac('0x18')]]?members[_0x34f75a[_0xc1ac('0x18')]]['uniqueid']:_0x34f75a[_0xc1ac('0x18')],_0x34f75a[_0xc1ac('0x19')],_0x34f75a[_0xc1ac('0x18')]));switch(_0x34f75a[_0xc1ac('0x19')]){case _0xc1ac('0x1a'):case _0xc1ac('0x1b'):if(!startsWith(exclude,_0x34f75a[_0xc1ac('0x18')])){members[_0x34f75a[_0xc1ac('0x18')]]={'channel':_0xc1ac('0x1c'),'interface':_0x34f75a[_0xc1ac('0x18')],'type':_0xc1ac('0x1d'),'enterAt':utils[_0xc1ac('0x1e')](),'role':'agent'};}break;case _0xc1ac('0x1f'):if(!_[_0xc1ac('0x20')](members[_0x34f75a['device']])){members[_0x34f75a['device']][_0xc1ac('0x21')]=utils[_0xc1ac('0x1e')]();members[_0x34f75a[_0xc1ac('0x18')]][_0xc1ac('0x22')]=utils['diffTime'](members[_0x34f75a[_0xc1ac('0x18')]][_0xc1ac('0x21')],members[_0x34f75a[_0xc1ac('0x18')]]['enterAt']);if(members[_0x34f75a[_0xc1ac('0x18')]][_0xc1ac('0x13')]){writeDB(members[_0x34f75a[_0xc1ac('0x18')]]);}}break;default:break;}}catch(_0x323568){utils[_0xc1ac('0x11')](util[_0xc1ac('0x4')](_0xc1ac('0x16'),members[_0x34f75a['device']]?members[_0x34f75a['device']][_0xc1ac('0x13')]:_0x34f75a[_0xc1ac('0x18')]),_0x323568);}};exports[_0xc1ac('0x23')]=function(_0x39e1ea){try{if(!_[_0xc1ac('0x20')](members[_0x39e1ea[_0xc1ac('0x6')]])){utils[_0xc1ac('0x24')](util[_0xc1ac('0x4')]('[%s][members][agentcomplete]',_0x39e1ea[_0xc1ac('0x13')]),_0x39e1ea);utils[_0xc1ac('0x3')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x39e1ea['uniqueid'],_0x39e1ea[_0xc1ac('0x6')],_0x39e1ea[_0xc1ac('0x25')]));members[_0x39e1ea[_0xc1ac('0x6')]]=_['assign'](members[_0x39e1ea['interface']],{'data4':_0x39e1ea['queue'],'uniqueid':_0x39e1ea[_0xc1ac('0x13')]});}}catch(_0x1e522f){utils['error'](util[_0xc1ac('0x4')]('[%s][members][agentcomplete]',_0x39e1ea[_0xc1ac('0x13')]),_0x1e522f);}};exports[_0xc1ac('0x26')]=function(_0x54302e){try{utils['debug'](util[_0xc1ac('0x4')](_0xc1ac('0x27'),_0x54302e[_0xc1ac('0x13')]),_0x54302e);if(_0x54302e[_0xc1ac('0x28')]){var _0x5ce7ea=_0x54302e['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x5ce7ea])){members[_0x5ce7ea]=_[_0xc1ac('0x29')](members[_0x5ce7ea],{'data1':members[_0x5ce7ea][_0xc1ac('0x2a')]||_0x54302e[_0xc1ac('0x2b')],'data2':members[_0x5ce7ea]['data2']||_0x54302e[_0xc1ac('0x2c')],'data3':members[_0x5ce7ea][_0xc1ac('0x2d')]||_0x54302e[_0xc1ac('0x2e')],'uniqueid':members[_0x5ce7ea][_0xc1ac('0x13')]||_0x54302e[_0xc1ac('0x13')]});utils['info'](util[_0xc1ac('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x54302e[_0xc1ac('0x13')],members[_0x5ce7ea][_0xc1ac('0x2a')],members[_0x5ce7ea][_0xc1ac('0x2f')],members[_0x5ce7ea]['data3']));if(members[_0x5ce7ea][_0xc1ac('0x21')]){writeDB(members[_0x5ce7ea]);}}}if(_0x54302e['destinationchannel']){var _0x110637=_0x54302e['destinationchannel']['split']('-')[0x0];if(!_[_0xc1ac('0x20')](members[_0x110637])){members[_0x110637]=_[_0xc1ac('0x29')](members[_0x110637],{'data1':members[_0x110637][_0xc1ac('0x2a')]||_0x54302e['type'],'data2':members[_0x110637][_0xc1ac('0x2f')]||_0x54302e[_0xc1ac('0x2c')],'data3':members[_0x110637][_0xc1ac('0x2d')]||_0x54302e[_0xc1ac('0x2e')],'uniqueid':members[_0x110637][_0xc1ac('0x13')]||_0x54302e[_0xc1ac('0x13')]});utils['info'](util[_0xc1ac('0x4')](_0xc1ac('0x30'),_0x54302e[_0xc1ac('0x13')],members[_0x110637][_0xc1ac('0x2a')],members[_0x110637][_0xc1ac('0x2f')],members[_0x110637][_0xc1ac('0x2d')]));if(members[_0x110637][_0xc1ac('0x21')]){writeDB(members[_0x110637]);}}}}catch(_0x9f9e19){utils[_0xc1ac('0x11')](util[_0xc1ac('0x4')]('[%s][members][cdr]',_0x54302e[_0xc1ac('0x13')]),_0x9f9e19);}}; \ No newline at end of file +var _0x6478=['lodash','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','uniqueid','some','devicestatechange','debug','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','assign','data1','type','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','data3'];(function(_0x178745,_0x1d3ab2){var _0x4c9128=function(_0x3f3849){while(--_0x3f3849){_0x178745['push'](_0x178745['shift']());}};_0x4c9128(++_0x1d3ab2);}(_0x6478,0x64));var _0x8647=function(_0x30e228,_0x1dd9ba){_0x30e228=_0x30e228-0x0;var _0x27d19a=_0x6478[_0x30e228];return _0x27d19a;};'use strict';var _=require(_0x8647('0x0'));var util=require(_0x8647('0x1'));var utils=require(_0x8647('0x2'));var members={};var exclude=[_0x8647('0x3'),'Queue:'];function writeDB(_0x882207){utils['info'](util[_0x8647('0x4')](_0x8647('0x5'),_0x882207['uniqueid'],_0x882207[_0x8647('0x6')],_0x882207[_0x8647('0x7')],_0x882207['data2'],_0x882207[_0x8647('0x8')],_0x882207['type']));if(_0x882207[_0x8647('0x6')]){utils[_0x8647('0x9')](_0x882207[_0x8647('0x6')])[_0x8647('0xa')](function(_0xbe3076){if(_0xbe3076){_0x882207[_0x8647('0x8')]=_0xbe3076[_0x8647('0xb')];_0x882207[_0x8647('0xc')]=_0xbe3076[_0x8647('0xc')];utils[_0x8647('0xd')]('CreateMemberReport',_0x882207);}else{utils[_0x8647('0xe')](_0x882207[_0x8647('0x6')][_0x8647('0xf')]('/')[0x1])[_0x8647('0xa')](function(_0x53083d){if(_0x53083d){_0x882207[_0x8647('0x8')]=_0x53083d[_0x8647('0xb')];_0x882207['internal']=_0x53083d[_0x8647('0xc')];utils[_0x8647('0xd')](_0x8647('0x10'),_0x882207);}});}})[_0x8647('0x11')](function(_0x4a4acf){utils[_0x8647('0x12')](util[_0x8647('0x4')]('[%s][members][writeDB]',_0x882207[_0x8647('0x13')]),_0x4a4acf);});}delete members[_0x882207[_0x8647('0x6')]];}function startsWith(_0x1bf05e,_0xaa2f15){return _[_0x8647('0x14')](_0x1bf05e,function(_0x26ea8b){return _['startsWith'](_0xaa2f15,_0x26ea8b);});}exports[_0x8647('0x15')]=function(_0x344e3d){try{utils[_0x8647('0x16')](util[_0x8647('0x4')](_0x8647('0x17'),members[_0x344e3d[_0x8647('0x18')]]?members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x13')]:_0x344e3d[_0x8647('0x18')]),_0x344e3d);utils[_0x8647('0x19')](util[_0x8647('0x4')](_0x8647('0x1a'),members[_0x344e3d[_0x8647('0x18')]]?members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x13')]:_0x344e3d['device'],_0x344e3d['state'],_0x344e3d[_0x8647('0x18')]));switch(_0x344e3d[_0x8647('0x1b')]){case _0x8647('0x1c'):case _0x8647('0x1d'):if(!startsWith(exclude,_0x344e3d[_0x8647('0x18')])){members[_0x344e3d[_0x8647('0x18')]]={'channel':_0x8647('0x1e'),'interface':_0x344e3d[_0x8647('0x18')],'type':_0x8647('0x1f'),'enterAt':utils[_0x8647('0x20')](),'role':_0x8647('0x21')};}break;case _0x8647('0x22'):if(!_[_0x8647('0x23')](members[_0x344e3d[_0x8647('0x18')]])){members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x24')]=utils['now']();members[_0x344e3d['device']]['duration']=utils[_0x8647('0x25')](members[_0x344e3d['device']]['exitAt'],members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x26')]);if(members[_0x344e3d['device']][_0x8647('0x13')]){writeDB(members[_0x344e3d['device']]);}}break;default:break;}}catch(_0x240a30){utils[_0x8647('0x12')](util[_0x8647('0x4')](_0x8647('0x17'),members[_0x344e3d['device']]?members[_0x344e3d[_0x8647('0x18')]][_0x8647('0x13')]:_0x344e3d[_0x8647('0x18')]),_0x240a30);}};exports[_0x8647('0x27')]=function(_0x30e71d){try{if(!_[_0x8647('0x23')](members[_0x30e71d[_0x8647('0x6')]])){utils[_0x8647('0x16')](util['format'](_0x8647('0x28'),_0x30e71d[_0x8647('0x13')]),_0x30e71d);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x30e71d[_0x8647('0x13')],_0x30e71d[_0x8647('0x6')],_0x30e71d['queue']));members[_0x30e71d[_0x8647('0x6')]]=_[_0x8647('0x29')](members[_0x30e71d[_0x8647('0x6')]],{'data4':_0x30e71d['queue'],'uniqueid':_0x30e71d[_0x8647('0x13')]});}}catch(_0x326583){utils[_0x8647('0x12')](util['format']('[%s][members][agentcomplete]',_0x30e71d[_0x8647('0x13')]),_0x326583);}};exports['cdr']=function(_0x5ac47c){try{utils['debug'](util['format']('[%s][members][cdr]',_0x5ac47c[_0x8647('0x13')]),_0x5ac47c);if(_0x5ac47c[_0x8647('0x7')]){var _0x35a6b4=_0x5ac47c[_0x8647('0x7')]['split']('-')[0x0];if(!_[_0x8647('0x23')](members[_0x35a6b4])){members[_0x35a6b4]=_[_0x8647('0x29')](members[_0x35a6b4],{'data1':members[_0x35a6b4][_0x8647('0x2a')]||_0x5ac47c[_0x8647('0x2b')],'data2':members[_0x35a6b4]['data2']||_0x5ac47c[_0x8647('0x2c')],'data3':members[_0x35a6b4]['data3']||_0x5ac47c[_0x8647('0x2d')],'uniqueid':members[_0x35a6b4]['uniqueid']||_0x5ac47c['uniqueid']});utils[_0x8647('0x19')](util[_0x8647('0x4')](_0x8647('0x2e'),_0x5ac47c['uniqueid'],members[_0x35a6b4][_0x8647('0x2a')],members[_0x35a6b4][_0x8647('0x2f')],members[_0x35a6b4]['data3']));if(members[_0x35a6b4][_0x8647('0x24')]){writeDB(members[_0x35a6b4]);}}}if(_0x5ac47c['destinationchannel']){var _0x487a0f=_0x5ac47c[_0x8647('0x30')]['split']('-')[0x0];if(!_[_0x8647('0x23')](members[_0x487a0f])){members[_0x487a0f]=_[_0x8647('0x29')](members[_0x487a0f],{'data1':members[_0x487a0f][_0x8647('0x2a')]||_0x5ac47c[_0x8647('0x2b')],'data2':members[_0x487a0f][_0x8647('0x2f')]||_0x5ac47c[_0x8647('0x2c')],'data3':members[_0x487a0f][_0x8647('0x31')]||_0x5ac47c[_0x8647('0x2d')],'uniqueid':members[_0x487a0f][_0x8647('0x13')]||_0x5ac47c['uniqueid']});utils[_0x8647('0x19')](util[_0x8647('0x4')](_0x8647('0x2e'),_0x5ac47c['uniqueid'],members[_0x487a0f][_0x8647('0x2a')],members[_0x487a0f][_0x8647('0x2f')],members[_0x487a0f][_0x8647('0x31')]));if(members[_0x487a0f][_0x8647('0x24')]){writeDB(members[_0x487a0f]);}}}}catch(_0x1cd837){utils[_0x8647('0x12')](util[_0x8647('0x4')]('[%s][members][cdr]',_0x5ac47c[_0x8647('0x13')]),_0x1cd837);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2b4663a..ec61c42 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 _0x80c7=['transferuniqueid','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','uniqueid','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','hangup','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','varset','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','now','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%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','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','lastAssignedTo','membername','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten'];(function(_0x9b70aa,_0x2c4cee){var _0x18d9eb=function(_0x198415){while(--_0x198415){_0x9b70aa['push'](_0x9b70aa['shift']());}};_0x18d9eb(++_0x2c4cee);}(_0x80c7,0x83));var _0x780c=function(_0x1c029f,_0x351f4d){_0x1c029f=_0x1c029f-0x0;var _0x554863=_0x80c7[_0x1c029f];return _0x554863;};'use strict';var _=require(_0x780c('0x0'));var util=require('util');var utils=require(_0x780c('0x1'));var queues={};function writeDB(_0x352c94){utils[_0x780c('0x2')](util[_0x780c('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x352c94[_0x780c('0x4')],_0x352c94['channel'],_0x352c94[_0x780c('0x5')],_0x352c94['lastAssignedTo'],_0x352c94['calleridnum'],_0x352c94[_0x780c('0x6')],_0x352c94[_0x780c('0x7')]));if(_0x352c94[_0x780c('0x5')]){utils[_0x780c('0x8')](_0x352c94[_0x780c('0x5')])[_0x780c('0x9')](function(_0x96d8bc){if(_0x96d8bc){_0x352c94[_0x780c('0xa')]=_0x96d8bc[_0x780c('0xa')];}utils[_0x780c('0xb')](_0x780c('0xc'),_0x352c94);});}else{utils['request']('CreateVoiceQueueReport',_0x352c94);}if(_0x352c94[_0x780c('0xd')]){delete queues[_0x352c94[_0x780c('0xd')]];}else{delete queues[_0x352c94[_0x780c('0x4')]];}}exports[_0x780c('0xe')]=function(_0x543fd8){try{utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x10'),_0x543fd8[_0x780c('0x4')]),_0x543fd8);utils['info'](util[_0x780c('0x3')](_0x780c('0x11'),_0x543fd8[_0x780c('0x4')],_0x543fd8[_0x780c('0x5')],_0x543fd8['position']));queues[_0x543fd8[_0x780c('0x4')]]=_[_0x780c('0x12')](_0x543fd8,{'originalposition':_0x543fd8[_0x780c('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x562d26){utils['error'](util[_0x780c('0x3')]('[%s][queues][queuecallerjoin]',_0x543fd8[_0x780c('0x4')]),_0x562d26);}};exports[_0x780c('0x14')]=function(_0x199806){try{if(!_['isNil'](queues[_0x199806[_0x780c('0x4')]])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x15'),_0x199806[_0x780c('0x4')]),_0x199806);if(queues[_0x199806['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x199806[_0x780c('0x4')]][_0x780c('0x16')]&&!queues[_0x199806[_0x780c('0x4')]][_0x780c('0x17')]){queues[_0x199806[_0x780c('0x4')]][_0x780c('0x18')]=!![];queues[_0x199806['uniqueid']][_0x780c('0x19')]=utils['now']();queues[_0x199806[_0x780c('0x4')]][_0x780c('0x7')]=_0x780c('0x1a');}utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x1b'),_0x199806[_0x780c('0x4')],queues[_0x199806[_0x780c('0x4')]]['name'],queues[_0x199806[_0x780c('0x4')]][_0x780c('0x7')]));writeDB(queues[_0x199806['uniqueid']]);}else if(queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]){utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x1c'),_0x199806[_0x780c('0x4')],queues[_0x199806[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]));queues[queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]]=queues[_0x199806[_0x780c('0x4')]];queues[queues[_0x199806[_0x780c('0x4')]][_0x780c('0xd')]][_0x780c('0x1e')]=0x2;delete queues[_0x199806[_0x780c('0x4')]];}}}catch(_0x3e77bc){utils[_0x780c('0x1f')](util['format'](_0x780c('0x15'),_0x199806[_0x780c('0x4')]),_0x3e77bc);}};exports[_0x780c('0x20')]=function(_0x4b716e){try{utils[_0x780c('0xf')](util['format']('[%s][queues][varset]',_0x4b716e['uniqueid']),_0x4b716e);if(!_[_0x780c('0x21')](_0x4b716e[_0x780c('0x22')][_0x780c('0x23')])&&_0x4b716e[_0x780c('0x24')][_0x780c('0x25')]()!==_0x780c('0x26')){if(!_[_0x780c('0x21')](queues[_0x4b716e[_0x780c('0x4')]])){queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x27')]=null;queues[_0x4b716e['uniqueid']][_0x780c('0x17')]=!![];queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x28')]=utils[_0x780c('0x29')]();queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x7')]=_0x4b716e[_0x780c('0x24')][_0x780c('0x25')]();utils['info'](util['format'](_0x780c('0x2a'),_0x4b716e[_0x780c('0x4')],queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x1d')],_0x4b716e['value'],queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x7')]));writeDB(queues[_0x4b716e[_0x780c('0x4')]]);}}else if(!_[_0x780c('0x21')](_0x4b716e[_0x780c('0x22')][_0x780c('0x2b')])){if(!_[_0x780c('0x21')](queues[_0x4b716e[_0x780c('0x4')]])&&!queues[_0x4b716e['uniqueid']][_0x780c('0x16')]){queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x4b716e['uniqueid']][_0x780c('0x27')]=null;queues[_0x4b716e['uniqueid']][_0x780c('0x17')]=!![];queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x28')]=utils['now']();queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x7')]=_0x780c('0x2c');utils['info'](util[_0x780c('0x3')](_0x780c('0x2d'),_0x4b716e[_0x780c('0x4')],queues[_0x4b716e[_0x780c('0x4')]][_0x780c('0x1d')],_0x4b716e[_0x780c('0x24')],queues[_0x4b716e['uniqueid']][_0x780c('0x7')]));}}}catch(_0x292c32){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x2e'),_0x4b716e[_0x780c('0x4')]),_0x292c32);}};exports[_0x780c('0x16')]=function(_0x515ecb){try{if(!_[_0x780c('0x21')](queues[_0x515ecb[_0x780c('0x4')]])){utils[_0x780c('0xf')](util['format'](_0x780c('0x2f'),_0x515ecb[_0x780c('0x4')]),_0x515ecb);queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x17')]=![];queues[_0x515ecb['uniqueid']]['queuecallerexitAt']=null;queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x16')]=!![];queues[_0x515ecb[_0x780c('0x4')]]['queuecallerabandonAt']=utils['now']();queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x7')]=_0x780c('0x30');utils['info'](util[_0x780c('0x3')](_0x780c('0x31'),_0x515ecb[_0x780c('0x4')],queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0x515ecb[_0x780c('0x4')]][_0x780c('0x7')]));}}catch(_0x506ac8){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x2f'),_0x515ecb['uniqueid']),_0x506ac8);}};exports[_0x780c('0x32')]=function(_0x449e6d){try{if(!_[_0x780c('0x21')](queues[_0x449e6d[_0x780c('0x4')]])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x33'),_0x449e6d[_0x780c('0x4')]),_0x449e6d);utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x34'),_0x449e6d['uniqueid'],queues[_0x449e6d[_0x780c('0x4')]]['name'],_0x449e6d[_0x780c('0x35')],_0x449e6d[_0x780c('0x36')]));queues[_0x449e6d[_0x780c('0x4')]][_0x780c('0x32')]=!![];queues[_0x449e6d['uniqueid']][_0x780c('0x37')]=utils['now']();queues[_0x449e6d[_0x780c('0x4')]]['holdtime']=utils['diffTime'](queues[_0x449e6d[_0x780c('0x4')]][_0x780c('0x37')],queues[_0x449e6d[_0x780c('0x4')]][_0x780c('0x38')]);queues[_0x449e6d[_0x780c('0x4')]]['position']=_0x449e6d[_0x780c('0x13')];queues[_0x449e6d[_0x780c('0x4')]]['count']=_0x449e6d[_0x780c('0x39')];queues[_0x449e6d['uniqueid']][_0x780c('0x35')]=_0x449e6d[_0x780c('0x35')];queues[_0x449e6d[_0x780c('0x4')]]['connectedlinename']=_0x449e6d[_0x780c('0x36')];}}catch(_0x50f48c){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x33'),_0x449e6d[_0x780c('0x4')]),_0x50f48c);}};exports['agentconnect']=function(_0xed886a){try{if(!_[_0x780c('0x21')](queues[_0xed886a['uniqueid']])){utils['debug'](util[_0x780c('0x3')](_0x780c('0x3a'),_0xed886a[_0x780c('0x4')]),_0xed886a);utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x3b'),_0xed886a['uniqueid'],queues[_0xed886a['uniqueid']][_0x780c('0x1d')],_0xed886a['membername'],_0xed886a[_0x780c('0x3c')]));queues[_0xed886a['uniqueid']][_0x780c('0x16')]=![];queues[_0xed886a['uniqueid']][_0x780c('0x16')]=![];queues[_0xed886a[_0x780c('0x4')]]['queuecallerabandonAt']=null;queues[_0xed886a[_0x780c('0x4')]]['queuecallerexit']=![];queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x7')]=null;queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x28')]=null;queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x3d')]=!![];queues[_0xed886a[_0x780c('0x4')]]['accountcode']=_0xed886a[_0x780c('0x3c')];queues[_0xed886a[_0x780c('0x4')]][_0x780c('0x3e')]=_0xed886a[_0x780c('0x3f')];}}catch(_0x1c8470){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x3a'),_0xed886a['uniqueid']),_0x1c8470);}};exports[_0x780c('0x40')]=function(_0x1a6cf6){try{if(!_[_0x780c('0x21')](queues[_0x1a6cf6[_0x780c('0x4')]])){if(queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x37')]){utils['debug'](util[_0x780c('0x3')](_0x780c('0x41'),_0x1a6cf6[_0x780c('0x4')]),_0x1a6cf6);queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x16')]=![];queues[_0x1a6cf6[_0x780c('0x4')]]['queuecallerabandonAt']=null;queues[_0x1a6cf6[_0x780c('0x4')]]['queuecallerexit']=![];queues[_0x1a6cf6[_0x780c('0x4')]]['queuecallerexitAt']=null;queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x3d')]=!![];queues[_0x1a6cf6['uniqueid']][_0x780c('0x3e')]=_0x1a6cf6[_0x780c('0x3f')];queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x18')]=!![];queues[_0x1a6cf6['uniqueid']][_0x780c('0x19')]=utils[_0x780c('0x29')]();if(_0x1a6cf6['reason']==_0x780c('0x42')){if(!queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x42')]){queues[_0x1a6cf6['uniqueid']]['queuecallerexitreason']=_0x780c('0x43');}}else{queues[_0x1a6cf6['uniqueid']][_0x780c('0x7')]='COMPLETEDBY'+_0x1a6cf6[_0x780c('0x44')][_0x780c('0x25')]();}utils['info'](util[_0x780c('0x3')](_0x780c('0x45'),_0x1a6cf6[_0x780c('0x4')],queues[_0x1a6cf6[_0x780c('0x4')]][_0x780c('0x1d')],_0x1a6cf6[_0x780c('0x3f')],queues[_0x1a6cf6['uniqueid']][_0x780c('0x7')]));writeDB(queues[_0x1a6cf6['uniqueid']]);}}}catch(_0x428cc5){utils[_0x780c('0x1f')](util[_0x780c('0x3')]('[%s][queues][agentcomplete]',_0x1a6cf6[_0x780c('0x4')]),_0x428cc5);}};exports[_0x780c('0x46')]=function(_0x574b74){try{if(!_[_0x780c('0x21')](queues[_0x574b74['transfereeuniqueid']])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x47'),_0x574b74[_0x780c('0x4')]),_0x574b74);queues[_0x574b74['transfereeuniqueid']][_0x780c('0x42')]=!![];queues[_0x574b74[_0x780c('0x48')]][_0x780c('0x49')]='BLIND';queues[_0x574b74[_0x780c('0x48')]][_0x780c('0x4a')]=_0x574b74['extension'];queues[_0x574b74['transfereeuniqueid']][_0x780c('0x4b')]=_0x574b74[_0x780c('0x48')];queues[_0x574b74['transfereeuniqueid']][_0x780c('0x7')]='BLINDTRANSFER';utils[_0x780c('0x2')](util[_0x780c('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x574b74[_0x780c('0x4')],queues[_0x574b74['transfereeuniqueid']][_0x780c('0x1d')],_0x574b74[_0x780c('0x48')],_0x574b74[_0x780c('0x4c')]));}}catch(_0x5afcbb){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x47'),_0x574b74[_0x780c('0x4')]),_0x5afcbb);}};exports[_0x780c('0x4d')]=function(_0x2d66fc){try{utils[_0x780c('0xf')](util[_0x780c('0x3')]('[%s][queues][attendedtransfer]',_0x2d66fc['origtransfereruniqueid']),_0x2d66fc);if(_0x2d66fc[_0x780c('0x4e')]==_0x2d66fc[_0x780c('0x4f')]){if(!_['isNil'](queues[_0x2d66fc[_0x780c('0x50')]])){utils['info'](util[_0x780c('0x3')](_0x780c('0x51'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x1d')],_0x2d66fc[_0x780c('0x52')]));queues[_0x2d66fc[_0x780c('0x50')]]['transfer']=!![];queues[_0x2d66fc['secondtransfererlinkedid']][_0x780c('0x49')]=_0x780c('0x53');queues[_0x2d66fc['secondtransfererlinkedid']][_0x780c('0x4a')]=_0x2d66fc[_0x780c('0x52')];queues[_0x2d66fc['secondtransfererlinkedid']][_0x780c('0x4b')]=_0x2d66fc[_0x780c('0x4e')];queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x7')]=_0x780c('0x54');}if(!_['isNil'](queues[_0x2d66fc[_0x780c('0x4f')]])){if(_0x2d66fc[_0x780c('0x55')]&&queues[_0x2d66fc[_0x780c('0x55')]]){queues[_0x2d66fc['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2d66fc[_0x780c('0x48')]]=_[_0x780c('0x56')](queues[_0x2d66fc[_0x780c('0x55')]]);queues[_0x2d66fc[_0x780c('0x48')]]['transfereduniqueid']=_0x2d66fc[_0x780c('0x57')];queues[_0x2d66fc['transfereeuniqueid']][_0x780c('0x1e')]=0x2;queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x58')]=queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x58')];queues[_0x2d66fc[_0x780c('0x48')]]['calleridname']=queues[_0x2d66fc[_0x780c('0x50')]]['calleridname'];queues[_0x2d66fc[_0x780c('0x48')]]['queuecallerjoinAt']=utils[_0x780c('0x29')]();queues[_0x2d66fc['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x780c('0x29')]();queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x59')]=0x0;queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x5a')]=0x0;utils['info'](util[_0x780c('0x3')](_0x780c('0x5b'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x1d')],queues[_0x2d66fc['transfereeuniqueid']][_0x780c('0x58')],queues[_0x2d66fc[_0x780c('0x48')]][_0x780c('0x5c')]));}else{utils[_0x780c('0x2')](util[_0x780c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc['origtransfererlinkedid']][_0x780c('0x1d')],_0x2d66fc[_0x780c('0x50')]));queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0xd')]=_0x2d66fc[_0x780c('0x50')];}}}else if(_0x2d66fc[_0x780c('0x5d')]==_0x2d66fc[_0x780c('0x50')]){if(!_[_0x780c('0x21')](queues[_0x2d66fc[_0x780c('0x4f')]])){utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x5e'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0x1d')],_0x2d66fc[_0x780c('0x5d')],_0x2d66fc['secondtransfererexten']));queues[_0x2d66fc[_0x780c('0x4f')]]['transfer']=!![];queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0x49')]='ATTENDED';queues[_0x2d66fc[_0x780c('0x4f')]][_0x780c('0x4a')]=_0x2d66fc['secondtransfererexten'];queues[_0x2d66fc['origtransfererlinkedid']][_0x780c('0x4b')]=_0x2d66fc[_0x780c('0x5d')];queues[_0x2d66fc[_0x780c('0x4f')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x780c('0x21')](queues[_0x2d66fc[_0x780c('0x50')]])){if(_0x2d66fc[_0x780c('0x5f')]&&queues[_0x2d66fc['transfertargetlinkedid']]){queues[_0x2d66fc[_0x780c('0x5f')]][_0x780c('0x1e')]=0x1;queues[_0x2d66fc[_0x780c('0x57')]]=_[_0x780c('0x56')](queues[_0x2d66fc[_0x780c('0x5f')]]);queues[_0x2d66fc['transfertargetuniqueid']][_0x780c('0xd')]=_0x2d66fc[_0x780c('0x57')];queues[_0x2d66fc['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x58')]=queues[_0x2d66fc[_0x780c('0x4f')]]['calleridnum'];queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x5c')]=queues[_0x2d66fc['origtransfererlinkedid']][_0x780c('0x5c')];queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x38')]=utils[_0x780c('0x29')]();queues[_0x2d66fc['transfertargetuniqueid']][_0x780c('0x37')]=utils[_0x780c('0x29')]();queues[_0x2d66fc[_0x780c('0x57')]]['holdtime']=0x0;queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x5a')]=0x0;utils['info'](util[_0x780c('0x3')](_0x780c('0x60'),_0x2d66fc[_0x780c('0x4e')],queues[_0x2d66fc[_0x780c('0x57')]][_0x780c('0x1d')],queues[_0x2d66fc[_0x780c('0x57')]]['transfereduniqueid'],queues[_0x2d66fc['transfertargetuniqueid']]['calleridnum'],queues[_0x2d66fc[_0x780c('0x57')]]['calleridname']));}else{utils['info'](util['format'](_0x780c('0x61'),_0x2d66fc['origtransfereruniqueid'],queues[_0x2d66fc[_0x780c('0x50')]][_0x780c('0x1d')],_0x2d66fc['origtransfererlinkedid']));queues[_0x2d66fc[_0x780c('0x50')]]['transfereduniqueid']=_0x2d66fc['origtransfererlinkedid'];}}}}catch(_0x5dd25d){utils['error'](util[_0x780c('0x3')]('[%s][queues][attendedtransfer]',_0x2d66fc[_0x780c('0x4e')]),_0x5dd25d);}};exports['musiconholdstart']=function(_0x17af76){try{if(!_[_0x780c('0x21')](queues[_0x17af76[_0x780c('0x4')]])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x62'),_0x17af76['uniqueid']),_0x17af76);queues[_0x17af76[_0x780c('0x4')]][_0x780c('0x63')]=utils[_0x780c('0x29')]();utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x64'),_0x17af76[_0x780c('0x4')],queues[_0x17af76[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0x17af76[_0x780c('0x4')]][_0x780c('0x63')]));}}catch(_0x32a92f){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x62'),_0x17af76[_0x780c('0x4')]),_0x32a92f);}};exports['musiconholdstop']=function(_0xcd68a9){try{if(!_[_0x780c('0x21')](queues[_0xcd68a9[_0x780c('0x4')]])){if(!_[_0x780c('0x21')](queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x63')])){utils[_0x780c('0xf')](util[_0x780c('0x3')](_0x780c('0x65'),_0xcd68a9[_0x780c('0x4')]),_0xcd68a9);queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x5a')]+=utils['diffTime'](utils[_0x780c('0x29')](),queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x63')]);utils[_0x780c('0x2')](util[_0x780c('0x3')](_0x780c('0x66'),_0xcd68a9[_0x780c('0x4')],queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x1d')],queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x5a')]));delete queues[_0xcd68a9[_0x780c('0x4')]][_0x780c('0x63')];}}}catch(_0x51c360){utils[_0x780c('0x1f')](util[_0x780c('0x3')](_0x780c('0x65'),_0xcd68a9['uniqueid']),_0x51c360);}}; \ No newline at end of file +var _0x3b2c=['holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','now','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','value','toUpperCase','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','isNil','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum'];(function(_0x578fd2,_0x224860){var _0x2647aa=function(_0x50f36a){while(--_0x50f36a){_0x578fd2['push'](_0x578fd2['shift']());}};_0x2647aa(++_0x224860);}(_0x3b2c,0x1c0));var _0xc3b2=function(_0x2489f2,_0x4189ce){_0x2489f2=_0x2489f2-0x0;var _0x3af61b=_0x3b2c[_0x2489f2];return _0x3af61b;};'use strict';var _=require(_0xc3b2('0x0'));var util=require(_0xc3b2('0x1'));var utils=require(_0xc3b2('0x2'));var queues={};function writeDB(_0x3239cb){utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3239cb[_0xc3b2('0x5')],_0x3239cb['channel'],_0x3239cb[_0xc3b2('0x6')],_0x3239cb[_0xc3b2('0x7')],_0x3239cb['calleridnum'],_0x3239cb[_0xc3b2('0x8')],_0x3239cb[_0xc3b2('0x9')]));if(_0x3239cb[_0xc3b2('0x6')]){utils[_0xc3b2('0xa')](_0x3239cb[_0xc3b2('0x6')])[_0xc3b2('0xb')](function(_0x248497){if(_0x248497){_0x3239cb['type']=_0x248497[_0xc3b2('0xc')];}utils[_0xc3b2('0xd')](_0xc3b2('0xe'),_0x3239cb);});}else{utils[_0xc3b2('0xd')](_0xc3b2('0xe'),_0x3239cb);}if(_0x3239cb[_0xc3b2('0xf')]){delete queues[_0x3239cb[_0xc3b2('0xf')]];}else{delete queues[_0x3239cb[_0xc3b2('0x5')]];}}exports[_0xc3b2('0x10')]=function(_0x1d6848){try{utils[_0xc3b2('0x11')](util['format'](_0xc3b2('0x12'),_0x1d6848[_0xc3b2('0x5')]),_0x1d6848);utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')](_0xc3b2('0x13'),_0x1d6848['uniqueid'],_0x1d6848['queue'],_0x1d6848['position']));queues[_0x1d6848['uniqueid']]=_['assign'](_0x1d6848,{'originalposition':_0x1d6848['position'],'queuecallerjoinAt':utils[_0xc3b2('0x14')](),'mohtime':0x0});}catch(_0x67f6ff){utils['error'](util[_0xc3b2('0x4')](_0xc3b2('0x12'),_0x1d6848['uniqueid']),_0x67f6ff);}};exports['hangup']=function(_0x9bfbed){try{if(!_['isNil'](queues[_0x9bfbed['uniqueid']])){utils[_0xc3b2('0x11')](util[_0xc3b2('0x4')](_0xc3b2('0x15'),_0x9bfbed[_0xc3b2('0x5')]),_0x9bfbed);if(queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x16')]){if(!queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x17')]&&!queues[_0x9bfbed['uniqueid']]['queuecallerexit']){queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x18')]=!![];queues[_0x9bfbed['uniqueid']]['queuecallercompleteAt']=utils[_0xc3b2('0x14')]();queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x9')]='COMPLETEDBYAGENT';}utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x9bfbed[_0xc3b2('0x5')],queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x19')],queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x9')]));writeDB(queues[_0x9bfbed[_0xc3b2('0x5')]]);}else if(queues[_0x9bfbed[_0xc3b2('0x5')]]['transfereduniqueid']){utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')](_0xc3b2('0x1a'),_0x9bfbed[_0xc3b2('0x5')],queues[_0x9bfbed[_0xc3b2('0x5')]][_0xc3b2('0x19')],queues[_0x9bfbed['uniqueid']]['transfereduniqueid']));queues[queues[_0x9bfbed['uniqueid']][_0xc3b2('0xf')]]=queues[_0x9bfbed[_0xc3b2('0x5')]];queues[queues[_0x9bfbed[_0xc3b2('0x5')]]['transfereduniqueid']][_0xc3b2('0x1b')]=0x2;delete queues[_0x9bfbed[_0xc3b2('0x5')]];}}}catch(_0xcc7c0c){utils[_0xc3b2('0x1c')](util[_0xc3b2('0x4')]('[%s][queues][hangup]',_0x9bfbed['uniqueid']),_0xcc7c0c);}};exports[_0xc3b2('0x1d')]=function(_0x5054c9){try{utils['debug'](util[_0xc3b2('0x4')](_0xc3b2('0x1e'),_0x5054c9[_0xc3b2('0x5')]),_0x5054c9);if(!_['isNil'](_0x5054c9[_0xc3b2('0x1f')]['queuestatus'])&&_0x5054c9[_0xc3b2('0x20')][_0xc3b2('0x21')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x5054c9['uniqueid']])){queues[_0x5054c9['uniqueid']][_0xc3b2('0x17')]=![];queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x22')]=null;queues[_0x5054c9['uniqueid']][_0xc3b2('0x23')]=!![];queues[_0x5054c9['uniqueid']]['queuecallerexitAt']=utils[_0xc3b2('0x14')]();queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x9')]=_0x5054c9[_0xc3b2('0x20')][_0xc3b2('0x21')]();utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')](_0xc3b2('0x24'),_0x5054c9['uniqueid'],queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x19')],_0x5054c9[_0xc3b2('0x20')],queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x9')]));writeDB(queues[_0x5054c9[_0xc3b2('0x5')]]);}}else if(!_[_0xc3b2('0x25')](_0x5054c9[_0xc3b2('0x1f')][_0xc3b2('0x26')])){if(!_['isNil'](queues[_0x5054c9[_0xc3b2('0x5')]])&&!queues[_0x5054c9['uniqueid']][_0xc3b2('0x17')]){queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x17')]=![];queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x22')]=null;queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x23')]=!![];queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x27')]=utils[_0xc3b2('0x14')]();queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x9')]=_0xc3b2('0x28');utils[_0xc3b2('0x3')](util['format'](_0xc3b2('0x29'),_0x5054c9['uniqueid'],queues[_0x5054c9[_0xc3b2('0x5')]]['name'],_0x5054c9[_0xc3b2('0x20')],queues[_0x5054c9[_0xc3b2('0x5')]][_0xc3b2('0x9')]));}}}catch(_0x53fca3){utils[_0xc3b2('0x1c')](util[_0xc3b2('0x4')](_0xc3b2('0x1e'),_0x5054c9[_0xc3b2('0x5')]),_0x53fca3);}};exports[_0xc3b2('0x17')]=function(_0x5546e5){try{if(!_[_0xc3b2('0x25')](queues[_0x5546e5[_0xc3b2('0x5')]])){utils[_0xc3b2('0x11')](util[_0xc3b2('0x4')](_0xc3b2('0x2a'),_0x5546e5[_0xc3b2('0x5')]),_0x5546e5);queues[_0x5546e5[_0xc3b2('0x5')]]['queuecallerexit']=![];queues[_0x5546e5['uniqueid']]['queuecallerexitAt']=null;queues[_0x5546e5[_0xc3b2('0x5')]]['queuecallerabandon']=!![];queues[_0x5546e5[_0xc3b2('0x5')]][_0xc3b2('0x22')]=utils[_0xc3b2('0x14')]();queues[_0x5546e5[_0xc3b2('0x5')]][_0xc3b2('0x9')]=_0xc3b2('0x2b');utils['info'](util[_0xc3b2('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x5546e5[_0xc3b2('0x5')],queues[_0x5546e5[_0xc3b2('0x5')]][_0xc3b2('0x19')],queues[_0x5546e5[_0xc3b2('0x5')]]['queuecallerexitreason']));}}catch(_0x3b2786){utils[_0xc3b2('0x1c')](util['format'](_0xc3b2('0x2a'),_0x5546e5[_0xc3b2('0x5')]),_0x3b2786);}};exports[_0xc3b2('0x2c')]=function(_0x416218){try{if(!_['isNil'](queues[_0x416218[_0xc3b2('0x5')]])){utils[_0xc3b2('0x11')](util['format'](_0xc3b2('0x2d'),_0x416218[_0xc3b2('0x5')]),_0x416218);utils['info'](util[_0xc3b2('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x416218[_0xc3b2('0x5')],queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x19')],_0x416218[_0xc3b2('0x2e')],_0x416218['connectedlinename']));queues[_0x416218['uniqueid']][_0xc3b2('0x2c')]=!![];queues[_0x416218['uniqueid']][_0xc3b2('0x16')]=utils[_0xc3b2('0x14')]();queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x2f')]=utils[_0xc3b2('0x30')](queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x16')],queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x31')]);queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x32')]=_0x416218[_0xc3b2('0x32')];queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x33')]=_0x416218[_0xc3b2('0x33')];queues[_0x416218['uniqueid']][_0xc3b2('0x2e')]=_0x416218[_0xc3b2('0x2e')];queues[_0x416218[_0xc3b2('0x5')]][_0xc3b2('0x34')]=_0x416218[_0xc3b2('0x34')];}}catch(_0x4db499){utils['error'](util[_0xc3b2('0x4')]('[%s][queues][queuecallerleave]',_0x416218[_0xc3b2('0x5')]),_0x4db499);}};exports[_0xc3b2('0x35')]=function(_0x588234){try{if(!_[_0xc3b2('0x25')](queues[_0x588234[_0xc3b2('0x5')]])){utils['debug'](util[_0xc3b2('0x4')]('[%s][queues][agentconnect]',_0x588234[_0xc3b2('0x5')]),_0x588234);utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')](_0xc3b2('0x36'),_0x588234[_0xc3b2('0x5')],queues[_0x588234[_0xc3b2('0x5')]][_0xc3b2('0x19')],_0x588234[_0xc3b2('0x37')],_0x588234[_0xc3b2('0x38')]));queues[_0x588234[_0xc3b2('0x5')]][_0xc3b2('0x17')]=![];queues[_0x588234['uniqueid']]['queuecallerabandon']=![];queues[_0x588234['uniqueid']]['queuecallerabandonAt']=null;queues[_0x588234[_0xc3b2('0x5')]][_0xc3b2('0x23')]=![];queues[_0x588234['uniqueid']][_0xc3b2('0x9')]=null;queues[_0x588234[_0xc3b2('0x5')]][_0xc3b2('0x27')]=null;queues[_0x588234[_0xc3b2('0x5')]]['assigned']=!![];queues[_0x588234[_0xc3b2('0x5')]][_0xc3b2('0x8')]=_0x588234['destaccountcode'];queues[_0x588234[_0xc3b2('0x5')]][_0xc3b2('0x7')]=_0x588234['membername'];}}catch(_0x4111d3){utils['error'](util[_0xc3b2('0x4')]('[%s][queues][agentconnect]',_0x588234[_0xc3b2('0x5')]),_0x4111d3);}};exports[_0xc3b2('0x39')]=function(_0x57e8d7){try{if(!_['isNil'](queues[_0x57e8d7[_0xc3b2('0x5')]])){if(queues[_0x57e8d7[_0xc3b2('0x5')]]['queuecallerleaveAt']){utils[_0xc3b2('0x11')](util[_0xc3b2('0x4')](_0xc3b2('0x3a'),_0x57e8d7[_0xc3b2('0x5')]),_0x57e8d7);queues[_0x57e8d7[_0xc3b2('0x5')]][_0xc3b2('0x17')]=![];queues[_0x57e8d7['uniqueid']][_0xc3b2('0x17')]=![];queues[_0x57e8d7['uniqueid']][_0xc3b2('0x22')]=null;queues[_0x57e8d7[_0xc3b2('0x5')]][_0xc3b2('0x23')]=![];queues[_0x57e8d7[_0xc3b2('0x5')]]['queuecallerexitAt']=null;queues[_0x57e8d7[_0xc3b2('0x5')]][_0xc3b2('0x3b')]=!![];queues[_0x57e8d7['uniqueid']][_0xc3b2('0x7')]=_0x57e8d7['membername'];queues[_0x57e8d7[_0xc3b2('0x5')]]['queuecallercomplete']=!![];queues[_0x57e8d7[_0xc3b2('0x5')]][_0xc3b2('0x3c')]=utils['now']();if(_0x57e8d7[_0xc3b2('0x3d')]=='transfer'){if(!queues[_0x57e8d7[_0xc3b2('0x5')]][_0xc3b2('0x3e')]){queues[_0x57e8d7[_0xc3b2('0x5')]]['queuecallerexitreason']=_0xc3b2('0x3f');}}else{queues[_0x57e8d7[_0xc3b2('0x5')]][_0xc3b2('0x9')]=_0xc3b2('0x40')+_0x57e8d7[_0xc3b2('0x3d')][_0xc3b2('0x21')]();}utils['info'](util[_0xc3b2('0x4')](_0xc3b2('0x41'),_0x57e8d7[_0xc3b2('0x5')],queues[_0x57e8d7[_0xc3b2('0x5')]]['name'],_0x57e8d7[_0xc3b2('0x37')],queues[_0x57e8d7['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x57e8d7[_0xc3b2('0x5')]]);}}}catch(_0xc45084){utils['error'](util['format']('[%s][queues][agentcomplete]',_0x57e8d7[_0xc3b2('0x5')]),_0xc45084);}};exports[_0xc3b2('0x42')]=function(_0x4478f4){try{if(!_[_0xc3b2('0x25')](queues[_0x4478f4[_0xc3b2('0x43')]])){utils[_0xc3b2('0x11')](util[_0xc3b2('0x4')]('[%s][queues][blindtransfer]',_0x4478f4[_0xc3b2('0x5')]),_0x4478f4);queues[_0x4478f4['transfereeuniqueid']][_0xc3b2('0x3e')]=!![];queues[_0x4478f4['transfereeuniqueid']][_0xc3b2('0x44')]='BLIND';queues[_0x4478f4[_0xc3b2('0x43')]][_0xc3b2('0x45')]=_0x4478f4[_0xc3b2('0x46')];queues[_0x4478f4[_0xc3b2('0x43')]]['transferuniqueid']=_0x4478f4[_0xc3b2('0x43')];queues[_0x4478f4[_0xc3b2('0x43')]][_0xc3b2('0x9')]='BLINDTRANSFER';utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4478f4[_0xc3b2('0x5')],queues[_0x4478f4[_0xc3b2('0x43')]]['name'],_0x4478f4[_0xc3b2('0x43')],_0x4478f4[_0xc3b2('0x46')]));}}catch(_0x2d42ff){utils[_0xc3b2('0x1c')](util[_0xc3b2('0x4')](_0xc3b2('0x47'),_0x4478f4['uniqueid']),_0x2d42ff);}};exports[_0xc3b2('0x48')]=function(_0x56296){try{utils[_0xc3b2('0x11')](util[_0xc3b2('0x4')](_0xc3b2('0x49'),_0x56296[_0xc3b2('0x4a')]),_0x56296);if(_0x56296[_0xc3b2('0x4a')]==_0x56296[_0xc3b2('0x4b')]){if(!_[_0xc3b2('0x25')](queues[_0x56296[_0xc3b2('0x4c')]])){utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')](_0xc3b2('0x4d'),_0x56296[_0xc3b2('0x4a')],queues[_0x56296[_0xc3b2('0x4c')]][_0xc3b2('0x19')],_0x56296[_0xc3b2('0x4e')]));queues[_0x56296[_0xc3b2('0x4c')]]['transfer']=!![];queues[_0x56296['secondtransfererlinkedid']][_0xc3b2('0x44')]=_0xc3b2('0x4f');queues[_0x56296[_0xc3b2('0x4c')]]['transferexten']=_0x56296[_0xc3b2('0x4e')];queues[_0x56296[_0xc3b2('0x4c')]][_0xc3b2('0x50')]=_0x56296[_0xc3b2('0x4a')];queues[_0x56296[_0xc3b2('0x4c')]][_0xc3b2('0x9')]=_0xc3b2('0x51');}if(!_[_0xc3b2('0x25')](queues[_0x56296[_0xc3b2('0x4b')]])){if(_0x56296[_0xc3b2('0x52')]&&queues[_0x56296['transfereelinkedid']]){queues[_0x56296['transfereelinkedid']][_0xc3b2('0x1b')]=0x1;queues[_0x56296['transfereeuniqueid']]=_[_0xc3b2('0x53')](queues[_0x56296[_0xc3b2('0x52')]]);queues[_0x56296['transfereeuniqueid']][_0xc3b2('0xf')]=_0x56296[_0xc3b2('0x54')];queues[_0x56296[_0xc3b2('0x43')]][_0xc3b2('0x1b')]=0x2;queues[_0x56296[_0xc3b2('0x43')]][_0xc3b2('0x55')]=queues[_0x56296['secondtransfererlinkedid']][_0xc3b2('0x55')];queues[_0x56296[_0xc3b2('0x43')]]['calleridname']=queues[_0x56296[_0xc3b2('0x4c')]][_0xc3b2('0x56')];queues[_0x56296[_0xc3b2('0x43')]][_0xc3b2('0x31')]=utils[_0xc3b2('0x14')]();queues[_0x56296[_0xc3b2('0x43')]][_0xc3b2('0x16')]=utils[_0xc3b2('0x14')]();queues[_0x56296['transfereeuniqueid']][_0xc3b2('0x2f')]=0x0;queues[_0x56296[_0xc3b2('0x43')]][_0xc3b2('0x57')]=0x0;utils[_0xc3b2('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x56296[_0xc3b2('0x4a')],queues[_0x56296[_0xc3b2('0x43')]][_0xc3b2('0x19')],queues[_0x56296[_0xc3b2('0x43')]]['calleridnum'],queues[_0x56296['transfereeuniqueid']][_0xc3b2('0x56')]));}else{utils['info'](util['format'](_0xc3b2('0x58'),_0x56296['origtransfereruniqueid'],queues[_0x56296[_0xc3b2('0x4b')]]['name'],_0x56296['secondtransfererlinkedid']));queues[_0x56296[_0xc3b2('0x4b')]]['transfereduniqueid']=_0x56296['secondtransfererlinkedid'];}}}else if(_0x56296[_0xc3b2('0x59')]==_0x56296[_0xc3b2('0x4c')]){if(!_['isNil'](queues[_0x56296[_0xc3b2('0x4b')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x56296[_0xc3b2('0x4a')],queues[_0x56296[_0xc3b2('0x4b')]][_0xc3b2('0x19')],_0x56296[_0xc3b2('0x59')],_0x56296['secondtransfererexten']));queues[_0x56296[_0xc3b2('0x4b')]][_0xc3b2('0x3e')]=!![];queues[_0x56296['origtransfererlinkedid']][_0xc3b2('0x44')]=_0xc3b2('0x4f');queues[_0x56296['origtransfererlinkedid']][_0xc3b2('0x45')]=_0x56296[_0xc3b2('0x5a')];queues[_0x56296[_0xc3b2('0x4b')]]['transferuniqueid']=_0x56296[_0xc3b2('0x59')];queues[_0x56296['origtransfererlinkedid']]['queuecallerexitreason']=_0xc3b2('0x51');}if(!_[_0xc3b2('0x25')](queues[_0x56296[_0xc3b2('0x4c')]])){if(_0x56296[_0xc3b2('0x5b')]&&queues[_0x56296[_0xc3b2('0x5b')]]){queues[_0x56296[_0xc3b2('0x5b')]]['queuecallerenterreason']=0x1;queues[_0x56296[_0xc3b2('0x54')]]=_[_0xc3b2('0x53')](queues[_0x56296[_0xc3b2('0x5b')]]);queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0xf')]=_0x56296[_0xc3b2('0x54')];queues[_0x56296['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x56296[_0xc3b2('0x54')]]['calleridnum']=queues[_0x56296[_0xc3b2('0x4b')]][_0xc3b2('0x55')];queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0x56')]=queues[_0x56296[_0xc3b2('0x4b')]][_0xc3b2('0x56')];queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0x31')]=utils[_0xc3b2('0x14')]();queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0x16')]=utils[_0xc3b2('0x14')]();queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0x2f')]=0x0;queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0x57')]=0x0;utils['info'](util[_0xc3b2('0x4')](_0xc3b2('0x5c'),_0x56296[_0xc3b2('0x4a')],queues[_0x56296[_0xc3b2('0x54')]][_0xc3b2('0x19')],queues[_0x56296['transfertargetuniqueid']][_0xc3b2('0xf')],queues[_0x56296['transfertargetuniqueid']][_0xc3b2('0x55')],queues[_0x56296['transfertargetuniqueid']][_0xc3b2('0x56')]));}else{utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')](_0xc3b2('0x58'),_0x56296['origtransfereruniqueid'],queues[_0x56296[_0xc3b2('0x4c')]][_0xc3b2('0x19')],_0x56296[_0xc3b2('0x4b')]));queues[_0x56296[_0xc3b2('0x4c')]][_0xc3b2('0xf')]=_0x56296['origtransfererlinkedid'];}}}}catch(_0x4f6f9e){utils[_0xc3b2('0x1c')](util[_0xc3b2('0x4')](_0xc3b2('0x49'),_0x56296[_0xc3b2('0x4a')]),_0x4f6f9e);}};exports[_0xc3b2('0x5d')]=function(_0x1e9639){try{if(!_[_0xc3b2('0x25')](queues[_0x1e9639['uniqueid']])){utils['debug'](util[_0xc3b2('0x4')](_0xc3b2('0x5e'),_0x1e9639[_0xc3b2('0x5')]),_0x1e9639);queues[_0x1e9639['uniqueid']][_0xc3b2('0x5f')]=utils[_0xc3b2('0x14')]();utils[_0xc3b2('0x3')](util[_0xc3b2('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x1e9639[_0xc3b2('0x5')],queues[_0x1e9639[_0xc3b2('0x5')]]['name'],queues[_0x1e9639[_0xc3b2('0x5')]]['musiconholdstartAt']));}}catch(_0x2edf7c){utils[_0xc3b2('0x1c')](util[_0xc3b2('0x4')](_0xc3b2('0x5e'),_0x1e9639[_0xc3b2('0x5')]),_0x2edf7c);}};exports[_0xc3b2('0x60')]=function(_0x180bcd){try{if(!_['isNil'](queues[_0x180bcd[_0xc3b2('0x5')]])){if(!_['isNil'](queues[_0x180bcd[_0xc3b2('0x5')]][_0xc3b2('0x5f')])){utils[_0xc3b2('0x11')](util[_0xc3b2('0x4')](_0xc3b2('0x61'),_0x180bcd[_0xc3b2('0x5')]),_0x180bcd);queues[_0x180bcd['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xc3b2('0x14')](),queues[_0x180bcd[_0xc3b2('0x5')]]['musiconholdstartAt']);utils['info'](util[_0xc3b2('0x4')](_0xc3b2('0x62'),_0x180bcd[_0xc3b2('0x5')],queues[_0x180bcd[_0xc3b2('0x5')]][_0xc3b2('0x19')],queues[_0x180bcd[_0xc3b2('0x5')]][_0xc3b2('0x57')]));delete queues[_0x180bcd[_0xc3b2('0x5')]]['musiconholdstartAt'];}}}catch(_0x15d849){utils[_0xc3b2('0x1c')](util[_0xc3b2('0x4')]('[%s][queues][musiconholdstop]',_0x180bcd[_0xc3b2('0x5')]),_0x15d849);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 820b144..7e1f86b 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 _0x23c6=['util','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','isNil','channelstate','error','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash'];(function(_0x5e76d3,_0x5bf618){var _0x4a0790=function(_0x24530b){while(--_0x24530b){_0x5e76d3['push'](_0x5e76d3['shift']());}};_0x4a0790(++_0x5bf618);}(_0x23c6,0x19c));var _0x623c=function(_0x3d92e4,_0x53a178){_0x3d92e4=_0x3d92e4-0x0;var _0x1f97ce=_0x23c6[_0x3d92e4];return _0x1f97ce;};'use strict';var _=require(_0x623c('0x0'));var util=require(_0x623c('0x1'));var utils=require(_0x623c('0x2'));var recordings={};function writeDB(_0x245c4c){utils[_0x623c('0x3')](util[_0x623c('0x4')](_0x623c('0x5'),_0x245c4c['uniqueid']));if(_0x245c4c[_0x623c('0x6')]){utils[_0x623c('0x7')](_0x245c4c[_0x623c('0x6')])['then'](function(_0x343e51){if(_0x343e51){_0x245c4c[_0x623c('0x8')]=_0x343e51[_0x623c('0x9')];_0x245c4c[_0x623c('0xa')]=_0x343e51['id'];}utils[_0x623c('0xb')](_0x623c('0xc'),_0x245c4c);});}else{utils[_0x623c('0xb')](_0x623c('0xc'),_0x245c4c);}}exports[_0x623c('0xd')]=function(_0x531d8d){try{utils[_0x623c('0xe')](util[_0x623c('0x4')](_0x623c('0xf'),_0x531d8d[_0x623c('0x10')]),_0x531d8d);if(_0x531d8d[_0x623c('0x10')]==_0x531d8d[_0x623c('0x11')]){utils['info'](util['format'](_0x623c('0x12'),_0x531d8d['uniqueid'],_0x531d8d[_0x623c('0x13')],_0x531d8d['exten']));recordings[_0x531d8d[_0x623c('0x10')]]={'uniqueid':_0x531d8d[_0x623c('0x10')],'accountcode':_0x531d8d[_0x623c('0x6')],'exten':_0x531d8d[_0x623c('0x14')],'context':_0x531d8d[_0x623c('0x13')],'channel':_0x531d8d[_0x623c('0x15')],'monitors':[]};}}catch(_0xf478bc){utils['error'](util[_0x623c('0x4')](_0x623c('0xf'),_0x531d8d[_0x623c('0x10')]),_0xf478bc);}};exports[_0x623c('0x16')]=function(_0x47b2cb){try{utils[_0x623c('0xe')](util[_0x623c('0x4')]('[%s][recordings][newstate]',_0x47b2cb[_0x623c('0x10')]),_0x47b2cb);if(!_[_0x623c('0x17')](recordings[_0x47b2cb['uniqueid']])&&_0x47b2cb['channelstate']==0x6){utils[_0x623c('0x3')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x47b2cb['uniqueid'],_0x47b2cb['context'],_0x47b2cb[_0x623c('0x15')]));}else if(!_['isNil'](recordings[_0x47b2cb[_0x623c('0x11')]])&&_0x47b2cb[_0x623c('0x18')]==0x6&&_0x47b2cb[_0x623c('0x13')]!='transfer'){utils[_0x623c('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x47b2cb[_0x623c('0x10')],_0x47b2cb[_0x623c('0x11')],_0x47b2cb[_0x623c('0x13')],_0x47b2cb[_0x623c('0x15')]));recordings[_0x47b2cb[_0x623c('0x11')]][_0x623c('0x6')]=_0x47b2cb[_0x623c('0x6')];}}catch(_0x4e38ff){utils[_0x623c('0x19')](util[_0x623c('0x4')](_0x623c('0x1a'),_0x47b2cb[_0x623c('0x10')]),_0x4e38ff);}};exports[_0x623c('0x1b')]=function(_0x2113d2){try{if(!_[_0x623c('0x17')](_0x2113d2[_0x623c('0x1c')])&&!_[_0x623c('0x17')](_0x2113d2['variable'][_0x623c('0x1d')])){utils['debug'](util[_0x623c('0x4')](_0x623c('0x1e'),_0x2113d2[_0x623c('0x10')]),_0x2113d2);utils[_0x623c('0x3')](util[_0x623c('0x4')](_0x623c('0x1f'),_0x2113d2['uniqueid'],_0x2113d2[_0x623c('0x1c')],_0x2113d2[_0x623c('0x20')]));if(_['endsWith'](_0x2113d2[_0x623c('0x20')],'.wav49')){_0x2113d2[_0x623c('0x20')]=_0x2113d2[_0x623c('0x20')][_0x623c('0x21')](_0x623c('0x22'),_0x623c('0x23'));}if(recordings[_0x2113d2[_0x623c('0x11')]]){var _0x4ad44a=_['find'](recordings[_0x2113d2['linkedid']][_0x623c('0x24')],{'value':_0x2113d2[_0x623c('0x20')]});if(_['isNil'](_0x4ad44a)){recordings[_0x2113d2[_0x623c('0x11')]]['monitors'][_0x623c('0x25')]({'value':_0x2113d2[_0x623c('0x20')]});}}}}catch(_0x5c033f){utils[_0x623c('0x19')](util[_0x623c('0x4')](_0x623c('0x1e'),_0x2113d2[_0x623c('0x10')]),_0x5c033f);}};exports[_0x623c('0x26')]=function(_0x3b47d7){try{if(!_[_0x623c('0x17')](recordings[_0x3b47d7[_0x623c('0x10')]])){utils[_0x623c('0xe')](util[_0x623c('0x4')](_0x623c('0x27'),_0x3b47d7[_0x623c('0x10')]),_0x3b47d7);utils[_0x623c('0x3')](util[_0x623c('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3b47d7['uniqueid'],_0x3b47d7[_0x623c('0x28')],_0x3b47d7['calleridname'],_0x3b47d7[_0x623c('0x29')]));recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x28')]=_0x3b47d7[_0x623c('0x28')];recordings[_0x3b47d7[_0x623c('0x10')]]['calleridname']=_0x3b47d7[_0x623c('0x2a')];recordings[_0x3b47d7[_0x623c('0x10')]]['connectedlinenum']=_0x3b47d7[_0x623c('0x2b')];recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x2c')]=_0x3b47d7[_0x623c('0x2c')];if(recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x2d')]=='outbound'&&recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x6')]){recordings[_0x3b47d7['uniqueid']][_0x623c('0x2b')]=recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x6')];recordings[_0x3b47d7[_0x623c('0x10')]][_0x623c('0x2c')]='';}recordings[_0x3b47d7['uniqueid']][_0x623c('0x24')][_0x623c('0x2e')](function(_0x12f2b9){var _0xd3b71f=_[_0x623c('0x2f')](recordings[_0x3b47d7[_0x623c('0x10')]]);_0xd3b71f['value']=_0x12f2b9[_0x623c('0x20')];writeDB(_0xd3b71f);});delete recordings[_0x3b47d7['uniqueid']];}}catch(_0x107602){utils['error'](util[_0x623c('0x4')](_0x623c('0x27'),_0x3b47d7['uniqueid']),_0x107602);}};exports['newexten']=function(_0x3f05d1){try{if(!_['isNil'](recordings[_0x3f05d1[_0x623c('0x10')]])){utils['debug'](util['format'](_0x623c('0x30'),_0x3f05d1[_0x623c('0x10')]),_0x3f05d1);utils[_0x623c('0x3')](util[_0x623c('0x4')](_0x623c('0x31'),_0x3f05d1[_0x623c('0x10')],_0x3f05d1[_0x623c('0x32')],_0x3f05d1[_0x623c('0x33')]));if(_0x3f05d1[_0x623c('0x32')][_0x623c('0x34')]()=='set'&&_['startsWith'](_0x3f05d1[_0x623c('0x33')][_0x623c('0x34')](),_0x623c('0x35'))){var _0x3405a8=_0x3f05d1[_0x623c('0x33')][_0x623c('0x36')]('=');var _0x96a38a=_0x3405a8[0x0]['substring'](_0x3405a8[0x0][_0x623c('0x37')]('(')+0x1,_0x3405a8[0x0]['lastIndexOf'](')'));var _0x10f31b=_0x3405a8[0x1];recordings[_0x3f05d1[_0x623c('0x10')]][_0x96a38a]=_0x10f31b;}}}catch(_0x5b5d02){utils['error'](util['format'](_0x623c('0x30'),_0x3f05d1[_0x623c('0x10')]),_0x5b5d02);}};exports[_0x623c('0x38')]=function(_0x2c88cb){try{if(!_['isNil'](recordings[_0x2c88cb[_0x623c('0x10')]])){utils[_0x623c('0xe')](util[_0x623c('0x4')](_0x623c('0x39'),_0x2c88cb[_0x623c('0x10')]),_0x2c88cb);utils['info'](util[_0x623c('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x2c88cb[_0x623c('0x10')],_0x2c88cb[_0x623c('0x3a')]));recordings[_0x2c88cb[_0x623c('0x10')]][_0x623c('0x3a')]=_0x2c88cb['queue'];}}catch(_0x1eb32f){utils[_0x623c('0x19')](util[_0x623c('0x4')]('[%s][recordings][queuecallerjoin]',_0x2c88cb[_0x623c('0x10')]),_0x1eb32f);}}; \ No newline at end of file +var _0x9eff=['uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','debug','[%s][recordings][newstate]','channelstate','channel','isNil','linkedid','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','application','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]'];(function(_0x366e51,_0x3a0178){var _0x4e23e3=function(_0x7ecebe){while(--_0x7ecebe){_0x366e51['push'](_0x366e51['shift']());}};_0x4e23e3(++_0x3a0178);}(_0x9eff,0x1a5));var _0xf9ef=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x9eff[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xf9ef('0x0'));var util=require(_0xf9ef('0x1'));var utils=require(_0xf9ef('0x2'));var recordings={};function writeDB(_0x4cd107){utils[_0xf9ef('0x3')](util[_0xf9ef('0x4')](_0xf9ef('0x5'),_0x4cd107[_0xf9ef('0x6')]));if(_0x4cd107[_0xf9ef('0x7')]){utils[_0xf9ef('0x8')](_0x4cd107[_0xf9ef('0x7')])[_0xf9ef('0x9')](function(_0x31b53d){if(_0x31b53d){_0x4cd107[_0xf9ef('0xa')]=_0x31b53d[_0xf9ef('0xb')];_0x4cd107[_0xf9ef('0xc')]=_0x31b53d['id'];}utils['request'](_0xf9ef('0xd'),_0x4cd107);});}else{utils[_0xf9ef('0xe')](_0xf9ef('0xd'),_0x4cd107);}}exports['newchannel']=function(_0x3e28ef){try{utils['debug'](util['format'](_0xf9ef('0xf'),_0x3e28ef[_0xf9ef('0x6')]),_0x3e28ef);if(_0x3e28ef[_0xf9ef('0x6')]==_0x3e28ef['linkedid']){utils[_0xf9ef('0x3')](util[_0xf9ef('0x4')](_0xf9ef('0x10'),_0x3e28ef[_0xf9ef('0x6')],_0x3e28ef[_0xf9ef('0x11')],_0x3e28ef[_0xf9ef('0x12')]));recordings[_0x3e28ef[_0xf9ef('0x6')]]={'uniqueid':_0x3e28ef[_0xf9ef('0x6')],'accountcode':_0x3e28ef[_0xf9ef('0x7')],'exten':_0x3e28ef[_0xf9ef('0x12')],'context':_0x3e28ef['context'],'channel':_0x3e28ef['channel'],'monitors':[]};}}catch(_0x4b8442){utils[_0xf9ef('0x13')](util['format'](_0xf9ef('0xf'),_0x3e28ef[_0xf9ef('0x6')]),_0x4b8442);}};exports['newstate']=function(_0x5901d2){try{utils[_0xf9ef('0x14')](util[_0xf9ef('0x4')](_0xf9ef('0x15'),_0x5901d2['uniqueid']),_0x5901d2);if(!_['isNil'](recordings[_0x5901d2[_0xf9ef('0x6')]])&&_0x5901d2[_0xf9ef('0x16')]==0x6){utils[_0xf9ef('0x3')](util[_0xf9ef('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x5901d2[_0xf9ef('0x6')],_0x5901d2['context'],_0x5901d2[_0xf9ef('0x17')]));}else if(!_[_0xf9ef('0x18')](recordings[_0x5901d2[_0xf9ef('0x19')]])&&_0x5901d2['channelstate']==0x6&&_0x5901d2[_0xf9ef('0x11')]!=_0xf9ef('0x1a')){utils[_0xf9ef('0x3')](util[_0xf9ef('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5901d2[_0xf9ef('0x6')],_0x5901d2[_0xf9ef('0x19')],_0x5901d2[_0xf9ef('0x11')],_0x5901d2[_0xf9ef('0x17')]));recordings[_0x5901d2[_0xf9ef('0x19')]][_0xf9ef('0x7')]=_0x5901d2[_0xf9ef('0x7')];}}catch(_0x6042cb){utils[_0xf9ef('0x13')](util[_0xf9ef('0x4')](_0xf9ef('0x15'),_0x5901d2['uniqueid']),_0x6042cb);}};exports[_0xf9ef('0x1b')]=function(_0x3fe0b5){try{if(!_[_0xf9ef('0x18')](_0x3fe0b5[_0xf9ef('0x1c')])&&!_[_0xf9ef('0x18')](_0x3fe0b5[_0xf9ef('0x1c')][_0xf9ef('0x1d')])){utils[_0xf9ef('0x14')](util[_0xf9ef('0x4')](_0xf9ef('0x1e'),_0x3fe0b5['uniqueid']),_0x3fe0b5);utils[_0xf9ef('0x3')](util[_0xf9ef('0x4')](_0xf9ef('0x1f'),_0x3fe0b5[_0xf9ef('0x6')],_0x3fe0b5['variable'],_0x3fe0b5[_0xf9ef('0x20')]));if(_[_0xf9ef('0x21')](_0x3fe0b5[_0xf9ef('0x20')],_0xf9ef('0x22'))){_0x3fe0b5[_0xf9ef('0x20')]=_0x3fe0b5[_0xf9ef('0x20')][_0xf9ef('0x23')](_0xf9ef('0x22'),'.WAV');}if(recordings[_0x3fe0b5[_0xf9ef('0x19')]]){var _0x140dd3=_['find'](recordings[_0x3fe0b5['linkedid']][_0xf9ef('0x24')],{'value':_0x3fe0b5['value']});if(_[_0xf9ef('0x18')](_0x140dd3)){recordings[_0x3fe0b5[_0xf9ef('0x19')]][_0xf9ef('0x24')]['push']({'value':_0x3fe0b5[_0xf9ef('0x20')]});}}}}catch(_0x131d0f){utils[_0xf9ef('0x13')](util[_0xf9ef('0x4')](_0xf9ef('0x1e'),_0x3fe0b5[_0xf9ef('0x6')]),_0x131d0f);}};exports[_0xf9ef('0x25')]=function(_0x3d92c4){try{if(!_[_0xf9ef('0x18')](recordings[_0x3d92c4[_0xf9ef('0x6')]])){utils[_0xf9ef('0x14')](util[_0xf9ef('0x4')]('[%s][recordings][hangup]',_0x3d92c4[_0xf9ef('0x6')]),_0x3d92c4);utils[_0xf9ef('0x3')](util[_0xf9ef('0x4')](_0xf9ef('0x26'),_0x3d92c4[_0xf9ef('0x6')],_0x3d92c4[_0xf9ef('0x27')],_0x3d92c4[_0xf9ef('0x28')],_0x3d92c4[_0xf9ef('0x29')]));recordings[_0x3d92c4[_0xf9ef('0x6')]][_0xf9ef('0x27')]=_0x3d92c4[_0xf9ef('0x27')];recordings[_0x3d92c4[_0xf9ef('0x6')]][_0xf9ef('0x28')]=_0x3d92c4[_0xf9ef('0x28')];recordings[_0x3d92c4[_0xf9ef('0x6')]][_0xf9ef('0x2a')]=_0x3d92c4['connectedlinenum'];recordings[_0x3d92c4['uniqueid']]['connectedlinename']=_0x3d92c4[_0xf9ef('0x2b')];if(recordings[_0x3d92c4['uniqueid']][_0xf9ef('0x2c')]==_0xf9ef('0x2d')&&recordings[_0x3d92c4[_0xf9ef('0x6')]]['accountcode']){recordings[_0x3d92c4['uniqueid']][_0xf9ef('0x2a')]=recordings[_0x3d92c4[_0xf9ef('0x6')]]['accountcode'];recordings[_0x3d92c4[_0xf9ef('0x6')]][_0xf9ef('0x2b')]='';}recordings[_0x3d92c4[_0xf9ef('0x6')]][_0xf9ef('0x24')][_0xf9ef('0x2e')](function(_0xe8a5bf){var _0x2cc346=_[_0xf9ef('0x2f')](recordings[_0x3d92c4['uniqueid']]);_0x2cc346[_0xf9ef('0x20')]=_0xe8a5bf[_0xf9ef('0x20')];writeDB(_0x2cc346);});delete recordings[_0x3d92c4['uniqueid']];}}catch(_0x4341e8){utils['error'](util[_0xf9ef('0x4')](_0xf9ef('0x30'),_0x3d92c4[_0xf9ef('0x6')]),_0x4341e8);}};exports['newexten']=function(_0x117f1f){try{if(!_['isNil'](recordings[_0x117f1f[_0xf9ef('0x6')]])){utils[_0xf9ef('0x14')](util[_0xf9ef('0x4')](_0xf9ef('0x31'),_0x117f1f[_0xf9ef('0x6')]),_0x117f1f);utils['info'](util[_0xf9ef('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x117f1f[_0xf9ef('0x6')],_0x117f1f[_0xf9ef('0x32')],_0x117f1f['appdata']));if(_0x117f1f[_0xf9ef('0x32')][_0xf9ef('0x33')]()==_0xf9ef('0x34')&&_[_0xf9ef('0x35')](_0x117f1f['appdata'][_0xf9ef('0x33')](),_0xf9ef('0x36'))){var _0x1fef4d=_0x117f1f['appdata']['split']('=');var _0x2317d8=_0x1fef4d[0x0][_0xf9ef('0x37')](_0x1fef4d[0x0][_0xf9ef('0x38')]('(')+0x1,_0x1fef4d[0x0][_0xf9ef('0x38')](')'));var _0x4093c2=_0x1fef4d[0x1];recordings[_0x117f1f[_0xf9ef('0x6')]][_0x2317d8]=_0x4093c2;}}}catch(_0x461520){utils[_0xf9ef('0x13')](util[_0xf9ef('0x4')](_0xf9ef('0x31'),_0x117f1f[_0xf9ef('0x6')]),_0x461520);}};exports[_0xf9ef('0x39')]=function(_0x12538a){try{if(!_['isNil'](recordings[_0x12538a['uniqueid']])){utils[_0xf9ef('0x14')](util[_0xf9ef('0x4')](_0xf9ef('0x3a'),_0x12538a[_0xf9ef('0x6')]),_0x12538a);utils[_0xf9ef('0x3')](util['format'](_0xf9ef('0x3b'),_0x12538a['uniqueid'],_0x12538a['queue']));recordings[_0x12538a[_0xf9ef('0x6')]]['queue']=_0x12538a[_0xf9ef('0x3c')];}}catch(_0x465c8d){utils[_0xf9ef('0x13')](util[_0xf9ef('0x4')](_0xf9ef('0x3a'),_0x12538a[_0xf9ef('0x6')]),_0x465c8d);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index d6afe92..8f77ca8 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 _0xc996=['error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','blind','transfereruniqueid'];(function(_0x2d8a9d,_0x2b39fc){var _0x1b924d=function(_0x24800c){while(--_0x24800c){_0x2d8a9d['push'](_0x2d8a9d['shift']());}};_0x1b924d(++_0x2b39fc);}(_0xc996,0x171));var _0x6c99=function(_0x2ba904,_0x5585c4){_0x2ba904=_0x2ba904-0x0;var _0x4641a9=_0xc996[_0x2ba904];return _0x4641a9;};'use strict';var _=require(_0x6c99('0x0'));var util=require(_0x6c99('0x1'));var utils=require(_0x6c99('0x2'));function writeDB(_0x3e8815){utils[_0x6c99('0x3')](util[_0x6c99('0x4')](_0x6c99('0x5'),_0x3e8815[_0x6c99('0x6')]===_0x6c99('0x7')?_0x3e8815['origtransfereruniqueid']:_0x3e8815[_0x6c99('0x8')],_0x3e8815[_0x6c99('0x6')]));utils['request'](_0x6c99('0x9'),_0x3e8815);}exports[_0x6c99('0xa')]={};exports[_0x6c99('0xb')]=function(_0x54204e){try{utils[_0x6c99('0xc')](util['format'](_0x6c99('0xd'),_0x54204e['uniqueid']),_0x54204e);utils['info'](util[_0x6c99('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x54204e[_0x6c99('0x8')],_0x54204e[_0x6c99('0xe')],_0x54204e['transferercalleridname'],_0x54204e[_0x6c99('0xf')],_0x54204e['transfereecalleridname']));_0x54204e[_0x6c99('0x6')]=_0x6c99('0x10');exports['blinds'][_0x54204e[_0x6c99('0x11')]]=_0x54204e;writeDB(_0x54204e);}catch(_0x4d7e0b){utils[_0x6c99('0x12')](util[_0x6c99('0x4')](_0x6c99('0xd'),_0x54204e[_0x6c99('0x8')]),_0x4d7e0b);}};exports[_0x6c99('0x13')]=function(_0x57be22){try{utils[_0x6c99('0xc')](util[_0x6c99('0x4')](_0x6c99('0x14'),_0x57be22[_0x6c99('0x15')]),_0x57be22);utils[_0x6c99('0x3')](util[_0x6c99('0x4')](_0x6c99('0x16'),_0x57be22['origtransfereruniqueid'],_0x57be22[_0x6c99('0x17')],_0x57be22[_0x6c99('0x18')],_0x57be22[_0x6c99('0x19')],_0x57be22['transfertargetcalleridname']));_0x57be22=_[_0x6c99('0x1a')](_0x57be22,{'transfererchannel':_0x57be22[_0x6c99('0x1b')],'transferercalleridnum':_0x57be22[_0x6c99('0x17')],'transferercalleridname':_0x57be22[_0x6c99('0x18')],'transfererconnectedlinenum':_0x57be22[_0x6c99('0x1c')],'transfererconnectedlinename':_0x57be22[_0x6c99('0x1d')],'transfereraccountcode':_0x57be22[_0x6c99('0x1e')],'transferercontext':_0x57be22[_0x6c99('0x1f')],'transfererexten':_0x57be22[_0x6c99('0x20')],'transfererlinkedid':_0x57be22[_0x6c99('0x21')],'context':_0x57be22[_0x6c99('0x22')],'extension':_0x57be22[_0x6c99('0x23')],'type':_0x6c99('0x7')});if(_[_0x6c99('0x24')](_0x57be22['transfereechannel'])){_0x57be22=_[_0x6c99('0x1a')](_0x57be22,{'transfereechannel':_0x57be22['transfertargetchannel'],'transfereecalleridnum':_0x57be22['transfertargetcalleridnum'],'transfereecalleridname':_0x57be22['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x57be22[_0x6c99('0x25')],'transfereeconnectedlinename':_0x57be22[_0x6c99('0x26')],'transfereeaccountcode':_0x57be22[_0x6c99('0x27')],'transfereecontext':_0x57be22[_0x6c99('0x28')],'transfereeexten':_0x57be22[_0x6c99('0x29')],'transfereelinkedid':_0x57be22[_0x6c99('0x2a')]});}writeDB(_0x57be22);}catch(_0x28e967){utils[_0x6c99('0x12')](util[_0x6c99('0x4')](_0x6c99('0x14'),_0x57be22[_0x6c99('0x15')]),_0x28e967);}}; \ No newline at end of file +var _0x4519=['isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x4519,0x19f));var _0x9451=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4519[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9451('0x0'));var util=require(_0x9451('0x1'));var utils=require(_0x9451('0x2'));function writeDB(_0x17d04c){utils[_0x9451('0x3')](util[_0x9451('0x4')](_0x9451('0x5'),_0x17d04c[_0x9451('0x6')]===_0x9451('0x7')?_0x17d04c[_0x9451('0x8')]:_0x17d04c[_0x9451('0x9')],_0x17d04c['type']));utils[_0x9451('0xa')](_0x9451('0xb'),_0x17d04c);}exports['blinds']={};exports[_0x9451('0xc')]=function(_0x3d500d){try{utils['debug'](util['format'](_0x9451('0xd'),_0x3d500d[_0x9451('0x9')]),_0x3d500d);utils[_0x9451('0x3')](util[_0x9451('0x4')](_0x9451('0xe'),_0x3d500d[_0x9451('0x9')],_0x3d500d[_0x9451('0xf')],_0x3d500d[_0x9451('0x10')],_0x3d500d['transfereecalleridnum'],_0x3d500d[_0x9451('0x11')]));_0x3d500d['type']=_0x9451('0x12');exports['blinds'][_0x3d500d['transfereruniqueid']]=_0x3d500d;writeDB(_0x3d500d);}catch(_0x2e9d28){utils['error'](util[_0x9451('0x4')]('[%s][transfers][blindtransfer]',_0x3d500d[_0x9451('0x9')]),_0x2e9d28);}};exports[_0x9451('0x13')]=function(_0x5c4570){try{utils[_0x9451('0x14')](util[_0x9451('0x4')](_0x9451('0x15'),_0x5c4570[_0x9451('0x8')]),_0x5c4570);utils[_0x9451('0x3')](util[_0x9451('0x4')](_0x9451('0x16'),_0x5c4570[_0x9451('0x8')],_0x5c4570[_0x9451('0x17')],_0x5c4570['origtransferercalleridname'],_0x5c4570[_0x9451('0x18')],_0x5c4570['transfertargetcalleridname']));_0x5c4570=_[_0x9451('0x19')](_0x5c4570,{'transfererchannel':_0x5c4570[_0x9451('0x1a')],'transferercalleridnum':_0x5c4570[_0x9451('0x17')],'transferercalleridname':_0x5c4570['origtransferercalleridname'],'transfererconnectedlinenum':_0x5c4570[_0x9451('0x1b')],'transfererconnectedlinename':_0x5c4570[_0x9451('0x1c')],'transfereraccountcode':_0x5c4570[_0x9451('0x1d')],'transferercontext':_0x5c4570[_0x9451('0x1e')],'transfererexten':_0x5c4570[_0x9451('0x1f')],'transfererlinkedid':_0x5c4570[_0x9451('0x20')],'context':_0x5c4570[_0x9451('0x21')],'extension':_0x5c4570[_0x9451('0x22')],'type':_0x9451('0x7')});if(_[_0x9451('0x23')](_0x5c4570[_0x9451('0x24')])){_0x5c4570=_['assign'](_0x5c4570,{'transfereechannel':_0x5c4570[_0x9451('0x25')],'transfereecalleridnum':_0x5c4570['transfertargetcalleridnum'],'transfereecalleridname':_0x5c4570[_0x9451('0x26')],'transfereeconnectedlinenum':_0x5c4570[_0x9451('0x27')],'transfereeconnectedlinename':_0x5c4570[_0x9451('0x28')],'transfereeaccountcode':_0x5c4570['transfertargetaccountcode'],'transfereecontext':_0x5c4570[_0x9451('0x29')],'transfereeexten':_0x5c4570[_0x9451('0x2a')],'transfereelinkedid':_0x5c4570[_0x9451('0x2b')]});}writeDB(_0x5c4570);}catch(_0x3ae06a){utils[_0x9451('0x2c')](util[_0x9451('0x4')]('[%s][transfers][attendedtransfer]',_0x5c4570[_0x9451('0x8')]),_0x3ae06a);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 458886a..5af41a7 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 _0xacf6=['getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','format','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','request','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xacf6,0x6d));var _0x6acf=function(_0x2f386b,_0x1ff02d){_0x2f386b=_0x2f386b-0x0;var _0x2b3eea=_0xacf6[_0x2f386b];return _0x2b3eea;};'use strict';var BPromise=require(_0x6acf('0x0'));var jayson=require(_0x6acf('0x1'));var moment=require(_0x6acf('0x2'));var util=require(_0x6acf('0x3'));var client=jayson[_0x6acf('0x4')][_0x6acf('0x5')]({'port':0x2329});var logger=require(_0x6acf('0x6'))('xdr');exports[_0x6acf('0x7')]=function(_0x49996a,_0x4de83e){logger[_0x6acf('0x7')](_0x49996a,_0x4de83e?util[_0x6acf('0x8')](_0x4de83e,{'showHidden':![],'depth':null}):'');};exports[_0x6acf('0x9')]=function(_0x346df5,_0xa0b349){logger['debug'](_0x346df5,_0xa0b349?util['inspect'](_0xa0b349,{'showHidden':![],'depth':null}):'');};exports[_0x6acf('0xa')]=function(_0x3fc6ba,_0x46502a){logger[_0x6acf('0xa')](_0x3fc6ba,_0x46502a?util[_0x6acf('0x8')](_0x46502a,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x108a1f,_0x4e9b4e){return client['request'](_0x108a1f,{'body':_0x4e9b4e})[_0x6acf('0xb')](function(_0x3f3150){logger[_0x6acf('0x9')](_0x6acf('0xc'),_0x108a1f,_0x3f3150?util[_0x6acf('0x8')](_0x3f3150,{'showHidden':![],'depth':null}):'');})[_0x6acf('0xd')](function(_0x3eafdd){logger['error']('[utils][request]\x20name:%s',_0x108a1f,_0x3eafdd?util[_0x6acf('0x8')](_0x3eafdd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x31f239){return client[_0x6acf('0xe')](_0x6acf('0xf'),{'options':{'raw':!![],'attributes':['id',_0x6acf('0x10'),_0x6acf('0x11'),_0x6acf('0x12')],'where':_0x31f239,'limit':0x1}})[_0x6acf('0xb')](function(_0x2c14b3){logger[_0x6acf('0x9')](_0x6acf('0x13'),JSON[_0x6acf('0x14')](_0x31f239),_0x2c14b3?util[_0x6acf('0x8')](_0x2c14b3,{'showHidden':![],'depth':null}):'');return _0x2c14b3[_0x6acf('0x15')][_0x6acf('0x16')]?_0x2c14b3[_0x6acf('0x15')][0x0]:null;});}exports[_0x6acf('0x17')]=function(_0x28e745){return new BPromise(function(_0xd32daf,_0x41d028){if(_0x28e745){return getUser({'internal':_0x28e745})[_0x6acf('0xb')](function(_0x34717d){logger[_0x6acf('0x7')](_0x6acf('0x18'),_0x28e745,_0x34717d?_0x6acf('0x19'):_0x6acf('0x1a'));return _0xd32daf(_0x34717d);})[_0x6acf('0xd')](function(_0x30ea7f){logger[_0x6acf('0xa')](_0x6acf('0x1b'),_0x30ea7f?util[_0x6acf('0x8')](_0x30ea7f,{'showHidden':![],'depth':null}):'');return _0xd32daf(null);});}return _0xd32daf(null);});};exports[_0x6acf('0x1c')]=function(_0x4fb1b2){return new BPromise(function(_0x50d896,_0x294d81){if(_0x4fb1b2){return getUser({'interface':_0x4fb1b2})[_0x6acf('0xb')](function(_0x21294d){logger[_0x6acf('0x7')](_0x6acf('0x1d'),_0x4fb1b2,_0x21294d?_0x6acf('0x19'):_0x6acf('0x1a'));return _0x50d896(_0x21294d);})['catch'](function(_0x219d0c){logger[_0x6acf('0xa')]('[utils][getUserByInterface]',_0x219d0c?util[_0x6acf('0x8')](_0x219d0c,{'showHidden':![],'depth':null}):'');return _0x50d896(null);});}return _0x50d896(null);});};exports['getUserByName']=function(_0x4297a6){return new BPromise(function(_0xca014d,_0x555aee){if(_0x4297a6){return getUser({'name':_0x4297a6})[_0x6acf('0xb')](function(_0x34a842){logger[_0x6acf('0x7')](_0x6acf('0x1e'),_0x4297a6,_0x34a842?_0x6acf('0x19'):_0x6acf('0x1a'));return _0xca014d(_0x34a842);})[_0x6acf('0xd')](function(_0x57bc99){logger[_0x6acf('0xa')](_0x6acf('0x1f'),_0x57bc99?util[_0x6acf('0x8')](_0x57bc99,{'showHidden':![],'depth':null}):'');return _0xca014d(null);});}return _0xca014d(null);});};exports[_0x6acf('0x20')]=function(_0x349704){return new BPromise(function(_0x41a83d,_0x64217b){if(_0x349704){return client[_0x6acf('0xe')](_0x6acf('0x21'),{'options':{'raw':!![],'attributes':['id','name',_0x6acf('0x22'),'acw','acwTimeout'],'where':{'name':_0x349704},'limit':0x1}})[_0x6acf('0xb')](function(_0x6fe279){logger[_0x6acf('0x9')](_0x6acf('0x23'),_0x349704,_0x6fe279?util[_0x6acf('0x8')](_0x6fe279,{'showHidden':![],'depth':null}):'');logger[_0x6acf('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x349704,_0x6fe279?_0x6acf('0x19'):_0x6acf('0x1a'));return _0x41a83d(_0x6fe279['result']['length']?_0x6fe279[_0x6acf('0x15')][0x0]:null);})[_0x6acf('0xd')](function(_0x515630){logger[_0x6acf('0xa')](_0x6acf('0x24'),_0x515630?util['inspect'](_0x515630,{'showHidden':![],'depth':null}):'');return _0x41a83d(null);});}return _0x41a83d(null);});};exports[_0x6acf('0x25')]=function(_0x7b8130,_0x47e7ab){return moment(_0x7b8130)['add'](_0x47e7ab,'seconds')['format'](_0x6acf('0x26'));};exports[_0x6acf('0x27')]=function(_0x83a28c,_0x4bff63){return moment(_0x83a28c)['subtract'](_0x4bff63,_0x6acf('0x28'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6acf('0x29')]=function(_0x28b21e,_0x339c23){return moment(_0x28b21e)[_0x6acf('0x2a')](moment(_0x339c23),_0x6acf('0x28'));};exports[_0x6acf('0x2b')]=function(_0x33fa30,_0x13ea16){return parseInt(_0x33fa30,0xa)+parseInt(_0x13ea16,0xa);};exports['now']=function(){return moment()[_0x6acf('0x2c')](_0x6acf('0x26'));};exports[_0x6acf('0x2d')]=function(_0x430164,_0x333ade){if(_0x333ade){return moment(_0x430164)[_0x6acf('0x2d')](_0x333ade);}return!![];};exports[_0x6acf('0x2e')]=function(_0xeea76,_0x29e763){if(_0x29e763){return moment(_0xeea76)[_0x6acf('0x2e')](_0x29e763);}else if(_0xeea76){return!![];}return![];}; \ No newline at end of file +var _0x1b94=['format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','internal','name','interface','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','type','acw','acwTimeout','addTime','seconds'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1b94,0x169));var _0x41b9=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x1b94[_0x2d34d6];return _0x1d3d12;};'use strict';var BPromise=require(_0x41b9('0x0'));var jayson=require(_0x41b9('0x1'));var moment=require('moment');var util=require(_0x41b9('0x2'));var client=jayson[_0x41b9('0x3')][_0x41b9('0x4')]({'port':0x2329});var logger=require(_0x41b9('0x5'))(_0x41b9('0x6'));exports[_0x41b9('0x7')]=function(_0x20d891,_0x4b9d90){logger[_0x41b9('0x7')](_0x20d891,_0x4b9d90?util[_0x41b9('0x8')](_0x4b9d90,{'showHidden':![],'depth':null}):'');};exports[_0x41b9('0x9')]=function(_0x26e742,_0x4d5a46){logger[_0x41b9('0x9')](_0x26e742,_0x4d5a46?util[_0x41b9('0x8')](_0x4d5a46,{'showHidden':![],'depth':null}):'');};exports[_0x41b9('0xa')]=function(_0x3bfb4b,_0x5c5dee){logger[_0x41b9('0xa')](_0x3bfb4b,_0x5c5dee?util[_0x41b9('0x8')](_0x5c5dee,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3d5354,_0x324671){return client[_0x41b9('0xb')](_0x3d5354,{'body':_0x324671})[_0x41b9('0xc')](function(_0x94094d){logger['debug'](_0x41b9('0xd'),_0x3d5354,_0x94094d?util['inspect'](_0x94094d,{'showHidden':![],'depth':null}):'');})[_0x41b9('0xe')](function(_0x506583){logger[_0x41b9('0xa')](_0x41b9('0xd'),_0x3d5354,_0x506583?util['inspect'](_0x506583,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2842fb){return client[_0x41b9('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x41b9('0xf'),_0x41b9('0x10'),_0x41b9('0x11')],'where':_0x2842fb,'limit':0x1}})['then'](function(_0x1e8088){logger[_0x41b9('0x9')]('[utils][getUser]\x20where:%s',JSON[_0x41b9('0x12')](_0x2842fb),_0x1e8088?util[_0x41b9('0x8')](_0x1e8088,{'showHidden':![],'depth':null}):'');return _0x1e8088['result'][_0x41b9('0x13')]?_0x1e8088[_0x41b9('0x14')][0x0]:null;});}exports[_0x41b9('0x15')]=function(_0x5675a7){return new BPromise(function(_0x1fba01,_0x151e7a){if(_0x5675a7){return getUser({'internal':_0x5675a7})[_0x41b9('0xc')](function(_0x568a32){logger[_0x41b9('0x7')](_0x41b9('0x16'),_0x5675a7,_0x568a32?_0x41b9('0x17'):_0x41b9('0x18'));return _0x1fba01(_0x568a32);})[_0x41b9('0xe')](function(_0x2e91dc){logger[_0x41b9('0xa')](_0x41b9('0x19'),_0x2e91dc?util[_0x41b9('0x8')](_0x2e91dc,{'showHidden':![],'depth':null}):'');return _0x1fba01(null);});}return _0x1fba01(null);});};exports[_0x41b9('0x1a')]=function(_0x4134cb){return new BPromise(function(_0x3b3082,_0x160199){if(_0x4134cb){return getUser({'interface':_0x4134cb})[_0x41b9('0xc')](function(_0xea5803){logger[_0x41b9('0x7')](_0x41b9('0x1b'),_0x4134cb,_0xea5803?_0x41b9('0x17'):'notfound');return _0x3b3082(_0xea5803);})[_0x41b9('0xe')](function(_0x341916){logger[_0x41b9('0xa')](_0x41b9('0x1c'),_0x341916?util[_0x41b9('0x8')](_0x341916,{'showHidden':![],'depth':null}):'');return _0x3b3082(null);});}return _0x3b3082(null);});};exports['getUserByName']=function(_0x2bbfa4){return new BPromise(function(_0x2c8deb,_0x2718c7){if(_0x2bbfa4){return getUser({'name':_0x2bbfa4})[_0x41b9('0xc')](function(_0x5f598e){logger[_0x41b9('0x7')](_0x41b9('0x1d'),_0x2bbfa4,_0x5f598e?_0x41b9('0x17'):'notfound');return _0x2c8deb(_0x5f598e);})[_0x41b9('0xe')](function(_0x1c98a6){logger['error']('[utils][getUserByName]',_0x1c98a6?util[_0x41b9('0x8')](_0x1c98a6,{'showHidden':![],'depth':null}):'');return _0x2c8deb(null);});}return _0x2c8deb(null);});};exports['getVoiceQueueByName']=function(_0x40c663){return new BPromise(function(_0x39b0e7,_0x3c8179){if(_0x40c663){return client[_0x41b9('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x41b9('0x10'),_0x41b9('0x1e'),_0x41b9('0x1f'),_0x41b9('0x20')],'where':{'name':_0x40c663},'limit':0x1}})['then'](function(_0x3db537){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x40c663,_0x3db537?util[_0x41b9('0x8')](_0x3db537,{'showHidden':![],'depth':null}):'');logger[_0x41b9('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x40c663,_0x3db537?_0x41b9('0x17'):_0x41b9('0x18'));return _0x39b0e7(_0x3db537['result'][_0x41b9('0x13')]?_0x3db537[_0x41b9('0x14')][0x0]:null);})['catch'](function(_0x5ea6f0){logger[_0x41b9('0xa')]('[utils][getVoiceQueueByName]',_0x5ea6f0?util[_0x41b9('0x8')](_0x5ea6f0,{'showHidden':![],'depth':null}):'');return _0x39b0e7(null);});}return _0x39b0e7(null);});};exports[_0x41b9('0x21')]=function(_0x13d873,_0xda8cb3){return moment(_0x13d873)['add'](_0xda8cb3,_0x41b9('0x22'))[_0x41b9('0x23')](_0x41b9('0x24'));};exports[_0x41b9('0x25')]=function(_0x29a9bb,_0x306c40){return moment(_0x29a9bb)[_0x41b9('0x26')](_0x306c40,'seconds')[_0x41b9('0x23')](_0x41b9('0x24'));};exports[_0x41b9('0x27')]=function(_0x3710a8,_0x54cd85){return moment(_0x3710a8)[_0x41b9('0x28')](moment(_0x54cd85),_0x41b9('0x22'));};exports['sumTime']=function(_0x257be3,_0x54253c){return parseInt(_0x257be3,0xa)+parseInt(_0x54253c,0xa);};exports[_0x41b9('0x29')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x41b9('0x2a')]=function(_0x1f247c,_0x500353){if(_0x500353){return moment(_0x1f247c)['isAfter'](_0x500353);}return!![];};exports[_0x41b9('0x2b')]=function(_0x5ad039,_0x5bf37e){if(_0x5bf37e){return moment(_0x5ad039)[_0x41b9('0x2b')](_0x5bf37e);}else if(_0x5ad039){return!![];}return![];}; \ No newline at end of file